@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 @@
|
|
|
1
|
+
{"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/core/system-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EACL,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAEhF,qEAAqE;AACrE,wEAAwE;AACxE,mEAAmE;AACnE,4CAA4C;AAC5C,MAAM,CAAC,MAAM,sBAAsB,GAAG,qBAAqB,CAAC;AAE5D;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,YAAqB;IAC5D,MAAM,GAAG,GAAG,YAAY,IAAI,wBAAwB,CAAC,gBAAgB,CAAC,CAAC;IACvE,MAAM,kBAAkB,CAAC,GAAG,CAAC,CAAC;AAChC,CAAC;AA8BD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,OAAqB,EACrB,SAAsD;IAEtD,MAAM,IAAI,GACR,OAAO,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,CAAC,IAAI,EAAE,CAAC;QACxB,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QAChC,0EAA0E;QAC1E,kEAAkE;QAClE,IAAI,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,OAAO,SAAS,CAAC;QACvD,IAAI,4BAA4B,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,OAAO,SAAS,CAAC;QAC9D,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,OAAO,SAAS,CAAC;QAC7D,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QAC1D,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IAClD,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/core/version.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB,eAAO,MAAM,mBAAmB,UAAU,CAAC"}
|
package/dist/core/version.js
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* Keep in lockstep with package.json::version. There's no automated check —
|
|
10
|
-
* a missed bump just means meta.lastTouchedVersion lies, which is annoying
|
|
11
|
-
* but not corrupting.
|
|
12
|
-
*/
|
|
13
|
-
export const BRIGADE_CLI_VERSION = "0.1.0";
|
|
1
|
+
// Tiny shim — re-exports F:\Brigade's existing version constant under the
|
|
2
|
+
// names the lifted code expects (`./version.js` from `core/`). Avoids
|
|
3
|
+
// duplicating the version literal; single source of truth stays at
|
|
4
|
+
// `src/version.ts`.
|
|
5
|
+
import { VERSION } from "../version.js";
|
|
6
|
+
export { VERSION };
|
|
7
|
+
// Alias the lifted callers use (Downloads/Brigade calls it BRIGADE_CLI_VERSION).
|
|
8
|
+
export const BRIGADE_CLI_VERSION = VERSION;
|
|
14
9
|
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/core/version.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,sEAAsE;AACtE,mEAAmE;AACnE,oBAAoB;AACpB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,OAAO,EAAE,CAAC;AACnB,iFAAiF;AACjF,MAAM,CAAC,MAAM,mBAAmB,GAAG,OAAO,CAAC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Webhook + RPC guards — body-size cap, timeout, HMAC helpers.
|
|
3
|
+
*
|
|
4
|
+
* Used by the gateway's HTTP route dispatcher to enforce per-route guarantees
|
|
5
|
+
* BEFORE a plugin's handler ever sees the request, and exposed to plugin
|
|
6
|
+
* authors so a webhook handler can verify provider-signed payloads (Stripe,
|
|
7
|
+
* GitHub, LINE, Slack, etc.) without re-implementing the careful crypto bits.
|
|
8
|
+
*
|
|
9
|
+
* Three primitives:
|
|
10
|
+
* - `readBodyWithLimit(req, res, opts)` — pre-buffer the body up to a byte
|
|
11
|
+
* cap. Sends `413 Payload Too Large` (or `408 Request Timeout`) directly
|
|
12
|
+
* and returns `null` so the handler can early-out. The cap defaults to
|
|
13
|
+
* 1 MiB, mirroring the reference upstream's post-auth limit; the timeout
|
|
14
|
+
* defaults to 30s.
|
|
15
|
+
* - `computeHmacSha256(body, secret)` — canonical hex HMAC-SHA256 for the
|
|
16
|
+
* provider signature schemes that use hex (Stripe v1, GitHub `sha256=…`,
|
|
17
|
+
* etc). Returns the bare hex string so callers can prefix `sha256=` etc.
|
|
18
|
+
* to match the provider's wire format.
|
|
19
|
+
* - `safeEqualHmac(expected, actual)` — timing-safe string compare via
|
|
20
|
+
* `crypto.timingSafeEqual` on equal-length padded buffers. Avoids the
|
|
21
|
+
* early-exit length-leak that the naive `===` path has, and never
|
|
22
|
+
* throws on length mismatch (the LINE adapter taught us that one).
|
|
23
|
+
*
|
|
24
|
+
* Plugin-author contract: a webhook handler that opts into `auth: "none"`
|
|
25
|
+
* MUST verify the signature itself — these helpers are the supported way.
|
|
26
|
+
* Routes that opt into `auth: "operator"` are gated by the gateway before
|
|
27
|
+
* the handler runs and can skip the HMAC step entirely.
|
|
28
|
+
*
|
|
29
|
+
* Replay defense (also author-facing): a valid signature does NOT prove a
|
|
30
|
+
* payload is FRESH — a captured signed request replays forever. Pair
|
|
31
|
+
* `verifyWebhookSignature` (multi-provider, computed over the RAW body,
|
|
32
|
+
* fail-closed) with `verifyTimestampFresh` + a per-account `WebhookReplayGuard`
|
|
33
|
+
* (delivery-id/nonce dedup) for at-most-once inbound processing.
|
|
34
|
+
*/
|
|
35
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
36
|
+
/** Default cap when a route doesn't declare `maxBodyBytes`. Matches the reference upstream's post-auth limit. */
|
|
37
|
+
export declare const DEFAULT_MAX_BODY_BYTES = 1048576;
|
|
38
|
+
/** Default timeout when a route doesn't declare `timeoutMs`. */
|
|
39
|
+
export declare const DEFAULT_TIMEOUT_MS = 30000;
|
|
40
|
+
/**
|
|
41
|
+
* Read a request body up to `maxBytes`. Streams the request, accumulating
|
|
42
|
+
* chunks until either the body ends (returns the `Buffer`) or the running
|
|
43
|
+
* total exceeds the cap (responds `413` + returns `null`). A per-call
|
|
44
|
+
* timeout aborts the read and responds `408` if the client takes too long.
|
|
45
|
+
*
|
|
46
|
+
* Why pre-buffer at all? Plugin handlers want a `Buffer` they can HMAC-verify
|
|
47
|
+
* against the provider's signature header. Letting the handler consume the
|
|
48
|
+
* stream itself loses the size guard — and the typical "re-emit the chunks"
|
|
49
|
+
* shim is a foot-gun (every author gets it slightly wrong). Buffering once,
|
|
50
|
+
* up front, lands the body where it's wanted with the safety baked in.
|
|
51
|
+
*
|
|
52
|
+
* Always writes a JSON body on rejection so the caller (or curl) sees what
|
|
53
|
+
* happened, never just a bare status line.
|
|
54
|
+
*/
|
|
55
|
+
export declare function readBodyWithLimit(req: IncomingMessage, res: ServerResponse, opts?: {
|
|
56
|
+
maxBytes?: number;
|
|
57
|
+
timeoutMs?: number;
|
|
58
|
+
}): Promise<Buffer | null>;
|
|
59
|
+
/**
|
|
60
|
+
* Compute HMAC-SHA256 of `body` with `secret` and return the hex digest.
|
|
61
|
+
* The hex shape is what GitHub (`sha256=…`), Stripe (`v1=…`), and most other
|
|
62
|
+
* providers send on the wire; callers can prefix as needed.
|
|
63
|
+
*/
|
|
64
|
+
export declare function computeHmacSha256(body: Buffer | string, secret: string): string;
|
|
65
|
+
/**
|
|
66
|
+
* Timing-safe HMAC compare. Always reads the same number of bytes regardless
|
|
67
|
+
* of where the strings differ, and tolerates length mismatch by padding both
|
|
68
|
+
* sides to the longest length before the constant-time compare (then returns
|
|
69
|
+
* `false` if the original lengths differed). Never throws — a length mismatch
|
|
70
|
+
* passed to `crypto.timingSafeEqual` directly would.
|
|
71
|
+
*
|
|
72
|
+
* Use for any string-vs-string secret comparison: HMAC hex digests, base64
|
|
73
|
+
* signatures, shared-secret tokens. NOT for password hashes — use a slow KDF
|
|
74
|
+
* for those (bcrypt/argon2).
|
|
75
|
+
*/
|
|
76
|
+
export declare function safeEqualHmac(expected: string, actual: string): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Reject STALE or REPLAYED webhook deliveries. A provider signature proves a
|
|
79
|
+
* payload was signed with the shared secret — it does NOT prove the payload is
|
|
80
|
+
* fresh: a captured signed request is otherwise replayable forever. Pair
|
|
81
|
+
* `verifyTimestampFresh` (reject deliveries outside a clock-skew window) with
|
|
82
|
+
* `WebhookReplayGuard` (reject a delivery-id/nonce seen before) for at-most-once
|
|
83
|
+
* inbound processing. Both are author-facing, same as the HMAC helpers above.
|
|
84
|
+
*/
|
|
85
|
+
/** True if `tsMs` is within `windowMs` of now (default ±5 min). Reject otherwise. */
|
|
86
|
+
export declare function verifyTimestampFresh(tsMs: number, opts?: {
|
|
87
|
+
windowMs?: number;
|
|
88
|
+
nowMs?: number;
|
|
89
|
+
}): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Bounded, TTL'd dedup of webhook delivery ids / nonces. `check(id)` returns
|
|
92
|
+
* `true` if `id` was already seen within the TTL (a REPLAY — reject it) and
|
|
93
|
+
* `false` otherwise (first sight — recorded, accept). Size-capped with oldest-
|
|
94
|
+
* first eviction so a flood can't grow it unbounded; entries also expire by TTL.
|
|
95
|
+
* One instance per webhook account/channel (held in the adapter's runtime).
|
|
96
|
+
*/
|
|
97
|
+
export declare class WebhookReplayGuard {
|
|
98
|
+
private readonly seen;
|
|
99
|
+
private readonly ttlMs;
|
|
100
|
+
private readonly maxEntries;
|
|
101
|
+
constructor(opts?: {
|
|
102
|
+
ttlMs?: number;
|
|
103
|
+
maxEntries?: number;
|
|
104
|
+
});
|
|
105
|
+
/** Record `id` and report whether it was a replay. Empty id → not a replay
|
|
106
|
+
* (the caller should fall back to timestamp-only freshness in that case). */
|
|
107
|
+
check(id: string, nowMs?: number): boolean;
|
|
108
|
+
/** Tracked-id count (diagnostics/tests). */
|
|
109
|
+
get size(): number;
|
|
110
|
+
}
|
|
111
|
+
export type WebhookSignatureProvider = "github" | "slack" | "gitlab" | "hmac-sha256";
|
|
112
|
+
/**
|
|
113
|
+
* Verify a provider-signed webhook over the RAW body bytes. The HMAC MUST be
|
|
114
|
+
* computed BEFORE any JSON parse — re-serializing a parsed body changes the
|
|
115
|
+
* bytes and breaks the signature, the single most common webhook-auth bug. Fails
|
|
116
|
+
* CLOSED: a missing/blank secret or a missing expected header returns
|
|
117
|
+
* `{ok:false}` rather than silently skipping the check. For Slack it also
|
|
118
|
+
* enforces the signed timestamp's freshness (the v0 signature covers the ts, so
|
|
119
|
+
* a replay outside the window fails here without a separate guard).
|
|
120
|
+
*/
|
|
121
|
+
export declare function verifyWebhookSignature(provider: WebhookSignatureProvider, args: {
|
|
122
|
+
headers: Record<string, string | string[] | undefined>;
|
|
123
|
+
rawBody: Buffer | string;
|
|
124
|
+
secret: string;
|
|
125
|
+
nowMs?: number;
|
|
126
|
+
timestampWindowMs?: number;
|
|
127
|
+
}): {
|
|
128
|
+
ok: boolean;
|
|
129
|
+
reason?: string;
|
|
130
|
+
};
|
|
131
|
+
//# sourceMappingURL=webhook-guards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook-guards.d.ts","sourceRoot":"","sources":["../../src/core/webhook-guards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEjE,iHAAiH;AACjH,eAAO,MAAM,sBAAsB,UAAY,CAAC;AAEhD,gEAAgE;AAChE,eAAO,MAAM,kBAAkB,QAAS,CAAC;AAEzC;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,iBAAiB,CACtC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,IAAI,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9C,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAiFxB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAG/E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GA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|
|
4
|
+
* Used by the gateway's HTTP route dispatcher to enforce per-route guarantees
|
|
5
|
+
* BEFORE a plugin's handler ever sees the request, and exposed to plugin
|
|
6
|
+
* authors so a webhook handler can verify provider-signed payloads (Stripe,
|
|
7
|
+
* GitHub, LINE, Slack, etc.) without re-implementing the careful crypto bits.
|
|
8
|
+
*
|
|
9
|
+
* Three primitives:
|
|
10
|
+
* - `readBodyWithLimit(req, res, opts)` — pre-buffer the body up to a byte
|
|
11
|
+
* cap. Sends `413 Payload Too Large` (or `408 Request Timeout`) directly
|
|
12
|
+
* and returns `null` so the handler can early-out. The cap defaults to
|
|
13
|
+
* 1 MiB, mirroring the reference upstream's post-auth limit; the timeout
|
|
14
|
+
* defaults to 30s.
|
|
15
|
+
* - `computeHmacSha256(body, secret)` — canonical hex HMAC-SHA256 for the
|
|
16
|
+
* provider signature schemes that use hex (Stripe v1, GitHub `sha256=…`,
|
|
17
|
+
* etc). Returns the bare hex string so callers can prefix `sha256=` etc.
|
|
18
|
+
* to match the provider's wire format.
|
|
19
|
+
* - `safeEqualHmac(expected, actual)` — timing-safe string compare via
|
|
20
|
+
* `crypto.timingSafeEqual` on equal-length padded buffers. Avoids the
|
|
21
|
+
* early-exit length-leak that the naive `===` path has, and never
|
|
22
|
+
* throws on length mismatch (the LINE adapter taught us that one).
|
|
23
|
+
*
|
|
24
|
+
* Plugin-author contract: a webhook handler that opts into `auth: "none"`
|
|
25
|
+
* MUST verify the signature itself — these helpers are the supported way.
|
|
26
|
+
* Routes that opt into `auth: "operator"` are gated by the gateway before
|
|
27
|
+
* the handler runs and can skip the HMAC step entirely.
|
|
28
|
+
*
|
|
29
|
+
* Replay defense (also author-facing): a valid signature does NOT prove a
|
|
30
|
+
* payload is FRESH — a captured signed request replays forever. Pair
|
|
31
|
+
* `verifyWebhookSignature` (multi-provider, computed over the RAW body,
|
|
32
|
+
* fail-closed) with `verifyTimestampFresh` + a per-account `WebhookReplayGuard`
|
|
33
|
+
* (delivery-id/nonce dedup) for at-most-once inbound processing.
|
|
34
|
+
*/
|
|
35
|
+
import { createHmac, timingSafeEqual } from "node:crypto";
|
|
36
|
+
/** Default cap when a route doesn't declare `maxBodyBytes`. Matches the reference upstream's post-auth limit. */
|
|
37
|
+
export const DEFAULT_MAX_BODY_BYTES = 1_048_576; // 1 MiB
|
|
38
|
+
/** Default timeout when a route doesn't declare `timeoutMs`. */
|
|
39
|
+
export const DEFAULT_TIMEOUT_MS = 30_000; // 30s
|
|
40
|
+
/**
|
|
41
|
+
* Read a request body up to `maxBytes`. Streams the request, accumulating
|
|
42
|
+
* chunks until either the body ends (returns the `Buffer`) or the running
|
|
43
|
+
* total exceeds the cap (responds `413` + returns `null`). A per-call
|
|
44
|
+
* timeout aborts the read and responds `408` if the client takes too long.
|
|
45
|
+
*
|
|
46
|
+
* Why pre-buffer at all? Plugin handlers want a `Buffer` they can HMAC-verify
|
|
47
|
+
* against the provider's signature header. Letting the handler consume the
|
|
48
|
+
* stream itself loses the size guard — and the typical "re-emit the chunks"
|
|
49
|
+
* shim is a foot-gun (every author gets it slightly wrong). Buffering once,
|
|
50
|
+
* up front, lands the body where it's wanted with the safety baked in.
|
|
51
|
+
*
|
|
52
|
+
* Always writes a JSON body on rejection so the caller (or curl) sees what
|
|
53
|
+
* happened, never just a bare status line.
|
|
54
|
+
*/
|
|
55
|
+
export async function readBodyWithLimit(req, res, opts) {
|
|
56
|
+
const maxBytes = opts?.maxBytes ?? DEFAULT_MAX_BODY_BYTES;
|
|
57
|
+
const timeoutMs = opts?.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
58
|
+
return new Promise((resolve) => {
|
|
59
|
+
const chunks = [];
|
|
60
|
+
let received = 0;
|
|
61
|
+
let settled = false;
|
|
62
|
+
const finish = (value) => {
|
|
63
|
+
if (settled)
|
|
64
|
+
return;
|
|
65
|
+
settled = true;
|
|
66
|
+
clearTimeout(timer);
|
|
67
|
+
req.removeListener("data", onData);
|
|
68
|
+
req.removeListener("end", onEnd);
|
|
69
|
+
req.removeListener("error", onError);
|
|
70
|
+
req.removeListener("aborted", onAborted);
|
|
71
|
+
resolve(value);
|
|
72
|
+
};
|
|
73
|
+
const writeStatus = (status, message) => {
|
|
74
|
+
if (!res.headersSent) {
|
|
75
|
+
res.statusCode = status;
|
|
76
|
+
res.setHeader("Content-Type", "application/json; charset=utf-8");
|
|
77
|
+
res.end(JSON.stringify({ error: message }));
|
|
78
|
+
}
|
|
79
|
+
else if (!res.writableEnded) {
|
|
80
|
+
try {
|
|
81
|
+
res.end();
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
/* socket already torn down */
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const onData = (chunk) => {
|
|
89
|
+
const buf = typeof chunk === "string" ? Buffer.from(chunk) : chunk;
|
|
90
|
+
received += buf.length;
|
|
91
|
+
if (received > maxBytes) {
|
|
92
|
+
writeStatus(413, `Payload too large (max ${maxBytes} bytes)`);
|
|
93
|
+
// Drain the rest of the stream so the client doesn't hang on
|
|
94
|
+
// a half-closed socket. Node ignores additional data after
|
|
95
|
+
// res.end() but the request side still wants its end event.
|
|
96
|
+
try {
|
|
97
|
+
req.pause();
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
/* ignore */
|
|
101
|
+
}
|
|
102
|
+
finish(null);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
chunks.push(buf);
|
|
106
|
+
};
|
|
107
|
+
const onEnd = () => {
|
|
108
|
+
finish(Buffer.concat(chunks, received));
|
|
109
|
+
};
|
|
110
|
+
const onError = () => {
|
|
111
|
+
writeStatus(400, "Bad request body");
|
|
112
|
+
finish(null);
|
|
113
|
+
};
|
|
114
|
+
const onAborted = () => {
|
|
115
|
+
// Client hung up mid-body; nothing to respond with, just clean up.
|
|
116
|
+
finish(null);
|
|
117
|
+
};
|
|
118
|
+
const timer = setTimeout(() => {
|
|
119
|
+
writeStatus(408, `Request timeout (${timeoutMs}ms)`);
|
|
120
|
+
finish(null);
|
|
121
|
+
}, timeoutMs);
|
|
122
|
+
// Don't keep the event loop alive on this timer alone.
|
|
123
|
+
if (typeof timer.unref === "function") {
|
|
124
|
+
timer.unref();
|
|
125
|
+
}
|
|
126
|
+
req.on("data", onData);
|
|
127
|
+
req.on("end", onEnd);
|
|
128
|
+
req.on("error", onError);
|
|
129
|
+
req.on("aborted", onAborted);
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Compute HMAC-SHA256 of `body` with `secret` and return the hex digest.
|
|
134
|
+
* The hex shape is what GitHub (`sha256=…`), Stripe (`v1=…`), and most other
|
|
135
|
+
* providers send on the wire; callers can prefix as needed.
|
|
136
|
+
*/
|
|
137
|
+
export function computeHmacSha256(body, secret) {
|
|
138
|
+
const data = typeof body === "string" ? Buffer.from(body) : body;
|
|
139
|
+
return createHmac("sha256", secret).update(data).digest("hex");
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Timing-safe HMAC compare. Always reads the same number of bytes regardless
|
|
143
|
+
* of where the strings differ, and tolerates length mismatch by padding both
|
|
144
|
+
* sides to the longest length before the constant-time compare (then returns
|
|
145
|
+
* `false` if the original lengths differed). Never throws — a length mismatch
|
|
146
|
+
* passed to `crypto.timingSafeEqual` directly would.
|
|
147
|
+
*
|
|
148
|
+
* Use for any string-vs-string secret comparison: HMAC hex digests, base64
|
|
149
|
+
* signatures, shared-secret tokens. NOT for password hashes — use a slow KDF
|
|
150
|
+
* for those (bcrypt/argon2).
|
|
151
|
+
*/
|
|
152
|
+
export function safeEqualHmac(expected, actual) {
|
|
153
|
+
const a = Buffer.from(expected);
|
|
154
|
+
const b = Buffer.from(actual);
|
|
155
|
+
const maxLen = Math.max(a.length, b.length);
|
|
156
|
+
// Allocate fixed-length buffers so timingSafeEqual never throws on
|
|
157
|
+
// mismatched lengths. We still return false below when the original
|
|
158
|
+
// lengths differ — the constant-time compare is just for the bytes.
|
|
159
|
+
const padA = Buffer.alloc(maxLen);
|
|
160
|
+
const padB = Buffer.alloc(maxLen);
|
|
161
|
+
a.copy(padA);
|
|
162
|
+
b.copy(padB);
|
|
163
|
+
// Call timingSafeEqual unconditionally so the && short-circuit can't
|
|
164
|
+
// leak length information through wall-clock timing.
|
|
165
|
+
const bytesEqual = timingSafeEqual(padA, padB);
|
|
166
|
+
return a.length === b.length && bytesEqual;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Reject STALE or REPLAYED webhook deliveries. A provider signature proves a
|
|
170
|
+
* payload was signed with the shared secret — it does NOT prove the payload is
|
|
171
|
+
* fresh: a captured signed request is otherwise replayable forever. Pair
|
|
172
|
+
* `verifyTimestampFresh` (reject deliveries outside a clock-skew window) with
|
|
173
|
+
* `WebhookReplayGuard` (reject a delivery-id/nonce seen before) for at-most-once
|
|
174
|
+
* inbound processing. Both are author-facing, same as the HMAC helpers above.
|
|
175
|
+
*/
|
|
176
|
+
/** True if `tsMs` is within `windowMs` of now (default ±5 min). Reject otherwise. */
|
|
177
|
+
export function verifyTimestampFresh(tsMs, opts = {}) {
|
|
178
|
+
if (!Number.isFinite(tsMs))
|
|
179
|
+
return false;
|
|
180
|
+
const windowMs = opts.windowMs && opts.windowMs > 0 ? opts.windowMs : 300_000;
|
|
181
|
+
const nowMs = opts.nowMs ?? Date.now();
|
|
182
|
+
return Math.abs(nowMs - tsMs) <= windowMs;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Bounded, TTL'd dedup of webhook delivery ids / nonces. `check(id)` returns
|
|
186
|
+
* `true` if `id` was already seen within the TTL (a REPLAY — reject it) and
|
|
187
|
+
* `false` otherwise (first sight — recorded, accept). Size-capped with oldest-
|
|
188
|
+
* first eviction so a flood can't grow it unbounded; entries also expire by TTL.
|
|
189
|
+
* One instance per webhook account/channel (held in the adapter's runtime).
|
|
190
|
+
*/
|
|
191
|
+
export class WebhookReplayGuard {
|
|
192
|
+
seen = new Map();
|
|
193
|
+
ttlMs;
|
|
194
|
+
maxEntries;
|
|
195
|
+
constructor(opts = {}) {
|
|
196
|
+
this.ttlMs = opts.ttlMs && opts.ttlMs > 0 ? opts.ttlMs : 300_000;
|
|
197
|
+
this.maxEntries = opts.maxEntries && opts.maxEntries > 0 ? opts.maxEntries : 5000;
|
|
198
|
+
}
|
|
199
|
+
/** Record `id` and report whether it was a replay. Empty id → not a replay
|
|
200
|
+
* (the caller should fall back to timestamp-only freshness in that case). */
|
|
201
|
+
check(id, nowMs = Date.now()) {
|
|
202
|
+
if (!id)
|
|
203
|
+
return false;
|
|
204
|
+
const exp = this.seen.get(id);
|
|
205
|
+
if (exp !== undefined && exp > nowMs)
|
|
206
|
+
return true; // within TTL → replay
|
|
207
|
+
// (Re)insert at the tail; Map preserves insertion order for oldest-first eviction.
|
|
208
|
+
this.seen.delete(id);
|
|
209
|
+
this.seen.set(id, nowMs + this.ttlMs);
|
|
210
|
+
while (this.seen.size > this.maxEntries) {
|
|
211
|
+
const oldest = this.seen.keys().next().value;
|
|
212
|
+
if (oldest === undefined)
|
|
213
|
+
break;
|
|
214
|
+
this.seen.delete(oldest);
|
|
215
|
+
}
|
|
216
|
+
return false;
|
|
217
|
+
}
|
|
218
|
+
/** Tracked-id count (diagnostics/tests). */
|
|
219
|
+
get size() {
|
|
220
|
+
return this.seen.size;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
/** Case-insensitive header lookup (Node lowercases inbound headers, but be defensive). */
|
|
224
|
+
function headerValue(headers, name) {
|
|
225
|
+
const lower = name.toLowerCase();
|
|
226
|
+
for (const [k, v] of Object.entries(headers)) {
|
|
227
|
+
if (k.toLowerCase() === lower)
|
|
228
|
+
return Array.isArray(v) ? v[0] : v;
|
|
229
|
+
}
|
|
230
|
+
return undefined;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Verify a provider-signed webhook over the RAW body bytes. The HMAC MUST be
|
|
234
|
+
* computed BEFORE any JSON parse — re-serializing a parsed body changes the
|
|
235
|
+
* bytes and breaks the signature, the single most common webhook-auth bug. Fails
|
|
236
|
+
* CLOSED: a missing/blank secret or a missing expected header returns
|
|
237
|
+
* `{ok:false}` rather than silently skipping the check. For Slack it also
|
|
238
|
+
* enforces the signed timestamp's freshness (the v0 signature covers the ts, so
|
|
239
|
+
* a replay outside the window fails here without a separate guard).
|
|
240
|
+
*/
|
|
241
|
+
export function verifyWebhookSignature(provider, args) {
|
|
242
|
+
const { headers, rawBody, secret } = args;
|
|
243
|
+
if (!secret)
|
|
244
|
+
return { ok: false, reason: "no signing secret configured" };
|
|
245
|
+
switch (provider) {
|
|
246
|
+
case "github": {
|
|
247
|
+
const sig = headerValue(headers, "x-hub-signature-256");
|
|
248
|
+
if (!sig)
|
|
249
|
+
return { ok: false, reason: "missing x-hub-signature-256 header" };
|
|
250
|
+
return { ok: safeEqualHmac(`sha256=${computeHmacSha256(rawBody, secret)}`, sig) };
|
|
251
|
+
}
|
|
252
|
+
case "gitlab": {
|
|
253
|
+
const token = headerValue(headers, "x-gitlab-token");
|
|
254
|
+
if (!token)
|
|
255
|
+
return { ok: false, reason: "missing x-gitlab-token header" };
|
|
256
|
+
return { ok: safeEqualHmac(secret, token) };
|
|
257
|
+
}
|
|
258
|
+
case "slack": {
|
|
259
|
+
const sig = headerValue(headers, "x-slack-signature");
|
|
260
|
+
const ts = headerValue(headers, "x-slack-request-timestamp");
|
|
261
|
+
if (!sig || !ts)
|
|
262
|
+
return { ok: false, reason: "missing slack signature/timestamp headers" };
|
|
263
|
+
const fresh = verifyTimestampFresh(Number(ts) * 1000, {
|
|
264
|
+
...(args.timestampWindowMs !== undefined ? { windowMs: args.timestampWindowMs } : {}),
|
|
265
|
+
...(args.nowMs !== undefined ? { nowMs: args.nowMs } : {}),
|
|
266
|
+
});
|
|
267
|
+
if (!fresh)
|
|
268
|
+
return { ok: false, reason: "stale or invalid slack timestamp" };
|
|
269
|
+
const body = typeof rawBody === "string" ? rawBody : rawBody.toString("utf8");
|
|
270
|
+
return { ok: safeEqualHmac(`v0=${computeHmacSha256(`v0:${ts}:${body}`, secret)}`, sig) };
|
|
271
|
+
}
|
|
272
|
+
case "hmac-sha256": {
|
|
273
|
+
const sig = headerValue(headers, "x-webhook-signature");
|
|
274
|
+
if (!sig)
|
|
275
|
+
return { ok: false, reason: "missing x-webhook-signature header" };
|
|
276
|
+
const normalized = sig.startsWith("sha256=") ? sig.slice(7) : sig;
|
|
277
|
+
return { ok: safeEqualHmac(computeHmacSha256(rawBody, secret), normalized) };
|
|
278
|
+
}
|
|
279
|
+
default:
|
|
280
|
+
return { ok: false, reason: "unknown signature provider" };
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
//# sourceMappingURL=webhook-guards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook-guards.js","sourceRoot":"","sources":["../../src/core/webhook-guards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG1D,iHAAiH;AACjH,MAAM,CAAC,MAAM,sBAAsB,GAAG,SAAS,CAAC,CAAC,QAAQ;AAEzD,gEAAgE;AAChE,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,CAAC,MAAM;AAEhD;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACtC,GAAoB,EACpB,GAAmB,EACnB,IAAgD;IAEhD,MAAM,QAAQ,GAAG,IAAI,EAAE,QAAQ,IAAI,sBAAsB,CAAC;IAC1D,MAAM,SAAS,GAAG,IAAI,EAAE,SAAS,IAAI,kBAAkB,CAAC;IAExD,OAAO,IAAI,OAAO,CAAgB,CAAC,OAAO,EAAE,EAAE;QAC7C,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,IAAI,QAAQ,GAAG,CAAC,CAAC;QACjB,IAAI,OAAO,GAAG,KAAK,CAAC;QAEpB,M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want this frame? */
|
|
6
|
+
export declare function shouldDeliverFrame(agentSubs: ReadonlySet<string> | undefined, sessionSubs: ReadonlySet<string> | undefined, tags: FrameTags): boolean;
|
|
7
|
+
/** Cheap discriminator: pulls optional agentId/sessionId off a payload. */
|
|
8
|
+
export declare function extractFrameTags(payload: unknown): FrameTags;
|
|
9
|
+
//# sourceMappingURL=ws-subscription-filter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ws-subscription-filter.d.ts","sourceRoot":"","sources":["../../src/core/ws-subscription-filter.ts"],"names":[],"mappings":"AAcA,MAAM,WAAW,SAAS;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED,qEAAqE;AACrE,wBAAgB,kBAAkB,CACjC,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,EAC1C,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,EAC5C,IAAI,EAAE,SAAS,GACb,OAAO,CAOT;AAED,2EAA2E;AAC3E,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,CAO5D"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Pure per-client subscription filter for the gateway WS broadcaster.
|
|
2
|
+
//
|
|
3
|
+
// Wave I closure: `connWantsFrame` inside `startServer` decides whether a
|
|
4
|
+
// connected client should receive a broadcast frame. It was inlined when
|
|
5
|
+
// Wave H landed but is now extracted so both the gateway and a focused
|
|
6
|
+
// unit test exercise the same predicate. The behaviour is unchanged:
|
|
7
|
+
//
|
|
8
|
+
// - Untagged frames (no agentId, no sessionId) broadcast to everyone —
|
|
9
|
+
// state snapshots / generic errors keep working without a subscribe.
|
|
10
|
+
// - Clients with no subscriptions get every frame — legacy single-agent
|
|
11
|
+
// TUI clients are not penalised for omitting the subscribe handshake.
|
|
12
|
+
// - Otherwise the client must be subscribed to either the agentId or
|
|
13
|
+
// sessionId on the frame; an explicit subscribe narrows the view.
|
|
14
|
+
/** Pure predicate: does a client with these subs want this frame? */
|
|
15
|
+
export function shouldDeliverFrame(agentSubs, sessionSubs, tags) {
|
|
16
|
+
const { agentId, sessionId } = tags;
|
|
17
|
+
if (!agentId && !sessionId)
|
|
18
|
+
return true;
|
|
19
|
+
if (!agentSubs && !sessionSubs)
|
|
20
|
+
return true;
|
|
21
|
+
if (agentId && agentSubs?.has(agentId))
|
|
22
|
+
return true;
|
|
23
|
+
if (sessionId && sessionSubs?.has(sessionId))
|
|
24
|
+
return true;
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
/** Cheap discriminator: pulls optional agentId/sessionId off a payload. */
|
|
28
|
+
export function extractFrameTags(payload) {
|
|
29
|
+
const obj = payload;
|
|
30
|
+
if (!obj || typeof obj !== "object")
|
|
31
|
+
return {};
|
|
32
|
+
const tags = {};
|
|
33
|
+
if (typeof obj.agentId === "string")
|
|
34
|
+
tags.agentId = obj.agentId;
|
|
35
|
+
if (typeof obj.sessionId === "string")
|
|
36
|
+
tags.sessionId = obj.sessionId;
|
|
37
|
+
return tags;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=ws-subscription-filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ws-subscription-filter.js","sourceRoot":"","sources":["../../src/core/ws-subscription-filter.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,EAAE;AACF,0EAA0E;AAC1E,yEAAyE;AACzE,uEAAuE;AACvE,qEAAqE;AACrE,EAAE;AACF,yEAAyE;AACzE,yEAAyE;AACzE,0EAA0E;AAC1E,0EAA0E;AAC1E,uEAAuE;AACvE,sEAAsE;AAOtE,qEAAqE;AACrE,MAAM,UAAU,kBAAkB,CACjC,SAA0C,EAC1C,WAA4C,EAC5C,IAAe;IAEf,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IACpC,IAAI,CAAC,OAAO,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IACxC,IAAI,CAAC,SAAS,IAAI,CAAC,WAAW;QAAE,OAAO,IAAI,CAAC;IAC5C,IAAI,OAAO,IAAI,SAAS,EAAE,GAAG,CAAC,OAAO,CAAC;QAAE,OAAO,IAAI,CAAC;IACpD,IAAI,SAAS,IAAI,WAAW,EAAE,GAAG,CAAC,SAAS,CAAC;QAAE,OAAO,IAAI,CAAC;IAC1D,OAAO,KAAK,CAAC;AACd,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,gBAAgB,CAAC,OAAgB;IAChD,MAAM,GAAG,GAAG,OAA4D,CAAC;IACzE,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,EAAE,CAAC;IAC/C,MAAM,IAAI,GAAc,EAAE,CAAC;IAC3B,IAAI,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ;QAAE,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;IAChE,IAAI,OAAO,GAAG,CAAC,SAAS,KAAK,QAAQ;QAAE,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC;IACtE,OAAO,IAAI,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Process-wide active cron service singleton.
|
|
3
|
+
*
|
|
4
|
+
* The cron service is a singleton in Brigade's process model — the gateway
|
|
5
|
+
* daemon owns ONE `CronServiceState` instance, constructed at boot and
|
|
6
|
+
* wired with the real deps (`runIsolatedAgentJob`, `enqueueSystemEvent`,
|
|
7
|
+
* etc.). Surfaces that need to reach the service — the agent-callable
|
|
8
|
+
* `cron` tool, the gateway RPC handlers, the CLI commands — all look it
|
|
9
|
+
* up here rather than threading the state through every callsite.
|
|
10
|
+
*
|
|
11
|
+
* Pattern mirrors `approval-bridge.ts`'s active-bridge singleton. Tests
|
|
12
|
+
* set this to a fake state in `beforeEach` + null it in `afterEach` so a
|
|
13
|
+
* stray test instance can't leak across suites.
|
|
14
|
+
*
|
|
15
|
+
* P1#9 (Wave H) — pinned via `resolveGlobalSingleton` so dual-loaded
|
|
16
|
+
* Brigade modules (test harness + runtime in one process; hot-reload in
|
|
17
|
+
* dev) share ONE slot. Without the pin, every module copy would carry its
|
|
18
|
+
* own `activeState` and the agent tool / gateway handler that imported a
|
|
19
|
+
* different copy than the boot path would silently see `null`.
|
|
20
|
+
*/
|
|
21
|
+
import type { CronServiceState } from "./service/state.js";
|
|
22
|
+
/** Set the process-wide active cron service. Gateway boot calls this once. */
|
|
23
|
+
export declare function setActiveCronService(state: CronServiceState | null): void;
|
|
24
|
+
/** Read the active service. Returns `null` when no daemon has booted yet. */
|
|
25
|
+
export declare function getActiveCronService(): CronServiceState | null;
|
|
26
|
+
/** Resolve or throw — caller wants the service and wants a clear error otherwise. */
|
|
27
|
+
export declare function requireActiveCronService(): CronServiceState;
|
|
28
|
+
/** Test-only — clear between cases. */
|
|
29
|
+
export declare function clearActiveCronServiceForTests(): void;
|
|
30
|
+
//# sourceMappingURL=active-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"active-service.d.ts","sourceRoot":"","sources":["../../src/cron/active-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAY3D,8EAA8E;AAC9E,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,GAAG,IAAI,CAEzE;AAED,6EAA6E;AAC7E,wBAAgB,oBAAoB,IAAI,gBAAgB,GAAG,IAAI,CAE9D;AAED,qFAAqF;AACrF,wBAAgB,wBAAwB,IAAI,gBAAgB,CAQ3D;AAED,uCAAuC;AACvC,wBAAgB,8BAA8B,IAAI,IAAI,CAErD"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Process-wide active cron service singleton.
|
|
3
|
+
*
|
|
4
|
+
* The cron service is a singleton in Brigade's process model — the gateway
|
|
5
|
+
* daemon owns ONE `CronServiceState` instance, constructed at boot and
|
|
6
|
+
* wired with the real deps (`runIsolatedAgentJob`, `enqueueSystemEvent`,
|
|
7
|
+
* etc.). Surfaces that need to reach the service — the agent-callable
|
|
8
|
+
* `cron` tool, the gateway RPC handlers, the CLI commands — all look it
|
|
9
|
+
* up here rather than threading the state through every callsite.
|
|
10
|
+
*
|
|
11
|
+
* Pattern mirrors `approval-bridge.ts`'s active-bridge singleton. Tests
|
|
12
|
+
* set this to a fake state in `beforeEach` + null it in `afterEach` so a
|
|
13
|
+
* stray test instance can't leak across suites.
|
|
14
|
+
*
|
|
15
|
+
* P1#9 (Wave H) — pinned via `resolveGlobalSingleton` so dual-loaded
|
|
16
|
+
* Brigade modules (test harness + runtime in one process; hot-reload in
|
|
17
|
+
* dev) share ONE slot. Without the pin, every module copy would carry its
|
|
18
|
+
* own `activeState` and the agent tool / gateway handler that imported a
|
|
19
|
+
* different copy than the boot path would silently see `null`.
|
|
20
|
+
*/
|
|
21
|
+
import { resolveGlobalSingleton } from "../shared/global-singleton.js";
|
|
22
|
+
const ACTIVE_CRON_SERVICE_KEY = Symbol.for("brigade.cron.activeService");
|
|
23
|
+
function getState() {
|
|
24
|
+
return resolveGlobalSingleton(ACTIVE_CRON_SERVICE_KEY, () => ({
|
|
25
|
+
activeState: null,
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
/** Set the process-wide active cron service. Gateway boot calls this once. */
|
|
29
|
+
export function setActiveCronService(state) {
|
|
30
|
+
getState().activeState = state;
|
|
31
|
+
}
|
|
32
|
+
/** Read the active service. Returns `null` when no daemon has booted yet. */
|
|
33
|
+
export function getActiveCronService() {
|
|
34
|
+
return getState().activeState;
|
|
35
|
+
}
|
|
36
|
+
/** Resolve or throw — caller wants the service and wants a clear error otherwise. */
|
|
37
|
+
export function requireActiveCronService() {
|
|
38
|
+
const state = getState().activeState;
|
|
39
|
+
if (!state) {
|
|
40
|
+
throw new Error("cron service not initialized — boot the gateway (or set a test fake) before calling this surface");
|
|
41
|
+
}
|
|
42
|
+
return state;
|
|
43
|
+
}
|
|
44
|
+
/** Test-only — clear between cases. */
|
|
45
|
+
export function clearActiveCronServiceForTests() {
|
|
46
|
+
getState().activeState = null;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=active-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"active-service.js","sourceRoot":"","sources":["../../src/cron/active-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAKvE,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAEzE,SAAS,QAAQ;IAChB,OAAO,sBAAsB,CAAyB,uBAAuB,EAAE,GAAG,EAAE,CAAC,CAAC;QACrF,WAAW,EAAE,IAAI;KACjB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,oBAAoB,CAAC,KAA8B;IAClE,QAAQ,EAAE,CAAC,WAAW,GAAG,KAAK,CAAC;AAChC,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,oBAAoB;IACnC,OAAO,QAAQ,EAAE,CAAC,WAAW,CAAC;AAC/B,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,wBAAwB;IACvC,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC,WAAW,CAAC;IACrC,IAAI,CAAC,KAAK,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACd,kGAAkG,CAClG,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AAED,uCAAuC;AACvC,MAAM,UAAU,8BAA8B;IAC7C,QAAQ,EAAE,CAAC,WAAW,GAAG,IAAI,CAAC;AAC/B,CAAC"}
|