@reticlehq/server 2.14.0 → 3.2.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/SKILL.md +54 -136
- package/bin/reticle.js +1 -1
- package/dist/command/cli/adhoc-verdict.d.ts +64 -0
- package/dist/command/cli/adhoc-verdict.js +144 -0
- package/dist/command/cli/answers/status-next-action.d.ts +61 -0
- package/dist/command/cli/answers/status-next-action.js +84 -0
- package/dist/command/cli/auth/cloud-keystore.js +97 -0
- package/dist/command/cli/auth/device-flow.d.ts +76 -0
- package/dist/command/cli/auth/device-flow.js +56 -0
- package/dist/command/cli/cli-doctor.js +215 -0
- package/dist/command/cli/cli-flow-commands.d.ts +47 -0
- package/dist/command/cli/cli-flow-commands.js +255 -0
- package/dist/command/cli/cli-kill.d.ts +59 -0
- package/dist/command/cli/cli-kill.js +162 -0
- package/dist/command/cli/cli-parse-grammar.d.ts +29 -0
- package/dist/command/cli/cli-parse-grammar.js +39 -0
- package/dist/command/cli/cli-parse-verify.d.ts +22 -0
- package/dist/command/cli/cli-parse-verify.js +143 -0
- package/dist/command/cli/cli-parse.d.ts +193 -0
- package/dist/command/cli/cli-parse.js +833 -0
- package/dist/command/cli/cli-update-commands.js +112 -0
- package/dist/command/cli/cli-verify.d.ts +124 -0
- package/dist/command/cli/cli-verify.js +426 -0
- package/dist/command/cli/cloud-cli.js +694 -0
- package/dist/command/cli/cloud-kit.d.ts +37 -0
- package/dist/command/cli/cloud-kit.js +117 -0
- package/dist/command/cli/cloud-login.js +183 -0
- package/dist/command/cli/config/config-discovery.d.ts +48 -0
- package/dist/command/cli/config/config-discovery.js +183 -0
- package/dist/command/cli/daemon-start-options.d.ts +33 -0
- package/dist/command/cli/demo/demo-page.d.ts +78 -0
- package/dist/command/cli/demo/demo-page.js +238 -0
- package/dist/command/cli/demo/demo-run.d.ts +38 -0
- package/dist/command/cli/demo/demo-run.js +138 -0
- package/dist/command/cli/doctor/doctor-daemon-line.js +47 -0
- package/dist/command/cli/doctor/doctor-rows.d.ts +75 -0
- package/dist/command/cli/doctor/doctor-rows.js +77 -0
- package/dist/command/cli/doctor/doctor-sessions-line.js +69 -0
- package/dist/command/cli/drive/drive-attach.d.ts +113 -0
- package/dist/command/cli/drive/drive-attach.js +221 -0
- package/dist/command/cli/drive/drive-command.js +107 -0
- package/dist/command/cli/launch/cli-launch.d.ts +100 -0
- package/dist/command/cli/launch/cli-launch.js +216 -0
- package/dist/command/cli/lifecycle/daemon-lifecycle.d.ts +33 -0
- package/dist/command/cli/lifecycle/daemon-lifecycle.js +198 -0
- package/dist/command/cli/mcp-command.js +176 -0
- package/dist/command/cli/ports/port-holder.js +123 -0
- package/dist/command/cli/ports/resolve/cli-port.d.ts +71 -0
- package/dist/command/cli/ports/resolve/cli-port.js +140 -0
- package/dist/command/cli/setup-mcp-cli.d.ts +29 -0
- package/dist/command/cli/setup-mcp-cli.js +107 -0
- package/dist/command/cli/status/status-lines.d.ts +28 -0
- package/dist/command/cli/status/status-lines.js +117 -0
- package/dist/command/cli/status-fields.d.ts +28 -0
- package/dist/command/cli/status-fields.js +29 -0
- package/dist/command/cli/tutorial.d.ts +116 -0
- package/dist/command/cli/tutorial.js +189 -0
- package/dist/command/cli-onboarding.d.ts +21 -0
- package/dist/command/cli-onboarding.js +27 -0
- package/dist/command/cli.d.ts +6 -0
- package/dist/command/cli.js +710 -0
- package/dist/command/daemon/binding/daemon-status-probe.d.ts +2 -0
- package/dist/command/daemon/binding/daemon-status-probe.js +48 -0
- package/dist/command/daemon/binding/loopback-reach.d.ts +42 -0
- package/dist/command/daemon/binding/loopback-reach.js +63 -0
- package/dist/command/daemon/daemon-resilience.d.ts +86 -0
- package/dist/command/daemon/daemon-resilience.js +339 -0
- package/dist/command/daemon/daemon-resolve.d.ts +113 -0
- package/dist/command/daemon/daemon-resolve.js +187 -0
- package/dist/command/daemon/daemon.d.ts +86 -0
- package/dist/command/daemon/daemon.js +333 -0
- package/dist/command/daemon/idle-shutdown.d.ts +54 -0
- package/dist/command/daemon/idle-shutdown.js +98 -0
- package/dist/command/daemon/lifetime/daemon-usefulness.d.ts +60 -0
- package/dist/command/daemon/lifetime/daemon-usefulness.js +61 -0
- package/dist/command/daemon/lifetime/heartbeat.d.ts +119 -0
- package/dist/command/daemon/lifetime/heartbeat.js +151 -0
- package/dist/command/daemon/lifetime/idle-grace.d.ts +32 -0
- package/dist/command/daemon/lifetime/idle-grace.js +41 -0
- package/dist/command/daemon/lifetime/log-cap.d.ts +68 -0
- package/dist/command/daemon/lifetime/log-cap.js +115 -0
- package/dist/command/daemon/state-dir.js +59 -0
- package/dist/command/daemon/wake-decision.d.ts +32 -0
- package/dist/command/daemon/wake-decision.js +38 -0
- package/dist/command/dev/stale-issue-guard.d.ts +35 -0
- package/dist/command/dev/stale-issue-guard.js +69 -0
- package/dist/command/setup/agent-configs.d.ts +111 -0
- package/dist/command/setup/agent-configs.js +365 -0
- package/dist/command/setup/agent-notice-memory.d.ts +16 -0
- package/dist/command/setup/agent-notice-memory.js +65 -0
- package/dist/command/setup/agent-writer.d.ts +52 -0
- package/dist/command/setup/agent-writer.js +116 -0
- package/dist/command/setup/auto-approve.js +153 -0
- package/dist/command/setup/bringup/bridge-port.d.ts +15 -0
- package/dist/command/setup/bringup/bridge-port.js +24 -0
- package/dist/command/setup/bringup/dev-server-wait.d.ts +69 -0
- package/dist/command/setup/bringup/dev-server-wait.js +83 -0
- package/dist/command/setup/bringup/ensure-daemon.js +58 -0
- package/dist/command/setup/init/init-host.js +37 -0
- package/dist/command/setup/init/init-runtime.d.ts +39 -0
- package/dist/command/setup/init/init-runtime.js +168 -0
- package/dist/command/setup/node-effects.d.ts +63 -0
- package/dist/command/setup/node-effects.js +225 -0
- package/dist/command/setup/probe/page-probe.d.ts +71 -0
- package/dist/command/setup/probe/page-probe.js +89 -0
- package/dist/command/setup/remaining-steps.js +53 -0
- package/dist/command/setup/run-setup.d.ts +123 -0
- package/dist/command/setup/run-setup.js +316 -0
- package/dist/command/setup/setup-command.d.ts +48 -0
- package/dist/command/setup/setup-command.js +224 -0
- package/dist/command/setup/setup-install.d.ts +18 -0
- package/dist/command/setup/setup-install.js +40 -0
- package/dist/command/setup/setup-mcp.d.ts +57 -0
- package/dist/command/setup/setup-mcp.js +92 -0
- package/dist/command/setup/setup-options.d.ts +66 -0
- package/dist/command/setup/setup-options.js +63 -0
- package/dist/command/setup/terminal/confirm.js +206 -0
- package/dist/command/setup/terminal/crash.d.ts +55 -0
- package/dist/command/setup/terminal/crash.js +74 -0
- package/dist/command/update/nudge-credit.js +53 -0
- package/dist/command/update/sdk-sync.d.ts +20 -0
- package/dist/command/update/sdk-sync.js +22 -0
- package/dist/command/update/update-checker.js +122 -0
- package/dist/command/update/update-nudge.d.ts +90 -0
- package/dist/command/update/update-nudge.js +211 -0
- package/dist/command/update/updater.d.ts +81 -0
- package/dist/command/update/updater.js +223 -0
- package/dist/command/version/identity/server-version.js +50 -0
- package/dist/command/version/peer-announce.js +32 -0
- package/dist/command/version/sdk-fix.js +127 -0
- package/dist/command/version/version-nudge.js +61 -0
- package/dist/command/version/version-skew.d.ts +113 -0
- package/dist/command/version/version-skew.js +192 -0
- package/dist/features/crawl/crawl-tools.d.ts +7 -0
- package/dist/features/crawl/crawl-tools.js +89 -0
- package/dist/features/crawl/crawl.d.ts +98 -0
- package/dist/features/crawl/crawl.js +444 -0
- package/dist/features/ee/audit-log.js +11 -0
- package/dist/features/harness/drive-report.d.ts +73 -0
- package/dist/features/harness/drive-report.js +196 -0
- package/dist/features/harness/driver.d.ts +50 -0
- package/dist/features/harness/driver.js +239 -0
- package/dist/features/harness/drivers.d.ts +19 -0
- package/dist/features/harness/drivers.js +19 -0
- package/dist/features/harness/fill-values.d.ts +67 -0
- package/dist/features/harness/fill-values.js +153 -0
- package/dist/features/harness/harness.d.ts +159 -0
- package/dist/features/harness/harness.js +203 -0
- package/dist/features/harness/jev-driver.d.ts +188 -0
- package/dist/features/harness/jev-driver.js +664 -0
- package/dist/features/harness/openai-driver.d.ts +46 -0
- package/dist/features/harness/openai-driver.js +197 -0
- package/dist/features/harness/platform-config.d.ts +52 -0
- package/dist/features/harness/platform-config.js +89 -0
- package/dist/features/harness/with-timeout.d.ts +18 -0
- package/dist/features/harness/with-timeout.js +34 -0
- package/dist/features/license/license-env.d.ts +24 -0
- package/dist/features/license/license-env.js +140 -0
- package/dist/features/license/license.d.ts +161 -0
- package/dist/features/license/license.js +287 -0
- package/dist/features/visual/visual-store.d.ts +22 -0
- package/dist/features/visual/visual-store.js +66 -0
- package/dist/features/visual/visual-tools.d.ts +26 -0
- package/dist/features/visual/visual-tools.js +352 -0
- package/dist/hooks/hook-bus.d.ts +53 -0
- package/dist/hooks/hook-bus.js +106 -0
- package/dist/hooks/hook-commands.d.ts +59 -0
- package/dist/hooks/hook-commands.js +184 -0
- package/dist/hooks/hook-emit.d.ts +44 -0
- package/dist/hooks/hook-emit.js +85 -0
- package/dist/import-graph.d.ts +48 -0
- package/dist/import-graph.js +106 -0
- package/dist/index.d.ts +91 -125
- package/dist/index.js +250 -160
- package/dist/judgement/capsule/capsule-store.d.ts +70 -0
- package/dist/judgement/capsule/capsule-store.js +113 -0
- package/dist/judgement/capsule/capsule.d.ts +42 -0
- package/dist/judgement/capsule/capsule.js +73 -0
- package/dist/judgement/capsule/causal-summary.d.ts +119 -0
- package/dist/judgement/capsule/causal-summary.js +172 -0
- package/dist/judgement/capsule/divergence.d.ts +26 -0
- package/dist/judgement/domain/domain-model.js +126 -0
- package/dist/judgement/domain/domain-tools.d.ts +2 -0
- package/dist/judgement/domain/domain-tools.js +96 -0
- package/dist/judgement/domain/flow-risk.js +80 -0
- package/dist/judgement/oracles/propose-consequences.d.ts +22 -0
- package/dist/judgement/oracles/propose-consequences.js +106 -0
- package/dist/judgement/outcome/predicate-to-expect.d.ts +44 -0
- package/dist/judgement/outcome/predicate-to-expect.js +148 -0
- package/dist/judgement/runs/artifact/build-verification-run.d.ts +34 -0
- package/dist/judgement/runs/artifact/build-verification-run.js +83 -0
- package/dist/judgement/runs/artifact/render-report.js +84 -0
- package/dist/judgement/runs/artifact/replay-mapping.js +34 -0
- package/dist/judgement/runs/artifact/run-store.d.ts +54 -0
- package/dist/judgement/runs/artifact/run-store.js +150 -0
- package/dist/judgement/runs/artifact/to-artifact.d.ts +119 -0
- package/dist/judgement/runs/artifact/to-artifact.js +83 -0
- package/dist/judgement/runs/context-tools.d.ts +2 -0
- package/dist/judgement/runs/context-tools.js +70 -0
- package/dist/judgement/runs/default-run-id.d.ts +8 -0
- package/dist/judgement/runs/default-run-id.js +11 -0
- package/dist/judgement/runs/drive-run.d.ts +61 -0
- package/dist/judgement/runs/drive-run.js +130 -0
- package/dist/judgement/runs/late-answer.d.ts +55 -0
- package/dist/judgement/runs/late-answer.js +81 -0
- package/dist/judgement/runs/reticle-runner.d.ts +60 -0
- package/dist/judgement/runs/reticle-runner.js +95 -0
- package/dist/judgement/runs/run-tools.d.ts +17 -0
- package/dist/judgement/runs/run-tools.js +97 -0
- package/dist/judgement/runs/runner-port.d.ts +11 -0
- package/dist/judgement/runs/runner-port.js +18 -0
- package/dist/judgement/runs/verification-sync.d.ts +13 -0
- package/dist/judgement/runs/verification-sync.js +93 -0
- package/dist/language/flows/affected-tools.d.ts +18 -0
- package/dist/language/flows/affected-tools.js +83 -0
- package/dist/language/flows/annotate-tools.d.ts +15 -0
- package/dist/language/flows/annotate-tools.js +179 -0
- package/dist/language/flows/change/affected.d.ts +24 -0
- package/dist/language/flows/change/affected.js +35 -0
- package/dist/language/flows/change/flow-sources.d.ts +19 -0
- package/dist/language/flows/change/flow-sources.js +55 -0
- package/dist/language/flows/change/gate.js +33 -0
- package/dist/language/flows/decision.d.ts +45 -0
- package/dist/language/flows/decision.js +371 -0
- package/dist/language/flows/empty-flow.js +24 -0
- package/dist/language/flows/fields/flow-secret-field.d.ts +53 -0
- package/dist/language/flows/fields/flow-secret-field.js +75 -0
- package/dist/language/flows/fields/flow-upload-resolve.d.ts +23 -0
- package/dist/language/flows/fields/flow-upload-resolve.js +46 -0
- package/dist/language/flows/flow-anchor.d.ts +59 -0
- package/dist/language/flows/flow-anchor.js +240 -0
- package/dist/language/flows/flow-classify.d.ts +73 -0
- package/dist/language/flows/flow-classify.js +146 -0
- package/dist/language/flows/flow-expect-grammar.d.ts +33 -0
- package/dist/language/flows/flow-expect-grammar.js +155 -0
- package/dist/language/flows/flow-intent.d.ts +52 -0
- package/dist/language/flows/flow-intent.js +123 -0
- package/dist/language/flows/flow-learning.d.ts +52 -0
- package/dist/language/flows/flow-learning.js +76 -0
- package/dist/language/flows/flow-mutate-tools.d.ts +14 -0
- package/dist/language/flows/flow-mutate-tools.js +82 -0
- package/dist/language/flows/flow-replay-run.d.ts +91 -0
- package/dist/language/flows/flow-replay-run.js +748 -0
- package/dist/language/flows/flow-replay-types.d.ts +37 -0
- package/dist/language/flows/flow-replay-types.js +1 -0
- package/dist/language/flows/flow-replay.d.ts +91 -0
- package/dist/language/flows/flow-replay.js +487 -0
- package/dist/language/flows/flow-result.d.ts +35 -0
- package/dist/language/flows/flow-result.js +26 -0
- package/dist/language/flows/flow-step-runners.d.ts +54 -0
- package/dist/language/flows/flow-step-runners.js +369 -0
- package/dist/language/flows/flow-store-for-session.d.ts +32 -0
- package/dist/language/flows/flow-success.d.ts +32 -0
- package/dist/language/flows/flow-success.js +181 -0
- package/dist/language/flows/flow-tools.d.ts +15 -0
- package/dist/language/flows/flow-tools.js +842 -0
- package/dist/language/flows/flows.d.ts +114 -0
- package/dist/language/flows/flows.js +492 -0
- package/dist/language/flows/heal-precondition.d.ts +28 -0
- package/dist/language/flows/heal-precondition.js +38 -0
- package/dist/language/flows/heal-run.d.ts +17 -0
- package/dist/language/flows/heal-run.js +186 -0
- package/dist/language/flows/heal.js +97 -0
- package/dist/language/flows/mutation-run.d.ts +33 -0
- package/dist/language/flows/mutation-run.js +60 -0
- package/dist/language/flows/narrow-write.d.ts +32 -0
- package/dist/language/flows/narrow-write.js +26 -0
- package/dist/language/flows/recording/flake.d.ts +56 -0
- package/dist/language/flows/recording/recording-backtrack.js +73 -0
- package/dist/language/flows/recording/tape/recordings.d.ts +134 -0
- package/dist/language/flows/recording/tape/recordings.js +144 -0
- package/dist/language/flows/replay.d.ts +83 -0
- package/dist/language/flows/replay.js +397 -0
- package/dist/language/flows/role-anchor-nearest.js +45 -0
- package/dist/language/flows/stores/assertion-tiers-store.d.ts +26 -0
- package/dist/language/flows/stores/assertion-tiers-store.js +107 -0
- package/dist/language/flows/stores/flake-store.d.ts +18 -0
- package/dist/language/flows/stores/flake-store.js +58 -0
- package/dist/language/flows/suite/server-verify.d.ts +15 -0
- package/dist/language/flows/suite/server-verify.js +56 -0
- package/dist/language/flows/suite/suite-flakes.d.ts +34 -0
- package/dist/language/flows/suite/suite-flakes.js +32 -0
- package/dist/language/flows/suite-selection.d.ts +45 -0
- package/dist/language/flows/suite-selection.js +84 -0
- package/dist/language/flows/verify-change-tools.d.ts +2 -0
- package/dist/language/flows/verify-change-tools.js +244 -0
- package/dist/machine/clock.d.ts +24 -0
- package/dist/machine/clock.js +1 -0
- package/dist/machine/repo-root.d.ts +16 -0
- package/dist/machine/repo-root.js +20 -0
- package/dist/memory/cloud/account-state.d.ts +20 -0
- package/dist/memory/cloud/account-state.js +70 -0
- package/dist/memory/cloud/cloud-config.d.ts +79 -0
- package/dist/memory/cloud/cloud-config.js +156 -0
- package/dist/memory/cloud/cloud-sync.d.ts +195 -0
- package/dist/memory/cloud/cloud-sync.js +359 -0
- package/dist/memory/cloud/harness-config.d.ts +10 -0
- package/dist/memory/cloud/harness-config.js +58 -0
- package/dist/memory/cloud/harness-offer.d.ts +44 -0
- package/dist/memory/cloud/harness-offer.js +146 -0
- package/dist/memory/cloud/harness-switch.d.ts +11 -0
- package/dist/memory/cloud/harness-switch.js +53 -0
- package/dist/memory/cloud/sync-cycle.d.ts +121 -0
- package/dist/memory/cloud/sync-cycle.js +295 -0
- package/dist/memory/cloud/sync-daemon.d.ts +73 -0
- package/dist/memory/cloud/sync-daemon.js +297 -0
- package/dist/memory/cloud/sync-disk.js +193 -0
- package/dist/memory/impact/impact-recorder.d.ts +54 -0
- package/dist/memory/impact/impact-recorder.js +160 -0
- package/dist/memory/impact/impact-store.d.ts +52 -0
- package/dist/memory/impact/impact-store.js +274 -0
- package/dist/memory/intent/inline-intent.d.ts +60 -0
- package/dist/memory/intent/inline-intent.js +206 -0
- package/dist/memory/intent/intent-shard-store.d.ts +87 -0
- package/dist/memory/intent/intent-shard-store.js +215 -0
- package/dist/memory/intent/intent-shard.d.ts +389 -0
- package/dist/memory/intent/intent-shard.js +153 -0
- package/dist/memory/intent/intent-store.d.ts +47 -0
- package/dist/memory/intent/intent-store.js +133 -0
- package/dist/memory/intent/intent-subject.d.ts +46 -0
- package/dist/memory/intent/intent-subject.js +175 -0
- package/dist/memory/intent/intent-tools.d.ts +2 -0
- package/dist/memory/intent/intent-tools.js +157 -0
- package/dist/memory/intent/open-intents.d.ts +36 -0
- package/dist/memory/intent/open-intents.js +58 -0
- package/dist/memory/journal/ambient-store.d.ts +13 -0
- package/dist/memory/journal/ambient-store.js +52 -0
- package/dist/memory/journal/attach-journal.d.ts +37 -0
- package/dist/memory/journal/attach-journal.js +26 -0
- package/dist/memory/journal/drive-flow.d.ts +74 -0
- package/dist/memory/journal/drive-flow.js +157 -0
- package/dist/memory/journal/drive-run-flush.d.ts +42 -0
- package/dist/memory/journal/drive-run-flush.js +82 -0
- package/dist/memory/journal/envelope-store.d.ts +16 -0
- package/dist/memory/journal/envelope-store.js +61 -0
- package/dist/memory/journal/envelope.d.ts +230 -0
- package/dist/memory/journal/journal-query.d.ts +66 -0
- package/dist/memory/journal/journal-query.js +98 -0
- package/dist/memory/journal/journal-recorder.d.ts +109 -0
- package/dist/memory/journal/journal-recorder.js +153 -0
- package/dist/memory/journal/on-disk/ambient-file.d.ts +21 -0
- package/dist/memory/journal/on-disk/ambient-file.js +15 -0
- package/dist/memory/journal/on-disk/retention.d.ts +141 -0
- package/dist/memory/journal/on-disk/retention.js +291 -0
- package/dist/memory/journal/on-disk/workspace-gitignore.d.ts +21 -0
- package/dist/memory/journal/on-disk/workspace-gitignore.js +93 -0
- package/dist/memory/journal/self-observation.d.ts +3 -0
- package/dist/memory/journal/self-observation.js +67 -0
- package/dist/memory/journal/session-end.d.ts +112 -0
- package/dist/memory/journal/session-end.js +179 -0
- package/dist/memory/journal/session-journal.d.ts +134 -0
- package/dist/memory/journal/session-journal.js +614 -0
- package/dist/memory/project/artifact-root-resolver.d.ts +3 -0
- package/dist/memory/project/artifact-root-resolver.js +89 -0
- package/dist/memory/project/artifact-root.d.ts +109 -0
- package/dist/memory/project/artifact-root.js +157 -0
- package/dist/memory/project/dir/fill-value-store.d.ts +32 -0
- package/dist/memory/project/dir/fill-value-store.js +88 -0
- package/dist/memory/project/dir/reticle-dir.d.ts +139 -0
- package/dist/memory/project/dir/reticle-dir.js +229 -0
- package/dist/memory/project/fs/fs-port.d.ts +68 -0
- package/dist/memory/project/fs/fs-port.js +82 -0
- package/dist/memory/project/learned-routes.d.ts +38 -0
- package/dist/memory/project/learned-routes.js +79 -0
- package/dist/memory/project/memory-fs.d.ts +10 -0
- package/dist/memory/project/project-for-root.d.ts +30 -0
- package/dist/memory/project/project-for-root.js +43 -0
- package/dist/memory/project/project-store.d.ts +54 -0
- package/dist/memory/project/project-store.js +244 -0
- package/dist/memory/project/project-tools.d.ts +8 -0
- package/dist/memory/project/project-tools.js +160 -0
- package/dist/memory/project/reticle-deps.d.ts +15 -0
- package/dist/memory/project/reticle-deps.js +33 -0
- package/dist/memory/project/session-root.d.ts +52 -0
- package/dist/memory/project/session-root.js +100 -0
- package/dist/memory/recall/memory-tools.d.ts +2 -0
- package/dist/memory/recall/memory-tools.js +81 -0
- package/dist/memory/recall/prior/connection-memory.d.ts +65 -0
- package/dist/memory/recall/prior/connection-memory.js +114 -0
- package/dist/memory/recall/project-memory.d.ts +33 -0
- package/dist/portal/bridge/auth-failure-reason.d.ts +32 -0
- package/dist/portal/bridge/auth-failure-reason.js +68 -0
- package/dist/portal/bridge/bridge-security.d.ts +30 -0
- package/dist/portal/bridge/bridge-security.js +53 -0
- package/dist/portal/bridge/bridge.d.ts +109 -0
- package/dist/portal/bridge/bridge.js +808 -0
- package/dist/portal/input/drive-url-stamp.d.ts +14 -0
- package/dist/portal/input/drive-url-stamp.js +33 -0
- package/dist/portal/input/network-detail.d.ts +97 -0
- package/dist/portal/input/network-detail.js +138 -0
- package/dist/portal/input/network-mock-tools.d.ts +21 -0
- package/dist/portal/input/network-mock-tools.js +124 -0
- package/dist/portal/input/network-mock.js +83 -0
- package/dist/portal/input/network-mutation.d.ts +47 -0
- package/dist/portal/input/network-mutation.js +53 -0
- package/dist/portal/input/real-input.d.ts +261 -0
- package/dist/portal/input/real-input.js +488 -0
- package/dist/portal/input/scroll-find.js +111 -0
- package/dist/portal/input/scroll-tools.d.ts +2 -0
- package/dist/portal/input/scroll-tools.js +76 -0
- package/dist/portal/input/storage-fixture.d.ts +57 -0
- package/dist/portal/input/storage-fixture.js +92 -0
- package/dist/portal/input/viewport-tools.d.ts +2 -0
- package/dist/portal/input/viewport-tools.js +72 -0
- package/dist/portal/pool/browser-pool.d.ts +174 -0
- package/dist/portal/pool/browser-pool.js +559 -0
- package/dist/portal/pool/lease-reaper.js +40 -0
- package/dist/portal/pool/playwright-launcher.js +150 -0
- package/dist/portal/pool/pool-contract.d.ts +116 -0
- package/dist/portal/pool/pool-contract.js +8 -0
- package/dist/portal/pool/storage-seed.d.ts +23 -0
- package/dist/portal/realm/conformance-client.d.ts +43 -0
- package/dist/portal/realm/conformance-client.js +227 -0
- package/dist/portal/realm/http-witness.d.ts +48 -0
- package/dist/portal/realm/http-witness.js +135 -0
- package/dist/portal/realm/web-realm.d.ts +225 -0
- package/dist/portal/realm/web-realm.js +661 -0
- package/dist/portal/session/daemon-answers.d.ts +20 -0
- package/dist/portal/session/daemon-answers.js +20 -0
- package/dist/portal/session/dev-server/dev-server-probe.js +147 -0
- package/dist/portal/session/facts/handshake-facts.d.ts +56 -0
- package/dist/portal/session/facts/handshake-facts.js +1 -0
- package/dist/portal/session/facts/observed-state.d.ts +60 -0
- package/dist/portal/session/facts/observed-state.js +121 -0
- package/dist/portal/session/facts/session-replaced.d.ts +43 -0
- package/dist/portal/session/facts/session-replaced.js +51 -0
- package/dist/portal/session/live-control-tools.d.ts +15 -0
- package/dist/portal/session/live-control-tools.js +242 -0
- package/dist/portal/session/no-session-diagnosis.d.ts +176 -0
- package/dist/portal/session/no-session-diagnosis.js +457 -0
- package/dist/portal/session/no-session-next-action.d.ts +76 -0
- package/dist/portal/session/no-session-next-action.js +211 -0
- package/dist/portal/session/no-session-watch.js +351 -0
- package/dist/portal/session/output-budget.d.ts +82 -0
- package/dist/portal/session/output-budget.js +108 -0
- package/dist/portal/session/page-commands/undeclared-command.d.ts +30 -0
- package/dist/portal/session/page-commands/undeclared-command.js +44 -0
- package/dist/portal/session/presence/session-recommendation.js +29 -0
- package/dist/portal/session/rebind.d.ts +18 -0
- package/dist/portal/session/rebind.js +38 -0
- package/dist/portal/session/session-health.d.ts +145 -0
- package/dist/portal/session/session-health.js +154 -0
- package/dist/portal/session/session-manager.d.ts +81 -0
- package/dist/portal/session/session-manager.js +504 -0
- package/dist/portal/session/session-reaper.d.ts +36 -0
- package/dist/portal/session/session-reaper.js +93 -0
- package/dist/portal/session/session-tools.d.ts +8 -0
- package/dist/portal/session/session-tools.js +42 -0
- package/dist/portal/session/session.d.ts +279 -0
- package/dist/portal/session/session.js +875 -0
- package/dist/portal/session/stall-clock.js +48 -0
- package/dist/portal/session/timing/command-timeout.d.ts +40 -0
- package/dist/portal/session/timing/command-timeout.js +42 -0
- package/dist/start-options.d.ts +51 -0
- package/dist/start-options.js +7 -0
- package/dist/status-payload.d.ts +16 -10
- package/dist/status-payload.js +5 -2
- package/dist/surface/http-server.d.ts +52 -0
- package/dist/surface/http-server.js +379 -0
- package/dist/surface/mcp/consumer-verdict-guard.d.ts +40 -0
- package/dist/surface/mcp/consumer-verdict-guard.js +57 -0
- package/dist/surface/mcp/faults/mcp-is-error.d.ts +13 -0
- package/dist/surface/mcp/faults/mcp-is-error.js +18 -0
- package/dist/surface/mcp/faults/mcp-outage.d.ts +33 -0
- package/dist/surface/mcp/faults/mcp-outage.js +71 -0
- package/dist/surface/mcp/mcp-proxy.d.ts +119 -0
- package/dist/surface/mcp/mcp-proxy.js +882 -0
- package/dist/surface/mcp/mcp.d.ts +89 -0
- package/dist/surface/mcp/mcp.js +676 -0
- package/dist/surface/mcp/proxy/mcp-post-transport.js +109 -0
- package/dist/surface/mcp/proxy/proxy-daemon-probe.d.ts +22 -0
- package/dist/surface/mcp/proxy/proxy-daemon-probe.js +71 -0
- package/dist/surface/mcp/proxy/proxy-handshake.js +192 -0
- package/dist/surface/mcp/proxy/proxy-lifecycle.d.ts +90 -0
- package/dist/surface/mcp/proxy/proxy-lifecycle.js +98 -0
- package/dist/surface/mcp/proxy/proxy-log.d.ts +57 -0
- package/dist/surface/mcp/proxy/proxy-log.js +117 -0
- package/dist/surface/mcp/server-instructions.d.ts +26 -0
- package/dist/surface/mcp/server-instructions.js +156 -0
- package/dist/surface/mcp/surface-vocabulary.d.ts +47 -0
- package/dist/surface/mcp/surface-vocabulary.js +56 -0
- package/dist/surface/mcp/tool-catalog-cache.d.ts +45 -0
- package/dist/surface/mcp/tool-catalog-cache.js +77 -0
- package/dist/surface/tools/act/act-danger.js +69 -0
- package/dist/surface/tools/act/act-helpers.d.ts +17 -0
- package/dist/surface/tools/act/act-helpers.js +40 -0
- package/dist/surface/tools/act/act-observation.d.ts +42 -0
- package/dist/surface/tools/act/act-observation.js +36 -0
- package/dist/surface/tools/act/act-preflight.d.ts +27 -0
- package/dist/surface/tools/act/act-preflight.js +168 -0
- package/dist/surface/tools/act/act-target.d.ts +10 -0
- package/dist/surface/tools/act/act-target.js +100 -0
- package/dist/surface/tools/act/navigation/navigate-arrival.d.ts +68 -0
- package/dist/surface/tools/act/resolve-target.js +115 -0
- package/dist/surface/tools/act/sequence-grade.d.ts +79 -0
- package/dist/surface/tools/act/sequence-grade.js +104 -0
- package/dist/surface/tools/act-capsule.d.ts +33 -0
- package/dist/surface/tools/act-capsule.js +79 -0
- package/dist/surface/tools/act-merged.d.ts +20 -0
- package/dist/surface/tools/act-merged.js +53 -0
- package/dist/surface/tools/act-sequence-tool.js +330 -0
- package/dist/surface/tools/act-tools.d.ts +24 -0
- package/dist/surface/tools/act-tools.js +835 -0
- package/dist/surface/tools/args/numeric-bounds.d.ts +97 -0
- package/dist/surface/tools/args/numeric-bounds.js +133 -0
- package/dist/surface/tools/assert/assert-grade.d.ts +42 -0
- package/dist/surface/tools/assert/assert-grade.js +125 -0
- package/dist/surface/tools/assert/assert-source.d.ts +52 -0
- package/dist/surface/tools/assert/assert-source.js +74 -0
- package/dist/surface/tools/assert/assert-verdict.d.ts +48 -0
- package/dist/surface/tools/assert/assert-verdict.js +247 -0
- package/dist/surface/tools/browser-tools.d.ts +2 -0
- package/dist/surface/tools/browser-tools.js +115 -0
- package/dist/surface/tools/contract-tools.d.ts +2 -0
- package/dist/surface/tools/contract-tools.js +112 -0
- package/dist/surface/tools/coverage-tools.d.ts +18 -0
- package/dist/surface/tools/coverage-tools.js +178 -0
- package/dist/surface/tools/dynamic-tools.d.ts +17 -0
- package/dist/surface/tools/dynamic-tools.js +282 -0
- package/dist/surface/tools/error-recovery.d.ts +116 -0
- package/dist/surface/tools/error-recovery.js +527 -0
- package/dist/surface/tools/explore-tools.d.ts +14 -0
- package/dist/surface/tools/explore-tools.js +162 -0
- package/dist/surface/tools/feature-capture.d.ts +151 -0
- package/dist/surface/tools/feature-capture.js +235 -0
- package/dist/surface/tools/feedback-invite.d.ts +48 -0
- package/dist/surface/tools/feedback-invite.js +71 -0
- package/dist/surface/tools/feedback-tools.d.ts +35 -0
- package/dist/surface/tools/feedback-tools.js +280 -0
- package/dist/surface/tools/first-sentence.d.ts +24 -0
- package/dist/surface/tools/first-sentence.js +0 -0
- package/dist/surface/tools/gap-novelty.d.ts +39 -0
- package/dist/surface/tools/gap-novelty.js +69 -0
- package/dist/surface/tools/gaps/capability-absences.d.ts +39 -0
- package/dist/surface/tools/gaps/capability-absences.js +46 -0
- package/dist/surface/tools/harness-explore.d.ts +177 -0
- package/dist/surface/tools/harness-explore.js +453 -0
- package/dist/surface/tools/harness-plan.d.ts +76 -0
- package/dist/surface/tools/harness-plan.js +156 -0
- package/dist/surface/tools/harness-toolset.d.ts +35 -0
- package/dist/surface/tools/harness-toolset.js +144 -0
- package/dist/surface/tools/inspect-tool.d.ts +4 -0
- package/dist/surface/tools/inspect-tool.js +142 -0
- package/dist/surface/tools/invoke-tool.d.ts +10 -0
- package/dist/surface/tools/invoke-tool.js +668 -0
- package/dist/surface/tools/lease-hint.d.ts +50 -0
- package/dist/surface/tools/lease-hint.js +125 -0
- package/dist/surface/tools/lease-tools.d.ts +195 -0
- package/dist/surface/tools/lease-tools.js +797 -0
- package/dist/surface/tools/lineage-tools.d.ts +14 -0
- package/dist/surface/tools/lineage-tools.js +64 -0
- package/dist/surface/tools/live-call-text.d.ts +25 -0
- package/dist/surface/tools/live-call-text.js +191 -0
- package/dist/surface/tools/merge-tools.d.ts +68 -0
- package/dist/surface/tools/merge-tools.js +110 -0
- package/dist/surface/tools/merged-name-redirect.d.ts +36 -0
- package/dist/surface/tools/merged-name-redirect.js +107 -0
- package/dist/surface/tools/observe-tools.js +700 -0
- package/dist/surface/tools/read/query-windowed.d.ts +54 -0
- package/dist/surface/tools/read/query-windowed.js +75 -0
- package/dist/surface/tools/read/snapshot-delta.d.ts +92 -0
- package/dist/surface/tools/read/snapshot-delta.js +356 -0
- package/dist/surface/tools/read-tools.js +569 -0
- package/dist/surface/tools/real-input-attempt.d.ts +68 -0
- package/dist/surface/tools/real-input-attempt.js +360 -0
- package/dist/surface/tools/reconcile-tools.js +211 -0
- package/dist/surface/tools/tool-hit-rate.js +90 -0
- package/dist/surface/tools/tool-kit.d.ts +254 -0
- package/dist/surface/tools/tool-kit.js +123 -0
- package/dist/surface/tools/tool-surface.d.ts +195 -0
- package/dist/surface/tools/tool-surface.js +429 -0
- package/dist/surface/tools/tools-helpers.d.ts +40 -0
- package/dist/surface/tools/tools-helpers.js +76 -0
- package/dist/surface/tools/tools.d.ts +76 -0
- package/dist/surface/tools/tools.js +799 -0
- package/dist/surface/tools/unadvertised-help.js +60 -0
- package/dist/surface/tools/verify-next-baton.js +52 -0
- package/dist/telemetry/app-instrumented.d.ts +3 -5
- package/dist/telemetry/app-instrumented.js +17 -6
- package/dist/telemetry/argument-shape.js +4 -4
- package/dist/telemetry/bug-found.js +49 -27
- package/dist/telemetry/cli-telemetry.js +27 -10
- package/dist/telemetry/daemon-telemetry.d.ts +7 -13
- package/dist/telemetry/daemon-telemetry.js +15 -22
- package/dist/telemetry/error-fingerprint.js +26 -1
- package/dist/telemetry/feedback-cli.d.ts +1 -1
- package/dist/telemetry/feedback-cli.js +2 -2
- package/dist/telemetry/feedback-context.js +4 -4
- package/dist/telemetry/feedback.js +1 -1
- package/dist/telemetry/harness-drive.d.ts +6 -0
- package/dist/telemetry/harness-drive.js +39 -0
- package/dist/telemetry/install-source.js +1 -1
- package/dist/telemetry/install-trace.d.ts +8 -0
- package/dist/telemetry/install-trace.js +74 -0
- package/dist/telemetry/license-activation.js +1 -1
- package/dist/telemetry/mcp-connection.d.ts +14 -1
- package/dist/telemetry/mcp-connection.js +17 -2
- package/dist/telemetry/onboarding-firsts.d.ts +40 -0
- package/dist/telemetry/onboarding-firsts.js +109 -0
- package/dist/telemetry/onboarding-funnel.d.ts +26 -0
- package/dist/telemetry/onboarding-funnel.js +60 -0
- package/dist/telemetry/project-profile.js +1 -1
- package/dist/telemetry/run-telemetry.js +13 -0
- package/dist/telemetry/session-metrics.d.ts +6 -7
- package/dist/telemetry/session-metrics.js +14 -21
- package/dist/telemetry/telemetry.d.ts +8 -1
- package/dist/telemetry/telemetry.js +6 -5
- package/dist/telemetry/verification-of.d.ts +6 -8
- package/dist/telemetry/verification-of.js +38 -12
- package/dist/workspace-packages.d.ts +22 -0
- package/dist/workspace-packages.js +57 -0
- package/docs/README.md +29 -23
- package/docs/actions.mdx +4 -4
- package/docs/adapters.md +75 -0
- package/docs/agent-cheatsheet.md +37 -27
- package/docs/architecture.md +3 -2
- package/docs/autodrive.md +99 -0
- package/docs/benchmarks.md +1 -1
- package/docs/best-practices.mdx +3 -3
- package/docs/capabilities.mdx +4 -4
- package/docs/cli/cloud.mdx +4 -4
- package/docs/cli/doctor.mdx +1 -0
- package/docs/cli/feedback.mdx +1 -1
- package/docs/cli/init.mdx +3 -3
- package/docs/cli/mcp.mdx +1 -1
- package/docs/cli/status.mdx +35 -20
- package/docs/cli/watch.mdx +1 -1
- package/docs/cli.mdx +15 -25
- package/docs/desktop.mdx +1 -1
- package/docs/enterprise.md +3 -2
- package/docs/faq.mdx +4 -4
- package/docs/first-drive.md +5 -5
- package/docs/flows.md +5 -5
- package/docs/for-agents.md +2 -1
- package/docs/frameworks.mdx +1 -1
- package/docs/getting-started.md +30 -21
- package/docs/http-transport.md +1 -1
- package/docs/index.mdx +28 -10
- package/docs/install-agentic.mdx +12 -4
- package/docs/install-manual.mdx +23 -7
- package/docs/instrumentation.mdx +3 -3
- package/docs/local-registry.md +15 -4
- package/docs/packages/babel-plugin.mdx +1 -1
- package/docs/packages/browser.mdx +2 -2
- package/docs/packages/core.mdx +2 -2
- package/docs/packages/engine.mdx +40 -0
- package/docs/packages/open-verification.mdx +40 -0
- package/docs/packages/tauri.mdx +1 -1
- package/docs/packages.mdx +22 -2
- package/docs/platform-integration.md +3 -3
- package/docs/predicates.mdx +19 -3
- package/docs/protocol.mdx +60 -0
- package/docs/quickstart.mdx +48 -13
- package/docs/recipes.mdx +1 -1
- package/docs/required-checks.md +37 -0
- package/docs/skill-file.mdx +2 -2
- package/docs/skill-setup.md +104 -0
- package/docs/state-files.md +46 -0
- package/docs/state-management.mdx +1 -1
- package/docs/system-map.md +8 -6
- package/docs/telemetry.md +4 -3
- package/docs/testing.md +12 -3
- package/docs/token-efficiency.md +3 -3
- package/docs/tools/act-and-wait.mdx +173 -0
- package/docs/tools/act-sequence.mdx +160 -0
- package/docs/tools/act.mdx +95 -0
- package/docs/tools/assert.mdx +129 -0
- package/docs/tools/console.mdx +70 -0
- package/docs/tools/inspect.mdx +95 -0
- package/docs/tools/navigate.mdx +107 -0
- package/docs/tools/network.mdx +126 -0
- package/docs/tools/observe.mdx +145 -0
- package/docs/tools/overview.mdx +163 -0
- package/docs/tools/query.mdx +133 -0
- package/docs/tools/sessions.mdx +101 -0
- package/docs/tools/snapshot.mdx +136 -0
- package/docs/tools/state.mdx +111 -0
- package/docs/tools/wait-for.mdx +92 -0
- package/docs/troubleshooting.mdx +43 -9
- package/docs/usage.md +59 -59
- package/package.json +31 -13
- package/dist/bridge/auth-failure-reason.d.ts +0 -23
- package/dist/bridge/auth-failure-reason.js +0 -47
- package/dist/bridge/bridge-security.d.ts +0 -30
- package/dist/bridge/bridge-security.js +0 -53
- package/dist/bridge/bridge.d.ts +0 -95
- package/dist/bridge/bridge.js +0 -713
- package/dist/bridge/bridge.test-harness.d.ts +0 -65
- package/dist/bridge/bridge.test-harness.js +0 -230
- package/dist/capsule/capsule-store.d.ts +0 -71
- package/dist/capsule/capsule-store.js +0 -114
- package/dist/capsule/capsule.d.ts +0 -18
- package/dist/capsule/capsule.js +0 -35
- package/dist/capsule/causal-summary.d.ts +0 -119
- package/dist/capsule/causal-summary.js +0 -172
- package/dist/capsule/divergence.d.ts +0 -35
- package/dist/capsule/predicate-to-links.d.ts +0 -8
- package/dist/capsule/predicate-to-links.js +0 -33
- package/dist/cli/adhoc-verdict.d.ts +0 -58
- package/dist/cli/adhoc-verdict.js +0 -115
- package/dist/cli/cli-doctor.js +0 -195
- package/dist/cli/cli-flow-commands.d.ts +0 -46
- package/dist/cli/cli-flow-commands.js +0 -255
- package/dist/cli/cli-kill.d.ts +0 -59
- package/dist/cli/cli-kill.js +0 -162
- package/dist/cli/cli-launch.d.ts +0 -92
- package/dist/cli/cli-launch.js +0 -223
- package/dist/cli/cli-parse.d.ts +0 -171
- package/dist/cli/cli-parse.js +0 -874
- package/dist/cli/cli-port.d.ts +0 -70
- package/dist/cli/cli-port.js +0 -136
- package/dist/cli/cli-update-commands.js +0 -112
- package/dist/cli/cli-verify.d.ts +0 -86
- package/dist/cli/cli-verify.js +0 -340
- package/dist/cli/cloud-cli.js +0 -694
- package/dist/cli/cloud-keystore.js +0 -97
- package/dist/cli/cloud-kit.d.ts +0 -37
- package/dist/cli/cloud-kit.js +0 -121
- package/dist/cli/cloud-login.js +0 -183
- package/dist/cli/config-discovery.d.ts +0 -36
- package/dist/cli/config-discovery.js +0 -164
- package/dist/cli/daemon-start-options.d.ts +0 -33
- package/dist/cli/device-flow.d.ts +0 -76
- package/dist/cli/device-flow.js +0 -56
- package/dist/cli/doctor-daemon-line.js +0 -47
- package/dist/cli/doctor-rows.d.ts +0 -63
- package/dist/cli/doctor-rows.js +0 -65
- package/dist/cli/doctor-sessions-line.js +0 -69
- package/dist/cli/drive-attach.d.ts +0 -113
- package/dist/cli/drive-attach.js +0 -221
- package/dist/cli/drive-command.js +0 -107
- package/dist/cli/mcp-command.js +0 -174
- package/dist/cli/port-holder.js +0 -123
- package/dist/cli/status-next-action.d.ts +0 -51
- package/dist/cli/status-next-action.js +0 -60
- package/dist/cli.d.ts +0 -6
- package/dist/cli.js +0 -828
- package/dist/cloud/account-state.d.ts +0 -20
- package/dist/cloud/account-state.js +0 -65
- package/dist/cloud/cloud-config.d.ts +0 -57
- package/dist/cloud/cloud-config.js +0 -145
- package/dist/cloud/cloud-sync.d.ts +0 -190
- package/dist/cloud/cloud-sync.js +0 -354
- package/dist/cloud/sync-cycle.d.ts +0 -111
- package/dist/cloud/sync-cycle.js +0 -270
- package/dist/cloud/sync-daemon.d.ts +0 -53
- package/dist/cloud/sync-daemon.js +0 -260
- package/dist/cloud/sync-disk.js +0 -191
- package/dist/crawl/crawl-tools.d.ts +0 -7
- package/dist/crawl/crawl-tools.js +0 -87
- package/dist/crawl/crawl.d.ts +0 -98
- package/dist/crawl/crawl.js +0 -441
- package/dist/daemon/daemon-resilience.d.ts +0 -74
- package/dist/daemon/daemon-resilience.js +0 -318
- package/dist/daemon/daemon-resolve.d.ts +0 -113
- package/dist/daemon/daemon-resolve.js +0 -187
- package/dist/daemon/daemon-usefulness.d.ts +0 -61
- package/dist/daemon/daemon-usefulness.js +0 -62
- package/dist/daemon/daemon.d.ts +0 -95
- package/dist/daemon/daemon.js +0 -336
- package/dist/daemon/heartbeat.d.ts +0 -111
- package/dist/daemon/heartbeat.js +0 -141
- package/dist/daemon/idle-grace.d.ts +0 -32
- package/dist/daemon/idle-grace.js +0 -41
- package/dist/daemon/idle-shutdown.d.ts +0 -54
- package/dist/daemon/idle-shutdown.js +0 -98
- package/dist/daemon/state-dir.js +0 -59
- package/dist/daemon/wake-decision.d.ts +0 -32
- package/dist/daemon/wake-decision.js +0 -38
- package/dist/dev/stale-issue-guard.d.ts +0 -41
- package/dist/dev/stale-issue-guard.js +0 -75
- package/dist/domain/domain-model.js +0 -126
- package/dist/domain/domain-tools.d.ts +0 -2
- package/dist/domain/domain-tools.js +0 -94
- package/dist/domain/flow-risk.js +0 -80
- package/dist/ee/audit-log.js +0 -11
- package/dist/events/body-failures.d.ts +0 -4
- package/dist/events/body-failures.js +0 -113
- package/dist/events/contradiction-folds.d.ts +0 -45
- package/dist/events/contradiction-folds.js +0 -42
- package/dist/events/contradictions.d.ts +0 -170
- package/dist/events/contradictions.js +0 -718
- package/dist/events/declared.d.ts +0 -74
- package/dist/events/declared.js +0 -171
- package/dist/events/echo-mismatch.d.ts +0 -10
- package/dist/events/echo-mismatch.js +0 -299
- package/dist/events/event-filters.d.ts +0 -121
- package/dist/events/event-filters.js +0 -215
- package/dist/events/json-salvage.d.ts +0 -33
- package/dist/events/json-salvage.js +0 -96
- package/dist/events/lineage.d.ts +0 -52
- package/dist/events/lineage.js +0 -122
- package/dist/events/net-evidence.d.ts +0 -21
- package/dist/events/net-evidence.js +0 -81
- package/dist/events/observed-in-window.d.ts +0 -24
- package/dist/events/observed-in-window.js +0 -38
- package/dist/events/predicate-asks.d.ts +0 -30
- package/dist/events/predicate-asks.js +0 -48
- package/dist/events/predicate-console.d.ts +0 -13
- package/dist/events/predicate-console.js +0 -138
- package/dist/events/predicate-element.d.ts +0 -13
- package/dist/events/predicate-element.js +0 -214
- package/dist/events/predicate-eval.d.ts +0 -101
- package/dist/events/predicate-eval.js +0 -834
- package/dist/events/predicate-parse.d.ts +0 -17
- package/dist/events/predicate-parse.js +0 -175
- package/dist/events/predicate-precheck.d.ts +0 -8
- package/dist/events/predicate-precheck.js +0 -41
- package/dist/events/predicate-request-body.d.ts +0 -50
- package/dist/events/predicate-request-body.js +0 -120
- package/dist/events/predicate-route.d.ts +0 -66
- package/dist/events/predicate-route.js +0 -258
- package/dist/events/predicate-schema.d.ts +0 -168
- package/dist/events/predicate-schema.js +0 -501
- package/dist/events/predicate.d.ts +0 -74
- package/dist/events/predicate.js +0 -725
- package/dist/events/reaction.d.ts +0 -33
- package/dist/events/reaction.js +0 -59
- package/dist/events/reconcile.d.ts +0 -39
- package/dist/events/reconcile.js +0 -211
- package/dist/events/ring-buffer.d.ts +0 -41
- package/dist/events/ring-buffer.js +0 -151
- package/dist/events/split-text-miss.d.ts +0 -32
- package/dist/events/split-text-miss.js +0 -51
- package/dist/events/stale-response.d.ts +0 -3
- package/dist/events/stale-response.js +0 -186
- package/dist/events/testid-near-miss.d.ts +0 -22
- package/dist/events/testid-near-miss.js +0 -33
- package/dist/events/unit-mismatch.d.ts +0 -16
- package/dist/events/unit-mismatch.js +0 -167
- package/dist/flows/affected-tools.d.ts +0 -18
- package/dist/flows/affected-tools.js +0 -80
- package/dist/flows/affected.d.ts +0 -24
- package/dist/flows/affected.js +0 -35
- package/dist/flows/annotate-tools.d.ts +0 -15
- package/dist/flows/annotate-tools.js +0 -179
- package/dist/flows/assertion-tiers-store.d.ts +0 -16
- package/dist/flows/assertion-tiers-store.js +0 -98
- package/dist/flows/decision.d.ts +0 -25
- package/dist/flows/decision.js +0 -201
- package/dist/flows/empty-flow.js +0 -24
- package/dist/flows/flake-store.d.ts +0 -18
- package/dist/flows/flake-store.js +0 -58
- package/dist/flows/flake.d.ts +0 -56
- package/dist/flows/flow-classify.d.ts +0 -51
- package/dist/flows/flow-classify.js +0 -102
- package/dist/flows/flow-expect-grammar.d.ts +0 -33
- package/dist/flows/flow-expect-grammar.js +0 -155
- package/dist/flows/flow-intent.d.ts +0 -52
- package/dist/flows/flow-intent.js +0 -123
- package/dist/flows/flow-replay-run.d.ts +0 -43
- package/dist/flows/flow-replay-run.js +0 -478
- package/dist/flows/flow-replay.d.ts +0 -82
- package/dist/flows/flow-replay.js +0 -519
- package/dist/flows/flow-secret-field.d.ts +0 -14
- package/dist/flows/flow-secret-field.js +0 -22
- package/dist/flows/flow-sources.d.ts +0 -19
- package/dist/flows/flow-sources.js +0 -32
- package/dist/flows/flow-step-runners.d.ts +0 -52
- package/dist/flows/flow-step-runners.js +0 -315
- package/dist/flows/flow-store-for-session.d.ts +0 -31
- package/dist/flows/flow-success.d.ts +0 -32
- package/dist/flows/flow-success.js +0 -169
- package/dist/flows/flow-tools.d.ts +0 -15
- package/dist/flows/flow-tools.js +0 -639
- package/dist/flows/flow-upload-resolve.d.ts +0 -23
- package/dist/flows/flow-upload-resolve.js +0 -46
- package/dist/flows/flows.d.ts +0 -130
- package/dist/flows/flows.js +0 -870
- package/dist/flows/gate.js +0 -33
- package/dist/flows/heal-run.d.ts +0 -10
- package/dist/flows/heal-run.js +0 -139
- package/dist/flows/heal.js +0 -97
- package/dist/flows/predicate-to-expect.d.ts +0 -44
- package/dist/flows/predicate-to-expect.js +0 -130
- package/dist/flows/recording-backtrack.js +0 -73
- package/dist/flows/recordings.d.ts +0 -63
- package/dist/flows/recordings.js +0 -57
- package/dist/flows/replay.d.ts +0 -62
- package/dist/flows/replay.js +0 -337
- package/dist/flows/role-anchor-nearest.js +0 -45
- package/dist/flows/server-verify.d.ts +0 -15
- package/dist/flows/server-verify.js +0 -56
- package/dist/flows/suite-flakes.d.ts +0 -34
- package/dist/flows/suite-flakes.js +0 -32
- package/dist/flows/verify-change-tools.d.ts +0 -2
- package/dist/flows/verify-change-tools.js +0 -231
- package/dist/honesty/accepted-write.d.ts +0 -17
- package/dist/honesty/accepted-write.js +0 -22
- package/dist/honesty/already-true.d.ts +0 -16
- package/dist/honesty/already-true.js +0 -89
- package/dist/honesty/blind-spots.d.ts +0 -133
- package/dist/honesty/blind-spots.js +0 -248
- package/dist/honesty/body-capture-remedy.d.ts +0 -42
- package/dist/honesty/body-capture-remedy.js +0 -95
- package/dist/honesty/feature-capture.d.ts +0 -151
- package/dist/honesty/feature-capture.js +0 -233
- package/dist/honesty/gap-ledger.d.ts +0 -52
- package/dist/honesty/gap-ledger.js +0 -63
- package/dist/honesty/honesty.d.ts +0 -103
- package/dist/honesty/honesty.js +0 -95
- package/dist/honesty/instrumentation-gaps.d.ts +0 -95
- package/dist/honesty/instrumentation-gaps.js +0 -114
- package/dist/honesty/observability.d.ts +0 -38
- package/dist/honesty/observability.js +0 -40
- package/dist/honesty/tool-hit-rate.js +0 -90
- package/dist/honesty/uncaptured-bodies.d.ts +0 -23
- package/dist/honesty/uncaptured-bodies.js +0 -41
- package/dist/honesty/undeclared-change.d.ts +0 -51
- package/dist/honesty/undeclared-change.js +0 -56
- package/dist/honesty/unread-outcome.d.ts +0 -10
- package/dist/honesty/unread-outcome.js +0 -77
- package/dist/honesty/unsettled.d.ts +0 -58
- package/dist/honesty/unsettled.js +0 -127
- package/dist/honesty/verified.d.ts +0 -148
- package/dist/honesty/verified.js +0 -330
- package/dist/http-server.d.ts +0 -52
- package/dist/http-server.js +0 -381
- package/dist/impact/impact-recorder.d.ts +0 -46
- package/dist/impact/impact-recorder.js +0 -159
- package/dist/impact/impact-store.d.ts +0 -47
- package/dist/impact/impact-store.js +0 -255
- package/dist/input/network-detail.d.ts +0 -104
- package/dist/input/network-detail.js +0 -211
- package/dist/input/network-mock-tools.d.ts +0 -21
- package/dist/input/network-mock-tools.js +0 -124
- package/dist/input/network-mock.js +0 -61
- package/dist/input/real-input.d.ts +0 -222
- package/dist/input/real-input.js +0 -405
- package/dist/input/scroll-find.js +0 -111
- package/dist/input/scroll-tools.d.ts +0 -2
- package/dist/input/scroll-tools.js +0 -76
- package/dist/input/viewport-tools.d.ts +0 -2
- package/dist/input/viewport-tools.js +0 -72
- package/dist/intent/inline-intent.d.ts +0 -27
- package/dist/intent/inline-intent.js +0 -193
- package/dist/intent/intent-shard-store.d.ts +0 -73
- package/dist/intent/intent-shard-store.js +0 -203
- package/dist/intent/intent-shard.d.ts +0 -411
- package/dist/intent/intent-shard.js +0 -176
- package/dist/intent/intent-store.d.ts +0 -49
- package/dist/intent/intent-store.js +0 -133
- package/dist/intent/intent-subject.d.ts +0 -46
- package/dist/intent/intent-subject.js +0 -177
- package/dist/intent/intent-tools.d.ts +0 -2
- package/dist/intent/intent-tools.js +0 -143
- package/dist/intent/open-intents.d.ts +0 -43
- package/dist/intent/open-intents.js +0 -40
- package/dist/journal/ambient-store.d.ts +0 -13
- package/dist/journal/ambient-store.js +0 -45
- package/dist/journal/ambient.d.ts +0 -47
- package/dist/journal/ambient.js +0 -47
- package/dist/journal/attach-journal.d.ts +0 -30
- package/dist/journal/attach-journal.js +0 -30
- package/dist/journal/envelope-store.d.ts +0 -16
- package/dist/journal/envelope-store.js +0 -61
- package/dist/journal/envelope.d.ts +0 -230
- package/dist/journal/journal-query.d.ts +0 -32
- package/dist/journal/journal-query.js +0 -52
- package/dist/journal/journal-recorder.d.ts +0 -61
- package/dist/journal/journal-recorder.js +0 -115
- package/dist/journal/retention.d.ts +0 -20
- package/dist/journal/retention.js +0 -49
- package/dist/journal/session-end.d.ts +0 -32
- package/dist/journal/session-end.js +0 -51
- package/dist/journal/session-journal.d.ts +0 -24
- package/dist/journal/session-journal.js +0 -167
- package/dist/journal/workspace-gitignore.d.ts +0 -10
- package/dist/journal/workspace-gitignore.js +0 -59
- package/dist/license/license-env.d.ts +0 -29
- package/dist/license/license-env.js +0 -148
- package/dist/license/license.d.ts +0 -169
- package/dist/license/license.js +0 -289
- package/dist/mcp/mcp-is-error.d.ts +0 -13
- package/dist/mcp/mcp-is-error.js +0 -18
- package/dist/mcp/mcp-outage.d.ts +0 -32
- package/dist/mcp/mcp-outage.js +0 -55
- package/dist/mcp/mcp-post-transport.js +0 -109
- package/dist/mcp/mcp-proxy.d.ts +0 -110
- package/dist/mcp/mcp-proxy.js +0 -872
- package/dist/mcp/mcp.d.ts +0 -80
- package/dist/mcp/mcp.js +0 -536
- package/dist/mcp/proxy-daemon-probe.d.ts +0 -9
- package/dist/mcp/proxy-daemon-probe.js +0 -54
- package/dist/mcp/proxy-handshake.js +0 -192
- package/dist/mcp/proxy-lifecycle.d.ts +0 -92
- package/dist/mcp/proxy-lifecycle.js +0 -100
- package/dist/mcp/proxy-log.d.ts +0 -63
- package/dist/mcp/proxy-log.js +0 -132
- package/dist/mcp/server-instructions.d.ts +0 -18
- package/dist/mcp/server-instructions.js +0 -98
- package/dist/mcp/tool-catalog-cache.d.ts +0 -45
- package/dist/mcp/tool-catalog-cache.js +0 -77
- package/dist/memory/memory-tools.d.ts +0 -2
- package/dist/memory/memory-tools.js +0 -82
- package/dist/memory/project-memory.d.ts +0 -33
- package/dist/oracles/propose-consequences.d.ts +0 -22
- package/dist/oracles/propose-consequences.js +0 -106
- package/dist/pool/browser-pool.d.ts +0 -282
- package/dist/pool/browser-pool.js +0 -560
- package/dist/pool/lease-reaper.js +0 -40
- package/dist/pool/playwright-launcher.js +0 -150
- package/dist/pool/storage-seed.d.ts +0 -23
- package/dist/project/artifact-root.d.ts +0 -84
- package/dist/project/artifact-root.js +0 -112
- package/dist/project/fs-port.d.ts +0 -47
- package/dist/project/fs-port.js +0 -54
- package/dist/project/learned-routes.d.ts +0 -24
- package/dist/project/learned-routes.js +0 -63
- package/dist/project/memory-fs.d.ts +0 -10
- package/dist/project/project-store.d.ts +0 -54
- package/dist/project/project-store.js +0 -201
- package/dist/project/project-tools.d.ts +0 -2
- package/dist/project/project-tools.js +0 -155
- package/dist/project/reticle-dir.d.ts +0 -102
- package/dist/project/reticle-dir.js +0 -188
- package/dist/project/session-root.d.ts +0 -23
- package/dist/project/session-root.js +0 -38
- package/dist/runs/build-verification-run.d.ts +0 -29
- package/dist/runs/build-verification-run.js +0 -70
- package/dist/runs/context-tools.d.ts +0 -2
- package/dist/runs/context-tools.js +0 -89
- package/dist/runs/render-report.js +0 -69
- package/dist/runs/replay-mapping.js +0 -34
- package/dist/runs/reticle-runner.d.ts +0 -60
- package/dist/runs/reticle-runner.js +0 -95
- package/dist/runs/run-store.d.ts +0 -54
- package/dist/runs/run-store.js +0 -147
- package/dist/runs/run-tools.d.ts +0 -9
- package/dist/runs/run-tools.js +0 -82
- package/dist/runs/runner-port.d.ts +0 -13
- package/dist/runs/runner-port.js +0 -22
- package/dist/runs/verification-sync.d.ts +0 -12
- package/dist/runs/verification-sync.js +0 -87
- package/dist/session/command-timeout.d.ts +0 -46
- package/dist/session/command-timeout.js +0 -42
- package/dist/session/connection-memory.d.ts +0 -59
- package/dist/session/connection-memory.js +0 -108
- package/dist/session/dev-server-probe.js +0 -147
- package/dist/session/live-control-tools.d.ts +0 -15
- package/dist/session/live-control-tools.js +0 -242
- package/dist/session/no-session-diagnosis.d.ts +0 -176
- package/dist/session/no-session-diagnosis.js +0 -477
- package/dist/session/no-session-next-action.d.ts +0 -72
- package/dist/session/no-session-next-action.js +0 -174
- package/dist/session/no-session-watch.js +0 -335
- package/dist/session/observed-state.d.ts +0 -60
- package/dist/session/observed-state.js +0 -121
- package/dist/session/output-budget.d.ts +0 -49
- package/dist/session/output-budget.js +0 -67
- package/dist/session/session-health.d.ts +0 -138
- package/dist/session/session-health.js +0 -154
- package/dist/session/session-manager.d.ts +0 -76
- package/dist/session/session-manager.js +0 -464
- package/dist/session/session-reaper.d.ts +0 -36
- package/dist/session/session-reaper.js +0 -93
- package/dist/session/session-recommendation.js +0 -29
- package/dist/session/session-replaced.d.ts +0 -24
- package/dist/session/session-replaced.js +0 -29
- package/dist/session/session-tools.d.ts +0 -8
- package/dist/session/session-tools.js +0 -42
- package/dist/session/session.d.ts +0 -280
- package/dist/session/session.js +0 -891
- package/dist/session/stall-clock.js +0 -48
- package/dist/setup/agent-configs.d.ts +0 -97
- package/dist/setup/agent-configs.js +0 -333
- package/dist/setup/agent-writer.d.ts +0 -52
- package/dist/setup/agent-writer.js +0 -115
- package/dist/setup/auto-approve.js +0 -153
- package/dist/setup/bridge-port.d.ts +0 -15
- package/dist/setup/bridge-port.js +0 -24
- package/dist/setup/confirm.js +0 -205
- package/dist/setup/dev-server-wait.d.ts +0 -68
- package/dist/setup/dev-server-wait.js +0 -67
- package/dist/setup/drive-agent.d.ts +0 -70
- package/dist/setup/drive-agent.js +0 -171
- package/dist/setup/drive-plan.d.ts +0 -69
- package/dist/setup/drive-plan.js +0 -130
- package/dist/setup/ensure-daemon.js +0 -58
- package/dist/setup/init-host.js +0 -26
- package/dist/setup/init-runtime.d.ts +0 -41
- package/dist/setup/init-runtime.js +0 -167
- package/dist/setup/node-effects.d.ts +0 -63
- package/dist/setup/node-effects.js +0 -225
- package/dist/setup/page-probe.d.ts +0 -44
- package/dist/setup/page-probe.js +0 -49
- package/dist/setup/remaining-steps.js +0 -31
- package/dist/setup/run-setup.d.ts +0 -103
- package/dist/setup/run-setup.js +0 -294
- package/dist/setup/setup-command.d.ts +0 -46
- package/dist/setup/setup-command.js +0 -207
- package/dist/setup/setup-options.d.ts +0 -76
- package/dist/setup/setup-options.js +0 -68
- package/dist/tools/act-capsule.d.ts +0 -33
- package/dist/tools/act-capsule.js +0 -53
- package/dist/tools/act-danger.js +0 -69
- package/dist/tools/act-helpers.d.ts +0 -17
- package/dist/tools/act-helpers.js +0 -40
- package/dist/tools/act-observation.d.ts +0 -42
- package/dist/tools/act-observation.js +0 -36
- package/dist/tools/act-preflight.d.ts +0 -20
- package/dist/tools/act-preflight.js +0 -103
- package/dist/tools/act-sequence-tool.js +0 -135
- package/dist/tools/act-target.d.ts +0 -18
- package/dist/tools/act-target.js +0 -56
- package/dist/tools/act-tools.d.ts +0 -20
- package/dist/tools/act-tools.js +0 -763
- package/dist/tools/assert-grade.d.ts +0 -42
- package/dist/tools/assert-grade.js +0 -108
- package/dist/tools/assert-source.d.ts +0 -52
- package/dist/tools/assert-source.js +0 -74
- package/dist/tools/assert-verdict.d.ts +0 -48
- package/dist/tools/assert-verdict.js +0 -197
- package/dist/tools/browser-tools.d.ts +0 -2
- package/dist/tools/browser-tools.js +0 -115
- package/dist/tools/contract-tools.d.ts +0 -2
- package/dist/tools/contract-tools.js +0 -98
- package/dist/tools/coverage-tools.d.ts +0 -18
- package/dist/tools/coverage-tools.js +0 -175
- package/dist/tools/dynamic-tools.d.ts +0 -7
- package/dist/tools/dynamic-tools.js +0 -257
- package/dist/tools/error-recovery.d.ts +0 -110
- package/dist/tools/error-recovery.js +0 -499
- package/dist/tools/feedback-invite.d.ts +0 -48
- package/dist/tools/feedback-invite.js +0 -71
- package/dist/tools/feedback-tools.d.ts +0 -35
- package/dist/tools/feedback-tools.js +0 -228
- package/dist/tools/invoke-tool.d.ts +0 -10
- package/dist/tools/invoke-tool.js +0 -569
- package/dist/tools/lease-hint.d.ts +0 -49
- package/dist/tools/lease-hint.js +0 -124
- package/dist/tools/lease-tools.d.ts +0 -143
- package/dist/tools/lease-tools.js +0 -688
- package/dist/tools/lineage-tools.d.ts +0 -14
- package/dist/tools/lineage-tools.js +0 -64
- package/dist/tools/merge-tools.d.ts +0 -51
- package/dist/tools/merge-tools.js +0 -69
- package/dist/tools/merged-name-redirect.d.ts +0 -26
- package/dist/tools/merged-name-redirect.js +0 -77
- package/dist/tools/navigate-arrival.d.ts +0 -68
- package/dist/tools/numeric-bounds.d.ts +0 -89
- package/dist/tools/numeric-bounds.js +0 -125
- package/dist/tools/observe-tools.js +0 -578
- package/dist/tools/read-tools.js +0 -569
- package/dist/tools/real-input-attempt.d.ts +0 -68
- package/dist/tools/real-input-attempt.js +0 -360
- package/dist/tools/reconcile-tools.js +0 -126
- package/dist/tools/resolve-target.js +0 -116
- package/dist/tools/snapshot-delta.d.ts +0 -92
- package/dist/tools/snapshot-delta.js +0 -356
- package/dist/tools/tool-kit.d.ts +0 -221
- package/dist/tools/tool-kit.js +0 -114
- package/dist/tools/tool-names.d.ts +0 -112
- package/dist/tools/tool-names.js +0 -112
- package/dist/tools/tool-surface.d.ts +0 -222
- package/dist/tools/tool-surface.js +0 -439
- package/dist/tools/tools-helpers.d.ts +0 -42
- package/dist/tools/tools-helpers.js +0 -87
- package/dist/tools/tools.d.ts +0 -20
- package/dist/tools/tools.js +0 -739
- package/dist/tools/unadvertised-help.js +0 -42
- package/dist/tools/verify-next-baton.js +0 -52
- package/dist/update/nudge-credit.js +0 -53
- package/dist/update/reticle-deps.d.ts +0 -9
- package/dist/update/reticle-deps.js +0 -27
- package/dist/update/sdk-sync.d.ts +0 -20
- package/dist/update/sdk-sync.js +0 -22
- package/dist/update/update-checker.js +0 -122
- package/dist/update/update-nudge.d.ts +0 -92
- package/dist/update/update-nudge.js +0 -214
- package/dist/update/updater.d.ts +0 -54
- package/dist/update/updater.js +0 -190
- package/dist/version/peer-announce.js +0 -32
- package/dist/version/sdk-fix.js +0 -127
- package/dist/version/server-version.js +0 -13
- package/dist/version/version-nudge.js +0 -61
- package/dist/version/version-skew.d.ts +0 -93
- package/dist/version/version-skew.js +0 -147
- package/dist/visual/visual-store.d.ts +0 -22
- package/dist/visual/visual-store.js +0 -66
- package/dist/visual/visual-tools.d.ts +0 -26
- package/dist/visual/visual-tools.js +0 -328
- package/docs/docs.json +0 -369
- package/docs/fixtures.md +0 -51
- package/docs/gate-plan.md +0 -104
- package/docs/gates.md +0 -131
- package/docs/style.css +0 -14
- package/docs/telemetry-contract.md +0 -390
- package/docs/telemetry-events.mdx +0 -442
- package/docs/tools-act-and-wait.mdx +0 -173
- package/docs/tools-act-sequence.mdx +0 -153
- package/docs/tools-act.mdx +0 -95
- package/docs/tools-assert.mdx +0 -129
- package/docs/tools-console.mdx +0 -63
- package/docs/tools-inspect.mdx +0 -88
- package/docs/tools-navigate.mdx +0 -107
- package/docs/tools-network.mdx +0 -119
- package/docs/tools-observe.mdx +0 -145
- package/docs/tools-overview.mdx +0 -160
- package/docs/tools-query.mdx +0 -126
- package/docs/tools-sessions.mdx +0 -94
- package/docs/tools-snapshot.mdx +0 -129
- package/docs/tools-state.mdx +0 -104
- package/docs/tools-wait-for.mdx +0 -85
- /package/dist/{cli → command/cli/answers}/gate-exit.d.ts +0 -0
- /package/dist/{cli → command/cli/answers}/gate-exit.js +0 -0
- /package/dist/{cli → command/cli/answers}/gate-hook-message.d.ts +0 -0
- /package/dist/{cli → command/cli/answers}/gate-hook-message.js +0 -0
- /package/dist/{cli → command/cli/answers}/open-note.d.ts +0 -0
- /package/dist/{cli → command/cli/answers}/open-note.js +0 -0
- /package/dist/{cli → command/cli/auth}/cloud-keystore.d.ts +0 -0
- /package/dist/{cli → command/cli/auth}/cloud-session.d.ts +0 -0
- /package/dist/{cli → command/cli/auth}/cloud-session.js +0 -0
- /package/dist/{cli → command/cli}/cli-doctor.d.ts +0 -0
- /package/dist/{cli → command/cli}/cli-parse-feedback.d.ts +0 -0
- /package/dist/{cli → command/cli}/cli-parse-feedback.js +0 -0
- /package/dist/{cli → command/cli}/cli-update-commands.d.ts +0 -0
- /package/dist/{cli → command/cli}/cloud-cli.d.ts +0 -0
- /package/dist/{cli → command/cli}/cloud-login.d.ts +0 -0
- /package/dist/{cli → command/cli}/daemon-start-options.js +0 -0
- /package/dist/{cli → command/cli/doctor/browser}/chromium-hint.d.ts +0 -0
- /package/dist/{cli → command/cli/doctor/browser}/chromium-hint.js +0 -0
- /package/dist/{cli → command/cli/doctor}/doctor-daemon-line.d.ts +0 -0
- /package/dist/{cli → command/cli/doctor}/doctor-project-line.d.ts +0 -0
- /package/dist/{cli → command/cli/doctor}/doctor-project-line.js +0 -0
- /package/dist/{cli → command/cli/doctor}/doctor-sessions-line.d.ts +0 -0
- /package/dist/{cli → command/cli/drive}/drive-command.d.ts +0 -0
- /package/dist/{cli → command/cli}/mcp-command.d.ts +0 -0
- /package/dist/{cli → command/cli/ports}/port-holder.d.ts +0 -0
- /package/dist/{cli → command/cli/ports}/sibling-ports.d.ts +0 -0
- /package/dist/{cli → command/cli/ports}/sibling-ports.js +0 -0
- /package/dist/{cli → command/cli}/project-name.d.ts +0 -0
- /package/dist/{cli → command/cli}/project-name.js +0 -0
- /package/dist/{daemon → command/daemon/binding}/free-port.d.ts +0 -0
- /package/dist/{daemon → command/daemon/binding}/free-port.js +0 -0
- /package/dist/{daemon → command/daemon/binding}/loopback-alias.d.ts +0 -0
- /package/dist/{daemon → command/daemon/binding}/loopback-alias.js +0 -0
- /package/dist/{daemon → command/daemon/binding}/port-presence.d.ts +0 -0
- /package/dist/{daemon → command/daemon/binding}/port-presence.js +0 -0
- /package/dist/{daemon → command/daemon}/dev-servers.d.ts +0 -0
- /package/dist/{daemon → command/daemon}/dev-servers.js +0 -0
- /package/dist/{daemon → command/daemon/lifetime}/startup-failure.d.ts +0 -0
- /package/dist/{daemon → command/daemon/lifetime}/startup-failure.js +0 -0
- /package/dist/{daemon → command/daemon/lifetime}/unclean-predecessor.d.ts +0 -0
- /package/dist/{daemon → command/daemon/lifetime}/unclean-predecessor.js +0 -0
- /package/dist/{daemon → command/daemon}/state-dir.d.ts +0 -0
- /package/dist/{setup → command/setup}/agent-io.d.ts +0 -0
- /package/dist/{setup → command/setup}/agent-io.js +0 -0
- /package/dist/{setup → command/setup}/approval-migration.d.ts +0 -0
- /package/dist/{setup → command/setup}/approval-migration.js +0 -0
- /package/dist/{setup → command/setup}/auto-approve.d.ts +0 -0
- /package/dist/{setup → command/setup/bringup}/ensure-daemon.d.ts +0 -0
- /package/dist/{setup → command/setup/bringup}/relaunch.d.ts +0 -0
- /package/dist/{setup → command/setup/bringup}/relaunch.js +0 -0
- /package/dist/{setup → command/setup}/desktop-shape.d.ts +0 -0
- /package/dist/{setup → command/setup}/desktop-shape.js +0 -0
- /package/dist/{setup → command/setup/init}/init-host.d.ts +0 -0
- /package/dist/{setup → command/setup}/license-key.d.ts +0 -0
- /package/dist/{setup → command/setup}/license-key.js +0 -0
- /package/dist/{setup → command/setup/probe}/existing-app.d.ts +0 -0
- /package/dist/{setup → command/setup/probe}/existing-app.js +0 -0
- /package/dist/{setup → command/setup/probe}/loopback-probe-urls.d.ts +0 -0
- /package/dist/{setup → command/setup/probe}/loopback-probe-urls.js +0 -0
- /package/dist/{setup → command/setup}/remaining-steps.d.ts +0 -0
- /package/dist/{setup → command/setup}/session-pick.d.ts +0 -0
- /package/dist/{setup → command/setup}/session-pick.js +0 -0
- /package/dist/{setup → command/setup/terminal}/confirm.d.ts +0 -0
- /package/dist/{setup → command/setup/terminal}/interrupt.d.ts +0 -0
- /package/dist/{setup → command/setup/terminal}/interrupt.js +0 -0
- /package/dist/{setup → command/setup/terminal}/listeners.d.ts +0 -0
- /package/dist/{setup → command/setup/terminal}/listeners.js +0 -0
- /package/dist/{setup → command/setup/terminal}/transcripts.d.ts +0 -0
- /package/dist/{setup → command/setup/terminal}/transcripts.js +0 -0
- /package/dist/{setup → command/setup/terminal}/wait-progress.d.ts +0 -0
- /package/dist/{setup → command/setup/terminal}/wait-progress.js +0 -0
- /package/dist/{update → command/update}/nudge-credit.d.ts +0 -0
- /package/dist/{update → command/update}/update-checker.d.ts +0 -0
- /package/dist/{version → command/version/identity}/server-version.d.ts +0 -0
- /package/dist/{version → command/version}/peer-announce.d.ts +0 -0
- /package/dist/{version → command/version}/sdk-fix.d.ts +0 -0
- /package/dist/{version → command/version}/version-nudge.d.ts +0 -0
- /package/dist/{crawl → features/crawl}/crawl-empty.d.ts +0 -0
- /package/dist/{crawl → features/crawl}/crawl-empty.js +0 -0
- /package/dist/{ee → features/ee}/audit-log.d.ts +0 -0
- /package/dist/{visual → features/visual}/capture-cleanup.d.ts +0 -0
- /package/dist/{visual → features/visual}/capture-cleanup.js +0 -0
- /package/dist/{visual → features/visual}/visual-diff.d.ts +0 -0
- /package/dist/{visual → features/visual}/visual-diff.js +0 -0
- /package/dist/{capsule → judgement/capsule}/divergence.js +0 -0
- /package/dist/{capsule → judgement/capsule}/minimize.d.ts +0 -0
- /package/dist/{capsule → judgement/capsule}/minimize.js +0 -0
- /package/dist/{domain → judgement/domain}/domain-model.d.ts +0 -0
- /package/dist/{domain → judgement/domain}/flow-risk.d.ts +0 -0
- /package/dist/{hunt → judgement/hunt}/hunt-report.d.ts +0 -0
- /package/dist/{hunt → judgement/hunt}/hunt-report.js +0 -0
- /package/dist/{oracles → judgement/oracles}/flow-instrument-gaps.d.ts +0 -0
- /package/dist/{oracles → judgement/oracles}/flow-instrument-gaps.js +0 -0
- /package/dist/{oracles → judgement/oracles}/self-instrument.d.ts +0 -0
- /package/dist/{oracles → judgement/oracles}/self-instrument.js +0 -0
- /package/dist/{flows → judgement/outcome}/assertion-integrity.d.ts +0 -0
- /package/dist/{flows → judgement/outcome}/assertion-integrity.js +0 -0
- /package/dist/{flows → judgement/outcome}/attributed-failure.d.ts +0 -0
- /package/dist/{flows → judgement/outcome}/attributed-failure.js +0 -0
- /package/dist/{flows → judgement/outcome}/role-drift-reason.d.ts +0 -0
- /package/dist/{flows → judgement/outcome}/role-drift-reason.js +0 -0
- /package/dist/{flows → judgement/outcome}/verify-change-verdict.d.ts +0 -0
- /package/dist/{flows → judgement/outcome}/verify-change-verdict.js +0 -0
- /package/dist/{phenomena → judgement/phenomena}/phenomena.d.ts +0 -0
- /package/dist/{phenomena → judgement/phenomena}/phenomena.js +0 -0
- /package/dist/{runs → judgement/runs/artifact}/profile-redact.d.ts +0 -0
- /package/dist/{runs → judgement/runs/artifact}/profile-redact.js +0 -0
- /package/dist/{runs → judgement/runs/artifact}/render-report.d.ts +0 -0
- /package/dist/{runs → judgement/runs/artifact}/replay-mapping.d.ts +0 -0
- /package/dist/{runs → judgement/runs/artifact}/run-context.d.ts +0 -0
- /package/dist/{runs → judgement/runs/artifact}/run-context.js +0 -0
- /package/dist/{runs → judgement/runs/artifact}/run-diff.d.ts +0 -0
- /package/dist/{runs → judgement/runs/artifact}/run-diff.js +0 -0
- /package/dist/{runs → judgement/runs}/repair-prompt.d.ts +0 -0
- /package/dist/{runs → judgement/runs}/repair-prompt.js +0 -0
- /package/dist/{runs → judgement/runs}/risk-classify.d.ts +0 -0
- /package/dist/{runs → judgement/runs}/risk-classify.js +0 -0
- /package/dist/{runs → judgement/runs}/verify-http.d.ts +0 -0
- /package/dist/{runs → judgement/runs}/verify-http.js +0 -0
- /package/dist/{runs → judgement/runs}/verify-server.d.ts +0 -0
- /package/dist/{runs → judgement/runs}/verify-server.js +0 -0
- /package/dist/{flows → language/flows/annotate-notes}/annotate-target.d.ts +0 -0
- /package/dist/{flows → language/flows/annotate-notes}/annotate-target.js +0 -0
- /package/dist/{flows → language/flows/annotate-notes}/annotate.d.ts +0 -0
- /package/dist/{flows → language/flows/annotate-notes}/annotate.js +0 -0
- /package/dist/{flows → language/flows}/buddy-status.d.ts +0 -0
- /package/dist/{flows → language/flows}/buddy-status.js +0 -0
- /package/dist/{flows → language/flows/change}/gate.d.ts +0 -0
- /package/dist/{flows → language/flows/change}/git-changed.d.ts +0 -0
- /package/dist/{flows → language/flows/change}/git-changed.js +0 -0
- /package/dist/{flows → language/flows/change}/watch-batcher.d.ts +0 -0
- /package/dist/{flows → language/flows/change}/watch-batcher.js +0 -0
- /package/dist/{flows → language/flows}/empty-flow.d.ts +0 -0
- /package/dist/{flows → language/flows}/flow-memory-consult.d.ts +0 -0
- /package/dist/{flows → language/flows}/flow-memory-consult.js +0 -0
- /package/dist/{flows → language/flows}/flow-report.d.ts +0 -0
- /package/dist/{flows → language/flows}/flow-report.js +0 -0
- /package/dist/{flows → language/flows}/flow-scope.d.ts +0 -0
- /package/dist/{flows → language/flows}/flow-scope.js +0 -0
- /package/dist/{flows → language/flows}/flow-store-for-session.js +0 -0
- /package/dist/{flows → language/flows}/heal.d.ts +0 -0
- /package/dist/{flows → language/flows/recording}/flake.js +0 -0
- /package/dist/{flows → language/flows/recording}/recording-backtrack.d.ts +0 -0
- /package/dist/{flows → language/flows/recording}/replay-halt.d.ts +0 -0
- /package/dist/{flows → language/flows/recording}/replay-halt.js +0 -0
- /package/dist/{flows → language/flows}/role-anchor-nearest.d.ts +0 -0
- /package/dist/{flows → language/flows/stores}/annotation-store.d.ts +0 -0
- /package/dist/{flows → language/flows/stores}/annotation-store.js +0 -0
- /package/dist/{flows → language/flows/suite}/coverage.d.ts +0 -0
- /package/dist/{flows → language/flows/suite}/coverage.js +0 -0
- /package/dist/{flows → language/flows/suite}/parallel-suite.d.ts +0 -0
- /package/dist/{flows → language/flows/suite}/parallel-suite.js +0 -0
- /package/dist/{platform.d.ts → machine/platform.d.ts} +0 -0
- /package/dist/{platform.js → machine/platform.js} +0 -0
- /package/dist/{temp-dir.d.ts → machine/temp-dir.d.ts} +0 -0
- /package/dist/{temp-dir.js → machine/temp-dir.js} +0 -0
- /package/dist/{cloud → memory/cloud}/sync-disk.d.ts +0 -0
- /package/dist/{cloud → memory/cloud}/sync-hash.d.ts +0 -0
- /package/dist/{cloud → memory/cloud}/sync-hash.js +0 -0
- /package/dist/{journal → memory/journal}/deviation-report.d.ts +0 -0
- /package/dist/{journal → memory/journal}/deviation-report.js +0 -0
- /package/dist/{journal → memory/journal}/deviation-service.d.ts +0 -0
- /package/dist/{journal → memory/journal}/deviation-service.js +0 -0
- /package/dist/{journal → memory/journal}/envelope.js +0 -0
- /package/dist/{journal → memory/journal}/rollups.d.ts +0 -0
- /package/dist/{journal → memory/journal}/rollups.js +0 -0
- /package/dist/{project → memory/project}/baselines.d.ts +0 -0
- /package/dist/{project → memory/project}/baselines.js +0 -0
- /package/dist/{project → memory/project}/file-lock.d.ts +0 -0
- /package/dist/{project → memory/project}/file-lock.js +0 -0
- /package/dist/{project → memory/project}/memory-fs.js +0 -0
- /package/dist/{session → memory/recall}/looks-like-dev-server.d.ts +0 -0
- /package/dist/{session → memory/recall}/looks-like-dev-server.js +0 -0
- /package/dist/memory/{project-memory.js → recall/project-memory.js} +0 -0
- /package/dist/{session → memory/recall}/registered-projects.d.ts +0 -0
- /package/dist/{session → memory/recall}/registered-projects.js +0 -0
- /package/dist/{bridge → portal/bridge}/pairing-token.d.ts +0 -0
- /package/dist/{bridge → portal/bridge}/pairing-token.js +0 -0
- /package/dist/{bridge → portal/bridge}/protocol-skew.d.ts +0 -0
- /package/dist/{bridge → portal/bridge}/protocol-skew.js +0 -0
- /package/dist/{bridge → portal/bridge}/token-auth.d.ts +0 -0
- /package/dist/{bridge → portal/bridge}/token-auth.js +0 -0
- /package/dist/{input → portal/input}/driven-redaction.d.ts +0 -0
- /package/dist/{input → portal/input}/driven-redaction.js +0 -0
- /package/dist/{input → portal/input}/network-mock.d.ts +0 -0
- /package/dist/{input → portal/input}/scroll-find.d.ts +0 -0
- /package/dist/{pool → portal/pool}/lease-reaper.d.ts +0 -0
- /package/dist/{pool → portal/pool}/playwright-launcher.d.ts +0 -0
- /package/dist/{pool → portal/pool}/storage-seed.js +0 -0
- /package/dist/{session → portal/session}/control-envelope.d.ts +0 -0
- /package/dist/{session → portal/session}/control-envelope.js +0 -0
- /package/dist/{session → portal/session/dev-server}/dev-command.d.ts +0 -0
- /package/dist/{session → portal/session/dev-server}/dev-command.js +0 -0
- /package/dist/{session → portal/session/dev-server}/dev-server-probe.d.ts +0 -0
- /package/dist/{session → portal/session/facts}/ref-provenance.d.ts +0 -0
- /package/dist/{session → portal/session/facts}/ref-provenance.js +0 -0
- /package/dist/{session → portal/session}/fake-session.d.ts +0 -0
- /package/dist/{session → portal/session}/fake-session.js +0 -0
- /package/dist/{session → portal/session/human}/live-control.d.ts +0 -0
- /package/dist/{session → portal/session/human}/live-control.js +0 -0
- /package/dist/{session → portal/session/human}/presenter-args.d.ts +0 -0
- /package/dist/{session → portal/session/human}/presenter-args.js +0 -0
- /package/dist/{session → portal/session/human}/review-store.d.ts +0 -0
- /package/dist/{session → portal/session/human}/review-store.js +0 -0
- /package/dist/{session → portal/session}/last-act.d.ts +0 -0
- /package/dist/{session → portal/session}/last-act.js +0 -0
- /package/dist/{session → portal/session}/lease-visibility.d.ts +0 -0
- /package/dist/{session → portal/session}/lease-visibility.js +0 -0
- /package/dist/{session → portal/session}/no-session-watch.d.ts +0 -0
- /package/dist/{session → portal/session/page-commands}/pending-commands.d.ts +0 -0
- /package/dist/{session → portal/session/page-commands}/pending-commands.js +0 -0
- /package/dist/{session → portal/session/presence}/attachment-history.d.ts +0 -0
- /package/dist/{session → portal/session/presence}/attachment-history.js +0 -0
- /package/dist/{session → portal/session/presence}/lease-availability.d.ts +0 -0
- /package/dist/{session → portal/session/presence}/lease-availability.js +0 -0
- /package/dist/{session → portal/session/presence}/session-lease.d.ts +0 -0
- /package/dist/{session → portal/session/presence}/session-lease.js +0 -0
- /package/dist/{session → portal/session/presence}/session-mirror.d.ts +0 -0
- /package/dist/{session → portal/session/presence}/session-mirror.js +0 -0
- /package/dist/{session → portal/session/presence}/session-recommendation.d.ts +0 -0
- /package/dist/{session → portal/session}/session-info.d.ts +0 -0
- /package/dist/{session → portal/session}/session-info.js +0 -0
- /package/dist/{session → portal/session}/session-reconnect.d.ts +0 -0
- /package/dist/{session → portal/session}/session-reconnect.js +0 -0
- /package/dist/{session → portal/session}/session-successor.d.ts +0 -0
- /package/dist/{session → portal/session}/session-successor.js +0 -0
- /package/dist/{session → portal/session}/stall-clock.d.ts +0 -0
- /package/dist/{session → portal/session}/state-select.d.ts +0 -0
- /package/dist/{session → portal/session}/state-select.js +0 -0
- /package/dist/{session → portal/session/timing}/resolve-within.d.ts +0 -0
- /package/dist/{session → portal/session/timing}/resolve-within.js +0 -0
- /package/dist/{session → portal/session/timing}/wall-clock.d.ts +0 -0
- /package/dist/{session → portal/session/timing}/wall-clock.js +0 -0
- /package/dist/{loopback-agent.d.ts → surface/loopback-agent.d.ts} +0 -0
- /package/dist/{loopback-agent.js → surface/loopback-agent.js} +0 -0
- /package/dist/{mcp → surface/mcp}/attach-memory.d.ts +0 -0
- /package/dist/{mcp → surface/mcp}/attach-memory.js +0 -0
- /package/dist/{mcp → surface/mcp/peer}/client-identity.d.ts +0 -0
- /package/dist/{mcp → surface/mcp/peer}/client-identity.js +0 -0
- /package/dist/{mcp → surface/mcp/proxy}/mcp-post-transport.d.ts +0 -0
- /package/dist/{mcp → surface/mcp/proxy}/proxy-backoff.d.ts +0 -0
- /package/dist/{mcp → surface/mcp/proxy}/proxy-backoff.js +0 -0
- /package/dist/{mcp → surface/mcp/proxy}/proxy-handshake.d.ts +0 -0
- /package/dist/{mcp → surface/mcp}/proxy-idle-exit.d.ts +0 -0
- /package/dist/{mcp → surface/mcp}/proxy-idle-exit.js +0 -0
- /package/dist/{mcp → surface/mcp}/shared-params.d.ts +0 -0
- /package/dist/{mcp → surface/mcp}/shared-params.js +0 -0
- /package/dist/{mcp → surface/mcp}/sse-frame-parser.d.ts +0 -0
- /package/dist/{mcp → surface/mcp}/sse-frame-parser.js +0 -0
- /package/dist/{tools → surface/tools/act}/act-danger.d.ts +0 -0
- /package/dist/{tools → surface/tools/act}/act-sequence-retry.d.ts +0 -0
- /package/dist/{tools → surface/tools/act}/act-sequence-retry.js +0 -0
- /package/dist/{tools → surface/tools/act}/act-view.d.ts +0 -0
- /package/dist/{tools → surface/tools/act}/act-view.js +0 -0
- /package/dist/{tools → surface/tools/act/navigation}/navigate-arrival.js +0 -0
- /package/dist/{tools → surface/tools/act/navigation}/navigate-result.d.ts +0 -0
- /package/dist/{tools → surface/tools/act/navigation}/navigate-result.js +0 -0
- /package/dist/{tools → surface/tools/act/navigation}/reload-result.d.ts +0 -0
- /package/dist/{tools → surface/tools/act/navigation}/reload-result.js +0 -0
- /package/dist/{tools → surface/tools/act}/react-grace.d.ts +0 -0
- /package/dist/{tools → surface/tools/act}/react-grace.js +0 -0
- /package/dist/{tools → surface/tools/act}/resolve-target.d.ts +0 -0
- /package/dist/{tools → surface/tools/act}/settle-in-flight.d.ts +0 -0
- /package/dist/{tools → surface/tools/act}/settle-in-flight.js +0 -0
- /package/dist/{tools → surface/tools}/act-sequence-tool.d.ts +0 -0
- /package/dist/{tools → surface/tools/args}/alias-args.d.ts +0 -0
- /package/dist/{tools → surface/tools/args}/alias-args.js +0 -0
- /package/dist/{tools → surface/tools/gaps}/coverage-identity.d.ts +0 -0
- /package/dist/{tools → surface/tools/gaps}/coverage-identity.js +0 -0
- /package/dist/{tools → surface/tools/gaps}/observed-nothing.d.ts +0 -0
- /package/dist/{tools → surface/tools/gaps}/observed-nothing.js +0 -0
- /package/dist/{tools → surface/tools/gaps}/sdk-marker-probe.d.ts +0 -0
- /package/dist/{tools → surface/tools/gaps}/sdk-marker-probe.js +0 -0
- /package/dist/{tools → surface/tools}/observe-tools.d.ts +0 -0
- /package/dist/{tools → surface/tools/read}/complete-snapshot.d.ts +0 -0
- /package/dist/{tools → surface/tools/read}/complete-snapshot.js +0 -0
- /package/dist/{tools → surface/tools/read}/query-paginate.d.ts +0 -0
- /package/dist/{tools → surface/tools/read}/query-paginate.js +0 -0
- /package/dist/{tools → surface/tools/read}/query-shape.d.ts +0 -0
- /package/dist/{tools → surface/tools/read}/query-shape.js +0 -0
- /package/dist/{tools → surface/tools}/read-tools.d.ts +0 -0
- /package/dist/{tools → surface/tools}/reconcile-tools.d.ts +0 -0
- /package/dist/{honesty → surface/tools}/tool-hit-rate.d.ts +0 -0
- /package/dist/{tools → surface/tools}/tool-invoker.d.ts +0 -0
- /package/dist/{tools → surface/tools}/tool-invoker.js +0 -0
- /package/dist/{tools → surface/tools}/unadvertised-help.d.ts +0 -0
- /package/dist/{tools → surface/tools}/verify-next-baton.d.ts +0 -0
- /package/docs/{tools-session-and-feedback.mdx → tools/session-and-feedback.mdx} +0 -0
- /package/docs/{tools-tools-and-run.mdx → tools/tools-and-run.mdx} +0 -0
|
@@ -0,0 +1,808 @@
|
|
|
1
|
+
import * as http from 'node:http';
|
|
2
|
+
import { authFailureReason } from './auth-failure-reason.js';
|
|
3
|
+
import { impactSnapshot, recordImpact } from '../../memory/impact/impact-recorder.js';
|
|
4
|
+
import { WebSocketServer } from 'ws';
|
|
5
|
+
import { HookEvent } from '@reticlehq/core/hooks';
|
|
6
|
+
import { emitSessionHook } from '../../hooks/hook-emit.js';
|
|
7
|
+
import { EventType, HumanControlKind, RETICLE_WS_PATH, ReticleMessageSchema, LOOPBACK_HOST, MessageKind, ReticleEnv, RETICLE_PROTOCOL_VERSION, TRANSPORT_LIMITS, isLocalPage, isLoopbackHostname, isOpaqueOrigin, OPAQUE_ORIGIN, isHighValueEvent, RATE_CAP_HIGH_VALUE_RESERVE_RATIO, CONTRACT_FINGERPRINT, CONTRACT_PARTS, } from '@reticlehq/core';
|
|
8
|
+
import { Session } from '../session/session.js';
|
|
9
|
+
import { SessionManager } from '../session/session-manager.js';
|
|
10
|
+
import { tokensMatch } from './token-auth.js';
|
|
11
|
+
import { pairingTokenSource } from './pairing-token.js';
|
|
12
|
+
import { log } from '../../log.js';
|
|
13
|
+
import { getSessionMetrics } from '../../telemetry/session-metrics.js';
|
|
14
|
+
import { sessionReplacedReason } from '../session/facts/session-replaced.js';
|
|
15
|
+
import { describeSkew, sdkFix, SkewPair } from '../../command/version/version-skew.js';
|
|
16
|
+
import { noteVersionSkew } from '../../command/version/version-nudge.js';
|
|
17
|
+
import { protocolSkewReason } from './protocol-skew.js';
|
|
18
|
+
import { SERVER_VERSION } from '../../command/version/identity/server-version.js';
|
|
19
|
+
/**
|
|
20
|
+
* Take the mutable half of a session's identity from a repeat HELLO.
|
|
21
|
+
*
|
|
22
|
+
* Lives here rather than on Session because this is where the protocol decision is made — the caller
|
|
23
|
+
* has already established that the hello belongs to this same session — and because these fields are
|
|
24
|
+
* the session's public surface, read by the tools on every listing.
|
|
25
|
+
*
|
|
26
|
+
* `hasCapabilities` is the one that matters: it is announced in the hello, which the SDK sends at
|
|
27
|
+
* connect(), while capabilities are registered AFTER connect by design (registerStore needs a live
|
|
28
|
+
* SDK to subscribe through). Without this refresh, an app that declared its entire testable surface
|
|
29
|
+
* reported `hasCapabilities: false` forever.
|
|
30
|
+
*/
|
|
31
|
+
function refreshIdentity(session, hello) {
|
|
32
|
+
session.url = hello.url;
|
|
33
|
+
session.title = hello.title;
|
|
34
|
+
session.adapters = hello.adapters;
|
|
35
|
+
session.hasCapabilities = hello.hasCapabilities ?? false;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The close reasons worth telling an AGENT about, not just the SDK.
|
|
39
|
+
*
|
|
40
|
+
* The SDK prints these and stops retrying. The agent then calls a tool and is told "no browser
|
|
41
|
+
* session connected" — which is indistinguishable from an app nobody started. An outdated SDK and a
|
|
42
|
+
* stale pairing token were both invisible for that reason; these two carry their own remedy, so
|
|
43
|
+
* surfacing them is strictly better than the generic answer.
|
|
44
|
+
*/
|
|
45
|
+
export const WS_CLOSE_REASON = {
|
|
46
|
+
/**
|
|
47
|
+
* The generic form. The live path picks a DIRECTION-aware reason instead (see protocol-skew.ts);
|
|
48
|
+
* this stays as the close-code table's label and as the fallback when the skew cannot be read.
|
|
49
|
+
*/
|
|
50
|
+
PROTOCOL_MISMATCH: 'protocol version mismatch — @reticlehq/browser and server disagree',
|
|
51
|
+
AUTH_FAILED: 'authentication failed — restart the dev server; a reload keeps the old pairing token',
|
|
52
|
+
/**
|
|
53
|
+
* The daemon threw while handling a message. Closing is deliberate: an exception leaves the
|
|
54
|
+
* session in a state neither side can describe, and a socket left OPEN and unresponsive is the
|
|
55
|
+
* worst of the outcomes — the agent's next tool call reports "no browser session connected",
|
|
56
|
+
* which reads as an app nobody started. Closing at least makes the SDK reconnect and say so.
|
|
57
|
+
*/
|
|
58
|
+
HANDLER_FAILED: 'the Reticle daemon failed handling a message — reload the page to reconnect',
|
|
59
|
+
/**
|
|
60
|
+
* The pool of half-open handshakes was full, so this dial was turned away before it could say
|
|
61
|
+
* anything. Every other refusal here records why and this one did not — it closed the socket and
|
|
62
|
+
* returned — so an app that was running, instrumented and actively dialling looked exactly like an
|
|
63
|
+
* app nobody had started, and the diagnosis went hunting a stopped dev server.
|
|
64
|
+
*
|
|
65
|
+
* Names the cause and the fact that it is transient, because the remedy differs from every other
|
|
66
|
+
* refusal on this path: nothing about the app is wrong and retrying is the correct response.
|
|
67
|
+
*/
|
|
68
|
+
HANDSHAKE_POOL_FULL: 'refused at the handshake pool — too many connections were mid-handshake on this daemon, so ' +
|
|
69
|
+
'this dial never got to identify itself. Nothing is wrong with the app; the pool drains on its ' +
|
|
70
|
+
'own and reloading the page reconnects. If it persists, something else on this machine is ' +
|
|
71
|
+
'opening sockets to this port.',
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* A dial turned away at the ORIGIN gate, in words the reader can act on.
|
|
75
|
+
*
|
|
76
|
+
* This is the refusal that used to leave no trace anywhere. It happens before any HELLO, so it
|
|
77
|
+
* produced no `noteClosure`, no `session_disconnected`, nothing but an `origin_rejected` log line —
|
|
78
|
+
* and the daemon log is the file nobody opens until they have already lost the afternoon. Reported
|
|
79
|
+
* from a multi-tenant app resolving its tenant from the `Host` header: on a hosts-file alias every
|
|
80
|
+
* dial was refused here, `doctor` reported every check green, and the lease hint blamed the port.
|
|
81
|
+
*
|
|
82
|
+
* The origin is IN the message because it is the fix: it is either the alias to allow-list, or the
|
|
83
|
+
* proof that the page is not being served from where the developer thinks it is.
|
|
84
|
+
*/
|
|
85
|
+
function originRejectedReason(origin) {
|
|
86
|
+
const named = origin === undefined || 0 === origin.length ? 'a page sending no Origin' : origin;
|
|
87
|
+
return (`a browser dialled this daemon and was REFUSED at the origin gate: ${named} is not allowed. ` +
|
|
88
|
+
'Off localhost the SDK needs BOTH `allowNonLocalhost: true` AND a pairing token, and the ' +
|
|
89
|
+
'daemon needs that origin allow-listed (RETICLE_ALLOWED_ORIGINS). The app is running and ' +
|
|
90
|
+
'instrumented — it was turned away, so do not go looking for a stopped dev server.');
|
|
91
|
+
}
|
|
92
|
+
/** WS close codes + reasons the bridge sends to the SDK (1008 = policy violation, 1013 = try again later). */
|
|
93
|
+
const WS_CLOSE = {
|
|
94
|
+
TOO_MANY_HANDSHAKES: [1013, 'too many pending handshakes'],
|
|
95
|
+
HELLO_TIMEOUT: [1008, 'hello timeout'],
|
|
96
|
+
INVALID_MESSAGE: [1008, 'invalid message'],
|
|
97
|
+
HELLO_DUPLICATE: [1008, 'hello already received'],
|
|
98
|
+
// AUTH_FAILED's code is 1008; the reason string is chosen at close time by authFailureReason
|
|
99
|
+
// (no token vs wrong token vs different project). A reload cannot mint a credential into a CDN
|
|
100
|
+
// snippet or a Next env frozen at config eval. Kept under the 123-byte close-reason limit.
|
|
101
|
+
AUTH_FAILED: [1008, WS_CLOSE_REASON.AUTH_FAILED],
|
|
102
|
+
SESSION_LIMIT: [1013, 'session limit reached'],
|
|
103
|
+
PROTOCOL_MISMATCH: [1008, WS_CLOSE_REASON.PROTOCOL_MISMATCH],
|
|
104
|
+
HANDLER_FAILED: [1011, WS_CLOSE_REASON.HANDLER_FAILED],
|
|
105
|
+
};
|
|
106
|
+
/** Parse a positive integer env override; anything else (unset, zero, junk) falls through to the default. */
|
|
107
|
+
function positiveIntFromEnv(raw) {
|
|
108
|
+
if (raw === undefined)
|
|
109
|
+
return undefined;
|
|
110
|
+
const parsed = Number.parseInt(raw, 10);
|
|
111
|
+
return Number.isFinite(parsed) && parsed > 0 ? parsed : undefined;
|
|
112
|
+
}
|
|
113
|
+
/** The flow name if this event is a panel ▶ replay request, else undefined. Pure boundary narrowing. */
|
|
114
|
+
function replayRequest(event) {
|
|
115
|
+
if (event.type !== EventType.HUMAN_CONTROL)
|
|
116
|
+
return undefined;
|
|
117
|
+
if (event.data['kind'] !== HumanControlKind.REPLAY)
|
|
118
|
+
return undefined;
|
|
119
|
+
const name = event.data['text'];
|
|
120
|
+
return 'string' === typeof name && name.length > 0 ? name : undefined;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* The desired harness state if this event is the panel's switch, else undefined.
|
|
124
|
+
*
|
|
125
|
+
* Carries `on`/`off` rather than meaning "toggle": a double-click on a flaky connection sends two,
|
|
126
|
+
* and two toggles land back where they started while two `on`s are the same as one.
|
|
127
|
+
*/
|
|
128
|
+
function harnessRequest(event) {
|
|
129
|
+
if (event.type !== EventType.HUMAN_CONTROL)
|
|
130
|
+
return undefined;
|
|
131
|
+
if (event.data['kind'] !== HumanControlKind.HARNESS)
|
|
132
|
+
return undefined;
|
|
133
|
+
const want = event.data['text'];
|
|
134
|
+
if ('on' === want)
|
|
135
|
+
return true;
|
|
136
|
+
if ('off' === want)
|
|
137
|
+
return false;
|
|
138
|
+
return undefined;
|
|
139
|
+
}
|
|
140
|
+
/** True when this event is the panel's "sync now" button. Pure boundary narrowing, like the above. */
|
|
141
|
+
function isSyncRequest(event) {
|
|
142
|
+
return event.type === EventType.HUMAN_CONTROL && event.data['kind'] === HumanControlKind.SYNC;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Canonical comparable form of a WS `Origin`. Web origins collapse to scheme://host[:port]. An
|
|
146
|
+
* OPAQUE origin — a desktop webview (`tauri://localhost`, `app://.`) or `file://`, whose `URL.origin`
|
|
147
|
+
* is the string "null" — is kept VERBATIM instead, so it survives into the allow-list and can be
|
|
148
|
+
* compared. Collapsing those to "null" would both merge every desktop scheme into one bucket and
|
|
149
|
+
* feed an unparseable string to `new URL`. Returns null only for a header that is not an origin.
|
|
150
|
+
*/
|
|
151
|
+
function normalizeOrigin(origin) {
|
|
152
|
+
if (origin === OPAQUE_ORIGIN)
|
|
153
|
+
return OPAQUE_ORIGIN;
|
|
154
|
+
try {
|
|
155
|
+
const web = new URL(origin).origin;
|
|
156
|
+
return web === OPAQUE_ORIGIN ? origin : web;
|
|
157
|
+
}
|
|
158
|
+
catch {
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* When a message fails the strict schema, detect the specific case of a HELLO whose protocolVersion
|
|
164
|
+
* differs from ours — so we can tell the operator "upgrade @reticlehq/browser" instead of dropping the
|
|
165
|
+
* connection into the generic NO_SESSION_CONNECTED path, which misdiagnoses it as a port mismatch.
|
|
166
|
+
* Returns the mismatched version, or null when it isn't a version-mismatched HELLO.
|
|
167
|
+
*/
|
|
168
|
+
function helloProtocolMismatch(text) {
|
|
169
|
+
try {
|
|
170
|
+
const json = JSON.parse(text);
|
|
171
|
+
if (json.kind === MessageKind.HELLO &&
|
|
172
|
+
'number' === typeof json.protocolVersion &&
|
|
173
|
+
json.protocolVersion !== RETICLE_PROTOCOL_VERSION) {
|
|
174
|
+
return json.protocolVersion;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
/* not JSON — fall through to the generic invalid-message path */
|
|
179
|
+
}
|
|
180
|
+
return null;
|
|
181
|
+
}
|
|
182
|
+
/** Normalize ws RawData (string | Buffer | Buffer[] | ArrayBuffer) into a UTF-8 string. */
|
|
183
|
+
function rawToString(raw) {
|
|
184
|
+
if ('string' === typeof raw)
|
|
185
|
+
return raw;
|
|
186
|
+
if (Array.isArray(raw))
|
|
187
|
+
return Buffer.concat(raw).toString('utf8');
|
|
188
|
+
if (raw instanceof ArrayBuffer)
|
|
189
|
+
return Buffer.from(raw).toString('utf8');
|
|
190
|
+
return raw.toString('utf8');
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* The browser-facing half of the relay: a localhost WebSocket server. Each connection
|
|
194
|
+
* announces itself with HELLO (registering a Session), then streams EVENTs and replies to
|
|
195
|
+
* COMMANDs.
|
|
196
|
+
*/
|
|
197
|
+
export class Bridge {
|
|
198
|
+
sessions = new SessionManager();
|
|
199
|
+
/** Resolves with the actually-bound port once the server is listening. */
|
|
200
|
+
ready;
|
|
201
|
+
#wss;
|
|
202
|
+
#clock;
|
|
203
|
+
#token;
|
|
204
|
+
/** Which source supplied #token — logged on a refusal so a mismatch names its own cause. */
|
|
205
|
+
#tokenSource;
|
|
206
|
+
/**
|
|
207
|
+
* Projects this daemon has ACCEPTED a session from. Evidence, not derivation: it is what lets a
|
|
208
|
+
* leaked daemon say "I belong to another project" instead of "authentication failed". See
|
|
209
|
+
* authFailureReason.
|
|
210
|
+
*/
|
|
211
|
+
#servedProjects = new Set();
|
|
212
|
+
/** Session ids already counted in the impact record - a reconnect is not a new session. */
|
|
213
|
+
#countedSessions = new Set();
|
|
214
|
+
#allowedOrigins;
|
|
215
|
+
#maxMessagesPerSecond;
|
|
216
|
+
#maxSessions;
|
|
217
|
+
#maxPendingConnections;
|
|
218
|
+
#helloTimeoutMs;
|
|
219
|
+
#sdkFix;
|
|
220
|
+
#pendingConnections = 0;
|
|
221
|
+
#onReplay;
|
|
222
|
+
/**
|
|
223
|
+
* EVERY session-ready handler, not the most recent one.
|
|
224
|
+
*
|
|
225
|
+
* This was a single slot, and a second `attachSessionReady` silently replaced the first. Nothing
|
|
226
|
+
* threw and nothing went red — the earlier handler simply never ran again. It cost the
|
|
227
|
+
* `app_instrumented` metric on its first day: the call was wired correctly, registered before the
|
|
228
|
+
* flow-chip handler, and overwritten by it, so the event that measures whether an app was ever
|
|
229
|
+
* instrumented was permanently absent. Found by connecting a real session to a real daemon, which
|
|
230
|
+
* is the only thing that could have found it.
|
|
231
|
+
*/
|
|
232
|
+
#onSessionReady = [];
|
|
233
|
+
/*
|
|
234
|
+
* A LIST, not a single slot.
|
|
235
|
+
*
|
|
236
|
+
* It held one handler, so a second `attachSessionCreate` silently replaced the first — and the
|
|
237
|
+
* first is what stamps a session's artifactRoot, without which every verdict is recorded against
|
|
238
|
+
* wherever the daemon was started. A registration API whose failure mode is "the previous caller
|
|
239
|
+
* stops working, quietly" is a trap; anything that needs to run on a new session now simply runs.
|
|
240
|
+
*/
|
|
241
|
+
#onSessionCreate = [];
|
|
242
|
+
/** Fired when a session is removed — flushes its journal tail + persists what it learned. */
|
|
243
|
+
#onSessionEnd;
|
|
244
|
+
/** Wired by the daemon: push to the dashboard now, because somebody asked in the panel. */
|
|
245
|
+
#onSyncRequest;
|
|
246
|
+
#onHarnessRequest;
|
|
247
|
+
constructor(options) {
|
|
248
|
+
const host = options.host ?? LOOPBACK_HOST;
|
|
249
|
+
if ((options.token?.length ?? 0) > TRANSPORT_LIMITS.MAX_TOKEN_LENGTH) {
|
|
250
|
+
throw new Error(`Reticle pairing token exceeds ${String(TRANSPORT_LIMITS.MAX_TOKEN_LENGTH)} characters`);
|
|
251
|
+
}
|
|
252
|
+
if (!isLoopbackHostname(host) && (options.token === undefined || 0 === options.token.length)) {
|
|
253
|
+
throw new Error('a pairing token is required when the Reticle bridge binds beyond localhost');
|
|
254
|
+
}
|
|
255
|
+
this.#clock = options.clock ?? (() => Date.now());
|
|
256
|
+
this.#token =
|
|
257
|
+
options.token !== undefined && options.token.length > 0 ? options.token : undefined;
|
|
258
|
+
// Supplied by resolveBridgeSecurity, which is the only place that can tell an auto-provisioned
|
|
259
|
+
// token from one a caller passed — both arrive here as options.token. Defaulted rather than
|
|
260
|
+
// required so a directly-constructed Bridge (tests, embedders) still logs something true.
|
|
261
|
+
this.#tokenSource =
|
|
262
|
+
options.tokenSource ??
|
|
263
|
+
pairingTokenSource({
|
|
264
|
+
explicit: options.token !== undefined && 0 < options.token.length,
|
|
265
|
+
env: process.env,
|
|
266
|
+
});
|
|
267
|
+
// An entry that fails to normalize — typically a scheme-less `myapp.test` — used to be
|
|
268
|
+
// filtered out with no trace: the allow-list LOOKED configured, every dial from that origin
|
|
269
|
+
// was refused at the gate, and the refusal read as a scheme mismatch in the page rather than
|
|
270
|
+
// as a config value that was silently discarded. Warn at construction, naming the entry and
|
|
271
|
+
// the accepted form, so the config error surfaces at startup instead of as a mystery 403.
|
|
272
|
+
this.#allowedOrigins = new Set();
|
|
273
|
+
for (const entry of options.allowedOrigins ?? []) {
|
|
274
|
+
const normalized = normalizeOrigin(entry);
|
|
275
|
+
if (null === normalized) {
|
|
276
|
+
log('allowed_origin_ignored', {
|
|
277
|
+
entry,
|
|
278
|
+
warning: `${ReticleEnv.ALLOWED_ORIGINS} entry "${entry}" is not a valid origin and was ` +
|
|
279
|
+
`IGNORED — an origin needs a scheme, e.g. "http://${entry}" (scheme://host[:port]).`,
|
|
280
|
+
});
|
|
281
|
+
continue;
|
|
282
|
+
}
|
|
283
|
+
this.#allowedOrigins.add(normalized);
|
|
284
|
+
}
|
|
285
|
+
// Binding beyond localhost means the browser dials in from a non-loopback Origin. With no
|
|
286
|
+
// allow-list, #originAllowed rejects every such Origin at the WS handshake, so the bridge comes
|
|
287
|
+
// up but accepts nothing — a silent, fail-closed footgun. Refuse to start with a clear message.
|
|
288
|
+
if (!isLoopbackHostname(host) && 0 === this.#allowedOrigins.size) {
|
|
289
|
+
throw new Error(`${ReticleEnv.ALLOWED_ORIGINS} must list the app origin(s) when the Reticle bridge binds ` +
|
|
290
|
+
'beyond localhost — otherwise every non-loopback browser is rejected at the WebSocket ' +
|
|
291
|
+
'origin check and no connection can be established.');
|
|
292
|
+
}
|
|
293
|
+
// Explicit option wins; then the env override, so a genuinely busy app can raise the ceiling
|
|
294
|
+
// instead of accepting sampled coverage. Free and local — the daemon runs on the same machine,
|
|
295
|
+
// so a higher cap costs nobody anything, which is also why this is not a paid knob.
|
|
296
|
+
this.#maxMessagesPerSecond =
|
|
297
|
+
options.maxMessagesPerSecond ??
|
|
298
|
+
positiveIntFromEnv(process.env[ReticleEnv.MAX_MESSAGES_PER_SECOND]) ??
|
|
299
|
+
TRANSPORT_LIMITS.MAX_MESSAGES_PER_SECOND;
|
|
300
|
+
this.#maxSessions = options.maxSessions ?? TRANSPORT_LIMITS.MAX_SESSIONS;
|
|
301
|
+
this.#maxPendingConnections =
|
|
302
|
+
options.maxPendingConnections ?? TRANSPORT_LIMITS.MAX_PENDING_CONNECTIONS;
|
|
303
|
+
this.#helloTimeoutMs = options.helloTimeoutMs ?? TRANSPORT_LIMITS.HELLO_TIMEOUT_MS;
|
|
304
|
+
this.#sdkFix = options.sdkFix ?? (() => sdkFix(SERVER_VERSION));
|
|
305
|
+
if (options.server !== undefined) {
|
|
306
|
+
const srv = options.server;
|
|
307
|
+
this.#wss = new WebSocketServer({
|
|
308
|
+
server: srv,
|
|
309
|
+
path: RETICLE_WS_PATH,
|
|
310
|
+
maxPayload: TRANSPORT_LIMITS.MAX_MESSAGE_BYTES,
|
|
311
|
+
verifyClient: ({ origin }, done) => {
|
|
312
|
+
const allowed = this.#originAllowed(origin);
|
|
313
|
+
if (!allowed)
|
|
314
|
+
this.#noteOriginRejected(origin);
|
|
315
|
+
done(allowed, 403, 'Forbidden');
|
|
316
|
+
},
|
|
317
|
+
});
|
|
318
|
+
// In shared-server mode the daemon owns listen; but a WebSocketServer bound to a server that
|
|
319
|
+
// fails to listen (EADDRINUSE) surfaces the error on the WS instance too. Without a listener
|
|
320
|
+
// that is an unhandled 'error' that can crash/hang the process — so absorb it here and reject
|
|
321
|
+
// `ready`, mirroring the standalone branch. The daemon's own listen handler reports the failure.
|
|
322
|
+
this.ready = new Promise((resolve, reject) => {
|
|
323
|
+
this.#wss.once('error', reject);
|
|
324
|
+
if (srv.listening) {
|
|
325
|
+
this.#wss.removeListener('error', reject);
|
|
326
|
+
resolve(srv.address().port);
|
|
327
|
+
}
|
|
328
|
+
else {
|
|
329
|
+
srv.once('listening', () => {
|
|
330
|
+
this.#wss.removeListener('error', reject);
|
|
331
|
+
resolve(srv.address().port);
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
else {
|
|
337
|
+
this.#wss = new WebSocketServer({
|
|
338
|
+
port: options.port,
|
|
339
|
+
host,
|
|
340
|
+
path: RETICLE_WS_PATH,
|
|
341
|
+
maxPayload: TRANSPORT_LIMITS.MAX_MESSAGE_BYTES,
|
|
342
|
+
verifyClient: ({ origin }, done) => {
|
|
343
|
+
const allowed = this.#originAllowed(origin);
|
|
344
|
+
if (!allowed)
|
|
345
|
+
this.#noteOriginRejected(origin);
|
|
346
|
+
done(allowed, 403, 'Forbidden');
|
|
347
|
+
},
|
|
348
|
+
});
|
|
349
|
+
// Reject on 'error' as well as resolve on 'listening'. A port collision (EADDRINUSE) emits
|
|
350
|
+
// 'error'; with no listener that becomes an unhandled 'error' (process crash) AND leaves
|
|
351
|
+
// `ready` pending forever. Surfacing it lets the CLI print "port already in use" cleanly.
|
|
352
|
+
this.ready = new Promise((resolve, reject) => {
|
|
353
|
+
this.#wss.once('error', reject);
|
|
354
|
+
this.#wss.on('listening', () => {
|
|
355
|
+
this.#wss.removeListener('error', reject);
|
|
356
|
+
resolve(this.#wss.address().port);
|
|
357
|
+
});
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
// A PERMANENT 'error' listener, on top of the one `ready` installs and then removes.
|
|
361
|
+
//
|
|
362
|
+
// `ws` re-emits every 'error' from the server it is attached to, and both `ready` branches above
|
|
363
|
+
// drop their listener the moment the port is bound. From then on the emitter is bare, and an
|
|
364
|
+
// EventEmitter that emits 'error' with no listener THROWS — which in the daemon is an
|
|
365
|
+
// uncaughtException, which is an exit, which takes every agent and every session on this port
|
|
366
|
+
// with it. Logging one is all it takes; the transport itself needs no other reaction.
|
|
367
|
+
this.#wss.on('error', (err) => {
|
|
368
|
+
log('bridge_ws_error', { error: err.message });
|
|
369
|
+
});
|
|
370
|
+
this.#wss.on('connection', (socket) => {
|
|
371
|
+
this.#onConnection(socket);
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
#onConnection(socket) {
|
|
375
|
+
if (this.#pendingConnections >= this.#maxPendingConnections) {
|
|
376
|
+
// On the channel the no-session diagnosis reads, not only into the log. This refusal happens
|
|
377
|
+
// before any HELLO, so without it the dial leaves no trace at all — the same hole the origin
|
|
378
|
+
// gate had, and the same fix.
|
|
379
|
+
this.sessions.noteClosure(WS_CLOSE_REASON.HANDSHAKE_POOL_FULL, this.#clock());
|
|
380
|
+
log('bridge_handshake_pool_full', { pending: this.#pendingConnections });
|
|
381
|
+
socket.close(...WS_CLOSE.TOO_MANY_HANDSHAKES);
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
this.#pendingConnections += 1;
|
|
385
|
+
let awaitingHello = true;
|
|
386
|
+
let session;
|
|
387
|
+
let messageWindowStartedAt = this.#clock();
|
|
388
|
+
let messagesInWindow = 0;
|
|
389
|
+
let highValueInWindow = 0;
|
|
390
|
+
const highValueReserve = Math.ceil(this.#maxMessagesPerSecond * RATE_CAP_HIGH_VALUE_RESERVE_RATIO);
|
|
391
|
+
const releasePending = () => {
|
|
392
|
+
if (!awaitingHello)
|
|
393
|
+
return;
|
|
394
|
+
awaitingHello = false;
|
|
395
|
+
this.#pendingConnections -= 1;
|
|
396
|
+
};
|
|
397
|
+
const helloTimer = setTimeout(() => {
|
|
398
|
+
if (!awaitingHello)
|
|
399
|
+
return;
|
|
400
|
+
releasePending();
|
|
401
|
+
socket.close(...WS_CLOSE.HELLO_TIMEOUT);
|
|
402
|
+
}, this.#helloTimeoutMs);
|
|
403
|
+
let droppedByRate = 0;
|
|
404
|
+
/*
|
|
405
|
+
* Everything below runs inside a guard, because a throw here used to leave the socket OPEN and
|
|
406
|
+
* unresponsive. Every other refusal in this file is careful to say WHY it closed, precisely so a
|
|
407
|
+
* failure is not mistaken for an app nobody started — and an unhandled exception silently
|
|
408
|
+
* produced that exact indistinguishable state. Measured: one undefined import turned into a test
|
|
409
|
+
* that timed out waiting for a close, with no error surfacing anywhere.
|
|
410
|
+
*/
|
|
411
|
+
socket.on('message', (raw) => {
|
|
412
|
+
try {
|
|
413
|
+
const now = this.#clock();
|
|
414
|
+
if (now - messageWindowStartedAt >= 1000) {
|
|
415
|
+
messageWindowStartedAt = now;
|
|
416
|
+
messagesInWindow = 0;
|
|
417
|
+
highValueInWindow = 0;
|
|
418
|
+
}
|
|
419
|
+
messagesInWindow += 1;
|
|
420
|
+
const overRate = messagesInWindow > this.#maxMessagesPerSecond;
|
|
421
|
+
const text = rawToString(raw);
|
|
422
|
+
const parsed = this.#parse(text);
|
|
423
|
+
if (null === parsed) {
|
|
424
|
+
const got = helloProtocolMismatch(text);
|
|
425
|
+
if (got !== null) {
|
|
426
|
+
log('protocol_version_mismatch', { got, expected: RETICLE_PROTOCOL_VERSION });
|
|
427
|
+
/*
|
|
428
|
+
* Name the component that is actually stale.
|
|
429
|
+
*
|
|
430
|
+
* This used to send one fixed "upgrade @reticlehq/browser" whichever way the versions
|
|
431
|
+
* disagreed, and the skew seen in practice runs the other way — a current SDK in the app
|
|
432
|
+
* dialling a daemon npx served from cache. Advice naming the wrong component is worse than
|
|
433
|
+
* none: the user upgrades what was already current, sees no change, and blames the tool.
|
|
434
|
+
*/
|
|
435
|
+
const reason = protocolSkewReason(got, RETICLE_PROTOCOL_VERSION);
|
|
436
|
+
// Told to the AGENT too, not only to the SDK that is about to stop retrying. Without this
|
|
437
|
+
// the next tool call answers "no browser session connected", which reads as "no app is
|
|
438
|
+
// running" — so an SDK too old to connect is invisible.
|
|
439
|
+
this.sessions.noteClosure(reason, this.#clock());
|
|
440
|
+
socket.close(WS_CLOSE.PROTOCOL_MISMATCH[0], reason);
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
socket.close(...WS_CLOSE.INVALID_MESSAGE);
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
// Over the cap we SAMPLE — we never disconnect. Going blind is the one thing an observability
|
|
447
|
+
// layer must not do when it sees too much, and the close was a policy code the SDK correctly
|
|
448
|
+
// never retries: the app kept running and Reticle was blind from that instant, on exactly the
|
|
449
|
+
// busiest apps. Measured: each request emits two messages (pending + settled), so the cap binds
|
|
450
|
+
// at ~500 requests/second — a dashboard burst reaches it, a streaming app lives above it.
|
|
451
|
+
//
|
|
452
|
+
// Only EVENTS are dropped. A dropped hello would strand the session and a dropped
|
|
453
|
+
// command_result would hang the agent's in-flight call, so control traffic is always processed
|
|
454
|
+
// however fast it arrives — the cap exists to bound observation, not to break the protocol.
|
|
455
|
+
// Over the cap we drop by VALUE, not by arrival order. Volume is inversely correlated with
|
|
456
|
+
// value — a render-commit storm is thousands/second while the network call an assertion turns
|
|
457
|
+
// on is one — so first-come-first-dropped spends the budget on churn and loses the signal.
|
|
458
|
+
// High-value kinds get a bounded reserve on top of the cap; see event-priority.ts.
|
|
459
|
+
if (overRate && parsed.kind === MessageKind.EVENT) {
|
|
460
|
+
const withinReserve = isHighValueEvent(parsed.event.type) && highValueInWindow < highValueReserve;
|
|
461
|
+
if (withinReserve) {
|
|
462
|
+
highValueInWindow += 1;
|
|
463
|
+
}
|
|
464
|
+
else {
|
|
465
|
+
droppedByRate += 1;
|
|
466
|
+
if (session !== undefined)
|
|
467
|
+
session.noteRateLimited(droppedByRate);
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
if (parsed.kind === MessageKind.HELLO) {
|
|
472
|
+
if (session !== undefined) {
|
|
473
|
+
// A repeat hello on the SAME socket for the SAME session is an identity refresh, not a
|
|
474
|
+
// violation: the SDK re-announces when the app registers capabilities, which happens after
|
|
475
|
+
// connect by design. Closing the socket on it made `hasCapabilities` permanently false for
|
|
476
|
+
// every app that declared anything. A hello bearing a DIFFERENT session id is still a
|
|
477
|
+
// protocol violation — that is the case this guard exists for.
|
|
478
|
+
if (parsed.sessionId !== session.id) {
|
|
479
|
+
socket.close(...WS_CLOSE.HELLO_DUPLICATE);
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
refreshIdentity(session, parsed);
|
|
483
|
+
return;
|
|
484
|
+
}
|
|
485
|
+
if (this.#token !== undefined && !tokensMatch(this.#token, parsed.token)) {
|
|
486
|
+
// A daemon left running by ANOTHER project answers this app and rejects it on token. The
|
|
487
|
+
// token is not wrong, it is somebody else's — and "authentication failed" sends the user to
|
|
488
|
+
// check the one thing that is fine. See auth-failure-reason.
|
|
489
|
+
const reason = authFailureReason(this.#servedProjects, parsed.projectId, parsed.token);
|
|
490
|
+
// The token SOURCE, never the token. A refusal here has no other witness: the value is
|
|
491
|
+
// machine-level on both sides, so the daemon's cwd cannot explain a mismatch (#685) and
|
|
492
|
+
// the only thing that can is the environment the two processes were started in — which
|
|
493
|
+
// differs exactly when an IDE spawns the MCP server globally instead of from the shell
|
|
494
|
+
// that launched the dev server.
|
|
495
|
+
log('authentication_failed', {
|
|
496
|
+
served: [...this.#servedProjects],
|
|
497
|
+
...(parsed.projectId === undefined ? {} : { helloProject: parsed.projectId }),
|
|
498
|
+
presented: parsed.token !== undefined && 0 < parsed.token.length,
|
|
499
|
+
tokenSource: this.#tokenSource,
|
|
500
|
+
});
|
|
501
|
+
this.sessions.noteClosure(reason, this.#clock());
|
|
502
|
+
socket.close(WS_CLOSE.AUTH_FAILED[0], reason);
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
const existing = this.sessions.get(parsed.sessionId);
|
|
506
|
+
if (existing === undefined && this.sessions.count() >= this.#maxSessions) {
|
|
507
|
+
socket.close(...WS_CLOSE.SESSION_LIMIT);
|
|
508
|
+
return;
|
|
509
|
+
}
|
|
510
|
+
clearTimeout(helloTimer);
|
|
511
|
+
releasePending();
|
|
512
|
+
session = new Session(parsed, socket, this.#clock);
|
|
513
|
+
// Recorded on ACCEPTANCE, so it is evidence of what this daemon really serves.
|
|
514
|
+
if (parsed.projectId !== undefined)
|
|
515
|
+
this.#servedProjects.add(parsed.projectId);
|
|
516
|
+
// Attach the durable journal (and anything else registered) before any events stream in.
|
|
517
|
+
// One throwing handler must not stop the others, or the order of registration would decide
|
|
518
|
+
// which features survive a bad frame.
|
|
519
|
+
for (const handler of this.#onSessionCreate) {
|
|
520
|
+
try {
|
|
521
|
+
handler(session);
|
|
522
|
+
}
|
|
523
|
+
catch {
|
|
524
|
+
/* a handler that failed is not a reason to drop the session */
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
// A tab that has just connected has no impact record yet, so the report would read "nothing
|
|
528
|
+
// recorded" over a file with a month of history in it. Push what is already on disk as soon
|
|
529
|
+
// as there is somewhere to push it to; a session is also a thing that HAPPENED, so it counts.
|
|
530
|
+
// A reconnecting tab keeps its id, so counting every connect made a page reload look like
|
|
531
|
+
// a fresh session - the number climbed while nothing new happened.
|
|
532
|
+
if (!this.#countedSessions.has(session.id)) {
|
|
533
|
+
this.#countedSessions.add(session.id);
|
|
534
|
+
// Against this session's OWN project. Counted here rather than at the chokepoint because
|
|
535
|
+
// a connect is not a tool call, and a session that connects and is never driven is still
|
|
536
|
+
// that project's session — not the daemon's.
|
|
537
|
+
recordImpact({ sessions: 1 }, {}, session.artifactRoot);
|
|
538
|
+
}
|
|
539
|
+
// ...and the tab is shown its own project's numbers. Captured into a const so the closure
|
|
540
|
+
// cannot be read as capturing a reassignable binding that TS believes may be undefined.
|
|
541
|
+
const attached = session;
|
|
542
|
+
attached.pushImpact(() => impactSnapshot(attached.artifactRoot), true);
|
|
543
|
+
const replaced = this.sessions.add(session);
|
|
544
|
+
// Said out loud once the session is actually in the registry, never before: a hook that
|
|
545
|
+
// fires on a session a consumer cannot then look up describes a moment that did not happen.
|
|
546
|
+
emitSessionHook(HookEvent.SESSION_STARTED, {
|
|
547
|
+
id: attached.id,
|
|
548
|
+
url: attached.url,
|
|
549
|
+
runtime: attached.runtime,
|
|
550
|
+
});
|
|
551
|
+
if (replaced !== undefined) {
|
|
552
|
+
// Name the newcomer. "session replaced by a newer connection" says a replacement
|
|
553
|
+
// happened but not BY WHAT, so the cause has to be inferred. A session is only ever
|
|
554
|
+
// replaced by one carrying the SAME id, and knowing which URL claimed it is the
|
|
555
|
+
// difference between a diagnosis and a guess.
|
|
556
|
+
log('session_replaced', {
|
|
557
|
+
sessionId: session.id,
|
|
558
|
+
byUrl: session.url,
|
|
559
|
+
previousUrl: replaced.url,
|
|
560
|
+
});
|
|
561
|
+
// Hand the displaced session its replacement BEFORE ending it, so a tool call still holding
|
|
562
|
+
// the old handle can finish against the live connection instead of returning an error whose
|
|
563
|
+
// only answer is to go and rediscover an id that has not changed. See Session.succeededBy.
|
|
564
|
+
replaced.succeededBy(session);
|
|
565
|
+
replaced.disconnect(sessionReplacedReason(session.id, session.url), true);
|
|
566
|
+
}
|
|
567
|
+
// The daemon is the single judge of skew, and HELLO is where the page announces itself.
|
|
568
|
+
// Reported on the session (reticle_sessions) AND queued for the next tool result, because an
|
|
569
|
+
// agent driving a flow never calls reticle_sessions and would never learn.
|
|
570
|
+
const skew = describeSkew({
|
|
571
|
+
what: 'the page',
|
|
572
|
+
version: parsed.sdkVersion,
|
|
573
|
+
contract: parsed.contract,
|
|
574
|
+
// What the page SPEAKS, when it is new enough to say. Forwarded so `describeSkew` can
|
|
575
|
+
// compare names instead of hashes — the branch that was written for this and had no
|
|
576
|
+
// producer until the SDK started sending it.
|
|
577
|
+
...(parsed.contractParts === undefined
|
|
578
|
+
? {}
|
|
579
|
+
: { contractParts: parsed.contractParts }),
|
|
580
|
+
fix: this.#sdkFix(),
|
|
581
|
+
}, {
|
|
582
|
+
version: SERVER_VERSION,
|
|
583
|
+
contract: CONTRACT_FINGERPRINT,
|
|
584
|
+
contractParts: CONTRACT_PARTS,
|
|
585
|
+
});
|
|
586
|
+
// Kept so a remedy can check whether it applies to THIS page — see body-capture-remedy.
|
|
587
|
+
session.sdkVersion = parsed.sdkVersion;
|
|
588
|
+
session.captureBodies = parsed.captureBodies;
|
|
589
|
+
// What this page says it is watching. Read at assert time to refuse a claim that needs
|
|
590
|
+
// a channel nobody declared, rather than answering it with an empty result that reads
|
|
591
|
+
// exactly like the value not being there.
|
|
592
|
+
session.channels = parsed.channels;
|
|
593
|
+
// What it will answer, read at dispatch time so a command the page does not serve is
|
|
594
|
+
// refused instead of waited out.
|
|
595
|
+
//
|
|
596
|
+
// `parsed.platform` is deliberately NOT kept. It is a protocol field and it is correct
|
|
597
|
+
// on the wire, but this daemon already learns the runtime from the health event and has
|
|
598
|
+
// no decision that needs the answer sooner. Storing it would be a handshake fact nobody
|
|
599
|
+
// reads, which is the shape this codebase has now produced twice in one week -- see
|
|
600
|
+
// handshake-facts-are-read.test.ts, which exists because of it.
|
|
601
|
+
session.commands = parsed.commands;
|
|
602
|
+
if (skew !== undefined) {
|
|
603
|
+
log('version_skew', {
|
|
604
|
+
sessionId: session.id,
|
|
605
|
+
sdk: parsed.sdkVersion,
|
|
606
|
+
daemon: SERVER_VERSION,
|
|
607
|
+
});
|
|
608
|
+
session.versionSkew = skew;
|
|
609
|
+
noteVersionSkew(SkewPair.SDK, skew);
|
|
610
|
+
}
|
|
611
|
+
log('session_connected', { sessionId: session.id, url: session.url });
|
|
612
|
+
// The one fact that separates a broken install from an unused one. Best-effort and wrapped:
|
|
613
|
+
// a metric must never affect whether an app can connect. See SessionSummary.appConnects.
|
|
614
|
+
try {
|
|
615
|
+
getSessionMetrics().recordAppConnected();
|
|
616
|
+
}
|
|
617
|
+
catch {
|
|
618
|
+
/* never let a counter interfere with an app connecting */
|
|
619
|
+
}
|
|
620
|
+
// Each handler is independent, so one throwing must not cost the others their turn.
|
|
621
|
+
for (const onReady of this.#onSessionReady) {
|
|
622
|
+
try {
|
|
623
|
+
onReady(session);
|
|
624
|
+
}
|
|
625
|
+
catch {
|
|
626
|
+
/* a session-ready observer must never break the session it observes */
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
return;
|
|
630
|
+
}
|
|
631
|
+
if (session === undefined)
|
|
632
|
+
return;
|
|
633
|
+
session.touch();
|
|
634
|
+
if (parsed.kind === MessageKind.EVENT) {
|
|
635
|
+
// A panel ▶ replay needs the daemon's flow store, which the Session can't reach — route it to
|
|
636
|
+
// the daemon-wired handler instead of the in-session control path. Everything else is normal.
|
|
637
|
+
const replay = replayRequest(parsed.event);
|
|
638
|
+
// Narrowed before the chain, not inside it: the result is needed by the branch AND by the
|
|
639
|
+
// test that decides whether this is a panel control at all, and calling it twice would
|
|
640
|
+
// invite the two calls to disagree.
|
|
641
|
+
const harness = harnessRequest(parsed.event);
|
|
642
|
+
if (replay !== undefined)
|
|
643
|
+
this.#onReplay?.(session.id, replay);
|
|
644
|
+
// Same shape as ▶ replay, and routed the same way: what to push lives in the daemon's
|
|
645
|
+
// cloud wiring, which a Session cannot reach. Nothing is awaited — the panel is telling
|
|
646
|
+
// us to hurry, not asking for a result.
|
|
647
|
+
else if (isSyncRequest(parsed.event))
|
|
648
|
+
this.#onSyncRequest?.();
|
|
649
|
+
// The switch is written through to the platform by the daemon, for the same reason: the
|
|
650
|
+
// Session has no cloud credential and should not grow one.
|
|
651
|
+
else if (harness !== undefined)
|
|
652
|
+
this.#onHarnessRequest?.(harness);
|
|
653
|
+
// Pass the raw frame's byte length so the buffer doesn't re-serialize every event for accounting.
|
|
654
|
+
else
|
|
655
|
+
session.pushEvent(parsed.event, Buffer.byteLength(text, 'utf8'));
|
|
656
|
+
}
|
|
657
|
+
else if (parsed.kind === MessageKind.COMMAND_RESULT) {
|
|
658
|
+
session.handleResult(parsed);
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
catch (err) {
|
|
662
|
+
log('message_handler_failed', { error: err instanceof Error ? err.message : String(err) });
|
|
663
|
+
// Never let the close path throw too — that would restore the hang this guard removes.
|
|
664
|
+
try {
|
|
665
|
+
socket.close(...WS_CLOSE.HANDLER_FAILED);
|
|
666
|
+
}
|
|
667
|
+
catch {
|
|
668
|
+
socket.terminate();
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
});
|
|
672
|
+
socket.on('close', () => {
|
|
673
|
+
clearTimeout(helloTimer);
|
|
674
|
+
releasePending();
|
|
675
|
+
if (session !== undefined) {
|
|
676
|
+
const ended = session;
|
|
677
|
+
if (this.sessions.remove(ended)) {
|
|
678
|
+
log('session_disconnected', { sessionId: ended.id });
|
|
679
|
+
// Best-effort teardown: flush the journal tail + persist ambient learning. Never awaited here
|
|
680
|
+
// (the socket is already closing) and never allowed to reject into the close handler.
|
|
681
|
+
void this.#onSessionEnd?.(ended).catch(() => undefined);
|
|
682
|
+
// AFTER teardown is started, and deliberately not awaited on it. The payload says a
|
|
683
|
+
// session ended, which is already true here; making it wait for the journal flush would
|
|
684
|
+
// put a hook in the path of a socket close for no gain to the consumer.
|
|
685
|
+
emitSessionHook(HookEvent.SESSION_ENDED, {
|
|
686
|
+
id: ended.id,
|
|
687
|
+
url: ended.url,
|
|
688
|
+
runtime: ended.runtime,
|
|
689
|
+
});
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
});
|
|
693
|
+
socket.on('error', (err) => {
|
|
694
|
+
log('socket_error', { error: err.message });
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
/**
|
|
698
|
+
* Record a refused dial where something OTHER than the daemon log can read it.
|
|
699
|
+
*
|
|
700
|
+
* The log line stays — it is the forensic record — but a line in `~/.reticle/daemon-<port>.log` is
|
|
701
|
+
* invisible to the agent that is, at that exact moment, being told "no browser session connected"
|
|
702
|
+
* with no reason attached. `noteClosure` is the channel the no-session diagnosis already reads, so
|
|
703
|
+
* the refusal now travels the same route as an auth failure and a protocol mismatch, and the loop
|
|
704
|
+
* (the reason is only in the page console; the console needs a session; the refusal prevents one)
|
|
705
|
+
* is broken from the daemon side.
|
|
706
|
+
*/
|
|
707
|
+
#noteOriginRejected(origin) {
|
|
708
|
+
log('origin_rejected', { origin: origin ?? 'missing' });
|
|
709
|
+
this.sessions.noteClosure(originRejectedReason(origin), this.#clock());
|
|
710
|
+
}
|
|
711
|
+
#originAllowed(origin) {
|
|
712
|
+
// A real browser SDK connection always carries an Origin. A missing Origin means a non-browser
|
|
713
|
+
// local process (another app, a malicious npm postinstall, an extension's native host) — untrusted
|
|
714
|
+
// unless a pairing token is required, in which case the HELLO token check is the real gate.
|
|
715
|
+
if (origin === undefined)
|
|
716
|
+
return this.#token !== undefined;
|
|
717
|
+
const normalized = normalizeOrigin(origin);
|
|
718
|
+
if (null === normalized)
|
|
719
|
+
return false;
|
|
720
|
+
if (this.#allowedOrigins.has(normalized))
|
|
721
|
+
return true;
|
|
722
|
+
// A desktop webview (Electron, Tauri) or a file:// document sends an opaque Origin: no host to
|
|
723
|
+
// check, so it is exactly as attributable as a missing Origin — defer to the token, as above.
|
|
724
|
+
// Without this branch `new URL` throws INSIDE the WS upgrade handler, crashing the process.
|
|
725
|
+
if (isOpaqueOrigin(normalized))
|
|
726
|
+
return this.#token !== undefined;
|
|
727
|
+
// `isLocalPage`, not `isLoopbackHostname` — the SAME rule the SDK applies on the page side.
|
|
728
|
+
//
|
|
729
|
+
// They had drifted, and the drift made a whole platform unreachable. Tauri v2 uses an opaque
|
|
730
|
+
// `tauri://localhost` on macOS/Linux, but on WINDOWS the webview needs a real http origin and
|
|
731
|
+
// Tauri serves `http://tauri.localhost`. `isLocalPage` was taught that hostname; this check was
|
|
732
|
+
// not. So a Windows Tauri app passed its own gate, dialed the bridge, and every handshake came
|
|
733
|
+
// back 403 — Reticle could not connect to a Tauri app on Windows at all, which is precisely the
|
|
734
|
+
// platform the release notes admitted had never been executed.
|
|
735
|
+
//
|
|
736
|
+
// No weaker than before: `.localhost` is reserved for loopback by RFC 6761, so the name cannot
|
|
737
|
+
// resolve to a remote host, and this is the argument core already made when it accepted the same
|
|
738
|
+
// hostname for the page.
|
|
739
|
+
const url = new URL(normalized);
|
|
740
|
+
return isLocalPage(url.protocol, url.hostname);
|
|
741
|
+
}
|
|
742
|
+
#parse(text) {
|
|
743
|
+
let json;
|
|
744
|
+
try {
|
|
745
|
+
json = JSON.parse(text);
|
|
746
|
+
}
|
|
747
|
+
catch {
|
|
748
|
+
return null;
|
|
749
|
+
}
|
|
750
|
+
const result = ReticleMessageSchema.safeParse(json);
|
|
751
|
+
if (!result.success) {
|
|
752
|
+
log('bad_message', { issues: result.error.issues.length });
|
|
753
|
+
return null;
|
|
754
|
+
}
|
|
755
|
+
return result.data;
|
|
756
|
+
}
|
|
757
|
+
/** Register the daemon's handler for a panel ▶ replay (it owns the flow store). */
|
|
758
|
+
attachReplay(handler) {
|
|
759
|
+
this.#onReplay = handler;
|
|
760
|
+
}
|
|
761
|
+
/**
|
|
762
|
+
* Register a callback fired when a browser session connects.
|
|
763
|
+
*
|
|
764
|
+
* ADDITIVE: every registered handler runs. Assigning to one slot meant the last caller silently
|
|
765
|
+
* won and every earlier one stopped firing — see the field declaration.
|
|
766
|
+
*/
|
|
767
|
+
attachSessionReady(handler) {
|
|
768
|
+
this.#onSessionReady.push(handler);
|
|
769
|
+
}
|
|
770
|
+
/** Register a callback fired the instant a session is created — used to attach the durable journal. */
|
|
771
|
+
/**
|
|
772
|
+
* Teardown handler fired when a session is removed (tab closed/disconnected). Without it the journal's
|
|
773
|
+
* batched tail (< one flush batch) never reaches disk and the learned ambient map is discarded.
|
|
774
|
+
*/
|
|
775
|
+
attachSessionEnd(handler) {
|
|
776
|
+
this.#onSessionEnd = handler;
|
|
777
|
+
}
|
|
778
|
+
/**
|
|
779
|
+
* Register what to do when the panel's sync button is pressed.
|
|
780
|
+
*
|
|
781
|
+
* Optional, like every other panel-routed handler here: a bridge built without one simply ignores
|
|
782
|
+
* the request rather than refusing it, which is the right behaviour for a button whose whole job
|
|
783
|
+
* is to make something happen sooner than it already would.
|
|
784
|
+
*/
|
|
785
|
+
attachSyncRequest(handler) {
|
|
786
|
+
this.#onSyncRequest = handler;
|
|
787
|
+
}
|
|
788
|
+
/**
|
|
789
|
+
* Register a handler for the panel's harness switch. Optional for the same reason as the above: a
|
|
790
|
+
* bridge built without one ignores the request rather than refusing it.
|
|
791
|
+
*/
|
|
792
|
+
attachHarnessRequest(handler) {
|
|
793
|
+
this.#onHarnessRequest = handler;
|
|
794
|
+
}
|
|
795
|
+
/** Register a handler to run when a session connects. Additive — every handler runs. */
|
|
796
|
+
attachSessionCreate(handler) {
|
|
797
|
+
this.#onSessionCreate.push(handler);
|
|
798
|
+
}
|
|
799
|
+
close() {
|
|
800
|
+
return new Promise((resolve) => {
|
|
801
|
+
for (const client of this.#wss.clients)
|
|
802
|
+
client.terminate();
|
|
803
|
+
this.#wss.close(() => {
|
|
804
|
+
resolve();
|
|
805
|
+
});
|
|
806
|
+
});
|
|
807
|
+
}
|
|
808
|
+
}
|