@zhushanwen/pi-structured-output 0.3.4 → 2.0.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 +3 -3
- package/src/index.ts +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhushanwen/pi-structured-output",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Structured output tool for Pi — enforces JSON Schema via tool call mechanism with Ajv validation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"ajv": "^8.17.0"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@
|
|
28
|
-
"
|
|
27
|
+
"@earendil-works/pi-coding-agent": "*",
|
|
28
|
+
"typebox": "*"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/node": "^24.0.0",
|
package/src/index.ts
CHANGED
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
* 最多重试 2 次,防止无限循环。
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import { Type } from "
|
|
14
|
+
import { Type } from "typebox";
|
|
15
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
15
16
|
import Ajv, { type ValidateFunction } from "ajv";
|
|
16
17
|
|
|
17
|
-
/** Pi Extension API — typed
|
|
18
|
-
|
|
19
|
-
type PiAPI = any;
|
|
18
|
+
/** Pi Extension API — properly typed via ExtensionAPI from pi-coding-agent SDK */
|
|
19
|
+
type PiAPI = ExtensionAPI;
|
|
20
20
|
|
|
21
21
|
const TOOL_NAME = "structured-output";
|
|
22
22
|
const ENV_SCHEMA = "PI_WORKFLOW_SCHEMA";
|