mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-24 06:45:22 +00:00
chore: rm patches now that ai sdk packages are upgraded
This commit is contained in:
@@ -111,8 +111,6 @@
|
||||
"@types/node": "catalog:"
|
||||
},
|
||||
"patchedDependencies": {
|
||||
"@standard-community/standard-openapi@0.2.9": "patches/@standard-community%2Fstandard-openapi@0.2.9.patch",
|
||||
"@openrouter/ai-sdk-provider@1.5.4": "patches/@openrouter%2Fai-sdk-provider@1.5.4.patch",
|
||||
"@ai-sdk/xai@2.0.51": "patches/@ai-sdk%2Fxai@2.0.51.patch"
|
||||
"@standard-community/standard-openapi@0.2.9": "patches/@standard-community%2Fstandard-openapi@0.2.9.patch"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
diff --git a/dist/index.mjs b/dist/index.mjs
|
||||
--- a/dist/index.mjs
|
||||
+++ b/dist/index.mjs
|
||||
@@ -959,7 +959,7 @@
|
||||
model: z4.string().nullish(),
|
||||
object: z4.literal("response"),
|
||||
output: z4.array(outputItemSchema),
|
||||
- usage: xaiResponsesUsageSchema,
|
||||
+ usage: xaiResponsesUsageSchema.nullish(),
|
||||
status: z4.string()
|
||||
});
|
||||
var xaiResponsesChunkSchema = z4.union([
|
||||
\ No newline at end of file
|
||||
@@ -1143,6 +1143,18 @@
|
||||
z4.object({
|
||||
type: z4.literal("response.completed"),
|
||||
response: xaiResponsesResponseSchema
|
||||
+ }),
|
||||
+ z4.object({
|
||||
+ type: z4.literal("response.function_call_arguments.delta"),
|
||||
+ item_id: z4.string(),
|
||||
+ output_index: z4.number(),
|
||||
+ delta: z4.string()
|
||||
+ }),
|
||||
+ z4.object({
|
||||
+ type: z4.literal("response.function_call_arguments.done"),
|
||||
+ item_id: z4.string(),
|
||||
+ output_index: z4.number(),
|
||||
+ arguments: z4.string()
|
||||
})
|
||||
]);
|
||||
|
||||
\ No newline at end of file
|
||||
@@ -1940,6 +1952,9 @@
|
||||
if (response2.status) {
|
||||
finishReason = mapXaiResponsesFinishReason(response2.status);
|
||||
}
|
||||
+ if (seenToolCalls.size > 0 && finishReason !== "tool-calls") {
|
||||
+ finishReason = "tool-calls";
|
||||
+ }
|
||||
return;
|
||||
}
|
||||
if (event.type === "response.output_item.added" || event.type === "response.output_item.done") {
|
||||
\ No newline at end of file
|
||||
@@ -2024,7 +2039,7 @@
|
||||
}
|
||||
}
|
||||
} else if (part.type === "function_call") {
|
||||
- if (!seenToolCalls.has(part.call_id)) {
|
||||
+ if (event.type === "response.output_item.done" && !seenToolCalls.has(part.call_id)) {
|
||||
seenToolCalls.add(part.call_id);
|
||||
controller.enqueue({
|
||||
type: "tool-input-start",
|
||||
\ No newline at end of file
|
||||
diff --git a/dist/index.js b/dist/index.js
|
||||
--- a/dist/index.js
|
||||
+++ b/dist/index.js
|
||||
@@ -964,7 +964,7 @@
|
||||
model: import_v44.z.string().nullish(),
|
||||
object: import_v44.z.literal("response"),
|
||||
output: import_v44.z.array(outputItemSchema),
|
||||
- usage: xaiResponsesUsageSchema,
|
||||
+ usage: xaiResponsesUsageSchema.nullish(),
|
||||
status: import_v44.z.string()
|
||||
});
|
||||
var xaiResponsesChunkSchema = import_v44.z.union([
|
||||
\ No newline at end of file
|
||||
@@ -1148,6 +1148,18 @@
|
||||
import_v44.z.object({
|
||||
type: import_v44.z.literal("response.completed"),
|
||||
response: xaiResponsesResponseSchema
|
||||
+ }),
|
||||
+ import_v44.z.object({
|
||||
+ type: import_v44.z.literal("response.function_call_arguments.delta"),
|
||||
+ item_id: import_v44.z.string(),
|
||||
+ output_index: import_v44.z.number(),
|
||||
+ delta: import_v44.z.string()
|
||||
+ }),
|
||||
+ import_v44.z.object({
|
||||
+ type: import_v44.z.literal("response.function_call_arguments.done"),
|
||||
+ item_id: import_v44.z.string(),
|
||||
+ output_index: import_v44.z.number(),
|
||||
+ arguments: import_v44.z.string()
|
||||
})
|
||||
]);
|
||||
|
||||
\ No newline at end of file
|
||||
@@ -1935,6 +1947,9 @@
|
||||
if (response2.status) {
|
||||
finishReason = mapXaiResponsesFinishReason(response2.status);
|
||||
}
|
||||
+ if (seenToolCalls.size > 0 && finishReason !== "tool-calls") {
|
||||
+ finishReason = "tool-calls";
|
||||
+ }
|
||||
return;
|
||||
}
|
||||
if (event.type === "response.output_item.added" || event.type === "response.output_item.done") {
|
||||
\ No newline at end of file
|
||||
@@ -2019,7 +2034,7 @@
|
||||
}
|
||||
}
|
||||
} else if (part.type === "function_call") {
|
||||
- if (!seenToolCalls.has(part.call_id)) {
|
||||
+ if (event.type === "response.output_item.done" && !seenToolCalls.has(part.call_id)) {
|
||||
seenToolCalls.add(part.call_id);
|
||||
controller.enqueue({
|
||||
type: "tool-input-start",
|
||||
\ No newline at end of file
|
||||
@@ -1,128 +0,0 @@
|
||||
diff --git a/dist/index.js b/dist/index.js
|
||||
index f33510a50d11a2cb92a90ea70cc0ac84c89f29b9..e887a60352c0c08ab794b1e6821854dfeefd20cc 100644
|
||||
--- a/dist/index.js
|
||||
+++ b/dist/index.js
|
||||
@@ -2110,7 +2110,12 @@ var OpenRouterChatLanguageModel = class {
|
||||
if (reasoningStarted && !textStarted) {
|
||||
controller.enqueue({
|
||||
type: "reasoning-end",
|
||||
- id: reasoningId || generateId()
|
||||
+ id: reasoningId || generateId(),
|
||||
+ providerMetadata: accumulatedReasoningDetails.length > 0 ? {
|
||||
+ openrouter: {
|
||||
+ reasoning_details: accumulatedReasoningDetails
|
||||
+ }
|
||||
+ } : undefined
|
||||
});
|
||||
reasoningStarted = false;
|
||||
}
|
||||
@@ -2307,7 +2312,12 @@ var OpenRouterChatLanguageModel = class {
|
||||
if (reasoningStarted) {
|
||||
controller.enqueue({
|
||||
type: "reasoning-end",
|
||||
- id: reasoningId || generateId()
|
||||
+ id: reasoningId || generateId(),
|
||||
+ providerMetadata: accumulatedReasoningDetails.length > 0 ? {
|
||||
+ openrouter: {
|
||||
+ reasoning_details: accumulatedReasoningDetails
|
||||
+ }
|
||||
+ } : undefined
|
||||
});
|
||||
}
|
||||
if (textStarted) {
|
||||
diff --git a/dist/index.mjs b/dist/index.mjs
|
||||
index 8a688331b88b4af738ee4ca8062b5f24124d3d81..6310cb8b7c8d0a728d86e1eed09906c6b4c91ae2 100644
|
||||
--- a/dist/index.mjs
|
||||
+++ b/dist/index.mjs
|
||||
@@ -2075,7 +2075,12 @@ var OpenRouterChatLanguageModel = class {
|
||||
if (reasoningStarted && !textStarted) {
|
||||
controller.enqueue({
|
||||
type: "reasoning-end",
|
||||
- id: reasoningId || generateId()
|
||||
+ id: reasoningId || generateId(),
|
||||
+ providerMetadata: accumulatedReasoningDetails.length > 0 ? {
|
||||
+ openrouter: {
|
||||
+ reasoning_details: accumulatedReasoningDetails
|
||||
+ }
|
||||
+ } : undefined
|
||||
});
|
||||
reasoningStarted = false;
|
||||
}
|
||||
@@ -2272,7 +2277,12 @@ var OpenRouterChatLanguageModel = class {
|
||||
if (reasoningStarted) {
|
||||
controller.enqueue({
|
||||
type: "reasoning-end",
|
||||
- id: reasoningId || generateId()
|
||||
+ id: reasoningId || generateId(),
|
||||
+ providerMetadata: accumulatedReasoningDetails.length > 0 ? {
|
||||
+ openrouter: {
|
||||
+ reasoning_details: accumulatedReasoningDetails
|
||||
+ }
|
||||
+ } : undefined
|
||||
});
|
||||
}
|
||||
if (textStarted) {
|
||||
diff --git a/dist/internal/index.js b/dist/internal/index.js
|
||||
index d40fa66125941155ac13a4619503caba24d89f8a..8dd86d1b473f2fa31c1acd9881d72945b294a197 100644
|
||||
--- a/dist/internal/index.js
|
||||
+++ b/dist/internal/index.js
|
||||
@@ -2064,7 +2064,12 @@ var OpenRouterChatLanguageModel = class {
|
||||
if (reasoningStarted && !textStarted) {
|
||||
controller.enqueue({
|
||||
type: "reasoning-end",
|
||||
- id: reasoningId || generateId()
|
||||
+ id: reasoningId || generateId(),
|
||||
+ providerMetadata: accumulatedReasoningDetails.length > 0 ? {
|
||||
+ openrouter: {
|
||||
+ reasoning_details: accumulatedReasoningDetails
|
||||
+ }
|
||||
+ } : undefined
|
||||
});
|
||||
reasoningStarted = false;
|
||||
}
|
||||
@@ -2261,7 +2266,12 @@ var OpenRouterChatLanguageModel = class {
|
||||
if (reasoningStarted) {
|
||||
controller.enqueue({
|
||||
type: "reasoning-end",
|
||||
- id: reasoningId || generateId()
|
||||
+ id: reasoningId || generateId(),
|
||||
+ providerMetadata: accumulatedReasoningDetails.length > 0 ? {
|
||||
+ openrouter: {
|
||||
+ reasoning_details: accumulatedReasoningDetails
|
||||
+ }
|
||||
+ } : undefined
|
||||
});
|
||||
}
|
||||
if (textStarted) {
|
||||
diff --git a/dist/internal/index.mjs b/dist/internal/index.mjs
|
||||
index b0ed9d113549c5c55ea3b1e08abb3db6f92ae5a7..5695930a8e038facc071d58a4179a369a29be9c7 100644
|
||||
--- a/dist/internal/index.mjs
|
||||
+++ b/dist/internal/index.mjs
|
||||
@@ -2030,7 +2030,12 @@ var OpenRouterChatLanguageModel = class {
|
||||
if (reasoningStarted && !textStarted) {
|
||||
controller.enqueue({
|
||||
type: "reasoning-end",
|
||||
- id: reasoningId || generateId()
|
||||
+ id: reasoningId || generateId(),
|
||||
+ providerMetadata: accumulatedReasoningDetails.length > 0 ? {
|
||||
+ openrouter: {
|
||||
+ reasoning_details: accumulatedReasoningDetails
|
||||
+ }
|
||||
+ } : undefined
|
||||
});
|
||||
reasoningStarted = false;
|
||||
}
|
||||
@@ -2227,7 +2232,12 @@ var OpenRouterChatLanguageModel = class {
|
||||
if (reasoningStarted) {
|
||||
controller.enqueue({
|
||||
type: "reasoning-end",
|
||||
- id: reasoningId || generateId()
|
||||
+ id: reasoningId || generateId(),
|
||||
+ providerMetadata: accumulatedReasoningDetails.length > 0 ? {
|
||||
+ openrouter: {
|
||||
+ reasoning_details: accumulatedReasoningDetails
|
||||
+ }
|
||||
+ } : undefined
|
||||
});
|
||||
}
|
||||
if (textStarted) {
|
||||
Reference in New Issue
Block a user