@adhdev/daemon-core 0.9.82-rc.49 → 0.9.82-rc.490
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/boot/daemon-lifecycle.d.ts +9 -0
- package/dist/boot/process-hardening.d.ts +50 -0
- package/dist/build-info.d.ts +37 -0
- package/dist/chat/source-machine.d.ts +166 -0
- package/dist/chat/source-resolver.d.ts +104 -0
- package/dist/chat/subscription-updates.d.ts +1 -0
- package/dist/cli-adapter-types.d.ts +68 -2
- package/dist/cli-adapters/cli-script-runner.d.ts +117 -0
- package/dist/cli-adapters/cli-state-engine.d.ts +220 -0
- package/dist/cli-adapters/provider-cli-adapter.d.ts +137 -64
- package/dist/cli-adapters/provider-cli-parse.d.ts +5 -0
- package/dist/cli-adapters/provider-cli-runtime.d.ts +34 -0
- package/dist/cli-adapters/provider-cli-shared.d.ts +74 -0
- package/dist/cli-adapters/pty-write-chunking.d.ts +34 -0
- package/dist/cli-adapters/raw-terminal-io.d.ts +37 -0
- package/dist/cli-adapters/resolve-executable.d.ts +69 -0
- package/dist/cli-adapters/terminal-backends/ghostty-vt-backend.d.ts +6 -3
- package/dist/cli-adapters/terminal-backends/types.d.ts +10 -2
- package/dist/cli-adapters/terminal-screen.d.ts +4 -11
- package/dist/commands/chat-commands-debug-bundle.d.ts +14 -0
- package/dist/commands/chat-commands-read.d.ts +23 -0
- package/dist/commands/chat-commands-scope.d.ts +39 -0
- package/dist/commands/chat-commands-shared.d.ts +33 -0
- package/dist/commands/chat-commands-write.d.ts +14 -0
- package/dist/commands/chat-commands.d.ts +10 -23
- package/dist/commands/cli-manager.d.ts +71 -1
- package/dist/commands/handler.d.ts +125 -0
- package/dist/commands/high-family/index.d.ts +3 -0
- package/dist/commands/high-family/mesh-coordinator-launch.d.ts +2 -0
- package/dist/commands/high-family/mesh-events.d.ts +2 -0
- package/dist/commands/high-family/mesh-status.d.ts +2 -0
- package/dist/commands/high-family/types.d.ts +64 -0
- package/dist/commands/low-family/coordinator-prompt.d.ts +9 -0
- package/dist/commands/low-family/daemon-lifecycle.d.ts +2 -0
- package/dist/commands/low-family/diagnostics.d.ts +2 -0
- package/dist/commands/low-family/index.d.ts +3 -0
- package/dist/commands/low-family/mesh-ledger.d.ts +10 -0
- package/dist/commands/low-family/mesh-node-logs.d.ts +2 -0
- package/dist/commands/low-family/notification.d.ts +2 -0
- package/dist/commands/low-family/refine-config.d.ts +2 -0
- package/dist/commands/low-family/session-host.d.ts +2 -0
- package/dist/commands/low-family/spec-providerdev.d.ts +11 -0
- package/dist/commands/low-family/status-meta.d.ts +2 -0
- package/dist/commands/low-family/types.d.ts +33 -0
- package/dist/commands/med-family/cli-agent.d.ts +2 -0
- package/dist/commands/med-family/fast-forward.d.ts +2 -0
- package/dist/commands/med-family/ide.d.ts +10 -0
- package/dist/commands/med-family/index.d.ts +3 -0
- package/dist/commands/med-family/mesh-crud.d.ts +48 -0
- package/dist/commands/med-family/mesh-host-pairing.d.ts +2 -0
- package/dist/commands/med-family/mesh-queue.d.ts +2 -0
- package/dist/commands/med-family/mesh-restart.d.ts +2 -0
- package/dist/commands/med-family/types.d.ts +152 -0
- package/dist/commands/mesh-coordinator.d.ts +85 -1
- package/dist/commands/router-aggregate-status.d.ts +24 -0
- package/dist/commands/router-mesh-session-owner.d.ts +59 -0
- package/dist/commands/router-refine.d.ts +151 -0
- package/dist/commands/router-worktree-cleanup.d.ts +133 -0
- package/dist/commands/router.d.ts +203 -15
- package/dist/commands/upgrade-helper.d.ts +41 -1
- package/dist/config/chat-history.d.ts +11 -0
- package/dist/config/config.d.ts +19 -0
- package/dist/config/mesh-config.d.ts +65 -0
- package/dist/config/mesh-json-config.d.ts +199 -0
- package/dist/config/registry-resolver.d.ts +54 -0
- package/dist/config/repo-settings.d.ts +77 -0
- package/dist/config/state-store.d.ts +30 -0
- package/dist/daemon/dev-server.d.ts +0 -2
- package/dist/detection/cli-detector.d.ts +17 -0
- package/dist/detection/ide-detector.d.ts +13 -0
- package/dist/detection/win32-ide-version.d.ts +37 -0
- package/dist/git/change-impact-config.d.ts +159 -0
- package/dist/git/git-commands.d.ts +26 -2
- package/dist/git/git-diff.d.ts +6 -0
- package/dist/git/git-executor.d.ts +11 -0
- package/dist/git/git-status.d.ts +80 -0
- package/dist/git/git-types.d.ts +2 -50
- package/dist/git/git-worktree.d.ts +71 -1
- package/dist/git/index.d.ts +3 -1
- package/dist/index.d.ts +70 -17
- package/dist/index.js +53532 -19073
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +53283 -18989
- package/dist/index.mjs.map +1 -1
- package/dist/installer.d.ts +1 -4
- package/dist/ipc/local-ipc-server.d.ts +91 -0
- package/dist/launch.d.ts +1 -1
- package/dist/logging/async-batch-writer.d.ts +10 -0
- package/dist/logging/debug-config.d.ts +16 -0
- package/dist/logging/log-redactor.d.ts +24 -0
- package/dist/logging/log-tail-reader.d.ts +81 -0
- package/dist/logging/logger.d.ts +1 -1
- package/dist/mesh/contracts.d.ts +256 -0
- package/dist/mesh/coordinator-prompt.d.ts +76 -0
- package/dist/mesh/coordinator-registry.d.ts +59 -0
- package/dist/mesh/mesh-active-work.d.ts +203 -0
- package/dist/mesh/mesh-clone-grace.d.ts +8 -0
- package/dist/mesh/mesh-completion-synthesis.d.ts +4 -0
- package/dist/mesh/mesh-coordinator-config.d.ts +21 -0
- package/dist/mesh/mesh-delivery-policy.d.ts +104 -0
- package/dist/mesh/mesh-event-classify.d.ts +7 -0
- package/dist/mesh/mesh-event-forwarding.d.ts +58 -0
- package/dist/mesh/mesh-event-trace.d.ts +21 -0
- package/dist/mesh/mesh-events-coordinator.d.ts +4 -0
- package/dist/mesh/mesh-events-pending.d.ts +258 -0
- package/dist/mesh/mesh-events-stale.d.ts +61 -0
- package/dist/mesh/mesh-events-utils.d.ts +75 -0
- package/dist/mesh/mesh-events.d.ts +6 -49
- package/dist/mesh/mesh-fast-forward.d.ts +81 -0
- package/dist/mesh/mesh-host-ownership.d.ts +21 -1
- package/dist/mesh/mesh-init.d.ts +128 -0
- package/dist/mesh/mesh-ledger-reconciliation.d.ts +23 -4
- package/dist/mesh/mesh-ledger.d.ts +139 -1
- package/dist/mesh/mesh-magi-status.d.ts +63 -0
- package/dist/mesh/mesh-missions.d.ts +281 -0
- package/dist/mesh/mesh-node-identity.d.ts +310 -0
- package/dist/mesh/mesh-queue-assignment.d.ts +162 -0
- package/dist/mesh/mesh-reconcile-acked-hold.d.ts +17 -0
- package/dist/mesh/mesh-reconcile-config.d.ts +6 -0
- package/dist/mesh/mesh-reconcile-identity.d.ts +6 -0
- package/dist/mesh/mesh-reconcile-loop.d.ts +84 -0
- package/dist/mesh/mesh-reconcile-v2-backstop.d.ts +16 -0
- package/dist/mesh/mesh-refine-batch.d.ts +68 -0
- package/dist/mesh/mesh-refine-gates.d.ts +457 -0
- package/dist/mesh/mesh-refine-status.d.ts +62 -0
- package/dist/mesh/mesh-remote-event-pull.d.ts +15 -0
- package/dist/mesh/mesh-review-inbox.d.ts +90 -0
- package/dist/mesh/mesh-routing.d.ts +70 -0
- package/dist/mesh/mesh-runtime-store.d.ts +567 -0
- package/dist/mesh/mesh-scheduling-runtime.d.ts +78 -0
- package/dist/mesh/mesh-task-inflight.d.ts +46 -0
- package/dist/mesh/mesh-task-stats.d.ts +49 -0
- package/dist/mesh/mesh-unresolved-forward-outbox.d.ts +34 -0
- package/dist/mesh/mesh-warmup-deadline.d.ts +68 -0
- package/dist/mesh/mesh-work-queue.d.ts +392 -1
- package/dist/mesh/preview-freshness.d.ts +28 -0
- package/dist/mesh/refine-config.d.ts +97 -0
- package/dist/mesh/worktree-bootstrap-config.d.ts +219 -0
- package/dist/providers/acp-provider-instance.d.ts +5 -0
- package/dist/providers/approval-utils.d.ts +46 -0
- package/dist/providers/chat-message-normalization.d.ts +58 -1
- package/dist/providers/cli-provider-effect-format.d.ts +30 -0
- package/dist/providers/cli-provider-history-dedup.d.ts +17 -0
- package/dist/providers/cli-provider-input-prompt.d.ts +12 -0
- package/dist/providers/cli-provider-instance-types.d.ts +45 -0
- package/dist/providers/cli-provider-instance.d.ts +426 -30
- package/dist/providers/cli-provider-status-helpers.d.ts +46 -0
- package/dist/providers/cli-provider-transcript-merge.d.ts +7 -0
- package/dist/providers/contracts.d.ts +196 -6
- package/dist/providers/external-sources.d.ts +71 -0
- package/dist/providers/manual-attendance.d.ts +79 -0
- package/dist/providers/native-history/antigravity-claim-registry.d.ts +39 -0
- package/dist/providers/native-history/antigravity-cli-transcript.d.ts +137 -0
- package/dist/providers/native-history/claude-cli-transcript.d.ts +70 -0
- package/dist/providers/native-history/codex-cli-transcript.d.ts +73 -0
- package/dist/providers/native-history/constants.d.ts +12 -0
- package/dist/providers/native-history/dispatcher.d.ts +44 -0
- package/dist/providers/native-history/hermes-cli-transcript.d.ts +30 -0
- package/dist/providers/native-history/index.d.ts +13 -0
- package/dist/providers/provider-instance-manager.d.ts +30 -0
- package/dist/providers/provider-instance.d.ts +31 -1
- package/dist/providers/provider-loader.d.ts +42 -5
- package/dist/providers/provider-trust.d.ts +31 -0
- package/dist/providers/read-chat-contract.d.ts +29 -0
- package/dist/providers/sdk/v1/builders/acp/detect-status.d.ts +68 -0
- package/dist/providers/sdk/v1/builders/cli/detect-status.d.ts +86 -0
- package/dist/providers/sdk/v1/builders/cli/parse-approval-squash.d.ts +59 -0
- package/dist/providers/sdk/v1/builders/cli/parse-approval.d.ts +65 -0
- package/dist/providers/sdk/v1/builders/cli/parse-session.d.ts +91 -0
- package/dist/providers/sdk/v1/builders/cli/visible-region.d.ts +42 -0
- package/dist/providers/sdk/v1/fixture-tooling/format.d.ts +126 -0
- package/dist/providers/sdk/v1/fixture-tooling/index.d.ts +8 -0
- package/dist/providers/sdk/v1/fixture-tooling/replay.d.ts +38 -0
- package/dist/providers/sdk/v1/index.d.ts +30 -0
- package/dist/providers/sdk/v1/sandbox/README-design.d.ts +193 -0
- package/dist/providers/sdk/v1/sandbox/require-whitelist.d.ts +74 -0
- package/dist/providers/sdk/v1/sandbox/script-runner.d.ts +98 -0
- package/dist/providers/sdk/v1/types/cli/index.d.ts +277 -0
- package/dist/providers/sdk/v1/types/common/index.d.ts +203 -0
- package/dist/providers/sdk/v1/validators/index.d.ts +5 -0
- package/dist/providers/sdk/v1/validators/manifest.d.ts +40 -0
- package/dist/providers/sdk/v1/validators/taint.d.ts +52 -0
- package/dist/providers/spec/adapter.d.ts +98 -0
- package/dist/providers/spec/cli-adapter.d.ts +223 -0
- package/dist/providers/spec/evaluator.d.ts +45 -0
- package/dist/providers/spec/fsm-driver.d.ts +449 -0
- package/dist/providers/spec/fsm-evaluator.d.ts +93 -0
- package/dist/providers/spec/fsm-loader.d.ts +14 -0
- package/dist/providers/spec/fsm-types.d.ts +202 -0
- package/dist/providers/spec/native-history-executor.d.ts +41 -0
- package/dist/providers/spec/pre-launch-trust.d.ts +16 -0
- package/dist/providers/spec/route.d.ts +4 -0
- package/dist/providers/spec/types.d.ts +244 -0
- package/dist/providers/status-monitor.d.ts +7 -7
- package/dist/providers/transcript-v2.d.ts +176 -0
- package/dist/providers/types/interactive-prompt.d.ts +84 -0
- package/dist/providers/working-dir.d.ts +17 -0
- package/dist/repo-mesh-types.d.ts +616 -12
- package/dist/runtime-defaults.d.ts +2 -0
- package/dist/session-host/managed-host.d.ts +64 -0
- package/dist/session-host/runtime-surface.d.ts +10 -16
- package/dist/sessions/registry.d.ts +26 -0
- package/dist/shared-types-extra.d.ts +2 -4
- package/dist/shared-types.d.ts +110 -55
- package/dist/status/chat-tail-hot-sessions.d.ts +40 -0
- package/dist/status/normalize.d.ts +1 -1
- package/dist/status/normalize.js +1 -0
- package/dist/status/normalize.js.map +1 -1
- package/dist/status/normalize.mjs +1 -0
- package/dist/status/normalize.mjs.map +1 -1
- package/dist/status/reporter.d.ts +2 -0
- package/dist/status/snapshot.d.ts +27 -0
- package/dist/system/hash.d.ts +8 -0
- package/dist/system/load-better-sqlite3.d.ts +21 -0
- package/dist/types.d.ts +20 -6
- package/package.json +11 -4
- package/src/agent-stream/poller.ts +2 -3
- package/src/agent-stream/provider-adapter.ts +1 -1
- package/src/boot/daemon-lifecycle.ts +80 -14
- package/src/boot/process-hardening.ts +89 -0
- package/src/build-info.ts +73 -0
- package/src/chat/source-machine.ts +534 -0
- package/src/chat/source-resolver.ts +0 -0
- package/src/chat/subscription-updates.ts +20 -1
- package/src/cli-adapter-types.d.ts +3 -1
- package/src/cli-adapter-types.ts +68 -2
- package/src/cli-adapters/cli-script-runner.ts +421 -0
- package/src/cli-adapters/cli-state-engine.ts +1282 -0
- package/src/cli-adapters/provider-cli-adapter.d.ts +1 -1
- package/src/cli-adapters/provider-cli-adapter.ts +1048 -1143
- package/src/cli-adapters/provider-cli-parse.d.ts +2 -0
- package/src/cli-adapters/provider-cli-parse.ts +19 -0
- package/src/cli-adapters/provider-cli-runtime.ts +56 -7
- package/src/cli-adapters/provider-cli-shared.d.ts +4 -0
- package/src/cli-adapters/provider-cli-shared.ts +121 -11
- package/src/cli-adapters/pty-transport.ts +2 -1
- package/src/cli-adapters/pty-write-chunking.ts +106 -0
- package/src/cli-adapters/raw-terminal-io.ts +252 -0
- package/src/cli-adapters/resolve-executable.ts +204 -0
- package/src/cli-adapters/session-host-transport.ts +2 -1
- package/src/cli-adapters/terminal-backends/ghostty-vt-backend.ts +63 -29
- package/src/cli-adapters/terminal-backends/types.ts +10 -3
- package/src/cli-adapters/terminal-screen.ts +16 -81
- package/src/commands/chat-commands-debug-bundle.ts +398 -0
- package/src/commands/chat-commands-read.ts +2788 -0
- package/src/commands/chat-commands-scope.ts +54 -0
- package/src/commands/chat-commands-shared.ts +114 -0
- package/src/commands/chat-commands-write.ts +891 -0
- package/src/commands/chat-commands.ts +19 -1841
- package/src/commands/cli-manager.d.ts +2 -0
- package/src/commands/cli-manager.ts +724 -27
- package/src/commands/handler.ts +865 -2
- package/src/commands/high-family/index.ts +28 -0
- package/src/commands/high-family/mesh-coordinator-launch.ts +696 -0
- package/src/commands/high-family/mesh-events.ts +102 -0
- package/src/commands/high-family/mesh-status.ts +857 -0
- package/src/commands/high-family/types.ts +80 -0
- package/src/commands/low-family/coordinator-prompt.ts +125 -0
- package/src/commands/low-family/daemon-lifecycle.ts +120 -0
- package/src/commands/low-family/diagnostics.ts +57 -0
- package/src/commands/low-family/index.ts +37 -0
- package/src/commands/low-family/mesh-ledger.ts +62 -0
- package/src/commands/low-family/mesh-node-logs.ts +87 -0
- package/src/commands/low-family/notification.ts +116 -0
- package/src/commands/low-family/refine-config.ts +106 -0
- package/src/commands/low-family/session-host.ts +282 -0
- package/src/commands/low-family/spec-providerdev.ts +217 -0
- package/src/commands/low-family/status-meta.ts +112 -0
- package/src/commands/low-family/types.ts +39 -0
- package/src/commands/med-family/cli-agent.ts +270 -0
- package/src/commands/med-family/fast-forward.ts +230 -0
- package/src/commands/med-family/ide.ts +163 -0
- package/src/commands/med-family/index.ts +37 -0
- package/src/commands/med-family/mesh-crud.ts +1268 -0
- package/src/commands/med-family/mesh-host-pairing.ts +234 -0
- package/src/commands/med-family/mesh-queue.ts +167 -0
- package/src/commands/med-family/mesh-restart.ts +92 -0
- package/src/commands/med-family/types.ts +153 -0
- package/src/commands/mesh-coordinator.ts +334 -124
- package/src/commands/router-aggregate-status.ts +209 -0
- package/src/commands/router-mesh-session-owner.ts +114 -0
- package/src/commands/router-refine.ts +1794 -0
- package/src/commands/router-worktree-cleanup.ts +870 -0
- package/src/commands/router.ts +567 -4149
- package/src/commands/stream-commands.ts +8 -0
- package/src/commands/upgrade-helper.ts +310 -45
- package/src/config/chat-history.ts +517 -24
- package/src/config/config.ts +30 -0
- package/src/config/mesh-config.ts +300 -24
- package/src/config/mesh-json-config.ts +376 -0
- package/src/config/recent-activity.ts +8 -2
- package/src/config/registry-resolver.ts +100 -0
- package/src/config/repo-settings.ts +111 -0
- package/src/config/state-store.ts +55 -0
- package/src/daemon/dev-auto-implement.ts +3 -2
- package/src/daemon/dev-cli-debug.ts +10 -1
- package/src/daemon/dev-server.ts +0 -541
- package/src/detection/cli-detector.ts +94 -9
- package/src/detection/ide-detector.ts +55 -16
- package/src/detection/win32-ide-version.ts +106 -0
- package/src/git/change-impact-config.ts +354 -0
- package/src/git/git-commands.ts +112 -16
- package/src/git/git-diff.ts +81 -11
- package/src/git/git-executor.ts +12 -0
- package/src/git/git-status.ts +822 -48
- package/src/git/git-types.ts +14 -62
- package/src/git/git-worktree.ts +261 -4
- package/src/git/index.ts +17 -0
- package/src/index.ts +190 -13
- package/src/installer.d.ts +1 -1
- package/src/installer.ts +8 -6
- package/src/ipc/local-ipc-server.ts +278 -0
- package/src/launch.d.ts +1 -1
- package/src/launch.ts +37 -28
- package/src/logging/async-batch-writer.ts +55 -0
- package/src/logging/command-log.ts +7 -5
- package/src/logging/debug-config.ts +25 -0
- package/src/logging/debug-trace.ts +7 -2
- package/src/logging/log-redactor.ts +100 -0
- package/src/logging/log-tail-reader.ts +341 -0
- package/src/logging/logger.ts +14 -7
- package/src/mesh/contracts.ts +510 -0
- package/src/mesh/coordinator-prompt.ts +627 -34
- package/src/mesh/coordinator-registry.ts +121 -0
- package/src/mesh/mesh-active-work.ts +706 -0
- package/src/mesh/mesh-clone-grace.ts +68 -0
- package/src/mesh/mesh-completion-synthesis.ts +416 -0
- package/src/mesh/mesh-coordinator-config.ts +97 -0
- package/src/mesh/mesh-delivery-policy.ts +284 -0
- package/src/mesh/mesh-event-classify.ts +78 -0
- package/src/mesh/mesh-event-forwarding.ts +2030 -0
- package/src/mesh/mesh-event-trace.ts +67 -0
- package/src/mesh/mesh-events-coordinator.ts +32 -0
- package/src/mesh/mesh-events-pending.ts +1548 -0
- package/src/mesh/mesh-events-stale.ts +452 -0
- package/src/mesh/mesh-events-utils.ts +443 -0
- package/src/mesh/mesh-events.ts +43 -1035
- package/src/mesh/mesh-fast-forward.ts +856 -0
- package/src/mesh/mesh-host-ownership.ts +41 -3
- package/src/mesh/mesh-init.ts +350 -0
- package/src/mesh/mesh-ledger-reconciliation.ts +12 -7
- package/src/mesh/mesh-ledger.ts +897 -102
- package/src/mesh/mesh-magi-status.ts +223 -0
- package/src/mesh/mesh-missions.ts +695 -0
- package/src/mesh/mesh-node-identity.ts +2065 -0
- package/src/mesh/mesh-queue-assignment.ts +2498 -0
- package/src/mesh/mesh-reconcile-acked-hold.ts +230 -0
- package/src/mesh/mesh-reconcile-config.ts +66 -0
- package/src/mesh/mesh-reconcile-identity.ts +103 -0
- package/src/mesh/mesh-reconcile-loop.ts +1696 -0
- package/src/mesh/mesh-reconcile-v2-backstop.ts +62 -0
- package/src/mesh/mesh-refine-batch.ts +205 -0
- package/src/mesh/mesh-refine-gates.ts +1792 -0
- package/src/mesh/mesh-refine-status.ts +231 -0
- package/src/mesh/mesh-remote-event-pull.ts +279 -0
- package/src/mesh/mesh-review-inbox.ts +308 -0
- package/src/mesh/mesh-routing.ts +291 -0
- package/src/mesh/mesh-runtime-store.ts +2292 -0
- package/src/mesh/mesh-scheduling-runtime.ts +198 -0
- package/src/mesh/mesh-task-inflight.ts +70 -0
- package/src/mesh/mesh-task-stats.ts +161 -0
- package/src/mesh/mesh-unresolved-forward-outbox.ts +215 -0
- package/src/mesh/mesh-warmup-deadline.ts +152 -0
- package/src/mesh/mesh-work-queue.ts +1489 -145
- package/src/mesh/preview-freshness.ts +163 -0
- package/src/mesh/refine-config.ts +129 -12
- package/src/mesh/worktree-bootstrap-config.ts +599 -0
- package/src/providers/acp-provider-instance.ts +43 -10
- package/src/providers/approval-utils.d.ts +5 -0
- package/src/providers/approval-utils.ts +100 -6
- package/src/providers/chat-message-normalization.ts +126 -4
- package/src/providers/cli-provider-effect-format.ts +53 -0
- package/src/providers/cli-provider-history-dedup.ts +75 -0
- package/src/providers/cli-provider-input-prompt.ts +133 -0
- package/src/providers/cli-provider-instance-types.ts +131 -0
- package/src/providers/cli-provider-instance.ts +2771 -499
- package/src/providers/cli-provider-status-helpers.ts +123 -0
- package/src/providers/cli-provider-transcript-merge.ts +114 -0
- package/src/providers/contracts.d.ts +55 -0
- package/src/providers/contracts.ts +207 -6
- package/src/providers/extension-provider-instance.ts +12 -7
- package/src/providers/external-sources.ts +218 -0
- package/src/providers/ide-provider-instance.ts +35 -12
- package/src/providers/manual-attendance.ts +105 -0
- package/src/providers/native-history/antigravity-claim-registry.ts +138 -0
- package/src/providers/native-history/antigravity-cli-transcript.ts +1275 -0
- package/src/providers/native-history/claude-cli-transcript.ts +396 -0
- package/src/providers/native-history/codex-cli-transcript.ts +479 -0
- package/src/providers/native-history/constants.ts +19 -0
- package/src/providers/native-history/dispatcher.ts +617 -0
- package/src/providers/native-history/hermes-cli-transcript.ts +312 -0
- package/src/providers/native-history/index.ts +30 -0
- package/src/providers/provider-instance-manager.ts +71 -0
- package/src/providers/provider-instance.ts +24 -1
- package/src/providers/provider-loader.ts +700 -55
- package/src/providers/provider-schema.ts +93 -14
- package/src/providers/provider-trust.ts +114 -0
- package/src/providers/read-chat-contract.ts +76 -16
- package/src/providers/sdk/README.md +49 -0
- package/src/providers/sdk/v1/builders/acp/detect-status.ts +144 -0
- package/src/providers/sdk/v1/builders/cli/detect-status.ts +313 -0
- package/src/providers/sdk/v1/builders/cli/parse-approval-squash.ts +158 -0
- package/src/providers/sdk/v1/builders/cli/parse-approval.ts +261 -0
- package/src/providers/sdk/v1/builders/cli/parse-session.ts +276 -0
- package/src/providers/sdk/v1/builders/cli/visible-region.ts +143 -0
- package/src/providers/sdk/v1/fixture-tooling/format.ts +130 -0
- package/src/providers/sdk/v1/fixture-tooling/index.ts +22 -0
- package/src/providers/sdk/v1/fixture-tooling/replay.ts +352 -0
- package/src/providers/sdk/v1/index.ts +152 -0
- package/src/providers/sdk/v1/sandbox/README-design.ts +195 -0
- package/src/providers/sdk/v1/sandbox/require-whitelist.ts +472 -0
- package/src/providers/sdk/v1/sandbox/script-runner.ts +150 -0
- package/src/providers/sdk/v1/schemas/cli/provider.schema.json +538 -0
- package/src/providers/sdk/v1/schemas/primitives/acp-session-protocol-v1.json +131 -0
- package/src/providers/sdk/v1/schemas/primitives/native-history-codex-rollout-v1.json +66 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-approval-squash-v1.json +91 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-assistant-block-v1.json +91 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-cue-ordering-v1.json +47 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-dispatch-order-v1.json +32 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-footer-chrome-v1.json +42 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-index-finder-v1.json +27 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-modal-v1.json +125 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-prompt-marker-v1.json +45 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-session-id-extraction-v1.json +46 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-settled-prompt-v1.json +71 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-spinner-v1.json +83 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-transcript-pty-v1.json +83 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-visible-region-v1.json +57 -0
- package/src/providers/sdk/v1/schemas/primitives/tui-welcome-screen-v1.json +35 -0
- package/src/providers/sdk/v1/types/cli/index.ts +365 -0
- package/src/providers/sdk/v1/types/common/index.ts +229 -0
- package/src/providers/sdk/v1/validators/index.ts +19 -0
- package/src/providers/sdk/v1/validators/manifest.ts +110 -0
- package/src/providers/sdk/v1/validators/taint.ts +309 -0
- package/src/providers/spec/adapter.ts +246 -0
- package/src/providers/spec/cli-adapter.ts +1064 -0
- package/src/providers/spec/evaluator.ts +407 -0
- package/src/providers/spec/fsm-driver.ts +1528 -0
- package/src/providers/spec/fsm-evaluator.ts +290 -0
- package/src/providers/spec/fsm-loader.ts +128 -0
- package/src/providers/spec/fsm-types.ts +301 -0
- package/src/providers/spec/native-history-executor.ts +1241 -0
- package/src/providers/spec/pre-launch-trust.ts +104 -0
- package/src/providers/spec/route.ts +51 -0
- package/src/providers/spec/types.ts +284 -0
- package/src/providers/status-monitor.d.ts +7 -7
- package/src/providers/status-monitor.ts +37 -22
- package/src/providers/transcript-v2.ts +567 -0
- package/src/providers/types/interactive-prompt.ts +536 -0
- package/src/providers/version-archive.ts +64 -24
- package/src/providers/working-dir.ts +23 -0
- package/src/repo-mesh-types.ts +861 -14
- package/src/runtime-defaults.ts +39 -0
- package/src/session-host/managed-host.ts +218 -0
- package/src/session-host/runtime-surface.ts +20 -80
- package/src/sessions/registry.ts +44 -0
- package/src/shared-types-extra.ts +2 -4
- package/src/shared-types.d.ts +8 -0
- package/src/shared-types.ts +148 -55
- package/src/status/builders.ts +69 -6
- package/src/status/chat-tail-hot-sessions.ts +117 -2
- package/src/status/normalize.ts +2 -0
- package/src/status/reporter.ts +19 -1
- package/src/status/snapshot.ts +100 -27
- package/src/system/hash.ts +23 -0
- package/src/system/host-memory.ts +29 -12
- package/src/system/load-better-sqlite3.ts +68 -0
- package/src/types.ts +26 -6
- package/dist/cli-adapters/terminal-backends/xterm-backend.d.ts +0 -17
- package/dist/mesh/mesh-sync.d.ts +0 -53
- package/src/cli-adapters/terminal-backends/ghostty-vt-backend.d.ts +0 -16
- package/src/cli-adapters/terminal-backends/xterm-backend.ts +0 -97
- package/src/mesh/mesh-sync.ts +0 -111
package/src/daemon/dev-server.ts
CHANGED
|
@@ -1050,547 +1050,6 @@ export class DevServer implements DevServerContext {
|
|
|
1050
1050
|
return handleAutoImplement(this, type, req, res);
|
|
1051
1051
|
}
|
|
1052
1052
|
|
|
1053
|
-
private buildAutoImplPrompt(
|
|
1054
|
-
type: string,
|
|
1055
|
-
provider: any,
|
|
1056
|
-
providerDir: string,
|
|
1057
|
-
functions: string[],
|
|
1058
|
-
domContext: any,
|
|
1059
|
-
referenceScripts: Record<string, string>,
|
|
1060
|
-
userComment?: string,
|
|
1061
|
-
referenceType?: string | null,
|
|
1062
|
-
): string {
|
|
1063
|
-
if (provider.category === 'cli') {
|
|
1064
|
-
return this.buildCliAutoImplPrompt(type, provider, providerDir, functions, referenceScripts, userComment, referenceType);
|
|
1065
|
-
}
|
|
1066
|
-
|
|
1067
|
-
const lines: string[] = [];
|
|
1068
|
-
|
|
1069
|
-
// ── System instructions ──
|
|
1070
|
-
lines.push('You are implementing browser automation scripts for an IDE provider.');
|
|
1071
|
-
lines.push('Be concise. Do NOT explain your reasoning. Just edit files directly.');
|
|
1072
|
-
lines.push('');
|
|
1073
|
-
|
|
1074
|
-
// ── Target ──
|
|
1075
|
-
lines.push(`# Target: ${provider.name || type} (${type})`);
|
|
1076
|
-
lines.push(`Provider directory: \`${providerDir}\``);
|
|
1077
|
-
lines.push('');
|
|
1078
|
-
|
|
1079
|
-
// ── funcToFile mapping (needed early for file classification) ──
|
|
1080
|
-
const funcToFile: Record<string, string> = {
|
|
1081
|
-
readChat: 'read_chat.js', sendMessage: 'send_message.js',
|
|
1082
|
-
resolveAction: 'resolve_action.js', listSessions: 'list_sessions.js',
|
|
1083
|
-
listChats: 'list_chats.js', switchSession: 'switch_session.js',
|
|
1084
|
-
newSession: 'new_session.js', focusEditor: 'focus_editor.js',
|
|
1085
|
-
openPanel: 'open_panel.js', listModels: 'list_models.js',
|
|
1086
|
-
listModes: 'list_modes.js', setModel: 'set_model.js', setMode: 'set_mode.js',
|
|
1087
|
-
};
|
|
1088
|
-
const targetFileNames = new Set(functions.map(fn => funcToFile[fn]).filter(Boolean));
|
|
1089
|
-
|
|
1090
|
-
// ── Existing target files (inline, so no reading needed) ──
|
|
1091
|
-
const scriptsDir = path.join(providerDir, 'scripts');
|
|
1092
|
-
const latestScriptsDir = this.getLatestScriptVersionDir(scriptsDir);
|
|
1093
|
-
if (latestScriptsDir) {
|
|
1094
|
-
lines.push(`Scripts version directory: \`${latestScriptsDir}\``);
|
|
1095
|
-
lines.push('');
|
|
1096
|
-
|
|
1097
|
-
// Target files: editable
|
|
1098
|
-
lines.push('## ✏️ Target Files (EDIT THESE)');
|
|
1099
|
-
lines.push('These are the ONLY files you are allowed to modify. Replace the TODO stubs with working implementations.');
|
|
1100
|
-
lines.push('');
|
|
1101
|
-
for (const file of fs.readdirSync(latestScriptsDir)) {
|
|
1102
|
-
if (file.endsWith('.js') && targetFileNames.has(file)) {
|
|
1103
|
-
try {
|
|
1104
|
-
const content = fs.readFileSync(path.join(latestScriptsDir, file), 'utf-8');
|
|
1105
|
-
lines.push(`### \`${file}\` ✏️ EDIT`);
|
|
1106
|
-
lines.push('```javascript');
|
|
1107
|
-
lines.push(content);
|
|
1108
|
-
lines.push('```');
|
|
1109
|
-
lines.push('');
|
|
1110
|
-
} catch { /* skip */ }
|
|
1111
|
-
}
|
|
1112
|
-
}
|
|
1113
|
-
|
|
1114
|
-
// Non-target files: reference only
|
|
1115
|
-
const refFiles = fs.readdirSync(latestScriptsDir).filter(f => f.endsWith('.js') && !targetFileNames.has(f));
|
|
1116
|
-
if (refFiles.length > 0) {
|
|
1117
|
-
lines.push('## 🔒 Other Scripts (REFERENCE ONLY — DO NOT EDIT)');
|
|
1118
|
-
lines.push('These files are shown for context only. Do NOT modify them under any circumstances.');
|
|
1119
|
-
lines.push('');
|
|
1120
|
-
for (const file of refFiles) {
|
|
1121
|
-
try {
|
|
1122
|
-
const content = fs.readFileSync(path.join(latestScriptsDir, file), 'utf-8');
|
|
1123
|
-
lines.push(`### \`${file}\` 🔒`);
|
|
1124
|
-
lines.push('```javascript');
|
|
1125
|
-
lines.push(content);
|
|
1126
|
-
lines.push('```');
|
|
1127
|
-
lines.push('');
|
|
1128
|
-
} catch { /* skip */ }
|
|
1129
|
-
}
|
|
1130
|
-
}
|
|
1131
|
-
}
|
|
1132
|
-
|
|
1133
|
-
// ── DOM context ──
|
|
1134
|
-
if (domContext) {
|
|
1135
|
-
lines.push('## Live DOM Analysis (from CDP)');
|
|
1136
|
-
lines.push('Use these selectors in your implementations:');
|
|
1137
|
-
lines.push('```json');
|
|
1138
|
-
lines.push(JSON.stringify(domContext, null, 2));
|
|
1139
|
-
lines.push('```');
|
|
1140
|
-
lines.push('');
|
|
1141
|
-
}
|
|
1142
|
-
|
|
1143
|
-
// ── Reference implementation ── (funcToFile already defined above)
|
|
1144
|
-
|
|
1145
|
-
if (Object.keys(referenceScripts).length > 0) {
|
|
1146
|
-
lines.push(`## Reference Implementation (from ${referenceType || 'antigravity'} provider)`);
|
|
1147
|
-
lines.push('These are WORKING scripts from another IDE. Adapt the PATTERNS (not selectors) for the target IDE.');
|
|
1148
|
-
lines.push('');
|
|
1149
|
-
for (const fn of functions) {
|
|
1150
|
-
const fileName = funcToFile[fn];
|
|
1151
|
-
if (fileName && referenceScripts[fileName]) {
|
|
1152
|
-
lines.push(`### ${fn} → \`${fileName}\``);
|
|
1153
|
-
lines.push('```javascript');
|
|
1154
|
-
lines.push(referenceScripts[fileName]);
|
|
1155
|
-
lines.push('```');
|
|
1156
|
-
lines.push('');
|
|
1157
|
-
}
|
|
1158
|
-
}
|
|
1159
|
-
if (referenceScripts['scripts.js']) {
|
|
1160
|
-
lines.push('### Router → `scripts.js`');
|
|
1161
|
-
lines.push('```javascript');
|
|
1162
|
-
lines.push(referenceScripts['scripts.js']);
|
|
1163
|
-
lines.push('```');
|
|
1164
|
-
lines.push('');
|
|
1165
|
-
}
|
|
1166
|
-
}
|
|
1167
|
-
|
|
1168
|
-
// ── Markdown Guides (Provider Fix) ──
|
|
1169
|
-
const docsDir = path.join(providerDir, '../../docs');
|
|
1170
|
-
const loadGuide = (name: string) => {
|
|
1171
|
-
try {
|
|
1172
|
-
const p = path.join(docsDir, name);
|
|
1173
|
-
if (fs.existsSync(p)) return fs.readFileSync(p, 'utf-8');
|
|
1174
|
-
} catch { /* ignore */ }
|
|
1175
|
-
return null;
|
|
1176
|
-
};
|
|
1177
|
-
|
|
1178
|
-
const providerGuide = loadGuide('PROVIDER_GUIDE.md');
|
|
1179
|
-
if (providerGuide) {
|
|
1180
|
-
lines.push('## Documentation: PROVIDER_GUIDE.md');
|
|
1181
|
-
lines.push('```markdown');
|
|
1182
|
-
lines.push(providerGuide);
|
|
1183
|
-
lines.push('```');
|
|
1184
|
-
lines.push('');
|
|
1185
|
-
}
|
|
1186
|
-
|
|
1187
|
-
const cdpGuide = loadGuide('CDP_SELECTOR_GUIDE.md');
|
|
1188
|
-
if (cdpGuide) {
|
|
1189
|
-
lines.push('## Documentation: CDP_SELECTOR_GUIDE.md');
|
|
1190
|
-
lines.push('```markdown');
|
|
1191
|
-
lines.push(cdpGuide);
|
|
1192
|
-
lines.push('```');
|
|
1193
|
-
lines.push('');
|
|
1194
|
-
}
|
|
1195
|
-
|
|
1196
|
-
// ── Task ──
|
|
1197
|
-
lines.push('## Task');
|
|
1198
|
-
lines.push(`Edit files in \`${providerDir}\` to implement: **${functions.join(', ')}**`);
|
|
1199
|
-
lines.push('');
|
|
1200
|
-
|
|
1201
|
-
// ── Rules ──
|
|
1202
|
-
lines.push('## Rules');
|
|
1203
|
-
lines.push('0. **🚫 SCOPE CONSTRAINT**: You may ONLY edit files marked ✏️ EDIT above. ALL other files are READ-ONLY. Do NOT modify, rewrite, refactor, or "improve" any file not explicitly marked as editable — even if you notice bugs or improvements. No exceptions.');
|
|
1204
|
-
lines.push('1. **Scripts WITHOUT params** → IIFE: `(() => { ... })()`');
|
|
1205
|
-
lines.push('2. **Scripts WITH params** → arrow: `(params) => { ... }` — router calls `(${script})(${JSON.stringify(params)})`');
|
|
1206
|
-
lines.push('3. If live DOM analysis is included above, use it. Otherwise, discover selectors yourself via CDP before coding.');
|
|
1207
|
-
lines.push('4. Always wrap in try-catch, return `JSON.stringify(result)`');
|
|
1208
|
-
lines.push('5. Do NOT modify `scripts.js` router — only edit individual `*.js` files');
|
|
1209
|
-
lines.push('6. All scripts run in the browser (CDP evaluate) — use DOM APIs only');
|
|
1210
|
-
lines.push('7. **Cross-Platform Compatibility**: If you use ARIA labels that contain keyboard shortcuts (e.g., `Cascade (⌘L)`), you MUST use substring matches (`aria-label*="Cascade"`) or handle both macOS (`⌘`, `Cmd`) and Windows (`Ctrl`) so the script does not break on other operating systems.');
|
|
1211
|
-
lines.push('8. **CRITICAL: DO NOT explore the filesystem or read other providers.** The reference implementation pattern is already provided below. Do not run `find`, `rg`, or `cat` on upstream providers. Doing so wastes context tokens and will crash the agent session. Focus entirely on modifying the target files.');
|
|
1212
|
-
lines.push('9. Do NOT delete any files. Implement the logic by replacing the empty stubs.');
|
|
1213
|
-
lines.push('');
|
|
1214
|
-
|
|
1215
|
-
// ── Output contracts ──
|
|
1216
|
-
lines.push('## Required Return Format');
|
|
1217
|
-
lines.push('| Function | Return JSON |');
|
|
1218
|
-
lines.push('|---|---|');
|
|
1219
|
-
lines.push('| readChat | `{ id, status, title, messages: [{role, content, index, kind?, meta?}], inputContent, activeModal, controlValues?, summaryMetadata? }` — optional `kind`: standard, thought, tool, terminal; prefer explicit `controlValues` for current selections and `summaryMetadata` for compact always-visible UI metadata |');
|
|
1220
|
-
lines.push('| sendMessage | `{ sent: false, needsTypeAndSend: true, selector }` |');
|
|
1221
|
-
lines.push('| resolveAction | `{ resolved: true/false, clicked? }` |');
|
|
1222
|
-
lines.push('| listSessions | `{ sessions: [{ id, title, active, index }] }` |');
|
|
1223
|
-
lines.push('| switchSession | `{ switched: true/false }` |');
|
|
1224
|
-
lines.push('| newSession | `{ created: true/false }` |');
|
|
1225
|
-
lines.push('| listModels | `{ models: [{ name, id }], current }` |');
|
|
1226
|
-
lines.push('| setModel | `{ success: true/false }` |');
|
|
1227
|
-
lines.push('| listModes | `{ modes: [{ name, id }], current }` |');
|
|
1228
|
-
lines.push('| setMode | `{ success: true/false }` |');
|
|
1229
|
-
lines.push('| focusEditor | `{ focused: true/false, error? }` |');
|
|
1230
|
-
lines.push('| openPanel | `{ opened: true/false, visible: true/false, focused?: true, error? }` |');
|
|
1231
|
-
lines.push('');
|
|
1232
|
-
|
|
1233
|
-
// ── readChat.status lifecycle spec ──
|
|
1234
|
-
lines.push('## 🔴 CRITICAL: readChat `status` Lifecycle');
|
|
1235
|
-
lines.push('The `status` field in readChat controls how the dashboard and daemon auto-approve-loop behave.');
|
|
1236
|
-
lines.push('Getting this wrong will break the entire automation pipeline. The status MUST reflect the ACTUAL current state:');
|
|
1237
|
-
lines.push('');
|
|
1238
|
-
lines.push('| Status | When to use | How to detect |');
|
|
1239
|
-
lines.push('|---|---|---|');
|
|
1240
|
-
lines.push('| `idle` | AI is NOT generating, no approval needed | Default state. No stop button, no spinners, no approval pills/buttons |');
|
|
1241
|
-
lines.push('| `generating` | AI is actively streaming/thinking | ANY of: (1) Submit button icon SVG changes (e.g. arrow→stop square, fill="none"→fill="currentColor"), (2) Stop/Cancel button visible, (3) CSS animation, (4) Structural markers (aria-labels that only appear during generation) |');
|
|
1242
|
-
lines.push('| `waiting_approval` | AI stopped and needs user action | Actionable buttons like Run/Skip/Accept/Reject are visible AND clickable |');
|
|
1243
|
-
lines.push('');
|
|
1244
|
-
lines.push('### ⚠️ Status Detection Gotchas (MUST READ!)');
|
|
1245
|
-
lines.push('1. **DO NOT rely on button text/labels in the user\'s language.** OS locale may be Korean, Japanese, etc. Button text like "Cancel" or "Stop" will be localized. Instead, detect STRUCTURAL indicators: SVG icon changes, CSS classes, aria-labels from the extension\'s own React/Radix UI (which stay in English regardless of OS locale).');
|
|
1246
|
-
lines.push('2. **Use sendMessage to CREATE a generating state, then CAPTURE the DOM.** Send a LONG prompt (e.g. "Write an extremely detailed 5000-word essay...") so the AI takes 10+ seconds. Then periodically capture the DOM during generation to find which elements appear/change. Compare idle vs generating DOM snapshots to find reliable structural markers.');
|
|
1247
|
-
lines.push('3. **Look for SVG icon changes in the submit button.** Many IDEs change the submit button icon from an arrow (send) to a square (stop) during generation. Check the SVG `fill` attribute or path data.');
|
|
1248
|
-
lines.push('4. **FALSE POSITIVES from old messages**: Chat history may contain text like "Command Awaiting Approval" from PAST turns. ONLY match small leaf elements (under 80 chars) or use explicit button/pill selectors.');
|
|
1249
|
-
lines.push('5. **Awaiting Approval pill without actions**: Some IDEs show a floating pill/banner that is just a scroll-to indicator. If NO actionable buttons exist, the status should be `idle`, NOT `waiting_approval`.');
|
|
1250
|
-
lines.push('6. **activeModal must include actions**: When `status` is `waiting_approval`, the `activeModal` object MUST include a non-empty `actions` array.');
|
|
1251
|
-
lines.push('');
|
|
1252
|
-
|
|
1253
|
-
lines.push('## Action');
|
|
1254
|
-
lines.push('1. Edit the script files to implement working code');
|
|
1255
|
-
lines.push('2. After editing, TEST each function using the DevConsole API (see below)');
|
|
1256
|
-
lines.push('3. If a test fails, fix the implementation and re-test');
|
|
1257
|
-
lines.push('4. **IMPORTANT VERIFICATION LOGIC**: When verifying your implementation, beware of state contamination! You MUST perform strict Integration Testing:');
|
|
1258
|
-
lines.push(' - `openPanel`: Toggle buttons are usually located in the top header, sidebar, or activity bar. Prefer finding and clicking these native UI buttons over extreme CSS injection hacks if possible.');
|
|
1259
|
-
lines.push(' - `listSessions`: If sessions are unmounted when the panel is closed, try to explicitly interact with the UI to open the history/sessions view (e.g., clicking a history icon usually found near the chat header) BEFORE scraping.');
|
|
1260
|
-
lines.push(' - `switchSession`: Prove your switch was successful by subsequently calling `readChat` and explicitly checking that the chat context has actually changed.');
|
|
1261
|
-
lines.push('');
|
|
1262
|
-
|
|
1263
|
-
// ── DevConsole API for verification ──
|
|
1264
|
-
lines.push('## DOM Exploration');
|
|
1265
|
-
if (domContext) {
|
|
1266
|
-
lines.push('A lightweight DOM snapshot is included above, but you MUST still verify selectors yourself before finalizing the scripts.');
|
|
1267
|
-
} else {
|
|
1268
|
-
lines.push('No DOM snapshot is included here. You MUST use your command-line tools to discover the IDE structure dynamically.');
|
|
1269
|
-
}
|
|
1270
|
-
lines.push('');
|
|
1271
|
-
lines.push('### 1. Evaluate JS to explore IDE DOM');
|
|
1272
|
-
lines.push('Use cURL to run JavaScript inside the IDE:');
|
|
1273
|
-
lines.push('```bash');
|
|
1274
|
-
lines.push(`curl -sS -X POST http://127.0.0.1:${DEV_SERVER_PORT}/api/cdp/evaluate \\`);
|
|
1275
|
-
lines.push(` -H "Content-Type: application/json" \\`);
|
|
1276
|
-
lines.push(` -d '{"expression": "document.body.innerHTML.substring(0, 1000)", "ideType": "${type}"}'`);
|
|
1277
|
-
lines.push('```');
|
|
1278
|
-
lines.push('');
|
|
1279
|
-
lines.push('### 2. Test your generated function');
|
|
1280
|
-
lines.push('Once you save the file, test it by running:');
|
|
1281
|
-
lines.push('```bash');
|
|
1282
|
-
lines.push(`curl -X POST http://127.0.0.1:${DEV_SERVER_PORT}/api/providers/reload`);
|
|
1283
|
-
lines.push(`curl -sS -X POST http://127.0.0.1:${DEV_SERVER_PORT}/api/scripts/run -H "Content-Type: application/json" -d '{"script": "readChat", "type": "${type}", "ideType": "${type}"}'`);
|
|
1284
|
-
lines.push('```');
|
|
1285
|
-
lines.push('');
|
|
1286
|
-
lines.push('### Task Workflow');
|
|
1287
|
-
lines.push('1. Write bash scripts to `curl` the CDP evaluate API above to find exactly where `.chat-message`, etc., are located.');
|
|
1288
|
-
lines.push('2. Iteratively explore until you are confident in your selectors.');
|
|
1289
|
-
lines.push('3. Edit the `.js` files using the selectors you discovered.');
|
|
1290
|
-
lines.push('4. Reload providers and TEST your script via the API.');
|
|
1291
|
-
lines.push('');
|
|
1292
|
-
lines.push('### 🔥 Advanced UI Parsing (CRUCIAL for `readChat`)');
|
|
1293
|
-
lines.push('Your `readChat` must flawlessly parse complex UI elements (tables, code blocks, tool calls, and AI thoughts). The quality must match the `antigravity` reference.');
|
|
1294
|
-
lines.push('To achieve this, you MUST generate a live test scenario:');
|
|
1295
|
-
lines.push(`1. Early in your process, send a rich prompt to the IDE using the API:`);
|
|
1296
|
-
lines.push(` \`curl -sS -X POST http://127.0.0.1:${DEV_SERVER_PORT}/api/scripts/run -H "Content-Type: application/json" -d '{"script": "sendMessage", "type": "${type}", "ideType": "${type}", "args": {"message": "Write a python script, draw a markdown table, use a tool, and show your reasoning/thought process"}}'\``);
|
|
1297
|
-
lines.push('2. Wait a few seconds for the IDE AI to generate these elements in the UI.');
|
|
1298
|
-
lines.push('3. Use CDP evaluate to deeply inspect the DOM structure of the newly generated tables, code blocks, thought blocks, and tool calls.');
|
|
1299
|
-
lines.push('4. Ensure `readChat` extracts `content` with precise markdown formatting (especially for tables/code) and assigns correct `kind` tags (`thought`, `tool`, `terminal`).');
|
|
1300
|
-
lines.push('');
|
|
1301
|
-
|
|
1302
|
-
// ── Mandatory Integration Test ──
|
|
1303
|
-
lines.push('## 🧪 MANDATORY: Status Integration Test');
|
|
1304
|
-
lines.push('Before finishing, you MUST run this end-to-end test to verify readChat status transitions work:');
|
|
1305
|
-
lines.push('');
|
|
1306
|
-
lines.push('### Step 1: Baseline — confirm idle');
|
|
1307
|
-
lines.push('```bash');
|
|
1308
|
-
lines.push(`curl -X POST http://127.0.0.1:${DEV_SERVER_PORT}/api/providers/reload`);
|
|
1309
|
-
lines.push(`RESULT=$(curl -sS -X POST http://127.0.0.1:${DEV_SERVER_PORT}/api/scripts/run -H "Content-Type: application/json" -d '{"script": "readChat", "type": "${type}", "ideType": "${type}"}')`);
|
|
1310
|
-
lines.push(`echo "$RESULT" | python3 -c "import sys,json; d=json.load(sys.stdin); r=d.get('result',d); r=json.loads(r) if isinstance(r,str) else r; assert r.get('status')=='idle', f'Expected idle, got {r.get(chr(34)+chr(115)+chr(116)+chr(97)+chr(116)+chr(117)+chr(115)+chr(34))}'; print('Step 1 PASS: status=idle')"`);
|
|
1311
|
-
lines.push('```');
|
|
1312
|
-
lines.push('');
|
|
1313
|
-
lines.push('### Step 2: Send a LONG message that triggers extended generation (10+ seconds)');
|
|
1314
|
-
lines.push('```bash');
|
|
1315
|
-
lines.push(`curl -sS -X POST http://127.0.0.1:${DEV_SERVER_PORT}/api/scripts/run -H "Content-Type: application/json" -d '{"script": "sendMessage", "type": "${type}", "ideType": "${type}", "args": {"message": "Write an extremely detailed 5000-word essay about the history of artificial intelligence from Alan Turing to 2025. Be very thorough and verbose."}}'`);
|
|
1316
|
-
lines.push('sleep 3');
|
|
1317
|
-
lines.push('```');
|
|
1318
|
-
lines.push('');
|
|
1319
|
-
lines.push('### Step 3: Check generating OR completed');
|
|
1320
|
-
lines.push('The AI may still be generating OR may have finished already. Either generating or idle is acceptable:');
|
|
1321
|
-
lines.push('```bash');
|
|
1322
|
-
lines.push(`RESULT=$(curl -sS -X POST http://127.0.0.1:${DEV_SERVER_PORT}/api/scripts/run -H "Content-Type: application/json" -d '{"script": "readChat", "type": "${type}", "ideType": "${type}"}')`);
|
|
1323
|
-
lines.push(`echo "$RESULT" | python3 -c "import sys,json; d=json.load(sys.stdin); r=d.get('result',d); r=json.loads(r) if isinstance(r,str) else r; s=r.get('status'); assert s in ('generating','idle','waiting_approval'), f'Unexpected: {s}'; print(f'Step 3 PASS: status={s}')"`);
|
|
1324
|
-
lines.push('```');
|
|
1325
|
-
lines.push('');
|
|
1326
|
-
lines.push('### Step 4: Wait for completion and verify new message');
|
|
1327
|
-
lines.push('```bash');
|
|
1328
|
-
lines.push('sleep 10');
|
|
1329
|
-
lines.push(`RESULT=$(curl -sS -X POST http://127.0.0.1:${DEV_SERVER_PORT}/api/scripts/run -H "Content-Type: application/json" -d '{"script": "readChat", "type": "${type}", "ideType": "${type}"}')`);
|
|
1330
|
-
lines.push(`echo "$RESULT" | python3 -c "import sys,json; d=json.load(sys.stdin); r=d.get('result',d); r=json.loads(r) if isinstance(r,str) else r; s=r.get('status'); msgs=r.get('messages',[]); assert s=='idle', f'Expected idle, got {s}'; assert len(msgs)>0, 'No messages'; print(f'Step 4 PASS: status={s}, messages={len(msgs)}')"`);
|
|
1331
|
-
lines.push('```');
|
|
1332
|
-
lines.push('');
|
|
1333
|
-
lines.push('If ANY step fails, fix your implementation and re-run the test. Do NOT finish until all 4 steps pass.');
|
|
1334
|
-
lines.push('');
|
|
1335
|
-
// ── User-provided additional instructions ──
|
|
1336
|
-
if (userComment) {
|
|
1337
|
-
lines.push('## ⚠️ User Instructions (HIGH PRIORITY)');
|
|
1338
|
-
lines.push('The user has provided the following additional instructions. Follow them strictly:');
|
|
1339
|
-
lines.push('');
|
|
1340
|
-
lines.push(userComment);
|
|
1341
|
-
lines.push('');
|
|
1342
|
-
}
|
|
1343
|
-
|
|
1344
|
-
lines.push('Start NOW. Do not ask for permission. Explore the DOM -> Code -> Test.');
|
|
1345
|
-
|
|
1346
|
-
return lines.join('\n');
|
|
1347
|
-
}
|
|
1348
|
-
|
|
1349
|
-
private buildCliAutoImplPrompt(
|
|
1350
|
-
type: string,
|
|
1351
|
-
provider: any,
|
|
1352
|
-
providerDir: string,
|
|
1353
|
-
functions: string[],
|
|
1354
|
-
referenceScripts: Record<string, string>,
|
|
1355
|
-
userComment?: string,
|
|
1356
|
-
referenceType?: string | null,
|
|
1357
|
-
): string {
|
|
1358
|
-
const lines: string[] = [];
|
|
1359
|
-
|
|
1360
|
-
lines.push('You are implementing PTY parsing scripts for a CLI provider.');
|
|
1361
|
-
lines.push('Be concise. Do NOT explain your reasoning. Edit files directly and verify with the local DevServer.');
|
|
1362
|
-
lines.push('');
|
|
1363
|
-
|
|
1364
|
-
lines.push(`# Target: ${provider.name || type} (${type})`);
|
|
1365
|
-
lines.push(`Provider directory: \`${providerDir}\``);
|
|
1366
|
-
lines.push('Provider category: `cli`');
|
|
1367
|
-
lines.push('');
|
|
1368
|
-
|
|
1369
|
-
const funcToFile: Record<string, string> = {
|
|
1370
|
-
parseSession: 'parse_session.js',
|
|
1371
|
-
detectStatus: 'detect_status.js',
|
|
1372
|
-
parseApproval: 'parse_approval.js',
|
|
1373
|
-
};
|
|
1374
|
-
const targetFileNames = new Set(functions.map(fn => funcToFile[fn]).filter(Boolean));
|
|
1375
|
-
|
|
1376
|
-
const scriptsDir = path.join(providerDir, 'scripts');
|
|
1377
|
-
const latestScriptsDir = this.getLatestScriptVersionDir(scriptsDir);
|
|
1378
|
-
if (latestScriptsDir) {
|
|
1379
|
-
lines.push(`Scripts version directory: \`${latestScriptsDir}\``);
|
|
1380
|
-
lines.push('');
|
|
1381
|
-
|
|
1382
|
-
// Target files: editable
|
|
1383
|
-
lines.push('## ✏️ Target Files (EDIT THESE)');
|
|
1384
|
-
lines.push('These are the ONLY files you are allowed to modify. Replace TODO or heuristic-only logic with working PTY-aware implementations.');
|
|
1385
|
-
lines.push('');
|
|
1386
|
-
for (const file of fs.readdirSync(latestScriptsDir)) {
|
|
1387
|
-
if (!file.endsWith('.js')) continue;
|
|
1388
|
-
if (!targetFileNames.has(file)) continue;
|
|
1389
|
-
try {
|
|
1390
|
-
const content = fs.readFileSync(path.join(latestScriptsDir, file), 'utf-8');
|
|
1391
|
-
lines.push(`### \`${file}\` ✏️ EDIT`);
|
|
1392
|
-
lines.push('```javascript');
|
|
1393
|
-
lines.push(content);
|
|
1394
|
-
lines.push('```');
|
|
1395
|
-
lines.push('');
|
|
1396
|
-
} catch {
|
|
1397
|
-
// ignore
|
|
1398
|
-
}
|
|
1399
|
-
}
|
|
1400
|
-
|
|
1401
|
-
// Non-target files: reference only
|
|
1402
|
-
const refFiles = fs.readdirSync(latestScriptsDir).filter(f => f.endsWith('.js') && !targetFileNames.has(f));
|
|
1403
|
-
if (refFiles.length > 0) {
|
|
1404
|
-
lines.push('## 🔒 Other Scripts (REFERENCE ONLY — DO NOT EDIT)');
|
|
1405
|
-
lines.push('These files are shown for context only. Do NOT modify them under any circumstances.');
|
|
1406
|
-
lines.push('');
|
|
1407
|
-
for (const file of refFiles) {
|
|
1408
|
-
try {
|
|
1409
|
-
const content = fs.readFileSync(path.join(latestScriptsDir, file), 'utf-8');
|
|
1410
|
-
lines.push(`### \`${file}\` 🔒`);
|
|
1411
|
-
lines.push('```javascript');
|
|
1412
|
-
lines.push(content);
|
|
1413
|
-
lines.push('```');
|
|
1414
|
-
lines.push('');
|
|
1415
|
-
} catch {
|
|
1416
|
-
// ignore
|
|
1417
|
-
}
|
|
1418
|
-
}
|
|
1419
|
-
}
|
|
1420
|
-
}
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
if (Object.keys(referenceScripts).length > 0) {
|
|
1425
|
-
lines.push(`## Reference Implementation (from ${referenceType || 'another CLI'} provider)`);
|
|
1426
|
-
lines.push('These are working CLI PTY parser scripts. Reuse the parsing shape and runtime contract, but adapt to the target CLI screen.');
|
|
1427
|
-
lines.push('');
|
|
1428
|
-
for (const fn of functions) {
|
|
1429
|
-
const fileName = funcToFile[fn];
|
|
1430
|
-
if (fileName && referenceScripts[fileName]) {
|
|
1431
|
-
lines.push(`### ${fn} → \`${fileName}\``);
|
|
1432
|
-
lines.push('```javascript');
|
|
1433
|
-
lines.push(referenceScripts[fileName]);
|
|
1434
|
-
lines.push('```');
|
|
1435
|
-
lines.push('');
|
|
1436
|
-
}
|
|
1437
|
-
}
|
|
1438
|
-
if (referenceScripts['scripts.js']) {
|
|
1439
|
-
lines.push('### Router → `scripts.js`');
|
|
1440
|
-
lines.push('```javascript');
|
|
1441
|
-
lines.push(referenceScripts['scripts.js']);
|
|
1442
|
-
lines.push('```');
|
|
1443
|
-
lines.push('');
|
|
1444
|
-
}
|
|
1445
|
-
}
|
|
1446
|
-
|
|
1447
|
-
// ── Markdown Guides (Provider Fix) ──
|
|
1448
|
-
const docsDir = path.join(providerDir, '../../docs');
|
|
1449
|
-
const loadGuide = (name: string) => {
|
|
1450
|
-
try {
|
|
1451
|
-
const p = path.join(docsDir, name);
|
|
1452
|
-
if (fs.existsSync(p)) return fs.readFileSync(p, 'utf-8');
|
|
1453
|
-
} catch { /* ignore */ }
|
|
1454
|
-
return null;
|
|
1455
|
-
};
|
|
1456
|
-
|
|
1457
|
-
const providerGuide = loadGuide('PROVIDER_GUIDE.md');
|
|
1458
|
-
if (providerGuide) {
|
|
1459
|
-
lines.push('## Documentation: PROVIDER_GUIDE.md');
|
|
1460
|
-
lines.push('```markdown');
|
|
1461
|
-
lines.push(providerGuide);
|
|
1462
|
-
lines.push('```');
|
|
1463
|
-
lines.push('');
|
|
1464
|
-
}
|
|
1465
|
-
|
|
1466
|
-
lines.push('## Runtime Contract');
|
|
1467
|
-
lines.push('The daemon runtime is already implemented in `packages/daemon-core/src/cli-adapters/provider-cli-adapter.ts`.');
|
|
1468
|
-
lines.push('Your scripts receive PTY-derived input and must return plain JS objects.');
|
|
1469
|
-
lines.push('');
|
|
1470
|
-
lines.push('| Function | Input | Return |');
|
|
1471
|
-
lines.push('|---|---|---|');
|
|
1472
|
-
lines.push('| `parseSession` | `{ buffer, rawBuffer, recentBuffer, screenText, messages, partialResponse }` | `{ id, status, title, messages, activeModal }` |');
|
|
1473
|
-
lines.push('| `detectStatus` | `{ tail, screenText, rawBuffer }` | `idle`, `generating`, `waiting_approval`, or `error` |');
|
|
1474
|
-
lines.push('| `parseApproval` | `{ buffer, rawBuffer, tail }` | `{ message, buttons }` or `null` |');
|
|
1475
|
-
lines.push('');
|
|
1476
|
-
lines.push('## Primary Source of Truth');
|
|
1477
|
-
lines.push('The runtime now provides a reliable current-screen snapshot. Treat `screenText` as the primary source of truth for the LIVE visible UI.');
|
|
1478
|
-
lines.push('That means:');
|
|
1479
|
-
lines.push('- Use `screenText` first for prompt detection, approval UI, status, and visible assistant content.');
|
|
1480
|
-
lines.push('- Use `rawBuffer` only as supporting evidence when ANSI/style/cursor cues matter.');
|
|
1481
|
-
lines.push('- Use `buffer` only when the visible screen does not contain enough text to recover the latest assistant answer.');
|
|
1482
|
-
lines.push('- Do NOT build the parser around stale transcript noise if the current screen already gives the answer.');
|
|
1483
|
-
lines.push('');
|
|
1484
|
-
|
|
1485
|
-
lines.push('## Rules');
|
|
1486
|
-
lines.push('0. **🚫 SCOPE CONSTRAINT**: You may ONLY edit files marked ✏️ EDIT above. ALL other files are READ-ONLY. Do NOT modify, rewrite, refactor, or "improve" any file not explicitly marked as editable — even if you notice bugs or improvements. No exceptions.');
|
|
1487
|
-
lines.push('1. These scripts run in Node.js CommonJS, not in the browser. Do NOT use DOM APIs.');
|
|
1488
|
-
lines.push('2. Prefer `screenText` for current visible UI state. It is now the PTY equivalent of a trustworthy live DOM snapshot.');
|
|
1489
|
-
lines.push('3. Use `messages` as prior transcript state so redraws do not duplicate old turns on every parse.');
|
|
1490
|
-
lines.push('4. Use `partialResponse` for the actively streaming assistant text when status is `generating`.');
|
|
1491
|
-
lines.push('5. `detectStatus` must stay lightweight and current-screen-oriented. Prefer the active bottom-of-screen region over stale history.');
|
|
1492
|
-
lines.push('6. `parseApproval` should understand the live approval area and return clean button labels from the CURRENT visible modal.');
|
|
1493
|
-
lines.push('7. Use `rawBuffer` only when ANSI/control-sequence artifacts or style cues matter. Do not depend on raw escape noise unless necessary.');
|
|
1494
|
-
lines.push('8. Keep exports compatible with the existing `scripts.js` router (`module.exports = function ...`).');
|
|
1495
|
-
lines.push('9. Do NOT modify ANY file not explicitly marked ✏️ EDIT above. No exceptions — no "tiny supporting changes" to other files.');
|
|
1496
|
-
lines.push('10. When the verification API returns `instanceId`, keep using that exact instance for follow-up `send`, `resolve`, `raw`, and `stop` calls. Do not assume type-only routing is safe if multiple sessions exist.');
|
|
1497
|
-
lines.push('11. Do NOT repeatedly dump the same target files. Read the target scripts once, reproduce the bug, then move directly to patching.');
|
|
1498
|
-
lines.push('12. If the user instructions include concrete screen text, raw PTY snippets, or a specific repro, treat that as the primary acceptance criteria.');
|
|
1499
|
-
lines.push('13. After the first successful live repro, stop broad diagnosis. Edit the scripts, reload, and verify. Do not burn tokens on repeated re-inspection without code changes.');
|
|
1500
|
-
lines.push('14. If the visible current screen is clean and sufficient, do NOT fall back to complex buffer heuristics. Simpler current-screen parsing is preferred.');
|
|
1501
|
-
lines.push('15. Before changing parser logic, verify whether `provider.json` submit/approval behavior (`sendDelayMs`, `approvalKeys`, submit strategy) is the simpler and more correct fix.');
|
|
1502
|
-
lines.push('');
|
|
1503
|
-
|
|
1504
|
-
lines.push('## Task');
|
|
1505
|
-
lines.push(`Edit files in \`${providerDir}\` to implement: **${functions.join(', ')}**`);
|
|
1506
|
-
lines.push('');
|
|
1507
|
-
|
|
1508
|
-
lines.push('## Verification API');
|
|
1509
|
-
lines.push('Use the DevServer CLI debug endpoints, not DOM/CDP routes.');
|
|
1510
|
-
lines.push('');
|
|
1511
|
-
lines.push('### 1. Launch the target CLI');
|
|
1512
|
-
lines.push('```bash');
|
|
1513
|
-
lines.push(`curl -sS -X POST http://127.0.0.1:${DEV_SERVER_PORT}/api/cli/launch \\`);
|
|
1514
|
-
lines.push(' -H "Content-Type: application/json" \\');
|
|
1515
|
-
lines.push(` -d '{"type":"${type}","workingDir":"${providerDir.replace(/\\/g, '\\\\')}"}'`);
|
|
1516
|
-
lines.push('```');
|
|
1517
|
-
lines.push('');
|
|
1518
|
-
lines.push('### 2. Inspect parsed + raw adapter state');
|
|
1519
|
-
lines.push('```bash');
|
|
1520
|
-
lines.push(`curl -sS http://127.0.0.1:${DEV_SERVER_PORT}/api/cli/debug/${type}`);
|
|
1521
|
-
lines.push(`curl -sS http://127.0.0.1:${DEV_SERVER_PORT}/api/cli/trace/${type}`);
|
|
1522
|
-
lines.push(`curl -sS http://127.0.0.1:${DEV_SERVER_PORT}/api/cli/status`);
|
|
1523
|
-
lines.push('```');
|
|
1524
|
-
lines.push('');
|
|
1525
|
-
lines.push('The debug payload should be read in this priority order:');
|
|
1526
|
-
lines.push('1. `screenText` / current visible state');
|
|
1527
|
-
lines.push('2. parsed `status`, `messages`, `activeModal`');
|
|
1528
|
-
lines.push('3. `rawBuffer` only for style/control-sequence cues');
|
|
1529
|
-
lines.push('4. `buffer` only when the current screen is insufficient');
|
|
1530
|
-
lines.push('');
|
|
1531
|
-
lines.push('Extract the current `instanceId` from the launch or status response and keep using it below.');
|
|
1532
|
-
lines.push('');
|
|
1533
|
-
lines.push('### 3. Send a realistic approval-triggering prompt');
|
|
1534
|
-
lines.push('```bash');
|
|
1535
|
-
lines.push(`curl -sS -X POST http://127.0.0.1:${DEV_SERVER_PORT}/api/cli/send \\`);
|
|
1536
|
-
lines.push(' -H "Content-Type: application/json" \\');
|
|
1537
|
-
lines.push(` -d '{"type":"${type}","instanceId":"<INSTANCE_ID>","text":"Create a file at tmp/adhdev_provider_fix_test.py that prints the current working directory and the squares of 1 through 5, then run python3 tmp/adhdev_provider_fix_test.py and tell me the exact output."}'`);
|
|
1538
|
-
lines.push('```');
|
|
1539
|
-
lines.push('');
|
|
1540
|
-
lines.push('### 4. If approval appears, resolve it until the CLI reaches idle');
|
|
1541
|
-
lines.push('```bash');
|
|
1542
|
-
lines.push(`curl -sS -X POST http://127.0.0.1:${DEV_SERVER_PORT}/api/cli/resolve \\`);
|
|
1543
|
-
lines.push(' -H "Content-Type: application/json" \\');
|
|
1544
|
-
lines.push(` -d '{"type":"${type}","instanceId":"<INSTANCE_ID>","buttonIndex":0}'`);
|
|
1545
|
-
lines.push(`curl -sS -X POST http://127.0.0.1:${DEV_SERVER_PORT}/api/cli/raw \\`);
|
|
1546
|
-
lines.push(' -H "Content-Type: application/json" \\');
|
|
1547
|
-
lines.push(` -d '{"type":"${type}","instanceId":"<INSTANCE_ID>","keys":"1"}'`);
|
|
1548
|
-
lines.push('```');
|
|
1549
|
-
lines.push('');
|
|
1550
|
-
lines.push('Use `resolve` when the parsed modal buttons are correct. Use `raw` when the CLI expects a literal keystroke like `1`, `y`, or Enter. Repeat until idle.');
|
|
1551
|
-
lines.push('');
|
|
1552
|
-
lines.push('### Patch Discipline');
|
|
1553
|
-
lines.push('Once the repro is confirmed, immediately edit the target files. Avoid loops where you keep re-reading long files or re-running the same debug commands without changing code.');
|
|
1554
|
-
lines.push('');
|
|
1555
|
-
lines.push('### 5. Verify the side effects outside the CLI');
|
|
1556
|
-
lines.push('```bash');
|
|
1557
|
-
lines.push('test -f tmp/adhdev_provider_fix_test.py');
|
|
1558
|
-
lines.push('python3 tmp/adhdev_provider_fix_test.py');
|
|
1559
|
-
lines.push('```');
|
|
1560
|
-
lines.push('');
|
|
1561
|
-
lines.push('### 6. Stop the CLI when finished');
|
|
1562
|
-
lines.push('```bash');
|
|
1563
|
-
lines.push(`curl -sS -X POST http://127.0.0.1:${DEV_SERVER_PORT}/api/cli/stop \\`);
|
|
1564
|
-
lines.push(' -H "Content-Type: application/json" \\');
|
|
1565
|
-
lines.push(` -d '{"type":"${type}","instanceId":"<INSTANCE_ID>"}'`);
|
|
1566
|
-
lines.push('```');
|
|
1567
|
-
lines.push('');
|
|
1568
|
-
|
|
1569
|
-
lines.push('## Required Validation');
|
|
1570
|
-
lines.push('1. Confirm `detectStatus` changes sensibly between startup, generating, approval, and idle.');
|
|
1571
|
-
lines.push('2. Confirm `parseSession` produces a stable transcript without duplicating past turns when the PTY redraws.');
|
|
1572
|
-
lines.push('3. Confirm the latest assistant message streams through `partialResponse` while generation is in progress.');
|
|
1573
|
-
lines.push('4. Confirm approval parsing returns meaningful button labels when the CLI requests permission.');
|
|
1574
|
-
lines.push('5. Confirm the Python file was actually created and executed, not just described in chat text.');
|
|
1575
|
-
lines.push('6. Confirm the final assistant transcript includes the exact Python output, including the working directory line and the five square numbers.');
|
|
1576
|
-
lines.push('7. Re-run the debug endpoints after edits. Do NOT finish until the parsed result looks correct.');
|
|
1577
|
-
lines.push('8. Confirm the parser still works after a redraw or scroll change without duplicating transcript history.');
|
|
1578
|
-
lines.push('9. Confirm the implementation prefers current-screen signals over stale history when both are present.');
|
|
1579
|
-
lines.push('');
|
|
1580
|
-
|
|
1581
|
-
if (userComment) {
|
|
1582
|
-
lines.push('## ⚠️ User Instructions (HIGH PRIORITY)');
|
|
1583
|
-
lines.push('The user has provided the following additional instructions. Follow them strictly:');
|
|
1584
|
-
lines.push('');
|
|
1585
|
-
lines.push(userComment);
|
|
1586
|
-
lines.push('');
|
|
1587
|
-
}
|
|
1588
|
-
|
|
1589
|
-
lines.push('Start NOW. Launch the CLI, inspect PTY state, edit the scripts, and verify via the CLI debug endpoints.');
|
|
1590
|
-
|
|
1591
|
-
return lines.join('\n');
|
|
1592
|
-
}
|
|
1593
|
-
|
|
1594
1053
|
private handleAutoImplSSE(type: string, req: http.IncomingMessage, res: http.ServerResponse): void {
|
|
1595
1054
|
handleAutoImplSSE(this, type, req, res);
|
|
1596
1055
|
}
|