@desplega.ai/agent-swarm 2.7.10 → 2.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (296) hide show
  1. package/dist/acp-adapter-pdy3qsvg.js +15 -0
  2. package/dist/{actions-b8aqhrsg.js → actions-pwjpn0j6.js} +19 -20
  3. package/dist/{amp-adapter-4c165vgn.js → amp-adapter-cq9jgj6x.js} +2 -3
  4. package/dist/{app-m9khefrh.js → app-cnfffgwg.js} +3 -3
  5. package/dist/{assistant-rh4v3ntz.js → assistant-kpn317y1.js} +21 -22
  6. package/dist/{boot-args-schema-hwkc8bzv.js → boot-args-schema-pbbnhmc3.js} +1 -1
  7. package/dist/{boot-reembed-fdyk55h4.js → boot-reembed-9m0ysxma.js} +1 -1
  8. package/dist/{boot-reembed-5y6yw9sj.js → boot-reembed-majbn53m.js} +1 -1
  9. package/dist/{boot-scrub-sweep-r5r8kqsn.js → boot-scrub-sweep-app8g8ym.js} +3 -3
  10. package/dist/{boot-seeds-8f9zt5cm.js → boot-seeds-pbtmvcjm.js} +4 -5
  11. package/dist/{claude-adapter-s5df247c.js → claude-adapter-wn1g3qp5.js} +7 -8
  12. package/dist/{claude-managed-adapter-h74d06yz.js → claude-managed-adapter-jh6c523j.js} +3 -3
  13. package/dist/{claude-managed-setup-9gsmwzyx.js → claude-managed-setup-pd47nzch.js} +6 -6
  14. package/dist/{claude-sdk-session-dq1j4nz9.js → claude-sdk-session-3a2a6589.js} +9066 -8818
  15. package/dist/{cli-n5yexkdg.js → cli-0b4zam62.js} +1 -0
  16. package/dist/{cli-5wfz00be.js → cli-0jzra9ad.js} +2 -2
  17. package/dist/{cli-zjphdj1a.js → cli-0ntbxyaa.js} +40 -18
  18. package/dist/{cli-yz7v0sh4.js → cli-1xh9a7hn.js} +4 -6
  19. package/dist/{cli-eqtfgfr6.js → cli-2gxeg5gr.js} +1 -1
  20. package/dist/{cli-hfkwwy1h.js → cli-2zp0et3v.js} +21 -2
  21. package/dist/{cli-6m6b4bep.js → cli-3rkdne1h.js} +2 -2
  22. package/dist/{cli-mr97t7cc.js → cli-4r05hnqa.js} +263 -14
  23. package/dist/{cli-jc1g9ndz.js → cli-5j88qqa8.js} +10 -5
  24. package/dist/{cli-xfjrc279.js → cli-5mrq3ake.js} +48 -14
  25. package/dist/{cli-an1knn2k.js → cli-6mma83xa.js} +5 -5
  26. package/dist/{cli-tph5wt3y.js → cli-6wj7p986.js} +1 -1
  27. package/dist/{cli-t73cas91.js → cli-7349va39.js} +8100 -7620
  28. package/dist/{cli-5xcb8gxq.js → cli-7b8sbmag.js} +8 -8
  29. package/dist/{cli-3xj33nrx.js → cli-7cp6aa1q.js} +10 -3
  30. package/dist/{cli-mp9aa8g5.js → cli-7p1kvkck.js} +6 -6
  31. package/dist/{cli-j7d73g1y.js → cli-7w69ne2f.js} +3035 -354
  32. package/dist/{cli-cr14kftt.js → cli-89cqnasv.js} +3 -3
  33. package/dist/{cli-w3bk0dgv.js → cli-8aes17e4.js} +2 -2
  34. package/dist/{cli-7wz05bx3.js → cli-93k32c37.js} +468 -745
  35. package/dist/{cli-eqk5p56g.js → cli-9vhebtjz.js} +9 -9
  36. package/dist/{cli-td33w98c.js → cli-9wngrawf.js} +10 -10
  37. package/dist/cli-a3b239vq.js +242 -0
  38. package/dist/{cli-kx4c8j05.js → cli-b085njxz.js} +63 -19
  39. package/dist/{cli-8ewkreqd.js → cli-b5rs97a6.js} +7 -9
  40. package/dist/{cli-bxz823sz.js → cli-b8e9nb04.js} +1 -1
  41. package/dist/{cli-nj3x45rw.js → cli-bb431xey.js} +52 -43
  42. package/dist/{cli-36wdfzgn.js → cli-bsywb58a.js} +8 -8
  43. package/dist/{cli-18qt3few.js → cli-cyhbbd1z.js} +1 -1
  44. package/dist/{cli-eb2azq8n.js → cli-d3p5vwbk.js} +9 -9
  45. package/dist/{cli-2tsfpc70.js → cli-dy32zecz.js} +1 -1
  46. package/dist/{cli-rjyghzg4.js → cli-g70vxtjh.js} +2 -2
  47. package/dist/{cli-55bkx8hh.js → cli-gax7fk3t.js} +1 -1
  48. package/dist/{cli-jg24scat.js → cli-jcpr5smb.js} +3 -3
  49. package/dist/{cli-n07eecjs.js → cli-jywyhqws.js} +3 -3
  50. package/dist/{cli-38yww4e9.js → cli-k0615eh8.js} +8 -8
  51. package/dist/{cli-3xddv0rk.js → cli-k26bkr9t.js} +5 -7
  52. package/dist/{cli-xd5ebp64.js → cli-k93bq1wq.js} +3 -3
  53. package/dist/{cli-f2zenhja.js → cli-kc7v1nfv.js} +1 -1
  54. package/dist/{cli-x9exydey.js → cli-m4dqmnbp.js} +1 -1
  55. package/dist/{cli-gpwhbgx0.js → cli-m9s2qff2.js} +57 -25
  56. package/dist/{cli-ybjdc978.js → cli-mrt48bx7.js} +7 -4
  57. package/dist/{cli-ttbqe3q4.js → cli-p1w18yhx.js} +1 -1
  58. package/dist/{cli-h49ejvmc.js → cli-pcad4cb1.js} +1 -1
  59. package/dist/{cli-tmft5dz2.js → cli-qmqk2yc2.js} +1 -1
  60. package/dist/{cli-g1px1g2e.js → cli-re4raaj0.js} +1 -1
  61. package/dist/{cli-xbtq4d6s.js → cli-sn7rtnj4.js} +12 -8
  62. package/dist/{cli-n9abj89w.js → cli-syybb0p1.js} +8 -8
  63. package/dist/{cli-v2fwbnsk.js → cli-tacge1w0.js} +6 -6
  64. package/dist/{cli-pyrxt9gw.js → cli-tk7cjj8h.js} +1 -1
  65. package/dist/{cli-xvymtmv4.js → cli-tqegb8eq.js} +3 -3
  66. package/dist/{cli-kf3pxxdg.js → cli-v1dv1r37.js} +1 -1
  67. package/dist/{cli-z9cs5m0w.js → cli-vbh10fqa.js} +12 -12
  68. package/dist/{cli-3xcwp3z8.js → cli-vj75tyaw.js} +3 -3
  69. package/dist/{cli-xncjscpm.js → cli-vqptjbr7.js} +50 -24
  70. package/dist/{cli-q581b386.js → cli-wk18cm92.js} +5 -5
  71. package/dist/{cli-4vwxp550.js → cli-x1wa213s.js} +1 -1
  72. package/dist/{cli-n9ftpys4.js → cli-x6t50dmw.js} +7 -7
  73. package/dist/{cli-jrp1dt73.js → cli-xzm9vcfg.js} +1 -1
  74. package/dist/{cli-16phend6.js → cli-yn2bbre9.js} +1 -1
  75. package/dist/{cli-rt0ag4x1.js → cli-yncmerje.js} +5 -5
  76. package/dist/{cli-0m7rtm11.js → cli-zcsw143p.js} +1 -1
  77. package/dist/cli.js +18 -18
  78. package/dist/{codex-adapter-yr60sme6.js → codex-adapter-nha71q3n.js} +5 -6
  79. package/dist/{codex-hook-fac6175r.js → codex-hook-h3vk6xzr.js} +1 -1
  80. package/dist/{codex-session-runner-pch8x584.js → codex-session-runner-ak9x1k1h.js} +5 -6
  81. package/dist/{commands-phjfbkv0.js → commands-f587qpq8.js} +3 -3
  82. package/dist/{controller-jkx994pz.js → controller-hxx8wwy1.js} +2 -2
  83. package/dist/{controllers-connect-c4448kwa.js → controllers-connect-k5sg9m9h.js} +20 -21
  84. package/dist/{cursor-adapter-ndebqnm8.js → cursor-adapter-n5nc3mfe.js} +1 -2
  85. package/dist/{db-ef32tbfc.js → db-amm8w15a.js} +10 -2
  86. package/dist/{db-ez6egt6v.js → db-nzf8zb5z.js} +3 -3
  87. package/dist/{devin-adapter-z46ep5ph.js → devin-adapter-xedz98zv.js} +1 -1
  88. package/dist/{dispatcher-g3tt9hs9.js → dispatcher-89zrts8f.js} +18 -19
  89. package/dist/{dsh-adapter-tcyn3099.js → dsh-adapter-nrhbrjz8.js} +1 -2
  90. package/dist/{easter-egg-3d-e36hk5td.js → easter-egg-3d-533knw22.js} +1 -1
  91. package/dist/{embedding-space-4kyh5qqj.js → embedding-space-ezwenjmj.js} +6 -6
  92. package/dist/{embeddings-6a8v4a6t.js → embeddings-np74ht6g.js} +1 -1
  93. package/dist/{execute-3cbg0twf.js → execute-b3mrb1mv.js} +1 -1
  94. package/dist/{external-channel-se646snz.js → external-channel-z46yx9d7.js} +2 -2
  95. package/dist/{fx-adapter-yw795hqq.js → fx-adapter-3q12snn6.js} +7 -8
  96. package/dist/{grok-adapter-ttmcss2j.js → grok-adapter-ahb1w033.js} +7 -8
  97. package/dist/handlers-vbww69re.js +32 -0
  98. package/dist/heartbeat-dt9qw9c8.js +43 -0
  99. package/dist/{hook-hq93y5ej.js → hook-8k6fbz9b.js} +5 -5
  100. package/dist/{hook-g3nhexsy.js → hook-jgcgygex.js} +6 -6
  101. package/dist/{http-5a9p4h6y.js → http-haw4r8ne.js} +284 -142
  102. package/dist/{index-0eny15vj.js → index-2skqtd76.js} +2 -2
  103. package/dist/{index-6haqt3v5.js → index-4a0670yh.js} +8917 -8476
  104. package/dist/index-4xwaf5th.js +32 -0
  105. package/dist/{index-3c5pxbge.js → index-5gk12my8.js} +1 -1
  106. package/dist/{index-w7em4ktq.js → index-d6wkh8ar.js} +2 -2
  107. package/dist/index-f0hcrs8e.js +33 -0
  108. package/dist/{index-rvccek1w.js → index-gjwaqaq8.js} +5 -5
  109. package/dist/{index-e5pfbsys.js → index-hjhfk3ra.js} +3 -3
  110. package/dist/{index-1qw6f2dc.js → index-khe3gp0k.js} +4 -4
  111. package/dist/index-s4ewdma4.js +37 -0
  112. package/dist/{index-hgn3c961.js → index-tez78qj3.js} +979 -36
  113. package/dist/{index-s72rqgsx.js → index-tvfafeyy.js} +1 -1
  114. package/dist/{keepalive-1j4n4dmk.js → keepalive-xn6s7rmg.js} +3 -3
  115. package/dist/lead-6ygbfhbh.js +70 -0
  116. package/dist/{maintenance-dmghacy5.js → maintenance-vdts800b.js} +1 -1
  117. package/dist/{node-je82wjet.js → node-4c5jqxr3.js} +1 -1
  118. package/dist/{oauth-refresh-sweep-yy06c03c.js → oauth-refresh-sweep-094c8wfk.js} +2 -2
  119. package/dist/{onboard-52f9t5dm.js → onboard-v99eh56m.js} +3 -3
  120. package/dist/{opencode-adapter-krnh9jkn.js → opencode-adapter-dsagkhtw.js} +5 -6
  121. package/dist/{otel-impl-xjqz6wjj.js → otel-impl-q7yr9yp0.js} +1 -1
  122. package/dist/{pi-mono-adapter-dbxyp0qv.js → pi-mono-adapter-546cd1cc.js} +9 -9
  123. package/dist/{pricing-refresh-ctdr74pd.js → pricing-refresh-7dh2yase.js} +2 -3
  124. package/dist/{rbac-roles-ehv8s10n.js → rbac-roles-mdmc96p4.js} +3 -3
  125. package/dist/{rbac-roles-q0gr8eyj.js → rbac-roles-npbmdh77.js} +4 -6
  126. package/dist/{registry-hpjfmcfz.js → registry-32b1mft6.js} +1 -1
  127. package/dist/{render-v2-5b6chvcq.js → render-v2-twhhwmms.js} +3 -3
  128. package/dist/{resume-5a5d2845.js → resume-5gsrjd5e.js} +6 -6
  129. package/dist/{runtime-khxszyfp.js → runtime-1hv06jsn.js} +1 -1
  130. package/dist/{session-access-gj0bjhqg.js → session-access-m191x30x.js} +4 -4
  131. package/dist/{session-source-backfill-2sy0krfk.js → session-source-backfill-nt923ask.js} +2 -2
  132. package/dist/{setup-7ssfakk1.js → setup-wv467afy.js} +1 -1
  133. package/dist/{virtual-modules-pjj0knwf.js → virtual-modules-gazyapte.js} +3 -3
  134. package/dist/{work-objects-bf3syvhq.js → work-objects-8zkrpy13.js} +21 -22
  135. package/dist/{worker-follow-up-38xevga6.js → worker-follow-up-cecqszem.js} +18 -19
  136. package/dist/worker-mz5z7kj0.js +70 -0
  137. package/openapi.json +334 -7
  138. package/package.json +5 -5
  139. package/src/apps/definition.ts +11 -0
  140. package/src/apps/store.ts +28 -8
  141. package/src/be/db/model-profiles.ts +147 -38
  142. package/src/be/db/tasks/read.ts +5 -1
  143. package/src/be/db/workflow-run-definitions.ts +117 -0
  144. package/src/be/db.ts +24 -3
  145. package/src/be/memory/constants.ts +14 -1
  146. package/src/be/memory/key-paths.ts +8 -0
  147. package/src/be/memory/providers/sqlite-store.ts +160 -10
  148. package/src/be/memory/task-learning.ts +79 -14
  149. package/src/be/memory/types.ts +24 -1
  150. package/src/be/migrations/279_backfill_learning_expiry.sql +15 -0
  151. package/src/be/migrations/281_model_profiles_pr2.sql +28 -0
  152. package/src/be/migrations/283_workflow_run_definitions.sql +14 -0
  153. package/src/be/model-profile-check.ts +284 -0
  154. package/src/be/model-tier-resolution.ts +112 -12
  155. package/src/be/multi-runtime.ts +27 -0
  156. package/src/be/runtime-pools/routing.ts +52 -4
  157. package/src/be/scripts/typecheck.ts +1 -0
  158. package/src/be/seed-scripts/catalog/dreaming-learnings.ts +552 -0
  159. package/src/be/seed-scripts/catalog/dreaming-memtax-create.ts +389 -14
  160. package/src/be/seed-scripts/catalog/dreaming-memtax.ts +6 -3
  161. package/src/be/seed-scripts/index.ts +9 -0
  162. package/src/be/steering.ts +8 -2
  163. package/src/commands/onboard/agent-fs-version.ts +1 -1
  164. package/src/commands/runner.ts +32 -1
  165. package/src/fs/provider.ts +17 -3
  166. package/src/heartbeat/heartbeat.ts +12 -1
  167. package/src/heartbeat/index.ts +1 -0
  168. package/src/http/agents.ts +56 -4
  169. package/src/http/apps.ts +3 -1
  170. package/src/http/config.ts +2 -6
  171. package/src/http/index.ts +2 -3
  172. package/src/http/model-profiles.ts +58 -10
  173. package/src/http/poll.ts +36 -3
  174. package/src/http/schedules.ts +42 -3
  175. package/src/http/tasks.ts +37 -12
  176. package/src/http/workflows.ts +15 -2
  177. package/src/prompts/session-templates.ts +1 -1
  178. package/src/providers/acp-targets.ts +11 -6
  179. package/src/providers/amp-adapter.ts +1 -1
  180. package/src/providers/claude-sdk-session.ts +132 -23
  181. package/src/providers/codex-skill-resolver.ts +10 -4
  182. package/src/providers/cursor-adapter.ts +1 -1
  183. package/src/providers/devin-skill-resolver.ts +5 -5
  184. package/src/providers/dsh-adapter.ts +1 -1
  185. package/src/scheduler/schedule-task.ts +1 -0
  186. package/src/scripts-runtime/eval-harness.ts +14 -1
  187. package/src/scripts-runtime/executors/types.ts +3 -0
  188. package/src/scripts-runtime/sdk-allowlist.ts +1 -0
  189. package/src/scripts-runtime/swarm-sdk.ts +18 -1
  190. package/src/scripts-runtime/types/stdlib.d.ts +1 -0
  191. package/src/scripts-runtime/types/swarm-sdk.d.ts +1 -0
  192. package/src/server.ts +2 -0
  193. package/src/slack/app.ts +93 -0
  194. package/src/slack/inbound-dispatch.ts +18 -1
  195. package/src/slack/workspace-guard.ts +345 -0
  196. package/src/tasks/task-terminal-effects.ts +4 -0
  197. package/src/tasks/worker-follow-up.ts +102 -2
  198. package/src/tests/acp-adapter.test.ts +82 -0
  199. package/src/tests/apps-icon.test.ts +120 -0
  200. package/src/tests/chained-task-follow-up.test.ts +248 -0
  201. package/src/tests/check-pr-body.test.ts +40 -0
  202. package/src/tests/claude-sdk-lifecycle.test.ts +216 -1
  203. package/src/tests/claude-sdk-process.fixture.ts +57 -0
  204. package/src/tests/codex-skill-resolver.test.ts +31 -0
  205. package/src/tests/credentials-allowlist.test.ts +470 -0
  206. package/src/tests/db-task-read-contract.test.ts +5 -0
  207. package/src/tests/db-task-write-contract.test.ts +5 -0
  208. package/src/tests/deferred-wake-follow-up.test.ts +47 -0
  209. package/src/tests/docs-index-footprint.test.js +3 -3
  210. package/src/tests/dreaming-learnings.test.ts +1395 -0
  211. package/src/tests/dsh-adapter.test.ts +1 -1
  212. package/src/tests/explicit-model-validation.test.ts +2 -0
  213. package/src/tests/fs-provider.test.ts +42 -0
  214. package/src/tests/heartbeat.test.ts +28 -1
  215. package/src/tests/human-free-reclassify.test.ts +5 -1
  216. package/src/tests/list-endpoint-slimming.test.ts +17 -0
  217. package/src/tests/mcp-tools.test.ts +1 -1
  218. package/src/tests/migration-283-workflow-run-definitions.test.ts +69 -0
  219. package/src/tests/model-profile-check.test.ts +387 -0
  220. package/src/tests/model-profiles-api.test.ts +528 -1
  221. package/src/tests/profile-claim.test.ts +415 -3
  222. package/src/tests/profile-tier-alias.test.ts +382 -0
  223. package/src/tests/schedule-profile.test.ts +359 -0
  224. package/src/tests/script-connections.test.ts +6 -0
  225. package/src/tests/script-native-unawaited-drain.test.ts +167 -0
  226. package/src/tests/script-per-script-executor.test.ts +1 -0
  227. package/src/tests/scripts-sdk-bridge-tool-failure.test.ts +141 -0
  228. package/src/tests/seed-scripts.test.ts +2 -2
  229. package/src/tests/slack-inbound-receipts.test.ts +22 -2
  230. package/src/tests/slack-socket-ack.test.ts +16 -1
  231. package/src/tests/slack-workspace-guard.test.ts +905 -0
  232. package/src/tests/steering-core.test.ts +40 -0
  233. package/src/tests/store-progress-learning.test.ts +605 -20
  234. package/src/tests/tool-annotations.test.ts +1 -1
  235. package/src/tests/workflow-convergence.test.ts +46 -40
  236. package/src/tests/workflow-definition-pinning-recovery.test.ts +552 -0
  237. package/src/tests/workflow-definition-pinning.test.ts +645 -0
  238. package/src/tests/workflow-executors.test.ts +16 -7
  239. package/src/tests/workflow-foreach.test.ts +43 -20
  240. package/src/tests/workflow-notify-slack-ready.test.ts +161 -0
  241. package/src/tests/workflow-profile.test.ts +328 -0
  242. package/src/tools/app-upsert.ts +1 -1
  243. package/src/tools/memory-edit.ts +2 -1
  244. package/src/tools/model-profiles/check-model-profile.ts +63 -0
  245. package/src/tools/schedules/create-schedule.ts +45 -4
  246. package/src/tools/schedules/patch-schedule.ts +50 -4
  247. package/src/tools/schedules/update-schedule.ts +50 -4
  248. package/src/tools/script-run.ts +1 -1
  249. package/src/tools/send-task.ts +17 -2
  250. package/src/tools/store-progress.ts +15 -3
  251. package/src/tools/task-action.ts +9 -1
  252. package/src/tools/templates.ts +13 -0
  253. package/src/tools/tool-config.ts +2 -1
  254. package/src/tools/utils.ts +61 -4
  255. package/src/tools/workflows/create-workflow.ts +1 -1
  256. package/src/tools/workflows/retry-workflow-run.ts +1 -1
  257. package/src/tools/workflows/update-workflow.ts +10 -1
  258. package/src/types.ts +56 -1
  259. package/src/utils/credentials.ts +89 -12
  260. package/src/workflows/engine.ts +10 -1
  261. package/src/workflows/executors/agent-task.ts +21 -2
  262. package/src/workflows/executors/foreach.ts +4 -1
  263. package/src/workflows/executors/notify.ts +62 -6
  264. package/src/workflows/executors/sub-workflow.ts +1 -1
  265. package/src/workflows/executors/swarm-script.ts +4 -1
  266. package/src/workflows/foreach-driver.ts +8 -5
  267. package/src/workflows/limits.ts +2 -1
  268. package/src/workflows/model-validation.ts +27 -2
  269. package/src/workflows/patch-definition.ts +3 -1
  270. package/src/workflows/recovery.ts +6 -6
  271. package/src/workflows/resume.ts +9 -9
  272. package/src/workflows/retry-poller.ts +2 -2
  273. package/templates/skills/apps/SKILL.md +2 -0
  274. package/templates/skills/apps/content.md +2 -0
  275. package/templates/skills/code-quality/content.md +12 -0
  276. package/templates/skills/memory/content.md +8 -0
  277. package/templates/skills/scheduling/config.json +1 -1
  278. package/templates/skills/scheduling/content.md +2 -2
  279. package/templates/skills/swarm-docs/content.md +4 -0
  280. package/templates/skills/swarm-extensions/content.md +1 -1
  281. package/templates/skills/swarm-scripts/SKILL.md +2 -2
  282. package/templates/skills/swarm-scripts/content.md +2 -2
  283. package/templates/skills/work-on-task/SKILL.md +2 -0
  284. package/templates/skills/work-on-task/content.md +2 -0
  285. package/templates/workflows/dreaming/content.md +174 -7
  286. package/dist/acp-adapter-srfhs1s9.js +0 -16
  287. package/dist/cli-bzvs88tv.js +0 -339
  288. package/dist/cli-cyn9v8zr.js +0 -748
  289. package/dist/cli-ed6yqpf1.js +0 -779
  290. package/dist/handlers-17wha3ze.js +0 -33
  291. package/dist/heartbeat-gwewgdms.js +0 -42
  292. package/dist/index-8arwq8mw.js +0 -34
  293. package/dist/index-tpw054az.js +0 -38
  294. package/dist/index-waq75j2j.js +0 -31
  295. package/dist/lead-re73kdgc.js +0 -72
  296. package/dist/worker-r8mz7a65.js +0 -72
