@aigentyc/chat-sdk 0.2.4 → 0.3.0

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 (103) hide show
  1. package/bin/aigentyc.mjs +14 -8
  2. package/bin/lib/add.mjs +1 -1
  3. package/bin/lib/doctor.mjs +1 -1
  4. package/bin/lib/skill.mjs +84 -0
  5. package/claude-skill/README.md +32 -0
  6. package/claude-skill/aigentyc-chat-sdk/SKILL.md +339 -0
  7. package/context7.json +1 -1
  8. package/dist/ChatInterface-B0zbA3Lm.d.cts +64 -0
  9. package/dist/ChatInterface-f8ftS56n.d.ts +64 -0
  10. package/dist/{SlotsContext-CBtt36al.d.ts → SlotsContext-BjiX1mRx.d.ts} +17 -2
  11. package/dist/{SlotsContext-CHvISDJT.d.cts → SlotsContext-CEOBjzfh.d.cts} +17 -2
  12. package/dist/ai-elements.cjs +114 -393
  13. package/dist/ai-elements.cjs.map +1 -1
  14. package/dist/ai-elements.d.cts +2 -31
  15. package/dist/ai-elements.d.ts +2 -31
  16. package/dist/ai-elements.js +9 -291
  17. package/dist/ai-elements.js.map +1 -1
  18. package/dist/{chunk-5QSXB6UL.cjs → chunk-3HGOLNGG.cjs} +13 -4
  19. package/dist/chunk-3HGOLNGG.cjs.map +1 -0
  20. package/dist/{chunk-KVEJAPWA.js → chunk-3KSMOHNY.js} +48 -62
  21. package/dist/chunk-3KSMOHNY.js.map +1 -0
  22. package/dist/chunk-4WOBNRRB.cjs +540 -0
  23. package/dist/chunk-4WOBNRRB.cjs.map +1 -0
  24. package/dist/chunk-7AZMWPKX.cjs +35 -0
  25. package/dist/chunk-7AZMWPKX.cjs.map +1 -0
  26. package/dist/chunk-B27JIQ4Z.js +528 -0
  27. package/dist/chunk-B27JIQ4Z.js.map +1 -0
  28. package/dist/{chunk-J2K7EJYP.cjs → chunk-BPV66QNM.cjs} +6 -4
  29. package/dist/chunk-BPV66QNM.cjs.map +1 -0
  30. package/dist/{chunk-FYPJSHCL.js → chunk-FPQ3UCCJ.js} +6 -4
  31. package/dist/chunk-FPQ3UCCJ.js.map +1 -0
  32. package/dist/{chunk-7L4FS6G7.js → chunk-JHWSG5IB.js} +17 -3
  33. package/dist/chunk-JHWSG5IB.js.map +1 -0
  34. package/dist/{chunk-4FBVV64J.js → chunk-M4YRNNGB.js} +13 -4
  35. package/dist/chunk-M4YRNNGB.js.map +1 -0
  36. package/dist/{chunk-QDFPJJ5Y.cjs → chunk-OU5OZKYH.cjs} +50 -65
  37. package/dist/chunk-OU5OZKYH.cjs.map +1 -0
  38. package/dist/{chunk-MC6QDYB6.cjs → chunk-PPCGZ5MP.cjs} +166 -67
  39. package/dist/chunk-PPCGZ5MP.cjs.map +1 -0
  40. package/dist/{chunk-U3FXVLUK.js → chunk-PQCGQ32Q.js} +84 -4
  41. package/dist/chunk-PQCGQ32Q.js.map +1 -0
  42. package/dist/{chunk-FOZXDUSZ.js → chunk-SWKWHBBN.js} +151 -54
  43. package/dist/chunk-SWKWHBBN.js.map +1 -0
  44. package/dist/{chunk-DMGYQ6NN.cjs → chunk-TLGZSXTU.cjs} +86 -6
  45. package/dist/chunk-TLGZSXTU.cjs.map +1 -0
  46. package/dist/{chunk-C24QG43M.cjs → chunk-TZ7EM3EG.cjs} +17 -2
  47. package/dist/chunk-TZ7EM3EG.cjs.map +1 -0
  48. package/dist/chunk-XEAAB5ZM.js +32 -0
  49. package/dist/chunk-XEAAB5ZM.js.map +1 -0
  50. package/dist/components.cjs +31 -52
  51. package/dist/components.cjs.map +1 -1
  52. package/dist/components.d.cts +4 -34
  53. package/dist/components.d.ts +4 -34
  54. package/dist/components.js +18 -42
  55. package/dist/components.js.map +1 -1
  56. package/dist/core.d.cts +2 -2
  57. package/dist/core.d.ts +2 -2
  58. package/dist/hooks.cjs +6 -6
  59. package/dist/hooks.d.cts +2 -2
  60. package/dist/hooks.d.ts +2 -2
  61. package/dist/hooks.js +2 -2
  62. package/dist/i18n.d.cts +1 -1
  63. package/dist/i18n.d.ts +1 -1
  64. package/dist/index.cjs +45 -23
  65. package/dist/index.cjs.map +1 -1
  66. package/dist/index.d.cts +51 -6
  67. package/dist/index.d.ts +51 -6
  68. package/dist/index.js +17 -10
  69. package/dist/index.js.map +1 -1
  70. package/dist/llms-full.txt +194 -14
  71. package/dist/message-feedback-BFh3-qym.d.cts +92 -0
  72. package/dist/message-feedback-cWR0NVok.d.ts +92 -0
  73. package/dist/normalize-KzCLLqpU.d.cts +42 -0
  74. package/dist/normalize-KzCLLqpU.d.ts +42 -0
  75. package/dist/styles.css +1 -1
  76. package/dist/theme.d.cts +1 -1
  77. package/dist/theme.d.ts +1 -1
  78. package/dist/tools.cjs +14 -5
  79. package/dist/tools.d.cts +3 -2
  80. package/dist/tools.d.ts +3 -2
  81. package/dist/tools.js +3 -2
  82. package/dist/{types-DKJ_-nbG.d.cts → types-DlNwk-bG.d.cts} +33 -3
  83. package/dist/{types-DKJ_-nbG.d.ts → types-DlNwk-bG.d.ts} +33 -3
  84. package/dist/ui.cjs +45 -45
  85. package/dist/ui.js +2 -2
  86. package/llms.txt +175 -5
  87. package/package.json +2 -1
  88. package/dist/chunk-4FBVV64J.js.map +0 -1
  89. package/dist/chunk-5QSXB6UL.cjs.map +0 -1
  90. package/dist/chunk-7L4FS6G7.js.map +0 -1
  91. package/dist/chunk-A7PCSWIK.js +0 -219
  92. package/dist/chunk-A7PCSWIK.js.map +0 -1
  93. package/dist/chunk-C24QG43M.cjs.map +0 -1
  94. package/dist/chunk-DMGYQ6NN.cjs.map +0 -1
  95. package/dist/chunk-FOZXDUSZ.js.map +0 -1
  96. package/dist/chunk-FYPJSHCL.js.map +0 -1
  97. package/dist/chunk-J2K7EJYP.cjs.map +0 -1
  98. package/dist/chunk-KVEJAPWA.js.map +0 -1
  99. package/dist/chunk-MC6QDYB6.cjs.map +0 -1
  100. package/dist/chunk-QDFPJJ5Y.cjs.map +0 -1
  101. package/dist/chunk-RTVEBPAJ.cjs +0 -230
  102. package/dist/chunk-RTVEBPAJ.cjs.map +0 -1
  103. package/dist/chunk-U3FXVLUK.js.map +0 -1
