@desplega.ai/agent-swarm 2.8.0 → 2.8.2

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.
Files changed (216) hide show
  1. package/dist/{acp-adapter-t949vbbp.js → acp-adapter-fqzkxyra.js} +3 -3
  2. package/dist/{actions-7e9czc7s.js → actions-kxek041g.js} +18 -18
  3. package/dist/{amp-adapter-gv6cbb7d.js → amp-adapter-ce7jjke4.js} +1 -1
  4. package/dist/{app-b9fbkp9v.js → app-v6zz8yh0.js} +3 -3
  5. package/dist/{assistant-wjb7v4c7.js → assistant-m0sw9xx2.js} +19 -19
  6. package/dist/{boot-args-schema-2t37e0fe.js → boot-args-schema-66bk37wv.js} +1 -1
  7. package/dist/{boot-reembed-gka3zas7.js → boot-reembed-edjpwsc1.js} +1 -1
  8. package/dist/{boot-reembed-a35nkyr1.js → boot-reembed-y27n09tz.js} +1 -1
  9. package/dist/{boot-scrub-sweep-65sdnp6c.js → boot-scrub-sweep-1xc35965.js} +3 -3
  10. package/dist/{boot-seeds-x42tzytw.js → boot-seeds-7hjj91qj.js} +4 -4
  11. package/dist/{boxd-qbkxy6ap.js → boxd-ent8ch04.js} +1 -1
  12. package/dist/{claude-adapter-v221b2fd.js → claude-adapter-stw7jdcf.js} +3 -3
  13. package/dist/{claude-managed-adapter-29eq09wd.js → claude-managed-adapter-jh6c523j.js} +2 -2
  14. package/dist/{claude-managed-setup-9m6450zk.js → claude-managed-setup-y6z2perp.js} +5 -5
  15. package/dist/{claude-sdk-session-0q0ptaba.js → claude-sdk-session-vvya8wqk.js} +3 -3
  16. package/dist/{cli-wk18cm92.js → cli-0cq8y6m7.js} +1 -1
  17. package/dist/{cli-p1w18yhx.js → cli-1pz0330a.js} +1 -1
  18. package/dist/{cli-y97qxcfx.js → cli-1qkz151v.js} +3 -3
  19. package/dist/{cli-qwca7s44.js → cli-26ctbcdp.js} +18 -6
  20. package/dist/{cli-8fknbnhw.js → cli-2kvhc7x8.js} +7 -7
  21. package/dist/{cli-rfywm85n.js → cli-3e875j5p.js} +136 -49
  22. package/dist/{cli-6wxjceza.js → cli-3sy2xags.js} +10 -10
  23. package/dist/{cli-a7wvp2km.js → cli-3vmb0n58.js} +1 -1
  24. package/dist/{cli-p1bq50aa.js → cli-4vzgeta4.js} +13 -13
  25. package/dist/{cli-m28atx8q.js → cli-5y340nzn.js} +4 -4
  26. package/dist/{cli-7p1kvkck.js → cli-6rc5frdm.js} +1 -1
  27. package/dist/{cli-tph5wt3y.js → cli-6wj7p986.js} +1 -1
  28. package/dist/{cli-t73cas91.js → cli-7349va39.js} +8100 -7620
  29. package/dist/{cli-ee0b971j.js → cli-837vfs2x.js} +2 -2
  30. package/dist/{cli-abejgen1.js → cli-959kp5h2.js} +12 -11
  31. package/dist/{cli-8kzasymh.js → cli-97ae65rz.js} +4 -4
  32. package/dist/{cli-m4dqmnbp.js → cli-9mb2q6pb.js} +1 -1
  33. package/dist/{cli-p2gfst4m.js → cli-a0z912j7.js} +123 -35
  34. package/dist/{cli-4txa0ter.js → cli-b98a65ed.js} +3 -3
  35. package/dist/{cli-k0wwfqbg.js → cli-dns0y538.js} +4 -0
  36. package/dist/{cli-tk7cjj8h.js → cli-dzpc6en0.js} +1 -1
  37. package/dist/{cli-qa4wdgsy.js → cli-e1p3n5gq.js} +4 -4
  38. package/dist/{cli-gxkx0zzp.js → cli-f4e8r23x.js} +1 -1
  39. package/dist/{cli-qmqk2yc2.js → cli-f4r3g076.js} +1 -1
  40. package/dist/{cli-wcg8x116.js → cli-f6bahpn5.js} +1 -1
  41. package/dist/{cli-qsnnd04k.js → cli-fpjmegdb.js} +1 -1
  42. package/dist/{cli-j790gp2w.js → cli-fwy8kfd6.js} +271 -37
  43. package/dist/{cli-rmmpt0wm.js → cli-g5mtmf6t.js} +6 -6
  44. package/dist/{cli-rzsy6nc6.js → cli-gyt3zydq.js} +3 -3
  45. package/dist/{cli-pasjcnmj.js → cli-j24zbska.js} +3 -3
  46. package/dist/{cli-qfedvmcr.js → cli-jdknh18m.js} +10 -10
  47. package/dist/{cli-7b8sbmag.js → cli-kjtwrhea.js} +1 -1
  48. package/dist/{cli-gpwhbgx0.js → cli-m9s2qff2.js} +57 -25
  49. package/dist/{cli-2wnq8jkz.js → cli-mxn1qvbn.js} +3 -2
  50. package/dist/{cli-s7t6p9my.js → cli-n6vtrcht.js} +1 -1
  51. package/dist/{cli-2zp0et3v.js → cli-pchypa1s.js} +55 -19
  52. package/dist/{cli-yq3zak69.js → cli-pfs8adn4.js} +1 -1
  53. package/dist/{cli-c55z5chy.js → cli-q24n86d2.js} +2 -2
  54. package/dist/{cli-h38x262p.js → cli-rcecc3yq.js} +167 -43
  55. package/dist/{cli-xae4g51r.js → cli-rh15cakt.js} +1 -1
  56. package/dist/{cli-sdtt3men.js → cli-rmzsadkf.js} +1 -1
  57. package/dist/{cli-f3vq58d2.js → cli-t2tma8gb.js} +1 -1
  58. package/dist/{cli-m23zjcy2.js → cli-tekytdq9.js} +2 -2
  59. package/dist/{cli-tqegb8eq.js → cli-vdektqgf.js} +1 -1
  60. package/dist/{cli-ffhtssbp.js → cli-vj75tyaw.js} +1 -1
  61. package/dist/{cli-deefvewm.js → cli-w401b9tq.js} +1 -1
  62. package/dist/{cli-n9ftpys4.js → cli-x6t50dmw.js} +7 -7
  63. package/dist/{cli-6t09sdhy.js → cli-xf3qw745.js} +3 -3
  64. package/dist/{cli-hxpyc9sn.js → cli-z1w943va.js} +2 -2
  65. package/dist/{cli-334z18y3.js → cli-zh9rsbqf.js} +3 -3
  66. package/dist/cli.js +17 -17
  67. package/dist/{codex-adapter-30j9bpzd.js → codex-adapter-zerf5qsp.js} +1 -1
  68. package/dist/{codex-hook-h3vk6xzr.js → codex-hook-30gyhzxe.js} +1 -1
  69. package/dist/{codex-session-runner-8vp57v8w.js → codex-session-runner-89s304py.js} +1 -1
  70. package/dist/{commands-bngnz9g7.js → commands-jeh1b51j.js} +3 -3
  71. package/dist/{controller-hxx8wwy1.js → controller-mctfbrse.js} +3 -3
  72. package/dist/{controllers-connect-e2b4gyxc.js → controllers-connect-nxa1ddwn.js} +19 -19
  73. package/dist/{cursor-adapter-n5nc3mfe.js → cursor-adapter-qj8vehv6.js} +1 -1
  74. package/dist/{db-bgm7vkc0.js → db-2dvay0es.js} +3 -3
  75. package/dist/{db-c6np41ca.js → db-b36qn6k3.js} +2 -2
  76. package/dist/{dispatcher-jnybck15.js → dispatcher-gndbta01.js} +17 -17
  77. package/dist/{dsh-adapter-nrhbrjz8.js → dsh-adapter-f75sz821.js} +1 -1
  78. package/dist/{e2b-jkwfhbcv.js → e2b-3gpc2n3w.js} +1 -1
  79. package/dist/{e2b-s16txnpx.js → e2b-jbm7mj93.js} +1 -1
  80. package/dist/{embedding-space-crsm2zp0.js → embedding-space-4p05vb2x.js} +6 -6
  81. package/dist/{embeddings-e7z3f27f.js → embeddings-m6768mgh.js} +1 -1
  82. package/dist/{external-channel-m77wf5z3.js → external-channel-gjv3jne3.js} +2 -2
  83. package/dist/{fx-adapter-b6w0kf56.js → fx-adapter-rpsgb1tw.js} +4 -4
  84. package/dist/{grok-adapter-4sqtebdk.js → grok-adapter-n2m3zjg1.js} +4 -4
  85. package/dist/handlers-nv8edn19.js +32 -0
  86. package/dist/{heartbeat-xgb036sx.js → heartbeat-a1tv60gt.js} +20 -20
  87. package/dist/{hook-xsk1jbha.js → hook-8h5dzcgq.js} +2 -2
  88. package/dist/{hook-5h02c9ga.js → hook-cyaps9ba.js} +4 -4
  89. package/dist/{http-txe7qhvn.js → http-t15mhbd9.js} +1733 -79
  90. package/dist/{index-0eny15vj.js → index-2skqtd76.js} +2 -2
  91. package/dist/{index-w7em4ktq.js → index-d6wkh8ar.js} +2 -2
  92. package/dist/{index-rvccek1w.js → index-gjwaqaq8.js} +5 -5
  93. package/dist/{index-e5pfbsys.js → index-hjhfk3ra.js} +3 -3
  94. package/dist/{index-1qw6f2dc.js → index-khe3gp0k.js} +4 -4
  95. package/dist/index-ksmyd6kc.js +37 -0
  96. package/dist/{index-vk63emp7.js → index-qav6455f.js} +14 -12
  97. package/dist/index-rjnrje98.js +32 -0
  98. package/dist/index-tv3413wy.js +33 -0
  99. package/dist/{index-ysvbhg5m.js → index-w1zqf680.js} +1 -1
  100. package/dist/{keepalive-4zsrce78.js → keepalive-91s7hzrb.js} +3 -3
  101. package/dist/lead-3hmddvrm.js +70 -0
  102. package/dist/{maintenance-86jvartk.js → maintenance-7pjmy5xy.js} +1 -1
  103. package/dist/{node-je82wjet.js → node-4c5jqxr3.js} +1 -1
  104. package/dist/{oauth-refresh-sweep-j52kg9pr.js → oauth-refresh-sweep-rzqfm94j.js} +2 -2
  105. package/dist/{onboard-c2aj5p8q.js → onboard-74st7pag.js} +3 -3
  106. package/dist/{opencode-adapter-dsagkhtw.js → opencode-adapter-arn7gm8q.js} +2 -2
  107. package/dist/{otel-impl-yyy203z8.js → otel-impl-rnzey8cb.js} +1 -1
  108. package/dist/{pi-mono-adapter-546cd1cc.js → pi-mono-adapter-6mkwq64n.js} +3 -2
  109. package/dist/{pricing-refresh-1rgzqyzz.js → pricing-refresh-ha21jhk7.js} +2 -2
  110. package/dist/{rbac-roles-e70xfeyj.js → rbac-roles-59dxachk.js} +2 -2
  111. package/dist/{rbac-roles-q89qe8er.js → rbac-roles-wqhma4dr.js} +3 -3
  112. package/dist/{render-v2-k6tt107q.js → render-v2-14kpzx12.js} +3 -3
  113. package/dist/{resume-cnnrjfxa.js → resume-gsa5fb5f.js} +6 -6
  114. package/dist/{session-access-xkxkjw3n.js → session-access-skm7bnp6.js} +4 -4
  115. package/dist/{session-source-backfill-1d5pdwww.js → session-source-backfill-pbqzbncv.js} +2 -2
  116. package/dist/{setup-se8q7gkc.js → setup-5yermsem.js} +1 -1
  117. package/dist/{work-objects-1kxnbzy5.js → work-objects-xj0ck0w4.js} +20 -20
  118. package/dist/{worker-follow-up-zqm8apt4.js → worker-follow-up-911xc0b8.js} +19 -17
  119. package/dist/worker-qgg0m2gw.js +70 -0
  120. package/openapi.json +1741 -290
  121. package/package.json +3 -3
  122. package/src/apps/catalog.generated.json +120 -1
  123. package/src/apps/definition.ts +38 -11
  124. package/src/apps/page-validator.ts +88 -0
  125. package/src/be/db/model-profiles.ts +110 -11
  126. package/src/be/db/tasks/read.ts +20 -0
  127. package/src/be/db/workflow-run-definitions.ts +19 -8
  128. package/src/be/db-client.ts +43 -5
  129. package/src/be/db.ts +9 -3
  130. package/src/be/migrations/284_model_profile_fallbacks.sql +9 -0
  131. package/src/be/model-profile-check.ts +43 -18
  132. package/src/be/runtime-pools/routing.ts +1 -0
  133. package/src/be/savings/calibrate.ts +468 -0
  134. package/src/be/savings/compute.ts +182 -0
  135. package/src/be/savings/model.ts +406 -0
  136. package/src/be/scripts/typecheck.ts +5 -0
  137. package/src/be/seed/agent-fs-provision.ts +48 -11
  138. package/src/be/seed/workflows-seeder.ts +67 -23
  139. package/src/be/skill-parser.ts +19 -7
  140. package/src/commands/onboard/agent-fs-version.ts +1 -1
  141. package/src/commands/provider-error-class.ts +97 -0
  142. package/src/commands/runner.ts +99 -17
  143. package/src/extensions/contract-types.generated.ts +1 -1
  144. package/src/http/all-routes.ts +2 -0
  145. package/src/http/fs.ts +8 -2
  146. package/src/http/index.ts +4 -0
  147. package/src/http/model-profiles.ts +43 -10
  148. package/src/http/poll.ts +1 -0
  149. package/src/http/savings-calibration.ts +277 -0
  150. package/src/http/savings.ts +363 -0
  151. package/src/http/tasks.ts +46 -4
  152. package/src/http/trackers/authorize-gate.ts +41 -0
  153. package/src/http/trackers/jira.ts +26 -4
  154. package/src/http/trackers/linear.ts +26 -4
  155. package/src/integrations/chat-sdk/limits.ts +6 -1
  156. package/src/jira/oauth.ts +7 -1
  157. package/src/linear/README.md +2 -1
  158. package/src/linear/oauth.ts +7 -1
  159. package/src/providers/amp-adapter.ts +1 -1
  160. package/src/providers/codex-adapter.ts +3 -0
  161. package/src/providers/pi-mono-adapter.ts +6 -5
  162. package/src/providers/types.ts +7 -0
  163. package/src/scripts-runtime/eval-harness.ts +14 -1
  164. package/src/scripts-runtime/executors/types.ts +3 -0
  165. package/src/scripts-runtime/sdk-allowlist.ts +11 -1
  166. package/src/scripts-runtime/swarm-sdk.ts +6 -0
  167. package/src/scripts-runtime/types/stdlib.d.ts +9 -0
  168. package/src/scripts-runtime/types/swarm-extension.d.ts +34 -0
  169. package/src/scripts-runtime/types/swarm-sdk.d.ts +9 -0
  170. package/src/tasks/worker-follow-up.ts +142 -3
  171. package/src/tests/agent-fs-provision-seeder.test.ts +81 -0
  172. package/src/tests/apps-chart-shell.test.ts +170 -0
  173. package/src/tests/apps-icon.test.ts +156 -2
  174. package/src/tests/chat-sdk-relay.test.ts +12 -0
  175. package/src/tests/codex-adapter.test.ts +11 -0
  176. package/src/tests/comb-default.test.ts +6 -0
  177. package/src/tests/core-auth.test.ts +7 -6
  178. package/src/tests/db-client-busy-retry.test.ts +58 -6
  179. package/src/tests/deploy-guard.test.ts +154 -0
  180. package/src/tests/docs-index-footprint.test.js +3 -3
  181. package/src/tests/fixtures/app-shell-charts-definition.json.txt +180 -0
  182. package/src/tests/mcp-tools.test.ts +1 -1
  183. package/src/tests/model-profile-fallbacks.test.ts +482 -0
  184. package/src/tests/model-profiles-api.test.ts +1 -0
  185. package/src/tests/pi-mono-session-cost-on-abort.test.ts +115 -0
  186. package/src/tests/provider-error-class.test.ts +174 -0
  187. package/src/tests/runner-provider-fallback.test.ts +197 -0
  188. package/src/tests/savings-calibration-api.test.ts +264 -0
  189. package/src/tests/savings-calibration.test.ts +201 -0
  190. package/src/tests/savings-compute.test.ts +406 -0
  191. package/src/tests/savings-model.test.ts +287 -0
  192. package/src/tests/script-connections.test.ts +2 -0
  193. package/src/tests/script-native-unawaited-drain.test.ts +167 -0
  194. package/src/tests/sdk-allowlist.test.ts +40 -0
  195. package/src/tests/seed-workflows.test.ts +167 -11
  196. package/src/tests/skill-parser.test.ts +45 -0
  197. package/src/tests/tracker-oauth-authorize-auth.test.ts +262 -0
  198. package/src/tests/workflow-definition-pinning.test.ts +128 -3
  199. package/src/tests/workflow-script-principal.test.ts +94 -4
  200. package/src/tools/app-upsert.ts +1 -1
  201. package/src/tools/model-profiles/list-model-profiles.ts +4 -2
  202. package/src/tools/script-run.ts +1 -1
  203. package/src/tools/update-profile.ts +1 -1
  204. package/src/types.ts +115 -33
  205. package/src/utils/constants.ts +2 -0
  206. package/templates/skills/apps/SKILL.md +62 -3
  207. package/templates/skills/apps/content.md +62 -3
  208. package/templates/skills/swarm-docs/content.md +2 -0
  209. package/templates/skills/swarm-scripts/SKILL.md +1 -1
  210. package/templates/skills/swarm-scripts/content.md +1 -1
  211. package/dist/handlers-kdjcyzdj.js +0 -32
  212. package/dist/index-835xdgnm.js +0 -33
  213. package/dist/index-d469300x.js +0 -37
  214. package/dist/index-rzqwp11g.js +0 -32
  215. package/dist/lead-yqt47dkr.js +0 -70
  216. package/dist/worker-j6xxtq7p.js +0 -70
