@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,101 @@
|
|
|
1
|
+
import { SqliteAdapter as Database } from "../storage.js";
|
|
2
|
+
export interface SynthesisRun {
|
|
3
|
+
id: string;
|
|
4
|
+
triggered_by: "scheduler" | "manual" | "threshold" | "hook";
|
|
5
|
+
project_id: string | null;
|
|
6
|
+
agent_id: string | null;
|
|
7
|
+
corpus_size: number;
|
|
8
|
+
proposals_generated: number;
|
|
9
|
+
proposals_accepted: number;
|
|
10
|
+
proposals_rejected: number;
|
|
11
|
+
status: "pending" | "running" | "completed" | "failed" | "rolled_back";
|
|
12
|
+
error: string | null;
|
|
13
|
+
started_at: string;
|
|
14
|
+
completed_at: string | null;
|
|
15
|
+
}
|
|
16
|
+
export interface SynthesisProposal {
|
|
17
|
+
id: string;
|
|
18
|
+
run_id: string;
|
|
19
|
+
proposal_type: "merge" | "archive" | "promote" | "update_value" | "add_tag" | "remove_duplicate";
|
|
20
|
+
memory_ids: string[];
|
|
21
|
+
target_memory_id: string | null;
|
|
22
|
+
proposed_changes: Record<string, unknown>;
|
|
23
|
+
reasoning: string | null;
|
|
24
|
+
confidence: number;
|
|
25
|
+
status: "pending" | "accepted" | "rejected" | "rolled_back";
|
|
26
|
+
created_at: string;
|
|
27
|
+
executed_at: string | null;
|
|
28
|
+
rollback_data: Record<string, unknown> | null;
|
|
29
|
+
}
|
|
30
|
+
export interface SynthesisMetric {
|
|
31
|
+
id: string;
|
|
32
|
+
run_id: string;
|
|
33
|
+
metric_type: string;
|
|
34
|
+
value: number;
|
|
35
|
+
baseline: number | null;
|
|
36
|
+
created_at: string;
|
|
37
|
+
}
|
|
38
|
+
export interface SynthesisEvent {
|
|
39
|
+
id: string;
|
|
40
|
+
event_type: "recalled" | "searched" | "saved" | "updated" | "deleted" | "injected";
|
|
41
|
+
memory_id: string | null;
|
|
42
|
+
agent_id: string | null;
|
|
43
|
+
project_id: string | null;
|
|
44
|
+
session_id: string | null;
|
|
45
|
+
query: string | null;
|
|
46
|
+
importance_at_time: number | null;
|
|
47
|
+
metadata: Record<string, unknown>;
|
|
48
|
+
created_at: string;
|
|
49
|
+
}
|
|
50
|
+
export declare function createSynthesisRun(input: {
|
|
51
|
+
triggered_by: SynthesisRun["triggered_by"];
|
|
52
|
+
project_id?: string | null;
|
|
53
|
+
agent_id?: string | null;
|
|
54
|
+
corpus_size?: number;
|
|
55
|
+
}, db?: Database): SynthesisRun;
|
|
56
|
+
export declare function getSynthesisRun(id: string, db?: Database): SynthesisRun | null;
|
|
57
|
+
export declare function listSynthesisRuns(filter: {
|
|
58
|
+
project_id?: string | null;
|
|
59
|
+
status?: SynthesisRun["status"];
|
|
60
|
+
limit?: number;
|
|
61
|
+
}, db?: Database): SynthesisRun[];
|
|
62
|
+
export declare function updateSynthesisRun(id: string, updates: Partial<Pick<SynthesisRun, "status" | "error" | "corpus_size" | "proposals_generated" | "proposals_accepted" | "proposals_rejected" | "completed_at">>, db?: Database): SynthesisRun;
|
|
63
|
+
export declare function createProposal(input: {
|
|
64
|
+
run_id: string;
|
|
65
|
+
proposal_type: SynthesisProposal["proposal_type"];
|
|
66
|
+
memory_ids: string[];
|
|
67
|
+
target_memory_id?: string | null;
|
|
68
|
+
proposed_changes: Record<string, unknown>;
|
|
69
|
+
reasoning?: string | null;
|
|
70
|
+
confidence: number;
|
|
71
|
+
}, db?: Database): SynthesisProposal;
|
|
72
|
+
export declare function getProposal(id: string, db?: Database): SynthesisProposal | null;
|
|
73
|
+
export declare function listProposals(run_id: string, filter?: {
|
|
74
|
+
status?: SynthesisProposal["status"];
|
|
75
|
+
}, db?: Database): SynthesisProposal[];
|
|
76
|
+
export declare function updateProposal(id: string, updates: Partial<Pick<SynthesisProposal, "status" | "executed_at" | "rollback_data">>, db?: Database): SynthesisProposal;
|
|
77
|
+
export declare function createMetric(input: {
|
|
78
|
+
run_id: string;
|
|
79
|
+
metric_type: string;
|
|
80
|
+
value: number;
|
|
81
|
+
baseline?: number | null;
|
|
82
|
+
}, db?: Database): SynthesisMetric;
|
|
83
|
+
export declare function listMetrics(run_id: string, db?: Database): SynthesisMetric[];
|
|
84
|
+
export declare function recordSynthesisEvent(input: {
|
|
85
|
+
event_type: SynthesisEvent["event_type"];
|
|
86
|
+
memory_id?: string | null;
|
|
87
|
+
agent_id?: string | null;
|
|
88
|
+
project_id?: string | null;
|
|
89
|
+
session_id?: string | null;
|
|
90
|
+
query?: string | null;
|
|
91
|
+
importance_at_time?: number | null;
|
|
92
|
+
metadata?: Record<string, unknown>;
|
|
93
|
+
}, db?: Database): void;
|
|
94
|
+
export declare function listSynthesisEvents(filter: {
|
|
95
|
+
memory_id?: string;
|
|
96
|
+
project_id?: string;
|
|
97
|
+
event_type?: SynthesisEvent["event_type"];
|
|
98
|
+
since?: string;
|
|
99
|
+
limit?: number;
|
|
100
|
+
}, db?: Database): SynthesisEvent[];
|
|
101
|
+
//# sourceMappingURL=synthesis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"synthesis.d.ts","sourceRoot":"","sources":["../../src/db/synthesis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAS1D,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,WAAW,GAAG,QAAQ,GAAG,WAAW,GAAG,MAAM,CAAC;IAC5D,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,aAAa,CAAC;IACvE,KAA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B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC,EACD,EAAE,CAAC,EAAE,QAAQ,GACZ,IAAI,CAyBN;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE;IACN,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,EACD,EAAE,CAAC,EAAE,QAAQ,GACZ,cAAc,EAAE,CAsBlB"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { SqliteAdapter as Database } from "../storage.js";
|
|
2
|
+
export type TaskStatus = "pending" | "in_progress" | "completed" | "failed" | "cancelled";
|
|
3
|
+
export type TaskPriority = "critical" | "high" | "medium" | "low";
|
|
4
|
+
export interface Task {
|
|
5
|
+
id: string;
|
|
6
|
+
subject: string;
|
|
7
|
+
description: string;
|
|
8
|
+
status: TaskStatus;
|
|
9
|
+
priority: TaskPriority;
|
|
10
|
+
tags: string[];
|
|
11
|
+
assigned_agent_id: string | null;
|
|
12
|
+
project_id: string | null;
|
|
13
|
+
session_id: string | null;
|
|
14
|
+
parent_task_id: string | null;
|
|
15
|
+
metadata: Record<string, unknown>;
|
|
16
|
+
progress: number;
|
|
17
|
+
due_at: string | null;
|
|
18
|
+
started_at: string | null;
|
|
19
|
+
completed_at: string | null;
|
|
20
|
+
failed_at: string | null;
|
|
21
|
+
error: string | null;
|
|
22
|
+
created_at: string;
|
|
23
|
+
updated_at: string;
|
|
24
|
+
}
|
|
25
|
+
export interface TaskComment {
|
|
26
|
+
id: string;
|
|
27
|
+
task_id: string;
|
|
28
|
+
agent_id: string | null;
|
|
29
|
+
body: string;
|
|
30
|
+
created_at: string;
|
|
31
|
+
}
|
|
32
|
+
export interface CreateTaskInput {
|
|
33
|
+
subject: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
priority?: TaskPriority;
|
|
36
|
+
tags?: string[];
|
|
37
|
+
assigned_agent_id?: string;
|
|
38
|
+
project_id?: string;
|
|
39
|
+
session_id?: string;
|
|
40
|
+
parent_task_id?: string;
|
|
41
|
+
metadata?: Record<string, unknown>;
|
|
42
|
+
due_at?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface UpdateTaskInput {
|
|
45
|
+
subject?: string;
|
|
46
|
+
description?: string;
|
|
47
|
+
status?: TaskStatus;
|
|
48
|
+
priority?: TaskPriority;
|
|
49
|
+
tags?: string[];
|
|
50
|
+
assigned_agent_id?: string | null;
|
|
51
|
+
metadata?: Record<string, unknown>;
|
|
52
|
+
progress?: number;
|
|
53
|
+
due_at?: string | null;
|
|
54
|
+
error?: string | null;
|
|
55
|
+
}
|
|
56
|
+
export declare function createTask(db: Database, input: CreateTaskInput): Task;
|
|
57
|
+
export declare function getTask(db: Database, id: string): Task | null;
|
|
58
|
+
export declare function listTasks(db: Database, filter?: {
|
|
59
|
+
status?: TaskStatus;
|
|
60
|
+
priority?: TaskPriority;
|
|
61
|
+
assigned_agent_id?: string;
|
|
62
|
+
project_id?: string;
|
|
63
|
+
session_id?: string;
|
|
64
|
+
parent_task_id?: string | null;
|
|
65
|
+
tags?: string[];
|
|
66
|
+
limit?: number;
|
|
67
|
+
offset?: number;
|
|
68
|
+
}): {
|
|
69
|
+
tasks: Task[];
|
|
70
|
+
count: number;
|
|
71
|
+
};
|
|
72
|
+
export declare function updateTask(db: Database, id: string, input: UpdateTaskInput): Task | null;
|
|
73
|
+
export declare function deleteTask(db: Database, id: string): boolean;
|
|
74
|
+
export declare function addTaskComment(db: Database, taskId: string, body: string, agentId?: string): TaskComment;
|
|
75
|
+
export declare function listTaskComments(db: Database, taskId: string): {
|
|
76
|
+
comments: TaskComment[];
|
|
77
|
+
count: number;
|
|
78
|
+
};
|
|
79
|
+
export declare function deleteTaskComment(db: Database, id: string): boolean;
|
|
80
|
+
export declare function getTaskStats(db: Database, filter?: {
|
|
81
|
+
project_id?: string;
|
|
82
|
+
agent_id?: string;
|
|
83
|
+
}): {
|
|
84
|
+
total: number;
|
|
85
|
+
by_status: Record<TaskStatus, number>;
|
|
86
|
+
by_priority: Record<TaskPriority, number>;
|
|
87
|
+
overdue: number;
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=tasks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/db/tasks.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG1D,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,aAAa,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC;AAC1F,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AAElE,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,YAAY,CAAC;IACvB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC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,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAQxG;AAYD,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG;IAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAKzG;AAED,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAGnE;AAMD,wBAAgB,YAAY,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG;IAC/F,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACtC,WAAW,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IAC1C,OAAO,EAAE,MAAM,CAAC;CACjB,CA4CA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SqliteAdapter as Database } from "../storage.js";
|
|
2
|
+
import type { ToolEvent, CreateToolEventInput, ToolStats } from "../types/index.js";
|
|
3
|
+
export declare function saveToolEvent(input: CreateToolEventInput, db?: Database): ToolEvent;
|
|
4
|
+
export declare function getToolEvent(id: string, db?: Database): ToolEvent | null;
|
|
5
|
+
export declare function getToolEvents(filters: {
|
|
6
|
+
tool_name?: string;
|
|
7
|
+
agent_id?: string;
|
|
8
|
+
project_id?: string;
|
|
9
|
+
success?: boolean;
|
|
10
|
+
from_date?: string;
|
|
11
|
+
to_date?: string;
|
|
12
|
+
limit?: number;
|
|
13
|
+
offset?: number;
|
|
14
|
+
}, db?: Database): ToolEvent[];
|
|
15
|
+
export declare function getToolStats(tool_name: string, project_id?: string, db?: Database): ToolStats;
|
|
16
|
+
export declare function getToolLessons(tool_name: string, project_id?: string, limit?: number, db?: Database): {
|
|
17
|
+
lesson: string;
|
|
18
|
+
when_to_use: string | null;
|
|
19
|
+
created_at: string;
|
|
20
|
+
}[];
|
|
21
|
+
export declare function deleteToolEvents(filters: {
|
|
22
|
+
tool_name?: string;
|
|
23
|
+
agent_id?: string;
|
|
24
|
+
project_id?: string;
|
|
25
|
+
before_date?: string;
|
|
26
|
+
}, db?: Database): number;
|
|
27
|
+
//# sourceMappingURL=tool-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-events.d.ts","sourceRoot":"","sources":["../../src/db/tool-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAiCpF,wBAAgB,aAAa,CAAC,KAAK,EAAE,oBAAoB,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,SAAS,CAkCnF;AAMD,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,IAAI,CAKxE;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE;IACP,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,EACD,EAAE,CAAC,EAAE,QAAQ,GACZ,SAAS,EAAE,CAqDb;AAMD,wBAAgB,YAAY,CAC1B,SAAS,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE,MAAM,EACnB,EAAE,CAAC,EAAE,QAAQ,GACZ,SAAS,CAkDX;AAMD,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE,MAAM,EACnB,KAAK,CAAC,EAAE,MAAM,EACd,EAAE,CAAC,EAAE,QAAQ,GACZ;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,EAAE,CAuBtE;AAMD,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE;IACP,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,EACD,EAAE,CAAC,EAAE,QAAQ,GACZ,MAAM,CA8BR"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { SqliteAdapter as Database } from "../storage.js";
|
|
2
|
+
import type { LookupAddress } from "node:dns";
|
|
3
|
+
import type { WebhookHook, HookType } from "../types/hooks.js";
|
|
4
|
+
/**
|
|
5
|
+
* Resolver signature: returns every A/AAAA address for a hostname.
|
|
6
|
+
* Defaults to node:dns/promises lookup (all addresses, verbatim order).
|
|
7
|
+
*/
|
|
8
|
+
export type HostResolver = (hostname: string) => Promise<LookupAddress[]>;
|
|
9
|
+
export interface WebhookUrlValidationOptions {
|
|
10
|
+
/**
|
|
11
|
+
* Hostname resolver override — a deterministic test seam. Production call
|
|
12
|
+
* sites never pass it; when absent the real system resolver is used.
|
|
13
|
+
*/
|
|
14
|
+
lookup?: HostResolver;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Validate a webhook handler URL. Rejects (async) when the URL is not a
|
|
18
|
+
* public http(s) endpoint: unparseable, wrong scheme, embedded credentials,
|
|
19
|
+
* or a loopback / link-local / private / metadata target — whether named
|
|
20
|
+
* directly as an IP literal or indirectly via a DNS name that resolves to one
|
|
21
|
+
* of those ranges. A hostname that cannot be resolved is rejected (fail
|
|
22
|
+
* closed): it could never be delivered, and rejecting it closes the SSRF
|
|
23
|
+
* class.
|
|
24
|
+
*/
|
|
25
|
+
export declare function validateWebhookHandlerUrl(url: string, opts?: WebhookUrlValidationOptions): Promise<void>;
|
|
26
|
+
export interface CreateWebhookHookInput {
|
|
27
|
+
type: HookType;
|
|
28
|
+
handlerUrl: string;
|
|
29
|
+
priority?: number;
|
|
30
|
+
blocking?: boolean;
|
|
31
|
+
agentId?: string;
|
|
32
|
+
projectId?: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
}
|
|
35
|
+
export declare function createWebhookHook(input: CreateWebhookHookInput, db?: Database, opts?: WebhookUrlValidationOptions): Promise<WebhookHook>;
|
|
36
|
+
export declare function getWebhookHook(id: string, db?: Database): WebhookHook | null;
|
|
37
|
+
export declare function listWebhookHooks(filter?: {
|
|
38
|
+
type?: HookType;
|
|
39
|
+
enabled?: boolean;
|
|
40
|
+
}, db?: Database): WebhookHook[];
|
|
41
|
+
export declare function updateWebhookHook(id: string, updates: {
|
|
42
|
+
enabled?: boolean;
|
|
43
|
+
description?: string;
|
|
44
|
+
priority?: number;
|
|
45
|
+
}, db?: Database): WebhookHook | null;
|
|
46
|
+
export declare function deleteWebhookHook(id: string, db?: Database): boolean;
|
|
47
|
+
export declare function recordWebhookInvocation(id: string, success: boolean, db?: Database): void;
|
|
48
|
+
//# sourceMappingURL=webhook_hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook_hooks.d.ts","sourceRoot":"","sources":["../../src/db/webhook_hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAM1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AA6H/D;;;GAGG;AACH,MAAM,MAA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AAW,GAAG,IAAI,CAoCpB;AAMD,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO,CAQpE;AAMD,wBAAgB,uBAAuB,CACrC,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,OAAO,EAChB,EAAE,CAAC,EAAE,QAAQ,GACZ,IAAI,CAmBN"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface HistoricalReceiptDiagnosticQuery {
|
|
2
|
+
query<T = Record<string, unknown>>(sql: string, values?: unknown[]): Promise<{
|
|
3
|
+
rows: T[];
|
|
4
|
+
rowCount: number | null;
|
|
5
|
+
}>;
|
|
6
|
+
}
|
|
7
|
+
export interface HistoricalReceiptDiagnosticReport {
|
|
8
|
+
schema: "mementos.historical-project-registration-receipt-diagnostic.v1";
|
|
9
|
+
status: "PASS";
|
|
10
|
+
transaction_read_only: true;
|
|
11
|
+
exact_receipt_count: 1;
|
|
12
|
+
table_count_before: string;
|
|
13
|
+
table_count_after: string;
|
|
14
|
+
table_digest_before: string;
|
|
15
|
+
table_digest_after: string;
|
|
16
|
+
table_count_unchanged: true;
|
|
17
|
+
table_digest_unchanged: true;
|
|
18
|
+
authority_id: string;
|
|
19
|
+
tenant_id: string;
|
|
20
|
+
corpus_id: string;
|
|
21
|
+
operation_id: string;
|
|
22
|
+
step_id: string;
|
|
23
|
+
target_selector: string;
|
|
24
|
+
target_id: string;
|
|
25
|
+
receipt_id: string;
|
|
26
|
+
identity_digest: string;
|
|
27
|
+
target_digest: string;
|
|
28
|
+
operation_digest: string;
|
|
29
|
+
idempotency_digest: string;
|
|
30
|
+
result_digest: string;
|
|
31
|
+
receipt_digest: string;
|
|
32
|
+
response_digest: string;
|
|
33
|
+
}
|
|
34
|
+
export declare class HistoricalReceiptDiagnosticError extends Error {
|
|
35
|
+
readonly code: string;
|
|
36
|
+
constructor(code: string);
|
|
37
|
+
}
|
|
38
|
+
export declare function diagnoseHistoricalProjectRegistrationReceipt(query: HistoricalReceiptDiagnosticQuery): Promise<HistoricalReceiptDiagnosticReport>;
|
|
39
|
+
//# sourceMappingURL=historical-project-registration-receipt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"historical-project-registration-receipt.d.ts","sourceRoot":"","sources":["../../src/diagnostics/historical-project-registration-receipt.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,gCAAgC;IAC/C,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,OAAO,EAAE,GACjB,OAAO,CAAC;QAAE,IAAI,EAAE,CAAC,EAAE,CAAC;QAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;CACpD;AAYD,MAAM,WAAW,iCAAiC;IAChD,MAAM,EAAE,gEAAgE,CAAC;IACzE,MAAM,EAAE,MAAM,CAAC;IACf,qBAAqB,EAAE,IAAI,CAAC;IAC5B,mBAAmB,EAAE,CAAC,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,qBAAqB,EAAE,IAAI,CAAC;IAC5B,sBAAsB,EAAE,IAAI,CAAC;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,qBAAa,gCAAiC,SAAQ,KAAK;IAC7C,QAAQ,CAAC,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM;CAIlC;AAyFD,wBAAsB,4CAA4C,CAChE,KAAK,EAAE,gCAAgC,GACtC,OAAO,CAAC,iCAAiC,CAAC,CAgH5C"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const SERVER_DATA_BACKENDS: readonly ["sqlite", "postgresql"];
|
|
2
|
+
export type ServerDataBackend = (typeof SERVER_DATA_BACKENDS)[number];
|
|
3
|
+
export type Env = Record<string, string | undefined>;
|
|
4
|
+
/** Upper-snake env token for an app name, e.g. `todos` -> `TODOS`. */
|
|
5
|
+
export declare function envToken(name: string): string;
|
|
6
|
+
export interface ServerDataBackendEnvKeys {
|
|
7
|
+
databaseUrlKeys: string[];
|
|
8
|
+
}
|
|
9
|
+
export declare function serverDataBackendEnvKeys(name: string): ServerDataBackendEnvKeys;
|
|
10
|
+
export declare function assertNoLegacyStorageMode(name: string, env?: Env): void;
|
|
11
|
+
export interface ServerDataBackendResolution {
|
|
12
|
+
backend: ServerDataBackend;
|
|
13
|
+
source: string;
|
|
14
|
+
databaseUrlPresent: boolean;
|
|
15
|
+
databaseUrlSource: string | null;
|
|
16
|
+
}
|
|
17
|
+
export declare function resolveServerDataBackend(name: string, env?: Env): ServerDataBackendResolution;
|
|
18
|
+
/** Resolve the database URL without logging it. Returns `null` when unset. */
|
|
19
|
+
export declare function resolveDatabaseUrl(name: string, env?: Env): string | null;
|
|
20
|
+
//# sourceMappingURL=backend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../../src/generated/storage-kit/backend.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,oBAAoB,mCAAoC,CAAC;AACtE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAErD,sEAAsE;AACtE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED,MAAM,WAAW,wBAAwB;IACvC,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,wBAAwB,CAK/E;AA+BD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAE,GAAiB,GAAG,IAAI,CASpF;AAED,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,iBAAiB,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,EACZ,GAAG,GAAE,GAAiB,GACrB,2BAA2B,CAiB7B;AAED,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAE,GAAiB,GAAG,MAAM,GAAG,IAAI,CAItF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { TypedQueryClient } from "./query.js";
|
|
2
|
+
import { type Migration, type MigrationRunnerOptions } from "./migrations.js";
|
|
3
|
+
export interface HealthResult {
|
|
4
|
+
ok: boolean;
|
|
5
|
+
/** Round-trip latency of the probe query, in milliseconds. */
|
|
6
|
+
latencyMs: number;
|
|
7
|
+
error?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Cheap reachability probe: `SELECT 1`. Never throws — reports `ok: false`. */
|
|
10
|
+
export declare function checkHealth(client: TypedQueryClient): Promise<HealthResult>;
|
|
11
|
+
export interface ReadyResult extends HealthResult {
|
|
12
|
+
/** Migration ids that are defined but not yet applied. */
|
|
13
|
+
pendingMigrations: string[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Readiness probe: reachable AND fully migrated. Reports `ok: false` with the
|
|
17
|
+
* list of pending migration ids when the schema is behind.
|
|
18
|
+
*/
|
|
19
|
+
export declare function checkReady(client: TypedQueryClient, migrations: readonly Migration[], options?: MigrationRunnerOptions): Promise<ReadyResult>;
|
|
20
|
+
//# sourceMappingURL=health.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../../src/generated/storage-kit/health.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAmB,KAAK,SAAS,EAAE,KAAK,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAE/F,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,OAAO,CAAC;IACZ,8DAA8D;IAC9D,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,gFAAgF;AAChF,wBAAsB,WAAW,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,YAAY,CAAC,CAYjF;AAED,MAAM,WAAW,WAAY,SAAQ,YAAY;IAC/C,0DAA0D;IAC1D,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAC9B,MAAM,EAAE,gBAAgB,EACxB,UAAU,EAAE,SAAS,SAAS,EAAE,EAChC,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,WAAW,CAAC,CAetB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const KIT_VERSION = "0.10.6";
|
|
2
|
+
export * from "./backend.js";
|
|
3
|
+
export * from "./tls.js";
|
|
4
|
+
export * from "./query.js";
|
|
5
|
+
export * from "./pool.js";
|
|
6
|
+
export * from "./migrations.js";
|
|
7
|
+
export * from "./health.js";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generated/storage-kit/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,WAAW,WAAW,CAAC;AAEpC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { TypedQueryClient } from "./query.js";
|
|
2
|
+
/** Default ledger table name. Override per app if a legacy name exists. */
|
|
3
|
+
export declare const DEFAULT_MIGRATION_LEDGER_TABLE = "schema_migrations";
|
|
4
|
+
export interface Migration {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly sql: string;
|
|
7
|
+
readonly checksum: string;
|
|
8
|
+
}
|
|
9
|
+
export type MigrationState = "already_applied" | "pending";
|
|
10
|
+
export interface MigrationPlanItem {
|
|
11
|
+
readonly migration: Migration;
|
|
12
|
+
readonly state: MigrationState;
|
|
13
|
+
}
|
|
14
|
+
export interface AppliedMigration {
|
|
15
|
+
readonly id: string;
|
|
16
|
+
readonly checksum: string;
|
|
17
|
+
readonly appliedAt: string;
|
|
18
|
+
}
|
|
19
|
+
export interface MigrationResult {
|
|
20
|
+
readonly dryRun: boolean;
|
|
21
|
+
readonly applied: AppliedMigration[];
|
|
22
|
+
readonly plan: MigrationPlanItem[];
|
|
23
|
+
}
|
|
24
|
+
/** Stable sha256 checksum for a migration's SQL text. */
|
|
25
|
+
export declare function checksumSql(sql: string): string;
|
|
26
|
+
/** Freeze a migration definition, computing its checksum from the SQL. */
|
|
27
|
+
export declare function defineMigration(id: string, sql: string): Migration;
|
|
28
|
+
export interface MigrationRunnerOptions {
|
|
29
|
+
ledgerTable?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare class MigrationLedger {
|
|
32
|
+
private readonly client;
|
|
33
|
+
private readonly migrations;
|
|
34
|
+
private readonly ledgerTable;
|
|
35
|
+
constructor(client: TypedQueryClient, migrations: readonly Migration[], options?: MigrationRunnerOptions);
|
|
36
|
+
ensureLedger(): Promise<void>;
|
|
37
|
+
listApplied(): Promise<AppliedMigration[]>;
|
|
38
|
+
private readApplied;
|
|
39
|
+
/** Compute the migration plan and guard against drift/downgrade. */
|
|
40
|
+
private buildPlan;
|
|
41
|
+
/** Apply all pending migrations. With `dryRun`, report the plan only. */
|
|
42
|
+
migrate(opts?: {
|
|
43
|
+
dryRun?: boolean;
|
|
44
|
+
}): Promise<MigrationResult>;
|
|
45
|
+
}
|
|
46
|
+
/** Convenience: build a ledger and run all pending migrations. */
|
|
47
|
+
export declare function createMigrationLedger(client: TypedQueryClient, migrations: readonly Migration[], options?: MigrationRunnerOptions): MigrationLedger;
|
|
48
|
+
//# sourceMappingURL=migrations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../../src/generated/storage-kit/migrations.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAGnD,2EAA2E;AAC3E,eAAO,MAAM,8BAA8B,sBAAsB,CAAC;AAElE,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,MAAM,cAAc,GAAG,iBAAiB,GAAG,SAAS,CAAC;AAE3D,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;CA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Ae,CAEjB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read `key` from `source` only when `source` OWNS it.
|
|
3
|
+
*
|
|
4
|
+
* Returns `undefined` for an inherited property and for a null/undefined or
|
|
5
|
+
* non-object source, so a guarded read is a drop-in for `source?.[key]` that
|
|
6
|
+
* cannot be answered by the prototype chain.
|
|
7
|
+
*/
|
|
8
|
+
export declare function ownProp<T>(source: unknown, key: string): T | undefined;
|
|
9
|
+
/** `ownProp` narrowed to a string, so a polluted non-string cannot slip through. */
|
|
10
|
+
export declare function ownString(source: unknown, key: string): string | undefined;
|
|
11
|
+
//# sourceMappingURL=own.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"own.d.ts","sourceRoot":"","sources":["../../../src/generated/storage-kit/own.ts"],"names":[],"mappings":"AAyCA;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAMtE;AAED,oFAAoF;AACpF,wBAAgB,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAG1E"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Pool } from "pg";
|
|
2
|
+
import { type TlsResolveOptions } from "./tls.js";
|
|
3
|
+
import { type PoolQueryClient } from "./query.js";
|
|
4
|
+
export interface CreatePgPoolOptions extends TlsResolveOptions {
|
|
5
|
+
connectionString: string;
|
|
6
|
+
/** Max clients in the pool. Defaults to pg's default (10). */
|
|
7
|
+
max?: number;
|
|
8
|
+
/** Idle client timeout (ms). */
|
|
9
|
+
idleTimeoutMillis?: number;
|
|
10
|
+
/** Connection acquisition timeout (ms). */
|
|
11
|
+
connectionTimeoutMillis?: number;
|
|
12
|
+
/** Application name reported to Postgres (shows in pg_stat_activity). */
|
|
13
|
+
applicationName?: string;
|
|
14
|
+
}
|
|
15
|
+
/** Build a `pg.Pool` with fleet-standard TLS handling. */
|
|
16
|
+
export declare function createPgPool(options: CreatePgPoolOptions): Pool;
|
|
17
|
+
export interface CreateServerPoolFromEnvOptions extends TlsResolveOptions {
|
|
18
|
+
max?: number;
|
|
19
|
+
idleTimeoutMillis?: number;
|
|
20
|
+
connectionTimeoutMillis?: number;
|
|
21
|
+
applicationName?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ServerPoolFromEnv {
|
|
24
|
+
client: PoolQueryClient;
|
|
25
|
+
connectionSource: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Resolve backend + database URL from the environment and build the server's
|
|
29
|
+
* PostgreSQL pool.
|
|
30
|
+
*
|
|
31
|
+
* Throws when no database URL selects the `postgresql` backend. Never logs the
|
|
32
|
+
* URL.
|
|
33
|
+
*/
|
|
34
|
+
export declare function createServerPoolFromEnv(appName: string, options?: CreateServerPoolFromEnvOptions): ServerPoolFromEnv;
|
|
35
|
+
//# sourceMappingURL=pool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../../../src/generated/storage-kit/pool.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,IAAI,CAAC;AAE3C,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAgDrE,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC5D,gBAAgB,EAAE,MAAM,CAAC;IACzB,8DAA8D;IAC9D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,2CAA2C;IAC3C,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,yEAAyE;IACzE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,0DAA0D;AAC1D,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAmC/D;AAED,MAAM,WAAW,8BAA+B,SAAQ,iBAAiB;IACvE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,eAAe,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,8BAAmC,GAC3C,iBAAiB,CAoBnB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Pool, QueryResultRow } from "pg";
|
|
2
|
+
export interface QueryResult<T extends QueryResultRow> {
|
|
3
|
+
rows: T[];
|
|
4
|
+
rowCount: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Minimal executor contract. `pg.Pool` and `pg.PoolClient` both satisfy the
|
|
8
|
+
* `query` method; the wrapper builds the rest on top so tests can substitute a
|
|
9
|
+
* lightweight shim without pulling in a live Postgres.
|
|
10
|
+
*/
|
|
11
|
+
export interface PgExecutor {
|
|
12
|
+
query<T extends QueryResultRow>(sql: string, params?: readonly unknown[]): Promise<{
|
|
13
|
+
rows: T[];
|
|
14
|
+
rowCount: number | null;
|
|
15
|
+
}>;
|
|
16
|
+
}
|
|
17
|
+
export interface TypedQueryClient {
|
|
18
|
+
query<T extends QueryResultRow>(sql: string, params?: readonly unknown[]): Promise<QueryResult<T>>;
|
|
19
|
+
many<T extends QueryResultRow>(sql: string, params?: readonly unknown[]): Promise<T[]>;
|
|
20
|
+
/** First row or `null`. Restored here after open-knowledge dropped it. */
|
|
21
|
+
get<T extends QueryResultRow>(sql: string, params?: readonly unknown[]): Promise<T | null>;
|
|
22
|
+
/** Exactly one row; throws if zero or more than one row is returned. */
|
|
23
|
+
one<T extends QueryResultRow>(sql: string, params?: readonly unknown[]): Promise<T>;
|
|
24
|
+
execute(sql: string, params?: readonly unknown[]): Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
/** Wrap any `PgExecutor` (a Pool, a PoolClient, or a test shim) with the typed vocabulary. */
|
|
27
|
+
export declare function wrapExecutor(executor: PgExecutor): TypedQueryClient;
|
|
28
|
+
export interface PoolQueryClient extends TypedQueryClient {
|
|
29
|
+
readonly pool: Pool;
|
|
30
|
+
/** Run a callback inside a `BEGIN`/`COMMIT` transaction on a dedicated client. */
|
|
31
|
+
transaction<T>(fn: (client: TypedQueryClient) => Promise<T>): Promise<T>;
|
|
32
|
+
close(): Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
/** Build a `PoolQueryClient` around a live `pg.Pool`. */
|
|
35
|
+
export declare function createQueryClient(pool: Pool): PoolQueryClient;
|
|
36
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/generated/storage-kit/query.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,IAAI,EAAc,cAAc,EAAE,MAAM,IAAI,CAAC;AAE3D,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,cAAc;IACnD,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,CAAC,SAAS,cAAc,EAC5B,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,SAAS,OAAO,EAAE,GAC1B,OAAO,CAAC;QAAE,IAAI,EAAE,CAAC,EAAE,CAAC;QAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;CACpD;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,CAAC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Pool` / `pg.Client`. */
|
|
2
|
+
export type PgSslConfig = boolean | {
|
|
3
|
+
rejectUnauthorized: boolean;
|
|
4
|
+
ca?: string;
|
|
5
|
+
cert?: string;
|
|
6
|
+
key?: string;
|
|
7
|
+
passphrase?: string;
|
|
8
|
+
};
|
|
9
|
+
export interface TlsResolveOptions {
|
|
10
|
+
/** Inline CA bundle (PEM). Wins over every other CA source. */
|
|
11
|
+
ca?: string;
|
|
12
|
+
/** Path to a CA bundle PEM file, e.g. the Amazon RDS global bundle. */
|
|
13
|
+
caCertPath?: string;
|
|
14
|
+
/** Environment used to discover PGSSLROOTCERT / NODE_EXTRA_CA_CERTS. */
|
|
15
|
+
env?: Record<string, string | undefined>;
|
|
16
|
+
}
|
|
17
|
+
export type SslMode = "disable" | "prefer" | "require" | "verify-ca" | "verify-full";
|
|
18
|
+
/**
|
|
19
|
+
* Remove the TLS query parameters once this module has resolved them into an
|
|
20
|
+
* explicit `ssl` option. pg re-parses `connectionString` AFTER merging pool
|
|
21
|
+
* options and lets the parse win, so leaving `sslmode` (or `ssl`, `sslcert`,
|
|
22
|
+
* `sslkey`, `sslrootcert`, `sslnegotiation`) in the URL replaces the resolved
|
|
23
|
+
* SSL object with pg's own — discarding the CA bundle with it.
|
|
24
|
+
*
|
|
25
|
+
* Non-TLS parameters and any fragment are preserved exactly.
|
|
26
|
+
*/
|
|
27
|
+
export declare function connectionStringWithoutTlsParameters(connectionString: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* Preserve pg's transport negotiation choice outside the stripped URL, so
|
|
30
|
+
* `sslnegotiation=direct` survives as an explicit pool option instead of being
|
|
31
|
+
* silently dropped.
|
|
32
|
+
*/
|
|
33
|
+
export declare function sslNegotiationFromConnectionString(connectionString: string): "postgres" | "direct" | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Extract the effective `sslmode` from a Postgres connection string. Honors the
|
|
36
|
+
* `sslmode` query param, the legacy `ssl=true` boolean, and pg's rule that
|
|
37
|
+
* `sslnegotiation=direct` implies TLS when no explicit SSL setting is present.
|
|
38
|
+
* Returns `disable` when TLS is not requested.
|
|
39
|
+
*/
|
|
40
|
+
export declare function sslModeFromConnectionString(connectionString: string): SslMode;
|
|
41
|
+
/**
|
|
42
|
+
* Resolve the `pg` ssl config for a connection string. See the module header
|
|
43
|
+
* for the full mode table.
|
|
44
|
+
*
|
|
45
|
+
* Returns `false` when TLS was explicitly switched off, and `undefined` when the
|
|
46
|
+
* DSN expressed no TLS policy at all — those are different answers, and pg
|
|
47
|
+
* treats them differently: only `undefined` lets `PGSSLMODE` decide.
|
|
48
|
+
*
|
|
49
|
+
* The caller MUST hand pg `connectionStringWithoutTlsParameters(connectionString)`
|
|
50
|
+
* rather than the original DSN, or pg discards everything resolved here.
|
|
51
|
+
*/
|
|
52
|
+
export declare function resolveTlsConfig(connectionString: string, options?: TlsResolveOptions): PgSslConfig | undefined;
|
|
53
|
+
//# sourceMappingURL=tls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tls.d.ts","sourceRoot":"","sources":["../../../src/generated/storage-kit/tls.ts"],"names":[],"mappings":"AAwNA,iEAAiE;AACjE,MAAM,MAAM,WAAW,GACnB,OAAO,GACP;IACE,kBAAkB,EAAE,OAAO,CAAC;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEN,MAAM,WAAW,iBAAiB;IAChC,+DAA+D;IAC/D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,uEAAuE;IACvE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wEAAwE;IACxE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CAC1C;AAED,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,aAAa,CAAC;AA+BrF;;;;;;;;GAQG;AACH,wBAAgB,oCAAoC,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAOrF;AAgBD;;;;GAIG;AACH,wBAAgB,kCAAkC,CAChD,gBAAgB,EAAE,MAAM,GACvB,UAAU,GAAG,QAAQ,GAAG,SAAS,CAKnC;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAmD7E;AA6CD;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAC9B,gBAAgB,EAAE,MAAM,EACxB,OAAO,GAAE,iBAAsB,GAC9B,WAAW,GAAG,SAAS,CAgEzB"}
|