onadit 0.0.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.dev.md +124 -0
- package/README.md +194 -2
- package/dist/src/auth/keychain.d.ts +42 -0
- package/dist/src/auth/keychain.d.ts.map +1 -0
- package/dist/src/auth/keychain.js +177 -0
- package/dist/src/auth/keychain.js.map +1 -0
- package/dist/src/auth/middleware.d.ts +21 -0
- package/dist/src/auth/middleware.d.ts.map +1 -0
- package/dist/src/auth/middleware.js +93 -0
- package/dist/src/auth/middleware.js.map +1 -0
- package/dist/src/auth/rate-limit.d.ts +16 -0
- package/dist/src/auth/rate-limit.d.ts.map +1 -0
- package/dist/src/auth/rate-limit.js +38 -0
- package/dist/src/auth/rate-limit.js.map +1 -0
- package/dist/src/auth/rotation.d.ts +67 -0
- package/dist/src/auth/rotation.d.ts.map +1 -0
- package/dist/src/auth/rotation.js +190 -0
- package/dist/src/auth/rotation.js.map +1 -0
- package/dist/src/backfill/project-context-batch-constructor.d.ts +127 -0
- package/dist/src/backfill/project-context-batch-constructor.d.ts.map +1 -0
- package/dist/src/backfill/project-context-batch-constructor.js +210 -0
- package/dist/src/backfill/project-context-batch-constructor.js.map +1 -0
- package/dist/src/capture/assistant-text-lookup.d.ts +31 -0
- package/dist/src/capture/assistant-text-lookup.d.ts.map +1 -0
- package/dist/src/capture/assistant-text-lookup.js +222 -0
- package/dist/src/capture/assistant-text-lookup.js.map +1 -0
- package/dist/src/capture/auto-capture.d.ts +322 -0
- package/dist/src/capture/auto-capture.d.ts.map +1 -0
- package/dist/src/capture/auto-capture.js +1167 -0
- package/dist/src/capture/auto-capture.js.map +1 -0
- package/dist/src/capture/auto-repair.d.ts +125 -0
- package/dist/src/capture/auto-repair.d.ts.map +1 -0
- package/dist/src/capture/auto-repair.js +280 -0
- package/dist/src/capture/auto-repair.js.map +1 -0
- package/dist/src/capture/batch-budget.d.ts +90 -0
- package/dist/src/capture/batch-budget.d.ts.map +1 -0
- package/dist/src/capture/batch-budget.js +148 -0
- package/dist/src/capture/batch-budget.js.map +1 -0
- package/dist/src/capture/claude-cli-triage-provider.d.ts +28 -0
- package/dist/src/capture/claude-cli-triage-provider.d.ts.map +1 -0
- package/dist/src/capture/claude-cli-triage-provider.js +101 -0
- package/dist/src/capture/claude-cli-triage-provider.js.map +1 -0
- package/dist/src/capture/codex-cli-triage-provider.d.ts +17 -0
- package/dist/src/capture/codex-cli-triage-provider.d.ts.map +1 -0
- package/dist/src/capture/codex-cli-triage-provider.js +91 -0
- package/dist/src/capture/codex-cli-triage-provider.js.map +1 -0
- package/dist/src/capture/cursor-capture.d.ts +89 -0
- package/dist/src/capture/cursor-capture.d.ts.map +1 -0
- package/dist/src/capture/cursor-capture.js +121 -0
- package/dist/src/capture/cursor-capture.js.map +1 -0
- package/dist/src/capture/observability.d.ts +131 -0
- package/dist/src/capture/observability.d.ts.map +1 -0
- package/dist/src/capture/observability.js +181 -0
- package/dist/src/capture/observability.js.map +1 -0
- package/dist/src/capture/openai-triage-provider.d.ts +92 -0
- package/dist/src/capture/openai-triage-provider.d.ts.map +1 -0
- package/dist/src/capture/openai-triage-provider.js +267 -0
- package/dist/src/capture/openai-triage-provider.js.map +1 -0
- package/dist/src/capture/recover-quarantine.d.ts +273 -0
- package/dist/src/capture/recover-quarantine.d.ts.map +1 -0
- package/dist/src/capture/recover-quarantine.js +581 -0
- package/dist/src/capture/recover-quarantine.js.map +1 -0
- package/dist/src/capture/review-queue-index.d.ts +51 -0
- package/dist/src/capture/review-queue-index.d.ts.map +1 -0
- package/dist/src/capture/review-queue-index.js +204 -0
- package/dist/src/capture/review-queue-index.js.map +1 -0
- package/dist/src/capture/review-queue.d.ts +47 -0
- package/dist/src/capture/review-queue.d.ts.map +1 -0
- package/dist/src/capture/review-queue.js +116 -0
- package/dist/src/capture/review-queue.js.map +1 -0
- package/dist/src/capture/sources.d.ts +53 -0
- package/dist/src/capture/sources.d.ts.map +1 -0
- package/dist/src/capture/sources.js +55 -0
- package/dist/src/capture/sources.js.map +1 -0
- package/dist/src/capture/stored-statements.d.ts +9 -0
- package/dist/src/capture/stored-statements.d.ts.map +1 -0
- package/dist/src/capture/stored-statements.js +63 -0
- package/dist/src/capture/stored-statements.js.map +1 -0
- package/dist/src/capture/triage-classification.d.ts +92 -0
- package/dist/src/capture/triage-classification.d.ts.map +1 -0
- package/dist/src/capture/triage-classification.js +94 -0
- package/dist/src/capture/triage-classification.js.map +1 -0
- package/dist/src/capture/triage-lane.d.ts +39 -0
- package/dist/src/capture/triage-lane.d.ts.map +1 -0
- package/dist/src/capture/triage-lane.js +217 -0
- package/dist/src/capture/triage-lane.js.map +1 -0
- package/dist/src/capture/triage-provider-factory.d.ts +36 -0
- package/dist/src/capture/triage-provider-factory.d.ts.map +1 -0
- package/dist/src/capture/triage-provider-factory.js +55 -0
- package/dist/src/capture/triage-provider-factory.js.map +1 -0
- package/dist/src/capture/triage-provider.d.ts +82 -0
- package/dist/src/capture/triage-provider.d.ts.map +1 -0
- package/dist/src/capture/triage-provider.js +126 -0
- package/dist/src/capture/triage-provider.js.map +1 -0
- package/dist/src/capture/triage.d.ts +30 -0
- package/dist/src/capture/triage.d.ts.map +1 -0
- package/dist/src/capture/triage.js +50 -0
- package/dist/src/capture/triage.js.map +1 -0
- package/dist/src/capture/user-statements-recheck.d.ts +22 -0
- package/dist/src/capture/user-statements-recheck.d.ts.map +1 -0
- package/dist/src/capture/user-statements-recheck.js +181 -0
- package/dist/src/capture/user-statements-recheck.js.map +1 -0
- package/dist/src/capture/user-statements.d.ts +84 -0
- package/dist/src/capture/user-statements.d.ts.map +1 -0
- package/dist/src/capture/user-statements.js +617 -0
- package/dist/src/capture/user-statements.js.map +1 -0
- package/dist/src/cli/agent-homes.d.ts +15 -0
- package/dist/src/cli/agent-homes.d.ts.map +1 -0
- package/dist/src/cli/agent-homes.js +45 -0
- package/dist/src/cli/agent-homes.js.map +1 -0
- package/dist/src/cli/commands/backfill.d.ts +3 -0
- package/dist/src/cli/commands/backfill.d.ts.map +1 -0
- package/dist/src/cli/commands/backfill.js +1379 -0
- package/dist/src/cli/commands/backfill.js.map +1 -0
- package/dist/src/cli/commands/brief.d.ts +12 -0
- package/dist/src/cli/commands/brief.d.ts.map +1 -0
- package/dist/src/cli/commands/brief.js +131 -0
- package/dist/src/cli/commands/brief.js.map +1 -0
- package/dist/src/cli/commands/bulk-ingest.d.ts +3 -0
- package/dist/src/cli/commands/bulk-ingest.d.ts.map +1 -0
- package/dist/src/cli/commands/bulk-ingest.js +126 -0
- package/dist/src/cli/commands/bulk-ingest.js.map +1 -0
- 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 +194 -0
- package/dist/src/cli/commands/capture-recover.js.map +1 -0
- package/dist/src/cli/commands/capture.d.ts +12 -0
- package/dist/src/cli/commands/capture.d.ts.map +1 -0
- package/dist/src/cli/commands/capture.js +304 -0
- package/dist/src/cli/commands/capture.js.map +1 -0
- package/dist/src/cli/commands/chunk-backfill.d.ts +13 -0
- package/dist/src/cli/commands/chunk-backfill.d.ts.map +1 -0
- package/dist/src/cli/commands/chunk-backfill.js +157 -0
- package/dist/src/cli/commands/chunk-backfill.js.map +1 -0
- package/dist/src/cli/commands/compact.d.ts +3 -0
- package/dist/src/cli/commands/compact.d.ts.map +1 -0
- package/dist/src/cli/commands/compact.js +70 -0
- package/dist/src/cli/commands/compact.js.map +1 -0
- package/dist/src/cli/commands/cursor-probe.d.ts +20 -0
- package/dist/src/cli/commands/cursor-probe.d.ts.map +1 -0
- package/dist/src/cli/commands/cursor-probe.js +162 -0
- package/dist/src/cli/commands/cursor-probe.js.map +1 -0
- 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 +259 -0
- package/dist/src/cli/commands/doctor.js.map +1 -0
- package/dist/src/cli/commands/feedback.d.ts +34 -0
- package/dist/src/cli/commands/feedback.d.ts.map +1 -0
- package/dist/src/cli/commands/feedback.js +214 -0
- package/dist/src/cli/commands/feedback.js.map +1 -0
- package/dist/src/cli/commands/hooks-install.d.ts +66 -0
- package/dist/src/cli/commands/hooks-install.d.ts.map +1 -0
- package/dist/src/cli/commands/hooks-install.js +228 -0
- package/dist/src/cli/commands/hooks-install.js.map +1 -0
- package/dist/src/cli/commands/import.d.ts +19 -0
- package/dist/src/cli/commands/import.d.ts.map +1 -0
- package/dist/src/cli/commands/import.js +258 -0
- package/dist/src/cli/commands/import.js.map +1 -0
- package/dist/src/cli/commands/ingest.d.ts +3 -0
- package/dist/src/cli/commands/ingest.d.ts.map +1 -0
- package/dist/src/cli/commands/ingest.js +80 -0
- package/dist/src/cli/commands/ingest.js.map +1 -0
- package/dist/src/cli/commands/mcp-install.d.ts +65 -0
- package/dist/src/cli/commands/mcp-install.d.ts.map +1 -0
- package/dist/src/cli/commands/mcp-install.js +306 -0
- package/dist/src/cli/commands/mcp-install.js.map +1 -0
- package/dist/src/cli/commands/menubar.d.ts +127 -0
- package/dist/src/cli/commands/menubar.d.ts.map +1 -0
- package/dist/src/cli/commands/menubar.js +585 -0
- package/dist/src/cli/commands/menubar.js.map +1 -0
- package/dist/src/cli/commands/onboard-first-run.d.ts +5 -0
- package/dist/src/cli/commands/onboard-first-run.d.ts.map +1 -0
- package/dist/src/cli/commands/onboard-first-run.js +156 -0
- package/dist/src/cli/commands/onboard-first-run.js.map +1 -0
- package/dist/src/cli/commands/onboard.d.ts +336 -0
- package/dist/src/cli/commands/onboard.d.ts.map +1 -0
- package/dist/src/cli/commands/onboard.js +1873 -0
- package/dist/src/cli/commands/onboard.js.map +1 -0
- package/dist/src/cli/commands/rebuild.d.ts +12 -0
- package/dist/src/cli/commands/rebuild.d.ts.map +1 -0
- package/dist/src/cli/commands/rebuild.js +167 -0
- package/dist/src/cli/commands/rebuild.js.map +1 -0
- package/dist/src/cli/commands/reconcile.d.ts +3 -0
- package/dist/src/cli/commands/reconcile.d.ts.map +1 -0
- package/dist/src/cli/commands/reconcile.js +68 -0
- package/dist/src/cli/commands/reconcile.js.map +1 -0
- package/dist/src/cli/commands/reindex.d.ts +3 -0
- package/dist/src/cli/commands/reindex.d.ts.map +1 -0
- package/dist/src/cli/commands/reindex.js +66 -0
- package/dist/src/cli/commands/reindex.js.map +1 -0
- package/dist/src/cli/commands/review.d.ts +13 -0
- package/dist/src/cli/commands/review.d.ts.map +1 -0
- package/dist/src/cli/commands/review.js +401 -0
- package/dist/src/cli/commands/review.js.map +1 -0
- package/dist/src/cli/commands/save.d.ts +3 -0
- package/dist/src/cli/commands/save.d.ts.map +1 -0
- package/dist/src/cli/commands/save.js +111 -0
- package/dist/src/cli/commands/save.js.map +1 -0
- package/dist/src/cli/commands/search.d.ts +37 -0
- package/dist/src/cli/commands/search.d.ts.map +1 -0
- package/dist/src/cli/commands/search.js +118 -0
- package/dist/src/cli/commands/search.js.map +1 -0
- package/dist/src/cli/commands/setup.d.ts +30 -0
- package/dist/src/cli/commands/setup.d.ts.map +1 -0
- package/dist/src/cli/commands/setup.js +122 -0
- package/dist/src/cli/commands/setup.js.map +1 -0
- package/dist/src/cli/commands/stats.d.ts +3 -0
- package/dist/src/cli/commands/stats.d.ts.map +1 -0
- package/dist/src/cli/commands/stats.js +42 -0
- package/dist/src/cli/commands/stats.js.map +1 -0
- package/dist/src/cli/commands/status.d.ts +17 -0
- package/dist/src/cli/commands/status.d.ts.map +1 -0
- package/dist/src/cli/commands/status.js +206 -0
- package/dist/src/cli/commands/status.js.map +1 -0
- package/dist/src/cli/commands/token-issue.d.ts +3 -0
- package/dist/src/cli/commands/token-issue.d.ts.map +1 -0
- package/dist/src/cli/commands/token-issue.js +33 -0
- package/dist/src/cli/commands/token-issue.js.map +1 -0
- package/dist/src/cli/commands/triage.d.ts +3 -0
- package/dist/src/cli/commands/triage.d.ts.map +1 -0
- package/dist/src/cli/commands/triage.js +127 -0
- package/dist/src/cli/commands/triage.js.map +1 -0
- package/dist/src/cli/commands/uninstall.d.ts +85 -0
- package/dist/src/cli/commands/uninstall.d.ts.map +1 -0
- package/dist/src/cli/commands/uninstall.js +512 -0
- package/dist/src/cli/commands/uninstall.js.map +1 -0
- package/dist/src/cli/commands/update.d.ts +105 -0
- package/dist/src/cli/commands/update.d.ts.map +1 -0
- package/dist/src/cli/commands/update.js +559 -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 +28 -0
- package/dist/src/cli/default-config-path.js.map +1 -0
- package/dist/src/cli/feedback/feedback-config.d.ts +67 -0
- package/dist/src/cli/feedback/feedback-config.d.ts.map +1 -0
- package/dist/src/cli/feedback/feedback-config.js +169 -0
- package/dist/src/cli/feedback/feedback-config.js.map +1 -0
- package/dist/src/cli/feedback/feedback-history.d.ts +11 -0
- package/dist/src/cli/feedback/feedback-history.d.ts.map +1 -0
- package/dist/src/cli/feedback/feedback-history.js +145 -0
- package/dist/src/cli/feedback/feedback-history.js.map +1 -0
- package/dist/src/cli/feedback/feedback-payload.d.ts +74 -0
- package/dist/src/cli/feedback/feedback-payload.d.ts.map +1 -0
- package/dist/src/cli/feedback/feedback-payload.js +10 -0
- package/dist/src/cli/feedback/feedback-payload.js.map +1 -0
- package/dist/src/cli/feedback/feedback-relay.d.ts +15 -0
- package/dist/src/cli/feedback/feedback-relay.d.ts.map +1 -0
- package/dist/src/cli/feedback/feedback-relay.js +47 -0
- package/dist/src/cli/feedback/feedback-relay.js.map +1 -0
- package/dist/src/cli/feedback/feedback-status.d.ts +11 -0
- package/dist/src/cli/feedback/feedback-status.d.ts.map +1 -0
- package/dist/src/cli/feedback/feedback-status.js +122 -0
- package/dist/src/cli/feedback/feedback-status.js.map +1 -0
- 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 +73 -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/hooks-writers/claude-code-policy-script.d.ts +35 -0
- package/dist/src/cli/hooks-writers/claude-code-policy-script.d.ts.map +1 -0
- package/dist/src/cli/hooks-writers/claude-code-policy-script.js +122 -0
- package/dist/src/cli/hooks-writers/claude-code-policy-script.js.map +1 -0
- package/dist/src/cli/hooks-writers/claude-code.d.ts +63 -0
- package/dist/src/cli/hooks-writers/claude-code.d.ts.map +1 -0
- package/dist/src/cli/hooks-writers/claude-code.js +289 -0
- package/dist/src/cli/hooks-writers/claude-code.js.map +1 -0
- package/dist/src/cli/hooks-writers/codex.d.ts +16 -0
- package/dist/src/cli/hooks-writers/codex.d.ts.map +1 -0
- package/dist/src/cli/hooks-writers/codex.js +17 -0
- package/dist/src/cli/hooks-writers/codex.js.map +1 -0
- package/dist/src/cli/hooks-writers/errors.d.ts +16 -0
- package/dist/src/cli/hooks-writers/errors.d.ts.map +1 -0
- package/dist/src/cli/hooks-writers/errors.js +24 -0
- package/dist/src/cli/hooks-writers/errors.js.map +1 -0
- package/dist/src/cli/hooks-writers/index.d.ts +23 -0
- package/dist/src/cli/hooks-writers/index.d.ts.map +1 -0
- package/dist/src/cli/hooks-writers/index.js +34 -0
- package/dist/src/cli/hooks-writers/index.js.map +1 -0
- package/dist/src/cli/hooks-writers/state.d.ts +43 -0
- package/dist/src/cli/hooks-writers/state.d.ts.map +1 -0
- package/dist/src/cli/hooks-writers/state.js +225 -0
- package/dist/src/cli/hooks-writers/state.js.map +1 -0
- package/dist/src/cli/hooks-writers/types.d.ts +28 -0
- package/dist/src/cli/hooks-writers/types.d.ts.map +1 -0
- package/dist/src/cli/hooks-writers/types.js +8 -0
- package/dist/src/cli/hooks-writers/types.js.map +1 -0
- package/dist/src/cli/http-client.d.ts +128 -0
- package/dist/src/cli/http-client.d.ts.map +1 -0
- package/dist/src/cli/http-client.js +401 -0
- package/dist/src/cli/http-client.js.map +1 -0
- package/dist/src/cli/index.d.ts +4 -0
- package/dist/src/cli/index.d.ts.map +1 -0
- package/dist/src/cli/index.js +99 -0
- package/dist/src/cli/index.js.map +1 -0
- package/dist/src/cli/job-poller.d.ts +13 -0
- package/dist/src/cli/job-poller.d.ts.map +1 -0
- package/dist/src/cli/job-poller.js +29 -0
- package/dist/src/cli/job-poller.js.map +1 -0
- package/dist/src/cli/mcp-config-writers/codex-toml.d.ts +20 -0
- package/dist/src/cli/mcp-config-writers/codex-toml.d.ts.map +1 -0
- package/dist/src/cli/mcp-config-writers/codex-toml.js +918 -0
- package/dist/src/cli/mcp-config-writers/codex-toml.js.map +1 -0
- package/dist/src/cli/mcp-config-writers/earlier-name-restrictions.d.ts +11 -0
- package/dist/src/cli/mcp-config-writers/earlier-name-restrictions.d.ts.map +1 -0
- package/dist/src/cli/mcp-config-writers/earlier-name-restrictions.js +152 -0
- package/dist/src/cli/mcp-config-writers/earlier-name-restrictions.js.map +1 -0
- package/dist/src/cli/mcp-config-writers/errors.d.ts +17 -0
- package/dist/src/cli/mcp-config-writers/errors.d.ts.map +1 -0
- package/dist/src/cli/mcp-config-writers/errors.js +13 -0
- package/dist/src/cli/mcp-config-writers/errors.js.map +1 -0
- package/dist/src/cli/mcp-config-writers/index.d.ts +28 -0
- package/dist/src/cli/mcp-config-writers/index.d.ts.map +1 -0
- package/dist/src/cli/mcp-config-writers/index.js +70 -0
- package/dist/src/cli/mcp-config-writers/index.js.map +1 -0
- package/dist/src/cli/mcp-config-writers/json-config.d.ts +20 -0
- package/dist/src/cli/mcp-config-writers/json-config.d.ts.map +1 -0
- package/dist/src/cli/mcp-config-writers/json-config.js +301 -0
- package/dist/src/cli/mcp-config-writers/json-config.js.map +1 -0
- package/dist/src/cli/mcp-config-writers/left-in-folder.d.ts +18 -0
- package/dist/src/cli/mcp-config-writers/left-in-folder.d.ts.map +1 -0
- package/dist/src/cli/mcp-config-writers/left-in-folder.js +140 -0
- package/dist/src/cli/mcp-config-writers/left-in-folder.js.map +1 -0
- package/dist/src/cli/mcp-config-writers/redact.d.ts +28 -0
- package/dist/src/cli/mcp-config-writers/redact.d.ts.map +1 -0
- package/dist/src/cli/mcp-config-writers/redact.js +48 -0
- package/dist/src/cli/mcp-config-writers/redact.js.map +1 -0
- package/dist/src/cli/mcp-config-writers/types.d.ts +46 -0
- package/dist/src/cli/mcp-config-writers/types.d.ts.map +1 -0
- package/dist/src/cli/mcp-config-writers/types.js +5 -0
- package/dist/src/cli/mcp-config-writers/types.js.map +1 -0
- package/dist/src/cli/output.d.ts +8 -0
- package/dist/src/cli/output.d.ts.map +1 -0
- package/dist/src/cli/output.js +34 -0
- package/dist/src/cli/output.js.map +1 -0
- package/dist/src/cli/postinstall-menubar.d.ts +38 -0
- package/dist/src/cli/postinstall-menubar.d.ts.map +1 -0
- package/dist/src/cli/postinstall-menubar.js +139 -0
- package/dist/src/cli/postinstall-menubar.js.map +1 -0
- package/dist/src/cli/status/friend-header.d.ts +61 -0
- package/dist/src/cli/status/friend-header.d.ts.map +1 -0
- package/dist/src/cli/status/friend-header.js +727 -0
- package/dist/src/cli/status/friend-header.js.map +1 -0
- package/dist/src/cli/status/local-signals.d.ts +89 -0
- package/dist/src/cli/status/local-signals.d.ts.map +1 -0
- package/dist/src/cli/status/local-signals.js +194 -0
- package/dist/src/cli/status/local-signals.js.map +1 -0
- package/dist/src/cli/token.d.ts +37 -0
- package/dist/src/cli/token.d.ts.map +1 -0
- package/dist/src/cli/token.js +105 -0
- package/dist/src/cli/token.js.map +1 -0
- 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/cli/uninstall/mcp-uninstall.d.ts +33 -0
- package/dist/src/cli/uninstall/mcp-uninstall.d.ts.map +1 -0
- package/dist/src/cli/uninstall/mcp-uninstall.js +116 -0
- package/dist/src/cli/uninstall/mcp-uninstall.js.map +1 -0
- package/dist/src/config/loader.d.ts +9 -0
- package/dist/src/config/loader.d.ts.map +1 -0
- package/dist/src/config/loader.js +73 -0
- package/dist/src/config/loader.js.map +1 -0
- package/dist/src/config/schema.d.ts +956 -0
- package/dist/src/config/schema.d.ts.map +1 -0
- package/dist/src/config/schema.js +339 -0
- package/dist/src/config/schema.js.map +1 -0
- package/dist/src/diagnostics/claude-preflight.d.ts +35 -0
- package/dist/src/diagnostics/claude-preflight.d.ts.map +1 -0
- package/dist/src/diagnostics/claude-preflight.js +90 -0
- package/dist/src/diagnostics/claude-preflight.js.map +1 -0
- package/dist/src/diagnostics/codex-preflight.d.ts +43 -0
- package/dist/src/diagnostics/codex-preflight.d.ts.map +1 -0
- package/dist/src/diagnostics/codex-preflight.js +128 -0
- package/dist/src/diagnostics/codex-preflight.js.map +1 -0
- package/dist/src/diagnostics/doctor.d.ts +125 -0
- package/dist/src/diagnostics/doctor.d.ts.map +1 -0
- package/dist/src/diagnostics/doctor.js +450 -0
- package/dist/src/diagnostics/doctor.js.map +1 -0
- package/dist/src/diagnostics/install-layout.d.ts +40 -0
- package/dist/src/diagnostics/install-layout.d.ts.map +1 -0
- package/dist/src/diagnostics/install-layout.js +55 -0
- package/dist/src/diagnostics/install-layout.js.map +1 -0
- package/dist/src/diagnostics/memory-coverage.d.ts +54 -0
- package/dist/src/diagnostics/memory-coverage.d.ts.map +1 -0
- package/dist/src/diagnostics/memory-coverage.js +272 -0
- package/dist/src/diagnostics/memory-coverage.js.map +1 -0
- package/dist/src/diagnostics/notify.d.ts +107 -0
- package/dist/src/diagnostics/notify.d.ts.map +1 -0
- package/dist/src/diagnostics/notify.js +217 -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/bulk-ingest.d.ts +11 -0
- package/dist/src/ingestion/bulk-ingest.d.ts.map +1 -0
- package/dist/src/ingestion/bulk-ingest.js +11 -0
- package/dist/src/ingestion/bulk-ingest.js.map +1 -0
- package/dist/src/ingestion/chunk-meta.d.ts +85 -0
- package/dist/src/ingestion/chunk-meta.d.ts.map +1 -0
- package/dist/src/ingestion/chunk-meta.js +167 -0
- package/dist/src/ingestion/chunk-meta.js.map +1 -0
- package/dist/src/ingestion/chunk-text.d.ts +39 -0
- package/dist/src/ingestion/chunk-text.d.ts.map +1 -0
- package/dist/src/ingestion/chunk-text.js +114 -0
- package/dist/src/ingestion/chunk-text.js.map +1 -0
- package/dist/src/ingestion/cursor/cursor-store.d.ts +177 -0
- package/dist/src/ingestion/cursor/cursor-store.d.ts.map +1 -0
- package/dist/src/ingestion/cursor/cursor-store.js +242 -0
- package/dist/src/ingestion/cursor/cursor-store.js.map +1 -0
- package/dist/src/ingestion/cursor/enrich-roots.d.ts +16 -0
- package/dist/src/ingestion/cursor/enrich-roots.d.ts.map +1 -0
- package/dist/src/ingestion/cursor/enrich-roots.js +22 -0
- package/dist/src/ingestion/cursor/enrich-roots.js.map +1 -0
- package/dist/src/ingestion/cursor/vscdb-reader.d.ts +32 -0
- package/dist/src/ingestion/cursor/vscdb-reader.d.ts.map +1 -0
- package/dist/src/ingestion/cursor/vscdb-reader.js +113 -0
- package/dist/src/ingestion/cursor/vscdb-reader.js.map +1 -0
- package/dist/src/ingestion/cursor/workspace-root.d.ts +96 -0
- package/dist/src/ingestion/cursor/workspace-root.d.ts.map +1 -0
- package/dist/src/ingestion/cursor/workspace-root.js +187 -0
- package/dist/src/ingestion/cursor/workspace-root.js.map +1 -0
- package/dist/src/ingestion/extractor.d.ts +16 -0
- package/dist/src/ingestion/extractor.d.ts.map +1 -0
- package/dist/src/ingestion/extractor.js +85 -0
- package/dist/src/ingestion/extractor.js.map +1 -0
- package/dist/src/ingestion/extractors/docx.d.ts +3 -0
- package/dist/src/ingestion/extractors/docx.d.ts.map +1 -0
- package/dist/src/ingestion/extractors/docx.js +20 -0
- package/dist/src/ingestion/extractors/docx.js.map +1 -0
- package/dist/src/ingestion/extractors/pdf.d.ts +3 -0
- package/dist/src/ingestion/extractors/pdf.d.ts.map +1 -0
- package/dist/src/ingestion/extractors/pdf.js +32 -0
- package/dist/src/ingestion/extractors/pdf.js.map +1 -0
- package/dist/src/ingestion/historical-campaign.d.ts +340 -0
- package/dist/src/ingestion/historical-campaign.d.ts.map +1 -0
- package/dist/src/ingestion/historical-campaign.js +1010 -0
- package/dist/src/ingestion/historical-campaign.js.map +1 -0
- package/dist/src/ingestion/ignored-paths.d.ts +20 -0
- package/dist/src/ingestion/ignored-paths.d.ts.map +1 -0
- package/dist/src/ingestion/ignored-paths.js +45 -0
- package/dist/src/ingestion/ignored-paths.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 +12 -0
- package/dist/src/ingestion/inbox-watcher.d.ts.map +1 -0
- package/dist/src/ingestion/inbox-watcher.js +83 -0
- package/dist/src/ingestion/inbox-watcher.js.map +1 -0
- package/dist/src/ingestion/indexer.d.ts +39 -0
- package/dist/src/ingestion/indexer.d.ts.map +1 -0
- package/dist/src/ingestion/indexer.js +111 -0
- package/dist/src/ingestion/indexer.js.map +1 -0
- package/dist/src/ingestion/metadata-extraction.d.ts +56 -0
- package/dist/src/ingestion/metadata-extraction.d.ts.map +1 -0
- package/dist/src/ingestion/metadata-extraction.js +151 -0
- package/dist/src/ingestion/metadata-extraction.js.map +1 -0
- package/dist/src/ingestion/parsers/chatgpt-web.d.ts +29 -0
- package/dist/src/ingestion/parsers/chatgpt-web.d.ts.map +1 -0
- package/dist/src/ingestion/parsers/chatgpt-web.js +100 -0
- package/dist/src/ingestion/parsers/chatgpt-web.js.map +1 -0
- package/dist/src/ingestion/parsers/claude-code-jsonl.d.ts +26 -0
- package/dist/src/ingestion/parsers/claude-code-jsonl.d.ts.map +1 -0
- package/dist/src/ingestion/parsers/claude-code-jsonl.js +125 -0
- package/dist/src/ingestion/parsers/claude-code-jsonl.js.map +1 -0
- package/dist/src/ingestion/parsers/claude-desktop-sessions.d.ts +17 -0
- package/dist/src/ingestion/parsers/claude-desktop-sessions.d.ts.map +1 -0
- package/dist/src/ingestion/parsers/claude-desktop-sessions.js +112 -0
- package/dist/src/ingestion/parsers/claude-desktop-sessions.js.map +1 -0
- package/dist/src/ingestion/parsers/claude-web.d.ts +24 -0
- package/dist/src/ingestion/parsers/claude-web.d.ts.map +1 -0
- package/dist/src/ingestion/parsers/claude-web.js +75 -0
- package/dist/src/ingestion/parsers/claude-web.js.map +1 -0
- package/dist/src/ingestion/parsers/codex-jsonl.d.ts +18 -0
- package/dist/src/ingestion/parsers/codex-jsonl.d.ts.map +1 -0
- package/dist/src/ingestion/parsers/codex-jsonl.js +150 -0
- package/dist/src/ingestion/parsers/codex-jsonl.js.map +1 -0
- package/dist/src/ingestion/parsers/gemini-web.d.ts +16 -0
- package/dist/src/ingestion/parsers/gemini-web.d.ts.map +1 -0
- package/dist/src/ingestion/parsers/gemini-web.js +170 -0
- package/dist/src/ingestion/parsers/gemini-web.js.map +1 -0
- package/dist/src/ingestion/parsers/grok-cli.d.ts +19 -0
- package/dist/src/ingestion/parsers/grok-cli.d.ts.map +1 -0
- package/dist/src/ingestion/parsers/grok-cli.js +126 -0
- package/dist/src/ingestion/parsers/grok-cli.js.map +1 -0
- package/dist/src/ingestion/parsers/grok-web.d.ts +40 -0
- package/dist/src/ingestion/parsers/grok-web.d.ts.map +1 -0
- package/dist/src/ingestion/parsers/grok-web.js +67 -0
- package/dist/src/ingestion/parsers/grok-web.js.map +1 -0
- package/dist/src/ingestion/parsers/turns.d.ts +36 -0
- package/dist/src/ingestion/parsers/turns.d.ts.map +1 -0
- package/dist/src/ingestion/parsers/turns.js +25 -0
- package/dist/src/ingestion/parsers/turns.js.map +1 -0
- package/dist/src/ingestion/parsers/types.d.ts +47 -0
- package/dist/src/ingestion/parsers/types.d.ts.map +1 -0
- package/dist/src/ingestion/parsers/types.js +26 -0
- package/dist/src/ingestion/parsers/types.js.map +1 -0
- package/dist/src/ingestion/report-cards.d.ts +75 -0
- package/dist/src/ingestion/report-cards.d.ts.map +1 -0
- package/dist/src/ingestion/report-cards.js +224 -0
- package/dist/src/ingestion/report-cards.js.map +1 -0
- package/dist/src/ingestion/scanner.d.ts +48 -0
- package/dist/src/ingestion/scanner.d.ts.map +1 -0
- package/dist/src/ingestion/scanner.js +131 -0
- package/dist/src/ingestion/scanner.js.map +1 -0
- 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/ingestion/staging.d.ts +109 -0
- package/dist/src/ingestion/staging.d.ts.map +1 -0
- package/dist/src/ingestion/staging.js +411 -0
- package/dist/src/ingestion/staging.js.map +1 -0
- package/dist/src/ingestion/watcher.d.ts +65 -0
- package/dist/src/ingestion/watcher.d.ts.map +1 -0
- package/dist/src/ingestion/watcher.js +182 -0
- package/dist/src/ingestion/watcher.js.map +1 -0
- package/dist/src/jobs/codex-override-handler.d.ts +3 -0
- package/dist/src/jobs/codex-override-handler.d.ts.map +1 -0
- package/dist/src/jobs/codex-override-handler.js +16 -0
- package/dist/src/jobs/codex-override-handler.js.map +1 -0
- package/dist/src/jobs/handlers/compact.d.ts +30 -0
- package/dist/src/jobs/handlers/compact.d.ts.map +1 -0
- package/dist/src/jobs/handlers/compact.js +360 -0
- package/dist/src/jobs/handlers/compact.js.map +1 -0
- 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 +13 -0
- package/dist/src/jobs/handlers/ingest.d.ts.map +1 -0
- package/dist/src/jobs/handlers/ingest.js +557 -0
- package/dist/src/jobs/handlers/ingest.js.map +1 -0
- package/dist/src/jobs/handlers/optimize.d.ts +11 -0
- package/dist/src/jobs/handlers/optimize.d.ts.map +1 -0
- package/dist/src/jobs/handlers/optimize.js +12 -0
- package/dist/src/jobs/handlers/optimize.js.map +1 -0
- package/dist/src/jobs/handlers/reconcile.d.ts +57 -0
- package/dist/src/jobs/handlers/reconcile.d.ts.map +1 -0
- package/dist/src/jobs/handlers/reconcile.js +685 -0
- package/dist/src/jobs/handlers/reconcile.js.map +1 -0
- package/dist/src/jobs/handlers/reindex.d.ts +38 -0
- package/dist/src/jobs/handlers/reindex.d.ts.map +1 -0
- package/dist/src/jobs/handlers/reindex.js +63 -0
- package/dist/src/jobs/handlers/reindex.js.map +1 -0
- package/dist/src/jobs/handlers/save.d.ts +10 -0
- package/dist/src/jobs/handlers/save.d.ts.map +1 -0
- package/dist/src/jobs/handlers/save.js +316 -0
- package/dist/src/jobs/handlers/save.js.map +1 -0
- package/dist/src/jobs/handlers/triage.d.ts +47 -0
- package/dist/src/jobs/handlers/triage.d.ts.map +1 -0
- package/dist/src/jobs/handlers/triage.js +95 -0
- package/dist/src/jobs/handlers/triage.js.map +1 -0
- package/dist/src/jobs/maintenance-scheduler.d.ts +30 -0
- package/dist/src/jobs/maintenance-scheduler.d.ts.map +1 -0
- package/dist/src/jobs/maintenance-scheduler.js +41 -0
- package/dist/src/jobs/maintenance-scheduler.js.map +1 -0
- package/dist/src/jobs/queue.d.ts +157 -0
- package/dist/src/jobs/queue.d.ts.map +1 -0
- package/dist/src/jobs/queue.js +759 -0
- package/dist/src/jobs/queue.js.map +1 -0
- package/dist/src/jobs/types.d.ts +53 -0
- package/dist/src/jobs/types.d.ts.map +1 -0
- package/dist/src/jobs/types.js +33 -0
- package/dist/src/jobs/types.js.map +1 -0
- package/dist/src/jobs/worker-entry.d.ts +10 -0
- package/dist/src/jobs/worker-entry.d.ts.map +1 -0
- package/dist/src/jobs/worker-entry.js +252 -0
- package/dist/src/jobs/worker-entry.js.map +1 -0
- package/dist/src/jobs/worker-process.d.ts +67 -0
- package/dist/src/jobs/worker-process.d.ts.map +1 -0
- package/dist/src/jobs/worker-process.js +227 -0
- package/dist/src/jobs/worker-process.js.map +1 -0
- package/dist/src/jobs/worker.d.ts +11 -0
- package/dist/src/jobs/worker.d.ts.map +1 -0
- package/dist/src/jobs/worker.js +14 -0
- package/dist/src/jobs/worker.js.map +1 -0
- package/dist/src/main.d.ts +2 -0
- package/dist/src/main.d.ts.map +1 -0
- package/dist/src/main.js +683 -0
- package/dist/src/main.js.map +1 -0
- package/dist/src/mcp/capture-diagnostics.d.ts +51 -0
- package/dist/src/mcp/capture-diagnostics.d.ts.map +1 -0
- package/dist/src/mcp/capture-diagnostics.js +127 -0
- package/dist/src/mcp/capture-diagnostics.js.map +1 -0
- package/dist/src/mcp/errors.d.ts +8 -0
- package/dist/src/mcp/errors.d.ts.map +1 -0
- package/dist/src/mcp/errors.js +69 -0
- package/dist/src/mcp/errors.js.map +1 -0
- package/dist/src/mcp/memory-diagnostics.d.ts +6 -0
- package/dist/src/mcp/memory-diagnostics.d.ts.map +1 -0
- package/dist/src/mcp/memory-diagnostics.js +51 -0
- package/dist/src/mcp/memory-diagnostics.js.map +1 -0
- package/dist/src/mcp/names.d.ts +48 -0
- package/dist/src/mcp/names.d.ts.map +1 -0
- package/dist/src/mcp/names.js +77 -0
- package/dist/src/mcp/names.js.map +1 -0
- package/dist/src/mcp/server.d.ts +19 -0
- package/dist/src/mcp/server.d.ts.map +1 -0
- package/dist/src/mcp/server.js +184 -0
- package/dist/src/mcp/server.js.map +1 -0
- package/dist/src/mcp/stdio.d.ts +2 -0
- package/dist/src/mcp/stdio.d.ts.map +1 -0
- package/dist/src/mcp/stdio.js +8 -0
- package/dist/src/mcp/stdio.js.map +1 -0
- package/dist/src/mcp/tools/context-pack.d.ts +35 -0
- package/dist/src/mcp/tools/context-pack.d.ts.map +1 -0
- package/dist/src/mcp/tools/context-pack.js +279 -0
- package/dist/src/mcp/tools/context-pack.js.map +1 -0
- package/dist/src/mcp/tools/conversations-search.d.ts +38 -0
- package/dist/src/mcp/tools/conversations-search.d.ts.map +1 -0
- package/dist/src/mcp/tools/conversations-search.js +79 -0
- package/dist/src/mcp/tools/conversations-search.js.map +1 -0
- package/dist/src/mcp/tools/evidence-feedback.d.ts +60 -0
- package/dist/src/mcp/tools/evidence-feedback.d.ts.map +1 -0
- package/dist/src/mcp/tools/evidence-feedback.js +62 -0
- package/dist/src/mcp/tools/evidence-feedback.js.map +1 -0
- package/dist/src/mcp/tools/log-outcome.d.ts +72 -0
- package/dist/src/mcp/tools/log-outcome.d.ts.map +1 -0
- package/dist/src/mcp/tools/log-outcome.js +59 -0
- package/dist/src/mcp/tools/log-outcome.js.map +1 -0
- package/dist/src/mcp/tools/open-evidence.d.ts +37 -0
- package/dist/src/mcp/tools/open-evidence.d.ts.map +1 -0
- package/dist/src/mcp/tools/open-evidence.js +72 -0
- package/dist/src/mcp/tools/open-evidence.js.map +1 -0
- package/dist/src/mcp/tools/save.d.ts +37 -0
- package/dist/src/mcp/tools/save.d.ts.map +1 -0
- package/dist/src/mcp/tools/save.js +65 -0
- package/dist/src/mcp/tools/save.js.map +1 -0
- package/dist/src/mcp/tools/search.d.ts +37 -0
- package/dist/src/mcp/tools/search.d.ts.map +1 -0
- package/dist/src/mcp/tools/search.js +95 -0
- package/dist/src/mcp/tools/search.js.map +1 -0
- package/dist/src/mcp/tools/status.d.ts +31 -0
- package/dist/src/mcp/tools/status.d.ts.map +1 -0
- package/dist/src/mcp/tools/status.js +63 -0
- package/dist/src/mcp/tools/status.js.map +1 -0
- package/dist/src/observability/coverage.d.ts +100 -0
- package/dist/src/observability/coverage.d.ts.map +1 -0
- package/dist/src/observability/coverage.js +178 -0
- package/dist/src/observability/coverage.js.map +1 -0
- 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 +352 -0
- package/dist/src/observability/onboarding-metric.js.map +1 -0
- package/dist/src/observability/retrieval-feedback.d.ts +82 -0
- package/dist/src/observability/retrieval-feedback.d.ts.map +1 -0
- package/dist/src/observability/retrieval-feedback.js +231 -0
- package/dist/src/observability/retrieval-feedback.js.map +1 -0
- package/dist/src/observability/rift-context.d.ts +53 -0
- package/dist/src/observability/rift-context.d.ts.map +1 -0
- package/dist/src/observability/rift-context.js +141 -0
- package/dist/src/observability/rift-context.js.map +1 -0
- package/dist/src/observability/staleness.d.ts +43 -0
- package/dist/src/observability/staleness.d.ts.map +1 -0
- package/dist/src/observability/staleness.js +74 -0
- package/dist/src/observability/staleness.js.map +1 -0
- package/dist/src/observability/tool-usage-stats.d.ts +139 -0
- package/dist/src/observability/tool-usage-stats.d.ts.map +1 -0
- package/dist/src/observability/tool-usage-stats.js +245 -0
- package/dist/src/observability/tool-usage-stats.js.map +1 -0
- package/dist/src/observability/tool-usage.d.ts +231 -0
- package/dist/src/observability/tool-usage.d.ts.map +1 -0
- package/dist/src/observability/tool-usage.js +489 -0
- package/dist/src/observability/tool-usage.js.map +1 -0
- package/dist/src/observability/version-check.d.ts +75 -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/onboarding/capture-switch.d.ts +20 -0
- package/dist/src/onboarding/capture-switch.d.ts.map +1 -0
- package/dist/src/onboarding/capture-switch.js +52 -0
- package/dist/src/onboarding/capture-switch.js.map +1 -0
- package/dist/src/onboarding/daemon-control.d.ts +33 -0
- package/dist/src/onboarding/daemon-control.d.ts.map +1 -0
- package/dist/src/onboarding/daemon-control.js +92 -0
- package/dist/src/onboarding/daemon-control.js.map +1 -0
- package/dist/src/onboarding/env-file.d.ts +18 -0
- package/dist/src/onboarding/env-file.d.ts.map +1 -0
- package/dist/src/onboarding/env-file.js +89 -0
- package/dist/src/onboarding/env-file.js.map +1 -0
- package/dist/src/onboarding/search-by-meaning.d.ts +35 -0
- package/dist/src/onboarding/search-by-meaning.d.ts.map +1 -0
- package/dist/src/onboarding/search-by-meaning.js +163 -0
- package/dist/src/onboarding/search-by-meaning.js.map +1 -0
- package/dist/src/onboarding/setup-page.d.ts +7 -0
- package/dist/src/onboarding/setup-page.d.ts.map +1 -0
- package/dist/src/onboarding/setup-page.js +823 -0
- package/dist/src/onboarding/setup-page.js.map +1 -0
- package/dist/src/onboarding/setup-session.d.ts +22 -0
- package/dist/src/onboarding/setup-session.d.ts.map +1 -0
- package/dist/src/onboarding/setup-session.js +80 -0
- package/dist/src/onboarding/setup-session.js.map +1 -0
- package/dist/src/onboarding/setup-state.d.ts +117 -0
- package/dist/src/onboarding/setup-state.d.ts.map +1 -0
- package/dist/src/onboarding/setup-state.js +267 -0
- package/dist/src/onboarding/setup-state.js.map +1 -0
- package/dist/src/onboarding/voyage-validate.d.ts +22 -0
- package/dist/src/onboarding/voyage-validate.d.ts.map +1 -0
- package/dist/src/onboarding/voyage-validate.js +96 -0
- package/dist/src/onboarding/voyage-validate.js.map +1 -0
- package/dist/src/providers/anthropic-digest.d.ts +23 -0
- package/dist/src/providers/anthropic-digest.d.ts.map +1 -0
- package/dist/src/providers/anthropic-digest.js +91 -0
- package/dist/src/providers/anthropic-digest.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/claude-cli-metadata-extraction.d.ts +47 -0
- package/dist/src/providers/claude-cli-metadata-extraction.d.ts.map +1 -0
- package/dist/src/providers/claude-cli-metadata-extraction.js +130 -0
- package/dist/src/providers/claude-cli-metadata-extraction.js.map +1 -0
- package/dist/src/providers/claude-cli-runner.d.ts +92 -0
- package/dist/src/providers/claude-cli-runner.d.ts.map +1 -0
- package/dist/src/providers/claude-cli-runner.js +598 -0
- package/dist/src/providers/claude-cli-runner.js.map +1 -0
- package/dist/src/providers/claude-input-limit.d.ts +32 -0
- package/dist/src/providers/claude-input-limit.d.ts.map +1 -0
- package/dist/src/providers/claude-input-limit.js +32 -0
- package/dist/src/providers/claude-input-limit.js.map +1 -0
- package/dist/src/providers/codex-cli-digest.d.ts +12 -0
- package/dist/src/providers/codex-cli-digest.d.ts.map +1 -0
- package/dist/src/providers/codex-cli-digest.js +70 -0
- package/dist/src/providers/codex-cli-digest.js.map +1 -0
- package/dist/src/providers/codex-cli-metadata-extraction.d.ts +15 -0
- package/dist/src/providers/codex-cli-metadata-extraction.d.ts.map +1 -0
- package/dist/src/providers/codex-cli-metadata-extraction.js +78 -0
- package/dist/src/providers/codex-cli-metadata-extraction.js.map +1 -0
- package/dist/src/providers/codex-cli-model.d.ts +110 -0
- package/dist/src/providers/codex-cli-model.d.ts.map +1 -0
- package/dist/src/providers/codex-cli-model.js +338 -0
- package/dist/src/providers/codex-cli-model.js.map +1 -0
- package/dist/src/providers/codex-cli-runner.d.ts +70 -0
- package/dist/src/providers/codex-cli-runner.d.ts.map +1 -0
- package/dist/src/providers/codex-cli-runner.js +745 -0
- package/dist/src/providers/codex-cli-runner.js.map +1 -0
- package/dist/src/providers/codex-input-limit.d.ts +43 -0
- package/dist/src/providers/codex-input-limit.d.ts.map +1 -0
- package/dist/src/providers/codex-input-limit.js +70 -0
- package/dist/src/providers/codex-input-limit.js.map +1 -0
- package/dist/src/providers/conversation-generation.d.ts +21 -0
- package/dist/src/providers/conversation-generation.d.ts.map +1 -0
- package/dist/src/providers/conversation-generation.js +132 -0
- package/dist/src/providers/conversation-generation.js.map +1 -0
- package/dist/src/providers/ollama-embed.d.ts +23 -0
- package/dist/src/providers/ollama-embed.d.ts.map +1 -0
- package/dist/src/providers/ollama-embed.js +137 -0
- package/dist/src/providers/ollama-embed.js.map +1 -0
- package/dist/src/providers/ollama.d.ts +42 -0
- package/dist/src/providers/ollama.d.ts.map +1 -0
- package/dist/src/providers/ollama.js +169 -0
- package/dist/src/providers/ollama.js.map +1 -0
- package/dist/src/providers/openai-metadata-extraction.d.ts +120 -0
- package/dist/src/providers/openai-metadata-extraction.d.ts.map +1 -0
- package/dist/src/providers/openai-metadata-extraction.js +225 -0
- package/dist/src/providers/openai-metadata-extraction.js.map +1 -0
- package/dist/src/providers/operator-overrides.d.ts +24 -0
- package/dist/src/providers/operator-overrides.d.ts.map +1 -0
- package/dist/src/providers/operator-overrides.js +84 -0
- package/dist/src/providers/operator-overrides.js.map +1 -0
- 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/shared-request.d.ts +22 -0
- package/dist/src/providers/shared-request.d.ts.map +1 -0
- package/dist/src/providers/shared-request.js +63 -0
- package/dist/src/providers/shared-request.js.map +1 -0
- package/dist/src/providers/stub.d.ts +19 -0
- package/dist/src/providers/stub.d.ts.map +1 -0
- package/dist/src/providers/stub.js +74 -0
- package/dist/src/providers/stub.js.map +1 -0
- package/dist/src/providers/types.d.ts +100 -0
- package/dist/src/providers/types.d.ts.map +1 -0
- package/dist/src/providers/types.js +63 -0
- package/dist/src/providers/types.js.map +1 -0
- package/dist/src/providers/voyage.d.ts +55 -0
- package/dist/src/providers/voyage.d.ts.map +1 -0
- package/dist/src/providers/voyage.js +179 -0
- package/dist/src/providers/voyage.js.map +1 -0
- package/dist/src/retrieval/brief.d.ts +26 -0
- package/dist/src/retrieval/brief.d.ts.map +1 -0
- package/dist/src/retrieval/brief.js +268 -0
- package/dist/src/retrieval/brief.js.map +1 -0
- package/dist/src/retrieval/canonical-files.d.ts +79 -0
- package/dist/src/retrieval/canonical-files.d.ts.map +1 -0
- package/dist/src/retrieval/canonical-files.js +432 -0
- package/dist/src/retrieval/canonical-files.js.map +1 -0
- package/dist/src/retrieval/compact.d.ts +306 -0
- package/dist/src/retrieval/compact.d.ts.map +1 -0
- package/dist/src/retrieval/compact.js +810 -0
- package/dist/src/retrieval/compact.js.map +1 -0
- package/dist/src/retrieval/context-pack.d.ts +344 -0
- package/dist/src/retrieval/context-pack.d.ts.map +1 -0
- package/dist/src/retrieval/context-pack.js +1483 -0
- package/dist/src/retrieval/context-pack.js.map +1 -0
- package/dist/src/retrieval/conversation-dedup.d.ts +54 -0
- package/dist/src/retrieval/conversation-dedup.d.ts.map +1 -0
- package/dist/src/retrieval/conversation-dedup.js +162 -0
- package/dist/src/retrieval/conversation-dedup.js.map +1 -0
- 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/cwd.d.ts +25 -0
- package/dist/src/retrieval/cwd.d.ts.map +1 -0
- package/dist/src/retrieval/cwd.js +48 -0
- package/dist/src/retrieval/cwd.js.map +1 -0
- package/dist/src/retrieval/degraded.d.ts +20 -0
- package/dist/src/retrieval/degraded.d.ts.map +1 -0
- package/dist/src/retrieval/degraded.js +43 -0
- package/dist/src/retrieval/degraded.js.map +1 -0
- package/dist/src/retrieval/evidence-key.d.ts +48 -0
- package/dist/src/retrieval/evidence-key.d.ts.map +1 -0
- package/dist/src/retrieval/evidence-key.js +131 -0
- package/dist/src/retrieval/evidence-key.js.map +1 -0
- package/dist/src/retrieval/feedback-ranking.d.ts +49 -0
- package/dist/src/retrieval/feedback-ranking.d.ts.map +1 -0
- package/dist/src/retrieval/feedback-ranking.js +138 -0
- package/dist/src/retrieval/feedback-ranking.js.map +1 -0
- package/dist/src/retrieval/git-state.d.ts +62 -0
- package/dist/src/retrieval/git-state.d.ts.map +1 -0
- package/dist/src/retrieval/git-state.js +192 -0
- package/dist/src/retrieval/git-state.js.map +1 -0
- package/dist/src/retrieval/group-by-parent.d.ts +38 -0
- package/dist/src/retrieval/group-by-parent.d.ts.map +1 -0
- package/dist/src/retrieval/group-by-parent.js +40 -0
- package/dist/src/retrieval/group-by-parent.js.map +1 -0
- package/dist/src/retrieval/hybrid.d.ts +75 -0
- package/dist/src/retrieval/hybrid.d.ts.map +1 -0
- package/dist/src/retrieval/hybrid.js +151 -0
- package/dist/src/retrieval/hybrid.js.map +1 -0
- package/dist/src/retrieval/lexical.d.ts +33 -0
- package/dist/src/retrieval/lexical.d.ts.map +1 -0
- package/dist/src/retrieval/lexical.js +379 -0
- package/dist/src/retrieval/lexical.js.map +1 -0
- 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/passages.d.ts +24 -0
- package/dist/src/retrieval/passages.d.ts.map +1 -0
- package/dist/src/retrieval/passages.js +160 -0
- package/dist/src/retrieval/passages.js.map +1 -0
- package/dist/src/retrieval/post-filter.d.ts +32 -0
- package/dist/src/retrieval/post-filter.d.ts.map +1 -0
- package/dist/src/retrieval/post-filter.js +57 -0
- package/dist/src/retrieval/post-filter.js.map +1 -0
- package/dist/src/retrieval/project-index.d.ts +71 -0
- package/dist/src/retrieval/project-index.d.ts.map +1 -0
- package/dist/src/retrieval/project-index.js +348 -0
- package/dist/src/retrieval/project-index.js.map +1 -0
- package/dist/src/retrieval/recall-hint.d.ts +22 -0
- package/dist/src/retrieval/recall-hint.d.ts.map +1 -0
- package/dist/src/retrieval/recall-hint.js +33 -0
- package/dist/src/retrieval/recall-hint.js.map +1 -0
- package/dist/src/retrieval/receipt.d.ts +57 -0
- package/dist/src/retrieval/receipt.d.ts.map +1 -0
- package/dist/src/retrieval/receipt.js +122 -0
- package/dist/src/retrieval/receipt.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/reranker.d.ts +119 -0
- package/dist/src/retrieval/reranker.d.ts.map +1 -0
- package/dist/src/retrieval/reranker.js +220 -0
- package/dist/src/retrieval/reranker.js.map +1 -0
- package/dist/src/retrieval/stitch-chunks.d.ts +76 -0
- package/dist/src/retrieval/stitch-chunks.d.ts.map +1 -0
- package/dist/src/retrieval/stitch-chunks.js +113 -0
- package/dist/src/retrieval/stitch-chunks.js.map +1 -0
- package/dist/src/retrieval/vector.d.ts +71 -0
- package/dist/src/retrieval/vector.d.ts.map +1 -0
- package/dist/src/retrieval/vector.js +147 -0
- package/dist/src/retrieval/vector.js.map +1 -0
- package/dist/src/runtime/legacy-migration.d.ts +27 -0
- package/dist/src/runtime/legacy-migration.d.ts.map +1 -0
- package/dist/src/runtime/legacy-migration.js +140 -0
- package/dist/src/runtime/legacy-migration.js.map +1 -0
- package/dist/src/runtime/legacy-name-guard.d.ts +35 -0
- package/dist/src/runtime/legacy-name-guard.d.ts.map +1 -0
- package/dist/src/runtime/legacy-name-guard.js +58 -0
- package/dist/src/runtime/legacy-name-guard.js.map +1 -0
- package/dist/src/runtime/rift-env.d.ts +14 -0
- package/dist/src/runtime/rift-env.d.ts.map +1 -0
- package/dist/src/runtime/rift-env.js +79 -0
- package/dist/src/runtime/rift-env.js.map +1 -0
- package/dist/src/runtime/voyage-key-source.d.ts +46 -0
- package/dist/src/runtime/voyage-key-source.d.ts.map +1 -0
- package/dist/src/runtime/voyage-key-source.js +97 -0
- package/dist/src/runtime/voyage-key-source.js.map +1 -0
- package/dist/src/runtime/watcher-startup.d.ts +2 -0
- package/dist/src/runtime/watcher-startup.d.ts.map +1 -0
- package/dist/src/runtime/watcher-startup.js +4 -0
- package/dist/src/runtime/watcher-startup.js.map +1 -0
- package/dist/src/security/archive.d.ts +23 -0
- package/dist/src/security/archive.d.ts.map +1 -0
- package/dist/src/security/archive.js +163 -0
- package/dist/src/security/archive.js.map +1 -0
- package/dist/src/security/paths.d.ts +21 -0
- package/dist/src/security/paths.d.ts.map +1 -0
- package/dist/src/security/paths.js +67 -0
- package/dist/src/security/paths.js.map +1 -0
- package/dist/src/server/app.d.ts +29 -0
- package/dist/src/server/app.d.ts.map +1 -0
- package/dist/src/server/app.js +356 -0
- package/dist/src/server/app.js.map +1 -0
- package/dist/src/server/build-info.d.ts +8 -0
- package/dist/src/server/build-info.d.ts.map +1 -0
- package/dist/src/server/build-info.js +61 -0
- package/dist/src/server/build-info.js.map +1 -0
- package/dist/src/server/lifecycle.d.ts +30 -0
- package/dist/src/server/lifecycle.d.ts.map +1 -0
- package/dist/src/server/lifecycle.js +59 -0
- package/dist/src/server/lifecycle.js.map +1 -0
- package/dist/src/server/middleware/multipart.d.ts +51 -0
- package/dist/src/server/middleware/multipart.d.ts.map +1 -0
- package/dist/src/server/middleware/multipart.js +86 -0
- package/dist/src/server/middleware/multipart.js.map +1 -0
- package/dist/src/server/routes/compact.d.ts +37 -0
- package/dist/src/server/routes/compact.d.ts.map +1 -0
- package/dist/src/server/routes/compact.js +80 -0
- package/dist/src/server/routes/compact.js.map +1 -0
- package/dist/src/server/routes/context.d.ts +12 -0
- package/dist/src/server/routes/context.d.ts.map +1 -0
- package/dist/src/server/routes/context.js +73 -0
- package/dist/src/server/routes/context.js.map +1 -0
- package/dist/src/server/routes/conversations-search.d.ts +4 -0
- package/dist/src/server/routes/conversations-search.d.ts.map +1 -0
- package/dist/src/server/routes/conversations-search.js +287 -0
- package/dist/src/server/routes/conversations-search.js.map +1 -0
- 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 +481 -0
- package/dist/src/server/routes/friend-status.d.ts.map +1 -0
- package/dist/src/server/routes/friend-status.js +675 -0
- package/dist/src/server/routes/friend-status.js.map +1 -0
- package/dist/src/server/routes/ingest.d.ts +15 -0
- package/dist/src/server/routes/ingest.d.ts.map +1 -0
- package/dist/src/server/routes/ingest.js +142 -0
- package/dist/src/server/routes/ingest.js.map +1 -0
- package/dist/src/server/routes/jobs.d.ts +10 -0
- package/dist/src/server/routes/jobs.d.ts.map +1 -0
- package/dist/src/server/routes/jobs.js +29 -0
- package/dist/src/server/routes/jobs.js.map +1 -0
- package/dist/src/server/routes/mcp-usage.d.ts +17 -0
- package/dist/src/server/routes/mcp-usage.d.ts.map +1 -0
- package/dist/src/server/routes/mcp-usage.js +17 -0
- package/dist/src/server/routes/mcp-usage.js.map +1 -0
- package/dist/src/server/routes/reconcile.d.ts +4 -0
- package/dist/src/server/routes/reconcile.d.ts.map +1 -0
- package/dist/src/server/routes/reconcile.js +62 -0
- package/dist/src/server/routes/reconcile.js.map +1 -0
- package/dist/src/server/routes/reindex.d.ts +4 -0
- package/dist/src/server/routes/reindex.d.ts.map +1 -0
- package/dist/src/server/routes/reindex.js +77 -0
- package/dist/src/server/routes/reindex.js.map +1 -0
- package/dist/src/server/routes/retrieval-feedback.d.ts +3 -0
- package/dist/src/server/routes/retrieval-feedback.d.ts.map +1 -0
- package/dist/src/server/routes/retrieval-feedback.js +290 -0
- package/dist/src/server/routes/retrieval-feedback.js.map +1 -0
- package/dist/src/server/routes/save.d.ts +52 -0
- package/dist/src/server/routes/save.d.ts.map +1 -0
- package/dist/src/server/routes/save.js +127 -0
- package/dist/src/server/routes/save.js.map +1 -0
- package/dist/src/server/routes/search.d.ts +5 -0
- package/dist/src/server/routes/search.d.ts.map +1 -0
- package/dist/src/server/routes/search.js +689 -0
- package/dist/src/server/routes/search.js.map +1 -0
- package/dist/src/server/routes/setup.d.ts +46 -0
- package/dist/src/server/routes/setup.d.ts.map +1 -0
- package/dist/src/server/routes/setup.js +322 -0
- package/dist/src/server/routes/setup.js.map +1 -0
- package/dist/src/server/routes/stats.d.ts +10 -0
- package/dist/src/server/routes/stats.d.ts.map +1 -0
- package/dist/src/server/routes/stats.js +15 -0
- package/dist/src/server/routes/stats.js.map +1 -0
- package/dist/src/server/routes/status.d.ts +20 -0
- package/dist/src/server/routes/status.d.ts.map +1 -0
- package/dist/src/server/routes/status.js +31 -0
- package/dist/src/server/routes/status.js.map +1 -0
- package/dist/src/server/routes/triage.d.ts +4 -0
- package/dist/src/server/routes/triage.d.ts.map +1 -0
- package/dist/src/server/routes/triage.js +97 -0
- package/dist/src/server/routes/triage.js.map +1 -0
- package/dist/src/server/save-quality.d.ts +21 -0
- package/dist/src/server/save-quality.d.ts.map +1 -0
- package/dist/src/server/save-quality.js +51 -0
- package/dist/src/server/save-quality.js.map +1 -0
- package/dist/src/server/serving-marker.d.ts +85 -0
- package/dist/src/server/serving-marker.d.ts.map +1 -0
- package/dist/src/server/serving-marker.js +226 -0
- package/dist/src/server/serving-marker.js.map +1 -0
- package/dist/src/storage/atomic.d.ts +8 -0
- package/dist/src/storage/atomic.d.ts.map +1 -0
- package/dist/src/storage/atomic.js +22 -0
- package/dist/src/storage/atomic.js.map +1 -0
- package/dist/src/storage/chunk-backfill.d.ts +39 -0
- package/dist/src/storage/chunk-backfill.d.ts.map +1 -0
- package/dist/src/storage/chunk-backfill.js +295 -0
- package/dist/src/storage/chunk-backfill.js.map +1 -0
- package/dist/src/storage/db.d.ts +15 -0
- package/dist/src/storage/db.d.ts.map +1 -0
- package/dist/src/storage/db.js +47 -0
- package/dist/src/storage/db.js.map +1 -0
- package/dist/src/storage/filter.d.ts +42 -0
- package/dist/src/storage/filter.d.ts.map +1 -0
- package/dist/src/storage/filter.js +70 -0
- package/dist/src/storage/filter.js.map +1 -0
- package/dist/src/storage/fts.d.ts +47 -0
- package/dist/src/storage/fts.d.ts.map +1 -0
- package/dist/src/storage/fts.js +86 -0
- package/dist/src/storage/fts.js.map +1 -0
- package/dist/src/storage/integrity.d.ts +11 -0
- package/dist/src/storage/integrity.d.ts.map +1 -0
- package/dist/src/storage/integrity.js +66 -0
- package/dist/src/storage/integrity.js.map +1 -0
- package/dist/src/storage/maintenance.d.ts +27 -0
- package/dist/src/storage/maintenance.d.ts.map +1 -0
- package/dist/src/storage/maintenance.js +66 -0
- package/dist/src/storage/maintenance.js.map +1 -0
- package/dist/src/storage/rebuild.d.ts +71 -0
- package/dist/src/storage/rebuild.d.ts.map +1 -0
- package/dist/src/storage/rebuild.js +605 -0
- package/dist/src/storage/rebuild.js.map +1 -0
- package/dist/src/storage/report-card-backfill.d.ts +20 -0
- package/dist/src/storage/report-card-backfill.d.ts.map +1 -0
- package/dist/src/storage/report-card-backfill.js +114 -0
- package/dist/src/storage/report-card-backfill.js.map +1 -0
- package/dist/src/storage/shadow-swap.d.ts +20 -0
- package/dist/src/storage/shadow-swap.d.ts.map +1 -0
- package/dist/src/storage/shadow-swap.js +163 -0
- package/dist/src/storage/shadow-swap.js.map +1 -0
- package/dist/src/storage/tables.d.ts +147 -0
- package/dist/src/storage/tables.d.ts.map +1 -0
- package/dist/src/storage/tables.js +290 -0
- package/dist/src/storage/tables.js.map +1 -0
- package/operator/swiftbar/render-menu.py +475 -0
- package/operator/swiftbar/rift.10s.sh +201 -0
- package/package.json +57 -3
|
@@ -0,0 +1,1167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-capture orchestrator for local CLI conversations.
|
|
3
|
+
*
|
|
4
|
+
* Scans local conversation stores (currently Claude Code + Codex),
|
|
5
|
+
* deduplicates against previously processed sessions,
|
|
6
|
+
* triages each new conversation, and routes the result:
|
|
7
|
+
*
|
|
8
|
+
* - save: calls the daemon's POST /save with full content
|
|
9
|
+
* - review: writes to the file-backed review queue
|
|
10
|
+
* - discard: marks as processed, no further action
|
|
11
|
+
*
|
|
12
|
+
* Deduplication state is persisted to data/capture-state.json.
|
|
13
|
+
* The dedupe key is the session UUID + a content hash, so
|
|
14
|
+
* reprocessing the same conversation is idempotent, but
|
|
15
|
+
* a significantly updated conversation is re-evaluated.
|
|
16
|
+
*/
|
|
17
|
+
import crypto from "node:crypto";
|
|
18
|
+
import fs from "node:fs";
|
|
19
|
+
import path from "node:path";
|
|
20
|
+
import os from "node:os";
|
|
21
|
+
import { z } from "zod";
|
|
22
|
+
import { discoverClaudeCodeSessions, parseClaudeCodeSession, } from "../ingestion/parsers/claude-code-jsonl.js";
|
|
23
|
+
import { discoverClaudeDesktopSessions, parseClaudeDesktopSession, } from "../ingestion/parsers/claude-desktop-sessions.js";
|
|
24
|
+
import { discoverCodexSessions, parseCodexSession, } from "../ingestion/parsers/codex-jsonl.js";
|
|
25
|
+
import { discoverGrokSessions, parseGrokSession } from "../ingestion/parsers/grok-cli.js";
|
|
26
|
+
import { parseCursorComposerSession } from "../ingestion/cursor/cursor-store.js";
|
|
27
|
+
import { defaultCursorDir } from "../ingestion/cursor/vscdb-reader.js";
|
|
28
|
+
import { cursorCaptureEnabled, cursorCapturePersistEnabled, cursorTitlesRevealed, discoverCursorCaptureSessions, redactedCursorTitle, } from "./cursor-capture.js";
|
|
29
|
+
import { triageConversation } from "./triage.js";
|
|
30
|
+
import { encodeUserStatement, ownsPassage, sealUserStatements, verifyUserStatementsWithEvidence, } from "./user-statements.js";
|
|
31
|
+
import { createStoredStatementsLookup } from "./stored-statements.js";
|
|
32
|
+
import { addToReview } from "./review-queue.js";
|
|
33
|
+
import { createAssistantTextLookup, sessionRoots, } from "./assistant-text-lookup.js";
|
|
34
|
+
import { atomicWrite } from "../storage/atomic.js";
|
|
35
|
+
import { createConfiguredTriageProvider, getConfiguredTriageProviderName, } from "./triage-provider-factory.js";
|
|
36
|
+
import { CodexCliTimeoutError } from "../providers/codex-cli-runner.js";
|
|
37
|
+
import { ClaudeCliTimeoutError } from "../providers/claude-cli-runner.js";
|
|
38
|
+
import { AUTO_CAPTURE_SOURCE_VALUES, CLAUDE_DESKTOP_CAPTURE_SOURCE, CURSOR_CAPTURE_SOURCE, DEFAULT_AUTO_CAPTURE_SOURCES, } from "./sources.js";
|
|
39
|
+
/**
|
|
40
|
+
* Default upper bound for a Codex CLI session that auto-capture will hand
|
|
41
|
+
* to the triage subprocess. Real sessions in `~/.codex/sessions/` are tens
|
|
42
|
+
* of KB to ~2 MB; 8 MB is well above healthy traffic and well below the
|
|
43
|
+
* 25 MB outliers that have been observed to make Codex CLI exit 1.
|
|
44
|
+
*
|
|
45
|
+
* Operators raise this in `config.json` under `capture.codex_cli.max_session_bytes`.
|
|
46
|
+
*/
|
|
47
|
+
export const DEFAULT_CODEX_MAX_SESSION_BYTES = 8 * 1024 * 1024;
|
|
48
|
+
/**
|
|
49
|
+
* Default upper bound for a native Cursor session's PARSED transcript before the
|
|
50
|
+
* size guard quarantines it instead of handing it to the triage subprocess.
|
|
51
|
+
* Unlike Codex (a session file we can `stat`), Cursor content is reassembled
|
|
52
|
+
* from `state.vscdb` bubbles in memory, so the bound is measured on the merged
|
|
53
|
+
* user+assistant text. 4 MB of text is ~1M tokens — far past any healthy
|
|
54
|
+
* session and well past what triage should ever receive. Overridable per run
|
|
55
|
+
* via `AutoCaptureDeps.cursorMaxSessionBytes`.
|
|
56
|
+
*/
|
|
57
|
+
export const DEFAULT_CURSOR_MAX_SESSION_BYTES = 4 * 1024 * 1024;
|
|
58
|
+
/** Sentinel idempotency_key written into capture-state.json for oversized sessions. */
|
|
59
|
+
export const QUARANTINED_OVERSIZED_KEY = "quarantined:oversized";
|
|
60
|
+
/**
|
|
61
|
+
* Translate the operator-facing `capture.codex_cli.max_session_bytes` config
|
|
62
|
+
* field into the partial `AutoCaptureDeps` shape that every entry point
|
|
63
|
+
* (daemon scheduled run, `onadit capture`, `onadit onboard` first-capture) must
|
|
64
|
+
* spread into its `runAutoCapture()` call. Centralizing this resolution
|
|
65
|
+
* keeps the three call sites from drifting and gives behavioral tests a
|
|
66
|
+
* single observable contract.
|
|
67
|
+
*
|
|
68
|
+
* Returns an empty object (so the spread is a no-op) when the override is
|
|
69
|
+
* absent — the consuming `runAutoCapture` then falls through to
|
|
70
|
+
* `DEFAULT_CODEX_MAX_SESSION_BYTES`.
|
|
71
|
+
*/
|
|
72
|
+
export function resolveCodexCaptureDeps(config) {
|
|
73
|
+
const override = config.capture?.codex_cli?.max_session_bytes;
|
|
74
|
+
return override !== undefined ? { codexMaxSessionBytes: override } : {};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Resolve the native-Cursor size override into the partial deps every call site
|
|
78
|
+
* (daemon scheduled run, `onadit capture`) spreads into `runAutoCapture()`. Mirrors
|
|
79
|
+
* `resolveCodexCaptureDeps`. Returns an empty object (no-op spread) when absent,
|
|
80
|
+
* so `runAutoCapture` falls through to `DEFAULT_CURSOR_MAX_SESSION_BYTES`.
|
|
81
|
+
*/
|
|
82
|
+
export function resolveCursorCaptureDeps(config) {
|
|
83
|
+
const override = config.capture?.cursor?.max_session_bytes;
|
|
84
|
+
return override !== undefined ? { cursorMaxSessionBytes: override } : {};
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Build the full daemon-scheduled `runAutoCapture` deps from config + the
|
|
88
|
+
* job-queue-backed `saveFn`. The factory exists so the daemon path is
|
|
89
|
+
* directly unit-testable: callers can assert the returned shape without
|
|
90
|
+
* standing up the full daemon. The CLI paths (`onadit capture`, `onadit onboard
|
|
91
|
+
* --first-capture`) build their deps inline because they vary per-invocation
|
|
92
|
+
* (source filter, dry-run, claudeDir/codexDir overrides, HTTP-client save).
|
|
93
|
+
*/
|
|
94
|
+
export function buildDaemonAutoCaptureDeps(opts) {
|
|
95
|
+
return {
|
|
96
|
+
dataDir: opts.config.data_paths.data_dir,
|
|
97
|
+
sources: opts.config.capture.sources,
|
|
98
|
+
// Config membership IS the Cursor opt-in: when the daemon's configured
|
|
99
|
+
// sources include cursor_composer, authorize discovery + persistence for
|
|
100
|
+
// this run without the env flags.
|
|
101
|
+
cursorConfigEnabled: opts.config.capture.sources.includes(CURSOR_CAPTURE_SOURCE),
|
|
102
|
+
...resolveCodexCaptureDeps(opts.config),
|
|
103
|
+
...resolveCursorCaptureDeps(opts.config),
|
|
104
|
+
saveFn: opts.saveFn,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
const STATE_FILE = "capture-state.json";
|
|
108
|
+
/**
|
|
109
|
+
* Committed ledger generations (`<N>.json`, immutable). The newest is the
|
|
110
|
+
* ledger; `capture-state.json` is a mirror kept for older readers and humans.
|
|
111
|
+
* See saveState for why.
|
|
112
|
+
*/
|
|
113
|
+
const STATE_GENERATIONS_DIR = "capture-state.gen";
|
|
114
|
+
/** Generations are kept at least this long, and the newest few always. */
|
|
115
|
+
const STATE_GENERATION_KEEP_MS = 60 * 60 * 1000;
|
|
116
|
+
const STATE_GENERATION_KEEP_COUNT = 3;
|
|
117
|
+
/** Commit attempts before a run gives up (each retry means another run committed). */
|
|
118
|
+
const STATE_COMMIT_ATTEMPTS = 50;
|
|
119
|
+
/**
|
|
120
|
+
* Whether a source may be PERSISTED. Claude/Codex always persist. Native Cursor
|
|
121
|
+
* persists when EITHER:
|
|
122
|
+
* - it is scheduled via config (`cursorConfigEnabled`, i.e. `cursor_composer`
|
|
123
|
+
* is in `config.capture.sources`) — the deliberate, persisted opt-in that
|
|
124
|
+
* authorizes the daemon (and a config-driven manual run) to capture + save
|
|
125
|
+
* Cursor without any env flags; OR
|
|
126
|
+
* - BOTH env flags are set (`RIFT_CURSOR_CAPTURE=1` discovery master switch and
|
|
127
|
+
* `CURSOR_CAPTURE_PERSIST=1`) — the ad-hoc/dogfood path for an explicit
|
|
128
|
+
* `--source cursor_composer` run with no config opt-in.
|
|
129
|
+
*
|
|
130
|
+
* The env discovery flag is part of the env gate on purpose: persisting a source
|
|
131
|
+
* we are not even discovering is incoherent, and — critically — it would let an
|
|
132
|
+
* explicit `--source cursor_composer` run with persist on but discovery OFF write
|
|
133
|
+
* a bootstrap watermark for zero discovered sessions, falsely marking history as
|
|
134
|
+
* "already baselined." A later run with discovery on would then skip bootstrap
|
|
135
|
+
* and save real existing sessions as new — the exact historical backfill this
|
|
136
|
+
* gate exists to prevent. Requiring both env flags (or a config opt-in, which
|
|
137
|
+
* always also enables discovery — see `cursorOn`) closes that hole.
|
|
138
|
+
*
|
|
139
|
+
* With persistence off, Cursor sessions are discovered, fingerprinted, and
|
|
140
|
+
* triaged, but never saved, queued for review, or written to capture-state —
|
|
141
|
+
* "no writes" by construction, independent of `--dry-run`. The check reads the
|
|
142
|
+
* env at call time, so it is consistent within a single run.
|
|
143
|
+
*/
|
|
144
|
+
function writesEnabledForSource(source, cursorConfigEnabled) {
|
|
145
|
+
if (source === CURSOR_CAPTURE_SOURCE) {
|
|
146
|
+
return (cursorConfigEnabled ||
|
|
147
|
+
(cursorCaptureEnabled() && cursorCapturePersistEnabled()));
|
|
148
|
+
}
|
|
149
|
+
return true;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Content fingerprint for a discovered session. Cursor sessions hash their
|
|
153
|
+
* precomputed ordered-bubble material; file-backed sources hash size + tail.
|
|
154
|
+
*/
|
|
155
|
+
function sessionFingerprint(session) {
|
|
156
|
+
if (session.grok) {
|
|
157
|
+
return crypto.createHash("sha256")
|
|
158
|
+
.update(contentFingerprint(session.path))
|
|
159
|
+
.update(JSON.stringify(session.grok.metadata))
|
|
160
|
+
.digest("hex").slice(0, 16);
|
|
161
|
+
}
|
|
162
|
+
if (session.cursor) {
|
|
163
|
+
return crypto
|
|
164
|
+
.createHash("sha256")
|
|
165
|
+
.update(session.cursor.fingerprintInput)
|
|
166
|
+
.digest("hex")
|
|
167
|
+
.slice(0, 16);
|
|
168
|
+
}
|
|
169
|
+
return contentFingerprint(session.path);
|
|
170
|
+
}
|
|
171
|
+
export function zeroCounts() {
|
|
172
|
+
return {
|
|
173
|
+
discovered: 0,
|
|
174
|
+
bootstrapped: 0,
|
|
175
|
+
new: 0,
|
|
176
|
+
skipped: 0,
|
|
177
|
+
saved: 0,
|
|
178
|
+
review: 0,
|
|
179
|
+
discarded: 0,
|
|
180
|
+
quarantined: 0,
|
|
181
|
+
errors: 0,
|
|
182
|
+
deferred: 0,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
export function makeErrorCounts(errors = 1) {
|
|
186
|
+
return {
|
|
187
|
+
...zeroCounts(),
|
|
188
|
+
errors,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
function ensureCounts(report, source) {
|
|
192
|
+
const existing = report.counts_by_source[source];
|
|
193
|
+
if (existing)
|
|
194
|
+
return existing;
|
|
195
|
+
const counts = zeroCounts();
|
|
196
|
+
report.counts_by_source[source] = counts;
|
|
197
|
+
return counts;
|
|
198
|
+
}
|
|
199
|
+
function stateKey(source, sessionId) {
|
|
200
|
+
return `${source}:${sessionId}`;
|
|
201
|
+
}
|
|
202
|
+
function getPreviousEntry(state, source, sessionId) {
|
|
203
|
+
const keyed = state.processed[stateKey(source, sessionId)];
|
|
204
|
+
if (keyed !== undefined)
|
|
205
|
+
return keyed;
|
|
206
|
+
// Backward compatibility: early capture-state files keyed Claude-only
|
|
207
|
+
// sessions by bare UUID. Reuse that state so Claude auto-capture does not
|
|
208
|
+
// unexpectedly re-import an already-processed corpus.
|
|
209
|
+
return source === "claude_code" ? state.processed[sessionId] : undefined;
|
|
210
|
+
}
|
|
211
|
+
function hasSourcePrefixedEntries(state, source) {
|
|
212
|
+
const prefix = `${source}:`;
|
|
213
|
+
return Object.keys(state.processed).some((key) => key.startsWith(prefix));
|
|
214
|
+
}
|
|
215
|
+
function hasClaudeLegacyBareEntries(state) {
|
|
216
|
+
return Object.keys(state.processed).some((key) => !key.includes(":"));
|
|
217
|
+
}
|
|
218
|
+
function hasPriorStateForSource(state, source) {
|
|
219
|
+
if (state.bootstrapped_sources?.[source])
|
|
220
|
+
return true;
|
|
221
|
+
if (hasSourcePrefixedEntries(state, source))
|
|
222
|
+
return true;
|
|
223
|
+
// Claude was the only original live source, and older state files used
|
|
224
|
+
// bare UUID keys. Treat those as Claude prior state so a migrated install
|
|
225
|
+
// does not re-import an already-captured corpus.
|
|
226
|
+
return source === "claude_code" && hasClaudeLegacyBareEntries(state);
|
|
227
|
+
}
|
|
228
|
+
function shouldBootstrapSource(state, source, dryRun) {
|
|
229
|
+
if (dryRun)
|
|
230
|
+
return false;
|
|
231
|
+
return !hasPriorStateForSource(state, source);
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Whether a preflight failure is transient (a worker timeout/termination) and
|
|
235
|
+
* therefore safe to continue past, vs. a hard auth/path failure that should
|
|
236
|
+
* abort the run. Timeouts are already retried once at the runner; if the probe
|
|
237
|
+
* still timed out, individual sessions may still succeed, so we let them try.
|
|
238
|
+
* Covers both worker runtimes (Codex and Claude).
|
|
239
|
+
*/
|
|
240
|
+
function isTransientPreflightError(err) {
|
|
241
|
+
return (err instanceof CodexCliTimeoutError || err instanceof ClaudeCliTimeoutError);
|
|
242
|
+
}
|
|
243
|
+
async function ensureAutoCaptureTriageReady() {
|
|
244
|
+
// This is intentionally a tiny real CLI model call on the CONFIGURED worker
|
|
245
|
+
// (codex_cli or claude_code), not a cheap version check: it catches expired
|
|
246
|
+
// auth and runtime/model failures before a capture run starts mutating state.
|
|
247
|
+
await createConfiguredTriageProvider({ timeoutMs: 120_000 }).triage({
|
|
248
|
+
content: "User: Auto-capture preflight check.\n\nAssistant: Ready.",
|
|
249
|
+
source: "codex_cli",
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Load the capture state from disk.
|
|
254
|
+
*/
|
|
255
|
+
const CaptureStateEntrySchema = z.object({
|
|
256
|
+
fingerprint: z.string(),
|
|
257
|
+
idempotency_key: z.string().default(""),
|
|
258
|
+
});
|
|
259
|
+
const CaptureStateSchema = z.object({
|
|
260
|
+
processed: z
|
|
261
|
+
.record(z.string(), z.union([z.string(), CaptureStateEntrySchema]))
|
|
262
|
+
.default({}),
|
|
263
|
+
bootstrapped_sources: z.record(z.string(), z.string()).optional(),
|
|
264
|
+
});
|
|
265
|
+
const LenientCaptureStateSchema = z.object({
|
|
266
|
+
processed: z.record(z.string(), z.unknown()).default({}),
|
|
267
|
+
bootstrapped_sources: z.record(z.string(), z.string()).optional(),
|
|
268
|
+
});
|
|
269
|
+
function backupUnreadableState(statePath, error) {
|
|
270
|
+
const suffix = new Date().toISOString().replace(/[:.]/g, "-");
|
|
271
|
+
const backupPath = `${statePath}.corrupt-${suffix}`;
|
|
272
|
+
try {
|
|
273
|
+
fs.copyFileSync(statePath, backupPath);
|
|
274
|
+
process.stderr.write(`Auto-capture state parse failed for ${statePath}; backed up to ${backupPath}: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
275
|
+
}
|
|
276
|
+
catch (backupErr) {
|
|
277
|
+
process.stderr.write(`Auto-capture state parse failed for ${statePath}; backup failed: ${backupErr instanceof Error ? backupErr.message : String(backupErr)}\n`);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
function normalizeBootstrappedSources(sources) {
|
|
281
|
+
const bootstrappedSources = {};
|
|
282
|
+
// Iterate ALL auto-capture sources, not just the scheduled defaults: a
|
|
283
|
+
// flag-gated source that persists (Cursor, when CURSOR_CAPTURE_PERSIST is on)
|
|
284
|
+
// writes a bootstrap watermark, and that marker must survive a state reload —
|
|
285
|
+
// otherwise the source re-bootstraps every run and never captures anything.
|
|
286
|
+
for (const source of AUTO_CAPTURE_SOURCE_VALUES) {
|
|
287
|
+
const value = sources?.[source];
|
|
288
|
+
if (typeof value === "string") {
|
|
289
|
+
bootstrappedSources[source] = value;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return bootstrappedSources;
|
|
293
|
+
}
|
|
294
|
+
/** Committed generation numbers, oldest first. */
|
|
295
|
+
function listStateGenerations(genDir) {
|
|
296
|
+
let names;
|
|
297
|
+
try {
|
|
298
|
+
names = fs.readdirSync(genDir);
|
|
299
|
+
}
|
|
300
|
+
catch {
|
|
301
|
+
return [];
|
|
302
|
+
}
|
|
303
|
+
return names
|
|
304
|
+
.map((n) => /^(\d+)\.json$/.exec(n)?.[1])
|
|
305
|
+
.filter((n) => n !== undefined)
|
|
306
|
+
.map(Number)
|
|
307
|
+
.sort((a, b) => a - b);
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* The current ledger and its generation: the newest committed generation, or
|
|
311
|
+
* the legacy `capture-state.json` (generation 0) before the first commit.
|
|
312
|
+
*/
|
|
313
|
+
function loadCurrentState(dataDir) {
|
|
314
|
+
const genDir = path.join(dataDir, STATE_GENERATIONS_DIR);
|
|
315
|
+
const newest = listStateGenerations(genDir).at(-1);
|
|
316
|
+
if (newest === undefined) {
|
|
317
|
+
return { state: loadStateFile(path.join(dataDir, STATE_FILE)), generation: 0 };
|
|
318
|
+
}
|
|
319
|
+
return { state: loadStateFile(path.join(genDir, `${newest}.json`)), generation: newest };
|
|
320
|
+
}
|
|
321
|
+
function loadState(dataDir) {
|
|
322
|
+
return loadCurrentState(dataDir).state;
|
|
323
|
+
}
|
|
324
|
+
function loadStateFile(statePath) {
|
|
325
|
+
if (!fs.existsSync(statePath)) {
|
|
326
|
+
return { processed: {} };
|
|
327
|
+
}
|
|
328
|
+
let decoded;
|
|
329
|
+
try {
|
|
330
|
+
decoded = JSON.parse(fs.readFileSync(statePath, "utf-8"));
|
|
331
|
+
}
|
|
332
|
+
catch (err) {
|
|
333
|
+
backupUnreadableState(statePath, err);
|
|
334
|
+
return { processed: {} };
|
|
335
|
+
}
|
|
336
|
+
const parsed = CaptureStateSchema.safeParse(decoded);
|
|
337
|
+
if (parsed.success) {
|
|
338
|
+
const bootstrappedSources = normalizeBootstrappedSources(parsed.data.bootstrapped_sources);
|
|
339
|
+
return {
|
|
340
|
+
processed: parsed.data.processed,
|
|
341
|
+
...(Object.keys(bootstrappedSources).length > 0
|
|
342
|
+
? { bootstrapped_sources: bootstrappedSources }
|
|
343
|
+
: {}),
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
backupUnreadableState(statePath, parsed.error);
|
|
347
|
+
const lenient = LenientCaptureStateSchema.safeParse(decoded);
|
|
348
|
+
if (!lenient.success) {
|
|
349
|
+
return { processed: {} };
|
|
350
|
+
}
|
|
351
|
+
const processed = {};
|
|
352
|
+
for (const [key, value] of Object.entries(lenient.data.processed)) {
|
|
353
|
+
if (typeof value === "string") {
|
|
354
|
+
processed[key] = value;
|
|
355
|
+
continue;
|
|
356
|
+
}
|
|
357
|
+
const entry = CaptureStateEntrySchema.safeParse(value);
|
|
358
|
+
if (entry.success) {
|
|
359
|
+
processed[key] = entry.data;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
const bootstrappedSources = normalizeBootstrappedSources(lenient.data.bootstrapped_sources);
|
|
363
|
+
return {
|
|
364
|
+
processed,
|
|
365
|
+
...(Object.keys(bootstrappedSources).length > 0
|
|
366
|
+
? { bootstrapped_sources: bootstrappedSources }
|
|
367
|
+
: {}),
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
function discoverAllSessions(allowedSources, claudeDir, codexDir, cursor, claudeDesktopDir, grokDir) {
|
|
371
|
+
const sessions = [];
|
|
372
|
+
// Sources whose discovery actually RAN (and, for sources that catch their own
|
|
373
|
+
// errors, SUCCEEDED) this run. Only these may be bootstrapped: writing a
|
|
374
|
+
// first-enable watermark for a source we never read — because its flag was off
|
|
375
|
+
// or its store was unreadable — would falsely baseline real history and let a
|
|
376
|
+
// later run save it as new. Claude/Codex don't catch discovery errors, so a
|
|
377
|
+
// failure aborts the whole run before any watermark; they are live whenever
|
|
378
|
+
// attempted. Cursor catches (opt-in, best-effort), so it is live only when
|
|
379
|
+
// enabled AND its read succeeds.
|
|
380
|
+
const liveSources = new Set();
|
|
381
|
+
let cursorDiscovery;
|
|
382
|
+
let claudeDesktopDiscovery;
|
|
383
|
+
if (!allowedSources || allowedSources.has("claude_code")) {
|
|
384
|
+
liveSources.add("claude_code");
|
|
385
|
+
sessions.push(...discoverClaudeCodeSessions(claudeDir).map((session) => ({
|
|
386
|
+
source: "claude_code",
|
|
387
|
+
sessionId: session.sessionId,
|
|
388
|
+
path: session.path,
|
|
389
|
+
project: session.projectDir,
|
|
390
|
+
})));
|
|
391
|
+
}
|
|
392
|
+
if (!allowedSources || allowedSources.has("codex_cli")) {
|
|
393
|
+
liveSources.add("codex_cli");
|
|
394
|
+
sessions.push(...discoverCodexSessions(codexDir).map((session) => ({
|
|
395
|
+
source: "codex_cli",
|
|
396
|
+
sessionId: session.sessionId,
|
|
397
|
+
path: session.path,
|
|
398
|
+
project: session.root,
|
|
399
|
+
})));
|
|
400
|
+
}
|
|
401
|
+
// Opt-in only: gated on EXPLICIT membership (not `!allowedSources`), so the
|
|
402
|
+
// null/"all defaults" path never reads the Claude desktop store. FAIL CLOSED:
|
|
403
|
+
// mark the source live (and therefore bootstrappable) ONLY after a clean scan.
|
|
404
|
+
// An unreadable store throws in discovery; we skip it for this run rather than
|
|
405
|
+
// watermark a store we couldn't read — otherwise a later, readable run would
|
|
406
|
+
// import that private Cowork history as new. This matches Cursor's fail-closed
|
|
407
|
+
// *watermark* behaviour (live only after a clean read), and records the
|
|
408
|
+
// outcome so `onadit status` can be honest about an explicit Cowork opt-in.
|
|
409
|
+
if (allowedSources?.has(CLAUDE_DESKTOP_CAPTURE_SOURCE)) {
|
|
410
|
+
try {
|
|
411
|
+
for (const session of discoverClaudeDesktopSessions(claudeDesktopDir)) {
|
|
412
|
+
sessions.push({
|
|
413
|
+
source: CLAUDE_DESKTOP_CAPTURE_SOURCE,
|
|
414
|
+
sessionId: session.sessionId,
|
|
415
|
+
path: session.path,
|
|
416
|
+
project: "cowork",
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
liveSources.add(CLAUDE_DESKTOP_CAPTURE_SOURCE);
|
|
420
|
+
claudeDesktopDiscovery = { ok: true };
|
|
421
|
+
}
|
|
422
|
+
catch (err) {
|
|
423
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
424
|
+
const code = err.code;
|
|
425
|
+
claudeDesktopDiscovery = {
|
|
426
|
+
ok: false,
|
|
427
|
+
error: message,
|
|
428
|
+
...(typeof code === "string" ? { error_code: code } : {}),
|
|
429
|
+
};
|
|
430
|
+
process.stderr.write(`Claude desktop capture: skipped (store unreadable): ${message}\n`);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
if (allowedSources?.has("grok_cli")) {
|
|
434
|
+
for (const grok of discoverGrokSessions(grokDir)) {
|
|
435
|
+
sessions.push({ source: "grok_cli", sessionId: grok.sessionId,
|
|
436
|
+
path: grok.path, project: grok.project, grok });
|
|
437
|
+
}
|
|
438
|
+
liveSources.add("grok_cli");
|
|
439
|
+
}
|
|
440
|
+
if (cursor.enabled &&
|
|
441
|
+
(!allowedSources || allowedSources.has(CURSOR_CAPTURE_SOURCE))) {
|
|
442
|
+
try {
|
|
443
|
+
const disco = discoverCursorCaptureSessions({
|
|
444
|
+
cursorDir: cursor.cursorDir,
|
|
445
|
+
...(cursor.reader ? { reader: cursor.reader } : {}),
|
|
446
|
+
});
|
|
447
|
+
for (const s of disco.sessions) {
|
|
448
|
+
sessions.push({
|
|
449
|
+
source: CURSOR_CAPTURE_SOURCE,
|
|
450
|
+
sessionId: s.composerId,
|
|
451
|
+
path: disco.dbPath,
|
|
452
|
+
project: s.project,
|
|
453
|
+
cursor: {
|
|
454
|
+
raw: disco.raw,
|
|
455
|
+
fingerprintInput: s.fingerprintInput,
|
|
456
|
+
projectRoot: s.projectRoot,
|
|
457
|
+
projectRootStatus: s.projectRootStatus,
|
|
458
|
+
stableKey: s.stableKey,
|
|
459
|
+
},
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
// Reached only on a clean read — now Cursor is safe to bootstrap. If the
|
|
463
|
+
// store throws below, we deliberately leave it OUT of liveSources so a
|
|
464
|
+
// transient read failure on the first-enable run cannot watermark (and
|
|
465
|
+
// thereby skip) real history that a later, readable run would discover.
|
|
466
|
+
liveSources.add(CURSOR_CAPTURE_SOURCE);
|
|
467
|
+
cursorDiscovery = { ok: true };
|
|
468
|
+
}
|
|
469
|
+
catch (err) {
|
|
470
|
+
// Cursor not installed / sqlite3 missing / store read failed: a benign
|
|
471
|
+
// skip for the RUN (the opt-in must never fail the whole capture), but NO
|
|
472
|
+
// LONGER a silent one. Record the outcome so status can warn that a
|
|
473
|
+
// scheduled Cursor opt-in physically can't read its store — instead of
|
|
474
|
+
// claiming "capture on" off the file-presence probe alone.
|
|
475
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
476
|
+
const code = err.code;
|
|
477
|
+
cursorDiscovery = {
|
|
478
|
+
ok: false,
|
|
479
|
+
error: message,
|
|
480
|
+
...(typeof code === "string" ? { error_code: code } : {}),
|
|
481
|
+
};
|
|
482
|
+
process.stderr.write(`Cursor capture: skipped (store unreadable): ${message}\n`);
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
return {
|
|
486
|
+
sessions,
|
|
487
|
+
liveSources,
|
|
488
|
+
...(cursorDiscovery ? { cursorDiscovery } : {}),
|
|
489
|
+
...(claudeDesktopDiscovery ? { claudeDesktopDiscovery } : {}),
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
function applyBootstrap(ctx, sessions, enabledSources, liveSources, cursorConfigEnabled, dryRun) {
|
|
493
|
+
const bootstrappedSessionKeys = new Set();
|
|
494
|
+
const nowIso = new Date().toISOString();
|
|
495
|
+
for (const source of enabledSources) {
|
|
496
|
+
// Only bootstrap a source whose discovery actually ran (and succeeded) this
|
|
497
|
+
// run — see `liveSources` in discoverAllSessions. A source that was listed
|
|
498
|
+
// but not read (flag off, or store unreadable) must NOT get a watermark, or
|
|
499
|
+
// it would falsely baseline history we never looked at.
|
|
500
|
+
if (!liveSources.has(source))
|
|
501
|
+
continue;
|
|
502
|
+
// Grok opt-in explicitly covers existing and future sessions.
|
|
503
|
+
if (source === "grok_cli")
|
|
504
|
+
continue;
|
|
505
|
+
// Skip sources that don't persist (Cursor with neither the config opt-in nor
|
|
506
|
+
// both env flags): a watermark is a write we must not make for a triage-only
|
|
507
|
+
// source.
|
|
508
|
+
if (!writesEnabledForSource(source, cursorConfigEnabled))
|
|
509
|
+
continue;
|
|
510
|
+
if (!shouldBootstrapSource(ctx.state, source, dryRun)) {
|
|
511
|
+
continue;
|
|
512
|
+
}
|
|
513
|
+
const sourceSessions = sessions.filter((session) => session.source === source);
|
|
514
|
+
for (const session of sourceSessions) {
|
|
515
|
+
const fingerprint = sessionFingerprint(session);
|
|
516
|
+
ctx.state.processed[stateKey(session.source, session.sessionId)] = {
|
|
517
|
+
fingerprint,
|
|
518
|
+
idempotency_key: "",
|
|
519
|
+
};
|
|
520
|
+
bootstrappedSessionKeys.add(stateKey(session.source, session.sessionId));
|
|
521
|
+
}
|
|
522
|
+
ensureCounts(ctx.report, source).bootstrapped += sourceSessions.length;
|
|
523
|
+
ctx.state.bootstrapped_sources = {
|
|
524
|
+
...(ctx.state.bootstrapped_sources ?? {}),
|
|
525
|
+
[source]: nowIso,
|
|
526
|
+
};
|
|
527
|
+
ctx.stateChanged = true;
|
|
528
|
+
}
|
|
529
|
+
return bootstrappedSessionKeys;
|
|
530
|
+
}
|
|
531
|
+
function deriveTopLevelTotals(report) {
|
|
532
|
+
const totals = {
|
|
533
|
+
total_discovered: 0,
|
|
534
|
+
new_conversations: 0,
|
|
535
|
+
saved: 0,
|
|
536
|
+
discarded: 0,
|
|
537
|
+
review: 0,
|
|
538
|
+
quarantined: 0,
|
|
539
|
+
errors: 0,
|
|
540
|
+
deferred: 0,
|
|
541
|
+
bootstrapped: 0,
|
|
542
|
+
};
|
|
543
|
+
for (const counts of Object.values(report.counts_by_source)) {
|
|
544
|
+
if (!counts)
|
|
545
|
+
continue;
|
|
546
|
+
totals.total_discovered += counts.discovered;
|
|
547
|
+
totals.new_conversations += counts.new;
|
|
548
|
+
totals.saved += counts.saved;
|
|
549
|
+
totals.discarded += counts.discarded;
|
|
550
|
+
totals.review += counts.review;
|
|
551
|
+
totals.quarantined += counts.quarantined;
|
|
552
|
+
totals.errors += counts.errors;
|
|
553
|
+
totals.deferred += counts.deferred;
|
|
554
|
+
totals.bootstrapped += counts.bootstrapped;
|
|
555
|
+
}
|
|
556
|
+
report.total_discovered = totals.total_discovered;
|
|
557
|
+
report.new_conversations = totals.new_conversations;
|
|
558
|
+
report.saved = totals.saved;
|
|
559
|
+
report.discarded = totals.discarded;
|
|
560
|
+
report.review = totals.review;
|
|
561
|
+
report.quarantined = totals.quarantined;
|
|
562
|
+
report.errors = totals.errors;
|
|
563
|
+
report.deferred = totals.deferred;
|
|
564
|
+
report.bootstrapped = totals.bootstrapped;
|
|
565
|
+
return report;
|
|
566
|
+
}
|
|
567
|
+
function applySessionOutcome(ctx, outcome) {
|
|
568
|
+
const counts = ensureCounts(ctx.report, outcome.source);
|
|
569
|
+
counts.new += outcome.counts.new ?? 0;
|
|
570
|
+
counts.skipped += outcome.counts.skipped ?? 0;
|
|
571
|
+
counts.saved += outcome.counts.saved ?? 0;
|
|
572
|
+
counts.review += outcome.counts.review ?? 0;
|
|
573
|
+
counts.discarded += outcome.counts.discarded ?? 0;
|
|
574
|
+
counts.quarantined += outcome.counts.quarantined ?? 0;
|
|
575
|
+
counts.errors += outcome.counts.errors ?? 0;
|
|
576
|
+
counts.deferred += outcome.counts.deferred ?? 0;
|
|
577
|
+
ctx.report.results.push(...outcome.results);
|
|
578
|
+
ctx.report.error_details.push(...outcome.errorDetails);
|
|
579
|
+
ctx.stateChanged ||= outcome.stateChanged;
|
|
580
|
+
}
|
|
581
|
+
/** True when two processed-ledger entries carry the same fingerprint+key. */
|
|
582
|
+
function processedEntriesEqual(a, b) {
|
|
583
|
+
if (a === undefined || b === undefined)
|
|
584
|
+
return a === b;
|
|
585
|
+
if (typeof a === "string" || typeof b === "string")
|
|
586
|
+
return a === b;
|
|
587
|
+
return (a.fingerprint === b.fingerprint && a.idempotency_key === b.idempotency_key);
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* Persist the capture state, merging with the ledger as it is now.
|
|
591
|
+
*
|
|
592
|
+
* The ledger is read once at run start and written once at run end. Other
|
|
593
|
+
* capture runs — the daemon tick, `onadit capture`, scripted captures of other
|
|
594
|
+
* agent homes — may commit in between, from other processes. A blind
|
|
595
|
+
* overwrite would erase what they ADDED (sessions we never saw) and revert
|
|
596
|
+
* what they UPDATED (keys we hold but didn't reprocess). So we overlay ONLY
|
|
597
|
+
* the keys this run changed, detected by diffing against the run-start
|
|
598
|
+
* snapshot (`initialProcessed`), onto the current ledger. (Two runs changing
|
|
599
|
+
* the SAME key resolve last-committer-wins; both hold a valid entry.)
|
|
600
|
+
*
|
|
601
|
+
* The commit is a compare-and-swap, with no lock: generation N+1 is published
|
|
602
|
+
* with link(2), which is atomic and fails if N+1 already exists. Losing that
|
|
603
|
+
* race means another run committed after our read, so we reload, merge again
|
|
604
|
+
* and retry. A successful link is then checked against the newest generation
|
|
605
|
+
* (see below), so a save paused long enough for cleanup to free the name it
|
|
606
|
+
* links cannot pass with an obsolete snapshot. Every generation readers use is
|
|
607
|
+
* therefore merged from the one before it, and no interleaving can drop an
|
|
608
|
+
* entry. There is nothing to
|
|
609
|
+
* recover after a crash — a dead writer leaves at most a temp file — so no
|
|
610
|
+
* process ever has to judge or delete another's state.
|
|
611
|
+
*/
|
|
612
|
+
async function saveState(dataDir, state, initialProcessed, hooks = {}) {
|
|
613
|
+
const genDir = path.join(dataDir, STATE_GENERATIONS_DIR);
|
|
614
|
+
fs.mkdirSync(genDir, { recursive: true });
|
|
615
|
+
for (let attempt = 0; attempt < STATE_COMMIT_ATTEMPTS; attempt++) {
|
|
616
|
+
const { state: current, generation } = loadCurrentState(dataDir);
|
|
617
|
+
await hooks.afterRead?.(attempt);
|
|
618
|
+
const body = JSON.stringify(mergeCaptureState(current, state, initialProcessed), null, 2);
|
|
619
|
+
const tmp = path.join(genDir, `.tmp-${process.pid}-${crypto.randomUUID()}`);
|
|
620
|
+
fs.writeFileSync(tmp, body, "utf-8");
|
|
621
|
+
try {
|
|
622
|
+
fs.linkSync(tmp, path.join(genDir, `${generation + 1}.json`));
|
|
623
|
+
}
|
|
624
|
+
catch (err) {
|
|
625
|
+
if (err.code === "EEXIST")
|
|
626
|
+
continue;
|
|
627
|
+
throw err;
|
|
628
|
+
}
|
|
629
|
+
finally {
|
|
630
|
+
fs.rmSync(tmp, { force: true });
|
|
631
|
+
}
|
|
632
|
+
// link() only proves the name was free, not that it was never used:
|
|
633
|
+
// cleanup frees old names, so a save paused past the retention window
|
|
634
|
+
// could land on one with an obsolete snapshot. Cleanup never removes the
|
|
635
|
+
// newest generation, so in that case a newer one is still on disk. Any
|
|
636
|
+
// newer generation means "maybe obsolete": merge again from the newest.
|
|
637
|
+
// (It may instead be a run that already built on ours; re-applying our
|
|
638
|
+
// changes is then a no-op.)
|
|
639
|
+
if ((listStateGenerations(genDir).at(-1) ?? 0) > generation + 1)
|
|
640
|
+
continue;
|
|
641
|
+
// Mirror for readers that predate generations. It can lag when runs
|
|
642
|
+
// overlap, so the ledger itself is never read from it once generations exist.
|
|
643
|
+
await atomicWrite(path.join(dataDir, STATE_FILE), body);
|
|
644
|
+
pruneStateGenerations(genDir, generation + 1);
|
|
645
|
+
return;
|
|
646
|
+
}
|
|
647
|
+
throw new Error(`Auto-capture state: gave up after ${STATE_COMMIT_ATTEMPTS} commit attempts (other capture runs kept committing)`);
|
|
648
|
+
}
|
|
649
|
+
function mergeCaptureState(current, state, initialProcessed) {
|
|
650
|
+
const mergedProcessed = { ...current.processed };
|
|
651
|
+
for (const [key, value] of Object.entries(state.processed)) {
|
|
652
|
+
if (!processedEntriesEqual(initialProcessed[key], value)) {
|
|
653
|
+
mergedProcessed[key] = value;
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
const mergedBootstrapped = {
|
|
657
|
+
...(current.bootstrapped_sources ?? {}),
|
|
658
|
+
...(state.bootstrapped_sources ?? {}),
|
|
659
|
+
};
|
|
660
|
+
return {
|
|
661
|
+
processed: mergedProcessed,
|
|
662
|
+
...(Object.keys(mergedBootstrapped).length > 0
|
|
663
|
+
? { bootstrapped_sources: mergedBootstrapped }
|
|
664
|
+
: {}),
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* Drop old generations and stray temp files. A file is removed only when it
|
|
669
|
+
* is older than STATE_GENERATION_KEEP_MS and not among the newest few, far
|
|
670
|
+
* beyond a normal read-to-commit window (milliseconds). A save paused longer
|
|
671
|
+
* than that is caught by saveState's post-link check. Best-effort.
|
|
672
|
+
*/
|
|
673
|
+
function pruneStateGenerations(genDir, newest) {
|
|
674
|
+
const cutoff = Date.now() - STATE_GENERATION_KEEP_MS;
|
|
675
|
+
let names;
|
|
676
|
+
try {
|
|
677
|
+
names = fs.readdirSync(genDir);
|
|
678
|
+
}
|
|
679
|
+
catch {
|
|
680
|
+
return;
|
|
681
|
+
}
|
|
682
|
+
for (const name of names) {
|
|
683
|
+
const gen = /^(\d+)\.json$/.exec(name)?.[1];
|
|
684
|
+
if (gen !== undefined && Number(gen) > newest - STATE_GENERATION_KEEP_COUNT)
|
|
685
|
+
continue;
|
|
686
|
+
if (gen === undefined && !name.startsWith(".tmp-"))
|
|
687
|
+
continue;
|
|
688
|
+
const file = path.join(genDir, name);
|
|
689
|
+
try {
|
|
690
|
+
if (fs.statSync(file).mtimeMs < cutoff)
|
|
691
|
+
fs.rmSync(file, { force: true });
|
|
692
|
+
}
|
|
693
|
+
catch {
|
|
694
|
+
// already gone
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
/** Test hooks: the ledger save and load, callable from a separate process. */
|
|
699
|
+
export async function saveCaptureStateForTests(dataDir, state, initialProcessed, hooks = {}) {
|
|
700
|
+
await saveState(dataDir, state, initialProcessed, hooks);
|
|
701
|
+
}
|
|
702
|
+
export function loadCaptureStateForTests(dataDir) {
|
|
703
|
+
return loadState(dataDir);
|
|
704
|
+
}
|
|
705
|
+
/**
|
|
706
|
+
* Write an operator-recovery record for a Codex session that was skipped
|
|
707
|
+
* before triage because it exceeds the configured byte-size threshold.
|
|
708
|
+
*
|
|
709
|
+
* Filename is deterministic (`codex_cli_<sessionId>_<fingerprint>.json`) so
|
|
710
|
+
* repeated runs collide on the same path; the existsSync gate makes the
|
|
711
|
+
* write a no-op on retry. The source jsonl is never read or mutated — the
|
|
712
|
+
* record only carries metadata the operator needs to backfill or raise the
|
|
713
|
+
* threshold later.
|
|
714
|
+
*/
|
|
715
|
+
async function writeOversizedQuarantineRecord(opts) {
|
|
716
|
+
const dir = path.join(opts.dataDir, "quarantine");
|
|
717
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
718
|
+
const filename = `${opts.source}_${opts.sessionId}_${opts.fingerprint}.json`;
|
|
719
|
+
const target = path.join(dir, filename);
|
|
720
|
+
if (fs.existsSync(target))
|
|
721
|
+
return;
|
|
722
|
+
const remediation = opts.source === CURSOR_CAPTURE_SOURCE
|
|
723
|
+
? "Raise AutoCaptureDeps.cursorMaxSessionBytes for the run, or split the Cursor session."
|
|
724
|
+
: "Raise capture.codex_cli.max_session_bytes (and restart the daemon), or use the future opt-in chunked-summarize backfill.";
|
|
725
|
+
const record = {
|
|
726
|
+
source: opts.source,
|
|
727
|
+
session_id: opts.sessionId,
|
|
728
|
+
session_path: opts.sessionPath,
|
|
729
|
+
size_bytes: opts.sizeBytes,
|
|
730
|
+
threshold_bytes: opts.thresholdBytes,
|
|
731
|
+
fingerprint: opts.fingerprint,
|
|
732
|
+
reason: "oversized-session",
|
|
733
|
+
remediation,
|
|
734
|
+
quarantined_at: new Date().toISOString(),
|
|
735
|
+
};
|
|
736
|
+
await atomicWrite(target, JSON.stringify(record, null, 2));
|
|
737
|
+
}
|
|
738
|
+
/**
|
|
739
|
+
* Compute a content hash for deduplication.
|
|
740
|
+
* Uses file size + last few bytes as a fast fingerprint.
|
|
741
|
+
* A full content hash would be too slow for large files.
|
|
742
|
+
*/
|
|
743
|
+
function contentFingerprint(filePath) {
|
|
744
|
+
const stat = fs.statSync(filePath);
|
|
745
|
+
const size = stat.size;
|
|
746
|
+
// Read last 4KB for fingerprinting (captures recent messages)
|
|
747
|
+
const fd = fs.openSync(filePath, "r");
|
|
748
|
+
const tailSize = Math.min(size, 4096);
|
|
749
|
+
const buf = Buffer.alloc(tailSize);
|
|
750
|
+
fs.readSync(fd, buf, 0, tailSize, Math.max(0, size - tailSize));
|
|
751
|
+
fs.closeSync(fd);
|
|
752
|
+
return crypto
|
|
753
|
+
.createHash("sha256")
|
|
754
|
+
.update(`${size}:`)
|
|
755
|
+
.update(buf)
|
|
756
|
+
.digest("hex")
|
|
757
|
+
.slice(0, 16);
|
|
758
|
+
}
|
|
759
|
+
async function processSession(session, state, deps) {
|
|
760
|
+
const empty = () => ({
|
|
761
|
+
source: session.source,
|
|
762
|
+
counts: {},
|
|
763
|
+
results: [],
|
|
764
|
+
errorDetails: [],
|
|
765
|
+
stateChanged: false,
|
|
766
|
+
});
|
|
767
|
+
try {
|
|
768
|
+
const skip = (reason) => ({
|
|
769
|
+
...empty(), counts: { skipped: 1 },
|
|
770
|
+
skipDetails: [{ source: session.source, sessionId: session.sessionId, path: session.path, reason }],
|
|
771
|
+
});
|
|
772
|
+
if (session.grok?.skipReason)
|
|
773
|
+
return skip(session.grok.skipReason);
|
|
774
|
+
const fingerprint = sessionFingerprint(session);
|
|
775
|
+
// Cursor is triage-only this slice: no /save, no review-queue, no
|
|
776
|
+
// capture-state write — regardless of --dry-run. See writesEnabledForSource.
|
|
777
|
+
const writesAllowed = !deps.dryRun &&
|
|
778
|
+
writesEnabledForSource(session.source, Boolean(deps.cursorConfigEnabled));
|
|
779
|
+
const cursorResultFields = session.cursor
|
|
780
|
+
? {
|
|
781
|
+
projectRootStatus: session.cursor.projectRootStatus,
|
|
782
|
+
stableKey: session.cursor.stableKey,
|
|
783
|
+
}
|
|
784
|
+
: {};
|
|
785
|
+
// Cursor titles are private (user's session name / first prompt), and even
|
|
786
|
+
// the triage-only dry-run prints result titles to the terminal and JSON.
|
|
787
|
+
// Redact to a non-identifying label by default; reveal only behind an
|
|
788
|
+
// explicit opt-in. Claude/Codex titles are untouched.
|
|
789
|
+
const displayTitle = (parsedTitle) => {
|
|
790
|
+
if (session.cursor && !cursorTitlesRevealed()) {
|
|
791
|
+
return redactedCursorTitle(session.sessionId);
|
|
792
|
+
}
|
|
793
|
+
return parsedTitle ?? "(empty)";
|
|
794
|
+
};
|
|
795
|
+
const prev = getPreviousEntry(state, session.source, session.sessionId);
|
|
796
|
+
const prevFingerprint = typeof prev === "string" ? prev : prev?.fingerprint;
|
|
797
|
+
const prevKey = typeof prev === "object" ? prev?.idempotency_key : undefined;
|
|
798
|
+
if (prevFingerprint === fingerprint) {
|
|
799
|
+
if (session.grok)
|
|
800
|
+
return skip("Unchanged since previous capture");
|
|
801
|
+
return {
|
|
802
|
+
...empty(),
|
|
803
|
+
counts: { skipped: 1 },
|
|
804
|
+
};
|
|
805
|
+
}
|
|
806
|
+
if (session.source === "codex_cli") {
|
|
807
|
+
const maxBytes = deps.codexMaxSessionBytes ?? DEFAULT_CODEX_MAX_SESSION_BYTES;
|
|
808
|
+
const sizeBytes = fs.statSync(session.path).size;
|
|
809
|
+
if (sizeBytes > maxBytes) {
|
|
810
|
+
const outcome = empty();
|
|
811
|
+
outcome.counts.quarantined = 1;
|
|
812
|
+
if (!deps.dryRun) {
|
|
813
|
+
await writeOversizedQuarantineRecord({
|
|
814
|
+
source: session.source,
|
|
815
|
+
dataDir: deps.dataDir,
|
|
816
|
+
sessionId: session.sessionId,
|
|
817
|
+
sessionPath: session.path,
|
|
818
|
+
sizeBytes,
|
|
819
|
+
thresholdBytes: maxBytes,
|
|
820
|
+
fingerprint,
|
|
821
|
+
});
|
|
822
|
+
state.processed[stateKey(session.source, session.sessionId)] = {
|
|
823
|
+
fingerprint,
|
|
824
|
+
idempotency_key: QUARANTINED_OVERSIZED_KEY,
|
|
825
|
+
};
|
|
826
|
+
outcome.stateChanged = true;
|
|
827
|
+
}
|
|
828
|
+
return outcome;
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
const isUpdate = prevFingerprint !== undefined;
|
|
832
|
+
const outcome = empty();
|
|
833
|
+
outcome.counts.new = 1;
|
|
834
|
+
let parsed;
|
|
835
|
+
if (session.cursor) {
|
|
836
|
+
parsed = parseCursorComposerSession(session.cursor.raw, session.sessionId);
|
|
837
|
+
}
|
|
838
|
+
else {
|
|
839
|
+
const data = fs.readFileSync(session.path, "utf-8");
|
|
840
|
+
parsed =
|
|
841
|
+
session.source === "claude_code"
|
|
842
|
+
? parseClaudeCodeSession(session.sessionId, data)
|
|
843
|
+
: session.grok
|
|
844
|
+
? parseGrokSession(session.sessionId, data, session.grok.metadata)
|
|
845
|
+
: session.source === CLAUDE_DESKTOP_CAPTURE_SOURCE
|
|
846
|
+
? parseClaudeDesktopSession(session.sessionId, data)
|
|
847
|
+
: parseCodexSession(session.sessionId, data);
|
|
848
|
+
}
|
|
849
|
+
if (!parsed || parsed.content.length < 100) {
|
|
850
|
+
if (writesAllowed) {
|
|
851
|
+
state.processed[stateKey(session.source, session.sessionId)] = {
|
|
852
|
+
fingerprint,
|
|
853
|
+
idempotency_key: "",
|
|
854
|
+
};
|
|
855
|
+
outcome.stateChanged = true;
|
|
856
|
+
}
|
|
857
|
+
outcome.counts.discarded = 1;
|
|
858
|
+
outcome.results.push({
|
|
859
|
+
source: session.source,
|
|
860
|
+
sessionId: session.sessionId,
|
|
861
|
+
title: displayTitle(parsed?.title),
|
|
862
|
+
decision: "discard",
|
|
863
|
+
confidence: 1.0,
|
|
864
|
+
model: "n/a",
|
|
865
|
+
provider: "auto-capture",
|
|
866
|
+
summary: "Too short or empty",
|
|
867
|
+
...cursorResultFields,
|
|
868
|
+
});
|
|
869
|
+
return outcome;
|
|
870
|
+
}
|
|
871
|
+
// Cursor size guard. Cursor has no file to stat (its content lives in a
|
|
872
|
+
// shared `state.vscdb`), so the guard runs on the PARSED transcript — the
|
|
873
|
+
// exact text triage would feed the subprocess — and fires BEFORE any triage
|
|
874
|
+
// or save. Mirrors the codex oversized path: quarantine, never triage. The
|
|
875
|
+
// quarantine record + capture-state sentinel are writes, so they only land
|
|
876
|
+
// when writes are allowed (persist on, non-dry); otherwise it is a pure skip.
|
|
877
|
+
//
|
|
878
|
+
// TERMINAL by design (decided pre-scheduling): unlike Codex, an oversized
|
|
879
|
+
// Cursor session has NO auto-recovery path — `recover-quarantine` globs only
|
|
880
|
+
// `codex_cli_` records, so it never touches the `cursor_composer_` record we
|
|
881
|
+
// write here, and `countParkedOversizedSessions` never raises a "run repair"
|
|
882
|
+
// advisory for it. The record is operator-visible metadata only; the sole
|
|
883
|
+
// remediation is to raise the byte limit or split the session, after which
|
|
884
|
+
// the grown/changed fingerprint re-discovers it on a later run. Cursor
|
|
885
|
+
// chunked-summarize backfill is deferred to the scheduling slice.
|
|
886
|
+
if (session.cursor) {
|
|
887
|
+
const sizeBytes = Buffer.byteLength(parsed.content, "utf8");
|
|
888
|
+
const maxBytes = deps.cursorMaxSessionBytes ?? DEFAULT_CURSOR_MAX_SESSION_BYTES;
|
|
889
|
+
if (sizeBytes > maxBytes) {
|
|
890
|
+
const oversized = empty();
|
|
891
|
+
oversized.counts.quarantined = 1;
|
|
892
|
+
if (writesAllowed) {
|
|
893
|
+
await writeOversizedQuarantineRecord({
|
|
894
|
+
source: session.source,
|
|
895
|
+
dataDir: deps.dataDir,
|
|
896
|
+
sessionId: session.sessionId,
|
|
897
|
+
sessionPath: session.path,
|
|
898
|
+
sizeBytes,
|
|
899
|
+
thresholdBytes: maxBytes,
|
|
900
|
+
fingerprint,
|
|
901
|
+
});
|
|
902
|
+
state.processed[stateKey(session.source, session.sessionId)] = {
|
|
903
|
+
fingerprint,
|
|
904
|
+
idempotency_key: QUARANTINED_OVERSIZED_KEY,
|
|
905
|
+
};
|
|
906
|
+
oversized.stateChanged = true;
|
|
907
|
+
}
|
|
908
|
+
return oversized;
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
const triage = await triageConversation(parsed.content);
|
|
912
|
+
const result = {
|
|
913
|
+
source: session.source,
|
|
914
|
+
sessionId: session.sessionId,
|
|
915
|
+
title: displayTitle(parsed.title),
|
|
916
|
+
decision: triage.decision,
|
|
917
|
+
confidence: triage.confidence,
|
|
918
|
+
model: triage.model,
|
|
919
|
+
provider: triage.provider,
|
|
920
|
+
summary: triage.summary,
|
|
921
|
+
...cursorResultFields,
|
|
922
|
+
};
|
|
923
|
+
outcome.results.push(result);
|
|
924
|
+
// Only quotes found inside a turn the user typed are kept; see
|
|
925
|
+
// user-statements.ts. The worker's claims alone are never stored. What
|
|
926
|
+
// the session's previous capture stored is checked again alongside them.
|
|
927
|
+
const earlier = await deps.storedStatements?.(session.source, session.sessionId);
|
|
928
|
+
const userStatements = (await verifyUserStatementsWithEvidence({
|
|
929
|
+
content: parsed.content,
|
|
930
|
+
userSpans: parsed.userSpans,
|
|
931
|
+
decisions: triage.user_decisions,
|
|
932
|
+
constraints: triage.user_constraints,
|
|
933
|
+
earlier,
|
|
934
|
+
}, deps.assistantText)).map(encodeUserStatement);
|
|
935
|
+
const saidByUser = userStatements.length > 0 && writesAllowed
|
|
936
|
+
? {
|
|
937
|
+
decisions: userStatements,
|
|
938
|
+
user_statements_seal: sealUserStatements(deps.dataDir, userStatements, parsed.content),
|
|
939
|
+
}
|
|
940
|
+
: {};
|
|
941
|
+
if (!writesAllowed) {
|
|
942
|
+
// Writes are off for one of two reasons, and they are NOT equivalent:
|
|
943
|
+
// - dry-run of a persistable source: a faithful preview of what a real
|
|
944
|
+
// run WOULD persist, so save/review count as saved/review.
|
|
945
|
+
// - a source whose persistence is gated off this slice (Cursor): a real
|
|
946
|
+
// run would not persist it either, so reporting "saved" is a lie. Even
|
|
947
|
+
// a non-dry `onadit capture` reaches the health ledger (capture.ts), and
|
|
948
|
+
// `onadit status` would then sum those as real saved sessions. Bucket
|
|
949
|
+
// these as `deferred` so neither the ledger nor status ever inflates.
|
|
950
|
+
// Bucketing keys on the SOURCE (writesEnabledForSource), not --dry-run, so
|
|
951
|
+
// a gated source reads `deferred` consistently in dry and non-dry runs.
|
|
952
|
+
const persistable = writesEnabledForSource(session.source, Boolean(deps.cursorConfigEnabled));
|
|
953
|
+
switch (triage.decision) {
|
|
954
|
+
case "save":
|
|
955
|
+
if (persistable)
|
|
956
|
+
outcome.counts.saved = 1;
|
|
957
|
+
else
|
|
958
|
+
outcome.counts.deferred = 1;
|
|
959
|
+
break;
|
|
960
|
+
case "review":
|
|
961
|
+
if (persistable)
|
|
962
|
+
outcome.counts.review = 1;
|
|
963
|
+
else
|
|
964
|
+
outcome.counts.deferred = 1;
|
|
965
|
+
break;
|
|
966
|
+
case "discard":
|
|
967
|
+
// A discard persists nothing regardless of the gate, so it is honest
|
|
968
|
+
// in either case and never inflates a "saved" count.
|
|
969
|
+
outcome.counts.discarded = 1;
|
|
970
|
+
break;
|
|
971
|
+
}
|
|
972
|
+
return outcome;
|
|
973
|
+
}
|
|
974
|
+
switch (triage.decision) {
|
|
975
|
+
case "save": {
|
|
976
|
+
const newKey = `auto-capture:${session.source}:${session.sessionId}:${fingerprint}`;
|
|
977
|
+
await deps.saveFn({
|
|
978
|
+
source: session.source,
|
|
979
|
+
summary: triage.summary,
|
|
980
|
+
content: parsed.content,
|
|
981
|
+
topics: triage.topics,
|
|
982
|
+
...saidByUser,
|
|
983
|
+
idempotency_key: newKey,
|
|
984
|
+
...(isUpdate && prevKey ? { replace_idempotency_key: prevKey } : {}),
|
|
985
|
+
...(parsed.cwd ? { cwd: parsed.cwd } : {}),
|
|
986
|
+
});
|
|
987
|
+
outcome.counts.saved = 1;
|
|
988
|
+
break;
|
|
989
|
+
}
|
|
990
|
+
case "review": {
|
|
991
|
+
await addToReview(deps.dataDir, {
|
|
992
|
+
source: session.source,
|
|
993
|
+
conversationId: session.sessionId,
|
|
994
|
+
summary: triage.summary,
|
|
995
|
+
content: parsed.content,
|
|
996
|
+
triage,
|
|
997
|
+
...saidByUser,
|
|
998
|
+
project: session.project,
|
|
999
|
+
});
|
|
1000
|
+
outcome.counts.review = 1;
|
|
1001
|
+
break;
|
|
1002
|
+
}
|
|
1003
|
+
case "discard": {
|
|
1004
|
+
outcome.counts.discarded = 1;
|
|
1005
|
+
break;
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
const savedKey = triage.decision === "save"
|
|
1009
|
+
? `auto-capture:${session.source}:${session.sessionId}:${fingerprint}`
|
|
1010
|
+
: undefined;
|
|
1011
|
+
state.processed[stateKey(session.source, session.sessionId)] = {
|
|
1012
|
+
fingerprint,
|
|
1013
|
+
idempotency_key: savedKey ?? "",
|
|
1014
|
+
};
|
|
1015
|
+
outcome.stateChanged = true;
|
|
1016
|
+
return outcome;
|
|
1017
|
+
}
|
|
1018
|
+
catch (err) {
|
|
1019
|
+
return {
|
|
1020
|
+
source: session.source,
|
|
1021
|
+
counts: { errors: 1 },
|
|
1022
|
+
results: [],
|
|
1023
|
+
errorDetails: [{
|
|
1024
|
+
sessionId: session.sessionId,
|
|
1025
|
+
source: session.source,
|
|
1026
|
+
error: `[${session.source}] ${err instanceof Error ? err.message : String(err)}`,
|
|
1027
|
+
}],
|
|
1028
|
+
stateChanged: false,
|
|
1029
|
+
};
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
/**
|
|
1033
|
+
* Run the auto-capture pipeline.
|
|
1034
|
+
*
|
|
1035
|
+
* 1. Discover all supported local CLI conversation files
|
|
1036
|
+
* 2. Filter out already-processed conversations (by session UUID + content hash)
|
|
1037
|
+
* 3. Parse each new conversation
|
|
1038
|
+
* 4. Triage via Haiku (with Sonnet escalation)
|
|
1039
|
+
* 5. Route: save/review/discard
|
|
1040
|
+
* 6. Update dedupe state
|
|
1041
|
+
*/
|
|
1042
|
+
export async function runAutoCapture(deps) {
|
|
1043
|
+
const claudeDir = deps.claudeDir ?? path.join(os.homedir(), ".claude");
|
|
1044
|
+
const codexDir = deps.codexDir ?? path.join(os.homedir(), ".codex");
|
|
1045
|
+
const cursorDir = deps.cursorDir ?? defaultCursorDir();
|
|
1046
|
+
const claudeDesktopDir = deps.claudeDesktopDir ??
|
|
1047
|
+
path.join(os.homedir(), "Library", "Application Support", "Claude");
|
|
1048
|
+
const assistantText = deps.assistantText ??
|
|
1049
|
+
createAssistantTextLookup({
|
|
1050
|
+
ownedBy: ownsPassage,
|
|
1051
|
+
roots: sessionRoots({
|
|
1052
|
+
sources: deps.sources ?? ["claude_code", "codex_cli"],
|
|
1053
|
+
claudeDir,
|
|
1054
|
+
codexDir,
|
|
1055
|
+
claudeDesktopDir,
|
|
1056
|
+
grokDir: deps.grokDir,
|
|
1057
|
+
}),
|
|
1058
|
+
});
|
|
1059
|
+
const state = loadState(deps.dataDir);
|
|
1060
|
+
// Snapshot the ledger exactly as loaded so the end-of-run merge can overlay
|
|
1061
|
+
// ONLY the keys this run actually changed (see saveState). Capturing it here
|
|
1062
|
+
// — before bootstrap or processing mutates `state.processed` — is what lets
|
|
1063
|
+
// a slow run avoid clobbering a concurrent run's newer entry for a key this
|
|
1064
|
+
// run never touched.
|
|
1065
|
+
const initialProcessed = { ...state.processed };
|
|
1066
|
+
const allowedSources = deps.sources ? new Set(deps.sources) : null;
|
|
1067
|
+
// Cursor is enabled for this run via EITHER the config opt-in
|
|
1068
|
+
// (`cursorConfigEnabled` — cursor_composer in config.capture.sources, the
|
|
1069
|
+
// scheduled path) OR the `RIFT_CURSOR_CAPTURE` env flag (the ad-hoc/dogfood
|
|
1070
|
+
// path). Config enablement also authorizes persistence (see
|
|
1071
|
+
// writesEnabledForSource); the env path still needs CURSOR_CAPTURE_PERSIST.
|
|
1072
|
+
const cursorConfigEnabled = Boolean(deps.cursorConfigEnabled);
|
|
1073
|
+
const cursorOn = cursorConfigEnabled || cursorCaptureEnabled();
|
|
1074
|
+
// When no explicit source filter was given and Cursor is on (config or env),
|
|
1075
|
+
// it joins the default run so its sessions show up alongside claude/codex.
|
|
1076
|
+
const enabledSources = deps.sources
|
|
1077
|
+
? deps.sources
|
|
1078
|
+
: cursorOn
|
|
1079
|
+
? [...DEFAULT_AUTO_CAPTURE_SOURCES, CURSOR_CAPTURE_SOURCE]
|
|
1080
|
+
: DEFAULT_AUTO_CAPTURE_SOURCES;
|
|
1081
|
+
const { sessions, liveSources, cursorDiscovery, claudeDesktopDiscovery } = discoverAllSessions(allowedSources, claudeDir, codexDir, {
|
|
1082
|
+
enabled: cursorOn,
|
|
1083
|
+
cursorDir,
|
|
1084
|
+
...(deps.cursorReader ? { reader: deps.cursorReader } : {}),
|
|
1085
|
+
}, claudeDesktopDir, deps.grokDir ?? path.join(os.homedir(), ".grok"));
|
|
1086
|
+
const report = {
|
|
1087
|
+
total_discovered: 0,
|
|
1088
|
+
new_conversations: 0,
|
|
1089
|
+
saved: 0,
|
|
1090
|
+
discarded: 0,
|
|
1091
|
+
review: 0,
|
|
1092
|
+
quarantined: 0,
|
|
1093
|
+
errors: 0,
|
|
1094
|
+
deferred: 0,
|
|
1095
|
+
bootstrapped: 0,
|
|
1096
|
+
preflight_ok: true,
|
|
1097
|
+
counts_by_source: {},
|
|
1098
|
+
results: [],
|
|
1099
|
+
error_details: [],
|
|
1100
|
+
skipped_details: [],
|
|
1101
|
+
...(cursorDiscovery ? { cursor_discovery: cursorDiscovery } : {}),
|
|
1102
|
+
...(claudeDesktopDiscovery
|
|
1103
|
+
? { claude_desktop_discovery: claudeDesktopDiscovery }
|
|
1104
|
+
: {}),
|
|
1105
|
+
};
|
|
1106
|
+
for (const source of enabledSources) {
|
|
1107
|
+
ensureCounts(report, source);
|
|
1108
|
+
}
|
|
1109
|
+
for (const session of sessions) {
|
|
1110
|
+
ensureCounts(report, session.source).discovered++;
|
|
1111
|
+
}
|
|
1112
|
+
const ctx = {
|
|
1113
|
+
state,
|
|
1114
|
+
report,
|
|
1115
|
+
stateChanged: false,
|
|
1116
|
+
};
|
|
1117
|
+
const bootstrappedSessionKeys = applyBootstrap(ctx, sessions, enabledSources, liveSources, cursorConfigEnabled, Boolean(deps.dryRun));
|
|
1118
|
+
const sessionsToProcess = sessions.filter((session) => !bootstrappedSessionKeys.has(stateKey(session.source, session.sessionId)));
|
|
1119
|
+
if (enabledSources.length > 0) {
|
|
1120
|
+
// Stamp the worker that this run's preflight will use (and did use, on
|
|
1121
|
+
// failure) BEFORE running it, so the recorded outcome is attributable to the
|
|
1122
|
+
// worker that actually ran — never re-inferred later from drifting config or
|
|
1123
|
+
// ambiguous error text. `deps.preflightTriage` (test seam) stands in for the
|
|
1124
|
+
// configured provider, so the configured name is still the right label.
|
|
1125
|
+
report.preflight_worker =
|
|
1126
|
+
getConfiguredTriageProviderName() === "claude_code" ? "claude" : "codex";
|
|
1127
|
+
try {
|
|
1128
|
+
await (deps.preflightTriage ?? ensureAutoCaptureTriageReady)();
|
|
1129
|
+
}
|
|
1130
|
+
catch (err) {
|
|
1131
|
+
const error = err instanceof Error ? err.message : String(err);
|
|
1132
|
+
// Preflight is a triage-worker health probe (Codex or Claude), NOT a
|
|
1133
|
+
// conversation. Record it on its own field + the preflight_ok health flag,
|
|
1134
|
+
// never as per-source conversation errors — so the "N failed" count
|
|
1135
|
+
// reflects only real sessions. (autoCaptureRunFailed still flags the run
|
|
1136
|
+
// via preflight_ok.)
|
|
1137
|
+
report.preflight_ok = false;
|
|
1138
|
+
report.preflight_error = error;
|
|
1139
|
+
// A timeout/termination is transient (cold start, brief contention) and
|
|
1140
|
+
// has already been retried once at the runner. Don't abort the whole run
|
|
1141
|
+
// over a flaky probe — continue and let each session's own bounded-retry
|
|
1142
|
+
// triage decide; failures that remain are recorded as real per-session
|
|
1143
|
+
// errors and self-heal next run. A genuine auth/path failure (ENOENT,
|
|
1144
|
+
// non-zero exit) is fatal: abort rather than hammer every session with an
|
|
1145
|
+
// identical failure that would only bury the root cause.
|
|
1146
|
+
if (!isTransientPreflightError(err)) {
|
|
1147
|
+
if (ctx.stateChanged) {
|
|
1148
|
+
await saveState(deps.dataDir, state, initialProcessed);
|
|
1149
|
+
}
|
|
1150
|
+
return deriveTopLevelTotals(report);
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
const storedStatements = deps.storedStatements ?? createStoredStatementsLookup(deps.dataDir);
|
|
1155
|
+
for (const session of sessionsToProcess) {
|
|
1156
|
+
const outcome = await processSession(session, state, { ...deps, assistantText, storedStatements });
|
|
1157
|
+
applySessionOutcome(ctx, outcome);
|
|
1158
|
+
if (outcome.skipDetails)
|
|
1159
|
+
report.skipped_details.push(...outcome.skipDetails);
|
|
1160
|
+
}
|
|
1161
|
+
// Persist updated state
|
|
1162
|
+
if (!deps.dryRun && ctx.stateChanged) {
|
|
1163
|
+
await saveState(deps.dataDir, state, initialProcessed);
|
|
1164
|
+
}
|
|
1165
|
+
return deriveTopLevelTotals(report);
|
|
1166
|
+
}
|
|
1167
|
+
//# sourceMappingURL=auto-capture.js.map
|