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.
- package/index.ts +19 -8
- 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: {
|
|
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
|
|
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
|
-
//
|
|
912
|
-
const
|
|
913
|
-
|
|
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
|
|
950
|
-
|
|
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
|
: "";
|