@desplega.ai/agent-swarm 1.113.0 → 1.115.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/README.md +2 -2
  2. package/dist/{actions-q4n7cz6e.js → actions-17ya5wde.js} +8 -9
  3. package/dist/{app-es4nzc71.js → app-4f718yk0.js} +6 -6
  4. package/dist/{assistant-0x8ey0vs.js → assistant-ah7csnjz.js} +19 -18
  5. package/dist/{boot-reembed-69agkhv6.js → boot-reembed-4jpxhb25.js} +6 -6
  6. package/dist/{boot-reembed-p0ny05t8.js → boot-reembed-qata34xa.js} +5 -5
  7. package/dist/{boot-scrub-logs-yybrkmvr.js → boot-scrub-logs-tv48nn3z.js} +4 -4
  8. package/dist/{claude-adapter-mma9a1yr.js → claude-adapter-3csn5bks.js} +3 -3
  9. package/dist/{claude-managed-adapter-pv2nbqy4.js → claude-managed-adapter-kysmkz89.js} +2 -2
  10. package/dist/cli-0pygq9r1.js +429 -0
  11. package/dist/{cli-hsetkkd3.js → cli-12vb0xg6.js} +33 -9
  12. package/dist/{cli-ncfgsqbd.js → cli-15y7qhzp.js} +262 -33
  13. package/dist/{cli-7ga43spr.js → cli-1yjrbg1f.js} +1 -1
  14. package/dist/{cli-36ymmpmp.js → cli-3samkyap.js} +2 -2
  15. package/dist/cli-52fg7s7x.js +269 -0
  16. package/dist/{cli-hjhvekf4.js → cli-65ekje01.js} +11 -8
  17. package/dist/{cli-h3k622d0.js → cli-6aq8xhvm.js} +90 -3
  18. package/dist/{cli-f3qa069v.js → cli-7xje5amz.js} +1 -1
  19. package/dist/cli-86fdnerz.js +405 -0
  20. package/dist/{cli-9cy6nc5m.js → cli-8fjwym53.js} +1 -1
  21. package/dist/{cli-c3frqf65.js → cli-b23axgz4.js} +3 -3
  22. package/dist/{cli-a0t7vapf.js → cli-bc89my0z.js} +1 -1
  23. package/dist/{cli-bnzbn8j8.js → cli-beea4a3y.js} +73 -24
  24. package/dist/{cli-q21d49ac.js → cli-bw80ck94.js} +1 -1
  25. package/dist/{cli-pwc5e83c.js → cli-cchksf5q.js} +12 -7
  26. package/dist/{cli-30bbaveh.js → cli-cmw9rzy5.js} +2 -2
  27. package/dist/{cli-y6mrptcn.js → cli-cnwssmsr.js} +1 -1
  28. package/dist/{cli-r5g6ngtn.js → cli-dcca6j8m.js} +46 -5
  29. package/dist/{cli-tkmm5nf9.js → cli-e61fs2hp.js} +59 -2
  30. package/dist/{cli-6wscj9z0.js → cli-e7306swv.js} +14 -14
  31. package/dist/{cli-dcfyyh3t.js → cli-ftyf58xj.js} +2 -2
  32. package/dist/{cli-4xyj9jtq.js → cli-hrhye2rm.js} +1062 -478
  33. package/dist/cli-jkhwmmgg.js +136 -0
  34. package/dist/{cli-y4ycrnjc.js → cli-k3y4z3h5.js} +1 -1
  35. package/dist/{cli-6xd0bvf8.js → cli-ma04faw5.js} +1 -1
  36. package/dist/{cli-2fc97xm5.js → cli-mnbgv3w7.js} +4 -4
  37. package/dist/{cli-trmapn9k.js → cli-pet3aev6.js} +95 -10
  38. package/dist/{cli-z46pnksz.js → cli-q1rx7g0d.js} +175 -28
  39. package/dist/{cli-qwgtacd6.js → cli-r9f6ngrf.js} +1244 -336
  40. package/dist/{cli-gtkqc144.js → cli-shvaxw27.js} +13 -7
  41. package/dist/{cli-ywez6yps.js → cli-sq7f72d6.js} +1 -1
  42. package/dist/cli-t0vqevnm.js +393 -0
  43. package/dist/{cli-tbw13sx8.js → cli-tece6zgm.js} +1 -1
  44. package/dist/{cli-bgvskydy.js → cli-tffvrh6j.js} +1 -1
  45. package/dist/cli-wh91zby6.js +187222 -0
  46. package/dist/{cli-anrj584m.js → cli-xz9aq0rf.js} +1 -1
  47. package/dist/{cli-mq580e06.js → cli-zsrdty74.js} +18 -18
  48. package/dist/cli.js +32 -15
  49. package/dist/{codex-adapter-5cmy858w.js → codex-adapter-de3w0nch.js} +10 -10
  50. package/dist/{codex-session-runner-46q8mrba.js → codex-session-runner-bnw8cysk.js} +10 -10
  51. package/dist/{commands-z5dbwta3.js → commands-hch4e2k1.js} +4 -4
  52. package/dist/{db-bbgahh4z.js → db-p3h2j06x.js} +14 -4
  53. package/dist/{handlers-6b44317z.js → handlers-9er4zx9q.js} +17 -31
  54. package/dist/{hook-sbp5fmps.js → hook-4axs756z.js} +7 -7
  55. package/dist/{http-2xz43gz3.js → http-809fvtz2.js} +1934 -886
  56. package/dist/{index-wz1ea15p.js → index-2dgfj9av.js} +3 -3
  57. package/dist/{index-nhat35em.js → index-47em3d2n.js} +14 -11
  58. package/dist/{index-5ghxn8s6.js → index-9fqaktjr.js} +12 -9
  59. package/dist/{index-0gzmqj4k.js → index-9ht8gr56.js} +13 -10
  60. package/dist/{index-vfedgdw6.js → index-rm85cfdx.js} +368 -40
  61. package/dist/{index-ykvs43z4.js → index-t2snazez.js} +4 -4
  62. package/dist/{keepalive-62gfj91d.js → keepalive-3cps6e3e.js} +7 -6
  63. package/dist/{lead-ag0akn0v.js → lead-fkk95wgq.js} +36 -32
  64. package/dist/{maintenance-xxrrzk5x.js → maintenance-fweqh0yj.js} +6 -6
  65. package/dist/{mistral-conversations-26yrnbf1.js → mistral-conversations-7gqnz2wt.js} +7 -7
  66. package/dist/oauth-refresh-sweep-sycqtbph.js +114 -0
  67. package/dist/{onboard-64zyfcbs.js → onboard-cy0rkgvx.js} +2 -2
  68. package/dist/{opencode-adapter-mqsxr170.js → opencode-adapter-p6bxnbm4.js} +2 -2
  69. package/dist/{otel-zjd9zaxs.js → otel-g299k41b.js} +2 -2
  70. package/dist/{otel-impl-b86qseaa.js → otel-impl-wbns8hf7.js} +1 -1
  71. package/dist/{pi-mono-adapter-kxjxpfgy.js → pi-mono-adapter-05sck1ds.js} +17 -109
  72. package/dist/{pricing-refresh-cgtkffpa.js → pricing-refresh-0hvazmkf.js} +6 -6
  73. package/dist/rbac-roles-kfesjy9y.js +28 -0
  74. package/dist/rbac-roles-mwcwhbxc.js +283 -0
  75. package/dist/{seed-pricing-1r1y1xkq.js → seed-pricing-h2kdq4cq.js} +5 -5
  76. package/dist/{setup-mkcgkjf7.js → setup-8506q97w.js} +2 -2
  77. package/dist/{worker-351sze63.js → worker-4r5c6zyb.js} +36 -32
  78. package/openapi.json +1327 -20
  79. package/package.json +3 -3
  80. package/src/agentmail/handlers.ts +16 -6
  81. package/src/agentmail/templates.ts +25 -5
  82. package/src/be/audit-user.ts +28 -4
  83. package/src/be/db-queries/oauth.ts +42 -0
  84. package/src/be/db.ts +314 -28
  85. package/src/be/identity.ts +79 -0
  86. package/src/be/mcp-proxy.ts +132 -0
  87. package/src/be/migrations/109_rbac_roles.sql +79 -0
  88. package/src/be/migrations/111_oauth_credential_bindings.sql +6 -0
  89. package/src/be/migrations/112_script_connections_graphql.sql +96 -0
  90. package/src/be/migrations/113_task_routing_affinity.sql +9 -0
  91. package/src/be/migrations/114_backfill_gpt_5_6_pricing.sql +15 -0
  92. package/src/be/modelsdev-cache.json +135 -0
  93. package/src/be/oauth-credential-bindings.ts +35 -0
  94. package/src/be/oauth-refresh-sweep.ts +159 -0
  95. package/src/be/rbac-audit.ts +52 -13
  96. package/src/be/rbac-roles.ts +424 -0
  97. package/src/be/script-connections.ts +459 -40
  98. package/src/be/script-credential-broker.ts +29 -3
  99. package/src/be/scripts/typecheck.ts +51 -7
  100. package/src/be/seed-scripts/catalog/catalog-report.inline.ts +325 -24
  101. package/src/be/seed-scripts/catalog/catalog-report.ts +325 -24
  102. package/src/be/users.ts +24 -0
  103. package/src/cli.tsx +17 -0
  104. package/src/github/handlers.ts +10 -9
  105. package/src/github/templates.ts +45 -9
  106. package/src/gitlab/handlers.ts +20 -8
  107. package/src/gitlab/templates.ts +18 -6
  108. package/src/heartbeat/heartbeat.ts +143 -21
  109. package/src/http/all-routes.ts +3 -0
  110. package/src/http/approval-requests.ts +12 -0
  111. package/src/http/config.ts +44 -10
  112. package/src/http/core.ts +30 -3
  113. package/src/http/favorites.ts +1 -5
  114. package/src/http/index.ts +25 -1
  115. package/src/http/mcp-oauth.ts +2 -0
  116. package/src/http/mcp-servers.ts +44 -3
  117. package/src/http/oauth-generic.ts +105 -0
  118. package/src/http/poll.ts +20 -3
  119. package/src/http/script-connection-proxy.ts +116 -0
  120. package/src/http/script-connections.ts +1657 -0
  121. package/src/http/scripts.ts +27 -7
  122. package/src/http/skills.ts +11 -0
  123. package/src/http/tasks.ts +27 -13
  124. package/src/http/x.ts +6 -2
  125. package/src/integrations/kapso/inbound.ts +23 -6
  126. package/src/jira/sync.ts +111 -17
  127. package/src/jira/templates.ts +10 -2
  128. package/src/mcp-client/http-client.ts +194 -0
  129. package/src/oauth/app-validation.ts +16 -0
  130. package/src/oauth/ensure-token.ts +69 -14
  131. package/src/oauth/mcp-wrapper.ts +15 -0
  132. package/src/oauth/wrapper.ts +48 -20
  133. package/src/prompts/session-templates.ts +3 -3
  134. package/src/providers/codex-models.ts +100 -30
  135. package/src/providers/modelsdev-reasoning.json +51 -0
  136. package/src/providers/pi-mono-mcp-client.ts +2 -133
  137. package/src/providers/reasoning-effort.ts +11 -5
  138. package/src/rbac/admission.ts +68 -0
  139. package/src/rbac/index.ts +2 -0
  140. package/src/rbac/legacy-policy.ts +12 -0
  141. package/src/rbac/permissions.ts +48 -0
  142. package/src/scheduler/scheduler.ts +9 -1
  143. package/src/scripts-runtime/api-client.ts +151 -19
  144. package/src/scripts-runtime/api-types.ts +38 -6
  145. package/src/scripts-runtime/credential-broker/default-bindings.ts +1 -0
  146. package/src/scripts-runtime/credential-broker/types.ts +8 -0
  147. package/src/scripts-runtime/ctx.ts +11 -1
  148. package/src/scripts-runtime/eval-harness.ts +5 -1
  149. package/src/scripts-runtime/executors/types.ts +2 -1
  150. package/src/scripts-runtime/loader.ts +3 -1
  151. package/src/scripts-runtime/mcp-client.ts +87 -0
  152. package/src/scripts-runtime/sdk-allowlist.ts +1 -0
  153. package/src/scripts-runtime/types/stdlib.d.ts +6 -0
  154. package/src/scripts-runtime/types/swarm-sdk.d.ts +19 -0
  155. package/src/server-user.ts +114 -59
  156. package/src/server.ts +12 -0
  157. package/src/slack/assistant.ts +14 -6
  158. package/src/slack/enrich.ts +17 -0
  159. package/src/slack/handlers.ts +8 -22
  160. package/src/slack/responses.ts +91 -1
  161. package/src/slack/thread-buffer.ts +6 -3
  162. package/src/slack/watcher.ts +9 -6
  163. package/src/tasks/worker-follow-up.ts +100 -3
  164. package/src/tests/agentmail-handlers.test.ts +32 -3
  165. package/src/tests/approval-requests.test.ts +61 -0
  166. package/src/tests/audit-user.test.ts +47 -1
  167. package/src/tests/codex-adapter.test.ts +46 -23
  168. package/src/tests/credential-broker.test.ts +5 -2
  169. package/src/tests/delete-page-tool.test.ts +197 -0
  170. package/src/tests/github-handlers.test.ts +28 -2
  171. package/src/tests/gitlab-handlers.test.ts +125 -0
  172. package/src/tests/heartbeat.test.ts +48 -3
  173. package/src/tests/identity.test.ts +117 -0
  174. package/src/tests/jira-sync.test.ts +99 -1
  175. package/src/tests/kapso-inbound.test.ts +7 -0
  176. package/src/tests/mcp-tools-user.test.ts +60 -6
  177. package/src/tests/model-control.test.ts +8 -2
  178. package/src/tests/oauth-credential-bindings.test.ts +490 -0
  179. package/src/tests/oauth-refresh-sweep.test.ts +160 -0
  180. package/src/tests/pool-affinity.test.ts +401 -0
  181. package/src/tests/prompt-template-remaining.test.ts +2 -2
  182. package/src/tests/rbac-admission-e2e.test.ts +386 -0
  183. package/src/tests/rbac-admission.test.ts +492 -0
  184. package/src/tests/rbac-e2e-helpers.ts +3 -0
  185. package/src/tests/rbac-engine.test.ts +50 -0
  186. package/src/tests/rbac-mcp-admission-e2e.test.ts +362 -0
  187. package/src/tests/rbac-roles.test.ts +328 -0
  188. package/src/tests/reasoning-effort.test.ts +15 -2
  189. package/src/tests/schedule-target-type.test.ts +50 -0
  190. package/src/tests/scheduled-tasks.test.ts +40 -0
  191. package/src/tests/script-apis-mcp.test.ts +37 -13
  192. package/src/tests/script-connections-http.test.ts +1158 -0
  193. package/src/tests/script-connections-mcp.test.ts +894 -0
  194. package/src/tests/script-connections.test.ts +754 -6
  195. package/src/tests/scripts-external-api.test.ts +49 -1
  196. package/src/tests/scripts-runtime-secret-egress.test.ts +1 -0
  197. package/src/tests/scripts-runtime.test.ts +291 -0
  198. package/src/tests/seed-scripts.test.ts +36 -0
  199. package/src/tests/slack-identity-resolution.test.ts +37 -3
  200. package/src/tests/slack-inline-output.test.ts +65 -0
  201. package/src/tests/slack-thread-buffer.test.ts +28 -0
  202. package/src/tests/tool-annotations.test.ts +1 -0
  203. package/src/tests/user-token-rest-auth.test.ts +140 -1
  204. package/src/tests/workflow-swarm-script.test.ts +44 -0
  205. package/src/tests/workflow-triggers-v2.test.ts +300 -1
  206. package/src/tools/credential-bindings/tool.ts +277 -18
  207. package/src/tools/delete-page.ts +145 -0
  208. package/src/tools/mcp-servers/mcp-server-delete.ts +7 -4
  209. package/src/tools/request-human-input.ts +2 -0
  210. package/src/tools/resolve-user.ts +77 -27
  211. package/src/tools/script-apis.ts +62 -3
  212. package/src/tools/script-connections/tool.ts +275 -31
  213. package/src/tools/send-task.ts +15 -1
  214. package/src/tools/task-action.ts +34 -2
  215. package/src/tools/templates.ts +53 -1
  216. package/src/tools/tool-config.ts +2 -1
  217. package/src/tools/utils.ts +2 -0
  218. package/src/tools/workflows/create-workflow.ts +8 -1
  219. package/src/tools/workflows/update-workflow.ts +11 -2
  220. package/src/types.ts +90 -11
  221. package/src/utils/scoped-resource.ts +25 -0
  222. package/src/workflows/executors/human-in-the-loop.ts +1 -0
  223. package/src/workflows/executors/swarm-script.ts +7 -1
  224. package/src/workflows/triggers.ts +146 -18
  225. package/templates/skills/swarm-scripts/content.md +33 -8
  226. package/dist/cli-bgef578c.js +0 -771
  227. package/dist/cli-c9mtm09b.js +0 -43
  228. package/dist/cli-ceewqajw.js +0 -1698
  229. package/dist/{anthropic-messages-8nc6r2dw.js → anthropic-messages-kq3pjhbp.js} +6 -6
  230. package/dist/{azure-openai-responses-6yfzw3qw.js → azure-openai-responses-gm1ejtmn.js} +7 -7
  231. package/dist/{cli-vbraamxr.js → cli-6b4wwmm8.js} +9 -9
  232. package/dist/{cli-2r7s8jhp.js → cli-sznberje.js} +3 -3
  233. package/dist/{google-generative-ai-vfq6ymz9.js → google-generative-ai-hyrra2jm.js} +3 -3
  234. package/dist/{google-vertex-mj5y5rfj.js → google-vertex-8bs2pzgn.js} +3 -3
  235. package/dist/{openai-codex-responses-8h6kvfv8.js → openai-codex-responses-3nkvje79.js} +4 -4
  236. package/dist/{openai-completions-x6kjnqjd.js → openai-completions-0asftkwg.js} +11 -11
  237. package/dist/{openai-responses-7jwyz3ds.js → openai-responses-pmatek45.js} +10 -10
