@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
@@ -46,7 +46,7 @@ import {
46
46
  getWorkflowVersions2,
47
47
  getMcpServerById2,
48
48
  init_db4
49
- } from "./cli-h38x262p.js";
49
+ } from "./cli-rcecc3yq.js";
50
50
  import {
51
51
  McpHttpClient,
52
52
  init_http_client
@@ -61,11 +61,11 @@ import {
61
61
  oauthAppRowToProviderConfig,
62
62
  ensureAuthorizationTokenOrThrow,
63
63
  init_ensure_token
64
- } from "./cli-sdtt3men.js";
64
+ } from "./cli-rmzsadkf.js";
65
65
  import {
66
66
  validateDefinition,
67
67
  init_definition2
68
- } from "./cli-qfedvmcr.js";
68
+ } from "./cli-jdknh18m.js";
69
69
  import {
70
70
  isInvalidClientError,
71
71
  publicEndpointSsrfOptions,
@@ -73,18 +73,18 @@ import {
73
73
  refreshMcpToken,
74
74
  computeExpiresAt,
75
75
  init_mcp_wrapper
76
- } from "./cli-s7t6p9my.js";
76
+ } from "./cli-n6vtrcht.js";
77
77
  import {
78
78
  mintScriptRunToken,
79
79
  revokeSessionToken,
80
80
  init_users
81
- } from "./cli-gxkx0zzp.js";
81
+ } from "./cli-f4e8r23x.js";
82
82
  import {
83
83
  defaultAssetKey,
84
84
  init_key,
85
85
  AppIconSchema,
86
86
  init_types4
87
- } from "./cli-2zp0et3v.js";
87
+ } from "./cli-pchypa1s.js";
88
88
  import {
89
89
  init_zod
90
90
  } from "./cli-zcfpsfzf.js";
