botmux 3.9.2 → 3.10.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/README.en.md +1 -1
- package/README.md +1 -1
- package/dist/.runtime-build-id +1 -1
- package/dist/adapters/cli/codex.d.ts.map +1 -1
- package/dist/adapters/cli/codex.js +6 -0
- package/dist/adapters/cli/codex.js.map +1 -1
- package/dist/adapters/cli/opencode.d.ts.map +1 -1
- package/dist/adapters/cli/opencode.js +7 -1
- package/dist/adapters/cli/opencode.js.map +1 -1
- package/dist/adapters/cli/reasonix.d.ts +35 -0
- package/dist/adapters/cli/reasonix.d.ts.map +1 -0
- package/dist/adapters/cli/reasonix.js +236 -0
- package/dist/adapters/cli/reasonix.js.map +1 -0
- package/dist/adapters/cli/registry.d.ts +2 -1
- package/dist/adapters/cli/registry.d.ts.map +1 -1
- package/dist/adapters/cli/registry.js +4 -1
- package/dist/adapters/cli/registry.js.map +1 -1
- package/dist/adapters/cli/types.d.ts +5 -1
- package/dist/adapters/cli/types.d.ts.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +168 -62
- package/dist/cli.js.map +1 -1
- package/dist/core/command-handler.d.ts +18 -4
- package/dist/core/command-handler.d.ts.map +1 -1
- package/dist/core/command-handler.js +234 -26
- package/dist/core/command-handler.js.map +1 -1
- package/dist/core/dashboard-ipc-server.d.ts +1 -0
- package/dist/core/dashboard-ipc-server.d.ts.map +1 -1
- package/dist/core/dashboard-ipc-server.js +27 -3
- package/dist/core/dashboard-ipc-server.js.map +1 -1
- package/dist/core/dispatch.d.ts +54 -24
- package/dist/core/dispatch.d.ts.map +1 -1
- package/dist/core/dispatch.js +81 -27
- package/dist/core/dispatch.js.map +1 -1
- package/dist/core/input-turn-dedupe.d.ts +20 -0
- package/dist/core/input-turn-dedupe.d.ts.map +1 -0
- package/dist/core/input-turn-dedupe.js +57 -0
- package/dist/core/input-turn-dedupe.js.map +1 -0
- package/dist/core/local-terminal-opener.d.ts.map +1 -1
- package/dist/core/local-terminal-opener.js +10 -1
- package/dist/core/local-terminal-opener.js.map +1 -1
- package/dist/core/passthrough-commands.d.ts.map +1 -1
- package/dist/core/passthrough-commands.js +1 -1
- package/dist/core/passthrough-commands.js.map +1 -1
- package/dist/core/plugins/pm2.d.ts.map +1 -1
- package/dist/core/plugins/pm2.js +7 -1
- package/dist/core/plugins/pm2.js.map +1 -1
- package/dist/core/resource-monitor/attribution.d.ts.map +1 -1
- package/dist/core/resource-monitor/attribution.js +17 -1
- package/dist/core/resource-monitor/attribution.js.map +1 -1
- package/dist/core/resource-monitor/darwin.d.ts +145 -0
- package/dist/core/resource-monitor/darwin.d.ts.map +1 -0
- package/dist/core/resource-monitor/darwin.js +360 -0
- package/dist/core/resource-monitor/darwin.js.map +1 -0
- package/dist/core/resource-monitor/procfs.d.ts.map +1 -1
- package/dist/core/resource-monitor/procfs.js +6 -0
- package/dist/core/resource-monitor/procfs.js.map +1 -1
- package/dist/core/resource-monitor/types.d.ts +1 -1
- package/dist/core/resource-monitor/types.d.ts.map +1 -1
- package/dist/core/scheduler.d.ts.map +1 -1
- package/dist/core/scheduler.js +5 -2
- package/dist/core/scheduler.js.map +1 -1
- package/dist/core/session-discovery.d.ts.map +1 -1
- package/dist/core/session-discovery.js +3 -0
- package/dist/core/session-discovery.js.map +1 -1
- package/dist/core/session-manager.d.ts +3 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +46 -0
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-marker.d.ts +1 -8
- package/dist/core/session-marker.d.ts.map +1 -1
- package/dist/core/session-marker.js +2 -50
- package/dist/core/session-marker.js.map +1 -1
- package/dist/core/types.d.ts +3 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/core/worker-pool.d.ts +17 -0
- package/dist/core/worker-pool.d.ts.map +1 -1
- package/dist/core/worker-pool.js +292 -9
- package/dist/core/worker-pool.js.map +1 -1
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +27 -12
- package/dist/daemon.js.map +1 -1
- package/dist/dashboard/daemon-internal-api.d.ts.map +1 -1
- package/dist/dashboard/daemon-internal-api.js +11 -2
- package/dist/dashboard/daemon-internal-api.js.map +1 -1
- package/dist/dashboard/groups-action-helpers.d.ts +2 -0
- package/dist/dashboard/groups-action-helpers.d.ts.map +1 -1
- package/dist/dashboard/groups-action-helpers.js +9 -0
- package/dist/dashboard/groups-action-helpers.js.map +1 -1
- package/dist/dashboard/groups-matrix-snapshot.d.ts +56 -0
- package/dist/dashboard/groups-matrix-snapshot.d.ts.map +1 -0
- package/dist/dashboard/groups-matrix-snapshot.js +127 -0
- package/dist/dashboard/groups-matrix-snapshot.js.map +1 -0
- package/dist/dashboard/resource-monitor-service.d.ts.map +1 -1
- package/dist/dashboard/resource-monitor-service.js +18 -2
- package/dist/dashboard/resource-monitor-service.js.map +1 -1
- package/dist/dashboard/web/app.d.ts.map +1 -1
- package/dist/dashboard/web/app.js +45 -4
- package/dist/dashboard/web/app.js.map +1 -1
- package/dist/dashboard/web/groups-api.js +1 -1
- package/dist/dashboard/web/groups-api.js.map +1 -1
- package/dist/dashboard/web/i18n.js +10 -10
- package/dist/dashboard/web/i18n.js.map +1 -1
- package/dist/dashboard/web/roles-page.d.ts.map +1 -1
- package/dist/dashboard/web/roles-page.js +26 -11
- package/dist/dashboard/web/roles-page.js.map +1 -1
- package/dist/dashboard-web/app.js +1 -1
- package/dist/dashboard-web/chunks/{bot-defaults-page-BHTQEWCH.js → bot-defaults-page-LTVOUDIS.js} +1 -1
- package/dist/dashboard-web/chunks/{chunk-KLZCQAHF.js → chunk-3UE7S77S.js} +1 -1
- package/dist/dashboard-web/chunks/{chunk-W77TPKZH.js → chunk-DCS35UMD.js} +1 -1
- package/dist/dashboard-web/chunks/{chunk-E3HZZXK5.js → chunk-MFQPCVHY.js} +4 -4
- package/dist/dashboard-web/chunks/{chunk-EZH56JCI.js → chunk-ZU3UUKAR.js} +1 -1
- package/dist/dashboard-web/chunks/{connectors-page-BP255CAX.js → connectors-page-5KWDIMKC.js} +1 -1
- package/dist/dashboard-web/chunks/{groups-page-CDHVXBUT.js → groups-page-FHOKYXMW.js} +1 -1
- package/dist/dashboard-web/chunks/{insights-page-57BFE6GT.js → insights-page-T2ZX2RWL.js} +1 -1
- package/dist/dashboard-web/chunks/{monitor-room-UTOYGQVF.js → monitor-room-YNVBAGR6.js} +1 -1
- package/dist/dashboard-web/chunks/{monitoring-page-WTHYAIUM.js → monitoring-page-LHM55YWN.js} +1 -1
- package/dist/dashboard-web/chunks/{office-page-JSMIB353.js → office-page-ATXVP7PW.js} +1 -1
- package/dist/dashboard-web/chunks/{overview-page-3VDBOH7L.js → overview-page-QYI3KBDD.js} +1 -1
- package/dist/dashboard-web/chunks/roles-page-56VWM6CD.js +1 -0
- package/dist/dashboard-web/chunks/{schedules-page-HHN736H6.js → schedules-page-S5K6U4EO.js} +1 -1
- package/dist/dashboard-web/chunks/{sessions-page-EIWOZD7A.js → sessions-page-WBP4N7D2.js} +1 -1
- package/dist/dashboard-web/chunks/{settings-page-2IUT5LS4.js → settings-page-QUZDQARR.js} +1 -1
- package/dist/dashboard-web/chunks/{skills-page-JKFKMUEM.js → skills-page-IFY7AEND.js} +1 -1
- package/dist/dashboard-web/chunks/{team-federation-page-Q2PXC3UY.js → team-federation-page-C7FJQPFZ.js} +1 -1
- package/dist/dashboard-web/chunks/{v3-page-EBQCD4AO.js → v3-page-2LMF3WWR.js} +1 -1
- package/dist/dashboard-web/chunks/{whiteboards-page-QZRMVNZN.js → whiteboards-page-3XC6QRMY.js} +1 -1
- package/dist/dashboard-web/style.css +2 -4
- package/dist/dashboard.js +65 -9
- package/dist/dashboard.js.map +1 -1
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +33 -7
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/zh.d.ts.map +1 -1
- package/dist/i18n/zh.js +31 -7
- package/dist/i18n/zh.js.map +1 -1
- package/dist/im/lark/card-builder.d.ts +7 -0
- package/dist/im/lark/card-builder.d.ts.map +1 -1
- package/dist/im/lark/card-builder.js +56 -0
- package/dist/im/lark/card-builder.js.map +1 -1
- package/dist/im/lark/card-handler.d.ts.map +1 -1
- package/dist/im/lark/card-handler.js +42 -19
- package/dist/im/lark/card-handler.js.map +1 -1
- package/dist/im/lark/client.d.ts +10 -0
- package/dist/im/lark/client.d.ts.map +1 -1
- package/dist/im/lark/client.js +79 -0
- package/dist/im/lark/client.js.map +1 -1
- package/dist/im/lark/event-dispatcher.d.ts +14 -1
- package/dist/im/lark/event-dispatcher.d.ts.map +1 -1
- package/dist/im/lark/event-dispatcher.js +171 -15
- package/dist/im/lark/event-dispatcher.js.map +1 -1
- package/dist/im/lark/lark-hosts.d.ts +5 -0
- package/dist/im/lark/lark-hosts.d.ts.map +1 -1
- package/dist/im/lark/lark-hosts.js +10 -0
- package/dist/im/lark/lark-hosts.js.map +1 -1
- package/dist/im/lark/message-parser.d.ts.map +1 -1
- package/dist/im/lark/message-parser.js +24 -7
- package/dist/im/lark/message-parser.js.map +1 -1
- package/dist/pm2-graceful-exit.d.ts +28 -0
- package/dist/pm2-graceful-exit.d.ts.map +1 -0
- package/dist/pm2-graceful-exit.js +39 -0
- package/dist/pm2-graceful-exit.js.map +1 -0
- package/dist/services/bridge-fallback-gate.d.ts +9 -2
- package/dist/services/bridge-fallback-gate.d.ts.map +1 -1
- package/dist/services/bridge-fallback-gate.js +31 -19
- package/dist/services/bridge-fallback-gate.js.map +1 -1
- package/dist/services/message-listener-store.d.ts +18 -0
- package/dist/services/message-listener-store.d.ts.map +1 -1
- package/dist/services/message-listener-store.js +35 -10
- package/dist/services/message-listener-store.js.map +1 -1
- package/dist/services/message-listener.d.ts +17 -0
- package/dist/services/message-listener.d.ts.map +1 -1
- package/dist/services/message-listener.js +26 -0
- package/dist/services/message-listener.js.map +1 -1
- package/dist/setup/bot-config-editor.d.ts.map +1 -1
- package/dist/setup/bot-config-editor.js +2 -0
- package/dist/setup/bot-config-editor.js.map +1 -1
- package/dist/setup/lark-scopes.json +1 -0
- package/dist/setup/verify-permissions.d.ts.map +1 -1
- package/dist/setup/verify-permissions.js +8 -0
- package/dist/setup/verify-permissions.js.map +1 -1
- package/dist/types.d.ts +34 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/child-env.d.ts +1 -1
- package/dist/utils/child-env.d.ts.map +1 -1
- package/dist/utils/child-env.js +13 -0
- package/dist/utils/child-env.js.map +1 -1
- package/dist/utils/file-lock.d.ts.map +1 -1
- package/dist/utils/file-lock.js +1 -1
- package/dist/utils/file-lock.js.map +1 -1
- package/dist/utils/global-install.d.ts.map +1 -1
- package/dist/utils/global-install.js +56 -10
- package/dist/utils/global-install.js.map +1 -1
- package/dist/utils/idle-detector.d.ts +4 -0
- package/dist/utils/idle-detector.d.ts.map +1 -1
- package/dist/utils/idle-detector.js +25 -0
- package/dist/utils/idle-detector.js.map +1 -1
- package/dist/utils/process-identity.d.ts +7 -0
- package/dist/utils/process-identity.d.ts.map +1 -0
- package/dist/utils/process-identity.js +62 -0
- package/dist/utils/process-identity.js.map +1 -0
- package/dist/worker.js +123 -9
- package/dist/worker.js.map +1 -1
- package/dist/workflows/events/payloads.d.ts +10 -10
- package/dist/workflows/events/schema.d.ts +28 -28
- package/dist/workflows/hostExecutors/registry.d.ts +2 -7
- package/dist/workflows/hostExecutors/registry.d.ts.map +1 -1
- package/dist/workflows/hostExecutors/registry.js.map +1 -1
- package/dist/workflows/shared/provider-reconciler.d.ts +1 -30
- package/dist/workflows/shared/provider-reconciler.d.ts.map +1 -1
- package/dist/workflows/shared/provider-reconciler.js.map +1 -1
- package/dist/workflows/v3/artifact-contract.d.ts +41 -0
- package/dist/workflows/v3/artifact-contract.d.ts.map +1 -0
- package/dist/workflows/v3/artifact-contract.js +20 -0
- package/dist/workflows/v3/artifact-contract.js.map +1 -0
- package/dist/workflows/v3/botmux-attempt-lease.d.ts +7 -0
- package/dist/workflows/v3/botmux-attempt-lease.d.ts.map +1 -0
- package/dist/workflows/v3/botmux-attempt-lease.js +189 -0
- package/dist/workflows/v3/botmux-attempt-lease.js.map +1 -0
- package/dist/workflows/v3/botmux-host-policy.d.ts +7 -0
- package/dist/workflows/v3/botmux-host-policy.d.ts.map +1 -0
- package/dist/workflows/v3/botmux-host-policy.js +34 -0
- package/dist/workflows/v3/botmux-host-policy.js.map +1 -0
- package/dist/workflows/v3/cli-run.d.ts +1 -1
- package/dist/workflows/v3/cli-run.d.ts.map +1 -1
- package/dist/workflows/v3/cli-run.js +1 -1
- package/dist/workflows/v3/cli-run.js.map +1 -1
- package/dist/workflows/v3/contract.d.ts +8 -89
- package/dist/workflows/v3/contract.d.ts.map +1 -1
- package/dist/workflows/v3/contract.js +2 -8
- package/dist/workflows/v3/contract.js.map +1 -1
- package/dist/workflows/v3/core-control.d.ts +16 -0
- package/dist/workflows/v3/core-control.d.ts.map +1 -0
- package/dist/workflows/v3/core-control.js +60 -0
- package/dist/workflows/v3/core-control.js.map +1 -0
- package/dist/workflows/v3/daemon-run.d.ts.map +1 -1
- package/dist/workflows/v3/daemon-run.js +2 -1
- package/dist/workflows/v3/daemon-run.js.map +1 -1
- package/dist/workflows/v3/dag-loader.d.ts +5 -0
- package/dist/workflows/v3/dag-loader.d.ts.map +1 -0
- package/dist/workflows/v3/dag-loader.js +22 -0
- package/dist/workflows/v3/dag-loader.js.map +1 -0
- package/dist/workflows/v3/dag.d.ts +2 -6
- package/dist/workflows/v3/dag.d.ts.map +1 -1
- package/dist/workflows/v3/dag.js +2 -24
- package/dist/workflows/v3/dag.js.map +1 -1
- package/dist/workflows/v3/ephemeral-pool.d.ts.map +1 -1
- package/dist/workflows/v3/ephemeral-pool.js +22 -12
- package/dist/workflows/v3/ephemeral-pool.js.map +1 -1
- package/dist/workflows/v3/event-contract.d.ts +273 -0
- package/dist/workflows/v3/event-contract.d.ts.map +1 -0
- package/dist/workflows/v3/event-contract.js +8 -0
- package/dist/workflows/v3/event-contract.js.map +1 -0
- package/dist/workflows/v3/gate-policy.d.ts +12 -0
- package/dist/workflows/v3/gate-policy.d.ts.map +1 -0
- package/dist/workflows/v3/gate-policy.js +20 -0
- package/dist/workflows/v3/gate-policy.js.map +1 -0
- package/dist/workflows/v3/gate-wait-store.d.ts +99 -0
- package/dist/workflows/v3/gate-wait-store.d.ts.map +1 -0
- package/dist/workflows/v3/gate-wait-store.js +263 -0
- package/dist/workflows/v3/gate-wait-store.js.map +1 -0
- package/dist/workflows/v3/host.js +1 -1
- package/dist/workflows/v3/host.js.map +1 -1
- package/dist/workflows/v3/human-gate.d.ts +4 -99
- package/dist/workflows/v3/human-gate.d.ts.map +1 -1
- package/dist/workflows/v3/human-gate.js +4 -275
- package/dist/workflows/v3/human-gate.js.map +1 -1
- package/dist/workflows/v3/in-process-attempt-lease.d.ts +10 -0
- package/dist/workflows/v3/in-process-attempt-lease.d.ts.map +1 -0
- package/dist/workflows/v3/in-process-attempt-lease.js +47 -0
- package/dist/workflows/v3/in-process-attempt-lease.js.map +1 -0
- package/dist/workflows/v3/journal.d.ts +2 -275
- package/dist/workflows/v3/journal.d.ts.map +1 -1
- package/dist/workflows/v3/journal.js.map +1 -1
- package/dist/workflows/v3/library-service.js +1 -1
- package/dist/workflows/v3/library-service.js.map +1 -1
- package/dist/workflows/v3/orchestrator.d.ts +1 -2
- package/dist/workflows/v3/orchestrator.d.ts.map +1 -1
- package/dist/workflows/v3/orchestrator.js.map +1 -1
- package/dist/workflows/v3/portable-artifact-snapshot.d.ts +15 -0
- package/dist/workflows/v3/portable-artifact-snapshot.d.ts.map +1 -0
- package/dist/workflows/v3/portable-artifact-snapshot.js +76 -0
- package/dist/workflows/v3/portable-artifact-snapshot.js.map +1 -0
- package/dist/workflows/v3/portable-final-outputs.d.ts +37 -0
- package/dist/workflows/v3/portable-final-outputs.d.ts.map +1 -0
- package/dist/workflows/v3/portable-final-outputs.js +137 -0
- package/dist/workflows/v3/portable-final-outputs.js.map +1 -0
- package/dist/workflows/v3/portable-run-snapshot.d.ts +14 -0
- package/dist/workflows/v3/portable-run-snapshot.d.ts.map +1 -0
- package/dist/workflows/v3/portable-run-snapshot.js +176 -0
- package/dist/workflows/v3/portable-run-snapshot.js.map +1 -0
- package/dist/workflows/v3/portable-runtime.d.ts +83 -0
- package/dist/workflows/v3/portable-runtime.d.ts.map +1 -0
- package/dist/workflows/v3/portable-runtime.js +135 -0
- package/dist/workflows/v3/portable-runtime.js.map +1 -0
- package/dist/workflows/v3/runtime-host-contract.d.ts +182 -0
- package/dist/workflows/v3/runtime-host-contract.d.ts.map +1 -0
- package/dist/workflows/v3/runtime-host-contract.js +9 -0
- package/dist/workflows/v3/runtime-host-contract.js.map +1 -0
- package/dist/workflows/v3/runtime.d.ts +12 -226
- package/dist/workflows/v3/runtime.d.ts.map +1 -1
- package/dist/workflows/v3/runtime.js +14 -3173
- package/dist/workflows/v3/runtime.js.map +1 -1
- package/dist/workflows/v3/shared-node-runtime.d.ts +203 -0
- package/dist/workflows/v3/shared-node-runtime.d.ts.map +1 -0
- package/dist/workflows/v3/shared-node-runtime.js +2978 -0
- package/dist/workflows/v3/shared-node-runtime.js.map +1 -0
- package/dist/workflows/v3/shared-runtime.d.ts +17 -0
- package/dist/workflows/v3/shared-runtime.d.ts.map +1 -0
- package/dist/workflows/v3/shared-runtime.js +12 -0
- package/dist/workflows/v3/shared-runtime.js.map +1 -0
- package/package.json +4 -1
- package/dist/dashboard-web/chunks/roles-page-LHVAU2BI.js +0 -1
|
@@ -1,230 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Botmux-compatible facade for the shared Node runtime.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*
|
|
15
|
-
* MVP scope: static DAG, fail-fast, no retry (always `attempts/001`). Retry
|
|
16
|
-
* (`attempts/NNN`) and richer cancel semantics are deferred — see
|
|
17
|
-
* `docs/design/2026-06-01-v3-mvp-engine-split.md`.
|
|
18
|
-
*/
|
|
19
|
-
import { type V3Dag, type V3LoopExitWhen, type V3Node, type V3ResultSchema } from './dag.js';
|
|
20
|
-
import { type StoredEvent, type V3ErrorClass, type V3UncertainHostEffect } from './journal.js';
|
|
21
|
-
import type { RunChatBinding } from './grill-state.js';
|
|
22
|
-
import { type BotSnapshot, type GoalAsk, type Manifest, type RunNode, type ValidateManifest } from './contract.js';
|
|
23
|
-
import type { HostExecutorRegistry } from '../hostExecutors/registry.js';
|
|
24
|
-
import type { ProviderReconciler } from '../shared/provider-reconciler.js';
|
|
25
|
-
/**
|
|
26
|
-
* Render the self-contained instruction file the goal-mode agent reads via
|
|
27
|
-
* `$BOTMUX_GOAL_PATH`. The execution contract (read inputs / write products /
|
|
28
|
-
* write the manifest) lives HERE — in a file — rather than inside the `/goal`
|
|
29
|
-
* command text, because a long multi-line `/goal` argument trips Claude Code's
|
|
30
|
-
* paste-detection (the TUI folds it into a "[Pasted text]" blob and the
|
|
31
|
-
* slash-command parser never fires). The pool's `buildGoalCommand` therefore
|
|
32
|
-
* sends only a short single-line `/goal` that points the agent at this file.
|
|
33
|
-
*
|
|
34
|
-
* Rendered from `contract.ts` constants so the manifest shape stays a single
|
|
35
|
-
* source of truth shared with codex's validator.
|
|
36
|
-
*/
|
|
37
|
-
export declare function renderGoalFile(goal: string, resultSchema?: V3ResultSchema, loopCtx?: {
|
|
38
|
-
loopId: string;
|
|
39
|
-
iteration: number;
|
|
40
|
-
maxIterations: number;
|
|
41
|
-
}, nodeInstructions?: string, hasWorkflowParams?: boolean): string;
|
|
42
|
-
/**
|
|
43
|
-
* Map a node's failure to its terminal kind (the blocked/failed split):
|
|
44
|
-
* - `blocked` = semantic/contract failure — retryable via a new attempt
|
|
45
|
-
* - `failed` = infrastructure / human-veto / budget — needs intervention
|
|
46
|
-
*
|
|
47
|
-
* `selfReportedFail` marks the special case where the manifest is structurally
|
|
48
|
-
* VALID but declares `status:'fail'` — then the node's own `error.retryable`
|
|
49
|
-
* decides (`false` → failed; `true`/absent → blocked, the agent presumably
|
|
50
|
-
* knows a human can unblock it).
|
|
51
|
-
*/
|
|
52
|
-
export declare function classifyTerminal(errorClass: V3ErrorClass, opts?: {
|
|
53
|
-
selfReportedFail?: boolean;
|
|
54
|
-
retryable?: boolean;
|
|
55
|
-
}): 'blocked' | 'failed';
|
|
56
|
-
/**
|
|
57
|
-
* Read + validate a goal worker's `ask.json` (the runtime human-ask payload).
|
|
58
|
-
* Defensive: a missing / malformed / out-of-bounds file yields `undefined`, so a
|
|
59
|
-
* broken ask degrades to a plain blocked card rather than crashing the drive —
|
|
60
|
-
* the manifest's `error.message` still carries the question text for the human.
|
|
61
|
-
* Accepts either 2–6 concrete options or `freeText:true`. Exported for tests.
|
|
62
|
-
*/
|
|
63
|
-
export declare function readGoalAsk(askPath: string): GoalAsk | undefined;
|
|
64
|
-
/**
|
|
65
|
-
* Merge a node's capability override onto the bot's frozen snapshot (P2).
|
|
66
|
-
* Workflow execution always uses CLI bypass permissions; per-node overrides
|
|
67
|
-
* may redirect the model but cannot alter the permission posture.
|
|
68
|
-
*/
|
|
69
|
-
export declare function mergeNodeCapability(snap: BotSnapshot, override: V3Node['override']): BotSnapshot;
|
|
70
|
-
/** Validation outcome for an opt-in `result.json` against its node schema. */
|
|
71
|
-
export interface ResultValidation {
|
|
72
|
-
ok: boolean;
|
|
73
|
-
problems?: string[];
|
|
74
|
-
}
|
|
75
|
-
/** Read a worker's cross-node revisit request from `result.json` (if any). A
|
|
76
|
-
* revisit is `{ "status": "revisit", "revisitTo": "<ancestor>", "reason"? }`.
|
|
77
|
-
* Absent result.json / non-revisit status → `{ ok:true }` (no request). A
|
|
78
|
-
* malformed revisit (missing/blank revisitTo, non-string reason) → `ok:false`
|
|
79
|
-
* so the runtime blocks it as resultInvalid. The ancestor membership check
|
|
80
|
-
* (toNodeId ∈ node.revisitTo) is the caller's (it has the node). */
|
|
81
|
-
/** Two-tier revisit budget check (anti-infinite-loop): a source→target pair may
|
|
82
|
-
* revisit `DEFAULT_REVISIT_BUDGET_PER_PAIR` times, and the whole run
|
|
83
|
-
* `DEFAULT_REVISIT_BUDGET_PER_RUN` times, each extendable by a
|
|
84
|
-
* `revisitBudgetGranted` event. Counts revisits ALREADY made; returns
|
|
85
|
-
* `{ok:false, tier, detail}` when this next revisit would exceed a tier —
|
|
86
|
-
* `tier` tells the grant card which scope to extend (菲菲 review). */
|
|
87
|
-
export declare function revisitBudgetStatus(events: StoredEvent[], sourceNodeId: string, toNodeId: string): {
|
|
88
|
-
ok: true;
|
|
89
|
-
} | {
|
|
90
|
-
ok: false;
|
|
91
|
-
tier: 'pair' | 'run';
|
|
92
|
-
detail: string;
|
|
93
|
-
};
|
|
94
|
-
export declare function readRevisitRequest(manifest: Manifest, outputDir: string): {
|
|
95
|
-
ok: true;
|
|
96
|
-
request?: {
|
|
97
|
-
toNodeId: string;
|
|
98
|
-
reason?: string;
|
|
99
|
-
};
|
|
100
|
-
} | {
|
|
101
|
-
ok: false;
|
|
102
|
-
problems: string[];
|
|
103
|
-
};
|
|
104
|
-
/**
|
|
105
|
-
* Validate a `result.json` against the node's (already dag-validated) result
|
|
106
|
-
* schema subset. Top-level types only — see `V3ResultSchema`. Undeclared
|
|
107
|
-
* extra properties are allowed (JSON-Schema default).
|
|
108
|
-
*/
|
|
109
|
-
export declare function validateResult(filePath: string, schema: V3ResultSchema): ResultValidation;
|
|
110
|
-
/**
|
|
111
|
-
* Evaluate a (dag-validated) loop exit predicate against the observed result
|
|
112
|
-
* field. Pure + exported for tests. Type mismatches simply don't match —
|
|
113
|
-
* validateDag already guarantees the field is declared/required with a
|
|
114
|
-
* compatible type, so a mismatch here means the result was tampered with
|
|
115
|
-
* post-validation; not-matching (→ continue/exhausted) is the safe answer.
|
|
116
|
-
*/
|
|
117
|
-
export declare function matchLoopExitWhen(when: V3LoopExitWhen, value: unknown): boolean;
|
|
118
|
-
/**
|
|
119
|
-
* Compute the attemptId the NEXT dispatch of `nodeId` must use, from the
|
|
120
|
-
* journal: an unconsumed `nodeRetryRequested` reservation wins (retry intent
|
|
121
|
-
* is authoritative for the redrive); otherwise max(seen)+1 — which is 001 for
|
|
122
|
-
* a first dispatch. Dispatch events are the authority for "seen"; a
|
|
123
|
-
* reservation is consumed by a later `nodeDispatched` with the same number.
|
|
124
|
-
*/
|
|
125
|
-
export declare function nextAttemptIdFor(events: StoredEvent[], key: string): string;
|
|
126
|
-
/** Latest dispatched attemptId for a dispatch `key` (the `previousAttemptId` a
|
|
127
|
-
* retry entrypoint must reference). `key` is an instance (`A#001`), a loop
|
|
128
|
-
* body expansion, or a legacy nodeId — matched by `(instanceId ?? nodeId)` so
|
|
129
|
-
* a retry stays inside the same instance. Undefined when never dispatched. */
|
|
130
|
-
export declare function latestAttemptIdFor(events: StoredEvent[], key: string): string | undefined;
|
|
131
|
-
export interface V3RuntimeDeps {
|
|
132
|
-
/** Spawn an ephemeral worker for one goal node (codex's pool). */
|
|
133
|
-
runNode: RunNode;
|
|
134
|
-
/** Validate a node's manifest after the worker exits (codex's manifest.ts). */
|
|
135
|
-
validateManifest: ValidateManifest;
|
|
136
|
-
/** Freeze a node's bot spawn config at run start. Given `node.bot` (may be
|
|
137
|
-
* undefined → the run's default bot), returns the snapshot persisted in the
|
|
138
|
-
* runDir and threaded through `runNode` (never re-resolved mid-run). */
|
|
139
|
-
resolveBotSnapshot: (botId: string | undefined) => BotSnapshot;
|
|
140
|
-
/** Trusted deterministic host executors. Required when the DAG has host nodes. */
|
|
141
|
-
hostExecutors?: HostExecutorRegistry;
|
|
142
|
-
/** Provider recovery capabilities keyed by executor.provider. */
|
|
143
|
-
hostReconcilers?: Map<string, ProviderReconciler>;
|
|
144
|
-
/** Injectable wall clock for deterministic host idempotency-TTL recovery. */
|
|
145
|
-
now?: () => number;
|
|
146
|
-
/** Resolve a humanGate. Required only if the DAG declares any gate; the
|
|
147
|
-
* runtime throws if a gate is hit without a handler. (Wired by
|
|
148
|
-
* `human-gate.ts` post-milestone.) */
|
|
149
|
-
resolveGate?: (req: {
|
|
150
|
-
nodeId: string;
|
|
151
|
-
prompt: string;
|
|
152
|
-
waitId: string;
|
|
153
|
-
runDir: string;
|
|
154
|
-
hostApproval?: {
|
|
155
|
-
attemptId: string;
|
|
156
|
-
approvalDigest: string;
|
|
157
|
-
inputHash: string;
|
|
158
|
-
};
|
|
159
|
-
}) => Promise<{
|
|
160
|
-
resolution: 'approved' | 'rejected';
|
|
161
|
-
by: string;
|
|
162
|
-
selected?: string;
|
|
163
|
-
}>;
|
|
164
|
-
}
|
|
165
|
-
export interface V3RuntimeOptions {
|
|
166
|
-
/** The run lives in `${baseDir}/${dag.runId}`. */
|
|
167
|
-
baseDir: string;
|
|
168
|
-
/** Gate handling model. `blocking` keeps the CLI/dev y/N path; `suspend`
|
|
169
|
-
* writes the pending wait and returns `awaitingGate` for a daemon/card layer
|
|
170
|
-
* to resolve and re-drive from disk. */
|
|
171
|
-
gateMode?: 'blocking' | 'suspend';
|
|
172
|
-
/** Concurrency caps (codex's three-layer cap; conservative defaults). */
|
|
173
|
-
globalConcurrency?: number;
|
|
174
|
-
perBotConcurrency?: number;
|
|
175
|
-
perCliConcurrency?: number;
|
|
176
|
-
cancelSignal?: AbortSignal;
|
|
177
|
-
/** Bot identities already pinned by an immutable run envelope. When set,
|
|
178
|
-
* the runtime must use these exact snapshots instead of live bots.json. */
|
|
179
|
-
frozenBotSnapshots?: ReadonlyMap<string, BotSnapshot>;
|
|
180
|
-
/** `dag.json` / `bots.snapshot.json` are authorized exact-byte artifacts.
|
|
181
|
-
* Runtime may read them but must never rewrite them on start/retry/resume. */
|
|
182
|
-
authorizedArtifacts?: boolean;
|
|
183
|
-
/** Parsed from the exact verified params artifact. Each node receives only
|
|
184
|
-
* the keys it explicitly references, via an attempt-local 0600 JSON file. */
|
|
185
|
-
resolvedWorkflowData?: {
|
|
186
|
-
params: Record<string, unknown>;
|
|
187
|
-
context: Record<string, string>;
|
|
188
|
-
};
|
|
189
|
-
/** How long the scheduler waits for the original host SDK promise before
|
|
190
|
-
* detaching and reconciling the still-open durable intent with the same key. */
|
|
191
|
-
hostResponseWaitMs?: number;
|
|
192
|
-
/** The run's authenticated chat binding — threaded verbatim into every
|
|
193
|
-
* RunNodeRequest so worker CLI children get real BOTMUX_* identity env.
|
|
194
|
-
* See RunNodeRequest.chatBinding. */
|
|
195
|
-
chatBinding?: RunChatBinding;
|
|
4
|
+
* Existing daemon/CLI callers keep the historical dependency shape while the
|
|
5
|
+
* shared runtime receives an explicit attempt lease provider.
|
|
6
|
+
*/
|
|
7
|
+
import type { V3Dag } from './dag.js';
|
|
8
|
+
import { type V3RuntimeDeps as SharedRuntimeDeps, type V3RuntimeOptions, type V3RunOutcome } from './shared-node-runtime.js';
|
|
9
|
+
import type { AttemptLeaseProvider } from './runtime-host-contract.js';
|
|
10
|
+
export { classifyTerminal, latestAttemptIdFor, matchLoopExitWhen, mergeNodeCapability, nextAttemptIdFor, readGoalAsk, readRevisitRequest, renderGoalFile, revisitBudgetStatus, validateResult, } from './shared-node-runtime.js';
|
|
11
|
+
export type { ResultValidation, V3PendingGate, V3RunOutcome, V3RuntimeOptions, } from './shared-node-runtime.js';
|
|
12
|
+
export interface V3RuntimeDeps extends Omit<SharedRuntimeDeps, 'attemptLeaseProvider'> {
|
|
13
|
+
attemptLeaseProvider?: AttemptLeaseProvider;
|
|
196
14
|
}
|
|
197
|
-
export
|
|
198
|
-
nodeId: string;
|
|
199
|
-
waitId: string;
|
|
200
|
-
prompt: string;
|
|
201
|
-
options: string[];
|
|
202
|
-
approveOptions: string[];
|
|
203
|
-
approvers: string[];
|
|
204
|
-
hostApproval?: {
|
|
205
|
-
attemptId: string;
|
|
206
|
-
approvalDigest: string;
|
|
207
|
-
inputHash: string;
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
export type V3RunOutcome = {
|
|
211
|
-
reason: 'terminal';
|
|
212
|
-
runStatus: 'succeeded' | 'failed' | 'blocked' | 'cancelled';
|
|
213
|
-
failedNodeId?: string;
|
|
214
|
-
blockedNodeId?: string;
|
|
215
|
-
failureReason?: 'allSinksSkipped';
|
|
216
|
-
failureDetail?: string;
|
|
217
|
-
uncertainHostEffects?: V3UncertainHostEffect[];
|
|
218
|
-
runDir: string;
|
|
219
|
-
} | {
|
|
220
|
-
reason: 'awaitingGate';
|
|
221
|
-
pendingWaits: V3PendingGate[];
|
|
222
|
-
runDir: string;
|
|
223
|
-
};
|
|
224
|
-
/**
|
|
225
|
-
* Run a validated DAG to terminal. Resumable: if `journal.ndjson` already has
|
|
226
|
-
* events (daemon restart), the loop picks up from the materialized state
|
|
227
|
-
* instead of re-running completed nodes.
|
|
228
|
-
*/
|
|
229
|
-
export declare function runWorkflow(dag: V3Dag, deps: V3RuntimeDeps, opts: V3RuntimeOptions): Promise<V3RunOutcome>;
|
|
15
|
+
export declare function runWorkflow(dag: V3Dag, deps: V3RuntimeDeps, options: V3RuntimeOptions): Promise<V3RunOutcome>;
|
|
230
16
|
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/workflows/v3/runtime.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/workflows/v3/runtime.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAGtC,OAAO,EAEL,KAAK,aAAa,IAAI,iBAAiB,EACvC,KAAK,gBAAgB,EACrB,KAAK,YAAY,EAClB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,cAAc,GACf,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAElC,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,iBAAiB,EAAE,sBAAsB,CAAC;IACvD,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;CAC7C;AAED,wBAAsB,WAAW,CAC/B,GAAG,EAAE,KAAK,EACV,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,YAAY,CAAC,CAQvB"}
|