@desplega.ai/agent-swarm 1.119.0 → 1.119.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 (78) hide show
  1. package/README.md +7 -7
  2. package/dist/{actions-cdhadphb.js → actions-6fvp3prn.js} +7 -7
  3. package/dist/{app-w2067dt3.js → app-spr18zx3.js} +3 -3
  4. package/dist/{assistant-cb02pb41.js → assistant-v625bfkb.js} +10 -10
  5. package/dist/{boot-reembed-b18pndap.js → boot-reembed-fk1zawyh.js} +4 -4
  6. package/dist/{boot-reembed-p00s3r7a.js → boot-reembed-knw7ta83.js} +3 -3
  7. package/dist/{boot-scrub-logs-b9ym4xx3.js → boot-scrub-logs-rqq0drek.js} +2 -2
  8. package/dist/{cli-9ed8efw3.js → cli-0qhghy2e.js} +1 -1
  9. package/dist/{cli-azvm6fss.js → cli-22xdkf0e.js} +22 -3
  10. package/dist/{cli-qf35kzka.js → cli-2pv9mf2n.js} +1 -1
  11. package/dist/{cli-x1m2hp0q.js → cli-3w3ay9kf.js} +11 -11
  12. package/dist/{cli-h1gg78hv.js → cli-5ne5v3gy.js} +37 -35
  13. package/dist/{cli-06xdf1gz.js → cli-62c45z8p.js} +1 -1
  14. package/dist/{cli-15m4y05s.js → cli-6h60nrdw.js} +5 -5
  15. package/dist/cli-95kferzh.js +439 -0
  16. package/dist/{cli-hyn69s0c.js → cli-bcev4a56.js} +1 -1
  17. package/dist/{cli-bx96sw2z.js → cli-befewsnp.js} +2 -2
  18. package/dist/{cli-qw9seygs.js → cli-cbz05wnr.js} +2 -2
  19. package/dist/{cli-9kbww4vb.js → cli-cjdjcx1h.js} +1 -1
  20. package/dist/{cli-zcra7f1h.js → cli-dd7eaykj.js} +2 -2
  21. package/dist/{cli-wh91zby6.js → cli-dh9eb7tt.js} +6 -6
  22. package/dist/{cli-qcm02dkk.js → cli-ed4s7b1n.js} +1 -1
  23. package/dist/{cli-mxennm5t.js → cli-g617qdzb.js} +2 -2
  24. package/dist/{cli-e7306swv.js → cli-hcpm1e90.js} +6 -6
  25. package/dist/{cli-j12px91x.js → cli-jkkjjdyn.js} +1 -1
  26. package/dist/{cli-06d436hx.js → cli-k2yqtwjk.js} +7 -7
  27. package/dist/{cli-dqxwy0td.js → cli-kb6wj6mf.js} +1 -1
  28. package/dist/{cli-vt51szy9.js → cli-n1rag5eq.js} +1 -1
  29. package/dist/{cli-txxvn1zb.js → cli-qfp2c1qs.js} +1 -1
  30. package/dist/{cli-q7eev82n.js → cli-vvty0cfn.js} +3 -3
  31. package/dist/{cli-chs2zh28.js → cli-vxesz4hy.js} +4 -4
  32. package/dist/{cli-jy7w6z37.js → cli-wen3f7km.js} +12 -12
  33. package/dist/{cli-vfq38b3e.js → cli-xem4ndhx.js} +1 -1
  34. package/dist/cli.js +13 -13
  35. package/dist/{codex-adapter-de3w0nch.js → codex-adapter-efskwfc4.js} +4 -4
  36. package/dist/{codex-session-runner-bnw8cysk.js → codex-session-runner-n7ad0jdv.js} +4 -4
  37. package/dist/{commands-rn6frj4c.js → commands-2nyhjm5e.js} +2 -2
  38. package/dist/{db-kmemzvqt.js → db-psx972cv.js} +2 -2
  39. package/dist/{handlers-mppa5zb3.js → handlers-drzntj65.js} +10 -10
  40. package/dist/{hook-ej6457r1.js → hook-sf4wxq2j.js} +3 -3
  41. package/dist/{http-wv092d70.js → http-kbavqgsx.js} +101 -495
  42. package/dist/{index-q1x8ttq6.js → index-1dcn9zk6.js} +6 -6
  43. package/dist/{index-bc90csfq.js → index-a2wmwh7d.js} +9 -9
  44. package/dist/{index-adgr531h.js → index-dnajx229.js} +10 -10
  45. package/dist/{index-n6xq6x5d.js → index-fjcjdmv1.js} +8 -8
  46. package/dist/{keepalive-yjx8f7cq.js → keepalive-t3hw5tb4.js} +4 -4
  47. package/dist/{lead-r01f3pft.js → lead-keecxwds.js} +25 -25
  48. package/dist/{maintenance-tr5vvp93.js → maintenance-h2h5dbf4.js} +4 -4
  49. package/dist/{oauth-refresh-sweep-s2jrst63.js → oauth-refresh-sweep-41nw0tkp.js} +3 -3
  50. package/dist/{onboard-czarh0tp.js → onboard-de1wkp0v.js} +2 -2
  51. package/dist/{otel-impl-3e0t0kga.js → otel-impl-251jnpdd.js} +1 -1
  52. package/dist/{pi-mono-adapter-05sck1ds.js → pi-mono-adapter-erghwha0.js} +7 -7
  53. package/dist/{pricing-refresh-0dvbj3rq.js → pricing-refresh-0n50xvtx.js} +4 -4
  54. package/dist/{rbac-roles-1q4v9s52.js → rbac-roles-2m5b327a.js} +3 -3
  55. package/dist/{rbac-roles-thnb7h7j.js → rbac-roles-z10gz1j8.js} +2 -2
  56. package/dist/registry-wejfsj31.js +13 -0
  57. package/dist/{seed-pricing-76xbxghj.js → seed-pricing-vetpp3cy.js} +3 -3
  58. package/dist/{setup-b134pfqr.js → setup-zvayft41.js} +2 -2
  59. package/dist/{worker-e1ssyv77.js → worker-feez5q1v.js} +25 -25
  60. package/openapi.json +53 -1
  61. package/package.json +1 -1
  62. package/src/be/seed/agent-fs-provision.ts +41 -1
  63. package/src/fs/registry.ts +13 -1
  64. package/src/http/core.ts +8 -0
  65. package/src/http/fs.ts +41 -1
  66. package/src/tests/agent-fs-provision-seeder.test.ts +40 -0
  67. package/src/tests/preload.ts +21 -0
  68. package/src/tests/prompt-template-resolver.test.ts +6 -0
  69. package/src/tests/prompt-template-session.test.ts +6 -0
  70. package/src/tests/template-registry-helpers.ts +29 -0
  71. package/dist/{azure-openai-responses-gm1ejtmn.js → azure-openai-responses-f57n5qy7.js} +4 -4
  72. package/dist/{claude-managed-setup-cm05wtek.js → claude-managed-setup-eac00cqn.js} +1 -1
  73. package/dist/{cli-6b4wwmm8.js → cli-0qy7bk86.js} +3 -3
  74. package/dist/{google-vertex-8bs2pzgn.js → google-vertex-9hhq68sw.js} +3 -3
  75. package/dist/{mistral-conversations-7gqnz2wt.js → mistral-conversations-tn4sj5qv.js} +3 -3
  76. package/dist/{openai-codex-responses-3nkvje79.js → openai-codex-responses-bex0bpn6.js} +2 -2
  77. package/dist/{openai-completions-0asftkwg.js → openai-completions-gygw5cxt.js} +8 -8
  78. package/dist/{openai-responses-pmatek45.js → openai-responses-8c0dgmty.js} +7 -7
