ai 6.0.0-beta.164 → 6.0.0-beta.165
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/CHANGELOG.md +10 -0
- package/dist/index.js +70 -59
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +70 -59
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/internal/index.mjs +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# ai
|
|
2
2
|
|
|
3
|
+
## 6.0.0-beta.165
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2625a04: feat(openai); update spec for mcp approval
|
|
8
|
+
- Updated dependencies [2625a04]
|
|
9
|
+
- @ai-sdk/provider@3.0.0-beta.31
|
|
10
|
+
- @ai-sdk/gateway@2.0.0-beta.91
|
|
11
|
+
- @ai-sdk/provider-utils@4.0.0-beta.58
|
|
12
|
+
|
|
3
13
|
## 6.0.0-beta.164
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -951,7 +951,7 @@ var import_provider_utils3 = require("@ai-sdk/provider-utils");
|
|
|
951
951
|
var import_provider_utils4 = require("@ai-sdk/provider-utils");
|
|
952
952
|
|
|
953
953
|
// src/version.ts
|
|
954
|
-
var VERSION = true ? "6.0.0-beta.
|
|
954
|
+
var VERSION = true ? "6.0.0-beta.165" : "0.0.0-test";
|
|
955
955
|
|
|
956
956
|
// src/util/download/download.ts
|
|
957
957
|
var download = async ({ url }) => {
|
|
@@ -4101,68 +4101,73 @@ function asContent({
|
|
|
4101
4101
|
toolApprovalRequests,
|
|
4102
4102
|
tools
|
|
4103
4103
|
}) {
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
}
|
|
4117
|
-
}
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
error: part.result,
|
|
4140
|
-
providerExecuted: true,
|
|
4141
|
-
dynamic: part.dynamic
|
|
4142
|
-
};
|
|
4143
|
-
}
|
|
4144
|
-
return {
|
|
4145
|
-
type: "tool-result",
|
|
4104
|
+
const contentParts = [];
|
|
4105
|
+
for (const part of content) {
|
|
4106
|
+
switch (part.type) {
|
|
4107
|
+
case "text":
|
|
4108
|
+
case "reasoning":
|
|
4109
|
+
case "source":
|
|
4110
|
+
contentParts.push(part);
|
|
4111
|
+
break;
|
|
4112
|
+
case "file": {
|
|
4113
|
+
contentParts.push({
|
|
4114
|
+
type: "file",
|
|
4115
|
+
file: new DefaultGeneratedFile(part),
|
|
4116
|
+
...part.providerMetadata != null ? { providerMetadata: part.providerMetadata } : {}
|
|
4117
|
+
});
|
|
4118
|
+
break;
|
|
4119
|
+
}
|
|
4120
|
+
case "tool-call": {
|
|
4121
|
+
contentParts.push(
|
|
4122
|
+
toolCalls.find((toolCall) => toolCall.toolCallId === part.toolCallId)
|
|
4123
|
+
);
|
|
4124
|
+
break;
|
|
4125
|
+
}
|
|
4126
|
+
case "tool-result": {
|
|
4127
|
+
const toolCall = toolCalls.find(
|
|
4128
|
+
(toolCall2) => toolCall2.toolCallId === part.toolCallId
|
|
4129
|
+
);
|
|
4130
|
+
if (toolCall == null) {
|
|
4131
|
+
const tool2 = tools == null ? void 0 : tools[part.toolName];
|
|
4132
|
+
const supportsDeferredResults = (tool2 == null ? void 0 : tool2.type) === "provider" && tool2.supportsDeferredResults;
|
|
4133
|
+
if (!supportsDeferredResults) {
|
|
4134
|
+
throw new Error(`Tool call ${part.toolCallId} not found.`);
|
|
4135
|
+
}
|
|
4136
|
+
if (part.isError) {
|
|
4137
|
+
contentParts.push({
|
|
4138
|
+
type: "tool-error",
|
|
4146
4139
|
toolCallId: part.toolCallId,
|
|
4147
4140
|
toolName: part.toolName,
|
|
4148
4141
|
input: void 0,
|
|
4149
|
-
|
|
4142
|
+
error: part.result,
|
|
4150
4143
|
providerExecuted: true,
|
|
4151
4144
|
dynamic: part.dynamic
|
|
4152
|
-
};
|
|
4153
|
-
}
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
type: "tool-error",
|
|
4145
|
+
});
|
|
4146
|
+
} else {
|
|
4147
|
+
contentParts.push({
|
|
4148
|
+
type: "tool-result",
|
|
4157
4149
|
toolCallId: part.toolCallId,
|
|
4158
4150
|
toolName: part.toolName,
|
|
4159
|
-
input:
|
|
4160
|
-
|
|
4151
|
+
input: void 0,
|
|
4152
|
+
output: part.result,
|
|
4161
4153
|
providerExecuted: true,
|
|
4162
|
-
dynamic:
|
|
4163
|
-
};
|
|
4154
|
+
dynamic: part.dynamic
|
|
4155
|
+
});
|
|
4164
4156
|
}
|
|
4165
|
-
|
|
4157
|
+
break;
|
|
4158
|
+
}
|
|
4159
|
+
if (part.isError) {
|
|
4160
|
+
contentParts.push({
|
|
4161
|
+
type: "tool-error",
|
|
4162
|
+
toolCallId: part.toolCallId,
|
|
4163
|
+
toolName: part.toolName,
|
|
4164
|
+
input: toolCall.input,
|
|
4165
|
+
error: part.result,
|
|
4166
|
+
providerExecuted: true,
|
|
4167
|
+
dynamic: toolCall.dynamic
|
|
4168
|
+
});
|
|
4169
|
+
} else {
|
|
4170
|
+
contentParts.push({
|
|
4166
4171
|
type: "tool-result",
|
|
4167
4172
|
toolCallId: part.toolCallId,
|
|
4168
4173
|
toolName: part.toolName,
|
|
@@ -4170,13 +4175,16 @@ function asContent({
|
|
|
4170
4175
|
output: part.result,
|
|
4171
4176
|
providerExecuted: true,
|
|
4172
4177
|
dynamic: toolCall.dynamic
|
|
4173
|
-
};
|
|
4178
|
+
});
|
|
4174
4179
|
}
|
|
4180
|
+
break;
|
|
4175
4181
|
}
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4182
|
+
case "tool-approval-request": {
|
|
4183
|
+
break;
|
|
4184
|
+
}
|
|
4185
|
+
}
|
|
4186
|
+
}
|
|
4187
|
+
return [...contentParts, ...toolOutputs, ...toolApprovalRequests];
|
|
4180
4188
|
}
|
|
4181
4189
|
|
|
4182
4190
|
// src/generate-text/stream-text.ts
|
|
@@ -5459,6 +5467,9 @@ function runToolsTransformation({
|
|
|
5459
5467
|
}
|
|
5460
5468
|
break;
|
|
5461
5469
|
}
|
|
5470
|
+
case "tool-approval-request": {
|
|
5471
|
+
break;
|
|
5472
|
+
}
|
|
5462
5473
|
default: {
|
|
5463
5474
|
const _exhaustiveCheck = chunkType;
|
|
5464
5475
|
throw new Error(`Unhandled chunk type: ${_exhaustiveCheck}`);
|