pi-fast-subagent 0.6.0 → 0.6.1

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/index.ts +19 -8
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -891,7 +891,13 @@ export default function (pi: ExtensionAPI) {
891
891
  try { return wrapTextWithAnsi(text, w); } catch { return [truncateToWidth(text, w, "...")]; }
892
892
  }
893
893
 
894
- const cache: { width?: number; responseLines?: string[]; skipped?: number } = {};
894
+ const cache: {
895
+ width?: number;
896
+ promptLines?: string[];
897
+ promptSkipped?: number;
898
+ responseLines?: string[];
899
+ skipped?: number;
900
+ } = {};
895
901
 
896
902
  return {
897
903
  invalidate() { cache.width = undefined; },
@@ -902,15 +908,19 @@ export default function (pi: ExtensionAPI) {
902
908
  // ── Prompt ────────────────────────────────────────────────────
903
909
  if (details.task) {
904
910
  out.push("Prompt:");
905
- const taskLines = details.task.split("\n");
906
911
  if (expanded) {
907
- for (const line of taskLines) {
912
+ for (const line of details.task.split("\n")) {
908
913
  for (const w of wrapLine(indent + line, width)) out.push(w);
909
914
  }
910
915
  } else {
911
- // Single truncated line in collapsed
912
- const oneLiner = taskLines[0] ?? "";
913
- out.push(truncateToWidth(indent + oneLiner, width, "..."));
916
+ // Up to 8 visual lines in collapsed mode
917
+ const PROMPT_PREVIEW_LINES = 8;
918
+ if (cache.width !== width || cache.promptLines === undefined) {
919
+ const preview = truncateToVisualLines(details.task, PROMPT_PREVIEW_LINES, width - indent.length);
920
+ cache.promptLines = preview.visualLines.map((l) => truncateToWidth(indent + l, width, "..."));
921
+ cache.promptSkipped = preview.skippedCount;
922
+ }
923
+ out.push(...cache.promptLines);
914
924
  }
915
925
  }
916
926
 
@@ -946,8 +956,9 @@ export default function (pi: ExtensionAPI) {
946
956
 
947
957
  // ── Status ───────────────────────────────────────────────
948
958
  const status = statusLine();
949
- const expandHint = !expanded && (cache.skipped ?? 0) > 0
950
- ? keyHint("app.tools.expand", `expand · ${cache.skipped} lines hidden`)
959
+ const totalSkipped = (cache.skipped ?? 0) + (cache.promptSkipped ?? 0);
960
+ const expandHint = !expanded && totalSkipped > 0
961
+ ? keyHint("app.tools.expand", `expand · ${totalSkipped} lines hidden`)
951
962
  : !expanded && toolCalls.some((t) => t.result !== undefined)
952
963
  ? keyHint("app.tools.expand", "expand for tool outputs")
953
964
  : "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-fast-subagent",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "In-process subagent delegation for pi with single, parallel, and background modes",
5
5
  "type": "module",
6
6
  "keywords": [