@d3ara1n/pi-subagent 3.2.1 → 3.2.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/package.json +1 -1
- package/src/view.test.ts +20 -1
- package/src/view.ts +22 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@d3ara1n/pi-subagent",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Role-based subagent orchestration for pi — delegates tasks to specialized pi child processes with configurable model roles",
|
|
6
6
|
"main": "src/index.ts",
|
package/src/view.test.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import test from "node:test";
|
|
2
2
|
import assert from "node:assert";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
filterDeliveredRuns,
|
|
5
|
+
inheritedConversationFields,
|
|
6
|
+
sortViewRuns,
|
|
7
|
+
} from "./view.ts";
|
|
4
8
|
import type { RunHandle } from "./run.ts";
|
|
5
9
|
|
|
6
10
|
// ── Fakes ──────────────────────────────────────────────────────────
|
|
@@ -29,6 +33,21 @@ test("filterDeliveredRuns drops delivered terminal runs, keeps live and undelive
|
|
|
29
33
|
);
|
|
30
34
|
});
|
|
31
35
|
|
|
36
|
+
// ── inheritedConversationFields ────────────────────────────────────
|
|
37
|
+
|
|
38
|
+
test("inheritedConversationFields returns aligned-view metadata without body text", () => {
|
|
39
|
+
assert.deepEqual(inheritedConversationFields(50_000, true), [
|
|
40
|
+
["inherited", "yes"],
|
|
41
|
+
["size", "50k chars"],
|
|
42
|
+
["truncated", "yes"],
|
|
43
|
+
]);
|
|
44
|
+
assert.deepEqual(inheritedConversationFields(0, false), [
|
|
45
|
+
["inherited", "yes"],
|
|
46
|
+
["size", "0 chars"],
|
|
47
|
+
["truncated", "no"],
|
|
48
|
+
]);
|
|
49
|
+
});
|
|
50
|
+
|
|
32
51
|
// ── sortViewRuns ───────────────────────────────────────────────────
|
|
33
52
|
|
|
34
53
|
test("sortViewRuns ranks running before finished, each group by id", () => {
|
package/src/view.ts
CHANGED
|
@@ -52,7 +52,6 @@ import type { ActivityEntry } from "./types.ts";
|
|
|
52
52
|
import {
|
|
53
53
|
briefFilesUsed,
|
|
54
54
|
formatFallback,
|
|
55
|
-
formatInheritedConversationInput,
|
|
56
55
|
formatThinking,
|
|
57
56
|
formatTimePart,
|
|
58
57
|
formatToolCall,
|
|
@@ -132,6 +131,20 @@ export function filterDeliveredRuns(runs: RunHandle[], delivered: Set<string>):
|
|
|
132
131
|
);
|
|
133
132
|
}
|
|
134
133
|
|
|
134
|
+
/**
|
|
135
|
+
* @internal — exported for testing; formats the metadata shown in the brief view.
|
|
136
|
+
*/
|
|
137
|
+
export function inheritedConversationFields(
|
|
138
|
+
chars: number,
|
|
139
|
+
truncated: boolean,
|
|
140
|
+
): Array<[label: string, value: string]> {
|
|
141
|
+
return [
|
|
142
|
+
["inherited", "yes"],
|
|
143
|
+
["size", `${formatTokens(chars)} chars`],
|
|
144
|
+
["truncated", truncated ? "yes" : "no"],
|
|
145
|
+
];
|
|
146
|
+
}
|
|
147
|
+
|
|
135
148
|
export class SubagentViewPanel implements Component, Focusable {
|
|
136
149
|
focused = true;
|
|
137
150
|
|
|
@@ -383,12 +396,15 @@ export class SubagentViewPanel implements Component, Focusable {
|
|
|
383
396
|
}
|
|
384
397
|
|
|
385
398
|
if (run.inheritConversation) {
|
|
386
|
-
section(
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
),
|
|
399
|
+
section("conversation");
|
|
400
|
+
const fields = inheritedConversationFields(
|
|
401
|
+
run.inheritedConversationChars ?? 0,
|
|
402
|
+
run.inheritedConversationTruncated === true,
|
|
391
403
|
);
|
|
404
|
+
const labelWidth = Math.max(...fields.map(([label]) => label.length));
|
|
405
|
+
for (const [label, value] of fields) {
|
|
406
|
+
lines.push(` ${fg("dim", label.padEnd(labelWidth))} ${fg("accent", value)}`);
|
|
407
|
+
}
|
|
392
408
|
}
|
|
393
409
|
|
|
394
410
|
if (run.files && run.files.length > 0) {
|