@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
package/dist/ui/chat.js
DELETED
|
@@ -1,1008 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Brigade chat TUI.
|
|
3
|
-
*
|
|
4
|
-
* Pi-TUI components, glued to the Pi Agent event stream:
|
|
5
|
-
* - Status header (model · token usage · cost)
|
|
6
|
-
* - Conversation log (Markdown components, one per assistant turn)
|
|
7
|
-
* - Tool call indicators (Text components inserted inline)
|
|
8
|
-
* - Loader (CancellableLoader during agent thinking)
|
|
9
|
-
* - Editor (multi-line input with history)
|
|
10
|
-
* - Footer hint
|
|
11
|
-
*
|
|
12
|
-
* Streaming: each `message_delta` event updates the current Markdown component.
|
|
13
|
-
* Differential rendering means only changed lines repaint — no flicker.
|
|
14
|
-
*/
|
|
15
|
-
import * as path from "node:path";
|
|
16
|
-
import { CancellableLoader, Editor, Input, Markdown, SelectList, Text, } from "@mariozechner/pi-tui";
|
|
17
|
-
import chalk from "chalk";
|
|
18
|
-
import { classifySensitiveStopReason, runWithContentQualityRetry, runWithFallback, runWithHeartbeat, runWithLengthContinuation, runWithStreamTimeout, runWithThinkingFallback, switchModelMidTurn, } from "../core/agent.js";
|
|
19
|
-
import { BRIGADE_DIR, loadConfig, saveConfig } from "../core/config.js";
|
|
20
|
-
import { cleanProviderError, describeModelCapabilities, pickStreamIdleMs } from "../core/model-caps.js";
|
|
21
|
-
import { buildLoginGuidanceMessage, friendlyError, translateAuthError } from "../core/auth-error.js";
|
|
22
|
-
import { discoverOllamaModels, writeOllamaToModelsJson } from "../integrations/ollama.js";
|
|
23
|
-
import { findProvider, PROVIDERS } from "../providers/catalog.js";
|
|
24
|
-
import { validateApiKeyOnline } from "../providers/validate-key.js";
|
|
25
|
-
import { renderBrandHeader } from "./brand.js";
|
|
26
|
-
import { restoreTerminal } from "./terminal-cleanup.js";
|
|
27
|
-
import { brand, editorTheme, markdownTheme, selectListTheme } from "./theme.js";
|
|
28
|
-
const VALID_THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh"];
|
|
29
|
-
export async function runChat(opts) {
|
|
30
|
-
const { session, tui, authStorage, modelRegistry } = opts;
|
|
31
|
-
let provider = opts.provider;
|
|
32
|
-
let modelId = opts.modelId;
|
|
33
|
-
// ── brand wordmark at the top of the chat screen ────────────────────
|
|
34
|
-
// Same chunky 4-stop metallic wordmark from onboarding. Pi-TUI is
|
|
35
|
-
// stream-based, so this appears once at boot and naturally scrolls
|
|
36
|
-
// out of view as the conversation grows below. We render the still
|
|
37
|
-
// (last-frame) variant here — onboarding gets the looping clip as a
|
|
38
|
-
// one-time wow moment, but in chat the looping animation competes
|
|
39
|
-
// with the conversation for attention, so we freeze it at the
|
|
40
|
-
// artist's intended resting pose.
|
|
41
|
-
renderBrandHeader(tui, { animate: false });
|
|
42
|
-
// ── status header (model · tokens · cost) ───────────────────────────
|
|
43
|
-
const header = new Text("", 0, 0);
|
|
44
|
-
tui.addChild(header);
|
|
45
|
-
const divider = new Text(brand.dim("─".repeat(80)), 0, 0);
|
|
46
|
-
tui.addChild(divider);
|
|
47
|
-
// usage state we render in the header
|
|
48
|
-
let totalIn = 0;
|
|
49
|
-
let totalOut = 0;
|
|
50
|
-
let totalCost = 0;
|
|
51
|
-
// Cost is only displayed when the provider reports it. Many free-tier providers
|
|
52
|
-
// (Groq, free Gemini tier, Ollama) don't report usage cost, so we hide the field
|
|
53
|
-
// instead of permanently showing $0.0000 — which would mislead users.
|
|
54
|
-
//
|
|
55
|
-
// Also includes per-model capabilities (thinking level, vision, ctx, $/Mtok)
|
|
56
|
-
// derived from the live `session.model` + `session.thinkingLevel` so it stays
|
|
57
|
-
// accurate across thinking-level changes and (future) model swaps.
|
|
58
|
-
const updateHeader = (extra) => {
|
|
59
|
-
const providerName = findProvider(provider)?.name ?? provider;
|
|
60
|
-
const caps = session.model
|
|
61
|
-
? describeModelCapabilities(session.model, session.thinkingLevel)
|
|
62
|
-
: "";
|
|
63
|
-
const capsStr = caps ? ` · ${caps}` : "";
|
|
64
|
-
const tokens = totalIn + totalOut > 0 ? ` · ${(totalIn + totalOut).toLocaleString()} tok` : "";
|
|
65
|
-
const cost = totalCost > 0 ? ` · $${totalCost.toFixed(4)}` : "";
|
|
66
|
-
// Live context usage. Pi recomputes this after each LLM response, so
|
|
67
|
-
// the percentage stays accurate as the conversation grows. We only
|
|
68
|
-
// show it once it crosses 50% — below that the user doesn't need to
|
|
69
|
-
// worry. Highlights in amber at 75%+ to warn before auto-compact fires.
|
|
70
|
-
const usage = session.getContextUsage();
|
|
71
|
-
let usageStr = "";
|
|
72
|
-
if (usage?.percent != null && usage.percent >= 50) {
|
|
73
|
-
const pct = Math.round(usage.percent);
|
|
74
|
-
const colored = pct >= 75 ? brand.amber(`${pct}% ctx`) : brand.dim(`${pct}% ctx`);
|
|
75
|
-
usageStr = ` · ${colored}`;
|
|
76
|
-
}
|
|
77
|
-
const tail = extra ? ` · ${extra}` : "";
|
|
78
|
-
header.setText(` ${brand.amber("●")} ${brand.white("Brigade")} ${brand.dim(`${providerName} · ${modelId}${capsStr}${tokens}${cost}`)}${usageStr}${brand.dim(tail)}`);
|
|
79
|
-
};
|
|
80
|
-
updateHeader();
|
|
81
|
-
// ── editor ──────────────────────────────────────────────────────────
|
|
82
|
-
const editor = new Editor(tui, editorTheme);
|
|
83
|
-
tui.addChild(editor);
|
|
84
|
-
tui.setFocus(editor);
|
|
85
|
-
// Hint line below the editor
|
|
86
|
-
tui.addChild(new Text(brand.dim(" Enter to send · Ctrl+C abort · Ctrl+D quit · /model /provider /thinking /compact /help"), 0, 0));
|
|
87
|
-
// ── streaming state ─────────────────────────────────────────────────
|
|
88
|
-
let isAgentRunning = false;
|
|
89
|
-
let activeAssistant = null;
|
|
90
|
-
let activeLoader = null;
|
|
91
|
-
let pendingTools = new Map();
|
|
92
|
-
/**
|
|
93
|
-
* Extract concatenated text from an assistant message's content blocks.
|
|
94
|
-
* The cumulative content is what Pi maintains — we read from it instead of
|
|
95
|
-
* trying to stitch deltas ourselves, because not every provider emits
|
|
96
|
-
* `text_delta` events (some only emit `text_start` + `text_end`, and
|
|
97
|
-
* reasoning models intersperse `thinking_*` events). Reading from
|
|
98
|
-
* `event.message.content` is what Pi's own interactive mode does and is
|
|
99
|
-
* the only robust approach across providers.
|
|
100
|
-
*/
|
|
101
|
-
const extractAssistantText = (message) => {
|
|
102
|
-
if (!message || !Array.isArray(message.content))
|
|
103
|
-
return "";
|
|
104
|
-
return message.content
|
|
105
|
-
.filter((b) => b && b.type === "text" && typeof b.text === "string")
|
|
106
|
-
.map((b) => b.text)
|
|
107
|
-
.join("");
|
|
108
|
-
};
|
|
109
|
-
/** Pull text from a user message — used by mid-turn /model switch to replay the last user message on the new model. */
|
|
110
|
-
const extractUserText = (message) => {
|
|
111
|
-
if (!message)
|
|
112
|
-
return "";
|
|
113
|
-
if (typeof message.content === "string")
|
|
114
|
-
return message.content;
|
|
115
|
-
if (!Array.isArray(message.content))
|
|
116
|
-
return "";
|
|
117
|
-
return message.content
|
|
118
|
-
.filter((b) => b && b.type === "text" && typeof b.text === "string")
|
|
119
|
-
.map((b) => b.text)
|
|
120
|
-
.join("");
|
|
121
|
-
};
|
|
122
|
-
const insertBeforeEditor = (component) => {
|
|
123
|
-
// children: [header, divider, ...messages, editor, hint]
|
|
124
|
-
const children = tui.children;
|
|
125
|
-
const editorIdx = children.indexOf(editor);
|
|
126
|
-
if (editorIdx < 0) {
|
|
127
|
-
tui.addChild(component);
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
children.splice(editorIdx, 0, component);
|
|
131
|
-
tui.requestRender();
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
const removeChild = (component) => {
|
|
135
|
-
try {
|
|
136
|
-
tui.removeChild(component);
|
|
137
|
-
}
|
|
138
|
-
catch {
|
|
139
|
-
/* ignore */
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
/**
|
|
143
|
-
* Run an inline picker over the conversation: insert a SelectList right above
|
|
144
|
-
* the editor, steal focus, await a choice, then remove the list and any
|
|
145
|
-
* supporting label rows. Returns the chosen value, or `null` if the user
|
|
146
|
-
* pressed Esc/Ctrl+C. The chat stays scrolled and intact throughout —
|
|
147
|
-
* no clear-screen, no flash.
|
|
148
|
-
*/
|
|
149
|
-
const inlinePick = async (title, items, opts = {}) => {
|
|
150
|
-
const labelRow = new Text(` ${brand.amber(title)}`, 0, 0);
|
|
151
|
-
insertBeforeEditor(labelRow);
|
|
152
|
-
const [minW, maxW] = opts.primaryWidth ?? [22, 38];
|
|
153
|
-
const list = new SelectList(items, Math.min(items.length, 12), selectListTheme, {
|
|
154
|
-
minPrimaryColumnWidth: minW,
|
|
155
|
-
maxPrimaryColumnWidth: maxW,
|
|
156
|
-
});
|
|
157
|
-
insertBeforeEditor(list);
|
|
158
|
-
tui.setFocus(list);
|
|
159
|
-
tui.requestRender();
|
|
160
|
-
try {
|
|
161
|
-
const chosen = await new Promise((resolve, reject) => {
|
|
162
|
-
list.onSelect = (item) => resolve(item);
|
|
163
|
-
list.onCancel = () => reject(new Error("cancel"));
|
|
164
|
-
});
|
|
165
|
-
return chosen._value;
|
|
166
|
-
}
|
|
167
|
-
catch {
|
|
168
|
-
return null;
|
|
169
|
-
}
|
|
170
|
-
finally {
|
|
171
|
-
removeChild(list);
|
|
172
|
-
removeChild(labelRow);
|
|
173
|
-
tui.setFocus(editor);
|
|
174
|
-
tui.requestRender();
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
/**
|
|
178
|
-
* Inline single-line text input — same lifecycle as inlinePick. Used for
|
|
179
|
-
* API-key entry, base-URL prompts, and the like during /provider.
|
|
180
|
-
* Returns the typed value, or `null` if the user pressed Esc.
|
|
181
|
-
*/
|
|
182
|
-
const inlinePrompt = async (label, hint) => {
|
|
183
|
-
const labelRow = new Text(` ${brand.amber(label)}`, 0, 0);
|
|
184
|
-
insertBeforeEditor(labelRow);
|
|
185
|
-
const hintRow = hint ? new Text(brand.dim(` ${hint}`), 0, 0) : null;
|
|
186
|
-
if (hintRow)
|
|
187
|
-
insertBeforeEditor(hintRow);
|
|
188
|
-
const input = new Input();
|
|
189
|
-
insertBeforeEditor(input);
|
|
190
|
-
tui.setFocus(input);
|
|
191
|
-
tui.requestRender();
|
|
192
|
-
try {
|
|
193
|
-
return await new Promise((resolve, reject) => {
|
|
194
|
-
input.onSubmit = (value) => resolve(value.trim());
|
|
195
|
-
input.onEscape = () => reject(new Error("cancel"));
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
catch {
|
|
199
|
-
return null;
|
|
200
|
-
}
|
|
201
|
-
finally {
|
|
202
|
-
removeChild(input);
|
|
203
|
-
if (hintRow)
|
|
204
|
-
removeChild(hintRow);
|
|
205
|
-
removeChild(labelRow);
|
|
206
|
-
tui.setFocus(editor);
|
|
207
|
-
tui.requestRender();
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
/**
|
|
211
|
-
* Switch to a new (provider, modelId) pair. Resolves the model object via
|
|
212
|
-
* ModelRegistry, calls Pi's setModel (which validates auth + persists to
|
|
213
|
-
* session), and updates Brigade's local state + saved config so the next
|
|
214
|
-
* boot resumes here. Returns whether the switch succeeded.
|
|
215
|
-
*/
|
|
216
|
-
const switchToModel = async (newProvider, newModelId) => {
|
|
217
|
-
const model = modelRegistry.find(newProvider, newModelId);
|
|
218
|
-
if (!model) {
|
|
219
|
-
insertBeforeEditor(new Text(` ${brand.error("✗")} ${brand.error(`No model "${newModelId}" found for provider "${newProvider}".`)}`, 0, 0));
|
|
220
|
-
return false;
|
|
221
|
-
}
|
|
222
|
-
try {
|
|
223
|
-
await session.setModel(model);
|
|
224
|
-
}
|
|
225
|
-
catch (err) {
|
|
226
|
-
const raw = err instanceof Error ? err.message : String(err);
|
|
227
|
-
const friendly = friendlyError(raw, cleanProviderError);
|
|
228
|
-
insertBeforeEditor(new Text(` ${brand.error("✗")} ${brand.error(friendly)}`, 0, 0));
|
|
229
|
-
return false;
|
|
230
|
-
}
|
|
231
|
-
provider = newProvider;
|
|
232
|
-
modelId = newModelId;
|
|
233
|
-
await saveConfig({ defaultProvider: newProvider, defaultModelId: newModelId });
|
|
234
|
-
updateHeader();
|
|
235
|
-
insertBeforeEditor(new Text(` ${brand.amber("✓")} ${brand.dim("switched to")} ${brand.white(`${newProvider} · ${newModelId}`)}`, 0, 0));
|
|
236
|
-
return true;
|
|
237
|
-
};
|
|
238
|
-
// ── replay: print prior conversation if resumed ────────────────────
|
|
239
|
-
for (const m of session.messages) {
|
|
240
|
-
if (m.role === "user" && Array.isArray(m.content)) {
|
|
241
|
-
const text = m.content
|
|
242
|
-
.filter((b) => b.type === "text")
|
|
243
|
-
.map((b) => b.text)
|
|
244
|
-
.join("");
|
|
245
|
-
if (text) {
|
|
246
|
-
insertBeforeEditor(new Markdown(`${brand.user("you")} ${text}`, 1, 0, markdownTheme));
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
else if (m.role === "assistant" && Array.isArray(m.content)) {
|
|
250
|
-
const text = m.content
|
|
251
|
-
.filter((b) => b.type === "text")
|
|
252
|
-
.map((b) => b.text)
|
|
253
|
-
.join("");
|
|
254
|
-
if (text) {
|
|
255
|
-
insertBeforeEditor(new Markdown(`${brand.agent("brigade")} ${text}`, 1, 0, markdownTheme));
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
// ── subscribe to Pi events ─────────────────────────────────────────
|
|
260
|
-
session.subscribe((event) => {
|
|
261
|
-
switch (event.type) {
|
|
262
|
-
case "agent_start": {
|
|
263
|
-
isAgentRunning = true;
|
|
264
|
-
editor.disableSubmit = true;
|
|
265
|
-
updateHeader("thinking…");
|
|
266
|
-
activeLoader = new CancellableLoader(tui, (s) => brand.amber(s), (s) => brand.dim(s), "thinking");
|
|
267
|
-
insertBeforeEditor(activeLoader);
|
|
268
|
-
break;
|
|
269
|
-
}
|
|
270
|
-
case "message_update": {
|
|
271
|
-
// Pull text from the cumulative message — works for every provider
|
|
272
|
-
// regardless of whether they emit text_delta, text_end, or just
|
|
273
|
-
// the final message all at once. This is the same pattern Pi's
|
|
274
|
-
// own interactive mode uses.
|
|
275
|
-
const msg = event.message;
|
|
276
|
-
if (!msg || msg.role !== "assistant")
|
|
277
|
-
break;
|
|
278
|
-
const text = extractAssistantText(msg);
|
|
279
|
-
if (!text)
|
|
280
|
-
break; // tool calls / thinking blocks only — nothing to render yet
|
|
281
|
-
if (activeLoader) {
|
|
282
|
-
removeChild(activeLoader);
|
|
283
|
-
activeLoader = null;
|
|
284
|
-
}
|
|
285
|
-
if (!activeAssistant) {
|
|
286
|
-
activeAssistant = new Markdown(`${brand.agent("brigade")} ${text}`, 1, 0, markdownTheme);
|
|
287
|
-
insertBeforeEditor(activeAssistant);
|
|
288
|
-
}
|
|
289
|
-
else {
|
|
290
|
-
activeAssistant.setText(`${brand.agent("brigade")} ${text}`);
|
|
291
|
-
tui.requestRender();
|
|
292
|
-
}
|
|
293
|
-
break;
|
|
294
|
-
}
|
|
295
|
-
case "message_end": {
|
|
296
|
-
// Final safety net: some providers don't stream incrementally —
|
|
297
|
-
// they only emit message_end with the full message. If we never
|
|
298
|
-
// rendered any text from message_update, render it now.
|
|
299
|
-
const msg = event.message;
|
|
300
|
-
if (!msg || msg.role !== "assistant")
|
|
301
|
-
break;
|
|
302
|
-
const text = extractAssistantText(msg);
|
|
303
|
-
if (!text)
|
|
304
|
-
break;
|
|
305
|
-
if (activeLoader) {
|
|
306
|
-
removeChild(activeLoader);
|
|
307
|
-
activeLoader = null;
|
|
308
|
-
}
|
|
309
|
-
if (!activeAssistant) {
|
|
310
|
-
activeAssistant = new Markdown(`${brand.agent("brigade")} ${text}`, 1, 0, markdownTheme);
|
|
311
|
-
insertBeforeEditor(activeAssistant);
|
|
312
|
-
}
|
|
313
|
-
else {
|
|
314
|
-
activeAssistant.setText(`${brand.agent("brigade")} ${text}`);
|
|
315
|
-
tui.requestRender();
|
|
316
|
-
}
|
|
317
|
-
break;
|
|
318
|
-
}
|
|
319
|
-
case "tool_execution_start": {
|
|
320
|
-
if (activeLoader) {
|
|
321
|
-
removeChild(activeLoader);
|
|
322
|
-
activeLoader = null;
|
|
323
|
-
}
|
|
324
|
-
const summary = formatToolArgs(event.toolName, event.args);
|
|
325
|
-
const indicator = new Text(` ${brand.tool("⚡")} ${brand.tool(event.toolName)} ${brand.dim(summary)}`, 0, 0);
|
|
326
|
-
pendingTools.set(event.toolCallId, indicator);
|
|
327
|
-
insertBeforeEditor(indicator);
|
|
328
|
-
break;
|
|
329
|
-
}
|
|
330
|
-
case "tool_execution_end": {
|
|
331
|
-
const indicator = pendingTools.get(event.toolCallId);
|
|
332
|
-
if (indicator) {
|
|
333
|
-
const mark = event.isError ? brand.error("✗") : brand.tool("✓");
|
|
334
|
-
indicator.setText(` ${mark} ${brand.tool(event.toolName)}`);
|
|
335
|
-
tui.requestRender();
|
|
336
|
-
pendingTools.delete(event.toolCallId);
|
|
337
|
-
}
|
|
338
|
-
break;
|
|
339
|
-
}
|
|
340
|
-
case "turn_end": {
|
|
341
|
-
const usage = event.message?.usage;
|
|
342
|
-
if (usage) {
|
|
343
|
-
totalIn += usage.input ?? 0;
|
|
344
|
-
totalOut += usage.output ?? 0;
|
|
345
|
-
totalCost += usage.cost ?? 0;
|
|
346
|
-
updateHeader();
|
|
347
|
-
}
|
|
348
|
-
break;
|
|
349
|
-
}
|
|
350
|
-
case "compaction_start": {
|
|
351
|
-
// Pi auto-compacts when context fills. Surface it so the user
|
|
352
|
-
// understands the brief pause + the assistant message that
|
|
353
|
-
// follows comes from a fresh summary.
|
|
354
|
-
const usage = session.getContextUsage();
|
|
355
|
-
const pct = usage?.percent != null ? `${Math.round(usage.percent)}%` : "high";
|
|
356
|
-
insertBeforeEditor(new Text(` ${brand.dim(`⚡ compacting context (was ${pct})…`)}`, 0, 0));
|
|
357
|
-
break;
|
|
358
|
-
}
|
|
359
|
-
case "compaction_end": {
|
|
360
|
-
const ev = event;
|
|
361
|
-
if (ev.aborted) {
|
|
362
|
-
insertBeforeEditor(new Text(` ${brand.dim("compaction aborted")}`, 0, 0));
|
|
363
|
-
}
|
|
364
|
-
else {
|
|
365
|
-
// Pi's getContextUsage returns null right after compaction by
|
|
366
|
-
// design — token estimates need a fresh LLM response to
|
|
367
|
-
// recalculate. Show that explicitly instead of a confusing "?".
|
|
368
|
-
const after = session.getContextUsage();
|
|
369
|
-
const afterStr = after?.percent != null
|
|
370
|
-
? `usage now ${Math.round(after.percent)}%`
|
|
371
|
-
: "usage refreshes after your next message";
|
|
372
|
-
insertBeforeEditor(new Text(` ${brand.amber("✓")} ${brand.dim(`compacted · ${afterStr}`)}`, 0, 0));
|
|
373
|
-
}
|
|
374
|
-
updateHeader();
|
|
375
|
-
break;
|
|
376
|
-
}
|
|
377
|
-
case "agent_end": {
|
|
378
|
-
isAgentRunning = false;
|
|
379
|
-
editor.disableSubmit = false;
|
|
380
|
-
activeAssistant = null;
|
|
381
|
-
if (activeLoader) {
|
|
382
|
-
removeChild(activeLoader);
|
|
383
|
-
activeLoader = null;
|
|
384
|
-
}
|
|
385
|
-
// Last-resort safety net: if no text was ever rendered (no message_update,
|
|
386
|
-
// no message_end), surface the final message text or any error message
|
|
387
|
-
// from the agent end event. Without this, a bad request leaves the user
|
|
388
|
-
// staring at "thinking…" gone-but-no-reply. Provider errors arrive as
|
|
389
|
-
// nested JSON blobs (Pi wraps the upstream response) — cleanProviderError
|
|
390
|
-
// peels them down to a single human-readable line.
|
|
391
|
-
const messages = event.messages;
|
|
392
|
-
if (Array.isArray(messages) && messages.length > 0) {
|
|
393
|
-
const last = messages[messages.length - 1];
|
|
394
|
-
if (last && last.role === "assistant") {
|
|
395
|
-
const text = extractAssistantText(last);
|
|
396
|
-
const errMsg = last.errorMessage;
|
|
397
|
-
// Sensitive stop reasons (refusal, content filter, policy block)
|
|
398
|
-
// produce empty content with a meaningful stopReason. Translate
|
|
399
|
-
// to a friendly message — without this the user sees nothing.
|
|
400
|
-
const sensitive = !text ? classifySensitiveStopReason(last) : null;
|
|
401
|
-
if (!text && errMsg) {
|
|
402
|
-
// Pi's auth-resolution failures arrive with `/login` (a Pi command
|
|
403
|
-
// Brigade doesn't have) and raw `node_modules/.../docs/...` paths
|
|
404
|
-
// embedded — both are Brigade-UX violations. friendlyError() runs
|
|
405
|
-
// translateAuthError first (which carries no `✗` prefix because
|
|
406
|
-
// it includes its own `⚠`), then falls back to cleanProviderError
|
|
407
|
-
// for non-auth provider errors (with `✗` prefix).
|
|
408
|
-
const translated = translateAuthError(errMsg);
|
|
409
|
-
if (translated) {
|
|
410
|
-
insertBeforeEditor(new Text(` ${brand.error(translated)}`, 0, 0));
|
|
411
|
-
}
|
|
412
|
-
else {
|
|
413
|
-
const cleaned = cleanProviderError(errMsg);
|
|
414
|
-
insertBeforeEditor(new Text(` ${brand.error("✗")} ${brand.error(cleaned)}`, 0, 0));
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
else if (sensitive) {
|
|
418
|
-
insertBeforeEditor(new Text(` ${brand.error("✗")} ${brand.error(sensitive.userMessage)}`, 0, 0));
|
|
419
|
-
}
|
|
420
|
-
else if (!text && (last.stopReason === "error" || last.stopReason === "aborted")) {
|
|
421
|
-
insertBeforeEditor(new Text(` ${brand.error("✗")} ${brand.error(`Agent ended with no reply (${last.stopReason})`)}`, 0, 0));
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
updateHeader();
|
|
426
|
-
break;
|
|
427
|
-
}
|
|
428
|
-
case "auto_retry_start": {
|
|
429
|
-
// Pi auto-retries transient provider errors (rate limit, 5xx,
|
|
430
|
-
// connection drop). Tell the user it's happening — without this,
|
|
431
|
-
// a slow retry looks like the model is just hanging.
|
|
432
|
-
const ev = event;
|
|
433
|
-
const attempt = ev.attempt ?? 1;
|
|
434
|
-
const max = ev.maxAttempts ?? 1;
|
|
435
|
-
const waitS = Math.round((ev.delayMs ?? 0) / 100) / 10;
|
|
436
|
-
insertBeforeEditor(new Text(` ${brand.dim(`↻ retrying (attempt ${attempt}/${max}, waiting ${waitS}s)…`)}`, 0, 0));
|
|
437
|
-
break;
|
|
438
|
-
}
|
|
439
|
-
case "auto_retry_end": {
|
|
440
|
-
const ev = event;
|
|
441
|
-
if (ev.success === false) {
|
|
442
|
-
insertBeforeEditor(new Text(` ${brand.error("✗")} ${brand.error(`gave up after ${ev.attempt} attempts`)}`, 0, 0));
|
|
443
|
-
}
|
|
444
|
-
break;
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
});
|
|
448
|
-
// ── input handling ─────────────────────────────────────────────────
|
|
449
|
-
editor.onSubmit = async (value) => {
|
|
450
|
-
const trimmed = value.trim();
|
|
451
|
-
if (!trimmed)
|
|
452
|
-
return;
|
|
453
|
-
// Mid-turn submit → STEER, not drop. Pi queues the message and the
|
|
454
|
-
// model sees it after the current tool round completes — no abort,
|
|
455
|
-
// no lost context. This is what "steer" means at the loop level and
|
|
456
|
-
// it's a key part of a production-grade chat UX.
|
|
457
|
-
if (isAgentRunning) {
|
|
458
|
-
// Slash commands during a turn are still handled locally — they
|
|
459
|
-
// shouldn't reach the model. (This block intentionally mirrors the
|
|
460
|
-
// post-loop set; if a new local command lands below, mirror it here.)
|
|
461
|
-
if (trimmed === "/exit" || trimmed === "/quit") {
|
|
462
|
-
tui.stop();
|
|
463
|
-
restoreTerminal();
|
|
464
|
-
process.exit(0);
|
|
465
|
-
}
|
|
466
|
-
// /model <id> mid-turn → live model switch. Aborts the current
|
|
467
|
-
// turn cleanly, swaps the model, re-prompts with the user's
|
|
468
|
-
// original message. Hot-swap UX; way better than "abort, wait,
|
|
469
|
-
// /model, retype".
|
|
470
|
-
if (trimmed.startsWith("/model ")) {
|
|
471
|
-
editor.setText("");
|
|
472
|
-
const targetId = trimmed.slice("/model ".length).trim();
|
|
473
|
-
const matches = modelRegistry.getAvailable().filter((m) => m.id === targetId);
|
|
474
|
-
const target = matches.find((m) => m.provider === provider) ?? matches[0];
|
|
475
|
-
if (!target) {
|
|
476
|
-
insertBeforeEditor(new Text(` ${brand.error(`✗ no configured model with id "${targetId}". Type /model to list.`)}`, 0, 0));
|
|
477
|
-
return;
|
|
478
|
-
}
|
|
479
|
-
// Find the most recent user message to replay on the new model.
|
|
480
|
-
const lastUser = [...session.messages].reverse().find((m) => m.role === "user");
|
|
481
|
-
const replayMsg = lastUser ? extractUserText(lastUser) : "";
|
|
482
|
-
if (!replayMsg) {
|
|
483
|
-
insertBeforeEditor(new Text(` ${brand.error("✗ no user message to replay on the new model.")}`, 0, 0));
|
|
484
|
-
return;
|
|
485
|
-
}
|
|
486
|
-
insertBeforeEditor(new Text(` ${brand.dim(`↻ aborting current turn, switching to ${targetId}, re-running…`)}`, 0, 0));
|
|
487
|
-
try {
|
|
488
|
-
const swapped = await switchModelMidTurn(session, target, replayMsg);
|
|
489
|
-
if (!swapped) {
|
|
490
|
-
// Turn ended between our `isAgentRunning` check and switchModelMidTurn —
|
|
491
|
-
// the in-flight signal had already cleared. Fall back to a normal
|
|
492
|
-
// post-turn switch using the same code path the post-turn /model uses.
|
|
493
|
-
await switchToModel(target.provider, target.id);
|
|
494
|
-
return;
|
|
495
|
-
}
|
|
496
|
-
provider = target.provider;
|
|
497
|
-
modelId = target.id;
|
|
498
|
-
await saveConfig({ defaultProvider: provider, defaultModelId: modelId });
|
|
499
|
-
updateHeader();
|
|
500
|
-
}
|
|
501
|
-
catch (err) {
|
|
502
|
-
const raw = err instanceof Error ? err.message : String(err);
|
|
503
|
-
const friendly = friendlyError(raw, cleanProviderError);
|
|
504
|
-
insertBeforeEditor(new Text(` ${brand.error("✗")} ${brand.error(`Switch failed: ${friendly}`)}`, 0, 0));
|
|
505
|
-
}
|
|
506
|
-
return;
|
|
507
|
-
}
|
|
508
|
-
editor.setText("");
|
|
509
|
-
session.agent.steer({
|
|
510
|
-
role: "user",
|
|
511
|
-
content: [{ type: "text", text: trimmed }],
|
|
512
|
-
});
|
|
513
|
-
insertBeforeEditor(new Markdown(`${brand.user("you")} ${trimmed}`, 1, 0, markdownTheme));
|
|
514
|
-
insertBeforeEditor(new Text(` ${brand.dim("↳ queued — the model will see this on its next turn")}`, 0, 0));
|
|
515
|
-
return;
|
|
516
|
-
}
|
|
517
|
-
// slash commands (handled locally, never sent to the model)
|
|
518
|
-
if (trimmed === "/exit" || trimmed === "/quit") {
|
|
519
|
-
tui.stop();
|
|
520
|
-
restoreTerminal();
|
|
521
|
-
process.exit(0);
|
|
522
|
-
}
|
|
523
|
-
if (trimmed === "/clear") {
|
|
524
|
-
editor.setText("");
|
|
525
|
-
return;
|
|
526
|
-
}
|
|
527
|
-
if (trimmed === "/help") {
|
|
528
|
-
insertBeforeEditor(new Markdown(`${brand.dim("commands")}\n` +
|
|
529
|
-
`- ${chalk.bold("/exit")} or ${chalk.bold("/quit")} — quit Brigade\n` +
|
|
530
|
-
`- ${chalk.bold("/help")} — this list\n` +
|
|
531
|
-
`- ${chalk.bold("/clear")} — clear the input\n` +
|
|
532
|
-
`- ${chalk.bold("/model")} — switch to another configured model\n` +
|
|
533
|
-
`- ${chalk.bold("/model <id>")} — switch directly by model id\n` +
|
|
534
|
-
`- ${chalk.bold("/provider")} — add a new provider mid-session\n` +
|
|
535
|
-
`- ${chalk.bold("/thinking <level>")} — set reasoning effort (off|minimal|low|medium|high|xhigh)\n` +
|
|
536
|
-
`- ${chalk.bold("/compact")} — summarize older turns to free up context\n` +
|
|
537
|
-
`- ${chalk.bold("Ctrl+C")} — abort the current turn\n` +
|
|
538
|
-
`- ${chalk.bold("Ctrl+D")} — quit`, 1, 0, markdownTheme));
|
|
539
|
-
editor.setText("");
|
|
540
|
-
return;
|
|
541
|
-
}
|
|
542
|
-
// `/login` is a Pi slash command — Brigade doesn't have one. Pi's
|
|
543
|
-
// auth-error text tells users to type `/login`, so users WILL try it.
|
|
544
|
-
// Translate the attempt into Brigade's actual flow rather than
|
|
545
|
-
// silently sending `/login` to the model as a user message.
|
|
546
|
-
if (trimmed === "/login" || trimmed === "/auth" || trimmed === "/onboard") {
|
|
547
|
-
editor.setText("");
|
|
548
|
-
insertBeforeEditor(new Text(` ${brand.error(buildLoginGuidanceMessage())}`, 0, 0));
|
|
549
|
-
return;
|
|
550
|
-
}
|
|
551
|
-
// /compact — manually trigger Pi's compaction. Auto-compaction runs in
|
|
552
|
-
// the background at high context usage; this lets the user trigger it
|
|
553
|
-
// on demand (or summarize early before a long task).
|
|
554
|
-
if (trimmed === "/compact") {
|
|
555
|
-
editor.setText("");
|
|
556
|
-
const usage = session.getContextUsage();
|
|
557
|
-
if (usage?.percent != null) {
|
|
558
|
-
insertBeforeEditor(new Text(` ${brand.dim(`Compacting (current usage ${Math.round(usage.percent)}%)…`)}`, 0, 0));
|
|
559
|
-
}
|
|
560
|
-
else {
|
|
561
|
-
insertBeforeEditor(new Text(` ${brand.dim("Compacting…")}`, 0, 0));
|
|
562
|
-
}
|
|
563
|
-
try {
|
|
564
|
-
const result = await session.compact();
|
|
565
|
-
// getContextUsage returns null right after compaction (Pi: token
|
|
566
|
-
// estimate needs a fresh LLM response). Show that explicitly.
|
|
567
|
-
const after = session.getContextUsage();
|
|
568
|
-
const afterStr = after?.percent != null
|
|
569
|
-
? `usage now ${Math.round(after.percent)}%`
|
|
570
|
-
: "usage refreshes after your next message";
|
|
571
|
-
const before = result?.tokensBefore ? `${(result.tokensBefore / 1000).toFixed(1)}k` : "?";
|
|
572
|
-
insertBeforeEditor(new Text(` ${brand.amber("✓")} ${brand.dim(`Compacted ${before} of older context · ${afterStr}`)}`, 0, 0));
|
|
573
|
-
updateHeader();
|
|
574
|
-
}
|
|
575
|
-
catch (err) {
|
|
576
|
-
const raw = err instanceof Error ? err.message : String(err);
|
|
577
|
-
const friendly = friendlyError(raw, cleanProviderError);
|
|
578
|
-
insertBeforeEditor(new Text(` ${brand.error("✗")} ${brand.error(`Compaction failed: ${friendly}`)}`, 0, 0));
|
|
579
|
-
}
|
|
580
|
-
return;
|
|
581
|
-
}
|
|
582
|
-
// /model — list/switch already-configured models. Without args, opens an
|
|
583
|
-
// inline picker over every model with auth set. With args, switches directly
|
|
584
|
-
// (matches by id; if multiple providers expose the same id, prefers the
|
|
585
|
-
// current provider, otherwise the first match).
|
|
586
|
-
if (trimmed === "/model" || trimmed.startsWith("/model ")) {
|
|
587
|
-
editor.setText("");
|
|
588
|
-
const available = modelRegistry.getAvailable();
|
|
589
|
-
if (available.length === 0) {
|
|
590
|
-
insertBeforeEditor(new Text(` ${brand.error("✗ no configured models — try /provider to add one.")}`, 0, 0));
|
|
591
|
-
return;
|
|
592
|
-
}
|
|
593
|
-
const arg = trimmed === "/model" ? "" : trimmed.slice("/model ".length).trim();
|
|
594
|
-
if (arg) {
|
|
595
|
-
// Direct switch by id. Prefer current provider on tie.
|
|
596
|
-
const matches = available.filter((m) => m.id === arg);
|
|
597
|
-
const target = matches.find((m) => m.provider === provider) ?? matches[0];
|
|
598
|
-
if (!target) {
|
|
599
|
-
insertBeforeEditor(new Text(` ${brand.error(`✗ no configured model with id "${arg}".`)} ${brand.dim(`Run /model to see the list.`)}`, 0, 0));
|
|
600
|
-
return;
|
|
601
|
-
}
|
|
602
|
-
await switchToModel(target.provider, target.id);
|
|
603
|
-
return;
|
|
604
|
-
}
|
|
605
|
-
// Inline picker. Sort by current-provider-first, then reasoning, then ctx.
|
|
606
|
-
const sorted = [...available].sort((a, b) => {
|
|
607
|
-
if (a.provider !== b.provider) {
|
|
608
|
-
if (a.provider === provider)
|
|
609
|
-
return -1;
|
|
610
|
-
if (b.provider === provider)
|
|
611
|
-
return 1;
|
|
612
|
-
return a.provider.localeCompare(b.provider);
|
|
613
|
-
}
|
|
614
|
-
if (!!a.reasoning !== !!b.reasoning)
|
|
615
|
-
return a.reasoning ? -1 : 1;
|
|
616
|
-
return (b.contextWindow ?? 0) - (a.contextWindow ?? 0);
|
|
617
|
-
});
|
|
618
|
-
const items = sorted.map((m) => ({
|
|
619
|
-
value: `${m.provider}::${m.id}`,
|
|
620
|
-
label: `${m.id}${m.id === modelId && m.provider === provider ? brand.amber(" (current)") : ""}`,
|
|
621
|
-
description: `${findProvider(m.provider)?.name ?? m.provider} · ${describeModelCapabilities(m)}`,
|
|
622
|
-
_value: { p: m.provider, id: m.id },
|
|
623
|
-
}));
|
|
624
|
-
const picked = await inlinePick("Switch model", items, { primaryWidth: [22, 38] });
|
|
625
|
-
if (!picked)
|
|
626
|
-
return;
|
|
627
|
-
if (picked.p === provider && picked.id === modelId) {
|
|
628
|
-
insertBeforeEditor(new Text(` ${brand.dim("already on that model.")}`, 0, 0));
|
|
629
|
-
return;
|
|
630
|
-
}
|
|
631
|
-
await switchToModel(picked.p, picked.id);
|
|
632
|
-
return;
|
|
633
|
-
}
|
|
634
|
-
// /provider — add a new provider mid-session. Picks the unconfigured ones,
|
|
635
|
-
// runs the same key-entry / Ollama-discovery code as onboarding, and (on
|
|
636
|
-
// success) auto-switches to the first model from that provider.
|
|
637
|
-
if (trimmed === "/provider") {
|
|
638
|
-
editor.setText("");
|
|
639
|
-
// Show only providers we don't already have credentials/registration for.
|
|
640
|
-
const configuredProviders = new Set(modelRegistry.getAvailable().map((m) => m.provider));
|
|
641
|
-
const candidates = PROVIDERS.filter((p) => !configuredProviders.has(p.id));
|
|
642
|
-
// Track whether this add results in 2+ providers being configured —
|
|
643
|
-
// drives the "all providers stay configured · use /model to switch"
|
|
644
|
-
// reassurance line shown after a successful add. Captured BEFORE the
|
|
645
|
-
// add so we know the prior count.
|
|
646
|
-
const willBeMultiProvider = configuredProviders.size >= 1;
|
|
647
|
-
const renderMultiProviderTip = () => {
|
|
648
|
-
if (!willBeMultiProvider)
|
|
649
|
-
return;
|
|
650
|
-
insertBeforeEditor(new Text(` ${brand.dim("All your providers stay configured · use /model to switch any time · saved across restarts.")}`, 0, 0));
|
|
651
|
-
};
|
|
652
|
-
if (candidates.length === 0) {
|
|
653
|
-
insertBeforeEditor(new Text(` ${brand.dim("all curated providers are already configured. Use /model to switch.")}`, 0, 0));
|
|
654
|
-
return;
|
|
655
|
-
}
|
|
656
|
-
const items = candidates.map((p) => ({
|
|
657
|
-
value: p.id,
|
|
658
|
-
label: p.name,
|
|
659
|
-
description: p.description,
|
|
660
|
-
_value: p,
|
|
661
|
-
}));
|
|
662
|
-
const picked = await inlinePick("Add a provider", items, { primaryWidth: [18, 22] });
|
|
663
|
-
if (!picked)
|
|
664
|
-
return;
|
|
665
|
-
// Three paths now:
|
|
666
|
-
// - custom: user supplies provider id + baseUrl + apiKey + a model id
|
|
667
|
-
// - local (ollama): discover models via /api/tags
|
|
668
|
-
// - remote: just collect API key + use Pi's catalog
|
|
669
|
-
if (picked.custom) {
|
|
670
|
-
const providerId = await inlinePrompt("Give this connection a short name", "Lowercase letters and dashes only — for example: together, fireworks, on-prem.");
|
|
671
|
-
if (!providerId)
|
|
672
|
-
return;
|
|
673
|
-
if (!/^[a-z][a-z0-9_-]*$/.test(providerId)) {
|
|
674
|
-
insertBeforeEditor(new Text(` ${brand.error("✗ Use lowercase letters, numbers, and dashes only.")}`, 0, 0));
|
|
675
|
-
return;
|
|
676
|
-
}
|
|
677
|
-
const baseUrl = await inlinePrompt("Endpoint URL", "The OpenAI-compatible URL — for example: https://api.together.xyz/v1");
|
|
678
|
-
if (!baseUrl)
|
|
679
|
-
return;
|
|
680
|
-
if (!/^https?:\/\//i.test(baseUrl)) {
|
|
681
|
-
insertBeforeEditor(new Text(` ${brand.error("✗ The URL should start with https:// or http://.")}`, 0, 0));
|
|
682
|
-
return;
|
|
683
|
-
}
|
|
684
|
-
const apiKey = await inlinePrompt("API key", "Type \"none\" if your endpoint doesn't require one.");
|
|
685
|
-
if (!apiKey)
|
|
686
|
-
return;
|
|
687
|
-
const oneModelId = await inlinePrompt("Model name", "Pick the model you'd like to use first — for example: meta-llama/Llama-3.3-70B-Instruct-Turbo");
|
|
688
|
-
if (!oneModelId)
|
|
689
|
-
return;
|
|
690
|
-
// Confirmation step — show the user a summary of what we're about
|
|
691
|
-
// to save before we write anything. Catches typos in the URL or
|
|
692
|
-
// model id before they cause failed requests later.
|
|
693
|
-
const maskedKey = apiKey.length > 8
|
|
694
|
-
? `${apiKey.slice(0, 4)}…${apiKey.slice(-4)}`
|
|
695
|
-
: apiKey === "none"
|
|
696
|
-
? "none"
|
|
697
|
-
: "(hidden)";
|
|
698
|
-
insertBeforeEditor(new Text(` ${brand.amber("Review:")}`, 0, 0));
|
|
699
|
-
insertBeforeEditor(new Text(` ${brand.dim("Name:")} ${brand.white(providerId)}`, 0, 0));
|
|
700
|
-
insertBeforeEditor(new Text(` ${brand.dim("Endpoint:")} ${brand.white(baseUrl)}`, 0, 0));
|
|
701
|
-
insertBeforeEditor(new Text(` ${brand.dim("API key:")} ${brand.white(maskedKey)}`, 0, 0));
|
|
702
|
-
insertBeforeEditor(new Text(` ${brand.dim("Model:")} ${brand.white(oneModelId)}`, 0, 0));
|
|
703
|
-
const confirmed = await inlinePick("Save this connection?", [
|
|
704
|
-
{ value: "save", label: "Yes, save and switch", description: "Adds this connection and switches to it now", _value: true },
|
|
705
|
-
{ value: "cancel", label: "No, cancel", description: "Discard everything you typed", _value: false },
|
|
706
|
-
], { primaryWidth: [22, 28] });
|
|
707
|
-
if (!confirmed) {
|
|
708
|
-
insertBeforeEditor(new Text(` ${brand.dim("Cancelled — nothing was saved.")}`, 0, 0));
|
|
709
|
-
return;
|
|
710
|
-
}
|
|
711
|
-
// Write the custom provider into models.json. We write a single model
|
|
712
|
-
// with conservative defaults; the user can extend the entry by hand
|
|
713
|
-
// for additional models. Reasoning is heuristic — set true if the id
|
|
714
|
-
// hints at a reasoning model.
|
|
715
|
-
const guessReasoning = /o[13]\b/i.test(oneModelId) || /r1\b/i.test(oneModelId) || /think/i.test(oneModelId) || /qwen[23]/i.test(oneModelId);
|
|
716
|
-
const fs = await import("node:fs/promises");
|
|
717
|
-
const modelsPath = path.join(BRIGADE_DIR, "models.json");
|
|
718
|
-
let existing = { providers: {} };
|
|
719
|
-
try {
|
|
720
|
-
existing = JSON.parse(await fs.readFile(modelsPath, "utf8"));
|
|
721
|
-
if (!existing.providers)
|
|
722
|
-
existing.providers = {};
|
|
723
|
-
}
|
|
724
|
-
catch {
|
|
725
|
-
/* file missing — start fresh */
|
|
726
|
-
}
|
|
727
|
-
existing.providers[providerId] = {
|
|
728
|
-
baseUrl: baseUrl.replace(/\/$/, ""),
|
|
729
|
-
api: "openai-completions",
|
|
730
|
-
apiKey,
|
|
731
|
-
models: [
|
|
732
|
-
{
|
|
733
|
-
id: oneModelId,
|
|
734
|
-
name: oneModelId,
|
|
735
|
-
reasoning: guessReasoning,
|
|
736
|
-
input: ["text"],
|
|
737
|
-
contextWindow: 32_768,
|
|
738
|
-
maxTokens: 8_192,
|
|
739
|
-
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
740
|
-
},
|
|
741
|
-
],
|
|
742
|
-
};
|
|
743
|
-
try {
|
|
744
|
-
await fs.writeFile(modelsPath, JSON.stringify(existing, null, 2), "utf8");
|
|
745
|
-
modelRegistry.refresh();
|
|
746
|
-
}
|
|
747
|
-
catch (err) {
|
|
748
|
-
insertBeforeEditor(new Text(` ${brand.error("✗")} ${brand.error(`Couldn't save the connection: ${err instanceof Error ? err.message : String(err)}`)}`, 0, 0));
|
|
749
|
-
return;
|
|
750
|
-
}
|
|
751
|
-
insertBeforeEditor(new Text(` ${brand.amber("✓")} ${brand.dim(`Connected ${providerId} · switching to ${oneModelId}…`)}`, 0, 0));
|
|
752
|
-
renderMultiProviderTip();
|
|
753
|
-
await switchToModel(providerId, oneModelId);
|
|
754
|
-
return;
|
|
755
|
-
}
|
|
756
|
-
if (picked.local && picked.id === "ollama") {
|
|
757
|
-
const baseUrl = picked.baseUrl ?? "http://localhost:11434";
|
|
758
|
-
insertBeforeEditor(new Text(` ${brand.dim("Scanning Ollama…")}`, 0, 0));
|
|
759
|
-
let discovered;
|
|
760
|
-
try {
|
|
761
|
-
discovered = await discoverOllamaModels(baseUrl);
|
|
762
|
-
}
|
|
763
|
-
catch (err) {
|
|
764
|
-
insertBeforeEditor(new Text(` ${brand.error("✗")} ${brand.error(err instanceof Error ? err.message : String(err))}`, 0, 0));
|
|
765
|
-
return;
|
|
766
|
-
}
|
|
767
|
-
try {
|
|
768
|
-
await writeOllamaToModelsJson(path.join(BRIGADE_DIR, "models.json"), baseUrl, discovered);
|
|
769
|
-
modelRegistry.refresh();
|
|
770
|
-
}
|
|
771
|
-
catch (err) {
|
|
772
|
-
insertBeforeEditor(new Text(` ${brand.error("✗")} ${brand.error(`Couldn't save the connection: ${err instanceof Error ? err.message : String(err)}`)}`, 0, 0));
|
|
773
|
-
return;
|
|
774
|
-
}
|
|
775
|
-
insertBeforeEditor(new Text(` ${brand.amber("✓")} ${brand.dim(`Ollama connected · ${discovered.length} model${discovered.length === 1 ? "" : "s"} ready. Switching…`)}`, 0, 0));
|
|
776
|
-
renderMultiProviderTip();
|
|
777
|
-
// Auto-switch to the first discovered model.
|
|
778
|
-
if (discovered[0])
|
|
779
|
-
await switchToModel("ollama", discovered[0].id);
|
|
780
|
-
return;
|
|
781
|
-
}
|
|
782
|
-
// Remote provider — collect API key inline, validate, save.
|
|
783
|
-
const key = await inlinePrompt(`Paste your ${picked.name} API key`, `We'll keep it private to this device. Need a key? ${picked.keyUrl}`);
|
|
784
|
-
if (!key)
|
|
785
|
-
return;
|
|
786
|
-
if (key.length < 16 || /\s/.test(key)) {
|
|
787
|
-
insertBeforeEditor(new Text(` ${brand.error("✗ That doesn't look right — try copying the key again.")}`, 0, 0));
|
|
788
|
-
return;
|
|
789
|
-
}
|
|
790
|
-
const validating = new CancellableLoader(tui, (s) => brand.amber(s), (s) => brand.dim(s), `Connecting to ${picked.name}…`);
|
|
791
|
-
insertBeforeEditor(validating);
|
|
792
|
-
const onlineCheck = await validateApiKeyOnline(picked.id, key);
|
|
793
|
-
removeChild(validating);
|
|
794
|
-
if (!onlineCheck.ok) {
|
|
795
|
-
insertBeforeEditor(new Text(` ${brand.error("✗")} ${brand.error(onlineCheck.reason)}`, 0, 0));
|
|
796
|
-
return;
|
|
797
|
-
}
|
|
798
|
-
authStorage.set(picked.id, { type: "api_key", key });
|
|
799
|
-
authStorage.reload();
|
|
800
|
-
modelRegistry.refresh();
|
|
801
|
-
// Auto-switch to a sensible default model from the new provider —
|
|
802
|
-
// reasoning-first, then largest context window.
|
|
803
|
-
const newModels = modelRegistry.getAvailable().filter((m) => m.provider === picked.id);
|
|
804
|
-
if (newModels.length === 0) {
|
|
805
|
-
insertBeforeEditor(new Text(` ${brand.amber("✓")} ${brand.dim(`${picked.name} connected, but no models are available right now. Try /model later.`)}`, 0, 0));
|
|
806
|
-
renderMultiProviderTip();
|
|
807
|
-
return;
|
|
808
|
-
}
|
|
809
|
-
const sorted = [...newModels].sort((a, b) => {
|
|
810
|
-
if (!!a.reasoning !== !!b.reasoning)
|
|
811
|
-
return a.reasoning ? -1 : 1;
|
|
812
|
-
return (b.contextWindow ?? 0) - (a.contextWindow ?? 0);
|
|
813
|
-
});
|
|
814
|
-
insertBeforeEditor(new Text(` ${brand.amber("✓")} ${brand.dim(`${picked.name} connected · switching to ${sorted[0].id}…`)}`, 0, 0));
|
|
815
|
-
renderMultiProviderTip();
|
|
816
|
-
await switchToModel(picked.id, sorted[0].id);
|
|
817
|
-
return;
|
|
818
|
-
}
|
|
819
|
-
// /thinking [level] — reads or sets the model's reasoning effort.
|
|
820
|
-
// Pi clamps to model capabilities (e.g. "off" gets coerced for non-reasoning
|
|
821
|
-
// models), so we can pass through the user's choice and let Pi decide what's
|
|
822
|
-
// actually applicable. Without args, reports current state + valid options.
|
|
823
|
-
if (trimmed === "/thinking" || trimmed.startsWith("/thinking ")) {
|
|
824
|
-
editor.setText("");
|
|
825
|
-
if (!session.supportsThinking()) {
|
|
826
|
-
insertBeforeEditor(new Text(` ${brand.dim(`This model (${modelId}) does not support thinking — nothing to set.`)}`, 0, 0));
|
|
827
|
-
return;
|
|
828
|
-
}
|
|
829
|
-
const arg = trimmed === "/thinking" ? "" : trimmed.slice("/thinking ".length).trim().toLowerCase();
|
|
830
|
-
const available = session.getAvailableThinkingLevels();
|
|
831
|
-
if (!arg) {
|
|
832
|
-
insertBeforeEditor(new Text(` ${brand.dim("thinking is")} ${brand.amber(session.thinkingLevel)} ${brand.dim("· available:")} ${brand.dim(available.join(" "))}`, 0, 0));
|
|
833
|
-
return;
|
|
834
|
-
}
|
|
835
|
-
if (!VALID_THINKING_LEVELS.includes(arg)) {
|
|
836
|
-
insertBeforeEditor(new Text(` ${brand.error(`✗ unknown level "${arg}".`)} ${brand.dim(`Try one of: ${available.join(", ")}`)}`, 0, 0));
|
|
837
|
-
return;
|
|
838
|
-
}
|
|
839
|
-
if (!available.includes(arg)) {
|
|
840
|
-
insertBeforeEditor(new Text(` ${brand.error(`✗ "${arg}" is not supported on ${modelId}.`)} ${brand.dim(`Available: ${available.join(", ")}`)}`, 0, 0));
|
|
841
|
-
return;
|
|
842
|
-
}
|
|
843
|
-
session.setThinkingLevel(arg);
|
|
844
|
-
updateHeader();
|
|
845
|
-
insertBeforeEditor(new Text(` ${brand.amber("✓")} ${brand.dim("thinking set to")} ${brand.amber(arg)}`, 0, 0));
|
|
846
|
-
return;
|
|
847
|
-
}
|
|
848
|
-
// echo user message
|
|
849
|
-
insertBeforeEditor(new Markdown(`${brand.user("you")} ${trimmed}`, 1, 0, markdownTheme));
|
|
850
|
-
editor.setText("");
|
|
851
|
-
try {
|
|
852
|
-
// Build the fallback chain from config. We accept ONE fallback in
|
|
853
|
-
// BrigadeConfig today; future versions can extend to an array.
|
|
854
|
-
const cfg = await loadConfig();
|
|
855
|
-
const fallbackModel = cfg.fallbackProvider && cfg.fallbackModelId
|
|
856
|
-
? modelRegistry.find(cfg.fallbackProvider, cfg.fallbackModelId)
|
|
857
|
-
: undefined;
|
|
858
|
-
// Compose the loop wrappers from the inside out:
|
|
859
|
-
// 1. session.prompt() — Pi's actual loop
|
|
860
|
-
// 2. runWithStreamTimeout() — aborts if the loop goes silent for 60s
|
|
861
|
-
// 3. runWithFallback() — on hard error, walks the fallback chain
|
|
862
|
-
// Order matters: timeout wraps the prompt INSIDE fallback, so each
|
|
863
|
-
// fallback attempt gets its own fresh 60s watcher.
|
|
864
|
-
await runWithFallback(session, trimmed, {
|
|
865
|
-
fallbacks: fallbackModel ? [{ model: fallbackModel }] : [],
|
|
866
|
-
// Per-attempt wrappers. Composition (outer → inner):
|
|
867
|
-
// 1. runWithHeartbeat — every 30s of silence, show "still
|
|
868
|
-
// working… Ns elapsed" so the user
|
|
869
|
-
// knows we're alive (esp. local 30B
|
|
870
|
-
// models that take minutes per turn)
|
|
871
|
-
// 2. runWithStreamTimeout — abort after per-provider idle threshold
|
|
872
|
-
// (60s cloud / 5min Ollama)
|
|
873
|
-
// 3. runWithContentQualityRetry — re-prompt with a steer if the model
|
|
874
|
-
// returned empty / reasoning-only /
|
|
875
|
-
// planning-only output
|
|
876
|
-
// 4. runWithThinkingFallback — auto-downgrade thinking on rejection
|
|
877
|
-
// 5. session.prompt — Pi's actual loop
|
|
878
|
-
wrapAttempt: (promptFn) => runWithHeartbeat(session, () => runWithStreamTimeout(session, () => runWithLengthContinuation(session, () => runWithContentQualityRetry(session, () => runWithThinkingFallback(session, promptFn, {
|
|
879
|
-
onDowngrade: (originalLevel) => {
|
|
880
|
-
insertBeforeEditor(new Text(` ${brand.dim(`This model doesn't support thinking — switching from ${originalLevel} to off and retrying…`)}`, 0, 0));
|
|
881
|
-
},
|
|
882
|
-
}), {
|
|
883
|
-
onRetry: (reason) => {
|
|
884
|
-
const label = reason === "empty"
|
|
885
|
-
? "no visible answer — re-prompting"
|
|
886
|
-
: reason === "reasoning-only"
|
|
887
|
-
? "model emitted only reasoning — asking for visible answer"
|
|
888
|
-
: "model described an action but didn't take it — asking it to actually do it";
|
|
889
|
-
insertBeforeEditor(new Text(` ${brand.dim(`↻ ${label}…`)}`, 0, 0));
|
|
890
|
-
},
|
|
891
|
-
}), {
|
|
892
|
-
onContinue: () => {
|
|
893
|
-
insertBeforeEditor(new Text(` ${brand.dim("↻ reply was truncated — asking the model to continue…")}`, 0, 0));
|
|
894
|
-
},
|
|
895
|
-
}), {
|
|
896
|
-
// Per-provider timeout. Cloud non-reasoning: 60s; cloud
|
|
897
|
-
// reasoning: 180s; Ollama: 5min; custom: 3min.
|
|
898
|
-
idleMs: session.model ? pickStreamIdleMs(session.model) : 60_000,
|
|
899
|
-
onTimeout: (ms) => {
|
|
900
|
-
insertBeforeEditor(new Text(` ${brand.dim(`⏳ no response for ${Math.round(ms / 1000)}s — aborting…`)}`, 0, 0));
|
|
901
|
-
},
|
|
902
|
-
}), {
|
|
903
|
-
intervalMs: 30_000,
|
|
904
|
-
onHeartbeat: (ms) => {
|
|
905
|
-
const sec = Math.round(ms / 1000);
|
|
906
|
-
insertBeforeEditor(new Text(` ${brand.dim(`still working… ${sec}s elapsed`)}`, 0, 0));
|
|
907
|
-
},
|
|
908
|
-
}),
|
|
909
|
-
onFallback: (reason) => {
|
|
910
|
-
insertBeforeEditor(new Text(` ${brand.dim(`↻ primary failed (${friendlyError(reason, cleanProviderError)}) — trying ${cfg.fallbackModelId}…`)}`, 0, 0));
|
|
911
|
-
},
|
|
912
|
-
onFallbackExhausted: (reason) => {
|
|
913
|
-
insertBeforeEditor(new Text(` ${brand.error("✗ all fallback models failed:")} ${brand.error(friendlyError(reason, cleanProviderError))}`, 0, 0));
|
|
914
|
-
},
|
|
915
|
-
});
|
|
916
|
-
}
|
|
917
|
-
catch (err) {
|
|
918
|
-
// Provider errors arrive here when the request itself throws (vs being
|
|
919
|
-
// captured into an assistant message and surfaced via agent_end). They're
|
|
920
|
-
// often nested-JSON blobs — clean them before showing.
|
|
921
|
-
//
|
|
922
|
-
// We reset isAgentRunning + disableSubmit defensively because some error
|
|
923
|
-
// paths fire BEFORE `agent_start` (e.g. sync auth-resolver failures), so
|
|
924
|
-
// the `agent_end` event handler never runs. Re-assigning false when it's
|
|
925
|
-
// already false is a no-op, so this is safe even when agent_end did fire.
|
|
926
|
-
const raw = err instanceof Error ? err.message : String(err);
|
|
927
|
-
const msg = friendlyError(raw, cleanProviderError);
|
|
928
|
-
insertBeforeEditor(new Text(` ${brand.error("✗")} ${brand.error(msg)}`, 0, 0));
|
|
929
|
-
isAgentRunning = false;
|
|
930
|
-
editor.disableSubmit = false;
|
|
931
|
-
updateHeader();
|
|
932
|
-
}
|
|
933
|
-
};
|
|
934
|
-
// NOTE: tui.start() is called once in index.ts BEFORE splash + onboarding,
|
|
935
|
-
// so the renderer is already alive by the time we get here. Don't start twice.
|
|
936
|
-
// Likewise, the SIGINT handler is wired ONCE at the top level (index.ts) and
|
|
937
|
-
// delegates here via the returned ChatHandle — preventing handler stacking.
|
|
938
|
-
tui.requestRender();
|
|
939
|
-
// Optional first-run kickoff. Caller (post-onboard chat boot) passes
|
|
940
|
-
// `kickoffMessage` only when the workspace is truly fresh (BOOTSTRAP.md
|
|
941
|
-
// just seeded), so the agent reads BOOTSTRAP.md from its system prompt
|
|
942
|
-
// and opens the "who am I, who are you?" name-discovery conversation
|
|
943
|
-
// instead of sitting silently waiting for the user to type first.
|
|
944
|
-
//
|
|
945
|
-
// We dispatch through `editor.onSubmit` (the same surface a real Enter
|
|
946
|
-
// keypress hits) instead of calling `session.prompt` directly, so the
|
|
947
|
-
// turn flows through every wrapper (timeout, heartbeat, fallback chain,
|
|
948
|
-
// content-quality retry, …) just like a user-typed turn would. The
|
|
949
|
-
// kickoff message also renders as a normal "you" bubble in the
|
|
950
|
-
// conversation log, keeping the UI honest about what was sent.
|
|
951
|
-
//
|
|
952
|
-
// Fire-and-forget on a microtask so we return the ChatHandle promptly —
|
|
953
|
-
// the caller can wire SIGINT against the handle while the kickoff turn
|
|
954
|
-
// is still streaming.
|
|
955
|
-
const kickoff = opts.kickoffMessage?.trim();
|
|
956
|
-
if (kickoff && editor.onSubmit) {
|
|
957
|
-
const dispatchKickoff = editor.onSubmit;
|
|
958
|
-
queueMicrotask(() => {
|
|
959
|
-
void dispatchKickoff(kickoff);
|
|
960
|
-
});
|
|
961
|
-
}
|
|
962
|
-
// First-run discoverability tip. Only shown on a truly fresh workspace
|
|
963
|
-
// (same signal that gates the kickoff) so returning users don't see it
|
|
964
|
-
// every boot. The slash command list mirrors the editor footer hint,
|
|
965
|
-
// minus /help itself (we tell them how to find /help so they can read
|
|
966
|
-
// the full list).
|
|
967
|
-
if (opts.firstRun) {
|
|
968
|
-
insertBeforeEditor(new Text(` ${brand.dim("tip: type /help for slash commands (/model · /provider · /thinking · /compact)")}`, 0, 0));
|
|
969
|
-
}
|
|
970
|
-
return {
|
|
971
|
-
abort: () => {
|
|
972
|
-
if (!isAgentRunning)
|
|
973
|
-
return false;
|
|
974
|
-
session.abort().catch(() => { });
|
|
975
|
-
isAgentRunning = false;
|
|
976
|
-
editor.disableSubmit = false;
|
|
977
|
-
if (activeLoader) {
|
|
978
|
-
removeChild(activeLoader);
|
|
979
|
-
activeLoader = null;
|
|
980
|
-
}
|
|
981
|
-
insertBeforeEditor(new Text(` ${brand.error("✗")} ${brand.dim("aborted")}`, 0, 0));
|
|
982
|
-
updateHeader();
|
|
983
|
-
return true;
|
|
984
|
-
},
|
|
985
|
-
isRunning: () => isAgentRunning,
|
|
986
|
-
};
|
|
987
|
-
}
|
|
988
|
-
/* ────────────────────────────── helpers ──────────────────────────────── */
|
|
989
|
-
function formatToolArgs(name, args) {
|
|
990
|
-
if (!args || typeof args !== "object")
|
|
991
|
-
return "";
|
|
992
|
-
if (args.path)
|
|
993
|
-
return String(args.path);
|
|
994
|
-
if (args.command)
|
|
995
|
-
return String(args.command).slice(0, 60);
|
|
996
|
-
if (args.pattern)
|
|
997
|
-
return String(args.pattern);
|
|
998
|
-
if (args.query)
|
|
999
|
-
return `"${String(args.query)}"`;
|
|
1000
|
-
const keys = Object.keys(args);
|
|
1001
|
-
if (keys.length === 0)
|
|
1002
|
-
return "";
|
|
1003
|
-
return keys
|
|
1004
|
-
.slice(0, 2)
|
|
1005
|
-
.map((k) => `${k}=${JSON.stringify(args[k]).slice(0, 30)}`)
|
|
1006
|
-
.join(" ");
|
|
1007
|
-
}
|
|
1008
|
-
//# sourceMappingURL=chat.js.map
|