pi-distill 0.3.1 → 0.4.0

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/README.md CHANGED
@@ -44,6 +44,8 @@ It does not register a second `bash`, `read`, `grep`, or `find` tool.
44
44
  pi install npm:pi-distill
45
45
  ```
46
46
 
47
+ The shared `pi-extensions-tool-display` dependency initializes the display host automatically; no separate host package is required.
48
+
47
49
  Reload Pi after installation:
48
50
 
49
51
  ```text
@@ -133,7 +135,7 @@ The distillation prompt strictly follows the locale selected by `/pi-language`:
133
135
  ## Scope and boundaries
134
136
 
135
137
  - Handles every active tool with an object parameter schema; whether `outputPrompt` can be injected is determined by the tool schema, not a fixed allowlist.
136
- - Registers no replacement tools, does not change tool execution semantics, and does not depend on the unrelated npm package `pi-tool-display`.
138
+ - Registers no replacement tools, does not change tool execution semantics, and does not require a separately installed `pi-tool-display` host package.
137
139
  - Text distillation is lossy; use `RAW` when completeness matters.
138
140
  - Non-text results are a completeness boundary: images, audio, binary data, and mixed content bypass text distillation.
139
141
  - Oversized distilled or final text is written to a temporary file and represented by its path, preventing unbounded context growth.
package/README.zh-CN.md CHANGED
@@ -44,6 +44,8 @@
44
44
  pi install npm:pi-distill
45
45
  ```
46
46
 
47
+ 共享依赖 `pi-extensions-tool-display` 会自动初始化展示宿主,不需要额外安装宿主包。
48
+
47
49
  安装后重新加载 Pi:
48
50
 
49
51
  ```text
@@ -135,7 +137,7 @@ Agent 消费更适合当前决策的结果,并获得可审计的处理诊断
135
137
  ## 覆盖范围与边界
136
138
 
137
139
  - 自动处理所有当前已启用且参数 schema 为 object 的工具;能否注入 `outputPrompt` 由工具 schema 决定,不维护固定工具名单。
138
- - 不注册替代工具,不改变原工具的执行语义,也不依赖无关的 npm 包 `pi-tool-display`。
140
+ - 不注册替代工具,不改变原工具的执行语义,也不要求额外安装独立的 `pi-tool-display` 宿主包。
139
141
  - 文本提炼是有损操作;完整性要求应使用 `RAW`。
140
142
  - 非文本结果是完整性边界:图片、音频、二进制和混合 content 不进入文本提炼链路。
141
143
  - 提炼结果或最终文本过大时写入临时文件并返回路径,避免上下文无限膨胀。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-distill",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "Pi tool-output distillation with file-first configuration",
5
5
  "type": "module",
6
6
  "files": [
@@ -52,7 +52,7 @@
52
52
  "pi-extensions-i18n": "^0.3.0"
53
53
  },
54
54
  "dependencies": {
55
- "pi-extensions-tool-display": "^0.1.1"
55
+ "pi-extensions-tool-display": "^0.2.0"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@earendil-works/pi-ai": "0.80.10",
package/src/index.ts CHANGED
@@ -28,6 +28,7 @@ import type {
28
28
  ToolResultEvent,
29
29
  } from "@earendil-works/pi-coding-agent";
30
30
  import { performance } from "node:perf_hooks";
31
+ import { ensureToolDisplayHost } from "pi-extensions-tool-display";
31
32
  import {
32
33
  appendDistillFallbackAudit,
33
34
  registerDistillFallbackRenderer,
@@ -712,6 +713,7 @@ function registerDistillConfigCommand(pi: ExtensionAPI): void {
712
713
  }
713
714
 
714
715
  export default function piDistillExtension(pi: ExtensionAPI) {
716
+ ensureToolDisplayHost(pi);
715
717
  const pendingCalls = new Map<string, PendingDistillCall>();
716
718
  let originalUserPrompt = "";
717
719
  const disposeToolDisplayMiddleware = registerDistillToolDisplayMiddleware();