@agentclientprotocol/claude-agent-acp 0.107.1-preview.2 → 0.107.1-preview.3
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/v2/terminal.js +11 -5
- package/package.json +1 -1
package/dist/v2/terminal.js
CHANGED
|
@@ -40,7 +40,7 @@ export class V2Terminals {
|
|
|
40
40
|
sessionUpdate: "terminal_update",
|
|
41
41
|
terminalId: running.terminalId,
|
|
42
42
|
...(newCommand ? { command } : {}),
|
|
43
|
-
...(output ? { output: { data:
|
|
43
|
+
...(output ? { output: { data: terminalBytes(output.data) } } : {}),
|
|
44
44
|
...(exit
|
|
45
45
|
? {
|
|
46
46
|
exitStatus: {
|
|
@@ -57,7 +57,7 @@ export class V2Terminals {
|
|
|
57
57
|
terminal.push({
|
|
58
58
|
sessionUpdate: "terminal_output_chunk",
|
|
59
59
|
terminalId: running.terminalId,
|
|
60
|
-
data:
|
|
60
|
+
data: terminalBytes(delta.data),
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
if (exit)
|
|
@@ -115,7 +115,13 @@ function commandOf(rawInput) {
|
|
|
115
115
|
const command = rawInput?.command;
|
|
116
116
|
return typeof command === "string" && command.length > 0 ? command : undefined;
|
|
117
117
|
}
|
|
118
|
-
/**
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
/**
|
|
119
|
+
* The output as the bytes a PTY would have delivered, base64-encoded as a v2
|
|
120
|
+
* terminal carries them. A v2 terminal carries the bytes a terminal emulator
|
|
121
|
+
* receives, but Claude Code runs a command with its output piped, so no line
|
|
122
|
+
* discipline turned each LF into CR LF (`ONLCR`). Without the CR, an emulator
|
|
123
|
+
* moves down a row and keeps the column: "a\nb" draws "b" under the end of "a".
|
|
124
|
+
*/
|
|
125
|
+
function terminalBytes(text) {
|
|
126
|
+
return Buffer.from(text.replaceAll("\n", "\r\n"), "utf8").toString("base64");
|
|
121
127
|
}
|
package/package.json
CHANGED