@@ -59,7 +59,12 @@ class APIError extends AnthropicError {
59
59
  this.requestID = headers?.get("request-id");
60
60
  this.workspaceID = headers?.get("anthropic-workspace-id");
61
61
  this.error = error;
62
- this.type = type ?? null;
62
+ const body = error ?? {};
63
+ this.apiMessage = body.error?.message ?? null;
64
+ this.type = type ?? body.error?.type ?? null;
65
+ const errorCode = body.error?.details?.error_code;
66
+ this.errorCode = typeof errorCode === "string" ? errorCode : null;
67
+ this.details = body.error?.details ?? null;
63
68
  }
64
69
  static makeMessage(status, error, message) {
65
70
  const msg = error?.message ? typeof error.message === "string" ? error.message : JSON.stringify(error.message) : error ? JSON.stringify(error) : message;
@@ -79,32 +84,14 @@ class APIError extends AnthropicError {
79
84
  return new APIConnectionError({ message, cause: castToError(errorResponse) });
80
85
  }
81
86
  const error = errorResponse;
82
- const type = error?.["error"]?.["type"];
83
- if (status === 400) {
84
- return new BadRequestError(status, error, message, headers, type);
85
- }
86
- if (status === 401) {
87
- return new AuthenticationError(status, error, message, headers, type);
88
- }
89
- if (status === 403) {
90
- return new PermissionDeniedError(status, error, message, headers, type);
91
- }
92
- if (status === 404) {
93
- return new NotFoundError2(status, error, message, headers, type);
94
- }
95
- if (status === 409) {
96
- return new ConflictError(status, error, message, headers, type);
97
- }
98
- if (status === 422) {
99
- return new UnprocessableEntityError(status, error, message, headers, type);
100
- }
101
- if (status === 429) {
102
- return new RateLimitError(status, error, message, headers, type);
87
+ const errorClass = STATUS_ERROR_CLASSES.get(status);
88
+ if (errorClass) {
89
+ return new errorClass(status, error, message, headers);
103
90
  }
104
91
  if (status >= 500) {
105
- return new InternalServerError(status, error, message, headers, type);
92
+ return new InternalServerError(status, error, message, headers);
106
93
  }
107
- return new APIError(status, error, message, headers, type);
94
+ return new APIError(status, error, message, headers);
108
95
  }
109
96
  }
