glirastes 0.3.0 → 0.3.1

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 (310) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/README.md +146 -9
  3. package/codegen/package.json +5 -0
  4. package/dist/cjs/codegen/asset-sync.d.ts +20 -0
  5. package/dist/cjs/codegen/asset-sync.js +28 -0
  6. package/dist/cjs/codegen/coverage.d.ts +66 -0
  7. package/dist/cjs/codegen/coverage.js +408 -0
  8. package/dist/cjs/codegen/endpoint-scanner.d.ts +16 -0
  9. package/dist/cjs/codegen/endpoint-scanner.js +197 -0
  10. package/dist/cjs/codegen/format.d.ts +17 -0
  11. package/dist/cjs/codegen/format.js +34 -0
  12. package/dist/cjs/codegen/fs-utils.d.ts +45 -0
  13. package/dist/cjs/codegen/fs-utils.js +165 -0
  14. package/dist/cjs/codegen/index.d.ts +13 -0
  15. package/dist/cjs/codegen/index.js +33 -0
  16. package/dist/cjs/codegen/mcp-generator.d.ts +50 -0
  17. package/dist/cjs/codegen/mcp-generator.js +803 -0
  18. package/dist/cjs/codegen/module-generator.d.ts +11 -0
  19. package/dist/cjs/codegen/module-generator.js +353 -0
  20. package/dist/cjs/codegen/nestjs-scanner.d.ts +43 -0
  21. package/dist/cjs/codegen/nestjs-scanner.js +241 -0
  22. package/dist/cjs/codegen/output-recommender.d.ts +23 -0
  23. package/dist/cjs/codegen/output-recommender.js +33 -0
  24. package/dist/cjs/codegen/scaffolder.d.ts +36 -0
  25. package/dist/cjs/codegen/scaffolder.js +262 -0
  26. package/dist/cjs/codegen/skill-generator.d.ts +49 -0
  27. package/dist/cjs/codegen/skill-generator.js +967 -0
  28. package/dist/cjs/codegen/types.d.ts +52 -0
  29. package/dist/cjs/codegen/types.js +16 -0
  30. package/dist/cjs/codegen/ui-scanner.d.ts +24 -0
  31. package/dist/cjs/codegen/ui-scanner.js +202 -0
  32. package/dist/cjs/codegen/validator.d.ts +35 -0
  33. package/dist/cjs/codegen/validator.js +292 -0
  34. package/dist/cjs/index.d.ts +1 -0
  35. package/dist/cjs/index.js +23 -0
  36. package/dist/cjs/openapi/index.d.ts +78 -0
  37. package/dist/cjs/openapi/index.js +347 -0
  38. package/dist/cjs/package.json +1 -0
  39. package/dist/cjs/react/audio-worklet-processor.d.ts +16 -0
  40. package/dist/cjs/react/audio-worklet-processor.js +27 -0
  41. package/dist/cjs/react/bridges/rest-session-bridge.d.ts +113 -0
  42. package/dist/cjs/react/bridges/rest-session-bridge.js +209 -0
  43. package/dist/cjs/react/components/ai-chat-panel.d.ts +12 -0
  44. package/dist/cjs/react/components/ai-chat-panel.js +67 -0
  45. package/dist/cjs/react/components/ai-trigger-button.d.ts +2 -0
  46. package/dist/cjs/react/components/ai-trigger-button.js +239 -0
  47. package/dist/cjs/react/components/approval-card.d.ts +9 -0
  48. package/dist/cjs/react/components/approval-card.js +24 -0
  49. package/dist/cjs/react/components/bulk-approval-card.d.ts +9 -0
  50. package/dist/cjs/react/components/bulk-approval-card.js +36 -0
  51. package/dist/cjs/react/components/chat-input.d.ts +10 -0
  52. package/dist/cjs/react/components/chat-input.js +60 -0
  53. package/dist/cjs/react/components/chat-window.d.ts +2 -0
  54. package/dist/cjs/react/components/chat-window.js +134 -0
  55. package/dist/cjs/react/components/confirm-dialog.d.ts +32 -0
  56. package/dist/cjs/react/components/confirm-dialog.js +48 -0
  57. package/dist/cjs/react/components/floating-chat-ui.d.ts +90 -0
  58. package/dist/cjs/react/components/floating-chat-ui.js +163 -0
  59. package/dist/cjs/react/components/mention-chip.d.ts +16 -0
  60. package/dist/cjs/react/components/mention-chip.js +42 -0
  61. package/dist/cjs/react/components/mention-input.d.ts +8 -0
  62. package/dist/cjs/react/components/mention-input.js +117 -0
  63. package/dist/cjs/react/components/message-bubble.d.ts +11 -0
  64. package/dist/cjs/react/components/message-bubble.js +171 -0
  65. package/dist/cjs/react/components/message-list.d.ts +8 -0
  66. package/dist/cjs/react/components/message-list.js +52 -0
  67. package/dist/cjs/react/components/pipeline-timeline.d.ts +7 -0
  68. package/dist/cjs/react/components/pipeline-timeline.js +72 -0
  69. package/dist/cjs/react/components/recording-bar.d.ts +2 -0
  70. package/dist/cjs/react/components/recording-bar.js +81 -0
  71. package/dist/cjs/react/components/recording-controls.d.ts +18 -0
  72. package/dist/cjs/react/components/recording-controls.js +38 -0
  73. package/dist/cjs/react/components/rich-mention-input.d.ts +2 -0
  74. package/dist/cjs/react/components/rich-mention-input.js +571 -0
  75. package/dist/cjs/react/components/session-switcher.d.ts +14 -0
  76. package/dist/cjs/react/components/session-switcher.js +133 -0
  77. package/dist/cjs/react/components/suggestion-bar.d.ts +9 -0
  78. package/dist/cjs/react/components/suggestion-bar.js +47 -0
  79. package/dist/cjs/react/components/suggestion-chip.d.ts +9 -0
  80. package/dist/cjs/react/components/suggestion-chip.js +14 -0
  81. package/dist/cjs/react/components/voice-input-addon.d.ts +13 -0
  82. package/dist/cjs/react/components/voice-input-addon.js +31 -0
  83. package/dist/cjs/react/components/voice-input-button.d.ts +2 -0
  84. package/dist/cjs/react/components/voice-input-button.js +55 -0
  85. package/dist/cjs/react/components/wavesurfer-loader.d.ts +5 -0
  86. package/dist/cjs/react/components/wavesurfer-loader.js +36 -0
  87. package/dist/cjs/react/hooks/use-ai-chat.d.ts +22 -0
  88. package/dist/cjs/react/hooks/use-ai-chat.js +51 -0
  89. package/dist/cjs/react/hooks/use-approvals.d.ts +23 -0
  90. package/dist/cjs/react/hooks/use-approvals.js +63 -0
  91. package/dist/cjs/react/hooks/use-deepgram-transcription.d.ts +2 -0
  92. package/dist/cjs/react/hooks/use-deepgram-transcription.js +329 -0
  93. package/dist/cjs/react/hooks/use-drag-resize-panel.d.ts +48 -0
  94. package/dist/cjs/react/hooks/use-drag-resize-panel.js +308 -0
  95. package/dist/cjs/react/hooks/use-draggable-position.d.ts +25 -0
  96. package/dist/cjs/react/hooks/use-draggable-position.js +134 -0
  97. package/dist/cjs/react/hooks/use-keyboard-shortcut.d.ts +20 -0
  98. package/dist/cjs/react/hooks/use-keyboard-shortcut.js +93 -0
  99. package/dist/cjs/react/hooks/use-mentions.d.ts +23 -0
  100. package/dist/cjs/react/hooks/use-mentions.js +42 -0
  101. package/dist/cjs/react/hooks/use-suggestions.d.ts +22 -0
  102. package/dist/cjs/react/hooks/use-suggestions.js +39 -0
  103. package/dist/cjs/react/index.d.ts +43 -0
  104. package/dist/cjs/react/index.js +111 -0
  105. package/dist/cjs/react/provider/ai-chat-provider.d.ts +45 -0
  106. package/dist/cjs/react/provider/ai-chat-provider.js +1024 -0
  107. package/dist/cjs/react/provider/chat-context.d.ts +84 -0
  108. package/dist/cjs/react/provider/chat-context.js +13 -0
  109. package/dist/cjs/react/template.d.ts +84 -0
  110. package/dist/cjs/react/template.js +90 -0
  111. package/dist/cjs/react/themes.d.ts +24 -0
  112. package/dist/cjs/react/themes.js +273 -0
  113. package/dist/cjs/react/transports/langgraph/index.d.ts +2 -0
  114. package/dist/cjs/react/transports/langgraph/index.js +8 -0
  115. package/dist/cjs/react/transports/langgraph/langgraph-ai-chat.d.ts +62 -0
  116. package/dist/cjs/react/transports/langgraph/langgraph-ai-chat.js +94 -0
  117. package/dist/cjs/react/transports/langgraph.d.ts +71 -0
  118. package/dist/cjs/react/transports/langgraph.js +369 -0
  119. package/dist/cjs/react/transports/vercel/index.d.ts +2 -0
  120. package/dist/cjs/react/transports/vercel/index.js +8 -0
  121. package/dist/cjs/react/transports/vercel/vercel-ai-chat.d.ts +49 -0
  122. package/dist/cjs/react/transports/vercel/vercel-ai-chat.js +81 -0
  123. package/dist/cjs/react/transports/vercel.d.ts +30 -0
  124. package/dist/cjs/react/transports/vercel.js +69 -0
  125. package/dist/cjs/react/types.d.ts +760 -0
  126. package/dist/cjs/react/types.js +2 -0
  127. package/dist/cjs/react/ui.d.ts +73 -0
  128. package/dist/cjs/react/ui.js +183 -0
  129. package/dist/cjs/react/utils/create-approval-description.d.ts +53 -0
  130. package/dist/cjs/react/utils/create-approval-description.js +122 -0
  131. package/dist/cjs/react/utils/create-tool-result-handler.d.ts +90 -0
  132. package/dist/cjs/react/utils/create-tool-result-handler.js +168 -0
  133. package/dist/cjs/react/utils/mention-markup.d.ts +13 -0
  134. package/dist/cjs/react/utils/mention-markup.js +117 -0
  135. package/dist/cjs/react/utils/merge-pipeline-steps.d.ts +19 -0
  136. package/dist/cjs/react/utils/merge-pipeline-steps.js +81 -0
  137. package/dist/cjs/react/utils/sanitize-stored-messages.d.ts +23 -0
  138. package/dist/cjs/react/utils/sanitize-stored-messages.js +52 -0
  139. package/dist/cjs/server/adapters/nestjs/chat/ai-chat-auth.guard.d.ts +10 -0
  140. package/dist/cjs/server/adapters/nestjs/chat/ai-chat-auth.guard.js +42 -0
  141. package/dist/cjs/server/adapters/nestjs/chat/ai-chat-module-options.interface.d.ts +32 -0
  142. package/dist/cjs/server/adapters/nestjs/chat/ai-chat-module-options.interface.js +4 -0
  143. package/dist/cjs/server/adapters/nestjs/chat/ai-chat.controller.d.ts +11 -0
  144. package/dist/cjs/server/adapters/nestjs/chat/ai-chat.controller.js +80 -0
  145. package/dist/cjs/server/adapters/nestjs/chat/ai-chat.module.d.ts +9 -0
  146. package/dist/cjs/server/adapters/nestjs/chat/ai-chat.module.js +119 -0
  147. package/dist/cjs/server/adapters/nestjs/chat/ai-chat.service.d.ts +13 -0
  148. package/dist/cjs/server/adapters/nestjs/chat/ai-chat.service.js +131 -0
  149. package/dist/cjs/server/adapters/nestjs/chat/dto/ai-chat-request.dto.d.ts +7 -0
  150. package/dist/cjs/server/adapters/nestjs/chat/dto/ai-chat-request.dto.js +52 -0
  151. package/dist/cjs/server/adapters/nestjs/chat/dto/chat-message-part.dto.d.ts +19 -0
  152. package/dist/cjs/server/adapters/nestjs/chat/dto/chat-message-part.dto.js +108 -0
  153. package/dist/cjs/server/adapters/nestjs/chat/dto/chat-message.dto.d.ts +8 -0
  154. package/dist/cjs/server/adapters/nestjs/chat/dto/chat-message.dto.js +59 -0
  155. package/dist/cjs/server/adapters/nestjs/chat/dto/index.d.ts +3 -0
  156. package/dist/cjs/server/adapters/nestjs/chat/dto/index.js +9 -0
  157. package/dist/cjs/server/adapters/nestjs/chat/index.d.ts +3 -0
  158. package/dist/cjs/server/adapters/nestjs/chat/index.js +9 -0
  159. package/dist/cjs/server/adapters/nestjs/chat/speech-stream.gateway.d.ts +4 -0
  160. package/dist/cjs/server/adapters/nestjs/chat/speech-stream.gateway.js +73 -0
  161. package/dist/cjs/server/adapters/nestjs/chat/ws-loader.d.ts +5 -0
  162. package/dist/cjs/server/adapters/nestjs/chat/ws-loader.js +72 -0
  163. package/dist/cjs/server/adapters/nestjs/decorators/ai-module.decorator.d.ts +6 -0
  164. package/dist/cjs/server/adapters/nestjs/decorators/ai-module.decorator.js +13 -0
  165. package/dist/cjs/server/adapters/nestjs/decorators/ai-param.decorator.d.ts +5 -0
  166. package/dist/cjs/server/adapters/nestjs/decorators/ai-param.decorator.js +15 -0
  167. package/dist/cjs/server/adapters/nestjs/decorators/ai-tool.decorator.d.ts +6 -0
  168. package/dist/cjs/server/adapters/nestjs/decorators/ai-tool.decorator.js +22 -0
  169. package/dist/cjs/server/adapters/nestjs/decorators/constants.d.ts +4 -0
  170. package/dist/cjs/server/adapters/nestjs/decorators/constants.js +7 -0
  171. package/dist/cjs/server/adapters/nestjs/index.d.ts +14 -0
  172. package/dist/cjs/server/adapters/nestjs/index.js +42 -0
  173. package/dist/cjs/server/adapters/nestjs/metadata.d.ts +39 -0
  174. package/dist/cjs/server/adapters/nestjs/metadata.js +36 -0
  175. package/dist/cjs/server/adapters/nestjs/module/ai-tools-explorer.service.d.ts +36 -0
  176. package/dist/cjs/server/adapters/nestjs/module/ai-tools-explorer.service.js +159 -0
  177. package/dist/cjs/server/adapters/nestjs/module/ai-tools.module.d.ts +37 -0
  178. package/dist/cjs/server/adapters/nestjs/module/ai-tools.module.js +44 -0
  179. package/dist/cjs/server/adapters/nestjs/module/ai-tools.service.d.ts +28 -0
  180. package/dist/cjs/server/adapters/nestjs/module/ai-tools.service.js +41 -0
  181. package/dist/cjs/server/adapters/nestjs/scanner/nestjs-scanner.d.ts +16 -0
  182. package/dist/cjs/server/adapters/nestjs/scanner/nestjs-scanner.js +117 -0
  183. package/dist/cjs/server/adapters/nestjs/scanner/schema-builder.d.ts +26 -0
  184. package/dist/cjs/server/adapters/nestjs/scanner/schema-builder.js +259 -0
  185. package/dist/cjs/server/adapters/nestjs/swagger.d.ts +7 -0
  186. package/dist/cjs/server/adapters/nestjs/swagger.js +39 -0
  187. package/dist/cjs/server/adapters/nextjs/context-helpers.d.ts +22 -0
  188. package/dist/cjs/server/adapters/nextjs/context-helpers.js +60 -0
  189. package/dist/cjs/server/adapters/nextjs/create-ai-chat-handler.d.ts +94 -0
  190. package/dist/cjs/server/adapters/nextjs/create-ai-chat-handler.js +965 -0
  191. package/dist/cjs/server/adapters/nextjs/filter-fallback-error.d.ts +11 -0
  192. package/dist/cjs/server/adapters/nextjs/filter-fallback-error.js +41 -0
  193. package/dist/cjs/server/adapters/nextjs/index.d.ts +8 -0
  194. package/dist/cjs/server/adapters/nextjs/index.js +22 -0
  195. package/dist/cjs/server/adapters/nextjs/prepare-model-messages.d.ts +58 -0
  196. package/dist/cjs/server/adapters/nextjs/prepare-model-messages.js +114 -0
  197. package/dist/cjs/server/adapters/nextjs/sanitize-model-messages.d.ts +64 -0
  198. package/dist/cjs/server/adapters/nextjs/sanitize-model-messages.js +489 -0
  199. package/dist/cjs/server/adapters/nextjs/server-action-helper.d.ts +7 -0
  200. package/dist/cjs/server/adapters/nextjs/server-action-helper.js +40 -0
  201. package/dist/cjs/server/adapters/nextjs/types.d.ts +246 -0
  202. package/dist/cjs/server/adapters/nextjs/types.js +2 -0
  203. package/dist/cjs/server/adapters/nextjs/with-ai-tool.d.ts +9 -0
  204. package/dist/cjs/server/adapters/nextjs/with-ai-tool.js +12 -0
  205. package/dist/cjs/server/core/followup-tool.d.ts +9 -0
  206. package/dist/cjs/server/core/followup-tool.js +82 -0
  207. package/dist/cjs/server/core/index.d.ts +139 -0
  208. package/dist/cjs/server/core/index.js +818 -0
  209. package/dist/cjs/server/core/intent-classifier.d.ts +94 -0
  210. package/dist/cjs/server/core/intent-classifier.js +324 -0
  211. package/dist/cjs/server/core/model-selector.d.ts +12 -0
  212. package/dist/cjs/server/core/model-selector.js +48 -0
  213. package/dist/cjs/server/core/module-router.d.ts +14 -0
  214. package/dist/cjs/server/core/module-router.js +110 -0
  215. package/dist/cjs/server/core/zod-compact.d.ts +18 -0
  216. package/dist/cjs/server/core/zod-compact.js +129 -0
  217. package/dist/cjs/server/index.d.ts +6 -0
  218. package/dist/cjs/server/index.js +28 -0
  219. package/dist/cjs/server/lancer/cache.d.ts +9 -0
  220. package/dist/cjs/server/lancer/cache.js +33 -0
  221. package/dist/cjs/server/lancer/client.d.ts +2 -0
  222. package/dist/cjs/server/lancer/client.js +279 -0
  223. package/dist/cjs/server/lancer/errors.d.ts +13 -0
  224. package/dist/cjs/server/lancer/errors.js +21 -0
  225. package/dist/cjs/server/lancer/index.d.ts +3 -0
  226. package/dist/cjs/server/lancer/index.js +7 -0
  227. package/dist/cjs/server/lancer/telemetry-buffer.d.ts +15 -0
  228. package/dist/cjs/server/lancer/telemetry-buffer.js +64 -0
  229. package/dist/cjs/server/lancer/types.d.ts +201 -0
  230. package/dist/cjs/server/lancer/types.js +5 -0
  231. package/dist/cjs/server/pii-shield/aegis-detector.d.ts +26 -0
  232. package/dist/cjs/server/pii-shield/aegis-detector.js +26 -0
  233. package/dist/cjs/server/pii-shield/create-pii-shield.d.ts +2 -0
  234. package/dist/cjs/server/pii-shield/create-pii-shield.js +191 -0
  235. package/dist/cjs/server/pii-shield/deep-walk.d.ts +1 -0
  236. package/dist/cjs/server/pii-shield/deep-walk.js +19 -0
  237. package/dist/cjs/server/pii-shield/fake-data.d.ts +5 -0
  238. package/dist/cjs/server/pii-shield/fake-data.js +170 -0
  239. package/dist/cjs/server/pii-shield/index.d.ts +4 -0
  240. package/dist/cjs/server/pii-shield/index.js +9 -0
  241. package/dist/cjs/server/pii-shield/leakage.d.ts +1 -0
  242. package/dist/cjs/server/pii-shield/leakage.js +15 -0
  243. package/dist/cjs/server/pii-shield/session-mapping.d.ts +12 -0
  244. package/dist/cjs/server/pii-shield/session-mapping.js +70 -0
  245. package/dist/cjs/server/pipeline.d.ts +26 -0
  246. package/dist/cjs/server/pipeline.js +127 -0
  247. package/dist/cjs/server/testing/approvals.d.ts +11 -0
  248. package/dist/cjs/server/testing/approvals.js +41 -0
  249. package/dist/cjs/server/testing/combination.d.ts +3 -0
  250. package/dist/cjs/server/testing/combination.js +83 -0
  251. package/dist/cjs/server/testing/create-test-suite.d.ts +29 -0
  252. package/dist/cjs/server/testing/create-test-suite.js +81 -0
  253. package/dist/cjs/server/testing/edge-cases.d.ts +8 -0
  254. package/dist/cjs/server/testing/edge-cases.js +277 -0
  255. package/dist/cjs/server/testing/guardrails.d.ts +14 -0
  256. package/dist/cjs/server/testing/guardrails.js +152 -0
  257. package/dist/cjs/server/testing/helpers.d.ts +14 -0
  258. package/dist/cjs/server/testing/helpers.js +119 -0
  259. package/dist/cjs/server/testing/index.d.ts +12 -0
  260. package/dist/cjs/server/testing/index.js +37 -0
  261. package/dist/cjs/server/testing/mock-executor.d.ts +8 -0
  262. package/dist/cjs/server/testing/mock-executor.js +40 -0
  263. package/dist/cjs/server/testing/regression.d.ts +7 -0
  264. package/dist/cjs/server/testing/regression.js +27 -0
  265. package/dist/cjs/server/testing/routing.d.ts +12 -0
  266. package/dist/cjs/server/testing/routing.js +63 -0
  267. package/dist/cjs/server/testing/schema-consistency.d.ts +6 -0
  268. package/dist/cjs/server/testing/schema-consistency.js +56 -0
  269. package/dist/cjs/server/testing/smoke.d.ts +11 -0
  270. package/dist/cjs/server/testing/smoke.js +64 -0
  271. package/dist/cjs/server/testing/types.d.ts +156 -0
  272. package/dist/cjs/server/testing/types.js +2 -0
  273. package/dist/cjs/types.d.ts +696 -0
  274. package/dist/cjs/types.js +91 -0
  275. package/dist/cli/commands/install-skills.d.ts +17 -0
  276. package/dist/cli/commands/install-skills.js +185 -0
  277. package/dist/cli/commands/install-skills.js.map +1 -0
  278. package/dist/cli/index.js +25 -0
  279. package/dist/cli/index.js.map +1 -1
  280. package/dist/react/components/ai-trigger-button.js +4 -6
  281. package/dist/react/components/ai-trigger-button.js.map +1 -1
  282. package/dist/react/components/recording-bar.js +4 -6
  283. package/dist/react/components/recording-bar.js.map +1 -1
  284. package/dist/react/components/wavesurfer-loader.d.ts +5 -0
  285. package/dist/react/components/wavesurfer-loader.js +34 -0
  286. package/dist/react/components/wavesurfer-loader.js.map +1 -0
  287. package/dist/server/adapters/nestjs/chat/ai-chat.module.d.ts +1 -1
  288. package/dist/server/adapters/nestjs/chat/ai-chat.module.js +3 -2
  289. package/dist/server/adapters/nestjs/chat/ai-chat.module.js.map +1 -1
  290. package/dist/server/adapters/nestjs/chat/speech-stream.gateway.d.ts +1 -1
  291. package/dist/server/adapters/nestjs/chat/speech-stream.gateway.js +10 -8
  292. package/dist/server/adapters/nestjs/chat/speech-stream.gateway.js.map +1 -1
  293. package/dist/server/adapters/nestjs/chat/ws-loader.d.ts +5 -0
  294. package/dist/server/adapters/nestjs/chat/ws-loader.js +37 -0
  295. package/dist/server/adapters/nestjs/chat/ws-loader.js.map +1 -0
  296. package/openapi/package.json +5 -0
  297. package/package.json +59 -16
  298. package/react/langgraph/package.json +5 -0
  299. package/react/package.json +5 -0
  300. package/react/vercel/package.json +5 -0
  301. package/server/nestjs/package.json +5 -0
  302. package/server/nextjs/package.json +5 -0
  303. package/server/package.json +5 -0
  304. package/server/testing/package.json +5 -0
  305. package/skills/README.md +107 -0
  306. package/skills/building-glirastes-chat-ui/SKILL.md +378 -0
  307. package/skills/integrating-glirastes-nestjs/SKILL.md +346 -0
  308. package/skills/integrating-glirastes-nextjs/SKILL.md +306 -0
  309. package/skills/integrating-glirastes-nextjs-with-nestjs-backend/SKILL.md +359 -0
  310. package/skills/maintaining-glirastes-tools/SKILL.md +463 -0
