@arhen/pi-core-subagent 1.3.44 → 1.3.45

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/peek.ts +20 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arhen/pi-core-subagent",
3
- "version": "1.3.44",
3
+ "version": "1.3.45",
4
4
  "type": "module",
5
5
  "description": "pi extension: fast in-process subagents with a dependency-graph scheduler (needs edges gate tasks and carry upstream output into dependent prompts), plus background runs, intercom and agent-to-agent mailbox. Leader defines agents inline.",
6
6
  "license": "MIT",
package/src/peek.ts CHANGED
@@ -177,21 +177,34 @@ export function createPeekPane(
177
177
  const clamp = (n: number, len: number) => (len === 0 ? 0 : Math.max(0, Math.min(len - 1, n)));
178
178
 
179
179
  /**
180
- * Every row is padded to the full pane width and background-filled, so the
181
- * transcript underneath never shows through the overlay.
180
+ * Every row is a full-width bordered line: │ edge, one space of padding, the
181
+ * text padded out, then the closing edge. Background-filled so the transcript
182
+ * underneath never shows through the overlay, and edged so the pane reads as
183
+ * one object instead of a floating block of colour.
182
184
  */
183
185
  const row = (content: string, width: number): string => {
184
- const inner = width - 4; // 2 cols padding each side
186
+ const inner = width - 4; // │ + space each side
185
187
  const text = truncateToWidth(content, Math.max(0, inner), "…");
186
188
  const pad = Math.max(0, inner - visibleWidth(text));
187
- return theme.bg("selectedBg", ` ${text}${" ".repeat(pad)} `);
189
+ const edge = theme.fg("border", "│");
190
+ return theme.bg("selectedBg", `${edge} ${text}${" ".repeat(pad)} ${edge}`);
188
191
  };
189
192
 
193
+ /** Top/bottom cap, and the ├───┤ divider between chrome and content. */
194
+ const edgeRow = (width: number, left: string, right: string): string =>
195
+ theme.bg("selectedBg", theme.fg("border", `${left}${"─".repeat(Math.max(0, width - 2))}${right}`));
196
+
190
197
  return {
191
198
  render(width: number): string[] {
192
199
  const tasks = getTasks();
193
200
  selected = clamp(selected, tasks.length);
194
- if (tasks.length === 0) return [row(theme.fg("dim", "No subagents in this session."), width)];
201
+ if (tasks.length === 0) {
202
+ return [
203
+ edgeRow(width, "╭", "╮"),
204
+ row(theme.fg("dim", "No subagents in this session."), width),
205
+ edgeRow(width, "╰", "╯"),
206
+ ];
207
+ }
195
208
  const task = tasks[selected]!;
196
209
  const hint = confirming
197
210
  ? theme.fg("error", `abort ${task.agent}? y / n`)
@@ -202,8 +215,7 @@ export function createPeekPane(
202
215
  ? `${theme.fg("muted", "Subagents")}${theme.fg("dim", " › ")}${theme.fg("accent", theme.bold(task.agent))} ${statusTag(task.status, theme)}`
203
216
  : theme.fg("accent", theme.bold("Subagents"));
204
217
  const title = `${crumb} ${theme.fg("muted", `${selected + 1}/${tasks.length}`)}`;
205
- const rule = theme.fg("borderMuted", "─".repeat(Math.max(0, width - 4)));
206
- const lines = [row("", width), row(title, width), row(hint, width), row(rule, width)];
218
+ const lines = [edgeRow(width, "╭", "╮"), row(title, width), row(hint, width), edgeRow(width, "├", "┤")];
207
219
 
208
220
  if (!tailing) {
209
221
  for (const [i, t] of tasks.entries()) {
@@ -218,7 +230,7 @@ export function createPeekPane(
218
230
  if (tail.length === 0) lines.push(row(theme.fg("dim", "(no activity yet)"), width));
219
231
  for (const line of tail) lines.push(row(renderLine(line, theme), width));
220
232
  }
221
- lines.push(row("", width));
233
+ lines.push(edgeRow(width, "╰", "╯"));
222
234
  return lines;
223
235
  },
224
236
  handleInput(data: string): void {