@desplega.ai/agent-swarm 1.79.4 → 1.80.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 (130) hide show
  1. package/openapi.json +496 -32
  2. package/package.json +14 -6
  3. package/src/artifact-sdk/server.ts +2 -1
  4. package/src/be/db.ts +102 -31
  5. package/src/be/migrations/063_cost_context_schema_relax.sql +133 -0
  6. package/src/be/migrations/064_scripts.sql +39 -0
  7. package/src/be/migrations/065_script_embeddings.sql +7 -0
  8. package/src/be/pricing-normalize.ts +81 -0
  9. package/src/be/scripts/db.ts +391 -0
  10. package/src/be/scripts/embeddings.ts +231 -0
  11. package/src/be/scripts/maintenance.ts +9 -0
  12. package/src/be/scripts/typecheck.ts +193 -0
  13. package/src/be/seed-pricing.ts +293 -0
  14. package/src/cli.tsx +22 -5
  15. package/src/commands/artifact.ts +3 -2
  16. package/src/commands/claude-managed-setup.ts +21 -4
  17. package/src/commands/codex-login.ts +5 -3
  18. package/src/commands/onboard.tsx +2 -1
  19. package/src/commands/runner.ts +663 -246
  20. package/src/commands/setup.tsx +5 -3
  21. package/src/hooks/hook.ts +4 -3
  22. package/src/http/context.ts +6 -2
  23. package/src/http/index.ts +126 -68
  24. package/src/http/memory.ts +28 -0
  25. package/src/http/openapi.ts +1 -0
  26. package/src/http/page-proxy.ts +2 -1
  27. package/src/http/route-def.ts +1 -0
  28. package/src/http/schedules.ts +37 -0
  29. package/src/http/scripts.ts +381 -0
  30. package/src/http/session-data.ts +74 -23
  31. package/src/linear/outbound.ts +9 -2
  32. package/src/otel-impl.ts +200 -0
  33. package/src/otel.ts +132 -0
  34. package/src/providers/claude-adapter.ts +52 -6
  35. package/src/providers/claude-managed-adapter.ts +43 -17
  36. package/src/providers/claude-managed-pricing.ts +34 -0
  37. package/src/providers/codex-adapter.ts +38 -27
  38. package/src/providers/codex-models.ts +22 -3
  39. package/src/providers/devin-adapter.ts +11 -0
  40. package/src/providers/opencode-adapter.ts +31 -7
  41. package/src/providers/pi-mono-adapter.ts +39 -7
  42. package/src/providers/pricing-sources.md +52 -0
  43. package/src/providers/swarm-events-shared.ts +8 -4
  44. package/src/providers/types.ts +33 -10
  45. package/src/scripts-runtime/ctx.ts +23 -0
  46. package/src/scripts-runtime/eval-harness.ts +39 -0
  47. package/src/scripts-runtime/executors/native.ts +229 -0
  48. package/src/scripts-runtime/executors/registry.ts +16 -0
  49. package/src/scripts-runtime/executors/types.ts +63 -0
  50. package/src/scripts-runtime/extract-signature.ts +81 -0
  51. package/src/scripts-runtime/import-allowlist.ts +109 -0
  52. package/src/scripts-runtime/loader.ts +96 -0
  53. package/src/scripts-runtime/redacted.ts +48 -0
  54. package/src/scripts-runtime/sdk-allowlist.ts +29 -0
  55. package/src/scripts-runtime/stdlib/fetch.ts +46 -0
  56. package/src/scripts-runtime/stdlib/glob.ts +8 -0
  57. package/src/scripts-runtime/stdlib/grep.ts +34 -0
  58. package/src/scripts-runtime/stdlib/index.ts +16 -0
  59. package/src/scripts-runtime/stdlib/table.ts +17 -0
  60. package/src/scripts-runtime/swarm-config.ts +35 -0
  61. package/src/scripts-runtime/swarm-sdk.ts +197 -0
  62. package/src/scripts-runtime/types/stdlib.d.ts +104 -0
  63. package/src/scripts-runtime/types/swarm-sdk.d.ts +86 -0
  64. package/src/server.ts +18 -0
  65. package/src/tests/api-key.test.ts +33 -0
  66. package/src/tests/claude-managed-adapter.test.ts +17 -3
  67. package/src/tests/claude-managed-setup.test.ts +10 -1
  68. package/src/tests/codex-adapter.test.ts +20 -19
  69. package/src/tests/codex-login.test.ts +1 -1
  70. package/src/tests/context-snapshot.test.ts +2 -2
  71. package/src/tests/context-window.test.ts +65 -1
  72. package/src/tests/devin-adapter.test.ts +2 -0
  73. package/src/tests/http/context-routes.test.ts +161 -0
  74. package/src/tests/linear-outbound-sync.test.ts +109 -0
  75. package/src/tests/mcp-tools.test.ts +69 -0
  76. package/src/tests/migration-063-schema-relax.test.ts +109 -0
  77. package/src/tests/opencode-adapter.test.ts +146 -1
  78. package/src/tests/otel-impl-secret-scrubbing.test.ts +33 -0
  79. package/src/tests/pages-view-count.test.ts +30 -5
  80. package/src/tests/providers/codex-cost.test.ts +18 -0
  81. package/src/tests/providers/opencode-cost.test.ts +74 -0
  82. package/src/tests/providers/pi-cost.test.ts +128 -0
  83. package/src/tests/redacted.test.ts +29 -0
  84. package/src/tests/runner-tool-spans.test.ts +268 -0
  85. package/src/tests/script-executor-conformance.test.ts +142 -0
  86. package/src/tests/script-executor-registry.test.ts +17 -0
  87. package/src/tests/scripts-db.test.ts +329 -0
  88. package/src/tests/scripts-embeddings.test.ts +291 -0
  89. package/src/tests/scripts-extract-signature.test.ts +47 -0
  90. package/src/tests/scripts-http.test.ts +350 -0
  91. package/src/tests/scripts-import-allowlist.test.ts +55 -0
  92. package/src/tests/scripts-mcp-e2e.test.ts +269 -0
  93. package/src/tests/scripts-runtime-secret-egress.test.ts +44 -0
  94. package/src/tests/scripts-runtime.test.ts +289 -0
  95. package/src/tests/sdk-allowlist.test.ts +59 -0
  96. package/src/tests/secret-scrubber.test.ts +54 -1
  97. package/src/tests/session-costs-codex-recompute.test.ts +35 -22
  98. package/src/tests/session-costs-model-key-normalize.test.ts +271 -0
  99. package/src/tests/session-costs-recompute-all-providers.test.ts +170 -0
  100. package/src/tests/store-progress-cost.test.ts +6 -1
  101. package/src/tests/swarm-config.test.ts +38 -0
  102. package/src/tests/tool-annotations.test.ts +2 -2
  103. package/src/tests/tool-call-progress.test.ts +30 -0
  104. package/src/tests/workflow-e2e.test.ts +218 -0
  105. package/src/tests/workflow-executors.test.ts +32 -2
  106. package/src/tests/workflow-input-redaction.test.ts +232 -0
  107. package/src/tests/workflow-swarm-script.test.ts +273 -0
  108. package/src/tools/memory-rate.ts +2 -1
  109. package/src/tools/script-common.ts +88 -0
  110. package/src/tools/script-delete.ts +35 -0
  111. package/src/tools/script-query-types.ts +37 -0
  112. package/src/tools/script-run.ts +43 -0
  113. package/src/tools/script-search.ts +32 -0
  114. package/src/tools/script-upsert.ts +43 -0
  115. package/src/tools/store-progress.ts +16 -60
  116. package/src/tools/tool-config.ts +7 -0
  117. package/src/tools/utils.ts +65 -12
  118. package/src/types.ts +122 -10
  119. package/src/utils/api-key.ts +28 -0
  120. package/src/utils/context-window.ts +104 -4
  121. package/src/utils/page-session.ts +8 -6
  122. package/src/utils/secret-scrubber.ts +29 -1
  123. package/src/workflows/engine.ts +12 -4
  124. package/src/workflows/executors/index.ts +1 -0
  125. package/src/workflows/executors/registry.ts +2 -0
  126. package/src/workflows/executors/script.ts +12 -1
  127. package/src/workflows/executors/swarm-script.ts +170 -0
  128. package/src/workflows/input.ts +65 -0
  129. package/src/workflows/recovery.ts +31 -3
  130. package/src/workflows/resume.ts +43 -5
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.79.4",
5
+ "version": "1.80.1",
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": [
@@ -2147,7 +2147,8 @@
2147
2147
  "type": "string",
