@jeffreycao/copilot-api 2.1.1 → 2.1.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/main.js +1 -1
- package/dist/{server---R3M8xj.js → server-CFiLrT2j.js} +20 -2
- package/dist/server-CFiLrT2j.js.map +1 -0
- package/dist/{start-ObdI9ph2.js → start-B5OlQ3jG.js} +2 -2
- package/dist/{start-ObdI9ph2.js.map → start-B5OlQ3jG.js.map} +1 -1
- package/package.json +1 -1
- package/dist/server---R3M8xj.js.map +0 -1
package/dist/main.js
CHANGED
|
@@ -25,7 +25,7 @@ bindElectronFetch();
|
|
|
25
25
|
const { auth } = await import("./auth-DH-ThnhJ.js");
|
|
26
26
|
const { debug } = await import("./debug-D2giR-Kj.js");
|
|
27
27
|
const { mcp } = await import("./mcp-BG6fpi6q.js");
|
|
28
|
-
const { start } = await import("./start-
|
|
28
|
+
const { start } = await import("./start-B5OlQ3jG.js");
|
|
29
29
|
await runMain(defineCommand({
|
|
30
30
|
meta: {
|
|
31
31
|
name: "copilot-api",
|
|
@@ -2999,7 +2999,8 @@ async function handleCompletion$1(c) {
|
|
|
2999
2999
|
});
|
|
3000
3000
|
}
|
|
3001
3001
|
debugJson(logger$13, "Request payload:", payload);
|
|
3002
|
-
const selectedModel =
|
|
3002
|
+
const selectedModel = findEndpointModel(payload.model);
|
|
3003
|
+
payload.model = selectedModel?.id ?? payload.model;
|
|
3003
3004
|
if (isNullish(payload.max_tokens) && isNullish(payload.max_completion_tokens)) {
|
|
3004
3005
|
payload = {
|
|
3005
3006
|
...payload,
|
|
@@ -10025,6 +10026,7 @@ const handleResponses = async (c) => {
|
|
|
10025
10026
|
model: payload.model
|
|
10026
10027
|
});
|
|
10027
10028
|
removeUnsupportedTools(payload);
|
|
10029
|
+
fillEmptyNamespaceToolDescriptions(payload);
|
|
10028
10030
|
if (!responsesHandlerDependencies.isResponsesApiWebSearchEnabled()) removeWebSearchTool(payload);
|
|
10029
10031
|
const sanitizedImageCount = sanitizeOversizedInputImages(payload, selectedModel?.capabilities.limits.vision?.max_prompt_image_size);
|
|
10030
10032
|
if (sanitizedImageCount > 0) logger$1.warn(`Omitted ${sanitizedImageCount} oversized input image(s) before forwarding to Copilot Responses`);
|
|
@@ -10110,6 +10112,22 @@ const removeUnsupportedTools = (payload) => {
|
|
|
10110
10112
|
});
|
|
10111
10113
|
if (dropped.length > 0) logger$1.debug("Removed unsupported tools:", dropped);
|
|
10112
10114
|
};
|
|
10115
|
+
const fillEmptyNamespaceToolDescriptions = (payload) => {
|
|
10116
|
+
fillEmptyNamespaceDescriptions(payload.tools);
|
|
10117
|
+
if (!Array.isArray(payload.input)) return;
|
|
10118
|
+
for (const item of payload.input) {
|
|
10119
|
+
if (!item || typeof item !== "object") continue;
|
|
10120
|
+
fillEmptyNamespaceDescriptions(item.tools);
|
|
10121
|
+
}
|
|
10122
|
+
};
|
|
10123
|
+
const fillEmptyNamespaceDescriptions = (tools) => {
|
|
10124
|
+
if (!Array.isArray(tools)) return;
|
|
10125
|
+
for (const tool of tools) {
|
|
10126
|
+
if (!tool || typeof tool !== "object") continue;
|
|
10127
|
+
const namespaceTool = tool;
|
|
10128
|
+
if (namespaceTool.type === "namespace" && namespaceTool.description === "" && typeof namespaceTool.name === "string") namespaceTool.description = namespaceTool.name;
|
|
10129
|
+
}
|
|
10130
|
+
};
|
|
10113
10131
|
const getIncomingResponsesSessionId = (c) => getTrimmedHeader(c, "session-id") ?? getTrimmedHeader(c, "x-session-id");
|
|
10114
10132
|
const codexSubagentHeaderValues = new Set([
|
|
10115
10133
|
"collab_spawn",
|
|
@@ -10258,4 +10276,4 @@ server.route("/:provider/images", providerImageRoutes);
|
|
|
10258
10276
|
//#endregion
|
|
10259
10277
|
export { server };
|
|
10260
10278
|
|
|
10261
|
-
//# sourceMappingURL=server
|
|
10279
|
+
//# sourceMappingURL=server-CFiLrT2j.js.map
|