@desplega.ai/agent-swarm 1.156.0 → 1.157.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 (68) hide show
  1. package/dist/{acp-adapter-c1msptrw.js → acp-adapter-qhqrk4q0.js} +1 -1
  2. package/dist/{actions-wd41qtdc.js → actions-9rrg0zxm.js} +12 -12
  3. package/dist/{app-tz2qrnah.js → app-enysy1zd.js} +3 -3
  4. package/dist/{assistant-c3q1zj2t.js → assistant-zegamy48.js} +13 -13
  5. package/dist/{boot-reembed-0be1krkm.js → boot-reembed-r6shx5qx.js} +4 -4
  6. package/dist/{boot-reembed-r00j03f3.js → boot-reembed-zfxb937k.js} +3 -3
  7. package/dist/{boot-scrub-logs-9j4hd0vw.js → boot-scrub-logs-k5y0se6r.js} +2 -2
  8. package/dist/{claude-adapter-112w28qc.js → claude-adapter-5yc7hxwv.js} +3 -3
  9. package/dist/{claude-sdk-session-k7pb5kfz.js → claude-sdk-session-j4ywn3xf.js} +3 -3
  10. package/dist/{cli-9pyah9c4.js → cli-01vfmq8c.js} +45 -21
  11. package/dist/{cli-xa4j64zh.js → cli-5j7bm4tb.js} +5 -5
  12. package/dist/{cli-hc2fkhdv.js → cli-6jjzxv3b.js} +2 -2
  13. package/dist/{cli-9w4ex8vh.js → cli-74h6f2bp.js} +2 -2
  14. package/dist/{cli-7pgcpcrg.js → cli-9n76jszt.js} +1 -1
  15. package/dist/{cli-7vj52450.js → cli-9p33cz9h.js} +8 -8
  16. package/dist/{cli-24w39x6n.js → cli-awwphhcs.js} +1 -1
  17. package/dist/{cli-nyqza443.js → cli-c41wjx0r.js} +3 -3
  18. package/dist/{cli-jk26c1sz.js → cli-f3va018d.js} +1 -1
  19. package/dist/{cli-tp0d7vzb.js → cli-jytrw2na.js} +4 -4
  20. package/dist/{cli-y8bfxjtw.js → cli-r9ee9c4w.js} +8 -8
  21. package/dist/{cli-7j2098n5.js → cli-s98skd5r.js} +2 -2
  22. package/dist/{cli-865swy5p.js → cli-sgyqyyxe.js} +2 -2
  23. package/dist/{cli-s8hpxeg4.js → cli-tpv97m71.js} +2 -2
  24. package/dist/{cli-08n8jxcw.js → cli-v53rbqp3.js} +1 -1
  25. package/dist/{cli-szcyv1mm.js → cli-vx9p3qdt.js} +1 -1
  26. package/dist/{cli-90x9ewbz.js → cli-wb2zvbfg.js} +1 -1
  27. package/dist/{cli-28wkjpdp.js → cli-wsed24mk.js} +2 -2
  28. package/dist/{cli-t1cd3mhp.js → cli-xf5b7y1f.js} +1 -1
  29. package/dist/{cli-b05d7szr.js → cli-y3nxwx0t.js} +1 -1
  30. package/dist/{cli-mx3bzbv8.js → cli-yscm6cv8.js} +103 -36
  31. package/dist/cli.js +12 -12
  32. package/dist/{codex-adapter-g4tj1f2g.js → codex-adapter-gns3s6c3.js} +2 -2
  33. package/dist/{codex-session-runner-ad8ha7zt.js → codex-session-runner-gqnxys5w.js} +2 -2
  34. package/dist/{commands-z3gd8ppc.js → commands-hxy2y2sp.js} +2 -2
  35. package/dist/{db-bezm97r9.js → db-w8ghhsgf.js} +2 -2
  36. package/dist/{dispatcher-a97hc33y.js → dispatcher-cp1rknjz.js} +11 -11
  37. package/dist/{handlers-wtdy1x02.js → handlers-egfhr351.js} +14 -14
  38. package/dist/{hook-fvs58a5b.js → hook-fbxjqfjz.js} +2 -2
  39. package/dist/{hook-7edgmzng.js → hook-x4kftwzt.js} +1 -1
  40. package/dist/{http-phnf93hp.js → http-c7jfx990.js} +27 -27
  41. package/dist/{index-7x131mmf.js → index-4k9hct21.js} +11 -11
  42. package/dist/{index-yp8rasxk.js → index-dc2ek6bw.js} +3 -3
  43. package/dist/{index-1fktvwxc.js → index-jtvpgb8f.js} +8 -8
  44. package/dist/{index-7jwk7nsm.js → index-r6bty6tb.js} +12 -12
  45. package/dist/{index-50jxgw0d.js → index-yy07ef2s.js} +11 -11
  46. package/dist/{keepalive-nnz07ebd.js → keepalive-f7ekefyc.js} +4 -4
  47. package/dist/{lead-mg7qcgww.js → lead-h053syts.js} +15 -15
  48. package/dist/{maintenance-ywmnqrpx.js → maintenance-a3w6zs54.js} +4 -4
  49. package/dist/{oauth-refresh-sweep-c63sqfs1.js → oauth-refresh-sweep-vra1dhkd.js} +3 -3
  50. package/dist/{onboard-2zj8sqkq.js → onboard-mfgzeqxs.js} +2 -2
  51. package/dist/{otel-impl-jgdfm26f.js → otel-impl-2ez6xk57.js} +1 -1
  52. package/dist/{pricing-refresh-3whntb69.js → pricing-refresh-6sw65tck.js} +4 -4
  53. package/dist/{rbac-roles-3zw68x72.js → rbac-roles-3gxmnb20.js} +3 -3
  54. package/dist/{rbac-roles-3zptcc3p.js → rbac-roles-nm6924sy.js} +2 -2
  55. package/dist/{render-v2-dbvpyysc.js → render-v2-f026j6c4.js} +3 -3
  56. package/dist/{seed-pricing-ncgxz1r2.js → seed-pricing-vqxa06qf.js} +3 -3
  57. package/dist/{setup-qwx0j8z9.js → setup-w606fr1q.js} +2 -2
  58. package/dist/{work-objects-sjbcmvep.js → work-objects-ezmggdne.js} +14 -14
  59. package/dist/{worker-xezqdkb7.js → worker-1mbyv29k.js} +15 -15
  60. package/openapi.json +1 -1
  61. package/package.json +2 -2
  62. package/src/providers/codex-agents-md.ts +140 -17
  63. package/src/scheduler/deferred-task-waits.ts +28 -0
  64. package/src/scheduler/scheduler.ts +14 -0
  65. package/src/tests/codex-adapter.test.ts +126 -1
  66. package/src/tests/deferred-schedule-reaper.test.ts +193 -0
  67. package/src/tools/schedules/list-schedules.ts +4 -2
  68. package/templates/skills/scheduling/content.md +1 -1
