@reticlehq/server 2.13.0 → 2.14.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 +8 -18
- package/bin/reticle.js +3 -0
- package/dist/bridge/auth-failure-reason.js +12 -1
- package/dist/bridge/bridge-security.d.ts +8 -0
- package/dist/bridge/bridge-security.js +6 -1
- package/dist/bridge/bridge.d.ts +3 -0
- package/dist/bridge/bridge.js +23 -1
- package/dist/bridge/bridge.test-harness.d.ts +10 -1
- package/dist/bridge/bridge.test-harness.js +7 -1
- package/dist/bridge/pairing-token.d.ts +17 -0
- package/dist/bridge/pairing-token.js +26 -0
- package/dist/bridge/token-auth.d.ts +7 -0
- package/dist/bridge/token-auth.js +7 -1
- package/dist/capsule/capsule-store.d.ts +4 -4
- package/dist/capsule/capsule.d.ts +1 -1
- package/dist/capsule/capsule.js +3 -3
- package/dist/capsule/causal-summary.d.ts +21 -1
- package/dist/capsule/causal-summary.js +8 -6
- package/dist/capsule/divergence.d.ts +1 -1
- package/dist/capsule/divergence.js +26 -10
- package/dist/chromium-launch-options.d.ts +2 -1
- package/dist/cli/adhoc-verdict.d.ts +58 -0
- package/dist/cli/adhoc-verdict.js +115 -0
- package/dist/cli/chromium-hint.d.ts +18 -4
- package/dist/cli/chromium-hint.js +54 -6
- package/dist/cli/cli-doctor.js +1 -2
- package/dist/cli/cli-flow-commands.d.ts +16 -2
- package/dist/cli/cli-flow-commands.js +28 -9
- package/dist/cli/cli-parse-feedback.js +1 -1
- package/dist/cli/cli-parse.d.ts +2 -1
- package/dist/cli/cli-parse.js +38 -0
- package/dist/cli/cli-port.d.ts +5 -13
- package/dist/cli/cli-port.js +5 -38
- package/dist/cli/cli-update-commands.js +4 -4
- package/dist/cli/cli-verify.d.ts +24 -7
- package/dist/cli/cli-verify.js +87 -13
- package/dist/cli/cloud-keystore.d.ts +2 -1
- package/dist/cli/cloud-login.d.ts +2 -1
- package/dist/cli/cloud-session.d.ts +2 -1
- package/dist/cli/cloud-session.js +1 -1
- package/dist/cli/daemon-start-options.d.ts +2 -1
- package/dist/cli/device-flow.d.ts +2 -2
- package/dist/cli/doctor-daemon-line.d.ts +2 -1
- package/dist/cli/doctor-project-line.d.ts +2 -1
- package/dist/cli/doctor-rows.d.ts +2 -1
- package/dist/cli/drive-attach.d.ts +4 -3
- package/dist/cli/gate-hook-message.d.ts +2 -1
- package/dist/cli/status-next-action.js +10 -11
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +21 -9
- package/dist/cloud/account-state.d.ts +20 -0
- package/dist/cloud/account-state.js +65 -0
- package/dist/cloud/cloud-sync.d.ts +46 -3
- package/dist/cloud/cloud-sync.js +116 -0
- package/dist/cloud/sync-cycle.d.ts +5 -4
- package/dist/cloud/sync-cycle.js +1 -1
- package/dist/cloud/sync-daemon.d.ts +3 -19
- package/dist/cloud/sync-daemon.js +2 -2
- package/dist/crawl/crawl-tools.js +1 -1
- package/dist/crawl/crawl.d.ts +5 -5
- package/dist/crawl/crawl.js +138 -4
- package/dist/daemon/daemon-resilience.d.ts +3 -2
- package/dist/daemon/daemon-resilience.js +43 -4
- package/dist/daemon/daemon-resolve.d.ts +0 -9
- package/dist/daemon/daemon-resolve.js +2 -2
- package/dist/daemon/dev-servers.d.ts +1 -1
- package/dist/daemon/dev-servers.js +1 -1
- package/dist/daemon/loopback-alias.d.ts +2 -1
- package/dist/daemon/startup-failure.d.ts +11 -0
- package/dist/daemon/startup-failure.js +46 -0
- package/dist/events/contradictions.d.ts +10 -16
- package/dist/events/contradictions.js +149 -17
- package/dist/events/declared.d.ts +13 -1
- package/dist/events/declared.js +59 -3
- package/dist/events/echo-mismatch.js +75 -6
- package/dist/events/lineage.d.ts +52 -0
- package/dist/events/lineage.js +122 -0
- package/dist/events/net-evidence.d.ts +21 -0
- package/dist/events/net-evidence.js +81 -0
- package/dist/events/predicate-console.d.ts +13 -0
- package/dist/events/predicate-console.js +138 -0
- package/dist/events/predicate-element.d.ts +13 -0
- package/dist/events/predicate-element.js +214 -0
- package/dist/events/predicate-eval.d.ts +15 -3
- package/dist/events/predicate-eval.js +128 -110
- package/dist/events/predicate-parse.js +34 -1
- package/dist/events/predicate-request-body.d.ts +50 -0
- package/dist/events/predicate-request-body.js +120 -0
- package/dist/events/predicate-route.d.ts +21 -1
- package/dist/events/predicate-route.js +149 -21
- package/dist/events/predicate-schema.d.ts +8 -1
- package/dist/events/predicate-schema.js +34 -0
- package/dist/events/predicate.d.ts +2 -0
- package/dist/events/predicate.js +52 -159
- package/dist/events/split-text-miss.d.ts +6 -4
- package/dist/events/split-text-miss.js +12 -5
- package/dist/flows/affected-tools.js +22 -9
- package/dist/flows/annotate.d.ts +2 -1
- package/dist/flows/annotate.js +19 -1
- package/dist/flows/coverage.d.ts +2 -2
- package/dist/flows/flake.d.ts +3 -3
- package/dist/flows/flow-expect-grammar.d.ts +33 -0
- package/dist/flows/flow-expect-grammar.js +155 -0
- package/dist/flows/flow-replay-run.d.ts +1 -1
- package/dist/flows/flow-replay-run.js +28 -15
- package/dist/flows/flow-replay.d.ts +10 -0
- package/dist/flows/flow-replay.js +57 -22
- package/dist/flows/flow-secret-field.d.ts +14 -0
- package/dist/flows/flow-secret-field.js +22 -0
- package/dist/flows/flow-step-runners.d.ts +1 -0
- package/dist/flows/flow-step-runners.js +91 -34
- package/dist/flows/flow-success.js +22 -0
- package/dist/flows/flow-tools.js +27 -8
- package/dist/flows/flow-upload-resolve.d.ts +23 -0
- package/dist/flows/flow-upload-resolve.js +46 -0
- package/dist/flows/flows.d.ts +15 -0
- package/dist/flows/flows.js +17 -14
- package/dist/flows/git-changed.d.ts +23 -4
- package/dist/flows/git-changed.js +32 -6
- package/dist/flows/heal-run.js +2 -2
- package/dist/flows/predicate-to-expect.d.ts +3 -2
- package/dist/flows/predicate-to-expect.js +11 -5
- package/dist/flows/recording-backtrack.d.ts +24 -0
- package/dist/flows/recording-backtrack.js +73 -0
- package/dist/flows/recordings.d.ts +6 -0
- package/dist/flows/replay-halt.d.ts +26 -0
- package/dist/flows/replay-halt.js +30 -0
- package/dist/flows/replay.d.ts +0 -8
- package/dist/flows/replay.js +15 -3
- package/dist/flows/suite-flakes.d.ts +2 -1
- package/dist/flows/verify-change-tools.js +16 -4
- package/dist/honesty/already-true.d.ts +14 -0
- package/dist/honesty/already-true.js +47 -4
- package/dist/honesty/blind-spots.d.ts +3 -1
- package/dist/honesty/blind-spots.js +24 -1
- package/dist/honesty/body-capture-remedy.d.ts +42 -0
- package/dist/honesty/body-capture-remedy.js +95 -0
- package/dist/honesty/feature-capture.d.ts +3 -2
- package/dist/honesty/feature-capture.js +1 -1
- package/dist/honesty/gap-ledger.d.ts +1 -1
- package/dist/honesty/gap-ledger.js +1 -1
- package/dist/honesty/instrumentation-gaps.d.ts +8 -1
- package/dist/honesty/instrumentation-gaps.js +12 -2
- package/dist/honesty/observability.d.ts +4 -3
- package/dist/honesty/tool-hit-rate.d.ts +3 -2
- package/dist/honesty/uncaptured-bodies.d.ts +3 -1
- package/dist/honesty/uncaptured-bodies.js +6 -2
- package/dist/honesty/unsettled.d.ts +9 -0
- package/dist/honesty/unsettled.js +45 -0
- package/dist/honesty/verified.d.ts +32 -1
- package/dist/honesty/verified.js +37 -10
- package/dist/impact/impact-store.d.ts +5 -14
- package/dist/impact/impact-store.js +49 -6
- package/dist/index.js +1 -1
- package/dist/input/network-detail.d.ts +26 -1
- package/dist/input/network-detail.js +44 -12
- package/dist/input/network-mock-tools.js +24 -17
- package/dist/input/real-input.js +1 -1
- package/dist/input/viewport-tools.js +25 -13
- package/dist/intent/inline-intent.d.ts +0 -10
- package/dist/intent/inline-intent.js +1 -1
- package/dist/intent/intent-shard-store.d.ts +3 -2
- package/dist/intent/intent-shard-store.js +1 -1
- package/dist/intent/intent-shard.d.ts +14 -14
- package/dist/intent/intent-shard.js +4 -4
- package/dist/intent/intent-store.d.ts +1 -1
- package/dist/intent/intent-store.js +1 -1
- package/dist/intent/intent-subject.d.ts +2 -1
- package/dist/intent/open-intents.d.ts +3 -2
- package/dist/license/license.d.ts +4 -4
- package/dist/license/license.js +1 -1
- package/dist/mcp/attach-memory.d.ts +2 -1
- package/dist/mcp/client-identity.d.ts +2 -1
- package/dist/mcp/mcp-outage.d.ts +1 -1
- package/dist/mcp/mcp-outage.js +1 -1
- package/dist/mcp/mcp-proxy.d.ts +3 -1
- package/dist/mcp/mcp-proxy.js +32 -7
- package/dist/mcp/mcp.js +3 -1
- package/dist/mcp/proxy-handshake.d.ts +2 -1
- package/dist/mcp/proxy-idle-exit.d.ts +45 -0
- package/dist/mcp/proxy-idle-exit.js +94 -0
- package/dist/mcp/server-instructions.d.ts +2 -1
- package/dist/memory/project-memory.d.ts +2 -3
- package/dist/memory/project-memory.js +1 -1
- package/dist/oracles/propose-consequences.js +5 -5
- package/dist/oracles/self-instrument.d.ts +2 -2
- package/dist/oracles/self-instrument.js +1 -1
- package/dist/platform.d.ts +3 -5
- package/dist/platform.js +3 -5
- package/dist/pool/browser-pool.d.ts +92 -0
- package/dist/pool/browser-pool.js +119 -5
- package/dist/pool/playwright-launcher.js +29 -2
- package/dist/pool/storage-seed.d.ts +23 -0
- package/dist/pool/storage-seed.js +198 -0
- package/dist/project/artifact-root.d.ts +2 -1
- package/dist/project/memory-fs.d.ts +2 -1
- package/dist/project/reticle-dir.js +1 -1
- package/dist/project/session-root.d.ts +8 -0
- package/dist/project/session-root.js +9 -2
- package/dist/runs/reticle-runner.d.ts +14 -1
- package/dist/runs/reticle-runner.js +39 -2
- package/dist/session/attachment-history.d.ts +2 -1
- package/dist/session/fake-session.d.ts +37 -0
- package/dist/session/fake-session.js +81 -0
- package/dist/session/lease-visibility.d.ts +2 -1
- package/dist/session/live-control-tools.js +6 -0
- package/dist/session/no-session-diagnosis.d.ts +17 -1
- package/dist/session/no-session-diagnosis.js +32 -6
- package/dist/session/no-session-next-action.d.ts +14 -0
- package/dist/session/no-session-next-action.js +18 -0
- package/dist/session/no-session-watch.js +46 -3
- package/dist/session/registered-projects.d.ts +54 -0
- package/dist/session/registered-projects.js +73 -0
- package/dist/session/review-store.d.ts +2 -1
- package/dist/session/session-health.d.ts +62 -1
- package/dist/session/session-health.js +82 -2
- package/dist/session/session-manager.d.ts +11 -1
- package/dist/session/session-manager.js +18 -3
- package/dist/session/session-replaced.d.ts +24 -0
- package/dist/session/session-replaced.js +29 -0
- package/dist/session/session-successor.js +20 -4
- package/dist/session/session.d.ts +13 -5
- package/dist/session/session.js +31 -23
- package/dist/setup/agent-configs.d.ts +3 -2
- package/dist/setup/agent-writer.d.ts +3 -2
- package/dist/setup/approval-migration.d.ts +2 -1
- package/dist/setup/approval-migration.js +1 -1
- package/dist/setup/auto-approve.d.ts +11 -19
- package/dist/setup/auto-approve.js +15 -12
- package/dist/{init → setup}/confirm.js +1 -1
- package/dist/setup/desktop-shape.d.ts +3 -2
- package/dist/setup/dev-server-wait.d.ts +8 -0
- package/dist/setup/dev-server-wait.js +3 -1
- package/dist/setup/drive-agent.d.ts +2 -3
- package/dist/setup/drive-agent.js +1 -1
- package/dist/setup/drive-plan.d.ts +3 -2
- package/dist/setup/ensure-daemon.d.ts +2 -1
- package/dist/setup/existing-app.d.ts +12 -0
- package/dist/setup/existing-app.js +13 -0
- package/dist/setup/init-host.d.ts +11 -0
- package/dist/setup/init-host.js +26 -0
- package/dist/setup/init-runtime.d.ts +4 -10
- package/dist/setup/init-runtime.js +23 -16
- package/dist/setup/license-key.d.ts +2 -1
- package/dist/setup/listeners.d.ts +2 -1
- package/dist/setup/loopback-probe-urls.d.ts +18 -0
- package/dist/setup/loopback-probe-urls.js +52 -0
- package/dist/setup/node-effects.d.ts +3 -0
- package/dist/setup/node-effects.js +26 -11
- package/dist/setup/page-probe.d.ts +5 -0
- package/dist/setup/relaunch.d.ts +2 -1
- package/dist/setup/run-setup.d.ts +5 -1
- package/dist/setup/run-setup.js +155 -48
- package/dist/setup/setup-command.d.ts +3 -2
- package/dist/setup/setup-command.js +8 -0
- package/dist/setup/setup-options.d.ts +5 -3
- package/dist/setup/setup-options.js +3 -2
- package/dist/setup/wait-progress.d.ts +28 -0
- package/dist/setup/wait-progress.js +43 -0
- package/dist/telemetry/app-instrumented.d.ts +2 -1
- package/dist/telemetry/app-instrumented.js +1 -1
- package/dist/telemetry/automation-hint.d.ts +1 -1
- package/dist/telemetry/automation-hint.js +1 -1
- package/dist/telemetry/cli-telemetry.js +1 -1
- package/dist/telemetry/connect-failure.d.ts +1 -1
- package/dist/telemetry/connect-failure.js +1 -1
- package/dist/telemetry/crash-cause.d.ts +3 -2
- package/dist/telemetry/crash-cause.js +1 -1
- package/dist/telemetry/daemon-telemetry.d.ts +3 -2
- package/dist/telemetry/daemon-telemetry.js +1 -1
- package/dist/telemetry/error-class.d.ts +3 -2
- package/dist/telemetry/error-class.js +1 -1
- package/dist/telemetry/feedback-cli.js +1 -1
- package/dist/telemetry/feedback-context.d.ts +3 -2
- package/dist/telemetry/feedback-context.js +5 -4
- package/dist/telemetry/feedback-local.d.ts +3 -2
- package/dist/telemetry/feedback.d.ts +4 -3
- package/dist/telemetry/feedback.js +1 -1
- package/dist/telemetry/git-facts.d.ts +2 -2
- package/dist/telemetry/git-facts.js +1 -1
- package/dist/telemetry/identify.d.ts +1 -1
- package/dist/telemetry/identify.js +1 -1
- package/dist/telemetry/init-telemetry.d.ts +2 -14
- package/dist/telemetry/init-telemetry.js +4 -13
- package/dist/telemetry/install-source.d.ts +7 -13
- package/dist/telemetry/install-source.js +7 -29
- package/dist/telemetry/license-activation.d.ts +3 -2
- package/dist/telemetry/license-activation.js +1 -1
- package/dist/telemetry/machine-snapshot.d.ts +1 -1
- package/dist/telemetry/mcp-connection.js +1 -1
- package/dist/telemetry/project-profile.d.ts +0 -14
- package/dist/telemetry/project-profile.js +1 -1
- package/dist/telemetry/proxy-telemetry.js +1 -1
- package/dist/telemetry/session-metrics.d.ts +1 -1
- package/dist/telemetry/session-metrics.js +1 -1
- package/dist/telemetry/telemetry.d.ts +1 -17
- package/dist/telemetry/telemetry.js +4 -4
- package/dist/telemetry/tool-refused.d.ts +1 -1
- package/dist/telemetry/tool-refused.js +1 -1
- package/dist/tools/act-observation.d.ts +3 -2
- package/dist/tools/act-preflight.js +8 -3
- package/dist/tools/act-target.d.ts +4 -0
- package/dist/tools/act-target.js +14 -5
- package/dist/tools/act-tools.d.ts +0 -2
- package/dist/tools/act-tools.js +45 -15
- package/dist/tools/assert-source.d.ts +30 -0
- package/dist/tools/assert-source.js +21 -0
- package/dist/tools/assert-verdict.d.ts +1 -1
- package/dist/tools/assert-verdict.js +14 -4
- package/dist/tools/browser-tools.js +28 -8
- package/dist/tools/complete-snapshot.d.ts +3 -2
- package/dist/tools/dynamic-tools.js +8 -0
- package/dist/tools/error-recovery.d.ts +10 -0
- package/dist/tools/error-recovery.js +23 -0
- package/dist/tools/feedback-tools.js +1 -1
- package/dist/tools/invoke-tool.js +2 -0
- package/dist/tools/lease-tools.d.ts +48 -20
- package/dist/tools/lease-tools.js +311 -76
- package/dist/tools/lineage-tools.d.ts +14 -0
- package/dist/tools/lineage-tools.js +64 -0
- package/dist/tools/merge-tools.js +1 -3
- package/dist/tools/navigate-arrival.d.ts +45 -1
- package/dist/tools/navigate-arrival.js +39 -6
- package/dist/tools/navigate-result.d.ts +8 -1
- package/dist/tools/navigate-result.js +14 -4
- package/dist/tools/numeric-bounds.d.ts +0 -11
- package/dist/tools/numeric-bounds.js +4 -4
- package/dist/tools/observe-tools.js +22 -26
- package/dist/tools/observed-nothing.d.ts +9 -0
- package/dist/tools/observed-nothing.js +2 -1
- package/dist/tools/read-tools.js +12 -17
- package/dist/tools/real-input-attempt.d.ts +14 -6
- package/dist/tools/real-input-attempt.js +75 -18
- package/dist/tools/reconcile-tools.js +2 -1
- package/dist/tools/reload-result.d.ts +6 -1
- package/dist/tools/reload-result.js +7 -2
- package/dist/tools/resolve-target.d.ts +7 -1
- package/dist/tools/resolve-target.js +72 -9
- package/dist/tools/settle-in-flight.d.ts +1 -1
- package/dist/tools/settle-in-flight.js +9 -2
- package/dist/tools/snapshot-delta.d.ts +24 -1
- package/dist/tools/snapshot-delta.js +66 -7
- package/dist/tools/tool-names.d.ts +1 -0
- package/dist/tools/tool-names.js +1 -0
- package/dist/tools/tool-surface.js +20 -2
- package/dist/tools/tools.js +120 -11
- package/dist/tools/verify-next-baton.d.ts +2 -1
- package/dist/update/sdk-sync.d.ts +1 -1
- package/dist/update/sdk-sync.js +1 -1
- package/dist/update/updater.js +1 -1
- package/dist/version/sdk-fix.d.ts +2 -1
- package/dist/version/version-skew.d.ts +0 -8
- package/dist/version/version-skew.js +1 -1
- package/docs/README.md +8 -6
- package/docs/actions.mdx +1 -1
- package/docs/agent-cheatsheet.md +4 -2
- package/docs/architecture.md +1 -1
- package/docs/cli/mcp.mdx +3 -1
- package/docs/cli/watch.mdx +1 -1
- package/docs/cli.mdx +1 -1
- package/docs/desktop.mdx +1 -1
- package/docs/docs.json +8 -3
- package/docs/faq.mdx +9 -0
- package/docs/first-drive.md +136 -0
- package/docs/frameworks.mdx +29 -7
- package/docs/gate-plan.md +2 -2
- package/docs/gates.md +19 -11
- package/docs/getting-started.md +7 -1
- package/docs/http-transport.md +164 -0
- package/docs/index.mdx +5 -3
- package/docs/install-manual.mdx +1 -1
- package/docs/packages/tauri.mdx +1 -1
- package/docs/packages.mdx +15 -3
- package/docs/platform-integration.md +1 -1
- package/docs/predicates.mdx +2 -0
- package/docs/system-map.md +2 -2
- package/docs/telemetry-contract.md +4 -4
- package/docs/telemetry-events.mdx +1 -1
- package/docs/telemetry.md +3 -3
- package/docs/tools-navigate.mdx +14 -6
- package/docs/usage.md +4 -4
- package/package.json +7 -4
- package/dist/init/agent-rules.d.ts +0 -116
- package/dist/init/agent-rules.js +0 -279
- package/dist/init/app-choice.d.ts +0 -20
- package/dist/init/app-choice.js +0 -25
- package/dist/init/astro-host.d.ts +0 -21
- package/dist/init/astro-host.js +0 -27
- package/dist/init/astro-patch.d.ts +0 -33
- package/dist/init/astro-patch.js +0 -300
- package/dist/init/capabilities.d.ts +0 -40
- package/dist/init/capabilities.js +0 -150
- package/dist/init/closing-hint.d.ts +0 -36
- package/dist/init/closing-hint.js +0 -120
- package/dist/init/connect-steps.d.ts +0 -2
- package/dist/init/connect-steps.js +0 -50
- package/dist/init/cra.d.ts +0 -79
- package/dist/init/cra.js +0 -178
- package/dist/init/csp-check.d.ts +0 -38
- package/dist/init/csp-check.js +0 -107
- package/dist/init/csp-doctor.d.ts +0 -32
- package/dist/init/csp-doctor.js +0 -54
- package/dist/init/desktop-doctor.d.ts +0 -41
- package/dist/init/desktop-doctor.js +0 -198
- package/dist/init/detect.d.ts +0 -96
- package/dist/init/detect.js +0 -209
- package/dist/init/dev-script.d.ts +0 -50
- package/dist/init/dev-script.js +0 -66
- package/dist/init/format-generated.d.ts +0 -18
- package/dist/init/format-generated.js +0 -39
- package/dist/init/install-hint.d.ts +0 -9
- package/dist/init/install-hint.js +0 -29
- package/dist/init/mcp-clients.d.ts +0 -89
- package/dist/init/mcp-clients.js +0 -299
- package/dist/init/mcp-registered.d.ts +0 -12
- package/dist/init/mcp-registered.js +0 -14
- package/dist/init/mcp.d.ts +0 -89
- package/dist/init/mcp.js +0 -129
- package/dist/init/next-patch.d.ts +0 -39
- package/dist/init/next-patch.js +0 -196
- package/dist/init/node-io.d.ts +0 -7
- package/dist/init/node-io.js +0 -117
- package/dist/init/non-js-project.d.ts +0 -27
- package/dist/init/non-js-project.js +0 -84
- package/dist/init/patch-kind.d.ts +0 -20
- package/dist/init/patch-kind.js +0 -10
- package/dist/init/plan-framework.d.ts +0 -64
- package/dist/init/plan-framework.js +0 -565
- package/dist/init/plan.d.ts +0 -242
- package/dist/init/plan.js +0 -703
- package/dist/init/preflight.d.ts +0 -28
- package/dist/init/preflight.js +0 -38
- package/dist/init/project-id.d.ts +0 -12
- package/dist/init/project-id.js +0 -25
- package/dist/init/refresh-rules.d.ts +0 -39
- package/dist/init/refresh-rules.js +0 -51
- package/dist/init/run.d.ts +0 -117
- package/dist/init/run.js +0 -806
- package/dist/init/slash-command.d.ts +0 -27
- package/dist/init/slash-command.js +0 -132
- package/dist/init/snippets.d.ts +0 -134
- package/dist/init/snippets.js +0 -572
- package/dist/init/vite-config.d.ts +0 -18
- package/dist/init/vite-config.js +0 -114
- package/dist/init/windows-quote.d.ts +0 -38
- package/dist/init/windows-quote.js +0 -70
- package/dist/init/workspace-apps.d.ts +0 -30
- package/dist/init/workspace-apps.js +0 -178
- package/dist/project/remember-project.d.ts +0 -24
- package/dist/project/remember-project.js +0 -40
- /package/dist/{init → setup}/confirm.d.ts +0 -0
package/dist/mcp/mcp-proxy.js
CHANGED
|
@@ -32,6 +32,7 @@ import { proxyLog } from './proxy-log.js';
|
|
|
32
32
|
import { OutageReason, OutageStage, reportMcpOutage } from './mcp-outage.js';
|
|
33
33
|
import { postToSession } from './mcp-post-transport.js';
|
|
34
34
|
import { reconnectDelayMs } from './proxy-backoff.js';
|
|
35
|
+
import { PROXY_IDLE_EXIT_EVENT, ProxyIdleExit, resolveProxyIdleExitMs } from './proxy-idle-exit.js';
|
|
35
36
|
export { reconnectDelayMs, RECONNECT_BASE_MS, RECONNECT_CAP_MS } from './proxy-backoff.js';
|
|
36
37
|
export { MCP_PROXY_HTTP_AGENT_OPTIONS, postToSession, shouldRetryUnsentPost, } from './mcp-post-transport.js';
|
|
37
38
|
/**
|
|
@@ -301,7 +302,9 @@ export function startMcpProxy(port,
|
|
|
301
302
|
* budget ran out and then killed itself, taking the agent's whole Reticle surface with it — the
|
|
302
303
|
* failure mode for a daemon that crashed, was stopped, or shut itself down as idle.
|
|
303
304
|
*/
|
|
304
|
-
ensureDaemon
|
|
305
|
+
ensureDaemon,
|
|
306
|
+
/** Observe the real shutdown boundary in transport tests without terminating their worker. */
|
|
307
|
+
exitProcess = (code) => process.exit(code)) {
|
|
305
308
|
return new Promise((_resolve, reject) => {
|
|
306
309
|
// A client just started us, which is the only honest evidence that Reticle is registered with
|
|
307
310
|
// one at all: a config entry proves somebody wrote JSON, not that a client ever read it. Paired
|
|
@@ -313,6 +316,7 @@ ensureDaemon) {
|
|
|
313
316
|
// a runtime throw, not a type error.
|
|
314
317
|
const catalog = new ToolCatalogCache();
|
|
315
318
|
let postUrl = null;
|
|
319
|
+
let stopped = false;
|
|
316
320
|
/**
|
|
317
321
|
* No daemon is listening and the proxy has stopped chasing one.
|
|
318
322
|
*
|
|
@@ -383,12 +387,33 @@ ensureDaemon) {
|
|
|
383
387
|
};
|
|
384
388
|
const replay = new HandshakeReplay();
|
|
385
389
|
const pending = new PendingRequests();
|
|
390
|
+
const quit = (code) => {
|
|
391
|
+
if (stopped)
|
|
392
|
+
return;
|
|
393
|
+
stopped = true;
|
|
394
|
+
idleExit.stop();
|
|
395
|
+
// Await: fire-and-forget here is how daemon_stopped never arrived.
|
|
396
|
+
void flushProxySessionMetrics().finally(() => exitProcess(code));
|
|
397
|
+
};
|
|
398
|
+
const idleExit = new ProxyIdleExit({
|
|
399
|
+
graceMs: resolveProxyIdleExitMs(process.env[ReticleEnv.MCP_PROXY_IDLE]),
|
|
400
|
+
isBusy: () => pending.unanswered.length > 0 || stdinQueue.length > 0,
|
|
401
|
+
onExit: (idleMs) => {
|
|
402
|
+
proxyLog(PROXY_IDLE_EXIT_EVENT, {
|
|
403
|
+
port,
|
|
404
|
+
idleMs,
|
|
405
|
+
note: 'the client link was quiet for the configured idle window with no work in flight; exiting the abandoned proxy',
|
|
406
|
+
});
|
|
407
|
+
quit(0);
|
|
408
|
+
},
|
|
409
|
+
});
|
|
410
|
+
idleExit.start();
|
|
386
411
|
/** The ONE way a line reaches the client — so nothing can be answered without clearing the debt. */
|
|
387
412
|
const emit = (line) => {
|
|
413
|
+
idleExit.noteTraffic();
|
|
388
414
|
pending.observeInbound(line);
|
|
389
415
|
process.stdout.write(`${line}\n`);
|
|
390
416
|
};
|
|
391
|
-
let stopped = false;
|
|
392
417
|
let attempts = 0;
|
|
393
418
|
/** The daemon announced a planned shutdown; the next drop is that, not a fault. */
|
|
394
419
|
let daemonRetiring = false;
|
|
@@ -736,6 +761,9 @@ ensureDaemon) {
|
|
|
736
761
|
let stdinBuffer = '';
|
|
737
762
|
let stdinDiscarding = false;
|
|
738
763
|
process.stdin.on('data', (chunk) => {
|
|
764
|
+
if (stopped)
|
|
765
|
+
return;
|
|
766
|
+
idleExit.noteTraffic();
|
|
739
767
|
// Not `(buffer + chunk).split()` inline — that rescans everything held on every chunk, so one
|
|
740
768
|
// large line cost O(n²) in its own size and pinned the event loop for tens of seconds, during
|
|
741
769
|
// which every other tool call on this link hung with no response and no error. See drainLines.
|
|
@@ -819,11 +847,8 @@ ensureDaemon) {
|
|
|
819
847
|
// between the writes made it "work", which is the signature of a teardown race, not of a client
|
|
820
848
|
// that asked for too much. Drain first, and let the exit status carry the truth if it fails.
|
|
821
849
|
process.stdin.on('end', () => {
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
// Await: fire-and-forget here is how daemon_stopped never arrived.
|
|
825
|
-
void flushProxySessionMetrics().finally(() => process.exit(code));
|
|
826
|
-
};
|
|
850
|
+
if (stopped)
|
|
851
|
+
return;
|
|
827
852
|
if (0 === pending.unanswered.length) {
|
|
828
853
|
quit(0);
|
|
829
854
|
return;
|
package/dist/mcp/mcp.js
CHANGED
|
@@ -122,7 +122,9 @@ const PREDICATE_KINDS = 'Predicate object: { kind, ...fields }. kind is one of e
|
|
|
122
122
|
*/
|
|
123
123
|
const PREDICATE_FIELD_GRAMMAR_HINT = ' Bug-catching options: net.count (exact request count — catches double-submit), ' +
|
|
124
124
|
'net.bodyContains (a substring of what the SERVER answered — catches a UI that echoes the input ' +
|
|
125
|
-
'it sent instead of the result it got back),
|
|
125
|
+
'it sent instead of the result it got back), net.requestBodyMatches (a shallow JSON match on what ' +
|
|
126
|
+
'the UI SENT — the verdict for "applying this filter actually puts it in the payload"), ' +
|
|
127
|
+
'console.absent:true (action completed with a CLEAN ' +
|
|
126
128
|
'console), absent:true on element/text (it should be gone). Call reticle_tools for the full field ' +
|
|
127
129
|
'grammar of a kind.';
|
|
128
130
|
const COMPACT_PREDICATE_DESCRIPTION = `${PREDICATE_KINDS}${PREDICATE_FIELD_GRAMMAR_HINT}`;
|
|
@@ -75,7 +75,7 @@ export declare function degradedInstructions(healthy: string, port: number, reas
|
|
|
75
75
|
* out-of-memory exit that would take the agent's whole tool surface with it.
|
|
76
76
|
*/
|
|
77
77
|
export declare const MAX_STDIN_LINE_BYTES: number;
|
|
78
|
-
|
|
78
|
+
interface DrainedLines {
|
|
79
79
|
/** Complete lines, in order. Empty when the chunk carried no newline. */
|
|
80
80
|
lines: string[];
|
|
81
81
|
/** The trailing partial line, carried into the next chunk. */
|
|
@@ -105,3 +105,4 @@ export interface DrainedLines {
|
|
|
105
105
|
* the concatenation alone. Only a chunk that actually carries a newline pays for a scan.
|
|
106
106
|
*/
|
|
107
107
|
export declare function drainLines(buffer: string, chunk: string, maxLineBytes?: number, discarding?: boolean): DrainedLines;
|
|
108
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A live proxy is more valuable than a reclaimed one: unlike the daemon, no client automatically
|
|
3
|
+
* respawns the stdio server after it exits. Give a quiet but still-open client a full day before
|
|
4
|
+
* deciding it was abandoned. That is deliberately much longer than the daemon's attached grace,
|
|
5
|
+
* while still bounding the process pairs that were observed surviving for several days.
|
|
6
|
+
*
|
|
7
|
+
* Kept independent of the daemon's configured grace: changing how soon an unused daemon retires
|
|
8
|
+
* must not silently change how soon an editor loses its MCP server.
|
|
9
|
+
*/
|
|
10
|
+
export declare const PROXY_IDLE_EXIT_MS: number;
|
|
11
|
+
/** The local diagnostic emitted before an abandoned proxy exits. */
|
|
12
|
+
export declare const PROXY_IDLE_EXIT_EVENT = "reticle_mcp_proxy_idle_exit";
|
|
13
|
+
export interface ProxyIdleExitOptions {
|
|
14
|
+
/** Called once after the client link has stayed quiet for the whole grace. */
|
|
15
|
+
onExit: (idleMs: number) => void;
|
|
16
|
+
/** True while a request or queued message still needs an answer. */
|
|
17
|
+
isBusy?: () => boolean;
|
|
18
|
+
/** Continuous quiet window before exit. A non-positive value disables the watcher. */
|
|
19
|
+
graceMs?: number;
|
|
20
|
+
/** How often to re-check the link. */
|
|
21
|
+
checkIntervalMs?: number;
|
|
22
|
+
/** Injected clock for deterministic tests. */
|
|
23
|
+
clock?: () => number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Reaps an abandoned MCP stdio proxy without mistaking a thinking pause or an in-flight call for an
|
|
27
|
+
* abandoned client. Client traffic restarts the grace, and active work starts a fresh grace only
|
|
28
|
+
* after it has settled. The interval is unref'd so this watcher can never keep the process alive by
|
|
29
|
+
* itself.
|
|
30
|
+
*/
|
|
31
|
+
export declare class ProxyIdleExit {
|
|
32
|
+
#private;
|
|
33
|
+
constructor(opts: ProxyIdleExitOptions);
|
|
34
|
+
/** Record bytes moving across the client-facing stdio link. */
|
|
35
|
+
noteTraffic(): void;
|
|
36
|
+
/** Run one idle check. Exposed so tests can drive the decision with an injected clock. */
|
|
37
|
+
check(): void;
|
|
38
|
+
start(): void;
|
|
39
|
+
stop(): void;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Resolve the proxy-idle environment control: a non-negative quiet window in milliseconds, with
|
|
43
|
+
* zero as the explicit opt-out. Invalid values retain the conservative one-day default.
|
|
44
|
+
*/
|
|
45
|
+
export declare function resolveProxyIdleExitMs(raw: string | undefined): number;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { SESSION_LIFECYCLE } from '@reticlehq/core';
|
|
2
|
+
/**
|
|
3
|
+
* A live proxy is more valuable than a reclaimed one: unlike the daemon, no client automatically
|
|
4
|
+
* respawns the stdio server after it exits. Give a quiet but still-open client a full day before
|
|
5
|
+
* deciding it was abandoned. That is deliberately much longer than the daemon's attached grace,
|
|
6
|
+
* while still bounding the process pairs that were observed surviving for several days.
|
|
7
|
+
*
|
|
8
|
+
* Kept independent of the daemon's configured grace: changing how soon an unused daemon retires
|
|
9
|
+
* must not silently change how soon an editor loses its MCP server.
|
|
10
|
+
*/
|
|
11
|
+
export const PROXY_IDLE_EXIT_MS = 24 * 60 * 60_000;
|
|
12
|
+
/** The local diagnostic emitted before an abandoned proxy exits. */
|
|
13
|
+
export const PROXY_IDLE_EXIT_EVENT = 'reticle_mcp_proxy_idle_exit';
|
|
14
|
+
/**
|
|
15
|
+
* Reaps an abandoned MCP stdio proxy without mistaking a thinking pause or an in-flight call for an
|
|
16
|
+
* abandoned client. Client traffic restarts the grace, and active work starts a fresh grace only
|
|
17
|
+
* after it has settled. The interval is unref'd so this watcher can never keep the process alive by
|
|
18
|
+
* itself.
|
|
19
|
+
*/
|
|
20
|
+
export class ProxyIdleExit {
|
|
21
|
+
#timer;
|
|
22
|
+
#lastTrafficAt;
|
|
23
|
+
#wasBusy = false;
|
|
24
|
+
#fired = false;
|
|
25
|
+
#onExit;
|
|
26
|
+
#isBusy;
|
|
27
|
+
#graceMs;
|
|
28
|
+
#checkIntervalMs;
|
|
29
|
+
#clock;
|
|
30
|
+
constructor(opts) {
|
|
31
|
+
this.#onExit = opts.onExit;
|
|
32
|
+
this.#isBusy = opts.isBusy ?? (() => false);
|
|
33
|
+
this.#graceMs = opts.graceMs ?? PROXY_IDLE_EXIT_MS;
|
|
34
|
+
this.#checkIntervalMs =
|
|
35
|
+
opts.checkIntervalMs ??
|
|
36
|
+
Math.min(SESSION_LIFECYCLE.DAEMON_IDLE_CHECK_MS, Math.max(1, this.#graceMs));
|
|
37
|
+
this.#clock = opts.clock ?? (() => Date.now());
|
|
38
|
+
this.#lastTrafficAt = this.#clock();
|
|
39
|
+
}
|
|
40
|
+
/** Record bytes moving across the client-facing stdio link. */
|
|
41
|
+
noteTraffic() {
|
|
42
|
+
if (this.#fired)
|
|
43
|
+
return;
|
|
44
|
+
this.#lastTrafficAt = this.#clock();
|
|
45
|
+
}
|
|
46
|
+
/** Run one idle check. Exposed so tests can drive the decision with an injected clock. */
|
|
47
|
+
check() {
|
|
48
|
+
if (this.#fired || this.#graceMs <= 0)
|
|
49
|
+
return;
|
|
50
|
+
const now = this.#clock();
|
|
51
|
+
const busy = this.#isBusy();
|
|
52
|
+
if (busy) {
|
|
53
|
+
this.#wasBusy = true;
|
|
54
|
+
this.#lastTrafficAt = now;
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
// A queued message can become settled between checks without producing client-facing traffic.
|
|
58
|
+
// Start a complete grace window at that transition instead of measuring from the last busy poll.
|
|
59
|
+
if (this.#wasBusy) {
|
|
60
|
+
this.#wasBusy = false;
|
|
61
|
+
this.#lastTrafficAt = now;
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const idleMs = now - this.#lastTrafficAt;
|
|
65
|
+
if (idleMs < this.#graceMs)
|
|
66
|
+
return;
|
|
67
|
+
this.#fired = true;
|
|
68
|
+
this.#onExit(idleMs);
|
|
69
|
+
}
|
|
70
|
+
start() {
|
|
71
|
+
if (this.#graceMs <= 0 || this.#timer !== undefined)
|
|
72
|
+
return;
|
|
73
|
+
this.#timer = setInterval(() => this.check(), this.#checkIntervalMs);
|
|
74
|
+
this.#timer.unref();
|
|
75
|
+
}
|
|
76
|
+
stop() {
|
|
77
|
+
if (this.#timer === undefined)
|
|
78
|
+
return;
|
|
79
|
+
clearInterval(this.#timer);
|
|
80
|
+
this.#timer = undefined;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Resolve the proxy-idle environment control: a non-negative quiet window in milliseconds, with
|
|
85
|
+
* zero as the explicit opt-out. Invalid values retain the conservative one-day default.
|
|
86
|
+
*/
|
|
87
|
+
export function resolveProxyIdleExitMs(raw) {
|
|
88
|
+
if (raw === undefined || '' === raw.trim())
|
|
89
|
+
return PROXY_IDLE_EXIT_MS;
|
|
90
|
+
const value = Number(raw);
|
|
91
|
+
if (!Number.isFinite(value) || value < 0)
|
|
92
|
+
return PROXY_IDLE_EXIT_MS;
|
|
93
|
+
return Math.floor(value);
|
|
94
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
interface InstructionState {
|
|
2
2
|
/**
|
|
3
3
|
* Has an app ever connected to Reticle for this project, on this port?
|
|
4
4
|
*
|
|
@@ -15,3 +15,4 @@ export interface InstructionState {
|
|
|
15
15
|
* this block rather than repeated across sixteen parameter descriptions. See shared-params.ts.
|
|
16
16
|
*/
|
|
17
17
|
export declare function buildServerInstructions(state: InstructionState): string;
|
|
18
|
+
export {};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import type { FileSystemPort } from '../project/fs-port.js';
|
|
2
|
-
/** Named so a read from the tool surface is distinguishable from the CLI's and from replay's. */
|
|
3
|
-
export declare const MCP_AGENT_ID = "reticle-mcp";
|
|
4
2
|
/** Why a lookup returned nothing. Each one is a different thing for the agent to do next. */
|
|
5
3
|
export declare const MemoryUnavailable: {
|
|
6
4
|
/** No `.reticle/cloud.json` — this project has never been linked to a workspace. */
|
|
@@ -18,7 +16,7 @@ export interface KnownThing {
|
|
|
18
16
|
sourceFile: string | null;
|
|
19
17
|
subject: string;
|
|
20
18
|
}
|
|
21
|
-
|
|
19
|
+
type ProjectMemoryResult = {
|
|
22
20
|
ok: true;
|
|
23
21
|
subject: string | null;
|
|
24
22
|
known: KnownThing[];
|
|
@@ -32,3 +30,4 @@ export declare function readProjectMemory(fs: FileSystemPort, root: string, home
|
|
|
32
30
|
subject?: string | undefined;
|
|
33
31
|
limit: number;
|
|
34
32
|
}): Promise<ProjectMemoryResult>;
|
|
33
|
+
export {};
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
import { cloudFetch } from '../cloud/cloud-sync.js';
|
|
15
15
|
import { resolveProjectCloud } from '../cloud/cloud-config.js';
|
|
16
16
|
/** Named so a read from the tool surface is distinguishable from the CLI's and from replay's. */
|
|
17
|
-
|
|
17
|
+
const MCP_AGENT_ID = 'reticle-mcp';
|
|
18
18
|
/** Why a lookup returned nothing. Each one is a different thing for the agent to do next. */
|
|
19
19
|
export const MemoryUnavailable = {
|
|
20
20
|
/** No `.reticle/cloud.json` — this project has never been linked to a workspace. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventType, PredicateKind } from '@reticlehq/core';
|
|
2
|
-
import {
|
|
2
|
+
import { routeOfEvent } from '../events/predicate-route.js';
|
|
3
3
|
const TIER = { SIGNAL: 0, CONSEQUENCE: 1, PRESENCE: 2 };
|
|
4
4
|
function pathname(url) {
|
|
5
5
|
if (typeof url !== 'string')
|
|
@@ -67,16 +67,16 @@ export function proposeConsequences(events) {
|
|
|
67
67
|
break;
|
|
68
68
|
}
|
|
69
69
|
case EventType.ROUTE_CHANGE: {
|
|
70
|
-
const
|
|
71
|
-
if (
|
|
70
|
+
const routed = routeOfEvent(data);
|
|
71
|
+
if (routed !== undefined) {
|
|
72
72
|
// `pathname`, not `to`: the evaluator has never accepted `to`, so this surface was handing
|
|
73
73
|
// the agent a predicate reticle_assert refuses with "unknown field to". A proposal that
|
|
74
74
|
// cannot be evaluated is worse than no proposal — see the schema check in the test.
|
|
75
75
|
//
|
|
76
76
|
// And the ROUTER's path, not the document's: under a hash router the document pathname is
|
|
77
77
|
// `/` on every page, so proposing it proposes an assertion that says nothing about where
|
|
78
|
-
// the app went.
|
|
79
|
-
const to =
|
|
78
|
+
// the app went. See routeOfEvent.
|
|
79
|
+
const to = routed.routePath;
|
|
80
80
|
add(`route:${to}`, {
|
|
81
81
|
predicate: { kind: PredicateKind.ROUTE, pathname: to },
|
|
82
82
|
tier: TIER.CONSEQUENCE,
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
* Kinds come from `@reticlehq/core`. A second enum here is how `reticle_domain` used to say
|
|
9
9
|
* `missing-signal` while honesty said `no-signal-on-mutation` for the same absence.
|
|
10
10
|
*/
|
|
11
|
-
import { InstrumentationGapKind } from '@reticlehq/core';
|
|
11
|
+
import { InstrumentationGapKind } from '@reticlehq/core/artifacts';
|
|
12
12
|
/** The three core kinds a located proposal can close. Other kinds are verdict-side, not insert-side. */
|
|
13
|
-
|
|
13
|
+
type LocatableGapKind = typeof InstrumentationGapKind.NO_SIGNAL_ON_MUTATION | typeof InstrumentationGapKind.NO_STORE_REGISTERED | typeof InstrumentationGapKind.MISSING_TESTID;
|
|
14
14
|
export interface LocatedGap {
|
|
15
15
|
kind: LocatableGapKind;
|
|
16
16
|
file: string;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Kinds come from `@reticlehq/core`. A second enum here is how `reticle_domain` used to say
|
|
9
9
|
* `missing-signal` while honesty said `no-signal-on-mutation` for the same absence.
|
|
10
10
|
*/
|
|
11
|
-
import { InstrumentationGapKind } from '@reticlehq/core';
|
|
11
|
+
import { InstrumentationGapKind } from '@reticlehq/core/artifacts';
|
|
12
12
|
/** PascalCase a store name for a `useX.getState` hint (cart → Cart). */
|
|
13
13
|
function pascal(name) {
|
|
14
14
|
return 0 === name.length ? name : name[0]?.toUpperCase() + name.slice(1);
|
package/dist/platform.d.ts
CHANGED
|
@@ -8,9 +8,7 @@
|
|
|
8
8
|
* simply never runs there.
|
|
9
9
|
*
|
|
10
10
|
* Node-side only, so deliberately NOT in `@reticlehq/core` — core is the wire contract, and a
|
|
11
|
-
* platform name never crosses the wire.
|
|
11
|
+
* platform name never crosses the wire. It DEFINES in `@reticlehq/init` because the scaffolder needs
|
|
12
|
+
* it and may not import the daemon; re-exported here so every existing reader is unchanged.
|
|
12
13
|
*/
|
|
13
|
-
export
|
|
14
|
-
readonly WINDOWS: "win32";
|
|
15
|
-
readonly MACOS: "darwin";
|
|
16
|
-
};
|
|
14
|
+
export { NodePlatform } from '@reticlehq/init';
|
package/dist/platform.js
CHANGED
|
@@ -8,9 +8,7 @@
|
|
|
8
8
|
* simply never runs there.
|
|
9
9
|
*
|
|
10
10
|
* Node-side only, so deliberately NOT in `@reticlehq/core` — core is the wire contract, and a
|
|
11
|
-
* platform name never crosses the wire.
|
|
11
|
+
* platform name never crosses the wire. It DEFINES in `@reticlehq/init` because the scaffolder needs
|
|
12
|
+
* it and may not import the daemon; re-exported here so every existing reader is unchanged.
|
|
12
13
|
*/
|
|
13
|
-
export
|
|
14
|
-
WINDOWS: 'win32',
|
|
15
|
-
MACOS: 'darwin',
|
|
16
|
-
};
|
|
14
|
+
export { NodePlatform } from '@reticlehq/init';
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
* The browser is injected via a `Launcher` so all lifecycle logic is testable without real Chromium;
|
|
10
10
|
* the thin Playwright adapter that satisfies these interfaces lives separately.
|
|
11
11
|
*/
|
|
12
|
+
/** The minimal page surface the pool drives. Real Playwright `Page` satisfies this. */
|
|
13
|
+
import { type SeedStorage } from '@reticlehq/core';
|
|
12
14
|
export interface PooledPage {
|
|
13
15
|
goto(url: string, opts?: {
|
|
14
16
|
timeoutMs?: number;
|
|
@@ -37,11 +39,75 @@ export interface PooledPage {
|
|
|
37
39
|
* reports dispatched/settled while the styles never ran.
|
|
38
40
|
*/
|
|
39
41
|
hover?(x: number, y: number): Promise<void>;
|
|
42
|
+
/** Add an init script to run after document creation but before any page scripts run. */
|
|
43
|
+
addInitScript?<Arg>(script: ((arg: Arg) => void) | string, arg?: Arg): Promise<InitScriptHandle | void>;
|
|
44
|
+
/**
|
|
45
|
+
* Install (or clear) network mocks on this page. OPTIONAL: a fake that does not implement it
|
|
46
|
+
* makes `reticle_network_mock` refuse rather than claiming it stubbed a request it cannot intercept.
|
|
47
|
+
*/
|
|
48
|
+
installMocks?(rules: readonly PooledMockRule[]): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Resize this page's viewport. OPTIONAL, like `installMocks`: a fake that does not implement it
|
|
51
|
+
* makes `reticle_viewport` refuse rather than claim a resize the page never took.
|
|
52
|
+
*
|
|
53
|
+
* A lease IS a real browser page, so the resize was always possible — the tool simply had no route
|
|
54
|
+
* to it and consulted only the driven-provider path. On an SDK-only install there is no such
|
|
55
|
+
* provider, so mobile-only UI (a `lg:hidden` hamburger, a drawer that only mounts under a
|
|
56
|
+
* breakpoint) could not be driven at all without installing Playwright separately.
|
|
57
|
+
*/
|
|
58
|
+
setViewport?(size: {
|
|
59
|
+
width: number;
|
|
60
|
+
height: number;
|
|
61
|
+
}): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Fires when the page opens a native `window.confirm`/`alert`/`prompt`. OPTIONAL, like `onConsole`:
|
|
64
|
+
* a fake that does not implement it means the pool cannot see or arbitrate the dialog, and the
|
|
65
|
+
* page is left to whatever the underlying engine does with no listener attached.
|
|
66
|
+
*
|
|
67
|
+
* The pool always dismisses on this handler (see `acquire`) — a page blocked on a native dialog
|
|
68
|
+
* previously wedged the whole session (every subsequent tool call timed out and no recovery
|
|
69
|
+
* existed short of restarting the daemon), because nothing in the stack ever answered it.
|
|
70
|
+
*/
|
|
71
|
+
onDialog?(handler: (dialog: PooledDialog) => void): void;
|
|
72
|
+
}
|
|
73
|
+
/** A native dialog the page opened, handed to the pool so it can be dismissed instead of left blocking. */
|
|
74
|
+
export interface PooledDialog {
|
|
75
|
+
/** The dialog's message text — kept for diagnostics (`BrowserPool#lastDialogMessage`). */
|
|
76
|
+
readonly message: string;
|
|
77
|
+
dismiss(): Promise<void>;
|
|
78
|
+
}
|
|
79
|
+
export interface InitScriptHandle {
|
|
80
|
+
dispose(): Promise<void>;
|
|
81
|
+
}
|
|
82
|
+
export interface PooledCookie {
|
|
83
|
+
name: string;
|
|
84
|
+
value: string;
|
|
85
|
+
url?: string;
|
|
86
|
+
domain?: string;
|
|
87
|
+
path?: string;
|
|
88
|
+
expires?: number;
|
|
89
|
+
httpOnly?: boolean;
|
|
90
|
+
secure?: boolean;
|
|
91
|
+
sameSite?: 'Strict' | 'Lax' | 'None';
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* One interception rule the pool can install. Same fields as the drive-path mock rule, kept here so
|
|
95
|
+
* the pool does not import Playwright.
|
|
96
|
+
*/
|
|
97
|
+
export interface PooledMockRule {
|
|
98
|
+
urlContains: string;
|
|
99
|
+
method?: string;
|
|
100
|
+
status?: number;
|
|
101
|
+
body?: string;
|
|
102
|
+
contentType?: string;
|
|
103
|
+
delayMs?: number;
|
|
104
|
+
abort?: boolean;
|
|
40
105
|
}
|
|
41
106
|
/** An isolated browsing context (cookies/storage). Real Playwright `BrowserContext` satisfies this. */
|
|
42
107
|
export interface PooledContext {
|
|
43
108
|
newPage(): Promise<PooledPage>;
|
|
44
109
|
close(): Promise<void>;
|
|
110
|
+
addCookies?(cookies: PooledCookie[]): Promise<void>;
|
|
45
111
|
}
|
|
46
112
|
/** The launched browser. Real Playwright `Browser` satisfies this. */
|
|
47
113
|
export interface PooledBrowser {
|
|
@@ -57,6 +123,7 @@ export type Launcher = () => Promise<PooledBrowser>;
|
|
|
57
123
|
export interface Lease {
|
|
58
124
|
readonly sessionId: string;
|
|
59
125
|
readonly url: string;
|
|
126
|
+
readonly navStatus?: number;
|
|
60
127
|
release(): Promise<void>;
|
|
61
128
|
}
|
|
62
129
|
/** Default lease time-to-live: a lease untouched for this long is presumed orphaned and reclaimed. */
|
|
@@ -147,6 +214,25 @@ export declare class BrowserPool {
|
|
|
147
214
|
* Touches the lease like any other tool call, so hovering keeps it alive.
|
|
148
215
|
*/
|
|
149
216
|
hoverLease(sessionId: string, x: number, y: number): Promise<boolean>;
|
|
217
|
+
/**
|
|
218
|
+
* Install network mocks on a leased page, or false when this session is not a lease or cannot
|
|
219
|
+
* intercept. Same optional-capability contract as screenshotLease: absence must read as "could not
|
|
220
|
+
* mock", never as a stub that applied to nothing.
|
|
221
|
+
*
|
|
222
|
+
* Touches the lease like any other tool call, so mocking keeps it alive.
|
|
223
|
+
*/
|
|
224
|
+
/**
|
|
225
|
+
* Resize a leased page's viewport, or report that this page cannot be resized.
|
|
226
|
+
*
|
|
227
|
+
* Alias-resolved like every other agent-facing capability — see `#leaseIdOf`.
|
|
228
|
+
*
|
|
229
|
+
* Touches the lease like any other tool call, so resizing keeps it alive.
|
|
230
|
+
*/
|
|
231
|
+
setViewportLease(sessionId: string, size: {
|
|
232
|
+
width: number;
|
|
233
|
+
height: number;
|
|
234
|
+
}): Promise<boolean>;
|
|
235
|
+
setMocksLease(sessionId: string, rules: readonly PooledMockRule[]): Promise<boolean>;
|
|
150
236
|
sweepExpired(): Promise<string[]>;
|
|
151
237
|
/**
|
|
152
238
|
* How many leases this pool has reclaimed for going stale.
|
|
@@ -177,6 +263,7 @@ export declare class BrowserPool {
|
|
|
177
263
|
acquire(url: string, opts?: {
|
|
178
264
|
signal?: AbortSignal;
|
|
179
265
|
sessionId?: string;
|
|
266
|
+
seedStorage?: SeedStorage;
|
|
180
267
|
}): Promise<Lease>;
|
|
181
268
|
/**
|
|
182
269
|
* The websocket address this lease's page reported it could not reach, if it reported one.
|
|
@@ -184,6 +271,11 @@ export declare class BrowserPool {
|
|
|
184
271
|
* Undefined means the page said nothing — never that it dialled the right place.
|
|
185
272
|
*/
|
|
186
273
|
dialFailureUrl(sessionId: string): string | undefined;
|
|
274
|
+
/**
|
|
275
|
+
* The message of the most recent native dialog (`confirm`/`alert`/`prompt`) auto-dismissed on this
|
|
276
|
+
* lease, if any. Diagnostic only — the dialog itself is already gone by the time this is readable.
|
|
277
|
+
*/
|
|
278
|
+
lastDialogMessage(sessionId: string): string | undefined;
|
|
187
279
|
/** Close every context and the browser. Pending waiters are rejected (the pool is terminal now). */
|
|
188
280
|
shutdown(): Promise<void>;
|
|
189
281
|
}
|