@heyhuynhgiabuu/pi-pretty 0.6.24 → 0.6.26

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/src/tools/find.ts CHANGED
@@ -150,7 +150,7 @@ export function registerFindTool(
150
150
  const pathPart = theme.fg("toolOutput", pathArg);
151
151
  const limitPart = limit !== undefined && limit !== null ? theme.fg("dim", ` limit ${limit}`) : "";
152
152
  const out = `${findLabel} ${patternPart}${inPart}${pathPart}${limitPart}`;
153
- text.setText(fillToolBackground(`\n${TOOL_RESULT_INDENT}${out}\n`, ctx.isError ? BG_ERROR : undefined));
153
+ text.setText(fillToolBackground(`\n${TOOL_RESULT_INDENT}${out}`, ctx.isError ? BG_ERROR : undefined));
154
154
  return text;
155
155
  },
156
156
 
@@ -168,7 +168,7 @@ export function registerFindTool(
168
168
  const noticeStr = d.notices?.length
169
169
  ? `\n${TOOL_RESULT_INDENT}${theme.fg("warning", `[${d.notices.join(". ")}]`)}`
170
170
  : "";
171
- text.setText(fillToolBackground(`\n${TOOL_RESULT_INDENT}${theme.fg("dim", "0 files")}${noticeStr}\n`));
171
+ text.setText(fillToolBackground(`${TOOL_RESULT_INDENT}${theme.fg("dim", "0 files")}${noticeStr}\n`));
172
172
  return text;
173
173
  }
174
174
  if (!ctx.expanded) {
@@ -190,14 +190,14 @@ export function registerFindTool(
190
190
  const duration = renderToolDuration(r);
191
191
  text.setText(
192
192
  fillToolBackground(
193
- `\n${TOOL_RESULT_INDENT}${theme.fg("dim", `${d.matchCount} files`)}${duration ? `${FG_DIM}· ${duration}${RST}` : ""}\n${rendered}${noticeStr}\n`,
193
+ `${TOOL_RESULT_INDENT}${theme.fg("dim", `${d.matchCount} files`)}${duration ? `${FG_DIM}· ${duration}${RST}` : ""}\n${rendered}${noticeStr}\n`,
194
194
  ),
195
195
  );
196
196
  return text;
197
197
  }
198
198
  const fc = r.content?.[0] as TextContent | undefined;
199
199
  text.setText(
200
- fillToolBackground(`\n${TOOL_RESULT_INDENT}${theme.fg("dim", fc?.text?.slice(0, 120) ?? "0 files")}\n`),
200
+ fillToolBackground(`${TOOL_RESULT_INDENT}${theme.fg("dim", fc?.text?.slice(0, 120) ?? "0 files")}\n`),
201
201
  );
202
202
  return text;
203
203
  },
package/src/tools/grep.ts CHANGED
@@ -111,7 +111,7 @@ export function registerGrepTool(
111
111
  if (limit !== undefined && limit !== null) out += theme.fg("dim", ` limit ${limit}`);
112
112
  if (literal) out += theme.fg("dim", ` (literal)`);
113
113
  if (caseInsensitive) out += theme.fg("dim", ` (case-insensitive)`);
114
- text.setText(fillToolBackground(`\n${TOOL_RESULT_INDENT}${out}\n`, ctx.isError ? BG_ERROR : undefined));
114
+ text.setText(fillToolBackground(`\n${TOOL_RESULT_INDENT}${out}`, ctx.isError ? BG_ERROR : undefined));
115
115
  return text;
116
116
  },
117
117
 
package/src/tools/ls.ts CHANGED
@@ -51,7 +51,7 @@ export function registerLsTool(
51
51
  let out = theme.fg("toolTitle", theme.bold("ls"));
52
52
  if (path) out += ` ${theme.fg("accent", path)}`;
53
53
  if (limit !== undefined && limit !== null) out += theme.fg("toolOutput", ` (limit ${limit})`);
54
- text.setText(fillToolBackground(`\n${TOOL_RESULT_INDENT}${out}\n`, ctx.isError ? BG_ERROR : undefined));
54
+ text.setText(fillToolBackground(`\n${TOOL_RESULT_INDENT}${out}`, ctx.isError ? BG_ERROR : undefined));
55
55
  return text;
56
56
  },
57
57
 
@@ -79,7 +79,7 @@ export function registerLsTool(
79
79
  .join("\n");
80
80
  text.setText(
81
81
  fillToolBackground(
82
- `\n${TOOL_RESULT_INDENT}${FG_DIM}${d.entryCount} entries${RST}${renderToolMetrics(result)}\n${rendered}\n`,
82
+ `${TOOL_RESULT_INDENT}${FG_DIM}${d.entryCount} entries${RST}${renderToolMetrics(result)}\n${rendered}\n`,
83
83
  ),
84
84
  );
85
85
  return text;
package/src/tools/read.ts CHANGED
@@ -100,7 +100,7 @@ export function registerReadTool(
100
100
 
101
101
  const path = String(args.path ?? "");
102
102
  const label = theme.fg("error", theme.bold("→ read"));
103
- text.setText(fillToolBackground(`\n${TOOL_RESULT_INDENT}${label} ${theme.fg("toolTitle", path)}\n`, BG_ERROR));
103
+ text.setText(fillToolBackground(`\n${TOOL_RESULT_INDENT}${label} ${theme.fg("toolTitle", path)}`, BG_ERROR));
104
104
  return text;
105
105
  },
106
106
 
@@ -137,7 +137,7 @@ export function registerReadTool(
137
137
  if (!ctx.expanded) {
138
138
  if (skillName) {
139
139
  const header = renderSkillHeader(skillName, false, theme);
140
- text.setText(fillToolBackground(`\n${TOOL_RESULT_INDENT}${header}\n`, BG_BASE));
140
+ text.setText(fillToolBackground(`\n${TOOL_RESULT_INDENT}${header}`, BG_BASE));
141
141
  return text;
142
142
  }
143
143
  text.setText(
package/src/types.ts CHANGED
@@ -187,4 +187,8 @@ export interface PiPrettyDeps {
187
187
  sdk?: SdkTools;
188
188
  TextComponent?: new (text?: string, x?: number, y?: number) => ComponentLike;
189
189
  fffModule?: typeof import("@ff-labs/fff-node");
190
+ /** Host AssistantMessageComponent class for the per-row label patch; defaults
191
+ * to the package export. Injectable so tests can verify against the exact
192
+ * class instance they construct rows from. */
193
+ assistantMessageComponent?: unknown;
190
194
  }