@assistant-ui/react 0.5.21 → 0.5.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. package/dist/{AssistantTypes-D93BmqD5.d.mts → AssistantTypes-BNB-knVq.d.mts} +1 -1
  2. package/dist/{AssistantTypes-D93BmqD5.d.ts → AssistantTypes-BNB-knVq.d.ts} +1 -1
  3. package/dist/chunk-DCHYNTHI.js +11 -0
  4. package/dist/chunk-DCHYNTHI.js.map +1 -0
  5. package/dist/chunk-NSPHKRLF.js +819 -0
  6. package/dist/chunk-NSPHKRLF.js.map +1 -0
  7. package/dist/{chunk-2RKUKZSZ.mjs → chunk-ZWRFAYHH.mjs} +61 -3
  8. package/dist/chunk-ZWRFAYHH.mjs.map +1 -0
  9. package/dist/edge.d.mts +90 -5
  10. package/dist/edge.d.ts +90 -5
  11. package/dist/edge.js +0 -1
  12. package/dist/edge.js.map +1 -1
  13. package/dist/edge.mjs +799 -49
  14. package/dist/edge.mjs.map +1 -1
  15. package/dist/index.d.mts +153 -7
  16. package/dist/index.d.ts +153 -7
  17. package/dist/index.js +724 -1596
  18. package/dist/index.js.map +1 -1
  19. package/dist/index.mjs +807 -252
  20. package/dist/index.mjs.map +1 -1
  21. package/dist/tailwindcss/index.js +24 -53
  22. package/dist/tailwindcss/index.js.map +1 -1
  23. package/package.json +1 -12
  24. package/dist/Thread-BbLf1cc4.d.mts +0 -156
  25. package/dist/Thread-jfAlPLli.d.ts +0 -156
  26. package/dist/chunk-2RKUKZSZ.mjs.map +0 -1
  27. package/dist/chunk-QBS6JLLN.mjs +0 -63
  28. package/dist/chunk-QBS6JLLN.mjs.map +0 -1
  29. package/dist/chunk-V66MVXBH.mjs +0 -608
  30. package/dist/chunk-V66MVXBH.mjs.map +0 -1
  31. package/dist/internal.d.mts +0 -9
  32. package/dist/internal.d.ts +0 -9
  33. package/dist/internal.js +0 -620
  34. package/dist/internal.js.map +0 -1
  35. package/dist/internal.mjs +0 -24
  36. package/dist/internal.mjs.map +0 -1
  37. package/internal/README.md +0 -1
  38. package/internal/package.json +0 -5
@@ -1,41 +1,9 @@
1
- "use client";
2
- "use strict";
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __export = (target, all) => {
10
- for (var name in all)
11
- __defProp(target, name, { get: all[name], enumerable: true });
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(to, key) && key !== except)
17
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
- }
19
- return to;
20
- };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
2
+ require('../chunk-DCHYNTHI.js');
30
3
 
31
4
  // src/tailwindcss/index.ts
