ai 6.0.273 → 6.0.274
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.d.mts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -1
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/internal/index.mjs +1 -1
- package/docs/04-ai-sdk-ui/03-chatbot-tool-usage.mdx +7 -0
- package/docs/04-ai-sdk-ui/50-stream-protocol.mdx +18 -0
- package/docs/07-reference/01-ai-sdk-core/31-ui-message.mdx +31 -0
- package/package.json +1 -1
- package/src/ui/process-ui-message-stream.ts +3 -0
- package/src/ui/ui-messages.ts +10 -0
- package/src/ui/validate-ui-messages.ts +10 -0
- package/src/ui-message-stream/ui-message-chunks.ts +2 -0
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1756,6 +1756,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
1756
1756
|
approval: {
|
|
1757
1757
|
id: string;
|
|
1758
1758
|
approved?: never;
|
|
1759
|
+
descriptor?: unknown;
|
|
1759
1760
|
reason?: never;
|
|
1760
1761
|
signature?: string;
|
|
1761
1762
|
};
|
|
@@ -1768,6 +1769,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
1768
1769
|
approval: {
|
|
1769
1770
|
id: string;
|
|
1770
1771
|
approved: boolean;
|
|
1772
|
+
descriptor?: unknown;
|
|
1771
1773
|
reason?: string;
|
|
1772
1774
|
signature?: string;
|
|
1773
1775
|
};
|
|
@@ -1782,6 +1784,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
1782
1784
|
approval?: {
|
|
1783
1785
|
id: string;
|
|
1784
1786
|
approved: true;
|
|
1787
|
+
descriptor?: unknown;
|
|
1785
1788
|
reason?: string;
|
|
1786
1789
|
signature?: string;
|
|
1787
1790
|
};
|
|
@@ -1796,6 +1799,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
1796
1799
|
approval?: {
|
|
1797
1800
|
id: string;
|
|
1798
1801
|
approved: true;
|
|
1802
|
+
descriptor?: unknown;
|
|
1799
1803
|
reason?: string;
|
|
1800
1804
|
signature?: string;
|
|
1801
1805
|
};
|
|
@@ -1808,6 +1812,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
1808
1812
|
approval: {
|
|
1809
1813
|
id: string;
|
|
1810
1814
|
approved: false;
|
|
1815
|
+
descriptor?: unknown;
|
|
1811
1816
|
reason?: string;
|
|
1812
1817
|
signature?: string;
|
|
1813
1818
|
};
|
|
@@ -1856,6 +1861,7 @@ type DynamicToolUIPart = {
|
|
|
1856
1861
|
approval: {
|
|
1857
1862
|
id: string;
|
|
1858
1863
|
approved?: never;
|
|
1864
|
+
descriptor?: unknown;
|
|
1859
1865
|
reason?: never;
|
|
1860
1866
|
signature?: string;
|
|
1861
1867
|
};
|
|
@@ -1868,6 +1874,7 @@ type DynamicToolUIPart = {
|
|
|
1868
1874
|
approval: {
|
|
1869
1875
|
id: string;
|
|
1870
1876
|
approved: boolean;
|
|
1877
|
+
descriptor?: unknown;
|
|
1871
1878
|
reason?: string;
|
|
1872
1879
|
signature?: string;
|
|
1873
1880
|
};
|
|
@@ -1882,6 +1889,7 @@ type DynamicToolUIPart = {
|
|
|
1882
1889
|
approval?: {
|
|
1883
1890
|
id: string;
|
|
1884
1891
|
approved: true;
|
|
1892
|
+
descriptor?: unknown;
|
|
1885
1893
|
reason?: string;
|
|
1886
1894
|
signature?: string;
|
|
1887
1895
|
};
|
|
@@ -1895,6 +1903,7 @@ type DynamicToolUIPart = {
|
|
|
1895
1903
|
approval?: {
|
|
1896
1904
|
id: string;
|
|
1897
1905
|
approved: true;
|
|
1906
|
+
descriptor?: unknown;
|
|
1898
1907
|
reason?: string;
|
|
1899
1908
|
signature?: string;
|
|
1900
1909
|
};
|
|
@@ -1907,6 +1916,7 @@ type DynamicToolUIPart = {
|
|
|
1907
1916
|
approval: {
|
|
1908
1917
|
id: string;
|
|
1909
1918
|
approved: false;
|
|
1919
|
+
descriptor?: unknown;
|
|
1910
1920
|
reason?: string;
|
|
1911
1921
|
signature?: string;
|
|
1912
1922
|
};
|
|
@@ -2040,6 +2050,7 @@ type UIMessageChunk<METADATA = unknown, DATA_TYPES extends UIDataTypes = UIDataT
|
|
|
2040
2050
|
type: 'tool-approval-request';
|
|
2041
2051
|
approvalId: string;
|
|
2042
2052
|
toolCallId: string;
|
|
2053
|
+
approvalDescriptor?: unknown;
|
|
2043
2054
|
signature?: string;
|
|
2044
2055
|
} | {
|
|
2045
2056
|
type: 'tool-output-available';
|
package/dist/index.d.ts
CHANGED
|
@@ -1756,6 +1756,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
1756
1756
|
approval: {
|
|
1757
1757
|
id: string;
|
|
1758
1758
|
approved?: never;
|
|
1759
|
+
descriptor?: unknown;
|
|
1759
1760
|
reason?: never;
|
|
1760
1761
|
signature?: string;
|
|
1761
1762
|
};
|
|
@@ -1768,6 +1769,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
1768
1769
|
approval: {
|
|
1769
1770
|
id: string;
|
|
1770
1771
|
approved: boolean;
|
|
1772
|
+
descriptor?: unknown;
|
|
1771
1773
|
reason?: string;
|
|
1772
1774
|
signature?: string;
|
|
1773
1775
|
};
|
|
@@ -1782,6 +1784,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
1782
1784
|
approval?: {
|
|
1783
1785
|
id: string;
|
|
1784
1786
|
approved: true;
|
|
1787
|
+
descriptor?: unknown;
|
|
1785
1788
|
reason?: string;
|
|
1786
1789
|
signature?: string;
|
|
1787
1790
|
};
|
|
@@ -1796,6 +1799,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
1796
1799
|
approval?: {
|
|
1797
1800
|
id: string;
|
|
1798
1801
|
approved: true;
|
|
1802
|
+
descriptor?: unknown;
|
|
1799
1803
|
reason?: string;
|
|
1800
1804
|
signature?: string;
|
|
1801
1805
|
};
|
|
@@ -1808,6 +1812,7 @@ type UIToolInvocation<TOOL extends UITool | Tool> = {
|
|
|
1808
1812
|
approval: {
|
|
1809
1813
|
id: string;
|
|
1810
1814
|
approved: false;
|
|
1815
|
+
descriptor?: unknown;
|
|
1811
1816
|
reason?: string;
|
|
1812
1817
|
signature?: string;
|
|
1813
1818
|
};
|
|
@@ -1856,6 +1861,7 @@ type DynamicToolUIPart = {
|
|
|
1856
1861
|
approval: {
|
|
1857
1862
|
id: string;
|
|
1858
1863
|
approved?: never;
|
|
1864
|
+
descriptor?: unknown;
|
|
1859
1865
|
reason?: never;
|
|
1860
1866
|
signature?: string;
|
|
1861
1867
|
};
|
|
@@ -1868,6 +1874,7 @@ type DynamicToolUIPart = {
|
|
|
1868
1874
|
approval: {
|
|
1869
1875
|
id: string;
|
|
1870
1876
|
approved: boolean;
|
|
1877
|
+
descriptor?: unknown;
|
|
1871
1878
|
reason?: string;
|
|
1872
1879
|
signature?: string;
|
|
1873
1880
|
};
|
|
@@ -1882,6 +1889,7 @@ type DynamicToolUIPart = {
|
|
|
1882
1889
|
approval?: {
|
|
1883
1890
|
id: string;
|
|
1884
1891
|
approved: true;
|
|
1892
|
+
descriptor?: unknown;
|
|
1885
1893
|
reason?: string;
|
|
1886
1894
|
signature?: string;
|
|
1887
1895
|
};
|
|
@@ -1895,6 +1903,7 @@ type DynamicToolUIPart = {
|
|
|
1895
1903
|
approval?: {
|
|
1896
1904
|
id: string;
|
|
1897
1905
|
approved: true;
|
|
1906
|
+
descriptor?: unknown;
|
|
1898
1907
|
reason?: string;
|
|
1899
1908
|
signature?: string;
|
|
1900
1909
|
};
|
|
@@ -1907,6 +1916,7 @@ type DynamicToolUIPart = {
|
|
|
1907
1916
|
approval: {
|
|
1908
1917
|
id: string;
|
|
1909
1918
|
approved: false;
|
|
1919
|
+
descriptor?: unknown;
|
|
1910
1920
|
reason?: string;
|
|
1911
1921
|
signature?: string;
|
|
1912
1922
|
};
|
|
@@ -2040,6 +2050,7 @@ type UIMessageChunk<METADATA = unknown, DATA_TYPES extends UIDataTypes = UIDataT
|
|
|
2040
2050
|
type: 'tool-approval-request';
|
|
2041
2051
|
approvalId: string;
|
|
2042
2052
|
toolCallId: string;
|
|
2053
|
+
approvalDescriptor?: unknown;
|
|
2043
2054
|
signature?: string;
|
|
2044
2055
|
} | {
|
|
2045
2056
|
type: 'tool-output-available';
|
package/dist/index.js
CHANGED
|
@@ -1334,7 +1334,7 @@ function detectMediaType({
|
|
|
1334
1334
|
var import_provider_utils3 = require("@ai-sdk/provider-utils");
|
|
1335
1335
|
|
|
1336
1336
|
// src/version.ts
|
|
1337
|
-
var VERSION = true ? "6.0.
|
|
1337
|
+
var VERSION = true ? "6.0.274" : "0.0.0-test";
|
|
1338
1338
|
|
|
1339
1339
|
// src/util/download/download.ts
|
|
1340
1340
|
var download = async ({
|
|
@@ -5734,6 +5734,7 @@ var uiMessageChunkSchema = (0, import_provider_utils17.lazySchema)(
|
|
|
5734
5734
|
type: import_v47.z.literal("tool-approval-request"),
|
|
5735
5735
|
approvalId: import_v47.z.string(),
|
|
5736
5736
|
toolCallId: import_v47.z.string(),
|
|
5737
|
+
approvalDescriptor: import_v47.z.unknown().optional(),
|
|
5737
5738
|
signature: import_v47.z.string().optional()
|
|
5738
5739
|
}),
|
|
5739
5740
|
import_v47.z.looseObject({
|
|
@@ -6313,6 +6314,7 @@ function processUIMessageStream({
|
|
|
6313
6314
|
toolInvocation.state = "approval-requested";
|
|
6314
6315
|
toolInvocation.approval = {
|
|
6315
6316
|
id: chunk.approvalId,
|
|
6317
|
+
...chunk.approvalDescriptor != null ? { descriptor: chunk.approvalDescriptor } : {},
|
|
6316
6318
|
...chunk.signature != null ? { signature: chunk.signature } : {}
|
|
6317
6319
|
};
|
|
6318
6320
|
write();
|
|
@@ -9791,6 +9793,7 @@ var uiMessagesSchema = (0, import_provider_utils24.lazySchema)(
|
|
|
9791
9793
|
approval: import_v48.z.object({
|
|
9792
9794
|
id: import_v48.z.string(),
|
|
9793
9795
|
approved: import_v48.z.never().optional(),
|
|
9796
|
+
descriptor: import_v48.z.unknown().optional(),
|
|
9794
9797
|
reason: import_v48.z.never().optional(),
|
|
9795
9798
|
signature: import_v48.z.string().optional()
|
|
9796
9799
|
})
|
|
@@ -9809,6 +9812,7 @@ var uiMessagesSchema = (0, import_provider_utils24.lazySchema)(
|
|
|
9809
9812
|
approval: import_v48.z.object({
|
|
9810
9813
|
id: import_v48.z.string(),
|
|
9811
9814
|
approved: import_v48.z.boolean(),
|
|
9815
|
+
descriptor: import_v48.z.unknown().optional(),
|
|
9812
9816
|
reason: import_v48.z.string().optional(),
|
|
9813
9817
|
signature: import_v48.z.string().optional()
|
|
9814
9818
|
})
|
|
@@ -9829,6 +9833,7 @@ var uiMessagesSchema = (0, import_provider_utils24.lazySchema)(
|
|
|
9829
9833
|
approval: import_v48.z.object({
|
|
9830
9834
|
id: import_v48.z.string(),
|
|
9831
9835
|
approved: import_v48.z.literal(true),
|
|
9836
|
+
descriptor: import_v48.z.unknown().optional(),
|
|
9832
9837
|
reason: import_v48.z.string().optional(),
|
|
9833
9838
|
signature: import_v48.z.string().optional()
|
|
9834
9839
|
}).optional()
|
|
@@ -9849,6 +9854,7 @@ var uiMessagesSchema = (0, import_provider_utils24.lazySchema)(
|
|
|
9849
9854
|
approval: import_v48.z.object({
|
|
9850
9855
|
id: import_v48.z.string(),
|
|
9851
9856
|
approved: import_v48.z.literal(true),
|
|
9857
|
+
descriptor: import_v48.z.unknown().optional(),
|
|
9852
9858
|
reason: import_v48.z.string().optional(),
|
|
9853
9859
|
signature: import_v48.z.string().optional()
|
|
9854
9860
|
}).optional()
|
|
@@ -9867,6 +9873,7 @@ var uiMessagesSchema = (0, import_provider_utils24.lazySchema)(
|
|
|
9867
9873
|
approval: import_v48.z.object({
|
|
9868
9874
|
id: import_v48.z.string(),
|
|
9869
9875
|
approved: import_v48.z.literal(false),
|
|
9876
|
+
descriptor: import_v48.z.unknown().optional(),
|
|
9870
9877
|
reason: import_v48.z.string().optional(),
|
|
9871
9878
|
signature: import_v48.z.string().optional()
|
|
9872
9879
|
})
|
|
@@ -9908,6 +9915,7 @@ var uiMessagesSchema = (0, import_provider_utils24.lazySchema)(
|
|
|
9908
9915
|
approval: import_v48.z.object({
|
|
9909
9916
|
id: import_v48.z.string(),
|
|
9910
9917
|
approved: import_v48.z.never().optional(),
|
|
9918
|
+
descriptor: import_v48.z.unknown().optional(),
|
|
9911
9919
|
reason: import_v48.z.never().optional(),
|
|
9912
9920
|
signature: import_v48.z.string().optional()
|
|
9913
9921
|
})
|
|
@@ -9925,6 +9933,7 @@ var uiMessagesSchema = (0, import_provider_utils24.lazySchema)(
|
|
|
9925
9933
|
approval: import_v48.z.object({
|
|
9926
9934
|
id: import_v48.z.string(),
|
|
9927
9935
|
approved: import_v48.z.boolean(),
|
|
9936
|
+
descriptor: import_v48.z.unknown().optional(),
|
|
9928
9937
|
reason: import_v48.z.string().optional(),
|
|
9929
9938
|
signature: import_v48.z.string().optional()
|
|
9930
9939
|
})
|
|
@@ -9944,6 +9953,7 @@ var uiMessagesSchema = (0, import_provider_utils24.lazySchema)(
|
|
|
9944
9953
|
approval: import_v48.z.object({
|
|
9945
9954
|
id: import_v48.z.string(),
|
|
9946
9955
|
approved: import_v48.z.literal(true),
|
|
9956
|
+
descriptor: import_v48.z.unknown().optional(),
|
|
9947
9957
|
reason: import_v48.z.string().optional(),
|
|
9948
9958
|
signature: import_v48.z.string().optional()
|
|
9949
9959
|
}).optional()
|
|
@@ -9963,6 +9973,7 @@ var uiMessagesSchema = (0, import_provider_utils24.lazySchema)(
|
|
|
9963
9973
|
approval: import_v48.z.object({
|
|
9964
9974
|
id: import_v48.z.string(),
|
|
9965
9975
|
approved: import_v48.z.literal(true),
|
|
9976
|
+
descriptor: import_v48.z.unknown().optional(),
|
|
9966
9977
|
reason: import_v48.z.string().optional(),
|
|
9967
9978
|
signature: import_v48.z.string().optional()
|
|
9968
9979
|
}).optional()
|
|
@@ -9980,6 +9991,7 @@ var uiMessagesSchema = (0, import_provider_utils24.lazySchema)(
|
|
|
9980
9991
|
approval: import_v48.z.object({
|
|
9981
9992
|
id: import_v48.z.string(),
|
|
9982
9993
|
approved: import_v48.z.literal(false),
|
|
9994
|
+
descriptor: import_v48.z.unknown().optional(),
|
|
9983
9995
|
reason: import_v48.z.string().optional(),
|
|
9984
9996
|
signature: import_v48.z.string().optional()
|
|
9985
9997
|
})
|