donobu
Version:
Create browser automations with an LLM agent and replay them as Playwright scripts.
143 lines • 7 kB
TypeScript
import type { ElementHandle } from 'playwright';
import { z } from 'zod/v4';
import type { ToolCallContext } from '../models/ToolCallContext';
import { ReplayableInteraction } from './ReplayableInteraction';
export declare const FAKER_DATA_TYPES: readonly ["person.fullName", "person.firstName", "person.lastName", "person.jobTitle", "person.jobArea", "internet.email", "internet.username", "internet.password", "internet.url", "internet.domainName", "internet.ipv4", "phone.number", "location.streetAddress", "location.city", "location.state", "location.country", "location.zipCode", "company.name", "company.catchPhrase", "finance.accountNumber", "finance.creditCardNumber", "finance.currencyCode", "date.birthdate", "date.past", "date.future", "lorem.word", "lorem.sentence", "lorem.paragraph", "number.int", "string.uuid", "string.alphanumeric", "color.human"];
export type FakerDataType = (typeof FAKER_DATA_TYPES)[number];
export declare const InputFakerCoreSchema: z.ZodObject<{
dataType: z.ZodEnum<{
"person.fullName": "person.fullName";
"person.firstName": "person.firstName";
"person.lastName": "person.lastName";
"person.jobTitle": "person.jobTitle";
"person.jobArea": "person.jobArea";
"internet.email": "internet.email";
"internet.username": "internet.username";
"internet.password": "internet.password";
"internet.url": "internet.url";
"internet.domainName": "internet.domainName";
"internet.ipv4": "internet.ipv4";
"phone.number": "phone.number";
"location.streetAddress": "location.streetAddress";
"location.city": "location.city";
"location.state": "location.state";
"location.country": "location.country";
"location.zipCode": "location.zipCode";
"company.name": "company.name";
"company.catchPhrase": "company.catchPhrase";
"finance.accountNumber": "finance.accountNumber";
"finance.creditCardNumber": "finance.creditCardNumber";
"finance.currencyCode": "finance.currencyCode";
"date.birthdate": "date.birthdate";
"date.past": "date.past";
"date.future": "date.future";
"lorem.word": "lorem.word";
"lorem.sentence": "lorem.sentence";
"lorem.paragraph": "lorem.paragraph";
"number.int": "number.int";
"string.uuid": "string.uuid";
"string.alphanumeric": "string.alphanumeric";
"color.human": "color.human";
}>;
append: z.ZodOptional<z.ZodBoolean>;
finalizeWithSubmit: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>;
export declare const InputFakerNonGptSchema: z.ZodObject<{
dataType: z.ZodEnum<{
"person.fullName": "person.fullName";
"person.firstName": "person.firstName";
"person.lastName": "person.lastName";
"person.jobTitle": "person.jobTitle";
"person.jobArea": "person.jobArea";
"internet.email": "internet.email";
"internet.username": "internet.username";
"internet.password": "internet.password";
"internet.url": "internet.url";
"internet.domainName": "internet.domainName";
"internet.ipv4": "internet.ipv4";
"phone.number": "phone.number";
"location.streetAddress": "location.streetAddress";
"location.city": "location.city";
"location.state": "location.state";
"location.country": "location.country";
"location.zipCode": "location.zipCode";
"company.name": "company.name";
"company.catchPhrase": "company.catchPhrase";
"finance.accountNumber": "finance.accountNumber";
"finance.creditCardNumber": "finance.creditCardNumber";
"finance.currencyCode": "finance.currencyCode";
"date.birthdate": "date.birthdate";
"date.past": "date.past";
"date.future": "date.future";
"lorem.word": "lorem.word";
"lorem.sentence": "lorem.sentence";
"lorem.paragraph": "lorem.paragraph";
"number.int": "number.int";
"string.uuid": "string.uuid";
"string.alphanumeric": "string.alphanumeric";
"color.human": "color.human";
}>;
append: z.ZodOptional<z.ZodBoolean>;
finalizeWithSubmit: z.ZodOptional<z.ZodBoolean>;
selector: z.ZodObject<{
element: z.ZodArray<z.ZodString>;
frame: z.ZodOptional<z.ZodNullable<z.ZodString>>;
}, z.core.$strip>;
}, z.core.$strip>;
export declare const InputFakerGptSchema: z.ZodObject<{
dataType: z.ZodEnum<{
"person.fullName": "person.fullName";
"person.firstName": "person.firstName";
"person.lastName": "person.lastName";
"person.jobTitle": "person.jobTitle";
"person.jobArea": "person.jobArea";
"internet.email": "internet.email";
"internet.username": "internet.username";
"internet.password": "internet.password";
"internet.url": "internet.url";
"internet.domainName": "internet.domainName";
"internet.ipv4": "internet.ipv4";
"phone.number": "phone.number";
"location.streetAddress": "location.streetAddress";
"location.city": "location.city";
"location.state": "location.state";
"location.country": "location.country";
"location.zipCode": "location.zipCode";
"company.name": "company.name";
"company.catchPhrase": "company.catchPhrase";
"finance.accountNumber": "finance.accountNumber";
"finance.creditCardNumber": "finance.creditCardNumber";
"finance.currencyCode": "finance.currencyCode";
"date.birthdate": "date.birthdate";
"date.past": "date.past";
"date.future": "date.future";
"lorem.word": "lorem.word";
"lorem.sentence": "lorem.sentence";
"lorem.paragraph": "lorem.paragraph";
"number.int": "number.int";
"string.uuid": "string.uuid";
"string.alphanumeric": "string.alphanumeric";
"color.human": "color.human";
}>;
append: z.ZodOptional<z.ZodBoolean>;
finalizeWithSubmit: z.ZodOptional<z.ZodBoolean>;
whyThisAnnotation: z.ZodString;
annotation: z.ZodString;
rationale: z.ZodString;
}, z.core.$strip>;
export declare class InputFakerTool extends ReplayableInteraction<typeof InputFakerCoreSchema, typeof InputFakerNonGptSchema, typeof InputFakerGptSchema> {
static readonly NAME = "inputFaker";
constructor();
invoke(context: ToolCallContext, parameters: z.infer<typeof InputFakerCoreSchema>, handles: {
target: ElementHandle<HTMLElement | SVGElement>;
label?: ElementHandle<HTMLElement | SVGElement>;
}): Promise<string>;
/**
* Generates a value for the given data type using Faker.js.
* Exported as a static method so the Playwright helper and code generator
* can call it directly without instantiating the tool.
*/
static generate(dataType: FakerDataType): string;
private clearField;
}
//# sourceMappingURL=InputFakerTool.d.ts.map