2148
2148
  "enum": [
2149
2149
  "auto",
2150
- "manual"
2150
+ "manual",
2151
+ "auto-inferred"
2151
2152
  ]
2152
2153
  },
2153
2154
  "preCompactTokens": {
@@ -2161,6 +2162,18 @@
2161
2162
  "cumulativeOutputTokens": {
2162
2163
  "type": "integer",
2163
2164
  "minimum": 0
2165
+ },
2166
+ "contextFormula": {
2167
+ "type": "string",
2168
+ "enum": [
2169
+ "input-cache-output",
2170
+ "input-cache-no-output",
2171
+ "input-output-no-cache",
2172
+ "peak-proxy",
2173
+ "pi-delegated",
2174
+ "harness-reported",
2175
+ "unknown"
2176
+ ]
2164
2177
  }
2165
2178
  },
2166
2179
  "required": [
@@ -2702,7 +2715,8 @@
2702
2715
  "workflow.run.end",
2703
2716
  "system.boot",
2704
2717
  "system.migration",
2705
- "system.error"
2718
+ "system.error",
2719
+ "script.global_upsert"
2706
2720
  ]
2707
2721
  },
2708
2722
  "status": {
@@ -2816,7 +2830,8 @@
2816
2830
  "workflow.run.end",
2817
2831
  "system.boot",
2818
2832
  "system.migration",
2819
- "system.error"
2833
+ "system.error",
2834
+ "script.global_upsert"
2820
2835
  ]
