@assistant-ui/react 0.5.20 → 0.5.22

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,40 +1,9 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- 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');
29
3
 
30
4
  // src/tailwindcss/index.ts
31
- var tailwindcss_exports = {};
32
- __export(tailwindcss_exports, {
33
- default: () => tailwindcss_default
34
- });
35
- module.exports = __toCommonJS(tailwindcss_exports);
36
- var import_plugin = __toESM(require("tailwindcss/plugin"));
37
- var auiPlugin = import_plugin.default.withOptions(
5
+ var _plugin = require('tailwindcss/plugin'); var _plugin2 = _interopRequireDefault(_plugin);
6
+ var auiPlugin = _plugin2.default.withOptions(
38
7
  ({ components = ["assistant-modal", "thread"], shadcn = false } = {}) => ({ addComponents }) => {
39
8
  const assistantModal = components.includes("assistant-modal");
40
9
  const thread = assistantModal || components.includes("thread");
@@ -70,38 +39,38 @@ var auiPlugin = import_plugin.default.withOptions(
70
39
  extend: {
71
40
  colors: {
72
41
  aui: {
73
- border: colors.border ?? `hsl(var(${prefix}border))`,
74
- input: colors.input ?? `hsl(var(${prefix}input))`,
75
- ring: colors.ring ?? `hsl(var(${prefix}ring))`,
76
- background: colors.background ?? `hsl(var(${prefix}background))`,
77
- 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))`)),
78
47
  primary: {
79
- DEFAULT: colors.primary?.DEFAULT ?? `hsl(var(${prefix}primary))`,
80
- 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))`))
81
50
  },
82
51
  secondary: {
83
- DEFAULT: colors.secondary?.DEFAULT ?? `hsl(var(${prefix}secondary))`,
84
- 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))`))
85
54
  },
86
55
  destructive: {
87
- 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))`)),
88
57
  foreground: `hsl(var(${prefix}destructive-foreground))`
89
58
  },
90
59
  muted: {
91
60
  DEFAULT: `hsl(var(${prefix}muted))`,
92
- 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))`))
93
62
  },
94
63
  accent: {
95
- DEFAULT: colors.accent?.DEFAULT ?? `hsl(var(${prefix}accent))`,
96
- 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))`))
97
66
  },
98
67
  popover: {
99
- DEFAULT: colors.popover?.DEFAULT ?? `hsl(var(${prefix}popover))`,
100
- 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))`))
101
70
  },
102
71
  card: {
103
- DEFAULT: colors.card?.DEFAULT ?? `hsl(var(${prefix}card))`,
104
- 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))`))
105
74
  }
106
75
  }
107
76
  }
@@ -111,4 +80,7 @@ var auiPlugin = import_plugin.default.withOptions(
111
80
  }
112
81
  );
113
82
  var tailwindcss_default = auiPlugin;
83
+
84
+
85
+ exports.default = tailwindcss_default;
114
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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ACE,OAAO,SAAS,cAChB,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,M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AA,oBAAA;AAAA,cACrB,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"]}
@@ -1,3 +1,6 @@
1
+ "use client";
2
+ import "../chunk-BJPOCE4O.mjs";
3
+
1
4
  // src/tailwindcss/index.ts
2
5
  import plugin from "tailwindcss/plugin";