@@ -0,0 +1,439 @@
1
+ // src/fs/provider.ts
2
+ class FilesError extends Error {
3
+ code;
4
+ status;
5
+ cause;
6
+ constructor(code, message, opts = {}) {
7
+ super(message);
8
+ this.name = "FilesError";
9
+ this.code = code;
10
+ this.status = opts.status;
11
+ this.cause = opts.cause;
12
+ }
13
+ }
14
+ function providerPath(scope) {
15
+ if (scope.key !== undefined && scope.key !== null && scope.key !== "") {
16
+ return normalizeStoredKey(scope.key);
17
+ }
18
+ const safeName = normalizeName(scope.name);
19
+ return `tasks/${encodeURIComponent(scope.taskId)}/${safeName}`;
20
+ }
21
+ function normalizeStoredKey(key) {
22
+ const trimmed = key.trim().replace(/^\/+/, "");
23
+ if (!trimmed || trimmed.includes("\x00")) {
24
+ throw new FilesError("Provider", "Stored file key must be a non-empty path");
25
+ }
26
+ if (trimmed.split("/").some((part) => part === "..")) {
27
+ throw new FilesError("Provider", "Stored file key must not contain parent path segments");
28
+ }
29
+ return trimmed;
30
+ }
31
+ function normalizeName(name) {
32
+ const trimmed = name.trim().replace(/^\/+/, "");
33
+ if (!trimmed || trimmed === "." || trimmed.includes("\x00")) {
34
+ throw new FilesError("Provider", "File name must be a non-empty relative path");
35
+ }
36
+ const parts = trimmed.split("/");
37
+ if (parts.some((part) => !part || part === "." || part === "..")) {
38
+ throw new FilesError("Provider", "File name must not contain empty or parent path segments");
39
+ }
40
+ return parts.map(encodeURIComponent).join("/");
41
+ }
42
+ function fileObjectFromHeaders(providerId, scope, headers, overrides = {}) {
43
+ const sizeHeader = headers.get("content-length");
44
+ return {
45
+ providerId,
46
+ key: providerPath(scope),
47
+ taskId: scope.taskId,
48
+ name: scope.name,
49
+ contentType: headers.get("content-type") ?? undefined,
50
+ sizeBytes: sizeHeader ? Number(sizeHeader) : undefined,
51
+ etag: headers.get("etag") ?? undefined,
52
+ sha256: headers.get("x-agent-fs-content-hash") ?? undefined,
53
+ version: headers.get("x-agent-fs-version") ?? undefined,
54
+ ...overrides
55
+ };
56
+ }
57
+ function normalizeFilesError(error) {
58
+ if (error instanceof FilesError) {
59
+ return error;
60
+ }
61
+ return new FilesError("Provider", error instanceof Error ? error.message : "File provider error", {
62
+ cause: error
63
+ });
64
+ }
65
+
66
+ // src/fs/agent-fs-provider.ts
67
+ class AgentFsProvider {
68
+ id = "agent-fs";
69
+ capabilities = {
70
+ signedUrl: { supported: true, maxExpiresIn: 3600 },
71
+ search: true,
72
+ comments: true,
73
+ versioning: true
74
+ };
75
+ apiUrl;
76
+ apiKey;
77
+ orgId;
78
+ driveId;
79
+ fetchImpl;
80
+ constructor(options = {}) {
81
+ this.apiUrl = stripTrailingSlash(options.apiUrl ?? process.env.AGENT_FS_API_URL ?? "");
82
+ this.apiKey = options.apiKey ?? process.env.API_AGENT_FS_API_KEY ?? process.env.AGENT_FS_API_KEY ?? "";
83
+ this.orgId = options.orgId ?? process.env.AGENT_FS_DEFAULT_ORG_ID ?? process.env.AGENT_FS_SHARED_ORG_ID ?? "";
84
+ this.driveId = options.driveId ?? process.env.AGENT_FS_DEFAULT_DRIVE_ID ?? "";
85
+ this.fetchImpl = options.fetchImpl ?? globalThis.fetch;
86
+ if (!this.apiUrl || !this.apiKey || !this.orgId || !this.driveId) {
87
+ throw new FilesError("Provider", "AGENT_FS_API_URL, API_AGENT_FS_API_KEY or AGENT_FS_API_KEY, AGENT_FS_DEFAULT_ORG_ID, and AGENT_FS_DEFAULT_DRIVE_ID are required for the agent-fs provider");
88
+ }
89
+ }
90
+ async upload(scope, body, options = {}) {
91
+ const headers = new Headers(this.authHeaders());
92
+ if (options.contentType) {
93
+ headers.set("content-type", options.contentType);
94
+ }
95
+ if (options.ifNoneMatch) {
96
+ headers.set("if-none-match", options.ifNoneMatch);
97
+ }
98
+ if (options.ifMatch) {
99
+ headers.set("if-match", options.ifMatch);
100
+ }
101
+ if (options.message) {
102
+ headers.set("x-agent-fs-message", options.message);
103
+ }
104
+ const response = await this.fetchRaw(scope, { method: "PUT", headers, body });
105
+ const parsed = await response.json().catch(() => ({}));
106
+ return fileObjectFromHeaders(this.id, scope, response.headers, {
107
+ key: parsed.path ?? providerPath(scope),
108
+ version: parsed.version === undefined ? response.headers.get("x-agent-fs-version") ?? undefined : String(parsed.version),
109
+ sha256: parsed.contentHash ?? response.headers.get("x-agent-fs-content-hash") ?? undefined,
110
+ metadata: { deduped: parsed.deduped }
111
+ });
112
+ }
113
+ async download(scope) {
114
+ return this.fetchRaw(scope, { method: "GET", headers: this.authHeaders() });
115
+ }
116
+ async head(scope) {
117
+ const response = await this.download(scope);
118
+ await response.body?.cancel();
119
+ return fileObjectFromHeaders(this.id, scope, response.headers);
120
+ }
121
+ async exists(scope) {
122
+ try {
123
+ await this.head(scope);
124
+ return true;
125
+ } catch (error) {
126
+ if (error instanceof FilesError && error.code === "NotFound") {
127
+ return false;
128
+ }
129
+ throw error;
130
+ }
131
+ }
132
+ async delete(scope) {
133
+ await this.ops({ op: "rm", path: providerPath(scope) }, scope);
134
+ }
135
+ async copy(source, destination) {
136
+ await this.ops({ op: "cp", path: providerPath(source), dest: providerPath(destination) });
137
+ return this.head(destination);
138
+ }
139
+ async move(source, destination) {
140
+ await this.ops({ op: "mv", path: providerPath(source), dest: providerPath(destination) });
141
+ return this.head(destination);
142
+ }
143
+ async list(options) {
144
+ const prefix = `tasks/${encodeURIComponent(options.taskId)}/${options.prefix ?? ""}`;
145
+ const result = await this.ops({ op: "ls", path: prefix });
146
+ const resultRecord = asRecord(result);
147
+ const entries = Array.isArray(result) ? result : Array.isArray(resultRecord?.entries) ? resultRecord.entries : [];
148
+ return entries.slice(0, options.limit).map((entry) => {
149
+ const key = String(entry.path ?? entry.name ?? "");
150
+ const name = key.startsWith(`tasks/${encodeURIComponent(options.taskId)}/`) ? key.slice(`tasks/${encodeURIComponent(options.taskId)}/`.length) : key;
151
+ return {
152
+ providerId: this.id,
153
+ key,
154
+ taskId: options.taskId,
155
+ name: decodeURIComponent(name),
156
+ contentType: typeof entry.mimeType === "string" ? entry.mimeType : undefined,
157
+ sizeBytes: typeof entry.size === "number" ? entry.size : undefined,
158
+ version: entry.version === undefined ? undefined : String(entry.version)
159
+ };
160
+ });
161
+ }
162
+ async* listAll(options) {
163
+ for (const item of await this.list(options)) {
164
+ yield item;
165
+ }
166
+ }
167
+ async url(scope, options = {}) {
168
+ const expiresIn = Math.min(options.expiresIn ?? 3600, this.capabilities.signedUrl.maxExpiresIn);
169
+ const result = await this.ops({ op: "signed-url", path: providerPath(scope), expiresIn }, scope);
170
+ if (typeof result === "string") {
171
+ return result;
172
+ }
173
+ const resultRecord = asRecord(result);
174
+ if (typeof resultRecord?.url === "string") {
175
+ return resultRecord.url;
176
+ }
177
+ throw new FilesError("Provider", "agent-fs signed-url op did not return a URL");
178
+ }
179
+ async signedUploadUrl() {
180
+ throw new FilesError("ReadOnly", "agent-fs does not support signed upload URLs");
181
+ }
182
+ async search(query) {
183
+ const result = await this.ops({
184
+ op: "search",
185
+ query: query.query,
186
+ path: `tasks/${encodeURIComponent(query.taskId)}`,
187
+ limit: query.limit
188
+ });
189
+ return Array.isArray(result) ? result : [];
190
+ }
191
+ async addComment(input) {
192
+ return await this.ops({
193
+ op: "comment-add",
194
+ path: providerPath(input),
195
+ body: input.body,
196
+ range: input.range
197
+ });
198
+ }
199
+ async listComments(scope) {
200
+ const result = await this.ops({ op: "comment-list", path: providerPath(scope) });
201
+ return Array.isArray(result) ? result : [];
202
+ }
203
+ async listVersions(scope) {
204
+ const result = await this.ops({ op: "log", path: providerPath(scope) });
205
+ return Array.isArray(result) ? result : [];
206
+ }
207
+ async restoreVersion(scope) {
208
+ return await this.ops({
209
+ op: "revert",
210
+ path: providerPath(scope),
211
+ version: scope.version
212
+ });
213
+ }
214
+ async fetchRaw(scope, init) {
215
+ const response = await this.fetchImpl(this.rawUrl(scope), init);
216
+ if (!response.ok) {
217
+ throw await responseToFilesError(response);
218
+ }
219
+ return response;
220
+ }
221
+ async ops(body, scope) {
222
+ const response = await this.fetchImpl(`${this.apiUrl}/orgs/${encodeURIComponent(this.orgFor(scope))}/ops`, {
223
+ method: "POST",
224
+ headers: {
225
+ ...this.authHeaders(),
226
+ "content-type": "application/json"
227
+ },
228
+ body: JSON.stringify({ driveId: this.driveFor(scope), ...body })
229
+ });
230
+ if (!response.ok) {
231
+ throw await responseToFilesError(response);
232
+ }
233
+ return response.json().catch(() => null);
234
+ }
235
+ rawUrl(scope) {
236
+ return `${this.apiUrl}/orgs/${encodeURIComponent(this.orgFor(scope))}/drives/${encodeURIComponent(this.driveFor(scope))}/files/${providerPath(scope)}/raw`;
237
+ }
238
+ orgFor(scope) {
239
+ return scope?.orgId?.trim() || this.orgId;
240
+ }
241
+ driveFor(scope) {
242
+ return scope?.driveId?.trim() || this.driveId;
243
+ }
244
+ authHeaders() {
245
+ return { authorization: `Bearer ${this.apiKey}` };
246
+ }
247
+ }
248
+ function asRecord(value) {
249
+ return value && typeof value === "object" ? value : null;
250
+ }
251
+ async function responseToFilesError(response) {
252
+ const text = await response.text().catch(() => "");
253
+ const message = text || `File provider returned HTTP ${response.status}`;
254
+ if (response.status === 401 || response.status === 403) {
255
+ return new FilesError("Unauthorized", message, { status: response.status });
256
+ }
257
+ if (response.status === 404) {
258
+ return new FilesError("NotFound", message, { status: response.status });
259
+ }
260
+ if (response.status === 409 || response.status === 412) {
261
+ return new FilesError("Conflict", message, { status: response.status });
262
+ }
263
+ return new FilesError("Provider", message, { status: response.status });
264
+ }
265
+ function stripTrailingSlash(value) {
266
+ return value.replace(/\/+$/, "");
267
+ }
268
+
269
+ // src/fs/local-fs-provider.ts
270
+ import { mkdir, readdir, rm, stat } from "node:fs/promises";
271
+ import { dirname, join, relative, sep } from "node:path";
272
+ var DEFAULT_ROOT_DIR = "./data/fs";
273
+
274
+ class LocalFsProvider {
275
+ id = "local-fs";
276
+ capabilities = {
277
+ signedUrl: { supported: false }
278
+ };
279
+ rootDir;
280
+ constructor(options = {}) {
281
+ this.rootDir = options.rootDir ?? process.env.AGENT_FS_LOCAL_DIR ?? DEFAULT_ROOT_DIR;
282
+ }
283
+ async upload(scope, body, options = {}) {
284
+ const target = this.localPath(scope);
285
+ await mkdir(dirname(target), { recursive: true });
286
+ if (options.ifNoneMatch === "*" && await this.exists(scope)) {
287
+ throw new FilesError("Conflict", "File already exists");
288
+ }
289
+ await Bun.write(target, await new Response(body).arrayBuffer());
290
+ if (options.contentType) {
291
+ await Bun.write(this.metaPath(target), JSON.stringify({ contentType: options.contentType }));
292
+ }
293
+ return this.head(scope);
294
+ }
295
+ async download(scope) {
296
+ const target = this.localPath(scope);
297
+ if (!await this.exists(scope)) {
298
+ throw new FilesError("NotFound", "File not found");
299
+ }
300
+ return new Response(Bun.file(target));
301
+ }
302
+ async head(scope) {
303
+ const target = this.localPath(scope);
304
+ try {
305
+ const info = await stat(target);
306
+ const storedContentType = await this.readStoredContentType(target);
307
+ return {
308
+ providerId: this.id,
309
+ key: providerPath(scope),
310
+ taskId: scope.taskId,
311
+ name: scope.name,
312
+ contentType: storedContentType ?? Bun.file(target).type ?? undefined,
313
+ sizeBytes: info.size,
314
+ updatedAt: info.mtime.toISOString()
315
+ };
316
+ } catch (error) {
317
+ if (error.code === "ENOENT") {
318
+ throw new FilesError("NotFound", "File not found", { cause: error });
319
+ }
320
+ throw new FilesError("Provider", "Unable to read file metadata", { cause: error });
321
+ }
322
+ }
323
+ async exists(scope) {
324
+ try {
325
+ await stat(this.localPath(scope));
326
+ return true;
327
+ } catch (error) {
328
+ if (error.code === "ENOENT") {
329
+ return false;
330
+ }
331
+ throw new FilesError("Provider", "Unable to check file existence", { cause: error });
332
+ }
333
+ }
334
+ async delete(scope) {
335
+ const target = this.localPath(scope);
336
+ await rm(target, { force: true });
337
+ await rm(this.metaPath(target), { force: true });
338
+ }
339
+ async copy(source, destination) {
340
+ const sourceHead = await this.head(source);
341
+ const response = await this.download(source);
342
+ await this.upload(destination, await response.arrayBuffer(), {
343
+ contentType: sourceHead.contentType
344
+ });
345
+ return this.head(destination);
346
+ }
347
+ async move(source, destination) {
348
+ const copied = await this.copy(source, destination);
349
+ await this.delete(source);
350
+ return copied;
351
+ }
352
+ async list(options) {
353
+ const taskRoot = join(this.rootDir, "tasks", encodeURIComponent(options.taskId));
354
+ const files = [];
355
+ await this.walk(taskRoot, async (path) => {
356
+ const rel = relative(taskRoot, path).split(sep).join("/");
357
+ const name = decodePath(rel);
358
+ if (options.prefix && !name.startsWith(options.prefix)) {
359
+ return;
360
+ }
361
+ files.push(await this.head({ taskId: options.taskId, name }));
362
+ });
363
+ return typeof options.limit === "number" ? files.slice(0, options.limit) : files;
364
+ }
365
+ async* listAll(options) {
366
+ for (const item of await this.list(options)) {
367
+ yield item;
368
+ }
369
+ }
370
+ async url(scope) {
371
+ return `/api/fs/tasks/${encodeURIComponent(scope.taskId)}/files/${encodeURIComponent(scope.name)}/raw`;
372
+ }
373
+ async signedUploadUrl() {
374
+ throw new FilesError("ReadOnly", "local-fs does not support signed upload URLs");
375
+ }
376
+ localPath(scope) {
377
+ return join(this.rootDir, providerPath(scope));
378
+ }
379
+ metaPath(target) {
380
+ return `${target}.meta.json`;
381
+ }
382
+ async readStoredContentType(target) {
383
+ try {
384
+ const metaFile = Bun.file(this.metaPath(target));
385
+ if (!await metaFile.exists()) {
386
+ return;
387
+ }
388
+ const meta = await metaFile.json();
389
+ return typeof meta?.contentType === "string" ? meta.contentType : undefined;
390
+ } catch {
391
+ return;
392
+ }
393
+ }
394
+ async walk(dir, visit) {
395
+ let entries;
396
+ try {
397
+ entries = await readdir(dir, { withFileTypes: true });
398
+ } catch (error) {
399
+ if (error.code === "ENOENT") {
400
+ return;
401
+ }
402
+ throw new FilesError("Provider", "Unable to list files", { cause: error });
403
+ }
404
+ for (const entry of entries) {
405
+ const path = join(dir, entry.name);
406
+ if (entry.isDirectory()) {
407
+ await this.walk(path, visit);
408
+ } else if (entry.isFile() && !entry.name.endsWith(".meta.json")) {
409
+ await visit(path);
410
+ }
411
+ }
412
+ }
413
+ }
414
+ function decodePath(path) {
415
+ return path.split("/").map((part) => decodeURIComponent(part)).join("/");
416
+ }
417
+
418
+ // src/fs/registry.ts
419
+ var memoizedProvider = null;
420
+ function getFileStorageProvider() {
421
+ if (!memoizedProvider) {
422
+ memoizedProvider = selectProvider();
423
+ }
424
+ return memoizedProvider;
425
+ }
426
+ function selectProvider() {
427
+ if (process.env.AGENT_FS_API_URL && (process.env.API_AGENT_FS_API_KEY || process.env.AGENT_FS_API_KEY)) {
428
+ return new AgentFsProvider;
429
+ }
430
+ return new LocalFsProvider;
431
+ }
432
+ function resetFileStorageProvider() {
433
+ memoizedProvider = null;
434
+ }
435
+ function resetFileStorageProviderForTests() {
436
+ resetFileStorageProvider();
437
+ }
438
+
439
+ export { FilesError, normalizeFilesError, getFileStorageProvider, selectProvider, resetFileStorageProvider, resetFileStorageProviderForTests };
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  getDb,
6
6
  init_db