2821
2836
  },
2822
2837
  "required": false,
@@ -2966,7 +2981,8 @@
2966
2981
  "workflow.run.end",
2967
2982
  "system.boot",
2968
2983
  "system.migration",
2969
- "system.error"
2984
+ "system.error",
2985
+ "script.global_upsert"
2970
2986
  ]
2971
2987
  },
2972
2988
  "status": {
@@ -4159,6 +4175,36 @@
4159
4175
  "description": "Memory not found"
4160
4176
  }
4161
4177
  }
4178
+ },
4179
+ "get": {
4180
+ "summary": "Get a single memory by ID",
4181
+ "tags": [
4182
+ "Memory"
4183
+ ],
4184
+ "security": [
4185
+ {
4186
+ "bearerAuth": []
4187
+ }
4188
+ ],
4189
+ "parameters": [
4190
+ {
4191
+ "schema": {
4192
+ "type": "string",
4193
+ "format": "uuid"
4194
+ },
4195
+ "required": true,
4196
+ "name": "id",
4197
+ "in": "path"
4198
+ }
4199
+ ],
4200
+ "responses": {
4201
+ "200": {
4202
+ "description": "Memory details"
4203
+ },
4204
+ "404": {
4205
+ "description": "Memory not found"
4206
+ }
4207
+ }
4162
4208
  }
4163
4209
  },
4164
4210
  "/api/memory/rate": {
@@ -5393,8 +5439,12 @@
5393
5439
  "type": "string",
5394
5440
  "enum": [
5395
5441
  "claude",
5442
+ "claude-managed",
5396
5443
  "codex",
5397
- "pi"
5444
+ "pi",
5445
+ "opencode",
5446
+ "devin",
5447
+ "gemini"
5398
5448
  ]
5399
5449
  },
5400
5450
  "model": {
@@ -5405,7 +5455,10 @@
5405
5455
  "enum": [
5406
5456
  "input",
5407
5457
  "cached_input",
5408
- "output"
5458
+ "output",
5459
+ "cache_write",
5460
+ "runtime_hour",
5461
+ "acu"
5409
5462
  ]
5410
5463
  },
5411
5464
  "effectiveFrom": {
@@ -5462,8 +5515,12 @@
5462
5515
  "type": "string",
5463
5516
  "enum": [
5464
5517
  "claude",
5518
+ "claude-managed",
5465
5519
  "codex",
5466
- "pi"
5520
+ "pi",
5521
+ "opencode",
5522
+ "devin",
5523
+ "gemini"
5467
5524
  ]
5468
5525
  },
5469
5526
  "required": true,
@@ -5485,7 +5542,10 @@
5485
5542
  "enum": [
5486
5543
  "input",
5487
5544
  "cached_input",
5488
- "output"
5545
+ "output",
5546
+ "cache_write",
5547
+ "runtime_hour",
5548
+ "acu"
5489
5549
  ]
5490
5550
  },
5491
5551
  "required": true,
@@ -5515,8 +5575,12 @@
5515
5575
  "type": "string",
5516
5576
  "enum": [
5517
5577
  "claude",
5578
+ "claude-managed",
5518
5579
  "codex",
5519
- "pi"
5580
+ "pi",
5581
+ "opencode",
5582
+ "devin",
5583
+ "gemini"
5520
5584
  ]
5521
5585
  },
5522
5586
  "required": true,
