onadit 0.0.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.dev.md +124 -0
- package/README.md +194 -2
- package/dist/src/auth/keychain.d.ts +42 -0
- package/dist/src/auth/keychain.d.ts.map +1 -0
- package/dist/src/auth/keychain.js +177 -0
- package/dist/src/auth/keychain.js.map +1 -0
- package/dist/src/auth/middleware.d.ts +21 -0
- package/dist/src/auth/middleware.d.ts.map +1 -0
- package/dist/src/auth/middleware.js +93 -0
- package/dist/src/auth/middleware.js.map +1 -0
- package/dist/src/auth/rate-limit.d.ts +16 -0
- package/dist/src/auth/rate-limit.d.ts.map +1 -0
- package/dist/src/auth/rate-limit.js +38 -0
- package/dist/src/auth/rate-limit.js.map +1 -0
- package/dist/src/auth/rotation.d.ts +67 -0
- package/dist/src/auth/rotation.d.ts.map +1 -0
- package/dist/src/auth/rotation.js +190 -0
- package/dist/src/auth/rotation.js.map +1 -0
- package/dist/src/backfill/project-context-batch-constructor.d.ts +127 -0
- package/dist/src/backfill/project-context-batch-constructor.d.ts.map +1 -0
- package/dist/src/backfill/project-context-batch-constructor.js +210 -0
- package/dist/src/backfill/project-context-batch-constructor.js.map +1 -0
- package/dist/src/capture/assistant-text-lookup.d.ts +31 -0
- package/dist/src/capture/assistant-text-lookup.d.ts.map +1 -0
- package/dist/src/capture/assistant-text-lookup.js +222 -0
- package/dist/src/capture/assistant-text-lookup.js.map +1 -0
- package/dist/src/capture/auto-capture.d.ts +322 -0
- package/dist/src/capture/auto-capture.d.ts.map +1 -0
- package/dist/src/capture/auto-capture.js +1167 -0
- package/dist/src/capture/auto-capture.js.map +1 -0
- package/dist/src/capture/auto-repair.d.ts +125 -0
- package/dist/src/capture/auto-repair.d.ts.map +1 -0
- package/dist/src/capture/auto-repair.js +280 -0
- package/dist/src/capture/auto-repair.js.map +1 -0
- package/dist/src/capture/batch-budget.d.ts +90 -0
- package/dist/src/capture/batch-budget.d.ts.map +1 -0
- package/dist/src/capture/batch-budget.js +148 -0
- package/dist/src/capture/batch-budget.js.map +1 -0
- package/dist/src/capture/claude-cli-triage-provider.d.ts +28 -0
- package/dist/src/capture/claude-cli-triage-provider.d.ts.map +1 -0
- package/dist/src/capture/claude-cli-triage-provider.js +101 -0
- package/dist/src/capture/claude-cli-triage-provider.js.map +1 -0
- package/dist/src/capture/codex-cli-triage-provider.d.ts +17 -0
- package/dist/src/capture/codex-cli-triage-provider.d.ts.map +1 -0
- package/dist/src/capture/codex-cli-triage-provider.js +91 -0
- package/dist/src/capture/codex-cli-triage-provider.js.map +1 -0
- package/dist/src/capture/cursor-capture.d.ts +89 -0
- package/dist/src/capture/cursor-capture.d.ts.map +1 -0
- package/dist/src/capture/cursor-capture.js +121 -0
- package/dist/src/capture/cursor-capture.js.map +1 -0
- package/dist/src/capture/observability.d.ts +131 -0
- package/dist/src/capture/observability.d.ts.map +1 -0
- package/dist/src/capture/observability.js +181 -0
- package/dist/src/capture/observability.js.map +1 -0
- package/dist/src/capture/openai-triage-provider.d.ts +92 -0
- package/dist/src/capture/openai-triage-provider.d.ts.map +1 -0
- package/dist/src/capture/openai-triage-provider.js +267 -0
- package/dist/src/capture/openai-triage-provider.js.map +1 -0
- package/dist/src/capture/recover-quarantine.d.ts +273 -0
- package/dist/src/capture/recover-quarantine.d.ts.map +1 -0
- package/dist/src/capture/recover-quarantine.js +581 -0
- package/dist/src/capture/recover-quarantine.js.map +1 -0
- package/dist/src/capture/review-queue-index.d.ts +51 -0
- package/dist/src/capture/review-queue-index.d.ts.map +1 -0
- package/dist/src/capture/review-queue-index.js +204 -0
- package/dist/src/capture/review-queue-index.js.map +1 -0
- package/dist/src/capture/review-queue.d.ts +47 -0
- package/dist/src/capture/review-queue.d.ts.map +1 -0
- package/dist/src/capture/review-queue.js +116 -0
- package/dist/src/capture/review-queue.js.map +1 -0
- package/dist/src/capture/sources.d.ts +53 -0
- package/dist/src/capture/sources.d.ts.map +1 -0
- package/dist/src/capture/sources.js +55 -0
- package/dist/src/capture/sources.js.map +1 -0
- package/dist/src/capture/stored-statements.d.ts +9 -0
- package/dist/src/capture/stored-statements.d.ts.map +1 -0
- package/dist/src/capture/stored-statements.js +63 -0
- package/dist/src/capture/stored-statements.js.map +1 -0
- package/dist/src/capture/triage-classification.d.ts +92 -0
- package/dist/src/capture/triage-classification.d.ts.map +1 -0
- package/dist/src/capture/triage-classification.js +94 -0
- package/dist/src/capture/triage-classification.js.map +1 -0
- package/dist/src/capture/triage-lane.d.ts +39 -0
- package/dist/src/capture/triage-lane.d.ts.map +1 -0
- package/dist/src/capture/triage-lane.js +217 -0
- package/dist/src/capture/triage-lane.js.map +1 -0
- package/dist/src/capture/triage-provider-factory.d.ts +36 -0
- package/dist/src/capture/triage-provider-factory.d.ts.map +1 -0
- package/dist/src/capture/triage-provider-factory.js +55 -0
- package/dist/src/capture/triage-provider-factory.js.map +1 -0
- package/dist/src/capture/triage-provider.d.ts +82 -0
- package/dist/src/capture/triage-provider.d.ts.map +1 -0
- package/dist/src/capture/triage-provider.js +126 -0
- package/dist/src/capture/triage-provider.js.map +1 -0
- package/dist/src/capture/triage.d.ts +30 -0
- package/dist/src/capture/triage.d.ts.map +1 -0
- package/dist/src/capture/triage.js +50 -0
- package/dist/src/capture/triage.js.map +1 -0
- package/dist/src/capture/user-statements-recheck.d.ts +22 -0
- package/dist/src/capture/user-statements-recheck.d.ts.map +1 -0
- package/dist/src/capture/user-statements-recheck.js +181 -0
- package/dist/src/capture/user-statements-recheck.js.map +1 -0
- package/dist/src/capture/user-statements.d.ts +84 -0
- package/dist/src/capture/user-statements.d.ts.map +1 -0
- package/dist/src/capture/user-statements.js +617 -0
- package/dist/src/capture/user-statements.js.map +1 -0
- package/dist/src/cli/agent-homes.d.ts +15 -0
- package/dist/src/cli/agent-homes.d.ts.map +1 -0
- package/dist/src/cli/agent-homes.js +45 -0
- package/dist/src/cli/agent-homes.js.map +1 -0
- package/dist/src/cli/commands/backfill.d.ts +3 -0
- package/dist/src/cli/commands/backfill.d.ts.map +1 -0
- package/dist/src/cli/commands/backfill.js +1379 -0
- package/dist/src/cli/commands/backfill.js.map +1 -0
- package/dist/src/cli/commands/brief.d.ts +12 -0
- package/dist/src/cli/commands/brief.d.ts.map +1 -0
- package/dist/src/cli/commands/brief.js +131 -0
- package/dist/src/cli/commands/brief.js.map +1 -0
- package/dist/src/cli/commands/bulk-ingest.d.ts +3 -0
- package/dist/src/cli/commands/bulk-ingest.d.ts.map +1 -0
- package/dist/src/cli/commands/bulk-ingest.js +126 -0
- package/dist/src/cli/commands/bulk-ingest.js.map +1 -0
- package/dist/src/cli/commands/capture-recover.d.ts +40 -0
- package/dist/src/cli/commands/capture-recover.d.ts.map +1 -0
- package/dist/src/cli/commands/capture-recover.js +194 -0
- package/dist/src/cli/commands/capture-recover.js.map +1 -0
- package/dist/src/cli/commands/capture.d.ts +12 -0
- package/dist/src/cli/commands/capture.d.ts.map +1 -0
- package/dist/src/cli/commands/capture.js +304 -0
- package/dist/src/cli/commands/capture.js.map +1 -0
- package/dist/src/cli/commands/chunk-backfill.d.ts +13 -0
- package/dist/src/cli/commands/chunk-backfill.d.ts.map +1 -0
- package/dist/src/cli/commands/chunk-backfill.js +157 -0
- package/dist/src/cli/commands/chunk-backfill.js.map +1 -0
- package/dist/src/cli/commands/compact.d.ts +3 -0
- package/dist/src/cli/commands/compact.d.ts.map +1 -0
- package/dist/src/cli/commands/compact.js +70 -0
- package/dist/src/cli/commands/compact.js.map +1 -0
- package/dist/src/cli/commands/cursor-probe.d.ts +20 -0
- package/dist/src/cli/commands/cursor-probe.d.ts.map +1 -0
- package/dist/src/cli/commands/cursor-probe.js +162 -0
- package/dist/src/cli/commands/cursor-probe.js.map +1 -0
- package/dist/src/cli/commands/doctor.d.ts +6 -0
- package/dist/src/cli/commands/doctor.d.ts.map +1 -0
- package/dist/src/cli/commands/doctor.js +259 -0
- package/dist/src/cli/commands/doctor.js.map +1 -0
- package/dist/src/cli/commands/feedback.d.ts +34 -0
- package/dist/src/cli/commands/feedback.d.ts.map +1 -0
- package/dist/src/cli/commands/feedback.js +214 -0
- package/dist/src/cli/commands/feedback.js.map +1 -0
- package/dist/src/cli/commands/hooks-install.d.ts +66 -0
- package/dist/src/cli/commands/hooks-install.d.ts.map +1 -0
- package/dist/src/cli/commands/hooks-install.js +228 -0
- package/dist/src/cli/commands/hooks-install.js.map +1 -0
- package/dist/src/cli/commands/import.d.ts +19 -0
- package/dist/src/cli/commands/import.d.ts.map +1 -0
- package/dist/src/cli/commands/import.js +258 -0
- package/dist/src/cli/commands/import.js.map +1 -0
- package/dist/src/cli/commands/ingest.d.ts +3 -0
- package/dist/src/cli/commands/ingest.d.ts.map +1 -0
- package/dist/src/cli/commands/ingest.js +80 -0
- package/dist/src/cli/commands/ingest.js.map +1 -0
- package/dist/src/cli/commands/mcp-install.d.ts +65 -0
- package/dist/src/cli/commands/mcp-install.d.ts.map +1 -0
- package/dist/src/cli/commands/mcp-install.js +306 -0
- package/dist/src/cli/commands/mcp-install.js.map +1 -0
- package/dist/src/cli/commands/menubar.d.ts +127 -0
- package/dist/src/cli/commands/menubar.d.ts.map +1 -0
- package/dist/src/cli/commands/menubar.js +585 -0
- package/dist/src/cli/commands/menubar.js.map +1 -0
- package/dist/src/cli/commands/onboard-first-run.d.ts +5 -0
- package/dist/src/cli/commands/onboard-first-run.d.ts.map +1 -0
- package/dist/src/cli/commands/onboard-first-run.js +156 -0
- package/dist/src/cli/commands/onboard-first-run.js.map +1 -0
- package/dist/src/cli/commands/onboard.d.ts +336 -0
- package/dist/src/cli/commands/onboard.d.ts.map +1 -0
- package/dist/src/cli/commands/onboard.js +1873 -0
- package/dist/src/cli/commands/onboard.js.map +1 -0
- package/dist/src/cli/commands/rebuild.d.ts +12 -0
- package/dist/src/cli/commands/rebuild.d.ts.map +1 -0
- package/dist/src/cli/commands/rebuild.js +167 -0
- package/dist/src/cli/commands/rebuild.js.map +1 -0
- package/dist/src/cli/commands/reconcile.d.ts +3 -0
- package/dist/src/cli/commands/reconcile.d.ts.map +1 -0
- package/dist/src/cli/commands/reconcile.js +68 -0
- package/dist/src/cli/commands/reconcile.js.map +1 -0
- package/dist/src/cli/commands/reindex.d.ts +3 -0
- package/dist/src/cli/commands/reindex.d.ts.map +1 -0
- package/dist/src/cli/commands/reindex.js +66 -0
- package/dist/src/cli/commands/reindex.js.map +1 -0
- package/dist/src/cli/commands/review.d.ts +13 -0
- package/dist/src/cli/commands/review.d.ts.map +1 -0
- package/dist/src/cli/commands/review.js +401 -0
- package/dist/src/cli/commands/review.js.map +1 -0
- package/dist/src/cli/commands/save.d.ts +3 -0
- package/dist/src/cli/commands/save.d.ts.map +1 -0
- package/dist/src/cli/commands/save.js +111 -0
- package/dist/src/cli/commands/save.js.map +1 -0
- package/dist/src/cli/commands/search.d.ts +37 -0
- package/dist/src/cli/commands/search.d.ts.map +1 -0
- package/dist/src/cli/commands/search.js +118 -0
- package/dist/src/cli/commands/search.js.map +1 -0
- package/dist/src/cli/commands/setup.d.ts +30 -0
- package/dist/src/cli/commands/setup.d.ts.map +1 -0
- package/dist/src/cli/commands/setup.js +122 -0
- package/dist/src/cli/commands/setup.js.map +1 -0
- package/dist/src/cli/commands/stats.d.ts +3 -0
- package/dist/src/cli/commands/stats.d.ts.map +1 -0
- package/dist/src/cli/commands/stats.js +42 -0
- package/dist/src/cli/commands/stats.js.map +1 -0
- package/dist/src/cli/commands/status.d.ts +17 -0
- package/dist/src/cli/commands/status.d.ts.map +1 -0
- package/dist/src/cli/commands/status.js +206 -0
- package/dist/src/cli/commands/status.js.map +1 -0
- package/dist/src/cli/commands/token-issue.d.ts +3 -0
- package/dist/src/cli/commands/token-issue.d.ts.map +1 -0
- package/dist/src/cli/commands/token-issue.js +33 -0
- package/dist/src/cli/commands/token-issue.js.map +1 -0
- package/dist/src/cli/commands/triage.d.ts +3 -0
- package/dist/src/cli/commands/triage.d.ts.map +1 -0
- package/dist/src/cli/commands/triage.js +127 -0
- package/dist/src/cli/commands/triage.js.map +1 -0
- package/dist/src/cli/commands/uninstall.d.ts +85 -0
- package/dist/src/cli/commands/uninstall.d.ts.map +1 -0
- package/dist/src/cli/commands/uninstall.js +512 -0
- package/dist/src/cli/commands/uninstall.js.map +1 -0
- package/dist/src/cli/commands/update.d.ts +105 -0
- package/dist/src/cli/commands/update.d.ts.map +1 -0
- package/dist/src/cli/commands/update.js +559 -0
- package/dist/src/cli/commands/update.js.map +1 -0
- package/dist/src/cli/default-config-path.d.ts +15 -0
- package/dist/src/cli/default-config-path.d.ts.map +1 -0
- package/dist/src/cli/default-config-path.js +28 -0
- package/dist/src/cli/default-config-path.js.map +1 -0
- package/dist/src/cli/feedback/feedback-config.d.ts +67 -0
- package/dist/src/cli/feedback/feedback-config.d.ts.map +1 -0
- package/dist/src/cli/feedback/feedback-config.js +169 -0
- package/dist/src/cli/feedback/feedback-config.js.map +1 -0
- package/dist/src/cli/feedback/feedback-history.d.ts +11 -0
- package/dist/src/cli/feedback/feedback-history.d.ts.map +1 -0
- package/dist/src/cli/feedback/feedback-history.js +145 -0
- package/dist/src/cli/feedback/feedback-history.js.map +1 -0
- package/dist/src/cli/feedback/feedback-payload.d.ts +74 -0
- package/dist/src/cli/feedback/feedback-payload.d.ts.map +1 -0
- package/dist/src/cli/feedback/feedback-payload.js +10 -0
- package/dist/src/cli/feedback/feedback-payload.js.map +1 -0
- package/dist/src/cli/feedback/feedback-relay.d.ts +15 -0
- package/dist/src/cli/feedback/feedback-relay.d.ts.map +1 -0
- package/dist/src/cli/feedback/feedback-relay.js +47 -0
- package/dist/src/cli/feedback/feedback-relay.js.map +1 -0
- package/dist/src/cli/feedback/feedback-status.d.ts +11 -0
- package/dist/src/cli/feedback/feedback-status.d.ts.map +1 -0
- package/dist/src/cli/feedback/feedback-status.js +122 -0
- package/dist/src/cli/feedback/feedback-status.js.map +1 -0
- package/dist/src/cli/feedback/invite.d.ts +17 -0
- package/dist/src/cli/feedback/invite.d.ts.map +1 -0
- package/dist/src/cli/feedback/invite.js +73 -0
- package/dist/src/cli/feedback/invite.js.map +1 -0
- package/dist/src/cli/feedback/relay-secret-store.d.ts +32 -0
- package/dist/src/cli/feedback/relay-secret-store.d.ts.map +1 -0
- package/dist/src/cli/feedback/relay-secret-store.js +137 -0
- package/dist/src/cli/feedback/relay-secret-store.js.map +1 -0
- package/dist/src/cli/hooks-writers/claude-code-policy-script.d.ts +35 -0
- package/dist/src/cli/hooks-writers/claude-code-policy-script.d.ts.map +1 -0
- package/dist/src/cli/hooks-writers/claude-code-policy-script.js +122 -0
- package/dist/src/cli/hooks-writers/claude-code-policy-script.js.map +1 -0
- package/dist/src/cli/hooks-writers/claude-code.d.ts +63 -0
- package/dist/src/cli/hooks-writers/claude-code.d.ts.map +1 -0
- package/dist/src/cli/hooks-writers/claude-code.js +289 -0
- package/dist/src/cli/hooks-writers/claude-code.js.map +1 -0
- package/dist/src/cli/hooks-writers/codex.d.ts +16 -0
- package/dist/src/cli/hooks-writers/codex.d.ts.map +1 -0
- package/dist/src/cli/hooks-writers/codex.js +17 -0
- package/dist/src/cli/hooks-writers/codex.js.map +1 -0
- package/dist/src/cli/hooks-writers/errors.d.ts +16 -0
- package/dist/src/cli/hooks-writers/errors.d.ts.map +1 -0
- package/dist/src/cli/hooks-writers/errors.js +24 -0
- package/dist/src/cli/hooks-writers/errors.js.map +1 -0
- package/dist/src/cli/hooks-writers/index.d.ts +23 -0
- package/dist/src/cli/hooks-writers/index.d.ts.map +1 -0
- package/dist/src/cli/hooks-writers/index.js +34 -0
- package/dist/src/cli/hooks-writers/index.js.map +1 -0
- package/dist/src/cli/hooks-writers/state.d.ts +43 -0
- package/dist/src/cli/hooks-writers/state.d.ts.map +1 -0
- package/dist/src/cli/hooks-writers/state.js +225 -0
- package/dist/src/cli/hooks-writers/state.js.map +1 -0
- package/dist/src/cli/hooks-writers/types.d.ts +28 -0
- package/dist/src/cli/hooks-writers/types.d.ts.map +1 -0
- package/dist/src/cli/hooks-writers/types.js +8 -0
- package/dist/src/cli/hooks-writers/types.js.map +1 -0
- package/dist/src/cli/http-client.d.ts +128 -0
- package/dist/src/cli/http-client.d.ts.map +1 -0
- package/dist/src/cli/http-client.js +401 -0
- package/dist/src/cli/http-client.js.map +1 -0
- package/dist/src/cli/index.d.ts +4 -0
- package/dist/src/cli/index.d.ts.map +1 -0
- package/dist/src/cli/index.js +99 -0
- package/dist/src/cli/index.js.map +1 -0
- package/dist/src/cli/job-poller.d.ts +13 -0
- package/dist/src/cli/job-poller.d.ts.map +1 -0
- package/dist/src/cli/job-poller.js +29 -0
- package/dist/src/cli/job-poller.js.map +1 -0
- package/dist/src/cli/mcp-config-writers/codex-toml.d.ts +20 -0
- package/dist/src/cli/mcp-config-writers/codex-toml.d.ts.map +1 -0
- package/dist/src/cli/mcp-config-writers/codex-toml.js +918 -0
- package/dist/src/cli/mcp-config-writers/codex-toml.js.map +1 -0
- package/dist/src/cli/mcp-config-writers/earlier-name-restrictions.d.ts +11 -0
- package/dist/src/cli/mcp-config-writers/earlier-name-restrictions.d.ts.map +1 -0
- package/dist/src/cli/mcp-config-writers/earlier-name-restrictions.js +152 -0
- package/dist/src/cli/mcp-config-writers/earlier-name-restrictions.js.map +1 -0
- package/dist/src/cli/mcp-config-writers/errors.d.ts +17 -0
- package/dist/src/cli/mcp-config-writers/errors.d.ts.map +1 -0
- package/dist/src/cli/mcp-config-writers/errors.js +13 -0
- package/dist/src/cli/mcp-config-writers/errors.js.map +1 -0
- package/dist/src/cli/mcp-config-writers/index.d.ts +28 -0
- package/dist/src/cli/mcp-config-writers/index.d.ts.map +1 -0
- package/dist/src/cli/mcp-config-writers/index.js +70 -0
- package/dist/src/cli/mcp-config-writers/index.js.map +1 -0
- package/dist/src/cli/mcp-config-writers/json-config.d.ts +20 -0
- package/dist/src/cli/mcp-config-writers/json-config.d.ts.map +1 -0
- package/dist/src/cli/mcp-config-writers/json-config.js +301 -0
- package/dist/src/cli/mcp-config-writers/json-config.js.map +1 -0
- package/dist/src/cli/mcp-config-writers/left-in-folder.d.ts +18 -0
- package/dist/src/cli/mcp-config-writers/left-in-folder.d.ts.map +1 -0
- package/dist/src/cli/mcp-config-writers/left-in-folder.js +140 -0
- package/dist/src/cli/mcp-config-writers/left-in-folder.js.map +1 -0
- package/dist/src/cli/mcp-config-writers/redact.d.ts +28 -0
- package/dist/src/cli/mcp-config-writers/redact.d.ts.map +1 -0
- package/dist/src/cli/mcp-config-writers/redact.js +48 -0
- package/dist/src/cli/mcp-config-writers/redact.js.map +1 -0
- package/dist/src/cli/mcp-config-writers/types.d.ts +46 -0
- package/dist/src/cli/mcp-config-writers/types.d.ts.map +1 -0
- package/dist/src/cli/mcp-config-writers/types.js +5 -0
- package/dist/src/cli/mcp-config-writers/types.js.map +1 -0
- package/dist/src/cli/output.d.ts +8 -0
- package/dist/src/cli/output.d.ts.map +1 -0
- package/dist/src/cli/output.js +34 -0
- package/dist/src/cli/output.js.map +1 -0
- package/dist/src/cli/postinstall-menubar.d.ts +38 -0
- package/dist/src/cli/postinstall-menubar.d.ts.map +1 -0
- package/dist/src/cli/postinstall-menubar.js +139 -0
- package/dist/src/cli/postinstall-menubar.js.map +1 -0
- package/dist/src/cli/status/friend-header.d.ts +61 -0
- package/dist/src/cli/status/friend-header.d.ts.map +1 -0
- package/dist/src/cli/status/friend-header.js +727 -0
- package/dist/src/cli/status/friend-header.js.map +1 -0
- package/dist/src/cli/status/local-signals.d.ts +89 -0
- package/dist/src/cli/status/local-signals.d.ts.map +1 -0
- package/dist/src/cli/status/local-signals.js +194 -0
- package/dist/src/cli/status/local-signals.js.map +1 -0
- package/dist/src/cli/token.d.ts +37 -0
- package/dist/src/cli/token.d.ts.map +1 -0
- package/dist/src/cli/token.js +105 -0
- package/dist/src/cli/token.js.map +1 -0
- package/dist/src/cli/ui.d.ts +47 -0
- package/dist/src/cli/ui.d.ts.map +1 -0
- package/dist/src/cli/ui.js +166 -0
- package/dist/src/cli/ui.js.map +1 -0
- package/dist/src/cli/uninstall/mcp-uninstall.d.ts +33 -0
- package/dist/src/cli/uninstall/mcp-uninstall.d.ts.map +1 -0
- package/dist/src/cli/uninstall/mcp-uninstall.js +116 -0
- package/dist/src/cli/uninstall/mcp-uninstall.js.map +1 -0
- package/dist/src/config/loader.d.ts +9 -0
- package/dist/src/config/loader.d.ts.map +1 -0
- package/dist/src/config/loader.js +73 -0
- package/dist/src/config/loader.js.map +1 -0
- package/dist/src/config/schema.d.ts +956 -0
- package/dist/src/config/schema.d.ts.map +1 -0
- package/dist/src/config/schema.js +339 -0
- package/dist/src/config/schema.js.map +1 -0
- package/dist/src/diagnostics/claude-preflight.d.ts +35 -0
- package/dist/src/diagnostics/claude-preflight.d.ts.map +1 -0
- package/dist/src/diagnostics/claude-preflight.js +90 -0
- package/dist/src/diagnostics/claude-preflight.js.map +1 -0
- package/dist/src/diagnostics/codex-preflight.d.ts +43 -0
- package/dist/src/diagnostics/codex-preflight.d.ts.map +1 -0
- package/dist/src/diagnostics/codex-preflight.js +128 -0
- package/dist/src/diagnostics/codex-preflight.js.map +1 -0
- package/dist/src/diagnostics/doctor.d.ts +125 -0
- package/dist/src/diagnostics/doctor.d.ts.map +1 -0
- package/dist/src/diagnostics/doctor.js +450 -0
- package/dist/src/diagnostics/doctor.js.map +1 -0
- package/dist/src/diagnostics/install-layout.d.ts +40 -0
- package/dist/src/diagnostics/install-layout.d.ts.map +1 -0
- package/dist/src/diagnostics/install-layout.js +55 -0
- package/dist/src/diagnostics/install-layout.js.map +1 -0
- package/dist/src/diagnostics/memory-coverage.d.ts +54 -0
- package/dist/src/diagnostics/memory-coverage.d.ts.map +1 -0
- package/dist/src/diagnostics/memory-coverage.js +272 -0
- package/dist/src/diagnostics/memory-coverage.js.map +1 -0
- package/dist/src/diagnostics/notify.d.ts +107 -0
- package/dist/src/diagnostics/notify.d.ts.map +1 -0
- package/dist/src/diagnostics/notify.js +217 -0
- package/dist/src/diagnostics/notify.js.map +1 -0
- package/dist/src/diagnostics/repair-prompt.d.ts +49 -0
- package/dist/src/diagnostics/repair-prompt.d.ts.map +1 -0
- package/dist/src/diagnostics/repair-prompt.js +223 -0
- package/dist/src/diagnostics/repair-prompt.js.map +1 -0
- package/dist/src/ingestion/bulk-ingest.d.ts +11 -0
- package/dist/src/ingestion/bulk-ingest.d.ts.map +1 -0
- package/dist/src/ingestion/bulk-ingest.js +11 -0
- package/dist/src/ingestion/bulk-ingest.js.map +1 -0
- package/dist/src/ingestion/chunk-meta.d.ts +85 -0
- package/dist/src/ingestion/chunk-meta.d.ts.map +1 -0
- package/dist/src/ingestion/chunk-meta.js +167 -0
- package/dist/src/ingestion/chunk-meta.js.map +1 -0
- package/dist/src/ingestion/chunk-text.d.ts +39 -0
- package/dist/src/ingestion/chunk-text.d.ts.map +1 -0
- package/dist/src/ingestion/chunk-text.js +114 -0
- package/dist/src/ingestion/chunk-text.js.map +1 -0
- package/dist/src/ingestion/cursor/cursor-store.d.ts +177 -0
- package/dist/src/ingestion/cursor/cursor-store.d.ts.map +1 -0
- package/dist/src/ingestion/cursor/cursor-store.js +242 -0
- package/dist/src/ingestion/cursor/cursor-store.js.map +1 -0
- package/dist/src/ingestion/cursor/enrich-roots.d.ts +16 -0
- package/dist/src/ingestion/cursor/enrich-roots.d.ts.map +1 -0
- package/dist/src/ingestion/cursor/enrich-roots.js +22 -0
- package/dist/src/ingestion/cursor/enrich-roots.js.map +1 -0
- package/dist/src/ingestion/cursor/vscdb-reader.d.ts +32 -0
- package/dist/src/ingestion/cursor/vscdb-reader.d.ts.map +1 -0
- package/dist/src/ingestion/cursor/vscdb-reader.js +113 -0
- package/dist/src/ingestion/cursor/vscdb-reader.js.map +1 -0
- package/dist/src/ingestion/cursor/workspace-root.d.ts +96 -0
- package/dist/src/ingestion/cursor/workspace-root.d.ts.map +1 -0
- package/dist/src/ingestion/cursor/workspace-root.js +187 -0
- package/dist/src/ingestion/cursor/workspace-root.js.map +1 -0
- package/dist/src/ingestion/extractor.d.ts +16 -0
- package/dist/src/ingestion/extractor.d.ts.map +1 -0
- package/dist/src/ingestion/extractor.js +85 -0
- package/dist/src/ingestion/extractor.js.map +1 -0
- package/dist/src/ingestion/extractors/docx.d.ts +3 -0
- package/dist/src/ingestion/extractors/docx.d.ts.map +1 -0
- package/dist/src/ingestion/extractors/docx.js +20 -0
- package/dist/src/ingestion/extractors/docx.js.map +1 -0
- package/dist/src/ingestion/extractors/pdf.d.ts +3 -0
- package/dist/src/ingestion/extractors/pdf.d.ts.map +1 -0
- package/dist/src/ingestion/extractors/pdf.js +32 -0
- package/dist/src/ingestion/extractors/pdf.js.map +1 -0
- package/dist/src/ingestion/historical-campaign.d.ts +340 -0
- package/dist/src/ingestion/historical-campaign.d.ts.map +1 -0
- package/dist/src/ingestion/historical-campaign.js +1010 -0
- package/dist/src/ingestion/historical-campaign.js.map +1 -0
- package/dist/src/ingestion/ignored-paths.d.ts +20 -0
- package/dist/src/ingestion/ignored-paths.d.ts.map +1 -0
- package/dist/src/ingestion/ignored-paths.js +45 -0
- package/dist/src/ingestion/ignored-paths.js.map +1 -0
- package/dist/src/ingestion/inbox-core/conversation-fingerprint.d.ts +2 -0
- package/dist/src/ingestion/inbox-core/conversation-fingerprint.d.ts.map +1 -0
- package/dist/src/ingestion/inbox-core/conversation-fingerprint.js +27 -0
- package/dist/src/ingestion/inbox-core/conversation-fingerprint.js.map +1 -0
- package/dist/src/ingestion/inbox-core/conversation-key.d.ts +2 -0
- package/dist/src/ingestion/inbox-core/conversation-key.d.ts.map +1 -0
- package/dist/src/ingestion/inbox-core/conversation-key.js +31 -0
- package/dist/src/ingestion/inbox-core/conversation-key.js.map +1 -0
- package/dist/src/ingestion/inbox-core/extensions.d.ts +3 -0
- package/dist/src/ingestion/inbox-core/extensions.d.ts.map +1 -0
- package/dist/src/ingestion/inbox-core/extensions.js +16 -0
- package/dist/src/ingestion/inbox-core/extensions.js.map +1 -0
- package/dist/src/ingestion/inbox-core/idempotency.d.ts +2 -0
- package/dist/src/ingestion/inbox-core/idempotency.d.ts.map +1 -0
- package/dist/src/ingestion/inbox-core/idempotency.js +22 -0
- package/dist/src/ingestion/inbox-core/idempotency.js.map +1 -0
- package/dist/src/ingestion/inbox-core/index.d.ts +20 -0
- package/dist/src/ingestion/inbox-core/index.d.ts.map +1 -0
- package/dist/src/ingestion/inbox-core/index.js +20 -0
- package/dist/src/ingestion/inbox-core/index.js.map +1 -0
- package/dist/src/ingestion/inbox-core/source-detection.d.ts +2 -0
- package/dist/src/ingestion/inbox-core/source-detection.d.ts.map +1 -0
- package/dist/src/ingestion/inbox-core/source-detection.js +23 -0
- package/dist/src/ingestion/inbox-core/source-detection.js.map +1 -0
- package/dist/src/ingestion/inbox-core/source-sniffer.d.ts +11 -0
- package/dist/src/ingestion/inbox-core/source-sniffer.d.ts.map +1 -0
- package/dist/src/ingestion/inbox-core/source-sniffer.js +69 -0
- package/dist/src/ingestion/inbox-core/source-sniffer.js.map +1 -0
- package/dist/src/ingestion/inbox-core/zip-sniffer.d.ts +70 -0
- package/dist/src/ingestion/inbox-core/zip-sniffer.d.ts.map +1 -0
- package/dist/src/ingestion/inbox-core/zip-sniffer.js +161 -0
- package/dist/src/ingestion/inbox-core/zip-sniffer.js.map +1 -0
- package/dist/src/ingestion/inbox-watcher.d.ts +12 -0
- package/dist/src/ingestion/inbox-watcher.d.ts.map +1 -0
- package/dist/src/ingestion/inbox-watcher.js +83 -0
- package/dist/src/ingestion/inbox-watcher.js.map +1 -0
- package/dist/src/ingestion/indexer.d.ts +39 -0
- package/dist/src/ingestion/indexer.d.ts.map +1 -0
- package/dist/src/ingestion/indexer.js +111 -0
- package/dist/src/ingestion/indexer.js.map +1 -0
- package/dist/src/ingestion/metadata-extraction.d.ts +56 -0
- package/dist/src/ingestion/metadata-extraction.d.ts.map +1 -0
- package/dist/src/ingestion/metadata-extraction.js +151 -0
- package/dist/src/ingestion/metadata-extraction.js.map +1 -0
- package/dist/src/ingestion/parsers/chatgpt-web.d.ts +29 -0
- package/dist/src/ingestion/parsers/chatgpt-web.d.ts.map +1 -0
- package/dist/src/ingestion/parsers/chatgpt-web.js +100 -0
- package/dist/src/ingestion/parsers/chatgpt-web.js.map +1 -0
- package/dist/src/ingestion/parsers/claude-code-jsonl.d.ts +26 -0
- package/dist/src/ingestion/parsers/claude-code-jsonl.d.ts.map +1 -0
- package/dist/src/ingestion/parsers/claude-code-jsonl.js +125 -0
- package/dist/src/ingestion/parsers/claude-code-jsonl.js.map +1 -0
- package/dist/src/ingestion/parsers/claude-desktop-sessions.d.ts +17 -0
- package/dist/src/ingestion/parsers/claude-desktop-sessions.d.ts.map +1 -0
- package/dist/src/ingestion/parsers/claude-desktop-sessions.js +112 -0
- package/dist/src/ingestion/parsers/claude-desktop-sessions.js.map +1 -0
- package/dist/src/ingestion/parsers/claude-web.d.ts +24 -0
- package/dist/src/ingestion/parsers/claude-web.d.ts.map +1 -0
- package/dist/src/ingestion/parsers/claude-web.js +75 -0
- package/dist/src/ingestion/parsers/claude-web.js.map +1 -0
- package/dist/src/ingestion/parsers/codex-jsonl.d.ts +18 -0
- package/dist/src/ingestion/parsers/codex-jsonl.d.ts.map +1 -0
- package/dist/src/ingestion/parsers/codex-jsonl.js +150 -0
- package/dist/src/ingestion/parsers/codex-jsonl.js.map +1 -0
- package/dist/src/ingestion/parsers/gemini-web.d.ts +16 -0
- package/dist/src/ingestion/parsers/gemini-web.d.ts.map +1 -0
- package/dist/src/ingestion/parsers/gemini-web.js +170 -0
- package/dist/src/ingestion/parsers/gemini-web.js.map +1 -0
- package/dist/src/ingestion/parsers/grok-cli.d.ts +19 -0
- package/dist/src/ingestion/parsers/grok-cli.d.ts.map +1 -0
- package/dist/src/ingestion/parsers/grok-cli.js +126 -0
- package/dist/src/ingestion/parsers/grok-cli.js.map +1 -0
- package/dist/src/ingestion/parsers/grok-web.d.ts +40 -0
- package/dist/src/ingestion/parsers/grok-web.d.ts.map +1 -0
- package/dist/src/ingestion/parsers/grok-web.js +67 -0
- package/dist/src/ingestion/parsers/grok-web.js.map +1 -0
- package/dist/src/ingestion/parsers/turns.d.ts +36 -0
- package/dist/src/ingestion/parsers/turns.d.ts.map +1 -0
- package/dist/src/ingestion/parsers/turns.js +25 -0
- package/dist/src/ingestion/parsers/turns.js.map +1 -0
- package/dist/src/ingestion/parsers/types.d.ts +47 -0
- package/dist/src/ingestion/parsers/types.d.ts.map +1 -0
- package/dist/src/ingestion/parsers/types.js +26 -0
- package/dist/src/ingestion/parsers/types.js.map +1 -0
- package/dist/src/ingestion/report-cards.d.ts +75 -0
- package/dist/src/ingestion/report-cards.d.ts.map +1 -0
- package/dist/src/ingestion/report-cards.js +224 -0
- package/dist/src/ingestion/report-cards.js.map +1 -0
- package/dist/src/ingestion/scanner.d.ts +48 -0
- package/dist/src/ingestion/scanner.d.ts.map +1 -0
- package/dist/src/ingestion/scanner.js +131 -0
- package/dist/src/ingestion/scanner.js.map +1 -0
- package/dist/src/ingestion/skip-quarantine.d.ts +10 -0
- package/dist/src/ingestion/skip-quarantine.d.ts.map +1 -0
- package/dist/src/ingestion/skip-quarantine.js +35 -0
- package/dist/src/ingestion/skip-quarantine.js.map +1 -0
- package/dist/src/ingestion/staging.d.ts +109 -0
- package/dist/src/ingestion/staging.d.ts.map +1 -0
- package/dist/src/ingestion/staging.js +411 -0
- package/dist/src/ingestion/staging.js.map +1 -0
- package/dist/src/ingestion/watcher.d.ts +65 -0
- package/dist/src/ingestion/watcher.d.ts.map +1 -0
- package/dist/src/ingestion/watcher.js +182 -0
- package/dist/src/ingestion/watcher.js.map +1 -0
- package/dist/src/jobs/codex-override-handler.d.ts +3 -0
- package/dist/src/jobs/codex-override-handler.d.ts.map +1 -0
- package/dist/src/jobs/codex-override-handler.js +16 -0
- package/dist/src/jobs/codex-override-handler.js.map +1 -0
- package/dist/src/jobs/handlers/compact.d.ts +30 -0
- package/dist/src/jobs/handlers/compact.d.ts.map +1 -0
- package/dist/src/jobs/handlers/compact.js +360 -0
- package/dist/src/jobs/handlers/compact.js.map +1 -0
- package/dist/src/jobs/handlers/dedupe-conversations.d.ts +134 -0
- package/dist/src/jobs/handlers/dedupe-conversations.d.ts.map +1 -0
- package/dist/src/jobs/handlers/dedupe-conversations.js +371 -0
- package/dist/src/jobs/handlers/dedupe-conversations.js.map +1 -0
- package/dist/src/jobs/handlers/ingest.d.ts +13 -0
- package/dist/src/jobs/handlers/ingest.d.ts.map +1 -0
- package/dist/src/jobs/handlers/ingest.js +557 -0
- package/dist/src/jobs/handlers/ingest.js.map +1 -0
- package/dist/src/jobs/handlers/optimize.d.ts +11 -0
- package/dist/src/jobs/handlers/optimize.d.ts.map +1 -0
- package/dist/src/jobs/handlers/optimize.js +12 -0
- package/dist/src/jobs/handlers/optimize.js.map +1 -0
- package/dist/src/jobs/handlers/reconcile.d.ts +57 -0
- package/dist/src/jobs/handlers/reconcile.d.ts.map +1 -0
- package/dist/src/jobs/handlers/reconcile.js +685 -0
- package/dist/src/jobs/handlers/reconcile.js.map +1 -0
- package/dist/src/jobs/handlers/reindex.d.ts +38 -0
- package/dist/src/jobs/handlers/reindex.d.ts.map +1 -0
- package/dist/src/jobs/handlers/reindex.js +63 -0
- package/dist/src/jobs/handlers/reindex.js.map +1 -0
- package/dist/src/jobs/handlers/save.d.ts +10 -0
- package/dist/src/jobs/handlers/save.d.ts.map +1 -0
- package/dist/src/jobs/handlers/save.js +316 -0
- package/dist/src/jobs/handlers/save.js.map +1 -0
- package/dist/src/jobs/handlers/triage.d.ts +47 -0
- package/dist/src/jobs/handlers/triage.d.ts.map +1 -0
- package/dist/src/jobs/handlers/triage.js +95 -0
- package/dist/src/jobs/handlers/triage.js.map +1 -0
- package/dist/src/jobs/maintenance-scheduler.d.ts +30 -0
- package/dist/src/jobs/maintenance-scheduler.d.ts.map +1 -0
- package/dist/src/jobs/maintenance-scheduler.js +41 -0
- package/dist/src/jobs/maintenance-scheduler.js.map +1 -0
- package/dist/src/jobs/queue.d.ts +157 -0
- package/dist/src/jobs/queue.d.ts.map +1 -0
- package/dist/src/jobs/queue.js +759 -0
- package/dist/src/jobs/queue.js.map +1 -0
- package/dist/src/jobs/types.d.ts +53 -0
- package/dist/src/jobs/types.d.ts.map +1 -0
- package/dist/src/jobs/types.js +33 -0
- package/dist/src/jobs/types.js.map +1 -0
- package/dist/src/jobs/worker-entry.d.ts +10 -0
- package/dist/src/jobs/worker-entry.d.ts.map +1 -0
- package/dist/src/jobs/worker-entry.js +252 -0
- package/dist/src/jobs/worker-entry.js.map +1 -0
- package/dist/src/jobs/worker-process.d.ts +67 -0
- package/dist/src/jobs/worker-process.d.ts.map +1 -0
- package/dist/src/jobs/worker-process.js +227 -0
- package/dist/src/jobs/worker-process.js.map +1 -0
- package/dist/src/jobs/worker.d.ts +11 -0
- package/dist/src/jobs/worker.d.ts.map +1 -0
- package/dist/src/jobs/worker.js +14 -0
- package/dist/src/jobs/worker.js.map +1 -0
- package/dist/src/main.d.ts +2 -0
- package/dist/src/main.d.ts.map +1 -0
- package/dist/src/main.js +683 -0
- package/dist/src/main.js.map +1 -0
- package/dist/src/mcp/capture-diagnostics.d.ts +51 -0
- package/dist/src/mcp/capture-diagnostics.d.ts.map +1 -0
- package/dist/src/mcp/capture-diagnostics.js +127 -0
- package/dist/src/mcp/capture-diagnostics.js.map +1 -0
- package/dist/src/mcp/errors.d.ts +8 -0
- package/dist/src/mcp/errors.d.ts.map +1 -0
- package/dist/src/mcp/errors.js +69 -0
- package/dist/src/mcp/errors.js.map +1 -0
- package/dist/src/mcp/memory-diagnostics.d.ts +6 -0
- package/dist/src/mcp/memory-diagnostics.d.ts.map +1 -0
- package/dist/src/mcp/memory-diagnostics.js +51 -0
- package/dist/src/mcp/memory-diagnostics.js.map +1 -0
- package/dist/src/mcp/names.d.ts +48 -0
- package/dist/src/mcp/names.d.ts.map +1 -0
- package/dist/src/mcp/names.js +77 -0
- package/dist/src/mcp/names.js.map +1 -0
- package/dist/src/mcp/server.d.ts +19 -0
- package/dist/src/mcp/server.d.ts.map +1 -0
- package/dist/src/mcp/server.js +184 -0
- package/dist/src/mcp/server.js.map +1 -0
- package/dist/src/mcp/stdio.d.ts +2 -0
- package/dist/src/mcp/stdio.d.ts.map +1 -0
- package/dist/src/mcp/stdio.js +8 -0
- package/dist/src/mcp/stdio.js.map +1 -0
- package/dist/src/mcp/tools/context-pack.d.ts +35 -0
- package/dist/src/mcp/tools/context-pack.d.ts.map +1 -0
- package/dist/src/mcp/tools/context-pack.js +279 -0
- package/dist/src/mcp/tools/context-pack.js.map +1 -0
- package/dist/src/mcp/tools/conversations-search.d.ts +38 -0
- package/dist/src/mcp/tools/conversations-search.d.ts.map +1 -0
- package/dist/src/mcp/tools/conversations-search.js +79 -0
- package/dist/src/mcp/tools/conversations-search.js.map +1 -0
- package/dist/src/mcp/tools/evidence-feedback.d.ts +60 -0
- package/dist/src/mcp/tools/evidence-feedback.d.ts.map +1 -0
- package/dist/src/mcp/tools/evidence-feedback.js +62 -0
- package/dist/src/mcp/tools/evidence-feedback.js.map +1 -0
- package/dist/src/mcp/tools/log-outcome.d.ts +72 -0
- package/dist/src/mcp/tools/log-outcome.d.ts.map +1 -0
- package/dist/src/mcp/tools/log-outcome.js +59 -0
- package/dist/src/mcp/tools/log-outcome.js.map +1 -0
- package/dist/src/mcp/tools/open-evidence.d.ts +37 -0
- package/dist/src/mcp/tools/open-evidence.d.ts.map +1 -0
- package/dist/src/mcp/tools/open-evidence.js +72 -0
- package/dist/src/mcp/tools/open-evidence.js.map +1 -0
- package/dist/src/mcp/tools/save.d.ts +37 -0
- package/dist/src/mcp/tools/save.d.ts.map +1 -0
- package/dist/src/mcp/tools/save.js +65 -0
- package/dist/src/mcp/tools/save.js.map +1 -0
- package/dist/src/mcp/tools/search.d.ts +37 -0
- package/dist/src/mcp/tools/search.d.ts.map +1 -0
- package/dist/src/mcp/tools/search.js +95 -0
- package/dist/src/mcp/tools/search.js.map +1 -0
- package/dist/src/mcp/tools/status.d.ts +31 -0
- package/dist/src/mcp/tools/status.d.ts.map +1 -0
- package/dist/src/mcp/tools/status.js +63 -0
- package/dist/src/mcp/tools/status.js.map +1 -0
- package/dist/src/observability/coverage.d.ts +100 -0
- package/dist/src/observability/coverage.d.ts.map +1 -0
- package/dist/src/observability/coverage.js +178 -0
- package/dist/src/observability/coverage.js.map +1 -0
- package/dist/src/observability/embedding-events.d.ts +52 -0
- package/dist/src/observability/embedding-events.d.ts.map +1 -0
- package/dist/src/observability/embedding-events.js +149 -0
- package/dist/src/observability/embedding-events.js.map +1 -0
- package/dist/src/observability/index-events.d.ts +70 -0
- package/dist/src/observability/index-events.d.ts.map +1 -0
- package/dist/src/observability/index-events.js +148 -0
- package/dist/src/observability/index-events.js.map +1 -0
- package/dist/src/observability/onboarding-metric.d.ts +131 -0
- package/dist/src/observability/onboarding-metric.d.ts.map +1 -0
- package/dist/src/observability/onboarding-metric.js +352 -0
- package/dist/src/observability/onboarding-metric.js.map +1 -0
- package/dist/src/observability/retrieval-feedback.d.ts +82 -0
- package/dist/src/observability/retrieval-feedback.d.ts.map +1 -0
- package/dist/src/observability/retrieval-feedback.js +231 -0
- package/dist/src/observability/retrieval-feedback.js.map +1 -0
- package/dist/src/observability/rift-context.d.ts +53 -0
- package/dist/src/observability/rift-context.d.ts.map +1 -0
- package/dist/src/observability/rift-context.js +141 -0
- package/dist/src/observability/rift-context.js.map +1 -0
- package/dist/src/observability/staleness.d.ts +43 -0
- package/dist/src/observability/staleness.d.ts.map +1 -0
- package/dist/src/observability/staleness.js +74 -0
- package/dist/src/observability/staleness.js.map +1 -0
- package/dist/src/observability/tool-usage-stats.d.ts +139 -0
- package/dist/src/observability/tool-usage-stats.d.ts.map +1 -0
- package/dist/src/observability/tool-usage-stats.js +245 -0
- package/dist/src/observability/tool-usage-stats.js.map +1 -0
- package/dist/src/observability/tool-usage.d.ts +231 -0
- package/dist/src/observability/tool-usage.d.ts.map +1 -0
- package/dist/src/observability/tool-usage.js +489 -0
- package/dist/src/observability/tool-usage.js.map +1 -0
- package/dist/src/observability/version-check.d.ts +75 -0
- package/dist/src/observability/version-check.d.ts.map +1 -0
- package/dist/src/observability/version-check.js +198 -0
- package/dist/src/observability/version-check.js.map +1 -0
- package/dist/src/onboarding/capture-switch.d.ts +20 -0
- package/dist/src/onboarding/capture-switch.d.ts.map +1 -0
- package/dist/src/onboarding/capture-switch.js +52 -0
- package/dist/src/onboarding/capture-switch.js.map +1 -0
- package/dist/src/onboarding/daemon-control.d.ts +33 -0
- package/dist/src/onboarding/daemon-control.d.ts.map +1 -0
- package/dist/src/onboarding/daemon-control.js +92 -0
- package/dist/src/onboarding/daemon-control.js.map +1 -0
- package/dist/src/onboarding/env-file.d.ts +18 -0
- package/dist/src/onboarding/env-file.d.ts.map +1 -0
- package/dist/src/onboarding/env-file.js +89 -0
- package/dist/src/onboarding/env-file.js.map +1 -0
- package/dist/src/onboarding/search-by-meaning.d.ts +35 -0
- package/dist/src/onboarding/search-by-meaning.d.ts.map +1 -0
- package/dist/src/onboarding/search-by-meaning.js +163 -0
- package/dist/src/onboarding/search-by-meaning.js.map +1 -0
- package/dist/src/onboarding/setup-page.d.ts +7 -0
- package/dist/src/onboarding/setup-page.d.ts.map +1 -0
- package/dist/src/onboarding/setup-page.js +823 -0
- package/dist/src/onboarding/setup-page.js.map +1 -0
- package/dist/src/onboarding/setup-session.d.ts +22 -0
- package/dist/src/onboarding/setup-session.d.ts.map +1 -0
- package/dist/src/onboarding/setup-session.js +80 -0
- package/dist/src/onboarding/setup-session.js.map +1 -0
- package/dist/src/onboarding/setup-state.d.ts +117 -0
- package/dist/src/onboarding/setup-state.d.ts.map +1 -0
- package/dist/src/onboarding/setup-state.js +267 -0
- package/dist/src/onboarding/setup-state.js.map +1 -0
- package/dist/src/onboarding/voyage-validate.d.ts +22 -0
- package/dist/src/onboarding/voyage-validate.d.ts.map +1 -0
- package/dist/src/onboarding/voyage-validate.js +96 -0
- package/dist/src/onboarding/voyage-validate.js.map +1 -0
- package/dist/src/providers/anthropic-digest.d.ts +23 -0
- package/dist/src/providers/anthropic-digest.d.ts.map +1 -0
- package/dist/src/providers/anthropic-digest.js +91 -0
- package/dist/src/providers/anthropic-digest.js.map +1 -0
- package/dist/src/providers/basic-metadata-extraction.d.ts +60 -0
- package/dist/src/providers/basic-metadata-extraction.d.ts.map +1 -0
- package/dist/src/providers/basic-metadata-extraction.js +114 -0
- package/dist/src/providers/basic-metadata-extraction.js.map +1 -0
- package/dist/src/providers/claude-cli-metadata-extraction.d.ts +47 -0
- package/dist/src/providers/claude-cli-metadata-extraction.d.ts.map +1 -0
- package/dist/src/providers/claude-cli-metadata-extraction.js +130 -0
- package/dist/src/providers/claude-cli-metadata-extraction.js.map +1 -0
- package/dist/src/providers/claude-cli-runner.d.ts +92 -0
- package/dist/src/providers/claude-cli-runner.d.ts.map +1 -0
- package/dist/src/providers/claude-cli-runner.js +598 -0
- package/dist/src/providers/claude-cli-runner.js.map +1 -0
- package/dist/src/providers/claude-input-limit.d.ts +32 -0
- package/dist/src/providers/claude-input-limit.d.ts.map +1 -0
- package/dist/src/providers/claude-input-limit.js +32 -0
- package/dist/src/providers/claude-input-limit.js.map +1 -0
- package/dist/src/providers/codex-cli-digest.d.ts +12 -0
- package/dist/src/providers/codex-cli-digest.d.ts.map +1 -0
- package/dist/src/providers/codex-cli-digest.js +70 -0
- package/dist/src/providers/codex-cli-digest.js.map +1 -0
- package/dist/src/providers/codex-cli-metadata-extraction.d.ts +15 -0
- package/dist/src/providers/codex-cli-metadata-extraction.d.ts.map +1 -0
- package/dist/src/providers/codex-cli-metadata-extraction.js +78 -0
- package/dist/src/providers/codex-cli-metadata-extraction.js.map +1 -0
- package/dist/src/providers/codex-cli-model.d.ts +110 -0
- package/dist/src/providers/codex-cli-model.d.ts.map +1 -0
- package/dist/src/providers/codex-cli-model.js +338 -0
- package/dist/src/providers/codex-cli-model.js.map +1 -0
- package/dist/src/providers/codex-cli-runner.d.ts +70 -0
- package/dist/src/providers/codex-cli-runner.d.ts.map +1 -0
- package/dist/src/providers/codex-cli-runner.js +745 -0
- package/dist/src/providers/codex-cli-runner.js.map +1 -0
- package/dist/src/providers/codex-input-limit.d.ts +43 -0
- package/dist/src/providers/codex-input-limit.d.ts.map +1 -0
- package/dist/src/providers/codex-input-limit.js +70 -0
- package/dist/src/providers/codex-input-limit.js.map +1 -0
- package/dist/src/providers/conversation-generation.d.ts +21 -0
- package/dist/src/providers/conversation-generation.d.ts.map +1 -0
- package/dist/src/providers/conversation-generation.js +132 -0
- package/dist/src/providers/conversation-generation.js.map +1 -0
- package/dist/src/providers/ollama-embed.d.ts +23 -0
- package/dist/src/providers/ollama-embed.d.ts.map +1 -0
- package/dist/src/providers/ollama-embed.js +137 -0
- package/dist/src/providers/ollama-embed.js.map +1 -0
- package/dist/src/providers/ollama.d.ts +42 -0
- package/dist/src/providers/ollama.d.ts.map +1 -0
- package/dist/src/providers/ollama.js +169 -0
- package/dist/src/providers/ollama.js.map +1 -0
- package/dist/src/providers/openai-metadata-extraction.d.ts +120 -0
- package/dist/src/providers/openai-metadata-extraction.d.ts.map +1 -0
- package/dist/src/providers/openai-metadata-extraction.js +225 -0
- package/dist/src/providers/openai-metadata-extraction.js.map +1 -0
- package/dist/src/providers/operator-overrides.d.ts +24 -0
- package/dist/src/providers/operator-overrides.d.ts.map +1 -0
- package/dist/src/providers/operator-overrides.js +84 -0
- package/dist/src/providers/operator-overrides.js.map +1 -0
- package/dist/src/providers/placeholder-embed.d.ts +56 -0
- package/dist/src/providers/placeholder-embed.d.ts.map +1 -0
- package/dist/src/providers/placeholder-embed.js +64 -0
- package/dist/src/providers/placeholder-embed.js.map +1 -0
- package/dist/src/providers/shared-request.d.ts +22 -0
- package/dist/src/providers/shared-request.d.ts.map +1 -0
- package/dist/src/providers/shared-request.js +63 -0
- package/dist/src/providers/shared-request.js.map +1 -0
- package/dist/src/providers/stub.d.ts +19 -0
- package/dist/src/providers/stub.d.ts.map +1 -0
- package/dist/src/providers/stub.js +74 -0
- package/dist/src/providers/stub.js.map +1 -0
- package/dist/src/providers/types.d.ts +100 -0
- package/dist/src/providers/types.d.ts.map +1 -0
- package/dist/src/providers/types.js +63 -0
- package/dist/src/providers/types.js.map +1 -0
- package/dist/src/providers/voyage.d.ts +55 -0
- package/dist/src/providers/voyage.d.ts.map +1 -0
- package/dist/src/providers/voyage.js +179 -0
- package/dist/src/providers/voyage.js.map +1 -0
- package/dist/src/retrieval/brief.d.ts +26 -0
- package/dist/src/retrieval/brief.d.ts.map +1 -0
- package/dist/src/retrieval/brief.js +268 -0
- package/dist/src/retrieval/brief.js.map +1 -0
- package/dist/src/retrieval/canonical-files.d.ts +79 -0
- package/dist/src/retrieval/canonical-files.d.ts.map +1 -0
- package/dist/src/retrieval/canonical-files.js +432 -0
- package/dist/src/retrieval/canonical-files.js.map +1 -0
- package/dist/src/retrieval/compact.d.ts +306 -0
- package/dist/src/retrieval/compact.d.ts.map +1 -0
- package/dist/src/retrieval/compact.js +810 -0
- package/dist/src/retrieval/compact.js.map +1 -0
- package/dist/src/retrieval/context-pack.d.ts +344 -0
- package/dist/src/retrieval/context-pack.d.ts.map +1 -0
- package/dist/src/retrieval/context-pack.js +1483 -0
- package/dist/src/retrieval/context-pack.js.map +1 -0
- package/dist/src/retrieval/conversation-dedup.d.ts +54 -0
- package/dist/src/retrieval/conversation-dedup.d.ts.map +1 -0
- package/dist/src/retrieval/conversation-dedup.js +162 -0
- package/dist/src/retrieval/conversation-dedup.js.map +1 -0
- package/dist/src/retrieval/current-truth.d.ts +360 -0
- package/dist/src/retrieval/current-truth.d.ts.map +1 -0
- package/dist/src/retrieval/current-truth.js +766 -0
- package/dist/src/retrieval/current-truth.js.map +1 -0
- package/dist/src/retrieval/cwd.d.ts +25 -0
- package/dist/src/retrieval/cwd.d.ts.map +1 -0
- package/dist/src/retrieval/cwd.js +48 -0
- package/dist/src/retrieval/cwd.js.map +1 -0
- package/dist/src/retrieval/degraded.d.ts +20 -0
- package/dist/src/retrieval/degraded.d.ts.map +1 -0
- package/dist/src/retrieval/degraded.js +43 -0
- package/dist/src/retrieval/degraded.js.map +1 -0
- package/dist/src/retrieval/evidence-key.d.ts +48 -0
- package/dist/src/retrieval/evidence-key.d.ts.map +1 -0
- package/dist/src/retrieval/evidence-key.js +131 -0
- package/dist/src/retrieval/evidence-key.js.map +1 -0
- package/dist/src/retrieval/feedback-ranking.d.ts +49 -0
- package/dist/src/retrieval/feedback-ranking.d.ts.map +1 -0
- package/dist/src/retrieval/feedback-ranking.js +138 -0
- package/dist/src/retrieval/feedback-ranking.js.map +1 -0
- package/dist/src/retrieval/git-state.d.ts +62 -0
- package/dist/src/retrieval/git-state.d.ts.map +1 -0
- package/dist/src/retrieval/git-state.js +192 -0
- package/dist/src/retrieval/git-state.js.map +1 -0
- package/dist/src/retrieval/group-by-parent.d.ts +38 -0
- package/dist/src/retrieval/group-by-parent.d.ts.map +1 -0
- package/dist/src/retrieval/group-by-parent.js +40 -0
- package/dist/src/retrieval/group-by-parent.js.map +1 -0
- package/dist/src/retrieval/hybrid.d.ts +75 -0
- package/dist/src/retrieval/hybrid.d.ts.map +1 -0
- package/dist/src/retrieval/hybrid.js +151 -0
- package/dist/src/retrieval/hybrid.js.map +1 -0
- package/dist/src/retrieval/lexical.d.ts +33 -0
- package/dist/src/retrieval/lexical.d.ts.map +1 -0
- package/dist/src/retrieval/lexical.js +379 -0
- package/dist/src/retrieval/lexical.js.map +1 -0
- package/dist/src/retrieval/locator-boost.d.ts +37 -0
- package/dist/src/retrieval/locator-boost.d.ts.map +1 -0
- package/dist/src/retrieval/locator-boost.js +129 -0
- package/dist/src/retrieval/locator-boost.js.map +1 -0
- package/dist/src/retrieval/passages.d.ts +24 -0
- package/dist/src/retrieval/passages.d.ts.map +1 -0
- package/dist/src/retrieval/passages.js +160 -0
- package/dist/src/retrieval/passages.js.map +1 -0
- package/dist/src/retrieval/post-filter.d.ts +32 -0
- package/dist/src/retrieval/post-filter.d.ts.map +1 -0
- package/dist/src/retrieval/post-filter.js +57 -0
- package/dist/src/retrieval/post-filter.js.map +1 -0
- package/dist/src/retrieval/project-index.d.ts +71 -0
- package/dist/src/retrieval/project-index.d.ts.map +1 -0
- package/dist/src/retrieval/project-index.js +348 -0
- package/dist/src/retrieval/project-index.js.map +1 -0
- package/dist/src/retrieval/recall-hint.d.ts +22 -0
- package/dist/src/retrieval/recall-hint.d.ts.map +1 -0
- package/dist/src/retrieval/recall-hint.js +33 -0
- package/dist/src/retrieval/recall-hint.js.map +1 -0
- package/dist/src/retrieval/receipt.d.ts +57 -0
- package/dist/src/retrieval/receipt.d.ts.map +1 -0
- package/dist/src/retrieval/receipt.js +122 -0
- package/dist/src/retrieval/receipt.js.map +1 -0
- package/dist/src/retrieval/report-demotion.d.ts +46 -0
- package/dist/src/retrieval/report-demotion.d.ts.map +1 -0
- package/dist/src/retrieval/report-demotion.js +169 -0
- package/dist/src/retrieval/report-demotion.js.map +1 -0
- package/dist/src/retrieval/reranker.d.ts +119 -0
- package/dist/src/retrieval/reranker.d.ts.map +1 -0
- package/dist/src/retrieval/reranker.js +220 -0
- package/dist/src/retrieval/reranker.js.map +1 -0
- package/dist/src/retrieval/stitch-chunks.d.ts +76 -0
- package/dist/src/retrieval/stitch-chunks.d.ts.map +1 -0
- package/dist/src/retrieval/stitch-chunks.js +113 -0
- package/dist/src/retrieval/stitch-chunks.js.map +1 -0
- package/dist/src/retrieval/vector.d.ts +71 -0
- package/dist/src/retrieval/vector.d.ts.map +1 -0
- package/dist/src/retrieval/vector.js +147 -0
- package/dist/src/retrieval/vector.js.map +1 -0
- package/dist/src/runtime/legacy-migration.d.ts +27 -0
- package/dist/src/runtime/legacy-migration.d.ts.map +1 -0
- package/dist/src/runtime/legacy-migration.js +140 -0
- package/dist/src/runtime/legacy-migration.js.map +1 -0
- package/dist/src/runtime/legacy-name-guard.d.ts +35 -0
- package/dist/src/runtime/legacy-name-guard.d.ts.map +1 -0
- package/dist/src/runtime/legacy-name-guard.js +58 -0
- package/dist/src/runtime/legacy-name-guard.js.map +1 -0
- package/dist/src/runtime/rift-env.d.ts +14 -0
- package/dist/src/runtime/rift-env.d.ts.map +1 -0
- package/dist/src/runtime/rift-env.js +79 -0
- package/dist/src/runtime/rift-env.js.map +1 -0
- package/dist/src/runtime/voyage-key-source.d.ts +46 -0
- package/dist/src/runtime/voyage-key-source.d.ts.map +1 -0
- package/dist/src/runtime/voyage-key-source.js +97 -0
- package/dist/src/runtime/voyage-key-source.js.map +1 -0
- package/dist/src/runtime/watcher-startup.d.ts +2 -0
- package/dist/src/runtime/watcher-startup.d.ts.map +1 -0
- package/dist/src/runtime/watcher-startup.js +4 -0
- package/dist/src/runtime/watcher-startup.js.map +1 -0
- package/dist/src/security/archive.d.ts +23 -0
- package/dist/src/security/archive.d.ts.map +1 -0
- package/dist/src/security/archive.js +163 -0
- package/dist/src/security/archive.js.map +1 -0
- package/dist/src/security/paths.d.ts +21 -0
- package/dist/src/security/paths.d.ts.map +1 -0
- package/dist/src/security/paths.js +67 -0
- package/dist/src/security/paths.js.map +1 -0
- package/dist/src/server/app.d.ts +29 -0
- package/dist/src/server/app.d.ts.map +1 -0
- package/dist/src/server/app.js +356 -0
- package/dist/src/server/app.js.map +1 -0
- package/dist/src/server/build-info.d.ts +8 -0
- package/dist/src/server/build-info.d.ts.map +1 -0
- package/dist/src/server/build-info.js +61 -0
- package/dist/src/server/build-info.js.map +1 -0
- package/dist/src/server/lifecycle.d.ts +30 -0
- package/dist/src/server/lifecycle.d.ts.map +1 -0
- package/dist/src/server/lifecycle.js +59 -0
- package/dist/src/server/lifecycle.js.map +1 -0
- package/dist/src/server/middleware/multipart.d.ts +51 -0
- package/dist/src/server/middleware/multipart.d.ts.map +1 -0
- package/dist/src/server/middleware/multipart.js +86 -0
- package/dist/src/server/middleware/multipart.js.map +1 -0
- package/dist/src/server/routes/compact.d.ts +37 -0
- package/dist/src/server/routes/compact.d.ts.map +1 -0
- package/dist/src/server/routes/compact.js +80 -0
- package/dist/src/server/routes/compact.js.map +1 -0
- package/dist/src/server/routes/context.d.ts +12 -0
- package/dist/src/server/routes/context.d.ts.map +1 -0
- package/dist/src/server/routes/context.js +73 -0
- package/dist/src/server/routes/context.js.map +1 -0
- package/dist/src/server/routes/conversations-search.d.ts +4 -0
- package/dist/src/server/routes/conversations-search.d.ts.map +1 -0
- package/dist/src/server/routes/conversations-search.js +287 -0
- package/dist/src/server/routes/conversations-search.js.map +1 -0
- package/dist/src/server/routes/enqueue.d.ts +11 -0
- package/dist/src/server/routes/enqueue.d.ts.map +1 -0
- package/dist/src/server/routes/enqueue.js +17 -0
- package/dist/src/server/routes/enqueue.js.map +1 -0
- package/dist/src/server/routes/friend-status.d.ts +481 -0
- package/dist/src/server/routes/friend-status.d.ts.map +1 -0
- package/dist/src/server/routes/friend-status.js +675 -0
- package/dist/src/server/routes/friend-status.js.map +1 -0
- package/dist/src/server/routes/ingest.d.ts +15 -0
- package/dist/src/server/routes/ingest.d.ts.map +1 -0
- package/dist/src/server/routes/ingest.js +142 -0
- package/dist/src/server/routes/ingest.js.map +1 -0
- package/dist/src/server/routes/jobs.d.ts +10 -0
- package/dist/src/server/routes/jobs.d.ts.map +1 -0
- package/dist/src/server/routes/jobs.js +29 -0
- package/dist/src/server/routes/jobs.js.map +1 -0
- package/dist/src/server/routes/mcp-usage.d.ts +17 -0
- package/dist/src/server/routes/mcp-usage.d.ts.map +1 -0
- package/dist/src/server/routes/mcp-usage.js +17 -0
- package/dist/src/server/routes/mcp-usage.js.map +1 -0
- package/dist/src/server/routes/reconcile.d.ts +4 -0
- package/dist/src/server/routes/reconcile.d.ts.map +1 -0
- package/dist/src/server/routes/reconcile.js +62 -0
- package/dist/src/server/routes/reconcile.js.map +1 -0
- package/dist/src/server/routes/reindex.d.ts +4 -0
- package/dist/src/server/routes/reindex.d.ts.map +1 -0
- package/dist/src/server/routes/reindex.js +77 -0
- package/dist/src/server/routes/reindex.js.map +1 -0
- package/dist/src/server/routes/retrieval-feedback.d.ts +3 -0
- package/dist/src/server/routes/retrieval-feedback.d.ts.map +1 -0
- package/dist/src/server/routes/retrieval-feedback.js +290 -0
- package/dist/src/server/routes/retrieval-feedback.js.map +1 -0
- package/dist/src/server/routes/save.d.ts +52 -0
- package/dist/src/server/routes/save.d.ts.map +1 -0
- package/dist/src/server/routes/save.js +127 -0
- package/dist/src/server/routes/save.js.map +1 -0
- package/dist/src/server/routes/search.d.ts +5 -0
- package/dist/src/server/routes/search.d.ts.map +1 -0
- package/dist/src/server/routes/search.js +689 -0
- package/dist/src/server/routes/search.js.map +1 -0
- package/dist/src/server/routes/setup.d.ts +46 -0
- package/dist/src/server/routes/setup.d.ts.map +1 -0
- package/dist/src/server/routes/setup.js +322 -0
- package/dist/src/server/routes/setup.js.map +1 -0
- package/dist/src/server/routes/stats.d.ts +10 -0
- package/dist/src/server/routes/stats.d.ts.map +1 -0
- package/dist/src/server/routes/stats.js +15 -0
- package/dist/src/server/routes/stats.js.map +1 -0
- package/dist/src/server/routes/status.d.ts +20 -0
- package/dist/src/server/routes/status.d.ts.map +1 -0
- package/dist/src/server/routes/status.js +31 -0
- package/dist/src/server/routes/status.js.map +1 -0
- package/dist/src/server/routes/triage.d.ts +4 -0
- package/dist/src/server/routes/triage.d.ts.map +1 -0
- package/dist/src/server/routes/triage.js +97 -0
- package/dist/src/server/routes/triage.js.map +1 -0
- package/dist/src/server/save-quality.d.ts +21 -0
- package/dist/src/server/save-quality.d.ts.map +1 -0
- package/dist/src/server/save-quality.js +51 -0
- package/dist/src/server/save-quality.js.map +1 -0
- package/dist/src/server/serving-marker.d.ts +85 -0
- package/dist/src/server/serving-marker.d.ts.map +1 -0
- package/dist/src/server/serving-marker.js +226 -0
- package/dist/src/server/serving-marker.js.map +1 -0
- package/dist/src/storage/atomic.d.ts +8 -0
- package/dist/src/storage/atomic.d.ts.map +1 -0
- package/dist/src/storage/atomic.js +22 -0
- package/dist/src/storage/atomic.js.map +1 -0
- package/dist/src/storage/chunk-backfill.d.ts +39 -0
- package/dist/src/storage/chunk-backfill.d.ts.map +1 -0
- package/dist/src/storage/chunk-backfill.js +295 -0
- package/dist/src/storage/chunk-backfill.js.map +1 -0
- package/dist/src/storage/db.d.ts +15 -0
- package/dist/src/storage/db.d.ts.map +1 -0
- package/dist/src/storage/db.js +47 -0
- package/dist/src/storage/db.js.map +1 -0
- package/dist/src/storage/filter.d.ts +42 -0
- package/dist/src/storage/filter.d.ts.map +1 -0
- package/dist/src/storage/filter.js +70 -0
- package/dist/src/storage/filter.js.map +1 -0
- package/dist/src/storage/fts.d.ts +47 -0
- package/dist/src/storage/fts.d.ts.map +1 -0
- package/dist/src/storage/fts.js +86 -0
- package/dist/src/storage/fts.js.map +1 -0
- package/dist/src/storage/integrity.d.ts +11 -0
- package/dist/src/storage/integrity.d.ts.map +1 -0
- package/dist/src/storage/integrity.js +66 -0
- package/dist/src/storage/integrity.js.map +1 -0
- package/dist/src/storage/maintenance.d.ts +27 -0
- package/dist/src/storage/maintenance.d.ts.map +1 -0
- package/dist/src/storage/maintenance.js +66 -0
- package/dist/src/storage/maintenance.js.map +1 -0
- package/dist/src/storage/rebuild.d.ts +71 -0
- package/dist/src/storage/rebuild.d.ts.map +1 -0
- package/dist/src/storage/rebuild.js +605 -0
- package/dist/src/storage/rebuild.js.map +1 -0
- package/dist/src/storage/report-card-backfill.d.ts +20 -0
- package/dist/src/storage/report-card-backfill.d.ts.map +1 -0
- package/dist/src/storage/report-card-backfill.js +114 -0
- package/dist/src/storage/report-card-backfill.js.map +1 -0
- package/dist/src/storage/shadow-swap.d.ts +20 -0
- package/dist/src/storage/shadow-swap.d.ts.map +1 -0
- package/dist/src/storage/shadow-swap.js +163 -0
- package/dist/src/storage/shadow-swap.js.map +1 -0
- package/dist/src/storage/tables.d.ts +147 -0
- package/dist/src/storage/tables.d.ts.map +1 -0
- package/dist/src/storage/tables.js +290 -0
- package/dist/src/storage/tables.js.map +1 -0
- package/operator/swiftbar/render-menu.py +475 -0
- package/operator/swiftbar/rift.10s.sh +201 -0
- package/package.json +57 -3
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { TableName } from "../storage/tables.js";
|
|
2
|
+
import type { RankedResult } from "./reranker.js";
|
|
3
|
+
import type { SearchScope } from "./vector.js";
|
|
4
|
+
/**
|
|
5
|
+
* Whether a source table can ever hold a report (i.e. is a document table).
|
|
6
|
+
* Lets the route skip the source_path fetch entirely for conversation-only
|
|
7
|
+
* result sets.
|
|
8
|
+
*/
|
|
9
|
+
export declare function isReportCandidateTable(t: TableName): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* A ranked hit is a report iff it's a document (conversations/digests never
|
|
12
|
+
* are) whose source_path matches the shared snapshot/report classifier. The
|
|
13
|
+
* classifier only treats a `reports/` doc as generated when it sits under
|
|
14
|
+
* Onadit's own reports root (`selfReportsRoot`); see {@link isSnapshotPath}.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isReportHit(sourceTable: TableName, sourcePath: string | undefined, selfReportsRoot?: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Fetch `source_path` for the document-table rows in `ranked`. Conversations
|
|
19
|
+
* and digests are skipped — they can never be reports, so we don't pay for a
|
|
20
|
+
* lookup. Returns a map keyed by row id; ids with no row (or no path) are
|
|
21
|
+
* simply absent and treated as non-reports by the caller.
|
|
22
|
+
*/
|
|
23
|
+
export declare function fetchDocSourcePaths(ranked: readonly RankedResult[]): Promise<Map<string, string>>;
|
|
24
|
+
/**
|
|
25
|
+
* Like {@link fetchDocSourcePaths} but also pulls `metadata.title`. Used by the
|
|
26
|
+
* locator boost, which scores query overlap against path/slug/filename/title.
|
|
27
|
+
* Conversations and digests are skipped — a locator wants a file, not a
|
|
28
|
+
* conversation. Keep this projection narrow: the boost must never fetch or
|
|
29
|
+
* inspect document bodies.
|
|
30
|
+
*/
|
|
31
|
+
export declare function fetchDocFields(ranked: readonly RankedResult[]): Promise<Map<string, {
|
|
32
|
+
source_path?: string;
|
|
33
|
+
title?: string;
|
|
34
|
+
}>>;
|
|
35
|
+
/**
|
|
36
|
+
* Stable-reorder `ranked` so report/snapshot docs sort after all non-report
|
|
37
|
+
* hits, preserving relative order within each group. Applies to `scope:"all"`
|
|
38
|
+
* only; every other scope is a no-op. Scores are carried through unchanged.
|
|
39
|
+
*
|
|
40
|
+
* `isExempt` (optional) is the locator demotion-exception hook: a report for
|
|
41
|
+
* which `isExempt(id)` returns true is treated as kept (NOT demoted), because
|
|
42
|
+
* the query explicitly asked to locate that report. Omitting it preserves the
|
|
43
|
+
* exact prior behaviour — every report is demoted.
|
|
44
|
+
*/
|
|
45
|
+
export declare function demoteReports(ranked: readonly RankedResult[], sourcePathById: ReadonlyMap<string, string>, scope: SearchScope, selfReportsRoot?: string, isExempt?: (id: string) => boolean): RankedResult[];
|
|
46
|
+
//# sourceMappingURL=report-demotion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-demotion.d.ts","sourceRoot":"","sources":["../../../src/retrieval/report-demotion.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAQ/C;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,SAAS,GAAG,OAAO,CAE5D;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,WAAW,EAAE,SAAS,EACtB,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,eAAe,CAAC,EAAE,MAAM,GACvB,OAAO,CAET;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,SAAS,YAAY,EAAE,GAC9B,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAyB9B;AAED;;;;;;GAMG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,SAAS,YAAY,EAAE,GAC9B,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAoChE;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,SAAS,YAAY,EAAE,EAC/B,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EAC3C,KAAK,EAAE,WAAW,EAClB,eAAe,CAAC,EAAE,MAAM,EACxB,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,GACjC,YAAY,EAAE,CAehB"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Report-as-memory demotion for flat `onadit_search` (POST /search).
|
|
3
|
+
*
|
|
4
|
+
* The docs-vs-discussions retrieval eval showed generated reports/snapshots
|
|
5
|
+
* dominating default (`scope:"all"`) results — 42–62% of the top-10 on
|
|
6
|
+
* discussion-intent queries — burying conversations and trackers as if a
|
|
7
|
+
* frozen synthesis were current memory. This pushes report/snapshot docs
|
|
8
|
+
* BEHIND all non-report evidence in the default mixed surface.
|
|
9
|
+
*
|
|
10
|
+
* Deliberately narrow (the proven slice, not the whole experiment):
|
|
11
|
+
* - It is a STABLE REORDER. Scores are never changed — "all docs score
|
|
12
|
+
* worse" is explicitly NOT what this does. A report keeps its score and
|
|
13
|
+
* its relative order among other reports; it just sorts after non-report
|
|
14
|
+
* evidence of any score.
|
|
15
|
+
* - It reuses the EXISTING trust classifier ({@link isSnapshotPath}) — no
|
|
16
|
+
* second trust system. Generated-report detection is anchored there to
|
|
17
|
+
* Onadit's own reports root (`selfReportsRoot`), so a client's `reports/`
|
|
18
|
+
* folder is never demoted by path shape alone.
|
|
19
|
+
* - It applies to `scope:"all"` ONLY — the mixed-memory default where
|
|
20
|
+
* reports compete with conversations, which is the only surface the eval
|
|
21
|
+
* validated. Every explicit doc-like scope (`documents`, `clients`,
|
|
22
|
+
* `projects`) is a no-op: those are deliberate document searches where a
|
|
23
|
+
* report (incl. a client's own `reports/` folder) may be exactly what the
|
|
24
|
+
* asker wants, and we have no eval signal that demoting there is correct.
|
|
25
|
+
* - No named-report exception and no discussion/doc tiebreak: those were
|
|
26
|
+
* unproven (or, for the tiebreak, actively wrong for locator queries) in
|
|
27
|
+
* the eval and are intentionally left out.
|
|
28
|
+
*
|
|
29
|
+
* PR2 add-on: {@link demoteReports} takes an optional `isExempt(id)` hook that
|
|
30
|
+
* exempts a single field-matched report TARGET from demotion when a locator
|
|
31
|
+
* query explicitly asked to find it. The hook is supplied only by the flag-
|
|
32
|
+
* gated locator path in the route ({@link ../server/routes/search.ts}); omitted
|
|
33
|
+
* (the default), demotion behaves exactly as the proven slice above.
|
|
34
|
+
*/
|
|
35
|
+
import { isSnapshotPath } from "./current-truth.js";
|
|
36
|
+
import { getTable } from "../storage/tables.js";
|
|
37
|
+
const DOC_TABLES = ["structured_docs", "structured_docs_local"];
|
|
38
|
+
function isDocTable(t) {
|
|
39
|
+
return DOC_TABLES.includes(t);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Whether a source table can ever hold a report (i.e. is a document table).
|
|
43
|
+
* Lets the route skip the source_path fetch entirely for conversation-only
|
|
44
|
+
* result sets.
|
|
45
|
+
*/
|
|
46
|
+
export function isReportCandidateTable(t) {
|
|
47
|
+
return isDocTable(t);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* A ranked hit is a report iff it's a document (conversations/digests never
|
|
51
|
+
* are) whose source_path matches the shared snapshot/report classifier. The
|
|
52
|
+
* classifier only treats a `reports/` doc as generated when it sits under
|
|
53
|
+
* Onadit's own reports root (`selfReportsRoot`); see {@link isSnapshotPath}.
|
|
54
|
+
*/
|
|
55
|
+
export function isReportHit(sourceTable, sourcePath, selfReportsRoot) {
|
|
56
|
+
return isDocTable(sourceTable) && isSnapshotPath(sourcePath, selfReportsRoot);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Fetch `source_path` for the document-table rows in `ranked`. Conversations
|
|
60
|
+
* and digests are skipped — they can never be reports, so we don't pay for a
|
|
61
|
+
* lookup. Returns a map keyed by row id; ids with no row (or no path) are
|
|
62
|
+
* simply absent and treated as non-reports by the caller.
|
|
63
|
+
*/
|
|
64
|
+
export async function fetchDocSourcePaths(ranked) {
|
|
65
|
+
const byTable = new Map();
|
|
66
|
+
for (const r of ranked) {
|
|
67
|
+
if (!isDocTable(r.source_table))
|
|
68
|
+
continue;
|
|
69
|
+
const arr = byTable.get(r.source_table) ?? [];
|
|
70
|
+
arr.push(r.id);
|
|
71
|
+
byTable.set(r.source_table, arr);
|
|
72
|
+
}
|
|
73
|
+
const out = new Map();
|
|
74
|
+
for (const [table, ids] of byTable) {
|
|
75
|
+
if (ids.length === 0)
|
|
76
|
+
continue;
|
|
77
|
+
const quoted = ids.map((i) => `'${i.replace(/'/g, "''")}'`).join(",");
|
|
78
|
+
const rows = (await getTable(table)
|
|
79
|
+
.query()
|
|
80
|
+
.where(`id IN (${quoted})`)
|
|
81
|
+
.select(["id", "source_path"])
|
|
82
|
+
.limit(ids.length)
|
|
83
|
+
.toArray());
|
|
84
|
+
for (const row of rows) {
|
|
85
|
+
if (typeof row.id === "string" && typeof row.source_path === "string") {
|
|
86
|
+
out.set(row.id, row.source_path);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return out;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Like {@link fetchDocSourcePaths} but also pulls `metadata.title`. Used by the
|
|
94
|
+
* locator boost, which scores query overlap against path/slug/filename/title.
|
|
95
|
+
* Conversations and digests are skipped — a locator wants a file, not a
|
|
96
|
+
* conversation. Keep this projection narrow: the boost must never fetch or
|
|
97
|
+
* inspect document bodies.
|
|
98
|
+
*/
|
|
99
|
+
export async function fetchDocFields(ranked) {
|
|
100
|
+
const byTable = new Map();
|
|
101
|
+
for (const r of ranked) {
|
|
102
|
+
if (!isDocTable(r.source_table))
|
|
103
|
+
continue;
|
|
104
|
+
const arr = byTable.get(r.source_table) ?? [];
|
|
105
|
+
arr.push(r.id);
|
|
106
|
+
byTable.set(r.source_table, arr);
|
|
107
|
+
}
|
|
108
|
+
const out = new Map();
|
|
109
|
+
for (const [table, ids] of byTable) {
|
|
110
|
+
if (ids.length === 0)
|
|
111
|
+
continue;
|
|
112
|
+
const quoted = ids.map((i) => `'${i.replace(/'/g, "''")}'`).join(",");
|
|
113
|
+
const rows = (await getTable(table)
|
|
114
|
+
.query()
|
|
115
|
+
.where(`id IN (${quoted})`)
|
|
116
|
+
.select(["id", "source_path", "metadata"])
|
|
117
|
+
.limit(ids.length)
|
|
118
|
+
.toArray());
|
|
119
|
+
for (const row of rows) {
|
|
120
|
+
if (typeof row["id"] !== "string")
|
|
121
|
+
continue;
|
|
122
|
+
const entry = {};
|
|
123
|
+
if (typeof row["source_path"] === "string")
|
|
124
|
+
entry.source_path = row["source_path"];
|
|
125
|
+
let title;
|
|
126
|
+
const meta = row["metadata"];
|
|
127
|
+
if (typeof meta === "string") {
|
|
128
|
+
try {
|
|
129
|
+
title = JSON.parse(meta).title;
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
/* ignore malformed metadata */
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
if (title !== undefined)
|
|
136
|
+
entry.title = title;
|
|
137
|
+
out.set(row["id"], entry);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return out;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Stable-reorder `ranked` so report/snapshot docs sort after all non-report
|
|
144
|
+
* hits, preserving relative order within each group. Applies to `scope:"all"`
|
|
145
|
+
* only; every other scope is a no-op. Scores are carried through unchanged.
|
|
146
|
+
*
|
|
147
|
+
* `isExempt` (optional) is the locator demotion-exception hook: a report for
|
|
148
|
+
* which `isExempt(id)` returns true is treated as kept (NOT demoted), because
|
|
149
|
+
* the query explicitly asked to locate that report. Omitting it preserves the
|
|
150
|
+
* exact prior behaviour — every report is demoted.
|
|
151
|
+
*/
|
|
152
|
+
export function demoteReports(ranked, sourcePathById, scope, selfReportsRoot, isExempt) {
|
|
153
|
+
if (scope !== "all")
|
|
154
|
+
return [...ranked];
|
|
155
|
+
const kept = [];
|
|
156
|
+
const demoted = [];
|
|
157
|
+
for (const r of ranked) {
|
|
158
|
+
if (isReportHit(r.source_table, sourcePathById.get(r.id), selfReportsRoot) &&
|
|
159
|
+
!isExempt?.(r.id))
|
|
160
|
+
demoted.push(r);
|
|
161
|
+
else
|
|
162
|
+
kept.push(r);
|
|
163
|
+
}
|
|
164
|
+
// Fast path: nothing to move — return the original reference's contents.
|
|
165
|
+
if (demoted.length === 0)
|
|
166
|
+
return [...ranked];
|
|
167
|
+
return [...kept, ...demoted];
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=report-demotion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-demotion.js","sourceRoot":"","sources":["../../../src/retrieval/report-demotion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAKhD,MAAM,UAAU,GAAyB,CAAC,iBAAiB,EAAE,uBAAuB,CAAC,CAAC;AAEtF,SAAS,UAAU,CAAC,CAAY;IAC9B,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AAChC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,CAAY;IACjD,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC;AACvB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CACzB,WAAsB,EACtB,UAA8B,EAC9B,eAAwB;IAExB,OAAO,UAAU,CAAC,WAAW,CAAC,IAAI,cAAc,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;AAChF,CAAC;AAED;;;;;GAKG;AACH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C;YAEjB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;YACb,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IACD,yEAAyE;IACzE,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,CAAC,GAAG,MAAM,CAAC,CAAC;IAC7C,OAAO,CAAC,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deterministic reranking — PRD Section 6.2, plus a small freshness boost.
|
|
3
|
+
*
|
|
4
|
+
* score = (S_sim * 0.55) + (S_rec * 0.10) + (S_qual * 0.10)
|
|
5
|
+
* + (B_tier * 0.10) + (fixed neutral B_feed * 0.10)
|
|
6
|
+
* + (B_hyb * 0.05) + (B_fresh * 0.05)
|
|
7
|
+
*
|
|
8
|
+
* B_fresh is a short-horizon exponential decay (half-life ~14d) on top of
|
|
9
|
+
* S_rec's gentle long-horizon decay. Added after Slice 5 daily-use
|
|
10
|
+
* validation showed just-saved rows never surfaced in top-k even for
|
|
11
|
+
* their own unique phrases: the existing S_rec barely moves (flat across
|
|
12
|
+
* a month), so freshness couldn't break near-ties against older bulk.
|
|
13
|
+
* B_fresh is additive, bounded, decays to ~0 past 2 months — it nudges
|
|
14
|
+
* the write-back loop without overriding strong older matches.
|
|
15
|
+
*
|
|
16
|
+
* All factors are deterministic (no randomness).
|
|
17
|
+
*/
|
|
18
|
+
import type { TableName } from "../storage/tables.js";
|
|
19
|
+
import type { RetrievalMethod } from "./hybrid.js";
|
|
20
|
+
/**
|
|
21
|
+
* Weight of the B_feed term. Exported so the flag-gated retrieval-feedback
|
|
22
|
+
* post-pass ({@link applyFeedbackBoost}) can re-score by the SAME weight the
|
|
23
|
+
* composite uses — keeping "apply feedback as a post-pass" mathematically
|
|
24
|
+
* identical to "rerank with that B_feed".
|
|
25
|
+
*/
|
|
26
|
+
export declare const W_FEED_WEIGHT = 0.1;
|
|
27
|
+
/** Half-life (in days) of the short-horizon freshness decay. 14d so a row
|
|
28
|
+
* indexed within a week still carries most of the bump; past ~2 months
|
|
29
|
+
* B_fresh collapses to near-zero and effectively disappears. */
|
|
30
|
+
export declare const FRESH_HALF_LIFE_DAYS = 14;
|
|
31
|
+
export interface RerankCandidate {
|
|
32
|
+
id: string;
|
|
33
|
+
content: string;
|
|
34
|
+
/** Raw similarity score from vector search (0-1). 0 if lexical-only. */
|
|
35
|
+
raw_sim: number;
|
|
36
|
+
/** Raw BM25 score from lexical search (unnormalized). 0 if vector-only. */
|
|
37
|
+
raw_bm25: number;
|
|
38
|
+
source_table: TableName;
|
|
39
|
+
retrieval_method: RetrievalMethod;
|
|
40
|
+
/** ISO-8601 timestamp of when the item was indexed. */
|
|
41
|
+
indexed_at?: string;
|
|
42
|
+
/** Conversation quality: "high" | "medium" | "low". Absent for structured_docs. */
|
|
43
|
+
quality?: string;
|
|
44
|
+
/** Raw JSON-encoded topics array. Used by pre-rerank post-filter. */
|
|
45
|
+
topics?: string;
|
|
46
|
+
/** Raw JSON-encoded decisions array. Used by pre-rerank post-filter. */
|
|
47
|
+
decisions?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Shadow retrieval-feedback boost. Positive-only v0: 1.0 is neutral, values
|
|
50
|
+
* above 1.0 are computed from opened/cited evidence. Slice 15 exposes this
|
|
51
|
+
* factor for `rift why`; ranking integration is deferred to Slice 16.
|
|
52
|
+
*/
|
|
53
|
+
feedback_boost?: number;
|
|
54
|
+
}
|
|
55
|
+
export interface RankedResult {
|
|
56
|
+
id: string;
|
|
57
|
+
content: string;
|
|
58
|
+
score: number;
|
|
59
|
+
retrieval_method: RetrievalMethod;
|
|
60
|
+
source_table: TableName;
|
|
61
|
+
/** Breakdown of score factors (for debugging / golden-file tests). */
|
|
62
|
+
factors: ScoreFactors;
|
|
63
|
+
/** Raw BM25 score normalized by the max BM25 in the candidate set
|
|
64
|
+
* (0 when there was no lexical hit). Exposed so downstream filters
|
|
65
|
+
* like ContextPack's relevance floor can combine semantic and
|
|
66
|
+
* lexical signals — `factors.S_sim` alone drops to `raw_sim` for
|
|
67
|
+
* hybrid hits, which under-reports relevance when keyword overlap
|
|
68
|
+
* is the real signal. */
|
|
69
|
+
bm25_normalized: number;
|
|
70
|
+
}
|
|
71
|
+
export interface ScoreFactors {
|
|
72
|
+
S_sim: number;
|
|
73
|
+
S_rec: number;
|
|
74
|
+
S_qual: number;
|
|
75
|
+
B_tier: number;
|
|
76
|
+
B_feed: number;
|
|
77
|
+
B_hyb: number;
|
|
78
|
+
/** Short-horizon freshness boost in [0,1]; exp(-days / 14). */
|
|
79
|
+
B_fresh: number;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Rerank candidates using the PRD 6.2 deterministic formula.
|
|
83
|
+
*
|
|
84
|
+
* @param candidates - merged results from hybrid search
|
|
85
|
+
* @param now - reference timestamp for recency calculation (defaults to Date.now())
|
|
86
|
+
* @returns results sorted by final score descending
|
|
87
|
+
*/
|
|
88
|
+
export declare function rerank(candidates: RerankCandidate[], now?: number): RankedResult[];
|
|
89
|
+
export declare function clampFeedbackBoost(boost: number | undefined): number;
|
|
90
|
+
/**
|
|
91
|
+
* Apply retrieval-feedback boosts to an already-reranked set (Slice 16).
|
|
92
|
+
*
|
|
93
|
+
* `rerank()` deliberately uses a FIXED neutral B_feed term (`+ W_FEED`) so the
|
|
94
|
+
* shadow ledger never moves live ranking. This post-pass is how the gated
|
|
95
|
+
* feedback flag actually applies the learned boost — kept as a separate,
|
|
96
|
+
* flag-gated step so `rerank()` and its golden tests stay byte-for-byte the
|
|
97
|
+
* current behaviour.
|
|
98
|
+
*
|
|
99
|
+
* Why a post-pass is exact: the composite score is a SUM and B_feed appears in
|
|
100
|
+
* exactly one term (`B_feed * W_FEED`). Replacing the old factor `B_old` with a
|
|
101
|
+
* new `B_new` shifts the score by exactly `(B_new - B_old) * W_FEED` — identical
|
|
102
|
+
* to having reranked with `B_new` from the start. `B_old` is whatever the prior
|
|
103
|
+
* pass recorded in `factors.B_feed` (1.0 on the live search path, which never
|
|
104
|
+
* populates `feedback_boost`), so a neutral boost is a guaranteed no-op.
|
|
105
|
+
*
|
|
106
|
+
* Determinism / no-op safety: when no candidate's boost differs from its current
|
|
107
|
+
* factor (the cold-start / empty-ledger case), the input order is returned
|
|
108
|
+
* UNCHANGED — no re-score, no re-sort — so "feedback ranking on, no learned
|
|
109
|
+
* signal yet" is provably indistinguishable from "off".
|
|
110
|
+
*
|
|
111
|
+
* @param ranked - results from {@link rerank}, already sorted by score desc
|
|
112
|
+
* @param boostOf - the learned B_feed for a result, or undefined for neutral
|
|
113
|
+
* @returns the (possibly reordered) results + how many were actually boosted
|
|
114
|
+
*/
|
|
115
|
+
export declare function applyFeedbackBoost(ranked: readonly RankedResult[], boostOf: (r: Pick<RankedResult, "id" | "source_table">) => number | undefined): {
|
|
116
|
+
ranked: RankedResult[];
|
|
117
|
+
appliedCount: number;
|
|
118
|
+
};
|
|
119
|
+
//# sourceMappingURL=reranker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reranker.d.ts","sourceRoot":"","sources":["../../../src/retrieval/reranker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAUnD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,MAAS,CAAC;AAGpC;;iEAEiE;AACjE,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAqBvC,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,wEAAwE;IACxE,OAAO,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,SAAS,CA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IAAE,MAAM,EAAE,YAAY,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAkBlD"}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { isReportCardRowId } from "../ingestion/report-cards.js";
|
|
2
|
+
// --- Weights (PRD 6.2 + Slice 5 freshness boost) ---
|
|
3
|
+
const W_SIM = 0.55;
|
|
4
|
+
const W_REC = 0.10;
|
|
5
|
+
const W_QUAL = 0.10;
|
|
6
|
+
const W_TIER = 0.10;
|
|
7
|
+
const W_FEED = 0.10;
|
|
8
|
+
const W_HYB = 0.05;
|
|
9
|
+
/**
|
|
10
|
+
* Weight of the B_feed term. Exported so the flag-gated retrieval-feedback
|
|
11
|
+
* post-pass ({@link applyFeedbackBoost}) can re-score by the SAME weight the
|
|
12
|
+
* composite uses — keeping "apply feedback as a post-pass" mathematically
|
|
13
|
+
* identical to "rerank with that B_feed".
|
|
14
|
+
*/
|
|
15
|
+
export const W_FEED_WEIGHT = W_FEED;
|
|
16
|
+
/** Small additive boost for just-indexed rows; see B_fresh doc below. */
|
|
17
|
+
const W_FRESH = 0.05;
|
|
18
|
+
/** Half-life (in days) of the short-horizon freshness decay. 14d so a row
|
|
19
|
+
* indexed within a week still carries most of the bump; past ~2 months
|
|
20
|
+
* B_fresh collapses to near-zero and effectively disappears. */
|
|
21
|
+
export const FRESH_HALF_LIFE_DAYS = 14;
|
|
22
|
+
const FEEDBACK_MIN = 1.0;
|
|
23
|
+
const FEEDBACK_MAX = 1.25;
|
|
24
|
+
// --- Tier boosts (PRD 6.2 + assumptions A2) ---
|
|
25
|
+
const TIER_BOOST = {
|
|
26
|
+
conversations_hot: 1.0,
|
|
27
|
+
digests: 1.1,
|
|
28
|
+
conversations_cold: 0.7,
|
|
29
|
+
structured_docs: 1.0, // A2: same as hot
|
|
30
|
+
};
|
|
31
|
+
// --- Quality mapping ---
|
|
32
|
+
const QUALITY_SCORE = {
|
|
33
|
+
high: 1.0,
|
|
34
|
+
medium: 0.7,
|
|
35
|
+
low: 0.4,
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Rerank candidates using the PRD 6.2 deterministic formula.
|
|
39
|
+
*
|
|
40
|
+
* @param candidates - merged results from hybrid search
|
|
41
|
+
* @param now - reference timestamp for recency calculation (defaults to Date.now())
|
|
42
|
+
* @returns results sorted by final score descending
|
|
43
|
+
*/
|
|
44
|
+
export function rerank(candidates, now = Date.now()) {
|
|
45
|
+
// Compute max BM25 score across all candidates for normalization.
|
|
46
|
+
// Lexical-only candidates use normalized BM25 as S_sim so that
|
|
47
|
+
// stronger keyword matches score higher than weaker ones.
|
|
48
|
+
const maxBm25 = candidates.reduce((max, c) => Math.max(max, c.raw_bm25), 0);
|
|
49
|
+
// Keyword scores are put on the vector scale of this pool: the best keyword
|
|
50
|
+
// match scores like the best semantic match, not a flat 1.0 that no cosine
|
|
51
|
+
// similarity reaches (voyage-3-lite tops out near 0.7). Without that, once
|
|
52
|
+
// keyword search covers every row, a pile of older keyword matches buries a
|
|
53
|
+
// newer row that only vector search found. With no vector hits (no key, or
|
|
54
|
+
// the embedding was skipped) the scale is 1 and keyword ranking is unchanged.
|
|
55
|
+
const maxSim = candidates.reduce((max, c) => (c.retrieval_method === "lexical" ? max : Math.max(max, c.raw_sim)), 0);
|
|
56
|
+
const lexicalScale = maxSim > 0 ? Math.min(1, maxSim) : 1;
|
|
57
|
+
const ranked = candidates.map((c) => {
|
|
58
|
+
const factors = computeFactors(c, now, maxBm25, lexicalScale);
|
|
59
|
+
const score = factors.S_sim * W_SIM +
|
|
60
|
+
factors.S_rec * W_REC +
|
|
61
|
+
factors.S_qual * W_QUAL +
|
|
62
|
+
factors.B_tier * W_TIER +
|
|
63
|
+
W_FEED + // neutral baseline, preserving the historical fixed B_feed=1.0 term
|
|
64
|
+
factors.B_hyb * W_HYB +
|
|
65
|
+
factors.B_fresh * W_FRESH;
|
|
66
|
+
const bm25_normalized = maxBm25 > 0 ? Math.min(1, c.raw_bm25 / maxBm25) : 0;
|
|
67
|
+
return {
|
|
68
|
+
id: c.id,
|
|
69
|
+
content: c.content,
|
|
70
|
+
score,
|
|
71
|
+
retrieval_method: c.retrieval_method,
|
|
72
|
+
source_table: c.source_table,
|
|
73
|
+
factors,
|
|
74
|
+
bm25_normalized,
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
ranked.sort((a, b) => b.score - a.score);
|
|
78
|
+
return ranked;
|
|
79
|
+
}
|
|
80
|
+
function computeFactors(c, now, maxBm25, lexicalScale = 1) {
|
|
81
|
+
// S_sim: vector hits use cosine similarity (already [0,1]). Keyword hits use
|
|
82
|
+
// BM25 normalized by the pool max, scaled onto the pool's vector scale (see
|
|
83
|
+
// rerank). A hybrid hit takes the stronger of its two signals, so matching
|
|
84
|
+
// both ways never scores below matching by keyword alone.
|
|
85
|
+
const S_lex = maxBm25 > 0 ? Math.min(1, c.raw_bm25 / maxBm25) * lexicalScale : 0;
|
|
86
|
+
let S_sim;
|
|
87
|
+
if (c.retrieval_method === "lexical") {
|
|
88
|
+
S_sim = S_lex;
|
|
89
|
+
}
|
|
90
|
+
else if (c.retrieval_method === "hybrid") {
|
|
91
|
+
S_sim = Math.max(Math.max(0, Math.min(1, c.raw_sim)), S_lex);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
S_sim = Math.max(0, Math.min(1, c.raw_sim));
|
|
95
|
+
}
|
|
96
|
+
// beta.28 card guard (docs/10): a report index card is a short keyword-dense
|
|
97
|
+
// pointer, so its BM25 can spike on an incidental token (e.g. a path fragment
|
|
98
|
+
// in the summary) with ZERO semantic match. A lexical-only card (vector miss
|
|
99
|
+
// ⇒ raw_sim == 0) must NOT ride the BM25 normalization to a high S_sim and
|
|
100
|
+
// outrank semantically-matched discussions — that was the gate's one
|
|
101
|
+
// false-#1. Card-specific: real cards (vector/hybrid hits) keep their cosine
|
|
102
|
+
// S_sim, so locator coverage is untouched. Identified by the canonical
|
|
103
|
+
// `report_card:` id, the same marker the SQL retrieval exclusion uses.
|
|
104
|
+
const isCard = isReportCardRowId(c.id);
|
|
105
|
+
if (isCard && c.retrieval_method === "lexical") {
|
|
106
|
+
S_sim = 0;
|
|
107
|
+
}
|
|
108
|
+
// S_rec: recency score = 1 / (1 + days_since_indexed * 0.01)
|
|
109
|
+
const S_rec = computeRecency(c.indexed_at, now);
|
|
110
|
+
// S_qual: conversation quality; defaults to 1.0 for structured_docs (A1)
|
|
111
|
+
const S_qual = computeQuality(c.quality, c.source_table);
|
|
112
|
+
// B_tier: tier boost based on source table. Cards get NO document tier
|
|
113
|
+
// advantage — a pointer must not outrank a real answer on tier alone. Today
|
|
114
|
+
// structured_docs is already neutral (1.0 == conversations_hot), so this is a
|
|
115
|
+
// no-op guard that stays correct if the doc tier is ever raised.
|
|
116
|
+
const B_tier = isCard
|
|
117
|
+
? Math.min(TIER_BOOST[c.source_table] ?? 1.0, 1.0)
|
|
118
|
+
: (TIER_BOOST[c.source_table] ?? 1.0);
|
|
119
|
+
// B_feed: positive-only retrieval feedback. Cold start is exactly neutral.
|
|
120
|
+
const B_feed = clampFeedbackBoost(c.feedback_boost);
|
|
121
|
+
// B_hyb: 1.3 if found in both vector and lexical paths
|
|
122
|
+
const B_hyb = c.retrieval_method === "hybrid" ? 1.3 : 1.0;
|
|
123
|
+
// B_fresh: short-horizon additive freshness boost; see top-of-file doc.
|
|
124
|
+
const B_fresh = computeFreshness(c.indexed_at, now);
|
|
125
|
+
return { S_sim, S_rec, S_qual, B_tier, B_feed, B_hyb, B_fresh };
|
|
126
|
+
}
|
|
127
|
+
export function clampFeedbackBoost(boost) {
|
|
128
|
+
if (typeof boost !== "number" || Number.isNaN(boost))
|
|
129
|
+
return 1.0;
|
|
130
|
+
return Math.max(FEEDBACK_MIN, Math.min(FEEDBACK_MAX, boost));
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Apply retrieval-feedback boosts to an already-reranked set (Slice 16).
|
|
134
|
+
*
|
|
135
|
+
* `rerank()` deliberately uses a FIXED neutral B_feed term (`+ W_FEED`) so the
|
|
136
|
+
* shadow ledger never moves live ranking. This post-pass is how the gated
|
|
137
|
+
* feedback flag actually applies the learned boost — kept as a separate,
|
|
138
|
+
* flag-gated step so `rerank()` and its golden tests stay byte-for-byte the
|
|
139
|
+
* current behaviour.
|
|
140
|
+
*
|
|
141
|
+
* Why a post-pass is exact: the composite score is a SUM and B_feed appears in
|
|
142
|
+
* exactly one term (`B_feed * W_FEED`). Replacing the old factor `B_old` with a
|
|
143
|
+
* new `B_new` shifts the score by exactly `(B_new - B_old) * W_FEED` — identical
|
|
144
|
+
* to having reranked with `B_new` from the start. `B_old` is whatever the prior
|
|
145
|
+
* pass recorded in `factors.B_feed` (1.0 on the live search path, which never
|
|
146
|
+
* populates `feedback_boost`), so a neutral boost is a guaranteed no-op.
|
|
147
|
+
*
|
|
148
|
+
* Determinism / no-op safety: when no candidate's boost differs from its current
|
|
149
|
+
* factor (the cold-start / empty-ledger case), the input order is returned
|
|
150
|
+
* UNCHANGED — no re-score, no re-sort — so "feedback ranking on, no learned
|
|
151
|
+
* signal yet" is provably indistinguishable from "off".
|
|
152
|
+
*
|
|
153
|
+
* @param ranked - results from {@link rerank}, already sorted by score desc
|
|
154
|
+
* @param boostOf - the learned B_feed for a result, or undefined for neutral
|
|
155
|
+
* @returns the (possibly reordered) results + how many were actually boosted
|
|
156
|
+
*/
|
|
157
|
+
export function applyFeedbackBoost(ranked, boostOf) {
|
|
158
|
+
let appliedCount = 0;
|
|
159
|
+
const rescored = ranked.map((r) => {
|
|
160
|
+
const B_new = clampFeedbackBoost(boostOf(r));
|
|
161
|
+
const B_old = r.factors.B_feed;
|
|
162
|
+
if (B_new === B_old)
|
|
163
|
+
return r;
|
|
164
|
+
appliedCount += 1;
|
|
165
|
+
return {
|
|
166
|
+
...r,
|
|
167
|
+
score: r.score + (B_new - B_old) * W_FEED,
|
|
168
|
+
factors: { ...r.factors, B_feed: B_new },
|
|
169
|
+
};
|
|
170
|
+
});
|
|
171
|
+
// No effective boost → preserve the exact input order (no re-sort), so an
|
|
172
|
+
// empty/neutral ledger can never perturb ranking.
|
|
173
|
+
if (appliedCount === 0)
|
|
174
|
+
return { ranked: rescored, appliedCount };
|
|
175
|
+
rescored.sort((a, b) => b.score - a.score);
|
|
176
|
+
return { ranked: rescored, appliedCount };
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* B_fresh = exp(-daysSince / FRESH_HALF_LIFE_DAYS).
|
|
180
|
+
*
|
|
181
|
+
* Returns 0 (no boost) when `indexed_at` is missing or unparseable — that
|
|
182
|
+
* matches the "row has no freshness signal" case. The formula collapses to
|
|
183
|
+
* near-zero past ~2 months, so older rows see essentially no effect.
|
|
184
|
+
*/
|
|
185
|
+
function computeFreshness(indexedAt, now) {
|
|
186
|
+
if (!indexedAt)
|
|
187
|
+
return 0;
|
|
188
|
+
const indexedMs = new Date(indexedAt).getTime();
|
|
189
|
+
if (Number.isNaN(indexedMs))
|
|
190
|
+
return 0;
|
|
191
|
+
const daysSince = Math.max(0, (now - indexedMs) / (1000 * 60 * 60 * 24));
|
|
192
|
+
return Math.exp(-daysSince / FRESH_HALF_LIFE_DAYS);
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* S_rec = 1 / (1 + days_since_indexed * 0.01)
|
|
196
|
+
*
|
|
197
|
+
* If indexed_at is missing, returns 0.5 (neutral).
|
|
198
|
+
*/
|
|
199
|
+
function computeRecency(indexedAt, now) {
|
|
200
|
+
if (!indexedAt)
|
|
201
|
+
return 0.5;
|
|
202
|
+
const indexedMs = new Date(indexedAt).getTime();
|
|
203
|
+
if (Number.isNaN(indexedMs))
|
|
204
|
+
return 0.5;
|
|
205
|
+
const daysSince = Math.max(0, (now - indexedMs) / (1000 * 60 * 60 * 24));
|
|
206
|
+
return 1 / (1 + daysSince * 0.01);
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* S_qual: quality score from conversation metadata.
|
|
210
|
+
* Defaults to 1.0 for structured_docs (A1) and digests.
|
|
211
|
+
*/
|
|
212
|
+
function computeQuality(quality, sourceTable) {
|
|
213
|
+
if (sourceTable === "structured_docs" || sourceTable === "digests") {
|
|
214
|
+
return 1.0;
|
|
215
|
+
}
|
|
216
|
+
if (!quality)
|
|
217
|
+
return 1.0;
|
|
218
|
+
return QUALITY_SCORE[quality] ?? 1.0;
|
|
219
|
+
}
|
|
220
|
+
//# sourceMappingURL=reranker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reranker.js","sourceRoot":"","sources":["../../../src/retrieval/reranker.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,sDAAsD;AACtD,MAAM,KAAK,GAAG,IAAI,CAAC;AACnB,MAAM,KAAK,GAAG,IAAI,CAAC;AACnB,MAAM,MAAM,GAAG,IAAI,CAAC;AACpB,MAAM,MAAM,GAAG,IAAI,CAAC;AACpB,MAAM,MAAM,GAAG,IAAI,CAAC;AACpB,MAAM,KAAK,GAAG,IAAI,CAAC;AACnB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC;AACpC,yEAAyE;AACzE,MAAM,OAAO,GAAG,IAAI,CAAC;AACrB;;iEAEiE;AACjE,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AACvC,MAAM,YAAY,GAAG,GAAG,CAAC;AACzB,MAAM,YAAY,GAAG,IAAI,CAAC;AAE1B,iDAAiD;AACjD,MAAM,UAAU,GAA2B;IACzC,iBAAiB,EAAE,GAAG;IACtB,OAAO,EAAE,GAAG;IACZ,kBAAkB,EAAE,GAAG;IACvB,eAAe,EAAE,GAAG,EAAE,kBAAkB;CACzC,CAAC;AAEF,0BAA0B;AAC1B,MAAM,aAAa,GAA2B;IAC5C,IAAI,EAAE,GAAG;IACT,MAAM,EAAE,GAAG;IACX,GAAG,EAAE,GAAG;CACT,CAAC;AAyDF;;;;;;GAMG;A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AiB,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QACnE,OAAO,GAAG,CAAC;IACb,CAAC;IACD,IAAI,CAAC,OAAO;QAAE,OAAO,GAAG,CAAC;IACzB,OAAO,aAAa,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read-side reassembly of chunk siblings for the `expand` path.
|
|
3
|
+
*
|
|
4
|
+
* Index-time chunking seeds every chunk N+1 with an overlap tail copied from the
|
|
5
|
+
* end of chunk N (see `overlapTail` in `../ingestion/chunk-text.ts`): the start of
|
|
6
|
+
* one chunk literally duplicates a suffix of the previous one. Naively
|
|
7
|
+
* concatenating adjacent chunks would print that shared region twice and read as
|
|
8
|
+
* broken. `stitchChunkContents` joins an ordered run of chunks back together,
|
|
9
|
+
* removing the duplicated seam so each overlap region appears exactly once.
|
|
10
|
+
*
|
|
11
|
+
* Only contiguous index ranges are stitched (the `middle`/`full` expand windows
|
|
12
|
+
* are both contiguous). A genuine gap (a missing index — e.g. a partially-written
|
|
13
|
+
* set) is rendered with an explicit boundary marker rather than de-overlapped
|
|
14
|
+
* across, since non-adjacent chunks share no seam.
|
|
15
|
+
*
|
|
16
|
+
* Interior gaps fall out naturally (a missing index between two present ones).
|
|
17
|
+
* Edge gaps do not: chunks present for [1,2] of an expected [0,2] range have no
|
|
18
|
+
* absent index *between* siblings, so a caller that knows the expected range
|
|
19
|
+
* passes it via `expectedStart`/`expectedEnd` to render the missing leading or
|
|
20
|
+
* trailing section explicitly, instead of returning a partial body that reads as
|
|
21
|
+
* a whole one.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Maximum seam length searched when de-overlapping. The index-time overlap tail
|
|
25
|
+
* is bounded by `DEFAULT_CHUNK_OPTIONS.overlapChars` (216), so a real seam is
|
|
26
|
+
* always well under this; the cap is generous slack against future chunker
|
|
27
|
+
* tuning while keeping the longest-common-overlap scan cheap (≤ cap² char
|
|
28
|
+
* comparisons per seam). We take the LONGEST matching suffix/prefix so a real
|
|
29
|
+
* 216-char seam is removed in full; a coincidental longer match in prose is
|
|
30
|
+
* vanishingly unlikely and would only ever drop genuinely duplicated text.
|
|
31
|
+
*/
|
|
32
|
+
export declare const MAX_SEAM_OVERLAP_CHARS = 512;
|
|
33
|
+
export interface StitchChunk {
|
|
34
|
+
/** 0-based chunk ordinal within the parent set. */
|
|
35
|
+
index: number;
|
|
36
|
+
/** The chunk's stored content. */
|
|
37
|
+
content: string;
|
|
38
|
+
}
|
|
39
|
+
export interface StitchResult {
|
|
40
|
+
/** Reassembled, de-overlapped content. */
|
|
41
|
+
text: string;
|
|
42
|
+
/** How many chunk rows were combined into {@link text}. */
|
|
43
|
+
sectionsUsed: number;
|
|
44
|
+
/** True when one or more index gaps were bridged with a boundary marker. */
|
|
45
|
+
hasGaps: boolean;
|
|
46
|
+
/** Raw chunk offsets in the returned body, including de-overlapped seams. */
|
|
47
|
+
chunkStarts?: Map<number, number>;
|
|
48
|
+
}
|
|
49
|
+
export interface StitchOptions {
|
|
50
|
+
trackPositions?: boolean;
|
|
51
|
+
/** Longest seam searched when de-overlapping adjacent chunks. */
|
|
52
|
+
maxSeam?: number;
|
|
53
|
+
/**
|
|
54
|
+
* Lowest chunk index the caller expected in this run. When the lowest present
|
|
55
|
+
* index is greater, the leading section(s) are rendered as an explicit
|
|
56
|
+
* omission marker (an edge gap a between-siblings scan can't detect).
|
|
57
|
+
*/
|
|
58
|
+
expectedStart?: number;
|
|
59
|
+
/**
|
|
60
|
+
* Highest chunk index the caller expected in this run. When the highest
|
|
61
|
+
* present index is lower, the trailing section(s) are rendered as an explicit
|
|
62
|
+
* omission marker.
|
|
63
|
+
*/
|
|
64
|
+
expectedEnd?: number;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Stitch an ordered run of chunk siblings into one body, removing the duplicated
|
|
68
|
+
* overlap at each adjacent seam. Input need not be pre-sorted; duplicate indices
|
|
69
|
+
* keep the first occurrence. Returns the empty string for an empty input.
|
|
70
|
+
*
|
|
71
|
+
* Pass `expectedStart`/`expectedEnd` to also surface missing leading/trailing
|
|
72
|
+
* sections (edge gaps) as omission markers; without them only interior gaps are
|
|
73
|
+
* marked.
|
|
74
|
+
*/
|
|
75
|
+
export declare function stitchChunkContents(chunks: StitchChunk[], opts?: StitchOptions): StitchResult;
|
|
76
|
+
//# sourceMappingURL=stitch-chunks.d.ts.map
|