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,745 @@
|
|
|
1
|
+
import crypto from "node:crypto";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { spawn, spawnSync } from "node:child_process";
|
|
6
|
+
import { findCodexModelRejection } from "../diagnostics/codex-preflight.js";
|
|
7
|
+
import { markCodexModelRefused, resetCodexModelCacheForTests, resolveCodexModel, } from "./codex-cli-model.js";
|
|
8
|
+
const SCHEMA_CACHE = new Map();
|
|
9
|
+
let codexVersionPromise = null;
|
|
10
|
+
let isolatedCodexHomePath = null;
|
|
11
|
+
// mtime (ms) of the SOURCE auth.json at the moment we last copied it into the
|
|
12
|
+
// isolated home. Drives the staleness re-copy in ensureIsolatedCodexHome.
|
|
13
|
+
let isolatedCodexAuthSourceMtimeMs = null;
|
|
14
|
+
let codexLaunchSpec = null;
|
|
15
|
+
let runtimeTempDirPath = null;
|
|
16
|
+
let runtimeCleanupRegistered = false;
|
|
17
|
+
// Cached SUCCESS of the pre-send `codex exec` capability probe. Only success is
|
|
18
|
+
// cached — see ensureCodexExecCompatible.
|
|
19
|
+
let codexExecCompatible = false;
|
|
20
|
+
let codexExecProbeOverride;
|
|
21
|
+
const CODEX_EXECUTABLE_FALLBACK_DIRS = [
|
|
22
|
+
"/opt/homebrew/bin",
|
|
23
|
+
"/usr/local/bin",
|
|
24
|
+
];
|
|
25
|
+
/** Minimal schema for the model-availability probe. */
|
|
26
|
+
const CODEX_MODEL_PROBE_SCHEMA = {
|
|
27
|
+
type: "object",
|
|
28
|
+
additionalProperties: false,
|
|
29
|
+
required: ["ok"],
|
|
30
|
+
properties: { ok: { type: "boolean" } },
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Does this model actually run under our isolated CODEX_HOME? A tiny real
|
|
34
|
+
* `codex exec` — true on a clean structured response, false when Codex refuses
|
|
35
|
+
* the model. Any other failure (auth, network, timeout) throws: it is not about
|
|
36
|
+
* the model, so trying the next one would only hide it. Injected into
|
|
37
|
+
* resolveCodexModel so the pick is verified rather than guessed.
|
|
38
|
+
*/
|
|
39
|
+
async function probeCodexModel(model) {
|
|
40
|
+
try {
|
|
41
|
+
await runCodexCliJson({
|
|
42
|
+
prompt: "User: ping.\n\nAssistant: Ready.\nReturn JSON {\"ok\": true} and nothing else.",
|
|
43
|
+
schema: CODEX_MODEL_PROBE_SCHEMA,
|
|
44
|
+
model,
|
|
45
|
+
timeoutMs: 60_000,
|
|
46
|
+
});
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
if (error instanceof CodexModelRejectedError) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
throw error;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The models this account can use, from `codex debug models`. Signed in, Codex
|
|
58
|
+
* refreshes the list from OpenAI (well under a second; no model call, no
|
|
59
|
+
* content), so a retired model is already gone from it. Injected into
|
|
60
|
+
* resolveCodexModel.
|
|
61
|
+
*/
|
|
62
|
+
async function listCodexCatalog() {
|
|
63
|
+
const { stdout } = await runCodexCommand(["debug", "models"], {
|
|
64
|
+
cwd: ensureRuntimeTempDir(),
|
|
65
|
+
timeoutMs: 30_000,
|
|
66
|
+
});
|
|
67
|
+
const models = JSON.parse(stdout).models;
|
|
68
|
+
if (!Array.isArray(models)) {
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
return models.filter((model) => typeof model === "object" &&
|
|
72
|
+
model !== null &&
|
|
73
|
+
typeof model.slug === "string");
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* `codex exec` options `runCodexCliJson` depends on. A `codex` whose
|
|
77
|
+
* `exec --help` does not advertise EVERY one of these is too old to run our
|
|
78
|
+
* contract — most importantly `--output-schema`, which Codex added after 0.39.
|
|
79
|
+
* We reject such a CLI BEFORE piping any captured conversation to it (mirrors
|
|
80
|
+
* the Claude runner's REQUIRED_CLAUDE_FLAGS pre-send probe).
|
|
81
|
+
*/
|
|
82
|
+
const REQUIRED_CODEX_EXEC_FLAGS = [
|
|
83
|
+
"--output-schema",
|
|
84
|
+
"--output-last-message",
|
|
85
|
+
];
|
|
86
|
+
/**
|
|
87
|
+
* Test seam: replace the spawn-based `exec --help` probe so callers can unit-
|
|
88
|
+
* test the "reject before sending content" behavior without spawning codex.
|
|
89
|
+
* Returns null when compatible, else a leak-free reason. Resets the success
|
|
90
|
+
* cache so the next call re-probes through the override.
|
|
91
|
+
*/
|
|
92
|
+
export function setCodexExecProbeForTests(fn) {
|
|
93
|
+
codexExecProbeOverride = fn;
|
|
94
|
+
codexExecCompatible = false;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Throw (with an actionable, leak-free message) when the `codex` CLI cannot run
|
|
98
|
+
* our `exec` contract, BEFORE any captured conversation is sent. Caches only
|
|
99
|
+
* success: a too-old CLI re-probes each call so an in-place upgrade is picked up
|
|
100
|
+
* without a daemon restart, and a transient `--help` hiccup does not freeze the
|
|
101
|
+
* daemon at "incompatible". A spawn/ENOENT from `--help` (binary missing)
|
|
102
|
+
* propagates as-is so it keeps its own `binary` classification.
|
|
103
|
+
*/
|
|
104
|
+
async function ensureCodexExecCompatible(cwd) {
|
|
105
|
+
if (codexExecCompatible)
|
|
106
|
+
return;
|
|
107
|
+
const reason = codexExecProbeOverride
|
|
108
|
+
? await codexExecProbeOverride(cwd)
|
|
109
|
+
: await probeCodexExecCompatibility(cwd);
|
|
110
|
+
if (reason !== null) {
|
|
111
|
+
throw new Error(reason);
|
|
112
|
+
}
|
|
113
|
+
codexExecCompatible = true;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Structural probe: `codex exec --help` must advertise every
|
|
117
|
+
* REQUIRED_CODEX_EXEC_FLAG. No model call, no content, no auth — bounded by a
|
|
118
|
+
* short timeout. Returns null when compatible, else a leak-free reason naming
|
|
119
|
+
* the missing option(s). A failure to even run `--help` (e.g. spawn ENOENT)
|
|
120
|
+
* propagates so a missing binary keeps its `binary` classification rather than
|
|
121
|
+
* being mislabelled "too old".
|
|
122
|
+
*/
|
|
123
|
+
async function probeCodexExecCompatibility(cwd) {
|
|
124
|
+
const { stdout: help } = await runCodexCommand(["exec", "--help"], {
|
|
125
|
+
cwd,
|
|
126
|
+
timeoutMs: 15_000,
|
|
127
|
+
});
|
|
128
|
+
const missing = REQUIRED_CODEX_EXEC_FLAGS.filter((flag) => !help.includes(flag));
|
|
129
|
+
if (missing.length === 0) {
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
// This message is recorded verbatim as the run's `preflight_error`, and
|
|
133
|
+
// status/doctor attribute a failure to a worker partly by scanning that text.
|
|
134
|
+
// So it must name ONLY Codex — mentioning `claude_code` here (even as a
|
|
135
|
+
// helpful "switch worker" hint) would make a too-old-Codex failure look like a
|
|
136
|
+
// Claude failure and send the user to fix the wrong tool. The "switch to the
|
|
137
|
+
// Claude worker" remedy belongs in the doctor/status next-action copy, which
|
|
138
|
+
// is derived from the error CLASS at display time, not parsed back out of this
|
|
139
|
+
// string.
|
|
140
|
+
return ("Codex CLI is too old for Onadit capture — `codex exec` is missing required " +
|
|
141
|
+
`option(s): ${missing.join(", ")}. Upgrade Codex (e.g. brew upgrade codex, ` +
|
|
142
|
+
"or reinstall); Onadit retries automatically on its next pass.");
|
|
143
|
+
}
|
|
144
|
+
/** One bounded retry on timeout/termination — see runCodexCliJson. */
|
|
145
|
+
const CODEX_TIMEOUT_RETRY_LIMIT = 1;
|
|
146
|
+
const CODEX_TIMEOUT_RETRY_BACKOFF_MS = 500;
|
|
147
|
+
/**
|
|
148
|
+
* Thrown ONLY when the runner's own timeout timer fires and kills the Codex
|
|
149
|
+
* CLI process (`code === null`, signal SIGTERM) — i.e. the "took too long"
|
|
150
|
+
* case. A signal termination we did NOT initiate (external SIGKILL, OOM,
|
|
151
|
+
* manual interrupt) is deliberately NOT this error; see `runCodexCommand`.
|
|
152
|
+
* Typed (and carrying `timeoutMs`/`signal`) so callers can apply a bounded
|
|
153
|
+
* retry to it specifically, and so the recorded message is diagnosable
|
|
154
|
+
* instead of the opaque "exit null".
|
|
155
|
+
*/
|
|
156
|
+
export class CodexCliTimeoutError extends Error {
|
|
157
|
+
timeoutMs;
|
|
158
|
+
signal;
|
|
159
|
+
constructor(timeoutMs, signal, detail = "") {
|
|
160
|
+
const signalPart = signal ? ` by ${signal}` : "";
|
|
161
|
+
super(`Codex CLI timed out after ${timeoutMs}ms (process terminated${signalPart})${detail}`);
|
|
162
|
+
this.name = "CodexCliTimeoutError";
|
|
163
|
+
this.timeoutMs = timeoutMs;
|
|
164
|
+
this.signal = signal;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Thrown when Codex exits refusing the pinned model — retired, or not on the
|
|
169
|
+
* account's plan ("The 'gpt-5.5' model is not supported when using Codex with
|
|
170
|
+
* a ChatGPT account."). Found in the FULL output before it is shortened, and
|
|
171
|
+
* named first in the message, so the recorded error always says it.
|
|
172
|
+
*/
|
|
173
|
+
export class CodexModelRejectedError extends Error {
|
|
174
|
+
model;
|
|
175
|
+
constructor(model, reason, exitCode) {
|
|
176
|
+
super(`Codex CLI failed (exit ${exitCode}) — Codex rejected the model "${model}": ${reason}`);
|
|
177
|
+
this.name = "CodexModelRejectedError";
|
|
178
|
+
this.model = model;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
/** At most this many model switches inside one call — see runCodexCliJson. */
|
|
182
|
+
const CODEX_MODEL_SWITCH_LIMIT = 3;
|
|
183
|
+
function delay(ms) {
|
|
184
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
185
|
+
}
|
|
186
|
+
export async function runCodexCliJson(options) {
|
|
187
|
+
const cwd = options.cwd ?? process.cwd();
|
|
188
|
+
// Verify the `codex` CLI can actually run our `exec` contract BEFORE piping
|
|
189
|
+
// any captured conversation to it. A CLI predating `--output-schema` (≤0.39)
|
|
190
|
+
// would otherwise receive the full prompt and only then exit 2. The probe
|
|
191
|
+
// uses `codex exec --help` only — no content, no model call, no auth — and is
|
|
192
|
+
// cached process-wide on success. Mirrors the Claude runner's pre-send probe.
|
|
193
|
+
await ensureCodexExecCompatible(cwd);
|
|
194
|
+
const exec = {
|
|
195
|
+
prompt: options.prompt,
|
|
196
|
+
cwd,
|
|
197
|
+
schemaPath: ensureSchemaFile(options.schema),
|
|
198
|
+
timeoutMs: options.timeoutMs ?? 120_000,
|
|
199
|
+
};
|
|
200
|
+
// An explicit model (the probe) is run as asked — never swapped.
|
|
201
|
+
if (options.model !== undefined) {
|
|
202
|
+
return runCodexExec(exec, options.model);
|
|
203
|
+
}
|
|
204
|
+
// Pin an explicit model on every run. Never inherit codex's implicit
|
|
205
|
+
// default — that default changes between releases and silently broke every
|
|
206
|
+
// preflight when 0.125.0 moved it to a ChatGPT-plan-rejected model.
|
|
207
|
+
let model = await resolveCodexModel(probeCodexModel, listCodexCatalog);
|
|
208
|
+
// When Codex refuses the model (OpenAI retired it, or the plan lost it),
|
|
209
|
+
// record the refusal, pick another model and run again, instead of failing
|
|
210
|
+
// every capture until someone edits config.json. Bounded: the configured,
|
|
211
|
+
// source and persisted models are tried unprobed, so each can be refused once
|
|
212
|
+
// before resolution reaches the probed catalog.
|
|
213
|
+
for (let switches = 0;; switches++) {
|
|
214
|
+
try {
|
|
215
|
+
return await runCodexExec(exec, model);
|
|
216
|
+
}
|
|
217
|
+
catch (error) {
|
|
218
|
+
if (!(error instanceof CodexModelRejectedError) ||
|
|
219
|
+
switches >= CODEX_MODEL_SWITCH_LIMIT) {
|
|
220
|
+
throw error;
|
|
221
|
+
}
|
|
222
|
+
markCodexModelRefused(model);
|
|
223
|
+
model = await resolveCodexModel(probeCodexModel, listCodexCatalog);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
async function runCodexExec(exec, model) {
|
|
228
|
+
// One bounded retry, and ONLY for timeout/termination (the old "exit null").
|
|
229
|
+
// Triage/preflight calls that get SIGTERM'd are overwhelmingly transient
|
|
230
|
+
// (cold start, brief contention), so a single retry recovers them inside the
|
|
231
|
+
// same run instead of deferring to the next hourly pass. We deliberately do
|
|
232
|
+
// NOT retry malformed JSON, empty output, spawn/ENOENT, or non-zero exits
|
|
233
|
+
// (auth/runtime/oversized) — those are not transient and retrying would only
|
|
234
|
+
// hide the real failure. (The ONE exception, handled a layer down in
|
|
235
|
+
// runCodexCommand: a spawn/ENOENT from a cached binary path that a `brew
|
|
236
|
+
// upgrade` invalidated mid-daemon gets a single re-resolve+retry. A
|
|
237
|
+
// genuinely-missing binary still ENOENTs on that retry and surfaces here
|
|
238
|
+
// unretried.) Raising the timeout is intentionally avoided: it raises cost
|
|
239
|
+
// and hang risk without addressing the transient-kill cause.
|
|
240
|
+
let lastTimeout = null;
|
|
241
|
+
for (let attempt = 0; attempt <= CODEX_TIMEOUT_RETRY_LIMIT; attempt++) {
|
|
242
|
+
const outputPath = path.join(ensureRuntimeTempDir(), `codex-cli-output-${process.pid}-${crypto.randomUUID()}.json`);
|
|
243
|
+
try {
|
|
244
|
+
const { stdout } = await runCodexCommand([
|
|
245
|
+
"exec",
|
|
246
|
+
"-",
|
|
247
|
+
"--sandbox",
|
|
248
|
+
"read-only",
|
|
249
|
+
"--color",
|
|
250
|
+
"never",
|
|
251
|
+
"--skip-git-repo-check",
|
|
252
|
+
"--model",
|
|
253
|
+
model,
|
|
254
|
+
"--output-schema",
|
|
255
|
+
exec.schemaPath,
|
|
256
|
+
"--output-last-message",
|
|
257
|
+
outputPath,
|
|
258
|
+
], {
|
|
259
|
+
cwd: exec.cwd,
|
|
260
|
+
timeoutMs: exec.timeoutMs,
|
|
261
|
+
stdinText: exec.prompt,
|
|
262
|
+
});
|
|
263
|
+
const raw = fs.existsSync(outputPath)
|
|
264
|
+
? fs.readFileSync(outputPath, "utf-8").trim()
|
|
265
|
+
: stdout.trim();
|
|
266
|
+
if (raw.length === 0) {
|
|
267
|
+
throw new Error("Codex CLI returned empty output");
|
|
268
|
+
}
|
|
269
|
+
try {
|
|
270
|
+
return {
|
|
271
|
+
output: JSON.parse(raw),
|
|
272
|
+
cliTag: await resolveCodexCliTag(exec.cwd),
|
|
273
|
+
model,
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
catch (error) {
|
|
277
|
+
throw new Error(`Codex CLI returned malformed JSON: ${raw.slice(0, 500)}`, { cause: error });
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
catch (error) {
|
|
281
|
+
if (error instanceof CodexCliTimeoutError &&
|
|
282
|
+
attempt < CODEX_TIMEOUT_RETRY_LIMIT) {
|
|
283
|
+
lastTimeout = error;
|
|
284
|
+
await delay(CODEX_TIMEOUT_RETRY_BACKOFF_MS);
|
|
285
|
+
continue;
|
|
286
|
+
}
|
|
287
|
+
throw error;
|
|
288
|
+
}
|
|
289
|
+
finally {
|
|
290
|
+
fs.rmSync(outputPath, { force: true });
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
// Unreachable: the loop either returns or throws on the final attempt.
|
|
294
|
+
throw lastTimeout ?? new Error("Codex CLI failed after retries");
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Cheap, synchronous "is the Codex CLI installed?" probe — resolves the
|
|
298
|
+
* `codex` executable on PATH (plus the Homebrew/usr-local fallbacks the
|
|
299
|
+
* runner already searches). Used to decide, per import, whether AI metadata
|
|
300
|
+
* extraction is available or whether to fall back to BasicMetadataExtractor.
|
|
301
|
+
* Detects install only, NOT auth — an installed-but-unauthenticated Codex
|
|
302
|
+
* still passes here and fails later at extraction time.
|
|
303
|
+
*/
|
|
304
|
+
export function isCodexCliAvailable() {
|
|
305
|
+
return resolveCodexExecutableForTests("codex") !== undefined;
|
|
306
|
+
}
|
|
307
|
+
export function resetCodexCliRunnerCacheForTests() {
|
|
308
|
+
SCHEMA_CACHE.clear();
|
|
309
|
+
codexVersionPromise = null;
|
|
310
|
+
codexLaunchSpec = null;
|
|
311
|
+
codexExecCompatible = false;
|
|
312
|
+
wrapperKeepsCodexHomeCache.clear();
|
|
313
|
+
resetCodexModelCacheForTests();
|
|
314
|
+
cleanupRuntimeTempArtifacts();
|
|
315
|
+
}
|
|
316
|
+
async function resolveCodexCliTag(cwd) {
|
|
317
|
+
if (codexVersionPromise === null) {
|
|
318
|
+
codexVersionPromise = runCodexCommand(["--version"], {
|
|
319
|
+
cwd,
|
|
320
|
+
timeoutMs: 15_000,
|
|
321
|
+
})
|
|
322
|
+
.then(({ stdout }) => stdout.trim() || "codex-cli")
|
|
323
|
+
.catch(() => "codex-cli");
|
|
324
|
+
}
|
|
325
|
+
return codexVersionPromise;
|
|
326
|
+
}
|
|
327
|
+
function ensureSchemaFile(schema) {
|
|
328
|
+
const json = JSON.stringify(schema);
|
|
329
|
+
const digest = crypto.createHash("sha256").update(json).digest("hex");
|
|
330
|
+
const cached = SCHEMA_CACHE.get(digest);
|
|
331
|
+
if (cached && fs.existsSync(cached)) {
|
|
332
|
+
return cached;
|
|
333
|
+
}
|
|
334
|
+
const schemaPath = path.join(ensureRuntimeTempDir(), `codex-cli-schema-${digest}.json`);
|
|
335
|
+
if (!fs.existsSync(schemaPath)) {
|
|
336
|
+
fs.writeFileSync(schemaPath, `${json}\n`, "utf-8");
|
|
337
|
+
}
|
|
338
|
+
SCHEMA_CACHE.set(digest, schemaPath);
|
|
339
|
+
return schemaPath;
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* A `spawn … ENOENT` means the resolved Codex binary is no longer at the
|
|
343
|
+
* cached path — almost always a `brew upgrade` deleting the version-stamped
|
|
344
|
+
* path a long-running daemon memoized before the upgrade. Clearing the
|
|
345
|
+
* launch-spec cache and re-resolving picks up the new binary (via the stable
|
|
346
|
+
* symlink), so a single retry recovers in-process without a daemon restart.
|
|
347
|
+
*/
|
|
348
|
+
function isCodexBinaryMissingError(error) {
|
|
349
|
+
return (error instanceof Error && /failed to start:.*\bENOENT\b/.test(error.message));
|
|
350
|
+
}
|
|
351
|
+
async function runCodexCommand(args, options) {
|
|
352
|
+
try {
|
|
353
|
+
return await runCodexCommandOnce(args, options);
|
|
354
|
+
}
|
|
355
|
+
catch (error) {
|
|
356
|
+
if (!isCodexBinaryMissingError(error)) {
|
|
357
|
+
throw error;
|
|
358
|
+
}
|
|
359
|
+
// Force re-resolution of the binary path, then retry exactly once.
|
|
360
|
+
codexLaunchSpec = null;
|
|
361
|
+
return runCodexCommandOnce(args, options);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
async function runCodexCommandOnce(args, options) {
|
|
365
|
+
return new Promise((resolve, reject) => {
|
|
366
|
+
let stdinError = null;
|
|
367
|
+
let stdout = "";
|
|
368
|
+
let stderr = "";
|
|
369
|
+
// We own the timeout here rather than via spawn's `timeout` option so we
|
|
370
|
+
// can tell a timeout-kill apart from any OTHER signal termination — an
|
|
371
|
+
// external SIGKILL, an OOM kill, or a manual interrupt. Only the timeout
|
|
372
|
+
// path is retryable upstream; misclassifying an external kill as a timeout
|
|
373
|
+
// would retry a non-transient failure and bury its real cause. spawn's own
|
|
374
|
+
// `timeout` would kill the child from libuv WITHOUT flipping this flag, so
|
|
375
|
+
// it is deliberately not used.
|
|
376
|
+
let timedOut = false;
|
|
377
|
+
let child;
|
|
378
|
+
try {
|
|
379
|
+
child = spawnCodexProcess(args, {
|
|
380
|
+
cwd: options.cwd,
|
|
381
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
382
|
+
env: codexCliEnv(),
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
catch (error) {
|
|
386
|
+
reject(error);
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
const timer = setTimeout(() => {
|
|
390
|
+
timedOut = true;
|
|
391
|
+
child.kill("SIGTERM");
|
|
392
|
+
}, options.timeoutMs);
|
|
393
|
+
timer.unref?.();
|
|
394
|
+
child.on("error", (error) => {
|
|
395
|
+
clearTimeout(timer);
|
|
396
|
+
reject(new Error(`Codex CLI failed to start: ${error.message}`));
|
|
397
|
+
});
|
|
398
|
+
child.stdout?.setEncoding("utf-8");
|
|
399
|
+
child.stdout?.on("data", (chunk) => {
|
|
400
|
+
stdout += chunk;
|
|
401
|
+
});
|
|
402
|
+
child.stderr?.setEncoding("utf-8");
|
|
403
|
+
child.stderr?.on("data", (chunk) => {
|
|
404
|
+
stderr += chunk;
|
|
405
|
+
});
|
|
406
|
+
if (child.stdin) {
|
|
407
|
+
child.stdin.on("error", (error) => {
|
|
408
|
+
stdinError = error;
|
|
409
|
+
});
|
|
410
|
+
child.stdin.end(options.stdinText ?? "");
|
|
411
|
+
}
|
|
412
|
+
child.on("close", (code, signal) => {
|
|
413
|
+
clearTimeout(timer);
|
|
414
|
+
const summary = summarizeCodexOutput(stderr, stdout);
|
|
415
|
+
const detail = summary ? ` — ${summary}` : "";
|
|
416
|
+
if (code === null) {
|
|
417
|
+
// exit null = terminated by a signal, not a clean exit. If OUR timeout
|
|
418
|
+
// fired, it's the transient "took too long" case — typed + retryable,
|
|
419
|
+
// recorded as "timed out after Xms by SIGTERM" instead of the opaque
|
|
420
|
+
// "exit null". Any OTHER signal termination (external kill, OOM, manual
|
|
421
|
+
// interrupt) is NOT a timeout: surface it as-is so it is never retried.
|
|
422
|
+
if (timedOut) {
|
|
423
|
+
reject(new CodexCliTimeoutError(options.timeoutMs, signal, detail));
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
reject(new Error(`Codex CLI was terminated by ${signal ?? "an unknown signal"} (not a timeout)${detail}`));
|
|
427
|
+
return;
|
|
428
|
+
}
|
|
429
|
+
if (code !== 0) {
|
|
430
|
+
// Look for a model refusal in the FULL output, before it is shortened:
|
|
431
|
+
// a burst of reconnect errors can push it out of the summary. Only a
|
|
432
|
+
// Codex ERROR line naming the pinned model counts, and not one that is
|
|
433
|
+
// part of the prompt Codex echoes back (a triaged conversation can
|
|
434
|
+
// quote an old refusal).
|
|
435
|
+
const model = pinnedModelArg(args);
|
|
436
|
+
const rejection = model
|
|
437
|
+
? findCodexModelRejection(`${stderr}\n${stdout}`, model, options.stdinText ?? "")
|
|
438
|
+
: null;
|
|
439
|
+
if (model && rejection) {
|
|
440
|
+
reject(new CodexModelRejectedError(model, rejection, code));
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
reject(new Error(`Codex CLI failed (exit ${code})${summary
|
|
444
|
+
? ` — ${summary}`
|
|
445
|
+
: stdinError
|
|
446
|
+
? ` — stdin: ${stdinError.message}`
|
|
447
|
+
: ""}`));
|
|
448
|
+
return;
|
|
449
|
+
}
|
|
450
|
+
if (stdinError && !isIgnorableStdinError(stdinError)) {
|
|
451
|
+
reject(new Error(`Codex CLI stdin failed: ${stdinError.message}`));
|
|
452
|
+
return;
|
|
453
|
+
}
|
|
454
|
+
resolve({ stdout, stderr });
|
|
455
|
+
});
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
/** Cap on the diagnostic summary written into preflight_error / thrown errors. */
|
|
459
|
+
const CODEX_OUTPUT_SUMMARY_MAX = 2000;
|
|
460
|
+
/**
|
|
461
|
+
* Summarise codex output for diagnosis. The old first-500-chars slice captured
|
|
462
|
+
* only the startup banner and hid the actual cause, which lands at the END of
|
|
463
|
+
* the stream (the failing model name, the exit reason). Instead keep the
|
|
464
|
+
* salient `ERROR` lines plus the tail. Short outputs are returned whole.
|
|
465
|
+
*/
|
|
466
|
+
export function summarizeCodexOutput(stderr, stdout) {
|
|
467
|
+
const raw = (stderr.trim() || stdout.trim()).trim();
|
|
468
|
+
if (raw.length <= CODEX_OUTPUT_SUMMARY_MAX) {
|
|
469
|
+
return raw;
|
|
470
|
+
}
|
|
471
|
+
const errorLines = raw
|
|
472
|
+
.split(/\r?\n/)
|
|
473
|
+
.filter((line) => line.includes("ERROR"))
|
|
474
|
+
.slice(-8)
|
|
475
|
+
.join("\n");
|
|
476
|
+
const tail = raw.slice(-1200);
|
|
477
|
+
const combined = errorLines ? `${errorLines}\n…\n${tail}` : `…${tail}`;
|
|
478
|
+
return combined.length <= CODEX_OUTPUT_SUMMARY_MAX
|
|
479
|
+
? combined
|
|
480
|
+
: `…${combined.slice(-CODEX_OUTPUT_SUMMARY_MAX)}`;
|
|
481
|
+
}
|
|
482
|
+
/** The value after `--model` in a codex argv, if any. */
|
|
483
|
+
function pinnedModelArg(args) {
|
|
484
|
+
const index = args.indexOf("--model");
|
|
485
|
+
return index >= 0 ? args[index + 1] : undefined;
|
|
486
|
+
}
|
|
487
|
+
function isIgnorableStdinError(error) {
|
|
488
|
+
return ("code" in error &&
|
|
489
|
+
(error.code === "EPIPE" ||
|
|
490
|
+
error.code === "ECONNRESET" ||
|
|
491
|
+
error.code === "ERR_STREAM_DESTROYED"));
|
|
492
|
+
}
|
|
493
|
+
function spawnCodexProcess(args, options) {
|
|
494
|
+
const launchSpec = resolveCodexLaunchSpec();
|
|
495
|
+
const launchArgs = [...launchSpec.prefixArgs, ...args];
|
|
496
|
+
try {
|
|
497
|
+
return spawn(launchSpec.command, launchArgs, {
|
|
498
|
+
cwd: options.cwd,
|
|
499
|
+
stdio: options.stdio,
|
|
500
|
+
env: options.env,
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
catch (error) {
|
|
504
|
+
if (!(error instanceof Error) ||
|
|
505
|
+
!error.message.includes("EBADF")) {
|
|
506
|
+
throw new Error(`Codex CLI failed to spawn (${formatLaunch(launchSpec.command, launchArgs)}): ${error instanceof Error ? error.message : String(error)}`);
|
|
507
|
+
}
|
|
508
|
+
const shellCommand = [launchSpec.command, ...launchArgs]
|
|
509
|
+
.map(quotePosixArg)
|
|
510
|
+
.join(" ");
|
|
511
|
+
try {
|
|
512
|
+
return spawn("/bin/sh", ["-lc", shellCommand], {
|
|
513
|
+
cwd: options.cwd,
|
|
514
|
+
stdio: options.stdio,
|
|
515
|
+
env: options.env,
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
catch (shellError) {
|
|
519
|
+
throw new Error(`Codex CLI failed to spawn directly and via shell (${formatLaunch(launchSpec.command, launchArgs)}): ${shellError instanceof Error ? shellError.message : String(shellError)}`);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
function formatLaunch(command, args) {
|
|
524
|
+
return [command, ...args].map(quotePosixArg).join(" ");
|
|
525
|
+
}
|
|
526
|
+
function quotePosixArg(value) {
|
|
527
|
+
if (value.length === 0)
|
|
528
|
+
return "''";
|
|
529
|
+
return `'${value.replace(/'/g, `'\"'\"'`)}'`;
|
|
530
|
+
}
|
|
531
|
+
function codexCliEnv() {
|
|
532
|
+
return {
|
|
533
|
+
...process.env,
|
|
534
|
+
CODEX_HOME: ensureIsolatedCodexHome(),
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
function resolveCodexLaunchSpec() {
|
|
538
|
+
if (codexLaunchSpec !== null) {
|
|
539
|
+
return codexLaunchSpec;
|
|
540
|
+
}
|
|
541
|
+
const executable = resolveCodexExecutableForTests("codex");
|
|
542
|
+
const stableLaunchPath = executable ?? "codex";
|
|
543
|
+
// Resolve the symlink target ONLY to *detect* a `.js` shim (an npm-style
|
|
544
|
+
// install whose bin entry points at JS we must run under node). We then
|
|
545
|
+
// launch via the STABLE path we found on PATH — e.g. the Homebrew symlink
|
|
546
|
+
// /opt/homebrew/bin/codex — NOT the realpath, for BOTH the binary and the
|
|
547
|
+
// `.js` case. Following the symlink to a version-stamped path (a Caskroom
|
|
548
|
+
// …/codex/0.125.0/… binary, or a versioned …/cli.js a global JS manager
|
|
549
|
+
// rotates) pins a location that an upgrade deletes out from under a
|
|
550
|
+
// long-running daemon, producing `spawn … ENOENT` on every probe until
|
|
551
|
+
// restart. The stable path survives upgrades because the package manager
|
|
552
|
+
// just repoints the symlink; node happily runs the script the symlink
|
|
553
|
+
// resolves to at spawn time.
|
|
554
|
+
const realExecutable = executable ? fs.realpathSync(executable) : "codex";
|
|
555
|
+
codexLaunchSpec = realExecutable.endsWith(".js")
|
|
556
|
+
? { command: process.execPath, prefixArgs: [stableLaunchPath] }
|
|
557
|
+
: { command: stableLaunchPath, prefixArgs: [] };
|
|
558
|
+
return codexLaunchSpec;
|
|
559
|
+
}
|
|
560
|
+
export function resolveCodexExecutableForTests(name, pathEnv = process.env["PATH"], fallbackDirs = CODEX_EXECUTABLE_FALLBACK_DIRS, keepsCodexHome = wrapperKeepsCodexHome) {
|
|
561
|
+
const searchDirs = [
|
|
562
|
+
...(pathEnv ? pathEnv.split(path.delimiter) : []),
|
|
563
|
+
...fallbackDirs,
|
|
564
|
+
];
|
|
565
|
+
const candidates = searchDirs
|
|
566
|
+
.filter((dir) => dir.length > 0)
|
|
567
|
+
.map((dir) => path.join(dir, name))
|
|
568
|
+
.filter((candidate) => fs.existsSync(candidate));
|
|
569
|
+
const hasRealBinary = candidates.some((candidate) => !isShellScriptWrapper(candidate));
|
|
570
|
+
for (const candidate of candidates) {
|
|
571
|
+
// A shell-script wrapper (account routing, proxy settings, a version
|
|
572
|
+
// manager) is used as before, unless it replaces the CODEX_HOME we set and
|
|
573
|
+
// a real binary is there to use instead. A wrapper that replaces it makes
|
|
574
|
+
// triage run with the user's MCP servers and hooks (their noise buried
|
|
575
|
+
// the real error on 2026-10-14) and saves every triage call in the user's
|
|
576
|
+
// Codex history, where the next capture picks it up as a conversation.
|
|
577
|
+
if (!isShellScriptWrapper(candidate) ||
|
|
578
|
+
!hasRealBinary ||
|
|
579
|
+
keepsCodexHome(candidate)) {
|
|
580
|
+
return candidate;
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
return candidates[0];
|
|
584
|
+
}
|
|
585
|
+
const wrapperKeepsCodexHomeCache = new Map();
|
|
586
|
+
/**
|
|
587
|
+
* Does this wrapper leave our CODEX_HOME alone? Run `login status` with an
|
|
588
|
+
* empty CODEX_HOME: Codex itself, or a wrapper that passes it through, answers
|
|
589
|
+
* "Not logged in"; a wrapper that swaps in the user's own home answers "Logged
|
|
590
|
+
* in using …". Reads a file, no network, a few milliseconds. When the answer is
|
|
591
|
+
* unclear the wrapper is kept, as before this check existed. Cached per path.
|
|
592
|
+
*/
|
|
593
|
+
function wrapperKeepsCodexHome(wrapper) {
|
|
594
|
+
const cached = wrapperKeepsCodexHomeCache.get(wrapper);
|
|
595
|
+
if (cached !== undefined)
|
|
596
|
+
return cached;
|
|
597
|
+
let keeps = true;
|
|
598
|
+
let emptyHome;
|
|
599
|
+
try {
|
|
600
|
+
emptyHome = fs.mkdtempSync(path.join(ensureRuntimeTempDir(), "codex-home-check-"));
|
|
601
|
+
const result = spawnSync(wrapper, ["login", "status"], {
|
|
602
|
+
env: { ...process.env, CODEX_HOME: emptyHome },
|
|
603
|
+
encoding: "utf-8",
|
|
604
|
+
timeout: 10_000,
|
|
605
|
+
});
|
|
606
|
+
if (!result.error) {
|
|
607
|
+
keeps = !/logged in using/i.test(`${result.stdout ?? ""}\n${result.stderr ?? ""}`);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
catch {
|
|
611
|
+
// Keep the wrapper.
|
|
612
|
+
}
|
|
613
|
+
finally {
|
|
614
|
+
if (emptyHome)
|
|
615
|
+
fs.rmSync(emptyHome, { recursive: true, force: true });
|
|
616
|
+
}
|
|
617
|
+
wrapperKeepsCodexHomeCache.set(wrapper, keeps);
|
|
618
|
+
return keeps;
|
|
619
|
+
}
|
|
620
|
+
/**
|
|
621
|
+
* A `codex` that is a shell script (`#!/bin/sh`, `#!/usr/bin/env bash`, …) is a
|
|
622
|
+
* wrapper around Codex, not Codex. A node `.js` entry point is not a shell
|
|
623
|
+
* script.
|
|
624
|
+
*/
|
|
625
|
+
function isShellScriptWrapper(file) {
|
|
626
|
+
let fd;
|
|
627
|
+
try {
|
|
628
|
+
fd = fs.openSync(file, "r");
|
|
629
|
+
const head = Buffer.alloc(128);
|
|
630
|
+
const bytesRead = fs.readSync(fd, head, 0, head.length, 0);
|
|
631
|
+
const firstLine = head.subarray(0, bytesRead).toString("utf-8").split("\n")[0] ?? "";
|
|
632
|
+
if (!firstLine.startsWith("#!"))
|
|
633
|
+
return false;
|
|
634
|
+
// `#!/bin/sh` → sh; `#!/usr/bin/env -S bash -e` → bash; `#!/usr/bin/env node` → node.
|
|
635
|
+
const [command = "", ...rest] = firstLine.slice(2).trim().split(/\s+/);
|
|
636
|
+
const interpreter = path.basename(command) === "env"
|
|
637
|
+
? (rest.find((arg) => !arg.startsWith("-")) ?? "")
|
|
638
|
+
: path.basename(command);
|
|
639
|
+
return /^(sh|bash|zsh|dash|ksh)$/.test(path.basename(interpreter));
|
|
640
|
+
}
|
|
641
|
+
catch {
|
|
642
|
+
return false;
|
|
643
|
+
}
|
|
644
|
+
finally {
|
|
645
|
+
if (fd !== undefined)
|
|
646
|
+
fs.closeSync(fd);
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* Path to a private CODEX_HOME holding ONLY a copy of the operator's
|
|
651
|
+
* `auth.json` — so triage runs with the user's login but none of their
|
|
652
|
+
* config.toml / MCP / project state.
|
|
653
|
+
*
|
|
654
|
+
* The snapshot is REFRESHED when the source `~/.codex/auth.json` changes. The
|
|
655
|
+
* daemon runs capture in-process for its whole lifetime (a setInterval loop),
|
|
656
|
+
* so a one-time copy would pin whatever token was current at boot: a later
|
|
657
|
+
* host-side `codex login` (which rewrites the source with a rotated refresh
|
|
658
|
+
* token) would never reach the snapshot and every triage would 401 until a
|
|
659
|
+
* daemon restart. We compare the SOURCE file's mtime — not the temp copy's,
|
|
660
|
+
* which codex advances in place when it refreshes the access token — so a real
|
|
661
|
+
* re-login is picked up on the next capture while routine in-temp refreshes are
|
|
662
|
+
* ignored. The refreshed token is NEVER copied back to `~/.codex`: that would
|
|
663
|
+
* race a concurrent user `codex login`.
|
|
664
|
+
*/
|
|
665
|
+
function ensureIsolatedCodexHome() {
|
|
666
|
+
const sourceHome = resolveSourceCodexHome();
|
|
667
|
+
const authPath = path.join(sourceHome, "auth.json");
|
|
668
|
+
const sourceMtimeMs = statMtimeMsOrNull(authPath);
|
|
669
|
+
const existingHome = isolatedCodexHomePath !== null && fs.existsSync(isolatedCodexHomePath)
|
|
670
|
+
? isolatedCodexHomePath
|
|
671
|
+
: null;
|
|
672
|
+
if (existingHome !== null && sourceMtimeMs === isolatedCodexAuthSourceMtimeMs) {
|
|
673
|
+
return existingHome;
|
|
674
|
+
}
|
|
675
|
+
const isolatedHome = existingHome ??
|
|
676
|
+
fs.mkdtempSync(path.join(ensureRuntimeTempDir(), "codex-cli-backfill-home-"));
|
|
677
|
+
if (fs.existsSync(authPath)) {
|
|
678
|
+
fs.copyFileSync(authPath, path.join(isolatedHome, "auth.json"));
|
|
679
|
+
isolatedCodexAuthSourceMtimeMs = sourceMtimeMs;
|
|
680
|
+
}
|
|
681
|
+
else {
|
|
682
|
+
// No source auth to copy. We deliberately KEEP any existing snapshot rather
|
|
683
|
+
// than delete it: a host `codex login` rewrites auth.json via atomic temp +
|
|
684
|
+
// rename, so a stat that lands mid-rename can momentarily see no file —
|
|
685
|
+
// deleting on that transient absence would nuke a perfectly good token and
|
|
686
|
+
// 401 the next run, the exact failure this whole mechanism exists to avoid.
|
|
687
|
+
// Known, accepted trade-off: a DELIBERATE `codex logout` (a lasting absence,
|
|
688
|
+
// not a transient one) won't propagate — Onadit keeps using the copied token
|
|
689
|
+
// until the server rejects it (handled by the auth preflight class) or the
|
|
690
|
+
// daemon restarts. Record null so a later reappearance re-copies.
|
|
691
|
+
isolatedCodexAuthSourceMtimeMs = null;
|
|
692
|
+
}
|
|
693
|
+
isolatedCodexHomePath = isolatedHome;
|
|
694
|
+
return isolatedHome;
|
|
695
|
+
}
|
|
696
|
+
function statMtimeMsOrNull(filePath) {
|
|
697
|
+
try {
|
|
698
|
+
return fs.statSync(filePath).mtimeMs;
|
|
699
|
+
}
|
|
700
|
+
catch {
|
|
701
|
+
return null;
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
function resolveSourceCodexHome() {
|
|
705
|
+
if (typeof process.env["CODEX_HOME"] === "string") {
|
|
706
|
+
return process.env["CODEX_HOME"];
|
|
707
|
+
}
|
|
708
|
+
return path.join(os.homedir(), ".codex");
|
|
709
|
+
}
|
|
710
|
+
function ensureRuntimeTempDir() {
|
|
711
|
+
if (runtimeTempDirPath && fs.existsSync(runtimeTempDirPath)) {
|
|
712
|
+
return runtimeTempDirPath;
|
|
713
|
+
}
|
|
714
|
+
const runtimeTempDir = fs.mkdtempSync(path.join(resolveWritableTempRoot(), "codex-cli-runner-"));
|
|
715
|
+
runtimeTempDirPath = runtimeTempDir;
|
|
716
|
+
if (!runtimeCleanupRegistered) {
|
|
717
|
+
runtimeCleanupRegistered = true;
|
|
718
|
+
process.once("exit", cleanupRuntimeTempArtifacts);
|
|
719
|
+
}
|
|
720
|
+
return runtimeTempDir;
|
|
721
|
+
}
|
|
722
|
+
function resolveWritableTempRoot() {
|
|
723
|
+
for (const candidate of [os.tmpdir(), "/tmp"]) {
|
|
724
|
+
if (!candidate || !fs.existsSync(candidate)) {
|
|
725
|
+
continue;
|
|
726
|
+
}
|
|
727
|
+
try {
|
|
728
|
+
fs.accessSync(candidate, fs.constants.R_OK | fs.constants.W_OK);
|
|
729
|
+
return candidate;
|
|
730
|
+
}
|
|
731
|
+
catch {
|
|
732
|
+
continue;
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
throw new Error(`No writable temp directory available for Codex CLI runtime (TMPDIR=${process.env["TMPDIR"] ?? "<unset>"})`);
|
|
736
|
+
}
|
|
737
|
+
function cleanupRuntimeTempArtifacts() {
|
|
738
|
+
if (runtimeTempDirPath) {
|
|
739
|
+
fs.rmSync(runtimeTempDirPath, { recursive: true, force: true });
|
|
740
|
+
runtimeTempDirPath = null;
|
|
741
|
+
}
|
|
742
|
+
isolatedCodexHomePath = null;
|
|
743
|
+
isolatedCodexAuthSourceMtimeMs = null;
|
|
744
|
+
}
|
|
745
|
+
//# sourceMappingURL=codex-cli-runner.js.map
|