@@ -105,7 +105,7 @@ import {
105
105
  import {
106
106
  getMcpBaseUrl,
107
107
  init_constants3
108
- } from "./cli-k0wwfqbg.js";
108
+ } from "./cli-dns0y538.js";
109
109
  import {
110
110
  isEnvFlagEnabled,
111
111
  init_env_flag
@@ -178858,9 +178858,6 @@ function parseWorkflowSource(source) {
178858
178858
  function loadSeedWorkflows(sources = BUILT_IN_WORKFLOW_SOURCES) {
178859
178859
  return sources.map(parseWorkflowSource).filter((workflow) => workflow !== null).sort((left, right) => left.name.localeCompare(right.name));
178860
178860
  }
178861
- function workflowSeedHash(workflow) {
178862
- return computeContentHash2(canonicalJson(workflow));
178863
- }
178864
178861
  async function findWorkflowByName(name) {
178865
178862
  return (await listWorkflows2()).find((workflow) => workflow.name === name) ?? null;
178866
178863
  }
@@ -178905,20 +178902,31 @@ function executableSurface(workflow) {
178905
178902
  } = workflow;
178906
178903
  return canonicalJson(surface);
178907
178904
  }
178908
- async function seededWorkflowState(workflow) {
178909
- const state = await getSeedState("workflow", workflow.name);
178910
- if (!state)
178911
- return "unseeded";
178905
+ function workflowSeedHash(workflow) {
178906
+ return computeContentHash2(executableSurface(workflow));
178907
+ }
178908
+ function legacyWorkflowSeedHash(workflow) {
178909
+ return computeContentHash2(canonicalJson(workflow));
178910
+ }
178911
+ async function executesSeededSurface(workflow, seededHash) {
178912
178912
  const live = workflowFromRow(workflow);
178913
- if (workflowSeedHash(live) === state.seededHash)
178914
- return "pristine";
178913
+ if (workflowSeedHash(live) === seededHash)
178914
+ return true;
178915
+ if (legacyWorkflowSeedHash(live) === seededHash)
178916
+ return true;
178915
178917
  for (const version of await getWorkflowVersions2(workflow.id)) {
178916
178918
  const seeded = workflowFromSnapshot(version.snapshot);
178917
- if (workflowSeedHash(seeded) !== state.seededHash)
178919
+ if (legacyWorkflowSeedHash(seeded) !== seededHash)
178918
178920
  continue;
178919
- return executableSurface(seeded) === executableSurface(live) ? "pristine" : "edited";
178921
+ return executableSurface(seeded) === executableSurface(live);
178920
178922
  }
178921
- return "edited";
178923
+ return false;
178924
+ }
178925
+ async function seededWorkflowState(workflow) {
178926
+ const state = await getSeedState("workflow", workflow.name);
178927
+ if (!state)
178928
+ return "unseeded";
178929
+ return await executesSeededSurface(workflow, state.seededHash) ? "pristine" : "edited";
178922
178930
  }
178923
178931
  function createWorkflowsSeeder(sources = BUILT_IN_WORKFLOW_SOURCES) {
178924
178932
  const workflows = loadSeedWorkflows(sources);
@@ -178933,7 +178941,16 @@ function createWorkflowsSeeder(sources = BUILT_IN_WORKFLOW_SOURCES) {
178933
178941
  },
178934
178942
  async upstreamHash(item) {
178935
178943
  const existing = await findWorkflowByName(item.key);
178936
- return existing ? workflowSeedHash(workflowFromRow(existing)) : null;
178944
+ if (!existing)
178945
+ return null;
178946
+ const liveHash = workflowSeedHash(workflowFromRow(existing));
178947
+ if (liveHash === item.contentHash)
178948
+ return liveHash;
178949
+ const state = await getSeedState("workflow", item.key);
178950
+ if (state && await executesSeededSurface(existing, state.seededHash)) {
178951
+ return state.seededHash;
178952
+ }
178953
+ return liveHash;
178937
178954
  },
178938
178955
  async apply(item) {
178939
178956
  const { workflow } = item;
@@ -178941,12 +178958,8 @@ function createWorkflowsSeeder(sources = BUILT_IN_WORKFLOW_SOURCES) {
178941
178958
  if (!validation.valid) {
178942
178959
  throw new Error(`Invalid workflow definition: ${validation.errors.join("; ")}`);
178943
178960
  }
178944
- const data = {
178945
- description: workflow.description,
178961
+ const executable = {
178946
178962
  definition: workflow.definition,
178947
- triggers: workflow.triggers,
178948
- cooldown: workflow.cooldown,
178949
- input: workflow.input,
178950
178963
  triggerSchema: workflow.triggerSchema,
178951
178964
  params: workflow.params,
178952
178965
  requiredParams: workflow.requiredParams,
@@ -178954,12 +178967,20 @@ function createWorkflowsSeeder(sources = BUILT_IN_WORKFLOW_SOURCES) {
178954
178967
  };
178955
178968
  const existing = await findWorkflowByName(workflow.name);
178956
178969
  if (!existing) {
178957
- const created = await createWorkflow2({ name: workflow.name, ...data });
178970
+ const created = await createWorkflow2({
178971
+ name: workflow.name,
178972
+ ...executable,
178973
+ description: workflow.description,
178974
+ triggers: workflow.triggers,
178975
+ cooldown: workflow.cooldown,
178976
+ input: workflow.input
178977
+ });
178958
178978
  if (!workflow.enabled)
178959
178979
  await updateWorkflow2(created.id, { enabled: false });
178960
178980
  return;
178961
178981
  }
178962
- await updateWorkflow2(existing.id, { ...data, enabled: workflow.enabled });
178982
+ const input = workflow.input || existing.input ? { ...workflow.input, ...existing.input } : undefined;
178983
+ await updateWorkflow2(existing.id, { ...executable, input });
178963
178984
  }
178964
178985
  };
178965
178986
  }
@@ -179487,6 +179508,7 @@ var init_catalog_generated = __esm(() => {
179487
179508
  "NumberInput",
179488
179509
  "Button",
179489
179510
  "Metric",
179511
+ "Chart",
179490
179512
  "Alert",
179491
179513
  "Badge",
179492
179514
  "Icon",
@@ -180094,7 +180116,7 @@ var init_catalog_generated = __esm(() => {
180094
180116
  }
180095
180117
  },
180096
180118
  Metric: {
180097
- description: 'Stat tile (the dashboard `StatPanel`): label, value, optional `detail` line and `trend: { direction: "up"|"down"|"flat", label }` (arrow plus success/error/muted text). `icon` adds a tile tinted by `tone` (neutral|success|active|error|info|pending|warning|paused); `info` is a one-sentence explanation in a tooltip next to the label. Bind `loading` to the backing query (`{ "$state": "/queries/<name>/loading" }`) to show a skeleton instead of a blank value while it loads; an empty value renders an em dash.',
180119
+ description: 'Stat tile (the dashboard `StatPanel`): label, value, optional `detail` line and `trend: { direction: "up"|"down"|"flat", label }` (arrow plus success/error/muted text). `icon` adds a tile tinted by `tone` (neutral|success|active|error|info|pending|warning|paused); `info` is a one-sentence explanation in a tooltip next to the label. Bind `loading` to the backing query (`{ "$state": "/queries/<name>/loading" }`) to show a skeleton instead of a blank value while it loads; an empty value renders an em dash. `sparkline` draws a small trend line under the value, in the `tone` color: an array of numbers (`null` is a gap), or rows (bind `{ "$state": "/queries/<name>/data" }`) read through `sparklineKey`. Fewer than two points draws nothing.',
180098
180120
  props: {
180099
180121
  $schema: "http://json-schema.org/draft-07/schema#",
180100
180122
  type: "object",
@@ -180185,12 +180207,130 @@ var init_catalog_generated = __esm(() => {
180185
180207
  },
180186
180208
  required: ["direction", "label"],
180187
180209
  additionalProperties: false
180210
+ },
180211
+ sparkline: {
180212
+ maxItems: 500,
180213
+ type: "array",
180214
+ items: {
180215
+ anyOf: [
180216
+ {
180217
+ type: "number"
180218
+ },
180219
+ {
180220
+ type: "null"
180221
+ },
180222
+ {
180223
+ type: "object",
180224
+ propertyNames: {
180225
+ type: "string"
180226
+ },
180227
+ additionalProperties: {}
180228
+ }
180229
+ ]
180230
+ }
180231
+ },
180232
+ sparklineKey: {
180233
+ type: "string"
180188
180234
  }
180189
180235
  },
180190
180236
  required: ["label", "value"],
180191
180237
  additionalProperties: false
180192
180238
  }
180193
180239
  },
180240
+ Chart: {
180241
+ description: 'Line, area or bar chart over rows. Bind `data`/`loading`/`error` to a named query like Table. `x` is the row field on the x axis: `xType: "category"` (default) keeps row order, `"time"` parses ISO dates or epoch ms, sorts the rows and labels ticks as dates (rows whose `x` does not parse are dropped). `series: [{ key, label?, color? }]` (1-8) plots numeric row fields; `color` is chart-1..chart-5, primary, success, warning, error, info or muted (default palette, in order: primary, chart-2..chart-5). `stacked` stacks area and bar series (lines never stack). `format` number (default) | currency (`currency`, ISO code, default USD) | percent (values are ratios, 0.42 = 42%) shapes axis ticks and the tooltip. Hover shows a tooltip with every series; the legend shows with two or more series (`legend` forces it on or off). `height` px (120-640, default 240). No rows renders `emptyMessage` (default "No data yet"). Wrap it in a `Card` for a title.',
180242
+ props: {
180243
+ $schema: "http://json-schema.org/draft-07/schema#",
180244
+ type: "object",
180245
+ properties: {
180246
+ kind: {
180247
+ type: "string",
180248
+ enum: ["line", "area", "bar"]
180249
+ },
180250
+ data: {
180251
+ type: "array",
180252
+ items: {
180253
+ type: "object",
180254
+ propertyNames: {
180255
+ type: "string"
180256
+ },
180257
+ additionalProperties: {}
180258
+ }
180259
+ },
180260
+ loading: {
180261
+ type: "boolean"
180262
+ },
180263
+ error: {
180264
+ type: ["string", "null"]
180265
+ },
180266
+ x: {
180267
+ type: "string"
180268
+ },
180269
+ xType: {
180270
+ type: "string",
180271
+ enum: ["category", "time"]
180272
+ },
180273
+ series: {
180274
+ minItems: 1,
180275
+ maxItems: 8,
180276
+ type: "array",
180277
+ items: {
180278
+ type: "object",
180279
+ properties: {
180280
+ key: {
180281
+ type: "string"
180282
+ },
180283
+ label: {
180284
+ type: "string"
180285
+ },
180286
+ color: {
180287
+ type: "string",
180288
+ enum: [
180289
+ "chart-1",
180290
+ "chart-2",
180291
+ "chart-3",
180292
+ "chart-4",
180293
+ "chart-5",
180294
+ "primary",
180295
+ "success",
180296
+ "warning",
180297
+ "error",
180298
+ "info",
180299
+ "muted"
180300
+ ]
180301
+ }
180302
+ },
180303
+ required: ["key"],
180304
+ additionalProperties: false
180305
+ }
180306
+ },
180307
+ stacked: {
180308
+ type: "boolean"
180309
+ },
180310
+ format: {
180311
+ type: "string",
180312
+ enum: ["number", "currency", "percent"]
180313
+ },
180314
+ currency: {
180315
+ type: "string",
180316
+ pattern: "^[A-Z]{3}$"
180317
+ },
180318
+ height: {
180319
+ type: "integer",
180320
+ minimum: 120,
180321
+ maximum: 640
180322
+ },
180323
+ legend: {
180324
+ type: "boolean"
180325
+ },
180326
+ emptyMessage: {
180327
+ type: "string"
180328
+ }
180329
+ },
180330
+ required: ["kind", "x", "series"],
180331
+ additionalProperties: false
180332
+ }
180333
+ },
180194
180334
  Alert: {
180195
180335
  description: "Status-toned inline alert. `icon` overrides the tone's default icon. `actionLabel` adds a button inside the callout that emits the element's `press` event (wire it with `on.press`).",
180196
180336
  props: {
@@ -183305,6 +183445,50 @@ async function elementDefinitionIssues(definition, catalog, context = {}) {
183305
183445
  }
183306
183446
  return dedupeIssues(issues);
183307
183447
  }
183448
+ function chartPropIssues(props, elementPath) {
183449
+ const issues = [];
183450
+ const propsPath = `${elementPath}.props`;
183451
+ if (Array.isArray(props.series)) {
183452
+ if (props.series.length === 0 || props.series.length > CHART_MAX_SERIES) {
183453
+ issues.push(issue(`${propsPath}.series`, `must list 1-${CHART_MAX_SERIES} series`));
183454
+ }
183455
+ const seen = new Set;
183456
+ for (const [index, entry] of props.series.entries()) {
183457
+ if (!isPlainObject(entry) || typeof entry.key !== "string")
183458
+ continue;
183459
+ if (seen.has(entry.key)) {
183460
+ issues.push(issue(`${propsPath}.series.${index}.key`, `duplicate series "${entry.key}"`));
183461
+ }
183462
+ seen.add(entry.key);
183463
+ }
183464
+ }
183465
+ if (typeof props.currency === "string" && !/^[A-Z]{3}$/.test(props.currency)) {
183466
+ issues.push(issue(`${propsPath}.currency`, "must be an ISO 4217 code like USD"));
183467
+ }
183468
+ if (typeof props.height === "number" && (!Number.isInteger(props.height) || props.height < 120 || props.height > 640)) {
183469
+ issues.push(issue(`${propsPath}.height`, "must be an integer from 120 to 640"));
183470
+ }
183471
+ return issues;
183472
+ }
183473
+ function shellDefinitionIssues(definition, catalog) {
183474
+ const issues = [];
183475
+ const iconNames = catalog.components.Icon?.props.properties?.name?.enum ?? [];
183476
+ const sidebar = definition.layout === "sidebar";
183477
+ for (const [pageName, page] of Object.entries(definition.pages)) {
183478
+ const pagePath = appendPath("pages", pageName);
183479
+ if (page.icon !== undefined && !iconNames.includes(page.icon)) {
183480
+ issues.push(issue(appendPath(pagePath, "icon"), `unknown icon "${page.icon}"`));
183481
+ }
183482
+ if (!sidebar) {
183483
+ for (const key of ["headerActions", "nav"]) {
183484
+ if (page[key] !== undefined) {
183485
+ issues.push(issue(appendPath(pagePath, key), 'only rendered with layout: "sidebar"; set it or drop this'));
183486
+ }
183487
+ }
183488
+ }
183489
+ }
183490
+ return issues;
183491
+ }
183308
183492
  function validatePage(definition, catalog, target) {
183309
183493
  const issues = [];
183310
183494
  const stateRefs = [];
@@ -183381,6 +183565,8 @@ function validatePage(definition, catalog, target) {
183381
183565
  issues.push(issue(`${elementPath}.props.busyWith`, `unknown app action "${rawElement.props.busyWith}"`));
183382
183566
  }
183383
183567
  collectLinkFieldIssues(definition, type, rawElement.props, elementPath, issues);
183568
+ if (type === "Chart")
183569
+ issues.push(...chartPropIssues(rawElement.props, elementPath));
183384
183570
  if (type === "Table") {
183385
183571
  const tableProps = rawElement.props;
183386
183572
  const selectionProps = ["selectable", "bulkActions"].filter((prop) => {
@@ -183460,6 +183646,13 @@ function validatePage(definition, catalog, target) {
183460
183646
  }
183461
183647
  }
183462
183648
  }
183649
+ if (type === "Chart" && Array.isArray(props.series)) {
183650
+ for (const [index, entry] of props.series.entries()) {
183651
+ if (isPlainObject(entry)) {
183652
+ fieldNames.push([`${elementPath}.props.series.${index}.key`, entry.key]);
183653
+ }
183654
+ }
183655
+ }
183463
183656
  for (const [fieldPath, fieldName] of fieldNames) {
183464
183657
  if (typeof fieldName !== "string")
183465
183658
  continue;
@@ -183626,6 +183819,17 @@ function validatePage(definition, catalog, target) {
183626
183819
  };
183627
183820
  if (typeof root === "string")
183628
183821
  markReachable(root);
183822
+ const headerActions = pageName ? definition.pages[pageName]?.headerActions : undefined;
183823
+ if (headerActions !== undefined) {
183824
+ const headerPath = appendPath(pagePath, "headerActions");
183825
+ if (!Object.hasOwn(elements, headerActions)) {
183826
+ issues.push(issue(headerPath, `element "${headerActions}" not found`));
183827
+ } else if (reachable.has(headerActions)) {
183828
+ issues.push(issue(headerPath, `element "${headerActions}" is already rendered from root`));
183829
+ } else {
183830
+ markReachable(headerActions);
183831
+ }
183832
+ }
183629
183833
  for (const elementId of Object.keys(elements)) {
183630
183834
  if (!reachable.has(elementId)) {
183631
183835
  issues.push(issue(`${elementsPath}.${elementId}`, "element is not reachable from root"));
@@ -183649,7 +183853,7 @@ function validatePage(definition, catalog, target) {
183649
183853
  }
183650
183854
  return dedupeIssues(issues);
183651
183855
  }
183652
- var ELEMENT_KEYS, UI_STATE_COMPONENTS, SCHEMA_FORM_ID, RESERVED_UI_IDS, PROP_ACTION_CHAINS, ITEM_ACTION_CHAINS, DATA_FIELD_PROPS, CONDITION_KEYS, COMPARISON_KEYS, POPOVER_MAX_FIELDS = 12, LINK_FIELD_PROPS, MAX_ELEMENT_REF_DEPTH = 5, MAX_ELEMENT_REF_EXPANSION_WORK = 100, MAX_ELEMENT_REF_EXPANSION_ISSUES = 100;
183856
+ var ELEMENT_KEYS, UI_STATE_COMPONENTS, SCHEMA_FORM_ID, RESERVED_UI_IDS, PROP_ACTION_CHAINS, ITEM_ACTION_CHAINS, DATA_FIELD_PROPS, CONDITION_KEYS, COMPARISON_KEYS, POPOVER_MAX_FIELDS = 12, LINK_FIELD_PROPS, MAX_ELEMENT_REF_DEPTH = 5, MAX_ELEMENT_REF_EXPANSION_WORK = 100, MAX_ELEMENT_REF_EXPANSION_ISSUES = 100, CHART_MAX_SERIES = 8;
183653
183857
  var init_page_validator = __esm(() => {
183654
183858
  init_definition();
183655
183859
  ELEMENT_KEYS = new Set([
@@ -183692,7 +183896,8 @@ var init_page_validator = __esm(() => {
183692
183896
  DATA_FIELD_PROPS = {
183693
183897
  Kanban: ["columnField", "titleField", "idField"],
183694
183898
  Calendar: ["startField", "endField", "titleField", "idField"],
183695
- ContributionGraph: ["dateField", "countField"]
183899
+ ContributionGraph: ["dateField", "countField"],
183900
+ Chart: ["x"]
183696
183901
  };
183697
183902
  CONDITION_KEYS = new Set(["eq", "neq", "gt", "gte", "lt", "lte", "not"]);
183698
183903
  COMPARISON_KEYS = ["eq", "neq", "gt", "gte", "lt", "lte"];
@@ -184033,6 +184238,7 @@ async function parseAppDefinition(input, elementContext = {}) {
184033
184238
  ...jsonColumnDefaultSizeIssues(parsed.data),
184034
184239
  ...Object.keys(parsed.data.pages).flatMap((pageName) => validatePage(parsed.data, catalog_generated_default, pageName)),
184035
184240
  ...crossPageDefinitionIssues(parsed.data, catalog_generated_default),
184241
+ ...shellDefinitionIssues(parsed.data, catalog_generated_default),
184036
184242
  ...await elementDefinitionIssues(parsed.data, catalog_generated_default, elementContext)
184037
184243
  ];
184038
184244
  const grandfatheredScriptRefs = collectScriptReferencePathMap(elementContext.existingDefinition);
@@ -184148,7 +184354,8 @@ function applyMergePatch(target, patch, path) {
184148
184354
  delete result[key];
184149
184355
  continue;
184150
184356
  }
184151
- defineMergePatchValue(result, key, entriesAreAtomic && !(path.length === 1 && path[0] === "elements" && isMergePatchObject(value) && Object.keys(value).length === 1 && isMergePatchObject(value.elements)) ? value : applyMergePatch(result[key], value, [...path, key]));
184357
+ const replaceWhole = path.length === 0 && key === "icon" || entriesAreAtomic && !(path.length === 1 && path[0] === "elements" && isMergePatchObject(value) && Object.keys(value).length === 1 && isMergePatchObject(value.elements));
184358
+ defineMergePatchValue(result, key, replaceWhole ? value : applyMergePatch(result[key], value, [...path, key]));
184152
184359
  }
184153
184360
  return result;
184154
184361
  }
@@ -184371,7 +184578,11 @@ var init_definition = __esm(() => {
184371
184578
  root: string2(),
184372
184579
  elements: record2(string2(), unknown()),
184373
184580
  title: string2().optional(),
184374
- params: record2(AppNameSchema, AppPageParamSchema).optional()
184581
+ params: record2(AppNameSchema, AppPageParamSchema).optional(),
184582
+ icon: string2().optional(),
184583
+ description: string2().max(280).optional(),
184584
+ headerActions: string2().optional(),
184585
+ nav: boolean().optional()
184375
184586
  }).strict();
184376
184587
  ElementPropDefSchema = object2({
184377
184588
  kind: ScalarColumnKindSchema,
@@ -184429,6 +184640,7 @@ var init_definition = __esm(() => {
184429
184640
  pages: record2(AppNameSchema, AppPageSchema),
184430
184641
  defaultPage: AppNameSchema,
184431
184642
  theme: AppThemeIdSchema.optional(),
184643
+ layout: _enum2(["sidebar"]).optional(),
184432
184644
  icon: AppIconSchema.optional()
184433
184645
  }).superRefine((definition, ctx) => {
184434
184646
  if (!Object.hasOwn(definition.pages, definition.defaultPage)) {
@@ -184542,7 +184754,8 @@ var init_definition = __esm(() => {
184542
184754
  "defaultPage",
184543
184755
  "schemaVersion",
184544
184756
  "theme",
184545
- "icon"
184757
+ "icon",
184758
+ "layout"
184546
184759
  ]);
184547
184760
  TOP_LEVEL_KEY_SUGGESTIONS = {
184548
184761
  element: "elements",
@@ -185424,6 +185637,11 @@ export interface SwarmSdk {
185424
185637
  // --- scripts ---
185425
185638
  script_search(args: { query?: string; scope?: ScriptScope; limit?: number }): Promise<unknown>;
185426
185639
  script_run(args: { name?: string; source?: string; args?: unknown; intent?: string; scope?: ScriptScope; fsMode?: ScriptFsMode; executor?: ScriptExecutorName | null; idempotencyKey?: string }): Promise<unknown>;
185640
+ // --- savings calibration (REST only) ---
185641
+ /** The savings curve in use (shipped or derived from this deployment) and the stored row's metadata. */
185642
+ savings_calibrationGet(): Promise<unknown>;
185643
+ /** Derive the curve from the last \`days\` of sessions. Read-only unless \`apply\` is true (needs config write access). One run at a time; takes up to 120 s, so call it from a script with a long enough timeout. */
185644
+ savings_calibrationRun(args?: { days?: number; end?: string; apply?: boolean }): Promise<unknown>;
185427
185645
  // --- swarm / agent ---
185428
185646
  swarm_get(args?: { includeFull?: boolean }): Promise<unknown>;
185429
185647
  agent_info(args?: Record<string, unknown>): Promise<unknown>;
@@ -186156,17 +186374,33 @@ function parseSkillContent(content) {
186156
186374
  if (secondDelimiter === -1) {
186157
186375
  throw new Error("Skill content has unterminated frontmatter. Missing closing ---.");
186158
186376
  }
186159
- const frontmatterRaw = trimmed.slice(3, secondDelimiter).trim();
186377
+ const frontmatterRaw = trimmed.slice(3, secondDelimiter);
186160
186378
  const body = trimmed.slice(secondDelimiter + 3).trim();
186161
186379
  const metadata = {};
186162
- for (const line of frontmatterRaw.split(`
186163
- `)) {
186380
+ const lines = frontmatterRaw.split(`
186381
+ `);
186382
+ for (let i = 0;i < lines.length; i++) {
186383
+ const line = lines[i];
186164
186384
  const colonIdx = line.indexOf(":");
186165
186385
  if (colonIdx === -1)
186166
186386
  continue;
186167
186387
  const key = line.slice(0, colonIdx).trim();
186168
186388
  let value = line.slice(colonIdx + 1).trim();
186169
- if (value.length >= 2 && value.startsWith('"') && value.endsWith('"')) {
186389
+ if (/^[>|][-+]?$/.test(value)) {
186390
+ const start = i;
186391
+ const indentation = line.length - line.trimStart().length;
186392
+ while (i + 1 < lines.length) {
186393
+ const next = lines[i + 1];
186394
+ if (next.trim() && next.length - next.trimStart().length <= indentation)
186395
+ break;
186396
+ i++;
186397
+ }
186398
+ const scalar = lines.slice(start, i + 1).join(`
186399
+ `) + (i < lines.length - 1 ? `
186400
+ ` : "");
186401
+ const block = Bun.YAML.parse(scalar);
186402
+ value = block[key] ?? "";
186403
+ } else if (value.length >= 2 && value.startsWith('"') && value.endsWith('"')) {
186170
186404
  try {
186171
186405
  value = JSON.parse(value);
186172
186406
  } catch {}
@@ -11,7 +11,7 @@ import {
11
11
  init_steering2,
12
12
  createLogEntry2,
13
13
  init_db4
14
- } from "./cli-h38x262p.js";
14
+ } from "./cli-rcecc3yq.js";
15
15
  import {
16
16
  ackSlackMessage,
17
17
  skipSlackMessageReaction,
@@ -28,7 +28,7 @@ import {
28
28
  init_watcher,
29
29
  getSlackApp2,
30
30
  init_app3
31
- } from "./cli-p1bq50aa.js";
31
+ } from "./cli-4vzgeta4.js";
32
32
  import {
33
33
  TaskCreationBlockedError,
34
34
  init_errors2,
@@ -42,20 +42,20 @@ import {
42
42
  init_message_text,
43
43
  createAdditiveBuffer,
44
44
  init_additive_buffer
45
- } from "./cli-rfywm85n.js";
45
+ } from "./cli-3e875j5p.js";
46
46
  import {
47
47
  resolveSlackUserId,
48
48
  rewriteSlackMentions,
49
49
  init_enrich
50
- } from "./cli-6t09sdhy.js";
50
+ } from "./cli-xf3qw745.js";
51
51
  import {
52
52
  isSlackThreadLeft,
53
53
  init_left_threads
54
- } from "./cli-a7wvp2km.js";
54
+ } from "./cli-3vmb0n58.js";
55
55
  import {
56
56
  findUserByExternalId,
57
57
  init_users
58
- } from "./cli-gxkx0zzp.js";
58
+ } from "./cli-f4e8r23x.js";
59
59
  import {
60
60
  isSteeringEnabled2,
61
61
  init_steering_enabled
@@ -9,7 +9,7 @@ import {
9
9
  import {
10
10
  applyOpenRouterBaseUrlOverride2,
11
11
  buildOpenAICompatibleProviderBlock2
12
- } from "./cli-7p1kvkck.js";
12
+ } from "./cli-6rc5frdm.js";
13
13
  import {
14
14
  fetchInstalledMcpServers
15
15
  } from "./cli-bst1vp7e.js";
@@ -30,7 +30,7 @@ import {
30
30
  import {
31
31
  DEFAULT_MODEL_TIER_MAP,
32
32
  init_types4
33
- } from "./cli-2zp0et3v.js";
33
+ } from "./cli-pchypa1s.js";
34
34
  import {
35
35
  resolveTemplateFromCode,
36
36
  resolveTemplateAsync,
@@ -58,7 +58,7 @@ import {
58
58
  import {
59
59
  init_package,
60
60
  package_default
61
- } from "./cli-334z18y3.js";
61
+ } from "./cli-zh9rsbqf.js";
62
62
  import {
63
63
  fxModelRoute,
64
64
  normalizeGrokModel,
@@ -34,7 +34,7 @@ import {
34
34
  getPendingWaitsByEvent2,
35
35
  resolveWaitState2,
36
36
  init_db4
37
- } from "./cli-h38x262p.js";
37
+ } from "./cli-rcecc3yq.js";
38
38
  import {
39
39
  workflowEventBus2,
40
40
  init_event_bus
@@ -79,12 +79,12 @@ import {
79
79
  getNextTargets,
80
80
  getSuccessors,
81
81
  init_definition2
82
- } from "./cli-qfedvmcr.js";
82
+ } from "./cli-jdknh18m.js";
83
83
  import {
84
84
  RetryPolicySchema,
85
85
  SUPERSEDED_WORKFLOW_TASK_REASON,
86
86
  init_types4
87
- } from "./cli-2zp0et3v.js";
87
+ } from "./cli-pchypa1s.js";
88
88
  import {
89
89
  init_zod
90
90
  } from "./cli-zcfpsfzf.js";