@jini-ai/chat 0.1.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 (444) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +109 -0
  3. package/dist/core/agentic/chat-capabilities.d.ts +19 -0
  4. package/dist/core/agentic/chat-capabilities.d.ts.map +1 -0
  5. package/dist/core/agentic/chat-capabilities.js +106 -0
  6. package/dist/core/agentic/chat-capabilities.js.map +1 -0
  7. package/dist/core/agentic/index.d.ts +22 -0
  8. package/dist/core/agentic/index.d.ts.map +1 -0
  9. package/dist/core/agentic/index.js +21 -0
  10. package/dist/core/agentic/index.js.map +1 -0
  11. package/dist/core/events.d.ts +84 -0
  12. package/dist/core/events.d.ts.map +1 -0
  13. package/dist/core/events.js +14 -0
  14. package/dist/core/events.js.map +1 -0
  15. package/dist/core/index.d.ts +40 -0
  16. package/dist/core/index.d.ts.map +1 -0
  17. package/dist/core/index.js +40 -0
  18. package/dist/core/index.js.map +1 -0
  19. package/dist/core/messages.d.ts +53 -0
  20. package/dist/core/messages.d.ts.map +1 -0
  21. package/dist/core/messages.js +16 -0
  22. package/dist/core/messages.js.map +1 -0
  23. package/dist/core/partial-json.d.ts +36 -0
  24. package/dist/core/partial-json.d.ts.map +1 -0
  25. package/dist/core/partial-json.js +119 -0
  26. package/dist/core/partial-json.js.map +1 -0
  27. package/dist/core/persistence/index.d.ts +11 -0
  28. package/dist/core/persistence/index.d.ts.map +1 -0
  29. package/dist/core/persistence/index.js +11 -0
  30. package/dist/core/persistence/index.js.map +1 -0
  31. package/dist/core/persistence/ports.d.ts +124 -0
  32. package/dist/core/persistence/ports.d.ts.map +1 -0
  33. package/dist/core/persistence/ports.js +2 -0
  34. package/dist/core/persistence/ports.js.map +1 -0
  35. package/dist/core/persistence/title.d.ts +35 -0
  36. package/dist/core/persistence/title.d.ts.map +1 -0
  37. package/dist/core/persistence/title.js +137 -0
  38. package/dist/core/persistence/title.js.map +1 -0
  39. package/dist/core/question-form/format.d.ts +27 -0
  40. package/dist/core/question-form/format.d.ts.map +1 -0
  41. package/dist/core/question-form/format.js +45 -0
  42. package/dist/core/question-form/format.js.map +1 -0
  43. package/dist/core/question-form/normalize.d.ts +30 -0
  44. package/dist/core/question-form/normalize.d.ts.map +1 -0
  45. package/dist/core/question-form/normalize.js +192 -0
  46. package/dist/core/question-form/normalize.js.map +1 -0
  47. package/dist/core/question-form/scan.d.ts +50 -0
  48. package/dist/core/question-form/scan.d.ts.map +1 -0
  49. package/dist/core/question-form/scan.js +404 -0
  50. package/dist/core/question-form/scan.js.map +1 -0
  51. package/dist/core/question-form/types.d.ts +83 -0
  52. package/dist/core/question-form/types.d.ts.map +1 -0
  53. package/dist/core/question-form/types.js +11 -0
  54. package/dist/core/question-form/types.js.map +1 -0
  55. package/dist/core/question-form.d.ts +39 -0
  56. package/dist/core/question-form.d.ts.map +1 -0
  57. package/dist/core/question-form.js +4 -0
  58. package/dist/core/question-form.js.map +1 -0
  59. package/dist/core/todos.d.ts +70 -0
  60. package/dist/core/todos.d.ts.map +1 -0
  61. package/dist/core/todos.js +175 -0
  62. package/dist/core/todos.js.map +1 -0
  63. package/dist/core/tool-events.d.ts +18 -0
  64. package/dist/core/tool-events.d.ts.map +1 -0
  65. package/dist/core/tool-events.js +36 -0
  66. package/dist/core/tool-events.js.map +1 -0
  67. package/dist/core/tools.d.ts +51 -0
  68. package/dist/core/tools.d.ts.map +1 -0
  69. package/dist/core/tools.js +41 -0
  70. package/dist/core/tools.js.map +1 -0
  71. package/dist/core/transcript.d.ts +81 -0
  72. package/dist/core/transcript.d.ts.map +1 -0
  73. package/dist/core/transcript.js +133 -0
  74. package/dist/core/transcript.js.map +1 -0
  75. package/dist/core/transport.d.ts +109 -0
  76. package/dist/core/transport.d.ts.map +1 -0
  77. package/dist/core/transport.js +2 -0
  78. package/dist/core/transport.js.map +1 -0
  79. package/dist/core/util/index.d.ts +16 -0
  80. package/dist/core/util/index.d.ts.map +1 -0
  81. package/dist/core/util/index.js +16 -0
  82. package/dist/core/util/index.js.map +1 -0
  83. package/dist/core/util/manifest.d.ts +39 -0
  84. package/dist/core/util/manifest.d.ts.map +1 -0
  85. package/dist/core/util/manifest.js +173 -0
  86. package/dist/core/util/manifest.js.map +1 -0
  87. package/dist/core/util/markdown-context.d.ts +47 -0
  88. package/dist/core/util/markdown-context.d.ts.map +1 -0
  89. package/dist/core/util/markdown-context.js +125 -0
  90. package/dist/core/util/markdown-context.js.map +1 -0
  91. package/dist/core/util/markup-attributes.d.ts +20 -0
  92. package/dist/core/util/markup-attributes.d.ts.map +1 -0
  93. package/dist/core/util/markup-attributes.js +33 -0
  94. package/dist/core/util/markup-attributes.js.map +1 -0
  95. package/dist/core/util/parser.d.ts +42 -0
  96. package/dist/core/util/parser.d.ts.map +1 -0
  97. package/dist/core/util/parser.js +238 -0
  98. package/dist/core/util/parser.js.map +1 -0
  99. package/dist/core/util/pointer.d.ts +28 -0
  100. package/dist/core/util/pointer.d.ts.map +1 -0
  101. package/dist/core/util/pointer.js +75 -0
  102. package/dist/core/util/pointer.js.map +1 -0
  103. package/dist/core/util/recover.d.ts +40 -0
  104. package/dist/core/util/recover.d.ts.map +1 -0
  105. package/dist/core/util/recover.js +117 -0
  106. package/dist/core/util/recover.js.map +1 -0
  107. package/dist/core/util/strip.d.ts +112 -0
  108. package/dist/core/util/strip.d.ts.map +1 -0
  109. package/dist/core/util/strip.js +333 -0
  110. package/dist/core/util/strip.js.map +1 -0
  111. package/dist/core/util/types.d.ts +31 -0
  112. package/dist/core/util/types.d.ts.map +1 -0
  113. package/dist/core/util/types.js +2 -0
  114. package/dist/core/util/types.js.map +1 -0
  115. package/dist/core/util/validate.d.ts +50 -0
  116. package/dist/core/util/validate.d.ts.map +1 -0
  117. package/dist/core/util/validate.js +202 -0
  118. package/dist/core/util/validate.js.map +1 -0
  119. package/dist/react/agent-bridge/frontend-session-bridge.d.ts +45 -0
  120. package/dist/react/agent-bridge/frontend-session-bridge.d.ts.map +1 -0
  121. package/dist/react/agent-bridge/frontend-session-bridge.js +214 -0
  122. package/dist/react/agent-bridge/frontend-session-bridge.js.map +1 -0
  123. package/dist/react/artifact-types.d.ts +61 -0
  124. package/dist/react/artifact-types.d.ts.map +1 -0
  125. package/dist/react/artifact-types.js +33 -0
  126. package/dist/react/artifact-types.js.map +1 -0
  127. package/dist/react/chat-pane.d.ts +21 -0
  128. package/dist/react/chat-pane.d.ts.map +1 -0
  129. package/dist/react/chat-pane.js +20 -0
  130. package/dist/react/chat-pane.js.map +1 -0
  131. package/dist/react/components/A2uiSurfaceCard.d.ts +35 -0
  132. package/dist/react/components/A2uiSurfaceCard.d.ts.map +1 -0
  133. package/dist/react/components/A2uiSurfaceCard.js +272 -0
  134. package/dist/react/components/A2uiSurfaceCard.js.map +1 -0
  135. package/dist/react/components/AttachmentTray.d.ts +6 -0
  136. package/dist/react/components/AttachmentTray.d.ts.map +1 -0
  137. package/dist/react/components/AttachmentTray.js +30 -0
  138. package/dist/react/components/AttachmentTray.js.map +1 -0
  139. package/dist/react/components/ChatFab.d.ts +8 -0
  140. package/dist/react/components/ChatFab.d.ts.map +1 -0
  141. package/dist/react/components/ChatFab.js +24 -0
  142. package/dist/react/components/ChatFab.js.map +1 -0
  143. package/dist/react/components/Composer.d.ts +34 -0
  144. package/dist/react/components/Composer.d.ts.map +1 -0
  145. package/dist/react/components/Composer.js +300 -0
  146. package/dist/react/components/Composer.js.map +1 -0
  147. package/dist/react/components/ComposerDiscovery.d.ts +46 -0
  148. package/dist/react/components/ComposerDiscovery.d.ts.map +1 -0
  149. package/dist/react/components/ComposerDiscovery.js +38 -0
  150. package/dist/react/components/ComposerDiscovery.js.map +1 -0
  151. package/dist/react/components/ConversationList.d.ts +31 -0
  152. package/dist/react/components/ConversationList.d.ts.map +1 -0
  153. package/dist/react/components/ConversationList.js +221 -0
  154. package/dist/react/components/ConversationList.js.map +1 -0
  155. package/dist/react/components/ExtEventErrorBoundary.d.ts +35 -0
  156. package/dist/react/components/ExtEventErrorBoundary.d.ts.map +1 -0
  157. package/dist/react/components/ExtEventErrorBoundary.js +38 -0
  158. package/dist/react/components/ExtEventErrorBoundary.js.map +1 -0
  159. package/dist/react/components/Icon.d.ts +17 -0
  160. package/dist/react/components/Icon.d.ts.map +1 -0
  161. package/dist/react/components/Icon.js +46 -0
  162. package/dist/react/components/Icon.js.map +1 -0
  163. package/dist/react/components/JiniChatProvider.d.ts +45 -0
  164. package/dist/react/components/JiniChatProvider.d.ts.map +1 -0
  165. package/dist/react/components/JiniChatProvider.js +44 -0
  166. package/dist/react/components/JiniChatProvider.js.map +1 -0
  167. package/dist/react/components/Markdown.d.ts +5 -0
  168. package/dist/react/components/Markdown.d.ts.map +1 -0
  169. package/dist/react/components/Markdown.js +390 -0
  170. package/dist/react/components/Markdown.js.map +1 -0
  171. package/dist/react/components/McpUiSurfaceCard.d.ts +51 -0
  172. package/dist/react/components/McpUiSurfaceCard.d.ts.map +1 -0
  173. package/dist/react/components/McpUiSurfaceCard.js +159 -0
  174. package/dist/react/components/McpUiSurfaceCard.js.map +1 -0
  175. package/dist/react/components/MessageList.d.ts +15 -0
  176. package/dist/react/components/MessageList.d.ts.map +1 -0
  177. package/dist/react/components/MessageList.js +81 -0
  178. package/dist/react/components/MessageList.js.map +1 -0
  179. package/dist/react/components/MessageRow.d.ts +60 -0
  180. package/dist/react/components/MessageRow.d.ts.map +1 -0
  181. package/dist/react/components/MessageRow.js +156 -0
  182. package/dist/react/components/MessageRow.js.map +1 -0
  183. package/dist/react/components/NextStepActions.d.ts +34 -0
  184. package/dist/react/components/NextStepActions.d.ts.map +1 -0
  185. package/dist/react/components/NextStepActions.js +9 -0
  186. package/dist/react/components/NextStepActions.js.map +1 -0
  187. package/dist/react/components/QuestionForm.d.ts +26 -0
  188. package/dist/react/components/QuestionForm.d.ts.map +1 -0
  189. package/dist/react/components/QuestionForm.js +238 -0
  190. package/dist/react/components/QuestionForm.js.map +1 -0
  191. package/dist/react/components/QuestionsPanel.d.ts +13 -0
  192. package/dist/react/components/QuestionsPanel.d.ts.map +1 -0
  193. package/dist/react/components/QuestionsPanel.js +33 -0
  194. package/dist/react/components/QuestionsPanel.js.map +1 -0
  195. package/dist/react/components/TodoCard.d.ts +8 -0
  196. package/dist/react/components/TodoCard.d.ts.map +1 -0
  197. package/dist/react/components/TodoCard.js +29 -0
  198. package/dist/react/components/TodoCard.js.map +1 -0
  199. package/dist/react/components/ToolCard.d.ts +22 -0
  200. package/dist/react/components/ToolCard.d.ts.map +1 -0
  201. package/dist/react/components/ToolCard.js +298 -0
  202. package/dist/react/components/ToolCard.js.map +1 -0
  203. package/dist/react/components/composer-discovery.d.ts +107 -0
  204. package/dist/react/components/composer-discovery.d.ts.map +1 -0
  205. package/dist/react/components/composer-discovery.js +176 -0
  206. package/dist/react/components/composer-discovery.js.map +1 -0
  207. package/dist/react/ext-event-renderer-registry.d.ts +51 -0
  208. package/dist/react/ext-event-renderer-registry.d.ts.map +1 -0
  209. package/dist/react/ext-event-renderer-registry.js +20 -0
  210. package/dist/react/ext-event-renderer-registry.js.map +1 -0
  211. package/dist/react/features/chat-pane/agent-tools.d.ts +14 -0
  212. package/dist/react/features/chat-pane/agent-tools.d.ts.map +1 -0
  213. package/dist/react/features/chat-pane/agent-tools.js +22 -0
  214. package/dist/react/features/chat-pane/agent-tools.js.map +1 -0
  215. package/dist/react/features/chat-pane/components/AgentRuntimePicker.d.ts +12 -0
  216. package/dist/react/features/chat-pane/components/AgentRuntimePicker.d.ts.map +1 -0
  217. package/dist/react/features/chat-pane/components/AgentRuntimePicker.js +106 -0
  218. package/dist/react/features/chat-pane/components/AgentRuntimePicker.js.map +1 -0
  219. package/dist/react/features/chat-pane/components/ChatPane.d.ts +10 -0
  220. package/dist/react/features/chat-pane/components/ChatPane.d.ts.map +1 -0
  221. package/dist/react/features/chat-pane/components/ChatPane.js +169 -0
  222. package/dist/react/features/chat-pane/components/ChatPane.js.map +1 -0
  223. package/dist/react/features/chat-pane/create-daemon-attachment-uploader.d.ts +21 -0
  224. package/dist/react/features/chat-pane/create-daemon-attachment-uploader.d.ts.map +1 -0
  225. package/dist/react/features/chat-pane/create-daemon-attachment-uploader.js +213 -0
  226. package/dist/react/features/chat-pane/create-daemon-attachment-uploader.js.map +1 -0
  227. package/dist/react/features/chat-pane/create-mcp-ui-tool-caller.d.ts +70 -0
  228. package/dist/react/features/chat-pane/create-mcp-ui-tool-caller.d.ts.map +1 -0
  229. package/dist/react/features/chat-pane/create-mcp-ui-tool-caller.js +76 -0
  230. package/dist/react/features/chat-pane/create-mcp-ui-tool-caller.js.map +1 -0
  231. package/dist/react/features/chat-pane/hooks/useAgentRuntimePicker.hooks.d.ts +133 -0
  232. package/dist/react/features/chat-pane/hooks/useAgentRuntimePicker.hooks.d.ts.map +1 -0
  233. package/dist/react/features/chat-pane/hooks/useAgentRuntimePicker.hooks.js +258 -0
  234. package/dist/react/features/chat-pane/hooks/useAgentRuntimePicker.hooks.js.map +1 -0
  235. package/dist/react/features/chat-pane/hooks/useChatPane.hooks.d.ts +66 -0
  236. package/dist/react/features/chat-pane/hooks/useChatPane.hooks.d.ts.map +1 -0
  237. package/dist/react/features/chat-pane/hooks/useChatPane.hooks.js +224 -0
  238. package/dist/react/features/chat-pane/hooks/useChatPane.hooks.js.map +1 -0
  239. package/dist/react/features/chat-pane/hooks/useChatPaneAgentControl.hooks.d.ts +38 -0
  240. package/dist/react/features/chat-pane/hooks/useChatPaneAgentControl.hooks.d.ts.map +1 -0
  241. package/dist/react/features/chat-pane/hooks/useChatPaneAgentControl.hooks.js +252 -0
  242. package/dist/react/features/chat-pane/hooks/useChatPaneAgentControl.hooks.js.map +1 -0
  243. package/dist/react/features/chat-pane/hooks/useChatPaneControlsHeight.hooks.d.ts +16 -0
  244. package/dist/react/features/chat-pane/hooks/useChatPaneControlsHeight.hooks.d.ts.map +1 -0
  245. package/dist/react/features/chat-pane/hooks/useChatPaneControlsHeight.hooks.js +59 -0
  246. package/dist/react/features/chat-pane/hooks/useChatPaneControlsHeight.hooks.js.map +1 -0
  247. package/dist/react/features/chat-pane/hooks/useChatPaneFileDrop.hooks.d.ts +26 -0
  248. package/dist/react/features/chat-pane/hooks/useChatPaneFileDrop.hooks.d.ts.map +1 -0
  249. package/dist/react/features/chat-pane/hooks/useChatPaneFileDrop.hooks.js +74 -0
  250. package/dist/react/features/chat-pane/hooks/useChatPaneFileDrop.hooks.js.map +1 -0
  251. package/dist/react/features/chat-pane/hooks/useChatPaneRuntimeInventory.hooks.d.ts +25 -0
  252. package/dist/react/features/chat-pane/hooks/useChatPaneRuntimeInventory.hooks.d.ts.map +1 -0
  253. package/dist/react/features/chat-pane/hooks/useChatPaneRuntimeInventory.hooks.js +88 -0
  254. package/dist/react/features/chat-pane/hooks/useChatPaneRuntimeInventory.hooks.js.map +1 -0
  255. package/dist/react/features/chat-pane/hooks/useChatPaneWorkingDirectory.hooks.d.ts +38 -0
  256. package/dist/react/features/chat-pane/hooks/useChatPaneWorkingDirectory.hooks.d.ts.map +1 -0
  257. package/dist/react/features/chat-pane/hooks/useChatPaneWorkingDirectory.hooks.js +184 -0
  258. package/dist/react/features/chat-pane/hooks/useChatPaneWorkingDirectory.hooks.js.map +1 -0
  259. package/dist/react/features/chat-pane/index.d.ts +12 -0
  260. package/dist/react/features/chat-pane/index.d.ts.map +1 -0
  261. package/dist/react/features/chat-pane/index.js +11 -0
  262. package/dist/react/features/chat-pane/index.js.map +1 -0
  263. package/dist/react/features/chat-pane/react/components/AgentRuntimePicker.d.ts +12 -0
  264. package/dist/react/features/chat-pane/react/components/AgentRuntimePicker.d.ts.map +1 -0
  265. package/dist/react/features/chat-pane/react/components/AgentRuntimePicker.js +102 -0
  266. package/dist/react/features/chat-pane/react/components/AgentRuntimePicker.js.map +1 -0
  267. package/dist/react/features/chat-pane/react/components/ChatPane.d.ts +10 -0
  268. package/dist/react/features/chat-pane/react/components/ChatPane.d.ts.map +1 -0
  269. package/dist/react/features/chat-pane/react/components/ChatPane.js +137 -0
  270. package/dist/react/features/chat-pane/react/components/ChatPane.js.map +1 -0
  271. package/dist/react/features/chat-pane/react/hooks/useAgentRuntimePicker.hooks.d.ts +133 -0
  272. package/dist/react/features/chat-pane/react/hooks/useAgentRuntimePicker.hooks.d.ts.map +1 -0
  273. package/dist/react/features/chat-pane/react/hooks/useAgentRuntimePicker.hooks.js +258 -0
  274. package/dist/react/features/chat-pane/react/hooks/useAgentRuntimePicker.hooks.js.map +1 -0
  275. package/dist/react/features/chat-pane/react/hooks/useChatPane.hooks.d.ts +66 -0
  276. package/dist/react/features/chat-pane/react/hooks/useChatPane.hooks.d.ts.map +1 -0
  277. package/dist/react/features/chat-pane/react/hooks/useChatPane.hooks.js +223 -0
  278. package/dist/react/features/chat-pane/react/hooks/useChatPane.hooks.js.map +1 -0
  279. package/dist/react/features/chat-pane/react/hooks/useChatPaneAgentControl.hooks.d.ts +38 -0
  280. package/dist/react/features/chat-pane/react/hooks/useChatPaneAgentControl.hooks.d.ts.map +1 -0
  281. package/dist/react/features/chat-pane/react/hooks/useChatPaneAgentControl.hooks.js +252 -0
  282. package/dist/react/features/chat-pane/react/hooks/useChatPaneAgentControl.hooks.js.map +1 -0
  283. package/dist/react/features/chat-pane/react/hooks/useChatPaneFileDrop.hooks.d.ts +26 -0
  284. package/dist/react/features/chat-pane/react/hooks/useChatPaneFileDrop.hooks.d.ts.map +1 -0
  285. package/dist/react/features/chat-pane/react/hooks/useChatPaneFileDrop.hooks.js +60 -0
  286. package/dist/react/features/chat-pane/react/hooks/useChatPaneFileDrop.hooks.js.map +1 -0
  287. package/dist/react/features/chat-pane/react/hooks/useChatPaneRuntimeInventory.hooks.d.ts +25 -0
  288. package/dist/react/features/chat-pane/react/hooks/useChatPaneRuntimeInventory.hooks.d.ts.map +1 -0
  289. package/dist/react/features/chat-pane/react/hooks/useChatPaneRuntimeInventory.hooks.js +83 -0
  290. package/dist/react/features/chat-pane/react/hooks/useChatPaneRuntimeInventory.hooks.js.map +1 -0
  291. package/dist/react/features/chat-pane/react/hooks/useChatPaneWorkingDirectory.hooks.d.ts +38 -0
  292. package/dist/react/features/chat-pane/react/hooks/useChatPaneWorkingDirectory.hooks.d.ts.map +1 -0
  293. package/dist/react/features/chat-pane/react/hooks/useChatPaneWorkingDirectory.hooks.js +184 -0
  294. package/dist/react/features/chat-pane/react/hooks/useChatPaneWorkingDirectory.hooks.js.map +1 -0
  295. package/dist/react/features/chat-pane/react/styles.d.ts +2 -0
  296. package/dist/react/features/chat-pane/react/styles.d.ts.map +1 -0
  297. package/dist/react/features/chat-pane/react/styles.js +863 -0
  298. package/dist/react/features/chat-pane/react/styles.js.map +1 -0
  299. package/dist/react/features/chat-pane/rules.d.ts +31 -0
  300. package/dist/react/features/chat-pane/rules.d.ts.map +1 -0
  301. package/dist/react/features/chat-pane/rules.js +81 -0
  302. package/dist/react/features/chat-pane/rules.js.map +1 -0
  303. package/dist/react/features/chat-pane/styles.d.ts +2 -0
  304. package/dist/react/features/chat-pane/styles.d.ts.map +1 -0
  305. package/dist/react/features/chat-pane/styles.js +1327 -0
  306. package/dist/react/features/chat-pane/styles.js.map +1 -0
  307. package/dist/react/features/chat-pane/types.d.ts +248 -0
  308. package/dist/react/features/chat-pane/types.d.ts.map +1 -0
  309. package/dist/react/features/chat-pane/types.js +2 -0
  310. package/dist/react/features/chat-pane/types.js.map +1 -0
  311. package/dist/react/features/model-picker/components/CredentialStatusBadge.d.ts +7 -0
  312. package/dist/react/features/model-picker/components/CredentialStatusBadge.d.ts.map +1 -0
  313. package/dist/react/features/model-picker/components/CredentialStatusBadge.js +20 -0
  314. package/dist/react/features/model-picker/components/CredentialStatusBadge.js.map +1 -0
  315. package/dist/react/features/model-picker/components/ModelPicker.d.ts +9 -0
  316. package/dist/react/features/model-picker/components/ModelPicker.d.ts.map +1 -0
  317. package/dist/react/features/model-picker/components/ModelPicker.js +34 -0
  318. package/dist/react/features/model-picker/components/ModelPicker.js.map +1 -0
  319. package/dist/react/features/model-picker/constants.d.ts +6 -0
  320. package/dist/react/features/model-picker/constants.d.ts.map +1 -0
  321. package/dist/react/features/model-picker/constants.js +9 -0
  322. package/dist/react/features/model-picker/constants.js.map +1 -0
  323. package/dist/react/features/model-picker/dependencies.d.ts +11 -0
  324. package/dist/react/features/model-picker/dependencies.d.ts.map +1 -0
  325. package/dist/react/features/model-picker/dependencies.js +10 -0
  326. package/dist/react/features/model-picker/dependencies.js.map +1 -0
  327. package/dist/react/features/model-picker/hooks/useModelPicker.hooks.d.ts +27 -0
  328. package/dist/react/features/model-picker/hooks/useModelPicker.hooks.d.ts.map +1 -0
  329. package/dist/react/features/model-picker/hooks/useModelPicker.hooks.js +62 -0
  330. package/dist/react/features/model-picker/hooks/useModelPicker.hooks.js.map +1 -0
  331. package/dist/react/features/model-picker/index.d.ts +32 -0
  332. package/dist/react/features/model-picker/index.d.ts.map +1 -0
  333. package/dist/react/features/model-picker/index.js +29 -0
  334. package/dist/react/features/model-picker/index.js.map +1 -0
  335. package/dist/react/features/model-picker/ports.d.ts +11 -0
  336. package/dist/react/features/model-picker/ports.d.ts.map +1 -0
  337. package/dist/react/features/model-picker/ports.js +2 -0
  338. package/dist/react/features/model-picker/ports.js.map +1 -0
  339. package/dist/react/features/model-picker/react/components/CredentialStatusBadge.d.ts +7 -0
  340. package/dist/react/features/model-picker/react/components/CredentialStatusBadge.d.ts.map +1 -0
  341. package/dist/react/features/model-picker/react/components/CredentialStatusBadge.js +20 -0
  342. package/dist/react/features/model-picker/react/components/CredentialStatusBadge.js.map +1 -0
  343. package/dist/react/features/model-picker/react/components/ModelPicker.d.ts +9 -0
  344. package/dist/react/features/model-picker/react/components/ModelPicker.d.ts.map +1 -0
  345. package/dist/react/features/model-picker/react/components/ModelPicker.js +34 -0
  346. package/dist/react/features/model-picker/react/components/ModelPicker.js.map +1 -0
  347. package/dist/react/features/model-picker/react/hooks/useModelPicker.hooks.d.ts +27 -0
  348. package/dist/react/features/model-picker/react/hooks/useModelPicker.hooks.d.ts.map +1 -0
  349. package/dist/react/features/model-picker/react/hooks/useModelPicker.hooks.js +62 -0
  350. package/dist/react/features/model-picker/react/hooks/useModelPicker.hooks.js.map +1 -0
  351. package/dist/react/features/model-picker/rules.d.ts +26 -0
  352. package/dist/react/features/model-picker/rules.d.ts.map +1 -0
  353. package/dist/react/features/model-picker/rules.js +84 -0
  354. package/dist/react/features/model-picker/rules.js.map +1 -0
  355. package/dist/react/features/model-picker/types.d.ts +38 -0
  356. package/dist/react/features/model-picker/types.d.ts.map +1 -0
  357. package/dist/react/features/model-picker/types.js +2 -0
  358. package/dist/react/features/model-picker/types.js.map +1 -0
  359. package/dist/react/hooks/composer-draft-cache.d.ts +65 -0
  360. package/dist/react/hooks/composer-draft-cache.d.ts.map +1 -0
  361. package/dist/react/hooks/composer-draft-cache.js +89 -0
  362. package/dist/react/hooks/composer-draft-cache.js.map +1 -0
  363. package/dist/react/hooks/context.d.ts +18 -0
  364. package/dist/react/hooks/context.d.ts.map +1 -0
  365. package/dist/react/hooks/context.js +60 -0
  366. package/dist/react/hooks/context.js.map +1 -0
  367. package/dist/react/hooks/testing/fake-transport.d.ts +34 -0
  368. package/dist/react/hooks/testing/fake-transport.d.ts.map +1 -0
  369. package/dist/react/hooks/testing/fake-transport.js +46 -0
  370. package/dist/react/hooks/testing/fake-transport.js.map +1 -0
  371. package/dist/react/hooks/useArtifactStream.d.ts +18 -0
  372. package/dist/react/hooks/useArtifactStream.d.ts.map +1 -0
  373. package/dist/react/hooks/useArtifactStream.js +55 -0
  374. package/dist/react/hooks/useArtifactStream.js.map +1 -0
  375. package/dist/react/hooks/useChatFabDrag.d.ts +25 -0
  376. package/dist/react/hooks/useChatFabDrag.d.ts.map +1 -0
  377. package/dist/react/hooks/useChatFabDrag.js +88 -0
  378. package/dist/react/hooks/useChatFabDrag.js.map +1 -0
  379. package/dist/react/hooks/useComposer.d.ts +48 -0
  380. package/dist/react/hooks/useComposer.d.ts.map +1 -0
  381. package/dist/react/hooks/useComposer.js +121 -0
  382. package/dist/react/hooks/useComposer.js.map +1 -0
  383. package/dist/react/hooks/useConversation.d.ts +34 -0
  384. package/dist/react/hooks/useConversation.d.ts.map +1 -0
  385. package/dist/react/hooks/useConversation.js +163 -0
  386. package/dist/react/hooks/useConversation.js.map +1 -0
  387. package/dist/react/hooks/useCopyToClipboard.d.ts +14 -0
  388. package/dist/react/hooks/useCopyToClipboard.d.ts.map +1 -0
  389. package/dist/react/hooks/useCopyToClipboard.js +98 -0
  390. package/dist/react/hooks/useCopyToClipboard.js.map +1 -0
  391. package/dist/react/hooks/useExtEventGroups.d.ts +7 -0
  392. package/dist/react/hooks/useExtEventGroups.d.ts.map +1 -0
  393. package/dist/react/hooks/useExtEventGroups.js +32 -0
  394. package/dist/react/hooks/useExtEventGroups.js.map +1 -0
  395. package/dist/react/hooks/useLatestOperation.d.ts +31 -0
  396. package/dist/react/hooks/useLatestOperation.d.ts.map +1 -0
  397. package/dist/react/hooks/useLatestOperation.js +74 -0
  398. package/dist/react/hooks/useLatestOperation.js.map +1 -0
  399. package/dist/react/hooks/usePinnedTodos.d.ts +15 -0
  400. package/dist/react/hooks/usePinnedTodos.d.ts.map +1 -0
  401. package/dist/react/hooks/usePinnedTodos.js +43 -0
  402. package/dist/react/hooks/usePinnedTodos.js.map +1 -0
  403. package/dist/react/hooks/useQuestionForms.d.ts +28 -0
  404. package/dist/react/hooks/useQuestionForms.d.ts.map +1 -0
  405. package/dist/react/hooks/useQuestionForms.js +113 -0
  406. package/dist/react/hooks/useQuestionForms.js.map +1 -0
  407. package/dist/react/hooks/useRunStream.d.ts +27 -0
  408. package/dist/react/hooks/useRunStream.d.ts.map +1 -0
  409. package/dist/react/hooks/useRunStream.js +180 -0
  410. package/dist/react/hooks/useRunStream.js.map +1 -0
  411. package/dist/react/hooks/useToolTimeline.d.ts +33 -0
  412. package/dist/react/hooks/useToolTimeline.d.ts.map +1 -0
  413. package/dist/react/hooks/useToolTimeline.js +47 -0
  414. package/dist/react/hooks/useToolTimeline.js.map +1 -0
  415. package/dist/react/index.d.ts +158 -0
  416. package/dist/react/index.d.ts.map +1 -0
  417. package/dist/react/index.js +118 -0
  418. package/dist/react/index.js.map +1 -0
  419. package/dist/react/message-blocks.d.ts +86 -0
  420. package/dist/react/message-blocks.d.ts.map +1 -0
  421. package/dist/react/message-blocks.js +78 -0
  422. package/dist/react/message-blocks.js.map +1 -0
  423. package/dist/react/poc-mcp-ui-official/PocMcpUiCard.d.ts +9 -0
  424. package/dist/react/poc-mcp-ui-official/PocMcpUiCard.d.ts.map +1 -0
  425. package/dist/react/poc-mcp-ui-official/PocMcpUiCard.js +29 -0
  426. package/dist/react/poc-mcp-ui-official/PocMcpUiCard.js.map +1 -0
  427. package/dist/react/poc-mcp-ui-official/create-poc-resource.d.ts +30 -0
  428. package/dist/react/poc-mcp-ui-official/create-poc-resource.d.ts.map +1 -0
  429. package/dist/react/poc-mcp-ui-official/create-poc-resource.js +44 -0
  430. package/dist/react/poc-mcp-ui-official/create-poc-resource.js.map +1 -0
  431. package/dist/react/slots.d.ts +215 -0
  432. package/dist/react/slots.d.ts.map +1 -0
  433. package/dist/react/slots.js +2 -0
  434. package/dist/react/slots.js.map +1 -0
  435. package/dist/react/styles/reference.css +298 -0
  436. package/dist/react/tool-renderer-registry.d.ts +41 -0
  437. package/dist/react/tool-renderer-registry.d.ts.map +1 -0
  438. package/dist/react/tool-renderer-registry.js +22 -0
  439. package/dist/react/tool-renderer-registry.js.map +1 -0
  440. package/dist/react/util/defined-props.d.ts +31 -0
  441. package/dist/react/util/defined-props.d.ts.map +1 -0
  442. package/dist/react/util/defined-props.js +28 -0
  443. package/dist/react/util/defined-props.js.map +1 -0
  444. package/package.json +99 -0