package/dist/theme.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
- export { T as ThemeConfig } from './types-DKJ_-nbG.cjs';
3
+ export { T as ThemeConfig } from './types-DlNwk-bG.cjs';
4
4
 
5
5
  /**
6
6
  * Theme configuration for the chat widget.
package/dist/theme.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
- export { T as ThemeConfig } from './types-DKJ_-nbG.js';
3
+ export { T as ThemeConfig } from './types-DlNwk-bG.js';
4
4
 
5
5
  /**
6
6
  * Theme configuration for the chat widget.
package/dist/tools.cjs CHANGED
@@ -1,8 +1,9 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkDMGYQ6NN_cjs = require('./chunk-DMGYQ6NN.cjs');
5
- require('./chunk-J2K7EJYP.cjs');
4
+ var chunk7AZMWPKX_cjs = require('./chunk-7AZMWPKX.cjs');
5
+ var chunkTLGZSXTU_cjs = require('./chunk-TLGZSXTU.cjs');
6
+ require('./chunk-BPV66QNM.cjs');
6
7
  require('./chunk-JOO6C3XT.cjs');
7
8
  var chunkJ2H6MLQF_cjs = require('./chunk-J2H6MLQF.cjs');
8
9
  var chunkQ7T3VAJV_cjs = require('./chunk-Q7T3VAJV.cjs');
@@ -12,17 +13,25 @@ require('./chunk-525KS5HM.cjs');
12
13
 
13
14
 
14
15
 
16
+ Object.defineProperty(exports, "getToolDisplayData", {
17
+ enumerable: true,
18
+ get: function () { return chunk7AZMWPKX_cjs.getToolDisplayData; }
19
+ });
20
+ Object.defineProperty(exports, "normalizeToolRows", {
21
+ enumerable: true,
22
+ get: function () { return chunk7AZMWPKX_cjs.normalizeToolRows; }
23
+ });
15
24
  Object.defineProperty(exports, "ComponentRenderer", {
16
25
  enumerable: true,
17
- get: function () { return chunkDMGYQ6NN_cjs.ComponentRenderer; }
26
+ get: function () { return chunkTLGZSXTU_cjs.ComponentRenderer; }
18
27
  });
19
28
  Object.defineProperty(exports, "SearchKnowledgeBaseRenderer", {
20
29
  enumerable: true,
21
- get: function () { return chunkDMGYQ6NN_cjs.SearchKnowledgeBaseRenderer; }
30
+ get: function () { return chunkTLGZSXTU_cjs.SearchKnowledgeBaseRenderer; }
22
31
  });
23
32
  Object.defineProperty(exports, "ToolRenderer", {
24
33
  enumerable: true,
25
- get: function () { return chunkDMGYQ6NN_cjs.ToolRenderer; }
34
+ get: function () { return chunkTLGZSXTU_cjs.ToolRenderer; }
26
35
  });
27
36
  Object.defineProperty(exports, "JsonRenderResult", {
28
37
  enumerable: true,
package/dist/tools.d.cts CHANGED
@@ -1,7 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { g as ToolRendererProps } from './types-DKJ_-nbG.cjs';
3
- export { d as ComponentAction, h as ToolResult } from './types-DKJ_-nbG.cjs';
2
+ import { g as ToolRendererProps } from './types-DlNwk-bG.cjs';
3
+ export { d as ComponentAction, h as ToolResult } from './types-DlNwk-bG.cjs';
4
4
  export { J as JsonRenderResult } from './JsonRenderResult-Ftw4AKwb.cjs';
5
+ export { g as getToolDisplayData, n as normalizeToolRows } from './normalize-KzCLLqpU.cjs';
5
6
  import 'react';
6
7
  import '@json-render/core';
7
8
 
package/dist/tools.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { g as ToolRendererProps } from './types-DKJ_-nbG.js';
3
- export { d as ComponentAction, h as ToolResult } from './types-DKJ_-nbG.js';
2
+ import { g as ToolRendererProps } from './types-DlNwk-bG.js';
3
+ export { d as ComponentAction, h as ToolResult } from './types-DlNwk-bG.js';
4
4
  export { J as JsonRenderResult } from './JsonRenderResult-Ftw4AKwb.js';
5
+ export { g as getToolDisplayData, n as normalizeToolRows } from './normalize-KzCLLqpU.js';
5
6
  import 'react';
6
7
  import '@json-render/core';
7
8
 
package/dist/tools.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use client";
2
- export { ComponentRenderer, SearchKnowledgeBaseRenderer, ToolRenderer } from './chunk-U3FXVLUK.js';
3
- import './chunk-FYPJSHCL.js';
2
+ export { getToolDisplayData, normalizeToolRows } from './chunk-XEAAB5ZM.js';
3
+ export { ComponentRenderer, SearchKnowledgeBaseRenderer, ToolRenderer } from './chunk-PQCGQ32Q.js';
4
+ import './chunk-FPQ3UCCJ.js';
4
5
  import './chunk-PS3U7T37.js';
5
6
  export { JsonRenderResult } from './chunk-RPDJXB3U.js';
6
7
  export { VisualizationRenderer } from './chunk-5T4FJ2SR.js';
@@ -121,12 +121,33 @@ interface SlotMap {
121
121
  loader?: ComponentType<SlotProps>;
122
122
  /** Custom feedback (thumbs up/down) component */
