@zhushanwen/pi-structured-output 5.1.0 → 5.1.1
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 -2
- package/src/tool-definition.ts +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhushanwen/pi-structured-output",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.1",
|
|
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",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"ajv": "^8.17.0"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@earendil-works/pi-coding-agent": "^0.84.
|
|
30
|
+
"@earendil-works/pi-coding-agent": "^0.84.4",
|
|
31
31
|
"typebox": "*"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
package/src/tool-definition.ts
CHANGED
|
@@ -47,7 +47,9 @@ export const ENV_SCHEMA = "PI_WORKFLOW_SCHEMA";
|
|
|
47
47
|
*
|
|
48
48
|
* [跨包契约] 任一端改值必须同步另一端,否则 SW 侧硬拒绝线与 SO 侧提示线漂移。
|
|
49
49
|
*/
|
|
50
|
-
|
|
50
|
+
const SCHEMA_SIZE_WARN_KIB = 256;
|
|
51
|
+
const BYTES_PER_KIB = 1024;
|
|
52
|
+
export const SO_SCHEMA_SIZE_WARN_BYTES = SCHEMA_SIZE_WARN_KIB * BYTES_PER_KIB;
|
|
51
53
|
|
|
52
54
|
/**
|
|
53
55
|
* 注册期 schema 体积可见性提示(SO-DATA-4 的 SO 侧职责:提示,不拒绝)。
|
|
@@ -59,7 +61,7 @@ function warnIfSchemaOversized(envSchema: string): void {
|
|
|
59
61
|
if (bytes <= SO_SCHEMA_SIZE_WARN_BYTES) return;
|
|
60
62
|
process.stderr.write(
|
|
61
63
|
`[structured-output] PI_WORKFLOW_SCHEMA is ${bytes} bytes (> ${SO_SCHEMA_SIZE_WARN_BYTES} bytes / `
|
|
62
|
-
+ `${SO_SCHEMA_SIZE_WARN_BYTES /
|
|
64
|
+
+ `${SO_SCHEMA_SIZE_WARN_BYTES / BYTES_PER_KIB} KiB). The env channel has a size ceiling: the workflow runner `
|
|
63
65
|
+ "rejects injection above its own limit (spawn fails, hard to attribute), and oversized values can "
|
|
64
66
|
+ "hit E2BIG (ARG_MAX) at spawn. "
|
|
65
67
|
+ "👉 精简 outputSchema(删冗余 description / 收敛深嵌套)或拆分为多个小 schema 步骤。\n",
|