package/openapi.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "Agent Swarm API",
5
- "version": "1.113.0",
5
+ "version": "1.115.0",
6
6
  "description": "Multi-agent orchestration API for Claude Code, Codex, and Gemini CLI. Enables task distribution, agent communication, and service discovery.\n\nMCP tools are documented separately in [MCP.md](./MCP.md)."
7
7
  },
8
8
  "servers": [
@@ -560,6 +560,7 @@
560
560
  "medium",
561
561
  "high",
562
562
  "xhigh",
563
+ "max",
563
564
  null
564
565
  ]
565
566
  }
@@ -986,7 +987,8 @@
986
987
  "low",
987
988
  "medium",
988
989
  "high",
989
- "xhigh"
990
+ "xhigh",
991
+ "max"
990
992
  ]
991
993
  }
992
994
  },
@@ -1108,7 +1110,8 @@
1108
1110
  "low",
1109
1111
  "medium",
1110
1112
  "high",
1111
- "xhigh"
1113
+ "xhigh",
1114
+ "max"
1112
1115
  ]
1113
1116
  }
1114
1117
  },
@@ -6378,6 +6381,77 @@
6378
6381
  }
6379
6382
  }
6380
6383
  },
6384
+ "/api/oauth/{provider}/callback": {
6385
+ "get": {
6386
+ "operationId": "oauth_generic_callback",
6387
+ "summary": "Generic OAuth redirect target for script credential bindings",
6388
+ "tags": [
6389
+ "OAuth"
6390
+ ],
6391
+ "parameters": [
6392
+ {
6393
+ "schema": {
6394
+ "type": "string",
6395
+ "minLength": 1,
6396
+ "maxLength": 255,
6397
+ "pattern": "^[A-Za-z0-9_-]+$"
6398
+ },
6399
+ "required": true,
6400
+ "name": "provider",
6401
+ "in": "path"
6402
+ },
6403
+ {
6404
+ "schema": {
6405
+ "type": "string"
6406
+ },
6407
+ "required": false,
6408
+ "name": "code",
6409
+ "in": "query"
6410
+ },
6411
+ {
6412
+ "schema": {
6413
+ "type": "string"
6414
+ },
6415
+ "required": false,
6416
+ "name": "state",
6417
+ "in": "query"
6418
+ },
6419
+ {
6420
+ "schema": {
6421
+ "type": "string"
6422
+ },
6423
+ "required": false,
6424
+ "name": "error",
6425
+ "in": "query"
6426
+ },
6427
+ {
6428
+ "schema": {
6429
+ "type": "string"
6430
+ },
6431
+ "required": false,
6432
+ "name": "error_description",
6433
+ "in": "query"
6434
+ }
6435
+ ],
6436
+ "responses": {
6437
+ "200": {
6438
+ "description": "OAuth authorization completed"
6439
+ },
6440
+ "400": {
6441
+ "description": "Missing or invalid OAuth callback parameters"
6442
+ },
6443
+ "404": {
6444
+ "description": "OAuth app not configured"
6445
+ },
6446
+ "409": {
6447
+ "description": "Provider has a dedicated OAuth callback"
6448
+ },
6449
+ "502": {
6450
+ "description": "Token exchange failed"
6451
+ }
6452
+ }
6453
+ }
6454
+ },
6381
6455
  "/@swarm/api/{path}": {
6382
6456
  "get": {
6383
6457
  "summary": "Cookie-gated proxy to the swarm API (used by db-backed page iframes)",
@@ -9360,26 +9434,965 @@
9360
9434
  }
9361
9435
  }
