onadit 0.0.1 → 0.1.0-beta.45
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 +556 -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 +708 -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 +33 -0
- package/dist/src/diagnostics/codex-preflight.d.ts.map +1 -0
- package/dist/src/diagnostics/codex-preflight.js +99 -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 +71 -0
- package/dist/src/observability/version-check.d.ts.map +1 -0
- package/dist/src/observability/version-check.js +198 -0
- package/dist/src/observability/version-check.js.map +1 -0
- package/dist/src/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 +61 -0
- package/dist/src/providers/codex-cli-model.d.ts.map +1 -0
- package/dist/src/providers/codex-cli-model.js +194 -0
- package/dist/src/providers/codex-cli-model.js.map +1 -0
- package/dist/src/providers/codex-cli-runner.d.ts +60 -0
- package/dist/src/providers/codex-cli-runner.d.ts.map +1 -0
- package/dist/src/providers/codex-cli-runner.js +584 -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 +1473 -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 +474 -0
- package/dist/src/server/routes/friend-status.d.ts.map +1 -0
- package/dist/src/server/routes/friend-status.js +671 -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,918 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Surgical TOML writer for `~/.codex/config.toml`.
|
|
3
|
+
*
|
|
4
|
+
* Codex stores MCP servers as `[mcp_servers.<name>]` table sections.
|
|
5
|
+
* We don't depend on a TOML parser — the only edit Onadit makes is at
|
|
6
|
+
* the section-table level, so a line-based scan is enough and avoids
|
|
7
|
+
* round-tripping comments/blank lines/quoted strings the friend may
|
|
8
|
+
* have hand-written elsewhere in the file.
|
|
9
|
+
*
|
|
10
|
+
* Contract matches the JSON writer:
|
|
11
|
+
* - Atomic (tmp + rename).
|
|
12
|
+
* - Backup `<file>.bak.<iso-no-colons>` if file existed; surface only ID.
|
|
13
|
+
* - Drop every `[mcp_servers.<legacy>]` section (bare or quoted, any
|
|
14
|
+
* supported spacing, case-insensitive on the legacy server name).
|
|
15
|
+
* - Replace any existing `[mcp_servers.onadit]` section, keeping the
|
|
16
|
+
* user's policy for it (`enabled`, tool allow/deny lists, timeouts,
|
|
17
|
+
* `[mcp_servers.onadit.tools.*]` approval tables). Only the executable
|
|
18
|
+
* part (command, args) is Onadit's; env and unknown keys are still dropped.
|
|
19
|
+
* - Treat `[mcp_servers.rift]`, the server's name before the product was
|
|
20
|
+
* renamed, as that same entry: its policy moves to the new section with
|
|
21
|
+
* the tool names it lists renamed, and the old section is removed.
|
|
22
|
+
* - Stop, with the file untouched, wherever the entry cannot be carried
|
|
23
|
+
* across exactly: the server written as an inline table or with dotted
|
|
24
|
+
* keys instead of its own table (adding a table would create a second,
|
|
25
|
+
* unrestricted entry), tool names spelled with escape sequences (a
|
|
26
|
+
* text-level rename would miss them and a deny list would stop
|
|
27
|
+
* matching), and, on a refresh, arguments it cannot read (the config
|
|
28
|
+
* path must not be replaced by a guess).
|
|
29
|
+
* - Preserve the rest of the file verbatim (preamble + other tables).
|
|
30
|
+
* - Refuse to overwrite if any bracketed line is structurally
|
|
31
|
+
* malformed: take a reference backup, throw `ParseFailedError`,
|
|
32
|
+
* do not touch the file.
|
|
33
|
+
* - On a write rollback (rename failure post-backup), restore the
|
|
34
|
+
* backup contents in place.
|
|
35
|
+
*/
|
|
36
|
+
import fs from "node:fs";
|
|
37
|
+
import path from "node:path";
|
|
38
|
+
import { ParseFailedError } from "./errors.js";
|
|
39
|
+
import { isLegacyServerName, redactForbidden } from "./redact.js";
|
|
40
|
+
import { PREVIOUS_MCP_ENTRY_FILE, PREVIOUS_SERVER_NAME, SERVER_NAME, isMcpEntryFile, renamePreviousToolNames, } from "../../mcp/names.js";
|
|
41
|
+
const SECTION_RE = /^\s*\[\s*([^\]]+?)\s*\]\s*(?:#.*)?$/;
|
|
42
|
+
const ARRAY_TABLE_RE = /^\s*\[\[\s*([^\]]+?)\s*\]\]\s*(?:#.*)?$/;
|
|
43
|
+
const LEADING_BRACKET_RE = /^\s*\[/;
|
|
44
|
+
const MCP_SERVERS = "mcp_servers";
|
|
45
|
+
/**
|
|
46
|
+
* Keys under `[mcp_servers.onadit]` that express the user's policy rather than
|
|
47
|
+
* how to launch or authenticate the server. A reinstall must not re-enable a
|
|
48
|
+
* disabled server, widen its tool list or drop an approval requirement.
|
|
49
|
+
*
|
|
50
|
+
* Taken from Codex's RawMcpServerConfig (codex-cli 0.154). The other fields —
|
|
51
|
+
* command, args, env, env_vars, cwd, url, http_headers, env_http_headers,
|
|
52
|
+
* bearer_token(_env_var), http_headers_helper, auth, oauth, oauth_resource,
|
|
53
|
+
* scopes, environment_id, name — are launch, transport or credentials: Onadit
|
|
54
|
+
* rebuilds command/args and drops the rest so no stale secret survives.
|
|
55
|
+
*/
|
|
56
|
+
const RIFT_POLICY_KEYS = new Set([
|
|
57
|
+
"enabled",
|
|
58
|
+
"required",
|
|
59
|
+
"enabled_tools",
|
|
60
|
+
"disabled_tools",
|
|
61
|
+
"default_tools_approval_mode",
|
|
62
|
+
"tools",
|
|
63
|
+
"startup_timeout_sec",
|
|
64
|
+
"startup_timeout_ms",
|
|
65
|
+
"tool_timeout_sec",
|
|
66
|
+
"supports_parallel_tool_calls",
|
|
67
|
+
"omit_tools_from",
|
|
68
|
+
]);
|
|
69
|
+
/** Policy keys whose value, or whose sub-keys, name tools. */
|
|
70
|
+
const TOOL_NAMING_KEYS = new Set(["enabled_tools", "disabled_tools", "tools"]);
|
|
71
|
+
class MalformedTomlError extends Error {
|
|
72
|
+
constructor(message) {
|
|
73
|
+
super(message);
|
|
74
|
+
this.name = "MalformedTomlError";
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
export function writeCodexTomlConfig(opts) {
|
|
78
|
+
const absolute = path.resolve(opts.configPath);
|
|
79
|
+
const preexisting = fs.existsSync(absolute);
|
|
80
|
+
const now = opts.now ?? defaultNow;
|
|
81
|
+
const raw = preexisting ? fs.readFileSync(absolute, "utf8") : "";
|
|
82
|
+
// Which of this server's entries are rebuilt and which are left in place.
|
|
83
|
+
//
|
|
84
|
+
// A section under the earlier server name keeps that name unless the person
|
|
85
|
+
// asked for the move (`newNames`): its tools keep their ids, so every rule
|
|
86
|
+
// written against them, in settings this writer can see or not, keeps
|
|
87
|
+
// applying. It is only pointed at this install, at the entry file that
|
|
88
|
+
// serves the earlier names. A refresh (`existingOnly`) does the same for
|
|
89
|
+
// every entry of ours and nothing else.
|
|
90
|
+
//
|
|
91
|
+
// A rebuilt entry drops its parent section AND every descendant subtable
|
|
92
|
+
// (e.g. [mcp_servers.onadit.env]) so a stale env block — possibly carrying a
|
|
93
|
+
// Voyage key from an earlier hand-edit — can't survive. Same for every
|
|
94
|
+
// legacy-named server. Unrelated servers pass through verbatim. Any
|
|
95
|
+
// MalformedTomlError raised here flows through failParse so the friend's
|
|
96
|
+
// file is left untouched.
|
|
97
|
+
const removedLegacyNames = [];
|
|
98
|
+
const seenLegacy = new Set();
|
|
99
|
+
const current = emptyEntry();
|
|
100
|
+
const previous = emptyEntry();
|
|
101
|
+
const refresh = !!opts.existingOnly;
|
|
102
|
+
let keptSections;
|
|
103
|
+
let parsed;
|
|
104
|
+
let entry;
|
|
105
|
+
let hasCurrent;
|
|
106
|
+
let hasPrevious;
|
|
107
|
+
let rename;
|
|
108
|
+
try {
|
|
109
|
+
parsed = parseTomlSections(raw);
|
|
110
|
+
// The server defined without a table of its own. This writer only knows
|
|
111
|
+
// `[mcp_servers.<name>]`; appending one beside an inline or dotted
|
|
112
|
+
// definition would leave two entries, the new one with none of the
|
|
113
|
+
// person's restrictions.
|
|
114
|
+
if (definesOwnServerInline(parsed.preamble, [])) {
|
|
115
|
+
throw new MalformedTomlError("mcp_servers.<name> written with dotted keys is not supported");
|
|
116
|
+
}
|
|
117
|
+
const names = new Set(parsed.sections.filter((s) => s.keySegments[0] === MCP_SERVERS && s.keySegments.length >= 2).map((s) => s.keySegments[1]));
|
|
118
|
+
hasCurrent = names.has(SERVER_NAME);
|
|
119
|
+
hasPrevious = names.has(PREVIOUS_SERVER_NAME);
|
|
120
|
+
rename = !!opts.newNames && hasPrevious;
|
|
121
|
+
const earlierEntryFile = path.join(path.dirname(opts.spec.args[0]), PREVIOUS_MCP_ENTRY_FILE);
|
|
122
|
+
keptSections = [];
|
|
123
|
+
for (const section of parsed.sections) {
|
|
124
|
+
const segs = section.keySegments;
|
|
125
|
+
if (segs.length === 1 && segs[0] === MCP_SERVERS && definesOwnServerInline(section.bodyLines, segs)) {
|
|
126
|
+
throw new MalformedTomlError("mcp_servers.<name> written inline is not supported");
|
|
127
|
+
}
|
|
128
|
+
if (segs[0] === MCP_SERVERS && segs.length >= 2) {
|
|
129
|
+
const name = segs[1];
|
|
130
|
+
const isCurrent = name === SERVER_NAME;
|
|
131
|
+
const isPrevious = name === PREVIOUS_SERVER_NAME;
|
|
132
|
+
if (refresh ? isCurrent || isPrevious : isPrevious && !rename) {
|
|
133
|
+
// Left in place, under its name. Only the parent table's command and
|
|
134
|
+
// entry file change; sub-tables and every other line stay.
|
|
135
|
+
if (section.arrayTable) {
|
|
136
|
+
throw new MalformedTomlError("array-of-tables under [[mcp_servers.<name>]] is not supported");
|
|
137
|
+
}
|
|
138
|
+
keptSections.push(segs.length !== 2
|
|
139
|
+
? section
|
|
140
|
+
: refresh
|
|
141
|
+
? { ...section, bodyLines: repointEntryFiles(section.bodyLines, path.dirname(opts.spec.args[0])) }
|
|
142
|
+
: { ...section, bodyLines: repointBody(section.bodyLines, opts.spec, earlierEntryFile) });
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
const isLegacy = !refresh && isLegacyServerName(name);
|
|
146
|
+
const own = refresh ? null : isCurrent ? current : isPrevious ? previous : null;
|
|
147
|
+
if (isLegacy || own) {
|
|
148
|
+
// Array-of-tables under [[mcp_servers.<name>]] is not
|
|
149
|
+
// intentionally supported by Onadit. Fail closed rather than
|
|
150
|
+
// silently sweep — the friend's file is left untouched and
|
|
151
|
+
// recovery flows from the reference backup.
|
|
152
|
+
if (section.arrayTable) {
|
|
153
|
+
throw new MalformedTomlError("array-of-tables under [[mcp_servers.<name>]] is not supported");
|
|
154
|
+
}
|
|
155
|
+
if (isLegacy && !seenLegacy.has(name)) {
|
|
156
|
+
seenLegacy.add(name);
|
|
157
|
+
removedLegacyNames.push(name);
|
|
158
|
+
}
|
|
159
|
+
// Mark the entry as seen whether we encountered the parent or
|
|
160
|
+
// a descendant — the friend's file may have only the
|
|
161
|
+
// implicit [mcp_servers.onadit.env] form.
|
|
162
|
+
if (own) {
|
|
163
|
+
own.seen = true;
|
|
164
|
+
// User policy survives the rewrite: per-tool tables whole, and
|
|
165
|
+
// allowlisted keys from the parent table.
|
|
166
|
+
if (segs[2] === "tools") {
|
|
167
|
+
own.toolSections.push(section);
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
if (segs.length === 2) {
|
|
171
|
+
own.policy.push(...extractPolicyEntries(section.bodyLines));
|
|
172
|
+
const configArg = readConfigArg(section.bodyLines);
|
|
173
|
+
if (configArg === null)
|
|
174
|
+
own.argsUnreadable = true;
|
|
175
|
+
else
|
|
176
|
+
own.configArg ??= configArg;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
// A comment before the next header may describe that unrelated
|
|
180
|
+
// section. Keep standalone comments and spacing when replacing Onadit.
|
|
181
|
+
const preceding = keptSections.at(-1)?.bodyLines ?? parsed.preamble;
|
|
182
|
+
preceding.push(...section.bodyLines.filter(isTomlTrivia));
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
keptSections.push(section);
|
|
187
|
+
}
|
|
188
|
+
// On a move, the section under the earlier name is this same entry: its
|
|
189
|
+
// policy carries over, with the tool names it lists renamed. A section
|
|
190
|
+
// already under the current name wins, and the earlier one is dropped.
|
|
191
|
+
entry = current.seen ? current : rename ? renamedToCurrent(previous) : emptyEntry();
|
|
192
|
+
// A move keeps the config path the connection already used. When that
|
|
193
|
+
// path cannot be read, putting the default in its place could point the
|
|
194
|
+
// agent at another archive.
|
|
195
|
+
if (rename && !current.seen && previous.argsUnreadable) {
|
|
196
|
+
throw new MalformedTomlError("args are written in a form this writer cannot read");
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
catch (err) {
|
|
200
|
+
if (err instanceof MalformedTomlError) {
|
|
201
|
+
throw failParse(opts, absolute, raw, now, err);
|
|
202
|
+
}
|
|
203
|
+
throw err;
|
|
204
|
+
}
|
|
205
|
+
const removedNames = removedLegacyNames;
|
|
206
|
+
const renamedFromEarlier = rename && !hasCurrent;
|
|
207
|
+
const keptEarlierNames = hasPrevious && !rename;
|
|
208
|
+
// The current name: rebuilt where it is, written on a move, and created only
|
|
209
|
+
// where the server is not connected at all. Beside a connection kept on its
|
|
210
|
+
// earlier names it would be a second way in, with none of its rules.
|
|
211
|
+
const wroteCurrent = !refresh && (hasCurrent || rename || !hasPrevious);
|
|
212
|
+
const spec = renamedFromEarlier && previous.configArg
|
|
213
|
+
? { command: opts.spec.command, args: [opts.spec.args[0], previous.configArg, ...opts.spec.args.slice(2)] }
|
|
214
|
+
: opts.spec;
|
|
215
|
+
let merged;
|
|
216
|
+
if (wroteCurrent) {
|
|
217
|
+
const riftBlock = [
|
|
218
|
+
[renderRiftSection(spec), ...entry.policy.flatMap((p) => p.lines)].join("\n"),
|
|
219
|
+
...entry.toolSections.map((t) => [t.headerLine, ...trimTrailingTrivia(t.bodyLines)].join("\n")),
|
|
220
|
+
].join("\n\n");
|
|
221
|
+
merged = renderToml(parsed.preamble, keptSections, riftBlock);
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
merged = renderSections(parsed.preamble, keptSections, raw);
|
|
225
|
+
}
|
|
226
|
+
// A refresh with nothing of ours in the file, or nothing to change in it.
|
|
227
|
+
if (refresh && merged === raw)
|
|
228
|
+
return skipped(absolute, preexisting, opts.dryRun);
|
|
229
|
+
const redactedDiff = renderRedactedDiff({
|
|
230
|
+
removedNames,
|
|
231
|
+
rewroteRift: hasCurrent || hasPrevious,
|
|
232
|
+
renamedFromPrevious: renamedFromEarlier,
|
|
233
|
+
keptEarlierNames,
|
|
234
|
+
wroteCurrent,
|
|
235
|
+
spec,
|
|
236
|
+
keptPolicyKeys: [
|
|
237
|
+
...entry.policy.map((p) => p.key),
|
|
238
|
+
...entry.toolSections.map((t) => t.keySegments.slice(2).join(".")),
|
|
239
|
+
],
|
|
240
|
+
});
|
|
241
|
+
const backupId = preexisting ? makeBackupId(opts.client, now) : null;
|
|
242
|
+
const backupPath = preexisting ? `${absolute}.bak.${backupId}` : null;
|
|
243
|
+
if (!opts.dryRun) {
|
|
244
|
+
if (preexisting && backupPath) {
|
|
245
|
+
fs.writeFileSync(backupPath, raw, { encoding: "utf8", mode: 0o600 });
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
fs.mkdirSync(path.dirname(absolute), { recursive: true });
|
|
249
|
+
}
|
|
250
|
+
const tmp = `${absolute}.tmp.${process.pid}`;
|
|
251
|
+
// A config the person keeps private stays private.
|
|
252
|
+
const mode = preexisting ? fs.statSync(absolute).mode & 0o777 : 0o644;
|
|
253
|
+
try {
|
|
254
|
+
fs.writeFileSync(tmp, merged, { encoding: "utf8", mode });
|
|
255
|
+
fs.chmodSync(tmp, mode);
|
|
256
|
+
fs.renameSync(tmp, absolute);
|
|
257
|
+
}
|
|
258
|
+
catch (err) {
|
|
259
|
+
try {
|
|
260
|
+
if (fs.existsSync(tmp))
|
|
261
|
+
fs.unlinkSync(tmp);
|
|
262
|
+
}
|
|
263
|
+
catch {
|
|
264
|
+
// ignore
|
|
265
|
+
}
|
|
266
|
+
if (preexisting && backupPath && fs.existsSync(backupPath)) {
|
|
267
|
+
try {
|
|
268
|
+
fs.copyFileSync(backupPath, absolute);
|
|
269
|
+
}
|
|
270
|
+
catch {
|
|
271
|
+
// best effort — operator-side recovery uses the backup file directly.
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
throw err;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
return {
|
|
278
|
+
configPath: absolute,
|
|
279
|
+
preexisting,
|
|
280
|
+
backedUp: preexisting,
|
|
281
|
+
backupId,
|
|
282
|
+
backupPath,
|
|
283
|
+
legacyRemovedCount: removedNames.length,
|
|
284
|
+
redactedDiff,
|
|
285
|
+
dryRun: opts.dryRun,
|
|
286
|
+
...(opts.dryRun ? { wouldWrite: merged } : {}),
|
|
287
|
+
...(renamedFromEarlier ? { renamedFromEarlier: true } : {}),
|
|
288
|
+
...(keptEarlierNames ? { keptEarlierNames: true } : {}),
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
function failParse(opts, absolute, raw, now, cause) {
|
|
292
|
+
const id = makeBackupId(opts.client, now);
|
|
293
|
+
// A refresh runs on every upgrade and has changed nothing: no backup.
|
|
294
|
+
if (!opts.dryRun && !opts.existingOnly) {
|
|
295
|
+
try {
|
|
296
|
+
fs.mkdirSync(path.dirname(absolute), { recursive: true });
|
|
297
|
+
fs.writeFileSync(`${absolute}.bak.${id}`, raw, {
|
|
298
|
+
encoding: "utf8",
|
|
299
|
+
mode: 0o600,
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
catch {
|
|
303
|
+
// best-effort; the operator-side recovery flow handles missing backups.
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
return new ParseFailedError(opts.client, id, cause);
|
|
307
|
+
}
|
|
308
|
+
function parseTomlSections(raw) {
|
|
309
|
+
if (raw === "")
|
|
310
|
+
return { preamble: [], sections: [] };
|
|
311
|
+
// Preserve the original line-ending style by splitting on \n only.
|
|
312
|
+
const lines = raw.split("\n");
|
|
313
|
+
const trailingNewline = raw.endsWith("\n");
|
|
314
|
+
if (trailingNewline)
|
|
315
|
+
lines.pop();
|
|
316
|
+
const preamble = [];
|
|
317
|
+
const sections = [];
|
|
318
|
+
let current = null;
|
|
319
|
+
for (const line of lines) {
|
|
320
|
+
const arrayMatch = line.match(ARRAY_TABLE_RE);
|
|
321
|
+
const sectionMatch = arrayMatch ? null : line.match(SECTION_RE);
|
|
322
|
+
if (arrayMatch || sectionMatch) {
|
|
323
|
+
const rawKey = (arrayMatch?.[1] ?? sectionMatch?.[1] ?? "").trim();
|
|
324
|
+
const segments = normalizeTableKey(rawKey);
|
|
325
|
+
if (!segments) {
|
|
326
|
+
throw new MalformedTomlError("malformed table header");
|
|
327
|
+
}
|
|
328
|
+
if (current)
|
|
329
|
+
sections.push(current);
|
|
330
|
+
current = {
|
|
331
|
+
headerLine: line,
|
|
332
|
+
keySegments: segments,
|
|
333
|
+
arrayTable: !!arrayMatch,
|
|
334
|
+
bodyLines: [],
|
|
335
|
+
};
|
|
336
|
+
continue;
|
|
337
|
+
}
|
|
338
|
+
// Any line that begins with `[` but didn't match a header is
|
|
339
|
+
// structurally suspect — fail closed rather than silently shoving
|
|
340
|
+
// it into a body. Pure comments / blank lines / `key = value`
|
|
341
|
+
// lines are fine.
|
|
342
|
+
if (LEADING_BRACKET_RE.test(line)) {
|
|
343
|
+
throw new MalformedTomlError("bracketed line is not a valid table header");
|
|
344
|
+
}
|
|
345
|
+
if (current) {
|
|
346
|
+
current.bodyLines.push(line);
|
|
347
|
+
}
|
|
348
|
+
else {
|
|
349
|
+
preamble.push(line);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
if (current)
|
|
353
|
+
sections.push(current);
|
|
354
|
+
return { preamble, sections };
|
|
355
|
+
}
|
|
356
|
+
function isTomlTrivia(line) {
|
|
357
|
+
return /^\s*(?:#.*)?$/.test(line);
|
|
358
|
+
}
|
|
359
|
+
function trimTrailingTrivia(lines) {
|
|
360
|
+
let end = lines.length;
|
|
361
|
+
while (end > 0 && /^\s*$/.test(lines[end - 1]))
|
|
362
|
+
end--;
|
|
363
|
+
return lines.slice(0, end);
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Pull the allowlisted policy entries out of a `[mcp_servers.onadit]` body.
|
|
367
|
+
* An entry spans continuation lines while its brackets/braces are open, so a
|
|
368
|
+
* multi-line `enabled_tools = [ ... ]` is kept (or dropped) as a unit.
|
|
369
|
+
*/
|
|
370
|
+
function extractPolicyEntries(body) {
|
|
371
|
+
return bodyEntries(body).filter((entry) => RIFT_POLICY_KEYS.has(entry.key));
|
|
372
|
+
}
|
|
373
|
+
/** Every `key = value` entry of a table body, with its continuation lines. */
|
|
374
|
+
function bodyEntries(body) {
|
|
375
|
+
const entries = [];
|
|
376
|
+
let i = 0;
|
|
377
|
+
while (i < body.length) {
|
|
378
|
+
const first = body[i];
|
|
379
|
+
const key = entryKey(first);
|
|
380
|
+
if (!key) {
|
|
381
|
+
i++;
|
|
382
|
+
continue;
|
|
383
|
+
}
|
|
384
|
+
const start = i;
|
|
385
|
+
const entry = [first];
|
|
386
|
+
let depth = bracketDepth(first.slice(key.valueStart));
|
|
387
|
+
i++;
|
|
388
|
+
while (depth > 0 && i < body.length) {
|
|
389
|
+
entry.push(body[i]);
|
|
390
|
+
depth += bracketDepth(body[i]);
|
|
391
|
+
i++;
|
|
392
|
+
}
|
|
393
|
+
entries.push({ key: key.segments[0], segments: key.segments, lines: entry, start });
|
|
394
|
+
}
|
|
395
|
+
return entries;
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* What a refresh does to a parent table's body: each argument that names one
|
|
399
|
+
* of the server's entry files is pointed at the same file in this install's
|
|
400
|
+
* folder. Nothing else changes, so the names it serves, the command that
|
|
401
|
+
* launches it (a wrapper, node with flags) and every other line stay as the
|
|
402
|
+
* person has them. A table with no such argument comes back as it is.
|
|
403
|
+
*/
|
|
404
|
+
function repointEntryFiles(body, installDir) {
|
|
405
|
+
const args = bodyEntries(body).find((entry) => entry.segments.length === 1 && entry.key === "args");
|
|
406
|
+
if (!args)
|
|
407
|
+
return body;
|
|
408
|
+
const value = [args.lines[0].slice(entryKey(args.lines[0]).valueStart), ...args.lines.slice(1)].join("\n");
|
|
409
|
+
const strings = tomlStrings(value);
|
|
410
|
+
// Whether one of them is an entry file cannot be told.
|
|
411
|
+
if (strings === null)
|
|
412
|
+
throw new MalformedTomlError("args are written in a form this writer cannot read");
|
|
413
|
+
const next = strings.map((arg) => (isMcpEntryFile(arg) ? path.join(installDir, path.basename(arg)) : arg));
|
|
414
|
+
if (next.every((arg, i) => arg === strings[i]))
|
|
415
|
+
return body;
|
|
416
|
+
return [
|
|
417
|
+
...body.slice(0, args.start),
|
|
418
|
+
`args = [${next.map(quoteTomlString).join(", ")}]`,
|
|
419
|
+
...body.slice(args.start + args.lines.length),
|
|
420
|
+
];
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* A parent table's body pointed at this install: `command` and the first
|
|
424
|
+
* element of `args` change; the config path the table already carries, any
|
|
425
|
+
* further arguments, and every other line stay as they are. A table that
|
|
426
|
+
* launches nothing (no `command`, no `args`) is returned unchanged.
|
|
427
|
+
*/
|
|
428
|
+
function repointBody(body, spec, entryFile) {
|
|
429
|
+
const entries = bodyEntries(body).filter((entry) => entry.segments.length === 1);
|
|
430
|
+
const command = entries.find((entry) => entry.key === "command");
|
|
431
|
+
const args = entries.find((entry) => entry.key === "args");
|
|
432
|
+
if (!command && !args)
|
|
433
|
+
return body;
|
|
434
|
+
let rest = spec.args.slice(1);
|
|
435
|
+
if (args) {
|
|
436
|
+
const value = [args.lines[0].slice(entryKey(args.lines[0]).valueStart), ...args.lines.slice(1)].join("\n");
|
|
437
|
+
const strings = tomlStrings(value);
|
|
438
|
+
// The config path must not be replaced by a guess.
|
|
439
|
+
if (strings === null)
|
|
440
|
+
throw new MalformedTomlError("args are written in a form this writer cannot read");
|
|
441
|
+
if (strings.length > 1)
|
|
442
|
+
rest = strings.slice(1);
|
|
443
|
+
}
|
|
444
|
+
const commandLine = `command = ${quoteTomlString(spec.command)}`;
|
|
445
|
+
const argsLine = `args = [${[entryFile, ...rest].map(quoteTomlString).join(", ")}]`;
|
|
446
|
+
const out = [];
|
|
447
|
+
for (let i = 0; i < body.length; i++) {
|
|
448
|
+
if (command && i === command.start) {
|
|
449
|
+
out.push(commandLine, ...(args ? [] : [argsLine]));
|
|
450
|
+
i += command.lines.length - 1;
|
|
451
|
+
}
|
|
452
|
+
else if (args && i === args.start) {
|
|
453
|
+
out.push(...(command ? [] : [commandLine]), argsLine);
|
|
454
|
+
i += args.lines.length - 1;
|
|
455
|
+
}
|
|
456
|
+
else {
|
|
457
|
+
out.push(body[i]);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
return out;
|
|
461
|
+
}
|
|
462
|
+
/** The file as parsed, written back: unchanged sections come out byte for byte. */
|
|
463
|
+
function renderSections(preamble, sections, raw) {
|
|
464
|
+
const lines = [...preamble];
|
|
465
|
+
for (const section of sections)
|
|
466
|
+
lines.push(section.headerLine, ...section.bodyLines);
|
|
467
|
+
return lines.join("\n") + (raw.endsWith("\n") && lines.length > 0 ? "\n" : "");
|
|
468
|
+
}
|
|
469
|
+
function emptyEntry() {
|
|
470
|
+
return { seen: false, policy: [], toolSections: [], configArg: undefined, argsUnreadable: false };
|
|
471
|
+
}
|
|
472
|
+
function isOwnServerName(name) {
|
|
473
|
+
return name === SERVER_NAME || name === PREVIOUS_SERVER_NAME || isLegacyServerName(name);
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* True when a table body defines one of this product's servers without a
|
|
477
|
+
* table of its own: `rift = { … }` or `rift.command = …` under `[mcp_servers]`,
|
|
478
|
+
* `mcp_servers.rift.command = …` at the top of the file, or the whole
|
|
479
|
+
* `mcp_servers` as one inline table.
|
|
480
|
+
*/
|
|
481
|
+
function definesOwnServerInline(body, tablePath) {
|
|
482
|
+
return bodyEntries(body).some((entry) => {
|
|
483
|
+
const segments = [...tablePath, ...entry.segments];
|
|
484
|
+
if (segments[0] !== MCP_SERVERS)
|
|
485
|
+
return false;
|
|
486
|
+
return segments.length === 1 || isOwnServerName(segments[1]);
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* The second element of the section's `args`, which is the config path the
|
|
491
|
+
* server was installed with. Undefined when the section has no `args` or no
|
|
492
|
+
* second element; null when `args` is there in a form this reader does not
|
|
493
|
+
* handle, so the caller can stop instead of guessing.
|
|
494
|
+
*/
|
|
495
|
+
function readConfigArg(body) {
|
|
496
|
+
const args = bodyEntries(body).find((entry) => entry.key === "args");
|
|
497
|
+
if (!args)
|
|
498
|
+
return undefined;
|
|
499
|
+
// Only the value: a key written with quotes ("args" = [...]) is not an argument.
|
|
500
|
+
const value = [args.lines[0].slice(entryKey(args.lines[0]).valueStart), ...args.lines.slice(1)].join("\n");
|
|
501
|
+
const strings = tomlStrings(value);
|
|
502
|
+
return strings === null ? null : strings[1];
|
|
503
|
+
}
|
|
504
|
+
const MULTI_LINE_QUOTES = ['"'.repeat(3), "'".repeat(3)];
|
|
505
|
+
/**
|
|
506
|
+
* The strings in a TOML value, in order and decoded: basic ("…", with
|
|
507
|
+
* escapes) and literal ('…'). Comments are skipped. Null for multi-line
|
|
508
|
+
* strings and invalid escapes, which this reader does not handle.
|
|
509
|
+
*/
|
|
510
|
+
function tomlStrings(value) {
|
|
511
|
+
if (MULTI_LINE_QUOTES.some((quotes) => value.includes(quotes)))
|
|
512
|
+
return null;
|
|
513
|
+
const strings = [];
|
|
514
|
+
let i = 0;
|
|
515
|
+
while (i < value.length) {
|
|
516
|
+
const c = value[i];
|
|
517
|
+
if (c === "#") {
|
|
518
|
+
while (i < value.length && value[i] !== "\n")
|
|
519
|
+
i++;
|
|
520
|
+
}
|
|
521
|
+
else if (c === "'") {
|
|
522
|
+
const end = value.indexOf("'", i + 1);
|
|
523
|
+
if (end < 0)
|
|
524
|
+
return null;
|
|
525
|
+
strings.push(value.slice(i + 1, end));
|
|
526
|
+
i = end + 1;
|
|
527
|
+
}
|
|
528
|
+
else if (c === '"') {
|
|
529
|
+
let end = i + 1;
|
|
530
|
+
while (end < value.length && value[end] !== '"')
|
|
531
|
+
end += value[end] === "\\" ? 2 : 1;
|
|
532
|
+
if (end >= value.length)
|
|
533
|
+
return null;
|
|
534
|
+
const decoded = decodeBasicString(value.slice(i + 1, end));
|
|
535
|
+
if (decoded === null)
|
|
536
|
+
return null;
|
|
537
|
+
strings.push(decoded);
|
|
538
|
+
i = end + 1;
|
|
539
|
+
}
|
|
540
|
+
else {
|
|
541
|
+
i++;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
return strings;
|
|
545
|
+
}
|
|
546
|
+
const BASIC_ESCAPES = { '"': '"', "\\": "\\", b: "\b", t: "\t", n: "\n", f: "\f", r: "\r" };
|
|
547
|
+
/** The value of a TOML basic string's body, or null on an escape TOML does not define. */
|
|
548
|
+
function decodeBasicString(body) {
|
|
549
|
+
let out = "";
|
|
550
|
+
for (let i = 0; i < body.length; i++) {
|
|
551
|
+
if (body[i] !== "\\") {
|
|
552
|
+
out += body[i];
|
|
553
|
+
continue;
|
|
554
|
+
}
|
|
555
|
+
const esc = body[++i];
|
|
556
|
+
if (esc !== undefined && esc in BASIC_ESCAPES) {
|
|
557
|
+
out += BASIC_ESCAPES[esc];
|
|
558
|
+
}
|
|
559
|
+
else if (esc === "u" || esc === "U") {
|
|
560
|
+
const length = esc === "u" ? 4 : 8;
|
|
561
|
+
const hex = body.slice(i + 1, i + 1 + length);
|
|
562
|
+
if (!new RegExp(`^[0-9A-Fa-f]{${length}}$`).test(hex))
|
|
563
|
+
return null;
|
|
564
|
+
const code = parseInt(hex, 16);
|
|
565
|
+
if (code > 0x10ffff || (code >= 0xd800 && code <= 0xdfff))
|
|
566
|
+
return null;
|
|
567
|
+
out += String.fromCodePoint(code);
|
|
568
|
+
i += length;
|
|
569
|
+
}
|
|
570
|
+
else {
|
|
571
|
+
return null;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
return out;
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* An entry written under the server's earlier name, as it reads under the
|
|
578
|
+
* current one. Tool names are renamed in the text. That is exact only while
|
|
579
|
+
* the text is what TOML reads: an escape sequence ("\u0072ift_search") spells
|
|
580
|
+
* a name the rename cannot see, and the restriction it expressed would stop
|
|
581
|
+
* applying. So anything that names tools and contains a backslash stops the
|
|
582
|
+
* write.
|
|
583
|
+
*/
|
|
584
|
+
function renamedToCurrent(entry) {
|
|
585
|
+
const namesTools = [
|
|
586
|
+
...entry.policy.filter((p) => TOOL_NAMING_KEYS.has(p.key)).flatMap((p) => p.lines),
|
|
587
|
+
...entry.toolSections.flatMap((section) => [section.headerLine, ...section.bodyLines]),
|
|
588
|
+
];
|
|
589
|
+
if (namesTools.some((line) => line.includes("\\"))) {
|
|
590
|
+
throw new MalformedTomlError("tool names written with escape sequences are not supported");
|
|
591
|
+
}
|
|
592
|
+
return {
|
|
593
|
+
...entry,
|
|
594
|
+
policy: entry.policy.map((p) => TOOL_NAMING_KEYS.has(p.key) ? { ...p, lines: p.lines.map(renamePreviousToolNames) } : p),
|
|
595
|
+
toolSections: entry.toolSections.map((section) => {
|
|
596
|
+
const keySegments = [MCP_SERVERS, SERVER_NAME, ...section.keySegments.slice(2).map(renamePreviousToolNames)];
|
|
597
|
+
return {
|
|
598
|
+
...section,
|
|
599
|
+
keySegments,
|
|
600
|
+
headerLine: `[${keySegments.map(tomlKey).join(".")}]`,
|
|
601
|
+
// A `[mcp_servers.<name>.tools]` table keys its entries by tool name.
|
|
602
|
+
bodyLines: section.bodyLines.map(renamePreviousToolNames),
|
|
603
|
+
};
|
|
604
|
+
}),
|
|
605
|
+
};
|
|
606
|
+
}
|
|
607
|
+
function tomlKey(segment) {
|
|
608
|
+
return /^[A-Za-z0-9_-]+$/.test(segment) ? segment : quoteTomlString(segment);
|
|
609
|
+
}
|
|
610
|
+
function skipped(configPath, preexisting, dryRun) {
|
|
611
|
+
return {
|
|
612
|
+
configPath,
|
|
613
|
+
preexisting,
|
|
614
|
+
backedUp: false,
|
|
615
|
+
backupId: null,
|
|
616
|
+
backupPath: null,
|
|
617
|
+
legacyRemovedCount: 0,
|
|
618
|
+
redactedDiff: "",
|
|
619
|
+
dryRun,
|
|
620
|
+
skipped: true,
|
|
621
|
+
};
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* The key of a `key = value` line — bare, "quoted", 'literal' or dotted —
|
|
625
|
+
* and where its value starts. Null for comments, blanks and continuations.
|
|
626
|
+
*/
|
|
627
|
+
function entryKey(line) {
|
|
628
|
+
let quote = null;
|
|
629
|
+
for (let i = 0; i < line.length; i++) {
|
|
630
|
+
const c = line[i];
|
|
631
|
+
if (quote) {
|
|
632
|
+
if (c === "\\" && quote === '"')
|
|
633
|
+
i++;
|
|
634
|
+
else if (c === quote)
|
|
635
|
+
quote = null;
|
|
636
|
+
continue;
|
|
637
|
+
}
|
|
638
|
+
if (c === '"' || c === "'")
|
|
639
|
+
quote = c;
|
|
640
|
+
else if (c === "#")
|
|
641
|
+
return null;
|
|
642
|
+
else if (c === "=") {
|
|
643
|
+
const segments = normalizeTableKey(line.slice(0, i));
|
|
644
|
+
return segments ? { segments, valueStart: i + 1 } : null;
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
return null;
|
|
648
|
+
}
|
|
649
|
+
/** Net `[`/`{` minus `]`/`}` outside strings and comments. */
|
|
650
|
+
function bracketDepth(text) {
|
|
651
|
+
let depth = 0;
|
|
652
|
+
let quote = null;
|
|
653
|
+
for (let i = 0; i < text.length; i++) {
|
|
654
|
+
const c = text[i];
|
|
655
|
+
if (quote) {
|
|
656
|
+
if (c === "\\" && quote === '"')
|
|
657
|
+
i++;
|
|
658
|
+
else if (c === quote)
|
|
659
|
+
quote = null;
|
|
660
|
+
continue;
|
|
661
|
+
}
|
|
662
|
+
if (c === "#")
|
|
663
|
+
break;
|
|
664
|
+
if (c === '"' || c === "'")
|
|
665
|
+
quote = c;
|
|
666
|
+
else if (c === "[" || c === "{")
|
|
667
|
+
depth++;
|
|
668
|
+
else if (c === "]" || c === "}")
|
|
669
|
+
depth--;
|
|
670
|
+
}
|
|
671
|
+
return depth;
|
|
672
|
+
}
|
|
673
|
+
/** Remove only owned tables, keeping unrelated text and standalone comments. */
|
|
674
|
+
export function stripRiftTomlSections(raw) {
|
|
675
|
+
let parsed;
|
|
676
|
+
try {
|
|
677
|
+
parsed = parseTomlSections(raw);
|
|
678
|
+
}
|
|
679
|
+
catch (err) {
|
|
680
|
+
if (err instanceof MalformedTomlError)
|
|
681
|
+
return null;
|
|
682
|
+
throw err;
|
|
683
|
+
}
|
|
684
|
+
const lines = [...parsed.preamble];
|
|
685
|
+
let changed = false;
|
|
686
|
+
for (const section of parsed.sections) {
|
|
687
|
+
const [root, name] = section.keySegments;
|
|
688
|
+
const owned = root === MCP_SERVERS && name !== undefined
|
|
689
|
+
&& (name === SERVER_NAME || name === PREVIOUS_SERVER_NAME || isLegacyServerName(name));
|
|
690
|
+
if (owned) {
|
|
691
|
+
if (section.arrayTable)
|
|
692
|
+
return null;
|
|
693
|
+
changed = true;
|
|
694
|
+
lines.push(...section.bodyLines.filter(isTomlTrivia));
|
|
695
|
+
}
|
|
696
|
+
else {
|
|
697
|
+
lines.push(section.headerLine, ...section.bodyLines);
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
if (!changed)
|
|
701
|
+
return raw;
|
|
702
|
+
return lines.join("\n") + (raw.endsWith("\n") && lines.length > 0 ? "\n" : "");
|
|
703
|
+
}
|
|
704
|
+
/**
|
|
705
|
+
* Parse a TOML table key into its dotted segments, with quoted forms
|
|
706
|
+
* unquoted. Returns null on malformed input.
|
|
707
|
+
*
|
|
708
|
+
* Accepts:
|
|
709
|
+
* - bare keys (chars `A-Za-z0-9_-`)
|
|
710
|
+
* - basic-quoted keys (`"..."` with `\"` and `\\` escapes)
|
|
711
|
+
* - literal-quoted keys (`'...'`, no escape processing)
|
|
712
|
+
* - dotted keys with arbitrary whitespace around the dots
|
|
713
|
+
*/
|
|
714
|
+
function normalizeTableKey(raw) {
|
|
715
|
+
const trimmed = raw.trim();
|
|
716
|
+
if (trimmed === "")
|
|
717
|
+
return null;
|
|
718
|
+
const segments = [];
|
|
719
|
+
let i = 0;
|
|
720
|
+
const n = trimmed.length;
|
|
721
|
+
let expectKey = true;
|
|
722
|
+
while (i < n) {
|
|
723
|
+
while (i < n && (trimmed[i] === " " || trimmed[i] === "\t"))
|
|
724
|
+
i++;
|
|
725
|
+
if (i >= n) {
|
|
726
|
+
if (expectKey)
|
|
727
|
+
return null; // trailing dot
|
|
728
|
+
break;
|
|
729
|
+
}
|
|
730
|
+
if (!expectKey) {
|
|
731
|
+
if (trimmed[i] === ".") {
|
|
732
|
+
i++;
|
|
733
|
+
expectKey = true;
|
|
734
|
+
continue;
|
|
735
|
+
}
|
|
736
|
+
return null;
|
|
737
|
+
}
|
|
738
|
+
const ch = trimmed[i];
|
|
739
|
+
let segment = "";
|
|
740
|
+
if (ch === '"') {
|
|
741
|
+
i++;
|
|
742
|
+
let closed = false;
|
|
743
|
+
while (i < n) {
|
|
744
|
+
const c = trimmed[i];
|
|
745
|
+
if (c === "\\") {
|
|
746
|
+
if (i + 1 >= n)
|
|
747
|
+
return null; // trailing backslash, no escape char
|
|
748
|
+
const esc = trimmed[i + 1];
|
|
749
|
+
switch (esc) {
|
|
750
|
+
case '"':
|
|
751
|
+
segment += '"';
|
|
752
|
+
i += 2;
|
|
753
|
+
break;
|
|
754
|
+
case "\\":
|
|
755
|
+
segment += "\\";
|
|
756
|
+
i += 2;
|
|
757
|
+
break;
|
|
758
|
+
case "b":
|
|
759
|
+
segment += "\b";
|
|
760
|
+
i += 2;
|
|
761
|
+
break;
|
|
762
|
+
case "t":
|
|
763
|
+
segment += "\t";
|
|
764
|
+
i += 2;
|
|
765
|
+
break;
|
|
766
|
+
case "n":
|
|
767
|
+
segment += "\n";
|
|
768
|
+
i += 2;
|
|
769
|
+
break;
|
|
770
|
+
case "f":
|
|
771
|
+
segment += "\f";
|
|
772
|
+
i += 2;
|
|
773
|
+
break;
|
|
774
|
+
case "r":
|
|
775
|
+
segment += "\r";
|
|
776
|
+
i += 2;
|
|
777
|
+
break;
|
|
778
|
+
case "u": {
|
|
779
|
+
if (i + 6 > n)
|
|
780
|
+
return null;
|
|
781
|
+
const hex = trimmed.slice(i + 2, i + 6);
|
|
782
|
+
if (!/^[0-9A-Fa-f]{4}$/.test(hex))
|
|
783
|
+
return null;
|
|
784
|
+
const code = parseInt(hex, 16);
|
|
785
|
+
if (code >= 0xd800 && code <= 0xdfff)
|
|
786
|
+
return null;
|
|
787
|
+
segment += String.fromCodePoint(code);
|
|
788
|
+
i += 6;
|
|
789
|
+
break;
|
|
790
|
+
}
|
|
791
|
+
case "U": {
|
|
792
|
+
if (i + 10 > n)
|
|
793
|
+
return null;
|
|
794
|
+
const hex = trimmed.slice(i + 2, i + 10);
|
|
795
|
+
if (!/^[0-9A-Fa-f]{8}$/.test(hex))
|
|
796
|
+
return null;
|
|
797
|
+
const code = parseInt(hex, 16);
|
|
798
|
+
if (code > 0x10ffff)
|
|
799
|
+
return null;
|
|
800
|
+
if (code >= 0xd800 && code <= 0xdfff)
|
|
801
|
+
return null;
|
|
802
|
+
segment += String.fromCodePoint(code);
|
|
803
|
+
i += 10;
|
|
804
|
+
break;
|
|
805
|
+
}
|
|
806
|
+
default:
|
|
807
|
+
return null; // invalid escape (e.g. \q)
|
|
808
|
+
}
|
|
809
|
+
continue;
|
|
810
|
+
}
|
|
811
|
+
if (c === '"') {
|
|
812
|
+
closed = true;
|
|
813
|
+
i++;
|
|
814
|
+
break;
|
|
815
|
+
}
|
|
816
|
+
// Reject control characters (other than tab) inside a basic
|
|
817
|
+
// string — matches TOML spec for in-line table keys.
|
|
818
|
+
const code = c.charCodeAt(0);
|
|
819
|
+
if ((code < 0x20 && code !== 0x09) || code === 0x7f)
|
|
820
|
+
return null;
|
|
821
|
+
segment += c;
|
|
822
|
+
i++;
|
|
823
|
+
}
|
|
824
|
+
if (!closed)
|
|
825
|
+
return null;
|
|
826
|
+
}
|
|
827
|
+
else if (ch === "'") {
|
|
828
|
+
i++;
|
|
829
|
+
let closed = false;
|
|
830
|
+
while (i < n) {
|
|
831
|
+
const c = trimmed[i];
|
|
832
|
+
if (c === "'") {
|
|
833
|
+
closed = true;
|
|
834
|
+
i++;
|
|
835
|
+
break;
|
|
836
|
+
}
|
|
837
|
+
segment += c;
|
|
838
|
+
i++;
|
|
839
|
+
}
|
|
840
|
+
if (!closed)
|
|
841
|
+
return null;
|
|
842
|
+
}
|
|
843
|
+
else if (/[A-Za-z0-9_-]/.test(ch)) {
|
|
844
|
+
while (i < n && /[A-Za-z0-9_-]/.test(trimmed[i])) {
|
|
845
|
+
segment += trimmed[i];
|
|
846
|
+
i++;
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
else {
|
|
850
|
+
return null;
|
|
851
|
+
}
|
|
852
|
+
if (segment === "")
|
|
853
|
+
return null;
|
|
854
|
+
segments.push(segment);
|
|
855
|
+
expectKey = false;
|
|
856
|
+
}
|
|
857
|
+
if (expectKey)
|
|
858
|
+
return null; // trailing dot
|
|
859
|
+
return segments;
|
|
860
|
+
}
|
|
861
|
+
function renderToml(preamble, sections, riftBlock) {
|
|
862
|
+
const parts = [];
|
|
863
|
+
if (preamble.length > 0)
|
|
864
|
+
parts.push(preamble.join("\n"));
|
|
865
|
+
for (const s of sections) {
|
|
866
|
+
parts.push([s.headerLine, ...s.bodyLines].join("\n"));
|
|
867
|
+
}
|
|
868
|
+
const kept = parts.join("\n");
|
|
869
|
+
return kept + (kept && !kept.endsWith("\n") ? "\n\n" : "") + riftBlock + "\n";
|
|
870
|
+
}
|
|
871
|
+
function renderRiftSection(spec) {
|
|
872
|
+
const argsToml = spec.args.map(quoteTomlString).join(", ");
|
|
873
|
+
return [
|
|
874
|
+
`[mcp_servers.${SERVER_NAME}]`,
|
|
875
|
+
`command = ${quoteTomlString(spec.command)}`,
|
|
876
|
+
`args = [${argsToml}]`,
|
|
877
|
+
].join("\n");
|
|
878
|
+
}
|
|
879
|
+
function quoteTomlString(s) {
|
|
880
|
+
return `"${s.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
|
|
881
|
+
}
|
|
882
|
+
function renderRedactedDiff(opts) {
|
|
883
|
+
const lines = [];
|
|
884
|
+
for (const name of opts.removedNames) {
|
|
885
|
+
lines.push(`- [mcp_servers.${redactForbidden(name)}] (removed)`);
|
|
886
|
+
}
|
|
887
|
+
if (opts.renamedFromPrevious) {
|
|
888
|
+
lines.push(`- [mcp_servers.${PREVIOUS_SERVER_NAME}] (renamed to ${SERVER_NAME})`);
|
|
889
|
+
}
|
|
890
|
+
if (opts.keptEarlierNames) {
|
|
891
|
+
lines.push(`~ [mcp_servers.${PREVIOUS_SERVER_NAME}] (kept under its earlier name, pointed at this install)`);
|
|
892
|
+
}
|
|
893
|
+
// The command and arguments are those of the section under the current name;
|
|
894
|
+
// a connection kept under its earlier name launches a different entry file.
|
|
895
|
+
if (opts.wroteCurrent) {
|
|
896
|
+
lines.push(opts.rewroteRift
|
|
897
|
+
? `~ [mcp_servers.${SERVER_NAME}] (updated)`
|
|
898
|
+
: `+ [mcp_servers.${SERVER_NAME}] (added)`);
|
|
899
|
+
lines.push(` command = "${redactForbidden(opts.spec.command)}"`);
|
|
900
|
+
lines.push(` args = [${opts.spec.args
|
|
901
|
+
.map((a) => `"${redactForbidden(a)}"`)
|
|
902
|
+
.join(", ")}]`);
|
|
903
|
+
}
|
|
904
|
+
if (opts.keptPolicyKeys.length > 0) {
|
|
905
|
+
lines.push(` kept your settings: ${[...new Set(opts.keptPolicyKeys)].map(redactForbidden).join(", ")}`);
|
|
906
|
+
}
|
|
907
|
+
return lines.join("\n");
|
|
908
|
+
}
|
|
909
|
+
function makeBackupId(client, now) {
|
|
910
|
+
return `rift-mcp-${client}-${formatBackupTimestamp(now())}`;
|
|
911
|
+
}
|
|
912
|
+
function formatBackupTimestamp(d) {
|
|
913
|
+
return d.toISOString().replace(/\.\d{3}Z$/, "Z").replace(/:/g, "-");
|
|
914
|
+
}
|
|
915
|
+
function defaultNow() {
|
|
916
|
+
return new Date();
|
|
917
|
+
}
|
|
918
|
+
//# sourceMappingURL=codex-toml.js.map
|