@spinabot/brigade 0.1.2 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +748 -88
- package/brigade.mjs +150 -73
- package/dist/agents/a2a-policy-canonicalize.d.ts +60 -0
- package/dist/agents/a2a-policy-canonicalize.d.ts.map +1 -0
- package/dist/agents/a2a-policy-canonicalize.js +103 -0
- package/dist/agents/a2a-policy-canonicalize.js.map +1 -0
- package/dist/agents/agent-event-bus.d.ts +221 -0
- package/dist/agents/agent-event-bus.d.ts.map +1 -0
- package/dist/agents/agent-event-bus.js +88 -0
- package/dist/agents/agent-event-bus.js.map +1 -0
- package/dist/agents/agent-events.d.ts +84 -0
- package/dist/agents/agent-events.d.ts.map +1 -0
- package/dist/agents/agent-events.js +309 -0
- package/dist/agents/agent-events.js.map +1 -0
- package/dist/agents/agent-events.types.d.ts +139 -0
- package/dist/agents/agent-events.types.d.ts.map +1 -0
- package/dist/agents/agent-events.types.js +27 -0
- package/dist/agents/agent-events.types.js.map +1 -0
- package/dist/agents/agent-loop.d.ts +145 -0
- package/dist/agents/agent-loop.d.ts.map +1 -0
- package/dist/agents/agent-loop.js +1938 -0
- package/dist/agents/agent-loop.js.map +1 -0
- package/dist/agents/agent-scope.d.ts +28 -0
- package/dist/agents/agent-scope.d.ts.map +1 -0
- package/dist/agents/agent-scope.js +39 -0
- package/dist/agents/agent-scope.js.map +1 -0
- package/dist/agents/approval-bridge.d.ts +139 -0
- package/dist/agents/approval-bridge.d.ts.map +1 -0
- package/dist/agents/approval-bridge.js +178 -0
- package/dist/agents/approval-bridge.js.map +1 -0
- package/dist/agents/carrow.d.ts +49 -0
- package/dist/agents/carrow.d.ts.map +1 -0
- package/dist/agents/carrow.js +57 -0
- package/dist/agents/carrow.js.map +1 -0
- package/dist/agents/channels/abort-triggers.d.ts +17 -0
- package/dist/agents/channels/abort-triggers.d.ts.map +1 -0
- package/dist/agents/channels/abort-triggers.js +52 -0
- package/dist/agents/channels/abort-triggers.js.map +1 -0
- package/dist/agents/channels/access-control/index.d.ts +5 -0
- package/dist/agents/channels/access-control/index.d.ts.map +1 -0
- package/dist/agents/channels/access-control/index.js +4 -0
- package/dist/agents/channels/access-control/index.js.map +1 -0
- package/dist/agents/channels/access-control/policy.d.ts +69 -0
- package/dist/agents/channels/access-control/policy.d.ts.map +1 -0
- package/dist/agents/channels/access-control/policy.js +123 -0
- package/dist/agents/channels/access-control/policy.js.map +1 -0
- package/dist/agents/channels/access-control/store.d.ts +86 -0
- package/dist/agents/channels/access-control/store.d.ts.map +1 -0
- package/dist/agents/channels/access-control/store.js +482 -0
- package/dist/agents/channels/access-control/store.js.map +1 -0
- package/dist/agents/channels/access-control/types.d.ts +52 -0
- package/dist/agents/channels/access-control/types.d.ts.map +1 -0
- package/dist/agents/channels/access-control/types.js +20 -0
- package/dist/agents/channels/access-control/types.js.map +1 -0
- package/dist/agents/channels/active-manager.d.ts +31 -0
- package/dist/agents/channels/active-manager.d.ts.map +1 -0
- package/dist/agents/channels/active-manager.js +41 -0
- package/dist/agents/channels/active-manager.js.map +1 -0
- package/dist/agents/channels/agent-switch-command.d.ts +53 -0
- package/dist/agents/channels/agent-switch-command.d.ts.map +1 -0
- package/dist/agents/channels/agent-switch-command.js +349 -0
- package/dist/agents/channels/agent-switch-command.js.map +1 -0
- package/dist/agents/channels/approval-router.d.ts +158 -0
- package/dist/agents/channels/approval-router.d.ts.map +1 -0
- package/dist/agents/channels/approval-router.js +446 -0
- package/dist/agents/channels/approval-router.js.map +1 -0
- package/dist/agents/channels/channel-entry-contract.d.ts +70 -0
- package/dist/agents/channels/channel-entry-contract.d.ts.map +1 -0
- package/dist/agents/channels/channel-entry-contract.js +48 -0
- package/dist/agents/channels/channel-entry-contract.js.map +1 -0
- package/dist/agents/channels/channel-plugin-manager.d.ts +86 -0
- package/dist/agents/channels/channel-plugin-manager.d.ts.map +1 -0
- package/dist/agents/channels/channel-plugin-manager.js +345 -0
- package/dist/agents/channels/channel-plugin-manager.js.map +1 -0
- package/dist/agents/channels/chat-type.d.ts +27 -0
- package/dist/agents/channels/chat-type.d.ts.map +1 -0
- package/dist/agents/channels/chat-type.js +33 -0
- package/dist/agents/channels/chat-type.js.map +1 -0
- package/dist/agents/channels/dedupe.d.ts +44 -0
- package/dist/agents/channels/dedupe.d.ts.map +1 -0
- package/dist/agents/channels/dedupe.js +80 -0
- package/dist/agents/channels/dedupe.js.map +1 -0
- package/dist/agents/channels/inbound-pipeline.d.ts +90 -0
- package/dist/agents/channels/inbound-pipeline.d.ts.map +1 -0
- package/dist/agents/channels/inbound-pipeline.js +721 -0
- package/dist/agents/channels/inbound-pipeline.js.map +1 -0
- package/dist/agents/channels/last-channel.d.ts +56 -0
- package/dist/agents/channels/last-channel.d.ts.map +1 -0
- package/dist/agents/channels/last-channel.js +65 -0
- package/dist/agents/channels/last-channel.js.map +1 -0
- package/dist/agents/channels/manager.d.ts +76 -0
- package/dist/agents/channels/manager.d.ts.map +1 -0
- package/dist/agents/channels/manager.js +132 -0
- package/dist/agents/channels/manager.js.map +1 -0
- package/dist/agents/channels/media-capture.d.ts +23 -0
- package/dist/agents/channels/media-capture.d.ts.map +1 -0
- package/dist/agents/channels/media-capture.js +40 -0
- package/dist/agents/channels/media-capture.js.map +1 -0
- package/dist/agents/channels/plugin-channel-manager-facade.d.ts +18 -0
- package/dist/agents/channels/plugin-channel-manager-facade.d.ts.map +1 -0
- package/dist/agents/channels/plugin-channel-manager-facade.js +52 -0
- package/dist/agents/channels/plugin-channel-manager-facade.js.map +1 -0
- package/dist/agents/channels/reply-sanitizer.d.ts +38 -0
- package/dist/agents/channels/reply-sanitizer.d.ts.map +1 -0
- package/dist/agents/channels/reply-sanitizer.js +94 -0
- package/dist/agents/channels/reply-sanitizer.js.map +1 -0
- package/dist/agents/channels/retryable-inbound.d.ts +31 -0
- package/dist/agents/channels/retryable-inbound.d.ts.map +1 -0
- package/dist/agents/channels/retryable-inbound.js +37 -0
- package/dist/agents/channels/retryable-inbound.js.map +1 -0
- package/dist/agents/channels/types.adapters.d.ts +399 -0
- package/dist/agents/channels/types.adapters.d.ts.map +1 -0
- package/dist/agents/channels/types.adapters.js +33 -0
- package/dist/agents/channels/types.adapters.js.map +1 -0
- package/dist/agents/channels/types.core.d.ts +134 -0
- package/dist/agents/channels/types.core.d.ts.map +1 -0
- package/dist/agents/channels/types.core.js +32 -0
- package/dist/agents/channels/types.core.js.map +1 -0
- package/dist/agents/channels/types.plugin.d.ts +78 -0
- package/dist/agents/channels/types.plugin.d.ts.map +1 -0
- package/dist/agents/channels/types.plugin.js +30 -0
- package/dist/agents/channels/types.plugin.js.map +1 -0
- package/dist/agents/channels/whatsapp/account-config.d.ts +50 -0
- package/dist/agents/channels/whatsapp/account-config.d.ts.map +1 -0
- package/dist/agents/channels/whatsapp/account-config.js +105 -0
- package/dist/agents/channels/whatsapp/account-config.js.map +1 -0
- package/dist/agents/channels/whatsapp/adapter.d.ts +22 -0
- package/dist/agents/channels/whatsapp/adapter.d.ts.map +1 -0
- package/dist/agents/channels/whatsapp/adapter.js +270 -0
- package/dist/agents/channels/whatsapp/adapter.js.map +1 -0
- package/dist/agents/channels/whatsapp/chunk.d.ts +26 -0
- package/dist/agents/channels/whatsapp/chunk.d.ts.map +1 -0
- package/dist/agents/channels/whatsapp/chunk.js +123 -0
- package/dist/agents/channels/whatsapp/chunk.js.map +1 -0
- package/dist/agents/channels/whatsapp/connection.d.ts +249 -0
- package/dist/agents/channels/whatsapp/connection.d.ts.map +1 -0
- package/dist/agents/channels/whatsapp/connection.js +1628 -0
- package/dist/agents/channels/whatsapp/connection.js.map +1 -0
- package/dist/agents/channels/whatsapp/convex-auth-state.d.ts +34 -0
- package/dist/agents/channels/whatsapp/convex-auth-state.d.ts.map +1 -0
- package/dist/agents/channels/whatsapp/convex-auth-state.js +168 -0
- package/dist/agents/channels/whatsapp/convex-auth-state.js.map +1 -0
- package/dist/agents/channels/whatsapp/format.d.ts +15 -0
- package/dist/agents/channels/whatsapp/format.d.ts.map +1 -0
- package/dist/agents/channels/whatsapp/format.js +66 -0
- package/dist/agents/channels/whatsapp/format.js.map +1 -0
- package/dist/agents/channels/whatsapp/inbound-extras.d.ts +30 -0
- package/dist/agents/channels/whatsapp/inbound-extras.d.ts.map +1 -0
- package/dist/agents/channels/whatsapp/inbound-extras.js +146 -0
- package/dist/agents/channels/whatsapp/inbound-extras.js.map +1 -0
- package/dist/agents/channels/whatsapp/index.d.ts +7 -0
- package/dist/agents/channels/whatsapp/index.d.ts.map +1 -0
- package/dist/agents/channels/whatsapp/index.js +7 -0
- package/dist/agents/channels/whatsapp/index.js.map +1 -0
- package/dist/agents/channels/whatsapp/media.d.ts +47 -0
- package/dist/agents/channels/whatsapp/media.d.ts.map +1 -0
- package/dist/agents/channels/whatsapp/media.js +192 -0
- package/dist/agents/channels/whatsapp/media.js.map +1 -0
- package/dist/agents/channels/whatsapp/module.d.ts +10 -0
- package/dist/agents/channels/whatsapp/module.d.ts.map +1 -0
- package/dist/agents/channels/whatsapp/module.js +17 -0
- package/dist/agents/channels/whatsapp/module.js.map +1 -0
- package/dist/agents/channels/whatsapp/plugin.d.ts +60 -0
- package/dist/agents/channels/whatsapp/plugin.d.ts.map +1 -0
- package/dist/agents/channels/whatsapp/plugin.js +238 -0
- package/dist/agents/channels/whatsapp/plugin.js.map +1 -0
- package/dist/agents/cmd-ism-guard.d.ts +47 -0
- package/dist/agents/cmd-ism-guard.d.ts.map +1 -0
- package/dist/agents/cmd-ism-guard.js +100 -0
- package/dist/agents/cmd-ism-guard.js.map +1 -0
- package/dist/agents/config-write-guard.d.ts +25 -0
- package/dist/agents/config-write-guard.d.ts.map +1 -0
- package/dist/agents/config-write-guard.js +95 -0
- package/dist/agents/config-write-guard.js.map +1 -0
- package/dist/agents/content-quality-retry.d.ts +66 -0
- package/dist/agents/content-quality-retry.d.ts.map +1 -0
- package/dist/agents/content-quality-retry.js +140 -0
- package/dist/agents/content-quality-retry.js.map +1 -0
- package/dist/agents/error-classifier.d.ts +89 -0
- package/dist/agents/error-classifier.d.ts.map +1 -0
- package/dist/agents/error-classifier.js +630 -0
- package/dist/agents/error-classifier.js.map +1 -0
- package/dist/agents/exec-gate.d.ts +113 -0
- package/dist/agents/exec-gate.d.ts.map +1 -0
- package/dist/agents/exec-gate.js +335 -0
- package/dist/agents/exec-gate.js.map +1 -0
- package/dist/agents/exec-session-allow.d.ts +30 -0
- package/dist/agents/exec-session-allow.d.ts.map +1 -0
- package/dist/agents/exec-session-allow.js +50 -0
- package/dist/agents/exec-session-allow.js.map +1 -0
- package/dist/agents/extensions/active-registry.d.ts +4 -0
- package/dist/agents/extensions/active-registry.d.ts.map +1 -0
- package/dist/agents/extensions/active-registry.js +18 -0
- package/dist/agents/extensions/active-registry.js.map +1 -0
- package/dist/agents/extensions/discovery.d.ts +84 -0
- package/dist/agents/extensions/discovery.d.ts.map +1 -0
- package/dist/agents/extensions/discovery.js +249 -0
- package/dist/agents/extensions/discovery.js.map +1 -0
- package/dist/agents/extensions/hook-runner.d.ts +67 -0
- package/dist/agents/extensions/hook-runner.d.ts.map +1 -0
- package/dist/agents/extensions/hook-runner.js +155 -0
- package/dist/agents/extensions/hook-runner.js.map +1 -0
- package/dist/agents/extensions/index.d.ts +15 -0
- package/dist/agents/extensions/index.d.ts.map +1 -0
- package/dist/agents/extensions/index.js +14 -0
- package/dist/agents/extensions/index.js.map +1 -0
- package/dist/agents/extensions/loader.d.ts +38 -0
- package/dist/agents/extensions/loader.d.ts.map +1 -0
- package/dist/agents/extensions/loader.js +142 -0
- package/dist/agents/extensions/loader.js.map +1 -0
- package/dist/agents/extensions/modules/arxiv.d.ts +28 -0
- package/dist/agents/extensions/modules/arxiv.d.ts.map +1 -0
- package/dist/agents/extensions/modules/arxiv.js +145 -0
- package/dist/agents/extensions/modules/arxiv.js.map +1 -0
- package/dist/agents/extensions/modules/brave.d.ts +28 -0
- package/dist/agents/extensions/modules/brave.d.ts.map +1 -0
- package/dist/agents/extensions/modules/brave.js +489 -0
- package/dist/agents/extensions/modules/brave.js.map +1 -0
- package/dist/agents/extensions/modules/duckduckgo.d.ts +27 -0
- package/dist/agents/extensions/modules/duckduckgo.d.ts.map +1 -0
- package/dist/agents/extensions/modules/duckduckgo.js +263 -0
- package/dist/agents/extensions/modules/duckduckgo.js.map +1 -0
- package/dist/agents/extensions/modules/exa.d.ts +19 -0
- package/dist/agents/extensions/modules/exa.d.ts.map +1 -0
- package/dist/agents/extensions/modules/exa.js +208 -0
- package/dist/agents/extensions/modules/exa.js.map +1 -0
- package/dist/agents/extensions/modules/firecrawl.d.ts +51 -0
- package/dist/agents/extensions/modules/firecrawl.d.ts.map +1 -0
- package/dist/agents/extensions/modules/firecrawl.js +280 -0
- package/dist/agents/extensions/modules/firecrawl.js.map +1 -0
- package/dist/agents/extensions/modules/github-search.d.ts +29 -0
- package/dist/agents/extensions/modules/github-search.d.ts.map +1 -0
- package/dist/agents/extensions/modules/github-search.js +197 -0
- package/dist/agents/extensions/modules/github-search.js.map +1 -0
- package/dist/agents/extensions/modules/hackernews.d.ts +17 -0
- package/dist/agents/extensions/modules/hackernews.d.ts.map +1 -0
- package/dist/agents/extensions/modules/hackernews.js +144 -0
- package/dist/agents/extensions/modules/hackernews.js.map +1 -0
- package/dist/agents/extensions/modules/index.d.ts +11 -0
- package/dist/agents/extensions/modules/index.d.ts.map +1 -0
- package/dist/agents/extensions/modules/index.js +64 -0
- package/dist/agents/extensions/modules/index.js.map +1 -0
- package/dist/agents/extensions/modules/npm-search.d.ts +15 -0
- package/dist/agents/extensions/modules/npm-search.d.ts.map +1 -0
- package/dist/agents/extensions/modules/npm-search.js +126 -0
- package/dist/agents/extensions/modules/npm-search.js.map +1 -0
- package/dist/agents/extensions/modules/ollama-search.d.ts +30 -0
- package/dist/agents/extensions/modules/ollama-search.d.ts.map +1 -0
- package/dist/agents/extensions/modules/ollama-search.js +171 -0
- package/dist/agents/extensions/modules/ollama-search.js.map +1 -0
- package/dist/agents/extensions/modules/perplexity.d.ts +19 -0
- package/dist/agents/extensions/modules/perplexity.d.ts.map +1 -0
- package/dist/agents/extensions/modules/perplexity.js +358 -0
- package/dist/agents/extensions/modules/perplexity.js.map +1 -0
- package/dist/agents/extensions/modules/searxng.d.ts +43 -0
- package/dist/agents/extensions/modules/searxng.d.ts.map +1 -0
- package/dist/agents/extensions/modules/searxng.js +191 -0
- package/dist/agents/extensions/modules/searxng.js.map +1 -0
- package/dist/agents/extensions/modules/tavily.d.ts +71 -0
- package/dist/agents/extensions/modules/tavily.d.ts.map +1 -0
- package/dist/agents/extensions/modules/tavily.js +330 -0
- package/dist/agents/extensions/modules/tavily.js.map +1 -0
- package/dist/agents/extensions/modules/web-provider-helpers.d.ts +89 -0
- package/dist/agents/extensions/modules/web-provider-helpers.d.ts.map +1 -0
- package/dist/agents/extensions/modules/web-provider-helpers.js +146 -0
- package/dist/agents/extensions/modules/web-provider-helpers.js.map +1 -0
- package/dist/agents/extensions/modules/web-search-filters.d.ts +62 -0
- package/dist/agents/extensions/modules/web-search-filters.d.ts.map +1 -0
- package/dist/agents/extensions/modules/web-search-filters.js +179 -0
- package/dist/agents/extensions/modules/web-search-filters.js.map +1 -0
- package/dist/agents/extensions/modules/wikipedia.d.ts +16 -0
- package/dist/agents/extensions/modules/wikipedia.d.ts.map +1 -0
- package/dist/agents/extensions/modules/wikipedia.js +138 -0
- package/dist/agents/extensions/modules/wikipedia.js.map +1 -0
- package/dist/agents/extensions/registry-cache.d.ts +74 -0
- package/dist/agents/extensions/registry-cache.d.ts.map +1 -0
- package/dist/agents/extensions/registry-cache.js +117 -0
- package/dist/agents/extensions/registry-cache.js.map +1 -0
- package/dist/agents/extensions/registry.d.ts +184 -0
- package/dist/agents/extensions/registry.d.ts.map +1 -0
- package/dist/agents/extensions/registry.js +512 -0
- package/dist/agents/extensions/registry.js.map +1 -0
- package/dist/agents/extensions/types.d.ts +1195 -0
- package/dist/agents/extensions/types.d.ts.map +1 -0
- package/dist/agents/extensions/types.js +28 -0
- package/dist/agents/extensions/types.js.map +1 -0
- package/dist/agents/gateway-call.d.ts +171 -0
- package/dist/agents/gateway-call.d.ts.map +1 -0
- package/dist/agents/gateway-call.js +74 -0
- package/dist/agents/gateway-call.js.map +1 -0
- package/dist/agents/heartbeat-runner.d.ts +100 -0
- package/dist/agents/heartbeat-runner.d.ts.map +1 -0
- package/dist/agents/heartbeat-runner.js +268 -0
- package/dist/agents/heartbeat-runner.js.map +1 -0
- package/dist/agents/heartbeat-scheduler.d.ts +56 -0
- package/dist/agents/heartbeat-scheduler.d.ts.map +1 -0
- package/dist/agents/heartbeat-scheduler.js +366 -0
- package/dist/agents/heartbeat-scheduler.js.map +1 -0
- package/dist/agents/heartbeat-wake.d.ts +99 -0
- package/dist/agents/heartbeat-wake.d.ts.map +1 -0
- package/dist/agents/heartbeat-wake.js +304 -0
- package/dist/agents/heartbeat-wake.js.map +1 -0
- package/dist/agents/identity-file.d.ts +26 -0
- package/dist/agents/identity-file.d.ts.map +1 -0
- package/dist/agents/identity-file.js +86 -0
- package/dist/agents/identity-file.js.map +1 -0
- package/dist/agents/identity-links.d.ts +44 -0
- package/dist/agents/identity-links.d.ts.map +1 -0
- package/dist/agents/identity-links.js +51 -0
- package/dist/agents/identity-links.js.map +1 -0
- package/dist/agents/loop/autonomous-agent.d.ts +55 -0
- package/dist/agents/loop/autonomous-agent.d.ts.map +1 -0
- package/dist/agents/loop/autonomous-agent.js +91 -0
- package/dist/agents/loop/autonomous-agent.js.map +1 -0
- package/dist/agents/loop/loop-guards.d.ts +95 -0
- package/dist/agents/loop/loop-guards.d.ts.map +1 -0
- package/dist/agents/loop/loop-guards.js +169 -0
- package/dist/agents/loop/loop-guards.js.map +1 -0
- package/dist/agents/loop/loop-runner.d.ts +72 -0
- package/dist/agents/loop/loop-runner.d.ts.map +1 -0
- package/dist/agents/loop/loop-runner.js +114 -0
- package/dist/agents/loop/loop-runner.js.map +1 -0
- package/dist/agents/memory/auto-recall.d.ts +69 -0
- package/dist/agents/memory/auto-recall.d.ts.map +1 -0
- package/dist/agents/memory/auto-recall.js +147 -0
- package/dist/agents/memory/auto-recall.js.map +1 -0
- package/dist/agents/memory/behavior-review.d.ts +68 -0
- package/dist/agents/memory/behavior-review.d.ts.map +1 -0
- package/dist/agents/memory/behavior-review.js +131 -0
- package/dist/agents/memory/behavior-review.js.map +1 -0
- package/dist/agents/memory/consolidate.d.ts +62 -0
- package/dist/agents/memory/consolidate.d.ts.map +1 -0
- package/dist/agents/memory/consolidate.js +275 -0
- package/dist/agents/memory/consolidate.js.map +1 -0
- package/dist/agents/memory/contradiction.d.ts +44 -0
- package/dist/agents/memory/contradiction.d.ts.map +1 -0
- package/dist/agents/memory/contradiction.js +86 -0
- package/dist/agents/memory/contradiction.js.map +1 -0
- package/dist/agents/memory/curator.d.ts +22 -0
- package/dist/agents/memory/curator.d.ts.map +1 -0
- package/dist/agents/memory/curator.js +52 -0
- package/dist/agents/memory/curator.js.map +1 -0
- package/dist/agents/memory/decay.d.ts +32 -0
- package/dist/agents/memory/decay.d.ts.map +1 -0
- package/dist/agents/memory/decay.js +86 -0
- package/dist/agents/memory/decay.js.map +1 -0
- package/dist/agents/memory/dream.d.ts +52 -0
- package/dist/agents/memory/dream.d.ts.map +1 -0
- package/dist/agents/memory/dream.js +192 -0
- package/dist/agents/memory/dream.js.map +1 -0
- package/dist/agents/memory/embedder-providers.d.ts +114 -0
- package/dist/agents/memory/embedder-providers.d.ts.map +1 -0
- package/dist/agents/memory/embedder-providers.js +213 -0
- package/dist/agents/memory/embedder-providers.js.map +1 -0
- package/dist/agents/memory/embedder.d.ts +84 -0
- package/dist/agents/memory/embedder.d.ts.map +1 -0
- package/dist/agents/memory/embedder.js +218 -0
- package/dist/agents/memory/embedder.js.map +1 -0
- package/dist/agents/memory/eval/asr-bench.d.ts +33 -0
- package/dist/agents/memory/eval/asr-bench.d.ts.map +1 -0
- package/dist/agents/memory/eval/asr-bench.js +129 -0
- package/dist/agents/memory/eval/asr-bench.js.map +1 -0
- package/dist/agents/memory/eval/capabilities.d.ts +97 -0
- package/dist/agents/memory/eval/capabilities.d.ts.map +1 -0
- package/dist/agents/memory/eval/capabilities.js +210 -0
- package/dist/agents/memory/eval/capabilities.js.map +1 -0
- package/dist/agents/memory/eval/gold-export.d.ts +44 -0
- package/dist/agents/memory/eval/gold-export.d.ts.map +1 -0
- package/dist/agents/memory/eval/gold-export.js +85 -0
- package/dist/agents/memory/eval/gold-export.js.map +1 -0
- package/dist/agents/memory/eval/gold-hard.d.ts +35 -0
- package/dist/agents/memory/eval/gold-hard.d.ts.map +1 -0
- package/dist/agents/memory/eval/gold-hard.js +113 -0
- package/dist/agents/memory/eval/gold-hard.js.map +1 -0
- package/dist/agents/memory/eval/gold-rich.d.ts +33 -0
- package/dist/agents/memory/eval/gold-rich.d.ts.map +1 -0
- package/dist/agents/memory/eval/gold-rich.js +82 -0
- package/dist/agents/memory/eval/gold-rich.js.map +1 -0
- package/dist/agents/memory/eval/gold-synthetic.d.ts +19 -0
- package/dist/agents/memory/eval/gold-synthetic.d.ts.map +1 -0
- package/dist/agents/memory/eval/gold-synthetic.js +65 -0
- package/dist/agents/memory/eval/gold-synthetic.js.map +1 -0
- package/dist/agents/memory/eval/gold.d.ts +73 -0
- package/dist/agents/memory/eval/gold.d.ts.map +1 -0
- package/dist/agents/memory/eval/gold.js +174 -0
- package/dist/agents/memory/eval/gold.js.map +1 -0
- package/dist/agents/memory/eval/harness.d.ts +110 -0
- package/dist/agents/memory/eval/harness.d.ts.map +1 -0
- package/dist/agents/memory/eval/harness.js +123 -0
- package/dist/agents/memory/eval/harness.js.map +1 -0
- package/dist/agents/memory/eval/metrics.d.ts +71 -0
- package/dist/agents/memory/eval/metrics.d.ts.map +1 -0
- package/dist/agents/memory/eval/metrics.js +169 -0
- package/dist/agents/memory/eval/metrics.js.map +1 -0
- package/dist/agents/memory/event-log.d.ts +52 -0
- package/dist/agents/memory/event-log.d.ts.map +1 -0
- package/dist/agents/memory/event-log.js +65 -0
- package/dist/agents/memory/event-log.js.map +1 -0
- package/dist/agents/memory/extract.d.ts +155 -0
- package/dist/agents/memory/extract.d.ts.map +1 -0
- package/dist/agents/memory/extract.js +571 -0
- package/dist/agents/memory/extract.js.map +1 -0
- package/dist/agents/memory/governance.d.ts +45 -0
- package/dist/agents/memory/governance.d.ts.map +1 -0
- package/dist/agents/memory/governance.js +113 -0
- package/dist/agents/memory/governance.js.map +1 -0
- package/dist/agents/memory/graph-export.d.ts +59 -0
- package/dist/agents/memory/graph-export.d.ts.map +1 -0
- package/dist/agents/memory/graph-export.js +181 -0
- package/dist/agents/memory/graph-export.js.map +1 -0
- package/dist/agents/memory/graph-recall.d.ts +42 -0
- package/dist/agents/memory/graph-recall.d.ts.map +1 -0
- package/dist/agents/memory/graph-recall.js +165 -0
- package/dist/agents/memory/graph-recall.js.map +1 -0
- package/dist/agents/memory/graph.d.ts +92 -0
- package/dist/agents/memory/graph.d.ts.map +1 -0
- package/dist/agents/memory/graph.js +266 -0
- package/dist/agents/memory/graph.js.map +1 -0
- package/dist/agents/memory/host-ports.d.ts +27 -0
- package/dist/agents/memory/host-ports.d.ts.map +1 -0
- package/dist/agents/memory/host-ports.js +31 -0
- package/dist/agents/memory/host-ports.js.map +1 -0
- package/dist/agents/memory/hybrid.d.ts +46 -0
- package/dist/agents/memory/hybrid.d.ts.map +1 -0
- package/dist/agents/memory/hybrid.js +184 -0
- package/dist/agents/memory/hybrid.js.map +1 -0
- package/dist/agents/memory/index.d.ts +13 -0
- package/dist/agents/memory/index.d.ts.map +1 -0
- package/dist/agents/memory/index.js +13 -0
- package/dist/agents/memory/index.js.map +1 -0
- package/dist/agents/memory/json-scan.d.ts +14 -0
- package/dist/agents/memory/json-scan.d.ts.map +1 -0
- package/dist/agents/memory/json-scan.js +47 -0
- package/dist/agents/memory/json-scan.js.map +1 -0
- package/dist/agents/memory/links.d.ts +92 -0
- package/dist/agents/memory/links.d.ts.map +1 -0
- package/dist/agents/memory/links.js +140 -0
- package/dist/agents/memory/links.js.map +1 -0
- package/dist/agents/memory/maintenance.d.ts +18 -0
- package/dist/agents/memory/maintenance.d.ts.map +1 -0
- package/dist/agents/memory/maintenance.js +66 -0
- package/dist/agents/memory/maintenance.js.map +1 -0
- package/dist/agents/memory/memory-mcp-server.d.ts +39 -0
- package/dist/agents/memory/memory-mcp-server.d.ts.map +1 -0
- package/dist/agents/memory/memory-mcp-server.js +122 -0
- package/dist/agents/memory/memory-mcp-server.js.map +1 -0
- package/dist/agents/memory/memory-mcp.d.ts +34 -0
- package/dist/agents/memory/memory-mcp.d.ts.map +1 -0
- package/dist/agents/memory/memory-mcp.js +130 -0
- package/dist/agents/memory/memory-mcp.js.map +1 -0
- package/dist/agents/memory/plugin-runtime.d.ts +133 -0
- package/dist/agents/memory/plugin-runtime.d.ts.map +1 -0
- package/dist/agents/memory/plugin-runtime.js +149 -0
- package/dist/agents/memory/plugin-runtime.js.map +1 -0
- package/dist/agents/memory/query.d.ts +50 -0
- package/dist/agents/memory/query.d.ts.map +1 -0
- package/dist/agents/memory/query.js +94 -0
- package/dist/agents/memory/query.js.map +1 -0
- package/dist/agents/memory/records.d.ts +617 -0
- package/dist/agents/memory/records.d.ts.map +1 -0
- package/dist/agents/memory/records.js +1327 -0
- package/dist/agents/memory/records.js.map +1 -0
- package/dist/agents/memory/reembed.d.ts +42 -0
- package/dist/agents/memory/reembed.d.ts.map +1 -0
- package/dist/agents/memory/reembed.js +60 -0
- package/dist/agents/memory/reembed.js.map +1 -0
- package/dist/agents/memory/relationship-extract.d.ts +259 -0
- package/dist/agents/memory/relationship-extract.d.ts.map +1 -0
- package/dist/agents/memory/relationship-extract.js +454 -0
- package/dist/agents/memory/relationship-extract.js.map +1 -0
- package/dist/agents/memory/rerank.d.ts +37 -0
- package/dist/agents/memory/rerank.d.ts.map +1 -0
- package/dist/agents/memory/rerank.js +43 -0
- package/dist/agents/memory/rerank.js.map +1 -0
- package/dist/agents/memory/scoring.d.ts +85 -0
- package/dist/agents/memory/scoring.d.ts.map +1 -0
- package/dist/agents/memory/scoring.js +139 -0
- package/dist/agents/memory/scoring.js.map +1 -0
- package/dist/agents/memory/self-improve.d.ts +56 -0
- package/dist/agents/memory/self-improve.d.ts.map +1 -0
- package/dist/agents/memory/self-improve.js +98 -0
- package/dist/agents/memory/self-improve.js.map +1 -0
- package/dist/agents/memory/self-review.d.ts +68 -0
- package/dist/agents/memory/self-review.d.ts.map +1 -0
- package/dist/agents/memory/self-review.js +109 -0
- package/dist/agents/memory/self-review.js.map +1 -0
- package/dist/agents/memory/storage.d.ts +156 -0
- package/dist/agents/memory/storage.d.ts.map +1 -0
- package/dist/agents/memory/storage.js +359 -0
- package/dist/agents/memory/storage.js.map +1 -0
- package/dist/agents/memory/tideline.d.ts +203 -0
- package/dist/agents/memory/tideline.d.ts.map +1 -0
- package/dist/agents/memory/tideline.js +189 -0
- package/dist/agents/memory/tideline.js.map +1 -0
- package/dist/agents/memory/vault.d.ts +142 -0
- package/dist/agents/memory/vault.d.ts.map +1 -0
- package/dist/agents/memory/vault.js +787 -0
- package/dist/agents/memory/vault.js.map +1 -0
- package/dist/agents/memory/write-gate.d.ts +76 -0
- package/dist/agents/memory/write-gate.d.ts.map +1 -0
- package/dist/agents/memory/write-gate.js +140 -0
- package/dist/agents/memory/write-gate.js.map +1 -0
- package/dist/agents/mid-turn-switch.d.ts +25 -0
- package/dist/agents/mid-turn-switch.d.ts.map +1 -0
- package/dist/agents/mid-turn-switch.js +103 -0
- package/dist/agents/mid-turn-switch.js.map +1 -0
- package/dist/agents/model-fallback.d.ts +50 -0
- package/dist/agents/model-fallback.d.ts.map +1 -0
- package/dist/agents/model-fallback.js +226 -0
- package/dist/agents/model-fallback.js.map +1 -0
- package/dist/agents/model-resolution.d.ts +38 -0
- package/dist/agents/model-resolution.d.ts.map +1 -0
- package/dist/agents/model-resolution.js +155 -0
- package/dist/agents/model-resolution.js.map +1 -0
- package/dist/agents/org/a2a-adapter.d.ts +49 -0
- package/dist/agents/org/a2a-adapter.d.ts.map +1 -0
- package/dist/agents/org/a2a-adapter.js +92 -0
- package/dist/agents/org/a2a-adapter.js.map +1 -0
- package/dist/agents/org/assets/mascots/README.md +34 -0
- package/dist/agents/org/assets/mascots/Untitled-1.png +0 -0
- package/dist/agents/org/assets/mascots/brigade_biceps.png +0 -0
- package/dist/agents/org/audit-log.d.ts +22 -0
- package/dist/agents/org/audit-log.d.ts.map +1 -0
- package/dist/agents/org/audit-log.js +37 -0
- package/dist/agents/org/audit-log.js.map +1 -0
- package/dist/agents/org/auto-derive.d.ts +22 -0
- package/dist/agents/org/auto-derive.d.ts.map +1 -0
- package/dist/agents/org/auto-derive.js +66 -0
- package/dist/agents/org/auto-derive.js.map +1 -0
- package/dist/agents/org/delivery-kind.d.ts +89 -0
- package/dist/agents/org/delivery-kind.d.ts.map +1 -0
- package/dist/agents/org/delivery-kind.js +149 -0
- package/dist/agents/org/delivery-kind.js.map +1 -0
- package/dist/agents/org/derive-graph.d.ts +34 -0
- package/dist/agents/org/derive-graph.d.ts.map +1 -0
- package/dist/agents/org/derive-graph.js +266 -0
- package/dist/agents/org/derive-graph.js.map +1 -0
- package/dist/agents/org/lints.d.ts +21 -0
- package/dist/agents/org/lints.d.ts.map +1 -0
- package/dist/agents/org/lints.js +133 -0
- package/dist/agents/org/lints.js.map +1 -0
- package/dist/agents/org/pride-html.d.ts +61 -0
- package/dist/agents/org/pride-html.d.ts.map +1 -0
- package/dist/agents/org/pride-html.js +565 -0
- package/dist/agents/org/pride-html.js.map +1 -0
- package/dist/agents/org/pride-image.d.ts +101 -0
- package/dist/agents/org/pride-image.d.ts.map +1 -0
- package/dist/agents/org/pride-image.js +210 -0
- package/dist/agents/org/pride-image.js.map +1 -0
- package/dist/agents/org/pride-taunts.d.ts +47 -0
- package/dist/agents/org/pride-taunts.d.ts.map +1 -0
- package/dist/agents/org/pride-taunts.js +411 -0
- package/dist/agents/org/pride-taunts.js.map +1 -0
- package/dist/agents/org/pride-template.d.ts +272 -0
- package/dist/agents/org/pride-template.d.ts.map +1 -0
- package/dist/agents/org/pride-template.js +892 -0
- package/dist/agents/org/pride-template.js.map +1 -0
- package/dist/agents/org/pride-themes.d.ts +80 -0
- package/dist/agents/org/pride-themes.d.ts.map +1 -0
- package/dist/agents/org/pride-themes.js +7596 -0
- package/dist/agents/org/pride-themes.js.map +1 -0
- package/dist/agents/org/structured-errors.d.ts +47 -0
- package/dist/agents/org/structured-errors.d.ts.map +1 -0
- package/dist/agents/org/structured-errors.js +97 -0
- package/dist/agents/org/structured-errors.js.map +1 -0
- package/dist/agents/org/types.d.ts +139 -0
- package/dist/agents/org/types.d.ts.map +1 -0
- package/dist/agents/org/types.js +43 -0
- package/dist/agents/org/types.js.map +1 -0
- package/dist/agents/org/validate.d.ts +36 -0
- package/dist/agents/org/validate.d.ts.map +1 -0
- package/dist/agents/org/validate.js +135 -0
- package/dist/agents/org/validate.js.map +1 -0
- package/dist/agents/path-write-guard.d.ts +82 -0
- package/dist/agents/path-write-guard.d.ts.map +1 -0
- package/dist/agents/path-write-guard.js +722 -0
- package/dist/agents/path-write-guard.js.map +1 -0
- package/dist/agents/payload-mutators.d.ts +175 -0
- package/dist/agents/payload-mutators.d.ts.map +1 -0
- package/dist/agents/payload-mutators.js +994 -0
- package/dist/agents/payload-mutators.js.map +1 -0
- package/dist/agents/pending-system-events.d.ts +76 -0
- package/dist/agents/pending-system-events.d.ts.map +1 -0
- package/dist/agents/pending-system-events.js +115 -0
- package/dist/agents/pending-system-events.js.map +1 -0
- package/dist/agents/provider-attribution.d.ts +19 -0
- package/dist/agents/provider-attribution.d.ts.map +1 -0
- package/dist/agents/provider-attribution.js +62 -0
- package/dist/agents/provider-attribution.js.map +1 -0
- package/dist/agents/quality/slop-detector.d.ts +40 -0
- package/dist/agents/quality/slop-detector.d.ts.map +1 -0
- package/dist/agents/quality/slop-detector.js +108 -0
- package/dist/agents/quality/slop-detector.js.map +1 -0
- package/dist/agents/quality/slop-index.d.ts +27 -0
- package/dist/agents/quality/slop-index.d.ts.map +1 -0
- package/dist/agents/quality/slop-index.js +124 -0
- package/dist/agents/quality/slop-index.js.map +1 -0
- package/dist/agents/retry-policy.d.ts +38 -0
- package/dist/agents/retry-policy.d.ts.map +1 -0
- package/dist/agents/retry-policy.js +276 -0
- package/dist/agents/retry-policy.js.map +1 -0
- package/dist/agents/routing/account-id.d.ts +43 -0
- package/dist/agents/routing/account-id.d.ts.map +1 -0
- package/dist/agents/routing/account-id.js +103 -0
- package/dist/agents/routing/account-id.js.map +1 -0
- package/dist/agents/routing/bindings.d.ts +20 -0
- package/dist/agents/routing/bindings.d.ts.map +1 -0
- package/dist/agents/routing/bindings.js +22 -0
- package/dist/agents/routing/bindings.js.map +1 -0
- package/dist/agents/routing/dm-scope-warning.d.ts +37 -0
- package/dist/agents/routing/dm-scope-warning.d.ts.map +1 -0
- package/dist/agents/routing/dm-scope-warning.js +110 -0
- package/dist/agents/routing/dm-scope-warning.js.map +1 -0
- package/dist/agents/routing/identity-links.d.ts +45 -0
- package/dist/agents/routing/identity-links.d.ts.map +1 -0
- package/dist/agents/routing/identity-links.js +85 -0
- package/dist/agents/routing/identity-links.js.map +1 -0
- package/dist/agents/routing/resolve-route.d.ts +91 -0
- package/dist/agents/routing/resolve-route.d.ts.map +1 -0
- package/dist/agents/routing/resolve-route.js +653 -0
- package/dist/agents/routing/resolve-route.js.map +1 -0
- package/dist/agents/routing/session-key.d.ts +168 -0
- package/dist/agents/routing/session-key.d.ts.map +1 -0
- package/dist/agents/routing/session-key.js +268 -0
- package/dist/agents/routing/session-key.js.map +1 -0
- package/dist/agents/sanitize-surrogates.d.ts +30 -0
- package/dist/agents/sanitize-surrogates.d.ts.map +1 -0
- package/dist/agents/sanitize-surrogates.js +56 -0
- package/dist/agents/sanitize-surrogates.js.map +1 -0
- package/dist/agents/session-context.d.ts +80 -0
- package/dist/agents/session-context.d.ts.map +1 -0
- package/dist/agents/session-context.js +76 -0
- package/dist/agents/session-context.js.map +1 -0
- package/dist/agents/session-event-prompt.d.ts +124 -0
- package/dist/agents/session-event-prompt.d.ts.map +1 -0
- package/dist/agents/session-event-prompt.js +179 -0
- package/dist/agents/session-event-prompt.js.map +1 -0
- package/dist/agents/session-inbox.d.ts +129 -0
- package/dist/agents/session-inbox.d.ts.map +1 -0
- package/dist/agents/session-inbox.js +492 -0
- package/dist/agents/session-inbox.js.map +1 -0
- package/dist/agents/session-registry.d.ts +148 -0
- package/dist/agents/session-registry.d.ts.map +1 -0
- package/dist/agents/session-registry.js +405 -0
- package/dist/agents/session-registry.js.map +1 -0
- package/dist/agents/session-wiring.d.ts +214 -0
- package/dist/agents/session-wiring.d.ts.map +1 -0
- package/dist/agents/session-wiring.js +278 -0
- package/dist/agents/session-wiring.js.map +1 -0
- package/dist/agents/session-write-lock.d.ts +15 -0
- package/dist/agents/session-write-lock.d.ts.map +1 -0
- package/dist/agents/session-write-lock.js +15 -0
- package/dist/agents/session-write-lock.js.map +1 -0
- package/dist/agents/skills/agent-filter.d.ts +43 -0
- package/dist/agents/skills/agent-filter.d.ts.map +1 -0
- package/dist/agents/skills/agent-filter.js +89 -0
- package/dist/agents/skills/agent-filter.js.map +1 -0
- package/dist/agents/skills/discovery.d.ts +97 -0
- package/dist/agents/skills/discovery.d.ts.map +1 -0
- package/dist/agents/skills/discovery.js +136 -0
- package/dist/agents/skills/discovery.js.map +1 -0
- package/dist/agents/skills/eligibility.d.ts +118 -0
- package/dist/agents/skills/eligibility.d.ts.map +1 -0
- package/dist/agents/skills/eligibility.js +280 -0
- package/dist/agents/skills/eligibility.js.map +1 -0
- package/dist/agents/skills/grant.d.ts +70 -0
- package/dist/agents/skills/grant.d.ts.map +1 -0
- package/dist/agents/skills/grant.js +106 -0
- package/dist/agents/skills/grant.js.map +1 -0
- package/dist/agents/skills/index.d.ts +35 -0
- package/dist/agents/skills/index.d.ts.map +1 -0
- package/dist/agents/skills/index.js +88 -0
- package/dist/agents/skills/index.js.map +1 -0
- package/dist/agents/skills/install-spec.d.ts +51 -0
- package/dist/agents/skills/install-spec.d.ts.map +1 -0
- package/dist/agents/skills/install-spec.js +21 -0
- package/dist/agents/skills/install-spec.js.map +1 -0
- package/dist/agents/skills/install.d.ts +68 -0
- package/dist/agents/skills/install.d.ts.map +1 -0
- package/dist/agents/skills/install.js +206 -0
- package/dist/agents/skills/install.js.map +1 -0
- package/dist/agents/skills/org-access.d.ts +27 -0
- package/dist/agents/skills/org-access.d.ts.map +1 -0
- package/dist/agents/skills/org-access.js +87 -0
- package/dist/agents/skills/org-access.js.map +1 -0
- package/dist/agents/skills/skill-consolidate.d.ts +76 -0
- package/dist/agents/skills/skill-consolidate.d.ts.map +1 -0
- package/dist/agents/skills/skill-consolidate.js +264 -0
- package/dist/agents/skills/skill-consolidate.js.map +1 -0
- package/dist/agents/skills/skill-curator.d.ts +91 -0
- package/dist/agents/skills/skill-curator.d.ts.map +1 -0
- package/dist/agents/skills/skill-curator.js +239 -0
- package/dist/agents/skills/skill-curator.js.map +1 -0
- package/dist/agents/skills/skill-manifest.d.ts +35 -0
- package/dist/agents/skills/skill-manifest.d.ts.map +1 -0
- package/dist/agents/skills/skill-manifest.js +82 -0
- package/dist/agents/skills/skill-manifest.js.map +1 -0
- package/dist/agents/skills/skill-review.d.ts +91 -0
- package/dist/agents/skills/skill-review.d.ts.map +1 -0
- package/dist/agents/skills/skill-review.js +271 -0
- package/dist/agents/skills/skill-review.js.map +1 -0
- package/dist/agents/skills/skill-usage.d.ts +81 -0
- package/dist/agents/skills/skill-usage.d.ts.map +1 -0
- package/dist/agents/skills/skill-usage.js +208 -0
- package/dist/agents/skills/skill-usage.js.map +1 -0
- package/dist/agents/skills/status.d.ts +68 -0
- package/dist/agents/skills/status.d.ts.map +1 -0
- package/dist/agents/skills/status.js +147 -0
- package/dist/agents/skills/status.js.map +1 -0
- package/dist/agents/skills/update-config.d.ts +32 -0
- package/dist/agents/skills/update-config.d.ts.map +1 -0
- package/dist/agents/skills/update-config.js +53 -0
- package/dist/agents/skills/update-config.js.map +1 -0
- package/dist/agents/slash-commands.d.ts +25 -0
- package/dist/agents/slash-commands.d.ts.map +1 -0
- package/dist/agents/slash-commands.js +151 -0
- package/dist/agents/slash-commands.js.map +1 -0
- package/dist/agents/smart-compaction.d.ts +105 -0
- package/dist/agents/smart-compaction.d.ts.map +1 -0
- package/dist/agents/smart-compaction.js +355 -0
- package/dist/agents/smart-compaction.js.map +1 -0
- package/dist/agents/stream-wrappers.d.ts +20 -0
- package/dist/agents/stream-wrappers.d.ts.map +1 -0
- package/dist/agents/stream-wrappers.js +307 -0
- package/dist/agents/stream-wrappers.js.map +1 -0
- package/dist/agents/subagent-abort-cascade.d.ts +31 -0
- package/dist/agents/subagent-abort-cascade.d.ts.map +1 -0
- package/dist/agents/subagent-abort-cascade.js +124 -0
- package/dist/agents/subagent-abort-cascade.js.map +1 -0
- package/dist/agents/subagent-announce-delivery.d.ts +83 -0
- package/dist/agents/subagent-announce-delivery.d.ts.map +1 -0
- package/dist/agents/subagent-announce-delivery.js +159 -0
- package/dist/agents/subagent-announce-delivery.js.map +1 -0
- package/dist/agents/subagent-budget.d.ts +36 -0
- package/dist/agents/subagent-budget.d.ts.map +1 -0
- package/dist/agents/subagent-budget.js +93 -0
- package/dist/agents/subagent-budget.js.map +1 -0
- package/dist/agents/subagent-completion-bridge.d.ts +42 -0
- package/dist/agents/subagent-completion-bridge.d.ts.map +1 -0
- package/dist/agents/subagent-completion-bridge.js +338 -0
- package/dist/agents/subagent-completion-bridge.js.map +1 -0
- package/dist/agents/subagent-lifecycle-events.d.ts +31 -0
- package/dist/agents/subagent-lifecycle-events.d.ts.map +1 -0
- package/dist/agents/subagent-lifecycle-events.js +21 -0
- package/dist/agents/subagent-lifecycle-events.js.map +1 -0
- package/dist/agents/subagent-policy.d.ts +206 -0
- package/dist/agents/subagent-policy.d.ts.map +1 -0
- package/dist/agents/subagent-policy.js +295 -0
- package/dist/agents/subagent-policy.js.map +1 -0
- package/dist/agents/subagent-registry-completion.d.ts +69 -0
- package/dist/agents/subagent-registry-completion.d.ts.map +1 -0
- package/dist/agents/subagent-registry-completion.js +128 -0
- package/dist/agents/subagent-registry-completion.js.map +1 -0
- package/dist/agents/subagent-registry.d.ts +85 -0
- package/dist/agents/subagent-registry.d.ts.map +1 -0
- package/dist/agents/subagent-registry.js +215 -0
- package/dist/agents/subagent-registry.js.map +1 -0
- package/dist/agents/subagent-registry.types.d.ts +94 -0
- package/dist/agents/subagent-registry.types.d.ts.map +1 -0
- package/dist/agents/subagent-registry.types.js +19 -0
- package/dist/agents/subagent-registry.types.js.map +1 -0
- package/dist/agents/subagent-runner.d.ts +75 -0
- package/dist/agents/subagent-runner.d.ts.map +1 -0
- package/dist/agents/subagent-runner.js +358 -0
- package/dist/agents/subagent-runner.js.map +1 -0
- package/dist/agents/subagent-spawn-abort-marker.d.ts +46 -0
- package/dist/agents/subagent-spawn-abort-marker.d.ts.map +1 -0
- package/dist/agents/subagent-spawn-abort-marker.js +81 -0
- package/dist/agents/subagent-spawn-abort-marker.js.map +1 -0
- package/dist/agents/subagent-spawn.d.ts +104 -0
- package/dist/agents/subagent-spawn.d.ts.map +1 -0
- package/dist/agents/subagent-spawn.js +358 -0
- package/dist/agents/subagent-spawn.js.map +1 -0
- package/dist/agents/thinking-fallback.d.ts +49 -0
- package/dist/agents/thinking-fallback.d.ts.map +1 -0
- package/dist/agents/thinking-fallback.js +97 -0
- package/dist/agents/thinking-fallback.js.map +1 -0
- package/dist/agents/tool-guard.d.ts +71 -0
- package/dist/agents/tool-guard.d.ts.map +1 -0
- package/dist/agents/tool-guard.js +154 -0
- package/dist/agents/tool-guard.js.map +1 -0
- package/dist/agents/tool-loop-detector.d.ts +115 -0
- package/dist/agents/tool-loop-detector.d.ts.map +1 -0
- package/dist/agents/tool-loop-detector.js +0 -0
- package/dist/agents/tool-loop-detector.js.map +1 -0
- package/dist/agents/tool-summaries.d.ts +3 -0
- package/dist/agents/tool-summaries.d.ts.map +1 -0
- package/dist/agents/tool-summaries.js +78 -0
- package/dist/agents/tool-summaries.js.map +1 -0
- package/dist/agents/tools/agents-list-tool.d.ts +51 -0
- package/dist/agents/tools/agents-list-tool.d.ts.map +1 -0
- package/dist/agents/tools/agents-list-tool.js +167 -0
- package/dist/agents/tools/agents-list-tool.js.map +1 -0
- package/dist/agents/tools/browser.d.ts +144 -0
- package/dist/agents/tools/browser.d.ts.map +1 -0
- package/dist/agents/tools/browser.js +1538 -0
- package/dist/agents/tools/browser.js.map +1 -0
- package/dist/agents/tools/common.d.ts +208 -0
- package/dist/agents/tools/common.d.ts.map +1 -0
- package/dist/agents/tools/common.js +405 -0
- package/dist/agents/tools/common.js.map +1 -0
- package/dist/agents/tools/composio-tool.d.ts +179 -0
- package/dist/agents/tools/composio-tool.d.ts.map +1 -0
- package/dist/agents/tools/composio-tool.js +474 -0
- package/dist/agents/tools/composio-tool.js.map +1 -0
- package/dist/agents/tools/cron-tool.d.ts +187 -0
- package/dist/agents/tools/cron-tool.d.ts.map +1 -0
- package/dist/agents/tools/cron-tool.js +985 -0
- package/dist/agents/tools/cron-tool.js.map +1 -0
- package/dist/agents/tools/find-tool.d.ts +55 -0
- package/dist/agents/tools/find-tool.d.ts.map +1 -0
- package/dist/agents/tools/find-tool.js +163 -0
- package/dist/agents/tools/find-tool.js.map +1 -0
- package/dist/agents/tools/generate-image-tool.d.ts +77 -0
- package/dist/agents/tools/generate-image-tool.d.ts.map +1 -0
- package/dist/agents/tools/generate-image-tool.js +421 -0
- package/dist/agents/tools/generate-image-tool.js.map +1 -0
- package/dist/agents/tools/index.d.ts +14 -0
- package/dist/agents/tools/index.d.ts.map +1 -0
- package/dist/agents/tools/index.js +12 -0
- package/dist/agents/tools/index.js.map +1 -0
- package/dist/agents/tools/manage-access-tool.d.ts +64 -0
- package/dist/agents/tools/manage-access-tool.d.ts.map +1 -0
- package/dist/agents/tools/manage-access-tool.js +188 -0
- package/dist/agents/tools/manage-access-tool.js.map +1 -0
- package/dist/agents/tools/manage-agent-tool.d.ts +50 -0
- package/dist/agents/tools/manage-agent-tool.d.ts.map +1 -0
- package/dist/agents/tools/manage-agent-tool.js +232 -0
- package/dist/agents/tools/manage-agent-tool.js.map +1 -0
- package/dist/agents/tools/manage-channel-access-tool.d.ts +44 -0
- package/dist/agents/tools/manage-channel-access-tool.d.ts.map +1 -0
- package/dist/agents/tools/manage-channel-access-tool.js +144 -0
- package/dist/agents/tools/manage-channel-access-tool.js.map +1 -0
- package/dist/agents/tools/manage-memory-tool.d.ts +30 -0
- package/dist/agents/tools/manage-memory-tool.d.ts.map +1 -0
- package/dist/agents/tools/manage-memory-tool.js +309 -0
- package/dist/agents/tools/manage-memory-tool.js.map +1 -0
- package/dist/agents/tools/manage-provider-tool.d.ts +65 -0
- package/dist/agents/tools/manage-provider-tool.d.ts.map +1 -0
- package/dist/agents/tools/manage-provider-tool.js +249 -0
- package/dist/agents/tools/manage-provider-tool.js.map +1 -0
- package/dist/agents/tools/manage-skill-tool.d.ts +121 -0
- package/dist/agents/tools/manage-skill-tool.d.ts.map +1 -0
- package/dist/agents/tools/manage-skill-tool.js +722 -0
- package/dist/agents/tools/manage-skill-tool.js.map +1 -0
- package/dist/agents/tools/memory-tools.d.ts +172 -0
- package/dist/agents/tools/memory-tools.d.ts.map +1 -0
- package/dist/agents/tools/memory-tools.js +561 -0
- package/dist/agents/tools/memory-tools.js.map +1 -0
- package/dist/agents/tools/oauth-authorize-tool.d.ts +94 -0
- package/dist/agents/tools/oauth-authorize-tool.d.ts.map +1 -0
- package/dist/agents/tools/oauth-authorize-tool.js +670 -0
- package/dist/agents/tools/oauth-authorize-tool.js.map +1 -0
- package/dist/agents/tools/org-tool.d.ts +208 -0
- package/dist/agents/tools/org-tool.d.ts.map +1 -0
- package/dist/agents/tools/org-tool.js +790 -0
- package/dist/agents/tools/org-tool.js.map +1 -0
- package/dist/agents/tools/registry.d.ts +146 -0
- package/dist/agents/tools/registry.d.ts.map +1 -0
- package/dist/agents/tools/registry.js +396 -0
- package/dist/agents/tools/registry.js.map +1 -0
- package/dist/agents/tools/send-media-tool.d.ts +92 -0
- package/dist/agents/tools/send-media-tool.d.ts.map +1 -0
- package/dist/agents/tools/send-media-tool.js +512 -0
- package/dist/agents/tools/send-media-tool.js.map +1 -0
- package/dist/agents/tools/send-message-tool.d.ts +84 -0
- package/dist/agents/tools/send-message-tool.d.ts.map +1 -0
- package/dist/agents/tools/send-message-tool.js +226 -0
- package/dist/agents/tools/send-message-tool.js.map +1 -0
- package/dist/agents/tools/sessions/history.d.ts +53 -0
- package/dist/agents/tools/sessions/history.d.ts.map +1 -0
- package/dist/agents/tools/sessions/history.js +138 -0
- package/dist/agents/tools/sessions/history.js.map +1 -0
- package/dist/agents/tools/sessions/index.d.ts +92 -0
- package/dist/agents/tools/sessions/index.d.ts.map +1 -0
- package/dist/agents/tools/sessions/index.js +125 -0
- package/dist/agents/tools/sessions/index.js.map +1 -0
- package/dist/agents/tools/sessions/list.d.ts +53 -0
- package/dist/agents/tools/sessions/list.d.ts.map +1 -0
- package/dist/agents/tools/sessions/list.js +134 -0
- package/dist/agents/tools/sessions/list.js.map +1 -0
- package/dist/agents/tools/sessions/resolve-access.d.ts +34 -0
- package/dist/agents/tools/sessions/resolve-access.d.ts.map +1 -0
- package/dist/agents/tools/sessions/resolve-access.js +67 -0
- package/dist/agents/tools/sessions/resolve-access.js.map +1 -0
- package/dist/agents/tools/sessions/send.d.ts +68 -0
- package/dist/agents/tools/sessions/send.d.ts.map +1 -0
- package/dist/agents/tools/sessions/send.js +556 -0
- package/dist/agents/tools/sessions/send.js.map +1 -0
- package/dist/agents/tools/sessions/shared.d.ts +145 -0
- package/dist/agents/tools/sessions/shared.d.ts.map +1 -0
- package/dist/agents/tools/sessions/shared.js +352 -0
- package/dist/agents/tools/sessions/shared.js.map +1 -0
- package/dist/agents/tools/sessions/spawn.d.ts +71 -0
- package/dist/agents/tools/sessions/spawn.d.ts.map +1 -0
- package/dist/agents/tools/sessions/spawn.js +132 -0
- package/dist/agents/tools/sessions/spawn.js.map +1 -0
- package/dist/agents/tools/spawn-agent-tool.d.ts +87 -0
- package/dist/agents/tools/spawn-agent-tool.d.ts.map +1 -0
- package/dist/agents/tools/spawn-agent-tool.js +189 -0
- package/dist/agents/tools/spawn-agent-tool.js.map +1 -0
- package/dist/agents/tools/spawn-agents-tool.d.ts +75 -0
- package/dist/agents/tools/spawn-agents-tool.d.ts.map +1 -0
- package/dist/agents/tools/spawn-agents-tool.js +267 -0
- package/dist/agents/tools/spawn-agents-tool.js.map +1 -0
- package/dist/agents/tools/types.d.ts +55 -0
- package/dist/agents/tools/types.d.ts.map +1 -0
- package/dist/agents/tools/types.js +28 -0
- package/dist/agents/tools/types.js.map +1 -0
- package/dist/agents/tools/web-fetch-utils.d.ts +114 -0
- package/dist/agents/tools/web-fetch-utils.d.ts.map +1 -0
- package/dist/agents/tools/web-fetch-utils.js +560 -0
- package/dist/agents/tools/web-fetch-utils.js.map +1 -0
- package/dist/agents/tools/web-fetch.d.ts +97 -0
- package/dist/agents/tools/web-fetch.d.ts.map +1 -0
- package/dist/agents/tools/web-fetch.js +369 -0
- package/dist/agents/tools/web-fetch.js.map +1 -0
- package/dist/agents/tools/web-retry.d.ts +55 -0
- package/dist/agents/tools/web-retry.d.ts.map +1 -0
- package/dist/agents/tools/web-retry.js +172 -0
- package/dist/agents/tools/web-retry.js.map +1 -0
- package/dist/agents/tools/web-search.d.ts +96 -0
- package/dist/agents/tools/web-search.d.ts.map +1 -0
- package/dist/agents/tools/web-search.js +459 -0
- package/dist/agents/tools/web-search.js.map +1 -0
- package/dist/agents/tools/web-shared.d.ts +123 -0
- package/dist/agents/tools/web-shared.d.ts.map +1 -0
- package/dist/agents/tools/web-shared.js +207 -0
- package/dist/agents/tools/web-shared.js.map +1 -0
- package/dist/assets/brigade-favicon.png +0 -0
- package/dist/auth/profile-cooldown.d.ts +105 -0
- package/dist/auth/profile-cooldown.d.ts.map +1 -0
- package/dist/auth/profile-cooldown.js +466 -0
- package/dist/auth/profile-cooldown.js.map +1 -0
- package/dist/auth/profiles.d.ts +93 -0
- package/dist/auth/profiles.d.ts.map +1 -0
- package/dist/auth/profiles.js +321 -0
- package/dist/auth/profiles.js.map +1 -0
- package/dist/buildstamp.json +1 -0
- package/dist/cli/argv.d.ts +20 -0
- package/dist/cli/argv.d.ts.map +1 -0
- package/dist/cli/argv.js +47 -0
- package/dist/cli/argv.js.map +1 -0
- package/dist/cli/commands/agent.d.ts +19 -0
- package/dist/cli/commands/agent.d.ts.map +1 -0
- package/dist/cli/commands/agent.js +297 -0
- package/dist/cli/commands/agent.js.map +1 -0
- package/dist/cli/commands/agents-bindings.d.ts +80 -0
- package/dist/cli/commands/agents-bindings.d.ts.map +1 -0
- package/dist/cli/commands/agents-bindings.js +252 -0
- package/dist/cli/commands/agents-bindings.js.map +1 -0
- package/dist/cli/commands/agents-cmd.d.ts +160 -0
- package/dist/cli/commands/agents-cmd.d.ts.map +1 -0
- package/dist/cli/commands/agents-cmd.js +1199 -0
- package/dist/cli/commands/agents-cmd.js.map +1 -0
- package/dist/cli/commands/agents-config.d.ts +102 -0
- package/dist/cli/commands/agents-config.d.ts.map +1 -0
- package/dist/cli/commands/agents-config.js +294 -0
- package/dist/cli/commands/agents-config.js.map +1 -0
- package/dist/cli/commands/agents-shared.d.ts +57 -0
- package/dist/cli/commands/agents-shared.d.ts.map +1 -0
- package/dist/cli/commands/agents-shared.js +83 -0
- package/dist/cli/commands/agents-shared.js.map +1 -0
- package/dist/cli/commands/backup.d.ts +36 -0
- package/dist/cli/commands/backup.d.ts.map +1 -0
- package/dist/cli/commands/backup.js +244 -0
- package/dist/cli/commands/backup.js.map +1 -0
- package/dist/cli/commands/channels.d.ts +106 -0
- package/dist/cli/commands/channels.d.ts.map +1 -0
- package/dist/cli/commands/channels.js +830 -0
- package/dist/cli/commands/channels.js.map +1 -0
- package/dist/cli/commands/chat.d.ts +43 -0
- package/dist/cli/commands/chat.d.ts.map +1 -0
- package/dist/cli/commands/chat.js +84 -0
- package/dist/cli/commands/chat.js.map +1 -0
- package/dist/cli/commands/config-cmd.d.ts +62 -0
- package/dist/cli/commands/config-cmd.d.ts.map +1 -0
- package/dist/cli/commands/config-cmd.js +404 -0
- package/dist/cli/commands/config-cmd.js.map +1 -0
- package/dist/cli/commands/connect.d.ts +73 -0
- package/dist/cli/commands/connect.d.ts.map +1 -0
- package/dist/cli/commands/connect.js +1952 -0
- package/dist/cli/commands/connect.js.map +1 -0
- package/dist/cli/commands/cron.d.ts +58 -0
- package/dist/cli/commands/cron.d.ts.map +1 -0
- package/dist/cli/commands/cron.js +250 -0
- package/dist/cli/commands/cron.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +25 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +618 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/encrypt-cmd.d.ts +12 -0
- package/dist/cli/commands/encrypt-cmd.d.ts.map +1 -0
- package/dist/cli/commands/encrypt-cmd.js +119 -0
- package/dist/cli/commands/encrypt-cmd.js.map +1 -0
- package/dist/cli/commands/exec-cmd.d.ts +55 -0
- package/dist/cli/commands/exec-cmd.d.ts.map +1 -0
- package/dist/cli/commands/exec-cmd.js +253 -0
- package/dist/cli/commands/exec-cmd.js.map +1 -0
- package/dist/cli/commands/gateway-install.d.ts +21 -0
- package/dist/cli/commands/gateway-install.d.ts.map +1 -0
- package/dist/cli/commands/gateway-install.js +71 -0
- package/dist/cli/commands/gateway-install.js.map +1 -0
- package/dist/cli/commands/gateway-supervise.d.ts +102 -0
- package/dist/cli/commands/gateway-supervise.d.ts.map +1 -0
- package/dist/cli/commands/gateway-supervise.js +194 -0
- package/dist/cli/commands/gateway-supervise.js.map +1 -0
- package/dist/cli/commands/gateway.d.ts +58 -0
- package/dist/cli/commands/gateway.d.ts.map +1 -0
- package/dist/cli/commands/gateway.js +497 -0
- package/dist/cli/commands/gateway.js.map +1 -0
- package/dist/cli/commands/logs.d.ts +14 -0
- package/dist/cli/commands/logs.d.ts.map +1 -0
- package/dist/cli/commands/logs.js +93 -0
- package/dist/cli/commands/logs.js.map +1 -0
- package/dist/cli/commands/mcp-cmd.d.ts +4 -0
- package/dist/cli/commands/mcp-cmd.d.ts.map +1 -0
- package/dist/cli/commands/mcp-cmd.js +30 -0
- package/dist/cli/commands/mcp-cmd.js.map +1 -0
- package/dist/cli/commands/onboard-config.d.ts +23 -0
- package/dist/cli/commands/onboard-config.d.ts.map +1 -0
- package/dist/cli/commands/onboard-config.js +33 -0
- package/dist/cli/commands/onboard-config.js.map +1 -0
- package/dist/cli/commands/onboard.d.ts +48 -0
- package/dist/cli/commands/onboard.d.ts.map +1 -0
- package/dist/cli/commands/onboard.js +397 -0
- package/dist/cli/commands/onboard.js.map +1 -0
- package/dist/cli/commands/org-cmd.d.ts +87 -0
- package/dist/cli/commands/org-cmd.d.ts.map +1 -0
- package/dist/cli/commands/org-cmd.js +394 -0
- package/dist/cli/commands/org-cmd.js.map +1 -0
- package/dist/cli/commands/org-cmd.templates.d.ts +66 -0
- package/dist/cli/commands/org-cmd.templates.d.ts.map +1 -0
- package/dist/cli/commands/org-cmd.templates.js +145 -0
- package/dist/cli/commands/org-cmd.templates.js.map +1 -0
- package/dist/cli/commands/org-slash.d.ts +107 -0
- package/dist/cli/commands/org-slash.d.ts.map +1 -0
- package/dist/cli/commands/org-slash.js +263 -0
- package/dist/cli/commands/org-slash.js.map +1 -0
- package/dist/cli/commands/pairing.d.ts +33 -0
- package/dist/cli/commands/pairing.d.ts.map +1 -0
- package/dist/cli/commands/pairing.js +155 -0
- package/dist/cli/commands/pairing.js.map +1 -0
- package/dist/cli/commands/secrets-audit.d.ts +17 -0
- package/dist/cli/commands/secrets-audit.d.ts.map +1 -0
- package/dist/cli/commands/secrets-audit.js +109 -0
- package/dist/cli/commands/secrets-audit.js.map +1 -0
- package/dist/cli/commands/sessions.d.ts +22 -0
- package/dist/cli/commands/sessions.d.ts.map +1 -0
- package/dist/cli/commands/sessions.js +99 -0
- package/dist/cli/commands/sessions.js.map +1 -0
- package/dist/cli/commands/skills.d.ts +17 -0
- package/dist/cli/commands/skills.d.ts.map +1 -0
- package/dist/cli/commands/skills.js +100 -0
- package/dist/cli/commands/skills.js.map +1 -0
- package/dist/cli/commands/status.d.ts +26 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +252 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/store-cmd.d.ts +36 -0
- package/dist/cli/commands/store-cmd.d.ts.map +1 -0
- package/dist/cli/commands/store-cmd.js +405 -0
- package/dist/cli/commands/store-cmd.js.map +1 -0
- package/dist/cli/flows/web-setup.d.ts +47 -0
- package/dist/cli/flows/web-setup.d.ts.map +1 -0
- package/dist/cli/flows/web-setup.js +324 -0
- package/dist/cli/flows/web-setup.js.map +1 -0
- package/dist/cli/program/build-program.d.ts +3 -0
- package/dist/cli/program/build-program.d.ts.map +1 -0
- package/dist/cli/program/build-program.js +1326 -0
- package/dist/cli/program/build-program.js.map +1 -0
- package/dist/cli/run-main.d.ts +2 -0
- package/dist/cli/run-main.d.ts.map +1 -0
- package/dist/cli/run-main.js +63 -0
- package/dist/cli/run-main.js.map +1 -0
- package/dist/config/agent-limits.d.ts +22 -0
- package/dist/config/agent-limits.d.ts.map +1 -0
- package/dist/config/agent-limits.js +34 -0
- package/dist/config/agent-limits.js.map +1 -0
- package/dist/config/io.d.ts +378 -0
- package/dist/config/io.d.ts.map +1 -0
- package/dist/config/io.js +602 -0
- package/dist/config/io.js.map +1 -0
- package/dist/config/paths.d.ts +80 -0
- package/dist/config/paths.d.ts.map +1 -0
- package/dist/config/paths.js +342 -0
- package/dist/config/paths.js.map +1 -0
- package/dist/config/types.d.ts +12 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +12 -0
- package/dist/config/types.js.map +1 -0
- package/dist/core/agent-dispatcher.d.ts +91 -0
- package/dist/core/agent-dispatcher.d.ts.map +1 -0
- package/dist/core/agent-dispatcher.js +251 -0
- package/dist/core/agent-dispatcher.js.map +1 -0
- package/dist/core/agent-events-stream.d.ts +76 -0
- package/dist/core/agent-events-stream.d.ts.map +1 -0
- package/dist/core/agent-events-stream.js +185 -0
- package/dist/core/agent-events-stream.js.map +1 -0
- package/dist/core/agent-runtime-persist.d.ts +53 -0
- package/dist/core/agent-runtime-persist.d.ts.map +1 -0
- package/dist/core/agent-runtime-persist.js +114 -0
- package/dist/core/agent-runtime-persist.js.map +1 -0
- package/dist/core/auth-bridge.d.ts +8 -0
- package/dist/core/auth-bridge.d.ts.map +1 -0
- package/dist/core/auth-bridge.js +102 -0
- package/dist/core/auth-bridge.js.map +1 -0
- package/dist/core/auth-error.d.ts +49 -0
- package/dist/core/auth-error.d.ts.map +1 -0
- package/dist/core/auth-error.js.map +1 -0
- package/dist/core/brigade-config.d.ts +205 -0
- package/dist/core/brigade-config.d.ts.map +1 -0
- package/dist/core/brigade-config.js +58 -6
- package/dist/core/brigade-config.js.map +1 -0
- package/dist/core/config.d.ts +17 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +92 -246
- package/dist/core/config.js.map +1 -0
- package/dist/core/console-stream.d.ts +52 -0
- package/dist/core/console-stream.d.ts.map +1 -0
- package/dist/core/console-stream.js +49 -3
- package/dist/core/console-stream.js.map +1 -0
- package/dist/core/daemon/launchd.d.ts +19 -0
- package/dist/core/daemon/launchd.d.ts.map +1 -0
- package/dist/core/daemon/launchd.js +117 -0
- package/dist/core/daemon/launchd.js.map +1 -0
- package/dist/core/daemon/schtasks.d.ts +23 -0
- package/dist/core/daemon/schtasks.d.ts.map +1 -0
- package/dist/core/daemon/schtasks.js +139 -0
- package/dist/core/daemon/schtasks.js.map +1 -0
- package/dist/core/daemon/service.d.ts +56 -0
- package/dist/core/daemon/service.d.ts.map +1 -0
- package/dist/core/daemon/service.js +54 -0
- package/dist/core/daemon/service.js.map +1 -0
- package/dist/core/daemon/systemd.d.ts +19 -0
- package/dist/core/daemon/systemd.d.ts.map +1 -0
- package/dist/core/daemon/systemd.js +117 -0
- package/dist/core/daemon/systemd.js.map +1 -0
- package/dist/core/event-logger.d.ts +74 -0
- package/dist/core/event-logger.d.ts.map +1 -0
- package/dist/core/event-logger.js +299 -6
- package/dist/core/event-logger.js.map +1 -0
- package/dist/core/exec-approvals.d.ts +178 -0
- package/dist/core/exec-approvals.d.ts.map +1 -0
- package/dist/core/exec-approvals.js +591 -266
- package/dist/core/exec-approvals.js.map +1 -0
- package/dist/core/extension-lifecycle.d.ts +27 -0
- package/dist/core/extension-lifecycle.d.ts.map +1 -0
- package/dist/core/extension-lifecycle.js +45 -0
- package/dist/core/extension-lifecycle.js.map +1 -0
- package/dist/core/gateway-caller-impl.d.ts +42 -0
- package/dist/core/gateway-caller-impl.d.ts.map +1 -0
- package/dist/core/gateway-caller-impl.js +95 -0
- package/dist/core/gateway-caller-impl.js.map +1 -0
- package/dist/core/gateway-lock.d.ts +88 -0
- package/dist/core/gateway-lock.d.ts.map +1 -0
- package/dist/core/gateway-lock.js +204 -0
- package/dist/core/gateway-lock.js.map +1 -0
- package/dist/core/gateway-probe.d.ts +148 -0
- package/dist/core/gateway-probe.d.ts.map +1 -0
- package/dist/core/gateway-probe.js +319 -0
- package/dist/core/gateway-probe.js.map +1 -0
- package/dist/core/gateway-spawn.d.ts +40 -0
- package/dist/core/gateway-spawn.d.ts.map +1 -0
- package/dist/core/gateway-spawn.js +156 -0
- package/dist/core/gateway-spawn.js.map +1 -0
- package/dist/core/model-caps.d.ts +85 -0
- package/dist/core/model-caps.d.ts.map +1 -0
- package/dist/core/model-caps.js +88 -2
- package/dist/core/model-caps.js.map +1 -0
- package/dist/core/port-inspect.d.ts +37 -0
- package/dist/core/port-inspect.d.ts.map +1 -0
- package/dist/core/port-inspect.js +165 -0
- package/dist/core/port-inspect.js.map +1 -0
- package/dist/core/server-lanes.d.ts +25 -0
- package/dist/core/server-lanes.d.ts.map +1 -0
- package/dist/core/server-lanes.js +31 -0
- package/dist/core/server-lanes.js.map +1 -0
- package/dist/core/server-methods/cron.d.ts +104 -0
- package/dist/core/server-methods/cron.d.ts.map +1 -0
- package/dist/core/server-methods/cron.js +183 -0
- package/dist/core/server-methods/cron.js.map +1 -0
- package/dist/core/server-methods/health.d.ts +36 -0
- package/dist/core/server-methods/health.d.ts.map +1 -0
- package/dist/core/server-methods/health.js +51 -0
- package/dist/core/server-methods/health.js.map +1 -0
- package/dist/core/server-methods/org.d.ts +93 -0
- package/dist/core/server-methods/org.d.ts.map +1 -0
- package/dist/core/server-methods/org.js +95 -0
- package/dist/core/server-methods/org.js.map +1 -0
- package/dist/core/server-methods/sessions.d.ts +133 -0
- package/dist/core/server-methods/sessions.d.ts.map +1 -0
- package/dist/core/server-methods/sessions.js +209 -0
- package/dist/core/server-methods/sessions.js.map +1 -0
- package/dist/core/server.d.ts +46 -0
- package/dist/core/server.d.ts.map +1 -0
- package/dist/core/server.js +4716 -249
- package/dist/core/server.js.map +1 -0
- package/dist/core/system-prompt.d.ts +92 -0
- package/dist/core/system-prompt.d.ts.map +1 -0
- package/dist/core/system-prompt.js +180 -1584
- package/dist/core/system-prompt.js.map +1 -0
- package/dist/core/version.d.ts +4 -0
- package/dist/core/version.d.ts.map +1 -0
- package/dist/core/version.js +8 -13
- package/dist/core/version.js.map +1 -0
- package/dist/core/webhook-guards.d.ts +131 -0
- package/dist/core/webhook-guards.d.ts.map +1 -0
- package/dist/core/webhook-guards.js +283 -0
- package/dist/core/webhook-guards.js.map +1 -0
- package/dist/core/ws-subscription-filter.d.ts +9 -0
- package/dist/core/ws-subscription-filter.d.ts.map +1 -0
- package/dist/core/ws-subscription-filter.js +39 -0
- package/dist/core/ws-subscription-filter.js.map +1 -0
- package/dist/cron/active-service.d.ts +30 -0
- package/dist/cron/active-service.d.ts.map +1 -0
- package/dist/cron/active-service.js +48 -0
- package/dist/cron/active-service.js.map +1 -0
- package/dist/cron/isolated-agent/run-executor.d.ts +49 -0
- package/dist/cron/isolated-agent/run-executor.d.ts.map +1 -0
- package/dist/cron/isolated-agent/run-executor.js +343 -0
- package/dist/cron/isolated-agent/run-executor.js.map +1 -0
- package/dist/cron/isolated-agent/run.d.ts +27 -0
- package/dist/cron/isolated-agent/run.d.ts.map +1 -0
- package/dist/cron/isolated-agent/run.js +29 -0
- package/dist/cron/isolated-agent/run.js.map +1 -0
- package/dist/cron/normalize.d.ts +103 -0
- package/dist/cron/normalize.d.ts.map +1 -0
- package/dist/cron/normalize.js +376 -0
- package/dist/cron/normalize.js.map +1 -0
- package/dist/cron/parse.d.ts +27 -0
- package/dist/cron/parse.d.ts.map +1 -0
- package/dist/cron/parse.js +55 -0
- package/dist/cron/parse.js.map +1 -0
- package/dist/cron/reminder-context.d.ts +78 -0
- package/dist/cron/reminder-context.d.ts.map +1 -0
- package/dist/cron/reminder-context.js +167 -0
- package/dist/cron/reminder-context.js.map +1 -0
- package/dist/cron/run-log.d.ts +48 -0
- package/dist/cron/run-log.d.ts.map +1 -0
- package/dist/cron/run-log.js +225 -0
- package/dist/cron/run-log.js.map +1 -0
- package/dist/cron/schedule.d.ts +46 -0
- package/dist/cron/schedule.d.ts.map +1 -0
- package/dist/cron/schedule.js +144 -0
- package/dist/cron/schedule.js.map +1 -0
- package/dist/cron/service/jobs.d.ts +138 -0
- package/dist/cron/service/jobs.d.ts.map +1 -0
- package/dist/cron/service/jobs.js +370 -0
- package/dist/cron/service/jobs.js.map +1 -0
- package/dist/cron/service/locked.d.ts +46 -0
- package/dist/cron/service/locked.d.ts.map +1 -0
- package/dist/cron/service/locked.js +54 -0
- package/dist/cron/service/locked.js.map +1 -0
- package/dist/cron/service/ops.d.ts +124 -0
- package/dist/cron/service/ops.d.ts.map +1 -0
- package/dist/cron/service/ops.js +415 -0
- package/dist/cron/service/ops.js.map +1 -0
- package/dist/cron/service/state.d.ts +254 -0
- package/dist/cron/service/state.d.ts.map +1 -0
- package/dist/cron/service/state.js +50 -0
- package/dist/cron/service/state.js.map +1 -0
- package/dist/cron/service/store.d.ts +65 -0
- package/dist/cron/service/store.d.ts.map +1 -0
- package/dist/cron/service/store.js +350 -0
- package/dist/cron/service/store.js.map +1 -0
- package/dist/cron/service/timer.d.ts +113 -0
- package/dist/cron/service/timer.d.ts.map +1 -0
- package/dist/cron/service/timer.js +1081 -0
- package/dist/cron/service/timer.js.map +1 -0
- package/dist/cron/session-reaper.d.ts +62 -0
- package/dist/cron/session-reaper.d.ts.map +1 -0
- package/dist/cron/session-reaper.js +152 -0
- package/dist/cron/session-reaper.js.map +1 -0
- package/dist/cron/session-target.d.ts +56 -0
- package/dist/cron/session-target.d.ts.map +1 -0
- package/dist/cron/session-target.js +96 -0
- package/dist/cron/session-target.js.map +1 -0
- package/dist/cron/stagger.d.ts +34 -0
- package/dist/cron/stagger.d.ts.map +1 -0
- package/dist/cron/stagger.js +69 -0
- package/dist/cron/stagger.js.map +1 -0
- package/dist/cron/types.d.ts +287 -0
- package/dist/cron/types.d.ts.map +1 -0
- package/dist/cron/types.js +22 -0
- package/dist/cron/types.js.map +1 -0
- package/dist/cron/validate-timestamp.d.ts +33 -0
- package/dist/cron/validate-timestamp.d.ts.map +1 -0
- package/dist/cron/validate-timestamp.js +54 -0
- package/dist/cron/validate-timestamp.js.map +1 -0
- package/dist/entry.d.ts +2 -0
- package/dist/entry.d.ts.map +1 -0
- package/dist/entry.js +57 -0
- package/dist/entry.js.map +1 -0
- package/dist/extension-sdk.d.ts +28 -0
- package/dist/extension-sdk.d.ts.map +1 -0
- package/dist/extension-sdk.js +26 -0
- package/dist/extension-sdk.js.map +1 -0
- package/dist/identity/device.d.ts +19 -0
- package/dist/identity/device.d.ts.map +1 -0
- package/dist/identity/device.js +88 -0
- package/dist/identity/device.js.map +1 -0
- package/dist/infra/backoff.d.ts +24 -0
- package/dist/infra/backoff.d.ts.map +1 -0
- package/dist/infra/backoff.js +48 -0
- package/dist/infra/backoff.js.map +1 -0
- package/dist/infra/errors.d.ts +35 -0
- package/dist/infra/errors.d.ts.map +1 -0
- package/dist/infra/errors.js +54 -0
- package/dist/infra/errors.js.map +1 -0
- package/dist/infra/fs/atomic-rename.d.ts +31 -0
- package/dist/infra/fs/atomic-rename.d.ts.map +1 -0
- package/dist/infra/fs/atomic-rename.js +75 -0
- package/dist/infra/fs/atomic-rename.js.map +1 -0
- package/dist/infra/json-file.d.ts +25 -0
- package/dist/infra/json-file.d.ts.map +1 -0
- package/dist/infra/json-file.js +49 -0
- package/dist/infra/json-file.js.map +1 -0
- package/dist/infra/json-utf8-bytes.d.ts +14 -0
- package/dist/infra/json-utf8-bytes.d.ts.map +1 -0
- package/dist/infra/json-utf8-bytes.js +20 -0
- package/dist/infra/json-utf8-bytes.js.map +1 -0
- package/dist/infra/net/dns-pinning.d.ts +66 -0
- package/dist/infra/net/dns-pinning.d.ts.map +1 -0
- package/dist/infra/net/dns-pinning.js +128 -0
- package/dist/infra/net/dns-pinning.js.map +1 -0
- package/dist/infra/net/fetch-guard.d.ts +85 -0
- package/dist/infra/net/fetch-guard.d.ts.map +1 -0
- package/dist/infra/net/fetch-guard.js +439 -0
- package/dist/infra/net/fetch-guard.js.map +1 -0
- package/dist/infra/prototype-keys.d.ts +19 -0
- package/dist/infra/prototype-keys.d.ts.map +1 -0
- package/dist/infra/prototype-keys.js +22 -0
- package/dist/infra/prototype-keys.js.map +1 -0
- package/dist/integrations/ollama.d.ts +67 -0
- package/dist/integrations/ollama.d.ts.map +1 -0
- package/dist/integrations/ollama.js +53 -0
- package/dist/integrations/ollama.js.map +1 -0
- package/dist/integrations/provider-discovery.d.ts +66 -0
- package/dist/integrations/provider-discovery.d.ts.map +1 -0
- package/dist/integrations/provider-discovery.js +166 -0
- package/dist/integrations/provider-discovery.js.map +1 -0
- package/dist/logging/redact.d.ts +28 -0
- package/dist/logging/redact.d.ts.map +1 -0
- package/dist/logging/redact.js +51 -0
- package/dist/logging/redact.js.map +1 -0
- package/dist/logging/subsystem-logger.d.ts +77 -0
- package/dist/logging/subsystem-logger.d.ts.map +1 -0
- package/dist/logging/subsystem-logger.js +577 -0
- package/dist/logging/subsystem-logger.js.map +1 -0
- package/dist/logging/subsystem.d.ts +13 -0
- package/dist/logging/subsystem.d.ts.map +1 -0
- package/dist/logging/subsystem.js +12 -0
- package/dist/logging/subsystem.js.map +1 -0
- package/dist/process/command-queue.d.ts +152 -0
- package/dist/process/command-queue.d.ts.map +1 -0
- package/dist/process/command-queue.js +420 -0
- package/dist/process/command-queue.js.map +1 -0
- package/dist/process/lanes.d.ts +102 -0
- package/dist/process/lanes.d.ts.map +1 -0
- package/dist/process/lanes.js +117 -0
- package/dist/process/lanes.js.map +1 -0
- package/dist/process/session-lane.d.ts +31 -0
- package/dist/process/session-lane.d.ts.map +1 -0
- package/dist/process/session-lane.js +45 -0
- package/dist/process/session-lane.js.map +1 -0
- package/dist/protocol/errors.d.ts +35 -0
- package/dist/protocol/errors.d.ts.map +1 -0
- package/dist/protocol/errors.js +36 -0
- package/dist/protocol/errors.js.map +1 -0
- package/dist/protocol/handshake.d.ts +101 -0
- package/dist/protocol/handshake.d.ts.map +1 -0
- package/dist/protocol/handshake.js +49 -0
- package/dist/protocol/handshake.js.map +1 -0
- package/dist/protocol/messages.d.ts +68 -0
- package/dist/protocol/messages.d.ts.map +1 -0
- package/dist/protocol/messages.js +20 -0
- package/dist/protocol/messages.js.map +1 -0
- package/dist/protocol/methods.d.ts +312 -0
- package/dist/protocol/methods.d.ts.map +1 -0
- package/dist/protocol/methods.js +16 -0
- package/dist/protocol/methods.js.map +1 -0
- package/dist/protocol.d.ts +598 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +12 -0
- package/dist/protocol.js.map +1 -0
- package/dist/providers/auth-methods.d.ts +82 -0
- package/dist/providers/auth-methods.d.ts.map +1 -0
- package/dist/providers/auth-methods.js +180 -0
- package/dist/providers/auth-methods.js.map +1 -0
- package/dist/providers/catalog.d.ts +85 -0
- package/dist/providers/catalog.d.ts.map +1 -0
- package/dist/providers/catalog.js +41 -0
- package/dist/providers/catalog.js.map +1 -0
- package/dist/providers/validate-key.d.ts +42 -0
- package/dist/providers/validate-key.d.ts.map +1 -0
- package/dist/providers/validate-key.js.map +1 -0
- package/dist/security/external-content.d.ts +67 -0
- package/dist/security/external-content.d.ts.map +1 -0
- package/dist/security/external-content.js +80 -0
- package/dist/security/external-content.js.map +1 -0
- package/dist/security/injection-patterns.d.ts +33 -0
- package/dist/security/injection-patterns.d.ts.map +1 -0
- package/dist/security/injection-patterns.js +97 -0
- package/dist/security/injection-patterns.js.map +1 -0
- package/dist/security/media-path-guard.d.ts +25 -0
- package/dist/security/media-path-guard.d.ts.map +1 -0
- package/dist/security/media-path-guard.js +98 -0
- package/dist/security/media-path-guard.js.map +1 -0
- package/dist/security/terminal-input-sanitizer.d.ts +30 -0
- package/dist/security/terminal-input-sanitizer.d.ts.map +1 -0
- package/dist/security/terminal-input-sanitizer.js +70 -0
- package/dist/security/terminal-input-sanitizer.js.map +1 -0
- package/dist/sessions/bootstrap-marker.d.ts +5 -0
- package/dist/sessions/bootstrap-marker.d.ts.map +1 -0
- package/dist/sessions/bootstrap-marker.js +120 -0
- package/dist/sessions/bootstrap-marker.js.map +1 -0
- package/dist/sessions/session-file-repair.d.ts +12 -0
- package/dist/sessions/session-file-repair.d.ts.map +1 -0
- package/dist/sessions/session-file-repair.js +155 -0
- package/dist/sessions/session-file-repair.js.map +1 -0
- package/dist/sessions/session-key-utils.d.ts +54 -0
- package/dist/sessions/session-key-utils.d.ts.map +1 -0
- package/dist/sessions/session-key-utils.js +133 -0
- package/dist/sessions/session-key-utils.js.map +1 -0
- package/dist/sessions/session-manager-factory.d.ts +21 -0
- package/dist/sessions/session-manager-factory.d.ts.map +1 -0
- package/dist/sessions/session-manager-factory.js +142 -0
- package/dist/sessions/session-manager-factory.js.map +1 -0
- package/dist/sessions/session-store.d.ts +154 -0
- package/dist/sessions/session-store.d.ts.map +1 -0
- package/dist/sessions/session-store.js +498 -0
- package/dist/sessions/session-store.js.map +1 -0
- package/dist/sessions/session-write-lock.d.ts +10 -0
- package/dist/sessions/session-write-lock.d.ts.map +1 -0
- package/dist/sessions/session-write-lock.js +167 -0
- package/dist/sessions/session-write-lock.js.map +1 -0
- package/dist/sessions/transcript-reader.d.ts +37 -0
- package/dist/sessions/transcript-reader.d.ts.map +1 -0
- package/dist/sessions/transcript-reader.js +136 -0
- package/dist/sessions/transcript-reader.js.map +1 -0
- package/dist/sessions/transcript-repair.d.ts +16 -0
- package/dist/sessions/transcript-repair.d.ts.map +1 -0
- package/dist/sessions/transcript-repair.js +214 -0
- package/dist/sessions/transcript-repair.js.map +1 -0
- package/dist/shared/global-singleton.d.ts +27 -0
- package/dist/shared/global-singleton.d.ts.map +1 -0
- package/dist/shared/global-singleton.js +35 -0
- package/dist/shared/global-singleton.js.map +1 -0
- package/dist/shared/string-coerce.d.ts +12 -0
- package/dist/shared/string-coerce.d.ts.map +1 -0
- package/dist/shared/string-coerce.js +12 -0
- package/dist/shared/string-coerce.js.map +1 -0
- package/dist/storage/boot.d.ts +28 -0
- package/dist/storage/boot.d.ts.map +1 -0
- package/dist/storage/boot.js +588 -0
- package/dist/storage/boot.js.map +1 -0
- package/dist/storage/config-cache.d.ts +23 -0
- package/dist/storage/config-cache.d.ts.map +1 -0
- package/dist/storage/config-cache.js +58 -0
- package/dist/storage/config-cache.js.map +1 -0
- package/dist/storage/convex/auth-store.d.ts +52 -0
- package/dist/storage/convex/auth-store.d.ts.map +1 -0
- package/dist/storage/convex/auth-store.js +282 -0
- package/dist/storage/convex/auth-store.js.map +1 -0
- package/dist/storage/convex/blob-store.d.ts +20 -0
- package/dist/storage/convex/blob-store.d.ts.map +1 -0
- package/dist/storage/convex/blob-store.js +74 -0
- package/dist/storage/convex/blob-store.js.map +1 -0
- package/dist/storage/convex/channel-store.d.ts +112 -0
- package/dist/storage/convex/channel-store.d.ts.map +1 -0
- package/dist/storage/convex/channel-store.js +267 -0
- package/dist/storage/convex/channel-store.js.map +1 -0
- package/dist/storage/convex/client.d.ts +53 -0
- package/dist/storage/convex/client.d.ts.map +1 -0
- package/dist/storage/convex/client.js +121 -0
- package/dist/storage/convex/client.js.map +1 -0
- package/dist/storage/convex/config-store.d.ts +29 -0
- package/dist/storage/convex/config-store.d.ts.map +1 -0
- package/dist/storage/convex/config-store.js +205 -0
- package/dist/storage/convex/config-store.js.map +1 -0
- package/dist/storage/convex/cron-store.d.ts +86 -0
- package/dist/storage/convex/cron-store.d.ts.map +1 -0
- package/dist/storage/convex/cron-store.js +428 -0
- package/dist/storage/convex/cron-store.js.map +1 -0
- package/dist/storage/convex/exec-approval-store.d.ts +38 -0
- package/dist/storage/convex/exec-approval-store.d.ts.map +1 -0
- package/dist/storage/convex/exec-approval-store.js +147 -0
- package/dist/storage/convex/exec-approval-store.js.map +1 -0
- package/dist/storage/convex/extension-store.d.ts +28 -0
- package/dist/storage/convex/extension-store.d.ts.map +1 -0
- package/dist/storage/convex/extension-store.js +39 -0
- package/dist/storage/convex/extension-store.js.map +1 -0
- package/dist/storage/convex/index.d.ts +35 -0
- package/dist/storage/convex/index.d.ts.map +1 -0
- package/dist/storage/convex/index.js +141 -0
- package/dist/storage/convex/index.js.map +1 -0
- package/dist/storage/convex/instance-store.d.ts +37 -0
- package/dist/storage/convex/instance-store.d.ts.map +1 -0
- package/dist/storage/convex/instance-store.js +88 -0
- package/dist/storage/convex/instance-store.js.map +1 -0
- package/dist/storage/convex/log-store.d.ts +36 -0
- package/dist/storage/convex/log-store.d.ts.map +1 -0
- package/dist/storage/convex/log-store.js +213 -0
- package/dist/storage/convex/log-store.js.map +1 -0
- package/dist/storage/convex/memory-store.d.ts +50 -0
- package/dist/storage/convex/memory-store.d.ts.map +1 -0
- package/dist/storage/convex/memory-store.js +537 -0
- package/dist/storage/convex/memory-store.js.map +1 -0
- package/dist/storage/convex/message-store.d.ts +32 -0
- package/dist/storage/convex/message-store.d.ts.map +1 -0
- package/dist/storage/convex/message-store.js +272 -0
- package/dist/storage/convex/message-store.js.map +1 -0
- package/dist/storage/convex/org-store.d.ts +46 -0
- package/dist/storage/convex/org-store.d.ts.map +1 -0
- package/dist/storage/convex/org-store.js +101 -0
- package/dist/storage/convex/org-store.js.map +1 -0
- package/dist/storage/convex/session-store.d.ts +44 -0
- package/dist/storage/convex/session-store.d.ts.map +1 -0
- package/dist/storage/convex/session-store.js +257 -0
- package/dist/storage/convex/session-store.js.map +1 -0
- package/dist/storage/convex/skill-store.d.ts +49 -0
- package/dist/storage/convex/skill-store.d.ts.map +1 -0
- package/dist/storage/convex/skill-store.js +84 -0
- package/dist/storage/convex/skill-store.js.map +1 -0
- package/dist/storage/convex/subagent-store.d.ts +28 -0
- package/dist/storage/convex/subagent-store.d.ts.map +1 -0
- package/dist/storage/convex/subagent-store.js +83 -0
- package/dist/storage/convex/subagent-store.js.map +1 -0
- package/dist/storage/convex/workspace-store.d.ts +25 -0
- package/dist/storage/convex/workspace-store.d.ts.map +1 -0
- package/dist/storage/convex/workspace-store.js +127 -0
- package/dist/storage/convex/workspace-store.js.map +1 -0
- package/dist/storage/cron-cache.d.ts +17 -0
- package/dist/storage/cron-cache.d.ts.map +1 -0
- package/dist/storage/cron-cache.js +67 -0
- package/dist/storage/cron-cache.js.map +1 -0
- package/dist/storage/encryption.d.ts +69 -0
- package/dist/storage/encryption.d.ts.map +1 -0
- package/dist/storage/encryption.js +389 -0
- package/dist/storage/encryption.js.map +1 -0
- package/dist/storage/factory-reset.d.ts +7 -0
- package/dist/storage/factory-reset.d.ts.map +1 -0
- package/dist/storage/factory-reset.js +34 -0
- package/dist/storage/factory-reset.js.map +1 -0
- package/dist/storage/facts-cache.d.ts +24 -0
- package/dist/storage/facts-cache.d.ts.map +1 -0
- package/dist/storage/facts-cache.js +110 -0
- package/dist/storage/facts-cache.js.map +1 -0
- package/dist/storage/flush.d.ts +4 -0
- package/dist/storage/flush.d.ts.map +1 -0
- package/dist/storage/flush.js +128 -0
- package/dist/storage/flush.js.map +1 -0
- package/dist/storage/instance-admin.d.ts +52 -0
- package/dist/storage/instance-admin.d.ts.map +1 -0
- package/dist/storage/instance-admin.js +91 -0
- package/dist/storage/instance-admin.js.map +1 -0
- package/dist/storage/local/auth-store.d.ts +44 -0
- package/dist/storage/local/auth-store.d.ts.map +1 -0
- package/dist/storage/local/auth-store.js +252 -0
- package/dist/storage/local/auth-store.js.map +1 -0
- package/dist/storage/local/blob-store.d.ts +14 -0
- package/dist/storage/local/blob-store.d.ts.map +1 -0
- package/dist/storage/local/blob-store.js +87 -0
- package/dist/storage/local/blob-store.js.map +1 -0
- package/dist/storage/local/channel-store.d.ts +107 -0
- package/dist/storage/local/channel-store.d.ts.map +1 -0
- package/dist/storage/local/channel-store.js +147 -0
- package/dist/storage/local/channel-store.js.map +1 -0
- package/dist/storage/local/config-store.d.ts +23 -0
- package/dist/storage/local/config-store.d.ts.map +1 -0
- package/dist/storage/local/config-store.js +98 -0
- package/dist/storage/local/config-store.js.map +1 -0
- package/dist/storage/local/cron-store.d.ts +30 -0
- package/dist/storage/local/cron-store.d.ts.map +1 -0
- package/dist/storage/local/cron-store.js +186 -0
- package/dist/storage/local/cron-store.js.map +1 -0
- package/dist/storage/local/exec-approval-store.d.ts +41 -0
- package/dist/storage/local/exec-approval-store.d.ts.map +1 -0
- package/dist/storage/local/exec-approval-store.js +78 -0
- package/dist/storage/local/exec-approval-store.js.map +1 -0
- package/dist/storage/local/extension-store.d.ts +13 -0
- package/dist/storage/local/extension-store.d.ts.map +1 -0
- package/dist/storage/local/extension-store.js +36 -0
- package/dist/storage/local/extension-store.js.map +1 -0
- package/dist/storage/local/file-watcher.d.ts +24 -0
- package/dist/storage/local/file-watcher.d.ts.map +1 -0
- package/dist/storage/local/file-watcher.js +141 -0
- package/dist/storage/local/file-watcher.js.map +1 -0
- package/dist/storage/local/index.d.ts +33 -0
- package/dist/storage/local/index.d.ts.map +1 -0
- package/dist/storage/local/index.js +143 -0
- package/dist/storage/local/index.js.map +1 -0
- package/dist/storage/local/instance-store.d.ts +30 -0
- package/dist/storage/local/instance-store.d.ts.map +1 -0
- package/dist/storage/local/instance-store.js +83 -0
- package/dist/storage/local/instance-store.js.map +1 -0
- package/dist/storage/local/log-store.d.ts +27 -0
- package/dist/storage/local/log-store.d.ts.map +1 -0
- package/dist/storage/local/log-store.js +185 -0
- package/dist/storage/local/log-store.js.map +1 -0
- package/dist/storage/local/memory-store.d.ts +39 -0
- package/dist/storage/local/memory-store.d.ts.map +1 -0
- package/dist/storage/local/memory-store.js +258 -0
- package/dist/storage/local/memory-store.js.map +1 -0
- package/dist/storage/local/message-store.d.ts +27 -0
- package/dist/storage/local/message-store.d.ts.map +1 -0
- package/dist/storage/local/message-store.js +253 -0
- package/dist/storage/local/message-store.js.map +1 -0
- package/dist/storage/local/org-store.d.ts +39 -0
- package/dist/storage/local/org-store.d.ts.map +1 -0
- package/dist/storage/local/org-store.js +155 -0
- package/dist/storage/local/org-store.js.map +1 -0
- package/dist/storage/local/session-store.d.ts +30 -0
- package/dist/storage/local/session-store.d.ts.map +1 -0
- package/dist/storage/local/session-store.js +82 -0
- package/dist/storage/local/session-store.js.map +1 -0
- package/dist/storage/local/skill-store.d.ts +40 -0
- package/dist/storage/local/skill-store.d.ts.map +1 -0
- package/dist/storage/local/skill-store.js +121 -0
- package/dist/storage/local/skill-store.js.map +1 -0
- package/dist/storage/local/subagent-store.d.ts +20 -0
- package/dist/storage/local/subagent-store.d.ts.map +1 -0
- package/dist/storage/local/subagent-store.js +71 -0
- package/dist/storage/local/subagent-store.js.map +1 -0
- package/dist/storage/local/workspace-store.d.ts +22 -0
- package/dist/storage/local/workspace-store.d.ts.map +1 -0
- package/dist/storage/local/workspace-store.js +190 -0
- package/dist/storage/local/workspace-store.js.map +1 -0
- package/dist/storage/migrate.d.ts +64 -0
- package/dist/storage/migrate.d.ts.map +1 -0
- package/dist/storage/migrate.js +585 -0
- package/dist/storage/migrate.js.map +1 -0
- package/dist/storage/runtime-context.d.ts +35 -0
- package/dist/storage/runtime-context.d.ts.map +1 -0
- package/dist/storage/runtime-context.js +145 -0
- package/dist/storage/runtime-context.js.map +1 -0
- package/dist/storage/sentinel.d.ts +28 -0
- package/dist/storage/sentinel.d.ts.map +1 -0
- package/dist/storage/sentinel.js +98 -0
- package/dist/storage/sentinel.js.map +1 -0
- package/dist/storage/session-cache.d.ts +15 -0
- package/dist/storage/session-cache.d.ts.map +1 -0
- package/dist/storage/session-cache.js +81 -0
- package/dist/storage/session-cache.js.map +1 -0
- package/dist/storage/store.d.ts +745 -0
- package/dist/storage/store.d.ts.map +1 -0
- package/dist/storage/store.js +36 -0
- package/dist/storage/store.js.map +1 -0
- package/dist/storage/strict-guard.d.ts +17 -0
- package/dist/storage/strict-guard.d.ts.map +1 -0
- package/dist/storage/strict-guard.js +200 -0
- package/dist/storage/strict-guard.js.map +1 -0
- package/dist/storage/workspace-live-mirror.d.ts +33 -0
- package/dist/storage/workspace-live-mirror.d.ts.map +1 -0
- package/dist/storage/workspace-live-mirror.js +207 -0
- package/dist/storage/workspace-live-mirror.js.map +1 -0
- package/dist/system-prompt/assembler.d.ts +113 -0
- package/dist/system-prompt/assembler.d.ts.map +1 -0
- package/dist/system-prompt/assembler.js +649 -0
- package/dist/system-prompt/assembler.js.map +1 -0
- package/dist/system-prompt/bootstrap-budget.d.ts +22 -0
- package/dist/system-prompt/bootstrap-budget.d.ts.map +1 -0
- package/dist/system-prompt/bootstrap-budget.js +83 -0
- package/dist/system-prompt/bootstrap-budget.js.map +1 -0
- package/dist/system-prompt/cache-boundary.d.ts +13 -0
- package/dist/system-prompt/cache-boundary.d.ts.map +1 -0
- package/dist/system-prompt/cache-boundary.js +56 -0
- package/dist/system-prompt/cache-boundary.js.map +1 -0
- package/dist/system-prompt/cache-stability.d.ts +3 -0
- package/dist/system-prompt/cache-stability.d.ts.map +1 -0
- package/dist/system-prompt/cache-stability.js +18 -0
- package/dist/system-prompt/cache-stability.js.map +1 -0
- package/dist/system-prompt/guidance.d.ts +147 -0
- package/dist/system-prompt/guidance.d.ts.map +1 -0
- package/dist/system-prompt/guidance.js +352 -0
- package/dist/system-prompt/guidance.js.map +1 -0
- package/dist/system-prompt/identity-defaults.d.ts +50 -0
- package/dist/system-prompt/identity-defaults.d.ts.map +1 -0
- package/dist/system-prompt/identity-defaults.js +119 -0
- package/dist/system-prompt/identity-defaults.js.map +1 -0
- package/dist/system-prompt/org/escalation-inbox.d.ts +53 -0
- package/dist/system-prompt/org/escalation-inbox.d.ts.map +1 -0
- package/dist/system-prompt/org/escalation-inbox.js +71 -0
- package/dist/system-prompt/org/escalation-inbox.js.map +1 -0
- package/dist/system-prompt/org/receiver-hint.d.ts +72 -0
- package/dist/system-prompt/org/receiver-hint.d.ts.map +1 -0
- package/dist/system-prompt/org/receiver-hint.js +116 -0
- package/dist/system-prompt/org/receiver-hint.js.map +1 -0
- package/dist/system-prompt/org/render-org-block.d.ts +42 -0
- package/dist/system-prompt/org/render-org-block.d.ts.map +1 -0
- package/dist/system-prompt/org/render-org-block.js +57 -0
- package/dist/system-prompt/org/render-org-block.js.map +1 -0
- package/dist/system-prompt/org/sub-agent-anchor.d.ts +30 -0
- package/dist/system-prompt/org/sub-agent-anchor.d.ts.map +1 -0
- package/dist/system-prompt/org/sub-agent-anchor.js +36 -0
- package/dist/system-prompt/org/sub-agent-anchor.js.map +1 -0
- package/dist/system-prompt/override.d.ts +7 -0
- package/dist/system-prompt/override.d.ts.map +1 -0
- package/dist/system-prompt/override.js +13 -0
- package/dist/system-prompt/override.js.map +1 -0
- package/dist/system-prompt/pi-injection.d.ts +5 -0
- package/dist/system-prompt/pi-injection.d.ts.map +1 -0
- package/dist/system-prompt/pi-injection.js +33 -0
- package/dist/system-prompt/pi-injection.js.map +1 -0
- package/dist/system-prompt/runtime-params.d.ts +34 -0
- package/dist/system-prompt/runtime-params.d.ts.map +1 -0
- package/dist/system-prompt/runtime-params.js +108 -0
- package/dist/system-prompt/runtime-params.js.map +1 -0
- package/dist/system-prompt/sanitize.d.ts +7 -0
- package/dist/system-prompt/sanitize.d.ts.map +1 -0
- package/dist/system-prompt/sanitize.js +31 -0
- package/dist/system-prompt/sanitize.js.map +1 -0
- package/dist/system-prompt/types.d.ts +7 -0
- package/dist/system-prompt/types.d.ts.map +1 -0
- package/dist/system-prompt/types.js +3 -0
- package/dist/system-prompt/types.js.map +1 -0
- package/dist/system-prompt/workspace-loader.d.ts +12 -0
- package/dist/system-prompt/workspace-loader.d.ts.map +1 -0
- package/dist/system-prompt/workspace-loader.js +115 -0
- package/dist/system-prompt/workspace-loader.js.map +1 -0
- package/dist/tideline/advanced.d.ts +25 -0
- package/dist/tideline/advanced.d.ts.map +1 -0
- package/dist/tideline/advanced.js +34 -0
- package/dist/tideline/advanced.js.map +1 -0
- package/dist/tideline/eval.d.ts +19 -0
- package/dist/tideline/eval.d.ts.map +1 -0
- package/dist/tideline/eval.js +24 -0
- package/dist/tideline/eval.js.map +1 -0
- package/dist/tideline/host-ports.standalone.d.ts +49 -0
- package/dist/tideline/host-ports.standalone.d.ts.map +1 -0
- package/dist/tideline/host-ports.standalone.js +61 -0
- package/dist/tideline/host-ports.standalone.js.map +1 -0
- package/dist/tideline/index.d.ts +34 -0
- package/dist/tideline/index.d.ts.map +1 -0
- package/dist/tideline/index.js +42 -0
- package/dist/tideline/index.js.map +1 -0
- package/dist/tui/approval-prompt.d.ts +73 -0
- package/dist/tui/approval-prompt.d.ts.map +1 -0
- package/dist/tui/approval-prompt.js +272 -0
- package/dist/tui/approval-prompt.js.map +1 -0
- package/dist/tui/client.d.ts +89 -0
- package/dist/tui/client.d.ts.map +1 -0
- package/dist/tui/client.js.map +1 -0
- package/dist/ui/brand-frames-cli.d.ts +19 -0
- package/dist/ui/brand-frames-cli.d.ts.map +1 -0
- package/dist/ui/brand-frames-cli.js +8 -13
- package/dist/ui/brand-frames-cli.js.map +1 -0
- package/dist/ui/brand.d.ts +41 -0
- package/dist/ui/brand.d.ts.map +1 -0
- package/dist/ui/brand.js +28 -6
- package/dist/ui/brand.js.map +1 -0
- package/dist/ui/editor.d.ts +30 -0
- package/dist/ui/editor.d.ts.map +1 -0
- package/dist/ui/editor.js +73 -0
- package/dist/ui/editor.js.map +1 -0
- package/dist/ui/format-session.d.ts +68 -0
- package/dist/ui/format-session.d.ts.map +1 -0
- package/dist/ui/format-session.js +181 -0
- package/dist/ui/format-session.js.map +1 -0
- package/dist/ui/markdown.d.ts +48 -0
- package/dist/ui/markdown.d.ts.map +1 -0
- package/dist/ui/markdown.js +60 -0
- package/dist/ui/markdown.js.map +1 -0
- package/dist/ui/onboard-storage-mode.d.ts +17 -0
- package/dist/ui/onboard-storage-mode.d.ts.map +1 -0
- package/dist/ui/onboard-storage-mode.js +638 -0
- package/dist/ui/onboard-storage-mode.js.map +1 -0
- package/dist/ui/onboarding.d.ts +97 -0
- package/dist/ui/onboarding.d.ts.map +1 -0
- package/dist/ui/onboarding.js +259 -111
- package/dist/ui/onboarding.js.map +1 -0
- package/dist/ui/searchable-select.d.ts +48 -0
- package/dist/ui/searchable-select.d.ts.map +1 -0
- package/dist/ui/searchable-select.js +108 -0
- package/dist/ui/searchable-select.js.map +1 -0
- package/dist/ui/syntax-theme.d.ts +30 -0
- package/dist/ui/syntax-theme.d.ts.map +1 -0
- package/dist/ui/syntax-theme.js +72 -0
- package/dist/ui/syntax-theme.js.map +1 -0
- package/dist/ui/terminal-cleanup.d.ts +46 -0
- package/dist/ui/terminal-cleanup.d.ts.map +1 -0
- package/dist/ui/terminal-cleanup.js +17 -5
- package/dist/ui/terminal-cleanup.js.map +1 -0
- package/dist/ui/theme.d.ts +21 -0
- package/dist/ui/theme.d.ts.map +1 -0
- package/dist/ui/theme.js +66 -2
- package/dist/ui/theme.js.map +1 -0
- package/dist/ui/tool-result.d.ts +47 -0
- package/dist/ui/tool-result.d.ts.map +1 -0
- package/dist/ui/tool-result.js +100 -0
- package/dist/ui/tool-result.js.map +1 -0
- package/dist/utils/delivery-context.d.ts +50 -0
- package/dist/utils/delivery-context.d.ts.map +1 -0
- package/dist/utils/delivery-context.js +82 -0
- package/dist/utils/delivery-context.js.map +1 -0
- package/dist/utils/message-channel.d.ts +60 -0
- package/dist/utils/message-channel.d.ts.map +1 -0
- package/dist/utils/message-channel.js +103 -0
- package/dist/utils/message-channel.js.map +1 -0
- package/dist/utils/string-coerce.d.ts +50 -0
- package/dist/utils/string-coerce.d.ts.map +1 -0
- package/dist/utils/string-coerce.js +101 -0
- package/dist/utils/string-coerce.js.map +1 -0
- package/dist/version.d.ts +20 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +54 -0
- package/dist/version.js.map +1 -0
- package/dist/workspace/bootstrap.d.ts +12 -0
- package/dist/workspace/bootstrap.d.ts.map +1 -0
- package/dist/workspace/bootstrap.js +123 -0
- package/dist/workspace/bootstrap.js.map +1 -0
- package/dist/workspace/fs-utils.d.ts +2 -0
- package/dist/workspace/fs-utils.d.ts.map +1 -0
- package/dist/workspace/fs-utils.js +14 -0
- package/dist/workspace/fs-utils.js.map +1 -0
- package/dist/workspace/git-init.d.ts +5 -0
- package/dist/workspace/git-init.d.ts.map +1 -0
- package/dist/workspace/git-init.js +71 -0
- package/dist/workspace/git-init.js.map +1 -0
- package/dist/workspace/state.d.ts +13 -0
- package/dist/workspace/state.d.ts.map +1 -0
- package/dist/workspace/state.js +128 -0
- package/dist/workspace/state.js.map +1 -0
- package/dist/workspace/template-loader.d.ts +15 -0
- package/dist/workspace/template-loader.d.ts.map +1 -0
- package/dist/workspace/template-loader.js +214 -0
- package/dist/workspace/template-loader.js.map +1 -0
- package/package.json +173 -68
- package/scripts/build-done.mjs +125 -0
- package/scripts/run-brigade.mjs +208 -0
- package/skills/1password/SKILL.md +70 -0
- package/skills/1password/references/cli-examples.md +29 -0
- package/skills/1password/references/get-started.md +17 -0
- package/skills/apple-notes/SKILL.md +77 -0
- package/skills/apple-reminders/SKILL.md +118 -0
- package/skills/bear-notes/SKILL.md +107 -0
- package/skills/blogwatcher/SKILL.md +69 -0
- package/skills/blucli/SKILL.md +47 -0
- package/skills/bluebubbles/SKILL.md +136 -0
- package/skills/camsnap/SKILL.md +45 -0
- package/skills/canvas/SKILL.md +204 -0
- package/skills/coding-agent/SKILL.md +316 -0
- package/skills/discord/SKILL.md +197 -0
- package/skills/eightctl/SKILL.md +50 -0
- package/skills/gemini/SKILL.md +43 -0
- package/skills/gh-issues/SKILL.md +885 -0
- package/skills/gifgrep/SKILL.md +79 -0
- package/skills/git-commit/SKILL.md +40 -0
- package/skills/github/SKILL.md +163 -0
- package/skills/gog/SKILL.md +116 -0
- package/skills/goplaces/SKILL.md +52 -0
- package/skills/healthcheck/SKILL.md +245 -0
- package/skills/himalaya/SKILL.md +257 -0
- package/skills/himalaya/references/configuration.md +184 -0
- package/skills/himalaya/references/message-composition.md +199 -0
- package/skills/imsg/SKILL.md +122 -0
- package/skills/lead-scout/SKILL.md +46 -0
- package/skills/mcporter/SKILL.md +61 -0
- package/skills/model-usage/SKILL.md +69 -0
- package/skills/nano-pdf/SKILL.md +38 -0
- package/skills/node-connect/SKILL.md +142 -0
- package/skills/notion/SKILL.md +174 -0
- package/skills/oauth-setup/SKILL.md +55 -0
- package/skills/obsidian/SKILL.md +81 -0
- package/skills/openai-whisper/SKILL.md +38 -0
- package/skills/openai-whisper-api/SKILL.md +62 -0
- package/skills/openai-whisper-api/scripts/transcribe.sh +88 -0
- package/skills/openhue/SKILL.md +112 -0
- package/skills/oracle/SKILL.md +125 -0
- package/skills/ordercli/SKILL.md +78 -0
- package/skills/peekaboo/SKILL.md +190 -0
- package/skills/sag/SKILL.md +87 -0
- package/skills/session-logs/SKILL.md +151 -0
- package/skills/share-skills/SKILL.md +72 -0
- package/skills/sherpa-onnx-tts/SKILL.md +109 -0
- package/skills/sherpa-onnx-tts/bin/sherpa-onnx-tts +178 -0
- package/skills/skill-creator/SKILL.md +372 -0
- package/skills/skill-creator/license.txt +202 -0
- package/skills/skill-creator/scripts/init_skill.py +378 -0
- package/skills/skill-creator/scripts/package_skill.py +139 -0
- package/skills/skill-creator/scripts/quick_validate.py +159 -0
- package/skills/skill-creator/scripts/test_package_skill.py +160 -0
- package/skills/skill-creator/scripts/test_quick_validate.py +72 -0
- package/skills/slack/SKILL.md +144 -0
- package/skills/songsee/SKILL.md +49 -0
- package/skills/sonoscli/SKILL.md +65 -0
- package/skills/spotify-player/SKILL.md +64 -0
- package/skills/summarize/SKILL.md +87 -0
- package/skills/taskflow/SKILL.md +149 -0
- package/skills/taskflow-inbox-triage/SKILL.md +119 -0
- package/skills/things-mac/SKILL.md +86 -0
- package/skills/tmux/SKILL.md +170 -0
- package/skills/tmux/scripts/find-sessions.sh +112 -0
- package/skills/tmux/scripts/wait-for-text.sh +83 -0
- package/skills/trello/SKILL.md +108 -0
- package/skills/video-frames/SKILL.md +46 -0
- package/skills/video-frames/scripts/frame.sh +81 -0
- package/skills/voice-call/SKILL.md +45 -0
- package/skills/wacli/SKILL.md +72 -0
- package/skills/weather/SKILL.md +129 -0
- package/skills/xurl/SKILL.md +461 -0
- package/templates/workspace/AGENTS.md +223 -0
- package/templates/workspace/BOOTSTRAP.md +64 -0
- package/templates/workspace/HEARTBEAT.md +15 -0
- package/templates/workspace/IDENTITY.md +31 -0
- package/templates/workspace/SOUL.md +47 -0
- package/templates/workspace/TOOLS.md +48 -0
- package/templates/workspace/USER.md +25 -0
- package/CHANGELOG.md +0 -48
- package/SECURITY.md +0 -208
- package/assets/brigade-wordmark.png +0 -0
- package/dist/cli/chat-cmd.js +0 -191
- package/dist/cli/config-cmd.js +0 -171
- package/dist/cli/connect-cmd.js +0 -487
- package/dist/cli/doctor-cmd.js +0 -387
- package/dist/cli/gateway-cmd.js +0 -155
- package/dist/cli.js +0 -328
- package/dist/core/agent.js +0 -1123
- package/dist/core/auth-label.js +0 -147
- package/dist/core/cli-error.js +0 -94
- package/dist/core/error-classifier.js +0 -354
- package/dist/core/provider-payload-mutators.js +0 -517
- package/dist/core/provider-quirks.js +0 -285
- package/dist/core/smart-compaction.js +0 -209
- package/dist/core/system-prompt-defaults.js +0 -264
- package/dist/core/system-prompt-guidance.js +0 -271
- package/dist/index.js +0 -32
- package/dist/ui/brand-frames.js +0 -36
- package/dist/ui/chat.js +0 -1008
|
@@ -0,0 +1,1081 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scheduler tick loop + per-job execution dispatch.
|
|
3
|
+
*
|
|
4
|
+
* Three pieces work together here:
|
|
5
|
+
*
|
|
6
|
+
* - **armTimer** — schedules the next `onTimer` call via `setTimeout`,
|
|
7
|
+
* clamped at `MAX_TIMER_DELAY_MS` (60 s) so process suspend / wall-clock
|
|
8
|
+
* skew can't leave us asleep past a missed fire. We use a fresh
|
|
9
|
+
* `setTimeout` each tick (not `setInterval`) so the scheduling is
|
|
10
|
+
* anchored to actual completion time, not nominal interval ticks.
|
|
11
|
+
*
|
|
12
|
+
* - **onTimer** — the tick handler. Walks the job list, finds whatever's
|
|
13
|
+
* due (or marginally past-due), spawns up to `maxConcurrentRuns`
|
|
14
|
+
* parallel `runDueJob` calls, then rearms the timer to the next wake
|
|
15
|
+
* time. A watchdog also rearms during long-running jobs so the timer
|
|
16
|
+
* can't stay disarmed indefinitely.
|
|
17
|
+
*
|
|
18
|
+
* - **runDueJob** — sets the `runningAtMs` marker, persists it, calls the
|
|
19
|
+
* injected `runIsolatedAgentJob` (or `enqueueSystemEvent` for main-
|
|
20
|
+
* session payloads), then applies the outcome via `applyJobResult`.
|
|
21
|
+
* Emits `started` + `finished` events for every fire. Writes a run-log
|
|
22
|
+
* entry on finish. Triggers failure-alert if the consecutive-error
|
|
23
|
+
* count crosses the configured threshold.
|
|
24
|
+
*
|
|
25
|
+
* The startup catchup (`runMissedJobs`) is invoked separately by `ops.start`
|
|
26
|
+
* — it's a one-shot at-restart sweep, not part of the tick loop.
|
|
27
|
+
*/
|
|
28
|
+
import { withPerInstanceLock } from "./locked.js";
|
|
29
|
+
import { parseSessionRetention, reapIsolatedCronSessions, shouldRunSweep, } from "../session-reaper.js";
|
|
30
|
+
import { DEFAULT_AGENT_ID } from "../../config/paths.js";
|
|
31
|
+
import { getLastChannelForAgent } from "../../agents/channels/last-channel.js";
|
|
32
|
+
import { ensureLoaded, persist } from "./store.js";
|
|
33
|
+
import { applyJobResult, computeJobNextRunAtMs, errorBackoffMs, normalizeJobTickState, recordScheduleComputeError, } from "./jobs.js";
|
|
34
|
+
import { appendCronRunLog } from "../run-log.js";
|
|
35
|
+
/**
|
|
36
|
+
* Anti-drift clamp on the timer delay. This is ALSO the cron's own
|
|
37
|
+
* always-on heartbeat cadence: the scheduler wakes up at least every
|
|
38
|
+
* 30 seconds regardless of whether any agent has `heartbeat.intervalMs`
|
|
39
|
+
* configured. Cron MUST NOT depend on the agent heartbeat scheduler — if
|
|
40
|
+
* an operator runs Brigade with no heartbeat interval set, `wakeMode:
|
|
41
|
+
* "next-heartbeat"` system events would otherwise wait forever.
|
|
42
|
+
*
|
|
43
|
+
* Why 30 s (not 60 s): a 60-second worst-case for `wakeMode: "now"`
|
|
44
|
+
* crons feels laggy when the operator says "ping me in a minute".
|
|
45
|
+
* 30 s halves that perceived latency while keeping the timer cost
|
|
46
|
+
* negligible (one `setTimeout` per 30 s, no I/O on a quiet tick).
|
|
47
|
+
*/
|
|
48
|
+
export const MAX_TIMER_DELAY_MS = 30_000;
|
|
49
|
+
/** Spin-loop safety net — if the calculated delay rounds to 0, fall back to this. */
|
|
50
|
+
export const MIN_REFIRE_GAP_MS = 2_000;
|
|
51
|
+
/** How long to wait between watchdog-driven rearms during execution. */
|
|
52
|
+
const RUNNING_RECHECK_INTERVAL_MS = 60_000;
|
|
53
|
+
/**
|
|
54
|
+
* Threshold for surfacing "the next tick fired much later than we asked".
|
|
55
|
+
* If the actual delay between arming and firing exceeds the requested delay
|
|
56
|
+
* by MORE than this, it almost certainly means the host slept / suspended
|
|
57
|
+
* (laptop closed overnight, container paused, VM frozen). Logged so the
|
|
58
|
+
* operator can correlate missed crons with the underlying suspend instead
|
|
59
|
+
* of chasing a phantom scheduler bug. 60s gives normal scheduling jitter
|
|
60
|
+
* room to breathe (a backed-up event loop can land a tick a few seconds
|
|
61
|
+
* late under load) while still catching real multi-minute / multi-hour
|
|
62
|
+
* sleep events.
|
|
63
|
+
*/
|
|
64
|
+
const TICK_SKEW_THRESHOLD_MS = 60_000;
|
|
65
|
+
/**
|
|
66
|
+
* Per-execution wall-clock cap when the job didn't specify
|
|
67
|
+
* `payload.timeoutSeconds`. 60 seconds matches the reference's default and is well
|
|
68
|
+
* above the slow-path tail of every realistic cron run (a reminder "say
|
|
69
|
+
* hi" turn is sub-5s; even a research cron firing a web-search + reply
|
|
70
|
+
* sits under 30s). Long-running crons MUST opt in by setting
|
|
71
|
+
* `payload.timeoutSeconds` explicitly — that way a typo'd or runaway run
|
|
72
|
+
* doesn't pin the per-instance lock for fifteen minutes the way it used
|
|
73
|
+
* to.
|
|
74
|
+
*/
|
|
75
|
+
const DEFAULT_EXECUTION_TIMEOUT_MS = 60_000;
|
|
76
|
+
/**
|
|
77
|
+
* Wall-clock cap on the announce-delivery network send.
|
|
78
|
+
*
|
|
79
|
+
* The post-run result-apply runs under the per-instance lock (store
|
|
80
|
+
* consistency — see `runDueJob`). The announce dispatcher
|
|
81
|
+
* (`deps.deliverCronAnnounce`) is the one piece of that section that does
|
|
82
|
+
* NETWORK I/O: it hands the model's reply to a channel adapter's outbound
|
|
83
|
+
* (a WhatsApp socket send, a Slack/Telegram HTTP POST). A health pre-flight
|
|
84
|
+
* gate on the dispatcher side fast-refuses an adapter that's known-down, but
|
|
85
|
+
* `health()` is a cached best-effort probe — it does not guarantee an
|
|
86
|
+
* in-flight send completes. A send that passes the gate and then stalls
|
|
87
|
+
* mid-flight (an HTTP POST that never responds, a socket whose cached health
|
|
88
|
+
* bool went stale) would pin the per-instance lock for the full stall and
|
|
89
|
+
* block every concurrent `cron add` / `cron list` / `cron update` queued on
|
|
90
|
+
* the same instance — a smaller instance of exactly the anti-pattern the
|
|
91
|
+
* "model call stays OUTSIDE the lock" design (see `onTimer` Phase A/B) was
|
|
92
|
+
* built to avoid.
|
|
93
|
+
*
|
|
94
|
+
* 8 seconds is far above a healthy channel send's round-trip (sub-second for
|
|
95
|
+
* a WhatsApp/Slack outbound) while capping the worst-case lock-hold so a
|
|
96
|
+
* stalled adapter can't wedge the cron store. On timeout the send is treated
|
|
97
|
+
* as a non-delivery — the awareness fallback still fires and
|
|
98
|
+
* `lastDeliveryStatus` / `lastDeliveryError` record the stall, identical to
|
|
99
|
+
* the dispatcher returning `false`.
|
|
100
|
+
*/
|
|
101
|
+
const ANNOUNCE_DISPATCH_TIMEOUT_MS = 8_000;
|
|
102
|
+
/** Compute the minimum next-fire across all enabled jobs. `undefined` = no work pending. */
|
|
103
|
+
export function nextWakeAtMs(state) {
|
|
104
|
+
let earliest;
|
|
105
|
+
for (const job of state.store.jobs) {
|
|
106
|
+
if (!job.enabled)
|
|
107
|
+
continue;
|
|
108
|
+
const next = job.state.nextRunAtMs;
|
|
109
|
+
if (next === undefined)
|
|
110
|
+
continue;
|
|
111
|
+
if (job.state.runningAtMs !== undefined)
|
|
112
|
+
continue;
|
|
113
|
+
if (earliest === undefined || next < earliest)
|
|
114
|
+
earliest = next;
|
|
115
|
+
}
|
|
116
|
+
return earliest;
|
|
117
|
+
}
|
|
118
|
+
/** Cancel any pending scheduler timer. Safe to call when no timer is armed. */
|
|
119
|
+
export function stopTimer(state) {
|
|
120
|
+
if (state.timer) {
|
|
121
|
+
clearTimeout(state.timer);
|
|
122
|
+
state.timer = null;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Schedule the next `onTimer` call. Idempotent — cancels any previous timer
|
|
127
|
+
* before scheduling the new one so multiple `armTimer` calls don't pile up.
|
|
128
|
+
*
|
|
129
|
+
* Cron owns its OWN tick — `setTimeout` driven, capped at
|
|
130
|
+
* `MAX_TIMER_DELAY_MS` (30 s). It is COMPLETELY INDEPENDENT of the agent
|
|
131
|
+
* heartbeat scheduler. Even if no agent has `heartbeat.intervalMs` set,
|
|
132
|
+
* the cron tick still fires every 30 s, drains pending wake intents, and
|
|
133
|
+
* picks up `wakeMode: "next-heartbeat"` system-event crons. Without this
|
|
134
|
+
* decoupling, an install with zero agent-heartbeat config would leave
|
|
135
|
+
* `next-heartbeat` crons stuck in the enqueue queue forever.
|
|
136
|
+
*/
|
|
137
|
+
export function armTimer(state) {
|
|
138
|
+
stopTimer(state);
|
|
139
|
+
if (state.config.enabled === false)
|
|
140
|
+
return;
|
|
141
|
+
const now = state.deps.nowMs();
|
|
142
|
+
const next = nextWakeAtMs(state);
|
|
143
|
+
let delay = next === undefined ? MAX_TIMER_DELAY_MS : Math.max(0, next - now);
|
|
144
|
+
delay = Math.min(delay, MAX_TIMER_DELAY_MS);
|
|
145
|
+
// Floor delay==0 to MIN_REFIRE_GAP_MS so a stuck `runningAtMs` + past-due
|
|
146
|
+
// `nextRunAtMs` pair cannot cause a setTimeout(0) hot-loop. The tick that
|
|
147
|
+
// just ran couldn't collect the past-due job (runningAtMs blocks it), so
|
|
148
|
+
// rearming with delay=0 would re-enter onTimer immediately, do nothing,
|
|
149
|
+
// rearm with delay=0 again, ad infinitum — pinning a CPU core until the
|
|
150
|
+
// 2-hour STUCK_RUN_MS sweep clears the marker. MIN_REFIRE_GAP_MS=2s gives
|
|
151
|
+
// the watchdog room to act without saturating the loop.
|
|
152
|
+
if (delay === 0)
|
|
153
|
+
delay = MIN_REFIRE_GAP_MS;
|
|
154
|
+
// Record the arm in `state` so the next `onTimer` can compute actual-vs-
|
|
155
|
+
// expected delay and surface clock-skew / host-suspend events. Captured
|
|
156
|
+
// BEFORE `setTimeout` so a race where the timer fires immediately still
|
|
157
|
+
// sees populated fields.
|
|
158
|
+
state.lastTickArmedAt = now;
|
|
159
|
+
state.lastTickExpectedDelayMs = delay;
|
|
160
|
+
state.timer = setTimeout(() => {
|
|
161
|
+
void onTimer(state);
|
|
162
|
+
}, delay);
|
|
163
|
+
// Don't keep the event loop alive solely for the cron timer — the
|
|
164
|
+
// gateway daemon has its own keepalive (HTTP server). Standalone CLI
|
|
165
|
+
// invocations want the process to exit when their work is done.
|
|
166
|
+
if (typeof state.timer.unref === "function")
|
|
167
|
+
state.timer.unref();
|
|
168
|
+
}
|
|
169
|
+
/** Watchdog: re-arm the timer even while a long job is running. */
|
|
170
|
+
function armRunningRecheckTimer(state) {
|
|
171
|
+
stopTimer(state);
|
|
172
|
+
state.timer = setTimeout(() => {
|
|
173
|
+
if (!state.running) {
|
|
174
|
+
void onTimer(state);
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
armRunningRecheckTimer(state);
|
|
178
|
+
}, RUNNING_RECHECK_INTERVAL_MS);
|
|
179
|
+
if (typeof state.timer.unref === "function")
|
|
180
|
+
state.timer.unref();
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* One tick of the scheduler. Always re-arms before returning.
|
|
184
|
+
*
|
|
185
|
+
* Lifecycle: load fresh from disk → normalize every job's tick-state →
|
|
186
|
+
* collect runnables (within concurrency budget) → spawn them in parallel
|
|
187
|
+
* → wait for all → recompute next-fire → persist → rearm.
|
|
188
|
+
*/
|
|
189
|
+
export async function onTimer(state) {
|
|
190
|
+
if (state.running)
|
|
191
|
+
return; // re-entry guard (shouldn't happen, but cheap)
|
|
192
|
+
// Clock-skew / host-suspend detection — surfaces "the OS slept, we're
|
|
193
|
+
// waking up well past our scheduled fire" events to the log so a missed
|
|
194
|
+
// 09:00 reminder after an overnight laptop sleep doesn't look like a
|
|
195
|
+
// scheduler bug. Computed against `lastTickArmedAt` captured by the
|
|
196
|
+
// PREVIOUS `armTimer` call, so the first tick (no prior arm) never
|
|
197
|
+
// reports a skew. We compute BEFORE setting `running=true` so the
|
|
198
|
+
// observation is still logged on a re-entry race (rare, but cheap).
|
|
199
|
+
if (state.lastTickArmedAt !== undefined && state.lastTickExpectedDelayMs !== undefined) {
|
|
200
|
+
const armed = state.lastTickArmedAt;
|
|
201
|
+
const expected = state.lastTickExpectedDelayMs;
|
|
202
|
+
const actual = state.deps.nowMs() - armed;
|
|
203
|
+
const skewMs = actual - expected;
|
|
204
|
+
if (skewMs >= TICK_SKEW_THRESHOLD_MS) {
|
|
205
|
+
state.deps.log.warn("cron tick fired much later than scheduled (host likely slept/suspended)", {
|
|
206
|
+
expectedDelayMs: expected,
|
|
207
|
+
actualDelayMs: actual,
|
|
208
|
+
skewMs,
|
|
209
|
+
thresholdMs: TICK_SKEW_THRESHOLD_MS,
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
state.running = true;
|
|
214
|
+
armRunningRecheckTimer(state);
|
|
215
|
+
try {
|
|
216
|
+
// Drain pending `next-heartbeat` wake intents BEFORE collecting due
|
|
217
|
+
// jobs. Every entry came from a previous tick's main-target cron
|
|
218
|
+
// whose `wakeMode === "next-heartbeat"`; this drain is the "next
|
|
219
|
+
// tick" semantic, max-30s-from-fire, that decouples cron from the
|
|
220
|
+
// per-agent heartbeat scheduler. We swap the queue array out first
|
|
221
|
+
// so wakes enqueued during this very tick (by jobs we run below)
|
|
222
|
+
// don't get drained immediately — they wait for the NEXT tick.
|
|
223
|
+
drainPendingHeartbeatWakes(state);
|
|
224
|
+
const now = state.deps.nowMs();
|
|
225
|
+
// Phase A — under the lock: ensureLoaded + maintenance + collect
|
|
226
|
+
// runnables + mark-running + persist. SHORT and CPU-bound — does NOT
|
|
227
|
+
// touch the model or any I/O slower than a JSON write. Releasing the
|
|
228
|
+
// lock between phases is critical so concurrent `cron add` /
|
|
229
|
+
// `cron list` / `cron update` calls don't queue behind a long
|
|
230
|
+
// isolated-turn model call (which can take 15 minutes per the
|
|
231
|
+
// timeout default). The lock is for STORE consistency, not for
|
|
232
|
+
// serialising the actual run.
|
|
233
|
+
let runnable = [];
|
|
234
|
+
await withPerInstanceLock(state.op, async () => {
|
|
235
|
+
await ensureLoaded(state);
|
|
236
|
+
let storeMutated = false;
|
|
237
|
+
// Maintenance pass: clear stuck runningAtMs, refresh stale nextRunAtMs.
|
|
238
|
+
for (let i = 0; i < state.store.jobs.length; i++) {
|
|
239
|
+
const job = state.store.jobs[i];
|
|
240
|
+
const normalized = normalizeJobTickState(job, now);
|
|
241
|
+
if (normalized.changed) {
|
|
242
|
+
state.store.jobs[i] = normalized.job;
|
|
243
|
+
storeMutated = true;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
runnable = collectRunnableJobs(state, now);
|
|
247
|
+
if (runnable.length === 0) {
|
|
248
|
+
if (storeMutated)
|
|
249
|
+
await persist(state);
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
// Mark every job-we're-about-to-run as `running` + persist BEFORE
|
|
253
|
+
// dispatching. If we crash mid-dispatch, the next startup will
|
|
254
|
+
// see the marker, treat it as stuck (after STUCK_RUN_MS), and
|
|
255
|
+
// clear it — no double-execution.
|
|
256
|
+
for (const job of runnable) {
|
|
257
|
+
const idx = state.store.jobs.findIndex((j) => j.id === job.id);
|
|
258
|
+
if (idx < 0)
|
|
259
|
+
continue;
|
|
260
|
+
state.store.jobs[idx] = {
|
|
261
|
+
...state.store.jobs[idx],
|
|
262
|
+
state: { ...state.store.jobs[idx].state, runningAtMs: now },
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
await persist(state);
|
|
266
|
+
});
|
|
267
|
+
// Phase B — OUTSIDE the lock: dispatch via a bounded worker pool so
|
|
268
|
+
// over-concurrent fires stay SEQUENCED (oldest-due first) within the
|
|
269
|
+
// same tick instead of dropping. Each `runDueJob` re-acquires its own
|
|
270
|
+
// per-instance lock for the brief result-apply persist after the run
|
|
271
|
+
// finishes — the SHORT critical section that needs serialisation. The
|
|
272
|
+
// 30-second-to-15-minute model call in between is NOT under the lock,
|
|
273
|
+
// so a `cron add` arriving mid-fire completes within milliseconds
|
|
274
|
+
// instead of blocking until the run finishes.
|
|
275
|
+
if (runnable.length > 0) {
|
|
276
|
+
const concurrency = Math.min(resolveRunConcurrency(state), runnable.length);
|
|
277
|
+
let cursor = 0;
|
|
278
|
+
const workers = Array.from({ length: concurrency }, async () => {
|
|
279
|
+
for (;;) {
|
|
280
|
+
const index = cursor++;
|
|
281
|
+
if (index >= runnable.length)
|
|
282
|
+
return;
|
|
283
|
+
const job = runnable[index];
|
|
284
|
+
await runDueJob(state, job, state.deps.nowMs());
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
await Promise.all(workers);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
finally {
|
|
291
|
+
// Session-reaper sweep — throttled to once per MIN_SWEEP_INTERVAL_MS
|
|
292
|
+
// (5 minutes) so the tick loop doesn't hammer the filesystem on
|
|
293
|
+
// every fire. Best-effort: a thrown sweep is caught + logged so it
|
|
294
|
+
// can't break the timer rearm below.
|
|
295
|
+
//
|
|
296
|
+
// Multi-agent: walk every distinct `job.agentId` in the store so a
|
|
297
|
+
// cron scheduled by a non-default agent gets its isolated-run
|
|
298
|
+
// transcripts pruned too. Always include `DEFAULT_AGENT_ID` so legacy
|
|
299
|
+
// jobs missing `agentId` (and the boot agent's surface) are still
|
|
300
|
+
// swept on a fresh install.
|
|
301
|
+
const sweepNow = state.deps.nowMs();
|
|
302
|
+
if (shouldRunSweep(state.lastReapAtMs, sweepNow)) {
|
|
303
|
+
const retentionMs = parseSessionRetention(state.config.sessionRetention);
|
|
304
|
+
if (retentionMs !== null && retentionMs > 0) {
|
|
305
|
+
const agentIds = new Set([DEFAULT_AGENT_ID]);
|
|
306
|
+
for (const job of state.store.jobs) {
|
|
307
|
+
if (typeof job.agentId === "string" && job.agentId.trim().length > 0) {
|
|
308
|
+
agentIds.add(job.agentId);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
for (const agentId of agentIds) {
|
|
312
|
+
try {
|
|
313
|
+
await reapIsolatedCronSessions({
|
|
314
|
+
agentId,
|
|
315
|
+
retentionMs,
|
|
316
|
+
nowMs: sweepNow,
|
|
317
|
+
log: state.deps.log,
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
catch (err) {
|
|
321
|
+
state.deps.log.warn("session reaper sweep threw", {
|
|
322
|
+
agentId,
|
|
323
|
+
error: err instanceof Error ? err.message : String(err),
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
state.lastReapAtMs = sweepNow;
|
|
329
|
+
}
|
|
330
|
+
state.running = false;
|
|
331
|
+
armTimer(state);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Resolve the effective max-concurrent-runs setting. Defaults to 4 so a
|
|
336
|
+
* burst of same-instant fires (a reminder + a "check status" cron sharing
|
|
337
|
+
* a 09:00 slot) all dispatch in parallel — the prior default of 1 caused
|
|
338
|
+
* losers to silently get pushed past their slot. Operators can still set
|
|
339
|
+
* `maxConcurrentRuns: 1` in `brigade.json` to opt back into single-file
|
|
340
|
+
* dispatch when their downstream provider can't handle parallel turns.
|
|
341
|
+
*/
|
|
342
|
+
export function resolveRunConcurrency(state) {
|
|
343
|
+
const raw = state.config.maxConcurrentRuns;
|
|
344
|
+
if (typeof raw !== "number" || !Number.isFinite(raw))
|
|
345
|
+
return 4;
|
|
346
|
+
return Math.max(1, Math.floor(raw));
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Find every job whose next-fire has arrived. Does NOT cap by the
|
|
350
|
+
* concurrency limit — the caller (`onTimer`) spawns a worker pool keyed by
|
|
351
|
+
* the concurrency limit so losers stay sequenced inside the SAME tick
|
|
352
|
+
* (oldest-due-first) instead of being dropped past their slot. Capping
|
|
353
|
+
* here used to silently advance the loser's `nextRunAtMs` on the very
|
|
354
|
+
* next maintenance pass (Bug #2).
|
|
355
|
+
*/
|
|
356
|
+
export function collectRunnableJobs(state, nowMs) {
|
|
357
|
+
const candidates = [];
|
|
358
|
+
for (const job of state.store.jobs) {
|
|
359
|
+
if (!job.enabled)
|
|
360
|
+
continue;
|
|
361
|
+
if (job.state.runningAtMs !== undefined)
|
|
362
|
+
continue;
|
|
363
|
+
const next = job.state.nextRunAtMs;
|
|
364
|
+
if (next === undefined)
|
|
365
|
+
continue;
|
|
366
|
+
if (next > nowMs)
|
|
367
|
+
continue;
|
|
368
|
+
candidates.push(job);
|
|
369
|
+
}
|
|
370
|
+
// Sort oldest-due-first so stale jobs run before fresh ones.
|
|
371
|
+
candidates.sort((a, b) => (a.state.nextRunAtMs ?? 0) - (b.state.nextRunAtMs ?? 0));
|
|
372
|
+
return candidates;
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Execute one job. Dispatches based on `sessionTarget`:
|
|
376
|
+
* - `"main"` → enqueue system event (parent operator session sees it).
|
|
377
|
+
* - other → call `runIsolatedAgentJob` dep with the job spec.
|
|
378
|
+
*
|
|
379
|
+
* Outcome path:
|
|
380
|
+
* - emit `started` event
|
|
381
|
+
* - run + capture outcome
|
|
382
|
+
* - apply outcome to job state (clears runningAtMs, sets nextRunAtMs +
|
|
383
|
+
* backoff for transient errors, disables for permanent / one-shot ok)
|
|
384
|
+
* - persist
|
|
385
|
+
* - emit `finished` event
|
|
386
|
+
* - append run-log entry
|
|
387
|
+
* - maybe send failure-alert
|
|
388
|
+
* - maybe delete one-shot
|
|
389
|
+
*/
|
|
390
|
+
export async function runDueJob(state, job, runAtMs) {
|
|
391
|
+
emit(state, { action: "started", jobId: job.id, runAtMs });
|
|
392
|
+
const startedAtMs = state.deps.nowMs();
|
|
393
|
+
const outcome = await executeJobCoreWithTimeout(state, job, runAtMs).catch((err) => ({
|
|
394
|
+
status: "error",
|
|
395
|
+
error: err instanceof Error ? err.message : String(err),
|
|
396
|
+
}));
|
|
397
|
+
const endedAtMs = state.deps.nowMs();
|
|
398
|
+
const execResult = {
|
|
399
|
+
status: outcome.status,
|
|
400
|
+
startedAtMs,
|
|
401
|
+
endedAtMs,
|
|
402
|
+
...(outcome.error !== undefined ? { error: outcome.error } : {}),
|
|
403
|
+
// Honour outcome-classified errorKind so a downstream runner (or the
|
|
404
|
+
// executor's own permanent-error matcher) can disable the job rather
|
|
405
|
+
// than retry on backoff. Defaults to `"transient"` when status is
|
|
406
|
+
// error and the runner didn't classify it.
|
|
407
|
+
errorKind: outcome.status === "error"
|
|
408
|
+
? (outcome.errorKind ?? "transient")
|
|
409
|
+
: undefined,
|
|
410
|
+
};
|
|
411
|
+
await withPerInstanceLock(state.op, async () => {
|
|
412
|
+
await ensureLoaded(state);
|
|
413
|
+
const idx = state.store.jobs.findIndex((j) => j.id === job.id);
|
|
414
|
+
if (idx < 0) {
|
|
415
|
+
// Job was deleted while running. Nothing to update.
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
const current = state.store.jobs[idx];
|
|
419
|
+
const { job: applied, deleteAfterApply } = applyJobResult(current, execResult);
|
|
420
|
+
if (deleteAfterApply) {
|
|
421
|
+
state.store.jobs.splice(idx, 1);
|
|
422
|
+
}
|
|
423
|
+
else {
|
|
424
|
+
state.store.jobs[idx] = applied;
|
|
425
|
+
}
|
|
426
|
+
await persist(state);
|
|
427
|
+
const finishedEvent = {
|
|
428
|
+
action: "finished",
|
|
429
|
+
jobId: job.id,
|
|
430
|
+
status: outcome.status,
|
|
431
|
+
...(outcome.error !== undefined ? { error: outcome.error } : {}),
|
|
432
|
+
...(outcome.summary !== undefined ? { summary: outcome.summary } : {}),
|
|
433
|
+
...(outcome.sessionId !== undefined ? { sessionId: outcome.sessionId } : {}),
|
|
434
|
+
...(outcome.sessionKey !== undefined ? { sessionKey: outcome.sessionKey } : {}),
|
|
435
|
+
...(outcome.model !== undefined ? { model: outcome.model } : {}),
|
|
436
|
+
...(outcome.provider !== undefined ? { provider: outcome.provider } : {}),
|
|
437
|
+
...(outcome.usage !== undefined ? { usage: outcome.usage } : {}),
|
|
438
|
+
runAtMs,
|
|
439
|
+
durationMs: endedAtMs - startedAtMs,
|
|
440
|
+
...(applied.state.nextRunAtMs !== undefined
|
|
441
|
+
? { nextRunAtMs: applied.state.nextRunAtMs }
|
|
442
|
+
: {}),
|
|
443
|
+
};
|
|
444
|
+
emit(state, finishedEvent);
|
|
445
|
+
const logEntry = {
|
|
446
|
+
ts: endedAtMs,
|
|
447
|
+
jobId: job.id,
|
|
448
|
+
action: "finished",
|
|
449
|
+
status: outcome.status,
|
|
450
|
+
...(outcome.error !== undefined ? { error: outcome.error } : {}),
|
|
451
|
+
...(outcome.summary !== undefined ? { summary: outcome.summary } : {}),
|
|
452
|
+
...(outcome.sessionId !== undefined ? { sessionId: outcome.sessionId } : {}),
|
|
453
|
+
...(outcome.sessionKey !== undefined ? { sessionKey: outcome.sessionKey } : {}),
|
|
454
|
+
runAtMs,
|
|
455
|
+
durationMs: endedAtMs - startedAtMs,
|
|
456
|
+
...(applied.state.nextRunAtMs !== undefined
|
|
457
|
+
? { nextRunAtMs: applied.state.nextRunAtMs }
|
|
458
|
+
: {}),
|
|
459
|
+
...(outcome.model !== undefined ? { model: outcome.model } : {}),
|
|
460
|
+
...(outcome.provider !== undefined ? { provider: outcome.provider } : {}),
|
|
461
|
+
...(outcome.usage !== undefined ? { usage: outcome.usage } : {}),
|
|
462
|
+
};
|
|
463
|
+
// Fire-and-forget — appendCronRunLog has its own internal error log.
|
|
464
|
+
void appendCronRunLog(logEntry, state.config.runLog);
|
|
465
|
+
// Announce delivery — surface the successful run's reply to the
|
|
466
|
+
// operator. Falls through silently for `mode !== "announce"` and for
|
|
467
|
+
// failures (those go through the failure-alert path below). Writes
|
|
468
|
+
// `lastDelivered` / `lastDeliveryStatus` / `lastDeliveryError` onto
|
|
469
|
+
// the job state under the same lock so a partially-failed delivery
|
|
470
|
+
// leaves an audit trail the operator can `cron list` to inspect.
|
|
471
|
+
//
|
|
472
|
+
// This MUST run even when `deleteAfterApply` is true. One-shot `at`
|
|
473
|
+
// reminders ("remind me to drink water in 5 minutes") default to
|
|
474
|
+
// `deleteAfterRun: true`, so the job was spliced out of the store
|
|
475
|
+
// above BEFORE we reach here — but delivering that reply is the WHOLE
|
|
476
|
+
// POINT of the reminder; the deletion is just post-fire cleanup.
|
|
477
|
+
// Gating delivery on `!deleteAfterApply` silently dropped the reply of
|
|
478
|
+
// EVERY default one-shot reminder on the floor: the isolated run
|
|
479
|
+
// produced "time to hydrate!" but it never reached WhatsApp, and the
|
|
480
|
+
// operator only got it after manually nudging the main session. The
|
|
481
|
+
// `idx2 >= 0` guard below makes the delivery-state write-back a no-op
|
|
482
|
+
// when the job was already deleted, so a deleted one-shot still
|
|
483
|
+
// delivers without trying to persist `lastDelivered` onto a row that
|
|
484
|
+
// no longer exists.
|
|
485
|
+
if (outcome.status === "ok") {
|
|
486
|
+
const deliveryResult = await maybeDeliverAnnounce(state, applied, outcome);
|
|
487
|
+
if (deliveryResult) {
|
|
488
|
+
const idx2 = state.store.jobs.findIndex((j) => j.id === job.id);
|
|
489
|
+
if (idx2 >= 0) {
|
|
490
|
+
state.store.jobs[idx2] = {
|
|
491
|
+
...state.store.jobs[idx2],
|
|
492
|
+
state: {
|
|
493
|
+
...state.store.jobs[idx2].state,
|
|
494
|
+
...(deliveryResult.delivered !== undefined
|
|
495
|
+
? { lastDelivered: deliveryResult.delivered }
|
|
496
|
+
: {}),
|
|
497
|
+
lastDeliveryStatus: deliveryResult.status,
|
|
498
|
+
...(deliveryResult.error !== undefined
|
|
499
|
+
? { lastDeliveryError: deliveryResult.error }
|
|
500
|
+
: { lastDeliveryError: undefined }),
|
|
501
|
+
},
|
|
502
|
+
};
|
|
503
|
+
await persist(state);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
// Failure-alert check
|
|
508
|
+
if (outcome.status === "error" && !deleteAfterApply) {
|
|
509
|
+
await maybeSendFailureAlert(state, applied, outcome.error ?? "unknown error", endedAtMs);
|
|
510
|
+
}
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
/**
|
|
514
|
+
* Deliver the run outcome's summary text to the operator if the job's
|
|
515
|
+
* `delivery.mode === "announce"`. Routes via the `deliverCronAnnounce`
|
|
516
|
+
* dep when wired (typically a channel adapter's outbound) and falls back
|
|
517
|
+
* to `enqueueSystemEvent` so a cron without an explicit channel target
|
|
518
|
+
* still surfaces somewhere the operator will see it.
|
|
519
|
+
*
|
|
520
|
+
* Returns a result describing what actually happened so the caller can
|
|
521
|
+
* persist `lastDelivered` / `lastDeliveryStatus` / `lastDeliveryError`
|
|
522
|
+
* on the job state — the operator's `cron list` then shows whether the
|
|
523
|
+
* most recent successful run's reply actually reached its target or hit
|
|
524
|
+
* a snag (e.g. the WhatsApp adapter was disconnected when the cron
|
|
525
|
+
* fired). Returns `null` when delivery wasn't requested at all (mode
|
|
526
|
+
* !== announce / empty summary), so the caller skips the state write.
|
|
527
|
+
*
|
|
528
|
+
* Best-effort by design: a delivery failure logs but does NOT change
|
|
529
|
+
* the job's `lastStatus`. The cron RAN — the bookkeeping that matters
|
|
530
|
+
* most is "did the agent complete its turn" — delivery is the soft
|
|
531
|
+
* suffix. When `delivery.bestEffort === true`, delivery errors are
|
|
532
|
+
* additionally muted from the diagnostic log (the operator opted in to
|
|
533
|
+
* "fire and forget" semantics; don't spam the log).
|
|
534
|
+
*
|
|
535
|
+
* The channel send is bounded by `ANNOUNCE_DISPATCH_TIMEOUT_MS` — this
|
|
536
|
+
* runs under the caller's per-instance lock, so a stalled adapter must
|
|
537
|
+
* not pin that lock indefinitely. A timed-out send is reported as a
|
|
538
|
+
* non-delivery (the awareness fallback still fires), never as a hang.
|
|
539
|
+
*/
|
|
540
|
+
async function maybeDeliverAnnounce(state, job, outcome) {
|
|
541
|
+
const delivery = job.delivery;
|
|
542
|
+
if (!delivery || delivery.mode !== "announce")
|
|
543
|
+
return null;
|
|
544
|
+
const summary = outcome.summary?.trim();
|
|
545
|
+
if (!summary) {
|
|
546
|
+
state.deps.log.info("cron announce skipped — empty reply summary", {
|
|
547
|
+
jobId: job.id,
|
|
548
|
+
});
|
|
549
|
+
return { status: "not-delivered", delivered: false, error: "empty reply summary" };
|
|
550
|
+
}
|
|
551
|
+
// The CHANNEL (WhatsApp/Slack/...) gets the model's reply VERBATIM — the
|
|
552
|
+
// recipient must never see internal [cron "name"] tagging. Only the
|
|
553
|
+
// operator's TUI awareness event (below) keeps the tag, so a firing can
|
|
554
|
+
// be told apart from the assistant's own lines in the operator console.
|
|
555
|
+
const channelText = summary;
|
|
556
|
+
const awarenessText = formatAnnounceText(job, summary);
|
|
557
|
+
// Last-channel fallback. When the operator (or the model) didn't set an
|
|
558
|
+
// explicit `delivery.channel/to` AND the turn that scheduled this cron
|
|
559
|
+
// had no channelContext (typical pure-TUI scheduling), the job lands
|
|
560
|
+
// with `{mode: "announce"}` and no target. Before falling all the way
|
|
561
|
+
// through to `enqueueSystemEvent`, look up the agent's most recently
|
|
562
|
+
// active channel — if WhatsApp / Slack / Telegram was the last surface
|
|
563
|
+
// the operator was on, the cron announces THERE. Without this the
|
|
564
|
+
// announce would land only in the TUI bubble + the next-prompt
|
|
565
|
+
// drain, and the operator on their phone would silently miss it.
|
|
566
|
+
let resolvedChannel = delivery.channel?.trim() || undefined;
|
|
567
|
+
let resolvedTo = delivery.to?.trim() || undefined;
|
|
568
|
+
let resolvedThreadId = delivery.threadId;
|
|
569
|
+
let resolvedAccountId = delivery.accountId;
|
|
570
|
+
if (!resolvedChannel || !resolvedTo) {
|
|
571
|
+
const agentId = job.agentId ?? DEFAULT_AGENT_ID;
|
|
572
|
+
const last = getLastChannelForAgent(agentId);
|
|
573
|
+
if (last) {
|
|
574
|
+
resolvedChannel ??= last.channelId;
|
|
575
|
+
resolvedTo ??= last.conversationId;
|
|
576
|
+
resolvedThreadId ??= last.threadId;
|
|
577
|
+
resolvedAccountId ??= last.accountId;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
const channel = resolvedChannel;
|
|
581
|
+
const to = resolvedTo;
|
|
582
|
+
const dispatcher = state.deps.deliverCronAnnounce;
|
|
583
|
+
const bestEffort = delivery.bestEffort === true;
|
|
584
|
+
let delivered = false;
|
|
585
|
+
let lastError;
|
|
586
|
+
if (dispatcher && channel && to) {
|
|
587
|
+
try {
|
|
588
|
+
// Bound the network send so a health-passing-but-stalled adapter
|
|
589
|
+
// can't pin the per-instance lock (this whole block runs under it
|
|
590
|
+
// in `runDueJob`). On timeout we treat the send as a non-delivery —
|
|
591
|
+
// `timedOut` flips `lastError` to a stall message below and the
|
|
592
|
+
// awareness fallback + `lastDeliveryStatus` write still run, exactly
|
|
593
|
+
// as they do when the dispatcher returns `false`.
|
|
594
|
+
const dispatch = dispatcher({
|
|
595
|
+
job,
|
|
596
|
+
text: channelText,
|
|
597
|
+
channel,
|
|
598
|
+
to,
|
|
599
|
+
...(resolvedAccountId ? { accountId: resolvedAccountId } : {}),
|
|
600
|
+
...(resolvedThreadId ? { threadId: resolvedThreadId } : {}),
|
|
601
|
+
});
|
|
602
|
+
let timeoutHandle;
|
|
603
|
+
let timedOut = false;
|
|
604
|
+
const timeoutGuard = new Promise((resolve) => {
|
|
605
|
+
timeoutHandle = setTimeout(() => {
|
|
606
|
+
timedOut = true;
|
|
607
|
+
resolve(false);
|
|
608
|
+
}, ANNOUNCE_DISPATCH_TIMEOUT_MS);
|
|
609
|
+
if (typeof timeoutHandle.unref === "function")
|
|
610
|
+
timeoutHandle.unref();
|
|
611
|
+
});
|
|
612
|
+
try {
|
|
613
|
+
delivered = await Promise.race([dispatch, timeoutGuard]);
|
|
614
|
+
}
|
|
615
|
+
finally {
|
|
616
|
+
if (timeoutHandle !== undefined)
|
|
617
|
+
clearTimeout(timeoutHandle);
|
|
618
|
+
}
|
|
619
|
+
if (timedOut) {
|
|
620
|
+
delivered = false;
|
|
621
|
+
lastError = `channel "${channel}" delivery timed out after ${ANNOUNCE_DISPATCH_TIMEOUT_MS}ms (adapter accepted the send but never completed)`;
|
|
622
|
+
// Swallow the still-pending dispatch's eventual settle so a late
|
|
623
|
+
// rejection doesn't surface as an unhandled rejection after the
|
|
624
|
+
// lock has already been released.
|
|
625
|
+
void Promise.resolve(dispatch).catch(() => undefined);
|
|
626
|
+
if (!bestEffort) {
|
|
627
|
+
state.deps.log.warn("cron announce dispatch timed out", {
|
|
628
|
+
jobId: job.id,
|
|
629
|
+
channel,
|
|
630
|
+
to,
|
|
631
|
+
timeoutMs: ANNOUNCE_DISPATCH_TIMEOUT_MS,
|
|
632
|
+
});
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
else if (!delivered) {
|
|
636
|
+
lastError = `channel "${channel}" dispatcher refused delivery (adapter not started, or recipient rejected)`;
|
|
637
|
+
if (!bestEffort) {
|
|
638
|
+
state.deps.log.warn("cron announce dispatcher returned false", {
|
|
639
|
+
jobId: job.id,
|
|
640
|
+
channel,
|
|
641
|
+
to,
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
catch (err) {
|
|
647
|
+
lastError = err instanceof Error ? err.message : String(err);
|
|
648
|
+
if (!bestEffort) {
|
|
649
|
+
state.deps.log.warn("cron announce dispatch threw", {
|
|
650
|
+
jobId: job.id,
|
|
651
|
+
channel,
|
|
652
|
+
to,
|
|
653
|
+
error: lastError,
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
// ALWAYS surface a TUI-visible awareness event so the operator's main
|
|
659
|
+
// session sees the cron fire, regardless of whether the channel-side
|
|
660
|
+
// delivery (WhatsApp / Slack / etc.) succeeded. Bug #4 — previously the
|
|
661
|
+
// `delivered=true` branch early-returned here and the operator's TUI
|
|
662
|
+
// silently missed the announce text whenever the channel dispatcher did
|
|
663
|
+
// its job. The TUI is THE operator console; cron firings must always be
|
|
664
|
+
// visible there, with a small `delivered`/`not-delivered` hint so the
|
|
665
|
+
// operator can tell whether the phone got the reminder too.
|
|
666
|
+
const enqueue = state.deps.enqueueSystemEvent;
|
|
667
|
+
if (enqueue) {
|
|
668
|
+
try {
|
|
669
|
+
enqueue({
|
|
670
|
+
text: awarenessText,
|
|
671
|
+
jobId: job.id,
|
|
672
|
+
jobName: job.name,
|
|
673
|
+
source: "cron",
|
|
674
|
+
delivered,
|
|
675
|
+
...(job.agentId !== undefined ? { agentId: job.agentId } : {}),
|
|
676
|
+
...(job.sessionKey !== undefined ? { sessionKey: job.sessionKey } : {}),
|
|
677
|
+
});
|
|
678
|
+
}
|
|
679
|
+
catch (err) {
|
|
680
|
+
const enqueueErr = err instanceof Error ? err.message : String(err);
|
|
681
|
+
if (!bestEffort) {
|
|
682
|
+
state.deps.log.warn("cron announce awareness enqueueSystemEvent threw", {
|
|
683
|
+
jobId: job.id,
|
|
684
|
+
error: enqueueErr,
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
// When channel-side ALSO failed, surface the enqueue error in the
|
|
688
|
+
// run-log so the operator can `cron list` and see "both surfaces
|
|
689
|
+
// fell through" rather than a misleading "delivered" tag.
|
|
690
|
+
if (!delivered) {
|
|
691
|
+
return {
|
|
692
|
+
status: "not-delivered",
|
|
693
|
+
delivered: false,
|
|
694
|
+
error: lastError ?? enqueueErr,
|
|
695
|
+
};
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
else if (!delivered && !bestEffort) {
|
|
700
|
+
state.deps.log.warn("cron announce had no usable delivery target (no channel + no enqueueSystemEvent dep)", { jobId: job.id, mode: delivery.mode, channel, to });
|
|
701
|
+
}
|
|
702
|
+
if (delivered) {
|
|
703
|
+
return { status: "delivered", delivered: true };
|
|
704
|
+
}
|
|
705
|
+
// Channel dispatch didn't land and the awareness fallback either was
|
|
706
|
+
// missing or threw. The system event itself counts as a successful
|
|
707
|
+
// delivery surface when it was enqueued — match the original semantics
|
|
708
|
+
// so `cron list` doesn't flash "not-delivered" red on what reached the
|
|
709
|
+
// operator's TUI.
|
|
710
|
+
if (enqueue) {
|
|
711
|
+
return { status: "delivered", delivered: true };
|
|
712
|
+
}
|
|
713
|
+
return {
|
|
714
|
+
status: "not-delivered",
|
|
715
|
+
delivered: false,
|
|
716
|
+
error: lastError ?? "no delivery surface available",
|
|
717
|
+
};
|
|
718
|
+
}
|
|
719
|
+
/**
|
|
720
|
+
* Build the operator-facing announce text. Prefixes the cron's name so the
|
|
721
|
+
* operator can tell announce messages from their own ongoing turn output
|
|
722
|
+
* (otherwise a system event injected mid-conversation reads like the
|
|
723
|
+
* assistant's own line).
|
|
724
|
+
*/
|
|
725
|
+
function formatAnnounceText(job, summary) {
|
|
726
|
+
const flat = summary.replace(/\s+/g, " ").trim();
|
|
727
|
+
const trimmed = flat.length <= 600 ? flat : `${flat.slice(0, 597)}…`;
|
|
728
|
+
return `[cron "${job.name}"] ${trimmed}`;
|
|
729
|
+
}
|
|
730
|
+
/**
|
|
731
|
+
* Execute the per-job timeout wrapper. Returns a `CronIsolatedRunOutcome`
|
|
732
|
+
* regardless of how the underlying call resolved/rejected.
|
|
733
|
+
*/
|
|
734
|
+
async function executeJobCoreWithTimeout(state, job, runAtMs) {
|
|
735
|
+
const timeoutMs = resolveJobTimeoutMs(job);
|
|
736
|
+
const timeoutController = new AbortController();
|
|
737
|
+
const timeoutHandle = setTimeout(() => {
|
|
738
|
+
timeoutController.abort(new Error(`cron job timed out after ${timeoutMs}ms`));
|
|
739
|
+
}, timeoutMs);
|
|
740
|
+
if (typeof timeoutHandle.unref === "function")
|
|
741
|
+
timeoutHandle.unref();
|
|
742
|
+
try {
|
|
743
|
+
return await executeJobCore(state, job, runAtMs, timeoutController.signal);
|
|
744
|
+
}
|
|
745
|
+
catch (err) {
|
|
746
|
+
if (timeoutController.signal.aborted) {
|
|
747
|
+
return {
|
|
748
|
+
status: "error",
|
|
749
|
+
error: `cron job timed out after ${timeoutMs}ms`,
|
|
750
|
+
};
|
|
751
|
+
}
|
|
752
|
+
throw err;
|
|
753
|
+
}
|
|
754
|
+
finally {
|
|
755
|
+
clearTimeout(timeoutHandle);
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
/** Dispatch based on session target. */
|
|
759
|
+
async function executeJobCore(state, job, runAtMs, abortSignal) {
|
|
760
|
+
if (job.sessionTarget === "main") {
|
|
761
|
+
// systemEvent payload — inject into main session. We don't WAIT for
|
|
762
|
+
// the agent's response; the cron's "outcome" is just whether the
|
|
763
|
+
// event was successfully enqueued.
|
|
764
|
+
if (job.payload.kind !== "systemEvent") {
|
|
765
|
+
return { status: "error", error: "invariant violated: main target without systemEvent payload" };
|
|
766
|
+
}
|
|
767
|
+
const enqueue = state.deps.enqueueSystemEvent;
|
|
768
|
+
if (!enqueue) {
|
|
769
|
+
return { status: "error", error: "no enqueueSystemEvent dep wired" };
|
|
770
|
+
}
|
|
771
|
+
try {
|
|
772
|
+
enqueue({
|
|
773
|
+
text: job.payload.text,
|
|
774
|
+
source: "cron",
|
|
775
|
+
jobId: job.id,
|
|
776
|
+
jobName: job.name,
|
|
777
|
+
...(job.agentId !== undefined ? { agentId: job.agentId } : {}),
|
|
778
|
+
...(job.sessionKey !== undefined ? { sessionKey: job.sessionKey } : {}),
|
|
779
|
+
});
|
|
780
|
+
if (job.wakeMode === "now") {
|
|
781
|
+
// Inline wake — bypass the heartbeat-wake-interval dependency
|
|
782
|
+
// entirely. The cron decided this is urgent; consume the system
|
|
783
|
+
// event right now via `requestHeartbeatNow`.
|
|
784
|
+
if (state.deps.requestHeartbeatNow) {
|
|
785
|
+
state.deps.requestHeartbeatNow({
|
|
786
|
+
reason: "cron-wake",
|
|
787
|
+
...(job.agentId !== undefined ? { agentId: job.agentId } : {}),
|
|
788
|
+
...(job.sessionKey !== undefined ? { sessionKey: job.sessionKey } : {}),
|
|
789
|
+
});
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
else {
|
|
793
|
+
// `next-heartbeat` — DO NOT depend on the agent heartbeat
|
|
794
|
+
// scheduler (which may not be configured at all). Queue a
|
|
795
|
+
// pending wake; the next cron tick (≤30 s) drains it via
|
|
796
|
+
// `requestHeartbeatNow` so the system event actually
|
|
797
|
+
// reaches a turn. Without this, a job with no
|
|
798
|
+
// `heartbeat.intervalMs` set would leave the system event
|
|
799
|
+
// stuck in `enqueueSystemEvent`'s queue indefinitely.
|
|
800
|
+
state.pendingHeartbeatWakes.push({
|
|
801
|
+
reason: "cron-wake",
|
|
802
|
+
...(job.agentId !== undefined ? { agentId: job.agentId } : {}),
|
|
803
|
+
...(job.sessionKey !== undefined ? { sessionKey: job.sessionKey } : {}),
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
return { status: "ok", summary: summariseSystemEventPayload(job.payload.text) };
|
|
807
|
+
}
|
|
808
|
+
catch (err) {
|
|
809
|
+
return { status: "error", error: err instanceof Error ? err.message : String(err) };
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
// Isolated / session:* — delegate to the agent runner (handles agentTurn AND
|
|
813
|
+
// script payloads; the executor dispatches by kind).
|
|
814
|
+
if (job.payload.kind !== "agentTurn" && job.payload.kind !== "script") {
|
|
815
|
+
return { status: "error", error: "invariant violated: isolated target without agentTurn/script payload" };
|
|
816
|
+
}
|
|
817
|
+
const runner = state.deps.runIsolatedAgentJob;
|
|
818
|
+
if (!runner) {
|
|
819
|
+
return { status: "error", error: "no runIsolatedAgentJob dep wired" };
|
|
820
|
+
}
|
|
821
|
+
return runner({ job, runAtMs, abortSignal });
|
|
822
|
+
}
|
|
823
|
+
/** Per-job timeout resolution. Both agentTurn and script carry `timeoutSeconds`. */
|
|
824
|
+
function resolveJobTimeoutMs(job) {
|
|
825
|
+
if (job.payload.kind !== "agentTurn" && job.payload.kind !== "script") {
|
|
826
|
+
return DEFAULT_EXECUTION_TIMEOUT_MS;
|
|
827
|
+
}
|
|
828
|
+
const p = job.payload;
|
|
829
|
+
if (typeof p.timeoutSeconds === "number" && p.timeoutSeconds > 0) {
|
|
830
|
+
return p.timeoutSeconds * 1000;
|
|
831
|
+
}
|
|
832
|
+
return DEFAULT_EXECUTION_TIMEOUT_MS;
|
|
833
|
+
}
|
|
834
|
+
/** Truncate a long system-event text into a one-line summary for the run log. */
|
|
835
|
+
function summariseSystemEventPayload(text) {
|
|
836
|
+
const flat = text.replace(/\s+/g, " ").trim();
|
|
837
|
+
return flat.length <= 120 ? flat : `${flat.slice(0, 117)}…`;
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* Drain `state.pendingHeartbeatWakes` by invoking `requestHeartbeatNow`
|
|
841
|
+
* for each queued intent. Called at the START of every `onTimer` tick so
|
|
842
|
+
* `wakeMode: "next-heartbeat"` system events queued by main-target crons
|
|
843
|
+
* during the PREVIOUS tick get consumed within ≤30 s — independent of any
|
|
844
|
+
* per-agent `heartbeat.intervalMs` setting. Errors per-entry are caught
|
|
845
|
+
* + logged so one bad wake can't poison the rest of the drain.
|
|
846
|
+
*/
|
|
847
|
+
function drainPendingHeartbeatWakes(state) {
|
|
848
|
+
if (state.pendingHeartbeatWakes.length === 0)
|
|
849
|
+
return;
|
|
850
|
+
const intents = state.pendingHeartbeatWakes;
|
|
851
|
+
state.pendingHeartbeatWakes = [];
|
|
852
|
+
const requestWake = state.deps.requestHeartbeatNow;
|
|
853
|
+
if (!requestWake) {
|
|
854
|
+
// No wake dispatcher wired (tests / CLI). Drop the intents — the
|
|
855
|
+
// system events themselves were already enqueued via
|
|
856
|
+
// `enqueueSystemEvent`; the operator's next turn or external
|
|
857
|
+
// consumer is responsible for picking them up.
|
|
858
|
+
return;
|
|
859
|
+
}
|
|
860
|
+
for (const intent of intents) {
|
|
861
|
+
try {
|
|
862
|
+
requestWake({
|
|
863
|
+
reason: intent.reason ?? "cron-wake",
|
|
864
|
+
...(intent.agentId !== undefined ? { agentId: intent.agentId } : {}),
|
|
865
|
+
...(intent.sessionKey !== undefined ? { sessionKey: intent.sessionKey } : {}),
|
|
866
|
+
});
|
|
867
|
+
}
|
|
868
|
+
catch (err) {
|
|
869
|
+
state.deps.log.warn("cron pending-wake drain entry threw", {
|
|
870
|
+
agentId: intent.agentId,
|
|
871
|
+
sessionKey: intent.sessionKey,
|
|
872
|
+
error: err instanceof Error ? err.message : String(err),
|
|
873
|
+
});
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
/** Emit a lifecycle event, swallowing listener errors. */
|
|
878
|
+
function emit(state, event) {
|
|
879
|
+
const cb = state.deps.onEvent;
|
|
880
|
+
if (!cb)
|
|
881
|
+
return;
|
|
882
|
+
try {
|
|
883
|
+
cb(event);
|
|
884
|
+
}
|
|
885
|
+
catch (err) {
|
|
886
|
+
state.deps.log.warn("cron event listener threw", {
|
|
887
|
+
action: event.action,
|
|
888
|
+
error: err instanceof Error ? err.message : String(err),
|
|
889
|
+
});
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
/**
|
|
893
|
+
* Send a failure-alert if the consecutive-error count crossed the configured
|
|
894
|
+
* `after` threshold AND the cooldown window has elapsed since the last alert.
|
|
895
|
+
* Updates `lastFailureAlertAtMs` on success so the cooldown is honoured.
|
|
896
|
+
*/
|
|
897
|
+
async function maybeSendFailureAlert(state, job, error, endedAtMs) {
|
|
898
|
+
const resolved = resolveFailureAlertConfig(state, job);
|
|
899
|
+
if (!resolved)
|
|
900
|
+
return;
|
|
901
|
+
// bestEffort jobs opted into "fire and forget" semantics — delivery errors
|
|
902
|
+
// are swallowed by design, so the failure-alert path must also stay
|
|
903
|
+
// silent. Without this gate, an operator who set `delivery.bestEffort:
|
|
904
|
+
// true` (e.g. for a low-priority WhatsApp ping) would still be paged on
|
|
905
|
+
// consecutive failures, defeating the contract.
|
|
906
|
+
if (job.delivery?.bestEffort === true)
|
|
907
|
+
return;
|
|
908
|
+
const count = job.state.consecutiveErrorCount ?? 0;
|
|
909
|
+
if (count < resolved.after)
|
|
910
|
+
return;
|
|
911
|
+
const lastSentAtMs = job.state.lastFailureAlertAtMs ?? 0;
|
|
912
|
+
if (endedAtMs - lastSentAtMs < resolved.cooldownMs)
|
|
913
|
+
return;
|
|
914
|
+
const sender = state.deps.sendCronFailureAlert;
|
|
915
|
+
if (!sender) {
|
|
916
|
+
state.deps.log.warn("failure-alert configured but no sendCronFailureAlert dep wired", {
|
|
917
|
+
jobId: job.id,
|
|
918
|
+
});
|
|
919
|
+
return;
|
|
920
|
+
}
|
|
921
|
+
const text = formatFailureAlertText(job, count, error);
|
|
922
|
+
const args = {
|
|
923
|
+
job,
|
|
924
|
+
text,
|
|
925
|
+
mode: resolved.mode,
|
|
926
|
+
...(resolved.channel !== undefined ? { channel: resolved.channel } : {}),
|
|
927
|
+
...(resolved.to !== undefined ? { to: resolved.to } : {}),
|
|
928
|
+
...(resolved.accountId !== undefined ? { accountId: resolved.accountId } : {}),
|
|
929
|
+
...(resolved.webhookUrl !== undefined ? { webhookUrl: resolved.webhookUrl } : {}),
|
|
930
|
+
};
|
|
931
|
+
try {
|
|
932
|
+
await sender(args);
|
|
933
|
+
// Update lastFailureAlertAtMs under the lock.
|
|
934
|
+
const idx = state.store.jobs.findIndex((j) => j.id === job.id);
|
|
935
|
+
if (idx >= 0) {
|
|
936
|
+
state.store.jobs[idx] = {
|
|
937
|
+
...state.store.jobs[idx],
|
|
938
|
+
state: { ...state.store.jobs[idx].state, lastFailureAlertAtMs: endedAtMs },
|
|
939
|
+
};
|
|
940
|
+
await persist(state);
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
catch (err) {
|
|
944
|
+
state.deps.log.warn("failure-alert send threw", {
|
|
945
|
+
jobId: job.id,
|
|
946
|
+
error: err instanceof Error ? err.message : String(err),
|
|
947
|
+
});
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
/** Resolve the effective failure-alert config: per-job overrides global. */
|
|
951
|
+
function resolveFailureAlertConfig(state, job) {
|
|
952
|
+
const perJob = job.failureAlert;
|
|
953
|
+
if (perJob === false)
|
|
954
|
+
return null;
|
|
955
|
+
const global = state.config.failureAlert;
|
|
956
|
+
const globalEnabled = global?.enabled === true;
|
|
957
|
+
const perJobPresent = perJob !== undefined;
|
|
958
|
+
if (!globalEnabled && !perJobPresent)
|
|
959
|
+
return null;
|
|
960
|
+
const merged = {
|
|
961
|
+
after: perJob?.after ?? global?.after ?? 2,
|
|
962
|
+
cooldownMs: perJob?.cooldownMs ?? global?.cooldownMs ?? 60 * 60_000,
|
|
963
|
+
channel: perJob?.channel,
|
|
964
|
+
to: perJob?.to,
|
|
965
|
+
accountId: perJob?.accountId ?? global?.accountId,
|
|
966
|
+
mode: (perJob?.mode ?? global?.mode ?? "announce"),
|
|
967
|
+
webhookUrl: perJob?.webhookUrl,
|
|
968
|
+
};
|
|
969
|
+
if (merged.after < 1)
|
|
970
|
+
merged.after = 1;
|
|
971
|
+
if (merged.cooldownMs < 0)
|
|
972
|
+
merged.cooldownMs = 0;
|
|
973
|
+
return merged;
|
|
974
|
+
}
|
|
975
|
+
function formatFailureAlertText(job, count, error) {
|
|
976
|
+
const trimmedError = error.length > 200 ? `${error.slice(0, 197)}…` : error;
|
|
977
|
+
return `Cron job "${job.name}" failed ${count} consecutive run(s)\nLast error: ${trimmedError}`;
|
|
978
|
+
}
|
|
979
|
+
/**
|
|
980
|
+
* Bounded startup catchup. Called by `ops.start`. Find missed recurring jobs,
|
|
981
|
+
* cap at `maxMissedJobsPerRestart`, schedule them with staggered offsets.
|
|
982
|
+
* One-shot `at` jobs whose `runningAtMs` was set get the marker cleared
|
|
983
|
+
* (interrupted mid-run, can't re-fire — they're presumed done).
|
|
984
|
+
*/
|
|
985
|
+
export async function planStartupCatchup(state) {
|
|
986
|
+
await withPerInstanceLock(state.op, async () => {
|
|
987
|
+
await ensureLoaded(state);
|
|
988
|
+
const now = state.deps.nowMs();
|
|
989
|
+
const maxMissed = Math.max(1, state.config.maxMissedJobsPerRestart ?? 5);
|
|
990
|
+
const stagger = Math.max(0, state.config.missedJobStaggerMs ?? 5_000);
|
|
991
|
+
let mutated = false;
|
|
992
|
+
const missed = [];
|
|
993
|
+
for (let i = 0; i < state.store.jobs.length; i++) {
|
|
994
|
+
const job = state.store.jobs[i];
|
|
995
|
+
// Clear stale runningAtMs markers regardless of kind — we restarted.
|
|
996
|
+
if (job.state.runningAtMs !== undefined) {
|
|
997
|
+
state.store.jobs[i] = {
|
|
998
|
+
...job,
|
|
999
|
+
state: { ...job.state, runningAtMs: undefined },
|
|
1000
|
+
};
|
|
1001
|
+
mutated = true;
|
|
1002
|
+
}
|
|
1003
|
+
// One-shot interrupted: don't replay; we can't tell if it ran.
|
|
1004
|
+
if (job.schedule.kind === "at" && job.state.lastStatus === undefined) {
|
|
1005
|
+
continue;
|
|
1006
|
+
}
|
|
1007
|
+
if (!job.enabled)
|
|
1008
|
+
continue;
|
|
1009
|
+
const next = job.state.nextRunAtMs;
|
|
1010
|
+
if (next === undefined) {
|
|
1011
|
+
// Try to recompute — if a schedule-compute error happened earlier,
|
|
1012
|
+
// this might succeed now.
|
|
1013
|
+
try {
|
|
1014
|
+
const recomputed = computeJobNextRunAtMs(job, now);
|
|
1015
|
+
if (recomputed !== undefined) {
|
|
1016
|
+
state.store.jobs[i] = {
|
|
1017
|
+
...state.store.jobs[i],
|
|
1018
|
+
state: { ...state.store.jobs[i].state, nextRunAtMs: recomputed },
|
|
1019
|
+
};
|
|
1020
|
+
mutated = true;
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
catch (err) {
|
|
1024
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
1025
|
+
state.store.jobs[i] = recordScheduleComputeError(job, message);
|
|
1026
|
+
mutated = true;
|
|
1027
|
+
}
|
|
1028
|
+
continue;
|
|
1029
|
+
}
|
|
1030
|
+
// Past-due → mark as missed; we'll defer fire to a staggered time below.
|
|
1031
|
+
if (next < now) {
|
|
1032
|
+
missed.push(state.store.jobs[i]);
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
// Stagger missed-job replays so a hundred catchups don't all fire on
|
|
1036
|
+
// the same tick. The first `maxMissed` jobs fire immediately (with a
|
|
1037
|
+
// small offset between them); ALL further deferred jobs ALSO get a
|
|
1038
|
+
// `nextRunAtMs` that's still past-due (now + offset) so they fire on
|
|
1039
|
+
// later ticks rather than being silently dropped past their slot
|
|
1040
|
+
// (Bug #2). The prior implementation jumped over-cap deferred jobs
|
|
1041
|
+
// to their NEXT regular slot, which dropped the missed fire entirely.
|
|
1042
|
+
const slice = missed.slice(0, maxMissed);
|
|
1043
|
+
for (let i = 0; i < slice.length; i++) {
|
|
1044
|
+
const job = slice[i];
|
|
1045
|
+
const idx = state.store.jobs.findIndex((j) => j.id === job.id);
|
|
1046
|
+
if (idx < 0)
|
|
1047
|
+
continue;
|
|
1048
|
+
const replayAt = now + i * stagger;
|
|
1049
|
+
state.store.jobs[idx] = {
|
|
1050
|
+
...state.store.jobs[idx],
|
|
1051
|
+
state: { ...state.store.jobs[idx].state, nextRunAtMs: replayAt },
|
|
1052
|
+
};
|
|
1053
|
+
mutated = true;
|
|
1054
|
+
}
|
|
1055
|
+
// Over-cap deferred missed jobs: keep them scheduled past-due with a
|
|
1056
|
+
// continuing stagger offset so subsequent ticks pick them up in order
|
|
1057
|
+
// without piling onto tick 1. Deferred-offset pattern: they STILL
|
|
1058
|
+
// fire, just spaced beyond the initial maxMissed slice — each
|
|
1059
|
+
// subsequent tick picks the next past-due one off the front.
|
|
1060
|
+
let offset = maxMissed * stagger;
|
|
1061
|
+
for (let i = maxMissed; i < missed.length; i++) {
|
|
1062
|
+
const job = missed[i];
|
|
1063
|
+
const idx = state.store.jobs.findIndex((j) => j.id === job.id);
|
|
1064
|
+
if (idx < 0)
|
|
1065
|
+
continue;
|
|
1066
|
+
state.store.jobs[idx] = {
|
|
1067
|
+
...state.store.jobs[idx],
|
|
1068
|
+
state: { ...state.store.jobs[idx].state, nextRunAtMs: now + offset },
|
|
1069
|
+
};
|
|
1070
|
+
offset += stagger;
|
|
1071
|
+
mutated = true;
|
|
1072
|
+
}
|
|
1073
|
+
// `computeJobNextRunAtMs` import retained for downstream callers.
|
|
1074
|
+
void computeJobNextRunAtMs;
|
|
1075
|
+
if (mutated)
|
|
1076
|
+
await persist(state);
|
|
1077
|
+
});
|
|
1078
|
+
// Use errorBackoffMs so the import doesn't go unused (some tests import it indirectly).
|
|
1079
|
+
void errorBackoffMs;
|
|
1080
|
+
}
|
|
1081
|
+
//# sourceMappingURL=timer.js.map
|