@desplega.ai/agent-swarm 1.81.1 → 1.83.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 (105) hide show
  1. package/openapi.json +127 -3
  2. package/package.json +3 -2
  3. package/src/be/db.ts +616 -96
  4. package/src/be/migrations/069_agent_tasks_perf_indexes.sql +17 -0
  5. package/src/be/migrations/070_seed_state.sql +22 -0
  6. package/src/be/migrations/071_codex_oauth_pool.sql +8 -0
  7. package/src/be/migrations/072_task_attachments.sql +38 -0
  8. package/src/be/migrations/073_task_attachments_agent_fs_ids.sql +15 -0
  9. package/src/be/scripts/typecheck.ts +450 -7
  10. package/src/be/seed/index.ts +9 -0
  11. package/src/be/seed/registry.ts +18 -0
  12. package/src/be/seed/runner.ts +98 -0
  13. package/src/be/seed/state-db.ts +36 -0
  14. package/src/be/seed/types.ts +59 -0
  15. package/src/be/seed-scripts/catalog/date-resolve.ts +104 -0
  16. package/src/be/seed-scripts/catalog/fetch-readable.ts +77 -0
  17. package/src/be/seed-scripts/catalog/gh-pr-snapshot.ts +104 -0
  18. package/src/be/seed-scripts/catalog/group-count.ts +70 -0
  19. package/src/be/seed-scripts/catalog/json-query.ts +124 -0
  20. package/src/be/seed-scripts/catalog/linear-issue.ts +103 -0
  21. package/src/be/seed-scripts/catalog/memory-dedup-check.ts +61 -0
  22. package/src/be/seed-scripts/catalog/slack-thread-flatten.ts +86 -0
  23. package/src/be/seed-scripts/catalog/task-failure-audit.ts +87 -0
  24. package/src/be/seed-scripts/catalog/text-diff.ts +103 -0
  25. package/src/be/seed-scripts/index.ts +183 -0
  26. package/src/cli.tsx +2 -0
  27. package/src/commands/codex-login.ts +36 -6
  28. package/src/commands/provider-credentials.ts +11 -0
  29. package/src/commands/runner.ts +133 -44
  30. package/src/http/agents.ts +7 -1
  31. package/src/http/index.ts +123 -74
  32. package/src/http/pages.ts +25 -5
  33. package/src/http/route-def.ts +63 -0
  34. package/src/http/schedules.ts +11 -2
  35. package/src/http/scripts.ts +10 -1
  36. package/src/http/sessions.ts +24 -3
  37. package/src/http/skills.ts +8 -1
  38. package/src/http/stats.ts +19 -0
  39. package/src/http/tasks.ts +20 -5
  40. package/src/http/utils.ts +44 -0
  41. package/src/http/workflows.ts +11 -1
  42. package/src/http.ts +2 -0
  43. package/src/otel-impl.ts +34 -4
  44. package/src/otel.ts +1 -3
  45. package/src/providers/claude-adapter.ts +61 -0
  46. package/src/providers/codex-adapter.ts +22 -1
  47. package/src/providers/codex-oauth/auth-json-fs.ts +52 -0
  48. package/src/providers/codex-oauth/auth-json.ts +3 -3
  49. package/src/providers/codex-oauth/storage.ts +81 -21
  50. package/src/providers/otel-env.ts +63 -0
  51. package/src/providers/pi-mono-adapter.ts +20 -3
  52. package/src/providers/types.ts +10 -1
  53. package/src/scripts-runtime/eval-harness.ts +70 -3
  54. package/src/scripts-runtime/executors/native.ts +19 -1
  55. package/src/scripts-runtime/executors/types.ts +17 -0
  56. package/src/scripts-runtime/loader.ts +2 -0
  57. package/src/server.ts +2 -0
  58. package/src/slack/blocks.ts +132 -1
  59. package/src/slack/responses.ts +15 -5
  60. package/src/slack/watcher.ts +12 -0
  61. package/src/tests/claude-adapter-otel.test.ts +225 -0
  62. package/src/tests/codex-adapter-otel.test.ts +120 -0
  63. package/src/tests/codex-login.test.ts +142 -0
  64. package/src/tests/codex-oauth-adapter.test.ts +108 -0
  65. package/src/tests/codex-oauth-auth-json-fs.test.ts +112 -0
  66. package/src/tests/codex-oauth-storage.test.ts +262 -86
  67. package/src/tests/codex-pool.test.ts +284 -0
  68. package/src/tests/credential-check.test.ts +47 -0
  69. package/src/tests/http-semconv-attributes.test.ts +92 -0
  70. package/src/tests/list-endpoint-slimming.test.ts +179 -0
  71. package/src/tests/mcp-tools-user.test.ts +48 -1
  72. package/src/tests/otel-env.test.ts +103 -0
  73. package/src/tests/otel-service-name.test.ts +55 -0
  74. package/src/tests/pagination-metrics.test.ts +165 -0
  75. package/src/tests/prompt-template-resolver.test.ts +1 -1
  76. package/src/tests/rest-api.test.ts +51 -1
  77. package/src/tests/route-def-find-route.test.ts +106 -0
  78. package/src/tests/scripts-http.test.ts +110 -0
  79. package/src/tests/scripts-runtime.test.ts +1 -0
  80. package/src/tests/scripts-typecheck.test.ts +175 -0
  81. package/src/tests/seed-scripts.test.ts +220 -0
  82. package/src/tests/seed.test.ts +163 -0
  83. package/src/tests/send-task-requested-by.test.ts +154 -0
  84. package/src/tests/slack-attachments-block.test.ts +240 -0
  85. package/src/tests/slack-blocks.test.ts +162 -0
  86. package/src/tests/slack-watcher.test.ts +83 -0
  87. package/src/tests/store-progress-attachments-handler.test.ts +480 -0
  88. package/src/tests/store-progress-attachments.test.ts +353 -0
  89. package/src/tests/workflow-http-v2.test.ts +16 -2
  90. package/src/tools/get-metrics.ts +46 -0
  91. package/src/tools/get-swarm.ts +10 -3
  92. package/src/tools/get-task-details.ts +15 -2
  93. package/src/tools/get-tasks.ts +22 -5
  94. package/src/tools/resolve-user.ts +25 -10
  95. package/src/tools/schedules/list-schedules.ts +15 -4
  96. package/src/tools/send-task.ts +16 -0
  97. package/src/tools/store-progress.ts +102 -4
  98. package/src/tools/tool-config.ts +2 -1
  99. package/src/tools/utils.ts +3 -1
  100. package/src/tools/workflows/list-workflows.ts +12 -3
  101. package/src/types.ts +149 -1
  102. package/src/utils/constants.ts +58 -0
  103. package/src/utils/internal-ai/register-bedrock.ts +34 -0
  104. package/src/utils/secret-scrubber.ts +3 -0
  105. /package/src/be/{seed.ts → seed-prompt-templates.ts} +0 -0
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.81.1",
5
+ "version": "1.83.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": [
@@ -360,6 +360,7 @@
360
360
  },
