monomind 1.11.12 → 1.11.13
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/.claude/commands/mastermind/idea.md +1 -1
- package/.claude/commands/mastermind/master.md +1 -1
- package/.claude/skills/mastermind/_protocol.md +4 -4
- package/.claude/skills/mastermind/build.md +3 -3
- package/.claude/skills/mastermind/content.md +3 -3
- package/.claude/skills/mastermind/createorg.md +2 -2
- package/.claude/skills/mastermind/finance.md +3 -3
- package/.claude/skills/mastermind/marketing.md +3 -3
- package/.claude/skills/mastermind/ops.md +3 -3
- package/.claude/skills/mastermind/release.md +3 -3
- package/.claude/skills/mastermind/research.md +3 -3
- package/.claude/skills/mastermind/review.md +3 -3
- package/.claude/skills/mastermind/sales.md +3 -3
- package/package.json +1 -1
- package/packages/@monomind/cli/dist/src/init/statusline-generator.js +3 -3
- package/packages/@monomind/cli/dist/src/observability/replay-reader.d.ts +1 -1
- package/packages/@monomind/cli/dist/src/update/checker.js +24 -7
- package/packages/@monomind/cli/dist/src/update/index.js +3 -6
- package/packages/@monomind/cli/package.json +1 -1
- package/packages/@monomind/cli/dist/src/agents/halt-signal.d.ts +0 -25
- package/packages/@monomind/cli/dist/src/agents/halt-signal.js +0 -76
- package/packages/@monomind/cli/dist/src/agents/index.d.ts +0 -18
- package/packages/@monomind/cli/dist/src/agents/index.js +0 -13
- package/packages/@monomind/cli/dist/src/agents/managed-agent.d.ts +0 -41
- package/packages/@monomind/cli/dist/src/agents/managed-agent.js +0 -69
- package/packages/@monomind/cli/dist/src/agents/prompt-experiment.d.ts +0 -23
- package/packages/@monomind/cli/dist/src/agents/prompt-experiment.js +0 -49
- package/packages/@monomind/cli/dist/src/agents/prompt-version-manager.d.ts +0 -22
- package/packages/@monomind/cli/dist/src/agents/prompt-version-manager.js +0 -80
- package/packages/@monomind/cli/dist/src/agents/registry-query.d.ts +0 -71
- package/packages/@monomind/cli/dist/src/agents/registry-query.js +0 -125
- package/packages/@monomind/cli/dist/src/agents/score-decay.d.ts +0 -19
- package/packages/@monomind/cli/dist/src/agents/score-decay.js +0 -22
- package/packages/@monomind/cli/dist/src/agents/shared-instructions-loader.d.ts +0 -13
- package/packages/@monomind/cli/dist/src/agents/shared-instructions-loader.js +0 -40
- package/packages/@monomind/cli/dist/src/agents/specialization-scorer.d.ts +0 -54
- package/packages/@monomind/cli/dist/src/agents/specialization-scorer.js +0 -212
- package/packages/@monomind/cli/dist/src/agents/termination-watcher.d.ts +0 -30
- package/packages/@monomind/cli/dist/src/agents/termination-watcher.js +0 -84
- package/packages/@monomind/cli/dist/src/agents/trigger-index.d.ts +0 -20
- package/packages/@monomind/cli/dist/src/agents/trigger-index.js +0 -38
- package/packages/@monomind/cli/dist/src/agents/trigger-scanner.d.ts +0 -64
- package/packages/@monomind/cli/dist/src/agents/trigger-scanner.js +0 -308
- package/packages/@monomind/cli/dist/src/agents/version-diff.d.ts +0 -18
- package/packages/@monomind/cli/dist/src/agents/version-diff.js +0 -64
- package/packages/@monomind/cli/dist/src/agents/version-store.d.ts +0 -60
- package/packages/@monomind/cli/dist/src/agents/version-store.js +0 -235
- package/packages/@monomind/cli/dist/src/benchmarks/pretrain/index.d.ts +0 -45
- package/packages/@monomind/cli/dist/src/benchmarks/pretrain/index.js +0 -404
- package/packages/@monomind/cli/dist/src/commands/agent-wasm.d.ts +0 -14
- package/packages/@monomind/cli/dist/src/commands/agent-wasm.js +0 -333
- package/packages/@monomind/cli/dist/src/commands/ui.js +0 -68
- package/packages/@monomind/cli/dist/src/consensus/index.d.ts +0 -7
- package/packages/@monomind/cli/dist/src/consensus/index.js +0 -6
- package/packages/@monomind/cli/dist/src/context/context-provider.d.ts +0 -44
- package/packages/@monomind/cli/dist/src/context/context-provider.js +0 -25
- package/packages/@monomind/cli/dist/src/context/git-state-provider.d.ts +0 -12
- package/packages/@monomind/cli/dist/src/context/git-state-provider.js +0 -34
- package/packages/@monomind/cli/dist/src/context/index.d.ts +0 -12
- package/packages/@monomind/cli/dist/src/context/index.js +0 -12
- package/packages/@monomind/cli/dist/src/context/project-conventions-provider.d.ts +0 -15
- package/packages/@monomind/cli/dist/src/context/project-conventions-provider.js +0 -19
- package/packages/@monomind/cli/dist/src/context/prompt-assembler.d.ts +0 -26
- package/packages/@monomind/cli/dist/src/context/prompt-assembler.js +0 -93
- package/packages/@monomind/cli/dist/src/context/task-history-provider.d.ts +0 -24
- package/packages/@monomind/cli/dist/src/context/task-history-provider.js +0 -32
- package/packages/@monomind/cli/dist/src/context/user-preferences-provider.d.ts +0 -14
- package/packages/@monomind/cli/dist/src/context/user-preferences-provider.js +0 -27
- package/packages/@monomind/cli/dist/src/dlq/dlq-reader.d.ts +0 -31
- package/packages/@monomind/cli/dist/src/dlq/dlq-reader.js +0 -81
- package/packages/@monomind/cli/dist/src/dlq/dlq-writer.d.ts +0 -24
- package/packages/@monomind/cli/dist/src/dlq/dlq-writer.js +0 -65
- package/packages/@monomind/cli/dist/src/dlq/index.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/dlq/index.js +0 -7
- package/packages/@monomind/cli/dist/src/eval/dataset-manager.d.ts +0 -33
- package/packages/@monomind/cli/dist/src/eval/dataset-manager.js +0 -107
- package/packages/@monomind/cli/dist/src/eval/dataset-runner.d.ts +0 -23
- package/packages/@monomind/cli/dist/src/eval/dataset-runner.js +0 -59
- package/packages/@monomind/cli/dist/src/eval/index.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/eval/index.js +0 -7
- package/packages/@monomind/cli/dist/src/eval/trace-collector.d.ts +0 -40
- package/packages/@monomind/cli/dist/src/eval/trace-collector.js +0 -102
- package/packages/@monomind/cli/dist/src/infrastructure/in-memory-repositories.d.ts +0 -68
- package/packages/@monomind/cli/dist/src/infrastructure/in-memory-repositories.js +0 -264
- package/packages/@monomind/cli/dist/src/interactive/interrupt.d.ts +0 -22
- package/packages/@monomind/cli/dist/src/interactive/interrupt.js +0 -71
- package/packages/@monomind/cli/dist/src/mcp/deprecation-injector.d.ts +0 -25
- package/packages/@monomind/cli/dist/src/mcp/deprecation-injector.js +0 -48
- package/packages/@monomind/cli/dist/src/mcp/tool-registry.d.ts +0 -61
- package/packages/@monomind/cli/dist/src/mcp/tool-registry.js +0 -246
- package/packages/@monomind/cli/dist/src/mcp-tools/wasm-agent-tools.d.ts +0 -9
- package/packages/@monomind/cli/dist/src/mcp-tools/wasm-agent-tools.js +0 -230
- package/packages/@monomind/cli/dist/src/model/complexity-scorer.d.ts +0 -21
- package/packages/@monomind/cli/dist/src/model/complexity-scorer.js +0 -106
- package/packages/@monomind/cli/dist/src/model/index.d.ts +0 -4
- package/packages/@monomind/cli/dist/src/model/index.js +0 -4
- package/packages/@monomind/cli/dist/src/model/model-settings.d.ts +0 -22
- package/packages/@monomind/cli/dist/src/model/model-settings.js +0 -33
- package/packages/@monomind/cli/dist/src/model/model-tier-resolver.d.ts +0 -24
- package/packages/@monomind/cli/dist/src/model/model-tier-resolver.js +0 -65
- package/packages/@monomind/cli/dist/src/monovector/capabilities.d.ts +0 -34
- package/packages/@monomind/cli/dist/src/monovector/capabilities.js +0 -37
- package/packages/@monomind/cli/dist/src/orchestration/index.d.ts +0 -7
- package/packages/@monomind/cli/dist/src/orchestration/index.js +0 -6
- package/packages/@monomind/cli/dist/src/orchestration/mode-dispatcher.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/orchestration/mode-dispatcher.js +0 -31
- package/packages/@monomind/cli/dist/src/orchestration/routing-modes.d.ts +0 -68
- package/packages/@monomind/cli/dist/src/orchestration/routing-modes.js +0 -180
- package/packages/@monomind/cli/dist/src/plugins/tests/demo-plugin-store.d.ts +0 -7
- package/packages/@monomind/cli/dist/src/plugins/tests/demo-plugin-store.js +0 -126
- package/packages/@monomind/cli/dist/src/plugins/tests/standalone-test.d.ts +0 -12
- package/packages/@monomind/cli/dist/src/plugins/tests/standalone-test.js +0 -188
- package/packages/@monomind/cli/dist/src/plugins/tests/test-plugin-store.d.ts +0 -7
- package/packages/@monomind/cli/dist/src/plugins/tests/test-plugin-store.js +0 -206
- package/packages/@monomind/cli/dist/src/runtime/headless.d.ts +0 -60
- package/packages/@monomind/cli/dist/src/runtime/headless.js +0 -284
- package/packages/@monomind/cli/dist/src/services/agentic-flow-bridge.d.ts +0 -50
- package/packages/@monomind/cli/dist/src/services/agentic-flow-bridge.js +0 -95
- package/packages/@monomind/cli/dist/src/services/container-worker-pool.d.ts +0 -197
- package/packages/@monomind/cli/dist/src/services/container-worker-pool.js +0 -623
- package/packages/@monomind/cli/dist/src/services/index.d.ts +0 -13
- package/packages/@monomind/cli/dist/src/services/index.js +0 -11
- package/packages/@monomind/cli/dist/src/services/worker-queue.d.ts +0 -201
- package/packages/@monomind/cli/dist/src/services/worker-queue.js +0 -594
- package/packages/@monomind/cli/dist/src/swarm/communication-graph.d.ts +0 -25
- package/packages/@monomind/cli/dist/src/swarm/communication-graph.js +0 -77
- package/packages/@monomind/cli/dist/src/swarm/flow-enforcer.d.ts +0 -31
- package/packages/@monomind/cli/dist/src/swarm/flow-enforcer.js +0 -61
- package/packages/@monomind/cli/dist/src/swarm/flow-visualizer.d.ts +0 -19
- package/packages/@monomind/cli/dist/src/swarm/flow-visualizer.js +0 -68
- package/packages/@monomind/cli/dist/src/transfer/deploy-seraphine.d.ts +0 -13
- package/packages/@monomind/cli/dist/src/transfer/deploy-seraphine.js +0 -205
- package/packages/@monomind/cli/dist/src/transfer/store/tests/standalone-test.d.ts +0 -12
- package/packages/@monomind/cli/dist/src/transfer/store/tests/standalone-test.js +0 -190
- package/packages/@monomind/cli/dist/src/transfer/test-seraphine.d.ts +0 -6
- package/packages/@monomind/cli/dist/src/transfer/test-seraphine.js +0 -105
- package/packages/@monomind/cli/dist/src/transfer/tests/test-store.d.ts +0 -7
- package/packages/@monomind/cli/dist/src/transfer/tests/test-store.js +0 -214
- package/packages/@monomind/cli/dist/src/workflow/condition-evaluator.d.ts +0 -10
- package/packages/@monomind/cli/dist/src/workflow/condition-evaluator.js +0 -82
- package/packages/@monomind/cli/dist/src/workflow/context-resolver.d.ts +0 -12
- package/packages/@monomind/cli/dist/src/workflow/context-resolver.js +0 -23
- package/packages/@monomind/cli/dist/src/workflow/dag-builder.d.ts +0 -17
- package/packages/@monomind/cli/dist/src/workflow/dag-builder.js +0 -129
- package/packages/@monomind/cli/dist/src/workflow/dag-executor.d.ts +0 -9
- package/packages/@monomind/cli/dist/src/workflow/dag-executor.js +0 -116
- package/packages/@monomind/cli/dist/src/workflow/dag-types.d.ts +0 -41
- package/packages/@monomind/cli/dist/src/workflow/dag-types.js +0 -8
- package/packages/@monomind/cli/dist/src/workflow/dsl-parser.d.ts +0 -12
- package/packages/@monomind/cli/dist/src/workflow/dsl-parser.js +0 -20
- package/packages/@monomind/cli/dist/src/workflow/dsl-schema.d.ts +0 -165
- package/packages/@monomind/cli/dist/src/workflow/dsl-schema.js +0 -82
- package/packages/@monomind/cli/dist/src/workflow/index.d.ts +0 -13
- package/packages/@monomind/cli/dist/src/workflow/index.js +0 -11
- package/packages/@monomind/cli/dist/src/workflow/template-engine.d.ts +0 -11
- package/packages/@monomind/cli/dist/src/workflow/template-engine.js +0 -40
- package/packages/@monomind/cli/dist/src/workflow/workflow-executor.d.ts +0 -29
- package/packages/@monomind/cli/dist/src/workflow/workflow-executor.js +0 -227
- package/packages/@monomind/guidance/dist/adversarial.d.ts +0 -284
- package/packages/@monomind/guidance/dist/adversarial.js +0 -572
- package/packages/@monomind/guidance/dist/analyzer.d.ts +0 -530
- package/packages/@monomind/guidance/dist/analyzer.js +0 -2518
- package/packages/@monomind/guidance/dist/artifacts.d.ts +0 -283
- package/packages/@monomind/guidance/dist/artifacts.js +0 -356
- package/packages/@monomind/guidance/dist/authority.d.ts +0 -290
- package/packages/@monomind/guidance/dist/authority.js +0 -558
- package/packages/@monomind/guidance/dist/capabilities.d.ts +0 -209
- package/packages/@monomind/guidance/dist/capabilities.js +0 -485
- package/packages/@monomind/guidance/dist/coherence.d.ts +0 -233
- package/packages/@monomind/guidance/dist/coherence.js +0 -372
- package/packages/@monomind/guidance/dist/compiler.d.ts +0 -87
- package/packages/@monomind/guidance/dist/compiler.js +0 -419
- package/packages/@monomind/guidance/dist/conformance-kit.d.ts +0 -225
- package/packages/@monomind/guidance/dist/conformance-kit.js +0 -629
- package/packages/@monomind/guidance/dist/continue-gate.d.ts +0 -214
- package/packages/@monomind/guidance/dist/continue-gate.js +0 -353
- package/packages/@monomind/guidance/dist/crypto-utils.d.ts +0 -17
- package/packages/@monomind/guidance/dist/crypto-utils.js +0 -24
- package/packages/@monomind/guidance/dist/evolution.d.ts +0 -282
- package/packages/@monomind/guidance/dist/evolution.js +0 -500
- package/packages/@monomind/guidance/dist/gates.d.ts +0 -79
- package/packages/@monomind/guidance/dist/gates.js +0 -302
- package/packages/@monomind/guidance/dist/gateway.d.ts +0 -206
- package/packages/@monomind/guidance/dist/gateway.js +0 -452
- package/packages/@monomind/guidance/dist/generators.d.ts +0 -153
- package/packages/@monomind/guidance/dist/generators.js +0 -682
- package/packages/@monomind/guidance/dist/headless.d.ts +0 -177
- package/packages/@monomind/guidance/dist/headless.js +0 -342
- package/packages/@monomind/guidance/dist/hooks.d.ts +0 -109
- package/packages/@monomind/guidance/dist/hooks.js +0 -347
- package/packages/@monomind/guidance/dist/index.d.ts +0 -205
- package/packages/@monomind/guidance/dist/index.js +0 -321
- package/packages/@monomind/guidance/dist/ledger.d.ts +0 -162
- package/packages/@monomind/guidance/dist/ledger.js +0 -375
- package/packages/@monomind/guidance/dist/manifest-validator.d.ts +0 -289
- package/packages/@monomind/guidance/dist/manifest-validator.js +0 -838
- package/packages/@monomind/guidance/dist/memory-gate.d.ts +0 -222
- package/packages/@monomind/guidance/dist/memory-gate.js +0 -382
- package/packages/@monomind/guidance/dist/meta-governance.d.ts +0 -265
- package/packages/@monomind/guidance/dist/meta-governance.js +0 -348
- package/packages/@monomind/guidance/dist/optimizer.d.ts +0 -104
- package/packages/@monomind/guidance/dist/optimizer.js +0 -329
- package/packages/@monomind/guidance/dist/persistence.d.ts +0 -189
- package/packages/@monomind/guidance/dist/persistence.js +0 -464
- package/packages/@monomind/guidance/dist/proof.d.ts +0 -185
- package/packages/@monomind/guidance/dist/proof.js +0 -238
- package/packages/@monomind/guidance/dist/retriever.d.ts +0 -116
- package/packages/@monomind/guidance/dist/retriever.js +0 -394
- package/packages/@monomind/guidance/dist/ruvbot-integration.d.ts +0 -370
- package/packages/@monomind/guidance/dist/ruvbot-integration.js +0 -738
- package/packages/@monomind/guidance/dist/temporal.d.ts +0 -426
- package/packages/@monomind/guidance/dist/temporal.js +0 -658
- package/packages/@monomind/guidance/dist/trust.d.ts +0 -283
- package/packages/@monomind/guidance/dist/trust.js +0 -473
- package/packages/@monomind/guidance/dist/truth-anchors.d.ts +0 -276
- package/packages/@monomind/guidance/dist/truth-anchors.js +0 -488
- package/packages/@monomind/guidance/dist/types.d.ts +0 -378
- package/packages/@monomind/guidance/dist/types.js +0 -10
- package/packages/@monomind/guidance/dist/uncertainty.d.ts +0 -372
- package/packages/@monomind/guidance/dist/uncertainty.js +0 -619
- package/packages/@monomind/guidance/dist/wasm-kernel.d.ts +0 -48
- package/packages/@monomind/guidance/dist/wasm-kernel.js +0 -158
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { buildDAG, detectCycles, topologicalSort } from './dag-builder.js';
|
|
2
|
-
import { resolveContext } from './context-resolver.js';
|
|
3
|
-
import { getMonitor } from '../production/monitoring.js';
|
|
4
|
-
function classifyError(err) {
|
|
5
|
-
const msg = err.message.toLowerCase();
|
|
6
|
-
if (msg.includes('rate limit') || msg.includes('429') || msg.includes('too many requests'))
|
|
7
|
-
return 'RATE_LIMIT';
|
|
8
|
-
if (msg.includes('timed out') || msg.includes('timeout'))
|
|
9
|
-
return 'TIMEOUT';
|
|
10
|
-
if (msg.includes('validation') || msg.includes('invalid') || msg.includes('schema'))
|
|
11
|
-
return 'VALIDATION';
|
|
12
|
-
return 'UNKNOWN';
|
|
13
|
-
}
|
|
14
|
-
export class DAGExecutor {
|
|
15
|
-
runner;
|
|
16
|
-
constructor(runner) {
|
|
17
|
-
this.runner = runner;
|
|
18
|
-
}
|
|
19
|
-
async execute(tasks) {
|
|
20
|
-
const dag = buildDAG(tasks);
|
|
21
|
-
const cycles = detectCycles(dag);
|
|
22
|
-
if (cycles.length > 0) {
|
|
23
|
-
throw new Error(`Cycle detected in task DAG: ${cycles[0].join(' → ')}`);
|
|
24
|
-
}
|
|
25
|
-
const levels = topologicalSort(dag);
|
|
26
|
-
const results = new Map();
|
|
27
|
-
for (const level of levels) {
|
|
28
|
-
const levelResults = await Promise.all(level.map(async (task) => {
|
|
29
|
-
const context = resolveContext(task, results);
|
|
30
|
-
const timeoutMs = task.timeoutMs ?? 300_000;
|
|
31
|
-
let timeoutHandle;
|
|
32
|
-
const timeoutPromise = new Promise((_, reject) => {
|
|
33
|
-
timeoutHandle = setTimeout(() => reject(new Error(`Task "${task.id}" timed out after ${timeoutMs}ms`)), timeoutMs);
|
|
34
|
-
});
|
|
35
|
-
const result = await Promise.race([
|
|
36
|
-
this.runWithRetry(task, context),
|
|
37
|
-
timeoutPromise,
|
|
38
|
-
]).finally(() => {
|
|
39
|
-
if (timeoutHandle)
|
|
40
|
-
clearTimeout(timeoutHandle);
|
|
41
|
-
}).catch((err) => {
|
|
42
|
-
const isTimeout = String(err).includes('timed out');
|
|
43
|
-
if (isTimeout) {
|
|
44
|
-
// Visible in monomind control — leaked task still running in background
|
|
45
|
-
getMonitor().counter('dag.task.timeout_leak', 1, {
|
|
46
|
-
taskId: task.id,
|
|
47
|
-
agentSlug: task.agentSlug,
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
return {
|
|
51
|
-
taskId: task.id,
|
|
52
|
-
agentSlug: task.agentSlug,
|
|
53
|
-
output: null,
|
|
54
|
-
outputRaw: '',
|
|
55
|
-
latencyMs: 0,
|
|
56
|
-
retryCount: 0,
|
|
57
|
-
completedAt: Date.now(),
|
|
58
|
-
status: isTimeout ? 'timeout' : 'error',
|
|
59
|
-
error: String(err),
|
|
60
|
-
};
|
|
61
|
-
});
|
|
62
|
-
return result;
|
|
63
|
-
}));
|
|
64
|
-
for (const result of levelResults) {
|
|
65
|
-
results.set(result.taskId, result);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return results;
|
|
69
|
-
}
|
|
70
|
-
async runWithRetry(task, context) {
|
|
71
|
-
const policy = task.retryPolicy ?? {
|
|
72
|
-
maxAttempts: 1,
|
|
73
|
-
initialDelayMs: 0,
|
|
74
|
-
backoffMultiplier: 1,
|
|
75
|
-
jitterMs: 0,
|
|
76
|
-
retryOn: [],
|
|
77
|
-
};
|
|
78
|
-
let lastError;
|
|
79
|
-
let actualAttempts = 0;
|
|
80
|
-
for (let attempt = 0; attempt < policy.maxAttempts; attempt++) {
|
|
81
|
-
actualAttempts = attempt + 1;
|
|
82
|
-
try {
|
|
83
|
-
return await this.runner(task, context);
|
|
84
|
-
}
|
|
85
|
-
catch (err) {
|
|
86
|
-
lastError = err;
|
|
87
|
-
// If retryOn is non-empty, check whether this error category matches.
|
|
88
|
-
// Unmatched errors consume the attempt but do not get retried further.
|
|
89
|
-
if (policy.retryOn.length > 0) {
|
|
90
|
-
const category = classifyError(lastError);
|
|
91
|
-
if (!policy.retryOn.includes(category)) {
|
|
92
|
-
break;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
if (attempt < policy.maxAttempts - 1) {
|
|
96
|
-
const delay = policy.initialDelayMs *
|
|
97
|
-
Math.pow(policy.backoffMultiplier, attempt) +
|
|
98
|
-
Math.random() * policy.jitterMs;
|
|
99
|
-
await new Promise((r) => setTimeout(r, delay));
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
return {
|
|
104
|
-
taskId: task.id,
|
|
105
|
-
agentSlug: task.agentSlug,
|
|
106
|
-
output: null,
|
|
107
|
-
outputRaw: '',
|
|
108
|
-
latencyMs: 0,
|
|
109
|
-
retryCount: actualAttempts,
|
|
110
|
-
completedAt: Date.now(),
|
|
111
|
-
status: 'error',
|
|
112
|
-
error: lastError?.message ?? 'Unknown error',
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
//# sourceMappingURL=dag-executor.js.map
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
export interface RetryPolicy {
|
|
2
|
-
maxAttempts: number;
|
|
3
|
-
initialDelayMs: number;
|
|
4
|
-
backoffMultiplier: number;
|
|
5
|
-
jitterMs: number;
|
|
6
|
-
retryOn: Array<'RATE_LIMIT' | 'TIMEOUT' | 'VALIDATION' | 'UNKNOWN'>;
|
|
7
|
-
}
|
|
8
|
-
export declare const DEFAULT_RETRY_POLICY: RetryPolicy;
|
|
9
|
-
export interface DAGTask {
|
|
10
|
-
id: string;
|
|
11
|
-
description: string;
|
|
12
|
-
agentSlug: string;
|
|
13
|
-
contextDeps?: string[];
|
|
14
|
-
outputSchema?: string;
|
|
15
|
-
timeoutMs?: number;
|
|
16
|
-
retryPolicy?: RetryPolicy;
|
|
17
|
-
priority?: 'low' | 'normal' | 'high' | 'critical';
|
|
18
|
-
config?: Record<string, unknown>;
|
|
19
|
-
}
|
|
20
|
-
export interface TaskResult {
|
|
21
|
-
taskId: string;
|
|
22
|
-
agentSlug: string;
|
|
23
|
-
output: unknown;
|
|
24
|
-
outputRaw: string;
|
|
25
|
-
tokenUsage?: {
|
|
26
|
-
input: number;
|
|
27
|
-
output: number;
|
|
28
|
-
};
|
|
29
|
-
latencyMs: number;
|
|
30
|
-
retryCount: number;
|
|
31
|
-
completedAt: number;
|
|
32
|
-
status: 'success' | 'error' | 'timeout';
|
|
33
|
-
error?: string;
|
|
34
|
-
}
|
|
35
|
-
export type DAGLevel = DAGTask[];
|
|
36
|
-
export interface DAG {
|
|
37
|
-
tasks: Map<string, DAGTask>;
|
|
38
|
-
edges: Map<string, Set<string>>;
|
|
39
|
-
reverseEdges: Map<string, Set<string>>;
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=dag-types.d.ts.map
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type WorkflowDefinition } from './dsl-schema.js';
|
|
2
|
-
export declare class DSLParser {
|
|
3
|
-
/**
|
|
4
|
-
* Load and validate a workflow definition from a YAML or JSON file.
|
|
5
|
-
*/
|
|
6
|
-
static loadFromFile(filePath: string): WorkflowDefinition;
|
|
7
|
-
/**
|
|
8
|
-
* Validate an unknown object against the workflow definition schema.
|
|
9
|
-
*/
|
|
10
|
-
static loadFromObject(raw: unknown): WorkflowDefinition;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=dsl-parser.d.ts.map
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from 'node:fs';
|
|
2
|
-
import YAML from 'yaml';
|
|
3
|
-
import { workflowDefinitionSchema, } from './dsl-schema.js';
|
|
4
|
-
export class DSLParser {
|
|
5
|
-
/**
|
|
6
|
-
* Load and validate a workflow definition from a YAML or JSON file.
|
|
7
|
-
*/
|
|
8
|
-
static loadFromFile(filePath) {
|
|
9
|
-
const raw = readFileSync(filePath, 'utf-8');
|
|
10
|
-
const parsed = filePath.endsWith('.json') ? JSON.parse(raw) : YAML.parse(raw);
|
|
11
|
-
return DSLParser.loadFromObject(parsed);
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Validate an unknown object against the workflow definition schema.
|
|
15
|
-
*/
|
|
16
|
-
static loadFromObject(raw) {
|
|
17
|
-
return workflowDefinitionSchema.parse(raw);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=dsl-parser.js.map
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const agentStepSchema: z.ZodObject<{
|
|
3
|
-
id: z.ZodString;
|
|
4
|
-
type: z.ZodLiteral<"agent">;
|
|
5
|
-
agent: z.ZodString;
|
|
6
|
-
task: z.ZodString;
|
|
7
|
-
context_deps: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
8
|
-
output_key: z.ZodOptional<z.ZodString>;
|
|
9
|
-
timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
10
|
-
retry_policy: z.ZodOptional<z.ZodObject<{
|
|
11
|
-
maxAttempts: z.ZodOptional<z.ZodNumber>;
|
|
12
|
-
initialDelayMs: z.ZodOptional<z.ZodNumber>;
|
|
13
|
-
backoffMultiplier: z.ZodOptional<z.ZodNumber>;
|
|
14
|
-
jitterMs: z.ZodOptional<z.ZodNumber>;
|
|
15
|
-
retryOn: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
16
|
-
UNKNOWN: "UNKNOWN";
|
|
17
|
-
RATE_LIMIT: "RATE_LIMIT";
|
|
18
|
-
TIMEOUT: "TIMEOUT";
|
|
19
|
-
VALIDATION: "VALIDATION";
|
|
20
|
-
}>>>;
|
|
21
|
-
}, z.core.$strip>>;
|
|
22
|
-
}, z.core.$strip>;
|
|
23
|
-
export declare const parallelStepSchema: z.ZodObject<{
|
|
24
|
-
id: z.ZodString;
|
|
25
|
-
type: z.ZodLiteral<"parallel">;
|
|
26
|
-
steps: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
27
|
-
}, z.core.$strip>;
|
|
28
|
-
export declare const sequenceStepSchema: z.ZodObject<{
|
|
29
|
-
id: z.ZodString;
|
|
30
|
-
type: z.ZodLiteral<"sequence">;
|
|
31
|
-
steps: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
32
|
-
}, z.core.$strip>;
|
|
33
|
-
export declare const conditionalStepSchema: z.ZodObject<{
|
|
34
|
-
id: z.ZodString;
|
|
35
|
-
type: z.ZodLiteral<"conditional">;
|
|
36
|
-
condition: z.ZodString;
|
|
37
|
-
if_true: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
38
|
-
if_false: z.ZodOptional<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
39
|
-
}, z.core.$strip>;
|
|
40
|
-
export declare const mapReduceStepSchema: z.ZodObject<{
|
|
41
|
-
id: z.ZodString;
|
|
42
|
-
type: z.ZodLiteral<"map_reduce">;
|
|
43
|
-
items: z.ZodString;
|
|
44
|
-
map_agent: z.ZodString;
|
|
45
|
-
map_task: z.ZodString;
|
|
46
|
-
reduce_agent: z.ZodString;
|
|
47
|
-
reduce_task: z.ZodString;
|
|
48
|
-
concurrent: z.ZodOptional<z.ZodNumber>;
|
|
49
|
-
}, z.core.$strip>;
|
|
50
|
-
export declare const loopStepSchema: z.ZodObject<{
|
|
51
|
-
id: z.ZodString;
|
|
52
|
-
type: z.ZodLiteral<"loop">;
|
|
53
|
-
condition: z.ZodString;
|
|
54
|
-
max_iterations: z.ZodNumber;
|
|
55
|
-
body: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
56
|
-
}, z.core.$strip>;
|
|
57
|
-
export declare const workflowStepSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
58
|
-
id: z.ZodString;
|
|
59
|
-
type: z.ZodLiteral<"agent">;
|
|
60
|
-
agent: z.ZodString;
|
|
61
|
-
task: z.ZodString;
|
|
62
|
-
context_deps: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
63
|
-
output_key: z.ZodOptional<z.ZodString>;
|
|
64
|
-
timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
65
|
-
retry_policy: z.ZodOptional<z.ZodObject<{
|
|
66
|
-
maxAttempts: z.ZodOptional<z.ZodNumber>;
|
|
67
|
-
initialDelayMs: z.ZodOptional<z.ZodNumber>;
|
|
68
|
-
backoffMultiplier: z.ZodOptional<z.ZodNumber>;
|
|
69
|
-
jitterMs: z.ZodOptional<z.ZodNumber>;
|
|
70
|
-
retryOn: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
71
|
-
UNKNOWN: "UNKNOWN";
|
|
72
|
-
RATE_LIMIT: "RATE_LIMIT";
|
|
73
|
-
TIMEOUT: "TIMEOUT";
|
|
74
|
-
VALIDATION: "VALIDATION";
|
|
75
|
-
}>>>;
|
|
76
|
-
}, z.core.$strip>>;
|
|
77
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
78
|
-
id: z.ZodString;
|
|
79
|
-
type: z.ZodLiteral<"parallel">;
|
|
80
|
-
steps: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
81
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
82
|
-
id: z.ZodString;
|
|
83
|
-
type: z.ZodLiteral<"sequence">;
|
|
84
|
-
steps: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
85
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
86
|
-
id: z.ZodString;
|
|
87
|
-
type: z.ZodLiteral<"conditional">;
|
|
88
|
-
condition: z.ZodString;
|
|
89
|
-
if_true: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
90
|
-
if_false: z.ZodOptional<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
91
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
92
|
-
id: z.ZodString;
|
|
93
|
-
type: z.ZodLiteral<"map_reduce">;
|
|
94
|
-
items: z.ZodString;
|
|
95
|
-
map_agent: z.ZodString;
|
|
96
|
-
map_task: z.ZodString;
|
|
97
|
-
reduce_agent: z.ZodString;
|
|
98
|
-
reduce_task: z.ZodString;
|
|
99
|
-
concurrent: z.ZodOptional<z.ZodNumber>;
|
|
100
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
101
|
-
id: z.ZodString;
|
|
102
|
-
type: z.ZodLiteral<"loop">;
|
|
103
|
-
condition: z.ZodString;
|
|
104
|
-
max_iterations: z.ZodNumber;
|
|
105
|
-
body: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
106
|
-
}, z.core.$strip>], "type">;
|
|
107
|
-
export type WorkflowStep = z.infer<typeof workflowStepSchema>;
|
|
108
|
-
export declare const workflowDefinitionSchema: z.ZodObject<{
|
|
109
|
-
name: z.ZodString;
|
|
110
|
-
version: z.ZodString;
|
|
111
|
-
description: z.ZodOptional<z.ZodString>;
|
|
112
|
-
variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
113
|
-
steps: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
114
|
-
id: z.ZodString;
|
|
115
|
-
type: z.ZodLiteral<"agent">;
|
|
116
|
-
agent: z.ZodString;
|
|
117
|
-
task: z.ZodString;
|
|
118
|
-
context_deps: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
119
|
-
output_key: z.ZodOptional<z.ZodString>;
|
|
120
|
-
timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
121
|
-
retry_policy: z.ZodOptional<z.ZodObject<{
|
|
122
|
-
maxAttempts: z.ZodOptional<z.ZodNumber>;
|
|
123
|
-
initialDelayMs: z.ZodOptional<z.ZodNumber>;
|
|
124
|
-
backoffMultiplier: z.ZodOptional<z.ZodNumber>;
|
|
125
|
-
jitterMs: z.ZodOptional<z.ZodNumber>;
|
|
126
|
-
retryOn: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
127
|
-
UNKNOWN: "UNKNOWN";
|
|
128
|
-
RATE_LIMIT: "RATE_LIMIT";
|
|
129
|
-
TIMEOUT: "TIMEOUT";
|
|
130
|
-
VALIDATION: "VALIDATION";
|
|
131
|
-
}>>>;
|
|
132
|
-
}, z.core.$strip>>;
|
|
133
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
134
|
-
id: z.ZodString;
|
|
135
|
-
type: z.ZodLiteral<"parallel">;
|
|
136
|
-
steps: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
137
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
138
|
-
id: z.ZodString;
|
|
139
|
-
type: z.ZodLiteral<"sequence">;
|
|
140
|
-
steps: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
141
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
142
|
-
id: z.ZodString;
|
|
143
|
-
type: z.ZodLiteral<"conditional">;
|
|
144
|
-
condition: z.ZodString;
|
|
145
|
-
if_true: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
146
|
-
if_false: z.ZodOptional<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
147
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
148
|
-
id: z.ZodString;
|
|
149
|
-
type: z.ZodLiteral<"map_reduce">;
|
|
150
|
-
items: z.ZodString;
|
|
151
|
-
map_agent: z.ZodString;
|
|
152
|
-
map_task: z.ZodString;
|
|
153
|
-
reduce_agent: z.ZodString;
|
|
154
|
-
reduce_task: z.ZodString;
|
|
155
|
-
concurrent: z.ZodOptional<z.ZodNumber>;
|
|
156
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
157
|
-
id: z.ZodString;
|
|
158
|
-
type: z.ZodLiteral<"loop">;
|
|
159
|
-
condition: z.ZodString;
|
|
160
|
-
max_iterations: z.ZodNumber;
|
|
161
|
-
body: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
162
|
-
}, z.core.$strip>], "type">>;
|
|
163
|
-
}, z.core.$strip>;
|
|
164
|
-
export type WorkflowDefinition = z.infer<typeof workflowDefinitionSchema>;
|
|
165
|
-
//# sourceMappingURL=dsl-schema.d.ts.map
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
// ---------- Retry policy (reuse shape from dag-types) ----------
|
|
3
|
-
const retryPolicySchema = z.object({
|
|
4
|
-
maxAttempts: z.number().int().min(1).max(10).optional(),
|
|
5
|
-
initialDelayMs: z.number().int().min(0).optional(),
|
|
6
|
-
backoffMultiplier: z.number().min(1).optional(),
|
|
7
|
-
jitterMs: z.number().int().min(0).optional(),
|
|
8
|
-
retryOn: z
|
|
9
|
-
.array(z.enum(['RATE_LIMIT', 'TIMEOUT', 'VALIDATION', 'UNKNOWN']))
|
|
10
|
-
.optional(),
|
|
11
|
-
});
|
|
12
|
-
// ---------- Lazy wrapper for recursive step references ----------
|
|
13
|
-
// Use ZodTypeAny to avoid circular type reference (WorkflowStep is defined below)
|
|
14
|
-
const lazyStep = z.lazy(() => workflowStepSchema);
|
|
15
|
-
// ---------- 6 step-type schemas ----------
|
|
16
|
-
export const agentStepSchema = z.object({
|
|
17
|
-
id: z.string().min(1),
|
|
18
|
-
type: z.literal('agent'),
|
|
19
|
-
agent: z.string().min(1),
|
|
20
|
-
task: z.string().min(1),
|
|
21
|
-
context_deps: z.array(z.string()).optional(),
|
|
22
|
-
output_key: z.string().optional(),
|
|
23
|
-
timeout_ms: z.number().int().positive().optional(),
|
|
24
|
-
retry_policy: retryPolicySchema.optional(),
|
|
25
|
-
});
|
|
26
|
-
export const parallelStepSchema = z.object({
|
|
27
|
-
id: z.string().min(1),
|
|
28
|
-
type: z.literal('parallel'),
|
|
29
|
-
steps: z.array(lazyStep).min(2).max(50),
|
|
30
|
-
});
|
|
31
|
-
export const sequenceStepSchema = z.object({
|
|
32
|
-
id: z.string().min(1),
|
|
33
|
-
type: z.literal('sequence'),
|
|
34
|
-
steps: z.array(lazyStep).min(1),
|
|
35
|
-
});
|
|
36
|
-
export const conditionalStepSchema = z.object({
|
|
37
|
-
id: z.string().min(1),
|
|
38
|
-
type: z.literal('conditional'),
|
|
39
|
-
condition: z.string().min(1),
|
|
40
|
-
if_true: lazyStep,
|
|
41
|
-
if_false: lazyStep.optional(),
|
|
42
|
-
});
|
|
43
|
-
export const mapReduceStepSchema = z.object({
|
|
44
|
-
id: z.string().min(1),
|
|
45
|
-
type: z.literal('map_reduce'),
|
|
46
|
-
items: z.string().min(1),
|
|
47
|
-
map_agent: z.string().min(1),
|
|
48
|
-
map_task: z.string().min(1),
|
|
49
|
-
reduce_agent: z.string().min(1),
|
|
50
|
-
reduce_task: z.string().min(1),
|
|
51
|
-
concurrent: z.number().int().min(1).max(500).optional(),
|
|
52
|
-
});
|
|
53
|
-
export const loopStepSchema = z.object({
|
|
54
|
-
id: z.string().min(1),
|
|
55
|
-
type: z.literal('loop'),
|
|
56
|
-
condition: z.string().min(1),
|
|
57
|
-
max_iterations: z.number().int().min(1).max(100),
|
|
58
|
-
body: z.array(lazyStep).min(1),
|
|
59
|
-
});
|
|
60
|
-
// ---------- Discriminated union of all step types ----------
|
|
61
|
-
export const workflowStepSchema = z.discriminatedUnion('type', [
|
|
62
|
-
agentStepSchema,
|
|
63
|
-
parallelStepSchema,
|
|
64
|
-
sequenceStepSchema,
|
|
65
|
-
conditionalStepSchema,
|
|
66
|
-
mapReduceStepSchema,
|
|
67
|
-
loopStepSchema,
|
|
68
|
-
]);
|
|
69
|
-
// ---------- Semver regex ----------
|
|
70
|
-
const semverRegex = /^\d+\.\d+\.\d+(-[\w.]+)?$/;
|
|
71
|
-
// ---------- Top-level workflow definition ----------
|
|
72
|
-
export const workflowDefinitionSchema = z.object({
|
|
73
|
-
name: z.string().min(1),
|
|
74
|
-
version: z.string().regex(semverRegex, 'version must be valid semver (e.g. 1.0.0)'),
|
|
75
|
-
description: z.string().optional(),
|
|
76
|
-
variables: z.record(z.string(), z.unknown()).optional(),
|
|
77
|
-
steps: z.array(workflowStepSchema).min(1),
|
|
78
|
-
}).refine((def) => {
|
|
79
|
-
const ids = def.steps.map((s) => s.id);
|
|
80
|
-
return ids.length === new Set(ids).size;
|
|
81
|
-
}, { message: 'Workflow step IDs must be unique', path: ['steps'] });
|
|
82
|
-
//# sourceMappingURL=dsl-schema.js.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export { buildDAG, detectCycles, topologicalSort } from './dag-builder.js';
|
|
2
|
-
export { DAGExecutor, type TaskRunner } from './dag-executor.js';
|
|
3
|
-
export { resolveContext, ContextResolutionError } from './context-resolver.js';
|
|
4
|
-
export type { DAGTask, TaskResult, DAGLevel, DAG, RetryPolicy, } from './dag-types.js';
|
|
5
|
-
export { DEFAULT_RETRY_POLICY } from './dag-types.js';
|
|
6
|
-
export { workflowStepSchema, workflowDefinitionSchema, agentStepSchema, parallelStepSchema, sequenceStepSchema, conditionalStepSchema, mapReduceStepSchema, loopStepSchema, } from './dsl-schema.js';
|
|
7
|
-
export type { WorkflowStep, WorkflowDefinition } from './dsl-schema.js';
|
|
8
|
-
export { DSLParser } from './dsl-parser.js';
|
|
9
|
-
export { substitute } from './template-engine.js';
|
|
10
|
-
export { evaluateCondition } from './condition-evaluator.js';
|
|
11
|
-
export { WorkflowExecutor } from './workflow-executor.js';
|
|
12
|
-
export type { AgentDispatcher, StepResult, WorkflowResult, } from './workflow-executor.js';
|
|
13
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export { buildDAG, detectCycles, topologicalSort } from './dag-builder.js';
|
|
2
|
-
export { DAGExecutor } from './dag-executor.js';
|
|
3
|
-
export { resolveContext, ContextResolutionError } from './context-resolver.js';
|
|
4
|
-
export { DEFAULT_RETRY_POLICY } from './dag-types.js';
|
|
5
|
-
// DSL workflow modules
|
|
6
|
-
export { workflowStepSchema, workflowDefinitionSchema, agentStepSchema, parallelStepSchema, sequenceStepSchema, conditionalStepSchema, mapReduceStepSchema, loopStepSchema, } from './dsl-schema.js';
|
|
7
|
-
export { DSLParser } from './dsl-parser.js';
|
|
8
|
-
export { substitute } from './template-engine.js';
|
|
9
|
-
export { evaluateCondition } from './condition-evaluator.js';
|
|
10
|
-
export { WorkflowExecutor } from './workflow-executor.js';
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Substitute {{variable}} and {{step-id.field}} placeholders in a template
|
|
3
|
-
* string using values from a context object.
|
|
4
|
-
*
|
|
5
|
-
* - `{{variable}}` resolves to `context[variable]`
|
|
6
|
-
* - `{{a.b.c}}` resolves to nested path `context.a.b.c`
|
|
7
|
-
*
|
|
8
|
-
* Safe regex-based — no eval.
|
|
9
|
-
*/
|
|
10
|
-
export declare function substitute(template: string, context: Record<string, unknown>): string;
|
|
11
|
-
//# sourceMappingURL=template-engine.d.ts.map
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Substitute {{variable}} and {{step-id.field}} placeholders in a template
|
|
3
|
-
* string using values from a context object.
|
|
4
|
-
*
|
|
5
|
-
* - `{{variable}}` resolves to `context[variable]`
|
|
6
|
-
* - `{{a.b.c}}` resolves to nested path `context.a.b.c`
|
|
7
|
-
*
|
|
8
|
-
* Safe regex-based — no eval.
|
|
9
|
-
*/
|
|
10
|
-
export function substitute(template, context) {
|
|
11
|
-
return template.replace(/\{\{([\w./-]+)\}\}/g, (_match, path) => {
|
|
12
|
-
const value = resolvePath(context, path);
|
|
13
|
-
if (value === undefined) {
|
|
14
|
-
return `{{${path}}}`;
|
|
15
|
-
}
|
|
16
|
-
return String(value);
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
const BLOCKED_KEYS = new Set(['__proto__', 'constructor', 'prototype']);
|
|
20
|
-
function resolvePath(obj, path) {
|
|
21
|
-
const segments = path.split('.');
|
|
22
|
-
let current = obj;
|
|
23
|
-
for (const segment of segments) {
|
|
24
|
-
if (current === null || current === undefined) {
|
|
25
|
-
return undefined;
|
|
26
|
-
}
|
|
27
|
-
if (typeof current !== 'object') {
|
|
28
|
-
return undefined;
|
|
29
|
-
}
|
|
30
|
-
if (BLOCKED_KEYS.has(segment)) {
|
|
31
|
-
return undefined;
|
|
32
|
-
}
|
|
33
|
-
if (!Object.prototype.hasOwnProperty.call(current, segment)) {
|
|
34
|
-
return undefined;
|
|
35
|
-
}
|
|
36
|
-
current = current[segment];
|
|
37
|
-
}
|
|
38
|
-
return current;
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=template-engine.js.map
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { WorkflowDefinition } from './dsl-schema.js';
|
|
2
|
-
export interface AgentDispatcher {
|
|
3
|
-
dispatch(agent: string, task: string, context: Record<string, unknown>): Promise<unknown>;
|
|
4
|
-
}
|
|
5
|
-
export interface StepResult {
|
|
6
|
-
stepId: string;
|
|
7
|
-
output: unknown;
|
|
8
|
-
status: 'success' | 'error';
|
|
9
|
-
error?: string;
|
|
10
|
-
}
|
|
11
|
-
export interface WorkflowResult {
|
|
12
|
-
workflowName: string;
|
|
13
|
-
status: 'success' | 'error';
|
|
14
|
-
stepResults: StepResult[];
|
|
15
|
-
context: Record<string, unknown>;
|
|
16
|
-
}
|
|
17
|
-
export declare class WorkflowExecutor {
|
|
18
|
-
private readonly dispatcher;
|
|
19
|
-
constructor(dispatcher: AgentDispatcher);
|
|
20
|
-
execute(workflow: WorkflowDefinition): Promise<WorkflowResult>;
|
|
21
|
-
private executeStep;
|
|
22
|
-
private executeAgent;
|
|
23
|
-
private executeParallel;
|
|
24
|
-
private executeSequence;
|
|
25
|
-
private executeConditional;
|
|
26
|
-
private executeMapReduce;
|
|
27
|
-
private executeLoop;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=workflow-executor.d.ts.map
|