@adhdev/daemon-core 0.9.82-rc.49 → 0.9.82-rc.490
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/dist/boot/daemon-lifecycle.d.ts +9 -0
- package/dist/boot/process-hardening.d.ts +50 -0
- package/dist/build-info.d.ts +37 -0
- package/dist/chat/source-machine.d.ts +166 -0
- package/dist/chat/source-resolver.d.ts +104 -0
- package/dist/chat/subscription-updates.d.ts +1 -0
- package/dist/cli-adapter-types.d.ts +68 -2
- package/dist/cli-adapters/cli-script-runner.d.ts +117 -0
- package/dist/cli-adapters/cli-state-engine.d.ts +220 -0
- package/dist/cli-adapters/provider-cli-adapter.d.ts +137 -64
- package/dist/cli-adapters/provider-cli-parse.d.ts +5 -0
- package/dist/cli-adapters/provider-cli-runtime.d.ts +34 -0
- package/dist/cli-adapters/provider-cli-shared.d.ts +74 -0
- package/dist/cli-adapters/pty-write-chunking.d.ts +34 -0
- package/dist/cli-adapters/raw-terminal-io.d.ts +37 -0
- package/dist/cli-adapters/resolve-executable.d.ts +69 -0
- package/dist/cli-adapters/terminal-backends/ghostty-vt-backend.d.ts +6 -3
- package/dist/cli-adapters/terminal-backends/types.d.ts +10 -2
- package/dist/cli-adapters/terminal-screen.d.ts +4 -11
- package/dist/commands/chat-commands-debug-bundle.d.ts +14 -0
- package/dist/commands/chat-commands-read.d.ts +23 -0
- package/dist/commands/chat-commands-scope.d.ts +39 -0
- package/dist/commands/chat-commands-shared.d.ts +33 -0
- package/dist/commands/chat-commands-write.d.ts +14 -0
- package/dist/commands/chat-commands.d.ts +10 -23
- package/dist/commands/cli-manager.d.ts +71 -1
- package/dist/commands/handler.d.ts +125 -0
- package/dist/commands/high-family/index.d.ts +3 -0
- package/dist/commands/high-family/mesh-coordinator-launch.d.ts +2 -0
- package/dist/commands/high-family/mesh-events.d.ts +2 -0
- package/dist/commands/high-family/mesh-status.d.ts +2 -0
- package/dist/commands/high-family/types.d.ts +64 -0
- package/dist/commands/low-family/coordinator-prompt.d.ts +9 -0
- package/dist/commands/low-family/daemon-lifecycle.d.ts +2 -0
- package/dist/commands/low-family/diagnostics.d.ts +2 -0
- package/dist/commands/low-family/index.d.ts +3 -0
- package/dist/commands/low-family/mesh-ledger.d.ts +10 -0
- package/dist/commands/low-family/mesh-node-logs.d.ts +2 -0
- package/dist/commands/low-family/notification.d.ts +2 -0
- package/dist/commands/low-family/refine-config.d.ts +2 -0
- package/dist/commands/low-family/session-host.d.ts +2 -0
- package/dist/commands/low-family/spec-providerdev.d.ts +11 -0
- package/dist/commands/low-family/status-meta.d.ts +2 -0
- package/dist/commands/low-family/types.d.ts +33 -0
- package/dist/commands/med-family/cli-agent.d.ts +2 -0
- package/dist/commands/med-family/fast-forward.d.ts +2 -0
- package/dist/commands/med-family/ide.d.ts +10 -0
- package/dist/commands/med-family/index.d.ts +3 -0
- package/dist/commands/med-family/mesh-crud.d.ts +48 -0
- package/dist/commands/med-family/mesh-host-pairing.d.ts +2 -0
- package/dist/commands/med-family/mesh-queue.d.ts +2 -0
- package/dist/commands/med-family/mesh-restart.d.ts +2 -0
- package/dist/commands/med-family/types.d.ts +152 -0
- package/dist/commands/mesh-coordinator.d.ts +85 -1
- package/dist/commands/router-aggregate-status.d.ts +24 -0
- package/dist/commands/router-mesh-session-owner.d.ts +59 -0
- package/dist/commands/router-refine.d.ts +151 -0
- package/dist/commands/router-worktree-cleanup.d.ts +133 -0
- package/dist/commands/router.d.ts +203 -15
- package/dist/commands/upgrade-helper.d.ts +41 -1
- package/dist/config/chat-history.d.ts +11 -0
- package/dist/config/config.d.ts +19 -0
- package/dist/config/mesh-config.d.ts +65 -0
- package/dist/config/mesh-json-config.d.ts +199 -0
- package/dist/config/registry-resolver.d.ts +54 -0
- package/dist/config/repo-settings.d.ts +77 -0
- package/dist/config/state-store.d.ts +30 -0
- package/dist/daemon/dev-server.d.ts +0 -2
- package/dist/detection/cli-detector.d.ts +17 -0
- package/dist/detection/ide-detector.d.ts +13 -0
- package/dist/detection/win32-ide-version.d.ts +37 -0
- package/dist/git/change-impact-config.d.ts +159 -0
- package/dist/git/git-commands.d.ts +26 -2
- package/dist/git/git-diff.d.ts +6 -0
- package/dist/git/git-executor.d.ts +11 -0
- package/dist/git/git-status.d.ts +80 -0
- package/dist/git/git-types.d.ts +2 -50
- package/dist/git/git-worktree.d.ts +71 -1
- package/dist/git/index.d.ts +3 -1
- package/dist/index.d.ts +70 -17
- package/dist/index.js +53532 -19073
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +53283 -18989
- package/dist/index.mjs.map +1 -1
- package/dist/installer.d.ts +1 -4
- package/dist/ipc/local-ipc-server.d.ts +91 -0
- package/dist/launch.d.ts +1 -1
- package/dist/logging/async-batch-writer.d.ts +10 -0
- package/dist/logging/debug-config.d.ts +16 -0
- package/dist/logging/log-redactor.d.ts +24 -0
- package/dist/logging/log-tail-reader.d.ts +81 -0
- package/dist/logging/logger.d.ts +1 -1
- package/dist/mesh/contracts.d.ts +256 -0
- package/dist/mesh/coordinator-prompt.d.ts +76 -0
- package/dist/mesh/coordinator-registry.d.ts +59 -0
- package/dist/mesh/mesh-active-work.d.ts +203 -0
- package/dist/mesh/mesh-clone-grace.d.ts +8 -0
- package/dist/mesh/mesh-completion-synthesis.d.ts +4 -0
- package/dist/mesh/mesh-coordinator-config.d.ts +21 -0
- package/dist/mesh/mesh-delivery-policy.d.ts +104 -0
- package/dist/mesh/mesh-event-classify.d.ts +7 -0
- package/dist/mesh/mesh-event-forwarding.d.ts +58 -0
- package/dist/mesh/mesh-event-trace.d.ts +21 -0
- package/dist/mesh/mesh-events-coordinator.d.ts +4 -0
- package/dist/mesh/mesh-events-pending.d.ts +258 -0
- package/dist/mesh/mesh-events-stale.d.ts +61 -0
- package/dist/mesh/mesh-events-utils.d.ts +75 -0
- package/dist/mesh/mesh-events.d.ts +6 -49
- package/dist/mesh/mesh-fast-forward.d.ts +81 -0
- package/dist/mesh/mesh-host-ownership.d.ts +21 -1
- package/dist/mesh/mesh-init.d.ts +128 -0
- package/dist/mesh/mesh-ledger-reconciliation.d.ts +23 -4
- package/dist/mesh/mesh-ledger.d.ts +139 -1
- package/dist/mesh/mesh-magi-status.d.ts +63 -0
- package/dist/mesh/mesh-missions.d.ts +281 -0
- package/dist/mesh/mesh-node-identity.d.ts +310 -0
- package/dist/mesh/mesh-queue-assignment.d.ts +162 -0
- package/dist/mesh/mesh-reconcile-acked-hold.d.ts +17 -0
- package/dist/mesh/mesh-reconcile-config.d.ts +6 -0
- package/dist/mesh/mesh-reconcile-identity.d.ts +6 -0
- package/dist/mesh/mesh-reconcile-loop.d.ts +84 -0
- package/dist/mesh/mesh-reconcile-v2-backstop.d.ts +16 -0
- package/dist/mesh/mesh-refine-batch.d.ts +68 -0
- package/dist/mesh/mesh-refine-gates.d.ts +457 -0
- package/dist/mesh/mesh-refine-status.d.ts +62 -0
- package/dist/mesh/mesh-remote-event-pull.d.ts +15 -0
- package/dist/mesh/mesh-review-inbox.d.ts +90 -0
- package/dist/mesh/mesh-routing.d.ts +70 -0
- package/dist/mesh/mesh-runtime-store.d.ts +567 -0
- package/dist/mesh/mesh-scheduling-runtime.d.ts +78 -0
- package/dist/mesh/mesh-task-inflight.d.ts +46 -0
- package/dist/mesh/mesh-task-stats.d.ts +49 -0
- package/dist/mesh/mesh-unresolved-forward-outbox.d.ts +34 -0
- package/dist/mesh/mesh-warmup-deadline.d.ts +68 -0
- package/dist/mesh/mesh-work-queue.d.ts +392 -1
- package/dist/mesh/preview-freshness.d.ts +28 -0
- package/dist/mesh/refine-config.d.ts +97 -0
- package/dist/mesh/worktree-bootstrap-config.d.ts +219 -0
- package/dist/providers/acp-provider-instance.d.ts +5 -0
- package/dist/providers/approval-utils.d.ts +46 -0
- package/dist/providers/chat-message-normalization.d.ts +58 -1
- package/dist/providers/cli-provider-effect-format.d.ts +30 -0
- package/dist/providers/cli-provider-history-dedup.d.ts +17 -0
- package/dist/providers/cli-provider-input-prompt.d.ts +12 -0
- package/dist/providers/cli-provider-instance-types.d.ts +45 -0
- package/dist/providers/cli-provider-instance.d.ts +426 -30
- package/dist/providers/cli-provider-status-helpers.d.ts +46 -0
- package/dist/providers/cli-provider-transcript-merge.d.ts +7 -0
- package/dist/providers/contracts.d.ts +196 -6
- package/dist/providers/external-sources.d.ts +71 -0
- package/dist/providers/manual-attendance.d.ts +79 -0
- package/dist/providers/native-history/antigravity-claim-registry.d.ts +39 -0
- package/dist/providers/native-history/antigravity-cli-transcript.d.ts +137 -0
- package/dist/providers/native-history/claude-cli-transcript.d.ts +70 -0
- package/dist/providers/native-history/codex-cli-transcript.d.ts +73 -0
- package/dist/providers/native-history/constants.d.ts +12 -0
- package/dist/providers/native-history/dispatcher.d.ts +44 -0
- package/dist/providers/native-history/hermes-cli-transcript.d.ts +30 -0
- package/dist/providers/native-history/index.d.ts +13 -0
- package/dist/providers/provider-instance-manager.d.ts +30 -0
- package/dist/providers/provider-instance.d.ts +31 -1
- package/dist/providers/provider-loader.d.ts +42 -5
- package/dist/providers/provider-trust.d.ts +31 -0
- package/dist/providers/read-chat-contract.d.ts +29 -0
- package/dist/providers/sdk/v1/builders/acp/detect-status.d.ts +68 -0
- package/dist/providers/sdk/v1/builders/cli/detect-status.d.ts +86 -0
- package/dist/providers/sdk/v1/builders/cli/parse-approval-squash.d.ts +59 -0
- package/dist/providers/sdk/v1/builders/cli/parse-approval.d.ts +65 -0
- package/dist/providers/sdk/v1/builders/cli/parse-session.d.ts +91 -0
- package/dist/providers/sdk/v1/builders/cli/visible-region.d.ts +42 -0
- package/dist/providers/sdk/v1/fixture-tooling/format.d.ts +126 -0
- package/dist/providers/sdk/v1/fixture-tooling/index.d.ts +8 -0
- package/dist/providers/sdk/v1/fixture-tooling/replay.d.ts +38 -0
- package/dist/providers/sdk/v1/index.d.ts +30 -0
- package/dist/providers/sdk/v1/sandbox/README-design.d.ts +193 -0
- package/dist/providers/sdk/v1/sandbox/require-whitelist.d.ts +74 -0
- package/dist/providers/sdk/v1/sandbox/script-runner.d.ts +98 -0
- package/dist/providers/sdk/v1/types/cli/index.d.ts +277 -0
- package/dist/providers/sdk/v1/types/common/index.d.ts +203 -0
- package/dist/providers/sdk/v1/validators/index.d.ts +5 -0
- package/dist/providers/sdk/v1/validators/manifest.d.ts +40 -0
- package/dist/providers/sdk/v1/validators/taint.d.ts +52 -0
- package/dist/providers/spec/adapter.d.ts +98 -0
- package/dist/providers/spec/cli-adapter.d.ts +223 -0
- package/dist/providers/spec/evaluator.d.ts +45 -0
- package/dist/providers/spec/fsm-driver.d.ts +449 -0
- package/dist/providers/spec/fsm-evaluator.d.ts +93 -0
- package/dist/providers/spec/fsm-loader.d.ts +14 -0
- package/dist/providers/spec/fsm-types.d.ts +202 -0
- package/dist/providers/spec/native-history-executor.d.ts +41 -0
- package/dist/providers/spec/pre-launch-trust.d.ts +16 -0
- package/dist/providers/spec/route.d.ts +4 -0
- package/dist/providers/spec/types.d.ts +244 -0
- package/dist/providers/status-monitor.d.ts +7 -7
- package/dist/providers/transcript-v2.d.ts +176 -0
- package/dist/providers/types/interactive-prompt.d.ts +84 -0
- package/dist/providers/working-dir.d.ts +17 -0
- package/dist/repo-mesh-types.d.ts +616 -12
- package/dist/runtime-defaults.d.ts +2 -0
- package/dist/session-host/managed-host.d.ts +64 -0
- package/dist/session-host/runtime-surface.d.ts +10 -16
- package/dist/sessions/registry.d.ts +26 -0
- package/dist/shared-types-extra.d.ts +2 -4
- package/dist/shared-types.d.ts +110 -55
- package/dist/status/chat-tail-hot-sessions.d.ts +40 -0
- package/dist/status/normalize.d.ts +1 -1
- package/dist/status/normalize.js +1 -0
- package/dist/status/normalize.js.map +1 -1
- package/dist/status/normalize.mjs +1 -0
- package/dist/status/normalize.mjs.map +1 -1
- package/dist/status/reporter.d.ts +2 -0
- package/dist/status/snapshot.d.ts +27 -0
- package/dist/system/hash.d.ts +8 -0
- package/dist/system/load-better-sqlite3.d.ts +21 -0
- package/dist/types.d.ts +20 -6
- package/package.json +11 -4
- package/src/agent-stream/poller.ts +2 -3
- package/src/agent-stream/provider-adapter.ts +1 -1
- package/src/boot/daemon-lifecycle.ts +80 -14
- package/src/boot/process-hardening.ts +89 -0
- package/src/build-info.ts +73 -0
- package/src/chat/source-machine.ts +534 -0
- package/src/chat/source-resolver.ts +0 -0
- package/src/chat/subscription-updates.ts +20 -1
- package/src/cli-adapter-types.d.ts +3 -1
- package/src/cli-adapter-types.ts +68 -2
- package/src/cli-adapters/cli-script-runner.ts +421 -0
- package/src/cli-adapters/cli-state-engine.ts +1282 -0
- package/src/cli-adapters/provider-cli-adapter.d.ts +1 -1
- package/src/cli-adapters/provider-cli-adapter.ts +1048 -1143
- package/src/cli-adapters/provider-cli-parse.d.ts +2 -0
- package/src/cli-adapters/provider-cli-parse.ts +19 -0
- package/src/cli-adapters/provider-cli-runtime.ts +56 -7
- package/src/cli-adapters/provider-cli-shared.d.ts +4 -0
- package/src/cli-adapters/provider-cli-shared.ts +121 -11
- package/src/cli-adapters/pty-transport.ts +2 -1
- package/src/cli-adapters/pty-write-chunking.ts +106 -0
- package/src/cli-adapters/raw-terminal-io.ts +252 -0
- package/src/cli-adapters/resolve-executable.ts +204 -0
- package/src/cli-adapters/session-host-transport.ts +2 -1
- package/src/cli-adapters/terminal-backends/ghostty-vt-backend.ts +63 -29
- package/src/cli-adapters/terminal-backends/types.ts +10 -3
- package/src/cli-adapters/terminal-screen.ts +16 -81
- package/src/commands/chat-commands-debug-bundle.ts +398 -0
- package/src/commands/chat-commands-read.ts +2788 -0
- package/src/commands/chat-commands-scope.ts +54 -0
- package/src/commands/chat-commands-shared.ts +114 -0
- package/src/commands/chat-commands-write.ts +891 -0
- package/src/commands/chat-commands.ts +19 -1841
- package/src/commands/cli-manager.d.ts +2 -0
- package/src/commands/cli-manager.ts +724 -27
- package/src/commands/handler.ts +865 -2
- package/src/commands/high-family/index.ts +28 -0
- package/src/commands/high-family/mesh-coordinator-launch.ts +696 -0
- package/src/commands/high-family/mesh-events.ts +102 -0
- package/src/commands/high-family/mesh-status.ts +857 -0
- package/src/commands/high-family/types.ts +80 -0
- package/src/commands/low-family/coordinator-prompt.ts +125 -0
- package/src/commands/low-family/daemon-lifecycle.ts +120 -0
- package/src/commands/low-family/diagnostics.ts +57 -0
- package/src/commands/low-family/index.ts +37 -0
- package/src/commands/low-family/mesh-ledger.ts +62 -0
- package/src/commands/low-family/mesh-node-logs.ts +87 -0
- package/src/commands/low-family/notification.ts +116 -0
- package/src/commands/low-family/refine-config.ts +106 -0
- package/src/commands/low-family/session-host.ts +282 -0
- package/src/commands/low-family/spec-providerdev.ts +217 -0
- package/src/commands/low-family/status-meta.ts +112 -0
- package/src/commands/low-family/types.ts +39 -0
- package/src/commands/med-family/cli-agent.ts +270 -0
- package/src/commands/med-family/fast-forward.ts +230 -0
- package/src/commands/med-family/ide.ts +163 -0
- package/src/commands/med-family/index.ts +37 -0
- package/src/commands/med-family/mesh-crud.ts +1268 -0
- package/src/commands/med-family/mesh-host-pairing.ts +234 -0
- package/src/commands/med-family/mesh-queue.ts +167 -0
- package/src/commands/med-family/mesh-restart.ts +92 -0
- package/src/commands/med-family/types.ts +153 -0
- package/src/commands/mesh-coordinator.ts +334 -124
- package/src/commands/router-aggregate-status.ts +209 -0
- package/src/commands/router-mesh-session-owner.ts +114 -0
- package/src/commands/router-refine.ts +1794 -0
- package/src/commands/router-worktree-cleanup.ts +870 -0
- package/src/commands/router.ts +567 -4149
- package/src/commands/stream-commands.ts +8 -0
- package/src/commands/upgrade-helper.ts +310 -45
- package/src/config/chat-history.ts +517 -24
- package/src/config/config.ts +30 -0
- package/src/config/mesh-config.ts +300 -24
- package/src/config/mesh-json-config.ts +376 -0
- package/src/config/recent-activity.ts +8 -2
- package/src/config/registry-resolver.ts +100 -0
- package/src/config/repo-settings.ts +111 -0
- package/src/config/state-store.ts +55 -0
- package/src/daemon/dev-auto-implement.ts +3 -2
- package/src/daemon/dev-cli-debug.ts +10 -1
- package/src/daemon/dev-server.ts +0 -541
- package/src/detection/cli-detector.ts +94 -9
- package/src/detection/ide-detector.ts +55 -16
- package/src/detection/win32-ide-version.ts +106 -0
- package/src/git/change-impact-config.ts +354 -0
- package/src/git/git-commands.ts +112 -16
- package/src/git/git-diff.ts +81 -11
- package/src/git/git-executor.ts +12 -0
- package/src/git/git-status.ts +822 -48
- package/src/git/git-types.ts +14 -62
- package/src/git/git-worktree.ts +261 -4
- package/src/git/index.ts +17 -0
- package/src/index.ts +190 -13
- package/src/installer.d.ts +1 -1
- package/src/installer.ts +8 -6
- package/src/ipc/local-ipc-server.ts +278 -0
- package/src/launch.d.ts +1 -1
- package/src/launch.ts +37 -28
- package/src/logging/async-batch-writer.ts +55 -0
- package/src/logging/command-log.ts +7 -5
- package/src/logging/debug-config.ts +25 -0
- package/src/logging/debug-trace.ts +7 -2
- package/src/logging/log-redactor.ts +100 -0
- package/src/logging/log-tail-reader.ts +341 -0
- package/src/logging/logger.ts +14 -7
- package/src/mesh/contracts.ts +510 -0
- package/src/mesh/coordinator-prompt.ts +627 -34
- package/src/mesh/coordinator-registry.ts +121 -0
- package/src/mesh/mesh-active-work.ts +706 -0
- package/src/mesh/mesh-clone-grace.ts +68 -0
- package/src/mesh/mesh-completion-synthesis.ts +416 -0
- package/src/mesh/mesh-coordinator-config.ts +97 -0
- package/src/mesh/mesh-delivery-policy.ts +284 -0
- package/src/mesh/mesh-event-classify.ts +78 -0
- package/src/mesh/mesh-event-forwarding.ts +2030 -0
- package/src/mesh/mesh-event-trace.ts +67 -0
- package/src/mesh/mesh-events-coordinator.ts +32 -0
- package/src/mesh/mesh-events-pending.ts +1548 -0
- package/src/mesh/mesh-events-stale.ts +452 -0
- package/src/mesh/mesh-events-utils.ts +443 -0
- package/src/mesh/mesh-events.ts +43 -1035
- package/src/mesh/mesh-fast-forward.ts +856 -0
- package/src/mesh/mesh-host-ownership.ts +41 -3
- package/src/mesh/mesh-init.ts +350 -0
- package/src/mesh/mesh-ledger-reconciliation.ts +12 -7
- package/src/mesh/mesh-ledger.ts +897 -102
- package/src/mesh/mesh-magi-status.ts +223 -0
- package/src/mesh/mesh-missions.ts +695 -0
- package/src/mesh/mesh-node-identity.ts +2065 -0
- package/src/mesh/mesh-queue-assignment.ts +2498 -0
- package/src/mesh/mesh-reconcile-acked-hold.ts +230 -0
- package/src/mesh/mesh-reconcile-config.ts +66 -0
- package/src/mesh/mesh-reconcile-identity.ts +103 -0
- package/src/mesh/mesh-reconcile-loop.ts +1696 -0
- package/src/mesh/mesh-reconcile-v2-backstop.ts +62 -0
- package/src/mesh/mesh-refine-batch.ts +205 -0
- package/src/mesh/mesh-refine-gates.ts +1792 -0
- package/src/mesh/mesh-refine-status.ts +231 -0
- package/src/mesh/mesh-remote-event-pull.ts +279 -0
- package/src/mesh/mesh-review-inbox.ts +308 -0
- package/src/mesh/mesh-routing.ts +291 -0
- package/src/mesh/mesh-runtime-store.ts +2292 -0
- package/src/mesh/mesh-scheduling-runtime.ts +198 -0
- package/src/mesh/mesh-task-inflight.ts +70 -0
- package/src/mesh/mesh-task-stats.ts +161 -0
- package/src/mesh/mesh-unresolved-forward-outbox.ts +215 -0
- package/src/mesh/mesh-warmup-deadline.ts +152 -0
- package/src/mesh/mesh-work-queue.ts +1489 -145
- package/src/mesh/preview-freshness.ts +163 -0
- package/src/mesh/refine-config.ts +129 -12
- package/src/mesh/worktree-bootstrap-config.ts +599 -0
- package/src/providers/acp-provider-instance.ts +43 -10
- package/src/providers/approval-utils.d.ts +5 -0
- package/src/providers/approval-utils.ts +100 -6
- package/src/providers/chat-message-normalization.ts +126 -4
- package/src/providers/cli-provider-effect-format.ts +53 -0
- package/src/providers/cli-provider-history-dedup.ts +75 -0
- package/src/providers/cli-provider-input-prompt.ts +133 -0
- package/src/providers/cli-provider-instance-types.ts +131 -0
- package/src/providers/cli-provider-instance.ts +2771 -499
- package/src/providers/cli-provider-status-helpers.ts +123 -0
- package/src/providers/cli-provider-transcript-merge.ts +114 -0
- package/src/providers/contracts.d.ts +55 -0
- package/src/providers/contracts.ts +207 -6
- package/src/providers/extension-provider-instance.ts +12 -7
- package/src/providers/external-sources.ts +218 -0
- package/src/providers/ide-provider-instance.ts +35 -12
- package/src/providers/manual-attendance.ts +105 -0
- package/src/providers/native-history/antigravity-claim-registry.ts +138 -0
- package/src/providers/native-history/antigravity-cli-transcript.ts +1275 -0
- package/src/providers/native-history/claude-cli-transcript.ts +396 -0
- package/src/providers/native-history/codex-cli-transcript.ts +479 -0
- package/src/providers/native-history/constants.ts +19 -0
- package/src/providers/native-history/dispatcher.ts +617 -0
- package/src/providers/native-history/hermes-cli-transcript.ts +312 -0
- package/src/providers/native-history/index.ts +30 -0
- package/src/providers/provider-instance-manager.ts +71 -0
- package/src/providers/provider-instance.ts +24 -1
- package/src/providers/provider-loader.ts +700 -55
- package/src/providers/provider-schema.ts +93 -14
- package/src/providers/provider-trust.ts +114 -0
- package/src/providers/read-chat-contract.ts +76 -16
- package/src/providers/sdk/README.md +49 -0
- package/src/providers/sdk/v1/builders/acp/detect-status.ts +144 -0
- package/src/providers/sdk/v1/builders/cli/detect-status.ts +313 -0
- package/src/providers/sdk/v1/builders/cli/parse-approval-squash.ts +158 -0
- package/src/providers/sdk/v1/builders/cli/parse-approval.ts +261 -0
- package/src/providers/sdk/v1/builders/cli/parse-session.ts +276 -0
- package/src/providers/sdk/v1/builders/cli/visible-region.ts +143 -0
- package/src/providers/sdk/v1/fixture-tooling/format.ts +130 -0
- package/src/providers/sdk/v1/fixture-tooling/index.ts +22 -0
- package/src/providers/sdk/v1/fixture-tooling/replay.ts +352 -0
- package/src/providers/sdk/v1/index.ts +152 -0
- package/src/providers/sdk/v1/sandbox/README-design.ts +195 -0
- package/src/providers/sdk/v1/sandbox/require-whitelist.ts +472 -0
- package/src/providers/sdk/v1/sandbox/script-runner.ts +150 -0
- package/src/providers/sdk/v1/schemas/cli/provider.schema.json +538 -0
- package/src/providers/sdk/v1/schemas/primitives/acp-session-protocol-v1.json +131 -0
- package/src/providers/sdk/v1/schemas/primitives/native-history-codex-rollout-v1.json +66 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-approval-squash-v1.json +91 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-assistant-block-v1.json +91 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-cue-ordering-v1.json +47 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-dispatch-order-v1.json +32 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-footer-chrome-v1.json +42 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-index-finder-v1.json +27 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-modal-v1.json +125 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-prompt-marker-v1.json +45 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-session-id-extraction-v1.json +46 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-settled-prompt-v1.json +71 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-spinner-v1.json +83 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-transcript-pty-v1.json +83 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-visible-region-v1.json +57 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-welcome-screen-v1.json +35 -0
- package/src/providers/sdk/v1/types/cli/index.ts +365 -0
- package/src/providers/sdk/v1/types/common/index.ts +229 -0
- package/src/providers/sdk/v1/validators/index.ts +19 -0
- package/src/providers/sdk/v1/validators/manifest.ts +110 -0
- package/src/providers/sdk/v1/validators/taint.ts +309 -0
- package/src/providers/spec/adapter.ts +246 -0
- package/src/providers/spec/cli-adapter.ts +1064 -0
- package/src/providers/spec/evaluator.ts +407 -0
- package/src/providers/spec/fsm-driver.ts +1528 -0
- package/src/providers/spec/fsm-evaluator.ts +290 -0
- package/src/providers/spec/fsm-loader.ts +128 -0
- package/src/providers/spec/fsm-types.ts +301 -0
- package/src/providers/spec/native-history-executor.ts +1241 -0
- package/src/providers/spec/pre-launch-trust.ts +104 -0
- package/src/providers/spec/route.ts +51 -0
- package/src/providers/spec/types.ts +284 -0
- package/src/providers/status-monitor.d.ts +7 -7
- package/src/providers/status-monitor.ts +37 -22
- package/src/providers/transcript-v2.ts +567 -0
- package/src/providers/types/interactive-prompt.ts +536 -0
- package/src/providers/version-archive.ts +64 -24
- package/src/providers/working-dir.ts +23 -0
- package/src/repo-mesh-types.ts +861 -14
- package/src/runtime-defaults.ts +39 -0
- package/src/session-host/managed-host.ts +218 -0
- package/src/session-host/runtime-surface.ts +20 -80
- package/src/sessions/registry.ts +44 -0
- package/src/shared-types-extra.ts +2 -4
- package/src/shared-types.d.ts +8 -0
- package/src/shared-types.ts +148 -55
- package/src/status/builders.ts +69 -6
- package/src/status/chat-tail-hot-sessions.ts +117 -2
- package/src/status/normalize.ts +2 -0
- package/src/status/reporter.ts +19 -1
- package/src/status/snapshot.ts +100 -27
- package/src/system/hash.ts +23 -0
- package/src/system/host-memory.ts +29 -12
- package/src/system/load-better-sqlite3.ts +68 -0
- package/src/types.ts +26 -6
- package/dist/cli-adapters/terminal-backends/xterm-backend.d.ts +0 -17
- package/dist/mesh/mesh-sync.d.ts +0 -53
- package/src/cli-adapters/terminal-backends/ghostty-vt-backend.d.ts +0 -16
- package/src/cli-adapters/terminal-backends/xterm-backend.ts +0 -97
- package/src/mesh/mesh-sync.ts +0 -111
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MeshCoordinatorMcpConfigFormat, MeshCoordinatorSystemPromptInjection, ProviderModule } from '../providers/contracts.js';
|
|
2
2
|
export interface MeshCoordinatorMcpServerLaunch {
|
|
3
3
|
command: string;
|
|
4
4
|
args: string[];
|
|
@@ -25,6 +25,7 @@ export type MeshCoordinatorSetup = {
|
|
|
25
25
|
command: string;
|
|
26
26
|
requiresRestart: boolean;
|
|
27
27
|
instructions: string;
|
|
28
|
+
mcpServer: MeshCoordinatorMcpServerLaunch;
|
|
28
29
|
} | {
|
|
29
30
|
kind: 'unsupported';
|
|
30
31
|
reason: string;
|
|
@@ -42,3 +43,86 @@ export interface ResolveMeshCoordinatorSetupOptions {
|
|
|
42
43
|
}
|
|
43
44
|
export declare function createHermesManualMeshCoordinatorSetup(meshId: string, workspace: string): MeshCoordinatorSetup;
|
|
44
45
|
export declare function resolveMeshCoordinatorSetup(options: ResolveMeshCoordinatorSetupOptions): MeshCoordinatorSetup;
|
|
46
|
+
/**
|
|
47
|
+
* Apply a provider's declared system-prompt injection rule, mutating `cliArgs`
|
|
48
|
+
* and `launchEnv` in place and writing any required workspace context file.
|
|
49
|
+
*
|
|
50
|
+
* Replaces the previous hard-coded `if (cliType === 'claude-cli') ... else if
|
|
51
|
+
* (cliType === 'hermes-cli') ...` branches in router.ts. Adding a new CLI is
|
|
52
|
+
* now provider.v1.json data, not a router edit.
|
|
53
|
+
*
|
|
54
|
+
* Failures are non-fatal: log and continue with whatever was applied so the
|
|
55
|
+
* coordinator session still launches, just without the prompt for that
|
|
56
|
+
* provider. A missing/unknown rule means "skip injection" — safe by default
|
|
57
|
+
* (the previous fallback unconditionally pushed --append-system-prompt onto
|
|
58
|
+
* every non-Claude CLI, which crashed agy on launch).
|
|
59
|
+
*/
|
|
60
|
+
export interface CoordinatorInjectionEffect {
|
|
61
|
+
/** Absolute path the daemon wrote a wrapper-blocked file to. Only set for
|
|
62
|
+
* context_file injection. R48 schedules a strip after launch so workers
|
|
63
|
+
* don't see the wrapper on disk; R47's unregister cleanup uses it as a
|
|
64
|
+
* fallback if the timer never fires (process crash, etc). */
|
|
65
|
+
contextFilePath?: string;
|
|
66
|
+
}
|
|
67
|
+
export declare function applyMeshCoordinatorSystemPromptInjection(systemPrompt: string, injection: MeshCoordinatorSystemPromptInjection | undefined, ctx: {
|
|
68
|
+
cliArgs: string[];
|
|
69
|
+
launchEnv: Record<string, string>;
|
|
70
|
+
workspace: string;
|
|
71
|
+
cliType: string;
|
|
72
|
+
}): CoordinatorInjectionEffect;
|
|
73
|
+
/**
|
|
74
|
+
* Strip the daemon's wrapper block from a context_file we previously wrote.
|
|
75
|
+
*
|
|
76
|
+
* Used in two places:
|
|
77
|
+
* 1. R48 inject-then-remove: ~5s after spawn, after agy/gemini have read
|
|
78
|
+
* the file into their in-memory system-prompt cache. Removing it from
|
|
79
|
+
* disk at that point doesn't affect the running coordinator but keeps
|
|
80
|
+
* worker sessions (or fresh non-coordinator launches) in the same
|
|
81
|
+
* workspace from picking up our wrapper.
|
|
82
|
+
* 2. R47 unregister fallback: if the timer never fires (process crash,
|
|
83
|
+
* kill -9), coordinator-registry.unregisterMeshCoordinator runs the
|
|
84
|
+
* same logic when its entry is dropped.
|
|
85
|
+
*
|
|
86
|
+
* Idempotent: missing file is fine, missing sentinels are fine, returns
|
|
87
|
+
* silently. Leaves user-authored content outside the sentinels intact.
|
|
88
|
+
* Deletes the file outright if our wrapper was the only content.
|
|
89
|
+
*/
|
|
90
|
+
export declare function stripCoordinatorWrapperFile(filePath: string): void;
|
|
91
|
+
export interface PtyExecResult {
|
|
92
|
+
exitCode: number | null;
|
|
93
|
+
signal: number | null;
|
|
94
|
+
output: string;
|
|
95
|
+
timedOut: boolean;
|
|
96
|
+
}
|
|
97
|
+
export interface MeshCoordinatorRegistrationStep {
|
|
98
|
+
command: string;
|
|
99
|
+
args: string[];
|
|
100
|
+
required: boolean;
|
|
101
|
+
label: 'remove_existing' | 'register';
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Codex rejects `mcp add` when a server with the same name already exists.
|
|
105
|
+
* Replace that entry before registering so transport/mesh changes do not leave
|
|
106
|
+
* a fresh coordinator attached to stale MCP launch arguments.
|
|
107
|
+
*/
|
|
108
|
+
export declare function buildMeshCoordinatorRegistrationPlan(cliType: string, serverName: string, registrationCommand: string): MeshCoordinatorRegistrationStep[];
|
|
109
|
+
/**
|
|
110
|
+
* Run a one-shot CLI command under a real PTY and collect its output.
|
|
111
|
+
*
|
|
112
|
+
* Some provider mcp-registration commands (`agy mcp add`, future bubbletea
|
|
113
|
+
* TUIs) refuse to run without `/dev/tty`. Daemon-side `execFileSync` runs
|
|
114
|
+
* pipe-only, so those commands fail with errors like
|
|
115
|
+
* `bubbletea: error opening TTY: open /dev/tty: device not configured`
|
|
116
|
+
* and silently skip the registration, leaving the launched session
|
|
117
|
+
* without the adhdev-mesh MCP tools — which is exactly what we saw with
|
|
118
|
+
* agy coordinators.
|
|
119
|
+
*
|
|
120
|
+
* Wrapping the registration through node-pty gives the child a real PTY,
|
|
121
|
+
* so the bubbletea check passes. We close stdin immediately and just
|
|
122
|
+
* collect stdout until the process exits or the timeout fires.
|
|
123
|
+
*/
|
|
124
|
+
export declare function execUnderPty(command: string, args: string[], options?: {
|
|
125
|
+
cwd?: string;
|
|
126
|
+
env?: Record<string, string>;
|
|
127
|
+
timeoutMs?: number;
|
|
128
|
+
}): Promise<PtyExecResult>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Aggregate mesh-status cache — extracted from router.ts (behavior-preserving code move).
|
|
3
|
+
*
|
|
4
|
+
* These functions were `DaemonCommandRouter` methods; they now take the router
|
|
5
|
+
* instance as `self`. The class keeps thin delegating wrappers
|
|
6
|
+
* (getCachedAggregateMeshStatus / rememberAggregateMeshStatus are bound into
|
|
7
|
+
* HighFamilyContext — intra-cluster calls therefore go through `self.` so instance
|
|
8
|
+
* dispatch is preserved). No log string, error message, refusal condition, or
|
|
9
|
+
* result shape changed — only physical location + `this.` → `self.`.
|
|
10
|
+
*
|
|
11
|
+
* The group is self-contained: it reads only `self.aggregateMeshStatusCache` and
|
|
12
|
+
* imported mesh-node-identity / mesh-work-queue helpers. It does NOT touch the
|
|
13
|
+
* inline-mesh cache cluster, so the move is a pure lift.
|
|
14
|
+
*/
|
|
15
|
+
import type { DaemonCommandRouter } from './router.js';
|
|
16
|
+
export declare function cloneJsonValue<T>(value: T): T;
|
|
17
|
+
export declare function hydrateCachedAggregateMeshStatusFromInline(self: DaemonCommandRouter, snapshot: any, mesh: any, options?: {
|
|
18
|
+
requireDirectPeerTruth?: boolean;
|
|
19
|
+
}): any;
|
|
20
|
+
export declare function getCachedAggregateMeshStatus(self: DaemonCommandRouter, meshId: string, mesh?: any, options?: {
|
|
21
|
+
requireDirectPeerTruth?: boolean;
|
|
22
|
+
allowStalePending?: boolean;
|
|
23
|
+
}): any | null;
|
|
24
|
+
export declare function rememberAggregateMeshStatus(self: DaemonCommandRouter, meshId: string, snapshot: any, refreshReason: string): any;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remote mesh-session owner resolution — extracted from router.ts (behavior-preserving code move).
|
|
3
|
+
*
|
|
4
|
+
* These functions were `DaemonCommandRouter` methods; they now take the router
|
|
5
|
+
* instance as `self`. resolveRemoteMeshSessionOwnerDaemonId stays reachable as a
|
|
6
|
+
* public method (the [Z] session-scoped forward in executeDaemonCommand and the
|
|
7
|
+
* mesh-session-scoped-remote-forward test call it), so the class keeps a thin
|
|
8
|
+
* delegating wrapper. No log string, error message, refusal condition, or result
|
|
9
|
+
* shape changed — only physical location + `this.` → `self.`.
|
|
10
|
+
*
|
|
11
|
+
* The group is read-only: it reads self.deps.statusInstanceId, the cached inline-mesh
|
|
12
|
+
* nodes, and the aggregate-status snapshot nodes. It never mutates router state.
|
|
13
|
+
*/
|
|
14
|
+
import type { DaemonCommandRouter } from './router.js';
|
|
15
|
+
/**
|
|
16
|
+
* Resolve the REMOTE worker daemonId that owns a given session, when the session
|
|
17
|
+
* belongs to a mesh node hosted on a DIFFERENT daemon than this coordinator.
|
|
18
|
+
*
|
|
19
|
+
* The coordinator does not host remote-worker session instances in its own
|
|
20
|
+
* instanceManager/sessionRegistry — only their cached mesh-node metadata. A
|
|
21
|
+
* dashboard-issued session-scoped command (invoke_provider_script / resolve_action /
|
|
22
|
+
* set_mode / …) lands on the coordinator with a targetSessionId the coordinator can't
|
|
23
|
+
* find locally, and without forwarding it dies as "Live session not found". send_chat
|
|
24
|
+
* happens to survive (its target resolves to the worker by another route), but the
|
|
25
|
+
* controlbar commands do not — so the controlbar buttons appear to do nothing.
|
|
26
|
+
*
|
|
27
|
+
* Mirror the existing node-level remote-forward pattern (fast_forward_mesh_node etc.):
|
|
28
|
+
* scan the candidate mesh nodes for the one hosting the targetSessionId, and return its
|
|
29
|
+
* daemonId when that daemonId is a remote daemon (i.e. not this coordinator's own
|
|
30
|
+
* statusInstanceId). Returns undefined for a locally-hosted session (no forward — execute
|
|
31
|
+
* locally as before) or when ownership can't be resolved.
|
|
32
|
+
*
|
|
33
|
+
* The candidate set spans BOTH the cached inline-mesh nodes and the live aggregate
|
|
34
|
+
* mesh-status snapshots. The inline cache reliably carries only each node's single primary
|
|
35
|
+
* session (cachedStatus.activeSession), so a worker hosting more than one session exposes its
|
|
36
|
+
* non-primary sessions only on the aggregate snapshot nodes (status.activeSessions /
|
|
37
|
+
* activeSessionDetails, built from live session records). collectMeshNodeHostedSessionIds does
|
|
38
|
+
* the wider plural-shape scan so a controlbar/modal command targeting a non-primary remote
|
|
39
|
+
* session still resolves its owner — the singular readCachedInlineMeshActiveSessions semantics
|
|
40
|
+
* other consumers depend on stay untouched.
|
|
41
|
+
*
|
|
42
|
+
* CANCEL-STOP-RELAY: the session-id cache scan above only matches when the coordinator's
|
|
43
|
+
* cached status snapshot already lists the worker's session id in a recognized active-sessions
|
|
44
|
+
* shape. A worktree-clone worker session whose id form/timing differs from the cached snapshot
|
|
45
|
+
* (or is simply not yet reflected) misses the scan, so a stop that carries the authoritative
|
|
46
|
+
* owning nodeId (mesh_queue_cancel knows assignedNodeId) used to silently fail to forward.
|
|
47
|
+
* `ownerNodeIdHint` adds a deterministic fallback: when the session-id scan misses, resolve the
|
|
48
|
+
* owner daemonId by matching the node by id (meshNodeIdMatches — same form-tolerant compare the
|
|
49
|
+
* rest of the router uses, no new raw compare). The same self-loopback guard applies to both
|
|
50
|
+
* paths, so a coordinator-hosted node is still never force-forwarded to a remote form of itself.
|
|
51
|
+
*/
|
|
52
|
+
export declare function resolveRemoteMeshSessionOwnerDaemonId(self: DaemonCommandRouter, sessionId: string, ownerNodeIdHint?: string): string | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Candidate nodes for remote-session owner resolution: the cached inline-mesh nodes (which
|
|
55
|
+
* carry each node's primary session) plus the nodes from every cached aggregate mesh-status
|
|
56
|
+
* snapshot (which carry each node's full live session list). getCachedInlineMeshNodes()
|
|
57
|
+
* returns a fresh array, so appending the aggregate nodes never mutates cached state.
|
|
58
|
+
*/
|
|
59
|
+
export declare function collectMeshSessionOwnerCandidateNodes(self: DaemonCommandRouter): any[];
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import type { DaemonCommandRouter, CommandRouterResult } from './router.js';
|
|
2
|
+
import { MeshRefineAsyncJobStatus, MeshRefineBatchJobHandle, MeshRefineBatchJobStatus, MeshRefineJobHandle, RefineContext, RefineStageOutcome } from '../mesh/mesh-refine-gates.js';
|
|
3
|
+
export declare function buildRefineJobKey(self: DaemonCommandRouter, meshId: string, nodeId: string): string;
|
|
4
|
+
export declare function buildRefineJobHandle(self: DaemonCommandRouter, args: {
|
|
5
|
+
meshId: string;
|
|
6
|
+
nodeId: string;
|
|
7
|
+
node?: any;
|
|
8
|
+
status?: MeshRefineAsyncJobStatus;
|
|
9
|
+
startedAt?: string;
|
|
10
|
+
completedAt?: string;
|
|
11
|
+
jobId?: string;
|
|
12
|
+
interactionId?: string;
|
|
13
|
+
retryOfJobId?: string;
|
|
14
|
+
coordinatorDaemonId?: string;
|
|
15
|
+
}): MeshRefineJobHandle;
|
|
16
|
+
/**
|
|
17
|
+
* Slim the terminal-stage refine result down to the fields a coordinator needs to
|
|
18
|
+
* decide next-step, dropping the heavy per-command / per-entry detail.
|
|
19
|
+
*
|
|
20
|
+
* The full `CommandRouterResult` (with `validationSummary.commandsRun[]` carrying
|
|
21
|
+
* per-command stdout/stderr, `rejectedCommands`, `suggestions`, `suggestedConfig`,
|
|
22
|
+
* the full `patchEquivalence`, and `submoduleReachability.entries[]`/`.unreachable[]`)
|
|
23
|
+
* routinely exceeds 70KB and overflows the coordinator token limit when it rides on a
|
|
24
|
+
* `mesh_wait_events` payload. The full detail is still persisted verbatim to the ledger
|
|
25
|
+
* (`appendRefineJobLedger`) and `terminalRefineJobs`, so slimming only the EVENT loses
|
|
26
|
+
* nothing — the coordinator can pull the full record on demand via
|
|
27
|
+
* `evidence.ledgerCommand` / `taskHistoryKind`.
|
|
28
|
+
*/
|
|
29
|
+
export declare function slimRefineEventResult(result: Record<string, unknown>): Record<string, unknown>;
|
|
30
|
+
export declare function queueRefineJobEvent(self: DaemonCommandRouter, event: 'refine:accepted' | 'refine:completed' | 'refine:failed', handle: MeshRefineJobHandle, result?: Record<string, unknown>): void;
|
|
31
|
+
export declare function appendRefineJobLedger(self: DaemonCommandRouter, kind: 'task_dispatched' | 'task_completed' | 'task_failed', handle: MeshRefineJobHandle, result?: Record<string, unknown>): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* On daemon restart, scan all mesh ledgers for refine jobs that were dispatched
|
|
34
|
+
* but never completed/failed (i.e. the daemon died mid-job). Re-queue each one
|
|
35
|
+
* so the job runs to completion automatically without coordinator intervention.
|
|
36
|
+
*/
|
|
37
|
+
export declare function resumePendingRefineJobsOnStartup(self: DaemonCommandRouter): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Synchronous refinery for a single worktree node — the gate pipeline that
|
|
40
|
+
* validates, preflights (patch-equivalence / submodule-reachability /
|
|
41
|
+
* no-op), merges, aligns submodules, cleans up the worktree node and
|
|
42
|
+
* (optionally) pushes. The body is a flat sequence of stage methods; each
|
|
43
|
+
* stage either returns a terminal CommandRouterResult (gate failure or a
|
|
44
|
+
* successful already-merged short-circuit) or `continue` with the extended
|
|
45
|
+
* context. Behavior — stage order, every early-exit, and every result shape —
|
|
46
|
+
* is identical to the previous single inlined body.
|
|
47
|
+
*/
|
|
48
|
+
export declare function executeMeshRefineNodeSynchronously(self: DaemonCommandRouter, meshId: string, nodeId: string, args: any): Promise<CommandRouterResult>;
|
|
49
|
+
/**
|
|
50
|
+
* resolve_refs stage: resolve the mesh / worktree node / source node /
|
|
51
|
+
* repoRoot, then the worktree branch, base branch, fetched base head and
|
|
52
|
+
* branch head. Seeds the RefineContext consumed by every later stage.
|
|
53
|
+
*/
|
|
54
|
+
export declare function refineResolveRefsStage(self: DaemonCommandRouter, meshId: string, nodeId: string, args: any, refineStages: Array<Record<string, unknown>>): Promise<RefineStageOutcome>;
|
|
55
|
+
/**
|
|
56
|
+
* validation stage: run the refinery validation gate (typecheck / test /
|
|
57
|
+
* lint / build per node config) and block on failure or when no allowlisted
|
|
58
|
+
* command was available. On pass, stores the summary on the context.
|
|
59
|
+
*/
|
|
60
|
+
export declare function refineValidationStage(self: DaemonCommandRouter, ctx: RefineContext): Promise<RefineStageOutcome>;
|
|
61
|
+
/**
|
|
62
|
+
* patch_equivalence stage: preflight that the worktree branch's cumulative
|
|
63
|
+
* patch is equivalent to base+branch. On a "behind base" branch, auto-rebase
|
|
64
|
+
* once and re-check; on an empty merge-tree with real branch changes, treat as
|
|
65
|
+
* already-merged-via-another-path and short-circuit to cleanup. Mutates the
|
|
66
|
+
* context's branchHead (after rebase) and patchEquivalence (rebased gate).
|
|
67
|
+
*/
|
|
68
|
+
export declare function refinePatchEquivalenceStage(self: DaemonCommandRouter, ctx: RefineContext): Promise<RefineStageOutcome>;
|
|
69
|
+
/**
|
|
70
|
+
* submodule_reachability stage: verify every submodule gitlink commit that
|
|
71
|
+
* would land via the merge is reachable from its configured remote main
|
|
72
|
+
* branch (optionally auto-publishing when policy allows). Blocks the merge
|
|
73
|
+
* when any commit is unreachable. Stores the result on the context.
|
|
74
|
+
*/
|
|
75
|
+
export declare function refineSubmoduleReachabilityStage(self: DaemonCommandRouter, ctx: RefineContext): Promise<RefineStageOutcome>;
|
|
76
|
+
/**
|
|
77
|
+
* effective_diff stage (no-op guard): block a silent no-op merge where the
|
|
78
|
+
* branch produces no effective root-tree diff against base — typically a
|
|
79
|
+
* submodule that has commits but whose root-level gitlink (pointer) bump was
|
|
80
|
+
* never committed, so the merge would land nothing real on main.
|
|
81
|
+
*/
|
|
82
|
+
export declare function refineEffectiveDiffStage(self: DaemonCommandRouter, ctx: RefineContext): Promise<RefineStageOutcome>;
|
|
83
|
+
/**
|
|
84
|
+
* merge + finalize stage: perform the --no-ff merge, align submodule
|
|
85
|
+
* checkouts after merge, clean up (remove) the worktree node per policy,
|
|
86
|
+
* append the refinery ledger entry, and (unless approval is required) push the
|
|
87
|
+
* base branch. Always terminal — produces the final CommandRouterResult.
|
|
88
|
+
*/
|
|
89
|
+
export declare function refineMergeAndFinalizeStage(self: DaemonCommandRouter, ctx: RefineContext): Promise<RefineStageOutcome>;
|
|
90
|
+
/**
|
|
91
|
+
* Batch refinery: converge multiple sibling worktree nodes onto the base branch
|
|
92
|
+
* in one sequential pipeline, absorbing the rebase + patch-equivalence churn that
|
|
93
|
+
* arises when several siblings touch the same submodule.
|
|
94
|
+
*
|
|
95
|
+
* Reuses executeMeshRefineNodeSynchronously per node — every node goes through the
|
|
96
|
+
* exact same validation / patch-equivalence / submodule-reachability / merge / cleanup
|
|
97
|
+
* gates, including its built-in auto-rebase onto fresh origin/<base>. Because each
|
|
98
|
+
* node fetches origin/<base> at the start of its own refine, a node merged earlier in
|
|
99
|
+
* the batch advances the base, and the next node's refine auto-rebases onto it before
|
|
100
|
+
* re-running patch-equivalence. No force-push, no reset — conflicting nodes are
|
|
101
|
+
* isolated as blocked_review while the rest of the batch proceeds.
|
|
102
|
+
*/
|
|
103
|
+
export declare function batchRefineMeshNodes(self: DaemonCommandRouter, meshId: string, requestedNodeIds: string[] | undefined, args: any): Promise<CommandRouterResult>;
|
|
104
|
+
/**
|
|
105
|
+
* Convergence core shared by the synchronous batch entry and the async batch job.
|
|
106
|
+
* Refines each node in order: the per-node refine pipeline fetches origin/<base>
|
|
107
|
+
* fresh, so each merged sibling advances the base before the next node's auto-rebase
|
|
108
|
+
* + patch-equivalence re-check. A blocked/failed node is isolated; the batch
|
|
109
|
+
* continues with the remaining nodes. Does NOT touch the per-node merge logic — it
|
|
110
|
+
* only sequences calls to executeMeshRefineNodeSynchronously and aggregates outcomes.
|
|
111
|
+
*/
|
|
112
|
+
export declare function runMeshRefineBatchConvergence(self: DaemonCommandRouter, meshId: string, orderedNodes: any[], ordering: {
|
|
113
|
+
order: string[];
|
|
114
|
+
rationale?: unknown;
|
|
115
|
+
}, args: any): Promise<CommandRouterResult>;
|
|
116
|
+
export declare function buildRefineBatchJobKey(self: DaemonCommandRouter, meshId: string): string;
|
|
117
|
+
export declare function buildRefineBatchJobHandle(self: DaemonCommandRouter, args: {
|
|
118
|
+
meshId: string;
|
|
119
|
+
nodeIds: string[];
|
|
120
|
+
order: string[];
|
|
121
|
+
status?: MeshRefineBatchJobStatus;
|
|
122
|
+
startedAt?: string;
|
|
123
|
+
completedAt?: string;
|
|
124
|
+
jobId?: string;
|
|
125
|
+
interactionId?: string;
|
|
126
|
+
coordinatorDaemonId?: string;
|
|
127
|
+
}): MeshRefineBatchJobHandle;
|
|
128
|
+
/**
|
|
129
|
+
* Emit a batch Refinery terminal/accepted event through the SAME pending-event +
|
|
130
|
+
* forward mechanism single-node refine uses (queueRefineJobEvent), so the
|
|
131
|
+
* coordinator's existing refine:accepted/completed/failed handling and message
|
|
132
|
+
* renderer apply unchanged. The aggregate per-node results ride along in `result`.
|
|
133
|
+
*/
|
|
134
|
+
export declare function queueRefineBatchJobEvent(self: DaemonCommandRouter, event: 'refine:accepted' | 'refine:completed' | 'refine:failed', handle: MeshRefineBatchJobHandle, result?: Record<string, unknown>): void;
|
|
135
|
+
export declare function appendRefineBatchJobLedger(self: DaemonCommandRouter, kind: 'task_dispatched' | 'task_completed' | 'task_failed', handle: MeshRefineBatchJobHandle, result?: Record<string, unknown>): Promise<void>;
|
|
136
|
+
export declare function finishMeshRefineBatchJob(self: DaemonCommandRouter, handle: MeshRefineBatchJobHandle, orderedNodes: any[], ordering: {
|
|
137
|
+
order: string[];
|
|
138
|
+
rationale?: unknown;
|
|
139
|
+
}, args: any): Promise<void>;
|
|
140
|
+
/**
|
|
141
|
+
* Async entry for the batch Refinery execute path. Mirrors startMeshRefineJob:
|
|
142
|
+
* resolves the plan synchronously (so target/ordering errors and the dry-run shape
|
|
143
|
+
* stay synchronous), then for execute=true registers an in-flight batch job, returns
|
|
144
|
+
* {async:true, status:'accepted', batch:true, ...plan} immediately, and runs the
|
|
145
|
+
* convergence loop in the background — emitting the same terminal refine event.
|
|
146
|
+
* Idempotent: a batch already in flight for this mesh returns the running handle
|
|
147
|
+
* with duplicate:true rather than spawning a second background job.
|
|
148
|
+
*/
|
|
149
|
+
export declare function startMeshRefineBatchJob(self: DaemonCommandRouter, meshId: string, requestedNodeIds: string[] | undefined, args: any): Promise<CommandRouterResult>;
|
|
150
|
+
export declare function finishMeshRefineJob(self: DaemonCommandRouter, handle: MeshRefineJobHandle, args: any): Promise<void>;
|
|
151
|
+
export declare function startMeshRefineJob(self: DaemonCommandRouter, meshId: string, nodeId: string, args: any): Promise<CommandRouterResult>;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import type { DaemonCommandRouter } from './router.js';
|
|
2
|
+
import type { RepoMeshSessionCleanupMode } from '../repo-mesh-types.js';
|
|
3
|
+
export declare function sessionMatchesMeshNode(self: DaemonCommandRouter, record: any, node: any, nodeId: string, sessionIds?: Set<string>): boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Best-effort recursive removal of a managed worktree directory.
|
|
6
|
+
*
|
|
7
|
+
* The git-registry de-registration is the safety-critical step of worktree
|
|
8
|
+
* teardown; a leftover directory must never gate dropping the node from the
|
|
9
|
+
* mesh. On Windows, `fs.rmSync` can throw EINVAL/EPERM/EBUSY on submodule
|
|
10
|
+
* gitlink (`.git`) files, long paths, junctions, or while a just-stopped
|
|
11
|
+
* delegate session is still releasing a handle/cwd on the directory. This
|
|
12
|
+
* helper absorbs those errors (never throws), with bounded retries + backoff
|
|
13
|
+
* to give handles time to release, and reports whether residue remains.
|
|
14
|
+
*/
|
|
15
|
+
export declare function bestEffortRemoveWorktreeDir(self: DaemonCommandRouter, dir: string): Promise<{
|
|
16
|
+
removed: boolean;
|
|
17
|
+
residue: boolean;
|
|
18
|
+
error?: string;
|
|
19
|
+
}>;
|
|
20
|
+
/**
|
|
21
|
+
* Non-destructive precheck mirroring every REFUSAL condition in
|
|
22
|
+
* {@link cleanupLocalWorktreeNode} — missing workspace / source-repo / branch
|
|
23
|
+
* metadata, unexpected (non-managed) path, branch mismatch — PLUS the
|
|
24
|
+
* dirty-worktree guard that `removeWorktree(requireClean)` enforces
|
|
25
|
+
* (`git status --porcelain`). It performs ZERO destructive actions: no
|
|
26
|
+
* `git worktree remove`, no `git worktree prune`, no directory deletion.
|
|
27
|
+
*
|
|
28
|
+
* remove_mesh_node calls this BEFORE any session cleanup so that a refusal
|
|
29
|
+
* (the common one being a dirty worktree) does not first stop/delete the
|
|
30
|
+
* delegated session and orphan it — the original ordering bug. Success/skip
|
|
31
|
+
* cases that the real cleanup handles idempotently (worktree path already
|
|
32
|
+
* gone, git-de-registered residue) are NOT refusals and return `{ ok: true }`.
|
|
33
|
+
*
|
|
34
|
+
* `force:true` skips the dirty guard, preserving `removeWorktree`'s
|
|
35
|
+
* `requireClean: !force` semantics. This is a read-only superset check; the
|
|
36
|
+
* authoritative `requireClean` guard inside `removeWorktree` is intentionally
|
|
37
|
+
* kept as a second line of defense against a precheck→execute race.
|
|
38
|
+
*/
|
|
39
|
+
export declare function precheckLocalWorktreeRemovable(self: DaemonCommandRouter, args: {
|
|
40
|
+
mesh: any;
|
|
41
|
+
node: any;
|
|
42
|
+
nodeId: string;
|
|
43
|
+
force?: boolean;
|
|
44
|
+
}): Promise<{
|
|
45
|
+
ok: true;
|
|
46
|
+
} | {
|
|
47
|
+
ok: false;
|
|
48
|
+
code: string;
|
|
49
|
+
error: string;
|
|
50
|
+
recoveryHint: string;
|
|
51
|
+
}>;
|
|
52
|
+
export declare function cleanupLocalWorktreeNode(self: DaemonCommandRouter, args: {
|
|
53
|
+
mesh: any;
|
|
54
|
+
node: any;
|
|
55
|
+
nodeId: string;
|
|
56
|
+
force?: boolean;
|
|
57
|
+
}): Promise<{
|
|
58
|
+
success: true;
|
|
59
|
+
skipped?: boolean;
|
|
60
|
+
removedPath?: string;
|
|
61
|
+
repoRoot?: string;
|
|
62
|
+
reason?: string;
|
|
63
|
+
fallback?: string;
|
|
64
|
+
forced?: boolean;
|
|
65
|
+
convergence?: Record<string, unknown>;
|
|
66
|
+
recovered?: boolean;
|
|
67
|
+
residue?: boolean;
|
|
68
|
+
residueWarning?: string;
|
|
69
|
+
residueError?: string;
|
|
70
|
+
branchRefDeleted?: boolean;
|
|
71
|
+
branchRefReason?: string;
|
|
72
|
+
branchRefForced?: boolean;
|
|
73
|
+
branchRefWarning?: string;
|
|
74
|
+
} | {
|
|
75
|
+
success: false;
|
|
76
|
+
code: string;
|
|
77
|
+
error: string;
|
|
78
|
+
recoveryHint: string;
|
|
79
|
+
convergence?: Record<string, unknown>;
|
|
80
|
+
}>;
|
|
81
|
+
export declare function getWorktreeForceCleanupConvergence(self: DaemonCommandRouter, args: {
|
|
82
|
+
repoRoot: string;
|
|
83
|
+
workspace: string;
|
|
84
|
+
node: any;
|
|
85
|
+
}): Promise<{
|
|
86
|
+
allow: boolean;
|
|
87
|
+
status?: string;
|
|
88
|
+
source?: string;
|
|
89
|
+
ref?: string;
|
|
90
|
+
error?: string;
|
|
91
|
+
}>;
|
|
92
|
+
export declare function isCompletedHostedSession(self: DaemonCommandRouter, record: any): boolean;
|
|
93
|
+
export declare function recordIntentionalMeshSessionStop(self: DaemonCommandRouter, args: {
|
|
94
|
+
meshId: string;
|
|
95
|
+
nodeId: string;
|
|
96
|
+
node: any;
|
|
97
|
+
sessionId: string;
|
|
98
|
+
mode: RepoMeshSessionCleanupMode;
|
|
99
|
+
source: 'mesh_cleanup_sessions' | 'mesh_remove_node' | 'magi_session_cleanup';
|
|
100
|
+
action: 'stop_session' | 'delete_session_force';
|
|
101
|
+
}): Promise<void>;
|
|
102
|
+
export declare function cleanupMeshSessions(self: DaemonCommandRouter, args: {
|
|
103
|
+
meshId: string;
|
|
104
|
+
nodeId: string;
|
|
105
|
+
node: any;
|
|
106
|
+
mode: RepoMeshSessionCleanupMode;
|
|
107
|
+
sessionIds?: string[];
|
|
108
|
+
dryRun?: boolean;
|
|
109
|
+
source?: 'mesh_cleanup_sessions' | 'mesh_remove_node' | 'magi_session_cleanup';
|
|
110
|
+
/**
|
|
111
|
+
* MAGI auto-cleanup safety gate: a map of sessionId → the queue task id that
|
|
112
|
+
* session must have been AUTO-LAUNCHED for (record meta autoLaunchedForQueueTaskId).
|
|
113
|
+
* When set, a matched explicit session is only acted on if its record carries that
|
|
114
|
+
* exact marker. A reused idle session (no marker), the coordinator session, a
|
|
115
|
+
* re-assigned session, or any session whose marker points at a DIFFERENT task is
|
|
116
|
+
* skipped (reason 'auto_launch_marker_mismatch') — so MAGI never kills a session it
|
|
117
|
+
* didn't itself spawn for this fan-out. Only consulted alongside explicit sessionIds.
|
|
118
|
+
*/
|
|
119
|
+
requireAutoLaunchedForTaskIds?: Record<string, string>;
|
|
120
|
+
/**
|
|
121
|
+
* Opt-in orphan reclaim (default false). See SESSION-ACCUMULATION-LEAK.
|
|
122
|
+
* When true, a workspace-only live_runtime session (no node binding) OR a
|
|
123
|
+
* live_runtime session bound to a node absent from `liveMeshNodeIds` is
|
|
124
|
+
* stopped instead of skipped by the conservative shared-daemon guard. A
|
|
125
|
+
* session whose meshNodeId is STILL in `liveMeshNodeIds` (active sibling)
|
|
126
|
+
* is never reclaimed — that is the shared-daemon safety this preserves.
|
|
127
|
+
*/
|
|
128
|
+
reclaimOrphans?: boolean;
|
|
129
|
+
liveMeshNodeIds?: string[];
|
|
130
|
+
}): Promise<{
|
|
131
|
+
success: boolean;
|
|
132
|
+
[key: string]: unknown;
|
|
133
|
+
}>;
|