@n8n/instance-ai 1.10.2 → 1.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +128 -0
- package/dist/agent/instance-agent.js +8 -0
- package/dist/agent/instance-agent.js.map +1 -1
- package/dist/agent/shared-prompts.d.ts +1 -0
- package/dist/agent/shared-prompts.js +25 -0
- package/dist/agent/shared-prompts.js.map +1 -1
- package/dist/agent/sub-agent-debriefing.d.ts +8 -8
- package/dist/agent/system-prompt.d.ts +2 -0
- package/dist/agent/system-prompt.js +52 -93
- package/dist/agent/system-prompt.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/constants/max-steps.d.ts +0 -1
- package/dist/constants/max-steps.js +0 -1
- package/dist/constants/max-steps.js.map +1 -1
- package/dist/index.d.ts +123 -33
- package/dist/index.js +103 -96
- package/dist/index.js.map +1 -1
- package/dist/knowledge-base/build-templates-index.d.ts +12 -0
- package/dist/knowledge-base/build-templates-index.js +113 -0
- package/dist/knowledge-base/build-templates-index.js.map +1 -0
- package/dist/knowledge-base/extract-builder-templates-archive.d.ts +2 -0
- package/dist/knowledge-base/extract-builder-templates-archive.js +89 -0
- package/dist/knowledge-base/extract-builder-templates-archive.js.map +1 -0
- package/dist/knowledge-base/materialize-knowledge-base.d.ts +67 -0
- package/dist/knowledge-base/materialize-knowledge-base.js +186 -0
- package/dist/knowledge-base/materialize-knowledge-base.js.map +1 -0
- package/dist/mcp/mcp-client-manager.js +6 -1
- package/dist/mcp/mcp-client-manager.js.map +1 -1
- package/dist/parsers/pdf-parser.js +4 -0
- package/dist/parsers/pdf-parser.js.map +1 -1
- package/dist/planned-tasks/planned-task-service.d.ts +5 -1
- package/dist/planned-tasks/planned-task-service.js +29 -1
- package/dist/planned-tasks/planned-task-service.js.map +1 -1
- package/dist/runtime/run-state-registry.d.ts +8 -0
- package/dist/runtime/run-state-registry.js.map +1 -1
- package/dist/runtime/terminal-response-guard.d.ts +2 -1
- package/dist/runtime/terminal-response-guard.js +20 -0
- package/dist/runtime/terminal-response-guard.js.map +1 -1
- package/dist/skills/materialize-runtime-skills.d.ts +1 -7
- package/dist/skills/materialize-runtime-skills.js +96 -176
- package/dist/skills/materialize-runtime-skills.js.map +1 -1
- package/dist/storage/index.d.ts +1 -1
- package/dist/storage/planned-task-storage.js +1 -0
- package/dist/storage/planned-task-storage.js.map +1 -1
- package/dist/storage/terminal-outcome-storage.d.ts +2 -2
- package/dist/storage/workflow-loop-storage.d.ts +199 -70
- package/dist/storage/workflow-loop-storage.js +107 -0
- package/dist/storage/workflow-loop-storage.js.map +1 -1
- package/dist/stream/work-summary-accumulator.d.ts +6 -6
- package/dist/tools/attachments/parse-file.tool.d.ts +18 -18
- package/dist/tools/credentials.tool.d.ts +2 -5
- package/dist/tools/credentials.tool.js +2 -6
- package/dist/tools/credentials.tool.js.map +1 -1
- package/dist/tools/executions.tool.js +53 -7
- package/dist/tools/executions.tool.js.map +1 -1
- package/dist/tools/index.js +3 -9
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/nodes/node-search-engine.d.ts +2 -0
- package/dist/tools/nodes/node-search-engine.js +66 -7
- package/dist/tools/nodes/node-search-engine.js.map +1 -1
- package/dist/tools/nodes.tool.js +10 -3
- package/dist/tools/nodes.tool.js.map +1 -1
- package/dist/tools/orchestration/complete-checkpoint.tool.js +69 -0
- package/dist/tools/orchestration/complete-checkpoint.tool.js.map +1 -1
- package/dist/tools/orchestration/delegate.schemas.d.ts +5 -5
- package/dist/tools/orchestration/delegate.tool.js +1 -1
- package/dist/tools/orchestration/delegate.tool.js.map +1 -1
- package/dist/tools/orchestration/plan.tool.js +96 -60
- package/dist/tools/orchestration/plan.tool.js.map +1 -1
- package/dist/tools/orchestration/report-verification-verdict.tool.d.ts +9 -6
- package/dist/tools/orchestration/report-verification-verdict.tool.js +6 -1
- package/dist/tools/orchestration/report-verification-verdict.tool.js.map +1 -1
- package/dist/tools/orchestration/verify-built-workflow.tool.js +3 -2
- package/dist/tools/orchestration/verify-built-workflow.tool.js.map +1 -1
- package/dist/tools/tool-ids.d.ts +0 -5
- package/dist/tools/tool-ids.js +3 -7
- package/dist/tools/tool-ids.js.map +1 -1
- package/dist/tools/workflows/build-workflow.tool.d.ts +8 -2
- package/dist/tools/workflows/build-workflow.tool.js +371 -17
- package/dist/tools/workflows/build-workflow.tool.js.map +1 -1
- package/dist/tools/workflows/materialize-node-type.tool.d.ts +4 -4
- package/dist/tools/workflows/materialize-node-type.tool.js +2 -2
- package/dist/tools/workflows/materialize-node-type.tool.js.map +1 -1
- package/dist/tools/workflows/setup-workflow.schema.d.ts +32 -32
- package/dist/tools/workflows/submit-workflow.tool.d.ts +16 -12
- package/dist/tools/workflows/submit-workflow.tool.js +9 -2
- package/dist/tools/workflows/submit-workflow.tool.js.map +1 -1
- package/dist/tools/workflows/write-sandbox-file.tool.js +2 -2
- package/dist/tools/workflows/write-sandbox-file.tool.js.map +1 -1
- package/dist/tools/workflows.tool.js +5 -0
- package/dist/tools/workflows.tool.js.map +1 -1
- package/dist/tracing/langsmith-tracing.js +6 -1
- package/dist/tracing/langsmith-tracing.js.map +1 -1
- package/dist/tracing/trace-payloads.js +2 -6
- package/dist/tracing/trace-payloads.js.map +1 -1
- package/dist/types.d.ts +48 -9
- package/dist/types.js.map +1 -1
- package/dist/workflow-builder/build-failure-tracker.d.ts +10 -0
- package/dist/workflow-builder/build-failure-tracker.js +36 -0
- package/dist/workflow-builder/build-failure-tracker.js.map +1 -0
- package/dist/workflow-builder/index.d.ts +1 -0
- package/dist/workflow-builder/index.js +4 -1
- package/dist/workflow-builder/index.js.map +1 -1
- package/dist/workflow-loop/guidance.js +10 -6
- package/dist/workflow-loop/guidance.js.map +1 -1
- package/dist/workflow-loop/index.d.ts +3 -2
- package/dist/workflow-loop/index.js +14 -1
- package/dist/workflow-loop/index.js.map +1 -1
- package/dist/workflow-loop/runtime.js +3 -1
- package/dist/workflow-loop/runtime.js.map +1 -1
- package/dist/workflow-loop/verification-obligation.d.ts +15 -0
- package/dist/workflow-loop/verification-obligation.js +140 -0
- package/dist/workflow-loop/verification-obligation.js.map +1 -0
- package/dist/workflow-loop/workflow-loop-controller.js +26 -1
- package/dist/workflow-loop/workflow-loop-controller.js.map +1 -1
- package/dist/workflow-loop/workflow-loop-state.d.ts +416 -62
- package/dist/workflow-loop/workflow-loop-state.js +66 -1
- package/dist/workflow-loop/workflow-loop-state.js.map +1 -1
- package/dist/workspace/builder-templates-service.js.map +1 -1
- package/dist/workspace/compute-workspace-content-hash.d.ts +1 -0
- package/dist/workspace/compute-workspace-content-hash.js +15 -0
- package/dist/workspace/compute-workspace-content-hash.js.map +1 -0
- package/dist/workspace/create-workspace.d.ts +9 -43
- package/dist/workspace/create-workspace.js +45 -55
- package/dist/workspace/create-workspace.js.map +1 -1
- package/dist/workspace/lazy-runtime-workspace.js +1 -1
- package/dist/workspace/lazy-runtime-workspace.js.map +1 -1
- package/dist/workspace/prebaked-workspace-bundle.d.ts +39 -0
- package/dist/workspace/prebaked-workspace-bundle.js +75 -0
- package/dist/workspace/prebaked-workspace-bundle.js.map +1 -0
- package/dist/workspace/sandbox-fs.d.ts +9 -24
- package/dist/workspace/sandbox-fs.js +2 -16
- package/dist/workspace/sandbox-fs.js.map +1 -1
- package/dist/workspace/sandbox-setup.d.ts +1 -7
- package/dist/workspace/sandbox-setup.js +28 -170
- package/dist/workspace/sandbox-setup.js.map +1 -1
- package/dist/workspace/snapshot-image-context.d.ts +5 -0
- package/dist/workspace/snapshot-image-context.js +36 -0
- package/dist/workspace/snapshot-image-context.js.map +1 -0
- package/dist/workspace/snapshot-manager.d.ts +9 -9
- package/dist/workspace/snapshot-manager.js +57 -67
- package/dist/workspace/snapshot-manager.js.map +1 -1
- package/dist/workspace/template-telemetry.js +4 -4
- package/dist/workspace/template-telemetry.js.map +1 -1
- package/dist/workspace/workspace-file-content.d.ts +2 -0
- package/dist/workspace/workspace-file-content.js +11 -0
- package/dist/workspace/workspace-file-content.js.map +1 -0
- package/dist/workspace/workspace-files.d.ts +20 -0
- package/dist/workspace/workspace-files.js +74 -0
- package/dist/workspace/workspace-files.js.map +1 -0
- package/dist/workspace/workspace-manifest.d.ts +12 -0
- package/dist/workspace/workspace-manifest.js +28 -0
- package/dist/workspace/workspace-manifest.js.map +1 -0
- package/package.json +21 -15
- package/skills/data-table-manager/SKILL.md +6 -6
- package/skills/debugging-executions/SKILL.md +44 -0
- package/skills/planned-task-runtime/SKILL.md +163 -0
- package/skills/planning/SKILL.md +137 -0
- package/skills/post-build-flow/SKILL.md +119 -0
- package/skills/post-build-flow/references/trigger-input-data-shapes.md +38 -0
- package/skills/workflow-builder/SKILL.md +608 -0
- package/dist/tools/best-practices/index.d.ts +0 -2
- package/dist/tools/best-practices/index.js +0 -10
- package/dist/tools/best-practices/index.js.map +0 -1
- package/dist/tools/best-practices/techniques.d.ts +0 -1
- package/dist/tools/best-practices/techniques.js +0 -7
- package/dist/tools/best-practices/techniques.js.map +0 -1
- package/dist/tools/orchestration/add-plan-item.tool.d.ts +0 -5
- package/dist/tools/orchestration/add-plan-item.tool.js +0 -89
- package/dist/tools/orchestration/add-plan-item.tool.js.map +0 -1
- package/dist/tools/orchestration/blueprint-accumulator.d.ts +0 -49
- package/dist/tools/orchestration/blueprint-accumulator.js +0 -176
- package/dist/tools/orchestration/blueprint-accumulator.js.map +0 -1
- package/dist/tools/orchestration/blueprint.schema.d.ts +0 -182
- package/dist/tools/orchestration/blueprint.schema.js +0 -56
- package/dist/tools/orchestration/blueprint.schema.js.map +0 -1
- package/dist/tools/orchestration/build-workflow-agent.prompt.d.ts +0 -8
- package/dist/tools/orchestration/build-workflow-agent.prompt.js +0 -466
- package/dist/tools/orchestration/build-workflow-agent.prompt.js.map +0 -1
- package/dist/tools/orchestration/build-workflow-agent.tool.d.ts +0 -148
- package/dist/tools/orchestration/build-workflow-agent.tool.js +0 -1498
- package/dist/tools/orchestration/build-workflow-agent.tool.js.map +0 -1
- package/dist/tools/orchestration/builder-memory-compaction.d.ts +0 -42
- package/dist/tools/orchestration/builder-memory-compaction.js +0 -132
- package/dist/tools/orchestration/builder-memory-compaction.js.map +0 -1
- package/dist/tools/orchestration/plan-agent-prompt.d.ts +0 -1
- package/dist/tools/orchestration/plan-agent-prompt.js +0 -83
- package/dist/tools/orchestration/plan-agent-prompt.js.map +0 -1
- package/dist/tools/orchestration/plan-with-agent.tool.d.ts +0 -27
- package/dist/tools/orchestration/plan-with-agent.tool.js +0 -710
- package/dist/tools/orchestration/plan-with-agent.tool.js.map +0 -1
- package/dist/tools/orchestration/submit-plan.tool.d.ts +0 -3
- package/dist/tools/orchestration/submit-plan.tool.js +0 -98
- package/dist/tools/orchestration/submit-plan.tool.js.map +0 -1
- package/dist/tools/templates.tool.d.ts +0 -1
- package/dist/tools/templates.tool.js +0 -58
- package/dist/tools/templates.tool.js.map +0 -1
- package/dist/workspace/daytona-auth-manager.d.ts +0 -26
- package/dist/workspace/daytona-auth-manager.js +0 -90
- package/dist/workspace/daytona-auth-manager.js.map +0 -1
- package/dist/workspace/daytona-filesystem.d.ts +0 -25
- package/dist/workspace/daytona-filesystem.js +0 -132
- package/dist/workspace/daytona-filesystem.js.map +0 -1
- package/dist/workspace/daytona-sandbox.d.ts +0 -71
- package/dist/workspace/daytona-sandbox.js +0 -368
- package/dist/workspace/daytona-sandbox.js.map +0 -1
- package/dist/workspace/lazy-daytona.d.ts +0 -2
- package/dist/workspace/lazy-daytona.js +0 -12
- package/dist/workspace/lazy-daytona.js.map +0 -1
- package/dist/workspace/local-filesystem.d.ts +0 -48
- package/dist/workspace/local-filesystem.js +0 -250
- package/dist/workspace/local-filesystem.js.map +0 -1
- package/dist/workspace/local-sandbox.d.ts +0 -28
- package/dist/workspace/local-sandbox.js +0 -121
- package/dist/workspace/local-sandbox.js.map +0 -1
- package/dist/workspace/n8n-sandbox-filesystem.d.ts +0 -25
- package/dist/workspace/n8n-sandbox-filesystem.js +0 -128
- package/dist/workspace/n8n-sandbox-filesystem.js.map +0 -1
- package/dist/workspace/n8n-sandbox-sandbox.d.ts +0 -35
- package/dist/workspace/n8n-sandbox-sandbox.js +0 -143
- package/dist/workspace/n8n-sandbox-sandbox.js.map +0 -1
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.publishPlanUpdate = publishPlanUpdate;
|
|
4
|
-
exports.createAddPlanItemTool = createAddPlanItemTool;
|
|
5
|
-
exports.createRemovePlanItemTool = createRemovePlanItemTool;
|
|
6
|
-
const agents_1 = require("@n8n/agents");
|
|
7
|
-
const zod_1 = require("zod");
|
|
8
|
-
const blueprint_schema_1 = require("./blueprint.schema");
|
|
9
|
-
function publishPlanUpdate(accumulator, context) {
|
|
10
|
-
const taskItems = accumulator.getTaskItemsForEvent();
|
|
11
|
-
const planItems = accumulator.getTaskList().map((t) => ({
|
|
12
|
-
id: t.id,
|
|
13
|
-
title: t.title,
|
|
14
|
-
kind: t.kind,
|
|
15
|
-
spec: t.spec,
|
|
16
|
-
deps: t.deps,
|
|
17
|
-
...(t.tools ? { tools: t.tools } : {}),
|
|
18
|
-
...(t.workflowId ? { workflowId: t.workflowId } : {}),
|
|
19
|
-
}));
|
|
20
|
-
context.eventBus.publish(context.threadId, {
|
|
21
|
-
type: 'tasks-update',
|
|
22
|
-
runId: context.runId,
|
|
23
|
-
agentId: context.orchestratorAgentId,
|
|
24
|
-
payload: { tasks: { tasks: taskItems }, planItems },
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
const addPlanItemInputSchema = zod_1.z.object({
|
|
28
|
-
summary: zod_1.z.string().optional().describe('1-2 sentence plan overview — set on first call'),
|
|
29
|
-
assumptions: zod_1.z
|
|
30
|
-
.array(zod_1.z.string())
|
|
31
|
-
.optional()
|
|
32
|
-
.describe('Assumptions the plan relies on — set on first call'),
|
|
33
|
-
item: zod_1.z.discriminatedUnion('kind', [
|
|
34
|
-
blueprint_schema_1.blueprintWorkflowItemSchema.extend({ kind: zod_1.z.literal('workflow') }),
|
|
35
|
-
blueprint_schema_1.blueprintDelegateItemSchema.extend({ kind: zod_1.z.literal('delegate') }),
|
|
36
|
-
blueprint_schema_1.blueprintCheckpointItemSchema.extend({ kind: zod_1.z.literal('checkpoint') }),
|
|
37
|
-
]),
|
|
38
|
-
});
|
|
39
|
-
function createAddPlanItemTool(accumulator, context) {
|
|
40
|
-
return new agents_1.Tool('add-plan-item')
|
|
41
|
-
.description('Add a single plan item (workflow, delegate, or checkpoint task). ' +
|
|
42
|
-
'Call once per item as you design it — each call makes the item visible to the user immediately. ' +
|
|
43
|
-
'Add workflow items only if the request requires automation. ' +
|
|
44
|
-
'Add a checkpoint item AFTER its target workflow(s) so the orchestrator can verify the result end-to-end. ' +
|
|
45
|
-
'Set summary and assumptions on your first call.')
|
|
46
|
-
.input(addPlanItemInputSchema)
|
|
47
|
-
.output(zod_1.z.object({ result: zod_1.z.string() }))
|
|
48
|
-
.handler(async (input) => {
|
|
49
|
-
if (input.summary !== undefined || input.assumptions !== undefined) {
|
|
50
|
-
accumulator.updateMeta(input.summary, input.assumptions);
|
|
51
|
-
}
|
|
52
|
-
const task = accumulator.addItem(input.item);
|
|
53
|
-
await context.taskStorage.save(context.threadId, {
|
|
54
|
-
tasks: accumulator.getTaskItemsForEvent(),
|
|
55
|
-
});
|
|
56
|
-
publishPlanUpdate(accumulator, context);
|
|
57
|
-
const totalCount = accumulator.getTaskItemsForEvent().length;
|
|
58
|
-
return {
|
|
59
|
-
result: `Added: ${task.title} (${totalCount} item${totalCount === 1 ? '' : 's'} total)`,
|
|
60
|
-
};
|
|
61
|
-
})
|
|
62
|
-
.build();
|
|
63
|
-
}
|
|
64
|
-
function createRemovePlanItemTool(accumulator, context) {
|
|
65
|
-
return new agents_1.Tool('remove-plan-item')
|
|
66
|
-
.description('Remove a plan item by ID. Use during plan revision to drop items the user no longer wants.')
|
|
67
|
-
.input(zod_1.z.object({
|
|
68
|
-
id: zod_1.z.string().describe('ID of the plan item to remove'),
|
|
69
|
-
}))
|
|
70
|
-
.output(zod_1.z.object({ result: zod_1.z.string() }))
|
|
71
|
-
.handler(async (input) => {
|
|
72
|
-
const removed = accumulator.removeItem(input.id);
|
|
73
|
-
await context.taskStorage.save(context.threadId, {
|
|
74
|
-
tasks: accumulator.getTaskItemsForEvent(),
|
|
75
|
-
});
|
|
76
|
-
publishPlanUpdate(accumulator, context);
|
|
77
|
-
const totalCount = accumulator.getTaskItemsForEvent().length;
|
|
78
|
-
if (removed) {
|
|
79
|
-
return {
|
|
80
|
-
result: `Removed item ${input.id}. ${totalCount} item${totalCount === 1 ? '' : 's'} remaining.`,
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
return {
|
|
84
|
-
result: `Item ${input.id} not found. ${totalCount} item${totalCount === 1 ? '' : 's'} in plan.`,
|
|
85
|
-
};
|
|
86
|
-
})
|
|
87
|
-
.build();
|
|
88
|
-
}
|
|
89
|
-
//# sourceMappingURL=add-plan-item.tool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-plan-item.tool.js","sourceRoot":"","sources":["../../../src/tools/orchestration/add-plan-item.tool.ts"],"names":[],"mappings":";;AAoBA,8CAoBC;AAeD,sDAgCC;AAED,4DAiCC;AAlHD,wCAAmC;AACnC,6BAAwB;AAGxB,yDAI4B;AAI5B,SAAgB,iBAAiB,CAChC,WAAiC,EACjC,OAA6B;IAE7B,MAAM,SAAS,GAAG,WAAW,CAAC,oBAAoB,EAAE,CAAC;IACrD,MAAM,SAAS,GAAG,WAAW,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACvD,EAAE,EAAE,CAAC,CAAC,EAAE;QACR,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,IAAI,EAAE,CAAC,CAAC,IAAI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,CAAC;QACR,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;KACxD,CAAC,CACF;SACA,MAAM,CAAC,OAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;SACxC,OAAO,CAAC,KAAK,EAAE,KAAqB,EAAE,EAAE;QACxC,MAAM,OAAO,GAAG,WAAW,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAEjD,MAAM,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;YAChD,KAAK,EAAE,WAAW,CAAC,oBAAoB,EAAE;SACzC,CAAC,CAAC;QACH,iBAAiB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAExC,MAAM,UAAU,GAAG,WAAW,CAAC,oBAAoB,EAAE,CAAC,MAAM,CAAC;QAC7D,IAAI,OAAO,EAAE,CAAC;YACb,OAAO;gBACN,MAAM,EAAE,gBAAgB,KAAK,CAAC,EAAE,KAAK,UAAU,QAAQ,UAAU,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,aAAa;aAC/F,CAAC;QACH,CAAC;QACD,OAAO;YACN,MAAM,EAAE,QAAQ,KAAK,CAAC,EAAE,eAAe,UAAU,QAAQ,UAAU,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,WAAW;SAC/F,CAAC;IACH,CAAC,CAAC;SACD,KAAK,EAAE,CAAC;AACX,CAAC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { BlueprintCheckpointItem, BlueprintDelegateItem, BlueprintWorkflowItem } from './blueprint.schema';
|
|
2
|
-
export interface PlannedTaskInput {
|
|
3
|
-
id: string;
|
|
4
|
-
title: string;
|
|
5
|
-
kind: string;
|
|
6
|
-
spec: string;
|
|
7
|
-
deps: string[];
|
|
8
|
-
tools?: string[];
|
|
9
|
-
workflowId?: string;
|
|
10
|
-
}
|
|
11
|
-
type BlueprintItem = (BlueprintWorkflowItem & {
|
|
12
|
-
kind: 'workflow';
|
|
13
|
-
}) | (BlueprintDelegateItem & {
|
|
14
|
-
kind: 'delegate';
|
|
15
|
-
}) | (BlueprintCheckpointItem & {
|
|
16
|
-
kind: 'checkpoint';
|
|
17
|
-
});
|
|
18
|
-
export declare class BlueprintAccumulator {
|
|
19
|
-
private workflows;
|
|
20
|
-
private delegateItems;
|
|
21
|
-
private checkpoints;
|
|
22
|
-
private tasks;
|
|
23
|
-
private summary;
|
|
24
|
-
private assumptions;
|
|
25
|
-
private approved;
|
|
26
|
-
private denied;
|
|
27
|
-
addItem(item: BlueprintItem): PlannedTaskInput;
|
|
28
|
-
updateMeta(summary?: string, assumptions?: string[]): void;
|
|
29
|
-
getTaskList(): PlannedTaskInput[];
|
|
30
|
-
getTaskItemsForEvent(): Array<{
|
|
31
|
-
id: string;
|
|
32
|
-
description: string;
|
|
33
|
-
status: 'todo';
|
|
34
|
-
}>;
|
|
35
|
-
reconcileDependencies(): void;
|
|
36
|
-
removeItem(id: string): boolean;
|
|
37
|
-
loadFromTasks(tasks: PlannedTaskInput[]): void;
|
|
38
|
-
markApproved(): void;
|
|
39
|
-
isApproved(): boolean;
|
|
40
|
-
markDenied(): void;
|
|
41
|
-
isDenied(): boolean;
|
|
42
|
-
isEmpty(): boolean;
|
|
43
|
-
getSummary(): string;
|
|
44
|
-
getAssumptions(): string[];
|
|
45
|
-
private upsertArray;
|
|
46
|
-
private removeFromArray;
|
|
47
|
-
private upsertTask;
|
|
48
|
-
}
|
|
49
|
-
export {};
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BlueprintAccumulator = void 0;
|
|
4
|
-
function workflowItemToTask(wf, assumptions) {
|
|
5
|
-
const specParts = [wf.purpose];
|
|
6
|
-
if (wf.triggerDescription)
|
|
7
|
-
specParts.push(`Trigger: ${wf.triggerDescription}`);
|
|
8
|
-
if (wf.integrations.length > 0)
|
|
9
|
-
specParts.push(`Integrations: ${wf.integrations.join(', ')}`);
|
|
10
|
-
if (assumptions.length > 0) {
|
|
11
|
-
specParts.push('\nAssumptions:');
|
|
12
|
-
for (const a of assumptions) {
|
|
13
|
-
specParts.push(`- ${a}`);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return {
|
|
17
|
-
id: wf.id,
|
|
18
|
-
title: `Build '${wf.name}' workflow`,
|
|
19
|
-
kind: 'build-workflow',
|
|
20
|
-
spec: specParts.join('\n'),
|
|
21
|
-
deps: wf.dependsOn,
|
|
22
|
-
workflowId: wf.existingWorkflowId,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
function delegateItemToTask(di) {
|
|
26
|
-
return {
|
|
27
|
-
id: di.id,
|
|
28
|
-
title: di.title,
|
|
29
|
-
kind: 'delegate',
|
|
30
|
-
spec: di.description,
|
|
31
|
-
deps: di.dependsOn,
|
|
32
|
-
tools: di.requiredTools,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
function checkpointItemToTask(c) {
|
|
36
|
-
return {
|
|
37
|
-
id: c.id,
|
|
38
|
-
title: c.title,
|
|
39
|
-
kind: 'checkpoint',
|
|
40
|
-
spec: c.instructions,
|
|
41
|
-
deps: c.dependsOn,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
class BlueprintAccumulator {
|
|
45
|
-
workflows = [];
|
|
46
|
-
delegateItems = [];
|
|
47
|
-
checkpoints = [];
|
|
48
|
-
tasks = [];
|
|
49
|
-
summary = '';
|
|
50
|
-
assumptions = [];
|
|
51
|
-
approved = false;
|
|
52
|
-
denied = false;
|
|
53
|
-
addItem(item) {
|
|
54
|
-
let task;
|
|
55
|
-
switch (item.kind) {
|
|
56
|
-
case 'workflow': {
|
|
57
|
-
const { kind: _, ...wf } = item;
|
|
58
|
-
this.upsertArray(this.workflows, wf);
|
|
59
|
-
task = workflowItemToTask(wf, this.assumptions);
|
|
60
|
-
break;
|
|
61
|
-
}
|
|
62
|
-
case 'delegate': {
|
|
63
|
-
const { kind: _, ...di } = item;
|
|
64
|
-
this.upsertArray(this.delegateItems, di);
|
|
65
|
-
task = delegateItemToTask(di);
|
|
66
|
-
break;
|
|
67
|
-
}
|
|
68
|
-
case 'checkpoint': {
|
|
69
|
-
const { kind: _, ...c } = item;
|
|
70
|
-
this.upsertArray(this.checkpoints, c);
|
|
71
|
-
task = checkpointItemToTask(c);
|
|
72
|
-
break;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
this.upsertTask(task);
|
|
76
|
-
return task;
|
|
77
|
-
}
|
|
78
|
-
updateMeta(summary, assumptions) {
|
|
79
|
-
if (summary !== undefined)
|
|
80
|
-
this.summary = summary;
|
|
81
|
-
if (assumptions !== undefined)
|
|
82
|
-
this.assumptions = assumptions;
|
|
83
|
-
}
|
|
84
|
-
getTaskList() {
|
|
85
|
-
return [...this.tasks];
|
|
86
|
-
}
|
|
87
|
-
getTaskItemsForEvent() {
|
|
88
|
-
return this.tasks.map((t) => ({
|
|
89
|
-
id: t.id,
|
|
90
|
-
description: t.title,
|
|
91
|
-
status: 'todo',
|
|
92
|
-
}));
|
|
93
|
-
}
|
|
94
|
-
reconcileDependencies() {
|
|
95
|
-
for (let i = 0; i < this.workflows.length; i++) {
|
|
96
|
-
const wf = this.workflows[i];
|
|
97
|
-
const updatedTask = workflowItemToTask(wf, this.assumptions);
|
|
98
|
-
this.upsertTask(updatedTask);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
removeItem(id) {
|
|
102
|
-
const taskIdx = this.tasks.findIndex((t) => t.id === id);
|
|
103
|
-
if (taskIdx < 0)
|
|
104
|
-
return false;
|
|
105
|
-
this.tasks.splice(taskIdx, 1);
|
|
106
|
-
this.removeFromArray(this.workflows, id);
|
|
107
|
-
this.removeFromArray(this.delegateItems, id);
|
|
108
|
-
this.removeFromArray(this.checkpoints, id);
|
|
109
|
-
for (const task of this.tasks) {
|
|
110
|
-
task.deps = task.deps.filter((dep) => dep !== id);
|
|
111
|
-
}
|
|
112
|
-
const workflowIds = new Set(this.workflows.map((w) => w.id));
|
|
113
|
-
const orphanedCheckpointIds = [];
|
|
114
|
-
for (const cp of this.checkpoints) {
|
|
115
|
-
const stillHasWorkflowDep = cp.dependsOn.some((depId) => workflowIds.has(depId));
|
|
116
|
-
if (!stillHasWorkflowDep) {
|
|
117
|
-
orphanedCheckpointIds.push(cp.id);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
for (const orphanId of orphanedCheckpointIds) {
|
|
121
|
-
this.removeItem(orphanId);
|
|
122
|
-
}
|
|
123
|
-
return true;
|
|
124
|
-
}
|
|
125
|
-
loadFromTasks(tasks) {
|
|
126
|
-
for (const t of tasks) {
|
|
127
|
-
this.upsertTask(t);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
markApproved() {
|
|
131
|
-
this.approved = true;
|
|
132
|
-
}
|
|
133
|
-
isApproved() {
|
|
134
|
-
return this.approved;
|
|
135
|
-
}
|
|
136
|
-
markDenied() {
|
|
137
|
-
this.denied = true;
|
|
138
|
-
}
|
|
139
|
-
isDenied() {
|
|
140
|
-
return this.denied;
|
|
141
|
-
}
|
|
142
|
-
isEmpty() {
|
|
143
|
-
return this.tasks.length === 0;
|
|
144
|
-
}
|
|
145
|
-
getSummary() {
|
|
146
|
-
return this.summary;
|
|
147
|
-
}
|
|
148
|
-
getAssumptions() {
|
|
149
|
-
return [...this.assumptions];
|
|
150
|
-
}
|
|
151
|
-
upsertArray(arr, item) {
|
|
152
|
-
const idx = arr.findIndex((existing) => existing.id === item.id);
|
|
153
|
-
if (idx >= 0) {
|
|
154
|
-
arr[idx] = item;
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
157
|
-
arr.push(item);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
removeFromArray(arr, id) {
|
|
161
|
-
const idx = arr.findIndex((item) => item.id === id);
|
|
162
|
-
if (idx >= 0)
|
|
163
|
-
arr.splice(idx, 1);
|
|
164
|
-
}
|
|
165
|
-
upsertTask(task) {
|
|
166
|
-
const idx = this.tasks.findIndex((t) => t.id === task.id);
|
|
167
|
-
if (idx >= 0) {
|
|
168
|
-
this.tasks[idx] = task;
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
this.tasks.push(task);
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
exports.BlueprintAccumulator = BlueprintAccumulator;
|
|
176
|
-
//# sourceMappingURL=blueprint-accumulator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"blueprint-accumulator.js","sourceRoot":"","sources":["../../../src/tools/orchestration/blueprint-accumulator.ts"],"names":[],"mappings":";;;AA2CA,SAAS,kBAAkB,CAAC,EAAyB,EAAE,WAAqB;IAC3E,MAAM,SAAS,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;IAC/B,IAAI,EAAE,CAAC,kBAAkB;QAAE,SAAS,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,kBAAkB,EAAE,CAAC,CAAC;IAC/E,IAAI,EAAE,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC;QAAE,SAAS,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAG9F,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5B,SAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACjC,KAAK,MAAM,CAAC,IAAI,WAAW,EAAE,CAAC;YAC7B,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC1B,CAAC;IACF,CAAC;IAED,OAAO;QACN,EAAE,EAAE,EAAE,CAAC,EAAE;QACT,KAAK,EAAE,UAAU,EAAE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AC,QAAQ,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC,CAAC;QACjE,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC;YACd,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;QACjB,CAAC;aAAM,CAAC;YACP,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChB,CAAC;IACF,CAAC;IAGO,eAAe,CAA2B,GAAQ,EAAE,EAAU;QACrE,MAAM,GAAG,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QACpD,IAAI,GAAG,IAAI,CAAC;YAAE,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IAClC,CAAC;IAGO,UAAU,CAAC,IAAsB;QACxC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC,CAAC;QAC1D,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC;YACd,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;QACxB,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC;IACF,CAAC;CACD;AArLD,oDAqLC"}
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const blueprintWorkflowItemSchema: z.ZodObject<{
|
|
3
|
-
id: z.ZodString;
|
|
4
|
-
name: z.ZodString;
|
|
5
|
-
purpose: z.ZodString;
|
|
6
|
-
integrations: z.ZodArray<z.ZodString, "many">;
|
|
7
|
-
triggerDescription: z.ZodOptional<z.ZodString>;
|
|
8
|
-
existingWorkflowId: z.ZodOptional<z.ZodString>;
|
|
9
|
-
dependsOn: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
10
|
-
}, "strip", z.ZodTypeAny, {
|
|
11
|
-
name: string;
|
|
12
|
-
id: string;
|
|
13
|
-
purpose: string;
|
|
14
|
-
integrations: string[];
|
|
15
|
-
dependsOn: string[];
|
|
16
|
-
triggerDescription?: string | undefined;
|
|
17
|
-
existingWorkflowId?: string | undefined;
|
|
18
|
-
}, {
|
|
19
|
-
name: string;
|
|
20
|
-
id: string;
|
|
21
|
-
purpose: string;
|
|
22
|
-
integrations: string[];
|
|
23
|
-
triggerDescription?: string | undefined;
|
|
24
|
-
existingWorkflowId?: string | undefined;
|
|
25
|
-
dependsOn?: string[] | undefined;
|
|
26
|
-
}>;
|
|
27
|
-
export declare const blueprintDelegateItemSchema: z.ZodObject<{
|
|
28
|
-
id: z.ZodString;
|
|
29
|
-
title: z.ZodString;
|
|
30
|
-
description: z.ZodString;
|
|
31
|
-
requiredTools: z.ZodArray<z.ZodString, "many">;
|
|
32
|
-
dependsOn: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
33
|
-
}, "strip", z.ZodTypeAny, {
|
|
34
|
-
title: string;
|
|
35
|
-
id: string;
|
|
36
|
-
description: string;
|
|
37
|
-
dependsOn: string[];
|
|
38
|
-
requiredTools: string[];
|
|
39
|
-
}, {
|
|
40
|
-
title: string;
|
|
41
|
-
id: string;
|
|
42
|
-
description: string;
|
|
43
|
-
requiredTools: string[];
|
|
44
|
-
dependsOn?: string[] | undefined;
|
|
45
|
-
}>;
|
|
46
|
-
export declare const blueprintCheckpointItemSchema: z.ZodObject<{
|
|
47
|
-
id: z.ZodString;
|
|
48
|
-
title: z.ZodString;
|
|
49
|
-
instructions: z.ZodString;
|
|
50
|
-
dependsOn: z.ZodArray<z.ZodString, "many">;
|
|
51
|
-
}, "strip", z.ZodTypeAny, {
|
|
52
|
-
title: string;
|
|
53
|
-
id: string;
|
|
54
|
-
instructions: string;
|
|
55
|
-
dependsOn: string[];
|
|
56
|
-
}, {
|
|
57
|
-
title: string;
|
|
58
|
-
id: string;
|
|
59
|
-
instructions: string;
|
|
60
|
-
dependsOn: string[];
|
|
61
|
-
}>;
|
|
62
|
-
export declare const planningBlueprintSchema: z.ZodObject<{
|
|
63
|
-
summary: z.ZodString;
|
|
64
|
-
workflows: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
65
|
-
id: z.ZodString;
|
|
66
|
-
name: z.ZodString;
|
|
67
|
-
purpose: z.ZodString;
|
|
68
|
-
integrations: z.ZodArray<z.ZodString, "many">;
|
|
69
|
-
triggerDescription: z.ZodOptional<z.ZodString>;
|
|
70
|
-
existingWorkflowId: z.ZodOptional<z.ZodString>;
|
|
71
|
-
dependsOn: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
72
|
-
}, "strip", z.ZodTypeAny, {
|
|
73
|
-
name: string;
|
|
74
|
-
id: string;
|
|
75
|
-
purpose: string;
|
|
76
|
-
integrations: string[];
|
|
77
|
-
dependsOn: string[];
|
|
78
|
-
triggerDescription?: string | undefined;
|
|
79
|
-
existingWorkflowId?: string | undefined;
|
|
80
|
-
}, {
|
|
81
|
-
name: string;
|
|
82
|
-
id: string;
|
|
83
|
-
purpose: string;
|
|
84
|
-
integrations: string[];
|
|
85
|
-
triggerDescription?: string | undefined;
|
|
86
|
-
existingWorkflowId?: string | undefined;
|
|
87
|
-
dependsOn?: string[] | undefined;
|
|
88
|
-
}>, "many">>;
|
|
89
|
-
delegateItems: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
90
|
-
id: z.ZodString;
|
|
91
|
-
title: z.ZodString;
|
|
92
|
-
description: z.ZodString;
|
|
93
|
-
requiredTools: z.ZodArray<z.ZodString, "many">;
|
|
94
|
-
dependsOn: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
95
|
-
}, "strip", z.ZodTypeAny, {
|
|
96
|
-
title: string;
|
|
97
|
-
id: string;
|
|
98
|
-
description: string;
|
|
99
|
-
dependsOn: string[];
|
|
100
|
-
requiredTools: string[];
|
|
101
|
-
}, {
|
|
102
|
-
title: string;
|
|
103
|
-
id: string;
|
|
104
|
-
description: string;
|
|
105
|
-
requiredTools: string[];
|
|
106
|
-
dependsOn?: string[] | undefined;
|
|
107
|
-
}>, "many">>;
|
|
108
|
-
checkpointItems: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
109
|
-
id: z.ZodString;
|
|
110
|
-
title: z.ZodString;
|
|
111
|
-
instructions: z.ZodString;
|
|
112
|
-
dependsOn: z.ZodArray<z.ZodString, "many">;
|
|
113
|
-
}, "strip", z.ZodTypeAny, {
|
|
114
|
-
title: string;
|
|
115
|
-
id: string;
|
|
116
|
-
instructions: string;
|
|
117
|
-
dependsOn: string[];
|
|
118
|
-
}, {
|
|
119
|
-
title: string;
|
|
120
|
-
id: string;
|
|
121
|
-
instructions: string;
|
|
122
|
-
dependsOn: string[];
|
|
123
|
-
}>, "many">>;
|
|
124
|
-
assumptions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
125
|
-
openQuestions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
126
|
-
}, "strip", z.ZodTypeAny, {
|
|
127
|
-
summary: string;
|
|
128
|
-
workflows: {
|
|
129
|
-
name: string;
|
|
130
|
-
id: string;
|
|
131
|
-
purpose: string;
|
|
132
|
-
integrations: string[];
|
|
133
|
-
dependsOn: string[];
|
|
134
|
-
triggerDescription?: string | undefined;
|
|
135
|
-
existingWorkflowId?: string | undefined;
|
|
136
|
-
}[];
|
|
137
|
-
delegateItems: {
|
|
138
|
-
title: string;
|
|
139
|
-
id: string;
|
|
140
|
-
description: string;
|
|
141
|
-
dependsOn: string[];
|
|
142
|
-
requiredTools: string[];
|
|
143
|
-
}[];
|
|
144
|
-
checkpointItems: {
|
|
145
|
-
title: string;
|
|
146
|
-
id: string;
|
|
147
|
-
instructions: string;
|
|
148
|
-
dependsOn: string[];
|
|
149
|
-
}[];
|
|
150
|
-
assumptions: string[];
|
|
151
|
-
openQuestions: string[];
|
|
152
|
-
}, {
|
|
153
|
-
summary: string;
|
|
154
|
-
workflows?: {
|
|
155
|
-
name: string;
|
|
156
|
-
id: string;
|
|
157
|
-
purpose: string;
|
|
158
|
-
integrations: string[];
|
|
159
|
-
triggerDescription?: string | undefined;
|
|
160
|
-
existingWorkflowId?: string | undefined;
|
|
161
|
-
dependsOn?: string[] | undefined;
|
|
162
|
-
}[] | undefined;
|
|
163
|
-
delegateItems?: {
|
|
164
|
-
title: string;
|
|
165
|
-
id: string;
|
|
166
|
-
description: string;
|
|
167
|
-
requiredTools: string[];
|
|
168
|
-
dependsOn?: string[] | undefined;
|
|
169
|
-
}[] | undefined;
|
|
170
|
-
checkpointItems?: {
|
|
171
|
-
title: string;
|
|
172
|
-
id: string;
|
|
173
|
-
instructions: string;
|
|
174
|
-
dependsOn: string[];
|
|
175
|
-
}[] | undefined;
|
|
176
|
-
assumptions?: string[] | undefined;
|
|
177
|
-
openQuestions?: string[] | undefined;
|
|
178
|
-
}>;
|
|
179
|
-
export type PlanningBlueprint = z.infer<typeof planningBlueprintSchema>;
|
|
180
|
-
export type BlueprintWorkflowItem = z.infer<typeof blueprintWorkflowItemSchema>;
|
|
181
|
-
export type BlueprintDelegateItem = z.infer<typeof blueprintDelegateItemSchema>;
|
|
182
|
-
export type BlueprintCheckpointItem = z.infer<typeof blueprintCheckpointItemSchema>;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.planningBlueprintSchema = exports.blueprintCheckpointItemSchema = exports.blueprintDelegateItemSchema = exports.blueprintWorkflowItemSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
exports.blueprintWorkflowItemSchema = zod_1.z.object({
|
|
6
|
-
id: zod_1.z.string().describe('Stable ID — preserved as task ID in the execution plan'),
|
|
7
|
-
name: zod_1.z.string().describe('Workflow display name'),
|
|
8
|
-
purpose: zod_1.z
|
|
9
|
-
.string()
|
|
10
|
-
.describe('1-2 sentence description of what the workflow does and why. Include any data table names, columns, seed/import needs, or existing-table requirements the workflow depends on.'),
|
|
11
|
-
integrations: zod_1.z.array(zod_1.z.string()).describe('Services/APIs this workflow connects'),
|
|
12
|
-
triggerDescription: zod_1.z
|
|
13
|
-
.string()
|
|
14
|
-
.optional()
|
|
15
|
-
.describe('Trigger type in a few words (e.g. "Webhook POST", "Schedule hourly")'),
|
|
16
|
-
existingWorkflowId: zod_1.z
|
|
17
|
-
.string()
|
|
18
|
-
.optional()
|
|
19
|
-
.describe('ID of existing workflow to modify (omit for new workflows)'),
|
|
20
|
-
dependsOn: zod_1.z
|
|
21
|
-
.array(zod_1.z.string())
|
|
22
|
-
.default([])
|
|
23
|
-
.describe('IDs of items that must complete before this one starts'),
|
|
24
|
-
});
|
|
25
|
-
exports.blueprintDelegateItemSchema = zod_1.z.object({
|
|
26
|
-
id: zod_1.z.string().describe('Stable ID — preserved as task ID'),
|
|
27
|
-
title: zod_1.z.string().describe('Short task title'),
|
|
28
|
-
description: zod_1.z.string().describe('Detailed task description'),
|
|
29
|
-
requiredTools: zod_1.z.array(zod_1.z.string()).describe('Tool names the delegate needs'),
|
|
30
|
-
dependsOn: zod_1.z.array(zod_1.z.string()).default([]),
|
|
31
|
-
});
|
|
32
|
-
exports.blueprintCheckpointItemSchema = zod_1.z.object({
|
|
33
|
-
id: zod_1.z.string().describe('Stable ID — preserved as task ID'),
|
|
34
|
-
title: zod_1.z
|
|
35
|
-
.string()
|
|
36
|
-
.describe('User-readable verification goal (e.g., "Verify Daily Email workflow runs without errors")'),
|
|
37
|
-
instructions: zod_1.z
|
|
38
|
-
.string()
|
|
39
|
-
.describe('Detailed verification steps the orchestrator must execute — which tools to call, the expected pass condition. The orchestrator runs this itself (no sub-agent).'),
|
|
40
|
-
dependsOn: zod_1.z
|
|
41
|
-
.array(zod_1.z.string())
|
|
42
|
-
.min(1)
|
|
43
|
-
.describe('IDs of items this checkpoint verifies. Must include at least one workflow item ID.'),
|
|
44
|
-
});
|
|
45
|
-
exports.planningBlueprintSchema = zod_1.z.object({
|
|
46
|
-
summary: zod_1.z.string().describe('1-2 sentence overview of the solution'),
|
|
47
|
-
workflows: zod_1.z.array(exports.blueprintWorkflowItemSchema).default([]),
|
|
48
|
-
delegateItems: zod_1.z.array(exports.blueprintDelegateItemSchema).default([]),
|
|
49
|
-
checkpointItems: zod_1.z.array(exports.blueprintCheckpointItemSchema).default([]),
|
|
50
|
-
assumptions: zod_1.z.array(zod_1.z.string()).default([]).describe('Assumptions the plan relies on'),
|
|
51
|
-
openQuestions: zod_1.z
|
|
52
|
-
.array(zod_1.z.string())
|
|
53
|
-
.default([])
|
|
54
|
-
.describe('Unresolved questions that may need user input before execution'),
|
|
55
|
-
});
|
|
56
|
-
//# sourceMappingURL=blueprint.schema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"blueprint.schema.js","sourceRoot":"","sources":["../../../src/tools/orchestration/blueprint.schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAMX,QAAA,2BAA2B,GAAG,OAAC,CAAC,MAAM,CAAC;IACnD,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wDAAwD,CAAC;IACjF,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;IAClD,OAAO,EAAE,OAAC;SACR,MAAM,EAAE;SACR,QAAQ,CACR,+KAA+K,CAC/K;IACF,YAAY,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,sCAAsC,CAAC;IAClF,kBAAkB,EAAE,OAAC;SACnB,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,sEAAsE,CAAC;IAClF,kBAAkB,EAAE,OAAC;SACnB,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,4DAA4D,CAAC;IACxE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AAC,KAAK,CAAC,mCAA2B,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC3D,aAAa,EAAE,OAAC,CAAC,KAAK,CAAC,mCAA2B,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC/D,eAAe,EAAE,OAAC,CAAC,KAAK,CAAC,qCAA6B,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACnE,WAAW,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,gCAAgC,CAAC;IACvF,aAAa,EAAE,OAAC;SACd,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;SACjB,OAAO,CAAC,EAAE,CAAC;SACX,QAAQ,CAAC,gEAAgE,CAAC;CAC5E,CAAC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare const BUILDER_AGENT_PROMPT: string;
|
|
2
|
-
export interface SandboxBuilderWorkspaceLayout {
|
|
3
|
-
mainWorkflowPath?: string;
|
|
4
|
-
sourceDir?: string;
|
|
5
|
-
chunksDir?: string;
|
|
6
|
-
tsconfigPath?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function createSandboxBuilderAgentPrompt(workspaceRoot: string, layout?: SandboxBuilderWorkspaceLayout): string;
|