@desplega.ai/agent-swarm 1.83.0 → 1.83.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/openapi.json +177 -10
  2. package/package.json +6 -6
  3. package/src/artifact-sdk/server.ts +23 -1
  4. package/src/be/budget-admission.ts +28 -4
  5. package/src/be/budget-refusal-notify.ts +19 -3
  6. package/src/be/db-queries/oauth.ts +43 -0
  7. package/src/be/db.ts +37 -4
  8. package/src/be/migrations/074_user_budget_scope.sql +85 -0
  9. package/src/be/schedules/validate.ts +21 -0
  10. package/src/be/skill-sync.ts +65 -15
  11. package/src/commands/resume-session.ts +118 -0
  12. package/src/commands/runner.ts +178 -121
  13. package/src/http/core.ts +4 -1
  14. package/src/http/index.ts +16 -0
  15. package/src/http/integrations.ts +26 -0
  16. package/src/http/mcp-user.ts +111 -0
  17. package/src/http/poll.ts +19 -5
  18. package/src/http/schedules.ts +35 -10
  19. package/src/http/skills.ts +27 -2
  20. package/src/http/users.ts +107 -2
  21. package/src/jira/client.ts +3 -5
  22. package/src/jira/oauth.ts +1 -0
  23. package/src/jira/sync.ts +2 -2
  24. package/src/oauth/ensure-token.ts +1 -0
  25. package/src/oauth/wrapper.ts +38 -7
  26. package/src/providers/claude-adapter.ts +7 -2
  27. package/src/providers/claude-managed-adapter.ts +1 -1
  28. package/src/providers/codex-adapter.ts +30 -0
  29. package/src/providers/opencode-adapter.ts +149 -14
  30. package/src/providers/pi-mono-adapter.ts +41 -1
  31. package/src/providers/types.ts +1 -1
  32. package/src/server-user.ts +117 -0
  33. package/src/tests/artifact-sdk.test.ts +23 -19
  34. package/src/tests/budget-user-scope.test.ts +376 -0
  35. package/src/tests/claude-managed-adapter.test.ts +6 -0
  36. package/src/tests/codex-adapter.test.ts +192 -0
  37. package/src/tests/codex-rate-limit-parse.test.ts +256 -0
  38. package/src/tests/db-queries-oauth.test.ts +43 -0
  39. package/src/tests/ensure-token.test.ts +93 -0
  40. package/src/tests/error-tracker.test.ts +52 -0
  41. package/src/tests/fetch-resolved-env.test.ts +33 -20
  42. package/src/tests/http-api-integration.test.ts +36 -0
  43. package/src/tests/http-users.test.ts +29 -1
  44. package/src/tests/mcp-user-route.test.ts +325 -0
  45. package/src/tests/opencode-adapter.test.ts +75 -0
  46. package/src/tests/pi-mono-adapter.test.ts +21 -1
  47. package/src/tests/rate-limit-event.test.ts +69 -6
  48. package/src/tests/resume-session.test.ts +93 -0
  49. package/src/tests/runner-skills-refresh.test.ts +200 -0
  50. package/src/tests/schedule-validation-helper.test.ts +51 -0
  51. package/src/tests/skill-sync.test.ts +73 -9
  52. package/src/tests/skills-signature.test.ts +141 -0
  53. package/src/tests/task-tools-ctx.test.ts +100 -0
  54. package/src/tests/task-tools-ownership.test.ts +167 -0
  55. package/src/tests/update-schedule-mcp-tool.test.ts +161 -0
  56. package/src/tests/user-token-routes.test.ts +221 -0
  57. package/src/tools/cancel-task.ts +137 -83
  58. package/src/tools/get-task-details.ts +73 -59
  59. package/src/tools/get-tasks.ts +134 -126
  60. package/src/tools/schedules/update-schedule.ts +48 -8
  61. package/src/tools/send-task.ts +312 -312
  62. package/src/tools/slack-upload-file.ts +17 -5
  63. package/src/tools/task-action.ts +464 -367
  64. package/src/tools/task-tool-ctx.ts +43 -0
  65. package/src/types.ts +6 -2
  66. package/src/utils/error-tracker.ts +122 -9
  67. package/src/utils/skills-refresh.ts +123 -0
