pi-distill 1.7.0 → 1.7.2
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 +1 -0
- package/README.zh-CN.md +1 -0
- package/package.json +2 -2
- package/src/index.ts +1 -0
package/README.md
CHANGED
|
@@ -111,6 +111,7 @@ Agent consumes a result suited to the current decision, with auditable diagnosti
|
|
|
111
111
|
3. The `tool_result` handler sees the actual output and decides what to do; it does not rely on the agent predicting the output size.
|
|
112
112
|
4. Every tool call must include a non-empty `outputRequest`. A prompt containing only `RAW` explicitly requests the original. Any other non-empty prompt permits distillation once the configured threshold is reached.
|
|
113
113
|
5. OpenAI-compatible completion requests enable native JSON mode with `response_format: { "type": "json_object" }`; OpenAI Responses-compatible requests use the equivalent `text.format`. A timed-out attempt is retried according to `timeoutRetryCount`, while other provider failures use `errorRetryCount` (both default to one retry). If a non-empty model response is only invalid JSON or violates the response schema, pi-distill makes one JSON-only repair call with the malformed response and validation error; it does not resend the tool output or run summarization again. If repair fails, no model is available, or compression is ineffective, the original facts are retained and the status is exposed through details and the audit card. JSON responses wrapped in Markdown fences such as `````json … ````` are also accepted.
|
|
114
|
+
6. Interrupting the parent Agent request aborts any in-flight distillation request immediately and disables retries for that interrupted result; the original tool output remains available through the normal fail-open path.
|
|
114
115
|
|
|
115
116
|
## Output contract
|
|
116
117
|
|
package/README.zh-CN.md
CHANGED
|
@@ -113,6 +113,7 @@ Agent 消费更适合当前决策的结果,并获得可审计的处理诊断
|
|
|
113
113
|
3. `tool_result` 事件拿到真实输出后再做判断,不依赖 Agent 对输出长度的预测。
|
|
114
114
|
4. 每次工具调用都必须包含非空的 `outputRequest`;严格的 `RAW` 表示明确要求原文;其他非空 prompt 才允许进入提炼流程。
|
|
115
115
|
5. OpenAI-compatible Completions 提炼请求会通过 `response_format: { "type": "json_object" }` 启用原生 JSON 模式;OpenAI Responses-compatible 请求使用等价的 `text.format`。单次提炼超时后按照 `timeoutRetryCount` 重试,其他模型调用异常按照 `errorRetryCount` 重试(两者默认都重试 1 次);如果模型已经返回文本,但只是 JSON 语法或响应结构校验失败,扩展会把坏响应和校验错误交给一次 JSON-only 修复 prompt,不会再次发送工具输出,也不会重新总结;修复失败、没有可用模型或结果收益过低时,扩展保留原始事实,并通过 details 和审计卡片暴露状态;模型用 Markdown 的 JSON 代码围栏(如 `````json … `````)包裹响应时也会兼容解析。
|
|
116
|
+
6. 用户打断上级 Agent 请求时,所有尚未完成的提炼请求会立即取消,并且不会为这次中断继续重试;原始工具结果仍按 fail-open 路径保留。
|
|
116
117
|
|
|
117
118
|
## 输出处理契约
|
|
118
119
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-distill",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.2",
|
|
4
4
|
"description": "Pi tool-output distillation with file-first configuration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.ts",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"pi-extensions-i18n": "^0.4.0",
|
|
65
|
-
"pi-extensions-tool-display": "^1.1.
|
|
65
|
+
"pi-extensions-tool-display": "^1.1.1"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@earendil-works/pi-ai": "0.80.10",
|
package/src/index.ts
CHANGED
|
@@ -1628,6 +1628,7 @@ export default function piDistillExtension(pi: ExtensionAPI) {
|
|
|
1628
1628
|
toolCallId: event.toolCallId,
|
|
1629
1629
|
params: { ...event.input, outputRequest },
|
|
1630
1630
|
originalUserPrompt: pending?.originalUserPrompt ?? originalUserPrompt,
|
|
1631
|
+
signal: ctx.signal,
|
|
1631
1632
|
ctx,
|
|
1632
1633
|
},
|
|
1633
1634
|
{
|