32
- var tailwindcss_exports = {};
33
- __export(tailwindcss_exports, {
34
- default: () => tailwindcss_default
35
- });
36
- module.exports = __toCommonJS(tailwindcss_exports);
37
- var import_plugin = __toESM(require("tailwindcss/plugin"));
38
- var auiPlugin = import_plugin.default.withOptions(
5
+ var _plugin = require('tailwindcss/plugin'); var _plugin2 = _interopRequireDefault(_plugin);
6
+ var auiPlugin = _plugin2.default.withOptions(
39
7
  ({ components = ["assistant-modal", "thread"], shadcn = false } = {}) => ({ addComponents }) => {
40
8
  const assistantModal = components.includes("assistant-modal");
41
9
  const thread = assistantModal || components.includes("thread");
@@ -71,38 +39,38 @@ var auiPlugin = import_plugin.default.withOptions(
71
39
  extend: {
72
40
  colors: {
73
41
  aui: {
74
- border: colors.border ?? `hsl(var(${prefix}border))`,
75
- input: colors.input ?? `hsl(var(${prefix}input))`,
76
- ring: colors.ring ?? `hsl(var(${prefix}ring))`,
77
- background: colors.background ?? `hsl(var(${prefix}background))`,
78
- foreground: colors.foreground ?? `hsl(var(${prefix}foreground))`,
42
+ border: _nullishCoalesce(colors.border, () => ( `hsl(var(${prefix}border))`)),
43
+ input: _nullishCoalesce(colors.input, () => ( `hsl(var(${prefix}input))`)),
44
+ ring: _nullishCoalesce(colors.ring, () => ( `hsl(var(${prefix}ring))`)),
45
+ background: _nullishCoalesce(colors.background, () => ( `hsl(var(${prefix}background))`)),
46
+ foreground: _nullishCoalesce(colors.foreground, () => ( `hsl(var(${prefix}foreground))`)),
79
47
  primary: {
80
- DEFAULT: colors.primary?.DEFAULT ?? `hsl(var(${prefix}primary))`,
81
- foreground: colors.primary?.foreground ?? `hsl(var(${prefix}primary-foreground))`
48
+ DEFAULT: _nullishCoalesce(_optionalChain([colors, 'access', _ => _.primary, 'optionalAccess', _2 => _2.DEFAULT]), () => ( `hsl(var(${prefix}primary))`)),
49
+ foreground: _nullishCoalesce(_optionalChain([colors, 'access', _3 => _3.primary, 'optionalAccess', _4 => _4.foreground]), () => ( `hsl(var(${prefix}primary-foreground))`))
82
50
  },
83
51
  secondary: {
84
- DEFAULT: colors.secondary?.DEFAULT ?? `hsl(var(${prefix}secondary))`,
85
- foreground: colors.secondary?.foreground ?? `hsl(var(${prefix}secondary-foreground))`
52
+ DEFAULT: _nullishCoalesce(_optionalChain([colors, 'access', _5 => _5.secondary, 'optionalAccess', _6 => _6.DEFAULT]), () => ( `hsl(var(${prefix}secondary))`)),
53
+ foreground: _nullishCoalesce(_optionalChain([colors, 'access', _7 => _7.secondary, 'optionalAccess', _8 => _8.foreground]), () => ( `hsl(var(${prefix}secondary-foreground))`))
86
54
  },
87
55
  destructive: {
88
- DEFAULT: colors.destructive?.DEFAULT ?? `hsl(var(${prefix}destructive))`,
56
+ DEFAULT: _nullishCoalesce(_optionalChain([colors, 'access', _9 => _9.destructive, 'optionalAccess', _10 => _10.DEFAULT]), () => ( `hsl(var(${prefix}destructive))`)),
89
57
  foreground: `hsl(var(${prefix}destructive-foreground))`
90
58
  },
91
59
  muted: {
92
60
  DEFAULT: `hsl(var(${prefix}muted))`,
93
- foreground: colors.muted?.foreground ?? `hsl(var(${prefix}muted-foreground))`
61
+ foreground: _nullishCoalesce(_optionalChain([colors, 'access', _11 => _11.muted, 'optionalAccess', _12 => _12.foreground]), () => ( `hsl(var(${prefix}muted-foreground))`))
94
62
  },
95
63
  accent: {
96
- DEFAULT: colors.accent?.DEFAULT ?? `hsl(var(${prefix}accent))`,
97
- foreground: colors.accent?.foreground ?? `hsl(var(${prefix}accent-foreground))`
64
+ DEFAULT: _nullishCoalesce(_optionalChain([colors, 'access', _13 => _13.accent, 'optionalAccess', _14 => _14.DEFAULT]), () => ( `hsl(var(${prefix}accent))`)),
65
+ foreground: _nullishCoalesce(_optionalChain([colors, 'access', _15 => _15.accent, 'optionalAccess', _16 => _16.foreground]), () => ( `hsl(var(${prefix}accent-foreground))`))
98
66
  },
99
67
  popover: {
100
- DEFAULT: colors.popover?.DEFAULT ?? `hsl(var(${prefix}popover))`,
101
- foreground: colors.popover?.foreground ?? `hsl(var(${prefix}popover-foreground))`
68
+ DEFAULT: _nullishCoalesce(_optionalChain([colors, 'access', _17 => _17.popover, 'optionalAccess', _18 => _18.DEFAULT]), () => ( `hsl(var(${prefix}popover))`)),
69
+ foreground: _nullishCoalesce(_optionalChain([colors, 'access', _19 => _19.popover, 'optionalAccess', _20 => _20.foreground]), () => ( `hsl(var(${prefix}popover-foreground))`))
102
70
  },
103
71
  card: {
104
- DEFAULT: colors.card?.DEFAULT ?? `hsl(var(${prefix}card))`,
105
- foreground: colors.card?.foreground ?? `hsl(var(${prefix}card-foreground))`
72
+ DEFAULT: _nullishCoalesce(_optionalChain([colors, 'access', _21 => _21.card, 'optionalAccess', _22 => _22.DEFAULT]), () => ( `hsl(var(${prefix}card))`)),
73
+ foreground: _nullishCoalesce(_optionalChain([colors, 'access', _23 => _23.card, 'optionalAccess', _24 => _24.foreground]), () => ( `hsl(var(${prefix}card-foreground))`))
106
74
  }
107
75
  }
108
76
  }
@@ -112,4 +80,7 @@ var auiPlugin = import_plugin.default.withOptions(
112
80
  }
113
81
  );
114
82
  var tailwindcss_default = auiPlugin;
83
+
84
+
85
+ exports.default = tailwindcss_default;
115
86
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/tailwindcss/index.ts"],"sourcesContent":["import plugin from \"tailwindcss/plugin\";\n\ntype AssistantTailwindPluginColors = {\n border: string;\n input: string;\n ring: string;\n background: string;\n foreground: string;\n primary: {\n DEFAULT: string;\n foreground: string;\n };\n secondary: {\n DEFAULT: string;\n foreground: string;\n };\n destructive: {\n DEFAULT: string;\n foreground: string;\n };\n muted: {\n DEFAULT: string;\n foreground: string;\n };\n accent: {\n DEFAULT: string;\n foreground: string;\n };\n popover: {\n DEFAULT: string;\n foreground: string;\n };\n card: {\n DEFAULT: string;\n foreground: string;\n };\n};\n\ntype AssisstantTailwindPluginOptions = {\n components?: (\"default-theme\" | \"base\" | \"thread\" | \"assistant-modal\")[];\n colors?: AssistantTailwindPluginColors;\n shadcn?: boolean;\n};\n\nconst auiPlugin = plugin.withOptions<AssisstantTailwindPluginOptions>(\n ({ components = [\"assistant-modal\", \"thread\"], shadcn = false } = {}) =>\n ({ addComponents }) => {\n const assistantModal = components.includes(\"assistant-modal\");\n const thread = assistantModal || components.includes(\"thread\");\n const base = thread || components.includes(\"base\");\n const defaultTheme = components.includes(\"default-theme\");\n\n if (defaultTheme && shadcn)\n throw new Error(\"default-theme cannot be used with shadcn\");\n\n if (defaultTheme || (base && !shadcn)) {\n addComponents({\n '@import \"@assistant-ui/react/styles/themes/default.css\"': \"\",\n });\n }\n\n if (base) {\n addComponents({\n '@import \"@assistant-ui/react/styles/tailwindcss/base-components.css\"':\n \"\",\n });\n }\n\n if (thread) {\n addComponents({\n '@import \"@assistant-ui/react/styles/tailwindcss/thread.css\"': \"\",\n });\n }\n\n if (assistantModal) {\n addComponents({\n '@import \"@assistant-ui/react/styles/tailwindcss/modal.css\"': \"\",\n });\n }\n },\n ({ shadcn = false, colors = {} } = {}) => {\n const prefix = !shadcn ? \"--aui-\" : \"--\";\n return {\n theme: {\n extend: {\n colors: {\n aui: {\n border: colors.border ?? `hsl(var(${prefix}border))`,\n input: colors.input ?? `hsl(var(${prefix}input))`,\n ring: colors.ring ?? `hsl(var(${prefix}ring))`,\n background: colors.background ?? `hsl(var(${prefix}background))`,\n foreground: colors.foreground ?? `hsl(var(${prefix}foreground))`,\n primary: {\n DEFAULT:\n colors.primary?.DEFAULT ?? `hsl(var(${prefix}primary))`,\n foreground:\n colors.primary?.foreground ??\n `hsl(var(${prefix}primary-foreground))`,\n },\n secondary: {\n DEFAULT:\n colors.secondary?.DEFAULT ?? `hsl(var(${prefix}secondary))`,\n foreground:\n colors.secondary?.foreground ??\n `hsl(var(${prefix}secondary-foreground))`,\n },\n destructive: {\n DEFAULT:\n colors.destructive?.DEFAULT ??\n `hsl(var(${prefix}destructive))`,\n foreground: `hsl(var(${prefix}destructive-foreground))`,\n },\n muted: {\n DEFAULT: `hsl(var(${prefix}muted))`,\n foreground:\n colors.muted?.foreground ??\n `hsl(var(${prefix}muted-foreground))`,\n },\n accent: {\n DEFAULT: colors.accent?.DEFAULT ?? `hsl(var(${prefix}accent))`,\n foreground:\n colors.accent?.foreground ??\n `hsl(var(${prefix}accent-foreground))`,\n },\n popover: {\n DEFAULT:\n colors.popover?.DEFAULT ?? `hsl(var(${prefix}popover))`,\n foreground:\n colors.popover?.foreground ??\n `hsl(var(${prefix}popover-foreground))`,\n },\n card: {\n DEFAULT: colors.card?.DEFAULT ?? `hsl(var(${prefix}card))`,\n foreground:\n colors.card?.foreground ??\n `hsl(var(${prefix}card-foreground))`,\n },\n },\n },\n },\n },\n };\n },\n);\n\nexport default auiPlugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAmB;AA4CnB,IAAM,YAAY,cAAAA,QAAO;AAAA,EACvB,CAAC,EAAE,aAAa,CAAC,mBAAmB,QAAQ,GAAG,SAAS,MAAM,IAAI,CAAC,MACjE,CAAC,EAAE,cAAc,MAAM;AACrB,UAAM,iBAAiB,WAAW,SAAS,iBAAiB;AAC5D,UAAM,SAAS,kBAAkB,WAAW,SAAS,QAAQ;AAC7D,UAAM,OAAO,UAAU,WAAW,SAAS,MAAM;AACjD,UAAM,eAAe,WAAW,SAAS,eAAe;AAExD,QAAI,gBAAgB;AAClB,YAAM,IAAI,MAAM,0CAA0C;AAE5D,QAAI,gBAAiB,QAAQ,CAAC,QAAS;AACrC,oBAAc;AAAA,QACZ,2DAA2D;AAAA,MAC7D,CAAC;AAAA,IACH;AAEA,QAAI,MAAM;AACR,oBAAc;AAAA,QACZ,wEACE;AAAA,MACJ,CAAC;AAAA,IACH;AAEA,QAAI,QAAQ;AACV,oBAAc;AAA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ChB,WAAW,MAAM;AAAA,cACrB;AAAA,cACA,MAAM;AAAA,gBACJ,SAAS,OAAO,MAAM,WAAW,WAAW,MAAM;AAAA,gBAClD,YACE,OAAO,MAAM,cACb,WAAW,MAAM;AAAA,cACrB;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEA,IAAO,sBAAQ;","names":["plugin"]}
1
+ {"version":3,"sources":["/home/runner/work/assistant-ui/assistant-ui/packages/react/dist/tailwindcss/index.js","../../src/tailwindcss/index.ts"],"names":[],"mappings":"AAAA,6xBAAY;AACZ,gCAA6B;AAC7B;AACA;ACHA,4FAAmB;AA4CnB,IAAM,UAAA,EAAY,gBAAA,CAAO,WAAA;AAAA,EACvB,CAAC,EAAE,WAAA,EAAa,CAAC,iBAAA,EAAmB,QAAQ,CAAA,EAAG,OAAA,EAAS,MAAM,EAAA,EAAI,CAAC,CAAA,EAAA,GACjE,CAAC,EAAE,cAAc,CAAA,EAAA,GAAM;AACrB,IAAA,MAAM,eAAA,EAAiB,UAAA,CAAW,QAAA,CAAS,iBAAiB,CAAA;AAC5D,IAAA,MAAM,OAAA,EAAS,eAAA,GAAkB,UAAA,CAAW,QAAA,CAAS,QAAQ,CAAA;AAC7D,IAAA,MAAM,KAAA,EAAO,OAAA,GAAU,UAAA,CAAW,QAAA,CAAS,MAAM,CAAA;AACjD,IAAA,MAAM,aAAA,EAAe,UAAA,CAAW,QAAA,CAAS,eAAe,CAAA;AAExD,IAAA,GAAA,CAAI,aAAA,GAAgB,MAAA;AAClB,MAAA,MAAM,IAAI,KAAA,CAAM,0CAA0C,CAAA;AAE5D,IAAA,GAAA,CAAI,aAAA,GAAiB,KAAA,GAAQ,CAAC,MAAA,EAAS;AACrC,MAAA,aAAA,CAAc;AAAA,QACZ,yDAAA,EAA2D;AAAA,MAC7D,CAAC,CAAA;AAAA,IACH;AAEA,IAAA,GAAA,CAAI,IAAA,EAAM;AACR,MAAA,aAAA,CAAc;A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ACrB,CAAA;AAAA,cACA,IAAA,EAAM;AAAA,gBACJ,OAAA,mCAAS,MAAA,uBAAO,IAAA,+BAAM,SAAA,UAAW,CAAA,QAAA,EAAW,MAAM,CAAA,MAAA,GAAA;AAAA,gBAClD,UAAA,mCACE,MAAA,uBAAO,IAAA,+BAAM,YAAA,UACb,CAAA,QAAA,EAAW,MAAM,CAAA,iBAAA;AAAA,cACrB;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF,CAAA;AAAA,EACF;AACF,CAAA;AAEA,IAAO,oBAAA,EAAQ,SAAA;AD/Df;AACE;AACF,sCAAC","file":"/home/runner/work/assistant-ui/assistant-ui/packages/react/dist/tailwindcss/index.js","sourcesContent":[null,"import plugin from \"tailwindcss/plugin\";\n\ntype AssistantTailwindPluginColors = {\n border: string;\n input: string;\n ring: string;\n background: string;\n foreground: string;\n primary: {\n DEFAULT: string;\n foreground: string;\n };\n secondary: {\n DEFAULT: string;\n foreground: string;\n };\n destructive: {\n DEFAULT: string;\n foreground: string;\n };\n muted: {\n DEFAULT: string;\n foreground: string;\n };\n accent: {\n DEFAULT: string;\n foreground: string;\n };\n popover: {\n DEFAULT: string;\n foreground: string;\n };\n card: {\n DEFAULT: string;\n foreground: string;\n };\n};\n\ntype AssisstantTailwindPluginOptions = {\n components?: (\"default-theme\" | \"base\" | \"thread\" | \"assistant-modal\")[];\n colors?: AssistantTailwindPluginColors;\n shadcn?: boolean;\n};\n\nconst auiPlugin = plugin.withOptions<AssisstantTailwindPluginOptions>(\n ({ components = [\"assistant-modal\", \"thread\"], shadcn = false } = {}) =>\n ({ addComponents }) => {\n const assistantModal = components.includes(\"assistant-modal\");\n const thread = assistantModal || components.includes(\"thread\");\n const base = thread || components.includes(\"base\");\n const defaultTheme = components.includes(\"default-theme\");\n\n if (defaultTheme && shadcn)\n throw new Error(\"default-theme cannot be used with shadcn\");\n\n if (defaultTheme || (base && !shadcn)) {\n addComponents({\n '@import \"@assistant-ui/react/styles/themes/default.css\"': \"\",\n });\n }\n\n if (base) {\n addComponents({\n '@import \"@assistant-ui/react/styles/tailwindcss/base-components.css\"':\n \"\",\n });\n }\n\n if (thread) {\n addComponents({\n '@import \"@assistant-ui/react/styles/tailwindcss/thread.css\"': \"\",\n });\n }\n\n if (assistantModal) {\n addComponents({\n '@import \"@assistant-ui/react/styles/tailwindcss/modal.css\"': \"\",\n });\n }\n },\n ({ shadcn = false, colors = {} } = {}) => {\n const prefix = !shadcn ? \"--aui-\" : \"--\";\n return {\n theme: {\n extend: {\n colors: {\n aui: {\n border: colors.border ?? `hsl(var(${prefix}border))`,\n input: colors.input ?? `hsl(var(${prefix}input))`,\n ring: colors.ring ?? `hsl(var(${prefix}ring))`,\n background: colors.background ?? `hsl(var(${prefix}background))`,\n foreground: colors.foreground ?? `hsl(var(${prefix}foreground))`,\n primary: {\n DEFAULT:\n colors.primary?.DEFAULT ?? `hsl(var(${prefix}primary))`,\n foreground:\n colors.primary?.foreground ??\n `hsl(var(${prefix}primary-foreground))`,\n },\n secondary: {\n DEFAULT:\n colors.secondary?.DEFAULT ?? `hsl(var(${prefix}secondary))`,\n foreground:\n colors.secondary?.foreground ??\n `hsl(var(${prefix}secondary-foreground))`,\n },\n destructive: {\n DEFAULT:\n colors.destructive?.DEFAULT ??\n `hsl(var(${prefix}destructive))`,\n foreground: `hsl(var(${prefix}destructive-foreground))`,\n },\n muted: {\n DEFAULT: `hsl(var(${prefix}muted))`,\n foreground:\n colors.muted?.foreground ??\n `hsl(var(${prefix}muted-foreground))`,\n },\n accent: {\n DEFAULT: colors.accent?.DEFAULT ?? `hsl(var(${prefix}accent))`,\n foreground:\n colors.accent?.foreground ??\n `hsl(var(${prefix}accent-foreground))`,\n },\n popover: {\n DEFAULT:\n colors.popover?.DEFAULT ?? `hsl(var(${prefix}popover))`,\n foreground:\n colors.popover?.foreground ??\n `hsl(var(${prefix}popover-foreground))`,\n },\n card: {\n DEFAULT: colors.card?.DEFAULT ?? `hsl(var(${prefix}card))`,\n foreground:\n colors.card?.foreground ??\n `hsl(var(${prefix}card-foreground))`,\n },\n },\n },\n },\n },\n };\n },\n);\n\nexport default auiPlugin;\n"]}
package/package.json CHANGED
@@ -29,7 +29,7 @@
29
29
  "conversational-ui",
30
30
  "conversational-ai"
31
31
  ],
32
- "version": "0.5.21",
32
+ "version": "0.5.22",
33
33
  "license": "MIT",
34
34
  "exports": {
35
35
  ".": {
@@ -52,16 +52,6 @@
52
52
  "default": "./dist/edge.js"
53
53
  }
54
54
  },
55
- "./internal": {
56
- "import": {
57
- "types": "./dist/internal.d.mts",
58
- "default": "./dist/internal.mjs"
59
- },
60
- "require": {
61
- "types": "./dist/internal.d.ts",
62
- "default": "./dist/internal.js"
63
- }
64
- },
65
55
  "./tailwindcss": {
66
56
  "import": {
67
57
  "types": "./dist/tailwindcss/index.d.mts",
@@ -83,7 +73,6 @@
83
73
  "files": [
84
74
  "dist",
85
75
  "edge",
86
- "internal",
87
76
  "tailwindcss",
88
77
  "README.md"
89
78
  ],
@@ -1,156 +0,0 @@
1
- import { h as ModelConfigProvider, c as ModelConfig, b as ThreadMessage, g as CoreMessage, C as ContentPartStatus, f as ToolCallContentPartStatus, d as TextContentPart, I as ImageContentPart, U as UIContentPart, e as ToolCallContentPart, A as AppendMessage } from './AssistantTypes-D93BmqD5.mjs';
2
- import * as react from 'react';
3
- import { ComponentType } from 'react';
4
- import * as class_variance_authority from 'class-variance-authority';
5
- import { VariantProps } from 'class-variance-authority';
6
- import * as class_variance_authority_types from 'class-variance-authority/types';
7
- import { Primitive } from '@radix-ui/react-primitive';
8
-
9
- type Unsubscribe = () => void;
10
-
11
- type ReactThreadRuntime = ThreadRuntime & {
12
- unstable_synchronizer?: ComponentType;
13
- };
14
-
15
- declare abstract class BaseAssistantRuntime<TThreadRuntime extends ReactThreadRuntime> implements AssistantRuntime {
16
- private _thread;
17
- constructor(_thread: TThreadRuntime);
18
- get thread(): TThreadRuntime;
19
- set thread(thread: TThreadRuntime);
20
- abstract registerModelConfigProvider(provider: ModelConfigProvider): Unsubscribe;
21
- abstract switchToThread(threadId: string | null): void;
22
- private _subscriptions;
23
- subscribe(callback: () => void): Unsubscribe;
24
- private subscriptionHandler;
25
- }
26
-
27
- declare class ProxyConfigProvider implements ModelConfigProvider {
28
- private _providers;
29
- getModelConfig(): ModelConfig;
30
- registerModelConfigProvider(provider: ModelConfigProvider): () => void;
31
- }
32
-
33
- declare class MessageRepository {
34
- private messages;
35
- private head;
36
- private root;
37
- private performOp;
38
- getMessages(): ThreadMessage[];
39
- addOrUpdateMessage(parentId: string | null, message: ThreadMessage): void;
40
- getMessage(messageId: string): {
41
- parentId: string | null;
42
- message: ThreadMessage;
43
- };
44
- appendOptimisticMessage(parentId: string | null, message: CoreMessage): string;
45
- deleteMessage(messageId: string, replacementId?: string | null | undefined): void;
46
- getBranches(messageId: string): string[];
47
- switchToBranch(messageId: string): void;
48
- resetHead(messageId: string | null): void;
49
- }
50
-
51
- type TextContentPartState = Readonly<{
52
- status: ContentPartStatus;
53
- part: TextContentPart;
54
- }>;
55
- type ContentPartState = Readonly<{
56
- status: ContentPartStatus | ToolCallContentPartStatus;
57
- part: TextContentPart | ImageContentPart | UIContentPart | ToolCallContentPart;
58
- }>;
59
-
60
- declare const useSmooth: (state: TextContentPartState, smooth?: boolean) => TextContentPartState;
61
-
62
- declare const withSmoothContextProvider: <C extends React.ComponentType<any>>(Component: C) => C;
63
- declare const useSmoothStatus: () => {
64
- type: "running";
65
- } | {
66
- type: "complete";
67
- } | {
68
- type: "incomplete";
69
- reason: "cancelled" | "length" | "content-filter" | "other" | "error";
70
- error?: unknown;
71
- } | {
72
- type: "requires-action";
73
- reason: "tool-calls";
74
- };
75
-
76
- declare const buttonVariants: (props?: ({
77
- variant?: "default" | "outline" | "ghost" | null | undefined;
78
- size?: "default" | "icon" | null | undefined;
79
- } & class_variance_authority_types.ClassProp) | undefined) => string;
80
- type ButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button> & VariantProps<typeof buttonVariants>;
81
-
82
- type TooltipIconButtonProps = ButtonProps & {
83
- tooltip: string;
84
- side?: "top" | "bottom" | "left" | "right";
85
- };
86
- declare const TooltipIconButton: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
87
- ref?: ((instance: HTMLButtonElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLButtonElement> | null | undefined;
88
- } & {
89
- asChild?: boolean;
90
- }, "ref"> & class_variance_authority.VariantProps<(props?: ({
91
- variant?: "default" | "outline" | "ghost" | null | undefined;
92
- size?: "default" | "icon" | null | undefined;
93
- } & class_variance_authority_types.ClassProp) | undefined) => string> & {
94
- tooltip: string;
95
- side?: "top" | "bottom" | "left" | "right";
96
- } & react.RefAttributes<HTMLButtonElement>>;
97
-
98
- declare const generateId: (size?: number) => string;
99
-
100
- type internal_BaseAssistantRuntime<TThreadRuntime extends ReactThreadRuntime> = BaseAssistantRuntime<TThreadRuntime>;
101
- declare const internal_BaseAssistantRuntime: typeof BaseAssistantRuntime;
102
- type internal_MessageRepository = MessageRepository;
103
- declare const internal_MessageRepository: typeof MessageRepository;
104
- type internal_ProxyConfigProvider = ProxyConfigProvider;
105
- declare const internal_ProxyConfigProvider: typeof ProxyConfigProvider;
106
- declare const internal_TooltipIconButton: typeof TooltipIconButton;
107
- declare const internal_generateId: typeof generateId;
108
- declare const internal_useSmooth: typeof useSmooth;
109
- declare const internal_useSmoothStatus: typeof useSmoothStatus;
110
- declare const internal_withSmoothContextProvider: typeof withSmoothContextProvider;
111
- declare namespace internal {
112
- export { internal_BaseAssistantRuntime as BaseAssistantRuntime, internal_MessageRepository as MessageRepository, internal_ProxyConfigProvider as ProxyConfigProvider, internal_TooltipIconButton as TooltipIconButton, internal_generateId as generateId, internal_useSmooth as useSmooth, internal_useSmoothStatus as useSmoothStatus, internal_withSmoothContextProvider as withSmoothContextProvider };
113
- }
114
-
115
- type AddToolResultOptions = {
116
- messageId: string;
117
- toolCallId: string;
118
- result: any;
119
- };
120
- type RuntimeCapabilities = {
121
- switchToBranch: boolean;
122
- edit: boolean;
123
- reload: boolean;
124
- cancel: boolean;
125
- copy: boolean;
126
- };
127
- type ThreadActionsState = Readonly<{
128
- capabilities: Readonly<RuntimeCapabilities>;
129
- getBranches: (messageId: string) => readonly string[];
130
- switchToBranch: (branchId: string) => void;
131
- append: (message: AppendMessage) => void;
132
- startRun: (parentId: string | null) => void;
133
- cancelRun: () => void;
134
- addToolResult: (options: AddToolResultOptions) => void;
135
- }>;
136
-
137
- type ThreadRuntime = Readonly<ThreadState & Omit<ThreadActionsState, "getRuntime"> & {
138
- messages: readonly ThreadMessage[];
139
- subscribe: (callback: () => void) => Unsubscribe;
140
- }>;
141
-
142
- type ThreadRuntimeWithSubscribe = {
143
- readonly thread: ThreadRuntime;
144
- subscribe: (callback: () => void) => Unsubscribe;
145
- };
146
- type AssistantRuntime = ThreadRuntimeWithSubscribe & {
147
- switchToThread: (threadId: string | null) => void;
148
- registerModelConfigProvider: (provider: ModelConfigProvider) => Unsubscribe;
149
- };
150
-
151
- type ThreadState = Readonly<{
152
- isRunning: boolean;
153
- isDisabled: boolean;
154
- }>;
155
-
156
- export { type AddToolResultOptions as A, BaseAssistantRuntime as B, type ContentPartState as C, MessageRepository as M, ProxyConfigProvider as P, type ReactThreadRuntime as R, type ThreadRuntime as T, type Unsubscribe as U, type AssistantRuntime as a, type ThreadState as b, type ThreadActionsState as c, type TooltipIconButtonProps as d, type ButtonProps as e, TooltipIconButton as f, generateId as g, useSmoothStatus as h, internal as i, useSmooth as u, withSmoothContextProvider as w };
@@ -1,156 +0,0 @@
1
- import { h as ModelConfigProvider, c as ModelConfig, b as ThreadMessage, g as CoreMessage, C as ContentPartStatus, f as ToolCallContentPartStatus, d as TextContentPart, I as ImageContentPart, U as UIContentPart, e as ToolCallContentPart, A as AppendMessage } from './AssistantTypes-D93BmqD5.js';
2
- import * as react from 'react';
3
- import { ComponentType } from 'react';
4
- import * as class_variance_authority from 'class-variance-authority';
5
- import { VariantProps } from 'class-variance-authority';
6
- import * as class_variance_authority_types from 'class-variance-authority/types';
7
- import { Primitive } from '@radix-ui/react-primitive';
8
-
9
- type Unsubscribe = () => void;
10
-
11
- type ReactThreadRuntime = ThreadRuntime & {
12
- unstable_synchronizer?: ComponentType;
13
- };
14
-
15
- declare abstract class BaseAssistantRuntime<TThreadRuntime extends ReactThreadRuntime> implements AssistantRuntime {
16
- private _thread;
17
- constructor(_thread: TThreadRuntime);
18
- get thread(): TThreadRuntime;
19
- set thread(thread: TThreadRuntime);
20
- abstract registerModelConfigProvider(provider: ModelConfigProvider): Unsubscribe;
21
- abstract switchToThread(threadId: string | null): void;
22
- private _subscriptions;
23
- subscribe(callback: () => void): Unsubscribe;
24
- private subscriptionHandler;
25
- }
26
-
27
- declare class ProxyConfigProvider implements ModelConfigProvider {
28
- private _providers;
29
- getModelConfig(): ModelConfig;
30
- registerModelConfigProvider(provider: ModelConfigProvider): () => void;
31
- }
32
-
33
- declare class MessageRepository {
34
- private messages;
35
- private head;
36
- private root;
37
- private performOp;
38
- getMessages(): ThreadMessage[];
39
- addOrUpdateMessage(parentId: string | null, message: ThreadMessage): void;
40
- getMessage(messageId: string): {
41
- parentId: string | null;
42
- message: ThreadMessage;
43
- };
44
- appendOptimisticMessage(parentId: string | null, message: CoreMessage): string;
45
- deleteMessage(messageId: string, replacementId?: string | null | undefined): void;
46
- getBranches(messageId: string): string[];
47
- switchToBranch(messageId: string): void;
48
- resetHead(messageId: string | null): void;
49
- }
50
-
51
- type TextContentPartState = Readonly<{
52
- status: ContentPartStatus;
53
- part: TextContentPart;
54
- }>;
55
- type ContentPartState = Readonly<{
56
- status: ContentPartStatus | ToolCallContentPartStatus;
57
- part: TextContentPart | ImageContentPart | UIContentPart | ToolCallContentPart;
58
- }>;
59
-
60
- declare const useSmooth: (state: TextContentPartState, smooth?: boolean) => TextContentPartState;
61
-
62
- declare const withSmoothContextProvider: <C extends React.ComponentType<any>>(Component: C) => C;
63
- declare const useSmoothStatus: () => {
64
- type: "running";
65
- } | {
66
- type: "complete";
67
- } | {
68
- type: "incomplete";
69
- reason: "cancelled" | "length" | "content-filter" | "other" | "error";
70
- error?: unknown;
71
- } | {
72
- type: "requires-action";
73
- reason: "tool-calls";
74
- };
75
-
76
- declare const buttonVariants: (props?: ({
77
- variant?: "default" | "outline" | "ghost" | null | undefined;
78
- size?: "default" | "icon" | null | undefined;
79
- } & class_variance_authority_types.ClassProp) | undefined) => string;
80
- type ButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button> & VariantProps<typeof buttonVariants>;
81
-
82
- type TooltipIconButtonProps = ButtonProps & {
83
- tooltip: string;
84
- side?: "top" | "bottom" | "left" | "right";
85
- };
86
- declare const TooltipIconButton: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
87
- ref?: ((instance: HTMLButtonElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLButtonElement> | null | undefined;
88
- } & {
89
- asChild?: boolean;
90
- }, "ref"> & class_variance_authority.VariantProps<(props?: ({
91
- variant?: "default" | "outline" | "ghost" | null | undefined;
92
- size?: "default" | "icon" | null | undefined;
93
- } & class_variance_authority_types.ClassProp) | undefined) => string> & {
94
- tooltip: string;
95
- side?: "top" | "bottom" | "left" | "right";
96
- } & react.RefAttributes<HTMLButtonElement>>;
97
-
98
- declare const generateId: (size?: number) => string;
99
-
100
- type internal_BaseAssistantRuntime<TThreadRuntime extends ReactThreadRuntime> = BaseAssistantRuntime<TThreadRuntime>;
101
- declare const internal_BaseAssistantRuntime: typeof BaseAssistantRuntime;
102
- type internal_MessageRepository = MessageRepository;
103
- declare const internal_MessageRepository: typeof MessageRepository;
104
- type internal_ProxyConfigProvider = ProxyConfigProvider;
105
- declare const internal_ProxyConfigProvider: typeof ProxyConfigProvider;
106
- declare const internal_TooltipIconButton: typeof TooltipIconButton;
107
- declare const internal_generateId: typeof generateId;
108
- declare const internal_useSmooth: typeof useSmooth;
109
- declare const internal_useSmoothStatus: typeof useSmoothStatus;
110
- declare const internal_withSmoothContextProvider: typeof withSmoothContextProvider;
111
- declare namespace internal {
112
- export { internal_BaseAssistantRuntime as BaseAssistantRuntime, internal_MessageRepository as MessageRepository, internal_ProxyConfigProvider as ProxyConfigProvider, internal_TooltipIconButton as TooltipIconButton, internal_generateId as generateId, internal_useSmooth as useSmooth, internal_useSmoothStatus as useSmoothStatus, internal_withSmoothContextProvider as withSmoothContextProvider };
113
- }
114
-
115
- type AddToolResultOptions = {
116
- messageId: string;
117
- toolCallId: string;
118
- result: any;
119
- };
120
- type RuntimeCapabilities = {
121
- switchToBranch: boolean;
122
- edit: boolean;
123
- reload: boolean;
124
- cancel: boolean;
125
- copy: boolean;
126
- };
127
- type ThreadActionsState = Readonly<{
128
- capabilities: Readonly<RuntimeCapabilities>;
129
- getBranches: (messageId: string) => readonly string[];
130
- switchToBranch: (branchId: string) => void;
131
- append: (message: AppendMessage) => void;
132
- startRun: (parentId: string | null) => void;
133
- cancelRun: () => void;
134
- addToolResult: (options: AddToolResultOptions) => void;
135
- }>;
136
-
137
- type ThreadRuntime = Readonly<ThreadState & Omit<ThreadActionsState, "getRuntime"> & {
138
- messages: readonly ThreadMessage[];
139
- subscribe: (callback: () => void) => Unsubscribe;
140
- }>;
141
-
142
- type ThreadRuntimeWithSubscribe = {
143
- readonly thread: ThreadRuntime;
144
- subscribe: (callback: () => void) => Unsubscribe;
145
- };
146
- type AssistantRuntime = ThreadRuntimeWithSubscribe & {
147
- switchToThread: (threadId: string | null) => void;
148
- registerModelConfigProvider: (provider: ModelConfigProvider) => Unsubscribe;
149
- };
150
-
151
- type ThreadState = Readonly<{
152
- isRunning: boolean;
153
- isDisabled: boolean;
154
- }>;
155
-
156
- export { type AddToolResultOptions as A, BaseAssistantRuntime as B, type ContentPartState as C, MessageRepository as M, ProxyConfigProvider as P, type ReactThreadRuntime as R, type ThreadRuntime as T, type Unsubscribe as U, type AssistantRuntime as a, type ThreadState as b, type ThreadActionsState as c, type TooltipIconButtonProps as d, type ButtonProps as e, TooltipIconButton as f, generateId as g, useSmoothStatus as h, internal as i, useSmooth as u, withSmoothContextProvider as w };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/runtimes/edge/converters/toLanguageModelMessages.ts","../src/runtimes/edge/converters/toCoreMessages.ts","../src/runtimes/edge/converters/toLanguageModelTools.ts","../src/runtimes/edge/partial-json/parse-partial-json.ts","../src/runtimes/edge/partial-json/fix-json.ts","../src/runtimes/edge/streams/runResultStream.ts","../src/runtimes/edge/streams/toolResultStream.ts"],"sourcesContent":["import {\n LanguageModelV1ImagePart,\n LanguageModelV1Message,\n LanguageModelV1TextPart,\n LanguageModelV1ToolCallPart,\n LanguageModelV1ToolResultPart,\n} from \"@ai-sdk/provider\";\nimport {\n CoreMessage,\n ThreadMessage,\n TextContentPart,\n CoreToolCallContentPart,\n} from \"../../../types/AssistantTypes\";\n\nconst assistantMessageSplitter = () => {\n const stash: LanguageModelV1Message[] = [];\n let assistantMessage = {\n role: \"assistant\" as const,\n content: [] as (LanguageModelV1TextPart | LanguageModelV1ToolCallPart)[],\n };\n let toolMessage = {\n role: \"tool\" as const,\n content: [] as LanguageModelV1ToolResultPart[],\n };\n\n return {\n addTextContentPart: (part: TextContentPart) => {\n if (toolMessage.content.length > 0) {\n stash.push(assistantMessage);\n stash.push(toolMessage);\n\n assistantMessage = {\n role: \"assistant\" as const,\n content: [] as (\n | LanguageModelV1TextPart\n | LanguageModelV1ToolCallPart\n )[],\n };\n\n toolMessage = {\n role: \"tool\" as const,\n content: [] as LanguageModelV1ToolResultPart[],\n };\n }\n\n assistantMessage.content.push(part);\n },\n addToolCallPart: (part: CoreToolCallContentPart) => {\n assistantMessage.content.push({\n type: \"tool-call\",\n toolCallId: part.toolCallId,\n toolName: part.toolName,\n args: part.args,\n });\n if (part.result) {\n toolMessage.content.push({\n type: \"tool-result\",\n toolCallId: part.toolCallId,\n toolName: part.toolName,\n result: part.result,\n // isError\n });\n }\n },\n getMessages: () => {\n if (toolMessage.content.length > 0) {\n return [...stash, assistantMessage, toolMessage];\n }\n\n return [...stash, assistantMessage];\n },\n };\n};\n\nexport function toLanguageModelMessages(\n message: readonly CoreMessage[] | readonly ThreadMessage[],\n): LanguageModelV1Message[] {\n return message.flatMap((message) => {\n const role = message.role;\n switch (role) {\n case \"system\": {\n return [{ role: \"system\", content: message.content[0].text }];\n }\n\n case \"user\": {\n const msg: LanguageModelV1Message = {\n role: \"user\",\n content: message.content.map(\n (part): LanguageModelV1TextPart | LanguageModelV1ImagePart => {\n const type = part.type;\n switch (type) {\n case \"text\": {\n return part;\n }\n\n case \"image\": {\n return {\n type: \"image\",\n image: new URL(part.image),\n };\n }\n\n default: {\n const unhandledType: \"ui\" = type;\n throw new Error(\n `Unspported content part type: ${unhandledType}`,\n );\n }\n }\n },\n ),\n };\n return [msg];\n }\n\n case \"assistant\": {\n const splitter = assistantMessageSplitter();\n for (const part of message.content) {\n const type = part.type;\n switch (type) {\n case \"text\": {\n splitter.addTextContentPart(part);\n break;\n }\n case \"tool-call\": {\n splitter.addToolCallPart(part);\n break;\n }\n default: {\n const unhandledType: \"ui\" = type;\n throw new Error(`Unhandled content part type: ${unhandledType}`);\n }\n }\n }\n return splitter.getMessages();\n }\n\n default: {\n const unhandledRole: never = role;\n throw new Error(`Unknown message role: ${unhandledRole}`);\n }\n }\n });\n}\n","import { ThreadMessage, CoreMessage } from \"../../../types\";\n\nexport const toCoreMessages = (message: ThreadMessage[]): CoreMessage[] => {\n return message.map(toCoreMessage);\n};\n\nexport const toCoreMessage = (message: ThreadMessage): CoreMessage => {\n const role = message.role;\n switch (role) {\n case \"assistant\":\n return {\n role,\n content: message.content.map((part) => {\n if (part.type === \"ui\") throw new Error(\"UI parts are not supported\");\n if (part.type === \"tool-call\") {\n const { argsText, ...rest } = part;\n return rest;\n }\n return part;\n }),\n };\n\n case \"user\":\n return {\n role,\n content: message.content.map((part) => {\n if (part.type === \"ui\") throw new Error(\"UI parts are not supported\");\n return part;\n }),\n };\n\n case \"system\":\n return {\n role,\n content: message.content,\n };\n\n default: {\n const unsupportedRole: never = role;\n throw new Error(`Unknown message role: ${unsupportedRole}`);\n }\n }\n};\n","import { LanguageModelV1FunctionTool } from \"@ai-sdk/provider\";\nimport { JSONSchema7 } from \"json-schema\";\nimport { z } from \"zod\";\nimport zodToJsonSchema from \"zod-to-json-schema\";\nimport { Tool } from \"../../../types/ModelConfigTypes\";\n\nexport const toLanguageModelTools = (\n tools: Record<string, Tool<any, any>>,\n): LanguageModelV1FunctionTool[] => {\n return Object.entries(tools).map(([name, tool]) => ({\n type: \"function\",\n name,\n ...(tool.description ? { description: tool.description } : undefined),\n parameters: (tool.parameters instanceof z.ZodType\n ? zodToJsonSchema(tool.parameters)\n : tool.parameters) as JSONSchema7,\n }));\n};\n","import sjson from \"secure-json-parse\";\nimport { fixJson } from \"./fix-json\";\n\nexport const parsePartialJson = (json: string) => {\n try {\n return sjson.parse(json);\n } catch {\n try {\n return sjson.parse(fixJson(json));\n } catch {\n return undefined;\n }\n }\n};\n","// LICENSE for this file only\n\n// Copyright 2023 Vercel, Inc.\n\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n\n// http://www.apache.org/licenses/LICENSE-2.0\n\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\ntype State =\n | \"ROOT\"\n | \"FINISH\"\n | \"INSIDE_STRING\"\n | \"INSIDE_STRING_ESCAPE\"\n | \"INSIDE_LITERAL\"\n | \"INSIDE_NUMBER\"\n | \"INSIDE_OBJECT_START\"\n | \"INSIDE_OBJECT_KEY\"\n | \"INSIDE_OBJECT_AFTER_KEY\"\n | \"INSIDE_OBJECT_BEFORE_VALUE\"\n | \"INSIDE_OBJECT_AFTER_VALUE\"\n | \"INSIDE_OBJECT_AFTER_COMMA\"\n | \"INSIDE_ARRAY_START\"\n | \"INSIDE_ARRAY_AFTER_VALUE\"\n | \"INSIDE_ARRAY_AFTER_COMMA\";\n\n// Implemented as a scanner with additional fixing\n// that performs a single linear time scan pass over the partial JSON.\n//\n// The states should ideally match relevant states from the JSON spec:\n// https://www.json.org/json-en.html\n//\n// Please note that invalid JSON is not considered/covered, because it\n// is assumed that the resulting JSON will be processed by a standard\n// JSON parser that will detect any invalid JSON.\nexport function fixJson(input: string): string {\n const stack: State[] = [\"ROOT\"];\n let lastValidIndex = -1;\n let literalStart: number | null = null;\n\n function processValueStart(char: string, i: number, swapState: State) {\n {\n switch (char) {\n case '\"': {\n lastValidIndex = i;\n stack.pop();\n stack.push(swapState);\n stack.push(\"INSIDE_STRING\");\n break;\n }\n\n case \"f\":\n case \"t\":\n case \"n\": {\n lastValidIndex = i;\n literalStart = i;\n stack.pop();\n stack.push(swapState);\n stack.push(\"INSIDE_LITERAL\");\n break;\n }\n\n case \"-\": {\n stack.pop();\n stack.push(swapState);\n stack.push(\"INSIDE_NUMBER\");\n break;\n }\n case \"0\":\n case \"1\":\n case \"2\":\n case \"3\":\n case \"4\":\n case \"5\":\n case \"6\":\n case \"7\":\n case \"8\":\n case \"9\": {\n lastValidIndex = i;\n stack.pop();\n stack.push(swapState);\n stack.push(\"INSIDE_NUMBER\");\n break;\n }\n\n case \"{\": {\n lastValidIndex = i;\n stack.pop();\n stack.push(swapState);\n stack.push(\"INSIDE_OBJECT_START\");\n break;\n }\n\n case \"[\": {\n lastValidIndex = i;\n stack.pop();\n stack.push(swapState);\n stack.push(\"INSIDE_ARRAY_START\");\n break;\n }\n }\n }\n }\n\n function processAfterObjectValue(char: string, i: number) {\n switch (char) {\n case \",\": {\n stack.pop();\n stack.push(\"INSIDE_OBJECT_AFTER_COMMA\");\n break;\n }\n case \"}\": {\n lastValidIndex = i;\n stack.pop();\n break;\n }\n }\n }\n\n function processAfterArrayValue(char: string, i: number) {\n switch (char) {\n case \",\": {\n stack.pop();\n stack.push(\"INSIDE_ARRAY_AFTER_COMMA\");\n break;\n }\n case \"]\": {\n lastValidIndex = i;\n stack.pop();\n break;\n }\n }\n }\n\n for (let i = 0; i < input.length; i++) {\n const char = input[i]!;\n const currentState = stack[stack.length - 1];\n\n switch (currentState) {\n case \"ROOT\":\n processValueStart(char, i, \"FINISH\");\n break;\n\n case \"INSIDE_OBJECT_START\": {\n switch (char) {\n case '\"': {\n stack.pop();\n stack.push(\"INSIDE_OBJECT_KEY\");\n break;\n }\n case \"}\": {\n lastValidIndex = i;\n stack.pop();\n break;\n }\n }\n break;\n }\n\n case \"INSIDE_OBJECT_AFTER_COMMA\": {\n switch (char) {\n case '\"': {\n stack.pop();\n stack.push(\"INSIDE_OBJECT_KEY\");\n break;\n }\n }\n break;\n }\n\n case \"INSIDE_OBJECT_KEY\": {\n switch (char) {\n case '\"': {\n stack.pop();\n stack.push(\"INSIDE_OBJECT_AFTER_KEY\");\n break;\n }\n }\n break;\n }\n\n case \"INSIDE_OBJECT_AFTER_KEY\": {\n switch (char) {\n case \":\": {\n stack.pop();\n stack.push(\"INSIDE_OBJECT_BEFORE_VALUE\");\n\n break;\n }\n }\n break;\n }\n\n case \"INSIDE_OBJECT_BEFORE_VALUE\": {\n processValueStart(char, i, \"INSIDE_OBJECT_AFTER_VALUE\");\n break;\n }\n\n case \"INSIDE_OBJECT_AFTER_VALUE\": {\n processAfterObjectValue(char, i);\n break;\n }\n\n case \"INSIDE_STRING\": {\n switch (char) {\n case '\"': {\n stack.pop();\n lastValidIndex = i;\n break;\n }\n\n case \"\\\\\": {\n stack.push(\"INSIDE_STRING_ESCAPE\");\n break;\n }\n\n default: {\n lastValidIndex = i;\n }\n }\n\n break;\n }\n\n case \"INSIDE_ARRAY_START\": {\n switch (char) {\n case \"]\": {\n lastValidIndex = i;\n stack.pop();\n break;\n }\n\n default: {\n lastValidIndex = i;\n processValueStart(char, i, \"INSIDE_ARRAY_AFTER_VALUE\");\n break;\n }\n }\n break;\n }\n\n case \"INSIDE_ARRAY_AFTER_VALUE\": {\n switch (char) {\n case \",\": {\n stack.pop();\n stack.push(\"INSIDE_ARRAY_AFTER_COMMA\");\n break;\n }\n\n case \"]\": {\n lastValidIndex = i;\n stack.pop();\n break;\n }\n\n default: {\n lastValidIndex = i;\n break;\n }\n }\n\n break;\n }\n\n case \"INSIDE_ARRAY_AFTER_COMMA\": {\n processValueStart(char, i, \"INSIDE_ARRAY_AFTER_VALUE\");\n break;\n }\n\n case \"INSIDE_STRING_ESCAPE\": {\n stack.pop();\n lastValidIndex = i;\n\n break;\n }\n\n case \"INSIDE_NUMBER\": {\n switch (char) {\n case \"0\":\n case \"1\":\n case \"2\":\n case \"3\":\n case \"4\":\n case \"5\":\n case \"6\":\n case \"7\":\n case \"8\":\n case \"9\": {\n lastValidIndex = i;\n break;\n }\n\n case \"e\":\n case \"E\":\n case \"-\":\n case \".\": {\n break;\n }\n\n case \",\": {\n stack.pop();\n\n if (stack[stack.length - 1] === \"INSIDE_ARRAY_AFTER_VALUE\") {\n processAfterArrayValue(char, i);\n }\n\n if (stack[stack.length - 1] === \"INSIDE_OBJECT_AFTER_VALUE\") {\n processAfterObjectValue(char, i);\n }\n\n break;\n }\n\n case \"}\": {\n stack.pop();\n\n if (stack[stack.length - 1] === \"INSIDE_OBJECT_AFTER_VALUE\") {\n processAfterObjectValue(char, i);\n }\n\n break;\n }\n\n case \"]\": {\n stack.pop();\n\n if (stack[stack.length - 1] === \"INSIDE_ARRAY_AFTER_VALUE\") {\n processAfterArrayValue(char, i);\n }\n\n break;\n }\n\n default: {\n stack.pop();\n break;\n }\n }\n\n break;\n }\n\n case \"INSIDE_LITERAL\": {\n const partialLiteral = input.substring(literalStart!, i + 1);\n\n if (\n !\"false\".startsWith(partialLiteral) &&\n !\"true\".startsWith(partialLiteral) &&\n !\"null\".startsWith(partialLiteral)\n ) {\n stack.pop();\n\n if (stack[stack.length - 1] === \"INSIDE_OBJECT_AFTER_VALUE\") {\n processAfterObjectValue(char, i);\n } else if (stack[stack.length - 1] === \"INSIDE_ARRAY_AFTER_VALUE\") {\n processAfterArrayValue(char, i);\n }\n } else {\n lastValidIndex = i;\n }\n\n break;\n }\n }\n }\n\n let result = input.slice(0, lastValidIndex + 1);\n\n for (let i = stack.length - 1; i >= 0; i--) {\n const state = stack[i];\n\n switch (state) {\n case \"INSIDE_STRING\": {\n result += '\"';\n break;\n }\n\n case \"INSIDE_OBJECT_KEY\":\n case \"INSIDE_OBJECT_AFTER_KEY\":\n case \"INSIDE_OBJECT_AFTER_COMMA\":\n case \"INSIDE_OBJECT_START\":\n case \"INSIDE_OBJECT_BEFORE_VALUE\":\n case \"INSIDE_OBJECT_AFTER_VALUE\": {\n result += \"}\";\n break;\n }\n\n case \"INSIDE_ARRAY_START\":\n case \"INSIDE_ARRAY_AFTER_COMMA\":\n case \"INSIDE_ARRAY_AFTER_VALUE\": {\n result += \"]\";\n break;\n }\n\n case \"INSIDE_LITERAL\": {\n const partialLiteral = input.substring(literalStart!, input.length);\n\n if (\"true\".startsWith(partialLiteral)) {\n result += \"true\".slice(partialLiteral.length);\n } else if (\"false\".startsWith(partialLiteral)) {\n result += \"false\".slice(partialLiteral.length);\n } else if (\"null\".startsWith(partialLiteral)) {\n result += \"null\".slice(partialLiteral.length);\n }\n }\n }\n }\n\n return result;\n}\n","import { ChatModelRunResult } from \"../../local/ChatModelAdapter\";\nimport { parsePartialJson } from \"../partial-json/parse-partial-json\";\nimport { LanguageModelV1StreamPart } from \"@ai-sdk/provider\";\nimport { ToolResultStreamPart } from \"./toolResultStream\";\nimport { MessageStatus } from \"../../../types\";\n\nexport function runResultStream() {\n let message: ChatModelRunResult = {\n content: [],\n status: { type: \"running\" },\n };\n const currentToolCall = { toolCallId: \"\", argsText: \"\" };\n\n return new TransformStream<ToolResultStreamPart, ChatModelRunResult>({\n transform(chunk, controller) {\n const chunkType = chunk.type;\n switch (chunkType) {\n case \"text-delta\": {\n message = appendOrUpdateText(message, chunk.textDelta);\n controller.enqueue(message);\n break;\n }\n case \"tool-call-delta\": {\n const { toolCallId, toolName, argsTextDelta } = chunk;\n if (currentToolCall.toolCallId !== toolCallId) {\n currentToolCall.toolCallId = toolCallId;\n currentToolCall.argsText = argsTextDelta;\n } else {\n currentToolCall.argsText += argsTextDelta;\n }\n\n message = appendOrUpdateToolCall(\n message,\n toolCallId,\n toolName,\n currentToolCall.argsText,\n );\n controller.enqueue(message);\n break;\n }\n case \"tool-call\": {\n break;\n }\n case \"tool-result\": {\n message = appendOrUpdateToolResult(\n message,\n chunk.toolCallId,\n chunk.toolName,\n chunk.result,\n );\n controller.enqueue(message);\n break;\n }\n case \"finish\": {\n message = appendOrUpdateFinish(message, chunk);\n controller.enqueue(message);\n break;\n }\n case \"error\": {\n if (\n chunk.error instanceof Error &&\n chunk.error.name === \"AbortError\"\n ) {\n message = appendOrUpdateCancel(message);\n controller.enqueue(message);\n break;\n } else {\n throw chunk.error;\n }\n }\n default: {\n const unhandledType: never = chunkType;\n throw new Error(`Unhandled chunk type: ${unhandledType}`);\n }\n }\n },\n });\n}\n\nconst appendOrUpdateText = (message: ChatModelRunResult, textDelta: string) => {\n let contentParts = message.content;\n let contentPart = message.content.at(-1);\n if (contentPart?.type !== \"text\") {\n contentPart = { type: \"text\", text: textDelta };\n } else {\n contentParts = contentParts.slice(0, -1);\n contentPart = { type: \"text\", text: contentPart.text + textDelta };\n }\n return {\n ...message,\n content: contentParts.concat([contentPart]),\n };\n};\n\nconst appendOrUpdateToolCall = (\n message: ChatModelRunResult,\n toolCallId: string,\n toolName: string,\n argsText: string,\n) => {\n let contentParts = message.content;\n let contentPart = message.content.at(-1);\n if (\n contentPart?.type !== \"tool-call\" ||\n contentPart.toolCallId !== toolCallId\n ) {\n contentPart = {\n type: \"tool-call\",\n toolCallId,\n toolName,\n argsText,\n args: parsePartialJson(argsText),\n };\n } else {\n contentParts = contentParts.slice(0, -1);\n contentPart = {\n ...contentPart,\n argsText,\n args: parsePartialJson(argsText),\n };\n }\n return {\n ...message,\n content: contentParts.concat([contentPart]),\n };\n};\n\nconst appendOrUpdateToolResult = (\n message: ChatModelRunResult,\n toolCallId: string,\n toolName: string,\n result: any,\n) => {\n let found = false;\n const newContentParts = message.content.map((part) => {\n if (part.type !== \"tool-call\" || part.toolCallId !== toolCallId)\n return part;\n found = true;\n\n if (part.toolName !== toolName)\n throw new Error(\n `Tool call ${toolCallId} found with tool name ${part.toolName}, but expected ${toolName}`,\n );\n\n return {\n ...part,\n result,\n };\n });\n if (!found)\n throw new Error(\n `Received tool result for unknown tool call \"${toolName}\" / \"${toolCallId}\". This is likely an internal bug in assistant-ui.`,\n );\n\n return {\n ...message,\n content: newContentParts,\n };\n};\n\nconst appendOrUpdateFinish = (\n message: ChatModelRunResult,\n chunk: LanguageModelV1StreamPart & { type: \"finish\" },\n): ChatModelRunResult => {\n const { type, ...rest } = chunk;\n return {\n ...message,\n status: getStatus(chunk),\n roundtrips: [\n ...(message.roundtrips ?? []),\n {\n logprobs: rest.logprobs,\n usage: rest.usage,\n },\n ],\n };\n};\n\nconst getStatus = (\n chunk: LanguageModelV1StreamPart & { type: \"finish\" },\n): MessageStatus => {\n if (chunk.finishReason === \"tool-calls\") {\n return {\n type: \"requires-action\",\n reason: \"tool-calls\",\n };\n } else if (\n chunk.finishReason === \"stop\" ||\n chunk.finishReason === \"unknown\"\n ) {\n return {\n type: \"complete\",\n reason: chunk.finishReason,\n };\n } else {\n return {\n type: \"incomplete\",\n reason: chunk.finishReason,\n };\n }\n};\n\nconst appendOrUpdateCancel = (\n message: ChatModelRunResult,\n): ChatModelRunResult => {\n return {\n ...message,\n status: {\n type: \"incomplete\",\n reason: \"cancelled\",\n },\n };\n};\n","import { Tool } from \"../../../types/ModelConfigTypes\";\nimport { LanguageModelV1StreamPart } from \"@ai-sdk/provider\";\nimport { z } from \"zod\";\nimport sjson from \"secure-json-parse\";\n\nexport type ToolResultStreamPart =\n | LanguageModelV1StreamPart\n | {\n type: \"tool-result\";\n toolCallType: \"function\";\n toolCallId: string;\n toolName: string;\n result: unknown;\n isError?: boolean;\n };\n\nexport function toolResultStream(tools: Record<string, Tool> | undefined) {\n const toolCallExecutions = new Map<string, Promise<any>>();\n\n return new TransformStream<ToolResultStreamPart, ToolResultStreamPart>({\n transform(chunk, controller) {\n // forward everything\n controller.enqueue(chunk);\n\n // handle tool calls\n const chunkType = chunk.type;\n switch (chunkType) {\n case \"tool-call\": {\n const { toolCallId, toolCallType, toolName, args: argsText } = chunk;\n const tool = tools?.[toolName];\n if (!tool || !tool.execute) return;\n\n const args = sjson.parse(argsText);\n if (tool.parameters instanceof z.ZodType) {\n const result = tool.parameters.safeParse(args);\n if (!result.success) {\n controller.enqueue({\n type: \"tool-result\",\n toolCallType,\n toolCallId,\n toolName,\n result:\n \"Function parameter validation failed. \" +\n JSON.stringify(result.error.issues),\n isError: true,\n });\n return;\n } else {\n toolCallExecutions.set(\n toolCallId,\n (async () => {\n try {\n const result = await tool.execute!(args);\n\n controller.enqueue({\n type: \"tool-result\",\n toolCallType,\n toolCallId,\n toolName,\n result,\n });\n } catch (error) {\n console.error(\"Error: \", error);\n controller.enqueue({\n type: \"tool-result\",\n toolCallType,\n toolCallId,\n toolName,\n result: \"Error: \" + error,\n isError: true,\n });\n } finally {\n toolCallExecutions.delete(toolCallId);\n }\n })(),\n );\n }\n }\n break;\n }\n\n // ignore other parts\n case \"text-delta\":\n case \"tool-call-delta\":\n case \"tool-result\":\n case \"finish\":\n case \"error\":\n break;\n\n default: {\n const unhandledType: never = chunkType;\n throw new Error(`Unhandled chunk type: ${unhandledType}`);\n }\n }\n },\n\n async flush() {\n await Promise.all(toolCallExecutions.values());\n },\n });\n}\n"],"mappings":";;;AAcA,IAAM,2BAA2B,MAAM;AACrC,QAAM,QAAkC,CAAC;AACzC,MAAI,mBAAmB;AAAA,IACrB,MAAM;AAAA,IACN,SAAS,CAAC;AAAA,EACZ;AACA,MAAI,cAAc;AAAA,IAChB,MAAM;AAAA,IACN,SAAS,CAAC;AAAA,EACZ;AAEA,SAAO;AAAA,IACL,oBAAoB,CAAC,SAA0B;AAC7C,UAAI,YAAY,QAAQ,SAAS,GAAG;AAClC,cAAM,KAAK,gBAAgB;AAC3B,cAAM,KAAK,WAAW;AAEtB,2BAAmB;AAAA,UACjB,MAAM;AAAA,UACN,SAAS,CAAC;AAAA,QAIZ;AAEA,sBAAc;AAAA,UACZ,MAAM;AAAA,UACN,SAAS,CAAC;AAAA,QACZ;AAAA,MACF;AAEA,uBAAiB,QAAQ,KAAK,IAAI;AAAA,IACpC;AAAA,IACA,iBAAiB,CAAC,SAAkC;AAClD,uBAAiB,QAAQ,KAAK;AAAA,QAC5B,MAAM;AAAA,QACN,YAAY,KAAK;AAAA,QACjB,UAAU,KAAK;AAAA,QACf,MAAM,KAAK;AAAA,MACb,CAAC;AACD,UAAI,KAAK,QAAQ;AACf,oBAAY,QAAQ,KAAK;AAAA,UACvB,MAAM;AAAA,UACN,YAAY,KAAK;AAAA,UACjB,UAAU,KAAK;AAAA,UACf,QAAQ,KAAK;AAAA;AAAA,QAEf,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA,aAAa,MAAM;AACjB,UAAI,YAAY,QAAQ,SAAS,GAAG;AAClC,eAAO,CAAC,GAAG,OAAO,kBAAkB,WAAW;AAAA,MACjD;AAEA,aAAO,CAAC,GAAG,OAAO,gBAAgB;AAAA,IACpC;AAAA,EACF;AACF;AAEO,SAAS,wBACd,SAC0B;AAC1B,SAAO,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