@@ -5,7 +5,7 @@ import {
5
5
  getDb,
6
6
  getDbClient,
7
7
  init_db
8
- } from "./cli-24w39x6n.js";
8
+ } from "./cli-awwphhcs.js";
9
9
  import {
10
10
  init_env_flag,
11
11
  isEnvFlagEnabled
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  resolveSlackUserId,
3
3
  rewriteSlackMentions
4
- } from "./cli-9w4ex8vh.js";
4
+ } from "./cli-74h6f2bp.js";
5
5
  import {
6
6
  bufferedFileFailures,
7
7
  buildEffectiveText,
@@ -11,7 +11,7 @@ import {
11
11
  fetchSlackFiles,
12
12
  findUserByExternalId,
13
13
  notifySlackFileFailures
14
- } from "./cli-9pyah9c4.js";
14
+ } from "./cli-01vfmq8c.js";
15
15
  import {
16
16
  buildBufferFlushBlocks,
17
17
  ensureSlackThreadTree,
@@ -20,7 +20,7 @@ import {
20
20
  getSlackApp,
21
21
  isSlackRenderV2Enabled,
22
22
  registerTreeMessage
23
- } from "./cli-7vj52450.js";
23
+ } from "./cli-9p33cz9h.js";
24
24
  import {
25
25
  createLogEntry,
26
26
  getAgentById,
@@ -33,7 +33,7 @@ import {
33
33
  init_steering,
34
34
  requestSteering,
35
35
  slackContextKey
36
- } from "./cli-24w39x6n.js";
36
+ } from "./cli-awwphhcs.js";
37
37
  import {
38
38
  init_steering_enabled,
39
39
  isSteeringEnabled
@@ -16,14 +16,14 @@ import {
16
16
  import {
17
17
  checkCodexCredentials,
18
18
  codexUserHome
19
- } from "./cli-mx3bzbv8.js";
19
+ } from "./cli-yscm6cv8.js";
20
20
  import {
21
21
  renderMemoriesPrompt,
22
22
  writeSkillsToFilesystem
23
23
  } from "./cli-tjmghmm5.js";
24
24
  import {
25
25
  checkClaudeCredentials
26
- } from "./cli-7j2098n5.js";
26
+ } from "./cli-s98skd5r.js";
27
27
  import {
28
28
  getContextWindowSize
29
29
  } from "./cli-e781c6f9.js";
