pi-distill 1.9.2 → 1.10.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
@@ -58,6 +58,16 @@ Open the interactive configuration command with:
58
58
  /config:distill
59
59
  ```
60
60
 
61
+ It opens a settings panel: field name on the left, current value on the right, one description line under the selection. Enter or Space flips a switch in place; enumerations, numbers and the summarizer model open a submenu with a filter box on top. Changes are written to disk and applied to the running session immediately, so Esc closes the panel with the new configuration already live. The model list comes from the models Pi has registered and can also be typed by hand.
62
+
63
+ Non-interactive forms are still available:
64
+
65
+ ```text
66
+ /config:distill status
67
+ /config:distill enable
68
+ /config:distill disable
69
+ ```
70
+
61
71
  ## The idea
62
72
 
63
73
  We are not trying to make the agent see less information. We are trying to avoid making it carry thousands of log lines into context just to find one conclusion.
package/README.zh-CN.md CHANGED
@@ -58,6 +58,16 @@ pi install npm:pi-distill
58
58
  /config:distill
59
59
  ```
60
60
 
61
+ 不带参数时打开设置面板:左边字段名、右边当前值、选中项下方一行说明。开关按回车或空格原地切换;枚举、数值和提炼模型按回车打开二级列表,列表上方带过滤输入框,模型还能直接手输。改一项立即写盘并对本次会话生效,Esc 关闭时新配置已经生效。模型列表来自 Pi 当前注册的模型。
62
+
63
+ 带参数时不开面板,只做对应动作:
64
+
65
+ ```text
66
+ /config:distill status
67
+ /config:distill enable
68
+ /config:distill disable
69
+ ```
70
+
61
71
  ## 核心思想
62
72
 
63
73
  我们不是想让 Agent 少看信息,而是避免它为了找一句结论,被迫把几千行日志一起带进上下文。
package/SKILL.md CHANGED
@@ -13,7 +13,9 @@ description: "配置与排查 pi-distill 的模型、压缩阈值、重试、工
13
13
 
14
14
  ## 修改
15
15
 
16
- 优先让用户在 Pi 中运行 `/config:distill`;`/pi-distill` 只是兼容别名。手工配置时只使用包内 `config.example.json` 已声明的字段:
16
+ 优先让用户在 Pi 中运行 `/config:distill`;`/pi-distill` 只是兼容别名。不带参数时打开设置面板(开关原地切换,枚举与模型走二级列表,模型可搜索、可手输),改一项立即写盘并对本次会话生效,不需要 `/reload`。带参数时不打开面板:`enable`、`disable`、`status`。
17
+
18
+ 手工配置时只使用包内 `config.example.json` 已声明的字段:
17
19
 
18
20
  - `model` 留空时使用当前会话模型,否则必须是可用的 `provider/model`;
19
21
  - `minChars` 控制何时提炼,`maxChars` 与 `maxOutputChars` 控制大结果落盘和返回上限;
@@ -7,22 +7,6 @@
7
7
  "zh-CN": "强制工具调用规则:每次调用任何带有 outputRequest 的工具时,Agent 都必须在 arguments 中通过 outputRequest 自主决策需要返回什么内容。绝不能省略、传 null 或空字符串。两种模式:需要完整原始输出时传 RAW;需要节省 token 或只提取部分信息时传描述性 outputRequest。RAW 必须是严格的三个 ASCII 字母。",
8
8
  "en-US": "MANDATORY tool-call rule: whenever a tool exposes outputRequest, the Agent must include outputRequest in the arguments of every call and use it to actively decide what to return. Never omit it, use null, or use an empty string. Two modes: use RAW when the full original output is needed; use a descriptive outputRequest when you want to save tokens or extract only part of the result. RAW must be exactly the three ASCII letters."
9
9
  },
10
- "positiveInteger": {
11
- "zh-CN": "请输入大于 0 的整数。",
12
- "en-US": "Enter a positive integer."
13
- },
14
- "nonNegativeInteger": {
15
- "zh-CN": "请输入大于或等于 0 的整数。",
16
- "en-US": "Enter a non-negative integer."
17
- },
18
- "modelInput": {
19
- "zh-CN": "模型(provider/model;留空使用当前会话模型)",
20
- "en-US": "Model (provider/model; leave empty to use the current session model)"
21
- },
22
- "modelInvalid": {
23
- "zh-CN": "请输入 provider/model,或留空使用当前会话模型。",
24
- "en-US": "Use provider/model, or leave empty to use the current session model."
25
- },
26
10
  "configWarnings": {
27
11
  "zh-CN": "配置有警告,将以可用值打开:{warnings}",
28
12
  "en-US": "Configuration warnings; opening with usable values: {warnings}"
@@ -31,6 +15,10 @@
31
15
  "zh-CN": "Distill 已保存,但有警告:{warnings}",
32
16
  "en-US": "Distill saved with warnings: {warnings}"
33
17
  },
