pi-posthorse 0.10.4 → 0.10.5
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 +6 -6
- package/src/ui/cards.ts +9 -1
- package/src/ui/text.ts +2 -3
- package/ui.ts +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-posthorse",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Posthorse: fresh context, same journey. No-summary context rollover for Pi, with sparse budget reminders, handoffs, notes, and history.",
|
|
6
6
|
"keywords": [
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"lint:fix:oxlint": "oxlint --fix ."
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"@earendil-works/pi-coding-agent": ">=1.
|
|
55
|
-
"@earendil-works/pi-tui": ">=1.
|
|
54
|
+
"@earendil-works/pi-coding-agent": ">=1.5.0",
|
|
55
|
+
"@earendil-works/pi-tui": ">=1.5.0",
|
|
56
56
|
"typebox": "*"
|
|
57
57
|
},
|
|
58
58
|
"peerDependenciesMeta": {
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@earendil-works/pi-ai": "1.
|
|
71
|
-
"@earendil-works/pi-coding-agent": "1.
|
|
72
|
-
"@earendil-works/pi-tui": "1.
|
|
70
|
+
"@earendil-works/pi-ai": "1.5.0",
|
|
71
|
+
"@earendil-works/pi-coding-agent": "1.5.0",
|
|
72
|
+
"@earendil-works/pi-tui": "1.5.0",
|
|
73
73
|
"@types/node": "24.19.1",
|
|
74
74
|
"oxc-parser": "0.156.0",
|
|
75
75
|
"oxfmt": "0.75.0",
|
package/src/ui/cards.ts
CHANGED
|
@@ -121,6 +121,7 @@ interface ResultFacts {
|
|
|
121
121
|
readonly expanded: boolean;
|
|
122
122
|
readonly imageCount: number;
|
|
123
123
|
readonly showImages: boolean;
|
|
124
|
+
readonly expandKey: string;
|
|
124
125
|
}
|
|
125
126
|
|
|
126
127
|
function submittedText(facts: ResultFacts): string {
|
|
@@ -310,7 +311,12 @@ function collapsedView(
|
|
|
310
311
|
const attachments =
|
|
311
312
|
attachment.length > 0 ? [truncateToWidth(theme.fg("muted", attachment), width)] : [];
|
|
312
313
|
const hidden = details || rows.length > shown.length;
|
|
313
|
-
return [
|
|
314
|
+
return [
|
|
315
|
+
...summaryRows,
|
|
316
|
+
...shown,
|
|
317
|
+
...attachments,
|
|
318
|
+
...(hidden ? [hint(theme, width, facts.expandKey)] : []),
|
|
319
|
+
];
|
|
314
320
|
};
|
|
315
321
|
}
|
|
316
322
|
|
|
@@ -343,6 +349,8 @@ export function toolCards(name: ToolName): Pick<ToolDefinition, "renderCall" | "
|
|
|
343
349
|
expanded,
|
|
344
350
|
imageCount: result.content.filter((part) => part.type === "image").length,
|
|
345
351
|
showImages: context.showImages,
|
|
352
|
+
// Pi injects keyText so the hint shows the user's configured keys.
|
|
353
|
+
expandKey: context.keyText("app.tools.expand"),
|
|
346
354
|
},
|
|
347
355
|
theme,
|
|
348
356
|
);
|
package/src/ui/text.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Theme } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { Text, stripTerminalSequences, truncateToWidth } from "@earendil-works/pi-tui";
|
|
3
3
|
|
|
4
4
|
export type OutputColor = "toolOutput" | "muted" | "dim" | "error" | "warning";
|
|
@@ -81,8 +81,7 @@ export function leadingRows(
|
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
export function hint(theme: Theme, width: number): string {
|
|
85
|
-
const key = keyText("app.tools.expand");
|
|
84
|
+
export function hint(theme: Theme, width: number, key: string): string {
|
|
86
85
|
return truncateToWidth(
|
|
87
86
|
theme.fg("dim", key.length > 0 ? `… ${key} to expand` : "… details hidden"),
|
|
88
87
|
width,
|
package/ui.ts
CHANGED
|
@@ -35,6 +35,8 @@ export function registerPosthorseMessages(pi: ExtensionAPI): void {
|
|
|
35
35
|
: raw;
|
|
36
36
|
const previewRows = window ? 2 : 3;
|
|
37
37
|
const previewText = leadingRows(preview, theme, "toolOutput", previewRows);
|
|
38
|
+
// Pi injects keyText so the hint shows the user's configured keys.
|
|
39
|
+
const expandKey = options.keyText("app.tools.expand");
|
|
38
40
|
let fullText: Text | undefined;
|
|
39
41
|
const historyText = textBlock("Earlier conversation remains in history.", theme, "muted");
|
|
40
42
|
const content: Component = {
|
|
@@ -57,7 +59,7 @@ export function registerPosthorseMessages(pi: ExtensionAPI): void {
|
|
|
57
59
|
: [
|
|
58
60
|
...(window ? historyText.render(inner).slice(0, 2) : []),
|
|
59
61
|
...previewText(inner).slice(0, previewRows),
|
|
60
|
-
hint(theme, inner),
|
|
62
|
+
hint(theme, inner, expandKey),
|
|
61
63
|
];
|
|
62
64
|
const box = new Box(padding, 1, (line) => theme.bg("customMessageBg", line));
|
|
63
65
|
box.addChild({
|