@zenning/ai 6.0.29 → 6.0.30
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 +6 -0
- package/dist/index.js +81 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +81 -10
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/internal/index.mjs +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1001,7 +1001,7 @@ var import_provider_utils3 = require("@zenning/provider-utils");
|
|
|
1001
1001
|
var import_provider_utils4 = require("@zenning/provider-utils");
|
|
1002
1002
|
|
|
1003
1003
|
// src/version.ts
|
|
1004
|
-
var VERSION = true ? "6.0.
|
|
1004
|
+
var VERSION = true ? "6.0.30" : "0.0.0-test";
|
|
1005
1005
|
|
|
1006
1006
|
// src/util/download/download.ts
|
|
1007
1007
|
var download = async ({ url }) => {
|
|
@@ -4839,16 +4839,43 @@ function processUIMessageStream({
|
|
|
4839
4839
|
break;
|
|
4840
4840
|
}
|
|
4841
4841
|
case "text-delta": {
|
|
4842
|
-
|
|
4842
|
+
let textPart = state.activeTextParts[chunk.id];
|
|
4843
|
+
if (!textPart) {
|
|
4844
|
+
const existing = state.message.parts.findLast(
|
|
4845
|
+
(p) => p.type === "text" && p.state !== "done"
|
|
4846
|
+
);
|
|
4847
|
+
if (existing) {
|
|
4848
|
+
textPart = existing;
|
|
4849
|
+
} else {
|
|
4850
|
+
textPart = {
|
|
4851
|
+
type: "text",
|
|
4852
|
+
text: "",
|
|
4853
|
+
state: "streaming"
|
|
4854
|
+
};
|
|
4855
|
+
state.message.parts.push(textPart);
|
|
4856
|
+
}
|
|
4857
|
+
state.activeTextParts[chunk.id] = textPart;
|
|
4858
|
+
}
|
|
4843
4859
|
textPart.text += chunk.delta;
|
|
4844
4860
|
textPart.providerMetadata = (_a16 = chunk.providerMetadata) != null ? _a16 : textPart.providerMetadata;
|
|
4845
4861
|
write();
|
|
4846
4862
|
break;
|
|
4847
4863
|
}
|
|
4848
4864
|
case "text-end": {
|
|
4849
|
-
|
|
4850
|
-
textPart
|
|
4851
|
-
|
|
4865
|
+
let textPart = state.activeTextParts[chunk.id];
|
|
4866
|
+
if (!textPart) {
|
|
4867
|
+
const existing = state.message.parts.findLast(
|
|
4868
|
+
(p) => p.type === "text" && p.state !== "done"
|
|
4869
|
+
);
|
|
4870
|
+
if (existing) {
|
|
4871
|
+
textPart = existing;
|
|
4872
|
+
state.activeTextParts[chunk.id] = textPart;
|
|
4873
|
+
}
|
|
4874
|
+
}
|
|
4875
|
+
if (textPart) {
|
|
4876
|
+
textPart.state = "done";
|
|
4877
|
+
textPart.providerMetadata = (_b = chunk.providerMetadata) != null ? _b : textPart.providerMetadata;
|
|
4878
|
+
}
|
|
4852
4879
|
delete state.activeTextParts[chunk.id];
|
|
4853
4880
|
write();
|
|
4854
4881
|
break;
|
|
@@ -4866,16 +4893,43 @@ function processUIMessageStream({
|
|
|
4866
4893
|
break;
|
|
4867
4894
|
}
|
|
4868
4895
|
case "reasoning-delta": {
|
|
4869
|
-
|
|
4896
|
+
let reasoningPart = state.activeReasoningParts[chunk.id];
|
|
4897
|
+
if (!reasoningPart) {
|
|
4898
|
+
const existing = state.message.parts.findLast(
|
|
4899
|
+
(p) => p.type === "reasoning" && p.state !== "done"
|
|
4900
|
+
);
|
|
4901
|
+
if (existing) {
|
|
4902
|
+
reasoningPart = existing;
|
|
4903
|
+
} else {
|
|
4904
|
+
reasoningPart = {
|
|
4905
|
+
type: "reasoning",
|
|
4906
|
+
text: "",
|
|
4907
|
+
state: "streaming"
|
|
4908
|
+
};
|
|
4909
|
+
state.message.parts.push(reasoningPart);
|
|
4910
|
+
}
|
|
4911
|
+
state.activeReasoningParts[chunk.id] = reasoningPart;
|
|
4912
|
+
}
|
|
4870
4913
|
reasoningPart.text += chunk.delta;
|
|
4871
4914
|
reasoningPart.providerMetadata = (_c = chunk.providerMetadata) != null ? _c : reasoningPart.providerMetadata;
|
|
4872
4915
|
write();
|
|
4873
4916
|
break;
|
|
4874
4917
|
}
|
|
4875
4918
|
case "reasoning-end": {
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4919
|
+
let reasoningPart = state.activeReasoningParts[chunk.id];
|
|
4920
|
+
if (!reasoningPart) {
|
|
4921
|
+
const existing = state.message.parts.findLast(
|
|
4922
|
+
(p) => p.type === "reasoning" && p.state !== "done"
|
|
4923
|
+
);
|
|
4924
|
+
if (existing) {
|
|
4925
|
+
reasoningPart = existing;
|
|
4926
|
+
state.activeReasoningParts[chunk.id] = reasoningPart;
|
|
4927
|
+
}
|
|
4928
|
+
}
|
|
4929
|
+
if (reasoningPart) {
|
|
4930
|
+
reasoningPart.providerMetadata = (_d = chunk.providerMetadata) != null ? _d : reasoningPart.providerMetadata;
|
|
4931
|
+
reasoningPart.state = "done";
|
|
4932
|
+
}
|
|
4879
4933
|
delete state.activeReasoningParts[chunk.id];
|
|
4880
4934
|
write();
|
|
4881
4935
|
break;
|
|
@@ -4944,7 +4998,24 @@ function processUIMessageStream({
|
|
|
4944
4998
|
break;
|
|
4945
4999
|
}
|
|
4946
5000
|
case "tool-input-delta": {
|
|
4947
|
-
|
|
5001
|
+
let partialToolCall = state.partialToolCalls[chunk.toolCallId];
|
|
5002
|
+
if (!partialToolCall) {
|
|
5003
|
+
const existingPart = state.message.parts.find(
|
|
5004
|
+
(p) => isToolUIPart(p) && p.toolCallId === chunk.toolCallId
|
|
5005
|
+
);
|
|
5006
|
+
if (existingPart) {
|
|
5007
|
+
const isDynamic = existingPart.type === "dynamic-tool";
|
|
5008
|
+
partialToolCall = {
|
|
5009
|
+
text: "",
|
|
5010
|
+
toolName: getToolName(existingPart),
|
|
5011
|
+
index: state.message.parts.filter(isStaticToolUIPart).indexOf(existingPart),
|
|
5012
|
+
dynamic: isDynamic
|
|
5013
|
+
};
|
|
5014
|
+
state.partialToolCalls[chunk.toolCallId] = partialToolCall;
|
|
5015
|
+
} else {
|
|
5016
|
+
break;
|
|
5017
|
+
}
|
|
5018
|
+
}
|
|
4948
5019
|
partialToolCall.text += chunk.inputTextDelta;
|
|
4949
5020
|
const { value: partialArgs } = await parsePartialJson(
|
|
4950
5021
|
partialToolCall.text
|