@adhdev/daemon-core 0.9.82-rc.45 → 0.9.82-rc.451
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 +200 -0
- package/dist/cli-adapters/provider-cli-adapter.d.ts +126 -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 +7 -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 +25 -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 +29 -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.d.ts +279 -2
- package/dist/commands/upgrade-helper.d.ts +41 -1
- package/dist/config/chat-history.d.ts +9 -0
- package/dist/config/config.d.ts +5 -0
- package/dist/config/mesh-config.d.ts +129 -1
- package/dist/config/mesh-json-config.d.ts +199 -0
- package/dist/config/repo-settings.d.ts +77 -0
- package/dist/daemon/dev-server.d.ts +0 -2
- 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 +12 -1
- 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 +57 -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 +66 -14
- package/dist/index.js +49753 -18414
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +49614 -18438
- 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/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 +164 -0
- package/dist/mesh/coordinator-prompt.d.ts +89 -0
- package/dist/mesh/coordinator-registry.d.ts +59 -0
- package/dist/mesh/mesh-active-work.d.ts +174 -0
- package/dist/mesh/mesh-clone-grace.d.ts +8 -0
- package/dist/mesh/mesh-coordinator-config.d.ts +21 -0
- package/dist/mesh/mesh-delivery-policy.d.ts +131 -0
- package/dist/mesh/mesh-event-classify.d.ts +5 -0
- package/dist/mesh/mesh-event-forwarding.d.ts +41 -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 +69 -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 +29 -0
- 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 +115 -1
- package/dist/mesh/mesh-magi-status.d.ts +63 -0
- package/dist/mesh/mesh-missions.d.ts +189 -0
- package/dist/mesh/mesh-node-identity.d.ts +306 -0
- package/dist/mesh/mesh-queue-assignment.d.ts +113 -0
- package/dist/mesh/mesh-reconcile-loop.d.ts +79 -0
- package/dist/mesh/mesh-refine-batch.d.ts +68 -0
- package/dist/mesh/mesh-refine-gates.d.ts +428 -0
- package/dist/mesh/mesh-refine-status.d.ts +62 -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 +450 -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 +30 -0
- package/dist/mesh/mesh-warmup-deadline.d.ts +68 -0
- package/dist/mesh/mesh-work-queue.d.ts +300 -5
- package/dist/mesh/preview-freshness.d.ts +18 -0
- package/dist/mesh/refine-config.d.ts +216 -0
- package/dist/mesh/worktree-bootstrap-config.d.ts +145 -0
- package/dist/providers/acp-provider-instance.d.ts +5 -0
- package/dist/providers/approval-utils.d.ts +20 -0
- package/dist/providers/chat-message-normalization.d.ts +32 -1
- package/dist/providers/cli-provider-instance.d.ts +254 -3
- package/dist/providers/contracts.d.ts +149 -6
- package/dist/providers/external-sources.d.ts +71 -0
- package/dist/providers/manual-attendance.d.ts +63 -0
- package/dist/providers/native-history/antigravity-cli-transcript.d.ts +126 -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 +27 -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 +29 -0
- package/dist/providers/provider-instance.d.ts +23 -1
- package/dist/providers/provider-loader.d.ts +26 -4
- 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 +444 -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 +222 -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 +519 -13
- 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 +6 -0
- package/dist/shared-types-extra.d.ts +2 -4
- package/dist/shared-types.d.ts +86 -55
- 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 +26 -0
- package/dist/system/hash.d.ts +8 -0
- package/dist/system/load-better-sqlite3.d.ts +21 -0
- package/dist/types.d.ts +5 -0
- package/package.json +7 -3
- package/src/agent-stream/poller.ts +2 -3
- package/src/agent-stream/provider-adapter.ts +1 -1
- package/src/boot/daemon-lifecycle.ts +63 -12
- 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 +1246 -0
- package/src/cli-adapters/provider-cli-adapter.d.ts +1 -1
- package/src/cli-adapters/provider-cli-adapter.ts +914 -1144
- 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/WINDOWS-UPGRADE-LOCK-FAILURE.md +198 -0
- package/src/commands/chat-commands-debug-bundle.ts +398 -0
- package/src/commands/chat-commands-read.ts +2488 -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.ts +596 -27
- package/src/commands/handler.ts +841 -2
- package/src/commands/high-family/index.ts +28 -0
- package/src/commands/high-family/mesh-coordinator-launch.ts +680 -0
- package/src/commands/high-family/mesh-events.ts +89 -0
- package/src/commands/high-family/mesh-status.ts +822 -0
- package/src/commands/high-family/types.ts +80 -0
- package/src/commands/low-family/coordinator-prompt.ts +72 -0
- package/src/commands/low-family/daemon-lifecycle.ts +107 -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 +274 -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 +238 -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 +1253 -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.ts +2893 -3536
- package/src/commands/stream-commands.ts +8 -0
- package/src/commands/upgrade-helper.ts +310 -45
- package/src/config/chat-history.ts +493 -24
- package/src/config/config.ts +12 -0
- package/src/config/mesh-config.ts +619 -23
- package/src/config/mesh-json-config.ts +376 -0
- package/src/config/recent-activity.ts +8 -2
- package/src/config/repo-settings.ts +111 -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 +28 -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 +78 -15
- package/src/git/git-diff.ts +81 -11
- package/src/git/git-executor.ts +12 -0
- package/src/git/git-status.ts +767 -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 +198 -12
- 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/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 +338 -0
- package/src/mesh/coordinator-prompt.ts +416 -34
- package/src/mesh/coordinator-registry.ts +121 -0
- package/src/mesh/mesh-active-work.ts +645 -0
- package/src/mesh/mesh-clone-grace.ts +68 -0
- package/src/mesh/mesh-coordinator-config.ts +97 -0
- package/src/mesh/mesh-delivery-policy.ts +315 -0
- package/src/mesh/mesh-event-classify.ts +51 -0
- package/src/mesh/mesh-event-forwarding.ts +1897 -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 +656 -0
- package/src/mesh/mesh-events-stale.ts +389 -0
- package/src/mesh/mesh-events-utils.ts +443 -0
- package/src/mesh/mesh-events.ts +33 -1035
- package/src/mesh/mesh-fast-forward.ts +843 -0
- package/src/mesh/mesh-host-ownership.ts +111 -0
- package/src/mesh/mesh-init.ts +350 -0
- package/src/mesh/mesh-ledger-reconciliation.ts +12 -7
- package/src/mesh/mesh-ledger.ts +841 -102
- package/src/mesh/mesh-magi-status.ts +223 -0
- package/src/mesh/mesh-missions.ts +449 -0
- package/src/mesh/mesh-node-identity.ts +1985 -0
- package/src/mesh/mesh-queue-assignment.ts +1924 -0
- package/src/mesh/mesh-reconcile-loop.ts +2018 -0
- package/src/mesh/mesh-refine-batch.ts +205 -0
- package/src/mesh/mesh-refine-gates.ts +1673 -0
- package/src/mesh/mesh-refine-status.ts +231 -0
- package/src/mesh/mesh-review-inbox.ts +307 -0
- package/src/mesh/mesh-routing.ts +291 -0
- package/src/mesh/mesh-runtime-store.ts +1853 -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 +185 -0
- package/src/mesh/mesh-warmup-deadline.ts +152 -0
- package/src/mesh/mesh-work-queue.ts +1254 -141
- package/src/mesh/preview-freshness.ts +118 -0
- package/src/mesh/refine-config.ts +423 -0
- package/src/mesh/worktree-bootstrap-config.ts +450 -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 +57 -5
- package/src/providers/chat-message-normalization.ts +92 -4
- package/src/providers/cli-provider-instance.ts +2177 -107
- package/src/providers/contracts.d.ts +55 -0
- package/src/providers/contracts.ts +160 -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 +85 -0
- package/src/providers/native-history/antigravity-cli-transcript.ts +1043 -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 +373 -0
- package/src/providers/native-history/hermes-cli-transcript.ts +260 -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 +19 -1
- package/src/providers/provider-loader.ts +668 -50
- package/src/providers/provider-schema.ts +87 -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 +250 -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 +509 -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 +1481 -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 +1174 -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 +262 -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 +758 -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 +6 -0
- package/src/shared-types-extra.ts +2 -4
- package/src/shared-types.d.ts +8 -0
- package/src/shared-types.ts +124 -55
- package/src/status/builders.ts +26 -6
- package/src/status/normalize.ts +2 -0
- package/src/status/reporter.ts +19 -1
- package/src/status/snapshot.ts +95 -26
- 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 +5 -0
- 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,301 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* adhdev:cli/spec@4 — declarative FSM spec.
|
|
3
|
+
*
|
|
4
|
+
* A v4 spec describes a finite state machine the same way a Unity animator
|
|
5
|
+
* layer does: states are nodes, transitions are directed edges with a guard
|
|
6
|
+
* condition. The engine (fsm-driver.ts) holds ZERO CLI-specific knowledge —
|
|
7
|
+
* every concept that used to live in the driver as a hard-coded debounce
|
|
8
|
+
* (startup grace, busy hold, completion marker, idle hold) is now expressed
|
|
9
|
+
* declaratively as either a state, a transition condition, or a transition
|
|
10
|
+
* guard. To support a new CLI you write a spec; you never touch the engine.
|
|
11
|
+
*
|
|
12
|
+
* Reuses v3's section system (sections{}) and condition system (regex /
|
|
13
|
+
* changed / all / any) verbatim — see types.ts. v4 only adds the FSM layer
|
|
14
|
+
* (states[] + transitions[]) on top and two new leaf conditions that are
|
|
15
|
+
* inherently time-based:
|
|
16
|
+
*
|
|
17
|
+
* - elapsed_ms : true once N ms have passed since the CURRENT state was
|
|
18
|
+
* entered. Replaces startup_grace_ms (a `starting` state with
|
|
19
|
+
* one `elapsed_ms` transition to idle).
|
|
20
|
+
* - stable_ms : true once the cursor_above region has been UNCHANGED for
|
|
21
|
+
* N ms. Replaces screen_active_hold_ms / the old changed:false
|
|
22
|
+
* + stable_ms combo. Pure region-stability gate.
|
|
23
|
+
*
|
|
24
|
+
* Both are evaluated by the driver (which owns the clock); the shared
|
|
25
|
+
* condition evaluator handles the screen-content leaves (regex / changed).
|
|
26
|
+
*/
|
|
27
|
+
'use strict';
|
|
28
|
+
|
|
29
|
+
import type {
|
|
30
|
+
RegexCondition, ChangedCondition,
|
|
31
|
+
Control, NotificationRule, DelegateTrigger,
|
|
32
|
+
NativeHistoryConfig, SectionDef, ExtractTitle, ExtractButtons,
|
|
33
|
+
} from './types.js';
|
|
34
|
+
|
|
35
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
36
|
+
// Conditions (v4)
|
|
37
|
+
//
|
|
38
|
+
// Superset of v3 conditions. Adds the two time-based leaves. The shared
|
|
39
|
+
// evaluator handles regex/changed; the driver handles elapsed_ms/stable_ms
|
|
40
|
+
// because they need the wall clock and per-region change timestamps.
|
|
41
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
42
|
+
|
|
43
|
+
/** True once `ms` have elapsed since the current state was entered. */
|
|
44
|
+
export interface ElapsedCondition {
|
|
45
|
+
elapsed_ms: number;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** True once a region has been unchanged for `ms`. A stability gate — the
|
|
49
|
+
* inverse of a busy signal.
|
|
50
|
+
*
|
|
51
|
+
* Region selection (precedence order):
|
|
52
|
+
* - `section` : a named section from the spec's `sections{}` (e.g. "body").
|
|
53
|
+
* Only lines inside that section are watched for change.
|
|
54
|
+
* - `cursor_above`: the N lines directly above the cursor.
|
|
55
|
+
* - neither : the whole screen (default).
|
|
56
|
+
*
|
|
57
|
+
* `ignore_lines` is orthogonal to region choice: lines matching it are
|
|
58
|
+
* stripped from BOTH frames before the change comparison, so a per-frame
|
|
59
|
+
* animation on those lines cannot reset the stable clock. This is the
|
|
60
|
+
* content-aware escape hatch for the busy→idle wedge — a benign residual
|
|
61
|
+
* ticker (a bare token counter / elapsed timer that repaints every frame
|
|
62
|
+
* after generation has finished) is filtered out, so a genuinely settled
|
|
63
|
+
* transcript can reach `stable_ms`. It is deliberately CONTENT-based, not
|
|
64
|
+
* geometric: an ACTIVE spinner line (glyph + esc/token trailer) does NOT
|
|
65
|
+
* match the benign pattern, so a real below-prompt spinner tick still resets
|
|
66
|
+
* the clock and holds busy (the FALSEIDLE2 / FALSEBUSY-B invariant). */
|
|
67
|
+
export interface StableCondition {
|
|
68
|
+
stable_ms: number;
|
|
69
|
+
/** Named section (from `sections{}`) that must be stable. Takes precedence
|
|
70
|
+
* over `cursor_above`. */
|
|
71
|
+
section?: string;
|
|
72
|
+
/** Lines above the cursor that must be stable. Default: whole screen.
|
|
73
|
+
* Ignored when `section` is set. */
|
|
74
|
+
cursor_above?: number;
|
|
75
|
+
/** Regex (line-tested with `m` flag). Lines matching it are removed from
|
|
76
|
+
* both the current and previous frame before deciding whether the region
|
|
77
|
+
* changed — a per-frame repaint confined to these lines does NOT reset the
|
|
78
|
+
* stability clock. Use for benign residual animation (token counter /
|
|
79
|
+
* elapsed timer). Must NOT match an active-spinner line, or a real spinner
|
|
80
|
+
* tick would be masked. */
|
|
81
|
+
ignore_lines?: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface FsmAllCondition {
|
|
85
|
+
all: FsmCondition[];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface FsmAnyCondition {
|
|
89
|
+
any: FsmCondition[];
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Negation — true when the inner condition is false. Lets a transition say
|
|
93
|
+
* "go busy unless the completion marker is present", etc. */
|
|
94
|
+
export interface FsmNotCondition {
|
|
95
|
+
not: FsmCondition;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export type FsmCondition =
|
|
99
|
+
| RegexCondition
|
|
100
|
+
| ChangedCondition
|
|
101
|
+
| ElapsedCondition
|
|
102
|
+
| StableCondition
|
|
103
|
+
| FsmAllCondition
|
|
104
|
+
| FsmAnyCondition
|
|
105
|
+
| FsmNotCondition;
|
|
106
|
+
|
|
107
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
108
|
+
// States & transitions (v4)
|
|
109
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
110
|
+
|
|
111
|
+
export interface FsmState {
|
|
112
|
+
id: string;
|
|
113
|
+
label: string;
|
|
114
|
+
/** Exactly one state must be `initial: true` — the state at spawn. */
|
|
115
|
+
initial?: boolean;
|
|
116
|
+
/** Modal states (approval/picker) expose modal buttons in the UI and are
|
|
117
|
+
* treated as "interesting" — the dashboard surfaces them distinctly. */
|
|
118
|
+
modal?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* For a modal state, what KIND of modal it is — the semantic distinction the
|
|
121
|
+
* status field (always 'approval' for any modal, so the dashboard surfaces it)
|
|
122
|
+
* deliberately loses. The auto-approve worker uses this to decide whether it
|
|
123
|
+
* may answer the modal on the user's behalf:
|
|
124
|
+
*
|
|
125
|
+
* - 'approval' — a tool/command/trust consent prompt ("Allow Bash?",
|
|
126
|
+
* "Trust this folder?"). Auto-approve MAY fire (a background mesh worker
|
|
127
|
+
* should not stall on these).
|
|
128
|
+
* - 'picker' — a selection menu the user opened (/model, /mode, …). There
|
|
129
|
+
* is no "correct" answer to auto-pick; blindly selecting the first option
|
|
130
|
+
* silently changes the model/mode. Auto-approve must NOT fire — the user
|
|
131
|
+
* chooses.
|
|
132
|
+
* - 'confirm' — a non-consent yes/no the user must decide. Left to the user.
|
|
133
|
+
*
|
|
134
|
+
* Defaults to 'approval' for a modal state that omits it (preserves the
|
|
135
|
+
* pre-existing "auto-approve any modal" behaviour for un-migrated specs;
|
|
136
|
+
* picker/confirm states declare their kind explicitly). Non-modal states
|
|
137
|
+
* have no modal_kind.
|
|
138
|
+
*/
|
|
139
|
+
modal_kind?: 'approval' | 'picker' | 'confirm';
|
|
140
|
+
/** Status this state maps to for the dashboard/cli-adapter status field.
|
|
141
|
+
* One of: idle | generating | approval. Defaults: modal→approval,
|
|
142
|
+
* initial→idle, id==='busy'→generating, else idle. Explicit wins. */
|
|
143
|
+
status?: 'idle' | 'generating' | 'approval';
|
|
144
|
+
/** Optional extraction run whenever this state is the committed state —
|
|
145
|
+
* used by modal states to surface a title + buttons. */
|
|
146
|
+
extract?: {
|
|
147
|
+
title?: ExtractTitle;
|
|
148
|
+
buttons?: ExtractButtons;
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface FsmTransition {
|
|
153
|
+
/** Source state id, or list of source ids, or "*" for any state. */
|
|
154
|
+
from: string | string[];
|
|
155
|
+
/** Destination state id. */
|
|
156
|
+
to: string;
|
|
157
|
+
/** Guard condition. Omitted → always eligible (only gated by `from` +
|
|
158
|
+
* min_hold_ms). Evaluated against the current screen + clock. */
|
|
159
|
+
when?: FsmCondition;
|
|
160
|
+
/** Minimum time the machine must have been in `from` before this edge can
|
|
161
|
+
* fire. Replaces busy_hold_ms / idle_hold_ms (per-edge, not global). */
|
|
162
|
+
min_hold_ms?: number;
|
|
163
|
+
/** Higher priority transitions are evaluated first. Default 0. Ties broken
|
|
164
|
+
* by declaration order. */
|
|
165
|
+
priority?: number;
|
|
166
|
+
/** Human label for the debugger. */
|
|
167
|
+
label?: string;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Declarative "trust this folder before spawn" config. Some agent CLIs gate the
|
|
172
|
+
* first run in a new folder behind an interactive trust prompt and persist the
|
|
173
|
+
* answer as a string array in a JSON settings file. Declaring this lets the
|
|
174
|
+
* engine add the workspace path to that array before spawn so the prompt never
|
|
175
|
+
* appears — the robust alternative to detecting and auto-clicking the modal.
|
|
176
|
+
* CLIs without such a gate omit this field and the engine does nothing.
|
|
177
|
+
*/
|
|
178
|
+
export interface PreLaunchTrust {
|
|
179
|
+
/** Path to the CLI's JSON settings file. A leading `~` expands to $HOME. */
|
|
180
|
+
settings_path: string;
|
|
181
|
+
/** Key of the string-array of trusted folder paths within that file. */
|
|
182
|
+
key: string;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
186
|
+
// CliSpecV4 — the v4 runtime spec
|
|
187
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
188
|
+
|
|
189
|
+
export interface CliSpecV4 {
|
|
190
|
+
$schema: 'adhdev:cli/spec@4';
|
|
191
|
+
id: string;
|
|
192
|
+
name: string;
|
|
193
|
+
binary: string;
|
|
194
|
+
spawn_args?: string[];
|
|
195
|
+
env?: Record<string, string>;
|
|
196
|
+
cli_version_range?: string;
|
|
197
|
+
/**
|
|
198
|
+
* Optional raw byte sequences written to the PTY once, shortly after spawn,
|
|
199
|
+
* to prime a TUI that gates its input handling on a terminal event the
|
|
200
|
+
* daemon would otherwise never emit. The canonical case is a focus-event
|
|
201
|
+
* TUI (Ink `useStdin`/`useFocus`, e.g. antigravity's `agy`) that enables
|
|
202
|
+
* focus reporting (`CSI ?1004h`) and treats its input box as unfocused —
|
|
203
|
+
* silently dropping the first programmatic write — until it receives a
|
|
204
|
+
* focus-in event (`ESC [ I`). Declaring `["[I"]` here wakes the input
|
|
205
|
+
* stream on spawn so the first delegated message lands without a manual
|
|
206
|
+
* keystroke. CLIs that do not focus-gate input simply omit this field; the
|
|
207
|
+
* engine writes nothing extra for them, so it stays CLI-agnostic.
|
|
208
|
+
*/
|
|
209
|
+
send_on_spawn?: string[];
|
|
210
|
+
/** Delay (ms) after spawn before writing `send_on_spawn`. Default 250. */
|
|
211
|
+
send_on_spawn_delay_ms?: number;
|
|
212
|
+
/**
|
|
213
|
+
* Opt-in stall recovery for focus-gated TUIs. The same CLIs that need
|
|
214
|
+
* `send_on_spawn` (focus-event TUIs like antigravity's `agy`) also stop
|
|
215
|
+
* rendering / flushing output the moment they believe they have lost focus
|
|
216
|
+
* MID-TURN — the screen freezes and only repaints once the user presses a
|
|
217
|
+
* key, which the daemon never does on its own. When this field is set and
|
|
218
|
+
* the machine is in a `generating`-status state whose screen has not changed
|
|
219
|
+
* for `refocus_when_stalled_ms`, the engine re-injects the `send_on_spawn`
|
|
220
|
+
* prime (the focus-in event) once to wake the render loop, then waits for the
|
|
221
|
+
* screen to change or for the stall window to lapse again before re-priming
|
|
222
|
+
* (a cooldown that prevents a tight re-prime loop). Requires `send_on_spawn`
|
|
223
|
+
* to carry the wake sequence; with no `send_on_spawn` there is nothing to
|
|
224
|
+
* re-inject and the engine does nothing. Omitted by every non-focus-gated
|
|
225
|
+
* CLI spec, so the engine stays CLI-agnostic.
|
|
226
|
+
*/
|
|
227
|
+
refocus_when_stalled_ms?: number;
|
|
228
|
+
/**
|
|
229
|
+
* Optional pre-spawn folder-trust step. When present, the engine adds the
|
|
230
|
+
* launch workspace path to the declared trusted-folders array before
|
|
231
|
+
* spawning, so a CLI that gates first run on a "trust this folder?" prompt
|
|
232
|
+
* (e.g. antigravity's `agy`) starts trusted and never blocks. Omitted for
|
|
233
|
+
* CLIs without such a gate. See pre-launch-trust.ts.
|
|
234
|
+
*/
|
|
235
|
+
pre_launch_trust?: PreLaunchTrust;
|
|
236
|
+
send_message: {
|
|
237
|
+
submit_key: string;
|
|
238
|
+
delay_ms_before_submit?: number;
|
|
239
|
+
delay_ms_per_char?: number;
|
|
240
|
+
};
|
|
241
|
+
sections: Record<string, SectionDef>;
|
|
242
|
+
states: FsmState[];
|
|
243
|
+
transitions: FsmTransition[];
|
|
244
|
+
control_bar?: Control[];
|
|
245
|
+
notifications?: NotificationRule[];
|
|
246
|
+
delegate?: DelegateTrigger[];
|
|
247
|
+
native_history?: NativeHistoryConfig;
|
|
248
|
+
requiresFinalAssistantBeforeIdle?: boolean;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export function isV4Spec(raw: unknown): raw is CliSpecV4 {
|
|
252
|
+
return !!raw && typeof raw === 'object'
|
|
253
|
+
&& (raw as { $schema?: string }).$schema === 'adhdev:cli/spec@4';
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export function initialState(spec: CliSpecV4): FsmState {
|
|
257
|
+
return spec.states.find(s => s.initial) ?? spec.states[0];
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export function stateById(spec: CliSpecV4, id: string): FsmState | undefined {
|
|
261
|
+
return spec.states.find(s => s.id === id);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/** Outgoing transitions from `stateId`, highest priority first, declaration
|
|
265
|
+
* order as tiebreak. Includes wildcard ("*") and list-membership sources. */
|
|
266
|
+
export function outgoingTransitions(spec: CliSpecV4, stateId: string): FsmTransition[] {
|
|
267
|
+
const matches = spec.transitions.filter(t => {
|
|
268
|
+
if (t.from === '*') return true;
|
|
269
|
+
if (Array.isArray(t.from)) return t.from.includes(stateId);
|
|
270
|
+
return t.from === stateId;
|
|
271
|
+
});
|
|
272
|
+
// Stable sort by priority desc; Array.prototype.sort is stable in V8 so
|
|
273
|
+
// equal-priority edges keep declaration order.
|
|
274
|
+
return matches
|
|
275
|
+
.map((t, i) => ({ t, i }))
|
|
276
|
+
.sort((a, b) => (b.t.priority ?? 0) - (a.t.priority ?? 0) || a.i - b.i)
|
|
277
|
+
.map(x => x.t);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/** Map a state to the dashboard status string, applying the documented
|
|
281
|
+
* defaults when `status` is not explicit. */
|
|
282
|
+
export function statusForState(state: FsmState): 'idle' | 'generating' | 'approval' {
|
|
283
|
+
if (state.status) return state.status;
|
|
284
|
+
if (state.modal) return 'approval';
|
|
285
|
+
if (state.id === 'busy' || state.id === 'generating') return 'generating';
|
|
286
|
+
return 'idle';
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* The modal kind for a state, or null when the state is not modal. A modal state
|
|
291
|
+
* that omits `modal_kind` defaults to 'approval' so the established
|
|
292
|
+
* auto-approve-any-modal behaviour is preserved for specs that have not yet
|
|
293
|
+
* declared a kind; picker/confirm states must opt out by declaring their kind.
|
|
294
|
+
* This is the value the cli-adapter carries on `activeModal.kind` and the
|
|
295
|
+
* auto-approve gate reads — see cli-provider-instance.maybeAutoApproveStatus.
|
|
296
|
+
*/
|
|
297
|
+
export function modalKindForState(state: FsmState): 'approval' | 'picker' | 'confirm' | null {
|
|
298
|
+
if (state.modal_kind) return state.modal_kind;
|
|
299
|
+
if (state.modal) return 'approval';
|
|
300
|
+
return null;
|
|
301
|
+
}
|