@@ -38,7 +38,7 @@ import {
38
38
  import {
39
39
  resolveScriptsOnlyMode,
40
40
  validateJsonSchema
41
- } from "./cli-9pyah9c4.js";
41
+ } from "./cli-01vfmq8c.js";
42
42
  import {
43
43
  authJsonToCredentialSelection,
44
44
  credentialsToAuthJson,
@@ -75,7 +75,7 @@ import {
75
75
  startSpan,
76
76
  withSpan,
77
77
  withSpanContext
78
- } from "./cli-7vj52450.js";
78
+ } from "./cli-9p33cz9h.js";
79
79
  import {
80
80
  init_task_attachment_links,
81
81
  taskAttachmentFetchCommand
@@ -84,7 +84,7 @@ import {
84
84
  initTelemetry,
85
85
  init_telemetry,
86
86
  telemetry
87
- } from "./cli-24w39x6n.js";
87
+ } from "./cli-awwphhcs.js";
88
88
  import {
89
89
  ProviderNameSchema,
90
90
  init_types,
@@ -163,7 +163,7 @@ async function materializeCodexAuthJson(_slot, creds, deps = {}) {
163
163
  async function createProviderAdapter(provider) {
164
164
  switch (provider) {
165
165
  case "claude": {
166
- const { ClaudeAdapter } = await import("./claude-adapter-112w28qc.js");
166
+ const { ClaudeAdapter } = await import("./claude-adapter-5yc7hxwv.js");
167
167
  return new ClaudeAdapter;
168
168
  }
169
169
  case "pi": {
@@ -171,7 +171,7 @@ async function createProviderAdapter(provider) {
171
171
  return new PiMonoAdapter;
172
172
  }
173
173
  case "codex": {
174
- const { CodexAdapter } = await import("./codex-adapter-g4tj1f2g.js");
174
+ const { CodexAdapter } = await import("./codex-adapter-gns3s6c3.js");
175
175
  return new CodexAdapter;
176
176
  }
177
177
  case "claude-managed": {
@@ -191,7 +191,7 @@ async function createProviderAdapter(provider) {
191
191
  return new DshAdapter;
192
192
  }
193
193
  case "acp": {
194
- const { ACPAdapter } = await import("./acp-adapter-c1msptrw.js");
194
+ const { ACPAdapter } = await import("./acp-adapter-qhqrk4q0.js");
195
195
  return new ACPAdapter;
196
196
  }
197
197
  default:
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runStopHookSessionSummarySubprocess
3
- } from "./cli-b05d7szr.js";
3
+ } from "./cli-y3nxwx0t.js";
4
4
  import {
5
5
  fetchInstalledMcpServers
6
6
  } from "./cli-tng3131n.js";
@@ -822,7 +822,7 @@ class ClaudeAdapter {
822
822
  if (transport === "sdk" && isClaudeBridgeEffective(sourceEnv)) {
823
823
  throw new Error("CLAUDE_TRANSPORT=sdk cannot run with an effective Claude Bridge configuration. Select CLI transport or disable the bridge.");
824
824
  }
825
- const claudeSdk = transport === "sdk" ? await import("./claude-sdk-session-k7pb5kfz.js") : undefined;
825
+ const claudeSdk = transport === "sdk" ? await import("./claude-sdk-session-j4ywn3xf.js") : undefined;
826
826
  claudeSdk?.validateClaudeSdkAdditionalArgs([
827
827
  ...claudeBinaryArgv.slice(1),
828
828
  ...config.additionalArgs ?? []
@@ -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.156.0",
10
+ version: "1.157.0",
11
11
  description: "agent-swarm.dev — an open-source operating system for AI work: a lead agent breaks goals into tasks, routes them to specialized workers such as Claude Code or Codex, runs each worker in an isolated container, and preserves shared memory, tools, schedules, and review gates so delegated work compounds across sessions.",
12
12
  keywords: [
13
13
  "agent-swarm.dev",
@@ -206,7 +206,7 @@ var init_package = __esm(() => {
206
206
  "@inkjs/ui": "^2.0.0",
207
207
  "@linear/sdk": "^77.0.0",
208
208
  "@modelcontextprotocol/sdk": "1.29.0",
209
- "@openai/codex": "0.156.1",
209
+ "@openai/codex": "0.157.1",
210
210
  "@opencode-ai/sdk": "^1.18.32",
211
211
  "@openfort/openfort-node": "^0.9.1",
212
212
  "@opentelemetry/api": "^1.9.1",
@@ -15,7 +15,7 @@ import {
15
15
  recoverIncompleteRuns,
16
16
  repointTrackerSyncBySwarmId,
17
17
  resolveLeadOnlyRecoveryAssignment
18
- } from "./cli-9pyah9c4.js";
18
+ } from "./cli-01vfmq8c.js";
19
19
  import {
20
20
  isMultiRuntimeEnabled
21
21
  } from "./cli-re8z5p8p.js";
@@ -61,7 +61,7 @@ import {
61
61
  releaseStaleReviewingTasks,
62
62
  supersedeTask,
63
63
  updateAgentStatus
64
- } from "./cli-24w39x6n.js";
64
+ } from "./cli-awwphhcs.js";
65
65
  import {
66
66
  init_registry,
67
67
  init_resolver,
@@ -11,7 +11,7 @@ import {
11
11
  getDbClient,
12
12
  init_db,
13
13
  isSqliteVecAvailable
14
- } from "./cli-24w39x6n.js";
14
+ } from "./cli-awwphhcs.js";
15
15
  import {
16
16
  __esm,
17
17
  __export,
@@ -6,7 +6,7 @@ import {
6
6
  getSwarmConfigs,
7
7
  init_db,
8
8
  upsertSwarmConfig
9
- } from "./cli-24w39x6n.js";
9
+ } from "./cli-awwphhcs.js";
10
10
  import {
11
11
  init_secret_scrubber,
12
12
  scrubSecrets
@@ -7,7 +7,7 @@ import {
7
7
  init_date_utils,
8
8
  init_db,
9
9
  normalizeDateRequired
10
- } from "./cli-24w39x6n.js";
10
+ } from "./cli-awwphhcs.js";
11
11
  import {
12
12
  init_secret_scrubber,
13
13
  registerVolatileSecret,
@@ -4,11 +4,11 @@ import {
4
4
  getEmbeddingProvider,
5
5
  init_embedding,
6
6
  serializeEmbedding
7
- } from "./cli-08n8jxcw.js";
7
+ } from "./cli-v53rbqp3.js";
8
8
  import {
9
9
  getDbClient,
10
10
  init_db
11
- } from "./cli-24w39x6n.js";
11
+ } from "./cli-awwphhcs.js";
12
12
  import {
13
13
  init_secret_scrubber,
14
14
  scrubSecrets
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getDb,
3
3
  init_db
4
- } from "./cli-24w39x6n.js";
4
+ } from "./cli-awwphhcs.js";
5
5
 
6
6
  // src/be/seed-pricing.ts
7
7
  init_db();
@@ -35,7 +35,7 @@ import {
35
35
  import {
36
36
  init_package,
37
37
  package_default
38
- } from "./cli-865swy5p.js";
38
+ } from "./cli-sgyqyyxe.js";
39
39
  import {
40
40
  init_secret_scrubber,
41
41
  scrubSecrets
@@ -52,7 +52,7 @@ import {
52
52
  import {
53
53
  init_package,
54
54
  package_default
55
- } from "./cli-865swy5p.js";
55
+ } from "./cli-sgyqyyxe.js";
56
56
  import {
57
57
  init_secret_scrubber,
58
58
  scrubSecrets
@@ -67,47 +67,114 @@ import { join as join2 } from "node:path";
67
67
  init_secret_scrubber();
68
68
 
69
69
  // src/providers/codex-agents-md.ts
70
- import { join } from "node:path";
70
+ import { lstat, mkdir, readlink, realpath, symlink, unlink } from "node:fs/promises";
71
+ import { homedir } from "node:os";
72
+ import { dirname, join, resolve, sep } from "node:path";
71
73
  var BLOCK_OPEN = "<swarm_system_prompt>";
72
74
  var BLOCK_CLOSE = "</swarm_system_prompt>";
73
75
  var BLOCK_REGEX = /<swarm_system_prompt>[\s\S]*?<\/swarm_system_prompt>\n?/;
76
+ var DEFAULT_STATE_DIR = join(homedir(), ".cache", "agent-swarm", "codex-agents-md");
74
77
  var NOOP_HANDLE = {
75
78
  cleanup: async () => {}
76
79
  };
77
- async function writeCodexAgentsMd(cwd, systemPrompt) {
80
+ async function readIfExists(path) {
81
+ const file = Bun.file(path);
82
+ return await file.exists() ? await file.text() : null;
83
+ }
84
+ function recordPathFor(stateDir, realCwd) {
85
+ const key = new Bun.CryptoHasher("sha256").update(realCwd).digest("hex");
86
+ return join(stateDir, `${key}.json`);
87
+ }
88
+ async function readRecord(recordPath, realCwd) {
89
+ try {
90
+ const record = JSON.parse(await Bun.file(recordPath).text());
91
+ if (record.cwd === realCwd && typeof record.linkTarget === "string") {
92
+ return { cwd: record.cwd, linkTarget: record.linkTarget };
93
+ }
94
+ } catch {}
95
+ return null;
96
+ }
97
+ async function inTreeTarget(realCwd, agentsMdPath, linkTarget) {
98
+ const target = await realpath(resolve(dirname(agentsMdPath), linkTarget)).catch(() => null);
99
+ const prefix = realCwd.endsWith(sep) ? realCwd : `${realCwd}${sep}`;
100
+ if (target === null || !target.startsWith(prefix)) {
101
+ return null;
102
+ }
103
+ const stat = await lstat(target).catch(() => null);
104
+ return stat?.isFile() ? target : null;
105
+ }
106
+ async function restoreSymlink(agentsMdPath, realCwd, linkTarget) {
107
+ const stat = await lstat(agentsMdPath).catch(() => null);
108
+ const current = stat?.isFile() ? await Bun.file(agentsMdPath).text() : null;
109
+ await unlink(agentsMdPath).catch(() => {});
110
+ await symlink(linkTarget, agentsMdPath);
111
+ if (current === null) {
112
+ return;
113
+ }
114
+ const target = await inTreeTarget(realCwd, agentsMdPath, linkTarget);
115
+ if (target === null) {
116
+ return;
117
+ }
118
+ const stripped = current.replace(BLOCK_REGEX, "");
119
+ if (stripped !== await Bun.file(target).text()) {
120
+ await Bun.write(target, stripped);
121
+ }
122
+ }
123
+ async function writeCodexAgentsMd(cwd, systemPrompt, options = {}) {
78
124
  if (!cwd || !systemPrompt) {
79
125
  return NOOP_HANDLE;
80
126
  }
81
127
  const agentsMdPath = join(cwd, "AGENTS.md");
82
128
  const claudeMdPath = join(cwd, "CLAUDE.md");
129
+ const stateDir = options.stateDir ?? DEFAULT_STATE_DIR;
130
+ const realCwd = await realpath(cwd).catch(() => resolve(cwd));
131
+ const recordPath = recordPathFor(stateDir, realCwd);
83
132
  const block = `${BLOCK_OPEN}
84
133
  ${systemPrompt}
85
134
  ${BLOCK_CLOSE}`;
86
- const agentsMdFile = Bun.file(agentsMdPath);
87
- const existingAgentsMdExists = await agentsMdFile.exists();
135
+ let stat = await lstat(agentsMdPath).catch(() => null);
136
+ const record = await readRecord(recordPath, realCwd);
137
+ if (record) {
138
+ if (stat?.isFile() && BLOCK_REGEX.test(await Bun.file(agentsMdPath).text())) {
139
+ await restoreSymlink(agentsMdPath, realCwd, record.linkTarget);
140
+ stat = await lstat(agentsMdPath);
141
+ }
142
+ await unlink(recordPath).catch(() => {});
143
+ }
144
+ if (stat?.isSymbolicLink()) {
145
+ const linkTarget = await readlink(agentsMdPath);
146
+ const target = await inTreeTarget(realCwd, agentsMdPath, linkTarget);
147
+ const targetContent = target !== null ? await Bun.file(target).text() : "";
148
+ await mkdir(stateDir, { recursive: true });
149
+ await Bun.write(recordPath, JSON.stringify({ cwd: realCwd, linkTarget }));
150
+ await unlink(agentsMdPath);
151
+ await Bun.write(agentsMdPath, `${block}
152
+ ${targetContent.replace(BLOCK_REGEX, "")}`);
153
+ return {
154
+ async cleanup() {
155
+ try {
156
+ await restoreSymlink(agentsMdPath, realCwd, linkTarget);
157
+ await unlink(recordPath).catch(() => {});
158
+ } catch {}
159
+ }
160
+ };
161
+ }
88
162
  let createdFresh = false;
89
163
  let newContent;
90
- if (!existingAgentsMdExists) {
91
- const claudeMdFile = Bun.file(claudeMdPath);
92
- const claudeMdExists = await claudeMdFile.exists();
93
- if (claudeMdExists) {
94
- const claudeContent = await claudeMdFile.text();
95
- newContent = `${block}
164
+ if (!stat) {
165
+ const claudeContent = await readIfExists(claudeMdPath);
166
+ newContent = claudeContent !== null ? `${block}
96
167
 
97
- ${claudeContent}`;
98
- } else {
99
- newContent = `${block}
168
+ ${claudeContent}` : `${block}
100
169
  `;
101
- }
102
170
  createdFresh = true;
103
171
  } else {
104
- const existingContent = await agentsMdFile.text();
172
+ const existingContent = await Bun.file(agentsMdPath).text();
105
173
  if (BLOCK_REGEX.test(existingContent)) {
106
174
  newContent = existingContent.replace(BLOCK_REGEX, `${block}
107
175
  `);
108
176
  } else {
109
177
  newContent = `${block}
110
-
111
178
  ${existingContent}`;
112
179
  }
113
180
  }
@@ -244,14 +311,14 @@ class CodexAppServer {
244
311
  if (this.closePromise)
245
312
  return Promise.reject(new Error("Codex app-server closed"));
246
313
  const id = this.nextId++;
247
- return new Promise((resolve, reject) => {
314
+ return new Promise((resolve2, reject) => {
248
315
  const timer = setTimeout(() => {
249
316
  this.pending.delete(id);
250
317
  reject(new Error(`Codex app-server ${method} timed out after ${this.requestTimeoutMs}ms`));
251
318
  }, this.requestTimeoutMs);
252
319
  this.pending.set(id, {
253
320
  method,
254
- resolve,
321
+ resolve: resolve2,
255
322
  reject,
256
323
  timer
257
324
  });
@@ -332122,13 +332189,13 @@ function checkCodexCredentials(env, opts = {}) {
332122
332189
  }
332123
332190
  async function resolveCodexAuthMode(config, emit, deps = {}) {
332124
332191
  const fsModule = await import("node:fs/promises");
332125
- const homedir = deps.homedir ?? codexUserHome;
332192
+ const homedir2 = deps.homedir ?? codexUserHome;
332126
332193
  const fs = deps.fs ?? {
332127
332194
  readFile: (path, encoding) => fsModule.readFile(path, encoding),
332128
332195
  mkdir: (path, opts) => fsModule.mkdir(path, opts),
332129
332196
  writeFile: (path, data, opts) => fsModule.writeFile(path, data, opts)
332130
332197
  };
332131
- const authJsonPath = join2(homedir(), ".codex", "auth.json");
332198
+ const authJsonPath = join2(homedir2(), ".codex", "auth.json");
332132
332199
  const readAuthMode = async () => {
332133
332200
  try {
332134
332201
  const raw = await fs.readFile(authJsonPath, "utf-8");
@@ -332164,7 +332231,7 @@ async function resolveCodexAuthMode(config, emit, deps = {}) {
332164
332231
  const authJson = credentialsToAuthJson(oauthCreds, {
332165
332232
  includeRefreshToken: !isPoolSlot
332166
332233
  });
332167
- await fs.mkdir(join2(homedir(), ".codex"), { recursive: true, mode: 448 });
332234
+ await fs.mkdir(join2(homedir2(), ".codex"), { recursive: true, mode: 448 });
332168
332235
  await fs.writeFile(authJsonPath, JSON.stringify(authJson, null, 2), { mode: 384 });
332169
332236
  const verb = currentMode === null ? "Restored" : currentMode === "chatgpt" ? "Revalidated" : "Upgraded api-key auth.json to";
332170
332237
  emit({
@@ -332458,8 +332525,8 @@ class AppServerCodexThread {
332458
332525
  const events = async function* () {
332459
332526
  while (!finished || pending.length > 0) {
332460
332527
  if (pending.length === 0) {
332461
- await new Promise((resolve) => {
332462
- wake = resolve;
332528
+ await new Promise((resolve2) => {
332529
+ wake = resolve2;
332463
332530
  });
332464
332531
  continue;
332465
332532
  }
@@ -332471,7 +332538,7 @@ class AppServerCodexThread {
332471
332538
  return { events: events() };
332472
332539
  }
332473
332540
  async steer(input) {
332474
- const turnId = this.activeTurnId ?? await new Promise((resolve, reject) => this.turnWaiters.push({ resolve, reject }));
332541
+ const turnId = this.activeTurnId ?? await new Promise((resolve2, reject) => this.turnWaiters.push({ resolve: resolve2, reject }));
332475
332542
  await this.client.request("turn/steer", {
332476
332543
  threadId: this.id,
332477
332544
  expectedTurnId: turnId,
@@ -332620,8 +332687,8 @@ class CodexSession {
332620
332687
  this.logFileHandle = Bun.file(config.logFile).writer();
332621
332688
  const reasoningApplication = applyReasoningEffort("codex", resolvedModel, config.reasoningEffort);
332622
332689
  this.appliedReasoningEffort = reasoningApplication.kind === "codex-config" ? config.reasoningEffort ?? null : null;
332623
- this.completionPromise = new Promise((resolve) => {
332624
- this.resolveCompletion = resolve;
332690
+ this.completionPromise = new Promise((resolve2) => {
332691
+ this.resolveCompletion = resolve2;
332625
332692
  });
332626
332693
  if (config.taskId && config.apiUrl && config.apiKey) {
332627
332694
  this.listeners.push(createCodexSwarmEventHandler({
@@ -332678,7 +332745,7 @@ class CodexSession {
332678
332745
  return { delivered: false, reason: "Codex session has completed" };
332679
332746
  }
332680
332747
  if (mode === "queue") {
332681
- return new Promise((resolve) => this.queuedPrompts.push({ text, resolve }));
332748
+ return new Promise((resolve2) => this.queuedPrompts.push({ text, resolve: resolve2 }));
332682
332749
  }
332683
332750
  try {
332684
332751
  await this.thread.steer(text);
@@ -333425,8 +333492,8 @@ class CodexSubprocessSession {
333425
333492
  try {
333426
333493
  await Promise.race([
333427
333494
  this.completionPromise,
333428
- new Promise((resolve) => {
333429
- timer = setTimeout(resolve, 2000);
333495
+ new Promise((resolve2) => {
333496
+ timer = setTimeout(resolve2, 2000);
333430
333497
  })
333431
333498
  ]);
333432
333499
  } finally {
@@ -333441,18 +333508,18 @@ class CodexSubprocessSession {
333441
333508
  if (this.finished)
333442
333509
  return { delivered: false, reason: "Codex session has completed" };
333443
333510
  const id = ++this.nextControlId;
333444
- return new Promise((resolve) => {
333511
+ return new Promise((resolve2) => {
333445
333512
  const timer = delivery.mode === "queue" ? undefined : setTimeout(() => {
333446
333513
  this.pendingSteering.delete(id);
333447
- resolve({ delivered: false, reason: "Codex steering request timed out" });
333514
+ resolve2({ delivered: false, reason: "Codex steering request timed out" });
333448
333515
  }, 35000);
333449
- this.pendingSteering.set(id, { resolve, timer });
333516
+ this.pendingSteering.set(id, { resolve: resolve2, timer });
333450
333517
  try {
333451
333518
  this.writeControl({ kind: "steer", id, delivery });
333452
333519
  } catch (error) {
333453
333520
  clearTimeout(timer);
333454
333521
  this.pendingSteering.delete(id);
333455
- resolve({ delivered: false, reason: scrubSecrets(String(error)) });
333522
+ resolve2({ delivered: false, reason: scrubSecrets(String(error)) });
333456
333523
  }
333457
333524
  });
333458
333525
  }
@@ -333462,9 +333529,9 @@ class CodexSubprocessSession {
333462
333529
  }
333463
333530
  finishSteering() {
333464
333531
  this.finished = true;
333465
- for (const { resolve, timer } of this.pendingSteering.values()) {
333532
+ for (const { resolve: resolve2, timer } of this.pendingSteering.values()) {
333466
333533
  clearTimeout(timer);
333467
- resolve({ delivered: false, reason: "Codex session has completed" });
333534
+ resolve2({ delivered: false, reason: "Codex session has completed" });
333468
333535
  }
333469
333536
  this.pendingSteering.clear();
333470
333537
  }
package/dist/cli.js CHANGED
@@ -57,7 +57,7 @@ var import_react = __toESM(require_react(), 1);
57
57
  // package.json
58
58
  var package_default = {
59
59
  name: "@desplega.ai/agent-swarm",
60
- version: "1.156.0",
60
+ version: "1.157.0",
61
61
  description: "agent-swarm.dev — an open-source operating system for AI work: a lead agent breaks goals into tasks, routes them to specialized workers such as Claude Code or Codex, runs each worker in an isolated container, and preserves shared memory, tools, schedules, and review gates so delegated work compounds across sessions.",
62
62
  keywords: [
63
63
  "agent-swarm.dev",
@@ -256,7 +256,7 @@ var package_default = {
256
256
  "@inkjs/ui": "^2.0.0",
257
257
  "@linear/sdk": "^77.0.0",
258
258
  "@modelcontextprotocol/sdk": "1.29.0",
259
- "@openai/codex": "0.156.1",
259
+ "@openai/codex": "0.157.1",
260
260
  "@opencode-ai/sdk": "^1.18.32",
261
261
  "@openfort/openfort-node": "^0.9.1",
262
262
  "@opentelemetry/api": "^1.9.1",
@@ -739,7 +739,7 @@ function McpServer({ port, apiKey, dbPath }) {
739
739
  if (dbPath) {
740
740
  process.env.DATABASE_PATH = dbPath;
741
741
  }
742
- import("./http-phnf93hp.js").then(() => {
742
+ import("./http-c7jfx990.js").then(() => {
743
743
  setStatus("running");
744
744
  }).catch((err) => {
745
745
  setStatus("error");
@@ -825,7 +825,7 @@ function WorkerRunner({
825
825
  }) {
826
826
  const { exit } = use_app_default();
827
827
  import_react.useEffect(() => {
828
- import("./worker-xezqdkb7.js").then(({ runWorker }) => runWorker({
828
+ import("./worker-1mbyv29k.js").then(({ runWorker }) => runWorker({
829
829
  prompt: prompt || undefined,
830
830
  yolo,
831
831
  systemPrompt: systemPrompt || undefined,
@@ -842,7 +842,7 @@ function WorkerRunner({
842
842
  function LeadRunner({ prompt, yolo, systemPrompt, systemPromptFile, additionalArgs }) {
843
843
  const { exit } = use_app_default();
844
844
  import_react.useEffect(() => {
845
- import("./lead-mg7qcgww.js").then(({ runLead }) => runLead({
845
+ import("./lead-h053syts.js").then(({ runLead }) => runLead({
846
846
  prompt: prompt || undefined,
847
847
  yolo,
848
848
  systemPrompt: systemPrompt || undefined,
@@ -882,8 +882,8 @@ function LazyComponent({
882
882
  }
883
883
  return import_react.createElement(Component, props);
884
884
  }
885
- var loadOnboard = () => import("./onboard-2zj8sqkq.js").then(({ Onboard }) => Onboard);
886
- var loadConnect = () => import("./setup-qwx0j8z9.js").then(({ Setup }) => Setup);
885
+ var loadOnboard = () => import("./onboard-mfgzeqxs.js").then(({ Onboard }) => Onboard);
886
+ var loadConnect = () => import("./setup-w606fr1q.js").then(({ Setup }) => Setup);
887
887
  function UnknownCommand({ command }) {
888
888
  const { exit } = use_app_default();
889
889
  import_react.useEffect(() => {
@@ -1004,14 +1004,14 @@ ${binName} docs \u2014 v${package_default.version}
1004
1004
  }
1005
1005
  process.exit(0);
1006
1006
  } else if (args.command === "hook") {
1007
- const { runHook } = await import("./hook-fvs58a5b.js");
1007
+ const { runHook } = await import("./hook-fbxjqfjz.js");
1008
1008
  await runHook();
1009
1009
  } else if (args.command === "codex-hook") {
1010
1010
  const { handleCodexHook } = await import("./codex-hook-9hptmdhj.js");
1011
1011
  await handleCodexHook();
1012
1012
  process.exit(0);
1013
1013
  } else if (args.command === "session-summary-stdin") {
1014
- const { runSessionSummaryFromStdin } = await import("./hook-7edgmzng.js");
1014
+ const { runSessionSummaryFromStdin } = await import("./hook-x4kftwzt.js");
1015
1015
  await runSessionSummaryFromStdin();
1016
1016
  process.exit(process.exitCode ?? 0);
1017
1017
  } else if (args.command === "artifact") {
@@ -1032,7 +1032,7 @@ ${binName} docs \u2014 v${package_default.version}
1032
1032
  printHelp("scripts");
1033
1033
  process.exit(scriptsArgs[0] === "reembed" || args.showHelp ? 0 : 1);
1034
1034
  }
1035
- const { runScriptsMaintenanceCommand } = await import("./maintenance-ywmnqrpx.js");
1035
+ const { runScriptsMaintenanceCommand } = await import("./maintenance-a3w6zs54.js");
1036
1036
  await runScriptsMaintenanceCommand(scriptsArgs);
1037
1037
  console.log("Scripts re-embedded.");
1038
1038
  } else if (args.command === "rbac") {
@@ -1042,14 +1042,14 @@ ${binName} docs \u2014 v${package_default.version}
1042
1042
  printHelp("rbac");
1043
1043
  process.exit(args.showHelp ? 0 : 1);
1044
1044
  }
1045
- const { runRbacCliCommand } = await import("./rbac-roles-3zptcc3p.js");
1045
+ const { runRbacCliCommand } = await import("./rbac-roles-nm6924sy.js");
1046
1046
  await runRbacCliCommand(rbacArgs);
1047
1047
  } else if (args.command === "codex-login") {
1048
1048
  const { runCodexLogin } = await import("./codex-login-x3jk4etn.js");
1049
1049
  const codexLoginArgs = process.argv.slice(process.argv.indexOf("codex-login") + 1);
1050
1050
  await runCodexLogin(codexLoginArgs);
1051
1051
  } else if (args.command === "codex-session-runner") {
1052
- const { runCodexSessionRunner } = await import("./codex-session-runner-ad8ha7zt.js");
1052
+ const { runCodexSessionRunner } = await import("./codex-session-runner-gqnxys5w.js");
1053
1053
  await runCodexSessionRunner();
1054
1054
  } else if (args.command === "claude-managed-setup") {
1055
1055
  const { runClaudeManagedSetup } = await import("./claude-managed-setup-60g8aazx.js");
@@ -6,7 +6,7 @@ import {
6
6
  createInProcessCodexSession,
7
7
  resolveCodexAuthMode,
8
8
  resolveCodexRunnerArgv
9
- } from "./cli-mx3bzbv8.js";
9
+ } from "./cli-yscm6cv8.js";
10
10
  import"./cli-hsxj0yar.js";
11
11
  import"./cli-r94z9p1z.js";
12
12
  import"./cli-2djtr51b.js";
@@ -30,7 +30,7 @@ import"./cli-cqt19wg6.js";
30
30
  import"./cli-ej6gbxfb.js";
31
31
  import"./cli-sd0mxa3c.js";
32
32
  import"./cli-w5e1d1vv.js";
33
- import"./cli-865swy5p.js";
33
+ import"./cli-sgyqyyxe.js";
34
34
  import"./cli-r2ap2czm.js";
35
35
  import"./cli-5b6b62tz.js";
36
36
  import"./cli-btbzvq95.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createInProcessCodexSession
3
- } from "./cli-mx3bzbv8.js";
3
+ } from "./cli-yscm6cv8.js";
4
4
  import"./cli-hsxj0yar.js";
5
5
  import"./cli-r94z9p1z.js";
6
6
  import"./cli-2djtr51b.js";
@@ -24,7 +24,7 @@ import"./cli-cqt19wg6.js";
24
24
  import"./cli-ej6gbxfb.js";
25
25
  import"./cli-sd0mxa3c.js";
26
26
  import"./cli-w5e1d1vv.js";
27
- import"./cli-865swy5p.js";
27
+ import"./cli-sgyqyyxe.js";
28
28
  import {
29
29
  init_secret_scrubber,
30
30
  scrubSecrets
@@ -2,7 +2,7 @@ import {
2
2
  getAllAgents,
3
3
  getAllTasks,
4
4
  init_db
5
- } from "./cli-24w39x6n.js";
5
+ } from "./cli-awwphhcs.js";
6
6
  import"./cli-h0wdadsx.js";
7
7
  import"./cli-3gmcwfyx.js";
8
8
  import"./cli-ggm92wcn.js";
@@ -17,7 +17,7 @@ import {
17
17
  } from "./cli-ej6gbxfb.js";
18
18
  import"./cli-sd0mxa3c.js";
19
19
  import"./cli-w5e1d1vv.js";
20
- import"./cli-865swy5p.js";
20
+ import"./cli-sgyqyyxe.js";
21
21
  import"./cli-r2ap2czm.js";
22
22
  import"./cli-zf8jjwex.js";
23
23
  import"./cli-bc05qbss.js";
@@ -471,7 +471,7 @@ import {
471
471
  upsertSkillFiles,
472
472
  upsertSwarmConfig,
473
473
  withFavoriteFlags
474
- } from "./cli-24w39x6n.js";
474
+ } from "./cli-awwphhcs.js";
475
475
  import"./cli-h0wdadsx.js";
476
476
  import {
477
477
  generateDefaultClaudeMd,
@@ -488,7 +488,7 @@ import"./cli-cqt19wg6.js";
488
488
  import"./cli-ej6gbxfb.js";
489
489
  import"./cli-sd0mxa3c.js";
490
490
  import"./cli-w5e1d1vv.js";
491
- import"./cli-865swy5p.js";
491
+ import"./cli-sgyqyyxe.js";
492
492
  import"./cli-r2ap2czm.js";
493
493
  import"./cli-zf8jjwex.js";
494
494
  import"./cli-bc05qbss.js";