@desplega.ai/agent-swarm 1.123.0 → 1.124.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 +2 -1
- package/dist/{actions-e4c9f0xy.js → actions-z3d0fk7z.js} +6 -6
- package/dist/{app-vmvmj2v3.js → app-q2rc9tdr.js} +4 -4
- package/dist/{assistant-yn7a792a.js → assistant-3stjq7fz.js} +9 -9
- package/dist/{boot-reembed-xg1r86h2.js → boot-reembed-5867whnb.js} +3 -3
- package/dist/{boot-reembed-chxty50a.js → boot-reembed-v6r1df32.js} +4 -4
- package/dist/{boot-scrub-logs-exwddvp5.js → boot-scrub-logs-8b8jegk3.js} +2 -2
- package/dist/{cli-1592nfd6.js → cli-0925phzv.js} +1 -1
- package/dist/{cli-hbbxmhec.js → cli-2yr6edr7.js} +4 -4
- package/dist/{cli-8cq4z4x7.js → cli-3z4q09tn.js} +182 -19
- package/dist/{cli-vz9drmce.js → cli-5jn6wnd9.js} +17 -8
- package/dist/{cli-5arfywtm.js → cli-5ncdb7ff.js} +19 -9
- package/dist/{cli-3tv9z4wx.js → cli-92bqgbgy.js} +1 -1
- package/dist/{cli-fjf04hpa.js → cli-dq2ssyf0.js} +48 -56
- package/dist/{cli-mngsj9fx.js → cli-gkvf8d83.js} +1 -1
- package/dist/{cli-mepk1j0t.js → cli-gzjsamwc.js} +2 -2
- package/dist/{cli-c9m59f83.js → cli-h89g0qrd.js} +1 -1
- package/dist/{cli-n8mf7x4b.js → cli-jp4mdj9d.js} +2 -2
- package/dist/{cli-822d4bjk.js → cli-kk58tg33.js} +7 -7
- package/dist/{cli-9hj1adgp.js → cli-mcez7z4p.js} +1 -1
- package/dist/{cli-byv3720g.js → cli-mmk5vagg.js} +2 -2
- package/dist/{cli-zdp11t8m.js → cli-p0ec4vv6.js} +1 -1
- package/dist/{cli-h2say6xk.js → cli-p0zgv8pj.js} +3 -1
- package/dist/{cli-8ef5ky75.js → cli-perb20ma.js} +1 -1
- package/dist/{cli-zkj6f2sk.js → cli-qf7acvyr.js} +90 -4
- package/dist/{cli-kmm1rwmp.js → cli-qwsagsmg.js} +1 -1
- package/dist/{cli-we91ywvy.js → cli-sqv6c9b8.js} +6 -6
- package/dist/{cli-np0yhmmk.js → cli-vm20sh8d.js} +3 -3
- package/dist/{cli-p11rf59d.js → cli-wn3m6q54.js} +3 -3
- package/dist/{cli-mkpf4ndf.js → cli-x268say8.js} +2976 -5621
- package/dist/{cli-ngbsk4yx.js → cli-y43n987v.js} +1 -1
- package/dist/{cli-4509mwm5.js → cli-ykthjw29.js} +8 -8
- package/dist/{cli-9eka6jwv.js → cli-zxb72ctk.js} +2 -2
- package/dist/cli.js +12 -10
- package/dist/{commands-sjk3zfyr.js → commands-sda76yn8.js} +2 -2
- package/dist/{db-2je5agjb.js → db-vn9e4rqj.js} +6 -2
- package/dist/{e2b-2s4psnbf.js → e2b-q345y8s4.js} +0 -4
- package/dist/{handlers-yzv369hf.js → handlers-xfja18ac.js} +9 -9
- package/dist/{hook-rfsj2r8x.js → hook-2medrp47.js} +1 -40
- package/dist/{http-v9rr144m.js → http-937pyjfc.js} +99 -44
- package/dist/{index-nr2199m6.js → index-2bqd2q9v.js} +11 -11
- package/dist/{index-3xtk777g.js → index-gw4en7jg.js} +9 -9
- package/dist/{index-c3tan44f.js → index-knqczmnm.js} +10 -10
- package/dist/{index-smjdc3h9.js → index-vah60vxp.js} +8 -8
- package/dist/{keepalive-5ds53bjd.js → keepalive-20rd6hxh.js} +5 -5
- package/dist/{lead-5xhez25b.js → lead-7w2k3a49.js} +21 -21
- package/dist/{maintenance-b43d24q6.js → maintenance-p3x918yw.js} +4 -4
- package/dist/{oauth-refresh-sweep-qe286vn2.js → oauth-refresh-sweep-shm0nzm4.js} +4 -4
- package/dist/{onboard-c4r3ds3z.js → onboard-py9dnf54.js} +6 -2
- package/dist/{otel-impl-nv3rjw61.js → otel-impl-7yjkfg68.js} +1 -1
- package/dist/{pi-mono-adapter-2syx1x4d.js → pi-mono-adapter-z6h98fva.js} +4 -38
- package/dist/{pricing-refresh-5ct2wp4k.js → pricing-refresh-3snb6370.js} +4 -4
- package/dist/{rbac-roles-m502w0qv.js → rbac-roles-5e72bbpk.js} +3 -3
- package/dist/{rbac-roles-b82cxpxn.js → rbac-roles-gqxdp8st.js} +4 -4
- package/dist/{seed-pricing-jhjphbf0.js → seed-pricing-bg42d7h2.js} +3 -3
- package/dist/{setup-zbaspydq.js → setup-nzk3kbbq.js} +2 -2
- package/dist/{worker-snvhpax5.js → worker-0p1jdzkm.js} +21 -21
- package/openapi.json +146 -1
- package/package.json +3 -1
- package/src/be/db.ts +81 -4
- package/src/be/models-catalog.ts +156 -0
- package/src/be/modelsdev-cache.ts +14 -1
- package/src/be/pricing-refresh.ts +2 -0
- package/src/be/scripts/typecheck.ts +17 -4
- package/src/be/seed-scripts/catalog/task-context-gathering.ts +1 -1
- package/src/commands/onboard/env-generator.ts +12 -0
- package/src/e2b/env.ts +0 -4
- package/src/hooks/hook.ts +0 -67
- package/src/http/all-routes.ts +1 -0
- package/src/http/index.ts +2 -0
- package/src/http/models-catalog.ts +65 -0
- package/src/http/workflows.ts +16 -4
- package/src/prompts/base-prompt.ts +8 -7
- package/src/prompts/session-templates.ts +106 -12
- package/src/providers/pi-mono-adapter.ts +12 -2
- package/src/providers/pi-mono-extension.ts +0 -64
- package/src/providers/pricing-sources.md +16 -1
- package/src/scripts-runtime/eval-harness.ts +18 -1
- package/src/scripts-runtime/swarm-sdk.ts +10 -0
- package/src/scripts-runtime/types/stdlib.d.ts +13 -0
- package/src/scripts-runtime/types/swarm-sdk.d.ts +13 -0
- package/src/server-user.ts +4 -7
- package/src/slack/blocks.ts +21 -8
- package/src/slack/responses.ts +27 -51
- package/src/slack/watcher.ts +22 -5
- package/src/telemetry.ts +169 -3
- package/src/tests/base-prompt.test.ts +79 -0
- package/src/tests/mcp-tools-user.test.ts +62 -16
- package/src/tests/mcp-tools.test.ts +6 -3
- package/src/tests/memory-edit.test.ts +21 -4
- package/src/tests/model-groups-live-catalog.test.ts +65 -0
- package/src/tests/models-catalog.test.ts +119 -0
- package/src/tests/oauth-access-token-tool.test.ts +71 -1
- package/src/tests/pricing-refresh.test.ts +25 -0
- package/src/tests/prompt-template-session.test.ts +142 -5
- package/src/tests/rbac-charact-skills.test.ts +81 -14
- package/src/tests/script-apis-mcp.test.ts +56 -8
- package/src/tests/scripts-mcp-e2e.test.ts +157 -8
- package/src/tests/scripts-typecheck.test.ts +17 -0
- package/src/tests/sdk-allowlist.test.ts +34 -1
- package/src/tests/seed-scripts.test.ts +43 -0
- package/src/tests/slack-blocks.test.ts +2 -1
- package/src/tests/slack-inline-output.test.ts +24 -30
- package/src/tests/slack-watcher.test.ts +42 -0
- package/src/tests/steer-task-tool.test.ts +37 -8
- package/src/tests/steering-transport.test.ts +18 -3
- package/src/tests/swarm-tool-result-gate.test.ts +399 -0
- package/src/tests/task-tools-ctx.test.ts +49 -17
- package/src/tests/task-tools-ownership.test.ts +41 -13
- package/src/tests/telemetry-init.test.ts +376 -2
- package/src/tests/tool-output-agent-id.test.ts +14 -2
- package/src/tests/workflow-http-v2.test.ts +116 -0
- package/src/tools/accept-steer.ts +45 -53
- package/src/tools/cancel-task.ts +31 -41
- package/src/tools/context-diff.ts +19 -63
- package/src/tools/context-history.ts +22 -51
- package/src/tools/create-channel.ts +24 -39
- package/src/tools/create-metric.ts +19 -82
- package/src/tools/create-page.ts +20 -81
- package/src/tools/credential-bindings/tool.ts +125 -246
- package/src/tools/db-query.ts +13 -24
- package/src/tools/delete-channel.ts +25 -71
- package/src/tools/delete-page.ts +27 -75
- package/src/tools/get-metrics.ts +29 -22
- package/src/tools/get-swarm.ts +44 -15
- package/src/tools/get-task-details.ts +150 -32
- package/src/tools/get-tasks.ts +63 -29
- package/src/tools/inject-learning.ts +8 -38
- package/src/tools/join-swarm.ts +45 -47
- package/src/tools/kv/kv-delete.ts +13 -37
- package/src/tools/kv/kv-get.ts +38 -29
- package/src/tools/kv/kv-incr.ts +28 -56
- package/src/tools/kv/kv-list.ts +40 -31
- package/src/tools/kv/kv-set.ts +34 -76
- package/src/tools/list-channels.ts +24 -17
- package/src/tools/list-services.ts +37 -45
- package/src/tools/manage-user.ts +53 -66
- package/src/tools/mcp-servers/mcp-server-create.ts +19 -55
- package/src/tools/mcp-servers/mcp-server-delete.ts +9 -39
- package/src/tools/mcp-servers/mcp-server-get.ts +9 -35
- package/src/tools/mcp-servers/mcp-server-install.ts +13 -60
- package/src/tools/mcp-servers/mcp-server-list.ts +28 -26
- package/src/tools/mcp-servers/mcp-server-uninstall.ts +10 -36
- package/src/tools/mcp-servers/mcp-server-update.ts +13 -57
- package/src/tools/memory-delete.ts +16 -46
- package/src/tools/memory-edit.ts +48 -49
- package/src/tools/memory-get.ts +40 -36
- package/src/tools/memory-rate.ts +14 -44
- package/src/tools/memory-search.ts +46 -52
- package/src/tools/my-agent-info.ts +39 -33
- package/src/tools/oauth-access-token.ts +9 -24
- package/src/tools/poll-task.ts +50 -77
- package/src/tools/post-message.ts +24 -38
- package/src/tools/prompt-templates/delete.ts +16 -48
- package/src/tools/prompt-templates/get.ts +45 -42
- package/src/tools/prompt-templates/list.ts +29 -44
- package/src/tools/prompt-templates/preview.ts +14 -40
- package/src/tools/prompt-templates/set.ts +30 -52
- package/src/tools/read-messages.ts +45 -54
- package/src/tools/register-agentmail-inbox.ts +28 -84
- package/src/tools/register-kapso-number.ts +20 -50
- package/src/tools/register-service.ts +36 -44
- package/src/tools/repos/get-repos.ts +29 -21
- package/src/tools/repos/update-repo.ts +30 -27
- package/src/tools/request-human-input.ts +10 -33
- package/src/tools/resolve-user.ts +59 -16
- package/src/tools/schedules/create-schedule.ts +58 -173
- package/src/tools/schedules/delete-schedule.ts +16 -56
- package/src/tools/schedules/list-schedules.ts +41 -67
- package/src/tools/schedules/patch-schedule.ts +57 -153
- package/src/tools/schedules/run-schedule-now.ts +18 -59
- package/src/tools/schedules/update-schedule.ts +57 -153
- package/src/tools/script-apis.ts +46 -28
- package/src/tools/script-common.ts +129 -34
- package/src/tools/script-connections/tool.ts +59 -154
- package/src/tools/script-query-types.ts +43 -3
- package/src/tools/script-run.ts +41 -2
- package/src/tools/script-runs.ts +69 -1
- package/src/tools/script-search.ts +24 -1
- package/src/tools/script-upsert.ts +18 -3
- package/src/tools/send-task.ts +32 -81
- package/src/tools/skills/skill-create.ts +14 -39
- package/src/tools/skills/skill-delete.ts +14 -42
- package/src/tools/skills/skill-get-file.ts +10 -43
- package/src/tools/skills/skill-get.ts +9 -32
- package/src/tools/skills/skill-install-remote.ts +16 -52
- package/src/tools/skills/skill-install.ts +14 -52
- package/src/tools/skills/skill-list.ts +24 -26
- package/src/tools/skills/skill-publish.ts +18 -54
- package/src/tools/skills/skill-search.ts +21 -18
- package/src/tools/skills/skill-sync-remote.ts +12 -24
- package/src/tools/skills/skill-uninstall.ts +10 -26
- package/src/tools/skills/skill-update.ts +24 -81
- package/src/tools/slack-delete.ts +8 -32
- package/src/tools/slack-download-file.ts +17 -57
- package/src/tools/slack-list-channels.ts +16 -43
- package/src/tools/slack-post.ts +11 -40
- package/src/tools/slack-read.ts +33 -103
- package/src/tools/slack-reply.ts +16 -53
- package/src/tools/slack-start-thread.ts +14 -55
- package/src/tools/slack-update.ts +8 -35
- package/src/tools/slack-upload-file.ts +22 -122
- package/src/tools/steer-task.ts +22 -35
- package/src/tools/store-progress.ts +11 -26
- package/src/tools/swarm-config/delete-config.ts +19 -57
- package/src/tools/swarm-config/get-config.ts +36 -44
- package/src/tools/swarm-config/list-config.ts +36 -44
- package/src/tools/swarm-config/set-config.ts +35 -73
- package/src/tools/swarm-x.ts +20 -26
- package/src/tools/task-action.ts +26 -46
- package/src/tools/task-tool-ctx.ts +5 -13
- package/src/tools/tracker/tracker-link-task.ts +8 -22
- package/src/tools/tracker/tracker-map-agent.ts +8 -22
- package/src/tools/tracker/tracker-status.ts +27 -19
- package/src/tools/tracker/tracker-sync-status.ts +8 -18
- package/src/tools/tracker/tracker-unlink.ts +4 -16
- package/src/tools/unregister-service.ts +19 -59
- package/src/tools/update-profile.ts +60 -100
- package/src/tools/update-service-status.ts +42 -67
- package/src/tools/utils.ts +189 -8
- package/src/tools/whatsapp-message.ts +19 -32
- package/src/tools/workflows/cancel-workflow-run.ts +4 -16
- package/src/tools/workflows/create-workflow.ts +9 -38
- package/src/tools/workflows/delete-workflow.ts +5 -17
- package/src/tools/workflows/get-workflow-run.ts +41 -31
- package/src/tools/workflows/get-workflow.ts +10 -21
- package/src/tools/workflows/list-workflow-runs.ts +107 -34
- package/src/tools/workflows/list-workflows.ts +5 -17
- package/src/tools/workflows/patch-workflow-node.ts +11 -39
- package/src/tools/workflows/patch-workflow.ts +11 -36
- package/src/tools/workflows/retry-workflow-run.ts +4 -16
- package/src/tools/workflows/trigger-workflow.ts +22 -58
- package/src/tools/workflows/update-workflow.ts +10 -42
- package/templates/skills/swarm-scripts/SKILL.md +1 -1
package/README.md
CHANGED
|
@@ -136,7 +136,8 @@ Check [our templates](https://templates.agent-swarm.dev) for a quick start.
|
|
|
136
136
|
- **Scripts as external APIs** — expose a saved script as a public `POST /api/x/script/<id>` endpoint with optional bearer auth, typed input validation, and per-endpoint usage tracking. [Guide →](https://docs.agent-swarm.dev/docs/guides/scripts-external-apis)
|
|
137
137
|
- **Typed script API connections** — lead-managed OpenAPI, GraphQL, and MCP connections generate `ctx.api.*` / `ctx.mcp.*` clients for scripts, with credential bindings and OAuth-backed auth kept server-side. [Guide →](https://docs.agent-swarm.dev/docs/guides/script-connections)
|
|
138
138
|
- **E2B-backed eval harness** — run a scenario × harness-config matrix against real swarm stacks, capture transcripts/artifacts, and grade outcomes with deterministic checks plus LLM or agentic judges. [Guide →](https://docs.agent-swarm.dev/docs/guides/evals-harness)
|
|
139
|
-
- **Harness & LLM agnostic** — run with Claude Code, Claude Bridge, OpenAI Codex, pi-mono (Anthropic, OpenRouter, or Amazon Bedrock), Devin, Claude Managed Agents, raw LLMs, or opencode. Route every OpenRouter-backed harness, workflow, and summarizer through an OpenAI-compatible gateway with `OPENROUTER_BASE_URL`. Tasks, schedules, and workflow agent-task nodes can use portable `modelTier` intent (`smol`, `regular`, `smart`, `ultra`), and operators can set per-agent reasoning effort (`off` → `max`, where supported) without changing task payloads. [Harness config →](https://docs.agent-swarm.dev/docs/guides/harness-configuration) · [Add a new provider →](https://docs.agent-swarm.dev/docs/guides/harness-providers)
|
|
139
|
+
- **Harness & LLM agnostic** — run with Claude Code, Claude Bridge, OpenAI Codex, pi-mono (Anthropic, OpenRouter, or Amazon Bedrock), Devin, Claude Managed Agents, raw LLMs, or opencode. The dashboard model picker follows a live models.dev catalog (with a bundled snapshot fallback), so newly released provider models appear without a redeploy. Route every OpenRouter-backed harness, workflow, and summarizer through an OpenAI-compatible gateway with `OPENROUTER_BASE_URL`. Tasks, schedules, and workflow agent-task nodes can use portable `modelTier` intent (`smol`, `regular`, `smart`, `ultra`), and operators can set per-agent reasoning effort (`off` → `max`, where supported) without changing task payloads. [Harness config →](https://docs.agent-swarm.dev/docs/guides/harness-configuration) · [Add a new provider →](https://docs.agent-swarm.dev/docs/guides/harness-providers)
|
|
140
|
+
- **Published release artifacts** — every release publishes multi-architecture API, full-worker, and slim-worker images alongside versioned E2B templates, the npm CLI package, and the Helm chart. [Artifact inventory →](https://docs.agent-swarm.dev/docs/guides/published-artifacts)
|
|
140
141
|
- **OpenTelemetry traces plus OTLP cost/token metrics** — export API + worker traces and finalized session cost/token counters through the same OTLP pipeline for dashboarding in SigNoz, Datadog, Tempo, or another compatible backend. [Observability →](https://docs.agent-swarm.dev/docs/guides/observability-opentelemetry)
|
|
141
142
|
- **Follow-up continuity across all harnesses** — child tasks inherit a bounded prior-task context preamble built from the task chain, so continuity survives restarts and works the same across every provider. [Task lifecycle →](https://docs.agent-swarm.dev/docs/concepts/task-lifecycle)
|
|
142
143
|
- **Skills & MCP servers** — reusable procedural knowledge, bundled skill reference files, and per-agent MCP servers with scope cascade. [MCP tools →](https://docs.agent-swarm.dev/docs/reference/mcp-tools)
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveSlackUserId
|
|
3
|
-
} from "./cli-
|
|
4
|
-
import"./cli-
|
|
3
|
+
} from "./cli-jp4mdj9d.js";
|
|
4
|
+
import"./cli-0925phzv.js";
|
|
5
5
|
import {
|
|
6
6
|
createTaskWithSiblingAwareness
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-qwsagsmg.js";
|
|
8
8
|
import {
|
|
9
9
|
buildCancelledBlocks,
|
|
10
10
|
getTaskLink
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-5ncdb7ff.js";
|
|
12
12
|
import"./cli-wspgs9bt.js";
|
|
13
13
|
import"./cli-dh55d5fg.js";
|
|
14
14
|
import {
|
|
@@ -19,9 +19,9 @@ import {
|
|
|
19
19
|
init_context_key,
|
|
20
20
|
init_db,
|
|
21
21
|
slackContextKey
|
|
22
|
-
} from "./cli-
|
|
22
|
+
} from "./cli-3z4q09tn.js";
|
|
23
23
|
import"./cli-z2zcxes1.js";
|
|
24
|
-
import"./cli-
|
|
24
|
+
import"./cli-p0zgv8pj.js";
|
|
25
25
|
import"./cli-4j2mrzag.js";
|
|
26
26
|
import"./cli-bw80ck94.js";
|
|
27
27
|
import"./cli-xz9aq0rf.js";
|
|
@@ -3,15 +3,15 @@ import {
|
|
|
3
3
|
initSlackApp,
|
|
4
4
|
startSlackApp,
|
|
5
5
|
stopSlackApp
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-dq2ssyf0.js";
|
|
7
7
|
import"./cli-rkndnn90.js";
|
|
8
8
|
import"./cli-b0p7rfnd.js";
|
|
9
|
-
import"./cli-
|
|
9
|
+
import"./cli-5ncdb7ff.js";
|
|
10
10
|
import"./cli-wspgs9bt.js";
|
|
11
11
|
import"./cli-dh55d5fg.js";
|
|
12
|
-
import"./cli-
|
|
12
|
+
import"./cli-3z4q09tn.js";
|
|
13
13
|
import"./cli-z2zcxes1.js";
|
|
14
|
-
import"./cli-
|
|
14
|
+
import"./cli-p0zgv8pj.js";
|
|
15
15
|
import"./cli-4j2mrzag.js";
|
|
16
16
|
import"./cli-bw80ck94.js";
|
|
17
17
|
import"./cli-xz9aq0rf.js";
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
bufferThreadMessage,
|
|
3
3
|
wasEventSeen
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-sqv6c9b8.js";
|
|
5
5
|
import {
|
|
6
6
|
hasOtherUserMention
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-92bqgbgy.js";
|
|
8
8
|
import {
|
|
9
9
|
resolveSlackUserId,
|
|
10
10
|
rewriteSlackMentions
|
|
11
|
-
} from "./cli-
|
|
12
|
-
import"./cli-
|
|
11
|
+
} from "./cli-jp4mdj9d.js";
|
|
12
|
+
import"./cli-0925phzv.js";
|
|
13
13
|
import {
|
|
14
14
|
createTaskWithSiblingAwareness
|
|
15
|
-
} from "./cli-
|
|
15
|
+
} from "./cli-qwsagsmg.js";
|
|
16
16
|
import {
|
|
17
17
|
require_dist
|
|
18
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-dq2ssyf0.js";
|
|
19
19
|
import"./cli-rkndnn90.js";
|
|
20
20
|
import"./cli-b0p7rfnd.js";
|
|
21
|
-
import"./cli-
|
|
21
|
+
import"./cli-5ncdb7ff.js";
|
|
22
22
|
import"./cli-wspgs9bt.js";
|
|
23
23
|
import"./cli-dh55d5fg.js";
|
|
24
24
|
import {
|
|
@@ -32,9 +32,9 @@ import {
|
|
|
32
32
|
isEnvFlagEnabled,
|
|
33
33
|
resolveTemplate,
|
|
34
34
|
slackContextKey
|
|
35
|
-
} from "./cli-
|
|
35
|
+
} from "./cli-3z4q09tn.js";
|
|
36
36
|
import"./cli-z2zcxes1.js";
|
|
37
|
-
import"./cli-
|
|
37
|
+
import"./cli-p0zgv8pj.js";
|
|
38
38
|
import"./cli-4j2mrzag.js";
|
|
39
39
|
import"./cli-bw80ck94.js";
|
|
40
40
|
import"./cli-xz9aq0rf.js";
|
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
getEmbeddingProvider,
|
|
4
4
|
getMemoryStore,
|
|
5
5
|
init_constants
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-p0ec4vv6.js";
|
|
7
7
|
import"./cli-q25ejbyn.js";
|
|
8
8
|
import {
|
|
9
9
|
getDb,
|
|
10
10
|
init_db
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-3z4q09tn.js";
|
|
12
12
|
import"./cli-z2zcxes1.js";
|
|
13
|
-
import"./cli-
|
|
13
|
+
import"./cli-p0zgv8pj.js";
|
|
14
14
|
import"./cli-4j2mrzag.js";
|
|
15
15
|
import"./cli-bw80ck94.js";
|
|
16
16
|
import"./cli-xz9aq0rf.js";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
embedScript,
|
|
3
3
|
embeddingProvider
|
|
4
|
-
} from "./cli-
|
|
5
|
-
import"./cli-
|
|
4
|
+
} from "./cli-mmk5vagg.js";
|
|
5
|
+
import"./cli-p0ec4vv6.js";
|
|
6
6
|
import"./cli-q25ejbyn.js";
|
|
7
7
|
import {
|
|
8
8
|
getDb,
|
|
9
9
|
init_db
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-3z4q09tn.js";
|
|
11
11
|
import"./cli-z2zcxes1.js";
|
|
12
|
-
import"./cli-
|
|
12
|
+
import"./cli-p0zgv8pj.js";
|
|
13
13
|
import"./cli-4j2mrzag.js";
|
|
14
14
|
import"./cli-bw80ck94.js";
|
|
15
15
|
import"./cli-xz9aq0rf.js";
|
|
@@ -4,15 +4,15 @@ import {
|
|
|
4
4
|
handleScheduleTrigger,
|
|
5
5
|
runScript,
|
|
6
6
|
startWorkflowExecution
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-kk58tg33.js";
|
|
8
8
|
import {
|
|
9
9
|
getScript,
|
|
10
10
|
getScriptApiConnectionDescriptors,
|
|
11
11
|
getScriptMcpConnectionDescriptors
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-wn3m6q54.js";
|
|
13
13
|
import {
|
|
14
14
|
createTaskWithSiblingAwareness
|
|
15
|
-
} from "./cli-
|
|
15
|
+
} from "./cli-qwsagsmg.js";
|
|
16
16
|
import {
|
|
17
17
|
getDb,
|
|
18
18
|
getDueScheduledTasks,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
scheduleContextKey,
|
|
25
25
|
telemetry,
|
|
26
26
|
updateScheduledTask
|
|
27
|
-
} from "./cli-
|
|
27
|
+
} from "./cli-3z4q09tn.js";
|
|
28
28
|
import {
|
|
29
29
|
__commonJS,
|
|
30
30
|
__require,
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
init_package,
|
|
7
7
|
package_default
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-p0zgv8pj.js";
|
|
9
9
|
import {
|
|
10
10
|
init_secret_scrubber,
|
|
11
11
|
scrubSecrets
|
|
@@ -643,6 +643,27 @@ function _resolveCloudMode(mcpBaseUrl) {
|
|
|
643
643
|
return { isCloud: false };
|
|
644
644
|
return { isCloud: isCloudHostname(hostname) };
|
|
645
645
|
}
|
|
646
|
+
function _resolveInstallMethod(raw, isE2b) {
|
|
647
|
+
const normalized = raw?.trim();
|
|
648
|
+
if (normalized && KNOWN_INSTALL_METHODS.has(normalized))
|
|
649
|
+
return normalized;
|
|
650
|
+
if (isE2b)
|
|
651
|
+
return "e2b";
|
|
652
|
+
return "manual";
|
|
653
|
+
}
|
|
654
|
+
function _resolveInstallPreset(raw) {
|
|
655
|
+
const normalized = raw?.trim();
|
|
656
|
+
return normalized && KNOWN_INSTALL_PRESETS.has(normalized) ? normalized : undefined;
|
|
657
|
+
}
|
|
658
|
+
function _hasEmbeddingKey(env = process.env) {
|
|
659
|
+
return !!(env.EMBEDDING_API_KEY || env.OPENAI_API_KEY);
|
|
660
|
+
}
|
|
661
|
+
function _hasSlackChannel(env = process.env) {
|
|
662
|
+
return !!(env.SLACK_BOT_TOKEN && env.SLACK_APP_TOKEN) && !isEnvFlagEnabled("SLACK_DISABLE", false, env);
|
|
663
|
+
}
|
|
664
|
+
function _hasEmailChannel(env = process.env) {
|
|
665
|
+
return !!env.AGENTMAIL_WEBHOOK_SECRET && !isEnvFlagEnabled("AGENTMAIL_DISABLE", false, env);
|
|
666
|
+
}
|
|
646
667
|
async function initTelemetry(sourceId, getConfig, setConfig, options = {}) {
|
|
647
668
|
if (!isEnabled())
|
|
648
669
|
return;
|
|
@@ -651,14 +672,25 @@ async function initTelemetry(sourceId, getConfig, setConfig, options = {}) {
|
|
|
651
672
|
const resolved = _resolveCloudMode(process.env.MCP_BASE_URL);
|
|
652
673
|
cachedIsCloud = resolved.isCloud;
|
|
653
674
|
cachedIsE2b = _isE2bSandbox();
|
|
654
|
-
|
|
675
|
+
cachedHasEmbedding = _hasEmbeddingKey();
|
|
676
|
+
cachedHasSlackChannel = _hasSlackChannel();
|
|
677
|
+
cachedHasEmailChannel = _hasEmailChannel();
|
|
678
|
+
cachedInstallMethod = _resolveInstallMethod(process.env.INSTALL_METHOD, cachedIsE2b);
|
|
679
|
+
cachedInstallPreset = _resolveInstallPreset(process.env.INSTALL_PRESET);
|
|
680
|
+
console.log(`telemetry: cloud=${cachedIsCloud} e2b=${cachedIsE2b} install_method=${cachedInstallMethod}`);
|
|
655
681
|
try {
|
|
656
682
|
const existing = await getConfig("telemetry_installation_id");
|
|
657
683
|
if (existing) {
|
|
658
684
|
installationId = existing;
|
|
685
|
+
const existingInstalledAt = await getConfig("telemetry_installed_at");
|
|
686
|
+
if (existingInstalledAt) {
|
|
687
|
+
installedAt = existingInstalledAt;
|
|
688
|
+
}
|
|
659
689
|
} else if (generateIfMissing) {
|
|
660
|
-
|
|
661
|
-
await setConfig("telemetry_installation_id",
|
|
690
|
+
const candidateId = `install_${randomUUID().replace(/-/g, "").slice(0, 16)}`;
|
|
691
|
+
await setConfig("telemetry_installation_id", candidateId);
|
|
692
|
+
installationId = candidateId;
|
|
693
|
+
await tryPersistInstalledAt(setConfig);
|
|
662
694
|
}
|
|
663
695
|
} catch {
|
|
664
696
|
if (generateIfMissing) {
|
|
@@ -666,6 +698,13 @@ async function initTelemetry(sourceId, getConfig, setConfig, options = {}) {
|
|
|
666
698
|
}
|
|
667
699
|
}
|
|
668
700
|
}
|
|
701
|
+
async function tryPersistInstalledAt(setConfig) {
|
|
702
|
+
const candidate = new Date().toISOString();
|
|
703
|
+
try {
|
|
704
|
+
await setConfig("telemetry_installed_at", candidate);
|
|
705
|
+
installedAt = candidate;
|
|
706
|
+
} catch {}
|
|
707
|
+
}
|
|
669
708
|
function getOrgIdentity() {
|
|
670
709
|
const out = {};
|
|
671
710
|
const orgId = process.env.SWARM_ORG_ID?.trim();
|
|
@@ -703,7 +742,12 @@ function track(options) {
|
|
|
703
742
|
...options.properties ?? {},
|
|
704
743
|
is_cloud: cachedIsCloud || isCloudDeployment(),
|
|
705
744
|
is_e2b: cachedIsE2b,
|
|
706
|
-
swarmVersion: package_default.version
|
|
745
|
+
swarmVersion: package_default.version,
|
|
746
|
+
has_embedding_key: cachedHasEmbedding,
|
|
747
|
+
has_slack_channel: cachedHasSlackChannel,
|
|
748
|
+
has_email_channel: cachedHasEmailChannel,
|
|
749
|
+
has_notification_channel: cachedHasSlackChannel || cachedHasEmailChannel,
|
|
750
|
+
install_method: cachedInstallMethod
|
|
707
751
|
},
|
|
708
752
|
metadata: {
|
|
709
753
|
transport: "https",
|
|
@@ -711,6 +755,8 @@ function track(options) {
|
|
|
711
755
|
environment: getTelemetryEnvironment(),
|
|
712
756
|
is_cloud: isCloudDeployment(),
|
|
713
757
|
...getOrgIdentity(),
|
|
758
|
+
...cachedInstallPreset ? { install_preset: cachedInstallPreset } : {},
|
|
759
|
+
...installedAt ? { install_created_at: installedAt } : {},
|
|
714
760
|
...options.metadata
|
|
715
761
|
}
|
|
716
762
|
};
|
|
@@ -722,7 +768,7 @@ function track(options) {
|
|
|
722
768
|
}).catch(() => {});
|
|
723
769
|
} catch {}
|
|
724
770
|
}
|
|
725
|
-
var TELEMETRY_ENDPOINT = "https://proxy.desplega.sh/v1/events", PRODUCT = "agent-swarm", TIMEOUT_MS = 5000, installationId = null, source = "unknown", cachedIsCloud = false, cachedIsE2b = false, CLOUD_HOST_EXACT, CLOUD_HOST_SUFFIXES, telemetry;
|
|
771
|
+
var TELEMETRY_ENDPOINT = "https://proxy.desplega.sh/v1/events", PRODUCT = "agent-swarm", TIMEOUT_MS = 5000, installationId = null, installedAt = null, source = "unknown", cachedIsCloud = false, cachedIsE2b = false, cachedHasEmbedding = false, cachedHasSlackChannel = false, cachedHasEmailChannel = false, cachedInstallMethod = "manual", cachedInstallPreset, CLOUD_HOST_EXACT, CLOUD_HOST_SUFFIXES, KNOWN_INSTALL_METHODS, KNOWN_INSTALL_PRESETS, telemetry;
|
|
726
772
|
var init_telemetry = __esm(() => {
|
|
727
773
|
init_package();
|
|
728
774
|
init_env_flag();
|
|
@@ -732,6 +778,8 @@ var init_telemetry = __esm(() => {
|
|
|
732
778
|
"agent-swarm.cloud"
|
|
733
779
|
]);
|
|
734
780
|
CLOUD_HOST_SUFFIXES = [".agent-swarm.dev", ".agent-swarm.cloud"];
|
|
781
|
+
KNOWN_INSTALL_METHODS = new Set(["onboard_interactive", "onboard_noninteractive"]);
|
|
782
|
+
KNOWN_INSTALL_PRESETS = new Set(["dev", "content", "research", "solo", "custom"]);
|
|
735
783
|
telemetry = {
|
|
736
784
|
taskEvent(event, props) {
|
|
737
785
|
track({ event: `task.${event}`, properties: props });
|
|
@@ -3329,9 +3377,8 @@ You also still have \`/workspace/personal/\` for general file persistence.
|
|
|
3329
3377
|
You have access to agent-fs — a persistent, searchable filesystem shared across the swarm.
|
|
3330
3378
|
Use the \`agent-fs\` CLI for all thoughts, research, plans, and shared documents.
|
|
3331
3379
|
|
|
3332
|
-
The \`agent-fs\` skill (
|
|
3333
|
-
|
|
3334
|
-
interactive CLI documentation.
|
|
3380
|
+
The \`agent-fs\` skill (installed in your skills directory) provides a full CLI
|
|
3381
|
+
reference. You can also run \`agent-fs docs\` for interactive CLI documentation.
|
|
3335
3382
|
|
|
3336
3383
|
### Writing to your personal drive (default)
|
|
3337
3384
|
\`\`\`bash
|
|
@@ -3421,6 +3468,50 @@ Your source code lives in the \`desplega-ai/agent-swarm\` GitHub repository. Key
|
|
|
3421
3468
|
Use this to debug issues and propose improvements to your own infrastructure.
|
|
3422
3469
|
|
|
3423
3470
|
**Proposing changes:** If you want to change how you are built (hooks, runner, prompts, tools), ask the lead agent to follow up with the user in Slack to discuss the change. Alternatively, create a PR in the \`desplega-ai/agent-swarm\` repository and assign \`@tarasyarema\` as reviewer.
|
|
3471
|
+
`,
|
|
3472
|
+
variables: [],
|
|
3473
|
+
category: "system"
|
|
3474
|
+
});
|
|
3475
|
+
registerTemplate({
|
|
3476
|
+
eventType: "system.agent.script_authoring_contract",
|
|
3477
|
+
header: "",
|
|
3478
|
+
defaultBody: `
|
|
3479
|
+
### Script Authoring Contract (read BEFORE writing any script)
|
|
3480
|
+
|
|
3481
|
+
**Entry point — \`args\` FIRST, \`ctx\` SECOND.** A one-parameter \`function (ctx)\` can execute through \`script-run\`, but at runtime that parameter receives \`args\`, so every \`ctx.*\` access throws. \`script-upsert\` also rejects an untyped parameter under strict typechecking. This is the single most common cause of failed script runs.
|
|
3482
|
+
|
|
3483
|
+
\`\`\`ts
|
|
3484
|
+
import type { ScriptContext } from "swarm-sdk";
|
|
3485
|
+
import * as z from "zod";
|
|
3486
|
+
|
|
3487
|
+
export const argsSchema = z.object({ taskId: z.string(), limit: z.number().optional() });
|
|
3488
|
+
|
|
3489
|
+
export default async function (args: z.infer<typeof argsSchema>, ctx: ScriptContext) {
|
|
3490
|
+
const res = await ctx.swarm.task_get({ taskId: args.taskId });
|
|
3491
|
+
const task = ((res as { data?: unknown }).data ?? res) as { title?: string };
|
|
3492
|
+
return { title: task?.title };
|
|
3493
|
+
}
|
|
3494
|
+
\`\`\`
|
|
3495
|
+
|
|
3496
|
+
**Typechecking:** inline source passed to \`script-run\` executes without a compile-time typecheck. \`script-upsert\` typechecks before saving, so import \`ScriptContext\` from \`"swarm-sdk"\` as shown above to make inline code promotion-safe. Use \`script-query-types\` for the authoritative SDK and stdlib declarations.
|
|
3497
|
+
|
|
3498
|
+
**What \`ctx\` actually holds for inline/named scripts (\`script-run\` / \`script-upsert\`) — nothing else:**
|
|
3499
|
+
- \`ctx.swarm.*\` — the swarm SDK: \`task_get\`, \`task_send\`, \`task_storeProgress\`, \`task_action\`, \`task_list\`, \`message_post\`, \`message_read\`, \`slack_reply\`, \`memory_search\`, \`kv_get\`/\`kv_set\`/\`kv_del\`/\`kv_incr\`/\`kv_list\`, \`swarm_get\`, \`agent_info\`, and more. Responses are usually wrapped — prefer \`res?.data ?? res\`.
|
|
3500
|
+
- \`ctx.swarm.config\` — \`apiKey\`, \`agentId\`, \`mcpBaseUrl\`, plus \`ctx.swarm.config.get("KEY")\` for user values. All are \`Redacted\` wrappers: they stringify to \`<redacted>\`, and you must never unwrap them into a return value, log line, or request body you build by hand.
|
|
3501
|
+
- \`ctx.api.<slug>\` / \`ctx.mcp.<slug>\` — typed clients for connections the lead registered (\`ctx.api.<slug>.<operationId>(...)\`, \`ctx.api.<slug>.graphql(query, vars)\`, \`ctx.mcp.<slug>.<toolName>(args)\`). They exist ONLY for registered connections — introspect with \`Object.keys(ctx.api ?? {})\` / \`Object.keys(ctx.mcp ?? {})\` before assuming one is there.
|
|
3502
|
+
- \`ctx.stdlib\` — \`fetch\`, \`fetchJson\` (retries + 30s timeout), \`grep\`, \`glob\`, \`table\`, \`Redacted\`.
|
|
3503
|
+
- \`ctx.logger\` — \`log\` / \`warn\` / \`error\`.
|
|
3504
|
+
|
|
3505
|
+
There is NO ambient task context: \`taskId\` must arrive through \`args\`. \`agentId\` IS propagated automatically (\`X-Agent-ID\` header).
|
|
3506
|
+
|
|
3507
|
+
**Durable workflow scripts (\`launch-script-run\`) get a DIFFERENT \`ctx\`:** \`ctx.run\` (\`id\`/\`agentId\`/\`args\`), \`ctx.step.rawLlm(label, config)\` / \`ctx.step.agentTask(label, config)\` / \`ctx.step.swarmScript(label, config)\` (durable, journaled steps), plus \`ctx.swarm.*\`, \`ctx.stdlib\`, \`ctx.logger\` as above. Durable runs have NO \`ctx.api\`/\`ctx.mcp\` connection clients and no \`ctx.swarm.config\` — call connections from an inner script via \`ctx.step.swarmScript\` instead.
|
|
3508
|
+
|
|
3509
|
+
**\`argsSchema\` convention:** export a Zod schema named \`argsSchema\` from every named script. \`script-upsert\` converts it to JSON Schema, so callers, schedules, and workflows can see the script's input contract. Without it the script's args are undocumented.
|
|
3510
|
+
|
|
3511
|
+
**Secrets — never paste a raw value:**
|
|
3512
|
+
- Prefer a registered connection (\`ctx.api.<slug>\` / \`ctx.mcp.<slug>\`): its credentials are attached server-side and never enter the script.
|
|
3513
|
+
- Otherwise put the placeholder \`[REDACTED:<CONFIG_KEY>]\` in the header or query value (e.g. \`Authorization: Bearer [REDACTED:GITHUB_TOKEN]\`). The runtime substitutes the real value at egress, and only for that credential binding's allowed hosts.
|
|
3514
|
+
- NEVER bake a raw secret — or the output of \`get-config\` with \`includeSecrets: true\` — into script source, script args, a schedule's \`taskTemplate\`, or a task description. Those are stored as plaintext and replayed on every run. Use a connection or a credential binding instead.
|
|
3424
3515
|
`,
|
|
3425
3516
|
variables: [],
|
|
3426
3517
|
category: "system"
|
|
@@ -3429,6 +3520,8 @@ Use this to debug issues and propose improvements to your own infrastructure.
|
|
|
3429
3520
|
eventType: "system.agent.script_rubric",
|
|
3430
3521
|
header: "",
|
|
3431
3522
|
defaultBody: `
|
|
3523
|
+
{{@template[system.agent.script_authoring_contract]}}
|
|
3524
|
+
|
|
3432
3525
|
### Agent Scripts — for bulk, repetitive, or data-heavy work
|
|
3433
3526
|
|
|
3434
3527
|
Use **scripts** (\`script-upsert\` + \`script-run\`) when a task involves repetitive SDK calls, large data processing, or deterministic multi-step pipelines. Scripts run out-of-process and return only their final result.
|
|
@@ -3469,13 +3562,7 @@ The 5 script tools (\`script-search\`, \`script-run\`, \`script-upsert\`, \`scri
|
|
|
3469
3562
|
|
|
3470
3563
|
This swarm runs in **scripts-only mode**. The ONLY swarm MCP tools available are the script tools: \`script-search\`, \`script-run\`, \`script-upsert\`, \`script-delete\`, \`script-query-types\`, \`launch-script-run\`, \`get-script-run\`, \`list-script-runs\` (your harness may expose them under a prefix, e.g. \`mcp__agent-swarm__script-run\` — use the exact registered tool id). They are already loaded. Named tools like \`store-progress\`, \`send-task\`, \`post-message\`, \`memory-search\` do NOT exist here — do not search for them.
|
|
3471
3564
|
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
\`\`\`ts
|
|
3475
|
-
export default async function (args: any, ctx: any) { /* ... */ }
|
|
3476
|
-
\`\`\`
|
|
3477
|
-
|
|
3478
|
-
The full SDK is \`ctx.swarm.*\` — task lifecycle (\`task_get\`, \`task_send\`, \`task_storeProgress\`, \`task_action\`, \`task_list\`), messaging (\`message_post\`, \`message_read\`), Slack (\`slack_reply\`, \`slack_post\`, \`slack_read\`), memory, kv, swarm info (\`swarm_get\`, \`agent_info\`), and more. Responses are usually wrapped — prefer \`res?.data ?? res\`.
|
|
3565
|
+
The script authoring contract above (entry signature, \`ctx\` shape, secret handling) applies here unchanged. The full SDK is \`ctx.swarm.*\` — task lifecycle (\`task_get\`, \`task_send\`, \`task_storeProgress\`, \`task_action\`, \`task_list\`), messaging (\`message_post\`, \`message_read\`), Slack (\`slack_reply\`, \`slack_post\`, \`slack_read\`), memory, kv, swarm info (\`swarm_get\`, \`agent_info\`), and more. Responses are usually wrapped — prefer \`res?.data ?? res\`.
|
|
3479
3566
|
|
|
3480
3567
|
**Built-in coordination scripts — USE THESE FIRST (\`script-run\` with \`name\` + \`args\`):**
|
|
3481
3568
|
- \`delegate\` {agentName, task, parentTaskId?} → subtask for an agent by name; returns {taskId}
|
|
@@ -3523,6 +3610,15 @@ You have access to the \`context-mode\` MCP tools (\`batch_execute\`, \`execute\
|
|
|
3523
3610
|
|
|
3524
3611
|
{{@template[system.agent.script_rubric]}}
|
|
3525
3612
|
|
|
3613
|
+
{{@template[system.agent.scheduling]}}
|
|
3614
|
+
`,
|
|
3615
|
+
variables: [],
|
|
3616
|
+
category: "system"
|
|
3617
|
+
});
|
|
3618
|
+
registerTemplate({
|
|
3619
|
+
eventType: "system.agent.scheduling",
|
|
3620
|
+
header: "",
|
|
3621
|
+
defaultBody: `
|
|
3526
3622
|
### Scheduling — Pick the Right targetType
|
|
3527
3623
|
|
|
3528
3624
|
When creating a schedule, match \`targetType\` to the work being fired:
|
|
@@ -3781,6 +3877,29 @@ Honor this requester profile in tone, depth, and format where it doesn't conflic
|
|
|
3781
3877
|
{{@template[system.agent.filesystem]}}
|
|
3782
3878
|
{{@template[system.agent.self_awareness]}}
|
|
3783
3879
|
{{@template[system.agent.script_rubric]}}
|
|
3880
|
+
{{@template[system.agent.scheduling]}}
|
|
3881
|
+
{{@template[system.agent.seed_scripts]}}
|
|
3882
|
+
|
|
3883
|
+
{{@template[system.agent.system]}}
|
|
3884
|
+
{{@template[system.agent.share_urls]}}
|
|
3885
|
+
{{@template[system.agent.code_quality]}}`,
|
|
3886
|
+
variables: [
|
|
3887
|
+
{ name: "role", description: "The agent's role" },
|
|
3888
|
+
{ name: "agentId", description: "The agent's unique identifier" }
|
|
3889
|
+
],
|
|
3890
|
+
category: "session"
|
|
3891
|
+
});
|
|
3892
|
+
registerTemplate({
|
|
3893
|
+
eventType: "system.session.lead.pi",
|
|
3894
|
+
header: "",
|
|
3895
|
+
defaultBody: `{{@template[system.agent.role]}}
|
|
3896
|
+
|
|
3897
|
+
{{@template[system.agent.register]}}
|
|
3898
|
+
{{@template[system.agent.lead]}}
|
|
3899
|
+
{{@template[system.agent.filesystem]}}
|
|
3900
|
+
{{@template[system.agent.self_awareness]}}
|
|
3901
|
+
{{@template[system.agent.script_rubric]}}
|
|
3902
|
+
{{@template[system.agent.scheduling]}}
|
|
3784
3903
|
{{@template[system.agent.seed_scripts]}}
|
|
3785
3904
|
|
|
3786
3905
|
{{@template[system.agent.system]}}
|
|
@@ -4836,6 +4955,7 @@ __export(exports_db, {
|
|
|
4836
4955
|
markInboxMessageDelegated: () => markInboxMessageDelegated,
|
|
4837
4956
|
logQueries: () => logQueries,
|
|
4838
4957
|
listWorkflows: () => listWorkflows,
|
|
4958
|
+
listWorkflowRunsPage: () => listWorkflowRunsPage,
|
|
4839
4959
|
listWorkflowRuns: () => listWorkflowRuns,
|
|
4840
4960
|
listUserFavorites: () => listUserFavorites,
|
|
4841
4961
|
listTaskTemplates: () => listTaskTemplates,
|
|
@@ -5118,6 +5238,7 @@ __export(exports_db, {
|
|
|
5118
5238
|
createApprovalRequest: () => createApprovalRequest,
|
|
5119
5239
|
createAgentMailInboxMapping: () => createAgentMailInboxMapping,
|
|
5120
5240
|
createAgent: () => createAgent,
|
|
5241
|
+
countWorkflowRuns: () => countWorkflowRuns,
|
|
5121
5242
|
countSessions: () => countSessions,
|
|
5122
5243
|
countScriptRuns: () => countScriptRuns,
|
|
5123
5244
|
countScriptRunJournalSteps: () => countScriptRunJournalSteps,
|
|
@@ -9340,8 +9461,50 @@ function updateWorkflowRun(id, data) {
|
|
|
9340
9461
|
}
|
|
9341
9462
|
return run;
|
|
9342
9463
|
}
|
|
9343
|
-
function listWorkflowRuns(workflowId) {
|
|
9344
|
-
|
|
9464
|
+
function listWorkflowRuns(workflowId, options = {}) {
|
|
9465
|
+
const conditions = ["workflowId = ?"];
|
|
9466
|
+
const params = [workflowId];
|
|
9467
|
+
if (options.status) {
|
|
9468
|
+
conditions.push("status = ?");
|
|
9469
|
+
params.push(options.status);
|
|
9470
|
+
}
|
|
9471
|
+
let pagination = "";
|
|
9472
|
+
if (options.limit !== undefined) {
|
|
9473
|
+
pagination = " LIMIT ? OFFSET ?";
|
|
9474
|
+
params.push(options.limit, options.offset ?? 0);
|
|
9475
|
+
} else if (options.offset !== undefined) {
|
|
9476
|
+
pagination = " LIMIT -1 OFFSET ?";
|
|
9477
|
+
params.push(options.offset);
|
|
9478
|
+
}
|
|
9479
|
+
return getDb().prepare(`SELECT * FROM workflow_runs
|
|
9480
|
+
WHERE ${conditions.join(" AND ")}
|
|
9481
|
+
ORDER BY startedAt DESC, id DESC${pagination}`).all(...params).map(rowToWorkflowRun);
|
|
9482
|
+
}
|
|
9483
|
+
function countWorkflowRuns(workflowId, options = {}) {
|
|
9484
|
+
const conditions = ["workflowId = ?"];
|
|
9485
|
+
const params = [workflowId];
|
|
9486
|
+
if (options.status) {
|
|
9487
|
+
conditions.push("status = ?");
|
|
9488
|
+
params.push(options.status);
|
|
9489
|
+
}
|
|
9490
|
+
const row = getDb().prepare(`SELECT COUNT(*) AS count FROM workflow_runs WHERE ${conditions.join(" AND ")}`).get(...params);
|
|
9491
|
+
return row?.count ?? 0;
|
|
9492
|
+
}
|
|
9493
|
+
function listWorkflowRunsPage(workflowId, options) {
|
|
9494
|
+
const runs = listWorkflowRuns(workflowId, options);
|
|
9495
|
+
const total = countWorkflowRuns(workflowId, { status: options.status });
|
|
9496
|
+
const nextOffset = options.offset + runs.length;
|
|
9497
|
+
const hasMore = nextOffset < total;
|
|
9498
|
+
return {
|
|
9499
|
+
runs,
|
|
9500
|
+
page: {
|
|
9501
|
+
limit: options.limit,
|
|
9502
|
+
offset: options.offset,
|
|
9503
|
+
total,
|
|
9504
|
+
hasMore,
|
|
9505
|
+
...hasMore ? { nextOffset } : {}
|
|
9506
|
+
}
|
|
9507
|
+
};
|
|
9345
9508
|
}
|
|
9346
9509
|
function rowToWorkflowRunStep(row) {
|
|
9347
9510
|
return {
|
|
@@ -12041,4 +12204,4 @@ var init_db = __esm(() => {
|
|
|
12041
12204
|
};
|
|
12042
12205
|
});
|
|
12043
12206
|
|
|
12044
|
-
export { normalizeAssetKey, parseAssetKey, canWriteAssetKey, init_key, interpolate, deepInterpolate, init_template, registerTemplate, getTemplateDefinition, getAllTemplateDefinitions, init_registry, configureHttpResolver, resolveTemplate, resolveTemplateAsync, init_resolver, slackContextKey, agentmailContextKey, githubContextKey, gitlabContextKey, linearContextKey, buildJiraContextKey, scheduleContextKey, workflowContextKey, agentContextKey, pageContextKey, init_context_key, checkSlackRoutingCoherence, init_slack_routing, parseEnvFlag, isEnvFlagEnabled, init_env_flag, initTelemetry, telemetry, init_telemetry, AssetKeySchema, AssetEntityTypeSchema, ModelTierSchema, ReasoningEffortSchema, splitLegacyModelAlias, resolveTaskModelSelection, AgentTaskStatusSchema, isTerminalTaskStatus, AgentTaskSourceSchema, ProviderNameSchema, SteerModeSchema, SteeringSourceSchema, SteeringMessageSchema, SteerOutcomeSchema, OnUnsupportedSchema, FollowUpConfigSchema, AgentTaskSchema, AttachmentInputSchema, TaskAttachmentSchema, InboxItemTypeSchema, InboxItemStatusSchema, FavoriteItemTypeSchema, TaskTemplateKindSchema, AgentAvatarSchema, AgentSchema, AgentLatestModelSchema, AgentCredStatusSchema, ChannelTypeSchema, ChannelSchema, ChannelMessageSchema, ServiceStatusSchema, ServiceSchema, ResumeReasonSchema, AgentLogSchema, EventCategorySchema, EventStatusSchema, EventSourceSchema, EventNameSchema, ScheduledTaskTargetTypeSchema, SwarmConfigScopeSchema, SwarmConfigSchema, RepoGuidelinesSchema, RepoHooksSchema, SwarmRepoSchema, AgentMemoryScopeSchema, AgentMemorySourceSchema, AgentMemorySchema, WorkflowDefinitionSchema, WorkflowNodePatchSchema, WorkflowPatchSchema, TriggerConfigSchema, CooldownConfigSchema, InputValueSchema, PageContentTypeSchema, PageAuthModeSchema, MetricDefinitionSchema, MetricVersionSchema, WorkflowRunStatusSchema, ScriptRunStatusSchema, TERMINAL_SCRIPT_RUN_STATUSES, PromptTemplateScopeSchema, PromptTemplateStateSchema, PromptTemplateSchema, PromptTemplateHistorySchema, ScriptScopeSchema, ScriptFsModeSchema, ScriptApiAuthModeSchema, ContextSnapshotEventTypeSchema, ContextFormulaSchema, BudgetScopeSchema, BudgetSchema, PricingProviderSchema, PricingTokenClassSchema, PricingRowSchema, BudgetRefusalCauseSchema, BudgetRefusalNotificationSchema, KvValueTypeSchema, KvNamespaceSchema, KvKeySchema, KvEntrySchema, init_types, setRequestAuth, getRequestAuth, getCurrentRequestAuth, init_request_auth_context, auditAssetKeys, init_asset_key_audit, CredentialBindingSchema, placeholderForConfigKey, CredentialBroker, DEFAULT_CREDENTIAL_BINDINGS, init_credential_broker, encryptSecret, decryptSecret, getEncryptionKey, init_crypto, normalizeDate, normalizeDateRequired, init_date_utils, init_session_templates, init_templates, init_templates2 as init_templates1, isSteeringEnabled, init_steering_enabled, SteeringRequestError, isSteeringEnabled2 as isSteeringEnabled1, getTaskSteeringFields, promotePendingSteeringForTask, markSteeringUndeliverable, requestSteering, init_steering, isReservedConfigKey, reservedKeyError, validateConfigValue, init_swarm_config_guard, onTaskStarted, init_task_lifecycle_events, generateDefaultClaudeMd, generateDefaultSoulMd, generateDefaultIdentityMd, generateDefaultToolsMd, init_defaults, isSqliteVecAvailable, initDb, getDb, closeDb, computeContentHash, createContextVersion, getLatestContextVersion, getContextVersion, getContextVersionHistory, agentQueries, updateAgentCredentialState, createAgent, getAgentById, getAllAgents, getLeadAgent, updateAgentStatus, updateAgentMaxTasks, updateAgentProvider, setAgentHarnessProvider, updateAgentCredStatus, listAgentsWithCredStatusByProvider, getAgentHarnessProviders, updateAgentActivity, MAX_EMPTY_POLLS, incrementEmptyPollCount, resetEmptyPollCount, shouldBlockPolling, deleteAgent, getActiveTaskCount, hasCapacity, getRemainingCapacity, updateAgentStatusFromCapacity, isPoolAffinityEnforcementEnabled, buildRoutingAffinityFromAgent, isAgentEligibleForTask, taskQueries, createTask, getPendingTaskForAgent, assignUnassignedTaskPending, startTask, getTaskById, markTaskSlackReplySent, setSlackMessageTracking, getChildTasks, hasNonTerminalResumeChild, hasNonTerminalRerouteDecisionChild, updateTaskClaudeSessionId, updateTaskTitle, updateTaskVcs, getTasksByAgentId, getAgentCurrentTask, getTasksByStatus, findTaskByVcs, findTaskByGitHub, getAllTasks, getTasksCount, getTaskStats, getCompletedSlackTasks, getRecentlyFinishedWorkerTasks, markTasksNotified, resetTasksNotified, getInProgressSlackTasks, getInProgressTasksByContextKey, findExistingLinearTrackerContextWork, getLatestTaskByContextKey, getAgentWorkingOnThread, getLatestActiveTaskInThread, getLatestLeadTaskInThread, getMostRecentTaskInThread, findCompletedTaskInThread, findRecentCancelledTaskInThread, completeTask, failTask, cancelTask, supersedeTask, backfillSupersedeTaskResumeTaskId, pauseTask, resumeTask, getPausedTasksForAgent, getOrphanedInProgressTasksForAgent, resetOrphanedInProgressTasksForAgent, getRecentlyCancelledTasksForAgent, deleteTask, updateTaskProgress, insertTaskAttachment, getAssetKeyMappingByProvider, upsertAssetKeyMapping, getAssetKeyMapping, listAssetSummaries, moveAssetKey, deleteTaskAttachment, replaceTaskAttachment, getTaskAttachments, createSteeringMessage, getSteeringMessagesForTask, getSteeringMessageById, getPendingSteeringForTask, getPendingSteeringForAgent, markSteeringDelivered, markSteeringHandled, markSteeringPromoted, cancelPendingSteeringForTask, hasPendingSteering, getAgentWithTasks, getAllAgentsWithTasks, logQueries, createLogEntry, getLogsByAgentId, getLogsByTaskId, getLogsByTaskIdChronological, getLogsByEventType, getAllLogs, findRecentSimilarTasks, createTaskExtended, claimTask, releaseTask, acceptTask, rejectTask, moveTaskToBacklog, moveTaskFromBacklog, releaseStaleReviewingTasks, getOfferedTasksForAgent, claimOfferedTask, getUnassignedTasksCount, getUnassignedTaskIds, getUnassignedTaskIdsForAgent, checkDependencies, getDependentTasks, cascadeFailDependents, updateAgentProfile, updateAgentName, createChannel, getMessageById, getChannelById, getChannelByName, getAllChannels, deleteChannel, postMessage, getChannelMessages, updateReadState, getLastReadAt, getUnreadMessages, getMentionsForAgent, getInboxSummary, claimMentions, releaseMentionProcessing, releaseStaleMentionProcessing, createService, getServiceById, getServiceByAgentAndName, getServicesByAgentId, getAllServices, updateServiceStatus, deleteService, upsertService, deleteServicesByAgentId, sessionLogQueries, createSessionLogs, getSessionLogsByTaskId, getSessionLogsBySession, createSessionCost, getSessionCostsByTaskId, getSessionCostsByAgentId, getAllSessionCosts, getSessionCostsFiltered, getSessionCostSummary, getDashboardCostSummary, createInboxMessage, getInboxMessageById, getUnreadInboxMessages, claimInboxMessages, markInboxMessageRead, markInboxMessageResponded, markInboxMessageDelegated, releaseStaleProcessingInbox, getConcurrentContext, getScheduledTasks, getScheduledTaskById, getScheduledTaskByName, createScheduledTask, updateScheduledTask, deleteScheduledTask, getDueScheduledTasks, autoEncryptLegacyPlaintextSecrets, maskSecrets, getSwarmConfigs, getInjectableGlobalConfigs, getSwarmConfigById, getSwarmConfigLookupById, upsertSwarmConfig, deleteSwarmConfig, deleteSwarmConfigByKey, getResolvedConfig, getSwarmRepos, getSwarmRepoById, getSwarmRepoByName, getSwarmRepoByUrl, createSwarmRepo, updateSwarmRepo, deleteSwarmRepo, getAgentMailInboxMapping, getAgentMailInboxMappingsByAgent, getAllAgentMailInboxMappings, createAgentMailInboxMapping, deleteAgentMailInboxMapping, findTaskByAgentMailThread, insertActiveSession, deleteActiveSession, deleteActiveSessionById, getActiveSessions, heartbeatActiveSession, cleanupStaleSessions, cleanupAgentSessions, updateActiveSessionProviderSessionId, getActiveSessionForTask, reassociateSessionLogs, getStalledInProgressTasks, getStalePinnedResumes, failPendingResumeIfUnclaimed, getIdleWorkersWithCapacity, getUnassignedPoolTasks, getStaleUnassignedAffinityTasks, getRecentFailedTasks, getRecentCompletedCount, getRecentFailedCount, createWorkflow, getWorkflow, listWorkflows, updateWorkflow, deleteWorkflow, getWorkflowsByScheduleId, createWorkflowRun, getWorkflowRun, updateWorkflowRun, listWorkflowRuns, createWorkflowRunStep, getWorkflowRunStep, updateWorkflowRunStep, getWorkflowRunStepsByRunId, getStuckWorkflowRuns, getLastSuccessfulRun, getLastRunStart, getRetryableSteps, getCompletedStepNodeIds, getTaskByWorkflowRunStepId, getStepByIdempotencyKey, getStepCountForNode, getLatestStepForNode, createWorkflowVersion, getWorkflowVersions, getWorkflowVersion, createPage, getPage, getPageBySlug, getLatestPageBySlug, listPagesByAgent, listAllPages, countAllPages, countPagesByAgent, updatePage, deletePage, incrementPageViewCount, createPageVersion, getPageVersions, getPageVersion, createMetric, getMetric, getMetricBySlug, listMetricsByAgent, listAllMetrics, countAllMetrics, countMetricsByAgent, updateMetric, deleteMetric, createMetricVersion, getMetricVersions, getMetricVersion, getPromptTemplates, getPromptTemplateById, upsertPromptTemplate, deletePromptTemplate, resetPromptTemplateToDefault, getPromptTemplateHistory, resolvePromptTemplate, checkoutPromptTemplate, getAllChannelActivityCursors, getChannelActivityCursor, upsertChannelActivityCursor, createApprovalRequest, getApprovalRequestById, resolveApprovalRequest, updateApprovalRequestNotifications, listApprovalRequests, getStuckApprovalRuns, getApprovalRequestByStepId, getExpiredPendingApprovals, createWaitState, getWaitStateById, getWaitStateByStepId, getDueWaitStates, getPendingEventWaitNames, getPendingWaitsByEvent, resolveWaitState, getStuckWaitRuns, SKILL_FILE_LIMITS, normalizeSkillFilePath, createSkill, updateSkill, listSkillFileManifest, getSkillFiles, getSkillFile, upsertSkillFile, upsertSkillFiles, deleteSkillFile, deleteSkill, getSkillById, getSkillByName, listSkills, searchSkills, installSkill, getSystemDefaultSkills, installSystemDefaultSkillsForAgent, uninstallSkill, getAgentSkills, toggleAgentSkill, createMcpServer, updateMcpServer, deleteMcpServer, getMcpServerById, getMcpServerByName, listMcpServers, installMcpServer, uninstallMcpServer, getAgentMcpServers, createContextSnapshot, getContextSnapshotsByTaskId, getContextSnapshotsBySessionId, getContextSummaryByTaskId, getAvailableKeyIndices, recordKeyUsage, markKeyRateLimited, recordKeyRateLimitWindows, setApiKeyName, clearKeyRateLimit, getKeyStatuses, getKeyCostSummary, getUserById, getAllUsers, createUser, updateUser, deleteUser, listInboxState, upsertInboxState, listFavorites, listUserFavorites, getFavoriteItemIdSet, setFavorite, setUserFavorite, withFavoriteFlags, listTaskTemplates, getRootTaskChain, listRecentSessions, countSessions, getBudget, getBudgets, upsertBudget, deleteBudget, getAllPricingRows, getPricingRows, getActivePricingRow, insertPricingRow, deletePricingRow, getDailySpendForAgent, getDailySpendGlobal, getDailySpendForUser, recordBudgetRefusalNotification, getBudgetRefusalNotification, getRecentBudgetRefusalNotifications, hasBudgetRefusalNotificationToday, setBudgetRefusalFollowUpTaskId, getLiveAgentCounts, getInstanceActivity, getSwarmMetrics, hasFirstCompletedTask, getKv, upsertKv, deleteKv, KvTypeCollisionError, incrKv, listKv, countKv, createScriptRun, recordInlineScriptRun, getScriptRun, getScriptRunByIdempotencyKey, listScriptRuns, countScriptRuns, countActiveScriptRuns, updateScriptRun, getRunningScriptRuns, getScriptRunJournalStep, upsertScriptRunJournalStep, listScriptRunJournalSteps, countScriptRunJournalSteps, countScriptRunJournalAgentTaskSteps, exports_db, init_db };
|
|
12207
|
+
export { normalizeAssetKey, parseAssetKey, canWriteAssetKey, init_key, interpolate, deepInterpolate, init_template, registerTemplate, getTemplateDefinition, getAllTemplateDefinitions, init_registry, configureHttpResolver, resolveTemplate, resolveTemplateAsync, init_resolver, slackContextKey, agentmailContextKey, githubContextKey, gitlabContextKey, linearContextKey, buildJiraContextKey, scheduleContextKey, workflowContextKey, agentContextKey, pageContextKey, init_context_key, checkSlackRoutingCoherence, init_slack_routing, parseEnvFlag, isEnvFlagEnabled, init_env_flag, initTelemetry, telemetry, init_telemetry, AssetKeySchema, AssetEntityTypeSchema, ModelTierSchema, ReasoningEffortSchema, splitLegacyModelAlias, resolveTaskModelSelection, AgentTaskStatusSchema, isTerminalTaskStatus, AgentTaskSourceSchema, ProviderNameSchema, SteerModeSchema, SteeringSourceSchema, SteerOutcomeSchema, OnUnsupportedSchema, FollowUpConfigSchema, AttachmentInputSchema, InboxItemTypeSchema, InboxItemStatusSchema, FavoriteItemTypeSchema, TaskTemplateKindSchema, AgentStatusSchema, AgentAvatarSchema, AgentLatestModelSchema, AgentCredStatusSchema, ChannelTypeSchema, ServiceStatusSchema, ResumeReasonSchema, EventCategorySchema, EventStatusSchema, EventSourceSchema, EventNameSchema, ScheduledTaskTargetTypeSchema, SwarmConfigScopeSchema, RepoGuidelinesSchema, RepoHooksSchema, SwarmRepoSchema, AgentMemoryScopeSchema, AgentMemorySourceSchema, WorkflowDefinitionSchema, WorkflowNodePatchSchema, WorkflowPatchSchema, TriggerConfigSchema, CooldownConfigSchema, InputValueSchema, PageContentTypeSchema, PageAuthModeSchema, MetricDefinitionSchema, MetricVersionSchema, WorkflowRunStatusSchema, ScriptRunStatusSchema, TERMINAL_SCRIPT_RUN_STATUSES, PromptTemplateScopeSchema, PromptTemplateStateSchema, ScriptScopeSchema, ScriptFsModeSchema, ScriptApiAuthModeSchema, ContextSnapshotEventTypeSchema, ContextFormulaSchema, BudgetScopeSchema, BudgetSchema, PricingProviderSchema, PricingTokenClassSchema, PricingRowSchema, BudgetRefusalCauseSchema, BudgetRefusalNotificationSchema, KvValueTypeSchema, KvNamespaceSchema, KvKeySchema, init_types, setRequestAuth, getRequestAuth, getCurrentRequestAuth, init_request_auth_context, auditAssetKeys, init_asset_key_audit, CredentialBindingSchema, placeholderForConfigKey, CredentialBroker, DEFAULT_CREDENTIAL_BINDINGS, init_credential_broker, encryptSecret, decryptSecret, getEncryptionKey, init_crypto, normalizeDate, normalizeDateRequired, init_date_utils, init_session_templates, init_templates, init_templates2 as init_templates1, isSteeringEnabled, init_steering_enabled, SteeringRequestError, isSteeringEnabled2 as isSteeringEnabled1, getTaskSteeringFields, promotePendingSteeringForTask, markSteeringUndeliverable, requestSteering, init_steering, isReservedConfigKey, reservedKeyError, validateConfigValue, init_swarm_config_guard, onTaskStarted, init_task_lifecycle_events, generateDefaultClaudeMd, generateDefaultSoulMd, generateDefaultIdentityMd, generateDefaultToolsMd, init_defaults, isSqliteVecAvailable, initDb, getDb, closeDb, computeContentHash, createContextVersion, getLatestContextVersion, getContextVersion, getContextVersionHistory, agentQueries, updateAgentCredentialState, createAgent, getAgentById, getAllAgents, getLeadAgent, updateAgentStatus, updateAgentMaxTasks, updateAgentProvider, setAgentHarnessProvider, updateAgentCredStatus, listAgentsWithCredStatusByProvider, getAgentHarnessProviders, updateAgentActivity, MAX_EMPTY_POLLS, incrementEmptyPollCount, resetEmptyPollCount, shouldBlockPolling, deleteAgent, getActiveTaskCount, hasCapacity, getRemainingCapacity, updateAgentStatusFromCapacity, isPoolAffinityEnforcementEnabled, buildRoutingAffinityFromAgent, isAgentEligibleForTask, taskQueries, createTask, getPendingTaskForAgent, assignUnassignedTaskPending, startTask, getTaskById, markTaskSlackReplySent, setSlackMessageTracking, getChildTasks, hasNonTerminalResumeChild, hasNonTerminalRerouteDecisionChild, updateTaskClaudeSessionId, updateTaskTitle, updateTaskVcs, getTasksByAgentId, getAgentCurrentTask, getTasksByStatus, findTaskByVcs, findTaskByGitHub, getAllTasks, getTasksCount, getTaskStats, getCompletedSlackTasks, getRecentlyFinishedWorkerTasks, markTasksNotified, resetTasksNotified, getInProgressSlackTasks, getInProgressTasksByContextKey, findExistingLinearTrackerContextWork, getLatestTaskByContextKey, getAgentWorkingOnThread, getLatestActiveTaskInThread, getLatestLeadTaskInThread, getMostRecentTaskInThread, findCompletedTaskInThread, findRecentCancelledTaskInThread, completeTask, failTask, cancelTask, supersedeTask, backfillSupersedeTaskResumeTaskId, pauseTask, resumeTask, getPausedTasksForAgent, getOrphanedInProgressTasksForAgent, resetOrphanedInProgressTasksForAgent, getRecentlyCancelledTasksForAgent, deleteTask, updateTaskProgress, insertTaskAttachment, getAssetKeyMappingByProvider, upsertAssetKeyMapping, getAssetKeyMapping, listAssetSummaries, moveAssetKey, deleteTaskAttachment, replaceTaskAttachment, getTaskAttachments, createSteeringMessage, getSteeringMessagesForTask, getSteeringMessageById, getPendingSteeringForTask, getPendingSteeringForAgent, markSteeringDelivered, markSteeringHandled, markSteeringPromoted, cancelPendingSteeringForTask, hasPendingSteering, getAgentWithTasks, getAllAgentsWithTasks, logQueries, createLogEntry, getLogsByAgentId, getLogsByTaskId, getLogsByTaskIdChronological, getLogsByEventType, getAllLogs, findRecentSimilarTasks, createTaskExtended, claimTask, releaseTask, acceptTask, rejectTask, moveTaskToBacklog, moveTaskFromBacklog, releaseStaleReviewingTasks, getOfferedTasksForAgent, claimOfferedTask, getUnassignedTasksCount, getUnassignedTaskIds, getUnassignedTaskIdsForAgent, checkDependencies, getDependentTasks, cascadeFailDependents, updateAgentProfile, updateAgentName, createChannel, getMessageById, getChannelById, getChannelByName, getAllChannels, deleteChannel, postMessage, getChannelMessages, updateReadState, getLastReadAt, getUnreadMessages, getMentionsForAgent, getInboxSummary, claimMentions, releaseMentionProcessing, releaseStaleMentionProcessing, createService, getServiceById, getServiceByAgentAndName, getServicesByAgentId, getAllServices, updateServiceStatus, deleteService, upsertService, deleteServicesByAgentId, sessionLogQueries, createSessionLogs, getSessionLogsByTaskId, getSessionLogsBySession, createSessionCost, getSessionCostsByTaskId, getSessionCostsByAgentId, getAllSessionCosts, getSessionCostsFiltered, getSessionCostSummary, getDashboardCostSummary, createInboxMessage, getInboxMessageById, getUnreadInboxMessages, claimInboxMessages, markInboxMessageRead, markInboxMessageResponded, markInboxMessageDelegated, releaseStaleProcessingInbox, getConcurrentContext, getScheduledTasks, getScheduledTaskById, getScheduledTaskByName, createScheduledTask, updateScheduledTask, deleteScheduledTask, getDueScheduledTasks, autoEncryptLegacyPlaintextSecrets, maskSecrets, getSwarmConfigs, getInjectableGlobalConfigs, getSwarmConfigById, getSwarmConfigLookupById, upsertSwarmConfig, deleteSwarmConfig, deleteSwarmConfigByKey, getResolvedConfig, getSwarmRepos, getSwarmRepoById, getSwarmRepoByName, getSwarmRepoByUrl, createSwarmRepo, updateSwarmRepo, deleteSwarmRepo, getAgentMailInboxMapping, getAgentMailInboxMappingsByAgent, getAllAgentMailInboxMappings, createAgentMailInboxMapping, deleteAgentMailInboxMapping, findTaskByAgentMailThread, insertActiveSession, deleteActiveSession, deleteActiveSessionById, getActiveSessions, heartbeatActiveSession, cleanupStaleSessions, cleanupAgentSessions, updateActiveSessionProviderSessionId, getActiveSessionForTask, reassociateSessionLogs, getStalledInProgressTasks, getStalePinnedResumes, failPendingResumeIfUnclaimed, getIdleWorkersWithCapacity, getUnassignedPoolTasks, getStaleUnassignedAffinityTasks, getRecentFailedTasks, getRecentCompletedCount, getRecentFailedCount, createWorkflow, getWorkflow, listWorkflows, updateWorkflow, deleteWorkflow, getWorkflowsByScheduleId, createWorkflowRun, getWorkflowRun, updateWorkflowRun, listWorkflowRuns, countWorkflowRuns, listWorkflowRunsPage, createWorkflowRunStep, getWorkflowRunStep, updateWorkflowRunStep, getWorkflowRunStepsByRunId, getStuckWorkflowRuns, getLastSuccessfulRun, getLastRunStart, getRetryableSteps, getCompletedStepNodeIds, getTaskByWorkflowRunStepId, getStepByIdempotencyKey, getStepCountForNode, getLatestStepForNode, createWorkflowVersion, getWorkflowVersions, getWorkflowVersion, createPage, getPage, getPageBySlug, getLatestPageBySlug, listPagesByAgent, listAllPages, countAllPages, countPagesByAgent, updatePage, deletePage, incrementPageViewCount, createPageVersion, getPageVersions, getPageVersion, createMetric, getMetric, getMetricBySlug, listMetricsByAgent, listAllMetrics, countAllMetrics, countMetricsByAgent, updateMetric, deleteMetric, createMetricVersion, getMetricVersions, getMetricVersion, getPromptTemplates, getPromptTemplateById, upsertPromptTemplate, deletePromptTemplate, resetPromptTemplateToDefault, getPromptTemplateHistory, resolvePromptTemplate, checkoutPromptTemplate, getAllChannelActivityCursors, getChannelActivityCursor, upsertChannelActivityCursor, createApprovalRequest, getApprovalRequestById, resolveApprovalRequest, updateApprovalRequestNotifications, listApprovalRequests, getStuckApprovalRuns, getApprovalRequestByStepId, getExpiredPendingApprovals, createWaitState, getWaitStateById, getWaitStateByStepId, getDueWaitStates, getPendingEventWaitNames, getPendingWaitsByEvent, resolveWaitState, getStuckWaitRuns, SKILL_FILE_LIMITS, normalizeSkillFilePath, createSkill, updateSkill, listSkillFileManifest, getSkillFiles, getSkillFile, upsertSkillFile, upsertSkillFiles, deleteSkillFile, deleteSkill, getSkillById, getSkillByName, listSkills, searchSkills, installSkill, getSystemDefaultSkills, installSystemDefaultSkillsForAgent, uninstallSkill, getAgentSkills, toggleAgentSkill, createMcpServer, updateMcpServer, deleteMcpServer, getMcpServerById, getMcpServerByName, listMcpServers, installMcpServer, uninstallMcpServer, getAgentMcpServers, createContextSnapshot, getContextSnapshotsByTaskId, getContextSnapshotsBySessionId, getContextSummaryByTaskId, getAvailableKeyIndices, recordKeyUsage, markKeyRateLimited, recordKeyRateLimitWindows, setApiKeyName, clearKeyRateLimit, getKeyStatuses, getKeyCostSummary, getUserById, getAllUsers, createUser, updateUser, deleteUser, listInboxState, upsertInboxState, listFavorites, listUserFavorites, getFavoriteItemIdSet, setFavorite, setUserFavorite, withFavoriteFlags, listTaskTemplates, getRootTaskChain, listRecentSessions, countSessions, getBudget, getBudgets, upsertBudget, deleteBudget, getAllPricingRows, getPricingRows, getActivePricingRow, insertPricingRow, deletePricingRow, getDailySpendForAgent, getDailySpendGlobal, getDailySpendForUser, recordBudgetRefusalNotification, getBudgetRefusalNotification, getRecentBudgetRefusalNotifications, hasBudgetRefusalNotificationToday, setBudgetRefusalFollowUpTaskId, getLiveAgentCounts, getInstanceActivity, getSwarmMetrics, hasFirstCompletedTask, getKv, upsertKv, deleteKv, KvTypeCollisionError, incrKv, listKv, countKv, createScriptRun, recordInlineScriptRun, getScriptRun, getScriptRunByIdempotencyKey, listScriptRuns, countScriptRuns, countActiveScriptRuns, updateScriptRun, getRunningScriptRuns, getScriptRunJournalStep, upsertScriptRunJournalStep, listScriptRunJournalSteps, countScriptRunJournalSteps, countScriptRunJournalAgentTaskSteps, exports_db, init_db };
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
getScriptApiTypes,
|
|
3
3
|
getScriptMcpTypes,
|
|
4
4
|
require_typescript
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-wn3m6q54.js";
|
|
6
6
|
import {
|
|
7
7
|
deleteSwarmConfigByKey,
|
|
8
8
|
getAgentById,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
getSwarmConfigs,
|
|
12
12
|
init_db,
|
|
13
13
|
upsertSwarmConfig
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-3z4q09tn.js";
|
|
15
15
|
import {
|
|
16
16
|
init_secret_scrubber,
|
|
17
17
|
scrubSecrets
|
|
@@ -457,7 +457,7 @@ export interface SwarmSdk {
|
|
|
457
457
|
// --- workflows ---
|
|
458
458
|
workflow_list(args?: { enabled?: boolean; includeFull?: boolean; consecutiveErrorsMin?: number; lastRunStatus?: "running" | "waiting" | "completed" | "failed" | "skipped" | "cancelled" }): Promise<unknown>;
|
|
459
459
|
workflow_get(args: { id: string }): Promise<unknown>;
|
|
460
|
-
workflow_listRuns(args: { workflowId: string; status?: "running" | "waiting" | "completed" | "failed" | "skipped" | "cancelled" }): Promise<unknown>;
|
|
460
|
+
workflow_listRuns(args: { workflowId: string; status?: "running" | "waiting" | "completed" | "failed" | "skipped" | "cancelled"; limit?: number; offset?: number }): Promise<unknown>;
|
|
461
461
|
workflow_getRun(args: { id: string }): Promise<unknown>;
|
|
462
462
|
// --- prompt templates ---
|
|
463
463
|
prompt_list(args?: { eventType?: string; scope?: "global" | "agent" | "repo"; scopeId?: string; isDefault?: boolean }): Promise<unknown>;
|
|
@@ -646,6 +646,17 @@ export interface ScriptContext {
|
|
|
646
646
|
logger: ScriptLogger;
|
|
647
647
|
}
|
|
648
648
|
|
|
649
|
+
/**
|
|
650
|
+
* A swarm script's default export. \`args\` comes FIRST, \`ctx\` second — never swap them.
|
|
651
|
+
*
|
|
652
|
+
* @example
|
|
653
|
+
* import type { ScriptContext } from "swarm-sdk";
|
|
654
|
+
*
|
|
655
|
+
* export default async function (args: { name: string }, ctx: ScriptContext) {
|
|
656
|
+
* await ctx.logger.log(\`hello \${args.name}\`);
|
|
657
|
+
* return { ok: true };
|
|
658
|
+
* }
|
|
659
|
+
*/
|
|
649
660
|
// biome-ignore lint/suspicious/noExplicitAny: scripts may narrow their args type at the entrypoint.
|
|
650
661
|
export type ScriptMain = (args: any, ctx: ScriptContext) => unknown | Promise<unknown>;
|
|
651
662
|
`;
|
|
@@ -1152,17 +1163,15 @@ void _scriptMain;
|
|
|
1152
1163
|
});
|
|
1153
1164
|
if (diagnostics.length === 0)
|
|
1154
1165
|
return { ok: true };
|
|
1155
|
-
const
|
|
1166
|
+
const formatHost = {
|
|
1156
1167
|
getCanonicalFileName: (fileName) => fileName,
|
|
1157
1168
|
getCurrentDirectory: () => "/virtual",
|
|
1158
1169
|
getNewLine: () => `
|
|
1159
1170
|
`
|
|
1160
|
-
}
|
|
1171
|
+
};
|
|
1161
1172
|
return {
|
|
1162
1173
|
ok: false,
|
|
1163
|
-
diagnostics:
|
|
1164
|
-
|
|
1165
|
-
`).filter(Boolean),
|
|
1174
|
+
diagnostics: diagnostics.map((diagnostic) => import_typescript.default.formatDiagnosticsWithColorAndContext([diagnostic], formatHost).trimEnd()),
|
|
1166
1175
|
structured: diagnostics.map(toStructured)
|
|
1167
1176
|
};
|
|
1168
1177
|
}
|