361
361
  "get": {
362
362
  "summary": "List all agents",
363
+ "description": "Returns agents WITHOUT the six identity-markdown blobs (`claudeMd`/`soulMd`/`identityMd`/`toolsMd`/`heartbeatMd`/`setupScript`) by default — they bloat the list by ~16 KB/agent and the overview never renders them. Pass `fields=full` to restore them, or fetch a single agent via `GET /api/agents/{id}`.",
363
364
  "tags": [
364
365
  "Agents"
365
366
  ],
@@ -379,6 +380,18 @@
379
380
  "required": false,
380
381
  "name": "include",
381
382
  "in": "query"
383
+ },
384
+ {
385
+ "schema": {
386
+ "type": "string",
387
+ "enum": [
388
+ "full",
389
+ "slim"
390
+ ]
391
+ },
392
+ "required": false,
393
+ "name": "fields",
394
+ "in": "query"
382
395
  }
383
396
  ],
384
397
  "responses": {
@@ -823,6 +836,7 @@
823
836
  "env",
824
837
  "file",
825
838
  "side-effect-pending",
839
+ "sdk-delegated",
826
840
  null
827
841
  ],
828
842
  "default": null
@@ -4524,6 +4538,7 @@
4524
4538
  },
4525
4539
  "get": {
4526
4540
  "summary": "List pages",
4541
+ "description": "Returns pages WITHOUT the heavy `body` (the full HTML/JSON document) and `passwordHash` by default — list views never render the body. Pass `fields=full` to restore `body`. Fetch a full page via `GET /api/pages/{id}`.",
4527
4542
  "tags": [
4528
4543
  "Pages"
4529
4544
  ],
@@ -4563,6 +4578,18 @@
4563
4578
  "required": false,
4564
4579
  "name": "offset",
4565
4580
  "in": "query"
4581
+ },
4582
+ {
4583
+ "schema": {
4584
+ "type": "string",
4585
+ "enum": [
4586
+ "full",
4587
+ "slim"
4588
+ ]
4589
+ },
4590
+ "required": false,
4591
+ "name": "fields",
4592
+ "in": "query"
4566
4593
  }
