@remnic/core 9.69.56 → 9.69.58
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/dist/abort-error.d.ts +5 -6
- package/dist/abort-error.d.ts.map +1 -0
- package/dist/abstraction-nodes.d.ts +12 -13
- package/dist/abstraction-nodes.d.ts.map +1 -0
- package/dist/access-admin-ops-surface.d.ts +20 -153
- package/dist/access-admin-ops-surface.d.ts.map +1 -0
- package/dist/access-admin-ops-surface.js +65 -60
- package/dist/access-audit.d.ts +6 -10
- package/dist/access-audit.d.ts.map +1 -0
- package/dist/access-audit.js +2 -2
- package/dist/access-authorization-probe.d.ts +7 -152
- package/dist/access-authorization-probe.d.ts.map +1 -0
- package/dist/access-authorization-probe.js +66 -61
- package/dist/access-boundary.d.ts +156 -145
- package/dist/access-boundary.d.ts.map +1 -0
- package/dist/access-boundary.js +65 -60
- package/dist/access-citation-namespace.d.ts +3 -3
- package/dist/access-citation-namespace.d.ts.map +1 -0
- package/dist/access-citation.d.ts +6 -7
- package/dist/access-citation.d.ts.map +1 -0
- package/dist/access-cli.d.ts +7 -7
- package/dist/access-cli.d.ts.map +1 -0
- package/dist/access-cli.js +157 -152
- package/dist/access-cli.js.map +1 -1
- package/dist/access-coding-context-resolution.d.ts +4 -23
- package/dist/access-coding-context-resolution.d.ts.map +1 -0
- package/dist/access-errors.d.ts +57 -5
- package/dist/access-errors.d.ts.map +1 -0
- package/dist/access-errors.js +13 -3
- package/dist/access-extraction-force-flush.d.ts +5 -150
- package/dist/access-extraction-force-flush.d.ts.map +1 -0
- package/dist/access-extraction-force-flush.js +65 -60
- package/dist/access-health-types.d.ts +7 -30
- package/dist/access-health-types.d.ts.map +1 -0
- package/dist/access-http-briefing.d.ts +5 -150
- package/dist/access-http-briefing.d.ts.map +1 -0
- package/dist/access-http-briefing.js +66 -61
- package/dist/access-http-lcm-compaction.d.ts +12 -156
- package/dist/access-http-lcm-compaction.d.ts.map +1 -0
- package/dist/access-http-lifecycle-flush.d.ts +6 -150
- package/dist/access-http-lifecycle-flush.d.ts.map +1 -0
- package/dist/access-http-offline-stream.d.ts +6 -151
- package/dist/access-http-offline-stream.d.ts.map +1 -0
- package/dist/access-http-query.d.ts +6 -26
- package/dist/access-http-query.d.ts.map +1 -0
- package/dist/access-http-query.js +67 -62
- package/dist/access-http.d.ts +22 -189
- package/dist/access-http.d.ts.map +1 -0
- package/dist/access-http.js +93 -89
- package/dist/access-idempotency.d.ts +5 -5
- package/dist/access-idempotency.d.ts.map +1 -0
- package/dist/access-identity-continuity-surface.d.ts +4 -115
- package/dist/access-identity-continuity-surface.d.ts.map +1 -0
- package/dist/access-identity-continuity-surface.js +65 -60
- package/dist/access-lcm-surface.d.ts +5 -151
- package/dist/access-lcm-surface.d.ts.map +1 -0
- package/dist/access-lcm-surface.js +65 -60
- package/dist/access-mcp-admin-tools.d.ts +4 -5
- package/dist/access-mcp-admin-tools.d.ts.map +1 -0
- package/dist/access-mcp-output-schemas.d.ts +2 -3
- package/dist/access-mcp-output-schemas.d.ts.map +1 -0
- package/dist/access-mcp-output-schemas.js +1 -1
- package/dist/access-mcp-shared-context-tools.d.ts +3 -150
- package/dist/access-mcp-shared-context-tools.d.ts.map +1 -0
- package/dist/access-mcp-sse.d.ts +3 -5
- package/dist/access-mcp-sse.d.ts.map +1 -0
- package/dist/access-mcp-tool-names.d.ts +9 -10
- package/dist/access-mcp-tool-names.d.ts.map +1 -0
- package/dist/access-mcp.d.ts +178 -145
- package/dist/access-mcp.d.ts.map +1 -0
- package/dist/access-mcp.js +80 -76
- package/dist/access-memory-search-fanout.d.ts +18 -37
- package/dist/access-memory-search-fanout.d.ts.map +1 -0
- package/dist/access-memory-search-fanout.js +2 -2
- package/dist/access-namespace-preflight.d.ts +18 -22
- package/dist/access-namespace-preflight.d.ts.map +1 -0
- package/dist/access-namespace-preflight.js +65 -60
- package/dist/access-observe-helpers.d.ts +4 -5
- package/dist/access-observe-helpers.d.ts.map +1 -0
- package/dist/access-observe-transcript.d.ts +5 -115
- package/dist/access-observe-transcript.d.ts.map +1 -0
- package/dist/access-observe-write-category.d.ts +5 -42
- package/dist/access-observe-write-category.d.ts.map +1 -0
- package/dist/access-observe-write-category.js +7 -7
- package/dist/access-observe-write-surface.d.ts +6 -151
- package/dist/access-observe-write-surface.d.ts.map +1 -0
- package/dist/access-observe-write-surface.js +65 -60
- package/dist/access-offline-manifest.d.ts +10 -124
- package/dist/access-offline-manifest.d.ts.map +1 -0
- package/dist/access-offline-manifest.js +7 -7
- package/dist/access-operations-batch.d.ts +12 -2
- package/dist/access-operations-batch.d.ts.map +1 -0
- package/dist/access-operations-batch.js +69 -66
- package/dist/access-operations.d.ts +66 -188
- package/dist/access-operations.d.ts.map +1 -0
- package/dist/access-operations.js +76 -73
- package/dist/access-recall-concurrency.d.ts +11 -156
- package/dist/access-recall-concurrency.d.ts.map +1 -0
- package/dist/access-recall-concurrency.js +65 -60
- package/dist/access-recall-diagnostics.d.ts +64 -0
- package/dist/access-recall-diagnostics.d.ts.map +1 -0
- package/dist/access-recall-diagnostics.js +26 -0
- package/dist/access-recall-response.d.ts +7 -151
- package/dist/access-recall-response.d.ts.map +1 -0
- package/dist/access-recall-response.js +65 -60
- package/dist/access-recall-surface.d.ts +11 -152
- package/dist/access-recall-surface.d.ts.map +1 -0
- package/dist/access-recall-surface.js +65 -60
- package/dist/access-schema.d.ts +203 -221
- package/dist/access-schema.d.ts.map +1 -0
- package/dist/access-schema.js +3 -3
- package/dist/access-service-helpers.d.ts +33 -145
- package/dist/access-service-helpers.d.ts.map +1 -0
- package/dist/access-service.d.ts +1825 -145
- package/dist/access-service.d.ts.map +1 -0
- package/dist/access-service.js +65 -60
- package/dist/access-surface-catalog.d.ts +7 -154
- package/dist/access-surface-catalog.d.ts.map +1 -0
- package/dist/access-surface-catalog.js +69 -62
- package/dist/access-surface-catalog.js.map +1 -1
- package/dist/access-token-capabilities.d.ts +19 -22
- package/dist/access-token-capabilities.d.ts.map +1 -0
- package/dist/access-token-capabilities.js +2 -2
- package/dist/access-wearables-meetings-surface.d.ts +14 -54
- package/dist/access-wearables-meetings-surface.d.ts.map +1 -0
- package/dist/action-confidence.d.ts +19 -40
- package/dist/action-confidence.d.ts.map +1 -0
- package/dist/active-context-config.d.ts +7 -8
- package/dist/active-context-config.d.ts.map +1 -0
- package/dist/active-context-transform.d.ts +31 -33
- package/dist/active-context-transform.d.ts.map +1 -0
- package/dist/active-memory-bridge.d.ts +10 -28
- package/dist/active-memory-bridge.d.ts.map +1 -0
- package/dist/active-recall.d.ts +11 -30
- package/dist/active-recall.d.ts.map +1 -0
- package/dist/active-recall.js +23 -23
- package/dist/activity/config.d.ts +24 -0
- package/dist/activity/config.d.ts.map +1 -0
- package/dist/activity/digest.d.ts +15 -35
- package/dist/activity/digest.d.ts.map +1 -0
- package/dist/activity/dwell.d.ts +14 -0
- package/dist/activity/dwell.d.ts.map +1 -0
- package/dist/activity/from-ms.d.ts +7 -0
- package/dist/activity/from-ms.d.ts.map +1 -0
- package/dist/activity/heading-level.d.ts +15 -0
- package/dist/activity/heading-level.d.ts.map +1 -0
- package/dist/activity/heading-title.d.ts +15 -0
- package/dist/activity/heading-title.d.ts.map +1 -0
- package/dist/activity/index.d.ts +46 -0
- package/dist/activity/index.d.ts.map +1 -0
- package/dist/activity/journal-extract.d.ts +68 -0
- package/dist/activity/journal-extract.d.ts.map +1 -0
- package/dist/activity/journal-heading.d.ts +26 -0
- package/dist/activity/journal-heading.d.ts.map +1 -0
- package/dist/activity/journal-path.d.ts +9 -0
- package/dist/activity/journal-path.d.ts.map +1 -0
- package/dist/activity/journal-read.d.ts +31 -0
- package/dist/activity/journal-read.d.ts.map +1 -0
- package/dist/activity/journal-section.d.ts +17 -0
- package/dist/activity/journal-section.d.ts.map +1 -0
- package/dist/activity/journal-source.d.ts +25 -0
- package/dist/activity/journal-source.d.ts.map +1 -0
- package/dist/activity/journal-state.d.ts +21 -0
- package/dist/activity/journal-state.d.ts.map +1 -0
- package/dist/activity/journal-state.lock-worker.d.ts +2 -0
- package/dist/activity/journal-state.lock-worker.d.ts.map +1 -0
- package/dist/activity/journal-strip.d.ts +6 -0
- package/dist/activity/journal-strip.d.ts.map +1 -0
- package/dist/activity/journal-vault-prereq.d.ts +23 -0
- package/dist/activity/journal-vault-prereq.d.ts.map +1 -0
- package/dist/activity/journal-vault-provenance.d.ts +12 -0
- package/dist/activity/journal-vault-provenance.d.ts.map +1 -0
- package/dist/activity/journal-vault-read.d.ts +32 -0
- package/dist/activity/journal-vault-read.d.ts.map +1 -0
- package/dist/activity/journal.d.ts +29 -0
- package/dist/activity/journal.d.ts.map +1 -0
- package/dist/activity/memory-gen.d.ts +71 -0
- package/dist/activity/memory-gen.d.ts.map +1 -0
- package/dist/activity/pipeline.d.ts +44 -0
- package/dist/activity/pipeline.d.ts.map +1 -0
- package/dist/activity/privacy-delete-plan.d.ts +22 -0
- package/dist/activity/privacy-delete-plan.d.ts.map +1 -0
- package/dist/activity/privacy-enabled.d.ts +16 -0
- package/dist/activity/privacy-enabled.d.ts.map +1 -0
- package/dist/activity/privacy-gate-resolve.d.ts +17 -0
- package/dist/activity/privacy-gate-resolve.d.ts.map +1 -0
- package/dist/activity/privacy-keys.d.ts +8 -0
- package/dist/activity/privacy-keys.d.ts.map +1 -0
- package/dist/activity/privacy-redact.d.ts +13 -0
- package/dist/activity/privacy-redact.d.ts.map +1 -0
- package/dist/activity/privacy-status.d.ts +30 -0
- package/dist/activity/privacy-status.d.ts.map +1 -0
- package/dist/activity/privacy-window.d.ts +15 -0
- package/dist/activity/privacy-window.d.ts.map +1 -0
- package/dist/activity/privacy.d.ts +17 -0
- package/dist/activity/privacy.d.ts.map +1 -0
- package/dist/activity/reindex.d.ts +23 -0
- package/dist/activity/reindex.d.ts.map +1 -0
- package/dist/activity/retain-days.d.ts +8 -0
- package/dist/activity/retain-days.d.ts.map +1 -0
- package/dist/activity/runner.d.ts +100 -0
- package/dist/activity/runner.d.ts.map +1 -0
- package/dist/activity/scheduler.d.ts +90 -0
- package/dist/activity/scheduler.d.ts.map +1 -0
- package/dist/activity/source-client.d.ts +24 -0
- package/dist/activity/source-client.d.ts.map +1 -0
- package/dist/activity/store.d.ts +53 -0
- package/dist/activity/store.d.ts.map +1 -0
- package/dist/activity/sync-registration.d.ts +83 -0
- package/dist/activity/sync-registration.d.ts.map +1 -0
- package/dist/activity/timeline/analysis-batch-empty.d.ts +8 -0
- package/dist/activity/timeline/analysis-batch-empty.d.ts.map +1 -0
- package/dist/activity/timeline/analysis-batch.d.ts +12 -0
- package/dist/activity/timeline/analysis-batch.d.ts.map +1 -0
- package/dist/activity/timeline/analysis-claim.d.ts +14 -0
- package/dist/activity/timeline/analysis-claim.d.ts.map +1 -0
- package/dist/activity/timeline/analysis-dup.d.ts +8 -0
- package/dist/activity/timeline/analysis-dup.d.ts.map +1 -0
- package/dist/activity/timeline/analysis-empty.d.ts +8 -0
- package/dist/activity/timeline/analysis-empty.d.ts.map +1 -0
- package/dist/activity/timeline/analysis-evidence.d.ts +12 -0
- package/dist/activity/timeline/analysis-evidence.d.ts.map +1 -0
- package/dist/activity/timeline/analysis-failure.d.ts +19 -0
- package/dist/activity/timeline/analysis-failure.d.ts.map +1 -0
- package/dist/activity/timeline/analysis-max.d.ts +8 -0
- package/dist/activity/timeline/analysis-max.d.ts.map +1 -0
- package/dist/activity/timeline/analysis-metadata.d.ts +30 -0
- package/dist/activity/timeline/analysis-metadata.d.ts.map +1 -0
- package/dist/activity/timeline/analysis-order.d.ts +8 -0
- package/dist/activity/timeline/analysis-order.d.ts.map +1 -0
- package/dist/activity/timeline/analysis-overlap.d.ts +8 -0
- package/dist/activity/timeline/analysis-overlap.d.ts.map +1 -0
- package/dist/activity/timeline/analysis-prompt.d.ts +13 -0
- package/dist/activity/timeline/analysis-prompt.d.ts.map +1 -0
- package/dist/activity/timeline/analysis-provider.d.ts +84 -0
- package/dist/activity/timeline/analysis-provider.d.ts.map +1 -0
- package/dist/activity/timeline/analysis-run.d.ts +40 -0
- package/dist/activity/timeline/analysis-run.d.ts.map +1 -0
- package/dist/activity/timeline/analysis.d.ts +63 -0
- package/dist/activity/timeline/analysis.d.ts.map +1 -0
- package/dist/activity/timeline/build.d.ts +50 -0
- package/dist/activity/timeline/build.d.ts.map +1 -0
- package/dist/activity/timeline/categories.d.ts +27 -0
- package/dist/activity/timeline/categories.d.ts.map +1 -0
- package/dist/activity/timeline/classify.d.ts +20 -0
- package/dist/activity/timeline/classify.d.ts.map +1 -0
- package/dist/activity/timeline/corrections.d.ts +37 -0
- package/dist/activity/timeline/corrections.d.ts.map +1 -0
- package/dist/activity/timeline/index.d.ts +35 -0
- package/dist/activity/timeline/index.d.ts.map +1 -0
- package/dist/activity/timeline/journal-recap-persist.d.ts +14 -0
- package/dist/activity/timeline/journal-recap-persist.d.ts.map +1 -0
- package/dist/activity/timeline/journal-recap.d.ts +21 -0
- package/dist/activity/timeline/journal-recap.d.ts.map +1 -0
- package/dist/activity/timeline/publish-cli.d.ts +17 -0
- package/dist/activity/timeline/publish-cli.d.ts.map +1 -0
- package/dist/activity/timeline/query.d.ts +86 -0
- package/dist/activity/timeline/query.d.ts.map +1 -0
- package/dist/activity/timeline/recap-card-count.d.ts +7 -0
- package/dist/activity/timeline/recap-card-count.d.ts.map +1 -0
- package/dist/activity/timeline/recap-card-id.d.ts +14 -0
- package/dist/activity/timeline/recap-card-id.d.ts.map +1 -0
- package/dist/activity/timeline/recap-date.d.ts +15 -0
- package/dist/activity/timeline/recap-date.d.ts.map +1 -0
- package/dist/activity/timeline/recap-empty.d.ts +8 -0
- package/dist/activity/timeline/recap-empty.d.ts.map +1 -0
- package/dist/activity/timeline/recap-export-range.d.ts +55 -0
- package/dist/activity/timeline/recap-export-range.d.ts.map +1 -0
- package/dist/activity/timeline/recap-export.d.ts +48 -0
- package/dist/activity/timeline/recap-export.d.ts.map +1 -0
- package/dist/activity/timeline/recap-fallback.d.ts +47 -0
- package/dist/activity/timeline/recap-fallback.d.ts.map +1 -0
- package/dist/activity/timeline/recap-id.d.ts +8 -0
- package/dist/activity/timeline/recap-id.d.ts.map +1 -0
- package/dist/activity/timeline/recap-markdown.d.ts +15 -0
- package/dist/activity/timeline/recap-markdown.d.ts.map +1 -0
- package/dist/activity/timeline/recap-merge-edits.d.ts +24 -0
- package/dist/activity/timeline/recap-merge-edits.d.ts.map +1 -0
- package/dist/activity/timeline/recap-sort-key.d.ts +9 -0
- package/dist/activity/timeline/recap-sort-key.d.ts.map +1 -0
- package/dist/activity/timeline/recap-tz.d.ts +15 -0
- package/dist/activity/timeline/recap-tz.d.ts.map +1 -0
- package/dist/activity/timeline/recap-window.d.ts +19 -0
- package/dist/activity/timeline/recap-window.d.ts.map +1 -0
- package/dist/activity/timeline/regenerate.d.ts +84 -0
- package/dist/activity/timeline/regenerate.d.ts.map +1 -0
- package/dist/activity/timeline/types.d.ts +98 -0
- package/dist/activity/timeline/types.d.ts.map +1 -0
- package/dist/activity/timeline/week-config-hash.d.ts +13 -0
- package/dist/activity/timeline/week-config-hash.d.ts.map +1 -0
- package/dist/activity/timeline/week-count.d.ts +7 -0
- package/dist/activity/timeline/week-count.d.ts.map +1 -0
- package/dist/activity/timeline/week-dashboard.d.ts +79 -0
- package/dist/activity/timeline/week-dashboard.d.ts.map +1 -0
- package/dist/activity/timeline/week-days.d.ts +6 -0
- package/dist/activity/timeline/week-days.d.ts.map +1 -0
- package/dist/activity/timeline/week-export.d.ts +27 -0
- package/dist/activity/timeline/week-export.d.ts.map +1 -0
- package/dist/activity/timeline/week-iso.d.ts +16 -0
- package/dist/activity/timeline/week-iso.d.ts.map +1 -0
- package/dist/activity/timeline/week-monday.d.ts +3 -0
- package/dist/activity/timeline/week-monday.d.ts.map +1 -0
- package/dist/activity/timeline/week-previous.d.ts +39 -0
- package/dist/activity/timeline/week-previous.d.ts.map +1 -0
- package/dist/activity/timeline/week-range.d.ts +10 -0
- package/dist/activity/timeline/week-range.d.ts.map +1 -0
- package/dist/activity/timeline/week-recurring.d.ts +21 -0
- package/dist/activity/timeline/week-recurring.d.ts.map +1 -0
- package/dist/activity/timeline/week-snapshot.d.ts +17 -0
- package/dist/activity/timeline/week-snapshot.d.ts.map +1 -0
- package/dist/activity/timeline/week-span.d.ts +2 -0
- package/dist/activity/timeline/week-span.d.ts.map +1 -0
- package/dist/activity/timeline/week-sunday.d.ts +3 -0
- package/dist/activity/timeline/week-sunday.d.ts.map +1 -0
- package/dist/activity/timeline/weekly-persist.d.ts +18 -0
- package/dist/activity/timeline/weekly-persist.d.ts.map +1 -0
- package/dist/activity/timeline/weekly.d.ts +42 -0
- package/dist/activity/timeline/weekly.d.ts.map +1 -0
- package/dist/activity/to-ms.d.ts +7 -0
- package/dist/activity/to-ms.d.ts.map +1 -0
- package/dist/activity/types.d.ts +208 -0
- package/dist/activity/types.d.ts.map +1 -0
- package/dist/activity/vault-begin.d.ts +8 -0
- package/dist/activity/vault-begin.d.ts.map +1 -0
- package/dist/activity/vault-body-trim.d.ts +7 -0
- package/dist/activity/vault-body-trim.d.ts.map +1 -0
- package/dist/activity/vault-dry-run.d.ts +13 -0
- package/dist/activity/vault-dry-run.d.ts.map +1 -0
- package/dist/activity/vault-end.d.ts +8 -0
- package/dist/activity/vault-end.d.ts.map +1 -0
- package/dist/activity/vault-frontmatter.d.ts +41 -0
- package/dist/activity/vault-frontmatter.d.ts.map +1 -0
- package/dist/activity/vault-insert.d.ts +24 -0
- package/dist/activity/vault-insert.d.ts.map +1 -0
- package/dist/activity/vault-join.d.ts +2 -0
- package/dist/activity/vault-join.d.ts.map +1 -0
- package/dist/activity/vault-marker.d.ts +12 -0
- package/dist/activity/vault-marker.d.ts.map +1 -0
- package/dist/activity/vault-name-trim.d.ts +7 -0
- package/dist/activity/vault-name-trim.d.ts.map +1 -0
- package/dist/activity/vault-path.d.ts +20 -0
- package/dist/activity/vault-path.d.ts.map +1 -0
- package/dist/activity/vault-publish.d.ts +71 -0
- package/dist/activity/vault-publish.d.ts.map +1 -0
- package/dist/activity/vault-publisher.d.ts +58 -0
- package/dist/activity/vault-publisher.d.ts.map +1 -0
- package/dist/activity/vault-region-pair.d.ts +17 -0
- package/dist/activity/vault-region-pair.d.ts.map +1 -0
- package/dist/activity/vault-region.d.ts +24 -0
- package/dist/activity/vault-region.d.ts.map +1 -0
- package/dist/activity/vault-status.d.ts +32 -0
- package/dist/activity/vault-status.d.ts.map +1 -0
- package/dist/activity/vault-suffix.d.ts +7 -0
- package/dist/activity/vault-suffix.d.ts.map +1 -0
- package/dist/activity/vault-wikilink.d.ts +2 -0
- package/dist/activity/vault-wikilink.d.ts.map +1 -0
- package/dist/activity/window-order.d.ts +17 -0
- package/dist/activity/window-order.d.ts.map +1 -0
- package/dist/adapters/claude-code.d.ts +3 -5
- package/dist/adapters/claude-code.d.ts.map +1 -0
- package/dist/adapters/codex.d.ts +3 -5
- package/dist/adapters/codex.d.ts.map +1 -0
- package/dist/adapters/grok.d.ts +23 -0
- package/dist/adapters/grok.d.ts.map +1 -0
- package/dist/adapters/hermes.d.ts +3 -5
- package/dist/adapters/hermes.d.ts.map +1 -0
- package/dist/adapters/index.d.ts +9 -51
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/opencode.d.ts +22 -0
- package/dist/adapters/opencode.d.ts.map +1 -0
- package/dist/adapters/registry.d.ts +3 -5
- package/dist/adapters/registry.d.ts.map +1 -0
- package/dist/adapters/registry.js +2 -2
- package/dist/adapters/replit.d.ts +3 -5
- package/dist/adapters/replit.d.ts.map +1 -0
- package/dist/adapters/types.d.ts +5 -6
- package/dist/adapters/types.d.ts.map +1 -0
- package/dist/admin/admin-surfaces.d.ts +362 -0
- package/dist/admin/admin-surfaces.d.ts.map +1 -0
- package/dist/ambient-provenance.d.ts +10 -30
- package/dist/ambient-provenance.d.ts.map +1 -0
- package/dist/archive-mutation-version.d.ts +8 -9
- package/dist/archive-mutation-version.d.ts.map +1 -0
- package/dist/artifact-search.d.ts +5 -25
- package/dist/artifact-search.d.ts.map +1 -0
- package/dist/auto-sync-CWSZDLLW.js +1 -1
- package/dist/background-generation-config.d.ts +3 -4
- package/dist/background-generation-config.d.ts.map +1 -0
- package/dist/background-generation.d.ts +5 -24
- package/dist/background-generation.d.ts.map +1 -0
- package/dist/behavior-learner.d.ts +6 -25
- package/dist/behavior-learner.d.ts.map +1 -0
- package/dist/behavior-signals.d.ts +5 -24
- package/dist/behavior-signals.d.ts.map +1 -0
- package/dist/binary-lifecycle/backend.d.ts +46 -0
- package/dist/binary-lifecycle/backend.d.ts.map +1 -0
- package/dist/binary-lifecycle/index.d.ts +13 -0
- package/dist/binary-lifecycle/index.d.ts.map +1 -0
- package/dist/binary-lifecycle/manifest.d.ts +22 -0
- package/dist/binary-lifecycle/manifest.d.ts.map +1 -0
- package/dist/binary-lifecycle/pipeline.d.ts +33 -0
- package/dist/binary-lifecycle/pipeline.d.ts.map +1 -0
- package/dist/binary-lifecycle/scanner.d.ts +21 -0
- package/dist/binary-lifecycle/scanner.d.ts.map +1 -0
- package/dist/binary-lifecycle/types.d.ts +70 -0
- package/dist/binary-lifecycle/types.d.ts.map +1 -0
- package/dist/bootstrap.d.ts +6 -115
- package/dist/bootstrap.d.ts.map +1 -0
- package/dist/bounded-jsonl-state.d.ts +5 -5
- package/dist/bounded-jsonl-state.d.ts.map +1 -0
- package/dist/boxes.d.ts +9 -9
- package/dist/boxes.d.ts.map +1 -0
- package/dist/briefing-window.d.ts +8 -40
- package/dist/briefing-window.d.ts.map +1 -0
- package/dist/briefing.d.ts +28 -61
- package/dist/briefing.d.ts.map +1 -0
- package/dist/briefing.js +14 -14
- package/dist/buffer-surprise-report.d.ts +6 -26
- package/dist/buffer-surprise-report.d.ts.map +1 -0
- package/dist/buffer-surprise.d.ts +5 -6
- package/dist/buffer-surprise.d.ts.map +1 -0
- package/dist/buffer-turn-helpers.d.ts +32 -18
- package/dist/buffer-turn-helpers.d.ts.map +1 -0
- package/dist/buffer.d.ts +9 -41
- package/dist/buffer.d.ts.map +1 -0
- package/dist/buffer.js +3 -3
- package/dist/bulk-import/index.d.ts +4 -44
- package/dist/bulk-import/index.d.ts.map +1 -0
- package/dist/bulk-import/pipeline.d.ts +30 -0
- package/dist/bulk-import/pipeline.d.ts.map +1 -0
- package/dist/bulk-import/registry.d.ts +23 -0
- package/dist/bulk-import/registry.d.ts.map +1 -0
- package/dist/bulk-import/types.d.ts +83 -0
- package/dist/bulk-import/types.d.ts.map +1 -0
- package/dist/calibration.d.ts +14 -37
- package/dist/calibration.d.ts.map +1 -0
- package/dist/capabilities.d.ts +64 -84
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capsule-cli.d.ts +23 -24
- package/dist/capsule-cli.d.ts.map +1 -0
- package/dist/capsule-crypto-7FJQINUR.js +18 -0
- package/dist/causal-behavior.d.ts +9 -38
- package/dist/causal-behavior.d.ts.map +1 -0
- package/dist/causal-behavior.js +2 -2
- package/dist/causal-chain.d.ts +13 -17
- package/dist/causal-chain.d.ts.map +1 -0
- package/dist/causal-chain.js +2 -2
- package/dist/causal-consolidation.d.ts +10 -29
- package/dist/causal-consolidation.d.ts.map +1 -0
- package/dist/causal-consolidation.js +17 -17
- package/dist/causal-retrieval.d.ts +6 -11
- package/dist/causal-retrieval.d.ts.map +1 -0
- package/dist/causal-retrieval.js +2 -2
- package/dist/causal-trajectory-graph.d.ts +7 -29
- package/dist/causal-trajectory-graph.d.ts.map +1 -0
- package/dist/causal-trajectory-graph.js +2 -2
- package/dist/causal-trajectory.d.ts +23 -25
- package/dist/causal-trajectory.d.ts.map +1 -0
- package/dist/causal-trajectory.js +1 -1
- package/dist/census-validation.d.ts +5 -6
- package/dist/census-validation.d.ts.map +1 -0
- package/dist/chat/chat-cli.d.ts +38 -0
- package/dist/chat/chat-cli.d.ts.map +1 -0
- package/dist/chat/chat-config.d.ts +25 -0
- package/dist/chat/chat-config.d.ts.map +1 -0
- package/dist/chat/chat-engine.d.ts +82 -0
- package/dist/chat/chat-engine.d.ts.map +1 -0
- package/dist/chat/chat-executor.d.ts +26 -0
- package/dist/chat/chat-executor.d.ts.map +1 -0
- package/dist/chat/chat-factory.d.ts +46 -0
- package/dist/chat/chat-factory.d.ts.map +1 -0
- package/dist/chat/chat-http.d.ts +83 -0
- package/dist/chat/chat-http.d.ts.map +1 -0
- package/dist/chat/chat-llm.d.ts +77 -0
- package/dist/chat/chat-llm.d.ts.map +1 -0
- package/dist/chat/chat-session.d.ts +118 -0
- package/dist/chat/chat-session.d.ts.map +1 -0
- package/dist/chat/chat-system-prompt.d.ts +23 -0
- package/dist/chat/chat-system-prompt.d.ts.map +1 -0
- package/dist/chat/chat-tools.d.ts +22 -0
- package/dist/chat/chat-tools.d.ts.map +1 -0
- package/dist/chat/chat-types.d.ts +134 -0
- package/dist/chat/chat-types.d.ts.map +1 -0
- package/dist/chunk-2CBWEIS4.js +1286 -0
- package/dist/chunk-2JQZSQXI.js +81 -0
- package/dist/chunk-2KHIBLO5.js +33 -0
- package/dist/chunk-2KHIBLO5.js.map +1 -0
- package/dist/chunk-2NLLXCJG.js +112 -0
- package/dist/chunk-2WMXZYMS.js +25 -0
- package/dist/chunk-34ZGBAGE.js +61 -0
- package/dist/chunk-36S7UHAW.js +623 -0
- package/dist/chunk-3JLWSFTV.js +801 -0
- package/dist/chunk-3MUKQQ7A.js +157 -0
- package/dist/chunk-3MUKQQ7A.js.map +1 -0
- package/dist/chunk-3RZOLUZT.js +140 -0
- package/dist/chunk-3SL52JKD.js +160 -0
- package/dist/chunk-4ALOINQ4.js +18512 -0
- package/dist/chunk-4ALOINQ4.js.map +1 -0
- package/dist/chunk-4QEZS7PK.js +502 -0
- package/dist/chunk-52VL6LCY.js +648 -0
- package/dist/chunk-52VL6LCY.js.map +1 -0
- package/dist/chunk-5HFVWYHL.js +111 -0
- package/dist/chunk-5HFVWYHL.js.map +1 -0
- package/dist/chunk-5QRYGLZN.js +35 -0
- package/dist/chunk-5R3C5LEZ.js +263 -0
- package/dist/chunk-634UKELB.js +77 -0
- package/dist/chunk-64JK4TL7.js +801 -0
- package/dist/chunk-6E5GYDIE.js +141 -0
- package/dist/chunk-6ISP2EN2.js +51 -0
- package/dist/chunk-6RD7MSIO.js +212 -0
- package/dist/chunk-6UDLN4IA.js +70 -0
- package/dist/chunk-754XN6LX.js +256 -0
- package/dist/chunk-7H2LEYYJ.js +256 -0
- package/dist/chunk-A7AISUJI.js +103 -0
- package/dist/chunk-AULKCNZW.js +727 -0
- package/dist/chunk-B7SSU55V.js +1686 -0
- package/dist/chunk-BICNRVEC.js +224 -0
- package/dist/chunk-BJI2D4SU.js +53 -0
- package/dist/chunk-BQB5ZMYO.js +28 -0
- package/dist/chunk-BSDBDFKZ.js +168 -0
- package/dist/chunk-BSDBDFKZ.js.map +1 -0
- package/dist/chunk-C5CPYMLX.js +315 -0
- package/dist/chunk-C6LRFPZL.js +4007 -0
- package/dist/chunk-C6LRFPZL.js.map +1 -0
- package/dist/chunk-CS2JO77A.js +95 -0
- package/dist/chunk-DTABICJ3.js +549 -0
- package/dist/chunk-DXODYQ7J.js +319 -0
- package/dist/chunk-DXODYQ7J.js.map +1 -0
- package/dist/chunk-E6UNM67F.js +432 -0
- package/dist/chunk-ENUI3IO7.js +271 -0
- package/dist/chunk-FF2XYADH.js +1084 -0
- package/dist/chunk-FF6N7BXC.js +389 -0
- package/dist/chunk-FNQEXI3D.js +22 -0
- package/dist/chunk-FNQEXI3D.js.map +1 -0
- package/dist/chunk-FSXD6Y4H.js +203 -0
- package/dist/chunk-GK6NOQE6.js +3400 -0
- package/dist/chunk-GRSFFLUY.js +43 -0
- package/dist/chunk-GWK7FEUL.js +761 -0
- package/dist/chunk-GWQVMKUJ.js +218 -0
- package/dist/chunk-H7O5L2IQ.js +3560 -0
- package/dist/chunk-H7O5L2IQ.js.map +1 -0
- package/dist/chunk-HKHZWJ3E.js +63 -0
- package/dist/chunk-IAZPYX6W.js +182 -0
- package/dist/chunk-IG747LRN.js +189 -0
- package/dist/chunk-IK63WA5A.js +30 -0
- package/dist/chunk-IRGQYQQ7.js +143 -0
- package/dist/chunk-IRGQYQQ7.js.map +1 -0
- package/dist/chunk-IUD6NLNM.js +24 -0
- package/dist/chunk-JSJZ2NXS.js +9782 -0
- package/dist/chunk-JUOJGZPV.js +566 -0
- package/dist/chunk-KA4U5GQN.js +960 -0
- package/dist/chunk-KQAFEZQX.js +264 -0
- package/dist/chunk-L4WBADKG.js +72 -0
- package/dist/chunk-LAL4B37X.js +275 -0
- package/dist/chunk-LELJRLPY.js +253 -0
- package/dist/chunk-LMMQKZK3.js +403 -0
- package/dist/chunk-LQ23DMTT.js +74 -0
- package/dist/chunk-LV6ZB6CA.js +285 -0
- package/dist/chunk-M5IJP3YW.js +5505 -0
- package/dist/chunk-MMMYRC7Q.js +606 -0
- package/dist/chunk-MMMYRC7Q.js.map +1 -0
- package/dist/chunk-MWZMVLXL.js +415 -0
- package/dist/chunk-MZUQVWVC.js +72 -0
- package/dist/chunk-MZUQVWVC.js.map +1 -0
- package/dist/chunk-N4VCHRLD.js +29 -0
- package/dist/chunk-NKXHCCLB.js +879 -0
- package/dist/chunk-NVCWA4QC.js +112 -0
- package/dist/chunk-ONWVMYHX.js +122 -0
- package/dist/chunk-P6P35FY4.js +54 -0
- package/dist/chunk-P7M22CYB.js +346 -0
- package/dist/chunk-QMWKENNK.js +111 -0
- package/dist/chunk-QOPB6KE3.js +1530 -0
- package/dist/chunk-RBULO7DO.js +223 -0
- package/dist/chunk-RDESQOEE.js +1008 -0
- package/dist/chunk-RMF763SX.js +115 -0
- package/dist/chunk-RN6ZCNM5.js +321 -0
- package/dist/chunk-S2OBXHMN.js +11341 -0
- package/dist/chunk-S3JPD4N7.js +216 -0
- package/dist/chunk-SF6RFI5Z.js +165 -0
- package/dist/chunk-SJV3AOZ2.js +2453 -0
- package/dist/chunk-SLULR4GC.js +202 -0
- package/dist/chunk-TFXXMTHV.js +1476 -0
- package/dist/chunk-TYP7GYRI.js +216 -0
- package/dist/chunk-TYZK56OA.js +2440 -0
- package/dist/chunk-VLDVNZQE.js +921 -0
- package/dist/chunk-W6YK672C.js +511 -0
- package/dist/chunk-X2NFFBTO.js +576 -0
- package/dist/chunk-X45KZOT2.js +1917 -0
- package/dist/chunk-X7Y7WX73.js +249 -0
- package/dist/chunk-XIXM6G7I.js +43 -0
- package/dist/chunk-XLXYARWC.js +210 -0
- package/dist/chunk-XVW52M6I.js +223 -0
- package/dist/chunk-YHU5XUF4.js +342 -0
- package/dist/chunk-YRH3C2OJ.js +73 -0
- package/dist/chunk-YXQE67A7.js +137 -0
- package/dist/chunk-ZHUVMSHI.js +731 -0
- package/dist/chunk-ZHXSOMYH.js +297 -0
- package/dist/chunk-ZIEZJMFW.js +768 -0
- package/dist/chunk-ZMT4ZVJU.js +31013 -0
- package/dist/chunk-ZMT4ZVJU.js.map +1 -0
- package/dist/chunk-ZOASYXBS.js +629 -0
- package/dist/chunk-ZOASYXBS.js.map +1 -0
- package/dist/chunk-ZSEFGDCI.js +98 -0
- package/dist/chunk-ZX5N5D6M.js +65 -0
- package/dist/chunking.d.ts +9 -10
- package/dist/chunking.d.ts.map +1 -0
- package/dist/citations.d.ts +8 -9
- package/dist/citations.d.ts.map +1 -0
- package/dist/cli/creation-ledger-commands.d.ts +24 -0
- package/dist/cli/creation-ledger-commands.d.ts.map +1 -0
- package/dist/cli/deep-recall-commands.d.ts +19 -0
- package/dist/cli/deep-recall-commands.d.ts.map +1 -0
- package/dist/cli/harmonic-search.d.ts +12 -0
- package/dist/cli/harmonic-search.d.ts.map +1 -0
- package/dist/cli/meetings-commands.d.ts +16 -0
- package/dist/cli/meetings-commands.d.ts.map +1 -0
- package/dist/cli/memory-browse-commands.d.ts +11 -0
- package/dist/cli/memory-browse-commands.d.ts.map +1 -0
- package/dist/cli/okf-commands.d.ts +5 -0
- package/dist/cli/okf-commands.d.ts.map +1 -0
- package/dist/cli/recall-navigation-commands.d.ts +11 -0
- package/dist/cli/recall-navigation-commands.d.ts.map +1 -0
- package/dist/cli/research-status-commands.d.ts +26 -0
- package/dist/cli/research-status-commands.d.ts.map +1 -0
- package/dist/cli/skills-commands.d.ts +14 -0
- package/dist/cli/skills-commands.d.ts.map +1 -0
- package/dist/cli/timeline-publish-commands.d.ts +11 -0
- package/dist/cli/timeline-publish-commands.d.ts.map +1 -0
- package/dist/cli-fallback.d.ts +13 -14
- package/dist/cli-fallback.d.ts.map +1 -0
- package/dist/cli.d.ts +1036 -165
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +120 -116
- package/dist/coding/action-gate.d.ts +176 -0
- package/dist/coding/action-gate.d.ts.map +1 -0
- package/dist/coding/architecture-card.d.ts +135 -0
- package/dist/coding/architecture-card.d.ts.map +1 -0
- package/dist/coding/architecture-surfaces.d.ts +166 -0
- package/dist/coding/architecture-surfaces.d.ts.map +1 -0
- package/dist/coding/codegraph-runtime.d.ts +321 -0
- package/dist/coding/codegraph-runtime.d.ts.map +1 -0
- package/dist/coding/codegraph-surfaces.d.ts +191 -0
- package/dist/coding/codegraph-surfaces.d.ts.map +1 -0
- package/dist/coding/coding-graph-types.d.ts +16 -17
- package/dist/coding/coding-graph-types.d.ts.map +1 -0
- package/dist/coding/coding-knowledge-config.d.ts +69 -0
- package/dist/coding/coding-knowledge-config.d.ts.map +1 -0
- package/dist/coding/coding-namespace.d.ts +214 -0
- package/dist/coding/coding-namespace.d.ts.map +1 -0
- package/dist/coding/decision-records.d.ts +120 -0
- package/dist/coding/decision-records.d.ts.map +1 -0
- package/dist/coding/decision-surfaces.d.ts +143 -0
- package/dist/coding/decision-surfaces.d.ts.map +1 -0
- package/dist/coding/export-okf-codegraph.d.ts +9 -28
- package/dist/coding/export-okf-codegraph.d.ts.map +1 -0
- package/dist/coding/export-okf-codegraph.js +13 -13
- package/dist/coding/git-context.d.ts +92 -0
- package/dist/coding/git-context.d.ts.map +1 -0
- package/dist/coding/optional-coding-graph.d.ts +9 -10
- package/dist/coding/optional-coding-graph.d.ts.map +1 -0
- package/dist/coding/pre-action-gate.d.ts +58 -18
- package/dist/coding/pre-action-gate.d.ts.map +1 -0
- package/dist/coding/pre-action-gate.js +2 -2
- package/dist/coding/review-context.d.ts +147 -0
- package/dist/coding/review-context.d.ts.map +1 -0
- package/dist/coding/session-delta-surfaces.d.ts +138 -0
- package/dist/coding/session-delta-surfaces.d.ts.map +1 -0
- package/dist/coding/session-delta.d.ts +201 -0
- package/dist/coding/session-delta.d.ts.map +1 -0
- package/dist/coding/structural-context.d.ts +194 -0
- package/dist/coding/structural-context.d.ts.map +1 -0
- package/dist/coding/structural-subprocess-provider.d.ts +50 -0
- package/dist/coding/structural-subprocess-provider.d.ts.map +1 -0
- package/dist/commitment-ledger.d.ts +13 -14
- package/dist/commitment-ledger.d.ts.map +1 -0
- package/dist/compat/checks.d.ts +3 -5
- package/dist/compat/checks.d.ts.map +1 -0
- package/dist/compat/codex-cli-fallback.d.ts +15 -1
- package/dist/compat/codex-cli-fallback.d.ts.map +1 -0
- package/dist/compat/codex-thread-key.d.ts +15 -1
- package/dist/compat/codex-thread-key.d.ts.map +1 -0
- package/dist/compat/types.d.ts +7 -8
- package/dist/compat/types.d.ts.map +1 -0
- package/dist/compounding/engine.d.ts +11 -44
- package/dist/compounding/engine.d.ts.map +1 -0
- package/dist/compounding/engine.js +14 -14
- package/dist/compounding/preference-consolidator.d.ts +10 -37
- package/dist/compounding/preference-consolidator.d.ts.map +1 -0
- package/dist/compression-optimizer.d.ts +10 -29
- package/dist/compression-optimizer.d.ts.map +1 -0
- package/dist/config-discovery.d.ts +4 -5
- package/dist/config-discovery.d.ts.map +1 -0
- package/dist/config-qmd.d.ts +7 -8
- package/dist/config-qmd.d.ts.map +1 -0
- package/dist/config-record.d.ts +2 -3
- package/dist/config-record.d.ts.map +1 -0
- package/dist/config-security.d.ts +2 -3
- package/dist/config-security.d.ts.map +1 -0
- package/dist/config.d.ts +7 -26
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +23 -23
- package/dist/connectors/codex-marketplace.d.ts +124 -0
- package/dist/connectors/codex-marketplace.d.ts.map +1 -0
- package/dist/connectors/codex-materialize-runner.d.ts +7 -27
- package/dist/connectors/codex-materialize-runner.d.ts.map +1 -0
- package/dist/connectors/codex-materialize-runner.js +14 -14
- package/dist/connectors/codex-materialize.d.ts +23 -41
- package/dist/connectors/codex-materialize.d.ts.map +1 -0
- package/dist/connectors/coerce.d.ts +73 -0
- package/dist/connectors/coerce.d.ts.map +1 -0
- package/dist/connectors/droid-mcp.d.ts +122 -0
- package/dist/connectors/droid-mcp.d.ts.map +1 -0
- package/dist/connectors/hermes-shim.d.ts +135 -0
- package/dist/connectors/hermes-shim.d.ts.map +1 -0
- package/dist/connectors/index.d.ts +42 -247
- package/dist/connectors/index.d.ts.map +1 -0
- package/dist/connectors/index.js +20 -20
- package/dist/connectors/label.d.ts +19 -0
- package/dist/connectors/label.d.ts.map +1 -0
- package/dist/connectors/live/framework.d.ts +169 -0
- package/dist/connectors/live/framework.d.ts.map +1 -0
- package/dist/connectors/live/github.d.ts +156 -0
- package/dist/connectors/live/github.d.ts.map +1 -0
- package/dist/connectors/live/gmail.d.ts +253 -0
- package/dist/connectors/live/gmail.d.ts.map +1 -0
- package/dist/connectors/live/google-drive.d.ts +198 -0
- package/dist/connectors/live/google-drive.d.ts.map +1 -0
- package/dist/connectors/live/index.d.ts +20 -0
- package/dist/connectors/live/index.d.ts.map +1 -0
- package/dist/connectors/live/notion.d.ts +146 -0
- package/dist/connectors/live/notion.d.ts.map +1 -0
- package/dist/connectors/live/registry.d.ts +53 -0
- package/dist/connectors/live/registry.d.ts.map +1 -0
- package/dist/connectors/live/state-store.d.ts +120 -0
- package/dist/connectors/live/state-store.d.ts.map +1 -0
- package/dist/connectors/live/transient-errors.d.ts +45 -0
- package/dist/connectors/live/transient-errors.d.ts.map +1 -0
- package/dist/connectors/materialize-paths.d.ts +15 -0
- package/dist/connectors/materialize-paths.d.ts.map +1 -0
- package/dist/connectors/materialize-skills.d.ts +52 -0
- package/dist/connectors/materialize-skills.d.ts.map +1 -0
- package/dist/connectors/paths.d.ts +78 -0
- package/dist/connectors/paths.d.ts.map +1 -0
- package/dist/connectors/prime-agent.d.ts +13 -0
- package/dist/connectors/prime-agent.d.ts.map +1 -0
- package/dist/connectors-cli.d.ts +170 -2
- package/dist/connectors-cli.d.ts.map +1 -0
- package/dist/console/state.d.ts +154 -0
- package/dist/console/state.d.ts.map +1 -0
- package/dist/console/trace.d.ts +199 -0
- package/dist/console/trace.d.ts.map +1 -0
- package/dist/console/tui.d.ts +106 -0
- package/dist/console/tui.d.ts.map +1 -0
- package/dist/consolidation-operator.d.ts +8 -9
- package/dist/consolidation-operator.d.ts.map +1 -0
- package/dist/consolidation-provenance-check.d.ts +5 -40
- package/dist/consolidation-provenance-check.d.ts.map +1 -0
- package/dist/consolidation-undo.d.ts +10 -44
- package/dist/consolidation-undo.d.ts.map +1 -0
- package/dist/content-hash.d.ts +6 -7
- package/dist/content-hash.d.ts.map +1 -0
- package/dist/context-summary.d.ts +8 -9
- package/dist/context-summary.d.ts.map +1 -0
- package/dist/contradiction/contradiction-judge.d.ts +65 -0
- package/dist/contradiction/contradiction-judge.d.ts.map +1 -0
- package/dist/contradiction/contradiction-review.d.ts +117 -0
- package/dist/contradiction/contradiction-review.d.ts.map +1 -0
- package/dist/contradiction/contradiction-scan.d.ts +74 -0
- package/dist/contradiction/contradiction-scan.d.ts.map +1 -0
- package/dist/contradiction/index.d.ts +12 -41
- package/dist/contradiction/index.d.ts.map +1 -0
- package/dist/contradiction/index.js +11 -11
- package/dist/contradiction/resolution.d.ts +57 -0
- package/dist/contradiction/resolution.d.ts.map +1 -0
- package/dist/contradiction-config.d.ts +5 -6
- package/dist/contradiction-config.d.ts.map +1 -0
- package/dist/converge-config.d.ts +9 -28
- package/dist/converge-config.d.ts.map +1 -0
- package/dist/convergence-refresh.d.ts +5 -40
- package/dist/convergence-refresh.d.ts.map +1 -0
- package/dist/convergence-refresh.js +16 -16
- package/dist/conversation-index/backend.d.ts +12 -31
- package/dist/conversation-index/backend.d.ts.map +1 -0
- package/dist/conversation-index/chunker.d.ts +4 -23
- package/dist/conversation-index/chunker.d.ts.map +1 -0
- package/dist/conversation-index/cleanup.d.ts +2 -3
- package/dist/conversation-index/cleanup.d.ts.map +1 -0
- package/dist/conversation-index/faiss-adapter.d.ts +63 -22
- package/dist/conversation-index/faiss-adapter.d.ts.map +1 -0
- package/dist/conversation-index/indexer.d.ts +9 -31
- package/dist/conversation-index/indexer.d.ts.map +1 -0
- package/dist/conversation-index/search.d.ts +10 -22
- package/dist/conversation-index/search.d.ts.map +1 -0
- package/dist/corpus-read-cancellation.d.ts +3 -4
- package/dist/corpus-read-cancellation.d.ts.map +1 -0
- package/dist/corpus-watermark.d.ts +19 -40
- package/dist/corpus-watermark.d.ts.map +1 -0
- package/dist/corpus-watermark.js +18 -18
- package/dist/correction/correction-access-wiring.d.ts +129 -0
- package/dist/correction/correction-access-wiring.d.ts.map +1 -0
- package/dist/correction/correction-contract.d.ts +220 -0
- package/dist/correction/correction-contract.d.ts.map +1 -0
- package/dist/correction/correction-executor.d.ts +174 -0
- package/dist/correction/correction-executor.d.ts.map +1 -0
- package/dist/correction/correction-planner.d.ts +162 -0
- package/dist/correction/correction-planner.d.ts.map +1 -0
- package/dist/correction/correction-service.d.ts +124 -0
- package/dist/correction/correction-service.d.ts.map +1 -0
- package/dist/correction/index.d.ts +23 -0
- package/dist/correction/index.d.ts.map +1 -0
- package/dist/correction/passive-capture.d.ts +107 -0
- package/dist/correction/passive-capture.d.ts.map +1 -0
- package/dist/correction/passive-correction-detector.d.ts +60 -0
- package/dist/correction/passive-correction-detector.d.ts.map +1 -0
- package/dist/correction/passive-correction-notifications.d.ts +36 -0
- package/dist/correction/passive-correction-notifications.d.ts.map +1 -0
- package/dist/cross-lingual-recall.d.ts +10 -29
- package/dist/cross-lingual-recall.d.ts.map +1 -0
- package/dist/cross-namespace-budget.d.ts +9 -10
- package/dist/cross-namespace-budget.d.ts.map +1 -0
- package/dist/cue-anchors.d.ts +11 -12
- package/dist/cue-anchors.d.ts.map +1 -0
- package/dist/curation/index.d.ts +98 -0
- package/dist/curation/index.d.ts.map +1 -0
- package/dist/dashboard-runtime.d.ts +4 -5
- package/dist/dashboard-runtime.d.ts.map +1 -0
- package/dist/day-summary.d.ts +5 -24
- package/dist/day-summary.d.ts.map +1 -0
- package/dist/dedup/connector-scope.d.ts +28 -0
- package/dist/dedup/connector-scope.d.ts.map +1 -0
- package/dist/dedup/index.d.ts +78 -0
- package/dist/dedup/index.d.ts.map +1 -0
- package/dist/dedup/merge-content.d.ts +24 -0
- package/dist/dedup/merge-content.d.ts.map +1 -0
- package/dist/dedup/merge-count.d.ts +7 -0
- package/dist/dedup/merge-count.d.ts.map +1 -0
- package/dist/dedup/merge-decision.d.ts +26 -0
- package/dist/dedup/merge-decision.d.ts.map +1 -0
- package/dist/dedup/merge-dup.d.ts +8 -0
- package/dist/dedup/merge-dup.d.ts.map +1 -0
- package/dist/dedup/merge-empty.d.ts +15 -0
- package/dist/dedup/merge-empty.d.ts.map +1 -0
- package/dist/dedup/merge-id.d.ts +8 -0
- package/dist/dedup/merge-id.d.ts.map +1 -0
- package/dist/dedup/merge-judge.d.ts +33 -0
- package/dist/dedup/merge-judge.d.ts.map +1 -0
- package/dist/dedup/merge-min-score.d.ts +2 -0
- package/dist/dedup/merge-min-score.d.ts.map +1 -0
- package/dist/dedup/merge-on-write-wire.d.ts +17 -0
- package/dist/dedup/merge-on-write-wire.d.ts.map +1 -0
- package/dist/dedup/merge-on-write.d.ts +32 -0
- package/dist/dedup/merge-on-write.d.ts.map +1 -0
- package/dist/dedup/merge-pair.d.ts +8 -0
- package/dist/dedup/merge-pair.d.ts.map +1 -0
- package/dist/dedup/merge-provenance.d.ts +43 -0
- package/dist/dedup/merge-provenance.d.ts.map +1 -0
- package/dist/dedup/merge-score.d.ts +7 -0
- package/dist/dedup/merge-score.d.ts.map +1 -0
- package/dist/dedup/merge-self.d.ts +13 -0
- package/dist/dedup/merge-self.d.ts.map +1 -0
- package/dist/dedup/merge-threshold.d.ts +13 -0
- package/dist/dedup/merge-threshold.d.ts.map +1 -0
- package/dist/dedup/merge-tie.d.ts +8 -0
- package/dist/dedup/merge-tie.d.ts.map +1 -0
- package/dist/dedup/merge-unique.d.ts +7 -0
- package/dist/dedup/merge-unique.d.ts.map +1 -0
- package/dist/dedup/merge-verdict.d.ts +19 -0
- package/dist/dedup/merge-verdict.d.ts.map +1 -0
- package/dist/dedup/merge.d.ts +122 -0
- package/dist/dedup/merge.d.ts.map +1 -0
- package/dist/dedup/novelty-gate.d.ts +60 -0
- package/dist/dedup/novelty-gate.d.ts.map +1 -0
- package/dist/dedup/semantic.d.ts +86 -0
- package/dist/dedup/semantic.d.ts.map +1 -0
- package/dist/deep-recall-config.d.ts +7 -8
- package/dist/deep-recall-config.d.ts.map +1 -0
- package/dist/deep-recall-config.js +2 -2
- package/dist/deep-recall-http-glue.d.ts +5 -151
- package/dist/deep-recall-http-glue.d.ts.map +1 -0
- package/dist/deep-recall-http-glue.js +6 -6
- package/dist/deep-recall-mcp-tools.d.ts +3 -150
- package/dist/deep-recall-mcp-tools.d.ts.map +1 -0
- package/dist/deep-recall-policy-llm.d.ts +6 -30
- package/dist/deep-recall-policy-llm.d.ts.map +1 -0
- package/dist/deep-recall-renderer.d.ts +3 -9
- package/dist/deep-recall-renderer.d.ts.map +1 -0
- package/dist/deep-recall-seeds.d.ts +7 -30
- package/dist/deep-recall-seeds.d.ts.map +1 -0
- package/dist/deep-recall.d.ts +15 -17
- package/dist/deep-recall.d.ts.map +1 -0
- package/dist/delinearize.d.ts +5 -25
- package/dist/delinearize.d.ts.map +1 -0
- package/dist/dependency-propagation-config.d.ts +3 -22
- package/dist/dependency-propagation-config.d.ts.map +1 -0
- package/dist/deterministic-order.d.ts +3 -4
- package/dist/deterministic-order.d.ts.map +1 -0
- package/dist/direct-answer-wiring.d.ts +8 -28
- package/dist/direct-answer-wiring.d.ts.map +1 -0
- package/dist/direct-answer.d.ts +10 -30
- package/dist/direct-answer.d.ts.map +1 -0
- package/dist/directory-sidecars.d.ts +17 -18
- package/dist/directory-sidecars.d.ts.map +1 -0
- package/dist/embedding-fallback.d.ts +6 -25
- package/dist/embedding-fallback.d.ts.map +1 -0
- package/dist/emit-legacy-tools.d.ts +3 -4
- package/dist/emit-legacy-tools.d.ts.map +1 -0
- package/dist/enrichment/audit.d.ts +27 -0
- package/dist/enrichment/audit.d.ts.map +1 -0
- package/dist/enrichment/index.d.ts +8 -177
- package/dist/enrichment/index.d.ts.map +1 -0
- package/dist/enrichment/pipeline.d.ts +15 -0
- package/dist/enrichment/pipeline.d.ts.map +1 -0
- package/dist/enrichment/provider-registry.d.ts +28 -0
- package/dist/enrichment/provider-registry.d.ts.map +1 -0
- package/dist/enrichment/types.d.ts +65 -0
- package/dist/enrichment/types.d.ts.map +1 -0
- package/dist/enrichment/web-search-provider.d.ts +26 -0
- package/dist/enrichment/web-search-provider.d.ts.map +1 -0
- package/dist/entity-id-normalization.d.ts +3 -4
- package/dist/entity-id-normalization.d.ts.map +1 -0
- package/dist/entity-origin-fields.d.ts +6 -24
- package/dist/entity-origin-fields.d.ts.map +1 -0
- package/dist/entity-recall-cancellation.d.ts +6 -7
- package/dist/entity-recall-cancellation.d.ts.map +1 -0
- package/dist/entity-retrieval-boundaries.d.ts +2 -3
- package/dist/entity-retrieval-boundaries.d.ts.map +1 -0
- package/dist/entity-retrieval-i18n.d.ts +5 -6
- package/dist/entity-retrieval-i18n.d.ts.map +1 -0
- package/dist/entity-retrieval.d.ts +8 -41
- package/dist/entity-retrieval.d.ts.map +1 -0
- package/dist/entity-retrieval.js +14 -14
- package/dist/entity-schema.d.ts +9 -28
- package/dist/entity-schema.d.ts.map +1 -0
- package/dist/episodic-context.d.ts +10 -30
- package/dist/episodic-context.d.ts.map +1 -0
- package/dist/eval-trajectory-contracts.d.ts +48 -68
- package/dist/eval-trajectory-contracts.d.ts.map +1 -0
- package/dist/eval-trajectory-store.d.ts +7 -28
- package/dist/eval-trajectory-store.d.ts.map +1 -0
- package/dist/eval-trajectory.d.ts +9 -30
- package/dist/eval-trajectory.d.ts.map +1 -0
- package/dist/evals.d.ts +29 -30
- package/dist/evals.d.ts.map +1 -0
- package/dist/event-order-query.d.ts +2 -3
- package/dist/event-order-query.d.ts.map +1 -0
- package/dist/event-order-recall.d.ts +6 -8
- package/dist/event-order-recall.d.ts.map +1 -0
- package/dist/event-time.d.ts +7 -8
- package/dist/event-time.d.ts.map +1 -0
- package/dist/evidence-pack.d.ts +7 -8
- package/dist/evidence-pack.d.ts.map +1 -0
- package/dist/experience/session-experience-config.d.ts +19 -0
- package/dist/experience/session-experience-config.d.ts.map +1 -0
- package/dist/experience/session-experience-mining.d.ts +31 -0
- package/dist/experience/session-experience-mining.d.ts.map +1 -0
- package/dist/experience/session-experience-recall.d.ts +19 -0
- package/dist/experience/session-experience-recall.d.ts.map +1 -0
- package/dist/experience/session-experience.d.ts +74 -0
- package/dist/experience/session-experience.d.ts.map +1 -0
- package/dist/explicit-capture.d.ts +20 -128
- package/dist/explicit-capture.d.ts.map +1 -0
- package/dist/explicit-capture.js +1 -1
- package/dist/explicit-cue-recall.d.ts +17 -19
- package/dist/explicit-cue-recall.d.ts.map +1 -0
- package/dist/external-wiki-access.d.ts +4 -152
- package/dist/external-wiki-access.d.ts.map +1 -0
- package/dist/external-wiki-access.js +66 -61
- package/dist/external-wiki-cli.d.ts +4 -5
- package/dist/external-wiki-cli.d.ts.map +1 -0
- package/dist/external-wiki-collection-registration.d.ts +7 -27
- package/dist/external-wiki-collection-registration.d.ts.map +1 -0
- package/dist/external-wiki-collection.d.ts +9 -29
- package/dist/external-wiki-collection.d.ts.map +1 -0
- package/dist/external-wiki-config.d.ts +3 -4
- package/dist/external-wiki-config.d.ts.map +1 -0
- package/dist/external-wiki-guard.d.ts +6 -7
- package/dist/external-wiki-guard.d.ts.map +1 -0
- package/dist/external-wiki-mcp-tools.d.ts +3 -149
- package/dist/external-wiki-mcp-tools.d.ts.map +1 -0
- package/dist/external-wiki-search.d.ts +12 -13
- package/dist/external-wiki-search.d.ts.map +1 -0
- package/dist/external-wiki.d.ts +12 -13
- package/dist/external-wiki.d.ts.map +1 -0
- package/dist/extraction-error-classification.d.ts +5 -24
- package/dist/extraction-error-classification.d.ts.map +1 -0
- package/dist/extraction-evidence-class.d.ts +13 -33
- package/dist/extraction-evidence-class.d.ts.map +1 -0
- package/dist/extraction-evidence-class.js +2 -2
- package/dist/extraction-faithfulness.d.ts +23 -46
- package/dist/extraction-faithfulness.d.ts.map +1 -0
- package/dist/extraction-judge-telemetry.d.ts +9 -36
- package/dist/extraction-judge-telemetry.d.ts.map +1 -0
- package/dist/extraction-judge-training.d.ts +9 -36
- package/dist/extraction-judge-training.d.ts.map +1 -0
- package/dist/extraction-judge.d.ts +20 -44
- package/dist/extraction-judge.d.ts.map +1 -0
- package/dist/extraction-liveness.d.ts +161 -18
- package/dist/extraction-liveness.d.ts.map +1 -0
- package/dist/extraction-normalization.d.ts +7 -26
- package/dist/extraction-normalization.d.ts.map +1 -0
- package/dist/extraction-prompt.d.ts +14 -34
- package/dist/extraction-prompt.d.ts.map +1 -0
- package/dist/extraction-redaction-rules.d.ts +6 -7
- package/dist/extraction-redaction-rules.d.ts.map +1 -0
- package/dist/extraction-source-grounding-helpers.d.ts +31 -32
- package/dist/extraction-source-grounding-helpers.d.ts.map +1 -0
- package/dist/extraction-source-grounding-rules.d.ts +6 -25
- package/dist/extraction-source-grounding-rules.d.ts.map +1 -0
- package/dist/extraction-source-grounding.d.ts +7 -25
- package/dist/extraction-source-grounding.d.ts.map +1 -0
- package/dist/extraction-source-grounding.js +3 -3
- package/dist/extraction-span-bench.d.ts +3 -4
- package/dist/extraction-span-bench.d.ts.map +1 -0
- package/dist/extraction-span-clip.d.ts +5 -6
- package/dist/extraction-span-clip.d.ts.map +1 -0
- package/dist/extraction-span-config.d.ts +40 -18
- package/dist/extraction-span-config.d.ts.map +1 -0
- package/dist/extraction-span-contains.d.ts +2 -3
- package/dist/extraction-span-contains.d.ts.map +1 -0
- package/dist/extraction-span-fallback.d.ts +5 -6
- package/dist/extraction-span-fallback.d.ts.map +1 -0
- package/dist/extraction-span-gap.d.ts +2 -3
- package/dist/extraction-span-gap.d.ts.map +1 -0
- package/dist/extraction-span-gate.d.ts +7 -8
- package/dist/extraction-span-gate.d.ts.map +1 -0
- package/dist/extraction-span-join.d.ts +5 -6
- package/dist/extraction-span-join.d.ts.map +1 -0
- package/dist/extraction-span-length.d.ts +2 -3
- package/dist/extraction-span-length.d.ts.map +1 -0
- package/dist/extraction-span-materialize.d.ts +18 -37
- package/dist/extraction-span-materialize.d.ts.map +1 -0
- package/dist/extraction-span-materialize.js +2 -2
- package/dist/extraction-span-overlap.d.ts +2 -3
- package/dist/extraction-span-overlap.d.ts.map +1 -0
- package/dist/extraction-span-provenance.d.ts +4 -5
- package/dist/extraction-span-provenance.d.ts.map +1 -0
- package/dist/extraction-span-shift.d.ts +2 -3
- package/dist/extraction-span-shift.d.ts.map +1 -0
- package/dist/extraction-span-slice.d.ts +2 -3
- package/dist/extraction-span-slice.d.ts.map +1 -0
- package/dist/extraction-span-source-hash.d.ts +5 -6
- package/dist/extraction-span-source-hash.d.ts.map +1 -0
- package/dist/extraction-span-tokens.d.ts +4 -5
- package/dist/extraction-span-tokens.d.ts.map +1 -0
- package/dist/extraction-span-validate.d.ts +5 -6
- package/dist/extraction-span-validate.d.ts.map +1 -0
- package/dist/extraction-span-wire.d.ts +5 -25
- package/dist/extraction-span-wire.d.ts.map +1 -0
- package/dist/extraction-span.d.ts +4 -5
- package/dist/extraction-span.d.ts.map +1 -0
- package/dist/extraction.d.ts +11 -44
- package/dist/extraction.d.ts.map +1 -0
- package/dist/extraction.js +26 -26
- package/dist/faithfulness-config.d.ts +3 -4
- package/dist/faithfulness-config.d.ts.map +1 -0
- package/dist/fallback-llm-codex-subscription.d.ts +23 -42
- package/dist/fallback-llm-codex-subscription.d.ts.map +1 -0
- package/dist/fallback-llm.d.ts +9 -30
- package/dist/fallback-llm.d.ts.map +1 -0
- package/dist/focused-list-recall.d.ts +5 -8
- package/dist/focused-list-recall.d.ts.map +1 -0
- package/dist/graph-append-error.d.ts +3 -27
- package/dist/graph-append-error.d.ts.map +1 -0
- package/dist/graph-dashboard-diff.d.ts +5 -28
- package/dist/graph-dashboard-diff.d.ts.map +1 -0
- package/dist/graph-dashboard-key.d.ts +3 -26
- package/dist/graph-dashboard-key.d.ts.map +1 -0
- package/dist/graph-dashboard-parser.d.ts +6 -29
- package/dist/graph-dashboard-parser.d.ts.map +1 -0
- package/dist/graph-edge-decay-ROSUPDX3.js +30 -0
- package/dist/graph-edge-reinforcement.d.ts +12 -36
- package/dist/graph-edge-reinforcement.d.ts.map +1 -0
- package/dist/graph-events.d.ts +13 -16
- package/dist/graph-events.d.ts.map +1 -0
- package/dist/graph-jsonl.d.ts +8 -31
- package/dist/graph-jsonl.d.ts.map +1 -0
- package/dist/graph-jsonl.js +3 -3
- package/dist/graph-path-reconstruction.d.ts +22 -22
- package/dist/graph-path-reconstruction.d.ts.map +1 -0
- package/dist/graph-path-scoring-config.d.ts +3 -4
- package/dist/graph-path-scoring-config.d.ts.map +1 -0
- package/dist/graph-path-scoring.d.ts +8 -30
- package/dist/graph-path-scoring.d.ts.map +1 -0
- package/dist/graph-recall.d.ts +7 -10
- package/dist/graph-recall.d.ts.map +1 -0
- package/dist/graph-retrieval.d.ts +19 -20
- package/dist/graph-retrieval.d.ts.map +1 -0
- package/dist/graph-snapshot.d.ts +14 -38
- package/dist/graph-snapshot.d.ts.map +1 -0
- package/dist/graph-snapshot.js +3 -3
- package/dist/graph-write-lock.d.ts +7 -10
- package/dist/graph-write-lock.d.ts.map +1 -0
- package/dist/graph.d.ts +325 -22
- package/dist/graph.d.ts.map +1 -0
- package/dist/graph.js +2 -2
- package/dist/harmonic-construction.d.ts +11 -13
- package/dist/harmonic-construction.d.ts.map +1 -0
- package/dist/harmonic-retrieval.d.ts +10 -12
- package/dist/harmonic-retrieval.d.ts.map +1 -0
- package/dist/harmonic-retrieval.js +1 -1
- package/dist/himem.d.ts +3 -4
- package/dist/himem.d.ts.map +1 -0
- package/dist/host-embedding-provider.d.ts +7 -8
- package/dist/host-embedding-provider.d.ts.map +1 -0
- package/dist/http-retry.d.ts +9 -10
- package/dist/http-retry.d.ts.map +1 -0
- package/dist/hygiene.d.ts +4 -5
- package/dist/hygiene.d.ts.map +1 -0
- package/dist/identity-continuity.d.ts +9 -11
- package/dist/identity-continuity.d.ts.map +1 -0
- package/dist/importance.d.ts +6 -26
- package/dist/importance.d.ts.map +1 -0
- package/dist/importers/base.d.ts +261 -0
- package/dist/importers/base.d.ts.map +1 -0
- package/dist/importers/index.d.ts +3 -280
- package/dist/importers/index.d.ts.map +1 -0
- package/dist/importers/test-utils.d.ts +5 -24
- package/dist/importers/test-utils.d.ts.map +1 -0
- package/dist/in-flight-reads.d.ts +10 -29
- package/dist/in-flight-reads.d.ts.map +1 -0
- package/dist/included-memories.d.ts +6 -7
- package/dist/included-memories.d.ts.map +1 -0
- package/dist/index.d.ts +185 -9836
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +275 -229
- package/dist/inline-script.d.ts +2 -3
- package/dist/inline-script.d.ts.map +1 -0
- package/dist/intent.d.ts +7 -26
- package/dist/intent.d.ts.map +1 -0
- package/dist/json-extract.d.ts +3 -4
- package/dist/json-extract.d.ts.map +1 -0
- package/dist/json-store.d.ts +9 -9
- package/dist/json-store.d.ts.map +1 -0
- package/dist/lcm/archive.d.ts +11 -13
- package/dist/lcm/archive.d.ts.map +1 -0
- package/dist/lcm/dag.d.ts +5 -7
- package/dist/lcm/dag.d.ts.map +1 -0
- package/dist/lcm/engine.d.ts +10 -32
- package/dist/lcm/engine.d.ts.map +1 -0
- package/dist/lcm/engine.js +4 -4
- package/dist/lcm/evidence-identity.d.ts +20 -0
- package/dist/lcm/evidence-identity.d.ts.map +1 -0
- package/dist/lcm/index.d.ts +9 -52
- package/dist/lcm/index.d.ts.map +1 -0
- package/dist/lcm/index.js +13 -13
- package/dist/lcm/queue.d.ts +7 -10
- package/dist/lcm/queue.d.ts.map +1 -0
- package/dist/lcm/recall.d.ts +8 -13
- package/dist/lcm/recall.d.ts.map +1 -0
- package/dist/lcm/schema.d.ts +5 -8
- package/dist/lcm/schema.d.ts.map +1 -0
- package/dist/lcm/summarizer.d.ts +7 -11
- package/dist/lcm/summarizer.d.ts.map +1 -0
- package/dist/lcm/tools.d.ts +4 -30
- package/dist/lcm/tools.d.ts.map +1 -0
- package/dist/lcm-fallback-read.d.ts +4 -5
- package/dist/lcm-fallback-read.d.ts.map +1 -0
- package/dist/lifecycle/seed-graduation-config-types.d.ts +21 -0
- package/dist/lifecycle/seed-graduation-config-types.d.ts.map +1 -0
- package/dist/lifecycle/seed-graduation.d.ts +97 -0
- package/dist/lifecycle/seed-graduation.d.ts.map +1 -0
- package/dist/lifecycle/tombstones.d.ts +389 -0
- package/dist/lifecycle/tombstones.d.ts.map +1 -0
- package/dist/lifecycle.d.ts +14 -33
- package/dist/lifecycle.d.ts.map +1 -0
- package/dist/live-connectors-runner.d.ts +11 -29
- package/dist/live-connectors-runner.d.ts.map +1 -0
- package/dist/local-llm-config.d.ts +5 -7
- package/dist/local-llm-config.d.ts.map +1 -0
- package/dist/local-llm-config.js +1 -1
- package/dist/local-llm-helpers.d.ts +102 -20
- package/dist/local-llm-helpers.d.ts.map +1 -0
- package/dist/local-llm-transport.d.ts +4 -6
- package/dist/local-llm-transport.d.ts.map +1 -0
- package/dist/local-llm.d.ts +145 -20
- package/dist/local-llm.d.ts.map +1 -0
- package/dist/local-model-endpoint.d.ts +10 -29
- package/dist/local-model-endpoint.d.ts.map +1 -0
- package/dist/location/access-operations.d.ts +9 -0
- package/dist/location/access-operations.d.ts.map +1 -0
- package/dist/location/backfill.d.ts +57 -0
- package/dist/location/backfill.d.ts.map +1 -0
- package/dist/location/cli.d.ts +67 -0
- package/dist/location/cli.d.ts.map +1 -0
- package/dist/location/config.d.ts +11 -0
- package/dist/location/config.d.ts.map +1 -0
- package/dist/location/http-glue.d.ts +20 -0
- package/dist/location/http-glue.d.ts.map +1 -0
- package/dist/location/index.d.ts +21 -534
- package/dist/location/index.d.ts.map +1 -0
- package/dist/location/index.js +17 -17
- package/dist/location/intervals.d.ts +61 -0
- package/dist/location/intervals.d.ts.map +1 -0
- package/dist/location/matching.d.ts +124 -0
- package/dist/location/matching.d.ts.map +1 -0
- package/dist/location/mcp-tools.d.ts +12 -0
- package/dist/location/mcp-tools.d.ts.map +1 -0
- package/dist/location/parse-companions.d.ts +7 -0
- package/dist/location/parse-companions.d.ts.map +1 -0
- package/dist/location/pipeline.d.ts +44 -0
- package/dist/location/pipeline.d.ts.map +1 -0
- package/dist/location/provider-setup.d.ts +33 -0
- package/dist/location/provider-setup.d.ts.map +1 -0
- package/dist/location/registry.d.ts +15 -0
- package/dist/location/registry.d.ts.map +1 -0
- package/dist/location/scheduler.d.ts +48 -0
- package/dist/location/scheduler.d.ts.map +1 -0
- package/dist/location/store.d.ts +95 -0
- package/dist/location/store.d.ts.map +1 -0
- package/dist/location/surfaces.d.ts +76 -0
- package/dist/location/surfaces.d.ts.map +1 -0
- package/dist/location/tagging.d.ts +116 -0
- package/dist/location/tagging.d.ts.map +1 -0
- package/dist/location/types.d.ts +109 -0
- package/dist/location/types.d.ts.map +1 -0
- package/dist/logger.d.ts +7 -8
- package/dist/logger.d.ts.map +1 -0
- package/dist/maintenance/archive-observations.d.ts +5 -5
- package/dist/maintenance/archive-observations.d.ts.map +1 -0
- package/dist/maintenance/atomic-file.d.ts +4 -5
- package/dist/maintenance/atomic-file.d.ts.map +1 -0
- package/dist/maintenance/backup-stamp.d.ts +2 -3
- package/dist/maintenance/backup-stamp.d.ts.map +1 -0
- package/dist/maintenance/day-summary-cron.d.ts +20 -0
- package/dist/maintenance/day-summary-cron.d.ts.map +1 -0
- package/dist/maintenance/dreams-ledger.d.ts +172 -0
- package/dist/maintenance/dreams-ledger.d.ts.map +1 -0
- package/dist/maintenance/first-start-migration.d.ts +61 -0
- package/dist/maintenance/first-start-migration.d.ts.map +1 -0
- package/dist/maintenance/forget.d.ts +59 -0
- package/dist/maintenance/forget.d.ts.map +1 -0
- package/dist/maintenance/graph-edge-decay.d.ts +122 -0
- package/dist/maintenance/graph-edge-decay.d.ts.map +1 -0
- package/dist/maintenance/memory-governance-cron.d.ts +9 -10
- package/dist/maintenance/memory-governance-cron.d.ts.map +1 -0
- package/dist/maintenance/memory-governance.d.ts +25 -43
- package/dist/maintenance/memory-governance.d.ts.map +1 -0
- package/dist/maintenance/memory-governance.js +14 -14
- package/dist/maintenance/migrate-observations.d.ts +4 -5
- package/dist/maintenance/migrate-observations.d.ts.map +1 -0
- package/dist/maintenance/namespace-maintenance-fanout.d.ts +132 -0
- package/dist/maintenance/namespace-maintenance-fanout.d.ts.map +1 -0
- package/dist/maintenance/namespace-planner.d.ts +96 -0
- package/dist/maintenance/namespace-planner.d.ts.map +1 -0
- package/dist/maintenance/observation-ledger-utils.d.ts +5 -6
- package/dist/maintenance/observation-ledger-utils.d.ts.map +1 -0
- package/dist/maintenance/pattern-reinforcement.d.ts +129 -0
- package/dist/maintenance/pattern-reinforcement.d.ts.map +1 -0
- package/dist/maintenance/projection-support.d.ts +76 -0
- package/dist/maintenance/projection-support.d.ts.map +1 -0
- package/dist/maintenance/purge.d.ts +85 -0
- package/dist/maintenance/purge.d.ts.map +1 -0
- package/dist/maintenance/rebuild-memory-lifecycle-ledger-cli.d.ts +24 -0
- package/dist/maintenance/rebuild-memory-lifecycle-ledger-cli.d.ts.map +1 -0
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +11 -43
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts.map +1 -0
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +14 -14
- package/dist/maintenance/rebuild-memory-projection.d.ts +14 -72
- package/dist/maintenance/rebuild-memory-projection.d.ts.map +1 -0
- package/dist/maintenance/rebuild-memory-projection.js +15 -15
- package/dist/maintenance/rebuild-observations.d.ts +4 -5
- package/dist/maintenance/rebuild-observations.d.ts.map +1 -0
- package/dist/maintenance/tier-stats.d.ts +59 -0
- package/dist/maintenance/tier-stats.d.ts.map +1 -0
- package/dist/mcp-memory-inspector-app.d.ts +15 -158
- package/dist/mcp-memory-inspector-app.d.ts.map +1 -0
- package/dist/mcp-read-only-tools.d.ts +2 -3
- package/dist/mcp-read-only-tools.d.ts.map +1 -0
- package/dist/mcp-read-only-tools.js +1 -1
- package/dist/meetings/build-scheduler.d.ts +43 -0
- package/dist/meetings/build-scheduler.d.ts.map +1 -0
- package/dist/meetings/build.d.ts +137 -0
- package/dist/meetings/build.d.ts.map +1 -0
- package/dist/meetings/cli.d.ts +37 -0
- package/dist/meetings/cli.d.ts.map +1 -0
- package/dist/meetings/config.d.ts +18 -0
- package/dist/meetings/config.d.ts.map +1 -0
- package/dist/meetings/day-source.d.ts +103 -0
- package/dist/meetings/day-source.d.ts.map +1 -0
- package/dist/meetings/detect.d.ts +33 -0
- package/dist/meetings/detect.d.ts.map +1 -0
- package/dist/meetings/errors.d.ts +10 -0
- package/dist/meetings/errors.d.ts.map +1 -0
- package/dist/meetings/fuse.d.ts +30 -0
- package/dist/meetings/fuse.d.ts.map +1 -0
- package/dist/meetings/http-glue.d.ts +37 -0
- package/dist/meetings/http-glue.d.ts.map +1 -0
- package/dist/meetings/index.d.ts +20 -0
- package/dist/meetings/index.d.ts.map +1 -0
- package/dist/meetings/mcp-tools.d.ts +10 -0
- package/dist/meetings/mcp-tools.d.ts.map +1 -0
- package/dist/meetings/memory-gen.d.ts +157 -0
- package/dist/meetings/memory-gen.d.ts.map +1 -0
- package/dist/meetings/memory-generator.d.ts +113 -0
- package/dist/meetings/memory-generator.d.ts.map +1 -0
- package/dist/meetings/service.d.ts +80 -0
- package/dist/meetings/service.d.ts.map +1 -0
- package/dist/meetings/store.d.ts +121 -0
- package/dist/meetings/store.d.ts.map +1 -0
- package/dist/meetings/summary-extractor.d.ts +96 -0
- package/dist/meetings/summary-extractor.d.ts.map +1 -0
- package/dist/meetings/types.d.ts +155 -0
- package/dist/meetings/types.d.ts.map +1 -0
- package/dist/memory-action-policy.d.ts +6 -25
- package/dist/memory-action-policy.d.ts.map +1 -0
- package/dist/memory-age.d.ts +16 -17
- package/dist/memory-age.d.ts.map +1 -0
- package/dist/memory-browse-http-glue.d.ts +5 -151
- package/dist/memory-browse-http-glue.d.ts.map +1 -0
- package/dist/memory-browse-http-glue.js +2 -2
- package/dist/memory-browse-mcp-tools.d.ts +3 -150
- package/dist/memory-browse-mcp-tools.d.ts.map +1 -0
- package/dist/memory-browse-operations.d.ts +11 -2
- package/dist/memory-browse-operations.d.ts.map +1 -0
- package/dist/memory-browse-operations.js +66 -61
- package/dist/memory-browse.d.ts +16 -36
- package/dist/memory-browse.d.ts.map +1 -0
- package/dist/memory-browse.js +4 -4
- package/dist/memory-cache.d.ts +27 -46
- package/dist/memory-cache.d.ts.map +1 -0
- package/dist/memory-controller.d.ts +29 -50
- package/dist/memory-controller.d.ts.map +1 -0
- package/dist/memory-corpus-version.d.ts +3 -4
- package/dist/memory-corpus-version.d.ts.map +1 -0
- package/dist/memory-extension/claude-code-publisher.d.ts +18 -0
- package/dist/memory-extension/claude-code-publisher.d.ts.map +1 -0
- package/dist/memory-extension/codex-publisher.d.ts +22 -0
- package/dist/memory-extension/codex-publisher.d.ts.map +1 -0
- package/dist/memory-extension/hermes-publisher.d.ts +18 -0
- package/dist/memory-extension/hermes-publisher.d.ts.map +1 -0
- package/dist/memory-extension/index.d.ts +57 -0
- package/dist/memory-extension/index.d.ts.map +1 -0
- package/dist/memory-extension/shared-instructions.d.ts +30 -0
- package/dist/memory-extension/shared-instructions.d.ts.map +1 -0
- package/dist/memory-extension/types.d.ts +88 -0
- package/dist/memory-extension/types.d.ts.map +1 -0
- package/dist/memory-extension-host/host-discovery.d.ts +38 -0
- package/dist/memory-extension-host/host-discovery.d.ts.map +1 -0
- package/dist/memory-extension-host/index.d.ts +7 -0
- package/dist/memory-extension-host/index.d.ts.map +1 -0
- package/dist/memory-extension-host/render-extensions-block.d.ts +23 -0
- package/dist/memory-extension-host/render-extensions-block.d.ts.map +1 -0
- package/dist/memory-extension-host/types.d.ts +20 -0
- package/dist/memory-extension-host/types.d.ts.map +1 -0
- package/dist/memory-lifecycle-ledger-utils.d.ts +19 -38
- package/dist/memory-lifecycle-ledger-utils.d.ts.map +1 -0
- package/dist/memory-projection-format.d.ts +3 -4
- package/dist/memory-projection-format.d.ts.map +1 -0
- package/dist/memory-projection-mutations.d.ts +3 -4
- package/dist/memory-projection-mutations.d.ts.map +1 -0
- package/dist/memory-projection-store.d.ts +35 -54
- package/dist/memory-projection-store.d.ts.map +1 -0
- package/dist/memory-provenance.d.ts +10 -29
- package/dist/memory-provenance.d.ts.map +1 -0
- package/dist/memory-snapshot.d.ts +3 -22
- package/dist/memory-snapshot.d.ts.map +1 -0
- package/dist/memory-subject-cli.d.ts +9 -156
- package/dist/memory-subject-cli.d.ts.map +1 -0
- package/dist/memory-subject.d.ts +132 -145
- package/dist/memory-subject.d.ts.map +1 -0
- package/dist/memory-worth-bench.d.ts +4 -5
- package/dist/memory-worth-bench.d.ts.map +1 -0
- package/dist/memory-worth-filter.d.ts +8 -11
- package/dist/memory-worth-filter.d.ts.map +1 -0
- package/dist/memory-worth-outcomes.d.ts +11 -45
- package/dist/memory-worth-outcomes.d.ts.map +1 -0
- package/dist/memory-worth.d.ts +4 -5
- package/dist/memory-worth.d.ts.map +1 -0
- package/dist/message-parts/index.d.ts +15 -16
- package/dist/message-parts/index.d.ts.map +1 -0
- package/dist/migrate/from-engram.d.ts +6 -7
- package/dist/migrate/from-engram.d.ts.map +1 -0
- package/dist/model-registry.d.ts +3 -4
- package/dist/model-registry.d.ts.map +1 -0
- package/dist/models-json.d.ts +5 -24
- package/dist/models-json.d.ts.map +1 -0
- package/dist/namespaces/catalog.d.ts +473 -0
- package/dist/namespaces/catalog.d.ts.map +1 -0
- package/dist/namespaces/identity.d.ts +5 -0
- package/dist/namespaces/identity.d.ts.map +1 -0
- package/dist/namespaces/migrate.d.ts +11 -46
- package/dist/namespaces/migrate.d.ts.map +1 -0
- package/dist/namespaces/migrate.js +15 -15
- package/dist/namespaces/path.d.ts +3 -0
- package/dist/namespaces/path.d.ts.map +1 -0
- package/dist/namespaces/principal.d.ts +9 -28
- package/dist/namespaces/principal.d.ts.map +1 -0
- package/dist/namespaces/scope-profile-config.d.ts +5 -0
- package/dist/namespaces/scope-profile-config.d.ts.map +1 -0
- package/dist/namespaces/scope-profiles.d.ts +46 -0
- package/dist/namespaces/scope-profiles.d.ts.map +1 -0
- package/dist/namespaces/search.d.ts +10 -28
- package/dist/namespaces/search.d.ts.map +1 -0
- package/dist/namespaces/search.js +5 -5
- package/dist/namespaces/storage.d.ts +8 -41
- package/dist/namespaces/storage.d.ts.map +1 -0
- package/dist/namespaces/storage.js +14 -14
- package/dist/native-binding-hint.d.ts +3 -4
- package/dist/native-binding-hint.d.ts.map +1 -0
- package/dist/native-knowledge.d.ts +15 -34
- package/dist/native-knowledge.d.ts.map +1 -0
- package/dist/negative.d.ts +3 -4
- package/dist/negative.d.ts.map +1 -0
- package/dist/network/tailscale.d.ts +7 -8
- package/dist/network/tailscale.d.ts.map +1 -0
- package/dist/network/webdav.d.ts +9 -10
- package/dist/network/webdav.d.ts.map +1 -0
- package/dist/objective-state-writers.d.ts +8 -9
- package/dist/objective-state-writers.d.ts.map +1 -0
- package/dist/objective-state.d.ts +15 -16
- package/dist/objective-state.d.ts.map +1 -0
- package/dist/offline-sync-exclude-globs.d.ts +3 -4
- package/dist/offline-sync-exclude-globs.d.ts.map +1 -0
- package/dist/offline-sync-file-io.d.ts +8 -9
- package/dist/offline-sync-file-io.d.ts.map +1 -0
- package/dist/offline-sync-impression-drain.d.ts +8 -26
- package/dist/offline-sync-impression-drain.d.ts.map +1 -0
- package/dist/offline-sync-impression-drain.js +2 -2
- package/dist/offline-sync.d.ts +57 -58
- package/dist/offline-sync.d.ts.map +1 -0
- package/dist/okf/cli.d.ts +10 -0
- package/dist/okf/cli.d.ts.map +1 -0
- package/dist/okf/config.d.ts +11 -0
- package/dist/okf/config.d.ts.map +1 -0
- package/dist/okf/index-files.d.ts +7 -0
- package/dist/okf/index-files.d.ts.map +1 -0
- package/dist/okf/lint.d.ts +12 -0
- package/dist/okf/lint.d.ts.map +1 -0
- package/dist/okf/render.d.ts +29 -0
- package/dist/okf/render.d.ts.map +1 -0
- package/dist/okf/sweep.d.ts +9 -0
- package/dist/okf/sweep.d.ts.map +1 -0
- package/dist/okf/type-mapping.d.ts +30 -0
- package/dist/okf/type-mapping.d.ts.map +1 -0
- package/dist/onboarding/index.d.ts +63 -0
- package/dist/onboarding/index.d.ts.map +1 -0
- package/dist/openai-chat-compat.d.ts +6 -7
- package/dist/openai-chat-compat.d.ts.map +1 -0
- package/dist/operator-doctor-corpus.d.ts +8 -29
- package/dist/operator-doctor-corpus.d.ts.map +1 -0
- package/dist/operator-doctor-corpus.js +21 -21
- package/dist/operator-doctor-replica.d.ts +8 -29
- package/dist/operator-doctor-replica.d.ts.map +1 -0
- package/dist/operator-doctor-replica.js +4 -4
- package/dist/operator-doctor-types.d.ts +2 -3
- package/dist/operator-doctor-types.d.ts.map +1 -0
- package/dist/operator-toolkit.d.ts +43 -75
- package/dist/operator-toolkit.d.ts.map +1 -0
- package/dist/operator-toolkit.js +37 -37
- package/dist/opik-exporter.d.ts +6 -8
- package/dist/opik-exporter.d.ts.map +1 -0
- package/dist/orchestration/compression-guideline-coordinator.d.ts +6 -40
- package/dist/orchestration/compression-guideline-coordinator.d.ts.map +1 -0
- package/dist/orchestration/consolidation-run.d.ts +93 -0
- package/dist/orchestration/consolidation-run.d.ts.map +1 -0
- package/dist/orchestration/contradiction-linking-coordinator.d.ts +102 -0
- package/dist/orchestration/contradiction-linking-coordinator.d.ts.map +1 -0
- package/dist/orchestration/conversation-index-coordinator.d.ts +99 -0
- package/dist/orchestration/conversation-index-coordinator.d.ts.map +1 -0
- package/dist/orchestration/dependency-propagation-delivery.d.ts +129 -0
- package/dist/orchestration/dependency-propagation-delivery.d.ts.map +1 -0
- package/dist/orchestration/dependency-propagation-queue-state.d.ts +15 -0
- package/dist/orchestration/dependency-propagation-queue-state.d.ts.map +1 -0
- package/dist/orchestration/dependency-propagation-recovery-replay.d.ts +49 -0
- package/dist/orchestration/dependency-propagation-recovery-replay.d.ts.map +1 -0
- package/dist/orchestration/dependency-propagation-replay-reconciliation.d.ts +25 -0
- package/dist/orchestration/dependency-propagation-replay-reconciliation.d.ts.map +1 -0
- package/dist/orchestration/dependency-propagation.d.ts +64 -0
- package/dist/orchestration/dependency-propagation.d.ts.map +1 -0
- package/dist/orchestration/dependency-revalidation.d.ts +45 -0
- package/dist/orchestration/dependency-revalidation.d.ts.map +1 -0
- package/dist/orchestration/entity-synthesis-coordinator.d.ts +64 -0
- package/dist/orchestration/entity-synthesis-coordinator.d.ts.map +1 -0
- package/dist/orchestration/episodic-context-section.d.ts +30 -0
- package/dist/orchestration/episodic-context-section.d.ts.map +1 -0
- package/dist/orchestration/extraction-anchor-snapshot.d.ts +20 -0
- package/dist/orchestration/extraction-anchor-snapshot.d.ts.map +1 -0
- package/dist/orchestration/extraction-envelope.d.ts +40 -0
- package/dist/orchestration/extraction-envelope.d.ts.map +1 -0
- package/dist/orchestration/extraction-injection-gate.d.ts +51 -0
- package/dist/orchestration/extraction-injection-gate.d.ts.map +1 -0
- package/dist/orchestration/extraction-origin-context.d.ts +19 -0
- package/dist/orchestration/extraction-origin-context.d.ts.map +1 -0
- package/dist/orchestration/extraction-persist-deps.d.ts +76 -0
- package/dist/orchestration/extraction-persist-deps.d.ts.map +1 -0
- package/dist/orchestration/extraction-persist-promotion.d.ts +203 -0
- package/dist/orchestration/extraction-persist-promotion.d.ts.map +1 -0
- package/dist/orchestration/extraction-persist.d.ts +19 -0
- package/dist/orchestration/extraction-persist.d.ts.map +1 -0
- package/dist/orchestration/extraction-queue-coordinator.d.ts +103 -0
- package/dist/orchestration/extraction-queue-coordinator.d.ts.map +1 -0
- package/dist/orchestration/extraction-run-helpers.d.ts +123 -0
- package/dist/orchestration/extraction-run-helpers.d.ts.map +1 -0
- package/dist/orchestration/extraction-run.d.ts +174 -0
- package/dist/orchestration/extraction-run.d.ts.map +1 -0
- package/dist/orchestration/extraction-shutdown.d.ts +6 -0
- package/dist/orchestration/extraction-shutdown.d.ts.map +1 -0
- package/dist/orchestration/extraction-watermark.d.ts +28 -0
- package/dist/orchestration/extraction-watermark.d.ts.map +1 -0
- package/dist/orchestration/generic-recall-paths.d.ts +36 -0
- package/dist/orchestration/generic-recall-paths.d.ts.map +1 -0
- package/dist/orchestration/graph-path-state-loader.d.ts +15 -0
- package/dist/orchestration/graph-path-state-loader.d.ts.map +1 -0
- package/dist/orchestration/graph-recall-coordinator.d.ts +107 -0
- package/dist/orchestration/graph-recall-coordinator.d.ts.map +1 -0
- package/dist/orchestration/harmonic-construction-persist.d.ts +58 -0
- package/dist/orchestration/harmonic-construction-persist.d.ts.map +1 -0
- package/dist/orchestration/lifecycle-policy-coordinator.d.ts +81 -0
- package/dist/orchestration/lifecycle-policy-coordinator.d.ts.map +1 -0
- package/dist/orchestration/maintenance.d.ts +229 -37
- package/dist/orchestration/maintenance.d.ts.map +1 -0
- package/dist/orchestration/maintenance.js +25 -25
- package/dist/orchestration/namespace-read-fanout.d.ts +95 -0
- package/dist/orchestration/namespace-read-fanout.d.ts.map +1 -0
- package/dist/orchestration/orchestrator-helpers.d.ts +408 -0
- package/dist/orchestration/orchestrator-helpers.d.ts.map +1 -0
- package/dist/orchestration/orchestrator-init.d.ts +124 -0
- package/dist/orchestration/orchestrator-init.d.ts.map +1 -0
- package/dist/orchestration/orchestrator-namespace-scope.d.ts +19 -0
- package/dist/orchestration/orchestrator-namespace-scope.d.ts.map +1 -0
- package/dist/orchestration/persistence-index.d.ts +141 -0
- package/dist/orchestration/persistence-index.d.ts.map +1 -0
- package/dist/orchestration/projection-rebuild-schedule.d.ts +21 -0
- package/dist/orchestration/projection-rebuild-schedule.d.ts.map +1 -0
- package/dist/orchestration/qmd-result-resolver.d.ts +75 -0
- package/dist/orchestration/qmd-result-resolver.d.ts.map +1 -0
- package/dist/orchestration/recall-background-writes.d.ts +3 -0
- package/dist/orchestration/recall-background-writes.d.ts.map +1 -0
- package/dist/orchestration/recall-entry.d.ts +78 -0
- package/dist/orchestration/recall-entry.d.ts.map +1 -0
- package/dist/orchestration/recall-internal-deps.d.ts +311 -0
- package/dist/orchestration/recall-internal-deps.d.ts.map +1 -0
- package/dist/orchestration/recall-internal.d.ts +30 -0
- package/dist/orchestration/recall-internal.d.ts.map +1 -0
- package/dist/orchestration/recall-introspection.d.ts +108 -0
- package/dist/orchestration/recall-introspection.d.ts.map +1 -0
- package/dist/orchestration/recall-profile-storage.d.ts +20 -0
- package/dist/orchestration/recall-profile-storage.d.ts.map +1 -0
- package/dist/orchestration/recall-recognition-index.d.ts +23 -0
- package/dist/orchestration/recall-recognition-index.d.ts.map +1 -0
- package/dist/orchestration/recall-recognition-search.d.ts +7 -0
- package/dist/orchestration/recall-recognition-search.d.ts.map +1 -0
- package/dist/orchestration/recall-rerank-coordinator.d.ts +126 -0
- package/dist/orchestration/recall-rerank-coordinator.d.ts.map +1 -0
- package/dist/orchestration/recall-result-formatter.d.ts +128 -0
- package/dist/orchestration/recall-result-formatter.d.ts.map +1 -0
- package/dist/orchestration/recall-search-pipeline.d.ts +284 -0
- package/dist/orchestration/recall-search-pipeline.d.ts.map +1 -0
- package/dist/orchestration/recall-search-prefilter.d.ts +31 -0
- package/dist/orchestration/recall-search-prefilter.d.ts.map +1 -0
- package/dist/orchestration/recall-section-coordinator.d.ts +92 -0
- package/dist/orchestration/recall-section-coordinator.d.ts.map +1 -0
- package/dist/orchestration/self-deps.d.ts +27 -0
- package/dist/orchestration/self-deps.d.ts.map +1 -0
- package/dist/orchestration/semantic-consolidation-coordinator.d.ts +64 -0
- package/dist/orchestration/semantic-consolidation-coordinator.d.ts.map +1 -0
- package/dist/orchestration/semantic-merge-commit-effects.d.ts +193 -0
- package/dist/orchestration/semantic-merge-commit-effects.d.ts.map +1 -0
- package/dist/orchestration/semantic-merge-persist.d.ts +318 -0
- package/dist/orchestration/semantic-merge-persist.d.ts.map +1 -0
- package/dist/orchestration/semantic-merge-promotion-payload.d.ts +132 -0
- package/dist/orchestration/semantic-merge-promotion-payload.d.ts.map +1 -0
- package/dist/orchestration/session-context.d.ts +225 -0
- package/dist/orchestration/session-context.d.ts.map +1 -0
- package/dist/orchestration/startup-collection-checks.d.ts +23 -0
- package/dist/orchestration/startup-collection-checks.d.ts.map +1 -0
- package/dist/orchestration/tier-migration-coordinator.d.ts +65 -0
- package/dist/orchestration/tier-migration-coordinator.d.ts.map +1 -0
- package/dist/orchestration/turn-ingestion.d.ts +227 -0
- package/dist/orchestration/turn-ingestion.d.ts.map +1 -0
- package/dist/orchestration/update-localization.d.ts +37 -0
- package/dist/orchestration/update-localization.d.ts.map +1 -0
- package/dist/orchestration/workspace-ops.d.ts +154 -0
- package/dist/orchestration/workspace-ops.d.ts.map +1 -0
- package/dist/orchestration/xray-capture-queue.d.ts +17 -0
- package/dist/orchestration/xray-capture-queue.d.ts.map +1 -0
- package/dist/orchestrator.d.ts +867 -109
- package/dist/orchestrator.d.ts.map +1 -0
- package/dist/orchestrator.js +157 -152
- package/dist/page-versioning.d.ts +16 -17
- package/dist/page-versioning.d.ts.map +1 -0
- package/dist/patterns-cli.d.ts +20 -40
- package/dist/patterns-cli.d.ts.map +1 -0
- package/dist/peers/index.d.ts +17 -327
- package/dist/peers/index.d.ts.map +1 -0
- package/dist/peers/migrate-from-identity-anchor.d.ts +119 -0
- package/dist/peers/migrate-from-identity-anchor.d.ts.map +1 -0
- package/dist/peers/profile-reasoner.d.ts +204 -0
- package/dist/peers/profile-reasoner.d.ts.map +1 -0
- package/dist/peers/storage.d.ts +163 -0
- package/dist/peers/storage.d.ts.map +1 -0
- package/dist/peers/types.d.ts +125 -0
- package/dist/peers/types.d.ts.map +1 -0
- package/dist/plugin-entry-resolver.d.ts +3 -4
- package/dist/plugin-entry-resolver.d.ts.map +1 -0
- package/dist/plugin-id.d.ts +4 -5
- package/dist/plugin-id.d.ts.map +1 -0
- package/dist/policy-runtime.d.ts +7 -26
- package/dist/policy-runtime.d.ts.map +1 -0
- package/dist/preferences/drift-config.d.ts +27 -0
- package/dist/preferences/drift-config.d.ts.map +1 -0
- package/dist/preferences/drift-recall.d.ts +74 -0
- package/dist/preferences/drift-recall.d.ts.map +1 -0
- package/dist/preferences/drift-types.d.ts +59 -0
- package/dist/preferences/drift-types.d.ts.map +1 -0
- package/dist/preferences/index.d.ts +12 -0
- package/dist/preferences/index.d.ts.map +1 -0
- package/dist/preferences/preference-drift.d.ts +144 -0
- package/dist/preferences/preference-drift.d.ts.map +1 -0
- package/dist/prioritized-embed.d.ts +3 -4
- package/dist/prioritized-embed.d.ts.map +1 -0
- package/dist/proactive-contention.d.ts +4 -24
- package/dist/proactive-contention.d.ts.map +1 -0
- package/dist/procedural/library-maintenance.d.ts +102 -0
- package/dist/procedural/library-maintenance.d.ts.map +1 -0
- package/dist/procedural/maintenance-config.d.ts +9 -0
- package/dist/procedural/maintenance-config.d.ts.map +1 -0
- package/dist/procedural/procedure-miner.d.ts +20 -0
- package/dist/procedural/procedure-miner.d.ts.map +1 -0
- package/dist/procedural/procedure-recall.d.ts +30 -0
- package/dist/procedural/procedure-recall.d.ts.map +1 -0
- package/dist/procedural/procedure-stats.d.ts +68 -0
- package/dist/procedural/procedure-stats.d.ts.map +1 -0
- package/dist/procedural/procedure-types.d.ts +26 -0
- package/dist/procedural/procedure-types.d.ts.map +1 -0
- package/dist/procedural/reinforcement-core.d.ts +39 -0
- package/dist/procedural/reinforcement-core.d.ts.map +1 -0
- package/dist/procedural/skill-io.d.ts +70 -0
- package/dist/procedural/skill-io.d.ts.map +1 -0
- package/dist/procedural/skill-projection.d.ts +98 -0
- package/dist/procedural/skill-projection.d.ts.map +1 -0
- package/dist/profiling.d.ts +10 -11
- package/dist/profiling.d.ts.map +1 -0
- package/dist/projection/index.d.ts +62 -0
- package/dist/projection/index.d.ts.map +1 -0
- package/dist/provenance.d.ts +13 -33
- package/dist/provenance.d.ts.map +1 -0
- package/dist/provenance.js +2 -2
- package/dist/providers/codex-subscription.d.ts +115 -0
- package/dist/providers/codex-subscription.d.ts.map +1 -0
- package/dist/qmd-preflight.d.ts +31 -21
- package/dist/qmd-preflight.d.ts.map +1 -0
- package/dist/qmd-recall-cache.d.ts +11 -30
- package/dist/qmd-recall-cache.d.ts.map +1 -0
- package/dist/qmd-status.d.ts +10 -11
- package/dist/qmd-status.d.ts.map +1 -0
- package/dist/qmd.d.ts +325 -21
- package/dist/qmd.d.ts.map +1 -0
- package/dist/reasoning-trace-recall.d.ts +7 -8
- package/dist/reasoning-trace-recall.d.ts.map +1 -0
- package/dist/reasoning-trace-types.d.ts +9 -10
- package/dist/reasoning-trace-types.d.ts.map +1 -0
- package/dist/recall-audit-anomaly.d.ts +11 -15
- package/dist/recall-audit-anomaly.d.ts.map +1 -0
- package/dist/recall-audit.d.ts +6 -8
- package/dist/recall-audit.d.ts.map +1 -0
- package/dist/recall-composition-decision.d.ts +9 -12
- package/dist/recall-composition-decision.d.ts.map +1 -0
- package/dist/recall-concurrency-config.d.ts +3 -22
- package/dist/recall-concurrency-config.d.ts.map +1 -0
- package/dist/recall-context-composition.d.ts +21 -22
- package/dist/recall-context-composition.d.ts.map +1 -0
- package/dist/recall-deep-access.d.ts +9 -12
- package/dist/recall-deep-access.d.ts.map +1 -0
- package/dist/recall-deep-budget-left.d.ts +2 -3
- package/dist/recall-deep-budget-left.d.ts.map +1 -0
- package/dist/recall-deep-budget.d.ts +2 -3
- package/dist/recall-deep-budget.d.ts.map +1 -0
- package/dist/recall-deep-expand-select.d.ts +4 -5
- package/dist/recall-deep-expand-select.d.ts.map +1 -0
- package/dist/recall-deep-expand.d.ts +2 -3
- package/dist/recall-deep-expand.d.ts.map +1 -0
- package/dist/recall-deep-frontier.d.ts +4 -5
- package/dist/recall-deep-frontier.d.ts.map +1 -0
- package/dist/recall-deep-policy.d.ts +5 -6
- package/dist/recall-deep-policy.d.ts.map +1 -0
- package/dist/recall-deep-query.d.ts +3 -4
- package/dist/recall-deep-query.d.ts.map +1 -0
- package/dist/recall-deep-refine.d.ts +2 -3
- package/dist/recall-deep-refine.d.ts.map +1 -0
- package/dist/recall-deep-render.d.ts +3 -6
- package/dist/recall-deep-render.d.ts.map +1 -0
- package/dist/recall-deep-rewrite.d.ts +4 -5
- package/dist/recall-deep-rewrite.d.ts.map +1 -0
- package/dist/recall-deep-step-count.d.ts +2 -3
- package/dist/recall-deep-step-count.d.ts.map +1 -0
- package/dist/recall-deep-stop-reason.d.ts +5 -6
- package/dist/recall-deep-stop-reason.d.ts.map +1 -0
- package/dist/recall-deep-stop.d.ts +6 -7
- package/dist/recall-deep-stop.d.ts.map +1 -0
- package/dist/recall-deep-trace-empty.d.ts +2 -3
- package/dist/recall-deep-trace-empty.d.ts.map +1 -0
- package/dist/recall-deep-working-set.d.ts +2 -3
- package/dist/recall-deep-working-set.d.ts.map +1 -0
- package/dist/recall-deep.d.ts +11 -12
- package/dist/recall-deep.d.ts.map +1 -0
- package/dist/recall-disclosure-escalation.d.ts +9 -29
- package/dist/recall-disclosure-escalation.d.ts.map +1 -0
- package/dist/recall-explain-renderer.d.ts +12 -38
- package/dist/recall-explain-renderer.d.ts.map +1 -0
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-handles.d.ts +23 -24
- package/dist/recall-handles.d.ts.map +1 -0
- package/dist/recall-memory-map.d.ts +8 -27
- package/dist/recall-memory-map.d.ts.map +1 -0
- package/dist/recall-mmr.d.ts +13 -14
- package/dist/recall-mmr.d.ts.map +1 -0
- package/dist/recall-navigate-access.d.ts +6 -27
- package/dist/recall-navigate-access.d.ts.map +1 -0
- package/dist/recall-navigate-access.js +2 -2
- package/dist/recall-navigate-action.d.ts +5 -5
- package/dist/recall-navigate-action.d.ts.map +1 -0
- package/dist/recall-navigate-budget.d.ts +3 -4
- package/dist/recall-navigate-budget.d.ts.map +1 -0
- package/dist/recall-navigate-cost.d.ts +2 -3
- package/dist/recall-navigate-cost.d.ts.map +1 -0
- package/dist/recall-navigate-depth.d.ts +2 -3
- package/dist/recall-navigate-depth.d.ts.map +1 -0
- package/dist/recall-navigate-disclosure.d.ts +5 -25
- package/dist/recall-navigate-disclosure.d.ts.map +1 -0
- package/dist/recall-navigate-disclosure.js +2 -2
- package/dist/recall-navigate-link.d.ts +5 -5
- package/dist/recall-navigate-link.d.ts.map +1 -0
- package/dist/recall-navigate-max-children.d.ts +2 -3
- package/dist/recall-navigate-max-children.d.ts.map +1 -0
- package/dist/recall-navigate-node.d.ts +3 -4
- package/dist/recall-navigate-node.d.ts.map +1 -0
- package/dist/recall-navigate-path.d.ts +2 -3
- package/dist/recall-navigate-path.d.ts.map +1 -0
- package/dist/recall-navigate-render.d.ts +3 -4
- package/dist/recall-navigate-render.d.ts.map +1 -0
- package/dist/recall-navigate-traverse.d.ts +5 -6
- package/dist/recall-navigate-traverse.d.ts.map +1 -0
- package/dist/recall-navigate-window.d.ts +5 -6
- package/dist/recall-navigate-window.d.ts.map +1 -0
- package/dist/recall-navigate.d.ts +13 -33
- package/dist/recall-navigate.d.ts.map +1 -0
- package/dist/recall-navigate.js +2 -2
- package/dist/recall-navigation-config.d.ts +7 -8
- package/dist/recall-navigation-config.d.ts.map +1 -0
- package/dist/recall-navigation-http-glue.d.ts +5 -151
- package/dist/recall-navigation-http-glue.d.ts.map +1 -0
- package/dist/recall-navigation-http-glue.js +2 -2
- package/dist/recall-navigation-mcp-tools.d.ts +3 -150
- package/dist/recall-navigation-mcp-tools.d.ts.map +1 -0
- package/dist/recall-navigation-operations.d.ts +11 -2
- package/dist/recall-navigation-operations.d.ts.map +1 -0
- package/dist/recall-navigation-operations.js +66 -61
- package/dist/recall-navigation-renderer.d.ts +4 -28
- package/dist/recall-navigation-renderer.d.ts.map +1 -0
- package/dist/recall-navigation.d.ts +13 -34
- package/dist/recall-navigation.d.ts.map +1 -0
- package/dist/recall-navigation.js +65 -60
- package/dist/recall-pipeline-stages.d.ts +6 -9
- package/dist/recall-pipeline-stages.d.ts.map +1 -0
- package/dist/recall-planner-i18n.d.ts +13 -14
- package/dist/recall-planner-i18n.d.ts.map +1 -0
- package/dist/recall-planner-llm.d.ts +8 -30
- package/dist/recall-planner-llm.d.ts.map +1 -0
- package/dist/recall-qos.d.ts +13 -15
- package/dist/recall-qos.d.ts.map +1 -0
- package/dist/recall-query-policy.d.ts +9 -10
- package/dist/recall-query-policy.d.ts.map +1 -0
- package/dist/recall-recognition-tier.d.ts +27 -28
- package/dist/recall-recognition-tier.d.ts.map +1 -0
- package/dist/recall-state-view-admission.d.ts +7 -26
- package/dist/recall-state-view-admission.d.ts.map +1 -0
- package/dist/recall-state-view-admission.js +3 -3
- package/dist/recall-state-view-anchors.d.ts +10 -29
- package/dist/recall-state-view-anchors.d.ts.map +1 -0
- package/dist/recall-state-view-current.d.ts +4 -5
- package/dist/recall-state-view-current.d.ts.map +1 -0
- package/dist/recall-state-view-inject.d.ts +3 -7
- package/dist/recall-state-view-inject.d.ts.map +1 -0
- package/dist/recall-state-view-kind.d.ts +5 -5
- package/dist/recall-state-view-kind.d.ts.map +1 -0
- package/dist/recall-state-view-label.d.ts +3 -6
- package/dist/recall-state-view-label.d.ts.map +1 -0
- package/dist/recall-state-view-packet.d.ts +7 -9
- package/dist/recall-state-view-packet.d.ts.map +1 -0
- package/dist/recall-state-view-render.d.ts +4 -7
- package/dist/recall-state-view-render.d.ts.map +1 -0
- package/dist/recall-state-view-successor.d.ts +3 -4
- package/dist/recall-state-view-successor.d.ts.map +1 -0
- package/dist/recall-state-view-superseded.d.ts +3 -4
- package/dist/recall-state-view-superseded.d.ts.map +1 -0
- package/dist/recall-state-view-transition.d.ts +4 -5
- package/dist/recall-state-view-transition.d.ts.map +1 -0
- package/dist/recall-state-view-widen.d.ts +3 -6
- package/dist/recall-state-view-widen.d.ts.map +1 -0
- package/dist/recall-state-view-wire.d.ts +3 -6
- package/dist/recall-state-view-wire.d.ts.map +1 -0
- package/dist/recall-state-view-zero-diff.d.ts +4 -5
- package/dist/recall-state-view-zero-diff.d.ts.map +1 -0
- package/dist/recall-state-view.d.ts +16 -17
- package/dist/recall-state-view.d.ts.map +1 -0
- package/dist/recall-state.d.ts +17 -35
- package/dist/recall-state.d.ts.map +1 -0
- package/dist/recall-tag-filter.d.ts +10 -33
- package/dist/recall-tag-filter.d.ts.map +1 -0
- package/dist/recall-timings.d.ts +10 -29
- package/dist/recall-timings.d.ts.map +1 -0
- package/dist/recall-tokenization.d.ts +7 -8
- package/dist/recall-tokenization.d.ts.map +1 -0
- package/dist/recall-why-cli.d.ts +25 -0
- package/dist/recall-why-cli.d.ts.map +1 -0
- package/dist/recall-why-cli.js +9 -0
- package/dist/recall-why-cli.js.map +1 -0
- package/dist/recall-why-renderer.d.ts +25 -0
- package/dist/recall-why-renderer.d.ts.map +1 -0
- package/dist/recall-why-renderer.js +18 -0
- package/dist/recall-why-renderer.js.map +1 -0
- package/dist/recall-why-service.d.ts +49 -0
- package/dist/recall-why-service.d.ts.map +1 -0
- package/dist/recall-why-service.js +46 -0
- package/dist/recall-why-service.js.map +1 -0
- package/dist/recall-why.d.ts +175 -0
- package/dist/recall-why.d.ts.map +1 -0
- package/dist/recall-why.js +25 -0
- package/dist/recall-why.js.map +1 -0
- package/dist/recall-xray-cli.d.ts +7 -31
- package/dist/recall-xray-cli.d.ts.map +1 -0
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +9 -33
- package/dist/recall-xray-renderer.d.ts.map +1 -0
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +19 -39
- package/dist/recall-xray.d.ts.map +1 -0
- package/dist/recall-xray.js +2 -2
- package/dist/reconcile/cursor.d.ts +15 -37
- package/dist/reconcile/cursor.d.ts.map +1 -0
- package/dist/reconcile/manifest.d.ts +19 -40
- package/dist/reconcile/manifest.d.ts.map +1 -0
- package/dist/reconcile/manifest.js +2 -2
- package/dist/reconcile/plan.d.ts +22 -42
- package/dist/reconcile/plan.d.ts.map +1 -0
- package/dist/reconstruct.d.ts +2 -3
- package/dist/reconstruct.d.ts.map +1 -0
- package/dist/relay/mission-access.d.ts +28 -0
- package/dist/relay/mission-access.d.ts.map +1 -0
- package/dist/relay/mission-fixture.d.ts +11 -0
- package/dist/relay/mission-fixture.d.ts.map +1 -0
- package/dist/relay/mission.d.ts +3952 -0
- package/dist/relay/mission.d.ts.map +1 -0
- package/dist/release-changelog.d.ts +3 -4
- package/dist/release-changelog.d.ts.map +1 -0
- package/dist/relevance.d.ts +3 -3
- package/dist/relevance.d.ts.map +1 -0
- package/dist/replay/normalizers/chatgpt.d.ts +3 -23
- package/dist/replay/normalizers/chatgpt.d.ts.map +1 -0
- package/dist/replay/normalizers/claude.d.ts +3 -23
- package/dist/replay/normalizers/claude.d.ts.map +1 -0
- package/dist/replay/normalizers/openclaw.d.ts +3 -23
- package/dist/replay/normalizers/openclaw.d.ts.map +1 -0
- package/dist/replay/normalizers/shared.d.ts +6 -25
- package/dist/replay/normalizers/shared.d.ts.map +1 -0
- package/dist/replay/runner.d.ts +10 -30
- package/dist/replay/runner.d.ts.map +1 -0
- package/dist/replay/types.d.ts +18 -37
- package/dist/replay/types.d.ts.map +1 -0
- package/dist/replica-divergence.d.ts +24 -45
- package/dist/replica-divergence.d.ts.map +1 -0
- package/dist/replica-divergence.js +3 -3
- package/dist/replica-peers-config.d.ts +50 -18
- package/dist/replica-peers-config.d.ts.map +1 -0
- package/dist/rerank.d.ts +8 -9
- package/dist/rerank.d.ts.map +1 -0
- package/dist/resolution-CHNISQJB.js +36 -0
- package/dist/resolution-CHNISQJB.js.map +1 -0
- package/dist/resolve-auth-token.d.ts +9 -27
- package/dist/resolve-auth-token.d.ts.map +1 -0
- package/dist/resolve-provider-secret.d.ts +10 -11
- package/dist/resolve-provider-secret.d.ts.map +1 -0
- package/dist/response-guidance-recall.d.ts +5 -8
- package/dist/response-guidance-recall.d.ts.map +1 -0
- package/dist/resume-bundles.d.ts +9 -10
- package/dist/resume-bundles.d.ts.map +1 -0
- package/dist/resume-bundles.js +24 -24
- package/dist/retrieval-agents.d.ts +14 -36
- package/dist/retrieval-agents.d.ts.map +1 -0
- package/dist/retrieval-tiers.d.ts +4 -24
- package/dist/retrieval-tiers.d.ts.map +1 -0
- package/dist/retrieval.d.ts +5 -6
- package/dist/retrieval.d.ts.map +1 -0
- package/dist/review/frontmatter.d.ts +6 -0
- package/dist/review/frontmatter.d.ts.map +1 -0
- package/dist/review/index.d.ts +81 -0
- package/dist/review/index.d.ts.map +1 -0
- package/dist/review/review-deck-http-base.d.ts +10 -0
- package/dist/review/review-deck-http-base.d.ts.map +1 -0
- package/dist/review/review-deck-mutation.d.ts +51 -0
- package/dist/review/review-deck-mutation.d.ts.map +1 -0
- package/dist/review/review-deck-snapshot.d.ts +10 -0
- package/dist/review/review-deck-snapshot.d.ts.map +1 -0
- package/dist/review/review-deck-surface.d.ts +33 -0
- package/dist/review/review-deck-surface.d.ts.map +1 -0
- package/dist/review/review-deck.d.ts +107 -0
- package/dist/review/review-deck.d.ts.map +1 -0
- package/dist/routing/engine.d.ts +12 -31
- package/dist/routing/engine.d.ts.map +1 -0
- package/dist/routing/store.d.ts +3 -23
- package/dist/routing/store.d.ts.map +1 -0
- package/dist/runtime/better-sqlite.d.ts +9 -10
- package/dist/runtime/better-sqlite.d.ts.map +1 -0
- package/dist/runtime/child-process.d.ts +5 -5
- package/dist/runtime/child-process.d.ts.map +1 -0
- package/dist/runtime/daemon-health.d.ts +2 -0
- package/dist/runtime/daemon-health.d.ts.map +1 -0
- package/dist/runtime/env.d.ts +5 -6
- package/dist/runtime/env.d.ts.map +1 -0
- package/dist/runtime/http-transport.d.ts +3 -4
- package/dist/runtime/http-transport.d.ts.map +1 -0
- package/dist/salvage-envelope.d.ts +3 -23
- package/dist/salvage-envelope.d.ts.map +1 -0
- package/dist/sanitize.d.ts +5 -7
- package/dist/sanitize.d.ts.map +1 -0
- package/dist/schemas.d.ts +205 -207
- package/dist/schemas.d.ts.map +1 -0
- package/dist/scopes/scope-plan.d.ts +258 -0
- package/dist/scopes/scope-plan.d.ts.map +1 -0
- package/dist/sdk-compat.d.ts +4 -5
- package/dist/sdk-compat.d.ts.map +1 -0
- package/dist/search/abort.d.ts +5 -0
- package/dist/search/abort.d.ts.map +1 -0
- package/dist/search/document-scanner.d.ts +3 -4
- package/dist/search/document-scanner.d.ts.map +1 -0
- package/dist/search/embed-helper.d.ts +8 -26
- package/dist/search/embed-helper.d.ts.map +1 -0
- package/dist/search/factory.d.ts +10 -31
- package/dist/search/factory.d.ts.map +1 -0
- package/dist/search/factory.js +4 -4
- package/dist/search/index.d.ts +11 -32
- package/dist/search/index.d.ts.map +1 -0
- package/dist/search/index.js +10 -10
- package/dist/search/lancedb-backend.d.ts +5 -26
- package/dist/search/lancedb-backend.d.ts.map +1 -0
- package/dist/search/meilisearch-backend.d.ts +4 -24
- package/dist/search/meilisearch-backend.d.ts.map +1 -0
- package/dist/search/noop-backend.d.ts +3 -23
- package/dist/search/noop-backend.d.ts.map +1 -0
- package/dist/search/orama-backend.d.ts +6 -27
- package/dist/search/orama-backend.d.ts.map +1 -0
- package/dist/search/orama-cjk-tokenizer.d.ts +53 -0
- package/dist/search/orama-cjk-tokenizer.d.ts.map +1 -0
- package/dist/search/port.d.ts +10 -29
- package/dist/search/port.d.ts.map +1 -0
- package/dist/search/remote-backend.d.ts +4 -24
- package/dist/search/remote-backend.d.ts.map +1 -0
- package/dist/secure-store/cipher.d.ts +127 -0
- package/dist/secure-store/cipher.d.ts.map +1 -0
- package/dist/secure-store/cli-handlers.d.ts +134 -0
- package/dist/secure-store/cli-handlers.d.ts.map +1 -0
- package/dist/secure-store/cli-renderer.d.ts +16 -0
- package/dist/secure-store/cli-renderer.d.ts.map +1 -0
- package/dist/secure-store/header.d.ts +137 -0
- package/dist/secure-store/header.d.ts.map +1 -0
- package/dist/secure-store/index.d.ts +23 -899
- package/dist/secure-store/index.d.ts.map +1 -0
- package/dist/secure-store/kdf.d.ts +101 -0
- package/dist/secure-store/kdf.d.ts.map +1 -0
- package/dist/secure-store/keyring.d.ts +58 -0
- package/dist/secure-store/keyring.d.ts.map +1 -0
- package/dist/secure-store/metadata.d.ts +104 -0
- package/dist/secure-store/metadata.d.ts.map +1 -0
- package/dist/secure-store/passphrase-reader.d.ts +40 -0
- package/dist/secure-store/passphrase-reader.d.ts.map +1 -0
- package/dist/secure-store/secure-fs.d.ts +227 -0
- package/dist/secure-store/secure-fs.d.ts.map +1 -0
- package/dist/security/audit-memory-cli.d.ts +9 -0
- package/dist/security/audit-memory-cli.d.ts.map +1 -0
- package/dist/security/audit-memory.d.ts +48 -0
- package/dist/security/audit-memory.d.ts.map +1 -0
- package/dist/security/injection-screen.d.ts +19 -0
- package/dist/security/injection-screen.d.ts.map +1 -0
- package/dist/security/origin-authority.d.ts +30 -0
- package/dist/security/origin-authority.d.ts.map +1 -0
- package/dist/security/types.d.ts +13 -0
- package/dist/security/types.d.ts.map +1 -0
- package/dist/semantic-chunking.d.ts +13 -16
- package/dist/semantic-chunking.d.ts.map +1 -0
- package/dist/semantic-consolidation.d.ts +126 -22
- package/dist/semantic-consolidation.d.ts.map +1 -0
- package/dist/semantic-consolidation.js +15 -15
- package/dist/semantic-merge-config.d.ts +2 -3
- package/dist/semantic-merge-config.d.ts.map +1 -0
- package/dist/semantic-rule-promotion.d.ts +7 -7
- package/dist/semantic-rule-promotion.d.ts.map +1 -0
- package/dist/semantic-rule-promotion.js +14 -14
- package/dist/semantic-rule-verifier.d.ts +6 -25
- package/dist/semantic-rule-verifier.d.ts.map +1 -0
- package/dist/semantic-rule-verifier.js +14 -14
- package/dist/session-identity.d.ts +10 -11
- package/dist/session-identity.d.ts.map +1 -0
- package/dist/session-integrity.d.ts +14 -15
- package/dist/session-integrity.d.ts.map +1 -0
- package/dist/session-namespace-bindings.d.ts +10 -11
- package/dist/session-namespace-bindings.d.ts.map +1 -0
- package/dist/session-observer-bands.d.ts +4 -23
- package/dist/session-observer-bands.d.ts.map +1 -0
- package/dist/session-observer-state.d.ts +6 -25
- package/dist/session-observer-state.d.ts.map +1 -0
- package/dist/session-summaries/adapters.d.ts +5 -0
- package/dist/session-summaries/adapters.d.ts.map +1 -0
- package/dist/session-summaries/index.d.ts +7 -0
- package/dist/session-summaries/index.d.ts.map +1 -0
- package/dist/session-summaries/redaction.d.ts +8 -0
- package/dist/session-summaries/redaction.d.ts.map +1 -0
- package/dist/session-summaries/types.d.ts +113 -0
- package/dist/session-summaries/types.d.ts.map +1 -0
- package/dist/session-toggles.d.ts +4 -4
- package/dist/session-toggles.d.ts.map +1 -0
- package/dist/session-transcript-migration.d.ts +9 -10
- package/dist/session-transcript-migration.d.ts.map +1 -0
- package/dist/shared-context/authority-precedence.d.ts +22 -0
- package/dist/shared-context/authority-precedence.d.ts.map +1 -0
- package/dist/shared-context/authority.d.ts +18 -0
- package/dist/shared-context/authority.d.ts.map +1 -0
- package/dist/shared-context/claim-key.d.ts +14 -0
- package/dist/shared-context/claim-key.d.ts.map +1 -0
- package/dist/shared-context/contradictions.d.ts +20 -0
- package/dist/shared-context/contradictions.d.ts.map +1 -0
- package/dist/shared-context/curation-lint.d.ts +23 -0
- package/dist/shared-context/curation-lint.d.ts.map +1 -0
- package/dist/shared-context/envelope-actor.d.ts +14 -0
- package/dist/shared-context/envelope-actor.d.ts.map +1 -0
- package/dist/shared-context/envelope-at.d.ts +19 -0
- package/dist/shared-context/envelope-at.d.ts.map +1 -0
- package/dist/shared-context/envelope-id.d.ts +14 -0
- package/dist/shared-context/envelope-id.d.ts.map +1 -0
- package/dist/shared-context/envelope-io.d.ts +100 -0
- package/dist/shared-context/envelope-io.d.ts.map +1 -0
- package/dist/shared-context/envelope-required.d.ts +14 -0
- package/dist/shared-context/envelope-required.d.ts.map +1 -0
- package/dist/shared-context/envelope-ttl.d.ts +12 -0
- package/dist/shared-context/envelope-ttl.d.ts.map +1 -0
- package/dist/shared-context/governance.d.ts +28 -0
- package/dist/shared-context/governance.d.ts.map +1 -0
- package/dist/shared-context/iso-instant.d.ts +19 -0
- package/dist/shared-context/iso-instant.d.ts.map +1 -0
- package/dist/shared-context/manager.d.ts +21 -48
- package/dist/shared-context/manager.d.ts.map +1 -0
- package/dist/shared-context/provenance.d.ts +18 -0
- package/dist/shared-context/provenance.d.ts.map +1 -0
- package/dist/shared-context/staleness.d.ts +18 -0
- package/dist/shared-context/staleness.d.ts.map +1 -0
- package/dist/shared-context/supersession-chain.d.ts +41 -0
- package/dist/shared-context/supersession-chain.d.ts.map +1 -0
- package/dist/shared-context/trajectories.d.ts +24 -0
- package/dist/shared-context/trajectories.d.ts.map +1 -0
- package/dist/shared-context/write-output-controls.d.ts +4 -5
- package/dist/shared-context/write-output-controls.d.ts.map +1 -0
- package/dist/signal.d.ts +4 -23
- package/dist/signal.d.ts.map +1 -0
- package/dist/skills-registry.d.ts +4 -5
- package/dist/skills-registry.d.ts.map +1 -0
- package/dist/source-agent-qualifier.d.ts +8 -27
- package/dist/source-agent-qualifier.d.ts.map +1 -0
- package/dist/source-agent-qualifier.js +23 -23
- package/dist/source-attribution.d.ts +20 -21
- package/dist/source-attribution.d.ts.map +1 -0
- package/dist/spaces/index.d.ts +148 -0
- package/dist/spaces/index.d.ts.map +1 -0
- package/dist/standing-memory-block.d.ts +25 -26
- package/dist/standing-memory-block.d.ts.map +1 -0
- package/dist/standup/access-operations.d.ts +2 -0
- package/dist/standup/access-operations.d.ts.map +1 -0
- package/dist/standup/build.d.ts +6 -7
- package/dist/standup/build.d.ts.map +1 -0
- package/dist/standup/build.js +15 -15
- package/dist/standup/http-glue.d.ts +4 -0
- package/dist/standup/http-glue.d.ts.map +1 -0
- package/dist/standup/mcp-tools.d.ts +3 -0
- package/dist/standup/mcp-tools.d.ts.map +1 -0
- package/dist/storage/cas-revision-host.d.ts +34 -0
- package/dist/storage/cas-revision-host.d.ts.map +1 -0
- package/dist/storage/cas-revision-store.d.ts +176 -0
- package/dist/storage/cas-revision-store.d.ts.map +1 -0
- package/dist/storage/citation-hash-source.d.ts +3 -0
- package/dist/storage/citation-hash-source.d.ts.map +1 -0
- package/dist/storage/committed-invalidation.d.ts +9 -0
- package/dist/storage/committed-invalidation.d.ts.map +1 -0
- package/dist/storage/content-hash-index.d.ts +269 -0
- package/dist/storage/content-hash-index.d.ts.map +1 -0
- package/dist/storage/context-transform-ledger.d.ts +10 -0
- package/dist/storage/context-transform-ledger.d.ts.map +1 -0
- package/dist/storage/deletion-revision-store.d.ts +79 -0
- package/dist/storage/deletion-revision-store.d.ts.map +1 -0
- package/dist/storage/entity-alias-config.d.ts +2 -0
- package/dist/storage/entity-alias-config.d.ts.map +1 -0
- package/dist/storage/entity-canonical-id-lock.d.ts +4 -0
- package/dist/storage/entity-canonical-id-lock.d.ts.map +1 -0
- package/dist/storage/entity-canonical-id-migration-adapter.d.ts +24 -0
- package/dist/storage/entity-canonical-id-migration-adapter.d.ts.map +1 -0
- package/dist/storage/entity-canonical-id-migration-runner.d.ts +16 -0
- package/dist/storage/entity-canonical-id-migration-runner.d.ts.map +1 -0
- package/dist/storage/entity-canonical-id-migration.d.ts +44 -0
- package/dist/storage/entity-canonical-id-migration.d.ts.map +1 -0
- package/dist/storage/entity-canonical-id-references.d.ts +173 -0
- package/dist/storage/entity-canonical-id-references.d.ts.map +1 -0
- package/dist/storage/entity-id-safety.d.ts +2 -0
- package/dist/storage/entity-id-safety.d.ts.map +1 -0
- package/dist/storage/entity-ref-repair.d.ts +45 -0
- package/dist/storage/entity-ref-repair.d.ts.map +1 -0
- package/dist/storage/entity-store.d.ts +131 -0
- package/dist/storage/entity-store.d.ts.map +1 -0
- package/dist/storage/entity-timeline.d.ts +34 -0
- package/dist/storage/entity-timeline.d.ts.map +1 -0
- package/dist/storage/identity-continuity-store.d.ts +40 -0
- package/dist/storage/identity-continuity-store.d.ts.map +1 -0
- package/dist/storage/memory-frontmatter-metadata.d.ts +4 -0
- package/dist/storage/memory-frontmatter-metadata.d.ts.map +1 -0
- package/dist/storage/memory-lifecycle-ledger-access.d.ts +194 -0
- package/dist/storage/memory-lifecycle-ledger-access.d.ts.map +1 -0
- package/dist/storage/memory-migration-serialization.d.ts +5 -0
- package/dist/storage/memory-migration-serialization.d.ts.map +1 -0
- package/dist/storage/memory-read-store.d.ts +193 -0
- package/dist/storage/memory-read-store.d.ts.map +1 -0
- package/dist/storage/profile-header.d.ts +16 -0
- package/dist/storage/profile-header.d.ts.map +1 -0
- package/dist/storage/questions-file.d.ts +11 -0
- package/dist/storage/questions-file.d.ts.map +1 -0
- package/dist/storage/secure-line-reader.d.ts +53 -0
- package/dist/storage/secure-line-reader.d.ts.map +1 -0
- package/dist/storage/supersession-audit.d.ts +7 -0
- package/dist/storage/supersession-audit.d.ts.map +1 -0
- package/dist/storage/supersession-side-effects.d.ts +51 -0
- package/dist/storage/supersession-side-effects.d.ts.map +1 -0
- package/dist/storage/tombstone-blocked-capture-index.d.ts +93 -0
- package/dist/storage/tombstone-blocked-capture-index.d.ts.map +1 -0
- package/dist/storage/tombstone-blocked-capture-mutation.d.ts +53 -0
- package/dist/storage/tombstone-blocked-capture-mutation.d.ts.map +1 -0
- package/dist/storage/tombstone-blocked-capture-sync.d.ts +96 -0
- package/dist/storage/tombstone-blocked-capture-sync.d.ts.map +1 -0
- package/dist/storage/tombstone-migration-sources.d.ts +24 -0
- package/dist/storage/tombstone-migration-sources.d.ts.map +1 -0
- package/dist/storage/windowed-memory-read.d.ts +28 -0
- package/dist/storage/windowed-memory-read.d.ts.map +1 -0
- package/dist/storage-contract/harness.d.ts +59 -0
- package/dist/storage-contract/harness.d.ts.map +1 -0
- package/dist/storage-guards.d.ts +6 -7
- package/dist/storage-guards.d.ts.map +1 -0
- package/dist/storage-paths.d.ts +8 -9
- package/dist/storage-paths.d.ts.map +1 -0
- package/dist/storage.d.ts +1362 -33
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +15 -15
- package/dist/store-contract.d.ts +9 -10
- package/dist/store-contract.d.ts.map +1 -0
- package/dist/structured-attributes.d.ts +6 -7
- package/dist/structured-attributes.d.ts.map +1 -0
- package/dist/subject-config.d.ts +4 -24
- package/dist/subject-config.d.ts.map +1 -0
- package/dist/summarizer.d.ts +7 -27
- package/dist/summarizer.d.ts.map +1 -0
- package/dist/summarizer.js +3 -3
- package/dist/summary-snapshot.d.ts +6 -25
- package/dist/summary-snapshot.d.ts.map +1 -0
- package/dist/support-passport/access-http-base.d.ts +20 -0
- package/dist/support-passport/access-http-base.d.ts.map +1 -0
- package/dist/support-passport/access-http.d.ts +64 -0
- package/dist/support-passport/access-http.d.ts.map +1 -0
- package/dist/support-passport/access-operations.d.ts +197 -0
- package/dist/support-passport/access-operations.d.ts.map +1 -0
- package/dist/support-passport/access-service-base.d.ts +86 -0
- package/dist/support-passport/access-service-base.d.ts.map +1 -0
- package/dist/support-passport/access-surface.d.ts +118 -0
- package/dist/support-passport/access-surface.d.ts.map +1 -0
- package/dist/support-passport/card-projection.d.ts +83 -0
- package/dist/support-passport/card-projection.d.ts.map +1 -0
- package/dist/support-passport/card-replacement.d.ts +21 -0
- package/dist/support-passport/card-replacement.d.ts.map +1 -0
- package/dist/support-passport/card-service.d.ts +65 -0
- package/dist/support-passport/card-service.d.ts.map +1 -0
- package/dist/support-passport/card-state.d.ts +28 -0
- package/dist/support-passport/card-state.d.ts.map +1 -0
- package/dist/support-passport/config.d.ts +4 -0
- package/dist/support-passport/config.d.ts.map +1 -0
- package/dist/support-passport/contracts.d.ts +165 -0
- package/dist/support-passport/contracts.d.ts.map +1 -0
- package/dist/support-passport/errors.d.ts +7 -0
- package/dist/support-passport/errors.d.ts.map +1 -0
- package/dist/support-passport/generated-batch.d.ts +47 -0
- package/dist/support-passport/generated-batch.d.ts.map +1 -0
- package/dist/support-passport/grant-contracts.d.ts +443 -0
- package/dist/support-passport/grant-contracts.d.ts.map +1 -0
- package/dist/support-passport/grant-service.d.ts +48 -0
- package/dist/support-passport/grant-service.d.ts.map +1 -0
- package/dist/support-passport/grant-store.d.ts +84 -0
- package/dist/support-passport/grant-store.d.ts.map +1 -0
- package/dist/support-passport/index.d.ts +17 -571
- package/dist/support-passport/index.d.ts.map +1 -0
- package/dist/support-passport/index.js +75 -70
- package/dist/support-passport/mcp-tools.d.ts +16 -0
- package/dist/support-passport/mcp-tools.d.ts.map +1 -0
- package/dist/support-passport/model-adapter.d.ts +90 -0
- package/dist/support-passport/model-adapter.d.ts.map +1 -0
- package/dist/support-passport/model-audit.d.ts +115 -0
- package/dist/support-passport/model-audit.d.ts.map +1 -0
- package/dist/support-passport/model-bridge.d.ts +105 -0
- package/dist/support-passport/model-bridge.d.ts.map +1 -0
- package/dist/support-passport/model-contracts.d.ts +219 -0
- package/dist/support-passport/model-contracts.d.ts.map +1 -0
- package/dist/support-passport/model-service.d.ts +58 -0
- package/dist/support-passport/model-service.d.ts.map +1 -0
- package/dist/support-passport/offline-sync-guard.d.ts +46 -0
- package/dist/support-passport/offline-sync-guard.d.ts.map +1 -0
- package/dist/support-passport/owner-lock.d.ts +16 -0
- package/dist/support-passport/owner-lock.d.ts.map +1 -0
- package/dist/support-passport/private-file.d.ts +16 -0
- package/dist/support-passport/private-file.d.ts.map +1 -0
- package/dist/support-passport/public-http.d.ts +23 -0
- package/dist/support-passport/public-http.d.ts.map +1 -0
- package/dist/surfaces/dreams.d.ts +4 -5
- package/dist/surfaces/dreams.d.ts.map +1 -0
- package/dist/surfaces/heartbeat.d.ts +4 -5
- package/dist/surfaces/heartbeat.d.ts.map +1 -0
- package/dist/sync/index.d.ts +69 -0
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/targeted-fact-recall.d.ts +5 -8
- package/dist/targeted-fact-recall.d.ts.map +1 -0
- package/dist/task-llm-config.d.ts +4 -5
- package/dist/task-llm-config.d.ts.map +1 -0
- package/dist/taxonomy/default-taxonomy.d.ts +7 -0
- package/dist/taxonomy/default-taxonomy.d.ts.map +1 -0
- package/dist/taxonomy/index.d.ts +11 -0
- package/dist/taxonomy/index.d.ts.map +1 -0
- package/dist/taxonomy/resolver-doc-generator.d.ts +17 -0
- package/dist/taxonomy/resolver-doc-generator.d.ts.map +1 -0
- package/dist/taxonomy/resolver.d.ts +25 -0
- package/dist/taxonomy/resolver.d.ts.map +1 -0
- package/dist/taxonomy/taxonomy-loader.d.ts +38 -0
- package/dist/taxonomy/taxonomy-loader.d.ts.map +1 -0
- package/dist/taxonomy/types.d.ts +49 -0
- package/dist/taxonomy/types.d.ts.map +1 -0
- package/dist/telemetry-transcript.d.ts +6 -7
- package/dist/telemetry-transcript.d.ts.map +1 -0
- package/dist/temporal-index-batch.d.ts +30 -1
- package/dist/temporal-index-batch.d.ts.map +1 -0
- package/dist/temporal-index-compat.d.ts +7 -267
- package/dist/temporal-index-compat.d.ts.map +1 -0
- package/dist/temporal-index.d.ts +230 -1
- package/dist/temporal-index.d.ts.map +1 -0
- package/dist/temporal-supersession.d.ts +14 -34
- package/dist/temporal-supersession.d.ts.map +1 -0
- package/dist/temporal-timeline-recall.d.ts +5 -24
- package/dist/temporal-timeline-recall.d.ts.map +1 -0
- package/dist/temporal-validity.d.ts +7 -27
- package/dist/temporal-validity.d.ts.map +1 -0
- package/dist/testing/lifecycle-matrix.d.ts +11 -12
- package/dist/testing/lifecycle-matrix.d.ts.map +1 -0
- package/dist/testing/orchestrator-lite.d.ts +80 -0
- package/dist/testing/orchestrator-lite.d.ts.map +1 -0
- package/dist/testing/subjects/meetings-namespace-harness.d.ts +32 -0
- package/dist/testing/subjects/meetings-namespace-harness.d.ts.map +1 -0
- package/dist/testing/tmp-dir.d.ts +9 -0
- package/dist/testing/tmp-dir.d.ts.map +1 -0
- package/dist/thread-key.d.ts +2 -3
- package/dist/thread-key.d.ts.map +1 -0
- package/dist/threading.d.ts +3 -23
- package/dist/threading.d.ts.map +1 -0
- package/dist/tier-migration.d.ts +10 -43
- package/dist/tier-migration.d.ts.map +1 -0
- package/dist/tier-routing.d.ts +8 -27
- package/dist/tier-routing.d.ts.map +1 -0
- package/dist/tmt.d.ts +18 -19
- package/dist/tmt.d.ts.map +1 -0
- package/dist/token-estimate.d.ts +2 -3
- package/dist/token-estimate.d.ts.map +1 -0
- package/dist/tokens.d.ts +15 -19
- package/dist/tokens.d.ts.map +1 -0
- package/dist/tokens.js +3 -3
- package/dist/tool-scoped-memory.d.ts +7 -8
- package/dist/tool-scoped-memory.d.ts.map +1 -0
- package/dist/topics.d.ts +4 -24
- package/dist/topics.d.ts.map +1 -0
- package/dist/training-export/converter.d.ts +18 -0
- package/dist/training-export/converter.d.ts.map +1 -0
- package/dist/training-export/date-parse.d.ts +38 -0
- package/dist/training-export/date-parse.d.ts.map +1 -0
- package/dist/training-export/index.d.ts +10 -0
- package/dist/training-export/index.d.ts.map +1 -0
- package/dist/training-export/registry.d.ts +27 -0
- package/dist/training-export/registry.d.ts.map +1 -0
- package/dist/training-export/types.d.ts +29 -0
- package/dist/training-export/types.d.ts.map +1 -0
- package/dist/transcript.d.ts +5 -24
- package/dist/transcript.d.ts.map +1 -0
- package/dist/transfer/autodetect.d.ts +3 -4
- package/dist/transfer/autodetect.d.ts.map +1 -0
- package/dist/transfer/backup.d.ts +3 -4
- package/dist/transfer/backup.d.ts.map +1 -0
- package/dist/transfer/backup.js +2 -2
- package/dist/transfer/capsule-crypto.d.ts +168 -0
- package/dist/transfer/capsule-crypto.d.ts.map +1 -0
- package/dist/transfer/capsule-export.d.ts +6 -9
- package/dist/transfer/capsule-export.d.ts.map +1 -0
- package/dist/transfer/capsule-export.js +2 -2
- package/dist/transfer/capsule-fork.d.ts +117 -0
- package/dist/transfer/capsule-fork.d.ts.map +1 -0
- package/dist/transfer/capsule-import.d.ts +10 -13
- package/dist/transfer/capsule-import.d.ts.map +1 -0
- package/dist/transfer/capsule-import.js +2 -2
- package/dist/transfer/capsule-merge.d.ts +124 -0
- package/dist/transfer/capsule-merge.d.ts.map +1 -0
- package/dist/transfer/conflict-policy.d.ts +5 -0
- package/dist/transfer/conflict-policy.d.ts.map +1 -0
- package/dist/transfer/constants.d.ts +4 -5
- package/dist/transfer/constants.d.ts.map +1 -0
- package/dist/transfer/exclusions.d.ts +8 -0
- package/dist/transfer/exclusions.d.ts.map +1 -0
- package/dist/transfer/export-json.d.ts +3 -4
- package/dist/transfer/export-json.d.ts.map +1 -0
- package/dist/transfer/export-md.d.ts +4 -5
- package/dist/transfer/export-md.d.ts.map +1 -0
- package/dist/transfer/export-okf.d.ts +11 -31
- package/dist/transfer/export-okf.d.ts.map +1 -0
- package/dist/transfer/export-okf.js +14 -14
- package/dist/transfer/export-sqlite.d.ts +3 -4
- package/dist/transfer/export-sqlite.d.ts.map +1 -0
- package/dist/transfer/fs-utils.d.ts +20 -21
- package/dist/transfer/fs-utils.d.ts.map +1 -0
- package/dist/transfer/import-json.d.ts +6 -7
- package/dist/transfer/import-json.d.ts.map +1 -0
- package/dist/transfer/import-md.d.ts +5 -6
- package/dist/transfer/import-md.d.ts.map +1 -0
- package/dist/transfer/import-sqlite.d.ts +5 -6
- package/dist/transfer/import-sqlite.d.ts.map +1 -0
- package/dist/transfer/integrity.d.ts +8 -0
- package/dist/transfer/integrity.d.ts.map +1 -0
- package/dist/transfer/sqlite-schema.d.ts +3 -4
- package/dist/transfer/sqlite-schema.d.ts.map +1 -0
- package/dist/transfer/types.d.ts +114 -116
- package/dist/transfer/types.d.ts.map +1 -0
- package/dist/trust-score-stage.d.ts +21 -40
- package/dist/trust-score-stage.d.ts.map +1 -0
- package/dist/trust-score.d.ts +15 -34
- package/dist/trust-score.d.ts.map +1 -0
- package/dist/trust-zones.d.ts +29 -30
- package/dist/trust-zones.d.ts.map +1 -0
- package/dist/types-continuity.d.ts +10 -11
- package/dist/types-continuity.d.ts.map +1 -0
- package/dist/types.d.ts +3500 -18
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -1
- package/dist/user-message-cleaning.d.ts +3 -4
- package/dist/user-message-cleaning.d.ts.map +1 -0
- package/dist/user-model.d.ts +17 -18
- package/dist/user-model.d.ts.map +1 -0
- package/dist/utility-learner.d.ts +10 -12
- package/dist/utility-learner.d.ts.map +1 -0
- package/dist/utility-runtime.d.ts +6 -27
- package/dist/utility-runtime.d.ts.map +1 -0
- package/dist/utility-telemetry.d.ts +12 -13
- package/dist/utility-telemetry.d.ts.map +1 -0
- package/dist/utils/category-dir.d.ts +45 -0
- package/dist/utils/category-dir.d.ts.map +1 -0
- package/dist/utils/errno.d.ts +4 -0
- package/dist/utils/errno.d.ts.map +1 -0
- package/dist/utils/iso-timestamp.d.ts +18 -0
- package/dist/utils/iso-timestamp.d.ts.map +1 -0
- package/dist/utils/path-containment.d.ts +50 -0
- package/dist/utils/path-containment.d.ts.map +1 -0
- package/dist/utils/path.d.ts +2 -3
- package/dist/utils/path.d.ts.map +1 -0
- package/dist/utils/script-aware-text.d.ts +27 -0
- package/dist/utils/script-aware-text.d.ts.map +1 -0
- package/dist/utils/serialize-mutations.d.ts +6 -7
- package/dist/utils/serialize-mutations.d.ts.map +1 -0
- package/dist/utils/yaml-scalar.d.ts +9 -0
- package/dist/utils/yaml-scalar.d.ts.map +1 -0
- package/dist/verified-recall.d.ts +5 -7
- package/dist/verified-recall.d.ts.map +1 -0
- package/dist/verified-recall.js +14 -14
- package/dist/version-utils.d.ts +3 -4
- package/dist/version-utils.d.ts.map +1 -0
- package/dist/wearables/auto-sync.d.ts +63 -0
- package/dist/wearables/auto-sync.d.ts.map +1 -0
- package/dist/wearables/cleanup.d.ts +39 -0
- package/dist/wearables/cleanup.d.ts.map +1 -0
- package/dist/wearables/cli.d.ts +24 -0
- package/dist/wearables/cli.d.ts.map +1 -0
- package/dist/wearables/config.d.ts +22 -0
- package/dist/wearables/config.d.ts.map +1 -0
- package/dist/wearables/corrections.d.ts +46 -0
- package/dist/wearables/corrections.d.ts.map +1 -0
- package/dist/wearables/day-store.d.ts +152 -0
- package/dist/wearables/day-store.d.ts.map +1 -0
- package/dist/wearables/errors.d.ts +19 -0
- package/dist/wearables/errors.d.ts.map +1 -0
- package/dist/wearables/fusion/cluster.d.ts +70 -0
- package/dist/wearables/fusion/cluster.d.ts.map +1 -0
- package/dist/wearables/fusion/fuse.d.ts +40 -0
- package/dist/wearables/fusion/fuse.d.ts.map +1 -0
- package/dist/wearables/fusion/index.d.ts +16 -0
- package/dist/wearables/fusion/index.d.ts.map +1 -0
- package/dist/wearables/fusion/reconcile.d.ts +52 -0
- package/dist/wearables/fusion/reconcile.d.ts.map +1 -0
- package/dist/wearables/fusion/reconstruct.d.ts +37 -0
- package/dist/wearables/fusion/reconstruct.d.ts.map +1 -0
- package/dist/wearables/fusion/store.d.ts +131 -0
- package/dist/wearables/fusion/store.d.ts.map +1 -0
- package/dist/wearables/fusion/types.d.ts +219 -0
- package/dist/wearables/fusion/types.d.ts.map +1 -0
- package/dist/wearables/http-glue.d.ts +12 -0
- package/dist/wearables/http-glue.d.ts.map +1 -0
- package/dist/wearables/index.d.ts +23 -0
- package/dist/wearables/index.d.ts.map +1 -0
- package/dist/wearables/mcp-tools.d.ts +12 -0
- package/dist/wearables/mcp-tools.d.ts.map +1 -0
- package/dist/wearables/memory-gen.d.ts +139 -0
- package/dist/wearables/memory-gen.d.ts.map +1 -0
- package/dist/wearables/pipeline.d.ts +81 -0
- package/dist/wearables/pipeline.d.ts.map +1 -0
- package/dist/wearables/redaction.d.ts +75 -0
- package/dist/wearables/redaction.d.ts.map +1 -0
- package/dist/wearables/registry.d.ts +47 -0
- package/dist/wearables/registry.d.ts.map +1 -0
- package/dist/wearables/service.d.ts +225 -0
- package/dist/wearables/service.d.ts.map +1 -0
- package/dist/wearables/speakers.d.ts +83 -0
- package/dist/wearables/speakers.d.ts.map +1 -0
- package/dist/wearables/sync-state.d.ts +52 -0
- package/dist/wearables/sync-state.d.ts.map +1 -0
- package/dist/wearables/text-language.d.ts +41 -0
- package/dist/wearables/text-language.d.ts.map +1 -0
- package/dist/wearables/trust.d.ts +93 -0
- package/dist/wearables/trust.d.ts.map +1 -0
- package/dist/wearables/types.d.ts +389 -0
- package/dist/wearables/types.d.ts.map +1 -0
- package/dist/whitespace.d.ts +7 -8
- package/dist/whitespace.d.ts.map +1 -0
- package/dist/who-knows-cli.d.ts +8 -155
- package/dist/who-knows-cli.d.ts.map +1 -0
- package/dist/who-knows-cli.js +16 -16
- package/dist/who-knows.d.ts +97 -145
- package/dist/who-knows.d.ts.map +1 -0
- package/dist/who-knows.js +15 -15
- package/dist/work/board.d.ts +8 -10
- package/dist/work/board.d.ts.map +1 -0
- package/dist/work/boundary.d.ts +5 -6
- package/dist/work/boundary.d.ts.map +1 -0
- package/dist/work/storage.d.ts +4 -6
- package/dist/work/storage.d.ts.map +1 -0
- package/dist/work/types.d.ts +11 -12
- package/dist/work/types.d.ts.map +1 -0
- package/dist/work-product-ledger.d.ts +12 -13
- package/dist/work-product-ledger.d.ts.map +1 -0
- package/dist/write-envelope.d.ts +23 -42
- package/dist/write-envelope.d.ts.map +1 -0
- package/dist/write-quarantine.d.ts +8 -9
- package/dist/write-quarantine.d.ts.map +1 -0
- package/dist/write-rate-limiter.d.ts +4 -4
- package/dist/write-rate-limiter.d.ts.map +1 -0
- package/package.json +2 -2
- package/scripts/build-with-heap.mjs +40 -19
- package/src/access-boundary.ts +1 -0
- package/src/access-errors.test.ts +182 -0
- package/src/access-errors.ts +252 -1
- package/src/access-http.ts +36 -103
- package/src/access-mcp-output-schemas.ts +1 -0
- package/src/access-mcp.ts +21 -2
- package/src/access-operations-batch.ts +8 -0
- package/src/access-recall-diagnostics.ts +236 -0
- package/src/access-service.ts +6 -0
- package/src/access-surface-catalog.ts +2 -0
- package/src/index.ts +11 -0
- package/src/mcp-read-only-tools.ts +1 -0
- package/src/orchestration/orchestrator-helpers.ts +7 -0
- package/src/orchestration/recall-internal.ts +1 -1
- package/src/recall-degradation-sink.test.ts +144 -0
- package/src/recall-why-cli.ts +59 -0
- package/src/recall-why-renderer.ts +142 -0
- package/src/recall-why-service.test.ts +306 -0
- package/src/recall-why-service.ts +218 -0
- package/src/recall-why.test.ts +511 -0
- package/src/recall-why.ts +568 -0
- package/src/types.ts +1 -0
- package/dist/access-namespace-preflight-U9RAdxqZ.d.ts +0 -146
- package/dist/access-service-CUNM5RfA.d.ts +0 -4700
- package/dist/capsule-crypto-YO5QJ6L3.js +0 -18
- package/dist/catalog-BuMyYPUn.d.ts +0 -473
- package/dist/chunk-27MKMTBY.js +0 -342
- package/dist/chunk-2HJKAVAS.js +0 -216
- package/dist/chunk-2QZJ4P27.js +0 -203
- package/dist/chunk-2SIKTXWX.js +0 -502
- package/dist/chunk-2Z24E5W2.js +0 -22
- package/dist/chunk-2Z24E5W2.js.map +0 -1
- package/dist/chunk-3R23DDD3.js +0 -9782
- package/dist/chunk-3S6URXEH.js +0 -63
- package/dist/chunk-43IQRLEF.js +0 -256
- package/dist/chunk-4UVJ6EIT.js +0 -22
- package/dist/chunk-4UVJ6EIT.js.map +0 -1
- package/dist/chunk-5FAGCOZD.js +0 -761
- package/dist/chunk-75YZ5VAI.js +0 -140
- package/dist/chunk-7IRZK6MM.js +0 -256
- package/dist/chunk-7QVYVSEH.js +0 -285
- package/dist/chunk-7RGX7BMF.js +0 -103
- package/dist/chunk-7RKAE6Y4.js +0 -727
- package/dist/chunk-AH44WTLJ.js +0 -415
- package/dist/chunk-AHVJ6GLL.js +0 -95
- package/dist/chunk-AIVRD66I.js +0 -511
- package/dist/chunk-AQ55YKEV.js +0 -29
- package/dist/chunk-AQWGCHIV.js +0 -263
- package/dist/chunk-ARRKSBQU.js +0 -72
- package/dist/chunk-AYHNTYVG.js +0 -43
- package/dist/chunk-BSCNBIF4.js +0 -24
- package/dist/chunk-BXLOS5AJ.js +0 -112
- package/dist/chunk-BXOPUJ3W.js +0 -801
- package/dist/chunk-CEO4DONG.js +0 -28
- package/dist/chunk-CVILPI77.js +0 -432
- package/dist/chunk-D2N3PMAE.js +0 -51
- package/dist/chunk-D7VT2LED.js +0 -253
- package/dist/chunk-DAOMWGO2.js +0 -65
- package/dist/chunk-DGS34QSY.js +0 -141
- package/dist/chunk-DI52XAKG.js +0 -223
- package/dist/chunk-DQEMWVMT.js +0 -249
- package/dist/chunk-DZP2XMZC.js +0 -1084
- package/dist/chunk-EVQ33D3N.js +0 -731
- package/dist/chunk-FPB5LQWW.js +0 -71
- package/dist/chunk-FPB5LQWW.js.map +0 -1
- package/dist/chunk-FROKVQQY.js +0 -3997
- package/dist/chunk-FROKVQQY.js.map +0 -1
- package/dist/chunk-G7S37WD4.js +0 -801
- package/dist/chunk-GRDRVYXJ.js +0 -1917
- package/dist/chunk-H6WOFMOV.js +0 -346
- package/dist/chunk-HMDYSGY6.js +0 -54
- package/dist/chunk-HNHIHXSD.js +0 -879
- package/dist/chunk-HWLIMQE2.js +0 -165
- package/dist/chunk-IWO6QXWJ.js +0 -224
- package/dist/chunk-IYNCJKBM.js +0 -3602
- package/dist/chunk-IYNCJKBM.js.map +0 -1
- package/dist/chunk-J54B5DGD.js +0 -1530
- package/dist/chunk-JMZQS6OS.js +0 -81
- package/dist/chunk-K4KE5MYE.js +0 -648
- package/dist/chunk-K4KE5MYE.js.map +0 -1
- package/dist/chunk-KH2D26LQ.js +0 -2440
- package/dist/chunk-KIGC55FQ.js +0 -5505
- package/dist/chunk-KQVBR7BC.js +0 -1286
- package/dist/chunk-L63GFNKL.js +0 -403
- package/dist/chunk-LIAKZGOY.js +0 -25
- package/dist/chunk-LVFI5LG7.js +0 -576
- package/dist/chunk-MTWD4KMM.js +0 -223
- package/dist/chunk-MWVYHNSU.js +0 -623
- package/dist/chunk-MZWSOLMT.js +0 -189
- package/dist/chunk-NNEWBRUL.js +0 -271
- package/dist/chunk-NPX6WMFJ.js +0 -1686
- package/dist/chunk-O7OVWKT4.js +0 -768
- package/dist/chunk-PLJ2MQFT.js +0 -182
- package/dist/chunk-Q4AUIFUA.js +0 -111
- package/dist/chunk-QWQB7TOB.js +0 -11341
- package/dist/chunk-QZ4U67KO.js +0 -98
- package/dist/chunk-RMMVQQA6.js +0 -70
- package/dist/chunk-RSMNPYBM.js +0 -61
- package/dist/chunk-RUUJXAGT.js +0 -122
- package/dist/chunk-S45INSV3.js +0 -389
- package/dist/chunk-SCXURCVT.js +0 -218
- package/dist/chunk-SGUDMW2K.js +0 -3400
- package/dist/chunk-SLGD36MM.js +0 -53
- package/dist/chunk-SMBWBEE7.js +0 -73
- package/dist/chunk-SPFNGHHP.js +0 -115
- package/dist/chunk-SPWNCGSM.js +0 -77
- package/dist/chunk-SZ7IVZGD.js +0 -112
- package/dist/chunk-TJNDFNCU.js +0 -597
- package/dist/chunk-TJNDFNCU.js.map +0 -1
- package/dist/chunk-TQT4AOPO.js +0 -321
- package/dist/chunk-TTFJQ5B5.js +0 -43
- package/dist/chunk-U2SK45U3.js +0 -1476
- package/dist/chunk-UCH2RWFX.js +0 -216
- package/dist/chunk-UDJMJNBK.js +0 -549
- package/dist/chunk-UJBIWY5M.js +0 -212
- package/dist/chunk-ULQVG6G3.js +0 -275
- package/dist/chunk-VDX2J7OX.js +0 -264
- package/dist/chunk-VGO57TU7.js +0 -960
- package/dist/chunk-VUV472VH.js +0 -1008
- package/dist/chunk-VVX5PZFS.js +0 -297
- package/dist/chunk-WH7RINGG.js +0 -315
- package/dist/chunk-WUJD4CHZ.js +0 -137
- package/dist/chunk-X7WAM3IY.js +0 -30
- package/dist/chunk-XPFJSUOR.js +0 -921
- package/dist/chunk-XVZA6VXC.js +0 -160
- package/dist/chunk-XZRZJHBW.js +0 -31013
- package/dist/chunk-XZRZJHBW.js.map +0 -1
- package/dist/chunk-Y4G6LHJW.js +0 -35
- package/dist/chunk-Y7LZ5V7N.js +0 -202
- package/dist/chunk-YEIKOBOW.js +0 -628
- package/dist/chunk-YEIKOBOW.js.map +0 -1
- package/dist/chunk-YIIW2OH2.js +0 -566
- package/dist/chunk-ZBYVR5W4.js +0 -18504
- package/dist/chunk-ZBYVR5W4.js.map +0 -1
- package/dist/chunk-ZN7SMKAK.js +0 -210
- package/dist/chunk-ZP73EM2X.js +0 -74
- package/dist/chunk-ZXQPAYCS.js +0 -2453
- package/dist/cli-CCc34xV7.d.ts +0 -1136
- package/dist/conflict-policy-DyJ2wd-h.d.ts +0 -4
- package/dist/connectors-cli-2iaQ5tX2.d.ts +0 -263
- package/dist/dependency-propagation-delivery-BrhPjAHQ.d.ts +0 -41
- package/dist/faiss-adapter-BHecI1fF.d.ts +0 -73
- package/dist/framework-CNDn2164.d.ts +0 -170
- package/dist/generic-recall-paths-C0J1Oxb7.d.ts +0 -23
- package/dist/graph-DRkl22KE.d.ts +0 -347
- package/dist/graph-edge-decay-MKIRZ762.js +0 -30
- package/dist/index-B735x-tK.d.ts +0 -284
- package/dist/local-llm-BkkEK9rn.d.ts +0 -247
- package/dist/maintenance-CLBIvVxg.d.ts +0 -749
- package/dist/orchestrator-iexgVLow.d.ts +0 -2701
- package/dist/pipeline-DvtDtyo9.d.ts +0 -32
- package/dist/public-http-UWVcqMcb.d.ts +0 -25
- package/dist/qmd-CBYBJ6HW.d.ts +0 -353
- package/dist/resolution-LXFQQ4AE.js +0 -36
- package/dist/scope-profiles-BN1Dgfha.d.ts +0 -30
- package/dist/semantic-BalR6EXU.d.ts +0 -87
- package/dist/semantic-consolidation-D--qe0eE.d.ts +0 -180
- package/dist/service-VealHeqO.d.ts +0 -846
- package/dist/storage-BhS9gUx3.d.ts +0 -166
- package/dist/storage-CMm-3aD3.d.ts +0 -2421
- package/dist/tagging-BjsNFKWz.d.ts +0 -240
- package/dist/types-B1VHaf2w.d.ts +0 -126
- package/dist/types-DJhqDJUV.d.ts +0 -50
- package/dist/types-Du6VdoAg.d.ts +0 -5482
- /package/dist/{capsule-crypto-YO5QJ6L3.js.map → access-recall-diagnostics.js.map} +0 -0
- /package/dist/{graph-edge-decay-MKIRZ762.js.map → capsule-crypto-7FJQINUR.js.map} +0 -0
- /package/dist/{chunk-KQVBR7BC.js.map → chunk-2CBWEIS4.js.map} +0 -0
- /package/dist/{chunk-JMZQS6OS.js.map → chunk-2JQZSQXI.js.map} +0 -0
- /package/dist/{chunk-BXLOS5AJ.js.map → chunk-2NLLXCJG.js.map} +0 -0
- /package/dist/{chunk-LIAKZGOY.js.map → chunk-2WMXZYMS.js.map} +0 -0
- /package/dist/{chunk-RSMNPYBM.js.map → chunk-34ZGBAGE.js.map} +0 -0
- /package/dist/{chunk-MWVYHNSU.js.map → chunk-36S7UHAW.js.map} +0 -0
- /package/dist/{chunk-G7S37WD4.js.map → chunk-3JLWSFTV.js.map} +0 -0
- /package/dist/{chunk-75YZ5VAI.js.map → chunk-3RZOLUZT.js.map} +0 -0
- /package/dist/{chunk-XVZA6VXC.js.map → chunk-3SL52JKD.js.map} +0 -0
- /package/dist/{chunk-2SIKTXWX.js.map → chunk-4QEZS7PK.js.map} +0 -0
- /package/dist/{chunk-Y4G6LHJW.js.map → chunk-5QRYGLZN.js.map} +0 -0
- /package/dist/{chunk-AQWGCHIV.js.map → chunk-5R3C5LEZ.js.map} +0 -0
- /package/dist/{chunk-SPWNCGSM.js.map → chunk-634UKELB.js.map} +0 -0
- /package/dist/{chunk-BXOPUJ3W.js.map → chunk-64JK4TL7.js.map} +0 -0
- /package/dist/{chunk-DGS34QSY.js.map → chunk-6E5GYDIE.js.map} +0 -0
- /package/dist/{chunk-D2N3PMAE.js.map → chunk-6ISP2EN2.js.map} +0 -0
- /package/dist/{chunk-UJBIWY5M.js.map → chunk-6RD7MSIO.js.map} +0 -0
- /package/dist/{chunk-RMMVQQA6.js.map → chunk-6UDLN4IA.js.map} +0 -0
- /package/dist/{chunk-7IRZK6MM.js.map → chunk-754XN6LX.js.map} +0 -0
- /package/dist/{chunk-43IQRLEF.js.map → chunk-7H2LEYYJ.js.map} +0 -0
- /package/dist/{chunk-7RGX7BMF.js.map → chunk-A7AISUJI.js.map} +0 -0
- /package/dist/{chunk-7RKAE6Y4.js.map → chunk-AULKCNZW.js.map} +0 -0
- /package/dist/{chunk-NPX6WMFJ.js.map → chunk-B7SSU55V.js.map} +0 -0
- /package/dist/{chunk-IWO6QXWJ.js.map → chunk-BICNRVEC.js.map} +0 -0
- /package/dist/{chunk-SLGD36MM.js.map → chunk-BJI2D4SU.js.map} +0 -0
- /package/dist/{chunk-CEO4DONG.js.map → chunk-BQB5ZMYO.js.map} +0 -0
- /package/dist/{chunk-WH7RINGG.js.map → chunk-C5CPYMLX.js.map} +0 -0
- /package/dist/{chunk-AHVJ6GLL.js.map → chunk-CS2JO77A.js.map} +0 -0
- /package/dist/{chunk-UDJMJNBK.js.map → chunk-DTABICJ3.js.map} +0 -0
- /package/dist/{chunk-CVILPI77.js.map → chunk-E6UNM67F.js.map} +0 -0
- /package/dist/{chunk-NNEWBRUL.js.map → chunk-ENUI3IO7.js.map} +0 -0
- /package/dist/{chunk-DZP2XMZC.js.map → chunk-FF2XYADH.js.map} +0 -0
- /package/dist/{chunk-S45INSV3.js.map → chunk-FF6N7BXC.js.map} +0 -0
- /package/dist/{chunk-2QZJ4P27.js.map → chunk-FSXD6Y4H.js.map} +0 -0
- /package/dist/{chunk-SGUDMW2K.js.map → chunk-GK6NOQE6.js.map} +0 -0
- /package/dist/{chunk-TTFJQ5B5.js.map → chunk-GRSFFLUY.js.map} +0 -0
- /package/dist/{chunk-5FAGCOZD.js.map → chunk-GWK7FEUL.js.map} +0 -0
- /package/dist/{chunk-SCXURCVT.js.map → chunk-GWQVMKUJ.js.map} +0 -0
- /package/dist/{chunk-3S6URXEH.js.map → chunk-HKHZWJ3E.js.map} +0 -0
- /package/dist/{chunk-PLJ2MQFT.js.map → chunk-IAZPYX6W.js.map} +0 -0
- /package/dist/{chunk-MZWSOLMT.js.map → chunk-IG747LRN.js.map} +0 -0
- /package/dist/{chunk-X7WAM3IY.js.map → chunk-IK63WA5A.js.map} +0 -0
- /package/dist/{chunk-BSCNBIF4.js.map → chunk-IUD6NLNM.js.map} +0 -0
- /package/dist/{chunk-3R23DDD3.js.map → chunk-JSJZ2NXS.js.map} +0 -0
- /package/dist/{chunk-YIIW2OH2.js.map → chunk-JUOJGZPV.js.map} +0 -0
- /package/dist/{chunk-VGO57TU7.js.map → chunk-KA4U5GQN.js.map} +0 -0
- /package/dist/{chunk-VDX2J7OX.js.map → chunk-KQAFEZQX.js.map} +0 -0
- /package/dist/{chunk-ARRKSBQU.js.map → chunk-L4WBADKG.js.map} +0 -0
- /package/dist/{chunk-ULQVG6G3.js.map → chunk-LAL4B37X.js.map} +0 -0
- /package/dist/{chunk-D7VT2LED.js.map → chunk-LELJRLPY.js.map} +0 -0
- /package/dist/{chunk-L63GFNKL.js.map → chunk-LMMQKZK3.js.map} +0 -0
- /package/dist/{chunk-ZP73EM2X.js.map → chunk-LQ23DMTT.js.map} +0 -0
- /package/dist/{chunk-7QVYVSEH.js.map → chunk-LV6ZB6CA.js.map} +0 -0
- /package/dist/{chunk-KIGC55FQ.js.map → chunk-M5IJP3YW.js.map} +0 -0
- /package/dist/{chunk-AH44WTLJ.js.map → chunk-MWZMVLXL.js.map} +0 -0
- /package/dist/{chunk-AQ55YKEV.js.map → chunk-N4VCHRLD.js.map} +0 -0
- /package/dist/{chunk-HNHIHXSD.js.map → chunk-NKXHCCLB.js.map} +0 -0
- /package/dist/{chunk-SZ7IVZGD.js.map → chunk-NVCWA4QC.js.map} +0 -0
- /package/dist/{chunk-RUUJXAGT.js.map → chunk-ONWVMYHX.js.map} +0 -0
- /package/dist/{chunk-HMDYSGY6.js.map → chunk-P6P35FY4.js.map} +0 -0
- /package/dist/{chunk-H6WOFMOV.js.map → chunk-P7M22CYB.js.map} +0 -0
- /package/dist/{chunk-Q4AUIFUA.js.map → chunk-QMWKENNK.js.map} +0 -0
- /package/dist/{chunk-J54B5DGD.js.map → chunk-QOPB6KE3.js.map} +0 -0
- /package/dist/{chunk-DI52XAKG.js.map → chunk-RBULO7DO.js.map} +0 -0
- /package/dist/{chunk-VUV472VH.js.map → chunk-RDESQOEE.js.map} +0 -0
- /package/dist/{chunk-SPFNGHHP.js.map → chunk-RMF763SX.js.map} +0 -0
- /package/dist/{chunk-TQT4AOPO.js.map → chunk-RN6ZCNM5.js.map} +0 -0
- /package/dist/{chunk-QWQB7TOB.js.map → chunk-S2OBXHMN.js.map} +0 -0
- /package/dist/{chunk-UCH2RWFX.js.map → chunk-S3JPD4N7.js.map} +0 -0
- /package/dist/{chunk-HWLIMQE2.js.map → chunk-SF6RFI5Z.js.map} +0 -0
- /package/dist/{chunk-ZXQPAYCS.js.map → chunk-SJV3AOZ2.js.map} +0 -0
- /package/dist/{chunk-Y7LZ5V7N.js.map → chunk-SLULR4GC.js.map} +0 -0
- /package/dist/{chunk-U2SK45U3.js.map → chunk-TFXXMTHV.js.map} +0 -0
- /package/dist/{chunk-2HJKAVAS.js.map → chunk-TYP7GYRI.js.map} +0 -0
- /package/dist/{chunk-KH2D26LQ.js.map → chunk-TYZK56OA.js.map} +0 -0
- /package/dist/{chunk-XPFJSUOR.js.map → chunk-VLDVNZQE.js.map} +0 -0
- /package/dist/{chunk-AIVRD66I.js.map → chunk-W6YK672C.js.map} +0 -0
- /package/dist/{chunk-LVFI5LG7.js.map → chunk-X2NFFBTO.js.map} +0 -0
- /package/dist/{chunk-GRDRVYXJ.js.map → chunk-X45KZOT2.js.map} +0 -0
- /package/dist/{chunk-DQEMWVMT.js.map → chunk-X7Y7WX73.js.map} +0 -0
- /package/dist/{chunk-AYHNTYVG.js.map → chunk-XIXM6G7I.js.map} +0 -0
- /package/dist/{chunk-ZN7SMKAK.js.map → chunk-XLXYARWC.js.map} +0 -0
- /package/dist/{chunk-MTWD4KMM.js.map → chunk-XVW52M6I.js.map} +0 -0
- /package/dist/{chunk-27MKMTBY.js.map → chunk-YHU5XUF4.js.map} +0 -0
- /package/dist/{chunk-SMBWBEE7.js.map → chunk-YRH3C2OJ.js.map} +0 -0
- /package/dist/{chunk-WUJD4CHZ.js.map → chunk-YXQE67A7.js.map} +0 -0
- /package/dist/{chunk-EVQ33D3N.js.map → chunk-ZHUVMSHI.js.map} +0 -0
- /package/dist/{chunk-VVX5PZFS.js.map → chunk-ZHXSOMYH.js.map} +0 -0
- /package/dist/{chunk-O7OVWKT4.js.map → chunk-ZIEZJMFW.js.map} +0 -0
- /package/dist/{chunk-QZ4U67KO.js.map → chunk-ZSEFGDCI.js.map} +0 -0
- /package/dist/{chunk-DAOMWGO2.js.map → chunk-ZX5N5D6M.js.map} +0 -0
- /package/dist/{resolution-LXFQQ4AE.js.map → graph-edge-decay-ROSUPDX3.js.map} +0 -0
|
@@ -0,0 +1,2453 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ensureContradictionScanCron,
|
|
3
|
+
ensureDaySummaryCron,
|
|
4
|
+
ensureGraphEdgeDecayCron,
|
|
5
|
+
ensureNightlyGovernanceCron,
|
|
6
|
+
ensurePatternReinforcementCron,
|
|
7
|
+
ensureProceduralMiningCron,
|
|
8
|
+
graphEdgeDecayCadenceToCronExpr
|
|
9
|
+
} from "./chunk-666A3MOW.js";
|
|
10
|
+
import {
|
|
11
|
+
startLocationAutoSync
|
|
12
|
+
} from "./chunk-34ZGBAGE.js";
|
|
13
|
+
import {
|
|
14
|
+
rebuildMemoryLifecycleLedger
|
|
15
|
+
} from "./chunk-5R3C5LEZ.js";
|
|
16
|
+
import {
|
|
17
|
+
planNamespaceMaintenance,
|
|
18
|
+
runNamespaceMaintenanceBatchPlan
|
|
19
|
+
} from "./chunk-AULKCNZW.js";
|
|
20
|
+
import {
|
|
21
|
+
rebuildMemoryProjection
|
|
22
|
+
} from "./chunk-RDESQOEE.js";
|
|
23
|
+
import {
|
|
24
|
+
DEFAULT_TIMELINE_CATEGORIES,
|
|
25
|
+
TIMELINE_RESERVED_IDLE,
|
|
26
|
+
TIMELINE_RESERVED_PAUSE,
|
|
27
|
+
TIMELINE_RESERVED_UNKNOWN,
|
|
28
|
+
analyzeTimelineCards,
|
|
29
|
+
buildAnalysisRunMetadata,
|
|
30
|
+
timelineAnalysisCompleteFromClients,
|
|
31
|
+
validateActivityBaseUrl,
|
|
32
|
+
validateTimelineCategories
|
|
33
|
+
} from "./chunk-QOPB6KE3.js";
|
|
34
|
+
import {
|
|
35
|
+
LocalLlmClient
|
|
36
|
+
} from "./chunk-G2XZFGYN.js";
|
|
37
|
+
import {
|
|
38
|
+
FallbackLlmClient
|
|
39
|
+
} from "./chunk-ZTHGFTMW.js";
|
|
40
|
+
import {
|
|
41
|
+
fallbackLlmRuntimeContextFromConfig
|
|
42
|
+
} from "./chunk-EP6BA7VV.js";
|
|
43
|
+
import {
|
|
44
|
+
activityDateInTimezone,
|
|
45
|
+
activityDayWindow,
|
|
46
|
+
activityDigestPath,
|
|
47
|
+
composeActivityDigestBody,
|
|
48
|
+
composeActivityDigestMeta,
|
|
49
|
+
hashActivityBody,
|
|
50
|
+
isValidActivityDate,
|
|
51
|
+
serializeActivityDigest
|
|
52
|
+
} from "./chunk-353C5UNV.js";
|
|
53
|
+
import {
|
|
54
|
+
STATE_FILE_MAX_DECRYPT_BYTES,
|
|
55
|
+
drainPendingLifecycleLedgerIfAny,
|
|
56
|
+
pendingLifecycleLedgerDir,
|
|
57
|
+
readProjectionRebuiltAt
|
|
58
|
+
} from "./chunk-JE334SIA.js";
|
|
59
|
+
import {
|
|
60
|
+
displayErrorDetail,
|
|
61
|
+
openBetterSqlite3
|
|
62
|
+
} from "./chunk-RL6NEVXT.js";
|
|
63
|
+
import {
|
|
64
|
+
assertPathInsideRoot,
|
|
65
|
+
listContainedSpillFiles
|
|
66
|
+
} from "./chunk-C7HJ3NEI.js";
|
|
67
|
+
import {
|
|
68
|
+
isSafeRouteNamespace
|
|
69
|
+
} from "./chunk-PCXDUHQH.js";
|
|
70
|
+
import {
|
|
71
|
+
namespaceIdentityFromToken
|
|
72
|
+
} from "./chunk-VUFL7X3H.js";
|
|
73
|
+
import {
|
|
74
|
+
resolveConsolidationCapabilities,
|
|
75
|
+
resolveMemoryLifecycleCapabilities,
|
|
76
|
+
resolveNamespaceCapabilities,
|
|
77
|
+
resolveQmdCapabilities,
|
|
78
|
+
resolveRecallAuxiliaryCapabilities
|
|
79
|
+
} from "./chunk-JUOZ62Y7.js";
|
|
80
|
+
import {
|
|
81
|
+
resolveHomeDir
|
|
82
|
+
} from "./chunk-P2QRMMVQ.js";
|
|
83
|
+
import {
|
|
84
|
+
SECURE_STORE_ENVELOPE_OVERHEAD_BYTES,
|
|
85
|
+
probeEncryptedRegularFileHeader
|
|
86
|
+
} from "./chunk-JN72EPOE.js";
|
|
87
|
+
import {
|
|
88
|
+
isErrnoCode
|
|
89
|
+
} from "./chunk-KNA3BXXL.js";
|
|
90
|
+
import {
|
|
91
|
+
log
|
|
92
|
+
} from "./chunk-3WCASNQZ.js";
|
|
93
|
+
|
|
94
|
+
// src/orchestration/maintenance.ts
|
|
95
|
+
import { existsSync } from "fs";
|
|
96
|
+
import { appendFile, lstat, mkdir as mkdir3, readFile as readFile2, readdir, realpath, stat, writeFile as writeFile2 } from "fs/promises";
|
|
97
|
+
import path5 from "path";
|
|
98
|
+
|
|
99
|
+
// src/maintenance/day-summary-cron.ts
|
|
100
|
+
function resolveDaySummaryCronModel(config) {
|
|
101
|
+
const rawSummaryModel = config.summaryModel;
|
|
102
|
+
const taskPrimary = config.taskModelChain?.primary;
|
|
103
|
+
const isGateway = config.modelSource === "gateway";
|
|
104
|
+
const model = isGateway ? rawSummaryModel || taskPrimary || void 0 : void 0;
|
|
105
|
+
const fallbacks = [];
|
|
106
|
+
if (model && taskPrimary && model === taskPrimary) {
|
|
107
|
+
const seen = new Set(model ? [model] : []);
|
|
108
|
+
const addUnique = (value) => {
|
|
109
|
+
if (typeof value !== "string") return;
|
|
110
|
+
const trimmed = value.trim();
|
|
111
|
+
if (trimmed.length > 0 && !seen.has(trimmed)) {
|
|
112
|
+
seen.add(trimmed);
|
|
113
|
+
fallbacks.push(trimmed);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
for (const fb of config.taskModelChain?.fallbacks ?? []) addUnique(fb);
|
|
117
|
+
const gwDefaults = config.gatewayConfig?.agents?.defaults?.model;
|
|
118
|
+
addUnique(gwDefaults?.primary);
|
|
119
|
+
if (Array.isArray(gwDefaults?.fallbacks)) {
|
|
120
|
+
for (const fb of gwDefaults.fallbacks) addUnique(fb);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return { ...model ? { model } : {}, fallbacks };
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// src/orchestration/projection-rebuild-schedule.ts
|
|
127
|
+
var FAILURE_RETRY_BACKOFF_MS = 5 * 60 * 1e3;
|
|
128
|
+
function createProjectionRebuildScheduleState() {
|
|
129
|
+
return { inFlight: false, lastRebuildAtMs: 0, lastFailureAtMs: 0 };
|
|
130
|
+
}
|
|
131
|
+
async function maybeRebuildMemoryProjectionScheduled(opts) {
|
|
132
|
+
const { config, state } = opts;
|
|
133
|
+
if (!resolveMemoryLifecycleCapabilities(config).projectionRebuild) return;
|
|
134
|
+
if (state.inFlight) return;
|
|
135
|
+
const intervalMs = config.projectionRebuildIntervalMs;
|
|
136
|
+
const now = Date.now();
|
|
137
|
+
if (now - state.lastRebuildAtMs < intervalMs) return;
|
|
138
|
+
if (now - state.lastFailureAtMs < FAILURE_RETRY_BACKOFF_MS) return;
|
|
139
|
+
const rootStorage = opts.getStorage?.();
|
|
140
|
+
const memoryDir = rootStorage ? rootStorage.dir : config.memoryDir;
|
|
141
|
+
const rebuiltAt = readProjectionRebuiltAt(memoryDir);
|
|
142
|
+
const rebuiltAtMs = rebuiltAt ? Date.parse(rebuiltAt) : Number.NaN;
|
|
143
|
+
if (Number.isFinite(rebuiltAtMs) && now - rebuiltAtMs < intervalMs) {
|
|
144
|
+
state.lastRebuildAtMs = rebuiltAtMs;
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
state.inFlight = true;
|
|
148
|
+
try {
|
|
149
|
+
const result = await rebuildMemoryProjection({
|
|
150
|
+
memoryDir,
|
|
151
|
+
// Reuse the daemon's live storage so secure-store deployments rebuild
|
|
152
|
+
// through the unlocked instance instead of a fresh locked one.
|
|
153
|
+
...rootStorage ? { storage: rootStorage } : {},
|
|
154
|
+
defaultNamespace: config.defaultNamespace,
|
|
155
|
+
dryRun: false,
|
|
156
|
+
now: new Date(now)
|
|
157
|
+
});
|
|
158
|
+
state.lastRebuildAtMs = Date.now();
|
|
159
|
+
const lag = Number.isFinite(rebuiltAtMs) ? `${Math.max(0, Math.round((now - rebuiltAtMs) / 6e4))}m stale` : "never previously built";
|
|
160
|
+
log.info(
|
|
161
|
+
`memory projection rebuilt (scheduled) for ${memoryDir}: was ${lag}; ${result.currentRows} current, ${result.timelineRows} timeline, ${result.entityMentionRows} entity-mention rows`
|
|
162
|
+
);
|
|
163
|
+
} catch (err) {
|
|
164
|
+
state.lastFailureAtMs = Date.now();
|
|
165
|
+
log.warn(`memory projection scheduled rebuild failed (non-fatal) for ${memoryDir}: ${err}`);
|
|
166
|
+
} finally {
|
|
167
|
+
state.inFlight = false;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// src/activity/reindex.ts
|
|
172
|
+
async function refreshActivityIndex(qmd, collection, signal) {
|
|
173
|
+
const execution = signal === void 0 ? void 0 : { signal };
|
|
174
|
+
if (typeof qmd.updateCollectionStrict === "function" && collection.trim().length > 0) {
|
|
175
|
+
await qmd.updateCollectionStrict(collection, execution);
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
if (typeof qmd.updateStrict === "function") {
|
|
179
|
+
await qmd.updateStrict(execution);
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
await qmd.update(execution);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// src/activity/store.ts
|
|
186
|
+
import { mkdirSync } from "fs";
|
|
187
|
+
import { mkdir } from "fs/promises";
|
|
188
|
+
import path from "path";
|
|
189
|
+
var ACTIVITY_SCHEMA_VERSION = 1;
|
|
190
|
+
var MAX_SEARCH_RESULTS = 100;
|
|
191
|
+
function activityDatabasePath(memoryDir) {
|
|
192
|
+
return path.join(memoryDir, "state", "activity.sqlite");
|
|
193
|
+
}
|
|
194
|
+
async function ensureActivityStateDir(memoryDir) {
|
|
195
|
+
await mkdir(path.join(memoryDir, "state"), { recursive: true });
|
|
196
|
+
}
|
|
197
|
+
function openActivityDatabase(memoryDir) {
|
|
198
|
+
mkdirSync(path.join(memoryDir, "state"), { recursive: true });
|
|
199
|
+
const db = openBetterSqlite3(activityDatabasePath(memoryDir));
|
|
200
|
+
db.pragma("journal_mode = WAL");
|
|
201
|
+
db.pragma("busy_timeout = 5000");
|
|
202
|
+
db.pragma("synchronous = NORMAL");
|
|
203
|
+
applySchema(db);
|
|
204
|
+
return db;
|
|
205
|
+
}
|
|
206
|
+
function applyActivitySchema(db) {
|
|
207
|
+
applySchema(db);
|
|
208
|
+
}
|
|
209
|
+
function applySchema(db) {
|
|
210
|
+
db.exec(`
|
|
211
|
+
CREATE TABLE IF NOT EXISTS activity_meta (
|
|
212
|
+
key TEXT PRIMARY KEY,
|
|
213
|
+
value TEXT NOT NULL
|
|
214
|
+
);
|
|
215
|
+
|
|
216
|
+
CREATE TABLE IF NOT EXISTS activity_snapshots (
|
|
217
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
218
|
+
machine TEXT NOT NULL,
|
|
219
|
+
captured_at_utc TEXT NOT NULL,
|
|
220
|
+
app_name TEXT NOT NULL,
|
|
221
|
+
window_title TEXT NOT NULL,
|
|
222
|
+
browser_url TEXT,
|
|
223
|
+
text TEXT NOT NULL,
|
|
224
|
+
text_source TEXT NOT NULL,
|
|
225
|
+
content_hash TEXT NOT NULL,
|
|
226
|
+
simhash TEXT
|
|
227
|
+
);
|
|
228
|
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_activity_snapshots_dedup
|
|
229
|
+
ON activity_snapshots(machine, captured_at_utc, content_hash);
|
|
230
|
+
CREATE INDEX IF NOT EXISTS idx_activity_snapshots_time
|
|
231
|
+
ON activity_snapshots(captured_at_utc, id);
|
|
232
|
+
|
|
233
|
+
CREATE TABLE IF NOT EXISTS activity_sync_state (
|
|
234
|
+
machine TEXT PRIMARY KEY,
|
|
235
|
+
cursor TEXT,
|
|
236
|
+
updated_at_utc TEXT NOT NULL
|
|
237
|
+
);
|
|
238
|
+
`);
|
|
239
|
+
const hasFts = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='activity_snapshots_fts'").get();
|
|
240
|
+
if (!hasFts) {
|
|
241
|
+
db.exec(`
|
|
242
|
+
CREATE VIRTUAL TABLE activity_snapshots_fts USING fts5(
|
|
243
|
+
text, app_name, window_title, browser_url
|
|
244
|
+
);
|
|
245
|
+
`);
|
|
246
|
+
}
|
|
247
|
+
db.prepare("INSERT OR REPLACE INTO activity_meta (key, value) VALUES ('schema_version', ?)").run(
|
|
248
|
+
String(ACTIVITY_SCHEMA_VERSION)
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
function canonicalizeUtc(iso) {
|
|
252
|
+
const parsed = Date.parse(iso);
|
|
253
|
+
return Number.isFinite(parsed) ? new Date(parsed).toISOString() : iso;
|
|
254
|
+
}
|
|
255
|
+
function assertRequiredSnapshotFields(s) {
|
|
256
|
+
const required = [
|
|
257
|
+
["machine", s.machine],
|
|
258
|
+
["app", s.app],
|
|
259
|
+
["windowTitle", s.windowTitle],
|
|
260
|
+
["text", s.text],
|
|
261
|
+
["textSource", s.textSource],
|
|
262
|
+
["contentHash", s.contentHash]
|
|
263
|
+
];
|
|
264
|
+
for (const [field, value] of required) {
|
|
265
|
+
if (typeof value !== "string") {
|
|
266
|
+
throw new RangeError(`activity: snapshot field "${field}" is required (got ${value === null ? "null" : typeof value}).`);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
if (s.machine.length === 0 || s.contentHash.length === 0) {
|
|
270
|
+
throw new RangeError('activity: snapshot "machine" and "contentHash" must be non-empty.');
|
|
271
|
+
}
|
|
272
|
+
if (s.textSource !== "ax" && s.textSource !== "ocr") {
|
|
273
|
+
throw new RangeError(`activity: snapshot "textSource" must be "ax" or "ocr" (got "${s.textSource}").`);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
function assertValidUtcInstant(iso, what) {
|
|
277
|
+
const m = iso.match(
|
|
278
|
+
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.\d+)?(?:Z|[+-](?:0\d:[0-5]\d|1[0-3]:[0-5]\d|14:00))$/
|
|
279
|
+
);
|
|
280
|
+
if (m === null || !Number.isFinite(Date.parse(iso))) {
|
|
281
|
+
throw new RangeError(`activity: invalid ${what} "${iso}".`);
|
|
282
|
+
}
|
|
283
|
+
const [year, month, day, hour, minute, second] = m.slice(1).map(Number);
|
|
284
|
+
const daysInMonth = month >= 1 && month <= 12 ? new Date(Date.UTC(year, month, 0)).getUTCDate() : 0;
|
|
285
|
+
if (day < 1 || day > daysInMonth || hour > 23 || minute > 59 || second > 59) {
|
|
286
|
+
throw new RangeError(`activity: ${what} "${iso}" is not a real calendar instant.`);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
function isRecord(value) {
|
|
290
|
+
return typeof value === "object" && value !== null;
|
|
291
|
+
}
|
|
292
|
+
function str(value) {
|
|
293
|
+
return typeof value === "string" ? value : "";
|
|
294
|
+
}
|
|
295
|
+
function optStr(value) {
|
|
296
|
+
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
297
|
+
}
|
|
298
|
+
function ftsMatchFor(query) {
|
|
299
|
+
if (typeof query !== "string") return null;
|
|
300
|
+
const tokens = query.match(/[\p{L}\p{N}_]+/gu);
|
|
301
|
+
if (!tokens || tokens.length === 0) return null;
|
|
302
|
+
return tokens.map((token) => `"${token}"`).join(" ");
|
|
303
|
+
}
|
|
304
|
+
function rowToSnapshot(row) {
|
|
305
|
+
if (!isRecord(row)) {
|
|
306
|
+
throw new Error("activity store: unexpected non-object row");
|
|
307
|
+
}
|
|
308
|
+
const textSource = row.text_source === "ocr" ? "ocr" : "ax";
|
|
309
|
+
return {
|
|
310
|
+
id: typeof row.id === "number" ? row.id : void 0,
|
|
311
|
+
machine: str(row.machine),
|
|
312
|
+
capturedAtUtc: str(row.captured_at_utc),
|
|
313
|
+
app: str(row.app_name),
|
|
314
|
+
windowTitle: str(row.window_title),
|
|
315
|
+
...optStr(row.browser_url) !== void 0 ? { browserUrl: optStr(row.browser_url) } : {},
|
|
316
|
+
text: str(row.text),
|
|
317
|
+
textSource,
|
|
318
|
+
contentHash: str(row.content_hash),
|
|
319
|
+
...optStr(row.simhash) !== void 0 ? { simhash: optStr(row.simhash) } : {}
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
var ActivityStore = class _ActivityStore {
|
|
323
|
+
db;
|
|
324
|
+
constructor(db) {
|
|
325
|
+
this.db = db;
|
|
326
|
+
}
|
|
327
|
+
static open(memoryDir) {
|
|
328
|
+
return new _ActivityStore(openActivityDatabase(memoryDir));
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Insert a snapshot, idempotent on (machine, captured_at_utc, content_hash):
|
|
332
|
+
* the same screen content recurring at a *different* time is kept; only an
|
|
333
|
+
* exact re-ingestion of the same capture dedups. Returns `inserted: false`
|
|
334
|
+
* for a duplicate. The FTS row is written only on a real insert (atomically),
|
|
335
|
+
* so it never drifts from the base table.
|
|
336
|
+
*/
|
|
337
|
+
insertSnapshot(snapshot) {
|
|
338
|
+
const runInsert = this.db.transaction((s) => {
|
|
339
|
+
assertValidUtcInstant(s.capturedAtUtc, "capture timestamp");
|
|
340
|
+
assertRequiredSnapshotFields(s);
|
|
341
|
+
const capturedAtUtc = canonicalizeUtc(s.capturedAtUtc);
|
|
342
|
+
const info = this.db.prepare(
|
|
343
|
+
`INSERT OR IGNORE INTO activity_snapshots
|
|
344
|
+
(machine, captured_at_utc, app_name, window_title, browser_url, text, text_source, content_hash, simhash)
|
|
345
|
+
VALUES (@machine, @captured_at_utc, @app_name, @window_title, @browser_url, @text, @text_source, @content_hash, @simhash)`
|
|
346
|
+
).run({
|
|
347
|
+
machine: s.machine,
|
|
348
|
+
captured_at_utc: capturedAtUtc,
|
|
349
|
+
app_name: s.app,
|
|
350
|
+
window_title: s.windowTitle,
|
|
351
|
+
browser_url: s.browserUrl ?? null,
|
|
352
|
+
text: s.text,
|
|
353
|
+
text_source: s.textSource,
|
|
354
|
+
content_hash: s.contentHash,
|
|
355
|
+
simhash: s.simhash ?? null
|
|
356
|
+
});
|
|
357
|
+
if (info.changes === 0) {
|
|
358
|
+
const existing = this.db.prepare("SELECT id FROM activity_snapshots WHERE machine = ? AND captured_at_utc = ? AND content_hash = ?").get(s.machine, capturedAtUtc, s.contentHash);
|
|
359
|
+
const id2 = isRecord(existing) && typeof existing.id === "number" ? existing.id : -1;
|
|
360
|
+
return { inserted: false, id: id2 };
|
|
361
|
+
}
|
|
362
|
+
const id = Number(info.lastInsertRowid);
|
|
363
|
+
this.db.prepare(
|
|
364
|
+
`INSERT INTO activity_snapshots_fts (rowid, text, app_name, window_title, browser_url)
|
|
365
|
+
VALUES (?, ?, ?, ?, ?)`
|
|
366
|
+
).run(id, s.text, s.app, s.windowTitle, s.browserUrl ?? "");
|
|
367
|
+
return { inserted: true, id };
|
|
368
|
+
});
|
|
369
|
+
return runInsert(snapshot);
|
|
370
|
+
}
|
|
371
|
+
/** Snapshots whose capture instant is in the half-open [start, end) window. */
|
|
372
|
+
listSnapshotsForDay(machine, startUtcInclusive, endUtcExclusive) {
|
|
373
|
+
assertValidUtcInstant(startUtcInclusive, "range start");
|
|
374
|
+
assertValidUtcInstant(endUtcExclusive, "range end");
|
|
375
|
+
const start = canonicalizeUtc(startUtcInclusive);
|
|
376
|
+
const end = canonicalizeUtc(endUtcExclusive);
|
|
377
|
+
const rows = machine === null ? this.db.prepare(
|
|
378
|
+
`SELECT * FROM activity_snapshots
|
|
379
|
+
WHERE captured_at_utc >= ? AND captured_at_utc < ?
|
|
380
|
+
ORDER BY captured_at_utc ASC, id ASC`
|
|
381
|
+
).all(start, end) : this.db.prepare(
|
|
382
|
+
`SELECT * FROM activity_snapshots
|
|
383
|
+
WHERE machine = ? AND captured_at_utc >= ? AND captured_at_utc < ?
|
|
384
|
+
ORDER BY captured_at_utc ASC, id ASC`
|
|
385
|
+
).all(machine, start, end);
|
|
386
|
+
return rows.map(rowToSnapshot);
|
|
387
|
+
}
|
|
388
|
+
getCursor(machine) {
|
|
389
|
+
const row = this.db.prepare("SELECT cursor FROM activity_sync_state WHERE machine = ?").get(machine);
|
|
390
|
+
return isRecord(row) && typeof row.cursor === "string" ? row.cursor : null;
|
|
391
|
+
}
|
|
392
|
+
setCursor(machine, cursor, updatedAtUtc = (/* @__PURE__ */ new Date()).toISOString()) {
|
|
393
|
+
this.db.prepare(
|
|
394
|
+
`INSERT INTO activity_sync_state (machine, cursor, updated_at_utc)
|
|
395
|
+
VALUES (?, ?, ?)
|
|
396
|
+
ON CONFLICT(machine) DO UPDATE SET cursor = excluded.cursor, updated_at_utc = excluded.updated_at_utc`
|
|
397
|
+
).run(machine, cursor, updatedAtUtc);
|
|
398
|
+
}
|
|
399
|
+
/** Full-text search over snapshot text/app/window/url; newest first. */
|
|
400
|
+
searchSnapshots(query, limit) {
|
|
401
|
+
const capped = Number.isInteger(limit) && limit > 0 ? Math.min(limit, MAX_SEARCH_RESULTS) : 20;
|
|
402
|
+
const match = ftsMatchFor(query);
|
|
403
|
+
if (match === null) return [];
|
|
404
|
+
const rows = this.db.prepare(
|
|
405
|
+
`SELECT s.* FROM activity_snapshots_fts f
|
|
406
|
+
JOIN activity_snapshots s ON s.id = f.rowid
|
|
407
|
+
WHERE activity_snapshots_fts MATCH ?
|
|
408
|
+
ORDER BY s.captured_at_utc DESC, s.id DESC
|
|
409
|
+
LIMIT ?`
|
|
410
|
+
).all(match, capped);
|
|
411
|
+
return rows.map(rowToSnapshot);
|
|
412
|
+
}
|
|
413
|
+
/** Retention: drop snapshots captured strictly before `cutoffUtc`. */
|
|
414
|
+
pruneOlderThan(cutoffUtc) {
|
|
415
|
+
assertValidUtcInstant(cutoffUtc, "prune cutoff");
|
|
416
|
+
const ids = this.db.prepare("SELECT id FROM activity_snapshots WHERE captured_at_utc < ?").all(canonicalizeUtc(cutoffUtc)).map((row) => isRecord(row) && typeof row.id === "number" ? row.id : -1).filter((id) => id >= 0);
|
|
417
|
+
const deleteFts = this.db.prepare("DELETE FROM activity_snapshots_fts WHERE rowid = ?");
|
|
418
|
+
const deleteRow = this.db.prepare("DELETE FROM activity_snapshots WHERE id = ?");
|
|
419
|
+
const tx = this.db.transaction((rowIds) => {
|
|
420
|
+
for (const id of rowIds) {
|
|
421
|
+
deleteFts.run(id);
|
|
422
|
+
deleteRow.run(id);
|
|
423
|
+
}
|
|
424
|
+
});
|
|
425
|
+
tx(ids);
|
|
426
|
+
return ids.length;
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* First and last stored capture instants (canonical UTC strings), or null
|
|
430
|
+
* when no snapshots exist. Backs the unbounded timeline search window.
|
|
431
|
+
*/
|
|
432
|
+
snapshotCaptureExtent() {
|
|
433
|
+
const row = this.db.prepare("SELECT MIN(captured_at_utc) AS first, MAX(captured_at_utc) AS last FROM activity_snapshots").get();
|
|
434
|
+
if (!isRecord(row) || typeof row.first !== "string" || typeof row.last !== "string") {
|
|
435
|
+
return null;
|
|
436
|
+
}
|
|
437
|
+
return { firstUtc: row.first, lastUtc: row.last };
|
|
438
|
+
}
|
|
439
|
+
close() {
|
|
440
|
+
this.db.close();
|
|
441
|
+
}
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
// src/activity/pipeline.ts
|
|
445
|
+
import { mkdir as mkdir2, readFile, rename, writeFile } from "fs/promises";
|
|
446
|
+
import { randomUUID } from "crypto";
|
|
447
|
+
import path2 from "path";
|
|
448
|
+
var MAX_SYNC_PAGES = 1e4;
|
|
449
|
+
function activityCursorKey(machine, date) {
|
|
450
|
+
return `${machine}\0${date}`;
|
|
451
|
+
}
|
|
452
|
+
var digestLocks = /* @__PURE__ */ new Map();
|
|
453
|
+
function withDigestLock(key, fn) {
|
|
454
|
+
const prior = digestLocks.get(key) ?? Promise.resolve();
|
|
455
|
+
const next = prior.then(fn, fn);
|
|
456
|
+
const tail = next.then(
|
|
457
|
+
() => void 0,
|
|
458
|
+
() => void 0
|
|
459
|
+
);
|
|
460
|
+
digestLocks.set(key, tail);
|
|
461
|
+
void tail.then(() => {
|
|
462
|
+
if (digestLocks.get(key) === tail) digestLocks.delete(key);
|
|
463
|
+
});
|
|
464
|
+
return next;
|
|
465
|
+
}
|
|
466
|
+
function snapshotForMachine(snapshot, machine) {
|
|
467
|
+
return {
|
|
468
|
+
machine,
|
|
469
|
+
capturedAtUtc: snapshot.capturedAtUtc,
|
|
470
|
+
app: snapshot.app,
|
|
471
|
+
windowTitle: snapshot.windowTitle,
|
|
472
|
+
...snapshot.browserUrl === void 0 ? {} : { browserUrl: snapshot.browserUrl },
|
|
473
|
+
text: snapshot.text,
|
|
474
|
+
textSource: snapshot.textSource,
|
|
475
|
+
contentHash: snapshot.contentHash,
|
|
476
|
+
...snapshot.simhash === void 0 ? {} : { simhash: snapshot.simhash }
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
async function writeDigestIfChanged(memoryDir, date, serialized) {
|
|
480
|
+
const target = activityDigestPath(memoryDir, date);
|
|
481
|
+
try {
|
|
482
|
+
if (await readFile(target, "utf8") === serialized) return false;
|
|
483
|
+
} catch (error) {
|
|
484
|
+
if (!(error instanceof Error) || !("code" in error) || error.code !== "ENOENT") throw error;
|
|
485
|
+
}
|
|
486
|
+
await mkdir2(path2.dirname(target), { recursive: true, mode: 448 });
|
|
487
|
+
const temporary = `${target}.${process.pid}.${randomUUID()}.tmp`;
|
|
488
|
+
await writeFile(temporary, serialized, { encoding: "utf8", mode: 384 });
|
|
489
|
+
await rename(temporary, target);
|
|
490
|
+
return true;
|
|
491
|
+
}
|
|
492
|
+
async function syncActivitySource(source, options) {
|
|
493
|
+
if (!isValidActivityDate(options.date)) {
|
|
494
|
+
throw new RangeError(`Invalid activity date "${options.date}"; expected a real YYYY-MM-DD day.`);
|
|
495
|
+
}
|
|
496
|
+
if (source.machineLabel.trim().length === 0) {
|
|
497
|
+
throw new RangeError("activity source machine label must not be empty");
|
|
498
|
+
}
|
|
499
|
+
const maxPages = options.maxPages ?? MAX_SYNC_PAGES;
|
|
500
|
+
if (!Number.isInteger(maxPages) || maxPages < 1) {
|
|
501
|
+
throw new RangeError("activity sync maxPages must be a positive integer");
|
|
502
|
+
}
|
|
503
|
+
const cursorKey = activityCursorKey(source.machineLabel, options.date);
|
|
504
|
+
let cursor = options.store.getCursor(cursorKey);
|
|
505
|
+
let pages = 0;
|
|
506
|
+
let fetched = 0;
|
|
507
|
+
let inserted = 0;
|
|
508
|
+
let duplicates = 0;
|
|
509
|
+
const seenCursors = /* @__PURE__ */ new Set();
|
|
510
|
+
let completed = false;
|
|
511
|
+
while (pages < maxPages) {
|
|
512
|
+
options.signal?.throwIfAborted();
|
|
513
|
+
const page = await source.fetchSnapshots({
|
|
514
|
+
date: options.date,
|
|
515
|
+
timezone: options.timezone,
|
|
516
|
+
cursor,
|
|
517
|
+
signal: options.signal
|
|
518
|
+
});
|
|
519
|
+
pages += 1;
|
|
520
|
+
fetched += page.snapshots.length;
|
|
521
|
+
for (const snapshot of page.snapshots) {
|
|
522
|
+
const result = options.store.insertSnapshot(snapshotForMachine(snapshot, source.machineLabel));
|
|
523
|
+
if (result.inserted) inserted += 1;
|
|
524
|
+
else duplicates += 1;
|
|
525
|
+
}
|
|
526
|
+
if (page.nextCursor === null) {
|
|
527
|
+
completed = true;
|
|
528
|
+
break;
|
|
529
|
+
}
|
|
530
|
+
if (typeof page.nextCursor !== "string" || page.nextCursor.length === 0) {
|
|
531
|
+
throw new TypeError("activity source returned an invalid cursor");
|
|
532
|
+
}
|
|
533
|
+
if (seenCursors.has(page.nextCursor)) {
|
|
534
|
+
throw new Error("activity source returned a repeated cursor");
|
|
535
|
+
}
|
|
536
|
+
seenCursors.add(page.nextCursor);
|
|
537
|
+
cursor = page.nextCursor;
|
|
538
|
+
}
|
|
539
|
+
if (!completed) {
|
|
540
|
+
throw new Error(`activity source exceeded ${maxPages} pages`);
|
|
541
|
+
}
|
|
542
|
+
options.signal?.throwIfAborted();
|
|
543
|
+
const digestWritten = await withDigestLock(`${options.memoryDir}\0${options.date}`, async () => {
|
|
544
|
+
options.signal?.throwIfAborted();
|
|
545
|
+
const { startUtc, endUtc } = activityDayWindow(options.date, options.timezone);
|
|
546
|
+
const snapshots = options.store.listSnapshotsForDay(null, startUtc, endUtc);
|
|
547
|
+
const body = composeActivityDigestBody(options.date, options.timezone, snapshots);
|
|
548
|
+
const machines = [...new Set(snapshots.map((snapshot) => snapshot.machine))].sort(
|
|
549
|
+
(a, b) => a < b ? -1 : a > b ? 1 : 0
|
|
550
|
+
);
|
|
551
|
+
const serialized = serializeActivityDigest(composeActivityDigestMeta(options.date, machines, snapshots, body), body);
|
|
552
|
+
return writeDigestIfChanged(options.memoryDir, options.date, serialized);
|
|
553
|
+
});
|
|
554
|
+
options.signal?.throwIfAborted();
|
|
555
|
+
options.store.setCursor(cursorKey, cursor);
|
|
556
|
+
let reindexError;
|
|
557
|
+
if (digestWritten && options.afterWrites !== void 0) {
|
|
558
|
+
try {
|
|
559
|
+
await options.afterWrites(options.signal);
|
|
560
|
+
} catch (error) {
|
|
561
|
+
reindexError = error instanceof Error && error.message.startsWith("QMD ") ? error.message : displayErrorDetail(error) || "reindex failed";
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
return {
|
|
565
|
+
machine: source.machineLabel,
|
|
566
|
+
fetched,
|
|
567
|
+
inserted,
|
|
568
|
+
duplicates,
|
|
569
|
+
cursor,
|
|
570
|
+
digestWritten,
|
|
571
|
+
...reindexError === void 0 ? {} : { reindexError }
|
|
572
|
+
};
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
// src/activity/source-client.ts
|
|
576
|
+
var DEFAULT_REQUEST_TIMEOUT_MS = 3e4;
|
|
577
|
+
function isRecord2(value) {
|
|
578
|
+
return typeof value === "object" && value !== null;
|
|
579
|
+
}
|
|
580
|
+
function stringField(value, field) {
|
|
581
|
+
const result = value[field];
|
|
582
|
+
if (typeof result !== "string" || result.length === 0) {
|
|
583
|
+
throw new TypeError(`activity source response has no valid ${field}`);
|
|
584
|
+
}
|
|
585
|
+
return result;
|
|
586
|
+
}
|
|
587
|
+
function contentStringField(value, field) {
|
|
588
|
+
const result = value[field];
|
|
589
|
+
if (typeof result !== "string") {
|
|
590
|
+
throw new TypeError(`activity source response has invalid ${field}`);
|
|
591
|
+
}
|
|
592
|
+
return result;
|
|
593
|
+
}
|
|
594
|
+
function optionalStringField(value, field) {
|
|
595
|
+
const result = value[field];
|
|
596
|
+
if (result === void 0 || result === null) return void 0;
|
|
597
|
+
if (typeof result !== "string") throw new TypeError(`activity source response has invalid ${field}`);
|
|
598
|
+
return result;
|
|
599
|
+
}
|
|
600
|
+
function snapshotFromWire(value, machine) {
|
|
601
|
+
if (!isRecord2(value)) throw new TypeError("activity source returned a non-object snapshot");
|
|
602
|
+
const textSource = stringField(value, "textSource");
|
|
603
|
+
if (textSource !== "ax" && textSource !== "ocr") {
|
|
604
|
+
throw new TypeError("activity source response has invalid textSource");
|
|
605
|
+
}
|
|
606
|
+
const browserUrl = optionalStringField(value, "browserUrl");
|
|
607
|
+
const simhash = optionalStringField(value, "simhash");
|
|
608
|
+
return {
|
|
609
|
+
machine,
|
|
610
|
+
capturedAtUtc: stringField(value, "capturedAtUtc"),
|
|
611
|
+
app: contentStringField(value, "app"),
|
|
612
|
+
windowTitle: contentStringField(value, "windowTitle"),
|
|
613
|
+
...browserUrl === void 0 ? {} : { browserUrl },
|
|
614
|
+
text: contentStringField(value, "text"),
|
|
615
|
+
textSource,
|
|
616
|
+
contentHash: stringField(value, "contentHash"),
|
|
617
|
+
...simhash === void 0 ? {} : { simhash }
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
function responsePage(value, machine) {
|
|
621
|
+
if (!isRecord2(value) || !Array.isArray(value.snapshots)) {
|
|
622
|
+
throw new TypeError("activity source response has no snapshots array");
|
|
623
|
+
}
|
|
624
|
+
const nextCursor = value.nextCursor === void 0 ? null : value.nextCursor;
|
|
625
|
+
if (nextCursor !== null && typeof nextCursor !== "string") {
|
|
626
|
+
throw new TypeError("activity source response has invalid nextCursor");
|
|
627
|
+
}
|
|
628
|
+
return {
|
|
629
|
+
snapshots: value.snapshots.map((snapshot) => snapshotFromWire(snapshot, machine)),
|
|
630
|
+
nextCursor
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
function requestUrl(baseUrl, path6, query) {
|
|
634
|
+
const url = new URL(path6, baseUrl);
|
|
635
|
+
const parts = Object.entries(query).filter((entry) => entry[1] !== void 0).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`);
|
|
636
|
+
url.search = parts.join("&");
|
|
637
|
+
return url.toString();
|
|
638
|
+
}
|
|
639
|
+
var ActivityHttpSourceClient = class {
|
|
640
|
+
machineLabel;
|
|
641
|
+
baseUrl;
|
|
642
|
+
token;
|
|
643
|
+
timeoutMs;
|
|
644
|
+
constructor(options) {
|
|
645
|
+
if (options.machineLabel.trim().length === 0) throw new RangeError("activity source machine label must not be empty");
|
|
646
|
+
if (options.timeoutMs !== void 0 && (!Number.isFinite(options.timeoutMs) || options.timeoutMs <= 0)) {
|
|
647
|
+
throw new RangeError("activity source timeoutMs must be a positive number");
|
|
648
|
+
}
|
|
649
|
+
this.machineLabel = options.machineLabel;
|
|
650
|
+
this.baseUrl = validateActivityBaseUrl(options.baseUrl).toString();
|
|
651
|
+
this.token = options.token;
|
|
652
|
+
this.timeoutMs = options.timeoutMs ?? DEFAULT_REQUEST_TIMEOUT_MS;
|
|
653
|
+
}
|
|
654
|
+
async request(url, signal) {
|
|
655
|
+
const timeout = AbortSignal.timeout(this.timeoutMs);
|
|
656
|
+
const composed = signal === void 0 ? timeout : AbortSignal.any([signal, timeout]);
|
|
657
|
+
const response = await fetch(url, {
|
|
658
|
+
headers: this.token === void 0 ? void 0 : { authorization: `Bearer ${this.token}` },
|
|
659
|
+
signal: composed
|
|
660
|
+
});
|
|
661
|
+
if (!response.ok) throw new Error(`activity source HTTP ${response.status}`);
|
|
662
|
+
return response;
|
|
663
|
+
}
|
|
664
|
+
async verify(signal) {
|
|
665
|
+
try {
|
|
666
|
+
await this.request(requestUrl(this.baseUrl, "/v1/health", {}), signal);
|
|
667
|
+
return { ok: true };
|
|
668
|
+
} catch (error) {
|
|
669
|
+
const detail = error instanceof Error && error.message.startsWith("activity source HTTP ") ? error.message.slice("activity source ".length) : displayErrorDetail(error) || "request failed";
|
|
670
|
+
return { ok: false, detail };
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
async fetchSnapshots(opts) {
|
|
674
|
+
const response = await this.request(
|
|
675
|
+
requestUrl(this.baseUrl, "/v1/snapshots", {
|
|
676
|
+
date: opts.date,
|
|
677
|
+
timezone: opts.timezone,
|
|
678
|
+
cursor: opts.cursor ?? void 0
|
|
679
|
+
}),
|
|
680
|
+
opts.signal
|
|
681
|
+
);
|
|
682
|
+
return responsePage(await response.json(), this.machineLabel);
|
|
683
|
+
}
|
|
684
|
+
};
|
|
685
|
+
|
|
686
|
+
// src/activity/timeline/regenerate.ts
|
|
687
|
+
import { randomBytes } from "crypto";
|
|
688
|
+
import { mkdirSync as mkdirSync3, readdirSync, readFileSync, renameSync, unlinkSync, writeFileSync } from "fs";
|
|
689
|
+
import path4 from "path";
|
|
690
|
+
|
|
691
|
+
// src/activity/timeline/corrections.ts
|
|
692
|
+
import { mkdirSync as mkdirSync2 } from "fs";
|
|
693
|
+
import path3 from "path";
|
|
694
|
+
function timelineCorrectionDatabasePath(memoryDir) {
|
|
695
|
+
return path3.join(memoryDir, "state", "activity-timeline.sqlite");
|
|
696
|
+
}
|
|
697
|
+
function rowToCorrection(row) {
|
|
698
|
+
return {
|
|
699
|
+
cardId: row.card_id,
|
|
700
|
+
categoryId: row.category_id ?? void 0,
|
|
701
|
+
title: row.title ?? void 0,
|
|
702
|
+
editedAtUtc: row.edited_at_utc
|
|
703
|
+
};
|
|
704
|
+
}
|
|
705
|
+
var TimelineCorrectionStore = class _TimelineCorrectionStore {
|
|
706
|
+
db;
|
|
707
|
+
constructor(db) {
|
|
708
|
+
this.db = db;
|
|
709
|
+
}
|
|
710
|
+
static open(memoryDir) {
|
|
711
|
+
mkdirSync2(path3.join(memoryDir, "state"), { recursive: true });
|
|
712
|
+
const db = openBetterSqlite3(timelineCorrectionDatabasePath(memoryDir));
|
|
713
|
+
db.pragma("journal_mode = WAL");
|
|
714
|
+
db.pragma("busy_timeout = 5000");
|
|
715
|
+
db.exec(`
|
|
716
|
+
CREATE TABLE IF NOT EXISTS timeline_corrections (
|
|
717
|
+
card_id TEXT PRIMARY KEY,
|
|
718
|
+
category_id TEXT,
|
|
719
|
+
title TEXT,
|
|
720
|
+
edited_at_utc TEXT NOT NULL
|
|
721
|
+
);
|
|
722
|
+
`);
|
|
723
|
+
return new _TimelineCorrectionStore(db);
|
|
724
|
+
}
|
|
725
|
+
/**
|
|
726
|
+
* Persist one correction. `categoryId`, when set, must exist in `categories`
|
|
727
|
+
* (defaults to the built-in registry) — an unknown category is a malformed
|
|
728
|
+
* edit and must fail rather than silently strand the card.
|
|
729
|
+
*/
|
|
730
|
+
upsert(correction, categories = DEFAULT_TIMELINE_CATEGORIES) {
|
|
731
|
+
validateTimelineCategories(categories);
|
|
732
|
+
if (typeof correction.cardId !== "string" || correction.cardId.length === 0) {
|
|
733
|
+
throw new RangeError("timeline correction requires a non-empty cardId");
|
|
734
|
+
}
|
|
735
|
+
if (typeof correction.editedAtUtc !== "string" || Number.isNaN(Date.parse(correction.editedAtUtc))) {
|
|
736
|
+
throw new RangeError("timeline correction requires a valid editedAtUtc instant");
|
|
737
|
+
}
|
|
738
|
+
if (correction.categoryId === void 0 && correction.title === void 0 || correction.title !== void 0 && correction.title.length === 0) {
|
|
739
|
+
throw new RangeError("timeline correction must set a categoryId and/or a non-empty title");
|
|
740
|
+
}
|
|
741
|
+
if (correction.categoryId !== void 0 && !categories.some((category) => category.id === correction.categoryId)) {
|
|
742
|
+
throw new RangeError(`timeline correction targets unknown category: ${correction.categoryId}`);
|
|
743
|
+
}
|
|
744
|
+
this.db.prepare(
|
|
745
|
+
`INSERT INTO timeline_corrections (card_id, category_id, title, edited_at_utc)
|
|
746
|
+
VALUES (?, ?, ?, ?)
|
|
747
|
+
ON CONFLICT(card_id) DO UPDATE SET category_id = excluded.category_id, title = excluded.title, edited_at_utc = excluded.edited_at_utc`
|
|
748
|
+
).run(correction.cardId, correction.categoryId ?? null, correction.title ?? null, correction.editedAtUtc);
|
|
749
|
+
}
|
|
750
|
+
get(cardId) {
|
|
751
|
+
const row = this.db.prepare("SELECT card_id, category_id, title, edited_at_utc FROM timeline_corrections WHERE card_id = ?").get(cardId);
|
|
752
|
+
return row === void 0 ? void 0 : rowToCorrection(row);
|
|
753
|
+
}
|
|
754
|
+
/** All corrections ordered by card id (deterministic listing). */
|
|
755
|
+
list() {
|
|
756
|
+
return this.db.prepare("SELECT card_id, category_id, title, edited_at_utc FROM timeline_corrections ORDER BY card_id ASC").all().map((row) => rowToCorrection(row));
|
|
757
|
+
}
|
|
758
|
+
/** Explicitly reset a card to its derived values; true when a correction existed. */
|
|
759
|
+
reset(cardId) {
|
|
760
|
+
return this.db.prepare("DELETE FROM timeline_corrections WHERE card_id = ?").run(cardId).changes > 0;
|
|
761
|
+
}
|
|
762
|
+
close() {
|
|
763
|
+
this.db.close();
|
|
764
|
+
}
|
|
765
|
+
};
|
|
766
|
+
function correctionsForCards(cards, corrections) {
|
|
767
|
+
const ids = new Set(cards.map((card) => card.id));
|
|
768
|
+
return corrections.filter((correction) => ids.has(correction.cardId));
|
|
769
|
+
}
|
|
770
|
+
function applyTimelineCorrections(cards, corrections) {
|
|
771
|
+
const byCardId = new Map(corrections.map((correction) => [correction.cardId, correction]));
|
|
772
|
+
return cards.map((card) => {
|
|
773
|
+
const correction = byCardId.get(card.id);
|
|
774
|
+
if (correction === void 0) return card;
|
|
775
|
+
return {
|
|
776
|
+
id: card.id,
|
|
777
|
+
kind: card.kind,
|
|
778
|
+
title: correction.title ?? card.title,
|
|
779
|
+
summary: card.summary,
|
|
780
|
+
categoryId: correction.categoryId ?? card.categoryId,
|
|
781
|
+
confidence: 1,
|
|
782
|
+
startUtc: card.startUtc,
|
|
783
|
+
endUtc: card.endUtc,
|
|
784
|
+
dayKey: card.dayKey,
|
|
785
|
+
timezone: card.timezone,
|
|
786
|
+
machine: card.machine,
|
|
787
|
+
evidenceIds: card.evidenceIds,
|
|
788
|
+
evidenceRange: card.evidenceRange,
|
|
789
|
+
manualEdit: {
|
|
790
|
+
...correction.categoryId !== void 0 ? { categoryId: correction.categoryId } : {},
|
|
791
|
+
...correction.title !== void 0 ? { title: correction.title } : {},
|
|
792
|
+
editedAtUtc: correction.editedAtUtc
|
|
793
|
+
}
|
|
794
|
+
};
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
// src/activity/timeline/build.ts
|
|
799
|
+
import { createHash } from "crypto";
|
|
800
|
+
|
|
801
|
+
// src/activity/timeline/classify.ts
|
|
802
|
+
var DOMAIN_CONFIDENCE = 0.85;
|
|
803
|
+
var APP_CONFIDENCE = 0.9;
|
|
804
|
+
var TITLE_CONFIDENCE = 0.7;
|
|
805
|
+
var UNKNOWN_CONFIDENCE = 0;
|
|
806
|
+
var RULES = [
|
|
807
|
+
{ categoryId: "development", domains: ["github.com", "gitlab.com", "stackoverflow.com", "linear.app", "atlassian.net"] },
|
|
808
|
+
{ categoryId: "communication", domains: ["mail.google.com", "gmail.com", "outlook.com", "outlook.office.com", "slack.com"] },
|
|
809
|
+
{ categoryId: "design", domains: ["figma.com", "canva.com"] },
|
|
810
|
+
{ categoryId: "documents", domains: ["docs.google.com", "notion.so", "dropbox.com"] },
|
|
811
|
+
{ categoryId: "entertainment", domains: ["youtube.com", "netflix.com", "spotify.com"] },
|
|
812
|
+
{ categoryId: "data", domains: ["metabase", "tableau", "grafana"] },
|
|
813
|
+
{ categoryId: "development", apps: ["code", "cursor", "neovim", "vim", "emacs", "xcode", "intellij", "terminal", "iterm", "warp", "wezterm", "kitty", "alacritty", "zed", "sublime", "datagrip"] },
|
|
814
|
+
{ categoryId: "communication", apps: ["slack", "discord", "teams", "mail", "outlook", "thunderbird", "messages", "signal", "whatsapp", "telegram", "zoom", "facetime", "meet"] },
|
|
815
|
+
{ categoryId: "design", apps: ["figma", "sketch", "photoshop", "illustrator", "indesign", "premiere", "after effects", "davinci", "blender", "ableton", "logic pro", "final cut"] },
|
|
816
|
+
{ categoryId: "documents", apps: ["word", "pages", "notion", "obsidian", "notes", "typora", "bear", "preview", "acrobat"] },
|
|
817
|
+
{ categoryId: "data", apps: ["excel", "numbers", "sheets", "tableau"] },
|
|
818
|
+
{ categoryId: "admin", apps: ["finder", "settings", "system preferences", "activity monitor", "files", "explorer"] },
|
|
819
|
+
{ categoryId: "entertainment", apps: ["spotify", "music", "youtube", "vlc", "quicktime", "steam", "netflix", "podcast", "tv"] },
|
|
820
|
+
{ categoryId: "browsing", apps: ["chrome", "safari", "firefox", "edge", "arc", "brave", "browser"] },
|
|
821
|
+
{ categoryId: "development", titles: ["pull request", "merge conflict", "terminal \u2014", "repository"] },
|
|
822
|
+
{ categoryId: "communication", titles: ["inbox"] },
|
|
823
|
+
{ categoryId: "data", titles: ["spreadsheet", "pivot table"] }
|
|
824
|
+
];
|
|
825
|
+
function classifyTimelineObservation(observation, categories) {
|
|
826
|
+
const app = observation.app.toLowerCase();
|
|
827
|
+
const title = observation.windowTitle.toLowerCase();
|
|
828
|
+
const domain = observation.browserUrl === void 0 ? "" : hostOf(observation.browserUrl);
|
|
829
|
+
for (const rule of RULES) {
|
|
830
|
+
if (rule.domains !== void 0 && domain !== "" && rule.domains.some((pattern) => domain.includes(pattern))) {
|
|
831
|
+
return checkedRule(rule, DOMAIN_CONFIDENCE, categories);
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
for (const rule of RULES) {
|
|
835
|
+
if (rule.apps !== void 0 && rule.apps.some((pattern) => app.includes(pattern))) {
|
|
836
|
+
return checkedRule(rule, APP_CONFIDENCE, categories);
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
for (const rule of RULES) {
|
|
840
|
+
if (rule.titles !== void 0 && rule.titles.some((pattern) => title.includes(pattern))) {
|
|
841
|
+
return checkedRule(rule, TITLE_CONFIDENCE, categories);
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
return { categoryId: TIMELINE_RESERVED_UNKNOWN, confidence: UNKNOWN_CONFIDENCE };
|
|
845
|
+
}
|
|
846
|
+
function checkedRule(rule, confidence, categories) {
|
|
847
|
+
if (!categories.some((category) => category.id === rule.categoryId)) {
|
|
848
|
+
throw new RangeError(`timeline classification rule targets unknown category: ${rule.categoryId}`);
|
|
849
|
+
}
|
|
850
|
+
return { categoryId: rule.categoryId, confidence };
|
|
851
|
+
}
|
|
852
|
+
function hostOf(url) {
|
|
853
|
+
try {
|
|
854
|
+
return new URL(url).hostname.toLowerCase();
|
|
855
|
+
} catch {
|
|
856
|
+
return url.toLowerCase();
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
// src/activity/timeline/build.ts
|
|
861
|
+
var TIMELINE_FORMAT_VERSION = 1;
|
|
862
|
+
var TIMELINE_MERGE_GAP_MS = 12e4;
|
|
863
|
+
var TIMELINE_MAX_DWELL_MS = 15 * 6e4;
|
|
864
|
+
function canonicalMs(iso) {
|
|
865
|
+
const parsed = Date.parse(iso);
|
|
866
|
+
return Number.isFinite(parsed) ? parsed : Number.NaN;
|
|
867
|
+
}
|
|
868
|
+
function isoOf(ms) {
|
|
869
|
+
return new Date(ms).toISOString();
|
|
870
|
+
}
|
|
871
|
+
function evidenceKeyOf(observation) {
|
|
872
|
+
return `${observation.machine}|${isoOf(canonicalMs(observation.capturedAtUtc))}|${observation.contentHash}`;
|
|
873
|
+
}
|
|
874
|
+
function stableCardId(identity) {
|
|
875
|
+
return `tlc_${createHash("sha256").update(identity, "utf8").digest("hex").slice(0, 16)}`;
|
|
876
|
+
}
|
|
877
|
+
function formatDurationMinutes(ms) {
|
|
878
|
+
return `${Math.round(ms / 6e4)}m`;
|
|
879
|
+
}
|
|
880
|
+
function unionIntervals(intervals) {
|
|
881
|
+
const sorted = [...intervals].sort((a, b) => a[0] - b[0] || a[1] - b[1]);
|
|
882
|
+
const merged = [];
|
|
883
|
+
for (const interval of sorted) {
|
|
884
|
+
const last = merged[merged.length - 1];
|
|
885
|
+
if (last !== void 0 && interval[0] <= last[1]) {
|
|
886
|
+
last[1] = Math.max(last[1], interval[1]);
|
|
887
|
+
} else {
|
|
888
|
+
merged.push([interval[0], interval[1]]);
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
return merged;
|
|
892
|
+
}
|
|
893
|
+
function subtractInterval(start, end, cutStart, cutEnd) {
|
|
894
|
+
if (cutEnd <= start || cutStart >= end) return [[start, end]];
|
|
895
|
+
const pieces = [];
|
|
896
|
+
if (cutStart > start) pieces.push([start, cutStart]);
|
|
897
|
+
if (cutEnd < end) pieces.push([cutEnd, end]);
|
|
898
|
+
return pieces;
|
|
899
|
+
}
|
|
900
|
+
function mergeTrack(machine, track, pauses) {
|
|
901
|
+
const cards = [];
|
|
902
|
+
let current = [];
|
|
903
|
+
const pauseStartsAfter = (fromMs, toMs) => pauses.some(([ps, pe]) => ps >= fromMs && ps < toMs && pe > ps);
|
|
904
|
+
for (const observation of track) {
|
|
905
|
+
const last = current[current.length - 1];
|
|
906
|
+
if (last !== void 0) {
|
|
907
|
+
const gap = canonicalMs(observation.capturedAtUtc) - canonicalMs(last.capturedAtUtc);
|
|
908
|
+
const sameKey = observation.app === last.app && observation.windowTitle === last.windowTitle;
|
|
909
|
+
const pauseBetween = pauseStartsAfter(canonicalMs(last.capturedAtUtc), canonicalMs(observation.capturedAtUtc));
|
|
910
|
+
if (!sameKey || gap > TIMELINE_MERGE_GAP_MS || pauseBetween) {
|
|
911
|
+
cards.push({ machine, observations: current });
|
|
912
|
+
current = [];
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
current.push(observation);
|
|
916
|
+
}
|
|
917
|
+
if (current.length > 0) cards.push({ machine, observations: current });
|
|
918
|
+
return cards;
|
|
919
|
+
}
|
|
920
|
+
function buildTimelineDay(input) {
|
|
921
|
+
const categories = input.categories ?? DEFAULT_TIMELINE_CATEGORIES;
|
|
922
|
+
validateTimelineCategories(categories);
|
|
923
|
+
const window = activityDayWindow(input.date, input.timezone);
|
|
924
|
+
const dayStartMs = Date.parse(window.startUtc);
|
|
925
|
+
const dayEndMs = Date.parse(window.endUtc);
|
|
926
|
+
const observations = input.observations.filter((observation) => Number.isFinite(canonicalMs(observation.capturedAtUtc))).filter((observation) => {
|
|
927
|
+
const ms = canonicalMs(observation.capturedAtUtc);
|
|
928
|
+
return ms >= dayStartMs && ms < dayEndMs;
|
|
929
|
+
});
|
|
930
|
+
for (const pause of input.pauses ?? []) {
|
|
931
|
+
const startMs = canonicalMs(pause.startUtc);
|
|
932
|
+
const endMs = canonicalMs(pause.endUtc);
|
|
933
|
+
if (!Number.isFinite(startMs) || !Number.isFinite(endMs) || startMs >= endMs) {
|
|
934
|
+
throw new RangeError("timeline pause must be a valid half-open [startUtc, endUtc) interval");
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
const pauseIntervals = unionIntervals(
|
|
938
|
+
(input.pauses ?? []).map((pause) => [canonicalMs(pause.startUtc), canonicalMs(pause.endUtc)]).map(([startMs, endMs]) => [Math.max(startMs, dayStartMs), Math.min(endMs, dayEndMs)]).filter(([startMs, endMs]) => endMs > startMs)
|
|
939
|
+
);
|
|
940
|
+
const tracks = /* @__PURE__ */ new Map();
|
|
941
|
+
for (const observation of observations) {
|
|
942
|
+
const track = tracks.get(observation.machine) ?? [];
|
|
943
|
+
track.push(observation);
|
|
944
|
+
tracks.set(observation.machine, track);
|
|
945
|
+
}
|
|
946
|
+
for (const track of tracks.values()) {
|
|
947
|
+
track.sort(
|
|
948
|
+
(a, b) => canonicalMs(a.capturedAtUtc) - canonicalMs(b.capturedAtUtc) || (a.contentHash < b.contentHash ? -1 : a.contentHash > b.contentHash ? 1 : 0)
|
|
949
|
+
);
|
|
950
|
+
}
|
|
951
|
+
const cards = [];
|
|
952
|
+
const machines = [...tracks.keys()].sort();
|
|
953
|
+
for (const machine of machines) {
|
|
954
|
+
const track = tracks.get(machine) ?? [];
|
|
955
|
+
const merged = mergeTrack(machine, track, pauseIntervals);
|
|
956
|
+
const trackIntervals = [];
|
|
957
|
+
for (let index = 0; index < merged.length; index++) {
|
|
958
|
+
const group = merged[index];
|
|
959
|
+
const first = group.observations[0];
|
|
960
|
+
const last = group.observations[group.observations.length - 1];
|
|
961
|
+
const startMs = canonicalMs(first.capturedAtUtc);
|
|
962
|
+
const lastMs = canonicalMs(last.capturedAtUtc);
|
|
963
|
+
const nextObsMs = index + 1 < merged.length ? canonicalMs(merged[index + 1].observations[0].capturedAtUtc) : Number.POSITIVE_INFINITY;
|
|
964
|
+
const pauseStartMs = pauseIntervals.find(([ps]) => ps > lastMs)?.[0] ?? Number.POSITIVE_INFINITY;
|
|
965
|
+
const endMs = Math.max(lastMs, Math.min(lastMs + TIMELINE_MAX_DWELL_MS, nextObsMs, pauseStartMs, dayEndMs));
|
|
966
|
+
trackIntervals.push([startMs, endMs]);
|
|
967
|
+
const evidenceIds = group.observations.map((observation) => observation.id);
|
|
968
|
+
const classification = classifyTimelineObservation(first, categories);
|
|
969
|
+
cards.push({
|
|
970
|
+
id: stableCardId(`activity|${machine}|${evidenceKeyOf(first)}|${evidenceKeyOf(last)}`),
|
|
971
|
+
kind: "activity",
|
|
972
|
+
title: first.windowTitle.length > 0 ? first.windowTitle : first.app,
|
|
973
|
+
summary: `${first.app} \xB7 ${machine} \xB7 ${evidenceIds.length} obs \xB7 ${formatDurationMinutes(endMs - startMs)}`,
|
|
974
|
+
categoryId: classification.categoryId,
|
|
975
|
+
confidence: classification.confidence,
|
|
976
|
+
startUtc: isoOf(startMs),
|
|
977
|
+
endUtc: isoOf(endMs),
|
|
978
|
+
dayKey: input.date,
|
|
979
|
+
timezone: input.timezone,
|
|
980
|
+
machine,
|
|
981
|
+
evidenceIds,
|
|
982
|
+
evidenceRange: { firstKey: evidenceKeyOf(first), lastKey: evidenceKeyOf(last) }
|
|
983
|
+
});
|
|
984
|
+
}
|
|
985
|
+
for (let index = 0; index + 1 < trackIntervals.length; index++) {
|
|
986
|
+
const gapStart = trackIntervals[index][1];
|
|
987
|
+
const gapEnd = trackIntervals[index + 1][0];
|
|
988
|
+
if (gapEnd <= gapStart) continue;
|
|
989
|
+
let pieces = [[gapStart, gapEnd]];
|
|
990
|
+
for (const [pauseStart, pauseEnd] of pauseIntervals) {
|
|
991
|
+
pieces = pieces.flatMap(([start, end]) => subtractInterval(start, end, pauseStart, pauseEnd));
|
|
992
|
+
}
|
|
993
|
+
for (const [start, end] of pieces) {
|
|
994
|
+
cards.push({
|
|
995
|
+
id: stableCardId(`idle|${machine}|${isoOf(start)}|${isoOf(end)}`),
|
|
996
|
+
kind: "idle",
|
|
997
|
+
title: "Idle",
|
|
998
|
+
summary: `${formatDurationMinutes(end - start)} gap on ${machine}`,
|
|
999
|
+
categoryId: TIMELINE_RESERVED_IDLE,
|
|
1000
|
+
confidence: 1,
|
|
1001
|
+
startUtc: isoOf(start),
|
|
1002
|
+
endUtc: isoOf(end),
|
|
1003
|
+
dayKey: input.date,
|
|
1004
|
+
timezone: input.timezone,
|
|
1005
|
+
machine,
|
|
1006
|
+
evidenceIds: [],
|
|
1007
|
+
evidenceRange: null
|
|
1008
|
+
});
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
for (const [pauseStart, pauseEnd] of pauseIntervals) {
|
|
1013
|
+
const reason = (input.pauses ?? []).find((pause) => canonicalMs(pause.startUtc) === pauseStart)?.reason;
|
|
1014
|
+
cards.push({
|
|
1015
|
+
id: stableCardId(`pause|${isoOf(pauseStart)}|${isoOf(pauseEnd)}`),
|
|
1016
|
+
kind: "pause",
|
|
1017
|
+
title: "Paused",
|
|
1018
|
+
summary: reason === void 0 ? `${formatDurationMinutes(pauseEnd - pauseStart)} user pause` : `${formatDurationMinutes(pauseEnd - pauseStart)} user pause \u2014 ${reason}`,
|
|
1019
|
+
categoryId: TIMELINE_RESERVED_PAUSE,
|
|
1020
|
+
confidence: 1,
|
|
1021
|
+
startUtc: isoOf(pauseStart),
|
|
1022
|
+
endUtc: isoOf(pauseEnd),
|
|
1023
|
+
dayKey: input.date,
|
|
1024
|
+
timezone: input.timezone,
|
|
1025
|
+
machine: null,
|
|
1026
|
+
evidenceIds: [],
|
|
1027
|
+
evidenceRange: null
|
|
1028
|
+
});
|
|
1029
|
+
}
|
|
1030
|
+
cards.sort((a, b) => a.startUtc < b.startUtc ? -1 : a.startUtc > b.startUtc ? 1 : a.endUtc < b.endUtc ? -1 : a.endUtc > b.endUtc ? 1 : (a.machine ?? "") < (b.machine ?? "") ? -1 : (a.machine ?? "") > (b.machine ?? "") ? 1 : a.id < b.id ? -1 : a.id > b.id ? 1 : 0);
|
|
1031
|
+
return {
|
|
1032
|
+
formatVersion: TIMELINE_FORMAT_VERSION,
|
|
1033
|
+
date: input.date,
|
|
1034
|
+
timezone: input.timezone,
|
|
1035
|
+
startUtc: window.startUtc,
|
|
1036
|
+
endUtc: window.endUtc,
|
|
1037
|
+
cards
|
|
1038
|
+
};
|
|
1039
|
+
}
|
|
1040
|
+
function serializeTimelineDay(day) {
|
|
1041
|
+
return JSON.stringify(day);
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
// src/activity/timeline/analysis-run.ts
|
|
1045
|
+
async function runTimelineCardAnalysis(input) {
|
|
1046
|
+
const { startUtc, endUtc } = activityDayWindow(input.date, input.timezone);
|
|
1047
|
+
if (!input.config.enabled) {
|
|
1048
|
+
return { status: "disabled", cards: input.cards };
|
|
1049
|
+
}
|
|
1050
|
+
const start = Date.parse(startUtc);
|
|
1051
|
+
const end = Date.parse(endUtc);
|
|
1052
|
+
const observations = input.observations.filter((observation) => {
|
|
1053
|
+
const captured = Date.parse(observation.capturedAtUtc);
|
|
1054
|
+
return Number.isFinite(captured) && captured >= start && captured < end;
|
|
1055
|
+
});
|
|
1056
|
+
const result = await analyzeTimelineCards({
|
|
1057
|
+
enabled: true,
|
|
1058
|
+
cards: input.cards,
|
|
1059
|
+
observations,
|
|
1060
|
+
provider: input.config.provider,
|
|
1061
|
+
model: input.config.model,
|
|
1062
|
+
complete: timelineAnalysisCompleteFromClients({
|
|
1063
|
+
localLlm: input.deps.localLlm ?? null,
|
|
1064
|
+
remoteLlm: input.deps.remoteLlm ?? null
|
|
1065
|
+
}),
|
|
1066
|
+
...input.config.timeoutMs === void 0 ? {} : { timeoutMs: input.config.timeoutMs },
|
|
1067
|
+
date: input.date,
|
|
1068
|
+
timezone: input.timezone,
|
|
1069
|
+
...input.categories === void 0 ? {} : { categories: input.categories },
|
|
1070
|
+
...input.config.preferences === void 0 ? {} : { preferences: input.config.preferences },
|
|
1071
|
+
...input.corrections === void 0 ? {} : { priorEdits: input.corrections },
|
|
1072
|
+
...input.signal === void 0 ? {} : { signal: input.signal }
|
|
1073
|
+
});
|
|
1074
|
+
if (result.status !== "ok") {
|
|
1075
|
+
return {
|
|
1076
|
+
status: result.status,
|
|
1077
|
+
cards: result.cards,
|
|
1078
|
+
...result.failure === void 0 ? {} : { failure: result.failure }
|
|
1079
|
+
};
|
|
1080
|
+
}
|
|
1081
|
+
return {
|
|
1082
|
+
status: "ok",
|
|
1083
|
+
cards: result.cards,
|
|
1084
|
+
metadata: buildAnalysisRunMetadata({
|
|
1085
|
+
provider: result.provider ?? "unknown",
|
|
1086
|
+
model: result.model ?? "unknown",
|
|
1087
|
+
promptVersion: String(result.promptVersion ?? "v0"),
|
|
1088
|
+
observationCount: observations.length
|
|
1089
|
+
})
|
|
1090
|
+
};
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
// src/activity/timeline/regenerate.ts
|
|
1094
|
+
var TIMELINE_DAY_FORMAT_VERSION = 1;
|
|
1095
|
+
var TIMELINE_DAY_DIR = path4.join("activity", "timeline");
|
|
1096
|
+
var inflight = /* @__PURE__ */ new Map();
|
|
1097
|
+
function requireToken(value, name) {
|
|
1098
|
+
if (typeof value !== "string" || value.trim().length === 0) {
|
|
1099
|
+
throw new TypeError(`${name} must be a non-empty string`);
|
|
1100
|
+
}
|
|
1101
|
+
return value.trim();
|
|
1102
|
+
}
|
|
1103
|
+
function timelineDayPath(memoryDir, date) {
|
|
1104
|
+
const root = requireToken(memoryDir, "memoryDir");
|
|
1105
|
+
if (!isValidActivityDate(date)) {
|
|
1106
|
+
throw new RangeError("date must be a real YYYY-MM-DD day");
|
|
1107
|
+
}
|
|
1108
|
+
return path4.join(path4.resolve(root), TIMELINE_DAY_DIR, `${date}.json`);
|
|
1109
|
+
}
|
|
1110
|
+
function snapshotToObservation(snapshot) {
|
|
1111
|
+
if (typeof snapshot.id !== "number") return null;
|
|
1112
|
+
return {
|
|
1113
|
+
id: snapshot.id,
|
|
1114
|
+
machine: snapshot.machine,
|
|
1115
|
+
capturedAtUtc: snapshot.capturedAtUtc,
|
|
1116
|
+
app: snapshot.app,
|
|
1117
|
+
windowTitle: snapshot.windowTitle,
|
|
1118
|
+
...snapshot.browserUrl === void 0 ? {} : { browserUrl: snapshot.browserUrl },
|
|
1119
|
+
contentHash: snapshot.contentHash
|
|
1120
|
+
};
|
|
1121
|
+
}
|
|
1122
|
+
function localDatesForUtcRange(fromMs, toMs, timezone) {
|
|
1123
|
+
if (!Number.isFinite(fromMs) || !Number.isFinite(toMs) || toMs <= fromMs) return [];
|
|
1124
|
+
const dates = [];
|
|
1125
|
+
let date = activityDateInTimezone(new Date(fromMs), timezone);
|
|
1126
|
+
const last = activityDateInTimezone(new Date(toMs - 1), timezone);
|
|
1127
|
+
while (dates.length < 3660) {
|
|
1128
|
+
dates.push(date);
|
|
1129
|
+
if (date === last) break;
|
|
1130
|
+
const { endUtc } = activityDayWindow(date, timezone);
|
|
1131
|
+
date = activityDateInTimezone(new Date(Date.parse(endUtc)), timezone);
|
|
1132
|
+
}
|
|
1133
|
+
return dates;
|
|
1134
|
+
}
|
|
1135
|
+
function listPersistedTimelineDates(memoryDir) {
|
|
1136
|
+
let entries;
|
|
1137
|
+
try {
|
|
1138
|
+
entries = readdirSync(path4.join(path4.resolve(requireToken(memoryDir, "memoryDir")), TIMELINE_DAY_DIR));
|
|
1139
|
+
} catch {
|
|
1140
|
+
return [];
|
|
1141
|
+
}
|
|
1142
|
+
const dates = [];
|
|
1143
|
+
for (const entry of entries) {
|
|
1144
|
+
const day = entry.endsWith(".json") ? entry.slice(0, -".json".length) : entry;
|
|
1145
|
+
if (isValidActivityDate(day)) dates.push(day);
|
|
1146
|
+
}
|
|
1147
|
+
return dates.sort();
|
|
1148
|
+
}
|
|
1149
|
+
function resolveTimelineLoadDates(input) {
|
|
1150
|
+
const { window, timezone, today, store, persistedDates } = input;
|
|
1151
|
+
if (window.from !== void 0 || window.to !== void 0) {
|
|
1152
|
+
const parsedTo = window.to === void 0 ? Number.NaN : Date.parse(window.to);
|
|
1153
|
+
const fromMs = window.from === void 0 ? parsedTo : Date.parse(window.from);
|
|
1154
|
+
const toMs = window.to === void 0 ? fromMs + 1 : parsedTo;
|
|
1155
|
+
if (!Number.isFinite(fromMs) || !Number.isFinite(toMs)) return [];
|
|
1156
|
+
return localDatesForUtcRange(fromMs, toMs > fromMs ? toMs : fromMs + 1, timezone);
|
|
1157
|
+
}
|
|
1158
|
+
const days = new Set(persistedDates);
|
|
1159
|
+
days.add(today);
|
|
1160
|
+
const extent = store.snapshotCaptureExtent();
|
|
1161
|
+
if (extent !== null) {
|
|
1162
|
+
const firstMs = Date.parse(extent.firstUtc);
|
|
1163
|
+
const lastMs = Date.parse(extent.lastUtc);
|
|
1164
|
+
if (Number.isFinite(firstMs) && Number.isFinite(lastMs) && lastMs >= firstMs) {
|
|
1165
|
+
for (const day of localDatesForUtcRange(firstMs, lastMs + 1, timezone)) days.add(day);
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
return [...days].sort();
|
|
1169
|
+
}
|
|
1170
|
+
function timelineAnalysisClientsFromConfig(config) {
|
|
1171
|
+
return {
|
|
1172
|
+
localLlm: new LocalLlmClient(config),
|
|
1173
|
+
remoteLlm: new FallbackLlmClient(
|
|
1174
|
+
config.gatewayConfig,
|
|
1175
|
+
fallbackLlmRuntimeContextFromConfig(config)
|
|
1176
|
+
)
|
|
1177
|
+
};
|
|
1178
|
+
}
|
|
1179
|
+
function resolveClients(input) {
|
|
1180
|
+
if (input.deps !== void 0) return input.deps;
|
|
1181
|
+
if (input.pluginConfig !== void 0) return timelineAnalysisClientsFromConfig(input.pluginConfig);
|
|
1182
|
+
return {};
|
|
1183
|
+
}
|
|
1184
|
+
function sourceHash(input) {
|
|
1185
|
+
return hashActivityBody(
|
|
1186
|
+
JSON.stringify({
|
|
1187
|
+
// The timezone is a day-window determinant (it bounds which
|
|
1188
|
+
// observations the day sees), so it belongs to the source identity:
|
|
1189
|
+
// identical observations under a different timezone must not reuse
|
|
1190
|
+
// the cached day (issue #2891).
|
|
1191
|
+
timezone: input.timezone,
|
|
1192
|
+
observations: input.observations.map((observation) => ({
|
|
1193
|
+
id: observation.id,
|
|
1194
|
+
contentHash: observation.contentHash,
|
|
1195
|
+
capturedAtUtc: observation.capturedAtUtc
|
|
1196
|
+
})),
|
|
1197
|
+
analysis: {
|
|
1198
|
+
enabled: input.analysis.enabled,
|
|
1199
|
+
provider: input.analysis.provider ?? null,
|
|
1200
|
+
model: input.analysis.model ?? null,
|
|
1201
|
+
timeoutMs: input.analysis.timeoutMs ?? null,
|
|
1202
|
+
preferences: input.analysis.preferences ?? null
|
|
1203
|
+
},
|
|
1204
|
+
corrections: input.corrections
|
|
1205
|
+
})
|
|
1206
|
+
);
|
|
1207
|
+
}
|
|
1208
|
+
function readPersisted(filePath) {
|
|
1209
|
+
try {
|
|
1210
|
+
const parsed = JSON.parse(readFileSync(filePath, "utf8"));
|
|
1211
|
+
if (parsed?.formatVersion !== TIMELINE_DAY_FORMAT_VERSION || !Array.isArray(parsed.cards)) {
|
|
1212
|
+
return null;
|
|
1213
|
+
}
|
|
1214
|
+
return parsed;
|
|
1215
|
+
} catch (error) {
|
|
1216
|
+
if (typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT") {
|
|
1217
|
+
return null;
|
|
1218
|
+
}
|
|
1219
|
+
return null;
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
function persistDay(filePath, payload) {
|
|
1223
|
+
const text = `${JSON.stringify(payload)}
|
|
1224
|
+
`;
|
|
1225
|
+
try {
|
|
1226
|
+
if (readFileSync(filePath, "utf8") === text) return false;
|
|
1227
|
+
} catch (error) {
|
|
1228
|
+
if (!(typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT")) {
|
|
1229
|
+
throw error;
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
mkdirSync3(path4.dirname(filePath), { recursive: true, mode: 448 });
|
|
1233
|
+
const tmpPath = `${filePath}.${process.pid}.${randomBytes(8).toString("hex")}.tmp`;
|
|
1234
|
+
writeFileSync(tmpPath, text, { encoding: "utf8", mode: 384 });
|
|
1235
|
+
try {
|
|
1236
|
+
renameSync(tmpPath, filePath);
|
|
1237
|
+
} catch (error) {
|
|
1238
|
+
try {
|
|
1239
|
+
unlinkSync(tmpPath);
|
|
1240
|
+
} catch {
|
|
1241
|
+
}
|
|
1242
|
+
throw error;
|
|
1243
|
+
}
|
|
1244
|
+
return true;
|
|
1245
|
+
}
|
|
1246
|
+
function toResult(filePath, written, analyzed, day) {
|
|
1247
|
+
return {
|
|
1248
|
+
status: day.status,
|
|
1249
|
+
cards: day.cards,
|
|
1250
|
+
path: filePath,
|
|
1251
|
+
written,
|
|
1252
|
+
analyzed,
|
|
1253
|
+
...day.metadata === void 0 ? {} : { metadata: day.metadata },
|
|
1254
|
+
...day.failure === void 0 ? {} : { failure: day.failure }
|
|
1255
|
+
};
|
|
1256
|
+
}
|
|
1257
|
+
function isCachedDayFinal(status, analysisEnabled) {
|
|
1258
|
+
if (analysisEnabled) {
|
|
1259
|
+
return status === "ok" || status === "provider_failed" || status === "invalid_output";
|
|
1260
|
+
}
|
|
1261
|
+
return status === "disabled";
|
|
1262
|
+
}
|
|
1263
|
+
async function regenerateUncached(input) {
|
|
1264
|
+
const date = requireToken(input.date, "date");
|
|
1265
|
+
const timezone = requireToken(input.timezone, "timezone");
|
|
1266
|
+
const filePath = timelineDayPath(input.memoryDir, date);
|
|
1267
|
+
if (!input.timelineEnabled) {
|
|
1268
|
+
return toResult(filePath, false, false, { status: "timeline_disabled", cards: [] });
|
|
1269
|
+
}
|
|
1270
|
+
const { startUtc, endUtc } = activityDayWindow(date, timezone);
|
|
1271
|
+
const observations = input.store.listSnapshotsForDay(null, startUtc, endUtc).map(snapshotToObservation).filter((observation) => observation !== null);
|
|
1272
|
+
let corrections = input.corrections;
|
|
1273
|
+
let opened;
|
|
1274
|
+
if (corrections === void 0) {
|
|
1275
|
+
opened = TimelineCorrectionStore.open(input.memoryDir);
|
|
1276
|
+
corrections = opened.list();
|
|
1277
|
+
}
|
|
1278
|
+
try {
|
|
1279
|
+
const rawCards = buildTimelineDay({ date, timezone, observations }).cards;
|
|
1280
|
+
corrections = correctionsForCards(rawCards, corrections);
|
|
1281
|
+
const built = applyTimelineCorrections(rawCards, corrections);
|
|
1282
|
+
const hash = sourceHash({ timezone, observations, analysis: input.analysis, corrections });
|
|
1283
|
+
const prior = readPersisted(filePath);
|
|
1284
|
+
if (prior !== null && prior.sourceHash === hash && isCachedDayFinal(prior.status, input.analysis.enabled)) {
|
|
1285
|
+
return toResult(filePath, false, false, prior);
|
|
1286
|
+
}
|
|
1287
|
+
const deterministic = {
|
|
1288
|
+
formatVersion: TIMELINE_DAY_FORMAT_VERSION,
|
|
1289
|
+
date,
|
|
1290
|
+
timezone,
|
|
1291
|
+
sourceHash: hash,
|
|
1292
|
+
status: input.analysis.enabled ? "pending" : "disabled",
|
|
1293
|
+
cards: built
|
|
1294
|
+
};
|
|
1295
|
+
persistDay(filePath, deterministic);
|
|
1296
|
+
if (!input.analysis.enabled) {
|
|
1297
|
+
return toResult(filePath, true, false, deterministic);
|
|
1298
|
+
}
|
|
1299
|
+
const deps = resolveClients(input);
|
|
1300
|
+
const analyzed = await runTimelineCardAnalysis({
|
|
1301
|
+
date,
|
|
1302
|
+
timezone,
|
|
1303
|
+
cards: built,
|
|
1304
|
+
observations,
|
|
1305
|
+
corrections,
|
|
1306
|
+
config: input.analysis,
|
|
1307
|
+
deps,
|
|
1308
|
+
...input.signal === void 0 ? {} : { signal: input.signal }
|
|
1309
|
+
});
|
|
1310
|
+
const next = {
|
|
1311
|
+
formatVersion: TIMELINE_DAY_FORMAT_VERSION,
|
|
1312
|
+
date,
|
|
1313
|
+
timezone,
|
|
1314
|
+
sourceHash: hash,
|
|
1315
|
+
status: analyzed.status,
|
|
1316
|
+
cards: analyzed.cards,
|
|
1317
|
+
...analyzed.metadata === void 0 ? {} : { metadata: analyzed.metadata },
|
|
1318
|
+
...analyzed.failure === void 0 ? {} : { failure: analyzed.failure }
|
|
1319
|
+
};
|
|
1320
|
+
persistDay(filePath, next);
|
|
1321
|
+
return toResult(filePath, true, analyzed.status === "ok", next);
|
|
1322
|
+
} finally {
|
|
1323
|
+
opened?.close();
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
async function regenerateTimelineDay(input) {
|
|
1327
|
+
const key = `${path4.resolve(requireToken(input.memoryDir, "memoryDir"))}\0${input.date}`;
|
|
1328
|
+
const pending = inflight.get(key);
|
|
1329
|
+
if (pending !== void 0) return pending;
|
|
1330
|
+
const run = regenerateUncached(input).finally(() => {
|
|
1331
|
+
if (inflight.get(key) === run) inflight.delete(key);
|
|
1332
|
+
});
|
|
1333
|
+
inflight.set(key, run);
|
|
1334
|
+
return run;
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
// src/activity/runner.ts
|
|
1338
|
+
function previousIsoDate(date) {
|
|
1339
|
+
const parsed = /* @__PURE__ */ new Date(`${date}T00:00:00Z`);
|
|
1340
|
+
parsed.setUTCDate(parsed.getUTCDate() - 1);
|
|
1341
|
+
return parsed.toISOString().slice(0, 10);
|
|
1342
|
+
}
|
|
1343
|
+
function resolveActivitySyncDates(syncDays, timezone, now) {
|
|
1344
|
+
const dates = [];
|
|
1345
|
+
let cursor = activityDateInTimezone(now, timezone);
|
|
1346
|
+
for (let count = 0; count < syncDays; count++) {
|
|
1347
|
+
dates.unshift(cursor);
|
|
1348
|
+
cursor = previousIsoDate(cursor);
|
|
1349
|
+
}
|
|
1350
|
+
return dates;
|
|
1351
|
+
}
|
|
1352
|
+
function sanitizedSyncError(error) {
|
|
1353
|
+
return error instanceof Error && /^(activity|Invalid activity)/.test(error.message) ? error.message : displayErrorDetail(error) || "activity sync failed";
|
|
1354
|
+
}
|
|
1355
|
+
async function runActivitySyncOnce(options) {
|
|
1356
|
+
const ranAt = typeof options.now === "function" ? options.now() : options.now ?? /* @__PURE__ */ new Date();
|
|
1357
|
+
if (!options.config.enabled) {
|
|
1358
|
+
return {
|
|
1359
|
+
ranAt: ranAt.toISOString(),
|
|
1360
|
+
enabled: false,
|
|
1361
|
+
ranCount: 0,
|
|
1362
|
+
errorCount: 0,
|
|
1363
|
+
reindexErrorCount: 0,
|
|
1364
|
+
totalInserted: 0,
|
|
1365
|
+
results: [],
|
|
1366
|
+
touchedDates: []
|
|
1367
|
+
};
|
|
1368
|
+
}
|
|
1369
|
+
const dates = resolveActivitySyncDates(options.config.syncDays, options.config.timezone, ranAt);
|
|
1370
|
+
const createSourceClient = options.createSourceClient ?? ((source) => new ActivityHttpSourceClient({
|
|
1371
|
+
machineLabel: source.machineLabel,
|
|
1372
|
+
baseUrl: source.baseUrl,
|
|
1373
|
+
...source.token === void 0 ? {} : { token: source.token }
|
|
1374
|
+
}));
|
|
1375
|
+
const ownStore = options.store === void 0;
|
|
1376
|
+
const store = options.store ?? ActivityStore.open(options.memoryDir);
|
|
1377
|
+
const results = [];
|
|
1378
|
+
const touchedDates = /* @__PURE__ */ new Set();
|
|
1379
|
+
try {
|
|
1380
|
+
for (const sourceConfig of options.config.sources) {
|
|
1381
|
+
const item = {
|
|
1382
|
+
machineLabel: sourceConfig.machineLabel,
|
|
1383
|
+
ran: false,
|
|
1384
|
+
fetched: 0,
|
|
1385
|
+
inserted: 0,
|
|
1386
|
+
duplicates: 0,
|
|
1387
|
+
digestsWritten: 0,
|
|
1388
|
+
// Cursors are now per (machine, date); report the last synced day's
|
|
1389
|
+
// cursor. Null until a day advances it.
|
|
1390
|
+
cursor: null
|
|
1391
|
+
};
|
|
1392
|
+
try {
|
|
1393
|
+
const client = createSourceClient(sourceConfig);
|
|
1394
|
+
for (const date of dates) {
|
|
1395
|
+
try {
|
|
1396
|
+
const result = await syncActivitySource(client, {
|
|
1397
|
+
date,
|
|
1398
|
+
timezone: options.config.timezone,
|
|
1399
|
+
memoryDir: options.memoryDir,
|
|
1400
|
+
store,
|
|
1401
|
+
signal: options.signal,
|
|
1402
|
+
...options.reindexSearch === void 0 ? {} : { afterWrites: options.reindexSearch }
|
|
1403
|
+
});
|
|
1404
|
+
item.fetched += result.fetched;
|
|
1405
|
+
item.inserted += result.inserted;
|
|
1406
|
+
if (result.inserted > 0) touchedDates.add(date);
|
|
1407
|
+
item.duplicates += result.duplicates;
|
|
1408
|
+
if (result.digestWritten) item.digestsWritten += 1;
|
|
1409
|
+
item.cursor = result.cursor;
|
|
1410
|
+
item.ran = true;
|
|
1411
|
+
if (result.reindexError !== void 0) item.reindexError = result.reindexError;
|
|
1412
|
+
} catch (dateError) {
|
|
1413
|
+
item.error = sanitizedSyncError(dateError);
|
|
1414
|
+
if (options.signal?.aborted) break;
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
} catch (error) {
|
|
1418
|
+
item.error = sanitizedSyncError(error);
|
|
1419
|
+
}
|
|
1420
|
+
results.push(item);
|
|
1421
|
+
if (options.signal?.aborted) break;
|
|
1422
|
+
}
|
|
1423
|
+
if (options.config.timeline.enabled && !options.signal?.aborted) {
|
|
1424
|
+
for (const date of dates) {
|
|
1425
|
+
try {
|
|
1426
|
+
await regenerateTimelineDay({
|
|
1427
|
+
date,
|
|
1428
|
+
timezone: options.config.timezone,
|
|
1429
|
+
memoryDir: options.memoryDir,
|
|
1430
|
+
store,
|
|
1431
|
+
timelineEnabled: true,
|
|
1432
|
+
analysis: options.config.timeline.analysis,
|
|
1433
|
+
...options.pluginConfig === void 0 ? {} : { pluginConfig: options.pluginConfig },
|
|
1434
|
+
...options.analysisDeps === void 0 ? {} : { deps: options.analysisDeps },
|
|
1435
|
+
...options.signal === void 0 ? {} : { signal: options.signal }
|
|
1436
|
+
});
|
|
1437
|
+
} catch {
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
} finally {
|
|
1442
|
+
if (ownStore) store.close();
|
|
1443
|
+
}
|
|
1444
|
+
return {
|
|
1445
|
+
ranAt: ranAt.toISOString(),
|
|
1446
|
+
enabled: true,
|
|
1447
|
+
ranCount: results.filter((item) => item.ran).length,
|
|
1448
|
+
errorCount: results.filter((item) => item.error !== void 0).length,
|
|
1449
|
+
reindexErrorCount: results.filter((item) => item.reindexError !== void 0).length,
|
|
1450
|
+
totalInserted: results.reduce((sum, item) => sum + item.inserted, 0),
|
|
1451
|
+
results,
|
|
1452
|
+
touchedDates: [...touchedDates].sort()
|
|
1453
|
+
};
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
// src/activity/scheduler.ts
|
|
1457
|
+
var ACTIVITY_SYNC_DEFAULT_INTERVAL_MS = 9e5;
|
|
1458
|
+
var ActivitySyncScheduler = class {
|
|
1459
|
+
config;
|
|
1460
|
+
memoryDir;
|
|
1461
|
+
intervalMs;
|
|
1462
|
+
invoke;
|
|
1463
|
+
setTimer;
|
|
1464
|
+
clearTimer;
|
|
1465
|
+
onRun;
|
|
1466
|
+
onError;
|
|
1467
|
+
handle = null;
|
|
1468
|
+
stopped = false;
|
|
1469
|
+
inFlight = false;
|
|
1470
|
+
inFlightPromise = null;
|
|
1471
|
+
abortController = new AbortController();
|
|
1472
|
+
constructor(options) {
|
|
1473
|
+
this.config = options.config;
|
|
1474
|
+
this.memoryDir = options.memoryDir;
|
|
1475
|
+
this.intervalMs = options.intervalMs ?? ACTIVITY_SYNC_DEFAULT_INTERVAL_MS;
|
|
1476
|
+
this.invoke = options.invoke ?? ((signal) => runActivitySyncOnce({
|
|
1477
|
+
config: this.config,
|
|
1478
|
+
memoryDir: this.memoryDir,
|
|
1479
|
+
signal,
|
|
1480
|
+
...options.reindexSearch === void 0 ? {} : { reindexSearch: options.reindexSearch },
|
|
1481
|
+
...options.pluginConfig === void 0 ? {} : { pluginConfig: options.pluginConfig }
|
|
1482
|
+
}));
|
|
1483
|
+
this.setTimer = options.setTimer ?? ((fn, ms) => {
|
|
1484
|
+
const timer = setInterval(fn, ms);
|
|
1485
|
+
timer.unref?.();
|
|
1486
|
+
return timer;
|
|
1487
|
+
});
|
|
1488
|
+
this.clearTimer = options.clearTimer ?? ((handle) => clearInterval(handle));
|
|
1489
|
+
this.onRun = options.onRun;
|
|
1490
|
+
this.onError = options.onError;
|
|
1491
|
+
}
|
|
1492
|
+
/**
|
|
1493
|
+
* Arm the periodic sync. Disabled config (default-off) registers nothing.
|
|
1494
|
+
* Idempotent: a second call while running (or after stop) re-arms nothing.
|
|
1495
|
+
*/
|
|
1496
|
+
start() {
|
|
1497
|
+
if (this.handle !== null || this.stopped || !this.config.enabled) {
|
|
1498
|
+
return { registered: this.handle !== null, intervalMs: this.intervalMs };
|
|
1499
|
+
}
|
|
1500
|
+
this.handle = this.setTimer(() => this.tick(), this.intervalMs);
|
|
1501
|
+
return { registered: true, intervalMs: this.intervalMs };
|
|
1502
|
+
}
|
|
1503
|
+
/**
|
|
1504
|
+
* Cancel the periodic sync and abort any in-flight tick, then resolve once it
|
|
1505
|
+
* has unwound. The abort + timer-clear + stop-latch happen synchronously, so
|
|
1506
|
+
* even a caller that cannot await (a sync teardown) still signals the running
|
|
1507
|
+
* sync to stop; async callers can await the returned drain. Idempotent.
|
|
1508
|
+
*/
|
|
1509
|
+
async stop() {
|
|
1510
|
+
this.stopped = true;
|
|
1511
|
+
this.abortController.abort();
|
|
1512
|
+
if (this.handle !== null) {
|
|
1513
|
+
this.clearTimer(this.handle);
|
|
1514
|
+
this.handle = null;
|
|
1515
|
+
}
|
|
1516
|
+
await this.inFlightPromise?.catch(() => void 0);
|
|
1517
|
+
}
|
|
1518
|
+
tick() {
|
|
1519
|
+
if (this.stopped || this.inFlight) return;
|
|
1520
|
+
this.inFlight = true;
|
|
1521
|
+
this.inFlightPromise = this.invoke(this.abortController.signal).then((summary) => this.onRun?.(summary)).catch((error) => this.onError?.(error)).finally(() => {
|
|
1522
|
+
this.inFlight = false;
|
|
1523
|
+
this.inFlightPromise = null;
|
|
1524
|
+
});
|
|
1525
|
+
}
|
|
1526
|
+
};
|
|
1527
|
+
|
|
1528
|
+
// src/activity/sync-registration.ts
|
|
1529
|
+
var ActivitySyncRegistrar = class {
|
|
1530
|
+
constructor(deps) {
|
|
1531
|
+
this.deps = deps;
|
|
1532
|
+
this.createScheduler = deps.createScheduler ?? ((options) => new ActivitySyncScheduler(options));
|
|
1533
|
+
}
|
|
1534
|
+
deps;
|
|
1535
|
+
scheduler = null;
|
|
1536
|
+
/** Latched by dispose() so a draining tick's onRun cannot re-arm maintenance. */
|
|
1537
|
+
disposed = false;
|
|
1538
|
+
createScheduler;
|
|
1539
|
+
/** True while a scheduler is armed (test/telemetry observability). */
|
|
1540
|
+
get armed() {
|
|
1541
|
+
return this.scheduler !== null;
|
|
1542
|
+
}
|
|
1543
|
+
/**
|
|
1544
|
+
* Arm (or re-arm) the periodic sync for the current lifecycle. Idempotent and
|
|
1545
|
+
* safe to call repeatedly; always stops a prior scheduler first.
|
|
1546
|
+
*/
|
|
1547
|
+
async register(signal) {
|
|
1548
|
+
const prior = this.scheduler;
|
|
1549
|
+
this.scheduler = null;
|
|
1550
|
+
await prior?.stop();
|
|
1551
|
+
if (signal.aborted) return;
|
|
1552
|
+
if (this.deps.secureStoreEnabled && this.deps.config.enabled) {
|
|
1553
|
+
log.warn(
|
|
1554
|
+
"activity sync disabled: secure store is enabled but activity digests/SQLite are not encrypted at rest"
|
|
1555
|
+
);
|
|
1556
|
+
return;
|
|
1557
|
+
}
|
|
1558
|
+
this.disposed = false;
|
|
1559
|
+
try {
|
|
1560
|
+
const scheduler = this.createScheduler({
|
|
1561
|
+
config: this.deps.config,
|
|
1562
|
+
memoryDir: this.deps.memoryDir,
|
|
1563
|
+
intervalMs: this.deps.config.autoSyncIntervalMinutes * 6e4,
|
|
1564
|
+
// Strict refresh after each digest write (rule 31): bypasses the
|
|
1565
|
+
// min-interval gate and throws on a real failure.
|
|
1566
|
+
reindexSearch: (sig) => refreshActivityIndex(this.deps.getQmd(), this.deps.qmdCollection, sig),
|
|
1567
|
+
...this.deps.pluginConfig === void 0 ? {} : { pluginConfig: this.deps.pluginConfig },
|
|
1568
|
+
// A failed reindex (QMD down) leaves the next unchanged-digest tick
|
|
1569
|
+
// skipping afterWrites, so route the retry through the durable,
|
|
1570
|
+
// throttled QMD path — but never after teardown.
|
|
1571
|
+
onRun: (summary) => {
|
|
1572
|
+
if (summary.reindexErrorCount > 0 && !this.disposed) {
|
|
1573
|
+
log.warn(
|
|
1574
|
+
`activity sync: ${summary.reindexErrorCount} source(s) had a failed reindex; queuing a maintenance retry`
|
|
1575
|
+
);
|
|
1576
|
+
this.deps.requestReindexRetry();
|
|
1577
|
+
}
|
|
1578
|
+
if (summary.enabled && summary.totalInserted > 0 && !this.disposed) {
|
|
1579
|
+
this.deps.onSynced?.(summary);
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
});
|
|
1583
|
+
this.scheduler = scheduler;
|
|
1584
|
+
scheduler.start();
|
|
1585
|
+
if (signal.aborted) {
|
|
1586
|
+
await scheduler.stop();
|
|
1587
|
+
this.scheduler = null;
|
|
1588
|
+
}
|
|
1589
|
+
} catch (err) {
|
|
1590
|
+
log.debug(`activity sync scheduler start failed (non-fatal): ${err}`);
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
/**
|
|
1594
|
+
* Latch teardown and drain the scheduler. Latching first ensures a draining
|
|
1595
|
+
* tick's onRun cannot queue a retry; the drain is awaited so no in-flight
|
|
1596
|
+
* tick keeps writing after teardown.
|
|
1597
|
+
*/
|
|
1598
|
+
async dispose() {
|
|
1599
|
+
this.disposed = true;
|
|
1600
|
+
const drain = this.scheduler?.stop();
|
|
1601
|
+
this.scheduler = null;
|
|
1602
|
+
await drain;
|
|
1603
|
+
}
|
|
1604
|
+
};
|
|
1605
|
+
|
|
1606
|
+
// src/orchestration/maintenance.ts
|
|
1607
|
+
function qmdMaintenanceSkipReasonForError(error) {
|
|
1608
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1609
|
+
return /^QMD (?:update|embed) skipped by .*min-interval gate$/.test(message) ? "throttled" : null;
|
|
1610
|
+
}
|
|
1611
|
+
var MaintenanceScheduler = class {
|
|
1612
|
+
constructor(deps) {
|
|
1613
|
+
this.deps = deps;
|
|
1614
|
+
this.activityRegistrar = new ActivitySyncRegistrar({
|
|
1615
|
+
config: deps.config.activity,
|
|
1616
|
+
memoryDir: deps.config.memoryDir,
|
|
1617
|
+
qmdCollection: deps.config.qmdCollection,
|
|
1618
|
+
secureStoreEnabled: resolveRecallAuxiliaryCapabilities(deps.config).secureStore,
|
|
1619
|
+
getQmd: () => deps.getQmd(),
|
|
1620
|
+
requestReindexRetry: () => this.requestQmdMaintenanceForTool("activity-reindex-retry"),
|
|
1621
|
+
pluginConfig: deps.config,
|
|
1622
|
+
...deps.onActivitySynced ? { onSynced: deps.onActivitySynced } : {}
|
|
1623
|
+
});
|
|
1624
|
+
}
|
|
1625
|
+
deps;
|
|
1626
|
+
// ── Consolidation scheduling state ──
|
|
1627
|
+
nonZeroExtractionsSinceConsolidation = 0;
|
|
1628
|
+
lastConsolidationRunAtMs = 0;
|
|
1629
|
+
consolidationRunPromise = null;
|
|
1630
|
+
disposed = false;
|
|
1631
|
+
// ── QMD maintenance scheduling state ──
|
|
1632
|
+
qmdMaintenanceTimer = null;
|
|
1633
|
+
qmdMaintenancePending = false;
|
|
1634
|
+
qmdMaintenanceInFlight = false;
|
|
1635
|
+
lastQmdEmbedAtMs = 0;
|
|
1636
|
+
lastQmdEmbedAtMsByNamespace = /* @__PURE__ */ new Map();
|
|
1637
|
+
// ── Lifecycle-ledger auto-compaction state (issue #1910) ──
|
|
1638
|
+
lifecycleCompactionInFlight = false;
|
|
1639
|
+
lastLifecycleCompactionAtMs = 0;
|
|
1640
|
+
// Upper bound on a rewritten ledger; a preserving compaction is bounded to
|
|
1641
|
+
// this so it can never leave the ledger over the whole-file read/decrypt cap
|
|
1642
|
+
// (#2033). Defaults to the decrypt cap; overridable in focused tests to drive
|
|
1643
|
+
// the bounding + post-write verification deterministically without a 400MB
|
|
1644
|
+
// fixture.
|
|
1645
|
+
lifecycleLedgerMaxBytes = STATE_FILE_MAX_DECRYPT_BYTES;
|
|
1646
|
+
// ── Memory-projection scheduled-rebuild state (issue #2119) ──
|
|
1647
|
+
projectionRebuild = createProjectionRebuildScheduleState();
|
|
1648
|
+
// ── Activity (screen-capture) sync scheduler (issue #1900) ──
|
|
1649
|
+
// The full arm/re-arm/teardown lifecycle lives in ActivitySyncRegistrar.
|
|
1650
|
+
activityRegistrar;
|
|
1651
|
+
// ── Location day-sync scheduler (issue #2047) — master default-off; the
|
|
1652
|
+
// timer + lifecycle contract lives in location/scheduler.ts.
|
|
1653
|
+
locationAutoSync = null;
|
|
1654
|
+
// ───────────────────────────────────────────────────────────────────────
|
|
1655
|
+
// Cron auto-registration
|
|
1656
|
+
// ───────────────────────────────────────────────────────────────────────
|
|
1657
|
+
/**
|
|
1658
|
+
* Register every cron job the daemon should run, gated by its config flag.
|
|
1659
|
+
* Each registration is independent and non-fatal — a failure in one does
|
|
1660
|
+
* not block the others (mirrors the orchestrator's prior sequential try/
|
|
1661
|
+
* catch behavior exactly).
|
|
1662
|
+
*
|
|
1663
|
+
* Returns when all eligible registrations have completed so callers that
|
|
1664
|
+
* `await deferredReady` can rely on jobs.json being current.
|
|
1665
|
+
*/
|
|
1666
|
+
async autoRegisterCrons(signal) {
|
|
1667
|
+
if (resolveRecallAuxiliaryCapabilities(this.deps.config).daySummary) {
|
|
1668
|
+
try {
|
|
1669
|
+
await this.autoRegisterDaySummaryCron();
|
|
1670
|
+
} catch (err) {
|
|
1671
|
+
log.debug(`day-summary cron auto-register failed (non-fatal): ${err}`);
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1674
|
+
if (this.deps.config.nightlyGovernanceCronAutoRegister) {
|
|
1675
|
+
try {
|
|
1676
|
+
await this.autoRegisterNightlyGovernanceCron();
|
|
1677
|
+
} catch (err) {
|
|
1678
|
+
log.debug(`nightly governance cron auto-register failed (non-fatal): ${err}`);
|
|
1679
|
+
}
|
|
1680
|
+
}
|
|
1681
|
+
if (this.deps.config.procedural?.proceduralMiningCronAutoRegister) {
|
|
1682
|
+
try {
|
|
1683
|
+
await this.autoRegisterProceduralMiningCron();
|
|
1684
|
+
} catch (err) {
|
|
1685
|
+
log.debug(`procedural mining cron auto-register failed (non-fatal): ${err}`);
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
if (this.deps.config.contradictionScan?.enabled) {
|
|
1689
|
+
try {
|
|
1690
|
+
await this.autoRegisterContradictionScanCron();
|
|
1691
|
+
} catch (err) {
|
|
1692
|
+
log.debug(`contradiction scan cron auto-register failed (non-fatal): ${err}`);
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1695
|
+
if (resolveConsolidationCapabilities(this.deps.config).patternReinforcement) {
|
|
1696
|
+
try {
|
|
1697
|
+
await this.autoRegisterPatternReinforcementCron();
|
|
1698
|
+
} catch (err) {
|
|
1699
|
+
log.debug(`pattern reinforcement cron auto-register failed (non-fatal): ${err}`);
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
if (resolveConsolidationCapabilities(this.deps.config).graphEdgeDecay) {
|
|
1703
|
+
try {
|
|
1704
|
+
await this.autoRegisterGraphEdgeDecayCron();
|
|
1705
|
+
} catch (err) {
|
|
1706
|
+
log.debug(`graph edge decay cron auto-register failed (non-fatal): ${err}`);
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
await this.activityRegistrar.register(signal);
|
|
1710
|
+
if (!signal.aborted && this.deps.config.location.enabled && this.deps.config.location.sources.some((source) => source.enabled)) {
|
|
1711
|
+
this.locationAutoSync = startLocationAutoSync({
|
|
1712
|
+
config: this.deps.config.location,
|
|
1713
|
+
memoryDir: this.deps.config.memoryDir
|
|
1714
|
+
});
|
|
1715
|
+
}
|
|
1716
|
+
}
|
|
1717
|
+
async autoRegisterDaySummaryCron() {
|
|
1718
|
+
const home = resolveHomeDir();
|
|
1719
|
+
const jobsPath = path5.join(home, ".openclaw", "cron", "jobs.json");
|
|
1720
|
+
try {
|
|
1721
|
+
if (!existsSync(jobsPath)) {
|
|
1722
|
+
log.debug("day-summary cron: jobs.json not found, skipping auto-register");
|
|
1723
|
+
return;
|
|
1724
|
+
}
|
|
1725
|
+
const { model, fallbacks } = resolveDaySummaryCronModel(this.deps.config);
|
|
1726
|
+
const timezone = this.deps.config.daySummaryTimezone || Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
1727
|
+
const result = await ensureDaySummaryCron(jobsPath, {
|
|
1728
|
+
timezone,
|
|
1729
|
+
...model ? { model } : {},
|
|
1730
|
+
...fallbacks.length > 0 ? { fallbacks } : {}
|
|
1731
|
+
});
|
|
1732
|
+
if (result.created) {
|
|
1733
|
+
log.info(
|
|
1734
|
+
`day-summary cron auto-registered (${result.jobId}, 23:47 ${timezone}${model ? `, model: ${model}` : ""})`
|
|
1735
|
+
);
|
|
1736
|
+
} else if (result.updated) {
|
|
1737
|
+
log.info(
|
|
1738
|
+
`day-summary cron reconciled (${result.jobId}, timezone: ${timezone}${model ? `, model: ${model}` : ""})`
|
|
1739
|
+
);
|
|
1740
|
+
} else {
|
|
1741
|
+
log.debug("day-summary cron already up to date");
|
|
1742
|
+
}
|
|
1743
|
+
} catch (err) {
|
|
1744
|
+
log.debug(`day-summary cron auto-register error: ${err}`);
|
|
1745
|
+
}
|
|
1746
|
+
}
|
|
1747
|
+
async autoRegisterNightlyGovernanceCron() {
|
|
1748
|
+
const home = resolveHomeDir();
|
|
1749
|
+
const jobsPath = path5.join(home, ".openclaw", "cron", "jobs.json");
|
|
1750
|
+
try {
|
|
1751
|
+
if (!existsSync(jobsPath)) {
|
|
1752
|
+
log.debug("nightly governance cron: jobs.json not found, skipping auto-register");
|
|
1753
|
+
return;
|
|
1754
|
+
}
|
|
1755
|
+
const created = await ensureNightlyGovernanceCron(jobsPath, {
|
|
1756
|
+
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
1757
|
+
});
|
|
1758
|
+
if (created.created) {
|
|
1759
|
+
log.info(
|
|
1760
|
+
`nightly governance cron auto-registered (${created.jobId}, 02:23 ${Intl.DateTimeFormat().resolvedOptions().timeZone})`
|
|
1761
|
+
);
|
|
1762
|
+
} else {
|
|
1763
|
+
log.debug("nightly governance cron already exists, skipping auto-register");
|
|
1764
|
+
}
|
|
1765
|
+
} catch (err) {
|
|
1766
|
+
log.debug(`nightly governance cron auto-register error: ${err}`);
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
async autoRegisterProceduralMiningCron() {
|
|
1770
|
+
const home = resolveHomeDir();
|
|
1771
|
+
const jobsPath = path5.join(home, ".openclaw", "cron", "jobs.json");
|
|
1772
|
+
try {
|
|
1773
|
+
if (!existsSync(jobsPath)) {
|
|
1774
|
+
log.debug("procedural mining cron: jobs.json not found, skipping auto-register");
|
|
1775
|
+
return;
|
|
1776
|
+
}
|
|
1777
|
+
const created = await ensureProceduralMiningCron(jobsPath, {
|
|
1778
|
+
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
1779
|
+
});
|
|
1780
|
+
if (created.created) {
|
|
1781
|
+
log.info(`procedural mining cron auto-registered (${created.jobId})`);
|
|
1782
|
+
} else {
|
|
1783
|
+
log.debug("procedural mining cron already exists, skipping auto-register");
|
|
1784
|
+
}
|
|
1785
|
+
} catch (err) {
|
|
1786
|
+
log.debug(`procedural mining cron auto-register error: ${err}`);
|
|
1787
|
+
}
|
|
1788
|
+
}
|
|
1789
|
+
async autoRegisterContradictionScanCron() {
|
|
1790
|
+
const home = resolveHomeDir();
|
|
1791
|
+
const jobsPath = path5.join(home, ".openclaw", "cron", "jobs.json");
|
|
1792
|
+
try {
|
|
1793
|
+
if (!existsSync(jobsPath)) {
|
|
1794
|
+
log.debug("contradiction scan cron: jobs.json not found, skipping auto-register");
|
|
1795
|
+
return;
|
|
1796
|
+
}
|
|
1797
|
+
const created = await ensureContradictionScanCron(jobsPath, {
|
|
1798
|
+
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
1799
|
+
});
|
|
1800
|
+
if (created.created) {
|
|
1801
|
+
log.info(`contradiction scan cron auto-registered (${created.jobId})`);
|
|
1802
|
+
} else {
|
|
1803
|
+
log.debug("contradiction scan cron already exists, skipping auto-register");
|
|
1804
|
+
}
|
|
1805
|
+
} catch (err) {
|
|
1806
|
+
log.debug(`contradiction scan cron auto-register error: ${err}`);
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
async autoRegisterPatternReinforcementCron() {
|
|
1810
|
+
const home = resolveHomeDir();
|
|
1811
|
+
const jobsPath = path5.join(home, ".openclaw", "cron", "jobs.json");
|
|
1812
|
+
try {
|
|
1813
|
+
if (!existsSync(jobsPath)) {
|
|
1814
|
+
log.debug("pattern reinforcement cron: jobs.json not found, skipping auto-register");
|
|
1815
|
+
return;
|
|
1816
|
+
}
|
|
1817
|
+
const created = await ensurePatternReinforcementCron(jobsPath, {
|
|
1818
|
+
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
1819
|
+
});
|
|
1820
|
+
if (created.created) {
|
|
1821
|
+
log.info(`pattern reinforcement cron auto-registered (${created.jobId})`);
|
|
1822
|
+
} else {
|
|
1823
|
+
log.debug("pattern reinforcement cron already exists, skipping auto-register");
|
|
1824
|
+
}
|
|
1825
|
+
} catch (err) {
|
|
1826
|
+
log.debug(`pattern reinforcement cron auto-register error: ${err}`);
|
|
1827
|
+
}
|
|
1828
|
+
}
|
|
1829
|
+
async autoRegisterGraphEdgeDecayCron() {
|
|
1830
|
+
const home = resolveHomeDir();
|
|
1831
|
+
const jobsPath = path5.join(home, ".openclaw", "cron", "jobs.json");
|
|
1832
|
+
try {
|
|
1833
|
+
if (!existsSync(jobsPath)) {
|
|
1834
|
+
log.debug("graph edge decay cron: jobs.json not found, skipping auto-register");
|
|
1835
|
+
return;
|
|
1836
|
+
}
|
|
1837
|
+
const scheduleExpr = graphEdgeDecayCadenceToCronExpr(
|
|
1838
|
+
this.deps.config.graphEdgeDecayCadenceMs
|
|
1839
|
+
);
|
|
1840
|
+
const created = await ensureGraphEdgeDecayCron(jobsPath, {
|
|
1841
|
+
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
1842
|
+
scheduleExpr
|
|
1843
|
+
});
|
|
1844
|
+
if (created.created) {
|
|
1845
|
+
log.info(`graph edge decay cron auto-registered (${created.jobId}, ${scheduleExpr})`);
|
|
1846
|
+
} else {
|
|
1847
|
+
log.debug("graph edge decay cron already exists, skipping auto-register");
|
|
1848
|
+
}
|
|
1849
|
+
} catch (err) {
|
|
1850
|
+
log.debug(`graph edge decay cron auto-register error: ${err}`);
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1853
|
+
// ───────────────────────────────────────────────────────────────────────
|
|
1854
|
+
// Consolidation scheduling
|
|
1855
|
+
// ───────────────────────────────────────────────────────────────────────
|
|
1856
|
+
/**
|
|
1857
|
+
* Maybe trigger a background consolidation pass after an extraction.
|
|
1858
|
+
* Counted + interval gated so a burst of extractions does not fan into a
|
|
1859
|
+
* burst of consolidation passes. The consolidation runner itself is
|
|
1860
|
+
* passed in as a callback because it lives on the orchestrator (LLM +
|
|
1861
|
+
* storage dependency surface) and is not owned by this module.
|
|
1862
|
+
*/
|
|
1863
|
+
maybeScheduleConsolidation(nonZeroExtraction, runConsolidation) {
|
|
1864
|
+
if (nonZeroExtraction) this.nonZeroExtractionsSinceConsolidation += 1;
|
|
1865
|
+
if (this.deps.config.consolidationRequireNonZeroExtraction && !nonZeroExtraction) {
|
|
1866
|
+
return;
|
|
1867
|
+
}
|
|
1868
|
+
if (this.nonZeroExtractionsSinceConsolidation < this.deps.config.consolidateEveryN) {
|
|
1869
|
+
return;
|
|
1870
|
+
}
|
|
1871
|
+
const now = Date.now();
|
|
1872
|
+
if (now - this.lastConsolidationRunAtMs < this.deps.config.consolidationMinIntervalMs) {
|
|
1873
|
+
return;
|
|
1874
|
+
}
|
|
1875
|
+
if (this.disposed || this.consolidationRunPromise) return;
|
|
1876
|
+
this.lastConsolidationRunAtMs = now;
|
|
1877
|
+
this.nonZeroExtractionsSinceConsolidation = 0;
|
|
1878
|
+
this.consolidationRunPromise = Promise.resolve().then(runConsolidation).catch((err) => {
|
|
1879
|
+
log.error("background consolidation failed", err);
|
|
1880
|
+
}).finally(() => {
|
|
1881
|
+
this.consolidationRunPromise = null;
|
|
1882
|
+
});
|
|
1883
|
+
}
|
|
1884
|
+
/** Whether a background consolidation pass is currently running. Exposed so
|
|
1885
|
+
* the orchestrator's waitForConsolidationIdle can poll idle state without
|
|
1886
|
+
* owning the cadence state (issue #1526 PR1). */
|
|
1887
|
+
isConsolidationInFlight() {
|
|
1888
|
+
return this.consolidationRunPromise !== null;
|
|
1889
|
+
}
|
|
1890
|
+
/** Whether a debounced QMD maintenance pass is armed and waiting for the
|
|
1891
|
+
* debounce timer. Exposed so drain/teardown diagnostics (e.g. the bench
|
|
1892
|
+
* adapter) can observe scheduler idle state after the #1526 PR1 extraction
|
|
1893
|
+
* moved this flag off the orchestrator. */
|
|
1894
|
+
isQmdMaintenancePending() {
|
|
1895
|
+
return this.qmdMaintenancePending;
|
|
1896
|
+
}
|
|
1897
|
+
/** Whether a QMD maintenance pass is currently running (singleflight guard).
|
|
1898
|
+
* Exposed for drain/teardown diagnostics (see isQmdMaintenancePending). */
|
|
1899
|
+
isQmdMaintenanceInFlight() {
|
|
1900
|
+
return this.qmdMaintenanceInFlight;
|
|
1901
|
+
}
|
|
1902
|
+
// ───────────────────────────────────────────────────────────────────────
|
|
1903
|
+
// QMD maintenance scheduling (debounced + singleflight)
|
|
1904
|
+
// ───────────────────────────────────────────────────────────────────────
|
|
1905
|
+
/** Internal: queue a debounced QMD maintenance pass. */
|
|
1906
|
+
requestQmdMaintenance() {
|
|
1907
|
+
if (!this.deps.getQmd().isAvailable()) return;
|
|
1908
|
+
if (!resolveQmdCapabilities(this.deps.config).qmdMaintenance) return;
|
|
1909
|
+
this.qmdMaintenancePending = true;
|
|
1910
|
+
if (this.qmdMaintenanceTimer) return;
|
|
1911
|
+
this.qmdMaintenanceTimer = setTimeout(() => {
|
|
1912
|
+
this.qmdMaintenanceTimer = null;
|
|
1913
|
+
this.runQmdMaintenance().catch(
|
|
1914
|
+
(err) => log.debug(`background qmd maintenance failed: ${err}`)
|
|
1915
|
+
);
|
|
1916
|
+
}, this.deps.config.qmdMaintenanceDebounceMs);
|
|
1917
|
+
}
|
|
1918
|
+
/**
|
|
1919
|
+
* Public entrypoint for tool-driven QMD maintenance requests.
|
|
1920
|
+
* Routes through existing debounced/singleflight maintenance controls.
|
|
1921
|
+
*/
|
|
1922
|
+
requestQmdMaintenanceForTool(reason) {
|
|
1923
|
+
try {
|
|
1924
|
+
this.requestQmdMaintenance();
|
|
1925
|
+
} catch (err) {
|
|
1926
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
1927
|
+
log.warn(`qmd maintenance request failed (${reason}): ${msg}`);
|
|
1928
|
+
}
|
|
1929
|
+
void this.maybeCompactMemoryLifecycleLedger().catch(
|
|
1930
|
+
(err) => log.debug(`lifecycle ledger auto-compaction check failed (non-fatal): ${err}`)
|
|
1931
|
+
);
|
|
1932
|
+
void maybeRebuildMemoryProjectionScheduled({
|
|
1933
|
+
config: this.deps.config,
|
|
1934
|
+
getStorage: this.deps.getStorage,
|
|
1935
|
+
state: this.projectionRebuild
|
|
1936
|
+
}).catch(
|
|
1937
|
+
(err) => log.debug(`memory projection scheduled rebuild check failed (non-fatal): ${err}`)
|
|
1938
|
+
);
|
|
1939
|
+
}
|
|
1940
|
+
/** Internal: run a single QMD maintenance pass under singleflight guard. */
|
|
1941
|
+
async runQmdMaintenance() {
|
|
1942
|
+
if (this.qmdMaintenanceInFlight) return;
|
|
1943
|
+
if (!this.qmdMaintenancePending) return;
|
|
1944
|
+
this.qmdMaintenanceInFlight = true;
|
|
1945
|
+
this.qmdMaintenancePending = false;
|
|
1946
|
+
try {
|
|
1947
|
+
if (resolveNamespaceCapabilities(this.deps.config).namespaces) {
|
|
1948
|
+
const plan = await this.namespaceMaintenancePlan("qmd");
|
|
1949
|
+
const now = Date.now();
|
|
1950
|
+
const lastEmbedAtByNamespace = this.lastQmdEmbedAtMsByNamespace;
|
|
1951
|
+
const dueEmbedNamespaces = (namespaces) => {
|
|
1952
|
+
if (!resolveQmdCapabilities(this.deps.config).qmdAutoEmbed) return [];
|
|
1953
|
+
return namespaces.filter(
|
|
1954
|
+
(namespace) => now - (lastEmbedAtByNamespace.get(namespace) ?? 0) >= this.deps.config.qmdEmbedMinIntervalMs
|
|
1955
|
+
);
|
|
1956
|
+
};
|
|
1957
|
+
const markEmbedded = (namespaces) => {
|
|
1958
|
+
if (namespaces.length === 0) return;
|
|
1959
|
+
for (const namespace of namespaces) {
|
|
1960
|
+
lastEmbedAtByNamespace.set(namespace, now);
|
|
1961
|
+
}
|
|
1962
|
+
this.lastQmdEmbedAtMs = now;
|
|
1963
|
+
};
|
|
1964
|
+
await runNamespaceMaintenanceBatchPlan(
|
|
1965
|
+
this.deps.config,
|
|
1966
|
+
plan,
|
|
1967
|
+
async (candidates) => {
|
|
1968
|
+
const namespaces = candidates.map((candidate) => candidate.namespace);
|
|
1969
|
+
const embedNamespaces = dueEmbedNamespaces(namespaces);
|
|
1970
|
+
let result;
|
|
1971
|
+
try {
|
|
1972
|
+
result = await this.deps.namespaceSearchRouter.updateNamespacesDetailed(
|
|
1973
|
+
namespaces,
|
|
1974
|
+
void 0,
|
|
1975
|
+
{ strict: true }
|
|
1976
|
+
);
|
|
1977
|
+
} catch (error) {
|
|
1978
|
+
if (embedNamespaces.length > 0 && qmdMaintenanceSkipReasonForError(error) === "throttled") {
|
|
1979
|
+
await this.deps.namespaceSearchRouter.embedNamespaces(embedNamespaces, {
|
|
1980
|
+
strict: true
|
|
1981
|
+
});
|
|
1982
|
+
markEmbedded(embedNamespaces);
|
|
1983
|
+
}
|
|
1984
|
+
throw error;
|
|
1985
|
+
}
|
|
1986
|
+
if (result.backendCount <= 0) {
|
|
1987
|
+
throw new Error("no eligible QMD backend for selected namespaces");
|
|
1988
|
+
}
|
|
1989
|
+
if (result.eligibleNamespaces.length !== namespaces.length) {
|
|
1990
|
+
const eligible = new Set(result.eligibleNamespaces);
|
|
1991
|
+
const missing = namespaces.filter(
|
|
1992
|
+
(namespace) => !eligible.has(namespace)
|
|
1993
|
+
);
|
|
1994
|
+
throw new Error(
|
|
1995
|
+
`QMD backend ineligible for selected namespaces (${missing.length})`
|
|
1996
|
+
);
|
|
1997
|
+
}
|
|
1998
|
+
if (embedNamespaces.length > 0) {
|
|
1999
|
+
await this.deps.namespaceSearchRouter.embedNamespaces(embedNamespaces, {
|
|
2000
|
+
strict: true
|
|
2001
|
+
});
|
|
2002
|
+
markEmbedded(embedNamespaces);
|
|
2003
|
+
}
|
|
2004
|
+
return { itemCount: result.backendCount };
|
|
2005
|
+
},
|
|
2006
|
+
this.deps.namespaceCatalog,
|
|
2007
|
+
{
|
|
2008
|
+
skipReasonForError: qmdMaintenanceSkipReasonForError
|
|
2009
|
+
}
|
|
2010
|
+
);
|
|
2011
|
+
} else {
|
|
2012
|
+
await this.deps.getQmd().update();
|
|
2013
|
+
const now = Date.now();
|
|
2014
|
+
if (resolveQmdCapabilities(this.deps.config).qmdAutoEmbed && now - this.lastQmdEmbedAtMs >= this.deps.config.qmdEmbedMinIntervalMs) {
|
|
2015
|
+
await this.deps.getQmd().embed();
|
|
2016
|
+
this.lastQmdEmbedAtMs = now;
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
} finally {
|
|
2020
|
+
this.qmdMaintenanceInFlight = false;
|
|
2021
|
+
if (this.qmdMaintenancePending) {
|
|
2022
|
+
this.requestQmdMaintenance();
|
|
2023
|
+
}
|
|
2024
|
+
}
|
|
2025
|
+
}
|
|
2026
|
+
/**
|
|
2027
|
+
* Size-gated, throttled, single-flighted auto-compaction of the lifecycle
|
|
2028
|
+
* ledger (issue #1910). Compacts the root ledger AND every namespace ledger
|
|
2029
|
+
* (`memoryDir/namespaces/<token>/state/`) when namespaces are enabled, each
|
|
2030
|
+
* through the existing `rebuildMemoryLifecycleLedger` so the
|
|
2031
|
+
* archive-then-atomic-write discipline is reused verbatim. `0` disables.
|
|
2032
|
+
*
|
|
2033
|
+
* Before compacting, drain EVERY target's durable pending-append spill (the
|
|
2034
|
+
* root ledger AND each namespace ledger) so a lifecycle event that spilled
|
|
2035
|
+
* while a prior long rewrite held the lock is folded back into its ledger and
|
|
2036
|
+
* cannot be silently lost (issue #2033). Draining is independent of both the
|
|
2037
|
+
* compaction threshold and the min-interval throttle: targets are enumerated
|
|
2038
|
+
* through the same safe (symlink/containment-checked) resolver and every
|
|
2039
|
+
* eligible queue is drained BEFORE any throttle return, so a namespace spill
|
|
2040
|
+
* created after the previous pass never waits out the whole interval.
|
|
2041
|
+
* Encrypted-store safety is preserved — a keyed target drains through its
|
|
2042
|
+
* secure StorageManager, a filesystem-fallback target only through a plaintext
|
|
2043
|
+
* context that refuses encrypted ledgers/spills. Work stays bounded: one
|
|
2044
|
+
* target enumeration plus a bounded per-queue drain.
|
|
2045
|
+
*
|
|
2046
|
+
* The min-interval throttle timestamp advances ONLY after real, fully
|
|
2047
|
+
* successful compaction work: a failed OR deferred target leaves the throttle
|
|
2048
|
+
* un-advanced so it stays eligible on the next maintenance pass, while
|
|
2049
|
+
* `lifecycleCompactionInFlight` still prevents overlapping runs. A "deferred"
|
|
2050
|
+
* target is oversized but could not be compacted because its encrypted ledger
|
|
2051
|
+
* has no unlocked secure store — arming the throttle for it would suppress the
|
|
2052
|
+
* retry of that still-oversized ledger for the whole interval (#2033).
|
|
2053
|
+
*
|
|
2054
|
+
* The min-interval throttle is bypassed for one case: an encrypted ledger
|
|
2055
|
+
* already at/over the whole-file decrypt cap is unreadable, so it must be
|
|
2056
|
+
* clamped on the next pass rather than wait out the interval. Ordinary
|
|
2057
|
+
* below-cap (or plaintext) targets stay throttled (#2033).
|
|
2058
|
+
*/
|
|
2059
|
+
async maybeCompactMemoryLifecycleLedger() {
|
|
2060
|
+
const targets = await this.resolveLifecycleCompactionTargets();
|
|
2061
|
+
for (const target of targets) {
|
|
2062
|
+
await this.drainPendingForTarget(target);
|
|
2063
|
+
}
|
|
2064
|
+
const threshold = this.deps.config.memoryLifecycleLedgerCompactBytes;
|
|
2065
|
+
if (!(threshold > 0)) return;
|
|
2066
|
+
if (this.lifecycleCompactionInFlight) return;
|
|
2067
|
+
const now = Date.now();
|
|
2068
|
+
if (now - this.lastLifecycleCompactionAtMs < this.deps.config.memoryLifecycleLedgerCompactMinIntervalMs && !await this.hasOverCapEncryptedLifecycleLedger(targets)) {
|
|
2069
|
+
return;
|
|
2070
|
+
}
|
|
2071
|
+
if (this.lifecycleCompactionInFlight) return;
|
|
2072
|
+
this.lifecycleCompactionInFlight = true;
|
|
2073
|
+
try {
|
|
2074
|
+
let compacted = 0;
|
|
2075
|
+
let failed = 0;
|
|
2076
|
+
let deferred = 0;
|
|
2077
|
+
for (const target of targets) {
|
|
2078
|
+
const outcome = await this.compactLifecycleLedgerTarget(target, threshold);
|
|
2079
|
+
if (outcome === "compacted") compacted += 1;
|
|
2080
|
+
else if (outcome === "failed") failed += 1;
|
|
2081
|
+
else if (outcome === "deferred") deferred += 1;
|
|
2082
|
+
}
|
|
2083
|
+
if (compacted > 0 && failed === 0 && deferred === 0) {
|
|
2084
|
+
this.lastLifecycleCompactionAtMs = now;
|
|
2085
|
+
}
|
|
2086
|
+
} finally {
|
|
2087
|
+
this.lifecycleCompactionInFlight = false;
|
|
2088
|
+
}
|
|
2089
|
+
}
|
|
2090
|
+
/**
|
|
2091
|
+
* True when any lifecycle target's ledger is encrypted at rest AND its
|
|
2092
|
+
* on-disk size is at/over the whole-file decrypt cap. Such a ledger is already
|
|
2093
|
+
* unreadable (the secure reader refuses at/over the cap), so it must reach the
|
|
2094
|
+
* bounded compaction path on the next maintenance pass regardless of the
|
|
2095
|
+
* global min-interval throttle — otherwise the throttle could keep an
|
|
2096
|
+
* unreadable ledger un-clamped for a whole interval (#2033). Ordinary
|
|
2097
|
+
* below-cap or plaintext targets never match, so the throttle still governs
|
|
2098
|
+
* them. A stat/probe failure yields "no forced target" and is left to the
|
|
2099
|
+
* normal compaction path, which classifies it as failed and retries.
|
|
2100
|
+
*/
|
|
2101
|
+
async hasOverCapEncryptedLifecycleLedger(targets) {
|
|
2102
|
+
for (const target of targets) {
|
|
2103
|
+
const ledgerPath = path5.join(target.memoryDir, "state", "memory-lifecycle-ledger.jsonl");
|
|
2104
|
+
let size;
|
|
2105
|
+
try {
|
|
2106
|
+
size = (await stat(ledgerPath)).size;
|
|
2107
|
+
} catch {
|
|
2108
|
+
continue;
|
|
2109
|
+
}
|
|
2110
|
+
if (size < this.lifecycleLedgerMaxBytes) continue;
|
|
2111
|
+
try {
|
|
2112
|
+
if (await probeEncryptedRegularFileHeader(ledgerPath)) return true;
|
|
2113
|
+
} catch {
|
|
2114
|
+
continue;
|
|
2115
|
+
}
|
|
2116
|
+
}
|
|
2117
|
+
return false;
|
|
2118
|
+
}
|
|
2119
|
+
/**
|
|
2120
|
+
* Drain one compaction target's durable pending spill. A catalog-backed
|
|
2121
|
+
* target folds through its secure StorageManager; a filesystem-fallback
|
|
2122
|
+
* target (no storage) folds through a path-scoped plaintext context that
|
|
2123
|
+
* refuses encrypted ledgers/spills so a keyless drain never downgrades an
|
|
2124
|
+
* encrypted ledger (issue #2033).
|
|
2125
|
+
*/
|
|
2126
|
+
async drainPendingForTarget(target) {
|
|
2127
|
+
if (target.storage) {
|
|
2128
|
+
await this.drainPendingLifecycleAppends(target.storage);
|
|
2129
|
+
} else {
|
|
2130
|
+
await this.drainPendingLifecycleAppendsForPath(target.memoryDir);
|
|
2131
|
+
}
|
|
2132
|
+
}
|
|
2133
|
+
/** Drain a target's durable pending lifecycle-append spill into its ledger
|
|
2134
|
+
* (issue #2033); non-fatal and a fast no-op when nothing is pending. */
|
|
2135
|
+
async drainPendingLifecycleAppends(storage) {
|
|
2136
|
+
if (!storage) return;
|
|
2137
|
+
try {
|
|
2138
|
+
await storage.drainPendingMemoryLifecycleEvents();
|
|
2139
|
+
} catch (err) {
|
|
2140
|
+
log.debug(`lifecycle pending drain failed (non-fatal): ${err}`);
|
|
2141
|
+
}
|
|
2142
|
+
}
|
|
2143
|
+
/**
|
|
2144
|
+
* Drain a filesystem-fallback target's pending lifecycle-append spill when no
|
|
2145
|
+
* secure StorageManager is available (catalog-disabled namespace; issue
|
|
2146
|
+
* #2033). Uses the safe path-scoped PLAINTEXT context this fallback already
|
|
2147
|
+
* operates in: a keyless drain can only fold plaintext spills into a plaintext
|
|
2148
|
+
* ledger, so it refuses when the ledger or ANY spill is encrypted at rest,
|
|
2149
|
+
* leaving those pending for a keyed (catalog-path) drain — exactly mirroring
|
|
2150
|
+
* the fallback compaction's encrypted-ledger deferral. Non-fatal; a fast
|
|
2151
|
+
* no-op when nothing is pending. The shared spill lister enforces the symlink/
|
|
2152
|
+
* containment guard on every spill file it reads or deletes.
|
|
2153
|
+
*/
|
|
2154
|
+
async drainPendingLifecycleAppendsForPath(memoryDir) {
|
|
2155
|
+
const ledgerPath = path5.join(memoryDir, "state", "memory-lifecycle-ledger.jsonl");
|
|
2156
|
+
const spillDir = pendingLifecycleLedgerDir(ledgerPath);
|
|
2157
|
+
let spillFiles;
|
|
2158
|
+
let claimedOrphans;
|
|
2159
|
+
try {
|
|
2160
|
+
spillFiles = await listContainedSpillFiles(spillDir);
|
|
2161
|
+
claimedOrphans = await listContainedSpillFiles(spillDir, ".jsonl.claimed");
|
|
2162
|
+
} catch (err) {
|
|
2163
|
+
log.debug(`fallback lifecycle pending scan failed (non-fatal) for ${memoryDir}: ${err}`);
|
|
2164
|
+
return;
|
|
2165
|
+
}
|
|
2166
|
+
if (spillFiles.length === 0 && claimedOrphans.length === 0) return;
|
|
2167
|
+
const io = {
|
|
2168
|
+
writeSecure: async (filePath, payload) => {
|
|
2169
|
+
await mkdir3(path5.dirname(filePath), { recursive: true });
|
|
2170
|
+
await writeFile2(filePath, payload, "utf-8");
|
|
2171
|
+
},
|
|
2172
|
+
readSecure: async (filePath) => {
|
|
2173
|
+
if (await probeEncryptedRegularFileHeader(filePath)) {
|
|
2174
|
+
throw new Error(`fallback lifecycle drain deferred: encrypted spill at ${filePath}`);
|
|
2175
|
+
}
|
|
2176
|
+
return readFile2(filePath, "utf-8");
|
|
2177
|
+
}
|
|
2178
|
+
};
|
|
2179
|
+
try {
|
|
2180
|
+
await drainPendingLifecycleLedgerIfAny(
|
|
2181
|
+
ledgerPath,
|
|
2182
|
+
io,
|
|
2183
|
+
async (payload) => {
|
|
2184
|
+
if (await probeEncryptedRegularFileHeader(ledgerPath)) {
|
|
2185
|
+
throw new Error(`fallback lifecycle drain deferred: ledger became encrypted at ${ledgerPath}`);
|
|
2186
|
+
}
|
|
2187
|
+
await appendFile(ledgerPath, payload, "utf-8");
|
|
2188
|
+
},
|
|
2189
|
+
async () => {
|
|
2190
|
+
await mkdir3(path5.dirname(ledgerPath), { recursive: true });
|
|
2191
|
+
}
|
|
2192
|
+
);
|
|
2193
|
+
} catch (err) {
|
|
2194
|
+
log.debug(`fallback lifecycle pending drain failed (non-fatal) for ${memoryDir}: ${err}`);
|
|
2195
|
+
}
|
|
2196
|
+
}
|
|
2197
|
+
/**
|
|
2198
|
+
* Enumerate the lifecycle ledgers to consider for compaction: the root
|
|
2199
|
+
* (through the secure-configured root storage when available) plus every
|
|
2200
|
+
* cataloged namespace ledger when namespaces are enabled. Deduplicated by
|
|
2201
|
+
* resolved storage dir so a namespace that collapses onto the root is not
|
|
2202
|
+
* compacted twice. Namespace resolution failures are non-fatal.
|
|
2203
|
+
*/
|
|
2204
|
+
async resolveLifecycleCompactionTargets() {
|
|
2205
|
+
const targets = [];
|
|
2206
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2207
|
+
const addTarget = (memoryDir, storage) => {
|
|
2208
|
+
const key = path5.resolve(memoryDir);
|
|
2209
|
+
if (seen.has(key)) return;
|
|
2210
|
+
seen.add(key);
|
|
2211
|
+
targets.push({ memoryDir, storage });
|
|
2212
|
+
};
|
|
2213
|
+
const rootStorage = this.deps.getStorage?.();
|
|
2214
|
+
addTarget(rootStorage ? rootStorage.dir : this.deps.config.memoryDir, rootStorage);
|
|
2215
|
+
const resolveNamespaceStorage = this.deps.storageForNamespace;
|
|
2216
|
+
if (resolveNamespaceStorage && this.deps.namespaceCatalog?.enabled) {
|
|
2217
|
+
let records = [];
|
|
2218
|
+
try {
|
|
2219
|
+
records = await this.deps.namespaceCatalog.listNamespaces();
|
|
2220
|
+
} catch (err) {
|
|
2221
|
+
log.debug(`lifecycle compaction: namespace enumeration failed (non-fatal): ${err}`);
|
|
2222
|
+
}
|
|
2223
|
+
for (const record of records) {
|
|
2224
|
+
const namespace = record.namespace.trim();
|
|
2225
|
+
if (!namespace) continue;
|
|
2226
|
+
try {
|
|
2227
|
+
const storage = await resolveNamespaceStorage(namespace);
|
|
2228
|
+
addTarget(storage.dir, storage);
|
|
2229
|
+
} catch (err) {
|
|
2230
|
+
log.debug(
|
|
2231
|
+
`lifecycle compaction: storage resolve failed for namespace ${namespace} (non-fatal): ${err}`
|
|
2232
|
+
);
|
|
2233
|
+
}
|
|
2234
|
+
}
|
|
2235
|
+
}
|
|
2236
|
+
if (resolveNamespaceCapabilities(this.deps.config).namespaces) {
|
|
2237
|
+
const namespacesBase = path5.join(this.deps.config.memoryDir, "namespaces");
|
|
2238
|
+
let memoryDirReal;
|
|
2239
|
+
try {
|
|
2240
|
+
memoryDirReal = await realpath(this.deps.config.memoryDir);
|
|
2241
|
+
const baseStat = await lstat(namespacesBase);
|
|
2242
|
+
if (baseStat.isSymbolicLink() || !baseStat.isDirectory()) {
|
|
2243
|
+
throw new Error("namespaces base is a symlink or not a directory");
|
|
2244
|
+
}
|
|
2245
|
+
assertPathInsideRoot(memoryDirReal, await realpath(namespacesBase), namespacesBase);
|
|
2246
|
+
} catch (err) {
|
|
2247
|
+
if (!isErrnoCode(err, "ENOENT")) {
|
|
2248
|
+
log.debug(`lifecycle compaction: namespaces base rejected (non-fatal): ${err}`);
|
|
2249
|
+
}
|
|
2250
|
+
return targets;
|
|
2251
|
+
}
|
|
2252
|
+
let entries = [];
|
|
2253
|
+
try {
|
|
2254
|
+
entries = await readdir(namespacesBase, { withFileTypes: true });
|
|
2255
|
+
} catch (err) {
|
|
2256
|
+
if (!isErrnoCode(err, "ENOENT")) {
|
|
2257
|
+
log.debug(`lifecycle compaction: namespaces dir scan failed (non-fatal): ${err}`);
|
|
2258
|
+
}
|
|
2259
|
+
}
|
|
2260
|
+
for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
|
|
2261
|
+
if (!entry.isDirectory() || entry.isSymbolicLink()) continue;
|
|
2262
|
+
const childPath = path5.join(namespacesBase, entry.name);
|
|
2263
|
+
try {
|
|
2264
|
+
assertPathInsideRoot(memoryDirReal, await realpath(childPath), childPath);
|
|
2265
|
+
} catch (err) {
|
|
2266
|
+
log.debug(`lifecycle compaction: skipping out-of-root namespace dir ${childPath}: ${err}`);
|
|
2267
|
+
continue;
|
|
2268
|
+
}
|
|
2269
|
+
const decodedNamespace = namespaceIdentityFromToken(entry.name);
|
|
2270
|
+
const routeNamespace = decodedNamespace !== null ? decodedNamespace : isSafeRouteNamespace(entry.name) ? entry.name : null;
|
|
2271
|
+
if (resolveNamespaceStorage && routeNamespace !== null) {
|
|
2272
|
+
try {
|
|
2273
|
+
const storage = await resolveNamespaceStorage(routeNamespace);
|
|
2274
|
+
if (path5.resolve(storage.dir) === path5.resolve(childPath)) {
|
|
2275
|
+
addTarget(storage.dir, storage);
|
|
2276
|
+
continue;
|
|
2277
|
+
}
|
|
2278
|
+
log.debug(
|
|
2279
|
+
`lifecycle compaction: fallback resolver routed ${childPath} to ${storage.dir}; using keyless target`
|
|
2280
|
+
);
|
|
2281
|
+
} catch (err) {
|
|
2282
|
+
log.debug(
|
|
2283
|
+
`lifecycle compaction: fallback storage resolve failed for ${childPath} (non-fatal): ${err}`
|
|
2284
|
+
);
|
|
2285
|
+
}
|
|
2286
|
+
}
|
|
2287
|
+
addTarget(childPath);
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
return targets;
|
|
2291
|
+
}
|
|
2292
|
+
/**
|
|
2293
|
+
* Compact one lifecycle ledger when it is at/over `threshold`. Returns
|
|
2294
|
+
* `"skipped"` (absent or below threshold — nothing to do), `"compacted"`
|
|
2295
|
+
* (rewritten and verified under the read/decrypt cap), `"failed"`
|
|
2296
|
+
* (rebuild/probe threw, or the rewritten ledger is STILL over the cap — an
|
|
2297
|
+
* ineffective compaction — non-fatal, retried next pass), or `"deferred"`
|
|
2298
|
+
* (oversized but its encrypted ledger cannot be rewritten because no unlocked
|
|
2299
|
+
* secure store is available — real work still pending, so the caller must NOT
|
|
2300
|
+
* arm the throttle). #2033: a deferred/failed target is distinct from a genuine
|
|
2301
|
+
* no-op so one namespace compacting cannot suppress retries for another, and
|
|
2302
|
+
* an over-cap rewrite never arms the throttle.
|
|
2303
|
+
*/
|
|
2304
|
+
async compactLifecycleLedgerTarget(target, threshold) {
|
|
2305
|
+
const ledgerPath = path5.join(target.memoryDir, "state", "memory-lifecycle-ledger.jsonl");
|
|
2306
|
+
let size = 0;
|
|
2307
|
+
try {
|
|
2308
|
+
size = (await stat(ledgerPath)).size;
|
|
2309
|
+
} catch (err) {
|
|
2310
|
+
if (isErrnoCode(err, "ENOENT")) return "skipped";
|
|
2311
|
+
log.warn(
|
|
2312
|
+
`lifecycle ledger size check failed (non-fatal) for ${target.memoryDir}: ${err}`
|
|
2313
|
+
);
|
|
2314
|
+
return "failed";
|
|
2315
|
+
}
|
|
2316
|
+
if (size < Math.min(threshold, this.lifecycleLedgerMaxBytes)) return "skipped";
|
|
2317
|
+
let encrypted;
|
|
2318
|
+
try {
|
|
2319
|
+
encrypted = await probeEncryptedRegularFileHeader(ledgerPath);
|
|
2320
|
+
} catch (err) {
|
|
2321
|
+
log.warn(`lifecycle ledger encryption probe failed (non-fatal) for ${ledgerPath}: ${err}`);
|
|
2322
|
+
return "failed";
|
|
2323
|
+
}
|
|
2324
|
+
const effectiveThreshold = encrypted ? Math.min(threshold, this.lifecycleLedgerMaxBytes) : threshold;
|
|
2325
|
+
if (size < effectiveThreshold) return "skipped";
|
|
2326
|
+
if (encrypted && !(target.storage?.isSecureStoreUnlocked() ?? false)) {
|
|
2327
|
+
log.warn(
|
|
2328
|
+
`lifecycle ledger at ${ledgerPath} is encrypted at rest but no unlocked secure storage is available; deferring auto-compaction to avoid a plaintext rewrite. Run 'remnic rebuild-memory-lifecycle-ledger --write' after unlocking.`
|
|
2329
|
+
);
|
|
2330
|
+
return "deferred";
|
|
2331
|
+
}
|
|
2332
|
+
const replacementEncrypted = encrypted || (target.storage?.willEncryptStateWrites() ?? false);
|
|
2333
|
+
const plaintextBudget = replacementEncrypted ? this.lifecycleLedgerMaxBytes - SECURE_STORE_ENVELOPE_OVERHEAD_BYTES - 1 : this.lifecycleLedgerMaxBytes - 1;
|
|
2334
|
+
try {
|
|
2335
|
+
const result = await rebuildMemoryLifecycleLedger({
|
|
2336
|
+
memoryDir: target.memoryDir,
|
|
2337
|
+
dryRun: false,
|
|
2338
|
+
storage: target.storage,
|
|
2339
|
+
// Background compaction must not lose append-only history that
|
|
2340
|
+
// frontmatter cannot reconstruct (issue #1910); the manual CLI repair
|
|
2341
|
+
// rebuild now preserves and bounds identically (#2033).
|
|
2342
|
+
preserveExistingEvents: true,
|
|
2343
|
+
// Bound the PLAINTEXT rewrite to a budget that reserves the secure-store
|
|
2344
|
+
// envelope, so the on-disk ledger (plaintext, or plaintext+envelope when
|
|
2345
|
+
// encrypted) is strictly below the read/decrypt cap; overflow lands in
|
|
2346
|
+
// the verbatim backup (#2033 findings 2+4).
|
|
2347
|
+
maxLedgerBytes: plaintextBudget
|
|
2348
|
+
});
|
|
2349
|
+
let rewrittenSize = 0;
|
|
2350
|
+
try {
|
|
2351
|
+
rewrittenSize = (await stat(ledgerPath)).size;
|
|
2352
|
+
} catch (err) {
|
|
2353
|
+
log.warn(`lifecycle ledger post-compaction size check failed (non-fatal) for ${target.memoryDir}: ${err}`);
|
|
2354
|
+
return "failed";
|
|
2355
|
+
}
|
|
2356
|
+
if (rewrittenSize >= this.lifecycleLedgerMaxBytes) {
|
|
2357
|
+
log.warn(
|
|
2358
|
+
`lifecycle ledger auto-compaction ineffective for ${target.memoryDir}: rewritten ledger is ${rewrittenSize}B, still at/over the ${this.lifecycleLedgerMaxBytes}-byte read/decrypt cap; leaving the throttle un-armed to retry.`
|
|
2359
|
+
);
|
|
2360
|
+
return "failed";
|
|
2361
|
+
}
|
|
2362
|
+
if (result.rewritten === false) {
|
|
2363
|
+
log.debug(
|
|
2364
|
+
`lifecycle ledger already compact for ${target.memoryDir}: ${rewrittenSize}B, no rewrite needed (throttle armed to avoid re-archiving an unchanged ledger).`
|
|
2365
|
+
);
|
|
2366
|
+
} else {
|
|
2367
|
+
log.info(
|
|
2368
|
+
`lifecycle ledger auto-compacted (${target.memoryDir}): ${size}B -> ${rewrittenSize}B, ${result.rebuiltRows} rows (${result.preservedAppendOnlyRows ?? 0} append-only preserved, ${result.archivedOverflowRows ?? 0} overflow archived), backup=${result.backupPath ?? "none"}`
|
|
2369
|
+
);
|
|
2370
|
+
}
|
|
2371
|
+
return "compacted";
|
|
2372
|
+
} catch (err) {
|
|
2373
|
+
log.warn(
|
|
2374
|
+
`lifecycle ledger auto-compaction failed (non-fatal) for ${target.memoryDir}: ${err}`
|
|
2375
|
+
);
|
|
2376
|
+
return "failed";
|
|
2377
|
+
}
|
|
2378
|
+
}
|
|
2379
|
+
/** Build the namespace-aware maintenance plan for one job. */
|
|
2380
|
+
async namespaceMaintenancePlan(jobName) {
|
|
2381
|
+
return planNamespaceMaintenance(this.deps.config, {
|
|
2382
|
+
jobName,
|
|
2383
|
+
catalog: this.deps.namespaceCatalog
|
|
2384
|
+
});
|
|
2385
|
+
}
|
|
2386
|
+
// ───────────────────────────────────────────────────────────────────────
|
|
2387
|
+
// Lifecycle
|
|
2388
|
+
// ───────────────────────────────────────────────────────────────────────
|
|
2389
|
+
/**
|
|
2390
|
+
* Clear any pending debounce timer and drain the activity sync scheduler.
|
|
2391
|
+
* Called from the orchestrator's destroy() so a late tick does not fire on a
|
|
2392
|
+
* torn-down instance and no in-flight activity tick keeps writing after
|
|
2393
|
+
* teardown. Async: awaits the scheduler's abort+drain before resolving.
|
|
2394
|
+
*/
|
|
2395
|
+
async dispose() {
|
|
2396
|
+
this.disposed = true;
|
|
2397
|
+
const consolidationDrain = this.consolidationRunPromise;
|
|
2398
|
+
const activityDrain = this.activityRegistrar.dispose();
|
|
2399
|
+
const locationDrain = this.locationAutoSync?.stop() ?? Promise.resolve();
|
|
2400
|
+
this.locationAutoSync = null;
|
|
2401
|
+
if (this.qmdMaintenanceTimer) {
|
|
2402
|
+
clearTimeout(this.qmdMaintenanceTimer);
|
|
2403
|
+
this.qmdMaintenanceTimer = null;
|
|
2404
|
+
}
|
|
2405
|
+
this.qmdMaintenancePending = false;
|
|
2406
|
+
await activityDrain;
|
|
2407
|
+
await locationDrain;
|
|
2408
|
+
if (this.qmdMaintenanceTimer) {
|
|
2409
|
+
clearTimeout(this.qmdMaintenanceTimer);
|
|
2410
|
+
this.qmdMaintenanceTimer = null;
|
|
2411
|
+
}
|
|
2412
|
+
this.qmdMaintenancePending = false;
|
|
2413
|
+
if (consolidationDrain) await consolidationDrain;
|
|
2414
|
+
}
|
|
2415
|
+
};
|
|
2416
|
+
|
|
2417
|
+
export {
|
|
2418
|
+
refreshActivityIndex,
|
|
2419
|
+
activityDatabasePath,
|
|
2420
|
+
ensureActivityStateDir,
|
|
2421
|
+
openActivityDatabase,
|
|
2422
|
+
applyActivitySchema,
|
|
2423
|
+
ActivityStore,
|
|
2424
|
+
activityCursorKey,
|
|
2425
|
+
syncActivitySource,
|
|
2426
|
+
ActivityHttpSourceClient,
|
|
2427
|
+
timelineCorrectionDatabasePath,
|
|
2428
|
+
TimelineCorrectionStore,
|
|
2429
|
+
correctionsForCards,
|
|
2430
|
+
applyTimelineCorrections,
|
|
2431
|
+
classifyTimelineObservation,
|
|
2432
|
+
TIMELINE_FORMAT_VERSION,
|
|
2433
|
+
TIMELINE_MERGE_GAP_MS,
|
|
2434
|
+
TIMELINE_MAX_DWELL_MS,
|
|
2435
|
+
buildTimelineDay,
|
|
2436
|
+
serializeTimelineDay,
|
|
2437
|
+
runTimelineCardAnalysis,
|
|
2438
|
+
TIMELINE_DAY_FORMAT_VERSION,
|
|
2439
|
+
TIMELINE_DAY_DIR,
|
|
2440
|
+
timelineDayPath,
|
|
2441
|
+
snapshotToObservation,
|
|
2442
|
+
localDatesForUtcRange,
|
|
2443
|
+
listPersistedTimelineDates,
|
|
2444
|
+
resolveTimelineLoadDates,
|
|
2445
|
+
timelineAnalysisClientsFromConfig,
|
|
2446
|
+
regenerateTimelineDay,
|
|
2447
|
+
resolveActivitySyncDates,
|
|
2448
|
+
runActivitySyncOnce,
|
|
2449
|
+
ACTIVITY_SYNC_DEFAULT_INTERVAL_MS,
|
|
2450
|
+
ActivitySyncScheduler,
|
|
2451
|
+
MaintenanceScheduler
|
|
2452
|
+
};
|
|
2453
|
+
//# sourceMappingURL=chunk-SJV3AOZ2.js.map
|