@reticlehq/server 2.3.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/SKILL.md +702 -0
- package/dist/bridge/auth-failure-reason.d.ts +19 -0
- package/dist/bridge/auth-failure-reason.js +29 -0
- package/dist/{bridge-security.d.ts → bridge/bridge-security.d.ts} +1 -1
- package/dist/{bridge-security.js → bridge/bridge-security.js} +1 -1
- package/dist/{bridge.d.ts → bridge/bridge.d.ts} +1 -1
- package/dist/{bridge.js → bridge/bridge.js} +105 -15
- package/dist/{bridge.test-harness.d.ts → bridge/bridge.test-harness.d.ts} +6 -11
- package/dist/{bridge.test-harness.js → bridge/bridge.test-harness.js} +21 -9
- package/dist/{pairing-token.js → bridge/pairing-token.js} +1 -1
- package/dist/capsule/capsule-store.d.ts +8 -3
- package/dist/capsule/capsule-store.js +7 -2
- package/dist/capsule/capsule.js +3 -3
- package/dist/capsule/causal-summary.d.ts +8 -0
- package/dist/capsule/causal-summary.js +22 -12
- package/dist/capsule/divergence.d.ts +9 -4
- package/dist/capsule/divergence.js +8 -8
- package/dist/capsule/predicate-to-links.js +11 -8
- package/dist/{cli-doctor.js → cli/cli-doctor.js} +9 -2
- package/dist/{cli-flow-commands.d.ts → cli/cli-flow-commands.d.ts} +2 -2
- package/dist/{cli-flow-commands.js → cli/cli-flow-commands.js} +15 -15
- package/dist/{cli-launch.d.ts → cli/cli-launch.d.ts} +32 -3
- package/dist/cli/cli-launch.js +171 -0
- package/dist/cli/cli-parse.d.ts +143 -0
- package/dist/{cli-parse.js → cli/cli-parse.js} +146 -65
- package/dist/{cli-port.d.ts → cli/cli-port.d.ts} +15 -0
- package/dist/{cli-port.js → cli/cli-port.js} +29 -8
- package/dist/cli/cli-update-commands.d.ts +4 -0
- package/dist/cli/cli-update-commands.js +93 -0
- package/dist/{cli-verify.js → cli/cli-verify.js} +14 -14
- package/dist/{cloud-cli.js → cli/cloud-cli.js} +29 -24
- package/dist/cli.d.ts +2 -2
- package/dist/cli.js +182 -93
- package/dist/cloud/cloud-config.d.ts +0 -1
- package/dist/cloud/cloud-config.js +9 -9
- package/dist/cloud/cloud-sync.d.ts +1 -7
- package/dist/cloud/cloud-sync.js +12 -12
- package/dist/crawl/crawl-empty.d.ts +16 -0
- package/dist/crawl/crawl-empty.js +24 -0
- package/dist/crawl/crawl-tools.js +4 -1
- package/dist/crawl/crawl.js +26 -7
- package/dist/daemon/daemon-resilience.d.ts +49 -0
- package/dist/daemon/daemon-resilience.js +191 -0
- package/dist/daemon/daemon-usefulness.d.ts +61 -0
- package/dist/daemon/daemon-usefulness.js +62 -0
- package/dist/{daemon.d.ts → daemon/daemon.d.ts} +33 -8
- package/dist/{daemon.js → daemon/daemon.js} +80 -48
- package/dist/daemon/idle-grace.d.ts +32 -0
- package/dist/daemon/idle-grace.js +41 -0
- package/dist/{idle-shutdown.d.ts → daemon/idle-shutdown.d.ts} +13 -0
- package/dist/{idle-shutdown.js → daemon/idle-shutdown.js} +27 -4
- package/dist/domain/domain-model.js +2 -2
- package/dist/events/body-failures.js +8 -8
- package/dist/events/contradictions.d.ts +1 -1
- package/dist/events/contradictions.js +60 -10
- package/dist/events/echo-mismatch.js +10 -10
- package/dist/events/event-filters.js +6 -6
- package/dist/events/json-salvage.d.ts +2 -1
- package/dist/events/json-salvage.js +6 -6
- package/dist/events/observed-in-window.d.ts +12 -0
- package/dist/events/observed-in-window.js +21 -0
- package/dist/events/predicate-eval.d.ts +43 -20
- package/dist/events/predicate-eval.js +159 -55
- package/dist/events/predicate.d.ts +2 -2
- package/dist/events/predicate.js +112 -35
- package/dist/events/reconcile.js +5 -5
- package/dist/events/ring-buffer.js +1 -1
- package/dist/events/stale-response.js +6 -6
- package/dist/events/testid-near-miss.d.ts +22 -0
- package/dist/events/testid-near-miss.js +33 -0
- package/dist/events/unit-mismatch.js +8 -8
- package/dist/flows/affected-tools.js +19 -4
- package/dist/flows/affected.js +1 -1
- package/dist/flows/annotate-target.d.ts +1 -0
- package/dist/flows/annotate-target.js +20 -0
- package/dist/flows/annotate-tools.js +25 -3
- package/dist/flows/annotate.js +17 -4
- package/dist/flows/assertion-integrity.d.ts +2 -1
- package/dist/flows/assertion-tiers-store.d.ts +3 -66
- package/dist/flows/assertion-tiers-store.js +2 -2
- package/dist/flows/attributed-failure.d.ts +17 -0
- package/dist/flows/attributed-failure.js +20 -0
- package/dist/flows/buddy-status.d.ts +2 -1
- package/dist/flows/buddy-status.js +2 -2
- package/dist/flows/coverage.d.ts +3 -2
- package/dist/flows/coverage.js +2 -2
- package/dist/flows/decision.d.ts +0 -6
- package/dist/flows/decision.js +64 -8
- package/dist/flows/empty-flow.d.ts +6 -0
- package/dist/flows/empty-flow.js +24 -0
- package/dist/flows/flake-store.d.ts +0 -1
- package/dist/flows/flake-store.js +1 -1
- package/dist/flows/flake.d.ts +2 -1
- package/dist/flows/flake.js +2 -2
- package/dist/flows/flow-classify.js +12 -0
- package/dist/flows/flow-replay-run.js +4 -4
- package/dist/flows/flow-replay.d.ts +5 -7
- package/dist/flows/flow-replay.js +114 -47
- package/dist/flows/flow-report.js +1 -1
- package/dist/flows/flow-scope.d.ts +1 -6
- package/dist/flows/flow-step-runners.d.ts +26 -6
- package/dist/flows/flow-step-runners.js +157 -6
- package/dist/flows/flow-success.js +20 -15
- package/dist/flows/flow-tools.js +67 -13
- package/dist/flows/flows.js +15 -11
- package/dist/flows/gate.d.ts +4 -3
- package/dist/flows/gate.js +1 -1
- package/dist/flows/heal-run.d.ts +0 -8
- package/dist/flows/heal-run.js +5 -5
- package/dist/flows/heal.js +3 -3
- package/dist/flows/predicate-to-expect.d.ts +38 -0
- package/dist/flows/predicate-to-expect.js +95 -0
- package/dist/flows/replay.d.ts +16 -1
- package/dist/flows/replay.js +58 -22
- package/dist/flows/role-anchor-nearest.d.ts +6 -0
- package/dist/flows/role-anchor-nearest.js +45 -0
- package/dist/flows/server-verify.d.ts +1 -1
- package/dist/flows/server-verify.js +5 -5
- package/dist/flows/verify-change-tools.js +32 -10
- package/dist/flows/verify-change-verdict.d.ts +15 -0
- package/dist/flows/verify-change-verdict.js +25 -0
- package/dist/flows/watch-batcher.d.ts +3 -2
- package/dist/honesty/already-true.d.ts +2 -0
- package/dist/honesty/already-true.js +31 -0
- package/dist/honesty/blind-spots.d.ts +16 -3
- package/dist/honesty/blind-spots.js +24 -12
- package/dist/honesty/honesty.d.ts +3 -2
- package/dist/honesty/honesty.js +4 -4
- package/dist/honesty/uncaptured-bodies.js +1 -1
- package/dist/honesty/unread-outcome.js +2 -2
- package/dist/honesty/verified.d.ts +22 -3
- package/dist/honesty/verified.js +48 -8
- package/dist/http-server.js +14 -7
- package/dist/hunt/hunt-report.d.ts +2 -1
- package/dist/hunt/hunt-report.js +2 -2
- package/dist/index.d.ts +8 -6
- package/dist/index.js +32 -25
- package/dist/init/agent-rules.d.ts +2 -1
- package/dist/init/agent-rules.js +45 -7
- package/dist/init/app-choice.d.ts +20 -0
- package/dist/init/app-choice.js +25 -0
- package/dist/init/astro-host.d.ts +21 -0
- package/dist/init/astro-host.js +27 -0
- package/dist/init/astro-patch.d.ts +16 -0
- package/dist/init/astro-patch.js +240 -0
- package/dist/init/capabilities.d.ts +17 -0
- package/dist/init/capabilities.js +54 -0
- package/dist/init/cra.d.ts +37 -0
- package/dist/init/cra.js +90 -0
- package/dist/init/cursor.js +39 -4
- package/dist/init/desktop-doctor.d.ts +3 -2
- package/dist/init/desktop-doctor.js +4 -4
- package/dist/init/detect.d.ts +26 -0
- package/dist/init/detect.js +78 -5
- package/dist/init/mcp-registered.d.ts +12 -0
- package/dist/init/mcp-registered.js +14 -0
- package/dist/init/mcp.d.ts +27 -2
- package/dist/init/mcp.js +40 -4
- package/dist/init/next-patch.d.ts +39 -0
- package/dist/init/next-patch.js +196 -0
- package/dist/init/node-io.js +48 -6
- package/dist/init/patch-kind.d.ts +20 -0
- package/dist/init/patch-kind.js +10 -0
- package/dist/init/plan-framework.d.ts +50 -0
- package/dist/init/plan-framework.js +341 -0
- package/dist/init/plan.d.ts +119 -6
- package/dist/init/plan.js +230 -131
- package/dist/init/project-id.d.ts +5 -9
- package/dist/init/project-id.js +10 -22
- package/dist/init/run.d.ts +22 -0
- package/dist/init/run.js +393 -28
- package/dist/init/slash-command.d.ts +27 -0
- package/dist/init/slash-command.js +61 -0
- package/dist/init/snippets.d.ts +41 -3
- package/dist/init/snippets.js +185 -10
- package/dist/init/vite-config.d.ts +4 -10
- package/dist/init/vite-config.js +15 -7
- package/dist/init/workspace-apps.d.ts +23 -0
- package/dist/init/workspace-apps.js +68 -0
- package/dist/input/driven-redaction.d.ts +15 -0
- package/dist/input/driven-redaction.js +76 -0
- package/dist/input/network-detail.d.ts +9 -3
- package/dist/input/network-detail.js +43 -23
- package/dist/input/network-mock-tools.js +2 -2
- package/dist/input/network-mock.js +4 -4
- package/dist/input/real-input.js +8 -3
- package/dist/input/scroll-find.js +2 -2
- package/dist/input/scroll-tools.d.ts +0 -5
- package/dist/input/scroll-tools.js +11 -4
- package/dist/input/viewport-tools.js +2 -2
- package/dist/journal/ambient-store.d.ts +0 -2
- package/dist/journal/ambient-store.js +1 -1
- package/dist/journal/ambient.js +1 -1
- package/dist/journal/attach-journal.d.ts +2 -1
- package/dist/journal/deviation-report.js +6 -6
- package/dist/journal/deviation-service.js +1 -1
- package/dist/journal/envelope-store.d.ts +0 -2
- package/dist/journal/envelope-store.js +1 -1
- package/dist/journal/envelope.d.ts +2 -3
- package/dist/journal/envelope.js +3 -3
- package/dist/journal/journal-query.js +1 -1
- package/dist/journal/journal-recorder.d.ts +2 -1
- package/dist/journal/journal-recorder.js +2 -2
- package/dist/journal/rollups.js +9 -9
- package/dist/journal/session-end.d.ts +2 -1
- package/dist/journal/session-journal.js +4 -4
- package/dist/license/license.d.ts +0 -14
- package/dist/license/license.js +8 -8
- package/dist/log.d.ts +10 -0
- package/dist/log.js +11 -1
- package/dist/mcp/mcp-is-error.d.ts +13 -0
- package/dist/mcp/mcp-is-error.js +18 -0
- package/dist/mcp/mcp-outage.d.ts +31 -0
- package/dist/mcp/mcp-outage.js +48 -0
- package/dist/mcp/mcp-proxy.d.ts +124 -0
- package/dist/mcp/mcp-proxy.js +697 -0
- package/dist/{mcp.d.ts → mcp/mcp.d.ts} +13 -10
- package/dist/{mcp.js → mcp/mcp.js} +110 -35
- package/dist/mcp/proxy-handshake.d.ts +3 -0
- package/dist/mcp/proxy-handshake.js +54 -0
- package/dist/mcp/proxy-lifecycle.d.ts +64 -0
- package/dist/mcp/proxy-lifecycle.js +70 -0
- package/dist/mcp/tool-catalog-cache.d.ts +29 -0
- package/dist/mcp/tool-catalog-cache.js +55 -0
- package/dist/oracles/propose-consequences.d.ts +2 -1
- package/dist/oracles/propose-consequences.js +16 -11
- package/dist/oracles/self-instrument.d.ts +2 -1
- package/dist/oracles/self-instrument.js +1 -1
- package/dist/phenomena/phenomena.js +3 -3
- package/dist/platform.d.ts +16 -0
- package/dist/platform.js +16 -0
- package/dist/pool/playwright-launcher.d.ts +15 -2
- package/dist/pool/playwright-launcher.js +21 -2
- package/dist/project/fs-port.js +1 -1
- package/dist/project/project-tools.js +2 -2
- package/dist/runs/build-verification-run.js +1 -1
- package/dist/runs/repair-prompt.d.ts +0 -6
- package/dist/runs/repair-prompt.js +3 -3
- package/dist/runs/risk-classify.js +1 -1
- package/dist/runs/run-diff.d.ts +0 -2
- package/dist/runs/run-diff.js +3 -3
- package/dist/runs/run-tools.js +2 -2
- package/dist/runs/verification-sync.js +2 -2
- package/dist/runs/verify-http.js +1 -1
- package/dist/runs/verify-server.js +1 -1
- package/dist/session/command-timeout.d.ts +11 -3
- package/dist/session/command-timeout.js +2 -2
- package/dist/session/control-envelope.d.ts +6 -0
- package/dist/session/control-envelope.js +7 -1
- package/dist/session/dev-server-probe.d.ts +13 -0
- package/dist/session/dev-server-probe.js +52 -0
- package/dist/session/last-act.d.ts +17 -3
- package/dist/session/last-act.js +16 -4
- package/dist/session/live-control-tools.js +7 -2
- package/dist/session/live-control.js +1 -1
- package/dist/session/looks-like-dev-server.d.ts +14 -0
- package/dist/session/looks-like-dev-server.js +25 -0
- package/dist/session/no-session-diagnosis.d.ts +38 -0
- package/dist/session/no-session-diagnosis.js +70 -0
- package/dist/session/no-session-watch.d.ts +19 -0
- package/dist/session/no-session-watch.js +61 -0
- package/dist/session/observed-state.d.ts +4 -0
- package/dist/session/observed-state.js +19 -1
- package/dist/session/output-budget.js +1 -1
- package/dist/session/session-health.d.ts +8 -1
- package/dist/session/session-health.js +8 -7
- package/dist/session/session-info.d.ts +26 -7
- package/dist/session/session-info.js +42 -1
- package/dist/session/session-lease.d.ts +0 -11
- package/dist/session/session-lease.js +1 -1
- package/dist/session/session-manager.d.ts +3 -0
- package/dist/session/session-manager.js +58 -9
- package/dist/session/session-readiness.d.ts +1 -1
- package/dist/session/session-readiness.js +6 -1
- package/dist/session/session-reaper.js +1 -1
- package/dist/session/session-reconnect.d.ts +32 -0
- package/dist/session/session-reconnect.js +42 -0
- package/dist/session/session.d.ts +20 -2
- package/dist/session/session.js +76 -26
- package/dist/session/state-select.d.ts +1 -1
- package/dist/session/state-select.js +1 -1
- package/dist/status-payload.d.ts +19 -0
- package/dist/status-payload.js +11 -0
- package/dist/telemetry/argument-shape.js +10 -1
- package/dist/telemetry/browser-mode.d.ts +27 -0
- package/dist/telemetry/browser-mode.js +33 -0
- package/dist/telemetry/bug-found.d.ts +17 -21
- package/dist/telemetry/bug-found.js +120 -8
- package/dist/telemetry/cli-telemetry.d.ts +2 -12
- package/dist/telemetry/cli-telemetry.js +27 -4
- package/dist/telemetry/daemon-telemetry.d.ts +19 -0
- package/dist/telemetry/daemon-telemetry.js +12 -2
- package/dist/telemetry/dev-repo.js +4 -4
- package/dist/telemetry/error-fingerprint.js +21 -2
- package/dist/telemetry/feedback-cli.d.ts +1 -1
- package/dist/telemetry/feedback-cli.js +4 -4
- package/dist/telemetry/feedback-context.d.ts +22 -0
- package/dist/telemetry/feedback-context.js +41 -1
- package/dist/telemetry/feedback-delivery.d.ts +20 -0
- package/dist/telemetry/feedback-delivery.js +30 -0
- package/dist/telemetry/feedback-outbox.d.ts +22 -0
- package/dist/telemetry/feedback-outbox.js +87 -0
- package/dist/telemetry/feedback.d.ts +22 -1
- package/dist/telemetry/feedback.js +67 -8
- package/dist/telemetry/git-facts.js +1 -1
- package/dist/telemetry/session-metrics.d.ts +2 -0
- package/dist/telemetry/session-metrics.js +68 -6
- package/dist/telemetry/telemetry.d.ts +27 -2
- package/dist/telemetry/telemetry.js +119 -29
- package/dist/telemetry/verification-of.d.ts +22 -0
- package/dist/telemetry/verification-of.js +84 -0
- package/dist/tools/act-capsule.js +2 -2
- package/dist/tools/act-danger.d.ts +12 -0
- package/dist/tools/act-danger.js +20 -3
- package/dist/tools/act-helpers.js +4 -4
- package/dist/tools/act-tools.d.ts +0 -8
- package/dist/tools/act-tools.js +84 -115
- package/dist/tools/act-view.js +7 -7
- package/dist/tools/alias-args.d.ts +17 -0
- package/dist/tools/alias-args.js +25 -0
- package/dist/tools/assert-grade.js +9 -9
- package/dist/tools/assert-verdict.d.ts +3 -1
- package/dist/tools/assert-verdict.js +8 -5
- package/dist/tools/browser-tools.js +30 -11
- package/dist/tools/contract-tools.js +1 -1
- package/dist/tools/coverage-identity.d.ts +34 -0
- package/dist/tools/coverage-identity.js +46 -0
- package/dist/tools/coverage-tools.js +10 -14
- package/dist/tools/dynamic-tools.d.ts +2 -1
- package/dist/tools/dynamic-tools.js +90 -18
- package/dist/tools/error-recovery.d.ts +20 -2
- package/dist/tools/error-recovery.js +179 -4
- package/dist/tools/feedback-tools.d.ts +12 -1
- package/dist/tools/feedback-tools.js +28 -5
- package/dist/tools/invoke-tool.d.ts +0 -6
- package/dist/tools/invoke-tool.js +57 -32
- package/dist/tools/lease-hint.d.ts +17 -0
- package/dist/tools/lease-hint.js +24 -0
- package/dist/tools/lease-tools.js +6 -5
- package/dist/tools/merge-tools.d.ts +10 -1
- package/dist/tools/merge-tools.js +9 -3
- package/dist/tools/merged-name-redirect.d.ts +13 -0
- package/dist/tools/merged-name-redirect.js +55 -0
- package/dist/tools/navigate-result.d.ts +17 -0
- package/dist/tools/navigate-result.js +31 -0
- package/dist/tools/observe-tools.js +54 -20
- package/dist/tools/observed-nothing.d.ts +25 -0
- package/dist/tools/observed-nothing.js +33 -0
- package/dist/tools/query-paginate.js +2 -2
- package/dist/tools/query-shape.d.ts +18 -0
- package/dist/tools/query-shape.js +39 -0
- package/dist/tools/read-tools.js +85 -20
- package/dist/tools/real-input-attempt.d.ts +28 -0
- package/dist/tools/real-input-attempt.js +88 -0
- package/dist/tools/reconcile-tools.js +7 -7
- package/dist/tools/reload-result.d.ts +14 -0
- package/dist/tools/reload-result.js +29 -0
- package/dist/tools/snapshot-delta.d.ts +4 -5
- package/dist/tools/snapshot-delta.js +0 -0
- package/dist/tools/tool-kit.d.ts +8 -0
- package/dist/tools/tool-surface.d.ts +83 -0
- package/dist/tools/tool-surface.js +204 -0
- package/dist/tools/tools-helpers.js +6 -6
- package/dist/tools/tools.d.ts +15 -0
- package/dist/tools/tools.js +53 -17
- package/dist/tools/unadvertised-help.d.ts +5 -0
- package/dist/tools/unadvertised-help.js +39 -0
- package/dist/trace.d.ts +69 -0
- package/dist/trace.js +150 -0
- package/dist/update/nudge-credit.d.ts +4 -0
- package/dist/update/nudge-credit.js +53 -0
- package/dist/update/sdk-sync.d.ts +21 -0
- package/dist/update/sdk-sync.js +42 -0
- package/dist/update/update-checker.js +3 -3
- package/dist/update/update-nudge.d.ts +63 -6
- package/dist/update/update-nudge.js +128 -15
- package/dist/update/updater.d.ts +1 -9
- package/dist/update/updater.js +13 -8
- package/dist/version/peer-announce.d.ts +4 -0
- package/dist/version/peer-announce.js +30 -0
- package/dist/{server-version.js → version/server-version.js} +5 -1
- package/dist/version/version-nudge.d.ts +28 -0
- package/dist/version/version-nudge.js +40 -0
- package/dist/version/version-skew.d.ts +66 -0
- package/dist/version/version-skew.js +71 -0
- package/dist/visual/visual-diff.js +2 -2
- package/dist/visual/visual-tools.js +4 -4
- package/docs/agent-cheatsheet.md +85 -0
- package/docs/architecture.md +113 -0
- package/docs/benchmarks.md +255 -0
- package/docs/debugging.md +102 -0
- package/docs/deploy-checks.md +69 -0
- package/docs/desktop-apps.md +256 -0
- package/docs/enterprise.md +62 -0
- package/docs/fixtures.md +28 -0
- package/docs/flows.md +166 -0
- package/docs/getting-started.md +469 -0
- package/docs/human-control.md +63 -0
- package/docs/integration-patterns.md +171 -0
- package/docs/local-registry.md +126 -0
- package/docs/mint.json +61 -0
- package/docs/multi-agent-testing.md +55 -0
- package/docs/platform-integration.md +122 -0
- package/docs/telemetry-contract.md +214 -0
- package/docs/telemetry.md +184 -0
- package/docs/testing.md +82 -0
- package/docs/token-efficiency.md +80 -0
- package/docs/usage.md +1046 -0
- package/package.json +8 -5
- package/dist/cli-launch.js +0 -112
- package/dist/cli-parse.d.ts +0 -140
- package/dist/daemon-resilience.d.ts +0 -22
- package/dist/daemon-resilience.js +0 -85
- package/dist/mcp-proxy.d.ts +0 -35
- package/dist/mcp-proxy.js +0 -190
- package/dist/tools/profiles.d.ts +0 -37
- package/dist/tools/profiles.js +0 -139
- /package/dist/{pairing-token.d.ts → bridge/pairing-token.d.ts} +0 -0
- /package/dist/{token-auth.d.ts → bridge/token-auth.d.ts} +0 -0
- /package/dist/{token-auth.js → bridge/token-auth.js} +0 -0
- /package/dist/{cli-doctor.d.ts → cli/cli-doctor.d.ts} +0 -0
- /package/dist/{cli-verify.d.ts → cli/cli-verify.d.ts} +0 -0
- /package/dist/{cloud-cli.d.ts → cli/cloud-cli.d.ts} +0 -0
- /package/dist/{server-version.d.ts → version/server-version.d.ts} +0 -0
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How each framework gets wired: the Vite plugin, the three Next files, the SvelteKit client hook.
|
|
3
|
+
* Split out of `plan.ts` — that file is the plan's SHAPE (statuses, ordering, the agent/MCP steps),
|
|
4
|
+
* this one is the per-framework detail, and they grow for different reasons.
|
|
5
|
+
*/
|
|
6
|
+
import { patchViteConfig, VitePatchKind } from './vite-config.js';
|
|
7
|
+
import { patchNextConfig, patchRootLayout, patchPagesApp } from './next-patch.js';
|
|
8
|
+
import { patchAstroConfig, patchAstroLayout } from './astro-patch.js';
|
|
9
|
+
import { CRA_DEV_MODULE_IMPORT, CRA_DEV_MODULE_PATH, CRA_ENV_PATH, TOKEN_VAR, craDevModuleFile, craEnvPatch, craImportPatch, } from './cra.js';
|
|
10
|
+
import { PatchKind } from './patch-kind.js';
|
|
11
|
+
import { viteManual, NEXT_LAYOUT_MANUAL, NEXT_LAYOUT_PATH, viteDevModuleFile, VITE_DEV_MODULE_PATH, nextReticleDevFile, NEXT_RETICLE_DEV_PATH, nextConfigManual, svelteKitHooksFile, SVELTEKIT_HOOKS_PATH, UNVERIFIED_FRAMEWORK_NOTE, astroManual, } from './snippets.js';
|
|
12
|
+
import { StepStatus } from './plan.js';
|
|
13
|
+
/** What adding `reticle()` to a Vite config buys, which differs by framework. */
|
|
14
|
+
export const VITE_PLUGIN_DETAIL = {
|
|
15
|
+
/** A plain Vite app gets both halves from the plugin. */
|
|
16
|
+
VITE: 'add reticle() to plugins (also injects connect())',
|
|
17
|
+
/**
|
|
18
|
+
* SvelteKit renders through app.html, so the plugin's HTML injection never fires and connect()
|
|
19
|
+
* comes from the client hook instead. The plugin is still required: it is what stamps
|
|
20
|
+
* data-reticle-source into .svelte components, and without it every verdict on a SvelteKit app
|
|
21
|
+
* comes back with no file:line at all.
|
|
22
|
+
*/
|
|
23
|
+
SVELTEKIT: 'add reticle() to plugins (stamps data-reticle-source in .svelte components)',
|
|
24
|
+
};
|
|
25
|
+
const CAPABILITIES_TITLE = 'Capabilities + store';
|
|
26
|
+
/**
|
|
27
|
+
* The dev module carrying `registerCapabilities` / `registerStore`.
|
|
28
|
+
*
|
|
29
|
+
* Without it every app came up `hasCapabilities: false` with a `reticle_state` holding nothing but
|
|
30
|
+
* `__reticle_renders` — the state-truth read was unavailable on every app out of the box. Written
|
|
31
|
+
* only when absent, because it is the one generated file a user is expected to EDIT.
|
|
32
|
+
*/
|
|
33
|
+
function capabilitiesStep(input) {
|
|
34
|
+
if (true === input.viteDevModuleExists) {
|
|
35
|
+
return [
|
|
36
|
+
{
|
|
37
|
+
title: CAPABILITIES_TITLE,
|
|
38
|
+
target: VITE_DEV_MODULE_PATH,
|
|
39
|
+
status: StepStatus.ALREADY,
|
|
40
|
+
detail: 'file exists — left alone, it is yours to edit',
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
const testids = input.testids ?? [];
|
|
45
|
+
const stores = input.storeHints ?? [];
|
|
46
|
+
const found = testids.length > 0
|
|
47
|
+
? `${String(testids.length)} data-testid values`
|
|
48
|
+
: 'no data-testid values yet';
|
|
49
|
+
return [
|
|
50
|
+
{
|
|
51
|
+
title: CAPABILITIES_TITLE,
|
|
52
|
+
target: VITE_DEV_MODULE_PATH,
|
|
53
|
+
status: StepStatus.APPLY,
|
|
54
|
+
detail: `${found}; ${stores.length > 0 ? `store: uncomment the ${String(stores.length)} suggested line(s)` : 'no state library detected'}`,
|
|
55
|
+
write: { path: VITE_DEV_MODULE_PATH, content: viteDevModuleFile(testids, stores) },
|
|
56
|
+
dependsOnInstall: true,
|
|
57
|
+
},
|
|
58
|
+
];
|
|
59
|
+
}
|
|
60
|
+
export function viteSteps(input, detail = VITE_PLUGIN_DETAIL.VITE) {
|
|
61
|
+
// Capabilities are independent of whether the config needed patching. Attaching them to the APPLY
|
|
62
|
+
// branch meant a re-run on an already-wired app silently never created the module.
|
|
63
|
+
return [...viteConfigSteps(input, detail), ...capabilitiesStep(input)];
|
|
64
|
+
}
|
|
65
|
+
function viteConfigSteps(input, detail) {
|
|
66
|
+
const cfg = input.viteConfig;
|
|
67
|
+
const port = input.options.port;
|
|
68
|
+
if (null === cfg) {
|
|
69
|
+
return [
|
|
70
|
+
{
|
|
71
|
+
title: 'Vite plugin',
|
|
72
|
+
target: 'vite.config',
|
|
73
|
+
status: StepStatus.MANUAL,
|
|
74
|
+
detail: viteManual(port),
|
|
75
|
+
},
|
|
76
|
+
];
|
|
77
|
+
}
|
|
78
|
+
const patch = patchViteConfig(cfg.source, port);
|
|
79
|
+
if (patch.kind === VitePatchKind.ALREADY) {
|
|
80
|
+
return [
|
|
81
|
+
{
|
|
82
|
+
title: 'Vite plugin',
|
|
83
|
+
target: cfg.path,
|
|
84
|
+
status: StepStatus.ALREADY,
|
|
85
|
+
detail: 'reticle() already in plugins',
|
|
86
|
+
},
|
|
87
|
+
];
|
|
88
|
+
}
|
|
89
|
+
if (patch.kind === VitePatchKind.MANUAL) {
|
|
90
|
+
return [
|
|
91
|
+
{
|
|
92
|
+
title: 'Vite plugin',
|
|
93
|
+
target: cfg.path,
|
|
94
|
+
status: StepStatus.MANUAL,
|
|
95
|
+
detail: `${patch.reason}\n\n${viteManual(port)}`,
|
|
96
|
+
},
|
|
97
|
+
];
|
|
98
|
+
}
|
|
99
|
+
return [
|
|
100
|
+
{
|
|
101
|
+
title: 'Vite plugin',
|
|
102
|
+
target: cfg.path,
|
|
103
|
+
status: StepStatus.APPLY,
|
|
104
|
+
detail,
|
|
105
|
+
write: { path: cfg.path, content: patch.code },
|
|
106
|
+
dependsOnInstall: true,
|
|
107
|
+
},
|
|
108
|
+
];
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Turn a conservative source patch into a step: applied when it patched, already when the wiring is
|
|
112
|
+
* there, and the hand-edit instructions when the file shape wasn't one we recognise.
|
|
113
|
+
*/
|
|
114
|
+
function patchStep(title, path, patch, applyDetail, manualDetail) {
|
|
115
|
+
if (patch.kind === PatchKind.ALREADY) {
|
|
116
|
+
return { title, target: path, status: StepStatus.ALREADY, detail: 'already wired' };
|
|
117
|
+
}
|
|
118
|
+
if (patch.kind === PatchKind.MANUAL) {
|
|
119
|
+
return {
|
|
120
|
+
title,
|
|
121
|
+
target: path,
|
|
122
|
+
status: StepStatus.MANUAL,
|
|
123
|
+
detail: `${patch.reason}\n\n${manualDetail}`,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
title,
|
|
128
|
+
target: path,
|
|
129
|
+
status: StepStatus.APPLY,
|
|
130
|
+
detail: applyDetail,
|
|
131
|
+
write: { path, content: patch.code },
|
|
132
|
+
dependsOnInstall: true,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Next used to be the ONLY stack with hand edits left over — and both of them fail silently when
|
|
137
|
+
* skipped, so a Next user's app booted, connected to nothing, and said nothing about why. Both are
|
|
138
|
+
* now patched by the same conservative rules the Vite config gets.
|
|
139
|
+
*/
|
|
140
|
+
export function nextSteps(input) {
|
|
141
|
+
const configFile = input.nextConfigFile ?? 'next.config.mjs';
|
|
142
|
+
const devPath = input.nextReticleDevPath ?? NEXT_RETICLE_DEV_PATH;
|
|
143
|
+
const devFile = input.nextReticleDevExists
|
|
144
|
+
? {
|
|
145
|
+
title: 'ReticleDev component',
|
|
146
|
+
target: devPath,
|
|
147
|
+
status: StepStatus.ALREADY,
|
|
148
|
+
detail: 'file exists',
|
|
149
|
+
}
|
|
150
|
+
: {
|
|
151
|
+
title: 'ReticleDev component',
|
|
152
|
+
target: devPath,
|
|
153
|
+
status: StepStatus.APPLY,
|
|
154
|
+
detail: 'create dev-only connect component',
|
|
155
|
+
write: {
|
|
156
|
+
path: devPath,
|
|
157
|
+
content: nextReticleDevFile(input.options.port, input.options.projectId, input.testids ?? [], input.storeHints ?? []),
|
|
158
|
+
},
|
|
159
|
+
dependsOnInstall: true,
|
|
160
|
+
};
|
|
161
|
+
const configPatch = null === input.nextConfigSource || input.nextConfigSource === undefined
|
|
162
|
+
? { kind: PatchKind.MANUAL, reason: `no ${configFile} found` }
|
|
163
|
+
: patchNextConfig(input.nextConfigSource);
|
|
164
|
+
const layout = input.nextLayout ?? null;
|
|
165
|
+
// Pages Router mounts through pages/_app, App Router through the root layout — different edits,
|
|
166
|
+
// and picking by path is what stops a Pages app being handed the layout patch that cannot apply.
|
|
167
|
+
const isPagesRouter = layout !== null && /(^|\/)pages\/_app\.[jt]sx?$/.test(layout.path);
|
|
168
|
+
const layoutPatch = null === layout
|
|
169
|
+
? { kind: PatchKind.MANUAL, reason: 'no root layout (app/layout.tsx) or pages/_app found' }
|
|
170
|
+
: isPagesRouter
|
|
171
|
+
? patchPagesApp(layout.source, input.nextReticleDevImport)
|
|
172
|
+
: patchRootLayout(layout.source);
|
|
173
|
+
return [
|
|
174
|
+
devFile,
|
|
175
|
+
patchStep('Next config (withReticle)', configFile, configPatch, 'wrap the export in withReticle (source mapping, dev-only)', nextConfigManual(configFile)),
|
|
176
|
+
patchStep('Mount ReticleDev', layout?.path ?? NEXT_LAYOUT_PATH, layoutPatch, 'mount <ReticleDev /> in the root layout (dev-only)', NEXT_LAYOUT_MANUAL),
|
|
177
|
+
];
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* SvelteKit is WIRED but not SUPPORTED, and the plan says so out loud.
|
|
181
|
+
*
|
|
182
|
+
* There is no SvelteKit app in `apps/` and no CI gate for one, so nothing proves this hook still
|
|
183
|
+
* registers a session — every other framework init offers (React, Next, Remix, Astro) has both. The
|
|
184
|
+
* wiring is real and may well work; what is missing is anything that would tell us when it stops.
|
|
185
|
+
* Silently emitting it reads as a support claim, which is the thing this project exists to not do.
|
|
186
|
+
*/
|
|
187
|
+
/**
|
|
188
|
+
* Create React App: the connect goes in `src/index.tsx`, the token in `.env.development.local`.
|
|
189
|
+
*
|
|
190
|
+
* The previous plan pointed at `index.html`, which cannot work — CRA's is a static template the
|
|
191
|
+
* bundler never processes for modules. Reported from a real cra-redux-saga app.
|
|
192
|
+
*/
|
|
193
|
+
export function craSteps(input) {
|
|
194
|
+
const entry = input.craEntry ?? null;
|
|
195
|
+
const steps = [
|
|
196
|
+
{
|
|
197
|
+
title: 'Reticle connect module',
|
|
198
|
+
target: CRA_DEV_MODULE_PATH,
|
|
199
|
+
status: StepStatus.APPLY,
|
|
200
|
+
detail: 'create the dev-only connect (CRA cannot inject through public/index.html)',
|
|
201
|
+
write: {
|
|
202
|
+
path: CRA_DEV_MODULE_PATH,
|
|
203
|
+
content: craDevModuleFile(input.options.port, input.options.projectId),
|
|
204
|
+
},
|
|
205
|
+
dependsOnInstall: true,
|
|
206
|
+
},
|
|
207
|
+
];
|
|
208
|
+
const token = input.pairingToken ?? '';
|
|
209
|
+
const env = craEnvPatch(input.craEnv ?? null, token);
|
|
210
|
+
if (env !== null) {
|
|
211
|
+
steps.push({
|
|
212
|
+
title: 'Pairing token',
|
|
213
|
+
target: CRA_ENV_PATH,
|
|
214
|
+
status: StepStatus.APPLY,
|
|
215
|
+
// REACT_APP_* is the only thing CRA inlines into browser code; without the token the bridge
|
|
216
|
+
// refuses the connection and no session appears. Say the file is gitignored HERE, at the one
|
|
217
|
+
// moment someone is looking: the token is per-machine and cannot travel, so every teammate
|
|
218
|
+
// has to run init once or their clone is dead with no explanation.
|
|
219
|
+
detail: `set ${TOKEN_VAR} (the only channel CRA inlines) — ${CRA_ENV_PATH} is gitignored, so each teammate must run \`reticle init\` on their own machine`,
|
|
220
|
+
write: { path: CRA_ENV_PATH, content: env },
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
else if ('' === token) {
|
|
224
|
+
// No daemon has ever run here, so there is no token to inline. Omitting the step entirely made
|
|
225
|
+
// init report all-green for an app that could never pair.
|
|
226
|
+
steps.push({
|
|
227
|
+
title: 'Pairing token',
|
|
228
|
+
target: CRA_ENV_PATH,
|
|
229
|
+
status: StepStatus.MANUAL,
|
|
230
|
+
detail: `no pairing token yet — run \`reticle start\`, then \`reticle init\` again to write ${TOKEN_VAR}`,
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
if (null === entry) {
|
|
234
|
+
steps.push({
|
|
235
|
+
title: 'Connect snippet (CRA)',
|
|
236
|
+
target: 'src/index.tsx',
|
|
237
|
+
status: StepStatus.MANUAL,
|
|
238
|
+
detail: `Add \`${CRA_DEV_MODULE_IMPORT}\` to your app entry (src/index.tsx or src/index.js), after the existing imports.`,
|
|
239
|
+
});
|
|
240
|
+
return steps;
|
|
241
|
+
}
|
|
242
|
+
const patched = craImportPatch(entry.source);
|
|
243
|
+
steps.push(null === patched
|
|
244
|
+
? {
|
|
245
|
+
title: 'Connect snippet (CRA)',
|
|
246
|
+
target: entry.path,
|
|
247
|
+
status: StepStatus.ALREADY,
|
|
248
|
+
detail: 'already imported',
|
|
249
|
+
}
|
|
250
|
+
: {
|
|
251
|
+
title: 'Connect snippet (CRA)',
|
|
252
|
+
target: entry.path,
|
|
253
|
+
status: StepStatus.APPLY,
|
|
254
|
+
detail: 'import the dev-only connect module',
|
|
255
|
+
write: { path: entry.path, content: patched },
|
|
256
|
+
dependsOnInstall: true,
|
|
257
|
+
});
|
|
258
|
+
return steps;
|
|
259
|
+
}
|
|
260
|
+
export function svelteKitSteps(input) {
|
|
261
|
+
const unverified = {
|
|
262
|
+
title: 'SvelteKit is UNVERIFIED',
|
|
263
|
+
target: SVELTEKIT_HOOKS_PATH,
|
|
264
|
+
status: StepStatus.NOTICE,
|
|
265
|
+
detail: UNVERIFIED_FRAMEWORK_NOTE,
|
|
266
|
+
};
|
|
267
|
+
// SvelteKit can't use the Vite-plugin injection (it renders via app.html) — wire a client hook
|
|
268
|
+
// that SvelteKit runs on startup, which is the path that can register a session at all.
|
|
269
|
+
if (true === input.svelteKitHooksExists) {
|
|
270
|
+
return [
|
|
271
|
+
unverified,
|
|
272
|
+
{
|
|
273
|
+
title: 'Reticle client hook',
|
|
274
|
+
target: SVELTEKIT_HOOKS_PATH,
|
|
275
|
+
status: StepStatus.ALREADY,
|
|
276
|
+
detail: 'file exists',
|
|
277
|
+
},
|
|
278
|
+
];
|
|
279
|
+
}
|
|
280
|
+
return [
|
|
281
|
+
unverified,
|
|
282
|
+
{
|
|
283
|
+
title: 'Reticle client hook',
|
|
284
|
+
target: SVELTEKIT_HOOKS_PATH,
|
|
285
|
+
status: StepStatus.APPLY,
|
|
286
|
+
detail: 'create dev-only client connect (SvelteKit renders via app.html)',
|
|
287
|
+
write: {
|
|
288
|
+
path: SVELTEKIT_HOOKS_PATH,
|
|
289
|
+
content: svelteKitHooksFile(input.options.port, input.options.projectId),
|
|
290
|
+
},
|
|
291
|
+
dependsOnInstall: true,
|
|
292
|
+
},
|
|
293
|
+
];
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Astro: the config define + build target, and the connect script in ONE layout.
|
|
297
|
+
*
|
|
298
|
+
* Astro was the last gated stack left printing a recipe it did not apply. It still falls back to the
|
|
299
|
+
* printed one whenever the choice is not obvious — no config, no single layout, or a shape the
|
|
300
|
+
* patchers do not fully recognise — because which page or layout to instrument is a real decision
|
|
301
|
+
* and a half-edited build config is worse than a documented manual step.
|
|
302
|
+
*/
|
|
303
|
+
export function astroSteps(input) {
|
|
304
|
+
const config = input.astroConfig ?? null;
|
|
305
|
+
const layout = input.astroLayout ?? null;
|
|
306
|
+
const manual = astroManual(input.options.port, input.options.projectId, layout?.path);
|
|
307
|
+
if (null === config || null === layout) {
|
|
308
|
+
return [
|
|
309
|
+
{
|
|
310
|
+
title: 'Connect snippet (Astro)',
|
|
311
|
+
// Name what is actually there. `astro.config + layout` pointed at a layout this project may
|
|
312
|
+
// not have — reported on a fixture with only src/pages/index.astro.
|
|
313
|
+
target: null === layout ? 'astro.config + a page (no layout found)' : 'astro.config + layout',
|
|
314
|
+
status: StepStatus.MANUAL,
|
|
315
|
+
detail: manual,
|
|
316
|
+
},
|
|
317
|
+
];
|
|
318
|
+
}
|
|
319
|
+
// ATOMIC. The connect snippet is useless without the config: the token is inlined by the config,
|
|
320
|
+
// so a layout patched on its own gives an app that dials the bridge and is refused. Measured on a
|
|
321
|
+
// real fixture — config ⚠, layout ✓ — which reads as one step done and one caveat when it is
|
|
322
|
+
// actually a guaranteed non-connection. If either half cannot be applied, BOTH go manual with the
|
|
323
|
+
// single recipe that does the whole job.
|
|
324
|
+
const manualWithLayout = astroManual(input.options.port, input.options.projectId, layout.path);
|
|
325
|
+
const configPatch = patchAstroConfig(config.source);
|
|
326
|
+
const layoutPatch = patchAstroLayout(layout.source, input.options.port, input.options.projectId);
|
|
327
|
+
if (configPatch.kind === PatchKind.MANUAL || layoutPatch.kind === PatchKind.MANUAL) {
|
|
328
|
+
return [
|
|
329
|
+
{
|
|
330
|
+
title: 'Connect snippet (Astro)',
|
|
331
|
+
target: `${config.path} + ${layout.path}`,
|
|
332
|
+
status: StepStatus.MANUAL,
|
|
333
|
+
detail: manualWithLayout,
|
|
334
|
+
},
|
|
335
|
+
];
|
|
336
|
+
}
|
|
337
|
+
return [
|
|
338
|
+
patchStep('Astro config (token + build target)', config.path, configPatch, 'inline the pairing token and raise build.target to es2022', manualWithLayout),
|
|
339
|
+
patchStep('Connect snippet (Astro)', layout.path, layoutPatch, 'add the dev-only connect <script> before </body>', manualWithLayout),
|
|
340
|
+
];
|
|
341
|
+
}
|
package/dist/init/plan.d.ts
CHANGED
|
@@ -4,10 +4,20 @@
|
|
|
4
4
|
* runner performs the `write` side-effects; this module decides *what* should happen.
|
|
5
5
|
*/
|
|
6
6
|
import { Framework, type Detection } from './detect.js';
|
|
7
|
-
/**
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Pin the SDK to the CLI's own version.
|
|
9
|
+
*
|
|
10
|
+
* `pnpm add -D @reticlehq/react` installed **2.2.1** in one project while npm and yarn took 2.3.0 in
|
|
11
|
+
* the next — a stale registry metadata cache, invisible to the user and to us. A version-skewed SDK
|
|
12
|
+
* talking to a newer daemon is the `-32000` failure path: the app connects, the protocol disagrees,
|
|
13
|
+
* and nothing on either side names a version. Asking for the CLI's exact version makes the cache
|
|
14
|
+
* irrelevant, and a skewed pair impossible to install by accident.
|
|
15
|
+
*/
|
|
16
|
+
export declare function pinnedPackages(packages: readonly string[], version: string | undefined): readonly string[];
|
|
9
17
|
/** Exported so the init telemetry can tell an MCP-registration failure from a dependency install. */
|
|
10
18
|
export declare const MCP_TARGET = "global (claude user scope)";
|
|
19
|
+
/** True when this step is what makes the app dial the daemon. */
|
|
20
|
+
export declare function isConnectStep(title: string): boolean;
|
|
11
21
|
/** The step that runs the package manager — the other thing that commonly fails on a user's machine. */
|
|
12
22
|
export declare const DEPS_TARGET = "package.json";
|
|
13
23
|
export declare const StepStatus: {
|
|
@@ -15,9 +25,16 @@ export declare const StepStatus: {
|
|
|
15
25
|
readonly MANUAL: "manual";
|
|
16
26
|
readonly ALREADY: "already";
|
|
17
27
|
readonly SKIP: "skip";
|
|
28
|
+
/**
|
|
29
|
+
* Something the user should KNOW, not something they must DO. The UNVERIFIED lines are the case:
|
|
30
|
+
* a Preact or SvelteKit app is wired and working, it just isn't covered by a gate. Reporting those
|
|
31
|
+
* as `manual` made "steps left to do" a number that could never reach zero, and made a release gate
|
|
32
|
+
* read two regressions that were not regressions.
|
|
33
|
+
*/
|
|
34
|
+
readonly NOTICE: "notice";
|
|
18
35
|
};
|
|
19
36
|
export type StepStatus = (typeof StepStatus)[keyof typeof StepStatus];
|
|
20
|
-
interface Step {
|
|
37
|
+
export interface Step {
|
|
21
38
|
title: string;
|
|
22
39
|
target: string;
|
|
23
40
|
status: StepStatus;
|
|
@@ -33,6 +50,27 @@ interface Step {
|
|
|
33
50
|
args: string[];
|
|
34
51
|
fallback: string;
|
|
35
52
|
};
|
|
53
|
+
/**
|
|
54
|
+
* A second, weaker attempt to run when `exec` fails, with what to tell the user if it succeeds.
|
|
55
|
+
*
|
|
56
|
+
* The pinned install is refused outright by pnpm's `minimumReleaseAge` for as long as its window
|
|
57
|
+
* lasts — so for ~48 hours after every release, a project with that setting could not install
|
|
58
|
+
* Reticle at all. An unpinned install still works there (it resolves the newest MATURE version), so
|
|
59
|
+
* the fallback trades an exact version for a working install and says which it did. It must never
|
|
60
|
+
* be silent: an older SDK against a newer daemon is the skew this pin exists to prevent.
|
|
61
|
+
*/
|
|
62
|
+
retry?: {
|
|
63
|
+
command: string;
|
|
64
|
+
args: string[];
|
|
65
|
+
note: string;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* This step wires the app to a package the install step provides. If that install fails, applying
|
|
69
|
+
* it anyway leaves the app importing a module that is not there — `next.config.ts` importing
|
|
70
|
+
* `@reticlehq/next` took a dev server down exactly this way. Installing Reticle must never be the
|
|
71
|
+
* reason an app stops booting.
|
|
72
|
+
*/
|
|
73
|
+
dependsOnInstall?: boolean;
|
|
36
74
|
}
|
|
37
75
|
export interface Plan {
|
|
38
76
|
framework: Framework;
|
|
@@ -46,6 +84,8 @@ export interface PlanInput {
|
|
|
46
84
|
mcpExists: boolean;
|
|
47
85
|
/** Whether Cursor is installed for this user (its global config dir exists). */
|
|
48
86
|
cursorPresent: boolean;
|
|
87
|
+
/** Whether THIS project has a .cursor/ directory — the signal that Cursor works on this repo. */
|
|
88
|
+
cursorProjectPresent?: boolean | undefined;
|
|
49
89
|
/** Current ~/.cursor/mcp.json content, or null if absent. */
|
|
50
90
|
cursorConfig: string | null;
|
|
51
91
|
/** Absolute path of ~/.cursor/mcp.json (the write target). */
|
|
@@ -55,27 +95,100 @@ export interface PlanInput {
|
|
|
55
95
|
path: string;
|
|
56
96
|
source: string;
|
|
57
97
|
} | null;
|
|
98
|
+
/** Discovered Astro config: its path + source, or null if none found. */
|
|
99
|
+
astroConfig?: {
|
|
100
|
+
path: string;
|
|
101
|
+
source: string;
|
|
102
|
+
} | null | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* The single layout to instrument, or null when the choice is not obvious.
|
|
105
|
+
*
|
|
106
|
+
* WHICH page or layout to instrument is a real decision — so `init` only makes it when there is
|
|
107
|
+
* exactly one candidate. Zero or several falls back to the printed recipe rather than guessing at
|
|
108
|
+
* the file every page of the user's site inherits from.
|
|
109
|
+
*/
|
|
110
|
+
astroLayout?: {
|
|
111
|
+
path: string;
|
|
112
|
+
source: string;
|
|
113
|
+
} | null | undefined;
|
|
58
114
|
/** Discovered Next config filename (e.g. 'next.config.mjs'), or null. */
|
|
59
115
|
nextConfigFile: string | null;
|
|
60
|
-
/**
|
|
116
|
+
/** Source of that Next config, so the export can be wrapped in withReticle. */
|
|
117
|
+
nextConfigSource?: string | null | undefined;
|
|
118
|
+
/** Discovered Next root layout: its path + source, or null (App Router only). */
|
|
119
|
+
nextLayout?: {
|
|
120
|
+
path: string;
|
|
121
|
+
source: string;
|
|
122
|
+
} | null | undefined;
|
|
123
|
+
/** Where the dev-only connect component goes — never inside `pages/`, which routes on presence. */
|
|
124
|
+
nextReticleDevPath?: string | undefined;
|
|
125
|
+
/** What the mount file should import — a sibling for App Router, `../components/…` for Pages. */
|
|
126
|
+
nextReticleDevImport?: string | undefined;
|
|
127
|
+
/** Whether the ReticleDev component file already exists. */
|
|
61
128
|
nextReticleDevExists: boolean;
|
|
129
|
+
/** `data-testid` values scanned from the app's source, for the generated capabilities block. */
|
|
130
|
+
testids?: readonly string[] | undefined;
|
|
131
|
+
/** Ready-to-uncomment `registerStore` lines for the state libraries the app actually depends on. */
|
|
132
|
+
storeHints?: readonly string[] | undefined;
|
|
133
|
+
/** Whether src/reticle-dev.ts already exists — it is the one generated file users are meant to edit. */
|
|
134
|
+
viteDevModuleExists?: boolean | undefined;
|
|
62
135
|
/** Whether src/hooks.client.ts already exists (SvelteKit idempotency). */
|
|
63
136
|
svelteKitHooksExists?: boolean;
|
|
137
|
+
/** CRA's bundled entry (src/index.tsx or .js) — where the connect import has to go. */
|
|
138
|
+
craEntry?: {
|
|
139
|
+
path: string;
|
|
140
|
+
source: string;
|
|
141
|
+
} | null;
|
|
142
|
+
/** Existing .env.development.local, so an unrelated variable in it survives. */
|
|
143
|
+
craEnv?: string | null;
|
|
144
|
+
/** The daemon's pairing token, inlined for CRA through the one channel it supports. */
|
|
145
|
+
pairingToken?: string;
|
|
64
146
|
/** Whether .reticle.json already exists in the project root (idempotency). */
|
|
65
147
|
reticleConfigExists?: boolean;
|
|
66
148
|
/** Current project-root CLAUDE.md content (for the idempotent agent-rule merge), or null/undefined. */
|
|
67
149
|
claudeMdContent?: string | null | undefined;
|
|
68
150
|
/** Current project-root AGENTS.md content (cross-agent fallback rule), or null/undefined. */
|
|
69
151
|
agentsMdContent?: string | null | undefined;
|
|
70
|
-
/**
|
|
71
|
-
|
|
152
|
+
/**
|
|
153
|
+
* Current .cursor/rules/reticle.mdc content, or null when absent.
|
|
154
|
+
*
|
|
155
|
+
* CONTENT, not existence. Gating on the file merely being there froze a Cursor project's rule at
|
|
156
|
+
* whatever release wrote it — so the CLAUDE.md path refreshed itself while the Cursor one never
|
|
157
|
+
* could, and a rule added later (`version_skew`) never reached a Cursor-only project at all.
|
|
158
|
+
*/
|
|
159
|
+
cursorRuleContent?: string | null | undefined;
|
|
160
|
+
/** Current .claude/commands/reticle.md content, or null when absent (slash-command idempotency). */
|
|
161
|
+
claudeCommandContent?: string | null | undefined;
|
|
162
|
+
/** Current .cursor/commands/reticle.md content, or null when absent. */
|
|
163
|
+
cursorCommandContent?: string | null | undefined;
|
|
72
164
|
options: {
|
|
73
165
|
port: number | undefined;
|
|
74
166
|
mcp: boolean;
|
|
75
167
|
install: boolean;
|
|
76
168
|
/** Stable project identity derived at init (package.json name + root). Baked into snippets/.reticle.json. */
|
|
77
169
|
projectId?: string;
|
|
170
|
+
/** The CLI's own version, pinned onto the SDK install so a stale registry cache cannot skew it. */
|
|
171
|
+
sdkVersion?: string;
|
|
78
172
|
};
|
|
79
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Every coding agent `reticle init` knows how to wire itself into, and the three surfaces it wires:
|
|
176
|
+
* the global MCP registration, the project rule file that makes the agent USE Reticle, and the
|
|
177
|
+
* `/reticle` command.
|
|
178
|
+
*
|
|
179
|
+
* One list, because those three surfaces used to enumerate Claude and Cursor separately in three
|
|
180
|
+
* places — so supporting a fourth agent meant finding all three and getting each right. Adding one
|
|
181
|
+
* is now an entry here plus its builders; each builder answers null when that agent is not present
|
|
182
|
+
* for this user or this project, which is also how "no agent detected" falls through to the
|
|
183
|
+
* cross-agent AGENTS.md.
|
|
184
|
+
*
|
|
185
|
+
* Deliberately functions rather than data: registering with Claude runs its CLI while Cursor merges
|
|
186
|
+
* a JSON file, and pretending those are the same shape would cost more than it saves.
|
|
187
|
+
*/
|
|
188
|
+
declare const AgentId: {
|
|
189
|
+
readonly CLAUDE: "claude";
|
|
190
|
+
readonly CURSOR: "cursor";
|
|
191
|
+
};
|
|
192
|
+
export type AgentId = (typeof AgentId)[keyof typeof AgentId];
|
|
80
193
|
export declare function buildPlan(input: PlanInput): Plan;
|
|
81
194
|
export {};
|