@yinan_chen/pi-claude-code-ui 0.8.8 → 0.8.9

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yinan_chen/pi-claude-code-ui",
3
- "version": "0.8.8",
3
+ "version": "0.8.9",
4
4
  "description": "Claude Code-style UI for Pi: transcript view, rich diffs, subagent panels and working-message status.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -47,10 +47,12 @@ export function patchRendererDispatch(cls: any): boolean {
47
47
  proto[FLAG] = true;
48
48
  for (const method of ["getMessageRenderer", "getEntryRenderer"]) {
49
49
  const orig = proto[method];
50
+ // kind("getMessageRenderer"/"getEntryRenderer")随转发传给 impl:generic 兜底只挂 message 侧——
51
+ // 原生对无 renderer 的 entry 完全不显示(addCustomEntryToChat 直接 return),entry 侧挖出数据型条目只是噪音。
50
52
  proto[method] = function (customType: string) {
51
53
  const impl = (globalThis as any).__leanTidyImpl;
52
54
  try {
53
- const override = impl?.rendererOverride?.(customType);
55
+ const override = impl?.rendererOverride?.(customType, method);
54
56
  if (override) return override;
55
57
  } catch {}
56
58
  return orig.call(this, customType);
package/src/index.ts CHANGED
@@ -454,11 +454,12 @@ export default async function leanTidy(pi: ExtensionAPI): Promise<void> {
454
454
  normalizeForeign: (lines: readonly string[]): string[] =>
455
455
  config.normalizeForeignRenderers ? normalizeForeignLines(lines) : (lines as string[]),
456
456
  /** 分发层拦截:内置适配表优先,其余 generic 自动接管,黑名单跳过;不受包加载顺序影响。 */
457
- rendererOverride: (customType: string): any => {
457
+ rendererOverride: (customType: string, via?: "getMessageRenderer" | "getEntryRenderer"): any => {
458
458
  if (config.foreignCardSkip.includes(customType)) return undefined;
459
459
  if (customType === "subagent-notification") return config.subagentRendering === "claude" ? subagentRenderer : undefined;
460
460
  if (customType === "subagents:workflow") return config.workflowRendering === "claude" ? workflowRenderer : undefined;
461
- return config.foreignCardStyle === "generic" ? genericCardRenderer : undefined;
461
+ // generic 兜底仅限 message 分发:entry 侧原生对无 renderer 完全不显示(数据型条目是噪音),回落原生。
462
+ return via !== "getEntryRenderer" && config.foreignCardStyle === "generic" ? genericCardRenderer : undefined;
462
463
  },
463
464
  } as RuntimeImpl;
464
465
  for (const method of IMPL_METHODS) {