@quandev104/pi-style 0.2.4 → 0.2.6
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 +1 -2
- package/dist/extensions/pi-style.js +4 -29
- package/dist/extensions/pi-style.js.map +1 -1
- package/extension-src/pi-style/app/command-service.ts +0 -2
- package/extension-src/pi-style/domain/config-normalization.ts +0 -3
- package/extension-src/pi-style/domain/config-types.ts +0 -2
- package/extension-src/pi-style/features/messages/index.ts +0 -44
- package/extension-src/pi-style/pi/compatibility-coordinator.ts +0 -1
- package/extension-src/pi-style/pi/compatibility-probe.ts +1 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
- **Editor** — compact/boxed/dock `CustomEditor` treatments with prompt glyph, metadata rows, and thinking-level border, preserving Pi keybindings and autocomplete.
|
|
18
18
|
- **Startup** — compact gradient logo header and optional overlay with System & Context / Available Tools panels, rendered from snapshot data collected before mount.
|
|
19
19
|
- **Messages** — assistant prefix and boxed compaction/skill/branch/MCP special blocks, and certified tool call/result selectors with pending/running/error markers.
|
|
20
|
-
- **Interim narration hiding** — the text of assistant messages that also carry tool calls is hidden (`messages.hideInterimText`): the feed shows only the tool blocks, the run summary, and the final answer.
|
|
21
20
|
- **Turn summaries** — when a turn completes, its finalized tool blocks collapse into one summary line (`➔ Read 2 files, ran 4 shell commands · 3.1s`); errors and interrupted turns stay visible, and Pi's global Ctrl+O toggle expands everything again (`tools.collapseAfterTurn`).
|
|
22
21
|
- **User-prompt image previews** — images attached to your prompt render inline **below your message** as display-only session entries (never sent to the LLM) with `#N · WxH` labels tying each image to its marker; multiple images lay out side-by-side on kitty-capable terminals (up to 3 columns, stacked fallback elsewhere), sized by `messages.previewMaxWidth` (default 30) with Pi's global Ctrl+O expanding to 60 (`messages.showImagePreviews`).
|
|
23
22
|
- **Clipboard image input** — the built-in `Ctrl+V` becomes a full image-paste flow with no other extension required: a sync native probe checks the clipboard at keystroke time, an `[Image #N] ` marker appears instantly in the editor (bytes attach asynchronously — no temp-file flash), backspacing right after a marker deletes it as one unit (discarding the image, image-paste semantics), and submit attaches real image attachments; raw pasted paths that bypass the editor still upgrade to `[image]` + attachment (`messages.clipboardImages`).
|
|
@@ -194,7 +193,7 @@ npm run check
|
|
|
194
193
|
|
|
195
194
|
`npm run check` runs all required automated gates in order.
|
|
196
195
|
|
|
197
|
-
Current test suite:
|
|
196
|
+
Current test suite: 819 tests across 41 files.
|
|
198
197
|
|
|
199
198
|
---
|
|
200
199
|
|
|
@@ -7630,7 +7630,6 @@ var DEFAULT_CONFIG = Object.freeze({
|
|
|
7630
7630
|
assistantPrefix: true,
|
|
7631
7631
|
specialBlocks: true,
|
|
7632
7632
|
hideThinkingLabel: true,
|
|
7633
|
-
hideInterimText: true,
|
|
7634
7633
|
showImagePreviews: true,
|
|
7635
7634
|
clipboardImages: true,
|
|
7636
7635
|
previewMaxWidth: 30
|
|
@@ -7750,7 +7749,6 @@ function normalizeConfig(input, defaults = DEFAULT_CONFIG) {
|
|
|
7750
7749
|
assistantPrefix: bool(messages.assistantPrefix, defaults.messages.assistantPrefix),
|
|
7751
7750
|
specialBlocks: bool(messages.specialBlocks, defaults.messages.specialBlocks),
|
|
7752
7751
|
hideThinkingLabel: bool(messages.hideThinkingLabel, defaults.messages.hideThinkingLabel),
|
|
7753
|
-
hideInterimText: bool(messages.hideInterimText, defaults.messages.hideInterimText),
|
|
7754
7752
|
showImagePreviews: bool(messages.showImagePreviews, defaults.messages.showImagePreviews),
|
|
7755
7753
|
clipboardImages: bool(messages.clipboardImages, defaults.messages.clipboardImages),
|
|
7756
7754
|
previewMaxWidth: boundedInt(messages.previewMaxWidth, defaults.messages.previewMaxWidth, 8, 60)
|
|
@@ -7806,7 +7804,6 @@ var BOOL_PATHS = /* @__PURE__ */ new Set([
|
|
|
7806
7804
|
"messages.assistantPrefix",
|
|
7807
7805
|
"messages.specialBlocks",
|
|
7808
7806
|
"messages.hideThinkingLabel",
|
|
7809
|
-
"messages.hideInterimText",
|
|
7810
7807
|
"messages.showImagePreviews",
|
|
7811
7808
|
"messages.clipboardImages",
|
|
7812
7809
|
"tools.enabled",
|
|
@@ -8278,7 +8275,6 @@ var allowedPaths = /* @__PURE__ */ new Set([
|
|
|
8278
8275
|
"messages.assistantPrefix",
|
|
8279
8276
|
"messages.specialBlocks",
|
|
8280
8277
|
"messages.hideThinkingLabel",
|
|
8281
|
-
"messages.hideInterimText",
|
|
8282
8278
|
"messages.showImagePreviews",
|
|
8283
8279
|
"messages.clipboardImages",
|
|
8284
8280
|
"messages.previewMaxWidth",
|
|
@@ -8313,7 +8309,6 @@ function validatePathValue(path, value) {
|
|
|
8313
8309
|
"messages.assistantPrefix",
|
|
8314
8310
|
"messages.specialBlocks",
|
|
8315
8311
|
"messages.hideThinkingLabel",
|
|
8316
|
-
"messages.hideInterimText",
|
|
8317
8312
|
"messages.showImagePreviews",
|
|
8318
8313
|
"messages.clipboardImages",
|
|
8319
8314
|
"messages.previewMaxWidth",
|
|
@@ -11867,8 +11862,7 @@ function prefixNative(lines, width, prefix) {
|
|
|
11867
11862
|
function decorateMessageRender(original, instance, args, snapshot = {
|
|
11868
11863
|
assistantPrefix: "\u2502 ",
|
|
11869
11864
|
assistantEnabled: true,
|
|
11870
|
-
collapseHiddenThinking: false
|
|
11871
|
-
hideInterimText: false
|
|
11865
|
+
collapseHiddenThinking: false
|
|
11872
11866
|
}) {
|
|
11873
11867
|
if (typeof original !== "function") return void 0;
|
|
11874
11868
|
const width = typeof args[0] === "number" ? args[0] : 0;
|
|
@@ -11892,17 +11886,6 @@ function decorateMessageRender(original, instance, args, snapshot = {
|
|
|
11892
11886
|
function isSpacerChild(child) {
|
|
11893
11887
|
return typeof child?.setLines === "function";
|
|
11894
11888
|
}
|
|
11895
|
-
function isInterimTextChild(child) {
|
|
11896
|
-
const candidate = child;
|
|
11897
|
-
return typeof candidate?.setText === "function" && candidate.options !== void 0 && typeof candidate.options === "object" && candidate.defaultTextStyle === void 0;
|
|
11898
|
-
}
|
|
11899
|
-
function hasToolCallItems(message) {
|
|
11900
|
-
if (!message || typeof message !== "object") return false;
|
|
11901
|
-
const content = message.content;
|
|
11902
|
-
return Array.isArray(content) && content.some(
|
|
11903
|
-
(item) => item !== null && typeof item === "object" && item.type === "toolCall"
|
|
11904
|
-
);
|
|
11905
|
-
}
|
|
11906
11889
|
function isBlankTextChild(child) {
|
|
11907
11890
|
const candidate = child;
|
|
11908
11891
|
if (typeof candidate?.setCustomBgFn !== "function" || typeof candidate.render !== "function") return false;
|
|
@@ -11919,8 +11902,7 @@ function markChildrenScanned(instance, children) {
|
|
|
11919
11902
|
function decorateMessageUpdate(original, instance, args, snapshot = {
|
|
11920
11903
|
assistantPrefix: "\u2502 ",
|
|
11921
11904
|
assistantEnabled: true,
|
|
11922
|
-
collapseHiddenThinking: false
|
|
11923
|
-
hideInterimText: false
|
|
11905
|
+
collapseHiddenThinking: false
|
|
11924
11906
|
}) {
|
|
11925
11907
|
if (typeof original !== "function") return void 0;
|
|
11926
11908
|
const result = Reflect.apply(original, instance, args);
|
|
@@ -11934,12 +11916,6 @@ function decorateMessageUpdate(original, instance, args, snapshot = {
|
|
|
11934
11916
|
if (isSpacerChild(children[index])) children.splice(index, 1);
|
|
11935
11917
|
}
|
|
11936
11918
|
}
|
|
11937
|
-
if (snapshot.hideInterimText && hasToolCallItems(args[0])) {
|
|
11938
|
-
for (let index = children.length - 1; index >= 0; index--) {
|
|
11939
|
-
if (isInterimTextChild(children[index])) children.splice(index, 1);
|
|
11940
|
-
}
|
|
11941
|
-
if (children.every((child) => isSpacerChild(child))) children.length = 0;
|
|
11942
|
-
}
|
|
11943
11919
|
markChildrenScanned(instance, children);
|
|
11944
11920
|
}
|
|
11945
11921
|
return result;
|
|
@@ -12403,7 +12379,7 @@ function surfaceDisabled(spec, config) {
|
|
|
12403
12379
|
if (!config.messages.enabled) return true;
|
|
12404
12380
|
if (spec.subtype === "native-assistant-message" && spec.method === "render") return !config.messages.assistantPrefix;
|
|
12405
12381
|
if (spec.subtype === "native-assistant-message" && spec.method === "updateContent")
|
|
12406
|
-
return !config.messages.hideThinkingLabel
|
|
12382
|
+
return !config.messages.hideThinkingLabel;
|
|
12407
12383
|
if (isSpecialBlock(spec)) return !config.messages.specialBlocks;
|
|
12408
12384
|
return true;
|
|
12409
12385
|
}
|
|
@@ -12777,8 +12753,7 @@ function createCompatibilityCoordinator(dispose = disposePiCompatibilityProbe) {
|
|
|
12777
12753
|
messageSnapshot: {
|
|
12778
12754
|
assistantPrefix: authorization.ascii ? "[assistant] " : "\u2502 ",
|
|
12779
12755
|
assistantEnabled,
|
|
12780
|
-
collapseHiddenThinking: thinkingCollapseEnabled
|
|
12781
|
-
hideInterimText: config.messages.hideInterimText && messagesEnabled
|
|
12756
|
+
collapseHiddenThinking: thinkingCollapseEnabled
|
|
12782
12757
|
},
|
|
12783
12758
|
toolSnapshot: {
|
|
12784
12759
|
callMarker: authorization.ascii ? "[tool] " : "[tool] ",
|