@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
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { type MeshRefineValidationCommandPlan, type RepoMeshRefineValidationCommandConfig } from './refine-config.js';
|
|
2
|
+
import type { MeshAsyncJobLifecycle } from '../repo-mesh-types.js';
|
|
3
|
+
export type WorktreeBootstrapStatus = 'ready' | 'complete' | 'running' | 'failed' | 'not_configured' | 'disabled' | 'stale';
|
|
4
|
+
export interface RepoMeshWorktreeBootstrapConfig {
|
|
5
|
+
version: 1;
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
runOnClone?: boolean;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
commands?: RepoMeshRefineValidationCommandConfig[];
|
|
10
|
+
staleInputs?: string[];
|
|
11
|
+
}
|
|
12
|
+
export interface WorktreeBootstrapState extends MeshAsyncJobLifecycle {
|
|
13
|
+
status: WorktreeBootstrapStatus;
|
|
14
|
+
required: boolean;
|
|
15
|
+
configSource?: string;
|
|
16
|
+
configSourceType?: 'repo_file' | 'mesh_policy' | 'unavailable' | 'invalid';
|
|
17
|
+
lastCommand?: string;
|
|
18
|
+
exitCode?: number | null;
|
|
19
|
+
commandsRun?: Array<Record<string, unknown>>;
|
|
20
|
+
staleInputs?: string[];
|
|
21
|
+
/**
|
|
22
|
+
* M2-1: sha256 per staleInputs path recorded when the bootstrap reached
|
|
23
|
+
* 'ready'. evaluateWorktreeBootstrapState compares current file hashes
|
|
24
|
+
* against this to detect staleness (e.g. base merge changed a lockfile).
|
|
25
|
+
* Missing files hash to the literal 'absent'.
|
|
26
|
+
*/
|
|
27
|
+
staleInputsDigest?: Record<string, string>;
|
|
28
|
+
/** M2-1: why an evaluated state resolved to stale (digest_mismatch | never_ran). */
|
|
29
|
+
staleReason?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare const WORKTREE_BOOTSTRAP_STALE_RUNNING_MS: number;
|
|
32
|
+
/**
|
|
33
|
+
* Enumerate registered submodule paths for a worktree, generically (no hardcoded
|
|
34
|
+
* 'oss'/'adhdev-providers'). Reads `.gitmodules` via `git config --file .gitmodules
|
|
35
|
+
* --get-regexp path`, whose lines are `submodule.<name>.path <relativePath>`. Paths
|
|
36
|
+
* are returned normalized to forward slashes (git porcelain always emits '/'),
|
|
37
|
+
* trailing slash stripped. Returns an empty set when there are no submodules or the
|
|
38
|
+
* lookup fails — callers must then treat any change as dirty (conservative).
|
|
39
|
+
*/
|
|
40
|
+
export declare function getRegisteredSubmodulePaths(workspace: string): Set<string>;
|
|
41
|
+
/**
|
|
42
|
+
* Read each registered submodule's configured `branch` from `.gitmodules`, keyed
|
|
43
|
+
* by the submodule's normalized path (matching {@link getRegisteredSubmodulePaths}).
|
|
44
|
+
*
|
|
45
|
+
* `.gitmodules` stores `submodule.<name>.path` and (optionally)
|
|
46
|
+
* `submodule.<name>.branch`; this joins the two on `<name>`. The special branch
|
|
47
|
+
* value `.` ("track the superproject's branch") is deliberately OMITTED so callers
|
|
48
|
+
* fall through to remote-HEAD detection instead of treating `.` as a literal branch
|
|
49
|
+
* name. Returns an empty map when there are no submodules, no `.gitmodules`, or the
|
|
50
|
+
* lookup fails (conservative — callers then detect or fall back).
|
|
51
|
+
*/
|
|
52
|
+
export declare function getSubmoduleConfiguredBranches(workspace: string): Map<string, string>;
|
|
53
|
+
/** Fallback submodule branch when no configured/detected default can be resolved. */
|
|
54
|
+
export declare const SUBMODULE_DEFAULT_BRANCH_FALLBACK = "main";
|
|
55
|
+
/**
|
|
56
|
+
* Resolve the default branch a submodule's commits are published to / checked for
|
|
57
|
+
* reachability against. Generalizes the previously hardcoded `main` so a submodule
|
|
58
|
+
* whose default branch is `master`/`trunk`/etc. is handled. Priority (each tier
|
|
59
|
+
* falls through to the next on miss/error):
|
|
60
|
+
*
|
|
61
|
+
* 1. `.gitmodules` `submodule.<name>.branch` (via {@link getSubmoduleConfiguredBranches};
|
|
62
|
+
* `.` is ignored) — an explicit, local, zero-cost declaration.
|
|
63
|
+
* 2. the submodule checkout's LOCAL remote HEAD: `git symbolic-ref --short
|
|
64
|
+
* refs/remotes/<remote>/HEAD` → strip the `<remote>/` prefix (no network).
|
|
65
|
+
* 3. the submodule remote's advertised HEAD: `git ls-remote --symref <remote> HEAD`
|
|
66
|
+
* → `ref: refs/heads/<branch>` (one network round-trip).
|
|
67
|
+
* 4. fallback {@link SUBMODULE_DEFAULT_BRANCH_FALLBACK} (`'main'`).
|
|
68
|
+
*
|
|
69
|
+
* Because the final fallback is `'main'` and every earlier tier that resolves `'main'`
|
|
70
|
+
* yields the same string, a repo whose submodules default to `main` (the common case)
|
|
71
|
+
* produces byte-identical downstream fetch/merge-base/push ref targets — only a
|
|
72
|
+
* read-only resolution probe is added.
|
|
73
|
+
*/
|
|
74
|
+
export declare function resolveSubmoduleDefaultBranch(opts: {
|
|
75
|
+
/** The submodule's local checkout — cwd for symbolic-ref / ls-remote. */
|
|
76
|
+
submoduleRepoPath: string;
|
|
77
|
+
/** The superproject workspace — for the `.gitmodules` branch lookup (tier 1). */
|
|
78
|
+
superprojectWorkspace?: string;
|
|
79
|
+
/** The submodule's path relative to the superproject (key into `.gitmodules`). */
|
|
80
|
+
submodulePath?: string;
|
|
81
|
+
/** Remote name (default `origin`). */
|
|
82
|
+
remote?: string;
|
|
83
|
+
/** Timeout for the local probe (tier 2); the network probe (tier 3) gets max(this, 30s). */
|
|
84
|
+
timeoutMs?: number;
|
|
85
|
+
}): Promise<string>;
|
|
86
|
+
export declare function isWorktreeBootstrapStaleRunning(node: {
|
|
87
|
+
worktreeBootstrap?: {
|
|
88
|
+
status?: string;
|
|
89
|
+
startedAt?: string;
|
|
90
|
+
updatedAt?: string;
|
|
91
|
+
completedAt?: string;
|
|
92
|
+
};
|
|
93
|
+
workspace?: string;
|
|
94
|
+
} | undefined, nowMs?: number): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* COMPLETION-PROPAGATION F7 (C2): the single shared consume-ready / bootstrap-pending defer
|
|
97
|
+
* predicate. A task must NOT be injected into a worktree node whose bootstrap is still 'running'
|
|
98
|
+
* — the provider is not yet ready to consume input, so the inject lands in the input buffer and
|
|
99
|
+
* is silently swallowed (empty session). Both the remote dispatch guard (the router agent_command
|
|
100
|
+
* handler) and the local queue-claim gate (tryAssignQueueTask) route through THIS predicate so
|
|
101
|
+
* they agree on exactly when to defer. Returns true = defer. The stale-'running' backstop
|
|
102
|
+
* (isWorktreeBootstrapStaleRunning) is honored here too: a 'running' state far older than any real
|
|
103
|
+
* bootstrap whose worktree is git-clean is treated as silently complete (do NOT defer), so a node
|
|
104
|
+
* whose terminal stamp never reached this daemon is not stranded forever.
|
|
105
|
+
*/
|
|
106
|
+
export declare function shouldDeferDispatchForBootstrap(node: {
|
|
107
|
+
worktreeBootstrap?: {
|
|
108
|
+
status?: string;
|
|
109
|
+
startedAt?: string;
|
|
110
|
+
updatedAt?: string;
|
|
111
|
+
completedAt?: string;
|
|
112
|
+
};
|
|
113
|
+
workspace?: string;
|
|
114
|
+
} | undefined, nowMs?: number): boolean;
|
|
115
|
+
export interface WorktreeBootstrapConfigLoadResult {
|
|
116
|
+
config?: RepoMeshWorktreeBootstrapConfig;
|
|
117
|
+
source: string;
|
|
118
|
+
sourceType: 'repo_file' | 'mesh_policy' | 'unavailable' | 'invalid';
|
|
119
|
+
path?: string;
|
|
120
|
+
error?: string;
|
|
121
|
+
}
|
|
122
|
+
export declare const MESH_WORKTREE_BOOTSTRAP_CONFIG_LOCATIONS: string[];
|
|
123
|
+
export declare const MESH_WORKTREE_BOOTSTRAP_CONFIG_SCHEMA: {
|
|
124
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
125
|
+
readonly title: "ADHDev Repo Mesh Worktree Bootstrap Config";
|
|
126
|
+
readonly type: "object";
|
|
127
|
+
readonly additionalProperties: false;
|
|
128
|
+
readonly required: readonly ["version"];
|
|
129
|
+
readonly properties: {
|
|
130
|
+
readonly version: {
|
|
131
|
+
readonly const: 1;
|
|
132
|
+
};
|
|
133
|
+
readonly enabled: {
|
|
134
|
+
readonly type: "boolean";
|
|
135
|
+
readonly default: true;
|
|
136
|
+
};
|
|
137
|
+
readonly runOnClone: {
|
|
138
|
+
readonly type: "boolean";
|
|
139
|
+
readonly default: true;
|
|
140
|
+
};
|
|
141
|
+
readonly required: {
|
|
142
|
+
readonly type: "boolean";
|
|
143
|
+
readonly default: true;
|
|
144
|
+
};
|
|
145
|
+
readonly staleInputs: {
|
|
146
|
+
readonly type: "array";
|
|
147
|
+
readonly maxItems: 16;
|
|
148
|
+
readonly items: {
|
|
149
|
+
readonly type: "string";
|
|
150
|
+
readonly minLength: 1;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
readonly commands: {
|
|
154
|
+
readonly type: "array";
|
|
155
|
+
readonly minItems: 1;
|
|
156
|
+
readonly maxItems: 4;
|
|
157
|
+
readonly items: {
|
|
158
|
+
readonly type: "object";
|
|
159
|
+
readonly additionalProperties: false;
|
|
160
|
+
readonly required: readonly ["command"];
|
|
161
|
+
readonly properties: {
|
|
162
|
+
readonly command: {
|
|
163
|
+
readonly type: "string";
|
|
164
|
+
readonly minLength: 1;
|
|
165
|
+
};
|
|
166
|
+
readonly args: {
|
|
167
|
+
readonly type: "array";
|
|
168
|
+
readonly items: {
|
|
169
|
+
readonly type: "string";
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
readonly category: {
|
|
173
|
+
readonly enum: readonly ["typecheck", "test", "lint", "build", "custom"];
|
|
174
|
+
};
|
|
175
|
+
readonly cwd: {
|
|
176
|
+
readonly type: "string";
|
|
177
|
+
};
|
|
178
|
+
readonly timeoutMs: {
|
|
179
|
+
readonly type: "number";
|
|
180
|
+
readonly minimum: 1000;
|
|
181
|
+
readonly maximum: 600000;
|
|
182
|
+
};
|
|
183
|
+
readonly outputLimitBytes: {
|
|
184
|
+
readonly type: "number";
|
|
185
|
+
readonly minimum: 1024;
|
|
186
|
+
readonly maximum: 1048576;
|
|
187
|
+
};
|
|
188
|
+
readonly env: {
|
|
189
|
+
readonly type: "object";
|
|
190
|
+
readonly additionalProperties: {
|
|
191
|
+
readonly type: "string";
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
export declare function validateMeshWorktreeBootstrapConfig(config: unknown, source?: string): {
|
|
200
|
+
valid: boolean;
|
|
201
|
+
errors: string[];
|
|
202
|
+
commands: MeshRefineValidationCommandPlan[];
|
|
203
|
+
rejectedCommands: Array<Record<string, unknown>>;
|
|
204
|
+
};
|
|
205
|
+
export declare function loadMeshWorktreeBootstrapConfig(mesh: any, workspace: string): WorktreeBootstrapConfigLoadResult;
|
|
206
|
+
/** M2-1: hash staleInputs files so 'ready' can be invalidated when they change. */
|
|
207
|
+
export declare function computeStaleInputsDigest(workspace: string, staleInputs: string[] | undefined): Record<string, string>;
|
|
208
|
+
/**
|
|
209
|
+
* M2-1: the official bootstrap state contract. Resolves the effective state
|
|
210
|
+
* for a node workspace from config presence + the persisted last-run state +
|
|
211
|
+
* a staleInputs digest comparison. Read-only — never runs commands.
|
|
212
|
+
*
|
|
213
|
+
* ready — last run succeeded and staleInputs are unchanged
|
|
214
|
+
* stale — never ran, or a staleInputs file changed since 'ready'
|
|
215
|
+
* running/failed — persisted lifecycle state passes through
|
|
216
|
+
* not_configured / disabled / (invalid → failed) — from config resolution
|
|
217
|
+
*/
|
|
218
|
+
export declare function evaluateWorktreeBootstrapState(mesh: any, workspace: string, persisted?: WorktreeBootstrapState | null): WorktreeBootstrapState;
|
|
219
|
+
export declare function runMeshWorktreeBootstrap(mesh: any, workspace: string): Promise<WorktreeBootstrapState>;
|
|
@@ -44,6 +44,8 @@ export declare class AcpProviderInstance implements ProviderInstance {
|
|
|
44
44
|
private partialBlocks;
|
|
45
45
|
/** Tool calls collected during current turn */
|
|
46
46
|
private turnToolCalls;
|
|
47
|
+
/** Guard: prevent concurrent sendPrompt calls from racing on shared state */
|
|
48
|
+
private _sendPromptInFlight;
|
|
47
49
|
private errorMessage;
|
|
48
50
|
private errorReason;
|
|
49
51
|
private stderrBuffer;
|
|
@@ -86,6 +88,9 @@ export declare class AcpProviderInstance implements ProviderInstance {
|
|
|
86
88
|
sendPrompt(text: string, contentBlocks?: ContentBlock[]): Promise<void>;
|
|
87
89
|
private cancelSession;
|
|
88
90
|
private permissionResolvers;
|
|
91
|
+
private readonly manualAttendance;
|
|
92
|
+
/** @see ProviderInstance.noteManualInteraction */
|
|
93
|
+
noteManualInteraction(now?: number): void;
|
|
89
94
|
resolvePermission(approved: boolean): Promise<void>;
|
|
90
95
|
private handleSessionUpdate;
|
|
91
96
|
/** Handle legacy session/update formats (pre-standardization compat) */
|
|
@@ -1,7 +1,53 @@
|
|
|
1
1
|
import type { ProviderModule } from './contracts.js';
|
|
2
|
+
export declare function normalizeApprovalLabel(value: string): string;
|
|
3
|
+
/**
|
|
4
|
+
* True when any of the given button labels reads as a decline/negative option
|
|
5
|
+
* (No / Deny / Cancel / Skip / …). Used as the second half of an approval-modal
|
|
6
|
+
* structural anchor: a real approval modal offers BOTH an affirmative and a
|
|
7
|
+
* decline, which distinguishes it from a generic numbered menu or prose list.
|
|
8
|
+
*/
|
|
9
|
+
export declare function hasNegativeApprovalOption(buttons: string[] | null | undefined): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* True when a button reliably identifies a tool-CONSENT modal on its own — a
|
|
12
|
+
* scoped permission-grant affirmative such as:
|
|
13
|
+
* - "Yes, allow all edits in tmp/ during this session"
|
|
14
|
+
* - "Yes, and don't ask again for example.com"
|
|
15
|
+
* - "Yes, allow reading from etc/ from this project"
|
|
16
|
+
* - "Always allow"
|
|
17
|
+
*
|
|
18
|
+
* These options only ever appear in a genuine approval/permission prompt; a
|
|
19
|
+
* /model or /mode picker ("1. Default 2. Opus 3. Sonnet") never offers a
|
|
20
|
+
* "grant this scope" choice. They therefore serve as a SECOND reliable
|
|
21
|
+
* structural anchor alongside {@link hasNegativeApprovalOption}.
|
|
22
|
+
*
|
|
23
|
+
* Why this exists (tall-diff fallback, #137): when a Write/Edit diff is tall,
|
|
24
|
+
* the trailing decline option ("3. No") can scroll off the bottom of the
|
|
25
|
+
* captured PTY frame, leaving only "1. Yes" + "2. Yes, allow … this session".
|
|
26
|
+
* hasNegativeApprovalOption then reads false and the auto-approve gate bails —
|
|
27
|
+
* a delegated worker sits forever on a modal it could safely have approved. The
|
|
28
|
+
* grant-scope affirmative lets the gate recognize the consent modal WITHOUT
|
|
29
|
+
* seeing the off-frame decline. The gate still selects the plain "Yes"
|
|
30
|
+
* (allow-once) via pickApprovalButton, never the broader grant, and the settle
|
|
31
|
+
* gate still requires a stable modal — so a half-rendered frame never fires.
|
|
32
|
+
* Kept deliberately narrow so no picker/confirm modal can trip it.
|
|
33
|
+
*/
|
|
34
|
+
export declare function hasReliableApprovalAffirmative(buttons: string[] | null | undefined): boolean;
|
|
2
35
|
export declare function getApprovalPositiveHints(provider?: Pick<ProviderModule, 'approvalPositiveHints'> | null): string[];
|
|
3
36
|
export declare function pickApprovalButton(buttons: string[] | null | undefined, provider?: Pick<ProviderModule, 'approvalPositiveHints'> | null): {
|
|
4
37
|
index: number;
|
|
5
38
|
label: string;
|
|
6
39
|
};
|
|
40
|
+
export declare function pickAutoApprovalButton(buttons: string[] | null | undefined): {
|
|
41
|
+
index: number;
|
|
42
|
+
label: string;
|
|
43
|
+
};
|
|
7
44
|
export declare function formatAutoApprovalMessage(modalMessage?: string, buttonLabel?: string): string;
|
|
45
|
+
/**
|
|
46
|
+
* Returns true when the given text (e.g. last assistant message content, or
|
|
47
|
+
* the tail of the PTY screen) looks like an active approval/input prompt
|
|
48
|
+
* rather than a completed assistant response. Used to prevent false
|
|
49
|
+
* idle/completion events when Claude Code surfaces a "Do you want to proceed?"
|
|
50
|
+
* style prompt that the PTY parser captures as an assistant turn while the
|
|
51
|
+
* session is still awaiting user input.
|
|
52
|
+
*/
|
|
53
|
+
export declare function looksLikeActiveApprovalPromptText(content: string): boolean;
|
|
@@ -1,6 +1,63 @@
|
|
|
1
1
|
import type { ChatMessage } from '../types.js';
|
|
2
|
-
export declare const DEFAULT_FINAL_SUMMARY_MAX_CHARS =
|
|
2
|
+
export declare const DEFAULT_FINAL_SUMMARY_MAX_CHARS = 16000;
|
|
3
3
|
export declare function extractFinalSummaryFromMessages(messages: ChatMessage[] | null | undefined, maxChars?: number): string;
|
|
4
|
+
export declare function readChatMessageTimestampMs(message: ChatMessage | null | undefined): number | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* Turn-scoped variant of extractFinalSummaryFromMessages. Selects the last
|
|
7
|
+
* user-facing assistant/model bubble whose own timestamp is at/after the
|
|
8
|
+
* producing turn's start (`minTimestampMs`). This is the NOTIF Defect-B fix:
|
|
9
|
+
* a completion event's finalSummary must describe the turn THAT completed, not
|
|
10
|
+
* the prior task's last bubble. For native-source providers (claude-cli) the
|
|
11
|
+
* external transcript holds the ENTIRE session history filtered only by session
|
|
12
|
+
* start, so a completion debounce that fires before the producing turn's final
|
|
13
|
+
* assistant bubble has landed would otherwise echo the previous task's tail.
|
|
14
|
+
* A message whose timestamp predates the turn start is skipped; if no in-turn
|
|
15
|
+
* assistant bubble exists yet, returns '' (weak/empty) — never the stale tail.
|
|
16
|
+
*
|
|
17
|
+
* Mirrors the reconcile path's transcriptAfterDispatch guard (mesh-events-stale):
|
|
18
|
+
* a bubble only counts if its timestamp proves it was produced after the turn began.
|
|
19
|
+
* When `minTimestampMs` is undefined the behaviour is identical to the unscoped
|
|
20
|
+
* extractor (no turn boundary known → no filtering).
|
|
21
|
+
*/
|
|
22
|
+
export declare function extractFinalSummaryFromMessagesAfter(messages: ChatMessage[] | null | undefined, minTimestampMs: number | undefined, maxChars?: number): string;
|
|
23
|
+
/**
|
|
24
|
+
* Like extractFinalSummaryFromMessages but also returns the ISO timestamp of the
|
|
25
|
+
* selected final assistant/model message. Completion reconciliation needs the
|
|
26
|
+
* timestamp to prove the transcript was produced AFTER the dispatch — without it
|
|
27
|
+
* reconcileDirectDispatchCompletionFromTranscript rejects non-JSON summaries as
|
|
28
|
+
* "transcript_not_proven_after_dispatch". The summary selection is identical so the
|
|
29
|
+
* timestamp always belongs to the message whose text became the summary.
|
|
30
|
+
*/
|
|
31
|
+
export declare function extractFinalAssistantSummaryEvidence(messages: ChatMessage[] | null | undefined, maxChars?: number): {
|
|
32
|
+
finalSummary: string;
|
|
33
|
+
transcriptMessageAt?: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* EARLYNOTIFY-GATEBYPASS (a)/(b) — the shared turn-finality selector for the completion
|
|
37
|
+
* final-assistant judgement, so the ~duplicated "which bubble is the turn's final answer"
|
|
38
|
+
* logic is decided ONE way (UNIFY A-6).
|
|
39
|
+
*
|
|
40
|
+
* Returns the message that qualifies as the turn's FINAL assistant bubble, or null when the
|
|
41
|
+
* transcript does not (yet) prove a turn end. The rule is a NON-EMPTY LATEST user-facing
|
|
42
|
+
* assistant/model bubble:
|
|
43
|
+
* - Scanning from the end, the FIRST user-facing assistant/model bubble encountered IS the
|
|
44
|
+
* turn-end candidate. If it is EMPTY (a streaming placeholder / mid-turn narration whose
|
|
45
|
+
* text has not landed), the turn is still in flight → return null. Crucially we do NOT walk
|
|
46
|
+
* back past that empty bubble to promote an EARLIER assistant narration to "final" (the
|
|
47
|
+
* Defect-B walk-back).
|
|
48
|
+
* - Trailing activity/internal bubbles (tool/thought/status) are skipped — they are not the
|
|
49
|
+
* assistant's user-facing answer.
|
|
50
|
+
* - A trailing user-facing USER message (a freshly dispatched task with no reply yet) means the
|
|
51
|
+
* assistant did not have the last word — no earlier bubble is promoted here; callers that must
|
|
52
|
+
* still reach a prior turn's tail use the timestamp-scoped extractor instead.
|
|
53
|
+
*
|
|
54
|
+
* A bare snapshot-idle with an arbitrary non-empty tail therefore does NOT qualify as a turn end;
|
|
55
|
+
* only a genuine latest-assistant bubble does. Turn-finality signals that live OUTSIDE the
|
|
56
|
+
* transcript (a committed generating→idle FSM transition, a self-attributing final_summary_json,
|
|
57
|
+
* or a continuous-idle streak) are enforced by the callers (the CLI completion gate, the reconcile
|
|
58
|
+
* grace gate) on top of this structural check.
|
|
59
|
+
*/
|
|
60
|
+
export declare function selectFinalAssistantTurnEndMessage(messages: ChatMessage[] | null | undefined): ChatMessage | null;
|
|
4
61
|
export declare const BUILTIN_CHAT_MESSAGE_KINDS: readonly ["standard", "thought", "tool", "terminal", "system"];
|
|
5
62
|
export type BuiltinChatMessageKind = typeof BUILTIN_CHAT_MESSAGE_KINDS[number];
|
|
6
63
|
export type ChatMessageKind = BuiltinChatMessageKind | (string & {});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare function getEffectDedupKey(effect: {
|
|
2
|
+
id?: string;
|
|
3
|
+
type: string;
|
|
4
|
+
message?: {
|
|
5
|
+
content?: unknown;
|
|
6
|
+
};
|
|
7
|
+
toast?: {
|
|
8
|
+
message?: string;
|
|
9
|
+
};
|
|
10
|
+
notification?: {
|
|
11
|
+
title?: string;
|
|
12
|
+
body?: string;
|
|
13
|
+
};
|
|
14
|
+
}): string;
|
|
15
|
+
export declare function getPersistedEffectContent(effect: {
|
|
16
|
+
type: string;
|
|
17
|
+
message?: {
|
|
18
|
+
content?: unknown;
|
|
19
|
+
};
|
|
20
|
+
toast?: {
|
|
21
|
+
message?: string;
|
|
22
|
+
};
|
|
23
|
+
notification?: {
|
|
24
|
+
title?: string;
|
|
25
|
+
body?: string;
|
|
26
|
+
bubbleContent?: unknown;
|
|
27
|
+
};
|
|
28
|
+
}): string | null;
|
|
29
|
+
export declare function formatApprovalRequestMessage(modalMessage?: string, buttons?: string[]): string;
|
|
30
|
+
export declare function formatMarkerTimestamp(timestamp: number): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI provider persisted-history dedup — incremental append computation.
|
|
3
|
+
*
|
|
4
|
+
* Pure move out of cli-provider-instance.ts (no behavior change): the
|
|
5
|
+
* shared-prefix diff that turns a full parsed transcript into the newly-added
|
|
6
|
+
* tail to append to the persisted chat history. cli-provider-instance
|
|
7
|
+
* re-exports buildIncrementalHistoryAppendMessages so existing importers/tests
|
|
8
|
+
* keep their path.
|
|
9
|
+
*/
|
|
10
|
+
export type PersistableCliHistoryMessage = {
|
|
11
|
+
role: string;
|
|
12
|
+
content: string;
|
|
13
|
+
kind?: string;
|
|
14
|
+
senderName?: string;
|
|
15
|
+
receivedAt?: number;
|
|
16
|
+
};
|
|
17
|
+
export declare function buildIncrementalHistoryAppendMessages(previousMessages: PersistableCliHistoryMessage[], currentMessages: PersistableCliHistoryMessage[]): PersistableCliHistoryMessage[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI provider structured-input helpers — image materialization + prompt build.
|
|
3
|
+
*
|
|
4
|
+
* Pure move out of cli-provider-instance.ts (no behavior change): the input
|
|
5
|
+
* envelope → CLI prompt string construction and its image-materialization
|
|
6
|
+
* support. cli-provider-instance re-exports buildCliStructuredInputPrompt so
|
|
7
|
+
* existing importers/tests keep their path.
|
|
8
|
+
*/
|
|
9
|
+
import { type InputEnvelope } from './contracts.js';
|
|
10
|
+
export declare function buildCliStructuredInputPrompt(input: InputEnvelope, options?: {
|
|
11
|
+
materializeDir?: string;
|
|
12
|
+
}): string;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export declare const STATUS_HYDRATION_TAIL_LIMIT = 200;
|
|
2
|
+
export type CompletedDebouncePending = {
|
|
3
|
+
chatTitle: string;
|
|
4
|
+
duration: number;
|
|
5
|
+
timestamp: number;
|
|
6
|
+
firstObservedAt: number;
|
|
7
|
+
previousStatus: string;
|
|
8
|
+
loggedBlockReason?: string;
|
|
9
|
+
loggedTranscriptProbe?: boolean;
|
|
10
|
+
transcriptProbeHistory?: ExternalTranscriptProbe[];
|
|
11
|
+
taskId?: string;
|
|
12
|
+
turnStartedAt?: number;
|
|
13
|
+
busyEpochAtArm?: number;
|
|
14
|
+
lastOutputAtArm?: number;
|
|
15
|
+
};
|
|
16
|
+
export type CompletedFinalizationBlock = {
|
|
17
|
+
reason: string;
|
|
18
|
+
terminal?: boolean;
|
|
19
|
+
allowTimeout?: boolean;
|
|
20
|
+
holdForTranscript?: boolean;
|
|
21
|
+
};
|
|
22
|
+
export type CompletionFinalAssistantEvidence = {
|
|
23
|
+
present: boolean;
|
|
24
|
+
messages: unknown[];
|
|
25
|
+
source: 'parsed' | 'external-native' | 'unavailable';
|
|
26
|
+
};
|
|
27
|
+
export type ExternalTranscriptProbe = {
|
|
28
|
+
readAt: number;
|
|
29
|
+
msgCount: number;
|
|
30
|
+
lastRole: string | null;
|
|
31
|
+
lastKind: string | null;
|
|
32
|
+
contentLen: number;
|
|
33
|
+
sourcePath: string | null;
|
|
34
|
+
sourceMtimeMs: number | null;
|
|
35
|
+
mtimeAgeMs: number | null;
|
|
36
|
+
};
|
|
37
|
+
export declare const COMPLETED_FINALIZATION_RETRY_MS = 1000;
|
|
38
|
+
export declare const COMPLETED_FINALIZATION_MAX_WAIT_MS = 30000;
|
|
39
|
+
export declare const NATIVE_HISTORY_MESH_IDLE_SETTLE_MS = 4000;
|
|
40
|
+
export declare const USER_INPUT_ACK_DEDUP_WINDOW_MS = 60000;
|
|
41
|
+
export declare const STARTUP_GRACE_IDLE_COLLAPSE_WINDOW_MS = 12000;
|
|
42
|
+
/** Events that signal a dispatched mesh task has reached a terminal state.
|
|
43
|
+
* Detach the mesh assignment after emitting one of these so the worker's
|
|
44
|
+
* next unrelated turn doesn't impersonate another completion. */
|
|
45
|
+
export declare const TERMINAL_MESH_EVENTS: Set<string>;
|