@@ -0,0 +1,102 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { createPortal } from 'react-dom';
3
+ import { AgentIcon, RemixIcon, SearchableModelSelect } from '@jini-ai/ui';
4
+ import { useT } from '../../../../hooks/context.js';
5
+ import { defaultChatPaneSelection } from '../../rules.js';
6
+ import { runtimeOptionLabel, runtimePopoverPosition, useAgentRuntimePicker, } from '../hooks/useAgentRuntimePicker.hooks.js';
7
+ // Re-exported so this module's public surface is unchanged by the behavior extraction; both are
8
+ // pure and now live beside the hook that consumes them.
9
+ export { runtimeOptionLabel, runtimePopoverPosition };
10
+ export function runtimeAgentStatus(agent) {
11
+ if (agent.available === false)
12
+ return agent.diagnostic ?? 'Not found on PATH';
13
+ if (agent.authStatus === 'missing')
14
+ return 'Installed · sign-in required';
15
+ return agent.version ?? 'Installed';
16
+ }
17
+ function RuntimeModeButtons({ executionMode, daemonOnline, apiModeAvailable, onExecutionModeChange, t, }) {
18
+ return (_jsxs(_Fragment, { children: [_jsxs("button", { type: "button", className: `jini-runtime-mode${executionMode === 'local' ? ' is-active' : ''}`, disabled: !daemonOnline && executionMode !== 'local', onClick: () => onExecutionModeChange?.('local'), children: [_jsx(RemixIcon, { name: "terminal-box-line", size: 18 }), _jsx("span", { children: t('Use Local CLI') }), _jsx("span", { className: "jini-runtime-mode__meta", children: !daemonOnline ? t('offline') : executionMode === 'local' ? t('active') : '' }), executionMode === 'local' ? (_jsx(RemixIcon, { name: "check-line", size: 19, className: "jini-runtime-check" })) : null] }), _jsxs("button", { type: "button", className: `jini-runtime-mode${executionMode === 'api' ? ' is-active' : ''}`, disabled: !apiModeAvailable, onClick: () => onExecutionModeChange?.('api'), children: [_jsx(RemixIcon, { name: "link", size: 18 }), _jsx("span", { children: t('Use API · BYOK') }), !apiModeAvailable ? _jsx("span", { className: "jini-runtime-mode__meta", children: t('not configured') }) : null, executionMode === 'api' ? (_jsx(RemixIcon, { name: "check-line", size: 19, className: "jini-runtime-check" })) : null] })] }));
19
+ }
20
+ function RuntimeAgentList({ orderedAgents, value, onChange, agentIconBasePath, t, }) {
21
+ if (orderedAgents.length === 0) {
22
+ return _jsx("div", { className: "jini-runtime-empty", children: t('No available code agents') });
23
+ }
24
+ return (_jsx(_Fragment, { children: orderedAgents.map((agent) => {
25
+ const active = agent.id === value.agentId;
26
+ const status = runtimeAgentStatus(agent);
27
+ return (_jsxs("button", { type: "button", role: "radio", "aria-checked": active, className: `jini-runtime-agent${active ? ' is-active' : ''}`, "aria-current": active ? 'true' : undefined, "aria-label": `${agent.name} · ${status}`, onClick: () => onChange(defaultChatPaneSelection(agent)), children: [_jsx(AgentIcon, { id: agent.id, size: 20, className: "jini-runtime-agent-icon", basePath: agentIconBasePath }), _jsx("span", { className: "jini-runtime-agent__copy", children: _jsx("strong", { children: agent.name }) }), _jsx("span", { className: "jini-runtime-agent__status", children: active ? t('selected') : status }), active ? (_jsx(RemixIcon, { name: "check-line", size: 19, className: "jini-runtime-check" })) : null] }, agent.id));
28
+ }) }));
29
+ }
30
+ function RuntimeModelSelects({ selectedAgent, value, onChange, t }) {
31
+ if (!selectedAgent)
32
+ return null;
33
+ return (_jsxs("div", { className: "jini-runtime-models", children: [(selectedAgent.models?.length ?? 0) > 0 ? (_jsxs("label", { className: "jini-runtime-select", children: [_jsx("span", { children: t('Model') }), _jsx("select", { "aria-label": t('Model'), value: value.model ?? '', onChange: (event) => onChange({
34
+ agentId: value.agentId,
35
+ model: event.target.value,
36
+ ...(value.reasoning ? { reasoning: value.reasoning } : {}),
37
+ }), children: selectedAgent.models?.map((model) => (_jsx("option", { value: model.id, children: model.label }, model.id))) })] })) : null, (selectedAgent.reasoningOptions?.length ?? 0) > 0 ? (_jsxs("label", { className: "jini-runtime-select", children: [_jsx("span", { children: t('Reasoning') }), _jsx("select", { "aria-label": t('Reasoning'), value: value.reasoning ?? '', onChange: (event) => onChange({
38
+ agentId: value.agentId,
39
+ ...(value.model ? { model: value.model } : {}),
40
+ reasoning: event.target.value,
41
+ }), children: selectedAgent.reasoningOptions?.map((option) => (_jsx("option", { value: option.id, children: option.label }, option.id))) })] })) : null] }));
42
+ }
43
+ /**
44
+ * What the popover shows in place of the CLI inventory while `executionMode` is `'api'`: the model
45
+ * the credential will run, and nothing else.
46
+ *
47
+ * Everything this replaces (the agent radios, the "Default (CLI config)" select, Reasoning, Rescan
48
+ * PATH) is a property of a *detected CLI process* and has no effect on an API turn — rendering them
49
+ * here was the defect.
50
+ *
51
+ * ## Why the same `SearchableModelSelect` the settings screen uses
52
+ *
53
+ * Not a look-alike `<select>`. This is literally the control `ByokProviderForm`'s Model field
54
+ * renders, fed the same discovered list and writing back to the same stored config, so the two
55
+ * surfaces cannot drift: pick a model here and the settings screen shows it, and vice versa. Its
56
+ * search box also matters at this size — a live Gemini key discovers ~40 models, which is past the
57
+ * point where a plain dropdown in a 320px popover is usable.
58
+ *
59
+ * Falls back to plain text when the host supplies no `onByokModelChange` or no model list. That is
60
+ * a real state, not a degenerate one: a host without discovery has nothing to offer a picker, and a
61
+ * disabled dropdown would read as "editable once something is enabled" when nothing here will
62
+ * enable it.
63
+ */
64
+ function RuntimeByokDetails({ byokRuntime, onByokModelChange, t }) {
65
+ const model = byokRuntime?.model?.trim();
66
+ const models = byokRuntime?.models ?? [];
67
+ const editable = onByokModelChange !== undefined && models.length > 0;
68
+ return (_jsxs("div", { className: "jini-runtime-models", children: [_jsxs("div", { className: "jini-runtime-select jini-runtime-byok-model", children: [_jsx("span", { children: t('Model') }), editable ? (_jsx(SearchableModelSelect, { models: models, value: model ?? '', onChange: (next) => onByokModelChange(next), ariaLabel: t('Model'), searchPlaceholder: t('Search models'),
69
+ // The menu portals to `document.body` at the package default `z-index: 60`, while this
70
+ // popover positions itself at 1000 — so without this the model list opens BEHIND the
71
+ // popover that owns it. Raised here rather than in the shared stylesheet because 60 is
72
+ // right for every other consumer; only this one opens a portalled menu from inside an
73
+ // already-elevated surface.
74
+ menuClassName: "jini-runtime-model-menu" })) : (_jsx("strong", { children: model || t('No model configured') }))] }), !model && !editable ? (_jsx("div", { className: "jini-runtime-empty", children: t('Set a model in the BYOK settings before sending a message.') })) : null] }));
75
+ }
76
+ function RuntimeRescanFooter({ onRescan, scanning, t }) {
77
+ if (onRescan) {
78
+ return (_jsxs("button", { type: "button", className: "jini-runtime-rescan", disabled: scanning, onClick: onRescan, children: [_jsx(RemixIcon, { name: "refresh-line", size: 17, ...(scanning ? { className: 'jini-runtime-spinner' } : {}) }), _jsx("span", { children: scanning ? t('Scanning PATH…') : t('Rescan PATH') })] }));
79
+ }
80
+ if (scanning) {
81
+ return _jsx("div", { className: "jini-runtime-empty", children: t('Scanning PATH…') });
82
+ }
83
+ return null;
84
+ }
85
+ /**
86
+ * Renders the package-owned local/API, agent, model, and reasoning picker.
87
+ *
88
+ * @complexity Time: O(n) in the runtime inventory; space: O(n) for ordering.
89
+ * @overallScore 100/100
90
+ */
91
+ export function AgentRuntimePicker({ agents, value, onChange, onRescan, scanning = false, daemonOnline = true, placement = 'up', executionMode = 'local', apiModeAvailable = false, onExecutionModeChange, byokRuntime, onByokModelChange, agentIconBasePath = '/agent-icons', }) {
92
+ const t = useT();
93
+ const { dialogId, open, position, triggerRef, popoverRef, orderedAgents, selectedAgent, modelLabel, runtimeSummary, triggerTitle, originTheme, toggleOpen, handlePopoverKeyDown, } = useAgentRuntimePicker({ agents, value, placement, t, executionMode, byokRuntime });
94
+ // The one branch this component makes. Everything below the mode buttons describes a detected CLI
95
+ // — the agent radios, its model and reasoning selects, and the PATH rescan — and none of it is
96
+ // true of, or has any effect on, an API turn. Previously all of it rendered in both modes, so an
97
+ // operator on BYOK saw a CLI named as "selected" and a model reading "Default (CLI config)"
98
+ // while their messages went to a provider over an API key.
99
+ const isApi = executionMode === 'api';
100
+ return (_jsxs("div", { className: "jini-runtime-picker", children: [_jsxs("button", { ref: triggerRef, type: "button", className: "jini-runtime-trigger", "aria-label": t('Choose AI runtime'), "aria-haspopup": "dialog", "aria-expanded": open, "aria-controls": dialogId, onClick: toggleOpen, children: [isApi ? (byokRuntime?.iconId ? (_jsx(AgentIcon, { id: byokRuntime.iconId, size: 22, className: "jini-runtime-agent-icon", basePath: agentIconBasePath })) : (_jsx(RemixIcon, { name: "link", size: 20, className: "jini-runtime-agent-icon" }))) : (_jsx(AgentIcon, { id: selectedAgent?.id ?? '', size: 22, className: "jini-runtime-agent-icon", basePath: agentIconBasePath })), _jsxs("span", { className: "jini-runtime-trigger__copy", children: [_jsx("strong", { children: triggerTitle }), _jsx("small", { children: modelLabel })] }), _jsx(RemixIcon, { name: "arrow-down-s-line", size: 15, className: "jini-runtime-trigger__chevron" })] }), open && position ? createPortal(_jsxs("div", { ref: popoverRef, className: "jini-runtime-popover", ...(originTheme ? { 'data-theme': originTheme } : {}), id: dialogId, role: "dialog", "aria-label": t('Choose AI runtime'), "aria-modal": "false", style: position, onKeyDown: handlePopoverKeyDown, children: [_jsxs("div", { className: "jini-runtime-popover__head", children: [_jsx("strong", { children: executionMode === 'local' ? t('Local CLI') : t('API · BYOK') }), _jsx("span", { children: runtimeSummary })] }), _jsx(RuntimeModeButtons, { executionMode: executionMode, daemonOnline: daemonOnline, apiModeAvailable: apiModeAvailable, onExecutionModeChange: onExecutionModeChange, t: t }), isApi ? (_jsx(RuntimeByokDetails, { byokRuntime: byokRuntime, onByokModelChange: onByokModelChange, t: t })) : (_jsxs(_Fragment, { children: [_jsx("div", { className: "jini-runtime-section-label", children: t('Code agent') }), _jsx("div", { role: "radiogroup", "aria-label": t('Code agent'), children: _jsx(RuntimeAgentList, { orderedAgents: orderedAgents, value: value, onChange: onChange, agentIconBasePath: agentIconBasePath, t: t }) }), _jsx(RuntimeModelSelects, { selectedAgent: selectedAgent, value: value, onChange: onChange, t: t }), _jsx(RuntimeRescanFooter, { onRescan: onRescan, scanning: scanning, t: t })] }))] }), document.body) : null] }));
101
+ }
102
+ //# sourceMappingURL=AgentRuntimePicker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentRuntimePicker.js","sourceRoot":"","sources":["../../../../../../src/react/features/chat-pane/react/components/AgentRuntimePicker.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,qBAAq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KAAC,mBAAmB,IAAC,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,GAAI,EAE7F,KAAC,mBAAmB,IAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,GAAI,IACpE,CACJ,IACG,EACN,QAAQ,CAAC,IAAI,CACd,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { ChatPaneProps } from '../../types.js';
2
+ /**
3
+ * Renders the self-contained chat-pane composition, including runtime and
4
+ * working-directory orchestration owned by `@jini-ai/chat-react`.
5
+ *
6
+ * @complexity Time/space: O(n) in rendered messages, agents, and suggestions.
7
+ * @overallScore 100/100
8
+ */
9
+ export declare function ChatPane({ transport, agents: injectedAgents, runtimeAccess, runtimeStatusPollMs, title, variant, initialMessages, conversationId, initialSelection, selection: controlledSelection, onSelectionChange, runContext, agentControl, onActivityChange, onMessagesChange, onRescanAgents, scanningAgents, daemonOnline, executionMode, apiModeAvailable, onExecutionModeChange, byokRuntime, onByokModelChange, initialDraft, placeholder, suggestions, workingDirectory, initialWorkingDirectory, onChangeWorkingDirectory, workingDirectoryAccess, projectFileNames, uploadAttachments, attachmentAccept, disabled, runtimePickerPlacement, composerSlots, header, leadingAccessory, footer, className, style, }: ChatPaneProps): import("react").JSX.Element;
10
+ //# sourceMappingURL=ChatPane.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatPane.d.ts","sourceRoot":"","sources":["../../../../../../src/react/features/chat-pane/react/components/ChatPane.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAEV,aAAa,EAId,MAAM,gBAAgB,CAAC;AAgSxB;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EACvB,SAAS,EACT,MAAM,EAAE,cAA6B,EACrC,aAAa,EACb,mBAA2B,EAC3B,KAAK,EACL,OAAqB,EACrB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,SAAS,EAAE,mBAAmB,EAC9B,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,cAAsB,EACtB,YAAmB,EACnB,aAAuB,EACvB,gBAAwB,EACxB,qBAAqB,EACrB,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,WAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,QAAgB,EAChB,sBAA6B,EAC7B,aAAa,EACb,MAAM,EACN,gBAAgB,EAChB,MAAM,EACN,SAAS,EACT,KAAK,GACN,EAAE,aAAa,+BAoHf"}
@@ -0,0 +1,137 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { WorkingDirPicker } from '@jini-ai/ui';
3
+ import { Composer } from '../../../../components/Composer.js';
4
+ import { MessageList } from '../../../../components/MessageList.js';
5
+ import { useT } from '../../../../hooks/context.js';
6
+ import { definedProps } from '../../../../util/defined-props.js';
7
+ import { useChatPane } from '../hooks/useChatPane.hooks.js';
8
+ import { useChatPaneAgentControl } from '../hooks/useChatPaneAgentControl.hooks.js';
9
+ import { useChatPaneFileDrop, } from '../hooks/useChatPaneFileDrop.hooks.js';
10
+ import { useChatPaneRuntimeInventory, } from '../hooks/useChatPaneRuntimeInventory.hooks.js';
11
+ import { CHAT_PANE_STYLES } from '../styles.js';
12
+ import { AgentRuntimePicker } from './AgentRuntimePicker.js';
13
+ const EMPTY_AGENTS = [];
14
+ function defaultHeader(title, onReset, t) {
15
+ return (_jsxs("div", { className: "jini-chat-pane__header", children: [_jsxs("div", { className: "jini-chat-pane__heading", children: [_jsx("span", { className: "jini-chat-pane__eyebrow", children: t('Workspace chat') }), _jsx("h1", { className: "jini-chat-pane__title", children: title ?? t('Chat') })] }), _jsx("button", { type: "button", className: "jini-chat-pane__new-thread", onClick: onReset, children: t('New thread') })] }));
16
+ }
17
+ /** Collapses `header ?? defaultHeader(...)` out of `ChatPane` itself — nesting is what taxes the
18
+ * `??` in the caller's score, not the branch itself. */
19
+ function resolveChatPaneHeader(header, title, onReset, t) {
20
+ return header ?? defaultHeader(title, onReset, t);
21
+ }
22
+ function chatPaneClassName(variant, className) {
23
+ return `jini-chat-pane jini-chat-pane--${variant}${className ? ` ${className}` : ''}`;
24
+ }
25
+ function resolveRuntimeAccessView(runtimeAccess, injectedAgents, scanningAgents, daemonOnline, onRescanAgents, inventory) {
26
+ if (runtimeAccess === undefined) {
27
+ return { agents: injectedAgents, scanningAgents, daemonOnline, rescanAgents: onRescanAgents };
28
+ }
29
+ return {
30
+ agents: inventory.agents,
31
+ scanningAgents: inventory.scanningAgents,
32
+ daemonOnline: inventory.daemonOnline,
33
+ rescanAgents: () => void inventory.rescanAgents(),
34
+ };
35
+ }
36
+ function ChatPaneSuggestionsRow({ suggestions, onSelect, t }) {
37
+ if (suggestions.length === 0)
38
+ return null;
39
+ return (_jsx("div", { className: "jini-chat-pane__suggestions", "aria-label": t('Example prompts'), children: suggestions.map((suggestion) => (_jsx("button", { type: "button", className: "jini-chat-pane__suggestion", onClick: () => onSelect(suggestion), children: suggestion }, suggestion))) }));
40
+ }
41
+ /** The pane's stack of mutually-independent error/status banners — each condition is its own
42
+ * source of truth, so they are rendered as siblings rather than folded into one derived state. */
43
+ function ChatPaneStatusMessages({ unavailable, conversationError, attachmentError, dropReadError, workingDirectoryError, workingDirectoryPending, workingDirectoryInvalid, runtimeInventoryError, t, }) {
44
+ return (_jsxs(_Fragment, { children: [unavailable ? (_jsx("div", { className: "jini-chat-pane__error", role: "alert", children: t('No usable CLI is selected.') })) : null, conversationError ? (_jsx("div", { className: "jini-chat-pane__error", role: "alert", children: conversationError.message })) : null, attachmentError ? (_jsx("div", { className: "jini-chat-pane__error", role: "alert", children: attachmentError.message })) : null, dropReadError ? (_jsx("div", { className: "jini-chat-pane__error", role: "alert", children: dropReadError })) : null, workingDirectoryError ? (_jsx("div", { className: "jini-chat-pane__error", role: "alert", children: workingDirectoryError.message })) : null, workingDirectoryPending ? (_jsx("div", { className: "jini-chat-pane__status", role: "status", children: t('Checking working directory…') })) : workingDirectoryInvalid ? (_jsx("div", { className: "jini-chat-pane__error", role: "alert", children: t('Working directory is unavailable.') })) : null, runtimeInventoryError ? (_jsx("div", { className: "jini-chat-pane__error", role: "alert", children: runtimeInventoryError.message })) : null] }));
45
+ }
46
+ function ChatPaneWorkingDirectoryBlock({ workingDirectoryAccess, pane, t, }) {
47
+ if (workingDirectoryAccess) {
48
+ return (_jsx("div", { className: "jini-chat-pane__workdir", children: _jsx(WorkingDirPicker, { workingDir: pane.workingDirectory, recentDirs: [...pane.recentDirectories], onPickDirectory: () => void pane.pickWorkingDirectory(), onSelectRecent: (directory) => void pane.selectRecentDirectory(directory), placement: "up", onClear: pane.clearWorkingDirectory, invalid: pane.workingDirectoryInvalid, onOpen: () => void pane.openWorkingDirectoryPicker(), labels: { trigger: t('Select working directory') } }) }));
49
+ }
50
+ if (pane.workingDirectory) {
51
+ return (_jsxs("div", { className: "jini-chat-pane__workdir", children: [_jsx("strong", { children: t('Working directory') }), _jsx("code", { children: pane.workingDirectory })] }));
52
+ }
53
+ return null;
54
+ }
55
+ /** `uploadAttachments === undefined` gates BOTH of these — a temporarily-disabled composer still
56
+ * consumes a file drop so the browser cannot navigate away to the local file (see
57
+ * `useChatPaneFileDrop`'s module doc), so the drop handlers stay attached even when the picker
58
+ * itself is hidden. Shared here so `ChatPaneComposerArea` pays for the branch once, at module
59
+ * scope, instead of per call site. */
60
+ function resolveDropTargetProps(uploadAttachments, fileDrop) {
61
+ return uploadAttachments === undefined ? {} : fileDrop.targetProps;
62
+ }
63
+ function resolveComposerAttachmentPicker(uploadAttachments, pane, attachmentAccept) {
64
+ if (uploadAttachments === undefined)
65
+ return {};
66
+ return {
67
+ attachmentPicker: definedProps({
68
+ onFiles: pane.addAttachments,
69
+ uploading: pane.isUploadingAttachments,
70
+ accept: attachmentAccept,
71
+ }),
72
+ };
73
+ }
74
+ /** The drop target, composer, working-directory block, and cancel-run control — everything below
75
+ * the status banners that reads/writes the live pane. */
76
+ function ChatPaneComposerArea({ fileDrop, uploadAttachments, pane, disabled, unavailable, placeholder, slots, attachmentAccept, workingDirectoryAccess, t, }) {
77
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: `jini-chat-pane__drop-target${fileDrop.draggingFiles ? ' is-dragging-files' : ''}`, "data-testid": "chat-pane-file-drop-target", "data-dragging-files": fileDrop.draggingFiles ? 'true' : 'false', ...resolveDropTargetProps(uploadAttachments, fileDrop), children: [fileDrop.draggingFiles ? (_jsx("span", { className: "jini-chat-pane__drop-announcement", role: "status", children: t('Drop files to attach') })) : null, _jsx(Composer, { composer: pane.composer, onSend: () => void pane.send(), disabled: disabled || unavailable || pane.conversation.isStreaming, sendDisabled: !pane.canSend, ...definedProps({ placeholder }), slots: slots, ...resolveComposerAttachmentPicker(uploadAttachments, pane, attachmentAccept) }), _jsx(ChatPaneWorkingDirectoryBlock, { workingDirectoryAccess: workingDirectoryAccess, pane: pane, t: t })] }), pane.conversation.isStreaming ? (_jsx("button", { type: "button", className: "jini-chat-pane__cancel", onClick: pane.conversation.cancel, children: t('Stop run') })) : null] }));
78
+ }
79
+ /**
80
+ * Renders the self-contained chat-pane composition, including runtime and
81
+ * working-directory orchestration owned by `@jini-ai/chat-react`.
82
+ *
83
+ * @complexity Time/space: O(n) in rendered messages, agents, and suggestions.
84
+ * @overallScore 100/100
85
+ */
86
+ export function ChatPane({ transport, agents: injectedAgents = EMPTY_AGENTS, runtimeAccess, runtimeStatusPollMs = 5_000, title, variant = 'workspace', initialMessages, conversationId, initialSelection, selection: controlledSelection, onSelectionChange, runContext, agentControl, onActivityChange, onMessagesChange, onRescanAgents, scanningAgents = false, daemonOnline = true, executionMode = 'local', apiModeAvailable = false, onExecutionModeChange, byokRuntime, onByokModelChange, initialDraft, placeholder, suggestions = [], workingDirectory, initialWorkingDirectory, onChangeWorkingDirectory, workingDirectoryAccess, projectFileNames, uploadAttachments, attachmentAccept, disabled = false, runtimePickerPlacement = 'up', composerSlots, header, leadingAccessory, footer, className, style, }) {
87
+ const t = useT();
88
+ const inventory = useChatPaneRuntimeInventory(definedProps({
89
+ access: runtimeAccess,
90
+ initialAgents: injectedAgents,
91
+ pollIntervalMs: runtimeStatusPollMs,
92
+ }));
93
+ const runtimeView = resolveRuntimeAccessView(runtimeAccess, injectedAgents, scanningAgents, daemonOnline, onRescanAgents, inventory);
94
+ const pane = useChatPane(definedProps({
95
+ transport,
96
+ agents: runtimeView.agents,
97
+ initialMessages,
98
+ conversationId,
99
+ initialSelection,
100
+ selection: controlledSelection,
101
+ onSelectionChange,
102
+ runContext,
103
+ initialDraft,
104
+ uploadAttachments,
105
+ onActivityChange,
106
+ onMessagesChange,
107
+ workingDirectory,
108
+ initialWorkingDirectory,
109
+ onChangeWorkingDirectory,
110
+ workingDirectoryAccess,
111
+ }));
112
+ // No `runContext` here on purpose: agent-driven sends go through `pane.sendPrompt`, which builds
113
+ // the context from the SAME `runContext` already handed to `useChatPane` above. A second copy
114
+ // would be a second source of truth that could silently drift from the composer's.
115
+ useChatPaneAgentControl(pane, definedProps({
116
+ enabled: agentControl?.enabled ?? false,
117
+ bridgeAccess: agentControl?.bridgeAccess,
118
+ }));
119
+ // Selection resolution only returns available agents, so absence is the
120
+ // single fail-closed state the view needs to represent.
121
+ const unavailable = pane.selectedAgent === undefined;
122
+ const fileDrop = useChatPaneFileDrop({
123
+ enabled: uploadAttachments !== undefined
124
+ && !disabled
125
+ && !unavailable
126
+ && !pane.conversation.isStreaming
127
+ && !pane.isUploadingAttachments,
128
+ onFiles: pane.addAttachments,
129
+ });
130
+ const slots = definedProps({
131
+ ...composerSlots,
132
+ leadingAccessories: leadingAccessory,
133
+ footerAccessories: (_jsx(AgentRuntimePicker, { agents: runtimeView.agents, value: pane.selection, onChange: pane.setSelection, ...definedProps({ onRescan: runtimeView.rescanAgents }), scanning: runtimeView.scanningAgents, daemonOnline: runtimeView.daemonOnline, placement: runtimePickerPlacement, executionMode: executionMode, apiModeAvailable: apiModeAvailable, ...definedProps({ onExecutionModeChange, byokRuntime, onByokModelChange }) })),
134
+ });
135
+ return (_jsxs("section", { className: chatPaneClassName(variant, className), style: style, "data-activity": pane.activity, children: [_jsx("style", { "data-jini-chat-pane-styles": "true", children: CHAT_PANE_STYLES }), resolveChatPaneHeader(header, title, pane.reset, t), _jsxs("div", { className: "jini-chat-pane__body", children: [_jsx(MessageList, { messages: pane.conversation.messages, isStreaming: pane.conversation.isStreaming, scrollIntent: pane.conversation.scrollIntent, onScrolled: pane.conversation.acknowledgeScroll, ...(projectFileNames === undefined ? {} : { projectFileNames: new Set(projectFileNames) }) }), _jsxs("div", { className: "jini-chat-pane__controls", children: [_jsx(ChatPaneSuggestionsRow, { suggestions: suggestions, onSelect: pane.composer.setDraft, t: t }), _jsx(ChatPaneStatusMessages, { unavailable: unavailable, conversationError: pane.conversation.error, attachmentError: pane.attachmentError, dropReadError: fileDrop.dropReadError, workingDirectoryError: pane.workingDirectoryError, workingDirectoryPending: pane.workingDirectoryPending, workingDirectoryInvalid: pane.workingDirectoryInvalid, runtimeInventoryError: inventory.runtimeInventoryError, t: t }), _jsx(ChatPaneComposerArea, { fileDrop: fileDrop, uploadAttachments: uploadAttachments, pane: pane, disabled: disabled, unavailable: unavailable, placeholder: placeholder, slots: slots, attachmentAccept: attachmentAccept, workingDirectoryAccess: workingDirectoryAccess, t: t })] })] }), footer] }));
136
+ }
137
+ //# sourceMappingURL=ChatPane.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatPane.js","sourceRoot":"","sources":["../../../../../../src/react/features/chat-pane/react/components/ChatPane.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO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,CAAC,qBAAqB,EACjD,uBAAuB,EAAE,IAAI,CAAC,uBAAuB,EACrD,uBAAuB,EAAE,IAAI,CAAC,uBAAuB,EACrD,qBAAqB,EAAE,SAAS,CAAC,qBAAqB,EACtD,CAAC,EAAE,CAAC,GACJ,EACF,KAAC,oBAAoB,IACnB,QAAQ,EAAE,QAAQ,EAClB,iBAAiB,EAAE,iBAAiB,EACpC,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EACZ,gBAAgB,EAAE,gBAAgB,EAClC,sBAAsB,EAAE,sBAAsB,EAC9C,CAAC,EAAE,CAAC,GACJ,IACE,IACF,EACL,MAAM,IACC,CACX,CAAC;AACJ,CAAC"}
@@ -0,0 +1,133 @@
1
+ /**
2
+ * All of `AgentRuntimePicker`'s behavior, so the component itself is only markup.
3
+ *
4
+ * What lives here is popover mechanics — open/close, dismissal, viewport-bounded positioning,
5
+ * focus restoration, and roving/trapped keyboard focus — plus the two derived labels the view
6
+ * shows. None of it is chat-specific; the only reason it is scoped to this feature rather than
7
+ * promoted to `@jini-ai/ui` is noted at the bottom of this comment.
8
+ *
9
+ * The pure functions below are separated from the hook deliberately: geometry and key-to-index
10
+ * resolution have real input/output contracts and edge cases (viewport clamping, `currentIndex`
11
+ * of `-1`, Tab-at-an-edge) that are far cheaper to test directly than to drive through a rendered
12
+ * popover with a mocked `getBoundingClientRect`. The hook itself owns only React lifecycle.
13
+ *
14
+ * **Not yet using `@jini-ai/ui`'s `useDismissOnOutsideOrEscape`**, which covers the same
15
+ * outside-click/Escape ground and whose own doc notes six features had hand-rolled it before this
16
+ * one. Two concrete mismatches block a drop-in: it takes a single `containerRef`, whereas here
17
+ * "inside" means the trigger *or* the portaled popover (two disjoint subtrees, since the popover
18
+ * renders into `document.body`); and it exposes one `onDismiss` with no indication of which input
19
+ * dismissed, while this popover must restore focus on the next tick for a pointer and immediately
20
+ * for Escape (see the comment on that timeout). Consolidating means extending the shared hook to
21
+ * accept multiple containers and report the dismissal cause — worth doing, but as its own change
22
+ * to a package other features already depend on, not as a side effect of this extraction.
23
+ */
24
+ import { type CSSProperties, type KeyboardEvent as ReactKeyboardEvent, type RefObject } from 'react';
25
+ import type { ByokRuntimeSummary, ChatPaneAgent, ChatPaneAgentSelection, RuntimePickerPlacement } from '../../types.js';
26
+ /**
27
+ * Resolves the user-facing label for a selected model or reasoning option.
28
+ *
29
+ * @complexity Time: O(n) in the supplied option count; space: O(1).
30
+ * @overallScore 100/100
31
+ */
32
+ export declare function runtimeOptionLabel(options: readonly {
33
+ id: string;
34
+ label: string;
35
+ }[] | undefined, value: string | undefined, fallback: string): string;
36
+ /**
37
+ * Computes a viewport-bounded fixed position for the body-portaled picker.
38
+ *
39
+ * @complexity Time/space: O(1).
40
+ * @overallScore 100/100
41
+ */
42
+ export declare function runtimePopoverPosition(trigger: DOMRect, placement: RuntimePickerPlacement): CSSProperties;
43
+ /** `Tab` wraps focus around the popover's control list instead of leaving it (the popover is a
44
+ * modal-ish dialog). Returns the index to wrap TO, or `null` when `Tab` should behave natively
45
+ * (not at an edge). `currentIndex` may be `-1` (active element not in `controls`); `atStart`/
46
+ * `atEnd` below only matter when it legitimately is 0 or `count - 1`. */
47
+ export declare function resolveTabWrapIndex(shiftKey: boolean, currentIndex: number, count: number): number | null;
48
+ /** Arrow/Home/End roving-tabindex target, or `null` for any other key. `currentIndex === -1`
49
+ * (nothing in `controls` focused yet) is a legitimate input — the modulo arithmetic below relies
50
+ * on it wrapping the same way a real index would. */
51
+ export declare function resolveRovingIndex(key: string, currentIndex: number, count: number): number | null;
52
+ /**
53
+ * The control index the popover's key handler should move focus to, or `null` to leave focus alone
54
+ * (and, in the caller, to skip `preventDefault()`). `Tab` is resolved and returned immediately —
55
+ * it must never fall through to the roving-tabindex logic below it.
56
+ */
57
+ export declare function resolvePopoverKeyAction(key: string, shiftKey: boolean, isButtonTarget: boolean, currentIndex: number, count: number): number | null;
58
+ /** Builds the one-line "which runtime am I talking to" summary shown in the popover head. */
59
+ export declare function runtimeSummaryText(selectedAgent: ChatPaneAgent | undefined, modelLabel: string, t: (key: string) => string): string;
60
+ /**
61
+ * The head/trigger labels while `executionMode` is `'api'`.
62
+ *
63
+ * Separate from {@link runtimeSummaryText} rather than folded into it because the two describe
64
+ * different things and fail differently: that one names a detected CLI and its model, this one
65
+ * names a provider and the model the credential is configured for, and neither has a sensible
66
+ * fallback to the other. A missing provider label here is not "no agent selected" — the API path is
67
+ * still what will run — so the fallback is a generic mode name, never a CLI's.
68
+ *
69
+ * @complexity Time/space: O(1).
70
+ */
71
+ export declare function byokSummaryText(byokRuntime: ByokRuntimeSummary | undefined, t: (key: string) => string): {
72
+ title: string;
73
+ modelLabel: string;
74
+ summary: string;
75
+ };
76
+ export interface UseAgentRuntimePickerOptions {
77
+ agents: readonly ChatPaneAgent[];
78
+ value: ChatPaneAgentSelection;
79
+ placement: RuntimePickerPlacement;
80
+ /** Translator, injected rather than read from context so this hook is testable without a provider. */
81
+ t: (key: string) => string;
82
+ /** Which runtime the labels below should describe. Defaults to `'local'`, preserving the
83
+ * pre-BYOK behavior for every caller that does not pass one. */
84
+ executionMode?: 'local' | 'api';
85
+ /** Only read when `executionMode` is `'api'`. Explicitly `| undefined` because the package builds
86
+ * under `exactOptionalPropertyTypes` and the component forwards its own optional prop straight
87
+ * through. */
88
+ byokRuntime?: ByokRuntimeSummary | undefined;
89
+ }
90
+ export interface UseAgentRuntimePickerResult {
91
+ /** Ties the trigger's `aria-controls` to the popover's `id`. */
92
+ dialogId: string;
93
+ open: boolean;
94
+ /** Undefined until the trigger has been measured; the popover does not render before then. */
95
+ position: CSSProperties | undefined;
96
+ triggerRef: RefObject<HTMLButtonElement | null>;
97
+ popoverRef: RefObject<HTMLDivElement | null>;
98
+ /** Unavailable agents removed, then ordered — what the radio group renders. */
99
+ orderedAgents: readonly ChatPaneAgent[];
100
+ selectedAgent: ChatPaneAgent | undefined;
101
+ modelLabel: string;
102
+ runtimeSummary: string;
103
+ /** What the collapsed trigger names as the runtime — the selected CLI in `'local'`, the provider
104
+ * in `'api'`. A separate field because the trigger must NOT fall back to `selectedAgent.name`
105
+ * while an API turn is what would actually run. */
106
+ triggerTitle: string;
107
+ /**
108
+ * The `data-theme` of the place the popover was opened FROM, or `null` when the host pins none.
109
+ *
110
+ * The popover renders through `createPortal` into `document.body`, so it escapes any `data-theme`
111
+ * on an ancestor of the trigger — and `@jini-ai/ui` themes entirely through `[data-theme]` token
112
+ * blocks, with its DARK values on a bare `@media (prefers-color-scheme: dark) { :root { … } }`.
113
+ * The consequence is not hypothetical: measured in Tovu's admin on a dark-mode machine, the
114
+ * popover itself looked right (the chat package's own `--jini-chat-*` tokens default light) while
115
+ * the `@jini-ai/ui` control inside it — the BYOK model select — resolved against that dark `:root`
116
+ * block and rendered dark-on-dark inside an all-light admin.
117
+ *
118
+ * So the popover carries its origin's theme with it, the same compensation `CustomSelect` already
119
+ * makes for its own portaled menu. `null` leaves document-level theming untouched, so a host that
120
+ * pins nothing is byte-identical to before.
121
+ */
122
+ originTheme: string | null;
123
+ toggleOpen: () => void;
124
+ handlePopoverKeyDown: (event: ReactKeyboardEvent<HTMLDivElement>) => void;
125
+ }
126
+ /**
127
+ * Owns the runtime picker's popover state so the component stays presentational.
128
+ *
129
+ * @complexity Time: O(n) in the agent count for ordering/selection; space: O(n) for the ordered
130
+ * snapshot. The DOM queries are O(c) in the popover's own control count.
131
+ */
132
+ export declare function useAgentRuntimePicker({ agents, value, placement, t, executionMode, byokRuntime, }: UseAgentRuntimePickerOptions): UseAgentRuntimePickerResult;
133
+ //# sourceMappingURL=useAgentRuntimePicker.hooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAgentRuntimePicker.hooks.d.ts","sourceRoot":"","sources":["../../../../../../src/react/features/chat-pane/react/hooks/useAgentRuntimePicker.hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;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