@desplega.ai/agent-swarm 1.109.0 → 1.111.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/README.md +1 -1
- package/dist/{actions-c67n3jxb.js → actions-a4crgvtd.js} +6 -6
- package/dist/{app-16zmk3px.js → app-va5mr9yw.js} +3 -3
- package/dist/{assistant-5wzbdcqf.js → assistant-0jm4vy8r.js} +9 -9
- package/dist/{boot-reembed-3af9vms0.js → boot-reembed-0t815mmm.js} +3 -3
- package/dist/{boot-reembed-jd82hb59.js → boot-reembed-50zzk97q.js} +4 -4
- package/dist/{boot-scrub-logs-858c7xqe.js → boot-scrub-logs-r99nbmxh.js} +2 -2
- package/dist/{claude-managed-setup-yhbcx0bz.js → claude-managed-setup-cm05wtek.js} +1 -1
- package/dist/{cli-dn44vqyb.js → cli-0d404x64.js} +1 -1
- package/dist/{cli-0wbkrrky.js → cli-0d5xddf1.js} +7 -2
- package/dist/{cli-06p7cfcg.js → cli-1aqc46he.js} +5 -5
- package/dist/{cli-efaejv9v.js → cli-2b0ew5v8.js} +1 -1
- package/dist/{cli-pqgd2rd1.js → cli-3cm8ar1c.js} +1 -1
- package/dist/{cli-4hapc9v6.js → cli-4f6vw5vy.js} +2 -2
- package/dist/{cli-ng2k7kwa.js → cli-4ke1amr9.js} +2 -2
- package/dist/{cli-72vm595k.js → cli-6tfm5fr1.js} +1 -1
- package/dist/{cli-m3enfr8q.js → cli-6wscj9z0.js} +4 -4
- package/dist/{cli-68aqqrmf.js → cli-8j1h9627.js} +14 -14
- package/dist/{cli-wjsj96hh.js → cli-aqr96mny.js} +1 -1
- package/dist/{cli-w6zp4qcx.js → cli-ceewqajw.js} +37 -39
- package/dist/{cli-aenr2vrd.js → cli-dza5039b.js} +317 -30
- package/dist/{cli-rk3snywa.js → cli-ee3fkebs.js} +2 -2
- package/dist/{cli-rtqc5r54.js → cli-f1f82qgv.js} +5 -5
- package/dist/{cli-ef1wbkhh.js → cli-fdnpymsv.js} +2 -2
- package/dist/{cli-wdp73c7w.js → cli-gchg43wt.js} +15 -5
- package/dist/{cli-7d38eycj.js → cli-h3vhr1gj.js} +2 -2
- package/dist/{cli-q95b16kk.js → cli-jrmjxsnk.js} +3 -3
- package/dist/{cli-eqq99cyd.js → cli-kavm2cv5.js} +2 -2
- package/dist/{cli-987a9zvn.js → cli-r3y5chyg.js} +4 -4
- package/dist/{cli-3s560caw.js → cli-t8m00q3b.js} +3 -3
- package/dist/{cli-amncg1dq.js → cli-tk9vyqzh.js} +66 -9
- package/dist/{cli-wgbsdhjc.js → cli-xqzvygxp.js} +1 -1
- package/dist/{cli-phe0nm59.js → cli-y7v6e7yr.js} +4 -4
- package/dist/{cli-4cgfsn4h.js → cli-z626gjqj.js} +1 -1
- package/dist/cli.js +12 -12
- package/dist/{codex-adapter-ebs12jef.js → codex-adapter-5cmy858w.js} +3 -3
- package/dist/{codex-login-4sywkz6v.js → codex-login-0h18cy3e.js} +1 -1
- package/dist/{codex-session-runner-3bx0b1hn.js → codex-session-runner-46q8mrba.js} +3 -3
- package/dist/{commands-0racez18.js → commands-t3rdvb55.js} +2 -2
- package/dist/{db-dt0zx0jq.js → db-mjqc8hj6.js} +2 -2
- package/dist/{handlers-aca9z23r.js → handlers-mcmg5qgc.js} +9 -9
- package/dist/{hook-twh1eb6a.js → hook-0p4q1tym.js} +3 -3
- package/dist/{http-p2vvn9m1.js → http-gs6fk9sg.js} +232 -37
- package/dist/{index-md9ke5yd.js → index-20mf9wvc.js} +8 -8
- package/dist/{index-kax7pt3w.js → index-6zpajd9e.js} +7 -11
- package/dist/{index-jw00ycgg.js → index-744yvc8x.js} +9 -9
- package/dist/{index-nbh8s0gd.js → index-w15fk28m.js} +7 -7
- package/dist/{keepalive-54awap1s.js → keepalive-3gvnbxaj.js} +4 -4
- package/dist/{lead-xqf6mzb8.js → lead-yjbmhj3g.js} +20 -20
- package/dist/{maintenance-1eqnnqwz.js → maintenance-jbvy2bfg.js} +4 -4
- package/dist/{onboard-jwhd9g2q.js → onboard-sexatejh.js} +2 -2
- package/dist/{otel-impl-zx1b8yr9.js → otel-impl-sgqvcw0f.js} +1 -1
- package/dist/{pi-mono-adapter-ayr3akk8.js → pi-mono-adapter-kxjxpfgy.js} +2 -2
- package/dist/{pricing-refresh-q3yep8w5.js → pricing-refresh-rat240yg.js} +4 -4
- package/dist/{seed-pricing-1af3yh3p.js → seed-pricing-7yfaf123.js} +3 -3
- package/dist/{setup-10f473wc.js → setup-vm5vcc6c.js} +2 -2
- package/dist/{worker-exyz0652.js → worker-02y2r0r2.js} +20 -20
- package/openapi.json +1010 -2
- package/package.json +2 -2
- package/src/be/db.ts +11 -11
- package/src/be/memory/constants.ts +7 -0
- package/src/be/memory/graph-expansion.ts +167 -0
- package/src/be/memory/link-resolver.ts +81 -17
- package/src/be/memory/links-store.ts +208 -0
- package/src/be/memory/providers/sqlite-store.ts +2 -2
- package/src/be/memory/raters/retrieval.ts +2 -1
- package/src/be/memory/types.ts +1 -1
- package/src/be/memory/usefulness-stats.ts +259 -0
- package/src/be/migrations/107_memory_usefulness_indexes.sql +12 -0
- package/src/be/seed-scripts/catalog/smart-recall.ts +1 -5
- package/src/github/mentions-aliases.test.ts +4 -3
- package/src/http/codex-oauth-keep-warm.ts +107 -0
- package/src/http/index.ts +2 -0
- package/src/http/memory.ts +73 -6
- package/src/providers/codex-adapter.ts +66 -2
- package/src/providers/codex-oauth/auth-json.ts +18 -9
- package/src/providers/codex-oauth/flow.ts +1 -1
- package/src/providers/codex-oauth/storage.ts +88 -6
- package/src/providers/codex-oauth/types.ts +1 -1
- package/src/tasks/worker-follow-up.ts +47 -23
- package/src/tests/codex-adapter-pool-auth-revalidate.test.ts +113 -11
- package/src/tests/codex-adapter.test.ts +27 -0
- package/src/tests/codex-oauth-keep-warm.test.ts +268 -0
- package/src/tests/codex-oauth-refresh-lock.test.ts +4 -4
- package/src/tests/codex-oauth-storage.test.ts +149 -6
- package/src/tests/codex-oauth.test.ts +12 -0
- package/src/tests/create-page-tool.test.ts +7 -0
- package/src/tests/entrypoint-codex-oauth-seed.test.ts +124 -0
- package/src/tests/heartbeat-reroute-decision.test.ts +49 -0
- package/src/tests/jira-webhook-lifecycle.test.ts +7 -0
- package/src/tests/memory-edit.test.ts +95 -0
- package/src/tests/memory-get-tool.test.ts +138 -0
- package/src/tests/memory-graph-expansion.test.ts +421 -0
- package/src/tests/memory-http-recall-gating.test.ts +13 -0
- package/src/tests/memory-link-resolver.test.ts +228 -2
- package/src/tests/memory-usefulness-endpoint.test.ts +392 -0
- package/src/tests/script-workflows-runtime-e2e.test.ts +1 -0
- package/src/tests/slack-upload-file.test.ts +135 -0
- package/src/tests/task-supersede-resume.test.ts +83 -6
- package/src/tools/inject-learning.ts +1 -0
- package/src/tools/memory-edit.ts +3 -2
- package/src/tools/memory-get.ts +66 -1
- package/src/tools/memory-search.ts +13 -3
- package/src/tools/slack-upload-file.ts +11 -1
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
init_templates1 as init_templates,
|
|
18
18
|
normalizeDateRequired,
|
|
19
19
|
resolveTemplate
|
|
20
|
-
} from "./cli-
|
|
20
|
+
} from "./cli-4ke1amr9.js";
|
|
21
21
|
|
|
22
22
|
// src/be/db-queries/tracker.ts
|
|
23
23
|
init_date_utils();
|
|
@@ -141,8 +141,12 @@ init_resolver();
|
|
|
141
141
|
init_templates();
|
|
142
142
|
var WORKER_LIVENESS_WINDOW_SECONDS = Number(process.env.WORKER_LIVENESS_WINDOW_SECONDS || "30");
|
|
143
143
|
var HEARTBEAT_PIN_CRASH_RESUME = process.env.HEARTBEAT_PIN_CRASH_RESUME !== "0";
|
|
144
|
+
function isGracefulResumePinEnabled() {
|
|
145
|
+
return process.env.HEARTBEAT_PIN_GRACEFUL_RESUME !== "0";
|
|
146
|
+
}
|
|
144
147
|
var RESUME_GENERATION_TAG_PREFIX = "resume-generation:";
|
|
145
148
|
var CRASH_RECOVERY_PIN_TAG = "crash-recovery-pin";
|
|
149
|
+
var GRACEFUL_SHUTDOWN_PIN_TAG = "graceful-shutdown-pin";
|
|
146
150
|
function getResumeGeneration(task) {
|
|
147
151
|
const tag = task.tags.find((value) => value.startsWith(RESUME_GENERATION_TAG_PREFIX));
|
|
148
152
|
if (!tag)
|
|
@@ -242,7 +246,7 @@ function createResumeFollowUp(args) {
|
|
|
242
246
|
return { kind: "workflow-skip", stepId: parent.workflowRunStepId };
|
|
243
247
|
}
|
|
244
248
|
let preferredAgentId;
|
|
245
|
-
if (parent.agentId
|
|
249
|
+
if (parent.agentId) {
|
|
246
250
|
const candidate = getAgentById(parent.agentId);
|
|
247
251
|
if (candidate && candidate.status !== "offline") {
|
|
248
252
|
const lastActivity = candidate.lastActivityAt ? Date.parse(candidate.lastActivityAt) : 0;
|
|
@@ -250,10 +254,13 @@ function createResumeFollowUp(args) {
|
|
|
250
254
|
const activeCount = getActiveTaskCount(candidate.id);
|
|
251
255
|
const hasCap = activeCount < (candidate.maxTasks ?? 1);
|
|
252
256
|
const isCrashRecovery = args.reason === "crash_recovery" && HEARTBEAT_PIN_CRASH_RESUME;
|
|
253
|
-
|
|
257
|
+
const isGracefulShutdown = args.reason === "graceful_shutdown";
|
|
258
|
+
const isGracefulPin = isGracefulShutdown && isGracefulResumePinEnabled();
|
|
259
|
+
const isFreshPinnedReason = !isGracefulShutdown && fresh;
|
|
260
|
+
if (hasCap && (isCrashRecovery || isGracefulPin || isFreshPinnedReason)) {
|
|
254
261
|
preferredAgentId = candidate.id;
|
|
255
|
-
} else if (isCrashRecovery && !hasCap) {
|
|
256
|
-
console.warn(`[Heartbeat]
|
|
262
|
+
} else if ((isCrashRecovery || isGracefulPin) && !hasCap) {
|
|
263
|
+
console.warn(`[Heartbeat] ${args.reason} resume for task ${parent.id.slice(0, 8)} NOT pinned: agent ${candidate.id.slice(0, 8)} at capacity (${activeCount}/${candidate.maxTasks ?? 1}); falling back to unassigned pool`);
|
|
257
264
|
}
|
|
258
265
|
}
|
|
259
266
|
}
|
|
@@ -279,6 +286,9 @@ function createResumeFollowUp(args) {
|
|
|
279
286
|
if (args.reason === "crash_recovery" && preferredAgentId !== undefined) {
|
|
280
287
|
tags.push(CRASH_RECOVERY_PIN_TAG);
|
|
281
288
|
}
|
|
289
|
+
if (args.reason === "graceful_shutdown" && preferredAgentId !== undefined) {
|
|
290
|
+
tags.push(GRACEFUL_SHUTDOWN_PIN_TAG);
|
|
291
|
+
}
|
|
282
292
|
const created = createTaskExtended(followUpDescription, {
|
|
283
293
|
agentId: preferredAgentId,
|
|
284
294
|
creatorAgentId: parent.creatorAgentId,
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
getEmbeddingProvider,
|
|
5
5
|
init_embedding,
|
|
6
6
|
serializeEmbedding
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-0d5xddf1.js";
|
|
8
8
|
import {
|
|
9
9
|
getDb,
|
|
10
10
|
init_db
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-4ke1amr9.js";
|
|
12
12
|
import {
|
|
13
13
|
init_secret_scrubber,
|
|
14
14
|
scrubSecrets
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
recordUnmappedIdentity
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-2b0ew5v8.js";
|
|
4
4
|
import {
|
|
5
5
|
findOrCreateUserByEmail,
|
|
6
6
|
findUserByExternalId,
|
|
7
7
|
linkIdentity
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-0d404x64.js";
|
|
9
9
|
import {
|
|
10
10
|
getKv,
|
|
11
11
|
init_db,
|
|
12
12
|
upsertKv
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-4ke1amr9.js";
|
|
14
14
|
|
|
15
15
|
// src/slack/enrich.ts
|
|
16
16
|
init_db();
|
|
@@ -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.111.0",
|
|
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>",
|
|
@@ -153,7 +153,7 @@ var init_package = __esm(() => {
|
|
|
153
153
|
"@linear/sdk": "^77.0.0",
|
|
154
154
|
"@modelcontextprotocol/sdk": "^1.25.1",
|
|
155
155
|
"@openai/codex-sdk": "^0.142.5",
|
|
156
|
-
"@opencode-ai/sdk": "^1.17.
|
|
156
|
+
"@opencode-ai/sdk": "^1.17.13",
|
|
157
157
|
"@openfort/openfort-node": "^0.9.1",
|
|
158
158
|
"@opentelemetry/api": "^1.9.1",
|
|
159
159
|
"@opentelemetry/exporter-metrics-otlp-http": "^0.218.0",
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
handleScheduleTrigger,
|
|
5
5
|
runScript,
|
|
6
6
|
startWorkflowExecution
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-1aqc46he.js";
|
|
8
8
|
import {
|
|
9
9
|
getScript
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-4f6vw5vy.js";
|
|
11
11
|
import {
|
|
12
12
|
createTaskWithSiblingAwareness,
|
|
13
13
|
scheduleContextKey
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-aqr96mny.js";
|
|
15
15
|
import {
|
|
16
16
|
getDb,
|
|
17
17
|
getDueScheduledTasks,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
init_telemetry,
|
|
22
22
|
telemetry,
|
|
23
23
|
updateScheduledTask
|
|
24
|
-
} from "./cli-
|
|
24
|
+
} from "./cli-4ke1amr9.js";
|
|
25
25
|
import {
|
|
26
26
|
__commonJS,
|
|
27
27
|
__require,
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
getNextResumeGeneration,
|
|
5
5
|
getResumeGeneration,
|
|
6
6
|
repointTrackerSyncBySwarmId
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-gchg43wt.js";
|
|
8
8
|
import {
|
|
9
9
|
getExecutorRegistry,
|
|
10
10
|
recoverIncompleteRuns
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-1aqc46he.js";
|
|
12
12
|
import {
|
|
13
13
|
MAX_EMPTY_POLLS,
|
|
14
14
|
assignUnassignedTaskPending,
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
resolveTemplate,
|
|
45
45
|
supersedeTask,
|
|
46
46
|
updateAgentStatus
|
|
47
|
-
} from "./cli-
|
|
47
|
+
} from "./cli-4ke1amr9.js";
|
|
48
48
|
|
|
49
49
|
// src/heartbeat/heartbeat.ts
|
|
50
50
|
init_db();
|
|
@@ -124,7 +124,7 @@ async function refreshAccessToken(refreshToken) {
|
|
|
124
124
|
if (!response.ok) {
|
|
125
125
|
const text = await response.text().catch(() => "");
|
|
126
126
|
console.error("[codex-oauth] Token refresh failed:", response.status, text);
|
|
127
|
-
return { type: "failed" };
|
|
127
|
+
return { type: "failed", status: response.status, error: text.slice(0, 300) };
|
|
128
128
|
}
|
|
129
129
|
const json = await response.json();
|
|
130
130
|
if (!json.access_token || !json.refresh_token || typeof json.expires_in !== "number") {
|
|
@@ -317,18 +317,74 @@ async function loginCodexOAuth(callbacks) {
|
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
319
|
|
|
320
|
+
// src/providers/codex-oauth/auth-json.ts
|
|
321
|
+
function deriveCodexKeySuffix(accessToken, accountId) {
|
|
322
|
+
const userId = extractChatgptUserId(accessToken);
|
|
323
|
+
const suffixSource = userId ?? accountId;
|
|
324
|
+
if (!userId) {
|
|
325
|
+
console.warn("[codex-oauth] No chatgpt_user_id in JWT — falling back to account_id for keySuffix derivation. " + "If two slots share an account, their suffixes will collide.");
|
|
326
|
+
}
|
|
327
|
+
return suffixSource.slice(-5);
|
|
328
|
+
}
|
|
329
|
+
function authJsonToCredentialSelection(auth, slot = 0, total = 1) {
|
|
330
|
+
return {
|
|
331
|
+
selected: auth.tokens.account_id,
|
|
332
|
+
index: slot,
|
|
333
|
+
total,
|
|
334
|
+
keySuffix: deriveCodexKeySuffix(auth.tokens.access_token, auth.tokens.account_id),
|
|
335
|
+
keyType: "CODEX_OAUTH",
|
|
336
|
+
isRateLimitFallback: false
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
function credentialsToAuthJson(creds, opts = {}) {
|
|
340
|
+
const includeRefreshToken = opts.includeRefreshToken ?? true;
|
|
341
|
+
return {
|
|
342
|
+
auth_mode: "chatgpt",
|
|
343
|
+
OPENAI_API_KEY: null,
|
|
344
|
+
tokens: {
|
|
345
|
+
id_token: creds.access,
|
|
346
|
+
access_token: creds.access,
|
|
347
|
+
refresh_token: includeRefreshToken ? creds.refresh : "",
|
|
348
|
+
account_id: creds.accountId
|
|
349
|
+
},
|
|
350
|
+
last_refresh: new Date(creds.expires).toISOString()
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
|
|
320
354
|
// src/providers/codex-oauth/storage.ts
|
|
321
355
|
var CODEX_OAUTH_KEY_LEGACY = "codex_oauth";
|
|
322
356
|
var REFRESH_LOCK_TTL_MS = 2 * 60 * 1000;
|
|
323
357
|
var REFRESH_LOCK_WAIT_MS = 30 * 1000;
|
|
324
358
|
var REFRESH_LOCK_POLL_MS = 250;
|
|
325
|
-
var REFRESH_SKEW_MS =
|
|
359
|
+
var REFRESH_SKEW_MS = 12 * 60 * 60 * 1000;
|
|
360
|
+
var ACCESS_TOKEN_TTL_MS = 10 * 24 * 60 * 60 * 1000;
|
|
326
361
|
function sleep(ms) {
|
|
327
362
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
328
363
|
}
|
|
329
364
|
function isExpiringSoon(expires) {
|
|
330
365
|
return Date.now() >= expires - REFRESH_SKEW_MS;
|
|
331
366
|
}
|
|
367
|
+
function isStaleByAge(expires, maxAgeMs) {
|
|
368
|
+
const issuedAt = expires - ACCESS_TOKEN_TTL_MS;
|
|
369
|
+
return Date.now() - issuedAt > maxAgeMs;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
class CodexOAuthRefreshError extends Error {
|
|
373
|
+
slot;
|
|
374
|
+
reason;
|
|
375
|
+
keySuffix;
|
|
376
|
+
status;
|
|
377
|
+
body;
|
|
378
|
+
constructor(slot, reason, keySuffix, status, body) {
|
|
379
|
+
super(reason === "lock_timeout" ? `[codex-oauth] slot ${slot} [...${keySuffix}] timed out waiting for refresh lock` : `[codex-oauth] slot ${slot} [...${keySuffix}] refresh rejected (${status ?? "unknown status"} ${body ?? ""})`.trim());
|
|
380
|
+
this.slot = slot;
|
|
381
|
+
this.reason = reason;
|
|
382
|
+
this.keySuffix = keySuffix;
|
|
383
|
+
this.status = status;
|
|
384
|
+
this.body = body;
|
|
385
|
+
this.name = "CodexOAuthRefreshError";
|
|
386
|
+
}
|
|
387
|
+
}
|
|
332
388
|
async function acquireCodexRefreshLock(apiUrl, apiKey, slot) {
|
|
333
389
|
const key = codexOAuthKeyForSlot(slot);
|
|
334
390
|
const res = await fetch(`${apiUrl}/api/oauth/refresh-locks/${encodeURIComponent(key)}`, {
|
|
@@ -462,24 +518,25 @@ async function persistCodexOAuth(apiUrl, apiKey, creds, slot = 0) {
|
|
|
462
518
|
console.error("[codex-oauth] persistCodexOAuth failed (non-fatal):", err);
|
|
463
519
|
}
|
|
464
520
|
}
|
|
465
|
-
async function getValidCodexOAuth(apiUrl, apiKey, slot = 0) {
|
|
521
|
+
async function getValidCodexOAuth(apiUrl, apiKey, slot = 0, opts) {
|
|
522
|
+
const needsRefresh = (c) => isExpiringSoon(c.expires) || opts?.maxAgeMs !== undefined && isStaleByAge(c.expires, opts.maxAgeMs);
|
|
466
523
|
let creds = await loadCodexOAuth(apiUrl, apiKey, slot);
|
|
467
524
|
if (!creds)
|
|
468
525
|
return null;
|
|
469
|
-
if (!
|
|
526
|
+
if (!needsRefresh(creds))
|
|
470
527
|
return creds;
|
|
471
528
|
const waitStartedAt = Date.now();
|
|
472
529
|
for (;; ) {
|
|
473
530
|
creds = await loadCodexOAuth(apiUrl, apiKey, slot);
|
|
474
531
|
if (!creds)
|
|
475
532
|
return null;
|
|
476
|
-
if (!
|
|
533
|
+
if (!needsRefresh(creds))
|
|
477
534
|
return creds;
|
|
478
535
|
const owner = await acquireCodexRefreshLock(apiUrl, apiKey, slot);
|
|
479
536
|
if (!owner) {
|
|
480
537
|
if (Date.now() - waitStartedAt > REFRESH_LOCK_WAIT_MS) {
|
|
481
538
|
console.error(`[codex-oauth] Timed out waiting for slot ${slot} refresh lock`);
|
|
482
|
-
|
|
539
|
+
throw new CodexOAuthRefreshError(slot, "lock_timeout", deriveCodexKeySuffix(creds.access, creds.accountId));
|
|
483
540
|
}
|
|
484
541
|
await sleep(REFRESH_LOCK_POLL_MS);
|
|
485
542
|
continue;
|
|
@@ -488,13 +545,13 @@ async function getValidCodexOAuth(apiUrl, apiKey, slot = 0) {
|
|
|
488
545
|
const lockedCreds = await loadCodexOAuth(apiUrl, apiKey, slot);
|
|
489
546
|
if (!lockedCreds)
|
|
490
547
|
return null;
|
|
491
|
-
if (!
|
|
548
|
+
if (!needsRefresh(lockedCreds))
|
|
492
549
|
return lockedCreds;
|
|
493
550
|
console.log("[codex-oauth] Token expired or expiring soon, refreshing...");
|
|
494
551
|
const result = await refreshAccessToken(lockedCreds.refresh);
|
|
495
552
|
if (result.type !== "success") {
|
|
496
553
|
console.error("[codex-oauth] Token refresh failed");
|
|
497
|
-
|
|
554
|
+
throw new CodexOAuthRefreshError(slot, "refresh_rejected", deriveCodexKeySuffix(lockedCreds.access, lockedCreds.accountId), result.status, result.error);
|
|
498
555
|
}
|
|
499
556
|
const refreshed = {
|
|
500
557
|
access: result.access,
|
|
@@ -517,4 +574,4 @@ async function getValidCodexOAuth(apiUrl, apiKey, slot = 0) {
|
|
|
517
574
|
}
|
|
518
575
|
}
|
|
519
576
|
|
|
520
|
-
export {
|
|
577
|
+
export { loginCodexOAuth, deriveCodexKeySuffix, authJsonToCredentialSelection, credentialsToAuthJson, CodexOAuthRefreshError, loadAllCodexOAuthSlots, storeCodexOAuth, persistCodexOAuth, getValidCodexOAuth };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAdditiveBuffer,
|
|
3
3
|
extractSlackMessageText
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-xqzvygxp.js";
|
|
5
5
|
import {
|
|
6
6
|
getSlackApp,
|
|
7
7
|
registerTreeMessage
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-f1f82qgv.js";
|
|
9
9
|
import {
|
|
10
10
|
buildBufferFlushBlocks
|
|
11
11
|
} from "./cli-6xd0bvf8.js";
|
|
12
12
|
import {
|
|
13
13
|
createTaskWithSiblingAwareness,
|
|
14
14
|
slackContextKey
|
|
15
|
-
} from "./cli-
|
|
15
|
+
} from "./cli-aqr96mny.js";
|
|
16
16
|
import {
|
|
17
17
|
getLatestActiveTaskInThread,
|
|
18
18
|
getLeadAgent,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
init_db,
|
|
21
21
|
init_registry,
|
|
22
22
|
registerTemplate
|
|
23
|
-
} from "./cli-
|
|
23
|
+
} from "./cli-4ke1amr9.js";
|
|
24
24
|
|
|
25
25
|
// src/slack/event-dedup.ts
|
|
26
26
|
var DEFAULT_TTL_MS = 300000;
|
package/dist/cli.js
CHANGED
|
@@ -64,7 +64,7 @@ var import_react = __toESM(require_react(), 1);
|
|
|
64
64
|
// package.json
|
|
65
65
|
var package_default = {
|
|
66
66
|
name: "@desplega.ai/agent-swarm",
|
|
67
|
-
version: "1.
|
|
67
|
+
version: "1.111.0",
|
|
68
68
|
description: "Multi-agent orchestration for Claude Code, Codex, Gemini CLI, and other AI coding assistants",
|
|
69
69
|
license: "MIT",
|
|
70
70
|
author: "desplega.sh <contact@desplega.sh>",
|
|
@@ -210,7 +210,7 @@ var package_default = {
|
|
|
210
210
|
"@linear/sdk": "^77.0.0",
|
|
211
211
|
"@modelcontextprotocol/sdk": "^1.25.1",
|
|
212
212
|
"@openai/codex-sdk": "^0.142.5",
|
|
213
|
-
"@opencode-ai/sdk": "^1.17.
|
|
213
|
+
"@opencode-ai/sdk": "^1.17.13",
|
|
214
214
|
"@openfort/openfort-node": "^0.9.1",
|
|
215
215
|
"@opentelemetry/api": "^1.9.1",
|
|
216
216
|
"@opentelemetry/exporter-metrics-otlp-http": "^0.218.0",
|
|
@@ -645,7 +645,7 @@ function McpServer({ port, apiKey, dbPath }) {
|
|
|
645
645
|
if (dbPath) {
|
|
646
646
|
process.env.DATABASE_PATH = dbPath;
|
|
647
647
|
}
|
|
648
|
-
import("./http-
|
|
648
|
+
import("./http-gs6fk9sg.js").then(() => {
|
|
649
649
|
setStatus("running");
|
|
650
650
|
}).catch((err) => {
|
|
651
651
|
setStatus("error");
|
|
@@ -731,7 +731,7 @@ function WorkerRunner({
|
|
|
731
731
|
}) {
|
|
732
732
|
const { exit } = use_app_default();
|
|
733
733
|
import_react.useEffect(() => {
|
|
734
|
-
import("./worker-
|
|
734
|
+
import("./worker-02y2r0r2.js").then(({ runWorker }) => runWorker({
|
|
735
735
|
prompt: prompt || undefined,
|
|
736
736
|
yolo,
|
|
737
737
|
systemPrompt: systemPrompt || undefined,
|
|
@@ -748,7 +748,7 @@ function WorkerRunner({
|
|
|
748
748
|
function LeadRunner({ prompt, yolo, systemPrompt, systemPromptFile, additionalArgs }) {
|
|
749
749
|
const { exit } = use_app_default();
|
|
750
750
|
import_react.useEffect(() => {
|
|
751
|
-
import("./lead-
|
|
751
|
+
import("./lead-yjbmhj3g.js").then(({ runLead }) => runLead({
|
|
752
752
|
prompt: prompt || undefined,
|
|
753
753
|
yolo,
|
|
754
754
|
systemPrompt: systemPrompt || undefined,
|
|
@@ -788,8 +788,8 @@ function LazyComponent({
|
|
|
788
788
|
}
|
|
789
789
|
return import_react.createElement(Component, props);
|
|
790
790
|
}
|
|
791
|
-
var loadOnboard = () => import("./onboard-
|
|
792
|
-
var loadConnect = () => import("./setup-
|
|
791
|
+
var loadOnboard = () => import("./onboard-sexatejh.js").then(({ Onboard }) => Onboard);
|
|
792
|
+
var loadConnect = () => import("./setup-vm5vcc6c.js").then(({ Setup }) => Setup);
|
|
793
793
|
function UnknownCommand({ command }) {
|
|
794
794
|
const { exit } = use_app_default();
|
|
795
795
|
import_react.useEffect(() => {
|
|
@@ -902,7 +902,7 @@ ${binName} docs \u2014 v${package_default.version}
|
|
|
902
902
|
}
|
|
903
903
|
process.exit(0);
|
|
904
904
|
} else if (args.command === "hook") {
|
|
905
|
-
const { runHook } = await import("./hook-
|
|
905
|
+
const { runHook } = await import("./hook-0p4q1tym.js");
|
|
906
906
|
await runHook();
|
|
907
907
|
} else if (args.command === "artifact") {
|
|
908
908
|
const artifactArgs = process.argv.slice(process.argv.indexOf("artifact") + 1);
|
|
@@ -922,18 +922,18 @@ ${binName} docs \u2014 v${package_default.version}
|
|
|
922
922
|
printHelp("scripts");
|
|
923
923
|
process.exit(scriptsArgs[0] === "reembed" || args.showHelp ? 0 : 1);
|
|
924
924
|
}
|
|
925
|
-
const { runScriptsMaintenanceCommand } = await import("./maintenance-
|
|
925
|
+
const { runScriptsMaintenanceCommand } = await import("./maintenance-jbvy2bfg.js");
|
|
926
926
|
await runScriptsMaintenanceCommand(scriptsArgs);
|
|
927
927
|
console.log("Scripts re-embedded.");
|
|
928
928
|
} else if (args.command === "codex-login") {
|
|
929
|
-
const { runCodexLogin } = await import("./codex-login-
|
|
929
|
+
const { runCodexLogin } = await import("./codex-login-0h18cy3e.js");
|
|
930
930
|
const codexLoginArgs = process.argv.slice(process.argv.indexOf("codex-login") + 1);
|
|
931
931
|
await runCodexLogin(codexLoginArgs);
|
|
932
932
|
} else if (args.command === "codex-session-runner") {
|
|
933
|
-
const { runCodexSessionRunner } = await import("./codex-session-runner-
|
|
933
|
+
const { runCodexSessionRunner } = await import("./codex-session-runner-46q8mrba.js");
|
|
934
934
|
await runCodexSessionRunner();
|
|
935
935
|
} else if (args.command === "claude-managed-setup") {
|
|
936
|
-
const { runClaudeManagedSetup } = await import("./claude-managed-setup-
|
|
936
|
+
const { runClaudeManagedSetup } = await import("./claude-managed-setup-cm05wtek.js");
|
|
937
937
|
const setupArgs = process.argv.slice(process.argv.indexOf("claude-managed-setup") + 1);
|
|
938
938
|
await runClaudeManagedSetup(setupArgs);
|
|
939
939
|
} else if (args.command === "e2b") {
|
|
@@ -6,15 +6,15 @@ import {
|
|
|
6
6
|
createInProcessCodexSession,
|
|
7
7
|
resolveCodexAuthMode,
|
|
8
8
|
resolveCodexRunnerArgv
|
|
9
|
-
} from "./cli-
|
|
10
|
-
import"./cli-
|
|
11
|
-
import"./cli-amncg1dq.js";
|
|
9
|
+
} from "./cli-ceewqajw.js";
|
|
10
|
+
import"./cli-6wscj9z0.js";
|
|
12
11
|
import"./cli-07er7wrs.js";
|
|
13
12
|
import"./cli-yv9dttkh.js";
|
|
14
13
|
import"./cli-r94z9p1z.js";
|
|
15
14
|
import"./cli-d6n0thxw.js";
|
|
16
15
|
import"./cli-hx1dcevq.js";
|
|
17
16
|
import"./cli-dcfyyh3t.js";
|
|
17
|
+
import"./cli-tk9vyqzh.js";
|
|
18
18
|
import"./cli-psrqtw2m.js";
|
|
19
19
|
import"./cli-zm7njwzd.js";
|
|
20
20
|
import"./cli-tghre7g6.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createInProcessCodexSession
|
|
3
|
-
} from "./cli-
|
|
4
|
-
import"./cli-
|
|
5
|
-
import"./cli-amncg1dq.js";
|
|
3
|
+
} from "./cli-ceewqajw.js";
|
|
4
|
+
import"./cli-6wscj9z0.js";
|
|
6
5
|
import"./cli-07er7wrs.js";
|
|
7
6
|
import"./cli-yv9dttkh.js";
|
|
8
7
|
import"./cli-r94z9p1z.js";
|
|
9
8
|
import"./cli-d6n0thxw.js";
|
|
10
9
|
import"./cli-hx1dcevq.js";
|
|
11
10
|
import"./cli-dcfyyh3t.js";
|
|
11
|
+
import"./cli-tk9vyqzh.js";
|
|
12
12
|
import"./cli-psrqtw2m.js";
|
|
13
13
|
import"./cli-zm7njwzd.js";
|
|
14
14
|
import"./cli-tghre7g6.js";
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
getAllAgents,
|
|
3
3
|
getAllTasks,
|
|
4
4
|
init_db
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-4ke1amr9.js";
|
|
6
6
|
import"./cli-z2zcxes1.js";
|
|
7
7
|
import"./cli-q21d49ac.js";
|
|
8
8
|
import"./cli-anrj584m.js";
|
|
9
|
-
import"./cli-
|
|
9
|
+
import"./cli-kavm2cv5.js";
|
|
10
10
|
import"./cli-4j2mrzag.js";
|
|
11
11
|
import"./cli-p9swy5t3.js";
|
|
12
12
|
|
|
@@ -385,11 +385,11 @@ import {
|
|
|
385
385
|
upsertSkillFiles,
|
|
386
386
|
upsertSwarmConfig,
|
|
387
387
|
withFavoriteFlags
|
|
388
|
-
} from "./cli-
|
|
388
|
+
} from "./cli-4ke1amr9.js";
|
|
389
389
|
import"./cli-z2zcxes1.js";
|
|
390
390
|
import"./cli-q21d49ac.js";
|
|
391
391
|
import"./cli-anrj584m.js";
|
|
392
|
-
import"./cli-
|
|
392
|
+
import"./cli-kavm2cv5.js";
|
|
393
393
|
import"./cli-4j2mrzag.js";
|
|
394
394
|
import"./cli-p9swy5t3.js";
|
|
395
395
|
init_db();
|
|
@@ -3,24 +3,24 @@ import {
|
|
|
3
3
|
getBufferMessageCount,
|
|
4
4
|
instantFlush,
|
|
5
5
|
wasEventSeen
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-y7v6e7yr.js";
|
|
7
7
|
import {
|
|
8
8
|
extractSlackMessageText,
|
|
9
9
|
extractTaskFromMessage,
|
|
10
10
|
hasOtherUserMention,
|
|
11
11
|
routeMessage
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-xqzvygxp.js";
|
|
13
13
|
import {
|
|
14
14
|
registerTreeMessage
|
|
15
|
-
} from "./cli-
|
|
15
|
+
} from "./cli-f1f82qgv.js";
|
|
16
16
|
import"./cli-rkndnn90.js";
|
|
17
17
|
import"./cli-b0p7rfnd.js";
|
|
18
18
|
import {
|
|
19
19
|
enrichSlackUserEmail,
|
|
20
20
|
resolveSlackUserId
|
|
21
|
-
} from "./cli-
|
|
22
|
-
import"./cli-
|
|
23
|
-
import"./cli-
|
|
21
|
+
} from "./cli-jrmjxsnk.js";
|
|
22
|
+
import"./cli-2b0ew5v8.js";
|
|
23
|
+
import"./cli-0d404x64.js";
|
|
24
24
|
import {
|
|
25
25
|
buildTreeBlocks
|
|
26
26
|
} from "./cli-6xd0bvf8.js";
|
|
@@ -28,7 +28,7 @@ import"./cli-wspgs9bt.js";
|
|
|
28
28
|
import {
|
|
29
29
|
createTaskWithSiblingAwareness,
|
|
30
30
|
slackContextKey
|
|
31
|
-
} from "./cli-
|
|
31
|
+
} from "./cli-aqr96mny.js";
|
|
32
32
|
import"./cli-dh55d5fg.js";
|
|
33
33
|
import {
|
|
34
34
|
getAgentById,
|
|
@@ -39,11 +39,11 @@ import {
|
|
|
39
39
|
init_db,
|
|
40
40
|
init_resolver,
|
|
41
41
|
resolveTemplate
|
|
42
|
-
} from "./cli-
|
|
42
|
+
} from "./cli-4ke1amr9.js";
|
|
43
43
|
import"./cli-z2zcxes1.js";
|
|
44
44
|
import"./cli-q21d49ac.js";
|
|
45
45
|
import"./cli-anrj584m.js";
|
|
46
|
-
import"./cli-
|
|
46
|
+
import"./cli-kavm2cv5.js";
|
|
47
47
|
import"./cli-4j2mrzag.js";
|
|
48
48
|
import"./cli-e15jhafb.js";
|
|
49
49
|
import {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
summarizeSession
|
|
3
|
-
} from "./cli-
|
|
4
|
-
import"./cli-amncg1dq.js";
|
|
3
|
+
} from "./cli-6wscj9z0.js";
|
|
5
4
|
import {
|
|
6
5
|
checkToolLoop,
|
|
7
6
|
clearToolHistory
|
|
@@ -14,6 +13,7 @@ import {
|
|
|
14
13
|
isLlmRaterEnabled,
|
|
15
14
|
postRatings
|
|
16
15
|
} from "./cli-dcfyyh3t.js";
|
|
16
|
+
import"./cli-tk9vyqzh.js";
|
|
17
17
|
import {
|
|
18
18
|
getApiKey
|
|
19
19
|
} from "./cli-f14fvzag.js";
|
|
@@ -30,7 +30,7 @@ import"./cli-anrj584m.js";
|
|
|
30
30
|
import {
|
|
31
31
|
init_package,
|
|
32
32
|
package_default
|
|
33
|
-
} from "./cli-
|
|
33
|
+
} from "./cli-kavm2cv5.js";
|
|
34
34
|
import"./cli-4j2mrzag.js";
|
|
35
35
|
import"./cli-xw7p4wkq.js";
|
|
36
36
|
import"./cli-4wgngmwv.js";
|