@zhushanwen/pi-permission 1.6.7 → 1.6.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": "@zhushanwen/pi-permission",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.9",
|
|
4
4
|
"description": "Pi permission extension — four permission modes (yolo/auto/approve/strict) with three-layer pipeline (AST + rules + AI classifier).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"tree-sitter-bash": "^0.25.1",
|
|
52
52
|
"web-tree-sitter": "^0.26.11",
|
|
53
|
-
"@zhushanwen/extension-protocol": "0.
|
|
54
|
-
"@zhushanwen/pi-ext-guards": "0.5.
|
|
53
|
+
"@zhushanwen/extension-protocol": "0.27.0",
|
|
54
|
+
"@zhushanwen/pi-ext-guards": "0.5.1",
|
|
55
55
|
"@zhushanwen/pi-extension-logger": "0.6.2",
|
|
56
|
-
"@zhushanwen/pi-llm-shared": "0.12.
|
|
56
|
+
"@zhushanwen/pi-llm-shared": "0.12.1"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"@earendil-works/pi-ai": "^1.0.0",
|
|
@@ -238,15 +238,10 @@ export function createClassifier(deps: ClassifierDeps): {
|
|
|
238
238
|
const timeoutMs = config.timeout > 0 ? config.timeout * MILLIS_PER_SECOND : undefined;
|
|
239
239
|
const callPromise = callLLM(buildCallOptions(model, ctx, config, timeoutMs, signal, onLog));
|
|
240
240
|
|
|
241
|
-
// 3. 等待 callLLM + 外层超时/中止兜底(provider 不支持 timeoutMs/signal
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
} catch (error) {
|
|
246
|
-
const message = toErrorMessage(error);
|
|
247
|
-
onLog?.(`[pi-permission] classifier: callLLM race threw: ${message}`);
|
|
248
|
-
return { ...CLASSIFY_FALLBACK_RESULT };
|
|
249
|
-
}
|
|
241
|
+
// 3. 等待 callLLM + 外层超时/中止兜底(provider 不支持 timeoutMs/signal 时防永挂)。
|
|
242
|
+
// raceResultWithDeadline 恒 resolve(callLLM reject 已在 racer 内归一为
|
|
243
|
+
// ok:false,timeout/abort racer 均 resolve-only),无需外层 catch。
|
|
244
|
+
const settled: SettledRace = await raceResultWithDeadline(callPromise, timeoutMs, signal);
|
|
250
245
|
|
|
251
246
|
// 4. timeout / aborted / ok:false → fail-closed fallback;成功 → 收窄透传
|
|
252
247
|
const settledOutcome = settleRacedResult(settled, timeoutMs, onLog);
|