@agent-proxy/agy 0.19.0 → 0.20.2
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 +40 -0
- package/dist/resources/models.js +0 -4
- package/package.json +4 -4
package/dist/request.js
CHANGED
|
@@ -629,6 +629,46 @@ export function translateAgyRequest(body, upstreamModel, to = "responses") {
|
|
|
629
629
|
(item.role === "assistant" ? assistantContent() : userContent()).parts.push(...parts);
|
|
630
630
|
continue;
|
|
631
631
|
}
|
|
632
|
+
if (item.type === "agent_message") {
|
|
633
|
+
// Codex 多智能体历史:agent 产出的消息(author/recipient 为内部路由元数据)
|
|
634
|
+
// 按 assistant 回放文本与图片;encrypted_content 是上游私有加密载荷,跨厂商
|
|
635
|
+
// 不可解,直接剥离。
|
|
636
|
+
const parts = [];
|
|
637
|
+
const content = item.content;
|
|
638
|
+
if (typeof content === "string")
|
|
639
|
+
parts.push({ text: content });
|
|
640
|
+
else if (Array.isArray(content)) {
|
|
641
|
+
for (const raw of content) {
|
|
642
|
+
if (!record(raw))
|
|
643
|
+
fail("agent_message 包含无效内容块");
|
|
644
|
+
if (raw.type === "encrypted_content")
|
|
645
|
+
continue;
|
|
646
|
+
if (raw.type === "input_text" || raw.type === "output_text" || raw.type === "text")
|
|
647
|
+
parts.push(textPart(raw, "agent_message"));
|
|
648
|
+
else if (raw.type === "input_image" || raw.type === "image") {
|
|
649
|
+
const source = raw.image_url ?? raw.url;
|
|
650
|
+
const url = typeof source === "string" ? source : record(source) ? source.url : undefined;
|
|
651
|
+
if (typeof url !== "string" || !url)
|
|
652
|
+
fail("agent_message 的 input_image 缺少 image_url");
|
|
653
|
+
if (url.startsWith("data:")) {
|
|
654
|
+
const match = /^data:([^;,]*)(?:;charset=[^;,]*)?;base64,(.*)$/s.exec(url);
|
|
655
|
+
if (!match)
|
|
656
|
+
fail("agent_message 的 data URI 必须是 base64 编码");
|
|
657
|
+
parts.push({ inlineData: { mimeType: match[1] || "image/png", data: match[2] } });
|
|
658
|
+
}
|
|
659
|
+
else {
|
|
660
|
+
parts.push({ fileData: { fileUri: url } });
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
else
|
|
664
|
+
fail(`agent_message 包含不支持的内容块类型 ${String(raw.type)}`);
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
else
|
|
668
|
+
fail("agent_message 的 content 必须是字符串或数组");
|
|
669
|
+
assistantContent().parts.push(...parts);
|
|
670
|
+
continue;
|
|
671
|
+
}
|
|
632
672
|
if (item.type === "function_call" || item.type === "custom_tool_call") {
|
|
633
673
|
const identity = toolIdentity(item.name, item.namespace);
|
|
634
674
|
const custom = item.type === "custom_tool_call";
|
package/dist/resources/models.js
CHANGED
|
@@ -5871,7 +5871,6 @@ var vendor_models_default = {
|
|
|
5871
5871
|
max_context_window: 1048576,
|
|
5872
5872
|
effective_context_window_percent: 95,
|
|
5873
5873
|
supports_parallel_tool_calls: true,
|
|
5874
|
-
experimental_supported_tools: [],
|
|
5875
5874
|
input_modalities: ["text", "image"]
|
|
5876
5875
|
},
|
|
5877
5876
|
{
|
|
@@ -5910,7 +5909,6 @@ var vendor_models_default = {
|
|
|
5910
5909
|
max_context_window: 1048576,
|
|
5911
5910
|
effective_context_window_percent: 95,
|
|
5912
5911
|
supports_parallel_tool_calls: true,
|
|
5913
|
-
experimental_supported_tools: [],
|
|
5914
5912
|
input_modalities: ["text", "image"]
|
|
5915
5913
|
},
|
|
5916
5914
|
{
|
|
@@ -5949,7 +5947,6 @@ var vendor_models_default = {
|
|
|
5949
5947
|
max_context_window: 1048576,
|
|
5950
5948
|
effective_context_window_percent: 95,
|
|
5951
5949
|
supports_parallel_tool_calls: true,
|
|
5952
|
-
experimental_supported_tools: [],
|
|
5953
5950
|
input_modalities: ["text", "image"]
|
|
5954
5951
|
},
|
|
5955
5952
|
{
|
|
@@ -5975,7 +5972,6 @@ var vendor_models_default = {
|
|
|
5975
5972
|
max_context_window: 204800,
|
|
5976
5973
|
effective_context_window_percent: 95,
|
|
5977
5974
|
supports_parallel_tool_calls: true,
|
|
5978
|
-
experimental_supported_tools: [],
|
|
5979
5975
|
input_modalities: ["text"]
|
|
5980
5976
|
}
|
|
5981
5977
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-proxy/agy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.2",
|
|
4
4
|
"description": "Agent Proxy agy 插件;保留基线转换行为。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -35,10 +35,10 @@
|
|
|
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.20.2"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@agent-proxy/plugin-api": "0.
|
|
41
|
+
"@agent-proxy/plugin-api": "0.20.2"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "da33f92fc5cb05404b8f7ef7a91eb6321382cfc1"
|
|
44
44
|
}
|