@chiwanpark/pi-squared-agent 0.1.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.
Files changed (162) hide show
  1. package/README.md +13 -0
  2. package/dist/cli.d.ts +3 -0
  3. package/dist/cli.d.ts.map +1 -0
  4. package/dist/cli.js +144 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/index.d.ts +11 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +11 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/runtime/auth-store.d.ts +36 -0
  11. package/dist/runtime/auth-store.d.ts.map +1 -0
  12. package/dist/runtime/auth-store.js +131 -0
  13. package/dist/runtime/auth-store.js.map +1 -0
  14. package/dist/runtime/config-store.d.ts +44 -0
  15. package/dist/runtime/config-store.d.ts.map +1 -0
  16. package/dist/runtime/config-store.js +138 -0
  17. package/dist/runtime/config-store.js.map +1 -0
  18. package/dist/runtime/messages.d.ts +12 -0
  19. package/dist/runtime/messages.d.ts.map +1 -0
  20. package/dist/runtime/messages.js +101 -0
  21. package/dist/runtime/messages.js.map +1 -0
  22. package/dist/runtime/model-resolver.d.ts +52 -0
  23. package/dist/runtime/model-resolver.d.ts.map +1 -0
  24. package/dist/runtime/model-resolver.js +175 -0
  25. package/dist/runtime/model-resolver.js.map +1 -0
  26. package/dist/runtime/pi-agent.d.ts +83 -0
  27. package/dist/runtime/pi-agent.d.ts.map +1 -0
  28. package/dist/runtime/pi-agent.js +405 -0
  29. package/dist/runtime/pi-agent.js.map +1 -0
  30. package/dist/runtime/status-store.d.ts +50 -0
  31. package/dist/runtime/status-store.d.ts.map +1 -0
  32. package/dist/runtime/status-store.js +65 -0
  33. package/dist/runtime/status-store.js.map +1 -0
  34. package/dist/runtime/system-prompt.d.ts +11 -0
  35. package/dist/runtime/system-prompt.d.ts.map +1 -0
  36. package/dist/runtime/system-prompt.js +43 -0
  37. package/dist/runtime/system-prompt.js.map +1 -0
  38. package/dist/runtime/tools/bash.d.ts +23 -0
  39. package/dist/runtime/tools/bash.d.ts.map +1 -0
  40. package/dist/runtime/tools/bash.js +206 -0
  41. package/dist/runtime/tools/bash.js.map +1 -0
  42. package/dist/runtime/tools/child-process.d.ts +13 -0
  43. package/dist/runtime/tools/child-process.d.ts.map +1 -0
  44. package/dist/runtime/tools/child-process.js +75 -0
  45. package/dist/runtime/tools/child-process.js.map +1 -0
  46. package/dist/runtime/tools/output-accumulator.d.ts +52 -0
  47. package/dist/runtime/tools/output-accumulator.d.ts.map +1 -0
  48. package/dist/runtime/tools/output-accumulator.js +160 -0
  49. package/dist/runtime/tools/output-accumulator.js.map +1 -0
  50. package/dist/runtime/tools/shell.d.ts +26 -0
  51. package/dist/runtime/tools/shell.d.ts.map +1 -0
  52. package/dist/runtime/tools/shell.js +116 -0
  53. package/dist/runtime/tools/shell.js.map +1 -0
  54. package/dist/runtime/tools/truncate.d.ts +38 -0
  55. package/dist/runtime/tools/truncate.d.ts.map +1 -0
  56. package/dist/runtime/tools/truncate.js +98 -0
  57. package/dist/runtime/tools/truncate.js.map +1 -0
  58. package/dist/tools/bash/child-process.d.ts +13 -0
  59. package/dist/tools/bash/child-process.d.ts.map +1 -0
  60. package/dist/tools/bash/child-process.js +79 -0
  61. package/dist/tools/bash/child-process.js.map +1 -0
  62. package/dist/tools/bash/output-accumulator.d.ts +54 -0
  63. package/dist/tools/bash/output-accumulator.d.ts.map +1 -0
  64. package/dist/tools/bash/output-accumulator.js +171 -0
  65. package/dist/tools/bash/output-accumulator.js.map +1 -0
  66. package/dist/tools/bash/shell.d.ts +26 -0
  67. package/dist/tools/bash/shell.d.ts.map +1 -0
  68. package/dist/tools/bash/shell.js +129 -0
  69. package/dist/tools/bash/shell.js.map +1 -0
  70. package/dist/tools/bash/tool.d.ts +23 -0
  71. package/dist/tools/bash/tool.d.ts.map +1 -0
  72. package/dist/tools/bash/tool.js +219 -0
  73. package/dist/tools/bash/tool.js.map +1 -0
  74. package/dist/tools/bash/truncate.d.ts +50 -0
  75. package/dist/tools/bash/truncate.d.ts.map +1 -0
  76. package/dist/tools/bash/truncate.js +184 -0
  77. package/dist/tools/bash/truncate.js.map +1 -0
  78. package/dist/tools/external-tool.d.ts +2 -0
  79. package/dist/tools/external-tool.d.ts.map +1 -0
  80. package/dist/tools/external-tool.js +15 -0
  81. package/dist/tools/external-tool.js.map +1 -0
  82. package/dist/tools/file/edit-diff.d.ts +27 -0
  83. package/dist/tools/file/edit-diff.d.ts.map +1 -0
  84. package/dist/tools/file/edit-diff.js +196 -0
  85. package/dist/tools/file/edit-diff.js.map +1 -0
  86. package/dist/tools/file/edit.d.ts +26 -0
  87. package/dist/tools/file/edit.d.ts.map +1 -0
  88. package/dist/tools/file/edit.js +106 -0
  89. package/dist/tools/file/edit.js.map +1 -0
  90. package/dist/tools/file/find.d.ts +27 -0
  91. package/dist/tools/file/find.d.ts.map +1 -0
  92. package/dist/tools/file/find.js +150 -0
  93. package/dist/tools/file/find.js.map +1 -0
  94. package/dist/tools/file/glob.d.ts +6 -0
  95. package/dist/tools/file/glob.d.ts.map +1 -0
  96. package/dist/tools/file/glob.js +50 -0
  97. package/dist/tools/file/glob.js.map +1 -0
  98. package/dist/tools/file/grep.d.ts +29 -0
  99. package/dist/tools/file/grep.d.ts.map +1 -0
  100. package/dist/tools/file/grep.js +220 -0
  101. package/dist/tools/file/grep.js.map +1 -0
  102. package/dist/tools/file/index.d.ts +7 -0
  103. package/dist/tools/file/index.d.ts.map +1 -0
  104. package/dist/tools/file/index.js +7 -0
  105. package/dist/tools/file/index.js.map +1 -0
  106. package/dist/tools/file/ls.d.ts +27 -0
  107. package/dist/tools/file/ls.d.ts.map +1 -0
  108. package/dist/tools/file/ls.js +82 -0
  109. package/dist/tools/file/ls.js.map +1 -0
  110. package/dist/tools/file/read.d.ts +23 -0
  111. package/dist/tools/file/read.d.ts.map +1 -0
  112. package/dist/tools/file/read.js +98 -0
  113. package/dist/tools/file/read.js.map +1 -0
  114. package/dist/tools/file/write.d.ts +17 -0
  115. package/dist/tools/file/write.d.ts.map +1 -0
  116. package/dist/tools/file/write.js +45 -0
  117. package/dist/tools/file/write.js.map +1 -0
  118. package/dist/tools/file-mutation-queue.d.ts +3 -0
  119. package/dist/tools/file-mutation-queue.d.ts.map +1 -0
  120. package/dist/tools/file-mutation-queue.js +47 -0
  121. package/dist/tools/file-mutation-queue.js.map +1 -0
  122. package/dist/tools/path-utils.d.ts +5 -0
  123. package/dist/tools/path-utils.d.ts.map +1 -0
  124. package/dist/tools/path-utils.js +79 -0
  125. package/dist/tools/path-utils.js.map +1 -0
  126. package/dist/tools/web/index.d.ts +2 -0
  127. package/dist/tools/web/index.d.ts.map +1 -0
  128. package/dist/tools/web/index.js +2 -0
  129. package/dist/tools/web/index.js.map +1 -0
  130. package/dist/tools/web/search.d.ts +44 -0
  131. package/dist/tools/web/search.d.ts.map +1 -0
  132. package/dist/tools/web/search.js +209 -0
  133. package/dist/tools/web/search.js.map +1 -0
  134. package/dist/tui/box.d.ts +11 -0
  135. package/dist/tui/box.d.ts.map +1 -0
  136. package/dist/tui/box.js +24 -0
  137. package/dist/tui/box.js.map +1 -0
  138. package/dist/tui/chat-screen.d.ts +29 -0
  139. package/dist/tui/chat-screen.d.ts.map +1 -0
  140. package/dist/tui/chat-screen.js +475 -0
  141. package/dist/tui/chat-screen.js.map +1 -0
  142. package/dist/tui/commands.d.ts +34 -0
  143. package/dist/tui/commands.d.ts.map +1 -0
  144. package/dist/tui/commands.js +691 -0
  145. package/dist/tui/commands.js.map +1 -0
  146. package/dist/tui/interactive.d.ts +9 -0
  147. package/dist/tui/interactive.d.ts.map +1 -0
  148. package/dist/tui/interactive.js +88 -0
  149. package/dist/tui/interactive.js.map +1 -0
  150. package/dist/tui/overlays.d.ts +39 -0
  151. package/dist/tui/overlays.d.ts.map +1 -0
  152. package/dist/tui/overlays.js +157 -0
  153. package/dist/tui/overlays.js.map +1 -0
  154. package/dist/tui/theme.d.ts +40 -0
  155. package/dist/tui/theme.d.ts.map +1 -0
  156. package/dist/tui/theme.js +120 -0
  157. package/dist/tui/theme.js.map +1 -0
  158. package/dist/tui/welcome.d.ts +3 -0
  159. package/dist/tui/welcome.d.ts.map +1 -0
  160. package/dist/tui/welcome.js +37 -0
  161. package/dist/tui/welcome.js.map +1 -0
  162. package/package.json +54 -0
