@reticlehq/server 2.2.1 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/bridge-security.d.ts +0 -1
- package/dist/bridge-security.js +0 -1
- package/dist/bridge.d.ts +0 -1
- package/dist/bridge.js +60 -10
- package/dist/bridge.test-harness.d.ts +0 -1
- package/dist/bridge.test-harness.js +0 -1
- package/dist/capsule/capsule-store.d.ts +2 -3
- package/dist/capsule/capsule-store.js +0 -1
- package/dist/capsule/capsule.d.ts +0 -1
- package/dist/capsule/capsule.js +0 -1
- package/dist/capsule/causal-summary.d.ts +21 -1
- package/dist/capsule/causal-summary.js +20 -2
- package/dist/capsule/divergence.d.ts +0 -1
- package/dist/capsule/divergence.js +0 -1
- package/dist/capsule/minimize.d.ts +0 -1
- package/dist/capsule/minimize.js +0 -1
- package/dist/capsule/predicate-to-links.d.ts +0 -1
- package/dist/capsule/predicate-to-links.js +0 -1
- package/dist/cli-doctor.d.ts +6 -0
- package/dist/cli-doctor.js +60 -0
- package/dist/cli-flow-commands.d.ts +0 -1
- package/dist/cli-flow-commands.js +0 -1
- package/dist/cli-launch.d.ts +0 -1
- package/dist/cli-launch.js +7 -3
- package/dist/cli-parse.d.ts +34 -2
- package/dist/cli-parse.js +107 -1
- package/dist/cli-port.d.ts +0 -1
- package/dist/cli-port.js +0 -1
- package/dist/cli-verify.d.ts +0 -1
- package/dist/cli-verify.js +1 -2
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +79 -67
- package/dist/cloud/cloud-config.d.ts +0 -1
- package/dist/cloud/cloud-config.js +0 -1
- package/dist/cloud/cloud-sync.d.ts +4 -5
- package/dist/cloud/cloud-sync.js +0 -1
- package/dist/cloud-cli.d.ts +0 -1
- package/dist/cloud-cli.js +9 -2
- package/dist/crawl/crawl-tools.d.ts +0 -1
- package/dist/crawl/crawl-tools.js +1 -2
- package/dist/crawl/crawl.d.ts +17 -3
- package/dist/crawl/crawl.js +43 -4
- package/dist/daemon-resilience.d.ts +6 -1
- package/dist/daemon-resilience.js +63 -1
- package/dist/daemon.d.ts +23 -3
- package/dist/daemon.js +36 -24
- package/dist/domain/domain-model.d.ts +0 -1
- package/dist/domain/domain-model.js +1 -2
- package/dist/domain/domain-tools.d.ts +0 -7
- package/dist/domain/domain-tools.js +21 -4
- package/dist/domain/flow-risk.d.ts +0 -1
- package/dist/domain/flow-risk.js +0 -1
- package/dist/ee/audit-log.d.ts +0 -1
- package/dist/ee/audit-log.js +0 -1
- package/dist/events/body-failures.d.ts +4 -0
- package/dist/events/body-failures.js +113 -0
- package/dist/events/contradictions.d.ts +53 -0
- package/dist/events/contradictions.js +282 -0
- package/dist/events/echo-mismatch.d.ts +4 -0
- package/dist/events/echo-mismatch.js +138 -0
- package/dist/events/event-filters.d.ts +17 -3
- package/dist/events/event-filters.js +13 -3
- package/dist/events/json-salvage.d.ts +32 -0
- package/dist/events/json-salvage.js +96 -0
- package/dist/events/predicate-eval.d.ts +2 -1
- package/dist/events/predicate-eval.js +56 -9
- package/dist/events/predicate.d.ts +0 -1
- package/dist/events/predicate.js +56 -2
- package/dist/events/reaction.d.ts +0 -1
- package/dist/events/reaction.js +0 -1
- package/dist/events/reconcile.d.ts +39 -0
- package/dist/events/reconcile.js +211 -0
- package/dist/events/ring-buffer.d.ts +0 -1
- package/dist/events/ring-buffer.js +0 -1
- package/dist/events/stale-response.d.ts +4 -0
- package/dist/events/stale-response.js +139 -0
- package/dist/events/unit-mismatch.d.ts +16 -0
- package/dist/events/unit-mismatch.js +167 -0
- package/dist/flows/affected-tools.d.ts +18 -0
- package/dist/flows/affected-tools.js +52 -0
- package/dist/flows/affected.d.ts +0 -1
- package/dist/flows/affected.js +0 -1
- package/dist/flows/annotate-tools.d.ts +0 -1
- package/dist/flows/annotate-tools.js +21 -3
- package/dist/flows/annotate.d.ts +0 -1
- package/dist/flows/annotate.js +0 -1
- package/dist/flows/annotation-store.d.ts +0 -1
- package/dist/flows/annotation-store.js +0 -1
- package/dist/flows/assertion-integrity.d.ts +0 -1
- package/dist/flows/assertion-integrity.js +0 -1
- package/dist/flows/assertion-tiers-store.d.ts +0 -1
- package/dist/flows/assertion-tiers-store.js +0 -1
- package/dist/flows/buddy-status.d.ts +0 -1
- package/dist/flows/buddy-status.js +0 -1
- package/dist/flows/coverage.d.ts +0 -1
- package/dist/flows/coverage.js +0 -1
- package/dist/flows/decision.d.ts +0 -1
- package/dist/flows/decision.js +0 -1
- package/dist/flows/flake-store.d.ts +0 -1
- package/dist/flows/flake-store.js +0 -1
- package/dist/flows/flake.d.ts +0 -1
- package/dist/flows/flake.js +0 -1
- package/dist/flows/flow-classify.d.ts +0 -1
- package/dist/flows/flow-classify.js +0 -1
- package/dist/flows/flow-replay-run.d.ts +0 -1
- package/dist/flows/flow-replay-run.js +2 -3
- package/dist/flows/flow-replay.d.ts +20 -4
- package/dist/flows/flow-replay.js +9 -43
- package/dist/flows/flow-report.d.ts +0 -1
- package/dist/flows/flow-report.js +0 -1
- package/dist/flows/flow-scope.d.ts +0 -1
- package/dist/flows/flow-scope.js +0 -1
- package/dist/flows/flow-sources.d.ts +0 -1
- package/dist/flows/flow-sources.js +0 -1
- package/dist/flows/flow-step-runners.d.ts +23 -0
- package/dist/flows/flow-step-runners.js +102 -0
- package/dist/flows/flow-success.d.ts +0 -1
- package/dist/flows/flow-success.js +0 -1
- package/dist/flows/flow-tools.d.ts +0 -1
- package/dist/flows/flow-tools.js +30 -8
- package/dist/flows/flows.d.ts +6 -2
- package/dist/flows/flows.js +15 -2
- package/dist/flows/gate.d.ts +0 -1
- package/dist/flows/gate.js +0 -1
- package/dist/flows/git-changed.d.ts +0 -1
- package/dist/flows/git-changed.js +0 -1
- package/dist/flows/heal-run.d.ts +0 -1
- package/dist/flows/heal-run.js +0 -1
- package/dist/flows/heal.d.ts +0 -1
- package/dist/flows/heal.js +0 -1
- package/dist/flows/parallel-suite.d.ts +0 -1
- package/dist/flows/parallel-suite.js +0 -1
- package/dist/flows/recordings.d.ts +0 -1
- package/dist/flows/recordings.js +0 -1
- package/dist/flows/replay.d.ts +0 -1
- package/dist/flows/replay.js +71 -4
- package/dist/flows/server-verify.d.ts +0 -1
- package/dist/flows/server-verify.js +0 -1
- package/dist/flows/verify-change-tools.d.ts +2 -0
- package/dist/flows/verify-change-tools.js +187 -0
- package/dist/flows/watch-batcher.d.ts +0 -1
- package/dist/flows/watch-batcher.js +0 -1
- package/dist/honesty/accepted-write.d.ts +14 -0
- package/dist/honesty/accepted-write.js +17 -0
- package/dist/honesty/blind-spots.d.ts +18 -1
- package/dist/honesty/blind-spots.js +47 -5
- package/dist/honesty/honesty.d.ts +0 -1
- package/dist/honesty/honesty.js +0 -1
- package/dist/honesty/uncaptured-bodies.d.ts +19 -0
- package/dist/honesty/uncaptured-bodies.js +30 -0
- package/dist/honesty/unread-outcome.d.ts +2 -0
- package/dist/honesty/unread-outcome.js +50 -0
- package/dist/honesty/verified.d.ts +40 -0
- package/dist/honesty/verified.js +86 -0
- package/dist/http-server.d.ts +0 -1
- package/dist/http-server.js +5 -1
- package/dist/hunt/hunt-report.d.ts +50 -0
- package/dist/hunt/hunt-report.js +84 -0
- package/dist/idle-shutdown.d.ts +0 -1
- package/dist/idle-shutdown.js +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/init/agent-rules.d.ts +0 -1
- package/dist/init/agent-rules.js +4 -2
- package/dist/init/cursor.d.ts +0 -1
- package/dist/init/cursor.js +0 -1
- package/dist/init/desktop-doctor.d.ts +40 -0
- package/dist/init/desktop-doctor.js +198 -0
- package/dist/init/detect.d.ts +0 -1
- package/dist/init/detect.js +0 -1
- package/dist/init/mcp.d.ts +0 -1
- package/dist/init/mcp.js +0 -1
- package/dist/init/node-io.d.ts +0 -1
- package/dist/init/node-io.js +0 -1
- package/dist/init/plan.d.ts +4 -1
- package/dist/init/plan.js +23 -5
- package/dist/init/project-id.d.ts +0 -1
- package/dist/init/project-id.js +0 -1
- package/dist/init/run.d.ts +0 -1
- package/dist/init/run.js +31 -3
- package/dist/init/snippets.d.ts +5 -1
- package/dist/init/snippets.js +5 -1
- package/dist/init/vite-config.d.ts +0 -1
- package/dist/init/vite-config.js +0 -1
- package/dist/input/network-detail.d.ts +0 -1
- package/dist/input/network-detail.js +0 -1
- package/dist/input/network-mock-tools.d.ts +0 -1
- package/dist/input/network-mock-tools.js +3 -4
- package/dist/input/network-mock.d.ts +0 -1
- package/dist/input/network-mock.js +0 -1
- package/dist/input/real-input.d.ts +14 -1
- package/dist/input/real-input.js +45 -3
- package/dist/input/scroll-find.d.ts +0 -1
- package/dist/input/scroll-find.js +0 -1
- package/dist/input/scroll-tools.d.ts +0 -1
- package/dist/input/scroll-tools.js +0 -1
- package/dist/input/viewport-tools.d.ts +0 -1
- package/dist/input/viewport-tools.js +3 -4
- package/dist/journal/ambient-store.d.ts +0 -1
- package/dist/journal/ambient-store.js +0 -1
- package/dist/journal/ambient.d.ts +0 -1
- package/dist/journal/ambient.js +0 -1
- package/dist/journal/attach-journal.d.ts +0 -1
- package/dist/journal/attach-journal.js +0 -1
- package/dist/journal/deviation-report.d.ts +0 -1
- package/dist/journal/deviation-report.js +0 -1
- package/dist/journal/deviation-service.d.ts +0 -1
- package/dist/journal/deviation-service.js +0 -1
- package/dist/journal/envelope-store.d.ts +0 -1
- package/dist/journal/envelope-store.js +0 -1
- package/dist/journal/envelope.d.ts +8 -9
- package/dist/journal/envelope.js +0 -1
- package/dist/journal/journal-query.d.ts +0 -1
- package/dist/journal/journal-query.js +0 -1
- package/dist/journal/journal-recorder.d.ts +0 -1
- package/dist/journal/journal-recorder.js +0 -1
- package/dist/journal/retention.d.ts +0 -1
- package/dist/journal/retention.js +0 -1
- package/dist/journal/rollups.d.ts +0 -1
- package/dist/journal/rollups.js +0 -1
- package/dist/journal/session-end.d.ts +0 -1
- package/dist/journal/session-end.js +0 -1
- package/dist/journal/session-journal.d.ts +0 -1
- package/dist/journal/session-journal.js +0 -1
- package/dist/license/license.d.ts +0 -1
- package/dist/license/license.js +0 -1
- package/dist/log.d.ts +0 -1
- package/dist/log.js +0 -1
- package/dist/mcp-proxy.d.ts +0 -1
- package/dist/mcp-proxy.js +0 -1
- package/dist/mcp.d.ts +15 -1
- package/dist/mcp.js +145 -17
- package/dist/oracles/flow-instrument-gaps.d.ts +0 -1
- package/dist/oracles/flow-instrument-gaps.js +0 -1
- package/dist/oracles/propose-consequences.d.ts +0 -1
- package/dist/oracles/propose-consequences.js +0 -1
- package/dist/oracles/self-instrument.d.ts +0 -1
- package/dist/oracles/self-instrument.js +0 -1
- package/dist/pairing-token.d.ts +0 -1
- package/dist/pairing-token.js +0 -1
- package/dist/phenomena/phenomena.d.ts +0 -1
- package/dist/phenomena/phenomena.js +0 -1
- package/dist/pool/browser-pool.d.ts +0 -1
- package/dist/pool/browser-pool.js +0 -1
- package/dist/pool/lease-reaper.d.ts +0 -1
- package/dist/pool/lease-reaper.js +0 -1
- package/dist/pool/playwright-launcher.d.ts +0 -1
- package/dist/pool/playwright-launcher.js +10 -2
- package/dist/project/baselines.d.ts +0 -1
- package/dist/project/baselines.js +0 -1
- package/dist/project/file-lock.d.ts +2 -1
- package/dist/project/file-lock.js +12 -2
- package/dist/project/fs-port.d.ts +0 -1
- package/dist/project/fs-port.js +0 -1
- package/dist/project/project-store.d.ts +0 -1
- package/dist/project/project-store.js +0 -1
- package/dist/project/project-tools.d.ts +0 -1
- package/dist/project/project-tools.js +29 -4
- package/dist/project/reticle-dir.d.ts +0 -1
- package/dist/project/reticle-dir.js +0 -1
- package/dist/runs/build-verification-run.d.ts +0 -1
- package/dist/runs/build-verification-run.js +0 -1
- package/dist/runs/profile-redact.d.ts +0 -1
- package/dist/runs/profile-redact.js +0 -1
- package/dist/runs/render-report.d.ts +0 -1
- package/dist/runs/render-report.js +0 -1
- package/dist/runs/repair-prompt.d.ts +0 -1
- package/dist/runs/repair-prompt.js +0 -1
- package/dist/runs/replay-mapping.d.ts +0 -1
- package/dist/runs/replay-mapping.js +0 -1
- package/dist/runs/reticle-runner.d.ts +0 -1
- package/dist/runs/reticle-runner.js +4 -2
- package/dist/runs/risk-classify.d.ts +0 -1
- package/dist/runs/risk-classify.js +0 -1
- package/dist/runs/run-diff.d.ts +0 -1
- package/dist/runs/run-diff.js +0 -1
- package/dist/runs/run-store.d.ts +0 -1
- package/dist/runs/run-store.js +0 -1
- package/dist/runs/run-tools.d.ts +0 -1
- package/dist/runs/run-tools.js +0 -1
- package/dist/runs/runner-port.d.ts +0 -1
- package/dist/runs/runner-port.js +0 -1
- package/dist/runs/verification-sync.d.ts +0 -1
- package/dist/runs/verification-sync.js +0 -1
- package/dist/runs/verify-http.d.ts +0 -1
- package/dist/runs/verify-http.js +0 -1
- package/dist/runs/verify-server.d.ts +0 -1
- package/dist/runs/verify-server.js +0 -1
- package/dist/server-version.d.ts +0 -1
- package/dist/server-version.js +0 -1
- package/dist/session/command-timeout.d.ts +35 -0
- package/dist/session/command-timeout.js +41 -0
- package/dist/session/control-envelope.d.ts +2 -3
- package/dist/session/control-envelope.js +2 -3
- package/dist/session/last-act.d.ts +31 -0
- package/dist/session/last-act.js +24 -0
- package/dist/session/live-control-tools.d.ts +0 -1
- package/dist/session/live-control-tools.js +3 -4
- package/dist/session/live-control.d.ts +0 -1
- package/dist/session/live-control.js +0 -1
- package/dist/session/observed-state.d.ts +12 -2
- package/dist/session/observed-state.js +29 -2
- package/dist/session/output-budget.d.ts +0 -1
- package/dist/session/output-budget.js +0 -1
- package/dist/session/pending-commands.d.ts +12 -0
- package/dist/session/pending-commands.js +36 -0
- package/dist/session/presenter-args.d.ts +0 -1
- package/dist/session/presenter-args.js +0 -1
- package/dist/session/review-store.d.ts +0 -1
- package/dist/session/review-store.js +0 -1
- package/dist/session/session-health.d.ts +26 -2
- package/dist/session/session-health.js +13 -1
- package/dist/session/session-info.d.ts +29 -0
- package/dist/session/session-info.js +1 -0
- package/dist/session/session-lease.d.ts +25 -0
- package/dist/session/session-lease.js +14 -0
- package/dist/session/session-manager.d.ts +7 -19
- package/dist/session/session-manager.js +29 -2
- package/dist/session/session-readiness.d.ts +0 -1
- package/dist/session/session-readiness.js +3 -4
- package/dist/session/session-reaper.d.ts +0 -1
- package/dist/session/session-reaper.js +0 -1
- package/dist/session/session-recommendation.d.ts +0 -1
- package/dist/session/session-recommendation.js +0 -1
- package/dist/session/session-tools.d.ts +0 -1
- package/dist/session/session-tools.js +2 -3
- package/dist/session/session.d.ts +27 -53
- package/dist/session/session.js +95 -66
- package/dist/session/state-select.d.ts +0 -1
- package/dist/session/state-select.js +0 -1
- package/dist/telemetry/argument-shape.d.ts +41 -0
- package/dist/telemetry/argument-shape.js +87 -0
- package/dist/telemetry/bug-found.d.ts +33 -0
- package/dist/telemetry/bug-found.js +95 -0
- package/dist/telemetry/cli-telemetry.d.ts +13 -0
- package/dist/telemetry/cli-telemetry.js +43 -0
- package/dist/telemetry/connect-failure.d.ts +16 -0
- package/dist/telemetry/connect-failure.js +44 -0
- package/dist/telemetry/daemon-telemetry.d.ts +19 -0
- package/dist/telemetry/daemon-telemetry.js +76 -0
- package/dist/telemetry/dev-repo.d.ts +10 -0
- package/dist/telemetry/dev-repo.js +80 -0
- package/dist/telemetry/error-fingerprint.d.ts +24 -0
- package/dist/telemetry/error-fingerprint.js +88 -0
- package/dist/telemetry/feedback-cli.d.ts +31 -0
- package/dist/telemetry/feedback-cli.js +102 -0
- package/dist/telemetry/feedback-context.d.ts +32 -0
- package/dist/telemetry/feedback-context.js +143 -0
- package/dist/telemetry/feedback.d.ts +66 -0
- package/dist/telemetry/feedback.js +175 -0
- package/dist/telemetry/git-facts.d.ts +21 -0
- package/dist/telemetry/git-facts.js +109 -0
- package/dist/telemetry/identify.d.ts +22 -0
- package/dist/telemetry/identify.js +73 -0
- package/dist/telemetry/init-telemetry.d.ts +26 -0
- package/dist/telemetry/init-telemetry.js +33 -0
- package/dist/telemetry/machine-snapshot.d.ts +6 -0
- package/dist/telemetry/machine-snapshot.js +39 -0
- package/dist/telemetry/mcp-connection.d.ts +5 -0
- package/dist/telemetry/mcp-connection.js +44 -0
- package/dist/telemetry/project-profile.d.ts +44 -0
- package/dist/telemetry/project-profile.js +205 -0
- package/dist/telemetry/run-telemetry.d.ts +21 -0
- package/dist/telemetry/run-telemetry.js +62 -0
- package/dist/telemetry/session-metrics.d.ts +103 -0
- package/dist/telemetry/session-metrics.js +329 -0
- package/dist/telemetry/telemetry.d.ts +35 -8
- package/dist/telemetry/telemetry.js +105 -12
- package/dist/token-auth.d.ts +0 -1
- package/dist/token-auth.js +0 -1
- package/dist/tools/act-capsule.d.ts +23 -0
- package/dist/tools/act-capsule.js +47 -0
- package/dist/tools/act-danger.d.ts +7 -0
- package/dist/tools/act-danger.js +44 -0
- package/dist/tools/act-helpers.d.ts +17 -0
- package/dist/tools/act-helpers.js +40 -0
- package/dist/tools/act-tools.d.ts +8 -1
- package/dist/tools/act-tools.js +96 -98
- package/dist/tools/act-view.d.ts +7 -1
- package/dist/tools/act-view.js +13 -1
- package/dist/tools/assert-grade.d.ts +22 -1
- package/dist/tools/assert-grade.js +46 -1
- package/dist/tools/assert-verdict.d.ts +21 -0
- package/dist/tools/assert-verdict.js +62 -0
- package/dist/tools/browser-tools.d.ts +0 -1
- package/dist/tools/browser-tools.js +2 -2
- package/dist/tools/contract-tools.d.ts +0 -1
- package/dist/tools/contract-tools.js +0 -1
- package/dist/tools/coverage-tools.d.ts +9 -0
- package/dist/tools/coverage-tools.js +92 -0
- package/dist/tools/dynamic-tools.d.ts +0 -1
- package/dist/tools/dynamic-tools.js +21 -2
- package/dist/tools/error-recovery.d.ts +18 -2
- package/dist/tools/error-recovery.js +42 -7
- package/dist/tools/feedback-tools.d.ts +24 -0
- package/dist/tools/feedback-tools.js +180 -0
- package/dist/tools/invoke-tool.d.ts +0 -1
- package/dist/tools/invoke-tool.js +115 -5
- package/dist/tools/lease-tools.d.ts +0 -1
- package/dist/tools/lease-tools.js +6 -5
- package/dist/tools/merge-tools.d.ts +0 -1
- package/dist/tools/merge-tools.js +0 -1
- package/dist/tools/observe-tools.d.ts +0 -1
- package/dist/tools/observe-tools.js +91 -39
- package/dist/tools/profiles.d.ts +1 -2
- package/dist/tools/profiles.js +43 -16
- package/dist/tools/query-paginate.d.ts +0 -1
- package/dist/tools/query-paginate.js +0 -1
- package/dist/tools/read-tools.d.ts +0 -1
- package/dist/tools/read-tools.js +10 -8
- package/dist/tools/reconcile-tools.d.ts +2 -0
- package/dist/tools/reconcile-tools.js +111 -0
- package/dist/tools/snapshot-delta.d.ts +0 -1
- package/dist/tools/snapshot-delta.js +0 -0
- package/dist/tools/tool-invoker.d.ts +0 -1
- package/dist/tools/tool-invoker.js +0 -1
- package/dist/tools/tool-kit.d.ts +16 -1
- package/dist/tools/tool-kit.js +8 -2
- package/dist/tools/tool-names.d.ts +6 -1
- package/dist/tools/tool-names.js +6 -1
- package/dist/tools/tools-helpers.d.ts +0 -1
- package/dist/tools/tools-helpers.js +0 -1
- package/dist/tools/tools.d.ts +0 -1
- package/dist/tools/tools.js +24 -4
- package/dist/update/update-checker.d.ts +0 -1
- package/dist/update/update-checker.js +0 -1
- package/dist/update/update-nudge.d.ts +20 -0
- package/dist/update/update-nudge.js +72 -0
- package/dist/update/updater.d.ts +14 -1
- package/dist/update/updater.js +33 -2
- package/dist/visual/visual-diff.d.ts +0 -1
- package/dist/visual/visual-diff.js +0 -1
- package/dist/visual/visual-store.d.ts +0 -1
- package/dist/visual/visual-store.js +0 -1
- package/dist/visual/visual-tools.d.ts +0 -1
- package/dist/visual/visual-tools.js +103 -16
- package/package.json +2 -2
- package/dist/bridge-security.d.ts.map +0 -1
- package/dist/bridge-security.js.map +0 -1
- package/dist/bridge.d.ts.map +0 -1
- package/dist/bridge.js.map +0 -1
- package/dist/bridge.test-harness.d.ts.map +0 -1
- package/dist/bridge.test-harness.js.map +0 -1
- package/dist/capsule/capsule-store.d.ts.map +0 -1
- package/dist/capsule/capsule-store.js.map +0 -1
- package/dist/capsule/capsule.d.ts.map +0 -1
- package/dist/capsule/capsule.js.map +0 -1
- package/dist/capsule/causal-summary.d.ts.map +0 -1
- package/dist/capsule/causal-summary.js.map +0 -1
- package/dist/capsule/divergence.d.ts.map +0 -1
- package/dist/capsule/divergence.js.map +0 -1
- package/dist/capsule/minimize.d.ts.map +0 -1
- package/dist/capsule/minimize.js.map +0 -1
- package/dist/capsule/predicate-to-links.d.ts.map +0 -1
- package/dist/capsule/predicate-to-links.js.map +0 -1
- package/dist/cli-flow-commands.d.ts.map +0 -1
- package/dist/cli-flow-commands.js.map +0 -1
- package/dist/cli-launch.d.ts.map +0 -1
- package/dist/cli-launch.js.map +0 -1
- package/dist/cli-parse.d.ts.map +0 -1
- package/dist/cli-parse.js.map +0 -1
- package/dist/cli-port.d.ts.map +0 -1
- package/dist/cli-port.js.map +0 -1
- package/dist/cli-verify.d.ts.map +0 -1
- package/dist/cli-verify.js.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/cloud/cloud-config.d.ts.map +0 -1
- package/dist/cloud/cloud-config.js.map +0 -1
- package/dist/cloud/cloud-sync.d.ts.map +0 -1
- package/dist/cloud/cloud-sync.js.map +0 -1
- package/dist/cloud-cli.d.ts.map +0 -1
- package/dist/cloud-cli.js.map +0 -1
- package/dist/crawl/crawl-tools.d.ts.map +0 -1
- package/dist/crawl/crawl-tools.js.map +0 -1
- package/dist/crawl/crawl.d.ts.map +0 -1
- package/dist/crawl/crawl.js.map +0 -1
- package/dist/daemon-resilience.d.ts.map +0 -1
- package/dist/daemon-resilience.js.map +0 -1
- package/dist/daemon.d.ts.map +0 -1
- package/dist/daemon.js.map +0 -1
- package/dist/domain/domain-model.d.ts.map +0 -1
- package/dist/domain/domain-model.js.map +0 -1
- package/dist/domain/domain-tools.d.ts.map +0 -1
- package/dist/domain/domain-tools.js.map +0 -1
- package/dist/domain/flow-risk.d.ts.map +0 -1
- package/dist/domain/flow-risk.js.map +0 -1
- package/dist/ee/audit-log.d.ts.map +0 -1
- package/dist/ee/audit-log.js.map +0 -1
- package/dist/events/event-filters.d.ts.map +0 -1
- package/dist/events/event-filters.js.map +0 -1
- package/dist/events/predicate-eval.d.ts.map +0 -1
- package/dist/events/predicate-eval.js.map +0 -1
- package/dist/events/predicate.d.ts.map +0 -1
- package/dist/events/predicate.js.map +0 -1
- package/dist/events/reaction.d.ts.map +0 -1
- package/dist/events/reaction.js.map +0 -1
- package/dist/events/ring-buffer.d.ts.map +0 -1
- package/dist/events/ring-buffer.js.map +0 -1
- package/dist/flows/affected.d.ts.map +0 -1
- package/dist/flows/affected.js.map +0 -1
- package/dist/flows/annotate-tools.d.ts.map +0 -1
- package/dist/flows/annotate-tools.js.map +0 -1
- package/dist/flows/annotate.d.ts.map +0 -1
- package/dist/flows/annotate.js.map +0 -1
- package/dist/flows/annotation-store.d.ts.map +0 -1
- package/dist/flows/annotation-store.js.map +0 -1
- package/dist/flows/assertion-integrity.d.ts.map +0 -1
- package/dist/flows/assertion-integrity.js.map +0 -1
- package/dist/flows/assertion-tiers-store.d.ts.map +0 -1
- package/dist/flows/assertion-tiers-store.js.map +0 -1
- package/dist/flows/buddy-status.d.ts.map +0 -1
- package/dist/flows/buddy-status.js.map +0 -1
- package/dist/flows/coverage.d.ts.map +0 -1
- package/dist/flows/coverage.js.map +0 -1
- package/dist/flows/decision.d.ts.map +0 -1
- package/dist/flows/decision.js.map +0 -1
- package/dist/flows/flake-store.d.ts.map +0 -1
- package/dist/flows/flake-store.js.map +0 -1
- package/dist/flows/flake.d.ts.map +0 -1
- package/dist/flows/flake.js.map +0 -1
- package/dist/flows/flow-classify.d.ts.map +0 -1
- package/dist/flows/flow-classify.js.map +0 -1
- package/dist/flows/flow-replay-run.d.ts.map +0 -1
- package/dist/flows/flow-replay-run.js.map +0 -1
- package/dist/flows/flow-replay.d.ts.map +0 -1
- package/dist/flows/flow-replay.js.map +0 -1
- package/dist/flows/flow-report.d.ts.map +0 -1
- package/dist/flows/flow-report.js.map +0 -1
- package/dist/flows/flow-scope.d.ts.map +0 -1
- package/dist/flows/flow-scope.js.map +0 -1
- package/dist/flows/flow-sources.d.ts.map +0 -1
- package/dist/flows/flow-sources.js.map +0 -1
- package/dist/flows/flow-success.d.ts.map +0 -1
- package/dist/flows/flow-success.js.map +0 -1
- package/dist/flows/flow-tools.d.ts.map +0 -1
- package/dist/flows/flow-tools.js.map +0 -1
- package/dist/flows/flows.d.ts.map +0 -1
- package/dist/flows/flows.js.map +0 -1
- package/dist/flows/gate.d.ts.map +0 -1
- package/dist/flows/gate.js.map +0 -1
- package/dist/flows/git-changed.d.ts.map +0 -1
- package/dist/flows/git-changed.js.map +0 -1
- package/dist/flows/heal-run.d.ts.map +0 -1
- package/dist/flows/heal-run.js.map +0 -1
- package/dist/flows/heal.d.ts.map +0 -1
- package/dist/flows/heal.js.map +0 -1
- package/dist/flows/parallel-suite.d.ts.map +0 -1
- package/dist/flows/parallel-suite.js.map +0 -1
- package/dist/flows/recordings.d.ts.map +0 -1
- package/dist/flows/recordings.js.map +0 -1
- package/dist/flows/replay.d.ts.map +0 -1
- package/dist/flows/replay.js.map +0 -1
- package/dist/flows/server-verify.d.ts.map +0 -1
- package/dist/flows/server-verify.js.map +0 -1
- package/dist/flows/watch-batcher.d.ts.map +0 -1
- package/dist/flows/watch-batcher.js.map +0 -1
- package/dist/honesty/blind-spots.d.ts.map +0 -1
- package/dist/honesty/blind-spots.js.map +0 -1
- package/dist/honesty/honesty.d.ts.map +0 -1
- package/dist/honesty/honesty.js.map +0 -1
- package/dist/http-server.d.ts.map +0 -1
- package/dist/http-server.js.map +0 -1
- package/dist/idle-shutdown.d.ts.map +0 -1
- package/dist/idle-shutdown.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/init/agent-rules.d.ts.map +0 -1
- package/dist/init/agent-rules.js.map +0 -1
- package/dist/init/cursor.d.ts.map +0 -1
- package/dist/init/cursor.js.map +0 -1
- package/dist/init/detect.d.ts.map +0 -1
- package/dist/init/detect.js.map +0 -1
- package/dist/init/mcp.d.ts.map +0 -1
- package/dist/init/mcp.js.map +0 -1
- package/dist/init/node-io.d.ts.map +0 -1
- package/dist/init/node-io.js.map +0 -1
- package/dist/init/plan.d.ts.map +0 -1
- package/dist/init/plan.js.map +0 -1
- package/dist/init/project-id.d.ts.map +0 -1
- package/dist/init/project-id.js.map +0 -1
- package/dist/init/run.d.ts.map +0 -1
- package/dist/init/run.js.map +0 -1
- package/dist/init/snippets.d.ts.map +0 -1
- package/dist/init/snippets.js.map +0 -1
- package/dist/init/vite-config.d.ts.map +0 -1
- package/dist/init/vite-config.js.map +0 -1
- package/dist/input/network-detail.d.ts.map +0 -1
- package/dist/input/network-detail.js.map +0 -1
- package/dist/input/network-mock-tools.d.ts.map +0 -1
- package/dist/input/network-mock-tools.js.map +0 -1
- package/dist/input/network-mock.d.ts.map +0 -1
- package/dist/input/network-mock.js.map +0 -1
- package/dist/input/real-input.d.ts.map +0 -1
- package/dist/input/real-input.js.map +0 -1
- package/dist/input/scroll-find.d.ts.map +0 -1
- package/dist/input/scroll-find.js.map +0 -1
- package/dist/input/scroll-tools.d.ts.map +0 -1
- package/dist/input/scroll-tools.js.map +0 -1
- package/dist/input/viewport-tools.d.ts.map +0 -1
- package/dist/input/viewport-tools.js.map +0 -1
- package/dist/journal/ambient-store.d.ts.map +0 -1
- package/dist/journal/ambient-store.js.map +0 -1
- package/dist/journal/ambient.d.ts.map +0 -1
- package/dist/journal/ambient.js.map +0 -1
- package/dist/journal/attach-journal.d.ts.map +0 -1
- package/dist/journal/attach-journal.js.map +0 -1
- package/dist/journal/deviation-report.d.ts.map +0 -1
- package/dist/journal/deviation-report.js.map +0 -1
- package/dist/journal/deviation-service.d.ts.map +0 -1
- package/dist/journal/deviation-service.js.map +0 -1
- package/dist/journal/envelope-store.d.ts.map +0 -1
- package/dist/journal/envelope-store.js.map +0 -1
- package/dist/journal/envelope.d.ts.map +0 -1
- package/dist/journal/envelope.js.map +0 -1
- package/dist/journal/journal-query.d.ts.map +0 -1
- package/dist/journal/journal-query.js.map +0 -1
- package/dist/journal/journal-recorder.d.ts.map +0 -1
- package/dist/journal/journal-recorder.js.map +0 -1
- package/dist/journal/retention.d.ts.map +0 -1
- package/dist/journal/retention.js.map +0 -1
- package/dist/journal/rollups.d.ts.map +0 -1
- package/dist/journal/rollups.js.map +0 -1
- package/dist/journal/session-end.d.ts.map +0 -1
- package/dist/journal/session-end.js.map +0 -1
- package/dist/journal/session-journal.d.ts.map +0 -1
- package/dist/journal/session-journal.js.map +0 -1
- package/dist/license/license.d.ts.map +0 -1
- package/dist/license/license.js.map +0 -1
- package/dist/log.d.ts.map +0 -1
- package/dist/log.js.map +0 -1
- package/dist/mcp-proxy.d.ts.map +0 -1
- package/dist/mcp-proxy.js.map +0 -1
- package/dist/mcp.d.ts.map +0 -1
- package/dist/mcp.js.map +0 -1
- package/dist/oracles/flow-instrument-gaps.d.ts.map +0 -1
- package/dist/oracles/flow-instrument-gaps.js.map +0 -1
- package/dist/oracles/propose-consequences.d.ts.map +0 -1
- package/dist/oracles/propose-consequences.js.map +0 -1
- package/dist/oracles/self-instrument.d.ts.map +0 -1
- package/dist/oracles/self-instrument.js.map +0 -1
- package/dist/pairing-token.d.ts.map +0 -1
- package/dist/pairing-token.js.map +0 -1
- package/dist/phenomena/phenomena.d.ts.map +0 -1
- package/dist/phenomena/phenomena.js.map +0 -1
- package/dist/pool/browser-pool.d.ts.map +0 -1
- package/dist/pool/browser-pool.js.map +0 -1
- package/dist/pool/lease-reaper.d.ts.map +0 -1
- package/dist/pool/lease-reaper.js.map +0 -1
- package/dist/pool/playwright-launcher.d.ts.map +0 -1
- package/dist/pool/playwright-launcher.js.map +0 -1
- package/dist/project/baselines.d.ts.map +0 -1
- package/dist/project/baselines.js.map +0 -1
- package/dist/project/file-lock.d.ts.map +0 -1
- package/dist/project/file-lock.js.map +0 -1
- package/dist/project/fs-port.d.ts.map +0 -1
- package/dist/project/fs-port.js.map +0 -1
- package/dist/project/project-store.d.ts.map +0 -1
- package/dist/project/project-store.js.map +0 -1
- package/dist/project/project-tools.d.ts.map +0 -1
- package/dist/project/project-tools.js.map +0 -1
- package/dist/project/reticle-dir.d.ts.map +0 -1
- package/dist/project/reticle-dir.js.map +0 -1
- package/dist/runs/build-verification-run.d.ts.map +0 -1
- package/dist/runs/build-verification-run.js.map +0 -1
- package/dist/runs/profile-redact.d.ts.map +0 -1
- package/dist/runs/profile-redact.js.map +0 -1
- package/dist/runs/render-report.d.ts.map +0 -1
- package/dist/runs/render-report.js.map +0 -1
- package/dist/runs/repair-prompt.d.ts.map +0 -1
- package/dist/runs/repair-prompt.js.map +0 -1
- package/dist/runs/replay-mapping.d.ts.map +0 -1
- package/dist/runs/replay-mapping.js.map +0 -1
- package/dist/runs/reticle-runner.d.ts.map +0 -1
- package/dist/runs/reticle-runner.js.map +0 -1
- package/dist/runs/risk-classify.d.ts.map +0 -1
- package/dist/runs/risk-classify.js.map +0 -1
- package/dist/runs/run-diff.d.ts.map +0 -1
- package/dist/runs/run-diff.js.map +0 -1
- package/dist/runs/run-store.d.ts.map +0 -1
- package/dist/runs/run-store.js.map +0 -1
- package/dist/runs/run-tools.d.ts.map +0 -1
- package/dist/runs/run-tools.js.map +0 -1
- package/dist/runs/runner-port.d.ts.map +0 -1
- package/dist/runs/runner-port.js.map +0 -1
- package/dist/runs/verification-sync.d.ts.map +0 -1
- package/dist/runs/verification-sync.js.map +0 -1
- package/dist/runs/verify-http.d.ts.map +0 -1
- package/dist/runs/verify-http.js.map +0 -1
- package/dist/runs/verify-server.d.ts.map +0 -1
- package/dist/runs/verify-server.js.map +0 -1
- package/dist/server-version.d.ts.map +0 -1
- package/dist/server-version.js.map +0 -1
- package/dist/session/control-envelope.d.ts.map +0 -1
- package/dist/session/control-envelope.js.map +0 -1
- package/dist/session/live-control-tools.d.ts.map +0 -1
- package/dist/session/live-control-tools.js.map +0 -1
- package/dist/session/live-control.d.ts.map +0 -1
- package/dist/session/live-control.js.map +0 -1
- package/dist/session/observed-state.d.ts.map +0 -1
- package/dist/session/observed-state.js.map +0 -1
- package/dist/session/output-budget.d.ts.map +0 -1
- package/dist/session/output-budget.js.map +0 -1
- package/dist/session/presenter-args.d.ts.map +0 -1
- package/dist/session/presenter-args.js.map +0 -1
- package/dist/session/review-store.d.ts.map +0 -1
- package/dist/session/review-store.js.map +0 -1
- package/dist/session/session-health.d.ts.map +0 -1
- package/dist/session/session-health.js.map +0 -1
- package/dist/session/session-manager.d.ts.map +0 -1
- package/dist/session/session-manager.js.map +0 -1
- package/dist/session/session-readiness.d.ts.map +0 -1
- package/dist/session/session-readiness.js.map +0 -1
- package/dist/session/session-reaper.d.ts.map +0 -1
- package/dist/session/session-reaper.js.map +0 -1
- package/dist/session/session-recommendation.d.ts.map +0 -1
- package/dist/session/session-recommendation.js.map +0 -1
- package/dist/session/session-tools.d.ts.map +0 -1
- package/dist/session/session-tools.js.map +0 -1
- package/dist/session/session.d.ts.map +0 -1
- package/dist/session/session.js.map +0 -1
- package/dist/session/state-select.d.ts.map +0 -1
- package/dist/session/state-select.js.map +0 -1
- package/dist/telemetry/telemetry.d.ts.map +0 -1
- package/dist/telemetry/telemetry.js.map +0 -1
- package/dist/token-auth.d.ts.map +0 -1
- package/dist/token-auth.js.map +0 -1
- package/dist/tools/act-tools.d.ts.map +0 -1
- package/dist/tools/act-tools.js.map +0 -1
- package/dist/tools/act-view.d.ts.map +0 -1
- package/dist/tools/act-view.js.map +0 -1
- package/dist/tools/assert-grade.d.ts.map +0 -1
- package/dist/tools/assert-grade.js.map +0 -1
- package/dist/tools/browser-tools.d.ts.map +0 -1
- package/dist/tools/browser-tools.js.map +0 -1
- package/dist/tools/contract-tools.d.ts.map +0 -1
- package/dist/tools/contract-tools.js.map +0 -1
- package/dist/tools/dynamic-tools.d.ts.map +0 -1
- package/dist/tools/dynamic-tools.js.map +0 -1
- package/dist/tools/error-recovery.d.ts.map +0 -1
- package/dist/tools/error-recovery.js.map +0 -1
- package/dist/tools/invoke-tool.d.ts.map +0 -1
- package/dist/tools/invoke-tool.js.map +0 -1
- package/dist/tools/lease-tools.d.ts.map +0 -1
- package/dist/tools/lease-tools.js.map +0 -1
- package/dist/tools/merge-tools.d.ts.map +0 -1
- package/dist/tools/merge-tools.js.map +0 -1
- package/dist/tools/observe-tools.d.ts.map +0 -1
- package/dist/tools/observe-tools.js.map +0 -1
- package/dist/tools/profiles.d.ts.map +0 -1
- package/dist/tools/profiles.js.map +0 -1
- package/dist/tools/query-paginate.d.ts.map +0 -1
- package/dist/tools/query-paginate.js.map +0 -1
- package/dist/tools/read-tools.d.ts.map +0 -1
- package/dist/tools/read-tools.js.map +0 -1
- package/dist/tools/snapshot-delta.d.ts.map +0 -1
- package/dist/tools/snapshot-delta.js.map +0 -1
- package/dist/tools/tool-invoker.d.ts.map +0 -1
- package/dist/tools/tool-invoker.js.map +0 -1
- package/dist/tools/tool-kit.d.ts.map +0 -1
- package/dist/tools/tool-kit.js.map +0 -1
- package/dist/tools/tool-names.d.ts.map +0 -1
- package/dist/tools/tool-names.js.map +0 -1
- package/dist/tools/tools-helpers.d.ts.map +0 -1
- package/dist/tools/tools-helpers.js.map +0 -1
- package/dist/tools/tools.d.ts.map +0 -1
- package/dist/tools/tools.js.map +0 -1
- package/dist/update/update-checker.d.ts.map +0 -1
- package/dist/update/update-checker.js.map +0 -1
- package/dist/update/updater.d.ts.map +0 -1
- package/dist/update/updater.js.map +0 -1
- package/dist/visual/visual-diff.d.ts.map +0 -1
- package/dist/visual/visual-diff.js.map +0 -1
- package/dist/visual/visual-store.d.ts.map +0 -1
- package/dist/visual/visual-store.js.map +0 -1
- package/dist/visual/visual-tools.d.ts.map +0 -1
- package/dist/visual/visual-tools.js.map +0 -1
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { EventType, ReticleCommand, SnapshotMode } from '@reticlehq/core';
|
|
3
|
+
import { ReticleTool } from './tool-names.js';
|
|
4
|
+
import { reconcile } from '../events/reconcile.js';
|
|
5
|
+
import { salvageJson } from '../events/json-salvage.js';
|
|
6
|
+
import { withControl } from '../session/control-envelope.js';
|
|
7
|
+
import { asNumber, asString } from './tools-helpers.js';
|
|
8
|
+
import { sessionIdShape, commandOrThrow } from './tool-kit.js';
|
|
9
|
+
/**
|
|
10
|
+
* Does the screen agree with the data the app was given?
|
|
11
|
+
*
|
|
12
|
+
* A separate tool rather than a passive contradiction rule, because it needs the rendered page as
|
|
13
|
+
* well as the events — a comparison, not an observation. Passive rules stay pure and run on every
|
|
14
|
+
* window; this one costs a snapshot, so the agent asks for it.
|
|
15
|
+
*
|
|
16
|
+
* It exists because the misses that mattered on a real payments dashboard were all this shape: a USD
|
|
17
|
+
* amount rendered with a rupee sign, a settlement the API calls `on_hold` rendered as "pending". No
|
|
18
|
+
* request fails, no assertion fails, and the numbers on screen match the numbers in the payload. The
|
|
19
|
+
* only thing that disagrees is the meaning.
|
|
20
|
+
*/
|
|
21
|
+
/** Response bodies captured in the window, newest last. Only JSON is worth comparing. */
|
|
22
|
+
async function capturedBodies(session, since, urlContains) {
|
|
23
|
+
const events = (await session.queryEvents({ since }));
|
|
24
|
+
const bodies = [];
|
|
25
|
+
let withBody = 0;
|
|
26
|
+
let total = 0;
|
|
27
|
+
let truncated = 0;
|
|
28
|
+
for (const event of events) {
|
|
29
|
+
if (event.type !== EventType.NET_REQUEST)
|
|
30
|
+
continue;
|
|
31
|
+
const url = typeof event.data['url'] === 'string' ? event.data['url'] : '';
|
|
32
|
+
if (urlContains !== undefined && !url.includes(urlContains))
|
|
33
|
+
continue;
|
|
34
|
+
total += 1;
|
|
35
|
+
const raw = event.data['responseBody'];
|
|
36
|
+
if (typeof raw !== 'string' || raw.length === 0)
|
|
37
|
+
continue;
|
|
38
|
+
// A capped body is not an absent one. Recover the records that closed before the cut rather than
|
|
39
|
+
// reporting nothing about the page with the most data on it.
|
|
40
|
+
const salvaged = salvageJson(raw);
|
|
41
|
+
if (salvaged.values.length === 0)
|
|
42
|
+
continue;
|
|
43
|
+
bodies.push(...salvaged.values);
|
|
44
|
+
withBody += 1;
|
|
45
|
+
if (salvaged.partial)
|
|
46
|
+
truncated += 1;
|
|
47
|
+
}
|
|
48
|
+
return { bodies, withBody, total, truncated };
|
|
49
|
+
}
|
|
50
|
+
export const RECONCILE_TOOLS = [
|
|
51
|
+
{
|
|
52
|
+
name: ReticleTool.RECONCILE,
|
|
53
|
+
example: { urlContains: '/api/v1/settlements' },
|
|
54
|
+
description: 'Compare what the API returned against what the page RENDERS. Catches the class no status code and no assertion can: a USD amount shown with a ₹ sign, a record the API calls `on_hold` displayed as "pending". Needs response bodies — enable `captureNetworkBodies` — and says so when they are missing rather than reporting a clean result over data it never read.',
|
|
55
|
+
inputSchema: {
|
|
56
|
+
...sessionIdShape,
|
|
57
|
+
since: z
|
|
58
|
+
.number()
|
|
59
|
+
.optional()
|
|
60
|
+
.describe('Cursor from a prior act — scopes to responses received after it. Default: 0.'),
|
|
61
|
+
urlContains: z
|
|
62
|
+
.string()
|
|
63
|
+
.optional()
|
|
64
|
+
.describe('Only compare responses from URLs containing this, e.g. "/api/v1/settlements".'),
|
|
65
|
+
},
|
|
66
|
+
outputSchema: {
|
|
67
|
+
mismatches: z
|
|
68
|
+
.array(z.object({ entity: z.string(), field: z.string(), api: z.string() }).passthrough())
|
|
69
|
+
.describe('Fields whose rendering disagrees with the data the app was given.'),
|
|
70
|
+
compared: z.number().describe('How many responses carried a body that could be compared.'),
|
|
71
|
+
note: z
|
|
72
|
+
.string()
|
|
73
|
+
.optional()
|
|
74
|
+
.describe('Present when nothing could be compared — never silent about an empty check.'),
|
|
75
|
+
},
|
|
76
|
+
handler: async (deps, args) => {
|
|
77
|
+
const session = deps.sessions.resolve(asString(args['sessionId']));
|
|
78
|
+
const since = asNumber(args['since']) ?? 0;
|
|
79
|
+
const { bodies, withBody, total, truncated } = await capturedBodies(session, since, asString(args['urlContains']));
|
|
80
|
+
// An empty result over data that was never read is the exact false green this tool exists to
|
|
81
|
+
// prevent, so the two cases are reported differently and neither is silent.
|
|
82
|
+
if (bodies.length === 0) {
|
|
83
|
+
return withControl(session, {
|
|
84
|
+
mismatches: [],
|
|
85
|
+
compared: 0,
|
|
86
|
+
note: total === 0
|
|
87
|
+
? 'no responses in this window matched — nothing was compared'
|
|
88
|
+
: `${String(total)} response(s) matched but NONE carried a recorded body, so nothing was compared. Enable it where your app calls connect(): \`reticle.connect({ captureNetworkBodies: true })\`, then re-run`,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
const snapshot = await commandOrThrow(deps, session.id, ReticleCommand.SNAPSHOT, {
|
|
92
|
+
mode: SnapshotMode.FULL,
|
|
93
|
+
});
|
|
94
|
+
const tree = snapshot.tree;
|
|
95
|
+
const mismatches = reconcile(bodies, typeof tree === 'string' ? tree : '');
|
|
96
|
+
// A truncated body is declared whether or not anything was found in it: "no mismatches" over a
|
|
97
|
+
// partially-read payload is a weaker statement than over a whole one, and the difference is
|
|
98
|
+
// exactly the kind of omission this layer exists to refuse.
|
|
99
|
+
const partial = truncated > 0
|
|
100
|
+
? {
|
|
101
|
+
note: `${String(truncated)} of ${String(withBody)} response(s) exceeded the body cap and were read only up to the cut — records after it were not compared`,
|
|
102
|
+
}
|
|
103
|
+
: mismatches.length === 0
|
|
104
|
+
? {
|
|
105
|
+
note: `compared ${String(withBody)} response(s); nothing on screen contradicts them`,
|
|
106
|
+
}
|
|
107
|
+
: {};
|
|
108
|
+
return withControl(session, { mismatches, compared: withBody, ...partial });
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
];
|
|
Binary file
|
|
@@ -12,4 +12,3 @@ export type ToolInvoker = (toolName: string, args: Record<string, unknown>) => P
|
|
|
12
12
|
* (the MCP `{ isError, content }` envelope is a transport concern this layer deliberately skips).
|
|
13
13
|
*/
|
|
14
14
|
export declare function createToolInvoker(deps: ToolDeps): ToolInvoker;
|
|
15
|
-
//# sourceMappingURL=tool-invoker.d.ts.map
|
package/dist/tools/tool-kit.d.ts
CHANGED
|
@@ -46,6 +46,22 @@ export interface ToolDef {
|
|
|
46
46
|
* compose tool calls safely. Also drives TOON encoding for snapshot/query results.
|
|
47
47
|
*/
|
|
48
48
|
outputSchema?: z.ZodRawShape;
|
|
49
|
+
/**
|
|
50
|
+
* One concrete, valid call — the shape, not the prose.
|
|
51
|
+
*
|
|
52
|
+
* A schema tells an agent the FIELD NAMES; it does not tell it how they compose, and under a lean
|
|
53
|
+
* profile only the first sentence of the description survives. So an agent reads "execute one
|
|
54
|
+
* action against a ref", sees `ref` / `action` / `args`, and guesses `{ action, testid }`. The
|
|
55
|
+
* guess fails inside the MCP SDK's own validation — BEFORE this package's error handling runs — so
|
|
56
|
+
* what comes back is a raw zod dump: the validator's internal state, naming no field and showing
|
|
57
|
+
* no correct shape. Two of those round trips cost more than the lean snapshot saves, which means
|
|
58
|
+
* arg-guessing quietly refunds the entire token advantage.
|
|
59
|
+
*
|
|
60
|
+
* Rendered into the advertised description, so it survives the terse profiles where it matters
|
|
61
|
+
* most. `tool-examples.test.ts` parses every one of these against its OWN inputSchema, because an
|
|
62
|
+
* example that does not validate is worse than none at all.
|
|
63
|
+
*/
|
|
64
|
+
example?: Record<string, unknown>;
|
|
49
65
|
handler: (deps: ToolDeps, args: Record<string, unknown>) => Promise<unknown>;
|
|
50
66
|
}
|
|
51
67
|
export declare const sessionIdShape: {
|
|
@@ -66,4 +82,3 @@ export declare function snapshotTree(deps: ToolDeps, sessionId: string | undefin
|
|
|
66
82
|
lines: string[];
|
|
67
83
|
route: string;
|
|
68
84
|
}>;
|
|
69
|
-
//# sourceMappingURL=tool-kit.d.ts.map
|
package/dist/tools/tool-kit.js
CHANGED
|
@@ -11,7 +11,7 @@ export const sessionIdShape = {
|
|
|
11
11
|
sessionId: z
|
|
12
12
|
.string()
|
|
13
13
|
.optional()
|
|
14
|
-
.describe('
|
|
14
|
+
.describe('OMIT THIS unless you mean a specific tab — Reticle scopes to your project, prefers the active one, and refuses rather than guesses when ambiguous. Pass an id from reticle_sessions only to target a particular tab. The previous wording ("omit when only ONE session is open") was wrong and cost real turns: with three sessions connected — an app plus two pool leases — resolution is still unambiguous, but that sentence sent the agent off to list and filter sessions by hand before every single call.'),
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
17
|
* Fields that `runTool` / `withControl` splice onto EVERY session-bound tool result at runtime
|
|
@@ -32,6 +32,13 @@ export const sessionEnvelopeShape = {
|
|
|
32
32
|
// That is exactly what invoke-tool.ts's health splice exists to prevent, so it belongs in the shared
|
|
33
33
|
// envelope, not per-tool.
|
|
34
34
|
warning: z.string().optional(),
|
|
35
|
+
// The one-shot "ask the human how this went" envelope. Undeclared, a validating profile would strip
|
|
36
|
+
// it — and a feedback prompt that never reaches the agent is a feedback prompt that never reaches
|
|
37
|
+
// the person, which is the entire failure mode this channel exists to fix.
|
|
38
|
+
feedback_prompt: z.unknown().optional(),
|
|
39
|
+
// One-shot "a newer Reticle exists" notice. Undeclared, a validating profile would strip it and the
|
|
40
|
+
// agent would never learn an update was waiting.
|
|
41
|
+
update_available: z.unknown().optional(),
|
|
35
42
|
};
|
|
36
43
|
/** Unwrap a browser command result or throw its error so the agent sees a clean failure. */
|
|
37
44
|
export async function commandOrThrow(deps, sessionId,
|
|
@@ -53,4 +60,3 @@ export async function snapshotTree(deps, sessionId) {
|
|
|
53
60
|
const snap = (result.result ?? {});
|
|
54
61
|
return { lines: normalizeLines(snap.tree ?? ''), route: snap.status?.route ?? '' };
|
|
55
62
|
}
|
|
56
|
-
//# sourceMappingURL=tool-kit.js.map
|
|
@@ -15,6 +15,7 @@ export declare const ReticleTool: {
|
|
|
15
15
|
readonly CONSOLE: "reticle_console";
|
|
16
16
|
readonly ANIMATIONS: "reticle_animations";
|
|
17
17
|
readonly ASSERT: "reticle_assert";
|
|
18
|
+
readonly RECONCILE: "reticle_reconcile";
|
|
18
19
|
readonly BASELINE_SAVE: "reticle_baseline_save";
|
|
19
20
|
readonly BASELINE_LIST: "reticle_baseline_list";
|
|
20
21
|
readonly DIFF: "reticle_diff";
|
|
@@ -42,6 +43,9 @@ export declare const ReticleTool: {
|
|
|
42
43
|
readonly FLOW_HEAL: "reticle_flow_heal";
|
|
43
44
|
/** structured annotation → compiles into the recording's expect/dynamic/success. */
|
|
44
45
|
readonly ANNOTATE: "reticle_annotate";
|
|
46
|
+
readonly AFFECTED: "reticle_affected";
|
|
47
|
+
readonly COVERAGE: "reticle_coverage";
|
|
48
|
+
readonly VERIFY_CHANGE: "reticle_verify_change";
|
|
45
49
|
/** read cross-run history (.reticle/project.json) + diff-vs-last for a name. */
|
|
46
50
|
readonly PROJECT: "reticle_project";
|
|
47
51
|
/** explicitly record a run outcome (the manual companion to auto-recording). */
|
|
@@ -94,6 +98,7 @@ export declare const ReticleTool: {
|
|
|
94
98
|
readonly TOOLS: "reticle_tools";
|
|
95
99
|
/** Meta: invoke any tool by name — the escape hatch that keeps a trimmed profile a trim, not a removal. */
|
|
96
100
|
readonly RUN: "reticle_run";
|
|
101
|
+
/** Report that Reticle itself failed — the agent's only way to tell us what to fix. */
|
|
102
|
+
readonly FEEDBACK: "reticle_feedback";
|
|
97
103
|
};
|
|
98
104
|
export type ReticleTool = (typeof ReticleTool)[keyof typeof ReticleTool];
|
|
99
|
-
//# sourceMappingURL=tool-names.d.ts.map
|
package/dist/tools/tool-names.js
CHANGED
|
@@ -16,6 +16,7 @@ export const ReticleTool = {
|
|
|
16
16
|
CONSOLE: 'reticle_console',
|
|
17
17
|
ANIMATIONS: 'reticle_animations',
|
|
18
18
|
ASSERT: 'reticle_assert',
|
|
19
|
+
RECONCILE: 'reticle_reconcile',
|
|
19
20
|
BASELINE_SAVE: 'reticle_baseline_save',
|
|
20
21
|
BASELINE_LIST: 'reticle_baseline_list',
|
|
21
22
|
DIFF: 'reticle_diff',
|
|
@@ -43,6 +44,9 @@ export const ReticleTool = {
|
|
|
43
44
|
FLOW_HEAL: 'reticle_flow_heal',
|
|
44
45
|
/** structured annotation → compiles into the recording's expect/dynamic/success. */
|
|
45
46
|
ANNOTATE: 'reticle_annotate',
|
|
47
|
+
AFFECTED: 'reticle_affected',
|
|
48
|
+
COVERAGE: 'reticle_coverage',
|
|
49
|
+
VERIFY_CHANGE: 'reticle_verify_change',
|
|
46
50
|
/** read cross-run history (.reticle/project.json) + diff-vs-last for a name. */
|
|
47
51
|
PROJECT: 'reticle_project',
|
|
48
52
|
/** explicitly record a run outcome (the manual companion to auto-recording). */
|
|
@@ -95,5 +99,6 @@ export const ReticleTool = {
|
|
|
95
99
|
TOOLS: 'reticle_tools',
|
|
96
100
|
/** Meta: invoke any tool by name — the escape hatch that keeps a trimmed profile a trim, not a removal. */
|
|
97
101
|
RUN: 'reticle_run',
|
|
102
|
+
/** Report that Reticle itself failed — the agent's only way to tell us what to fix. */
|
|
103
|
+
FEEDBACK: 'reticle_feedback',
|
|
98
104
|
};
|
|
99
|
-
//# sourceMappingURL=tool-names.js.map
|
package/dist/tools/tools.d.ts
CHANGED
package/dist/tools/tools.js
CHANGED
|
@@ -12,6 +12,9 @@ import { FLOW_TOOLS } from '../flows/flow-tools.js';
|
|
|
12
12
|
import { PROJECT_TOOLS } from '../project/project-tools.js';
|
|
13
13
|
import { RUN_TOOLS } from '../runs/run-tools.js';
|
|
14
14
|
import { VISUAL_TOOLS } from '../visual/visual-tools.js';
|
|
15
|
+
import { AFFECTED_TOOLS } from '../flows/affected-tools.js';
|
|
16
|
+
import { COVERAGE_TOOLS } from './coverage-tools.js';
|
|
17
|
+
import { VERIFY_CHANGE_TOOLS } from '../flows/verify-change-tools.js';
|
|
15
18
|
import { CRAWL_TOOLS } from '../crawl/crawl-tools.js';
|
|
16
19
|
import { SCROLL_TOOLS } from '../input/scroll-tools.js';
|
|
17
20
|
import { NETWORK_MOCK_TOOLS } from '../input/network-mock-tools.js';
|
|
@@ -23,8 +26,10 @@ import { sessionIdShape, commandOrThrow } from './tool-kit.js';
|
|
|
23
26
|
import { applyMerges } from './merge-tools.js';
|
|
24
27
|
import { ACT_TOOLS } from './act-tools.js';
|
|
25
28
|
import { OBSERVE_TOOLS } from './observe-tools.js';
|
|
29
|
+
import { RECONCILE_TOOLS } from './reconcile-tools.js';
|
|
26
30
|
import { READ_TOOLS } from './read-tools.js';
|
|
27
31
|
import { LEASE_TOOLS } from './lease-tools.js';
|
|
32
|
+
import { FEEDBACK_TOOLS } from './feedback-tools.js';
|
|
28
33
|
/** Per-server last-snapshot cache backing reticle_snapshot's diff:true delta mode (route-invalidated). */
|
|
29
34
|
const SNAPSHOT_CACHE = new SnapshotCache();
|
|
30
35
|
const RAW_TOOLS = [
|
|
@@ -71,7 +76,8 @@ const RAW_TOOLS = [
|
|
|
71
76
|
},
|
|
72
77
|
{
|
|
73
78
|
name: ReticleTool.SNAPSHOT,
|
|
74
|
-
|
|
79
|
+
example: { diff: true },
|
|
80
|
+
description: 'Semantic accessibility snapshot of the page or a subtree — `mode:"interactive"` returns only the controls, ~3x smaller. Refs (`e42`) are stable: the same element keeps its ref across snapshots and only stops resolving once it leaves the DOM — re-snapshot after a navigation or if a ref fails to resolve, not between ordinary actions. mode: full|interactive|status. Use to see what is on screen right now. The result carries cost:{ bytes, tokens } (estimated) — if it is large, re-scope (pass `scope`) or use mode:interactive/status instead of reading the whole tree. Pass diff:true after your first snapshot to get back ONLY what changed since your last look (mode:delta with added/removed, or mode:unchanged) — far fewer tokens and no stale tree to mis-read; a route change resets it to a full snapshot automatically.',
|
|
75
81
|
inputSchema: {
|
|
76
82
|
scope: z
|
|
77
83
|
.string()
|
|
@@ -151,7 +157,8 @@ const RAW_TOOLS = [
|
|
|
151
157
|
},
|
|
152
158
|
{
|
|
153
159
|
name: ReticleTool.QUERY,
|
|
154
|
-
|
|
160
|
+
example: { by: 'testid', value: 'todo-list' },
|
|
161
|
+
description: 'Find elements by Testing-Library semantics, INCLUDING open shadow roots — `count_only:true` gives just the count (~30x smaller); `limit` caps descriptors. Pass `by` (role|text|label|placeholder|testid|alt) and `value` (the query string). Returns matching refs + descriptors + visibility. Pass `attrs:["href"]` to project attributes (link/image URLs) onto each match. Pass `limit` to cap descriptors (broad role queries can be large) or `count_only:true` for just the match count — both cut tokens. On zero matches, also returns hint:{ route, presentRegions[], knownEmptyState } so you can distinguish an empty state from a missing element WITHOUT taking a snapshot.',
|
|
155
162
|
inputSchema: {
|
|
156
163
|
by: z.string().describe('Query strategy: role | text | label | placeholder | testid | alt'),
|
|
157
164
|
value: z
|
|
@@ -171,6 +178,7 @@ const RAW_TOOLS = [
|
|
|
171
178
|
.describe("Attribute names to return per match, e.g. ['href'] to inventory links or ['src'] for images. Absent attributes are omitted; credential-bearing names are redacted."),
|
|
172
179
|
limit: z
|
|
173
180
|
.number()
|
|
181
|
+
.nonnegative()
|
|
174
182
|
.optional()
|
|
175
183
|
.describe('Cap the returned descriptors to the first N (cuts tokens on broad queries). If more matched, the result carries total + truncated:true so the trim is never silent — narrow with name/scope.'),
|
|
176
184
|
count_only: z
|
|
@@ -262,9 +270,12 @@ const RAW_TOOLS = [
|
|
|
262
270
|
},
|
|
263
271
|
{
|
|
264
272
|
name: ReticleTool.INSPECT,
|
|
273
|
+
example: { ref: 'e42' },
|
|
265
274
|
description: 'Deep info on one element by ref: full a11y props, visibility, box, and (with @reticlehq/react) component stack + source file.',
|
|
266
275
|
inputSchema: {
|
|
267
|
-
ref: z
|
|
276
|
+
ref: z
|
|
277
|
+
.string()
|
|
278
|
+
.describe(`Element ref (e.g. 'e42') from reticle_snapshot/reticle_query — stable until the element leaves the DOM, so no re-snapshot between actions.`),
|
|
268
279
|
...sessionIdShape,
|
|
269
280
|
},
|
|
270
281
|
outputSchema: {
|
|
@@ -325,6 +336,7 @@ const RAW_TOOLS = [
|
|
|
325
336
|
}),
|
|
326
337
|
},
|
|
327
338
|
// reticle_capabilities (live | fromDisk) + reticle_contract_save. See contract-tools.ts.
|
|
339
|
+
...RECONCILE_TOOLS,
|
|
328
340
|
...CONTRACT_TOOLS,
|
|
329
341
|
...DOMAIN_TOOLS,
|
|
330
342
|
// reticle_flow_save / reticle_flow_list / reticle_flow_load. See flow-tools.ts.
|
|
@@ -345,6 +357,13 @@ const RAW_TOOLS = [
|
|
|
345
357
|
...SESSION_TOOLS,
|
|
346
358
|
// reticle_annotate (structured annotation → expect/dynamic/success). See annotate-tools.ts.
|
|
347
359
|
...ANNOTATE_TOOLS,
|
|
360
|
+
// reticle_affected — which saved flows a diff invalidates. Unadvertised (zero per-turn cost),
|
|
361
|
+
// reachable through reticle_run. See affected-tools.ts.
|
|
362
|
+
...AFFECTED_TOOLS,
|
|
363
|
+
// reticle_coverage — which controls were driven vs never touched. Unadvertised; via reticle_run.
|
|
364
|
+
...COVERAGE_TOOLS,
|
|
365
|
+
// reticle_verify_change — "did my change break anything" in one call. See verify-change-tools.ts.
|
|
366
|
+
...VERIFY_CHANGE_TOOLS,
|
|
348
367
|
// Live-control: reticle_end_session / reticle_resume / reticle_messages. See live-control-tools.ts.
|
|
349
368
|
...LIVE_CONTROL_TOOLS,
|
|
350
369
|
// reticle_navigate / reticle_refresh — browser navigation tools. See browser-tools.ts.
|
|
@@ -353,6 +372,8 @@ const RAW_TOOLS = [
|
|
|
353
372
|
...OBSERVE_TOOLS,
|
|
354
373
|
...READ_TOOLS,
|
|
355
374
|
...LEASE_TOOLS,
|
|
375
|
+
// reticle_feedback — the agent reports that RETICLE failed (not that the app did). See feedback-tools.ts.
|
|
376
|
+
...FEEDBACK_TOOLS,
|
|
356
377
|
];
|
|
357
378
|
/**
|
|
358
379
|
* surface consolidation. Tool defs are re-sent EVERY turn, so the advertised count is a per-turn
|
|
@@ -415,4 +436,3 @@ const RETIRED_FROM_SURFACE = [
|
|
|
415
436
|
ReticleTool.WAIT_READY, // server-internal: the first live call already blocks for the session
|
|
416
437
|
];
|
|
417
438
|
export const TOOLS = applyMerges(RAW_TOOLS, MERGE_PLANS, RETIRED_FROM_SURFACE);
|
|
418
|
-
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface UpdateNudge {
|
|
2
|
+
/** The version available, so the agent can tell the human what they would be moving to. */
|
|
3
|
+
latestVersion: string;
|
|
4
|
+
currentVersion: string;
|
|
5
|
+
/** The exact command. Spelled out so the agent never has to guess or invent one. */
|
|
6
|
+
command: string;
|
|
7
|
+
action: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Kick off a background check. Non-blocking and best-effort: `checkForUpdate` never throws, caches
|
|
11
|
+
* for 24h on disk, and falls back to the cached manifest when the registry is unreachable — so this
|
|
12
|
+
* costs one npm registry request per day per machine, and nothing at all when offline.
|
|
13
|
+
*/
|
|
14
|
+
export declare function startUpdateCheck(now?: () => number): void;
|
|
15
|
+
/** The nudge, once. Returns undefined afterwards so a long session is told exactly one time. */
|
|
16
|
+
export declare function takeUpdateNudge(): UpdateNudge | undefined;
|
|
17
|
+
/** Tests only — drop the module state so each case starts clean. */
|
|
18
|
+
export declare function resetUpdateNudge(): void;
|
|
19
|
+
/** Tests only — seed a pending nudge without going near the network. */
|
|
20
|
+
export declare function setPendingUpdate(nudge: UpdateNudge | undefined): void;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Telling the agent that a newer Reticle exists.
|
|
3
|
+
*
|
|
4
|
+
* Until now nothing did. `checkForUpdate` had exactly one caller — the `reticle update` command — so
|
|
5
|
+
* a published release was invisible to every install until a human happened to type that command,
|
|
6
|
+
* which in practice meant never. A fix could ship and sit unused for months on the machines that hit
|
|
7
|
+
* the bug it fixed.
|
|
8
|
+
*
|
|
9
|
+
* The nudge rides the tool-result envelope rather than being a tool of its own, for the same reason
|
|
10
|
+
* the session-health and pool-lease reminders do: the agent is mid-task, and something it has to go
|
|
11
|
+
* and ASK for is something it will not ask for. Delivered ONCE per daemon process — a repeated
|
|
12
|
+
* "please update" during someone's work is noise, and noise is what gets filtered out.
|
|
13
|
+
*
|
|
14
|
+
* It deliberately does NOT update anything by itself. A silent self-install would swap the binary
|
|
15
|
+
* under a running session, restart the daemon, and drop every agent attached to it — during work the
|
|
16
|
+
* human never agreed to interrupt. So the envelope carries the fact and the exact command, and the
|
|
17
|
+
* decision stays with the people whose machine it is.
|
|
18
|
+
*/
|
|
19
|
+
import { checkForUpdate } from './update-checker.js';
|
|
20
|
+
import { SERVER_VERSION } from '../server-version.js';
|
|
21
|
+
import { log } from '../log.js';
|
|
22
|
+
/** Let the daemon finish coming up before touching the network. */
|
|
23
|
+
const CHECK_DELAY_MS = 8_000;
|
|
24
|
+
const UPDATE_COMMAND = 'reticle update';
|
|
25
|
+
let pending;
|
|
26
|
+
let delivered = false;
|
|
27
|
+
/**
|
|
28
|
+
* Kick off a background check. Non-blocking and best-effort: `checkForUpdate` never throws, caches
|
|
29
|
+
* for 24h on disk, and falls back to the cached manifest when the registry is unreachable — so this
|
|
30
|
+
* costs one npm registry request per day per machine, and nothing at all when offline.
|
|
31
|
+
*/
|
|
32
|
+
export function startUpdateCheck(now = () => Date.now()) {
|
|
33
|
+
setTimeout(() => {
|
|
34
|
+
void checkForUpdate(SERVER_VERSION, now)
|
|
35
|
+
.then((manifest) => {
|
|
36
|
+
if (!manifest.updateAvailable || manifest.latestVersion === undefined)
|
|
37
|
+
return;
|
|
38
|
+
pending = {
|
|
39
|
+
currentVersion: SERVER_VERSION,
|
|
40
|
+
latestVersion: manifest.latestVersion,
|
|
41
|
+
command: UPDATE_COMMAND,
|
|
42
|
+
action: `A newer Reticle is available (${SERVER_VERSION} → ${manifest.latestVersion}). ` +
|
|
43
|
+
`Tell the human, and run \`${UPDATE_COMMAND}\` if they agree — it restarts the daemon, ` +
|
|
44
|
+
'so do it between tasks rather than mid-verification. Continue your current task first.',
|
|
45
|
+
};
|
|
46
|
+
log('reticle_update_available', {
|
|
47
|
+
from: SERVER_VERSION,
|
|
48
|
+
to: manifest.latestVersion,
|
|
49
|
+
});
|
|
50
|
+
})
|
|
51
|
+
.catch(() => {
|
|
52
|
+
/* a version check must never surface to a user */
|
|
53
|
+
});
|
|
54
|
+
}, CHECK_DELAY_MS).unref();
|
|
55
|
+
}
|
|
56
|
+
/** The nudge, once. Returns undefined afterwards so a long session is told exactly one time. */
|
|
57
|
+
export function takeUpdateNudge() {
|
|
58
|
+
if (delivered || pending === undefined)
|
|
59
|
+
return undefined;
|
|
60
|
+
delivered = true;
|
|
61
|
+
return pending;
|
|
62
|
+
}
|
|
63
|
+
/** Tests only — drop the module state so each case starts clean. */
|
|
64
|
+
export function resetUpdateNudge() {
|
|
65
|
+
pending = undefined;
|
|
66
|
+
delivered = false;
|
|
67
|
+
}
|
|
68
|
+
/** Tests only — seed a pending nudge without going near the network. */
|
|
69
|
+
export function setPendingUpdate(nudge) {
|
|
70
|
+
pending = nudge;
|
|
71
|
+
delivered = false;
|
|
72
|
+
}
|
package/dist/update/updater.d.ts
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/** Which way the installed version moved. A rollback means a release hurt someone enough to retreat. */
|
|
2
|
+
export declare const VersionChangeDirection: {
|
|
3
|
+
readonly UPDATE: "update";
|
|
4
|
+
readonly ROLLBACK: "rollback";
|
|
5
|
+
};
|
|
6
|
+
export type VersionChangeDirection = (typeof VersionChangeDirection)[keyof typeof VersionChangeDirection];
|
|
7
|
+
/**
|
|
8
|
+
* Report a completed version move. Never throws — an install that worked must still be reported done.
|
|
9
|
+
*
|
|
10
|
+
* Exported so the emit path can be exercised directly: `applyUpdate`/`rollback` both run a real npm
|
|
11
|
+
* install and then `process.exit`, so there is no way to reach this through them in a test without
|
|
12
|
+
* mocking the package manager and the process itself.
|
|
13
|
+
*/
|
|
14
|
+
export declare function reportVersionChange(from: string, to: string, direction: VersionChangeDirection): Promise<void>;
|
|
1
15
|
/** How this reticle process was launched — determines which npm strategy to use for updates. */
|
|
2
16
|
declare const ExecutionKind: {
|
|
3
17
|
/** Launched via `npx @reticlehq/server` — npm re-resolves the package on restart. */
|
|
@@ -46,4 +60,3 @@ export declare function applyUpdate(targetVersion: string): Promise<void>;
|
|
|
46
60
|
*/
|
|
47
61
|
export declare function rollback(): Promise<void>;
|
|
48
62
|
export {};
|
|
49
|
-
//# sourceMappingURL=updater.d.ts.map
|
package/dist/update/updater.js
CHANGED
|
@@ -3,8 +3,32 @@ import { existsSync } from 'node:fs';
|
|
|
3
3
|
import { platform } from 'node:os';
|
|
4
4
|
import { dirname, join } from 'node:path';
|
|
5
5
|
import { loadManifest, saveManifest } from './update-checker.js';
|
|
6
|
-
import { RETICLE_NPM_PACKAGE } from '../server-version.js';
|
|
6
|
+
import { RETICLE_NPM_PACKAGE, SERVER_VERSION } from '../server-version.js';
|
|
7
7
|
import { log } from '../log.js';
|
|
8
|
+
import { TelemetryEventKind } from '@reticlehq/core';
|
|
9
|
+
import { getTelemetry } from '../telemetry/telemetry.js';
|
|
10
|
+
/** Which way the installed version moved. A rollback means a release hurt someone enough to retreat. */
|
|
11
|
+
export const VersionChangeDirection = {
|
|
12
|
+
UPDATE: 'update',
|
|
13
|
+
ROLLBACK: 'rollback',
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Report a completed version move. Never throws — an install that worked must still be reported done.
|
|
17
|
+
*
|
|
18
|
+
* Exported so the emit path can be exercised directly: `applyUpdate`/`rollback` both run a real npm
|
|
19
|
+
* install and then `process.exit`, so there is no way to reach this through them in a test without
|
|
20
|
+
* mocking the package manager and the process itself.
|
|
21
|
+
*/
|
|
22
|
+
export async function reportVersionChange(from, to, direction) {
|
|
23
|
+
try {
|
|
24
|
+
await getTelemetry().emit(TelemetryEventKind.VERSION_CHANGED, {
|
|
25
|
+
versionChange: { from, to, direction },
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
/* best-effort, like every other send */
|
|
30
|
+
}
|
|
31
|
+
}
|
|
8
32
|
const NPM_BIN = platform() === 'win32' ? 'npm.cmd' : 'npm';
|
|
9
33
|
const NPM_TIMEOUT_MS = 120_000;
|
|
10
34
|
/** How this reticle process was launched — determines which npm strategy to use for updates. */
|
|
@@ -129,6 +153,11 @@ export async function applyUpdate(targetVersion) {
|
|
|
129
153
|
log('reticle_update_applying', { version: targetVersion, executionKind: kind });
|
|
130
154
|
await installVersion(targetVersion, kind);
|
|
131
155
|
log('reticle_update_applied', { version: targetVersion, executionKind: kind });
|
|
156
|
+
// Emitted AFTER the install succeeded, so the metric counts versions that actually landed rather
|
|
157
|
+
// than attempts. Awaited, unlike every other send in the product: `process.exit(0)` on the next
|
|
158
|
+
// line would kill an in-flight fire-and-forget POST, and this event is rare enough that the wait
|
|
159
|
+
// costs nothing. A failed send still cannot block the exit — `emit` swallows its own errors.
|
|
160
|
+
await reportVersionChange(SERVER_VERSION, targetVersion, VersionChangeDirection.UPDATE);
|
|
132
161
|
process.exit(0);
|
|
133
162
|
}
|
|
134
163
|
/**
|
|
@@ -145,10 +174,12 @@ export async function rollback() {
|
|
|
145
174
|
log('reticle_rollback_applying', { version: prev, executionKind: kind });
|
|
146
175
|
await installVersionRollback(prev, kind);
|
|
147
176
|
log('reticle_rollback_applied', { version: prev, executionKind: kind });
|
|
177
|
+
// A rollback is a release-quality alarm — someone shipped something that broke a real user badly
|
|
178
|
+
// enough for them to go backwards. Worth knowing about within the hour, not at the next retro.
|
|
179
|
+
await reportVersionChange(SERVER_VERSION, prev, VersionChangeDirection.ROLLBACK);
|
|
148
180
|
// For npx, exiting would let the next restart re-resolve @latest — rolling FORWARD, the opposite
|
|
149
181
|
// of rollback. installVersionRollback already told the user to pin the version in.mcp.json, so
|
|
150
182
|
// stay running rather than trigger that. Other kinds installed the old version and must restart.
|
|
151
183
|
if (kind !== ExecutionKind.NPX)
|
|
152
184
|
process.exit(0);
|
|
153
185
|
}
|
|
154
|
-
//# sourceMappingURL=updater.js.map
|
|
@@ -43,4 +43,3 @@ export interface VisualDiffResult {
|
|
|
43
43
|
* mismatch is a hard fail (can't pixel-diff) reported as `dimensionMismatch`, never a throw.
|
|
44
44
|
*/
|
|
45
45
|
export declare function diffPng(baselineBytes: Uint8Array, currentBytes: Uint8Array, opts?: DiffOptions): Promise<VisualDiffResult>;
|
|
46
|
-
//# sourceMappingURL=visual-diff.d.ts.map
|