@desplega.ai/agent-swarm 1.149.0 → 1.150.0
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 +7 -3
- package/dist/{acp-adapter-4jncb126.js → acp-adapter-d5mzggyk.js} +1 -1
- package/dist/{actions-31vp3ae7.js → actions-wn6ew0p7.js} +11 -10
- package/dist/{anthropic-messages-vs2rabzp.js → anthropic-messages-ec35ktvx.js} +4 -4
- package/dist/{app-1hh67x8w.js → app-dty7p9hg.js} +7 -7
- package/dist/{artifact-gj9arwrr.js → artifact-td4q4dch.js} +1 -1
- package/dist/{assistant-z66dmz6p.js → assistant-q4vhgjtx.js} +16 -17
- package/dist/{boot-reembed-wxa8ya0s.js → boot-reembed-92292pgf.js} +9 -9
- package/dist/{boot-reembed-fqzxxzjh.js → boot-reembed-n15q6s9x.js} +8 -8
- package/dist/{boot-scrub-logs-jnyndh79.js → boot-scrub-logs-44pc955m.js} +5 -5
- package/dist/{claude-adapter-3qpa9w0j.js → claude-adapter-cjegjbje.js} +14 -14
- package/dist/{claude-managed-adapter-qvsmh6mv.js → claude-managed-adapter-p3ts5m9m.js} +2 -2
- package/dist/{claude-sdk-session-2yxgjs5d.js → claude-sdk-session-7ywbn12v.js} +14 -14
- package/dist/{cli-cr12paw2.js → cli-111ey3ra.js} +5 -5
- package/dist/{cli-4wtq5jjv.js → cli-1mx65de9.js} +1 -1
- package/dist/{cli-9d8ntetj.js → cli-2658f6at.js} +1 -1
- package/dist/{cli-n3dz2942.js → cli-3ckzxdt1.js} +10 -6
- package/dist/{cli-yb9qhqam.js → cli-3mh119qv.js} +184 -67
- package/dist/{cli-ykxrnd1q.js → cli-72xdszyx.js} +2 -2
- package/dist/{cli-xm87hzbw.js → cli-7fesa1ky.js} +1 -1
- package/dist/{cli-3q5ejx9p.js → cli-7kwmt3r5.js} +2 -2
- package/dist/{cli-2qts1hys.js → cli-8chp8xab.js} +2 -2
- package/dist/{cli-qaacms9y.js → cli-9gqddmxs.js} +122 -97
- package/dist/{cli-zvz62chv.js → cli-a45d5v9b.js} +4 -4
- package/dist/{cli-9xvdm3bx.js → cli-asvrh7kj.js} +1 -1
- package/dist/{cli-kgz4np97.js → cli-b8x19vbh.js} +4 -4
- package/dist/{cli-9fy6nk6g.js → cli-ceb5y160.js} +1 -1
- package/dist/{cli-k0cr4kat.js → cli-ck1vqzdj.js} +1 -1
- package/dist/{cli-e29gmdmw.js → cli-dv6cdjs2.js} +2 -1
- package/dist/{cli-jecc01cb.js → cli-dyx0237s.js} +1 -1
- package/dist/{cli-kjwt6hdf.js → cli-gm0fhz13.js} +3 -3
- package/dist/{cli-sd5pv3b1.js → cli-h505yhex.js} +2 -2
- package/dist/{handlers-nbzdzn9k.js → cli-hbagregr.js} +15 -38
- package/dist/{cli-08b07b4r.js → cli-hmyynq9b.js} +1 -1
- package/dist/{cli-d8ftsp62.js → cli-kt7wevqh.js} +20 -13
- package/dist/{cli-gjhjfeeg.js → cli-kyysm7m3.js} +1 -1
- package/dist/{cli-1ebpar1q.js → cli-mzb0n642.js} +6 -6
- package/dist/{cli-q50ef8g0.js → cli-n1yj5fd5.js} +1 -1
- package/dist/{cli-3apbzgyk.js → cli-n75jt793.js} +13 -9
- package/dist/{cli-19f354qr.js → cli-q04q68be.js} +2 -2
- package/dist/{cli-yab68w40.js → cli-qp69dd5d.js} +29 -14
- package/dist/{cli-6pqcb4q0.js → cli-rnsr8asm.js} +12 -11
- package/dist/{cli-ygweqcn4.js → cli-rwp3ksm7.js} +91 -108
- package/dist/{cli-phsxnkp6.js → cli-ryz8q8p1.js} +74 -58
- package/dist/{cli-e95cx1eb.js → cli-taym3dmg.js} +10 -10
- package/dist/{cli-nye12xk5.js → cli-ttje5a4z.js} +7 -4
- package/dist/{cli-9hspd3dp.js → cli-vr6qj104.js} +1 -1
- package/dist/{cli-mnmsfd1w.js → cli-xjb9wghj.js} +7 -3
- package/dist/{cli-gv88e1vf.js → cli-ydk0wjj8.js} +1 -1
- package/dist/{cli-aae6hz6a.js → cli-zd21jrrc.js} +3 -3
- package/dist/{cli-7smrsr25.js → cli-zthatyrx.js} +23 -11
- package/dist/cli.js +19 -19
- package/dist/{codex-adapter-8meawydj.js → codex-adapter-rn3aq7jm.js} +7 -7
- package/dist/{codex-hook-hfrt9shr.js → codex-hook-gthcmm0g.js} +3 -3
- package/dist/{codex-session-runner-gjgxyp5j.js → codex-session-runner-bge0cbsw.js} +7 -7
- package/dist/{commands-hz3nb95f.js → commands-26phw0pc.js} +5 -5
- package/dist/{db-ggz97zbm.js → db-jxjx6s1b.js} +6 -6
- package/dist/{e2b-p04vmtx0.js → e2b-413b8t4v.js} +1 -1
- package/dist/handlers-vr1djg4n.js +41 -0
- package/dist/{hook-bks2q1f6.js → hook-jw0ztn96.js} +9 -9
- package/dist/{hook-kq9wp0ep.js → hook-t6fqsggw.js} +10 -10
- package/dist/{http-hrf77v87.js → http-hyc7s57s.js} +80 -71
- package/dist/{index-n28pw1zt.js → index-1d9r6a74.js} +18 -18
- package/dist/{index-cqtebbhb.js → index-bcyx5djw.js} +17 -17
- package/dist/{index-6nsbg88z.js → index-sfhaq59d.js} +408 -74
- package/dist/{index-8hmeg8j1.js → index-wtwpthe1.js} +17 -17
- package/dist/{keepalive-dxc12gvg.js → keepalive-fbsak4ya.js} +7 -7
- package/dist/{lead-yckfn18d.js → lead-rdzdm627.js} +39 -39
- package/dist/{maintenance-6kfb2m5e.js → maintenance-25z1c1vf.js} +9 -9
- package/dist/{node-x1g4v0pq.js → node-209sxmg3.js} +9 -9
- package/dist/{oauth-refresh-sweep-1x1ac722.js → oauth-refresh-sweep-j3d7gtse.js} +6 -6
- package/dist/{onboard-dcyt1609.js → onboard-dkcwrc75.js} +2 -2
- package/dist/{otel-impl-tbk3e5dr.js → otel-impl-8rgyy3j8.js} +1 -1
- package/dist/{pi-mono-adapter-zvshk5cj.js → pi-mono-adapter-4s2bbkgq.js} +8 -8
- package/dist/{pricing-refresh-kaqg567e.js → pricing-refresh-9cek71nq.js} +7 -7
- package/dist/{rbac-roles-cf97v1vd.js → rbac-roles-vk8mqp9v.js} +6 -6
- package/dist/{rbac-roles-ammq6rd2.js → rbac-roles-z98s2ypy.js} +5 -5
- package/dist/{render-v2-80w603vy.js → render-v2-3j26g0qh.js} +7 -7
- package/dist/{seed-pricing-zbrn83xv.js → seed-pricing-7rxhcnzm.js} +6 -6
- package/dist/{setup-fe66kczs.js → setup-e2t7vz0c.js} +2 -2
- package/dist/work-objects-8d3nd3x2.js +141 -0
- package/dist/{worker-qmb2d1e2.js → worker-0x9fn7nq.js} +39 -39
- package/openapi.json +15 -4
- package/package.json +3 -3
- package/src/agentmail/handlers.ts +5 -0
- package/src/be/budget-refusal-notify.ts +1 -0
- package/src/be/db/tasks/read.ts +3 -0
- package/src/be/db/tasks/write.ts +13 -1
- package/src/be/db.ts +4 -2
- package/src/be/migrations/153_deferred_task_wait_members.sql +25 -0
- package/src/be/migrations/154_routing_source.sql +3 -0
- package/src/be/scripts/typecheck.ts +7 -3
- package/src/be/seed/automation-toggle.ts +69 -0
- package/src/be/seed/schedules-seeder.ts +53 -8
- package/src/be/seed/workflows-seeder.ts +35 -6
- package/src/be/seed-scripts/catalog/delegate.ts +3 -1
- package/src/be/seed-skills/bundled-files.generated.json +1 -1
- package/src/be/steering.ts +1 -0
- package/src/be/swarm-config-guard.ts +1 -0
- package/src/commands/credential-refresh.ts +70 -0
- package/src/commands/provider-credentials.ts +2 -25
- package/src/commands/runner.ts +23 -56
- package/src/github/handlers.ts +9 -0
- package/src/gitlab/handlers.ts +4 -0
- package/src/heartbeat/heartbeat.ts +3 -0
- package/src/http/approval-requests.ts +1 -0
- package/src/http/apps.ts +1 -0
- package/src/http/config.ts +4 -1
- package/src/http/core.ts +4 -2
- package/src/http/index.ts +16 -3
- package/src/http/script-runs.ts +5 -0
- package/src/http/tasks.ts +5 -0
- package/src/integrations/kapso/inbound.ts +1 -0
- package/src/jira/sync.ts +2 -0
- package/src/linear/sync.ts +2 -0
- package/src/prompts/session-templates.ts +13 -9
- package/src/providers/claude-adapter.ts +21 -8
- package/src/scheduler/deferred-task-waits.ts +34 -5
- package/src/scheduler/schedule-task.ts +5 -1
- package/src/scheduler/scheduler.ts +104 -123
- package/src/scripts-runtime/types/stdlib.d.ts +7 -3
- package/src/scripts-runtime/types/swarm-sdk.d.ts +7 -3
- package/src/slack/HEURISTICS.md +2 -0
- package/src/slack/actions.ts +1 -0
- package/src/slack/app.ts +2 -0
- package/src/slack/assistant.ts +4 -12
- package/src/slack/handlers.ts +9 -14
- package/src/slack/inbound-files.ts +3 -3
- package/src/slack/render-v2.ts +17 -3
- package/src/slack/thread-buffer.ts +66 -23
- package/src/slack/work-objects.test.ts +252 -0
- package/src/slack/work-objects.ts +118 -0
- package/src/tasks/worker-follow-up.ts +4 -0
- package/src/tests/acp-adapter.test.ts +10 -10
- package/src/tests/agent-fs-live-url.test.ts +40 -0
- package/src/tests/agent-fs-provision-seeder.test.ts +12 -12
- package/src/tests/api-key-tracking.test.ts +18 -18
- package/src/tests/api-key.test.ts +4 -2
- package/src/tests/apps-rbac.test.ts +1 -1
- package/src/tests/apps-spike5.test.ts +1 -1
- package/src/tests/apps-sync-engine.test.ts +8 -8
- package/src/tests/apps-user-config.test.ts +1 -1
- package/src/tests/artifact-sdk.test.ts +8 -8
- package/src/tests/asset-key-mcp.test.ts +2 -0
- package/src/tests/automation-preflight-alert.test.ts +1 -1
- package/src/tests/base-prompt.test.ts +6 -6
- package/src/tests/budget-user-scope.test.ts +1 -1
- package/src/tests/budgets-routes.test.ts +1 -1
- package/src/tests/claude-adapter-binary.test.ts +22 -40
- package/src/tests/claude-adapter-otel.test.ts +13 -7
- package/src/tests/claude-adapter.test.ts +8 -6
- package/src/tests/claude-hook-credentials.test.ts +3 -3
- package/src/tests/claude-managed-adapter.test.ts +4 -4
- package/src/tests/claude-managed-setup.test.ts +3 -3
- package/src/tests/claude-sdk-lifecycle.test.ts +1 -1
- package/src/tests/claude-sdk-transport.test.ts +6 -6
- package/src/tests/claude-stop-hook.test.ts +8 -8
- package/src/tests/claude-worker-parity.test.ts +3 -3
- package/src/tests/codex-adapter-pool-auth-revalidate.test.ts +5 -5
- package/src/tests/codex-adapter.test.ts +7 -5
- package/src/tests/codex-app-server.test.ts +2 -2
- package/src/tests/codex-login.test.ts +15 -15
- package/src/tests/codex-oauth-credential-info.test.ts +4 -4
- package/src/tests/codex-oauth-keep-warm.test.ts +4 -4
- package/src/tests/codex-oauth-refresh-lock.test.ts +1 -1
- package/src/tests/codex-oauth-storage.test.ts +7 -7
- package/src/tests/codex-pool.test.ts +1 -1
- package/src/tests/codex-steering-hook.test.ts +1 -1
- package/src/tests/codex-swarm-events.test.ts +1 -1
- package/src/tests/config-api-only-keys.test.ts +1 -1
- package/src/tests/config-session-auth.test.ts +2 -2
- package/src/tests/connection-embedded-auth.test.ts +20 -18
- package/src/tests/core-auth.test.ts +1 -1
- package/src/tests/create-page-tool.test.ts +3 -3
- package/src/tests/credential-refresh.test.ts +115 -0
- package/src/tests/credential-wait.test.ts +2 -2
- package/src/tests/credentials.test.ts +6 -4
- package/src/tests/db-queries-oauth.test.ts +40 -40
- package/src/tests/defer-task.test.ts +73 -8
- package/src/tests/deferred-task-wait-migration.test.ts +64 -0
- package/src/tests/deferred-task-wake.test.ts +190 -1
- package/src/tests/devin-adapter.test.ts +1 -1
- package/src/tests/devin-api.test.ts +1 -1
- package/src/tests/e2b-dispatch.test.ts +21 -19
- package/src/tests/e2e-claude-transport.test.ts +3 -3
- package/src/tests/e2e-redact.test.ts +6 -6
- package/src/tests/ensure-token.test.ts +68 -68
- package/src/tests/entrypoint-api-readiness.test.ts +1 -1
- package/src/tests/entrypoint-codex-oauth-seed.test.ts +13 -13
- package/src/tests/events-http.test.ts +1 -1
- package/src/tests/fs-routes.test.ts +1 -1
- package/src/tests/gitlab-auth.test.ts +10 -10
- package/src/tests/harness-provider-resolution.test.ts +8 -5
- package/src/tests/heartbeat-reroute-decision.test.ts +1 -0
- package/src/tests/helper-credentials.test.ts +137 -0
- package/src/tests/http/context-routes.test.ts +2 -2
- package/src/tests/http-api-integration.test.ts +5 -2
- package/src/tests/http-users.test.ts +1 -1
- package/src/tests/identity-refresh.test.ts +2 -2
- package/src/tests/internal-ai/complete-structured.test.ts +2 -2
- package/src/tests/internal-ai/credentials.test.ts +19 -17
- package/src/tests/jira-metadata.test.ts +1 -1
- package/src/tests/jira-oauth.test.ts +5 -5
- package/src/tests/jira-sync.test.ts +1 -1
- package/src/tests/jira-webhook-lifecycle.test.ts +3 -3
- package/src/tests/jira-webhook.test.ts +2 -2
- package/src/tests/kapso-inbound.test.ts +2 -2
- package/src/tests/kv-http.test.ts +1 -1
- package/src/tests/kv-namespace-resolution.test.ts +1 -1
- package/src/tests/kv-page-proxy.test.ts +2 -2
- package/src/tests/launch-password-rejection.test.ts +2 -2
- package/src/tests/linear-webhook.test.ts +1 -1
- package/src/tests/mcp-oauth-dcr-reuse.test.ts +6 -6
- package/src/tests/mcp-oauth-ensure-token.test.ts +28 -22
- package/src/tests/mcp-oauth-manual-client.test.ts +16 -12
- package/src/tests/mcp-oauth-queries.test.ts +35 -32
- package/src/tests/mcp-oauth-resolve-secrets.test.ts +8 -8
- package/src/tests/mcp-oauth-wrapper.test.ts +20 -20
- package/src/tests/mcp-user-route.test.ts +1 -1
- package/src/tests/memory-edges.test.ts +1 -1
- package/src/tests/memory-rate-endpoint.test.ts +1 -1
- package/src/tests/memory-rate-tool.test.ts +2 -2
- package/src/tests/memory-rater-e2e.test.ts +1 -1
- package/src/tests/memory-rater-llm-summarizer.test.ts +3 -3
- package/src/tests/memory-rater-llm.test.ts +1 -1
- package/src/tests/model-control.test.ts +3 -0
- package/src/tests/multi-runtime-registration.test.ts +97 -3
- package/src/tests/oauth-access-token-tool.test.ts +18 -18
- package/src/tests/oauth-callback-flow.test.ts +8 -8
- package/src/tests/oauth-credential-bindings.test.ts +29 -27
- package/src/tests/oauth-keepalive.test.ts +10 -10
- package/src/tests/oauth-presets.test.ts +13 -5
- package/src/tests/oauth-refresh-failure.test.ts +9 -9
- package/src/tests/oauth-refresh-sweep.test.ts +20 -13
- package/src/tests/oauth-wrapper.test.ts +1 -1
- package/src/tests/onboard-compose.test.ts +3 -3
- package/src/tests/onboard-env.test.ts +26 -26
- package/src/tests/onboard-non-interactive.test.ts +4 -4
- package/src/tests/opencode-adapter.test.ts +1 -1
- package/src/tests/opencode-plugin.test.ts +2 -2
- package/src/tests/otel-session-cost-metrics.test.ts +1 -1
- package/src/tests/page-proxy-authed.test.ts +2 -2
- package/src/tests/page-proxy.test.ts +2 -2
- package/src/tests/page-session.test.ts +7 -7
- package/src/tests/page-viewer-auth.test.ts +2 -2
- package/src/tests/pages-authed-mode.test.ts +1 -1
- package/src/tests/pages-http.test.ts +1 -1
- package/src/tests/pages-password-mode.test.ts +1 -1
- package/src/tests/pages-public-authed-401.test.ts +1 -1
- package/src/tests/pages-public-html.test.ts +2 -2
- package/src/tests/pages-view-count.test.ts +1 -1
- package/src/tests/pi-mono-adapter.test.ts +10 -10
- package/src/tests/pi-mono-extension.test.ts +2 -2
- package/src/tests/pricing-routes.test.ts +1 -1
- package/src/tests/profile-sync-warning.test.ts +8 -8
- package/src/tests/profile-sync.test.ts +8 -8
- package/src/tests/prompt-template-session.test.ts +36 -5
- package/src/tests/provider-process-group.test.ts +95 -4
- package/src/tests/providers/pi-cost.test.ts +1 -1
- package/src/tests/queue-stall-alarm.test.ts +1 -1
- package/src/tests/rbac-admission.test.ts +1 -1
- package/src/tests/rbac-charact-http.test.ts +1 -1
- package/src/tests/rbac-e2e-helpers.ts +1 -1
- package/src/tests/realtime-room-surfaces.test.ts +1 -1
- package/src/tests/reload-config.test.ts +1 -1
- package/src/tests/routing-reason-contract.test.ts +76 -3
- package/src/tests/routing-reason-inventory.test.ts +11 -6
- package/src/tests/routing-source.test.ts +53 -0
- package/src/tests/runner-agent-fs-provision-retry.test.ts +1 -1
- package/src/tests/runner-context-preamble.test.ts +1 -1
- package/src/tests/runner-deployment-resume.test.ts +1 -1
- package/src/tests/runner-fallback-output.test.ts +1 -1
- package/src/tests/runner-identity-refresh.test.ts +1 -1
- package/src/tests/runner-skills-refresh.test.ts +1 -1
- package/src/tests/schedule-target-type.test.ts +3 -3
- package/src/tests/scheduled-tasks.test.ts +14 -5
- package/src/tests/scheduler-occurrence.test.ts +347 -0
- package/src/tests/script-apis-mcp.test.ts +1 -1
- package/src/tests/script-connections-http.test.ts +61 -58
- package/src/tests/script-connections-mcp.test.ts +1 -1
- package/src/tests/script-connections.test.ts +1 -1
- package/src/tests/script-runs-http.test.ts +15 -7
- package/src/tests/script-workflows-runtime-e2e.test.ts +1 -1
- package/src/tests/scripts-external-api.test.ts +1 -1
- package/src/tests/scripts-http.test.ts +1 -1
- package/src/tests/scripts-mcp-e2e.test.ts +1 -1
- package/src/tests/scripts-only-gating.test.ts +2 -2
- package/src/tests/scripts-retention.test.ts +1 -1
- package/src/tests/scripts-runtime-identity.test.ts +1 -1
- package/src/tests/scripts-runtime-secret-egress.test.ts +1 -1
- package/src/tests/scripts-runtime.test.ts +6 -4
- package/src/tests/scripts-typecheck.test.ts +21 -0
- package/src/tests/sdk-allowlist.test.ts +1 -1
- package/src/tests/secret-scrubber.test.ts +38 -31
- package/src/tests/seed-registry.test.ts +46 -8
- package/src/tests/seed-schedules.test.ts +139 -8
- package/src/tests/seed-workflows.test.ts +93 -7
- package/src/tests/send-task-output-schema.test.ts +9 -1
- package/src/tests/send-task-requested-by.test.ts +1 -0
- package/src/tests/send-task-slack-routing-guard.test.ts +2 -0
- package/src/tests/session-costs-codex-recompute.test.ts +1 -1
- package/src/tests/session-costs-golden.test.ts +2 -2
- package/src/tests/session-costs-model-key-normalize.test.ts +2 -2
- package/src/tests/session-costs-recompute-all-providers.test.ts +1 -1
- package/src/tests/session-tokens.test.ts +1 -1
- package/src/tests/shutdown-error-scrubbing.test.ts +1 -1
- package/src/tests/slack-file-tools-attachments.test.ts +1 -1
- package/src/tests/slack-inbound-files.test.ts +222 -86
- package/src/tests/slack-reaction-config.test.ts +5 -4
- package/src/tests/slack-read-boundaries.test.ts +1 -1
- package/src/tests/slack-render-v2.test.ts +120 -1
- package/src/tests/status.test.ts +7 -7
- package/src/tests/steering-core.test.ts +1 -1
- package/src/tests/steering-transport.test.ts +4 -4
- package/src/tests/store-progress-output-guidance.test.ts +34 -0
- package/src/tests/swarm-tool-result-gate.test.ts +11 -11
- package/src/tests/swarm-x-tool.test.ts +7 -5
- package/src/tests/sync-ai-toolbox-skills.test.ts +19 -0
- package/src/tests/task-supersede-resume.test.ts +1 -1
- package/src/tests/task-tools-ctx.test.ts +2 -0
- package/src/tests/tasks-requested-by-filter.test.ts +2 -2
- package/src/tests/telemetry-init.test.ts +11 -3
- package/src/tests/tool-output-agent-id.test.ts +1 -0
- package/src/tests/tracker-fold.test.ts +7 -7
- package/src/tests/tracker-tools.test.ts +3 -3
- package/src/tests/ui-followup-lead-delegation.test.ts +1 -0
- package/src/tests/unified-oauth-migration.test.ts +5 -5
- package/src/tests/user-token-rest-auth.test.ts +1 -1
- package/src/tests/user-token-routes.test.ts +1 -1
- package/src/tests/whoami-route.test.ts +1 -1
- package/src/tests/workflow-agent-task.test.ts +15 -13
- package/src/tests/workflow-ctx.test.ts +1 -1
- package/src/tests/workflow-e2e.test.ts +1 -1
- package/src/tests/workflow-engine-v2.test.ts +3 -1
- package/src/tests/workflow-executors.test.ts +2 -2
- package/src/tests/workflow-http-v2.test.ts +8 -6
- package/src/tests/workflow-input-redaction.test.ts +7 -5
- package/src/tests/workflow-integration-io.test.ts +2 -2
- package/src/tests/workflow-llm.test.ts +5 -5
- package/src/tests/workflow-registry.test.ts +1 -1
- package/src/tests/workflow-swarm-script.test.ts +1 -1
- package/src/tests/workflow-triggers-v2.test.ts +23 -21
- package/src/tests/x-composio.test.ts +9 -7
- package/src/tests/x402-client.test.ts +1 -1
- package/src/tests/x402-config.test.ts +28 -41
- package/src/tools/defer-task.ts +156 -24
- package/src/tools/send-task.ts +21 -1
- package/src/tools/skills/skill-publish.ts +1 -0
- package/src/tools/store-progress.ts +1 -1
- package/src/tools/templates.ts +2 -1
- package/src/types.ts +11 -0
- package/src/utils/constants.ts +7 -1
- package/src/utils/credentials.test.ts +16 -16
- package/src/workflows/executors/agent-task.ts +5 -0
- package/templates/ai-toolbox.manifest.json +7 -1
- package/templates/schedules/daily-blocker-digest/config.json +6 -1
- package/templates/schedules/daily-compounding-reflection/config.json +1 -0
- package/templates/schedules/daily-hn-briefing/config.json +1 -1
- package/templates/schedules/daily-status-report/config.json +6 -1
- package/templates/schedules/daily-swarm-update-check/config.json +19 -0
- package/templates/schedules/daily-swarm-update-check/content.md +49 -0
- package/templates/schedules/daily-workflow-health-audit/config.json +6 -1
- package/templates/schedules/gtm-weekly-review/config.json +1 -1
- package/templates/schedules/weekly-code-health-reports/config.json +1 -1
- package/templates/schedules/weekly-dependabot-triage/config.json +1 -1
- package/templates/schedules/weekly-dora-metrics/config.json +1 -1
- package/templates/schedules/weekly-harness-upgrade-check/config.json +1 -1
- package/templates/skills/delegate-work/files/scripts/codex-exec.sh +1 -1
- package/templates/skills/serply-search/SKILL.md +95 -0
- package/templates/skills/serply-search/config.json +13 -0
- package/templates/skills/serply-search/content.md +90 -0
- package/templates/skills/swarm-scripts/SKILL.md +2 -2
- package/templates/skills/swarm-scripts/content.md +2 -2
- package/templates/workflows/claude-code-changelog-watch/config.json +1 -1
- package/templates/workflows/gsc-topic-miner/config.json +1 -1
- package/templates/workflows/linear-drain-loop/config.json +1 -1
- package/templates/workflows/llm-safe-release-context/config.json +1 -1
- package/templates/workflows/ralph-loop/config.json +1 -1
- package/dist/{azure-openai-responses-cqar64rc.js → azure-openai-responses-g85jv7m8.js} +8 -8
- package/dist/{cli-4xz3pmrq.js → cli-8qx7jnrk.js} +5 -5
- package/dist/{cli-6664w7y4.js → cli-wk0gjrn3.js} +3 -3
- package/dist/{google-vertex-ppw8ydpa.js → google-vertex-pkhpkbq9.js} +3 -3
- package/dist/{openai-codex-responses-g7w48y30.js → openai-codex-responses-pm5gnyfa.js} +4 -4
- package/dist/{openai-completions-0bqmsajw.js → openai-completions-qdcmkfnr.js} +12 -12
- package/dist/{openai-responses-nmeyptke.js → openai-responses-vwvk1taj.js} +13 -13
|
@@ -12,20 +12,20 @@ import {
|
|
|
12
12
|
renderAutomationTokens,
|
|
13
13
|
schedulePreflightInput,
|
|
14
14
|
startWorkflowExecution
|
|
15
|
-
} from "./cli-
|
|
15
|
+
} from "./cli-rnsr8asm.js";
|
|
16
16
|
import {
|
|
17
17
|
buildScriptCredentialBindings,
|
|
18
18
|
getScript,
|
|
19
19
|
getScriptApiConnectionDescriptors,
|
|
20
20
|
getScriptMcpConnectionDescriptors,
|
|
21
21
|
runScript
|
|
22
|
-
} from "./cli-
|
|
22
|
+
} from "./cli-zd21jrrc.js";
|
|
23
23
|
import {
|
|
24
24
|
createTaskWithSiblingAwareness
|
|
25
|
-
} from "./cli-
|
|
25
|
+
} from "./cli-n1yj5fd5.js";
|
|
26
26
|
import {
|
|
27
27
|
ensure
|
|
28
|
-
} from "./cli-
|
|
28
|
+
} from "./cli-kt7wevqh.js";
|
|
29
29
|
import {
|
|
30
30
|
getDbClient,
|
|
31
31
|
getDueScheduledTasks,
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
scheduleContextKey,
|
|
40
40
|
telemetry,
|
|
41
41
|
updateScheduledTask
|
|
42
|
-
} from "./cli-
|
|
42
|
+
} from "./cli-qp69dd5d.js";
|
|
43
43
|
import {
|
|
44
44
|
init_event_bus,
|
|
45
45
|
workflowEventBus
|
|
@@ -72,6 +72,7 @@ async function createStandaloneScheduleTask(schedule, extraTags = []) {
|
|
|
72
72
|
priority: schedule.priority,
|
|
73
73
|
agentId: schedule.targetAgentId,
|
|
74
74
|
routingReason: schedule.targetAgentId ? "human_pinned" : undefined,
|
|
75
|
+
routingSource: schedule.targetAgentId ? "engine_default" : undefined,
|
|
75
76
|
model: schedule.model,
|
|
76
77
|
modelTier: schedule.modelTier,
|
|
77
78
|
scheduleId: schedule.id,
|
|
@@ -81,7 +82,10 @@ async function createStandaloneScheduleTask(schedule, extraTags = []) {
|
|
|
81
82
|
parentTaskId: schedule.parentTaskId
|
|
82
83
|
});
|
|
83
84
|
if (schedule.taskType === "deferred" && schedule.parentTaskId) {
|
|
84
|
-
await getDbClient().run(
|
|
85
|
+
await getDbClient().run(`UPDATE deferred_task_wait_members SET taskId = ?, updated_at = ?
|
|
86
|
+
WHERE taskId = ? AND scheduleId IN (
|
|
87
|
+
SELECT scheduleId FROM deferred_task_waits WHERE status = 'pending'
|
|
88
|
+
)`, [task.id, new Date().toISOString(), schedule.parentTaskId]);
|
|
85
89
|
}
|
|
86
90
|
return task;
|
|
87
91
|
}
|
|
@@ -102,6 +106,19 @@ async function dispatchDeferredTaskWait(scheduleId, reason, extraTags = []) {
|
|
|
102
106
|
let schedule = await getScheduledTaskById(scheduleId);
|
|
103
107
|
if (!schedule?.enabled)
|
|
104
108
|
return {};
|
|
109
|
+
let cause = "ceiling expired";
|
|
110
|
+
if (reason !== "ceiling") {
|
|
111
|
+
const members = await client.query(`SELECT m.taskId, t.status AS taskStatus, EXISTS (
|
|
112
|
+
SELECT 1 FROM scheduled_tasks d
|
|
113
|
+
WHERE d.parentTaskId = t.id AND d.taskType = 'deferred' AND d.enabled = 1
|
|
114
|
+
) AS deferred
|
|
115
|
+
FROM deferred_task_wait_members m LEFT JOIN agent_tasks t ON t.id = m.taskId
|
|
116
|
+
WHERE m.scheduleId = ?`, [scheduleId]);
|
|
117
|
+
const matched = members.filter((member) => !member.deferred && (member.taskStatus === "completed" || member.taskStatus === "failed") && (wait.eventName === "settled" || wait.eventName === `task.${member.taskStatus}`));
|
|
118
|
+
if (!matched.length || wait.mode === "all" && matched.length !== members.length)
|
|
119
|
+
return {};
|
|
120
|
+
cause = members.length === 1 ? `task.${matched[0].taskStatus} for task ${matched[0].taskId}` : `${wait.mode} tasks matched ${wait.eventName}: ${matched.map((member) => `${member.taskId} (${member.taskStatus})`).join(", ")}`;
|
|
121
|
+
}
|
|
105
122
|
const now = new Date().toISOString();
|
|
106
123
|
const claimed = await client.run("UPDATE deferred_task_waits SET status = 'fired', firedBy = ?, resolvedAt = ?, updated_at = ? WHERE scheduleId = ? AND status = 'pending'", [reason, now, now, scheduleId]);
|
|
107
124
|
if (!claimed.changes)
|
|
@@ -111,7 +128,6 @@ async function dispatchDeferredTaskWait(scheduleId, reason, extraTags = []) {
|
|
|
111
128
|
}
|
|
112
129
|
if (!schedule.taskTemplate)
|
|
113
130
|
throw new Error(`Schedule "${schedule.name}" has no taskTemplate`);
|
|
114
|
-
const cause = reason === "ceiling" ? "ceiling expired" : `${reason} for task ${wait.taskId}`;
|
|
115
131
|
const task = await createStandaloneScheduleTask({
|
|
116
132
|
...schedule,
|
|
117
133
|
taskTemplate: `${schedule.taskTemplate}
|
|
@@ -135,8 +151,9 @@ Wake-up cause: ${cause}.`
|
|
|
135
151
|
});
|
|
136
152
|
}
|
|
137
153
|
async function reconcileDeferredTaskWaits(taskId) {
|
|
138
|
-
const rows = await getDbClient().query(`SELECT w.*, t.status AS taskStatus FROM deferred_task_waits w
|
|
139
|
-
JOIN
|
|
154
|
+
const rows = await getDbClient().query(`SELECT DISTINCT w.*, t.status AS taskStatus FROM deferred_task_waits w
|
|
155
|
+
JOIN deferred_task_wait_members m ON m.scheduleId = w.scheduleId
|
|
156
|
+
JOIN agent_tasks t ON t.id = m.taskId
|
|
140
157
|
JOIN scheduled_tasks s ON s.id = w.scheduleId
|
|
141
158
|
WHERE w.status = 'pending' AND s.enabled = 1 AND t.status IN ('completed', 'failed')
|
|
142
159
|
AND NOT EXISTS (
|
|
@@ -144,7 +161,7 @@ async function reconcileDeferredTaskWaits(taskId) {
|
|
|
144
161
|
WHERE d.parentTaskId = t.id AND d.taskType = 'deferred' AND d.enabled = 1
|
|
145
162
|
)
|
|
146
163
|
AND (w.eventName = 'settled' OR w.eventName = 'task.' || t.status)
|
|
147
|
-
${taskId ? "AND
|
|
164
|
+
${taskId ? "AND m.taskId = ?" : ""}`, taskId ? [taskId] : []);
|
|
148
165
|
for (const row of rows) {
|
|
149
166
|
try {
|
|
150
167
|
await dispatchDeferredTaskWait(row.scheduleId, `task.${row.taskStatus}`);
|
|
@@ -173,6 +190,7 @@ function stopDeferredTaskWaits() {
|
|
|
173
190
|
|
|
174
191
|
// src/scheduler/scheduler.ts
|
|
175
192
|
var schedulerInterval = null;
|
|
193
|
+
var schedulerRun = null;
|
|
176
194
|
var isProcessing = false;
|
|
177
195
|
var executorRegistry = null;
|
|
178
196
|
function resolveExecutorRegistry() {
|
|
@@ -300,77 +318,50 @@ async function throwIfWorkflowNeedsSetup(scheduleId, runIds) {
|
|
|
300
318
|
throw new AutomationNeedsSetupError(run.error);
|
|
301
319
|
}
|
|
302
320
|
}
|
|
303
|
-
async function
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
321
|
+
async function claimScheduleOccurrence(snapshot, extraTags) {
|
|
322
|
+
return getDbClient().transaction(async () => {
|
|
323
|
+
const current = await getScheduledTaskById(snapshot.id);
|
|
324
|
+
if (!current?.enabled || !current.nextRunAt || current.nextRunAt !== snapshot.nextRunAt) {
|
|
325
|
+
return null;
|
|
326
|
+
}
|
|
327
|
+
const schedule = renderScheduledTaskParams(current);
|
|
328
|
+
const deferred = await dispatchDeferredTaskWait(schedule.id, "ceiling", extraTags);
|
|
329
|
+
if (deferred) {
|
|
330
|
+
return {
|
|
331
|
+
schedule,
|
|
332
|
+
claimed: await getScheduledTaskById(schedule.id),
|
|
333
|
+
dispatched: { triggeredWorkflows: false, ...deferred }
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
const now = new Date;
|
|
337
|
+
const nextRunAt = schedule.scheduleType === "one_time" ? null : calculateNextRun(schedule.timezone?.includes("{{") ? { ...schedule, timezone: "UTC" } : schedule, new Date(Math.max(now.getTime(), new Date(current.nextRunAt).getTime())));
|
|
338
|
+
const claimed = await updateScheduledTask(schedule.id, {
|
|
339
|
+
lastRunAt: now.toISOString(),
|
|
340
|
+
nextRunAt,
|
|
341
|
+
...schedule.scheduleType === "one_time" ? { enabled: false } : {}
|
|
310
342
|
});
|
|
311
|
-
return;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
343
|
+
return { schedule, claimed, dispatched: undefined };
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
async function updateClaimedSchedule(claimed, updates) {
|
|
347
|
+
await getDbClient().transaction(async () => {
|
|
348
|
+
const current = await getScheduledTaskById(claimed.id);
|
|
349
|
+
if (current?.nextRunAt !== claimed.nextRunAt || current?.lastRunAt !== claimed.lastRunAt || current?.enabled !== claimed.enabled || current?.lastUpdatedAt !== claimed.lastUpdatedAt)
|
|
350
|
+
return;
|
|
351
|
+
await updateScheduledTask(claimed.id, updates);
|
|
316
352
|
});
|
|
317
353
|
}
|
|
318
354
|
async function recoverMissedSchedules() {
|
|
319
|
-
const now =
|
|
355
|
+
const now = Date.now();
|
|
320
356
|
const dueSchedules = await getDueScheduledTasks();
|
|
321
|
-
for (const
|
|
322
|
-
const schedule = renderScheduledTaskParams(storedSchedule);
|
|
357
|
+
for (const schedule of dueSchedules) {
|
|
323
358
|
if (!schedule.nextRunAt)
|
|
324
359
|
continue;
|
|
325
|
-
const missedBy = now
|
|
360
|
+
const missedBy = now - new Date(schedule.nextRunAt).getTime();
|
|
326
361
|
if (missedBy < 15000)
|
|
327
362
|
continue;
|
|
328
363
|
console.log(`[Scheduler] Recovering missed schedule "${schedule.name}" ` + `(was due ${Math.round(missedBy / 1000)}s ago)`);
|
|
329
|
-
|
|
330
|
-
try {
|
|
331
|
-
({ triggeredWorkflows } = await dispatchScheduleTarget(schedule, ["recovered"]));
|
|
332
|
-
if (schedule.scheduleType === "one_time") {
|
|
333
|
-
await updateScheduledTask(schedule.id, {
|
|
334
|
-
lastRunAt: now.toISOString(),
|
|
335
|
-
nextRunAt: null,
|
|
336
|
-
enabled: false,
|
|
337
|
-
lastUpdatedAt: now.toISOString()
|
|
338
|
-
});
|
|
339
|
-
} else {
|
|
340
|
-
const nextRun = calculateNextRun(schedule, now);
|
|
341
|
-
await updateScheduledTask(schedule.id, {
|
|
342
|
-
lastRunAt: now.toISOString(),
|
|
343
|
-
nextRunAt: nextRun,
|
|
344
|
-
lastUpdatedAt: now.toISOString()
|
|
345
|
-
});
|
|
346
|
-
}
|
|
347
|
-
if (schedule.scheduleType === "one_time") {
|
|
348
|
-
console.log(`[Scheduler] One-time schedule "${schedule.name}" recovered and auto-disabled`);
|
|
349
|
-
}
|
|
350
|
-
telemetry.schedule("executed", {
|
|
351
|
-
scheduleType: schedule.scheduleType,
|
|
352
|
-
triggeredWorkflows,
|
|
353
|
-
wasRecovered: true
|
|
354
|
-
});
|
|
355
|
-
} catch (err) {
|
|
356
|
-
if (err instanceof AutomationNeedsSetupError) {
|
|
357
|
-
await advanceScheduleAfterNeedsSetup(schedule, now);
|
|
358
|
-
telemetry.schedule("error", {
|
|
359
|
-
scheduleType: schedule.scheduleType,
|
|
360
|
-
triggeredWorkflows,
|
|
361
|
-
wasRecovered: true,
|
|
362
|
-
consecutiveErrors: schedule.consecutiveErrors ?? 0
|
|
363
|
-
});
|
|
364
|
-
continue;
|
|
365
|
-
}
|
|
366
|
-
telemetry.schedule("error", {
|
|
367
|
-
scheduleType: schedule.scheduleType,
|
|
368
|
-
triggeredWorkflows,
|
|
369
|
-
wasRecovered: true,
|
|
370
|
-
consecutiveErrors: schedule.consecutiveErrors ?? 0
|
|
371
|
-
});
|
|
372
|
-
console.error(`[Scheduler] Error recovering "${schedule.name}":`, err);
|
|
373
|
-
}
|
|
364
|
+
await executeSchedule(schedule, ["recovered"]);
|
|
374
365
|
}
|
|
375
366
|
}
|
|
376
367
|
function calculateNextRun(schedule, fromTime = new Date) {
|
|
@@ -403,47 +394,33 @@ function getBackoffMs(consecutiveErrors) {
|
|
|
403
394
|
const idx = Math.min(consecutiveErrors - 1, ERROR_BACKOFF_MS.length - 1);
|
|
404
395
|
return ERROR_BACKOFF_MS[Math.max(0, idx)] ?? ERROR_BACKOFF_MS[0];
|
|
405
396
|
}
|
|
406
|
-
async function executeSchedule(schedule) {
|
|
407
|
-
|
|
397
|
+
async function executeSchedule(schedule, extraTags = []) {
|
|
398
|
+
let claimed = schedule;
|
|
408
399
|
let triggeredWorkflows = false;
|
|
400
|
+
const wasRecovered = extraTags.includes("recovered");
|
|
409
401
|
try {
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
});
|
|
422
|
-
console.log(`[Scheduler] Executed one-time schedule "${schedule.name}", auto-disabled`);
|
|
423
|
-
} else {
|
|
424
|
-
const nextRun = calculateNextRun(schedule, new Date);
|
|
425
|
-
await updateScheduledTask(schedule.id, {
|
|
426
|
-
lastRunAt: now,
|
|
427
|
-
nextRunAt: nextRun,
|
|
428
|
-
lastUpdatedAt: now,
|
|
429
|
-
consecutiveErrors: 0,
|
|
430
|
-
lastErrorAt: null,
|
|
431
|
-
lastErrorMessage: null
|
|
432
|
-
});
|
|
433
|
-
console.log(`[Scheduler] Executed schedule "${schedule.name}", next run: ${nextRun}`);
|
|
434
|
-
}
|
|
402
|
+
const occurrence = await claimScheduleOccurrence(schedule, extraTags);
|
|
403
|
+
if (!occurrence)
|
|
404
|
+
return;
|
|
405
|
+
({ schedule, claimed } = occurrence);
|
|
406
|
+
({ triggeredWorkflows } = occurrence.dispatched ?? await dispatchScheduleTarget(schedule, extraTags));
|
|
407
|
+
await updateClaimedSchedule(claimed, {
|
|
408
|
+
consecutiveErrors: 0,
|
|
409
|
+
lastErrorAt: null,
|
|
410
|
+
lastErrorMessage: null
|
|
411
|
+
});
|
|
412
|
+
console.log(`[Scheduler] Executed schedule "${schedule.name}", next run: ${claimed.nextRunAt ?? "disabled"}`);
|
|
435
413
|
telemetry.schedule("executed", {
|
|
436
414
|
scheduleType: schedule.scheduleType,
|
|
437
415
|
triggeredWorkflows,
|
|
438
|
-
wasRecovered
|
|
416
|
+
wasRecovered
|
|
439
417
|
});
|
|
440
418
|
} catch (err) {
|
|
441
419
|
if (err instanceof AutomationNeedsSetupError) {
|
|
442
|
-
await advanceScheduleAfterNeedsSetup(schedule);
|
|
443
420
|
telemetry.schedule("error", {
|
|
444
421
|
scheduleType: schedule.scheduleType,
|
|
445
422
|
triggeredWorkflows,
|
|
446
|
-
wasRecovered
|
|
423
|
+
wasRecovered,
|
|
447
424
|
consecutiveErrors: schedule.consecutiveErrors ?? 0
|
|
448
425
|
});
|
|
449
426
|
return;
|
|
@@ -469,26 +446,32 @@ async function executeSchedule(schedule) {
|
|
|
469
446
|
updates.nextRunAt = new Date(now.getTime() + backoff).toISOString();
|
|
470
447
|
console.log(`[Scheduler] Backing off "${schedule.name}" for ${backoff / 1000}s`);
|
|
471
448
|
}
|
|
472
|
-
await
|
|
449
|
+
await updateClaimedSchedule(claimed, updates);
|
|
473
450
|
telemetry.schedule("error", {
|
|
474
451
|
scheduleType: schedule.scheduleType,
|
|
475
452
|
triggeredWorkflows,
|
|
476
|
-
wasRecovered
|
|
453
|
+
wasRecovered,
|
|
477
454
|
consecutiveErrors: errorCount
|
|
478
455
|
});
|
|
479
456
|
}
|
|
480
457
|
}
|
|
481
458
|
function startScheduler(registry, intervalMs = 1e4, opts) {
|
|
482
|
-
if (
|
|
459
|
+
if (schedulerRun) {
|
|
483
460
|
console.log("[Scheduler] Already running");
|
|
484
461
|
return;
|
|
485
462
|
}
|
|
463
|
+
const run = {};
|
|
464
|
+
schedulerRun = run;
|
|
486
465
|
executorRegistry = registry;
|
|
487
466
|
console.log(`[Scheduler] Starting with ${intervalMs}ms polling interval`);
|
|
488
|
-
initDeferredTaskWaits().then(() => recoverMissedSchedules()
|
|
489
|
-
|
|
467
|
+
initDeferredTaskWaits().then(() => schedulerRun === run ? recoverMissedSchedules() : undefined).catch((err) => console.error("[Scheduler] Recovery failed:", err)).then(async () => {
|
|
468
|
+
if (schedulerRun !== run)
|
|
469
|
+
return;
|
|
470
|
+
schedulerInterval = setInterval(() => {
|
|
471
|
+
processSchedules().catch((err) => console.error("[Scheduler] Poll failed:", err));
|
|
472
|
+
}, intervalMs);
|
|
490
473
|
await processSchedules();
|
|
491
|
-
},
|
|
474
|
+
}).catch((err) => console.error("[Scheduler] Poll failed:", err));
|
|
492
475
|
ensure({
|
|
493
476
|
id: "scheduler_started",
|
|
494
477
|
flow: "api",
|
|
@@ -525,11 +508,11 @@ async function processSchedules() {
|
|
|
525
508
|
}
|
|
526
509
|
}
|
|
527
510
|
function stopScheduler() {
|
|
511
|
+
schedulerRun = null;
|
|
528
512
|
stopDeferredTaskWaits();
|
|
529
513
|
if (schedulerInterval) {
|
|
530
514
|
clearInterval(schedulerInterval);
|
|
531
515
|
schedulerInterval = null;
|
|
532
|
-
isProcessing = false;
|
|
533
516
|
console.log("[Scheduler] Stopped");
|
|
534
517
|
}
|
|
535
518
|
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
checkOpencodeCredentials
|
|
3
|
+
} from "./cli-5my3bjsd.js";
|
|
1
4
|
import {
|
|
2
5
|
renderSteeringDelivery
|
|
3
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-7fesa1ky.js";
|
|
4
7
|
import {
|
|
5
8
|
checkCodexCredentials,
|
|
6
9
|
codexUserHome
|
|
7
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-taym3dmg.js";
|
|
8
11
|
import {
|
|
9
12
|
checkClaudeManagedCredentials
|
|
10
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-wk0gjrn3.js";
|
|
11
14
|
import {
|
|
12
15
|
checkDevinCredentials
|
|
13
16
|
} from "./cli-9b13ggd1.js";
|
|
14
|
-
import {
|
|
15
|
-
checkOpencodeCredentials
|
|
16
|
-
} from "./cli-5my3bjsd.js";
|
|
17
17
|
import {
|
|
18
18
|
renderMemoriesPrompt,
|
|
19
19
|
resolveScriptsOnlyMode,
|
|
20
20
|
writeSkillsToFilesystem
|
|
21
|
-
} from "./cli-
|
|
21
|
+
} from "./cli-3mh119qv.js";
|
|
22
22
|
import {
|
|
23
23
|
checkClaudeCredentials
|
|
24
|
-
} from "./cli-
|
|
24
|
+
} from "./cli-zthatyrx.js";
|
|
25
25
|
import {
|
|
26
26
|
MAX_RATE_LIMIT_RESET_MS,
|
|
27
27
|
isCodexCreditsExhaustedMessage,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
} from "./cli-s25avqg9.js";
|
|
35
35
|
import {
|
|
36
36
|
validateJsonSchema
|
|
37
|
-
} from "./cli-
|
|
37
|
+
} from "./cli-rnsr8asm.js";
|
|
38
38
|
import {
|
|
39
39
|
authJsonToCredentialSelection,
|
|
40
40
|
credentialsToAuthJson,
|
|
@@ -61,7 +61,7 @@ import {
|
|
|
61
61
|
syncProfileFilesToServer,
|
|
62
62
|
writeIdentityBaselines,
|
|
63
63
|
writeProfileFileFromDb
|
|
64
|
-
} from "./cli-
|
|
64
|
+
} from "./cli-a45d5v9b.js";
|
|
65
65
|
import {
|
|
66
66
|
ensure,
|
|
67
67
|
initOtel,
|
|
@@ -71,11 +71,11 @@ import {
|
|
|
71
71
|
startSpan,
|
|
72
72
|
withSpan,
|
|
73
73
|
withSpanContext
|
|
74
|
-
} from "./cli-
|
|
74
|
+
} from "./cli-kt7wevqh.js";
|
|
75
75
|
import {
|
|
76
76
|
init_task_attachment_links,
|
|
77
77
|
taskAttachmentFetchCommand
|
|
78
|
-
} from "./cli-
|
|
78
|
+
} from "./cli-2658f6at.js";
|
|
79
79
|
import {
|
|
80
80
|
ProviderNameSchema,
|
|
81
81
|
initTelemetry,
|
|
@@ -83,7 +83,11 @@ import {
|
|
|
83
83
|
init_types,
|
|
84
84
|
resolveTaskModelSelection,
|
|
85
85
|
telemetry
|
|
86
|
-
} from "./cli-
|
|
86
|
+
} from "./cli-qp69dd5d.js";
|
|
87
|
+
import {
|
|
88
|
+
init_credentials,
|
|
89
|
+
resolveCredentialPools
|
|
90
|
+
} from "./cli-c2mk1kgf.js";
|
|
87
91
|
import {
|
|
88
92
|
generateDefaultClaudeMd,
|
|
89
93
|
generateDefaultIdentityMd,
|
|
@@ -93,7 +97,7 @@ import {
|
|
|
93
97
|
init_base_prompt,
|
|
94
98
|
init_defaults,
|
|
95
99
|
init_templates
|
|
96
|
-
} from "./cli-
|
|
100
|
+
} from "./cli-hmyynq9b.js";
|
|
97
101
|
import {
|
|
98
102
|
configureHttpResolver,
|
|
99
103
|
init_resolver,
|
|
@@ -102,15 +106,11 @@ import {
|
|
|
102
106
|
interpolate,
|
|
103
107
|
isSteeringEnabled,
|
|
104
108
|
resolveTemplateAsync
|
|
105
|
-
} from "./cli-
|
|
109
|
+
} from "./cli-n75jt793.js";
|
|
106
110
|
import {
|
|
107
111
|
getMcpBaseUrl,
|
|
108
112
|
init_constants
|
|
109
|
-
} from "./cli-
|
|
110
|
-
import {
|
|
111
|
-
init_credentials,
|
|
112
|
-
resolveCredentialPools
|
|
113
|
-
} from "./cli-c2mk1kgf.js";
|
|
113
|
+
} from "./cli-dv6cdjs2.js";
|
|
114
114
|
import {
|
|
115
115
|
init_secret_scrubber,
|
|
116
116
|
scrubSecrets
|
|
@@ -151,19 +151,19 @@ async function materializeCodexAuthJson(_slot, creds, deps = {}) {
|
|
|
151
151
|
async function createProviderAdapter(provider) {
|
|
152
152
|
switch (provider) {
|
|
153
153
|
case "claude": {
|
|
154
|
-
const { ClaudeAdapter } = await import("./claude-adapter-
|
|
154
|
+
const { ClaudeAdapter } = await import("./claude-adapter-cjegjbje.js");
|
|
155
155
|
return new ClaudeAdapter;
|
|
156
156
|
}
|
|
157
157
|
case "pi": {
|
|
158
|
-
const { PiMonoAdapter } = await import("./pi-mono-adapter-
|
|
158
|
+
const { PiMonoAdapter } = await import("./pi-mono-adapter-4s2bbkgq.js");
|
|
159
159
|
return new PiMonoAdapter;
|
|
160
160
|
}
|
|
161
161
|
case "codex": {
|
|
162
|
-
const { CodexAdapter } = await import("./codex-adapter-
|
|
162
|
+
const { CodexAdapter } = await import("./codex-adapter-rn3aq7jm.js");
|
|
163
163
|
return new CodexAdapter;
|
|
164
164
|
}
|
|
165
165
|
case "claude-managed": {
|
|
166
|
-
const { ClaudeManagedAdapter } = await import("./claude-managed-adapter-
|
|
166
|
+
const { ClaudeManagedAdapter } = await import("./claude-managed-adapter-p3ts5m9m.js");
|
|
167
167
|
return new ClaudeManagedAdapter;
|
|
168
168
|
}
|
|
169
169
|
case "devin": {
|
|
@@ -175,7 +175,7 @@ async function createProviderAdapter(provider) {
|
|
|
175
175
|
return new OpencodeAdapter;
|
|
176
176
|
}
|
|
177
177
|
case "acp": {
|
|
178
|
-
const { ACPAdapter } = await import("./acp-adapter-
|
|
178
|
+
const { ACPAdapter } = await import("./acp-adapter-d5mzggyk.js");
|
|
179
179
|
return new ACPAdapter;
|
|
180
180
|
}
|
|
181
181
|
default:
|
|
@@ -588,7 +588,7 @@ var CREDENTIAL_PROVIDER_CHECKERS = {
|
|
|
588
588
|
devin: (env) => checkDevinCredentials(env),
|
|
589
589
|
opencode: (env, opts) => checkOpencodeCredentials(env, opts),
|
|
590
590
|
pi: async (env, opts) => {
|
|
591
|
-
const { checkPiMonoCredentials } = await import("./pi-mono-adapter-
|
|
591
|
+
const { checkPiMonoCredentials } = await import("./pi-mono-adapter-4s2bbkgq.js");
|
|
592
592
|
return checkPiMonoCredentials(env, opts);
|
|
593
593
|
},
|
|
594
594
|
acp: () => ({ ready: true, missing: [], satisfiedBy: "sdk-delegated" })
|
|
@@ -832,17 +832,6 @@ async function sendCredStatusReport(apiUrl, apiKey, agentId, runtimeInstanceId,
|
|
|
832
832
|
throw new Error(`credential-status report failed: ${res.status} ${body}`.trim());
|
|
833
833
|
}
|
|
834
834
|
}
|
|
835
|
-
async function reportCredStatus(apiUrl, apiKey, agentId, runtimeInstanceId, credStatus) {
|
|
836
|
-
try {
|
|
837
|
-
await sendCredStatusReport(apiUrl, apiKey, agentId, runtimeInstanceId, {
|
|
838
|
-
ready: credStatus.ready,
|
|
839
|
-
missing: credStatus.missing,
|
|
840
|
-
credStatus
|
|
841
|
-
});
|
|
842
|
-
} catch (err) {
|
|
843
|
-
console.warn(`[cred-status] POST failed (non-fatal): ${err}`);
|
|
844
|
-
}
|
|
845
|
-
}
|
|
846
835
|
async function reportLatestModel(apiUrl, apiKey, agentId, latestModel) {
|
|
847
836
|
try {
|
|
848
837
|
await fetch(`${apiUrl}/api/agents/${encodeURIComponent(agentId)}/credential-status`, {
|
|
@@ -891,6 +880,43 @@ function buildLatestModelReport(opts) {
|
|
|
891
880
|
};
|
|
892
881
|
}
|
|
893
882
|
|
|
883
|
+
// src/commands/credential-refresh.ts
|
|
884
|
+
var CREDENTIAL_RETRY_INTERVAL_MS = 30000;
|
|
885
|
+
var BEDROCK_REFRESH_INTERVAL_MS = 5 * 60 * 1000;
|
|
886
|
+
async function refreshCredentialStatus(api, state, harnessProvider, env, now = Date.now()) {
|
|
887
|
+
if (isCredCheckDisabled(env) || state.inFlight)
|
|
888
|
+
return;
|
|
889
|
+
const providerChanged = state.harnessProvider !== harnessProvider;
|
|
890
|
+
const retryDue = state.ready !== true && now - state.lastRefreshAt >= CREDENTIAL_RETRY_INTERVAL_MS;
|
|
891
|
+
if (!providerChanged && !retryDue && !shouldRefreshBedrockStatus({
|
|
892
|
+
harnessProvider,
|
|
893
|
+
env,
|
|
894
|
+
lastRefreshAt: state.lastRefreshAt,
|
|
895
|
+
now,
|
|
896
|
+
intervalMs: BEDROCK_REFRESH_INTERVAL_MS
|
|
897
|
+
})) {
|
|
898
|
+
return;
|
|
899
|
+
}
|
|
900
|
+
state.harnessProvider = harnessProvider;
|
|
901
|
+
state.lastRefreshAt = now;
|
|
902
|
+
state.ready = null;
|
|
903
|
+
state.inFlight = true;
|
|
904
|
+
try {
|
|
905
|
+
const snapshot = await buildCredStatusReport(harnessProvider, { ...env }, {}, "post_task");
|
|
906
|
+
if (state.harnessProvider !== harnessProvider)
|
|
907
|
+
return;
|
|
908
|
+
await sendCredStatusReport(api.apiUrl, api.apiKey, api.agentId, api.runtimeInstanceId, {
|
|
909
|
+
ready: snapshot.ready,
|
|
910
|
+
missing: snapshot.missing,
|
|
911
|
+
credStatus: snapshot
|
|
912
|
+
});
|
|
913
|
+
if (state.harnessProvider === harnessProvider)
|
|
914
|
+
state.ready = snapshot.ready;
|
|
915
|
+
} finally {
|
|
916
|
+
state.inFlight = false;
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
|
|
894
920
|
// src/commands/credential-wait.ts
|
|
895
921
|
var EX_CONFIG = 78;
|
|
896
922
|
|
|
@@ -3973,13 +3999,16 @@ ${additionalSystemPrompt}` : basePrompt;
|
|
|
3973
3999
|
};
|
|
3974
4000
|
const cancelledSignaled = new Set;
|
|
3975
4001
|
const steeringDispatchState = isSteeringEnabled() ? createSteeringDispatchState() : null;
|
|
3976
|
-
|
|
4002
|
+
const credentialRefreshState = {
|
|
4003
|
+
harnessProvider: null,
|
|
4004
|
+
ready: null,
|
|
4005
|
+
lastRefreshAt: 0,
|
|
4006
|
+
inFlight: false
|
|
4007
|
+
};
|
|
3977
4008
|
let lastHarnessReconcileAt = 0;
|
|
3978
4009
|
const HARNESS_RECONCILE_INTERVAL_MS = 1e4;
|
|
3979
4010
|
let lastServerCapsRefreshAt = 0;
|
|
3980
4011
|
const SERVER_CAPS_REFRESH_INTERVAL_MS = 300000;
|
|
3981
|
-
let lastBedrockRefreshAt = 0;
|
|
3982
|
-
const BEDROCK_REFRESH_INTERVAL_MS = 5 * 60 * 1000;
|
|
3983
4012
|
const runtimeInstanceId = crypto.randomUUID();
|
|
3984
4013
|
process.env.SWARM_RUNTIME_INSTANCE_ID = runtimeInstanceId;
|
|
3985
4014
|
const apiConfig = { apiUrl, apiKey, agentId, runtimeInstanceId };
|
|
@@ -4001,7 +4030,7 @@ ${additionalSystemPrompt}` : basePrompt;
|
|
|
4001
4030
|
|
|
4002
4031
|
${additionalSystemPrompt}` : basePrompt;
|
|
4003
4032
|
promptRebuiltForProvider = true;
|
|
4004
|
-
|
|
4033
|
+
credentialRefreshState.harnessProvider = null;
|
|
4005
4034
|
agentVisibleChanged = true;
|
|
4006
4035
|
console.log(`[${role}] [harness] Swapped to ${resolvedProvider} (basePrompt rebuilt: ${basePrompt.length} chars)`);
|
|
4007
4036
|
} catch (err) {
|
|
@@ -4094,7 +4123,6 @@ ${additionalSystemPrompt}` : basePrompt;
|
|
|
4094
4123
|
agentId,
|
|
4095
4124
|
alreadyProvisioned: agentFsProvisioned
|
|
4096
4125
|
});
|
|
4097
|
-
cachedCredHarnessProvider = state.harnessProvider;
|
|
4098
4126
|
if (isCredCheckDisabled(process.env)) {
|
|
4099
4127
|
console.log(`[${role}] CRED_CHECK_DISABLE=1, skipping credential checks`);
|
|
4100
4128
|
} else {
|
|
@@ -4158,6 +4186,9 @@ ${additionalSystemPrompt}` : basePrompt;
|
|
|
4158
4186
|
label: "credential readiness report",
|
|
4159
4187
|
log: (line) => console.warn(`[${role}] ${line}`)
|
|
4160
4188
|
});
|
|
4189
|
+
credentialRefreshState.harnessProvider = state.harnessProvider;
|
|
4190
|
+
credentialRefreshState.ready = bootCredSnapshot?.ready ?? true;
|
|
4191
|
+
credentialRefreshState.lastRefreshAt = Date.now();
|
|
4161
4192
|
} catch (error) {
|
|
4162
4193
|
console.error(`[${role}] Failed to report credential readiness after recovery: ${error}`);
|
|
4163
4194
|
process.exit(1);
|
|
@@ -4566,22 +4597,7 @@ ${additionalSystemPrompt}` : basePrompt;
|
|
|
4566
4597
|
console.warn(`[${role}] [harness] Reconcile fetch failed (non-fatal): ${err}`);
|
|
4567
4598
|
}
|
|
4568
4599
|
}
|
|
4569
|
-
|
|
4570
|
-
const currentHarness = state.harnessProvider;
|
|
4571
|
-
if (currentHarness !== cachedCredHarnessProvider) {
|
|
4572
|
-
cachedCredHarnessProvider = currentHarness;
|
|
4573
|
-
buildCredStatusReport(currentHarness, process.env, {}, "post_task").then((snap) => reportCredStatus(apiUrl, apiKey, agentId, runtimeInstanceId, snap)).catch((err) => console.warn(`[${role}] cred_status post_task report failed (non-fatal): ${err}`));
|
|
4574
|
-
} else if (shouldRefreshBedrockStatus({
|
|
4575
|
-
harnessProvider: currentHarness,
|
|
4576
|
-
env: process.env,
|
|
4577
|
-
lastRefreshAt: lastBedrockRefreshAt,
|
|
4578
|
-
now: Date.now(),
|
|
4579
|
-
intervalMs: BEDROCK_REFRESH_INTERVAL_MS
|
|
4580
|
-
})) {
|
|
4581
|
-
lastBedrockRefreshAt = Date.now();
|
|
4582
|
-
buildCredStatusReport(currentHarness, process.env, {}, "post_task").then((snap) => reportCredStatus(apiUrl, apiKey, agentId, runtimeInstanceId, snap)).catch((err) => console.warn(`[${role}] bedrock enumeration refresh failed (non-fatal): ${err}`));
|
|
4583
|
-
}
|
|
4584
|
-
}
|
|
4600
|
+
refreshCredentialStatus(apiConfig, credentialRefreshState, state.harnessProvider, process.env).catch((err) => console.warn(`[${role}] cred_status post_task refresh failed (non-fatal): ${err}`));
|
|
4585
4601
|
const now = Date.now();
|
|
4586
4602
|
for (const [taskId, task] of state.activeTasks) {
|
|
4587
4603
|
if (vcsDetectedTasks.has(taskId))
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createSwarmEventHandler
|
|
3
|
-
} from "./cli-hsxj0yar.js";
|
|
4
1
|
import {
|
|
5
2
|
resolveCodexPrompt
|
|
6
3
|
} from "./cli-r94z9p1z.js";
|
|
4
|
+
import {
|
|
5
|
+
createSwarmEventHandler
|
|
6
|
+
} from "./cli-hsxj0yar.js";
|
|
7
7
|
import {
|
|
8
8
|
readPkgVersion
|
|
9
9
|
} from "./cli-2djtr51b.js";
|
|
@@ -11,25 +11,25 @@ import {
|
|
|
11
11
|
SessionErrorTracker,
|
|
12
12
|
buildOtelTraceparentEnv
|
|
13
13
|
} from "./cli-b5b30yzk.js";
|
|
14
|
-
import {
|
|
15
|
-
summarizeSession
|
|
16
|
-
} from "./cli-jecc01cb.js";
|
|
17
14
|
import {
|
|
18
15
|
CTX_MODE_NUDGE_EVERY
|
|
19
16
|
} from "./cli-zm7njwzd.js";
|
|
17
|
+
import {
|
|
18
|
+
summarizeSession
|
|
19
|
+
} from "./cli-dyx0237s.js";
|
|
20
20
|
import {
|
|
21
21
|
CONTEXT_FORMULA,
|
|
22
22
|
clampContextPercent,
|
|
23
23
|
computeContextUsedUnified
|
|
24
24
|
} from "./cli-s25avqg9.js";
|
|
25
|
+
import {
|
|
26
|
+
applyReasoningEffort
|
|
27
|
+
} from "./cli-4yc5d8fk.js";
|
|
25
28
|
import {
|
|
26
29
|
buildRatingsFromLlm,
|
|
27
30
|
fetchRetrievalsForTask,
|
|
28
31
|
postRatings
|
|
29
32
|
} from "./cli-xvkmedgn.js";
|
|
30
|
-
import {
|
|
31
|
-
applyReasoningEffort
|
|
32
|
-
} from "./cli-4yc5d8fk.js";
|
|
33
33
|
import {
|
|
34
34
|
swarmRuntimeInstanceId
|
|
35
35
|
} from "./cli-07jd68a1.js";
|
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
import {
|
|
50
50
|
init_package,
|
|
51
51
|
package_default
|
|
52
|
-
} from "./cli-
|
|
52
|
+
} from "./cli-gm0fhz13.js";
|
|
53
53
|
import {
|
|
54
54
|
init_secret_scrubber,
|
|
55
55
|
scrubSecrets
|