@zenning/ai 5.2.0 → 5.3.1
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/index.d.mts +14 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +56 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +56 -21
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/internal/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1405,7 +1405,7 @@ interface UIMessage<METADATA = unknown, DATA_PARTS extends UIDataTypes = UIDataT
|
|
|
1405
1405
|
*/
|
|
1406
1406
|
parts: Array<UIMessagePart<DATA_PARTS, TOOLS>>;
|
|
1407
1407
|
}
|
|
1408
|
-
type UIMessagePart<DATA_TYPES extends UIDataTypes, TOOLS extends UITools> = TextUIPart | ReasoningUIPart | ToolUIPart<TOOLS> | DynamicToolUIPart | SourceUrlUIPart | SourceDocumentUIPart | FileUIPart | DataUIPart<DATA_TYPES> | StepStartUIPart;
|
|
1408
|
+
type UIMessagePart<DATA_TYPES extends UIDataTypes, TOOLS extends UITools> = TextUIPart | ReasoningUIPart | ToolUIPart<TOOLS> | DynamicToolUIPart | SourceUrlUIPart | SourceDocumentUIPart | FileUIPart | SourceExecutionFileUIPart | DataUIPart<DATA_TYPES> | StepStartUIPart;
|
|
1409
1409
|
/**
|
|
1410
1410
|
* A text part of a message.
|
|
1411
1411
|
*/
|
|
@@ -1452,6 +1452,11 @@ type SourceUrlUIPart = {
|
|
|
1452
1452
|
title?: string;
|
|
1453
1453
|
providerMetadata?: ProviderMetadata;
|
|
1454
1454
|
};
|
|
1455
|
+
type SourceExecutionFileUIPart = {
|
|
1456
|
+
type: 'source-execution-file';
|
|
1457
|
+
sourceId: string;
|
|
1458
|
+
providerMetadata?: ProviderMetadata;
|
|
1459
|
+
};
|
|
1455
1460
|
/**
|
|
1456
1461
|
* A document source part of a message.
|
|
1457
1462
|
*/
|
|
@@ -1683,6 +1688,10 @@ declare const uiMessageChunkSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
1683
1688
|
url: z.ZodString;
|
|
1684
1689
|
mediaType: z.ZodString;
|
|
1685
1690
|
providerMetadata: z.ZodOptional<z.ZodType<_zenning_provider.SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<_zenning_provider.SharedV3ProviderMetadata, unknown>>>;
|
|
1691
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1692
|
+
type: z.ZodLiteral<"source-execution-file">;
|
|
1693
|
+
sourceId: z.ZodString;
|
|
1694
|
+
providerMetadata: z.ZodOptional<z.ZodType<_zenning_provider.SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<_zenning_provider.SharedV3ProviderMetadata, unknown>>>;
|
|
1686
1695
|
}, z.core.$strict>, z.ZodObject<{
|
|
1687
1696
|
type: z.ZodCustom<`data-${string}`, `data-${string}`>;
|
|
1688
1697
|
id: z.ZodOptional<z.ZodString>;
|
|
@@ -1798,6 +1807,10 @@ type UIMessageChunk<METADATA = unknown, DATA_TYPES extends UIDataTypes = UIDataT
|
|
|
1798
1807
|
startIndex?: number;
|
|
1799
1808
|
endIndex?: number;
|
|
1800
1809
|
providerMetadata?: ProviderMetadata;
|
|
1810
|
+
} | {
|
|
1811
|
+
type: 'source-execution-file';
|
|
1812
|
+
sourceId: string;
|
|
1813
|
+
providerMetadata?: ProviderMetadata;
|
|
1801
1814
|
} | {
|
|
1802
1815
|
type: 'file';
|
|
1803
1816
|
url: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1405,7 +1405,7 @@ interface UIMessage<METADATA = unknown, DATA_PARTS extends UIDataTypes = UIDataT
|
|
|
1405
1405
|
*/
|
|
1406
1406
|
parts: Array<UIMessagePart<DATA_PARTS, TOOLS>>;
|
|
1407
1407
|
}
|
|
1408
|
-
type UIMessagePart<DATA_TYPES extends UIDataTypes, TOOLS extends UITools> = TextUIPart | ReasoningUIPart | ToolUIPart<TOOLS> | DynamicToolUIPart | SourceUrlUIPart | SourceDocumentUIPart | FileUIPart | DataUIPart<DATA_TYPES> | StepStartUIPart;
|
|
1408
|
+
type UIMessagePart<DATA_TYPES extends UIDataTypes, TOOLS extends UITools> = TextUIPart | ReasoningUIPart | ToolUIPart<TOOLS> | DynamicToolUIPart | SourceUrlUIPart | SourceDocumentUIPart | FileUIPart | SourceExecutionFileUIPart | DataUIPart<DATA_TYPES> | StepStartUIPart;
|
|
1409
1409
|
/**
|
|
1410
1410
|
* A text part of a message.
|
|
1411
1411
|
*/
|
|
@@ -1452,6 +1452,11 @@ type SourceUrlUIPart = {
|
|
|
1452
1452
|
title?: string;
|
|
1453
1453
|
providerMetadata?: ProviderMetadata;
|
|
1454
1454
|
};
|
|
1455
|
+
type SourceExecutionFileUIPart = {
|
|
1456
|
+
type: 'source-execution-file';
|
|
1457
|
+
sourceId: string;
|
|
1458
|
+
providerMetadata?: ProviderMetadata;
|
|
1459
|
+
};
|
|
1455
1460
|
/**
|
|
1456
1461
|
* A document source part of a message.
|
|
1457
1462
|
*/
|
|
@@ -1683,6 +1688,10 @@ declare const uiMessageChunkSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
1683
1688
|
url: z.ZodString;
|
|
1684
1689
|
mediaType: z.ZodString;
|
|
1685
1690
|
providerMetadata: z.ZodOptional<z.ZodType<_zenning_provider.SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<_zenning_provider.SharedV3ProviderMetadata, unknown>>>;
|
|
1691
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1692
|
+
type: z.ZodLiteral<"source-execution-file">;
|
|
1693
|
+
sourceId: z.ZodString;
|
|
1694
|
+
providerMetadata: z.ZodOptional<z.ZodType<_zenning_provider.SharedV3ProviderMetadata, unknown, z.core.$ZodTypeInternals<_zenning_provider.SharedV3ProviderMetadata, unknown>>>;
|
|
1686
1695
|
}, z.core.$strict>, z.ZodObject<{
|
|
1687
1696
|
type: z.ZodCustom<`data-${string}`, `data-${string}`>;
|
|
1688
1697
|
id: z.ZodOptional<z.ZodString>;
|
|
@@ -1798,6 +1807,10 @@ type UIMessageChunk<METADATA = unknown, DATA_TYPES extends UIDataTypes = UIDataT
|
|
|
1798
1807
|
startIndex?: number;
|
|
1799
1808
|
endIndex?: number;
|
|
1800
1809
|
providerMetadata?: ProviderMetadata;
|
|
1810
|
+
} | {
|
|
1811
|
+
type: 'source-execution-file';
|
|
1812
|
+
sourceId: string;
|
|
1813
|
+
providerMetadata?: ProviderMetadata;
|
|
1801
1814
|
} | {
|
|
1802
1815
|
type: 'file';
|
|
1803
1816
|
url: string;
|
package/dist/index.js
CHANGED
|
@@ -802,7 +802,7 @@ function detectMediaType({
|
|
|
802
802
|
var import_provider_utils2 = require("@zenning/provider-utils");
|
|
803
803
|
|
|
804
804
|
// src/version.ts
|
|
805
|
-
var VERSION = true ? "5.
|
|
805
|
+
var VERSION = true ? "5.3.1" : "0.0.0-test";
|
|
806
806
|
|
|
807
807
|
// src/util/download/download.ts
|
|
808
808
|
var download = async ({ url }) => {
|
|
@@ -3064,6 +3064,11 @@ var uiMessageChunkSchema = import_v47.z.union([
|
|
|
3064
3064
|
mediaType: import_v47.z.string(),
|
|
3065
3065
|
providerMetadata: providerMetadataSchema.optional()
|
|
3066
3066
|
}),
|
|
3067
|
+
import_v47.z.strictObject({
|
|
3068
|
+
type: import_v47.z.literal("source-execution-file"),
|
|
3069
|
+
sourceId: import_v47.z.string(),
|
|
3070
|
+
providerMetadata: providerMetadataSchema.optional()
|
|
3071
|
+
}),
|
|
3067
3072
|
import_v47.z.strictObject({
|
|
3068
3073
|
type: import_v47.z.custom(
|
|
3069
3074
|
(value) => typeof value === "string" && value.startsWith("data-"),
|
|
@@ -3688,29 +3693,53 @@ function processUIMessageStream({
|
|
|
3688
3693
|
break;
|
|
3689
3694
|
}
|
|
3690
3695
|
case "source-url": {
|
|
3691
|
-
state.message.parts.
|
|
3692
|
-
type
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3696
|
+
const existingSource = state.message.parts.find(
|
|
3697
|
+
(part) => part.type === "source-url" && part.sourceId === chunk.sourceId
|
|
3698
|
+
);
|
|
3699
|
+
if (!existingSource) {
|
|
3700
|
+
state.message.parts.push({
|
|
3701
|
+
type: "source-url",
|
|
3702
|
+
sourceId: chunk.sourceId,
|
|
3703
|
+
url: chunk.url,
|
|
3704
|
+
title: chunk.title,
|
|
3705
|
+
providerMetadata: chunk.providerMetadata
|
|
3706
|
+
});
|
|
3707
|
+
write();
|
|
3708
|
+
}
|
|
3709
|
+
break;
|
|
3710
|
+
}
|
|
3711
|
+
case "source-execution-file": {
|
|
3712
|
+
const existingSource = state.message.parts.find(
|
|
3713
|
+
(part) => part.type === "source-execution-file" && part.sourceId === chunk.sourceId
|
|
3714
|
+
);
|
|
3715
|
+
if (!existingSource) {
|
|
3716
|
+
state.message.parts.push({
|
|
3717
|
+
type: "source-execution-file",
|
|
3718
|
+
sourceId: chunk.sourceId,
|
|
3719
|
+
providerMetadata: chunk.providerMetadata
|
|
3720
|
+
});
|
|
3721
|
+
write();
|
|
3722
|
+
}
|
|
3699
3723
|
break;
|
|
3700
3724
|
}
|
|
3701
3725
|
case "source-document": {
|
|
3702
|
-
state.message.parts.
|
|
3703
|
-
type
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3726
|
+
const existingSource = state.message.parts.find(
|
|
3727
|
+
(part) => part.type === "source-document" && part.sourceId === chunk.sourceId
|
|
3728
|
+
);
|
|
3729
|
+
if (!existingSource) {
|
|
3730
|
+
state.message.parts.push({
|
|
3731
|
+
type: "source-document",
|
|
3732
|
+
sourceId: chunk.sourceId,
|
|
3733
|
+
mediaType: chunk.mediaType,
|
|
3734
|
+
title: chunk.title,
|
|
3735
|
+
filename: chunk.filename,
|
|
3736
|
+
fileId: chunk.fileId,
|
|
3737
|
+
startIndex: chunk.startIndex,
|
|
3738
|
+
endIndex: chunk.endIndex,
|
|
3739
|
+
providerMetadata: chunk.providerMetadata
|
|
3740
|
+
});
|
|
3741
|
+
write();
|
|
3742
|
+
}
|
|
3714
3743
|
break;
|
|
3715
3744
|
}
|
|
3716
3745
|
case "tool-input-start": {
|
|
@@ -10224,6 +10253,11 @@ var dynamicToolUIPartSchemas = [
|
|
|
10224
10253
|
callProviderMetadata: providerMetadataSchema.optional()
|
|
10225
10254
|
})
|
|
10226
10255
|
];
|
|
10256
|
+
var sourceExecutionFileUIPartSchema = import_v410.z.object({
|
|
10257
|
+
type: import_v410.z.literal("source-execution-file"),
|
|
10258
|
+
sourceId: import_v410.z.string(),
|
|
10259
|
+
providerMetadata: providerMetadataSchema.optional()
|
|
10260
|
+
});
|
|
10227
10261
|
var toolUIPartSchemas = [
|
|
10228
10262
|
import_v410.z.object({
|
|
10229
10263
|
type: import_v410.z.string().startsWith("tool-"),
|
|
@@ -10278,6 +10312,7 @@ var uiMessageSchema = import_v410.z.object({
|
|
|
10278
10312
|
sourceDocumentUIPartSchema,
|
|
10279
10313
|
fileUIPartSchema,
|
|
10280
10314
|
stepStartUIPartSchema,
|
|
10315
|
+
sourceExecutionFileUIPartSchema,
|
|
10281
10316
|
dataUIPartSchema,
|
|
10282
10317
|
...dynamicToolUIPartSchemas,
|
|
10283
10318
|
...toolUIPartSchemas
|