remove eval

This commit is contained in:
Arjun 2026-05-06 12:17:21 +05:30
parent b9a62f6662
commit 629df2d83a
4 changed files with 2 additions and 85 deletions

View file

@ -51,7 +51,6 @@ export const BrowserControlActionSchema = z.enum([
'press',
'scroll',
'wait',
'eval',
]);
const BrowserElementTargetFields = {
@ -71,7 +70,6 @@ export const BrowserControlInputSchema = z.object({
ms: z.number().int().positive().max(30000).optional(),
maxElements: z.number().int().positive().max(100).optional(),
maxTextLength: z.number().int().positive().max(20000).optional(),
code: z.string().min(1).max(50000).optional(),
...BrowserElementTargetFields,
}).strict().superRefine((value, ctx) => {
const needsElementTarget = value.action === 'click' || value.action === 'type';
@ -116,14 +114,6 @@ export const BrowserControlInputSchema = z.object({
message: 'Provide an element index or selector.',
});
}
if (value.action === 'eval' && !value.code) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
path: ['code'],
message: 'code is required for eval.',
});
}
});
export const SuggestedBrowserSkillSchema = z.object({
@ -139,7 +129,6 @@ export const BrowserControlResultSchema = z.object({
error: z.string().optional(),
browser: BrowserStateSchema,
page: BrowserPageSnapshotSchema.optional(),
result: z.unknown().optional(),
suggestedSkills: z.array(SuggestedBrowserSkillSchema).optional(),
});