@copilotkit/react-core 2.0.0-rc.41 → 2.0.0-rc.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{MarkdownRendererContext-BL8ct_3U.d.mts → MarkdownRendererContext-CytkPOAJ.d.mts} +1 -1
- package/dist/{MarkdownRendererContext-BL8ct_3U.d.mts.map → MarkdownRendererContext-CytkPOAJ.d.mts.map} +1 -1
- package/dist/MarkdownSurfaces-DlYqJkAE.mjs +135 -0
- package/dist/MarkdownSurfaces-DlYqJkAE.mjs.map +1 -0
- package/dist/MarkdownSurfaces-DytbRzj2.cjs +141 -0
- package/dist/MarkdownSurfaces-DytbRzj2.cjs.map +1 -0
- package/dist/{MarkdownSurfaces-Byz821bg.mjs → ProviderMarkdown-BZaPDROY.mjs} +6 -132
- package/dist/ProviderMarkdown-BZaPDROY.mjs.map +1 -0
- package/dist/{MarkdownSurfaces-D2Ck-cbb.cjs → ProviderMarkdown-i_i2osOH.cjs} +4 -136
- package/dist/ProviderMarkdown-i_i2osOH.cjs.map +1 -0
- package/dist/accessibility-BLK-gE0R.mjs +129 -0
- package/dist/accessibility-BLK-gE0R.mjs.map +1 -0
- package/dist/accessibility-GnodqxkH.cjs +228 -0
- package/dist/accessibility-GnodqxkH.cjs.map +1 -0
- package/dist/{chat-Bf0vVdo7.mjs → chat-B1zczXUD.mjs} +21 -145
- package/dist/chat-B1zczXUD.mjs.map +1 -0
- package/dist/{chat-DgP2N7bD.d.mts → chat-C5XWeO1M.d.mts} +1 -1
- package/dist/{chat-DgP2N7bD.d.mts.map → chat-C5XWeO1M.d.mts.map} +1 -1
- package/dist/{chat-D3fxo6Ah.cjs → chat-CkFZMo5E.cjs} +29 -234
- package/dist/chat-CkFZMo5E.cjs.map +1 -0
- package/dist/context.cjs +2 -2
- package/dist/context.cjs.map +1 -1
- package/dist/context.d.cts +2 -2
- package/dist/context.d.mts +2 -2
- package/dist/context.mjs +2 -2
- package/dist/context.mjs.map +1 -1
- package/dist/generative-ui/native.cjs +9 -8
- package/dist/generative-ui/native.cjs.map +1 -1
- package/dist/generative-ui/native.d.cts.map +1 -1
- package/dist/generative-ui/native.d.mts +2 -2
- package/dist/generative-ui/native.d.mts.map +1 -1
- package/dist/generative-ui/native.mjs +4 -3
- package/dist/generative-ui/native.mjs.map +1 -1
- package/dist/generative-ui.cjs +11 -5767
- package/dist/generative-ui.cjs.map +1 -1
- package/dist/generative-ui.d.mts +4 -4
- package/dist/generative-ui.mjs +8 -5764
- package/dist/generative-ui.mjs.map +1 -1
- package/dist/{hooks-BRYonCVu.d.mts → hooks-DqsOIh8A.d.mts} +3 -3
- package/dist/{hooks-BRYonCVu.d.mts.map → hooks-DqsOIh8A.d.mts.map} +1 -1
- package/dist/index.cjs +180 -681
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -102
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +11 -104
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +64 -407
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +6132 -795
- package/dist/index.umd.js.map +1 -1
- package/dist/{refs-BIUfn1wb.cjs → refs-B5Dn59Pn.cjs} +2 -2
- package/dist/{refs-BIUfn1wb.cjs.map → refs-B5Dn59Pn.cjs.map} +1 -1
- package/dist/{refs-CMrRm3ta.mjs → refs-BW15wX_V.mjs} +1 -1
- package/dist/{refs-CMrRm3ta.mjs.map → refs-BW15wX_V.mjs.map} +1 -1
- package/dist/standard-CqGTZUZy.cjs +5780 -0
- package/dist/standard-CqGTZUZy.cjs.map +1 -0
- package/dist/standard-s8jByRiE.mjs +5784 -0
- package/dist/standard-s8jByRiE.mjs.map +1 -0
- package/dist/{use-generative-ui-root-C12htqbK.cjs → use-generative-ui-root-CIp0ytE6.cjs} +3 -3
- package/dist/{use-generative-ui-root-C12htqbK.cjs.map → use-generative-ui-root-CIp0ytE6.cjs.map} +1 -1
- package/dist/{use-generative-ui-root-CVgsDy1f.mjs → use-generative-ui-root-oBqPa6uy.mjs} +3 -2
- package/dist/{use-generative-ui-root-CVgsDy1f.mjs.map → use-generative-ui-root-oBqPa6uy.mjs.map} +1 -1
- package/package.json +7 -10
- package/dist/MarkdownSurfaces-Byz821bg.mjs.map +0 -1
- package/dist/MarkdownSurfaces-D2Ck-cbb.cjs.map +0 -1
- package/dist/chat-Bf0vVdo7.mjs.map +0 -1
- package/dist/chat-D3fxo6Ah.cjs.map +0 -1
|
@@ -1,85 +1,20 @@
|
|
|
1
|
-
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
-
key = keys[i];
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
-
__defProp(to, key, {
|
|
14
|
-
get: ((k) => from[k]).bind(null, key),
|
|
15
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
-
value: mod,
|
|
24
|
-
enumerable: true
|
|
25
|
-
}) : target, mod));
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
1
|
+
const require_accessibility = require('./accessibility-GnodqxkH.cjs');
|
|
28
2
|
let _copilotkit_core = require("@copilotkit/core");
|
|
29
3
|
let react = require("react");
|
|
30
|
-
react = __toESM(react);
|
|
4
|
+
react = require_accessibility.__toESM(react);
|
|
31
5
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
32
6
|
let _copilotkit_react_core_context = require("@copilotkit/react-core/context");
|
|
33
7
|
let _copilotkit_shared = require("@copilotkit/shared");
|
|
34
|
-
let zod = require("zod");
|
|
35
|
-
zod = __toESM(zod);
|
|
36
8
|
let _copilotkit_core_generative_ui = require("@copilotkit/core/generative-ui");
|
|
37
9
|
let _copilotkit_shared_generative_ui = require("@copilotkit/shared/generative-ui");
|
|
10
|
+
let zod = require("zod");
|
|
11
|
+
zod = require_accessibility.__toESM(zod);
|
|
38
12
|
|
|
39
|
-
//#region src/lib/shallow-stable-ref.ts
|
|
40
|
-
/**
|
|
41
|
-
* Shallow equality comparison for objects: same own keys, each holding the
|
|
42
|
-
* same value (`Object.is`). Core's `ɵshallowEqualRecord` holds the rule.
|
|
43
|
-
*/
|
|
44
|
-
function shallowEqual(obj1, obj2) {
|
|
45
|
-
return (0, _copilotkit_core.ɵshallowEqualRecord)(obj1, obj2);
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Returns true only for plain JS objects (`{}`), excluding arrays, Dates,
|
|
49
|
-
* class instances, and other exotic objects that happen to have typeof "object".
|
|
50
|
-
*/
|
|
51
|
-
function isPlainObject(obj) {
|
|
52
|
-
return obj !== null && typeof obj === "object" && Object.prototype.toString.call(obj) === "[object Object]";
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Returns the same reference as long as the value is shallowly equal to the
|
|
56
|
-
* previous render's value.
|
|
57
|
-
*
|
|
58
|
-
* - Identical references bail out immediately (O(1)).
|
|
59
|
-
* - Plain objects ({}) are shallow-compared key-by-key.
|
|
60
|
-
* - Arrays, Dates, class instances, functions, and primitives are compared by
|
|
61
|
-
* reference only — shallowEqual is never called on non-plain objects, which
|
|
62
|
-
* avoids incorrect equality for e.g. [1,2] vs [1,2] (different arrays).
|
|
63
|
-
*
|
|
64
|
-
* Typical use: stabilize inline slot props so MemoizedSlotWrapper's shallow
|
|
65
|
-
* equality check isn't defeated by a new object reference on every render.
|
|
66
|
-
*/
|
|
67
|
-
function useShallowStableRef(value) {
|
|
68
|
-
const ref = (0, react.useRef)(value);
|
|
69
|
-
if (ref.current === value) return ref.current;
|
|
70
|
-
if (isPlainObject(ref.current) && isPlainObject(value)) {
|
|
71
|
-
if (shallowEqual(ref.current, value)) return ref.current;
|
|
72
|
-
}
|
|
73
|
-
ref.current = value;
|
|
74
|
-
return ref.current;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
//#endregion
|
|
78
13
|
//#region src/providers/CopilotChatConfigurationProvider.tsx
|
|
79
14
|
const CopilotChatConfiguration = (0, react.createContext)(null);
|
|
80
15
|
const CopilotChatConfigurationProvider = ({ children, labels, agentId, threadId, hasExplicitThreadId, isModalDefaultOpen }) => {
|
|
81
16
|
const parentConfig = (0, react.useContext)(CopilotChatConfiguration);
|
|
82
|
-
const stableLabels = useShallowStableRef(labels);
|
|
17
|
+
const stableLabels = require_accessibility.useShallowStableRef(labels);
|
|
83
18
|
const mergedLabels = (0, react.useMemo)(() => ({
|
|
84
19
|
..._copilotkit_core.CopilotChatDefaultLabels,
|
|
85
20
|
...parentConfig?.labels,
|
|
@@ -213,32 +148,6 @@ const ControlledModalOpenScope = ({ children, open, onOpenChange }) => {
|
|
|
213
148
|
};
|
|
214
149
|
ControlledModalOpenScope.displayName = "ControlledModalOpenScope";
|
|
215
150
|
|
|
216
|
-
//#endregion
|
|
217
|
-
//#region src/types/defineToolCallRenderer.ts
|
|
218
|
-
function defineToolCallRenderer(def) {
|
|
219
|
-
const argsSchema = def.name === "*" && !def.args ? _copilotkit_shared.ɵanySchema : def.args;
|
|
220
|
-
return {
|
|
221
|
-
name: def.name,
|
|
222
|
-
args: argsSchema,
|
|
223
|
-
render: def.render,
|
|
224
|
-
...def.agentId ? { agentId: def.agentId } : {},
|
|
225
|
-
...def.group ? { group: true } : {}
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
//#endregion
|
|
230
|
-
//#region src/generative-ui/runtime-context.ts
|
|
231
|
-
const GenerativeUIRuntimeContext = (0, react.createContext)(null);
|
|
232
|
-
function useGenerativeUIRuntime() {
|
|
233
|
-
return (0, react.useContext)(GenerativeUIRuntimeContext);
|
|
234
|
-
}
|
|
235
|
-
function useRequiredGenerativeUIRuntime() {
|
|
236
|
-
const runtime = (0, react.useContext)(GenerativeUIRuntimeContext);
|
|
237
|
-
if (!runtime) throw new Error("Generative UI components must be rendered inside a generative UI provider: <CopilotKitProvider generativeUI={{ ui }}> on the web, or <GenerativeUIProvider> from @copilotkit/react-native/generative-ui on React Native.");
|
|
238
|
-
return runtime;
|
|
239
|
-
}
|
|
240
|
-
const GenerativeUINodeContext = (0, react.createContext)(null);
|
|
241
|
-
|
|
242
151
|
//#endregion
|
|
243
152
|
//#region src/generative-ui/hooks.ts
|
|
244
153
|
const noopSubscribe$1 = () => () => {};
|
|
@@ -266,7 +175,7 @@ function useManagerVersion(runtime) {
|
|
|
266
175
|
* ```
|
|
267
176
|
*/
|
|
268
177
|
function useGenerativeUIState(ui, key, value) {
|
|
269
|
-
const runtime = useRequiredGenerativeUIRuntime();
|
|
178
|
+
const runtime = require_accessibility.useRequiredGenerativeUIRuntime();
|
|
270
179
|
const serialized = JSON.stringify(value);
|
|
271
180
|
(0, react.useEffect)(() => {
|
|
272
181
|
const raw = JSON.parse(serialized ?? "null");
|
|
@@ -320,7 +229,7 @@ function useGenerativeUIState(ui, key, value) {
|
|
|
320
229
|
* ```
|
|
321
230
|
*/
|
|
322
231
|
function useGenerativeUIFunction(ui, name, handler) {
|
|
323
|
-
const runtime = useRequiredGenerativeUIRuntime();
|
|
232
|
+
const runtime = require_accessibility.useRequiredGenerativeUIRuntime();
|
|
324
233
|
const latest = (0, react.useRef)(handler);
|
|
325
234
|
latest.current = handler;
|
|
326
235
|
(0, react.useEffect)(() => runtime.dispatcher.register(name, latest), [runtime, name]);
|
|
@@ -380,51 +289,16 @@ function useGenerativeUIActivitySurface({ runtime, threadId, agentId, content, t
|
|
|
380
289
|
}
|
|
381
290
|
|
|
382
291
|
//#endregion
|
|
383
|
-
//#region src/
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
* `GenerativeUIComponentDefinition.writable`.
|
|
394
|
-
*
|
|
395
|
-
* The model does not see bound props or matched events.
|
|
396
|
-
*
|
|
397
|
-
* @param config - `id`, then optional `extends`, `state`, `functions` and
|
|
398
|
-
* `overrides`, then `components`. Put `state` before `components`, so the selectors
|
|
399
|
-
* get typed state.
|
|
400
|
-
* @throws Error when a name comes from two places, an override names no
|
|
401
|
-
* component of the bases, `props` is not an object
|
|
402
|
-
* schema with a JSON Schema, a key is reserved or used
|
|
403
|
-
* twice on a component, an event matches two functions, an unmatched event
|
|
404
|
-
* has no `parameters`, a `bind` key is not a prop, a `writable` key is not
|
|
405
|
-
* a prop or is a bound prop, or a setter name is already a key of the
|
|
406
|
-
* component. Also throws when `parameterOrder` contains duplicate or unknown
|
|
407
|
-
* keys, or an ordered component declares integer-index keys whose JSON object
|
|
408
|
-
* enumeration order cannot be controlled.
|
|
409
|
-
*
|
|
410
|
-
* @example
|
|
411
|
-
* ```ts
|
|
412
|
-
* const ui = createGenerativeUI({
|
|
413
|
-
* id: "acme/store@1",
|
|
414
|
-
* state: { cart: cartSchema },
|
|
415
|
-
* functions: { addToCart: { parameters: z.object({ productId: z.string() }) } },
|
|
416
|
-
* components: {
|
|
417
|
-
* CartSummary: {
|
|
418
|
-
* component: CartSummary,
|
|
419
|
-
* props: z.object({ count: z.number() }),
|
|
420
|
-
* bind: { count: (state) => state.cart.count },
|
|
421
|
-
* },
|
|
422
|
-
* },
|
|
423
|
-
* });
|
|
424
|
-
* ```
|
|
425
|
-
*/
|
|
426
|
-
function createGenerativeUI(config) {
|
|
427
|
-
return (0, _copilotkit_shared_generative_ui.createGenerativeUI)(config);
|
|
292
|
+
//#region src/types/defineToolCallRenderer.ts
|
|
293
|
+
function defineToolCallRenderer(def) {
|
|
294
|
+
const argsSchema = def.name === "*" && !def.args ? _copilotkit_shared.ɵanySchema : def.args;
|
|
295
|
+
return {
|
|
296
|
+
name: def.name,
|
|
297
|
+
args: argsSchema,
|
|
298
|
+
render: def.render,
|
|
299
|
+
...def.agentId ? { agentId: def.agentId } : {},
|
|
300
|
+
...def.group ? { group: true } : {}
|
|
301
|
+
};
|
|
428
302
|
}
|
|
429
303
|
|
|
430
304
|
//#endregion
|
|
@@ -825,28 +699,6 @@ var SurfaceBoundary = class extends react.Component {
|
|
|
825
699
|
}
|
|
826
700
|
};
|
|
827
701
|
|
|
828
|
-
//#endregion
|
|
829
|
-
//#region src/generative-ui/accessibility.ts
|
|
830
|
-
/**
|
|
831
|
-
* Experimental. The ARIA attributes of the `accessibility` that the model
|
|
832
|
-
* gave the component being rendered, to spread on its root element. The
|
|
833
|
-
* standard components do this; a custom component does it itself:
|
|
834
|
-
*
|
|
835
|
-
* @example
|
|
836
|
-
* ```tsx
|
|
837
|
-
* function Panel({ children }: { children?: ReactNode }) {
|
|
838
|
-
* const aria = useGenerativeUIAccessibility();
|
|
839
|
-
* return <section {...aria}>{children}</section>;
|
|
840
|
-
* }
|
|
841
|
-
* ```
|
|
842
|
-
*
|
|
843
|
-
* Outside of generated UI it gives `{}`.
|
|
844
|
-
*/
|
|
845
|
-
function useGenerativeUIAccessibility() {
|
|
846
|
-
const accessibility = (0, react.useContext)(GenerativeUINodeContext)?.accessibility;
|
|
847
|
-
return (0, react.useMemo)(() => (0, _copilotkit_core_generative_ui.accessibilityAttributes)(accessibility), [accessibility]);
|
|
848
|
-
}
|
|
849
|
-
|
|
850
702
|
//#endregion
|
|
851
703
|
//#region src/generative-ui/SurfaceView.tsx
|
|
852
704
|
const NO_ANCESTORS = [];
|
|
@@ -858,7 +710,7 @@ function isTemplateChildren(value) {
|
|
|
858
710
|
return typeof value === "object" && value !== null && "componentId" in value && typeof value.componentId === "string" && "path" in value && typeof value.path === "string";
|
|
859
711
|
}
|
|
860
712
|
function SurfaceView({ surface }) {
|
|
861
|
-
const runtime = useRequiredGenerativeUIRuntime();
|
|
713
|
+
const runtime = require_accessibility.useRequiredGenerativeUIRuntime();
|
|
862
714
|
const { SurfaceRoot } = useGenerativeUIHost();
|
|
863
715
|
const appliedCount = (0, react.useSyncExternalStore)(runtime.manager.subscribe, () => surface.operations.length, undefinedSnapshot);
|
|
864
716
|
const revision = (0, react.useMemo)(() => ({
|
|
@@ -936,18 +788,15 @@ function SurfaceView({ surface }) {
|
|
|
936
788
|
});
|
|
937
789
|
}
|
|
938
790
|
/**
|
|
939
|
-
* Resolves a component by id. Subscribes to the manager
|
|
940
|
-
*
|
|
941
|
-
*
|
|
942
|
-
* same
|
|
943
|
-
* visible inside synchronous flushes such as `act()` / `flushSync`, where the
|
|
944
|
-
* old tree would still be on screen, but it makes updates order-dependent.
|
|
945
|
-
* The manager notifies synchronously once an ingest has been fully applied.
|
|
791
|
+
* Resolves a component by id. Subscribes to the manager, which notifies
|
|
792
|
+
* synchronously once an ingest has been fully applied, so every subscriber
|
|
793
|
+
* (one per slotted child, or one per mount of the same surface) sees the
|
|
794
|
+
* same, complete update. The components model has no events of its own.
|
|
946
795
|
*/
|
|
947
796
|
function useComponentModel(manager, model, id) {
|
|
948
797
|
return (0, react.useSyncExternalStore)(manager.subscribe, () => model.componentsModel.get(id), undefinedSnapshot);
|
|
949
798
|
}
|
|
950
|
-
/** Same reasoning as `useComponentModel`:
|
|
799
|
+
/** Same reasoning as `useComponentModel`: the manager notifies. */
|
|
951
800
|
function useComponentProperties(manager, component) {
|
|
952
801
|
return (0, react.useSyncExternalStore)(manager.subscribe, () => component?.properties, undefinedSnapshot);
|
|
953
802
|
}
|
|
@@ -972,7 +821,7 @@ function placeOf(parentPlace, via, position) {
|
|
|
972
821
|
return `${parentPlace}/${via === "" ? "" : JSON.stringify(via)}${position}`;
|
|
973
822
|
}
|
|
974
823
|
const NodeView = (0, react.memo)(function NodeView({ surface, componentId, basePath, ancestors, parentPlace, via }) {
|
|
975
|
-
const runtime = useRequiredGenerativeUIRuntime();
|
|
824
|
+
const runtime = require_accessibility.useRequiredGenerativeUIRuntime();
|
|
976
825
|
const log = useFailureLog();
|
|
977
826
|
const component = useComponentModel(runtime.manager, surface.model, componentId);
|
|
978
827
|
const properties = useComponentProperties(runtime.manager, component);
|
|
@@ -1157,7 +1006,7 @@ function useModelDataProps(surface, definition, properties, basePath, overrides)
|
|
|
1157
1006
|
problem
|
|
1158
1007
|
};
|
|
1159
1008
|
const last = stable.current;
|
|
1160
|
-
if (!(result.ok && last.ok ? shallowEqual(last.values, result.values) && shallowEqual(last.accessibility ?? {}, result.accessibility ?? {}) : !result.ok && !last.ok && last.problem === result.problem)) stable.current = result;
|
|
1009
|
+
if (!(result.ok && last.ok ? require_accessibility.shallowEqual(last.values, result.values) && require_accessibility.shallowEqual(last.accessibility ?? {}, result.accessibility ?? {}) : !result.ok && !last.ok && last.problem === result.problem)) stable.current = result;
|
|
1161
1010
|
return stable.current;
|
|
1162
1011
|
}
|
|
1163
1012
|
const NO_SELECTION = {
|
|
@@ -1165,7 +1014,7 @@ const NO_SELECTION = {
|
|
|
1165
1014
|
values: {}
|
|
1166
1015
|
};
|
|
1167
1016
|
function isSameSelection(a, b) {
|
|
1168
|
-
if (a.ok && b.ok) return shallowEqual(a.values, b.values);
|
|
1017
|
+
if (a.ok && b.ok) return require_accessibility.shallowEqual(a.values, b.values);
|
|
1169
1018
|
if (!a.ok && !b.ok) return a.problem === b.problem;
|
|
1170
1019
|
return false;
|
|
1171
1020
|
}
|
|
@@ -1548,7 +1397,7 @@ function ResolvedNode({ surface, componentId, definition, properties, runtime, b
|
|
|
1548
1397
|
...setters
|
|
1549
1398
|
});
|
|
1550
1399
|
const hasEnvelope = properties.accessibility !== void 0 && definition.accessibility !== "self";
|
|
1551
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GenerativeUINodeContext.Provider, {
|
|
1400
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_accessibility.GenerativeUINodeContext.Provider, {
|
|
1552
1401
|
value: nodeContext,
|
|
1553
1402
|
children: hasEnvelope ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AccessibilityWrapper, {
|
|
1554
1403
|
attributes: (0, _copilotkit_core_generative_ui.wrapperAria)((0, _copilotkit_core_generative_ui.accessibilityAttributes)(accessibility)),
|
|
@@ -1572,7 +1421,7 @@ function DefaultGenerativeUIChatCard({ surfaceId, error, children }) {
|
|
|
1572
1421
|
});
|
|
1573
1422
|
}
|
|
1574
1423
|
function GenerativeUIChatActivity({ content, agent }) {
|
|
1575
|
-
const runtime = useGenerativeUIRuntime();
|
|
1424
|
+
const runtime = require_accessibility.useGenerativeUIRuntime();
|
|
1576
1425
|
const threadId = useCopilotChatConfiguration()?.threadId ?? agent?.threadId;
|
|
1577
1426
|
const Wrapper = (0, react.useContext)(GenerativeUIChatSlotContext) ?? DefaultGenerativeUIChatCard;
|
|
1578
1427
|
const { surface, rejected, error } = useGenerativeUIActivitySurface({
|
|
@@ -1655,18 +1504,6 @@ Object.defineProperty(exports, 'GenerativeUIHostContext', {
|
|
|
1655
1504
|
return GenerativeUIHostContext;
|
|
1656
1505
|
}
|
|
1657
1506
|
});
|
|
1658
|
-
Object.defineProperty(exports, 'GenerativeUINodeContext', {
|
|
1659
|
-
enumerable: true,
|
|
1660
|
-
get: function () {
|
|
1661
|
-
return GenerativeUINodeContext;
|
|
1662
|
-
}
|
|
1663
|
-
});
|
|
1664
|
-
Object.defineProperty(exports, 'GenerativeUIRuntimeContext', {
|
|
1665
|
-
enumerable: true,
|
|
1666
|
-
get: function () {
|
|
1667
|
-
return GenerativeUIRuntimeContext;
|
|
1668
|
-
}
|
|
1669
|
-
});
|
|
1670
1507
|
Object.defineProperty(exports, 'GenerativeUIToolCallRenderer', {
|
|
1671
1508
|
enumerable: true,
|
|
1672
1509
|
get: function () {
|
|
@@ -1679,18 +1516,6 @@ Object.defineProperty(exports, 'SurfaceView', {
|
|
|
1679
1516
|
return SurfaceView;
|
|
1680
1517
|
}
|
|
1681
1518
|
});
|
|
1682
|
-
Object.defineProperty(exports, '__toESM', {
|
|
1683
|
-
enumerable: true,
|
|
1684
|
-
get: function () {
|
|
1685
|
-
return __toESM;
|
|
1686
|
-
}
|
|
1687
|
-
});
|
|
1688
|
-
Object.defineProperty(exports, 'createGenerativeUI', {
|
|
1689
|
-
enumerable: true,
|
|
1690
|
-
get: function () {
|
|
1691
|
-
return createGenerativeUI;
|
|
1692
|
-
}
|
|
1693
|
-
});
|
|
1694
1519
|
Object.defineProperty(exports, 'createGenerativeUIActivityRenderer', {
|
|
1695
1520
|
enumerable: true,
|
|
1696
1521
|
get: function () {
|
|
@@ -1709,24 +1534,12 @@ Object.defineProperty(exports, 'defineToolCallRenderer', {
|
|
|
1709
1534
|
return defineToolCallRenderer;
|
|
1710
1535
|
}
|
|
1711
1536
|
});
|
|
1712
|
-
Object.defineProperty(exports, 'shallowEqual', {
|
|
1713
|
-
enumerable: true,
|
|
1714
|
-
get: function () {
|
|
1715
|
-
return shallowEqual;
|
|
1716
|
-
}
|
|
1717
|
-
});
|
|
1718
1537
|
Object.defineProperty(exports, 'useCopilotChatConfiguration', {
|
|
1719
1538
|
enumerable: true,
|
|
1720
1539
|
get: function () {
|
|
1721
1540
|
return useCopilotChatConfiguration;
|
|
1722
1541
|
}
|
|
1723
1542
|
});
|
|
1724
|
-
Object.defineProperty(exports, 'useGenerativeUIAccessibility', {
|
|
1725
|
-
enumerable: true,
|
|
1726
|
-
get: function () {
|
|
1727
|
-
return useGenerativeUIAccessibility;
|
|
1728
|
-
}
|
|
1729
|
-
});
|
|
1730
1543
|
Object.defineProperty(exports, 'useGenerativeUIActivitySurface', {
|
|
1731
1544
|
enumerable: true,
|
|
1732
1545
|
get: function () {
|
|
@@ -1751,12 +1564,6 @@ Object.defineProperty(exports, 'useGenerativeUIRejected', {
|
|
|
1751
1564
|
return useGenerativeUIRejected;
|
|
1752
1565
|
}
|
|
1753
1566
|
});
|
|
1754
|
-
Object.defineProperty(exports, 'useGenerativeUIRuntime', {
|
|
1755
|
-
enumerable: true,
|
|
1756
|
-
get: function () {
|
|
1757
|
-
return useGenerativeUIRuntime;
|
|
1758
|
-
}
|
|
1759
|
-
});
|
|
1760
1567
|
Object.defineProperty(exports, 'useGenerativeUIState', {
|
|
1761
1568
|
enumerable: true,
|
|
1762
1569
|
get: function () {
|
|
@@ -1769,16 +1576,4 @@ Object.defineProperty(exports, 'useManagerVersion', {
|
|
|
1769
1576
|
return useManagerVersion;
|
|
1770
1577
|
}
|
|
1771
1578
|
});
|
|
1772
|
-
|
|
1773
|
-
enumerable: true,
|
|
1774
|
-
get: function () {
|
|
1775
|
-
return useRequiredGenerativeUIRuntime;
|
|
1776
|
-
}
|
|
1777
|
-
});
|
|
1778
|
-
Object.defineProperty(exports, 'useShallowStableRef', {
|
|
1779
|
-
enumerable: true,
|
|
1780
|
-
get: function () {
|
|
1781
|
-
return useShallowStableRef;
|
|
1782
|
-
}
|
|
1783
|
-
});
|
|
1784
|
-
//# sourceMappingURL=chat-D3fxo6Ah.cjs.map
|
|
1579
|
+
//# sourceMappingURL=chat-CkFZMo5E.cjs.map
|