3
6
  var auiPlugin = plugin.withOptions(
@@ -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,OAAO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MAAM;AAAA,cACrB;AAAA,cACA,WAAW;AAAA,gBACT,SACE,OAAO,WAAW,WAAW,WAAW,MAAM;AAAA,gBAChD,YACE,OAAO,WAAW,cAClB,WAAW,MAAM;AAAA,cACrB;AAAA,cACA,aAAa;AAAA,gBACX,SACE,OAAO,aAAa,WACpB,WAAW,MAAM;AAAA,gBACnB,YAAY,WAAW,MAAM;AAAA,cAC/B;AAAA,cACA,OAAO;AAAA,gBACL,SAAS,WAAW,MAAM;AAAA,gBAC1B,YACE,OAAO,OAAO,cACd,WAAW,MAAM;AAAA,cACrB;AAAA,cACA,QAAQ;AAAA,gBACN,SAAS,OAAO,QAAQ,WAAW,WAAW,MAAM;AAAA,gBACpD,YACE,OAAO,QAAQ,cACf,WAAW,MAAM;AAAA,cACrB;AAAA,cACA,SAAS;AAAA,gBACP,SACE,OAAO,SAAS,WAAW,WAAW,MAAM;AAAA,gBAC9C,YACE,OAAO,SAAS,cAChB,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":[]}
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,OAAO,YAAY;AA4CnB,IAAM,YAAY,OAAO;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;AAAA,QACZ,+DAA+D;AAAA,MACjE,CAAC;AAAA,IACH;AAEA,QAAI,gBAAgB;AAClB,oBAAc;AAAA,QACZ,8DAA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AA,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":[]}
package/package.json CHANGED
@@ -29,7 +29,7 @@
29
29
  "conversational-ui",
30
30
  "conversational-ai"
31
31
  ],
