@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,1199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `brigade agents <list|bindings|bind|unbind|add|set-identity|delete>` — the
|
|
3
|
+
* seven CRUD command runners that drive the `cfg.agents` keyed map + the
|
|
4
|
+
* `cfg.bindings.entries[]` routing layer.
|
|
5
|
+
*
|
|
6
|
+
* Brand-scrubbed lift of the reference codebase's
|
|
7
|
+
* `src/commands/agents.commands.{list,bind,add,identity,delete}.ts`, adapted
|
|
8
|
+
* to Brigade's surfaces:
|
|
9
|
+
*
|
|
10
|
+
* - `loadConfig()` / `saveConfig()` from `core/config.ts` (NOT
|
|
11
|
+
* `replaceConfigFile`). Brigade ships its own write path with restore-
|
|
12
|
+
* env-var, top-level reordering, backup rotation, and audit logging.
|
|
13
|
+
* - `cfg.bindings.entries[]` wrapper (NOT a flat `cfg.bindings` array).
|
|
14
|
+
* - `cfg.agents.<id>` keyed map (NOT `cfg.agents.list[]`).
|
|
15
|
+
* - `resolveAgentWorkspaceDir(agentId)` / `resolveAgentDir(agentId)` /
|
|
16
|
+
* `resolveSessionsDir(agentId)` from `config/paths.ts`.
|
|
17
|
+
* - `DEFAULT_AGENT_ID` ("main") + `normalizeAgentId` from `agents/routing/
|
|
18
|
+
* session-key.ts`.
|
|
19
|
+
*
|
|
20
|
+
* Interactive prompts (clack wizard, readline confirm) are NOT lifted yet —
|
|
21
|
+
* Brigade has no clack-prompter and the user explicitly opted for "non-
|
|
22
|
+
* interactive first, interactive parity later". Every runner errors clearly
|
|
23
|
+
* when a flag set requires interaction and the flag is missing.
|
|
24
|
+
*
|
|
25
|
+
* Each runner returns an exit code (0 success / 1 failure) — same shape as
|
|
26
|
+
* `src/cli/commands/exec-cmd.ts` — and never calls `process.exit` itself so
|
|
27
|
+
* a higher-level dispatcher can compose them.
|
|
28
|
+
*/
|
|
29
|
+
import { existsSync, mkdirSync, readdirSync, renameSync, rmSync } from "node:fs";
|
|
30
|
+
import path from "node:path";
|
|
31
|
+
import { applyAutoEnableA2AOnAgentCreate as canonicalizedApplyAutoEnableA2AOnAgentCreate } from "../../agents/a2a-policy-canonicalize.js";
|
|
32
|
+
import { BUNDLED_MODULES, loadModules } from "../../agents/extensions/index.js";
|
|
33
|
+
import { resolveDefaultAgentId } from "../../agents/agent-scope.js";
|
|
34
|
+
import { listBindings } from "../../agents/routing/bindings.js";
|
|
35
|
+
import { DEFAULT_AGENT_ID, normalizeAgentId } from "../../agents/routing/session-key.js";
|
|
36
|
+
import { resolveAgentDir, resolveAgentWorkspaceDir, resolveSessionsDir, resolveStateDir, } from "../../config/paths.js";
|
|
37
|
+
import { loadConfig, saveConfig } from "../../core/config.js";
|
|
38
|
+
import { mutateConfigAtomic } from "../../config/io.js";
|
|
39
|
+
import { tryGetRuntimeContext } from "../../storage/runtime-context.js";
|
|
40
|
+
import { bootstrapWorkspace } from "../../workspace/bootstrap.js";
|
|
41
|
+
import { applyAgentBindings, describeBinding, listRouteBindings, parseBindingSpecs, removeAgentBindings, } from "./agents-bindings.js";
|
|
42
|
+
import { applyAgentConfig, buildAgentSummaries, findAgentEntryIndex, identityHasValues, listAgentEntries, loadAgentIdentity, parseIdentityMarkdown, pruneAgentConfig, } from "./agents-config.js";
|
|
43
|
+
// Words that the connect-mode TUI, gateway, or shell scripting would mistake
|
|
44
|
+
// for sentinels ("none" meaning unset, "default" colliding with the cfg
|
|
45
|
+
// reserved key, "null"/"undefined" being JS literals). Keep this list short —
|
|
46
|
+
// `main` is already covered by DEFAULT_AGENT_ID elsewhere.
|
|
47
|
+
const RESERVED_AGENT_IDS = new Set(["none", "null", "undefined", "default", "all", "any"]);
|
|
48
|
+
function defaultSink() {
|
|
49
|
+
return {
|
|
50
|
+
log: (m) => process.stdout.write(`${m}\n`),
|
|
51
|
+
error: (m) => process.stderr.write(`${m}\n`),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function writeJson(sink, payload) {
|
|
55
|
+
sink.log(JSON.stringify(payload, null, 2));
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* H2: when --json is set, error paths must emit a parseable JSON envelope
|
|
59
|
+
* to stderr instead of a human-readable line. Returns the original message
|
|
60
|
+
* so callers can keep a single `sink.error(msg)` shape behind a guard.
|
|
61
|
+
*/
|
|
62
|
+
function emitErrorJson(sink, opts, message) {
|
|
63
|
+
if (opts?.json) {
|
|
64
|
+
sink.error(JSON.stringify({ error: message }));
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
sink.error(message);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/** Best-effort home-relative path renderer — keeps screenshots clean. */
|
|
71
|
+
function shortenHomePath(p) {
|
|
72
|
+
const home = process.env.HOME ?? process.env.USERPROFILE ?? "";
|
|
73
|
+
if (!home)
|
|
74
|
+
return p;
|
|
75
|
+
const abs = path.resolve(p);
|
|
76
|
+
const homeAbs = path.resolve(home);
|
|
77
|
+
if (abs === homeAbs)
|
|
78
|
+
return "~";
|
|
79
|
+
if (abs.startsWith(homeAbs + path.sep))
|
|
80
|
+
return `~${abs.slice(homeAbs.length)}`;
|
|
81
|
+
return p;
|
|
82
|
+
}
|
|
83
|
+
/** Resolve user-typed path (`~`, env vars left literal, relative → cwd). */
|
|
84
|
+
function resolveUserPath(input) {
|
|
85
|
+
const trimmed = input.trim();
|
|
86
|
+
if (!trimmed)
|
|
87
|
+
return trimmed;
|
|
88
|
+
const home = process.env.HOME ?? process.env.USERPROFILE ?? "";
|
|
89
|
+
if (trimmed === "~")
|
|
90
|
+
return home || trimmed;
|
|
91
|
+
if (home && trimmed.startsWith("~/"))
|
|
92
|
+
return path.resolve(home, trimmed.slice(2));
|
|
93
|
+
return path.resolve(trimmed);
|
|
94
|
+
}
|
|
95
|
+
/** Look up the bundled channel catalog so parseBindingSpecs can validate. */
|
|
96
|
+
async function loadChannelCatalog() {
|
|
97
|
+
try {
|
|
98
|
+
const config = loadConfig();
|
|
99
|
+
const workspaceDir = resolveAgentWorkspaceDir(DEFAULT_AGENT_ID);
|
|
100
|
+
const registry = await loadModules({
|
|
101
|
+
modules: BUNDLED_MODULES,
|
|
102
|
+
meta: { agentId: DEFAULT_AGENT_ID, workspaceDir, cwd: workspaceDir, config: config },
|
|
103
|
+
});
|
|
104
|
+
return registry.channels.map((adapter) => ({ id: adapter.id }));
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
// Catalog load is best-effort — parseBindingSpecs treats undefined as
|
|
108
|
+
// "skip validation", so binding still works against an empty registry.
|
|
109
|
+
return [];
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function hasAgent(cfg, agentId) {
|
|
113
|
+
return buildAgentSummaries(cfg).some((s) => s.id === agentId);
|
|
114
|
+
}
|
|
115
|
+
function resolveTargetAgentId(cfg, agentInput, fallbackToDefault) {
|
|
116
|
+
if (agentInput?.trim())
|
|
117
|
+
return normalizeAgentId(agentInput);
|
|
118
|
+
if (fallbackToDefault)
|
|
119
|
+
return normalizeAgentId(resolveDefaultAgentId(cfg));
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
function formatBindingOwnerLine(b) {
|
|
123
|
+
return `${normalizeAgentId(b.agentId)} <- ${describeBinding(b)}`;
|
|
124
|
+
}
|
|
125
|
+
function formatBindingConflicts(conflicts) {
|
|
126
|
+
return conflicts.map((c) => `${describeBinding(c.binding)} (agent=${c.existingAgentId})`);
|
|
127
|
+
}
|
|
128
|
+
/** Render one agent-summary card for the human `agents list` output. */
|
|
129
|
+
function formatSummary(summary) {
|
|
130
|
+
const defaultTag = summary.isDefault ? " (default)" : "";
|
|
131
|
+
const header = summary.name && summary.name !== summary.id
|
|
132
|
+
? `${summary.id}${defaultTag} (${summary.name})`
|
|
133
|
+
: `${summary.id}${defaultTag}`;
|
|
134
|
+
const identityParts = [];
|
|
135
|
+
if (summary.identityEmoji)
|
|
136
|
+
identityParts.push(summary.identityEmoji);
|
|
137
|
+
if (summary.identityName)
|
|
138
|
+
identityParts.push(summary.identityName);
|
|
139
|
+
const identityLine = identityParts.length > 0 ? identityParts.join(" ") : null;
|
|
140
|
+
const identitySource = summary.identitySource === "identity"
|
|
141
|
+
? "IDENTITY.md"
|
|
142
|
+
: summary.identitySource === "config"
|
|
143
|
+
? "config"
|
|
144
|
+
: null;
|
|
145
|
+
const lines = [`- ${header}`];
|
|
146
|
+
if (identityLine) {
|
|
147
|
+
lines.push(` Identity: ${identityLine}${identitySource ? ` (${identitySource})` : ""}`);
|
|
148
|
+
}
|
|
149
|
+
lines.push(` Workspace: ${shortenHomePath(summary.workspace)}`);
|
|
150
|
+
lines.push(` Agent dir: ${shortenHomePath(summary.agentDir)}`);
|
|
151
|
+
if (summary.model)
|
|
152
|
+
lines.push(` Model: ${summary.model}`);
|
|
153
|
+
if (summary.provider)
|
|
154
|
+
lines.push(` Provider: ${summary.provider}`);
|
|
155
|
+
lines.push(` Routing rules: ${summary.bindings}`);
|
|
156
|
+
if (summary.bindingDetails?.length) {
|
|
157
|
+
lines.push(" Routing rules:");
|
|
158
|
+
for (const b of summary.bindingDetails)
|
|
159
|
+
lines.push(` - ${b}`);
|
|
160
|
+
}
|
|
161
|
+
return lines.join("\n");
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* UX-bridge helper: ensure `cfg.session.agentToAgent` carries a usable A2A
|
|
165
|
+
* policy after an `agents add`. Without this, a freshly added agent has the
|
|
166
|
+
* subagent allowlist seed (`applyAutoAllowOnCreate`) but A2A messaging via
|
|
167
|
+
* `sessions_send` still refuses because the policy block is missing /
|
|
168
|
+
* disabled — the model can spawn but cannot ping-pong.
|
|
169
|
+
*
|
|
170
|
+
* Thin wrapper around the shared `canonicalizeA2APolicy` helper
|
|
171
|
+
* (`agents/a2a-policy-canonicalize.ts`) — see that module for the full
|
|
172
|
+
* semantics matrix. Gated by `cfg.session.autoEnableA2AOnAgentCreate`
|
|
173
|
+
* (default `true`); sibling boot-time variant `applyAutoEnableA2AAtBoot`
|
|
174
|
+
* fires inside `continueBoot()`.
|
|
175
|
+
*
|
|
176
|
+
* The companion `pruneAgentConfig` (in agents-config.ts) strips the deleted
|
|
177
|
+
* agent id from any `allow` pair on `agents delete`, so add+delete stay
|
|
178
|
+
* symmetric without a separate code path.
|
|
179
|
+
*/
|
|
180
|
+
export function applyAutoEnableA2AOnAgentCreate(cfg) {
|
|
181
|
+
return canonicalizedApplyAutoEnableA2AOnAgentCreate(cfg);
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* UX-bridge helper: extend `cfg.agents.defaults.subagents.allowAgents` with
|
|
185
|
+
* the newly created agent id so it surfaces in the allowlist-scoped
|
|
186
|
+
* `agents_list` tool (and becomes spawn-targetable) without the operator
|
|
187
|
+
* having to know the second config key exists.
|
|
188
|
+
*
|
|
189
|
+
* Skipped when:
|
|
190
|
+
* - `cfg.agents.defaults.subagents.autoAllowOnCreate === false`
|
|
191
|
+
* (operator-driven strict allowlist mode — mirrors the reference's
|
|
192
|
+
* stock posture)
|
|
193
|
+
* - The list already contains `"*"` (wildcard already covers it)
|
|
194
|
+
* - The id is already in the list (idempotent re-runs)
|
|
195
|
+
*
|
|
196
|
+
* The companion `pruneAgentConfig` (in agents-config.ts) strips the id on
|
|
197
|
+
* delete so add+delete are symmetric without a separate code path.
|
|
198
|
+
*/
|
|
199
|
+
/**
|
|
200
|
+
* UX-bridge helper: implicit Pride-org init when `manage_agent({action:"add"})`
|
|
201
|
+
* is called with any org-position field (department / reportsTo / role / bio)
|
|
202
|
+
* AND `cfg.org` is absent.
|
|
203
|
+
*
|
|
204
|
+
* The operator should never have to run `brigade org init` separately just
|
|
205
|
+
* to say "create a CEO" or "create an engineer reporting to main" from chat.
|
|
206
|
+
* If the add carries an org seed, this helper:
|
|
207
|
+
*
|
|
208
|
+
* 1. Seeds `cfg.agents.<addedId>.org = { department?, reportsTo?, role?, bio? }`
|
|
209
|
+
* from the provided fields.
|
|
210
|
+
* 2. If `cfg.org` is absent, initialises it:
|
|
211
|
+
* - `cfg.org.topOrder` = the new agent's id IF its reportsTo === null
|
|
212
|
+
* (operator said "make this one the top"); otherwise defaults to
|
|
213
|
+
* `main` (the default agent id) and main is auto-seeded as
|
|
214
|
+
* `{department:"executive", reportsTo:null, role:"Chief of Staff"}`.
|
|
215
|
+
* - `cfg.org.a2a = { mode: "derived" }`.
|
|
216
|
+
* 3. If `cfg.org` is present, just merges the new agent's org block into
|
|
217
|
+
* `cfg.agents.<id>.org` (does NOT touch topOrder / a2a / departmentHeads).
|
|
218
|
+
*
|
|
219
|
+
* Opt-out: `cfg.session.autoEnableOrgOnHierarchicalAdd === false` short-
|
|
220
|
+
* circuits the init step (the new agent's org seed still applies, but
|
|
221
|
+
* cfg.org stays absent — strict mode for operators who curate cfg.org
|
|
222
|
+
* by hand).
|
|
223
|
+
*
|
|
224
|
+
* Companion: when the agent is deleted, `pruneAgentConfig` already strips
|
|
225
|
+
* its `cfg.agents.<id>.org` block (cleared with the agent entry). No
|
|
226
|
+
* separate org-position teardown is needed.
|
|
227
|
+
*/
|
|
228
|
+
export function applyAutoEnableOrgOnHierarchicalAdd(cfg, agentId, orgSeed) {
|
|
229
|
+
if (!orgSeed)
|
|
230
|
+
return cfg;
|
|
231
|
+
const hasAnyOrgField = orgSeed.department !== undefined ||
|
|
232
|
+
orgSeed.reportsTo !== undefined ||
|
|
233
|
+
orgSeed.role !== undefined ||
|
|
234
|
+
orgSeed.bio !== undefined;
|
|
235
|
+
if (!hasAnyOrgField)
|
|
236
|
+
return cfg;
|
|
237
|
+
const id = normalizeAgentId(agentId);
|
|
238
|
+
const sessionRaw = cfg.session ?? {};
|
|
239
|
+
const autoEnable = sessionRaw["autoEnableOrgOnHierarchicalAdd"];
|
|
240
|
+
const agentsRaw = cfg.agents ?? {};
|
|
241
|
+
const newAgentEntry = agentsRaw[id];
|
|
242
|
+
const newAgentObj = newAgentEntry && typeof newAgentEntry === "object" && !Array.isArray(newAgentEntry)
|
|
243
|
+
? newAgentEntry
|
|
244
|
+
: {};
|
|
245
|
+
// Build the new agent's org block from the seed.
|
|
246
|
+
const newAgentOrg = {};
|
|
247
|
+
if (orgSeed.department !== undefined)
|
|
248
|
+
newAgentOrg["department"] = orgSeed.department;
|
|
249
|
+
if (orgSeed.reportsTo !== undefined)
|
|
250
|
+
newAgentOrg["reportsTo"] = orgSeed.reportsTo;
|
|
251
|
+
if (orgSeed.role !== undefined)
|
|
252
|
+
newAgentOrg["role"] = orgSeed.role;
|
|
253
|
+
if (orgSeed.bio !== undefined)
|
|
254
|
+
newAgentOrg["bio"] = orgSeed.bio;
|
|
255
|
+
const nextAgentObj = { ...newAgentObj, org: newAgentOrg };
|
|
256
|
+
let nextAgents = { ...agentsRaw, [id]: nextAgentObj };
|
|
257
|
+
// If cfg.org is already present, just seed the agent block and return.
|
|
258
|
+
const orgRaw = cfg.org;
|
|
259
|
+
if (orgRaw && typeof orgRaw === "object" && !Array.isArray(orgRaw)) {
|
|
260
|
+
return { ...cfg, agents: nextAgents };
|
|
261
|
+
}
|
|
262
|
+
// cfg.org is absent — should we auto-init? Operator opt-out wins.
|
|
263
|
+
if (autoEnable === false) {
|
|
264
|
+
return { ...cfg, agents: nextAgents };
|
|
265
|
+
}
|
|
266
|
+
// Decide topOrder. If the new agent has reportsTo === null, the
|
|
267
|
+
// operator clearly intends the new agent to BE the top. Otherwise
|
|
268
|
+
// default to "main" + seed main's org block as Chief of Staff if it
|
|
269
|
+
// doesn't have one already.
|
|
270
|
+
let topOrder;
|
|
271
|
+
if (orgSeed.reportsTo === null) {
|
|
272
|
+
topOrder = id;
|
|
273
|
+
}
|
|
274
|
+
else {
|
|
275
|
+
topOrder = DEFAULT_AGENT_ID;
|
|
276
|
+
// Seed main's org block iff it's not already present.
|
|
277
|
+
const mainRaw = nextAgents[DEFAULT_AGENT_ID];
|
|
278
|
+
const mainObj = mainRaw && typeof mainRaw === "object" && !Array.isArray(mainRaw)
|
|
279
|
+
? mainRaw
|
|
280
|
+
: {};
|
|
281
|
+
if (!mainObj["org"] || typeof mainObj["org"] !== "object") {
|
|
282
|
+
const mainOrg = {
|
|
283
|
+
department: "executive",
|
|
284
|
+
reportsTo: null,
|
|
285
|
+
role: "Chief of Staff",
|
|
286
|
+
};
|
|
287
|
+
nextAgents = {
|
|
288
|
+
...nextAgents,
|
|
289
|
+
[DEFAULT_AGENT_ID]: { ...mainObj, org: mainOrg },
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
const nextOrg = {
|
|
294
|
+
topOrder,
|
|
295
|
+
a2a: { mode: "derived" },
|
|
296
|
+
};
|
|
297
|
+
return {
|
|
298
|
+
...cfg,
|
|
299
|
+
agents: nextAgents,
|
|
300
|
+
org: nextOrg,
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
export function applyAutoAllowOnCreate(cfg, agentId) {
|
|
304
|
+
const id = normalizeAgentId(agentId);
|
|
305
|
+
const agentsRaw = cfg.agents ?? {};
|
|
306
|
+
const defaultsRaw = agentsRaw["defaults"];
|
|
307
|
+
const defaults = defaultsRaw && typeof defaultsRaw === "object" && !Array.isArray(defaultsRaw)
|
|
308
|
+
? defaultsRaw
|
|
309
|
+
: {};
|
|
310
|
+
const subagentsRaw = defaults["subagents"];
|
|
311
|
+
const subagents = subagentsRaw && typeof subagentsRaw === "object" && !Array.isArray(subagentsRaw)
|
|
312
|
+
? subagentsRaw
|
|
313
|
+
: {};
|
|
314
|
+
// Operator opted out — leave the allowlist alone.
|
|
315
|
+
if (subagents["autoAllowOnCreate"] === false)
|
|
316
|
+
return cfg;
|
|
317
|
+
const allowRaw = subagents["allowAgents"];
|
|
318
|
+
const existing = Array.isArray(allowRaw)
|
|
319
|
+
? allowRaw.filter((v) => typeof v === "string")
|
|
320
|
+
: [];
|
|
321
|
+
// Wildcard already covers everything — skip.
|
|
322
|
+
if (existing.some((v) => v.trim() === "*"))
|
|
323
|
+
return cfg;
|
|
324
|
+
// Already present (idempotent) — skip.
|
|
325
|
+
if (existing.some((v) => normalizeAgentId(v) === id))
|
|
326
|
+
return cfg;
|
|
327
|
+
const nextAllow = [...existing, id];
|
|
328
|
+
const nextSubagents = { ...subagents, allowAgents: nextAllow };
|
|
329
|
+
const nextDefaults = { ...defaults, subagents: nextSubagents };
|
|
330
|
+
const nextAgents = { ...agentsRaw, defaults: nextDefaults };
|
|
331
|
+
return { ...cfg, agents: nextAgents };
|
|
332
|
+
}
|
|
333
|
+
/* ───────────────────────── 1. agents list ───────────────────────── */
|
|
334
|
+
export async function runAgentsList(opts = {}) {
|
|
335
|
+
const sink = defaultSink();
|
|
336
|
+
let cfg;
|
|
337
|
+
try {
|
|
338
|
+
cfg = loadConfig();
|
|
339
|
+
}
|
|
340
|
+
catch (err) {
|
|
341
|
+
emitErrorJson(sink, opts, `brigade agents list: failed to read brigade.json: ${err instanceof Error ? err.message : String(err)}`);
|
|
342
|
+
return 1;
|
|
343
|
+
}
|
|
344
|
+
const summaries = buildAgentSummaries(cfg);
|
|
345
|
+
const bindingMap = new Map();
|
|
346
|
+
for (const b of listBindings(cfg)) {
|
|
347
|
+
const id = normalizeAgentId(b.agentId);
|
|
348
|
+
const list = bindingMap.get(id) ?? [];
|
|
349
|
+
list.push(b);
|
|
350
|
+
bindingMap.set(id, list);
|
|
351
|
+
}
|
|
352
|
+
if (opts.bindings) {
|
|
353
|
+
for (const summary of summaries) {
|
|
354
|
+
const bindings = bindingMap.get(summary.id) ?? [];
|
|
355
|
+
if (bindings.length > 0) {
|
|
356
|
+
summary.bindingDetails = bindings.map((b) => describeBinding(b));
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
if (opts.json) {
|
|
361
|
+
// Keep the JSON contract as an array of summaries — matches OC's shape
|
|
362
|
+
// and existing machine consumers. Orphans are emitted as a stderr
|
|
363
|
+
// warning only (text path below handles them visibly).
|
|
364
|
+
writeJson(sink, summaries);
|
|
365
|
+
return 0;
|
|
366
|
+
}
|
|
367
|
+
const lines = ["Agents:", ...summaries.map(formatSummary)];
|
|
368
|
+
lines.push("Routing rules map channel/account/peer to an agent. Use --bindings for full rules.");
|
|
369
|
+
const orphanDirs = findOrphanAgentDirs(summaries.map((s) => s.id));
|
|
370
|
+
if (orphanDirs.length > 0) {
|
|
371
|
+
lines.push("");
|
|
372
|
+
lines.push(`⚠ Orphan dirs (on disk but NOT in brigade.json): ${orphanDirs.join(", ")}`);
|
|
373
|
+
lines.push(" Clean up with: rm -rf ~/.brigade/agents/<id>/ (or re-register via `brigade agents add`)");
|
|
374
|
+
}
|
|
375
|
+
sink.log(lines.join("\n"));
|
|
376
|
+
return 0;
|
|
377
|
+
}
|
|
378
|
+
// Scan ~/.brigade/agents/ for subdirs that look like agent state (have a
|
|
379
|
+
// workspace/ child) but whose id is NOT in cfg.agents. Catches half-created
|
|
380
|
+
// agents from a partial `agents add` failure, or hand-crafted dirs that
|
|
381
|
+
// skipped the CLI. Returns empty when the agents/ dir doesn't exist.
|
|
382
|
+
function findOrphanAgentDirs(configuredIds) {
|
|
383
|
+
const known = new Set(configuredIds);
|
|
384
|
+
const agentsRoot = path.dirname(resolveAgentDir("__probe__"));
|
|
385
|
+
if (!existsSync(agentsRoot))
|
|
386
|
+
return [];
|
|
387
|
+
const orphans = [];
|
|
388
|
+
try {
|
|
389
|
+
const dirents = readdirSync(agentsRoot, { withFileTypes: true });
|
|
390
|
+
for (const ent of dirents) {
|
|
391
|
+
if (!ent.isDirectory())
|
|
392
|
+
continue;
|
|
393
|
+
const id = ent.name;
|
|
394
|
+
if (known.has(id))
|
|
395
|
+
continue;
|
|
396
|
+
// Only flag dirs that look agent-ish (have a workspace/ subdir).
|
|
397
|
+
const workspaceProbe = path.join(agentsRoot, id, "workspace");
|
|
398
|
+
if (existsSync(workspaceProbe)) {
|
|
399
|
+
orphans.push(id);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
catch {
|
|
404
|
+
// Best-effort — list shouldn't fail because of a scan error.
|
|
405
|
+
}
|
|
406
|
+
return orphans;
|
|
407
|
+
}
|
|
408
|
+
/* ───────────────────────── 2. agents bindings ───────────────────────── */
|
|
409
|
+
export async function runAgentsBindings(opts = {}) {
|
|
410
|
+
const sink = defaultSink();
|
|
411
|
+
let cfg;
|
|
412
|
+
try {
|
|
413
|
+
cfg = loadConfig();
|
|
414
|
+
}
|
|
415
|
+
catch (err) {
|
|
416
|
+
emitErrorJson(sink, opts, `brigade agents bindings: failed to read brigade.json: ${err instanceof Error ? err.message : String(err)}`);
|
|
417
|
+
return 1;
|
|
418
|
+
}
|
|
419
|
+
const filterAgentId = opts.agent?.trim() ? normalizeAgentId(opts.agent) : null;
|
|
420
|
+
if (opts.agent && !filterAgentId) {
|
|
421
|
+
emitErrorJson(sink, opts, "Agent id is required.");
|
|
422
|
+
return 1;
|
|
423
|
+
}
|
|
424
|
+
if (filterAgentId && !hasAgent(cfg, filterAgentId)) {
|
|
425
|
+
emitErrorJson(sink, opts, `Agent "${filterAgentId}" not found.`);
|
|
426
|
+
return 1;
|
|
427
|
+
}
|
|
428
|
+
const filtered = listRouteBindings(cfg).filter((b) => !filterAgentId || normalizeAgentId(b.agentId) === filterAgentId);
|
|
429
|
+
if (opts.json) {
|
|
430
|
+
writeJson(sink, filtered.map((b) => ({
|
|
431
|
+
agentId: normalizeAgentId(b.agentId),
|
|
432
|
+
match: b.match,
|
|
433
|
+
description: describeBinding(b),
|
|
434
|
+
})));
|
|
435
|
+
return 0;
|
|
436
|
+
}
|
|
437
|
+
if (filtered.length === 0) {
|
|
438
|
+
sink.log(filterAgentId ? `No routing bindings for agent "${filterAgentId}".` : "No routing bindings.");
|
|
439
|
+
return 0;
|
|
440
|
+
}
|
|
441
|
+
sink.log(["Routing bindings:", ...filtered.map((b) => `- ${formatBindingOwnerLine(b)}`)].join("\n"));
|
|
442
|
+
return 0;
|
|
443
|
+
}
|
|
444
|
+
/* ───────────────────────── 3. agents bind ───────────────────────── */
|
|
445
|
+
export async function runAgentsBind(opts = {}) {
|
|
446
|
+
const sink = defaultSink();
|
|
447
|
+
let cfg;
|
|
448
|
+
try {
|
|
449
|
+
cfg = loadConfig();
|
|
450
|
+
}
|
|
451
|
+
catch (err) {
|
|
452
|
+
emitErrorJson(sink, opts, `brigade agents bind: failed to read brigade.json: ${err instanceof Error ? err.message : String(err)}`);
|
|
453
|
+
return 1;
|
|
454
|
+
}
|
|
455
|
+
const agentId = resolveTargetAgentId(cfg, opts.agent, true);
|
|
456
|
+
if (!agentId) {
|
|
457
|
+
emitErrorJson(sink, opts, "Unable to resolve agent id.");
|
|
458
|
+
return 1;
|
|
459
|
+
}
|
|
460
|
+
if (!hasAgent(cfg, agentId)) {
|
|
461
|
+
emitErrorJson(sink, opts, `Agent "${agentId}" not found.`);
|
|
462
|
+
return 1;
|
|
463
|
+
}
|
|
464
|
+
const specs = (opts.bind ?? []).map((v) => v.trim()).filter(Boolean);
|
|
465
|
+
if (specs.length === 0) {
|
|
466
|
+
emitErrorJson(sink, opts, "Provide at least one --bind <channel[:accountId]>.");
|
|
467
|
+
return 1;
|
|
468
|
+
}
|
|
469
|
+
const catalog = await loadChannelCatalog();
|
|
470
|
+
const parsed = parseBindingSpecs({ agentId, specs, config: cfg, channels: catalog });
|
|
471
|
+
if (parsed.errors.length > 0) {
|
|
472
|
+
emitErrorJson(sink, opts, parsed.errors.join("\n"));
|
|
473
|
+
return 1;
|
|
474
|
+
}
|
|
475
|
+
const result = applyAgentBindings(cfg, parsed.bindings);
|
|
476
|
+
if (result.added.length > 0 || result.updated.length > 0) {
|
|
477
|
+
saveConfig(result.config);
|
|
478
|
+
}
|
|
479
|
+
const payload = {
|
|
480
|
+
agentId,
|
|
481
|
+
added: result.added.map(describeBinding),
|
|
482
|
+
updated: result.updated.map(describeBinding),
|
|
483
|
+
skipped: result.skipped.map(describeBinding),
|
|
484
|
+
conflicts: formatBindingConflicts(result.conflicts),
|
|
485
|
+
};
|
|
486
|
+
if (opts.json) {
|
|
487
|
+
writeJson(sink, payload);
|
|
488
|
+
return result.conflicts.length > 0 ? 1 : 0;
|
|
489
|
+
}
|
|
490
|
+
if (result.added.length > 0) {
|
|
491
|
+
sink.log("Added bindings:");
|
|
492
|
+
for (const b of result.added)
|
|
493
|
+
sink.log(`- ${describeBinding(b)}`);
|
|
494
|
+
}
|
|
495
|
+
else if (result.updated.length === 0) {
|
|
496
|
+
sink.log("No new bindings added.");
|
|
497
|
+
}
|
|
498
|
+
if (result.updated.length > 0) {
|
|
499
|
+
sink.log("Updated bindings:");
|
|
500
|
+
for (const b of result.updated)
|
|
501
|
+
sink.log(`- ${describeBinding(b)}`);
|
|
502
|
+
}
|
|
503
|
+
if (result.skipped.length > 0) {
|
|
504
|
+
sink.log("Already present:");
|
|
505
|
+
for (const b of result.skipped)
|
|
506
|
+
sink.log(`- ${describeBinding(b)}`);
|
|
507
|
+
}
|
|
508
|
+
if (result.conflicts.length > 0) {
|
|
509
|
+
sink.error("Skipped bindings already claimed by another agent:");
|
|
510
|
+
for (const c of result.conflicts) {
|
|
511
|
+
sink.error(`- ${describeBinding(c.binding)} (agent=${c.existingAgentId})`);
|
|
512
|
+
}
|
|
513
|
+
return 1;
|
|
514
|
+
}
|
|
515
|
+
return 0;
|
|
516
|
+
}
|
|
517
|
+
/* ───────────────────────── 4. agents unbind ───────────────────────── */
|
|
518
|
+
export async function runAgentsUnbind(opts = {}) {
|
|
519
|
+
const sink = defaultSink();
|
|
520
|
+
let cfg;
|
|
521
|
+
try {
|
|
522
|
+
cfg = loadConfig();
|
|
523
|
+
}
|
|
524
|
+
catch (err) {
|
|
525
|
+
emitErrorJson(sink, opts, `brigade agents unbind: failed to read brigade.json: ${err instanceof Error ? err.message : String(err)}`);
|
|
526
|
+
return 1;
|
|
527
|
+
}
|
|
528
|
+
const agentId = resolveTargetAgentId(cfg, opts.agent, true);
|
|
529
|
+
if (!agentId) {
|
|
530
|
+
emitErrorJson(sink, opts, "Unable to resolve agent id.");
|
|
531
|
+
return 1;
|
|
532
|
+
}
|
|
533
|
+
if (!hasAgent(cfg, agentId)) {
|
|
534
|
+
emitErrorJson(sink, opts, `Agent "${agentId}" not found.`);
|
|
535
|
+
return 1;
|
|
536
|
+
}
|
|
537
|
+
if (opts.all && (opts.bind?.length ?? 0) > 0) {
|
|
538
|
+
emitErrorJson(sink, opts, "Use either --all or --bind, not both.");
|
|
539
|
+
return 1;
|
|
540
|
+
}
|
|
541
|
+
if (opts.all) {
|
|
542
|
+
const existing = listRouteBindings(cfg);
|
|
543
|
+
const removed = existing.filter((b) => normalizeAgentId(b.agentId) === agentId);
|
|
544
|
+
const kept = existing.filter((b) => normalizeAgentId(b.agentId) !== agentId);
|
|
545
|
+
if (removed.length === 0) {
|
|
546
|
+
if (opts.json) {
|
|
547
|
+
writeJson(sink, { agentId, removed: [], missing: [], conflicts: [] });
|
|
548
|
+
}
|
|
549
|
+
else {
|
|
550
|
+
sink.log(`No bindings to remove for agent "${agentId}".`);
|
|
551
|
+
}
|
|
552
|
+
return 0;
|
|
553
|
+
}
|
|
554
|
+
const next = {
|
|
555
|
+
...cfg,
|
|
556
|
+
bindings: { entries: kept },
|
|
557
|
+
};
|
|
558
|
+
saveConfig(next);
|
|
559
|
+
const payload = {
|
|
560
|
+
agentId,
|
|
561
|
+
removed: removed.map(describeBinding),
|
|
562
|
+
missing: [],
|
|
563
|
+
conflicts: [],
|
|
564
|
+
};
|
|
565
|
+
if (opts.json) {
|
|
566
|
+
writeJson(sink, payload);
|
|
567
|
+
}
|
|
568
|
+
else {
|
|
569
|
+
sink.log(`Removed ${removed.length} binding(s) for "${agentId}".`);
|
|
570
|
+
}
|
|
571
|
+
return 0;
|
|
572
|
+
}
|
|
573
|
+
const specs = (opts.bind ?? []).map((v) => v.trim()).filter(Boolean);
|
|
574
|
+
if (specs.length === 0) {
|
|
575
|
+
emitErrorJson(sink, opts, "Provide at least one --bind <channel[:accountId]> or use --all.");
|
|
576
|
+
return 1;
|
|
577
|
+
}
|
|
578
|
+
const catalog = await loadChannelCatalog();
|
|
579
|
+
const parsed = parseBindingSpecs({ agentId, specs, config: cfg, channels: catalog });
|
|
580
|
+
if (parsed.errors.length > 0) {
|
|
581
|
+
emitErrorJson(sink, opts, parsed.errors.join("\n"));
|
|
582
|
+
return 1;
|
|
583
|
+
}
|
|
584
|
+
const result = removeAgentBindings(cfg, parsed.bindings);
|
|
585
|
+
if (result.removed.length > 0) {
|
|
586
|
+
saveConfig(result.config);
|
|
587
|
+
}
|
|
588
|
+
const payload = {
|
|
589
|
+
agentId,
|
|
590
|
+
removed: result.removed.map(describeBinding),
|
|
591
|
+
missing: result.missing.map(describeBinding),
|
|
592
|
+
conflicts: formatBindingConflicts(result.conflicts),
|
|
593
|
+
};
|
|
594
|
+
if (opts.json) {
|
|
595
|
+
writeJson(sink, payload);
|
|
596
|
+
return result.conflicts.length > 0 ? 1 : 0;
|
|
597
|
+
}
|
|
598
|
+
if (result.removed.length > 0) {
|
|
599
|
+
sink.log("Removed bindings:");
|
|
600
|
+
for (const b of result.removed)
|
|
601
|
+
sink.log(`- ${describeBinding(b)}`);
|
|
602
|
+
}
|
|
603
|
+
else {
|
|
604
|
+
sink.log("No bindings removed.");
|
|
605
|
+
}
|
|
606
|
+
if (result.missing.length > 0) {
|
|
607
|
+
sink.log("Not found:");
|
|
608
|
+
for (const b of result.missing)
|
|
609
|
+
sink.log(`- ${describeBinding(b)}`);
|
|
610
|
+
}
|
|
611
|
+
if (result.conflicts.length > 0) {
|
|
612
|
+
sink.error("Bindings are owned by another agent:");
|
|
613
|
+
for (const c of result.conflicts) {
|
|
614
|
+
sink.error(`- ${describeBinding(c.binding)} (agent=${c.existingAgentId})`);
|
|
615
|
+
}
|
|
616
|
+
return 1;
|
|
617
|
+
}
|
|
618
|
+
return 0;
|
|
619
|
+
}
|
|
620
|
+
/* ───────────────────────── 5. agents add ───────────────────────── */
|
|
621
|
+
export async function runAgentsAdd(opts = {}) {
|
|
622
|
+
const sink = defaultSink();
|
|
623
|
+
let cfg;
|
|
624
|
+
try {
|
|
625
|
+
cfg = loadConfig();
|
|
626
|
+
}
|
|
627
|
+
catch (err) {
|
|
628
|
+
emitErrorJson(sink, opts, `brigade agents add: failed to read brigade.json: ${err instanceof Error ? err.message : String(err)}`);
|
|
629
|
+
return 1;
|
|
630
|
+
}
|
|
631
|
+
const nameInput = opts.name?.trim();
|
|
632
|
+
const workspaceFlag = opts.workspace?.trim();
|
|
633
|
+
if (!nameInput) {
|
|
634
|
+
emitErrorJson(sink, opts, "Agent name is required. Usage: brigade agents add <name> [--workspace <dir>]");
|
|
635
|
+
return 1;
|
|
636
|
+
}
|
|
637
|
+
const agentId = normalizeAgentId(nameInput);
|
|
638
|
+
if (agentId === DEFAULT_AGENT_ID) {
|
|
639
|
+
emitErrorJson(sink, opts, `"${DEFAULT_AGENT_ID}" is reserved. Choose another name.`);
|
|
640
|
+
return 1;
|
|
641
|
+
}
|
|
642
|
+
if (RESERVED_AGENT_IDS.has(agentId)) {
|
|
643
|
+
emitErrorJson(sink, opts, `"${agentId}" is a reserved word and cannot be used as an agent id. Reserved: ${[...RESERVED_AGENT_IDS].join(", ")}.`);
|
|
644
|
+
return 1;
|
|
645
|
+
}
|
|
646
|
+
if (agentId !== nameInput) {
|
|
647
|
+
sink.log(`Normalized agent id to "${agentId}".`);
|
|
648
|
+
}
|
|
649
|
+
if (findAgentEntryIndex(listAgentEntries(cfg), agentId) >= 0) {
|
|
650
|
+
emitErrorJson(sink, opts, `Agent "${agentId}" already exists.`);
|
|
651
|
+
return 1;
|
|
652
|
+
}
|
|
653
|
+
const workspaceDir = workspaceFlag ? resolveUserPath(workspaceFlag) : resolveAgentWorkspaceDir(agentId);
|
|
654
|
+
const agentDir = opts.agentDir?.trim() ? resolveUserPath(opts.agentDir.trim()) : resolveAgentDir(agentId);
|
|
655
|
+
const model = opts.model?.trim();
|
|
656
|
+
const provider = opts.provider?.trim();
|
|
657
|
+
let nextConfig = applyAgentConfig(cfg, {
|
|
658
|
+
agentId,
|
|
659
|
+
name: nameInput,
|
|
660
|
+
workspace: workspaceDir,
|
|
661
|
+
agentDir,
|
|
662
|
+
...(model ? { model } : {}),
|
|
663
|
+
...(provider ? { provider } : {}),
|
|
664
|
+
});
|
|
665
|
+
const catalog = await loadChannelCatalog();
|
|
666
|
+
const parsed = parseBindingSpecs({ agentId, specs: opts.bind, config: nextConfig, channels: catalog });
|
|
667
|
+
if (parsed.errors.length > 0) {
|
|
668
|
+
emitErrorJson(sink, opts, parsed.errors.join("\n"));
|
|
669
|
+
return 1;
|
|
670
|
+
}
|
|
671
|
+
const bindingResult = parsed.bindings.length > 0
|
|
672
|
+
? applyAgentBindings(nextConfig, parsed.bindings)
|
|
673
|
+
: { config: nextConfig, added: [], updated: [], skipped: [], conflicts: [] };
|
|
674
|
+
nextConfig = bindingResult.config;
|
|
675
|
+
// H7: saveConfig + bootstrapWorkspace must be atomic from the caller's
|
|
676
|
+
// perspective. If bootstrap throws (e.g. invalid workspace path) after
|
|
677
|
+
// we already persisted the new agent entry, roll the entry back so the
|
|
678
|
+
// operator does not end up with a half-created agent that boots up but
|
|
679
|
+
// has no workspace files.
|
|
680
|
+
//
|
|
681
|
+
// H8: the agent-add diff is re-applied against the freshest on-disk cfg
|
|
682
|
+
// inside the in-process mutex (mutateConfigAtomic). A concurrent set-model
|
|
683
|
+
// or set-thinking can no longer be silently stomped by the snapshot we
|
|
684
|
+
// read at the top of this function. The rollback also runs through the
|
|
685
|
+
// mutex so it can't race with another writer either.
|
|
686
|
+
try {
|
|
687
|
+
await mutateConfigAtomic((cur) => {
|
|
688
|
+
let staged = applyAgentConfig(cur, {
|
|
689
|
+
agentId,
|
|
690
|
+
name: nameInput,
|
|
691
|
+
workspace: workspaceDir,
|
|
692
|
+
agentDir,
|
|
693
|
+
...(model ? { model } : {}),
|
|
694
|
+
...(provider ? { provider } : {}),
|
|
695
|
+
});
|
|
696
|
+
if (parsed.bindings.length > 0) {
|
|
697
|
+
const reapplied = applyAgentBindings(staged, parsed.bindings);
|
|
698
|
+
staged = reapplied.config;
|
|
699
|
+
}
|
|
700
|
+
// UX-bridge: auto-extend `cfg.agents.defaults.subagents.allowAgents`
|
|
701
|
+
// so the newly added agent is immediately spawn-targetable + visible
|
|
702
|
+
// to peers via `agents_list` (which is allowlist-scoped). Without
|
|
703
|
+
// this, a fresh `manage_agent({action:"add"})` creates an entry the
|
|
704
|
+
// operator can SEE in `brigade agents list` but the model cannot
|
|
705
|
+
// see in `agents_list` until the operator hand-edits the allowlist.
|
|
706
|
+
//
|
|
707
|
+
// Opt-out: `cfg.agents.defaults.subagents.autoAllowOnCreate = false`
|
|
708
|
+
// disables the seed for operators who manage the allowlist by hand
|
|
709
|
+
// (strict-allowlist mode mirroring the reference's stock posture).
|
|
710
|
+
//
|
|
711
|
+
// Idempotent: skipped when the list already contains `"*"` (wildcard
|
|
712
|
+
// already covers it) or the agent id is already present.
|
|
713
|
+
staged = applyAutoAllowOnCreate(staged, agentId);
|
|
714
|
+
// UX-bridge (sibling seed): ensure `cfg.session.agentToAgent` carries
|
|
715
|
+
// a usable A2A policy so the new agent can ping-pong via
|
|
716
|
+
// `sessions_send` immediately. Without this, the subagent allowlist
|
|
717
|
+
// seed above lets the model see + spawn the new agent — but the A2A
|
|
718
|
+
// flow still refuses because the policy block is absent / disabled.
|
|
719
|
+
// Same opt-out story: `cfg.session.autoEnableA2AOnAgentCreate = false`.
|
|
720
|
+
staged = applyAutoEnableA2AOnAgentCreate(staged);
|
|
721
|
+
// UX-bridge (Pride org): when manage_agent was called with any
|
|
722
|
+
// org field (department / reportsTo / role / bio), seed the new
|
|
723
|
+
// agent's cfg.agents.<id>.org block AND auto-init cfg.org if
|
|
724
|
+
// it's absent. Lets the operator stand up a virtual office
|
|
725
|
+
// implicitly from chat — "create a CEO" or "create eng-lead
|
|
726
|
+
// reporting to main" works without a separate `brigade org
|
|
727
|
+
// init` step. Opt-out: cfg.session.autoEnableOrgOnHierarchicalAdd
|
|
728
|
+
// = false (operator curates cfg.org by hand).
|
|
729
|
+
staged = applyAutoEnableOrgOnHierarchicalAdd(staged, agentId, opts.org);
|
|
730
|
+
return staged;
|
|
731
|
+
});
|
|
732
|
+
await bootstrapWorkspace(workspaceDir);
|
|
733
|
+
}
|
|
734
|
+
catch (err) {
|
|
735
|
+
// Roll back the just-added agent (plus any bindings keyed to it).
|
|
736
|
+
try {
|
|
737
|
+
await mutateConfigAtomic((cur) => {
|
|
738
|
+
const pruned = pruneAgentConfig(cur, agentId);
|
|
739
|
+
return pruned.config;
|
|
740
|
+
});
|
|
741
|
+
}
|
|
742
|
+
catch (rollbackErr) {
|
|
743
|
+
emitErrorJson(sink, opts, `brigade agents add: rollback also failed: ${rollbackErr instanceof Error ? rollbackErr.message : String(rollbackErr)}`);
|
|
744
|
+
}
|
|
745
|
+
emitErrorJson(sink, opts, `brigade agents add: failed to bootstrap workspace, rolled back agent "${agentId}": ${err instanceof Error ? err.message : String(err)}`);
|
|
746
|
+
return 1;
|
|
747
|
+
}
|
|
748
|
+
const payload = {
|
|
749
|
+
agentId,
|
|
750
|
+
name: nameInput,
|
|
751
|
+
workspace: workspaceDir,
|
|
752
|
+
agentDir,
|
|
753
|
+
model: model ?? null,
|
|
754
|
+
provider: provider ?? null,
|
|
755
|
+
bindings: {
|
|
756
|
+
added: bindingResult.added.map(describeBinding),
|
|
757
|
+
updated: bindingResult.updated.map(describeBinding),
|
|
758
|
+
skipped: bindingResult.skipped.map(describeBinding),
|
|
759
|
+
conflicts: bindingResult.conflicts.map((c) => `${describeBinding(c.binding)} (agent=${c.existingAgentId})`),
|
|
760
|
+
},
|
|
761
|
+
};
|
|
762
|
+
if (opts.json) {
|
|
763
|
+
writeJson(sink, payload);
|
|
764
|
+
return bindingResult.conflicts.length > 0 ? 1 : 0;
|
|
765
|
+
}
|
|
766
|
+
sink.log(`Agent: ${agentId}`);
|
|
767
|
+
sink.log(`Workspace: ${shortenHomePath(workspaceDir)}`);
|
|
768
|
+
sink.log(`Agent dir: ${shortenHomePath(agentDir)}`);
|
|
769
|
+
if (model)
|
|
770
|
+
sink.log(`Model: ${model}`);
|
|
771
|
+
if (provider)
|
|
772
|
+
sink.log(`Provider: ${provider}`);
|
|
773
|
+
if (bindingResult.added.length > 0) {
|
|
774
|
+
sink.log("Added bindings:");
|
|
775
|
+
for (const b of bindingResult.added)
|
|
776
|
+
sink.log(`- ${describeBinding(b)}`);
|
|
777
|
+
}
|
|
778
|
+
if (bindingResult.conflicts.length > 0) {
|
|
779
|
+
sink.error("Skipped bindings already claimed by another agent:");
|
|
780
|
+
for (const c of bindingResult.conflicts) {
|
|
781
|
+
sink.error(`- ${describeBinding(c.binding)} (agent=${c.existingAgentId})`);
|
|
782
|
+
}
|
|
783
|
+
return 1;
|
|
784
|
+
}
|
|
785
|
+
return 0;
|
|
786
|
+
}
|
|
787
|
+
/* ───────────────────────── 6. agents set-identity ───────────────────────── */
|
|
788
|
+
const normalizeWorkspacePath = (input) => path.resolve(resolveUserPath(input));
|
|
789
|
+
function trimOpt(value) {
|
|
790
|
+
if (typeof value !== "string")
|
|
791
|
+
return undefined;
|
|
792
|
+
const t = value.trim();
|
|
793
|
+
return t.length > 0 ? t : undefined;
|
|
794
|
+
}
|
|
795
|
+
function resolveAgentIdByWorkspace(cfg, workspaceDir) {
|
|
796
|
+
const list = listAgentEntries(cfg);
|
|
797
|
+
const ids = list.length > 0
|
|
798
|
+
? list.map((e) => normalizeAgentId(e.id))
|
|
799
|
+
: [normalizeAgentId(resolveDefaultAgentId(cfg))];
|
|
800
|
+
const target = normalizeWorkspacePath(workspaceDir);
|
|
801
|
+
return ids.filter((id) => normalizeWorkspacePath(resolveAgentWorkspaceDir(id)) === target);
|
|
802
|
+
}
|
|
803
|
+
async function loadIdentityFromFile(filePath) {
|
|
804
|
+
try {
|
|
805
|
+
const fs = await import("node:fs/promises");
|
|
806
|
+
const content = await fs.readFile(filePath, "utf8");
|
|
807
|
+
const parsed = parseIdentityMarkdown(content);
|
|
808
|
+
return identityHasValues(parsed) ? parsed : null;
|
|
809
|
+
}
|
|
810
|
+
catch {
|
|
811
|
+
return null;
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
export async function runAgentsSetIdentity(opts = {}) {
|
|
815
|
+
const sink = defaultSink();
|
|
816
|
+
let cfg;
|
|
817
|
+
try {
|
|
818
|
+
cfg = loadConfig();
|
|
819
|
+
}
|
|
820
|
+
catch (err) {
|
|
821
|
+
emitErrorJson(sink, opts, `brigade agents set-identity: failed to read brigade.json: ${err instanceof Error ? err.message : String(err)}`);
|
|
822
|
+
return 1;
|
|
823
|
+
}
|
|
824
|
+
const agentRaw = trimOpt(opts.agent);
|
|
825
|
+
const nameRaw = trimOpt(opts.name);
|
|
826
|
+
const emojiRaw = trimOpt(opts.emoji);
|
|
827
|
+
const themeRaw = trimOpt(opts.theme);
|
|
828
|
+
const avatarRaw = trimOpt(opts.avatar);
|
|
829
|
+
const hasExplicitIdentity = Boolean(nameRaw || emojiRaw || themeRaw || avatarRaw);
|
|
830
|
+
const identityFileRaw = trimOpt(opts.identityFile);
|
|
831
|
+
const workspaceRaw = trimOpt(opts.workspace);
|
|
832
|
+
const wantsIdentityFile = Boolean(opts.fromIdentity || identityFileRaw || !hasExplicitIdentity);
|
|
833
|
+
let identityFilePath;
|
|
834
|
+
let workspaceDir;
|
|
835
|
+
if (identityFileRaw) {
|
|
836
|
+
identityFilePath = normalizeWorkspacePath(identityFileRaw);
|
|
837
|
+
workspaceDir = path.dirname(identityFilePath);
|
|
838
|
+
}
|
|
839
|
+
else if (workspaceRaw) {
|
|
840
|
+
workspaceDir = normalizeWorkspacePath(workspaceRaw);
|
|
841
|
+
}
|
|
842
|
+
else if (wantsIdentityFile || !agentRaw) {
|
|
843
|
+
workspaceDir = path.resolve(process.cwd());
|
|
844
|
+
}
|
|
845
|
+
let agentId = agentRaw ? normalizeAgentId(agentRaw) : undefined;
|
|
846
|
+
if (!agentId) {
|
|
847
|
+
if (!workspaceDir) {
|
|
848
|
+
emitErrorJson(sink, opts, "Select an agent with --agent or provide a workspace via --workspace.");
|
|
849
|
+
return 1;
|
|
850
|
+
}
|
|
851
|
+
const matches = resolveAgentIdByWorkspace(cfg, workspaceDir);
|
|
852
|
+
if (matches.length === 0) {
|
|
853
|
+
emitErrorJson(sink, opts, `No agent workspace matches ${shortenHomePath(workspaceDir)}. Pass --agent to target a specific agent.`);
|
|
854
|
+
return 1;
|
|
855
|
+
}
|
|
856
|
+
if (matches.length > 1) {
|
|
857
|
+
emitErrorJson(sink, opts, `Multiple agents match ${shortenHomePath(workspaceDir)}: ${matches.join(", ")}. Pass --agent to choose one.`);
|
|
858
|
+
return 1;
|
|
859
|
+
}
|
|
860
|
+
agentId = matches[0];
|
|
861
|
+
}
|
|
862
|
+
let identityFromFile = null;
|
|
863
|
+
if (wantsIdentityFile) {
|
|
864
|
+
if (identityFilePath) {
|
|
865
|
+
identityFromFile = await loadIdentityFromFile(identityFilePath);
|
|
866
|
+
}
|
|
867
|
+
else if (workspaceDir) {
|
|
868
|
+
identityFromFile = loadAgentIdentity(workspaceDir);
|
|
869
|
+
}
|
|
870
|
+
if (!identityFromFile) {
|
|
871
|
+
const targetPath = identityFilePath ??
|
|
872
|
+
(workspaceDir ? path.join(workspaceDir, "IDENTITY.md") : "IDENTITY.md");
|
|
873
|
+
emitErrorJson(sink, opts, `No identity data found in ${shortenHomePath(targetPath)}.`);
|
|
874
|
+
return 1;
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
const fileTheme = identityFromFile?.theme ?? identityFromFile?.creature ?? identityFromFile?.vibe ?? undefined;
|
|
878
|
+
const incomingIdentity = {
|
|
879
|
+
...(nameRaw || identityFromFile?.name ? { name: nameRaw ?? identityFromFile?.name } : {}),
|
|
880
|
+
...(emojiRaw || identityFromFile?.emoji ? { emoji: emojiRaw ?? identityFromFile?.emoji } : {}),
|
|
881
|
+
...(themeRaw || fileTheme ? { theme: themeRaw ?? fileTheme } : {}),
|
|
882
|
+
...(avatarRaw || identityFromFile?.avatar
|
|
883
|
+
? { avatar: avatarRaw ?? identityFromFile?.avatar }
|
|
884
|
+
: {}),
|
|
885
|
+
};
|
|
886
|
+
if (!incomingIdentity.name &&
|
|
887
|
+
!incomingIdentity.emoji &&
|
|
888
|
+
!incomingIdentity.theme &&
|
|
889
|
+
!incomingIdentity.avatar) {
|
|
890
|
+
emitErrorJson(sink, opts, "No identity fields provided. Use --name/--emoji/--theme/--avatar or --from-identity.");
|
|
891
|
+
return 1;
|
|
892
|
+
}
|
|
893
|
+
const nextConfig = applyAgentConfig(cfg, {
|
|
894
|
+
agentId,
|
|
895
|
+
identity: incomingIdentity,
|
|
896
|
+
});
|
|
897
|
+
saveConfig(nextConfig);
|
|
898
|
+
if (opts.json) {
|
|
899
|
+
writeJson(sink, {
|
|
900
|
+
agentId,
|
|
901
|
+
identity: incomingIdentity,
|
|
902
|
+
workspace: workspaceDir ?? null,
|
|
903
|
+
identityFile: identityFilePath ?? null,
|
|
904
|
+
});
|
|
905
|
+
return 0;
|
|
906
|
+
}
|
|
907
|
+
sink.log(`Agent: ${agentId}`);
|
|
908
|
+
if (incomingIdentity.name)
|
|
909
|
+
sink.log(`Name: ${incomingIdentity.name}`);
|
|
910
|
+
if (incomingIdentity.theme)
|
|
911
|
+
sink.log(`Theme: ${incomingIdentity.theme}`);
|
|
912
|
+
if (incomingIdentity.emoji)
|
|
913
|
+
sink.log(`Emoji: ${incomingIdentity.emoji}`);
|
|
914
|
+
if (incomingIdentity.avatar)
|
|
915
|
+
sink.log(`Avatar: ${incomingIdentity.avatar}`);
|
|
916
|
+
if (workspaceDir)
|
|
917
|
+
sink.log(`Workspace: ${shortenHomePath(workspaceDir)}`);
|
|
918
|
+
return 0;
|
|
919
|
+
}
|
|
920
|
+
/* ───────────────────────── 7. agents delete ───────────────────────── */
|
|
921
|
+
/**
|
|
922
|
+
* H6: move-to-trash instead of hard rm. A typo on `agents delete <id>`
|
|
923
|
+
* used to be unrecoverable; we now rename the target into a sibling
|
|
924
|
+
* `.brigade-trash/` and let the operator restore by hand.
|
|
925
|
+
*
|
|
926
|
+
* Trash sits next to the original parent and is capped at 10 entries
|
|
927
|
+
* (oldest first) to keep state-dir from ballooning over time.
|
|
928
|
+
*/
|
|
929
|
+
function safeRm(target, sink) {
|
|
930
|
+
if (!existsSync(target))
|
|
931
|
+
return;
|
|
932
|
+
try {
|
|
933
|
+
const parent = path.dirname(target);
|
|
934
|
+
const trashDir = path.join(parent, ".brigade-trash");
|
|
935
|
+
try {
|
|
936
|
+
mkdirSync(trashDir, { recursive: true });
|
|
937
|
+
}
|
|
938
|
+
catch {
|
|
939
|
+
/* fall through — the rename below will surface a real error */
|
|
940
|
+
}
|
|
941
|
+
const stamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
942
|
+
const moved = path.join(trashDir, `${path.basename(target)}-${stamp}`);
|
|
943
|
+
renameSync(target, moved);
|
|
944
|
+
// Cap the trash at 10 entries: drop the oldest first (lexicographic
|
|
945
|
+
// order matches creation order because we stamp with ISO timestamps).
|
|
946
|
+
try {
|
|
947
|
+
const entries = readdirSync(trashDir)
|
|
948
|
+
.map((name) => ({ name, full: path.join(trashDir, name) }))
|
|
949
|
+
.sort((a, b) => a.name.localeCompare(b.name));
|
|
950
|
+
while (entries.length > 10) {
|
|
951
|
+
const oldest = entries.shift();
|
|
952
|
+
if (oldest) {
|
|
953
|
+
try {
|
|
954
|
+
rmSync(oldest.full, { recursive: true, force: true });
|
|
955
|
+
}
|
|
956
|
+
catch {
|
|
957
|
+
/* best-effort GC */
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
catch {
|
|
963
|
+
/* best-effort GC */
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
catch (err) {
|
|
967
|
+
sink.error(`Warning: failed to move ${shortenHomePath(target)} to trash: ${err instanceof Error ? err.message : String(err)}`);
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
export async function runAgentsDelete(opts) {
|
|
971
|
+
const sink = defaultSink();
|
|
972
|
+
let cfg;
|
|
973
|
+
try {
|
|
974
|
+
cfg = loadConfig();
|
|
975
|
+
}
|
|
976
|
+
catch (err) {
|
|
977
|
+
emitErrorJson(sink, opts, `brigade agents delete: failed to read brigade.json: ${err instanceof Error ? err.message : String(err)}`);
|
|
978
|
+
return 1;
|
|
979
|
+
}
|
|
980
|
+
const input = opts.id?.trim();
|
|
981
|
+
if (!input) {
|
|
982
|
+
emitErrorJson(sink, opts, "Agent id is required.");
|
|
983
|
+
return 1;
|
|
984
|
+
}
|
|
985
|
+
const agentId = normalizeAgentId(input);
|
|
986
|
+
if (agentId !== input)
|
|
987
|
+
sink.log(`Normalized agent id to "${agentId}".`);
|
|
988
|
+
if (agentId === DEFAULT_AGENT_ID) {
|
|
989
|
+
emitErrorJson(sink, opts, `"${DEFAULT_AGENT_ID}" cannot be deleted.`);
|
|
990
|
+
return 1;
|
|
991
|
+
}
|
|
992
|
+
if (findAgentEntryIndex(listAgentEntries(cfg), agentId) < 0) {
|
|
993
|
+
emitErrorJson(sink, opts, `Agent "${agentId}" not found.`);
|
|
994
|
+
return 1;
|
|
995
|
+
}
|
|
996
|
+
if (!opts.force) {
|
|
997
|
+
emitErrorJson(sink, opts, `Refusing to delete agent "${agentId}" without --force. (Interactive confirm ships in a follow-up.)`);
|
|
998
|
+
return 1;
|
|
999
|
+
}
|
|
1000
|
+
// C3: read the configured workspace override BEFORE wiping. The old
|
|
1001
|
+
// code always called resolveAgentWorkspaceDir(agentId) which produces
|
|
1002
|
+
// the default <state>/agents/<id>/workspace path — orphaning any
|
|
1003
|
+
// custom workspace the agent was configured with.
|
|
1004
|
+
const agentsMapRaw = cfg.agents ?? {};
|
|
1005
|
+
const agentEntryRaw = agentsMapRaw[agentId];
|
|
1006
|
+
const configuredWorkspace = agentEntryRaw && typeof agentEntryRaw === "object" && !Array.isArray(agentEntryRaw)
|
|
1007
|
+
? agentEntryRaw.workspace
|
|
1008
|
+
: undefined;
|
|
1009
|
+
const configuredWorkspaceStr = typeof configuredWorkspace === "string" && configuredWorkspace.trim()
|
|
1010
|
+
? configuredWorkspace.trim()
|
|
1011
|
+
: "";
|
|
1012
|
+
const workspaceDir = configuredWorkspaceStr
|
|
1013
|
+
? path.resolve(configuredWorkspaceStr)
|
|
1014
|
+
: resolveAgentWorkspaceDir(agentId);
|
|
1015
|
+
// External-workspace guard: refuse to wipe anything outside the state
|
|
1016
|
+
// dir unless the operator explicitly opts in.
|
|
1017
|
+
const stateDir = path.resolve(resolveStateDir());
|
|
1018
|
+
const isInsideState = (() => {
|
|
1019
|
+
const rel = path.relative(stateDir, workspaceDir);
|
|
1020
|
+
return rel === "" || (!rel.startsWith("..") && !path.isAbsolute(rel));
|
|
1021
|
+
})();
|
|
1022
|
+
if (!isInsideState && !opts.allowExternalWorkspace) {
|
|
1023
|
+
emitErrorJson(sink, opts, `Refusing to remove external workspace ${shortenHomePath(workspaceDir)}. ` +
|
|
1024
|
+
`Re-run with --allow-external-workspace to wipe it.`);
|
|
1025
|
+
return 1;
|
|
1026
|
+
}
|
|
1027
|
+
sink.log(`Workspace target: ${shortenHomePath(workspaceDir)}`);
|
|
1028
|
+
const agentDir = resolveAgentDir(agentId);
|
|
1029
|
+
const sessionsDir = resolveSessionsDir(agentId);
|
|
1030
|
+
const result = pruneAgentConfig(cfg, agentId);
|
|
1031
|
+
saveConfig(result.config);
|
|
1032
|
+
safeRm(workspaceDir, sink);
|
|
1033
|
+
safeRm(agentDir, sink);
|
|
1034
|
+
safeRm(sessionsDir, sink);
|
|
1035
|
+
// Convex mode: the disk rm's above only clear the (mostly empty) local
|
|
1036
|
+
// surface — without this, EVERY backend row of the deleted agent survived
|
|
1037
|
+
// forever: sessions + transcripts, sealed auth profiles, mirrored persona
|
|
1038
|
+
// files, memory facts, and its cron jobs kept firing. Purge per domain via
|
|
1039
|
+
// the store; best-effort per domain so one failure can't strand the whole
|
|
1040
|
+
// delete (the config prune above already made the agent unroutable).
|
|
1041
|
+
const rctx = tryGetRuntimeContext();
|
|
1042
|
+
if (rctx?.mode === "convex") {
|
|
1043
|
+
const purged = await purgeAgentBackendRows(rctx.store, agentId, sink);
|
|
1044
|
+
sink.log(`Backend cleanup: ${purged.sessions} session(s), ${purged.transcripts} transcript(s), ` +
|
|
1045
|
+
`${purged.profiles} auth profile(s), ${purged.personas} persona file(s), ` +
|
|
1046
|
+
`${purged.facts} memory fact(s), ${purged.cronJobs} cron job(s).`);
|
|
1047
|
+
}
|
|
1048
|
+
if (opts.json) {
|
|
1049
|
+
writeJson(sink, {
|
|
1050
|
+
agentId,
|
|
1051
|
+
workspace: workspaceDir,
|
|
1052
|
+
agentDir,
|
|
1053
|
+
sessionsDir,
|
|
1054
|
+
removedBindings: result.removedBindings,
|
|
1055
|
+
removedAllow: result.removedAllow,
|
|
1056
|
+
});
|
|
1057
|
+
}
|
|
1058
|
+
else {
|
|
1059
|
+
sink.log(`Deleted agent: ${agentId}`);
|
|
1060
|
+
if (result.removedBindings > 0)
|
|
1061
|
+
sink.log(`Removed ${result.removedBindings} routing binding(s).`);
|
|
1062
|
+
if (result.removedAllow > 0)
|
|
1063
|
+
sink.log(`Removed ${result.removedAllow} agent-to-agent allow pair(s).`);
|
|
1064
|
+
}
|
|
1065
|
+
return 0;
|
|
1066
|
+
}
|
|
1067
|
+
/** Names the boot mirror + live mirror sync — the set a deleted agent may
|
|
1068
|
+
* have rows for in the personaFiles table. */
|
|
1069
|
+
const PURGE_PERSONA_NAMES = [
|
|
1070
|
+
"AGENTS.md",
|
|
1071
|
+
"SOUL.md",
|
|
1072
|
+
"IDENTITY.md",
|
|
1073
|
+
"USER.md",
|
|
1074
|
+
"TOOLS.md",
|
|
1075
|
+
"BOOTSTRAP.md",
|
|
1076
|
+
"MEMORY.md",
|
|
1077
|
+
"HEARTBEAT.md",
|
|
1078
|
+
];
|
|
1079
|
+
/**
|
|
1080
|
+
* Convex-mode backend cleanup for `agents delete`. Removes the deleted
|
|
1081
|
+
* agent's rows across every per-agent domain the store exposes: sessions
|
|
1082
|
+
* (+ their transcripts), sealed auth profiles, mirrored persona files,
|
|
1083
|
+
* memory facts, and cron jobs pinned to the agent (which otherwise kept
|
|
1084
|
+
* firing forever — pruneAgentConfig only strips bindings + allow pairs).
|
|
1085
|
+
* Also drops the regenerable OS-cache transcript JSONLs. Best-effort per
|
|
1086
|
+
* domain: a failure logs and moves on, never aborts the delete.
|
|
1087
|
+
*/
|
|
1088
|
+
async function purgeAgentBackendRows(store, agentId, sink) {
|
|
1089
|
+
const purged = { sessions: 0, transcripts: 0, profiles: 0, personas: 0, facts: 0, cronJobs: 0 };
|
|
1090
|
+
// Sessions + transcripts.
|
|
1091
|
+
try {
|
|
1092
|
+
const entries = await store.sessions.listEntries(agentId);
|
|
1093
|
+
for (const { sessionKey, entry } of entries) {
|
|
1094
|
+
const sessionId = entry.sessionId;
|
|
1095
|
+
if (typeof sessionId === "string" && sessionId) {
|
|
1096
|
+
try {
|
|
1097
|
+
await store.messages.deleteTranscript(agentId, sessionId);
|
|
1098
|
+
purged.transcripts += 1;
|
|
1099
|
+
}
|
|
1100
|
+
catch {
|
|
1101
|
+
/* per-row best-effort */
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
try {
|
|
1105
|
+
if (await store.sessions.deleteEntry(agentId, sessionKey))
|
|
1106
|
+
purged.sessions += 1;
|
|
1107
|
+
}
|
|
1108
|
+
catch {
|
|
1109
|
+
/* per-row best-effort */
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
catch (err) {
|
|
1114
|
+
sink.log(`Backend cleanup: sessions purge failed — ${err.message}`);
|
|
1115
|
+
}
|
|
1116
|
+
// Sealed auth profiles.
|
|
1117
|
+
try {
|
|
1118
|
+
const profiles = await store.auth.listProfiles(agentId);
|
|
1119
|
+
for (const p of profiles) {
|
|
1120
|
+
const profileId = p.profileId;
|
|
1121
|
+
if (!profileId)
|
|
1122
|
+
continue;
|
|
1123
|
+
try {
|
|
1124
|
+
await store.auth.deleteProfile(agentId, profileId);
|
|
1125
|
+
purged.profiles += 1;
|
|
1126
|
+
}
|
|
1127
|
+
catch {
|
|
1128
|
+
/* per-row best-effort */
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
catch (err) {
|
|
1133
|
+
sink.log(`Backend cleanup: auth purge failed — ${err.message}`);
|
|
1134
|
+
}
|
|
1135
|
+
// Mirrored persona files.
|
|
1136
|
+
for (const name of PURGE_PERSONA_NAMES) {
|
|
1137
|
+
try {
|
|
1138
|
+
if (await store.workspace.deletePersona(agentId, name))
|
|
1139
|
+
purged.personas += 1;
|
|
1140
|
+
}
|
|
1141
|
+
catch {
|
|
1142
|
+
/* per-row best-effort */
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
// Memory facts (workspaceId === agentId for per-agent workspaces).
|
|
1146
|
+
try {
|
|
1147
|
+
const records = await store.memory.listAllFactRecordsRaw(agentId);
|
|
1148
|
+
for (const r of records) {
|
|
1149
|
+
const id = r.id;
|
|
1150
|
+
if (!id)
|
|
1151
|
+
continue;
|
|
1152
|
+
try {
|
|
1153
|
+
await store.memory.deleteFactRecordRaw(agentId, id);
|
|
1154
|
+
purged.facts += 1;
|
|
1155
|
+
}
|
|
1156
|
+
catch {
|
|
1157
|
+
/* per-row best-effort */
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
catch (err) {
|
|
1162
|
+
sink.log(`Backend cleanup: memory purge failed — ${err.message}`);
|
|
1163
|
+
}
|
|
1164
|
+
// Cron jobs pinned to the deleted agent.
|
|
1165
|
+
try {
|
|
1166
|
+
const jobs = await store.cron.listJobs();
|
|
1167
|
+
for (const job of jobs) {
|
|
1168
|
+
if (job.agentId !== agentId)
|
|
1169
|
+
continue;
|
|
1170
|
+
// The store interface types rows as {jobId}; the convex impl's
|
|
1171
|
+
// rebuilt rows carry the internal {id}. Accept either spelling.
|
|
1172
|
+
const raw = job;
|
|
1173
|
+
const jobId = raw.id ?? raw.jobId;
|
|
1174
|
+
if (!jobId)
|
|
1175
|
+
continue;
|
|
1176
|
+
try {
|
|
1177
|
+
if (await store.cron.deleteJob(jobId))
|
|
1178
|
+
purged.cronJobs += 1;
|
|
1179
|
+
}
|
|
1180
|
+
catch {
|
|
1181
|
+
/* per-row best-effort */
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
catch (err) {
|
|
1186
|
+
sink.log(`Backend cleanup: cron purge failed — ${err.message}`);
|
|
1187
|
+
}
|
|
1188
|
+
// Regenerable OS-cache transcripts for this agent.
|
|
1189
|
+
try {
|
|
1190
|
+
const { rm } = await import("node:fs/promises");
|
|
1191
|
+
const { resolveOsCacheDir } = await import("../../config/paths.js");
|
|
1192
|
+
await rm(path.join(resolveOsCacheDir(), "sessions", agentId), { recursive: true, force: true });
|
|
1193
|
+
}
|
|
1194
|
+
catch {
|
|
1195
|
+
/* cache cleanup is cosmetic */
|
|
1196
|
+
}
|
|
1197
|
+
return purged;
|
|
1198
|
+
}
|
|
1199
|
+
//# sourceMappingURL=agents-cmd.js.map
|