@pi-kaush/pi-tool-call-markers 0.3.11 → 0.3.13
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/CHANGELOG.md +6 -0
- package/README.md +5 -5
- package/package.json +1 -1
- package/src/index.ts +4 -4
- package/src/muted.ts +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
- Paint collapsed rows with the theme's `dim` token instead of
|
|
6
|
+
`syntaxComment`. Pi's generated `system` theme solves `syntaxComment` to
|
|
7
|
+
the same contrast as `muted` and `toolOutput`, so collapsed tool calls
|
|
8
|
+
read almost like chat text there. `dim` stays a step below in every
|
|
9
|
+
theme; `collapsedToolCall` and `collapsedThinkingCall` overrides still win.
|
|
10
|
+
|
|
5
11
|
- Give the codemode tool its own `¢` anchor and collapsed label. Codemode
|
|
6
12
|
rows used to collapse to a script preview; they now show the nested
|
|
7
13
|
calls the script ran (repeats deduped to `name ×N`) followed by the
|
package/README.md
CHANGED
|
@@ -33,19 +33,19 @@ Collapsed tool rows use semantic theme colors with no gear, background fill, box
|
|
|
33
33
|
|
|
34
34
|
## Subagent plans
|
|
35
35
|
|
|
36
|
-
A recognized `subagent` call renders as an unboxed plan in the shared tool aesthetic,
|
|
36
|
+
A recognized `subagent` call renders as an unboxed plan in the shared tool aesthetic, using the same `│` tool-call rail:
|
|
37
37
|
|
|
38
38
|
```text
|
|
39
|
-
|
|
39
|
+
│ subagent chain (3 steps) [repo-review]
|
|
40
40
|
1. 🐝 bee [workhorse] Challenge the compatibility conclusion…
|
|
41
41
|
2. 🐝 bee …
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
Single calls stay on one
|
|
44
|
+
Single calls stay on one `│ [<emoji>] [<profile>][<agent>] <task preview>` row — no tool label. Chain calls get a heading with the kind, count, and scope followed by numbered steps (parallel tasks list without numbers), with each step ordered emoji, profile badge, name badge. Agent display names (emoji + name) are scraped from the native plan component — including the single-call heading — with an args fallback, and render in `accent`; everything else stays muted, and failed subagents go full red. Subagents never join ordinary tool groups.
|
|
45
45
|
|
|
46
46
|
While a subagent runs, the plan headline's tail shows live progress from the streamed result details — `→ 1 turn · provider/model` in the warning tone — and a settled call keeps the same `→ N turns · provider/model` summary in muted (turns aggregate across tasks; the model shows only when every task used the same one).
|
|
47
47
|
|
|
48
|
-
Malformed, ambiguous, future, or too-narrow shapes fall back to the generic
|
|
48
|
+
Malformed, ambiguous, future, or too-narrow shapes fall back to the generic `│ subagent …` collapsed row rather than dropping information, and `Ctrl+O` still exposes the native subagent renderer.
|
|
49
49
|
|
|
50
50
|
## Asked questions
|
|
51
51
|
|
|
@@ -135,7 +135,7 @@ Names are comma-separated and matched exactly. Listed rows never join a group, a
|
|
|
135
135
|
|
|
136
136
|
### Collapsed-row colors
|
|
137
137
|
|
|
138
|
-
Collapsed rows (tool calls, `+ Thought`, subagents) default to the theme's `
|
|
138
|
+
Collapsed rows (tool calls, `+ Thought`, subagents) default to the theme's `dim` color — it ships with every Pi theme and sits below `muted`, including in the generated `system` theme — with the row's anchor and the call content sharing it. Failures stay error-colored and live spinners keep their existing tints.
|
|
139
139
|
|
|
140
140
|
A theme can override each collapsed kind independently with optional color tokens:
|
|
141
141
|
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -24,7 +24,7 @@ import { isQuestionToolCall, renderQuestionBlock } from "./question-block.ts";
|
|
|
24
24
|
import { sanitizeInline } from "./sanitize.ts";
|
|
25
25
|
|
|
26
26
|
const OUTER_INSET = 2;
|
|
27
|
-
const SUBAGENT_MARKER = "
|
|
27
|
+
const SUBAGENT_MARKER = "│";
|
|
28
28
|
const GROUP_CALL_MARKER = "│";
|
|
29
29
|
// Collapsed rows anchor with a glyph instead of repeating the tool name;
|
|
30
30
|
// tools that read as one family share a glyph, and unmapped tools fall back
|
|
@@ -901,7 +901,7 @@ function codemodeCallLabel(row: ToolExecutionRow): string | undefined {
|
|
|
901
901
|
// The collapsed-row seam lives here and nowhere else: which anchor a row
|
|
902
902
|
// takes, how that anchor is styled, and the call text that follows it.
|
|
903
903
|
// Anchors always render bold and take no joining colon — `│ ● src/a.ts`,
|
|
904
|
-
// `│ $ npm test` — and subagent fallbacks keep their
|
|
904
|
+
// `│ $ npm test` — and subagent fallbacks keep their `│ subagent …`
|
|
905
905
|
// reading instead of a glyph. Callers append the outcome tail.
|
|
906
906
|
function collapsedSeam(
|
|
907
907
|
row: ToolExecutionRow,
|
|
@@ -1173,10 +1173,10 @@ function subagentProgressText(row: ToolExecutionRow): string | undefined {
|
|
|
1173
1173
|
return parts.length > 0 ? parts.join(" · ") : undefined;
|
|
1174
1174
|
}
|
|
1175
1175
|
|
|
1176
|
-
// Subagents render as an ordinary unboxed tool block: a
|
|
1176
|
+
// Subagents render as an ordinary unboxed tool block: a `│` heading with the
|
|
1177
1177
|
// plan kind/count/scope, then the numbered chain steps or parallel tasks with
|
|
1178
1178
|
// agent identities (emoji, profile badge, name badge) in accent. Single calls
|
|
1179
|
-
// collapse to one row:
|
|
1179
|
+
// collapse to one row: `│ <emoji> [<profile>][<name>] <task preview>`. Everything
|
|
1180
1180
|
// else stays muted (or error on failure), matching the shared tool-row aesthetic.
|
|
1181
1181
|
function renderSubagentPlan(
|
|
1182
1182
|
row: ToolExecutionRow,
|
package/src/muted.ts
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
// Collapsed-row color policy.
|
|
2
2
|
//
|
|
3
3
|
// Collapsed blocks (tool calls, settled "+ Thought" labels, subagent rows)
|
|
4
|
-
// default to the theme's `
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
4
|
+
// default to the theme's `dim` token — it ships with every Pi theme and sits
|
|
5
|
+
// below `muted` — instead of the louder muted/toolTitle/toolOutput split.
|
|
6
|
+
// Pi's generated `system` theme solves `syntaxComment` to the same contrast
|
|
7
|
+
// as `muted`, so only `dim` keeps collapsed rows clearly behind chat text.
|
|
8
|
+
// A theme can override each collapsed kind independently with a
|
|
9
|
+
// `collapsedToolCall` or `collapsedThinkingCall` color token.
|
|
9
10
|
//
|
|
10
11
|
// Failures always fall back to the historical tokens.
|
|
11
12
|
|
|
12
13
|
const TOOL_OVERRIDE_TOKEN = "collapsedToolCall";
|
|
13
14
|
const THINKING_OVERRIDE_TOKEN = "collapsedThinkingCall";
|
|
14
|
-
const DEFAULT_TOKEN = "
|
|
15
|
+
const DEFAULT_TOKEN = "dim";
|
|
15
16
|
|
|
16
17
|
type CollapsedTheme = {
|
|
17
18
|
fg(color: string, text: string): string;
|
|
@@ -57,7 +58,7 @@ export function paletteSample(theme: CollapsedTheme): string {
|
|
|
57
58
|
return PALETTE_TOKENS.map((token) => tokenAnsi(theme, token) ?? "").join(",");
|
|
58
59
|
}
|
|
59
60
|
|
|
60
|
-
// Override token when defined, else the theme's
|
|
61
|
+
// Override token when defined, else the theme's dim color, else
|
|
61
62
|
// null (caller falls back to the historical tokens).
|
|
62
63
|
function collapsedAnsi(
|
|
63
64
|
theme: CollapsedTheme,
|
|
@@ -95,8 +96,7 @@ export function fgCollapsed(
|
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
// Decoration rails recede further than collapsed text. No palette token is
|
|
98
|
-
// guaranteed lighter than the collapsed color
|
|
99
|
-
// resolves to the same overlay0 as syntaxComment), so apply the terminal's
|
|
99
|
+
// guaranteed lighter than the collapsed `dim` color, so apply the terminal's
|
|
100
100
|
// faint attribute: it lightens toward the background on light themes and
|
|
101
101
|
// darkens on dark ones. The rail keeps this muted weight even on failed
|
|
102
102
|
// rows, where only the row's text turns error-colored.
|