@@ -0,0 +1,154 @@
1
+ /**
2
+ * Regression test for scripts/deploy-guard.sh, the "guard" step of
3
+ * .github/workflows/docker-and-deploy.yml.
4
+ *
5
+ * The guard used to skip deploy whenever main had moved past the running
6
+ * commit. A newer docs-only commit starts no docker-and-deploy run, so that
7
+ * stranded prod on an older deploy. Now the guard skips only when the newer
8
+ * commits touch on.push.paths, read from the real workflow file.
9
+ *
10
+ * Each case builds a bare "origin", a shallow runner clone (like
11
+ * actions/checkout), then pushes newer main commits from a second clone and
12
+ * runs the guard in the runner clone.
13
+ */
14
+ import { afterAll, describe, expect, test } from "bun:test";
15
+ import { copyFileSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
16
+ import { tmpdir } from "node:os";
17
+ import { dirname, join, resolve } from "node:path";
18
+ import { CHILD_PROCESS_TEST_BUDGET_MS, expectChildOk, runChild } from "./test-proc";
19
+
20
+ const REPO_ROOT = resolve(import.meta.dir, "../..");
21
+ const GUARD_SCRIPT = join(REPO_ROOT, "scripts/deploy-guard.sh");
22
+ const WORKFLOW = ".github/workflows/docker-and-deploy.yml";
23
+
24
+ // GitHub runners ship yq. Locally, skip without it; in CI a missing yq must fail.
25
+ const hasYq = Bun.which("yq") !== null;
26
+
27
+ const tmpRoots: string[] = [];
28
+ afterAll(() => {
29
+ for (const dir of tmpRoots) rmSync(dir, { recursive: true, force: true });
30
+ });
31
+
32
+ const gitEnv: Record<string, string | undefined> = {
33
+ PATH: process.env.PATH,
34
+ HOME: process.env.HOME,
35
+ GIT_CONFIG_GLOBAL: "/dev/null",
36
+ GIT_CONFIG_NOSYSTEM: "1",
37
+ GIT_AUTHOR_NAME: "test",
38
+ GIT_AUTHOR_EMAIL: "test@example.com",
39
+ GIT_COMMITTER_NAME: "test",
40
+ GIT_COMMITTER_EMAIL: "test@example.com",
41
+ };
42
+
43
+ async function git(cwd: string, ...args: string[]): Promise<string> {
44
+ const r = expectChildOk(
45
+ await runChild(["git", ...args], { cwd, env: gitEnv }),
46
+ `git ${args.join(" ")}`,
47
+ );
48
+ return r.stdout.trim();
49
+ }
50
+
51
+ function write(dir: string, path: string, content: string): void {
52
+ mkdirSync(dirname(join(dir, path)), { recursive: true });
53
+ writeFileSync(join(dir, path), content);
54
+ }
55
+
56
+ /** Origin with one main commit, a shallow runner checkout of it, and a pusher clone. */
57
+ async function setup() {
58
+ const root = mkdtempSync(join(tmpdir(), "deploy-guard-"));
59
+ tmpRoots.push(root);
60
+ const origin = join(root, "origin.git");
61
+ const pusher = join(root, "pusher");
62
+ const runner = join(root, "runner");
63
+
64
+ await git(root, "init", "--bare", "-q", "-b", "main", origin);
65
+ await git(root, "clone", "-q", origin, pusher);
66
+ await git(pusher, "checkout", "-q", "-B", "main");
67
+ mkdirSync(join(pusher, ".github/workflows"), { recursive: true });
68
+ copyFileSync(join(REPO_ROOT, WORKFLOW), join(pusher, WORKFLOW));
69
+ write(pusher, "src/index.ts", "export {};\n");
70
+ write(pusher, "README.md", "# repo\n");
71
+ await git(pusher, "add", "-A");
72
+ await git(pusher, "commit", "-q", "-m", "initial");
73
+ await git(pusher, "push", "-q", "origin", "main");
74
+
75
+ await git(root, "clone", "-q", "--depth", "1", `file://${origin}`, runner);
76
+ const runningSha = await git(runner, "rev-parse", "HEAD");
77
+
78
+ const pushCommit = async (path: string, content: string) => {
79
+ write(pusher, path, content);
80
+ await git(pusher, "add", "-A");
81
+ await git(pusher, "commit", "-q", "-m", `change ${path}`);
82
+ await git(pusher, "push", "-q", "origin", "main");
83
+ };
84
+
85
+ const runGuard = async () => {
86
+ const outFile = join(root, `github-output-${Date.now()}`);
87
+ writeFileSync(outFile, "");
88
+ const r = await runChild(["bash", GUARD_SCRIPT], {
89
+ cwd: runner,
90
+ env: { ...gitEnv, GITHUB_SHA: runningSha, GITHUB_OUTPUT: outFile },
91
+ });
92
+ expectChildOk(r, "deploy-guard.sh");
93
+ const match = readFileSync(outFile, "utf8").match(/^is_tip=(true|false)$/m);
94
+ return { isTip: match?.[1], log: r.stdout };
95
+ };
96
+
97
+ return { pushCommit, runGuard };
98
+ }
99
+
100
+ describe.skipIf(!hasYq && !process.env.CI)("deploy guard (scripts/deploy-guard.sh)", () => {
101
+ test(
102
+ "deploys when the running commit is still main tip",
103
+ async () => {
104
+ const { runGuard } = await setup();
105
+ expect((await runGuard()).isTip).toBe("true");
106
+ },
107
+ CHILD_PROCESS_TEST_BUDGET_MS,
108
+ );
109
+
110
+ test(
111
+ "deploys when newer main commits are docs-only",
112
+ async () => {
113
+ const { pushCommit, runGuard } = await setup();
114
+ await pushCommit("README.md", "# repo\n\nmore docs\n");
115
+ await pushCommit("docs-site/content/docs/page.mdx", "docs\n");
116
+ const result = await runGuard();
117
+ expect(result.isTip).toBe("true");
118
+ },
119
+ CHILD_PROCESS_TEST_BUDGET_MS,
120
+ );
121
+
122
+ test(
123
+ "skips when a newer main commit changes src",
124
+ async () => {
125
+ const { pushCommit, runGuard } = await setup();
126
+ await pushCommit("src/index.ts", "export const x = 1;\n");
127
+ const result = await runGuard();
128
+ expect(result.isTip).toBe("false");
129
+ expect(result.log).toContain("src/index.ts");
130
+ },
131
+ CHILD_PROCESS_TEST_BUDGET_MS,
132
+ );
133
+
134
+ test(
135
+ "skips when a src change is followed by a docs-only tip",
136
+ async () => {
137
+ const { pushCommit, runGuard } = await setup();
138
+ await pushCommit("src/index.ts", "export const x = 1;\n");
139
+ await pushCommit("README.md", "# repo\n\nmore docs\n");
140
+ expect((await runGuard()).isTip).toBe("false");
141
+ },
142
+ CHILD_PROCESS_TEST_BUDGET_MS,
143
+ );
144
+
145
+ test(
146
+ "skips on a nested file under a ** trigger path (apps/ui/**)",
147
+ async () => {
148
+ const { pushCommit, runGuard } = await setup();
149
+ await pushCommit("apps/ui/src/components/deep/thing.tsx", "export {};\n");
150
+ expect((await runGuard()).isTip).toBe("false");
151
+ },
152
+ CHILD_PROCESS_TEST_BUDGET_MS,
153
+ );
154
+ });
@@ -78,7 +78,7 @@ describe("docs API index footprint", () => {
78
78
  expect(tasks).toContain('"path":"/api/task-templates","method":"get"');
79
79
  });
80
80
 
81
- test("OpenAPI and generated pages keep all 472 operations", async () => {
81
+ test("OpenAPI and generated pages keep all 476 operations", async () => {
82
82
  const spec = await Bun.file(resolve(repoRoot, "openapi.json")).json();
83
83
  const operationKeys = [];
84
84
  const tags = new Set();
@@ -103,8 +103,8 @@ describe("docs API index footprint", () => {
103
103
  expect(spec.paths["/api/agents/{id}/runtime"]?.get).toBeDefined();
104
104
 
105
105
  const generatedKeys = await generatedOperationKeys();
106
- expect(operationKeys).toHaveLength(472);
107
- expect(generatedKeys).toHaveLength(472);
106
+ expect(operationKeys).toHaveLength(476);
107
+ expect(generatedKeys).toHaveLength(476);
108
108
  expect(new Set(generatedKeys)).toEqual(new Set(operationKeys));
109
109
  });
110
110
 
@@ -0,0 +1,180 @@
1
+ {
2
+ "layout": "sidebar",
3
+ "models": {
4
+ "day": {
5
+ "columns": {
6
+ "date": { "kind": "date", "required": true },
7
+ "deploys": { "kind": "number" },
8
+ "failures": { "kind": "number" },
9
+ "spend": { "kind": "number" },
10
+ "passRate": { "kind": "number" }
11
+ }
12
+ },
13
+ "service": {
14
+ "columns": {
15
+ "name": { "kind": "string", "required": true },
16
+ "owner": { "kind": "string" },
17
+ "spend": { "kind": "number" }
18
+ }
19
+ }
20
+ },
21
+ "queries": {
22
+ "days": { "model": "day", "sort": { "column": "date", "dir": "asc" } },
23
+ "services": { "model": "service" },
24
+ "serviceById": { "model": "service", "filter": { "id": { "$param": "service" } } }
25
+ },
26
+ "defaultPage": "overview",
27
+ "pages": {
28
+ "overview": {
29
+ "title": "Overview",
30
+ "icon": "activity",
31
+ "description": "Deploys, failures and spend over the last two weeks.",
32
+ "headerActions": "headerRefresh",
33
+ "root": "root",
34
+ "elements": {
35
+ "root": { "type": "Stack", "props": { "gap": "lg" }, "children": ["tiles", "charts"] },
36
+ "tiles": {
37
+ "type": "Grid",
38
+ "props": { "columns": 3 },
39
+ "children": ["deploysTile", "failuresTile", "spendTile"]
40
+ },
41
+ "deploysTile": {
42
+ "type": "Metric",
43
+ "props": {
44
+ "label": "Deploys today",
45
+ "value": 14,
46
+ "icon": "rocket",
47
+ "tone": "success",
48
+ "trend": { "direction": "up", "label": "+3 vs yesterday" },
49
+ "sparkline": { "$state": "/queries/days/data" },
50
+ "sparklineKey": "deploys"
51
+ }
52
+ },
53
+ "failuresTile": {
54
+ "type": "Metric",
55
+ "props": {
56
+ "label": "Failed runs",
57
+ "value": 2,
58
+ "icon": "alert-triangle",
59
+ "tone": "error",
60
+ "sparkline": [5, 4, 6, 3, 4, 2, null, 3, 2, 2]
61
+ }
62
+ },
63
+ "spendTile": {
64
+ "type": "Metric",
65
+ "props": {
66
+ "label": "Spend today",
67
+ "value": "$182",
68
+ "icon": "dollar-sign",
69
+ "tone": "info",
70
+ "sparkline": { "$state": "/queries/days/data" },
71
+ "sparklineKey": "spend"
72
+ }
73
+ },
74
+ "charts": { "type": "Grid", "props": { "columns": 2 }, "children": ["deploysCard", "passCard"] },
75
+ "deploysCard": {
76
+ "type": "Card",
77
+ "props": { "title": "Deploys and failures", "description": "Stacked, per day" },
78
+ "children": ["deploysChart"]
79
+ },
80
+ "deploysChart": {
81
+ "type": "Chart",
82
+ "props": {
83
+ "kind": "bar",
84
+ "data": { "$state": "/queries/days/data" },
85
+ "loading": { "$state": "/queries/days/loading" },
86
+ "error": { "$state": "/queries/days/error" },
87
+ "x": "date",
88
+ "xType": "time",
89
+ "stacked": true,
90
+ "series": [
91
+ { "key": "deploys", "label": "Deploys" },
92
+ { "key": "failures", "label": "Failures", "color": "error" }
93
+ ]
94
+ }
95
+ },
96
+ "passCard": {
97
+ "type": "Card",
98
+ "props": { "title": "Pass rate" },
99
+ "children": ["passChart"]
100
+ },
101
+ "passChart": {
102
+ "type": "Chart",
103
+ "props": {
104
+ "kind": "area",
105
+ "data": { "$state": "/queries/days/data" },
106
+ "loading": { "$state": "/queries/days/loading" },
107
+ "x": "date",
108
+ "xType": "time",
109
+ "format": "percent",
110
+ "series": [{ "key": "passRate", "label": "Pass rate", "color": "success" }]
111
+ }
112
+ },
113
+ "headerRefresh": {
114
+ "type": "Button",
115
+ "props": { "label": "Refresh", "icon": "refresh-cw", "variant": "outline", "size": "sm" },
116
+ "on": { "press": [{ "action": "app.refresh" }] }
117
+ }
118
+ }
119
+ },
120
+ "spend": {
121
+ "title": "Spend",
122
+ "icon": "dollar-sign",
123
+ "description": "Daily spend and the services behind it.",
124
+ "root": "root",
125
+ "elements": {
126
+ "root": { "type": "Stack", "props": { "gap": "lg" }, "children": ["spendCard", "table"] },
127
+ "spendCard": { "type": "Card", "props": { "title": "Daily spend" }, "children": ["spendChart"] },
128
+ "spendChart": {
129
+ "type": "Chart",
130
+ "props": {
131
+ "kind": "line",
132
+ "data": { "$state": "/queries/days/data" },
133
+ "loading": { "$state": "/queries/days/loading" },
134
+ "x": "date",
135
+ "xType": "time",
136
+ "format": "currency",
137
+ "currency": "USD",
138
+ "height": 280,
139
+ "series": [{ "key": "spend", "label": "Spend" }]
140
+ }
141
+ },
142
+ "table": {
143
+ "type": "Table",
144
+ "props": {
145
+ "data": { "$state": "/queries/services/data" },
146
+ "loading": { "$state": "/queries/services/loading" },
147
+ "columns": [
148
+ { "key": "name", "label": "Service" },
149
+ { "key": "owner", "label": "Owner" },
150
+ { "key": "spend", "label": "Spend", "kind": "number" }
151
+ ],
152
+ "onRowClick": [
153
+ { "action": "app.navigate", "params": { "page": "service", "params": { "service": { "$row": "id" } } } }
154
+ ]
155
+ }
156
+ }
157
+ }
158
+ },
159
+ "service": {
160
+ "title": "Service",
161
+ "params": { "service": { "kind": "string", "required": true } },
162
+ "root": "detail",
163
+ "elements": {
164
+ "detail": {
165
+ "type": "DetailList",
166
+ "props": {
167
+ "data": { "$state": "/queries/serviceById/data/0" },
168
+ "fields": [{ "key": "name" }, { "key": "owner" }, { "key": "spend", "kind": "number" }]
169
+ }
170
+ }
171
+ }
172
+ },
173
+ "settings": {
174
+ "title": "Settings",
175
+ "nav": false,
176
+ "root": "text",
177
+ "elements": { "text": { "type": "Text", "props": { "content": "Nothing to configure yet." } } }
178
+ }
179
+ }
180
+ }
@@ -48,7 +48,7 @@ describe("script MCP tools", () => {
48
48
  "script-search":
49
49
  "Semantic search over swarm-shared TypeScript scripts (catalog persisted in the agent-swarm DB; callable from agents and workflows). For ephemeral throwaway TS on your local machine, use code-mode instead.",
50
50
  "script-run":
51
- "Run a named swarm-shared script (callable across agents and from workflow `swarm-script` nodes), OR inline source (auto-saved as scratch to the catalog). Inline source executes without the `script-upsert` compile-time typecheck. Use for swarm-visible, durable scripts. For local-only throwaway TS, use code-mode `run`.",
51
+ "Run a named swarm-shared script (callable across agents and from workflow `swarm-script` nodes), OR inline source (auto-saved as scratch to the catalog). Inline source executes without the `script-upsert` compile-time typecheck. Use for swarm-visible, durable scripts. For local-only throwaway TS, use code-mode `run`. The run ends when the script's default export resolves: a call it did not await gets 2 s more, then is stopped (native) or aborted at once (quickjs), so await every write that must land. A `Promise.race` deadline therefore bounds the run; a nested `script_run` that lost the race keeps running on the server under its own wall.",
52
52
  "script-upsert":
53
53
  'Typecheck and persist a TypeScript script to the swarm catalog under your agent scope (or global if you\'re a lead). Import `ScriptContext` from "swarm-sdk" for a real context type. Other agents and workflow nodes will be able to find and run it. For local-only scripts, use code-mode `save`.',
54
54
  "script-delete":