@@ -0,0 +1,206 @@
1
+ /**
2
+ * Bash tool — executes shell commands and returns stdout+stderr.
3
+ *
4
+ * Ported from @earendil-works/pi-coding-agent. TUI rendering components have
5
+ * been omitted; only the core execute logic is kept.
6
+ */
7
+ import { constants } from "node:fs";
8
+ import { access as fsAccess } from "node:fs/promises";
9
+ import { spawn } from "child_process";
10
+ import { Type } from "typebox";
11
+ import { waitForChildProcess } from "./child-process.js";
12
+ import { OutputAccumulator } from "./output-accumulator.js";
13
+ import {
14
+ getShellConfig,
15
+ getShellEnv,
16
+ killProcessTree,
17
+ trackDetachedChildPid,
18
+ untrackDetachedChildPid,
19
+ } from "./shell.js";
20
+ import { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize } from "./truncate.js";
21
+ // ---------------------------------------------------------------------------
22
+ // Schema
23
+ // ---------------------------------------------------------------------------
24
+ const bashSchema = Type.Object({
25
+ command: Type.String({ description: "Bash command to execute" }),
26
+ timeout: Type.Optional(Type.Number({ description: "Timeout in seconds (optional, no default timeout)" })),
27
+ });
28
+ // ---------------------------------------------------------------------------
29
+ // Throttle constant for streaming updates
30
+ // ---------------------------------------------------------------------------
31
+ const UPDATE_THROTTLE_MS = 100;
32
+ // ---------------------------------------------------------------------------
33
+ // createBashTool
34
+ // ---------------------------------------------------------------------------
35
+ /**
36
+ * Create a bash AgentTool that executes commands in `cwd`.
37
+ */
38
+ export function createBashTool(cwd) {
39
+ return {
40
+ name: "bash",
41
+ label: "bash",
42
+ description: [
43
+ "Execute a bash command in the current working directory.",
44
+ "Returns stdout and stderr.",
45
+ `Output is truncated to the last ${DEFAULT_MAX_LINES} lines or ${DEFAULT_MAX_BYTES / 1024}KB (whichever is hit first).`,
46
+ "If truncated, full output is saved to a temp file.",
47
+ "Optionally provide a timeout in seconds.",
48
+ ].join(" "),
49
+ parameters: bashSchema,
50
+ execute: async (_toolCallId, { command, timeout }, signal, onUpdate) => {
51
+ const { shell, args } = getShellConfig();
52
+ // Verify the working directory exists before spawning.
53
+ try {
54
+ await fsAccess(cwd, constants.F_OK);
55
+ } catch {
56
+ throw new Error(`Working directory does not exist: ${cwd}\nCannot execute bash commands.`);
57
+ }
58
+ if (signal?.aborted) throw new Error("aborted");
59
+ const child = spawn(shell, [...args, command], {
60
+ cwd,
61
+ detached: process.platform !== "win32",
62
+ env: getShellEnv(),
63
+ stdio: ["ignore", "pipe", "pipe"],
64
+ windowsHide: true,
65
+ });
66
+ if (child.pid) trackDetachedChildPid(child.pid);
67
+ let timedOut = false;
68
+ let timeoutHandle;
69
+ const onAbort = () => {
70
+ if (child.pid) killProcessTree(child.pid);
71
+ };
72
+ // -----------------------------------------------------------------------
73
+ // Output accumulation + streaming updates
74
+ // -----------------------------------------------------------------------
75
+ const output = new OutputAccumulator({ tempFilePrefix: "pi2-bash" });
76
+ let updateTimer;
77
+ let updateDirty = false;
78
+ let lastUpdateAt = 0;
79
+ const emitOutputUpdate = () => {
80
+ if (!onUpdate || !updateDirty) return;
81
+ updateDirty = false;
82
+ lastUpdateAt = Date.now();
83
+ const snapshot = output.snapshot({ persistIfTruncated: true });
84
+ onUpdate({
85
+ content: [{ type: "text", text: snapshot.content || "" }],
86
+ details: snapshot.truncation.truncated
87
+ ? {
88
+ truncation: snapshot.truncation,
89
+ ...(snapshot.fullOutputPath !== undefined && { fullOutputPath: snapshot.fullOutputPath }),
90
+ }
91
+ : undefined,
92
+ });
93
+ };
94
+ const clearUpdateTimer = () => {
95
+ if (updateTimer) {
96
+ clearTimeout(updateTimer);
97
+ updateTimer = undefined;
98
+ }
99
+ };
100
+ const scheduleOutputUpdate = () => {
101
+ if (!onUpdate) return;
102
+ updateDirty = true;
103
+ const delay = UPDATE_THROTTLE_MS - (Date.now() - lastUpdateAt);
104
+ if (delay <= 0) {
105
+ clearUpdateTimer();
106
+ emitOutputUpdate();
107
+ return;
108
+ }
109
+ updateTimer ??= setTimeout(() => {
110
+ updateTimer = undefined;
111
+ emitOutputUpdate();
112
+ }, delay);
113
+ };
114
+ if (onUpdate) onUpdate({ content: [], details: undefined });
115
+ child.stdout?.on("data", (data) => {
116
+ output.append(data);
117
+ scheduleOutputUpdate();
118
+ });
119
+ child.stderr?.on("data", (data) => {
120
+ output.append(data);
121
+ scheduleOutputUpdate();
122
+ });
123
+ // -----------------------------------------------------------------------
124
+ // Timeout + abort wiring
125
+ // -----------------------------------------------------------------------
126
+ if (timeout !== undefined && timeout > 0) {
127
+ timeoutHandle = setTimeout(() => {
128
+ timedOut = true;
129
+ if (child.pid) killProcessTree(child.pid);
130
+ }, timeout * 1000);
131
+ }
132
+ if (signal) {
133
+ if (signal.aborted) onAbort();
134
+ else signal.addEventListener("abort", onAbort, { once: true });
135
+ }
136
+ // -----------------------------------------------------------------------
137
+ // Helpers
138
+ // -----------------------------------------------------------------------
139
+ const finishOutput = async () => {
140
+ output.finish();
141
+ clearUpdateTimer();
142
+ emitOutputUpdate();
143
+ const snapshot = output.snapshot({ persistIfTruncated: true });
144
+ await output.closeTempFile();
145
+ return snapshot;
146
+ };
147
+ const formatOutput = (snapshot, emptyText = "(no output)") => {
148
+ const { truncation } = snapshot;
149
+ let text = snapshot.content || emptyText;
150
+ let details;
151
+ if (truncation.truncated) {
152
+ details = {
153
+ truncation,
154
+ ...(snapshot.fullOutputPath !== undefined && { fullOutputPath: snapshot.fullOutputPath }),
155
+ };
156
+ const startLine = truncation.totalLines - truncation.outputLines + 1;
157
+ const endLine = truncation.totalLines;
158
+ if (truncation.lastLinePartial) {
159
+ const lastLineSize = formatSize(output.getLastLineBytes());
160
+ text += `\n\n[Showing last ${formatSize(truncation.outputBytes)} of line ${endLine} (line is ${lastLineSize}). Full output: ${snapshot.fullOutputPath}]`;
161
+ } else if (truncation.truncatedBy === "lines") {
162
+ text += `\n\n[Showing lines ${startLine}-${endLine} of ${truncation.totalLines}. Full output: ${snapshot.fullOutputPath}]`;
163
+ } else {
164
+ text += `\n\n[Showing lines ${startLine}-${endLine} of ${truncation.totalLines} (${formatSize(DEFAULT_MAX_BYTES)} limit). Full output: ${snapshot.fullOutputPath}]`;
165
+ }
166
+ }
167
+ return { text, details };
168
+ };
169
+ const appendStatus = (text, status) => `${text ? `${text}\n\n` : ""}${status}`;
170
+ // -----------------------------------------------------------------------
171
+ // Execute and wait
172
+ // -----------------------------------------------------------------------
173
+ try {
174
+ let exitCode;
175
+ try {
176
+ exitCode = await waitForChildProcess(child);
177
+ if (signal?.aborted) throw new Error("aborted");
178
+ if (timedOut) throw new Error(`timeout:${timeout}`);
179
+ } catch (err) {
180
+ const snapshot = await finishOutput();
181
+ const { text } = formatOutput(snapshot, "");
182
+ if (err instanceof Error && err.message === "aborted") {
183
+ throw new Error(appendStatus(text, "Command aborted"));
184
+ }
185
+ if (err instanceof Error && err.message.startsWith("timeout:")) {
186
+ const secs = err.message.split(":")[1];
187
+ throw new Error(appendStatus(text, `Command timed out after ${secs} seconds`));
188
+ }
189
+ throw err;
190
+ }
191
+ const snapshot = await finishOutput();
192
+ const { text, details } = formatOutput(snapshot);
193
+ if (exitCode !== 0 && exitCode !== null) {
194
+ throw new Error(appendStatus(text, `Command exited with code ${exitCode}`));
195
+ }
196
+ return { content: [{ type: "text", text }], details };
197
+ } finally {
198
+ if (child.pid) untrackDetachedChildPid(child.pid);
199
+ if (timeoutHandle) clearTimeout(timeoutHandle);
200
+ if (signal) signal.removeEventListener("abort", onAbort);
201
+ clearUpdateTimer();
202
+ }
203
+ },
204
+ };
205
+ }
206
+ //# sourceMappingURL=bash.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bash.js","sourceRoot":"","sources":["../../../src/runtime/tools/bash.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,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AG,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;wBACvC,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,2BAA2B,IAAI,UAAU,CAAC,CAAC,CAAC;oBACjF,CAAC;oBACD,MAAM,GAAG,CAAC;gBACZ,CAAC;gBAED,MAAM,QAAQ,GAAG,MAAM,YAAY,EAAE,CAAC;gBACtC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;gBAEjD,IAAI,QAAQ,KAAK,CAAC,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;oBACxC,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,4BAA4B,QAAQ,EAAE,CAAC,CAAC,CAAC;gBAC9E,CAAC;gBAED,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC;YACxD,CAAC;oBAAS,CAAC;gBACT,IAAI,KAAK,CAAC,GAAG;oBAAE,uBAAuB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBAClD,IAAI,aAAa;oBAAE,YAAY,CAAC,aAAa,CAAC,CAAC;gBAC/C,IAAI,MAAM;oBAAE,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;gBACzD,gBAAgB,EAAE,CAAC;YACrB,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Wait for a child process to terminate without hanging on inherited stdio handles.
3
+ *
4
+ * On Windows, daemonized descendants can inherit the child's stdout/stderr pipe
5
+ * handles. In that case the child emits `exit`, but `close` can hang forever even
6
+ * though the original process is already gone. We wait briefly for stdio to end,
7
+ * then forcibly stop tracking the inherited handles.
8
+ *
9
+ * Ported from @earendil-works/pi-coding-agent.
10
+ */
11
+ import type { ChildProcess } from "node:child_process";
12
+ export declare function waitForChildProcess(child: ChildProcess): Promise<number | null>;
13
+ //# sourceMappingURL=child-process.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"child-process.d.ts","sourceRoot":"","sources":["../../../src/runtime/tools/child-process.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIvD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAuE/E"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Wait for a child process to terminate without hanging on inherited stdio handles.
3
+ *
4
+ * On Windows, daemonized descendants can inherit the child's stdout/stderr pipe
5
+ * handles. In that case the child emits `exit`, but `close` can hang forever even
6
+ * though the original process is already gone. We wait briefly for stdio to end,
7
+ * then forcibly stop tracking the inherited handles.
8
+ *
9
+ * Ported from @earendil-works/pi-coding-agent.
10
+ */
11
+ const EXIT_STDIO_GRACE_MS = 100;
12
+ export function waitForChildProcess(child) {
13
+ return new Promise((resolve, reject) => {
14
+ let settled = false;
15
+ let exited = false;
16
+ let exitCode = null;
17
+ let postExitTimer;
18
+ let stdoutEnded = child.stdout === null;
19
+ let stderrEnded = child.stderr === null;
20
+ const cleanup = () => {
21
+ if (postExitTimer) {
22
+ clearTimeout(postExitTimer);
23
+ postExitTimer = undefined;
24
+ }
25
+ child.removeListener("error", onError);
26
+ child.removeListener("exit", onExit);
27
+ child.removeListener("close", onClose);
28
+ child.stdout?.removeListener("end", onStdoutEnd);
29
+ child.stderr?.removeListener("end", onStderrEnd);
30
+ };
31
+ const finalize = (code) => {
32
+ if (settled) return;
33
+ settled = true;
34
+ cleanup();
35
+ child.stdout?.destroy();
36
+ child.stderr?.destroy();
37
+ resolve(code);
38
+ };
39
+ const maybeFinalizeAfterExit = () => {
40
+ if (!exited || settled) return;
41
+ if (stdoutEnded && stderrEnded) finalize(exitCode);
42
+ };
43
+ const onStdoutEnd = () => {
44
+ stdoutEnded = true;
45
+ maybeFinalizeAfterExit();
46
+ };
47
+ const onStderrEnd = () => {
48
+ stderrEnded = true;
49
+ maybeFinalizeAfterExit();
50
+ };
51
+ const onError = (err) => {
52
+ if (settled) return;
53
+ settled = true;
54
+ cleanup();
55
+ reject(err);
56
+ };
57
+ const onExit = (code) => {
58
+ exited = true;
59
+ exitCode = code;
60
+ maybeFinalizeAfterExit();
61
+ if (!settled) {
62
+ postExitTimer = setTimeout(() => finalize(code), EXIT_STDIO_GRACE_MS);
63
+ }
64
+ };
65
+ const onClose = (code) => {
66
+ finalize(code);
67
+ };
68
+ child.stdout?.once("end", onStdoutEnd);
69
+ child.stderr?.once("end", onStderrEnd);
70
+ child.once("error", onError);
71
+ child.once("exit", onExit);
72
+ child.once("close", onClose);
73
+ });
74
+ }
75
+ //# sourceMappingURL=child-process.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"child-process.js","sourceRoot":"","sources":["../../../src/runtime/tools/child-process.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEhC,MAAM,UAAU,mBAAmB,CAAC,KAAmB;IACrD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,IAAI,OAAO,GAAG,KAAK,CAAC;QACpB,IAAI,MAAM,GAAG,KAAK,CAAC;QACnB,IAAI,QAAQ,GAAkB,IAAI,CAAC;QACnC,IAAI,aAAyC,CAAC;QAC9C,IAAI,WAAW,GAAG,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC;QACxC,IAAI,WAAW,GAAG,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC;QAExC,MAAM,OAAO,GAAG,GAAG,EAAE;YACnB,IAAI,aAAa,EAAE,CAAC;gBAClB,YAAY,CAAC,aAAa,CAAC,CAAC;gBAC5B,aAAa,GAAG,SAAS,CAAC;YAC5B,CAAC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AAG,CAAC,IAAmB,EAAE,EAAE;YACrC,MAAM,GAAG,IAAI,CAAC;YACd,QAAQ,GAAG,IAAI,CAAC;YAChB,sBAAsB,EAAE,CAAC;YACzB,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,aAAa,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,mBAAmB,CAAC,CAAC;YACxE,CAAC;QACH,CAAC,CAAC;QAEF,MAAM,OAAO,GAAG,CAAC,IAAmB,EAAE,EAAE;YACtC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACjB,CAAC,CAAC;QAEF,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QACvC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QACvC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC7B,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Incrementally tracks streaming bash output with bounded memory.
3
+ *
4
+ * Decodes incoming Buffer chunks with a streaming UTF-8 decoder, keeps only a
5
+ * rolling tail in memory, and spills the full raw output to a temp file when
6
+ * the output exceeds the display limits.
7
+ *
8
+ * Ported from @earendil-works/pi-coding-agent.
9
+ */
10
+ import { type TruncationResult } from "./truncate.js";
11
+ export interface OutputSnapshot {
12
+ content: string;
13
+ truncation: TruncationResult;
14
+ fullOutputPath: string | undefined;
15
+ }
16
+ export interface OutputAccumulatorOptions {
17
+ maxLines?: number;
18
+ maxBytes?: number;
19
+ tempFilePrefix?: string;
20
+ }
21
+ export declare class OutputAccumulator {
22
+ private readonly maxLines;
23
+ private readonly maxBytes;
24
+ private readonly maxRollingBytes;
25
+ private readonly tempFilePrefix;
26
+ private decoder;
27
+ private rawChunks;
28
+ private tailText;
29
+ private tailBytes;
30
+ private tailStartsAtLineBoundary;
31
+ private totalRawBytes;
32
+ private totalDecodedBytes;
33
+ private completedLines;
34
+ private totalLines;
35
+ private currentLineBytes;
36
+ private hasOpenLine;
37
+ private finished;
38
+ private tempFilePath;
39
+ private tempFileStream;
40
+ constructor(options?: OutputAccumulatorOptions);
41
+ append(data: Buffer): void;
42
+ finish(): void;
43
+ snapshot(options?: { persistIfTruncated?: boolean }): OutputSnapshot;
44
+ closeTempFile(): Promise<void>;
45
+ getLastLineBytes(): number;
46
+ private appendDecodedText;
47
+ private trimTail;
48
+ private getSnapshotText;
49
+ private shouldUseTempFile;
50
+ private ensureTempFile;
51
+ }
52
+ //# sourceMappingURL=output-accumulator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output-accumulator.d.ts","sourceRoot":"","sources":["../../../src/runtime/tools/output-accumulator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,OAAO,EAAsD,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAW1G,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,gBAAgB,CAAC;IAC7B,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;IACzC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IAExC,OAAO,CAAC,OAAO,CAAqB;IACpC,OAAO,CAAC,SAAS,CAAgB;IACjC,OAAO,CAAC,QAAQ,CAAM;IACtB,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,wBAAwB,CAAQ;IACxC,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,iBAAiB,CAAK;IAC9B,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,gBAAgB,CAAK;IAC7B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,QAAQ,CAAS;IAEzB,OAAO,CAAC,YAAY,CAAqB;IACzC,OAAO,CAAC,cAAc,CAA0B;gBAEpC,OAAO,GAAE,wBAA6B;IAOlD,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAY1B,MAAM,IAAI,IAAI;IAOd,QAAQ,CAAC,OAAO,GAAE;QAAE,kBAAkB,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,cAAc;IAsBlE,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAmBpC,gBAAgB,IAAI,MAAM;IAI1B,OAAO,CAAC,iBAAiB;IA0BzB,OAAO,CAAC,QAAQ;IAahB,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,cAAc;CAOvB"}
@@ -0,0 +1,160 @@
1
+ /**
2
+ * Incrementally tracks streaming bash output with bounded memory.
3
+ *
4
+ * Decodes incoming Buffer chunks with a streaming UTF-8 decoder, keeps only a
5
+ * rolling tail in memory, and spills the full raw output to a temp file when
6
+ * the output exceeds the display limits.
7
+ *
8
+ * Ported from @earendil-works/pi-coding-agent.
9
+ */
10
+ import { randomBytes } from "node:crypto";
11
+ import { createWriteStream } from "node:fs";
12
+ import { tmpdir } from "node:os";
13
+ import { join } from "node:path";
14
+ import { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, truncateTail } from "./truncate.js";
15
+ function defaultTempFilePath(prefix) {
16
+ const id = randomBytes(8).toString("hex");
17
+ return join(tmpdir(), `${prefix}-${id}.log`);
18
+ }
19
+ function byteLength(text) {
20
+ return Buffer.byteLength(text, "utf-8");
21
+ }
22
+ export class OutputAccumulator {
23
+ maxLines;
24
+ maxBytes;
25
+ maxRollingBytes;
26
+ tempFilePrefix;
27
+ decoder = new TextDecoder();
28
+ rawChunks = [];
29
+ tailText = "";
30
+ tailBytes = 0;
31
+ tailStartsAtLineBoundary = true;
32
+ totalRawBytes = 0;
33
+ totalDecodedBytes = 0;
34
+ completedLines = 0;
35
+ totalLines = 0;
36
+ currentLineBytes = 0;
37
+ hasOpenLine = false;
38
+ finished = false;
39
+ tempFilePath;
40
+ tempFileStream;
41
+ constructor(options = {}) {
42
+ this.maxLines = options.maxLines ?? DEFAULT_MAX_LINES;
43
+ this.maxBytes = options.maxBytes ?? DEFAULT_MAX_BYTES;
44
+ this.maxRollingBytes = Math.max(this.maxBytes * 2, 1);
45
+ this.tempFilePrefix = options.tempFilePrefix ?? "pi-output";
46
+ }
47
+ append(data) {
48
+ if (this.finished) throw new Error("Cannot append to a finished output accumulator");
49
+ this.totalRawBytes += data.length;
50
+ this.appendDecodedText(this.decoder.decode(data, { stream: true }));
51
+ if (this.tempFileStream ?? this.shouldUseTempFile()) {
52
+ this.ensureTempFile();
53
+ this.tempFileStream?.write(data);
54
+ } else if (data.length > 0) {
55
+ this.rawChunks.push(data);
56
+ }
57
+ }
58
+ finish() {
59
+ if (this.finished) return;
60
+ this.finished = true;
61
+ this.appendDecodedText(this.decoder.decode());
62
+ if (this.shouldUseTempFile()) this.ensureTempFile();
63
+ }
64
+ snapshot(options = {}) {
65
+ const tailTruncation = truncateTail(this.getSnapshotText(), {
66
+ maxLines: this.maxLines,
67
+ maxBytes: this.maxBytes,
68
+ });
69
+ const truncated = this.totalLines > this.maxLines || this.totalDecodedBytes > this.maxBytes;
70
+ const truncatedBy = truncated
71
+ ? (tailTruncation.truncatedBy ?? (this.totalDecodedBytes > this.maxBytes ? "bytes" : "lines"))
72
+ : null;
73
+ const truncation = {
74
+ ...tailTruncation,
75
+ truncated,
76
+ truncatedBy,
77
+ totalLines: this.totalLines,
78
+ totalBytes: this.totalDecodedBytes,
79
+ maxLines: this.maxLines,
80
+ maxBytes: this.maxBytes,
81
+ };
82
+ if (options.persistIfTruncated === true && truncation.truncated) this.ensureTempFile();
83
+ return { content: truncation.content, truncation, fullOutputPath: this.tempFilePath };
84
+ }
85
+ async closeTempFile() {
86
+ if (!this.tempFileStream) return;
87
+ const stream = this.tempFileStream;
88
+ this.tempFileStream = undefined;
89
+ await new Promise((resolve, reject) => {
90
+ const onError = (error) => {
91
+ stream.off("finish", onFinish);
92
+ reject(error);
93
+ };
94
+ const onFinish = () => {
95
+ stream.off("error", onError);
96
+ resolve();
97
+ };
98
+ stream.once("error", onError);
99
+ stream.once("finish", onFinish);
100
+ stream.end();
101
+ });
102
+ }
103
+ getLastLineBytes() {
104
+ return this.currentLineBytes;
105
+ }
106
+ appendDecodedText(text) {
107
+ if (text.length === 0) return;
108
+ const bytes = byteLength(text);
109
+ this.totalDecodedBytes += bytes;
110
+ this.tailText += text;
111
+ this.tailBytes += bytes;
112
+ if (this.tailBytes > this.maxRollingBytes * 2) this.trimTail();
113
+ let newlines = 0;
114
+ let lastNewline = -1;
115
+ for (let i = text.indexOf("\n"); i !== -1; i = text.indexOf("\n", i + 1)) {
116
+ newlines++;
117
+ lastNewline = i;
118
+ }
119
+ if (newlines === 0) {
120
+ this.currentLineBytes += bytes;
121
+ this.hasOpenLine = true;
122
+ } else {
123
+ this.completedLines += newlines;
124
+ const tail = text.slice(lastNewline + 1);
125
+ this.currentLineBytes = byteLength(tail);
126
+ this.hasOpenLine = tail.length > 0;
127
+ }
128
+ this.totalLines = this.completedLines + (this.hasOpenLine ? 1 : 0);
129
+ }
130
+ trimTail() {
131
+ const buffer = Buffer.from(this.tailText, "utf-8");
132
+ if (buffer.length <= this.maxRollingBytes) {
133
+ this.tailBytes = buffer.length;
134
+ return;
135
+ }
136
+ let start = buffer.length - this.maxRollingBytes;
137
+ while (start < buffer.length && ((buffer[start] ?? 0) & 0xc0) === 0x80) start++;
138
+ this.tailStartsAtLineBoundary = start === 0 ? this.tailStartsAtLineBoundary : (buffer[start - 1] ?? 0) === 0x0a;
139
+ this.tailText = buffer.subarray(start).toString("utf-8");
140
+ this.tailBytes = byteLength(this.tailText);
141
+ }
142
+ getSnapshotText() {
143
+ if (this.tailStartsAtLineBoundary) return this.tailText;
144
+ const firstNewline = this.tailText.indexOf("\n");
145
+ return firstNewline === -1 ? this.tailText : this.tailText.slice(firstNewline + 1);
146
+ }
147
+ shouldUseTempFile() {
148
+ return (
149
+ this.totalRawBytes > this.maxBytes || this.totalDecodedBytes > this.maxBytes || this.totalLines > this.maxLines
150
+ );
151
+ }
152
+ ensureTempFile() {
153
+ if (this.tempFilePath) return;
154
+ this.tempFilePath = defaultTempFilePath(this.tempFilePrefix);
155
+ this.tempFileStream = createWriteStream(this.tempFilePath);
156
+ for (const chunk of this.rawChunks) this.tempFileStream.write(chunk);
157
+ this.rawChunks = [];
158
+ }
159
+ }
160
+ //# sourceMappingURL=output-accumulator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output-accumulator.js","sourceRoot":"","sources":["../../../src/runtime/tools/output-accumulator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAoB,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,YAAY,EAAyB,MAAM,eAAe,CAAC;AAE1G,SAAS,mBAAmB,CAAC,MAAc;IACzC,MAAM,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC1C,OAAO,IAAI,C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AAC,CAAC,CAAC;IACrF,CAAC;IAEO,iBAAiB;QACvB,OAAO,CACL,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,QAAQ,CAChH,CAAC;IACJ,CAAC;IAEO,cAAc;QACpB,IAAI,IAAI,CAAC,YAAY;YAAE,OAAO;QAC9B,IAAI,CAAC,YAAY,GAAG,mBAAmB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC7D,IAAI,CAAC,cAAc,GAAG,iBAAiB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC3D,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,SAAS;YAAE,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrE,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;IACtB,CAAC;CACF"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Shell configuration, environment helpers, and process-kill utilities.
3
+ *
4
+ * Ported from @earendil-works/pi-coding-agent.
5
+ * Simplification: getShellEnv() returns process.env as-is without prepending a
6
+ * pi-specific bin directory.
7
+ */
8
+ /**
9
+ * Resolve shell configuration based on platform and an optional explicit shell path.
10
+ *
11
+ * Resolution order:
12
+ * 1. User-specified shellPath
13
+ * 2. On Windows: Git Bash in known locations, then bash on PATH
14
+ * 3. On Unix: /bin/bash, then bash on PATH, then fallback to sh
15
+ */
16
+ export declare function getShellConfig(customShellPath?: string): {
17
+ shell: string;
18
+ args: string[];
19
+ };
20
+ /** Return the current process environment for spawned commands. */
21
+ export declare function getShellEnv(): NodeJS.ProcessEnv;
22
+ export declare function trackDetachedChildPid(pid: number): void;
23
+ export declare function untrackDetachedChildPid(pid: number): void;
24
+ /** Kill a process and its entire process group (cross-platform). */
25
+ export declare function killProcessTree(pid: number): void;
26
+ //# sourceMappingURL=shell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../../src/runtime/tools/shell.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAmCH;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CA+B1F;AAED,mEAAmE;AACnE,wBAAgB,WAAW,IAAI,MAAM,CAAC,UAAU,CAE/C;AAQD,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEvD;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEzD;AAED,oEAAoE;AACpE,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAsBjD"}