@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 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/react/features/chat-pane/styles.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6yC/B,CAAC"}
@@ -0,0 +1,248 @@
1
+ import type { CSSProperties, ReactNode, RefObject } from 'react';
2
+ import type { ChatAttachment, ChatMessage } from '@jini-ai/chat/core';
3
+ import type { ComposerSlots } from '../../slots.js';
4
+ import type { ChatTransport, RunContext } from '@jini-ai/chat/core';
5
+ export interface ChatPaneAgentOption {
6
+ id: string;
7
+ label: string;
8
+ }
9
+ /**
10
+ * Browser-safe runtime inventory consumed by the chat pane. This is
11
+ * structurally compatible with the daemon's `AgentSummary` DTO without
12
+ * coupling the React package to `@jini-ai/http-kit`.
13
+ */
14
+ export interface ChatPaneAgent {
15
+ id: string;
16
+ name: string;
17
+ available?: boolean;
18
+ version?: string | null;
19
+ authStatus?: 'ok' | 'missing' | 'unknown';
20
+ models?: readonly ChatPaneAgentOption[];
21
+ reasoningOptions?: readonly ChatPaneAgentOption[];
22
+ supportsCustomModel?: boolean;
23
+ diagnostic?: string;
24
+ }
25
+ export interface ChatPaneAgentSelection {
26
+ agentId: string;
27
+ model?: string;
28
+ reasoning?: string;
29
+ }
30
+ /** Host I/O effects used by the package-owned runtime inventory controller. */
31
+ export interface ChatPaneRuntimeAccess {
32
+ listAgents: () => Promise<readonly ChatPaneAgent[]>;
33
+ rescanAgents: () => Promise<readonly ChatPaneAgent[]>;
34
+ daemonOnline: () => Promise<boolean>;
35
+ }
36
+ export type ChatPaneActivity = 'unavailable' | 'ready' | 'queued' | 'streaming' | 'failed';
37
+ export type ChatPaneVariant = 'workspace';
38
+ export type RuntimePickerPlacement = 'up' | 'down';
39
+ /**
40
+ * Native filesystem operations used by {@link ChatPane} to implement its
41
+ * working-directory picker. The host provides effects only; current state,
42
+ * recent-folder UI, validation, cancellation, and errors remain package-owned.
43
+ *
44
+ * @example
45
+ * ```tsx
46
+ * <ChatPane
47
+ * initialWorkingDirectory="/work/example"
48
+ * onChangeWorkingDirectory={(directory) => console.log(directory)}
49
+ * workingDirectoryAccess={desktopBridge}
50
+ * />
51
+ * ```
52
+ */
53
+ export interface ChatPaneWorkingDirectoryAccess {
54
+ /** Canonicalizes a trusted host-declared initial directory when supported. */
55
+ normalizeWorkingDirectory?: (directory: string) => Promise<string | null>;
56
+ /** Opens a native folder dialog and returns null when the user cancels. */
57
+ pickWorkingDirectory: (currentDirectory?: string) => Promise<string | null>;
58
+ /** Reads most-recently-used folders in most-recent-first order. */
59
+ recentDirectories: () => Promise<readonly string[]>;
60
+ /** Checks whether a selected or recent directory still exists. */
61
+ directoryExists: (directory: string) => Promise<boolean>;
62
+ }
63
+ /** One daemon-relayed capability invocation the pane must execute and answer. */
64
+ export interface ChatPaneAgentToolAction {
65
+ readonly invocationId: string;
66
+ readonly capabilityId: string;
67
+ readonly input: Record<string, unknown>;
68
+ }
69
+ /**
70
+ * Host-supplied channel connecting this pane instance to a daemon-side transport (HTTP route, MCP
71
+ * stdio server) that cannot reach browser state directly. `subscribe` is called once while agent
72
+ * control is enabled; the host pushes each relayed action through its callback and the pane answers
73
+ * via `respondSuccess`/`respondError`. Omit entirely to run WebMCP-only (no daemon relay).
74
+ */
75
+ export interface ChatPaneAgentBridgeAccess {
76
+ /** Starts listening for relayed actions; returns an unsubscribe function. */
77
+ subscribe: (onAction: (action: ChatPaneAgentToolAction) => void) => () => void;
78
+ respondSuccess: (invocationId: string, output: unknown) => Promise<void>;
79
+ respondError: (invocationId: string, message: string) => Promise<void>;
80
+ }
81
+ /** Enables the chat pane's agent-control surface (`agent-tools.ts`'s `CHAT_PANE_AGENT_TOOLS`). */
82
+ export interface ChatPaneAgentControlOptions {
83
+ /** Defaults to `false` — agent control is opt-in. */
84
+ enabled?: boolean;
85
+ /** Wires the daemon-relayed transports (HTTP route table, MCP stdio server) in addition to in-page WebMCP. */
86
+ bridgeAccess?: ChatPaneAgentBridgeAccess;
87
+ }
88
+ export interface ChatPaneRunContextInput {
89
+ prompt: string;
90
+ selection: ChatPaneAgentSelection;
91
+ workingDirectory: string | null;
92
+ }
93
+ export type ChatPaneRunContext = RunContext | ((input: ChatPaneRunContextInput) => RunContext | undefined);
94
+ /**
95
+ * Imperative access to the composer's draft text — published on `composerHandle.current` by
96
+ * `ChatPane` itself once mounted (`null` before mount and after unmount).
97
+ */
98
+ export interface ChatPaneComposerHandle {
99
+ /**
100
+ * Appends `text` to whatever the operator has already typed (same joining rule the "+" discovery
101
+ * menu's `insertText` items use — see `appendComposerDiscovery`), rather than replacing the draft
102
+ * outright. This is the seam for a host that needs to write into the draft AFTER first render —
103
+ * `initialDraft` only seeds the very first one and cannot be written to again, and `ChatPane`
104
+ * exposes no other prop for pushing text into an in-progress draft from outside.
105
+ */
106
+ insertText: (text: string) => void;
107
+ }
108
+ export interface ChatPaneProps {
109
+ transport: ChatTransport;
110
+ agents?: readonly ChatPaneAgent[];
111
+ /** Optional host effects for package-owned inventory, rescan, and health polling. */
112
+ runtimeAccess?: ChatPaneRuntimeAccess;
113
+ runtimeStatusPollMs?: number;
114
+ title?: string;
115
+ variant?: ChatPaneVariant;
116
+ initialMessages?: ChatMessage[];
117
+ conversationId?: string | null;
118
+ initialSelection?: ChatPaneAgentSelection;
119
+ selection?: ChatPaneAgentSelection;
120
+ onSelectionChange?: (selection: ChatPaneAgentSelection) => void;
121
+ runContext?: ChatPaneRunContext;
122
+ /** Opt-in agent-control surface: WebMCP tool registration plus, when `bridgeAccess` is supplied, the daemon-relayed transports. */
123
+ agentControl?: ChatPaneAgentControlOptions;
124
+ onActivityChange?: (activity: ChatPaneActivity) => void;
125
+ /** Fires with the full message list whenever it changes — the read side of an otherwise write-only pane, for a host that needs to inspect or test what the conversation actually contains. */
126
+ onMessagesChange?: (messages: ChatMessage[]) => void;
127
+ onRescanAgents?: () => void;
128
+ scanningAgents?: boolean;
129
+ daemonOnline?: boolean;
130
+ executionMode?: 'local' | 'api';
131
+ apiModeAvailable?: boolean;
132
+ onExecutionModeChange?: (mode: 'local' | 'api') => void;
133
+ /** Passed straight through to the runtime picker; see {@link ByokRuntimeSummary}. */
134
+ byokRuntime?: ByokRuntimeSummary;
135
+ /** Passed straight through to the runtime picker. */
136
+ onByokModelChange?: (model: string) => void;
137
+ initialDraft?: string;
138
+ /**
139
+ * A ref `ChatPane` populates with a `ChatPaneComposerHandle` once mounted, for a host that needs
140
+ * to insert text into the draft from OUTSIDE this component's own props — e.g. an absolute path
141
+ * a desktop host recovered from a native drag-drop event and could not have known at
142
+ * `initialDraft`-seeding time. `null` before mount and after unmount; a host calling `.insertText`
143
+ * before the pane exists has nothing to call.
144
+ */
145
+ composerHandle?: RefObject<ChatPaneComposerHandle | null>;
146
+ placeholder?: string;
147
+ suggestions?: readonly string[];
148
+ /** Controlled working-directory value. */
149
+ workingDirectory?: string | null;
150
+ /** Initial value used when `workingDirectory` is uncontrolled. */
151
+ initialWorkingDirectory?: string | null;
152
+ /** Reports a package-owned picker, recent-folder, or clear selection. */
153
+ onChangeWorkingDirectory?: (workingDirectory: string | null) => void;
154
+ /** Optional native filesystem effects used by the package-owned picker. */
155
+ workingDirectoryAccess?: ChatPaneWorkingDirectoryAccess;
156
+ projectFileNames?: ReadonlySet<string>;
157
+ uploadAttachments?: (files: File[], options?: ChatPaneAttachmentUploadOptions) => Promise<ChatAttachment[]>;
158
+ attachmentAccept?: string;
159
+ disabled?: boolean;
160
+ runtimePickerPlacement?: RuntimePickerPlacement;
161
+ /**
162
+ * `footerAccessories` AND `leadingAccessories` are both excluded here for the same reason:
163
+ * `ChatPane` itself always owns both ends of the composer's slot row. The footer is always the
164
+ * `AgentRuntimePicker` (see `slots` assembly below); the leading, pinned-context zone is always
165
+ * assembled from this interface's own {@link leadingAccessory} prop. A `composerSlots` value
166
+ * carrying either key used to type-check but silently lose the value at runtime — `ChatPane`'s
167
+ * `slots` object always overwrote both keys unconditionally — so this `Omit` turns that dead end
168
+ * into a compile error instead of a debugging session.
169
+ */
170
+ composerSlots?: Omit<ComposerSlots, 'footerAccessories' | 'leadingAccessories'>;
171
+ header?: ReactNode;
172
+ /**
173
+ * Content for the composer's pinned-context zone — the space above the input that a host
174
+ * populates with whatever it wants pinned there (selected plugins, MCP servers, anything else),
175
+ * and which Jini renders and animates as a first-class part of the composer control (see
176
+ * `CHAT_PANE_STYLES`'s `.jini-composer-leading` rules). `undefined`/`null` renders nothing at
177
+ * all, so an idle composer reserves no space for this zone.
178
+ */
179
+ leadingAccessory?: ReactNode;
180
+ footer?: ReactNode;
181
+ className?: string;
182
+ style?: CSSProperties;
183
+ }
184
+ export interface ChatPaneAttachmentUploadOptions {
185
+ /** Aborted when the composer resets, the pane unmounts, or the upload is superseded. */
186
+ signal: AbortSignal;
187
+ /** Stable identifier shared by uploads staged for the same composer turn. */
188
+ batchId: string;
189
+ }
190
+ /**
191
+ * What the host's BYOK credential actually resolves to, for the picker to report while
192
+ * `executionMode` is `'api'`.
193
+ *
194
+ * Exists because the picker had no way to describe the API path at all. It knew only that the mode
195
+ * was selectable (`apiModeAvailable`), so every label it rendered came from the detected CLI
196
+ * inventory — a popover reading "Claude Code · Default model", offering a CLI agent list, a
197
+ * "Default (CLI config)" model select and a Rescan PATH button, while the pane was in fact talking
198
+ * to Gemini over an API key. None of those controls affect an API turn.
199
+ *
200
+ * Optional, and the picker degrades honestly without it — unnamed provider, no model line — rather
201
+ * than falling back to CLI labels, which would restate the same wrong claim.
202
+ */
203
+ export interface ByokRuntimeSummary {
204
+ /** Human-readable provider name, e.g. `'Google Gemini'`. Usually a `ProviderPreset.title`. */
205
+ providerLabel?: string;
206
+ /** The configured model id, e.g. `'gemini-2.5-flash-lite'`. */
207
+ model?: string;
208
+ /**
209
+ * Brand-mark id for `AgentIcon`, e.g. `'gemini'`.
210
+ *
211
+ * Host-supplied rather than derived here from `providerLabel`, because which brand assets exist
212
+ * is a fact about the HOST's asset directory (`agentIconBasePath`), not about the provider. A
213
+ * package-side guess would render a broken image for any host that ships a different set.
214
+ * Omitted means "no mark available", and the picker falls back to a generic API glyph rather
215
+ * than to the selected CLI's logo, which would name the wrong runtime.
216
+ */
217
+ iconId?: string;
218
+ /**
219
+ * Models this credential can run — the same discovered list the host's own BYOK settings show.
220
+ *
221
+ * Supplying it (together with `onByokModelChange`) turns the model row into a real picker
222
+ * writing back to the host's stored config, so the composer and the settings screen are two
223
+ * views of one value. Omit for a read-only display.
224
+ */
225
+ models?: readonly {
226
+ id: string;
227
+ label: string;
228
+ }[];
229
+ }
230
+ export interface AgentRuntimePickerProps {
231
+ agents: readonly ChatPaneAgent[];
232
+ value: ChatPaneAgentSelection;
233
+ onChange: (selection: ChatPaneAgentSelection) => void;
234
+ onRescan?: () => void;
235
+ scanning?: boolean;
236
+ daemonOnline?: boolean;
237
+ placement?: RuntimePickerPlacement;
238
+ executionMode?: 'local' | 'api';
239
+ apiModeAvailable?: boolean;
240
+ onExecutionModeChange?: (mode: 'local' | 'api') => void;
241
+ /** Read while `executionMode === 'api'`; ignored in `'local'`. */
242
+ byokRuntime?: ByokRuntimeSummary;
243
+ /** Persists a model chosen from the BYOK row. Supplying it (with `byokRuntime.models`) is what
244
+ * makes that row an editable picker rather than a read-only value. */
245
+ onByokModelChange?: (model: string) => void;
246
+ agentIconBasePath?: string;
247
+ }
248
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/react/features/chat-pane/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,o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AI,CAAC;IAC5C,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/react/features/chat-pane/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import type { CredentialStatus } from '../types.js';
2
+ export interface CredentialStatusBadgeProps {
3
+ status: CredentialStatus;
4
+ className?: string;
5
+ }
6
+ export declare function CredentialStatusBadge({ status, className }: CredentialStatusBadgeProps): import("react").JSX.Element;
7
+ //# sourceMappingURL=CredentialStatusBadge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CredentialStatusBadge.d.ts","sourceRoot":"","sources":["../../../../../src/react/features/model-picker/components/CredentialStatusBadge.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,gBAAgB,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAQD,wBAAgB,qBAAqB,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,0BAA0B,+BAUtF"}
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * @module CredentialStatusBadge
4
+ *
5
+ * A provider's credential status as a small pill — ported from
6
+ * `NewProjectPanel.tsx`'s inline `newproj-provider-badge` span
7
+ * ("Configured"/"Integrated"/"Unsupported"), de-branded and relabeled to
8
+ * this feature's generic `CredentialStatus` union.
9
+ */
10
+ import { useT } from '../../../hooks/context.js';
11
+ const STATUS_LABEL = {
12
+ configured: 'Configured',
13
+ available: 'Available',
14
+ unconfigured: 'Not configured',
15
+ };
16
+ export function CredentialStatusBadge({ status, className }) {
17
+ const t = useT();
18
+ return (_jsx("span", { className: `model-picker-status-badge model-picker-status-badge--${status}${className ? ` ${className}` : ''}`, "data-status": status, children: t(STATUS_LABEL[status]) }));
19
+ }
20
+ //# sourceMappingURL=CredentialStatusBadge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CredentialStatusBadge.js","sourceRoot":"","sources":["../../../../../src/react/features/model-picker/components/CredentialStatusBadge.tsx"],"names":[],"mappings":";AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAQjD,MAAM,YAAY,GAAqC;IACrD,UAAU,EAAE,YAAY;IACxB,SAAS,EAAE,WAAW;IACtB,YAAY,EAAE,gBAAgB;CAC/B,CAAC;AAEF,MAAM,UAAU,qBAAqB,CAAC,EAAE,MAAM,EAAE,SAAS,EAA8B;IACrF,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC;IACjB,OAAO,CACL,eACE,SAAS,EAAE,wDAAwD,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,iBACjG,MAAM,YAElB,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,GACnB,CACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { UseModelPickerOptions } from '../hooks/useModelPicker.hooks.js';
2
+ export interface ModelPickerProps extends UseModelPickerOptions {
3
+ label: string;
4
+ searchPlaceholder?: string;
5
+ className?: string;
6
+ 'data-testid'?: string;
7
+ }
8
+ export declare function ModelPicker({ label, searchPlaceholder, className, 'data-testid': testId, ...pickerOptions }: ModelPickerProps): import("react").JSX.Element;
9
+ //# sourceMappingURL=ModelPicker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModelPicker.d.ts","sourceRoot":"","sources":["../../../../../src/react/features/model-picker/components/ModelPicker.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAG9E,MAAM,WAAW,gBAAiB,SAAQ,qBAAqB;IAC7D,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,iBAAiB,EACjB,SAAS,EACT,aAAa,EAAE,MAAM,EACrB,GAAG,aAAa,EACjB,EAAE,gBAAgB,+BAgFlB"}
@@ -0,0 +1,34 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * @module ModelPicker
4
+ *
5
+ * A generic, provider-grouped, credential-status-badged, searchable model
6
+ * picker: trigger button + inline popover. Consolidates two independently
7
+ * re-implemented OD shapes that R6 confirmed share this exact pattern —
8
+ * `NewProjectPanel.tsx`'s `MediaModelCards` (provider grouping + status
9
+ * badges + search) and `modelOptions.tsx`'s `SearchableModelSelect`
10
+ * (searchable trigger/popover with outside-click/Escape dismissal, folded
11
+ * into `useModelPicker`). Unlike `SearchableModelSelect`, the popover
12
+ * renders inline rather than via a `document.body` portal — this package
13
+ * has no fixed-positioning collision-avoidance primitive of its own, and an
14
+ * inline popover keeps the component trivially testable; a host embedding
15
+ * this inside a clipping/overflow container can override positioning with
16
+ * its own CSS. See `source-map.md`.
17
+ */
18
+ import { useT } from '../../../hooks/context.js';
19
+ import { Icon } from '../../../components/Icon.js';
20
+ import { modelSubtitle } from '../rules.js';
21
+ import { useModelPicker } from '../hooks/useModelPicker.hooks.js';
22
+ import { CredentialStatusBadge } from './CredentialStatusBadge.js';
23
+ export function ModelPicker({ label, searchPlaceholder, className, 'data-testid': testId, ...pickerOptions }) {
24
+ const t = useT();
25
+ const { open, query, filteredGroups, selection, shouldShowSearch, containerRef, setQuery, toggle, select } = useModelPicker(pickerOptions);
26
+ const triggerTitle = selection?.model.label ?? t('No model selected');
27
+ const triggerSubtitle = selection ? modelSubtitle(selection) : t('Choose a model');
28
+ const totalMatches = filteredGroups.reduce((count, group) => count + group.models.length, 0);
29
+ return (_jsxs("div", { className: `model-picker${className ? ` ${className}` : ''}`, ref: containerRef, "data-testid": testId, children: [_jsx("span", { className: "model-picker-label", children: t(label) }), _jsxs("button", { type: "button", className: `model-picker-trigger${open ? ' is-open' : ''}${selection ? '' : ' is-empty'}`, onClick: toggle, "aria-haspopup": "listbox", "aria-expanded": open, "data-testid": testId ? `${testId}-trigger` : undefined, children: [_jsxs("span", { className: "model-picker-trigger-meta", children: [_jsx("span", { className: "model-picker-trigger-title", children: triggerTitle }), _jsx("span", { className: "model-picker-trigger-subtitle", children: triggerSubtitle })] }), _jsx(Icon, { name: "chevron-down", size: 14, className: "model-picker-trigger-chevron" })] }), open ? (_jsxs("div", { className: "model-picker-popover", role: "listbox", "data-testid": testId ? `${testId}-popover` : undefined, children: [shouldShowSearch ? (_jsx("div", { className: "model-picker-search-row", children: _jsx("input", { type: "search", className: "model-picker-search", value: query, placeholder: t(searchPlaceholder ?? 'Search models'), "aria-label": t(searchPlaceholder ?? 'Search models'), "data-testid": testId ? `${testId}-search` : undefined, onChange: (event) => setQuery(event.target.value) }) })) : null, _jsx("div", { className: "model-picker-list", children: totalMatches === 0 ? (_jsx("div", { className: "model-picker-empty", children: t('No matching models') })) : (filteredGroups.map((group) => (_jsxs("div", { className: "model-picker-group", children: [_jsxs("div", { className: "model-picker-group-head", children: [_jsx("span", { children: t(group.provider.label) }), _jsx(CredentialStatusBadge, { status: group.status })] }), group.models.map((model) => {
30
+ const active = selection?.model.id === model.id;
31
+ return (_jsxs("button", { type: "button", role: "option", "aria-selected": active, className: `model-picker-option${active ? ' is-active' : ''}`, "data-testid": testId ? `${testId}-option-${model.id}` : undefined, onClick: () => select(model.id), children: [_jsxs("span", { className: "model-picker-option-title", children: [model.label, model.default ? _jsx("span", { className: "model-picker-option-badge", children: t('Recommended') }) : null] }), model.hint ? _jsx("span", { className: "model-picker-option-hint", children: model.hint }) : null] }, model.id));
32
+ })] }, group.provider.id)))) })] })) : null] }));
33
+ }
34
+ //# sourceMappingURL=ModelPicker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModelPicker.js","sourceRoot":"","sources":["../../../../../src/react/features/model-picker/components/ModelPicker.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AASnE,MAAM,UAAU,WAAW,CAAC,EAC1B,KAAK,EACL,iBAAiB,EACjB,SAAS,EACT,aAAa,EAAE,MAAM,EACrB,GAAG,aAAa,EACC;IACjB,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC;IACjB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,gBAAgB,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,GACxG,cAAc,CAAC,aAAa,CAAC,CAAC;IAEhC,MAAM,YAAY,GAAG,SAAS,EAAE,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC,mBAAmB,CAAC,CAAC;IACtE,MAAM,eAAe,GAAG,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;IACnF,MAAM,YAAY,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAE7F,OAAO,CACL,eAAK,SAAS,EAAE,eAAe,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE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E,KAAK,CAAC,IAAI,GAAQ,CAAC,CAAC,CAAC,IAAI,KAZ9E,KAAK,CAAC,EAAE,CAaN,CACV,CAAC;gCACJ,CAAC,CAAC,KAxBqC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAyBpD,CACP,CAAC,CACH,GACG,IACF,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { CredentialStatus } from './types.js';
2
+ /** Below this many total options, the picker skips the search input (matches OD's `SearchableModelSelect`). */
3
+ export declare const DEFAULT_MIN_SEARCHABLE_OPTIONS = 8;
4
+ /** Lower sorts first: configured providers surface above merely-available, above unconfigured. */
5
+ export declare const CREDENTIAL_STATUS_SORT_PRIORITY: Record<CredentialStatus, number>;
6
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/react/features/model-picker/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,+GAA+G;AAC/G,eAAO,MAAM,8BAA8B,IAAI,CAAC;AAEhD,kGAAkG;AAClG,eAAO,MAAM,+BAA+B,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAI5E,CAAC"}
@@ -0,0 +1,9 @@
1
+ /** Below this many total options, the picker skips the search input (matches OD's `SearchableModelSelect`). */
2
+ export const DEFAULT_MIN_SEARCHABLE_OPTIONS = 8;
3
+ /** Lower sorts first: configured providers surface above merely-available, above unconfigured. */
4
+ export const CREDENTIAL_STATUS_SORT_PRIORITY = {
5
+ configured: 0,
6
+ available: 1,
7
+ unconfigured: 2,
8
+ };
9
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/react/features/model-picker/constants.ts"],"names":[],"mappings":"AAEA,+GAA+G;AAC/G,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC;AAEhD,kGAAkG;AAClG,MAAM,CAAC,MAAM,+BAA+B,GAAqC;IAC/E,UAAU,EAAE,CAAC;IACb,SAAS,EAAE,CAAC;IACZ,YAAY,EAAE,CAAC;CAChB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { ModelPickerPort } from './ports.js';
2
+ /**
3
+ * Default port: no live provider-model fetch — the picker works from
4
+ * whatever `models`/`providers` a host passes in directly. A host that wants
5
+ * a live catalogue supplies its own `ModelPickerPort` (a real fetch
6
+ * implementation) to `useModelPicker`/`<ModelPicker>` instead; this package
7
+ * ships only the no-op default, never a concrete transport call, matching
8
+ * the `features/connectors/` canary's `dependencies.ts` precedent.
9
+ */
10
+ export declare const defaultModelPickerPort: ModelPickerPort;
11
+ //# sourceMappingURL=dependencies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../../../../src/react/features/model-picker/dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,EAAE,eAAoB,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Default port: no live provider-model fetch — the picker works from
3
+ * whatever `models`/`providers` a host passes in directly. A host that wants
4
+ * a live catalogue supplies its own `ModelPickerPort` (a real fetch
5
+ * implementation) to `useModelPicker`/`<ModelPicker>` instead; this package
6
+ * ships only the no-op default, never a concrete transport call, matching
7
+ * the `features/connectors/` canary's `dependencies.ts` precedent.
8
+ */
9
+ export const defaultModelPickerPort = {};
10
+ //# sourceMappingURL=dependencies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../../../src/react/features/model-picker/dependencies.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAoB,EAAE,CAAC"}
@@ -0,0 +1,27 @@
1
+ import type { RefObject } from 'react';
2
+ import type { CredentialStatus, ModelOption, ModelPickerGroup, ModelPickerSelection, ModelProvider } from '../types.js';
3
+ export interface UseModelPickerOptions {
4
+ models: readonly ModelOption[];
5
+ providers: readonly ModelProvider[];
6
+ statusByProviderId: Readonly<Record<string, CredentialStatus>>;
7
+ value: string;
8
+ onChange: (modelId: string) => void;
9
+ /** When true, auto-selects the first available model whenever `value` doesn't match any model. Defaults to false. */
10
+ autoSelectFirst?: boolean;
11
+ minSearchableOptions?: number;
12
+ }
13
+ export interface ModelPickerController {
14
+ open: boolean;
15
+ query: string;
16
+ groups: ModelPickerGroup[];
17
+ filteredGroups: ModelPickerGroup[];
18
+ selection: ModelPickerSelection | null;
19
+ shouldShowSearch: boolean;
20
+ containerRef: RefObject<HTMLDivElement | null>;
21
+ setQuery: (query: string) => void;
22
+ toggle: () => void;
23
+ close: () => void;
24
+ select: (modelId: string) => void;
25
+ }
26
+ export declare function useModelPicker({ models, providers, statusByProviderId, value, onChange, autoSelectFirst, minSearchableOptions, }: UseModelPickerOptions): ModelPickerController;
27
+ //# sourceMappingURL=useModelPicker.hooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useModelPicker.hooks.d.ts","sourceRoot":"","sources":["../../../../../src/react/features/model-picker/hooks/useModelPicker.hooks.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAExH,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;IAC/B,SAAS,EAAE,SAAS,aAAa,EAAE,CAAC;IACpC,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,qHAAqH;IACrH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,cAAc,EAAE,gBAAgB,EAAE,CAAC;IACnC,SAAS,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACvC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,YAAY,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC/C,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,SAAS,EACT,kBAAkB,EAClB,KAAK,EACL,QAAQ,EACR,eAAuB,EACvB,oBAAqD,GACtD,EAAE,qBAAqB,GAAG,qBAAqB,CAuD/C"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * @module useModelPicker
3
+ *
4
+ * Headless controller for the model-picker feature: open/query state,
5
+ * derived provider groups + current selection, and the outside-click/
6
+ * Escape dismissal that `InlineModelSwitcher.tsx`'s popover and
7
+ * `modelOptions.tsx`'s `SearchableModelSelect` both hand-roll. All grouping/
8
+ * filtering/selection logic is delegated to the pure `rules.ts` — this hook
9
+ * only owns React state and the DOM-subscription effect.
10
+ */
11
+ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
12
+ import { DEFAULT_MIN_SEARCHABLE_OPTIONS } from '../constants.js';
13
+ import { filterModelGroups, findSelectedModel, firstAvailableModelId, groupModelsByProvider } from '../rules.js';
14
+ export function useModelPicker({ models, providers, statusByProviderId, value, onChange, autoSelectFirst = false, minSearchableOptions = DEFAULT_MIN_SEARCHABLE_OPTIONS, }) {
15
+ const [open, setOpen] = useState(false);
16
+ const [query, setQuery] = useState('');
17
+ const containerRef = useRef(null);
18
+ const groups = useMemo(() => groupModelsByProvider(models, providers, statusByProviderId), [models, providers, statusByProviderId]);
19
+ const filteredGroups = useMemo(() => filterModelGroups(groups, query), [groups, query]);
20
+ const selection = useMemo(() => findSelectedModel(groups, value), [groups, value]);
21
+ const totalOptionCount = useMemo(() => groups.reduce((count, group) => count + group.models.length, 0), [groups]);
22
+ const shouldShowSearch = totalOptionCount >= minSearchableOptions;
23
+ useEffect(() => {
24
+ if (!autoSelectFirst || selection)
25
+ return;
26
+ const fallbackId = firstAvailableModelId(groups);
27
+ if (fallbackId)
28
+ onChange(fallbackId);
29
+ }, [autoSelectFirst, groups, onChange, selection]);
30
+ const close = useCallback(() => {
31
+ setOpen(false);
32
+ setQuery('');
33
+ }, []);
34
+ const toggle = useCallback(() => {
35
+ setOpen((prev) => !prev);
36
+ }, []);
37
+ const select = useCallback((modelId) => {
38
+ onChange(modelId);
39
+ close();
40
+ }, [close, onChange]);
41
+ useEffect(() => {
42
+ if (!open)
43
+ return;
44
+ const onPointerDown = (event) => {
45
+ if (containerRef.current?.contains(event.target))
46
+ return;
47
+ close();
48
+ };
49
+ const onKeyDown = (event) => {
50
+ if (event.key === 'Escape')
51
+ close();
52
+ };
53
+ document.addEventListener('mousedown', onPointerDown);
54
+ document.addEventListener('keydown', onKeyDown);
55
+ return () => {
56
+ document.removeEventListener('mousedown', onPointerDown);
57
+ document.removeEventListener('keydown', onKeyDown);
58
+ };
59
+ }, [open, close]);
60
+ return { open, query, groups, filteredGroups, selection, shouldShowSearch, containerRef, setQuery, toggle, close, select };
61
+ }
62
+ //# sourceMappingURL=useModelPicker.hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useModelPicker.hooks.js","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G,CAAC,KAAoB,EAAE,EAAE;YACzC,IAAI,KAAK,CAAC,GAAG,KAAK,QAAQ;gBAAE,KAAK,EAAE,CAAC;QACtC,CAAC,CAAC;QACF,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;QACtD,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAChD,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,mBAAmB,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;YACzD,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QACrD,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IAElB,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,gBAAgB,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAC7H,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @module features/model-picker
3
+ *
4
+ * Public barrel — the only entry point other code (inside or outside this
5
+ * package) should import from; internal files are reached only through
6
+ * this file. See `source-map.md` for provenance and `types.ts`'s header for
7
+ * the `@jini-ai/protocol`-only dependency boundary.
8
+ *
9
+ * Where this belongs (2026-08-03 `@jini-ai/chat` consolidation): `ADS-memory/reports/jini-port/recon/
10
+ * r4b-webui-design.md` §1 line 41 explicitly lists "model/agent picker" among the widgets that
11
+ * belong behind a host-injected slot, not inside chat-react proper — picking which LLM/agent to
12
+ * run is a provider concern, not a chat-domain one. This module doesn't import anything from
13
+ * chat's own domain (only this package's local `Icon`/`hooks/context` utilities), so the design
14
+ * doc's instinct holds up on inspection. It moves here unchanged anyway: it has exactly one real
15
+ * consumer today (this package's own barrel, plus two tests), and this workspace's precedent
16
+ * (see `packages/desktop-host/source-map.md`) is to defer generalizing/slotting until a second
17
+ * consumer actually exists, rather than build a slot interface nobody has asked for yet. If a
18
+ * second consumer shows up, extracting this into a real host-injected slot is the intended end
19
+ * state — not a rewrite, a move.
20
+ */
21
+ export * from './types.js';
22
+ export * from './constants.js';
23
+ export * from './rules.js';
24
+ export * from './ports.js';
25
+ export { defaultModelPickerPort } from './dependencies.js';
26
+ export { useModelPicker } from './hooks/useModelPicker.hooks.js';
27
+ export type { UseModelPickerOptions, ModelPickerController } from './hooks/useModelPicker.hooks.js';
28
+ export { ModelPicker } from './components/ModelPicker.js';
29
+ export type { ModelPickerProps } from './components/ModelPicker.js';
30
+ export { CredentialStatusBadge } from './components/CredentialStatusBadge.js';
31
+ export type { CredentialStatusBadgeProps } from './components/CredentialStatusBadge.js';
32
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react/features/model-picker/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,YAAY,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACpG,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,YAAY,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @module features/model-picker
3
+ *
4
+ * Public barrel — the only entry point other code (inside or outside this
5
+ * package) should import from; internal files are reached only through
6
+ * this file. See `source-map.md` for provenance and `types.ts`'s header for
7
+ * the `@jini-ai/protocol`-only dependency boundary.
8
+ *
9
+ * Where this belongs (2026-08-03 `@jini-ai/chat` consolidation): `ADS-memory/reports/jini-port/recon/
10
+ * r4b-webui-design.md` §1 line 41 explicitly lists "model/agent picker" among the widgets that
11
+ * belong behind a host-injected slot, not inside chat-react proper — picking which LLM/agent to
12
+ * run is a provider concern, not a chat-domain one. This module doesn't import anything from
13
+ * chat's own domain (only this package's local `Icon`/`hooks/context` utilities), so the design
14
+ * doc's instinct holds up on inspection. It moves here unchanged anyway: it has exactly one real
15
+ * consumer today (this package's own barrel, plus two tests), and this workspace's precedent
16
+ * (see `packages/desktop-host/source-map.md`) is to defer generalizing/slotting until a second
17
+ * consumer actually exists, rather than build a slot interface nobody has asked for yet. If a
18
+ * second consumer shows up, extracting this into a real host-injected slot is the intended end
19
+ * state — not a rewrite, a move.
20
+ */
21
+ export * from './types.js';
22
+ export * from './constants.js';
23
+ export * from './rules.js';
24
+ export * from './ports.js';
25
+ export { defaultModelPickerPort } from './dependencies.js';
26
+ export { useModelPicker } from './hooks/useModelPicker.hooks.js';
27
+ export { ModelPicker } from './components/ModelPicker.js';
28
+ export { CredentialStatusBadge } from './components/CredentialStatusBadge.js';
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/react/features/model-picker/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { FetchProviderModelsInput, FetchProviderModelsResult } from './types.js';
2
+ /**
3
+ * The DI seam for anything transport-shaped this feature needs. Optional —
4
+ * a host that only ever supplies a static model list needs no port at all;
5
+ * `fetchProviderModels` exists for hosts that want to warm a live catalogue
6
+ * (mirrors OD's `fetchProviderModels`/`providerModelsCache` pair).
7
+ */
8
+ export interface ModelPickerPort {
9
+ fetchProviderModels?(input: FetchProviderModelsInput): Promise<FetchProviderModelsResult>;
10
+ }
11
+ //# sourceMappingURL=ports.d.ts.map