@spinabot/brigade 0.1.2 → 1.0.1
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/LICENSE +1 -1
- package/README.md +748 -88
- package/brigade.mjs +150 -73
- package/dist/agents/a2a-policy-canonicalize.d.ts +60 -0
- package/dist/agents/a2a-policy-canonicalize.d.ts.map +1 -0
- package/dist/agents/a2a-policy-canonicalize.js +103 -0
- package/dist/agents/a2a-policy-canonicalize.js.map +1 -0
- package/dist/agents/agent-event-bus.d.ts +221 -0
- package/dist/agents/agent-event-bus.d.ts.map +1 -0
- package/dist/agents/agent-event-bus.js +88 -0
- package/dist/agents/agent-event-bus.js.map +1 -0
- package/dist/agents/agent-events.d.ts +84 -0
- package/dist/agents/agent-events.d.ts.map +1 -0
- package/dist/agents/agent-events.js +309 -0
- package/dist/agents/agent-events.js.map +1 -0
- package/dist/agents/agent-events.types.d.ts +139 -0
- package/dist/agents/agent-events.types.d.ts.map +1 -0
- package/dist/agents/agent-events.types.js +27 -0
- package/dist/agents/agent-events.types.js.map +1 -0
- package/dist/agents/agent-loop.d.ts +145 -0
- package/dist/agents/agent-loop.d.ts.map +1 -0
- package/dist/agents/agent-loop.js +1938 -0
- package/dist/agents/agent-loop.js.map +1 -0
- package/dist/agents/agent-scope.d.ts +28 -0
- package/dist/agents/agent-scope.d.ts.map +1 -0
- package/dist/agents/agent-scope.js +39 -0
- package/dist/agents/agent-scope.js.map +1 -0
- package/dist/agents/approval-bridge.d.ts +139 -0
- package/dist/agents/approval-bridge.d.ts.map +1 -0
- package/dist/agents/approval-bridge.js +178 -0
- package/dist/agents/approval-bridge.js.map +1 -0
- package/dist/agents/carrow.d.ts +49 -0
- package/dist/agents/carrow.d.ts.map +1 -0
- package/dist/agents/carrow.js +57 -0
- package/dist/agents/carrow.js.map +1 -0
- package/dist/agents/channels/abort-triggers.d.ts +17 -0
- package/dist/agents/channels/abort-triggers.d.ts.map +1 -0
- package/dist/agents/channels/abort-triggers.js +52 -0
- package/dist/agents/channels/abort-triggers.js.map +1 -0
- package/dist/agents/channels/access-control/index.d.ts +5 -0
- package/dist/agents/channels/access-control/index.d.ts.map +1 -0
- package/dist/agents/channels/access-control/index.js +4 -0
- package/dist/agents/channels/access-control/index.js.map +1 -0
- package/dist/agents/channels/access-control/policy.d.ts +69 -0
- package/dist/agents/channels/access-control/policy.d.ts.map +1 -0
- package/dist/agents/channels/access-control/policy.js +123 -0
- package/dist/agents/channels/access-control/policy.js.map +1 -0
- package/dist/agents/channels/access-control/store.d.ts +86 -0
- package/dist/agents/channels/access-control/store.d.ts.map +1 -0
- package/dist/agents/channels/access-control/store.js +482 -0
- package/dist/agents/channels/access-control/store.js.map +1 -0
- package/dist/agents/channels/access-control/types.d.ts +52 -0
- package/dist/agents/channels/access-control/types.d.ts.map +1 -0
- package/dist/agents/channels/access-control/types.js +20 -0
- package/dist/agents/channels/access-control/types.js.map +1 -0
- package/dist/agents/channels/active-manager.d.ts +31 -0
- package/dist/agents/channels/active-manager.d.ts.map +1 -0
- package/dist/agents/channels/active-manager.js +41 -0
- package/dist/agents/channels/active-manager.js.map +1 -0
- package/dist/agents/channels/agent-switch-command.d.ts +53 -0
- package/dist/agents/channels/agent-switch-command.d.ts.map +1 -0
- package/dist/agents/channels/agent-switch-command.js +349 -0
- package/dist/agents/channels/agent-switch-command.js.map +1 -0
- package/dist/agents/channels/approval-router.d.ts +158 -0
- package/dist/agents/channels/approval-router.d.ts.map +1 -0
- package/dist/agents/channels/approval-router.js +446 -0
- package/dist/agents/channels/approval-router.js.map +1 -0
- package/dist/agents/channels/channel-entry-contract.d.ts +70 -0
- package/dist/agents/channels/channel-entry-contract.d.ts.map +1 -0
- package/dist/agents/channels/channel-entry-contract.js +48 -0
- package/dist/agents/channels/channel-entry-contract.js.map +1 -0
- package/dist/agents/channels/channel-plugin-manager.d.ts +86 -0
- package/dist/agents/channels/channel-plugin-manager.d.ts.map +1 -0
- package/dist/agents/channels/channel-plugin-manager.js +345 -0
- package/dist/agents/channels/channel-plugin-manager.js.map +1 -0
- package/dist/agents/channels/chat-type.d.ts +27 -0
- package/dist/agents/channels/chat-type.d.ts.map +1 -0
- package/dist/agents/channels/chat-type.js +33 -0
- package/dist/agents/channels/chat-type.js.map +1 -0
- package/dist/agents/channels/dedupe.d.ts +44 -0
- package/dist/agents/channels/dedupe.d.ts.map +1 -0
- package/dist/agents/channels/dedupe.js +80 -0
- package/dist/agents/channels/dedupe.js.map +1 -0
- package/dist/agents/channels/inbound-pipeline.d.ts +90 -0
- package/dist/agents/channels/inbound-pipeline.d.ts.map +1 -0
- package/dist/agents/channels/inbound-pipeline.js +721 -0
- package/dist/agents/channels/inbound-pipeline.js.map +1 -0
- package/dist/agents/channels/last-channel.d.ts +56 -0
- package/dist/agents/channels/last-channel.d.ts.map +1 -0
- package/dist/agents/channels/last-channel.js +65 -0
- package/dist/agents/channels/last-channel.js.map +1 -0
- package/dist/agents/channels/manager.d.ts +76 -0
- package/dist/agents/channels/manager.d.ts.map +1 -0
- package/dist/agents/channels/manager.js +132 -0
- package/dist/agents/channels/manager.js.map +1 -0
- package/dist/agents/channels/media-capture.d.ts +23 -0
- package/dist/agents/channels/media-capture.d.ts.map +1 -0
- package/dist/agents/channels/media-capture.js +40 -0
- package/dist/agents/channels/media-capture.js.map +1 -0
- package/dist/agents/channels/plugin-channel-manager-facade.d.ts +18 -0
- package/dist/agents/channels/plugin-channel-manager-facade.d.ts.map +1 -0
- package/dist/agents/channels/plugin-channel-manager-facade.js +52 -0
- package/dist/agents/channels/plugin-channel-manager-facade.js.map +1 -0
- package/dist/agents/channels/reply-sanitizer.d.ts +38 -0
- package/dist/agents/channels/reply-sanitizer.d.ts.map +1 -0
- package/dist/agents/channels/reply-sanitizer.js +94 -0
- package/dist/agents/channels/reply-sanitizer.js.map +1 -0
- package/dist/agents/channels/retryable-inbound.d.ts +31 -0
- package/dist/agents/channels/retryable-inbound.d.ts.map +1 -0
- package/dist/agents/channels/retryable-inbound.js +37 -0
- package/dist/agents/channels/retryable-inbound.js.map +1 -0
- package/dist/agents/channels/types.adapters.d.ts +399 -0
- package/dist/agents/channels/types.adapters.d.ts.map +1 -0
- package/dist/agents/channels/types.adapters.js +33 -0
- package/dist/agents/channels/types.adapters.js.map +1 -0
- package/dist/agents/channels/types.core.d.ts +134 -0
- package/dist/agents/channels/types.core.d.ts.map +1 -0
- package/dist/agents/channels/types.core.js +32 -0
- package/dist/agents/channels/types.core.js.map +1 -0
- package/dist/agents/channels/types.plugin.d.ts +78 -0
- package/dist/agents/channels/types.plugin.d.ts.map +1 -0
- package/dist/agents/channels/types.plugin.js +30 -0
- package/dist/agents/channels/types.plugin.js.map +1 -0
- package/dist/agents/channels/whatsapp/account-config.d.ts +50 -0
- package/dist/agents/channels/whatsapp/account-config.d.ts.map +1 -0
- package/dist/agents/channels/whatsapp/account-config.js +105 -0
- package/dist/agents/channels/whatsapp/account-config.js.map +1 -0
- package/dist/agents/channels/whatsapp/adapter.d.ts +22 -0
- package/dist/agents/channels/whatsapp/adapter.d.ts.map +1 -0
- package/dist/agents/channels/whatsapp/adapter.js +270 -0
- package/dist/agents/channels/whatsapp/adapter.js.map +1 -0
- package/dist/agents/channels/whatsapp/chunk.d.ts +26 -0
- package/dist/agents/channels/whatsapp/chunk.d.ts.map +1 -0
- package/dist/agents/channels/whatsapp/chunk.js +123 -0
- package/dist/agents/channels/whatsapp/chunk.js.map +1 -0
- package/dist/agents/channels/whatsapp/connection.d.ts +249 -0
- package/dist/agents/channels/whatsapp/connection.d.ts.map +1 -0
- package/dist/agents/channels/whatsapp/connection.js +1628 -0
- package/dist/agents/channels/whatsapp/connection.js.map +1 -0
- package/dist/agents/channels/whatsapp/convex-auth-state.d.ts +34 -0
- package/dist/agents/channels/whatsapp/convex-auth-state.d.ts.map +1 -0
- package/dist/agents/channels/whatsapp/convex-auth-state.js +168 -0
- package/dist/agents/channels/whatsapp/convex-auth-state.js.map +1 -0
- package/dist/agents/channels/whatsapp/format.d.ts +15 -0
- package/dist/agents/channels/whatsapp/format.d.ts.map +1 -0
- package/dist/agents/channels/whatsapp/format.js +66 -0
- package/dist/agents/channels/whatsapp/format.js.map +1 -0
- package/dist/agents/channels/whatsapp/inbound-extras.d.ts +30 -0
- package/dist/agents/channels/whatsapp/inbound-extras.d.ts.map +1 -0
- package/dist/agents/channels/whatsapp/inbound-extras.js +146 -0
- package/dist/agents/channels/whatsapp/inbound-extras.js.map +1 -0
- package/dist/agents/channels/whatsapp/index.d.ts +7 -0
- package/dist/agents/channels/whatsapp/index.d.ts.map +1 -0
- package/dist/agents/channels/whatsapp/index.js +7 -0
- package/dist/agents/channels/whatsapp/index.js.map +1 -0
- package/dist/agents/channels/whatsapp/media.d.ts +47 -0
- package/dist/agents/channels/whatsapp/media.d.ts.map +1 -0
- package/dist/agents/channels/whatsapp/media.js +192 -0
- package/dist/agents/channels/whatsapp/media.js.map +1 -0
- package/dist/agents/channels/whatsapp/module.d.ts +10 -0
- package/dist/agents/channels/whatsapp/module.d.ts.map +1 -0
- package/dist/agents/channels/whatsapp/module.js +17 -0
- package/dist/agents/channels/whatsapp/module.js.map +1 -0
- package/dist/agents/channels/whatsapp/plugin.d.ts +60 -0
- package/dist/agents/channels/whatsapp/plugin.d.ts.map +1 -0
- package/dist/agents/channels/whatsapp/plugin.js +238 -0
- package/dist/agents/channels/whatsapp/plugin.js.map +1 -0
- package/dist/agents/cmd-ism-guard.d.ts +47 -0
- package/dist/agents/cmd-ism-guard.d.ts.map +1 -0
- package/dist/agents/cmd-ism-guard.js +100 -0
- package/dist/agents/cmd-ism-guard.js.map +1 -0
- package/dist/agents/config-write-guard.d.ts +25 -0
- package/dist/agents/config-write-guard.d.ts.map +1 -0
- package/dist/agents/config-write-guard.js +95 -0
- package/dist/agents/config-write-guard.js.map +1 -0
- package/dist/agents/content-quality-retry.d.ts +66 -0
- package/dist/agents/content-quality-retry.d.ts.map +1 -0
- package/dist/agents/content-quality-retry.js +140 -0
- package/dist/agents/content-quality-retry.js.map +1 -0
- package/dist/agents/error-classifier.d.ts +89 -0
- package/dist/agents/error-classifier.d.ts.map +1 -0
- package/dist/agents/error-classifier.js +630 -0
- package/dist/agents/error-classifier.js.map +1 -0
- package/dist/agents/exec-gate.d.ts +113 -0
- package/dist/agents/exec-gate.d.ts.map +1 -0
- package/dist/agents/exec-gate.js +335 -0
- package/dist/agents/exec-gate.js.map +1 -0
- package/dist/agents/exec-session-allow.d.ts +30 -0
- package/dist/agents/exec-session-allow.d.ts.map +1 -0
- package/dist/agents/exec-session-allow.js +50 -0
- package/dist/agents/exec-session-allow.js.map +1 -0
- package/dist/agents/extensions/active-registry.d.ts +4 -0
- package/dist/agents/extensions/active-registry.d.ts.map +1 -0
- package/dist/agents/extensions/active-registry.js +18 -0
- package/dist/agents/extensions/active-registry.js.map +1 -0
- package/dist/agents/extensions/discovery.d.ts +84 -0
- package/dist/agents/extensions/discovery.d.ts.map +1 -0
- package/dist/agents/extensions/discovery.js +249 -0
- package/dist/agents/extensions/discovery.js.map +1 -0
- package/dist/agents/extensions/hook-runner.d.ts +67 -0
- package/dist/agents/extensions/hook-runner.d.ts.map +1 -0
- package/dist/agents/extensions/hook-runner.js +155 -0
- package/dist/agents/extensions/hook-runner.js.map +1 -0
- package/dist/agents/extensions/index.d.ts +15 -0
- package/dist/agents/extensions/index.d.ts.map +1 -0
- package/dist/agents/extensions/index.js +14 -0
- package/dist/agents/extensions/index.js.map +1 -0
- package/dist/agents/extensions/loader.d.ts +38 -0
- package/dist/agents/extensions/loader.d.ts.map +1 -0
- package/dist/agents/extensions/loader.js +142 -0
- package/dist/agents/extensions/loader.js.map +1 -0
- package/dist/agents/extensions/modules/arxiv.d.ts +28 -0
- package/dist/agents/extensions/modules/arxiv.d.ts.map +1 -0
- package/dist/agents/extensions/modules/arxiv.js +145 -0
- package/dist/agents/extensions/modules/arxiv.js.map +1 -0
- package/dist/agents/extensions/modules/brave.d.ts +28 -0
- package/dist/agents/extensions/modules/brave.d.ts.map +1 -0
- package/dist/agents/extensions/modules/brave.js +489 -0
- package/dist/agents/extensions/modules/brave.js.map +1 -0
- package/dist/agents/extensions/modules/duckduckgo.d.ts +27 -0
- package/dist/agents/extensions/modules/duckduckgo.d.ts.map +1 -0
- package/dist/agents/extensions/modules/duckduckgo.js +263 -0
- package/dist/agents/extensions/modules/duckduckgo.js.map +1 -0
- package/dist/agents/extensions/modules/exa.d.ts +19 -0
- package/dist/agents/extensions/modules/exa.d.ts.map +1 -0
- package/dist/agents/extensions/modules/exa.js +208 -0
- package/dist/agents/extensions/modules/exa.js.map +1 -0
- package/dist/agents/extensions/modules/firecrawl.d.ts +51 -0
- package/dist/agents/extensions/modules/firecrawl.d.ts.map +1 -0
- package/dist/agents/extensions/modules/firecrawl.js +280 -0
- package/dist/agents/extensions/modules/firecrawl.js.map +1 -0
- package/dist/agents/extensions/modules/github-search.d.ts +29 -0
- package/dist/agents/extensions/modules/github-search.d.ts.map +1 -0
- package/dist/agents/extensions/modules/github-search.js +197 -0
- package/dist/agents/extensions/modules/github-search.js.map +1 -0
- package/dist/agents/extensions/modules/hackernews.d.ts +17 -0
- package/dist/agents/extensions/modules/hackernews.d.ts.map +1 -0
- package/dist/agents/extensions/modules/hackernews.js +144 -0
- package/dist/agents/extensions/modules/hackernews.js.map +1 -0
- package/dist/agents/extensions/modules/index.d.ts +11 -0
- package/dist/agents/extensions/modules/index.d.ts.map +1 -0
- package/dist/agents/extensions/modules/index.js +64 -0
- package/dist/agents/extensions/modules/index.js.map +1 -0
- package/dist/agents/extensions/modules/npm-search.d.ts +15 -0
- package/dist/agents/extensions/modules/npm-search.d.ts.map +1 -0
- package/dist/agents/extensions/modules/npm-search.js +126 -0
- package/dist/agents/extensions/modules/npm-search.js.map +1 -0
- package/dist/agents/extensions/modules/ollama-search.d.ts +30 -0
- package/dist/agents/extensions/modules/ollama-search.d.ts.map +1 -0
- package/dist/agents/extensions/modules/ollama-search.js +171 -0
- package/dist/agents/extensions/modules/ollama-search.js.map +1 -0
- package/dist/agents/extensions/modules/perplexity.d.ts +19 -0
- package/dist/agents/extensions/modules/perplexity.d.ts.map +1 -0
- package/dist/agents/extensions/modules/perplexity.js +358 -0
- package/dist/agents/extensions/modules/perplexity.js.map +1 -0
- package/dist/agents/extensions/modules/searxng.d.ts +43 -0
- package/dist/agents/extensions/modules/searxng.d.ts.map +1 -0
- package/dist/agents/extensions/modules/searxng.js +191 -0
- package/dist/agents/extensions/modules/searxng.js.map +1 -0
- package/dist/agents/extensions/modules/tavily.d.ts +71 -0
- package/dist/agents/extensions/modules/tavily.d.ts.map +1 -0
- package/dist/agents/extensions/modules/tavily.js +330 -0
- package/dist/agents/extensions/modules/tavily.js.map +1 -0
- package/dist/agents/extensions/modules/web-provider-helpers.d.ts +89 -0
- package/dist/agents/extensions/modules/web-provider-helpers.d.ts.map +1 -0
- package/dist/agents/extensions/modules/web-provider-helpers.js +146 -0
- package/dist/agents/extensions/modules/web-provider-helpers.js.map +1 -0
- package/dist/agents/extensions/modules/web-search-filters.d.ts +62 -0
- package/dist/agents/extensions/modules/web-search-filters.d.ts.map +1 -0
- package/dist/agents/extensions/modules/web-search-filters.js +179 -0
- package/dist/agents/extensions/modules/web-search-filters.js.map +1 -0
- package/dist/agents/extensions/modules/wikipedia.d.ts +16 -0
- package/dist/agents/extensions/modules/wikipedia.d.ts.map +1 -0
- package/dist/agents/extensions/modules/wikipedia.js +138 -0
- package/dist/agents/extensions/modules/wikipedia.js.map +1 -0
- package/dist/agents/extensions/registry-cache.d.ts +74 -0
- package/dist/agents/extensions/registry-cache.d.ts.map +1 -0
- package/dist/agents/extensions/registry-cache.js +117 -0
- package/dist/agents/extensions/registry-cache.js.map +1 -0
- package/dist/agents/extensions/registry.d.ts +184 -0
- package/dist/agents/extensions/registry.d.ts.map +1 -0
- package/dist/agents/extensions/registry.js +512 -0
- package/dist/agents/extensions/registry.js.map +1 -0
- package/dist/agents/extensions/types.d.ts +1195 -0
- package/dist/agents/extensions/types.d.ts.map +1 -0
- package/dist/agents/extensions/types.js +28 -0
- package/dist/agents/extensions/types.js.map +1 -0
- package/dist/agents/gateway-call.d.ts +171 -0
- package/dist/agents/gateway-call.d.ts.map +1 -0
- package/dist/agents/gateway-call.js +74 -0
- package/dist/agents/gateway-call.js.map +1 -0
- package/dist/agents/heartbeat-runner.d.ts +100 -0
- package/dist/agents/heartbeat-runner.d.ts.map +1 -0
- package/dist/agents/heartbeat-runner.js +268 -0
- package/dist/agents/heartbeat-runner.js.map +1 -0
- package/dist/agents/heartbeat-scheduler.d.ts +56 -0
- package/dist/agents/heartbeat-scheduler.d.ts.map +1 -0
- package/dist/agents/heartbeat-scheduler.js +366 -0
- package/dist/agents/heartbeat-scheduler.js.map +1 -0
- package/dist/agents/heartbeat-wake.d.ts +99 -0
- package/dist/agents/heartbeat-wake.d.ts.map +1 -0
- package/dist/agents/heartbeat-wake.js +304 -0
- package/dist/agents/heartbeat-wake.js.map +1 -0
- package/dist/agents/identity-file.d.ts +26 -0
- package/dist/agents/identity-file.d.ts.map +1 -0
- package/dist/agents/identity-file.js +86 -0
- package/dist/agents/identity-file.js.map +1 -0
- package/dist/agents/identity-links.d.ts +44 -0
- package/dist/agents/identity-links.d.ts.map +1 -0
- package/dist/agents/identity-links.js +51 -0
- package/dist/agents/identity-links.js.map +1 -0
- package/dist/agents/loop/autonomous-agent.d.ts +55 -0
- package/dist/agents/loop/autonomous-agent.d.ts.map +1 -0
- package/dist/agents/loop/autonomous-agent.js +91 -0
- package/dist/agents/loop/autonomous-agent.js.map +1 -0
- package/dist/agents/loop/loop-guards.d.ts +95 -0
- package/dist/agents/loop/loop-guards.d.ts.map +1 -0
- package/dist/agents/loop/loop-guards.js +169 -0
- package/dist/agents/loop/loop-guards.js.map +1 -0
- package/dist/agents/loop/loop-runner.d.ts +72 -0
- package/dist/agents/loop/loop-runner.d.ts.map +1 -0
- package/dist/agents/loop/loop-runner.js +114 -0
- package/dist/agents/loop/loop-runner.js.map +1 -0
- package/dist/agents/memory/auto-recall.d.ts +69 -0
- package/dist/agents/memory/auto-recall.d.ts.map +1 -0
- package/dist/agents/memory/auto-recall.js +147 -0
- package/dist/agents/memory/auto-recall.js.map +1 -0
- package/dist/agents/memory/behavior-review.d.ts +68 -0
- package/dist/agents/memory/behavior-review.d.ts.map +1 -0
- package/dist/agents/memory/behavior-review.js +131 -0
- package/dist/agents/memory/behavior-review.js.map +1 -0
- package/dist/agents/memory/consolidate.d.ts +62 -0
- package/dist/agents/memory/consolidate.d.ts.map +1 -0
- package/dist/agents/memory/consolidate.js +275 -0
- package/dist/agents/memory/consolidate.js.map +1 -0
- package/dist/agents/memory/contradiction.d.ts +44 -0
- package/dist/agents/memory/contradiction.d.ts.map +1 -0
- package/dist/agents/memory/contradiction.js +86 -0
- package/dist/agents/memory/contradiction.js.map +1 -0
- package/dist/agents/memory/curator.d.ts +22 -0
- package/dist/agents/memory/curator.d.ts.map +1 -0
- package/dist/agents/memory/curator.js +52 -0
- package/dist/agents/memory/curator.js.map +1 -0
- package/dist/agents/memory/decay.d.ts +32 -0
- package/dist/agents/memory/decay.d.ts.map +1 -0
- package/dist/agents/memory/decay.js +86 -0
- package/dist/agents/memory/decay.js.map +1 -0
- package/dist/agents/memory/dream.d.ts +52 -0
- package/dist/agents/memory/dream.d.ts.map +1 -0
- package/dist/agents/memory/dream.js +192 -0
- package/dist/agents/memory/dream.js.map +1 -0
- package/dist/agents/memory/embedder-providers.d.ts +114 -0
- package/dist/agents/memory/embedder-providers.d.ts.map +1 -0
- package/dist/agents/memory/embedder-providers.js +213 -0
- package/dist/agents/memory/embedder-providers.js.map +1 -0
- package/dist/agents/memory/embedder.d.ts +84 -0
- package/dist/agents/memory/embedder.d.ts.map +1 -0
- package/dist/agents/memory/embedder.js +218 -0
- package/dist/agents/memory/embedder.js.map +1 -0
- package/dist/agents/memory/eval/asr-bench.d.ts +33 -0
- package/dist/agents/memory/eval/asr-bench.d.ts.map +1 -0
- package/dist/agents/memory/eval/asr-bench.js +129 -0
- package/dist/agents/memory/eval/asr-bench.js.map +1 -0
- package/dist/agents/memory/eval/capabilities.d.ts +97 -0
- package/dist/agents/memory/eval/capabilities.d.ts.map +1 -0
- package/dist/agents/memory/eval/capabilities.js +210 -0
- package/dist/agents/memory/eval/capabilities.js.map +1 -0
- package/dist/agents/memory/eval/gold-export.d.ts +44 -0
- package/dist/agents/memory/eval/gold-export.d.ts.map +1 -0
- package/dist/agents/memory/eval/gold-export.js +85 -0
- package/dist/agents/memory/eval/gold-export.js.map +1 -0
- package/dist/agents/memory/eval/gold-hard.d.ts +35 -0
- package/dist/agents/memory/eval/gold-hard.d.ts.map +1 -0
- package/dist/agents/memory/eval/gold-hard.js +113 -0
- package/dist/agents/memory/eval/gold-hard.js.map +1 -0
- package/dist/agents/memory/eval/gold-rich.d.ts +33 -0
- package/dist/agents/memory/eval/gold-rich.d.ts.map +1 -0
- package/dist/agents/memory/eval/gold-rich.js +82 -0
- package/dist/agents/memory/eval/gold-rich.js.map +1 -0
- package/dist/agents/memory/eval/gold-synthetic.d.ts +19 -0
- package/dist/agents/memory/eval/gold-synthetic.d.ts.map +1 -0
- package/dist/agents/memory/eval/gold-synthetic.js +65 -0
- package/dist/agents/memory/eval/gold-synthetic.js.map +1 -0
- package/dist/agents/memory/eval/gold.d.ts +73 -0
- package/dist/agents/memory/eval/gold.d.ts.map +1 -0
- package/dist/agents/memory/eval/gold.js +174 -0
- package/dist/agents/memory/eval/gold.js.map +1 -0
- package/dist/agents/memory/eval/harness.d.ts +110 -0
- package/dist/agents/memory/eval/harness.d.ts.map +1 -0
- package/dist/agents/memory/eval/harness.js +123 -0
- package/dist/agents/memory/eval/harness.js.map +1 -0
- package/dist/agents/memory/eval/metrics.d.ts +71 -0
- package/dist/agents/memory/eval/metrics.d.ts.map +1 -0
- package/dist/agents/memory/eval/metrics.js +169 -0
- package/dist/agents/memory/eval/metrics.js.map +1 -0
- package/dist/agents/memory/event-log.d.ts +52 -0
- package/dist/agents/memory/event-log.d.ts.map +1 -0
- package/dist/agents/memory/event-log.js +65 -0
- package/dist/agents/memory/event-log.js.map +1 -0
- package/dist/agents/memory/extract.d.ts +155 -0
- package/dist/agents/memory/extract.d.ts.map +1 -0
- package/dist/agents/memory/extract.js +571 -0
- package/dist/agents/memory/extract.js.map +1 -0
- package/dist/agents/memory/governance.d.ts +45 -0
- package/dist/agents/memory/governance.d.ts.map +1 -0
- package/dist/agents/memory/governance.js +113 -0
- package/dist/agents/memory/governance.js.map +1 -0
- package/dist/agents/memory/graph-export.d.ts +59 -0
- package/dist/agents/memory/graph-export.d.ts.map +1 -0
- package/dist/agents/memory/graph-export.js +181 -0
- package/dist/agents/memory/graph-export.js.map +1 -0
- package/dist/agents/memory/graph-recall.d.ts +42 -0
- package/dist/agents/memory/graph-recall.d.ts.map +1 -0
- package/dist/agents/memory/graph-recall.js +165 -0
- package/dist/agents/memory/graph-recall.js.map +1 -0
- package/dist/agents/memory/graph.d.ts +92 -0
- package/dist/agents/memory/graph.d.ts.map +1 -0
- package/dist/agents/memory/graph.js +266 -0
- package/dist/agents/memory/graph.js.map +1 -0
- package/dist/agents/memory/host-ports.d.ts +27 -0
- package/dist/agents/memory/host-ports.d.ts.map +1 -0
- package/dist/agents/memory/host-ports.js +31 -0
- package/dist/agents/memory/host-ports.js.map +1 -0
- package/dist/agents/memory/hybrid.d.ts +46 -0
- package/dist/agents/memory/hybrid.d.ts.map +1 -0
- package/dist/agents/memory/hybrid.js +184 -0
- package/dist/agents/memory/hybrid.js.map +1 -0
- package/dist/agents/memory/index.d.ts +13 -0
- package/dist/agents/memory/index.d.ts.map +1 -0
- package/dist/agents/memory/index.js +13 -0
- package/dist/agents/memory/index.js.map +1 -0
- package/dist/agents/memory/json-scan.d.ts +14 -0
- package/dist/agents/memory/json-scan.d.ts.map +1 -0
- package/dist/agents/memory/json-scan.js +47 -0
- package/dist/agents/memory/json-scan.js.map +1 -0
- package/dist/agents/memory/links.d.ts +92 -0
- package/dist/agents/memory/links.d.ts.map +1 -0
- package/dist/agents/memory/links.js +140 -0
- package/dist/agents/memory/links.js.map +1 -0
- package/dist/agents/memory/maintenance.d.ts +18 -0
- package/dist/agents/memory/maintenance.d.ts.map +1 -0
- package/dist/agents/memory/maintenance.js +66 -0
- package/dist/agents/memory/maintenance.js.map +1 -0
- package/dist/agents/memory/memory-mcp-server.d.ts +39 -0
- package/dist/agents/memory/memory-mcp-server.d.ts.map +1 -0
- package/dist/agents/memory/memory-mcp-server.js +122 -0
- package/dist/agents/memory/memory-mcp-server.js.map +1 -0
- package/dist/agents/memory/memory-mcp.d.ts +34 -0
- package/dist/agents/memory/memory-mcp.d.ts.map +1 -0
- package/dist/agents/memory/memory-mcp.js +130 -0
- package/dist/agents/memory/memory-mcp.js.map +1 -0
- package/dist/agents/memory/plugin-runtime.d.ts +133 -0
- package/dist/agents/memory/plugin-runtime.d.ts.map +1 -0
- package/dist/agents/memory/plugin-runtime.js +149 -0
- package/dist/agents/memory/plugin-runtime.js.map +1 -0
- package/dist/agents/memory/query.d.ts +50 -0
- package/dist/agents/memory/query.d.ts.map +1 -0
- package/dist/agents/memory/query.js +94 -0
- package/dist/agents/memory/query.js.map +1 -0
- package/dist/agents/memory/records.d.ts +617 -0
- package/dist/agents/memory/records.d.ts.map +1 -0
- package/dist/agents/memory/records.js +1327 -0
- package/dist/agents/memory/records.js.map +1 -0
- package/dist/agents/memory/reembed.d.ts +42 -0
- package/dist/agents/memory/reembed.d.ts.map +1 -0
- package/dist/agents/memory/reembed.js +60 -0
- package/dist/agents/memory/reembed.js.map +1 -0
- package/dist/agents/memory/relationship-extract.d.ts +259 -0
- package/dist/agents/memory/relationship-extract.d.ts.map +1 -0
- package/dist/agents/memory/relationship-extract.js +454 -0
- package/dist/agents/memory/relationship-extract.js.map +1 -0
- package/dist/agents/memory/rerank.d.ts +37 -0
- package/dist/agents/memory/rerank.d.ts.map +1 -0
- package/dist/agents/memory/rerank.js +43 -0
- package/dist/agents/memory/rerank.js.map +1 -0
- package/dist/agents/memory/scoring.d.ts +85 -0
- package/dist/agents/memory/scoring.d.ts.map +1 -0
- package/dist/agents/memory/scoring.js +139 -0
- package/dist/agents/memory/scoring.js.map +1 -0
- package/dist/agents/memory/self-improve.d.ts +56 -0
- package/dist/agents/memory/self-improve.d.ts.map +1 -0
- package/dist/agents/memory/self-improve.js +98 -0
- package/dist/agents/memory/self-improve.js.map +1 -0
- package/dist/agents/memory/self-review.d.ts +68 -0
- package/dist/agents/memory/self-review.d.ts.map +1 -0
- package/dist/agents/memory/self-review.js +109 -0
- package/dist/agents/memory/self-review.js.map +1 -0
- package/dist/agents/memory/storage.d.ts +156 -0
- package/dist/agents/memory/storage.d.ts.map +1 -0
- package/dist/agents/memory/storage.js +359 -0
- package/dist/agents/memory/storage.js.map +1 -0
- package/dist/agents/memory/tideline.d.ts +203 -0
- package/dist/agents/memory/tideline.d.ts.map +1 -0
- package/dist/agents/memory/tideline.js +189 -0
- package/dist/agents/memory/tideline.js.map +1 -0
- package/dist/agents/memory/vault.d.ts +142 -0
- package/dist/agents/memory/vault.d.ts.map +1 -0
- package/dist/agents/memory/vault.js +787 -0
- package/dist/agents/memory/vault.js.map +1 -0
- package/dist/agents/memory/write-gate.d.ts +76 -0
- package/dist/agents/memory/write-gate.d.ts.map +1 -0
- package/dist/agents/memory/write-gate.js +140 -0
- package/dist/agents/memory/write-gate.js.map +1 -0
- package/dist/agents/mid-turn-switch.d.ts +25 -0
- package/dist/agents/mid-turn-switch.d.ts.map +1 -0
- package/dist/agents/mid-turn-switch.js +103 -0
- package/dist/agents/mid-turn-switch.js.map +1 -0
- package/dist/agents/model-fallback.d.ts +50 -0
- package/dist/agents/model-fallback.d.ts.map +1 -0
- package/dist/agents/model-fallback.js +226 -0
- package/dist/agents/model-fallback.js.map +1 -0
- package/dist/agents/model-resolution.d.ts +38 -0
- package/dist/agents/model-resolution.d.ts.map +1 -0
- package/dist/agents/model-resolution.js +155 -0
- package/dist/agents/model-resolution.js.map +1 -0
- package/dist/agents/org/a2a-adapter.d.ts +49 -0
- package/dist/agents/org/a2a-adapter.d.ts.map +1 -0
- package/dist/agents/org/a2a-adapter.js +92 -0
- package/dist/agents/org/a2a-adapter.js.map +1 -0
- package/dist/agents/org/assets/mascots/README.md +34 -0
- package/dist/agents/org/assets/mascots/Untitled-1.png +0 -0
- package/dist/agents/org/assets/mascots/brigade_biceps.png +0 -0
- package/dist/agents/org/audit-log.d.ts +22 -0
- package/dist/agents/org/audit-log.d.ts.map +1 -0
- package/dist/agents/org/audit-log.js +37 -0
- package/dist/agents/org/audit-log.js.map +1 -0
- package/dist/agents/org/auto-derive.d.ts +22 -0
- package/dist/agents/org/auto-derive.d.ts.map +1 -0
- package/dist/agents/org/auto-derive.js +66 -0
- package/dist/agents/org/auto-derive.js.map +1 -0
- package/dist/agents/org/delivery-kind.d.ts +89 -0
- package/dist/agents/org/delivery-kind.d.ts.map +1 -0
- package/dist/agents/org/delivery-kind.js +149 -0
- package/dist/agents/org/delivery-kind.js.map +1 -0
- package/dist/agents/org/derive-graph.d.ts +34 -0
- package/dist/agents/org/derive-graph.d.ts.map +1 -0
- package/dist/agents/org/derive-graph.js +266 -0
- package/dist/agents/org/derive-graph.js.map +1 -0
- package/dist/agents/org/lints.d.ts +21 -0
- package/dist/agents/org/lints.d.ts.map +1 -0
- package/dist/agents/org/lints.js +133 -0
- package/dist/agents/org/lints.js.map +1 -0
- package/dist/agents/org/pride-html.d.ts +61 -0
- package/dist/agents/org/pride-html.d.ts.map +1 -0
- package/dist/agents/org/pride-html.js +565 -0
- package/dist/agents/org/pride-html.js.map +1 -0
- package/dist/agents/org/pride-image.d.ts +101 -0
- package/dist/agents/org/pride-image.d.ts.map +1 -0
- package/dist/agents/org/pride-image.js +210 -0
- package/dist/agents/org/pride-image.js.map +1 -0
- package/dist/agents/org/pride-taunts.d.ts +47 -0
- package/dist/agents/org/pride-taunts.d.ts.map +1 -0
- package/dist/agents/org/pride-taunts.js +411 -0
- package/dist/agents/org/pride-taunts.js.map +1 -0
- package/dist/agents/org/pride-template.d.ts +272 -0
- package/dist/agents/org/pride-template.d.ts.map +1 -0
- package/dist/agents/org/pride-template.js +892 -0
- package/dist/agents/org/pride-template.js.map +1 -0
- package/dist/agents/org/pride-themes.d.ts +80 -0
- package/dist/agents/org/pride-themes.d.ts.map +1 -0
- package/dist/agents/org/pride-themes.js +7596 -0
- package/dist/agents/org/pride-themes.js.map +1 -0
- package/dist/agents/org/structured-errors.d.ts +47 -0
- package/dist/agents/org/structured-errors.d.ts.map +1 -0
- package/dist/agents/org/structured-errors.js +97 -0
- package/dist/agents/org/structured-errors.js.map +1 -0
- package/dist/agents/org/types.d.ts +139 -0
- package/dist/agents/org/types.d.ts.map +1 -0
- package/dist/agents/org/types.js +43 -0
- package/dist/agents/org/types.js.map +1 -0
- package/dist/agents/org/validate.d.ts +36 -0
- package/dist/agents/org/validate.d.ts.map +1 -0
- package/dist/agents/org/validate.js +135 -0
- package/dist/agents/org/validate.js.map +1 -0
- package/dist/agents/path-write-guard.d.ts +82 -0
- package/dist/agents/path-write-guard.d.ts.map +1 -0
- package/dist/agents/path-write-guard.js +722 -0
- package/dist/agents/path-write-guard.js.map +1 -0
- package/dist/agents/payload-mutators.d.ts +175 -0
- package/dist/agents/payload-mutators.d.ts.map +1 -0
- package/dist/agents/payload-mutators.js +994 -0
- package/dist/agents/payload-mutators.js.map +1 -0
- package/dist/agents/pending-system-events.d.ts +76 -0
- package/dist/agents/pending-system-events.d.ts.map +1 -0
- package/dist/agents/pending-system-events.js +115 -0
- package/dist/agents/pending-system-events.js.map +1 -0
- package/dist/agents/provider-attribution.d.ts +19 -0
- package/dist/agents/provider-attribution.d.ts.map +1 -0
- package/dist/agents/provider-attribution.js +62 -0
- package/dist/agents/provider-attribution.js.map +1 -0
- package/dist/agents/quality/slop-detector.d.ts +40 -0
- package/dist/agents/quality/slop-detector.d.ts.map +1 -0
- package/dist/agents/quality/slop-detector.js +108 -0
- package/dist/agents/quality/slop-detector.js.map +1 -0
- package/dist/agents/quality/slop-index.d.ts +27 -0
- package/dist/agents/quality/slop-index.d.ts.map +1 -0
- package/dist/agents/quality/slop-index.js +124 -0
- package/dist/agents/quality/slop-index.js.map +1 -0
- package/dist/agents/retry-policy.d.ts +38 -0
- package/dist/agents/retry-policy.d.ts.map +1 -0
- package/dist/agents/retry-policy.js +276 -0
- package/dist/agents/retry-policy.js.map +1 -0
- package/dist/agents/routing/account-id.d.ts +43 -0
- package/dist/agents/routing/account-id.d.ts.map +1 -0
- package/dist/agents/routing/account-id.js +103 -0
- package/dist/agents/routing/account-id.js.map +1 -0
- package/dist/agents/routing/bindings.d.ts +20 -0
- package/dist/agents/routing/bindings.d.ts.map +1 -0
- package/dist/agents/routing/bindings.js +22 -0
- package/dist/agents/routing/bindings.js.map +1 -0
- package/dist/agents/routing/dm-scope-warning.d.ts +37 -0
- package/dist/agents/routing/dm-scope-warning.d.ts.map +1 -0
- package/dist/agents/routing/dm-scope-warning.js +110 -0
- package/dist/agents/routing/dm-scope-warning.js.map +1 -0
- package/dist/agents/routing/identity-links.d.ts +45 -0
- package/dist/agents/routing/identity-links.d.ts.map +1 -0
- package/dist/agents/routing/identity-links.js +85 -0
- package/dist/agents/routing/identity-links.js.map +1 -0
- package/dist/agents/routing/resolve-route.d.ts +91 -0
- package/dist/agents/routing/resolve-route.d.ts.map +1 -0
- package/dist/agents/routing/resolve-route.js +653 -0
- package/dist/agents/routing/resolve-route.js.map +1 -0
- package/dist/agents/routing/session-key.d.ts +168 -0
- package/dist/agents/routing/session-key.d.ts.map +1 -0
- package/dist/agents/routing/session-key.js +268 -0
- package/dist/agents/routing/session-key.js.map +1 -0
- package/dist/agents/sanitize-surrogates.d.ts +30 -0
- package/dist/agents/sanitize-surrogates.d.ts.map +1 -0
- package/dist/agents/sanitize-surrogates.js +56 -0
- package/dist/agents/sanitize-surrogates.js.map +1 -0
- package/dist/agents/session-context.d.ts +80 -0
- package/dist/agents/session-context.d.ts.map +1 -0
- package/dist/agents/session-context.js +76 -0
- package/dist/agents/session-context.js.map +1 -0
- package/dist/agents/session-event-prompt.d.ts +124 -0
- package/dist/agents/session-event-prompt.d.ts.map +1 -0
- package/dist/agents/session-event-prompt.js +179 -0
- package/dist/agents/session-event-prompt.js.map +1 -0
- package/dist/agents/session-inbox.d.ts +129 -0
- package/dist/agents/session-inbox.d.ts.map +1 -0
- package/dist/agents/session-inbox.js +492 -0
- package/dist/agents/session-inbox.js.map +1 -0
- package/dist/agents/session-registry.d.ts +148 -0
- package/dist/agents/session-registry.d.ts.map +1 -0
- package/dist/agents/session-registry.js +405 -0
- package/dist/agents/session-registry.js.map +1 -0
- package/dist/agents/session-wiring.d.ts +214 -0
- package/dist/agents/session-wiring.d.ts.map +1 -0
- package/dist/agents/session-wiring.js +278 -0
- package/dist/agents/session-wiring.js.map +1 -0
- package/dist/agents/session-write-lock.d.ts +15 -0
- package/dist/agents/session-write-lock.d.ts.map +1 -0
- package/dist/agents/session-write-lock.js +15 -0
- package/dist/agents/session-write-lock.js.map +1 -0
- package/dist/agents/skills/agent-filter.d.ts +43 -0
- package/dist/agents/skills/agent-filter.d.ts.map +1 -0
- package/dist/agents/skills/agent-filter.js +89 -0
- package/dist/agents/skills/agent-filter.js.map +1 -0
- package/dist/agents/skills/discovery.d.ts +97 -0
- package/dist/agents/skills/discovery.d.ts.map +1 -0
- package/dist/agents/skills/discovery.js +136 -0
- package/dist/agents/skills/discovery.js.map +1 -0
- package/dist/agents/skills/eligibility.d.ts +118 -0
- package/dist/agents/skills/eligibility.d.ts.map +1 -0
- package/dist/agents/skills/eligibility.js +280 -0
- package/dist/agents/skills/eligibility.js.map +1 -0
- package/dist/agents/skills/grant.d.ts +70 -0
- package/dist/agents/skills/grant.d.ts.map +1 -0
- package/dist/agents/skills/grant.js +106 -0
- package/dist/agents/skills/grant.js.map +1 -0
- package/dist/agents/skills/index.d.ts +35 -0
- package/dist/agents/skills/index.d.ts.map +1 -0
- package/dist/agents/skills/index.js +88 -0
- package/dist/agents/skills/index.js.map +1 -0
- package/dist/agents/skills/install-spec.d.ts +51 -0
- package/dist/agents/skills/install-spec.d.ts.map +1 -0
- package/dist/agents/skills/install-spec.js +21 -0
- package/dist/agents/skills/install-spec.js.map +1 -0
- package/dist/agents/skills/install.d.ts +68 -0
- package/dist/agents/skills/install.d.ts.map +1 -0
- package/dist/agents/skills/install.js +206 -0
- package/dist/agents/skills/install.js.map +1 -0
- package/dist/agents/skills/org-access.d.ts +27 -0
- package/dist/agents/skills/org-access.d.ts.map +1 -0
- package/dist/agents/skills/org-access.js +87 -0
- package/dist/agents/skills/org-access.js.map +1 -0
- package/dist/agents/skills/skill-consolidate.d.ts +76 -0
- package/dist/agents/skills/skill-consolidate.d.ts.map +1 -0
- package/dist/agents/skills/skill-consolidate.js +264 -0
- package/dist/agents/skills/skill-consolidate.js.map +1 -0
- package/dist/agents/skills/skill-curator.d.ts +91 -0
- package/dist/agents/skills/skill-curator.d.ts.map +1 -0
- package/dist/agents/skills/skill-curator.js +239 -0
- package/dist/agents/skills/skill-curator.js.map +1 -0
- package/dist/agents/skills/skill-manifest.d.ts +35 -0
- package/dist/agents/skills/skill-manifest.d.ts.map +1 -0
- package/dist/agents/skills/skill-manifest.js +82 -0
- package/dist/agents/skills/skill-manifest.js.map +1 -0
- package/dist/agents/skills/skill-review.d.ts +91 -0
- package/dist/agents/skills/skill-review.d.ts.map +1 -0
- package/dist/agents/skills/skill-review.js +271 -0
- package/dist/agents/skills/skill-review.js.map +1 -0
- package/dist/agents/skills/skill-usage.d.ts +81 -0
- package/dist/agents/skills/skill-usage.d.ts.map +1 -0
- package/dist/agents/skills/skill-usage.js +208 -0
- package/dist/agents/skills/skill-usage.js.map +1 -0
- package/dist/agents/skills/status.d.ts +68 -0
- package/dist/agents/skills/status.d.ts.map +1 -0
- package/dist/agents/skills/status.js +147 -0
- package/dist/agents/skills/status.js.map +1 -0
- package/dist/agents/skills/update-config.d.ts +32 -0
- package/dist/agents/skills/update-config.d.ts.map +1 -0
- package/dist/agents/skills/update-config.js +53 -0
- package/dist/agents/skills/update-config.js.map +1 -0
- package/dist/agents/slash-commands.d.ts +25 -0
- package/dist/agents/slash-commands.d.ts.map +1 -0
- package/dist/agents/slash-commands.js +151 -0
- package/dist/agents/slash-commands.js.map +1 -0
- package/dist/agents/smart-compaction.d.ts +105 -0
- package/dist/agents/smart-compaction.d.ts.map +1 -0
- package/dist/agents/smart-compaction.js +355 -0
- package/dist/agents/smart-compaction.js.map +1 -0
- package/dist/agents/stream-wrappers.d.ts +20 -0
- package/dist/agents/stream-wrappers.d.ts.map +1 -0
- package/dist/agents/stream-wrappers.js +307 -0
- package/dist/agents/stream-wrappers.js.map +1 -0
- package/dist/agents/subagent-abort-cascade.d.ts +31 -0
- package/dist/agents/subagent-abort-cascade.d.ts.map +1 -0
- package/dist/agents/subagent-abort-cascade.js +124 -0
- package/dist/agents/subagent-abort-cascade.js.map +1 -0
- package/dist/agents/subagent-announce-delivery.d.ts +83 -0
- package/dist/agents/subagent-announce-delivery.d.ts.map +1 -0
- package/dist/agents/subagent-announce-delivery.js +159 -0
- package/dist/agents/subagent-announce-delivery.js.map +1 -0
- package/dist/agents/subagent-budget.d.ts +36 -0
- package/dist/agents/subagent-budget.d.ts.map +1 -0
- package/dist/agents/subagent-budget.js +93 -0
- package/dist/agents/subagent-budget.js.map +1 -0
- package/dist/agents/subagent-completion-bridge.d.ts +42 -0
- package/dist/agents/subagent-completion-bridge.d.ts.map +1 -0
- package/dist/agents/subagent-completion-bridge.js +338 -0
- package/dist/agents/subagent-completion-bridge.js.map +1 -0
- package/dist/agents/subagent-lifecycle-events.d.ts +31 -0
- package/dist/agents/subagent-lifecycle-events.d.ts.map +1 -0
- package/dist/agents/subagent-lifecycle-events.js +21 -0
- package/dist/agents/subagent-lifecycle-events.js.map +1 -0
- package/dist/agents/subagent-policy.d.ts +206 -0
- package/dist/agents/subagent-policy.d.ts.map +1 -0
- package/dist/agents/subagent-policy.js +295 -0
- package/dist/agents/subagent-policy.js.map +1 -0
- package/dist/agents/subagent-registry-completion.d.ts +69 -0
- package/dist/agents/subagent-registry-completion.d.ts.map +1 -0
- package/dist/agents/subagent-registry-completion.js +128 -0
- package/dist/agents/subagent-registry-completion.js.map +1 -0
- package/dist/agents/subagent-registry.d.ts +85 -0
- package/dist/agents/subagent-registry.d.ts.map +1 -0
- package/dist/agents/subagent-registry.js +215 -0
- package/dist/agents/subagent-registry.js.map +1 -0
- package/dist/agents/subagent-registry.types.d.ts +94 -0
- package/dist/agents/subagent-registry.types.d.ts.map +1 -0
- package/dist/agents/subagent-registry.types.js +19 -0
- package/dist/agents/subagent-registry.types.js.map +1 -0
- package/dist/agents/subagent-runner.d.ts +75 -0
- package/dist/agents/subagent-runner.d.ts.map +1 -0
- package/dist/agents/subagent-runner.js +358 -0
- package/dist/agents/subagent-runner.js.map +1 -0
- package/dist/agents/subagent-spawn-abort-marker.d.ts +46 -0
- package/dist/agents/subagent-spawn-abort-marker.d.ts.map +1 -0
- package/dist/agents/subagent-spawn-abort-marker.js +81 -0
- package/dist/agents/subagent-spawn-abort-marker.js.map +1 -0
- package/dist/agents/subagent-spawn.d.ts +104 -0
- package/dist/agents/subagent-spawn.d.ts.map +1 -0
- package/dist/agents/subagent-spawn.js +358 -0
- package/dist/agents/subagent-spawn.js.map +1 -0
- package/dist/agents/thinking-fallback.d.ts +49 -0
- package/dist/agents/thinking-fallback.d.ts.map +1 -0
- package/dist/agents/thinking-fallback.js +97 -0
- package/dist/agents/thinking-fallback.js.map +1 -0
- package/dist/agents/tool-guard.d.ts +71 -0
- package/dist/agents/tool-guard.d.ts.map +1 -0
- package/dist/agents/tool-guard.js +154 -0
- package/dist/agents/tool-guard.js.map +1 -0
- package/dist/agents/tool-loop-detector.d.ts +115 -0
- package/dist/agents/tool-loop-detector.d.ts.map +1 -0
- package/dist/agents/tool-loop-detector.js +0 -0
- package/dist/agents/tool-loop-detector.js.map +1 -0
- package/dist/agents/tool-summaries.d.ts +3 -0
- package/dist/agents/tool-summaries.d.ts.map +1 -0
- package/dist/agents/tool-summaries.js +78 -0
- package/dist/agents/tool-summaries.js.map +1 -0
- package/dist/agents/tools/agents-list-tool.d.ts +51 -0
- package/dist/agents/tools/agents-list-tool.d.ts.map +1 -0
- package/dist/agents/tools/agents-list-tool.js +167 -0
- package/dist/agents/tools/agents-list-tool.js.map +1 -0
- package/dist/agents/tools/browser.d.ts +144 -0
- package/dist/agents/tools/browser.d.ts.map +1 -0
- package/dist/agents/tools/browser.js +1538 -0
- package/dist/agents/tools/browser.js.map +1 -0
- package/dist/agents/tools/common.d.ts +208 -0
- package/dist/agents/tools/common.d.ts.map +1 -0
- package/dist/agents/tools/common.js +405 -0
- package/dist/agents/tools/common.js.map +1 -0
- package/dist/agents/tools/composio-tool.d.ts +179 -0
- package/dist/agents/tools/composio-tool.d.ts.map +1 -0
- package/dist/agents/tools/composio-tool.js +474 -0
- package/dist/agents/tools/composio-tool.js.map +1 -0
- package/dist/agents/tools/cron-tool.d.ts +187 -0
- package/dist/agents/tools/cron-tool.d.ts.map +1 -0
- package/dist/agents/tools/cron-tool.js +985 -0
- package/dist/agents/tools/cron-tool.js.map +1 -0
- package/dist/agents/tools/find-tool.d.ts +55 -0
- package/dist/agents/tools/find-tool.d.ts.map +1 -0
- package/dist/agents/tools/find-tool.js +163 -0
- package/dist/agents/tools/find-tool.js.map +1 -0
- package/dist/agents/tools/generate-image-tool.d.ts +77 -0
- package/dist/agents/tools/generate-image-tool.d.ts.map +1 -0
- package/dist/agents/tools/generate-image-tool.js +421 -0
- package/dist/agents/tools/generate-image-tool.js.map +1 -0
- package/dist/agents/tools/index.d.ts +14 -0
- package/dist/agents/tools/index.d.ts.map +1 -0
- package/dist/agents/tools/index.js +12 -0
- package/dist/agents/tools/index.js.map +1 -0
- package/dist/agents/tools/manage-access-tool.d.ts +64 -0
- package/dist/agents/tools/manage-access-tool.d.ts.map +1 -0
- package/dist/agents/tools/manage-access-tool.js +188 -0
- package/dist/agents/tools/manage-access-tool.js.map +1 -0
- package/dist/agents/tools/manage-agent-tool.d.ts +50 -0
- package/dist/agents/tools/manage-agent-tool.d.ts.map +1 -0
- package/dist/agents/tools/manage-agent-tool.js +232 -0
- package/dist/agents/tools/manage-agent-tool.js.map +1 -0
- package/dist/agents/tools/manage-channel-access-tool.d.ts +44 -0
- package/dist/agents/tools/manage-channel-access-tool.d.ts.map +1 -0
- package/dist/agents/tools/manage-channel-access-tool.js +144 -0
- package/dist/agents/tools/manage-channel-access-tool.js.map +1 -0
- package/dist/agents/tools/manage-memory-tool.d.ts +30 -0
- package/dist/agents/tools/manage-memory-tool.d.ts.map +1 -0
- package/dist/agents/tools/manage-memory-tool.js +309 -0
- package/dist/agents/tools/manage-memory-tool.js.map +1 -0
- package/dist/agents/tools/manage-provider-tool.d.ts +65 -0
- package/dist/agents/tools/manage-provider-tool.d.ts.map +1 -0
- package/dist/agents/tools/manage-provider-tool.js +249 -0
- package/dist/agents/tools/manage-provider-tool.js.map +1 -0
- package/dist/agents/tools/manage-skill-tool.d.ts +121 -0
- package/dist/agents/tools/manage-skill-tool.d.ts.map +1 -0
- package/dist/agents/tools/manage-skill-tool.js +722 -0
- package/dist/agents/tools/manage-skill-tool.js.map +1 -0
- package/dist/agents/tools/memory-tools.d.ts +172 -0
- package/dist/agents/tools/memory-tools.d.ts.map +1 -0
- package/dist/agents/tools/memory-tools.js +561 -0
- package/dist/agents/tools/memory-tools.js.map +1 -0
- package/dist/agents/tools/oauth-authorize-tool.d.ts +94 -0
- package/dist/agents/tools/oauth-authorize-tool.d.ts.map +1 -0
- package/dist/agents/tools/oauth-authorize-tool.js +670 -0
- package/dist/agents/tools/oauth-authorize-tool.js.map +1 -0
- package/dist/agents/tools/org-tool.d.ts +208 -0
- package/dist/agents/tools/org-tool.d.ts.map +1 -0
- package/dist/agents/tools/org-tool.js +790 -0
- package/dist/agents/tools/org-tool.js.map +1 -0
- package/dist/agents/tools/registry.d.ts +146 -0
- package/dist/agents/tools/registry.d.ts.map +1 -0
- package/dist/agents/tools/registry.js +396 -0
- package/dist/agents/tools/registry.js.map +1 -0
- package/dist/agents/tools/send-media-tool.d.ts +92 -0
- package/dist/agents/tools/send-media-tool.d.ts.map +1 -0
- package/dist/agents/tools/send-media-tool.js +512 -0
- package/dist/agents/tools/send-media-tool.js.map +1 -0
- package/dist/agents/tools/send-message-tool.d.ts +84 -0
- package/dist/agents/tools/send-message-tool.d.ts.map +1 -0
- package/dist/agents/tools/send-message-tool.js +226 -0
- package/dist/agents/tools/send-message-tool.js.map +1 -0
- package/dist/agents/tools/sessions/history.d.ts +53 -0
- package/dist/agents/tools/sessions/history.d.ts.map +1 -0
- package/dist/agents/tools/sessions/history.js +138 -0
- package/dist/agents/tools/sessions/history.js.map +1 -0
- package/dist/agents/tools/sessions/index.d.ts +92 -0
- package/dist/agents/tools/sessions/index.d.ts.map +1 -0
- package/dist/agents/tools/sessions/index.js +125 -0
- package/dist/agents/tools/sessions/index.js.map +1 -0
- package/dist/agents/tools/sessions/list.d.ts +53 -0
- package/dist/agents/tools/sessions/list.d.ts.map +1 -0
- package/dist/agents/tools/sessions/list.js +134 -0
- package/dist/agents/tools/sessions/list.js.map +1 -0
- package/dist/agents/tools/sessions/resolve-access.d.ts +34 -0
- package/dist/agents/tools/sessions/resolve-access.d.ts.map +1 -0
- package/dist/agents/tools/sessions/resolve-access.js +67 -0
- package/dist/agents/tools/sessions/resolve-access.js.map +1 -0
- package/dist/agents/tools/sessions/send.d.ts +68 -0
- package/dist/agents/tools/sessions/send.d.ts.map +1 -0
- package/dist/agents/tools/sessions/send.js +556 -0
- package/dist/agents/tools/sessions/send.js.map +1 -0
- package/dist/agents/tools/sessions/shared.d.ts +145 -0
- package/dist/agents/tools/sessions/shared.d.ts.map +1 -0
- package/dist/agents/tools/sessions/shared.js +352 -0
- package/dist/agents/tools/sessions/shared.js.map +1 -0
- package/dist/agents/tools/sessions/spawn.d.ts +71 -0
- package/dist/agents/tools/sessions/spawn.d.ts.map +1 -0
- package/dist/agents/tools/sessions/spawn.js +132 -0
- package/dist/agents/tools/sessions/spawn.js.map +1 -0
- package/dist/agents/tools/spawn-agent-tool.d.ts +87 -0
- package/dist/agents/tools/spawn-agent-tool.d.ts.map +1 -0
- package/dist/agents/tools/spawn-agent-tool.js +189 -0
- package/dist/agents/tools/spawn-agent-tool.js.map +1 -0
- package/dist/agents/tools/spawn-agents-tool.d.ts +75 -0
- package/dist/agents/tools/spawn-agents-tool.d.ts.map +1 -0
- package/dist/agents/tools/spawn-agents-tool.js +267 -0
- package/dist/agents/tools/spawn-agents-tool.js.map +1 -0
- package/dist/agents/tools/types.d.ts +55 -0
- package/dist/agents/tools/types.d.ts.map +1 -0
- package/dist/agents/tools/types.js +28 -0
- package/dist/agents/tools/types.js.map +1 -0
- package/dist/agents/tools/web-fetch-utils.d.ts +114 -0
- package/dist/agents/tools/web-fetch-utils.d.ts.map +1 -0
- package/dist/agents/tools/web-fetch-utils.js +560 -0
- package/dist/agents/tools/web-fetch-utils.js.map +1 -0
- package/dist/agents/tools/web-fetch.d.ts +97 -0
- package/dist/agents/tools/web-fetch.d.ts.map +1 -0
- package/dist/agents/tools/web-fetch.js +369 -0
- package/dist/agents/tools/web-fetch.js.map +1 -0
- package/dist/agents/tools/web-retry.d.ts +55 -0
- package/dist/agents/tools/web-retry.d.ts.map +1 -0
- package/dist/agents/tools/web-retry.js +172 -0
- package/dist/agents/tools/web-retry.js.map +1 -0
- package/dist/agents/tools/web-search.d.ts +96 -0
- package/dist/agents/tools/web-search.d.ts.map +1 -0
- package/dist/agents/tools/web-search.js +459 -0
- package/dist/agents/tools/web-search.js.map +1 -0
- package/dist/agents/tools/web-shared.d.ts +123 -0
- package/dist/agents/tools/web-shared.d.ts.map +1 -0
- package/dist/agents/tools/web-shared.js +207 -0
- package/dist/agents/tools/web-shared.js.map +1 -0
- package/dist/assets/brigade-favicon.png +0 -0
- package/dist/auth/profile-cooldown.d.ts +105 -0
- package/dist/auth/profile-cooldown.d.ts.map +1 -0
- package/dist/auth/profile-cooldown.js +466 -0
- package/dist/auth/profile-cooldown.js.map +1 -0
- package/dist/auth/profiles.d.ts +93 -0
- package/dist/auth/profiles.d.ts.map +1 -0
- package/dist/auth/profiles.js +321 -0
- package/dist/auth/profiles.js.map +1 -0
- package/dist/buildstamp.json +1 -0
- package/dist/cli/argv.d.ts +20 -0
- package/dist/cli/argv.d.ts.map +1 -0
- package/dist/cli/argv.js +47 -0
- package/dist/cli/argv.js.map +1 -0
- package/dist/cli/commands/agent.d.ts +19 -0
- package/dist/cli/commands/agent.d.ts.map +1 -0
- package/dist/cli/commands/agent.js +297 -0
- package/dist/cli/commands/agent.js.map +1 -0
- package/dist/cli/commands/agents-bindings.d.ts +80 -0
- package/dist/cli/commands/agents-bindings.d.ts.map +1 -0
- package/dist/cli/commands/agents-bindings.js +252 -0
- package/dist/cli/commands/agents-bindings.js.map +1 -0
- package/dist/cli/commands/agents-cmd.d.ts +160 -0
- package/dist/cli/commands/agents-cmd.d.ts.map +1 -0
- package/dist/cli/commands/agents-cmd.js +1199 -0
- package/dist/cli/commands/agents-cmd.js.map +1 -0
- package/dist/cli/commands/agents-config.d.ts +102 -0
- package/dist/cli/commands/agents-config.d.ts.map +1 -0
- package/dist/cli/commands/agents-config.js +294 -0
- package/dist/cli/commands/agents-config.js.map +1 -0
- package/dist/cli/commands/agents-shared.d.ts +57 -0
- package/dist/cli/commands/agents-shared.d.ts.map +1 -0
- package/dist/cli/commands/agents-shared.js +83 -0
- package/dist/cli/commands/agents-shared.js.map +1 -0
- package/dist/cli/commands/backup.d.ts +36 -0
- package/dist/cli/commands/backup.d.ts.map +1 -0
- package/dist/cli/commands/backup.js +244 -0
- package/dist/cli/commands/backup.js.map +1 -0
- package/dist/cli/commands/channels.d.ts +106 -0
- package/dist/cli/commands/channels.d.ts.map +1 -0
- package/dist/cli/commands/channels.js +830 -0
- package/dist/cli/commands/channels.js.map +1 -0
- package/dist/cli/commands/chat.d.ts +43 -0
- package/dist/cli/commands/chat.d.ts.map +1 -0
- package/dist/cli/commands/chat.js +84 -0
- package/dist/cli/commands/chat.js.map +1 -0
- package/dist/cli/commands/config-cmd.d.ts +62 -0
- package/dist/cli/commands/config-cmd.d.ts.map +1 -0
- package/dist/cli/commands/config-cmd.js +404 -0
- package/dist/cli/commands/config-cmd.js.map +1 -0
- package/dist/cli/commands/connect.d.ts +73 -0
- package/dist/cli/commands/connect.d.ts.map +1 -0
- package/dist/cli/commands/connect.js +1952 -0
- package/dist/cli/commands/connect.js.map +1 -0
- package/dist/cli/commands/cron.d.ts +58 -0
- package/dist/cli/commands/cron.d.ts.map +1 -0
- package/dist/cli/commands/cron.js +250 -0
- package/dist/cli/commands/cron.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +25 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +618 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/encrypt-cmd.d.ts +12 -0
- package/dist/cli/commands/encrypt-cmd.d.ts.map +1 -0
- package/dist/cli/commands/encrypt-cmd.js +119 -0
- package/dist/cli/commands/encrypt-cmd.js.map +1 -0
- package/dist/cli/commands/exec-cmd.d.ts +55 -0
- package/dist/cli/commands/exec-cmd.d.ts.map +1 -0
- package/dist/cli/commands/exec-cmd.js +253 -0
- package/dist/cli/commands/exec-cmd.js.map +1 -0
- package/dist/cli/commands/gateway-install.d.ts +21 -0
- package/dist/cli/commands/gateway-install.d.ts.map +1 -0
- package/dist/cli/commands/gateway-install.js +71 -0
- package/dist/cli/commands/gateway-install.js.map +1 -0
- package/dist/cli/commands/gateway-supervise.d.ts +102 -0
- package/dist/cli/commands/gateway-supervise.d.ts.map +1 -0
- package/dist/cli/commands/gateway-supervise.js +194 -0
- package/dist/cli/commands/gateway-supervise.js.map +1 -0
- package/dist/cli/commands/gateway.d.ts +58 -0
- package/dist/cli/commands/gateway.d.ts.map +1 -0
- package/dist/cli/commands/gateway.js +497 -0
- package/dist/cli/commands/gateway.js.map +1 -0
- package/dist/cli/commands/logs.d.ts +14 -0
- package/dist/cli/commands/logs.d.ts.map +1 -0
- package/dist/cli/commands/logs.js +93 -0
- package/dist/cli/commands/logs.js.map +1 -0
- package/dist/cli/commands/mcp-cmd.d.ts +4 -0
- package/dist/cli/commands/mcp-cmd.d.ts.map +1 -0
- package/dist/cli/commands/mcp-cmd.js +30 -0
- package/dist/cli/commands/mcp-cmd.js.map +1 -0
- package/dist/cli/commands/onboard-config.d.ts +23 -0
- package/dist/cli/commands/onboard-config.d.ts.map +1 -0
- package/dist/cli/commands/onboard-config.js +33 -0
- package/dist/cli/commands/onboard-config.js.map +1 -0
- package/dist/cli/commands/onboard.d.ts +48 -0
- package/dist/cli/commands/onboard.d.ts.map +1 -0
- package/dist/cli/commands/onboard.js +397 -0
- package/dist/cli/commands/onboard.js.map +1 -0
- package/dist/cli/commands/org-cmd.d.ts +87 -0
- package/dist/cli/commands/org-cmd.d.ts.map +1 -0
- package/dist/cli/commands/org-cmd.js +394 -0
- package/dist/cli/commands/org-cmd.js.map +1 -0
- package/dist/cli/commands/org-cmd.templates.d.ts +66 -0
- package/dist/cli/commands/org-cmd.templates.d.ts.map +1 -0
- package/dist/cli/commands/org-cmd.templates.js +145 -0
- package/dist/cli/commands/org-cmd.templates.js.map +1 -0
- package/dist/cli/commands/org-slash.d.ts +107 -0
- package/dist/cli/commands/org-slash.d.ts.map +1 -0
- package/dist/cli/commands/org-slash.js +263 -0
- package/dist/cli/commands/org-slash.js.map +1 -0
- package/dist/cli/commands/pairing.d.ts +33 -0
- package/dist/cli/commands/pairing.d.ts.map +1 -0
- package/dist/cli/commands/pairing.js +155 -0
- package/dist/cli/commands/pairing.js.map +1 -0
- package/dist/cli/commands/secrets-audit.d.ts +17 -0
- package/dist/cli/commands/secrets-audit.d.ts.map +1 -0
- package/dist/cli/commands/secrets-audit.js +109 -0
- package/dist/cli/commands/secrets-audit.js.map +1 -0
- package/dist/cli/commands/sessions.d.ts +22 -0
- package/dist/cli/commands/sessions.d.ts.map +1 -0
- package/dist/cli/commands/sessions.js +99 -0
- package/dist/cli/commands/sessions.js.map +1 -0
- package/dist/cli/commands/skills.d.ts +17 -0
- package/dist/cli/commands/skills.d.ts.map +1 -0
- package/dist/cli/commands/skills.js +100 -0
- package/dist/cli/commands/skills.js.map +1 -0
- package/dist/cli/commands/status.d.ts +26 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +252 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/store-cmd.d.ts +36 -0
- package/dist/cli/commands/store-cmd.d.ts.map +1 -0
- package/dist/cli/commands/store-cmd.js +405 -0
- package/dist/cli/commands/store-cmd.js.map +1 -0
- package/dist/cli/flows/web-setup.d.ts +47 -0
- package/dist/cli/flows/web-setup.d.ts.map +1 -0
- package/dist/cli/flows/web-setup.js +324 -0
- package/dist/cli/flows/web-setup.js.map +1 -0
- package/dist/cli/program/build-program.d.ts +3 -0
- package/dist/cli/program/build-program.d.ts.map +1 -0
- package/dist/cli/program/build-program.js +1326 -0
- package/dist/cli/program/build-program.js.map +1 -0
- package/dist/cli/run-main.d.ts +2 -0
- package/dist/cli/run-main.d.ts.map +1 -0
- package/dist/cli/run-main.js +63 -0
- package/dist/cli/run-main.js.map +1 -0
- package/dist/config/agent-limits.d.ts +22 -0
- package/dist/config/agent-limits.d.ts.map +1 -0
- package/dist/config/agent-limits.js +34 -0
- package/dist/config/agent-limits.js.map +1 -0
- package/dist/config/io.d.ts +378 -0
- package/dist/config/io.d.ts.map +1 -0
- package/dist/config/io.js +602 -0
- package/dist/config/io.js.map +1 -0
- package/dist/config/paths.d.ts +80 -0
- package/dist/config/paths.d.ts.map +1 -0
- package/dist/config/paths.js +342 -0
- package/dist/config/paths.js.map +1 -0
- package/dist/config/types.d.ts +12 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +12 -0
- package/dist/config/types.js.map +1 -0
- package/dist/core/agent-dispatcher.d.ts +91 -0
- package/dist/core/agent-dispatcher.d.ts.map +1 -0
- package/dist/core/agent-dispatcher.js +251 -0
- package/dist/core/agent-dispatcher.js.map +1 -0
- package/dist/core/agent-events-stream.d.ts +76 -0
- package/dist/core/agent-events-stream.d.ts.map +1 -0
- package/dist/core/agent-events-stream.js +185 -0
- package/dist/core/agent-events-stream.js.map +1 -0
- package/dist/core/agent-runtime-persist.d.ts +53 -0
- package/dist/core/agent-runtime-persist.d.ts.map +1 -0
- package/dist/core/agent-runtime-persist.js +114 -0
- package/dist/core/agent-runtime-persist.js.map +1 -0
- package/dist/core/auth-bridge.d.ts +8 -0
- package/dist/core/auth-bridge.d.ts.map +1 -0
- package/dist/core/auth-bridge.js +102 -0
- package/dist/core/auth-bridge.js.map +1 -0
- package/dist/core/auth-error.d.ts +49 -0
- package/dist/core/auth-error.d.ts.map +1 -0
- package/dist/core/auth-error.js.map +1 -0
- package/dist/core/brigade-config.d.ts +205 -0
- package/dist/core/brigade-config.d.ts.map +1 -0
- package/dist/core/brigade-config.js +58 -6
- package/dist/core/brigade-config.js.map +1 -0
- package/dist/core/config.d.ts +17 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +92 -246
- package/dist/core/config.js.map +1 -0
- package/dist/core/console-stream.d.ts +52 -0
- package/dist/core/console-stream.d.ts.map +1 -0
- package/dist/core/console-stream.js +49 -3
- package/dist/core/console-stream.js.map +1 -0
- package/dist/core/daemon/launchd.d.ts +19 -0
- package/dist/core/daemon/launchd.d.ts.map +1 -0
- package/dist/core/daemon/launchd.js +117 -0
- package/dist/core/daemon/launchd.js.map +1 -0
- package/dist/core/daemon/schtasks.d.ts +23 -0
- package/dist/core/daemon/schtasks.d.ts.map +1 -0
- package/dist/core/daemon/schtasks.js +139 -0
- package/dist/core/daemon/schtasks.js.map +1 -0
- package/dist/core/daemon/service.d.ts +56 -0
- package/dist/core/daemon/service.d.ts.map +1 -0
- package/dist/core/daemon/service.js +54 -0
- package/dist/core/daemon/service.js.map +1 -0
- package/dist/core/daemon/systemd.d.ts +19 -0
- package/dist/core/daemon/systemd.d.ts.map +1 -0
- package/dist/core/daemon/systemd.js +117 -0
- package/dist/core/daemon/systemd.js.map +1 -0
- package/dist/core/event-logger.d.ts +74 -0
- package/dist/core/event-logger.d.ts.map +1 -0
- package/dist/core/event-logger.js +299 -6
- package/dist/core/event-logger.js.map +1 -0
- package/dist/core/exec-approvals.d.ts +178 -0
- package/dist/core/exec-approvals.d.ts.map +1 -0
- package/dist/core/exec-approvals.js +591 -266
- package/dist/core/exec-approvals.js.map +1 -0
- package/dist/core/extension-lifecycle.d.ts +27 -0
- package/dist/core/extension-lifecycle.d.ts.map +1 -0
- package/dist/core/extension-lifecycle.js +45 -0
- package/dist/core/extension-lifecycle.js.map +1 -0
- package/dist/core/gateway-caller-impl.d.ts +42 -0
- package/dist/core/gateway-caller-impl.d.ts.map +1 -0
- package/dist/core/gateway-caller-impl.js +95 -0
- package/dist/core/gateway-caller-impl.js.map +1 -0
- package/dist/core/gateway-lock.d.ts +88 -0
- package/dist/core/gateway-lock.d.ts.map +1 -0
- package/dist/core/gateway-lock.js +204 -0
- package/dist/core/gateway-lock.js.map +1 -0
- package/dist/core/gateway-probe.d.ts +148 -0
- package/dist/core/gateway-probe.d.ts.map +1 -0
- package/dist/core/gateway-probe.js +319 -0
- package/dist/core/gateway-probe.js.map +1 -0
- package/dist/core/gateway-spawn.d.ts +40 -0
- package/dist/core/gateway-spawn.d.ts.map +1 -0
- package/dist/core/gateway-spawn.js +156 -0
- package/dist/core/gateway-spawn.js.map +1 -0
- package/dist/core/model-caps.d.ts +85 -0
- package/dist/core/model-caps.d.ts.map +1 -0
- package/dist/core/model-caps.js +88 -2
- package/dist/core/model-caps.js.map +1 -0
- package/dist/core/port-inspect.d.ts +37 -0
- package/dist/core/port-inspect.d.ts.map +1 -0
- package/dist/core/port-inspect.js +165 -0
- package/dist/core/port-inspect.js.map +1 -0
- package/dist/core/server-lanes.d.ts +25 -0
- package/dist/core/server-lanes.d.ts.map +1 -0
- package/dist/core/server-lanes.js +31 -0
- package/dist/core/server-lanes.js.map +1 -0
- package/dist/core/server-methods/cron.d.ts +104 -0
- package/dist/core/server-methods/cron.d.ts.map +1 -0
- package/dist/core/server-methods/cron.js +183 -0
- package/dist/core/server-methods/cron.js.map +1 -0
- package/dist/core/server-methods/health.d.ts +36 -0
- package/dist/core/server-methods/health.d.ts.map +1 -0
- package/dist/core/server-methods/health.js +51 -0
- package/dist/core/server-methods/health.js.map +1 -0
- package/dist/core/server-methods/org.d.ts +93 -0
- package/dist/core/server-methods/org.d.ts.map +1 -0
- package/dist/core/server-methods/org.js +95 -0
- package/dist/core/server-methods/org.js.map +1 -0
- package/dist/core/server-methods/sessions.d.ts +133 -0
- package/dist/core/server-methods/sessions.d.ts.map +1 -0
- package/dist/core/server-methods/sessions.js +209 -0
- package/dist/core/server-methods/sessions.js.map +1 -0
- package/dist/core/server.d.ts +46 -0
- package/dist/core/server.d.ts.map +1 -0
- package/dist/core/server.js +4716 -249
- package/dist/core/server.js.map +1 -0
- package/dist/core/system-prompt.d.ts +92 -0
- package/dist/core/system-prompt.d.ts.map +1 -0
- package/dist/core/system-prompt.js +180 -1584
- package/dist/core/system-prompt.js.map +1 -0
- package/dist/core/version.d.ts +4 -0
- package/dist/core/version.d.ts.map +1 -0
- package/dist/core/version.js +8 -13
- package/dist/core/version.js.map +1 -0
- package/dist/core/webhook-guards.d.ts +131 -0
- package/dist/core/webhook-guards.d.ts.map +1 -0
- package/dist/core/webhook-guards.js +283 -0
- package/dist/core/webhook-guards.js.map +1 -0
- package/dist/core/ws-subscription-filter.d.ts +9 -0
- package/dist/core/ws-subscription-filter.d.ts.map +1 -0
- package/dist/core/ws-subscription-filter.js +39 -0
- package/dist/core/ws-subscription-filter.js.map +1 -0
- package/dist/cron/active-service.d.ts +30 -0
- package/dist/cron/active-service.d.ts.map +1 -0
- package/dist/cron/active-service.js +48 -0
- package/dist/cron/active-service.js.map +1 -0
- package/dist/cron/isolated-agent/run-executor.d.ts +49 -0
- package/dist/cron/isolated-agent/run-executor.d.ts.map +1 -0
- package/dist/cron/isolated-agent/run-executor.js +343 -0
- package/dist/cron/isolated-agent/run-executor.js.map +1 -0
- package/dist/cron/isolated-agent/run.d.ts +27 -0
- package/dist/cron/isolated-agent/run.d.ts.map +1 -0
- package/dist/cron/isolated-agent/run.js +29 -0
- package/dist/cron/isolated-agent/run.js.map +1 -0
- package/dist/cron/normalize.d.ts +103 -0
- package/dist/cron/normalize.d.ts.map +1 -0
- package/dist/cron/normalize.js +376 -0
- package/dist/cron/normalize.js.map +1 -0
- package/dist/cron/parse.d.ts +27 -0
- package/dist/cron/parse.d.ts.map +1 -0
- package/dist/cron/parse.js +55 -0
- package/dist/cron/parse.js.map +1 -0
- package/dist/cron/reminder-context.d.ts +78 -0
- package/dist/cron/reminder-context.d.ts.map +1 -0
- package/dist/cron/reminder-context.js +167 -0
- package/dist/cron/reminder-context.js.map +1 -0
- package/dist/cron/run-log.d.ts +48 -0
- package/dist/cron/run-log.d.ts.map +1 -0
- package/dist/cron/run-log.js +225 -0
- package/dist/cron/run-log.js.map +1 -0
- package/dist/cron/schedule.d.ts +46 -0
- package/dist/cron/schedule.d.ts.map +1 -0
- package/dist/cron/schedule.js +144 -0
- package/dist/cron/schedule.js.map +1 -0
- package/dist/cron/service/jobs.d.ts +138 -0
- package/dist/cron/service/jobs.d.ts.map +1 -0
- package/dist/cron/service/jobs.js +370 -0
- package/dist/cron/service/jobs.js.map +1 -0
- package/dist/cron/service/locked.d.ts +46 -0
- package/dist/cron/service/locked.d.ts.map +1 -0
- package/dist/cron/service/locked.js +54 -0
- package/dist/cron/service/locked.js.map +1 -0
- package/dist/cron/service/ops.d.ts +124 -0
- package/dist/cron/service/ops.d.ts.map +1 -0
- package/dist/cron/service/ops.js +415 -0
- package/dist/cron/service/ops.js.map +1 -0
- package/dist/cron/service/state.d.ts +254 -0
- package/dist/cron/service/state.d.ts.map +1 -0
- package/dist/cron/service/state.js +50 -0
- package/dist/cron/service/state.js.map +1 -0
- package/dist/cron/service/store.d.ts +65 -0
- package/dist/cron/service/store.d.ts.map +1 -0
- package/dist/cron/service/store.js +350 -0
- package/dist/cron/service/store.js.map +1 -0
- package/dist/cron/service/timer.d.ts +113 -0
- package/dist/cron/service/timer.d.ts.map +1 -0
- package/dist/cron/service/timer.js +1081 -0
- package/dist/cron/service/timer.js.map +1 -0
- package/dist/cron/session-reaper.d.ts +62 -0
- package/dist/cron/session-reaper.d.ts.map +1 -0
- package/dist/cron/session-reaper.js +152 -0
- package/dist/cron/session-reaper.js.map +1 -0
- package/dist/cron/session-target.d.ts +56 -0
- package/dist/cron/session-target.d.ts.map +1 -0
- package/dist/cron/session-target.js +96 -0
- package/dist/cron/session-target.js.map +1 -0
- package/dist/cron/stagger.d.ts +34 -0
- package/dist/cron/stagger.d.ts.map +1 -0
- package/dist/cron/stagger.js +69 -0
- package/dist/cron/stagger.js.map +1 -0
- package/dist/cron/types.d.ts +287 -0
- package/dist/cron/types.d.ts.map +1 -0
- package/dist/cron/types.js +22 -0
- package/dist/cron/types.js.map +1 -0
- package/dist/cron/validate-timestamp.d.ts +33 -0
- package/dist/cron/validate-timestamp.d.ts.map +1 -0
- package/dist/cron/validate-timestamp.js +54 -0
- package/dist/cron/validate-timestamp.js.map +1 -0
- package/dist/entry.d.ts +2 -0
- package/dist/entry.d.ts.map +1 -0
- package/dist/entry.js +57 -0
- package/dist/entry.js.map +1 -0
- package/dist/extension-sdk.d.ts +28 -0
- package/dist/extension-sdk.d.ts.map +1 -0
- package/dist/extension-sdk.js +26 -0
- package/dist/extension-sdk.js.map +1 -0
- package/dist/identity/device.d.ts +19 -0
- package/dist/identity/device.d.ts.map +1 -0
- package/dist/identity/device.js +88 -0
- package/dist/identity/device.js.map +1 -0
- package/dist/infra/backoff.d.ts +24 -0
- package/dist/infra/backoff.d.ts.map +1 -0
- package/dist/infra/backoff.js +48 -0
- package/dist/infra/backoff.js.map +1 -0
- package/dist/infra/errors.d.ts +35 -0
- package/dist/infra/errors.d.ts.map +1 -0
- package/dist/infra/errors.js +54 -0
- package/dist/infra/errors.js.map +1 -0
- package/dist/infra/fs/atomic-rename.d.ts +31 -0
- package/dist/infra/fs/atomic-rename.d.ts.map +1 -0
- package/dist/infra/fs/atomic-rename.js +75 -0
- package/dist/infra/fs/atomic-rename.js.map +1 -0
- package/dist/infra/json-file.d.ts +25 -0
- package/dist/infra/json-file.d.ts.map +1 -0
- package/dist/infra/json-file.js +49 -0
- package/dist/infra/json-file.js.map +1 -0
- package/dist/infra/json-utf8-bytes.d.ts +14 -0
- package/dist/infra/json-utf8-bytes.d.ts.map +1 -0
- package/dist/infra/json-utf8-bytes.js +20 -0
- package/dist/infra/json-utf8-bytes.js.map +1 -0
- package/dist/infra/net/dns-pinning.d.ts +66 -0
- package/dist/infra/net/dns-pinning.d.ts.map +1 -0
- package/dist/infra/net/dns-pinning.js +128 -0
- package/dist/infra/net/dns-pinning.js.map +1 -0
- package/dist/infra/net/fetch-guard.d.ts +85 -0
- package/dist/infra/net/fetch-guard.d.ts.map +1 -0
- package/dist/infra/net/fetch-guard.js +439 -0
- package/dist/infra/net/fetch-guard.js.map +1 -0
- package/dist/infra/prototype-keys.d.ts +19 -0
- package/dist/infra/prototype-keys.d.ts.map +1 -0
- package/dist/infra/prototype-keys.js +22 -0
- package/dist/infra/prototype-keys.js.map +1 -0
- package/dist/integrations/ollama.d.ts +67 -0
- package/dist/integrations/ollama.d.ts.map +1 -0
- package/dist/integrations/ollama.js +53 -0
- package/dist/integrations/ollama.js.map +1 -0
- package/dist/integrations/provider-discovery.d.ts +66 -0
- package/dist/integrations/provider-discovery.d.ts.map +1 -0
- package/dist/integrations/provider-discovery.js +166 -0
- package/dist/integrations/provider-discovery.js.map +1 -0
- package/dist/logging/redact.d.ts +28 -0
- package/dist/logging/redact.d.ts.map +1 -0
- package/dist/logging/redact.js +51 -0
- package/dist/logging/redact.js.map +1 -0
- package/dist/logging/subsystem-logger.d.ts +77 -0
- package/dist/logging/subsystem-logger.d.ts.map +1 -0
- package/dist/logging/subsystem-logger.js +577 -0
- package/dist/logging/subsystem-logger.js.map +1 -0
- package/dist/logging/subsystem.d.ts +13 -0
- package/dist/logging/subsystem.d.ts.map +1 -0
- package/dist/logging/subsystem.js +12 -0
- package/dist/logging/subsystem.js.map +1 -0
- package/dist/process/command-queue.d.ts +152 -0
- package/dist/process/command-queue.d.ts.map +1 -0
- package/dist/process/command-queue.js +420 -0
- package/dist/process/command-queue.js.map +1 -0
- package/dist/process/lanes.d.ts +102 -0
- package/dist/process/lanes.d.ts.map +1 -0
- package/dist/process/lanes.js +117 -0
- package/dist/process/lanes.js.map +1 -0
- package/dist/process/session-lane.d.ts +31 -0
- package/dist/process/session-lane.d.ts.map +1 -0
- package/dist/process/session-lane.js +45 -0
- package/dist/process/session-lane.js.map +1 -0
- package/dist/protocol/errors.d.ts +35 -0
- package/dist/protocol/errors.d.ts.map +1 -0
- package/dist/protocol/errors.js +36 -0
- package/dist/protocol/errors.js.map +1 -0
- package/dist/protocol/handshake.d.ts +101 -0
- package/dist/protocol/handshake.d.ts.map +1 -0
- package/dist/protocol/handshake.js +49 -0
- package/dist/protocol/handshake.js.map +1 -0
- package/dist/protocol/messages.d.ts +68 -0
- package/dist/protocol/messages.d.ts.map +1 -0
- package/dist/protocol/messages.js +20 -0
- package/dist/protocol/messages.js.map +1 -0
- package/dist/protocol/methods.d.ts +312 -0
- package/dist/protocol/methods.d.ts.map +1 -0
- package/dist/protocol/methods.js +16 -0
- package/dist/protocol/methods.js.map +1 -0
- package/dist/protocol.d.ts +598 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +12 -0
- package/dist/protocol.js.map +1 -0
- package/dist/providers/auth-methods.d.ts +82 -0
- package/dist/providers/auth-methods.d.ts.map +1 -0
- package/dist/providers/auth-methods.js +180 -0
- package/dist/providers/auth-methods.js.map +1 -0
- package/dist/providers/catalog.d.ts +85 -0
- package/dist/providers/catalog.d.ts.map +1 -0
- package/dist/providers/catalog.js +41 -0
- package/dist/providers/catalog.js.map +1 -0
- package/dist/providers/validate-key.d.ts +42 -0
- package/dist/providers/validate-key.d.ts.map +1 -0
- package/dist/providers/validate-key.js.map +1 -0
- package/dist/security/external-content.d.ts +67 -0
- package/dist/security/external-content.d.ts.map +1 -0
- package/dist/security/external-content.js +80 -0
- package/dist/security/external-content.js.map +1 -0
- package/dist/security/injection-patterns.d.ts +33 -0
- package/dist/security/injection-patterns.d.ts.map +1 -0
- package/dist/security/injection-patterns.js +97 -0
- package/dist/security/injection-patterns.js.map +1 -0
- package/dist/security/media-path-guard.d.ts +25 -0
- package/dist/security/media-path-guard.d.ts.map +1 -0
- package/dist/security/media-path-guard.js +98 -0
- package/dist/security/media-path-guard.js.map +1 -0
- package/dist/security/terminal-input-sanitizer.d.ts +30 -0
- package/dist/security/terminal-input-sanitizer.d.ts.map +1 -0
- package/dist/security/terminal-input-sanitizer.js +70 -0
- package/dist/security/terminal-input-sanitizer.js.map +1 -0
- package/dist/sessions/bootstrap-marker.d.ts +5 -0
- package/dist/sessions/bootstrap-marker.d.ts.map +1 -0
- package/dist/sessions/bootstrap-marker.js +120 -0
- package/dist/sessions/bootstrap-marker.js.map +1 -0
- package/dist/sessions/session-file-repair.d.ts +12 -0
- package/dist/sessions/session-file-repair.d.ts.map +1 -0
- package/dist/sessions/session-file-repair.js +155 -0
- package/dist/sessions/session-file-repair.js.map +1 -0
- package/dist/sessions/session-key-utils.d.ts +54 -0
- package/dist/sessions/session-key-utils.d.ts.map +1 -0
- package/dist/sessions/session-key-utils.js +133 -0
- package/dist/sessions/session-key-utils.js.map +1 -0
- package/dist/sessions/session-manager-factory.d.ts +21 -0
- package/dist/sessions/session-manager-factory.d.ts.map +1 -0
- package/dist/sessions/session-manager-factory.js +142 -0
- package/dist/sessions/session-manager-factory.js.map +1 -0
- package/dist/sessions/session-store.d.ts +154 -0
- package/dist/sessions/session-store.d.ts.map +1 -0
- package/dist/sessions/session-store.js +498 -0
- package/dist/sessions/session-store.js.map +1 -0
- package/dist/sessions/session-write-lock.d.ts +10 -0
- package/dist/sessions/session-write-lock.d.ts.map +1 -0
- package/dist/sessions/session-write-lock.js +167 -0
- package/dist/sessions/session-write-lock.js.map +1 -0
- package/dist/sessions/transcript-reader.d.ts +37 -0
- package/dist/sessions/transcript-reader.d.ts.map +1 -0
- package/dist/sessions/transcript-reader.js +136 -0
- package/dist/sessions/transcript-reader.js.map +1 -0
- package/dist/sessions/transcript-repair.d.ts +16 -0
- package/dist/sessions/transcript-repair.d.ts.map +1 -0
- package/dist/sessions/transcript-repair.js +214 -0
- package/dist/sessions/transcript-repair.js.map +1 -0
- package/dist/shared/global-singleton.d.ts +27 -0
- package/dist/shared/global-singleton.d.ts.map +1 -0
- package/dist/shared/global-singleton.js +35 -0
- package/dist/shared/global-singleton.js.map +1 -0
- package/dist/shared/string-coerce.d.ts +12 -0
- package/dist/shared/string-coerce.d.ts.map +1 -0
- package/dist/shared/string-coerce.js +12 -0
- package/dist/shared/string-coerce.js.map +1 -0
- package/dist/storage/boot.d.ts +28 -0
- package/dist/storage/boot.d.ts.map +1 -0
- package/dist/storage/boot.js +588 -0
- package/dist/storage/boot.js.map +1 -0
- package/dist/storage/config-cache.d.ts +23 -0
- package/dist/storage/config-cache.d.ts.map +1 -0
- package/dist/storage/config-cache.js +58 -0
- package/dist/storage/config-cache.js.map +1 -0
- package/dist/storage/convex/auth-store.d.ts +52 -0
- package/dist/storage/convex/auth-store.d.ts.map +1 -0
- package/dist/storage/convex/auth-store.js +282 -0
- package/dist/storage/convex/auth-store.js.map +1 -0
- package/dist/storage/convex/blob-store.d.ts +20 -0
- package/dist/storage/convex/blob-store.d.ts.map +1 -0
- package/dist/storage/convex/blob-store.js +74 -0
- package/dist/storage/convex/blob-store.js.map +1 -0
- package/dist/storage/convex/channel-store.d.ts +112 -0
- package/dist/storage/convex/channel-store.d.ts.map +1 -0
- package/dist/storage/convex/channel-store.js +267 -0
- package/dist/storage/convex/channel-store.js.map +1 -0
- package/dist/storage/convex/client.d.ts +53 -0
- package/dist/storage/convex/client.d.ts.map +1 -0
- package/dist/storage/convex/client.js +121 -0
- package/dist/storage/convex/client.js.map +1 -0
- package/dist/storage/convex/config-store.d.ts +29 -0
- package/dist/storage/convex/config-store.d.ts.map +1 -0
- package/dist/storage/convex/config-store.js +205 -0
- package/dist/storage/convex/config-store.js.map +1 -0
- package/dist/storage/convex/cron-store.d.ts +86 -0
- package/dist/storage/convex/cron-store.d.ts.map +1 -0
- package/dist/storage/convex/cron-store.js +428 -0
- package/dist/storage/convex/cron-store.js.map +1 -0
- package/dist/storage/convex/exec-approval-store.d.ts +38 -0
- package/dist/storage/convex/exec-approval-store.d.ts.map +1 -0
- package/dist/storage/convex/exec-approval-store.js +147 -0
- package/dist/storage/convex/exec-approval-store.js.map +1 -0
- package/dist/storage/convex/extension-store.d.ts +28 -0
- package/dist/storage/convex/extension-store.d.ts.map +1 -0
- package/dist/storage/convex/extension-store.js +39 -0
- package/dist/storage/convex/extension-store.js.map +1 -0
- package/dist/storage/convex/index.d.ts +35 -0
- package/dist/storage/convex/index.d.ts.map +1 -0
- package/dist/storage/convex/index.js +141 -0
- package/dist/storage/convex/index.js.map +1 -0
- package/dist/storage/convex/instance-store.d.ts +37 -0
- package/dist/storage/convex/instance-store.d.ts.map +1 -0
- package/dist/storage/convex/instance-store.js +88 -0
- package/dist/storage/convex/instance-store.js.map +1 -0
- package/dist/storage/convex/log-store.d.ts +36 -0
- package/dist/storage/convex/log-store.d.ts.map +1 -0
- package/dist/storage/convex/log-store.js +213 -0
- package/dist/storage/convex/log-store.js.map +1 -0
- package/dist/storage/convex/memory-store.d.ts +50 -0
- package/dist/storage/convex/memory-store.d.ts.map +1 -0
- package/dist/storage/convex/memory-store.js +537 -0
- package/dist/storage/convex/memory-store.js.map +1 -0
- package/dist/storage/convex/message-store.d.ts +32 -0
- package/dist/storage/convex/message-store.d.ts.map +1 -0
- package/dist/storage/convex/message-store.js +272 -0
- package/dist/storage/convex/message-store.js.map +1 -0
- package/dist/storage/convex/org-store.d.ts +46 -0
- package/dist/storage/convex/org-store.d.ts.map +1 -0
- package/dist/storage/convex/org-store.js +101 -0
- package/dist/storage/convex/org-store.js.map +1 -0
- package/dist/storage/convex/session-store.d.ts +44 -0
- package/dist/storage/convex/session-store.d.ts.map +1 -0
- package/dist/storage/convex/session-store.js +257 -0
- package/dist/storage/convex/session-store.js.map +1 -0
- package/dist/storage/convex/skill-store.d.ts +49 -0
- package/dist/storage/convex/skill-store.d.ts.map +1 -0
- package/dist/storage/convex/skill-store.js +84 -0
- package/dist/storage/convex/skill-store.js.map +1 -0
- package/dist/storage/convex/subagent-store.d.ts +28 -0
- package/dist/storage/convex/subagent-store.d.ts.map +1 -0
- package/dist/storage/convex/subagent-store.js +83 -0
- package/dist/storage/convex/subagent-store.js.map +1 -0
- package/dist/storage/convex/workspace-store.d.ts +25 -0
- package/dist/storage/convex/workspace-store.d.ts.map +1 -0
- package/dist/storage/convex/workspace-store.js +127 -0
- package/dist/storage/convex/workspace-store.js.map +1 -0
- package/dist/storage/cron-cache.d.ts +17 -0
- package/dist/storage/cron-cache.d.ts.map +1 -0
- package/dist/storage/cron-cache.js +67 -0
- package/dist/storage/cron-cache.js.map +1 -0
- package/dist/storage/encryption.d.ts +69 -0
- package/dist/storage/encryption.d.ts.map +1 -0
- package/dist/storage/encryption.js +389 -0
- package/dist/storage/encryption.js.map +1 -0
- package/dist/storage/factory-reset.d.ts +7 -0
- package/dist/storage/factory-reset.d.ts.map +1 -0
- package/dist/storage/factory-reset.js +34 -0
- package/dist/storage/factory-reset.js.map +1 -0
- package/dist/storage/facts-cache.d.ts +24 -0
- package/dist/storage/facts-cache.d.ts.map +1 -0
- package/dist/storage/facts-cache.js +110 -0
- package/dist/storage/facts-cache.js.map +1 -0
- package/dist/storage/flush.d.ts +4 -0
- package/dist/storage/flush.d.ts.map +1 -0
- package/dist/storage/flush.js +128 -0
- package/dist/storage/flush.js.map +1 -0
- package/dist/storage/instance-admin.d.ts +52 -0
- package/dist/storage/instance-admin.d.ts.map +1 -0
- package/dist/storage/instance-admin.js +91 -0
- package/dist/storage/instance-admin.js.map +1 -0
- package/dist/storage/local/auth-store.d.ts +44 -0
- package/dist/storage/local/auth-store.d.ts.map +1 -0
- package/dist/storage/local/auth-store.js +252 -0
- package/dist/storage/local/auth-store.js.map +1 -0
- package/dist/storage/local/blob-store.d.ts +14 -0
- package/dist/storage/local/blob-store.d.ts.map +1 -0
- package/dist/storage/local/blob-store.js +87 -0
- package/dist/storage/local/blob-store.js.map +1 -0
- package/dist/storage/local/channel-store.d.ts +107 -0
- package/dist/storage/local/channel-store.d.ts.map +1 -0
- package/dist/storage/local/channel-store.js +147 -0
- package/dist/storage/local/channel-store.js.map +1 -0
- package/dist/storage/local/config-store.d.ts +23 -0
- package/dist/storage/local/config-store.d.ts.map +1 -0
- package/dist/storage/local/config-store.js +98 -0
- package/dist/storage/local/config-store.js.map +1 -0
- package/dist/storage/local/cron-store.d.ts +30 -0
- package/dist/storage/local/cron-store.d.ts.map +1 -0
- package/dist/storage/local/cron-store.js +186 -0
- package/dist/storage/local/cron-store.js.map +1 -0
- package/dist/storage/local/exec-approval-store.d.ts +41 -0
- package/dist/storage/local/exec-approval-store.d.ts.map +1 -0
- package/dist/storage/local/exec-approval-store.js +78 -0
- package/dist/storage/local/exec-approval-store.js.map +1 -0
- package/dist/storage/local/extension-store.d.ts +13 -0
- package/dist/storage/local/extension-store.d.ts.map +1 -0
- package/dist/storage/local/extension-store.js +36 -0
- package/dist/storage/local/extension-store.js.map +1 -0
- package/dist/storage/local/file-watcher.d.ts +24 -0
- package/dist/storage/local/file-watcher.d.ts.map +1 -0
- package/dist/storage/local/file-watcher.js +141 -0
- package/dist/storage/local/file-watcher.js.map +1 -0
- package/dist/storage/local/index.d.ts +33 -0
- package/dist/storage/local/index.d.ts.map +1 -0
- package/dist/storage/local/index.js +143 -0
- package/dist/storage/local/index.js.map +1 -0
- package/dist/storage/local/instance-store.d.ts +30 -0
- package/dist/storage/local/instance-store.d.ts.map +1 -0
- package/dist/storage/local/instance-store.js +83 -0
- package/dist/storage/local/instance-store.js.map +1 -0
- package/dist/storage/local/log-store.d.ts +27 -0
- package/dist/storage/local/log-store.d.ts.map +1 -0
- package/dist/storage/local/log-store.js +185 -0
- package/dist/storage/local/log-store.js.map +1 -0
- package/dist/storage/local/memory-store.d.ts +39 -0
- package/dist/storage/local/memory-store.d.ts.map +1 -0
- package/dist/storage/local/memory-store.js +258 -0
- package/dist/storage/local/memory-store.js.map +1 -0
- package/dist/storage/local/message-store.d.ts +27 -0
- package/dist/storage/local/message-store.d.ts.map +1 -0
- package/dist/storage/local/message-store.js +253 -0
- package/dist/storage/local/message-store.js.map +1 -0
- package/dist/storage/local/org-store.d.ts +39 -0
- package/dist/storage/local/org-store.d.ts.map +1 -0
- package/dist/storage/local/org-store.js +155 -0
- package/dist/storage/local/org-store.js.map +1 -0
- package/dist/storage/local/session-store.d.ts +30 -0
- package/dist/storage/local/session-store.d.ts.map +1 -0
- package/dist/storage/local/session-store.js +82 -0
- package/dist/storage/local/session-store.js.map +1 -0
- package/dist/storage/local/skill-store.d.ts +40 -0
- package/dist/storage/local/skill-store.d.ts.map +1 -0
- package/dist/storage/local/skill-store.js +121 -0
- package/dist/storage/local/skill-store.js.map +1 -0
- package/dist/storage/local/subagent-store.d.ts +20 -0
- package/dist/storage/local/subagent-store.d.ts.map +1 -0
- package/dist/storage/local/subagent-store.js +71 -0
- package/dist/storage/local/subagent-store.js.map +1 -0
- package/dist/storage/local/workspace-store.d.ts +22 -0
- package/dist/storage/local/workspace-store.d.ts.map +1 -0
- package/dist/storage/local/workspace-store.js +190 -0
- package/dist/storage/local/workspace-store.js.map +1 -0
- package/dist/storage/migrate.d.ts +64 -0
- package/dist/storage/migrate.d.ts.map +1 -0
- package/dist/storage/migrate.js +585 -0
- package/dist/storage/migrate.js.map +1 -0
- package/dist/storage/runtime-context.d.ts +35 -0
- package/dist/storage/runtime-context.d.ts.map +1 -0
- package/dist/storage/runtime-context.js +145 -0
- package/dist/storage/runtime-context.js.map +1 -0
- package/dist/storage/sentinel.d.ts +28 -0
- package/dist/storage/sentinel.d.ts.map +1 -0
- package/dist/storage/sentinel.js +98 -0
- package/dist/storage/sentinel.js.map +1 -0
- package/dist/storage/session-cache.d.ts +15 -0
- package/dist/storage/session-cache.d.ts.map +1 -0
- package/dist/storage/session-cache.js +81 -0
- package/dist/storage/session-cache.js.map +1 -0
- package/dist/storage/store.d.ts +745 -0
- package/dist/storage/store.d.ts.map +1 -0
- package/dist/storage/store.js +36 -0
- package/dist/storage/store.js.map +1 -0
- package/dist/storage/strict-guard.d.ts +17 -0
- package/dist/storage/strict-guard.d.ts.map +1 -0
- package/dist/storage/strict-guard.js +200 -0
- package/dist/storage/strict-guard.js.map +1 -0
- package/dist/storage/workspace-live-mirror.d.ts +33 -0
- package/dist/storage/workspace-live-mirror.d.ts.map +1 -0
- package/dist/storage/workspace-live-mirror.js +207 -0
- package/dist/storage/workspace-live-mirror.js.map +1 -0
- package/dist/system-prompt/assembler.d.ts +113 -0
- package/dist/system-prompt/assembler.d.ts.map +1 -0
- package/dist/system-prompt/assembler.js +649 -0
- package/dist/system-prompt/assembler.js.map +1 -0
- package/dist/system-prompt/bootstrap-budget.d.ts +22 -0
- package/dist/system-prompt/bootstrap-budget.d.ts.map +1 -0
- package/dist/system-prompt/bootstrap-budget.js +83 -0
- package/dist/system-prompt/bootstrap-budget.js.map +1 -0
- package/dist/system-prompt/cache-boundary.d.ts +13 -0
- package/dist/system-prompt/cache-boundary.d.ts.map +1 -0
- package/dist/system-prompt/cache-boundary.js +56 -0
- package/dist/system-prompt/cache-boundary.js.map +1 -0
- package/dist/system-prompt/cache-stability.d.ts +3 -0
- package/dist/system-prompt/cache-stability.d.ts.map +1 -0
- package/dist/system-prompt/cache-stability.js +18 -0
- package/dist/system-prompt/cache-stability.js.map +1 -0
- package/dist/system-prompt/guidance.d.ts +147 -0
- package/dist/system-prompt/guidance.d.ts.map +1 -0
- package/dist/system-prompt/guidance.js +352 -0
- package/dist/system-prompt/guidance.js.map +1 -0
- package/dist/system-prompt/identity-defaults.d.ts +50 -0
- package/dist/system-prompt/identity-defaults.d.ts.map +1 -0
- package/dist/system-prompt/identity-defaults.js +119 -0
- package/dist/system-prompt/identity-defaults.js.map +1 -0
- package/dist/system-prompt/org/escalation-inbox.d.ts +53 -0
- package/dist/system-prompt/org/escalation-inbox.d.ts.map +1 -0
- package/dist/system-prompt/org/escalation-inbox.js +71 -0
- package/dist/system-prompt/org/escalation-inbox.js.map +1 -0
- package/dist/system-prompt/org/receiver-hint.d.ts +72 -0
- package/dist/system-prompt/org/receiver-hint.d.ts.map +1 -0
- package/dist/system-prompt/org/receiver-hint.js +116 -0
- package/dist/system-prompt/org/receiver-hint.js.map +1 -0
- package/dist/system-prompt/org/render-org-block.d.ts +42 -0
- package/dist/system-prompt/org/render-org-block.d.ts.map +1 -0
- package/dist/system-prompt/org/render-org-block.js +57 -0
- package/dist/system-prompt/org/render-org-block.js.map +1 -0
- package/dist/system-prompt/org/sub-agent-anchor.d.ts +30 -0
- package/dist/system-prompt/org/sub-agent-anchor.d.ts.map +1 -0
- package/dist/system-prompt/org/sub-agent-anchor.js +36 -0
- package/dist/system-prompt/org/sub-agent-anchor.js.map +1 -0
- package/dist/system-prompt/override.d.ts +7 -0
- package/dist/system-prompt/override.d.ts.map +1 -0
- package/dist/system-prompt/override.js +13 -0
- package/dist/system-prompt/override.js.map +1 -0
- package/dist/system-prompt/pi-injection.d.ts +5 -0
- package/dist/system-prompt/pi-injection.d.ts.map +1 -0
- package/dist/system-prompt/pi-injection.js +33 -0
- package/dist/system-prompt/pi-injection.js.map +1 -0
- package/dist/system-prompt/runtime-params.d.ts +34 -0
- package/dist/system-prompt/runtime-params.d.ts.map +1 -0
- package/dist/system-prompt/runtime-params.js +108 -0
- package/dist/system-prompt/runtime-params.js.map +1 -0
- package/dist/system-prompt/sanitize.d.ts +7 -0
- package/dist/system-prompt/sanitize.d.ts.map +1 -0
- package/dist/system-prompt/sanitize.js +31 -0
- package/dist/system-prompt/sanitize.js.map +1 -0
- package/dist/system-prompt/types.d.ts +7 -0
- package/dist/system-prompt/types.d.ts.map +1 -0
- package/dist/system-prompt/types.js +3 -0
- package/dist/system-prompt/types.js.map +1 -0
- package/dist/system-prompt/workspace-loader.d.ts +12 -0
- package/dist/system-prompt/workspace-loader.d.ts.map +1 -0
- package/dist/system-prompt/workspace-loader.js +115 -0
- package/dist/system-prompt/workspace-loader.js.map +1 -0
- package/dist/tideline/advanced.d.ts +25 -0
- package/dist/tideline/advanced.d.ts.map +1 -0
- package/dist/tideline/advanced.js +34 -0
- package/dist/tideline/advanced.js.map +1 -0
- package/dist/tideline/eval.d.ts +19 -0
- package/dist/tideline/eval.d.ts.map +1 -0
- package/dist/tideline/eval.js +24 -0
- package/dist/tideline/eval.js.map +1 -0
- package/dist/tideline/host-ports.standalone.d.ts +49 -0
- package/dist/tideline/host-ports.standalone.d.ts.map +1 -0
- package/dist/tideline/host-ports.standalone.js +61 -0
- package/dist/tideline/host-ports.standalone.js.map +1 -0
- package/dist/tideline/index.d.ts +34 -0
- package/dist/tideline/index.d.ts.map +1 -0
- package/dist/tideline/index.js +42 -0
- package/dist/tideline/index.js.map +1 -0
- package/dist/tui/approval-prompt.d.ts +73 -0
- package/dist/tui/approval-prompt.d.ts.map +1 -0
- package/dist/tui/approval-prompt.js +272 -0
- package/dist/tui/approval-prompt.js.map +1 -0
- package/dist/tui/client.d.ts +89 -0
- package/dist/tui/client.d.ts.map +1 -0
- package/dist/tui/client.js.map +1 -0
- package/dist/ui/brand-frames-cli.d.ts +19 -0
- package/dist/ui/brand-frames-cli.d.ts.map +1 -0
- package/dist/ui/brand-frames-cli.js +8 -13
- package/dist/ui/brand-frames-cli.js.map +1 -0
- package/dist/ui/brand.d.ts +41 -0
- package/dist/ui/brand.d.ts.map +1 -0
- package/dist/ui/brand.js +28 -6
- package/dist/ui/brand.js.map +1 -0
- package/dist/ui/editor.d.ts +30 -0
- package/dist/ui/editor.d.ts.map +1 -0
- package/dist/ui/editor.js +73 -0
- package/dist/ui/editor.js.map +1 -0
- package/dist/ui/format-session.d.ts +68 -0
- package/dist/ui/format-session.d.ts.map +1 -0
- package/dist/ui/format-session.js +181 -0
- package/dist/ui/format-session.js.map +1 -0
- package/dist/ui/markdown.d.ts +48 -0
- package/dist/ui/markdown.d.ts.map +1 -0
- package/dist/ui/markdown.js +60 -0
- package/dist/ui/markdown.js.map +1 -0
- package/dist/ui/onboard-storage-mode.d.ts +17 -0
- package/dist/ui/onboard-storage-mode.d.ts.map +1 -0
- package/dist/ui/onboard-storage-mode.js +638 -0
- package/dist/ui/onboard-storage-mode.js.map +1 -0
- package/dist/ui/onboarding.d.ts +97 -0
- package/dist/ui/onboarding.d.ts.map +1 -0
- package/dist/ui/onboarding.js +259 -111
- package/dist/ui/onboarding.js.map +1 -0
- package/dist/ui/searchable-select.d.ts +48 -0
- package/dist/ui/searchable-select.d.ts.map +1 -0
- package/dist/ui/searchable-select.js +108 -0
- package/dist/ui/searchable-select.js.map +1 -0
- package/dist/ui/syntax-theme.d.ts +30 -0
- package/dist/ui/syntax-theme.d.ts.map +1 -0
- package/dist/ui/syntax-theme.js +72 -0
- package/dist/ui/syntax-theme.js.map +1 -0
- package/dist/ui/terminal-cleanup.d.ts +46 -0
- package/dist/ui/terminal-cleanup.d.ts.map +1 -0
- package/dist/ui/terminal-cleanup.js +17 -5
- package/dist/ui/terminal-cleanup.js.map +1 -0
- package/dist/ui/theme.d.ts +21 -0
- package/dist/ui/theme.d.ts.map +1 -0
- package/dist/ui/theme.js +66 -2
- package/dist/ui/theme.js.map +1 -0
- package/dist/ui/tool-result.d.ts +47 -0
- package/dist/ui/tool-result.d.ts.map +1 -0
- package/dist/ui/tool-result.js +100 -0
- package/dist/ui/tool-result.js.map +1 -0
- package/dist/utils/delivery-context.d.ts +50 -0
- package/dist/utils/delivery-context.d.ts.map +1 -0
- package/dist/utils/delivery-context.js +82 -0
- package/dist/utils/delivery-context.js.map +1 -0
- package/dist/utils/message-channel.d.ts +60 -0
- package/dist/utils/message-channel.d.ts.map +1 -0
- package/dist/utils/message-channel.js +103 -0
- package/dist/utils/message-channel.js.map +1 -0
- package/dist/utils/string-coerce.d.ts +50 -0
- package/dist/utils/string-coerce.d.ts.map +1 -0
- package/dist/utils/string-coerce.js +101 -0
- package/dist/utils/string-coerce.js.map +1 -0
- package/dist/version.d.ts +20 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +54 -0
- package/dist/version.js.map +1 -0
- package/dist/workspace/bootstrap.d.ts +12 -0
- package/dist/workspace/bootstrap.d.ts.map +1 -0
- package/dist/workspace/bootstrap.js +123 -0
- package/dist/workspace/bootstrap.js.map +1 -0
- package/dist/workspace/fs-utils.d.ts +2 -0
- package/dist/workspace/fs-utils.d.ts.map +1 -0
- package/dist/workspace/fs-utils.js +14 -0
- package/dist/workspace/fs-utils.js.map +1 -0
- package/dist/workspace/git-init.d.ts +5 -0
- package/dist/workspace/git-init.d.ts.map +1 -0
- package/dist/workspace/git-init.js +71 -0
- package/dist/workspace/git-init.js.map +1 -0
- package/dist/workspace/state.d.ts +13 -0
- package/dist/workspace/state.d.ts.map +1 -0
- package/dist/workspace/state.js +128 -0
- package/dist/workspace/state.js.map +1 -0
- package/dist/workspace/template-loader.d.ts +15 -0
- package/dist/workspace/template-loader.d.ts.map +1 -0
- package/dist/workspace/template-loader.js +214 -0
- package/dist/workspace/template-loader.js.map +1 -0
- package/package.json +173 -68
- package/scripts/build-done.mjs +125 -0
- package/scripts/run-brigade.mjs +208 -0
- package/skills/1password/SKILL.md +70 -0
- package/skills/1password/references/cli-examples.md +29 -0
- package/skills/1password/references/get-started.md +17 -0
- package/skills/apple-notes/SKILL.md +77 -0
- package/skills/apple-reminders/SKILL.md +118 -0
- package/skills/bear-notes/SKILL.md +107 -0
- package/skills/blogwatcher/SKILL.md +69 -0
- package/skills/blucli/SKILL.md +47 -0
- package/skills/bluebubbles/SKILL.md +136 -0
- package/skills/camsnap/SKILL.md +45 -0
- package/skills/canvas/SKILL.md +204 -0
- package/skills/coding-agent/SKILL.md +316 -0
- package/skills/discord/SKILL.md +197 -0
- package/skills/eightctl/SKILL.md +50 -0
- package/skills/gemini/SKILL.md +43 -0
- package/skills/gh-issues/SKILL.md +885 -0
- package/skills/gifgrep/SKILL.md +79 -0
- package/skills/git-commit/SKILL.md +40 -0
- package/skills/github/SKILL.md +163 -0
- package/skills/gog/SKILL.md +116 -0
- package/skills/goplaces/SKILL.md +52 -0
- package/skills/healthcheck/SKILL.md +245 -0
- package/skills/himalaya/SKILL.md +257 -0
- package/skills/himalaya/references/configuration.md +184 -0
- package/skills/himalaya/references/message-composition.md +199 -0
- package/skills/imsg/SKILL.md +122 -0
- package/skills/lead-scout/SKILL.md +46 -0
- package/skills/mcporter/SKILL.md +61 -0
- package/skills/model-usage/SKILL.md +69 -0
- package/skills/nano-pdf/SKILL.md +38 -0
- package/skills/node-connect/SKILL.md +142 -0
- package/skills/notion/SKILL.md +174 -0
- package/skills/oauth-setup/SKILL.md +55 -0
- package/skills/obsidian/SKILL.md +81 -0
- package/skills/openai-whisper/SKILL.md +38 -0
- package/skills/openai-whisper-api/SKILL.md +62 -0
- package/skills/openai-whisper-api/scripts/transcribe.sh +88 -0
- package/skills/openhue/SKILL.md +112 -0
- package/skills/oracle/SKILL.md +125 -0
- package/skills/ordercli/SKILL.md +78 -0
- package/skills/peekaboo/SKILL.md +190 -0
- package/skills/sag/SKILL.md +87 -0
- package/skills/session-logs/SKILL.md +151 -0
- package/skills/share-skills/SKILL.md +72 -0
- package/skills/sherpa-onnx-tts/SKILL.md +109 -0
- package/skills/sherpa-onnx-tts/bin/sherpa-onnx-tts +178 -0
- package/skills/skill-creator/SKILL.md +372 -0
- package/skills/skill-creator/license.txt +202 -0
- package/skills/skill-creator/scripts/init_skill.py +378 -0
- package/skills/skill-creator/scripts/package_skill.py +139 -0
- package/skills/skill-creator/scripts/quick_validate.py +159 -0
- package/skills/skill-creator/scripts/test_package_skill.py +160 -0
- package/skills/skill-creator/scripts/test_quick_validate.py +72 -0
- package/skills/slack/SKILL.md +144 -0
- package/skills/songsee/SKILL.md +49 -0
- package/skills/sonoscli/SKILL.md +65 -0
- package/skills/spotify-player/SKILL.md +64 -0
- package/skills/summarize/SKILL.md +87 -0
- package/skills/taskflow/SKILL.md +149 -0
- package/skills/taskflow-inbox-triage/SKILL.md +119 -0
- package/skills/things-mac/SKILL.md +86 -0
- package/skills/tmux/SKILL.md +170 -0
- package/skills/tmux/scripts/find-sessions.sh +112 -0
- package/skills/tmux/scripts/wait-for-text.sh +83 -0
- package/skills/trello/SKILL.md +108 -0
- package/skills/video-frames/SKILL.md +46 -0
- package/skills/video-frames/scripts/frame.sh +81 -0
- package/skills/voice-call/SKILL.md +45 -0
- package/skills/wacli/SKILL.md +72 -0
- package/skills/weather/SKILL.md +129 -0
- package/skills/xurl/SKILL.md +461 -0
- package/templates/workspace/AGENTS.md +223 -0
- package/templates/workspace/BOOTSTRAP.md +64 -0
- package/templates/workspace/HEARTBEAT.md +15 -0
- package/templates/workspace/IDENTITY.md +31 -0
- package/templates/workspace/SOUL.md +47 -0
- package/templates/workspace/TOOLS.md +48 -0
- package/templates/workspace/USER.md +25 -0
- package/CHANGELOG.md +0 -48
- package/SECURITY.md +0 -208
- package/assets/brigade-wordmark.png +0 -0
- package/dist/cli/chat-cmd.js +0 -191
- package/dist/cli/config-cmd.js +0 -171
- package/dist/cli/connect-cmd.js +0 -487
- package/dist/cli/doctor-cmd.js +0 -387
- package/dist/cli/gateway-cmd.js +0 -155
- package/dist/cli.js +0 -328
- package/dist/core/agent.js +0 -1123
- package/dist/core/auth-label.js +0 -147
- package/dist/core/cli-error.js +0 -94
- package/dist/core/error-classifier.js +0 -354
- package/dist/core/provider-payload-mutators.js +0 -517
- package/dist/core/provider-quirks.js +0 -285
- package/dist/core/smart-compaction.js +0 -209
- package/dist/core/system-prompt-defaults.js +0 -264
- package/dist/core/system-prompt-guidance.js +0 -271
- package/dist/index.js +0 -32
- package/dist/ui/brand-frames.js +0 -36
- package/dist/ui/chat.js +0 -1008
|
@@ -0,0 +1,787 @@
|
|
|
1
|
+
// src/agents/memory/vault.ts
|
|
2
|
+
//
|
|
3
|
+
// Tideline Step 21 — the Obsidian markdown vault.
|
|
4
|
+
//
|
|
5
|
+
// Renders each fact as a markdown note: YAML frontmatter (id / segment / tier /
|
|
6
|
+
// status + typed `links` as a Bases-friendly array) over the content body, a
|
|
7
|
+
// `## Related` section of REAL `[[wikilinks]]` (what Obsidian's graph view
|
|
8
|
+
// actually draws edges from — it IGNORES YAML string arrays), and a PINNED
|
|
9
|
+
// region the human owns. Per distinct `subject` we ALSO write one TOPIC-HUB note
|
|
10
|
+
// that `[[wikilinks]]` every fact sharing it, so the graph visibly CLUSTERS
|
|
11
|
+
// facts around their topic instead of showing isolated, cryptically-named nodes.
|
|
12
|
+
//
|
|
13
|
+
// The bug this fixes was a RENDERING bug, not a data bug: the prior renderer
|
|
14
|
+
// named each note by the raw `memoryId` (e.g. `mem_mqmhnc52_eod06u.md`) and
|
|
15
|
+
// stored edges ONLY as YAML strings (`links: - "relates:mem_…"`), which the
|
|
16
|
+
// graph view never draws. Filenames are now derived from the fact CONTENT
|
|
17
|
+
// (readable, unique, filesystem-safe) and edges are emitted as body wikilinks.
|
|
18
|
+
//
|
|
19
|
+
// 3-WAY MERGE (the load-bearing property): the dream/system PROPOSES a fresh
|
|
20
|
+
// render, but a human-edited PINNED region (between the `%% pinned %%` markers)
|
|
21
|
+
// is spliced back in verbatim — the system never clobbers hand edits. So
|
|
22
|
+
// re-rendering after a dream pass updates the frontmatter + body + wikilinks
|
|
23
|
+
// while the human's notes survive untouched. In convex mode the vault is not
|
|
24
|
+
// written at all — callers gate on `mode !== "convex"` before calling
|
|
25
|
+
// `writeVault`.
|
|
26
|
+
import { createHash } from "node:crypto";
|
|
27
|
+
import * as fs from "node:fs";
|
|
28
|
+
import * as path from "node:path";
|
|
29
|
+
import { renameWithRetry } from "../../infra/fs/atomic-rename.js";
|
|
30
|
+
import { cosine, getDefaultEmbedder } from "./embedder.js";
|
|
31
|
+
import { linksFrom } from "./links.js";
|
|
32
|
+
import { originBucketKey } from "./records.js";
|
|
33
|
+
const PIN_OPEN = "%% pinned %%";
|
|
34
|
+
const PIN_CLOSE = "%% /pinned %%";
|
|
35
|
+
// A stable, machine-detectable sentinel placed near the top of every
|
|
36
|
+
// SYSTEM-authored note (fact notes AND topic hubs). Prune keys off this — NOT
|
|
37
|
+
// off the filename — so a readable, content-derived filename (e.g.
|
|
38
|
+
// `secret to be shredded.md`) is still recognised as the system's to remove,
|
|
39
|
+
// while a human's own vault note (an Index / Map-of-Content / daily note),
|
|
40
|
+
// which carries no sentinel, is NEVER pruned. It lives on its own line as an
|
|
41
|
+
// Obsidian comment, so it is invisible in the rendered note and outside the
|
|
42
|
+
// pinned region the merge preserves.
|
|
43
|
+
const FACT_SENTINEL = "%% tideline:fact %%";
|
|
44
|
+
const HUB_SENTINEL = "%% tideline:hub %%";
|
|
45
|
+
// The single root MAP / Map-of-Content note (one per vault). It links UP from
|
|
46
|
+
// every topic hub and is the graph's center node, so the hubs are no longer
|
|
47
|
+
// disconnected islands. It carries its OWN sentinel so the prune recognises a
|
|
48
|
+
// STALE Map (e.g. after every subject was purged) as the system's to rewrite/
|
|
49
|
+
// remove — exactly like a hub — instead of leaving it orphaned with dangling
|
|
50
|
+
// `[[topic — …]]` links. A human's own Index/MOC (no sentinel) is still untouched.
|
|
51
|
+
const MAP_SENTINEL = "%% tideline:map %%";
|
|
52
|
+
/** Matches any system sentinel (fact | hub | map) as a standalone line (after trim). */
|
|
53
|
+
const SENTINEL_RE = /^%% tideline:(?:fact|hub|map) %%$/m;
|
|
54
|
+
/** ASCII-safe basename (no extension) of the root Map note. Emoji lives in the
|
|
55
|
+
* H1/body ONLY — never the filename — so the file is portable across OSes. */
|
|
56
|
+
const MAP_BASENAME = "Memory Map";
|
|
57
|
+
/** Order STRONG edges render in the `## Related` section (stable, kind-grouped).
|
|
58
|
+
* `same_topic` is DELIBERATELY ABSENT — thematic edges render in their own
|
|
59
|
+
* quarantined `## Same area` section (see {@link renderSameArea}), never mingled
|
|
60
|
+
* with these strong factual/lifecycle edges. An edge kind not listed here sorts
|
|
61
|
+
* last (defensive — every non-thematic kind is covered). */
|
|
62
|
+
const LINK_KIND_ORDER = [
|
|
63
|
+
// store-minted lifecycle / mechanism edges
|
|
64
|
+
"supersedes",
|
|
65
|
+
"corrects",
|
|
66
|
+
"transition",
|
|
67
|
+
"contradicts",
|
|
68
|
+
// derivation / support
|
|
69
|
+
"derived_from",
|
|
70
|
+
"supports",
|
|
71
|
+
// strong factual taxonomy (the extractor's closed set)
|
|
72
|
+
"causes",
|
|
73
|
+
"caused_by",
|
|
74
|
+
"part_of",
|
|
75
|
+
"precedes",
|
|
76
|
+
"follows",
|
|
77
|
+
"enables",
|
|
78
|
+
"blocks",
|
|
79
|
+
"co_constrains",
|
|
80
|
+
"located_at",
|
|
81
|
+
"uses",
|
|
82
|
+
"works_on",
|
|
83
|
+
"contrasts_with",
|
|
84
|
+
"relates_to",
|
|
85
|
+
// legacy generic association (synonymy/bridge)
|
|
86
|
+
"relates",
|
|
87
|
+
];
|
|
88
|
+
/** Stable display order for the Map's per-segment cluster headings (most
|
|
89
|
+
* authoritative self-model first, ephemeral last — mirrors SEGMENT_SPECIFICITY).
|
|
90
|
+
* A segment not in this list (defensive — none today) sorts last, alphabetically. */
|
|
91
|
+
const SEGMENT_RENDER_ORDER = [
|
|
92
|
+
"identity",
|
|
93
|
+
"correction",
|
|
94
|
+
"preference",
|
|
95
|
+
"relationship",
|
|
96
|
+
"project",
|
|
97
|
+
"knowledge",
|
|
98
|
+
"context",
|
|
99
|
+
];
|
|
100
|
+
function segmentRank(seg) {
|
|
101
|
+
const i = SEGMENT_RENDER_ORDER.indexOf(seg);
|
|
102
|
+
return i === -1 ? SEGMENT_RENDER_ORDER.length : i;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Cosine bar a semantic BRIDGE must clear to link two facts that have no typed
|
|
106
|
+
* edge between them. Deliberately HIGH (0.6): a bridge is purely ADDITIVE
|
|
107
|
+
* connective tissue, so it must fire only on genuinely-near content — a low bar
|
|
108
|
+
* would web everything to everything and destroy the cluster structure the Map +
|
|
109
|
+
* hubs create. Re-measure against any LEARNED embedder before lowering (the
|
|
110
|
+
* bundled HRR embedder's unrelated-pair cosine on a small corpus already sits in
|
|
111
|
+
* the low-0.3s — see embedder.ts — so 0.6 keeps a comfortable margin over noise).
|
|
112
|
+
*/
|
|
113
|
+
const BRIDGE_COSINE_BAR = 0.6;
|
|
114
|
+
/** Max semantic bridges added PER fact — caps degree so one chatty fact can't
|
|
115
|
+
* fan out into a hairball that drowns the typed edges. Highest-cosine first. */
|
|
116
|
+
const MAX_BRIDGES_PER_FACT = 3;
|
|
117
|
+
function yamlValue(v) {
|
|
118
|
+
// Bare when unambiguous; otherwise a JSON string IS a valid YAML double-quoted
|
|
119
|
+
// scalar — it escapes backslash, quote, AND control chars (newline/tab/…),
|
|
120
|
+
// which a hand-rolled quote-only escape would corrupt into invalid frontmatter.
|
|
121
|
+
return /^[A-Za-z0-9 _./-]+$/.test(v) ? v : JSON.stringify(v);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Sanitise arbitrary fact text into a filesystem-safe, readable note BASENAME
|
|
125
|
+
* (no extension): replace the Windows/POSIX-reserved characters `\ / : * ? " < > |`
|
|
126
|
+
* and any control char with a space, collapse internal whitespace to single
|
|
127
|
+
* spaces, trim, and cap at ~80 chars (on a word boundary when one is near the
|
|
128
|
+
* cap). Trailing dots and spaces — illegal at the END of a Windows filename —
|
|
129
|
+
* are trimmed too. Hyphens/underscores/dots are LEGAL and kept (readability).
|
|
130
|
+
* Empty/degenerate input falls back to `"untitled"` so a name always exists;
|
|
131
|
+
* the caller still disambiguates collisions with a short id suffix.
|
|
132
|
+
*/
|
|
133
|
+
function sanitizeForFilename(content) {
|
|
134
|
+
// eslint-disable-next-line no-control-regex
|
|
135
|
+
let s = content.replace(/[\\/:*?"<>|\x00-\x1f]/g, " ").replace(/\s+/g, " ").trim();
|
|
136
|
+
if (s.length > 80) {
|
|
137
|
+
const cut = s.slice(0, 80);
|
|
138
|
+
const lastSpace = cut.lastIndexOf(" ");
|
|
139
|
+
s = lastSpace >= 40 ? cut.slice(0, lastSpace) : cut;
|
|
140
|
+
s = s.trim();
|
|
141
|
+
}
|
|
142
|
+
// A Windows filename may not END in a space or dot.
|
|
143
|
+
s = s.replace(/[. ]+$/g, "");
|
|
144
|
+
return s.length > 0 ? s : "untitled";
|
|
145
|
+
}
|
|
146
|
+
/** Short, stable per-id suffix (8 hex of sha1(memoryId)) to break a basename
|
|
147
|
+
* collision. Derived from the id — NOT iteration order — so the same record
|
|
148
|
+
* always resolves to the same filename across passes (prune/merge depend on it). */
|
|
149
|
+
function idSuffix(memoryId) {
|
|
150
|
+
return createHash("sha1").update(memoryId).digest("hex").slice(0, 8);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Build the id→filename map over the WHOLE record set FIRST, so every note's
|
|
154
|
+
* `## Related` wikilinks (and each hub's member links) resolve to the real
|
|
155
|
+
* on-disk filename. Deterministic and pass-stable:
|
|
156
|
+
* - a basename owned by exactly ONE record → `<basename>.md`;
|
|
157
|
+
* - a basename shared by MORE THAN ONE record → every sharer gets
|
|
158
|
+
* `<basename> (<idSuffix>).md`, so the choice never depends on which record
|
|
159
|
+
* was iterated first (a per-id suffix, not a positional one).
|
|
160
|
+
* `.md` is appended by callers via {@link factFileName}.
|
|
161
|
+
*/
|
|
162
|
+
function buildNameMap(records) {
|
|
163
|
+
// First pass: group ids by their sanitised basename to find collisions.
|
|
164
|
+
const byBase = new Map();
|
|
165
|
+
for (const r of records) {
|
|
166
|
+
const base = sanitizeForFilename(r.content);
|
|
167
|
+
const ids = byBase.get(base);
|
|
168
|
+
if (ids)
|
|
169
|
+
ids.push(r.memoryId);
|
|
170
|
+
else
|
|
171
|
+
byBase.set(base, [r.memoryId]);
|
|
172
|
+
}
|
|
173
|
+
const map = new Map();
|
|
174
|
+
for (const [base, ids] of byBase) {
|
|
175
|
+
if (ids.length === 1) {
|
|
176
|
+
map.set(ids[0], base);
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
// Shared basename → disambiguate every sharer by its own id (stable).
|
|
180
|
+
for (const id of ids)
|
|
181
|
+
map.set(id, `${base} (${idSuffix(id)})`);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return map;
|
|
185
|
+
}
|
|
186
|
+
/** `.md` filename for a fact, from its basename in the name map. */
|
|
187
|
+
function factFileName(memoryId, names) {
|
|
188
|
+
return `${names.get(memoryId) ?? `untitled (${idSuffix(memoryId)})`}.md`;
|
|
189
|
+
}
|
|
190
|
+
/** Hub BASENAME for a subject (no extension): `topic — <subject>`, sanitised. */
|
|
191
|
+
function hubBaseName(subject) {
|
|
192
|
+
return sanitizeForFilename(`topic — ${subject}`);
|
|
193
|
+
}
|
|
194
|
+
/** Synthetic name-map KEY for a subject's hub. A memoryId is always `mem_…`, so
|
|
195
|
+
* the `hub:` prefix can never collide with a real id — the hub can ride in the
|
|
196
|
+
* same id→filename map the facts use. */
|
|
197
|
+
function hubKey(subject) {
|
|
198
|
+
return `hub:${subject}`;
|
|
199
|
+
}
|
|
200
|
+
/** Tag-safe form of a subject/segment for an Obsidian `#tag` (spaces/slashes/
|
|
201
|
+
* reserved chars → `_`). Keeps `topic/<subject>` readable in the graph. */
|
|
202
|
+
function tagToken(raw) {
|
|
203
|
+
// eslint-disable-next-line no-control-regex
|
|
204
|
+
const t = raw.replace(/[\\/:*?"<>|#\x00-\x1f]/g, " ").replace(/\s+/g, "_").replace(/^_+|_+$/g, "");
|
|
205
|
+
return t.length > 0 ? t : "misc";
|
|
206
|
+
}
|
|
207
|
+
function renderFrontmatter(r) {
|
|
208
|
+
const lines = ["---", `id: ${yamlValue(r.memoryId)}`, `segment: ${r.segment}`, `tier: ${r.tier}`];
|
|
209
|
+
// Mark non-active (retracted/archived) notes so the vault distinguishes a live fact
|
|
210
|
+
// from restorable history rather than rendering them identically.
|
|
211
|
+
if (r.lifecycle && r.lifecycle !== "active")
|
|
212
|
+
lines.push(`lifecycle: ${r.lifecycle}`);
|
|
213
|
+
if (r.status)
|
|
214
|
+
lines.push(`status: ${r.status}`);
|
|
215
|
+
if (r.subjectKey)
|
|
216
|
+
lines.push(`subject: ${yamlValue(r.subjectKey)}`);
|
|
217
|
+
if (typeof r.confidence === "number")
|
|
218
|
+
lines.push(`confidence: ${r.confidence}`);
|
|
219
|
+
// Tags drive Obsidian's tag pane + are graph-visible. `topic/<subject>` is the
|
|
220
|
+
// per-topic cluster tag (mirrors the hub note's wikilinks); the segment is a
|
|
221
|
+
// coarse colour axis; `archived` marks restorable history so the graph shows
|
|
222
|
+
// it distinctly from live facts. Stored as a YAML flow array.
|
|
223
|
+
const tags = [];
|
|
224
|
+
if (r.subjectKey)
|
|
225
|
+
tags.push(`topic/${tagToken(r.subjectKey)}`);
|
|
226
|
+
tags.push(tagToken(r.segment));
|
|
227
|
+
if (r.lifecycle && r.lifecycle !== "active")
|
|
228
|
+
tags.push("archived");
|
|
229
|
+
lines.push(`tags: [${tags.join(", ")}]`);
|
|
230
|
+
// Keep the machine-readable typed edges in the frontmatter too (Bases/queries
|
|
231
|
+
// read these; the graph reads the `## Related` wikilinks below). Both kept.
|
|
232
|
+
const links = linksFrom(r);
|
|
233
|
+
if (links.length > 0) {
|
|
234
|
+
lines.push("links:");
|
|
235
|
+
for (const l of links)
|
|
236
|
+
lines.push(` - ${yamlValue(`${l.kind}:${l.target}`)}`);
|
|
237
|
+
}
|
|
238
|
+
lines.push("---");
|
|
239
|
+
return lines.join("\n");
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* The `## Related` section: every typed outbound edge whose target is IN the
|
|
243
|
+
* current record set, rendered as a REAL wikilink `- <kind>: [[<file w/o .md>]]`
|
|
244
|
+
* (kind-grouped, stable order, ALL seven kinds — supersedes/corrects/transition/
|
|
245
|
+
* contradicts/derived_from/supports/relates). This is what makes Obsidian draw
|
|
246
|
+
* graph edges. An edge to a target absent from `names` (purged/out-of-scope) is
|
|
247
|
+
* skipped — a dangling `[[…]]` would otherwise spawn a phantom placeholder node.
|
|
248
|
+
*
|
|
249
|
+
* `bridges` are conservative SEMANTIC bridges (Step: connected-graph) — additional
|
|
250
|
+
* `relates`-style edges to genuinely-near same-origin facts, computed by
|
|
251
|
+
* {@link buildBridges} only when an embedder is available. They are appended as
|
|
252
|
+
* `- relates (bridge): [[…]]` and de-duped against the typed edges above (a pair
|
|
253
|
+
* already joined by a real edge gets no bridge). Returns "" when nothing links.
|
|
254
|
+
*/
|
|
255
|
+
function renderRelated(r, names, bridges) {
|
|
256
|
+
// STRONG edges only — `same_topic` (thematic) is quarantined to `## Same area`.
|
|
257
|
+
const links = linksFrom(r).filter((l) => l.kind !== "same_topic" && names.has(l.target));
|
|
258
|
+
links.sort((a, b) => orderRank(a.kind) - orderRank(b.kind));
|
|
259
|
+
// `- <kind>: [[target]] — <reason>` (the explainable, justified edge). The reason
|
|
260
|
+
// is present on extractor edges (mandatory at extraction); store-minted lifecycle
|
|
261
|
+
// edges carry none, so they render as the bare typed wikilink.
|
|
262
|
+
const items = links.map((l) => `- ${l.kind}: [[${names.get(l.target)}]]${edgeReasonSuffix(l)}`);
|
|
263
|
+
// Append semantic bridges to targets NOT already joined by a typed edge above
|
|
264
|
+
// (so a bridge never duplicates a real edge). Only targets present in `names`
|
|
265
|
+
// (existing notes) — buildBridges already guarantees this, but re-check so a stale
|
|
266
|
+
// set can't emit a phantom node. A bridge that coincides with a quarantined
|
|
267
|
+
// same_topic target is still allowed (it's a stronger embedding-based signal).
|
|
268
|
+
if (bridges && bridges.size > 0) {
|
|
269
|
+
const alreadyLinked = new Set(links.map((l) => l.target));
|
|
270
|
+
for (const target of bridges) {
|
|
271
|
+
if (alreadyLinked.has(target) || !names.has(target))
|
|
272
|
+
continue;
|
|
273
|
+
items.push(`- relates (bridge): [[${names.get(target)}]]`);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
if (items.length === 0)
|
|
277
|
+
return "";
|
|
278
|
+
return `## Related\n${items.join("\n")}\n`;
|
|
279
|
+
}
|
|
280
|
+
/** Stable sort rank for a strong edge kind (unlisted kinds sort last). */
|
|
281
|
+
function orderRank(kind) {
|
|
282
|
+
const i = LINK_KIND_ORDER.indexOf(kind);
|
|
283
|
+
return i === -1 ? LINK_KIND_ORDER.length : i;
|
|
284
|
+
}
|
|
285
|
+
/** ` — <reason>` suffix for an edge that carries a justification; "" otherwise. The
|
|
286
|
+
* reason is single-line (collapse any stray newline) so one edge stays one bullet. */
|
|
287
|
+
function edgeReasonSuffix(l) {
|
|
288
|
+
const reason = l.reason?.trim();
|
|
289
|
+
return reason ? ` — ${reason.replace(/\s+/g, " ")}` : "";
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* The QUARANTINED `## Same area` section — thematic / same-domain `same_topic` edges,
|
|
293
|
+
* rendered SEPARATELY from the strong `## Related` edges so a same-domain pair (e.g.
|
|
294
|
+
* dark-mode ~ Obsidian) appears as an HONEST weak thematic link without masquerading
|
|
295
|
+
* as a strong relationship. Uses `~` (not the typed `- kind:` form) to read as a soft
|
|
296
|
+
* association. Only targets present in `names`; "" when there are none.
|
|
297
|
+
*/
|
|
298
|
+
function renderSameArea(r, names) {
|
|
299
|
+
const items = linksFrom(r)
|
|
300
|
+
.filter((l) => l.kind === "same_topic" && names.has(l.target))
|
|
301
|
+
.map((l) => `- ~ [[${names.get(l.target)}]]${edgeReasonSuffix(l)}`);
|
|
302
|
+
if (items.length === 0)
|
|
303
|
+
return "";
|
|
304
|
+
return `## Same area\n${items.join("\n")}\n`;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Render a fact to a full markdown note: frontmatter (with tags) + the system
|
|
308
|
+
* sentinel + body + an optional topic-hub backlink + `## Related` wikilinks +
|
|
309
|
+
* empty pin region. `names` resolves link targets (and this fact's own topic
|
|
310
|
+
* hub) to readable filenames; OMITTING it (e.g. a bare `renderNote(rec)`) means
|
|
311
|
+
* no edges can be resolved, so the `## Related` / hub-backlink sections are
|
|
312
|
+
* simply absent — the frontmatter + body + pin region still render. `bridges`
|
|
313
|
+
* (optional) is this fact's set of semantic-bridge target ids from
|
|
314
|
+
* {@link buildBridges}.
|
|
315
|
+
*/
|
|
316
|
+
export function renderNote(r, names, bridges) {
|
|
317
|
+
const resolve = names ?? new Map();
|
|
318
|
+
const sections = [renderFrontmatter(r), FACT_SENTINEL, r.content];
|
|
319
|
+
// Backlink to this fact's topic hub (the cluster anchor), when it has a subject
|
|
320
|
+
// and the hub is in scope. The hub also links back — a two-way edge clusters the
|
|
321
|
+
// fact tightly around its topic in the graph.
|
|
322
|
+
if (r.subjectKey && resolve.has(hubKey(r.subjectKey))) {
|
|
323
|
+
sections.push(`Topic: [[${hubBaseName(r.subjectKey)}]]`);
|
|
324
|
+
}
|
|
325
|
+
const related = renderRelated(r, resolve, bridges);
|
|
326
|
+
if (related)
|
|
327
|
+
sections.push(related.trimEnd());
|
|
328
|
+
// QUARANTINED thematic edges — their OWN section, after the strong `## Related`
|
|
329
|
+
// ones, so a same-domain hint never masquerades as a strong relationship.
|
|
330
|
+
const sameArea = renderSameArea(r, resolve);
|
|
331
|
+
if (sameArea)
|
|
332
|
+
sections.push(sameArea.trimEnd());
|
|
333
|
+
sections.push(`${PIN_OPEN}\n\n${PIN_CLOSE}`);
|
|
334
|
+
return `${sections.join("\n\n")}\n`;
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Render a TOPIC-HUB note for `subject`: a system note whose body `[[wikilinks]]`
|
|
338
|
+
* to every member fact (DOWN, the cluster anchor) AND — so the hubs form one
|
|
339
|
+
* connected web rather than disconnected stars — UP to the root Map and ACROSS to
|
|
340
|
+
* its sibling hubs in the SAME segment.
|
|
341
|
+
*
|
|
342
|
+
* `opts.linkMap` adds `Part of: [[Memory Map]]` (the UP edge to the graph centre);
|
|
343
|
+
* the caller sets it only when a Map note is actually being written, so the
|
|
344
|
+
* wikilink never dangles. `opts.siblingSubjects` are the OTHER subjects sharing
|
|
345
|
+
* this hub's segment — rendered as a `Related topics:` list of `[[topic — …]]`
|
|
346
|
+
* (the ACROSS edges that turn a segment into a visible cluster). Both are purely
|
|
347
|
+
* structural: they link only to hubs/notes that exist. Members are listed in the
|
|
348
|
+
* order given (the caller passes them subject-stable).
|
|
349
|
+
*/
|
|
350
|
+
export function renderHubNote(subject, memberIds, names, opts = {}) {
|
|
351
|
+
const items = memberIds.filter((id) => names.has(id)).map((id) => `- [[${names.get(id)}]]`);
|
|
352
|
+
const front = ["---", `topic: ${yamlValue(subject)}`, `tags: [topic/${tagToken(subject)}, hub]`, "---"].join("\n");
|
|
353
|
+
const body = items.length > 0 ? items.join("\n") : "_(no facts under this topic yet)_";
|
|
354
|
+
const sections = [front, HUB_SENTINEL, `# ${subject}`];
|
|
355
|
+
// UP edge to the root Map (the graph centre) — only when a Map is written.
|
|
356
|
+
if (opts.linkMap)
|
|
357
|
+
sections.push(`Part of: [[${MAP_BASENAME}]]`);
|
|
358
|
+
sections.push(`Facts on this topic:\n\n${body}`);
|
|
359
|
+
// ACROSS edges to sibling hubs in the same segment (the cluster's interlinks).
|
|
360
|
+
const siblings = (opts.siblingSubjects ?? []).filter((s) => s !== subject);
|
|
361
|
+
if (siblings.length > 0) {
|
|
362
|
+
const links = siblings.map((s) => `- [[${hubBaseName(s)}]]`).join("\n");
|
|
363
|
+
sections.push(`Related topics:\n\n${links}`);
|
|
364
|
+
}
|
|
365
|
+
sections.push(`${PIN_OPEN}\n\n${PIN_CLOSE}`);
|
|
366
|
+
return `${sections.join("\n\n")}\n`;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Render the root MAP / Map-of-Content note — the graph's CENTER node. It links to
|
|
370
|
+
* EVERY topic hub (`[[topic — <subject>]]`), GROUPED under a per-segment heading
|
|
371
|
+
* (`## identity`, `## preference`, …) so each segment reads as a cluster, with the
|
|
372
|
+
* active-fact count shown per topic. This is what turns N disconnected hub-stars
|
|
373
|
+
* into one connected web (Map → hubs → facts, plus the hubs' sibling interlinks).
|
|
374
|
+
*
|
|
375
|
+
* STRUCTURAL ONLY: it lists subjects/segments that ACTUALLY occur in the record
|
|
376
|
+
* set — it never invents a topic, a fact, or a count. `segments` maps each segment
|
|
377
|
+
* → its subjects (insertion-stable from the caller); `activeCounts` maps subject →
|
|
378
|
+
* its ACTIVE-fact tally (archived facts are excluded from the headline number,
|
|
379
|
+
* matching what the operator thinks of as "live" facts on a topic). Carries the
|
|
380
|
+
* map sentinel so a STALE Map is pruned/rewritten like a hub, and the usual pinned
|
|
381
|
+
* region so a human can annotate the map and have it survive a re-render.
|
|
382
|
+
*/
|
|
383
|
+
export function renderMapNote(segments, activeCounts) {
|
|
384
|
+
const front = ["---", "title: Memory Map", "tags: [map]", "---"].join("\n");
|
|
385
|
+
const orderedSegments = [...segments.keys()].sort((a, b) => segmentRank(a) - segmentRank(b) || a.localeCompare(b));
|
|
386
|
+
const blocks = [];
|
|
387
|
+
for (const seg of orderedSegments) {
|
|
388
|
+
const subjects = segments.get(seg) ?? [];
|
|
389
|
+
if (subjects.length === 0)
|
|
390
|
+
continue;
|
|
391
|
+
const lines = subjects.map((s) => {
|
|
392
|
+
const n = activeCounts.get(s) ?? 0;
|
|
393
|
+
// "(N active)" — the count is the LIVE-fact tally; pluralise for readability.
|
|
394
|
+
return `- [[${hubBaseName(s)}]] (${n} active fact${n === 1 ? "" : "s"})`;
|
|
395
|
+
});
|
|
396
|
+
blocks.push(`## ${seg}\n\n${lines.join("\n")}`);
|
|
397
|
+
}
|
|
398
|
+
const body = blocks.length > 0 ? blocks.join("\n\n") : "_(no topics yet — facts with a subject will cluster here)_";
|
|
399
|
+
return `${front}\n\n${MAP_SENTINEL}\n\n# 🗺️ Memory Map\n\n${body}\n\n${PIN_OPEN}\n\n${PIN_CLOSE}\n`;
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Build conservative SEMANTIC bridges between facts — `memoryId → set of target
|
|
403
|
+
* memoryIds` to additionally link as `relates (bridge)` edges. Purely ADDITIVE
|
|
404
|
+
* connective tissue so the graph reads as one web instead of isolated stars: it
|
|
405
|
+
* connects ONLY facts that genuinely co-occur, and only ones that already exist as
|
|
406
|
+
* notes. It NEVER fabricates content — it only draws edges between real records.
|
|
407
|
+
*
|
|
408
|
+
* Conditions for a bridge between facts A and B:
|
|
409
|
+
* - both are in `names` (i.e. both have an on-disk note to link);
|
|
410
|
+
* - SAME origin (`originBucketKey`) — never bridge an owner fact to a peer's, or
|
|
411
|
+
* two different peers' facts (mirrors every other cross-fact op's isolation);
|
|
412
|
+
* - NOT already joined by a typed edge in EITHER direction (no duplicate);
|
|
413
|
+
* - embedding cosine ≥ {@link BRIDGE_COSINE_BAR} (a HIGH bar — bridges fire only
|
|
414
|
+
* on genuinely-near content).
|
|
415
|
+
* Each fact keeps at most {@link MAX_BRIDGES_PER_FACT} bridges (highest cosine
|
|
416
|
+
* first) so one fact can't fan out into a hairball. Edges are SYMMETRIC (both
|
|
417
|
+
* endpoints record the bridge) so the link renders from either note.
|
|
418
|
+
*
|
|
419
|
+
* EMBEDDER GUARD — the whole feature is opt-in on a usable embedder. A vector is
|
|
420
|
+
* the record's stored `embedding` when present, else the fact's `content` embedded
|
|
421
|
+
* on demand. If the embedder is async (returns a Promise), throws, or yields a
|
|
422
|
+
* wrong-width vector, that record simply has NO vector and forms no bridges; if NO
|
|
423
|
+
* record ends up with a vector, the function returns an empty map and the vault
|
|
424
|
+
* renders with typed edges only. Nothing crosses the bar ⇒ empty map ⇒ no bridges.
|
|
425
|
+
*/
|
|
426
|
+
export function buildBridges(records, names) {
|
|
427
|
+
const out = new Map();
|
|
428
|
+
// Only facts that will actually have a note can be bridge endpoints.
|
|
429
|
+
const linkable = records.filter((r) => names.has(r.memoryId));
|
|
430
|
+
if (linkable.length < 2)
|
|
431
|
+
return out;
|
|
432
|
+
// Resolve a vector per record (stored, else embed-on-demand), embedder-guarded.
|
|
433
|
+
// A single shared embedder instance; the bundled HRR/Hashing embedders are sync.
|
|
434
|
+
let embed;
|
|
435
|
+
try {
|
|
436
|
+
const emb = getDefaultEmbedder();
|
|
437
|
+
embed = (text) => {
|
|
438
|
+
try {
|
|
439
|
+
const v = emb.embed([text]);
|
|
440
|
+
if (v instanceof Promise)
|
|
441
|
+
return undefined; // async model → skip (sync-only path)
|
|
442
|
+
const vec = v[0];
|
|
443
|
+
return Array.isArray(vec) && vec.length === emb.dims ? vec : undefined;
|
|
444
|
+
}
|
|
445
|
+
catch {
|
|
446
|
+
return undefined;
|
|
447
|
+
}
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
catch {
|
|
451
|
+
embed = undefined; // no embedder at all → no bridges
|
|
452
|
+
}
|
|
453
|
+
const vectors = new Map();
|
|
454
|
+
for (const r of linkable) {
|
|
455
|
+
const stored = Array.isArray(r.embedding) && r.embedding.length > 0 ? r.embedding : undefined;
|
|
456
|
+
const v = stored ?? (embed ? embed(r.content) : undefined);
|
|
457
|
+
if (v)
|
|
458
|
+
vectors.set(r.memoryId, v);
|
|
459
|
+
}
|
|
460
|
+
if (vectors.size < 2)
|
|
461
|
+
return out; // need at least one comparable pair
|
|
462
|
+
// Existing typed edges (either direction) — excluded so a bridge never dupes one.
|
|
463
|
+
const typed = new Set();
|
|
464
|
+
const pairKey = (a, b) => (a < b ? `${a}\u0000${b}` : `${b}\u0000${a}`);
|
|
465
|
+
for (const r of linkable) {
|
|
466
|
+
for (const l of linksFrom(r)) {
|
|
467
|
+
if (names.has(l.target))
|
|
468
|
+
typed.add(pairKey(r.memoryId, l.target));
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
const cands = [];
|
|
472
|
+
for (let i = 0; i < linkable.length; i++) {
|
|
473
|
+
const ra = linkable[i];
|
|
474
|
+
const va = vectors.get(ra.memoryId);
|
|
475
|
+
if (!va)
|
|
476
|
+
continue;
|
|
477
|
+
for (let j = i + 1; j < linkable.length; j++) {
|
|
478
|
+
const rb = linkable[j];
|
|
479
|
+
const vb = vectors.get(rb.memoryId);
|
|
480
|
+
if (!vb)
|
|
481
|
+
continue;
|
|
482
|
+
if (originBucketKey(ra) !== originBucketKey(rb))
|
|
483
|
+
continue; // origin isolation
|
|
484
|
+
if (typed.has(pairKey(ra.memoryId, rb.memoryId)))
|
|
485
|
+
continue; // already a typed edge
|
|
486
|
+
if (va.length !== vb.length)
|
|
487
|
+
continue; // mismatched embedder widths
|
|
488
|
+
const cos = cosine(va, vb);
|
|
489
|
+
if (cos >= BRIDGE_COSINE_BAR)
|
|
490
|
+
cands.push({ a: ra.memoryId, b: rb.memoryId, cos });
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
// Strongest first; ties broken by id pair for determinism (pass-stable output).
|
|
494
|
+
cands.sort((x, y) => y.cos - x.cos || pairKey(x.a, x.b).localeCompare(pairKey(y.a, y.b)));
|
|
495
|
+
const degree = new Map();
|
|
496
|
+
const deg = (id) => degree.get(id) ?? 0;
|
|
497
|
+
const add = (from, to) => {
|
|
498
|
+
let s = out.get(from);
|
|
499
|
+
if (!s) {
|
|
500
|
+
s = new Set();
|
|
501
|
+
out.set(from, s);
|
|
502
|
+
}
|
|
503
|
+
s.add(to);
|
|
504
|
+
degree.set(from, deg(from) + 1);
|
|
505
|
+
};
|
|
506
|
+
for (const c of cands) {
|
|
507
|
+
// Symmetric degree cap: add only if BOTH endpoints have headroom (keeps the
|
|
508
|
+
// edge two-way so it renders from either note without a one-sided dangle).
|
|
509
|
+
if (deg(c.a) >= MAX_BRIDGES_PER_FACT || deg(c.b) >= MAX_BRIDGES_PER_FACT)
|
|
510
|
+
continue;
|
|
511
|
+
add(c.a, c.b);
|
|
512
|
+
add(c.b, c.a);
|
|
513
|
+
}
|
|
514
|
+
return out;
|
|
515
|
+
}
|
|
516
|
+
/** Index of the LAST line that is EXACTLY `marker` (after trim), or -1. */
|
|
517
|
+
function lastMarkerLine(lines, marker) {
|
|
518
|
+
for (let i = lines.length - 1; i >= 0; i--)
|
|
519
|
+
if (lines[i].trim() === marker)
|
|
520
|
+
return i;
|
|
521
|
+
return -1;
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* Extract the pinned region's INNER text. LINE-ANCHORED: the open marker is the
|
|
525
|
+
* LAST line that is exactly `%% pinned %%`, the close is the first subsequent line
|
|
526
|
+
* exactly `%% /pinned %%` — so a marker token embedded MID-LINE in the human's own
|
|
527
|
+
* prose (or in a fact body that discusses the `%%` comment syntax) is NOT treated as
|
|
528
|
+
* a delimiter and cannot truncate/hijack the region. Missing close → captures
|
|
529
|
+
* OPEN→EOF rather than discarding edits. `undefined` when there is no open-marker line.
|
|
530
|
+
*/
|
|
531
|
+
export function extractPinned(md) {
|
|
532
|
+
const lines = md.split("\n");
|
|
533
|
+
const open = lastMarkerLine(lines, PIN_OPEN);
|
|
534
|
+
if (open === -1)
|
|
535
|
+
return undefined;
|
|
536
|
+
let close = lines.length;
|
|
537
|
+
for (let i = open + 1; i < lines.length; i++) {
|
|
538
|
+
if (lines[i].trim() === PIN_CLOSE) {
|
|
539
|
+
close = i;
|
|
540
|
+
break;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
return lines.slice(open + 1, close).join("\n");
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* 3-way merge: take the `proposed` render but splice the EXISTING note's pinned
|
|
547
|
+
* region back in, so a human edit survives a re-render. Line-anchored (matches
|
|
548
|
+
* extractPinned). No existing note / no pin region → `proposed` unchanged.
|
|
549
|
+
*/
|
|
550
|
+
export function mergeNote(existing, proposed) {
|
|
551
|
+
if (!existing)
|
|
552
|
+
return proposed;
|
|
553
|
+
const pinned = extractPinned(existing);
|
|
554
|
+
if (pinned === undefined)
|
|
555
|
+
return proposed;
|
|
556
|
+
const lines = proposed.split("\n");
|
|
557
|
+
const open = lastMarkerLine(lines, PIN_OPEN);
|
|
558
|
+
if (open === -1)
|
|
559
|
+
return proposed;
|
|
560
|
+
let close = lines.length;
|
|
561
|
+
for (let i = open + 1; i < lines.length; i++) {
|
|
562
|
+
if (lines[i].trim() === PIN_CLOSE) {
|
|
563
|
+
close = i;
|
|
564
|
+
break;
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
const tail = close < lines.length ? lines.slice(close) : [];
|
|
568
|
+
return [...lines.slice(0, open + 1), ...pinned.split("\n"), ...tail].join("\n");
|
|
569
|
+
}
|
|
570
|
+
/** True if `md` is a SYSTEM-authored note (carries a fact/hub sentinel). Prune
|
|
571
|
+
* keys off this so a readable, content-derived filename is still recognised as
|
|
572
|
+
* the system's to remove, while a human's own note (no sentinel) is left alone. */
|
|
573
|
+
function isSystemNote(md) {
|
|
574
|
+
return SENTINEL_RE.test(md);
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* Write/refresh the vault for `records` under `dir`, preserving pinned edits.
|
|
578
|
+
*
|
|
579
|
+
* Produces a CONNECTED, CLUSTERED graph with the topology of a well-built
|
|
580
|
+
* hand-crafted Obsidian vault — a root MAP → per-segment CLUSTERS → topic HUBS →
|
|
581
|
+
* fact LEAVES, plus cross-links so it reads as one web, not disconnected stars:
|
|
582
|
+
* - one note per fact (readable filename), each with `## Related` `[[wikilinks]]`
|
|
583
|
+
* to its typed neighbours (all seven edge kinds) PLUS conservative semantic
|
|
584
|
+
* bridges, a `topic/<subject>` tag, and a backlink to its topic hub;
|
|
585
|
+
* - one TOPIC-HUB note per distinct subject — links DOWN to its facts, UP to the
|
|
586
|
+
* Map, and ACROSS to its same-segment sibling hubs (the cluster interlinks);
|
|
587
|
+
* - one root MAP note (`Memory Map.md`) — the graph's centre — linking to EVERY
|
|
588
|
+
* hub grouped under per-segment headings, with each topic's active-fact count.
|
|
589
|
+
*
|
|
590
|
+
* `prune` (default OFF) removes any SYSTEM note (fact, hub, OR the Map — detected
|
|
591
|
+
* by the sentinel, NOT by filename) in `dir` NOT in the current render set — so an
|
|
592
|
+
* evicted/PURGED fact's note can't linger as plaintext on disk after a
|
|
593
|
+
* crypto-shred (the integrity counterpart to {@link FactStore.purge}), a hub for a
|
|
594
|
+
* now-empty subject is cleaned up, and a stale Map (all subjects gone) is removed
|
|
595
|
+
* rather than orphaned with dangling hub links. A human's own vault notes (their
|
|
596
|
+
* OWN Index/MOC/daily) carry no sentinel and are NEVER pruned. Callers that pass
|
|
597
|
+
* the FULL set for a vault (e.g. the whole owner origin) should enable it; callers
|
|
598
|
+
* passing a partial set must not.
|
|
599
|
+
*
|
|
600
|
+
* DURABILITY: each note is written via a sibling temp + atomic rename (the same
|
|
601
|
+
* tmp+rename pattern {@link FactStore} uses), so a crash mid-write leaves the
|
|
602
|
+
* OLD note — and the human-pinned region that lives ONLY in the .md (the fact
|
|
603
|
+
* body is recoverable from facts.jsonl; the pin is not) — intact rather than
|
|
604
|
+
* truncated. `renameWithRetry` rides over the Windows EPERM/EBUSY window an
|
|
605
|
+
* indexer/Obsidian briefly opens on the destination.
|
|
606
|
+
*
|
|
607
|
+
* BEST-EFFORT PER NOTE: a single unwritable/locked note (EACCES on a read-only
|
|
608
|
+
* note, EBUSY while held) is isolated so it neither skips the remaining notes
|
|
609
|
+
* nor — critically — skips the prune. The prune is the integrity step (it
|
|
610
|
+
* removes a just-shredded fact's plaintext note); `keep` is computed before any
|
|
611
|
+
* write, so it stays correct regardless of which renders succeeded, and so the
|
|
612
|
+
* prune runs unconditionally after the loop.
|
|
613
|
+
*/
|
|
614
|
+
export function writeVault(dir, records, opts = {}) {
|
|
615
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
616
|
+
// Build the id→filename map over ALL records FIRST so every wikilink resolves
|
|
617
|
+
// to a real on-disk name regardless of write order.
|
|
618
|
+
const names = buildNameMap(records);
|
|
619
|
+
// Group facts by subject for the topic hubs (stable insertion order). A fact
|
|
620
|
+
// with no subject contributes no hub link (and falls under no cluster). Hub
|
|
621
|
+
// basenames also enter `names` (under a synthetic hubKey) so a fact can render
|
|
622
|
+
// a `Topic: [[hub]]` backlink and the hub can be pruned/tracked like any note.
|
|
623
|
+
const subjects = new Map();
|
|
624
|
+
// Per subject: its SEGMENT (the cluster it lives in) + its ACTIVE-fact tally
|
|
625
|
+
// (the Map's headline count). Segment is taken from the first ACTIVE fact under
|
|
626
|
+
// the subject (an active fact defines the live cluster), else the first fact —
|
|
627
|
+
// a subject is normally single-segment, but this is deterministic if not.
|
|
628
|
+
const subjectSegment = new Map();
|
|
629
|
+
const subjectSegmentFromActive = new Set(); // segment was seeded by an active fact
|
|
630
|
+
const subjectActiveCount = new Map();
|
|
631
|
+
for (const r of records) {
|
|
632
|
+
if (!r.subjectKey)
|
|
633
|
+
continue;
|
|
634
|
+
const ids = subjects.get(r.subjectKey);
|
|
635
|
+
if (ids)
|
|
636
|
+
ids.push(r.memoryId);
|
|
637
|
+
else
|
|
638
|
+
subjects.set(r.subjectKey, [r.memoryId]);
|
|
639
|
+
const isActive = (r.lifecycle ?? "active") === "active";
|
|
640
|
+
if (isActive)
|
|
641
|
+
subjectActiveCount.set(r.subjectKey, (subjectActiveCount.get(r.subjectKey) ?? 0) + 1);
|
|
642
|
+
// Seed the segment if none yet, or UPGRADE a non-active seed to an active one.
|
|
643
|
+
if (!subjectSegment.has(r.subjectKey) || (isActive && !subjectSegmentFromActive.has(r.subjectKey))) {
|
|
644
|
+
subjectSegment.set(r.subjectKey, r.segment);
|
|
645
|
+
if (isActive)
|
|
646
|
+
subjectSegmentFromActive.add(r.subjectKey);
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
for (const subject of subjects.keys())
|
|
650
|
+
names.set(hubKey(subject), hubBaseName(subject));
|
|
651
|
+
// Subjects grouped by segment — drives BOTH the Map's per-segment clusters and
|
|
652
|
+
// each hub's same-segment sibling interlinks. Insertion-stable within a segment.
|
|
653
|
+
const subjectsBySegment = new Map();
|
|
654
|
+
for (const [subject, seg] of subjectSegment) {
|
|
655
|
+
const arr = subjectsBySegment.get(seg);
|
|
656
|
+
if (arr)
|
|
657
|
+
arr.push(subject);
|
|
658
|
+
else
|
|
659
|
+
subjectsBySegment.set(seg, [subject]);
|
|
660
|
+
}
|
|
661
|
+
// Conservative semantic bridges across facts (additive `relates` edges between
|
|
662
|
+
// genuinely-near same-origin facts). Empty when no embedder / nothing crosses
|
|
663
|
+
// the high cosine bar — purely additive, never fabricates a link. Computed once
|
|
664
|
+
// over the whole set so a bridge resolves regardless of write order.
|
|
665
|
+
const bridges = buildBridges(records, names);
|
|
666
|
+
// A Map note is emitted whenever there is at least one topic to anchor — it is
|
|
667
|
+
// the graph's centre (hubs link UP to it). With no subjects there are no hubs to
|
|
668
|
+
// connect, so no Map is written (nothing to centre) and the count stays as before.
|
|
669
|
+
const wantMap = subjects.size > 0;
|
|
670
|
+
let written = 0;
|
|
671
|
+
let mergedPinned = 0;
|
|
672
|
+
let writeFailed = 0;
|
|
673
|
+
let hubs = 0;
|
|
674
|
+
const keep = new Set();
|
|
675
|
+
// Shared per-note write step: 3-way merge over any existing note, atomic
|
|
676
|
+
// tmp+rename, best-effort isolation. Returns true on a successful write.
|
|
677
|
+
const writeNote = (name, proposed) => {
|
|
678
|
+
const file = path.join(dir, name);
|
|
679
|
+
let existing;
|
|
680
|
+
try {
|
|
681
|
+
existing = fs.readFileSync(file, "utf8");
|
|
682
|
+
}
|
|
683
|
+
catch {
|
|
684
|
+
existing = undefined;
|
|
685
|
+
}
|
|
686
|
+
const pinned = existing ? extractPinned(existing) : undefined;
|
|
687
|
+
const merged = mergeNote(existing, proposed);
|
|
688
|
+
const tmp = `${file}.tmp-${process.pid}-${Date.now()}`;
|
|
689
|
+
try {
|
|
690
|
+
fs.writeFileSync(tmp, merged, "utf8");
|
|
691
|
+
renameWithRetry(tmp, file);
|
|
692
|
+
if (pinned !== undefined && pinned.trim().length > 0)
|
|
693
|
+
mergedPinned++;
|
|
694
|
+
return true;
|
|
695
|
+
}
|
|
696
|
+
catch {
|
|
697
|
+
writeFailed++;
|
|
698
|
+
try {
|
|
699
|
+
fs.rmSync(tmp);
|
|
700
|
+
}
|
|
701
|
+
catch {
|
|
702
|
+
/* temp never landed / already gone */
|
|
703
|
+
}
|
|
704
|
+
return false;
|
|
705
|
+
}
|
|
706
|
+
};
|
|
707
|
+
// Fact notes (with typed-edge wikilinks + any semantic bridges).
|
|
708
|
+
for (const r of records) {
|
|
709
|
+
const name = factFileName(r.memoryId, names);
|
|
710
|
+
// Record the current set BEFORE attempting the write — a failed render must
|
|
711
|
+
// still count as "kept" so the prune below never deletes its (stale-but-
|
|
712
|
+
// present) on-disk note.
|
|
713
|
+
keep.add(name);
|
|
714
|
+
if (writeNote(name, renderNote(r, names, bridges.get(r.memoryId))))
|
|
715
|
+
written++;
|
|
716
|
+
}
|
|
717
|
+
// Topic-hub notes (one per distinct subject) — the cluster anchors. Each links
|
|
718
|
+
// UP to the Map (when one is written) and ACROSS to its same-segment siblings.
|
|
719
|
+
for (const [subject, memberIds] of subjects) {
|
|
720
|
+
const name = `${hubBaseName(subject)}.md`;
|
|
721
|
+
keep.add(name);
|
|
722
|
+
const seg = subjectSegment.get(subject);
|
|
723
|
+
const siblingSubjects = seg ? (subjectsBySegment.get(seg) ?? []) : [];
|
|
724
|
+
const hubNote = renderHubNote(subject, memberIds, names, { linkMap: wantMap, siblingSubjects });
|
|
725
|
+
if (writeNote(name, hubNote)) {
|
|
726
|
+
written++;
|
|
727
|
+
hubs++;
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
// Root MAP note (the graph's centre) — links to EVERY hub, grouped by segment,
|
|
731
|
+
// with each topic's active-fact count. Only when there is at least one topic.
|
|
732
|
+
if (wantMap) {
|
|
733
|
+
const name = `${MAP_BASENAME}.md`;
|
|
734
|
+
keep.add(name);
|
|
735
|
+
if (writeNote(name, renderMapNote(subjectsBySegment, subjectActiveCount)))
|
|
736
|
+
written++;
|
|
737
|
+
}
|
|
738
|
+
const result = { written, mergedPinned };
|
|
739
|
+
if (hubs > 0)
|
|
740
|
+
result.hubs = hubs;
|
|
741
|
+
if (writeFailed > 0)
|
|
742
|
+
result.writeFailed = writeFailed;
|
|
743
|
+
if (!opts.prune)
|
|
744
|
+
return result;
|
|
745
|
+
// Remove stale notes (a purged/evicted fact must not survive as plaintext; a
|
|
746
|
+
// hub for a now-empty subject is cleaned up). Runs unconditionally after the
|
|
747
|
+
// loop — gated on `prune`, NOT on every render succeeding — so a transiently-
|
|
748
|
+
// locked UNRELATED note can't leave a just-shredded fact's plaintext on disk.
|
|
749
|
+
let pruned = 0;
|
|
750
|
+
let entries;
|
|
751
|
+
try {
|
|
752
|
+
entries = fs.readdirSync(dir);
|
|
753
|
+
}
|
|
754
|
+
catch {
|
|
755
|
+
entries = [];
|
|
756
|
+
}
|
|
757
|
+
for (const f of entries) {
|
|
758
|
+
if (!f.endsWith(".md") || keep.has(f))
|
|
759
|
+
continue;
|
|
760
|
+
const full = path.join(dir, f);
|
|
761
|
+
// Only prune SYSTEM-authored notes (carry the fact/hub sentinel). A human's
|
|
762
|
+
// own notes in the vault (an Index/Map-of-Content, a daily note) carry no
|
|
763
|
+
// sentinel, so they're left alone — deleting them would contradict the whole
|
|
764
|
+
// editable-Obsidian-vault premise (the prune exists to stop a shredded fact's
|
|
765
|
+
// note lingering as plaintext, not to police the user's folder). Detection is
|
|
766
|
+
// by FILE CONTENT, not filename, because filenames are now readable/arbitrary.
|
|
767
|
+
let content;
|
|
768
|
+
try {
|
|
769
|
+
content = fs.readFileSync(full, "utf8");
|
|
770
|
+
}
|
|
771
|
+
catch {
|
|
772
|
+
continue; // unreadable — leave it (best effort)
|
|
773
|
+
}
|
|
774
|
+
if (!isSystemNote(content))
|
|
775
|
+
continue;
|
|
776
|
+
try {
|
|
777
|
+
fs.rmSync(full);
|
|
778
|
+
pruned++;
|
|
779
|
+
}
|
|
780
|
+
catch {
|
|
781
|
+
/* concurrent removal / locked — best effort */
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
result.pruned = pruned;
|
|
785
|
+
return result;
|
|
786
|
+
}
|
|
787
|
+
//# sourceMappingURL=vault.js.map
|