@agent-proxy/zcode 0.15.0 → 0.16.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/dist/request.js +11 -1
- package/package.json +5 -5
package/dist/request.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BridgeConversionError, convertRequest } from "@agent-proxy/llm-bridge";
|
|
1
|
+
import { BridgeConversionError, convertRequest, normalizeResponsesToolDeclarations } from "@agent-proxy/llm-bridge";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
import { decodeZcodeThinking, isZcodeRecord } from "./wire.js";
|
|
4
4
|
import { ANALYZE_IMAGE_SYSTEM_NOTE, ANALYZE_IMAGE_TOOL_DECLARATION, ANALYZE_IMAGE_TOOL_NAME, collectZcodeImages } from "./vision.js";
|
|
@@ -243,6 +243,16 @@ function segmentZcodeRequestLegs(to, body, options) {
|
|
|
243
243
|
export async function translateZcodeRequest(body, upstreamModel, to = "responses") {
|
|
244
244
|
if (typeof upstreamModel !== "string" || !upstreamModel)
|
|
245
245
|
fail("上游模型不能为空");
|
|
246
|
+
try {
|
|
247
|
+
// 工具规划与历史切段都要使用提升后的声明,确保增补的搜索与 namespace 工具可见。
|
|
248
|
+
if (to === "responses")
|
|
249
|
+
body = normalizeResponsesToolDeclarations(body);
|
|
250
|
+
}
|
|
251
|
+
catch (error) {
|
|
252
|
+
if (error instanceof BridgeConversionError)
|
|
253
|
+
throw new ZcodeRequestError(error.message);
|
|
254
|
+
throw error;
|
|
255
|
+
}
|
|
246
256
|
if (body.previous_response_id !== undefined && body.previous_response_id !== null && body.previous_response_id !== "") {
|
|
247
257
|
fail("ZCode 不支持 previous_response_id;请提供完整 input 历史");
|
|
248
258
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-proxy/zcode",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Agent Proxy zcode 插件;保留基线转换行为。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"url": "git+https://github.com/aceHubert/codex-cliproxy-gateway.git"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@agent-proxy/models": "0.
|
|
38
|
+
"@agent-proxy/models": "0.16.0"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@agent-proxy/llm-bridge": "0.
|
|
42
|
-
"@agent-proxy/plugin-api": "0.
|
|
41
|
+
"@agent-proxy/llm-bridge": "0.16.0",
|
|
42
|
+
"@agent-proxy/plugin-api": "0.16.0"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "062121f545d3391665789b2e8baae842029262be"
|
|
45
45
|
}
|