@copilotkit/react-core 2.0.0-rc.42 → 2.0.0-rc.44

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.
Files changed (91) hide show
  1. package/dist/{MarkdownRendererContext-BL8ct_3U.d.mts → MarkdownRendererContext-QFCldfW_.d.cts} +1 -1
  2. package/dist/{MarkdownRendererContext-BL8ct_3U.d.mts.map → MarkdownRendererContext-QFCldfW_.d.cts.map} +1 -1
  3. package/dist/{MarkdownRendererContext-C2J_lgqF.d.cts → MarkdownRendererContext-aK63ZFd-.d.mts} +1 -1
  4. package/dist/{MarkdownRendererContext-C2J_lgqF.d.cts.map → MarkdownRendererContext-aK63ZFd-.d.mts.map} +1 -1
  5. package/dist/MarkdownSurfaces-Do948N1P.cjs +141 -0
  6. package/dist/MarkdownSurfaces-Do948N1P.cjs.map +1 -0
  7. package/dist/MarkdownSurfaces-rtE9wRUP.mjs +135 -0
  8. package/dist/MarkdownSurfaces-rtE9wRUP.mjs.map +1 -0
  9. package/dist/{MarkdownSurfaces-D2Ck-cbb.cjs → ProviderMarkdown-D0eI0aPo.cjs} +26 -136
  10. package/dist/ProviderMarkdown-D0eI0aPo.cjs.map +1 -0
  11. package/dist/{MarkdownSurfaces-Byz821bg.mjs → ProviderMarkdown-epL7F3Vt.mjs} +22 -132
  12. package/dist/ProviderMarkdown-epL7F3Vt.mjs.map +1 -0
  13. package/dist/accessibility-BLK-gE0R.mjs +129 -0
  14. package/dist/accessibility-BLK-gE0R.mjs.map +1 -0
  15. package/dist/accessibility-GnodqxkH.cjs +228 -0
  16. package/dist/accessibility-GnodqxkH.cjs.map +1 -0
  17. package/dist/{chat-Bf0vVdo7.mjs → chat-B1zczXUD.mjs} +21 -145
  18. package/dist/chat-B1zczXUD.mjs.map +1 -0
  19. package/dist/chat-BZ_bvAkg.d.mts +38 -0
  20. package/dist/chat-BZ_bvAkg.d.mts.map +1 -0
  21. package/dist/{chat-D3fxo6Ah.cjs → chat-CkFZMo5E.cjs} +29 -234
  22. package/dist/chat-CkFZMo5E.cjs.map +1 -0
  23. package/dist/chat-CpZVyF_t.d.cts +38 -0
  24. package/dist/chat-CpZVyF_t.d.cts.map +1 -0
  25. package/dist/context.cjs +2 -2
  26. package/dist/context.cjs.map +1 -1
  27. package/dist/context.d.cts +2 -2
  28. package/dist/context.d.mts +2 -2
  29. package/dist/context.mjs +2 -2
  30. package/dist/context.mjs.map +1 -1
  31. package/dist/generative-ui/map.cjs +26 -0
  32. package/dist/generative-ui/map.cjs.map +1 -0
  33. package/dist/generative-ui/map.d.cts +23 -0
  34. package/dist/generative-ui/map.d.cts.map +1 -0
  35. package/dist/generative-ui/map.d.mts +23 -0
  36. package/dist/generative-ui/map.d.mts.map +1 -0
  37. package/dist/generative-ui/map.mjs +24 -0
  38. package/dist/generative-ui/map.mjs.map +1 -0
  39. package/dist/generative-ui/native.cjs +9 -8
  40. package/dist/generative-ui/native.cjs.map +1 -1
  41. package/dist/generative-ui/native.d.cts +3 -2
  42. package/dist/generative-ui/native.d.cts.map +1 -1
  43. package/dist/generative-ui/native.d.mts +3 -2
  44. package/dist/generative-ui/native.d.mts.map +1 -1
  45. package/dist/generative-ui/native.mjs +4 -3
  46. package/dist/generative-ui/native.mjs.map +1 -1
  47. package/dist/generative-ui.cjs +11 -5767
  48. package/dist/generative-ui.cjs.map +1 -1
  49. package/dist/generative-ui.d.cts +5 -4
  50. package/dist/generative-ui.d.cts.map +1 -1
  51. package/dist/generative-ui.d.mts +6 -5
  52. package/dist/generative-ui.d.mts.map +1 -1
  53. package/dist/generative-ui.mjs +8 -5764
  54. package/dist/generative-ui.mjs.map +1 -1
  55. package/dist/{hooks-BRYonCVu.d.mts → hooks-D2H3iL0N.d.mts} +3 -3
  56. package/dist/{hooks-BRYonCVu.d.mts.map → hooks-D2H3iL0N.d.mts.map} +1 -1
  57. package/dist/{hooks-2Ur8NQhj.d.cts → hooks-Dy8HeEdr.d.cts} +2 -2
  58. package/dist/{hooks-2Ur8NQhj.d.cts.map → hooks-Dy8HeEdr.d.cts.map} +1 -1
  59. package/dist/index.cjs +183 -700
  60. package/dist/index.cjs.map +1 -1
  61. package/dist/index.d.cts +11 -103
  62. package/dist/index.d.cts.map +1 -1
  63. package/dist/index.d.mts +11 -103
  64. package/dist/index.d.mts.map +1 -1
  65. package/dist/index.mjs +66 -425
  66. package/dist/index.mjs.map +1 -1
  67. package/dist/index.umd.js +6157 -799
  68. package/dist/index.umd.js.map +1 -1
  69. package/dist/{refs-BIUfn1wb.cjs → refs-B5Dn59Pn.cjs} +2 -2
  70. package/dist/{refs-BIUfn1wb.cjs.map → refs-B5Dn59Pn.cjs.map} +1 -1
  71. package/dist/{refs-CMrRm3ta.mjs → refs-BW15wX_V.mjs} +1 -1
  72. package/dist/{refs-CMrRm3ta.mjs.map → refs-BW15wX_V.mjs.map} +1 -1
  73. package/dist/{chat-DgP2N7bD.d.mts → runtime-context-B7f4M85q.d.mts} +21 -39
  74. package/dist/runtime-context-B7f4M85q.d.mts.map +1 -0
  75. package/dist/{chat-DtHs4alO.d.cts → runtime-context-CIkZS0ap.d.cts} +21 -39
  76. package/dist/runtime-context-CIkZS0ap.d.cts.map +1 -0
  77. package/dist/standard-CSBR4FhM.mjs +5800 -0
  78. package/dist/standard-CSBR4FhM.mjs.map +1 -0
  79. package/dist/standard-DBjcBGyd.cjs +5796 -0
  80. package/dist/standard-DBjcBGyd.cjs.map +1 -0
  81. package/dist/{use-generative-ui-root-C12htqbK.cjs → use-generative-ui-root-CIp0ytE6.cjs} +3 -3
  82. package/dist/{use-generative-ui-root-C12htqbK.cjs.map → use-generative-ui-root-CIp0ytE6.cjs.map} +1 -1
  83. package/dist/{use-generative-ui-root-CVgsDy1f.mjs → use-generative-ui-root-oBqPa6uy.mjs} +3 -2
  84. package/dist/{use-generative-ui-root-CVgsDy1f.mjs.map → use-generative-ui-root-oBqPa6uy.mjs.map} +1 -1
  85. package/package.json +14 -10
  86. package/dist/MarkdownSurfaces-Byz821bg.mjs.map +0 -1
  87. package/dist/MarkdownSurfaces-D2Ck-cbb.cjs.map +0 -1
  88. package/dist/chat-Bf0vVdo7.mjs.map +0 -1
  89. package/dist/chat-D3fxo6Ah.cjs.map +0 -1
  90. package/dist/chat-DgP2N7bD.d.mts.map +0 -1
  91. package/dist/chat-DtHs4alO.d.cts.map +0 -1
