@agentclientprotocol/codex-acp 1.12.1-preview.1 → 1.12.1-preview.2
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 +36 -19
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -22893,11 +22893,17 @@ function stripShellPrefix(command) {
|
|
|
22893
22893
|
// src/TerminalOutputMode.ts
|
|
22894
22894
|
function resolveTerminalOutputMode(clientCapabilities) {
|
|
22895
22895
|
const meta3 = clientCapabilities?._meta;
|
|
22896
|
+
if (meta3?.["terminal_output_delta"] === true) {
|
|
22897
|
+
return "terminal_output_delta";
|
|
22898
|
+
}
|
|
22896
22899
|
if (meta3?.["terminal_output"] === true) {
|
|
22897
22900
|
return "terminal_output";
|
|
22898
22901
|
}
|
|
22899
22902
|
return "terminal_output_delta";
|
|
22900
22903
|
}
|
|
22904
|
+
function clientSupportsTerminalOutputDelta(clientCapabilities) {
|
|
22905
|
+
return clientCapabilities?._meta?.["terminal_output_delta"] === true;
|
|
22906
|
+
}
|
|
22901
22907
|
function createTerminalOutputMeta(mode, terminalId, data) {
|
|
22902
22908
|
switch (mode) {
|
|
22903
22909
|
case "terminal_output":
|
|
@@ -24628,7 +24634,7 @@ var CodexEventHandler = class _CodexEventHandler {
|
|
|
24628
24634
|
disposed = false;
|
|
24629
24635
|
seenReasoningDeltaItemIds = /* @__PURE__ */ new Set();
|
|
24630
24636
|
terminalCommandIds = /* @__PURE__ */ new Set();
|
|
24631
|
-
|
|
24637
|
+
commandOutputIds = /* @__PURE__ */ new Set();
|
|
24632
24638
|
agentMessagePhases = /* @__PURE__ */ new Map();
|
|
24633
24639
|
turnDiffs = /* @__PURE__ */ new Map();
|
|
24634
24640
|
oversizedTurnDiffs = /* @__PURE__ */ new Set();
|
|
@@ -24964,6 +24970,8 @@ var CodexEventHandler = class _CodexEventHandler {
|
|
|
24964
24970
|
return this.createThreadGoalClearedEvent(notification.params);
|
|
24965
24971
|
case "item/commandExecution/terminalInteraction":
|
|
24966
24972
|
return this.createTerminalInteractionEvent(notification.params);
|
|
24973
|
+
case "thread/attachment/updated":
|
|
24974
|
+
return null;
|
|
24967
24975
|
// ignored events
|
|
24968
24976
|
case "thread/deleted":
|
|
24969
24977
|
case "thread/reverted":
|
|
@@ -25119,7 +25127,7 @@ ${event.details}` : event.summary;
|
|
|
25119
25127
|
this.terminalCommandIds.add(event.item.id);
|
|
25120
25128
|
} else {
|
|
25121
25129
|
this.terminalCommandIds.delete(event.item.id);
|
|
25122
|
-
this.
|
|
25130
|
+
this.commandOutputIds.delete(event.item.id);
|
|
25123
25131
|
}
|
|
25124
25132
|
return await createCommandExecutionUpdate(event.item);
|
|
25125
25133
|
}
|
|
@@ -25316,8 +25324,8 @@ ${event.details}` : event.summary;
|
|
|
25316
25324
|
return createAgentTextMessageChunk("*Context compacted to fit the model's context window.*\n\n");
|
|
25317
25325
|
}
|
|
25318
25326
|
createCommandOutputDeltaEvent(event) {
|
|
25319
|
-
if (
|
|
25320
|
-
this.
|
|
25327
|
+
if (event.delta.length > 0) {
|
|
25328
|
+
this.commandOutputIds.add(event.itemId);
|
|
25321
25329
|
}
|
|
25322
25330
|
return this.createCommandOutputEvent(event.itemId, event.delta, this.commandOutputMode(event.itemId));
|
|
25323
25331
|
}
|
|
@@ -25393,28 +25401,32 @@ ${event.stdin}
|
|
|
25393
25401
|
toolCallId: item.id,
|
|
25394
25402
|
...name === void 0 ? {} : { name },
|
|
25395
25403
|
status: item.status === "completed" ? "completed" : "failed",
|
|
25396
|
-
|
|
25397
|
-
|
|
25398
|
-
|
|
25404
|
+
...this.sessionState.terminalOutputDeltaSupported ? {} : {
|
|
25405
|
+
rawOutput: {
|
|
25406
|
+
formatted_output: item.aggregatedOutput ?? "",
|
|
25407
|
+
exit_code: item.exitCode
|
|
25408
|
+
}
|
|
25399
25409
|
}
|
|
25400
25410
|
};
|
|
25401
25411
|
const commandHadTerminal = this.terminalCommandIds.delete(item.id);
|
|
25402
|
-
const commandHadOutput = this.
|
|
25403
|
-
if (!commandHadTerminal) {
|
|
25404
|
-
return update;
|
|
25405
|
-
}
|
|
25412
|
+
const commandHadOutput = this.commandOutputIds.delete(item.id);
|
|
25406
25413
|
const terminalMeta = {};
|
|
25407
|
-
if (!commandHadOutput && item.aggregatedOutput) {
|
|
25414
|
+
if (!commandHadOutput && item.aggregatedOutput && (commandHadTerminal || this.sessionState.terminalOutputDeltaSupported)) {
|
|
25408
25415
|
Object.assign(
|
|
25409
25416
|
terminalMeta,
|
|
25410
25417
|
createTerminalOutputMeta(this.sessionState.terminalOutputMode, item.id, item.aggregatedOutput)
|
|
25411
25418
|
);
|
|
25412
25419
|
}
|
|
25413
|
-
|
|
25414
|
-
|
|
25415
|
-
|
|
25416
|
-
|
|
25417
|
-
|
|
25420
|
+
if (commandHadTerminal) {
|
|
25421
|
+
terminalMeta["terminal_exit"] = {
|
|
25422
|
+
exit_code: item.exitCode,
|
|
25423
|
+
signal: null,
|
|
25424
|
+
terminal_id: item.id
|
|
25425
|
+
};
|
|
25426
|
+
}
|
|
25427
|
+
if (Object.keys(terminalMeta).length === 0) {
|
|
25428
|
+
return update;
|
|
25429
|
+
}
|
|
25418
25430
|
return {
|
|
25419
25431
|
...update,
|
|
25420
25432
|
_meta: terminalMeta
|
|
@@ -27866,7 +27878,7 @@ var package_default = {
|
|
|
27866
27878
|
publishConfig: {
|
|
27867
27879
|
access: "public"
|
|
27868
27880
|
},
|
|
27869
|
-
version: "1.12.1-preview.
|
|
27881
|
+
version: "1.12.1-preview.2",
|
|
27870
27882
|
description: "",
|
|
27871
27883
|
main: "dist/index.js",
|
|
27872
27884
|
bin: {
|
|
@@ -27929,7 +27941,7 @@ var package_default = {
|
|
|
27929
27941
|
},
|
|
27930
27942
|
dependencies: {
|
|
27931
27943
|
"@agentclientprotocol/sdk": "^1.4.0",
|
|
27932
|
-
"@openai/codex": "^0.
|
|
27944
|
+
"@openai/codex": "^0.155.1",
|
|
27933
27945
|
diff: "^9.0.0",
|
|
27934
27946
|
open: "^11.0.1",
|
|
27935
27947
|
"vscode-jsonrpc": "^9.0.1",
|
|
@@ -32430,6 +32442,7 @@ var CodexAcpServer = class {
|
|
|
32430
32442
|
clientInfo;
|
|
32431
32443
|
clientCapabilities;
|
|
32432
32444
|
terminalOutputMode;
|
|
32445
|
+
terminalOutputDeltaSupported;
|
|
32433
32446
|
booleanConfigOptionsSupported;
|
|
32434
32447
|
/** Last `authStatus` pushed to the client; used to suppress duplicates. */
|
|
32435
32448
|
currentAuthStatus;
|
|
@@ -32469,6 +32482,7 @@ var CodexAcpServer = class {
|
|
|
32469
32482
|
this.clientInfo = null;
|
|
32470
32483
|
this.clientCapabilities = null;
|
|
32471
32484
|
this.terminalOutputMode = "terminal_output_delta";
|
|
32485
|
+
this.terminalOutputDeltaSupported = false;
|
|
32472
32486
|
this.booleanConfigOptionsSupported = false;
|
|
32473
32487
|
this.currentAuthStatus = null;
|
|
32474
32488
|
this.availableCommands = this.createAvailableCommands(codexAcpClient);
|
|
@@ -32488,6 +32502,7 @@ var CodexAcpServer = class {
|
|
|
32488
32502
|
this.clientCapabilities = _params.clientCapabilities ?? null;
|
|
32489
32503
|
this.initializeRequest = _params;
|
|
32490
32504
|
this.terminalOutputMode = resolveTerminalOutputMode(_params.clientCapabilities);
|
|
32505
|
+
this.terminalOutputDeltaSupported = clientSupportsTerminalOutputDelta(_params.clientCapabilities);
|
|
32491
32506
|
this.booleanConfigOptionsSupported = clientSupportsBooleanConfigOptions(_params.clientCapabilities);
|
|
32492
32507
|
await this.runWithProcessCheck(() => this.codexAcpClient.initialize(_params));
|
|
32493
32508
|
this.publishFirstAuthStatusAfterResponse();
|
|
@@ -32816,6 +32831,7 @@ Check ${configPath} and project .codex directories, especially their config.toml
|
|
|
32816
32831
|
currentModelSupportsFast,
|
|
32817
32832
|
sessionMcpServers,
|
|
32818
32833
|
terminalOutputMode: this.terminalOutputMode,
|
|
32834
|
+
terminalOutputDeltaSupported: this.terminalOutputDeltaSupported,
|
|
32819
32835
|
goalRevision: 0,
|
|
32820
32836
|
sessionTitle: null,
|
|
32821
32837
|
sessionTitleSource: operation === "resume" ? "unknown" : "unset",
|
|
@@ -33877,6 +33893,7 @@ Check ${configPath} and project .codex directories, especially their config.toml
|
|
|
33877
33893
|
currentModelSupportsFast,
|
|
33878
33894
|
sessionMcpServers,
|
|
33879
33895
|
terminalOutputMode: this.terminalOutputMode,
|
|
33896
|
+
terminalOutputDeltaSupported: this.terminalOutputDeltaSupported,
|
|
33880
33897
|
goalRevision: 0,
|
|
33881
33898
|
sessionTitle: null,
|
|
33882
33899
|
sessionTitleSource: "unset",
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.12.1-preview.
|
|
6
|
+
"version": "1.12.1-preview.2",
|
|
7
7
|
"description": "",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"bin": {
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@agentclientprotocol/sdk": "^1.4.0",
|
|
69
|
-
"@openai/codex": "^0.
|
|
69
|
+
"@openai/codex": "^0.155.1",
|
|
70
70
|
"diff": "^9.0.0",
|
|
71
71
|
"open": "^11.0.1",
|
|
72
72
|
"vscode-jsonrpc": "^9.0.1",
|