18
+ "configSaveFailed": {
19
+ "zh-CN": "写入 Distill 配置失败,面板里的改动没有生效:{error}",
20
+ "en-US": "Could not write the Distill configuration; the panel change did not take effect: {error}"
21
+ },
34
22
  "interactiveOnly": {
35
23
  "zh-CN": "交互式设置需要在带 UI 的 Pi 会话中运行。",
36
24
  "en-US": "Interactive settings require a Pi session with UI."
@@ -51,86 +39,10 @@
51
39
  "zh-CN": "当前会话模型",
52
40
  "en-US": "Current session model"
53
41
  },
54
- "status": {
55
- "zh-CN": "状态:{value}",
56
- "en-US": "Status: {value}"
57
- },
58
- "model": {
59
- "zh-CN": "模型:{value}",
60
- "en-US": "Model: {value}"
61
- },
62
- "minOutput": {
63
- "zh-CN": "最小输出:{value} 字符",
64
- "en-US": "Min output: {value} chars"
65
- },
66
- "summaryLimit": {
67
- "zh-CN": "摘要上限:{value} 字符",
68
- "en-US": "Summary limit: {value} chars"
69
- },
70
- "finalLimit": {
71
- "zh-CN": "最终输出上限:{value} 字符",
72
- "en-US": "Final output limit: {value} chars"
73
- },
74
- "timeout": {
75
- "zh-CN": "超时:{value}s",
76
- "en-US": "Timeout: {value}s"
77
- },
78
- "timeoutRetryCount": {
79
- "zh-CN": "超时重试:{value} 次",
80
- "en-US": "Timeout retries: {value}"
81
- },
82
- "errorRetryCount": {
83
- "zh-CN": "异常重试:{value} 次",
84
- "en-US": "Error retries: {value}"
85
- },
86
- "threshold": {
87
- "zh-CN": "长输出阈值:{value}x",
88
- "en-US": "Long-output threshold: {value}x"
89
- },
90
- "summarizeErrors": {
91
- "zh-CN": "提炼错误:{value}",
92
- "en-US": "Summarize errors: {value}"
93
- },
94
- "auditRenderer": {
95
- "zh-CN": "审计渲染器:{value}",
96
- "en-US": "Audit renderer: {value}"
97
- },
98
- "showOutputRequest": {
99
- "zh-CN": "显示 outputRequest:{value}",
100
- "en-US": "Show outputRequest: {value}"
101
- },
102
- "showSummary": {
103
- "zh-CN": "显示摘要:{value}",
104
- "en-US": "Show summary: {value}"
105
- },
106
- "toolOverrides": {
107
- "zh-CN": "工具 outputRequest",
108
- "en-US": "Tool outputRequest"
109
- },
110
- "toolSettingsTitle": {
111
- "zh-CN": "工具 outputRequest 设置",
112
- "en-US": "Tool outputRequest settings"
113
- },
114
- "toolStatus": {
115
- "zh-CN": "{tool}:{value}",
116
- "en-US": "{tool}: {value}"
117
- },
118
42
  "noConfigurableTools": {
119
43
  "zh-CN": "当前没有可配置的工具。",
120
44
  "en-US": "No configurable tools are currently available."
121
45
  },
122
- "minOutputTitle": {
123
- "zh-CN": "最小输出字符数",
124
- "en-US": "Minimum output chars"
125
- },
126
- "summaryLimitTitle": {
127
- "zh-CN": "摘要字符上限",
128
- "en-US": "Summary character limit"
129
- },
130
- "finalLimitTitle": {
131
- "zh-CN": "最终输出字符上限",
132
- "en-US": "Final output character limit"
133
- },
134
46
  "outputLimitExceeded": {
135
47
  "zh-CN": "输出超过 {maxChars} 个字符,完整内容已写入:{path}",
136
48
  "en-US": "Output exceeded {maxChars} chars and was written to: {path}"
@@ -139,18 +51,6 @@
139
51
  "zh-CN": "无法写入超长输出临时文件,将返回截断内容:{error}",
140
52
  "en-US": "Failed to write oversized output to a temp file; returning truncated content: {error}"
141
53
  },
142
- "timeoutTitle": {
143
- "zh-CN": "提炼模型超时(秒)",
144
- "en-US": "Summarizer timeout (seconds)"
145
- },
146
- "timeoutRetryCountTitle": {
147
- "zh-CN": "提炼超时重试次数",
148
- "en-US": "Distillation timeout retry count"
149
- },
150
- "errorRetryCountTitle": {
151
- "zh-CN": "提炼非超时异常重试次数",
152
- "en-US": "Distillation non-timeout error retry count"
153
- },
154
54
  "retryingSummary": {
155
55
  "zh-CN": "提炼发生{kind},正在进行第 {retry}/{limit} 次重试:{error}",
156
56
  "en-US": "Distillation hit {kind}; starting retry {retry}/{limit}: {error}"
@@ -171,9 +71,145 @@
171
71
  "zh-CN": "扩展 outputRequest 参数失败:{error}",
172
72
  "en-US": "Failed to extend the outputRequest parameter: {error}"
173
73
  },
