@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
|
@@ -42,6 +42,8 @@ function scopeMissError(scope) {
|
|
|
42
42
|
* tool targets when the agent omits an explicit sessionId. Extracted from session.ts so each file
|
|
43
43
|
* stays one cohesive unit (Session = one tab; SessionManager = the registry over all tabs).
|
|
44
44
|
*/
|
|
45
|
+
/** How many bridge-initiated closes to remember for diagnosis. */
|
|
46
|
+
const MAX_REMEMBERED_CLOSURES = 5;
|
|
45
47
|
export class SessionManager {
|
|
46
48
|
#sessions = new Map();
|
|
47
49
|
/**
|
|
@@ -91,6 +93,29 @@ export class SessionManager {
|
|
|
91
93
|
* desktop), skip the gap check and pick the freshest heartbeat. This lets the agent
|
|
92
94
|
* keep working in the background without requiring sessionId every time.
|
|
93
95
|
*/
|
|
96
|
+
/**
|
|
97
|
+
* Why a session recently went away, when the bridge closed it rather than the tab.
|
|
98
|
+
*
|
|
99
|
+
* The bridge enforces a message-rate cap and closes the socket on breach with `1008 message rate
|
|
100
|
+
* exceeded` — a policy violation, so the SDK does not retry. The app keeps running and Reticle is
|
|
101
|
+
* blind from that moment. Measured on the bench app: 2600 requests fired in one tick disconnected
|
|
102
|
+
* the session permanently, and the only trace was a line in the PAGE console, which no agent reads.
|
|
103
|
+
*
|
|
104
|
+
* Without this the agent is told "no browser session connected — check your app is running with
|
|
105
|
+
* @reticlehq/browser enabled", which is precisely wrong: the app IS running and instrumented. It
|
|
106
|
+
* was hung up on. Keeping the last few reasons turns an unexplained disappearance into a fact.
|
|
107
|
+
*/
|
|
108
|
+
#recentClosures = [];
|
|
109
|
+
/** Record a bridge-initiated close so `resolve` can explain a session that vanished. */
|
|
110
|
+
noteClosure(reason, at) {
|
|
111
|
+
this.#recentClosures.push({ at, reason });
|
|
112
|
+
if (this.#recentClosures.length > MAX_REMEMBERED_CLOSURES)
|
|
113
|
+
this.#recentClosures.shift();
|
|
114
|
+
}
|
|
115
|
+
/** The most recent bridge-initiated close, if any. */
|
|
116
|
+
lastClosure() {
|
|
117
|
+
return this.#recentClosures[this.#recentClosures.length - 1];
|
|
118
|
+
}
|
|
94
119
|
resolve(sessionId, scope) {
|
|
95
120
|
if (sessionId !== undefined) {
|
|
96
121
|
const found = this.#sessions.get(sessionId);
|
|
@@ -101,7 +126,10 @@ export class SessionManager {
|
|
|
101
126
|
return found;
|
|
102
127
|
}
|
|
103
128
|
if (this.#sessions.size === 0) {
|
|
104
|
-
|
|
129
|
+
const closure = this.lastClosure();
|
|
130
|
+
throw new Error(closure === undefined
|
|
131
|
+
? NO_SESSION_CONNECTED_ERROR
|
|
132
|
+
: `${NO_SESSION_CONNECTED_ERROR} NOTE: the bridge closed a session recently — "${closure.reason}". The app is probably still running; it was disconnected, and the SDK does not retry after a policy close. Reload the page to reconnect.`);
|
|
105
133
|
}
|
|
106
134
|
// Scope to the agent's active project FIRST, so a stray tab from another app/origin (e.g. a
|
|
107
135
|
// leftover dashboard on a different port) is structurally unselectable — it never enters the
|
|
@@ -153,4 +181,3 @@ export class SessionManager {
|
|
|
153
181
|
return best.s;
|
|
154
182
|
}
|
|
155
183
|
}
|
|
156
|
-
//# sourceMappingURL=session-manager.js.map
|
|
@@ -6,10 +6,10 @@ const DEFAULT_POLL_MS = 100;
|
|
|
6
6
|
*/
|
|
7
7
|
export const RETICLE_LOOP_GUIDE = 'Reticle loop — LOOK: reticle_snapshot / reticle_query / reticle_inspect · ACT: reticle_act (or reticle_act_and_wait) · ' +
|
|
8
8
|
'OBSERVE: reticle_observe / reticle_wait_for / reticle_network / reticle_console · ASSERT: reticle_assert over program ' +
|
|
9
|
-
'truth, not just the DOM · REGRESS:
|
|
10
|
-
'suite. The human can flag bugs from the panel — drain them with
|
|
9
|
+
'truth, not just the DOM · REGRESS: reticle_record{action:"start"} → reticle_replay, or reticle_flow_verify for the whole ' +
|
|
10
|
+
'suite. The human can flag bugs from the panel — drain them with reticle_session{action:"review"} and resolve each once fixed. ' +
|
|
11
11
|
'MANDATORY: the moment you stop driving — finishing your reply or waiting on the human — call reticle_session {action:"yield"} ' +
|
|
12
|
-
'(mode:"waiting", or mode:"ask" with the question) so the panel shows your real state;
|
|
12
|
+
'(mode:"waiting", or mode:"ask" with the question) so the panel shows your real state; reticle_session{action:"end"} ' +
|
|
13
13
|
'only when the whole task is done. Never leave the panel reading "live" when you have actually stopped.';
|
|
14
14
|
/**
|
|
15
15
|
* Resolve `true` as soon as at least one session is connected, or `false` if the timeout elapses
|
|
@@ -29,4 +29,3 @@ export async function waitForReady(opts) {
|
|
|
29
29
|
return true;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
//# sourceMappingURL=session-readiness.js.map
|
|
@@ -15,4 +15,3 @@ export interface RecommendationInputs {
|
|
|
15
15
|
* live tab is still scriptable, so blur alone does not trigger it. Pure.
|
|
16
16
|
*/
|
|
17
17
|
export declare function buildSessionRecommendation(inputs: RecommendationInputs): string | undefined;
|
|
18
|
-
//# sourceMappingURL=session-recommendation.d.ts.map
|
|
@@ -11,12 +11,12 @@ import { asNumber, asString } from '../tools/tools-helpers.js';
|
|
|
11
11
|
export const SESSION_TOOLS = [
|
|
12
12
|
{
|
|
13
13
|
name: ReticleTool.SESSION_TUNE,
|
|
14
|
-
description: 'Tune the presenter session for this app. { idleEndMs } sets how long the session stays open after you go quiet before the panel shows the human you are WAITING (your turn). Default 5min — the SLOW backstop; signal handback IMMEDIATELY with
|
|
14
|
+
description: 'Tune the presenter session for this app. { idleEndMs } sets how long the session stays open after you go quiet before the panel shows the human you are WAITING (your turn). Default 5min — the SLOW backstop; signal handback IMMEDIATELY with reticle_session{action:"yield"} instead of waiting for this. Lower it for snappier auto-handback, raise it for a slow app where long gaps between your tool calls are normal. Enforced SERVER-SIDE (immune to background-tab throttling); it also fires if you (the MCP client) disconnect — so a forgotten or crashed session never leaves the HUD reading "live". Going quiet then acting again revives the session automatically. Returns { applied, idleEndMs }.',
|
|
15
15
|
inputSchema: {
|
|
16
16
|
idleEndMs: z
|
|
17
17
|
.number()
|
|
18
18
|
.optional()
|
|
19
|
-
.describe('Idle window in milliseconds after which the panel shows WAITING (your turn). Default: 300000 (5 min) — the slow backstop; prefer
|
|
19
|
+
.describe('Idle window in milliseconds after which the panel shows WAITING (your turn). Default: 300000 (5 min) — the slow backstop; prefer reticle_session{action:"yield"}. Raise for slow apps.'),
|
|
20
20
|
sessionId: z
|
|
21
21
|
.string()
|
|
22
22
|
.optional()
|
|
@@ -40,4 +40,3 @@ export const SESSION_TOOLS = [
|
|
|
40
40
|
},
|
|
41
41
|
},
|
|
42
42
|
];
|
|
43
|
-
//# sourceMappingURL=session-tools.js.map
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { WebSocket } from 'ws';
|
|
2
|
+
import { LastAct } from './last-act.js';
|
|
3
|
+
import { type PageRuntime } from './command-timeout.js';
|
|
4
|
+
import { type SessionHealth } from './session-health.js';
|
|
5
|
+
export type { SessionHealth };
|
|
2
6
|
import { PresenterTone, SessionState, type CommandResult, type HelloMessage, type HumanControlData, type ReticleEvent } from '@reticlehq/core';
|
|
3
7
|
import type { JournalReader, JournalRecorder } from '../journal/journal-recorder.js';
|
|
4
8
|
import { type EventQueryOptions } from '../journal/journal-query.js';
|
|
@@ -6,36 +10,9 @@ import { type AmbientCounts } from '../journal/ambient.js';
|
|
|
6
10
|
import { type InboxMessage } from './live-control.js';
|
|
7
11
|
export type { InboxMessage } from './live-control.js';
|
|
8
12
|
import { type ReviewMark } from './review-store.js';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/** Stable build-stamped project identity; absent for v1.0 SDKs that don't send it. */
|
|
13
|
-
projectId?: string;
|
|
14
|
-
title: string;
|
|
15
|
-
adapters: string[];
|
|
16
|
-
hasCapabilities: boolean;
|
|
17
|
-
/** ms since the SDK last reported anything (silence ⇒ likely throttled). */
|
|
18
|
-
lastSeenMs: number;
|
|
19
|
-
hidden: boolean;
|
|
20
|
-
focused: boolean;
|
|
21
|
-
throttled: boolean;
|
|
22
|
-
/** present only when hidden/throttled — points at the `reticle drive` escape hatch. */
|
|
23
|
-
recommendation?: string;
|
|
24
|
-
stale?: boolean;
|
|
25
|
-
cleanup_suggestion?: string;
|
|
26
|
-
/** present only when the human has flagged bugs on this tab — count of pending review marks. */
|
|
27
|
-
pendingMarks?: number;
|
|
28
|
-
/** present with pendingMarks — nudges the agent to drain them with reticle_review. */
|
|
29
|
-
review_suggestion?: string;
|
|
30
|
-
}
|
|
31
|
-
/** The health block spliced onto act/assert results. */
|
|
32
|
-
export interface SessionHealth {
|
|
33
|
-
lastSeenMs: number;
|
|
34
|
-
throttled: boolean;
|
|
35
|
-
focused: boolean;
|
|
36
|
-
/** present only when hidden/throttled — points at the `reticle drive` escape hatch. */
|
|
37
|
-
recommendation?: string;
|
|
38
|
-
}
|
|
13
|
+
import { type SessionLease } from './session-lease.js';
|
|
14
|
+
import type { SessionInfo } from './session-info.js';
|
|
15
|
+
export type { SessionInfo } from './session-info.js';
|
|
39
16
|
type Clock = () => number;
|
|
40
17
|
/**
|
|
41
18
|
* One connected browser tab. Owns its socket, a ring buffer of observations, and the
|
|
@@ -57,8 +34,16 @@ export declare class Session {
|
|
|
57
34
|
touch(): void;
|
|
58
35
|
/** ms since the SDK last reported anything (distinct from elapsed-since-connect). */
|
|
59
36
|
lastSeenMs(): number;
|
|
60
|
-
/**
|
|
61
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Record the latest page visibility/focus state from a PAGE_HEALTH event.
|
|
39
|
+
*
|
|
40
|
+
* `runtime` is optional so an older SDK (which does not report it) still works — it simply loses
|
|
41
|
+
* the desktop-specific timeout diagnosis rather than breaking.
|
|
42
|
+
*/
|
|
43
|
+
applyHealth(hidden: boolean, focused: boolean, runtime?: string, engine?: string): void;
|
|
44
|
+
/** The shell (web/electron/tauri) and rendering engine the SDK reported. Undefined on an older SDK. */
|
|
45
|
+
get runtime(): PageRuntime | undefined;
|
|
46
|
+
get engine(): string | undefined;
|
|
62
47
|
/** Throttled if the tab is hidden OR we have not heard from it recently. */
|
|
63
48
|
throttled(): boolean;
|
|
64
49
|
/** The attachable health block — single source of truth for the tools. */
|
|
@@ -68,7 +53,9 @@ export declare class Session {
|
|
|
68
53
|
staleMs(): number;
|
|
69
54
|
/** Re-stamp an incoming event with server-relative time, buffer it, and fan out. */
|
|
70
55
|
pushEvent(event: ReticleEvent, byteSize?: number): void;
|
|
71
|
-
|
|
56
|
+
recordActedRef(ref: string): void;
|
|
57
|
+
actedRefs(): ReadonlySet<string>;
|
|
58
|
+
noteRateLimited(dropped: number): void;
|
|
72
59
|
blindSpots(): Readonly<Record<string, number>>;
|
|
73
60
|
/** Learned ambient-churn counts (PredicateSession hook the settle oracle reads). */
|
|
74
61
|
ambientCounts(): AmbientCounts;
|
|
@@ -99,16 +86,12 @@ export declare class Session {
|
|
|
99
86
|
flushJournal(): Promise<void>;
|
|
100
87
|
eventsSince(cursor: number): ReticleEvent[];
|
|
101
88
|
/**
|
|
102
|
-
*
|
|
103
|
-
*
|
|
89
|
+
* What the most recent act was: its cursor, its source, and what it changed inside its target.
|
|
90
|
+
*
|
|
91
|
+
* Exposed as the object rather than six pass-through methods — act writes to it and observe reads
|
|
92
|
+
* from it, and the split between those two tool calls is the whole reason it exists.
|
|
104
93
|
*/
|
|
105
|
-
|
|
106
|
-
/** The cursor of the last act, or undefined if nothing has acted yet. */
|
|
107
|
-
lastActCursor(): number | undefined;
|
|
108
|
-
/** Remember where the last acted control is written (`file:line`), for failures with no element. */
|
|
109
|
-
markActSource(source: string | undefined): void;
|
|
110
|
-
/** Where the last acted control is written, or undefined if nothing has acted yet. */
|
|
111
|
-
lastActSource(): string | undefined;
|
|
94
|
+
readonly lastAct: LastAct;
|
|
112
95
|
/**
|
|
113
96
|
* Stamp the wall-clock of the latest AGENT command (called whenever a tool resolves this session).
|
|
114
97
|
* If the reaper had auto-ended the session, a fresh command means the agent is alive again, so the
|
|
@@ -177,16 +160,8 @@ export declare class Session {
|
|
|
177
160
|
pushPresenter(state: SessionState, text?: string, tone?: PresenterTone): void;
|
|
178
161
|
/** Fire-and-forget a narration row to the live panel (so a resolved mark shows "✓ fixed"). */
|
|
179
162
|
pushNarration(text: string): void;
|
|
180
|
-
/**
|
|
181
|
-
|
|
182
|
-
* forever after. The lease carries an IMPORTANT reminder to call reticle_end_session. Coding agents
|
|
183
|
-
* (Claude Code, Codex) read tool results — they will see this and remember to clean up.
|
|
184
|
-
*/
|
|
185
|
-
takeSessionLease(): {
|
|
186
|
-
sessionId: string;
|
|
187
|
-
opened_at: number;
|
|
188
|
-
IMPORTANT: string;
|
|
189
|
-
} | undefined;
|
|
163
|
+
/** The one-time lease block on the first agent command, then undefined forever after. */
|
|
164
|
+
takeSessionLease(): SessionLease | undefined;
|
|
190
165
|
/**
|
|
191
166
|
* Returns a human-readable age warning after SESSION_LEASE.WARN_AFTER_MS (10 min), else undefined.
|
|
192
167
|
* Spliced onto every session-bound tool result so the agent is passively reminded to clean up
|
|
@@ -200,4 +175,3 @@ export declare class Session {
|
|
|
200
175
|
* units under the file-size cap.
|
|
201
176
|
*/
|
|
202
177
|
export { SessionManager } from './session-manager.js';
|
|
203
|
-
//# sourceMappingURL=session.d.ts.map
|
package/dist/session/session.js
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LastAct } from './last-act.js';
|
|
2
|
+
import { commandTimeoutMessage } from './command-timeout.js';
|
|
3
|
+
import { readHealthEvent } from './session-health.js';
|
|
4
|
+
import { PendingCommands } from './pending-commands.js';
|
|
5
|
+
import { EventType, HumanControlDataSchema, HumanControlKind, HumanMarkDataSchema, ReticleCommand, MessageKind, parseEventPayload, PresenterTone, SESSION_HEALTH, SESSION_LEASE, SESSION_LIFECYCLE, SessionState, } from '@reticlehq/core';
|
|
2
6
|
import { RingBuffer } from '../events/ring-buffer.js';
|
|
3
7
|
import { filterEvents, mergeEventsBySeq, } from '../journal/journal-query.js';
|
|
4
8
|
import {} from '../journal/ambient.js';
|
|
5
9
|
import { ObservedState } from './observed-state.js';
|
|
10
|
+
import { recordBrowserLatency, recordSdkFailure } from '../telemetry/session-metrics.js';
|
|
6
11
|
import { LiveControl } from './live-control.js';
|
|
7
12
|
import { ReviewStore } from './review-store.js';
|
|
8
13
|
import { buildSessionRecommendation } from './session-recommendation.js';
|
|
9
14
|
import { buildPresenterArgs } from './presenter-args.js';
|
|
15
|
+
import { buildSessionLease } from './session-lease.js';
|
|
10
16
|
const DEFAULT_COMMAND_TIMEOUT_MS = 8000;
|
|
11
17
|
/** Prefix on correlated command ids (c1, c2, …) — distinguishes them from mark ids. */
|
|
12
18
|
const COMMAND_ID_PREFIX = 'c';
|
|
@@ -30,15 +36,15 @@ export class Session {
|
|
|
30
36
|
#clock;
|
|
31
37
|
#startedAt;
|
|
32
38
|
#buffer = new RingBuffer();
|
|
33
|
-
#pending = new
|
|
39
|
+
#pending = new PendingCommands();
|
|
34
40
|
#listeners = new Set();
|
|
35
|
-
#seq = 0;
|
|
36
41
|
#actionSeq = 0;
|
|
37
42
|
#lastSeenAt;
|
|
38
43
|
#hidden = false;
|
|
44
|
+
/** Which shell the page reported (PAGE_HEALTH). Undefined until the first report lands. */
|
|
45
|
+
#runtime;
|
|
46
|
+
#engine;
|
|
39
47
|
#focused = true;
|
|
40
|
-
#lastActCursor;
|
|
41
|
-
#lastActSource;
|
|
42
48
|
/** Liveness: wall-clock of the last AGENT command (distinct from browser chatter / lastSeen). */
|
|
43
49
|
#lastAgentActivityAt;
|
|
44
50
|
/** Server-side mirror of the agent-tuned idle window, so the reaper honors reticle_session. */
|
|
@@ -82,10 +88,27 @@ export class Session {
|
|
|
82
88
|
lastSeenMs() {
|
|
83
89
|
return this.#clock() - this.#lastSeenAt;
|
|
84
90
|
}
|
|
85
|
-
/**
|
|
86
|
-
|
|
91
|
+
/**
|
|
92
|
+
* Record the latest page visibility/focus state from a PAGE_HEALTH event.
|
|
93
|
+
*
|
|
94
|
+
* `runtime` is optional so an older SDK (which does not report it) still works — it simply loses
|
|
95
|
+
* the desktop-specific timeout diagnosis rather than breaking.
|
|
96
|
+
*/
|
|
97
|
+
applyHealth(hidden, focused, runtime, engine) {
|
|
87
98
|
this.#hidden = hidden;
|
|
88
99
|
this.#focused = focused;
|
|
100
|
+
if (runtime === 'electron' || runtime === 'tauri' || runtime === 'web') {
|
|
101
|
+
this.#runtime = runtime;
|
|
102
|
+
}
|
|
103
|
+
if (engine !== undefined)
|
|
104
|
+
this.#engine = engine;
|
|
105
|
+
}
|
|
106
|
+
/** The shell (web/electron/tauri) and rendering engine the SDK reported. Undefined on an older SDK. */
|
|
107
|
+
get runtime() {
|
|
108
|
+
return this.#runtime;
|
|
109
|
+
}
|
|
110
|
+
get engine() {
|
|
111
|
+
return this.#engine;
|
|
89
112
|
}
|
|
90
113
|
/** Throttled if the tab is hidden OR we have not heard from it recently. */
|
|
91
114
|
throttled() {
|
|
@@ -120,14 +143,14 @@ export class Session {
|
|
|
120
143
|
if (this.staleMs() > SESSION_LEASE.STALE_AFTER_MS) {
|
|
121
144
|
base.stale = true;
|
|
122
145
|
base.cleanup_suggestion =
|
|
123
|
-
'Call
|
|
146
|
+
'Call reticle_session{action:"end"} to free this session before starting new work.';
|
|
124
147
|
}
|
|
125
148
|
// Surface human bug reports in reticle_sessions (only when > 0, so a clean session adds nothing).
|
|
126
149
|
const marks = this.#review.pendingCount();
|
|
127
150
|
if (marks > 0) {
|
|
128
151
|
base.pendingMarks = marks;
|
|
129
152
|
const s = marks === 1 ? '' : 's';
|
|
130
|
-
base.review_suggestion = `The human flagged ${String(marks)} issue${s} on this tab — call
|
|
153
|
+
base.review_suggestion = `The human flagged ${String(marks)} issue${s} on this tab — call reticle_session{action:"review"} to see and fix ${marks === 1 ? 'it' : 'them'}.`;
|
|
131
154
|
}
|
|
132
155
|
return base;
|
|
133
156
|
}
|
|
@@ -138,10 +161,15 @@ export class Session {
|
|
|
138
161
|
/** Re-stamp an incoming event with server-relative time, buffer it, and fan out. */
|
|
139
162
|
pushEvent(event, byteSize) {
|
|
140
163
|
if (event.type === EventType.PAGE_HEALTH) {
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
164
|
+
const r = readHealthEvent(event.data);
|
|
165
|
+
this.applyHealth(r.hidden ?? this.#hidden, r.focused ?? this.#focused, r.runtime, r.engine);
|
|
166
|
+
}
|
|
167
|
+
// The in-page half of Reticle reporting its own failure — recorded like a tool error
|
|
168
|
+
// (fingerprinted, variables stripped) so a broken observer is as visible as a broken tool.
|
|
169
|
+
if (event.type === EventType.SDK_FAILED) {
|
|
170
|
+
const sdk = parseEventPayload(EventType.SDK_FAILED, event.data);
|
|
171
|
+
if (sdk.success)
|
|
172
|
+
recordSdkFailure(sdk.data);
|
|
145
173
|
}
|
|
146
174
|
if (event.type === EventType.HUMAN_CONTROL) {
|
|
147
175
|
// Narrow unknown at the boundary; an invalid/unknown control is ignored (never thrown).
|
|
@@ -178,7 +206,17 @@ export class Session {
|
|
|
178
206
|
for (const listener of this.#listeners)
|
|
179
207
|
listener(attributed);
|
|
180
208
|
}
|
|
181
|
-
|
|
209
|
+
// Passthroughs to ObservedState, which owns the per-session facts that must SURVIVE buffer
|
|
210
|
+
// eviction: refs the agent drove, and what the layer could not see. See observed-state.ts.
|
|
211
|
+
recordActedRef(ref) {
|
|
212
|
+
this.#observed.recordActedRef(ref);
|
|
213
|
+
}
|
|
214
|
+
actedRefs() {
|
|
215
|
+
return this.#observed.actedRefs();
|
|
216
|
+
}
|
|
217
|
+
noteRateLimited(dropped) {
|
|
218
|
+
this.#observed.noteRateLimited(dropped);
|
|
219
|
+
}
|
|
182
220
|
blindSpots() {
|
|
183
221
|
return this.#observed.blindSpots();
|
|
184
222
|
}
|
|
@@ -241,24 +279,12 @@ export class Session {
|
|
|
241
279
|
return this.#buffer.since(cursor);
|
|
242
280
|
}
|
|
243
281
|
/**
|
|
244
|
-
*
|
|
245
|
-
*
|
|
282
|
+
* What the most recent act was: its cursor, its source, and what it changed inside its target.
|
|
283
|
+
*
|
|
284
|
+
* Exposed as the object rather than six pass-through methods — act writes to it and observe reads
|
|
285
|
+
* from it, and the split between those two tool calls is the whole reason it exists.
|
|
246
286
|
*/
|
|
247
|
-
|
|
248
|
-
this.#lastActCursor = cursor;
|
|
249
|
-
}
|
|
250
|
-
/** The cursor of the last act, or undefined if nothing has acted yet. */
|
|
251
|
-
lastActCursor() {
|
|
252
|
-
return this.#lastActCursor;
|
|
253
|
-
}
|
|
254
|
-
/** Remember where the last acted control is written (`file:line`), for failures with no element. */
|
|
255
|
-
markActSource(source) {
|
|
256
|
-
this.#lastActSource = source;
|
|
257
|
-
}
|
|
258
|
-
/** Where the last acted control is written, or undefined if nothing has acted yet. */
|
|
259
|
-
lastActSource() {
|
|
260
|
-
return this.#lastActSource;
|
|
261
|
-
}
|
|
287
|
+
lastAct = new LastAct();
|
|
262
288
|
// ── Server-authoritative liveness (immune to browser-tab throttling) ──────────────
|
|
263
289
|
/**
|
|
264
290
|
* Stamp the wall-clock of the latest AGENT command (called whenever a tool resolves this session).
|
|
@@ -309,8 +335,16 @@ export class Session {
|
|
|
309
335
|
}
|
|
310
336
|
/** Send a command to the browser and await its reply (or time out). */
|
|
311
337
|
command(name, args = {}, timeoutMs = DEFAULT_COMMAND_TIMEOUT_MS) {
|
|
312
|
-
this
|
|
313
|
-
|
|
338
|
+
// Recorded HERE rather than at the tool call sites: this is the one place every driven action
|
|
339
|
+
// passes through, so act_sequence and flow replay count too. Doing it per-tool missed both, and
|
|
340
|
+
// an under-counted "exercised" reports worse coverage than reality — the safe direction, but
|
|
341
|
+
// still wrong, and it made the number depend on which tool the agent happened to use.
|
|
342
|
+
if (name === ReticleCommand.ACT) {
|
|
343
|
+
const ref = args['ref'];
|
|
344
|
+
if (typeof ref === 'string')
|
|
345
|
+
this.recordActedRef(ref);
|
|
346
|
+
}
|
|
347
|
+
const id = this.#pending.nextId(COMMAND_ID_PREFIX);
|
|
314
348
|
const payload = JSON.stringify({
|
|
315
349
|
kind: MessageKind.COMMAND,
|
|
316
350
|
id,
|
|
@@ -318,30 +352,24 @@ export class Session {
|
|
|
318
352
|
name,
|
|
319
353
|
args,
|
|
320
354
|
});
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
this
|
|
327
|
-
this.#
|
|
328
|
-
});
|
|
355
|
+
// The timeout message is built LAZILY: health can change while a command is in flight, and the
|
|
356
|
+
// diagnosis should describe the page as it was when the command actually gave up.
|
|
357
|
+
const awaited = this.#pending.track(id, timeoutMs, () => commandTimeoutMessage(name, timeoutMs, {
|
|
358
|
+
url: this.url,
|
|
359
|
+
hidden: this.#hidden,
|
|
360
|
+
lastSeenMs: this.lastSeenMs(),
|
|
361
|
+
...(this.#runtime === undefined ? {} : { runtime: this.#runtime }),
|
|
362
|
+
}));
|
|
363
|
+
this.#socket.send(payload);
|
|
364
|
+
const sentAt = Date.now(); // browser-leg timing; see recordBrowserLatency for why it is split out
|
|
365
|
+
return awaited.finally(() => recordBrowserLatency(Date.now() - sentAt));
|
|
329
366
|
}
|
|
330
367
|
handleResult(result) {
|
|
331
|
-
|
|
332
|
-
if (pending === undefined)
|
|
333
|
-
return;
|
|
334
|
-
clearTimeout(pending.timer);
|
|
335
|
-
this.#pending.delete(result.id);
|
|
336
|
-
pending.resolve(result);
|
|
368
|
+
this.#pending.settle(result);
|
|
337
369
|
}
|
|
338
370
|
/** Reject everything still in flight — used on disconnect. */
|
|
339
371
|
rejectAll(reason) {
|
|
340
|
-
|
|
341
|
-
clearTimeout(pending.timer);
|
|
342
|
-
pending.reject(new Error(reason));
|
|
343
|
-
this.#pending.delete(id);
|
|
344
|
-
}
|
|
372
|
+
this.#pending.rejectAll(reason);
|
|
345
373
|
}
|
|
346
374
|
/** End this transport without letting a stale socket remove its replacement session. */
|
|
347
375
|
disconnect(reason) {
|
|
@@ -424,20 +452,12 @@ export class Session {
|
|
|
424
452
|
pushNarration(text) {
|
|
425
453
|
this.#post(ReticleCommand.NARRATE, { text, level: 'info' });
|
|
426
454
|
}
|
|
427
|
-
/**
|
|
428
|
-
* Returns the one-time session lease block on the very first agent command, then undefined
|
|
429
|
-
* forever after. The lease carries an IMPORTANT reminder to call reticle_end_session. Coding agents
|
|
430
|
-
* (Claude Code, Codex) read tool results — they will see this and remember to clean up.
|
|
431
|
-
*/
|
|
455
|
+
/** The one-time lease block on the first agent command, then undefined forever after. */
|
|
432
456
|
takeSessionLease() {
|
|
433
457
|
if (this.#firstCommandDone)
|
|
434
458
|
return undefined;
|
|
435
459
|
this.#firstCommandDone = true;
|
|
436
|
-
return
|
|
437
|
-
sessionId: this.id,
|
|
438
|
-
opened_at: this.#startedAt,
|
|
439
|
-
IMPORTANT: 'MANDATORY: the moment you stop driving — finishing a reply or waiting on the human — call reticle_session {action:"yield", mode:"waiting"} (or mode:"ask" with your question) so the panel never falsely reads "live". Call reticle_session {action:"end"} only when the whole task is done. The session revives on your next action.',
|
|
440
|
-
};
|
|
460
|
+
return buildSessionLease(this.id, this.#startedAt);
|
|
441
461
|
}
|
|
442
462
|
/**
|
|
443
463
|
* Returns a human-readable age warning after SESSION_LEASE.WARN_AFTER_MS (10 min), else undefined.
|
|
@@ -449,14 +469,24 @@ export class Session {
|
|
|
449
469
|
if (ageMs < SESSION_LEASE.WARN_AFTER_MS)
|
|
450
470
|
return undefined;
|
|
451
471
|
const minutes = Math.floor(ageMs / 60_000);
|
|
452
|
-
return `Session ${this.id} has been open for ${String(minutes)} minutes. If your task is complete, call
|
|
472
|
+
return `Session ${this.id} has been open for ${String(minutes)} minutes. If your task is complete, call reticle_session{action:"end"} now.`;
|
|
453
473
|
}
|
|
454
474
|
/** Fire-and-forget command send — NOT registered in #pending (no correlated result expected). */
|
|
455
475
|
#post(name, args) {
|
|
456
476
|
if (this.#socket.readyState !== WS_OPEN)
|
|
457
477
|
return;
|
|
458
|
-
|
|
459
|
-
|
|
478
|
+
// Shares the same counter as tracked commands, so a fire-and-forget id can never collide with
|
|
479
|
+
// one that IS awaiting a reply.
|
|
480
|
+
// Recorded HERE rather than at the tool call sites: this is the one place every driven action
|
|
481
|
+
// passes through, so act_sequence and flow replay count too. Doing it per-tool missed both, and
|
|
482
|
+
// an under-counted "exercised" reports worse coverage than reality — the safe direction, but
|
|
483
|
+
// still wrong, and it made the number depend on which tool the agent happened to use.
|
|
484
|
+
if (name === ReticleCommand.ACT) {
|
|
485
|
+
const ref = args['ref'];
|
|
486
|
+
if (typeof ref === 'string')
|
|
487
|
+
this.recordActedRef(ref);
|
|
488
|
+
}
|
|
489
|
+
const id = this.#pending.nextId(COMMAND_ID_PREFIX);
|
|
460
490
|
const payload = JSON.stringify({
|
|
461
491
|
kind: MessageKind.COMMAND,
|
|
462
492
|
id,
|
|
@@ -478,4 +508,3 @@ export class Session {
|
|
|
478
508
|
* units under the file-size cap.
|
|
479
509
|
*/
|
|
480
510
|
export { SessionManager } from './session-manager.js';
|
|
481
|
-
//# sourceMappingURL=session.js.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which flags and parameters people actually use — WITHOUT ever sending what they set them to.
|
|
3
|
+
*
|
|
4
|
+
* This is the most dangerous data in the product to collect, and the split that makes it safe is
|
|
5
|
+
* NAMES versus VALUES:
|
|
6
|
+
*
|
|
7
|
+
* - A flag or parameter NAME comes from a closed vocabulary we wrote ourselves. `--headed`,
|
|
8
|
+
* `--port`, `ref`, `timeout_ms` — there are a few dozen, none of them describe the user, and
|
|
9
|
+
* knowing which ones get used is the whole product question ("is anyone passing `fullPage`?
|
|
10
|
+
* does anybody use `--storage-state`?").
|
|
11
|
+
* - A VALUE is the user's. `--http-token` holds a secret. `--drive` holds a URL. `reticle_act`'s
|
|
12
|
+
* `args` holds the text being typed into the app, which on a login form is a password. A rule
|
|
13
|
+
* like "send short values, they're probably enums" would leak all three.
|
|
14
|
+
*
|
|
15
|
+
* So values are never sent, with one narrow exception: a handful of parameters whose values ARE our
|
|
16
|
+
* own enums, listed explicitly below. `action: "click"` is our vocabulary, not the user's, and it
|
|
17
|
+
* answers a real question. Membership in that list is opt-in per parameter and each entry names the
|
|
18
|
+
* exact values allowed — anything outside the list is reported as `other`, so a schema change can
|
|
19
|
+
* never quietly start forwarding free text.
|
|
20
|
+
*/
|
|
21
|
+
export declare const OTHER_VALUE = "other";
|
|
22
|
+
/** True for anything we are willing to report a value for. */
|
|
23
|
+
export declare function isSafeEnumParam(name: string): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* The reportable form of one parameter: `name` on its own, or `name:value` when the parameter is a
|
|
26
|
+
* known enum. Never the raw value of anything else.
|
|
27
|
+
*/
|
|
28
|
+
export declare function describeParam(name: string, value: unknown): string;
|
|
29
|
+
/** Every parameter an agent actually passed to one tool call, reduced to names (+ safe enums). */
|
|
30
|
+
export declare function describeToolParams(args: Record<string, unknown>): string[];
|
|
31
|
+
/**
|
|
32
|
+
* The flags PRESENT on a CLI invocation, by name only.
|
|
33
|
+
*
|
|
34
|
+
* Values are dropped without exception here — no enum allowlist — because the CLI's flag values are
|
|
35
|
+
* uniformly the user's: a port, a URL, a file path, a pairing token. `--http-token` alone is reason
|
|
36
|
+
* enough to make this rule absolute rather than case-by-case.
|
|
37
|
+
*
|
|
38
|
+
* Anything not starting with `--` is an argument, not a flag, and is dropped entirely: that is where
|
|
39
|
+
* the URL, the file list, and the feedback message live.
|
|
40
|
+
*/
|
|
41
|
+
export declare function describeCliFlags(argv: readonly string[]): string[];
|