4567
4594
  ],
4568
4595
  "responses": {
@@ -6731,6 +6758,7 @@
6731
6758
  },
6732
6759
  "get": {
6733
6760
  "summary": "List schedules",
6761
+ "description": "Returns schedules with the full `taskTemplate` replaced by a short `taskTemplatePreview` by default — list views never render the full template. Pass `fields=full` to restore `taskTemplate`. Fetch the full template via `GET /api/schedules/{id}`.",
6734
6762
  "tags": [
6735
6763
  "Schedules"
6736
6764
  ],
@@ -6783,6 +6811,18 @@
6783
6811
  "required": false,
6784
6812
  "name": "hideCompleted",
6785
6813
  "in": "query"
6814
+ },
6815
+ {
6816
+ "schema": {
6817
+ "type": "string",
6818
+ "enum": [
6819
+ "full",
6820
+ "slim"
6821
+ ]
6822
+ },
6823
+ "required": false,
6824
+ "name": "fields",
6825
+ "in": "query"
6786
6826
  }
6787
6827
  ],
6788
6828
  "responses": {
@@ -7312,6 +7352,7 @@
7312
7352
  "/api/sessions": {
7313
7353
  "get": {
7314
7354
  "summary": "List recent task sessions (root tasks + chain summary)",
7355
+ "description": "Each item's `root` is a slim task summary by default — the full `task` text is replaced with a bounded `taskPreview` and completion/integration blobs are dropped. Pass `fields=full` to restore the full root `AgentTask`. The full root + descendant chain are on `GET /api/sessions/{rootTaskId}`.",
7315
7356
  "tags": [
7316
7357
  "Sessions"
7317
7358
  ],
@@ -7367,6 +7408,18 @@
7367
7408
  "required": false,
7368
7409
  "name": "requestedByUserId",
7369
7410
  "in": "query"
7411
+ },
7412
+ {
7413
+ "schema": {
7414
+ "type": "string",
7415
+ "enum": [
7416
+ "full",
7417
+ "slim"
7418
+ ]
7419
+ },
7420
+ "required": false,
7421
+ "name": "fields",
7422
+ "in": "query"
7370
7423
  }
7371
7424
  ],
7372
7425
  "responses": {
@@ -7416,6 +7469,7 @@
7416
7469
  "/api/skills": {
7417
7470
  "get": {
7418
7471
  "summary": "List skills with optional filters",
7472
+ "description": "Returns skills WITHOUT the heavy `content` (full SKILL.md) by default — list views never render it. Pass `fields=full` to include `content` (e.g. for SDK consumers that read it from the list).",
7419
7473
  "tags": [
7420
7474
  "Skills"
7421
7475
  ],
@@ -7464,6 +7518,18 @@
7464
7518
  "required": false,
7465
7519
  "name": "search",
7466
7520
  "in": "query"
7521
+ },
7522
+ {
7523
+ "schema": {
7524
+ "type": "string",
7525
+ "enum": [
7526
+ "full",
7527
+ "slim"
7528
+ ]
7529
+ },
7530
+ "required": false,
7531
+ "name": "fields",
7532
+ "in": "query"
7467
7533
  }
7468
7534
  ],
7469
7535
  "responses": {
@@ -8931,6 +8997,25 @@
8931
8997
  }
8932
8998
  }
8933
8999
  },