@@ -1,4 +1,4 @@
1
- const require_chat = require('./chat-D3fxo6Ah.cjs');
1
+ const require_accessibility = require('./accessibility-GnodqxkH.cjs');
2
2
  let _copilotkit_shared_generative_ui = require("@copilotkit/shared/generative-ui");
3
3
 
4
4
  //#region src/generative-ui/refs.ts
@@ -40,4 +40,4 @@ Object.defineProperty(exports, 'childList', {
40
40
  return childList;
41
41
  }
42
42
  });
43
- //# sourceMappingURL=refs-BIUfn1wb.cjs.map
43
+ //# sourceMappingURL=refs-B5Dn59Pn.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"refs-BIUfn1wb.cjs","names":[],"sources":["../src/generative-ui/refs.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport {\n child as sharedChild,\n childList as sharedChildList,\n} from \"@copilotkit/shared/generative-ui\";\n\n/**\n * One component id. The component receives the rendered child. Pass the\n * description here, not with `.describe()`, which would replace the mark.\n *\n * @example\n * ```ts\n * const tabsSchema = z.object({\n * tabs: z.array(z.object({ title: z.string(), child: child() })),\n * });\n * // The component gets `tabs: { title: string; child: ReactNode }[]`.\n * ```\n */\nexport function child(description?: string) {\n return sharedChild<ReactNode>(description);\n}\n\n/**\n * A list of component ids, or a template `{ componentId, path }` that\n * repeats one component for each item of the list at `path`. The\n * component receives the rendered children. Pass the description here,\n * not with `.describe()`.\n */\nexport function childList(description?: string) {\n return sharedChildList<ReactNode>(description);\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAkBA,SAAgB,MAAM,aAAsB;AAC1C,oDAA8B,YAAY;;;;;;;;AAS5C,SAAgB,UAAU,aAAsB;AAC9C,wDAAkC,YAAY"}
1
+ {"version":3,"file":"refs-B5Dn59Pn.cjs","names":[],"sources":["../src/generative-ui/refs.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport {\n child as sharedChild,\n childList as sharedChildList,\n} from \"@copilotkit/shared/generative-ui\";\n\n/**\n * One component id. The component receives the rendered child. Pass the\n * description here, not with `.describe()`, which would replace the mark.\n *\n * @example\n * ```ts\n * const tabsSchema = z.object({\n * tabs: z.array(z.object({ title: z.string(), child: child() })),\n * });\n * // The component gets `tabs: { title: string; child: ReactNode }[]`.\n * ```\n */\nexport function child(description?: string) {\n return sharedChild<ReactNode>(description);\n}\n\n/**\n * A list of component ids, or a template `{ componentId, path }` that\n * repeats one component for each item of the list at `path`. The\n * component receives the rendered children. Pass the description here,\n * not with `.describe()`.\n */\nexport function childList(description?: string) {\n return sharedChildList<ReactNode>(description);\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAkBA,SAAgB,MAAM,aAAsB;AAC1C,oDAA8B,YAAY;;;;;;;;AAS5C,SAAgB,UAAU,aAAsB;AAC9C,wDAAkC,YAAY"}
@@ -28,4 +28,4 @@ function childList$1(description) {
28
28
 
29
29
  //#endregion
30
30
  export { childList$1 as n, child$1 as t };
31
- //# sourceMappingURL=refs-CMrRm3ta.mjs.map
31
+ //# sourceMappingURL=refs-BW15wX_V.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"refs-CMrRm3ta.mjs","names":["child","sharedChild","childList","sharedChildList"],"sources":["../src/generative-ui/refs.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport {\n child as sharedChild,\n childList as sharedChildList,\n} from \"@copilotkit/shared/generative-ui\";\n\n/**\n * One component id. The component receives the rendered child. Pass the\n * description here, not with `.describe()`, which would replace the mark.\n *\n * @example\n * ```ts\n * const tabsSchema = z.object({\n * tabs: z.array(z.object({ title: z.string(), child: child() })),\n * });\n * // The component gets `tabs: { title: string; child: ReactNode }[]`.\n * ```\n */\nexport function child(description?: string) {\n return sharedChild<ReactNode>(description);\n}\n\n/**\n * A list of component ids, or a template `{ componentId, path }` that\n * repeats one component for each item of the list at `path`. The\n * component receives the rendered children. Pass the description here,\n * not with `.describe()`.\n */\nexport function childList(description?: string) {\n return sharedChildList<ReactNode>(description);\n}\n"],"mappings":";;;;;;;;;;;;;;;AAkBA,SAAgBA,QAAM,aAAsB;AAC1C,QAAOC,MAAuB,YAAY;;;;;;;;AAS5C,SAAgBC,YAAU,aAAsB;AAC9C,QAAOC,UAA2B,YAAY"}
1
+ {"version":3,"file":"refs-BW15wX_V.mjs","names":["child","sharedChild","childList","sharedChildList"],"sources":["../src/generative-ui/refs.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport {\n child as sharedChild,\n childList as sharedChildList,\n} from \"@copilotkit/shared/generative-ui\";\n\n/**\n * One component id. The component receives the rendered child. Pass the\n * description here, not with `.describe()`, which would replace the mark.\n *\n * @example\n * ```ts\n * const tabsSchema = z.object({\n * tabs: z.array(z.object({ title: z.string(), child: child() })),\n * });\n * // The component gets `tabs: { title: string; child: ReactNode }[]`.\n * ```\n */\nexport function child(description?: string) {\n return sharedChild<ReactNode>(description);\n}\n\n/**\n * A list of component ids, or a template `{ componentId, path }` that\n * repeats one component for each item of the list at `path`. The\n * component receives the rendered children. Pass the description here,\n * not with `.describe()`.\n */\nexport function childList(description?: string) {\n return sharedChildList<ReactNode>(description);\n}\n"],"mappings":";;;;;;;;;;;;;;;AAkBA,SAAgBA,QAAM,aAAsB;AAC1C,QAAOC,MAAuB,YAAY;;;;;;;;AAS5C,SAAgBC,YAAU,aAAsB;AAC9C,QAAOC,UAA2B,YAAY"}
@@ -1,8 +1,6 @@
1
- import { ActivityMessageRenderProps, ActivityMessageRendererDef } from "@copilotkit/core";
2
1
  import * as react from "react";
3
- import React, { ComponentType, ReactNode } from "react";
4
- import * as react_jsx_runtime0 from "react/jsx-runtime";
5
- import { GenerativeUIRejectedOperation, GenerativeUISurfaceContent, GenerativeUIUserEvent } from "@copilotkit/shared";
2
+ import { ComponentType, ReactNode } from "react";
3
+ import { GenerativeUIUserEvent } from "@copilotkit/shared";
6
4
  import { GenerativeUIAccessibility, GenerativeUIAriaAttributes, GenerativeUIAriaAttributes as GenerativeUIAriaAttributes$1, GenerativeUIDispatcher, GenerativeUISurfaceManager } from "@copilotkit/core/generative-ui";
7
5
  import { AnyGenerativeUI, CreateGenerativeUIConfig, GenerativeUI, GenerativeUIBasesDefinitions, GenerativeUIComponentDefinition, GenerativeUIComponentName, GenerativeUIComponentProps, GenerativeUIDefinitions, GenerativeUIDefinitionsOf, GenerativeUIErrorInfo, GenerativeUIEventDefinition, GenerativeUIFunctionArgs, GenerativeUIFunctionDefinition, GenerativeUIFunctionDefinition as GenerativeUIFunctionDefinition$1, GenerativeUIFunctionInput, GenerativeUIFunctionName, GenerativeUIInvokeResult, GenerativeUIResultDefinitions, GenerativeUISchema, GenerativeUISlotKind, GenerativeUIStateOf, GenerativeUITheme } from "@copilotkit/shared/generative-ui";
8
6
 
@@ -119,9 +117,11 @@ interface GenerativeUIErrorBoundaryConfig {
119
117
  interface GenerativeUIBaseConfig {
120
118
  /**
121
119
  * The result of `createGenerativeUI`: the components the model can render,
122
- * the app state they read and the functions they call.
120
+ * the app state they read and the functions they call. Leave it out to
121
+ * use `standardUI` when the runtime turns generative UI on; the other
122
+ * options (such as `map` or `theme`) still apply.
123
123
  */
124
- ui: GenerativeUI$1;
124
+ ui?: GenerativeUI$1;
125
125
  /**
126
126
  * The agents that get the generative UI. When omitted, every agent gets
127
127
  * it. Other agents get no envelope.
@@ -134,9 +134,22 @@ interface GenerativeUIBaseConfig {
134
134
  * Native ignores it.
135
135
  */
136
136
  theme?: GenerativeUITheme;
137
+ /**
138
+ * Web only. Loads `maplibre-gl` for the standard `Map` component. Pass
139
+ * `loadMapLibre` from `@copilotkit/react-core/generative-ui/map` and
140
+ * install `maplibre-gl`. Without it, Map shows its markers as a list, and
141
+ * the app builds without `maplibre-gl`. React Native ignores it.
142
+ */
143
+ map?: GenerativeUILibraryLoader;
137
144
  /** Fallback UI and error reporting for generated UI. */
138
145
  errorBoundary?: GenerativeUIErrorBoundaryConfig;
139
146
  }
147
+ /**
148
+ * Loads an optional library for a standard component, such as
149
+ * `loadMapLibre` from `@copilotkit/react-core/generative-ui/map`. The
150
+ * library stays out of apps that do not pass a loader.
151
+ */
152
+ type GenerativeUILibraryLoader = () => Promise<unknown>;
140
153
  /**
141
154
  * The tool transport: the model calls the `render_ui` tool, and the runtime
142
155
  * validates each operation before it streams it to the client.
@@ -198,36 +211,5 @@ declare const GenerativeUIRuntimeContext: react.Context<GenerativeUIRuntime | nu
198
211
  declare function useGenerativeUIRuntime(): GenerativeUIRuntime | null;
199
212
  declare function useRequiredGenerativeUIRuntime(): GenerativeUIRuntime;
200
213
  //#endregion
201
- //#region src/types/react-activity-message-renderer.d.ts
202
- /**
203
- * An activity message renderer for React: a React component that draws
204
- * activity messages of one `activityType` (or `"*"` for any type). The
205
- * component receives {@link ActivityMessageRenderProps}.
206
- *
207
- * @typeParam TActivityContent - The shape of the activity content.
208
- */
209
- type ReactActivityMessageRenderer<TActivityContent> = ActivityMessageRendererDef<TActivityContent, React.ComponentType<ActivityMessageRenderProps<TActivityContent>>>;
210
- //#endregion
211
- //#region src/generative-ui/chat.d.ts
212
- interface GenerativeUIChatSurfaceProps {
213
- surfaceId: string;
214
- isStreaming: boolean;
215
- /**
216
- * Set when operations from the latest render_ui call were rejected. The
217
- * message is user-facing; `error.cause` holds the same list as `rejected`.
218
- */
219
- error?: Error;
220
- /** Rejected operations from the latest render_ui call, with validator reasons. */
221
- rejected: GenerativeUIRejectedOperation[];
222
- children: ReactNode;
223
- }
224
- declare function DefaultGenerativeUIChatCard({
225
- surfaceId,
226
- error,
227
- children
228
- }: GenerativeUIChatSurfaceProps): react_jsx_runtime0.JSX.Element;
229
- /** Hides the raw `render_ui` tool call; the surface activity owns the UX. */
230
- declare function GenerativeUIToolCallRenderer(): null;
231
- //#endregion
232
- export { createGenerativeUI$1 as A, GenerativeUIEventDefinition as C, GenerativeUIFunctionName as D, GenerativeUIFunctionInput as E, GenerativeUISlotKind as O, GenerativeUIDefinitionsOf as S, GenerativeUIFunctionDefinition$1 as T, CreateGenerativeUIConfig$1 as _, GenerativeUIConfig as a, GenerativeUIComponentName as b, GenerativeUIRuntime as c, GenerativeUIToolConfig as d, useGenerativeUIRuntime as f, useGenerativeUIAccessibility as g, GenerativeUIAriaAttributes$1 as h, ReactActivityMessageRenderer as i, GenerativeUIStateOf as k, GenerativeUIRuntimeContext as l, GenerativeUIAccessibility as m, GenerativeUIChatSurfaceProps as n, GenerativeUIErrorBoundaryConfig as o, useRequiredGenerativeUIRuntime as p, GenerativeUIToolCallRenderer as r, GenerativeUIMarkdownConfig as s, DefaultGenerativeUIChatCard as t, GenerativeUITheme as u, GenerativeUI$1 as v, GenerativeUIFunctionArgs as w, GenerativeUIComponentProps$1 as x, GenerativeUIComponentDefinition$1 as y };
233
- //# sourceMappingURL=chat-DgP2N7bD.d.mts.map
214
+ export { GenerativeUIFunctionInput as C, createGenerativeUI$1 as D, GenerativeUIStateOf as E, GenerativeUIFunctionDefinition$1 as S, GenerativeUISlotKind as T, GenerativeUIComponentName as _, GenerativeUIRuntime as a, GenerativeUIEventDefinition as b, GenerativeUIToolConfig as c, GenerativeUIAccessibility as d, GenerativeUIAriaAttributes$1 as f, GenerativeUIComponentDefinition$1 as g, GenerativeUI$1 as h, GenerativeUIMarkdownConfig as i, useGenerativeUIRuntime as l, CreateGenerativeUIConfig$1 as m, GenerativeUIErrorBoundaryConfig as n, GenerativeUIRuntimeContext as o, useGenerativeUIAccessibility as p, GenerativeUILibraryLoader as r, GenerativeUITheme as s, GenerativeUIConfig as t, useRequiredGenerativeUIRuntime as u, GenerativeUIComponentProps$1 as v, GenerativeUIFunctionName as w, GenerativeUIFunctionArgs as x, GenerativeUIDefinitionsOf as y };
215
+ //# sourceMappingURL=runtime-context-B7f4M85q.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-context-B7f4M85q.d.mts","names":[],"sources":["../src/generative-ui/catalog.ts","../src/generative-ui/accessibility.ts","../src/generative-ui/runtime-context.ts"],"mappings":";;;;;;;;KA2CY,iCAAA,GACV,+BAAA,CAAsC,aAAA;;;;;AAYxC;KAAY,cAAA,qBACU,uBAAA,GAA0B,uBAAA,IAC5C,YAAA,CAAmB,WAAA,EAAa,aAAA;;;;;;;;KASxB,4BAAA,YACC,eAAA,qBACQ,WAAA,CAAY,EAAA,2CAC7B,0BAAA,CAAiC,EAAA,EAAI,IAAA,EAAM,SAAA;;KAG1C,eAAA,wBAAuC,eAAA,uBAC3B,4BAAA,CAA6B,KAAA;EAC1C,SAAA,EAAW,aAAA,CACT,4BAAA,CAA6B,KAAA,oCAC3B,uBAAA,GACE,4BAAA,CAA2B,cAAA,CAAa,WAAA,GAAc,IAAA;AAAA;;KAOpD,0BAAA,wBACa,eAAA,kBACT,MAAA,SAAe,kBAAA,qBACX,MAAA,SAAe,8BAAA,iBACnB,MAAA,kCACC,MAAA,iCACD,MAAA,oCACG,MAAA,qBACf,wBAAA,CACF,KAAA,EACA,KAAA,EACA,SAAA,EACA,KAAA,EACA,MAAA,EACA,KAAA,EACA,QAAA,EACA,eAAA,CAAgB,KAAA;AAlClB;;;;;;;;;;;;;;;;;;;;;;;AAG0D;;;;;;;;;;;;;;;;;;;AAH1D,iBA+EgB,oBAAA,wBACS,eAAA,uBACT,MAAA,SAAe,kBAAA,0BACX,MAAA,SAAe,8BAAA,sBACnB,MAAA,uCACC,MAAA,sCACD,MAAA,yCACG,MAAA,uBAAA,CAEjB,MAAA,EAAQ,0BAAA,CACN,KAAA,EACA,KAAA,EACA,SAAA,EACA,KAAA,EACA,MAAA,EACA,KAAA,EACA,QAAA,IAMsB,cAAA,CACtB,6BAAA,CACE,KAAA,EACA,KAAA,EACA,SAAA,EACA,KAAA,EACA,MAAA,EACA,KAAA,EACA,QAAA;;;;;;;AArIN;;;;;AAaA;;;;;;iBCrBgB,4BAAA,CAAA,GAAgC,0BAA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react";
2
+ import { ComponentType, ReactNode } from "react";
3
3
  import { AnyGenerativeUI, CreateGenerativeUIConfig, GenerativeUI, GenerativeUIBasesDefinitions, GenerativeUIComponentDefinition, GenerativeUIComponentName, GenerativeUIComponentProps, GenerativeUIDefinitions, GenerativeUIDefinitionsOf, GenerativeUIErrorInfo, GenerativeUIEventDefinition, GenerativeUIFunctionArgs, GenerativeUIFunctionDefinition, GenerativeUIFunctionDefinition as GenerativeUIFunctionDefinition$1, GenerativeUIFunctionInput, GenerativeUIFunctionName, GenerativeUIInvokeResult, GenerativeUIResultDefinitions, GenerativeUISchema, GenerativeUISlotKind, GenerativeUIStateOf, GenerativeUITheme } from "@copilotkit/shared/generative-ui";
4
4
  import { GenerativeUIAccessibility, GenerativeUIAriaAttributes, GenerativeUIAriaAttributes as GenerativeUIAriaAttributes$1, GenerativeUIDispatcher, GenerativeUISurfaceManager } from "@copilotkit/core/generative-ui";
5
- import { GenerativeUIRejectedOperation, GenerativeUISurfaceContent, GenerativeUIUserEvent } from "@copilotkit/shared";
6
- import * as react_jsx_runtime0 from "react/jsx-runtime";
7
- import { ActivityMessageRenderProps, ActivityMessageRendererDef } from "@copilotkit/core";
5
+ import { GenerativeUIUserEvent } from "@copilotkit/shared";
8
6
 
9
7
  //#region src/generative-ui/catalog.d.ts
10
8
  /** One component of a generative UI, as the renderer reads it. */
@@ -119,9 +117,11 @@ interface GenerativeUIErrorBoundaryConfig {
119
117
  interface GenerativeUIBaseConfig {
120
118
  /**
121
119
  * The result of `createGenerativeUI`: the components the model can render,
122
- * the app state they read and the functions they call.
120
+ * the app state they read and the functions they call. Leave it out to
121
+ * use `standardUI` when the runtime turns generative UI on; the other
122
+ * options (such as `map` or `theme`) still apply.
123
123
  */
124
- ui: GenerativeUI$1;
124
+ ui?: GenerativeUI$1;
125
125
  /**
126
126
  * The agents that get the generative UI. When omitted, every agent gets
127
127
  * it. Other agents get no envelope.
@@ -134,9 +134,22 @@ interface GenerativeUIBaseConfig {
134
134
  * Native ignores it.
135
135
  */
136
136
  theme?: GenerativeUITheme;
137
+ /**
138
+ * Web only. Loads `maplibre-gl` for the standard `Map` component. Pass
139
+ * `loadMapLibre` from `@copilotkit/react-core/generative-ui/map` and
140
+ * install `maplibre-gl`. Without it, Map shows its markers as a list, and
141
+ * the app builds without `maplibre-gl`. React Native ignores it.
142
+ */
143
+ map?: GenerativeUILibraryLoader;
137
144
  /** Fallback UI and error reporting for generated UI. */
138
145
  errorBoundary?: GenerativeUIErrorBoundaryConfig;
139
146
  }
147
+ /**
148
+ * Loads an optional library for a standard component, such as
149
+ * `loadMapLibre` from `@copilotkit/react-core/generative-ui/map`. The
150
+ * library stays out of apps that do not pass a loader.
151
+ */
152
+ type GenerativeUILibraryLoader = () => Promise<unknown>;
140
153
  /**
141
154
  * The tool transport: the model calls the `render_ui` tool, and the runtime
142
155
  * validates each operation before it streams it to the client.
@@ -198,36 +211,5 @@ declare const GenerativeUIRuntimeContext: react.Context<GenerativeUIRuntime | nu
198
211
  declare function useGenerativeUIRuntime(): GenerativeUIRuntime | null;
199
212
  declare function useRequiredGenerativeUIRuntime(): GenerativeUIRuntime;
200
213
  //#endregion
201
- //#region src/types/react-activity-message-renderer.d.ts
202
- /**
203
- * An activity message renderer for React: a React component that draws
204
- * activity messages of one `activityType` (or `"*"` for any type). The
205
- * component receives {@link ActivityMessageRenderProps}.
206
- *
207
- * @typeParam TActivityContent - The shape of the activity content.
208
- */
209
- type ReactActivityMessageRenderer<TActivityContent> = ActivityMessageRendererDef<TActivityContent, React.ComponentType<ActivityMessageRenderProps<TActivityContent>>>;
210
- //#endregion
211
- //#region src/generative-ui/chat.d.ts
212
- interface GenerativeUIChatSurfaceProps {
213
- surfaceId: string;
214
- isStreaming: boolean;
215
- /**
216
- * Set when operations from the latest render_ui call were rejected. The
217
- * message is user-facing; `error.cause` holds the same list as `rejected`.
218
- */
219
- error?: Error;
220
- /** Rejected operations from the latest render_ui call, with validator reasons. */
221
- rejected: GenerativeUIRejectedOperation[];
222
- children: ReactNode;
223
- }
224
- declare function DefaultGenerativeUIChatCard({
225
- surfaceId,
226
- error,
227
- children
228
- }: GenerativeUIChatSurfaceProps): react_jsx_runtime0.JSX.Element;
229
- /** Hides the raw `render_ui` tool call; the surface activity owns the UX. */
230
- declare function GenerativeUIToolCallRenderer(): null;
231
- //#endregion
232
- export { createGenerativeUI as A, GenerativeUIEventDefinition as C, GenerativeUIFunctionName as D, GenerativeUIFunctionInput as E, GenerativeUISlotKind as O, GenerativeUIDefinitionsOf as S, GenerativeUIFunctionDefinition$1 as T, CreateGenerativeUIConfig$1 as _, GenerativeUIConfig as a, GenerativeUIComponentName as b, GenerativeUIRuntime as c, GenerativeUIToolConfig as d, useGenerativeUIRuntime as f, useGenerativeUIAccessibility as g, GenerativeUIAriaAttributes$1 as h, ReactActivityMessageRenderer as i, GenerativeUIStateOf as k, GenerativeUIRuntimeContext as l, GenerativeUIAccessibility as m, GenerativeUIChatSurfaceProps as n, GenerativeUIErrorBoundaryConfig as o, useRequiredGenerativeUIRuntime as p, GenerativeUIToolCallRenderer as r, GenerativeUIMarkdownConfig as s, DefaultGenerativeUIChatCard as t, GenerativeUITheme as u, GenerativeUI$1 as v, GenerativeUIFunctionArgs as w, GenerativeUIComponentProps$1 as x, GenerativeUIComponentDefinition$1 as y };
233
- //# sourceMappingURL=chat-DtHs4alO.d.cts.map
214
+ export { GenerativeUIFunctionInput as C, createGenerativeUI as D, GenerativeUIStateOf as E, GenerativeUIFunctionDefinition$1 as S, GenerativeUISlotKind as T, GenerativeUIComponentName as _, GenerativeUIRuntime as a, GenerativeUIEventDefinition as b, GenerativeUIToolConfig as c, GenerativeUIAccessibility as d, GenerativeUIAriaAttributes$1 as f, GenerativeUIComponentDefinition$1 as g, GenerativeUI$1 as h, GenerativeUIMarkdownConfig as i, useGenerativeUIRuntime as l, CreateGenerativeUIConfig$1 as m, GenerativeUIErrorBoundaryConfig as n, GenerativeUIRuntimeContext as o, useGenerativeUIAccessibility as p, GenerativeUILibraryLoader as r, GenerativeUITheme as s, GenerativeUIConfig as t, useRequiredGenerativeUIRuntime as u, GenerativeUIComponentProps$1 as v, GenerativeUIFunctionName as w, GenerativeUIFunctionArgs as x, GenerativeUIDefinitionsOf as y };
215
+ //# sourceMappingURL=runtime-context-CIkZS0ap.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-context-CIkZS0ap.d.cts","names":[],"sources":["../src/generative-ui/catalog.ts","../src/generative-ui/accessibility.ts","../src/generative-ui/runtime-context.ts"],"mappings":";;;;;;;;KA2CY,iCAAA,GACV,+BAAA,CAAsC,aAAA;;;;;AAYxC;KAAY,cAAA,qBACU,uBAAA,GAA0B,uBAAA,IAC5C,YAAA,CAAmB,WAAA,EAAa,aAAA;;;;;;;;KASxB,4BAAA,YACC,eAAA,qBACQ,WAAA,CAAY,EAAA,2CAC7B,0BAAA,CAAiC,EAAA,EAAI,IAAA,EAAM,SAAA;;KAG1C,eAAA,wBAAuC,eAAA,uBAC3B,4BAAA,CAA6B,KAAA;EAC1C,SAAA,EAAW,aAAA,CACT,4BAAA,CAA6B,KAAA,oCAC3B,uBAAA,GACE,4BAAA,CAA2B,cAAA,CAAa,WAAA,GAAc,IAAA;AAAA;;KAOpD,0BAAA,wBACa,eAAA,kBACT,MAAA,SAAe,kBAAA,qBACX,MAAA,SAAe,8BAAA,iBACnB,MAAA,kCACC,MAAA,iCACD,MAAA,oCACG,MAAA,qBACf,wBAAA,CACF,KAAA,EACA,KAAA,EACA,SAAA,EACA,KAAA,EACA,MAAA,EACA,KAAA,EACA,QAAA,EACA,eAAA,CAAgB,KAAA;AAlClB;;;;;;;;;;;;;;;;;;;;;;;AAG0D;;;;;;;;;;;;;;;;;;;AAH1D,iBA+EgB,kBAAA,wBACS,eAAA,uBACT,MAAA,SAAe,kBAAA,0BACX,MAAA,SAAe,8BAAA,sBACnB,MAAA,uCACC,MAAA,sCACD,MAAA,yCACG,MAAA,uBAAA,CAEjB,MAAA,EAAQ,0BAAA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