@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.
@@ -48,7 +48,6 @@ const allowedPaths = new Set([
48
48
  "messages.assistantPrefix",
49
49
  "messages.specialBlocks",
50
50
  "messages.hideThinkingLabel",
51
- "messages.hideInterimText",
52
51
  "messages.showImagePreviews",
53
52
  "messages.clipboardImages",
54
53
  "messages.previewMaxWidth",
@@ -84,7 +83,6 @@ function validatePathValue(path: string, value: unknown): boolean {
84
83
  "messages.assistantPrefix",
85
84
  "messages.specialBlocks",
86
85
  "messages.hideThinkingLabel",
87
- "messages.hideInterimText",
88
86
  "messages.showImagePreviews",
89
87
  "messages.clipboardImages",
90
88
  "messages.previewMaxWidth",
@@ -33,7 +33,6 @@ export const DEFAULT_CONFIG: NormalizedPiStyleConfig = Object.freeze({
33
33
  assistantPrefix: true,
34
34
  specialBlocks: true,
35
35
  hideThinkingLabel: true,
36
- hideInterimText: true,
37
36
  showImagePreviews: true,
38
37
  clipboardImages: true,
39
38
  previewMaxWidth: 30,
@@ -180,7 +179,6 @@ export function normalizeConfig(
180
179
  assistantPrefix: bool(messages.assistantPrefix, defaults.messages.assistantPrefix),
181
180
  specialBlocks: bool(messages.specialBlocks, defaults.messages.specialBlocks),
182
181
  hideThinkingLabel: bool(messages.hideThinkingLabel, defaults.messages.hideThinkingLabel),
183
- hideInterimText: bool(messages.hideInterimText, defaults.messages.hideInterimText),
184
182
  showImagePreviews: bool(messages.showImagePreviews, defaults.messages.showImagePreviews),
185
183
  clipboardImages: bool(messages.clipboardImages, defaults.messages.clipboardImages),
186
184
  previewMaxWidth: boundedInt(messages.previewMaxWidth, defaults.messages.previewMaxWidth, 8, 60),
@@ -244,7 +242,6 @@ const BOOL_PATHS = new Set([
244
242
  "messages.assistantPrefix",
245
243
  "messages.specialBlocks",
246
244
  "messages.hideThinkingLabel",
247
- "messages.hideInterimText",
248
245
  "messages.showImagePreviews",
249
246
  "messages.clipboardImages",
250
247
  "tools.enabled",
@@ -37,7 +37,6 @@ export interface PiStyleConfig {
37
37
  assistantPrefix?: boolean;
38
38
  specialBlocks?: boolean;
39
39
  hideThinkingLabel?: boolean;
40
- hideInterimText?: boolean;
41
40
  /** Inline previews for user-prompt images (ADR 0008); gates append and render. */
42
41
  showImagePreviews?: boolean;
43
42
  /** Clipboard image input (ADR 0009): upgrade built-in paste temp paths to attachments. */
@@ -102,7 +101,6 @@ export interface NormalizedPiStyleConfig {
102
101
  assistantPrefix: boolean;
103
102
  specialBlocks: boolean;
104
103
  hideThinkingLabel: boolean;
105
- hideInterimText: boolean;
106
104
  /** Inline previews for user-prompt images (ADR 0008); gates append and render. */
107
105
  showImagePreviews: boolean;
108
106
  /** Clipboard image input (ADR 0009): upgrade built-in paste temp paths to attachments. */
@@ -507,8 +507,6 @@ export type MessageDecorationSnapshot = Readonly<{
507
507
  assistantEnabled: boolean;
508
508
  /** Drop the hidden-thinking label row and its trailing spacer (zero-trace collapse). */
509
509
  collapseHiddenThinking: boolean;
510
- /** Hide the text of assistant messages that also carry tool calls (interim narration). */
511
- hideInterimText: boolean;
512
510
  }>;
513
511
 
514
512
  export function __getMessageDecorationTestState(): Readonly<MessageDecorationTestState> {
@@ -535,7 +533,6 @@ export function decorateMessageRender(
535
533
  assistantPrefix: "│ ",
536
534
  assistantEnabled: true,
537
535
  collapseHiddenThinking: false,
538
- hideInterimText: false,
539
536
  },
540
537
  ): unknown {
541
538
  if (typeof original !== "function") return undefined;
@@ -565,34 +562,6 @@ function isSpacerChild(child: unknown): boolean {
565
562
  return typeof (child as { setLines?: unknown } | undefined)?.setLines === "function";
566
563
  }
567
564
 
568
- /**
569
- * The assistant TEXT Markdown block: `Markdown(text, pad, 0, theme, undefined,
570
- * { transform })` — duck-typed by setText + options object + no defaultTextStyle.
571
- * Thinking Markdown passes a `{ color, italic }` defaultTextStyle and is
572
- * therefore excluded; plain Text components carry no `options`.
573
- */
574
- function isInterimTextChild(child: unknown): boolean {
575
- const candidate = child as { setText?: unknown; options?: unknown; defaultTextStyle?: unknown } | undefined;
576
- return (
577
- typeof candidate?.setText === "function" &&
578
- candidate.options !== undefined &&
579
- typeof candidate.options === "object" &&
580
- candidate.defaultTextStyle === undefined
581
- );
582
- }
583
-
584
- /** Whether the message content includes a toolCall item (interim narration marker). */
585
- function hasToolCallItems(message: unknown): boolean {
586
- if (!message || typeof message !== "object") return false;
587
- const content = (message as { content?: unknown }).content;
588
- return (
589
- Array.isArray(content) &&
590
- content.some(
591
- (item) => item !== null && typeof item === "object" && (item as { type?: unknown }).type === "toolCall",
592
- )
593
- );
594
- }
595
-
596
565
  /**
597
566
  * The hidden-thinking placeholder: a Text (setCustomBgFn) whose ANSI-stripped
598
567
  * rendered content is empty. Duck-typed on the public shape because
@@ -652,7 +621,6 @@ export function decorateMessageUpdate(
652
621
  assistantPrefix: "│ ",
653
622
  assistantEnabled: true,
654
623
  collapseHiddenThinking: false,
655
- hideInterimText: false,
656
624
  },
657
625
  ): unknown {
658
626
  if (typeof original !== "function") return undefined;
@@ -675,18 +643,6 @@ export function decorateMessageUpdate(
675
643
  if (isSpacerChild(children[index])) children.splice(index, 1);
676
644
  }
677
645
  }
678
- // Interim narration: assistant messages that carry tool calls use their text
679
- // only to narrate while working; the tool blocks tell the story. Hide the text
680
- // so the feed shows the run's summary and the final answer. Deterministic per
681
- // content — streaming, scroll-back, and resume behave identically. Errors and
682
- // truncation notices are Text children and stay; if only spacers remain the
683
- // message becomes zero-trace.
684
- if (snapshot.hideInterimText && hasToolCallItems(args[0])) {
685
- for (let index = children.length - 1; index >= 0; index--) {
686
- if (isInterimTextChild(children[index])) children.splice(index, 1);
687
- }
688
- if (children.every((child) => isSpacerChild(child))) children.length = 0;
689
- }
690
646
  markChildrenScanned(instance, children);
691
647
  }
692
648
  return result;
@@ -168,7 +168,6 @@ export function createCompatibilityCoordinator(dispose = disposePiCompatibilityP
168
168
  assistantPrefix: authorization.ascii ? "[assistant] " : "│ ",
169
169
  assistantEnabled,
170
170
  collapseHiddenThinking: thinkingCollapseEnabled,
171
- hideInterimText: config.messages.hideInterimText && messagesEnabled,
172
171
  },
173
172
  toolSnapshot: {
174
173
  callMarker: authorization.ascii ? "[tool] " : "[tool] ",
@@ -374,7 +374,6 @@ export interface CompatibilityProbeOptions {
374
374
  assistantPrefix: boolean;
375
375
  specialBlocks: boolean;
376
376
  hideThinkingLabel: boolean;
377
- hideInterimText: boolean;
378
377
  };
379
378
  tools: { enabled: boolean; style: string; maxCollapsedLines: number; maxExpandedLines: number; dimOutput: boolean };
380
379
  preset: string;
@@ -423,7 +422,7 @@ function surfaceDisabled(spec: TargetSpec, config: CompatibilityProbeOptions["co
423
422
  if (!config.messages.enabled) return true;
424
423
  if (spec.subtype === "native-assistant-message" && spec.method === "render") return !config.messages.assistantPrefix;
425
424
  if (spec.subtype === "native-assistant-message" && spec.method === "updateContent")
426
- return !config.messages.hideThinkingLabel && !config.messages.hideInterimText;
425
+ return !config.messages.hideThinkingLabel;
427
426
  if (isSpecialBlock(spec)) return !config.messages.specialBlocks;
428
427
  return true;
429
428
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quandev104/pi-style",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "A native-layout, cohesive visual style package for Pi.",
5
5
  "license": "MIT",
6
6
  "type": "module",