UNPKG

donobu

Version:

Create browser automations with an LLM agent and replay them as Playwright scripts.

87 lines 4.52 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CreateDonobuFlowSchema = void 0; const v4_1 = require("zod/v4"); const BrowserConfig_1 = require("./BrowserConfig"); const FlowMetadata_1 = require("./FlowMetadata"); const ProposedToolCall_1 = require("./ProposedToolCall"); const RunMode_1 = require("./RunMode"); exports.CreateDonobuFlowSchema = v4_1.z .looseObject({ id: v4_1.z .string() .min(1) .max(128) .regex(/^[a-zA-Z0-9._:-]+$/) .optional() .describe(`⚠️ ADVANCED — DO NOT USE unless you have a specific reason. Pre-assigned flow ID. Useful only when the caller must know the ID before flow creation completes (e.g. orchestrators that pre-allocate IDs to track an in-flight execution). The SDK does a best-effort collision check against the persistence layer and throws FlowIdCollisionException if the ID already exists, but concurrent calls with the same ID are RACY: there is no locking, so two callers can both pass the check and create dueling rows. If you do not need this, omit it and let the SDK mint an ID.`), target: v4_1.z .string() .describe('The target type: "web", "mobile", or a plugin-provided target.'), // -- Target-specific config (keyed by target value) -- web: v4_1.z .object({ browser: BrowserConfig_1.BrowserConfigSchema.nullable().optional(), targetWebsite: v4_1.z.string(), }) .optional() .describe('Web target configuration. Required when target is "web".'), // Plugin-provided target configurations (e.g. mobile) flow through via // .passthrough() and are validated by the corresponding TargetRuntimePlugin. // -- Target-invariant fields -- name: v4_1.z .string() .max(256) .nullable() .optional() .describe('The name for this Donobu flow; if present, must be fewer than 256 characters'), envVars: FlowMetadata_1.FlowMetadataSchema.shape.envVars.nullable().optional(), customTools: FlowMetadata_1.FlowMetadataSchema.shape.customTools.nullable().optional(), defaultMessageDuration: FlowMetadata_1.FlowMetadataSchema.shape.defaultMessageDuration .nullable() .optional(), callbackUrl: FlowMetadata_1.FlowMetadataSchema.shape.callbackUrl.nullable().optional(), overallObjective: FlowMetadata_1.FlowMetadataSchema.shape.overallObjective .nullable() .optional() .describe(`The overall objective to pursue; can only be omitted if initialRunMode has an effective value of ${RunMode_1.RunModeSchema.enum.INSTRUCT} or ${RunMode_1.RunModeSchema.enum.DETERMINISTIC}`), allowedTools: FlowMetadata_1.FlowMetadataSchema.shape.allowedTools.nullable().optional(), maxToolCalls: FlowMetadata_1.FlowMetadataSchema.shape.maxToolCalls.nullable().optional() .describe(`Set the maximum number of actions that can be taken in a flow. This setting is only used if the initialRunMode has an effective value of ${RunMode_1.RunModeSchema.enum.AUTONOMOUS}.`), resultJsonSchema: FlowMetadata_1.FlowMetadataSchema.shape.resultJsonSchema .nullable() .optional(), videoDisabled: FlowMetadata_1.FlowMetadataSchema.shape.videoDisabled, // -- Fields specific to creation that do not exist in FlowMetadata -- gptConfigNameOverride: v4_1.z .string() .nullable() .optional() .describe(`The name of a specific GPT configuration to use. If the corresponding GPT configuration is not defined or unresolvable, the default flow agent configuration will be used`), initialRunMode: FlowMetadata_1.FlowMetadataSchema.shape.runMode.nullable().optional(), isControlPanelEnabled: FlowMetadata_1.FlowMetadataSchema.shape.isControlPanelEnabled .nullable() .optional() .describe('Set to true if the control panel should be enabled. If the headless parameter is true, then this parameter is ignored'), toolCallsOnStart: v4_1.z .array(ProposedToolCall_1.ProposedToolCallSchema) .nullable() .optional() .describe('An ordered series of tool calls to invoke when starting the flow'), testId: v4_1.z .string() .optional() .describe('The ID of the test that this flow is associated with. Only optional to support legacy flow creation scenarios.'), }) .describe('This is the expected payload for a request to create a new Donobu flow'); //# sourceMappingURL=CreateDonobuFlow.js.map