7
- } from "./cli-j12px91x.js";
7
+ } from "./cli-jkkjjdyn.js";
8
8
 
9
9
  // src/be/rbac-roles.ts
10
10
  init_db();
@@ -3,7 +3,7 @@ import {
3
3
  } from "./cli-jkhwmmgg.js";
4
4
  import {
5
5
  embedScript
6
- } from "./cli-qw9seygs.js";
6
+ } from "./cli-cbz05wnr.js";
7
7
  import {
8
8
  calculatePKCECodeChallenge,
9
9
  generateRandomCodeVerifier,
@@ -22,7 +22,7 @@ import {
22
22
  init_date_utils,
23
23
  init_db,
24
24
  normalizeDateRequired
25
- } from "./cli-j12px91x.js";
25
+ } from "./cli-jkkjjdyn.js";
26
26
  import {
27
27
  init_zod
28
28
  } from "./cli-bw80ck94.js";
@@ -4,11 +4,11 @@ import {
4
4
  getEmbeddingProvider,
5
5
  init_embedding,
6
6
  serializeEmbedding
7
- } from "./cli-qcm02dkk.js";
7
+ } from "./cli-ed4s7b1n.js";
8
8
  import {
9
9
  getDb,
10
10
  init_db
11
- } from "./cli-j12px91x.js";
11
+ } from "./cli-jkkjjdyn.js";
12
12
  import {
13
13
  init_secret_scrubber,
14
14
  scrubSecrets
@@ -7,7 +7,7 @@ var package_default;
7
7
  var init_package = __esm(() => {
8
8
  package_default = {
9
9
  name: "@desplega.ai/agent-swarm",
10
- version: "1.119.0",
10
+ version: "1.119.2",
11
11
  description: "Multi-agent orchestration for Claude Code, Codex, Gemini CLI, and other AI coding assistants",
12
12
  license: "MIT",
13
13
  author: "desplega.sh <contact@desplega.sh>",
@@ -4,12 +4,12 @@ import {
4
4
  linkIdentity,
5
5
  recordUnmappedIdentity,
6
6
  resolveIdentity
7
- } from "./cli-txxvn1zb.js";
7
+ } from "./cli-qfp2c1qs.js";
8
8
  import {
9
9
  getKv,
10
10
  init_db,
11
11
  upsertKv
12
- } from "./cli-j12px91x.js";
12
+ } from "./cli-jkkjjdyn.js";
13
13
 
14
14
  // src/slack/enrich.ts
15
15
  init_db();
@@ -1,15 +1,15 @@
1
- import {
2
- resolveCodexPrompt
3
- } from "./cli-r94z9p1z.js";
4
- import {
5
- summarizeSession
6
- } from "./cli-e7306swv.js";
7
1
  import {
8
2
  createSwarmEventHandler
9
3
  } from "./cli-07er7wrs.js";
4
+ import {
5
+ resolveCodexPrompt
6
+ } from "./cli-r94z9p1z.js";
10
7
  import {
11
8
  readPkgVersion
12
9
  } from "./cli-d6n0thxw.js";
10
+ import {
11
+ summarizeSession
12
+ } from "./cli-hcpm1e90.js";
13
13
  import {
14
14
  buildRatingsFromLlm,
15
15
  fetchRetrievalsForTask,
@@ -6,7 +6,7 @@ import {
6
6
  getDb,
7
7
  init_db,
8
8
  isSqliteVecAvailable
9
- } from "./cli-j12px91x.js";
9
+ } from "./cli-jkkjjdyn.js";
10
10
  import {
11
11
  __esm,
12
12
  __export,
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  buildModelsDevSeedRows
3
- } from "./cli-vfq38b3e.js";
3
+ } from "./cli-xem4ndhx.js";
4
4
  import {
5
5
  createLogEntry,
6
6
  getActivePricingRow,
7
7
  getDb,
8
8
  init_db,
9
9
  insertPricingRow
10
- } from "./cli-j12px91x.js";
10
+ } from "./cli-jkkjjdyn.js";
11
11
  import {
12
12
  init_secret_scrubber,
13
13
  scrubSecrets
@@ -18654,7 +18654,7 @@ function amazonBedrockProvider() {
18654
18654
  }
18655
18655
 
18656
18656
  // node_modules/@earendil-works/pi-ai/dist/api/openai-completions.lazy.js
18657
- var openAICompletionsApi = () => lazyApi(() => import("./openai-completions-0asftkwg.js"));
18657
+ var openAICompletionsApi = () => lazyApi(() => import("./openai-completions-gygw5cxt.js"));
18658
18658
 
18659
18659
  // node_modules/@earendil-works/pi-ai/dist/auth/helpers.js
18660
18660
  function envApiKeyAuth(name, envVars) {
@@ -18738,7 +18738,7 @@ function anthropicProvider() {
18738
18738
  }
18739
18739
 
18740
18740
  // node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.lazy.js
18741
- var azureOpenAIResponsesApi = () => lazyApi(() => import("./azure-openai-responses-gm1ejtmn.js"));
18741
+ var azureOpenAIResponsesApi = () => lazyApi(() => import("./azure-openai-responses-f57n5qy7.js"));
18742
18742
 
18743
18743
  // node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js
18744
18744
  function azureOpenAIResponsesProvider() {
@@ -18764,7 +18764,7 @@ function cerebrasProvider() {
18764
18764
  }
18765
18765
 
18766
18766
  // node_modules/@earendil-works/pi-ai/dist/api/openai-responses.lazy.js
18767
- var openAIResponsesApi = () => lazyApi(() => import("./openai-responses-pmatek45.js"));
18767
+ var openAIResponsesApi = () => lazyApi(() => import("./openai-responses-8c0dgmty.js"));
18768
18768
 
18769
18769
  // node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-auth.js
18770
18770
  var CLOUDFLARE_API_KEY = "CLOUDFLARE_API_KEY";
@@ -18938,7 +18938,7 @@ function googleProvider() {
18938
18938
  }
18939
18939
 
18940
18940
  // node_modules/@earendil-works/pi-ai/dist/api/google-vertex.lazy.js
18941
- var googleVertexApi = () => lazyApi(() => import("./google-vertex-8bs2pzgn.js"));
18941
+ var googleVertexApi = () => lazyApi(() => import("./google-vertex-9hhq68sw.js"));
18942
18942
 
18943
18943
  // node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.js
18944
18944
  var VERTEX_ADC_PATH = "~/.config/gcloud/application_default_credentials.json";
@@ -19029,7 +19029,7 @@ function minimaxCnProvider() {
19029
19029
  }
19030
19030
 
19031
19031
  // node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.lazy.js
19032
- var mistralConversationsApi = () => lazyApi(() => import("./mistral-conversations-7gqnz2wt.js"));
19032
+ var mistralConversationsApi = () => lazyApi(() => import("./mistral-conversations-tn4sj5qv.js"));
19033
19033
 
19034
19034
  // node_modules/@earendil-works/pi-ai/dist/providers/mistral.js
19035
19035
  function mistralProvider() {
@@ -19092,7 +19092,7 @@ function openaiProvider() {
19092
19092
  }
19093
19093
 
19094
19094
  // node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.lazy.js
19095
- var openAICodexResponsesApi = () => lazyApi(() => import("./openai-codex-responses-3nkvje79.js"));
19095
+ var openAICodexResponsesApi = () => lazyApi(() => import("./openai-codex-responses-bex0bpn6.js"));
19096
19096
 
19097
19097
  // node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.js
19098
19098
  function openaiCodexProvider() {
@@ -26,7 +26,7 @@ import {
26
26
  import {
27
27
  init_package,
28
28
  package_default
29
- } from "./cli-9kbww4vb.js";
29
+ } from "./cli-cjdjcx1h.js";
30
30
  import {
31
31
  init_secret_scrubber,
32
32
  scrubSecrets
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  createAdditiveBuffer,
3
3
  extractSlackMessageText
4
- } from "./cli-06xdf1gz.js";
4
+ } from "./cli-62c45z8p.js";
5
5
  import {
6
6
  getSlackApp,
7
7
  registerTreeMessage
8
- } from "./cli-15m4y05s.js";
8
+ } from "./cli-6h60nrdw.js";
9
9
  import {
10
10
  rewriteSlackMentions
11
- } from "./cli-zcra7f1h.js";
11
+ } from "./cli-dd7eaykj.js";
12
+ import {
13
+ createTaskWithSiblingAwareness
14
+ } from "./cli-2pv9mf2n.js";
12
15
  import {
13
16
  buildBufferFlushBlocks
14
17
  } from "./cli-ma04faw5.js";
15
- import {
16
- createTaskWithSiblingAwareness
17
- } from "./cli-qf35kzka.js";
18
18
  import {
19
19
  getLatestActiveTaskInThread,
20
20
  getLeadAgent,
@@ -24,7 +24,7 @@ import {
24
24
  init_registry,
25
25
  registerTemplate,
26
26
  slackContextKey
27
- } from "./cli-j12px91x.js";
27
+ } from "./cli-jkkjjdyn.js";
28
28
 
29
29
  // src/slack/event-dedup.ts
30
30
  var DEFAULT_TTL_MS = 300000;
@@ -8,7 +8,7 @@ import {
8
8
  init_date_utils,
9
9
  init_db,
10
10
  normalizeDateRequired
11
- } from "./cli-j12px91x.js";
11
+ } from "./cli-jkkjjdyn.js";
12
12
 
13
13
  // src/be/db-queries/oauth.ts
14
14
  init_date_utils();
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  init_package,
3
3
  package_default
4
- } from "./cli-9kbww4vb.js";
4
+ } from "./cli-cjdjcx1h.js";
5
5
 
6
6
  // src/commands/shared/client-config.ts
7
7
  init_package();
@@ -4,7 +4,7 @@ import {
4
4
  incrKv,
5
5
  init_db,
6
6
  upsertKv
7
- } from "./cli-j12px91x.js";
7
+ } from "./cli-jkkjjdyn.js";
8
8
 
9
9
  // src/be/users.ts
10
10
  init_db();