32
- "version": "0.5.20",
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,61 +0,0 @@
1
- // src/types/ModelConfigTypes.ts
2
- import { z } from "zod";
3
- var LanguageModelV1CallSettingsSchema = z.object({
4
- maxTokens: z.number().int().positive().optional(),
5
- temperature: z.number().optional(),
6
- topP: z.number().optional(),
7
- presencePenalty: z.number().optional(),
8
- frequencyPenalty: z.number().optional(),
9
- seed: z.number().int().optional(),
10
- headers: z.record(z.string().optional()).optional()
11
- });
12
- var LanguageModelConfigSchema = z.object({
13
- apiKey: z.string().optional(),
14
- baseUrl: z.string().optional(),
15
- modelName: z.string().optional()
16
- });
17
- var mergeModelConfigs = (configSet) => {
18
- const configs = Array.from(configSet).map((c) => c.getModelConfig()).sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
19
- return configs.reduce((acc, config) => {
20
- if (config.system) {
21
- if (acc.system) {
22
- acc.system += `
23
-
24
- ${config.system}`;
25
- } else {
26
- acc.system = config.system;
27
- }
28
- }
29
- if (config.tools) {
30
- for (const [name, tool] of Object.entries(config.tools)) {
31
- if (acc.tools?.[name]) {
32
- throw new Error(
33
- `You tried to define a tool with the name ${name}, but it already exists.`
34
- );
35
- }
36
- if (!acc.tools) acc.tools = {};
37
- acc.tools[name] = tool;
38
- }
39
- }
40
- if (config.config) {
41
- acc.config = {
42
- ...acc.config,
43
- ...config.config
44
- };
45
- }
46
- if (config.callSettings) {
47
- acc.callSettings = {
48
- ...acc.callSettings,
49
- ...config.callSettings
50
- };
51
- }
52
- return acc;
53
- }, {});
54
- };
55
-
56
- export {
57
- LanguageModelV1CallSettingsSchema,
58
- LanguageModelConfigSchema,
59
- mergeModelConfigs
60
- };
61
- //# sourceMappingURL=chunk-BV6Y7C43.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/types/ModelConfigTypes.ts"],"sourcesContent":["import { z } from \"zod\";\nimport type { JSONSchema7 } from \"json-schema\";\n\nexport const LanguageModelV1CallSettingsSchema = z.object({\n maxTokens: z.number().int().positive().optional(),\n temperature: z.number().optional(),\n topP: z.number().optional(),\n presencePenalty: z.number().optional(),\n frequencyPenalty: z.number().optional(),\n seed: z.number().int().optional(),\n headers: z.record(z.string().optional()).optional(),\n});\n\nexport type LanguageModelV1CallSettings = z.infer<\n typeof LanguageModelV1CallSettingsSchema\n>;\n\nexport const LanguageModelConfigSchema = z.object({\n apiKey: z.string().optional(),\n baseUrl: z.string().optional(),\n modelName: z.string().optional(),\n});\n\nexport type LanguageModelConfig = z.infer<typeof LanguageModelConfigSchema>;\n\ntype ToolExecuteFunction<TArgs, TResult> = (\n args: TArgs,\n) => TResult | Promise<TResult>;\n\nexport type Tool<\n TArgs extends Record<string, unknown> = Record<string | number, unknown>,\n TResult = unknown,\n> = {\n description?: string | undefined;\n parameters: z.ZodSchema<TArgs> | JSONSchema7;\n execute?: ToolExecuteFunction<TArgs, TResult>;\n};\n\nexport type ModelConfig = {\n priority?: number | undefined;\n system?: string | undefined;\n tools?: Record<string, Tool<any, any>> | undefined;\n callSettings?: LanguageModelV1CallSettings | undefined;\n config?: LanguageModelConfig | undefined;\n};\n\nexport type ModelConfigProvider = { getModelConfig: () => ModelConfig };\n\nexport const mergeModelConfigs = (\n configSet: Set<ModelConfigProvider>,\n): ModelConfig => {\n const configs = Array.from(configSet)\n .map((c) => c.getModelConfig())\n .sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));\n\n return configs.reduce((acc, config) => {\n if (config.system) {\n if (acc.system) {\n // TODO should the separator be configurable?\n acc.system += `\\n\\n${config.system}`;\n } else {\n acc.system = config.system;\n }\n }\n if (config.tools) {\n for (const [name, tool] of Object.entries(config.tools)) {\n if (acc.tools?.[name]) {\n throw new Error(\n `You tried to define a tool with the name ${name}, but it already exists.`,\n );\n }\n if (!acc.tools) acc.tools = {};\n acc.tools[name] = tool;\n }\n }\n if (config.config) {\n acc.config = {\n ...acc.config,\n ...config.config,\n };\n }\n if (config.callSettings) {\n acc.callSettings = {\n ...acc.callSettings,\n ...config.callSettings,\n };\n }\n return acc;\n }, {} as ModelConfig);\n};\n"],"mappings":";AAAA,SAAS,SAAS;AAGX,IAAM,oCAAoC,EAAE,OAAO;AAAA,EACxD,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS;AAAA,EAChD,aAAa,EAAE,OAAO,EAAE,SAAS;AAAA,EACjC,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,EAC1B,iBAAiB,EAAE,OAAO,EAAE,SAAS;AAAA,EACrC,kBAAkB,EAAE,OAAO,EAAE,SAAS;AAAA,EACtC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EAChC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,SAAS;AACpD,CAAC;AAMM,IAAM,4BAA4B,EAAE,OAAO;AAAA,EAChD,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,WAAW,EAAE,OAAO,EAAE,SAAS;AACjC,CAAC;AA2BM,IAAM,oBAAoB,CAC/B,cACgB;AAChB,QAAM,UAAU,MAAM,KAAK,SAAS,EACjC,IAAI,CAAC,MAAM,EAAE,eAAe,CAAC,EAC7B,KAAK,CAAC,GAAG,OAAO,EAAE,YAAY,MAAM,EAAE,YAAY,EAAE;AAEvD,SAAO,QAAQ,OAAO,CAAC,KAAK,WAAW;AACrC,QAAI,OAAO,QAAQ;AACjB,UAAI,IAAI,QAAQ;AAEd,YAAI,UAAU;AAAA;AAAA,EAAO,OAAO,MAAM;AAAA,MACpC,OAAO;AACL,YAAI,SAAS,OAAO;AAAA,MACtB;AAAA,IACF;AACA,QAAI,OAAO,OAAO;AAChB,iBAAW,CAAC,MAAM,IAAI,KAAK,OAAO,QAAQ,OAAO,KAAK,GAAG;AACvD,YAAI,IAAI,QAAQ,IAAI,GAAG;AACrB,gBAAM,IAAI;AAAA,YACR,4CAA4C,IAAI;AAAA,UAClD;AAAA,QACF;AACA,YAAI,CAAC,IAAI,MAAO,KAAI,QAAQ,CAAC;AAC7B,YAAI,MAAM,IAAI,IAAI;AAAA,MACpB;AAAA,IACF;AACA,QAAI,OAAO,QAAQ;AACjB,UAAI,SAAS;AAAA,QACX,GAAG,IAAI;AAAA,QACP,GAAG,OAAO;AAAA,MACZ;AAAA,IACF;AACA,QAAI,OAAO,cAAc;AACvB,UAAI,eAAe;AAAA,QACjB,GAAG,IAAI;AAAA,QACP,GAAG,OAAO;AAAA,MACZ;AAAA,IACF;AACA,WAAO;AAAA,EACT,GAAG,CAAC,CAAgB;AACtB;","names":[]}
@@ -1,128 +0,0 @@
1
- import { M as ModelConfigProvider, c as ModelConfig, d as ThreadMessage, C as CoreMessage, A as AppendMessage, e as ContentPartStatus, f as TextContentPart } from './ModelConfigTypes-ComYH1b6.mjs';
2
- import * as react from 'react';
3
- import { ComponentType } from 'react';
4
- import * as class_variance_authority from 'class-variance-authority';
5
- import * as class_variance_authority_types from 'class-variance-authority/types';
6
- import '@ai-sdk/provider';
7
- import 'zod';
8
- import 'json-schema';
9
-
10
- type Unsubscribe = () => void;
11
-
12
- declare class ProxyConfigProvider implements ModelConfigProvider {
13
- private _providers;
14
- getModelConfig(): ModelConfig;
15
- registerModelConfigProvider(provider: ModelConfigProvider): () => void;
16
- }
17
-
18
- declare class MessageRepository {
19
- private messages;
20
- private head;
21
- private root;
22
- private performOp;
23
- getMessages(): ThreadMessage[];
24
- addOrUpdateMessage(parentId: string | null, message: ThreadMessage): void;
25
- getMessage(messageId: string): {
26
- parentId: string | null;
27
- message: ThreadMessage;
28
- };
29
- appendOptimisticMessage(parentId: string | null, message: CoreMessage): string;
30
- deleteMessage(messageId: string, replacementId?: string | null | undefined): void;
31
- getBranches(messageId: string): string[];
32
- switchToBranch(messageId: string): void;
33
- resetHead(messageId: string | null): void;
34
- }
35
-
36
- type ReactThreadRuntime = ThreadRuntime & {
37
- unstable_synchronizer?: ComponentType;
38
- };
39
-
40
- type AddToolResultOptions = {
41
- messageId: string;
42
- toolCallId: string;
43
- result: any;
44
- };
45
- type RuntimeCapabilities = {
46
- switchToBranch: boolean;
47
- edit: boolean;
48
- reload: boolean;
49
- cancel: boolean;
50
- copy: boolean;
51
- };
52
- type ThreadActionsState = Readonly<{
53
- capabilities: Readonly<RuntimeCapabilities>;
54
- getBranches: (messageId: string) => readonly string[];
55
- switchToBranch: (branchId: string) => void;
56
- append: (message: AppendMessage) => void;
57
- startRun: (parentId: string | null) => void;
58
- cancelRun: () => void;
59
- addToolResult: (options: AddToolResultOptions) => void;
60
- }>;
61
-
62
- type ThreadState = Readonly<{
63
- isRunning: boolean;
64
- isDisabled: boolean;
65
- }>;
66
-
67
- type TextContentPartState = Readonly<{
68
- status: ContentPartStatus;
69
- part: TextContentPart;
70
- }>;
71
-
72
- type ThreadRuntime = Readonly<ThreadState & Omit<ThreadActionsState, "getRuntime"> & {
73
- messages: readonly ThreadMessage[];
74
- subscribe: (callback: () => void) => Unsubscribe;
75
- }>;
76
-
77
- type ThreadRuntimeWithSubscribe = {
78
- readonly thread: ThreadRuntime;
79
- subscribe: (callback: () => void) => Unsubscribe;
80
- };
81
- type AssistantRuntime = ThreadRuntimeWithSubscribe & {
82
- switchToThread: (threadId: string | null) => void;
83
- registerModelConfigProvider: (provider: ModelConfigProvider) => Unsubscribe;
84
- };
85
-
86
- declare abstract class BaseAssistantRuntime<TThreadRuntime extends ReactThreadRuntime> implements AssistantRuntime {
87
- private _thread;
88
- constructor(_thread: TThreadRuntime);
89
- get thread(): TThreadRuntime;
90
- set thread(thread: TThreadRuntime);
91
- abstract registerModelConfigProvider(provider: ModelConfigProvider): Unsubscribe;
92
- abstract switchToThread(threadId: string | null): void;
93
- private _subscriptions;
94
- subscribe(callback: () => void): Unsubscribe;
95
- private subscriptionHandler;
96
- }
97
-
98
- declare const useSmooth: (state: TextContentPartState, smooth?: boolean) => TextContentPartState;
99
-
100
- declare const withSmoothContextProvider: <C extends React.ComponentType<any>>(Component: C) => C;
101
- declare const useSmoothStatus: () => {
102
- type: "running";
103
- } | {
104
- type: "complete";
105
- } | {
106
- type: "incomplete";
107
- reason: "cancelled" | "length" | "content-filter" | "other" | "error";
108
- error?: unknown;
109
- } | {
110
- type: "requires-action";
111
- reason: "tool-calls";
112
- };
113
-
114
- declare const TooltipIconButton: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
115
- 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;
116
- } & {
117
- asChild?: boolean;
118
- }, "ref"> & class_variance_authority.VariantProps<(props?: ({
119
- variant?: "default" | "outline" | "ghost" | null | undefined;
120
- size?: "default" | "icon" | null | undefined;
121
- } & class_variance_authority_types.ClassProp) | undefined) => string> & {
122
- tooltip: string;
123
- side?: "top" | "bottom" | "left" | "right";
124
- } & react.RefAttributes<HTMLButtonElement>>;
125
-
126
- declare const generateId: (size?: number) => string;
127
-
128
- export { BaseAssistantRuntime, MessageRepository, ProxyConfigProvider, TooltipIconButton, generateId, useSmooth, useSmoothStatus, withSmoothContextProvider };
@@ -1,128 +0,0 @@
1
- import { M as ModelConfigProvider, c as ModelConfig, d as ThreadMessage, C as CoreMessage, A as AppendMessage, e as ContentPartStatus, f as TextContentPart } from './ModelConfigTypes-ComYH1b6.js';
2
- import * as react from 'react';
3
- import { ComponentType } from 'react';
4
- import * as class_variance_authority from 'class-variance-authority';
5
- import * as class_variance_authority_types from 'class-variance-authority/types';
6
- import '@ai-sdk/provider';
7
- import 'zod';
8
- import 'json-schema';
9
-
10
- type Unsubscribe = () => void;
11
-
12
- declare class ProxyConfigProvider implements ModelConfigProvider {
13
- private _providers;
14
- getModelConfig(): ModelConfig;
15
- registerModelConfigProvider(provider: ModelConfigProvider): () => void;
16
- }
17
-
18
- declare class MessageRepository {
19
- private messages;
20
- private head;
21
- private root;
22
- private performOp;
23
- getMessages(): ThreadMessage[];
24
- addOrUpdateMessage(parentId: string | null, message: ThreadMessage): void;
25
- getMessage(messageId: string): {
26
- parentId: string | null;
27
- message: ThreadMessage;
28
- };
29
- appendOptimisticMessage(parentId: string | null, message: CoreMessage): string;
30
- deleteMessage(messageId: string, replacementId?: string | null | undefined): void;
31
- getBranches(messageId: string): string[];
32
- switchToBranch(messageId: string): void;
33
- resetHead(messageId: string | null): void;
34
- }
35
-
36
- type ReactThreadRuntime = ThreadRuntime & {
37
- unstable_synchronizer?: ComponentType;
38
- };
39
-
40
- type AddToolResultOptions = {
41
- messageId: string;
42
- toolCallId: string;
43
- result: any;
44
- };
45
- type RuntimeCapabilities = {
46
- switchToBranch: boolean;
47
- edit: boolean;
48
- reload: boolean;
49
- cancel: boolean;
50
- copy: boolean;
51
- };
52
- type ThreadActionsState = Readonly<{
53
- capabilities: Readonly<RuntimeCapabilities>;
54
- getBranches: (messageId: string) => readonly string[];
55
- switchToBranch: (branchId: string) => void;
56
- append: (message: AppendMessage) => void;
57
- startRun: (parentId: string | null) => void;
58
- cancelRun: () => void;
59
- addToolResult: (options: AddToolResultOptions) => void;
60
- }>;
61
-
62
- type ThreadState = Readonly<{
63
- isRunning: boolean;
64
- isDisabled: boolean;
65
- }>;
66
-
67
- type TextContentPartState = Readonly<{
68
- status: ContentPartStatus;
69
- part: TextContentPart;
70
- }>;
71
-
72
- type ThreadRuntime = Readonly<ThreadState & Omit<ThreadActionsState, "getRuntime"> & {
73
- messages: readonly ThreadMessage[];
74
- subscribe: (callback: () => void) => Unsubscribe;
75
- }>;
76
-
77
- type ThreadRuntimeWithSubscribe = {
78
- readonly thread: ThreadRuntime;
79
- subscribe: (callback: () => void) => Unsubscribe;
80
- };
81
- type AssistantRuntime = ThreadRuntimeWithSubscribe & {
82
- switchToThread: (threadId: string | null) => void;
83
- registerModelConfigProvider: (provider: ModelConfigProvider) => Unsubscribe;
84
- };
85
-
86
- declare abstract class BaseAssistantRuntime<TThreadRuntime extends ReactThreadRuntime> implements AssistantRuntime {
87
- private _thread;
88
- constructor(_thread: TThreadRuntime);
89
- get thread(): TThreadRuntime;
90
- set thread(thread: TThreadRuntime);
91
- abstract registerModelConfigProvider(provider: ModelConfigProvider): Unsubscribe;
92
- abstract switchToThread(threadId: string | null): void;
93
- private _subscriptions;
94
- subscribe(callback: () => void): Unsubscribe;
95
- private subscriptionHandler;
96
- }
97
-
98
- declare const useSmooth: (state: TextContentPartState, smooth?: boolean) => TextContentPartState;
99
-
100
- declare const withSmoothContextProvider: <C extends React.ComponentType<any>>(Component: C) => C;
101
- declare const useSmoothStatus: () => {
102
- type: "running";
103
- } | {
104
- type: "complete";
105
- } | {
106
- type: "incomplete";
107
- reason: "cancelled" | "length" | "content-filter" | "other" | "error";
108
- error?: unknown;
109
- } | {
110
- type: "requires-action";
111
- reason: "tool-calls";
112
- };
113
-
114
- declare const TooltipIconButton: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
115
- 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;
116
- } & {
117
- asChild?: boolean;
118
- }, "ref"> & class_variance_authority.VariantProps<(props?: ({
119
- variant?: "default" | "outline" | "ghost" | null | undefined;
120
- size?: "default" | "icon" | null | undefined;
121
- } & class_variance_authority_types.ClassProp) | undefined) => string> & {
122
- tooltip: string;
123
- side?: "top" | "bottom" | "left" | "right";
124
- } & react.RefAttributes<HTMLButtonElement>>;
125
-
126
- declare const generateId: (size?: number) => string;
127
-
128
- export { BaseAssistantRuntime, MessageRepository, ProxyConfigProvider, TooltipIconButton, generateId, useSmooth, useSmoothStatus, withSmoothContextProvider };