123
123
  feedback?: ComponentType<SlotProps>;
124
- /** Per-tool-name component overrides (keyed by tool name) */
124
+ /**
125
+ * Per-tool-name component overrides. Keys are tool NAMES (e.g. `searchProducts`,
126
+ * `calculateSeverance`). Values receive `ToolRendererProps`.
127
+ *
128
+ * Use this when you want to render a specific tool's output with custom UI.
129
+ *
130
+ * @example
131
+ * ```tsx
132
+ * slots={{ tools: { searchProducts: ProductGrid } }}
133
+ * ```
134
+ */
125
135
  tools?: Record<string, ComponentType<ToolRendererProps>>;
126
136
  /**
127
- * Per-tool render-mode overrides.
137
+ * Per-render-mode component overrides. Keys are render MODES (not tool names):
138
+ * `visualization` | `json_render` | `legacy` | `preset` | `text`.
128
139
  *
129
- * Keys are tool names, values are components that receive `ToolRendererProps`.
140
+ * Use this when you want to replace the default renderer for an entire category
141
+ * of tool outputs (e.g. swap the built-in recharts visualization for your own).
142
+ *
143
+ * **Common confusion**: if you want to override a specific tool, use `tools`
144
+ * (by name), not `toolRenderers` (by mode). Passing a tool name here does
145
+ * nothing (the SDK will emit a dev warning).
146
+ *
147
+ * @example
148
+ * ```tsx
149
+ * slots={{ toolRenderers: { visualization: MyChartRenderer } }}
150
+ * ```
130
151
  */
131
152
  toolRenderers?: Record<string, ComponentType<ToolRendererProps>>;
132
153
  /** Custom live-chat panel */
