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,810 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slice 1: Compact retrieval contract.
|
|
3
|
+
*
|
|
4
|
+
* Turns reranked results into a compact DTO that is safe to return to
|
|
5
|
+
* agents: bounded snippet/summary, no raw content by default, and a
|
|
6
|
+
* self-describing `expand` pointer for `detail=full` retrieval.
|
|
7
|
+
*
|
|
8
|
+
* Locked caps:
|
|
9
|
+
* - snippet <= 400 characters
|
|
10
|
+
* - summary <= 800 characters
|
|
11
|
+
*/
|
|
12
|
+
import { getTable, TABLE_NAMES } from "../storage/tables.js";
|
|
13
|
+
import { tokenize } from "./lexical.js";
|
|
14
|
+
import { extractPassages, passageQueryTerms } from "./passages.js";
|
|
15
|
+
import { parentKeyForRow, readChunkMarker, } from "../ingestion/chunk-meta.js";
|
|
16
|
+
import { rankedKey } from "./group-by-parent.js";
|
|
17
|
+
import { stitchChunkContents } from "./stitch-chunks.js";
|
|
18
|
+
import { eqFilter, inFilter } from "../storage/filter.js";
|
|
19
|
+
import { stableEvidenceIdentityForRow } from "./evidence-key.js";
|
|
20
|
+
export const SNIPPET_MAX = 400;
|
|
21
|
+
export const SUMMARY_MAX = 800;
|
|
22
|
+
export const TITLE_MAX = 120;
|
|
23
|
+
/**
|
|
24
|
+
* Token threshold above which `renderCompactMarkdown` annotates a hit with a
|
|
25
|
+
* compact `~Nk tokens` warning. The point is to make the agent see the size
|
|
26
|
+
* before it commits to a `detail=full` expansion that would blow context.
|
|
27
|
+
*/
|
|
28
|
+
export const LARGE_HIT_TOKEN_THRESHOLD = 10_000;
|
|
29
|
+
/**
|
|
30
|
+
* Middle-detail excerpt caps (characters, matching SNIPPET_MAX / SUMMARY_MAX).
|
|
31
|
+
* Targets ~2k–4k tokens total for an evidence-focused view that sits between
|
|
32
|
+
* `summary` (≤800 chars) and `full` (entire row content):
|
|
33
|
+
*
|
|
34
|
+
* - rows at or below MIDDLE_INLINE_THRESHOLD_CHARS get the full content inline
|
|
35
|
+
* (the excerpt would be the same content with no truncation, so skip the
|
|
36
|
+
* elision overhead);
|
|
37
|
+
* - larger rows get the first MIDDLE_HEAD_CHARS + last MIDDLE_TAIL_CHARS with
|
|
38
|
+
* a single elision marker between, preserving the bookends most useful for
|
|
39
|
+
* fact-checking (initial question, final answer/decision) while bounding
|
|
40
|
+
* cost.
|
|
41
|
+
*
|
|
42
|
+
* Char-based bounds are an intentional approximation: for typical mixed text,
|
|
43
|
+
* 1 token ≈ 4 chars, so 8000 head + 4000 tail ≈ 3000 tokens.
|
|
44
|
+
*/
|
|
45
|
+
export const MIDDLE_HEAD_CHARS = 8_000;
|
|
46
|
+
export const MIDDLE_TAIL_CHARS = 4_000;
|
|
47
|
+
export const MIDDLE_INLINE_THRESHOLD_CHARS = 12_000;
|
|
48
|
+
/**
|
|
49
|
+
* Neighbor chunks to include on each side of the matched chunk for a
|
|
50
|
+
* `detail="middle"` expand of a chunked source. The window is `[i-K, i+K]`
|
|
51
|
+
* clamped to the set, so K=1 yields up to 3 contiguous chunks (~5k chars /
|
|
52
|
+
* ~1.4k tokens at the default 1800-char target) — enough surrounding context to
|
|
53
|
+
* read the matched section in place without re-dumping the whole conversation.
|
|
54
|
+
*/
|
|
55
|
+
export const MIDDLE_CHUNK_NEIGHBORS = 1;
|
|
56
|
+
/**
|
|
57
|
+
* Pre-call size advert for an expansion: every compact hit carries this on
|
|
58
|
+
* both the top-level fields and inside `expand.params`, so an agent that
|
|
59
|
+
* copy-pastes the expand pointer verbatim still sees the size warning at the
|
|
60
|
+
* exact moment it chooses whether to spend context on `detail="full"`.
|
|
61
|
+
*/
|
|
62
|
+
export function computeContentSize(content) {
|
|
63
|
+
const content_bytes = Buffer.byteLength(content, "utf8");
|
|
64
|
+
const content_tokens_estimate = Math.ceil(content_bytes / 4);
|
|
65
|
+
return { content_bytes, content_tokens_estimate };
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Build the middle-detail content excerpt for a row body.
|
|
69
|
+
*
|
|
70
|
+
* - For content at or below MIDDLE_INLINE_THRESHOLD_CHARS, returns the content
|
|
71
|
+
* as-is (no truncation, `truncated: false`) — at that size the head+tail
|
|
72
|
+
* excerpt would equal the input anyway, and skipping the elision marker
|
|
73
|
+
* keeps the response identical to detail="full" for small rows.
|
|
74
|
+
* - For larger content, returns `head + elision marker + tail` where head is
|
|
75
|
+
* the first MIDDLE_HEAD_CHARS and tail is the last MIDDLE_TAIL_CHARS. The
|
|
76
|
+
* marker reports how many characters were elided so a reader knows the gap
|
|
77
|
+
* size without having to subtract.
|
|
78
|
+
*/
|
|
79
|
+
export function buildMiddleExcerpt(content, query) {
|
|
80
|
+
if (content.length <= MIDDLE_INLINE_THRESHOLD_CHARS) {
|
|
81
|
+
return { text: content, truncated: false };
|
|
82
|
+
}
|
|
83
|
+
if (query) {
|
|
84
|
+
const anchored = buildQueryAnchoredExcerpt(content, query);
|
|
85
|
+
if (anchored)
|
|
86
|
+
return { text: anchored, truncated: true };
|
|
87
|
+
}
|
|
88
|
+
const head = content.slice(0, MIDDLE_HEAD_CHARS);
|
|
89
|
+
const tail = content.slice(content.length - MIDDLE_TAIL_CHARS);
|
|
90
|
+
const elidedChars = content.length - MIDDLE_HEAD_CHARS - MIDDLE_TAIL_CHARS;
|
|
91
|
+
const elidedTokens = Math.ceil(Buffer.byteLength(content, "utf8") / 4);
|
|
92
|
+
const marker = `\n\n[…${elidedChars.toLocaleString("en-US")} chars elided — full row is ~${formatTokensShort(elidedTokens)} tokens, request detail="full" to expand…]\n\n`;
|
|
93
|
+
return { text: head + marker + tail, truncated: true };
|
|
94
|
+
}
|
|
95
|
+
/** Query-anchored middle excerpt: opening, then the best-matching spans. */
|
|
96
|
+
const ANCHORED_HEAD_CHARS = 2_000;
|
|
97
|
+
const ANCHORED_PASSAGE_CHARS = 3_000;
|
|
98
|
+
const ANCHORED_PASSAGES = 3;
|
|
99
|
+
function buildQueryAnchoredExcerpt(content, query) {
|
|
100
|
+
const passages = extractPassages(content, query, {
|
|
101
|
+
max: ANCHORED_PASSAGES,
|
|
102
|
+
windowChars: ANCHORED_PASSAGE_CHARS,
|
|
103
|
+
}).filter((p) => p.end > ANCHORED_HEAD_CHARS);
|
|
104
|
+
if (passages.length === 0)
|
|
105
|
+
return null;
|
|
106
|
+
const parts = [content.slice(0, ANCHORED_HEAD_CHARS)];
|
|
107
|
+
let cursor = ANCHORED_HEAD_CHARS;
|
|
108
|
+
for (const p of passages) {
|
|
109
|
+
const start = Math.max(p.start, cursor);
|
|
110
|
+
if (start >= p.end)
|
|
111
|
+
continue;
|
|
112
|
+
parts.push(`\n\n[…${(start - cursor).toLocaleString("en-US")} chars elided — match at char ${start.toLocaleString("en-US")}…]\n\n`, content.slice(start, p.end));
|
|
113
|
+
cursor = p.end;
|
|
114
|
+
}
|
|
115
|
+
const rest = content.length - cursor;
|
|
116
|
+
if (rest > 0) {
|
|
117
|
+
parts.push(`\n\n[…${rest.toLocaleString("en-US")} chars to the end — request detail="full" for the whole row…]`);
|
|
118
|
+
}
|
|
119
|
+
return parts.join("");
|
|
120
|
+
}
|
|
121
|
+
function formatTokensShort(tokens) {
|
|
122
|
+
if (tokens >= 1000)
|
|
123
|
+
return `${Math.round(tokens / 1000)}k`;
|
|
124
|
+
return String(tokens);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Pointer fields that let an agent re-cite this exact evidence for retrieval
|
|
128
|
+
* feedback without the route having to re-derive identity from a stale/partial
|
|
129
|
+
* pointer. `stable_evidence_key` is authoritative; `source` + `parent_id` are
|
|
130
|
+
* carried so conversation identity survives even if the key is ever dropped.
|
|
131
|
+
* Empty when no backing row is available (the expand path can still fetch by id).
|
|
132
|
+
*/
|
|
133
|
+
function evidencePointerParams(sourceTable, row) {
|
|
134
|
+
if (!row)
|
|
135
|
+
return {};
|
|
136
|
+
const identity = stableEvidenceIdentityForRow(sourceTable, row);
|
|
137
|
+
const source = row["source"];
|
|
138
|
+
const parentId = row["parent_id"];
|
|
139
|
+
return {
|
|
140
|
+
stable_evidence_key: identity.stable_evidence_key,
|
|
141
|
+
...(typeof source === "string" && source ? { source } : {}),
|
|
142
|
+
...(typeof parentId === "string" && parentId ? { parent_id: parentId } : {}),
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Batch-fetch the raw source rows for reranked results.
|
|
147
|
+
* Groups ids by source table and issues one `id IN (...)` query per table.
|
|
148
|
+
*
|
|
149
|
+
* Keyed by {@link rankedKey} — `(source_table, id)`, NOT bare id — so a row id
|
|
150
|
+
* shared across two tables (cloud vs local docs, hot vs cold) can never have one
|
|
151
|
+
* table's row overwrite the other's and produce a dishonest snippet/title/source
|
|
152
|
+
* for the surviving hit. Callers must look up via `get(rankedKey(r))`.
|
|
153
|
+
*/
|
|
154
|
+
export async function fetchRawRowsForRanked(ranked) {
|
|
155
|
+
const byTable = new Map();
|
|
156
|
+
for (const r of ranked) {
|
|
157
|
+
const arr = byTable.get(r.source_table) ?? [];
|
|
158
|
+
arr.push(r.id);
|
|
159
|
+
byTable.set(r.source_table, arr);
|
|
160
|
+
}
|
|
161
|
+
const out = new Map();
|
|
162
|
+
for (const [tableName, ids] of byTable) {
|
|
163
|
+
if (ids.length === 0)
|
|
164
|
+
continue;
|
|
165
|
+
const rows = (await getTable(tableName)
|
|
166
|
+
.query()
|
|
167
|
+
.where(inFilter("id", ids, { validateAsRowId: true }))
|
|
168
|
+
.limit(ids.length)
|
|
169
|
+
.toArray());
|
|
170
|
+
for (const row of rows) {
|
|
171
|
+
out.set(rankedKey({ source_table: tableName, id: row.id }), row);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return out;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* The minimal column projections each table family needs for
|
|
178
|
+
* {@link parentKeyForRow}. Deliberately excludes `content` and the embedding
|
|
179
|
+
* vector: chunk-grouping must inspect the WHOLE reranked pool (siblings beyond
|
|
180
|
+
* top_k still have to collapse before the top_k slice), and pulling full rows —
|
|
181
|
+
* embeddings included — for the entire deep pool on every query was a real
|
|
182
|
+
* hot-path regression. These projections let us key the pool cheaply, then fetch
|
|
183
|
+
* full rows only for the surviving representatives.
|
|
184
|
+
*/
|
|
185
|
+
const CONV_MARKER_COLUMNS = [
|
|
186
|
+
"id",
|
|
187
|
+
"parent_id",
|
|
188
|
+
"chunk_index",
|
|
189
|
+
"chunk_count",
|
|
190
|
+
"source",
|
|
191
|
+
];
|
|
192
|
+
const DOC_MARKER_COLUMNS = ["id", "source_path", "metadata"];
|
|
193
|
+
/**
|
|
194
|
+
* Compute the parent grouping key for every reranked result using a
|
|
195
|
+
* projection-only query (no `content`, no embedding vector) per source table.
|
|
196
|
+
*
|
|
197
|
+
* Returns `rankedKey(r) → parentKey | null`, keyed by `(source_table, id)` so a
|
|
198
|
+
* row id shared across two tables (cloud vs local docs, hot vs cold) can never
|
|
199
|
+
* collide into one entry. `null` for any row with no explicit chunk marker (the
|
|
200
|
+
* flag-off / legacy case — never grouped) and for any id with no backing row.
|
|
201
|
+
* Digests never chunk, so their ids map to `null` without a query. Pair with
|
|
202
|
+
* {@link groupByParent} (which looks up via {@link rankedKey}), then call
|
|
203
|
+
* {@link fetchRawRowsForRanked} on the post-group top-k representatives only.
|
|
204
|
+
*/
|
|
205
|
+
export async function fetchParentKeysForRanked(ranked) {
|
|
206
|
+
const byTable = new Map();
|
|
207
|
+
for (const r of ranked) {
|
|
208
|
+
const arr = byTable.get(r.source_table) ?? [];
|
|
209
|
+
arr.push(r.id);
|
|
210
|
+
byTable.set(r.source_table, arr);
|
|
211
|
+
}
|
|
212
|
+
const out = new Map();
|
|
213
|
+
for (const [tableName, ids] of byTable) {
|
|
214
|
+
if (ids.length === 0)
|
|
215
|
+
continue;
|
|
216
|
+
const keyOf = (id) => rankedKey({ source_table: tableName, id });
|
|
217
|
+
// Digests can never be chunked — skip the query entirely.
|
|
218
|
+
if (tableName === "digests") {
|
|
219
|
+
for (const id of ids)
|
|
220
|
+
out.set(keyOf(id), null);
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
const columns = tableName === "conversations_hot" || tableName === "conversations_cold"
|
|
224
|
+
? CONV_MARKER_COLUMNS
|
|
225
|
+
: DOC_MARKER_COLUMNS;
|
|
226
|
+
const rows = (await getTable(tableName)
|
|
227
|
+
.query()
|
|
228
|
+
.where(inFilter("id", ids, { validateAsRowId: true }))
|
|
229
|
+
.select([...columns])
|
|
230
|
+
.limit(ids.length)
|
|
231
|
+
.toArray());
|
|
232
|
+
for (const row of rows) {
|
|
233
|
+
const id = row.id;
|
|
234
|
+
out.set(keyOf(id), parentKeyForRow(tableName, row));
|
|
235
|
+
}
|
|
236
|
+
// Any id with no returned row reads as ungrouped.
|
|
237
|
+
for (const id of ids)
|
|
238
|
+
if (!out.has(keyOf(id)))
|
|
239
|
+
out.set(keyOf(id), null);
|
|
240
|
+
}
|
|
241
|
+
return out;
|
|
242
|
+
}
|
|
243
|
+
/** Derive the compact `tier` label from source_table (+ source_scope for docs). */
|
|
244
|
+
export function deriveTier(sourceTable, row) {
|
|
245
|
+
switch (sourceTable) {
|
|
246
|
+
case "conversations_hot":
|
|
247
|
+
return "hot";
|
|
248
|
+
case "conversations_cold":
|
|
249
|
+
return "cold";
|
|
250
|
+
case "digests":
|
|
251
|
+
return "digest";
|
|
252
|
+
case "structured_docs":
|
|
253
|
+
case "structured_docs_local": {
|
|
254
|
+
const scope = row?.source_scope;
|
|
255
|
+
return scope === "document" ? "document" : "structured_doc";
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Candidate source tables that can hold a row with the given compact tier.
|
|
261
|
+
* The `document` and `structured_doc` tiers map to either the cloud or local
|
|
262
|
+
* structured-docs table — callers should try them in order and keep the first hit.
|
|
263
|
+
*/
|
|
264
|
+
export function tablesForTier(tier) {
|
|
265
|
+
switch (tier) {
|
|
266
|
+
case "hot":
|
|
267
|
+
return ["conversations_hot"];
|
|
268
|
+
case "cold":
|
|
269
|
+
return ["conversations_cold"];
|
|
270
|
+
case "digest":
|
|
271
|
+
return ["digests"];
|
|
272
|
+
case "document":
|
|
273
|
+
case "structured_doc":
|
|
274
|
+
return ["structured_docs", "structured_docs_local"];
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Fetch a single row by id for the id-based expansion path on /search.
|
|
279
|
+
*
|
|
280
|
+
* When `sourceTableHint` is provided, only that table is consulted — this is
|
|
281
|
+
* the authoritative path for compact hits, which carry their backing table
|
|
282
|
+
* identity in `expand.params.source_table` precisely to disambiguate rows
|
|
283
|
+
* that may share an id across the cloud / local structured-doc tables.
|
|
284
|
+
*
|
|
285
|
+
* When `sourceTableHint` is omitted, falls back to iterating the candidate
|
|
286
|
+
* tables for the tier (first-match wins). This fallback is only used for
|
|
287
|
+
* hand-crafted expansion requests that don't carry `source_table`.
|
|
288
|
+
*/
|
|
289
|
+
export async function fetchRowByIdForTier(id, tier, sourceTableHint) {
|
|
290
|
+
const candidates = sourceTableHint
|
|
291
|
+
? [sourceTableHint]
|
|
292
|
+
: tablesForTier(tier);
|
|
293
|
+
for (const tableName of candidates) {
|
|
294
|
+
const rows = (await getTable(tableName)
|
|
295
|
+
.query()
|
|
296
|
+
// `id` is user-supplied via /search → escape only (no charset throw, so a
|
|
297
|
+
// malformed id stays a clean 404 rather than a 500).
|
|
298
|
+
.where(eqFilter("id", id))
|
|
299
|
+
.limit(1)
|
|
300
|
+
.toArray());
|
|
301
|
+
if (rows.length > 0) {
|
|
302
|
+
return { row: rows[0], sourceTable: tableName };
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
return null;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Fetch every row matching `id` across all supported tables.
|
|
309
|
+
*
|
|
310
|
+
* Used by the no-tier exact-ID path on /search: callers that pass only `id`
|
|
311
|
+
* deserve a deterministic answer — exactly one row, an explicit not-found,
|
|
312
|
+
* or an explicit ambiguous-ID error. Never silently fall back to ranked
|
|
313
|
+
* search.
|
|
314
|
+
*
|
|
315
|
+
* Returns an array of {row, sourceTable} hits — empty if nothing matches.
|
|
316
|
+
*/
|
|
317
|
+
export async function fetchRowsByIdAcrossTables(id) {
|
|
318
|
+
return fetchRowsByIdInTables(id, TABLE_NAMES);
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Fetch every row matching `id` across the given tables. Used by the
|
|
322
|
+
* tier-without-source_table path: when a tier maps to multiple backing
|
|
323
|
+
* tables (document / structured_doc → cloud + local), callers deserve the
|
|
324
|
+
* same ambiguity guarantee as the bare-id path rather than silent
|
|
325
|
+
* first-match-wins.
|
|
326
|
+
*/
|
|
327
|
+
export async function fetchRowsByIdInTables(id, tables) {
|
|
328
|
+
const matches = [];
|
|
329
|
+
for (const tableName of tables) {
|
|
330
|
+
const rows = (await getTable(tableName)
|
|
331
|
+
.query()
|
|
332
|
+
// `id` is user-supplied via /search → escape only (see fetchRowByIdForTier).
|
|
333
|
+
.where(eqFilter("id", id))
|
|
334
|
+
.limit(2)
|
|
335
|
+
.toArray());
|
|
336
|
+
for (const row of rows) {
|
|
337
|
+
matches.push({ row, sourceTable: tableName });
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
return matches;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Build a CompactHit directly from a raw row (bypassing retrieval/ranking).
|
|
344
|
+
* Used by the id-based expansion path: score is fixed at 1.0 and
|
|
345
|
+
* retrieval_method is labelled "direct" to signal a non-search fetch.
|
|
346
|
+
*/
|
|
347
|
+
export function buildCompactHitFromRow(row, sourceTable, opts) {
|
|
348
|
+
const tier = deriveTier(sourceTable, row);
|
|
349
|
+
const content = row.content || "";
|
|
350
|
+
const summary = deriveSummary(row, content);
|
|
351
|
+
const title = deriveTitle(sourceTable, row, content, summary);
|
|
352
|
+
const snippet = deriveSnippet(content, opts.query ?? "", "direct");
|
|
353
|
+
const timestamp = row.indexed_at ||
|
|
354
|
+
row.created_at ||
|
|
355
|
+
"";
|
|
356
|
+
const id = row.id;
|
|
357
|
+
const { content_bytes, content_tokens_estimate } = computeContentSize(content);
|
|
358
|
+
const detail = opts.detail ?? "full";
|
|
359
|
+
const [passage] = extractPassages(content, opts.query ?? "", { max: 1, windowChars: SNIPPET_MAX });
|
|
360
|
+
const hit = {
|
|
361
|
+
id,
|
|
362
|
+
source: deriveSource(sourceTable, row),
|
|
363
|
+
title,
|
|
364
|
+
score: 1.0,
|
|
365
|
+
retrieval_method: "direct",
|
|
366
|
+
timestamp,
|
|
367
|
+
tier,
|
|
368
|
+
snippet,
|
|
369
|
+
summary,
|
|
370
|
+
content_bytes,
|
|
371
|
+
content_tokens_estimate,
|
|
372
|
+
expand: {
|
|
373
|
+
route: opts.expandRoute ?? "/search",
|
|
374
|
+
params: {
|
|
375
|
+
id,
|
|
376
|
+
tier,
|
|
377
|
+
source_table: sourceTable,
|
|
378
|
+
detail: "full",
|
|
379
|
+
content_bytes,
|
|
380
|
+
content_tokens_estimate,
|
|
381
|
+
...evidencePointerParams(sourceTable, row),
|
|
382
|
+
},
|
|
383
|
+
},
|
|
384
|
+
};
|
|
385
|
+
if (opts.includePassage) {
|
|
386
|
+
hit.match_terms = passageQueryTerms(opts.query ?? "");
|
|
387
|
+
if (passage) {
|
|
388
|
+
hit.passage_start = passage.start;
|
|
389
|
+
hit.passage_end = passage.end;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
if (detail === "full") {
|
|
393
|
+
hit.content = content;
|
|
394
|
+
}
|
|
395
|
+
else if (detail === "middle") {
|
|
396
|
+
const excerpt = buildMiddleExcerpt(content, opts.query);
|
|
397
|
+
hit.content = excerpt.text;
|
|
398
|
+
if (excerpt.truncated)
|
|
399
|
+
hit.content_truncated = true;
|
|
400
|
+
}
|
|
401
|
+
return hit;
|
|
402
|
+
}
|
|
403
|
+
/** Projection columns needed to stitch a conversation / document chunk set. */
|
|
404
|
+
const CONV_STITCH_COLUMNS = [
|
|
405
|
+
"id",
|
|
406
|
+
"content",
|
|
407
|
+
"parent_id",
|
|
408
|
+
"chunk_index",
|
|
409
|
+
"chunk_count",
|
|
410
|
+
"source",
|
|
411
|
+
];
|
|
412
|
+
const DOC_STITCH_COLUMNS = [
|
|
413
|
+
"id",
|
|
414
|
+
"content",
|
|
415
|
+
"metadata",
|
|
416
|
+
"source_path",
|
|
417
|
+
];
|
|
418
|
+
/**
|
|
419
|
+
* Fetch the WHOLE parent chunk set of `matchedRow`. Reads only the columns
|
|
420
|
+
* needed to reassemble content (never the embedding vector). Best-effort: a
|
|
421
|
+
* sibling missing from the table (a partially-written set) simply doesn't appear,
|
|
422
|
+
* and the stitcher renders the gap honestly.
|
|
423
|
+
*
|
|
424
|
+
* The caller always needs the full set: even a bounded `middle` window must
|
|
425
|
+
* advertise the full-parent size on its `detail="full"` escalation pointer, so we
|
|
426
|
+
* stitch the whole set for that advert and a sub-window for the returned body.
|
|
427
|
+
* Server-side IO/memory therefore scales with parent length regardless of detail
|
|
428
|
+
* — fine for the bounded response, but not free for very long Codex/Claude
|
|
429
|
+
* threads. We read each sibling's ordinal from the authoritative column /
|
|
430
|
+
* metadata because that is simpler and more robust than an index-range predicate
|
|
431
|
+
* over the stringified `chunk_index`; a range/ID-targeted fetch is the follow-up
|
|
432
|
+
* if long-parent expand cost shows up in practice.
|
|
433
|
+
*/
|
|
434
|
+
async function fetchChunkSiblings(sourceTable, matchedRow, marker) {
|
|
435
|
+
const isConv = sourceTable === "conversations_hot" || sourceTable === "conversations_cold";
|
|
436
|
+
const limit = marker.count + 4; // small slack to surface any stray duplicate
|
|
437
|
+
const where = isConv
|
|
438
|
+
? // A conversation chunk set shares parent_id AND source (the namespaced
|
|
439
|
+
// retrieval key includes source), so scope to both.
|
|
440
|
+
`${eqFilter("parent_id", marker.parentId)} AND ${eqFilter("source", typeof matchedRow["source"] === "string" ? matchedRow["source"] : "")}`
|
|
441
|
+
: eqFilter("source_path", marker.parentId);
|
|
442
|
+
const rows = (await getTable(sourceTable)
|
|
443
|
+
.query()
|
|
444
|
+
.where(where)
|
|
445
|
+
.select([...(isConv ? CONV_STITCH_COLUMNS : DOC_STITCH_COLUMNS)])
|
|
446
|
+
.limit(limit)
|
|
447
|
+
.toArray());
|
|
448
|
+
const out = [];
|
|
449
|
+
for (const row of rows) {
|
|
450
|
+
const m = readChunkMarker(sourceTable, row);
|
|
451
|
+
if (!m)
|
|
452
|
+
continue;
|
|
453
|
+
out.push({ index: m.index, content: row.content ?? "" });
|
|
454
|
+
}
|
|
455
|
+
return out;
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Build a CompactHit for the exact-ID expand path, reassembling chunk siblings
|
|
459
|
+
* when the matched row belongs to a chunk set.
|
|
460
|
+
*
|
|
461
|
+
* - Unchunked rows, and any `detail="summary"` request, are returned verbatim by
|
|
462
|
+
* {@link buildCompactHitFromRow} — so with `RIFT_CHUNKING` off (no marked rows)
|
|
463
|
+
* this is provably the pre-stitching behavior.
|
|
464
|
+
* - For a chunked row, `detail="full"` reassembles the whole parent in
|
|
465
|
+
* `chunk_index` order; `detail="middle"` reassembles the matched chunk plus a
|
|
466
|
+
* bounded neighbor window (`MIDDLE_CHUNK_NEIGHBORS` each side). Both ranges are
|
|
467
|
+
* contiguous, and seams are de-overlapped so duplicated text appears once.
|
|
468
|
+
*
|
|
469
|
+
* The representative identity (id, title, source, timestamp, snippet, score)
|
|
470
|
+
* comes from the matched row. `content` and the TOP-LEVEL size fields are
|
|
471
|
+
* replaced with the stitched body actually returned, while the `expand.params`
|
|
472
|
+
* size fields advertise the FULL parent (what the `detail="full"` escalation
|
|
473
|
+
* pointer would return), plus `chunk_count` / `stitched_chunks` for observability.
|
|
474
|
+
*/
|
|
475
|
+
export async function buildExpandedHit(row, sourceTable, opts) {
|
|
476
|
+
const detail = opts.detail ?? "full";
|
|
477
|
+
const marker = readChunkMarker(sourceTable, row);
|
|
478
|
+
if (!marker || detail === "summary") {
|
|
479
|
+
return buildCompactHitFromRow(row, sourceTable, opts);
|
|
480
|
+
}
|
|
481
|
+
// Fetch the whole parent set once, then stitch it twice: the full ordered set
|
|
482
|
+
// sizes the `detail="full"` escalation pointer (expand.params), and a bounded
|
|
483
|
+
// sub-window is the body we actually return for `detail="middle"`.
|
|
484
|
+
const allSiblings = await fetchChunkSiblings(sourceTable, row, marker);
|
|
485
|
+
// Expected range = the whole parent [0, count-1]; passing it lets the stitcher
|
|
486
|
+
// mark a missing leading/trailing section (a partially-written set) instead of
|
|
487
|
+
// returning a partial body that reads as the complete parent.
|
|
488
|
+
const fullStitched = stitchChunkContents(allSiblings, {
|
|
489
|
+
trackPositions: !!opts.includePassage,
|
|
490
|
+
expectedStart: 0,
|
|
491
|
+
expectedEnd: marker.count - 1,
|
|
492
|
+
});
|
|
493
|
+
let returned = fullStitched;
|
|
494
|
+
if (detail === "middle") {
|
|
495
|
+
const start = Math.max(0, marker.index - MIDDLE_CHUNK_NEIGHBORS);
|
|
496
|
+
const end = Math.min(marker.count - 1, marker.index + MIDDLE_CHUNK_NEIGHBORS);
|
|
497
|
+
// Expected range = the requested window [start, end]; a sibling missing
|
|
498
|
+
// inside it (including its first/last index) renders as an omission marker.
|
|
499
|
+
// The deliberately out-of-window chunks are not "missing" and aren't marked.
|
|
500
|
+
returned = stitchChunkContents(allSiblings.filter((c) => c.index >= start && c.index <= end), { expectedStart: start, expectedEnd: end, trackPositions: !!opts.includePassage });
|
|
501
|
+
}
|
|
502
|
+
// Reuse all the title/source/snippet/timestamp derivation from the matched
|
|
503
|
+
// row, but start from "summary" so buildCompactHitFromRow doesn't also emit
|
|
504
|
+
// the single-chunk content — we replace content + size with the stitched body.
|
|
505
|
+
const hit = buildCompactHitFromRow(row, sourceTable, {
|
|
506
|
+
...opts,
|
|
507
|
+
detail: "summary",
|
|
508
|
+
});
|
|
509
|
+
// Top-level size = the body actually returned (middle window or full parent).
|
|
510
|
+
// The escalation pointer keeps detail="full" (set by buildCompactHitFromRow)
|
|
511
|
+
// and must advertise the FULL parent body re-expanding would return — so a
|
|
512
|
+
// bounded `middle` hit never under-states the cost of escalating to `full`.
|
|
513
|
+
const returnedSize = computeContentSize(returned.text);
|
|
514
|
+
const fullSize = computeContentSize(fullStitched.text);
|
|
515
|
+
hit.content = returned.text;
|
|
516
|
+
// Keep the passage of the ranked chunk. Searching the whole parent again
|
|
517
|
+
// can select an earlier duplicate that was never shown in the result row.
|
|
518
|
+
delete hit.passage_start;
|
|
519
|
+
delete hit.passage_end;
|
|
520
|
+
const [passage] = extractPassages(row.content ?? "", opts.query ?? "", { max: 1, windowChars: SNIPPET_MAX });
|
|
521
|
+
const chunkStart = returned.chunkStarts?.get(marker.index);
|
|
522
|
+
if (opts.includePassage && passage && chunkStart !== undefined) {
|
|
523
|
+
hit.passage_start = chunkStart + passage.start;
|
|
524
|
+
hit.passage_end = chunkStart + passage.end;
|
|
525
|
+
}
|
|
526
|
+
hit.content_bytes = returnedSize.content_bytes;
|
|
527
|
+
hit.content_tokens_estimate = returnedSize.content_tokens_estimate;
|
|
528
|
+
hit.expand.params["content_bytes"] = fullSize.content_bytes;
|
|
529
|
+
hit.expand.params["content_tokens_estimate"] = fullSize.content_tokens_estimate;
|
|
530
|
+
hit.chunk_count = marker.count;
|
|
531
|
+
hit.stitched_chunks = returned.sectionsUsed;
|
|
532
|
+
// A returned body that omits any sibling is an incomplete view of the parent.
|
|
533
|
+
// `content_truncated` is the existing contract downstream telemetry/agents use
|
|
534
|
+
// to know the body is partial: a bounded `middle` window trips it, and so does
|
|
535
|
+
// a `full` reassembly missing a sibling (a partially-written set). When a small
|
|
536
|
+
// parent's window happens to cover every chunk, sectionsUsed === count and it
|
|
537
|
+
// is correctly NOT flagged.
|
|
538
|
+
if (returned.sectionsUsed < marker.count)
|
|
539
|
+
hit.content_truncated = true;
|
|
540
|
+
return hit;
|
|
541
|
+
}
|
|
542
|
+
/** Derive a stable `source` string (what produced this row). */
|
|
543
|
+
export function deriveSource(sourceTable, row) {
|
|
544
|
+
if (sourceTable === "conversations_hot" || sourceTable === "conversations_cold") {
|
|
545
|
+
return row?.source || "conversation";
|
|
546
|
+
}
|
|
547
|
+
if (sourceTable === "digests")
|
|
548
|
+
return "digest";
|
|
549
|
+
return row?.source_type || "filesystem";
|
|
550
|
+
}
|
|
551
|
+
/** Derive a compact title. Prefers stored metadata, then first non-empty line. */
|
|
552
|
+
export function deriveTitle(sourceTable, row, content, summary) {
|
|
553
|
+
// Explicit stored title in metadata JSON takes precedence.
|
|
554
|
+
const metaTitle = readMetadataTitle(row);
|
|
555
|
+
if (metaTitle)
|
|
556
|
+
return truncate(metaTitle, TITLE_MAX);
|
|
557
|
+
if (sourceTable === "digests" && row) {
|
|
558
|
+
const start = row.period_start || "";
|
|
559
|
+
const end = row.period_end || "";
|
|
560
|
+
if (start || end)
|
|
561
|
+
return truncate(`Digest ${start}→${end}`, TITLE_MAX);
|
|
562
|
+
}
|
|
563
|
+
// Basename of a document path is a decent fallback for structured_docs.
|
|
564
|
+
if (sourceTable === "structured_docs" || sourceTable === "structured_docs_local") {
|
|
565
|
+
const p = row?.source_path;
|
|
566
|
+
if (p) {
|
|
567
|
+
const base = p.split("/").filter(Boolean).pop();
|
|
568
|
+
if (base)
|
|
569
|
+
return truncate(base, TITLE_MAX);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
const firstLine = firstNonEmptyLine(summary) || firstNonEmptyLine(content);
|
|
573
|
+
if (firstLine)
|
|
574
|
+
return truncate(firstLine, TITLE_MAX);
|
|
575
|
+
return "(untitled)";
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Derive a bounded snippet.
|
|
579
|
+
* - lexical/hybrid: up to 400 chars centered on the best query-term hit.
|
|
580
|
+
* - vector-only: first 400 chars of the first user turn (or content).
|
|
581
|
+
*/
|
|
582
|
+
export function deriveSnippet(content, query, retrievalMethod) {
|
|
583
|
+
if (!content)
|
|
584
|
+
return "";
|
|
585
|
+
if (retrievalMethod === "lexical" || retrievalMethod === "hybrid") {
|
|
586
|
+
const centered = centerOnQueryMatch(content, query);
|
|
587
|
+
if (centered !== null)
|
|
588
|
+
return truncate(centered, SNIPPET_MAX);
|
|
589
|
+
}
|
|
590
|
+
const firstTurn = extractFirstUserTurn(content);
|
|
591
|
+
return truncate(collapseWhitespace(firstTurn || content), SNIPPET_MAX);
|
|
592
|
+
}
|
|
593
|
+
/** Derive a bounded summary. Prefers stored summary, then content fallback. */
|
|
594
|
+
export function deriveSummary(row, content) {
|
|
595
|
+
const stored = row?.summary ?? "";
|
|
596
|
+
if (stored.trim())
|
|
597
|
+
return truncate(collapseWhitespace(stored), SUMMARY_MAX);
|
|
598
|
+
const metaSummary = readMetadataSummary(row);
|
|
599
|
+
if (metaSummary)
|
|
600
|
+
return truncate(collapseWhitespace(metaSummary), SUMMARY_MAX);
|
|
601
|
+
const firstTurn = extractFirstUserTurn(content);
|
|
602
|
+
return truncate(collapseWhitespace(firstTurn || content), SUMMARY_MAX);
|
|
603
|
+
}
|
|
604
|
+
export function buildCompactHit(ranked, row, opts) {
|
|
605
|
+
const tier = deriveTier(ranked.source_table, row);
|
|
606
|
+
const content = ranked.content || row?.content || "";
|
|
607
|
+
const summary = deriveSummary(row, content);
|
|
608
|
+
const title = deriveTitle(ranked.source_table, row, content, summary);
|
|
609
|
+
// Best query-matching span, with no speaker attribution.
|
|
610
|
+
const [best] = extractPassages(content, opts.query, { max: 1, windowChars: SNIPPET_MAX });
|
|
611
|
+
const snippet = best
|
|
612
|
+
? truncate(best.text, SNIPPET_MAX)
|
|
613
|
+
: deriveSnippet(content, opts.query, ranked.retrieval_method);
|
|
614
|
+
const timestamp = row?.indexed_at ||
|
|
615
|
+
row?.created_at ||
|
|
616
|
+
"";
|
|
617
|
+
const { content_bytes, content_tokens_estimate } = computeContentSize(content);
|
|
618
|
+
const hit = {
|
|
619
|
+
id: ranked.id,
|
|
620
|
+
source: deriveSource(ranked.source_table, row),
|
|
621
|
+
title,
|
|
622
|
+
score: ranked.score,
|
|
623
|
+
retrieval_method: ranked.retrieval_method,
|
|
624
|
+
timestamp,
|
|
625
|
+
tier,
|
|
626
|
+
snippet,
|
|
627
|
+
summary,
|
|
628
|
+
content_bytes,
|
|
629
|
+
content_tokens_estimate,
|
|
630
|
+
expand: {
|
|
631
|
+
route: opts.expandRoute ?? "/search",
|
|
632
|
+
// `source_table` is carried so the expansion path can fetch the exact
|
|
633
|
+
// backing row without guessing — critical for `document`/`structured_doc`
|
|
634
|
+
// tiers, where the same id may exist in both cloud and local tables.
|
|
635
|
+
//
|
|
636
|
+
// `content_bytes` and `content_tokens_estimate` are mirrored here so an
|
|
637
|
+
// agent that copy-pastes the `expand` pointer verbatim sees the size
|
|
638
|
+
// warning at the moment it chooses to spend context on `detail="full"`.
|
|
639
|
+
params: {
|
|
640
|
+
id: ranked.id,
|
|
641
|
+
tier,
|
|
642
|
+
source_table: ranked.source_table,
|
|
643
|
+
detail: "full",
|
|
644
|
+
content_bytes,
|
|
645
|
+
content_tokens_estimate,
|
|
646
|
+
...evidencePointerParams(ranked.source_table, row),
|
|
647
|
+
},
|
|
648
|
+
},
|
|
649
|
+
};
|
|
650
|
+
if (opts.includePassage) {
|
|
651
|
+
hit.match_terms = passageQueryTerms(opts.query);
|
|
652
|
+
if (best) {
|
|
653
|
+
hit.passage_start = best.start;
|
|
654
|
+
hit.passage_end = best.end;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
if (opts.detail === "full") {
|
|
658
|
+
hit.content = content;
|
|
659
|
+
}
|
|
660
|
+
else if (opts.detail === "middle") {
|
|
661
|
+
const excerpt = buildMiddleExcerpt(content, opts.query);
|
|
662
|
+
hit.content = excerpt.text;
|
|
663
|
+
if (excerpt.truncated)
|
|
664
|
+
hit.content_truncated = true;
|
|
665
|
+
}
|
|
666
|
+
if (opts.siblingCount !== undefined && opts.siblingCount > 1) {
|
|
667
|
+
hit.matched_sections = opts.siblingCount;
|
|
668
|
+
}
|
|
669
|
+
if (opts.duplicateCount !== undefined && opts.duplicateCount > 1) {
|
|
670
|
+
hit.duplicate_count = opts.duplicateCount;
|
|
671
|
+
}
|
|
672
|
+
return hit;
|
|
673
|
+
}
|
|
674
|
+
// --- Markdown rendering (MCP text channel) ---
|
|
675
|
+
/** Compact markdown rendering of a set of hits — no raw JSON. */
|
|
676
|
+
export function renderCompactMarkdown(hits, opts = {}) {
|
|
677
|
+
const lines = [];
|
|
678
|
+
if (opts.degraded) {
|
|
679
|
+
lines.push(`> ⚠ degraded${opts.degradedReason ? `: ${opts.degradedReason}` : ""}`, "");
|
|
680
|
+
}
|
|
681
|
+
else if (opts.lexical) {
|
|
682
|
+
// Intentional no-key mode, not a failure — keyword/BM25 results by design.
|
|
683
|
+
lines.push("> ℹ Keyword search (no embedding key configured — semantic ranking off).", "");
|
|
684
|
+
}
|
|
685
|
+
if (hits.length === 0) {
|
|
686
|
+
lines.push("_No results._");
|
|
687
|
+
return lines.join("\n");
|
|
688
|
+
}
|
|
689
|
+
hits.forEach((h, i) => {
|
|
690
|
+
const title = escapeMd(h.title ?? "(untitled)");
|
|
691
|
+
const tier = h.tier ?? "?";
|
|
692
|
+
const source = h.source === "grok_cli" ? "Grok CLI" : h.source ?? "?";
|
|
693
|
+
const score = typeof h.score === "number" ? h.score.toFixed(3) : "?";
|
|
694
|
+
const method = h.retrieval_method ?? "?";
|
|
695
|
+
const sizeWarning = formatSizeWarning(h.content_tokens_estimate);
|
|
696
|
+
const sections = typeof h.matched_sections === "number" && h.matched_sections > 1
|
|
697
|
+
? ` · +${h.matched_sections - 1} more section${h.matched_sections - 1 === 1 ? "" : "s"}`
|
|
698
|
+
: "";
|
|
699
|
+
const duplicates = typeof h.duplicate_count === "number" && h.duplicate_count > 1
|
|
700
|
+
? ` · +${h.duplicate_count - 1} duplicate capture${h.duplicate_count - 1 === 1 ? "" : "s"}`
|
|
701
|
+
: "";
|
|
702
|
+
lines.push(`${i + 1}. **${title}** — _${tier}_ · ${source} · score ${score} (${method})${sizeWarning ? ` · ${sizeWarning}` : ""}${sections}${duplicates}`);
|
|
703
|
+
if (h.snippet) {
|
|
704
|
+
lines.push(` ${escapeMd(h.snippet)}`);
|
|
705
|
+
}
|
|
706
|
+
// Render the expand pointer with the *actual* params object the route
|
|
707
|
+
// expects, so the printed markdown is round-trippable — an agent can
|
|
708
|
+
// copy-paste `{ ... }` as the request body for the route.
|
|
709
|
+
const expandRoute = h.expand?.route ?? "/search";
|
|
710
|
+
const params = h.expand?.params ?? { id: h.id, detail: "full" };
|
|
711
|
+
lines.push(` \`expand: ${expandRoute} ${JSON.stringify(params)}\``);
|
|
712
|
+
});
|
|
713
|
+
return lines.join("\n");
|
|
714
|
+
}
|
|
715
|
+
/**
|
|
716
|
+
* Compact size warning for large hits, e.g. `~82k tokens`. Returns the empty
|
|
717
|
+
* string for hits below `LARGE_HIT_TOKEN_THRESHOLD` so the markdown stays
|
|
718
|
+
* concise when expansion would be cheap.
|
|
719
|
+
*/
|
|
720
|
+
export function formatSizeWarning(tokensEstimate) {
|
|
721
|
+
if (typeof tokensEstimate !== "number" || tokensEstimate < LARGE_HIT_TOKEN_THRESHOLD) {
|
|
722
|
+
return "";
|
|
723
|
+
}
|
|
724
|
+
if (tokensEstimate >= 1000) {
|
|
725
|
+
return `~${Math.round(tokensEstimate / 1000)}k tokens`;
|
|
726
|
+
}
|
|
727
|
+
return `~${tokensEstimate} tokens`;
|
|
728
|
+
}
|
|
729
|
+
// --- Internals ---
|
|
730
|
+
function truncate(text, max) {
|
|
731
|
+
if (text.length <= max)
|
|
732
|
+
return text;
|
|
733
|
+
// Hard cap at `max` to guarantee the locked contract; callers rely on this.
|
|
734
|
+
return text.slice(0, max);
|
|
735
|
+
}
|
|
736
|
+
function collapseWhitespace(text) {
|
|
737
|
+
return text.replace(/\s+/g, " ").trim();
|
|
738
|
+
}
|
|
739
|
+
function firstNonEmptyLine(text) {
|
|
740
|
+
for (const line of text.split(/\r?\n/)) {
|
|
741
|
+
const t = line.trim();
|
|
742
|
+
if (t) {
|
|
743
|
+
// Strip common markdown heading hashes and list bullets for titles.
|
|
744
|
+
return t.replace(/^#+\s*/, "").replace(/^[-*]\s+/, "");
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
return "";
|
|
748
|
+
}
|
|
749
|
+
function extractFirstUserTurn(content) {
|
|
750
|
+
// Best-effort: look for a "User:" / "Human:" marker at the start of a line
|
|
751
|
+
// followed by text up to the next role marker. Falls back to empty string.
|
|
752
|
+
const match = content.match(/(?:^|\n)\s*(?:user|human)\s*:\s*([\s\S]*?)(?:\n\s*(?:assistant|ai|model|system)\s*:|\n{2,}#|$)/i);
|
|
753
|
+
if (match && match[1])
|
|
754
|
+
return match[1].trim();
|
|
755
|
+
return "";
|
|
756
|
+
}
|
|
757
|
+
function centerOnQueryMatch(content, query) {
|
|
758
|
+
const terms = tokenize(query);
|
|
759
|
+
if (terms.length === 0)
|
|
760
|
+
return null;
|
|
761
|
+
const lower = content.toLowerCase();
|
|
762
|
+
let bestIdx = -1;
|
|
763
|
+
for (const t of terms) {
|
|
764
|
+
const idx = lower.indexOf(t.toLowerCase());
|
|
765
|
+
if (idx >= 0 && (bestIdx === -1 || idx < bestIdx))
|
|
766
|
+
bestIdx = idx;
|
|
767
|
+
}
|
|
768
|
+
if (bestIdx < 0)
|
|
769
|
+
return null;
|
|
770
|
+
const halfWindow = Math.floor(SNIPPET_MAX / 2);
|
|
771
|
+
const start = Math.max(0, bestIdx - halfWindow);
|
|
772
|
+
const end = Math.min(content.length, start + SNIPPET_MAX);
|
|
773
|
+
const adjustedStart = Math.max(0, end - SNIPPET_MAX);
|
|
774
|
+
const slice = content.slice(adjustedStart, end);
|
|
775
|
+
return collapseWhitespace(slice);
|
|
776
|
+
}
|
|
777
|
+
function readMetadataTitle(row) {
|
|
778
|
+
const meta = row?.metadata;
|
|
779
|
+
if (typeof meta !== "string" || !meta)
|
|
780
|
+
return null;
|
|
781
|
+
try {
|
|
782
|
+
const parsed = JSON.parse(meta);
|
|
783
|
+
const t = parsed["title"];
|
|
784
|
+
if (typeof t === "string" && t.trim())
|
|
785
|
+
return t.trim();
|
|
786
|
+
}
|
|
787
|
+
catch {
|
|
788
|
+
// ignore malformed metadata
|
|
789
|
+
}
|
|
790
|
+
return null;
|
|
791
|
+
}
|
|
792
|
+
function readMetadataSummary(row) {
|
|
793
|
+
const meta = row?.metadata;
|
|
794
|
+
if (typeof meta !== "string" || !meta)
|
|
795
|
+
return null;
|
|
796
|
+
try {
|
|
797
|
+
const parsed = JSON.parse(meta);
|
|
798
|
+
const s = parsed["summary"];
|
|
799
|
+
if (typeof s === "string" && s.trim())
|
|
800
|
+
return s.trim();
|
|
801
|
+
}
|
|
802
|
+
catch {
|
|
803
|
+
// ignore
|
|
804
|
+
}
|
|
805
|
+
return null;
|
|
806
|
+
}
|
|
807
|
+
function escapeMd(text) {
|
|
808
|
+
return text.replace(/\|/g, "\\|").replace(/\n+/g, " ");
|
|
809
|
+
}
|
|
810
|
+
//# sourceMappingURL=compact.js.map
|