@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.
- package/dist/{acp-adapter-c1msptrw.js → acp-adapter-qhqrk4q0.js} +1 -1
- package/dist/{actions-wd41qtdc.js → actions-9rrg0zxm.js} +12 -12
- package/dist/{app-tz2qrnah.js → app-enysy1zd.js} +3 -3
- package/dist/{assistant-c3q1zj2t.js → assistant-zegamy48.js} +13 -13
- package/dist/{boot-reembed-0be1krkm.js → boot-reembed-r6shx5qx.js} +4 -4
- package/dist/{boot-reembed-r00j03f3.js → boot-reembed-zfxb937k.js} +3 -3
- package/dist/{boot-scrub-logs-9j4hd0vw.js → boot-scrub-logs-k5y0se6r.js} +2 -2
- package/dist/{claude-adapter-112w28qc.js → claude-adapter-5yc7hxwv.js} +3 -3
- package/dist/{claude-sdk-session-k7pb5kfz.js → claude-sdk-session-j4ywn3xf.js} +3 -3
- package/dist/{cli-9pyah9c4.js → cli-01vfmq8c.js} +45 -21
- package/dist/{cli-xa4j64zh.js → cli-5j7bm4tb.js} +5 -5
- package/dist/{cli-hc2fkhdv.js → cli-6jjzxv3b.js} +2 -2
- package/dist/{cli-9w4ex8vh.js → cli-74h6f2bp.js} +2 -2
- package/dist/{cli-7pgcpcrg.js → cli-9n76jszt.js} +1 -1
- package/dist/{cli-7vj52450.js → cli-9p33cz9h.js} +8 -8
- package/dist/{cli-24w39x6n.js → cli-awwphhcs.js} +1 -1
- package/dist/{cli-nyqza443.js → cli-c41wjx0r.js} +3 -3
- package/dist/{cli-jk26c1sz.js → cli-f3va018d.js} +1 -1
- package/dist/{cli-tp0d7vzb.js → cli-jytrw2na.js} +4 -4
- package/dist/{cli-y8bfxjtw.js → cli-r9ee9c4w.js} +8 -8
- package/dist/{cli-7j2098n5.js → cli-s98skd5r.js} +2 -2
- package/dist/{cli-865swy5p.js → cli-sgyqyyxe.js} +2 -2
- package/dist/{cli-s8hpxeg4.js → cli-tpv97m71.js} +2 -2
- package/dist/{cli-08n8jxcw.js → cli-v53rbqp3.js} +1 -1
- package/dist/{cli-szcyv1mm.js → cli-vx9p3qdt.js} +1 -1
- package/dist/{cli-90x9ewbz.js → cli-wb2zvbfg.js} +1 -1
- package/dist/{cli-28wkjpdp.js → cli-wsed24mk.js} +2 -2
- package/dist/{cli-t1cd3mhp.js → cli-xf5b7y1f.js} +1 -1
- package/dist/{cli-b05d7szr.js → cli-y3nxwx0t.js} +1 -1
- package/dist/{cli-mx3bzbv8.js → cli-yscm6cv8.js} +103 -36
- package/dist/cli.js +12 -12
- package/dist/{codex-adapter-g4tj1f2g.js → codex-adapter-gns3s6c3.js} +2 -2
- package/dist/{codex-session-runner-ad8ha7zt.js → codex-session-runner-gqnxys5w.js} +2 -2
- package/dist/{commands-z3gd8ppc.js → commands-hxy2y2sp.js} +2 -2
- package/dist/{db-bezm97r9.js → db-w8ghhsgf.js} +2 -2
- package/dist/{dispatcher-a97hc33y.js → dispatcher-cp1rknjz.js} +11 -11
- package/dist/{handlers-wtdy1x02.js → handlers-egfhr351.js} +14 -14
- package/dist/{hook-fvs58a5b.js → hook-fbxjqfjz.js} +2 -2
- package/dist/{hook-7edgmzng.js → hook-x4kftwzt.js} +1 -1
- package/dist/{http-phnf93hp.js → http-c7jfx990.js} +27 -27
- package/dist/{index-7x131mmf.js → index-4k9hct21.js} +11 -11
- package/dist/{index-yp8rasxk.js → index-dc2ek6bw.js} +3 -3
- package/dist/{index-1fktvwxc.js → index-jtvpgb8f.js} +8 -8
- package/dist/{index-7jwk7nsm.js → index-r6bty6tb.js} +12 -12
- package/dist/{index-50jxgw0d.js → index-yy07ef2s.js} +11 -11
- package/dist/{keepalive-nnz07ebd.js → keepalive-f7ekefyc.js} +4 -4
- package/dist/{lead-mg7qcgww.js → lead-h053syts.js} +15 -15
- package/dist/{maintenance-ywmnqrpx.js → maintenance-a3w6zs54.js} +4 -4
- package/dist/{oauth-refresh-sweep-c63sqfs1.js → oauth-refresh-sweep-vra1dhkd.js} +3 -3
- package/dist/{onboard-2zj8sqkq.js → onboard-mfgzeqxs.js} +2 -2
- package/dist/{otel-impl-jgdfm26f.js → otel-impl-2ez6xk57.js} +1 -1
- package/dist/{pricing-refresh-3whntb69.js → pricing-refresh-6sw65tck.js} +4 -4
- package/dist/{rbac-roles-3zw68x72.js → rbac-roles-3gxmnb20.js} +3 -3
- package/dist/{rbac-roles-3zptcc3p.js → rbac-roles-nm6924sy.js} +2 -2
- package/dist/{render-v2-dbvpyysc.js → render-v2-f026j6c4.js} +3 -3
- package/dist/{seed-pricing-ncgxz1r2.js → seed-pricing-vqxa06qf.js} +3 -3
- package/dist/{setup-qwx0j8z9.js → setup-w606fr1q.js} +2 -2
- package/dist/{work-objects-sjbcmvep.js → work-objects-ezmggdne.js} +14 -14
- package/dist/{worker-xezqdkb7.js → worker-1mbyv29k.js} +15 -15
- package/openapi.json +1 -1
- package/package.json +2 -2
- package/src/providers/codex-agents-md.ts +140 -17
- package/src/scheduler/deferred-task-waits.ts +28 -0
- package/src/scheduler/scheduler.ts +14 -0
- package/src/tests/codex-adapter.test.ts +126 -1
- package/src/tests/deferred-schedule-reaper.test.ts +193 -0
- package/src/tools/schedules/list-schedules.ts +4 -2
- package/templates/skills/scheduling/content.md +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveSlackUserId,
|
|
3
3
|
rewriteSlackMentions
|
|
4
|
-
} from "./cli-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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.
|
|
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.
|
|
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-
|
|
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-
|
|
64
|
+
} from "./cli-awwphhcs.js";
|
|
65
65
|
import {
|
|
66
66
|
init_registry,
|
|
67
67
|
init_resolver,
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
getEmbeddingProvider,
|
|
5
5
|
init_embedding,
|
|
6
6
|
serializeEmbedding
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-v53rbqp3.js";
|
|
8
8
|
import {
|
|
9
9
|
getDbClient,
|
|
10
10
|
init_db
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-awwphhcs.js";
|
|
12
12
|
import {
|
|
13
13
|
init_secret_scrubber,
|
|
14
14
|
scrubSecrets
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
import {
|
|
53
53
|
init_package,
|
|
54
54
|
package_default
|
|
55
|
-
} from "./cli-
|
|
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 {
|
|
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
|
|
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
|
-
|
|
87
|
-
const
|
|
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 (!
|
|
91
|
-
const
|
|
92
|
-
|
|
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
|
|
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((
|
|
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
|
|
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(
|
|
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(
|
|
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((
|
|
332462
|
-
wake =
|
|
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((
|
|
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((
|
|
332624
|
-
this.resolveCompletion =
|
|
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((
|
|
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((
|
|
333429
|
-
timer = setTimeout(
|
|
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((
|
|
333511
|
+
return new Promise((resolve2) => {
|
|
333445
333512
|
const timer = delivery.mode === "queue" ? undefined : setTimeout(() => {
|
|
333446
333513
|
this.pendingSteering.delete(id);
|
|
333447
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
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.
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
886
|
-
var loadConnect = () => import("./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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
491
|
+
import"./cli-sgyqyyxe.js";
|
|
492
492
|
import"./cli-r2ap2czm.js";
|
|
493
493
|
import"./cli-zf8jjwex.js";
|
|
494
494
|
import"./cli-bc05qbss.js";
|