@@ -275,6 +296,15 @@ interface ChatEventCallbacks {
275
296
  onLiveChatEnded?: (endedBy: string) => void;
276
297
  /** Fired on any error (network, auth, etc.) */
277
298
  onError?: (error: Error) => void;
299
+ /**
300
+ * Fired when the user starts a brand-new conversation (clearMessages + new
301
+ * sessionId). Useful for resetting external state the consumer tracks.
302
+ */
303
+ onNewConversation?: (sessionId: string) => void;
304
+ /** Fired when the user stops generation mid-stream (stopGeneration()). */
305
+ onStopGeneration?: () => void;
306
+ /** Fired when messages are cleared (but session kept). */
307
+ onClearMessages?: () => void;
278
308
  /**
279
309
  * Generic interaction event (link click, copy, feedback, etc.).
280
310
  * Useful for external analytics pipelines.
@@ -121,12 +121,33 @@ interface SlotMap {
121
121
  loader?: ComponentType<SlotProps>;
122
122
  /** Custom feedback (thumbs up/down) component */
123
123
  feedback?: ComponentType<SlotProps>;
124
- /** Per-tool-name component overrides (keyed by tool name) */
124
+ /**
125
+ * Per-tool-name component overrides. Keys are tool NAMES (e.g. `searchProducts`,
126
+ * `calculateSeverance`). Values receive `ToolRendererProps`.
127
+ *
128
+ * Use this when you want to render a specific tool's output with custom UI.
129
+ *
130
+ * @example
131
+ * ```tsx
132
+ * slots={{ tools: { searchProducts: ProductGrid } }}
133
+ * ```
134
+ */
125
135
  tools?: Record<string, ComponentType<ToolRendererProps>>;
126
136
  /**
127
- * Per-tool render-mode overrides.
137
+ * Per-render-mode component overrides. Keys are render MODES (not tool names):
138
+ * `visualization` | `json_render` | `legacy` | `preset` | `text`.
128
139
  *
129
- * Keys are tool names, values are components that receive `ToolRendererProps`.
140
+ * Use this when you want to replace the default renderer for an entire category
141
+ * of tool outputs (e.g. swap the built-in recharts visualization for your own).
142
+ *
143
+ * **Common confusion**: if you want to override a specific tool, use `tools`
144
+ * (by name), not `toolRenderers` (by mode). Passing a tool name here does
145
+ * nothing (the SDK will emit a dev warning).
146
+ *
147
+ * @example
148
+ * ```tsx
149
+ * slots={{ toolRenderers: { visualization: MyChartRenderer } }}
150
+ * ```
130
151
  */
131
152
  toolRenderers?: Record<string, ComponentType<ToolRendererProps>>;
132
153
  /** Custom live-chat panel */
@@ -275,6 +296,15 @@ interface ChatEventCallbacks {
275
296
  onLiveChatEnded?: (endedBy: string) => void;
276
297
  /** Fired on any error (network, auth, etc.) */
277
298
  onError?: (error: Error) => void;
299
+ /**
300
+ * Fired when the user starts a brand-new conversation (clearMessages + new
301
+ * sessionId). Useful for resetting external state the consumer tracks.
302
+ */
303
+ onNewConversation?: (sessionId: string) => void;
304
+ /** Fired when the user stops generation mid-stream (stopGeneration()). */
305
+ onStopGeneration?: () => void;
306
+ /** Fired when messages are cleared (but session kept). */
307
+ onClearMessages?: () => void;
278
308
  /**
279
309
  * Generic interaction event (link click, copy, feedback, etc.).
280
310
  * Useful for external analytics pipelines.
package/dist/ui.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkQDFPJJ5Y_cjs = require('./chunk-QDFPJJ5Y.cjs');
5
- var chunkC24QG43M_cjs = require('./chunk-C24QG43M.cjs');
4
+ var chunkOU5OZKYH_cjs = require('./chunk-OU5OZKYH.cjs');
5
+ var chunkTZ7EM3EG_cjs = require('./chunk-TZ7EM3EG.cjs');
6
6
  var chunkJI5KCSOI_cjs = require('./chunk-JI5KCSOI.cjs');
7
7
  var chunkAWAJOSFP_cjs = require('./chunk-AWAJOSFP.cjs');
8
8
  var chunk525KS5HM_cjs = require('./chunk-525KS5HM.cjs');
@@ -442,163 +442,163 @@ TableCaption.displayName = "TableCaption";
442
442
 
443
443
  Object.defineProperty(exports, "Alert", {
444
444
  enumerable: true,
445
- get: function () { return chunkQDFPJJ5Y_cjs.Alert; }
445
+ get: function () { return chunkOU5OZKYH_cjs.Alert; }
446
446
  });
447
447
  Object.defineProperty(exports, "AlertDescription", {
448
448
  enumerable: true,
449
- get: function () { return chunkQDFPJJ5Y_cjs.AlertDescription; }
449
+ get: function () { return chunkOU5OZKYH_cjs.AlertDescription; }
450
450
  });
451
451
  Object.defineProperty(exports, "AlertTitle", {
452
452
  enumerable: true,
453
- get: function () { return chunkQDFPJJ5Y_cjs.AlertTitle; }
453
+ get: function () { return chunkOU5OZKYH_cjs.AlertTitle; }
454
454
  });
455
455
  Object.defineProperty(exports, "Badge", {
456
456
  enumerable: true,
457
- get: function () { return chunkQDFPJJ5Y_cjs.Badge; }
457
+ get: function () { return chunkOU5OZKYH_cjs.Badge; }
458
458
  });
459
459
  Object.defineProperty(exports, "Carousel", {
460
460
  enumerable: true,
461
- get: function () { return chunkQDFPJJ5Y_cjs.Carousel; }
461
+ get: function () { return chunkOU5OZKYH_cjs.Carousel; }
462
462
  });
463
463
  Object.defineProperty(exports, "CarouselContent", {
464
464
  enumerable: true,
465
- get: function () { return chunkQDFPJJ5Y_cjs.CarouselContent; }
465
+ get: function () { return chunkOU5OZKYH_cjs.CarouselContent; }
466
466
  });
467
467
  Object.defineProperty(exports, "CarouselItem", {
468
468
  enumerable: true,
469
- get: function () { return chunkQDFPJJ5Y_cjs.CarouselItem; }
469
+ get: function () { return chunkOU5OZKYH_cjs.CarouselItem; }
470
470
  });
471
471
  Object.defineProperty(exports, "CarouselNext", {
472
472
  enumerable: true,
473
- get: function () { return chunkQDFPJJ5Y_cjs.CarouselNext; }
473
+ get: function () { return chunkOU5OZKYH_cjs.CarouselNext; }
474
474
  });
475
475
  Object.defineProperty(exports, "CarouselPrevious", {
476
476
  enumerable: true,
477
- get: function () { return chunkQDFPJJ5Y_cjs.CarouselPrevious; }
477
+ get: function () { return chunkOU5OZKYH_cjs.CarouselPrevious; }
478
478
  });
479
479
  Object.defineProperty(exports, "Dialog", {
480
480
  enumerable: true,
481
- get: function () { return chunkQDFPJJ5Y_cjs.Dialog; }
481
+ get: function () { return chunkOU5OZKYH_cjs.Dialog; }
482
482
  });
483
483
  Object.defineProperty(exports, "DialogClose", {
484
484
  enumerable: true,
485
- get: function () { return chunkQDFPJJ5Y_cjs.DialogClose; }
485
+ get: function () { return chunkOU5OZKYH_cjs.DialogClose; }
486
486
  });
487
487
  Object.defineProperty(exports, "DialogContent", {
488
488
  enumerable: true,
489
- get: function () { return chunkQDFPJJ5Y_cjs.DialogContent; }
489
+ get: function () { return chunkOU5OZKYH_cjs.DialogContent; }
490
490
  });
491
491
  Object.defineProperty(exports, "DialogDescription", {
492
492
  enumerable: true,
493
- get: function () { return chunkQDFPJJ5Y_cjs.DialogDescription; }
493
+ get: function () { return chunkOU5OZKYH_cjs.DialogDescription; }
494
494
  });
495
495
  Object.defineProperty(exports, "DialogFooter", {
496
496
  enumerable: true,
497
- get: function () { return chunkQDFPJJ5Y_cjs.DialogFooter; }
497
+ get: function () { return chunkOU5OZKYH_cjs.DialogFooter; }
498
498
  });
499
499
  Object.defineProperty(exports, "DialogHeader", {
500
500
  enumerable: true,
501
- get: function () { return chunkQDFPJJ5Y_cjs.DialogHeader; }
501
+ get: function () { return chunkOU5OZKYH_cjs.DialogHeader; }
502
502
  });
503
503
  Object.defineProperty(exports, "DialogTitle", {
504
504
  enumerable: true,
505
- get: function () { return chunkQDFPJJ5Y_cjs.DialogTitle; }
505
+ get: function () { return chunkOU5OZKYH_cjs.DialogTitle; }
506
506
  });
507
507
  Object.defineProperty(exports, "DialogTrigger", {
508
508
  enumerable: true,
509
- get: function () { return chunkQDFPJJ5Y_cjs.DialogTrigger; }
509
+ get: function () { return chunkOU5OZKYH_cjs.DialogTrigger; }
510
510
  });
511
511
  Object.defineProperty(exports, "DropdownMenu", {
512
512
  enumerable: true,
513
- get: function () { return chunkQDFPJJ5Y_cjs.DropdownMenu; }
513
+ get: function () { return chunkOU5OZKYH_cjs.DropdownMenu; }
514
514
  });
515
515
  Object.defineProperty(exports, "DropdownMenuContent", {
516
516
  enumerable: true,
517
- get: function () { return chunkQDFPJJ5Y_cjs.DropdownMenuContent; }
517
+ get: function () { return chunkOU5OZKYH_cjs.DropdownMenuContent; }
518
518
  });
519
519
  Object.defineProperty(exports, "DropdownMenuItem", {
520
520
  enumerable: true,
521
- get: function () { return chunkQDFPJJ5Y_cjs.DropdownMenuItem; }
521
+ get: function () { return chunkOU5OZKYH_cjs.DropdownMenuItem; }
522
522
  });
523
523
  Object.defineProperty(exports, "DropdownMenuTrigger", {
524
524
  enumerable: true,
525
- get: function () { return chunkQDFPJJ5Y_cjs.DropdownMenuTrigger; }
525
+ get: function () { return chunkOU5OZKYH_cjs.DropdownMenuTrigger; }
526
526
  });
527
527
  Object.defineProperty(exports, "Input", {
528
528
  enumerable: true,
529
- get: function () { return chunkQDFPJJ5Y_cjs.Input; }
529
+ get: function () { return chunkOU5OZKYH_cjs.Input; }
530
530
  });
531
531
  Object.defineProperty(exports, "Progress", {
532
532
  enumerable: true,
533
- get: function () { return chunkQDFPJJ5Y_cjs.Progress; }
533
+ get: function () { return chunkOU5OZKYH_cjs.Progress; }
534
534
  });
535
535
  Object.defineProperty(exports, "ScrollArea", {
536
536
  enumerable: true,
537
- get: function () { return chunkQDFPJJ5Y_cjs.ScrollArea; }
537
+ get: function () { return chunkOU5OZKYH_cjs.ScrollArea; }
538
538
  });
539
539
  Object.defineProperty(exports, "ScrollBar", {
540
540
  enumerable: true,
541
- get: function () { return chunkQDFPJJ5Y_cjs.ScrollBar; }
541
+ get: function () { return chunkOU5OZKYH_cjs.ScrollBar; }
542
542
  });
543
543
  Object.defineProperty(exports, "Select", {
544
544
  enumerable: true,
545
- get: function () { return chunkQDFPJJ5Y_cjs.Select; }
545
+ get: function () { return chunkOU5OZKYH_cjs.Select; }
546
546
  });
547
547
  Object.defineProperty(exports, "SelectContent", {
548
548
  enumerable: true,
549
- get: function () { return chunkQDFPJJ5Y_cjs.SelectContent; }
549
+ get: function () { return chunkOU5OZKYH_cjs.SelectContent; }
550
550
  });
551
551
  Object.defineProperty(exports, "SelectItem", {
552
552
  enumerable: true,
553
- get: function () { return chunkQDFPJJ5Y_cjs.SelectItem; }
553
+ get: function () { return chunkOU5OZKYH_cjs.SelectItem; }
554
554
  });
555
555
  Object.defineProperty(exports, "SelectTrigger", {
556
556
  enumerable: true,
557
- get: function () { return chunkQDFPJJ5Y_cjs.SelectTrigger; }
557
+ get: function () { return chunkOU5OZKYH_cjs.SelectTrigger; }
558
558
  });
559
559
  Object.defineProperty(exports, "SelectValue", {
560
560
  enumerable: true,
561
- get: function () { return chunkQDFPJJ5Y_cjs.SelectValue; }
561
+ get: function () { return chunkOU5OZKYH_cjs.SelectValue; }
562
562
  });
563
563
  Object.defineProperty(exports, "Separator", {
564
564
  enumerable: true,
565
- get: function () { return chunkQDFPJJ5Y_cjs.Separator; }
566
- });
567
- Object.defineProperty(exports, "Textarea", {
568
- enumerable: true,
569
- get: function () { return chunkQDFPJJ5Y_cjs.Textarea; }
565
+ get: function () { return chunkOU5OZKYH_cjs.Separator; }
570
566
  });
571
567
  Object.defineProperty(exports, "Tooltip", {
572
568
  enumerable: true,
573
- get: function () { return chunkQDFPJJ5Y_cjs.Tooltip; }
569
+ get: function () { return chunkOU5OZKYH_cjs.Tooltip; }
574
570
  });
575
571
  Object.defineProperty(exports, "TooltipContent", {
576
572
  enumerable: true,
577
- get: function () { return chunkQDFPJJ5Y_cjs.TooltipContent; }
573
+ get: function () { return chunkOU5OZKYH_cjs.TooltipContent; }
578
574
  });
579
575
  Object.defineProperty(exports, "TooltipProvider", {
580
576
  enumerable: true,
581
- get: function () { return chunkQDFPJJ5Y_cjs.TooltipProvider; }
577
+ get: function () { return chunkOU5OZKYH_cjs.TooltipProvider; }
582
578
  });
583
579
  Object.defineProperty(exports, "TooltipTrigger", {
584
580
  enumerable: true,
585
- get: function () { return chunkQDFPJJ5Y_cjs.TooltipTrigger; }
581
+ get: function () { return chunkOU5OZKYH_cjs.TooltipTrigger; }
586
582
  });
587
583
  Object.defineProperty(exports, "Button", {
588
584
  enumerable: true,
589
- get: function () { return chunkC24QG43M_cjs.Button; }
585
+ get: function () { return chunkTZ7EM3EG_cjs.Button; }
590
586
  });
591
587
  Object.defineProperty(exports, "Collapsible", {
592
588
  enumerable: true,
593
- get: function () { return chunkC24QG43M_cjs.Collapsible; }
589
+ get: function () { return chunkTZ7EM3EG_cjs.Collapsible; }
594
590
  });
595
591
  Object.defineProperty(exports, "CollapsibleContent", {
596
592
  enumerable: true,
597
- get: function () { return chunkC24QG43M_cjs.CollapsibleContent; }
593
+ get: function () { return chunkTZ7EM3EG_cjs.CollapsibleContent; }
598
594
  });
599
595
  Object.defineProperty(exports, "CollapsibleTrigger", {
600
596
  enumerable: true,
601
- get: function () { return chunkC24QG43M_cjs.CollapsibleTrigger; }
597
+ get: function () { return chunkTZ7EM3EG_cjs.CollapsibleTrigger; }
598
+ });
599
+ Object.defineProperty(exports, "Textarea", {
600
+ enumerable: true,
601
+ get: function () { return chunkTZ7EM3EG_cjs.Textarea; }
602
602
  });
603
603
  Object.defineProperty(exports, "Spinner", {
604
604
  enumerable: true,
package/dist/ui.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- export { Alert, AlertDescription, AlertTitle, Badge, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, Input, Progress, ScrollArea, ScrollBar, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Separator, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './chunk-KVEJAPWA.js';
3
- export { Button, Collapsible, CollapsibleContent, CollapsibleTrigger } from './chunk-7L4FS6G7.js';
2
+ export { Alert, AlertDescription, AlertTitle, Badge, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, Input, Progress, ScrollArea, ScrollBar, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Separator, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './chunk-3KSMOHNY.js';
3
+ export { Button, Collapsible, CollapsibleContent, CollapsibleTrigger, Textarea } from './chunk-JHWSG5IB.js';
4
4
  export { Spinner } from './chunk-4QT25AXI.js';
5
5
  export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from './chunk-NPJKLYLV.js';
6
6
  import { cn } from './chunk-3RW7O444.js';
package/llms.txt CHANGED
@@ -68,9 +68,33 @@ Peer deps required: `react>=19`, `react-dom>=19`. The CSS import is required for
68
68
 
69
69
  ## Slots
70
70
 
71
- Replace any UI piece via the `slots` prop:
71
+ Replace any UI piece via the `slots` prop. Every slot receives `DefaultComponent` as a prop so you can compose with — or fully replace — the built-in UI.
72
72
 
73
- `header`, `welcome`, `message`, `input`, `footer`, `loader`, `suggestions`, `tools` (keyed per tool name).
73
+ **Available slot names:**
74
+
75
+ - `header`, `footer`, `input`, `welcomePage`, `loader` — layout chrome
76
+ - `assistantMessage`, `userMessage`, `systemMessage` — per-role message rendering
77
+ - `feedback` — thumbs-up/down + copy row under assistant messages
78
+ - `emptyState` — shown when no messages and no welcome
79
+ - `tools` — `Record<toolName, Component>` (keyed by **tool name**, e.g. `searchProducts`)
80
+ - `toolRenderers` — `Record<renderMode, Component>` (keyed by **render mode**, e.g. `visualization`)
81
+ - `liveChatPanel`, `satisfactionRating`, `visitorIdentityForm`, `floatingButton` — live-chat + widget chrome
82
+
83
+ **Common confusion:** `tools` is by **tool name**, `toolRenderers` is by **render mode**. If you want to override a specific tool's display, use `tools`. In dev mode the SDK emits a console warning if a tool name leaks into `toolRenderers`.
84
+
85
+ ```tsx
86
+ import type { AssistantMessageSlotProps } from "@aigentyc/chat-sdk";
87
+
88
+ function MyAssistantMsg({ text, DefaultComponent, ...rest }: AssistantMessageSlotProps & { DefaultComponent: any }) {
89
+ return (
90
+ <div className="my-wrapper">
91
+ <DefaultComponent text={text} {...rest} />
92
+ </div>
93
+ );
94
+ }
95
+
96
+ <Chat slots={{ assistantMessage: MyAssistantMsg }} projectId="..." apiEndpoint="..." />
97
+ ```
74
98
 
75
99
  ## Tool rendering
76
100
 
@@ -285,17 +309,163 @@ import { useAigentycChat } from "@aigentyc/chat-sdk/hooks";
285
309
 
286
310
  const { newConversation, clearMessages } = useAigentycChat({ projectId: "...", apiEndpoint: "..." });
287
311
 
288
- <button onClick={newConversation}>New conversation</button> // new sessionId + clears
289
- <button onClick={clearMessages}>Clear messages</button> // clears, keeps session
312
+ <button onClick={newConversation}>New conversation</button> // new sessionId + clears + returns to welcome
313
+ <button onClick={clearMessages}>Clear messages</button> // clears, keeps session, returns to welcome
314
+ ```
315
+
316
+ ### Recipe: headless — full control with every event
317
+
318
+ ```tsx
319
+ "use client";
320
+ import { useAigentycChat } from "@aigentyc/chat-sdk/hooks";
321
+
322
+ export default function MyCustomChat() {
323
+ const {
324
+ messages,
325
+ status,
326
+ sendMessage,
327
+ stopGeneration,
328
+ newConversation,
329
+ clearMessages,
330
+ activeTools,
331
+ liveChat,
332
+ sessionId,
333
+ } = useAigentycChat({
334
+ projectId: "proj_...",
335
+ apiEndpoint: "https://app.aigentyc.ai",
336
+ apiKey: "tyco_pk_...",
337
+ onMessageSent: (m) => console.log("sent", m),
338
+ onMessageReceived: (m) => console.log("received", m),
339
+ onStreamStart: () => console.log("stream started"),
340
+ onStreamEnd: () => console.log("stream ended"),
341
+ onToolCall: (name, args) => console.log("tool", name, args),
342
+ onToolResult: (name, result) => console.log("tool result", name, result),
343
+ onNewConversation: (newSessionId) => console.log("new session", newSessionId),
344
+ onStopGeneration: () => console.log("stopped"),
345
+ onClearMessages: () => console.log("cleared"),
346
+ onError: (err) => console.error(err),
347
+ });
348
+
349
+ return (
350
+ <div>
351
+ <div className="history">
352
+ {messages.map((m) => (
353
+ <div key={m.id}>
354
+ <b>{m.role}:</b> {m.content}
355
+ </div>
356
+ ))}
357
+ </div>
358
+ {status === "streaming" && <button onClick={stopGeneration}>Stop</button>}
359
+ <button onClick={newConversation}>New</button>
360
+ </div>
361
+ );
362
+ }
363
+ ```
364
+
365
+ ### Recipe: control message part order (tools-first vs text-first)
366
+
367
+ ```tsx
368
+ // Text parts render before tool cards (default, best for Q&A/RAG)
369
+ <Chat messagePartOrder="text-first" projectId="..." apiEndpoint="..." />
370
+
371
+ // Tool cards render before text (best for tool-heavy apps — product cards, forms, etc.)
372
+ <Chat messagePartOrder="tools-first" projectId="..." apiEndpoint="..." />
373
+
374
+ // Render parts in the stream order (whatever the API returns)
375
+ <Chat messagePartOrder="stream-order" projectId="..." apiEndpoint="..." />
376
+ ```
377
+
378
+ ### Recipe: customize MessageFeedback (thumbs up/down) styling
379
+
380
+ ```tsx
381
+ import { MessageFeedback } from "@aigentyc/chat-sdk/ai-elements";
382
+
383
+ // Option 1: strip defaults and style from scratch
384
+ <Chat
385
+ slots={{
386
+ feedback: (props) => (
387
+ <MessageFeedback {...props} unstyled classNames={{
388
+ root: "my-feedback-row",
389
+ thumbsUp: "my-thumb-btn",
390
+ thumbsDown: "my-thumb-btn",
391
+ }} />
392
+ ),
393
+ }}
394
+ />
395
+
396
+ // Option 2: full render override
397
+ <Chat
398
+ slots={{
399
+ feedback: (props) => (
400
+ <MessageFeedback
401
+ {...props}
402
+ renderActions={({ onPositive, onNegative, onCopy, feedback }) => (
403
+ <div className="flex gap-2">
404
+ <button onClick={onPositive} className={feedback === "positive" ? "active" : ""}>👍</button>
405
+ <button onClick={onNegative} className={feedback === "negative" ? "active" : ""}>👎</button>
406
+ <button onClick={onCopy}>Copy</button>
407
+ </div>
408
+ )}
409
+ />
410
+ ),
411
+ }}
412
+ />
413
+ ```
414
+
415
+ ### Recipe: normalize messy tool data shapes
416
+
417
+ Custom tools (especially `data_store`) can return rows in a few shapes. Use the helper so renderers don't care:
418
+
419
+ ```tsx
420
+ import { normalizeToolRows } from "@aigentyc/chat-sdk";
421
+
422
+ function ProductGrid({ result }: ToolRendererProps) {
423
+ // Handles: flat array, { rows: [...] } wrapper, raw DB rows { id, data: {...} }
424
+ const rows = normalizeToolRows(result?.data);
425
+ return (
426
+ <div className="grid grid-cols-2 gap-2">
427
+ {rows.map((row, i) => <div key={i}>{row.name as string} — ${row.price as number}</div>)}
428
+ </div>
429
+ );
430
+ }
431
+ ```
432
+
433
+ ### Recipe: catch tool-renderer crashes without killing the chat
434
+
435
+ Wrap a risky slot in `ChatErrorBoundary`:
436
+
437
+ ```tsx
438
+ import { ChatErrorBoundary } from "@aigentyc/chat-sdk";
439
+
440
+ <Chat
441
+ slots={{
442
+ tools: {
443
+ myRiskyTool: (props) => (
444
+ <ChatErrorBoundary
445
+ label="product grid"
446
+ onError={(e) => Sentry.captureException(e)}
447
+ fallback={(err, retry) => <div>Failed. <button onClick={retry}>Retry</button></div>}
448
+ >
449
+ <MyProductGrid {...props} />
450
+ </ChatErrorBoundary>
451
+ ),
452
+ },
453
+ }}
454
+ />
290
455
  ```
456
+ The built-in tool dispatcher already wraps each tool in a boundary, so a single broken renderer never takes down the rest of the chat. Use `ChatErrorBoundary` manually only around custom slots you haven't tested in production.
291
457
 
292
458
  ## Troubleshooting
293
459
 
294
460
  | Symptom | Likely cause | Fix |
295
461
  | --- | --- | --- |
296
462
  | Unstyled / broken layout | Missing CSS import | `import "@aigentyc/chat-sdk/theme/styles.css"` |
297
- | 401 / 403 from API | `apiKey` missing or wrong scope | Create key with `Chat: Full` permission |
463
+ | 401 / "Missing Authorization" on embed | No `apiKey` passed — required for all third-party domain embeds | Pass `apiKey` prop (or `NEXT_PUBLIC_AIGENTYC_API_KEY` / `VITE_AIGENTYC_API_KEY` env var). The "no apiKey needed" path only works inside `app.aigentyc.com` itself (session cookie). |
464
+ | 403 / invalid origin | API key's Allowed Origins list doesn't include your embed domain | Dashboard → Settings → API Keys → edit → add domain |
298
465
  | CORS error in browser | Allowed Origins on API key doesn't include current URL | Add `http://localhost:5173` (Vite) or `http://localhost:3000` (Next) to the key's Allowed Origins |
466
+ | Slot override doesn't render | Using `toolRenderers` keyed by tool name | Use `tools` for per-tool overrides; `toolRenderers` is per render mode. Dev console warns automatically. |
467
+ | Welcome doesn't reappear after "new conversation" | Old SDK version (pre-0.2) | Upgrade — `newConversation()` now triggers a bidirectional welcome toggle |
468
+ | Dark mode leaks white backgrounds | Custom CSS / old SDK | As of 0.2, internal components use `bg-background`/`bg-card` vars — upgrade if you see white leaks |
299
469
  | `Cannot find module @ai-sdk/react` | Stale install from old SDK version | `rm -rf node_modules package-lock.json && npm install` (peers are bundled now) |
300
470
  | Hebrew text shows LTR | Forgot `language="he"` | Pass `language="he"` to `<Chat>` |
301
471
  | Tool result shows raw JSON | Custom tool with no renderer | Add `slots.tools[toolName]` or set `uiRenderMode: "hidden"` server-side |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigentyc/chat-sdk",
3
- "version": "0.2.4",
3
+ "version": "0.3.0",
4
4
  "description": "React SDK for building AI-powered chat interfaces connected to the Aigentyc platform",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -115,6 +115,7 @@
115
115
  "files": [
116
116
  "dist",
117
117
  "bin",
118
+ "claude-skill",
118
119
  "README.md",
119
120
  "AGENTS.md",
120
121
  "llms.txt",