@@ -13,6 +13,13 @@ const WORKSPACE_DIR = "/workspace";
13
13
 
14
14
  /**
15
15
  * Resolves a file path to an absolute path and checks if it exists.
16
+ *
17
+ * NOTE: existence is checked on the API server's filesystem (where this tool
18
+ * runs), NOT the caller's. Worker/lead containers have their own `/tmp` that
19
+ * the API server cannot see — the only volume mounted on both is
20
+ * `/workspace/shared/`. Files outside `/workspace/shared/` must be passed
21
+ * inline via the `content` (base64) param instead of `filePath`.
22
+ *
16
23
  * Handles several common patterns:
17
24
  * 1. Relative paths (e.g., "shared/file.png") -> resolved from /workspace
18
25
  * 2. Absolute paths under /workspace (e.g., "/workspace/shared/file.png") -> used as-is
@@ -110,14 +117,17 @@ export const registerSlackUploadFileTool = (server: McpServer) => {
110
117
  .optional()
111
118
  .describe(
112
119
  "Path to the file to upload. Either filePath OR content must be provided. " +
113
- "Relative paths are resolved from /workspace (e.g., 'shared/file.png' -> '/workspace/shared/file.png'). " +
114
- "Absolute paths work if they exist or if the file exists under /workspace with that path (e.g., '/tmp/file.png' checks '/tmp/file.png' then '/workspace/tmp/file.png').",
120
+ "IMPORTANT: the file is read on the API server's filesystem (where this tool runs), NOT on the caller's. " +
121
+ "Worker/lead containers do NOT share /tmp or /workspace/personal/ with the API server the only shared volume is /workspace/shared/. " +
122
+ "Use /workspace/shared/<agent-id>/file.png (or a relative path like 'shared/<agent-id>/file.png'). " +
123
+ "For files that only live on the caller (e.g. /tmp), pass them inline via `content` (base64) instead.",
115
124
  ),
116
125
  content: z
117
126
  .string()
118
127
  .optional()
119
128
  .describe(
120
- "Base64-encoded file content. Use this when the file is not on the local filesystem. Either filePath OR content must be provided.",
129
+ "Base64-encoded file content. Use this when the file lives on the caller's filesystem and isn't reachable by the API server " +
130
+ "(e.g. anything under /tmp on a worker/lead container). Either filePath OR content must be provided.",
121
131
  ),
122
132
  filename: z
123
133
  .string()
@@ -287,9 +297,11 @@ export const registerSlackUploadFileTool = (server: McpServer) => {
287
297
  `${pathResult.error}\n` +
288
298
  `Provided path: ${filePath}\n` +
289
299
  `Tried locations:\n${triedPathsList}\n\n` +
300
+ `Note: this tool reads the file on the API server's filesystem, NOT the caller's. ` +
301
+ `Worker/lead containers do not share /tmp or /workspace/personal/ with the API server — only /workspace/shared/.\n\n` +
290
302
  `Tips:\n` +
291
- `- Use relative paths from /workspace (e.g., 'shared/my-file.png')\n` +
292
- `- Or use absolute paths under /workspace (e.g., '/workspace/shared/my-file.png')`;
303
+ `- Put the file in /workspace/shared/<agent-id>/ (e.g., '/workspace/shared/<agent-id>/my-file.png') and pass that path.\n` +
304
+ `- Or pass the file inline via the \`content\` arg as base64 (with \`filename\`) so no shared-mount round-trip is needed.`;
293
305
  return {
294
306
  content: [{ type: "text", text: errorMsg }],
295
307
  structuredContent: { success: false, message: errorMsg },