@hasna/mementos 0.14.86 → 0.14.87
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/cli/__fixtures__/clean-fallback-stub-server.d.ts +2 -0
- package/dist/cli/__fixtures__/clean-fallback-stub-server.d.ts.map +1 -0
- package/dist/cli/__fixtures__/io-restore-stub-server.d.ts +2 -0
- package/dist/cli/__fixtures__/io-restore-stub-server.d.ts.map +1 -0
- package/dist/cli/brains.d.ts +3 -0
- package/dist/cli/brains.d.ts.map +1 -0
- package/dist/cli/commands/agent.d.ts +3 -0
- package/dist/cli/commands/agent.d.ts.map +1 -0
- package/dist/cli/commands/consolidation.d.ts +3 -0
- package/dist/cli/commands/consolidation.d.ts.map +1 -0
- package/dist/cli/commands/entity.d.ts +3 -0
- package/dist/cli/commands/entity.d.ts.map +1 -0
- package/dist/cli/commands/graph.d.ts +3 -0
- package/dist/cli/commands/graph.d.ts.map +1 -0
- package/dist/cli/commands/info-context.d.ts +3 -0
- package/dist/cli/commands/info-context.d.ts.map +1 -0
- package/dist/cli/commands/info-history.d.ts +3 -0
- package/dist/cli/commands/info-history.d.ts.map +1 -0
- package/dist/cli/commands/info-report.d.ts +3 -0
- package/dist/cli/commands/info-report.d.ts.map +1 -0
- package/dist/cli/commands/info-stale.d.ts +3 -0
- package/dist/cli/commands/info-stale.d.ts.map +1 -0
- package/dist/cli/commands/info-stats.d.ts +3 -0
- package/dist/cli/commands/info-stats.d.ts.map +1 -0
- package/dist/cli/commands/info.d.ts +12 -0
- package/dist/cli/commands/info.d.ts.map +1 -0
- package/dist/cli/commands/init.d.ts +3 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/io-backup.d.ts +3 -0
- package/dist/cli/commands/io-backup.d.ts.map +1 -0
- package/dist/cli/commands/io-clean.d.ts +3 -0
- package/dist/cli/commands/io-clean.d.ts.map +1 -0
- package/dist/cli/commands/io-export.d.ts +3 -0
- package/dist/cli/commands/io-export.d.ts.map +1 -0
- package/dist/cli/commands/io-import.d.ts +3 -0
- package/dist/cli/commands/io-import.d.ts.map +1 -0
- package/dist/cli/commands/io-restore.d.ts +3 -0
- package/dist/cli/commands/io-restore.d.ts.map +1 -0
- package/dist/cli/commands/io.d.ts +12 -0
- package/dist/cli/commands/io.d.ts.map +1 -0
- package/dist/cli/commands/memory-cmd-bulk.d.ts +3 -0
- package/dist/cli/commands/memory-cmd-bulk.d.ts.map +1 -0
- package/dist/cli/commands/memory-cmd-chain.d.ts +3 -0
- package/dist/cli/commands/memory-cmd-chain.d.ts.map +1 -0
- package/dist/cli/commands/memory-cmd-crud.d.ts +3 -0
- package/dist/cli/commands/memory-cmd-crud.d.ts.map +1 -0
- package/dist/cli/commands/memory-cmd-diff.d.ts +3 -0
- package/dist/cli/commands/memory-cmd-diff.d.ts.map +1 -0
- package/dist/cli/commands/memory-cmd-list.d.ts +3 -0
- package/dist/cli/commands/memory-cmd-list.d.ts.map +1 -0
- package/dist/cli/commands/memory-cmd-recall-exit.d.ts +3 -0
- package/dist/cli/commands/memory-cmd-recall-exit.d.ts.map +1 -0
- package/dist/cli/commands/memory-cmd-recall.d.ts +3 -0
- package/dist/cli/commands/memory-cmd-recall.d.ts.map +1 -0
- package/dist/cli/commands/memory-cmd-remove.d.ts +3 -0
- package/dist/cli/commands/memory-cmd-remove.d.ts.map +1 -0
- package/dist/cli/commands/memory-cmd-search.d.ts +3 -0
- package/dist/cli/commands/memory-cmd-search.d.ts.map +1 -0
- package/dist/cli/commands/memory-cmd-tail.d.ts +3 -0
- package/dist/cli/commands/memory-cmd-tail.d.ts.map +1 -0
- package/dist/cli/commands/memory-cmd-util.d.ts +3 -0
- package/dist/cli/commands/memory-cmd-util.d.ts.map +1 -0
- package/dist/cli/commands/memory-cmd-view.d.ts +3 -0
- package/dist/cli/commands/memory-cmd-view.d.ts.map +1 -0
- package/dist/cli/commands/memory-cmd-watch.d.ts +3 -0
- package/dist/cli/commands/memory-cmd-watch.d.ts.map +1 -0
- package/dist/cli/commands/memory-cmd-when-to-use.d.ts +3 -0
- package/dist/cli/commands/memory-cmd-when-to-use.d.ts.map +1 -0
- package/dist/cli/commands/memory.d.ts +3 -0
- package/dist/cli/commands/memory.d.ts.map +1 -0
- package/dist/cli/commands/project-panel.d.ts +3 -0
- package/dist/cli/commands/project-panel.d.ts.map +1 -0
- package/dist/cli/commands/project.d.ts +3 -0
- package/dist/cli/commands/project.d.ts.map +1 -0
- package/dist/cli/commands/relation.d.ts +3 -0
- package/dist/cli/commands/relation.d.ts.map +1 -0
- package/dist/cli/commands/storage.d.ts +3 -0
- package/dist/cli/commands/storage.d.ts.map +1 -0
- package/dist/cli/commands/system-auto-memory.d.ts +3 -0
- package/dist/cli/commands/system-auto-memory.d.ts.map +1 -0
- package/dist/cli/commands/system-completions.d.ts +13 -0
- package/dist/cli/commands/system-completions.d.ts.map +1 -0
- package/dist/cli/commands/system-config.d.ts +3 -0
- package/dist/cli/commands/system-config.d.ts.map +1 -0
- package/dist/cli/commands/system-doctor.d.ts +3 -0
- package/dist/cli/commands/system-doctor.d.ts.map +1 -0
- package/dist/cli/commands/system-hooks.d.ts +3 -0
- package/dist/cli/commands/system-hooks.d.ts.map +1 -0
- package/dist/cli/commands/system-mcp.d.ts +3 -0
- package/dist/cli/commands/system-mcp.d.ts.map +1 -0
- package/dist/cli/commands/system-misc.d.ts +3 -0
- package/dist/cli/commands/system-misc.d.ts.map +1 -0
- package/dist/cli/commands/system-profile.d.ts +3 -0
- package/dist/cli/commands/system-profile.d.ts.map +1 -0
- package/dist/cli/commands/system-session.d.ts +3 -0
- package/dist/cli/commands/system-session.d.ts.map +1 -0
- package/dist/cli/commands/system-sessions.d.ts +3 -0
- package/dist/cli/commands/system-sessions.d.ts.map +1 -0
- package/dist/cli/commands/system-synthesis.d.ts +3 -0
- package/dist/cli/commands/system-synthesis.d.ts.map +1 -0
- package/dist/cli/commands/system-synthesized-profile.d.ts +3 -0
- package/dist/cli/commands/system-synthesized-profile.d.ts.map +1 -0
- package/dist/cli/commands/system-tools.d.ts +3 -0
- package/dist/cli/commands/system-tools.d.ts.map +1 -0
- package/dist/cli/commands/system-watch.d.ts +3 -0
- package/dist/cli/commands/system-watch.d.ts.map +1 -0
- package/dist/cli/commands/system.d.ts +3 -0
- package/dist/cli/commands/system.d.ts.map +1 -0
- package/dist/cli/exit-codes.d.ts +13 -0
- package/dist/cli/exit-codes.d.ts.map +1 -0
- package/dist/cli/global-options.d.ts +27 -0
- package/dist/cli/global-options.d.ts.map +1 -0
- package/dist/cli/helpers.d.ts +150 -0
- package/dist/cli/helpers.d.ts.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +204 -20
- package/dist/cli/register-all.d.ts +17 -0
- package/dist/cli/register-all.d.ts.map +1 -0
- package/dist/cli/startup-side-effects.d.ts +9 -0
- package/dist/cli/startup-side-effects.d.ts.map +1 -0
- package/dist/db/__fixtures__/fail-closed-stub-server.d.ts +2 -0
- package/dist/db/__fixtures__/fail-closed-stub-server.d.ts.map +1 -0
- package/dist/db/__fixtures__/list-filter-capture-server.d.ts +2 -0
- package/dist/db/__fixtures__/list-filter-capture-server.d.ts.map +1 -0
- package/dist/db/__fixtures__/list-filter-client-runner.d.ts +2 -0
- package/dist/db/__fixtures__/list-filter-client-runner.d.ts.map +1 -0
- package/dist/db/acl.d.ts +34 -0
- package/dist/db/acl.d.ts.map +1 -0
- package/dist/db/agents.d.ts +35 -0
- package/dist/db/agents.d.ts.map +1 -0
- package/dist/db/analytics.d.ts +124 -0
- package/dist/db/analytics.d.ts.map +1 -0
- package/dist/db/api-mode.d.ts +127 -0
- package/dist/db/api-mode.d.ts.map +1 -0
- package/dist/db/audit.d.ts +53 -0
- package/dist/db/audit.d.ts.map +1 -0
- package/dist/db/database.d.ts +26 -0
- package/dist/db/database.d.ts.map +1 -0
- package/dist/db/entities.d.ts +62 -0
- package/dist/db/entities.d.ts.map +1 -0
- package/dist/db/entity-memories.d.ts +34 -0
- package/dist/db/entity-memories.d.ts.map +1 -0
- package/dist/db/feedback.d.ts +9 -0
- package/dist/db/feedback.d.ts.map +1 -0
- package/dist/db/locks.d.ts +63 -0
- package/dist/db/locks.d.ts.map +1 -0
- package/dist/db/machines.d.ts +23 -0
- package/dist/db/machines.d.ts.map +1 -0
- package/dist/db/memories.d.ts +199 -0
- package/dist/db/memories.d.ts.map +1 -0
- package/dist/db/memory-links.d.ts +21 -0
- package/dist/db/memory-links.d.ts.map +1 -0
- package/dist/db/memory-project-link.d.ts +13 -0
- package/dist/db/memory-project-link.d.ts.map +1 -0
- package/dist/db/migrations.d.ts +3 -0
- package/dist/db/migrations.d.ts.map +1 -0
- package/dist/db/pg-migrate.d.ts +27 -0
- package/dist/db/pg-migrate.d.ts.map +1 -0
- package/dist/db/pg-migrations.d.ts +2 -0
- package/dist/db/pg-migrations.d.ts.map +1 -0
- package/dist/db/projects.d.ts +27 -0
- package/dist/db/projects.d.ts.map +1 -0
- package/dist/db/ratings.d.ts +23 -0
- package/dist/db/ratings.d.ts.map +1 -0
- package/dist/db/relations.d.ts +49 -0
- package/dist/db/relations.d.ts.map +1 -0
- package/dist/db/session-jobs.d.ts +67 -0
- package/dist/db/session-jobs.d.ts.map +1 -0
- package/dist/db/store-backend.d.ts +42 -0
- package/dist/db/store-backend.d.ts.map +1 -0
- package/dist/db/subscriptions.d.ts +24 -0
- package/dist/db/subscriptions.d.ts.map +1 -0
- package/dist/db/synthesis.d.ts +101 -0
- package/dist/db/synthesis.d.ts.map +1 -0
- package/dist/db/tasks.d.ts +89 -0
- package/dist/db/tasks.d.ts.map +1 -0
- package/dist/db/tool-events.d.ts +27 -0
- package/dist/db/tool-events.d.ts.map +1 -0
- package/dist/db/webhook_hooks.d.ts +48 -0
- package/dist/db/webhook_hooks.d.ts.map +1 -0
- package/dist/diagnostics/historical-project-registration-receipt.d.ts +39 -0
- package/dist/diagnostics/historical-project-registration-receipt.d.ts.map +1 -0
- package/dist/generated/storage-kit/backend.d.ts +20 -0
- package/dist/generated/storage-kit/backend.d.ts.map +1 -0
- package/dist/generated/storage-kit/health.d.ts +20 -0
- package/dist/generated/storage-kit/health.d.ts.map +1 -0
- package/dist/generated/storage-kit/index.d.ts +8 -0
- package/dist/generated/storage-kit/index.d.ts.map +1 -0
- package/dist/generated/storage-kit/migrations.d.ts +48 -0
- package/dist/generated/storage-kit/migrations.d.ts.map +1 -0
- package/dist/generated/storage-kit/own.d.ts +11 -0
- package/dist/generated/storage-kit/own.d.ts.map +1 -0
- package/dist/generated/storage-kit/pool.d.ts +35 -0
- package/dist/generated/storage-kit/pool.d.ts.map +1 -0
- package/dist/generated/storage-kit/query.d.ts +36 -0
- package/dist/generated/storage-kit/query.d.ts.map +1 -0
- package/dist/generated/storage-kit/tls.d.ts +53 -0
- package/dist/generated/storage-kit/tls.d.ts.map +1 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -2
- package/dist/lib/activation-matcher.d.ts +17 -0
- package/dist/lib/activation-matcher.d.ts.map +1 -0
- package/dist/lib/asmr/categorizer.d.ts +31 -0
- package/dist/lib/asmr/categorizer.d.ts.map +1 -0
- package/dist/lib/asmr/context-agent.d.ts +4 -0
- package/dist/lib/asmr/context-agent.d.ts.map +1 -0
- package/dist/lib/asmr/ensemble.d.ts +23 -0
- package/dist/lib/asmr/ensemble.d.ts.map +1 -0
- package/dist/lib/asmr/fact-agent.d.ts +4 -0
- package/dist/lib/asmr/fact-agent.d.ts.map +1 -0
- package/dist/lib/asmr/index.d.ts +7 -0
- package/dist/lib/asmr/index.d.ts.map +1 -0
- package/dist/lib/asmr/orchestrator.d.ts +4 -0
- package/dist/lib/asmr/orchestrator.d.ts.map +1 -0
- package/dist/lib/asmr/recall.d.ts +3 -0
- package/dist/lib/asmr/recall.d.ts.map +1 -0
- package/dist/lib/asmr/temporal-agent.d.ts +4 -0
- package/dist/lib/asmr/temporal-agent.d.ts.map +1 -0
- package/dist/lib/asmr/types.d.ts +27 -0
- package/dist/lib/asmr/types.d.ts.map +1 -0
- package/dist/lib/auto-inject-orchestrator.d.ts +57 -0
- package/dist/lib/auto-inject-orchestrator.d.ts.map +1 -0
- package/dist/lib/auto-memory-queue.d.ts +48 -0
- package/dist/lib/auto-memory-queue.d.ts.map +1 -0
- package/dist/lib/auto-memory.d.ts +19 -0
- package/dist/lib/auto-memory.d.ts.map +1 -0
- package/dist/lib/bench.d.ts +20 -0
- package/dist/lib/bench.d.ts.map +1 -0
- package/dist/lib/built-in-hooks.d.ts +32 -0
- package/dist/lib/built-in-hooks.d.ts.map +1 -0
- package/dist/lib/channel-pusher.d.ts +39 -0
- package/dist/lib/channel-pusher.d.ts.map +1 -0
- package/dist/lib/config.d.ts +9 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/connectors/files.d.ts +8 -0
- package/dist/lib/connectors/files.d.ts.map +1 -0
- package/dist/lib/connectors/github.d.ts +7 -0
- package/dist/lib/connectors/github.d.ts.map +1 -0
- package/dist/lib/connectors/index.d.ts +12 -0
- package/dist/lib/connectors/index.d.ts.map +1 -0
- package/dist/lib/connectors/notion.d.ts +7 -0
- package/dist/lib/connectors/notion.d.ts.map +1 -0
- package/dist/lib/connectors/types.d.ts +27 -0
- package/dist/lib/connectors/types.d.ts.map +1 -0
- package/dist/lib/consolidation.d.ts +52 -0
- package/dist/lib/consolidation.d.ts.map +1 -0
- package/dist/lib/context-extractor.d.ts +14 -0
- package/dist/lib/context-extractor.d.ts.map +1 -0
- package/dist/lib/context.d.ts +36 -0
- package/dist/lib/context.d.ts.map +1 -0
- package/dist/lib/contradiction.d.ts +50 -0
- package/dist/lib/contradiction.d.ts.map +1 -0
- package/dist/lib/decay.d.ts +35 -0
- package/dist/lib/decay.d.ts.map +1 -0
- package/dist/lib/dedup.d.ts +33 -0
- package/dist/lib/dedup.d.ts.map +1 -0
- package/dist/lib/duration.d.ts +28 -0
- package/dist/lib/duration.d.ts.map +1 -0
- package/dist/lib/embeddings.d.ts +20 -0
- package/dist/lib/embeddings.d.ts.map +1 -0
- package/dist/lib/enum-validation.d.ts +20 -0
- package/dist/lib/enum-validation.d.ts.map +1 -0
- package/dist/lib/export-v1.d.ts +30 -0
- package/dist/lib/export-v1.d.ts.map +1 -0
- package/dist/lib/extractor.d.ts +9 -0
- package/dist/lib/extractor.d.ts.map +1 -0
- package/dist/lib/extractors/audio.d.ts +8 -0
- package/dist/lib/extractors/audio.d.ts.map +1 -0
- package/dist/lib/extractors/index.d.ts +12 -0
- package/dist/lib/extractors/index.d.ts.map +1 -0
- package/dist/lib/extractors/ocr.d.ts +7 -0
- package/dist/lib/extractors/ocr.d.ts.map +1 -0
- package/dist/lib/extractors/pdf.d.ts +7 -0
- package/dist/lib/extractors/pdf.d.ts.map +1 -0
- package/dist/lib/extractors/types.d.ts +12 -0
- package/dist/lib/extractors/types.d.ts.map +1 -0
- package/dist/lib/file-deps.d.ts +27 -0
- package/dist/lib/file-deps.d.ts.map +1 -0
- package/dist/lib/focus.d.ts +58 -0
- package/dist/lib/focus.d.ts.map +1 -0
- package/dist/lib/gatherer.d.ts +16 -0
- package/dist/lib/gatherer.d.ts.map +1 -0
- package/dist/lib/gdpr.d.ts +39 -0
- package/dist/lib/gdpr.d.ts.map +1 -0
- package/dist/lib/hooks.d.ts +50 -0
- package/dist/lib/hooks.d.ts.map +1 -0
- package/dist/lib/importers/index.d.ts +38 -0
- package/dist/lib/importers/index.d.ts.map +1 -0
- package/dist/lib/injector.d.ts +89 -0
- package/dist/lib/injector.d.ts.map +1 -0
- package/dist/lib/machine-visibility.d.ts +6 -0
- package/dist/lib/machine-visibility.d.ts.map +1 -0
- package/dist/lib/matryoshka.d.ts +50 -0
- package/dist/lib/matryoshka.d.ts.map +1 -0
- package/dist/lib/memory-lock.d.ts +58 -0
- package/dist/lib/memory-lock.d.ts.map +1 -0
- package/dist/lib/model-config.d.ts +14 -0
- package/dist/lib/model-config.d.ts.map +1 -0
- package/dist/lib/open-sessions-connector.d.ts +60 -0
- package/dist/lib/open-sessions-connector.d.ts.map +1 -0
- package/dist/lib/package-version.d.ts +3 -0
- package/dist/lib/package-version.d.ts.map +1 -0
- package/dist/lib/poisoning.d.ts +19 -0
- package/dist/lib/poisoning.d.ts.map +1 -0
- package/dist/lib/poll.d.ts +17 -0
- package/dist/lib/poll.d.ts.map +1 -0
- package/dist/lib/procedural-extractor.d.ts +21 -0
- package/dist/lib/procedural-extractor.d.ts.map +1 -0
- package/dist/lib/profile-sync.d.ts +20 -0
- package/dist/lib/profile-sync.d.ts.map +1 -0
- package/dist/lib/profile-synthesizer.d.ts +20 -0
- package/dist/lib/profile-synthesizer.d.ts.map +1 -0
- package/dist/lib/project-detect.d.ts +18 -0
- package/dist/lib/project-detect.d.ts.map +1 -0
- package/dist/lib/project-panel.d.ts +7 -0
- package/dist/lib/project-panel.d.ts.map +1 -0
- package/dist/lib/providers/anthropic.d.ts +21 -0
- package/dist/lib/providers/anthropic.d.ts.map +1 -0
- package/dist/lib/providers/base.d.ts +96 -0
- package/dist/lib/providers/base.d.ts.map +1 -0
- package/dist/lib/providers/cerebras.d.ts +20 -0
- package/dist/lib/providers/cerebras.d.ts.map +1 -0
- package/dist/lib/providers/grok.d.ts +19 -0
- package/dist/lib/providers/grok.d.ts.map +1 -0
- package/dist/lib/providers/index.d.ts +7 -0
- package/dist/lib/providers/index.d.ts.map +1 -0
- package/dist/lib/providers/openai-compat.d.ts +18 -0
- package/dist/lib/providers/openai-compat.d.ts.map +1 -0
- package/dist/lib/providers/openai.d.ts +20 -0
- package/dist/lib/providers/openai.d.ts.map +1 -0
- package/dist/lib/providers/registry.d.ts +38 -0
- package/dist/lib/providers/registry.d.ts.map +1 -0
- package/dist/lib/quality.d.ts +16 -0
- package/dist/lib/quality.d.ts.map +1 -0
- package/dist/lib/redact.d.ts +26 -0
- package/dist/lib/redact.d.ts.map +1 -0
- package/dist/lib/reflection.d.ts +83 -0
- package/dist/lib/reflection.d.ts.map +1 -0
- package/dist/lib/retention.d.ts +17 -0
- package/dist/lib/retention.d.ts.map +1 -0
- package/dist/lib/retired-storage-mode.d.ts +11 -0
- package/dist/lib/retired-storage-mode.d.ts.map +1 -0
- package/dist/lib/search.d.ts +52 -0
- package/dist/lib/search.d.ts.map +1 -0
- package/dist/lib/session-auto-resolve.d.ts +28 -0
- package/dist/lib/session-auto-resolve.d.ts.map +1 -0
- package/dist/lib/session-processor.d.ts +38 -0
- package/dist/lib/session-processor.d.ts.map +1 -0
- package/dist/lib/session-queue.d.ts +28 -0
- package/dist/lib/session-queue.d.ts.map +1 -0
- package/dist/lib/session-registry.d.ts +47 -0
- package/dist/lib/session-registry.d.ts.map +1 -0
- package/dist/lib/session-start-briefing.d.ts +10 -0
- package/dist/lib/session-start-briefing.d.ts.map +1 -0
- package/dist/lib/session-watcher.d.ts +30 -0
- package/dist/lib/session-watcher.d.ts.map +1 -0
- package/dist/lib/storage-sync.d.ts +45 -0
- package/dist/lib/storage-sync.d.ts.map +1 -0
- package/dist/lib/sync.d.ts +10 -0
- package/dist/lib/sync.d.ts.map +1 -0
- package/dist/lib/synthesis/corpus-builder.d.ts +30 -0
- package/dist/lib/synthesis/corpus-builder.d.ts.map +1 -0
- package/dist/lib/synthesis/executor.d.ts +14 -0
- package/dist/lib/synthesis/executor.d.ts.map +1 -0
- package/dist/lib/synthesis/index.d.ts +37 -0
- package/dist/lib/synthesis/index.d.ts.map +1 -0
- package/dist/lib/synthesis/llm-analyzer.d.ts +18 -0
- package/dist/lib/synthesis/llm-analyzer.d.ts.map +1 -0
- package/dist/lib/synthesis/metrics.d.ts +13 -0
- package/dist/lib/synthesis/metrics.d.ts.map +1 -0
- package/dist/lib/synthesis/scheduler.d.ts +18 -0
- package/dist/lib/synthesis/scheduler.d.ts.map +1 -0
- package/dist/lib/synthesis/validator.d.ts +19 -0
- package/dist/lib/synthesis/validator.d.ts.map +1 -0
- package/dist/lib/task-runner.d.ts +37 -0
- package/dist/lib/task-runner.d.ts.map +1 -0
- package/dist/lib/tool-lesson-extractor.d.ts +24 -0
- package/dist/lib/tool-lesson-extractor.d.ts.map +1 -0
- package/dist/lib/tool-memory-synthesizer.d.ts +28 -0
- package/dist/lib/tool-memory-synthesizer.d.ts.map +1 -0
- package/dist/lib/topic-clusterer.d.ts +21 -0
- package/dist/lib/topic-clusterer.d.ts.map +1 -0
- package/dist/lib/when-to-use-generator.d.ts +22 -0
- package/dist/lib/when-to-use-generator.d.ts.map +1 -0
- package/dist/mcp/http.d.ts +17 -0
- package/dist/mcp/http.d.ts.map +1 -0
- package/dist/mcp/index.d.ts +6 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +167 -10
- package/dist/mcp/memory-broadcast.d.ts +12 -0
- package/dist/mcp/memory-broadcast.d.ts.map +1 -0
- package/dist/mcp/tools/agent-tools.d.ts +3 -0
- package/dist/mcp/tools/agent-tools.d.ts.map +1 -0
- package/dist/mcp/tools/auto-memory-tools.d.ts +5 -0
- package/dist/mcp/tools/auto-memory-tools.d.ts.map +1 -0
- package/dist/mcp/tools/bulk-tools.d.ts +3 -0
- package/dist/mcp/tools/bulk-tools.d.ts.map +1 -0
- package/dist/mcp/tools/consolidation-tools.d.ts +3 -0
- package/dist/mcp/tools/consolidation-tools.d.ts.map +1 -0
- package/dist/mcp/tools/focus-tools.d.ts +3 -0
- package/dist/mcp/tools/focus-tools.d.ts.map +1 -0
- package/dist/mcp/tools/graph-entity-tools.d.ts +3 -0
- package/dist/mcp/tools/graph-entity-tools.d.ts.map +1 -0
- package/dist/mcp/tools/graph-query-tools.d.ts +3 -0
- package/dist/mcp/tools/graph-query-tools.d.ts.map +1 -0
- package/dist/mcp/tools/graph-relation-tools.d.ts +3 -0
- package/dist/mcp/tools/graph-relation-tools.d.ts.map +1 -0
- package/dist/mcp/tools/graph-tools.d.ts +3 -0
- package/dist/mcp/tools/graph-tools.d.ts.map +1 -0
- package/dist/mcp/tools/graph-utils.d.ts +5 -0
- package/dist/mcp/tools/graph-utils.d.ts.map +1 -0
- package/dist/mcp/tools/hook-tools.d.ts +3 -0
- package/dist/mcp/tools/hook-tools.d.ts.map +1 -0
- package/dist/mcp/tools/lock-tools.d.ts +3 -0
- package/dist/mcp/tools/lock-tools.d.ts.map +1 -0
- package/dist/mcp/tools/memory-audit.d.ts +3 -0
- package/dist/mcp/tools/memory-audit.d.ts.map +1 -0
- package/dist/mcp/tools/memory-crud.d.ts +3 -0
- package/dist/mcp/tools/memory-crud.d.ts.map +1 -0
- package/dist/mcp/tools/memory-health.d.ts +3 -0
- package/dist/mcp/tools/memory-health.d.ts.map +1 -0
- package/dist/mcp/tools/memory-history.d.ts +3 -0
- package/dist/mcp/tools/memory-history.d.ts.map +1 -0
- package/dist/mcp/tools/memory-inject.d.ts +3 -0
- package/dist/mcp/tools/memory-inject.d.ts.map +1 -0
- package/dist/mcp/tools/memory-io.d.ts +3 -0
- package/dist/mcp/tools/memory-io.d.ts.map +1 -0
- package/dist/mcp/tools/memory-lifecycle.d.ts +3 -0
- package/dist/mcp/tools/memory-lifecycle.d.ts.map +1 -0
- package/dist/mcp/tools/memory-search.d.ts +3 -0
- package/dist/mcp/tools/memory-search.d.ts.map +1 -0
- package/dist/mcp/tools/memory-stats.d.ts +3 -0
- package/dist/mcp/tools/memory-stats.d.ts.map +1 -0
- package/dist/mcp/tools/memory-tools.d.ts +17 -0
- package/dist/mcp/tools/memory-tools.d.ts.map +1 -0
- package/dist/mcp/tools/memory-utils.d.ts +27 -0
- package/dist/mcp/tools/memory-utils.d.ts.map +1 -0
- package/dist/mcp/tools/memory-validation.d.ts +3 -0
- package/dist/mcp/tools/memory-validation.d.ts.map +1 -0
- package/dist/mcp/tools/project-tools.d.ts +3 -0
- package/dist/mcp/tools/project-tools.d.ts.map +1 -0
- package/dist/mcp/tools/session-tools.d.ts +3 -0
- package/dist/mcp/tools/session-tools.d.ts.map +1 -0
- package/dist/mcp/tools/storage-tools.d.ts +3 -0
- package/dist/mcp/tools/storage-tools.d.ts.map +1 -0
- package/dist/mcp/tools/synthesis-tools.d.ts +3 -0
- package/dist/mcp/tools/synthesis-tools.d.ts.map +1 -0
- package/dist/mcp/tools/system-tools-events.d.ts +3 -0
- package/dist/mcp/tools/system-tools-events.d.ts.map +1 -0
- package/dist/mcp/tools/system-tools-memory-admin.d.ts +3 -0
- package/dist/mcp/tools/system-tools-memory-admin.d.ts.map +1 -0
- package/dist/mcp/tools/system-tools-shared.d.ts +23 -0
- package/dist/mcp/tools/system-tools-shared.d.ts.map +1 -0
- package/dist/mcp/tools/system-tools.d.ts +3 -0
- package/dist/mcp/tools/system-tools.d.ts.map +1 -0
- package/dist/mcp/tools/tool-registry.d.ts +30 -0
- package/dist/mcp/tools/tool-registry.d.ts.map +1 -0
- package/dist/mcp/tools/utility-tools.d.ts +3 -0
- package/dist/mcp/tools/utility-tools.d.ts.map +1 -0
- package/dist/memory-project-link/index.d.ts +2 -0
- package/dist/memory-project-link/index.d.ts.map +1 -0
- package/dist/memory-project-link/schema.d.ts +5 -0
- package/dist/memory-project-link/schema.d.ts.map +1 -0
- package/dist/pg-sync-worker.d.ts +2 -0
- package/dist/pg-sync-worker.d.ts.map +1 -0
- package/dist/project-registration/authority.d.ts +43 -0
- package/dist/project-registration/authority.d.ts.map +1 -0
- package/dist/project-registration/historical-receipt.d.ts +38 -0
- package/dist/project-registration/historical-receipt.d.ts.map +1 -0
- package/dist/project-registration/http.d.ts +32 -0
- package/dist/project-registration/http.d.ts.map +1 -0
- package/dist/project-registration/identity.d.ts +20 -0
- package/dist/project-registration/identity.d.ts.map +1 -0
- package/dist/project-registration/index.d.ts +11 -0
- package/dist/project-registration/index.d.ts.map +1 -0
- package/dist/project-registration/project-references.d.ts +71 -0
- package/dist/project-registration/project-references.d.ts.map +1 -0
- package/dist/project-registration/project-resources.d.ts +22 -0
- package/dist/project-registration/project-resources.d.ts.map +1 -0
- package/dist/project-registration/schema.d.ts +5 -0
- package/dist/project-registration/schema.d.ts.map +1 -0
- package/dist/project-registration/types.d.ts +319 -0
- package/dist/project-registration/types.d.ts.map +1 -0
- package/dist/project-registration.d.ts +2 -0
- package/dist/project-registration.d.ts.map +1 -0
- package/dist/sdk/index.d.ts +987 -0
- package/dist/sdk/index.d.ts.map +1 -0
- package/dist/server/auth.d.ts +11 -0
- package/dist/server/auth.d.ts.map +1 -0
- package/dist/server/helpers.d.ts +22 -0
- package/dist/server/helpers.d.ts.map +1 -0
- package/dist/server/index.d.ts +14 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +179 -19
- package/dist/server/openapi.d.ts +2 -0
- package/dist/server/openapi.d.ts.map +1 -0
- package/dist/server/router.d.ts +17 -0
- package/dist/server/router.d.ts.map +1 -0
- package/dist/server/routes/agents.d.ts +2 -0
- package/dist/server/routes/agents.d.ts.map +1 -0
- package/dist/server/routes/entities.d.ts +2 -0
- package/dist/server/routes/entities.d.ts.map +1 -0
- package/dist/server/routes/memories-bulk.d.ts +2 -0
- package/dist/server/routes/memories-bulk.d.ts.map +1 -0
- package/dist/server/routes/memories-crud.d.ts +2 -0
- package/dist/server/routes/memories-crud.d.ts.map +1 -0
- package/dist/server/routes/memories-io.d.ts +2 -0
- package/dist/server/routes/memories-io.d.ts.map +1 -0
- package/dist/server/routes/memories-misc.d.ts +2 -0
- package/dist/server/routes/memories-misc.d.ts.map +1 -0
- package/dist/server/routes/memories-search.d.ts +2 -0
- package/dist/server/routes/memories-search.d.ts.map +1 -0
- package/dist/server/routes/memories-stats.d.ts +2 -0
- package/dist/server/routes/memories-stats.d.ts.map +1 -0
- package/dist/server/routes/memories.d.ts +19 -0
- package/dist/server/routes/memories.d.ts.map +1 -0
- package/dist/server/routes/memory-project-link.d.ts +2 -0
- package/dist/server/routes/memory-project-link.d.ts.map +1 -0
- package/dist/server/routes/project-registration.d.ts +2 -0
- package/dist/server/routes/project-registration.d.ts.map +1 -0
- package/dist/server/routes/projects.d.ts +2 -0
- package/dist/server/routes/projects.d.ts.map +1 -0
- package/dist/server/routes/system-auto-memory.d.ts +2 -0
- package/dist/server/routes/system-auto-memory.d.ts.map +1 -0
- package/dist/server/routes/system-chain.d.ts +2 -0
- package/dist/server/routes/system-chain.d.ts.map +1 -0
- package/dist/server/routes/system-consolidation.d.ts +2 -0
- package/dist/server/routes/system-consolidation.d.ts.map +1 -0
- package/dist/server/routes/system-hooks.d.ts +2 -0
- package/dist/server/routes/system-hooks.d.ts.map +1 -0
- package/dist/server/routes/system-sessions.d.ts +2 -0
- package/dist/server/routes/system-sessions.d.ts.map +1 -0
- package/dist/server/routes/system-subscriptions.d.ts +2 -0
- package/dist/server/routes/system-subscriptions.d.ts.map +1 -0
- package/dist/server/routes/system-synthesis.d.ts +2 -0
- package/dist/server/routes/system-synthesis.d.ts.map +1 -0
- package/dist/server/routes/system-tools.d.ts +2 -0
- package/dist/server/routes/system-tools.d.ts.map +1 -0
- package/dist/server/routes/system.d.ts +2 -0
- package/dist/server/routes/system.d.ts.map +1 -0
- package/dist/server/routes/tasks.d.ts +2 -0
- package/dist/server/routes/tasks.d.ts.map +1 -0
- package/dist/storage.d.ts +280 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/test-support/memories-page-stub-server.d.ts +2 -0
- package/dist/test-support/memories-page-stub-server.d.ts.map +1 -0
- package/dist/test-support/memories-page-stub.d.ts +28 -0
- package/dist/test-support/memories-page-stub.d.ts.map +1 -0
- package/dist/test-support/pg-sync-stub-worker.d.ts +2 -0
- package/dist/test-support/pg-sync-stub-worker.d.ts.map +1 -0
- package/dist/test-support/preload-local-store.d.ts +2 -0
- package/dist/test-support/preload-local-store.d.ts.map +1 -0
- package/dist/test-support/project-authority-identity.d.ts +8 -0
- package/dist/test-support/project-authority-identity.d.ts.map +1 -0
- package/dist/test-support/store-isolation.d.ts +108 -0
- package/dist/test-support/store-isolation.d.ts.map +1 -0
- package/dist/test-support/strip-ansi.d.ts +3 -0
- package/dist/test-support/strip-ansi.d.ts.map +1 -0
- package/dist/types/hooks.d.ts +136 -0
- package/dist/types/hooks.d.ts.map +1 -0
- package/dist/types/index.d.ts +482 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { SqliteAdapter as Database } from "../storage.js";
|
|
2
|
+
import type { CreateMemoryInput, DedupeMode, Memory, MemoryFilter, MemoryVersion, UpdateMemoryInput } from "../types/index.js";
|
|
3
|
+
export declare function parseMemoryRow(row: Record<string, unknown>): Memory;
|
|
4
|
+
/**
|
|
5
|
+
* Return a rejection message when `agentId` is a reserved placeholder, or
|
|
6
|
+
* null when it is acceptable. Matching is case- and whitespace-insensitive,
|
|
7
|
+
* mirroring how registerAgent normalizes names (trim().toLowerCase()).
|
|
8
|
+
*/
|
|
9
|
+
export declare function reservedAgentIdViolation(agentId: string | null | undefined): string | null;
|
|
10
|
+
export declare function createMemory(input: CreateMemoryInput, dedupeMode?: DedupeMode, db?: Database): Memory;
|
|
11
|
+
export interface BulkUpsertResult {
|
|
12
|
+
inserted: number;
|
|
13
|
+
/** Rows the store already had (id or unique-key conflict) — a benign no-op. */
|
|
14
|
+
skipped: number;
|
|
15
|
+
/**
|
|
16
|
+
* Rows the store REFUSED (bad enum, failed CHECK/FK, missing key). These did
|
|
17
|
+
* NOT persist. Kept separate from `skipped` so a caller can never read a
|
|
18
|
+
* dropped row as an idempotent no-op; every rejection also has a line in
|
|
19
|
+
* `errors`. `inserted + skipped + rejected === total`.
|
|
20
|
+
*/
|
|
21
|
+
rejected: number;
|
|
22
|
+
errors: string[];
|
|
23
|
+
total: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Faithful, idempotent bulk restore of memories into the current store.
|
|
27
|
+
*
|
|
28
|
+
* Unlike {@link createMemory}, this primitive:
|
|
29
|
+
* - PRESERVES the original `id` (does not regenerate a UUID);
|
|
30
|
+
* - PRESERVES `status` (archived stays archived — never resurrected to active);
|
|
31
|
+
* - PRESERVES timestamps, `version`, `pinned`, `access_count` and scope fields;
|
|
32
|
+
* - does NOT dedupe by key/scope/agent and does NOT fire hooks / entity
|
|
33
|
+
* extraction / embedding work (those run asynchronously elsewhere).
|
|
34
|
+
*
|
|
35
|
+
* Idempotency is by conflict, not by suppression: the statement carries an
|
|
36
|
+
* explicit bare `ON CONFLICT DO NOTHING`, which SQLite and Postgres both read
|
|
37
|
+
* as "ignore a uniqueness conflict (primary-key `id` or the unique key index)".
|
|
38
|
+
* A row already present is therefore left untouched and re-runs never create
|
|
39
|
+
* duplicates. This is the cross-machine → cloud backfill path for the fleet
|
|
40
|
+
* self-host cutover: a machine's local memories are shipped to the cloud store
|
|
41
|
+
* verbatim without mutating rows that are already present.
|
|
42
|
+
*
|
|
43
|
+
* It deliberately does NOT use `INSERT OR IGNORE`: on SQLite that swallows
|
|
44
|
+
* *every* constraint failure, so a row refused by the `category`/`scope`/
|
|
45
|
+
* `source`/`status` CHECK vanished with `changes === 0` and was counted as an
|
|
46
|
+
* idempotent `skipped` — a cloud write that did not persist reporting success.
|
|
47
|
+
* With a bare `ON CONFLICT DO NOTHING` a CHECK/FK/NOT NULL violation still
|
|
48
|
+
* throws into the catch below and lands in `rejected` + `errors`. Enum values
|
|
49
|
+
* are additionally pre-validated per row so the reason names the field and the
|
|
50
|
+
* accepted set instead of quoting raw constraint SQL.
|
|
51
|
+
*
|
|
52
|
+
* FK-referenced agent/project/session/machine rows are stubbed via
|
|
53
|
+
* {@link ensureMemoryReferences} so cross-machine authorship ids never fail the
|
|
54
|
+
* write. Values and summaries are still passed through {@link redactSecrets}.
|
|
55
|
+
*/
|
|
56
|
+
export declare function bulkUpsertMemories(memories: Array<Record<string, unknown>>, db?: Database): BulkUpsertResult;
|
|
57
|
+
export declare function getMemory(id: string, db?: Database): Memory | null;
|
|
58
|
+
export declare function getMemoryByKey(key: string, scope?: string, agentId?: string, projectId?: string, sessionId?: string, db?: Database, as_of?: string): Memory | null;
|
|
59
|
+
/**
|
|
60
|
+
* Return ALL active memories matching a key (across scopes/agents/projects).
|
|
61
|
+
* Optional filters narrow the result set.
|
|
62
|
+
*/
|
|
63
|
+
export declare function getMemoriesByKey(key: string, scope?: string, agentId?: string, projectId?: string, db?: Database): Memory[];
|
|
64
|
+
export interface MemoryListPage {
|
|
65
|
+
rows: Memory[];
|
|
66
|
+
/**
|
|
67
|
+
* true = more rows exist beyond this page; false = the end was reached;
|
|
68
|
+
* undefined = the server did not say (an older server without the
|
|
69
|
+
* pagination contract — callers fall back to a short-page heuristic).
|
|
70
|
+
*/
|
|
71
|
+
has_more: boolean | undefined;
|
|
72
|
+
next_cursor: number | null;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* One bounded page of the memories list surface.
|
|
76
|
+
*
|
|
77
|
+
* The server caps every single response at 1000 rows and answers with
|
|
78
|
+
* `has_more` / `next_cursor`, so a caller that wants more than one page (or
|
|
79
|
+
* the full population) walks pages. A bare `listMemories()` keeps returning
|
|
80
|
+
* exactly one page for its existing callers.
|
|
81
|
+
*/
|
|
82
|
+
export declare function listMemoriesPage(filter?: MemoryFilter, db?: Database): MemoryListPage;
|
|
83
|
+
export declare function listMemories(filter?: MemoryFilter, db?: Database): Memory[];
|
|
84
|
+
export interface MemoryListBounded {
|
|
85
|
+
rows: Memory[];
|
|
86
|
+
has_more: boolean;
|
|
87
|
+
next_cursor: number | null;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Collect the memories list surface across bounded pages (BUG 2796806b).
|
|
91
|
+
*
|
|
92
|
+
* The server caps every single response at 1000 rows, so a caller that wants
|
|
93
|
+
* more than one page — or the full population — must walk. Mirrors the CLI
|
|
94
|
+
* page-walk guards: cursor-cycle detection and a bounded page count. `target`
|
|
95
|
+
* is the maximum number of rows to return; undefined returns the full
|
|
96
|
+
* population. Termination: the server's `has_more: false`, or a page shorter
|
|
97
|
+
* than requested when the server carries no signal, or `target` rows collected.
|
|
98
|
+
*/
|
|
99
|
+
export declare function listMemoriesBounded(filter: MemoryFilter | undefined, target: number | undefined, db?: Database): MemoryListBounded;
|
|
100
|
+
/**
|
|
101
|
+
* Total rows matching the list filter (limit/offset ignored). Local-store
|
|
102
|
+
* count; the server route computes it so API consumers never need it.
|
|
103
|
+
*/
|
|
104
|
+
export declare function countMemories(filter?: MemoryFilter, db?: Database): number;
|
|
105
|
+
export interface MemoryBriefingResult {
|
|
106
|
+
new: Memory[];
|
|
107
|
+
updated: Memory[];
|
|
108
|
+
expired: Memory[];
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Delta briefing: memories created / updated / expired since a timestamp,
|
|
112
|
+
* scoped by machine visibility. Transport-aware: in API mode the whole
|
|
113
|
+
* computation runs on the self-hosted server (the client has no DB).
|
|
114
|
+
*
|
|
115
|
+
* `visible_machine_id`: a resolved value (the caller resolves its own current
|
|
116
|
+
* machine). `null`/`undefined` restricts to machine-agnostic memories; a string
|
|
117
|
+
* also includes memories local to that machine.
|
|
118
|
+
*/
|
|
119
|
+
export declare function getMemoryBriefing(opts: {
|
|
120
|
+
since: string;
|
|
121
|
+
scope?: string;
|
|
122
|
+
project_id?: string;
|
|
123
|
+
visible_machine_id?: string | null;
|
|
124
|
+
limit?: number;
|
|
125
|
+
}, db?: Database): MemoryBriefingResult;
|
|
126
|
+
/**
|
|
127
|
+
* Low-trust memories (trust_score below a threshold) for poisoning review.
|
|
128
|
+
* Transport-aware: API mode reads from the self-hosted server.
|
|
129
|
+
*/
|
|
130
|
+
export declare function listLowTrustMemories(opts?: {
|
|
131
|
+
threshold?: number;
|
|
132
|
+
project_id?: string;
|
|
133
|
+
limit?: number;
|
|
134
|
+
offset?: number;
|
|
135
|
+
}, db?: Database): Memory[];
|
|
136
|
+
/**
|
|
137
|
+
* List memories ordered by most-recently-accessed (the `history` surface).
|
|
138
|
+
* Only returns memories that have been accessed at least once.
|
|
139
|
+
*/
|
|
140
|
+
export interface MemoryHistoryPage {
|
|
141
|
+
rows: Memory[];
|
|
142
|
+
has_more: boolean | undefined;
|
|
143
|
+
next_cursor: number | null;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* One bounded page of the history surface (most-recently-accessed memories).
|
|
147
|
+
* Same pagination contract as the list surface.
|
|
148
|
+
*/
|
|
149
|
+
export declare function listMemoryHistoryPage(opts?: {
|
|
150
|
+
limit?: number;
|
|
151
|
+
offset?: number;
|
|
152
|
+
}, db?: Database): MemoryHistoryPage;
|
|
153
|
+
/**
|
|
154
|
+
* List memories ordered by most-recently-accessed (the `history` surface).
|
|
155
|
+
* Only returns memories that have been accessed at least once.
|
|
156
|
+
*/
|
|
157
|
+
export declare function listMemoryHistory(opts?: {
|
|
158
|
+
limit?: number;
|
|
159
|
+
offset?: number;
|
|
160
|
+
}, db?: Database): Memory[];
|
|
161
|
+
/** Total accessed memories (the history surface population). */
|
|
162
|
+
export declare function countMemoryHistory(db?: Database): number;
|
|
163
|
+
export declare function getMemoryChain(sequenceGroup: string, projectId?: string, db?: Database): Memory[];
|
|
164
|
+
/**
|
|
165
|
+
* Load stored embeddings for a set of memory ids, for in-process re-ranking.
|
|
166
|
+
* API mode has no local embeddings table (the cloud store owns embeddings and
|
|
167
|
+
* ranks server-side), so it returns an empty map and callers gracefully fall
|
|
168
|
+
* back to importance/recency ordering.
|
|
169
|
+
*/
|
|
170
|
+
export declare function getMemoryEmbeddings(ids: string[], db?: Database): Map<string, number[]>;
|
|
171
|
+
export declare function updateMemory(id: string, input: UpdateMemoryInput, db?: Database): Memory;
|
|
172
|
+
export declare function deleteMemory(id: string, db?: Database): boolean;
|
|
173
|
+
export declare function bulkDeleteMemories(ids: string[], db?: Database): number;
|
|
174
|
+
export declare function touchMemory(id: string, db?: Database): void;
|
|
175
|
+
export declare function incrementRecallCount(id: string, db?: Database): void;
|
|
176
|
+
export declare function cleanExpiredMemories(db?: Database): number;
|
|
177
|
+
export declare function getMemoryVersions(memoryId: string, db?: Database): MemoryVersion[];
|
|
178
|
+
export interface SemanticSearchResult {
|
|
179
|
+
memory: Memory;
|
|
180
|
+
score: number;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Store or update the embedding for a memory. Called asynchronously after saves.
|
|
184
|
+
* Non-blocking: failures are silently ignored.
|
|
185
|
+
*/
|
|
186
|
+
export declare function indexMemoryEmbedding(memoryId: string, text: string, db?: Database): Promise<void>;
|
|
187
|
+
/**
|
|
188
|
+
* Semantic search across memories using cosine similarity.
|
|
189
|
+
* Falls back gracefully if no embeddings exist yet.
|
|
190
|
+
*/
|
|
191
|
+
export declare function semanticSearch(queryText: string, options?: {
|
|
192
|
+
threshold?: number;
|
|
193
|
+
limit?: number;
|
|
194
|
+
scope?: string;
|
|
195
|
+
agent_id?: string;
|
|
196
|
+
project_id?: string;
|
|
197
|
+
index_missing?: boolean;
|
|
198
|
+
}, db?: Database): Promise<SemanticSearchResult[]>;
|
|
199
|
+
//# sourceMappingURL=memories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memories.d.ts","sourceRoot":"","sources":["../../src/db/memories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,KAAK,EACV,iBAAiB,EACjB,UAAU,EACV,MAAM,EACN,YAAY,EACZ,aAAa,EACb,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAuD3B,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAqCnE;AA6BD;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAW1F;AAMD,wBAAgB,YAAY,CAC1B,KAAK,EAAE,iBAAiB,EACxB,UAAU,GAAE,UAAoB,EAChC,EAAE,CAAC,EAAE,QAAQ,GACZ,MAAM,CAqOR;AAMD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,+EAA+E;IAC/E,OAAO,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AAE,EAAE,CAAC,EAAE,QAAQ,GAAG,IAAI,CAQ3D;AAUD,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,IAAI,CAuBpE;AAMD,wBAAgB,oBAAoB,CAAC,EAAE,CAAC,EAAE,QAAQ,GAAG,MAAM,CAqB1D;AAMD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,aAAa,EAAE,CA4BlF;AAMD,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAcvG;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAClC,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE;IACP,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;CACpB,EACN,EAAE,CAAC,EAAE,QAAQ,GACZ,OAAO,CAAC,oBAAoB,EAAE,CAAC,CA4DjC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SqliteAdapter as Database } from "../storage.js";
|
|
2
|
+
export type MemoryLinkRelation = "summarizes" | "merged_from" | "promotes" | "reflects_on" | "supersedes" | "related_to";
|
|
3
|
+
export interface MemoryLink {
|
|
4
|
+
id: string;
|
|
5
|
+
source_memory_id: string;
|
|
6
|
+
target_memory_id: string;
|
|
7
|
+
relation_type: MemoryLinkRelation;
|
|
8
|
+
run_id: string | null;
|
|
9
|
+
metadata: Record<string, unknown>;
|
|
10
|
+
created_at: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function createMemoryLink(input: {
|
|
13
|
+
source_memory_id: string;
|
|
14
|
+
target_memory_id: string;
|
|
15
|
+
relation_type: MemoryLinkRelation;
|
|
16
|
+
run_id?: string | null;
|
|
17
|
+
metadata?: Record<string, unknown>;
|
|
18
|
+
}, db?: Database): MemoryLink;
|
|
19
|
+
export declare function getMemoryLinks(memoryId: string, relationType?: MemoryLinkRelation, db?: Database): MemoryLink[];
|
|
20
|
+
export declare function getMemoryBacklinks(memoryId: string, relationType?: MemoryLinkRelation, db?: Database): MemoryLink[];
|
|
21
|
+
//# sourceMappingURL=memory-links.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-links.d.ts","sourceRoot":"","sources":["../../src/db/memory-links.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAK1D,MAAM,MAAM,kBAAkB,GAC1B,YAAY,GACZ,aAAa,GACb,UAAU,GACV,aAAa,GACb,YAAY,GACZ,YAAY,CAAC;AAEjB,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,kBAAkB,CAAC;IAClC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,UAAU,EAAE,MAAM,CAAC;CACpB;AAcD,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE;IACL,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,kBAAkB,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,EACD,EAAE,CAAC,EAAE,QAAQ,GACZ,UAAU,CAoCZ;AAED,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,MAAM,EAChB,YAAY,CAAC,EAAE,kBAAkB,EACjC,EAAE,CAAC,EAAE,QAAQ,GACZ,UAAU,EAAE,CAad;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,YAAY,CAAC,EAAE,kBAAkB,EACjC,EAAE,CAAC,EAAE,QAAQ,GACZ,UAAU,EAAE,CAad"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SqliteAdapter as Database } from "../storage.js";
|
|
2
|
+
import type { MemoryProjectLinkReceipt, MemoryProjectLinkRequest, MemoryProjectLinkResult, MemoryProjectLinkRollbackRequest, ProjectAuthorityIdentity } from "../types/index.js";
|
|
3
|
+
export type MemoryProjectLinkErrorCode = "MEMORY_PROJECT_LINK_INVALID_INPUT" | "MEMORY_PROJECT_LINK_AUTHORITY_MISMATCH" | "MEMORY_PROJECT_LINK_MEMORY_NOT_FOUND" | "MEMORY_PROJECT_LINK_PROJECT_NOT_FOUND" | "MEMORY_PROJECT_LINK_STALE_MEMORY" | "MEMORY_PROJECT_LINK_STALE_PROJECT" | "MEMORY_PROJECT_LINK_COLLISION" | "MEMORY_PROJECT_LINK_IDEMPOTENCY_MISMATCH" | "MEMORY_PROJECT_LINK_RECEIPT_NOT_FOUND" | "MEMORY_PROJECT_LINK_RECEIPT_NOT_ROLLBACKABLE" | "MEMORY_PROJECT_LINK_ACCEPTED_TARGET_DRIFTED";
|
|
4
|
+
export declare class MemoryProjectLinkError extends Error {
|
|
5
|
+
readonly code: MemoryProjectLinkErrorCode;
|
|
6
|
+
readonly details: Record<string, unknown>;
|
|
7
|
+
constructor(code: MemoryProjectLinkErrorCode, message: string, details?: Record<string, unknown>);
|
|
8
|
+
}
|
|
9
|
+
export declare function previewMemoryProjectLink(memoryId: string, request: MemoryProjectLinkRequest, db?: Database): MemoryProjectLinkResult;
|
|
10
|
+
export declare function applyMemoryProjectLink(memoryId: string, request: MemoryProjectLinkRequest, db?: Database): MemoryProjectLinkResult;
|
|
11
|
+
export declare function rollbackMemoryProjectLink(memoryId: string, request: MemoryProjectLinkRollbackRequest, db?: Database): MemoryProjectLinkResult;
|
|
12
|
+
export declare function getMemoryProjectLinkReceipt(memoryId: string, receiptId: string, identity?: ProjectAuthorityIdentity, db?: Database): MemoryProjectLinkReceipt;
|
|
13
|
+
//# sourceMappingURL=memory-project-link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-project-link.d.ts","sourceRoot":"","sources":["../../src/db/memory-project-link.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,aAAa,IAAI,QAAQ,EAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAEV,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,EACvB,gCAAgC,EAGhC,wBAAwB,EACzB,MAAM,mBAAmB,CAAC;AAW3B,MAAM,MAAM,0BAA0B,GAClC,mCAAmC,GACnC,wCAAwC,GACxC,sCAAsC,GACtC,uCAAuC,GACvC,kCAAkC,GAClC,mCAAmC,GACnC,+BAA+B,GAC/B,0CAA0C,GAC1C,uCAAuC,GACvC,8CAA8C,GAC9C,6CAA6C,CAAC;AAElD,qBAAa,sBAAuB,SAAQ,KAAK;aAE7B,IAAI,EAAE,0BAA0B;aAEhC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;gBAFhC,IAAI,EAAE,0BAA0B,EAChD,OAAO,EAAE,MAAM,EACC,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM;CAKxD;AA6iBD,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,wBAAwB,EACjC,EAAE,CAAC,EAAE,QAAQ,GACZ,uBAAuB,CAsCzB;AAED,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,wBAAwB,EACjC,EAAE,CAAC,EAAE,QAAQ,GACZ,uBAAuB,CA4HzB;AAED,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,gCAAgC,EACzC,EAAE,CAAC,EAAE,QAAQ,GACZ,uBAAuB,CA8HzB;AAED,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,wBAA0C,EACpD,EAAE,CAAC,EAAE,QAAQ,GACZ,wBAAwB,CAqB1B"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const MEMORY_VERSION_SNAPSHOT_TRIGGER = "\nCREATE TRIGGER IF NOT EXISTS memories_version_snapshot\nBEFORE UPDATE ON memories\nWHEN NEW.version > OLD.version\nBEGIN\n INSERT OR IGNORE INTO memory_versions (\n id, memory_id, version, value, importance, scope, category, tags,\n summary, pinned, status, when_to_use, created_at\n ) VALUES (\n lower(hex(randomblob(4))) || '-' || lower(hex(randomblob(2))) || '-' ||\n lower(hex(randomblob(2))) || '-' || lower(hex(randomblob(2))) || '-' ||\n lower(hex(randomblob(6))),\n OLD.id, OLD.version, OLD.value, OLD.importance, OLD.scope, OLD.category,\n OLD.tags, OLD.summary, OLD.pinned, OLD.status, OLD.when_to_use,\n OLD.updated_at\n );\nEND;\n";
|
|
2
|
+
export declare const MIGRATIONS: string[];
|
|
3
|
+
//# sourceMappingURL=migrations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../src/db/migrations.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,+BAA+B,wqBAiB3C,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,MAAM,EA0iC9B,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface PgMigrationResult {
|
|
2
|
+
applied: number[];
|
|
3
|
+
alreadyApplied: number[];
|
|
4
|
+
errors: string[];
|
|
5
|
+
totalMigrations: number;
|
|
6
|
+
}
|
|
7
|
+
export interface PgMigrationDiagnostics {
|
|
8
|
+
ok: boolean;
|
|
9
|
+
target: "postgres-rds-compatible";
|
|
10
|
+
configured: boolean;
|
|
11
|
+
redacted_connection_string: string | null;
|
|
12
|
+
total_migrations: number;
|
|
13
|
+
mutates_remote_on_apply: true;
|
|
14
|
+
requires_approval_for_live_run: true;
|
|
15
|
+
no_network: true;
|
|
16
|
+
issues: string[];
|
|
17
|
+
warnings: string[];
|
|
18
|
+
}
|
|
19
|
+
export declare function getPgMigrationDiagnostics(connectionString?: string): PgMigrationDiagnostics;
|
|
20
|
+
/**
|
|
21
|
+
* Apply all pending PostgreSQL migrations to the given database.
|
|
22
|
+
*
|
|
23
|
+
* @param connectionString - PostgreSQL connection string
|
|
24
|
+
* @returns Summary of which migrations were applied / skipped / errored.
|
|
25
|
+
*/
|
|
26
|
+
export declare function applyPgMigrations(connectionString: string): Promise<PgMigrationResult>;
|
|
27
|
+
//# sourceMappingURL=pg-migrate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pg-migrate.d.ts","sourceRoot":"","sources":["../../src/db/pg-migrate.ts"],"names":[],"mappings":"AAcA,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,yBAAyB,CAAC;IAClC,UAAU,EAAE,OAAO,CAAC;IACpB,0BAA0B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,gBAAgB,EAAE,MAAM,CAAC;IACzB,uBAAuB,EAAE,IAAI,CAAC;IAC9B,8BAA8B,EAAE,IAAI,CAAC;IACrC,UAAU,EAAE,IAAI,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,wBAAgB,yBAAyB,CACvC,gBAAgB,CAAC,EAAE,MAAM,GACxB,sBAAsB,CAkCxB;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,iBAAiB,CAAC,CA8D5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pg-migrations.d.ts","sourceRoot":"","sources":["../../src/db/pg-migrations.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,aAAa,EAAE,MAAM,EA+1BjC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SqliteAdapter as Database } from "../storage.js";
|
|
2
|
+
import type { Project, ProjectAuthorityIdentity, ProjectGuardedRollbackRequest, ProjectGuardedUpdateRequest, ProjectGuardedUpdateResult, ProjectUpdateReceipt, UpdateProjectInput } from "../types/index.js";
|
|
3
|
+
export declare class ProjectCollisionError extends Error {
|
|
4
|
+
readonly field: "name" | "path";
|
|
5
|
+
readonly value: string;
|
|
6
|
+
constructor(field: "name" | "path", value: string);
|
|
7
|
+
}
|
|
8
|
+
export type ProjectGuardedUpdateErrorCode = "PROJECT_UPDATE_INVALID_INPUT" | "PROJECT_UPDATE_AUTHORITY_MISMATCH" | "PROJECT_UPDATE_NOT_FOUND" | "PROJECT_UPDATE_STALE_REVISION" | "PROJECT_UPDATE_COLLISION" | "PROJECT_UPDATE_IDEMPOTENCY_MISMATCH" | "PROJECT_UPDATE_RECEIPT_NOT_FOUND" | "PROJECT_UPDATE_ACCEPTED_TARGET_DRIFTED";
|
|
9
|
+
export declare class ProjectGuardedUpdateError extends Error {
|
|
10
|
+
readonly code: ProjectGuardedUpdateErrorCode;
|
|
11
|
+
readonly details: Record<string, unknown>;
|
|
12
|
+
constructor(code: ProjectGuardedUpdateErrorCode, message: string, details?: Record<string, unknown>);
|
|
13
|
+
}
|
|
14
|
+
export declare function registerProject(name: string, path: string, description?: string, memoryPrefix?: string, db?: Database): Project;
|
|
15
|
+
export declare function getProject(idOrPath: string, db?: Database): Project | null;
|
|
16
|
+
export declare function listProjects(db?: Database): Project[];
|
|
17
|
+
export declare function previewProjectUpdate(id: string, request: ProjectGuardedUpdateRequest, db?: Database, expectedIdentity?: ProjectAuthorityIdentity): ProjectGuardedUpdateResult;
|
|
18
|
+
export declare function applyProjectUpdate(id: string, request: ProjectGuardedUpdateRequest, db?: Database, expectedIdentity?: ProjectAuthorityIdentity, resultDigestForProject?: (project: Project) => string): ProjectGuardedUpdateResult;
|
|
19
|
+
export declare function rollbackProjectUpdate(id: string, request: ProjectGuardedRollbackRequest, db?: Database, expectedIdentity?: ProjectAuthorityIdentity, resultDigestForProject?: (project: Project) => string): ProjectGuardedUpdateResult;
|
|
20
|
+
export declare function getProjectUpdateReceipt(id: string, receiptId: string, identity?: ProjectAuthorityIdentity, db?: Database, expectedIdentity?: ProjectAuthorityIdentity): ProjectUpdateReceipt;
|
|
21
|
+
/**
|
|
22
|
+
* Package-internal compatibility helper for old tests and migrations.
|
|
23
|
+
* Public callers use applyProjectUpdate so every mutation is CAS-guarded and
|
|
24
|
+
* receipt-backed; this helper is intentionally not exported from src/index.ts.
|
|
25
|
+
*/
|
|
26
|
+
export declare function updateProject(id: string, input: UpdateProjectInput, db?: Database): Project | null;
|
|
27
|
+
//# sourceMappingURL=projects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/db/projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,KAAK,EACV,OAAO,EACP,wBAAwB,EACxB,6BAA6B,EAC7B,2BAA2B,EAC3B,0BAA0B,EAC1B,oBAAoB,EACpB,kBAAkB,EAC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AsB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,GACpD,0BAA0B,CA4F5B;AAED,wBAAgB,qBAAqB,CACnC,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,6BAA6B,EACtC,EAAE,CAAC,EAAE,QAAQ,EACb,gBAAgB,GAAE,wBAAmD,EACrE,sBAAsB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,GACpD,0BAA0B,CAuG5B;AAED,wBAAgB,uBAAuB,CACrC,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,wBAAmD,EAC7D,EAAE,CAAC,EAAE,QAAQ,EACb,gBAAgB,GAAE,wBAAmD,GACpE,oBAAoB,CAmBtB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,kBAAkB,EACzB,EAAE,CAAC,EAAE,QAAQ,GACZ,OAAO,GAAG,IAAI,CAkFhB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Memory ratings — usefulness feedback for memories.
|
|
3
|
+
*/
|
|
4
|
+
import { SqliteAdapter as Database } from "../storage.js";
|
|
5
|
+
export interface MemoryRating {
|
|
6
|
+
id: string;
|
|
7
|
+
memory_id: string;
|
|
8
|
+
agent_id: string | null;
|
|
9
|
+
useful: boolean;
|
|
10
|
+
context: string | null;
|
|
11
|
+
created_at: string;
|
|
12
|
+
}
|
|
13
|
+
export interface RatingsSummary {
|
|
14
|
+
memory_id: string;
|
|
15
|
+
total: number;
|
|
16
|
+
useful_count: number;
|
|
17
|
+
not_useful_count: number;
|
|
18
|
+
usefulness_ratio: number;
|
|
19
|
+
}
|
|
20
|
+
export declare function rateMemory(memoryId: string, useful: boolean, agentId?: string, context?: string, db?: Database): MemoryRating;
|
|
21
|
+
export declare function listRatingsForMemory(memoryId: string, db?: Database): MemoryRating[];
|
|
22
|
+
export declare function getRatingsSummary(memoryId: string, db?: Database): RatingsSummary;
|
|
23
|
+
//# sourceMappingURL=ratings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ratings.d.ts","sourceRoot":"","sources":["../../src/db/ratings.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAO1D,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAMD,wBAAgB,UAAU,CACxB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,OAAO,EACf,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,EAChB,EAAE,CAAC,EAAE,QAAQ,GACZ,YAAY,CAmBd;AAMD,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,EAAE,CAAC,EAAE,QAAQ,GACZ,YAAY,EAAE,CAOhB;AAED,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,EAAE,CAAC,EAAE,QAAQ,GACZ,cAAc,CAqBhB"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { SqliteAdapter as Database } from "../storage.js";
|
|
2
|
+
import type { Entity, Relation, CreateRelationInput, RelationType } from "../types/index.js";
|
|
3
|
+
export declare function parseRelationRow(row: Record<string, unknown>): Relation;
|
|
4
|
+
export declare function parseEntityRow(row: Record<string, unknown>): Entity;
|
|
5
|
+
export declare function createRelation(input: CreateRelationInput, db?: Database): Relation;
|
|
6
|
+
export declare function getRelation(id: string, db?: Database): Relation;
|
|
7
|
+
export declare function listRelations(filter: {
|
|
8
|
+
entity_id?: string;
|
|
9
|
+
relation_type?: RelationType;
|
|
10
|
+
direction?: "outgoing" | "incoming" | "both";
|
|
11
|
+
}, db?: Database): Relation[];
|
|
12
|
+
export declare function deleteRelation(id: string, db?: Database): void;
|
|
13
|
+
/**
|
|
14
|
+
* Get direct neighbors (1-hop) of an entity.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getRelatedEntities(entityId: string, relationType?: RelationType, db?: Database): Entity[];
|
|
17
|
+
/**
|
|
18
|
+
* Recursive CTE graph traversal. Collect all entities and relations within N hops.
|
|
19
|
+
* Traverses BOTH directions (source->target and target->source).
|
|
20
|
+
*/
|
|
21
|
+
export declare function getEntityGraph(entityId: string, depth?: number, db?: Database): {
|
|
22
|
+
entities: Entity[];
|
|
23
|
+
relations: Relation[];
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* BFS shortest path using recursive CTE. Return ordered entity list or null if no path.
|
|
27
|
+
*/
|
|
28
|
+
export declare function findPath(fromEntityId: string, toEntityId: string, maxDepth?: number, db?: Database): Entity[] | null;
|
|
29
|
+
export interface GraphStats {
|
|
30
|
+
entities: {
|
|
31
|
+
total: number;
|
|
32
|
+
by_type: Record<string, number>;
|
|
33
|
+
};
|
|
34
|
+
relations: {
|
|
35
|
+
total: number;
|
|
36
|
+
by_type: Record<string, number>;
|
|
37
|
+
};
|
|
38
|
+
memory_links: number;
|
|
39
|
+
orphan_entities: number;
|
|
40
|
+
avg_degree: number;
|
|
41
|
+
most_connected: {
|
|
42
|
+
id: string;
|
|
43
|
+
name: string;
|
|
44
|
+
type: string;
|
|
45
|
+
degree: number;
|
|
46
|
+
}[];
|
|
47
|
+
}
|
|
48
|
+
export declare function getGraphStats(db?: Database): GraphStats;
|
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,GAAE,MAAU,EACjB,EAAE,CAAC,EAAE,QAAQ,GACZ;IAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,SAAS,EAAE,QAAQ,EAAE,CAAA;CAAE,CA6C/C;AAED;;GAEG;AACH,wBAAgB,QAAQ,CACtB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,QAAQ,GAAE,MAAU,EACpB,EAAE,CAAC,EAAE,QAAQ,GACZ,MAAM,EAAE,GAAG,IAAI,CAsCjB;AAMD,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,CAAC;IAC7D,SAAS,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,CAAC;IAC9D,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC9E;AAED,wBAAgB,aAAa,CAAC,EAAE,CAAC,EAAE,QAAQ,GAAG,UAAU,CAyCvD"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { SqliteAdapter as Database } from "../storage.js";
|
|
2
|
+
export type SessionJobSource = "claude-code" | "codex" | "manual" | "open-sessions";
|
|
3
|
+
export type SessionJobStatus = "pending" | "processing" | "completed" | "failed";
|
|
4
|
+
export interface SessionMemoryJob {
|
|
5
|
+
id: string;
|
|
6
|
+
session_id: string;
|
|
7
|
+
agent_id: string | null;
|
|
8
|
+
project_id: string | null;
|
|
9
|
+
source: SessionJobSource;
|
|
10
|
+
status: SessionJobStatus;
|
|
11
|
+
transcript: string;
|
|
12
|
+
chunk_count: number;
|
|
13
|
+
memories_extracted: number;
|
|
14
|
+
error: string | null;
|
|
15
|
+
metadata: Record<string, unknown>;
|
|
16
|
+
created_at: string;
|
|
17
|
+
started_at: string | null;
|
|
18
|
+
completed_at: string | null;
|
|
19
|
+
}
|
|
20
|
+
export interface CreateSessionJobInput {
|
|
21
|
+
session_id: string;
|
|
22
|
+
transcript: string;
|
|
23
|
+
source?: SessionJobSource;
|
|
24
|
+
agent_id?: string;
|
|
25
|
+
project_id?: string;
|
|
26
|
+
metadata?: Record<string, unknown>;
|
|
27
|
+
}
|
|
28
|
+
export interface SessionJobFilter {
|
|
29
|
+
agent_id?: string;
|
|
30
|
+
project_id?: string;
|
|
31
|
+
status?: SessionJobStatus;
|
|
32
|
+
session_id?: string;
|
|
33
|
+
limit?: number;
|
|
34
|
+
offset?: number;
|
|
35
|
+
}
|
|
36
|
+
export interface UpdateSessionJobInput {
|
|
37
|
+
status?: SessionJobStatus;
|
|
38
|
+
chunk_count?: number;
|
|
39
|
+
memories_extracted?: number;
|
|
40
|
+
error?: string | null;
|
|
41
|
+
started_at?: string | null;
|
|
42
|
+
completed_at?: string | null;
|
|
43
|
+
}
|
|
44
|
+
export declare function createSessionJob(input: CreateSessionJobInput, db?: Database): SessionMemoryJob;
|
|
45
|
+
export declare function getSessionJob(id: string, db?: Database): SessionMemoryJob | null;
|
|
46
|
+
export declare function listSessionJobs(filter?: SessionJobFilter, db?: Database): SessionMemoryJob[];
|
|
47
|
+
export declare function updateSessionJob(id: string, updates: UpdateSessionJobInput, db?: Database): SessionMemoryJob | null;
|
|
48
|
+
export declare function getNextPendingJob(db?: Database): SessionMemoryJob | null;
|
|
49
|
+
/**
|
|
50
|
+
* Atomically claim a pending job for processing.
|
|
51
|
+
* Single-statement compare-and-swap: only a `pending` row transitions to
|
|
52
|
+
* `processing`, so concurrent workers (server poll, CLI, MCP, route) can never
|
|
53
|
+
* claim the same job twice. Returns the number of rows changed (1 = claimed,
|
|
54
|
+
* 0 = already claimed, not pending, or missing).
|
|
55
|
+
*/
|
|
56
|
+
export declare function claimSessionJob(id: string, db?: Database): number;
|
|
57
|
+
/**
|
|
58
|
+
* Requeue jobs stranded in `processing` by a crashed processor.
|
|
59
|
+
* Resets rows whose claim started before the cutoff back to `pending` so the
|
|
60
|
+
* poll re-picks them up. The cutoff is a JS-computed ISO-8601 timestamp
|
|
61
|
+
* (matching the `started_at` written by claimSessionJob / updateSessionJob);
|
|
62
|
+
* SQLite's `datetime('now')` must NOT be used here — its format differs from
|
|
63
|
+
* the ISO-8601 stored by `now()` and would compare lexically wrong. Returns
|
|
64
|
+
* the number of rows recovered.
|
|
65
|
+
*/
|
|
66
|
+
export declare function recoverStaleProcessingJobs(maxAgeMs: number, db?: Database): number;
|
|
67
|
+
//# sourceMappingURL=session-jobs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-jobs.d.ts","sourceRoot":"","sources":["../../src/db/session-jobs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAK1D,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,eAAe,CAAC;AACpF,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,YAAY,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEjF,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,EAAE,gBAAgB,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,KAA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AAG,IAAI,CAiBhF;AAED,wBAAgB,eAAe,CAC7B,MAAM,CAAC,EAAE,gBAAgB,EACzB,EAAE,CAAC,EAAE,QAAQ,GACZ,gBAAgB,EAAE,CA2CpB;AAED,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,qBAAqB,EAC9B,EAAE,CAAC,EAAE,QAAQ,GACZ,gBAAgB,GAAG,IAAI,CAwCzB;AAED,wBAAgB,iBAAiB,CAAC,EAAE,CAAC,EAAE,QAAQ,GAAG,gBAAgB,GAAG,IAAI,CASxE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,MAAM,CAQjE;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,MAAM,CAQlF"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The transport that reads and writes will actually use.
|
|
3
|
+
*
|
|
4
|
+
* - `local-sqlite` — the on-disk SQLite file at `db_path` is authoritative.
|
|
5
|
+
* - `cloud-api` — authed HTTPS to the server (the shared store).
|
|
6
|
+
* - `cloud-postgres` — a direct Postgres DSN; server-only, never a client.
|
|
7
|
+
*/
|
|
8
|
+
export type StoreBackend = "local-sqlite" | "cloud-api" | "cloud-postgres";
|
|
9
|
+
export interface StoreBackendReport {
|
|
10
|
+
/** Machine-readable contract for scripts and test guards. */
|
|
11
|
+
schema: "mementos.store_backend.v1";
|
|
12
|
+
backend: StoreBackend;
|
|
13
|
+
/** True when the HTTPS client transport is engaged (client reads AND writes). */
|
|
14
|
+
api_mode: boolean;
|
|
15
|
+
/** The server data backend (sqlite | postgresql) — reported for diagnosis, NOT the client answer. */
|
|
16
|
+
server_backend: string;
|
|
17
|
+
/** The SQLite path that WOULD be used. Meaningful only for `local-sqlite`. */
|
|
18
|
+
db_path: string;
|
|
19
|
+
/**
|
|
20
|
+
* Cloud endpoint origin + prefix as CONFIGURED, not necessarily as used: it
|
|
21
|
+
* is still reported when an explicit DB_PATH has outranked it, because the
|
|
22
|
+
* operator needs to see what was set as well as what won. Read `backend` /
|
|
23
|
+
* `api_mode` for what is actually in force, and `selected_by` for why.
|
|
24
|
+
* Not a secret; the key is never included.
|
|
25
|
+
*/
|
|
26
|
+
api_endpoint: string | null;
|
|
27
|
+
/**
|
|
28
|
+
* Whether an API key is CONFIGURED in the environment — again independent of
|
|
29
|
+
* whether it won. The value is never read or reported.
|
|
30
|
+
*/
|
|
31
|
+
api_key_present: boolean;
|
|
32
|
+
/** Env key NAMES that produced this backend, or `"default"`. Names only. */
|
|
33
|
+
selected_by: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Resolve the effective store backend from the environment.
|
|
37
|
+
*
|
|
38
|
+
* Pure with respect to storage: touches no database, makes no network call, and
|
|
39
|
+
* never places a credential value in the returned report.
|
|
40
|
+
*/
|
|
41
|
+
export declare function resolveStoreBackend(): StoreBackendReport;
|
|
42
|
+
//# sourceMappingURL=store-backend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store-backend.d.ts","sourceRoot":"","sources":["../../src/db/store-backend.ts"],"names":[],"mappings":"AAiCA;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,cAAc,GAAG,WAAW,GAAG,gBAAgB,CAAC;AAE3E,MAAM,WAAW,kBAAkB;IACjC,6DAA6D;IAC7D,MAAM,EAAE,2BAA2B,CAAC;IACpC,OAAO,EAAE,YAAY,CAAC;IACtB,iFAAiF;IACjF,QAAQ,EAAE,OAAO,CAAC;IAClB,qGAAqG;IACrG,cAAc,EAAE,MAAM,CAAC;IACvB,8EAA8E;IAC9E,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;OAMG;IACH,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;;;OAGG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB,4EAA4E;IAC5E,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,kBAAkB,CAiDxD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SqliteAdapter as Database } from "../storage.js";
|
|
2
|
+
export interface Subscription {
|
|
3
|
+
id: string;
|
|
4
|
+
agent_id: string;
|
|
5
|
+
key_pattern: string | null;
|
|
6
|
+
tag_pattern: string | null;
|
|
7
|
+
scope: string | null;
|
|
8
|
+
}
|
|
9
|
+
export interface CreateSubscriptionInput {
|
|
10
|
+
agent_id: string;
|
|
11
|
+
key_pattern?: string | null;
|
|
12
|
+
tag_pattern?: string | null;
|
|
13
|
+
scope?: string | null;
|
|
14
|
+
}
|
|
15
|
+
export declare function createSubscription(input: CreateSubscriptionInput, db?: Database): Subscription;
|
|
16
|
+
export declare function deleteSubscription(id: string, db?: Database): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Compute human-readable change notifications for an agent: recently changed
|
|
19
|
+
* memories (last 10 minutes) matching that agent's subscriptions, excluding the
|
|
20
|
+
* agent's own writes. Encapsulates the whole two-query workflow so callers
|
|
21
|
+
* (memory_inject) never touch SQLite directly.
|
|
22
|
+
*/
|
|
23
|
+
export declare function getSubscriptionNotifications(agentId: string, db?: Database): string[];
|
|
24
|
+
//# sourceMappingURL=subscriptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../src/db/subscriptions.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAI1D,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,YAAY,CAmB9F;AAED,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO,CAQrE;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,MAAM,EAAE,CAqCrF"}
|