@desplega.ai/agent-swarm 1.131.0 → 1.133.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/README.md +2 -2
- package/dist/{actions-w53mbns9.js → actions-cskpayd7.js} +11 -9
- package/dist/{anthropic-messages-rjmd2e7n.js → anthropic-messages-tpxtbx7b.js} +28 -12
- package/dist/{app-m9gwqsqv.js → app-ang77nbb.js} +8 -6
- package/dist/{assistant-bp65m6f3.js → assistant-b4exebdw.js} +16 -13
- package/dist/{azure-openai-responses-c0yjmbfd.js → azure-openai-responses-m3921t4y.js} +8 -8
- package/dist/{boot-reembed-62p0at2k.js → boot-reembed-ps2aftpb.js} +9 -7
- package/dist/{boot-reembed-xmfp6wdh.js → boot-reembed-znyk3nxb.js} +10 -8
- package/dist/{boot-scrub-logs-rr8q2dms.js → boot-scrub-logs-2ax3xgz1.js} +7 -5
- package/dist/{claude-adapter-2y47mrkd.js → claude-adapter-3ct8kgxw.js} +13 -9
- package/dist/{claude-managed-adapter-gv19tdew.js → claude-managed-adapter-akx4ntf2.js} +2 -2
- package/dist/{cli-t1xze5qh.js → cli-13w2hwkh.js} +1 -1
- package/dist/{cli-efxfnq6q.js → cli-1532szb1.js} +8 -6
- package/dist/{cli-d2tfkcga.js → cli-23d3rseb.js} +33 -17
- package/dist/{cli-nm5gtp1x.js → cli-2a75z9c5.js} +196 -7
- package/dist/{cli-fywms69x.js → cli-2t30rj0d.js} +1 -1
- package/dist/{cli-cvgjwnh1.js → cli-3c3tdgab.js} +10 -10
- package/dist/{cli-pm6xbh84.js → cli-3zzxa9jz.js} +46 -16
- package/dist/{cli-cdeg08wx.js → cli-4k6233gc.js} +1 -1
- package/dist/{cli-t55yw3a1.js → cli-5p2tz05r.js} +2 -2
- package/dist/{cli-0rcyq6d9.js → cli-5z2yhzvd.js} +125 -47
- package/dist/{cli-3kf51j15.js → cli-6zfq31nj.js} +9 -3
- package/dist/{cli-er3a4bb0.js → cli-8m9de10a.js} +6 -1
- package/dist/{cli-gm9cbhbq.js → cli-8t14vg9w.js} +27 -8
- package/dist/{cli-72q8m8gk.js → cli-9nfc2es8.js} +6 -6
- package/dist/{cli-5ze9rv97.js → cli-9ta3pwms.js} +11 -4
- package/dist/{cli-78xwvkhj.js → cli-avr0ns7z.js} +2 -2
- package/dist/{cli-n6h8qt8n.js → cli-c897wyhw.js} +12 -7
- package/dist/{cli-2q72qz2s.js → cli-dgk20ft7.js} +15 -6
- package/dist/cli-et1bbwqf.js +13 -0
- package/dist/{cli-bqw0mt1n.js → cli-f5w27pj3.js} +3 -3
- package/dist/{cli-2wadx7p2.js → cli-f8dre4bz.js} +2 -2
- package/dist/{cli-e7ckcg4v.js → cli-ftwpv451.js} +170 -387
- package/dist/{cli-g6b8x1h8.js → cli-g854s2dw.js} +1 -1
- package/dist/{cli-5kx36evn.js → cli-ggmdxeqa.js} +13 -8
- package/dist/cli-hkwfe3qj.js +530 -0
- package/dist/{cli-5dsbcjjw.js → cli-jqwnqx9m.js} +1 -1
- package/dist/{cli-9dr5qzc0.js → cli-ny122vh4.js} +21 -10
- package/dist/{cli-5v4rw6yd.js → cli-pvzqhbs9.js} +2 -2
- package/dist/cli-pzq5rjym.js +15 -0
- package/dist/{cli-xpxde7rm.js → cli-qes8ef67.js} +48 -30
- package/dist/{cli-sajgpkqg.js → cli-qs9hhsvb.js} +1723 -325
- package/dist/cli-qys3rhhz.js +27 -0
- package/dist/{cli-rzbpmxdr.js → cli-r6tpm37h.js} +2 -2
- package/dist/{cli-qv61hp37.js → cli-rch80c76.js} +2 -2
- package/dist/{cli-0258203w.js → cli-rpp0x4zy.js} +137 -17
- package/dist/{cli-5n6e5yfn.js → cli-s1k0wxhe.js} +12 -7
- package/dist/{cli-psh3c4va.js → cli-sfd9v7sj.js} +1 -1
- package/dist/{cli-70xqj0z3.js → cli-sh3ytsyj.js} +49 -39
- package/dist/{cli-zsspvvm2.js → cli-w1mp9jy7.js} +1 -1
- package/dist/{cli-d3x3x1c9.js → cli-xdb4mpnp.js} +2 -2
- package/dist/{cli-57khth04.js → cli-xmyqv00z.js} +120 -4
- package/dist/{cli-yw8vghx2.js → cli-xv8t8p3c.js} +65 -32
- package/dist/{cli-f1am9szv.js → cli-xxv5pn4f.js} +1 -1
- package/dist/{cli-t76vw5db.js → cli-y08jvxzx.js} +601 -140
- package/dist/{cli-a4jzdpa3.js → cli-zfbf3srj.js} +650 -245
- package/dist/{cli-a40rnf71.js → cli-zmq89k34.js} +6 -6
- package/dist/{cli-qmdnhpej.js → cli-zr9q011v.js} +23 -13
- package/dist/cli.js +22 -22
- package/dist/{codex-adapter-d24q75wk.js → codex-adapter-bef93pq4.js} +9 -7
- package/dist/{codex-hook-hq54t9ft.js → codex-hook-e8dba65p.js} +3 -2
- package/dist/{codex-session-runner-g50vcsex.js → codex-session-runner-5pkxys7x.js} +9 -7
- package/dist/{commands-c3nrc5hg.js → commands-e23s1bff.js} +9 -7
- package/dist/{db-nt7fg3tw.js → db-m3nabatn.js} +17 -5
- package/dist/{google-generative-ai-hysrd8qx.js → google-generative-ai-8maw55xh.js} +11 -8
- package/dist/{google-vertex-p5arrga0.js → google-vertex-8vjqmx8g.js} +11 -8
- package/dist/{handlers-fkr6swat.js → handlers-akazedvr.js} +16 -13
- package/dist/{hook-77wpvnjc.js → hook-ze4cpf0v.js} +55 -41
- package/dist/{hook-g019yehy.js → hook-zfqyyenw.js} +10 -7
- package/dist/{http-jewj0syk.js → http-sja0n6kw.js} +730 -150
- package/dist/index-0gr8vd6k.js +39 -0
- package/dist/{index-7n2xpbd4.js → index-354vkhdv.js} +154 -74
- package/dist/{index-070v4eyb.js → index-5qthek5t.js} +2 -3
- package/dist/{index-hfvggd0z.js → index-95t3cqq5.js} +16 -14
- package/dist/{index-9znhar3x.js → index-sea66619.js} +3 -4
- package/dist/{index-6gm5he8h.js → index-vpn36mma.js} +15 -13
- package/dist/{keepalive-j0fjvqfd.js → keepalive-3sp3meqj.js} +16 -10
- package/dist/{lead-1n8x30xe.js → lead-mefeewkf.js} +39 -36
- package/dist/{maintenance-gvev11sa.js → maintenance-8tbrbjfg.js} +10 -8
- package/dist/mistral-conversations-00zrp7g4.js +717 -0
- package/dist/{oauth-refresh-sweep-s9ecsvh0.js → oauth-refresh-sweep-srjwjz6m.js} +8 -6
- package/dist/{onboard-pvm5b38w.js → onboard-mt2tgyjg.js} +7 -7
- package/dist/{openai-codex-responses-5g27pd6f.js → openai-codex-responses-map32h2s.js} +18 -18
- package/dist/{openai-completions-3vkmfz2a.js → openai-completions-w871b1cq.js} +12 -11
- package/dist/{openai-responses-dg4t7j7a.js → openai-responses-b0j7xnw8.js} +15 -12
- package/dist/{opencode-adapter-1gm38aba.js → opencode-adapter-b39jefcj.js} +5 -3
- package/dist/{openrouter-images-g3gm8931.js → openrouter-images-srfkywy0.js} +4 -4
- package/dist/{otel-impl-p6jvgd9c.js → otel-impl-z6pxt3j9.js} +224 -9
- package/dist/{pi-mono-adapter-t091s27g.js → pi-mono-adapter-btvqmj58.js} +1138 -408
- package/dist/{pricing-refresh-k49rcyed.js → pricing-refresh-kyq8cezh.js} +9 -7
- package/dist/{rbac-roles-cr80g96t.js → rbac-roles-3ryfrfna.js} +8 -6
- package/dist/{rbac-roles-30pspvy7.js → rbac-roles-6qfvbee1.js} +9 -7
- package/dist/{render-v2-xm457ng1.js → render-v2-p61ppjey.js} +8 -6
- package/dist/{seed-pricing-yhpv35fr.js → seed-pricing-j56bbj4y.js} +8 -6
- package/dist/{setup-nytnmwwr.js → setup-tpr6c1kn.js} +2 -2
- package/dist/{worker-msytr2cw.js → worker-9w1v0mbb.js} +39 -36
- package/openapi.json +542 -16
- package/package.json +6 -6
- package/src/be/budget-refusal-notify.ts +14 -7
- package/src/be/db-queries/task-artifacts.ts +182 -0
- package/src/be/db.ts +783 -169
- package/src/be/events.ts +5 -0
- package/src/be/migrations/130_scratch_script_retention_grace.sql +6 -0
- package/src/be/migrations/131_session_logs_created_at_index.sql +2 -0
- package/src/be/migrations/132_multi_runtime_instances.sql +44 -0
- package/src/be/migrations/133_workflow_run_trigger_type.sql +12 -0
- package/src/be/migrations/135_backfill_task_pull_request_attachments.sql +228 -0
- package/src/be/migrations/136_task_requester_provenance.sql +37 -0
- package/src/be/migrations/137_memory_retrieval_composite_index.sql +1 -0
- package/src/be/multi-runtime.ts +430 -0
- package/src/be/scripts/db.ts +43 -1
- package/src/be/scripts/extract-schema.ts +3 -1
- package/src/be/scripts/retention.ts +164 -0
- package/src/be/scripts/run-saved.ts +16 -1
- package/src/be/scripts/typecheck.ts +3 -2
- package/src/be/seed-skills/index.ts +7 -0
- package/src/be/steering.ts +1 -1
- package/src/be/swarm-config-guard.ts +18 -0
- package/src/commands/credential-wait.ts +54 -0
- package/src/commands/onboard/steps/core-credentials.tsx +1 -1
- package/src/commands/onboard/steps/custom-templates.tsx +1 -1
- package/src/commands/onboard/steps/harness-credentials.tsx +1 -1
- package/src/commands/onboard/steps/health-check.tsx +1 -1
- package/src/commands/onboard/steps/start.tsx +1 -1
- package/src/commands/profile-sync-audit.ts +56 -0
- package/src/commands/profile-sync.ts +287 -15
- package/src/commands/provider-credentials.ts +46 -19
- package/src/commands/runner.ts +196 -33
- package/src/commands/templates.ts +22 -0
- package/src/github/handlers.ts +55 -9
- package/src/heartbeat/heartbeat.ts +71 -12
- package/src/hooks/hook.ts +49 -33
- package/src/http/active-sessions.ts +11 -1
- package/src/http/agents.ts +261 -30
- package/src/http/all-routes.ts +1 -0
- package/src/http/config.ts +13 -2
- package/src/http/core.ts +102 -4
- package/src/http/db-query-bounded.ts +313 -0
- package/src/http/db-query-shared.ts +249 -0
- package/src/http/db-query.ts +54 -42
- package/src/http/events.ts +2 -0
- package/src/http/index.ts +27 -2
- package/src/http/mcp-bridge.ts +37 -3
- package/src/http/mcp.ts +12 -0
- package/src/http/memory.ts +13 -2
- package/src/http/openapi.ts +1 -0
- package/src/http/poll.ts +70 -27
- package/src/http/route-def.ts +43 -9
- package/src/http/schedules.ts +2 -2
- package/src/http/scripts.ts +31 -4
- package/src/http/session-data.ts +44 -0
- package/src/http/tasks.ts +2 -2
- package/src/http/users.ts +74 -52
- package/src/http/webhooks.ts +5 -2
- package/src/http/workflows.ts +1 -4
- package/src/http/x.ts +14 -0
- package/src/integrations/kapso/inbound.ts +1 -1
- package/src/jira/outbound.ts +39 -8
- package/src/jira/webhook-lifecycle.ts +13 -2
- package/src/linear/outbound.ts +43 -10
- package/src/oauth/keepalive.ts +13 -2
- package/src/prompts/base-prompt.ts +1 -1
- package/src/prompts/session-templates.ts +45 -7
- package/src/providers/claude-adapter.ts +6 -0
- package/src/providers/claude-managed-models.ts +34 -10
- package/src/providers/codex-adapter.ts +6 -0
- package/src/providers/opencode-adapter.ts +6 -0
- package/src/providers/pi-mono-adapter.ts +8 -0
- package/src/providers/pricing-sources.md +24 -0
- package/src/queue-stall-alarm.ts +216 -0
- package/src/scheduler/scheduler.ts +7 -0
- package/src/script-workflows/executor.ts +2 -1
- package/src/scripts-runtime/executors/native.ts +2 -1
- package/src/scripts-runtime/executors/types.ts +5 -0
- package/src/scripts-runtime/loader.ts +5 -0
- package/src/scripts-runtime/swarm-config.ts +8 -0
- package/src/scripts-runtime/swarm-sdk.ts +7 -0
- package/src/scripts-runtime/types/stdlib.d.ts +1 -0
- package/src/scripts-runtime/types/swarm-sdk.d.ts +1 -0
- package/src/tests/budget-claim-gate.test.ts +20 -0
- package/src/tests/claude-adapter.test.ts +32 -0
- package/src/tests/claude-managed-adapter.test.ts +38 -7
- package/src/tests/codex-adapter.test.ts +30 -0
- package/src/tests/create-task-validation.test.ts +128 -0
- package/src/tests/credential-wait.test.ts +67 -1
- package/src/tests/db-query.test.ts +711 -2
- package/src/tests/http-api-integration.test.ts +81 -0
- package/src/tests/http-users.test.ts +166 -1
- package/src/tests/identity-field-budget.test.ts +176 -0
- package/src/tests/mcp-tools-user.test.ts +34 -0
- package/src/tests/mcp-user-route.test.ts +17 -0
- package/src/tests/metrics-http.test.ts +44 -0
- package/src/tests/multi-runtime-registration.test.ts +2703 -0
- package/src/tests/openapi-response-contract.test.ts +24 -0
- package/src/tests/openapi-route-headers.test.ts +83 -0
- package/src/tests/opencode-adapter.test.ts +40 -0
- package/src/tests/outbound-listener-rejection.test.ts +138 -0
- package/src/tests/pi-mono-adapter.test.ts +98 -0
- package/src/tests/profile-sync-warning.test.ts +277 -0
- package/src/tests/profile-sync.test.ts +232 -6
- package/src/tests/prompt-template-session.test.ts +32 -3
- package/src/tests/queue-stall-alarm.test.ts +226 -0
- package/src/tests/requester-comms.test.ts +32 -0
- package/src/tests/runner-requester-profile.test.ts +38 -0
- package/src/tests/sandboxed-process.test.ts +45 -0
- package/src/tests/schedule-target-type.test.ts +38 -0
- package/src/tests/script-connections.test.ts +16 -3
- package/src/tests/scripts-external-api.test.ts +8 -3
- package/src/tests/scripts-http.test.ts +12 -0
- package/src/tests/scripts-retention.test.ts +384 -0
- package/src/tests/scripts-runtime-identity.test.ts +375 -0
- package/src/tests/scripts-runtime.test.ts +4 -3
- package/src/tests/sdk-allowlist.test.ts +47 -0
- package/src/tests/send-task-requested-by.test.ts +9 -0
- package/src/tests/session-costs.test.ts +506 -1
- package/src/tests/shutdown-error-scrubbing.test.ts +92 -0
- package/src/tests/steering-core.test.ts +28 -0
- package/src/tests/task-artifacts.test.ts +386 -0
- package/src/tests/task-attachments-schema.test.ts +17 -1
- package/src/tests/task-completion-idempotency.test.ts +57 -0
- package/src/tests/task-pull-request-backfill-migration.test.ts +321 -0
- package/src/tests/update-profile-api.test.ts +67 -39
- package/src/tests/update-profile-auth.test.ts +48 -4
- package/src/tests/user-attribution-migration.test.ts +54 -0
- package/src/tests/user-identity.test.ts +72 -0
- package/src/tests/workflow-async-v2.test.ts +39 -1
- package/src/tests/workflow-http-v2.test.ts +3 -2
- package/src/tests/workflow-mcp-trigger-schema.test.ts +52 -3
- package/src/tests/workflow-retry-v2.test.ts +45 -1
- package/src/tests/workflow-swarm-script.test.ts +14 -5
- package/src/tools/db-query.ts +18 -8
- package/src/tools/get-task-details.ts +24 -3
- package/src/tools/manage-user.ts +36 -3
- package/src/tools/poll-task.ts +93 -14
- package/src/tools/script-common.ts +5 -0
- package/src/tools/send-task.ts +1 -4
- package/src/tools/store-progress.ts +13 -2
- package/src/tools/swarm-config/delete-config.ts +9 -0
- package/src/tools/swarm-config/set-config.ts +3 -2
- package/src/tools/task-action.ts +30 -0
- package/src/tools/task-tool-ctx.ts +8 -1
- package/src/tools/update-profile.ts +16 -21
- package/src/tools/utils.ts +5 -0
- package/src/tools/workflows/trigger-workflow.ts +7 -1
- package/src/types.ts +165 -1
- package/src/utils/github-pull-request.ts +76 -0
- package/src/utils/identity-field-budget.ts +73 -0
- package/src/utils/multi-runtime.ts +20 -0
- package/src/utils/requester-comms.ts +24 -0
- package/src/utils/sandboxed-process.ts +40 -14
- package/src/workflows/engine.ts +22 -2
- package/src/workflows/executors/swarm-script.ts +24 -1
- package/src/workflows/resume.ts +19 -11
- package/src/workflows/retry-poller.ts +1 -0
- package/src/workflows/triggers.ts +4 -0
- package/templates/schedules/daily-compounding-reflection/content.md +12 -3
- package/templates/skills/db-query-guidance/config.json +14 -0
- package/templates/skills/db-query-guidance/content.md +57 -0
- package/dist/cli-3te4jdkm.js +0 -225
- package/dist/cli-bmze986d.js +0 -7
- package/dist/cli-kh3ba2zf.js +0 -607
- package/dist/index-hp1kdbjj.js +0 -36
- package/dist/mistral-conversations-81fwav0j.js +0 -30578
- package/dist/otel-nqa12wf3.js +0 -3149
- package/dist/{pi-messages-tqj8q6b9.js → pi-messages-sssy32x4.js} +3 -3
package/README.md
CHANGED
|
@@ -121,8 +121,8 @@ Check [our templates](https://templates.agent-swarm.dev) for a quick start.
|
|
|
121
121
|
|
|
122
122
|
## Highlights
|
|
123
123
|
|
|
124
|
-
- **Lead/worker orchestration in Docker** — isolated dev environments, priority queues, pause/resume across deploys. [Architecture →](https://docs.agent-swarm.dev/docs/architecture/overview)
|
|
125
|
-
- **Compounding memory & persistent identity** — agents remember past sessions and evolve their own persona, expertise, and notes. [Memory →](https://docs.agent-swarm.dev/docs/architecture/memory) · [Agents →](https://docs.agent-swarm.dev/docs/architecture/agents)
|
|
124
|
+
- **Lead/worker orchestration in Docker** — isolated dev environments, priority queues, pause/resume across deploys, and API-side alerts when claimable work stops being picked up. [Architecture →](https://docs.agent-swarm.dev/docs/architecture/overview)
|
|
125
|
+
- **Compounding memory & persistent identity** — agents remember past sessions and evolve their own persona, expertise, and notes, with ratcheting file budgets and visible recovery when local edits exceed prompt limits. [Memory →](https://docs.agent-swarm.dev/docs/architecture/memory) · [Agents →](https://docs.agent-swarm.dev/docs/architecture/agents)
|
|
126
126
|
- **Hybrid + graph-linked memory recall** — memory retrieval can blend vector and full-text ranking, expand through linked memories, surface usefulness readouts, and let agents correct an existing memory without losing its ID or history. [Memory →](https://docs.agent-swarm.dev/docs/architecture/memory) · [MCP tools →](https://docs.agent-swarm.dev/docs/reference/mcp-tools#memory-tools)
|
|
127
127
|
- **Multi-channel inputs** — Slack, GitHub, GitLab, email, WhatsApp, Linear, Jira, and the HTTP API all create tasks. [Integrations](#integrations)
|
|
128
128
|
- **Persistent Slack thread trees** — opt in to one editable task tree per conversation, complete streamed outcome cards, and explicit agent-authored Block Kit messages without routine relay spam. [Slack guide →](https://docs.agent-swarm.dev/docs/guides/slack-integration)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveSlackUserId
|
|
3
|
-
} from "./cli-
|
|
4
|
-
import"./cli-
|
|
3
|
+
} from "./cli-avr0ns7z.js";
|
|
4
|
+
import"./cli-sfd9v7sj.js";
|
|
5
5
|
import {
|
|
6
6
|
createTaskWithSiblingAwareness
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-4k6233gc.js";
|
|
8
8
|
import {
|
|
9
9
|
buildCancelledBlocks,
|
|
10
10
|
ensureSlackThreadTree,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
getAgentEmoji,
|
|
13
13
|
getTaskLink,
|
|
14
14
|
isSlackRenderV2Enabled
|
|
15
|
-
} from "./cli-
|
|
15
|
+
} from "./cli-3c3tdgab.js";
|
|
16
16
|
import"./cli-k9qkf1hw.js";
|
|
17
17
|
import"./cli-b0p7rfnd.js";
|
|
18
18
|
import"./cli-t930g0xh.js";
|
|
@@ -24,14 +24,16 @@ import {
|
|
|
24
24
|
init_context_key,
|
|
25
25
|
init_db,
|
|
26
26
|
slackContextKey
|
|
27
|
-
} from "./cli-
|
|
28
|
-
import"./cli-
|
|
27
|
+
} from "./cli-zfbf3srj.js";
|
|
28
|
+
import"./cli-hkwfe3qj.js";
|
|
29
|
+
import"./cli-qes8ef67.js";
|
|
29
30
|
import"./cli-x23me2mg.js";
|
|
30
31
|
import"./cli-z2zcxes1.js";
|
|
31
|
-
import"./cli-
|
|
32
|
+
import"./cli-qys3rhhz.js";
|
|
33
|
+
import"./cli-w1mp9jy7.js";
|
|
34
|
+
import"./cli-9nfc2es8.js";
|
|
32
35
|
import"./cli-4j2mrzag.js";
|
|
33
|
-
import"./cli-
|
|
34
|
-
import"./cli-5dsbcjjw.js";
|
|
36
|
+
import"./cli-jqwnqx9m.js";
|
|
35
37
|
import"./cli-e15jhafb.js";
|
|
36
38
|
import"./cli-3fj60etf.js";
|
|
37
39
|
import"./cli-p9swy5t3.js";
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
splitDeferredTools
|
|
3
|
-
} from "./cli-vfcth11k.js";
|
|
4
1
|
import {
|
|
5
2
|
buildCopilotDynamicHeaders,
|
|
6
3
|
hasCopilotVisionInput
|
|
@@ -8,12 +5,15 @@ import {
|
|
|
8
5
|
import {
|
|
9
6
|
retryProviderRequest
|
|
10
7
|
} from "./cli-s8s499xy.js";
|
|
8
|
+
import {
|
|
9
|
+
getPiUserAgent
|
|
10
|
+
} from "./cli-et1bbwqf.js";
|
|
11
|
+
import {
|
|
12
|
+
splitDeferredTools
|
|
13
|
+
} from "./cli-vfcth11k.js";
|
|
11
14
|
import {
|
|
12
15
|
getProviderEnvValue
|
|
13
16
|
} from "./cli-4wgngmwv.js";
|
|
14
|
-
import {
|
|
15
|
-
headersToRecord
|
|
16
|
-
} from "./cli-vapyk8sw.js";
|
|
17
17
|
import {
|
|
18
18
|
parseJsonWithRepair,
|
|
19
19
|
parseStreamingJson
|
|
@@ -22,12 +22,16 @@ import {
|
|
|
22
22
|
adjustMaxTokensForThinking,
|
|
23
23
|
buildBaseOptions,
|
|
24
24
|
clampMaxTokensToContext,
|
|
25
|
+
getJsonSchemaToolParameters,
|
|
25
26
|
resolveJsonSchemaStrictSampling,
|
|
26
27
|
transformMessages
|
|
27
|
-
} from "./cli-
|
|
28
|
+
} from "./cli-xmyqv00z.js";
|
|
28
29
|
import {
|
|
29
30
|
sanitizeSurrogates
|
|
30
31
|
} from "./cli-y2apkfe2.js";
|
|
32
|
+
import {
|
|
33
|
+
headersToRecord
|
|
34
|
+
} from "./cli-vapyk8sw.js";
|
|
31
35
|
import {
|
|
32
36
|
calculateCost
|
|
33
37
|
} from "./cli-akdvwc9v.js";
|
|
@@ -4946,6 +4950,17 @@ function mergeHeaders(...headerSources) {
|
|
|
4946
4950
|
}
|
|
4947
4951
|
return merged;
|
|
4948
4952
|
}
|
|
4953
|
+
function mergeClientHeaders(model, ...headerSources) {
|
|
4954
|
+
const merged = mergeHeaders(...headerSources);
|
|
4955
|
+
if (model.provider === "kimi-coding") {
|
|
4956
|
+
for (const name of Object.keys(merged)) {
|
|
4957
|
+
if (name.toLowerCase() === "user-agent")
|
|
4958
|
+
delete merged[name];
|
|
4959
|
+
}
|
|
4960
|
+
merged["User-Agent"] = getPiUserAgent();
|
|
4961
|
+
}
|
|
4962
|
+
return merged;
|
|
4963
|
+
}
|
|
4949
4964
|
function hasHeader(headers, name) {
|
|
4950
4965
|
if (!headers)
|
|
4951
4966
|
return false;
|
|
@@ -5414,7 +5429,7 @@ function createClient(model, apiKey, interleavedThinking, useFineGrainedToolStre
|
|
|
5414
5429
|
baseURL: model.baseUrl,
|
|
5415
5430
|
dangerouslyAllowBrowser: true,
|
|
5416
5431
|
fetch: fetch2,
|
|
5417
|
-
defaultHeaders:
|
|
5432
|
+
defaultHeaders: mergeClientHeaders(model, {
|
|
5418
5433
|
accept: "application/json",
|
|
5419
5434
|
"anthropic-dangerous-direct-browser-access": "true",
|
|
5420
5435
|
...betaFeatures.length > 0 ? { "anthropic-beta": betaFeatures.join(",") } : {}
|
|
@@ -5429,7 +5444,7 @@ function createClient(model, apiKey, interleavedThinking, useFineGrainedToolStre
|
|
|
5429
5444
|
baseURL: model.baseUrl,
|
|
5430
5445
|
dangerouslyAllowBrowser: true,
|
|
5431
5446
|
fetch: fetch2,
|
|
5432
|
-
defaultHeaders:
|
|
5447
|
+
defaultHeaders: mergeClientHeaders(model, {
|
|
5433
5448
|
accept: "application/json",
|
|
5434
5449
|
"anthropic-dangerous-direct-browser-access": "true",
|
|
5435
5450
|
"anthropic-beta": ["claude-code-20250219", "oauth-2025-04-20", ...betaFeatures].join(","),
|
|
@@ -5440,7 +5455,7 @@ function createClient(model, apiKey, interleavedThinking, useFineGrainedToolStre
|
|
|
5440
5455
|
return { client: client2, isOAuthToken: true };
|
|
5441
5456
|
}
|
|
5442
5457
|
const sessionAffinityHeaders = sessionId && getAnthropicCompat(model).sendSessionAffinityHeaders ? { "x-session-affinity": sessionId } : {};
|
|
5443
|
-
const defaultHeaders =
|
|
5458
|
+
const defaultHeaders = mergeClientHeaders(model, {
|
|
5444
5459
|
accept: "application/json",
|
|
5445
5460
|
"anthropic-dangerous-direct-browser-access": "true",
|
|
5446
5461
|
...betaFeatures.length > 0 ? { "anthropic-beta": betaFeatures.join(",") } : {}
|
|
@@ -5710,14 +5725,15 @@ function convertTools(tools, isOAuthToken2, supportsEagerToolInputStreaming, sup
|
|
|
5710
5725
|
return [];
|
|
5711
5726
|
return tools.map((tool, index) => {
|
|
5712
5727
|
const strict = resolveJsonSchemaStrictSampling(tool, supportsStrictTools);
|
|
5713
|
-
const
|
|
5728
|
+
const parameters = getJsonSchemaToolParameters(tool, strict);
|
|
5729
|
+
const schema = parameters;
|
|
5714
5730
|
const legacyInputSchema = {
|
|
5715
5731
|
type: "object",
|
|
5716
5732
|
properties: schema.properties ?? {},
|
|
5717
5733
|
required: schema.required ?? []
|
|
5718
5734
|
};
|
|
5719
5735
|
const inputSchema = strict === true ? {
|
|
5720
|
-
...
|
|
5736
|
+
...parameters,
|
|
5721
5737
|
...legacyInputSchema
|
|
5722
5738
|
} : legacyInputSchema;
|
|
5723
5739
|
return {
|
|
@@ -3,18 +3,20 @@ import {
|
|
|
3
3
|
initSlackApp,
|
|
4
4
|
startSlackApp,
|
|
5
5
|
stopSlackApp
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-3c3tdgab.js";
|
|
7
7
|
import"./cli-k9qkf1hw.js";
|
|
8
8
|
import"./cli-b0p7rfnd.js";
|
|
9
9
|
import"./cli-t930g0xh.js";
|
|
10
|
-
import"./cli-
|
|
11
|
-
import"./cli-
|
|
10
|
+
import"./cli-zfbf3srj.js";
|
|
11
|
+
import"./cli-hkwfe3qj.js";
|
|
12
|
+
import"./cli-qes8ef67.js";
|
|
12
13
|
import"./cli-x23me2mg.js";
|
|
13
14
|
import"./cli-z2zcxes1.js";
|
|
14
|
-
import"./cli-
|
|
15
|
+
import"./cli-qys3rhhz.js";
|
|
16
|
+
import"./cli-w1mp9jy7.js";
|
|
17
|
+
import"./cli-9nfc2es8.js";
|
|
15
18
|
import"./cli-4j2mrzag.js";
|
|
16
|
-
import"./cli-
|
|
17
|
-
import"./cli-5dsbcjjw.js";
|
|
19
|
+
import"./cli-jqwnqx9m.js";
|
|
18
20
|
import"./cli-e15jhafb.js";
|
|
19
21
|
import"./cli-3fj60etf.js";
|
|
20
22
|
import"./cli-p9swy5t3.js";
|
|
@@ -2,24 +2,24 @@ import {
|
|
|
2
2
|
bufferThreadMessage,
|
|
3
3
|
getBufferMessageCount,
|
|
4
4
|
wasEventSeen
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-zmq89k34.js";
|
|
6
6
|
import {
|
|
7
7
|
hasOtherUserMention
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-xdb4mpnp.js";
|
|
9
9
|
import {
|
|
10
10
|
resolveSlackUserId,
|
|
11
11
|
rewriteSlackMentions
|
|
12
|
-
} from "./cli-
|
|
13
|
-
import"./cli-
|
|
12
|
+
} from "./cli-avr0ns7z.js";
|
|
13
|
+
import"./cli-sfd9v7sj.js";
|
|
14
14
|
import {
|
|
15
15
|
createTaskWithSiblingAwareness
|
|
16
|
-
} from "./cli-
|
|
16
|
+
} from "./cli-4k6233gc.js";
|
|
17
17
|
import {
|
|
18
18
|
ackSlackMessage,
|
|
19
19
|
ensureSlackThreadTree,
|
|
20
20
|
isSlackRenderV2Enabled,
|
|
21
21
|
require_dist
|
|
22
|
-
} from "./cli-
|
|
22
|
+
} from "./cli-3c3tdgab.js";
|
|
23
23
|
import"./cli-k9qkf1hw.js";
|
|
24
24
|
import"./cli-b0p7rfnd.js";
|
|
25
25
|
import"./cli-t930g0xh.js";
|
|
@@ -30,19 +30,22 @@ import {
|
|
|
30
30
|
init_context_key,
|
|
31
31
|
init_db,
|
|
32
32
|
slackContextKey
|
|
33
|
-
} from "./cli-
|
|
33
|
+
} from "./cli-zfbf3srj.js";
|
|
34
|
+
import"./cli-hkwfe3qj.js";
|
|
34
35
|
import {
|
|
35
|
-
init_env_flag,
|
|
36
36
|
init_resolver,
|
|
37
|
-
isEnvFlagEnabled,
|
|
38
37
|
resolveTemplate
|
|
39
|
-
} from "./cli-
|
|
38
|
+
} from "./cli-qes8ef67.js";
|
|
40
39
|
import"./cli-x23me2mg.js";
|
|
41
40
|
import"./cli-z2zcxes1.js";
|
|
42
|
-
import
|
|
41
|
+
import {
|
|
42
|
+
init_env_flag,
|
|
43
|
+
isEnvFlagEnabled
|
|
44
|
+
} from "./cli-qys3rhhz.js";
|
|
45
|
+
import"./cli-w1mp9jy7.js";
|
|
46
|
+
import"./cli-9nfc2es8.js";
|
|
43
47
|
import"./cli-4j2mrzag.js";
|
|
44
|
-
import"./cli-
|
|
45
|
-
import"./cli-5dsbcjjw.js";
|
|
48
|
+
import"./cli-jqwnqx9m.js";
|
|
46
49
|
import"./cli-e15jhafb.js";
|
|
47
50
|
import"./cli-3fj60etf.js";
|
|
48
51
|
import {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AzureOpenAI
|
|
3
|
+
} from "./cli-qs9hhsvb.js";
|
|
1
4
|
import {
|
|
2
5
|
convertResponsesMessages,
|
|
3
6
|
convertResponsesTools,
|
|
4
7
|
processResponsesStream
|
|
5
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-8t14vg9w.js";
|
|
6
9
|
import {
|
|
7
10
|
clampOpenAIPromptCacheKey
|
|
8
11
|
} from "./cli-mrptpp86.js";
|
|
9
|
-
import {
|
|
10
|
-
AzureOpenAI
|
|
11
|
-
} from "./cli-sajgpkqg.js";
|
|
12
12
|
import"./cli-5m9j2spm.js";
|
|
13
13
|
import {
|
|
14
14
|
retryProviderRequest
|
|
@@ -20,15 +20,15 @@ import {
|
|
|
20
20
|
import {
|
|
21
21
|
getProviderEnvValue
|
|
22
22
|
} from "./cli-4wgngmwv.js";
|
|
23
|
-
import {
|
|
24
|
-
headersToRecord
|
|
25
|
-
} from "./cli-vapyk8sw.js";
|
|
26
23
|
import"./cli-zyxs93y9.js";
|
|
27
24
|
import {
|
|
28
25
|
buildBaseOptions,
|
|
29
26
|
createGrammarToolInputProperties
|
|
30
|
-
} from "./cli-
|
|
27
|
+
} from "./cli-xmyqv00z.js";
|
|
31
28
|
import"./cli-y2apkfe2.js";
|
|
29
|
+
import {
|
|
30
|
+
headersToRecord
|
|
31
|
+
} from "./cli-vapyk8sw.js";
|
|
32
32
|
import {
|
|
33
33
|
clampThinkingLevel
|
|
34
34
|
} from "./cli-akdvwc9v.js";
|
|
@@ -3,19 +3,21 @@ import {
|
|
|
3
3
|
getEmbeddingProvider,
|
|
4
4
|
getMemoryStore,
|
|
5
5
|
init_constants
|
|
6
|
-
} from "./cli-
|
|
7
|
-
import"./cli-
|
|
6
|
+
} from "./cli-r6tpm37h.js";
|
|
7
|
+
import"./cli-rpp0x4zy.js";
|
|
8
8
|
import {
|
|
9
9
|
getDb,
|
|
10
10
|
init_db
|
|
11
|
-
} from "./cli-
|
|
12
|
-
import"./cli-
|
|
11
|
+
} from "./cli-zfbf3srj.js";
|
|
12
|
+
import"./cli-hkwfe3qj.js";
|
|
13
|
+
import"./cli-qes8ef67.js";
|
|
13
14
|
import"./cli-x23me2mg.js";
|
|
14
15
|
import"./cli-z2zcxes1.js";
|
|
15
|
-
import"./cli-
|
|
16
|
+
import"./cli-qys3rhhz.js";
|
|
17
|
+
import"./cli-w1mp9jy7.js";
|
|
18
|
+
import"./cli-9nfc2es8.js";
|
|
16
19
|
import"./cli-4j2mrzag.js";
|
|
17
|
-
import"./cli-
|
|
18
|
-
import"./cli-5dsbcjjw.js";
|
|
20
|
+
import"./cli-jqwnqx9m.js";
|
|
19
21
|
import"./cli-p9swy5t3.js";
|
|
20
22
|
|
|
21
23
|
// src/be/memory/boot-reembed.ts
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
embedScript,
|
|
3
3
|
embeddingProvider
|
|
4
|
-
} from "./cli-
|
|
5
|
-
import"./cli-
|
|
6
|
-
import"./cli-
|
|
4
|
+
} from "./cli-rch80c76.js";
|
|
5
|
+
import"./cli-r6tpm37h.js";
|
|
6
|
+
import"./cli-rpp0x4zy.js";
|
|
7
7
|
import {
|
|
8
8
|
getDb,
|
|
9
9
|
init_db
|
|
10
|
-
} from "./cli-
|
|
11
|
-
import"./cli-
|
|
10
|
+
} from "./cli-zfbf3srj.js";
|
|
11
|
+
import"./cli-hkwfe3qj.js";
|
|
12
|
+
import"./cli-qes8ef67.js";
|
|
12
13
|
import"./cli-x23me2mg.js";
|
|
13
14
|
import"./cli-z2zcxes1.js";
|
|
14
|
-
import"./cli-
|
|
15
|
+
import"./cli-qys3rhhz.js";
|
|
16
|
+
import"./cli-w1mp9jy7.js";
|
|
17
|
+
import"./cli-9nfc2es8.js";
|
|
15
18
|
import"./cli-4j2mrzag.js";
|
|
16
|
-
import"./cli-
|
|
17
|
-
import"./cli-5dsbcjjw.js";
|
|
19
|
+
import"./cli-jqwnqx9m.js";
|
|
18
20
|
import"./cli-p9swy5t3.js";
|
|
19
21
|
|
|
20
22
|
// src/be/scripts/boot-reembed.ts
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getDb,
|
|
3
3
|
init_db
|
|
4
|
-
} from "./cli-
|
|
5
|
-
import"./cli-
|
|
4
|
+
} from "./cli-zfbf3srj.js";
|
|
5
|
+
import"./cli-hkwfe3qj.js";
|
|
6
|
+
import"./cli-qes8ef67.js";
|
|
6
7
|
import"./cli-x23me2mg.js";
|
|
7
8
|
import"./cli-z2zcxes1.js";
|
|
8
|
-
import"./cli-
|
|
9
|
+
import"./cli-qys3rhhz.js";
|
|
10
|
+
import"./cli-w1mp9jy7.js";
|
|
11
|
+
import"./cli-9nfc2es8.js";
|
|
9
12
|
import {
|
|
10
13
|
init_secret_scrubber,
|
|
11
14
|
scrubSecrets
|
|
12
15
|
} from "./cli-4j2mrzag.js";
|
|
13
|
-
import"./cli-
|
|
14
|
-
import"./cli-5dsbcjjw.js";
|
|
16
|
+
import"./cli-jqwnqx9m.js";
|
|
15
17
|
import"./cli-p9swy5t3.js";
|
|
16
18
|
|
|
17
19
|
// src/be/boot-scrub-logs.ts
|
|
@@ -12,28 +12,32 @@ import {
|
|
|
12
12
|
resolveClaudeBinary,
|
|
13
13
|
resolveClaudeBinaryArgv,
|
|
14
14
|
resolveClaudeBridgeEnabled
|
|
15
|
-
} from "./cli-
|
|
16
|
-
import"./cli-
|
|
15
|
+
} from "./cli-6zfq31nj.js";
|
|
16
|
+
import"./cli-sh3ytsyj.js";
|
|
17
17
|
import"./cli-psrqtw2m.js";
|
|
18
|
-
import"./cli-0rcyq6d9.js";
|
|
19
|
-
import"./cli-yv9dttkh.js";
|
|
20
18
|
import"./cli-tng3131n.js";
|
|
21
19
|
import"./cli-zm7njwzd.js";
|
|
22
20
|
import"./cli-cw70hymf.js";
|
|
21
|
+
import"./cli-5z2yhzvd.js";
|
|
22
|
+
import"./cli-yv9dttkh.js";
|
|
23
23
|
import"./cli-v1mwc5v2.js";
|
|
24
|
-
import"./cli-
|
|
24
|
+
import"./cli-f8dre4bz.js";
|
|
25
25
|
import"./cli-e7d20cty.js";
|
|
26
26
|
import"./cli-8whqavk2.js";
|
|
27
|
+
import"./cli-pzq5rjym.js";
|
|
27
28
|
import"./cli-3dpj7atn.js";
|
|
28
29
|
import"./cli-f14fvzag.js";
|
|
29
|
-
import"./cli-
|
|
30
|
+
import"./cli-rpp0x4zy.js";
|
|
30
31
|
import"./cli-7zd05xb4.js";
|
|
32
|
+
import"./cli-hkwfe3qj.js";
|
|
33
|
+
import"./cli-qes8ef67.js";
|
|
31
34
|
import"./cli-x23me2mg.js";
|
|
32
35
|
import"./cli-z2zcxes1.js";
|
|
33
|
-
import"./cli-
|
|
36
|
+
import"./cli-qys3rhhz.js";
|
|
37
|
+
import"./cli-w1mp9jy7.js";
|
|
38
|
+
import"./cli-9nfc2es8.js";
|
|
34
39
|
import"./cli-4j2mrzag.js";
|
|
35
|
-
import"./cli-
|
|
36
|
-
import"./cli-5dsbcjjw.js";
|
|
40
|
+
import"./cli-jqwnqx9m.js";
|
|
37
41
|
import"./cli-darcwax3.js";
|
|
38
42
|
import"./cli-4wgngmwv.js";
|
|
39
43
|
import"./cli-zyxs93y9.js";
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
checkClaudeManagedCredentials,
|
|
4
4
|
composeManagedUserMessage,
|
|
5
5
|
normalizeRepoUrl
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-zr9q011v.js";
|
|
7
7
|
import"./cli-07er7wrs.js";
|
|
8
|
+
import"./cli-cw70hymf.js";
|
|
8
9
|
import"./cli-d6n0thxw.js";
|
|
9
10
|
import"./cli-yv9dttkh.js";
|
|
10
|
-
import"./cli-cw70hymf.js";
|
|
11
11
|
import"./cli-gz9sbyk3.js";
|
|
12
12
|
import"./cli-4j2mrzag.js";
|
|
13
13
|
import"./cli-p9swy5t3.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SYSTEM_COLUMN_KINDS,
|
|
3
3
|
listAppRecords
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-dgk20ft7.js";
|
|
5
5
|
import {
|
|
6
6
|
getScriptApiTypes,
|
|
7
7
|
getScriptMcpTypes,
|
|
8
8
|
require_typescript
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-3zzxa9jz.js";
|
|
10
10
|
import {
|
|
11
11
|
deleteSwarmConfigByKey,
|
|
12
12
|
getAgentById,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
getSwarmConfigs,
|
|
16
16
|
init_db,
|
|
17
17
|
upsertSwarmConfig
|
|
18
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-zfbf3srj.js";
|
|
19
19
|
import {
|
|
20
20
|
init_secret_scrubber,
|
|
21
21
|
scrubSecrets
|
|
@@ -552,9 +552,10 @@ function getScriptAppTypes(_context = {}) {
|
|
|
552
552
|
}
|
|
553
553
|
|
|
554
554
|
// src/be/scripts/extract-schema.ts
|
|
555
|
+
import { fileURLToPath } from "node:url";
|
|
555
556
|
var TIMEOUT_MS = 5000;
|
|
556
557
|
function extractorPath() {
|
|
557
|
-
return new URL("../../scripts-runtime/extract-args-schema.ts", import.meta.url)
|
|
558
|
+
return fileURLToPath(new URL("../../scripts-runtime/extract-args-schema.ts", import.meta.url));
|
|
558
559
|
}
|
|
559
560
|
async function extractArgsJsonSchema(source) {
|
|
560
561
|
const tmpdir = `${process.env.TMPDIR ?? "/tmp"}/schema-extract-${crypto.randomUUID()}`;
|
|
@@ -595,6 +596,7 @@ async function extractArgsJsonSchema(source) {
|
|
|
595
596
|
|
|
596
597
|
// src/be/scripts/typecheck.ts
|
|
597
598
|
var import_typescript = __toESM(require_typescript(), 1);
|
|
599
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
598
600
|
var SCRIPT_SDK_TYPES = `
|
|
599
601
|
export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue };
|
|
600
602
|
export type ScriptScope = "agent" | "global";
|
|
@@ -694,7 +696,7 @@ export interface SwarmSdk {
|
|
|
694
696
|
// --- repos ---
|
|
695
697
|
repo_list(args?: Record<string, unknown>): Promise<unknown>;
|
|
696
698
|
// --- schedules ---
|
|
697
|
-
schedule_list(args?: { enabled?: boolean; name?: string; scheduleType?: "recurring" | "one_time"; targetType?: "agent-task" | "workflow" | "script"; workflowId?: string; scriptName?: string; hideCompleted?: boolean; consecutiveErrorsMin?: number; lastRunStatus?: "failed" | "succeeded" }): Promise<unknown>;
|
|
699
|
+
schedule_list(args?: { enabled?: boolean; name?: string; scheduleType?: "recurring" | "one_time"; targetType?: "agent-task" | "workflow" | "script"; workflowId?: string; scriptName?: string; hideCompleted?: boolean; consecutiveErrorsMin?: number; lastRunStatus?: "failed" | "succeeded"; includeFull?: boolean }): Promise<unknown>;
|
|
698
700
|
// --- scripts ---
|
|
699
701
|
script_search(args: { query?: string; scope?: ScriptScope; limit?: number }): Promise<unknown>;
|
|
700
702
|
script_run(args: { name?: string; source?: string; args?: unknown; intent?: string; scope?: ScriptScope; fsMode?: ScriptFsMode; idempotencyKey?: string }): Promise<unknown>;
|
|
@@ -1333,7 +1335,7 @@ function scriptTypesBase() {
|
|
|
1333
1335
|
const dir = process.env.SCRIPT_TYPES_DIR;
|
|
1334
1336
|
if (dir)
|
|
1335
1337
|
return `${dir}/index.ts`;
|
|
1336
|
-
return new URL("../../index.ts", import.meta.url)
|
|
1338
|
+
return fileURLToPath2(new URL("../../index.ts", import.meta.url));
|
|
1337
1339
|
}
|
|
1338
1340
|
function createCompilerHost(files, options) {
|
|
1339
1341
|
const host = import_typescript.default.createCompilerHost(options, true);
|
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
REBOOT_RETRY_PIN_TAG,
|
|
3
|
+
agentsWithLiveRuntime,
|
|
4
|
+
countActiveRuntimeInstancesForAgent,
|
|
3
5
|
createPoolStarvationDecisionTask,
|
|
4
6
|
createRerouteDecisionTask,
|
|
5
7
|
createResumeFollowUp,
|
|
8
|
+
expireStaleRuntimeInstances,
|
|
6
9
|
getNextResumeGeneration,
|
|
7
10
|
getPinCandidateAgent,
|
|
8
11
|
getResumeGeneration,
|
|
9
12
|
repointTrackerSyncBySwarmId
|
|
10
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-2a75z9c5.js";
|
|
14
|
+
import {
|
|
15
|
+
isMultiRuntimeEnabled
|
|
16
|
+
} from "./cli-pzq5rjym.js";
|
|
11
17
|
import {
|
|
12
18
|
getExecutorRegistry,
|
|
13
19
|
recoverIncompleteRuns
|
|
14
|
-
} from "./cli-
|
|
20
|
+
} from "./cli-xv8t8p3c.js";
|
|
15
21
|
import {
|
|
16
22
|
MAX_EMPTY_POLLS,
|
|
17
23
|
assignUnassignedTaskPending,
|
|
@@ -51,13 +57,13 @@ import {
|
|
|
51
57
|
releaseStaleReviewingTasks,
|
|
52
58
|
supersedeTask,
|
|
53
59
|
updateAgentStatus
|
|
54
|
-
} from "./cli-
|
|
60
|
+
} from "./cli-zfbf3srj.js";
|
|
55
61
|
import {
|
|
56
62
|
init_registry,
|
|
57
63
|
init_resolver,
|
|
58
64
|
registerTemplate,
|
|
59
65
|
resolveTemplate
|
|
60
|
-
} from "./cli-
|
|
66
|
+
} from "./cli-qes8ef67.js";
|
|
61
67
|
import {
|
|
62
68
|
init_secret_scrubber,
|
|
63
69
|
scrubSecrets
|
|
@@ -244,9 +250,11 @@ async function codeLevelTriage() {
|
|
|
244
250
|
reviewingTasks: 0,
|
|
245
251
|
mentionProcessing: 0,
|
|
246
252
|
inboxProcessing: 0,
|
|
247
|
-
workflowRuns: 0
|
|
253
|
+
workflowRuns: 0,
|
|
254
|
+
staleRuntimes: 0
|
|
248
255
|
}
|
|
249
256
|
};
|
|
257
|
+
findings.staleCleanup.staleRuntimes = expireStaleRuntimeInstances().expired;
|
|
250
258
|
detectAndRemediateStalledTasks(findings);
|
|
251
259
|
checkWorkerHealth(findings);
|
|
252
260
|
autoAssignPoolTasks(findings);
|
|
@@ -313,7 +321,7 @@ function remediateCrashedWorkerTask(findings, task, opts) {
|
|
|
313
321
|
console.log(`[Heartbeat] Workflow-step task ${task.id.slice(0, 8)} failed — engine will handle retry (${opts.shortLabel})`);
|
|
314
322
|
const remaining2 = getActiveTaskCount(task.agentId);
|
|
315
323
|
if (remaining2 === 0)
|
|
316
|
-
|
|
324
|
+
restoreAgentIdleAfterRemediation(task.agentId);
|
|
317
325
|
}
|
|
318
326
|
return;
|
|
319
327
|
}
|
|
@@ -330,7 +338,7 @@ function remediateCrashedWorkerTask(findings, task, opts) {
|
|
|
330
338
|
console.log(`[Heartbeat] Auto-failed task ${task.id.slice(0, 8)} — ${opts.shortLabel} (${skipAutoResume ? "skipRetry taskType" : "resume already exists"})`);
|
|
331
339
|
const remaining2 = getActiveTaskCount(task.agentId);
|
|
332
340
|
if (remaining2 === 0)
|
|
333
|
-
|
|
341
|
+
restoreAgentIdleAfterRemediation(task.agentId);
|
|
334
342
|
}
|
|
335
343
|
return;
|
|
336
344
|
}
|
|
@@ -348,7 +356,7 @@ function remediateCrashedWorkerTask(findings, task, opts) {
|
|
|
348
356
|
console.warn(`[Heartbeat] Auto-failed task ${task.id.slice(0, 8)} — ${RESUME_BUDGET_EXHAUSTED_REASON} (${opts.shortLabel})`);
|
|
349
357
|
const remaining2 = getActiveTaskCount(task.agentId);
|
|
350
358
|
if (remaining2 === 0)
|
|
351
|
-
|
|
359
|
+
restoreAgentIdleAfterRemediation(task.agentId);
|
|
352
360
|
}
|
|
353
361
|
return;
|
|
354
362
|
}
|
|
@@ -396,7 +404,7 @@ function remediateCrashedWorkerTask(findings, task, opts) {
|
|
|
396
404
|
deleteActiveSession(task.id);
|
|
397
405
|
const remaining = getActiveTaskCount(task.agentId);
|
|
398
406
|
if (remaining === 0)
|
|
399
|
-
|
|
407
|
+
restoreAgentIdleAfterRemediation(task.agentId);
|
|
400
408
|
}
|
|
401
409
|
function getBootEpochMs() {
|
|
402
410
|
const gs = globalThis;
|
|
@@ -449,7 +457,7 @@ async function runRebootSweep() {
|
|
|
449
457
|
if (!failed)
|
|
450
458
|
continue;
|
|
451
459
|
if (getActiveTaskCount(task.agentId) === 0) {
|
|
452
|
-
|
|
460
|
+
restoreAgentIdleAfterRemediation(task.agentId);
|
|
453
461
|
}
|
|
454
462
|
if (SKIP_AUTO_RESUME_TYPES.has(task.taskType ?? "")) {
|
|
455
463
|
rebootAffectedTasks.push({ original: failed, retryTaskId: null });
|
|
@@ -524,7 +532,9 @@ function checkWorkerHealth(findings) {
|
|
|
524
532
|
}
|
|
525
533
|
function autoAssignPoolTasks(findings) {
|
|
526
534
|
getDb().transaction(() => {
|
|
527
|
-
const
|
|
535
|
+
const multiRuntime = isMultiRuntimeEnabled();
|
|
536
|
+
const withLiveRuntime = multiRuntime ? agentsWithLiveRuntime() : null;
|
|
537
|
+
const idleWorkers = getIdleWorkersWithCapacity().filter((w) => (w.emptyPollCount ?? 0) < MAX_EMPTY_POLLS && (withLiveRuntime === null || withLiveRuntime.has(w.id)));
|
|
528
538
|
if (idleWorkers.length === 0)
|
|
529
539
|
return;
|
|
530
540
|
const reservedByWorker = new Map;
|
|
@@ -638,6 +648,11 @@ function escalateStarvedPoolTasks(findings) {
|
|
|
638
648
|
}
|
|
639
649
|
}
|
|
640
650
|
}
|
|
651
|
+
function restoreAgentIdleAfterRemediation(agentId) {
|
|
652
|
+
if (isMultiRuntimeEnabled() && countActiveRuntimeInstancesForAgent(agentId) === 0)
|
|
653
|
+
return;
|
|
654
|
+
updateAgentStatus(agentId, "idle");
|
|
655
|
+
}
|
|
641
656
|
async function cleanupStaleResources(findings) {
|
|
642
657
|
findings.staleCleanup.sessions = cleanupStaleSessions(STALE_CLEANUP_THRESHOLD_MINUTES);
|
|
643
658
|
findings.staleCleanup.reviewingTasks = releaseStaleReviewingTasks(STALE_CLEANUP_THRESHOLD_MINUTES);
|
|
@@ -848,9 +863,11 @@ async function runHeartbeatSweep() {
|
|
|
848
863
|
reviewingTasks: 0,
|
|
849
864
|
mentionProcessing: 0,
|
|
850
865
|
inboxProcessing: 0,
|
|
851
|
-
workflowRuns: 0
|
|
866
|
+
workflowRuns: 0,
|
|
867
|
+
staleRuntimes: 0
|
|
852
868
|
}
|
|
853
869
|
};
|
|
870
|
+
cleanupOnlyFindings.staleCleanup.staleRuntimes = expireStaleRuntimeInstances().expired;
|
|
854
871
|
await cleanupStaleResources(cleanupOnlyFindings);
|
|
855
872
|
logFindings(cleanupOnlyFindings);
|
|
856
873
|
return;
|
|
@@ -899,12 +916,11 @@ function startHeartbeat(intervalMs = defaultIntervalMs()) {
|
|
|
899
916
|
return;
|
|
900
917
|
}
|
|
901
918
|
console.log(`[Heartbeat] Starting with ${intervalMs}ms interval`);
|
|
902
|
-
setTimeout(
|
|
903
|
-
|
|
904
|
-
runHeartbeatSweep();
|
|
919
|
+
setTimeout(() => {
|
|
920
|
+
runRebootSweep().then(() => runHeartbeatSweep()).catch((err) => console.error("[Heartbeat] boot sweep failed:", scrubSecrets(err instanceof Error ? err.message : String(err))));
|
|
905
921
|
}, 5000);
|
|
906
922
|
heartbeatInterval = setInterval(() => {
|
|
907
|
-
runHeartbeatSweep();
|
|
923
|
+
runHeartbeatSweep().catch((err) => console.error("[Heartbeat] sweep failed:", scrubSecrets(err instanceof Error ? err.message : String(err))));
|
|
908
924
|
}, intervalMs);
|
|
909
925
|
startHeartbeatChecklist();
|
|
910
926
|
}
|
|
@@ -955,7 +971,7 @@ function startHeartbeatChecklist(intervalMs = HEARTBEAT_CHECKLIST_INTERVAL_MS) {
|
|
|
955
971
|
console.log(`[Heartbeat] Checklist starting with ${intervalMs}ms interval`);
|
|
956
972
|
setTimeout(() => createBootTriageTask(), 90000);
|
|
957
973
|
checklistInterval = setInterval(() => {
|
|
958
|
-
checkHeartbeatChecklist();
|
|
974
|
+
checkHeartbeatChecklist().catch((err) => console.error("[Heartbeat] checklist check failed:", scrubSecrets(err instanceof Error ? err.message : String(err))));
|
|
959
975
|
}, intervalMs);
|
|
960
976
|
}
|
|
961
977
|
function stopHeartbeatChecklist() {
|