@reticlehq/server 3.5.0 → 3.7.0
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/README.md +1 -1
- package/SKILL.md +123 -116
- package/dist/chromium-launch-options.d.ts +3 -1
- package/dist/chromium-launch-options.js +2 -1
- package/dist/command/cli/adhoc-suite.d.ts +14 -0
- package/dist/command/cli/adhoc-suite.js +42 -7
- package/dist/command/cli/adhoc-verdict.d.ts +19 -2
- package/dist/command/cli/adhoc-verdict.js +76 -9
- package/dist/command/cli/answers/gate-exit.d.ts +23 -0
- package/dist/command/cli/answers/gate-exit.js +45 -0
- package/dist/command/cli/answers/gate-hook-message.d.ts +2 -0
- package/dist/command/cli/answers/gate-hook-message.js +3 -1
- package/dist/command/cli/answers/open-note.d.ts +2 -0
- package/dist/command/cli/answers/open-note.js +22 -0
- package/dist/command/cli/auth/device-flow.d.ts +13 -2
- package/dist/command/cli/auth/device-flow.js +17 -0
- package/dist/command/cli/cli-doctor.js +14 -0
- package/dist/command/cli/cli-flow-commands.d.ts +0 -11
- package/dist/command/cli/cli-flow-commands.js +31 -112
- package/dist/command/cli/cli-kill.js +3 -2
- package/dist/command/cli/cli-parse-grammar.d.ts +24 -0
- package/dist/command/cli/cli-parse-grammar.js +75 -0
- package/dist/command/cli/cli-parse-verify.d.ts +2 -0
- package/dist/command/cli/cli-parse-verify.js +18 -0
- package/dist/command/cli/cli-parse.d.ts +19 -28
- package/dist/command/cli/cli-parse.js +82 -182
- package/dist/command/cli/cli-update-commands.d.ts +1 -1
- package/dist/command/cli/cli-update-commands.js +61 -9
- package/dist/command/cli/cli-usage.d.ts +33 -0
- package/dist/command/cli/cli-usage.js +287 -0
- package/dist/command/cli/cli-verify.d.ts +35 -5
- package/dist/command/cli/cli-verify.js +114 -35
- package/dist/command/cli/cloud-cli.d.ts +13 -0
- package/dist/command/cli/cloud-cli.js +192 -341
- package/dist/command/cli/cloud-kit.d.ts +12 -0
- package/dist/command/cli/cloud-kit.js +41 -2
- package/dist/command/cli/cloud-link.d.ts +57 -0
- package/dist/command/cli/cloud-link.js +308 -0
- package/dist/command/cli/cloud-login.d.ts +22 -0
- package/dist/command/cli/cloud-login.js +96 -8
- package/dist/command/cli/context-command.d.ts +1 -0
- package/dist/command/cli/context-command.js +33 -0
- package/dist/command/cli/daemon-start-options.d.ts +3 -0
- package/dist/command/cli/daemon-start-options.js +24 -3
- package/dist/command/cli/doctor/browser/chromium-hint.d.ts +46 -0
- package/dist/command/cli/doctor/browser/chromium-hint.js +99 -1
- package/dist/command/cli/doctor/doctor-coverage-line.d.ts +2 -0
- package/dist/command/cli/doctor/doctor-coverage-line.js +47 -0
- package/dist/command/cli/doctor/doctor-project-line.d.ts +0 -12
- package/dist/command/cli/doctor/doctor-project-line.js +5 -4
- package/dist/command/cli/doctor/doctor-rows.d.ts +6 -0
- package/dist/command/cli/doctor/doctor-rows.js +6 -0
- package/dist/command/cli/doctor/doctor-signing-line.d.ts +38 -0
- package/dist/command/cli/doctor/doctor-signing-line.js +114 -0
- package/dist/command/cli/drive/drive-attach.d.ts +27 -2
- package/dist/command/cli/drive/drive-attach.js +71 -4
- package/dist/command/cli/drive/drive-command.d.ts +2 -1
- package/dist/command/cli/drive/drive-command.js +13 -7
- package/dist/command/cli/known-regression.d.ts +13 -0
- package/dist/command/cli/known-regression.js +34 -0
- package/dist/command/cli/launch/sdk-version-match.d.ts +12 -0
- package/dist/command/cli/launch/sdk-version-match.js +25 -0
- package/dist/command/cli/lifecycle/daemon-lifecycle.js +15 -3
- package/dist/command/cli/mcp-command.d.ts +6 -0
- package/dist/command/cli/mcp-command.js +13 -5
- package/dist/command/cli/ports/port-holder.d.ts +10 -0
- package/dist/command/cli/ports/port-holder.js +25 -1
- package/dist/command/cli/project-name.d.ts +29 -1
- package/dist/command/cli/project-name.js +107 -2
- package/dist/command/cli/setup-mcp-cli.d.ts +17 -1
- package/dist/command/cli/setup-mcp-cli.js +35 -12
- package/dist/command/cli/status/status-lines.d.ts +1 -0
- package/dist/command/cli/status/status-lines.js +47 -2
- package/dist/command/cli/status/workspace-links.d.ts +10 -0
- package/dist/command/cli/status/workspace-links.js +29 -0
- package/dist/command/cli/try-command.d.ts +96 -0
- package/dist/command/cli/try-command.js +362 -0
- package/dist/command/cli/tutorial.d.ts +0 -100
- package/dist/command/cli/tutorial.js +0 -181
- package/dist/command/cli/verify-results.d.ts +19 -0
- package/dist/command/cli/verify-results.js +29 -0
- package/dist/command/cli-onboarding.d.ts +0 -11
- package/dist/command/cli-onboarding.js +0 -15
- package/dist/command/cli.d.ts +20 -0
- package/dist/command/cli.js +130 -104
- package/dist/command/daemon/binding/daemon-status-probe.d.ts +2 -0
- package/dist/command/daemon/binding/daemon-status-probe.js +1 -0
- package/dist/command/daemon/daemon-resilience.js +4 -4
- package/dist/command/daemon/daemon-resolve.d.ts +23 -1
- package/dist/command/daemon/daemon-resolve.js +79 -9
- package/dist/command/setup/agent-writer.d.ts +1 -1
- package/dist/command/setup/agent-writer.js +3 -2
- package/dist/command/setup/bringup/bridge-port.d.ts +3 -1
- package/dist/command/setup/bringup/bridge-port.js +13 -3
- package/dist/command/setup/bringup/connect-lease.d.ts +1 -0
- package/dist/command/setup/bringup/connect-lease.js +1 -0
- package/dist/command/setup/bringup/dev-server-log-cap.js +2 -0
- package/dist/command/setup/bringup/dev-server-wait.d.ts +8 -0
- package/dist/command/setup/bringup/dev-server-wait.js +19 -0
- package/dist/command/setup/bringup/ensure-daemon.js +9 -2
- package/dist/command/setup/init/agent-restart.d.ts +23 -0
- package/dist/command/setup/init/agent-restart.js +28 -0
- package/dist/command/setup/init/init-port.d.ts +14 -1
- package/dist/command/setup/init/init-port.js +32 -2
- package/dist/command/setup/init/init-runtime.d.ts +22 -2
- package/dist/command/setup/init/init-runtime.js +114 -38
- package/dist/command/setup/node-effects.d.ts +2 -0
- package/dist/command/setup/node-effects.js +38 -9
- package/dist/command/setup/probe/existing-app.d.ts +12 -0
- package/dist/command/setup/probe/existing-app.js +14 -0
- package/dist/command/setup/remaining-steps.js +2 -1
- package/dist/command/setup/run-setup.d.ts +34 -9
- package/dist/command/setup/run-setup.js +65 -51
- package/dist/command/setup/setup-command.d.ts +25 -1
- package/dist/command/setup/setup-command.js +59 -4
- package/dist/command/setup/setup-mcp.js +25 -2
- package/dist/command/setup/tauri-signing.d.ts +19 -0
- package/dist/command/setup/tauri-signing.js +79 -0
- package/dist/command/setup/terminal/listeners.d.ts +10 -1
- package/dist/command/setup/terminal/listeners.js +37 -6
- package/dist/command/update/update-nudge.d.ts +9 -0
- package/dist/command/update/update-nudge.js +1 -1
- package/dist/command/update/updater.js +11 -15
- package/dist/command/version/version-nudge.js +3 -0
- package/dist/command/version/version-skew.d.ts +20 -1
- package/dist/command/version/version-skew.js +49 -4
- package/dist/features/crawl/crawl-tools.js +4 -0
- package/dist/features/crawl/crawl.d.ts +6 -0
- package/dist/features/crawl/crawl.js +23 -2
- package/dist/features/exhaust/ledger.d.ts +21 -14
- package/dist/features/exhaust/ledger.js +35 -9
- package/dist/features/harness/app-findings.d.ts +2 -0
- package/dist/features/harness/app-findings.js +52 -0
- package/dist/features/harness/drive-report.d.ts +61 -1
- package/dist/features/harness/drive-report.js +394 -26
- package/dist/features/harness/drive-runs.d.ts +120 -0
- package/dist/features/harness/drive-runs.js +289 -0
- package/dist/features/harness/drivers.d.ts +10 -14
- package/dist/features/harness/drivers.js +10 -14
- package/dist/features/harness/explore/console-pages.d.ts +15 -0
- package/dist/features/harness/explore/console-pages.js +146 -0
- package/dist/features/harness/explore/disparity.d.ts +19 -0
- package/dist/features/harness/explore/disparity.js +71 -0
- package/dist/features/harness/explore/fake-app.d.ts +16 -0
- package/dist/features/harness/explore/fake-app.js +49 -0
- package/dist/features/harness/explore/goal-search.d.ts +26 -0
- package/dist/features/harness/explore/goal-search.js +144 -0
- package/dist/features/harness/explore/page-tree.d.ts +49 -0
- package/dist/features/harness/explore/page-tree.js +148 -0
- package/dist/features/harness/explore/site-map.d.ts +34 -0
- package/dist/features/harness/explore/site-map.js +150 -0
- package/dist/features/harness/fill-values.d.ts +3 -73
- package/dist/features/harness/fill-values.js +3 -169
- package/dist/features/harness/goals.d.ts +82 -0
- package/dist/features/harness/goals.js +330 -0
- package/dist/features/harness/harness.d.ts +51 -1
- package/dist/features/harness/harness.js +207 -6
- package/dist/features/harness/platform/drive-target.d.ts +30 -0
- package/dist/features/harness/platform/drive-target.js +81 -0
- package/dist/features/harness/platform/local-apps.d.ts +127 -0
- package/dist/features/harness/platform/local-apps.js +280 -0
- package/dist/features/harness/platform/persona-credentials.d.ts +20 -0
- package/dist/features/harness/platform/persona-credentials.js +69 -0
- package/dist/features/harness/platform/platform-drives.d.ts +61 -0
- package/dist/features/harness/platform/platform-drives.js +114 -0
- package/dist/features/harness/platform/refusal.d.ts +52 -0
- package/dist/features/harness/platform/refusal.js +71 -0
- package/dist/features/harness/platform/remote-drive.d.ts +186 -0
- package/dist/features/harness/platform/remote-drive.js +378 -0
- package/dist/features/harness/platform/script.d.ts +94 -0
- package/dist/features/harness/platform/script.js +260 -0
- package/dist/features/harness/platform/server-driver.d.ts +54 -0
- package/dist/features/harness/platform/server-driver.js +182 -0
- package/dist/features/harness/platform-config.d.ts +41 -1
- package/dist/features/harness/platform-config.js +106 -9
- package/dist/features/harness/route-guess.d.ts +13 -0
- package/dist/features/harness/route-guess.js +49 -0
- package/dist/features/harness/script/app-controls.d.ts +5 -0
- package/dist/features/harness/script/app-controls.js +40 -0
- package/dist/features/harness/script/lane-ids.d.ts +14 -0
- package/dist/features/harness/script/lane-ids.js +16 -0
- package/dist/features/harness/script/script-run.d.ts +70 -0
- package/dist/features/harness/script/script-run.js +606 -0
- package/dist/features/license/license.d.ts +2 -2
- package/dist/features/visual/step-shots.d.ts +31 -0
- package/dist/features/visual/step-shots.js +231 -0
- package/dist/features/visual/visual-tools.d.ts +10 -1
- package/dist/features/visual/visual-tools.js +62 -17
- package/dist/hooks/client-directory.d.ts +18 -0
- package/dist/hooks/client-directory.js +57 -0
- package/dist/hooks/coding-agents.d.ts +34 -0
- package/dist/hooks/coding-agents.js +117 -0
- package/dist/hooks/driven-by.d.ts +23 -0
- package/dist/hooks/driven-by.js +56 -0
- package/dist/hooks/hook-bus.d.ts +4 -0
- package/dist/hooks/hook-bus.js +18 -0
- package/dist/hooks/hook-commands.js +15 -4
- package/dist/hooks/tool-log.d.ts +9 -0
- package/dist/hooks/tool-log.js +29 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +80 -243
- package/dist/judgement/capsule/capsule-store.d.ts +2 -2
- package/dist/judgement/capsule/causal-summary.d.ts +15 -1
- package/dist/judgement/capsule/causal-summary.js +33 -0
- package/dist/judgement/runs/artifact/build-verification-run.d.ts +1 -1
- package/dist/judgement/runs/artifact/build-verification-run.js +25 -3
- package/dist/judgement/runs/artifact/gap-summary.d.ts +0 -18
- package/dist/judgement/runs/artifact/gap-summary.js +12 -3
- package/dist/judgement/runs/artifact/replay-mapping.d.ts +1 -1
- package/dist/judgement/runs/artifact/replay-mapping.js +37 -11
- package/dist/judgement/runs/artifact/run-store.d.ts +14 -2
- package/dist/judgement/runs/artifact/run-store.js +195 -3
- package/dist/judgement/runs/context-tools.js +59 -1
- package/dist/judgement/runs/default-run-id.d.ts +3 -0
- package/dist/judgement/runs/default-run-id.js +16 -0
- package/dist/judgement/runs/drive-run.d.ts +71 -1
- package/dist/judgement/runs/drive-run.js +317 -5
- package/dist/judgement/runs/repair-prompt.js +1 -1
- package/dist/judgement/runs/resume.d.ts +44 -0
- package/dist/judgement/runs/resume.js +137 -0
- package/dist/judgement/runs/reticle-runner.js +13 -3
- package/dist/judgement/runs/runner-port.d.ts +5 -1
- package/dist/judgement/runs/runner-port.js +8 -2
- package/dist/judgement/runs/verification-sync.d.ts +5 -2
- package/dist/judgement/runs/verification-sync.js +40 -18
- package/dist/language/flows/change/gate.d.ts +10 -0
- package/dist/language/flows/change/gate.js +22 -0
- package/dist/language/flows/decision.js +36 -1
- package/dist/language/flows/fields/flow-secret-field.d.ts +12 -0
- package/dist/language/flows/fields/flow-secret-field.js +25 -2
- package/dist/language/flows/flow-anchor.d.ts +61 -10
- package/dist/language/flows/flow-anchor.js +98 -6
- package/dist/language/flows/flow-cross-step.d.ts +15 -0
- package/dist/language/flows/flow-cross-step.js +21 -0
- package/dist/language/flows/flow-intent.d.ts +1 -0
- package/dist/language/flows/flow-journey.d.ts +6 -0
- package/dist/language/flows/flow-journey.js +20 -0
- package/dist/language/flows/flow-learning.d.ts +4 -0
- package/dist/language/flows/flow-learning.js +45 -14
- package/dist/language/flows/flow-mutate-tools.js +5 -3
- package/dist/language/flows/flow-replay-run.d.ts +23 -9
- package/dist/language/flows/flow-replay-run.js +115 -110
- package/dist/language/flows/flow-replay-types.d.ts +1 -1
- package/dist/language/flows/flow-replay.d.ts +40 -1
- package/dist/language/flows/flow-replay.js +110 -22
- package/dist/language/flows/flow-result.d.ts +22 -1
- package/dist/language/flows/flow-result.js +47 -2
- package/dist/language/flows/flow-scope.js +5 -1
- package/dist/language/flows/flow-step-runners.d.ts +22 -2
- package/dist/language/flows/flow-step-runners.js +247 -47
- package/dist/language/flows/flow-store-for-session.d.ts +2 -2
- package/dist/language/flows/flow-store-for-session.js +7 -3
- package/dist/language/flows/flow-tools.d.ts +10 -0
- package/dist/language/flows/flow-tools.js +112 -89
- package/dist/language/flows/flows.d.ts +16 -1
- package/dist/language/flows/flows.js +74 -12
- package/dist/language/flows/heal-run.js +6 -4
- package/dist/language/flows/narrow-write.d.ts +7 -0
- package/dist/language/flows/narrow-write.js +36 -1
- package/dist/language/flows/recording/flake.d.ts +2 -2
- package/dist/language/flows/recording/recording-backtrack.js +14 -1
- package/dist/language/flows/recording/tape/recordings.d.ts +58 -4
- package/dist/language/flows/recording/tape/recordings.js +95 -13
- package/dist/language/flows/replay-from-hud.d.ts +20 -0
- package/dist/language/flows/replay-from-hud.js +51 -0
- package/dist/language/flows/replay.d.ts +9 -5
- package/dist/language/flows/replay.js +56 -15
- package/dist/language/flows/single-replay.d.ts +7 -0
- package/dist/language/flows/single-replay.js +26 -0
- package/dist/language/flows/suite/suite-flakes.js +2 -0
- package/dist/language/flows/suite-selection.d.ts +2 -15
- package/dist/language/flows/suite-selection.js +4 -3
- package/dist/language/flows/verify-change-tools.d.ts +1 -0
- package/dist/language/flows/verify-change-tools.js +202 -191
- package/dist/launch-chromium.d.ts +27 -5
- package/dist/launch-chromium.js +38 -8
- package/dist/memory/cloud/cloud-config.d.ts +22 -1
- package/dist/memory/cloud/cloud-config.js +34 -5
- package/dist/memory/cloud/cloud-sync.d.ts +17 -14
- package/dist/memory/cloud/cloud-sync.js +15 -4
- package/dist/memory/cloud/harness-config.d.ts +75 -1
- package/dist/memory/cloud/harness-config.js +115 -24
- package/dist/memory/cloud/hud-notices-source.d.ts +21 -0
- package/dist/memory/cloud/hud-notices-source.js +128 -0
- package/dist/memory/cloud/memory-scope.d.ts +161 -0
- package/dist/memory/cloud/memory-scope.js +227 -0
- package/dist/memory/cloud/sync-cycle.d.ts +44 -7
- package/dist/memory/cloud/sync-cycle.js +129 -15
- package/dist/memory/cloud/sync-daemon.d.ts +11 -0
- package/dist/memory/cloud/sync-daemon.js +121 -9
- package/dist/memory/cloud/sync-disk.d.ts +1 -1
- package/dist/memory/cloud/sync-disk.js +31 -10
- package/dist/memory/cloud/sync-screenshots.d.ts +32 -0
- package/dist/memory/cloud/sync-screenshots.js +105 -0
- package/dist/memory/cloud/unsynced-roots.d.ts +47 -0
- package/dist/memory/cloud/unsynced-roots.js +166 -0
- package/dist/memory/impact/account-watch.d.ts +34 -0
- package/dist/memory/impact/account-watch.js +59 -0
- package/dist/memory/impact/impact-recorder.d.ts +8 -0
- package/dist/memory/impact/impact-recorder.js +12 -2
- package/dist/memory/impact/impact-store.d.ts +17 -4
- package/dist/memory/impact/impact-store.js +169 -63
- package/dist/memory/intent/inline-intent.d.ts +1 -0
- package/dist/memory/intent/intent-shard-store.js +16 -4
- package/dist/memory/intent/intent-shard.d.ts +14 -2
- package/dist/memory/intent/intent-store.d.ts +1 -0
- package/dist/memory/intent/intent-tools.js +122 -4
- package/dist/memory/intent/open-intents.d.ts +6 -0
- package/dist/memory/intent/open-intents.js +10 -1
- package/dist/memory/intent/settled-words.d.ts +24 -0
- package/dist/memory/intent/settled-words.js +130 -0
- package/dist/memory/journal/drive-flow.d.ts +16 -0
- package/dist/memory/journal/drive-flow.js +34 -2
- package/dist/memory/journal/drive-run-flush.d.ts +2 -0
- package/dist/memory/journal/drive-run-flush.js +20 -5
- package/dist/memory/journal/envelope.d.ts +8 -8
- package/dist/memory/journal/journal-recorder.js +52 -3
- package/dist/memory/journal/on-disk/retention.d.ts +8 -0
- package/dist/memory/journal/on-disk/retention.js +32 -2
- package/dist/memory/journal/on-disk/startup-maintenance.js +3 -1
- package/dist/memory/journal/on-disk/workspace-tiers.js +9 -4
- package/dist/memory/journal/session-end.d.ts +15 -1
- package/dist/memory/journal/session-end.js +42 -9
- package/dist/memory/project/artifact-root-resolver.d.ts +26 -1
- package/dist/memory/project/artifact-root-resolver.js +125 -16
- package/dist/memory/project/artifact-root.d.ts +46 -8
- package/dist/memory/project/artifact-root.js +89 -10
- package/dist/memory/project/dir/reticle-dir.d.ts +18 -2
- package/dist/memory/project/dir/reticle-dir.js +26 -3
- package/dist/memory/project/link-directory.d.ts +15 -0
- package/dist/memory/project/link-directory.js +44 -0
- package/dist/memory/project/project-tools.js +22 -3
- package/dist/memory/project/root-claims.d.ts +6 -0
- package/dist/memory/project/root-claims.js +39 -0
- package/dist/memory/project/session-root.d.ts +26 -1
- package/dist/memory/project/session-root.js +49 -5
- package/dist/memory/project/sync-status.d.ts +85 -0
- package/dist/memory/project/sync-status.js +224 -0
- package/dist/memory/recall/memory-tools.js +47 -2
- package/dist/memory/recall/platform-memory.d.ts +34 -0
- package/dist/memory/recall/platform-memory.js +139 -0
- package/dist/memory/recall/project-memory.d.ts +19 -0
- package/dist/memory/recall/project-memory.js +80 -13
- package/dist/portal/bridge/bridge.d.ts +9 -3
- package/dist/portal/bridge/bridge.js +82 -22
- package/dist/portal/bridge/harness-request.d.ts +23 -0
- package/dist/portal/bridge/harness-request.js +27 -0
- package/dist/portal/bridge/pairing-token.d.ts +9 -0
- package/dist/portal/bridge/pairing-token.js +17 -0
- package/dist/portal/bridge/wrong-path.d.ts +17 -0
- package/dist/portal/bridge/wrong-path.js +35 -0
- package/dist/portal/input/network-mock-tools.js +11 -2
- package/dist/portal/input/real-input.d.ts +83 -10
- package/dist/portal/input/real-input.js +218 -30
- package/dist/portal/input/viewport-tools.js +3 -3
- package/dist/portal/pool/browser-pool.d.ts +70 -9
- package/dist/portal/pool/browser-pool.js +190 -37
- package/dist/portal/pool/context-permissions.d.ts +33 -0
- package/dist/portal/pool/context-permissions.js +33 -0
- package/dist/portal/pool/lease-marker-stamp.d.ts +23 -0
- package/dist/portal/pool/lease-marker-stamp.js +49 -0
- package/dist/portal/pool/playwright-launcher.d.ts +35 -0
- package/dist/portal/pool/playwright-launcher.js +64 -3
- package/dist/portal/pool/pool-contract.d.ts +28 -5
- package/dist/portal/session/agent-link.d.ts +8 -0
- package/dist/portal/session/agent-link.js +17 -0
- package/dist/portal/session/command-payload.d.ts +8 -0
- package/dist/portal/session/command-payload.js +24 -0
- package/dist/portal/session/daemon-answers.d.ts +3 -3
- package/dist/portal/session/daemon-answers.js +4 -2
- package/dist/portal/session/dev-server/dev-command.d.ts +21 -0
- package/dist/portal/session/dev-server/dev-command.js +87 -12
- package/dist/portal/session/facts/departure-note.d.ts +22 -0
- package/dist/portal/session/facts/departure-note.js +47 -0
- package/dist/portal/session/facts/observed-state.d.ts +16 -18
- package/dist/portal/session/facts/observed-state.js +46 -3
- package/dist/portal/session/facts/session-replaced.d.ts +5 -0
- package/dist/portal/session/facts/session-replaced.js +5 -0
- package/dist/portal/session/first-run-wiring.d.ts +42 -0
- package/dist/portal/session/first-run-wiring.js +132 -0
- package/dist/portal/session/human/live-control.d.ts +9 -2
- package/dist/portal/session/human/live-control.js +12 -3
- package/dist/portal/session/human/notes-ledger.d.ts +20 -0
- package/dist/portal/session/human/notes-ledger.js +55 -0
- package/dist/portal/session/human/review-store.d.ts +12 -0
- package/dist/portal/session/human/review-store.js +18 -10
- package/dist/portal/session/live-control-tools.d.ts +0 -13
- package/dist/portal/session/live-control-tools.js +107 -13
- package/dist/portal/session/narration-args.d.ts +5 -0
- package/dist/portal/session/narration-args.js +17 -0
- package/dist/portal/session/no-session-diagnosis.d.ts +8 -1
- package/dist/portal/session/no-session-diagnosis.js +46 -9
- package/dist/portal/session/no-session-next-action.d.ts +31 -0
- package/dist/portal/session/no-session-next-action.js +159 -60
- package/dist/portal/session/no-session-watch.d.ts +14 -1
- package/dist/portal/session/no-session-watch.js +227 -17
- package/dist/portal/session/presence/session-lease.js +1 -1
- package/dist/portal/session/presence/session-mirror.js +3 -0
- package/dist/portal/session/recorded-gaps.d.ts +97 -0
- package/dist/portal/session/recorded-gaps.js +251 -0
- package/dist/portal/session/serving-directory.d.ts +27 -0
- package/dist/portal/session/serving-directory.js +45 -0
- package/dist/portal/session/session-health.d.ts +18 -0
- package/dist/portal/session/session-health.js +9 -1
- package/dist/portal/session/session-info.d.ts +8 -1
- package/dist/portal/session/session-info.js +8 -1
- package/dist/portal/session/session-manager.d.ts +39 -0
- package/dist/portal/session/session-manager.js +98 -11
- package/dist/portal/session/session-reaper.js +4 -1
- package/dist/portal/session/session-successor.d.ts +13 -0
- package/dist/portal/session/session-successor.js +1 -1
- package/dist/portal/session/session-tools.js +26 -3
- package/dist/portal/session/session.d.ts +22 -30
- package/dist/portal/session/session.js +81 -79
- package/dist/portal/session/timing/command-timeout.js +25 -1
- package/dist/portal/session/timing/wall-clock.d.ts +1 -1
- package/dist/portal/session/timing/wall-clock.js +1 -1
- package/dist/portal/session/zero-install-first-call.d.ts +31 -0
- package/dist/portal/session/zero-install-first-call.js +88 -0
- package/dist/start-options.d.ts +12 -0
- package/dist/start-wiring.d.ts +63 -0
- package/dist/start-wiring.js +169 -0
- package/dist/status-payload.d.ts +23 -1
- package/dist/status-payload.js +36 -1
- package/dist/surface/http-server.js +18 -2
- package/dist/surface/mcp/attach-memory.d.ts +1 -0
- package/dist/surface/mcp/attach-memory.js +12 -1
- package/dist/surface/mcp/mcp-proxy.d.ts +9 -0
- package/dist/surface/mcp/mcp-proxy.js +65 -13
- package/dist/surface/mcp/mcp.d.ts +34 -6
- package/dist/surface/mcp/mcp.js +61 -17
- package/dist/surface/mcp/proxy/drive-calls.d.ts +10 -0
- package/dist/surface/mcp/proxy/drive-calls.js +27 -0
- package/dist/surface/mcp/proxy/mcp-post-transport.js +5 -0
- package/dist/surface/mcp/server-instructions.d.ts +4 -2
- package/dist/surface/mcp/server-instructions.js +32 -14
- package/dist/surface/mcp/shared-params.js +2 -2
- package/dist/surface/mcp/surface-vocabulary.d.ts +2 -0
- package/dist/surface/mcp/surface-vocabulary.js +1 -0
- package/dist/surface/tools/account-tool.d.ts +22 -0
- package/dist/surface/tools/account-tool.js +157 -0
- package/dist/surface/tools/act/act-danger.d.ts +11 -0
- package/dist/surface/tools/act/act-danger.js +38 -1
- package/dist/surface/tools/act/act-observation.d.ts +33 -0
- package/dist/surface/tools/act/act-observation.js +57 -0
- package/dist/surface/tools/act/act-preflight.js +25 -2
- package/dist/surface/tools/act/act-target.js +8 -3
- package/dist/surface/tools/act/navigation/navigate-arrival.d.ts +8 -0
- package/dist/surface/tools/act/navigation/navigate-arrival.js +56 -2
- package/dist/surface/tools/act/resolve-target.d.ts +1 -1
- package/dist/surface/tools/act/resolve-target.js +18 -3
- package/dist/surface/tools/act/screen-request.d.ts +34 -0
- package/dist/surface/tools/act/screen-request.js +113 -0
- package/dist/surface/tools/act/sequence-grade.d.ts +8 -0
- package/dist/surface/tools/act/sequence-grade.js +13 -2
- package/dist/surface/tools/act/settle-in-flight.js +25 -3
- package/dist/surface/tools/act-sequence-tool.js +138 -29
- package/dist/surface/tools/act-tools.d.ts +0 -9
- package/dist/surface/tools/act-tools.js +71 -41
- package/dist/surface/tools/agent/app-notes-learning.d.ts +7 -0
- package/dist/surface/tools/agent/app-notes-learning.js +80 -0
- package/dist/surface/tools/agent/app-notes.d.ts +4 -0
- package/dist/surface/tools/agent/app-notes.js +48 -0
- package/dist/surface/tools/agent/build-staleness.d.ts +7 -0
- package/dist/surface/tools/agent/build-staleness.js +62 -0
- package/dist/surface/tools/agent/compact-envelope.d.ts +80 -0
- package/dist/surface/tools/agent/compact-envelope.js +374 -0
- package/dist/surface/tools/agent/for-the-agent.d.ts +12 -0
- package/dist/surface/tools/agent/for-the-agent.js +44 -0
- package/dist/surface/tools/agent/notices.d.ts +50 -0
- package/dist/surface/tools/agent/notices.js +152 -0
- package/dist/surface/tools/agent/reteach.d.ts +11 -0
- package/dist/surface/tools/agent/reteach.js +50 -0
- package/dist/surface/tools/args/alias-args.d.ts +5 -0
- package/dist/surface/tools/args/alias-args.js +10 -0
- package/dist/surface/tools/args/confirm-dangerous-arg.d.ts +6 -0
- package/dist/surface/tools/args/confirm-dangerous-arg.js +6 -0
- package/dist/surface/tools/assert/assert-source.d.ts +15 -0
- package/dist/surface/tools/assert/assert-source.js +40 -0
- package/dist/surface/tools/assert/assert-verdict.d.ts +1 -1
- package/dist/surface/tools/assert/assert-verdict.js +42 -17
- package/dist/surface/tools/browser-tools.js +51 -2
- package/dist/surface/tools/chat-drives.d.ts +101 -0
- package/dist/surface/tools/chat-drives.js +409 -0
- package/dist/surface/tools/coverage-tools.d.ts +2 -10
- package/dist/surface/tools/coverage-tools.js +2 -53
- package/dist/surface/tools/dynamic-tools.js +29 -1
- package/dist/surface/tools/empty-session-list.d.ts +51 -0
- package/dist/surface/tools/empty-session-list.js +120 -0
- package/dist/surface/tools/error-recovery.d.ts +14 -0
- package/dist/surface/tools/error-recovery.js +105 -8
- package/dist/surface/tools/explore-tools.d.ts +31 -1
- package/dist/surface/tools/explore-tools.js +438 -66
- package/dist/surface/tools/feedback-tools.d.ts +2 -3
- package/dist/surface/tools/feedback-tools.js +18 -3
- package/dist/surface/tools/gap-novelty.d.ts +3 -1
- package/dist/surface/tools/gap-novelty.js +8 -1
- package/dist/surface/tools/harness-explore.d.ts +118 -57
- package/dist/surface/tools/harness-explore.js +344 -292
- package/dist/surface/tools/harness-gate.d.ts +88 -0
- package/dist/surface/tools/harness-gate.js +235 -0
- package/dist/surface/tools/harness-hunt.d.ts +43 -0
- package/dist/surface/tools/harness-hunt.js +215 -0
- package/dist/surface/tools/harness-plan.d.ts +17 -0
- package/dist/surface/tools/harness-plan.js +38 -0
- package/dist/surface/tools/harness-script.d.ts +30 -0
- package/dist/surface/tools/harness-script.js +560 -0
- package/dist/surface/tools/harness-tab-guard.d.ts +5 -0
- package/dist/surface/tools/harness-tab-guard.js +27 -0
- package/dist/surface/tools/harness-toolset.d.ts +22 -1
- package/dist/surface/tools/harness-toolset.js +101 -7
- package/dist/surface/tools/human-notes.d.ts +16 -0
- package/dist/surface/tools/human-notes.js +27 -0
- package/dist/surface/tools/invoke-tool.d.ts +5 -2
- package/dist/surface/tools/invoke-tool.js +263 -85
- package/dist/surface/tools/lease-hint.js +26 -5
- package/dist/surface/tools/lease-permissions.d.ts +33 -0
- package/dist/surface/tools/lease-permissions.js +73 -0
- package/dist/surface/tools/lease-readiness.d.ts +38 -0
- package/dist/surface/tools/lease-readiness.js +57 -0
- package/dist/surface/tools/lease-seed.d.ts +49 -0
- package/dist/surface/tools/lease-seed.js +167 -0
- package/dist/surface/tools/lease-tools.d.ts +13 -24
- package/dist/surface/tools/lease-tools.js +146 -197
- package/dist/surface/tools/live-call-text.js +4 -4
- package/dist/surface/tools/merge-tools.js +42 -2
- package/dist/surface/tools/merged-name-redirect.js +4 -0
- package/dist/surface/tools/next-step.d.ts +29 -0
- package/dist/surface/tools/next-step.js +214 -0
- package/dist/surface/tools/observe-tools.js +45 -9
- package/dist/surface/tools/platform-moment.d.ts +72 -0
- package/dist/surface/tools/platform-moment.js +296 -0
- package/dist/surface/tools/query-hint-schema.d.ts +7 -0
- package/dist/surface/tools/query-hint-schema.js +10 -0
- package/dist/surface/tools/read-tools.js +71 -14
- package/dist/surface/tools/real-input-attempt.js +96 -13
- package/dist/surface/tools/reticle-result.d.ts +120 -0
- package/dist/surface/tools/reticle-result.js +364 -0
- package/dist/surface/tools/tool-kit.d.ts +83 -3
- package/dist/surface/tools/tool-kit.js +77 -7
- package/dist/surface/tools/tools.js +43 -59
- package/dist/telemetry/account-envelope.d.ts +7 -0
- package/dist/telemetry/account-envelope.js +61 -0
- package/dist/telemetry/agent-client.d.ts +15 -0
- package/dist/telemetry/agent-client.js +57 -0
- package/dist/telemetry/app-instrumented.js +9 -2
- package/dist/telemetry/argument-shape.d.ts +7 -0
- package/dist/telemetry/argument-shape.js +86 -1
- package/dist/telemetry/automation-hint.d.ts +2 -3
- package/dist/telemetry/automation-hint.js +33 -8
- package/dist/telemetry/cli-telemetry.js +7 -2
- package/dist/telemetry/daemon-telemetry.js +3 -0
- package/dist/telemetry/error-fingerprint.d.ts +10 -1
- package/dist/telemetry/error-fingerprint.js +61 -5
- package/dist/telemetry/feedback-cli.d.ts +0 -13
- package/dist/telemetry/feedback-cli.js +0 -77
- package/dist/telemetry/feedback.d.ts +13 -0
- package/dist/telemetry/feedback.js +183 -17
- package/dist/telemetry/harness-run.d.ts +18 -0
- package/dist/telemetry/harness-run.js +80 -0
- package/dist/telemetry/hud-events.d.ts +16 -0
- package/dist/telemetry/hud-events.js +27 -0
- package/dist/telemetry/hud-metrics.d.ts +29 -6
- package/dist/telemetry/hud-metrics.js +116 -25
- package/dist/telemetry/init-telemetry.js +2 -2
- package/dist/telemetry/install-source.d.ts +13 -25
- package/dist/telemetry/install-source.js +44 -3
- package/dist/telemetry/mcp-connection.d.ts +0 -14
- package/dist/telemetry/mcp-connection.js +5 -1
- package/dist/telemetry/onboarding-firsts.d.ts +32 -0
- package/dist/telemetry/onboarding-firsts.js +81 -6
- package/dist/telemetry/platform-linked.d.ts +5 -0
- package/dist/telemetry/platform-linked.js +32 -0
- package/dist/telemetry/project-profile.js +5 -3
- package/dist/telemetry/proxy-telemetry.js +4 -1
- package/dist/telemetry/session-metrics.d.ts +15 -4
- package/dist/telemetry/session-metrics.js +88 -52
- package/dist/telemetry/telemetry.d.ts +38 -2
- package/dist/telemetry/telemetry.js +144 -34
- package/dist/telemetry/verification-of.d.ts +3 -1
- package/dist/telemetry/verification-of.js +13 -4
- package/dist/wire-journal.d.ts +2 -2
- package/dist/wire-journal.js +20 -6
- package/docs/README.md +3 -3
- package/docs/actions.mdx +6 -3
- package/docs/adapters.md +1 -1
- package/docs/agent-cheatsheet.md +25 -28
- package/docs/architecture.md +5 -5
- package/docs/autodrive.md +33 -28
- package/docs/benchmarks.md +5 -5
- package/docs/best-practices.mdx +27 -9
- package/docs/capabilities.mdx +14 -16
- package/docs/cli/affected.mdx +1 -1
- package/docs/cli/cloud.mdx +54 -75
- package/docs/cli/doctor.mdx +14 -3
- package/docs/cli/drive.mdx +20 -14
- package/docs/cli/feedback.mdx +3 -3
- package/docs/cli/gate.mdx +7 -2
- package/docs/cli/help.mdx +50 -55
- package/docs/cli/init.mdx +43 -28
- package/docs/cli/license.mdx +12 -8
- package/docs/cli/mcp.mdx +4 -4
- package/docs/cli/open.mdx +3 -3
- package/docs/cli/report.mdx +4 -2
- package/docs/cli/restart.mdx +2 -2
- package/docs/cli/rollback.mdx +14 -8
- package/docs/cli/serve.mdx +4 -4
- package/docs/cli/setup.mdx +23 -0
- package/docs/cli/status.mdx +18 -5
- package/docs/cli/stop.mdx +67 -8
- package/docs/cli/try.mdx +62 -0
- package/docs/cli/update.mdx +4 -3
- package/docs/cli/verify.mdx +17 -6
- package/docs/cli/version.mdx +5 -4
- package/docs/cli.mdx +111 -42
- package/docs/debugging.md +3 -3
- package/docs/deploy-checks.md +1 -1
- package/docs/desktop.mdx +9 -3
- package/docs/enterprise.md +11 -10
- package/docs/environment.mdx +7 -8
- package/docs/faq.mdx +3 -3
- package/docs/first-drive.md +5 -4
- package/docs/flows.md +35 -27
- package/docs/for-agents.md +4 -5
- package/docs/frameworks.mdx +32 -21
- package/docs/getting-started.md +65 -61
- package/docs/human-control.md +16 -16
- package/docs/index.mdx +15 -42
- package/docs/install-agentic.mdx +22 -37
- package/docs/install-manual.mdx +23 -13
- package/docs/instrumentation.mdx +5 -3
- package/docs/integration-patterns.md +7 -7
- package/docs/license-activation.mdx +1 -1
- package/docs/multi-agent-testing.md +24 -6
- package/docs/packages/babel-plugin.mdx +4 -2
- package/docs/packages/browser.mdx +16 -10
- package/docs/packages/core.mdx +12 -5
- package/docs/packages/electron.mdx +3 -2
- package/docs/packages/engine.mdx +1 -1
- package/docs/packages/eslint-plugin.mdx +18 -12
- package/docs/packages/next.mdx +8 -7
- package/docs/packages/open-verification.mdx +1 -1
- package/docs/packages/server.mdx +5 -5
- package/docs/packages/tauri.mdx +9 -9
- package/docs/packages/test.mdx +4 -10
- package/docs/packages/vite-plugin.mdx +32 -4
- package/docs/packages.mdx +11 -15
- package/docs/platform-integration.md +6 -5
- package/docs/predicates.mdx +40 -24
- package/docs/quickstart.mdx +69 -30
- package/docs/required-checks.md +8 -7
- package/docs/reticle-manual.md +15 -5
- package/docs/skill-file.mdx +17 -79
- package/docs/skill-setup.md +9 -9
- package/docs/skill.md +200 -0
- package/docs/system-map.md +7 -7
- package/docs/telemetry.md +23 -25
- package/docs/testing.md +4 -4
- package/docs/token-efficiency.md +12 -12
- package/docs/tools/act-and-wait.mdx +9 -2
- package/docs/tools/act-sequence.mdx +6 -7
- package/docs/tools/act.mdx +2 -2
- package/docs/tools/assert.mdx +18 -17
- package/docs/tools/console.mdx +9 -9
- package/docs/tools/inspect.mdx +16 -7
- package/docs/tools/look.mdx +24 -0
- package/docs/tools/navigate.mdx +5 -3
- package/docs/tools/network.mdx +2 -2
- package/docs/tools/observe.mdx +6 -6
- package/docs/tools/overview.mdx +34 -33
- package/docs/tools/query.mdx +5 -5
- package/docs/tools/session-and-feedback.mdx +22 -13
- package/docs/tools/sessions.mdx +8 -8
- package/docs/tools/snapshot.mdx +6 -5
- package/docs/tools/state.mdx +9 -9
- package/docs/tools/tools-and-run.mdx +26 -24
- package/docs/tools/verify.mdx +28 -0
- package/docs/tools/wait-for.mdx +8 -4
- package/docs/troubleshooting.mdx +21 -6
- package/docs/usage.md +55 -46
- package/docs/use-cases.mdx +3 -3
- package/docs/vs-chrome-devtools-mcp.mdx +9 -6
- package/docs/vs-playwright-mcp.mdx +3 -1
- package/docs/what-is-recorded.md +17 -5
- package/docs/what-is-reticle.mdx +5 -3
- package/docs/why-reticle.mdx +1 -1
- package/package.json +9 -12
- package/dist/command/cli/demo/demo-page.d.ts +0 -78
- package/dist/command/cli/demo/demo-page.js +0 -241
- package/dist/command/cli/demo/demo-run.d.ts +0 -38
- package/dist/command/cli/demo/demo-run.js +0 -138
- package/dist/features/harness/driver.d.ts +0 -50
- package/dist/features/harness/driver.js +0 -236
- package/dist/features/harness/jev-driver.d.ts +0 -188
- package/dist/features/harness/jev-driver.js +0 -678
- package/dist/features/harness/openai-driver.d.ts +0 -58
- package/dist/features/harness/openai-driver.js +0 -206
- package/dist/judgement/hunt/hunt-report.d.ts +0 -49
- package/dist/judgement/hunt/hunt-report.js +0 -84
- package/dist/language/flows/buddy-status.d.ts +0 -25
- package/dist/language/flows/buddy-status.js +0 -32
- package/dist/language/flows/change/watch-batcher.d.ts +0 -18
- package/dist/language/flows/change/watch-batcher.js +0 -19
- package/dist/memory/cloud/harness-offer.d.ts +0 -44
- package/dist/memory/cloud/harness-offer.js +0 -145
- package/dist/memory/project/dir/fill-value-store.d.ts +0 -32
- package/dist/memory/project/dir/fill-value-store.js +0 -88
- package/dist/surface/tools/feature-capture.d.ts +0 -151
- package/dist/surface/tools/feature-capture.js +0 -235
- package/dist/surface/tools/tool-hit-rate.d.ts +0 -87
- package/dist/surface/tools/tool-hit-rate.js +0 -90
- package/dist/telemetry/harness-drive.d.ts +0 -4
- package/dist/telemetry/harness-drive.js +0 -35
- package/dist/telemetry/identify.d.ts +0 -22
- package/dist/telemetry/identify.js +0 -73
- package/docs/cli/capsules.mdx +0 -70
- package/docs/cli/hunt.mdx +0 -73
- package/docs/cli/identify.mdx +0 -76
- package/docs/cli/kill.mdx +0 -91
- package/docs/cli/watch.mdx +0 -62
- package/docs/local-registry.md +0 -143
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wiring the app the first time an agent needs it, instead of at installation.
|
|
3
|
+
*
|
|
4
|
+
* Installing Reticle puts a CLI and an MCP server on the machine and touches no project. The app is
|
|
5
|
+
* instrumented the first time an agent actually uses Reticle against it: the daemon runs its own
|
|
6
|
+
* CLI's `init` in the project directory, the same codemod, dev-server start and connect a person
|
|
7
|
+
* would have run by hand, and reports what it changed.
|
|
8
|
+
*
|
|
9
|
+
* A child process rather than an import: the daemon never imports `@reticlehq/init`
|
|
10
|
+
* (library-path-boundary.test.ts), and running the CLI keeps that line where it is.
|
|
11
|
+
*
|
|
12
|
+
* Once per directory for the life of the daemon. A second call returns the first answer, so an agent
|
|
13
|
+
* that asks again after a failure is told the same thing rather than re-running a codemod on files
|
|
14
|
+
* the first run already changed.
|
|
15
|
+
*/
|
|
16
|
+
import { spawn } from 'node:child_process';
|
|
17
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
18
|
+
import { homedir } from 'node:os';
|
|
19
|
+
import { join, resolve } from 'node:path';
|
|
20
|
+
import { isWebApp } from '@reticlehq/init';
|
|
21
|
+
import { readProjectId } from '../../command/cli/ports/resolve/cli-port.js';
|
|
22
|
+
/** init has a dev server to start and a page to wait for; past this it is not coming. */
|
|
23
|
+
const WIRE_TIMEOUT_MS = 120_000;
|
|
24
|
+
/** A plan line as init prints it: `[✓] Vite plugin → vite.config.ts`. */
|
|
25
|
+
const PLAN_LINE = /^\s*\[(.)\]\s+(.+?)\s+→\s+(.+)$/;
|
|
26
|
+
export function projectDirectoryOf(cwd, home = homedir(), wired = (dir) => readProjectId(dir) !== undefined) {
|
|
27
|
+
const dir = resolve(cwd);
|
|
28
|
+
if (dir === resolve(home) || dir === resolve('/'))
|
|
29
|
+
return undefined;
|
|
30
|
+
// Already wired: nothing for a first run to do, and init over a wired app proves nothing.
|
|
31
|
+
if (wired(dir))
|
|
32
|
+
return undefined;
|
|
33
|
+
// Only an app with a page: a daemon started in a library or API package wrote a config there.
|
|
34
|
+
return isWebApp('.', {
|
|
35
|
+
exists: (p) => existsSync(join(dir, p)),
|
|
36
|
+
readFile: (p) => {
|
|
37
|
+
try {
|
|
38
|
+
return readFileSync(join(dir, p), 'utf8');
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
})
|
|
45
|
+
? dir
|
|
46
|
+
: undefined;
|
|
47
|
+
}
|
|
48
|
+
/** init's plan lines, and the one JSON object it prints last under `--json`. */
|
|
49
|
+
export function readInitOutput(stdout) {
|
|
50
|
+
const steps = stdout
|
|
51
|
+
.split('\n')
|
|
52
|
+
.map((line) => PLAN_LINE.exec(line))
|
|
53
|
+
.flatMap((m) => null === m
|
|
54
|
+
? []
|
|
55
|
+
: [{ mark: m[1] ?? '', title: (m[2] ?? '').trim(), target: (m[3] ?? '').trim() }]);
|
|
56
|
+
const at = stdout.lastIndexOf('\n{\n') + 1;
|
|
57
|
+
let result;
|
|
58
|
+
try {
|
|
59
|
+
result = JSON.parse(stdout.slice(at));
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
result = undefined;
|
|
63
|
+
}
|
|
64
|
+
return { steps, result };
|
|
65
|
+
}
|
|
66
|
+
function nodeRun(cliPath) {
|
|
67
|
+
return (args, cwd) => new Promise((done) => {
|
|
68
|
+
const child = spawn(process.execPath, [cliPath, ...args], {
|
|
69
|
+
cwd,
|
|
70
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
71
|
+
env: process.env,
|
|
72
|
+
});
|
|
73
|
+
let stdout = '';
|
|
74
|
+
let stderr = '';
|
|
75
|
+
child.stdout.on('data', (chunk) => (stdout += chunk.toString('utf8')));
|
|
76
|
+
child.stderr.on('data', (chunk) => (stderr += chunk.toString('utf8')));
|
|
77
|
+
const timer = setTimeout(() => child.kill(), WIRE_TIMEOUT_MS);
|
|
78
|
+
child.on('error', (error) => {
|
|
79
|
+
clearTimeout(timer);
|
|
80
|
+
done({ code: 1, stdout, stderr: `${stderr}${error.message}` });
|
|
81
|
+
});
|
|
82
|
+
child.on('close', (code) => {
|
|
83
|
+
clearTimeout(timer);
|
|
84
|
+
done({ code: code ?? 1, stdout, stderr });
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
export function firstRunWiring(options) {
|
|
89
|
+
const run = options.run ?? nodeRun(options.cliPath);
|
|
90
|
+
const done = new Map();
|
|
91
|
+
return {
|
|
92
|
+
projectDirectory: (cwd) => projectDirectoryOf(cwd),
|
|
93
|
+
wire(directory) {
|
|
94
|
+
const held = done.get(directory);
|
|
95
|
+
if (held !== undefined)
|
|
96
|
+
return held;
|
|
97
|
+
const outcome = run(['init', '--no-mcp', '--json', '--port', String(options.port)], directory)
|
|
98
|
+
.then(({ code, stdout, stderr }) => {
|
|
99
|
+
// Under --json the plan lines may go to stderr, keeping stdout for the one object.
|
|
100
|
+
const { result } = readInitOutput(stdout);
|
|
101
|
+
const { steps } = readInitOutput(`${stdout}\n${stderr}`);
|
|
102
|
+
const record = 'object' === typeof result && null !== result
|
|
103
|
+
? result
|
|
104
|
+
: {};
|
|
105
|
+
const url = 'string' === typeof record['url'] ? record['url'] : undefined;
|
|
106
|
+
const ok = 0 === code && true === record['ok'];
|
|
107
|
+
const lastError = stderr.trim().split('\n').at(-1);
|
|
108
|
+
return {
|
|
109
|
+
ok,
|
|
110
|
+
directory,
|
|
111
|
+
steps,
|
|
112
|
+
...(url === undefined ? {} : { url }),
|
|
113
|
+
...(ok
|
|
114
|
+
? {}
|
|
115
|
+
: {
|
|
116
|
+
error: lastError !== undefined && 0 < lastError.length
|
|
117
|
+
? lastError
|
|
118
|
+
: `init exited ${String(code)}`,
|
|
119
|
+
}),
|
|
120
|
+
};
|
|
121
|
+
})
|
|
122
|
+
.catch((error) => ({
|
|
123
|
+
ok: false,
|
|
124
|
+
directory,
|
|
125
|
+
steps: [],
|
|
126
|
+
error: error instanceof Error ? error.message : String(error),
|
|
127
|
+
}));
|
|
128
|
+
done.set(directory, outcome);
|
|
129
|
+
return outcome;
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
}
|
|
@@ -3,6 +3,10 @@ import { SessionState, type HumanControlData } from '@reticlehq/core';
|
|
|
3
3
|
export interface InboxMessage {
|
|
4
4
|
text: string;
|
|
5
5
|
t: number;
|
|
6
|
+
/** Set once an agent's tool call took it: what lets the HUD say "Seen" and never before. */
|
|
7
|
+
seen?: boolean;
|
|
8
|
+
/** The agent whose call took it, when the daemon knows. */
|
|
9
|
+
by?: string;
|
|
6
10
|
}
|
|
7
11
|
export declare class LiveControl {
|
|
8
12
|
#private;
|
|
@@ -20,8 +24,11 @@ export declare class LiveControl {
|
|
|
20
24
|
* while I was away", which a destructive drain can never give twice.
|
|
21
25
|
*/
|
|
22
26
|
history(): readonly InboxMessage[];
|
|
23
|
-
/**
|
|
24
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Return the queued notes AND clear them — delivered once, so a hint never repeats. Each is marked
|
|
29
|
+
* seen (by `by` when known) on the same object the history holds, so the HUD can show it.
|
|
30
|
+
*/
|
|
31
|
+
drain(by?: string): InboxMessage[];
|
|
25
32
|
/** Diagnostic read of the inbox depth (does not clear). */
|
|
26
33
|
size(): number;
|
|
27
34
|
/**
|
|
@@ -64,9 +64,18 @@ export class LiveControl {
|
|
|
64
64
|
history() {
|
|
65
65
|
return this.#history;
|
|
66
66
|
}
|
|
67
|
-
/**
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
/**
|
|
68
|
+
* Return the queued notes AND clear them — delivered once, so a hint never repeats. Each is marked
|
|
69
|
+
* seen (by `by` when known) on the same object the history holds, so the HUD can show it.
|
|
70
|
+
*/
|
|
71
|
+
drain(by) {
|
|
72
|
+
const taken = this.#inbox.splice(0, this.#inbox.length);
|
|
73
|
+
for (const message of taken) {
|
|
74
|
+
message.seen = true;
|
|
75
|
+
if (by !== undefined)
|
|
76
|
+
message.by = by;
|
|
77
|
+
}
|
|
78
|
+
return taken;
|
|
70
79
|
}
|
|
71
80
|
/** Diagnostic read of the inbox depth (does not clear). */
|
|
72
81
|
size() {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReviewMark } from './review-store.js';
|
|
2
|
+
/** One note as it lands on disk: the mark without its session-local id and clock. */
|
|
3
|
+
type StoredNote = Omit<ReviewMark, 'id' | 'at'>;
|
|
4
|
+
/** What `.reticle/notes.json` holds. Keyed by content, so a note survives the session it was made in. */
|
|
5
|
+
export interface NotesFile {
|
|
6
|
+
notes: Record<string, StoredNote>;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Mark ids (`m1`, `m2`, …) restart with the daemon, so they cannot name a note across sessions.
|
|
10
|
+
* The route, anchor and words can: the same complaint on the same element is the same note.
|
|
11
|
+
*/
|
|
12
|
+
export declare function noteKey(mark: Pick<ReviewMark, 'route' | 'anchor' | 'note'>): string;
|
|
13
|
+
/**
|
|
14
|
+
* Merge one session's marks into the project's notes file, so the HUD notes a human left reach the
|
|
15
|
+
* platform with the rest of `.reticle/` instead of dying with the session that held them.
|
|
16
|
+
*
|
|
17
|
+
* Never throws: a note that cannot be written must not break the event that carried it.
|
|
18
|
+
*/
|
|
19
|
+
export declare function recordNotes(reticleRoot: string | undefined, marks: readonly ReviewMark[]): void;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { mkdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { ReticleDir } from '@reticlehq/core';
|
|
5
|
+
/** Enough for a project's review history; the oldest fall off first. */
|
|
6
|
+
const MAX_NOTES = 500;
|
|
7
|
+
/**
|
|
8
|
+
* Mark ids (`m1`, `m2`, …) restart with the daemon, so they cannot name a note across sessions.
|
|
9
|
+
* The route, anchor and words can: the same complaint on the same element is the same note.
|
|
10
|
+
*/
|
|
11
|
+
export function noteKey(mark) {
|
|
12
|
+
return createHash('sha256')
|
|
13
|
+
.update(`${mark.route ?? ''}\n${mark.anchor}\n${mark.note}`)
|
|
14
|
+
.digest('hex')
|
|
15
|
+
.slice(0, 16);
|
|
16
|
+
}
|
|
17
|
+
function read(path) {
|
|
18
|
+
try {
|
|
19
|
+
const parsed = JSON.parse(readFileSync(path, 'utf8'));
|
|
20
|
+
return { notes: 'object' === typeof parsed.notes && null !== parsed.notes ? parsed.notes : {} };
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return { notes: {} };
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Merge one session's marks into the project's notes file, so the HUD notes a human left reach the
|
|
28
|
+
* platform with the rest of `.reticle/` instead of dying with the session that held them.
|
|
29
|
+
*
|
|
30
|
+
* Never throws: a note that cannot be written must not break the event that carried it.
|
|
31
|
+
*/
|
|
32
|
+
export function recordNotes(reticleRoot, marks) {
|
|
33
|
+
if (reticleRoot === undefined || 0 === marks.length)
|
|
34
|
+
return;
|
|
35
|
+
const path = join(reticleRoot, ReticleDir.NOTES_FILE);
|
|
36
|
+
try {
|
|
37
|
+
const held = read(path).notes;
|
|
38
|
+
for (const { id: _id, at: _at, ...note } of marks) {
|
|
39
|
+
const key = noteKey(note);
|
|
40
|
+
// Re-inserted so a note touched now counts as the newest when the oldest are dropped.
|
|
41
|
+
delete held[key];
|
|
42
|
+
held[key] = note;
|
|
43
|
+
}
|
|
44
|
+
const keys = Object.keys(held);
|
|
45
|
+
for (const stale of keys.slice(0, Math.max(0, keys.length - MAX_NOTES)))
|
|
46
|
+
delete held[stale];
|
|
47
|
+
mkdirSync(reticleRoot, { recursive: true });
|
|
48
|
+
const tmp = `${path}.${String(process.pid)}.tmp`;
|
|
49
|
+
writeFileSync(tmp, `${JSON.stringify({ notes: held }, null, 2)}\n`, 'utf8');
|
|
50
|
+
renameSync(tmp, path);
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
// Disk full or read-only checkout: the note is still in the session, just not on the platform.
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -30,8 +30,20 @@ interface ResolveOutcome {
|
|
|
30
30
|
/** The retired mark's note. Absent when nothing was resolved. */
|
|
31
31
|
note?: string;
|
|
32
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Per-session store of human review marks (the "annotate the bug where you see it" inbox). A mark is
|
|
35
|
+
* added when a HUMAN_MARK event arrives, listed by the agent via reticle_review, and retired with
|
|
36
|
+
* resolve when the agent claims the fix — distinct from the live-control inbox, which is drained
|
|
37
|
+
* (delivered-once) on read. Marks persist (read does not consume) so the agent can list, fix, and
|
|
38
|
+
* THEN resolve, and a fix can be verified against the same mark.
|
|
39
|
+
*
|
|
40
|
+
* No IO of its own and no clock: `onChange` is how a caller keeps it on disk (see notes-ledger.ts).
|
|
41
|
+
* The id is a monotonic counter (m1, m2, …) so it is deterministic and never depends on
|
|
42
|
+
* Math.random/Date.now; the timestamp is passed in by the caller.
|
|
43
|
+
*/
|
|
33
44
|
export declare class ReviewStore {
|
|
34
45
|
#private;
|
|
46
|
+
constructor(onChange?: (marks: ReviewMark[]) => void);
|
|
35
47
|
/** Store a new mark (status pending) stamped with the caller-supplied session-relative time. */
|
|
36
48
|
add(data: HumanMarkData, at: number): ReviewMark;
|
|
37
49
|
/** All marks still awaiting a fix, oldest first. Reading never consumes — resolve retires a mark. */
|
|
@@ -1,14 +1,4 @@
|
|
|
1
1
|
import { MarkStatus } from '@reticlehq/core';
|
|
2
|
-
/**
|
|
3
|
-
* Per-session store of human review marks (the "annotate the bug where you see it" inbox). A mark is
|
|
4
|
-
* added when a HUMAN_MARK event arrives, listed by the agent via reticle_review, and retired with
|
|
5
|
-
* resolve when the agent claims the fix — distinct from the live-control inbox, which is drained
|
|
6
|
-
* (delivered-once) on read. Marks persist (read does not consume) so the agent can list, fix, and
|
|
7
|
-
* THEN resolve, and a fix can be verified against the same mark.
|
|
8
|
-
*
|
|
9
|
-
* Pure in-memory state: no IO, no clock. The id is a monotonic counter (m1, m2, …) so it is
|
|
10
|
-
* deterministic and never depends on Math.random/Date.now; the timestamp is passed in by the caller.
|
|
11
|
-
*/
|
|
12
2
|
/** Prefix on review-mark ids (m1, m2, …) — distinguishes them from command ids. */
|
|
13
3
|
const MARK_ID_PREFIX = 'm';
|
|
14
4
|
/**
|
|
@@ -29,8 +19,24 @@ let nextMarkId = 0;
|
|
|
29
19
|
export function resetMarkIdsForTest() {
|
|
30
20
|
nextMarkId = 0;
|
|
31
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Per-session store of human review marks (the "annotate the bug where you see it" inbox). A mark is
|
|
24
|
+
* added when a HUMAN_MARK event arrives, listed by the agent via reticle_review, and retired with
|
|
25
|
+
* resolve when the agent claims the fix — distinct from the live-control inbox, which is drained
|
|
26
|
+
* (delivered-once) on read. Marks persist (read does not consume) so the agent can list, fix, and
|
|
27
|
+
* THEN resolve, and a fix can be verified against the same mark.
|
|
28
|
+
*
|
|
29
|
+
* No IO of its own and no clock: `onChange` is how a caller keeps it on disk (see notes-ledger.ts).
|
|
30
|
+
* The id is a monotonic counter (m1, m2, …) so it is deterministic and never depends on
|
|
31
|
+
* Math.random/Date.now; the timestamp is passed in by the caller.
|
|
32
|
+
*/
|
|
32
33
|
export class ReviewStore {
|
|
33
34
|
#marks = [];
|
|
35
|
+
/** Told the full history after every add and resolve, so a caller can keep it on disk. */
|
|
36
|
+
#onChange;
|
|
37
|
+
constructor(onChange) {
|
|
38
|
+
this.#onChange = onChange;
|
|
39
|
+
}
|
|
34
40
|
/** Store a new mark (status pending) stamped with the caller-supplied session-relative time. */
|
|
35
41
|
add(data, at) {
|
|
36
42
|
nextMarkId += 1;
|
|
@@ -49,6 +55,7 @@ export class ReviewStore {
|
|
|
49
55
|
if (data.route !== undefined)
|
|
50
56
|
mark.route = data.route;
|
|
51
57
|
this.#marks.push(mark);
|
|
58
|
+
this.#onChange?.(this.all());
|
|
52
59
|
return mark;
|
|
53
60
|
}
|
|
54
61
|
/** All marks still awaiting a fix, oldest first. Reading never consumes — resolve retires a mark. */
|
|
@@ -84,6 +91,7 @@ export class ReviewStore {
|
|
|
84
91
|
if (mark === undefined || mark.status === MarkStatus.RESOLVED)
|
|
85
92
|
return { resolved: false, id };
|
|
86
93
|
mark.status = MarkStatus.RESOLVED;
|
|
94
|
+
this.#onChange?.(this.all());
|
|
87
95
|
return { resolved: true, id, note: mark.note };
|
|
88
96
|
}
|
|
89
97
|
}
|
|
@@ -1,15 +1,2 @@
|
|
|
1
1
|
import type { ToolDef } from '../../surface/tools/tool-kit.js';
|
|
2
|
-
/**
|
|
3
|
-
* Live-control agent tools: the agent's side of the human-in-the-loop control surface.
|
|
4
|
-
*
|
|
5
|
-
* - reticle_end_session: terminal stop. Sets state `ended` and syncs the panel (PRESENTER) with an
|
|
6
|
-
* optional summary. Idempotent — ending an already-ended session is a safe no-op.
|
|
7
|
-
* - reticle_resume: clears a human pause. Sets state `active` and syncs the panel.
|
|
8
|
-
* - reticle_messages: explicit poll — drains and returns the queued human notes.
|
|
9
|
-
*
|
|
10
|
-
* State changes go through `setState`, which echoes the state to the panel in a SINGLE PRESENTER
|
|
11
|
-
* push (optionally carrying human-facing text, e.g. the end summary) — a transition never emits two
|
|
12
|
-
* PRESENTER commands. No clock is read here — inbox stamps were assigned by the session's injected
|
|
13
|
-
* elapsed clock at enqueue time.
|
|
14
|
-
*/
|
|
15
2
|
export declare const LIVE_CONTROL_TOOLS: ToolDef[];
|
|
@@ -1,12 +1,45 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { noteEmptyRead } from '../../surface/tools/gaps/observed-nothing.js';
|
|
3
|
-
import { AGENT_ASK_NOTICE, AGENT_WAITING_NOTICE, PresenterTone, SessionState, YIELD_WITHOUT_SESSION_NOTE, } from '@reticlehq/core';
|
|
3
|
+
import { AGENT_ASK_NOTICE, AGENT_WAITING_NOTICE, PresenterTone, SessionState, VerdictStatus, YIELD_WITHOUT_SESSION_NOTE, } from '@reticlehq/core';
|
|
4
4
|
import { ReticleTool } from '@reticlehq/core';
|
|
5
5
|
import { sessionIdShape } from '../../surface/tools/tool-kit.js';
|
|
6
6
|
import { asString } from '@reticlehq/core';
|
|
7
|
+
import { releaseLease } from '../../surface/tools/lease-tools.js';
|
|
7
8
|
import { gapReportLines } from '../../judgement/runs/artifact/gap-report.js';
|
|
8
9
|
import { gapSummary } from '../../judgement/runs/artifact/gap-summary.js';
|
|
9
|
-
import {
|
|
10
|
+
import { RESULT_FIELD, claimAgainstGrade, endedAgentSession, verdictsSettled, resultField, sessionResult, } from '../../surface/tools/reticle-result.js';
|
|
11
|
+
/** The tab's journal once every verdict in flight has been decided and written. */
|
|
12
|
+
async function settledJournal(session) {
|
|
13
|
+
await verdictsSettled();
|
|
14
|
+
await session.flushJournal?.();
|
|
15
|
+
return session.readJournalActions();
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The session an id-less yield hands back.
|
|
19
|
+
*
|
|
20
|
+
* Yield is non-destructive: it only gives the tab back to the human. With several projects connected,
|
|
21
|
+
* an id-less call hit the same "which session?" refusal a destructive action gets, so an agent that
|
|
22
|
+
* had just finished driving one tab had to look its id up in order to let go of it (#1258). When the
|
|
23
|
+
* ordinary resolution refuses, the one connected session this caller has DRIVEN (it holds a
|
|
24
|
+
* remembered act) is the clear candidate. None, or more than one, and the refusal stands: guessing
|
|
25
|
+
* which of two driven tabs to release is still a guess.
|
|
26
|
+
*/
|
|
27
|
+
function resolveYieldTarget(sessions, requested) {
|
|
28
|
+
if (requested !== undefined)
|
|
29
|
+
return sessions.resolve(requested);
|
|
30
|
+
try {
|
|
31
|
+
return sessions.resolve();
|
|
32
|
+
}
|
|
33
|
+
catch (refusal) {
|
|
34
|
+
// In scope only: a tab the project scope refuses to hand over is not this caller's to release.
|
|
35
|
+
const driven = sessions.inScope().filter((s) => s.lastAct.cursor() !== undefined);
|
|
36
|
+
const [only] = driven;
|
|
37
|
+
if (1 !== driven.length || only === undefined)
|
|
38
|
+
throw refusal;
|
|
39
|
+
only.markAgentActivity();
|
|
40
|
+
return only;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
10
43
|
/**
|
|
11
44
|
* Is this a turn ending with nothing attached, rather than a call about a specific tab?
|
|
12
45
|
*
|
|
@@ -34,18 +67,49 @@ function endingTurnWithNothingAttached(deps, id) {
|
|
|
34
67
|
* PRESENTER commands. No clock is read here — inbox stamps were assigned by the session's injected
|
|
35
68
|
* elapsed clock at enqueue time.
|
|
36
69
|
*/
|
|
70
|
+
const DISCONNECT_NEEDS_SESSION_ID = '`disconnect: true` needs the `sessionId` of the page to detach — list them with ' +
|
|
71
|
+
'reticle_session{action:"list"}; it is never picked for you, because detaching the wrong window ' +
|
|
72
|
+
'cuts you off from the app.';
|
|
73
|
+
/** The agent's claim, when it is one of the words a run verdict uses. */
|
|
74
|
+
function claimOf(value) {
|
|
75
|
+
const claims = [
|
|
76
|
+
VerdictStatus.PASS,
|
|
77
|
+
VerdictStatus.FAIL,
|
|
78
|
+
VerdictStatus.PARTIAL,
|
|
79
|
+
];
|
|
80
|
+
return claims.includes(value) ? value : undefined;
|
|
81
|
+
}
|
|
37
82
|
export const LIVE_CONTROL_TOOLS = [
|
|
38
83
|
{
|
|
39
84
|
name: ReticleTool.END_SESSION,
|
|
40
85
|
description: 'End this session for good — use ONLY when the whole task is complete. Sets state "ended" ' +
|
|
41
86
|
'(calm, terminal) and shows the optional `summary` on the panel. If you are just finishing a ' +
|
|
42
|
-
'turn or waiting on the human, call reticle_session{action:"yield"} instead (revivable). Idempotent.'
|
|
43
|
-
|
|
87
|
+
'turn or waiting on the human, call reticle_session{action:"yield"} instead (revivable). Idempotent. ' +
|
|
88
|
+
"With `disconnect: true` and a `sessionId` it also closes that page's connection and refuses it " +
|
|
89
|
+
'until the daemon restarts — for a stray window (a hidden desktop webview, a 404 page) that keeps coming back. ' +
|
|
90
|
+
'Ending a tab you leased also releases that lease (`leaseReleased: true`).',
|
|
91
|
+
inputSchema: {
|
|
92
|
+
summary: z.string().optional(),
|
|
93
|
+
claim: z
|
|
94
|
+
.enum([VerdictStatus.PASS, VerdictStatus.FAIL, VerdictStatus.PARTIAL])
|
|
95
|
+
.optional()
|
|
96
|
+
.describe('What YOU claim this session showed. Compared with the graded checks, never used as them.'),
|
|
97
|
+
disconnect: z
|
|
98
|
+
.boolean()
|
|
99
|
+
.optional()
|
|
100
|
+
.describe('Also detach this page for good (needs sessionId). Reloads stay detached.'),
|
|
101
|
+
...sessionIdShape,
|
|
102
|
+
},
|
|
44
103
|
// `sessionId` is optional because there may genuinely not be one — see the no-op below. An
|
|
45
104
|
// empty string would read as a real id in a log, which is worse than its absence.
|
|
46
105
|
outputSchema: {
|
|
47
106
|
ended: z.boolean(),
|
|
48
107
|
sessionId: z.string().optional(),
|
|
108
|
+
disconnected: z.boolean().optional(),
|
|
109
|
+
leaseReleased: z
|
|
110
|
+
.boolean()
|
|
111
|
+
.optional()
|
|
112
|
+
.describe('True when the ended tab was your lease: its context is closed and its slot freed.'),
|
|
49
113
|
note: z.string().optional(),
|
|
50
114
|
talk_to_us: z
|
|
51
115
|
.string()
|
|
@@ -55,9 +119,16 @@ export const LIVE_CONTROL_TOOLS = [
|
|
|
55
119
|
.array(z.string())
|
|
56
120
|
.optional()
|
|
57
121
|
.describe('What this session claimed and what held — an `unknown` is never counted as held.'),
|
|
122
|
+
[RESULT_FIELD]: z.string().optional(),
|
|
123
|
+
claim: z.object({ claimed: z.string(), graded: z.string(), agrees: z.boolean() }).optional(),
|
|
58
124
|
},
|
|
59
125
|
handler: (deps, args) => {
|
|
60
126
|
const requested = asString(args['sessionId']);
|
|
127
|
+
const detach = true === args['disconnect'];
|
|
128
|
+
const claim = claimOf(args['claim']);
|
|
129
|
+
// Named, never auto-picked: detaching the wrong window cuts the agent off from the app.
|
|
130
|
+
if (detach && requested === undefined)
|
|
131
|
+
throw new Error(DISCONNECT_NEEDS_SESSION_ID);
|
|
61
132
|
if (endingTurnWithNothingAttached(deps, requested)) {
|
|
62
133
|
return Promise.resolve({ ended: true, note: YIELD_WITHOUT_SESSION_NOTE });
|
|
63
134
|
}
|
|
@@ -90,14 +161,39 @@ export const LIVE_CONTROL_TOOLS = [
|
|
|
90
161
|
// rather than becoming a rejected promise the caller did not expect.
|
|
91
162
|
const session = deps.sessions.resolve(requested);
|
|
92
163
|
const summary = asString(args['summary']);
|
|
93
|
-
|
|
164
|
+
// A verdict still being decided (an assert waiting out its budget) is one of this session's
|
|
165
|
+
// checks: decided and journaled before the session's result is folded, never after it.
|
|
166
|
+
return settledJournal(session).then(async (all) => {
|
|
167
|
+
// This agent session only: its own calls since its last end, never the Harness drives the
|
|
168
|
+
// tab also holds, and under its own run id so a later end does not overwrite this run.
|
|
169
|
+
const ended = endedAgentSession(session.id, all, session.elapsed?.(), claim);
|
|
170
|
+
const actions = ended.actions;
|
|
94
171
|
// The moment the agent calls the task complete is when "and what did not hold" is worth a
|
|
95
172
|
// line: the same fold `reticle_context` and `reticle report` serve, so they cannot disagree.
|
|
96
173
|
const gap = gapReportLines(gapSummary(actions));
|
|
97
174
|
const panel = [summary, gap[0]].filter((line) => line !== undefined);
|
|
98
175
|
// One PRESENTER push for the transition; the summary and the gap headline ride together.
|
|
99
176
|
session.setState(SessionState.ENDED, 0 === panel.length ? undefined : panel.join('\n'));
|
|
100
|
-
|
|
177
|
+
if (detach)
|
|
178
|
+
deps.sessions.park(session);
|
|
179
|
+
const answer = {
|
|
180
|
+
ended: true,
|
|
181
|
+
sessionId: session.id,
|
|
182
|
+
...(detach ? { disconnected: true } : {}),
|
|
183
|
+
gap,
|
|
184
|
+
// No founder's-call invite here: it is offered to someone stuck (an error, an empty
|
|
185
|
+
// session list), never at the end of every task.
|
|
186
|
+
...(claim === undefined ? {} : { claim: claimAgainstGrade(claim, actions) }),
|
|
187
|
+
...resultField(() => sessionResult(deps, session.id, actions, ended.wallMs, ended.runId)),
|
|
188
|
+
};
|
|
189
|
+
// An ended lease left connected kept the tab registered until the reaper took it, so the
|
|
190
|
+
// next agent's every id-less call was refused as ambiguous. Released after the answer is
|
|
191
|
+
// folded, because releasing closes the tab. Only this caller's own lease, never another's.
|
|
192
|
+
const pool = deps.pool;
|
|
193
|
+
if (pool === undefined || !pool.heldBy(session.id, deps.attachId))
|
|
194
|
+
return answer;
|
|
195
|
+
await releaseLease(deps, pool, session.id);
|
|
196
|
+
return { ...answer, leaseReleased: true };
|
|
101
197
|
});
|
|
102
198
|
},
|
|
103
199
|
},
|
|
@@ -135,7 +231,7 @@ export const LIVE_CONTROL_TOOLS = [
|
|
|
135
231
|
note: YIELD_WITHOUT_SESSION_NOTE,
|
|
136
232
|
});
|
|
137
233
|
}
|
|
138
|
-
const session = deps.sessions
|
|
234
|
+
const session = resolveYieldTarget(deps.sessions, requested);
|
|
139
235
|
const note = asString(args['note']);
|
|
140
236
|
const tone = ask ? PresenterTone.ASK : PresenterTone.WAITING;
|
|
141
237
|
const text = ask && note !== undefined && note.trim().length > 0
|
|
@@ -202,12 +298,10 @@ export const LIVE_CONTROL_TOOLS = [
|
|
|
202
298
|
// said nothing; the second means an agent is waiting on a channel that does not exist.
|
|
203
299
|
return Promise.resolve(noteEmptyRead({ messages }, 'messages', {
|
|
204
300
|
noun: 'messages from the human since the last poll',
|
|
205
|
-
// The HUD
|
|
206
|
-
//
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
caveat: 'the HUD has no message box, so nothing currently sends on this channel — an empty ' +
|
|
210
|
-
'queue here is not evidence about what the human thinks',
|
|
301
|
+
// The HUD's note box is the one producer, and every tool result already carries what it
|
|
302
|
+
// sends, so polling this is rarely needed and silence here is only silence so far.
|
|
303
|
+
caveat: 'notes from the HUD also arrive inline on any Reticle tool result (`control.guidance`), ' +
|
|
304
|
+
'so an empty queue means nothing new since the last call, not that the human agrees',
|
|
211
305
|
}));
|
|
212
306
|
},
|
|
213
307
|
},
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A narration line for the HUD, and who it is from.
|
|
3
|
+
*
|
|
4
|
+
* A Harness line names the Harness, so the HUD files it in the Harness log rather than the Agent
|
|
5
|
+
* Log: two drivers in one log read as one muddle and credited the agent with the Harness's steps. A
|
|
6
|
+
* `summary` line (a run starting or ending) is shown in the Agent Log too, because the agent that
|
|
7
|
+
* asked for the run reports its result.
|
|
8
|
+
*/
|
|
9
|
+
import { CommandActor } from '@reticlehq/core';
|
|
10
|
+
export function narrationArgs(text, by) {
|
|
11
|
+
return {
|
|
12
|
+
text,
|
|
13
|
+
level: 'info',
|
|
14
|
+
...(by === undefined ? {} : { actor: CommandActor.HARNESS }),
|
|
15
|
+
...(true === by?.summary ? { summary: true } : {}),
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -166,6 +166,13 @@ export interface NoSessionFacts {
|
|
|
166
166
|
* or the ring has forgotten — inventing a URL is worse than the silence this exists to end.
|
|
167
167
|
*/
|
|
168
168
|
lastKnownUrl?: string;
|
|
169
|
+
/**
|
|
170
|
+
* Where the departed tab was seen heading, when the SDK reported a navigation just before the
|
|
171
|
+
* socket closed (#1256). Separate from `lastKnownUrl` — the old origin — because the 5xx probe
|
|
172
|
+
* and successor matching need the page the tab was ON, while the diagnosis needs where it was
|
|
173
|
+
* GOING. Absent unless the departure note arrived fresh.
|
|
174
|
+
*/
|
|
175
|
+
departedTo?: string;
|
|
169
176
|
/**
|
|
170
177
|
* What a plain GET of `lastKnownUrl` answered, done out of band by the watch after the session
|
|
171
178
|
* went. The one fact that separates a server error from a closed tab and from an install
|
|
@@ -179,7 +186,7 @@ export interface NoSessionFacts {
|
|
|
179
186
|
* recovery: a message that already carries its own next action must not be handed a second, more
|
|
180
187
|
* generic one that contradicts it.
|
|
181
188
|
*/
|
|
182
|
-
export declare const SELF_RECOVERING_MARKER = "Then call
|
|
189
|
+
export declare const SELF_RECOVERING_MARKER = "Then call reticle_session { action: \"list\" } again \u2014 it will appear within a second of the page loading.";
|
|
183
190
|
/**
|
|
184
191
|
* The diagnosis, and the CODE for the branch that produced it.
|
|
185
192
|
*
|