@adhdev/daemon-core 0.9.82-rc.4 → 0.9.82-rc.400
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 +11 -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 +67 -2
- package/dist/cli-adapters/cli-script-runner.d.ts +117 -0
- package/dist/cli-adapters/cli-state-engine.d.ts +198 -0
- package/dist/cli-adapters/provider-cli-adapter.d.ts +123 -64
- package/dist/cli-adapters/provider-cli-parse.d.ts +4 -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 +14 -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 +15 -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 +60 -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 +2 -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 +116 -0
- package/dist/commands/mesh-coordinator.d.ts +85 -1
- package/dist/commands/router.d.ts +267 -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 +77 -1
- package/dist/config/mesh-json-config.d.ts +299 -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 +28 -0
- package/dist/git/git-types.d.ts +5 -43
- package/dist/git/git-worktree.d.ts +22 -0
- package/dist/git/index.d.ts +2 -0
- package/dist/index.d.ts +57 -13
- package/dist/index.js +48373 -18578
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +47576 -17923
- 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-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 +19 -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 +55 -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 -37
- package/dist/mesh/mesh-fast-forward.d.ts +81 -0
- package/dist/mesh/mesh-host-ownership.d.ts +9 -0
- package/dist/mesh/mesh-init.d.ts +86 -0
- package/dist/mesh/mesh-ledger-reconciliation.d.ts +23 -4
- package/dist/mesh/mesh-ledger.d.ts +77 -1
- package/dist/mesh/mesh-missions.d.ts +164 -0
- package/dist/mesh/mesh-node-identity.d.ts +289 -0
- package/dist/mesh/mesh-queue-assignment.d.ts +95 -0
- package/dist/mesh/mesh-reconcile-loop.d.ts +65 -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 +447 -0
- package/dist/mesh/mesh-scheduling-runtime.d.ts +78 -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 +250 -6
- 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 +13 -0
- package/dist/providers/cli-provider-instance.d.ts +157 -3
- package/dist/providers/contracts.d.ts +139 -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 +100 -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 +14 -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 +91 -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 +407 -0
- package/dist/providers/spec/fsm-evaluator.d.ts +76 -0
- package/dist/providers/spec/fsm-loader.d.ts +14 -0
- package/dist/providers/spec/fsm-types.d.ts +174 -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 +536 -1
- package/dist/runtime-defaults.d.ts +2 -0
- package/dist/sessions/registry.d.ts +6 -0
- package/dist/shared-types-extra.d.ts +2 -4
- package/dist/shared-types.d.ts +59 -2
- 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 +66 -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 +1 -0
- 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 +1221 -0
- package/src/cli-adapters/provider-cli-adapter.d.ts +1 -1
- package/src/cli-adapters/provider-cli-adapter.ts +888 -1144
- package/src/cli-adapters/provider-cli-parse.d.ts +1 -0
- package/src/cli-adapters/provider-cli-parse.ts +13 -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 +90 -0
- package/src/cli-adapters/session-host-transport.ts +2 -1
- package/src/cli-adapters/terminal-backends/ghostty-vt-backend.ts +53 -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 +2327 -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 +880 -0
- package/src/commands/chat-commands.ts +19 -1841
- package/src/commands/cli-manager.ts +513 -26
- 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 +673 -0
- package/src/commands/high-family/mesh-events.ts +80 -0
- package/src/commands/high-family/mesh-status.ts +678 -0
- package/src/commands/high-family/types.ts +76 -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 +865 -0
- package/src/commands/med-family/mesh-host-pairing.ts +234 -0
- package/src/commands/med-family/mesh-queue.ts +131 -0
- package/src/commands/med-family/mesh-restart.ts +92 -0
- package/src/commands/med-family/types.ts +120 -0
- package/src/commands/mesh-coordinator.ts +334 -124
- package/src/commands/router.ts +2636 -2310
- package/src/commands/stream-commands.ts +8 -0
- package/src/commands/upgrade-helper.ts +310 -45
- package/src/config/chat-history.ts +483 -24
- package/src/config/config.ts +12 -0
- package/src/config/mesh-config.ts +353 -22
- package/src/config/mesh-json-config.ts +617 -0
- package/src/config/recent-activity.ts +8 -2
- 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 +56 -15
- package/src/git/git-diff.ts +81 -11
- package/src/git/git-executor.ts +12 -0
- package/src/git/git-status.ts +670 -48
- package/src/git/git-summary.ts +3 -0
- package/src/git/git-types.ts +17 -54
- package/src/git/git-worktree.ts +76 -1
- package/src/git/index.ts +16 -0
- package/src/index.ts +179 -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 +381 -33
- package/src/mesh/coordinator-registry.ts +121 -0
- package/src/mesh/mesh-active-work.ts +645 -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 +1762 -0
- package/src/mesh/mesh-event-trace.ts +67 -0
- package/src/mesh/mesh-events-coordinator.ts +31 -0
- package/src/mesh/mesh-events-pending.ts +590 -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 +32 -897
- package/src/mesh/mesh-fast-forward.ts +839 -0
- package/src/mesh/mesh-host-ownership.ts +73 -0
- package/src/mesh/mesh-init.ts +260 -0
- package/src/mesh/mesh-ledger-reconciliation.ts +12 -7
- package/src/mesh/mesh-ledger.ts +596 -102
- package/src/mesh/mesh-missions.ts +322 -0
- package/src/mesh/mesh-node-identity.ts +1887 -0
- package/src/mesh/mesh-queue-assignment.ts +1726 -0
- package/src/mesh/mesh-reconcile-loop.ts +1550 -0
- package/src/mesh/mesh-refine-batch.ts +205 -0
- package/src/mesh/mesh-refine-gates.ts +1660 -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 +1817 -0
- package/src/mesh/mesh-scheduling-runtime.ts +201 -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 +1178 -162
- package/src/mesh/preview-freshness.ts +118 -0
- package/src/mesh/refine-config.ts +423 -0
- package/src/mesh/worktree-bootstrap-config.ts +369 -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 +48 -6
- package/src/providers/cli-provider-instance.ts +1580 -103
- package/src/providers/contracts.d.ts +55 -0
- package/src/providers/contracts.ts +150 -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 +643 -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 +339 -0
- package/src/providers/native-history/hermes-cli-transcript.ts +230 -0
- package/src/providers/native-history/index.ts +30 -0
- package/src/providers/provider-instance-manager.ts +30 -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 +504 -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 +235 -0
- package/src/providers/spec/cli-adapter.ts +1056 -0
- package/src/providers/spec/evaluator.ts +407 -0
- package/src/providers/spec/fsm-driver.ts +1304 -0
- package/src/providers/spec/fsm-evaluator.ts +272 -0
- package/src/providers/spec/fsm-loader.ts +120 -0
- package/src/providers/spec/fsm-types.ts +273 -0
- package/src/providers/spec/native-history-executor.ts +1128 -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 +755 -2
- package/src/runtime-defaults.ts +39 -0
- 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 +64 -1
- 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
|
@@ -39,6 +39,46 @@ export declare function buildPinnedGlobalInstallCommand(options: {
|
|
|
39
39
|
}): PinnedGlobalInstallCommand;
|
|
40
40
|
export declare function getNpmExecOptions(platform?: NodeJS.Platform): NpmExecOptions;
|
|
41
41
|
export declare function execNpmCommandSync(args: string[], options?: ExecFileSyncOptions, surface?: Pick<CurrentGlobalInstallSurface, 'npmExecutable' | 'npmArgsPrefix' | 'execOptions'>): Buffer | string;
|
|
42
|
-
export declare function stopSessionHostProcesses(appName: string): void
|
|
42
|
+
export declare function stopSessionHostProcesses(appName: string): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Enumerate processes that have a locked native addon (conpty.node /
|
|
45
|
+
* ghostty-vt.dll) of *this* install memory-mapped.
|
|
46
|
+
*
|
|
47
|
+
* `stopSessionHostProcesses()` only knows the single managed session-host pid, so
|
|
48
|
+
* any *foreign* holder — e.g. an orphaned `pty_*probe*.cjs` left in `%TEMP%` — is
|
|
49
|
+
* invisible to it and keeps the addon locked through every install retry, dooming
|
|
50
|
+
* the upgrade with EBUSY. This scans by the module's full path so we only ever
|
|
51
|
+
* target a holder of the exact `packageRoot` being replaced (never an unrelated
|
|
52
|
+
* install's copy). Windows-only — these locks don't exist on POSIX.
|
|
53
|
+
*/
|
|
54
|
+
export declare function listForeignNativeAddonHolders(packageRoot: string | null | undefined): Array<{
|
|
55
|
+
pid: number;
|
|
56
|
+
commandLine: string | null;
|
|
57
|
+
}>;
|
|
58
|
+
/**
|
|
59
|
+
* Terminate every foreign process holding this install's native addon mapped,
|
|
60
|
+
* then wait for each to actually exit so the mapping is released before npm
|
|
61
|
+
* copies the file into its staging dir. Returns what it found/killed so the
|
|
62
|
+
* caller can surface an actionable recovery message on failure.
|
|
63
|
+
*/
|
|
64
|
+
export declare function stopForeignNativeAddonHolders(packageRoot: string | null | undefined, options?: {
|
|
65
|
+
parentPid?: number;
|
|
66
|
+
}): Promise<Array<{
|
|
67
|
+
pid: number;
|
|
68
|
+
commandLine: string | null;
|
|
69
|
+
killed: boolean;
|
|
70
|
+
}>>;
|
|
71
|
+
/**
|
|
72
|
+
* Best-effort removal of a leftover npm staging entry.
|
|
73
|
+
*
|
|
74
|
+
* A stale staging dir can hold a locked native binary — e.g. `ghostty-vt.dll`
|
|
75
|
+
* from `@adhdev/ghostty-vt-node` still mapped by a lingering session-host
|
|
76
|
+
* process — which makes `rmSync` throw `EPERM` on Windows. Staging cleanup is
|
|
77
|
+
* only housekeeping: the leftover is inert and npm creates its own fresh
|
|
78
|
+
* staging dir for the real install, so a lock on an old leftover must NOT abort
|
|
79
|
+
* the upgrade. Log and continue instead of letting the error propagate.
|
|
80
|
+
*/
|
|
81
|
+
export declare function safeRemoveStaleEntry(target: string, label: string): void;
|
|
82
|
+
export declare function cleanupStaleGlobalInstallDirs(pkgName: string, surface: CurrentGlobalInstallSurface): void;
|
|
43
83
|
export declare function spawnDetachedDaemonUpgradeHelper(payload: DaemonUpgradeHelperPayload): void;
|
|
44
84
|
export declare function maybeRunDaemonUpgradeHelperFromEnv(): Promise<boolean>;
|
|
@@ -110,12 +110,21 @@ export declare function readProviderChatHistory(agentType: string, options?: {
|
|
|
110
110
|
excludeRecentCount?: number;
|
|
111
111
|
historyBehavior?: ProviderHistoryBehavior;
|
|
112
112
|
scripts?: ProviderNativeHistoryScripts;
|
|
113
|
+
excludeInProgressTurn?: boolean;
|
|
114
|
+
sessionStartedAtMs?: number;
|
|
115
|
+
envOverrides?: Record<string, string>;
|
|
116
|
+
forceRefresh?: boolean;
|
|
113
117
|
}): {
|
|
114
118
|
messages: HistoryMessage[];
|
|
115
119
|
hasMore: boolean;
|
|
116
120
|
source: 'provider-native' | 'adhdev-mirror' | 'native-unavailable';
|
|
117
121
|
sourcePath?: string;
|
|
118
122
|
sourceMtimeMs?: number;
|
|
123
|
+
providerSessionId?: string;
|
|
124
|
+
workspace?: string;
|
|
125
|
+
nativeHistoryCoverage?: string;
|
|
126
|
+
partialReason?: string;
|
|
127
|
+
unavailableReason?: string;
|
|
119
128
|
};
|
|
120
129
|
export declare function listProviderHistorySessions(agentType: string, options?: {
|
|
121
130
|
canonicalHistory?: ProviderCanonicalHistoryConfig;
|
package/dist/config/config.d.ts
CHANGED
|
@@ -86,6 +86,11 @@ export declare function isStableMachineId(machineId?: string | null): boolean;
|
|
|
86
86
|
* Get the config directory path
|
|
87
87
|
*/
|
|
88
88
|
export declare function getConfigDir(): string;
|
|
89
|
+
/**
|
|
90
|
+
* Get the daemon runtime data directory (~/.adhdev/daemon/).
|
|
91
|
+
* Distinct from the user-config dir so runtime state can be cleared independently.
|
|
92
|
+
*/
|
|
93
|
+
export declare function getDaemonDataDir(): string;
|
|
89
94
|
/**
|
|
90
95
|
* Load configuration from disk
|
|
91
96
|
*/
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Cloud mode syncs these to D1 via server routes; standalone mode
|
|
6
6
|
* uses this file as the single source of truth.
|
|
7
7
|
*/
|
|
8
|
-
import type { LocalMeshEntry, LocalMeshNodeEntry, RepoMeshPolicy, RepoMeshNodePolicy, RepoMeshNodeCapabilities, RepoMeshCoordinatorConfig } from '../repo-mesh-types.js';
|
|
8
|
+
import type { LocalMeshEntry, LocalMeshNodeEntry, RepoMeshPolicy, RepoMeshNodePolicy, RepoMeshNodeCapabilities, RepoMeshCoordinatorConfig, RepoMeshHostMetadata, RepoMeshDaemonRole } from '../repo-mesh-types.js';
|
|
9
9
|
/**
|
|
10
10
|
* Normalize a Git remote URL into a stable identity string.
|
|
11
11
|
* e.g. "git@github.com:user/repo.git" → "github.com/user/repo"
|
|
@@ -22,6 +22,7 @@ export interface CreateMeshOptions {
|
|
|
22
22
|
defaultBranch?: string;
|
|
23
23
|
policy?: Partial<RepoMeshPolicy>;
|
|
24
24
|
coordinator?: RepoMeshCoordinatorConfig;
|
|
25
|
+
meshHost?: RepoMeshHostMetadata;
|
|
25
26
|
}
|
|
26
27
|
export declare function createMesh(opts: CreateMeshOptions): LocalMeshEntry;
|
|
27
28
|
export interface UpdateMeshOptions {
|
|
@@ -29,23 +30,98 @@ export interface UpdateMeshOptions {
|
|
|
29
30
|
defaultBranch?: string;
|
|
30
31
|
policy?: Partial<RepoMeshPolicy>;
|
|
31
32
|
coordinator?: RepoMeshCoordinatorConfig;
|
|
33
|
+
meshHost?: RepoMeshHostMetadata;
|
|
32
34
|
}
|
|
33
35
|
export declare function updateMesh(meshId: string, opts: UpdateMeshOptions): LocalMeshEntry | undefined;
|
|
34
36
|
export declare function deleteMesh(meshId: string): boolean;
|
|
37
|
+
export declare function tokenIdForManualPairing(token: string): string;
|
|
38
|
+
export interface ConfigureMeshHostPairingOptions {
|
|
39
|
+
hostAddress: string;
|
|
40
|
+
token: string;
|
|
41
|
+
now?: string;
|
|
42
|
+
}
|
|
43
|
+
export declare function configureMeshHostPairing(meshId: string, opts: ConfigureMeshHostPairingOptions): {
|
|
44
|
+
mesh: LocalMeshEntry;
|
|
45
|
+
meshHost: RepoMeshHostMetadata;
|
|
46
|
+
hostAddress: string;
|
|
47
|
+
} | undefined;
|
|
48
|
+
export interface CreateMeshHostPairingTokenOptions {
|
|
49
|
+
token?: string;
|
|
50
|
+
expiresAt?: string;
|
|
51
|
+
now?: string;
|
|
52
|
+
}
|
|
53
|
+
export declare function createMeshHostPairingToken(meshId: string, opts?: CreateMeshHostPairingTokenOptions): {
|
|
54
|
+
mesh: LocalMeshEntry;
|
|
55
|
+
meshHost: RepoMeshHostMetadata;
|
|
56
|
+
token: string;
|
|
57
|
+
tokenId: string;
|
|
58
|
+
expiresAt?: string;
|
|
59
|
+
} | undefined;
|
|
60
|
+
export interface MeshHostJoinMemberNodeInput {
|
|
61
|
+
id?: string;
|
|
62
|
+
workspace: string;
|
|
63
|
+
repoRoot?: string;
|
|
64
|
+
daemonId?: string;
|
|
65
|
+
machineId?: string;
|
|
66
|
+
userOverrides?: Partial<RepoMeshNodeCapabilities>;
|
|
67
|
+
policy?: RepoMeshNodePolicy;
|
|
68
|
+
role?: RepoMeshDaemonRole;
|
|
69
|
+
}
|
|
70
|
+
export interface ApplyMeshHostJoinOptions {
|
|
71
|
+
token: string;
|
|
72
|
+
memberNode: MeshHostJoinMemberNodeInput;
|
|
73
|
+
memberMeshId?: string;
|
|
74
|
+
now?: string;
|
|
75
|
+
}
|
|
76
|
+
export declare function applyMeshHostJoinRequest(meshId: string, opts: ApplyMeshHostJoinOptions): {
|
|
77
|
+
accepted: true;
|
|
78
|
+
mesh: LocalMeshEntry;
|
|
79
|
+
meshHost: RepoMeshHostMetadata;
|
|
80
|
+
node: LocalMeshNodeEntry;
|
|
81
|
+
tokenId: string;
|
|
82
|
+
} | {
|
|
83
|
+
accepted: false;
|
|
84
|
+
mesh?: LocalMeshEntry;
|
|
85
|
+
meshHost?: RepoMeshHostMetadata;
|
|
86
|
+
tokenId?: string;
|
|
87
|
+
reason: string;
|
|
88
|
+
} | undefined;
|
|
89
|
+
export declare function markMeshHostPairingJoined(meshId: string, opts: {
|
|
90
|
+
hostDaemonId?: string;
|
|
91
|
+
hostNodeId?: string;
|
|
92
|
+
joinedAt?: string;
|
|
93
|
+
token?: string;
|
|
94
|
+
tokenId?: string;
|
|
95
|
+
}): {
|
|
96
|
+
mesh: LocalMeshEntry;
|
|
97
|
+
meshHost: RepoMeshHostMetadata;
|
|
98
|
+
} | undefined;
|
|
35
99
|
export interface AddNodeOptions {
|
|
36
100
|
workspace: string;
|
|
37
101
|
repoRoot?: string;
|
|
38
102
|
daemonId?: string;
|
|
39
103
|
machineId?: string;
|
|
104
|
+
capabilities?: string[];
|
|
40
105
|
userOverrides?: Partial<RepoMeshNodeCapabilities>;
|
|
41
106
|
policy?: RepoMeshNodePolicy;
|
|
42
107
|
isLocalWorktree?: boolean;
|
|
43
108
|
worktreeBranch?: string;
|
|
44
109
|
clonedFromNodeId?: string;
|
|
110
|
+
worktreeBootstrap?: LocalMeshNodeEntry['worktreeBootstrap'];
|
|
111
|
+
role?: RepoMeshDaemonRole;
|
|
45
112
|
}
|
|
46
113
|
export declare function addNode(meshId: string, opts: AddNodeOptions): LocalMeshNodeEntry | undefined;
|
|
47
114
|
export declare function removeNode(meshId: string, nodeId: string): boolean;
|
|
48
115
|
export declare function updateNode(meshId: string, nodeId: string, opts: {
|
|
49
116
|
userOverrides?: Partial<RepoMeshNodeCapabilities>;
|
|
50
117
|
policy?: RepoMeshNodePolicy;
|
|
118
|
+
worktreeBootstrap?: LocalMeshNodeEntry['worktreeBootstrap'];
|
|
119
|
+
/** Per-node instruction surfaced in the coordinator prompt. Pass an
|
|
120
|
+
* empty string or undefined to clear it. */
|
|
121
|
+
systemPrompt?: string;
|
|
122
|
+
/** Live self-reported platform/arch from the owning daemon's git_status
|
|
123
|
+
* envelope. Persisted distinctly from userOverrides (auto-detected, not
|
|
124
|
+
* operator intent) so capability-tag os=/arch= self-heals across loads. */
|
|
125
|
+
reportedPlatform?: string;
|
|
126
|
+
reportedArch?: string;
|
|
51
127
|
}): LocalMeshNodeEntry | undefined;
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repo-shared declarative mesh config — `.adhdev/mesh.json`
|
|
3
|
+
*
|
|
4
|
+
* A repo-committed, machine-independent BASE for mesh declarative settings
|
|
5
|
+
* (policy + coordinator prompt override/append + operating notes). It is the
|
|
6
|
+
* lowest layer of a LOCAL-WINS merge chain:
|
|
7
|
+
*
|
|
8
|
+
* DEFAULT_MESH_POLICY → .adhdev/mesh.json (repo base) → machine-local
|
|
9
|
+
* meshes.json / coordinator-prompt files (always win)
|
|
10
|
+
*
|
|
11
|
+
* The merge is **in-memory only**. The on-disk machine-local `meshes.json` is
|
|
12
|
+
* NEVER mutated by this module — local config keeps winning and the merge is
|
|
13
|
+
* applied transiently on the coordinator launch + display paths. This keeps the
|
|
14
|
+
* repo file a shared default that a machine can always override without the
|
|
15
|
+
* override being silently rewritten back to the repo shape.
|
|
16
|
+
*
|
|
17
|
+
* Three zones (scope = mesh-global in v1; per-node scope is not introduced):
|
|
18
|
+
* - policy — RepoMeshPolicy fields; local fields that differ from
|
|
19
|
+
* DEFAULT_MESH_POLICY win, otherwise the repo base shows
|
|
20
|
+
* through (true per-field LOCAL-WINS).
|
|
21
|
+
* - coordinator — systemPromptOverride (local wins, else repo) and
|
|
22
|
+
* systemPromptAppend (repo append + local append BOTH
|
|
23
|
+
* stack, repo first).
|
|
24
|
+
* - operatingNotes — repo-declared baseline notes merged with the runtime
|
|
25
|
+
* ledger notes; on duplicate text the ledger note wins.
|
|
26
|
+
*
|
|
27
|
+
* Advisory-only fields (`coordinator.maxPromptChars`, `limits.maxNoteChars`,
|
|
28
|
+
* `limits.maxNotes`) are accepted and preserved in the schema but NOT enforced
|
|
29
|
+
* in v1 — they document operator intent only.
|
|
30
|
+
*
|
|
31
|
+
* SCHEDULING OVERLAY — this same `.adhdev/mesh.json` also carries the in-tree
|
|
32
|
+
* scheduling product surface (`policy.scheduling`). Instead of the scattered
|
|
33
|
+
* `schedulingStrategy` / `maxParallelTasks` knobs (each with its own default +
|
|
34
|
+
* clamp), an operator declares one `policy.scheduling` block checked into the
|
|
35
|
+
* repo. It layers ON TOP of the stored meshes.json policy with LOCAL-WINS — a
|
|
36
|
+
* value present in the repo file overrides the persisted mesh policy, so the
|
|
37
|
+
* repo is the source of truth for how its own work distributes. Absent keys
|
|
38
|
+
* leave the stored policy untouched (a partial overlay, not a replacement).
|
|
39
|
+
*
|
|
40
|
+
* .adhdev/mesh.json
|
|
41
|
+
* { "policy": { "scheduling": {
|
|
42
|
+
* "distribution": "spread" | "in_order", // → schedulingStrategy
|
|
43
|
+
* "maxParallel": 1..8, // → maxParallelTasks (clamped)
|
|
44
|
+
* "readonlyMultiplier": 2 // read-only cap multiplier (default 2)
|
|
45
|
+
* } } }
|
|
46
|
+
*
|
|
47
|
+
* The raw 4-union schedulingStrategy escape hatch is preserved elsewhere: a
|
|
48
|
+
* hand-edited meshes.json may still write any of the four raw strategies and the
|
|
49
|
+
* scheduler honors it. The scheduling overlay exposes only the 2-mode
|
|
50
|
+
* `distribution` façade, mapped through distributionToStrategy.
|
|
51
|
+
*
|
|
52
|
+
* The declarative-config loader (`loadRepoMeshJsonConfig`) and the scheduling
|
|
53
|
+
* overlay loader (`loadMeshJsonConfig`) read the SAME file but resolve different
|
|
54
|
+
* zones; they coexist intentionally — coordinator launch/display consume the
|
|
55
|
+
* declarative zones, the scheduler consumes the scheduling overlay.
|
|
56
|
+
*
|
|
57
|
+
* SECURITY: declarative only. JSON/YAML is parsed; arbitrary JS (.js) is NOT
|
|
58
|
+
* supported, so loading a config can never execute code.
|
|
59
|
+
*/
|
|
60
|
+
import { type RepoMeshPolicy, type RepoMeshCoordinatorConfig, type LocalMeshEntry, type RepoMeshDistribution, distributionToStrategy } from '../repo-mesh-types.js';
|
|
61
|
+
import type { CoordinatorOperatingNote } from '../mesh/coordinator-prompt.js';
|
|
62
|
+
export interface RepoMeshDeclarativeCoordinatorConfig {
|
|
63
|
+
/** Full mesh-level system prompt override. Same semantics as
|
|
64
|
+
* RepoMeshCoordinatorConfig.systemPromptOverride; LOCAL-WINS. */
|
|
65
|
+
systemPromptOverride?: string;
|
|
66
|
+
/** Mesh-level append stacked after the base prompt. Both the repo append
|
|
67
|
+
* and the machine-local append apply; the repo append comes first. */
|
|
68
|
+
systemPromptAppend?: string;
|
|
69
|
+
/** Advisory only in v1 — recorded but never enforced. */
|
|
70
|
+
maxPromptChars?: number;
|
|
71
|
+
}
|
|
72
|
+
export interface RepoMeshDeclarativeLimits {
|
|
73
|
+
/** Advisory only in v1 — recorded but never enforced. */
|
|
74
|
+
maxNoteChars?: number;
|
|
75
|
+
/** Advisory only in v1 — recorded but never enforced. */
|
|
76
|
+
maxNotes?: number;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Parsed + normalized `.adhdev/mesh.json` shape. Every field is optional except
|
|
80
|
+
* version so a repo can declare only the zone(s) it cares about.
|
|
81
|
+
*/
|
|
82
|
+
export interface RepoMeshDeclarativeConfig {
|
|
83
|
+
version: 1;
|
|
84
|
+
policy?: Partial<RepoMeshPolicy>;
|
|
85
|
+
coordinator?: RepoMeshDeclarativeCoordinatorConfig;
|
|
86
|
+
operatingNotes?: CoordinatorOperatingNote[];
|
|
87
|
+
limits?: RepoMeshDeclarativeLimits;
|
|
88
|
+
}
|
|
89
|
+
export interface RepoMeshJsonConfigLoadResult {
|
|
90
|
+
config?: RepoMeshDeclarativeConfig;
|
|
91
|
+
/** Relative location matched, or 'unavailable'/'invalid' marker. */
|
|
92
|
+
source: string;
|
|
93
|
+
sourceType: 'repo_file' | 'unavailable' | 'invalid';
|
|
94
|
+
/** Absolute path of the matched file, when one was read. */
|
|
95
|
+
path?: string;
|
|
96
|
+
error?: string;
|
|
97
|
+
}
|
|
98
|
+
export interface MeshJsonSchedulingConfig {
|
|
99
|
+
/** User-facing distribution mode; mapped to schedulingStrategy on apply. */
|
|
100
|
+
distribution?: RepoMeshDistribution;
|
|
101
|
+
/** Global write-task parallel cap (clamped to [1, 8] on apply). */
|
|
102
|
+
maxParallel?: number;
|
|
103
|
+
/** Read-only diagnosis cap multiplier. Missing → 2. */
|
|
104
|
+
readonlyMultiplier?: number;
|
|
105
|
+
}
|
|
106
|
+
export interface MeshJsonConfig {
|
|
107
|
+
scheduling?: MeshJsonSchedulingConfig;
|
|
108
|
+
}
|
|
109
|
+
export interface MeshJsonConfigLoadResult {
|
|
110
|
+
config?: MeshJsonConfig;
|
|
111
|
+
source: string;
|
|
112
|
+
sourceType: 'repo_file' | 'unavailable' | 'invalid';
|
|
113
|
+
path?: string;
|
|
114
|
+
error?: string;
|
|
115
|
+
/** Cache key: path + mtime, or a sentinel for the missing/invalid case. */
|
|
116
|
+
sourceKey: string;
|
|
117
|
+
}
|
|
118
|
+
export declare const MESH_JSON_CONFIG_LOCATIONS: string[];
|
|
119
|
+
export declare const MESH_JSON_CONFIG_SCHEMA: {
|
|
120
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
121
|
+
readonly title: "ADHDev Repo Mesh Declarative Config";
|
|
122
|
+
readonly type: "object";
|
|
123
|
+
readonly additionalProperties: false;
|
|
124
|
+
readonly required: readonly ["version"];
|
|
125
|
+
readonly properties: {
|
|
126
|
+
readonly version: {
|
|
127
|
+
readonly const: 1;
|
|
128
|
+
};
|
|
129
|
+
readonly policy: {
|
|
130
|
+
readonly type: "object";
|
|
131
|
+
};
|
|
132
|
+
readonly coordinator: {
|
|
133
|
+
readonly type: "object";
|
|
134
|
+
readonly additionalProperties: false;
|
|
135
|
+
readonly properties: {
|
|
136
|
+
readonly systemPromptOverride: {
|
|
137
|
+
readonly type: "string";
|
|
138
|
+
};
|
|
139
|
+
readonly systemPromptAppend: {
|
|
140
|
+
readonly type: "string";
|
|
141
|
+
};
|
|
142
|
+
readonly maxPromptChars: {
|
|
143
|
+
readonly type: "number";
|
|
144
|
+
readonly minimum: 1;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
readonly operatingNotes: {
|
|
149
|
+
readonly type: "array";
|
|
150
|
+
readonly maxItems: 200;
|
|
151
|
+
readonly items: {
|
|
152
|
+
readonly type: "object";
|
|
153
|
+
readonly additionalProperties: false;
|
|
154
|
+
readonly required: readonly ["text"];
|
|
155
|
+
readonly properties: {
|
|
156
|
+
readonly text: {
|
|
157
|
+
readonly type: "string";
|
|
158
|
+
readonly minLength: 1;
|
|
159
|
+
};
|
|
160
|
+
readonly category: {
|
|
161
|
+
readonly enum: readonly ["provider_quirk", "pattern_to_avoid", "recovery_lesson"];
|
|
162
|
+
};
|
|
163
|
+
readonly createdAt: {
|
|
164
|
+
readonly type: "string";
|
|
165
|
+
};
|
|
166
|
+
readonly sourceCoordinator: {
|
|
167
|
+
readonly type: "string";
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
readonly limits: {
|
|
173
|
+
readonly type: "object";
|
|
174
|
+
readonly additionalProperties: false;
|
|
175
|
+
readonly properties: {
|
|
176
|
+
readonly maxNoteChars: {
|
|
177
|
+
readonly type: "number";
|
|
178
|
+
readonly minimum: 1;
|
|
179
|
+
};
|
|
180
|
+
readonly maxNotes: {
|
|
181
|
+
readonly type: "number";
|
|
182
|
+
readonly minimum: 1;
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
/**
|
|
189
|
+
* Validate + normalize a parsed `.adhdev/mesh.json` object into a typed
|
|
190
|
+
* RepoMeshDeclarativeConfig. Returns the config plus any non-fatal warnings;
|
|
191
|
+
* `valid` is false only when the document is structurally unusable (not an
|
|
192
|
+
* object / wrong version). Unknown top-level keys are tolerated (dropped) so a
|
|
193
|
+
* newer repo file authored against a future schema still loads its known zones.
|
|
194
|
+
*/
|
|
195
|
+
export declare function normalizeRepoMeshDeclarativeConfig(parsed: unknown): {
|
|
196
|
+
valid: boolean;
|
|
197
|
+
config?: RepoMeshDeclarativeConfig;
|
|
198
|
+
errors: string[];
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
* Load the repo-shared declarative mesh config for a coordinator workspace.
|
|
202
|
+
*
|
|
203
|
+
* Resolution: the coordinator node workspace is checked first; if it carries no
|
|
204
|
+
* `.adhdev/mesh.json`, the calling process cwd is tried as a fallback (per the
|
|
205
|
+
* design: "workspace path = coordinator node workspace's .adhdev/mesh.json,
|
|
206
|
+
* else calling cwd"). The first existing file across both bases (and the
|
|
207
|
+
* json/yaml/yml variants) wins.
|
|
208
|
+
*
|
|
209
|
+
* Read/parse errors never throw — they resolve to a sourceType:'invalid'
|
|
210
|
+
* result so a broken repo file degrades to "no repo base" instead of blocking
|
|
211
|
+
* coordinator launch.
|
|
212
|
+
*/
|
|
213
|
+
export declare function loadRepoMeshJsonConfig(workspace?: string): RepoMeshJsonConfigLoadResult;
|
|
214
|
+
/**
|
|
215
|
+
* Reduce a (fully-normalized) machine-local policy to ONLY the fields that
|
|
216
|
+
* genuinely differ from DEFAULT_MESH_POLICY. A meshes.json policy is always
|
|
217
|
+
* stored fully-defaulted, so a naive merge would let it shadow every repo-base
|
|
218
|
+
* field — defeating the repo default. By keeping only the truly-overridden
|
|
219
|
+
* fields, an untouched local field falls through to the repo base while a local
|
|
220
|
+
* field the operator actually changed still wins. Optional fields absent from
|
|
221
|
+
* DEFAULT_MESH_POLICY (e.g. allowedProviders, schedulingStrategy) count as an
|
|
222
|
+
* override whenever present.
|
|
223
|
+
*/
|
|
224
|
+
export declare function diffPolicyFromDefault(local: Partial<RepoMeshPolicy> | undefined): Partial<RepoMeshPolicy>;
|
|
225
|
+
/**
|
|
226
|
+
* Effective mesh policy = DEFAULT → repo base → local overrides (per-field
|
|
227
|
+
* LOCAL-WINS). When `local` is all-default the repo base shows through entirely
|
|
228
|
+
* (case i); when `local` overrides a field that field wins (case ii). Nested
|
|
229
|
+
* objects (autoFastForward) are still merged per-field by mergeAndNormalizePolicy.
|
|
230
|
+
*/
|
|
231
|
+
export declare function mergeEffectiveMeshPolicy(repoPolicy: Partial<RepoMeshPolicy> | undefined, localPolicy: RepoMeshPolicy | Partial<RepoMeshPolicy> | undefined): RepoMeshPolicy;
|
|
232
|
+
/**
|
|
233
|
+
* Effective coordinator config. systemPromptOverride: local wins, else repo.
|
|
234
|
+
* systemPromptAppend: repo append + local append BOTH stack (repo first). Other
|
|
235
|
+
* coordinator fields (providerType, preferredNodeId, …) are carried from the
|
|
236
|
+
* machine-local config unchanged.
|
|
237
|
+
*/
|
|
238
|
+
export declare function mergeEffectiveCoordinatorConfig(repoCoord: RepoMeshDeclarativeCoordinatorConfig | undefined, localCoord: RepoMeshCoordinatorConfig | undefined): RepoMeshCoordinatorConfig;
|
|
239
|
+
/**
|
|
240
|
+
* Effective operating notes = repo-declared baseline ⊕ runtime ledger notes.
|
|
241
|
+
* Dedup by trimmed text with the LEDGER note winning (repo duplicates dropped),
|
|
242
|
+
* so a runtime note's freshest wording/category survives. Order: repo baseline
|
|
243
|
+
* first, then ledger notes. Returns undefined when nothing usable remains so the
|
|
244
|
+
* prompt's "## Operating Notes" section is omitted exactly as before.
|
|
245
|
+
*/
|
|
246
|
+
export declare function mergeEffectiveOperatingNotes(repoNotes: CoordinatorOperatingNote[] | undefined, ledgerNotes: CoordinatorOperatingNote[] | undefined): CoordinatorOperatingNote[] | undefined;
|
|
247
|
+
/**
|
|
248
|
+
* Produce an in-memory effective mesh by layering the repo declarative config
|
|
249
|
+
* UNDER the machine-local mesh entry (policy + coordinator zones). Returns a new
|
|
250
|
+
* object; the input mesh and on-disk meshes.json are never mutated. operatingNotes
|
|
251
|
+
* are merged separately at launch (they ride the prompt context, not the mesh).
|
|
252
|
+
*/
|
|
253
|
+
export declare function applyRepoMeshConfig<T extends Pick<LocalMeshEntry, 'policy' | 'coordinator'>>(mesh: T, repoConfig: RepoMeshDeclarativeConfig | null | undefined): T;
|
|
254
|
+
/**
|
|
255
|
+
* Build a `.adhdev/mesh.json` DRAFT from a machine-local mesh entry. This is a
|
|
256
|
+
* scaffold for the operator to review and commit — NOT an automatic migration.
|
|
257
|
+
* It captures the local policy (fully normalized) plus any coordinator prompt
|
|
258
|
+
* override/append so a repo can adopt the current machine's settings as the
|
|
259
|
+
* shared base. Operating notes are intentionally NOT exported: those are runtime
|
|
260
|
+
* ledger lessons, and a repo should declare baseline notes deliberately.
|
|
261
|
+
*/
|
|
262
|
+
export declare function buildMeshJsonConfigScaffold(mesh: Pick<LocalMeshEntry, 'policy' | 'coordinator'>): RepoMeshDeclarativeConfig;
|
|
263
|
+
/** Serialize a scaffold to the canonical 2-space JSON draft text. */
|
|
264
|
+
export declare function serializeMeshJsonConfigScaffold(config: RepoMeshDeclarativeConfig): string;
|
|
265
|
+
/**
|
|
266
|
+
* Validate a parsed `.adhdev/mesh.*` document into a MeshJsonConfig (scheduling
|
|
267
|
+
* overlay). Tolerant of an empty/partial file (an empty object is valid and
|
|
268
|
+
* yields no overlay); strict about malformed values so a typo surfaces as
|
|
269
|
+
* `invalid` rather than silently no-op'ing.
|
|
270
|
+
*/
|
|
271
|
+
export declare function validateMeshJsonConfig(raw: unknown, source?: string): {
|
|
272
|
+
valid: boolean;
|
|
273
|
+
errors: string[];
|
|
274
|
+
config?: MeshJsonConfig;
|
|
275
|
+
};
|
|
276
|
+
/**
|
|
277
|
+
* Locate and load the `.adhdev/mesh.json` scheduling overlay for a repo root.
|
|
278
|
+
* Declarative only — never executes config. Cached by path + mtime so repeated
|
|
279
|
+
* scheduler reads are cheap.
|
|
280
|
+
*/
|
|
281
|
+
export declare function loadMeshJsonConfig(repoRoot: string): MeshJsonConfigLoadResult;
|
|
282
|
+
/** Test-only: drop the mtime cache so a per-run temp file is re-read. */
|
|
283
|
+
export declare function __resetMeshJsonConfigCacheForTests(): void;
|
|
284
|
+
/**
|
|
285
|
+
* The effective scheduling knobs after layering the repo-local `.adhdev/mesh.json`
|
|
286
|
+
* overlay on top of a stored mesh policy (LOCAL-WINS). This is the single resolution
|
|
287
|
+
* point the scheduler reads, so the strategy/caps it acts on always reflect the
|
|
288
|
+
* in-tree override when present and fall back to the persisted policy otherwise.
|
|
289
|
+
*/
|
|
290
|
+
export interface EffectiveMeshScheduling {
|
|
291
|
+
/** Resolved raw strategy (override distribution → strategy, else stored policy). */
|
|
292
|
+
strategy: ReturnType<typeof distributionToStrategy> | RepoMeshPolicy['schedulingStrategy'];
|
|
293
|
+
/** Effective, clamped global write cap. */
|
|
294
|
+
maxParallelTasks: number;
|
|
295
|
+
/** Read-only cap multiplier (override, else default 2). */
|
|
296
|
+
readonlyMultiplier?: number;
|
|
297
|
+
/** True when an `.adhdev/mesh.json` overlay actually contributed a value. */
|
|
298
|
+
overrideApplied: boolean;
|
|
299
|
+
}
|
|
@@ -103,8 +103,6 @@ export declare class DevServer implements DevServerContext {
|
|
|
103
103
|
getLatestScriptVersionDir(scriptsDir: string): string | null;
|
|
104
104
|
private resolveAutoImplWritableProviderDir;
|
|
105
105
|
private handleAutoImplement;
|
|
106
|
-
private buildAutoImplPrompt;
|
|
107
|
-
private buildCliAutoImplPrompt;
|
|
108
106
|
private handleAutoImplSSE;
|
|
109
107
|
private handleAutoImplCancel;
|
|
110
108
|
sendAutoImplSSE(msg: {
|
|
@@ -32,4 +32,17 @@ export interface IDEDefinition {
|
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
export declare function registerIDEDefinition(def: IDEDefinition): void;
|
|
35
|
+
/**
|
|
36
|
+
* Resolve an IDE version on demand (NOT at boot).
|
|
37
|
+
*
|
|
38
|
+
* Order of preference, all spawn-free where possible:
|
|
39
|
+
* 1. win32: read the bundled product.json/package.json next to the exe.
|
|
40
|
+
* 2. Otherwise spawn `<cli> --version` — but ONLY when the binary is not a
|
|
41
|
+
* known GUI executable (the #4 guard), so we never boot an IDE window.
|
|
42
|
+
*
|
|
43
|
+
* `win32ProcessNames` is provider.json `processNames.win32` (type → exe names),
|
|
44
|
+
* used to recognise GUI executables. Callers that have a ProviderLoader can
|
|
45
|
+
* pass `providerLoader.getWinProcessNames()`.
|
|
46
|
+
*/
|
|
47
|
+
export declare function getIdeVersion(cliCommand: string, win32ProcessNames?: Record<string, string[]>): Promise<string | null>;
|
|
35
48
|
export declare function detectIDEs(providerLoader?: ProviderLoader): Promise<IDEInfo[]>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ADHDev — Windows IDE version detection (execution-free)
|
|
3
|
+
*
|
|
4
|
+
* On Windows the resolved "CLI" for a VS Code fork (Cursor, Antigravity, …)
|
|
5
|
+
* frequently resolves to the GUI Electron executable itself, because the
|
|
6
|
+
* case-insensitive filesystem matches `...\cursor\cursor.exe` against the
|
|
7
|
+
* real `Cursor.exe`. Running `<that exe> --version` boots the GUI instead of
|
|
8
|
+
* printing a version (Electron ignores the unknown flag and opens a window).
|
|
9
|
+
*
|
|
10
|
+
* To learn the version WITHOUT spawning anything, we read the bundled
|
|
11
|
+
* `product.json` / `package.json` that ship next to the executable. VS Code
|
|
12
|
+
* forks embed their version there. This is a pure filesystem read.
|
|
13
|
+
*
|
|
14
|
+
* It also exposes a guard so any remaining `--version` exec path can refuse to
|
|
15
|
+
* spawn a binary that is a known GUI executable for an IDE provider.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Read an IDE version from disk (no process spawn).
|
|
19
|
+
*
|
|
20
|
+
* @param exePath Absolute path to the GUI executable (or any path inside the
|
|
21
|
+
* IDE install dir — we read the manifest relative to its directory).
|
|
22
|
+
* @returns The version string, or null if it could not be determined.
|
|
23
|
+
*/
|
|
24
|
+
export declare function readWin32IdeVersionFromDisk(exePath: string): string | null;
|
|
25
|
+
/**
|
|
26
|
+
* True when `binPath` resolves to a known GUI executable for some IDE.
|
|
27
|
+
*
|
|
28
|
+
* Used as a safety net: any code path about to run `<bin> --version` must skip
|
|
29
|
+
* the spawn when the binary is actually the GUI Electron exe, since that would
|
|
30
|
+
* launch the IDE window. Comparison is case-insensitive on the basename
|
|
31
|
+
* (Windows filesystem semantics) against every provider's `processNames.win32`.
|
|
32
|
+
*
|
|
33
|
+
* @param binPath Resolved binary path that would be exec'd.
|
|
34
|
+
* @param win32ProcessNames Map of provider type → list of GUI exe names
|
|
35
|
+
* (from provider.json `processNames.win32`, e.g. `["Cursor.exe"]`).
|
|
36
|
+
*/
|
|
37
|
+
export declare function isKnownWin32GuiExe(binPath: string | null | undefined, win32ProcessNames: Record<string, string[]>): boolean;
|