@desplega.ai/agent-swarm 1.110.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-837ktebk.js → actions-a4crgvtd.js} +6 -6
- package/dist/{app-85h97pg2.js → app-va5mr9yw.js} +3 -3
- package/dist/{assistant-yhrta0c5.js → assistant-0jm4vy8r.js} +9 -9
- package/dist/{boot-reembed-8xmfv2pq.js → boot-reembed-0t815mmm.js} +3 -3
- package/dist/{boot-reembed-5sd1t9r4.js → boot-reembed-50zzk97q.js} +4 -4
- package/dist/{boot-scrub-logs-fdw8wbtq.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-gb7dqnna.js → cli-0d404x64.js} +1 -1
- package/dist/{cli-5kav4x1a.js → cli-0d5xddf1.js} +7 -2
- package/dist/{cli-3t97r3y1.js → cli-1aqc46he.js} +5 -5
- package/dist/{cli-dhph6q98.js → cli-2b0ew5v8.js} +1 -1
- package/dist/{cli-6ttdv68b.js → cli-3cm8ar1c.js} +1 -1
- package/dist/{cli-2h86bsfe.js → cli-4f6vw5vy.js} +2 -2
- package/dist/{cli-d8vmtyyr.js → cli-4ke1amr9.js} +1 -1
- package/dist/{cli-3baz70yp.js → cli-6tfm5fr1.js} +1 -1
- package/dist/{cli-m3enfr8q.js → cli-6wscj9z0.js} +4 -4
- package/dist/{cli-0pzg1f8z.js → cli-8j1h9627.js} +14 -14
- package/dist/{cli-8ps5wsk9.js → cli-aqr96mny.js} +1 -1
- package/dist/{cli-w6zp4qcx.js → cli-ceewqajw.js} +37 -39
- package/dist/{cli-kna0r84e.js → cli-dza5039b.js} +317 -30
- package/dist/{cli-sjm0e1pa.js → cli-ee3fkebs.js} +2 -2
- package/dist/{cli-4trfcacj.js → cli-f1f82qgv.js} +5 -5
- package/dist/{cli-cwety9qq.js → cli-fdnpymsv.js} +2 -2
- package/dist/{cli-k6ssh5dk.js → cli-gchg43wt.js} +1 -1
- package/dist/{cli-dy01kwxk.js → cli-h3vhr1gj.js} +2 -2
- package/dist/{cli-8s0swp2t.js → cli-jrmjxsnk.js} +3 -3
- package/dist/{cli-kg9v8h1w.js → cli-kavm2cv5.js} +1 -1
- package/dist/{cli-zw3cmjh6.js → cli-r3y5chyg.js} +4 -4
- package/dist/{cli-gtt1f14h.js → cli-t8m00q3b.js} +3 -3
- package/dist/{cli-amncg1dq.js → cli-tk9vyqzh.js} +66 -9
- package/dist/{cli-g44ffxk5.js → cli-xqzvygxp.js} +1 -1
- package/dist/{cli-r19ttke3.js → cli-y7v6e7yr.js} +4 -4
- package/dist/{cli-vfyhrk9k.js → cli-z626gjqj.js} +1 -1
- package/dist/cli.js +11 -11
- 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-3fh75nzv.js → commands-t3rdvb55.js} +2 -2
- package/dist/{db-kwfxkhpw.js → db-mjqc8hj6.js} +2 -2
- package/dist/{handlers-jj8rzetb.js → handlers-mcmg5qgc.js} +9 -9
- package/dist/{hook-1b45zzz1.js → hook-0p4q1tym.js} +3 -3
- package/dist/{http-71964f7a.js → http-gs6fk9sg.js} +232 -37
- package/dist/{index-zm0x6vmf.js → index-20mf9wvc.js} +8 -8
- package/dist/{index-c35g752k.js → index-6zpajd9e.js} +7 -11
- package/dist/{index-464v93y6.js → index-744yvc8x.js} +9 -9
- package/dist/{index-e01wmtj0.js → index-w15fk28m.js} +7 -7
- package/dist/{keepalive-2gxqjgrx.js → keepalive-3gvnbxaj.js} +4 -4
- package/dist/{lead-twm4zp8y.js → lead-yjbmhj3g.js} +20 -20
- package/dist/{maintenance-1htsnyz6.js → maintenance-jbvy2bfg.js} +4 -4
- package/dist/{onboard-1y1pdzt5.js → onboard-sexatejh.js} +2 -2
- package/dist/{otel-impl-pw9tnc80.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-tqvvrk7a.js → pricing-refresh-rat240yg.js} +4 -4
- package/dist/{seed-pricing-f23sehzq.js → seed-pricing-7yfaf123.js} +3 -3
- package/dist/{setup-jtw9rz9t.js → setup-vm5vcc6c.js} +2 -2
- package/dist/{worker-jxrmzwb9.js → worker-02y2r0r2.js} +20 -20
- package/openapi.json +1010 -2
- package/package.json +1 -1
- 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/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/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/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
package/README.md
CHANGED
|
@@ -123,7 +123,7 @@ Check [our templates](https://templates.agent-swarm.dev) for a quick start.
|
|
|
123
123
|
|
|
124
124
|
- **Lead/worker orchestration in Docker** — isolated dev environments, priority queues, pause/resume across deploys. [Architecture →](https://docs.agent-swarm.dev/docs/architecture/overview)
|
|
125
125
|
- **Compounding memory & persistent identity** — agents remember past sessions and evolve their own persona, expertise, and notes. [Memory →](https://docs.agent-swarm.dev/docs/architecture/memory) · [Agents →](https://docs.agent-swarm.dev/docs/architecture/agents)
|
|
126
|
-
- **Hybrid
|
|
126
|
+
- **Hybrid + graph-linked memory recall** — memory retrieval can blend vector and full-text ranking, expand through linked memories, surface usefulness readouts, and let agents correct an existing memory without losing its ID or history. [Memory →](https://docs.agent-swarm.dev/docs/architecture/memory) · [MCP tools →](https://docs.agent-swarm.dev/docs/reference/mcp-tools#memory-tools)
|
|
127
127
|
- **Multi-channel inputs** — Slack, GitHub, GitLab, email, WhatsApp, Linear, Jira, and the HTTP API all create tasks. [Integrations](#integrations)
|
|
128
128
|
- **Workflow engine with Human-in-the-Loop** — DAG-based automation with approval gates, retries, and structured I/O. [Workflows →](https://docs.agent-swarm.dev/docs/concepts/workflows)
|
|
129
129
|
- **Scheduled & recurring tasks** — cron-based automation for standing work, with schedules that can target agent tasks, workflows, or catalog scripts. [Scheduling →](https://docs.agent-swarm.dev/docs/concepts/scheduling)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveSlackUserId
|
|
3
|
-
} from "./cli-
|
|
4
|
-
import"./cli-
|
|
5
|
-
import"./cli-
|
|
3
|
+
} from "./cli-jrmjxsnk.js";
|
|
4
|
+
import"./cli-2b0ew5v8.js";
|
|
5
|
+
import"./cli-0d404x64.js";
|
|
6
6
|
import {
|
|
7
7
|
buildCancelledBlocks,
|
|
8
8
|
getTaskLink
|
|
@@ -11,7 +11,7 @@ import"./cli-wspgs9bt.js";
|
|
|
11
11
|
import {
|
|
12
12
|
createTaskWithSiblingAwareness,
|
|
13
13
|
slackContextKey
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-aqr96mny.js";
|
|
15
15
|
import"./cli-dh55d5fg.js";
|
|
16
16
|
import {
|
|
17
17
|
cancelTask,
|
|
@@ -19,11 +19,11 @@ import {
|
|
|
19
19
|
getLeadAgent,
|
|
20
20
|
getTaskById,
|
|
21
21
|
init_db
|
|
22
|
-
} from "./cli-
|
|
22
|
+
} from "./cli-4ke1amr9.js";
|
|
23
23
|
import"./cli-z2zcxes1.js";
|
|
24
24
|
import"./cli-q21d49ac.js";
|
|
25
25
|
import"./cli-anrj584m.js";
|
|
26
|
-
import"./cli-
|
|
26
|
+
import"./cli-kavm2cv5.js";
|
|
27
27
|
import"./cli-4j2mrzag.js";
|
|
28
28
|
import"./cli-p9swy5t3.js";
|
|
29
29
|
|
|
@@ -3,17 +3,17 @@ import {
|
|
|
3
3
|
initSlackApp,
|
|
4
4
|
startSlackApp,
|
|
5
5
|
stopSlackApp
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-f1f82qgv.js";
|
|
7
7
|
import"./cli-rkndnn90.js";
|
|
8
8
|
import"./cli-b0p7rfnd.js";
|
|
9
9
|
import"./cli-6xd0bvf8.js";
|
|
10
10
|
import"./cli-wspgs9bt.js";
|
|
11
11
|
import"./cli-dh55d5fg.js";
|
|
12
|
-
import"./cli-
|
|
12
|
+
import"./cli-4ke1amr9.js";
|
|
13
13
|
import"./cli-z2zcxes1.js";
|
|
14
14
|
import"./cli-q21d49ac.js";
|
|
15
15
|
import"./cli-anrj584m.js";
|
|
16
|
-
import"./cli-
|
|
16
|
+
import"./cli-kavm2cv5.js";
|
|
17
17
|
import"./cli-4j2mrzag.js";
|
|
18
18
|
import"./cli-e15jhafb.js";
|
|
19
19
|
import"./cli-7wmybrt5.js";
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
bufferThreadMessage,
|
|
3
3
|
wasEventSeen
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-y7v6e7yr.js";
|
|
5
5
|
import {
|
|
6
6
|
hasOtherUserMention
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-xqzvygxp.js";
|
|
8
8
|
import {
|
|
9
9
|
require_dist
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-f1f82qgv.js";
|
|
11
11
|
import"./cli-rkndnn90.js";
|
|
12
12
|
import"./cli-b0p7rfnd.js";
|
|
13
13
|
import {
|
|
14
14
|
resolveSlackUserId
|
|
15
|
-
} from "./cli-
|
|
16
|
-
import"./cli-
|
|
17
|
-
import"./cli-
|
|
15
|
+
} from "./cli-jrmjxsnk.js";
|
|
16
|
+
import"./cli-2b0ew5v8.js";
|
|
17
|
+
import"./cli-0d404x64.js";
|
|
18
18
|
import"./cli-6xd0bvf8.js";
|
|
19
19
|
import"./cli-wspgs9bt.js";
|
|
20
20
|
import {
|
|
21
21
|
createTaskWithSiblingAwareness,
|
|
22
22
|
slackContextKey
|
|
23
|
-
} from "./cli-
|
|
23
|
+
} from "./cli-aqr96mny.js";
|
|
24
24
|
import"./cli-dh55d5fg.js";
|
|
25
25
|
import {
|
|
26
26
|
getAgentWorkingOnThread,
|
|
@@ -29,11 +29,11 @@ import {
|
|
|
29
29
|
init_db,
|
|
30
30
|
init_resolver,
|
|
31
31
|
resolveTemplate
|
|
32
|
-
} from "./cli-
|
|
32
|
+
} from "./cli-4ke1amr9.js";
|
|
33
33
|
import"./cli-z2zcxes1.js";
|
|
34
34
|
import"./cli-q21d49ac.js";
|
|
35
35
|
import"./cli-anrj584m.js";
|
|
36
|
-
import"./cli-
|
|
36
|
+
import"./cli-kavm2cv5.js";
|
|
37
37
|
import"./cli-4j2mrzag.js";
|
|
38
38
|
import"./cli-e15jhafb.js";
|
|
39
39
|
import"./cli-7wmybrt5.js";
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
getEmbeddingProvider,
|
|
4
4
|
getMemoryStore,
|
|
5
5
|
init_constants
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-0d5xddf1.js";
|
|
7
7
|
import"./cli-q25ejbyn.js";
|
|
8
8
|
import {
|
|
9
9
|
getDb,
|
|
10
10
|
init_db
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-4ke1amr9.js";
|
|
12
12
|
import"./cli-z2zcxes1.js";
|
|
13
13
|
import"./cli-q21d49ac.js";
|
|
14
14
|
import"./cli-anrj584m.js";
|
|
15
|
-
import"./cli-
|
|
15
|
+
import"./cli-kavm2cv5.js";
|
|
16
16
|
import"./cli-4j2mrzag.js";
|
|
17
17
|
import"./cli-p9swy5t3.js";
|
|
18
18
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
embedScript,
|
|
3
3
|
embeddingProvider
|
|
4
|
-
} from "./cli-
|
|
5
|
-
import"./cli-
|
|
4
|
+
} from "./cli-h3vhr1gj.js";
|
|
5
|
+
import"./cli-0d5xddf1.js";
|
|
6
6
|
import"./cli-q25ejbyn.js";
|
|
7
7
|
import {
|
|
8
8
|
getDb,
|
|
9
9
|
init_db
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-4ke1amr9.js";
|
|
11
11
|
import"./cli-z2zcxes1.js";
|
|
12
12
|
import"./cli-q21d49ac.js";
|
|
13
13
|
import"./cli-anrj584m.js";
|
|
14
|
-
import"./cli-
|
|
14
|
+
import"./cli-kavm2cv5.js";
|
|
15
15
|
import"./cli-4j2mrzag.js";
|
|
16
16
|
import"./cli-p9swy5t3.js";
|
|
17
17
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getDb,
|
|
3
3
|
init_db
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-4ke1amr9.js";
|
|
5
5
|
import"./cli-z2zcxes1.js";
|
|
6
6
|
import"./cli-q21d49ac.js";
|
|
7
7
|
import"./cli-anrj584m.js";
|
|
8
|
-
import"./cli-
|
|
8
|
+
import"./cli-kavm2cv5.js";
|
|
9
9
|
import {
|
|
10
10
|
init_secret_scrubber,
|
|
11
11
|
scrubSecrets
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
getDb,
|
|
7
7
|
init_db,
|
|
8
8
|
isSqliteVecAvailable
|
|
9
|
-
} from "./cli-
|
|
9
|
+
} from "./cli-4ke1amr9.js";
|
|
10
10
|
import {
|
|
11
11
|
__esm,
|
|
12
12
|
__export,
|
|
@@ -25,6 +25,10 @@ function isHybridSearchEnabled() {
|
|
|
25
25
|
const val = process.env.MEMORY_HYBRID_SEARCH ?? "0";
|
|
26
26
|
return val === "1" || val.toLowerCase() === "true";
|
|
27
27
|
}
|
|
28
|
+
function isGraphExpansionEnabled() {
|
|
29
|
+
const val = process.env.MEMORY_GRAPH_EXPANSION ?? "0";
|
|
30
|
+
return val === "1" || val.toLowerCase() === "true";
|
|
31
|
+
}
|
|
28
32
|
var TTL_DEFAULTS, GLOBAL_HALF_LIFE_OVERRIDE, GLOBAL_HALF_LIFE, RECENCY_DECAY_HALF_LIFE, RECENCY_DECAY_HALF_LIFE_DAYS, SOURCE_QUALITY_MULTIPLIER, MIN_SIMILARITY, ACCESS_BOOST_MAX_MULTIPLIER, ACCESS_BOOST_RECENCY_WINDOW_HOURS, CANDIDATE_SET_MULTIPLIER, EMBEDDING_DIMENSIONS, DEFAULT_EMBEDDING_MODEL = "openai/text-embedding-3-small", PROTECTED_SOURCES;
|
|
29
33
|
var init_constants = __esm(() => {
|
|
30
34
|
TTL_DEFAULTS = {
|
|
@@ -6599,6 +6603,7 @@ var init_reranker = __esm(() => {
|
|
|
6599
6603
|
// src/be/memory/providers/sqlite-store.ts
|
|
6600
6604
|
var exports_sqlite_store = {};
|
|
6601
6605
|
__export(exports_sqlite_store, {
|
|
6606
|
+
rowToCandidate: () => rowToCandidate,
|
|
6602
6607
|
computeRrfScore: () => computeRrfScore,
|
|
6603
6608
|
applyEditMode: () => applyEditMode,
|
|
6604
6609
|
SqliteMemoryStore: () => SqliteMemoryStore
|
|
@@ -7362,4 +7367,4 @@ function getMemoryStore() {
|
|
|
7362
7367
|
return memoryStore;
|
|
7363
7368
|
}
|
|
7364
7369
|
|
|
7365
|
-
export { CANDIDATE_SET_MULTIPLIER, EMBEDDING_DIMENSIONS, init_constants, cosineSimilarity, serializeEmbedding, deserializeEmbedding, init_embedding, rerank, init_reranker, getEmbeddingProvider, getMemoryStore };
|
|
7370
|
+
export { CANDIDATE_SET_MULTIPLIER, isGraphExpansionEnabled, EMBEDDING_DIMENSIONS, init_constants, cosineSimilarity, serializeEmbedding, deserializeEmbedding, init_embedding, computeScore, rerank, init_reranker, rowToCandidate, init_sqlite_store, getEmbeddingProvider, getMemoryStore };
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
getScriptVersion,
|
|
10
10
|
listRelationalCredentialBindings,
|
|
11
11
|
validateScriptImports
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-4f6vw5vy.js";
|
|
13
13
|
import {
|
|
14
14
|
withSiblingAwareness,
|
|
15
15
|
workflowContextKey
|
|
16
|
-
} from "./cli-
|
|
16
|
+
} from "./cli-aqr96mny.js";
|
|
17
17
|
import {
|
|
18
18
|
getAppUrl
|
|
19
19
|
} from "./cli-dh55d5fg.js";
|
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
telemetry,
|
|
63
63
|
updateWorkflowRun,
|
|
64
64
|
updateWorkflowRunStep
|
|
65
|
-
} from "./cli-
|
|
65
|
+
} from "./cli-4ke1amr9.js";
|
|
66
66
|
import {
|
|
67
67
|
init_zod
|
|
68
68
|
} from "./cli-q21d49ac.js";
|
|
@@ -2515,7 +2515,7 @@ class HumanInTheLoopExecutor extends BaseExecutor {
|
|
|
2515
2515
|
}
|
|
2516
2516
|
if (notification.channel === "slack") {
|
|
2517
2517
|
try {
|
|
2518
|
-
const { getSlackApp } = await import("./app-
|
|
2518
|
+
const { getSlackApp } = await import("./app-va5mr9yw.js");
|
|
2519
2519
|
const slackApp = getSlackApp();
|
|
2520
2520
|
if (!slackApp) {
|
|
2521
2521
|
console.warn("[HITL] Slack not initialized — cannot send notification");
|
|
@@ -2629,7 +2629,7 @@ class NotifyExecutor extends BaseExecutor {
|
|
|
2629
2629
|
}
|
|
2630
2630
|
}
|
|
2631
2631
|
case "slack": {
|
|
2632
|
-
const { getSlackApp } = await import("./app-
|
|
2632
|
+
const { getSlackApp } = await import("./app-va5mr9yw.js");
|
|
2633
2633
|
const app = getSlackApp();
|
|
2634
2634
|
if (!app) {
|
|
2635
2635
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
embedScript
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-h3vhr1gj.js";
|
|
4
4
|
import {
|
|
5
5
|
computeContentHash,
|
|
6
6
|
decryptSecret,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
getSwarmConfigs,
|
|
11
11
|
init_crypto,
|
|
12
12
|
init_db
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-4ke1amr9.js";
|
|
14
14
|
import {
|
|
15
15
|
init_zod
|
|
16
16
|
} from "./cli-q21d49ac.js";
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getValidCodexOAuth,
|
|
3
|
-
persistCodexOAuth
|
|
4
|
-
} from "./cli-amncg1dq.js";
|
|
5
1
|
import {
|
|
6
2
|
appendAssistantMessageDiagnostic,
|
|
7
3
|
cleanupSessionResources,
|
|
@@ -15,6 +11,10 @@ import {
|
|
|
15
11
|
SummaryWithRatingsSchema,
|
|
16
12
|
buildSummaryWithRatingsPrompt
|
|
17
13
|
} from "./cli-dcfyyh3t.js";
|
|
14
|
+
import {
|
|
15
|
+
getValidCodexOAuth,
|
|
16
|
+
persistCodexOAuth
|
|
17
|
+
} from "./cli-tk9vyqzh.js";
|
|
18
18
|
import {
|
|
19
19
|
init_zod
|
|
20
20
|
} from "./cli-q21d49ac.js";
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
credentialsToAuthJson
|
|
5
|
-
} from "./cli-w6zp4qcx.js";
|
|
6
|
-
import {
|
|
7
|
-
loadAllCodexOAuthSlots
|
|
8
|
-
} from "./cli-amncg1dq.js";
|
|
2
|
+
checkCodexCredentials
|
|
3
|
+
} from "./cli-ceewqajw.js";
|
|
9
4
|
import {
|
|
10
5
|
checkClaudeManagedCredentials
|
|
11
6
|
} from "./cli-2r7s8jhp.js";
|
|
@@ -23,7 +18,12 @@ import {
|
|
|
23
18
|
withSpan,
|
|
24
19
|
withSpanContext,
|
|
25
20
|
writeSkillsToFilesystem
|
|
26
|
-
} from "./cli-
|
|
21
|
+
} from "./cli-dza5039b.js";
|
|
22
|
+
import {
|
|
23
|
+
authJsonToCredentialSelection,
|
|
24
|
+
credentialsToAuthJson,
|
|
25
|
+
loadAllCodexOAuthSlots
|
|
26
|
+
} from "./cli-tk9vyqzh.js";
|
|
27
27
|
import {
|
|
28
28
|
checkClaudeCredentials
|
|
29
29
|
} from "./cli-2fc97xm5.js";
|
|
@@ -40,10 +40,10 @@ import {
|
|
|
40
40
|
import {
|
|
41
41
|
ensure,
|
|
42
42
|
initialize
|
|
43
|
-
} from "./cli-
|
|
43
|
+
} from "./cli-r3y5chyg.js";
|
|
44
44
|
import {
|
|
45
45
|
validateJsonSchema
|
|
46
|
-
} from "./cli-
|
|
46
|
+
} from "./cli-1aqc46he.js";
|
|
47
47
|
import {
|
|
48
48
|
getApiKey
|
|
49
49
|
} from "./cli-f14fvzag.js";
|
|
@@ -79,7 +79,7 @@ import {
|
|
|
79
79
|
resolveTaskModelSelection,
|
|
80
80
|
resolveTemplateAsync,
|
|
81
81
|
telemetry
|
|
82
|
-
} from "./cli-
|
|
82
|
+
} from "./cli-4ke1amr9.js";
|
|
83
83
|
import {
|
|
84
84
|
init_credentials,
|
|
85
85
|
resolveCredentialPools
|
|
@@ -445,11 +445,11 @@ async function createProviderAdapter(provider) {
|
|
|
445
445
|
return new ClaudeAdapter;
|
|
446
446
|
}
|
|
447
447
|
case "pi": {
|
|
448
|
-
const { PiMonoAdapter } = await import("./pi-mono-adapter-
|
|
448
|
+
const { PiMonoAdapter } = await import("./pi-mono-adapter-kxjxpfgy.js");
|
|
449
449
|
return new PiMonoAdapter;
|
|
450
450
|
}
|
|
451
451
|
case "codex": {
|
|
452
|
-
const { CodexAdapter } = await import("./codex-adapter-
|
|
452
|
+
const { CodexAdapter } = await import("./codex-adapter-5cmy858w.js");
|
|
453
453
|
return new CodexAdapter;
|
|
454
454
|
}
|
|
455
455
|
case "claude-managed": {
|
|
@@ -1109,7 +1109,7 @@ async function checkProviderCredentials(provider, env, opts) {
|
|
|
1109
1109
|
case "opencode":
|
|
1110
1110
|
return checkOpencodeCredentials(env, opts);
|
|
1111
1111
|
case "pi": {
|
|
1112
|
-
const { checkPiMonoCredentials } = await import("./pi-mono-adapter-
|
|
1112
|
+
const { checkPiMonoCredentials } = await import("./pi-mono-adapter-kxjxpfgy.js");
|
|
1113
1113
|
return checkPiMonoCredentials(env, opts);
|
|
1114
1114
|
}
|
|
1115
1115
|
default:
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
summarizeSession
|
|
3
|
-
} from "./cli-
|
|
4
|
-
import {
|
|
5
|
-
extractChatgptUserId,
|
|
6
|
-
getValidCodexOAuth
|
|
7
|
-
} from "./cli-amncg1dq.js";
|
|
3
|
+
} from "./cli-6wscj9z0.js";
|
|
8
4
|
import {
|
|
9
5
|
createSwarmEventHandler
|
|
10
6
|
} from "./cli-07er7wrs.js";
|
|
@@ -19,6 +15,11 @@ import {
|
|
|
19
15
|
fetchRetrievalsForTask,
|
|
20
16
|
postRatings
|
|
21
17
|
} from "./cli-dcfyyh3t.js";
|
|
18
|
+
import {
|
|
19
|
+
CodexOAuthRefreshError,
|
|
20
|
+
credentialsToAuthJson,
|
|
21
|
+
getValidCodexOAuth
|
|
22
|
+
} from "./cli-tk9vyqzh.js";
|
|
22
23
|
import {
|
|
23
24
|
SessionErrorTracker,
|
|
24
25
|
buildOtelTraceparentEnv
|
|
@@ -687,37 +688,6 @@ function computeCodexCostUsd(model, inputTokens, cachedInputTokens, outputTokens
|
|
|
687
688
|
return inputCost + cachedCost + outputCost;
|
|
688
689
|
}
|
|
689
690
|
|
|
690
|
-
// src/providers/codex-oauth/auth-json.ts
|
|
691
|
-
function authJsonToCredentialSelection(auth, slot = 0, total = 1) {
|
|
692
|
-
const userId = extractChatgptUserId(auth.tokens.access_token);
|
|
693
|
-
const suffixSource = userId ?? auth.tokens.account_id;
|
|
694
|
-
if (!userId) {
|
|
695
|
-
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.");
|
|
696
|
-
}
|
|
697
|
-
return {
|
|
698
|
-
selected: auth.tokens.account_id,
|
|
699
|
-
index: slot,
|
|
700
|
-
total,
|
|
701
|
-
keySuffix: suffixSource.slice(-5),
|
|
702
|
-
keyType: "CODEX_OAUTH",
|
|
703
|
-
isRateLimitFallback: false
|
|
704
|
-
};
|
|
705
|
-
}
|
|
706
|
-
function credentialsToAuthJson(creds, opts = {}) {
|
|
707
|
-
const includeRefreshToken = opts.includeRefreshToken ?? true;
|
|
708
|
-
return {
|
|
709
|
-
auth_mode: "chatgpt",
|
|
710
|
-
OPENAI_API_KEY: null,
|
|
711
|
-
tokens: {
|
|
712
|
-
id_token: creds.access,
|
|
713
|
-
access_token: creds.access,
|
|
714
|
-
refresh_token: includeRefreshToken ? creds.refresh : "",
|
|
715
|
-
account_id: creds.accountId
|
|
716
|
-
},
|
|
717
|
-
last_refresh: new Date(creds.expires).toISOString()
|
|
718
|
-
};
|
|
719
|
-
}
|
|
720
|
-
|
|
721
691
|
// src/providers/codex-swarm-events.ts
|
|
722
692
|
function createCodexSwarmEventHandler(opts) {
|
|
723
693
|
return createSwarmEventHandler({
|
|
@@ -778,7 +748,23 @@ async function resolveCodexAuthMode(config, emit, deps = {}) {
|
|
|
778
748
|
const slot = config.codexSlot ?? 0;
|
|
779
749
|
const isPoolSlot = config.codexSlot !== undefined;
|
|
780
750
|
if (config.apiUrl && config.apiKey && (currentMode !== "chatgpt" || isPoolSlot)) {
|
|
781
|
-
|
|
751
|
+
let oauthCreds = null;
|
|
752
|
+
try {
|
|
753
|
+
oauthCreds = await getValidCodexOAuth(config.apiUrl, config.apiKey, slot);
|
|
754
|
+
} catch (err) {
|
|
755
|
+
if (isPoolSlot) {
|
|
756
|
+
throw new Error(buildPoolRevalidationFailureReason(err, slot));
|
|
757
|
+
}
|
|
758
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
759
|
+
emit({
|
|
760
|
+
type: "raw_stderr",
|
|
761
|
+
content: `[codex] OAuth revalidation failed (non-fatal, non-pool auth): ${message}
|
|
762
|
+
`
|
|
763
|
+
});
|
|
764
|
+
}
|
|
765
|
+
if (!oauthCreds && isPoolSlot) {
|
|
766
|
+
throw new Error(`[auth-error] Codex pool slot ${slot} revalidation failed: no credentials found in config store — the slot may have just been quarantined; re-run codex-login for this slot if this persists.`);
|
|
767
|
+
}
|
|
782
768
|
if (oauthCreds) {
|
|
783
769
|
try {
|
|
784
770
|
const authJson = credentialsToAuthJson(oauthCreds, {
|
|
@@ -805,6 +791,16 @@ async function resolveCodexAuthMode(config, emit, deps = {}) {
|
|
|
805
791
|
}
|
|
806
792
|
return currentMode;
|
|
807
793
|
}
|
|
794
|
+
function buildPoolRevalidationFailureReason(err, slot) {
|
|
795
|
+
if (err instanceof CodexOAuthRefreshError) {
|
|
796
|
+
if (err.reason === "lock_timeout") {
|
|
797
|
+
return `[auth-error] Codex pool slot ${slot} [...${err.keySuffix}] revalidation failed: timed out waiting for the refresh lock — transient, will retry on next task.`;
|
|
798
|
+
}
|
|
799
|
+
return `[auth-error] Codex pool slot ${slot} [...${err.keySuffix}] revalidation failed: refresh rejected (${err.status ?? "unknown status"} ${err.body ?? ""}) — credential likely revoked; re-run codex-login for this slot.`;
|
|
800
|
+
}
|
|
801
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
802
|
+
return `[auth-error] Codex pool slot ${slot} revalidation failed: ${message}`;
|
|
803
|
+
}
|
|
808
804
|
async function buildCodexConfig(config, model, emit) {
|
|
809
805
|
const mcpServers = {};
|
|
810
806
|
mcpServers["agent-swarm"] = {
|
|
@@ -1260,7 +1256,9 @@ class CodexSession {
|
|
|
1260
1256
|
"invalid_api_key",
|
|
1261
1257
|
"missing api key",
|
|
1262
1258
|
"no api key",
|
|
1263
|
-
"authentication failed"
|
|
1259
|
+
"authentication failed",
|
|
1260
|
+
"failed to refresh token",
|
|
1261
|
+
"invalid 'refresh_token'"
|
|
1264
1262
|
];
|
|
1265
1263
|
if (authPatterns.some((p) => normalized.includes(p))) {
|
|
1266
1264
|
return {
|
|
@@ -1697,4 +1695,4 @@ class CodexAdapter {
|
|
|
1697
1695
|
}
|
|
1698
1696
|
}
|
|
1699
1697
|
|
|
1700
|
-
export {
|
|
1698
|
+
export { checkCodexCredentials, resolveCodexAuthMode, buildCodexConfig, CodexSession, createInProcessCodexSession, resolveCodexRunnerArgv, CodexAdapter };
|