@openaide/codex-acp 1.1.3 → 1.1.5
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/index.js +14 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -23712,6 +23712,7 @@ var CodexSubagentEventRouter = class _CodexSubagentEventRouter {
|
|
|
23712
23712
|
replayQueue = [];
|
|
23713
23713
|
activeLegacyActivities = /* @__PURE__ */ new Set();
|
|
23714
23714
|
projectedPromptIds = /* @__PURE__ */ new Set();
|
|
23715
|
+
causalRootPrompts = /* @__PURE__ */ new Map();
|
|
23715
23716
|
async handle(notification) {
|
|
23716
23717
|
if (notification.method === "turn/started") {
|
|
23717
23718
|
return this.isKnownChild(notification.params.threadId);
|
|
@@ -23751,14 +23752,24 @@ var CodexSubagentEventRouter = class _CodexSubagentEventRouter {
|
|
|
23751
23752
|
if (!this.supported) {
|
|
23752
23753
|
return false;
|
|
23753
23754
|
}
|
|
23755
|
+
if (item.type === "userMessage" && notification.params.threadId === this.rootSessionId) {
|
|
23756
|
+
const text = item.content.filter((content) => content.type === "text").map((content) => content.text).join("").trim();
|
|
23757
|
+
if (text) this.causalRootPrompts.set(notification.params.turnId, { sourceId: item.id, text });
|
|
23758
|
+
return false;
|
|
23759
|
+
}
|
|
23754
23760
|
if (item.type === "subAgentActivity") {
|
|
23755
23761
|
if (isRootAgentPath(item.agentPath)) return true;
|
|
23756
23762
|
if (this.terminalPendingSpawns.has(item.agentThreadId)) return true;
|
|
23763
|
+
if (item.kind === "interacted") await this.reopen(item.agentThreadId);
|
|
23757
23764
|
let hasNativeRepresentation = this.children.has(item.agentThreadId);
|
|
23758
23765
|
if (!hasNativeRepresentation) {
|
|
23759
23766
|
await this.materialize(item.agentThreadId, item.agentPath);
|
|
23760
23767
|
hasNativeRepresentation = this.children.has(item.agentThreadId);
|
|
23761
23768
|
}
|
|
23769
|
+
if (hasNativeRepresentation && item.kind !== "interrupted") {
|
|
23770
|
+
const prompt = this.causalRootPrompts.get(notification.params.turnId);
|
|
23771
|
+
if (prompt) await this.projectPrompt(item.agentThreadId, prompt.sourceId, prompt.text);
|
|
23772
|
+
}
|
|
23762
23773
|
if (hasNativeRepresentation && item.kind === "interrupted") {
|
|
23763
23774
|
await this.finish(item.agentThreadId, "cancelled");
|
|
23764
23775
|
}
|
|
@@ -23987,7 +23998,7 @@ var CodexSubagentEventRouter = class _CodexSubagentEventRouter {
|
|
|
23987
23998
|
const reopened = {
|
|
23988
23999
|
parentThreadId: pending.parentThreadId,
|
|
23989
24000
|
parentSessionId,
|
|
23990
|
-
sessionId:
|
|
24001
|
+
sessionId: childThreadId,
|
|
23991
24002
|
name: fallbackName(childThreadId),
|
|
23992
24003
|
task: pending.task,
|
|
23993
24004
|
generation: 2
|
|
@@ -24004,12 +24015,10 @@ var CodexSubagentEventRouter = class _CodexSubagentEventRouter {
|
|
|
24004
24015
|
return;
|
|
24005
24016
|
}
|
|
24006
24017
|
if (!child.terminalState) return;
|
|
24007
|
-
const previousSessionId = child.sessionId;
|
|
24008
24018
|
const previousParentSessionId = child.parentSessionId;
|
|
24009
24019
|
const previousState = child.terminalState;
|
|
24010
24020
|
child.parentSessionId = this.children.get(child.parentThreadId)?.sessionId ?? this.rootSessionId;
|
|
24011
24021
|
child.generation += 1;
|
|
24012
|
-
child.sessionId = `${childThreadId}:generation:${child.generation}`;
|
|
24013
24022
|
delete child.terminalState;
|
|
24014
24023
|
try {
|
|
24015
24024
|
await this.session.update({
|
|
@@ -24021,7 +24030,6 @@ var CodexSubagentEventRouter = class _CodexSubagentEventRouter {
|
|
|
24021
24030
|
}, child.parentSessionId);
|
|
24022
24031
|
} catch (error51) {
|
|
24023
24032
|
child.generation -= 1;
|
|
24024
|
-
child.sessionId = previousSessionId;
|
|
24025
24033
|
child.parentSessionId = previousParentSessionId;
|
|
24026
24034
|
child.terminalState = previousState;
|
|
24027
24035
|
throw error51;
|
|
@@ -27261,7 +27269,7 @@ var package_default = {
|
|
|
27261
27269
|
publishConfig: {
|
|
27262
27270
|
access: "public"
|
|
27263
27271
|
},
|
|
27264
|
-
version: "1.1.
|
|
27272
|
+
version: "1.1.5",
|
|
27265
27273
|
description: "",
|
|
27266
27274
|
main: "dist/index.js",
|
|
27267
27275
|
bin: {
|
|
@@ -32516,7 +32524,7 @@ Check ${configPath} and project .codex directories, especially their config.toml
|
|
|
32516
32524
|
const previous = announced.get(item.agentThreadId);
|
|
32517
32525
|
if (previous && !previous.terminal) continue;
|
|
32518
32526
|
const generation = (previous?.generation ?? 0) + 1;
|
|
32519
|
-
const childSessionId =
|
|
32527
|
+
const childSessionId = item.agentThreadId;
|
|
32520
32528
|
const name = nameFromAgentPath(item.agentPath, `Agent ${item.agentThreadId.slice(-8)}`);
|
|
32521
32529
|
await session.update({
|
|
32522
32530
|
sessionUpdate: "subagent_spawned",
|