110
97
 
@@ -148,18 +135,63 @@ class PermissionDeniedError extends APIError {
148
135
  class NotFoundError2 extends APIError {
149
136
  }
150
137
 
138
+ class RequestTimeoutError extends APIError {
139
+ }
140
+
151
141
  class ConflictError extends APIError {
152
142
  }
153
143
 
144
+ class PreconditionFailedError extends APIError {
145
+ }
146
+
147
+ class ContentTooLargeError extends APIError {
148
+ }
149
+
154
150
  class UnprocessableEntityError extends APIError {
155
151
  }
156
152
 
157
153
  class RateLimitError extends APIError {
158
154
  }
159
155
 
156
+ class RequestHeaderFieldsTooLargeError extends APIError {
157
+ }
158
+
159
+ class ClientClosedRequestError extends APIError {
160
+ }
161
+
160
162
  class InternalServerError extends APIError {
161
163
  }
162
164
 
165
+ class NotImplementedError2 extends InternalServerError {
166
+ }
167
+
168
+ class ServiceUnavailableError extends InternalServerError {
169
+ }
170
+
171
+ class GatewayTimeoutError extends InternalServerError {
172
+ }
173
+
174
+ class OverloadedError extends InternalServerError {
175
+ }
176
+ var STATUS_ERROR_CLASSES = /* @__PURE__ */ new Map([
177
+ [400, BadRequestError],
178
+ [401, AuthenticationError],
179
+ [403, PermissionDeniedError],
180
+ [404, NotFoundError2],
181
+ [408, RequestTimeoutError],
182
+ [409, ConflictError],
183
+ [412, PreconditionFailedError],
184
+ [413, ContentTooLargeError],
185
+ [422, UnprocessableEntityError],
186
+ [429, RateLimitError],
187
+ [431, RequestHeaderFieldsTooLargeError],
188
+ [499, ClientClosedRequestError],
189
+ [501, NotImplementedError2],
190
+ [503, ServiceUnavailableError],
191
+ [504, GatewayTimeoutError],
192
+ [529, OverloadedError]
193
+ ]);
194
+
163
195
  // node_modules/@anthropic-ai/sdk/internal/utils/values.mjs
164
196
  var startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;
165
197
  var isAbsoluteURL = (url) => {
@@ -390,4 +422,4 @@ function promiseWithResolvers() {
390
422
  return { promise, resolve, reject };
391
423
  }
392
424
 
393
- export { __classPrivateFieldSet, __classPrivateFieldGet, isAbortError, castToError, AnthropicError, APIError, APIUserAbortError, APIConnectionError, APIConnectionTimeoutError, RetryableError, BadRequestError, AuthenticationError, PermissionDeniedError, NotFoundError2, ConflictError, UnprocessableEntityError, RateLimitError, InternalServerError, isAbsoluteURL, isArray, isReadonlyArray, maybeObj, isEmptyObj, isObj, validatePositiveInteger, CREDENTIAL_OPTIONS, safeJSON, checkNever, concatBytes, encodeUTF8, decodeUTF8, readEnv, defaultLogLevel, parseLogLevel, loggerFor, defaultLogger, debugLogRequestDetails, isStatus, isFatal4xx, backoff, jitter, applyJitter, ToolError, DEFAULT_MEMORY_SYNC_INTERVAL_MS, checkMemorySyncInterval, promiseWithResolvers };
425
+ export { __classPrivateFieldSet, __classPrivateFieldGet, isAbortError, castToError, AnthropicError, APIError, APIUserAbortError, APIConnectionError, APIConnectionTimeoutError, RetryableError, BadRequestError, AuthenticationError, PermissionDeniedError, NotFoundError2, RequestTimeoutError, ConflictError, PreconditionFailedError, ContentTooLargeError, UnprocessableEntityError, RateLimitError, RequestHeaderFieldsTooLargeError, ClientClosedRequestError, InternalServerError, NotImplementedError2, ServiceUnavailableError, GatewayTimeoutError, OverloadedError, isAbsoluteURL, isArray, isReadonlyArray, maybeObj, isEmptyObj, isObj, validatePositiveInteger, CREDENTIAL_OPTIONS, safeJSON, checkNever, concatBytes, encodeUTF8, decodeUTF8, readEnv, defaultLogLevel, parseLogLevel, loggerFor, defaultLogger, debugLogRequestDetails, isStatus, isFatal4xx, backoff, jitter, applyJitter, ToolError, DEFAULT_MEMORY_SYNC_INTERVAL_MS, checkMemorySyncInterval, promiseWithResolvers };
@@ -1,3 +1,6 @@
1
+ import {
2
+ getMaxSkillChars
3
+ } from "./cli-5j88qqa8.js";
1
4
  import {
2
5
  scrubSecrets,
3
6
  init_secret_scrubber
@@ -124,7 +127,6 @@ async function getOrCreatePlaybook(orgId, apiKey, title, body, swarmApiUrl, swar
124
127
  // src/providers/devin-skill-resolver.ts
125
128
  import { join } from "node:path";
126
129
  var SKILL_COMMAND_REGEX = /^@skills:([a-z0-9:_-]+)(?:\s+(.*))?$/;
127
- var MAX_SKILL_CHARS = Number(process.env.MAX_SKILL_CHARS) || 1e5;
128
130
  function defaultSkillsDir() {
129
131
  if (process.env.DEVIN_SKILLS_DIR) {
130
132
  return process.env.DEVIN_SKILLS_DIR;
@@ -169,13 +171,14 @@ async function resolveDevinPrompt(prompt, skillsDir, emit) {
169
171
  });
170
172
  return prompt;
171
173
  }
172
- if (skillContent.length > MAX_SKILL_CHARS) {
174
+ const maxSkillChars = getMaxSkillChars();
175
+ if (skillContent.length > maxSkillChars) {
173
176
  emit?.({
174
177
  type: "raw_stderr",
175
- content: `[devin] skill resolver: SKILL.md for @skills:${commandName} exceeds ${MAX_SKILL_CHARS} chars (${skillContent.length}), truncating
178
+ content: `[devin] skill resolver: SKILL.md for @skills:${commandName} exceeds ${maxSkillChars} chars (${skillContent.length}), truncating
176
179
  `
177
180
  });
178
- skillContent = skillContent.slice(0, MAX_SKILL_CHARS);
181
+ skillContent = skillContent.slice(0, maxSkillChars);
179
182
  }
180
183
  const userRequestBody = trailingArgs && rest ? `${trailingArgs}
181
184
  ${rest}` : trailingArgs || rest;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DEFAULT_MODEL_TIER_MAP,
3
3
  init_types4
4
- } from "./cli-hfkwwy1h.js";
4
+ } from "./cli-2zp0et3v.js";
5
5
  import {
6
6
  __esm
7
7
  } from "./cli-242037k3.js";
@@ -2,7 +2,7 @@ import {
2
2
  isGrokOpenRouterModel,
3
3
  grokTargetProfile,
4
4
  ACPAdapter2
5
- } from "./cli-xbtq4d6s.js";
5
+ } from "./cli-sn7rtnj4.js";
6
6
  import {
7
7
  getOpenRouterBaseUrl,
8
8
  getOpenRouterAttributionHeaders,
@@ -13,7 +13,7 @@ import {
13
13
  claudeMdLineageOf,
14
14
  planClaudeMdSync,
15
15
  init_profile_sync
16
- } from "./cli-pyrxt9gw.js";
16
+ } from "./cli-tk7cjj8h.js";
17
17
  import {
18
18
  scrubSecrets,
19
19
  init_secret_scrubber
@@ -5,7 +5,7 @@ import {
5
5
  scheduleOrgDomainRecompute,
6
6
  init_telemetry_identity,
7
7
  init_db4
8
- } from "./cli-j7d73g1y.js";
8
+ } from "./cli-7w69ne2f.js";
9
9
  import {
10
10
  registerVolatileSecret,
11
11
  unregisterVolatileSecret,
@@ -9,7 +9,7 @@ import {
9
9
  import {
10
10
  applyOpenRouterBaseUrlOverride2,
11
11
  buildOpenAICompatibleProviderBlock2
12
- } from "./cli-mp9aa8g5.js";
12
+ } from "./cli-7p1kvkck.js";
13
13
  import {
14
14
  fetchInstalledMcpServers
15
15
  } from "./cli-bst1vp7e.js";
@@ -30,13 +30,13 @@ import {
30
30
  import {
31
31
  DEFAULT_MODEL_TIER_MAP,
32
32
  init_types4
33
- } from "./cli-hfkwwy1h.js";
33
+ } from "./cli-2zp0et3v.js";
34
34
  import {
35
35
  resolveTemplateFromCode,
36
36
  resolveTemplateAsync,
37
37
  init_resolver,
38
38
  init_session_templates
39
- } from "./cli-kf3pxxdg.js";
39
+ } from "./cli-v1dv1r37.js";
40
40
  import {
41
41
  NEVER,
42
42
  string2,
@@ -58,7 +58,7 @@ import {
58
58
  import {
59
59
  init_package,
60
60
  package_default
61
- } from "./cli-rt0ag4x1.js";
61
+ } from "./cli-yncmerje.js";
62
62
  import {
63
63
  fxModelRoute,
64
64
  normalizeGrokModel,
@@ -4366,12 +4366,16 @@ function copyEnvKeys(config, env, keys) {
4366
4366
  function parseStringArray(value) {
4367
4367
  if (!value?.trim())
4368
4368
  return [];
4369
+ let parsed;
4369
4370
  try {
4370
- const parsed = JSON.parse(value);
4371
- if (Array.isArray(parsed) && parsed.every((entry) => typeof entry === "string")) {
4372
- return parsed;
4373
- }
4371
+ parsed = JSON.parse(value);
4374
4372
  } catch {}
4373
+ if (Array.isArray(parsed)) {
4374
+ if (!parsed.every((entry) => typeof entry === "string")) {
4375
+ throw new AcpTargetResolutionError("ACP_TARGET_ENV_KEYS must be a JSON array of strings.");
4376
+ }
4377
+ return parsed;
4378
+ }
4375
4379
  return value.split(",").map((entry) => entry.trim()).filter(Boolean);
4376
4380
  }
4377
4381
  function configuredOptions(config) {
@@ -12,7 +12,7 @@ import {
12
12
  SteeringBlockedError,
13
13
  init_steering2,
14
14
  init_db4
15
- } from "./cli-j7d73g1y.js";
15
+ } from "./cli-7w69ne2f.js";
16
16
  import {
17
17
  isBlockExternalEnabled2,
18
18
  invalidateChannelExternality2,
@@ -20,7 +20,7 @@ import {
20
20
  shouldBlockChannel2,
21
21
  leaveExternalChannel2,
22
22
  init_external_channel
23
- } from "./cli-bxz823sz.js";
23
+ } from "./cli-b8e9nb04.js";
24
24
  import {
25
25
  workflowEventBus2,
26
26
  init_event_bus
@@ -40,7 +40,7 @@ import {
40
40
  init_render_v2,
41
41
  registerTreeMessage,
42
42
  init_watcher
43
- } from "./cli-mr97t7cc.js";
43
+ } from "./cli-4r05hnqa.js";
44
44
  import {
45
45
  TaskCreationBlockedError,
46
46
  init_errors2,
@@ -61,7 +61,7 @@ import {
61
61
  init_message_text,
62
62
  dispatchPre2,
63
63
  init_dispatcher
64
- } from "./cli-7wz05bx3.js";
64
+ } from "./cli-93k32c37.js";
65
65
  import {
66
66
  wasEventSeen,
67
67
  init_event_dedup,
@@ -72,13 +72,13 @@ import {
72
72
  getBufferMessageCount,
73
73
  instantFlush,
74
74
  init_thread_buffer
75
- } from "./cli-v2fwbnsk.js";
75
+ } from "./cli-tacge1w0.js";
76
76
  import {
77
77
  enrichSlackUserEmail,
78
78
  resolveSlackUserId,
79
79
  rewriteSlackMentions,
80
80
  init_enrich
81
- } from "./cli-n07eecjs.js";
81
+ } from "./cli-jywyhqws.js";
82
82
  import {
83
83
  isSlackLeaveThreadDisabled,
84
84
  SLACK_LEFT_THREAD_CONFIRMATION,
@@ -86,11 +86,11 @@ import {
86
86
  leaveSlackThread,
87
87
  shouldSkipLeftSlackThread,
88
88
  init_left_threads
89
- } from "./cli-2tsfpc70.js";
89
+ } from "./cli-dy32zecz.js";
90
90
  import {
91
91
  resolveTemplate,
92
92
  init_resolver
93
- } from "./cli-kf3pxxdg.js";
93
+ } from "./cli-v1dv1r37.js";
94
94
  import {
95
95
  init_zod
96
96
  } from "./cli-zcfpsfzf.js";
@@ -11,7 +11,7 @@ import {
11
11
  init_steering2,
12
12
  createLogEntry2,
13
13
  init_db4
14
- } from "./cli-j7d73g1y.js";
14
+ } from "./cli-7w69ne2f.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-mr97t7cc.js";
31
+ } from "./cli-4r05hnqa.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-7wz05bx3.js";
45
+ } from "./cli-93k32c37.js";
46
46
  import {
47
47
  resolveSlackUserId,
48
48
  rewriteSlackMentions,
49
49
  init_enrich
50
- } from "./cli-n07eecjs.js";
50
+ } from "./cli-jywyhqws.js";
51
51
  import {
52
52
  isSlackThreadLeft,
53
53
  init_left_threads
54
- } from "./cli-2tsfpc70.js";
54
+ } from "./cli-dy32zecz.js";
55
55
  import {
56
56
  findUserByExternalId,
57
57
  init_users
58
- } from "./cli-g1px1g2e.js";
58
+ } from "./cli-re4raaj0.js";
59
59
  import {
60
60
  isSteeringEnabled2,
61
61
  init_steering_enabled
@@ -12,7 +12,7 @@ import {
12
12
  resolveTemplateAsync,
13
13
  init_resolver,
14
14
  init_session_templates
15
- } from "./cli-kf3pxxdg.js";
15
+ } from "./cli-v1dv1r37.js";
16
16
  import {
17
17
  MAX_PROFILE_FILE_LENGTH,
18
18
  getAppUrl,
@@ -4,7 +4,7 @@ import {
4
4
  } from "./cli-0726awxw.js";
5
5
  import {
6
6
  summarizeSession
7
- } from "./cli-rjyghzg4.js";
7
+ } from "./cli-g70vxtjh.js";
8
8
  import {
9
9
  getMemoryRaterNames,
10
10
  init_memory_raters,
@@ -19,7 +19,7 @@ import {
19
19
  readIdentityBaselines,
20
20
  advanceIdentityBaselines,
21
21
  init_profile_sync
22
- } from "./cli-pyrxt9gw.js";
22
+ } from "./cli-tk7cjj8h.js";
23
23
  import {
24
24
  getOpenRouterAttributionHeaders,
25
25
  init_openrouter_base_url
@@ -29,7 +29,7 @@ import {
29
29
  resolveTemplateAsync,
30
30
  init_resolver,
31
31
  init_session_templates
32
- } from "./cli-kf3pxxdg.js";
32
+ } from "./cli-v1dv1r37.js";
33
33
  import {
34
34
  isSessionSummarySkipped,
35
35
  init_env_flag
@@ -366,7 +366,7 @@ Your profile lives in the database. Edit it with \`update-profile\`: \`soulMd\`,
366
366
  ## Memory
367
367
 
368
368
  Memories from past sessions are in your task message. Read them before you start. For a wider search, run the \`task-context-gathering\` script with the task ID and two to four queries.
369
- When you learn something that would change how the next agent works (a fix, a pattern, a gotcha), pass it as \`learning\` on a \`store-progress\` call before the task ends. Completed task outputs are stored for you.
369
+ Pass a fix, pattern or gotcha the next agent needs as \`learning\` on a \`store-progress\` call before the task ends: line 1 a title, line 2 the rule ("When X, do Y"), never a status line. Completed task outputs are stored for you.
370
370
  You MUST use the \`memory\` skill before you store, edit, or delete a memory.
371
371
  `,
372
372
  variables: [],
@@ -18,7 +18,7 @@ import {
18
18
  createForeachAttemptSteps,
19
19
  init_workflow_runs,
20
20
  cancelTask2,
21
- getWorkflow2,
21
+ getRunWorkflow2,
22
22
  getWorkflowRun2,
23
23
  updateWorkflowRun2,
24
24
  getWorkflowRunStep2,
@@ -34,7 +34,7 @@ import {
34
34
  getPendingWaitsByEvent2,
35
35
  resolveWaitState2,
36
36
  init_db4
37
- } from "./cli-j7d73g1y.js";
37
+ } from "./cli-7w69ne2f.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-xncjscpm.js";
82
+ } from "./cli-vqptjbr7.js";
83
83
  import {
84
84
  RetryPolicySchema,
85
85
  SUPERSEDED_WORKFLOW_TASK_REASON,
86
86
  init_types4
87
- } from "./cli-hfkwwy1h.js";
87
+ } from "./cli-2zp0et3v.js";
88
88
  import {
89
89
  init_zod
90
90
  } from "./cli-zcfpsfzf.js";
@@ -198,7 +198,7 @@ var init_sub_workflow = __esm(() => {
198
198
  if (!workflow.enabled) {
199
199
  return { status: "failed", error: `Workflow ${config.workflowId} is disabled` };
200
200
  }
201
- const parent = await db.getWorkflow(meta.workflowId);
201
+ const parent = await db.getRunWorkflow({ id: meta.runId, workflowId: meta.workflowId });
202
202
  const triggeredByAgentId = parent?.createdByAgentId ?? await getWorkflowRunTriggeredByAgentId(meta.runId) ?? undefined;
203
203
  let childRunId;
204
204
  try {
@@ -806,7 +806,7 @@ async function resumeFromTaskCompletionUnguarded(event, registry) {
806
806
  return;
807
807
  if (await isStaleTaskEvent(step.id, event))
808
808
  return;
809
- const workflow = await getWorkflow2(run.workflowId);
809
+ const workflow = await getRunWorkflow2(run);
810
810
  if (!workflow)
811
811
  return;
812
812
  const ctx = run.context ?? {};
@@ -864,7 +864,7 @@ async function handleTaskFailureUnguarded(event, reason, registry, options) {
864
864
  return;
865
865
  if (await isStaleTaskEvent(step.id, event))
866
866
  return;
867
- const workflow = await getWorkflow2(run.workflowId);
867
+ const workflow = await getRunWorkflow2(run);
868
868
  if (!workflow)
869
869
  return;
870
870
  if (options.retryable) {
@@ -905,7 +905,7 @@ async function recordLateForeachOutcome(run, stepId, event, outcome) {
905
905
  return;
906
906
  if (await isStaleTaskEvent(step.id, event))
907
907
  return;
908
- const workflow = await getWorkflow2(run.workflowId);
908
+ const workflow = await getRunWorkflow2(run);
909
909
  if (!workflow || !resolveForeachParent(workflow.definition, step.nodeId))
910
910
  return;
911
911
  await settleForeachChild(workflow.definition, run.id, step.id, outcome, run.context ?? {});
@@ -923,7 +923,7 @@ async function retryFailedRun2(runId, registry) {
923
923
  const run = await getWorkflowRun2(runId);
924
924
  if (!run || run.status !== "failed")
925
925
  throw new Error("Run is not in failed state");
926
- const workflow = await getWorkflow2(run.workflowId);
926
+ const workflow = await getRunWorkflow2(run);
927
927
  if (!workflow)
928
928
  throw new Error("Workflow not found");
929
929
  const steps = await getWorkflowRunStepsByRunId2(runId);
@@ -1109,7 +1109,7 @@ async function resumeFromApprovalResolutionUnguarded(event, registry) {
1109
1109
  const step = await getWorkflowRunStep2(event.workflowRunStepId);
1110
1110
  if (!step || step.status !== "waiting")
1111
1111
  return;
1112
- const workflow = await getWorkflow2(run.workflowId);
1112
+ const workflow = await getRunWorkflow2(run);
1113
1113
  if (!workflow)
1114
1114
  return;
1115
1115
  if (event.status === "cancelled") {
@@ -1153,7 +1153,7 @@ async function resumeClaimedWait(waitRow, status, cappedPayload, registry) {
1153
1153
  const step = await getWorkflowRunStep2(waitRow.workflowRunStepId);
1154
1154
  if (!step || step.status !== "waiting")
1155
1155
  return;
1156
- const workflow = await getWorkflow2(run.workflowId);
1156
+ const workflow = await getRunWorkflow2(run);
1157
1157
  if (!workflow)
1158
1158
  return;
1159
1159
  const nextPort = computeNextPort(waitRow.mode, status);
@@ -1187,7 +1187,7 @@ async function resumeFromChildRun2(parentStepId, registry) {
1187
1187
  const run = await getWorkflowRun2(step.runId);
1188
1188
  if (!run || run.status !== "waiting" && run.status !== "running")
1189
1189
  return;
1190
- const workflow = await getWorkflow2(run.workflowId);
1190
+ const workflow = await getRunWorkflow2(run);
1191
1191
  if (!workflow)
1192
1192
  return;
1193
1193
  const ctx = run.context ?? {};
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Anthropic
3
- } from "./cli-t73cas91.js";
3
+ } from "./cli-7349va39.js";
4
4
  import {
5
5
  contextBoundNoteThreshold,
6
6
  createContextBoundNote
7
- } from "./cli-jrp1dt73.js";
7
+ } from "./cli-xzm9vcfg.js";
8
8
  import {
9
9
  checkToolLoop
10
10
  } from "./cli-0726awxw.js";
@@ -24,7 +24,7 @@ import {
24
24
  import {
25
25
  selectCredential,
26
26
  init_credentials2
27
- } from "./cli-xfjrc279.js";
27
+ } from "./cli-5mrq3ake.js";
28
28
  import {
29
29
  runtimeCatalogModel,
30
30
  init_runtime_model_catalog