9362
9436
  }
9363
- },
9437
+ },
9438
+ "responses": {
9439
+ "200": {
9440
+ "description": "Schedule patched"
9441
+ },
9442
+ "400": {
9443
+ "description": "Validation error"
9444
+ },
9445
+ "404": {
9446
+ "description": "Schedule not found"
9447
+ },
9448
+ "409": {
9449
+ "description": "Duplicate name"
9450
+ }
9451
+ }
9452
+ },
9453
+ "delete": {
9454
+ "summary": "Delete a schedule",
9455
+ "tags": [
9456
+ "Schedules"
9457
+ ],
9458
+ "security": [
9459
+ {
9460
+ "bearerAuth": []
9461
+ }
9462
+ ],
9463
+ "parameters": [
9464
+ {
9465
+ "schema": {
9466
+ "type": "string"
9467
+ },
9468
+ "required": true,
9469
+ "name": "id",
9470
+ "in": "path"
9471
+ }
9472
+ ],
9473
+ "responses": {
9474
+ "200": {
9475
+ "description": "Schedule deleted"
9476
+ },
9477
+ "404": {
9478
+ "description": "Schedule not found"
9479
+ }
9480
+ }
9481
+ }
9482
+ },
9483
+ "/api/script-connections": {
9484
+ "get": {
9485
+ "operationId": "script_connections_list",
9486
+ "summary": "List script connections",
9487
+ "description": "Dashboard read of OpenAPI, GraphQL, and MCP script connections with credential summaries.",
9488
+ "tags": [
9489
+ "Script Connections"
9490
+ ],
9491
+ "security": [
9492
+ {
9493
+ "bearerAuth": []
9494
+ }
9495
+ ],
9496
+ "parameters": [
9497
+ {
9498
+ "schema": {
9499
+ "type": "string",
9500
+ "enum": [
9501
+ "openapi",
9502
+ "graphql",
9503
+ "mcp"
9504
+ ]
9505
+ },
9506
+ "required": false,
9507
+ "name": "kind",
9508
+ "in": "query"
9509
+ },
9510
+ {
9511
+ "schema": {
9512
+ "type": "string",
9513
+ "enum": [
9514
+ "global",
9515
+ "agent",
9516
+ "repo"
9517
+ ]
9518
+ },
9519
+ "required": false,
9520
+ "name": "scope",
9521
+ "in": "query"
9522
+ },
9523
+ {
9524
+ "schema": {
9525
+ "type": "string"
9526
+ },
9527
+ "required": false,
9528
+ "name": "scopeId",
9529
+ "in": "query"
9530
+ }
9531
+ ],
9532
+ "responses": {
9533
+ "200": {
9534
+ "description": "Script connections"
9535
+ },
9536
+ "400": {
9537
+ "description": "Validation error"
9538
+ }
9539
+ }
9540
+ },
9541
+ "post": {
9542
+ "operationId": "script_connections_upsert",
9543
+ "summary": "Create or update a script connection",
9544
+ "tags": [
9545
+ "Script Connections"
9546
+ ],
9547
+ "security": [
9548
+ {
9549
+ "bearerAuth": []
9550
+ }
9551
+ ],
9552
+ "requestBody": {
9553
+ "content": {
9554
+ "application/json": {
9555
+ "schema": {
9556
+ "oneOf": [
9557
+ {
9558
+ "type": "object",
9559
+ "properties": {
9560
+ "id": {
9561
+ "type": "string",
9562
+ "format": "uuid"
9563
+ },
9564
+ "slug": {
9565
+ "type": "string",
9566
+ "minLength": 1,
9567
+ "maxLength": 80
9568
+ },
9569
+ "displayName": {
9570
+ "type": "string",
9571
+ "maxLength": 160
9572
+ },
9573
+ "scope": {
9574
+ "type": "string",
9575
+ "enum": [
9576
+ "global",
9577
+ "agent",
9578
+ "repo"
9579
+ ]
9580
+ },
9581
+ "scopeId": {
9582
+ "type": [
9583
+ "string",
9584
+ "null"
9585
+ ],
9586
+ "minLength": 1,
9587
+ "maxLength": 255
9588
+ },
9589
+ "allowedHosts": {
9590
+ "type": "array",
9591
+ "items": {
9592
+ "type": "string",
9593
+ "minLength": 1
9594
+ }
9595
+ },
9596
+ "credentialBindingId": {
9597
+ "type": [
9598
+ "string",
9599
+ "null"
9600
+ ],
9601
+ "format": "uuid"
9602
+ },
9603
+ "configKey": {
9604
+ "type": "string",
9605
+ "minLength": 1,
9606
+ "maxLength": 255
9607
+ },
9608
+ "headerTemplate": {
9609
+ "type": "string",
9610
+ "minLength": 1
9611
+ },
9612
+ "queryTemplate": {
9613
+ "type": "string",
9614
+ "minLength": 1
9615
+ },
9616
+ "authKind": {
9617
+ "type": "string",
9618
+ "enum": [
9619
+ "config",
9620
+ "oauth"
9621
+ ]
9622
+ },
9623
+ "oauthProvider": {
9624
+ "type": "string",
9625
+ "minLength": 1,
9626
+ "maxLength": 255,
9627
+ "pattern": "^[A-Za-z0-9_-]+$"
9628
+ },
9629
+ "enabled": {
9630
+ "type": "boolean"
9631
+ },
9632
+ "kind": {
9633
+ "type": "string",
9634
+ "enum": [
9635
+ "openapi"
9636
+ ]
9637
+ },
9638
+ "baseUrl": {
9639
+ "type": "string",
9640
+ "format": "uri"
9641
+ },
9642
+ "openapiSpecUrl": {
9643
+ "type": "string",
9644
+ "format": "uri"
9645
+ },
9646
+ "openapiSpecJson": {
9647
+ "type": "string"
9648
+ }
9649
+ },
9650
+ "required": [
9651
+ "slug",
9652
+ "kind",
9653
+ "baseUrl"
9654
+ ]
9655
+ },
9656
+ {
9657
+ "type": "object",
9658
+ "properties": {
9659
+ "id": {
9660
+ "type": "string",
9661
+ "format": "uuid"
9662
+ },
9663
+ "slug": {
9664
+ "type": "string",
9665
+ "minLength": 1,
9666
+ "maxLength": 80
9667
+ },
9668
+ "displayName": {
9669
+ "type": "string",
9670
+ "maxLength": 160
9671
+ },
9672
+ "scope": {
9673
+ "type": "string",
9674
+ "enum": [
9675
+ "global",
9676
+ "agent",
9677
+ "repo"
9678
+ ]
9679
+ },
9680
+ "scopeId": {
9681
+ "type": [
9682
+ "string",
9683
+ "null"
9684
+ ],
9685
+ "minLength": 1,
9686
+ "maxLength": 255
9687
+ },
9688
+ "allowedHosts": {
9689
+ "type": "array",
9690
+ "items": {
9691
+ "type": "string",
9692
+ "minLength": 1
9693
+ },
9694
+ "minItems": 1
9695
+ },
9696
+ "credentialBindingId": {
9697
+ "type": [
9698
+ "string",
9699
+ "null"
9700
+ ],
9701
+ "format": "uuid"
9702
+ },
9703
+ "configKey": {
9704
+ "type": "string",
9705
+ "minLength": 1,
9706
+ "maxLength": 255
9707
+ },
9708
+ "headerTemplate": {
9709
+ "type": "string",
9710
+ "minLength": 1
9711
+ },
9712
+ "queryTemplate": {
9713
+ "type": "string",
9714
+ "minLength": 1
9715
+ },
9716
+ "authKind": {
9717
+ "type": "string",
9718
+ "enum": [
9719
+ "config",
9720
+ "oauth"
9721
+ ]
9722
+ },
9723
+ "oauthProvider": {
9724
+ "type": "string",
9725
+ "minLength": 1,
9726
+ "maxLength": 255,
9727
+ "pattern": "^[A-Za-z0-9_-]+$"
9728
+ },
9729
+ "enabled": {
9730
+ "type": "boolean"
9731
+ },
9732
+ "kind": {
9733
+ "type": "string",
9734
+ "enum": [
9735
+ "graphql"
9736
+ ]
9737
+ },
9738
+ "baseUrl": {
9739
+ "type": "string",
9740
+ "format": "uri"
9741
+ }
9742
+ },
9743
+ "required": [
9744
+ "slug",
9745
+ "allowedHosts",
9746
+ "kind",
9747
+ "baseUrl"
9748
+ ]
9749
+ },
9750
+ {
9751
+ "type": "object",
9752
+ "properties": {
9753
+ "id": {
9754
+ "type": "string",
9755
+ "format": "uuid"
9756
+ },
9757
+ "slug": {
9758
+ "type": "string",
9759
+ "minLength": 1,
9760
+ "maxLength": 80
9761
+ },
9762
+ "displayName": {
9763
+ "type": "string",
9764
+ "maxLength": 160
9765
+ },
9766
+ "scope": {
9767
+ "type": "string",
9768
+ "enum": [
9769
+ "global",
9770
+ "agent",
9771
+ "repo"
9772
+ ]
9773
+ },
9774
+ "scopeId": {
9775
+ "type": [
9776
+ "string",
9777
+ "null"
9778
+ ],
9779
+ "minLength": 1,
9780
+ "maxLength": 255
9781
+ },
9782
+ "allowedHosts": {
9783
+ "type": "array",
9784
+ "items": {
9785
+ "type": "string",
9786
+ "minLength": 1
9787
+ }
9788
+ },
9789
+ "credentialBindingId": {
9790
+ "type": [
9791
+ "string",
9792
+ "null"
9793
+ ],
9794
+ "format": "uuid"
9795
+ },
9796
+ "configKey": {
9797
+ "type": "string",
9798
+ "minLength": 1,
9799
+ "maxLength": 255
9800
+ },
9801
+ "headerTemplate": {
9802
+ "type": "string",
9803
+ "minLength": 1
9804
+ },
9805
+ "queryTemplate": {
9806
+ "type": "string",
9807
+ "minLength": 1
9808
+ },
9809
+ "authKind": {
9810
+ "type": "string",
9811
+ "enum": [
9812
+ "config",
9813
+ "oauth"
9814
+ ]
9815
+ },
9816
+ "oauthProvider": {
9817
+ "type": "string",
9818
+ "minLength": 1,
9819
+ "maxLength": 255,
9820
+ "pattern": "^[A-Za-z0-9_-]+$"
9821
+ },
9822
+ "enabled": {
9823
+ "type": "boolean"
9824
+ },
9825
+ "kind": {
9826
+ "type": "string",
9827
+ "enum": [
9828
+ "mcp"
9829
+ ]
9830
+ },
9831
+ "mcpServerId": {
9832
+ "type": "string",
9833
+ "format": "uuid"
9834
+ }
9835
+ },
9836
+ "required": [
9837
+ "slug",
9838
+ "kind",
9839
+ "mcpServerId"
9840
+ ]
9841
+ }
9842
+ ]
9843
+ }
9844
+ }
9845
+ }
9846
+ },
9847
+ "responses": {
9848
+ "200": {
9849
+ "description": "Saved script connection"
9850
+ },
9851
+ "400": {
9852
+ "description": "Validation or generation error"
9853
+ },
9854
+ "403": {
9855
+ "description": "Only the lead agent can manage script connections"
9856
+ }
9857
+ }
9858
+ }
9859
+ },
9860
+ "/api/script-connections/{id}": {
9861
+ "get": {
9862
+ "operationId": "script_connections_get",
9863
+ "summary": "Get script connection detail",
9864
+ "tags": [
9865
+ "Script Connections"
9866
+ ],
9867
+ "security": [
9868
+ {
9869
+ "bearerAuth": []
9870
+ }
9871
+ ],
9872
+ "parameters": [
9873
+ {
9874
+ "schema": {
9875
+ "type": "string",
9876
+ "format": "uuid"
9877
+ },
9878
+ "required": true,
9879
+ "name": "id",
9880
+ "in": "path"
9881
+ }
9882
+ ],
9883
+ "responses": {
9884
+ "200": {
9885
+ "description": "Script connection detail"
9886
+ },
9887
+ "404": {
9888
+ "description": "Script connection not found"
9889
+ }
9890
+ }
9891
+ }
9892
+ },
9893
+ "/api/script-connections/{id}/refresh": {
9894
+ "post": {
9895
+ "operationId": "script_connections_refresh",
9896
+ "summary": "Refresh a script connection",
9897
+ "tags": [
9898
+ "Script Connections"
9899
+ ],
9900
+ "security": [
9901
+ {
9902
+ "bearerAuth": []
9903
+ }
9904
+ ],
9905
+ "parameters": [
9906
+ {
9907
+ "schema": {
9908
+ "type": "string",
9909
+ "format": "uuid"
9910
+ },
9911
+ "required": true,
9912
+ "name": "id",
9913
+ "in": "path"
9914
+ }
9915
+ ],
9916
+ "responses": {
9917
+ "200": {
9918
+ "description": "Refreshed script connection"
9919
+ },
9920
+ "400": {
9921
+ "description": "Connection cannot be refreshed"
9922
+ },
9923
+ "403": {
9924
+ "description": "Only the lead agent can manage script connections"
9925
+ },
9926
+ "404": {
9927
+ "description": "Script connection not found"
9928
+ }
9929
+ }
9930
+ }
9931
+ },
9932
+ "/api/script-connections/{id}/disable": {
9933
+ "post": {
9934
+ "operationId": "script_connections_set_enabled",
9935
+ "summary": "Enable or disable a script connection",
9936
+ "tags": [
9937
+ "Script Connections"
9938
+ ],
9939
+ "security": [
9940
+ {
9941
+ "bearerAuth": []
9942
+ }
9943
+ ],
9944
+ "parameters": [
9945
+ {
9946
+ "schema": {
9947
+ "type": "string",
9948
+ "format": "uuid"
9949
+ },
9950
+ "required": true,
9951
+ "name": "id",
9952
+ "in": "path"
9953
+ }
9954
+ ],
9955
+ "requestBody": {
9956
+ "content": {
9957
+ "application/json": {
9958
+ "schema": {
9959
+ "type": "object",
9960
+ "properties": {
9961
+ "enabled": {
9962
+ "type": "boolean"
9963
+ }
9964
+ },
9965
+ "required": [
9966
+ "enabled"
9967
+ ]
9968
+ }
9969
+ }
9970
+ }
9971
+ },
9972
+ "responses": {
9973
+ "200": {
9974
+ "description": "Updated script connection"
9975
+ },
9976
+ "403": {
9977
+ "description": "Only the lead agent can manage script connections"
9978
+ },
9979
+ "404": {
9980
+ "description": "Script connection not found"
9981
+ }
9982
+ }
9983
+ }
9984
+ },
9985
+ "/api/credential-bindings": {
9986
+ "get": {
9987
+ "operationId": "credential_bindings_list",
9988
+ "summary": "List script credential bindings",
9989
+ "tags": [
9990
+ "Script Connections"
9991
+ ],
9992
+ "security": [
9993
+ {
9994
+ "bearerAuth": []
9995
+ }
9996
+ ],
9997
+ "responses": {
9998
+ "200": {
9999
+ "description": "Credential bindings"
10000
+ }
10001
+ }
10002
+ },
10003
+ "post": {
10004
+ "operationId": "credential_bindings_upsert",
10005
+ "summary": "Create or update a script credential binding",
10006
+ "tags": [
10007
+ "Script Connections"
10008
+ ],
10009
+ "security": [
10010
+ {
10011
+ "bearerAuth": []
10012
+ }
10013
+ ],
10014
+ "requestBody": {
10015
+ "content": {
10016
+ "application/json": {
10017
+ "schema": {
10018
+ "type": "object",
10019
+ "properties": {
10020
+ "id": {
10021
+ "type": "string",
10022
+ "format": "uuid"
10023
+ },
10024
+ "configKey": {
10025
+ "type": "string",
10026
+ "minLength": 1,
10027
+ "maxLength": 255
10028
+ },
10029
+ "allowedHosts": {
10030
+ "type": "array",
10031
+ "items": {
10032
+ "type": "string",
10033
+ "minLength": 1
10034
+ },
10035
+ "minItems": 1
10036
+ },
10037
+ "headerTemplate": {
10038
+ "type": "string",
10039
+ "minLength": 1
10040
+ },
10041
+ "queryTemplate": {
10042
+ "type": "string",
10043
+ "minLength": 1
10044
+ },
10045
+ "scope": {
10046
+ "type": "string",
10047
+ "enum": [
10048
+ "global",
10049
+ "agent",
10050
+ "repo"
10051
+ ],
10052
+ "default": "global"
10053
+ },
10054
+ "scopeId": {
10055
+ "type": [
10056
+ "string",
10057
+ "null"
10058
+ ],
10059
+ "minLength": 1,
10060
+ "maxLength": 255
10061
+ },
10062
+ "active": {
10063
+ "type": "boolean",
10064
+ "default": true
10065
+ },
10066
+ "authKind": {
10067
+ "type": "string",
10068
+ "enum": [
10069
+ "config",
10070
+ "oauth"
10071
+ ],
10072
+ "default": "config"
10073
+ },
10074
+ "oauthProvider": {
10075
+ "type": "string",
10076
+ "minLength": 1,
10077
+ "maxLength": 255,
10078
+ "pattern": "^[A-Za-z0-9_-]+$"
10079
+ }
10080
+ },
10081
+ "required": [
10082
+ "configKey",
10083
+ "allowedHosts"
10084
+ ]
10085
+ }
10086
+ }
10087
+ }
10088
+ },
10089
+ "responses": {
10090
+ "200": {
10091
+ "description": "Saved credential binding"
10092
+ },
10093
+ "400": {
10094
+ "description": "Validation error"
10095
+ },
10096
+ "403": {
10097
+ "description": "Only the lead agent can manage script connections"
10098
+ }
10099
+ }
10100
+ }
10101
+ },
10102
+ "/api/oauth-apps": {
10103
+ "get": {
10104
+ "operationId": "oauth_apps_list",
10105
+ "summary": "List OAuth apps for script credential bindings",
10106
+ "tags": [
10107
+ "Script Connections"
10108
+ ],
10109
+ "security": [
10110
+ {
10111
+ "bearerAuth": []
10112
+ }
10113
+ ],
10114
+ "responses": {
10115
+ "200": {
10116
+ "description": "OAuth apps without client secrets"
10117
+ }
10118
+ }
10119
+ },
10120
+ "post": {
10121
+ "operationId": "oauth_apps_upsert",
10122
+ "summary": "Create or update an OAuth app for script credential bindings",
10123
+ "tags": [
10124
+ "Script Connections"
10125
+ ],
10126
+ "security": [
10127
+ {
10128
+ "bearerAuth": []
10129
+ }
10130
+ ],
10131
+ "requestBody": {
10132
+ "content": {
10133
+ "application/json": {
10134
+ "schema": {
10135
+ "type": "object",
10136
+ "properties": {
10137
+ "provider": {
10138
+ "type": "string",
10139
+ "minLength": 1,
10140
+ "maxLength": 255,
10141
+ "pattern": "^[A-Za-z0-9_-]+$"
10142
+ },
10143
+ "clientId": {
10144
+ "type": "string",
10145
+ "minLength": 1
10146
+ },
10147
+ "clientSecret": {
10148
+ "type": "string",
10149
+ "minLength": 1
10150
+ },
10151
+ "authorizeUrl": {
10152
+ "type": "string",
10153
+ "format": "uri"
10154
+ },
10155
+ "tokenUrl": {
10156
+ "type": "string",
10157
+ "format": "uri"
10158
+ },
10159
+ "scopes": {
10160
+ "type": "array",
10161
+ "items": {
10162
+ "type": "string",
10163
+ "minLength": 1
10164
+ },
10165
+ "default": []
10166
+ },
10167
+ "extraParams": {
10168
+ "type": "object",
10169
+ "additionalProperties": {
10170
+ "type": "string"
10171
+ }
10172
+ },
10173
+ "tokenAuthStyle": {
10174
+ "type": "string",
10175
+ "enum": [
10176
+ "body",
10177
+ "basic"
10178
+ ]
10179
+ },
10180
+ "tokenBodyFormat": {
10181
+ "type": "string",
10182
+ "enum": [
10183
+ "form",
10184
+ "json"
10185
+ ]
10186
+ }
10187
+ },
10188
+ "required": [
10189
+ "provider",
10190
+ "clientId",
10191
+ "authorizeUrl",
10192
+ "tokenUrl"
10193
+ ]
10194
+ }
10195
+ }
10196
+ }
10197
+ },
10198
+ "responses": {
10199
+ "200": {
10200
+ "description": "Saved OAuth app without client secret"
10201
+ },
10202
+ "400": {
10203
+ "description": "Validation error"
10204
+ },
10205
+ "403": {
10206
+ "description": "Only the lead agent can manage script connections"
10207
+ }
10208
+ }
10209
+ }
10210
+ },
10211
+ "/api/oauth-apps/discover": {
10212
+ "post": {
10213
+ "operationId": "oauth_apps_discover",
10214
+ "summary": "Discover OAuth endpoints from provider metadata",
10215
+ "tags": [
10216
+ "Script Connections"
10217
+ ],
10218
+ "security": [
10219
+ {
10220
+ "bearerAuth": []
10221
+ }
10222
+ ],
10223
+ "requestBody": {
10224
+ "content": {
10225
+ "application/json": {
10226
+ "schema": {
10227
+ "type": "object",
10228
+ "properties": {
10229
+ "url": {
10230
+ "type": "string",
10231
+ "format": "uri"
10232
+ }
10233
+ },
10234
+ "required": [
10235
+ "url"
10236
+ ]
10237
+ }
10238
+ }
10239
+ }
10240
+ },
10241
+ "responses": {
10242
+ "200": {
10243
+ "description": "Discovered OAuth metadata"
10244
+ },
10245
+ "400": {
10246
+ "description": "Discovery failed"
10247
+ },
10248
+ "403": {
10249
+ "description": "Only the lead agent can manage script connections"
10250
+ }
10251
+ }
10252
+ }
10253
+ },
10254
+ "/api/oauth-apps/{provider}": {
10255
+ "delete": {
10256
+ "operationId": "oauth_apps_delete",
10257
+ "summary": "Delete an OAuth app and its tokens",
10258
+ "tags": [
10259
+ "Script Connections"
10260
+ ],
10261
+ "security": [
10262
+ {
10263
+ "bearerAuth": []
10264
+ }
10265
+ ],
10266
+ "parameters": [
10267
+ {
10268
+ "schema": {
10269
+ "type": "string",
10270
+ "minLength": 1,
10271
+ "maxLength": 255,
10272
+ "pattern": "^[A-Za-z0-9_-]+$"
10273
+ },
10274
+ "required": true,
10275
+ "name": "provider",
10276
+ "in": "path"
10277
+ }
10278
+ ],
10279
+ "responses": {
10280
+ "200": {
10281
+ "description": "OAuth app deleted"
10282
+ },
10283
+ "403": {
10284
+ "description": "Only the lead agent can manage script connections"
10285
+ },
10286
+ "404": {
10287
+ "description": "OAuth app not found"
10288
+ }
10289
+ }
10290
+ }
10291
+ },
10292
+ "/api/oauth-apps/{provider}/authorize-url": {
10293
+ "post": {
10294
+ "operationId": "oauth_apps_authorize_url",
10295
+ "summary": "Build an OAuth authorization URL",
10296
+ "tags": [
10297
+ "Script Connections"
10298
+ ],
10299
+ "security": [
10300
+ {
10301
+ "bearerAuth": []
10302
+ }
10303
+ ],
10304
+ "parameters": [
10305
+ {
10306
+ "schema": {
10307
+ "type": "string",
10308
+ "minLength": 1,
10309
+ "maxLength": 255,
10310
+ "pattern": "^[A-Za-z0-9_-]+$"
10311
+ },
10312
+ "required": true,
10313
+ "name": "provider",
10314
+ "in": "path"
10315
+ }
10316
+ ],
9364
10317
  "responses": {
9365
10318
  "200": {
9366
- "description": "Schedule patched"
10319
+ "description": "OAuth authorization URL"
9367
10320
  },
9368
- "400": {
9369
- "description": "Validation error"
10321
+ "403": {
10322
+ "description": "Only the lead agent can manage script connections"
9370
10323
  },
9371
10324
  "404": {
9372
- "description": "Schedule not found"
10325
+ "description": "OAuth app not found"
10326
+ }
10327
+ }
10328
+ }
10329
+ },
10330
+ "/api/integrations-catalog": {
10331
+ "get": {
10332
+ "operationId": "integrations_catalog_list",
10333
+ "summary": "Proxy integrations.sh catalog entries",
10334
+ "tags": [
10335
+ "Script Connections"
10336
+ ],
10337
+ "security": [
10338
+ {
10339
+ "bearerAuth": []
10340
+ }
10341
+ ],
10342
+ "responses": {
10343
+ "200": {
10344
+ "description": "Integrations catalog entries"
9373
10345
  },
9374
- "409": {
9375
- "description": "Duplicate name"
10346
+ "502": {
10347
+ "description": "Catalog upstream unavailable"
9376
10348
  }
9377
10349
  }
9378
- },
10350
+ }
10351
+ },
10352
+ "/api/integrations-catalog/{domain}/surface": {
10353
+ "get": {
10354
+ "operationId": "integrations_catalog_surface",
10355
+ "summary": "Proxy integrations.sh per-domain surface details (trimmed for the Add Connection flow)",
10356
+ "tags": [
10357
+ "Script Connections"
10358
+ ],
10359
+ "security": [
10360
+ {
10361
+ "bearerAuth": []
10362
+ }
10363
+ ],
10364
+ "parameters": [
10365
+ {
10366
+ "schema": {
10367
+ "type": "string",
10368
+ "minLength": 1,
10369
+ "maxLength": 255,
10370
+ "pattern": "^[a-z0-9.-]+$/i"
10371
+ },
10372
+ "required": true,
10373
+ "name": "domain",
10374
+ "in": "path"
10375
+ }
10376
+ ],
10377
+ "responses": {
10378
+ "200": {
10379
+ "description": "Trimmed integration surface details for a domain"
10380
+ },
10381
+ "404": {
10382
+ "description": "No surface data for this domain"
10383
+ },
10384
+ "502": {
10385
+ "description": "Surface upstream unavailable"
10386
+ }
10387
+ }
10388
+ }
10389
+ },
10390
+ "/api/oauth-apps/{provider}/tokens": {
9379
10391
  "delete": {
9380
- "summary": "Delete a schedule",
10392
+ "operationId": "oauth_app_disconnect",
10393
+ "summary": "Disconnect an OAuth app: delete stored tokens (best-effort remote revocation when a revocation endpoint is known)",
9381
10394
  "tags": [
9382
- "Schedules"
10395
+ "Script Connections"
9383
10396
  ],
9384
10397
  "security": [
9385
10398
  {
@@ -9389,19 +10402,69 @@
9389
10402
  "parameters": [
9390
10403
  {
9391
10404
  "schema": {
9392
- "type": "string"
10405
+ "type": "string",
10406
+ "minLength": 1,
10407
+ "maxLength": 255,
10408
+ "pattern": "^[A-Za-z0-9_-]+$"
9393
10409
  },
9394
10410
  "required": true,
9395
- "name": "id",
10411
+ "name": "provider",
9396
10412
  "in": "path"
9397
10413
  }
9398
10414
  ],
9399
10415
  "responses": {
9400
10416
  "200": {
9401
- "description": "Schedule deleted"
10417
+ "description": "Disconnect result"
10418
+ },
10419
+ "403": {
10420
+ "description": "Only the lead agent can manage script connections"
9402
10421
  },
9403
10422
  "404": {
9404
- "description": "Schedule not found"
10423
+ "description": "OAuth app not found"
10424
+ }
10425
+ }
10426
+ }
10427
+ },
10428
+ "/api/oauth-apps/{provider}/refresh": {
10429
+ "post": {
10430
+ "operationId": "oauth_app_refresh_tokens",
10431
+ "summary": "Force-refresh the stored OAuth tokens for a provider (never returns token values)",
10432
+ "tags": [
10433
+ "Script Connections"
10434
+ ],
10435
+ "security": [
10436
+ {
10437
+ "bearerAuth": []
10438
+ }
10439
+ ],
10440
+ "parameters": [
10441
+ {
10442
+ "schema": {
10443
+ "type": "string",
10444
+ "minLength": 1,
10445
+ "maxLength": 255,
10446
+ "pattern": "^[A-Za-z0-9_-]+$"
10447
+ },
10448
+ "required": true,
10449
+ "name": "provider",
10450
+ "in": "path"
10451
+ }
10452
+ ],
10453
+ "responses": {
10454
+ "200": {
10455
+ "description": "Refresh result with token status and new expiry"
10456
+ },
10457
+ "400": {
10458
+ "description": "No stored tokens or provider does not support refresh"
10459
+ },
10460
+ "403": {
10461
+ "description": "Only the lead agent can manage script connections"
10462
+ },
10463
+ "404": {
10464
+ "description": "OAuth app not found"
10465
+ },
10466
+ "502": {
10467
+ "description": "Provider token endpoint rejected the refresh"
9405
10468
  }
9406
10469
  }
9407
10470
  }
@@ -9995,6 +11058,66 @@
9995
11058
  }
9996
11059
  }
9997
11060
  },
11061
+ "/api/script-connections/{id}/mcp-call": {
11062
+ "post": {
11063
+ "summary": "Invoke a tool on an MCP script connection",
11064
+ "tags": [
11065
+ "Script Connections"
11066
+ ],
11067
+ "security": [
11068
+ {
11069
+ "bearerAuth": []
11070
+ }
11071
+ ],
11072
+ "parameters": [
11073
+ {
11074
+ "schema": {
11075
+ "type": "string",
11076
+ "format": "uuid"
11077
+ },
11078
+ "required": true,
11079
+ "name": "id",
11080
+ "in": "path"
11081
+ }
11082
+ ],
11083
+ "requestBody": {
11084
+ "content": {
11085
+ "application/json": {
11086
+ "schema": {
11087
+ "type": "object",
11088
+ "properties": {
11089
+ "tool": {
11090
+ "type": "string",
11091
+ "minLength": 1
11092
+ },
11093
+ "arguments": {
11094
+ "type": "object",
11095
+ "additionalProperties": {}
11096
+ }
11097
+ },
11098
+ "required": [
11099
+ "tool"
11100
+ ]
11101
+ }
11102
+ }
11103
+ }
11104
+ },
11105
+ "responses": {
11106
+ "200": {
11107
+ "description": "MCP call result"
11108
+ },
11109
+ "400": {
11110
+ "description": "Invalid MCP connection or request"
11111
+ },
11112
+ "403": {
11113
+ "description": "Not allowed to invoke this MCP connection"
11114
+ },
11115
+ "404": {
11116
+ "description": "Script connection or agent not found"
11117
+ }
11118
+ }
11119
+ }
11120
+ },
9998
11121
  "/api/session-logs": {
9999
11122
  "post": {
10000
11123
  "summary": "Store session logs",
@@ -13290,6 +14413,15 @@
13290
14413
  "name": "createdAfter",
13291
14414
  "in": "query"
13292
14415
  },
14416
+ {
14417
+ "schema": {
14418
+ "type": "string",
14419
+ "format": "date-time"
14420
+ },
14421
+ "required": false,
14422
+ "name": "createdBefore",
14423
+ "in": "query"
14424
+ },
13293
14425
  {
13294
14426
  "schema": {
13295
14427
  "type": "string"
@@ -13298,6 +14430,18 @@
13298
14430
  "name": "source",
13299
14431
  "in": "query"
13300
14432
  },
14433
+ {
14434
+ "schema": {
14435
+ "type": "string",
14436
+ "enum": [
14437
+ "lastUpdatedAt",
14438
+ "createdAt"
14439
+ ]
14440
+ },
14441
+ "required": false,
14442
+ "name": "orderBy",
14443
+ "in": "query"
14444
+ },
13301
14445
  {
13302
14446
  "schema": {
13303
14447
  "type": [
@@ -13438,7 +14582,8 @@
13438
14582
  "low",
13439
14583
  "medium",
13440
14584
  "high",
13441
- "xhigh"
14585
+ "xhigh",
14586
+ "max"
13442
14587
  ]
13443
14588
  }
13444
14589
  },
@@ -15597,7 +16742,88 @@
15597
16742
  },
15598
16743
  "hmacHeader": {
15599
16744
  "type": "string",
15600
- "default": "X-Hub-Signature-256"
16745
+ "default": "X-Hub-Signature-256",
16746
+ "description": "Legacy HMAC header for webhook verification. Prefer verification.header for new workflows."
16747
+ },
16748
+ "verification": {
16749
+ "oneOf": [
16750
+ {
16751
+ "type": "object",
16752
+ "properties": {
16753
+ "format": {
16754
+ "type": "string",
16755
+ "enum": [
16756
+ "hmac-sha256"
16757
+ ]
16758
+ },
16759
+ "header": {
16760
+ "type": "string",
16761
+ "default": "X-Hub-Signature-256",
16762
+ "description": "Header containing HMAC-SHA256 over the raw request body. Accepts sha256=<hex> or bare hex."
16763
+ }
16764
+ },
16765
+ "required": [
16766
+ "format"
16767
+ ]
16768
+ },
16769
+ {
16770
+ "type": "object",
16771
+ "properties": {
16772
+ "format": {
16773
+ "type": "string",
16774
+ "enum": [
16775
+ "timestamped-hmac-sha256"
16776
+ ]
16777
+ },
16778
+ "header": {
16779
+ "type": "string",
16780
+ "minLength": 1,
16781
+ "description": "Header containing comma-separated timestamp/signature pairs such as t=<timestamp>,v1=<hex>."
16782
+ },
16783
+ "timestampKey": {
16784
+ "type": "string",
16785
+ "default": "t",
16786
+ "description": "Timestamp field key in the signature header"
16787
+ },
16788
+ "signatureKey": {
16789
+ "type": "string",
16790
+ "default": "v1",
16791
+ "description": "Signature field key in the signature header; multiple entries are allowed"
16792
+ },
16793
+ "toleranceSeconds": {
16794
+ "type": "integer",
16795
+ "exclusiveMinimum": 0,
16796
+ "default": 300,
16797
+ "description": "Maximum allowed clock skew, in seconds, for replay protection"
16798
+ }
16799
+ },
16800
+ "required": [
16801
+ "format",
16802
+ "header"
16803
+ ]
16804
+ },
16805
+ {
16806
+ "type": "object",
16807
+ "properties": {
16808
+ "format": {
16809
+ "type": "string",
16810
+ "enum": [
16811
+ "token-equality"
16812
+ ]
16813
+ },
16814
+ "header": {
16815
+ "type": "string",
16816
+ "minLength": 1,
16817
+ "description": "Header containing the shared token to compare"
16818
+ }
16819
+ },
16820
+ "required": [
16821
+ "format",
16822
+ "header"
16823
+ ]
16824
+ }
16825
+ ],
16826
+ "description": "Optional webhook verification format. Omit to keep legacy HMAC-SHA256 behavior with fallback header scanning."
15601
16827
  }
15602
16828
  },
15603
16829
  "required": [
@@ -15935,7 +17161,88 @@
15935
17161
  },
15936
17162
  "hmacHeader": {
15937
17163
  "type": "string",
15938
- "default": "X-Hub-Signature-256"
17164
+ "default": "X-Hub-Signature-256",
17165
+ "description": "Legacy HMAC header for webhook verification. Prefer verification.header for new workflows."
17166
+ },
17167
+ "verification": {
17168
+ "oneOf": [
17169
+ {
17170
+ "type": "object",
17171
+ "properties": {
17172
+ "format": {
17173
+ "type": "string",
17174
+ "enum": [
17175
+ "hmac-sha256"
17176
+ ]
17177
+ },
17178
+ "header": {
17179
+ "type": "string",
17180
+ "default": "X-Hub-Signature-256",
17181
+ "description": "Header containing HMAC-SHA256 over the raw request body. Accepts sha256=<hex> or bare hex."
17182
+ }
17183
+ },
17184
+ "required": [
17185
+ "format"
17186
+ ]
17187
+ },
17188
+ {
17189
+ "type": "object",
17190
+ "properties": {
17191
+ "format": {
17192
+ "type": "string",
17193
+ "enum": [
17194
+ "timestamped-hmac-sha256"
17195
+ ]
17196
+ },
17197
+ "header": {
17198
+ "type": "string",
17199
+ "minLength": 1,
17200
+ "description": "Header containing comma-separated timestamp/signature pairs such as t=<timestamp>,v1=<hex>."
17201
+ },
17202
+ "timestampKey": {
17203
+ "type": "string",
17204
+ "default": "t",
17205
+ "description": "Timestamp field key in the signature header"
17206
+ },
17207
+ "signatureKey": {
17208
+ "type": "string",
17209
+ "default": "v1",
17210
+ "description": "Signature field key in the signature header; multiple entries are allowed"
17211
+ },
17212
+ "toleranceSeconds": {
17213
+ "type": "integer",
17214
+ "exclusiveMinimum": 0,
17215
+ "default": 300,
17216
+ "description": "Maximum allowed clock skew, in seconds, for replay protection"
17217
+ }
17218
+ },
17219
+ "required": [
17220
+ "format",
17221
+ "header"
17222
+ ]
17223
+ },
17224
+ {
17225
+ "type": "object",
17226
+ "properties": {
17227
+ "format": {
17228
+ "type": "string",
17229
+ "enum": [
17230
+ "token-equality"
17231
+ ]
17232
+ },
17233
+ "header": {
17234
+ "type": "string",
17235
+ "minLength": 1,
17236
+ "description": "Header containing the shared token to compare"
17237
+ }
17238
+ },
17239
+ "required": [
17240
+ "format",
17241
+ "header"
17242
+ ]
17243
+ }
17244
+ ],
17245
+ "description": "Optional webhook verification format. Omit to keep legacy HMAC-SHA256 behavior with fallback header scanning."
15939
17246
  }
15940
17247
  },
15941
17248
  "required": [