@zhushanwen/pi-unified-hooks 0.2.2 → 0.2.3
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-unified-hooks",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Unified hooks extension - collect scattered hooks in one place for easy maintenance",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"peerDependenciesMeta": {},
|
|
25
25
|
"devDependencies": {
|
|
26
|
+
"@vitest/coverage-v8": "^4.1.9",
|
|
26
27
|
"vitest": "^4.1.8"
|
|
27
28
|
},
|
|
28
29
|
"files": [
|
|
@@ -33,7 +33,9 @@ interface ToolExecutionEndLikeEvent {
|
|
|
33
33
|
|
|
34
34
|
/** ExtensionContext 的最小子集,仅声明 unified-hooks 内部用到的 ui 字段。 */
|
|
35
35
|
export interface HookContext {
|
|
36
|
-
//
|
|
36
|
+
// ctx.ui 恒为对象(pi runner createContext:默认 noOpUIContext;RPC 模式
|
|
37
|
+
// setUIContext(createExtensionUIContext(), "rpc"),rpc-mode.js:87-96)——
|
|
38
|
+
// headless 下不会是 undefined。可选标记仅是本接口作为最小子集的宽松声明。
|
|
37
39
|
ui?: {
|
|
38
40
|
// type 必须用 SDK 字面量联合,否则非法值(如 "warn")会被 Pi 降级为 info 静默丢失。
|
|
39
41
|
notify(msg: string, type?: "info" | "warning" | "error"): void;
|