@jeffreycao/copilot-api 2.2.5 → 2.2.6
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/main.js +1 -1
- package/dist/{server-9Fk9a6_A.js → server-Bx7xs1FA.js} +11 -2
- package/dist/server-Bx7xs1FA.js.map +1 -0
- package/dist/{start-CO8nU6_-.js → start-HcJzBszU.js} +2 -2
- package/dist/{start-CO8nU6_-.js.map → start-HcJzBszU.js.map} +1 -1
- package/package.json +1 -1
- package/dist/server-9Fk9a6_A.js.map +0 -1
package/dist/main.js
CHANGED
|
@@ -30,7 +30,7 @@ if (isMcpFastPath(process.argv)) {
|
|
|
30
30
|
const { auth } = await import("./auth-C-RWNXGU.js");
|
|
31
31
|
const { debug } = await import("./debug-41w6Whae.js");
|
|
32
32
|
const { mcp } = await import("./mcp-fpSlKZxK.js");
|
|
33
|
-
const { start } = await import("./start-
|
|
33
|
+
const { start } = await import("./start-HcJzBszU.js");
|
|
34
34
|
await runMain(defineCommand({
|
|
35
35
|
meta: {
|
|
36
36
|
name: "copilot-api",
|
|
@@ -5976,6 +5976,7 @@ const collectInputItemImageDataUrls = (item, images) => {
|
|
|
5976
5976
|
const collectContentImageDataUrls = (content, images) => {
|
|
5977
5977
|
if (!Array.isArray(content)) return;
|
|
5978
5978
|
for (const block of content) {
|
|
5979
|
+
if (isResponseInputImage(block)) block.detail = normalizeInputImageDetail(block.detail);
|
|
5979
5980
|
const image = getInputImageDataUrl(block);
|
|
5980
5981
|
if (image) images.push(image);
|
|
5981
5982
|
}
|
|
@@ -5998,11 +5999,19 @@ const replaceInputImageWithPlaceholder = (image) => {
|
|
|
5998
5999
|
image.record.detail = "low";
|
|
5999
6000
|
delete image.record.file_id;
|
|
6000
6001
|
};
|
|
6002
|
+
const VALID_INPUT_IMAGE_DETAILS = new Set([
|
|
6003
|
+
"auto",
|
|
6004
|
+
"high",
|
|
6005
|
+
"low"
|
|
6006
|
+
]);
|
|
6007
|
+
const normalizeInputImageDetail = (detail) => {
|
|
6008
|
+
return VALID_INPUT_IMAGE_DETAILS.has(detail) ? detail : "auto";
|
|
6009
|
+
};
|
|
6001
6010
|
const isResponseInputMessage = (item) => {
|
|
6002
6011
|
return typeof item === "object" && item !== null && "role" in item && typeof item.role === "string";
|
|
6003
6012
|
};
|
|
6004
6013
|
const isResponseFunctionCallOutputItem = (item) => {
|
|
6005
|
-
return typeof item === "object" && item !== null && "type" in item && item.type === "function_call_output";
|
|
6014
|
+
return typeof item === "object" && item !== null && "type" in item && (item.type === "custom_tool_call_output" || item.type === "function_call_output");
|
|
6006
6015
|
};
|
|
6007
6016
|
const isResponseInputImage = (content) => {
|
|
6008
6017
|
return typeof content === "object" && content !== null && "type" in content && content.type === "input_image";
|
|
@@ -10508,4 +10517,4 @@ server.route("/:provider/images", providerImageRoutes);
|
|
|
10508
10517
|
//#endregion
|
|
10509
10518
|
export { server };
|
|
10510
10519
|
|
|
10511
|
-
//# sourceMappingURL=server-
|
|
10520
|
+
//# sourceMappingURL=server-Bx7xs1FA.js.map
|