donobu
Version:
Create browser automations with an LLM agent and replay them as Playwright scripts.
36 lines • 1.88 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TriggerDonobuFlowTool = exports.TriggerDonobuFlowGptSchema = exports.TriggerDonobuFlowCoreSchema = void 0;
const v4_1 = require("zod/v4");
const CreateDonobuFlow_1 = require("../models/CreateDonobuFlow");
const ToolSchema_1 = require("../models/ToolSchema");
const Tool_1 = require("./Tool");
exports.TriggerDonobuFlowCoreSchema = v4_1.z.object({
donobuFlowParameters: CreateDonobuFlow_1.CreateDonobuFlowSchema.describe('The parameters to use for the new Donobu flow.'),
});
exports.TriggerDonobuFlowGptSchema = v4_1.z.object({
...ToolSchema_1.BaseGptArgsSchema.shape,
...exports.TriggerDonobuFlowCoreSchema.shape,
});
class TriggerDonobuFlowTool extends Tool_1.Tool {
constructor() {
super(TriggerDonobuFlowTool.NAME, `Trigger a new Donobu flow. Note that the new flow will only have the specific context given via the
"donobuFlowParameters" field and runs in its own distinct environment, so be detailed when
specifying this data! Critical fields are "overallObjective" and "resultJsonSchema".
The other fields may be ignored if they are not relevant to the flow.`, exports.TriggerDonobuFlowCoreSchema, exports.TriggerDonobuFlowGptSchema);
}
async call(context, parameters) {
const flowHandle = await context.flowsManager.createFlow(parameters.donobuFlowParameters);
return {
isSuccessful: true,
forLlm: `Successfully triggered a new Donobu flow with ID: ${flowHandle.donobuFlow.metadata.id}`,
metadata: flowHandle.donobuFlow.metadata,
};
}
async callFromGpt(context, parameters) {
return this.call(context, parameters);
}
}
exports.TriggerDonobuFlowTool = TriggerDonobuFlowTool;
TriggerDonobuFlowTool.NAME = 'triggerDonobuFlow';
//# sourceMappingURL=TriggerDonobuFlowTool.js.map