@@ -0,0 +1,760 @@
1
+ import type { ReactNode, ReactElement, ComponentType, MouseEvent as ReactMouseEvent } from 'react';
2
+ /**
3
+ * Data part emitted by the transport during streaming.
4
+ * Used for pipeline reports, truncation, and custom data events.
5
+ */
6
+ export interface ChatTransportDataPart {
7
+ type: string;
8
+ data: unknown;
9
+ }
10
+ /**
11
+ * Callback that receives data parts from the transport during streaming.
12
+ */
13
+ export type ChatTransportDataHandler = (dataPart: ChatTransportDataPart) => void;
14
+ /**
15
+ * Approval response sent back to the transport.
16
+ */
17
+ export interface ChatTransportApprovalResponse {
18
+ id: string;
19
+ approved: boolean;
20
+ reason?: string;
21
+ }
22
+ /**
23
+ * The core transport interface that decouples AiChatProvider from any
24
+ * specific streaming backend (Vercel AI SDK, SSE, WebSocket, LangGraph, etc.).
25
+ *
26
+ * Consumers provide a transport implementation to AiChatProvider via the
27
+ * `transport` prop (required). Pick one of the bundled transports
28
+ * (`useVercelAiChatTransport`, `useLangGraphChatTransport`) from their
29
+ * dedicated subpaths, or implement this interface for a custom backend.
30
+ *
31
+ * @example
32
+ * ```tsx
33
+ * import { AiChatProvider } from 'glirastes/react';
34
+ * import { useLangGraphChatTransport } from 'glirastes/react/langgraph';
35
+ *
36
+ * const transport = useLangGraphChatTransport({ endpoint: '/api/chat' });
37
+ * <AiChatProvider transport={transport}>
38
+ * <MessageList />
39
+ * <ChatInput />
40
+ * </AiChatProvider>
41
+ * ```
42
+ */
43
+ export interface ChatTransport {
44
+ /** Current messages in the conversation */
45
+ messages: ChatMessage[];
46
+ /** Current transport status */
47
+ status: 'ready' | 'submitted' | 'streaming' | 'error';
48
+ /** Current error, if any */
49
+ error: Error | null;
50
+ /** Send a user message */
51
+ sendMessage(opts: {
52
+ text: string;
53
+ }): Promise<void>;
54
+ /** Stop the current generation */
55
+ stop(): void;
56
+ /** Replace the message list (for session restore, sanitization) */
57
+ setMessages(messages: ChatMessage[]): void;
58
+ /** Respond to a tool approval request */
59
+ addToolApprovalResponse(response: ChatTransportApprovalResponse): void | PromiseLike<void>;
60
+ /**
61
+ * Subscribe to data parts emitted by the transport during streaming.
62
+ * Returns an unsubscribe function. AiChatProvider calls this to wire
63
+ * its internal pipeline/truncation handlers; consumers can also use it
64
+ * for custom data-part processing.
65
+ */
66
+ subscribeToData?(handler: ChatTransportDataHandler): () => void;
67
+ }
68
+ /**
69
+ * Configuration for transports that connect to an HTTP endpoint.
70
+ * Used by VercelAiChatTransport and can be used by custom transports.
71
+ */
72
+ export interface ChatTransportConfig {
73
+ /** The chat API endpoint URL */
74
+ endpoint: string;
75
+ /** Static headers or a function that returns headers per request */
76
+ headers?: Record<string, string> | (() => Record<string, string>);
77
+ /** Callback for streaming data parts (pipeline reports, truncation, etc.) */
78
+ onData?: ChatTransportDataHandler;
79
+ }
80
+ export interface UseDeepgramTranscriptionOptions {
81
+ language?: string;
82
+ baseUrl?: string;
83
+ /** Returns the current auth token for WebSocket authentication */
84
+ getToken?: () => string | null | undefined;
85
+ onInterimTranscript?: (text: string) => void;
86
+ onError?: (error: string) => void;
87
+ }
88
+ export interface UseDeepgramTranscriptionReturn {
89
+ isRecording: boolean;
90
+ isConnecting: boolean;
91
+ error: string | null;
92
+ transcript: string;
93
+ startRecording: () => Promise<void>;
94
+ stopRecording: () => string;
95
+ }
96
+ export interface VoiceInputButtonProps {
97
+ onTranscript: (text: string) => void;
98
+ disabled?: boolean;
99
+ className?: string;
100
+ language?: string;
101
+ baseUrl?: string;
102
+ /** Returns the current auth token for WebSocket authentication */
103
+ getToken?: () => string | null | undefined;
104
+ onError?: (error: string) => void;
105
+ }
106
+ export interface RecordingBarProps {
107
+ isConnecting: boolean;
108
+ onCancel: () => void;
109
+ onStop: () => void;
110
+ variant: 'trigger' | 'inline';
111
+ className?: string;
112
+ }
113
+ export interface ChatMessage {
114
+ id: string;
115
+ role: 'user' | 'assistant' | 'system';
116
+ parts: MessagePart[];
117
+ createdAt?: Date;
118
+ }
119
+ export type MessagePart = TextPart | ToolInvocationPart | ToolResultPart;
120
+ export interface TextPart {
121
+ type: 'text';
122
+ text: string;
123
+ }
124
+ export interface ToolInvocationPart {
125
+ type: 'tool-invocation';
126
+ toolInvocationId: string;
127
+ toolName: string;
128
+ args: Record<string, unknown>;
129
+ state: 'partial-call' | 'call' | 'approval-requested' | 'output-available';
130
+ result?: unknown;
131
+ }
132
+ export interface ToolResultPart {
133
+ type: 'tool-result';
134
+ toolInvocationId: string;
135
+ toolName: string;
136
+ result: unknown;
137
+ }
138
+ export interface TruncationInfo {
139
+ completedTools: string[];
140
+ message: string;
141
+ }
142
+ export interface PipelineStepUsage {
143
+ inputTokens: number;
144
+ outputTokens: number;
145
+ totalTokens: number;
146
+ }
147
+ export interface PipelineStepReport {
148
+ stepNumber: number;
149
+ finishReason: string;
150
+ toolCalls: string[];
151
+ toolResults: number;
152
+ requiresApproval: boolean;
153
+ pendingApprovals: number;
154
+ summary: string;
155
+ usage: PipelineStepUsage;
156
+ createdAt: string;
157
+ }
158
+ export type PipelineStatus = 'running' | 'completed' | 'safety-stop' | 'aborted' | 'error';
159
+ export interface PipelineState {
160
+ status: PipelineStatus;
161
+ totalSteps: number;
162
+ finishReason?: string;
163
+ maxSteps: number;
164
+ stepLimitSource: 'explicit' | 'module' | 'safety';
165
+ updatedAt: string;
166
+ message?: string;
167
+ }
168
+ export interface MentionResult {
169
+ id: string;
170
+ type: string;
171
+ label: string;
172
+ description?: string;
173
+ icon?: string;
174
+ }
175
+ export interface MentionData {
176
+ id: string;
177
+ type: string;
178
+ label: string;
179
+ [key: string]: unknown;
180
+ }
181
+ export interface MentionConfig {
182
+ search: (query: string, type: string) => Promise<MentionResult[]>;
183
+ resolve: (id: string, type: string) => Promise<MentionData>;
184
+ types: string[];
185
+ serialize?: MentionSerializationConfig;
186
+ }
187
+ export interface MentionSerializationConfig {
188
+ enabled?: boolean;
189
+ includeContextBlock?: boolean;
190
+ contextLabel?: string;
191
+ }
192
+ /**
193
+ * Lightweight summary of a chat session used by the built-in session
194
+ * switcher and any consumer UI that needs to list sessions.
195
+ */
196
+ export interface SessionSummary {
197
+ id: string;
198
+ title: string;
199
+ createdAt?: string | number;
200
+ updatedAt?: string | number;
201
+ messageCount?: number;
202
+ status?: 'active' | 'archived' | string;
203
+ }
204
+ /**
205
+ * A "wire" chat message — the shallow shape most backends persist
206
+ * (single string body, flat role). Accepted by `SessionConfig.load`
207
+ * alongside the full `ChatMessage` shape; the provider coerces it into
208
+ * SDK messages automatically so consumer bridges don't have to map
209
+ * `content → parts[0].text` themselves.
210
+ */
211
+ export interface WireChatMessage {
212
+ id: string;
213
+ role: 'user' | 'assistant' | 'system' | string;
214
+ content: string | null;
215
+ createdAt?: string | number | Date;
216
+ }
217
+ /**
218
+ * Session persistence / multi-session hooks.
219
+ *
220
+ * The original single-session surface (`save`, `load`, `clear`) is still
221
+ * supported — set `defaultActiveId` (or leave it unset for `'default'`)
222
+ * and the SDK behaves exactly as before.
223
+ *
224
+ * To opt into multi-session: provide `list`, `create`, and `remove` (and
225
+ * optionally `rename`). When all three are defined, `sessionsSupported`
226
+ * on the chat context becomes `true` and the built-in `SessionSwitcher`
227
+ * component renders.
228
+ */
229
+ export interface SessionConfig {
230
+ /** Persist messages for a session. Called after each message change. */
231
+ save?: (conversationId: string, messages: ChatMessage[]) => void | Promise<void>;
232
+ /**
233
+ * Load previously-stored messages for a session. Called on mount and
234
+ * on switch. Return either full SDK `ChatMessage`s (with `parts`) or
235
+ * flat `WireChatMessage`s (with `content`) — the provider coerces
236
+ * the wire shape automatically.
237
+ */
238
+ load?: (conversationId: string) => Array<ChatMessage | WireChatMessage> | null | Promise<Array<ChatMessage | WireChatMessage> | null>;
239
+ /**
240
+ * Clear stored messages for a session. The optional id is the session
241
+ * being cleared; when omitted the consumer may treat it as "the active
242
+ * session" (pre-existing single-session behavior).
243
+ */
244
+ clear?: (conversationId?: string) => void | Promise<void>;
245
+ /** Fetch the list of sessions for the current user. */
246
+ list?: () => Promise<SessionSummary[]>;
247
+ /** Create a new session. The returned summary becomes the active session. */
248
+ create?: (opts?: {
249
+ title?: string;
250
+ }) => Promise<SessionSummary>;
251
+ /** Delete / archive a session. */
252
+ remove?: (conversationId: string) => Promise<void>;
253
+ /** Rename a session. */
254
+ rename?: (conversationId: string, title: string) => Promise<void>;
255
+ /** Controlled active session id. When set, the consumer owns the state. */
256
+ activeId?: string;
257
+ /** Initial active session id in uncontrolled mode. Default: `'default'`. */
258
+ defaultActiveId?: string;
259
+ /** Fires when the active session changes (both controlled and uncontrolled). */
260
+ onActiveIdChange?: (id: string) => void;
261
+ }
262
+ export interface Mention {
263
+ id: string;
264
+ type: string;
265
+ displayName: string;
266
+ slug?: string;
267
+ prefix?: string;
268
+ [key: string]: unknown;
269
+ }
270
+ export interface ToolLabelConfig {
271
+ labels?: Record<string, {
272
+ singular: string;
273
+ plural: string;
274
+ }>;
275
+ }
276
+ export type ToolResultDisplayMode = 'default' | 'hidden' | 'allowlist';
277
+ export interface ToolResultDisplayConfig {
278
+ mode?: ToolResultDisplayMode;
279
+ allowlist?: string[];
280
+ }
281
+ export interface VoiceInputConfig {
282
+ enabled?: boolean;
283
+ language?: string;
284
+ baseUrl?: string;
285
+ /** Returns the current auth token for WebSocket authentication */
286
+ getToken?: () => string | null | undefined;
287
+ recordingBar?: {
288
+ enabled?: boolean;
289
+ variant?: 'trigger' | 'inline';
290
+ };
291
+ onError?: (error: string) => void;
292
+ }
293
+ export interface SuggestionsConfig {
294
+ enabled?: boolean;
295
+ count?: number;
296
+ autoSuggest?: boolean;
297
+ staticChips?: string[];
298
+ rotationInterval?: number;
299
+ }
300
+ export interface ChatClassNames {
301
+ panel?: string;
302
+ messageList?: string;
303
+ messageBubble?: string;
304
+ input?: string;
305
+ approvalCard?: string;
306
+ suggestionChip?: string;
307
+ mentionChip?: string;
308
+ bulkApprovalCard?: string;
309
+ pipelineTimeline?: string;
310
+ /**
311
+ * The floating chat window `<section>`. Set this to apply Tailwind
312
+ * classes for sizing, background, border, shadow, etc. When set,
313
+ * the SDK's inline width/height styles are dropped so your class
314
+ * wins — e.g. `classNames={{ window: 'w-[500px] h-[400px] bg-slate-900' }}`.
315
+ */
316
+ window?: string;
317
+ /** The draggable header bar at the top of the chat window. */
318
+ windowHeader?: string;
319
+ /** The scrollable body region that wraps `<AiChatPanel />`. */
320
+ windowBody?: string;
321
+ /** The floating trigger pill (outer portal wrapper). */
322
+ trigger?: string;
323
+ /** The pill-shaped button inside the trigger. */
324
+ triggerPill?: string;
325
+ /** The session switcher dropdown root. */
326
+ switcher?: string;
327
+ [key: string]: string | undefined;
328
+ }
329
+ export interface ChatComponents {
330
+ MessageBubble?: ComponentType<MessageBubbleProps>;
331
+ ChatInput?: ComponentType<ChatInputProps>;
332
+ ToolResultBlock?: ComponentType<ToolResultBlockProps>;
333
+ Markdown?: ComponentType<MarkdownProps>;
334
+ InputExtra?: ComponentType<Record<string, never>>;
335
+ ApprovalCard?: ComponentType<ApprovalCardProps>;
336
+ BulkApprovalCard?: ComponentType<BulkApprovalCardProps>;
337
+ PipelineTimeline?: ComponentType<PipelineTimelineProps>;
338
+ SuggestionChip?: ComponentType<SuggestionChipProps>;
339
+ MentionChip?: ComponentType<MentionChipProps>;
340
+ }
341
+ /**
342
+ * All user-facing strings rendered by the SDK's built-in components.
343
+ * Every key is overridable via `AiChatProviderConfig.locale` so consumers
344
+ * can bind them to `next-intl`, `react-i18next`, or any other i18n stack.
345
+ */
346
+ export interface ChatLocale {
347
+ placeholder: string;
348
+ sendButton: string;
349
+ stopButton: string;
350
+ clearButton: string;
351
+ loadMoreButton: string;
352
+ emptyState: string;
353
+ errorMessage: string;
354
+ approveButton: string;
355
+ rejectButton: string;
356
+ approveAllButton: string;
357
+ rejectAllButton: string;
358
+ continueButton: string;
359
+ dismissButton: string;
360
+ cancelButton: string;
361
+ confirmButton: string;
362
+ moreItemsLabel: string;
363
+ allCountLabel: string;
364
+ pipelineTitle: string;
365
+ pipelineRunningLabel: string;
366
+ pipelineCompletedLabel: string;
367
+ pipelineSafetyStopLabel: string;
368
+ pipelineAbortedLabel: string;
369
+ pipelineErrorLabel: string;
370
+ pipelineStepLabel: string;
371
+ pipelineApprovalPendingLabel: string;
372
+ chatTitle: string;
373
+ closeChatAriaLabel: string;
374
+ clearChatAriaLabel: string;
375
+ confirmClearPrompt: string;
376
+ triggerAriaLabel: string;
377
+ micAriaLabel: string;
378
+ stopRecordingAriaLabel: string;
379
+ cancelRecordingAriaLabel: string;
380
+ newChatLabel: string;
381
+ noSessionsLabel: string;
382
+ sessionsLoadingLabel: string;
383
+ deleteSessionAriaLabel: string;
384
+ confirmDeleteSessionPrompt: string;
385
+ renameSessionAriaLabel: string;
386
+ renameSessionPlaceholder: string;
387
+ }
388
+ /** Preprocess message text before sending */
389
+ export type OnBeforeSend = (text: string, mentions: MentionData[]) => string;
390
+ /** Called when a tool produces output — useful for app-specific dispatching */
391
+ export type OnToolResult = (toolName: string, result: unknown) => void;
392
+ /** Formats approval display for a given tool call */
393
+ export type ApprovalDescriptionFn = (toolName: string, approvalId: string, args: unknown) => PendingApproval;
394
+ /** Translates a pipeline state message (e.g. "Stopped by user.") before rendering. */
395
+ export type PipelineMessageTranslator = (message: string) => string;
396
+ /** Formats a pipeline step summary for display. Receives the full step for rich formatting. */
397
+ export type StepSummaryFormatter = (step: PipelineStepReport) => string;
398
+ export interface AiChatProviderConfig {
399
+ mentions?: MentionConfig;
400
+ toolResults?: ToolResultDisplayConfig;
401
+ voice?: VoiceInputConfig;
402
+ session?: SessionConfig;
403
+ classNames?: ChatClassNames;
404
+ components?: ChatComponents;
405
+ suggestions?: SuggestionsConfig;
406
+ /**
407
+ * Partial override for any user-facing string rendered by the SDK.
408
+ * Omitted keys fall back to the built-in English defaults.
409
+ *
410
+ * ```tsx
411
+ * const t = useTranslations('chat');
412
+ * <LangGraphAiChat
413
+ * locale={{ sendButton: t('send'), placeholder: t('placeholder') }}
414
+ * />
415
+ * ```
416
+ */
417
+ locale?: Partial<ChatLocale>;
418
+ /**
419
+ * Theme for the floating widget: a preset name (autocompleted by your
420
+ * editor) or an override object. Defaults to `'professional-lightblue'`.
421
+ *
422
+ * ```tsx
423
+ * <LangGraphAiChat theme="professional-dark" />
424
+ * <LangGraphAiChat theme={{ preset: 'minimal-white', colors: { primary: '#10b981' } }} />
425
+ * ```
426
+ */
427
+ theme?: ChatTheme;
428
+ onToolResult?: OnToolResult;
429
+ onBeforeSend?: OnBeforeSend;
430
+ approvalDescription?: ApprovalDescriptionFn;
431
+ continueMessage?: string;
432
+ toolLabels?: ToolLabelConfig;
433
+ pipelineMessageTranslator?: PipelineMessageTranslator;
434
+ stepSummaryFormatter?: StepSummaryFormatter;
435
+ }
436
+ export type ChatThemePreset = 'professional-lightblue' | 'professional-dark' | 'minimal-white' | 'vibrant-indigo' | 'terminal-green' | 'liquid-glass' | 'purple-haze' | 'blue-dream' | 'sunset-orange' | 'ocean-teal' | 'midnight-mono';
437
+ export interface ChatThemeColors {
438
+ /** Accent color — send button, pill gradient start, active session row. */
439
+ primary?: string;
440
+ /** Second stop of the pill gradient + hover accents. */
441
+ primarySoft?: string;
442
+ /** Tinted background used for hover/active states. */
443
+ primaryTint?: string;
444
+ /** Chat panel background. */
445
+ bg?: string;
446
+ /** Secondary background — header strip, code blocks, suggestion chips. */
447
+ bgMuted?: string;
448
+ /** User message bubble background. */
449
+ bubbleUser?: string;
450
+ /** Assistant message bubble background. */
451
+ bubbleAssistant?: string;
452
+ /** Primary text color. */
453
+ text?: string;
454
+ /** Muted text (subtitles, timestamps). */
455
+ textMuted?: string;
456
+ /** Border color for separators, input, window edge. */
457
+ border?: string;
458
+ /** Danger color for delete actions and error banners. */
459
+ danger?: string;
460
+ }
461
+ export interface ChatThemeOverride {
462
+ /** Base preset to inherit. Defaults to `'professional-lightblue'`. */
463
+ preset?: ChatThemePreset;
464
+ colors?: ChatThemeColors;
465
+ /** Large radius — chat window, pill. Default: `0.875rem`. */
466
+ radius?: string;
467
+ /** Small radius — bubbles, inputs, buttons. Default: `0.5rem`. */
468
+ radiusSmall?: string;
469
+ /** Font stack for the entire widget. */
470
+ fontFamily?: string;
471
+ }
472
+ export type ChatTheme = ChatThemePreset | ChatThemeOverride;
473
+ /**
474
+ * Chat window size. Pass a preset or a concrete `{ width, height }` pair.
475
+ *
476
+ * | Preset | Width × Height |
477
+ * |---------|----------------|
478
+ * | `sm` | 360 × 560 |
479
+ * | `md` | 420 × 640 (default) |
480
+ * | `lg` | 520 × 720 |
481
+ * | `xl` | 640 × 820 |
482
+ * | `full` | 100% of viewport (mobile-style) |
483
+ */
484
+ export type ChatSizePreset = 'sm' | 'md' | 'lg' | 'xl' | 'full';
485
+ /**
486
+ * A single dimension value for the chat window. Accepts:
487
+ * - `number` — pixel count (e.g. `500`)
488
+ * - CSS length string — `'500px'`, `'40vw'`, `'70vh'`, `'60%'`, `'32rem'`
489
+ *
490
+ * Viewport units (`vw`, `vh`, `%`) are resolved against the current
491
+ * window and re-computed on resize, so the chat scales with the page.
492
+ */
493
+ export type ChatDimension = number | string;
494
+ export type ChatSize = ChatSizePreset | {
495
+ width: ChatDimension;
496
+ height: ChatDimension;
497
+ };
498
+ export interface UseAiChatReturn {
499
+ messages: ChatMessage[];
500
+ send: (message: string) => void;
501
+ stop: () => void;
502
+ isLoading: boolean;
503
+ error: Error | null;
504
+ loadMore: () => void;
505
+ hasMore: boolean;
506
+ clear: () => void;
507
+ pipelineSteps: PipelineStepReport[];
508
+ pipelineState: PipelineState | null;
509
+ }
510
+ export interface PendingApproval {
511
+ id: string;
512
+ toolName: string;
513
+ args: Record<string, unknown>;
514
+ messageId: string;
515
+ /** Human-readable description of what the tool will do */
516
+ description?: string;
517
+ /** Detail lines (e.g. "Title: My Task", "Priority: High") */
518
+ details?: string[];
519
+ /** Confirm button text override */
520
+ confirmText?: string;
521
+ }
522
+ export interface UseApprovalsReturn {
523
+ pending: PendingApproval[];
524
+ approve: (id: string) => void;
525
+ reject: (id: string) => void;
526
+ grouped: Map<string, PendingApproval[]>;
527
+ approveGroup: (toolName: string) => void;
528
+ rejectGroup: (toolName: string) => void;
529
+ isProcessing: boolean;
530
+ }
531
+ export interface UseMentionsReturn {
532
+ query: string;
533
+ results: MentionResult[];
534
+ select: (result: MentionResult) => void;
535
+ activeMentions: MentionData[];
536
+ isSearching: boolean;
537
+ }
538
+ export interface UseSuggestionsReturn {
539
+ chips: string[];
540
+ refresh: () => void;
541
+ select: (suggestion: string) => void;
542
+ isGenerating: boolean;
543
+ }
544
+ export interface AiChatPanelProps {
545
+ className?: string;
546
+ defaultOpen?: boolean;
547
+ /**
548
+ * Ephemeral assistant greeting shown only when the current session
549
+ * has no messages. Purely presentational — never persisted. Disappears
550
+ * the moment the user (or the agent) adds a real message.
551
+ *
552
+ * Use case: dashboards that want a "press button → chat opens with
553
+ * a prompt" affordance without polluting the session history when
554
+ * the user closes the window without sending anything.
555
+ */
556
+ welcomeMessage?: string;
557
+ }
558
+ export interface MessageListProps {
559
+ className?: string;
560
+ }
561
+ export interface MessageBubbleProps {
562
+ message: ChatMessage;
563
+ className?: string;
564
+ }
565
+ export interface ChatInputProps {
566
+ className?: string;
567
+ onSubmit?: (message: string) => void;
568
+ }
569
+ export interface MentionInputProps {
570
+ className?: string;
571
+ onSubmit?: (message: string) => void;
572
+ }
573
+ export interface RichMentionInputHandle {
574
+ focus: () => void;
575
+ clear: () => void;
576
+ getValue: () => string;
577
+ setValue: (value: string) => void;
578
+ getMentions: () => MentionData[];
579
+ addMention: (mention: MentionData) => void;
580
+ }
581
+ export interface MentionDropdownItemProps {
582
+ result: MentionResult;
583
+ isSelected: boolean;
584
+ onClick: () => void;
585
+ }
586
+ export interface RichMentionInputComponents {
587
+ DropdownItem?: ComponentType<MentionDropdownItemProps>;
588
+ }
589
+ export interface RichMentionInputProps {
590
+ value?: string;
591
+ defaultValue?: string;
592
+ placeholder?: string;
593
+ disabled?: boolean;
594
+ className?: string;
595
+ onChange?: (nextValue: string) => void;
596
+ onSubmit?: (message: string) => void;
597
+ /** Search callback for mention autocomplete (BYOS). Return matching results for the given query and trigger character. */
598
+ onSearch?: (query: string, trigger: string) => Promise<MentionResult[]> | MentionResult[];
599
+ /** Mention data to render as inline chips on mount (e.g. pre-filled context from a detail view). */
600
+ initialMentions?: MentionData[];
601
+ /** Characters that open the autocomplete dropdown. Defaults to `['@', '/']`. */
602
+ triggers?: string[];
603
+ /** Component overrides for the autocomplete dropdown. */
604
+ components?: RichMentionInputComponents;
605
+ }
606
+ export interface ChatWindowHeaderRenderProps {
607
+ onClose: () => void;
608
+ isDragging: boolean;
609
+ onDragStart: (e: ReactMouseEvent<HTMLElement>) => void;
610
+ onDoubleClick: () => void;
611
+ }
612
+ export interface ChatWindowProps {
613
+ children: ReactNode;
614
+ title?: string;
615
+ /** Aria-label + tooltip for the default close button. */
616
+ closeChatAriaLabel?: string;
617
+ header?: ReactNode;
618
+ /**
619
+ * Extra nodes rendered between the title and the close button in the
620
+ * default header. Ignored when `renderHeader` is provided.
621
+ */
622
+ headerActions?: ReactNode;
623
+ /**
624
+ * Replace the title node in the default header — e.g. to render a
625
+ * session switcher dropdown. Ignored when `renderHeader` is provided.
626
+ */
627
+ headerTitle?: ReactNode;
628
+ renderHeader?: (props: ChatWindowHeaderRenderProps) => ReactNode;
629
+ className?: string;
630
+ headerClassName?: string;
631
+ bodyClassName?: string;
632
+ portal?: boolean;
633
+ open?: boolean;
634
+ defaultOpen?: boolean;
635
+ onOpenChange?: (open: boolean) => void;
636
+ draggable?: boolean;
637
+ resizable?: boolean;
638
+ constrainToViewport?: boolean;
639
+ width?: number;
640
+ height?: number;
641
+ minWidth?: number;
642
+ minHeight?: number;
643
+ initialPosition?: {
644
+ x: number;
645
+ y: number;
646
+ };
647
+ maxWidth?: number;
648
+ maxHeight?: number;
649
+ snapToCenter?: boolean;
650
+ snapRadius?: number;
651
+ edgeThreshold?: number;
652
+ persistDimensions?: boolean | string;
653
+ onPositionChange?: (pos: {
654
+ x: number;
655
+ y: number;
656
+ } | null) => void;
657
+ onDimensionChange?: (size: {
658
+ width: number;
659
+ height: number;
660
+ }) => void;
661
+ resizeHandleClassName?: string;
662
+ snapIndicatorClassName?: string;
663
+ }
664
+ export interface ApprovalCardProps {
665
+ approval: PendingApproval;
666
+ onApprove: (id: string) => void;
667
+ onReject: (id: string) => void;
668
+ className?: string;
669
+ isProcessing?: boolean;
670
+ }
671
+ export interface BulkApprovalCardProps {
672
+ toolName: string;
673
+ approvals: PendingApproval[];
674
+ onApproveAll: () => void;
675
+ onRejectAll: () => void;
676
+ className?: string;
677
+ isProcessing?: boolean;
678
+ }
679
+ export interface PipelineTimelineProps {
680
+ steps: PipelineStepReport[];
681
+ pipelineState: PipelineState | null;
682
+ isLoading: boolean;
683
+ onStop: () => void;
684
+ className?: string;
685
+ }
686
+ export interface SuggestionChipProps {
687
+ label: string;
688
+ onClick: () => void;
689
+ className?: string;
690
+ disabled?: boolean;
691
+ isVisible?: boolean;
692
+ }
693
+ export interface SuggestionBarProps {
694
+ className?: string;
695
+ }
696
+ export interface ToolResultBlockProps {
697
+ toolName: string;
698
+ result: unknown;
699
+ className?: string;
700
+ }
701
+ export interface MarkdownProps {
702
+ content: string;
703
+ className?: string;
704
+ }
705
+ export interface MentionChipProps {
706
+ mention: Mention;
707
+ onRemove?: () => void;
708
+ className?: string;
709
+ compact?: boolean;
710
+ inline?: boolean;
711
+ }
712
+ export interface MentionChipListProps {
713
+ mentions: Mention[];
714
+ onRemove?: (mentionId: string) => void;
715
+ className?: string;
716
+ }
717
+ export interface AiTriggerButtonProps {
718
+ /** Called when the main button area (Sparkles) is clicked */
719
+ onClickChat: () => void;
720
+ /** Called when the mic button is clicked */
721
+ onClickMic: () => void;
722
+ /** Whether voice is currently recording */
723
+ isRecording?: boolean;
724
+ /** Whether voice connection is being established */
725
+ isConnecting?: boolean;
726
+ /** Called when user stops recording (red circle) */
727
+ onStopRecording?: () => void;
728
+ /** Called when user cancels recording (X) */
729
+ onCancelRecording?: () => void;
730
+ /** Render portal into document.body. Default: true */
731
+ portal?: boolean;
732
+ /** Optional className override for the outer fixed container */
733
+ className?: string;
734
+ /** Optional className for the button pill itself (e.g. `ai-magic-button`) */
735
+ buttonClassName?: string;
736
+ /** Wrap the default-state button in custom chrome (ContextMenu, Tooltip, etc.) */
737
+ renderWrapper?: (button: ReactElement) => ReactElement;
738
+ /** Allow the button to be dragged to a custom position. Default: true */
739
+ draggable?: boolean;
740
+ /** SessionStorage key for persisting the dragged position. Set to false to disable. Default: 'ai-trigger-btn' */
741
+ persistPosition?: string | false;
742
+ /** ARIA label for the main button. Default: "AI Assistant" */
743
+ ariaLabel?: string;
744
+ /** ARIA label for the mic button. Default: "Start recording" */
745
+ micAriaLabel?: string;
746
+ /** ARIA label for stop recording. Default: "Stop recording" */
747
+ stopAriaLabel?: string;
748
+ /**
749
+ * Render the mic zone on the pill. Default: `true`. Set to `false`
750
+ * to render a single-icon trigger (just the sparkle / custom icon).
751
+ */
752
+ showMic?: boolean;
753
+ /**
754
+ * Replace the built-in sparkle with a custom icon node. Sized to
755
+ * ~16×16 visually but can be anything (img, SVG, emoji, etc.).
756
+ */
757
+ icon?: ReactNode;
758
+ /** ARIA label for cancel recording. Default: "Cancel recording" */
759
+ cancelAriaLabel?: string;
760
+ }