@oh-my-pi/pi-coding-agent 4.3.1 → 4.3.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/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [4.3.2] - 2026-01-11
6
+ ### Changed
7
+
8
+ - Increased default bash output preview from 5 to 10 lines when collapsed
9
+ - Updated expanded bash output view to show full untruncated output when available
10
+
5
11
  ## [4.3.1] - 2026-01-11
6
12
 
7
13
  ### Changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oh-my-pi/pi-coding-agent",
3
- "version": "4.3.1",
3
+ "version": "4.3.2",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "ompConfig": {
@@ -39,10 +39,10 @@
39
39
  "prepublishOnly": "bun run generate-template && bun run clean && bun run build"
40
40
  },
41
41
  "dependencies": {
42
- "@oh-my-pi/pi-ai": "4.3.1",
43
- "@oh-my-pi/pi-agent-core": "4.3.1",
44
- "@oh-my-pi/pi-git-tool": "4.3.1",
45
- "@oh-my-pi/pi-tui": "4.3.1",
42
+ "@oh-my-pi/pi-ai": "4.3.2",
43
+ "@oh-my-pi/pi-agent-core": "4.3.2",
44
+ "@oh-my-pi/pi-git-tool": "4.3.2",
45
+ "@oh-my-pi/pi-tui": "4.3.2",
46
46
  "@openai/agents": "^0.3.7",
47
47
  "@sinclair/typebox": "^0.34.46",
48
48
  "ajv": "^8.17.1",
@@ -15,6 +15,8 @@ import { resolveToCwd } from "./path-utils";
15
15
  import { createToolUIKit } from "./render-utils";
16
16
  import { DEFAULT_MAX_BYTES, formatSize, type TruncationResult, truncateTail } from "./truncate";
17
17
 
18
+ export const BASH_DEFAULT_PREVIEW_LINES = 10;
19
+
18
20
  const bashSchema = Type.Object({
19
21
  command: Type.String({ description: "Bash command to execute" }),
20
22
  timeout: Type.Optional(Type.Number({ description: "Timeout in seconds (optional, no default timeout)" })),
@@ -26,6 +28,7 @@ const bashSchema = Type.Object({
26
28
  export interface BashToolDetails {
27
29
  truncation?: TruncationResult;
28
30
  fullOutputPath?: string;
31
+ fullOutput?: string;
29
32
  }
30
33
 
31
34
  /**
@@ -101,9 +104,12 @@ export function createBashTool(session: ToolSession, options?: BashToolOptions):
101
104
  const truncation = truncateTail(currentOutput);
102
105
  onUpdate({
103
106
  content: [{ type: "text", text: truncation.content || "" }],
104
- details: {
105
- truncation: truncation.truncated ? truncation : undefined,
106
- },
107
+ details: truncation.truncated
108
+ ? {
109
+ truncation,
110
+ fullOutput: currentOutput,
111
+ }
112
+ : undefined,
107
113
  });
108
114
  }
109
115
  },
@@ -129,6 +135,7 @@ export function createBashTool(session: ToolSession, options?: BashToolOptions):
129
135
  details = {
130
136
  truncation,
131
137
  fullOutputPath: result.fullOutputPath,
138
+ fullOutput: currentOutput,
132
139
  };
133
140
 
134
141
  const startLine = truncation.totalLines - truncation.outputLines + 1;
@@ -173,6 +180,9 @@ interface BashRenderContext {
173
180
  previewLines?: number;
174
181
  }
175
182
 
183
+ // Preview line limit when not expanded (matches tool-execution behavior)
184
+ export const BASH_PREVIEW_LINES = 10;
185
+
176
186
  export const bashToolRenderer = {
177
187
  renderCall(args: BashRenderArgs, uiTheme: Theme): Component {
178
188
  const ui = createToolUIKit(uiTheme);
@@ -214,21 +224,25 @@ export const bashToolRenderer = {
214
224
  const { renderContext } = options;
215
225
  const details = result.details;
216
226
 
227
+ const expanded = renderContext?.expanded ?? options.expanded;
228
+ const previewLines = renderContext?.previewLines ?? BASH_DEFAULT_PREVIEW_LINES;
229
+
217
230
  // Get output from context (preferred) or fall back to result content
218
231
  const output = renderContext?.output ?? (result.content?.find((c) => c.type === "text")?.text ?? "").trim();
219
- const expanded = renderContext?.expanded ?? options.expanded;
220
- const previewLines = renderContext?.previewLines ?? 5;
232
+ const fullOutput = details?.fullOutput;
233
+ const displayOutput = expanded ? (fullOutput ?? output) : output;
234
+ const showingFullOutput = expanded && fullOutput !== undefined;
221
235
 
222
236
  // Build truncation warning lines (static, doesn't depend on width)
223
237
  const truncation = details?.truncation;
224
238
  const fullOutputPath = details?.fullOutputPath;
225
239
  let warningLine: string | undefined;
226
- if (truncation?.truncated || fullOutputPath) {
240
+ if (fullOutputPath || (truncation?.truncated && !showingFullOutput)) {
227
241
  const warnings: string[] = [];
228
242
  if (fullOutputPath) {
229
243
  warnings.push(`Full output: ${fullOutputPath}`);
230
244
  }
231
- if (truncation?.truncated) {
245
+ if (truncation?.truncated && !showingFullOutput) {
232
246
  if (truncation.truncatedBy === "lines") {
233
247
  warnings.push(`Truncated: showing ${truncation.outputLines} of ${truncation.totalLines} lines`);
234
248
  } else {
@@ -237,17 +251,19 @@ export const bashToolRenderer = {
237
251
  );
238
252
  }
239
253
  }
240
- warningLine = uiTheme.fg("warning", ui.wrapBrackets(warnings.join(". ")));
254
+ if (warnings.length > 0) {
255
+ warningLine = uiTheme.fg("warning", ui.wrapBrackets(warnings.join(". ")));
256
+ }
241
257
  }
242
258
 
243
- if (!output) {
259
+ if (!displayOutput) {
244
260
  // No output - just show warning if any
245
261
  return new Text(warningLine ?? "", 0, 0);
246
262
  }
247
263
 
248
264
  if (expanded) {
249
265
  // Show all lines when expanded
250
- const styledOutput = output
266
+ const styledOutput = displayOutput
251
267
  .split("\n")
252
268
  .map((line) => uiTheme.fg("toolOutput", line))
253
269
  .join("\n");
@@ -256,7 +272,7 @@ export const bashToolRenderer = {
256
272
  }
257
273
 
258
274
  // Collapsed: use width-aware caching component
259
- const styledOutput = output
275
+ const styledOutput = displayOutput
260
276
  .split("\n")
261
277
  .map((line) => uiTheme.fg("toolOutput", line))
262
278
  .join("\n");
@@ -359,11 +359,11 @@ export function formatDiagnostics(
359
359
  const isLastDiag = di === diagnostics.length - 1;
360
360
  const diagBranch = isLastFile
361
361
  ? isLastDiag
362
- ? ` ${theme.tree.last}`
363
- : ` ${theme.tree.branch}`
362
+ ? ` ${theme.tree.last}`
363
+ : ` ${theme.tree.branch}`
364
364
  : isLastDiag
365
- ? ` ${theme.tree.vertical} ${theme.tree.last}`
366
- : ` ${theme.tree.vertical} ${theme.tree.branch}`;
365
+ ? `${theme.tree.vertical} ${theme.tree.last}`
366
+ : `${theme.tree.vertical} ${theme.tree.branch}`;
367
367
 
368
368
  const sevIcon =
369
369
  d.severity === "error"
@@ -11,6 +11,7 @@ import {
11
11
  type TUI,
12
12
  } from "@oh-my-pi/pi-tui";
13
13
  import stripAnsi from "strip-ansi";
14
+ import { BASH_DEFAULT_PREVIEW_LINES } from "../../../core/tools/bash";
14
15
  import { computeEditDiff, type EditDiffError, type EditDiffResult } from "../../../core/tools/edit-diff";
15
16
  import { toolRenderers } from "../../../core/tools/renderers";
16
17
  import { convertToPng } from "../../../utils/image-convert";
@@ -19,7 +20,6 @@ import { theme } from "../theme/theme";
19
20
  import { renderDiff } from "./diff";
20
21
 
21
22
  // Preview line limit for bash when not expanded
22
- const BASH_PREVIEW_LINES = 5;
23
23
  const GENERIC_PREVIEW_LINES = 6;
24
24
  const GENERIC_ARG_PREVIEW = 6;
25
25
  const GENERIC_VALUE_MAX = 80;
@@ -485,7 +485,7 @@ export class ToolExecutionComponent extends Container {
485
485
  const output = this.getTextOutput().trim();
486
486
  context.output = output;
487
487
  context.expanded = this.expanded;
488
- context.previewLines = BASH_PREVIEW_LINES;
488
+ context.previewLines = BASH_DEFAULT_PREVIEW_LINES;
489
489
  } else if (this.toolName === "edit") {
490
490
  // Edit needs diff preview and renderDiff function
491
491
  context.editDiffPreview = this.editDiffPreview;