174
- "thresholdTitle": {
175
- "zh-CN": "长输出阈值",
176
- "en-US": "Long-output threshold"
74
+ "panelLabelEnabled": {
75
+ "zh-CN": "启用提炼",
76
+ "en-US": "Distillation"
77
+ },
78
+ "panelDescEnabled": {
79
+ "zh-CN": "总开关:关闭后不再为任何工具注入 outputRequest,也不调用提炼模型。",
80
+ "en-US": "Master switch: when off, no tool gets an outputRequest and the summarizer is never called."
81
+ },
82
+ "panelLabelModel": {
83
+ "zh-CN": "提炼模型",
84
+ "en-US": "Summarizer model"
85
+ },
86
+ "panelDescModel": {
87
+ "zh-CN": "调用提炼模型时使用的 provider/model;选「当前会话模型」表示跟随会话。",
88
+ "en-US": "provider/model used for distillation; pick the current session model to follow the session."
89
+ },
90
+ "panelLabelMinChars": {
91
+ "zh-CN": "最小输出字符数",
92
+ "en-US": "Minimum output chars"
93
+ },
94
+ "panelDescMinChars": {
95
+ "zh-CN": "工具输出达到此字符数才调用提炼模型。",
96
+ "en-US": "Tool output must reach this length before the summarizer runs."
97
+ },
98
+ "panelLabelMaxChars": {
99
+ "zh-CN": "摘要字符上限",
100
+ "en-US": "Summary character limit"
101
+ },
102
+ "panelDescMaxChars": {
103
+ "zh-CN": "提炼结果超过此字符数时写入文件,只把路径交给 Agent。",
104
+ "en-US": "Summaries longer than this are written to a file and only the path is returned."
105
+ },
106
+ "panelLabelMaxOutputChars": {
107
+ "zh-CN": "最终输出字符上限",
108
+ "en-US": "Final output character limit"
109
+ },
110
+ "panelDescMaxOutputChars": {
111
+ "zh-CN": "最终返回给 Agent 的内容超过此字符数时写入文件。",
112
+ "en-US": "Content above this length is written to a file before being returned."
113
+ },
114
+ "panelLabelTimeoutSeconds": {
115
+ "zh-CN": "模型超时(秒)",
116
+ "en-US": "Model timeout (seconds)"
117
+ },
118
+ "panelDescTimeoutSeconds": {
119
+ "zh-CN": "单次提炼模型调用最长等待时间。",
120
+ "en-US": "Maximum wait for one summarizer call."
121
+ },
122
+ "panelLabelTimeoutRetryCount": {
123
+ "zh-CN": "超时重试次数",
124
+ "en-US": "Timeout retries"
125
+ },
126
+ "panelDescTimeoutRetryCount": {
127
+ "zh-CN": "提炼因超时失败后的额外重试次数,0 表示不重试。",
128
+ "en-US": "Extra retries after a timeout, 0 disables them."
129
+ },
130
+ "panelLabelErrorRetryCount": {
131
+ "zh-CN": "异常重试次数",
132
+ "en-US": "Error retries"
133
+ },
134
+ "panelDescErrorRetryCount": {
135
+ "zh-CN": "提炼因非超时异常失败后的额外重试次数,0 表示不重试。",
136
+ "en-US": "Extra retries after a non-timeout failure, 0 disables them."
137
+ },
138
+ "panelLabelMissedCompressionRatio": {
139
+ "zh-CN": "长输出提醒倍数",
140
+ "en-US": "Long-output reminder ratio"
141
+ },
142
+ "panelDescMissedCompressionRatio": {
143
+ "zh-CN": "没有 outputRequest 的输出超过最小字符数这么多倍时提醒。",
144
+ "en-US": "Warn when output without an outputRequest exceeds the minimum length by this factor."
145
+ },
146
+ "panelLabelSummarizeErrors": {
147
+ "zh-CN": "提炼错误输出",
148
+ "en-US": "Summarize error output"
149
+ },
150
+ "panelDescSummarizeErrors": {
151
+ "zh-CN": "工具返回错误且达到最小长度时是否仍调用提炼模型。",
152
+ "en-US": "Whether failed tools are still distilled once they reach the minimum length."
153
+ },
154
+ "panelLabelRenderEnabled": {
155
+ "zh-CN": "审计渲染器",
156
+ "en-US": "Audit renderer"
157
+ },
158
+ "panelDescRenderEnabled": {
159
+ "zh-CN": "是否在会话里显示提炼审计卡片。",
160
+ "en-US": "Whether the distillation audit card is shown in the transcript."
161
+ },
162
+ "panelLabelRenderShowPrompt": {
163
+ "zh-CN": "审计卡显示 outputRequest",
164
+ "en-US": "Audit card shows outputRequest"
165
+ },
166
+ "panelDescRenderShowPrompt": {
167
+ "zh-CN": "审计卡里是否显示本次调用的 outputRequest。",
168
+ "en-US": "Whether the audit card includes the call's outputRequest."
169
+ },
170
+ "panelLabelRenderShowResult": {
171
+ "zh-CN": "审计卡显示提炼结果",
172
+ "en-US": "Audit card shows the summary"
173
+ },
174
+ "panelDescRenderShowResult": {
175
+ "zh-CN": "审计卡里是否显示提炼后的内容。",
176
+ "en-US": "Whether the audit card includes the distilled content."
177
+ },
178
+ "panelLabelTool": {
179
+ "zh-CN": "工具:{tool}",
180
+ "en-US": "Tool: {tool}"
181
+ },
182
+ "panelDescTool": {
183
+ "zh-CN": "是否给 {tool} 注入 outputRequest 并提炼其结果;edit/write 未配置时默认关闭。",
184
+ "en-US": "Whether {tool} gets an outputRequest and result distillation; edit/write default to off."
185
+ },
186
+ "panelSearchPrompt": {
187
+ "zh-CN": "过滤",
188
+ "en-US": "Filter"
189
+ },
190
+ "panelUseCustom": {
191
+ "zh-CN": "使用 “{value}”",
192
+ "en-US": "Use “{value}”"
193
+ },
194
+ "configArgumentEnable": {
195
+ "zh-CN": "启用工具输出提炼。",
196
+ "en-US": "Enable tool-output distillation."
197
+ },
198
+ "configArgumentDisable": {
199
+ "zh-CN": "停用工具输出提炼。",
200
+ "en-US": "Disable tool-output distillation."
201
+ },
202
+ "configArgumentStatus": {
203
+ "zh-CN": "打印当前配置,不打开面板。",
204
+ "en-US": "Print the current configuration instead of opening the panel."
205
+ },
206
+ "configStatusReport": {
207
+ "zh-CN": "Distill:{value}\n模型:{model}\n最小输出:{minChars} 字符\n摘要上限:{maxChars} 字符\n最终输出上限:{maxOutputChars} 字符\n超时:{timeoutSeconds}s(超时重试 {timeoutRetryCount} 次,异常重试 {errorRetryCount} 次)\n长输出阈值:{missedCompressionRatio}x\n提炼错误:{summarizeErrors}\n审计渲染器:{render}\n配置文件:{path}",
208
+ "en-US": "Distill: {value}\nModel: {model}\nMin output: {minChars} chars\nSummary limit: {maxChars} chars\nFinal output limit: {maxOutputChars} chars\nTimeout: {timeoutSeconds}s (timeout retries {timeoutRetryCount}, error retries {errorRetryCount})\nLong-output threshold: {missedCompressionRatio}x\nSummarize errors: {summarizeErrors}\nAudit renderer: {render}\nConfig file: {path}"
209
+ },
210
+ "configUnknownArgument": {
211
+ "zh-CN": "未知参数 “{argument}”;可用参数:enable、disable、status。",
212
+ "en-US": "Unknown argument “{argument}”; available arguments: enable, disable, status."
177
213
  },
178
214
  "commandDescription": {
179
215
  "zh-CN": "交互式配置工具输出提炼",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-distill",
3
- "version": "1.9.2",
3
+ "version": "1.10.0",
4
4
  "description": "Pi tool-output distillation with file-first configuration",
5
5
  "type": "module",
6
6
  "main": "./index.ts",
@@ -61,14 +61,16 @@
61
61
  "@earendil-works/pi-tui": ">=0.80.0"
62
62
  },
63
63
  "dependencies": {
64
- "pi-extensions-i18n": "^0.8.0",
65
- "pi-extensions-tool-display": "^1.3.2"
64
+ "pi-extensions-i18n": "^0.9.0",
65
+ "pi-model-request": "^0.1.1",
66
+ "pi-extensions-tool-display": "^1.3.3"
66
67
  },
67
68
  "devDependencies": {
68
69
  "@earendil-works/pi-ai": "0.85.1",
69
70
  "@earendil-works/pi-coding-agent": "0.85.1",
70
71
  "@earendil-works/pi-tui": "0.85.1",
71
72
  "@types/node": "24.12.4",
73
+ "pi-model-request": "^0.1.1",
72
74
  "tsx": "4.23.1",
73
75
  "typescript": "5.9.3"
74
76
  }