@@ -5538,7 +5602,10 @@
5538
5602
  "enum": [
5539
5603
  "input",
5540
5604
  "cached_input",
5541
- "output"
5605
+ "output",
5606
+ "cache_write",
5607
+ "runtime_hour",
5608
+ "acu"
5542
5609
  ]
5543
5610
  },
5544
5611
  "required": true,
@@ -5580,8 +5647,12 @@
5580
5647
  "type": "string",
5581
5648
  "enum": [
5582
5649
  "claude",
5650
+ "claude-managed",
5583
5651
  "codex",
5584
- "pi"
5652
+ "pi",
5653
+ "opencode",
5654
+ "devin",
5655
+ "gemini"
5585
5656
  ]
5586
5657
  },
5587
5658
  "model": {
@@ -5592,7 +5663,10 @@
5592
5663
  "enum": [
5593
5664
  "input",
5594
5665
  "cached_input",
5595
- "output"
5666
+ "output",
5667
+ "cache_write",
5668
+ "runtime_hour",
5669
+ "acu"
5596
5670
  ]
5597
5671
  },
5598
5672
  "effectiveFrom": {
@@ -5649,8 +5723,12 @@
5649
5723
  "type": "string",
5650
5724
  "enum": [
5651
5725
  "claude",
5726
+ "claude-managed",
5652
5727
  "codex",
5653
- "pi"
5728
+ "pi",
5729
+ "opencode",
5730
+ "devin",
5731
+ "gemini"
5654
5732
  ]
5655
5733
  },
5656
5734
  "required": true,
@@ -5672,7 +5750,10 @@
5672
5750
  "enum": [
5673
5751
  "input",
5674
5752
  "cached_input",
5675
- "output"
5753
+ "output",
5754
+ "cache_write",
5755
+ "runtime_hour",
5756
+ "acu"
5676
5757
  ]
5677
5758
  },
5678
5759
  "required": true,
@@ -5692,8 +5773,12 @@
5692
5773
  "type": "string",
5693
5774
  "enum": [
5694
5775
  "claude",
5776
+ "claude-managed",
5695
5777
  "codex",
5696
- "pi"
5778
+ "pi",
5779
+ "opencode",
5780
+ "devin",
5781
+ "gemini"
5697
5782
  ]
5698
5783
  },
5699
5784
  "model": {
@@ -5704,7 +5789,10 @@
5704
5789
  "enum": [
5705
5790
  "input",
5706
5791
  "cached_input",
5707
- "output"
5792
+ "output",
5793
+ "cache_write",
5794
+ "runtime_hour",
5795
+ "acu"
5708
5796
  ]
5709
5797
  },
5710
5798
  "effectiveFrom": {
@@ -5758,8 +5846,12 @@
5758
5846
  "type": "string",
5759
5847
  "enum": [
5760
5848
  "claude",
5849
+ "claude-managed",
5761
5850
  "codex",
5762
- "pi"
5851
+ "pi",
5852
+ "opencode",
5853
+ "devin",
5854
+ "gemini"
5763
5855
  ]
5764
5856
  },
5765
5857
  "required": true,
@@ -5781,7 +5873,10 @@
5781
5873
  "enum": [
5782
5874
  "input",
5783
5875
  "cached_input",
5784
- "output"
5876
+ "output",
5877
+ "cache_write",
5878
+ "runtime_hour",
5879
+ "acu"
5785
5880
  ]
5786
5881
  },
5787
5882
  "required": true,
@@ -6633,6 +6728,68 @@
6633
6728
  "description": "Duplicate name"
6634
6729
  }
6635
6730
  }
6731
+ },
6732
+ "get": {
6733
+ "summary": "List schedules",
6734
+ "tags": [
6735
+ "Schedules"
6736
+ ],
6737
+ "security": [
6738
+ {
6739
+ "bearerAuth": []
6740
+ }
6741
+ ],
6742
+ "parameters": [
6743
+ {
6744
+ "schema": {
6745
+ "type": "string",
6746
+ "enum": [
6747
+ "true",
6748
+ "false"
6749
+ ]
6750
+ },
6751
+ "required": false,
6752
+ "name": "enabled",
6753
+ "in": "query"
6754
+ },
6755
+ {
6756
+ "schema": {
6757
+ "type": "string"
6758
+ },
6759
+ "required": false,
6760
+ "name": "name",
6761
+ "in": "query"
6762
+ },
6763
+ {
6764
+ "schema": {
6765
+ "type": "string",
6766
+ "enum": [
6767
+ "recurring",
6768
+ "one_time"
6769
+ ]
6770
+ },
6771
+ "required": false,
6772
+ "name": "scheduleType",
6773
+ "in": "query"
6774
+ },
6775
+ {
6776
+ "schema": {
6777
+ "type": "string",
6778
+ "enum": [
6779
+ "true",
6780
+ "false"
6781
+ ]
6782
+ },
6783
+ "required": false,
6784
+ "name": "hideCompleted",
6785
+ "in": "query"
6786
+ }
6787
+ ],
6788
+ "responses": {
6789
+ "200": {
6790
+ "description": "List of schedules"
6791
+ }
6792
+ }
6636
6793
  }