9000
+ "/api/metrics": {
9001
+ "get": {
9002
+ "summary": "Lightweight swarm-wide counts",
9003
+ "description": "Single JSON object of cheap `COUNT(*)` metrics — tasks (by status), agents (by status), workflows (total + enabled), pages, active sessions, skills. Use this instead of fetching full list payloads just to count. Powers UI footers/sidebars and MCP context.",
9004
+ "tags": [
9005
+ "Stats"
9006
+ ],
9007
+ "security": [
9008
+ {
9009
+ "bearerAuth": []
9010
+ }
9011
+ ],
9012
+ "responses": {
9013
+ "200": {
9014
+ "description": "Swarm metrics counts"
9015
+ }
9016
+ }
9017
+ }
9018
+ },
8934
9019
  "/api/services": {
8935
9020
  "get": {
8936
9021
  "summary": "List all registered services",
@@ -9355,6 +9440,7 @@
9355
9440
  "/api/tasks": {
9356
9441
  "get": {
9357
9442
  "summary": "List tasks with filters",
9443
+ "description": "Returns tasks with the full `task` text replaced by a bounded `taskPreview` and completion/integration blobs dropped by default — list views only need the preview. Pass `fields=full` to restore the full `AgentTask`. Fetch a single task in full via `GET /api/tasks/{id}`.",
9358
9444
  "tags": [
9359
9445
  "Tasks"
9360
9446
  ],
@@ -9446,6 +9532,18 @@
9446
9532
  "required": false,
9447
9533
  "name": "offset",
9448
9534
  "in": "query"
9535
+ },
9536
+ {
9537
+ "schema": {
9538
+ "type": "string",
9539
+ "enum": [
9540
+ "full",
9541
+ "slim"
9542
+ ]
9543
+ },
9544
+ "required": false,
9545
+ "name": "fields",
9546
+ "in": "query"
9449
9547
  }
9450
9548
  ],
9451
9549
  "responses": {
@@ -9698,7 +9796,8 @@
9698
9796
  },
9699
9797
  "/api/tasks/{id}": {
9700
9798
  "get": {
9701
- "summary": "Get task details with logs",
9799
+ "summary": "Get task details with logs and attachments",
9800
+ "description": "Returns the full `AgentTask` row decorated with `logs` (capped by `logsLimit`) and `attachments` (pointer-based artifacts stored on the task, ordered by `created_at`).",
9702
9801
  "tags": [
9703
9802
  "Tasks"
9704
9803
  ],
@@ -9715,11 +9814,21 @@
9715
9814
  "required": true,
9716
9815
  "name": "id",
9717
9816
  "in": "path"
9817
+ },
9818
+ {
9819
+ "schema": {
9820
+ "type": "integer",
9821
+ "minimum": 1,
9822
+ "maximum": 1000
9823
+ },
9824
+ "required": false,
9825
+ "name": "logsLimit",
9826
+ "in": "query"
9718
9827
  }
9719
9828
  ],
9720
9829
  "responses": {
9721
9830
  "200": {
9722
- "description": "Task with logs"
9831
+ "description": "Task with logs and attachments"
9723
9832
  },
9724
9833
  "404": {
9725
9834
  "description": "Task not found"
@@ -11223,6 +11332,7 @@
11223
11332
  "/api/workflows": {
11224
11333
  "get": {
11225
11334
  "summary": "List all workflows",
11335
+ "description": "Returns workflows WITHOUT the heavy `definition` (the full DAG) by default — the list view only needs a `nodeCount`, which is included. Pass `fields=full` to restore `definition` + trigger config. Fetch the full workflow via `GET /api/workflows/{id}`.",
11226
11336
  "tags": [
11227
11337
  "Workflows"
11228
11338
  ],
@@ -11231,6 +11341,20 @@
11231
11341
  "bearerAuth": []
11232
11342
  }
11233
11343
  ],
11344
+ "parameters": [
11345
+ {
11346
+ "schema": {
11347
+ "type": "string",
11348
+ "enum": [
11349
+ "full",
11350
+ "slim"
11351
+ ]
11352
+ },
11353
+ "required": false,
11354
+ "name": "fields",
11355
+ "in": "query"
11356
+ }
11357
+ ],
11234
11358
  "responses": {
11235
11359
  "200": {
11236
11360
  "description": "Workflow list"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@desplega.ai/agent-swarm",
3
- "version": "1.81.1",
3
+ "version": "1.83.0",
4
4
  "description": "Multi-agent orchestration for Claude Code, Codex, Gemini CLI, and other AI coding assistants",
5
5
  "license": "MIT",
6
6
  "author": "desplega.sh <contact@desplega.sh>",
@@ -85,7 +85,8 @@
85
85
  "pm2-status": "pm2 status swarm-api swarm-ui swarm-lead swarm-worker",
86
86
  "seed": "bun scripts/seed.ts",
87
87
  "seed:clean": "bun scripts/seed.ts --clean",
88
- "seed:people": "bun scripts/seed-people.ts"
88
+ "seed:people": "bun scripts/seed-people.ts",
89
+ "seed:scripts": "bun scripts/seed-scripts.ts"
89
90
  },
90
91
  "devDependencies": {
91
92
  "@biomejs/biome": "^2.3.10",