UNPKG

donobu

Version:

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

31 lines 1.39 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SetRunModeTool = exports.SetRunModeGptSchema = exports.SetRunModeCoreSchema = void 0; const v4_1 = require("zod/v4"); const RunMode_1 = require("../models/RunMode"); const ToolCallResult_1 = require("../models/ToolCallResult"); const ToolSchema_1 = require("../models/ToolSchema"); const Tool_1 = require("./Tool"); exports.SetRunModeCoreSchema = v4_1.z.object({ runMode: RunMode_1.RunModeSchema.describe('The value of the run mode to set.'), }); exports.SetRunModeGptSchema = v4_1.z.object({ ...ToolSchema_1.BaseGptArgsSchema.shape, ...exports.SetRunModeCoreSchema.shape, }); class SetRunModeTool extends Tool_1.Tool { constructor() { super(SetRunModeTool.NAME, `Set the run mode of this Donobu Flow, so that it can be controlled by Donobu (i.e. 'AUTONOMOUS' runMode), or be controlled by the user (i.e. 'INSTRUCT' runMode).`, exports.SetRunModeCoreSchema, exports.SetRunModeGptSchema, true); } async call(context, parameters) { context.metadata.runMode = parameters.runMode; return ToolCallResult_1.ToolCallResult.successful(); } async callFromGpt(context, parameters) { return this.call(context, parameters); } } exports.SetRunModeTool = SetRunModeTool; SetRunModeTool.NAME = 'setRunMode'; //# sourceMappingURL=SetRunModeTool.js.map