@namzu/sdk 59.0.0 → 60.1.0
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/CHANGELOG.md +120 -0
- package/dist/agents/QueryAgent.d.ts.map +1 -1
- package/dist/agents/QueryAgent.js +1 -0
- package/dist/agents/QueryAgent.js.map +1 -1
- package/dist/bridge/a2a/mapper.d.ts.map +1 -1
- package/dist/bridge/a2a/mapper.js +16 -0
- package/dist/bridge/a2a/mapper.js.map +1 -1
- package/dist/bridge/acp/update.d.ts.map +1 -1
- package/dist/bridge/acp/update.js +1 -0
- package/dist/bridge/acp/update.js.map +1 -1
- package/dist/bridge/sse/mapper.d.ts.map +1 -1
- package/dist/bridge/sse/mapper.js +12 -0
- package/dist/bridge/sse/mapper.js.map +1 -1
- package/dist/compaction/context-window.d.ts +53 -0
- package/dist/compaction/context-window.d.ts.map +1 -1
- package/dist/compaction/context-window.js +141 -2
- package/dist/compaction/context-window.js.map +1 -1
- package/dist/constants/continuation.d.ts +9 -0
- package/dist/constants/continuation.d.ts.map +1 -1
- package/dist/constants/continuation.js +9 -0
- package/dist/constants/continuation.js.map +1 -1
- package/dist/contracts/session/api.d.ts +7 -1
- package/dist/contracts/session/api.d.ts.map +1 -1
- package/dist/execution/workflow/index.d.ts +3 -1
- package/dist/execution/workflow/index.d.ts.map +1 -1
- package/dist/execution/workflow/index.js +2 -1
- package/dist/execution/workflow/index.js.map +1 -1
- package/dist/execution/workflow/journal.d.ts +24 -4
- package/dist/execution/workflow/journal.d.ts.map +1 -1
- package/dist/execution/workflow/journal.js +131 -9
- package/dist/execution/workflow/journal.js.map +1 -1
- package/dist/execution/workflow/prelude.d.ts +2 -0
- package/dist/execution/workflow/prelude.d.ts.map +1 -1
- package/dist/execution/workflow/prelude.js +49 -8
- package/dist/execution/workflow/prelude.js.map +1 -1
- package/dist/execution/workflow/resume.d.ts +59 -0
- package/dist/execution/workflow/resume.d.ts.map +1 -0
- package/dist/execution/workflow/resume.js +273 -0
- package/dist/execution/workflow/resume.js.map +1 -0
- package/dist/execution/workflow/runtime.d.ts.map +1 -1
- package/dist/execution/workflow/runtime.js +112 -8
- package/dist/execution/workflow/runtime.js.map +1 -1
- package/dist/execution/workflow/types.d.ts +105 -1
- package/dist/execution/workflow/types.d.ts.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/manager/session/turn-recorder.d.ts.map +1 -1
- package/dist/manager/session/turn-recorder.js +1 -0
- package/dist/manager/session/turn-recorder.js.map +1 -1
- package/dist/plugin/compat.d.ts +24 -0
- package/dist/plugin/compat.d.ts.map +1 -0
- package/dist/plugin/compat.js +149 -0
- package/dist/plugin/compat.js.map +1 -0
- package/dist/plugin/loader.d.ts +2 -1
- package/dist/plugin/loader.d.ts.map +1 -1
- package/dist/plugin/loader.js +6 -0
- package/dist/plugin/loader.js.map +1 -1
- package/dist/pricing/index.d.ts.map +1 -1
- package/dist/pricing/index.js +2 -1
- package/dist/pricing/index.js.map +1 -1
- package/dist/process/kill-tree.d.ts +44 -0
- package/dist/process/kill-tree.d.ts.map +1 -1
- package/dist/process/kill-tree.js +102 -4
- package/dist/process/kill-tree.js.map +1 -1
- package/dist/prompt/coding-agent-doctrine.d.ts +1 -1
- package/dist/prompt/coding-agent-doctrine.d.ts.map +1 -1
- package/dist/prompt/coding-agent-doctrine.js +9 -1
- package/dist/prompt/coding-agent-doctrine.js.map +1 -1
- package/dist/provider/collect-chat-completion.d.ts.map +1 -1
- package/dist/provider/collect-chat-completion.js +4 -0
- package/dist/provider/collect-chat-completion.js.map +1 -1
- package/dist/provider/fallback.d.ts.map +1 -1
- package/dist/provider/fallback.js +11 -0
- package/dist/provider/fallback.js.map +1 -1
- package/dist/provider/idle-timeout.d.ts.map +1 -1
- package/dist/provider/idle-timeout.js +5 -0
- package/dist/provider/idle-timeout.js.map +1 -1
- package/dist/provider/mock.d.ts +2 -0
- package/dist/provider/mock.d.ts.map +1 -1
- package/dist/provider/mock.js +16 -8
- package/dist/provider/mock.js.map +1 -1
- package/dist/provider/model-window-suffix.d.ts +18 -0
- package/dist/provider/model-window-suffix.d.ts.map +1 -0
- package/dist/provider/model-window-suffix.js +78 -0
- package/dist/provider/model-window-suffix.js.map +1 -0
- package/dist/provider/retry.d.ts.map +1 -1
- package/dist/provider/retry.js +5 -0
- package/dist/provider/retry.js.map +1 -1
- package/dist/public-runtime.d.ts +5 -3
- package/dist/public-runtime.d.ts.map +1 -1
- package/dist/public-runtime.js +5 -4
- package/dist/public-runtime.js.map +1 -1
- package/dist/public-types.d.ts +1 -0
- package/dist/public-types.d.ts.map +1 -1
- package/dist/registry/command/kernel-commands.d.ts +1 -4
- package/dist/registry/command/kernel-commands.d.ts.map +1 -1
- package/dist/registry/command/kernel-commands.js +0 -28
- package/dist/registry/command/kernel-commands.js.map +1 -1
- package/dist/runtime/jobs/awaited-jobs.d.ts +6 -0
- package/dist/runtime/jobs/awaited-jobs.d.ts.map +1 -1
- package/dist/runtime/jobs/awaited-jobs.js +11 -0
- package/dist/runtime/jobs/awaited-jobs.js.map +1 -1
- package/dist/runtime/jobs/host-exit-finalizer.d.ts +20 -0
- package/dist/runtime/jobs/host-exit-finalizer.d.ts.map +1 -0
- package/dist/runtime/jobs/host-exit-finalizer.js +57 -0
- package/dist/runtime/jobs/host-exit-finalizer.js.map +1 -0
- package/dist/runtime/jobs/liveness.d.ts +67 -0
- package/dist/runtime/jobs/liveness.d.ts.map +1 -0
- package/dist/runtime/jobs/liveness.js +94 -0
- package/dist/runtime/jobs/liveness.js.map +1 -0
- package/dist/runtime/jobs/registry.d.ts +21 -0
- package/dist/runtime/jobs/registry.d.ts.map +1 -1
- package/dist/runtime/jobs/registry.js +104 -2
- package/dist/runtime/jobs/registry.js.map +1 -1
- package/dist/runtime/jobs/wake-budget.d.ts +35 -0
- package/dist/runtime/jobs/wake-budget.d.ts.map +1 -0
- package/dist/runtime/jobs/wake-budget.js +48 -0
- package/dist/runtime/jobs/wake-budget.js.map +1 -0
- package/dist/runtime/query/detached-calls.d.ts +65 -0
- package/dist/runtime/query/detached-calls.d.ts.map +1 -0
- package/dist/runtime/query/detached-calls.js +116 -0
- package/dist/runtime/query/detached-calls.js.map +1 -0
- package/dist/runtime/query/executor.d.ts +4 -1
- package/dist/runtime/query/executor.d.ts.map +1 -1
- package/dist/runtime/query/executor.js +90 -6
- package/dist/runtime/query/executor.js.map +1 -1
- package/dist/runtime/query/index.d.ts +34 -0
- package/dist/runtime/query/index.d.ts.map +1 -1
- package/dist/runtime/query/index.js +32 -5
- package/dist/runtime/query/index.js.map +1 -1
- package/dist/runtime/query/iteration/effort-clamp.d.ts +13 -0
- package/dist/runtime/query/iteration/effort-clamp.d.ts.map +1 -0
- package/dist/runtime/query/iteration/effort-clamp.js +42 -0
- package/dist/runtime/query/iteration/effort-clamp.js.map +1 -0
- package/dist/runtime/query/iteration/index.d.ts +34 -0
- package/dist/runtime/query/iteration/index.d.ts.map +1 -1
- package/dist/runtime/query/iteration/index.js +199 -6
- package/dist/runtime/query/iteration/index.js.map +1 -1
- package/dist/runtime/query/iteration/outstanding-work.d.ts.map +1 -1
- package/dist/runtime/query/iteration/outstanding-work.js +11 -3
- package/dist/runtime/query/iteration/outstanding-work.js.map +1 -1
- package/dist/runtime/query/iteration/phases/context.d.ts +9 -0
- package/dist/runtime/query/iteration/phases/context.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/context.js.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.js +63 -1
- package/dist/runtime/query/iteration/phases/tool-review.js.map +1 -1
- package/dist/runtime/query/iteration/stream-turn.d.ts.map +1 -1
- package/dist/runtime/query/iteration/stream-turn.js +6 -0
- package/dist/runtime/query/iteration/stream-turn.js.map +1 -1
- package/dist/runtime/query/session-storage.d.ts.map +1 -1
- package/dist/runtime/query/session-storage.js +8 -3
- package/dist/runtime/query/session-storage.js.map +1 -1
- package/dist/runtime/query/steering.d.ts +29 -3
- package/dist/runtime/query/steering.d.ts.map +1 -1
- package/dist/runtime/query/steering.js +58 -3
- package/dist/runtime/query/steering.js.map +1 -1
- package/dist/runtime/query/tooling.d.ts +1 -0
- package/dist/runtime/query/tooling.d.ts.map +1 -1
- package/dist/runtime/query/tooling.js +1 -0
- package/dist/runtime/query/tooling.js.map +1 -1
- package/dist/runtime/system-events.d.ts +5 -0
- package/dist/runtime/system-events.d.ts.map +1 -1
- package/dist/runtime/system-events.js +7 -1
- package/dist/runtime/system-events.js.map +1 -1
- package/dist/sandbox/denial.d.ts +11 -0
- package/dist/sandbox/denial.d.ts.map +1 -0
- package/dist/sandbox/denial.js +61 -0
- package/dist/sandbox/denial.js.map +1 -0
- package/dist/sandbox/file-walk-program.d.ts.map +1 -1
- package/dist/sandbox/file-walk-program.js +31 -13
- package/dist/sandbox/file-walk-program.js.map +1 -1
- package/dist/sandbox/file-walk.d.ts +2 -0
- package/dist/sandbox/file-walk.d.ts.map +1 -1
- package/dist/sandbox/file-walk.js +64 -13
- package/dist/sandbox/file-walk.js.map +1 -1
- package/dist/sandbox/ignore-matcher.d.ts +30 -0
- package/dist/sandbox/ignore-matcher.d.ts.map +1 -0
- package/dist/sandbox/ignore-matcher.js +11 -0
- package/dist/sandbox/ignore-matcher.js.map +1 -0
- package/dist/sandbox/ignore-source.d.ts +26 -0
- package/dist/sandbox/ignore-source.d.ts.map +1 -0
- package/dist/sandbox/ignore-source.js +221 -0
- package/dist/sandbox/ignore-source.js.map +1 -0
- package/dist/sandbox/provider/local.d.ts.map +1 -1
- package/dist/sandbox/provider/local.js +11 -1
- package/dist/sandbox/provider/local.js.map +1 -1
- package/dist/scheduler/completion-inbox.d.ts.map +1 -1
- package/dist/scheduler/completion-inbox.js +1 -0
- package/dist/scheduler/completion-inbox.js.map +1 -1
- package/dist/session/log-hash.d.ts.map +1 -1
- package/dist/session/log-hash.js +18 -1
- package/dist/session/log-hash.js.map +1 -1
- package/dist/store/memory/disk.d.ts.map +1 -1
- package/dist/store/memory/disk.js +1 -1
- package/dist/store/memory/disk.js.map +1 -1
- package/dist/store/memory/markdown.d.ts.map +1 -1
- package/dist/store/memory/markdown.js +1 -1
- package/dist/store/memory/markdown.js.map +1 -1
- package/dist/store/memory/operation-lock.d.ts +20 -4
- package/dist/store/memory/operation-lock.d.ts.map +1 -1
- package/dist/store/memory/operation-lock.js +235 -58
- package/dist/store/memory/operation-lock.js.map +1 -1
- package/dist/store/session-index/sqlite.d.ts.map +1 -1
- package/dist/store/session-index/sqlite.js +169 -16
- package/dist/store/session-index/sqlite.js.map +1 -1
- package/dist/tools/builtins/bash.d.ts.map +1 -1
- package/dist/tools/builtins/bash.js +10 -4
- package/dist/tools/builtins/bash.js.map +1 -1
- package/dist/tools/builtins/computer-use.d.ts +35 -0
- package/dist/tools/builtins/computer-use.d.ts.map +1 -1
- package/dist/tools/builtins/computer-use.js +512 -67
- package/dist/tools/builtins/computer-use.js.map +1 -1
- package/dist/tools/builtins/glob.d.ts +1 -0
- package/dist/tools/builtins/glob.d.ts.map +1 -1
- package/dist/tools/builtins/glob.js +65 -28
- package/dist/tools/builtins/glob.js.map +1 -1
- package/dist/tools/builtins/grep.d.ts +2 -0
- package/dist/tools/builtins/grep.d.ts.map +1 -1
- package/dist/tools/builtins/grep.js +94 -40
- package/dist/tools/builtins/grep.js.map +1 -1
- package/dist/tools/builtins/job.d.ts +1 -1
- package/dist/tools/builtins/job.d.ts.map +1 -1
- package/dist/tools/builtins/job.js +34 -7
- package/dist/tools/builtins/job.js.map +1 -1
- package/dist/tools/builtins/search-support.d.ts +44 -0
- package/dist/tools/builtins/search-support.d.ts.map +1 -0
- package/dist/tools/builtins/search-support.js +89 -0
- package/dist/tools/builtins/search-support.js.map +1 -0
- package/dist/tools/builtins/wait-for-job-bounds.d.ts +2 -0
- package/dist/tools/builtins/wait-for-job-bounds.d.ts.map +1 -1
- package/dist/tools/builtins/wait-for-job-bounds.js +3 -1
- package/dist/tools/builtins/wait-for-job-bounds.js.map +1 -1
- package/dist/tools/builtins/wait-for-job.d.ts +1 -1
- package/dist/tools/builtins/wait-for-job.d.ts.map +1 -1
- package/dist/tools/builtins/wait-for-job.js +13 -2
- package/dist/tools/builtins/wait-for-job.js.map +1 -1
- package/dist/tools/command-shell.d.ts.map +1 -1
- package/dist/tools/command-shell.js +14 -5
- package/dist/tools/command-shell.js.map +1 -1
- package/dist/turn/reporter.d.ts.map +1 -1
- package/dist/turn/reporter.js +11 -0
- package/dist/turn/reporter.js.map +1 -1
- package/dist/types/agent/query.d.ts +2 -0
- package/dist/types/agent/query.d.ts.map +1 -1
- package/dist/types/computer-use/index.d.ts +129 -13
- package/dist/types/computer-use/index.d.ts.map +1 -1
- package/dist/types/computer-use/index.js.map +1 -1
- package/dist/types/message/index.d.ts +1 -1
- package/dist/types/message/index.d.ts.map +1 -1
- package/dist/types/message/index.js +1 -0
- package/dist/types/message/index.js.map +1 -1
- package/dist/types/plugin/index.d.ts +24 -0
- package/dist/types/plugin/index.d.ts.map +1 -1
- package/dist/types/plugin/index.js +4 -0
- package/dist/types/plugin/index.js.map +1 -1
- package/dist/types/provider/chat.d.ts +19 -0
- package/dist/types/provider/chat.d.ts.map +1 -1
- package/dist/types/provider/config.d.ts +7 -0
- package/dist/types/provider/config.d.ts.map +1 -1
- package/dist/types/provider/index.d.ts +1 -1
- package/dist/types/provider/index.d.ts.map +1 -1
- package/dist/types/provider/interface.d.ts +15 -0
- package/dist/types/provider/interface.d.ts.map +1 -1
- package/dist/types/provider/stream.d.ts +6 -0
- package/dist/types/provider/stream.d.ts.map +1 -1
- package/dist/types/sandbox/index.d.ts +38 -1
- package/dist/types/sandbox/index.d.ts.map +1 -1
- package/dist/types/sandbox/index.js.map +1 -1
- package/dist/types/session/events.d.ts +34 -0
- package/dist/types/session/events.d.ts.map +1 -1
- package/dist/types/session/events.js.map +1 -1
- package/dist/types/session/records.d.ts +298 -34
- package/dist/types/session/records.d.ts.map +1 -1
- package/dist/types/session/records.js +35 -1
- package/dist/types/session/records.js.map +1 -1
- package/dist/types/session/stop-reason.d.ts +11 -0
- package/dist/types/session/stop-reason.d.ts.map +1 -1
- package/dist/types/tool/index.d.ts +30 -0
- package/dist/types/tool/index.d.ts.map +1 -1
- package/dist/types/tool/index.js.map +1 -1
- package/dist/types/tool/presentation.d.ts +8 -0
- package/dist/types/tool/presentation.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/agents/QueryAgent.ts +1 -0
- package/src/bridge/a2a/mapper.ts +19 -0
- package/src/bridge/acp/update.ts +6 -1
- package/src/bridge/sse/mapper.ts +13 -0
- package/src/compaction/context-window.ts +163 -2
- package/src/constants/continuation.ts +13 -0
- package/src/contracts/session/api.ts +6 -0
- package/src/execution/workflow/index.ts +14 -1
- package/src/execution/workflow/journal.ts +161 -11
- package/src/execution/workflow/prelude.ts +51 -8
- package/src/execution/workflow/resume.ts +313 -0
- package/src/execution/workflow/runtime.ts +127 -9
- package/src/execution/workflow/types.ts +109 -1
- package/src/index.ts +17 -0
- package/src/manager/session/turn-recorder.ts +1 -0
- package/src/plugin/compat.ts +173 -0
- package/src/plugin/loader.ts +7 -1
- package/src/pricing/index.ts +2 -1
- package/src/process/kill-tree.ts +106 -4
- package/src/prompt/coding-agent-doctrine.ts +9 -1
- package/src/provider/collect-chat-completion.ts +3 -0
- package/src/provider/fallback.ts +17 -0
- package/src/provider/idle-timeout.ts +9 -0
- package/src/provider/mock.ts +19 -9
- package/src/provider/model-window-suffix.ts +85 -0
- package/src/provider/retry.ts +9 -0
- package/src/public-runtime.ts +21 -2
- package/src/public-types.ts +1 -0
- package/src/registry/command/kernel-commands.ts +1 -32
- package/src/runtime/jobs/awaited-jobs.ts +11 -0
- package/src/runtime/jobs/host-exit-finalizer.ts +67 -0
- package/src/runtime/jobs/liveness.ts +144 -0
- package/src/runtime/jobs/registry.ts +114 -2
- package/src/runtime/jobs/wake-budget.ts +55 -0
- package/src/runtime/query/detached-calls.ts +135 -0
- package/src/runtime/query/executor.ts +92 -10
- package/src/runtime/query/index.ts +65 -7
- package/src/runtime/query/iteration/effort-clamp.ts +46 -0
- package/src/runtime/query/iteration/index.ts +260 -6
- package/src/runtime/query/iteration/outstanding-work.ts +12 -3
- package/src/runtime/query/iteration/phases/context.ts +9 -0
- package/src/runtime/query/iteration/phases/tool-review.ts +73 -8
- package/src/runtime/query/iteration/stream-turn.ts +5 -0
- package/src/runtime/query/session-storage.ts +8 -3
- package/src/runtime/query/steering.ts +77 -6
- package/src/runtime/query/tooling.ts +2 -0
- package/src/runtime/system-events.ts +12 -1
- package/src/sandbox/denial.ts +79 -0
- package/src/sandbox/file-walk-program.ts +32 -13
- package/src/sandbox/file-walk.ts +75 -12
- package/src/sandbox/ignore-matcher.ts +46 -0
- package/src/sandbox/ignore-source.ts +220 -0
- package/src/sandbox/provider/local.ts +11 -1
- package/src/scheduler/completion-inbox.ts +1 -0
- package/src/session/log-hash.ts +21 -0
- package/src/store/memory/disk.ts +1 -0
- package/src/store/memory/markdown.ts +1 -0
- package/src/store/memory/operation-lock.ts +288 -57
- package/src/store/session-index/sqlite.ts +171 -16
- package/src/tools/builtins/bash.ts +11 -4
- package/src/tools/builtins/computer-use.ts +593 -68
- package/src/tools/builtins/glob.ts +79 -32
- package/src/tools/builtins/grep.ts +107 -43
- package/src/tools/builtins/job.ts +42 -12
- package/src/tools/builtins/search-support.ts +107 -0
- package/src/tools/builtins/wait-for-job-bounds.ts +5 -1
- package/src/tools/builtins/wait-for-job.ts +14 -2
- package/src/tools/command-shell.ts +13 -5
- package/src/turn/reporter.ts +12 -0
- package/src/types/agent/query.ts +2 -0
- package/src/types/computer-use/index.ts +157 -15
- package/src/types/message/index.ts +5 -3
- package/src/types/plugin/index.ts +8 -0
- package/src/types/provider/chat.ts +20 -0
- package/src/types/provider/config.ts +7 -0
- package/src/types/provider/index.ts +1 -0
- package/src/types/provider/interface.ts +20 -0
- package/src/types/provider/stream.ts +6 -0
- package/src/types/sandbox/index.ts +40 -1
- package/src/types/session/events.ts +65 -5
- package/src/types/session/records.ts +39 -2
- package/src/types/session/stop-reason.ts +11 -0
- package/src/types/tool/index.ts +30 -0
- package/src/types/tool/presentation.ts +8 -0
|
@@ -28,7 +28,7 @@ const PRELUDE_SOURCE = String.raw `(function (config) {
|
|
|
28
28
|
}
|
|
29
29
|
function phase(title) {
|
|
30
30
|
var t = clean(title, 120);
|
|
31
|
-
if (!t) throw
|
|
31
|
+
if (!t) throw misuse('phase() needs a non-empty title.');
|
|
32
32
|
cursor = t;
|
|
33
33
|
emit({ k: 'phase', title: t });
|
|
34
34
|
}
|
|
@@ -53,13 +53,26 @@ const PRELUDE_SOURCE = String.raw `(function (config) {
|
|
|
53
53
|
return e;
|
|
54
54
|
}
|
|
55
55
|
function isBudgetError(e) { return !!e && e.name === 'WorkflowBudgetExceededError'; }
|
|
56
|
+
function misuse(message) {
|
|
57
|
+
var e = new TypeError(message);
|
|
58
|
+
e.workflowMisuse = true;
|
|
59
|
+
return e;
|
|
60
|
+
}
|
|
61
|
+
function isMisuse(e) { return !!e && e.workflowMisuse === true; }
|
|
62
|
+
var optionNames = ['label', 'phase', 'schema', 'agentType', 'model', 'effort'];
|
|
56
63
|
async function agent(prompt, opts) {
|
|
57
64
|
if (typeof prompt !== 'string' || prompt.length === 0) {
|
|
58
|
-
throw
|
|
65
|
+
throw misuse('agent(prompt, options?): the prompt must be a non-empty string, got ' + kind(prompt));
|
|
59
66
|
}
|
|
60
67
|
var o = opts == null ? {} : opts;
|
|
61
68
|
if (typeof o !== 'object' || Array.isArray(o)) {
|
|
62
|
-
throw
|
|
69
|
+
throw misuse('agent(prompt, options?): options must be an object, got ' + kind(o));
|
|
70
|
+
}
|
|
71
|
+
var unknown = Object.keys(o).filter(function (k) { return optionNames.indexOf(k) < 0; });
|
|
72
|
+
if (unknown.length > 0) {
|
|
73
|
+
// Ignored, as it always was, but no longer silently: a saved script that
|
|
74
|
+
// misspells an option keeps running and the line says why it had no effect.
|
|
75
|
+
log('agent(prompt, options?): ignoring unknown option "' + unknown[0] + '"; the options are ' + optionNames.join(', ') + '.');
|
|
63
76
|
}
|
|
64
77
|
if (overBudget()) throw budgetError();
|
|
65
78
|
var request = { prompt: prompt, cursor: cursor };
|
|
@@ -69,23 +82,32 @@ const PRELUDE_SOURCE = String.raw `(function (config) {
|
|
|
69
82
|
if (o.agentType != null) request.agentType = clean(o.agentType, 120);
|
|
70
83
|
if (o.model != null) request.model = clean(o.model, 120);
|
|
71
84
|
if (o.effort != null) request.effort = clean(o.effort, 32);
|
|
72
|
-
var reply
|
|
85
|
+
var reply;
|
|
86
|
+
try {
|
|
87
|
+
reply = await rawCall('agent', request);
|
|
88
|
+
} catch (e) {
|
|
89
|
+
// The host rejects a malformed request with an "agent(): ..." message;
|
|
90
|
+
// that is the script's mistake, not a failed child.
|
|
91
|
+
if (e && typeof e.message === 'string' && e.message.indexOf('agent(): ') === 0) throw misuse(e.message);
|
|
92
|
+
throw e;
|
|
93
|
+
}
|
|
73
94
|
spent.tokensUsed = reply.t;
|
|
74
95
|
return reply.v;
|
|
75
96
|
}
|
|
76
97
|
async function parallel(thunks) {
|
|
77
98
|
if (!Array.isArray(thunks)) {
|
|
78
|
-
throw
|
|
99
|
+
throw misuse('parallel(thunks): the argument must be an array of functions, got ' + kind(thunks));
|
|
79
100
|
}
|
|
80
101
|
for (var p = 0; p < thunks.length; p++) {
|
|
81
102
|
if (typeof thunks[p] !== 'function') {
|
|
82
|
-
throw
|
|
103
|
+
throw misuse('parallel(thunks): item ' + (p + 1) + ' must be a function (wrap the work as () => agent(...)), got ' + kind(thunks[p]));
|
|
83
104
|
}
|
|
84
105
|
}
|
|
85
106
|
var dropped = 0;
|
|
86
107
|
var results = await Promise.all(thunks.map(function (t, n) {
|
|
87
108
|
return Promise.resolve().then(t).catch(function (e) {
|
|
88
109
|
if (isBudgetError(e)) { dropped++; return null; }
|
|
110
|
+
if (isMisuse(e)) throw e;
|
|
89
111
|
log('Step ' + (n + 1) + ' stopped: ' + clean(e && e.message ? e.message : e, 300));
|
|
90
112
|
return null;
|
|
91
113
|
});
|
|
@@ -95,12 +117,12 @@ const PRELUDE_SOURCE = String.raw `(function (config) {
|
|
|
95
117
|
}
|
|
96
118
|
async function pipeline(items) {
|
|
97
119
|
if (!Array.isArray(items)) {
|
|
98
|
-
throw
|
|
120
|
+
throw misuse('pipeline(items, ...stages): the first argument must be an array, got ' + kind(items));
|
|
99
121
|
}
|
|
100
122
|
var stages = Array.prototype.slice.call(arguments, 1);
|
|
101
123
|
for (var s = 0; s < stages.length; s++) {
|
|
102
124
|
if (typeof stages[s] !== 'function') {
|
|
103
|
-
throw
|
|
125
|
+
throw misuse('pipeline(items, ...stages): stage ' + (s + 1) + ' must be a function, got ' + kind(stages[s]));
|
|
104
126
|
}
|
|
105
127
|
}
|
|
106
128
|
if (items.length > 0 && overBudget()) throw budgetError();
|
|
@@ -112,6 +134,7 @@ const PRELUDE_SOURCE = String.raw `(function (config) {
|
|
|
112
134
|
value = await stages[i](value, item, index);
|
|
113
135
|
} catch (e) {
|
|
114
136
|
if (isBudgetError(e)) { dropped++; return null; }
|
|
137
|
+
if (isMisuse(e)) throw e;
|
|
115
138
|
log('Item ' + (index + 1) + ' stopped at step ' + (i + 1) + ': ' + clean(e && e.message ? e.message : e, 300));
|
|
116
139
|
return null;
|
|
117
140
|
}
|
|
@@ -141,6 +164,24 @@ const PRELUDE_SOURCE = String.raw `(function (config) {
|
|
|
141
164
|
install('log', log);
|
|
142
165
|
install('budget', budget);
|
|
143
166
|
install('args', config.args);
|
|
167
|
+
if (config.deterministic) {
|
|
168
|
+
var RealDate = Date;
|
|
169
|
+
var clockMessage = 'Date.now() / new Date() are unavailable in workflow scripts (breaks resume). Stamp results after the workflow returns, or pass timestamps through args.';
|
|
170
|
+
var randomMessage = 'Math.random() is unavailable in workflow scripts (breaks resume). For N independent samples, include the index in the agent label or prompt.';
|
|
171
|
+
var ShimDate = function Date(a, b, c, d, e, f, g) {
|
|
172
|
+
if (!new.target || arguments.length === 0) throw new Error(clockMessage);
|
|
173
|
+
return Reflect.construct(RealDate, Array.prototype.slice.call(arguments), new.target === ShimDate ? RealDate : new.target);
|
|
174
|
+
};
|
|
175
|
+
Object.defineProperty(ShimDate, 'prototype', { value: RealDate.prototype, writable: false, configurable: false });
|
|
176
|
+
Object.defineProperty(ShimDate, 'now', { value: function now() { throw new Error(clockMessage); }, writable: false, configurable: false });
|
|
177
|
+
Object.defineProperty(ShimDate, 'parse', { value: RealDate.parse, writable: false, configurable: false });
|
|
178
|
+
Object.defineProperty(ShimDate, 'UTC', { value: RealDate.UTC, writable: false, configurable: false });
|
|
179
|
+
Object.defineProperty(RealDate.prototype, 'constructor', { value: ShimDate, writable: false, configurable: false });
|
|
180
|
+
Object.defineProperty(globalThis, 'Date', { value: ShimDate, writable: false, configurable: false, enumerable: false });
|
|
181
|
+
Object.defineProperty(Math, 'random', { value: function random() { throw new Error(randomMessage); }, writable: false, configurable: false });
|
|
182
|
+
try { delete globalThis.eval; } catch (ignored) {}
|
|
183
|
+
Object.freeze(RealDate);
|
|
184
|
+
}
|
|
144
185
|
})`;
|
|
145
186
|
/**
|
|
146
187
|
* Lines the prelude occupies in the interpreter source, plus the newline that
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prelude.js","sourceRoot":"","sources":["../../../src/execution/workflow/prelude.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"prelude.js","sourceRoot":"","sources":["../../../src/execution/workflow/prelude.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyK9B,CAAA;AAEH;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAIhC;IACA,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAA;AAC/C,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,YAAY,CAAC,MAI5B;IACA,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;SACpC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;SAClC,IAAI,CAAC,SAAS,CAAC;SACf,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;SAClC,IAAI,CAAC,SAAS,CAAC,CAAA;IACjB,OAAO,GAAG,cAAc,IAAI,OAAO,IAAI,CAAA;AACxC,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { CheckedWorkflowJournal, WorkflowJournalRecord, WorkflowResumeState } from './types.js';
|
|
2
|
+
/** What of an `agent()` call decides its result. `label`, `phase` and progress callbacks do not. */
|
|
3
|
+
export interface WorkflowCallIdentity {
|
|
4
|
+
readonly schema?: unknown;
|
|
5
|
+
readonly model?: string;
|
|
6
|
+
readonly effort?: string;
|
|
7
|
+
readonly agentType?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The key a call is saved and looked up under: the prompt, the options that
|
|
11
|
+
* change what the agent does (schema, model, effort, agent type) and how many
|
|
12
|
+
* identical calls came before it in the same pass. Each part is length-prefixed
|
|
13
|
+
* so one cannot be read as part of another.
|
|
14
|
+
*/
|
|
15
|
+
export declare function workflowCallKey(prompt: string, call: WorkflowCallIdentity, ordinal: number): string;
|
|
16
|
+
/**
|
|
17
|
+
* What makes two calls the same call: the prompt and the options that change
|
|
18
|
+
* the agent, in a form where key order and `undefined` do not matter. The
|
|
19
|
+
* runtime counts repeats of this text to give identical calls distinct slots,
|
|
20
|
+
* and the key hashes the same text, so the two can never disagree.
|
|
21
|
+
*/
|
|
22
|
+
export declare function workflowCallContent(prompt: string, call: WorkflowCallIdentity): string;
|
|
23
|
+
/** The hash the first line of a run's journal chains from. It binds the file to its run id. */
|
|
24
|
+
export declare function workflowJournalSeed(runId: string): string;
|
|
25
|
+
/** The hash a line contributes to the next one: its exact bytes, newline included. */
|
|
26
|
+
export declare function workflowJournalLineHash(line: string): string;
|
|
27
|
+
/** The line `record` is written as. With a key, a `mac` over the rest of the line is added last. */
|
|
28
|
+
export declare function formatWorkflowJournalLine(record: WorkflowJournalRecord, seq: number, prev: string, key?: string | Uint8Array): string;
|
|
29
|
+
/**
|
|
30
|
+
* Reads a journal's text and keeps only the records that can be trusted.
|
|
31
|
+
*
|
|
32
|
+
* Every line carries `seq` (counting trusted lines from 1) and `prev` (the hash
|
|
33
|
+
* of the line before; the first chains from a seed bound to the run id). A
|
|
34
|
+
* line that does not chain, a line that does not parse, and anything after
|
|
35
|
+
* one is dropped until a `run_started` of a resumed pass picks the chain up
|
|
36
|
+
* again at the last trusted line. A last line without its newline that is not
|
|
37
|
+
* whole JSON is a torn write and is ignored; one that is whole JSON is read
|
|
38
|
+
* like any other line. The file is never rewritten.
|
|
39
|
+
*
|
|
40
|
+
* The chain alone cannot notice an edit to the final line (nothing chains from
|
|
41
|
+
* it yet). With `key`, every line must also carry a `mac` made with that
|
|
42
|
+
* secret, which closes that gap against anyone who does not hold the key.
|
|
43
|
+
*/
|
|
44
|
+
export declare function readWorkflowJournalChecked(text: string, runId: string, options?: {
|
|
45
|
+
readonly key?: string | Uint8Array;
|
|
46
|
+
}): CheckedWorkflowJournal;
|
|
47
|
+
/**
|
|
48
|
+
* Folds a checked journal into what a resumed pass needs.
|
|
49
|
+
*
|
|
50
|
+
* The last saved result for a key wins. An agent that was asked for again
|
|
51
|
+
* after a result was saved gives that result up until it finishes again. A
|
|
52
|
+
* failed or skipped outcome removes the result and marks the key failed; an
|
|
53
|
+
* outcome the run recorded as interrupted (stopped, not failed) leaves the key
|
|
54
|
+
* as seen but unfinished. Lines marked `cached` repeat an earlier result and
|
|
55
|
+
* are skipped, and so is any agent record from a pass older than the latest
|
|
56
|
+
* `run_started`, which a slow agent of an earlier pass can still write.
|
|
57
|
+
*/
|
|
58
|
+
export declare function loadWorkflowResume(checked: CheckedWorkflowJournal): WorkflowResumeState;
|
|
59
|
+
//# sourceMappingURL=resume.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resume.d.ts","sourceRoot":"","sources":["../../../src/execution/workflow/resume.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEX,sBAAsB,EAEtB,qBAAqB,EACrB,mBAAmB,EACnB,MAAM,YAAY,CAAA;AAsBnB,oGAAoG;AACpG,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC9B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,oBAAoB,EAC1B,OAAO,EAAE,MAAM,GACb,MAAM,CAER;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,GAAG,MAAM,CAQtF;AAED,+FAA+F;AAC/F,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,sFAAsF;AACtF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,oGAAoG;AACpG,wBAAgB,yBAAyB,CACxC,MAAM,EAAE,qBAAqB,EAC7B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,GAAG,UAAU,GACvB,MAAM,CAKR;AAqBD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,0BAA0B,CACzC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;IAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,UAAU,CAAA;CAAO,GAClD,sBAAsB,CAgFxB;AAMD;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,sBAAsB,GAAG,mBAAmB,CAsFvF"}
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { createHash, createHmac, timingSafeEqual } from 'node:crypto';
|
|
2
|
+
/** The key version. A change to how keys are made bumps it, so old keys simply never match. */
|
|
3
|
+
const KEY_VERSION = 'k1';
|
|
4
|
+
function sha256Hex(text) {
|
|
5
|
+
return createHash('sha256').update(text).digest('hex');
|
|
6
|
+
}
|
|
7
|
+
/** JSON with every object's keys sorted and `__proto__` dropped, so equal values give equal text. */
|
|
8
|
+
function canonicalJson(value) {
|
|
9
|
+
if (Array.isArray(value))
|
|
10
|
+
return `[${value.map((item) => canonicalJson(item)).join(',')}]`;
|
|
11
|
+
if (typeof value === 'object' && value !== null) {
|
|
12
|
+
const record = value;
|
|
13
|
+
const keys = Object.keys(record)
|
|
14
|
+
.filter((key) => key !== '__proto__' && record[key] !== undefined)
|
|
15
|
+
.sort();
|
|
16
|
+
return `{${keys.map((key) => `${JSON.stringify(key)}:${canonicalJson(record[key])}`).join(',')}}`;
|
|
17
|
+
}
|
|
18
|
+
return JSON.stringify(value) ?? 'null';
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The key a call is saved and looked up under: the prompt, the options that
|
|
22
|
+
* change what the agent does (schema, model, effort, agent type) and how many
|
|
23
|
+
* identical calls came before it in the same pass. Each part is length-prefixed
|
|
24
|
+
* so one cannot be read as part of another.
|
|
25
|
+
*/
|
|
26
|
+
export function workflowCallKey(prompt, call, ordinal) {
|
|
27
|
+
return `${KEY_VERSION}:${sha256Hex(`${workflowCallContent(prompt, call)}${ordinal}`)}`;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* What makes two calls the same call: the prompt and the options that change
|
|
31
|
+
* the agent, in a form where key order and `undefined` do not matter. The
|
|
32
|
+
* runtime counts repeats of this text to give identical calls distinct slots,
|
|
33
|
+
* and the key hashes the same text, so the two can never disagree.
|
|
34
|
+
*/
|
|
35
|
+
export function workflowCallContent(prompt, call) {
|
|
36
|
+
const options = canonicalJson({
|
|
37
|
+
schema: call.schema,
|
|
38
|
+
model: call.model,
|
|
39
|
+
effort: call.effort,
|
|
40
|
+
agentType: call.agentType,
|
|
41
|
+
});
|
|
42
|
+
return `${prompt.length}:${prompt}${options.length}:${options}`;
|
|
43
|
+
}
|
|
44
|
+
/** The hash the first line of a run's journal chains from. It binds the file to its run id. */
|
|
45
|
+
export function workflowJournalSeed(runId) {
|
|
46
|
+
return sha256Hex(`namzu-workflow-journal\0${runId}`);
|
|
47
|
+
}
|
|
48
|
+
/** The hash a line contributes to the next one: its exact bytes, newline included. */
|
|
49
|
+
export function workflowJournalLineHash(line) {
|
|
50
|
+
return sha256Hex(`${line}\n`);
|
|
51
|
+
}
|
|
52
|
+
/** The line `record` is written as. With a key, a `mac` over the rest of the line is added last. */
|
|
53
|
+
export function formatWorkflowJournalLine(record, seq, prev, key) {
|
|
54
|
+
const body = { seq, prev, ...record };
|
|
55
|
+
if (key === undefined)
|
|
56
|
+
return JSON.stringify(body);
|
|
57
|
+
const mac = createHmac('sha256', key).update(JSON.stringify(body)).digest('hex');
|
|
58
|
+
return JSON.stringify({ ...body, mac });
|
|
59
|
+
}
|
|
60
|
+
function macMatches(record, key) {
|
|
61
|
+
const { mac, ...rest } = record;
|
|
62
|
+
if (typeof mac !== 'string')
|
|
63
|
+
return false;
|
|
64
|
+
const expected = createHmac('sha256', key).update(JSON.stringify(rest)).digest();
|
|
65
|
+
const actual = Buffer.from(mac, 'hex');
|
|
66
|
+
return actual.length === expected.length && timingSafeEqual(actual, expected);
|
|
67
|
+
}
|
|
68
|
+
function parseLine(line) {
|
|
69
|
+
try {
|
|
70
|
+
const value = JSON.parse(line);
|
|
71
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value)
|
|
72
|
+
? value
|
|
73
|
+
: undefined;
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Reads a journal's text and keeps only the records that can be trusted.
|
|
81
|
+
*
|
|
82
|
+
* Every line carries `seq` (counting trusted lines from 1) and `prev` (the hash
|
|
83
|
+
* of the line before; the first chains from a seed bound to the run id). A
|
|
84
|
+
* line that does not chain, a line that does not parse, and anything after
|
|
85
|
+
* one is dropped until a `run_started` of a resumed pass picks the chain up
|
|
86
|
+
* again at the last trusted line. A last line without its newline that is not
|
|
87
|
+
* whole JSON is a torn write and is ignored; one that is whole JSON is read
|
|
88
|
+
* like any other line. The file is never rewritten.
|
|
89
|
+
*
|
|
90
|
+
* The chain alone cannot notice an edit to the final line (nothing chains from
|
|
91
|
+
* it yet). With `key`, every line must also carry a `mac` made with that
|
|
92
|
+
* secret, which closes that gap against anyone who does not hold the key.
|
|
93
|
+
*/
|
|
94
|
+
export function readWorkflowJournalChecked(text, runId, options = {}) {
|
|
95
|
+
const endsWithNewline = text === '' || text.endsWith('\n');
|
|
96
|
+
const pieces = text.split('\n');
|
|
97
|
+
const fragment = endsWithNewline ? undefined : pieces.pop();
|
|
98
|
+
if (endsWithNewline)
|
|
99
|
+
pieces.pop();
|
|
100
|
+
// A last line without its newline that is whole JSON was only missing the newline: it is
|
|
101
|
+
// judged like any other line (the writer adds the newline before the next record, so the
|
|
102
|
+
// hash it contributes is the one of the line with its newline). Anything else is a torn write.
|
|
103
|
+
const wholeFragment = fragment !== undefined && fragment !== '' && parseLine(fragment) !== undefined;
|
|
104
|
+
if (wholeFragment)
|
|
105
|
+
pieces.push(fragment);
|
|
106
|
+
const tornTail = fragment !== undefined && fragment !== '' && !wholeFragment;
|
|
107
|
+
const parsed = pieces.map((line) => parseLine(line));
|
|
108
|
+
const firstRecord = parsed.find((record) => record !== undefined);
|
|
109
|
+
if (firstRecord !== undefined && typeof firstRecord.seq !== 'number') {
|
|
110
|
+
return {
|
|
111
|
+
records: [],
|
|
112
|
+
legacy: true,
|
|
113
|
+
tornTail,
|
|
114
|
+
lastSeq: 0,
|
|
115
|
+
lastHash: workflowJournalSeed(runId),
|
|
116
|
+
endsWithNewline,
|
|
117
|
+
untrusted: parsed.filter((record) => record !== undefined),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
const records = [];
|
|
121
|
+
let lastSeq = 0;
|
|
122
|
+
let lastHash = workflowJournalSeed(runId);
|
|
123
|
+
let gapStart;
|
|
124
|
+
let gapLines = 0;
|
|
125
|
+
let gapParsed = false;
|
|
126
|
+
let brokenAt;
|
|
127
|
+
const closeGap = () => {
|
|
128
|
+
if (gapStart !== undefined && (gapLines > 1 || gapParsed))
|
|
129
|
+
brokenAt ??= gapStart;
|
|
130
|
+
gapStart = undefined;
|
|
131
|
+
gapLines = 0;
|
|
132
|
+
gapParsed = false;
|
|
133
|
+
};
|
|
134
|
+
for (let i = 0; i < pieces.length; i++) {
|
|
135
|
+
const line = pieces[i];
|
|
136
|
+
const record = parsed[i];
|
|
137
|
+
const chains = record !== undefined &&
|
|
138
|
+
record.seq === lastSeq + 1 &&
|
|
139
|
+
record.prev === lastHash &&
|
|
140
|
+
(options.key === undefined || macMatches(record, options.key));
|
|
141
|
+
const first = records.length === 0;
|
|
142
|
+
const acceptable = chains &&
|
|
143
|
+
(first
|
|
144
|
+
? record.type === 'run_started' && record.runId === runId
|
|
145
|
+
: gapStart === undefined || record.type === 'run_started');
|
|
146
|
+
if (acceptable) {
|
|
147
|
+
closeGap();
|
|
148
|
+
records.push(record);
|
|
149
|
+
lastSeq = record.seq;
|
|
150
|
+
lastHash = workflowJournalLineHash(line);
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
if (gapStart === undefined)
|
|
154
|
+
gapStart = i + 1;
|
|
155
|
+
gapLines++;
|
|
156
|
+
if (record !== undefined)
|
|
157
|
+
gapParsed = true;
|
|
158
|
+
}
|
|
159
|
+
// A gap that runs to the end is a change, except a single line that does not parse
|
|
160
|
+
// (what a torn write leaves once the next pass closed it with a newline).
|
|
161
|
+
closeGap();
|
|
162
|
+
return {
|
|
163
|
+
records,
|
|
164
|
+
legacy: false,
|
|
165
|
+
tornTail,
|
|
166
|
+
...(brokenAt !== undefined ? { brokenAt } : {}),
|
|
167
|
+
lastSeq,
|
|
168
|
+
lastHash,
|
|
169
|
+
endsWithNewline,
|
|
170
|
+
untrusted: [],
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
function hasResult(record) {
|
|
174
|
+
return Object.hasOwn(record, 'result') && record.result !== undefined && record.result !== null;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Folds a checked journal into what a resumed pass needs.
|
|
178
|
+
*
|
|
179
|
+
* The last saved result for a key wins. An agent that was asked for again
|
|
180
|
+
* after a result was saved gives that result up until it finishes again. A
|
|
181
|
+
* failed or skipped outcome removes the result and marks the key failed; an
|
|
182
|
+
* outcome the run recorded as interrupted (stopped, not failed) leaves the key
|
|
183
|
+
* as seen but unfinished. Lines marked `cached` repeat an earlier result and
|
|
184
|
+
* are skipped, and so is any agent record from a pass older than the latest
|
|
185
|
+
* `run_started`, which a slow agent of an earlier pass can still write.
|
|
186
|
+
*/
|
|
187
|
+
export function loadWorkflowResume(checked) {
|
|
188
|
+
const results = new Map();
|
|
189
|
+
const seen = new Set();
|
|
190
|
+
const failed = new Set();
|
|
191
|
+
const demoted = new Set();
|
|
192
|
+
const problems = [];
|
|
193
|
+
const keysByIndex = new Map();
|
|
194
|
+
let currentPass = 0;
|
|
195
|
+
let scriptSha256;
|
|
196
|
+
let previousFinish = 'unfinished';
|
|
197
|
+
for (const record of checked.records) {
|
|
198
|
+
if (record.type === 'run_started') {
|
|
199
|
+
currentPass = record.resume?.pass ?? 1;
|
|
200
|
+
scriptSha256 = record.scriptSha256;
|
|
201
|
+
previousFinish = 'unfinished';
|
|
202
|
+
keysByIndex.clear();
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
if (record.type === 'run_finished') {
|
|
206
|
+
previousFinish = record.status;
|
|
207
|
+
continue;
|
|
208
|
+
}
|
|
209
|
+
if (record.type !== 'agent_request' && record.type !== 'agent_outcome')
|
|
210
|
+
continue;
|
|
211
|
+
const pass = record.pass ?? 1;
|
|
212
|
+
if (pass < currentPass || record.cached === true)
|
|
213
|
+
continue;
|
|
214
|
+
if (record.type === 'agent_request') {
|
|
215
|
+
if (record.key === undefined)
|
|
216
|
+
continue;
|
|
217
|
+
keysByIndex.set(`${pass}:${record.index}`, record.key);
|
|
218
|
+
seen.add(record.key);
|
|
219
|
+
if (results.delete(record.key))
|
|
220
|
+
demoted.add(record.key);
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
const key = record.key ?? keysByIndex.get(`${pass}:${record.index}`);
|
|
224
|
+
if (key === undefined)
|
|
225
|
+
continue;
|
|
226
|
+
seen.add(key);
|
|
227
|
+
if (record.state === 'done' && hasResult(record)) {
|
|
228
|
+
results.set(key, {
|
|
229
|
+
value: record.result,
|
|
230
|
+
pass,
|
|
231
|
+
index: record.index,
|
|
232
|
+
...(record.childSessionId !== undefined ? { childSessionId: record.childSessionId } : {}),
|
|
233
|
+
});
|
|
234
|
+
failed.delete(key);
|
|
235
|
+
demoted.delete(key);
|
|
236
|
+
}
|
|
237
|
+
else if (record.state === 'done' && record.unsaved === true) {
|
|
238
|
+
results.delete(key);
|
|
239
|
+
demoted.add(key);
|
|
240
|
+
}
|
|
241
|
+
else if (record.interrupted === true) {
|
|
242
|
+
// Stopped, not failed: the agent runs again and the cache stays open.
|
|
243
|
+
results.delete(key);
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
results.delete(key);
|
|
247
|
+
demoted.delete(key);
|
|
248
|
+
failed.add(key);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
if (checked.legacy) {
|
|
252
|
+
problems.push('This run was saved before resuming was possible, so its agents cannot be reused.');
|
|
253
|
+
}
|
|
254
|
+
if (checked.brokenAt !== undefined) {
|
|
255
|
+
problems.push(`The journal was changed or cut short at line ${checked.brokenAt}. Results after that point are not trusted and those agents will run again.`);
|
|
256
|
+
}
|
|
257
|
+
const started = checked.records.some((record) => record.type === 'run_started');
|
|
258
|
+
if (!checked.legacy && !started)
|
|
259
|
+
problems.push('The journal has no usable record of the run.');
|
|
260
|
+
return {
|
|
261
|
+
pass: currentPass + 1,
|
|
262
|
+
results,
|
|
263
|
+
seen,
|
|
264
|
+
failed,
|
|
265
|
+
demoted,
|
|
266
|
+
...(scriptSha256 !== undefined ? { scriptSha256 } : {}),
|
|
267
|
+
previousFinish,
|
|
268
|
+
problems,
|
|
269
|
+
resumable: !checked.legacy && started,
|
|
270
|
+
...(checked.brokenAt !== undefined ? { brokenAt: checked.brokenAt } : {}),
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
//# sourceMappingURL=resume.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resume.js","sourceRoot":"","sources":["../../../src/execution/workflow/resume.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAUrE,+FAA+F;AAC/F,MAAM,WAAW,GAAG,IAAI,CAAA;AAExB,SAAS,SAAS,CAAC,IAAY;IAC9B,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AACvD,CAAC;AAED,qGAAqG;AACrG,S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,CAAC,CAAC,CAAC,EAAE,CAAC;QACvD,cAAc;QACd,QAAQ;QACR,SAAS,EAAE,CAAC,OAAO,CAAC,MAAM,IAAI,OAAO;QACrC,GAAG,CAAC,OAAO,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACzE,CAAA;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/execution/workflow/runtime.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAa,WAAW,EAAkB,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/execution/workflow/runtime.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAa,WAAW,EAAkB,MAAM,0BAA0B,CAAA;AAStF,OAAO,KAAK,EAQX,cAAc,EACd,sBAAsB,EACtB,kBAAkB,EAClB,iBAAiB,EAEjB,MAAM,YAAY,CAAA;AAEnB,uCAAuC;AACvC,eAAO,MAAM,kBAAkB,UAAU,CAAA;AAoBzC,sHAAsH;AACtH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAGvE;AASD,wBAAgB,qBAAqB,CAAC,MAAM,GAAE,cAAmB,GAAG,sBAAsB,CAqCzF;AAuHD,MAAM,WAAW,sBAAsB;IACtC,4FAA4F;IAC5F,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAA;IAClC,oCAAoC;IACpC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;IAC3B,qGAAqG;IACrG,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAC/B;AAkCD;;;;;;;;;;GAUG;AACH,qBAAa,eAAe;IAGf,OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAc;gBAEL,OAAO,GAAE,sBAA2B;IAI3D,GAAG,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAwnBlE"}
|