6637
6794
  },
6638
6795
  "/api/schedules/{id}/run": {
@@ -6951,13 +7108,27 @@
6951
7108
  "type": "integer"
6952
7109
  },
6953
7110
  "cacheWriteTokens": {
6954
- "type": "integer"
7111
+ "type": [
7112
+ "integer",
7113
+ "null"
7114
+ ]
7115
+ },
7116
+ "reasoningOutputTokens": {
7117
+ "type": "integer",
7118
+ "minimum": 0
7119
+ },
7120
+ "thinkingTokens": {
7121
+ "type": "integer",
7122
+ "minimum": 0
6955
7123
  },
6956
7124
  "durationMs": {
6957
7125
  "type": "integer"
6958
7126
  },
6959
7127
  "numTurns": {
6960
- "type": "integer"
7128
+ "type": [
7129
+ "integer",
7130
+ "null"
7131
+ ]
6961
7132
  },
6962
7133
  "model": {
6963
7134
  "type": "string"
@@ -6969,9 +7140,12 @@
6969
7140
  "type": "string",
6970
7141
  "enum": [
6971
7142
  "claude",
7143
+ "claude-managed",
6972
7144
  "codex",
6973
7145
  "pi",
6974
- "opencode"
7146
+ "opencode",
7147
+ "devin",
7148
+ "gemini"
6975
7149
  ]
6976
7150
  },
6977
7151
  "createdAt": {
@@ -7647,6 +7821,296 @@
7647
7821
  }
7648
7822
  }
7649
7823
  },
