@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,150 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import type { Memory, MemoryCategory, MemoryScope } from "../types/index.js";
|
|
3
|
+
import type { Entity, EntityType } from "../types/index.js";
|
|
4
|
+
export declare function getPackageVersion(): string;
|
|
5
|
+
export declare function importanceColor(importance: number): (s: string) => string;
|
|
6
|
+
export declare function colorScope(scope: MemoryScope): string;
|
|
7
|
+
export declare function colorCategory(category: MemoryCategory): string;
|
|
8
|
+
export declare function colorImportance(importance: number): string;
|
|
9
|
+
export declare function colorEntityType(type: string, suffix?: string): string;
|
|
10
|
+
export declare function resolveEntityArg(nameOrId: string, type?: EntityType): Entity;
|
|
11
|
+
export declare function outputJson(data: unknown): void;
|
|
12
|
+
export declare const DEFAULT_COMPACT_LIMIT = 20;
|
|
13
|
+
export declare const DEFAULT_SEARCH_LIMIT = 10;
|
|
14
|
+
export declare const DEFAULT_SNIPPET_LENGTH = 72;
|
|
15
|
+
export declare function positiveIntOrDefault(value: unknown, fallback: number): number;
|
|
16
|
+
export declare function cursorOrOffset(cursor: unknown, offset: unknown): number | undefined;
|
|
17
|
+
export declare function truncateText(value: string | null | undefined, max?: number): string;
|
|
18
|
+
export interface PagedFetchResult<T> {
|
|
19
|
+
rows: T[];
|
|
20
|
+
/**
|
|
21
|
+
* true = more rows exist; false = the end was reached; undefined = the
|
|
22
|
+
* server did not say (an older server without the pagination contract —
|
|
23
|
+
* the walk falls back to a short-page heuristic).
|
|
24
|
+
*/
|
|
25
|
+
has_more: boolean | undefined;
|
|
26
|
+
next_cursor: number | null;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Collect rows across bounded pages (BUG 2796806b). The server caps every
|
|
30
|
+
* single response (1000 rows for list surfaces), so a request for more than
|
|
31
|
+
* one page — or for the full population — must walk pages.
|
|
32
|
+
*
|
|
33
|
+
* `target` is the number of rows the caller will display; the walk probes one
|
|
34
|
+
* row past it so `hasMore` is truthful and a "use --cursor N for more" hint is
|
|
35
|
+
* honest. With `target` undefined every matching row is collected.
|
|
36
|
+
*
|
|
37
|
+
* Guarded against cursor cycles and runaway page counts (mirrors the SDK's
|
|
38
|
+
* traversal guards). Termination: the server's `has_more: false`, or a page
|
|
39
|
+
* shorter than requested when the server carries no signal, or `target` rows
|
|
40
|
+
* collected.
|
|
41
|
+
*/
|
|
42
|
+
export declare function collectPagedRows<T>(fetchPage: (offset: number, limit: number) => PagedFetchResult<T>, target: number | undefined, offset: number, opts?: {
|
|
43
|
+
pageSize?: number;
|
|
44
|
+
maxPages?: number;
|
|
45
|
+
}): {
|
|
46
|
+
rows: T[];
|
|
47
|
+
hasMore: boolean;
|
|
48
|
+
};
|
|
49
|
+
export declare function printPageHint(opts: {
|
|
50
|
+
shown: number;
|
|
51
|
+
limit: number;
|
|
52
|
+
offset?: number;
|
|
53
|
+
hasMore: boolean;
|
|
54
|
+
command: string;
|
|
55
|
+
detailHint?: string;
|
|
56
|
+
}): void;
|
|
57
|
+
/**
|
|
58
|
+
* Resolve output format from local command flag, global flag, or --json alias.
|
|
59
|
+
* Priority: localFmt > global --format > --json > "compact"
|
|
60
|
+
*/
|
|
61
|
+
export declare function getOutputFormat(program: Command, localFmt?: string): string;
|
|
62
|
+
/**
|
|
63
|
+
* Simple YAML output — no library dependency.
|
|
64
|
+
* Arrays of objects: each item as `- key: value` block.
|
|
65
|
+
* Single objects: `key: value` per line.
|
|
66
|
+
*/
|
|
67
|
+
export declare function outputYaml(data: unknown): void;
|
|
68
|
+
export declare function formatMemoryLine(m: Memory, opts?: {
|
|
69
|
+
valueLength?: number;
|
|
70
|
+
preferSummary?: boolean;
|
|
71
|
+
}): string;
|
|
72
|
+
export declare function formatMemoryDetail(m: Memory): string;
|
|
73
|
+
export declare function makeHandleError(program: Command): (e: unknown) => never;
|
|
74
|
+
export declare function resolveMemoryId(partialId: string): string;
|
|
75
|
+
/**
|
|
76
|
+
* Resolve an `--agent` filter value to the agent id the store actually indexes.
|
|
77
|
+
*
|
|
78
|
+
* WHY THIS EXISTS. Every read command declared `--agent <name>` and then used
|
|
79
|
+
* the raw string as an agent ID. A registered NAME therefore matched nothing,
|
|
80
|
+
* and — because an empty list is a legal answer — the miss was reported as
|
|
81
|
+
* "No memories found." at rc=0 with empty stderr. A real name and a fabricated
|
|
82
|
+
* string produced byte-identical output, so no caller could tell an empty set
|
|
83
|
+
* from a mistyped one. The fleet's compliance check for the mementos-discipline
|
|
84
|
+
* rule is `list --agent <seat>`, which meant it reported every seat as
|
|
85
|
+
* non-compliant regardless of truth: a check that cannot pass.
|
|
86
|
+
*
|
|
87
|
+
* RESOLUTION IS DELEGATED, NOT REIMPLEMENTED. `getAgent` already does
|
|
88
|
+
* id -> case-insensitive name -> unique partial id (returning null when a
|
|
89
|
+
* partial is ambiguous), it is what the `save` path uses since #43, and it is
|
|
90
|
+
* MODE-AWARE — in API mode it resolves through `GET /agents/<value>` rather
|
|
91
|
+
* than SQL. A local-only lookup here would have worked on a developer box and
|
|
92
|
+
* failed on the fleet, which runs in API mode.
|
|
93
|
+
*
|
|
94
|
+
* ON A MISS: WARN AND PASS THE RAW VALUE THROUGH.
|
|
95
|
+
*
|
|
96
|
+
* - WARN rather than THROW. The save path throws (#43) because there rc=0 was
|
|
97
|
+
* illusory: the write silently landed in the unowned bucket and destroyed
|
|
98
|
+
* what was there. A read filter destroys nothing, and callers legitimately
|
|
99
|
+
* treat an empty list as a scriptable answer, so the sibling contract to
|
|
100
|
+
* match is `todos list --assigned <bogus>`, which warns at rc=0. Same class,
|
|
101
|
+
* opposite verb, deliberately different remedy.
|
|
102
|
+
* - The warning goes to STDERR so `--format json` stays parseable on stdout.
|
|
103
|
+
* - PASSING THE RAW VALUE THROUGH, rather than dropping the filter, is the
|
|
104
|
+
* load-bearing half. Dropping it is what `search` and `info-stale` did, and
|
|
105
|
+
* it WIDENS the query: an unresolvable agent then returns every agent's
|
|
106
|
+
* rows. Zero rows is a visible failure; other agents' rows returned as
|
|
107
|
+
* yours is an invisible one. Passing the raw value keeps the query narrow
|
|
108
|
+
* and also cannot regress a caller whose id has no `agents` row — measured
|
|
109
|
+
* 0 such rows across 8340 memories at the time of the fix, but the store is
|
|
110
|
+
* not frozen.
|
|
111
|
+
*/
|
|
112
|
+
export declare function resolveAgentFilter(nameOrId: string | undefined): string | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* Resolve a key-or-id argument to a Memory object.
|
|
115
|
+
* Tries key lookup first (with optional scope/agent/project filters), then partial ID.
|
|
116
|
+
*/
|
|
117
|
+
export declare function resolveKeyOrId(keyOrId: string, opts: {
|
|
118
|
+
scope?: string;
|
|
119
|
+
agent?: string;
|
|
120
|
+
project?: string;
|
|
121
|
+
}, globalOpts: GlobalOpts): Memory | null;
|
|
122
|
+
export declare function formatWatchLine(m: Memory): string;
|
|
123
|
+
export declare function sendNotification(m: Memory): void;
|
|
124
|
+
export interface GlobalOpts {
|
|
125
|
+
project?: string;
|
|
126
|
+
json?: boolean;
|
|
127
|
+
format?: string;
|
|
128
|
+
agent?: string;
|
|
129
|
+
session?: string;
|
|
130
|
+
}
|
|
131
|
+
export declare function diffLines(oldText: string, newText: string): void;
|
|
132
|
+
export declare function diffMemory(memoryId: string, opts: {
|
|
133
|
+
version?: string;
|
|
134
|
+
}, globalOpts: GlobalOpts): void;
|
|
135
|
+
export declare const VALID_SCOPES: string[];
|
|
136
|
+
export declare const VALID_CATEGORIES: string[];
|
|
137
|
+
/** Navigate a nested object using dot-notation key path */
|
|
138
|
+
export declare function getNestedValue(obj: Record<string, unknown>, path: string): unknown;
|
|
139
|
+
/** Set a nested value using dot-notation key path */
|
|
140
|
+
export declare function setNestedValue(obj: Record<string, unknown>, path: string, value: unknown): void;
|
|
141
|
+
/** Remove a nested key using dot-notation key path */
|
|
142
|
+
export declare function deleteNestedKey(obj: Record<string, unknown>, path: string): void;
|
|
143
|
+
/** Parse a CLI value: try JSON.parse for numbers/booleans/arrays, fall back to string */
|
|
144
|
+
export declare function parseConfigValue(raw: string): unknown;
|
|
145
|
+
/** Validate a config key/value pair against known constraints */
|
|
146
|
+
export declare function validateConfigKeyValue(key: string, value: unknown, DEFAULT_CONFIG: unknown): string | null;
|
|
147
|
+
export declare function getConfigPath(): string;
|
|
148
|
+
export declare function readFileConfig(): Record<string, unknown>;
|
|
149
|
+
export declare function writeFileConfig(data: Record<string, unknown>): void;
|
|
150
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/cli/helpers.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.tsx"],"names":[],"mappings":""}
|
package/dist/cli/index.js
CHANGED
|
@@ -1011,7 +1011,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1011
1011
|
this._exitCallback = (err) => {
|
|
1012
1012
|
if (err.code !== "commander.executeSubCommandAsync") {
|
|
1013
1013
|
throw err;
|
|
1014
|
-
}
|
|
1014
|
+
} else {}
|
|
1015
1015
|
};
|
|
1016
1016
|
}
|
|
1017
1017
|
return this;
|
|
@@ -5019,6 +5019,30 @@ function redactSecrets(text) {
|
|
|
5019
5019
|
}
|
|
5020
5020
|
return result;
|
|
5021
5021
|
}
|
|
5022
|
+
function redactValueTree(value) {
|
|
5023
|
+
if (typeof value === "string")
|
|
5024
|
+
return redactSecrets(value);
|
|
5025
|
+
if (Array.isArray(value))
|
|
5026
|
+
return value.map(redactValueTree);
|
|
5027
|
+
if (value !== null && typeof value === "object") {
|
|
5028
|
+
const out = {};
|
|
5029
|
+
for (const [k, v] of Object.entries(value)) {
|
|
5030
|
+
out[k] = redactValueTree(v);
|
|
5031
|
+
}
|
|
5032
|
+
return out;
|
|
5033
|
+
}
|
|
5034
|
+
return value;
|
|
5035
|
+
}
|
|
5036
|
+
function redactMemoryForOutput(memory) {
|
|
5037
|
+
return {
|
|
5038
|
+
...memory,
|
|
5039
|
+
key: redactSecrets(memory.key),
|
|
5040
|
+
value: redactSecrets(memory.value),
|
|
5041
|
+
summary: memory.summary ? redactSecrets(memory.summary) : null,
|
|
5042
|
+
when_to_use: memory.when_to_use ? redactSecrets(memory.when_to_use) : null,
|
|
5043
|
+
metadata: redactValueTree(memory.metadata)
|
|
5044
|
+
};
|
|
5045
|
+
}
|
|
5022
5046
|
var REDACTED = "[REDACTED]", SECRET_PATTERNS;
|
|
5023
5047
|
var init_redact = __esm(() => {
|
|
5024
5048
|
SECRET_PATTERNS = [
|
|
@@ -9952,6 +9976,7 @@ var init_auto_memory = __esm(() => {
|
|
|
9952
9976
|
// src/db/webhook_hooks.ts
|
|
9953
9977
|
var exports_webhook_hooks = {};
|
|
9954
9978
|
__export(exports_webhook_hooks, {
|
|
9979
|
+
validateWebhookHandlerUrl: () => validateWebhookHandlerUrl,
|
|
9955
9980
|
updateWebhookHook: () => updateWebhookHook,
|
|
9956
9981
|
recordWebhookInvocation: () => recordWebhookInvocation,
|
|
9957
9982
|
listWebhookHooks: () => listWebhookHooks,
|
|
@@ -9959,6 +9984,8 @@ __export(exports_webhook_hooks, {
|
|
|
9959
9984
|
deleteWebhookHook: () => deleteWebhookHook,
|
|
9960
9985
|
createWebhookHook: () => createWebhookHook
|
|
9961
9986
|
});
|
|
9987
|
+
import { isIP } from "net";
|
|
9988
|
+
import { lookup as dnsLookup } from "dns/promises";
|
|
9962
9989
|
function parseRow(row) {
|
|
9963
9990
|
return {
|
|
9964
9991
|
id: row["id"],
|
|
@@ -9975,7 +10002,153 @@ function parseRow(row) {
|
|
|
9975
10002
|
failureCount: row["failure_count"]
|
|
9976
10003
|
};
|
|
9977
10004
|
}
|
|
9978
|
-
function
|
|
10005
|
+
function isBlockedIpv4(parts) {
|
|
10006
|
+
const a = parts[0];
|
|
10007
|
+
const b = parts[1];
|
|
10008
|
+
if (a === 0)
|
|
10009
|
+
return true;
|
|
10010
|
+
if (a === 127)
|
|
10011
|
+
return true;
|
|
10012
|
+
if (a === 169 && b === 254)
|
|
10013
|
+
return true;
|
|
10014
|
+
if (a === 10)
|
|
10015
|
+
return true;
|
|
10016
|
+
if (a === 172 && b >= 16 && b <= 31)
|
|
10017
|
+
return true;
|
|
10018
|
+
if (a === 192 && b === 168)
|
|
10019
|
+
return true;
|
|
10020
|
+
return false;
|
|
10021
|
+
}
|
|
10022
|
+
function isBlockedIpv6(bytes) {
|
|
10023
|
+
const mapped = bytes.slice(0, 10).every((b) => b === 0) && bytes[10] === 255 && bytes[11] === 255;
|
|
10024
|
+
if (mapped)
|
|
10025
|
+
return isBlockedIpv4(bytes.slice(12, 16));
|
|
10026
|
+
if (bytes.every((b) => b === 0))
|
|
10027
|
+
return true;
|
|
10028
|
+
if (bytes.slice(0, 15).every((b) => b === 0) && bytes[15] === 1)
|
|
10029
|
+
return true;
|
|
10030
|
+
if ((bytes[0] & 254) === 252)
|
|
10031
|
+
return true;
|
|
10032
|
+
if (bytes[0] === 254 && (bytes[1] & 192) === 128)
|
|
10033
|
+
return true;
|
|
10034
|
+
return false;
|
|
10035
|
+
}
|
|
10036
|
+
function quadToGroups(quad) {
|
|
10037
|
+
const nums = quad.split(".").map((p) => Number(p));
|
|
10038
|
+
const [a, b, c, d] = nums;
|
|
10039
|
+
const valid = [a, b, c, d].every((n) => n !== undefined && Number.isInteger(n) && n >= 0 && n <= 255);
|
|
10040
|
+
if (!valid)
|
|
10041
|
+
return null;
|
|
10042
|
+
return [a << 8 | b, c << 8 | d];
|
|
10043
|
+
}
|
|
10044
|
+
function parseIpv6Bytes(host) {
|
|
10045
|
+
const groups = host.split("::");
|
|
10046
|
+
if (groups.length > 2)
|
|
10047
|
+
return null;
|
|
10048
|
+
const headRaw = groups[0] ?? "";
|
|
10049
|
+
const tailRaw = groups[1] ?? "";
|
|
10050
|
+
const head = headRaw === "" ? [] : headRaw.split(":");
|
|
10051
|
+
const tail = tailRaw === "" ? [] : tailRaw.split(":");
|
|
10052
|
+
const headNums = [];
|
|
10053
|
+
for (const g of head) {
|
|
10054
|
+
if (!/^[0-9a-f]{1,4}$/i.test(g))
|
|
10055
|
+
return null;
|
|
10056
|
+
headNums.push(parseInt(g, 16));
|
|
10057
|
+
}
|
|
10058
|
+
const tailNums = [];
|
|
10059
|
+
for (const g of tail) {
|
|
10060
|
+
if (/^\d+\.\d+\.\d+\.\d+$/.test(g)) {
|
|
10061
|
+
const quads = quadToGroups(g);
|
|
10062
|
+
if (!quads)
|
|
10063
|
+
return null;
|
|
10064
|
+
tailNums.push(...quads);
|
|
10065
|
+
} else if (/^[0-9a-f]{1,4}$/i.test(g)) {
|
|
10066
|
+
tailNums.push(parseInt(g, 16));
|
|
10067
|
+
} else {
|
|
10068
|
+
return null;
|
|
10069
|
+
}
|
|
10070
|
+
}
|
|
10071
|
+
const hasCompression = groups.length === 2;
|
|
10072
|
+
if (!hasCompression && headNums.length !== 8)
|
|
10073
|
+
return null;
|
|
10074
|
+
if (hasCompression && headNums.length + tailNums.length >= 8)
|
|
10075
|
+
return null;
|
|
10076
|
+
const zeros = 8 - headNums.length - tailNums.length;
|
|
10077
|
+
const all = [...headNums, ...new Array(zeros).fill(0), ...tailNums];
|
|
10078
|
+
const bytes = [];
|
|
10079
|
+
for (const n of all) {
|
|
10080
|
+
bytes.push(n >> 8 & 255, n & 255);
|
|
10081
|
+
}
|
|
10082
|
+
return bytes;
|
|
10083
|
+
}
|
|
10084
|
+
function defaultResolveHost(hostname2) {
|
|
10085
|
+
return dnsLookup(hostname2, { all: true, verbatim: true });
|
|
10086
|
+
}
|
|
10087
|
+
function assertResolvedAddressPublic(address, url) {
|
|
10088
|
+
const version = isIP(address);
|
|
10089
|
+
if (version === 4) {
|
|
10090
|
+
if (isBlockedIpv4(address.split(".").map((p) => Number(p)))) {
|
|
10091
|
+
throw new Error(`${BLOCKED_TARGET_MESSAGE}: "${url}"`);
|
|
10092
|
+
}
|
|
10093
|
+
} else if (version === 6) {
|
|
10094
|
+
const bytes = parseIpv6Bytes(address);
|
|
10095
|
+
if (!bytes || isBlockedIpv6(bytes)) {
|
|
10096
|
+
throw new Error(`${BLOCKED_TARGET_MESSAGE}: "${url}"`);
|
|
10097
|
+
}
|
|
10098
|
+
} else {
|
|
10099
|
+
throw new Error(`${BLOCKED_TARGET_MESSAGE}: "${url}"`);
|
|
10100
|
+
}
|
|
10101
|
+
}
|
|
10102
|
+
async function validateWebhookHandlerUrl(url, opts) {
|
|
10103
|
+
const resolveHost = opts?.lookup ?? defaultResolveHost;
|
|
10104
|
+
let parsed;
|
|
10105
|
+
try {
|
|
10106
|
+
parsed = new URL(url);
|
|
10107
|
+
} catch {
|
|
10108
|
+
throw new Error(`Invalid webhook handler URL "${url}" \u2014 must be a valid http(s) URL`);
|
|
10109
|
+
}
|
|
10110
|
+
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
|
|
10111
|
+
throw new Error(`Invalid webhook handler URL "${url}" \u2014 only http and https are allowed`);
|
|
10112
|
+
}
|
|
10113
|
+
if (parsed.username || parsed.password) {
|
|
10114
|
+
throw new Error(`Invalid webhook handler URL "${url}" \u2014 embedded credentials are not allowed`);
|
|
10115
|
+
}
|
|
10116
|
+
const host = parsed.hostname.replace(/^\[|\]$/g, "").toLowerCase();
|
|
10117
|
+
if (host === "localhost" || host.endsWith(".localhost")) {
|
|
10118
|
+
throw new Error(`${BLOCKED_TARGET_MESSAGE}: "${url}"`);
|
|
10119
|
+
}
|
|
10120
|
+
const version = isIP(host);
|
|
10121
|
+
if (version === 4 || version === 6) {
|
|
10122
|
+
if (version === 4) {
|
|
10123
|
+
if (isBlockedIpv4(host.split(".").map((p) => Number(p)))) {
|
|
10124
|
+
throw new Error(`${BLOCKED_TARGET_MESSAGE}: "${url}"`);
|
|
10125
|
+
}
|
|
10126
|
+
} else {
|
|
10127
|
+
const bytes = parseIpv6Bytes(host);
|
|
10128
|
+
if (!bytes || isBlockedIpv6(bytes)) {
|
|
10129
|
+
throw new Error(`${BLOCKED_TARGET_MESSAGE}: "${url}"`);
|
|
10130
|
+
}
|
|
10131
|
+
}
|
|
10132
|
+
return;
|
|
10133
|
+
}
|
|
10134
|
+
if (/^[0-9]+(\.[0-9]+)*$/.test(host) || /^0x[0-9a-f]+$/i.test(host) || host.includes("%")) {
|
|
10135
|
+
throw new Error(`${BLOCKED_TARGET_MESSAGE}: "${url}"`);
|
|
10136
|
+
}
|
|
10137
|
+
let addrs;
|
|
10138
|
+
try {
|
|
10139
|
+
addrs = await resolveHost(host);
|
|
10140
|
+
} catch {
|
|
10141
|
+
throw new Error(`${BLOCKED_TARGET_MESSAGE}: "${url}"`);
|
|
10142
|
+
}
|
|
10143
|
+
if (addrs.length === 0) {
|
|
10144
|
+
throw new Error(`${BLOCKED_TARGET_MESSAGE}: "${url}"`);
|
|
10145
|
+
}
|
|
10146
|
+
for (const { address } of addrs) {
|
|
10147
|
+
assertResolvedAddressPublic(address, url);
|
|
10148
|
+
}
|
|
10149
|
+
}
|
|
10150
|
+
async function createWebhookHook(input, db, opts) {
|
|
10151
|
+
await validateWebhookHandlerUrl(input.handlerUrl, opts);
|
|
9979
10152
|
if (!db && isApiMode()) {
|
|
9980
10153
|
const { data } = apiJson("POST", "/webhooks", {
|
|
9981
10154
|
type: input.type,
|
|
@@ -10093,6 +10266,7 @@ function recordWebhookInvocation(id, success, db) {
|
|
|
10093
10266
|
d.run("UPDATE webhook_hooks SET invocation_count = invocation_count + 1, failure_count = failure_count + 1 WHERE id = ?", [id]);
|
|
10094
10267
|
}
|
|
10095
10268
|
}
|
|
10269
|
+
var BLOCKED_TARGET_MESSAGE = "Invalid webhook handler URL \u2014 loopback, link-local, and private network targets are not allowed";
|
|
10096
10270
|
var init_webhook_hooks = __esm(() => {
|
|
10097
10271
|
init_database();
|
|
10098
10272
|
init_api_mode();
|
|
@@ -10711,6 +10885,7 @@ var init_contradiction = __esm(() => {
|
|
|
10711
10885
|
var exports_built_in_hooks = {};
|
|
10712
10886
|
__export(exports_built_in_hooks, {
|
|
10713
10887
|
reloadWebhooks: () => reloadWebhooks,
|
|
10888
|
+
makeWebhookHandler: () => makeWebhookHandler,
|
|
10714
10889
|
loadWebhooksFromDb: () => loadWebhooksFromDb
|
|
10715
10890
|
});
|
|
10716
10891
|
async function getAutoMemory() {
|
|
@@ -10720,13 +10895,19 @@ async function getAutoMemory() {
|
|
|
10720
10895
|
}
|
|
10721
10896
|
return _processConversationTurn;
|
|
10722
10897
|
}
|
|
10723
|
-
function loadWebhooksFromDb() {
|
|
10898
|
+
async function loadWebhooksFromDb() {
|
|
10724
10899
|
if (_webhooksLoaded)
|
|
10725
10900
|
return;
|
|
10726
10901
|
_webhooksLoaded = true;
|
|
10727
10902
|
try {
|
|
10728
10903
|
const webhooks = listWebhookHooks({ enabled: true });
|
|
10729
10904
|
for (const wh of webhooks) {
|
|
10905
|
+
try {
|
|
10906
|
+
await validateWebhookHandlerUrl(wh.handlerUrl);
|
|
10907
|
+
} catch (err) {
|
|
10908
|
+
console.error(`[hooks] Skipping webhook ${wh.id} (${wh.type}): ${err instanceof Error ? err.message : String(err)}`);
|
|
10909
|
+
continue;
|
|
10910
|
+
}
|
|
10730
10911
|
hookRegistry.register({
|
|
10731
10912
|
type: wh.type,
|
|
10732
10913
|
blocking: wh.blocking,
|
|
@@ -10744,9 +10925,10 @@ function loadWebhooksFromDb() {
|
|
|
10744
10925
|
console.error("[hooks] Failed to load webhooks from DB:", err);
|
|
10745
10926
|
}
|
|
10746
10927
|
}
|
|
10747
|
-
function makeWebhookHandler(webhookId, url) {
|
|
10928
|
+
function makeWebhookHandler(webhookId, url, opts) {
|
|
10748
10929
|
return async (context) => {
|
|
10749
10930
|
try {
|
|
10931
|
+
await validateWebhookHandlerUrl(url, opts);
|
|
10750
10932
|
const res = await fetch(url, {
|
|
10751
10933
|
method: "POST",
|
|
10752
10934
|
headers: { "Content-Type": "application/json" },
|
|
@@ -10759,9 +10941,9 @@ function makeWebhookHandler(webhookId, url) {
|
|
|
10759
10941
|
}
|
|
10760
10942
|
};
|
|
10761
10943
|
}
|
|
10762
|
-
function reloadWebhooks() {
|
|
10944
|
+
async function reloadWebhooks() {
|
|
10763
10945
|
_webhooksLoaded = false;
|
|
10764
|
-
loadWebhooksFromDb();
|
|
10946
|
+
await loadWebhooksFromDb();
|
|
10765
10947
|
}
|
|
10766
10948
|
var _processConversationTurn = null, _webhooksLoaded = false;
|
|
10767
10949
|
var init_built_in_hooks = __esm(() => {
|
|
@@ -27383,7 +27565,7 @@ class JSONSchemaGenerator {
|
|
|
27383
27565
|
if (val === undefined) {
|
|
27384
27566
|
if (this.unrepresentable === "throw") {
|
|
27385
27567
|
throw new Error("Literal `undefined` cannot be represented in JSON Schema");
|
|
27386
|
-
}
|
|
27568
|
+
} else {}
|
|
27387
27569
|
} else if (typeof val === "bigint") {
|
|
27388
27570
|
if (this.unrepresentable === "throw") {
|
|
27389
27571
|
throw new Error("BigInt literals cannot be represented in JSON Schema");
|
|
@@ -49033,7 +49215,7 @@ var require_tracestate_impl = __commonJS((exports) => {
|
|
|
49033
49215
|
const value = listMember.slice(i + 1, part.length);
|
|
49034
49216
|
if ((0, tracestate_validators_1.validateKey)(key) && (0, tracestate_validators_1.validateValue)(value)) {
|
|
49035
49217
|
agg.set(key, value);
|
|
49036
|
-
}
|
|
49218
|
+
} else {}
|
|
49037
49219
|
}
|
|
49038
49220
|
return agg;
|
|
49039
49221
|
}, new Map);
|
|
@@ -65226,6 +65408,7 @@ function registerRecallCommand(program2) {
|
|
|
65226
65408
|
// src/cli/commands/memory-cmd-list.ts
|
|
65227
65409
|
init_projects();
|
|
65228
65410
|
init_memories();
|
|
65411
|
+
init_redact();
|
|
65229
65412
|
init_helpers();
|
|
65230
65413
|
import chalk12 from "chalk";
|
|
65231
65414
|
import { resolve as resolve7 } from "path";
|
|
@@ -65273,36 +65456,37 @@ function registerListCommand(program2) {
|
|
|
65273
65456
|
};
|
|
65274
65457
|
}, limit, offset);
|
|
65275
65458
|
const memories = hasMore && limit !== undefined ? collected.slice(0, limit) : collected;
|
|
65459
|
+
const sanitized = memories.map(redactMemoryForOutput);
|
|
65276
65460
|
if (fmt === "json") {
|
|
65277
|
-
outputJson(
|
|
65461
|
+
outputJson(sanitized);
|
|
65278
65462
|
return;
|
|
65279
65463
|
}
|
|
65280
65464
|
if (fmt === "csv") {
|
|
65281
65465
|
console.log("key,value,scope,category,importance,id");
|
|
65282
|
-
for (const m of
|
|
65466
|
+
for (const m of sanitized) {
|
|
65283
65467
|
const v = m.value.replace(/"/g, '""');
|
|
65284
65468
|
console.log(`"${m.key}","${v}",${m.scope},${m.category},${m.importance},${m.id.slice(0, 8)}`);
|
|
65285
65469
|
}
|
|
65286
65470
|
return;
|
|
65287
65471
|
}
|
|
65288
65472
|
if (fmt === "yaml") {
|
|
65289
|
-
outputYaml(
|
|
65473
|
+
outputYaml(sanitized);
|
|
65290
65474
|
return;
|
|
65291
65475
|
}
|
|
65292
|
-
if (
|
|
65476
|
+
if (sanitized.length === 0) {
|
|
65293
65477
|
console.log(chalk12.yellow("No memories found."));
|
|
65294
65478
|
return;
|
|
65295
65479
|
}
|
|
65296
|
-
console.log(chalk12.bold(`${
|
|
65297
|
-
for (const m of
|
|
65480
|
+
console.log(chalk12.bold(`${sanitized.length}${hasMore ? "+" : ""} memor${sanitized.length === 1 ? "y" : "ies"}:`));
|
|
65481
|
+
for (const m of sanitized) {
|
|
65298
65482
|
console.log(formatMemoryLine(m, {
|
|
65299
65483
|
valueLength: opts.verbose ? 120 : 64,
|
|
65300
65484
|
preferSummary: !opts.verbose
|
|
65301
65485
|
}));
|
|
65302
65486
|
}
|
|
65303
65487
|
printPageHint({
|
|
65304
|
-
shown:
|
|
65305
|
-
limit: limit ??
|
|
65488
|
+
shown: sanitized.length,
|
|
65489
|
+
limit: limit ?? sanitized.length,
|
|
65306
65490
|
offset,
|
|
65307
65491
|
hasMore,
|
|
65308
65492
|
command: "mementos list",
|
|
@@ -68572,7 +68756,7 @@ By type:`));
|
|
|
68572
68756
|
webhooksCmd.command("create <type> <url>").description("Create a persistent webhook hook").option("--blocking", "Block the operation until the webhook responds").option("--priority <n>", "Hook priority (default 50)", "50").option("--agent <id>", "Scope to specific agent").option("--project <id>", "Scope to specific project").option("--description <text>", "Human-readable description").action(async (type, url, opts) => {
|
|
68573
68757
|
const { createWebhookHook: createWebhookHook2 } = await Promise.resolve().then(() => (init_webhook_hooks(), exports_webhook_hooks));
|
|
68574
68758
|
const { reloadWebhooks: reloadWebhooks2 } = await Promise.resolve().then(() => (init_built_in_hooks(), exports_built_in_hooks));
|
|
68575
|
-
const wh = createWebhookHook2({
|
|
68759
|
+
const wh = await createWebhookHook2({
|
|
68576
68760
|
type,
|
|
68577
68761
|
handlerUrl: url,
|
|
68578
68762
|
blocking: opts.blocking ?? false,
|
|
@@ -68581,7 +68765,7 @@ By type:`));
|
|
|
68581
68765
|
projectId: opts.project,
|
|
68582
68766
|
description: opts.description
|
|
68583
68767
|
});
|
|
68584
|
-
reloadWebhooks2();
|
|
68768
|
+
await reloadWebhooks2();
|
|
68585
68769
|
console.log(chalk31.green("\u2713 Webhook created"));
|
|
68586
68770
|
console.log(` ID: ${chalk31.cyan(wh.id)}`);
|
|
68587
68771
|
console.log(` Type: ${wh.type}`);
|
|
@@ -68602,7 +68786,7 @@ By type:`));
|
|
|
68602
68786
|
const { reloadWebhooks: reloadWebhooks2 } = await Promise.resolve().then(() => (init_built_in_hooks(), exports_built_in_hooks));
|
|
68603
68787
|
const updated = updateWebhookHook2(id, { enabled: true });
|
|
68604
68788
|
if (updated) {
|
|
68605
|
-
reloadWebhooks2();
|
|
68789
|
+
await reloadWebhooks2();
|
|
68606
68790
|
console.log(chalk31.green(`\u2713 Webhook ${id} enabled`));
|
|
68607
68791
|
} else {
|
|
68608
68792
|
console.error(chalk31.red(`Webhook not found: ${id}`));
|
|
@@ -68614,7 +68798,7 @@ By type:`));
|
|
|
68614
68798
|
const { reloadWebhooks: reloadWebhooks2 } = await Promise.resolve().then(() => (init_built_in_hooks(), exports_built_in_hooks));
|
|
68615
68799
|
const updated = updateWebhookHook2(id, { enabled: false });
|
|
68616
68800
|
if (updated) {
|
|
68617
|
-
reloadWebhooks2();
|
|
68801
|
+
await reloadWebhooks2();
|
|
68618
68802
|
console.log(chalk31.yellow(`\u2298 Webhook ${id} disabled`));
|
|
68619
68803
|
} else {
|
|
68620
68804
|
console.error(chalk31.red(`Webhook not found: ${id}`));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
/**
|
|
3
|
+
* Attach EVERY command group to `program`, in the order the CLI presents them.
|
|
4
|
+
*
|
|
5
|
+
* This is the single registration list. `index.tsx` calls it to build the real
|
|
6
|
+
* CLI, and `global-options.test.ts` calls it to walk the real option tables — so
|
|
7
|
+
* the structural short-flag guard cannot silently check a smaller tree than the
|
|
8
|
+
* one that ships.
|
|
9
|
+
*
|
|
10
|
+
* That drift was real: the guard originally re-listed 11 groups by hand while
|
|
11
|
+
* the CLI wired 15 sources, leaving `init`, `project-panel`, `brains` and the
|
|
12
|
+
* `@hasna/events` groups (`events`, `webhooks`) unwalked. Seven live `-j`
|
|
13
|
+
* collisions sat in that blind spot while the guard reported clean. Adding a
|
|
14
|
+
* command group here is now the only step required for it to be covered.
|
|
15
|
+
*/
|
|
16
|
+
export declare function registerAllCommands(program: Command): Command;
|
|
17
|
+
//# sourceMappingURL=register-all.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-all.d.ts","sourceRoot":"","sources":["../../src/cli/register-all.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkBzC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAiB7D"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
/**
|
|
3
|
+
* Mark a command as having no startup database access, and return it so it can
|
|
4
|
+
* be used inline at the end of a builder chain.
|
|
5
|
+
*/
|
|
6
|
+
export declare function withoutStartupDbAccess<T extends Command>(command: T): T;
|
|
7
|
+
/** Whether the command about to run has opted out of the startup DB access. */
|
|
8
|
+
export declare function skipsStartupDbAccess(command: Command | undefined): boolean;
|
|
9
|
+
//# sourceMappingURL=startup-side-effects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"startup-side-effects.d.ts","sourceRoot":"","sources":["../../src/cli/startup-side-effects.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,OAAO,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAGvE;AAED,+EAA+E;AAC/E,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAE1E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fail-closed-stub-server.d.ts","sourceRoot":"","sources":["../../../src/db/__fixtures__/fail-closed-stub-server.ts"],"names":[],"mappings":"AAqBA,QAAA,MAAM,MAAM,uBAyCV,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-filter-capture-server.d.ts","sourceRoot":"","sources":["../../../src/db/__fixtures__/list-filter-capture-server.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-filter-client-runner.d.ts","sourceRoot":"","sources":["../../../src/db/__fixtures__/list-filter-client-runner.ts"],"names":[],"mappings":""}
|
package/dist/db/acl.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Memory Access Control Lists (ACLs).
|
|
3
|
+
*
|
|
4
|
+
* Fine-grained permissions beyond scopes: read-only, read-write, admin
|
|
5
|
+
* per agent per key pattern. Default: no ACLs = full access (backward compat).
|
|
6
|
+
*/
|
|
7
|
+
import { SqliteAdapter as Database } from "../storage.js";
|
|
8
|
+
export type AclPermission = "read" | "readwrite" | "admin";
|
|
9
|
+
export interface MemoryAcl {
|
|
10
|
+
id: string;
|
|
11
|
+
agent_id: string;
|
|
12
|
+
key_pattern: string;
|
|
13
|
+
permission: AclPermission;
|
|
14
|
+
project_id: string | null;
|
|
15
|
+
created_at: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Set an ACL rule. Upserts by agent_id + key_pattern.
|
|
19
|
+
*/
|
|
20
|
+
export declare function setAcl(agentId: string, keyPattern: string, permission: AclPermission, projectId?: string, db?: Database): MemoryAcl;
|
|
21
|
+
/**
|
|
22
|
+
* List ACLs for an agent.
|
|
23
|
+
*/
|
|
24
|
+
export declare function listAcls(agentId: string, db?: Database): MemoryAcl[];
|
|
25
|
+
/**
|
|
26
|
+
* Remove an ACL rule.
|
|
27
|
+
*/
|
|
28
|
+
export declare function removeAcl(id: string, db?: Database): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Check if an agent has the required permission for a memory key.
|
|
31
|
+
* Returns true if allowed (no ACLs = full access).
|
|
32
|
+
*/
|
|
33
|
+
export declare function checkPermission(agentId: string, memoryKey: string, requiredPermission: "read" | "write", db?: Database): boolean;
|
|
34
|
+
//# sourceMappingURL=acl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acl.d.ts","sourceRoot":"","sources":["../../src/db/acl.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG1D,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,WAAW,GAAG,OAAO,CAAC;AAE3D,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,aAAa,CAAC;IAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,MAAM,CACpB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,aAAa,EACzB,SAAS,CAAC,EAAE,MAAM,EAClB,EAAE,CAAC,EAAE,QAAQ,GACZ,SAAS,CAeX;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,SAAS,EAAE,CAGpE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO,CAI5D;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,kBAAkB,EAAE,MAAM,GAAG,OAAO,EACpC,EAAE,CAAC,EAAE,QAAQ,GACZ,OAAO,CAqBT"}
|