donobu
Version:
Create browser automations with an LLM agent and replay them as Playwright scripts.
47 lines • 1.88 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CreateTestSchema = void 0;
const v4_1 = require("zod/v4");
const BrowserConfig_1 = require("./BrowserConfig");
const RunConfig_1 = require("./RunConfig");
const RunMode_1 = require("./RunMode");
/**
* Payload for creating a new test. Uses the RunConfig fields (all made
* nullable/optional for creation) plus test-specific fields like suiteId
* and nextRunMode.
*/
exports.CreateTestSchema = RunConfig_1.RunConfigSchema.partial()
.extend({
target: v4_1.z
.string()
.describe('The target type: "web", "mobile", or a plugin-provided target.'),
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".'),
name: v4_1.z
.string()
.max(256)
.nullable()
.optional()
.describe('The name for this test.'),
suiteId: v4_1.z
.string()
.nullable()
.optional()
.describe('The ID of the suite to add this test to.'),
nextRunMode: RunMode_1.RunModeSchema.nullable()
.optional()
.describe('The run mode to use when creating flows from this test. Defaults to AUTONOMOUS.'),
// `allowedTools` is the only field in RunConfig that isn't already
// nullable at the base, so `.partial()` above only adds `.optional()`
// (accepts `undefined`, not `null`). Manual-test creation sends `null`
// here — mirror the nullable override that CreateDonobuFlowSchema uses
// so the two creation endpoints accept the same payload shape.
allowedTools: RunConfig_1.RunConfigSchema.shape.allowedTools.nullable().optional(),
})
.loose();
//# sourceMappingURL=CreateTest.js.map