7824
+ "/api/scripts/upsert": {
7825
+ "post": {
7826
+ "operationId": "scripts_upsert",
7827
+ "summary": "Create or update a reusable script",
7828
+ "description": "Explicit script upserts run a TypeScript typecheck before writing.",
7829
+ "tags": [
7830
+ "Scripts"
7831
+ ],
7832
+ "security": [
7833
+ {
7834
+ "bearerAuth": []
7835
+ }
7836
+ ],
7837
+ "requestBody": {
7838
+ "content": {
7839
+ "application/json": {
7840
+ "schema": {
7841
+ "type": "object",
7842
+ "properties": {
7843
+ "name": {
7844
+ "type": "string",
7845
+ "minLength": 1,
7846
+ "maxLength": 200
7847
+ },
7848
+ "source": {
7849
+ "type": "string",
7850
+ "minLength": 1
7851
+ },
7852
+ "description": {
7853
+ "type": "string",
7854
+ "default": ""
7855
+ },
7856
+ "intent": {
7857
+ "type": "string",
7858
+ "default": ""
7859
+ },
7860
+ "scope": {
7861
+ "type": "string",
7862
+ "enum": [
7863
+ "global",
7864
+ "agent"
7865
+ ],
7866
+ "default": "agent"
7867
+ },
7868
+ "fsMode": {
7869
+ "type": "string",
7870
+ "enum": [
7871
+ "none",
7872
+ "workspace-rw"
7873
+ ],
7874
+ "default": "none"
7875
+ }
7876
+ },
7877
+ "required": [
7878
+ "name",
7879
+ "source"
7880
+ ]
7881
+ }
7882
+ }
7883
+ }
7884
+ },
7885
+ "responses": {
7886
+ "200": {
7887
+ "description": "Script upserted"
7888
+ },
7889
+ "400": {
7890
+ "description": "Validation or typecheck failure"
7891
+ },
7892
+ "403": {
7893
+ "description": "Global write requires lead agent"
7894
+ }
7895
+ }
7896
+ }
7897
+ },
7898
+ "/api/scripts/run": {
7899
+ "post": {
7900
+ "operationId": "scripts_run",
7901
+ "summary": "Run a reusable or inline script",
7902
+ "description": "Inline source skips typecheck and is auto-saved as a scratch script only on success.",
7903
+ "tags": [
7904
+ "Scripts"
7905
+ ],
7906
+ "security": [
7907
+ {
7908
+ "bearerAuth": []
7909
+ }
7910
+ ],
7911
+ "requestBody": {
7912
+ "content": {
7913
+ "application/json": {
7914
+ "schema": {
7915
+ "type": "object",
7916
+ "properties": {
7917
+ "name": {
7918
+ "type": "string",
7919
+ "minLength": 1,
7920
+ "maxLength": 200
7921
+ },
7922
+ "source": {
7923
+ "type": "string",
7924
+ "minLength": 1
7925
+ },
7926
+ "args": {},
7927
+ "intent": {
7928
+ "type": "string",
7929
+ "default": ""
7930
+ },
7931
+ "scope": {
7932
+ "type": "string",
7933
+ "enum": [
7934
+ "global",
7935
+ "agent"
7936
+ ]
7937
+ },
7938
+ "fsMode": {
7939
+ "type": "string",
7940
+ "enum": [
7941
+ "none",
7942
+ "workspace-rw"
7943
+ ],
7944
+ "default": "none"
7945
+ }
7946
+ }
7947
+ }
7948
+ }
7949
+ }
7950
+ },
7951
+ "responses": {
7952
+ "200": {
7953
+ "description": "Script run completed"
7954
+ },
7955
+ "400": {
7956
+ "description": "Validation error"
7957
+ },
7958
+ "404": {
7959
+ "description": "Script not found"
7960
+ },
7961
+ "501": {
7962
+ "description": "workspace-rw scripts are not supported in v1"
7963
+ }
7964
+ }
7965
+ }
7966
+ },
7967
+ "/api/scripts/search": {
7968
+ "post": {
7969
+ "operationId": "scripts_search",
7970
+ "summary": "Search reusable scripts",
7971
+ "description": "Phase 3 search is substring-only over script name and metadata.",
7972
+ "tags": [
7973
+ "Scripts"
7974
+ ],
7975
+ "security": [
7976
+ {
7977
+ "bearerAuth": []
7978
+ }
7979
+ ],
7980
+ "requestBody": {
7981
+ "content": {
7982
+ "application/json": {
7983
+ "schema": {
7984
+ "type": "object",
7985
+ "properties": {
7986
+ "query": {
7987
+ "type": "string",
7988
+ "default": ""
7989
+ },
7990
+ "scope": {
7991
+ "type": "string",
7992
+ "enum": [
7993
+ "global",
7994
+ "agent"
7995
+ ]
7996
+ },
7997
+ "limit": {
7998
+ "type": "integer",
7999
+ "minimum": 1,
8000
+ "maximum": 100,
8001
+ "default": 10
8002
+ }
8003
+ }
8004
+ }
8005
+ }
8006
+ }
8007
+ },
8008
+ "responses": {
8009
+ "200": {
8010
+ "description": "Matching scripts"
8011
+ },
8012
+ "400": {
8013
+ "description": "Validation error"
8014
+ }
8015
+ }
8016
+ }
8017
+ },
8018
+ "/api/scripts/{name}": {
8019
+ "delete": {
8020
+ "operationId": "scripts_delete",
8021
+ "summary": "Delete a reusable script",
8022
+ "tags": [
8023
+ "Scripts"
8024
+ ],
8025
+ "security": [
8026
+ {
8027
+ "bearerAuth": []
8028
+ }
8029
+ ],
8030
+ "parameters": [
8031
+ {
8032
+ "schema": {
8033
+ "type": "string",
8034
+ "minLength": 1,
8035
+ "maxLength": 200
8036
+ },
8037
+ "required": true,
8038
+ "name": "name",
8039
+ "in": "path"
8040
+ },
8041
+ {
8042
+ "schema": {
8043
+ "type": "string",
8044
+ "enum": [
8045
+ "global",
8046
+ "agent"
8047
+ ],
8048
+ "default": "agent"
8049
+ },
8050
+ "required": false,
8051
+ "name": "scope",
8052
+ "in": "query"
8053
+ }
8054
+ ],
8055
+ "responses": {
8056
+ "200": {
8057
+ "description": "Delete result"
8058
+ },
8059
+ "400": {
8060
+ "description": "Validation error"
8061
+ },
8062
+ "403": {
8063
+ "description": "Global delete requires lead agent"
8064
+ }
8065
+ }
8066
+ }
8067
+ },
8068
+ "/api/scripts/{name}/types": {
8069
+ "get": {
8070
+ "operationId": "scripts_types",
8071
+ "summary": "Get script signature and authoring types",
8072
+ "tags": [
8073
+ "Scripts"
8074
+ ],
8075
+ "security": [
8076
+ {
8077
+ "bearerAuth": []
8078
+ }
8079
+ ],
8080
+ "parameters": [
8081
+ {
8082
+ "schema": {
8083
+ "type": "string",
8084
+ "minLength": 1,
8085
+ "maxLength": 200
8086
+ },
8087
+ "required": true,
8088
+ "name": "name",
8089
+ "in": "path"
8090
+ },
8091
+ {
8092
+ "schema": {
8093
+ "type": "string",
8094
+ "enum": [
8095
+ "global",
8096
+ "agent"
8097
+ ]
8098
+ },
8099
+ "required": false,
8100
+ "name": "scope",
8101
+ "in": "query"
8102
+ }
8103
+ ],
8104
+ "responses": {
8105
+ "200": {
8106
+ "description": "Script signature and type blobs"
8107
+ },
8108
+ "404": {
8109
+ "description": "Script not found"
8110
+ }
8111
+ }
8112
+ }
8113
+ },
7650
8114
  "/api/mcp-oauth/{mcpServerId}/metadata": {
7651
8115
  "get": {
7652
8116
  "summary": "Probe OAuth metadata (PRMD + AS) for an MCP server",
@@ -10344,7 +10808,7 @@
10344
10808
  },
10345
10809
  "type": {
10346
10810
  "type": "string",
10347
- "description": "Executor type: 'agent-task', 'script', 'raw-llm', 'validate', 'property-match'"
10811
+ "description": "Executor type: 'agent-task', 'script', 'swarm-script', 'raw-llm', 'validate', 'property-match'"
10348
10812
  },
10349
10813
  "label": {
10350
10814
  "type": "string",
@@ -10353,7 +10817,7 @@
10353
10817
  "config": {
10354
10818
  "type": "object",
10355
10819
  "additionalProperties": {},
10356
- "description": "Executor-specific config. For agent-task: { template, outputSchema?, agentId?, tags?, priority?, dir?, vcsRepo?, model? }. Values support {{interpolation}} from the node's inputs context. NOTE: config.outputSchema on agent-task nodes validates the AGENT's raw JSON output, while node-level outputSchema validates the EXECUTOR's return value ({taskId, taskOutput})."
10820
+ "description": "Executor-specific config. For agent-task: { template, outputSchema?, agentId?, tags?, priority?, dir?, vcsRepo?, model? }. For swarm-script: { scriptName, scope?, pinHash?, args?, fsMode? }. Values support {{interpolation}} from the node's inputs context. NOTE: config.outputSchema on agent-task nodes validates the AGENT's raw JSON output, while node-level outputSchema validates the EXECUTOR's return value ({taskId, taskOutput})."
10357
10821
  },
10358
10822
  "next": {
10359
10823
  "anyOf": [
@@ -10682,7 +11146,7 @@
10682
11146
  },
10683
11147
  "type": {
10684
11148
  "type": "string",
10685
- "description": "Executor type: 'agent-task', 'script', 'raw-llm', 'validate', 'property-match'"
11149
+ "description": "Executor type: 'agent-task', 'script', 'swarm-script', 'raw-llm', 'validate', 'property-match'"
10686
11150
  },
10687
11151
  "label": {
10688
11152
  "type": "string",
@@ -10691,7 +11155,7 @@
10691
11155
  "config": {
10692
11156
  "type": "object",
10693
11157
  "additionalProperties": {},
10694
- "description": "Executor-specific config. For agent-task: { template, outputSchema?, agentId?, tags?, priority?, dir?, vcsRepo?, model? }. Values support {{interpolation}} from the node's inputs context. NOTE: config.outputSchema on agent-task nodes validates the AGENT's raw JSON output, while node-level outputSchema validates the EXECUTOR's return value ({taskId, taskOutput})."
11158
+ "description": "Executor-specific config. For agent-task: { template, outputSchema?, agentId?, tags?, priority?, dir?, vcsRepo?, model? }. For swarm-script: { scriptName, scope?, pinHash?, args?, fsMode? }. Values support {{interpolation}} from the node's inputs context. NOTE: config.outputSchema on agent-task nodes validates the AGENT's raw JSON output, while node-level outputSchema validates the EXECUTOR's return value ({taskId, taskOutput})."
10695
11159
  },
10696
11160
  "next": {
10697
11161
  "anyOf": [
@@ -11000,7 +11464,7 @@
11000
11464
  "properties": {
11001
11465
  "type": {
11002
11466
  "type": "string",
11003
- "description": "Executor type: 'agent-task', 'script', 'raw-llm', 'validate', 'property-match'"
11467
+ "description": "Executor type: 'agent-task', 'script', 'swarm-script', 'raw-llm', 'validate', 'property-match'"
11004
11468
  },
11005
11469
  "label": {
11006
11470
  "type": "string",
@@ -11009,7 +11473,7 @@
11009
11473
  "config": {
11010
11474
  "type": "object",
11011
11475
  "additionalProperties": {},
11012
- "description": "Executor-specific config. For agent-task: { template, outputSchema?, agentId?, tags?, priority?, dir?, vcsRepo?, model? }. Values support {{interpolation}} from the node's inputs context. NOTE: config.outputSchema on agent-task nodes validates the AGENT's raw JSON output, while node-level outputSchema validates the EXECUTOR's return value ({taskId, taskOutput})."
11476
+ "description": "Executor-specific config. For agent-task: { template, outputSchema?, agentId?, tags?, priority?, dir?, vcsRepo?, model? }. For swarm-script: { scriptName, scope?, pinHash?, args?, fsMode? }. Values support {{interpolation}} from the node's inputs context. NOTE: config.outputSchema on agent-task nodes validates the AGENT's raw JSON output, while node-level outputSchema validates the EXECUTOR's return value ({taskId, taskOutput})."
11013
11477
  },
11014
11478
  "next": {
11015
11479
  "anyOf": [
@@ -11155,7 +11619,7 @@
11155
11619
  },
11156
11620
  "type": {
11157
11621
  "type": "string",
11158
- "description": "Executor type: 'agent-task', 'script', 'raw-llm', 'validate', 'property-match'"
11622
+ "description": "Executor type: 'agent-task', 'script', 'swarm-script', 'raw-llm', 'validate', 'property-match'"
11159
11623
  },
11160
11624
  "label": {
11161
11625
  "type": "string",
@@ -11164,7 +11628,7 @@
11164
11628
  "config": {
11165
11629
  "type": "object",
11166
11630
  "additionalProperties": {},
11167
- "description": "Executor-specific config. For agent-task: { template, outputSchema?, agentId?, tags?, priority?, dir?, vcsRepo?, model? }. Values support {{interpolation}} from the node's inputs context. NOTE: config.outputSchema on agent-task nodes validates the AGENT's raw JSON output, while node-level outputSchema validates the EXECUTOR's return value ({taskId, taskOutput})."
11631
+ "description": "Executor-specific config. For agent-task: { template, outputSchema?, agentId?, tags?, priority?, dir?, vcsRepo?, model? }. For swarm-script: { scriptName, scope?, pinHash?, args?, fsMode? }. Values support {{interpolation}} from the node's inputs context. NOTE: config.outputSchema on agent-task nodes validates the AGENT's raw JSON output, while node-level outputSchema validates the EXECUTOR's return value ({taskId, taskOutput})."
11168
11632
  },
11169
11633
  "next": {
11170
11634
  "anyOf": [
@@ -11390,7 +11854,7 @@
11390
11854
  "properties": {
11391
11855
  "type": {
11392
11856
  "type": "string",
11393
- "description": "Executor type: 'agent-task', 'script', 'raw-llm', 'validate', 'property-match'"
11857
+ "description": "Executor type: 'agent-task', 'script', 'swarm-script', 'raw-llm', 'validate', 'property-match'"
11394
11858
  },
11395
11859
  "label": {
11396
11860
  "type": "string",
@@ -11399,7 +11863,7 @@
11399
11863
  "config": {
11400
11864
  "type": "object",
11401
11865
  "additionalProperties": {},
11402
- "description": "Executor-specific config. For agent-task: { template, outputSchema?, agentId?, tags?, priority?, dir?, vcsRepo?, model? }. Values support {{interpolation}} from the node's inputs context. NOTE: config.outputSchema on agent-task nodes validates the AGENT's raw JSON output, while node-level outputSchema validates the EXECUTOR's return value ({taskId, taskOutput})."
11866
+ "description": "Executor-specific config. For agent-task: { template, outputSchema?, agentId?, tags?, priority?, dir?, vcsRepo?, model? }. For swarm-script: { scriptName, scope?, pinHash?, args?, fsMode? }. Values support {{interpolation}} from the node's inputs context. NOTE: config.outputSchema on agent-task nodes validates the AGENT's raw JSON output, while node-level outputSchema validates the EXECUTOR's return value ({taskId, taskOutput})."
11403
11867
  },
11404
11868
  "next": {
11405
11869
  "anyOf": [