@getrift/rift 0.1.0-beta.2 → 0.1.0-beta.21
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 +35 -9
- package/dist/src/auth/keychain.d.ts +9 -0
- package/dist/src/auth/keychain.d.ts.map +1 -1
- package/dist/src/auth/keychain.js +37 -0
- package/dist/src/auth/keychain.js.map +1 -1
- package/dist/src/capture/auto-capture.d.ts +7 -0
- package/dist/src/capture/auto-capture.d.ts.map +1 -1
- package/dist/src/capture/auto-capture.js +82 -15
- package/dist/src/capture/auto-capture.js.map +1 -1
- package/dist/src/capture/auto-repair.d.ts +110 -0
- package/dist/src/capture/auto-repair.d.ts.map +1 -0
- package/dist/src/capture/auto-repair.js +269 -0
- package/dist/src/capture/auto-repair.js.map +1 -0
- package/dist/src/capture/codex-cli-triage-provider.d.ts.map +1 -1
- package/dist/src/capture/codex-cli-triage-provider.js +4 -3
- package/dist/src/capture/codex-cli-triage-provider.js.map +1 -1
- package/dist/src/capture/observability.d.ts +42 -0
- package/dist/src/capture/observability.d.ts.map +1 -1
- package/dist/src/capture/observability.js +45 -4
- package/dist/src/capture/observability.js.map +1 -1
- package/dist/src/capture/recover-quarantine.d.ts +260 -0
- package/dist/src/capture/recover-quarantine.d.ts.map +1 -0
- package/dist/src/capture/recover-quarantine.js +522 -0
- package/dist/src/capture/recover-quarantine.js.map +1 -0
- package/dist/src/cli/commands/backfill.d.ts.map +1 -1
- package/dist/src/cli/commands/backfill.js +5 -2
- package/dist/src/cli/commands/backfill.js.map +1 -1
- package/dist/src/cli/commands/capture-recover.d.ts +40 -0
- package/dist/src/cli/commands/capture-recover.d.ts.map +1 -0
- package/dist/src/cli/commands/capture-recover.js +184 -0
- package/dist/src/cli/commands/capture-recover.js.map +1 -0
- package/dist/src/cli/commands/capture.d.ts.map +1 -1
- package/dist/src/cli/commands/capture.js +96 -5
- package/dist/src/cli/commands/capture.js.map +1 -1
- package/dist/src/cli/commands/doctor.d.ts +6 -0
- package/dist/src/cli/commands/doctor.d.ts.map +1 -0
- package/dist/src/cli/commands/doctor.js +242 -0
- package/dist/src/cli/commands/doctor.js.map +1 -0
- package/dist/src/cli/commands/feedback.d.ts +12 -0
- package/dist/src/cli/commands/feedback.d.ts.map +1 -1
- package/dist/src/cli/commands/feedback.js +93 -4
- package/dist/src/cli/commands/feedback.js.map +1 -1
- package/dist/src/cli/commands/mcp-install.js +5 -2
- package/dist/src/cli/commands/mcp-install.js.map +1 -1
- package/dist/src/cli/commands/menubar.d.ts +80 -0
- package/dist/src/cli/commands/menubar.d.ts.map +1 -0
- package/dist/src/cli/commands/menubar.js +388 -0
- package/dist/src/cli/commands/menubar.js.map +1 -0
- package/dist/src/cli/commands/onboard.d.ts +143 -5
- package/dist/src/cli/commands/onboard.d.ts.map +1 -1
- package/dist/src/cli/commands/onboard.js +844 -188
- package/dist/src/cli/commands/onboard.js.map +1 -1
- package/dist/src/cli/commands/rebuild.d.ts.map +1 -1
- package/dist/src/cli/commands/rebuild.js +6 -3
- package/dist/src/cli/commands/rebuild.js.map +1 -1
- package/dist/src/cli/commands/reconcile.d.ts.map +1 -1
- package/dist/src/cli/commands/reconcile.js +12 -0
- package/dist/src/cli/commands/reconcile.js.map +1 -1
- package/dist/src/cli/commands/review.d.ts.map +1 -1
- package/dist/src/cli/commands/review.js +22 -7
- package/dist/src/cli/commands/review.js.map +1 -1
- package/dist/src/cli/commands/search.d.ts +2 -0
- package/dist/src/cli/commands/search.d.ts.map +1 -1
- package/dist/src/cli/commands/search.js +34 -4
- package/dist/src/cli/commands/search.js.map +1 -1
- package/dist/src/cli/commands/status.d.ts +9 -7
- package/dist/src/cli/commands/status.d.ts.map +1 -1
- package/dist/src/cli/commands/status.js +117 -12
- package/dist/src/cli/commands/status.js.map +1 -1
- package/dist/src/cli/commands/token-issue.d.ts.map +1 -1
- package/dist/src/cli/commands/token-issue.js +9 -1
- package/dist/src/cli/commands/token-issue.js.map +1 -1
- package/dist/src/cli/commands/triage.d.ts.map +1 -1
- package/dist/src/cli/commands/triage.js +7 -5
- package/dist/src/cli/commands/triage.js.map +1 -1
- package/dist/src/cli/commands/update.d.ts +80 -0
- package/dist/src/cli/commands/update.d.ts.map +1 -0
- package/dist/src/cli/commands/update.js +390 -0
- package/dist/src/cli/commands/update.js.map +1 -0
- package/dist/src/cli/default-config-path.d.ts +15 -0
- package/dist/src/cli/default-config-path.d.ts.map +1 -0
- package/dist/src/cli/default-config-path.js +27 -0
- package/dist/src/cli/default-config-path.js.map +1 -0
- package/dist/src/cli/feedback/feedback-config.d.ts +46 -0
- package/dist/src/cli/feedback/feedback-config.d.ts.map +1 -1
- package/dist/src/cli/feedback/feedback-config.js +130 -4
- package/dist/src/cli/feedback/feedback-config.js.map +1 -1
- package/dist/src/cli/feedback/feedback-history.d.ts +7 -0
- package/dist/src/cli/feedback/feedback-history.d.ts.map +1 -1
- package/dist/src/cli/feedback/feedback-history.js +39 -9
- package/dist/src/cli/feedback/feedback-history.js.map +1 -1
- package/dist/src/cli/feedback/feedback-payload.d.ts +22 -1
- package/dist/src/cli/feedback/feedback-payload.d.ts.map +1 -1
- package/dist/src/cli/feedback/feedback-payload.js.map +1 -1
- package/dist/src/cli/feedback/feedback-relay.d.ts +2 -2
- package/dist/src/cli/feedback/feedback-relay.d.ts.map +1 -1
- package/dist/src/cli/feedback/feedback-relay.js.map +1 -1
- package/dist/src/cli/feedback/invite.d.ts +17 -0
- package/dist/src/cli/feedback/invite.d.ts.map +1 -0
- package/dist/src/cli/feedback/invite.js +67 -0
- package/dist/src/cli/feedback/invite.js.map +1 -0
- package/dist/src/cli/feedback/relay-secret-store.d.ts +32 -0
- package/dist/src/cli/feedback/relay-secret-store.d.ts.map +1 -0
- package/dist/src/cli/feedback/relay-secret-store.js +137 -0
- package/dist/src/cli/feedback/relay-secret-store.js.map +1 -0
- package/dist/src/cli/http-client.d.ts +93 -1
- package/dist/src/cli/http-client.d.ts.map +1 -1
- package/dist/src/cli/http-client.js +254 -6
- package/dist/src/cli/http-client.js.map +1 -1
- package/dist/src/cli/index.d.ts.map +1 -1
- package/dist/src/cli/index.js +29 -6
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/cli/postinstall-menubar.d.ts +22 -0
- package/dist/src/cli/postinstall-menubar.d.ts.map +1 -0
- package/dist/src/cli/postinstall-menubar.js +53 -0
- package/dist/src/cli/postinstall-menubar.js.map +1 -0
- package/dist/src/cli/status/friend-header.d.ts +16 -1
- package/dist/src/cli/status/friend-header.d.ts.map +1 -1
- package/dist/src/cli/status/friend-header.js +354 -26
- package/dist/src/cli/status/friend-header.js.map +1 -1
- package/dist/src/cli/status/local-signals.d.ts +18 -0
- package/dist/src/cli/status/local-signals.d.ts.map +1 -1
- package/dist/src/cli/status/local-signals.js +29 -0
- package/dist/src/cli/status/local-signals.js.map +1 -1
- package/dist/src/cli/ui.d.ts +47 -0
- package/dist/src/cli/ui.d.ts.map +1 -0
- package/dist/src/cli/ui.js +166 -0
- package/dist/src/cli/ui.js.map +1 -0
- package/dist/src/config/schema.d.ts +79 -0
- package/dist/src/config/schema.d.ts.map +1 -1
- package/dist/src/config/schema.js +44 -0
- package/dist/src/config/schema.js.map +1 -1
- package/dist/src/diagnostics/codex-preflight.d.ts +33 -0
- package/dist/src/diagnostics/codex-preflight.d.ts.map +1 -0
- package/dist/src/diagnostics/codex-preflight.js +75 -0
- package/dist/src/diagnostics/codex-preflight.js.map +1 -0
- package/dist/src/diagnostics/doctor.d.ts +114 -0
- package/dist/src/diagnostics/doctor.d.ts.map +1 -0
- package/dist/src/diagnostics/doctor.js +352 -0
- package/dist/src/diagnostics/doctor.js.map +1 -0
- package/dist/src/diagnostics/notify.d.ts +90 -0
- package/dist/src/diagnostics/notify.d.ts.map +1 -0
- package/dist/src/diagnostics/notify.js +177 -0
- package/dist/src/diagnostics/notify.js.map +1 -0
- package/dist/src/diagnostics/repair-prompt.d.ts +49 -0
- package/dist/src/diagnostics/repair-prompt.d.ts.map +1 -0
- package/dist/src/diagnostics/repair-prompt.js +223 -0
- package/dist/src/diagnostics/repair-prompt.js.map +1 -0
- package/dist/src/ingestion/inbox-core/conversation-fingerprint.d.ts +2 -0
- package/dist/src/ingestion/inbox-core/conversation-fingerprint.d.ts.map +1 -0
- package/dist/src/ingestion/inbox-core/conversation-fingerprint.js +27 -0
- package/dist/src/ingestion/inbox-core/conversation-fingerprint.js.map +1 -0
- package/dist/src/ingestion/inbox-core/conversation-key.d.ts +2 -0
- package/dist/src/ingestion/inbox-core/conversation-key.d.ts.map +1 -0
- package/dist/src/ingestion/inbox-core/conversation-key.js +31 -0
- package/dist/src/ingestion/inbox-core/conversation-key.js.map +1 -0
- package/dist/src/ingestion/inbox-core/extensions.d.ts +3 -0
- package/dist/src/ingestion/inbox-core/extensions.d.ts.map +1 -0
- package/dist/src/ingestion/inbox-core/extensions.js +16 -0
- package/dist/src/ingestion/inbox-core/extensions.js.map +1 -0
- package/dist/src/ingestion/inbox-core/idempotency.d.ts +2 -0
- package/dist/src/ingestion/inbox-core/idempotency.d.ts.map +1 -0
- package/dist/src/ingestion/inbox-core/idempotency.js +22 -0
- package/dist/src/ingestion/inbox-core/idempotency.js.map +1 -0
- package/dist/src/ingestion/inbox-core/index.d.ts +20 -0
- package/dist/src/ingestion/inbox-core/index.d.ts.map +1 -0
- package/dist/src/ingestion/inbox-core/index.js +20 -0
- package/dist/src/ingestion/inbox-core/index.js.map +1 -0
- package/dist/src/ingestion/inbox-core/source-detection.d.ts +2 -0
- package/dist/src/ingestion/inbox-core/source-detection.d.ts.map +1 -0
- package/dist/src/ingestion/inbox-core/source-detection.js +23 -0
- package/dist/src/ingestion/inbox-core/source-detection.js.map +1 -0
- package/dist/src/ingestion/inbox-core/source-sniffer.d.ts +11 -0
- package/dist/src/ingestion/inbox-core/source-sniffer.d.ts.map +1 -0
- package/dist/src/ingestion/inbox-core/source-sniffer.js +69 -0
- package/dist/src/ingestion/inbox-core/source-sniffer.js.map +1 -0
- package/dist/src/ingestion/inbox-core/zip-sniffer.d.ts +70 -0
- package/dist/src/ingestion/inbox-core/zip-sniffer.d.ts.map +1 -0
- package/dist/src/ingestion/inbox-core/zip-sniffer.js +161 -0
- package/dist/src/ingestion/inbox-core/zip-sniffer.js.map +1 -0
- package/dist/src/ingestion/inbox-watcher.d.ts.map +1 -1
- package/dist/src/ingestion/inbox-watcher.js +34 -50
- package/dist/src/ingestion/inbox-watcher.js.map +1 -1
- package/dist/src/ingestion/indexer.d.ts +7 -0
- package/dist/src/ingestion/indexer.d.ts.map +1 -1
- package/dist/src/ingestion/indexer.js +36 -2
- package/dist/src/ingestion/indexer.js.map +1 -1
- package/dist/src/ingestion/metadata-extraction.d.ts +8 -5
- package/dist/src/ingestion/metadata-extraction.d.ts.map +1 -1
- package/dist/src/ingestion/metadata-extraction.js +24 -5
- package/dist/src/ingestion/metadata-extraction.js.map +1 -1
- package/dist/src/ingestion/skip-quarantine.d.ts +10 -0
- package/dist/src/ingestion/skip-quarantine.d.ts.map +1 -0
- package/dist/src/ingestion/skip-quarantine.js +35 -0
- package/dist/src/ingestion/skip-quarantine.js.map +1 -0
- package/dist/src/jobs/handlers/compact.d.ts.map +1 -1
- package/dist/src/jobs/handlers/compact.js +30 -4
- package/dist/src/jobs/handlers/compact.js.map +1 -1
- package/dist/src/jobs/handlers/dedupe-conversations.d.ts +134 -0
- package/dist/src/jobs/handlers/dedupe-conversations.d.ts.map +1 -0
- package/dist/src/jobs/handlers/dedupe-conversations.js +371 -0
- package/dist/src/jobs/handlers/dedupe-conversations.js.map +1 -0
- package/dist/src/jobs/handlers/ingest.d.ts.map +1 -1
- package/dist/src/jobs/handlers/ingest.js +295 -41
- package/dist/src/jobs/handlers/ingest.js.map +1 -1
- package/dist/src/jobs/handlers/reconcile.d.ts +28 -0
- package/dist/src/jobs/handlers/reconcile.d.ts.map +1 -1
- package/dist/src/jobs/handlers/reconcile.js +145 -19
- package/dist/src/jobs/handlers/reconcile.js.map +1 -1
- package/dist/src/jobs/handlers/reindex.d.ts.map +1 -1
- package/dist/src/jobs/handlers/reindex.js +13 -2
- package/dist/src/jobs/handlers/reindex.js.map +1 -1
- package/dist/src/jobs/handlers/save.d.ts.map +1 -1
- package/dist/src/jobs/handlers/save.js +57 -3
- package/dist/src/jobs/handlers/save.js.map +1 -1
- package/dist/src/jobs/queue.d.ts +51 -1
- package/dist/src/jobs/queue.d.ts.map +1 -1
- package/dist/src/jobs/queue.js +466 -26
- package/dist/src/jobs/queue.js.map +1 -1
- package/dist/src/jobs/worker-entry.d.ts.map +1 -1
- package/dist/src/jobs/worker-entry.js +35 -7
- package/dist/src/jobs/worker-entry.js.map +1 -1
- package/dist/src/jobs/worker-process.d.ts +11 -0
- package/dist/src/jobs/worker-process.d.ts.map +1 -1
- package/dist/src/jobs/worker-process.js +37 -4
- package/dist/src/jobs/worker-process.js.map +1 -1
- package/dist/src/main.js +199 -46
- package/dist/src/main.js.map +1 -1
- package/dist/src/mcp/errors.d.ts.map +1 -1
- package/dist/src/mcp/errors.js +20 -1
- package/dist/src/mcp/errors.js.map +1 -1
- package/dist/src/mcp/server.d.ts.map +1 -1
- package/dist/src/mcp/server.js +43 -3
- package/dist/src/mcp/server.js.map +1 -1
- package/dist/src/mcp/tools/context-pack.d.ts.map +1 -1
- package/dist/src/mcp/tools/context-pack.js +164 -23
- package/dist/src/mcp/tools/context-pack.js.map +1 -1
- package/dist/src/mcp/tools/search.d.ts +6 -2
- package/dist/src/mcp/tools/search.d.ts.map +1 -1
- package/dist/src/mcp/tools/search.js +35 -4
- package/dist/src/mcp/tools/search.js.map +1 -1
- package/dist/src/observability/embedding-events.d.ts +52 -0
- package/dist/src/observability/embedding-events.d.ts.map +1 -0
- package/dist/src/observability/embedding-events.js +149 -0
- package/dist/src/observability/embedding-events.js.map +1 -0
- package/dist/src/observability/index-events.d.ts +70 -0
- package/dist/src/observability/index-events.d.ts.map +1 -0
- package/dist/src/observability/index-events.js +148 -0
- package/dist/src/observability/index-events.js.map +1 -0
- package/dist/src/observability/onboarding-metric.d.ts +131 -0
- package/dist/src/observability/onboarding-metric.d.ts.map +1 -0
- package/dist/src/observability/onboarding-metric.js +351 -0
- package/dist/src/observability/onboarding-metric.js.map +1 -0
- package/dist/src/observability/tool-usage-stats.d.ts +77 -4
- package/dist/src/observability/tool-usage-stats.d.ts.map +1 -1
- package/dist/src/observability/tool-usage-stats.js +112 -32
- package/dist/src/observability/tool-usage-stats.js.map +1 -1
- package/dist/src/observability/tool-usage.d.ts +100 -7
- package/dist/src/observability/tool-usage.d.ts.map +1 -1
- package/dist/src/observability/tool-usage.js +196 -33
- package/dist/src/observability/tool-usage.js.map +1 -1
- package/dist/src/observability/version-check.d.ts +71 -0
- package/dist/src/observability/version-check.d.ts.map +1 -0
- package/dist/src/observability/version-check.js +198 -0
- package/dist/src/observability/version-check.js.map +1 -0
- package/dist/src/providers/basic-metadata-extraction.d.ts +60 -0
- package/dist/src/providers/basic-metadata-extraction.d.ts.map +1 -0
- package/dist/src/providers/basic-metadata-extraction.js +114 -0
- package/dist/src/providers/basic-metadata-extraction.js.map +1 -0
- package/dist/src/providers/codex-cli-metadata-extraction.d.ts +1 -0
- package/dist/src/providers/codex-cli-metadata-extraction.d.ts.map +1 -1
- package/dist/src/providers/codex-cli-metadata-extraction.js +6 -2
- package/dist/src/providers/codex-cli-metadata-extraction.js.map +1 -1
- package/dist/src/providers/codex-cli-model.d.ts +61 -0
- package/dist/src/providers/codex-cli-model.d.ts.map +1 -0
- package/dist/src/providers/codex-cli-model.js +194 -0
- package/dist/src/providers/codex-cli-model.js.map +1 -0
- package/dist/src/providers/codex-cli-runner.d.ts +39 -0
- package/dist/src/providers/codex-cli-runner.d.ts.map +1 -1
- package/dist/src/providers/codex-cli-runner.js +234 -48
- package/dist/src/providers/codex-cli-runner.js.map +1 -1
- package/dist/src/providers/conversation-generation.d.ts.map +1 -1
- package/dist/src/providers/conversation-generation.js +43 -6
- package/dist/src/providers/conversation-generation.js.map +1 -1
- package/dist/src/providers/ollama-embed.d.ts +2 -1
- package/dist/src/providers/ollama-embed.d.ts.map +1 -1
- package/dist/src/providers/ollama-embed.js +1 -0
- package/dist/src/providers/ollama-embed.js.map +1 -1
- package/dist/src/providers/openai-metadata-extraction.d.ts +3 -3
- package/dist/src/providers/openai-metadata-extraction.d.ts.map +1 -1
- package/dist/src/providers/openai-metadata-extraction.js +18 -3
- package/dist/src/providers/openai-metadata-extraction.js.map +1 -1
- package/dist/src/providers/placeholder-embed.d.ts +56 -0
- package/dist/src/providers/placeholder-embed.d.ts.map +1 -0
- package/dist/src/providers/placeholder-embed.js +64 -0
- package/dist/src/providers/placeholder-embed.js.map +1 -0
- package/dist/src/providers/stub.d.ts +2 -0
- package/dist/src/providers/stub.d.ts.map +1 -1
- package/dist/src/providers/stub.js +2 -0
- package/dist/src/providers/stub.js.map +1 -1
- package/dist/src/providers/types.d.ts +11 -0
- package/dist/src/providers/types.d.ts.map +1 -1
- package/dist/src/providers/voyage.d.ts +2 -1
- package/dist/src/providers/voyage.d.ts.map +1 -1
- package/dist/src/providers/voyage.js +1 -0
- package/dist/src/providers/voyage.js.map +1 -1
- package/dist/src/retrieval/compact.d.ts +116 -2
- package/dist/src/retrieval/compact.d.ts.map +1 -1
- package/dist/src/retrieval/compact.js +158 -5
- package/dist/src/retrieval/compact.js.map +1 -1
- package/dist/src/retrieval/context-pack.d.ts +114 -0
- package/dist/src/retrieval/context-pack.d.ts.map +1 -1
- package/dist/src/retrieval/context-pack.js +292 -8
- package/dist/src/retrieval/context-pack.js.map +1 -1
- package/dist/src/retrieval/current-truth.d.ts +360 -0
- package/dist/src/retrieval/current-truth.d.ts.map +1 -0
- package/dist/src/retrieval/current-truth.js +766 -0
- package/dist/src/retrieval/current-truth.js.map +1 -0
- package/dist/src/retrieval/git-state.d.ts +53 -0
- package/dist/src/retrieval/git-state.d.ts.map +1 -0
- package/dist/src/retrieval/git-state.js +174 -0
- package/dist/src/retrieval/git-state.js.map +1 -0
- package/dist/src/retrieval/lexical.d.ts.map +1 -1
- package/dist/src/retrieval/lexical.js +19 -3
- package/dist/src/retrieval/lexical.js.map +1 -1
- package/dist/src/retrieval/locator-boost.d.ts +37 -0
- package/dist/src/retrieval/locator-boost.d.ts.map +1 -0
- package/dist/src/retrieval/locator-boost.js +129 -0
- package/dist/src/retrieval/locator-boost.js.map +1 -0
- package/dist/src/retrieval/report-demotion.d.ts +46 -0
- package/dist/src/retrieval/report-demotion.d.ts.map +1 -0
- package/dist/src/retrieval/report-demotion.js +169 -0
- package/dist/src/retrieval/report-demotion.js.map +1 -0
- package/dist/src/retrieval/vector.d.ts.map +1 -1
- package/dist/src/retrieval/vector.js +11 -2
- package/dist/src/retrieval/vector.js.map +1 -1
- package/dist/src/server/app.d.ts.map +1 -1
- package/dist/src/server/app.js +92 -11
- package/dist/src/server/app.js.map +1 -1
- package/dist/src/server/routes/compact.d.ts.map +1 -1
- package/dist/src/server/routes/compact.js +4 -1
- package/dist/src/server/routes/compact.js.map +1 -1
- package/dist/src/server/routes/context.d.ts +1 -1
- package/dist/src/server/routes/context.d.ts.map +1 -1
- package/dist/src/server/routes/context.js +2 -1
- package/dist/src/server/routes/context.js.map +1 -1
- package/dist/src/server/routes/conversations-search.d.ts.map +1 -1
- package/dist/src/server/routes/conversations-search.js +28 -3
- package/dist/src/server/routes/conversations-search.js.map +1 -1
- package/dist/src/server/routes/enqueue.d.ts +11 -0
- package/dist/src/server/routes/enqueue.d.ts.map +1 -0
- package/dist/src/server/routes/enqueue.js +17 -0
- package/dist/src/server/routes/enqueue.js.map +1 -0
- package/dist/src/server/routes/friend-status.d.ts +339 -3
- package/dist/src/server/routes/friend-status.d.ts.map +1 -1
- package/dist/src/server/routes/friend-status.js +447 -13
- package/dist/src/server/routes/friend-status.js.map +1 -1
- package/dist/src/server/routes/ingest.d.ts.map +1 -1
- package/dist/src/server/routes/ingest.js +5 -2
- package/dist/src/server/routes/ingest.js.map +1 -1
- package/dist/src/server/routes/mcp-usage.d.ts +5 -4
- package/dist/src/server/routes/mcp-usage.d.ts.map +1 -1
- package/dist/src/server/routes/mcp-usage.js.map +1 -1
- package/dist/src/server/routes/reconcile.d.ts.map +1 -1
- package/dist/src/server/routes/reconcile.js +20 -1
- package/dist/src/server/routes/reconcile.js.map +1 -1
- package/dist/src/server/routes/reindex.d.ts.map +1 -1
- package/dist/src/server/routes/reindex.js +4 -1
- package/dist/src/server/routes/reindex.js.map +1 -1
- package/dist/src/server/routes/save.d.ts.map +1 -1
- package/dist/src/server/routes/save.js +4 -1
- package/dist/src/server/routes/save.js.map +1 -1
- package/dist/src/server/routes/search.d.ts +1 -1
- package/dist/src/server/routes/search.d.ts.map +1 -1
- package/dist/src/server/routes/search.js +253 -29
- package/dist/src/server/routes/search.js.map +1 -1
- package/dist/src/server/routes/triage.d.ts.map +1 -1
- package/dist/src/server/routes/triage.js +4 -1
- package/dist/src/server/routes/triage.js.map +1 -1
- package/dist/src/storage/rebuild.d.ts +35 -1
- package/dist/src/storage/rebuild.d.ts.map +1 -1
- package/dist/src/storage/rebuild.js +288 -64
- package/dist/src/storage/rebuild.js.map +1 -1
- package/dist/src/storage/tables.d.ts +29 -0
- package/dist/src/storage/tables.d.ts.map +1 -1
- package/dist/src/storage/tables.js +32 -1
- package/dist/src/storage/tables.js.map +1 -1
- package/operator/swiftbar/render-menu.py +524 -0
- package/operator/swiftbar/rift.10s.sh +176 -0
- package/package.json +9 -3
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `rift update` — friend-readable in-place upgrade for the npm-installed CLI.
|
|
3
|
+
*
|
|
4
|
+
* Steps (in order, each one printed):
|
|
5
|
+
* 1. Resolve the target version with FRESH registry metadata
|
|
6
|
+
* (`npm view --prefer-online @getrift/rift@beta version`), then
|
|
7
|
+
* `npm install -g --prefer-online @getrift/rift@<that exact version>`.
|
|
8
|
+
* Pinning the exact version (not the `@beta` tag) plus `--prefer-online`
|
|
9
|
+
* removes the two ways an install can be a silent no-op: a stale local
|
|
10
|
+
* cache resolving the tag to the already-installed version, and the
|
|
11
|
+
* verify step later reading that same stale cache so a no-op "matches"
|
|
12
|
+
* itself. Falls back to `sudo npm install -g …` exactly like
|
|
13
|
+
* scripts/install.sh, so friends who installed via the one-liner without
|
|
14
|
+
* nvm don't hit a permission wall. When we can resolve where the `rift`
|
|
15
|
+
* on the friend's PATH lives, we install into THAT prefix (`--prefix`)
|
|
16
|
+
* so the copy their terminal runs is the copy that gets upgraded.
|
|
17
|
+
* 2. VERIFY: run the `rift` on PATH and confirm its version now equals the
|
|
18
|
+
* freshly-resolved expected version. An exit-0 npm install is NOT proof
|
|
19
|
+
* of an upgrade — npm can install into a different prefix than the binary
|
|
20
|
+
* on PATH. And if we could not reach the registry to learn the expected
|
|
21
|
+
* version at all, we FAIL as "could not verify" rather than passing on
|
|
22
|
+
* "installed something". We refuse to report success until the active
|
|
23
|
+
* version provably equals a freshly-resolved expected version. This is
|
|
24
|
+
* the load-bearing fix for the beta.18→beta.19 silent no-op that shipped
|
|
25
|
+
* a CLI too old to read its own (valid) config.
|
|
26
|
+
* 3. `launchctl kickstart -k gui/$UID/com.getrift.daemon` — restarts the
|
|
27
|
+
* daemon so it picks up the new code on disk.
|
|
28
|
+
* 4. Poll `/health` until 200 (or timeout) — proves the new build can
|
|
29
|
+
* actually start.
|
|
30
|
+
* 5. Refresh the SwiftBar menu plugin — keeps the 10-second menu surface
|
|
31
|
+
* on the same packaged scripts as the just-installed CLI.
|
|
32
|
+
*
|
|
33
|
+
* Failure contract:
|
|
34
|
+
* - npm install failure (step 1): the previous install is left in place.
|
|
35
|
+
* `npm install -g` with the same dist-tag is atomic enough here — npm
|
|
36
|
+
* replaces `bin/rift` only after a successful tarball install.
|
|
37
|
+
* - Verification failure (step 2): npm reported success but the `rift` on
|
|
38
|
+
* PATH is still the old version. The transcript names both versions and
|
|
39
|
+
* all the paths, leads with a plain-English headline ("Rift updated one
|
|
40
|
+
* copy, but your terminal still points at another copy."), and prints the
|
|
41
|
+
* exact command to install into the right prefix.
|
|
42
|
+
* - Kickstart or /health failure (steps 3–4): the new package is already
|
|
43
|
+
* installed on disk; only daemon recovery is needed. The transcript
|
|
44
|
+
* says so explicitly and points at the manual recovery action.
|
|
45
|
+
* In every branch the output is a friend-readable error pointing at the
|
|
46
|
+
* next recovery step; we never drop into "your install is broken" territory.
|
|
47
|
+
*
|
|
48
|
+
* Deliberately not in scope here:
|
|
49
|
+
* - No publishing.
|
|
50
|
+
* - No clean-Mac validation.
|
|
51
|
+
* - No Sparkle / background self-update.
|
|
52
|
+
* - No telemetry. The npm-registry probe lives in the daemon's daily
|
|
53
|
+
* loop (see src/observability/version-check.ts); this command does
|
|
54
|
+
* not write to that snapshot.
|
|
55
|
+
*/
|
|
56
|
+
import { spawn, execFile } from "node:child_process";
|
|
57
|
+
import path from "node:path";
|
|
58
|
+
import { Command } from "commander";
|
|
59
|
+
import { kickstartDaemon, waitForHealth, } from "../../onboarding/daemon-control.js";
|
|
60
|
+
import { installMenuBar } from "./menubar.js";
|
|
61
|
+
import { printJson, printText } from "../output.js";
|
|
62
|
+
const RIFT_PACKAGE_NAME = "@getrift/rift";
|
|
63
|
+
const RIFT_PACKAGE_SPEC = "@getrift/rift@beta";
|
|
64
|
+
const RIFT_BETA_TAG = "@getrift/rift@beta";
|
|
65
|
+
const DAEMON_BASE_URL = "http://127.0.0.1:3577";
|
|
66
|
+
const HEALTH_TIMEOUT_MS = 30_000;
|
|
67
|
+
const defaultRunner = {
|
|
68
|
+
runNpmInstall: defaultNpmInstall,
|
|
69
|
+
resolveActiveCli: defaultResolveActiveCli,
|
|
70
|
+
getActiveCliVersion: defaultGetActiveCliVersion,
|
|
71
|
+
getExpectedVersion: defaultGetExpectedVersion,
|
|
72
|
+
getNpmGlobalPrefix: defaultGetNpmGlobalPrefix,
|
|
73
|
+
kickstart: kickstartDaemon,
|
|
74
|
+
waitForHealth,
|
|
75
|
+
installMenuBar,
|
|
76
|
+
};
|
|
77
|
+
export function makeUpdateCommand() {
|
|
78
|
+
return new Command("update")
|
|
79
|
+
.description("Reinstall the latest @getrift/rift@beta and restart the daemon")
|
|
80
|
+
.action(async (_opts, cmd) => {
|
|
81
|
+
const globalOpts = cmd.optsWithGlobals();
|
|
82
|
+
const result = await runUpdate(defaultRunner);
|
|
83
|
+
if (globalOpts.json) {
|
|
84
|
+
printJson(result);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
for (const line of result.transcript)
|
|
88
|
+
printText(line);
|
|
89
|
+
}
|
|
90
|
+
if (!result.ok)
|
|
91
|
+
process.exitCode = 1;
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Pure orchestration so tests can inject a mock runner. The function
|
|
96
|
+
* always returns — exit-code mapping is the caller's job.
|
|
97
|
+
*/
|
|
98
|
+
export async function runUpdate(runner) {
|
|
99
|
+
const transcript = [];
|
|
100
|
+
const say = (line) => {
|
|
101
|
+
transcript.push(line);
|
|
102
|
+
};
|
|
103
|
+
// --- Step 1a: resolve the target version with FRESH registry metadata ---
|
|
104
|
+
// Resolve the expected version BEFORE installing, and force a registry
|
|
105
|
+
// round-trip (`npm view --prefer-online`). This is load-bearing: if both
|
|
106
|
+
// `npm install @beta` and the verification's `npm view @beta` read the same
|
|
107
|
+
// stale local cache, the tag can resolve to the version already installed —
|
|
108
|
+
// a no-op that then "verifies" against itself (beta.18 == beta.18) and the
|
|
109
|
+
// command lies. Pinning to the freshly-resolved EXACT version below removes
|
|
110
|
+
// the tag indirection from the install entirely.
|
|
111
|
+
const active = await runner.resolveActiveCli();
|
|
112
|
+
const installPrefix = active.prefix;
|
|
113
|
+
const expected = await runner.getExpectedVersion();
|
|
114
|
+
// --- Step 1b: npm install ---
|
|
115
|
+
// Install the exact pinned version when we know it (so a stale-cached tag
|
|
116
|
+
// can't redirect us), falling back to the @beta tag only when the registry
|
|
117
|
+
// probe failed. Install into the prefix that owns the `rift` on PATH so the
|
|
118
|
+
// copy the friend's shell runs is the copy that gets upgraded; when we can't
|
|
119
|
+
// resolve it, fall back to npm's choice and let verify (Step 2) catch a split.
|
|
120
|
+
const installSpec = expected ? `${RIFT_PACKAGE_NAME}@${expected}` : RIFT_PACKAGE_SPEC;
|
|
121
|
+
say(`==> Installing ${installSpec} via npm` +
|
|
122
|
+
(installPrefix ? ` (into ${installPrefix})` : ""));
|
|
123
|
+
let npmCode = await runner.runNpmInstall(installSpec, false, installPrefix);
|
|
124
|
+
if (npmCode !== 0) {
|
|
125
|
+
// npm exits non-zero on a permission denied error; mirror install.sh
|
|
126
|
+
// and retry under sudo so a non-nvm user on a system Node doesn't get
|
|
127
|
+
// stuck. The sudo prompt itself surfaces inline in the friend's
|
|
128
|
+
// terminal — we don't try to suppress it.
|
|
129
|
+
say(" npm install failed without sudo — retrying with sudo");
|
|
130
|
+
npmCode = await runner.runNpmInstall(installSpec, true, installPrefix);
|
|
131
|
+
}
|
|
132
|
+
if (npmCode !== 0) {
|
|
133
|
+
say("");
|
|
134
|
+
say("Update failed at step 1 (npm install).");
|
|
135
|
+
say("Your existing Rift install is unchanged.");
|
|
136
|
+
say(`Try manually: npm install -g --prefer-online ${RIFT_PACKAGE_SPEC}`);
|
|
137
|
+
return { ok: false, step: "npm", transcript };
|
|
138
|
+
}
|
|
139
|
+
say(" npm install completed.");
|
|
140
|
+
// --- Step 2: verify the active CLI actually upgraded ---
|
|
141
|
+
// An exit-0 npm install is NOT proof. npm can install into a different
|
|
142
|
+
// prefix than the binary on PATH, or (when we fell back to the tag) resolve
|
|
143
|
+
// `@beta` to the version already installed. In both cases the friend's shell
|
|
144
|
+
// still runs the old build. Refuse to claim success until the `rift` on PATH
|
|
145
|
+
// reports the expected version — and if we never resolved the expected
|
|
146
|
+
// version, say so honestly rather than passing on "installed something".
|
|
147
|
+
say("==> Verifying the rift on your PATH is up to date");
|
|
148
|
+
const activeVersion = await runner.getActiveCliVersion();
|
|
149
|
+
const verdict = evaluateUpgrade(expected, activeVersion);
|
|
150
|
+
if (!verdict.ok) {
|
|
151
|
+
const npmPrefix = await runner.getNpmGlobalPrefix();
|
|
152
|
+
appendVerifyDiagnosis(say, {
|
|
153
|
+
expected,
|
|
154
|
+
activeVersion,
|
|
155
|
+
active,
|
|
156
|
+
installPrefix,
|
|
157
|
+
npmPrefix,
|
|
158
|
+
reason: verdict.reason,
|
|
159
|
+
});
|
|
160
|
+
return { ok: false, step: "verify", transcript };
|
|
161
|
+
}
|
|
162
|
+
say(` Active rift is ${activeVersion} (matches the published @beta).`);
|
|
163
|
+
// --- Step 3: kickstart daemon ---
|
|
164
|
+
say("==> Restarting the Rift daemon");
|
|
165
|
+
const kick = await runner.kickstart();
|
|
166
|
+
if (kick.status !== "ok") {
|
|
167
|
+
say("");
|
|
168
|
+
say("Update installed, but the daemon did not restart cleanly.");
|
|
169
|
+
if (kick.hint)
|
|
170
|
+
say(` ${kick.hint}`);
|
|
171
|
+
say("Try: launchctl kickstart -k gui/$UID/com.getrift.daemon");
|
|
172
|
+
return { ok: false, step: "kickstart", transcript };
|
|
173
|
+
}
|
|
174
|
+
say(" Daemon kickstarted.");
|
|
175
|
+
// --- Step 4: wait for /health ---
|
|
176
|
+
say("==> Waiting for the daemon to answer /health");
|
|
177
|
+
const health = await runner.waitForHealth({
|
|
178
|
+
baseUrl: DAEMON_BASE_URL,
|
|
179
|
+
timeoutMs: HEALTH_TIMEOUT_MS,
|
|
180
|
+
});
|
|
181
|
+
if (!health.ok) {
|
|
182
|
+
say("");
|
|
183
|
+
say("Update installed and daemon kickstarted, but /health did not return 200.");
|
|
184
|
+
say(` ${health.reason}`);
|
|
185
|
+
say("Inspect with: rift status");
|
|
186
|
+
return { ok: false, step: "health", transcript };
|
|
187
|
+
}
|
|
188
|
+
say(` Daemon healthy (uptime ${health.uptimeSeconds}s).`);
|
|
189
|
+
// --- Step 5: refresh + relaunch menu bar ---
|
|
190
|
+
// installMenuBar now also launches/refreshes SwiftBar, so an update brings
|
|
191
|
+
// the icon back without a second manual step. A missing SwiftBar is NOT a
|
|
192
|
+
// failed update — we record the one recovery action and still report success.
|
|
193
|
+
say("==> Refreshing the Rift menu bar");
|
|
194
|
+
try {
|
|
195
|
+
const menu = runner.installMenuBar();
|
|
196
|
+
if (menu.skipped) {
|
|
197
|
+
say(` Menu bar skipped: ${menu.reason ?? "not available"}`);
|
|
198
|
+
}
|
|
199
|
+
else if (menu.menuVisible) {
|
|
200
|
+
say(" Menu bar refreshed — the Rift icon is in your menu bar.");
|
|
201
|
+
}
|
|
202
|
+
else if (menu.recovery) {
|
|
203
|
+
say(menu.swiftBarDetected
|
|
204
|
+
? " Menu bar plugin refreshed, but the Rift icon isn't showing yet."
|
|
205
|
+
: " Menu bar plugin refreshed, but SwiftBar is not installed to show it.");
|
|
206
|
+
say(` ${menu.recovery}`);
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
say(" Menu bar refreshed.");
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
catch (err) {
|
|
213
|
+
say(" Menu bar refresh skipped.");
|
|
214
|
+
say(` ${err instanceof Error ? err.message : String(err)}`);
|
|
215
|
+
}
|
|
216
|
+
say("");
|
|
217
|
+
say("Rift updated. Run `rift status` to confirm the new version.");
|
|
218
|
+
return { ok: true, transcript };
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Decide whether the active CLI actually upgraded. The contract is strict and
|
|
222
|
+
* biased toward honesty — "could not confirm" is a FAILURE, never a pass:
|
|
223
|
+
* - no active version at all → the binary is broken (`no_binary`).
|
|
224
|
+
* - no expected version → we couldn't reach the registry to learn the latest
|
|
225
|
+
* beta, so we cannot claim the update landed (`unverified`). This is the
|
|
226
|
+
* deliberate fix for "couldn't verify" silently becoming "updated".
|
|
227
|
+
* - active != expected → still the old (or wrong) build (`mismatch`).
|
|
228
|
+
* Only an active version that equals a freshly-resolved expected version is OK.
|
|
229
|
+
*/
|
|
230
|
+
export function evaluateUpgrade(expected, activeVersion) {
|
|
231
|
+
if (!activeVersion)
|
|
232
|
+
return { ok: false, reason: "no_binary" };
|
|
233
|
+
if (!expected)
|
|
234
|
+
return { ok: false, reason: "unverified" };
|
|
235
|
+
if (activeVersion !== expected)
|
|
236
|
+
return { ok: false, reason: "mismatch" };
|
|
237
|
+
return { ok: true };
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Friend-readable verification failure. Leads with a plain-English headline,
|
|
241
|
+
* then prints versions and paths so the detail is actionable. The branch is
|
|
242
|
+
* chosen from the classified `reason`, and — crucially — only calls it a
|
|
243
|
+
* prefix split when the install was NOT targeted at the active CLI's prefix.
|
|
244
|
+
* Since we install with `--prefix <active.prefix>` whenever we can resolve it,
|
|
245
|
+
* a failure there is a stale-cache / no-op, NOT a split; telling the friend to
|
|
246
|
+
* re-run the same targeted command would be misleading.
|
|
247
|
+
*/
|
|
248
|
+
function appendVerifyDiagnosis(say, ctx) {
|
|
249
|
+
const { expected, activeVersion, active, installPrefix, npmPrefix, reason } = ctx;
|
|
250
|
+
// The prefix npm actually wrote to: the one we targeted, else npm's default.
|
|
251
|
+
const actualInstallPrefix = installPrefix ?? npmPrefix;
|
|
252
|
+
// A genuine split is only possible when we did NOT target the active prefix
|
|
253
|
+
// (installPrefix === null) AND the binary on PATH lives outside where npm
|
|
254
|
+
// installed. When we targeted active.prefix, npm wrote exactly there.
|
|
255
|
+
const prefixSplit = reason === "mismatch" &&
|
|
256
|
+
installPrefix === null &&
|
|
257
|
+
active.binPath !== null &&
|
|
258
|
+
npmPrefix !== null &&
|
|
259
|
+
!binaryLivesUnderPrefix(active.binPath, npmPrefix);
|
|
260
|
+
say("");
|
|
261
|
+
if (reason === "no_binary") {
|
|
262
|
+
say("Rift installed, but `rift --version` would not run afterward.");
|
|
263
|
+
}
|
|
264
|
+
else if (reason === "unverified") {
|
|
265
|
+
say("Rift installed something, but I could not confirm it is the latest.");
|
|
266
|
+
}
|
|
267
|
+
else if (prefixSplit) {
|
|
268
|
+
say("Rift updated one copy, but your terminal still points at another copy.");
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
say("Rift installed, but the rift in your PATH is still the old version.");
|
|
272
|
+
}
|
|
273
|
+
// Detail block — keep the headline understandable, put specifics below it.
|
|
274
|
+
say("");
|
|
275
|
+
if (expected)
|
|
276
|
+
say(` Expected (published @beta): ${expected}`);
|
|
277
|
+
else
|
|
278
|
+
say(" Expected (published @beta): unknown — npm registry probe failed");
|
|
279
|
+
say(` Active (your shell's rift): ${activeVersion ?? "unknown"}`);
|
|
280
|
+
if (active.binPath)
|
|
281
|
+
say(` Active rift path: ${active.binPath}`);
|
|
282
|
+
if (actualInstallPrefix) {
|
|
283
|
+
say(` Installed into prefix: ${actualInstallPrefix}`);
|
|
284
|
+
}
|
|
285
|
+
if (prefixSplit && npmPrefix) {
|
|
286
|
+
say(` npm global prefix: ${npmPrefix}`);
|
|
287
|
+
}
|
|
288
|
+
// Recovery.
|
|
289
|
+
say("");
|
|
290
|
+
if (reason === "unverified") {
|
|
291
|
+
say("This usually means npm couldn't reach the registry. Check your");
|
|
292
|
+
say("connection and re-run `rift update`. To verify by hand:");
|
|
293
|
+
say(` npm view ${RIFT_BETA_TAG} version # the target`);
|
|
294
|
+
say(" rift --version # what your shell runs");
|
|
295
|
+
}
|
|
296
|
+
else if (prefixSplit) {
|
|
297
|
+
const targetPrefix = active.prefix ?? deriveBinPrefix(active.binPath);
|
|
298
|
+
say("Fix: install into the copy your terminal actually runs:");
|
|
299
|
+
if (targetPrefix) {
|
|
300
|
+
say(` npm install -g --prefix ${targetPrefix} --prefer-online ${RIFT_BETA_TAG}`);
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
say(` npm install -g --prefer-online ${RIFT_BETA_TAG}`);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
else {
|
|
307
|
+
// no_binary or same-prefix no-op: most often a stale npm metadata cache.
|
|
308
|
+
say("Your npm metadata cache may be stale (the install was a no-op).");
|
|
309
|
+
say(`Fix: npm install -g --prefer-online ${RIFT_BETA_TAG}`);
|
|
310
|
+
say(" (if it repeats: npm cache clean --force, then re-run rift update)");
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
/** True when `binPath` sits inside `<prefix>/bin` (i.e. npm's `-g` bin dir). */
|
|
314
|
+
function binaryLivesUnderPrefix(binPath, prefix) {
|
|
315
|
+
const binDir = path.join(prefix, "bin") + path.sep;
|
|
316
|
+
return (binPath + path.sep).startsWith(binDir);
|
|
317
|
+
}
|
|
318
|
+
/** prefix that owns a `<prefix>/bin/rift` binary, or null if not that shape. */
|
|
319
|
+
function deriveBinPrefix(binPath) {
|
|
320
|
+
if (!binPath)
|
|
321
|
+
return null;
|
|
322
|
+
const binDir = path.dirname(binPath);
|
|
323
|
+
return path.basename(binDir) === "bin" ? path.dirname(binDir) : null;
|
|
324
|
+
}
|
|
325
|
+
function defaultNpmInstall(spec, useSudo, prefix) {
|
|
326
|
+
return new Promise((resolve) => {
|
|
327
|
+
const prefixArgs = prefix ? ["--prefix", prefix] : [];
|
|
328
|
+
// `--prefer-online` forces npm to revalidate registry metadata instead of
|
|
329
|
+
// trusting a possibly-stale local cache — defense in depth on top of the
|
|
330
|
+
// pinned exact version, so even the tag-fallback path installs fresh.
|
|
331
|
+
const baseArgs = ["install", "-g", "--prefer-online", ...prefixArgs, spec];
|
|
332
|
+
const cmd = useSudo ? "sudo" : "npm";
|
|
333
|
+
const args = useSudo ? ["npm", ...baseArgs] : baseArgs;
|
|
334
|
+
const child = spawn(cmd, args, { stdio: "inherit" });
|
|
335
|
+
child.on("error", () => resolve(1));
|
|
336
|
+
child.on("close", (code) => resolve(code ?? 1));
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
/** Run a command, capture trimmed stdout, return null on any failure. */
|
|
340
|
+
function capture(cmd, args) {
|
|
341
|
+
return new Promise((resolve) => {
|
|
342
|
+
execFile(cmd, args, { timeout: 20_000, encoding: "utf8" }, (err, stdout) => {
|
|
343
|
+
if (err) {
|
|
344
|
+
resolve(null);
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
const out = stdout.trim();
|
|
348
|
+
resolve(out.length > 0 ? out : null);
|
|
349
|
+
});
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Resolve the `rift` the friend's shell runs and the prefix that owns it.
|
|
354
|
+
* Uses `command -v rift` (PATH lookup) rather than this process's own path —
|
|
355
|
+
* the running update is the OLD build, and we want the binary a fresh shell
|
|
356
|
+
* would launch. Prefix is the parent of the binary's `bin/` dir, which is
|
|
357
|
+
* exactly what `npm install -g --prefix` expects.
|
|
358
|
+
*/
|
|
359
|
+
async function defaultResolveActiveCli() {
|
|
360
|
+
const binPath = await capture("/bin/sh", ["-c", "command -v rift"]);
|
|
361
|
+
if (!binPath)
|
|
362
|
+
return { binPath: null, prefix: null };
|
|
363
|
+
// /opt/homebrew/bin/rift → bin dir /opt/homebrew/bin → prefix /opt/homebrew
|
|
364
|
+
const binDir = path.dirname(binPath);
|
|
365
|
+
const prefix = path.basename(binDir) === "bin" ? path.dirname(binDir) : null;
|
|
366
|
+
return { binPath, prefix };
|
|
367
|
+
}
|
|
368
|
+
/** Version reported by the `rift` on PATH (`rift --version`). */
|
|
369
|
+
async function defaultGetActiveCliVersion() {
|
|
370
|
+
const out = await capture("/bin/sh", ["-c", "rift --version"]);
|
|
371
|
+
if (!out)
|
|
372
|
+
return null;
|
|
373
|
+
// commander prints a bare version line; tolerate any extra decoration.
|
|
374
|
+
const match = out.match(/\d+\.\d+\.\d+[^\s]*/);
|
|
375
|
+
return match ? match[0] : out;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Expected version from the published `@beta` dist-tag, with FRESH metadata.
|
|
379
|
+
* `--prefer-online` is load-bearing: without it this probe can read the same
|
|
380
|
+
* stale cache the install did, so a no-op install would "verify" against an
|
|
381
|
+
* equally-stale expected version and the command would lie.
|
|
382
|
+
*/
|
|
383
|
+
function defaultGetExpectedVersion() {
|
|
384
|
+
return capture("npm", ["view", "--prefer-online", RIFT_BETA_TAG, "version"]);
|
|
385
|
+
}
|
|
386
|
+
/** npm's own global prefix (`npm prefix -g`). */
|
|
387
|
+
function defaultGetNpmGlobalPrefix() {
|
|
388
|
+
return capture("npm", ["prefix", "-g"]);
|
|
389
|
+
}
|
|
390
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../src/cli/commands/update.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,eAAe,EACf,aAAa,GACd,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAc,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhE,MAAM,iBAAiB,GAAG,eAAe,CAAC;AAC1C,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;AAC/C,MAAM,aAAa,GAAG,oBAAoB,CAAC;AAC3C,MAAM,eAAe,GAAG,uBAAuB,CAAC;AAChD,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAuDjC,MAAM,aAAa,GAAiB;IAClC,aAAa,EAAE,iBAAiB;IAChC,gBAAgB,EAAE,uBAAuB;IACzC,mBAAmB,EAAE,0BAA0B;IAC/C,kBAAkB,EAAE,yBAAyB;IAC7C,kBAAkB,EAAE,yBAAyB;IAC7C,SAAS,EAAE,eAAe;IAC1B,aAAa;IACb,cAAc;CACf,CAAC;AAEF,MAAM,UAAU,iBAAiB;IAC/B,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC;SACzB,WAAW,CAAC,gEAAgE,CAAC;SAC7E,MA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K,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AAC7B,CAAC;AAED,iEAAiE;AACjE,KAAK,UAAU,0BAA0B;IACvC,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAC/D,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IACtB,uEAAuE;IACvE,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAC/C,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;AAChC,CAAC;AAED;;;;;GAKG;AACH,SAAS,yBAAyB;IAChC,OAAO,OAAO,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,iBAAiB,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC;AAC/E,CAAC;AAED,iDAAiD;AACjD,SAAS,yBAAyB;IAChC,OAAO,OAAO,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical config path used when `--config` is not provided.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the path written by `scripts/install.sh`:
|
|
5
|
+
* $HOME/Library/Application Support/Rift/data/config.json
|
|
6
|
+
*
|
|
7
|
+
* Without this, the CLI default was `config.json` (relative to cwd),
|
|
8
|
+
* which broke every invocation made outside the data dir on a fresh
|
|
9
|
+
* friend install — `rift status` from the home folder would `ENOENT`.
|
|
10
|
+
*
|
|
11
|
+
* Override with the `RIFT_CONFIG` env var (absolute path) for tests
|
|
12
|
+
* or operators running multiple instances side-by-side.
|
|
13
|
+
*/
|
|
14
|
+
export declare function defaultConfigPath(): string;
|
|
15
|
+
//# sourceMappingURL=default-config-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-config-path.d.ts","sourceRoot":"","sources":["../../../src/cli/default-config-path.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAiB1C"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import os from "node:os";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
/**
|
|
4
|
+
* Canonical config path used when `--config` is not provided.
|
|
5
|
+
*
|
|
6
|
+
* Mirrors the path written by `scripts/install.sh`:
|
|
7
|
+
* $HOME/Library/Application Support/Rift/data/config.json
|
|
8
|
+
*
|
|
9
|
+
* Without this, the CLI default was `config.json` (relative to cwd),
|
|
10
|
+
* which broke every invocation made outside the data dir on a fresh
|
|
11
|
+
* friend install — `rift status` from the home folder would `ENOENT`.
|
|
12
|
+
*
|
|
13
|
+
* Override with the `RIFT_CONFIG` env var (absolute path) for tests
|
|
14
|
+
* or operators running multiple instances side-by-side.
|
|
15
|
+
*/
|
|
16
|
+
export function defaultConfigPath() {
|
|
17
|
+
// Per A-2.1: empty or whitespace-only RIFT_CONFIG falls through to the
|
|
18
|
+
// default. Treating " " as set would give the user a confusing
|
|
19
|
+
// `Config not found at /<cwd>` message later, when they think they
|
|
20
|
+
// didn't set the env var at all.
|
|
21
|
+
const override = process.env.RIFT_CONFIG;
|
|
22
|
+
if (typeof override === "string" && override.trim().length > 0) {
|
|
23
|
+
return path.resolve(override);
|
|
24
|
+
}
|
|
25
|
+
return path.join(os.homedir(), "Library", "Application Support", "Rift", "data", "config.json");
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=default-config-path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-config-path.js","sourceRoot":"","sources":["../../../src/cli/default-config-path.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,iBAAiB;IAC/B,uEAAuE;IACvE,iEAAiE;IACjE,mEAAmE;IACnE,iCAAiC;IACjC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;IACzC,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,IAAI,CAAC,IAAI,CACd,EAAE,CAAC,OAAO,EAAE,EACZ,SAAS,EACT,qBAAqB,EACrB,MAAM,EACN,MAAM,EACN,aAAa,CACd,CAAC;AACJ,CAAC"}
|
|
@@ -1,21 +1,67 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import type { RelaySecretStore } from "./relay-secret-store.js";
|
|
2
3
|
export declare const FeedbackConfigSchema: z.ZodObject<{
|
|
3
4
|
enabled: z.ZodBoolean;
|
|
4
5
|
url: z.ZodOptional<z.ZodString>;
|
|
5
6
|
installation_id: z.ZodOptional<z.ZodString>;
|
|
6
7
|
hmac_secret: z.ZodOptional<z.ZodString>;
|
|
8
|
+
unsigned: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
+
email: z.ZodOptional<z.ZodString>;
|
|
7
10
|
}, "strict", z.ZodTypeAny, {
|
|
8
11
|
enabled: boolean;
|
|
9
12
|
url?: string | undefined;
|
|
13
|
+
email?: string | undefined;
|
|
10
14
|
installation_id?: string | undefined;
|
|
11
15
|
hmac_secret?: string | undefined;
|
|
16
|
+
unsigned?: boolean | undefined;
|
|
12
17
|
}, {
|
|
13
18
|
enabled: boolean;
|
|
14
19
|
url?: string | undefined;
|
|
20
|
+
email?: string | undefined;
|
|
15
21
|
installation_id?: string | undefined;
|
|
16
22
|
hmac_secret?: string | undefined;
|
|
23
|
+
unsigned?: boolean | undefined;
|
|
17
24
|
}>;
|
|
18
25
|
export type FeedbackConfig = z.infer<typeof FeedbackConfigSchema>;
|
|
19
26
|
export declare function feedbackConfigPath(dataDir: string): string;
|
|
20
27
|
export declare function loadFeedbackConfig(dataDir: string): FeedbackConfig;
|
|
28
|
+
/**
|
|
29
|
+
* Persist the feedback config, ALWAYS stripping the deprecated `hmac_secret`
|
|
30
|
+
* — the secret belongs in the Keychain, never the sidecar. Writes mode 0600.
|
|
31
|
+
*/
|
|
32
|
+
export declare function writeFeedbackConfig(dataDir: string, cfg: FeedbackConfig): void;
|
|
33
|
+
/**
|
|
34
|
+
* Resolve the relay HMAC secret, migrating a legacy plaintext sidecar secret
|
|
35
|
+
* into the Keychain on first use. Order:
|
|
36
|
+
* 1. Keychain (the canonical home) — return it if present.
|
|
37
|
+
* 2. Legacy `hmac_secret` in the sidecar — write it to the Keychain, strip
|
|
38
|
+
* it from the file, then return it.
|
|
39
|
+
* 3. None / not securely resolvable — return null.
|
|
40
|
+
*
|
|
41
|
+
* NEVER returns a secret that isn't (or didn't just become) securely stored:
|
|
42
|
+
* - If the Keychain READ fails (e.g. locked), returns null — the caller must
|
|
43
|
+
* not downgrade to an unsigned production POST.
|
|
44
|
+
* - A legacy plaintext secret is returned ONLY after it is successfully
|
|
45
|
+
* written to the Keychain. If that write fails, returns null (no silent
|
|
46
|
+
* plaintext fallback); migration retries next time once the Keychain is
|
|
47
|
+
* reachable.
|
|
48
|
+
*
|
|
49
|
+
* NEVER throws — it runs in the best-effort `rift feedback` relay path. The
|
|
50
|
+
* plaintext strip is best-effort and RETRYABLE: a strip that fails (e.g. a
|
|
51
|
+
* read-only sidecar) leaves the plaintext for a later call to remove, and a
|
|
52
|
+
* later call strips a lingering plaintext copy even when the Keychain already
|
|
53
|
+
* holds the secret (the partial-migration case).
|
|
54
|
+
*/
|
|
55
|
+
export declare function resolveRelaySecret(deps: {
|
|
56
|
+
dataDir: string;
|
|
57
|
+
store: RelaySecretStore;
|
|
58
|
+
}): Promise<string | null>;
|
|
59
|
+
/**
|
|
60
|
+
* Turn the relay on for this install (from an accepted invite or operator
|
|
61
|
+
* flags): set `enabled` + `url`, mint an `installation_id` when absent, and
|
|
62
|
+
* preserve any existing email. `writeFeedbackConfig` guarantees no secret
|
|
63
|
+
* lands in the sidecar — the caller writes the secret to the Keychain. Returns
|
|
64
|
+
* the persisted config.
|
|
65
|
+
*/
|
|
66
|
+
export declare function applyRelayUrl(dataDir: string, url: string): FeedbackConfig;
|
|
21
67
|
//# sourceMappingURL=feedback-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feedback-config.d.ts","sourceRoot":"","sources":["../../../../src/cli/feedback/feedback-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"feedback-config.d.ts","sourceRoot":"","sources":["../../../../src/cli/feedback/feedback-config.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;EAmBtB,CAAC;AAEZ,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,CAclE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,cAAc,GAAG,IAAI,CAc9E;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,gBAAgB,CAAC;CACzB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA6BzB;AAkBD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,cAAc,CAU1E"}
|