@zhushanwen/pi-unified-hooks 0.1.2 → 0.2.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/package.json +2 -3
- package/src/__tests__/session-start-handler.test.ts +1 -1
- package/src/__tests__/tool-error-handler.test.ts +1 -1
- package/src/hooks/network-timeout-guard.ts +1 -1
- package/src/hooks/subagent-list-injector.ts +1 -1
- package/src/hooks/test-timeout-guard.ts +1 -1
- package/src/hooks/tool-error-handler.ts +2 -2
- package/src/index.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhushanwen/pi-unified-hooks",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Unified hooks extension - collect scattered hooks in one place for easy maintenance",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
],
|
|
17
17
|
"license": "MIT",
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"
|
|
20
|
-
"@mariozechner/pi-coding-agent": "*"
|
|
19
|
+
"@earendil-works/pi-coding-agent": "*"
|
|
21
20
|
},
|
|
22
21
|
"devDependencies": {
|
|
23
22
|
"vitest": "^4.1.8"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/__tests__/session-start-handler.test.ts
|
|
2
2
|
import { describe, expect, it, vi } from "vitest";
|
|
3
3
|
|
|
4
|
-
import type { ExtensionAPI } from "@
|
|
4
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
5
5
|
|
|
6
6
|
import type { HookContext } from "../hooks/tool-error-handler.ts";
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/__tests__/tool-error-handler.test.ts
|
|
2
2
|
import { describe, expect, it, vi } from "vitest";
|
|
3
3
|
|
|
4
|
-
import type { ExtensionAPI } from "@
|
|
4
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
5
5
|
|
|
6
6
|
import { setupToolErrorHandler, type HookContext } from "../hooks/tool-error-handler.ts";
|
|
7
7
|
|
|
@@ -12,7 +12,7 @@ import * as fs from "node:fs";
|
|
|
12
12
|
import * as os from "node:os";
|
|
13
13
|
import * as path from "node:path";
|
|
14
14
|
|
|
15
|
-
import type { ExtensionAPI } from "@
|
|
15
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
16
16
|
|
|
17
17
|
/** Minimal agent info extracted from .md frontmatter */
|
|
18
18
|
interface AgentEntry {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Python (pytest, unittest), Java (maven, gradle), Go, Rust, .NET, Ruby.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type { ExtensionAPI } from "@
|
|
11
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Patterns that indicate test execution.
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
* specific error patterns with contextual recovery.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type { ExtensionAPI } from "@
|
|
8
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Subset of `ToolExecutionEndEvent` fields used by this hook.
|
|
12
12
|
* Local interface because the SDK's full event type is not re-exported
|
|
13
|
-
* by the CI ambient type stubs
|
|
13
|
+
* by the CI ambient type stubs.
|
|
14
14
|
*
|
|
15
15
|
* `result` 形如 `{ content: Array<{ type: "text", text: string }>, isError: boolean }`
|
|
16
16
|
* (Pi 框架在 tool execute throw 时塞入 error content)。SDK 事件结构里没有独立
|
package/src/index.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Each hook is a self-contained module that can be enabled/disabled independently.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type { ExtensionAPI } from "@
|
|
8
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
9
9
|
|
|
10
10
|
// Re-export hook modules for easy access
|
|
11
11
|
|