@tylertech/forge-ai 0.15.3-dev.1 → 0.16.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 (446) hide show
  1. package/MIGRATION.md +192 -0
  2. package/README.md +76 -2
  3. package/custom-elements.json +5442 -15097
  4. package/dist/_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/decorate.mjs +9 -0
  5. package/dist/ai-agent-info/ai-agent-info.mjs +4 -78
  6. package/dist/ai-agent-info/ai-agent-info2.mjs +55 -0
  7. package/dist/ai-agent-info/index.d.ts +1 -1
  8. package/dist/ai-agent-info/index.mjs +1 -5
  9. package/dist/ai-agent-selector/ai-agent-selector.d.ts +2 -2
  10. package/dist/ai-agent-selector/ai-agent-selector.mjs +4 -439
  11. package/dist/ai-agent-selector/ai-agent-selector2.mjs +344 -0
  12. package/dist/ai-agent-selector/index.mjs +1 -5
  13. package/dist/ai-artifact/ai-artifact.mjs +4 -39
  14. package/dist/ai-artifact/ai-artifact2.mjs +31 -0
  15. package/dist/ai-artifact/index.d.ts +1 -1
  16. package/dist/ai-artifact/index.mjs +1 -5
  17. package/dist/ai-artifact-card/ai-artifact-card.mjs +4 -142
  18. package/dist/ai-artifact-card/ai-artifact-card2.mjs +103 -0
  19. package/dist/ai-artifact-card/index.d.ts +1 -1
  20. package/dist/ai-artifact-card/index.mjs +1 -5
  21. package/dist/ai-artifact-card-group/ai-artifact-card-group.mjs +4 -137
  22. package/dist/ai-artifact-card-group/ai-artifact-card-group2.mjs +100 -0
  23. package/dist/ai-artifact-card-group/index.d.ts +1 -1
  24. package/dist/ai-artifact-card-group/index.mjs +1 -5
  25. package/dist/ai-assistant-response/ai-assistant-response.d.ts +1 -2
  26. package/dist/ai-assistant-response/ai-assistant-response.mjs +4 -236
  27. package/dist/ai-assistant-response/ai-assistant-response2.mjs +137 -0
  28. package/dist/ai-assistant-response/index.d.ts +1 -1
  29. package/dist/ai-assistant-response/index.mjs +1 -5
  30. package/dist/ai-canvas/ai-canvas.d.ts +3 -3
  31. package/dist/ai-canvas/ai-canvas.mjs +4 -95
  32. package/dist/ai-canvas/ai-canvas2.mjs +74 -0
  33. package/dist/ai-canvas/index.d.ts +1 -1
  34. package/dist/ai-canvas/index.mjs +1 -5
  35. package/dist/ai-chain-of-thought/ai-chain-of-thought.mjs +4 -45
  36. package/dist/ai-chain-of-thought/ai-chain-of-thought2.mjs +35 -0
  37. package/dist/ai-chain-of-thought/index.d.ts +5 -5
  38. package/dist/ai-chain-of-thought/index.mjs +6 -17
  39. package/dist/ai-chain-of-thought/thought-base/index.mjs +1 -5
  40. package/dist/ai-chain-of-thought/thought-base/thought-base.mjs +4 -43
  41. package/dist/ai-chain-of-thought/thought-base/thought-base2.mjs +31 -0
  42. package/dist/ai-chain-of-thought/thought-detail/index.mjs +1 -5
  43. package/dist/ai-chain-of-thought/thought-detail/thought-detail.mjs +4 -34
  44. package/dist/ai-chain-of-thought/thought-detail/thought-detail2.mjs +26 -0
  45. package/dist/ai-chain-of-thought/thought-image/index.mjs +1 -5
  46. package/dist/ai-chain-of-thought/thought-image/thought-image.mjs +4 -43
  47. package/dist/ai-chain-of-thought/thought-image/thought-image2.mjs +30 -0
  48. package/dist/ai-chain-of-thought/thought-search-result/index.mjs +1 -5
  49. package/dist/ai-chain-of-thought/thought-search-result/thought-search-result.mjs +4 -62
  50. package/dist/ai-chain-of-thought/thought-search-result/thought-search-result2.mjs +45 -0
  51. package/dist/ai-chat-header/ai-chat-header.d.ts +7 -5
  52. package/dist/ai-chat-header/ai-chat-header.mjs +4 -439
  53. package/dist/ai-chat-header/ai-chat-header2.mjs +319 -0
  54. package/dist/ai-chat-header/index.d.ts +2 -2
  55. package/dist/ai-chat-header/index.mjs +1 -5
  56. package/dist/ai-chat-interface/ai-chat-interface.d.ts +1 -0
  57. package/dist/ai-chat-interface/ai-chat-interface.mjs +4 -103
  58. package/dist/ai-chat-interface/ai-chat-interface2.mjs +73 -0
  59. package/dist/ai-chat-interface/index.mjs +1 -5
  60. package/dist/ai-client-message/ai-client-message.d.ts +5 -6
  61. package/dist/ai-client-message/ai-client-message.mjs +4 -112
  62. package/dist/ai-client-message/ai-client-message2.mjs +76 -0
  63. package/dist/ai-client-message/index.mjs +1 -5
  64. package/dist/ai-context-chip/ai-context-chip.d.ts +1 -1
  65. package/dist/ai-context-chip/ai-context-chip.mjs +4 -169
  66. package/dist/ai-context-chip/ai-context-chip2.mjs +113 -0
  67. package/dist/ai-context-chip/index.mjs +1 -5
  68. package/dist/ai-context-items/ai-context-items.d.ts +11 -5
  69. package/dist/ai-context-items/ai-context-items.mjs +4 -78
  70. package/dist/ai-context-items/ai-context-items2.mjs +53 -0
  71. package/dist/ai-context-items/index.d.ts +1 -1
  72. package/dist/ai-context-items/index.mjs +1 -5
  73. package/dist/ai-conversations-panel/ai-conversations-panel.d.ts +2 -2
  74. package/dist/ai-conversations-panel/ai-conversations-panel.mjs +4 -632
  75. package/dist/ai-conversations-panel/ai-conversations-panel2.mjs +531 -0
  76. package/dist/ai-conversations-panel/index.mjs +1 -5
  77. package/dist/ai-copy-button/ai-copy-button.mjs +4 -116
  78. package/dist/ai-copy-button/ai-copy-button2.mjs +88 -0
  79. package/dist/ai-copy-button/index.mjs +1 -5
  80. package/dist/ai-dialog/ai-dialog.mjs +4 -304
  81. package/dist/ai-dialog/ai-dialog2.mjs +237 -0
  82. package/dist/ai-dialog/index.d.ts +1 -1
  83. package/dist/ai-dialog/index.mjs +1 -5
  84. package/dist/ai-disclaimer/ai-disclaimer.mjs +4 -70
  85. package/dist/ai-disclaimer/ai-disclaimer2.mjs +46 -0
  86. package/dist/ai-disclaimer/index.d.ts +1 -1
  87. package/dist/ai-disclaimer/index.mjs +1 -5
  88. package/dist/ai-dropdown-menu/ai-dropdown-menu-item-group.mjs +4 -80
  89. package/dist/ai-dropdown-menu/ai-dropdown-menu-item-group2.mjs +51 -0
  90. package/dist/ai-dropdown-menu/ai-dropdown-menu-item.d.ts +5 -1
  91. package/dist/ai-dropdown-menu/ai-dropdown-menu-item.mjs +4 -330
  92. package/dist/ai-dropdown-menu/ai-dropdown-menu-item2.mjs +280 -0
  93. package/dist/ai-dropdown-menu/ai-dropdown-menu-separator.mjs +4 -26
  94. package/dist/ai-dropdown-menu/ai-dropdown-menu-separator2.mjs +19 -0
  95. package/dist/ai-dropdown-menu/ai-dropdown-menu.d.ts +5 -0
  96. package/dist/ai-dropdown-menu/ai-dropdown-menu.mjs +4 -351
  97. package/dist/ai-dropdown-menu/ai-dropdown-menu2.mjs +268 -0
  98. package/dist/ai-dropdown-menu/index.d.ts +1 -0
  99. package/dist/ai-dropdown-menu/index.mjs +5 -10
  100. package/dist/ai-dropdown-menu/navigation-controller.d.ts +9 -1
  101. package/dist/ai-dropdown-menu/navigation-controller.mjs +214 -204
  102. package/dist/ai-dropdown-menu/selection-manager.mjs +202 -182
  103. package/dist/ai-edit-thread/ai-edit-thread.d.ts +1 -1
  104. package/dist/ai-edit-thread/ai-edit-thread.mjs +4 -137
  105. package/dist/ai-edit-thread/ai-edit-thread2.mjs +96 -0
  106. package/dist/ai-edit-thread/index.d.ts +1 -1
  107. package/dist/ai-edit-thread/index.mjs +1 -5
  108. package/dist/ai-empty-state/ai-empty-state.mjs +4 -38
  109. package/dist/ai-empty-state/ai-empty-state2.mjs +28 -0
  110. package/dist/ai-empty-state/index.d.ts +1 -1
  111. package/dist/ai-empty-state/index.mjs +1 -5
  112. package/dist/ai-error-message/ai-error-message.mjs +4 -80
  113. package/dist/ai-error-message/ai-error-message2.mjs +62 -0
  114. package/dist/ai-error-message/index.mjs +1 -5
  115. package/dist/ai-fab/ai-fab.mjs +4 -81
  116. package/dist/ai-fab/ai-fab2.mjs +54 -0
  117. package/dist/ai-fab/index.d.ts +1 -1
  118. package/dist/ai-fab/index.mjs +1 -5
  119. package/dist/ai-file-picker/ai-file-picker.d.ts +1 -0
  120. package/dist/ai-file-picker/ai-file-picker.mjs +4 -224
  121. package/dist/ai-file-picker/ai-file-picker2.mjs +172 -0
  122. package/dist/ai-file-picker/index.mjs +1 -4
  123. package/dist/ai-gradient-container/ai-gradient-container.mjs +4 -61
  124. package/dist/ai-gradient-container/ai-gradient-container2.mjs +38 -0
  125. package/dist/ai-gradient-container/index.d.ts +1 -1
  126. package/dist/ai-gradient-container/index.mjs +1 -5
  127. package/dist/ai-icon/ai-icon.d.ts +3 -0
  128. package/dist/ai-icon/ai-icon.mjs +4 -71
  129. package/dist/ai-icon/ai-icon2.mjs +41 -0
  130. package/dist/ai-icon/index.d.ts +1 -1
  131. package/dist/ai-icon/index.mjs +1 -5
  132. package/dist/ai-message-thread/ai-message-thread.d.ts +4 -3
  133. package/dist/ai-message-thread/ai-message-thread.mjs +4 -360
  134. package/dist/ai-message-thread/ai-message-thread2.mjs +279 -0
  135. package/dist/ai-message-thread/index.mjs +1 -5
  136. package/dist/ai-modal/ai-modal.mjs +4 -178
  137. package/dist/ai-modal/ai-modal2.mjs +141 -0
  138. package/dist/ai-modal/index.mjs +1 -4
  139. package/dist/ai-prompt/ai-prompt.d.ts +10 -6
  140. package/dist/ai-prompt/ai-prompt.mjs +4 -534
  141. package/dist/ai-prompt/ai-prompt2.mjs +438 -0
  142. package/dist/ai-prompt/index.mjs +1 -5
  143. package/dist/ai-reasoning/ai-reasoning.mjs +4 -44
  144. package/dist/ai-reasoning/ai-reasoning2.mjs +35 -0
  145. package/dist/ai-reasoning/index.d.ts +2 -2
  146. package/dist/ai-reasoning/index.mjs +4 -8
  147. package/dist/ai-reasoning/reasoning-content/index.d.ts +1 -1
  148. package/dist/ai-reasoning/reasoning-content/index.mjs +1 -5
  149. package/dist/ai-reasoning/reasoning-content/reasoning-content.mjs +4 -90
  150. package/dist/ai-reasoning/reasoning-content/reasoning-content2.mjs +68 -0
  151. package/dist/ai-reasoning-header/ai-reasoning-header.d.ts +7 -1
  152. package/dist/ai-reasoning-header/ai-reasoning-header.mjs +4 -68
  153. package/dist/ai-reasoning-header/ai-reasoning-header2.mjs +51 -0
  154. package/dist/ai-reasoning-header/index.d.ts +1 -1
  155. package/dist/ai-reasoning-header/index.mjs +1 -5
  156. package/dist/ai-response-message/ai-response-message.mjs +4 -25
  157. package/dist/ai-response-message/ai-response-message2.mjs +17 -0
  158. package/dist/ai-response-message/index.mjs +1 -5
  159. package/dist/ai-response-message-toolbar/ai-response-message-toolbar.d.ts +1 -1
  160. package/dist/ai-response-message-toolbar/ai-response-message-toolbar.mjs +4 -230
  161. package/dist/ai-response-message-toolbar/ai-response-message-toolbar2.mjs +171 -0
  162. package/dist/ai-response-message-toolbar/index.mjs +1 -5
  163. package/dist/ai-sidebar/ai-sidebar.d.ts +4 -4
  164. package/dist/ai-sidebar/ai-sidebar.mjs +4 -256
  165. package/dist/ai-sidebar/ai-sidebar2.mjs +211 -0
  166. package/dist/ai-sidebar/index.d.ts +2 -2
  167. package/dist/ai-sidebar/index.mjs +1 -5
  168. package/dist/ai-slash-command-menu/ai-slash-command-menu.d.ts +2 -1
  169. package/dist/ai-slash-command-menu/ai-slash-command-menu.mjs +4 -200
  170. package/dist/ai-slash-command-menu/ai-slash-command-menu2.mjs +160 -0
  171. package/dist/ai-slash-command-menu/index.mjs +1 -5
  172. package/dist/ai-spinner/ai-spinner.mjs +4 -41
  173. package/dist/ai-spinner/ai-spinner2.mjs +29 -0
  174. package/dist/ai-spinner/index.d.ts +1 -1
  175. package/dist/ai-spinner/index.mjs +1 -5
  176. package/dist/ai-steps/ai-steps.mjs +4 -163
  177. package/dist/ai-steps/ai-steps2.mjs +133 -0
  178. package/dist/ai-steps/index.d.ts +1 -1
  179. package/dist/ai-steps/index.mjs +1 -5
  180. package/dist/ai-suggestions/ai-suggestions.d.ts +2 -5
  181. package/dist/ai-suggestions/ai-suggestions.mjs +4 -164
  182. package/dist/ai-suggestions/ai-suggestions2.mjs +125 -0
  183. package/dist/ai-suggestions/index.d.ts +2 -1
  184. package/dist/ai-suggestions/index.mjs +1 -5
  185. package/dist/ai-thinking-indicator/ai-thinking-indicator.d.ts +2 -1
  186. package/dist/ai-thinking-indicator/ai-thinking-indicator.mjs +4 -160
  187. package/dist/ai-thinking-indicator/ai-thinking-indicator2.mjs +143 -0
  188. package/dist/ai-thinking-indicator/index.d.ts +1 -1
  189. package/dist/ai-thinking-indicator/index.mjs +1 -5
  190. package/dist/ai-thread-actions-menu/ai-thread-actions-menu.d.ts +2 -2
  191. package/dist/ai-thread-actions-menu/ai-thread-actions-menu.mjs +4 -152
  192. package/dist/ai-thread-actions-menu/ai-thread-actions-menu2.mjs +109 -0
  193. package/dist/ai-thread-actions-menu/index.d.ts +1 -1
  194. package/dist/ai-thread-actions-menu/index.mjs +1 -5
  195. package/dist/ai-threads-search/ai-threads-search.d.ts +3 -4
  196. package/dist/ai-threads-search/ai-threads-search.mjs +4 -602
  197. package/dist/ai-threads-search/ai-threads-search2.mjs +495 -0
  198. package/dist/ai-threads-search/index.d.ts +1 -1
  199. package/dist/ai-threads-search/index.mjs +1 -5
  200. package/dist/ai-tool-call/ai-tool-call.d.ts +21 -0
  201. package/dist/ai-tool-call/ai-tool-call.mjs +4 -0
  202. package/dist/ai-tool-call/ai-tool-call2.mjs +132 -0
  203. package/dist/{ai-chatbot → ai-tool-call}/create-tool-renderer.d.ts +1 -1
  204. package/dist/ai-tool-call/create-tool-renderer.mjs +10 -0
  205. package/dist/ai-tool-call/index.d.ts +6 -0
  206. package/dist/ai-tool-call/index.mjs +5 -0
  207. package/dist/{ai-chatbot → ai-tool-call}/tool-canvas.d.ts +1 -1
  208. package/dist/ai-tool-call/tool-canvas.mjs +135 -0
  209. package/dist/ai-tool-call/utils.d.ts +12 -0
  210. package/dist/ai-tool-call/utils.mjs +20 -0
  211. package/dist/ai-tool-call-indicator/ai-tool-call-indicator.d.ts +1 -1
  212. package/dist/ai-tool-call-indicator/ai-tool-call-indicator.mjs +4 -331
  213. package/dist/ai-tool-call-indicator/ai-tool-call-indicator2.mjs +225 -0
  214. package/dist/ai-tool-call-indicator/index.mjs +1 -5
  215. package/dist/ai-user-message/ai-user-message.mjs +4 -151
  216. package/dist/ai-user-message/ai-user-message2.mjs +105 -0
  217. package/dist/ai-user-message/index.mjs +1 -5
  218. package/dist/ai-user-message-toolbar/ai-user-message-toolbar.mjs +4 -160
  219. package/dist/ai-user-message-toolbar/ai-user-message-toolbar2.mjs +102 -0
  220. package/dist/ai-user-message-toolbar/index.mjs +1 -5
  221. package/dist/ai-voice-input/ai-voice-input.d.ts +1 -1
  222. package/dist/ai-voice-input/ai-voice-input.mjs +4 -113
  223. package/dist/ai-voice-input/ai-voice-input2.mjs +92 -0
  224. package/dist/ai-voice-input/index.d.ts +1 -1
  225. package/dist/ai-voice-input/index.mjs +1 -5
  226. package/dist/core/drag-controller.mjs +196 -221
  227. package/dist/core/index.d.ts +3 -2
  228. package/dist/core/index.mjs +7 -8
  229. package/dist/core/overlay/index.mjs +1 -4
  230. package/dist/core/overlay/overlay.d.ts +1 -1
  231. package/dist/core/overlay/overlay.mjs +4 -180
  232. package/dist/core/overlay/overlay2.mjs +146 -0
  233. package/dist/core/popover/index.mjs +1 -4
  234. package/dist/core/popover/popover.mjs +4 -98
  235. package/dist/core/popover/popover2.mjs +71 -0
  236. package/dist/core/resize-controller.mjs +132 -154
  237. package/dist/core/tooltip/index.mjs +1 -4
  238. package/dist/core/tooltip/tooltip.mjs +4 -279
  239. package/dist/core/tooltip/tooltip2.mjs +213 -0
  240. package/dist/index.d.ts +45 -53
  241. package/dist/index.mjs +100 -214
  242. package/dist/jsx.d.ts +895 -0
  243. package/dist/tools/ai-data-table/ai-data-table.d.ts +1 -2
  244. package/dist/tools/ai-data-table/ai-data-table.mjs +4 -257
  245. package/dist/tools/ai-data-table/ai-data-table2.mjs +185 -0
  246. package/dist/tools/ai-data-table/index.d.ts +0 -1
  247. package/dist/tools/ai-data-table/index.mjs +1 -6
  248. package/dist/tools/ai-paginator/ai-paginator.d.ts +14 -0
  249. package/dist/tools/ai-paginator/ai-paginator.mjs +4 -115
  250. package/dist/tools/ai-paginator/ai-paginator2.mjs +90 -0
  251. package/dist/tools/ai-paginator/index.mjs +1 -4
  252. package/dist/tools/ai-steps/ai-steps.d.ts +2 -3
  253. package/dist/tools/ai-steps/ai-steps.mjs +4 -49
  254. package/dist/tools/ai-steps/ai-steps2.mjs +30 -0
  255. package/dist/tools/ai-steps/index.d.ts +0 -1
  256. package/dist/tools/ai-steps/index.mjs +1 -6
  257. package/dist/tools/index.d.ts +3 -3
  258. package/dist/tools/index.mjs +7 -12
  259. package/dist/types/chat.d.ts +102 -0
  260. package/dist/types/feature.d.ts +1 -0
  261. package/dist/types/file.d.ts +36 -0
  262. package/dist/types/index.d.ts +6 -0
  263. package/dist/types/index.mjs +0 -0
  264. package/dist/types/thread.d.ts +14 -0
  265. package/dist/types/tool.d.ts +197 -0
  266. package/dist/utils/csv-utils.mjs +37 -57
  267. package/dist/utils/delete-thread-controller.d.ts +1 -1
  268. package/dist/utils/delete-thread-controller.mjs +48 -71
  269. package/dist/utils/dom.d.ts +14 -0
  270. package/dist/utils/dom.mjs +30 -0
  271. package/dist/utils/format.d.ts +9 -0
  272. package/dist/utils/format.mjs +27 -0
  273. package/dist/utils/index.d.ts +9 -6
  274. package/dist/utils/index.mjs +6 -16
  275. package/dist/utils/infinite-scroll-controller.mjs +88 -94
  276. package/dist/utils/keyboard-navigation-controller.mjs +62 -70
  277. package/dist/utils/markdown-stream-controller.mjs +48 -0
  278. package/dist/utils/markdown.d.ts +10 -1
  279. package/dist/utils/markdown.mjs +261 -40
  280. package/dist/utils/storage-utils.mjs +30 -24
  281. package/package.json +40 -104
  282. package/dist/ai-agent-info/ai-agent-info.scss.mjs +0 -4
  283. package/dist/ai-agent-selector/ai-agent-selector.scss.mjs +0 -4
  284. package/dist/ai-artifact/ai-artifact.scss.mjs +0 -4
  285. package/dist/ai-artifact-card/ai-artifact-card.scss.mjs +0 -283
  286. package/dist/ai-artifact-card-group/ai-artifact-card-group.scss.mjs +0 -173
  287. package/dist/ai-assistant-response/ai-assistant-response.scss.mjs +0 -4
  288. package/dist/ai-attachment/ai-attachment.d.ts +0 -39
  289. package/dist/ai-attachment/ai-attachment.mjs +0 -130
  290. package/dist/ai-attachment/ai-attachment.scss.mjs +0 -4
  291. package/dist/ai-attachment/index.d.ts +0 -1
  292. package/dist/ai-attachment/index.mjs +0 -5
  293. package/dist/ai-button/ai-button.d.ts +0 -21
  294. package/dist/ai-button/ai-button.mjs +0 -68
  295. package/dist/ai-button/ai-button.scss.mjs +0 -4
  296. package/dist/ai-button/index.d.ts +0 -1
  297. package/dist/ai-button/index.mjs +0 -5
  298. package/dist/ai-canvas/ai-canvas.scss.mjs +0 -4
  299. package/dist/ai-chain-of-thought/ai-chain-of-thought.scss.mjs +0 -4
  300. package/dist/ai-chain-of-thought/thought-base/thought-base.scss.mjs +0 -4
  301. package/dist/ai-chain-of-thought/thought-detail/thought-detail.scss.mjs +0 -4
  302. package/dist/ai-chain-of-thought/thought-image/thought-image.scss.mjs +0 -4
  303. package/dist/ai-chain-of-thought/thought-search-result/thought-search-result.scss.mjs +0 -4
  304. package/dist/ai-chat-header/ai-chat-header.scss.mjs +0 -4
  305. package/dist/ai-chat-interface/ai-chat-interface.scss.mjs +0 -4
  306. package/dist/ai-chatbot/ag-ui-adapter.d.ts +0 -24
  307. package/dist/ai-chatbot/ag-ui-adapter.mjs +0 -388
  308. package/dist/ai-chatbot/agent-adapter.d.ts +0 -310
  309. package/dist/ai-chatbot/agent-adapter.mjs +0 -221
  310. package/dist/ai-chatbot/agent-runner.d.ts +0 -41
  311. package/dist/ai-chatbot/agent-runner.mjs +0 -265
  312. package/dist/ai-chatbot/ai-chatbot-base.d.ts +0 -179
  313. package/dist/ai-chatbot/ai-chatbot-base.mjs +0 -684
  314. package/dist/ai-chatbot/ai-chatbot-tool-call.d.ts +0 -19
  315. package/dist/ai-chatbot/ai-chatbot-tool-call.mjs +0 -182
  316. package/dist/ai-chatbot/ai-chatbot-tool-call.scss.mjs +0 -4
  317. package/dist/ai-chatbot/ai-chatbot.d.ts +0 -196
  318. package/dist/ai-chatbot/ai-chatbot.mjs +0 -502
  319. package/dist/ai-chatbot/ai-chatbot.scss.mjs +0 -4
  320. package/dist/ai-chatbot/create-tool-renderer.mjs +0 -16
  321. package/dist/ai-chatbot/event-emitter.d.ts +0 -43
  322. package/dist/ai-chatbot/event-emitter.mjs +0 -81
  323. package/dist/ai-chatbot/file-upload-manager.d.ts +0 -27
  324. package/dist/ai-chatbot/file-upload-manager.mjs +0 -106
  325. package/dist/ai-chatbot/http-agent-with-credentials.d.ts +0 -8
  326. package/dist/ai-chatbot/http-agent-with-credentials.mjs +0 -14
  327. package/dist/ai-chatbot/index.d.ts +0 -18
  328. package/dist/ai-chatbot/index.mjs +0 -40
  329. package/dist/ai-chatbot/markdown-stream-controller.mjs +0 -50
  330. package/dist/ai-chatbot/message-state-controller.d.ts +0 -72
  331. package/dist/ai-chatbot/message-state-controller.mjs +0 -392
  332. package/dist/ai-chatbot/request-serialization.d.ts +0 -33
  333. package/dist/ai-chatbot/request-serialization.mjs +0 -31
  334. package/dist/ai-chatbot/tool-canvas.mjs +0 -128
  335. package/dist/ai-chatbot/types.d.ts +0 -582
  336. package/dist/ai-chatbot/utils.d.ts +0 -49
  337. package/dist/ai-chatbot/utils.mjs +0 -114
  338. package/dist/ai-chatbot-launcher/ai-chatbot-launcher.d.ts +0 -190
  339. package/dist/ai-chatbot-launcher/ai-chatbot-launcher.mjs +0 -986
  340. package/dist/ai-chatbot-launcher/ai-chatbot-launcher.scss.mjs +0 -4
  341. package/dist/ai-chatbot-launcher/index.d.ts +0 -1
  342. package/dist/ai-chatbot-launcher/index.mjs +0 -5
  343. package/dist/ai-client-message/ai-client-message.scss.mjs +0 -4
  344. package/dist/ai-confirmation-prompt/ai-confirmation-prompt.d.ts +0 -34
  345. package/dist/ai-confirmation-prompt/ai-confirmation-prompt.mjs +0 -134
  346. package/dist/ai-confirmation-prompt/ai-confirmation-prompt.scss.mjs +0 -4
  347. package/dist/ai-confirmation-prompt/index.d.ts +0 -1
  348. package/dist/ai-confirmation-prompt/index.mjs +0 -5
  349. package/dist/ai-context-chip/ai-context-chip.scss.mjs +0 -4
  350. package/dist/ai-context-items/ai-context-items.scss.mjs +0 -4
  351. package/dist/ai-conversations-panel/ai-conversations-panel.scss.mjs +0 -4
  352. package/dist/ai-copy-button/ai-copy-button.scss.mjs +0 -4
  353. package/dist/ai-dialog/ai-dialog.scss.mjs +0 -4
  354. package/dist/ai-disclaimer/ai-disclaimer.scss.mjs +0 -4
  355. package/dist/ai-dropdown-menu/ai-dropdown-menu-item-group.scss.mjs +0 -4
  356. package/dist/ai-dropdown-menu/ai-dropdown-menu-item.scss.mjs +0 -4
  357. package/dist/ai-dropdown-menu/ai-dropdown-menu-separator.scss.mjs +0 -4
  358. package/dist/ai-dropdown-menu/ai-dropdown-menu.scss.mjs +0 -4
  359. package/dist/ai-edit-thread/ai-edit-thread.scss.mjs +0 -4
  360. package/dist/ai-embedded-chat/ai-embedded-chat.d.ts +0 -64
  361. package/dist/ai-embedded-chat/ai-embedded-chat.mjs +0 -173
  362. package/dist/ai-embedded-chat/ai-embedded-chat.scss.mjs +0 -4
  363. package/dist/ai-embedded-chat/index.d.ts +0 -1
  364. package/dist/ai-embedded-chat/index.mjs +0 -5
  365. package/dist/ai-empty-state/ai-empty-state.scss.mjs +0 -4
  366. package/dist/ai-error-message/ai-error-message.scss.mjs +0 -4
  367. package/dist/ai-fab/ai-fab.scss.mjs +0 -4
  368. package/dist/ai-file-picker/ai-file-picker.scss.mjs +0 -4
  369. package/dist/ai-floating-chat/ai-floating-chat.d.ts +0 -53
  370. package/dist/ai-floating-chat/ai-floating-chat.mjs +0 -147
  371. package/dist/ai-floating-chat/ai-floating-chat.scss.mjs +0 -4
  372. package/dist/ai-floating-chat/index.d.ts +0 -1
  373. package/dist/ai-floating-chat/index.mjs +0 -5
  374. package/dist/ai-gradient-container/ai-gradient-container.scss.mjs +0 -4
  375. package/dist/ai-icon/ai-icon.scss.mjs +0 -4
  376. package/dist/ai-icon-button/ai-icon-button.d.ts +0 -19
  377. package/dist/ai-icon-button/ai-icon-button.mjs +0 -66
  378. package/dist/ai-icon-button/ai-icon-button.scss.mjs +0 -4
  379. package/dist/ai-icon-button/index.d.ts +0 -1
  380. package/dist/ai-icon-button/index.mjs +0 -5
  381. package/dist/ai-message-thread/ai-message-thread.scss.mjs +0 -4
  382. package/dist/ai-modal/ai-modal.scss.mjs +0 -4
  383. package/dist/ai-prompt/ai-prompt.scss.mjs +0 -4
  384. package/dist/ai-prompt/prompt-button/index.d.ts +0 -1
  385. package/dist/ai-prompt/prompt-button/index.mjs +0 -5
  386. package/dist/ai-prompt/prompt-button/prompt-button.d.ts +0 -16
  387. package/dist/ai-prompt/prompt-button/prompt-button.mjs +0 -40
  388. package/dist/ai-prompt/prompt-button/prompt-button.scss.mjs +0 -4
  389. package/dist/ai-reasoning/ai-reasoning.scss.mjs +0 -4
  390. package/dist/ai-reasoning/reasoning-content/reasoning-content.scss.mjs +0 -4
  391. package/dist/ai-reasoning-header/ai-reasoning-header.scss.mjs +0 -4
  392. package/dist/ai-response-message/ai-response-message.scss.mjs +0 -4
  393. package/dist/ai-response-message-toolbar/ai-response-message-toolbar.scss.mjs +0 -4
  394. package/dist/ai-sidebar/ai-sidebar.scss.mjs +0 -4
  395. package/dist/ai-sidebar-chat/ai-sidebar-chat.d.ts +0 -54
  396. package/dist/ai-sidebar-chat/ai-sidebar-chat.mjs +0 -163
  397. package/dist/ai-sidebar-chat/ai-sidebar-chat.scss.mjs +0 -4
  398. package/dist/ai-sidebar-chat/index.d.ts +0 -1
  399. package/dist/ai-sidebar-chat/index.mjs +0 -5
  400. package/dist/ai-slash-command-menu/ai-slash-command-menu.scss.mjs +0 -4
  401. package/dist/ai-spinner/ai-spinner.scss.mjs +0 -4
  402. package/dist/ai-steps/ai-steps.scss.mjs +0 -4
  403. package/dist/ai-suggestions/ai-suggestions.scss.mjs +0 -500
  404. package/dist/ai-thinking-indicator/ai-thinking-indicator.scss.mjs +0 -143
  405. package/dist/ai-thread-actions-menu/ai-thread-actions-menu.scss.mjs +0 -4
  406. package/dist/ai-threads/ai-threads.d.ts +0 -82
  407. package/dist/ai-threads/ai-threads.mjs +0 -343
  408. package/dist/ai-threads/ai-threads.scss.mjs +0 -4
  409. package/dist/ai-threads/index.d.ts +0 -1
  410. package/dist/ai-threads/index.mjs +0 -5
  411. package/dist/ai-threads-search/ai-threads-search.scss.mjs +0 -4
  412. package/dist/ai-tool-call-indicator/ai-tool-call-indicator.scss.mjs +0 -4
  413. package/dist/ai-user-message/ai-user-message.scss.mjs +0 -4
  414. package/dist/ai-user-message-toolbar/ai-user-message-toolbar.scss.mjs +0 -4
  415. package/dist/ai-voice-input/ai-voice-input.scss.mjs +0 -4
  416. package/dist/core/canvas-controller.d.ts +0 -81
  417. package/dist/core/canvas-controller.mjs +0 -221
  418. package/dist/core/chatbot-core-controller.d.ts +0 -57
  419. package/dist/core/chatbot-core-controller.mjs +0 -545
  420. package/dist/core/overlay/overlay.scss.mjs +0 -4
  421. package/dist/core/popover/popover.scss.mjs +0 -4
  422. package/dist/core/tooltip/tooltip.scss.mjs +0 -4
  423. package/dist/tools/ai-data-table/ai-data-table-definition.d.ts +0 -2
  424. package/dist/tools/ai-data-table/ai-data-table-definition.mjs +0 -43
  425. package/dist/tools/ai-data-table/ai-data-table.scss.mjs +0 -4
  426. package/dist/tools/ai-mcp-app/ai-mcp-app.d.ts +0 -70
  427. package/dist/tools/ai-mcp-app/ai-mcp-app.mjs +0 -589
  428. package/dist/tools/ai-mcp-app/ai-mcp-app.scss.mjs +0 -4
  429. package/dist/tools/ai-mcp-app/index.d.ts +0 -3
  430. package/dist/tools/ai-mcp-app/index.mjs +0 -6
  431. package/dist/tools/ai-mcp-app/mcp-app-bridge-controller.d.ts +0 -60
  432. package/dist/tools/ai-mcp-app/mcp-app-bridge-controller.mjs +0 -147
  433. package/dist/tools/ai-mcp-app/mcp-app-bridge-types.d.ts +0 -124
  434. package/dist/tools/ai-mcp-app/mcp-app-bridge.d.ts +0 -41
  435. package/dist/tools/ai-mcp-app/mcp-app-bridge.mjs +0 -293
  436. package/dist/tools/ai-mcp-app/mcp-app-context.d.ts +0 -46
  437. package/dist/tools/ai-mcp-app/mcp-app-context.mjs +0 -5
  438. package/dist/tools/ai-paginator/ai-paginator.scss.mjs +0 -4
  439. package/dist/tools/ai-steps/ai-steps-definition.d.ts +0 -2
  440. package/dist/tools/ai-steps/ai-steps-definition.mjs +0 -51
  441. package/dist/tools/ai-steps/ai-steps.scss.mjs +0 -4
  442. package/dist/utils/inert-outside.d.ts +0 -7
  443. package/dist/utils/inert-outside.mjs +0 -28
  444. package/dist/utils.d.ts +0 -32
  445. package/dist/utils.mjs +0 -57
  446. /package/dist/{ai-chatbot → utils}/markdown-stream-controller.d.ts +0 -0
@@ -1,582 +0,0 @@
1
- import { Thread } from '../ai-threads';
2
- /**
3
- * Valid HTML heading levels for accessibility and semantic structure
4
- */
5
- export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
6
- export interface Agent {
7
- id: string;
8
- name: string;
9
- description?: string;
10
- }
11
- export type SlashCommandId = 'clear' | 'export' | 'info' | 'debug';
12
- export type SlashCommandGroup = 'Conversation' | 'Help';
13
- export interface SlashCommand {
14
- id: SlashCommandId;
15
- name: string;
16
- group: SlashCommandGroup;
17
- }
18
- export interface ForgeAiSlashCommandMenuSelectEventData {
19
- command: SlashCommand;
20
- index: number;
21
- }
22
- /**
23
- * Function of a tool call whose parameter stays bivariant, so a `ToolDefinition<MyArgs>` can be stored in a
24
- * `ToolDefinition[]` alongside untyped tools without casts.
25
- */
26
- export type ToolCallMapper<TReturn, TArgs = Record<string, unknown>, TResult = unknown> = {
27
- bivarianceHack(toolCall: ToolCall<TArgs, TResult>): TReturn;
28
- }['bivarianceHack'];
29
- /** A static value, or one derived from the tool call. */
30
- export type ToolCallValue<TValue, TArgs = Record<string, unknown>, TResult = unknown> = TValue | ToolCallMapper<TValue, TArgs, TResult>;
31
- /** Host-provided context passed to a tool renderer's `render` function. */
32
- export interface ToolRenderContext {
33
- presentation: ToolPresentation;
34
- /** Controls captured when `render` runs; element renderers receive a reactive `canvas` property instead. */
35
- canvas: ToolCanvas;
36
- }
37
- /**
38
- * Bivariant like `ToolCallMapper`. `context` is optional so existing `render(toolCall)` implementations and
39
- * callers keep compiling; hosts always pass it.
40
- */
41
- export type ToolRenderFunction<TArgs = Record<string, unknown>, TResult = unknown> = {
42
- bivarianceHack(toolCall: ToolCall<TArgs, TResult>, context?: ToolRenderContext): HTMLElement | DocumentFragment;
43
- }['bivarianceHack'];
44
- export interface ToolRenderer<TArgs = any, TResult = any> {
45
- elementTag?: string;
46
- render?: ToolRenderFunction<TArgs, TResult>;
47
- }
48
- /**
49
- * Where a tool renderer instance is displayed. Set by the host on the elements it creates.
50
- * - `inline`: in the message thread with no canvas available
51
- * - `inline-expandable`: in the message thread; a canvas is available and the renderer may request it
52
- * - `canvas`: inside the canvas panel
53
- */
54
- export type ToolPresentation = 'inline' | 'inline-expandable' | 'canvas';
55
- /** Artifact card icon: an `<svg>` element, or SVG markup reduced to static shape elements and attributes. */
56
- export type ToolCanvasIcon = SVGElement | string;
57
- /** Artifact card labels for each state; shown as the tooltip and read by assistive technology. */
58
- export interface ToolCanvasActionLabel {
59
- /** Label while the artifact is not in the canvas, e.g. "Open report". */
60
- open: string;
61
- /** Label while the artifact is in the canvas, e.g. "Collapse report". */
62
- collapse: string;
63
- }
64
- /**
65
- * Opts a tool into the canvas panel of hosts that provide one (e.g. `forge-ai-chatbot-launcher`).
66
- * Hosts without a canvas ignore this and render the tool inline as usual. Every mapper receives the
67
- * `ToolCall`, so values can come from the agent's `args` or the handler's `result`.
68
- */
69
- export interface ToolCanvasConfig<TArgs = Record<string, unknown>, TResult = unknown> {
70
- /**
71
- * When the canvas opens. `auto`: as soon as the tool call renders (launcher only; other hosts treat it as
72
- * `on-request`). `on-request` (default): only when the renderer or artifact card asks for it.
73
- */
74
- open?: 'auto' | 'on-request';
75
- /**
76
- * What the thread shows for the tool call. `renderer`: the inline renderer. `card`: an artifact card that
77
- * opens the canvas. `card-while-open`: the renderer, swapped for the card while this call is in the canvas.
78
- * Defaults to `card` when `open` is `auto`, otherwise `renderer`.
79
- */
80
- inline?: ToolCanvasInline;
81
- /** Renderer used inside the canvas. Defaults to the tool's `renderer`. */
82
- renderer?: ToolRenderer<TArgs, TResult>;
83
- /** Canvas and artifact card title. Defaults to `displayName`, then `name`. */
84
- title?: ToolCallValue<string, TArgs, TResult>;
85
- /** Artifact card subtitle, e.g. a row count. */
86
- subtitle?: ToolCallValue<string, TArgs, TResult>;
87
- /** Artifact card icon. Defaults to a generic artifact glyph. */
88
- icon?: ToolCallValue<ToolCanvasIcon, TArgs, TResult>;
89
- /** Artifact card action labels. Defaults to "Open in canvas" / "Collapse canvas". */
90
- actionLabel?: ToolCallValue<ToolCanvasActionLabel, TArgs, TResult>;
91
- }
92
- export type ToolCanvasInline = 'renderer' | 'card' | 'card-while-open';
93
- /**
94
- * Canvas controls the host injects into a tool renderer as `canvas`. A new object is assigned whenever
95
- * `available` or `isOpen` changes, so declaring `canvas` as a reactive property re-renders the renderer.
96
- * Hosts without a canvas inject one with `available: false` whose methods return `false`.
97
- */
98
- export interface ToolCanvas {
99
- /** Whether the host can show this tool call in a canvas. */
100
- readonly available: boolean;
101
- /** Whether this tool call is the one currently shown in the canvas. */
102
- readonly isOpen: boolean;
103
- /** Shows this tool call in the canvas. Returns false when unavailable or the host declined. */
104
- open(options?: {
105
- title?: string;
106
- }): boolean;
107
- /** Closes the canvas if it is showing this tool call. Returns false when it was not or the host declined. */
108
- close(): boolean;
109
- /** Closes the canvas when this tool call is open, otherwise opens it. */
110
- toggle(): boolean;
111
- }
112
- /**
113
- * Interface that tool renderer components should implement for type-safe tool call handling.
114
- * @template TArgs - Type of the tool call arguments
115
- * @template TResult - Type returned by the tool's handler
116
- */
117
- export interface IToolRenderer<TArgs = Record<string, unknown>, TResult = unknown> {
118
- toolCall: ToolCall<TArgs, TResult>;
119
- /** Assigned by the host to tell the renderer where it is displayed. */
120
- presentation?: ToolPresentation;
121
- /** Assigned by the host to let the renderer open and close the canvas. */
122
- canvas?: ToolCanvas;
123
- }
124
- /**
125
- * Context provided to tool handlers when they are invoked.
126
- * @template TArgs - Type of the tool call arguments
127
- */
128
- export interface HandlerContext<TArgs = Record<string, unknown>> {
129
- /** Tool call arguments */
130
- args: TArgs;
131
- /** Unique identifier for this tool call */
132
- toolCallId: string;
133
- /** Name of the tool being called */
134
- toolName: string;
135
- /** Optional abort signal for cancellation support */
136
- signal?: AbortSignal;
137
- }
138
- /**
139
- * Context provided to onStart callback when tool call begins.
140
- */
141
- export interface ToolStartContext {
142
- toolCallId: string;
143
- toolName: string;
144
- }
145
- /**
146
- * Context provided to onDelta callback during streaming.
147
- * @template TArgs - Type of the tool call arguments
148
- */
149
- export interface ToolDeltaContext<TArgs = Record<string, unknown>> {
150
- argsBuffer: string;
151
- partialArgs: Partial<TArgs>;
152
- toolCallId: string;
153
- toolName: string;
154
- }
155
- /**
156
- * Context provided to onEnd callback when args are complete.
157
- * @template TArgs - Type of the tool call arguments
158
- */
159
- export interface ToolEndContext<TArgs = Record<string, unknown>> {
160
- args: TArgs;
161
- toolCallId: string;
162
- toolName: string;
163
- }
164
- export type ToolType = 'client' | 'agent';
165
- /**
166
- * Tool definition with optional type-safe handler.
167
- * @template TArgs - Type of the tool call arguments, typed through the handler, renderer, and canvas mappers
168
- * @template TResult - Type returned by `handler`, available as `toolCall.result`
169
- */
170
- export interface ToolDefinition<TArgs = Record<string, unknown>, TResult = string | Record<string, unknown>> {
171
- name: string;
172
- displayName?: string;
173
- description?: string;
174
- parameters?: {
175
- type: 'object';
176
- properties?: Record<string, unknown>;
177
- required?: string[];
178
- };
179
- /**
180
- * Optional renderer for displaying tool call results within the chat UI. Deliberately untyped (`any`
181
- * arguments) so renderers written before `ToolDefinition` had a `TResult`, including `render` callbacks
182
- * annotated with plain `ToolCall`, keep compiling on any `ToolDefinition<TArgs>`.
183
- */
184
- renderer?: ToolRenderer;
185
- /** If true, renderer shows immediately on tool call start (default: false). */
186
- renderOnStart?: boolean;
187
- /**
188
- * Opt-in marker declaring this tool is backed by an MCP-app UI resource. Presence
189
- * signals the core controller to resolve + stamp a {@link McpAppUiResource} when the
190
- * tool is called. `resourceUri` is informational; the resolved URI arrives on the
191
- * `mcp-ui-resource` event.
192
- */
193
- mcpApp?: {
194
- resourceUri?: string;
195
- };
196
- /** Canvas behavior for hosts that provide a canvas panel. Requires `renderer`. */
197
- canvas?: ToolCanvasConfig<TArgs, TResult>;
198
- /** Called when tool call starts (before args stream). */
199
- onStart?(context: ToolStartContext): void;
200
- /** Called during streaming with partial args. */
201
- onDelta?(context: ToolDeltaContext<TArgs>): void;
202
- /** Called when args are complete (before handler execution). */
203
- onEnd?(context: ToolEndContext<TArgs>): void;
204
- /**
205
- * Optional handler function invoked when tool is called.
206
- * Strings and objects are used directly as the tool result; `void` yields a generic success message.
207
- */
208
- handler?(context: HandlerContext<TArgs>): Promise<TResult | void> | TResult | void;
209
- }
210
- /**
211
- * Content-Security-Policy domain allow-lists for an MCP-app resource, mirroring the
212
- * spec's `_meta.ui.csp` shape (2026-01-26). The sandbox proxy composes these into the
213
- * enforced CSP; when omitted a restrictive default block applies.
214
- *
215
- * Local type — intentionally NOT aliased from `@modelcontextprotocol/ext-apps` so the
216
- * type layer stays bridge-agnostic.
217
- */
218
- export interface McpAppResourceCsp {
219
- /** Domains the widget may `connect-src` to (fetch/XHR/WebSocket). */
220
- connectDomains?: string[];
221
- /** Domains the widget may load passive resources from (img/media/etc.). */
222
- resourceDomains?: string[];
223
- /** Domains allowed in `frame-src`; absent → `frame-src 'none'`. */
224
- frameDomains?: string[];
225
- /** Domains allowed in `base-uri`; absent → `base-uri 'self'`. */
226
- baseUriDomains?: string[];
227
- }
228
- /**
229
- * Iframe permission policy for an MCP-app resource, mirroring the spec's
230
- * `_meta.ui.permissions` shape (2026-01-26): a key being present (with an empty object
231
- * value) means the permission is requested. The sandbox maps requested keys onto the
232
- * iframe `allow` attribute.
233
- *
234
- * Local type — not aliased from ext-apps.
235
- */
236
- export interface McpAppResourcePermissions {
237
- camera?: Record<string, never>;
238
- microphone?: Record<string, never>;
239
- geolocation?: Record<string, never>;
240
- clipboardWrite?: Record<string, never>;
241
- }
242
- /**
243
- * The resolved UI resource stamped onto a {@link ToolCall} once a `mcp-ui-resource`
244
- * event arrives. Presence of this on a tool call is the single render discriminator for
245
- * mounting `<forge-ai-mcp-app>`.
246
- *
247
- * Returned by `AgentAdapter.resolveMcpAppResource`, which fills `csp`/`permissions` from
248
- * the template response's `_meta.ui` (pass `{}` when the template declares none). The
249
- * widget refuses to render when either is missing.
250
- *
251
- * Local type — not aliased from ext-apps.
252
- */
253
- export interface McpAppUiResource {
254
- /** The complete standalone app HTML document, resolved server-side. */
255
- html: string;
256
- /** CSP domain allow-lists to enforce in the sandbox. Empty → restrictive default. */
257
- csp: McpAppResourceCsp;
258
- /** Iframe permission policy for the sandbox inner frame. */
259
- permissions: McpAppResourcePermissions;
260
- /** The concrete resolved `ui://` resource URI (never a template). */
261
- resourceUri?: string;
262
- /**
263
- * Whether the widget prefers the host to draw a border/background around it.
264
- * `true` → visible chrome, `false` → none, omitted → renderer default.
265
- */
266
- prefersBorder?: boolean;
267
- }
268
- /** Resolve state of an announced MCP-app UI resource that has not been stamped yet. */
269
- export type McpAppUiResourceStatus = 'loading' | 'error';
270
- /** Display modes an MCP-app widget can be presented in (spec 2026-01-26). */
271
- export type McpAppDisplayMode = 'inline' | 'fullscreen' | 'pip';
272
- /**
273
- * The raw MCP `CallToolResult` (minus `structuredContent`) for an MCP-app tool call. The
274
- * View's `ui/notifications/tool-result` is built from this plus
275
- * {@link ToolCall.structuredContent} — never from the model-facing `result`.
276
- */
277
- export interface McpToolResult {
278
- content: unknown[];
279
- isError?: boolean;
280
- _meta?: Record<string, unknown>;
281
- }
282
- /**
283
- * Size of the container holding a widget, in CSS pixels (spec `containerDimensions`): a
284
- * fixed `height` or a `maxHeight` bound, and a fixed `width` or a `maxWidth` bound.
285
- */
286
- export type McpAppContainerDimensions = ({
287
- height: number;
288
- } | {
289
- maxHeight?: number;
290
- }) & ({
291
- width: number;
292
- } | {
293
- maxWidth?: number;
294
- });
295
- /** The tool call that instantiated a widget (spec `toolInfo`). */
296
- export interface McpAppToolInfo {
297
- id?: string | number;
298
- tool: {
299
- name: string;
300
- inputSchema: {
301
- type: 'object';
302
- [key: string]: unknown;
303
- };
304
- [key: string]: unknown;
305
- };
306
- }
307
- /**
308
- * Theming sent to MCP-app widgets (spec `hostContext.styles`): spec CSS variables (e.g.
309
- * `--color-background-primary`) resolved from Forge tokens. Font loading (`css.fonts`) is not sent.
310
- */
311
- export interface McpAppHostStyles {
312
- variables?: Record<string, string>;
313
- }
314
- /**
315
- * Host context projected into an MCP-app widget.
316
- *
317
- * Local type — not aliased from ext-apps.
318
- */
319
- export interface McpAppHostContext {
320
- theme: 'light' | 'dark';
321
- /** Spec CSS variables resolved from the widget's Forge tokens. */
322
- styles?: McpAppHostStyles;
323
- /** The tool call that instantiated the widget. */
324
- toolInfo?: McpAppToolInfo;
325
- /** Size of the container holding the widget. */
326
- containerDimensions?: McpAppContainerDimensions;
327
- /** The widget's current display mode. */
328
- displayMode?: McpAppDisplayMode;
329
- /** Display modes the host is able to present. */
330
- availableDisplayModes?: McpAppDisplayMode[];
331
- /** BCP 47 language tag. */
332
- locale?: string;
333
- /** IANA time zone. */
334
- timeZone?: string;
335
- userAgent?: string;
336
- platform?: 'web' | 'desktop' | 'mobile';
337
- deviceCapabilities?: {
338
- touch?: boolean;
339
- hover?: boolean;
340
- };
341
- safeAreaInsets?: {
342
- top: number;
343
- right: number;
344
- bottom: number;
345
- left: number;
346
- };
347
- }
348
- /** Content-block types a host accepts for `ui/message` / `ui/update-model-context`. */
349
- export interface McpAppContentModalities {
350
- text?: Record<string, never>;
351
- image?: Record<string, never>;
352
- audio?: Record<string, never>;
353
- resource?: Record<string, never>;
354
- resourceLink?: Record<string, never>;
355
- structuredContent?: Record<string, never>;
356
- }
357
- /** The sandbox policy the host enforces for a widget, echoed in its host capabilities. */
358
- export interface McpAppSandboxCapabilities {
359
- csp?: McpAppResourceCsp;
360
- permissions?: McpAppResourcePermissions;
361
- }
362
- /**
363
- * Host capability advertisement returned to the widget in `McpUiInitializeResult`.
364
- * Spec-compliant widgets gate `ui/open-link` / `tools/call` / `resources/read` on these,
365
- * so they must be declared, not left implicit.
366
- *
367
- * Local type — not aliased from ext-apps.
368
- */
369
- export interface McpAppHostCapabilities {
370
- openLinks?: Record<string, never>;
371
- serverTools?: {
372
- listChanged?: boolean;
373
- };
374
- serverResources?: {
375
- listChanged?: boolean;
376
- };
377
- logging?: Record<string, never>;
378
- message?: McpAppContentModalities;
379
- updateModelContext?: McpAppContentModalities;
380
- sandbox?: McpAppSandboxCapabilities;
381
- }
382
- /**
383
- * Type-erased tool definition for collections that mix tools with different argument types, e.g. the
384
- * `tools` passed to an adapter. Any `ToolDefinition<TArgs, TResult>` is assignable to it.
385
- */
386
- export type AnyToolDefinition = ToolDefinition<object, any>;
387
- export interface ChatMessage {
388
- id: string;
389
- role: 'user' | 'assistant' | 'system' | 'tool';
390
- content: string;
391
- timestamp: number;
392
- status: 'pending' | 'streaming' | 'complete' | 'error';
393
- toolCalls?: ToolCall[];
394
- toolCallId?: string;
395
- feedback?: ResponseFeedback;
396
- children?: ResponseItem[];
397
- clientOnly?: boolean;
398
- kind?: ClientMessageKind;
399
- header?: string;
400
- actions?: ClientMessageAction[];
401
- }
402
- /**
403
- * Visual treatment for a client-only message. `text` matches the plain,
404
- * italic system-message style; the others render as a Forge inline-message
405
- * banner with a matching icon.
406
- */
407
- export type ClientMessageKind = 'text' | 'info' | 'warning' | 'error' | 'success';
408
- export interface ClientMessageAction {
409
- id: string;
410
- label: string;
411
- onClick: () => void;
412
- }
413
- /**
414
- * Input to {@link AiChatbotBase.addClientMessage}. Pass the same `id` on a
415
- * later call to upsert (replace) a previously added client message.
416
- */
417
- export interface ClientMessageInput {
418
- id?: string;
419
- content: string;
420
- kind?: ClientMessageKind;
421
- header?: string;
422
- actions?: ClientMessageAction[];
423
- }
424
- export interface ToolCall<TArgs = Record<string, unknown>, TResult = unknown> {
425
- id: string;
426
- messageId: string;
427
- name: string;
428
- args: TArgs;
429
- argsBuffer?: string;
430
- /** Handler return value once the call completes; an `{ error }` object if the handler threw. */
431
- result?: TResult;
432
- status: ToolCallStatus;
433
- type: ToolType;
434
- startTimestamp?: number;
435
- endTimestamp?: number;
436
- /**
437
- * The resolved MCP-app UI resource. When present, this tool call renders as a
438
- * sandboxed `<forge-ai-mcp-app>` widget instead of the standard tool-call UI.
439
- */
440
- uiResource?: McpAppUiResource;
441
- /**
442
- * Set while an announced MCP-app UI resource has not resolved: `loading` while it is
443
- * being fetched, `error` when the fetch failed. The tool call renders as a
444
- * `<forge-ai-mcp-app>` placeholder (or error) in its final position meanwhile.
445
- * Cleared once `uiResource` is stamped, or when the adapter resolves no resource.
446
- */
447
- uiResourceStatus?: McpAppUiResourceStatus;
448
- /** Companion structured payload for the widget, stripped from LLM context. */
449
- structuredContent?: unknown;
450
- /** `true` when `structuredContent` was dropped by the backend (size caps). */
451
- structuredContentOmitted?: boolean;
452
- /** Raw MCP result for an MCP-app tool call; the source of the View's `tool-result`. */
453
- mcpResult?: McpToolResult;
454
- /** `true` when `mcpResult` was dropped by the backend (size caps). */
455
- mcpResultOmitted?: boolean;
456
- }
457
- /**
458
- * Tool call lifecycle. `cancelled` means the call ended without a result (run aborted,
459
- * stream ended/errored, or the adapter reported `cancelled: true`).
460
- */
461
- export type ToolCallStatus = 'pending' | 'parsing' | 'executing' | 'complete' | 'error' | 'cancelled';
462
- export type ResponseItem = {
463
- type: 'text';
464
- messageId: string;
465
- content: string;
466
- status: 'streaming' | 'complete';
467
- } | {
468
- type: 'toolCall';
469
- data: ToolCall;
470
- };
471
- export type FeedbackType = 'positive' | 'negative';
472
- export interface ResponseFeedback {
473
- type: FeedbackType;
474
- reason?: string;
475
- }
476
- export interface AssistantResponse {
477
- id: string;
478
- children: ResponseItem[];
479
- status: 'streaming' | 'complete' | 'error';
480
- timestamp: number;
481
- feedback?: ResponseFeedback;
482
- isThinking?: boolean;
483
- }
484
- export interface FileAttachment {
485
- id: string;
486
- filename: string;
487
- size: number;
488
- mimeType: string;
489
- timestamp: number;
490
- uploading?: boolean;
491
- progress?: number;
492
- status?: 'pending' | 'uploading' | 'success' | 'error';
493
- error?: string;
494
- fileId?: string;
495
- }
496
- export interface UploadedFileMetadata {
497
- fileId: string;
498
- fileName: string;
499
- fileType: string;
500
- fileSize: number;
501
- uploadedAt: string;
502
- }
503
- export interface FileUploadCallbacks {
504
- updateProgress: (progress: number) => void;
505
- markComplete: (metadata: UploadedFileMetadata) => void;
506
- markError: (error: string) => void;
507
- onAbort: (callback: () => void) => void;
508
- }
509
- export type FileUploadHandler = (file: File, callbacks: FileUploadCallbacks) => Promise<void> | void;
510
- export interface FileRemoveCallbacks {
511
- onSuccess: () => void;
512
- onError: (error: string) => void;
513
- }
514
- export interface FileRemoveEvent extends FileRemoveCallbacks {
515
- fileId: string;
516
- }
517
- export interface ForgeAiChatbotFileSelectEventData {
518
- fileId: string;
519
- file: File;
520
- filename: string;
521
- size: number;
522
- mimeType: string;
523
- timestamp: number;
524
- updateProgress: (progress: number) => void;
525
- markComplete: (metadata: UploadedFileMetadata) => void;
526
- markError: (error: string) => void;
527
- onAbort: (callback: () => void) => void;
528
- }
529
- export type MessageItem = {
530
- type: 'message';
531
- data: ChatMessage;
532
- } | {
533
- type: 'toolCall';
534
- data: ToolCall;
535
- } | {
536
- type: 'assistant';
537
- data: AssistantResponse;
538
- };
539
- export interface ThreadState {
540
- threadId?: string;
541
- messages: ChatMessage[];
542
- timestamp?: number;
543
- selectedAgentId?: string;
544
- }
545
- export interface ForgeAiChatbotThreadSelectEventData {
546
- id: string;
547
- title: string;
548
- }
549
- export interface ForgeAiChatbotThreadSearchEventData {
550
- query: string;
551
- setResults: (results: Thread[]) => void;
552
- }
553
- export interface ForgeAiChatbotThreadLoadMoreEventData {
554
- query: string;
555
- appendResults: (results: Thread[]) => void;
556
- }
557
- export interface ForgeAiChatbotThreadRenameEventData {
558
- id: string;
559
- oldTitle: string;
560
- newTitle: string;
561
- onSuccess: () => void;
562
- onError: (error?: string) => void;
563
- }
564
- export interface ForgeAiChatbotThreadDeleteEventData {
565
- id: string;
566
- thread: Thread;
567
- onSuccess: () => void;
568
- onError: (error?: string) => void;
569
- }
570
- export interface ContextItem {
571
- id: string;
572
- label: string;
573
- removable?: boolean;
574
- sublabel?: string;
575
- loading?: boolean;
576
- type?: 'file' | 'context';
577
- }
578
- export interface ForgeAiChatbotContextRemoveEventData {
579
- id: string;
580
- item: ContextItem;
581
- }
582
- export type { Thread };
@@ -1,49 +0,0 @@
1
- import { ChatMessage, ContextItem, FileAttachment, ToolCall, AnyToolDefinition } from './types.js';
2
- export { renderMarkdown, renderInlineMarkdown, type RenderMarkdownOptions } from '../utils/markdown.js';
3
- /**
4
- * Whether a tool call's renderer should currently be shown: once the call is complete,
5
- * or immediately (while still parsing/executing) if the tool opted into `renderOnStart`.
6
- */
7
- export declare function shouldShowToolRenderer(toolCall: ToolCall, toolDefinition?: AnyToolDefinition): boolean;
8
- /**
9
- * Whether a tool call should be treated as settled for activity indicators (thinking
10
- * indicator, tool-call summary spinner): either genuinely finished, or already showing
11
- * its own renderer to the user, which makes a redundant "running" spinner misleading.
12
- */
13
- export declare function isToolCallSettled(toolCall: ToolCall, toolDefinition?: AnyToolDefinition): boolean;
14
- /**
15
- * Whether a tool call renders as a `<forge-ai-mcp-app>` widget: its UI resource is resolved,
16
- * or announced and still loading (or failed to load).
17
- */
18
- export declare function rendersAsMcpAppWidget(toolCall: ToolCall): boolean;
19
- /**
20
- * Generates a unique ID using UUID v4
21
- */
22
- export declare function generateId(): string;
23
- /**
24
- * Downloads content as a file with specified MIME type
25
- */
26
- export declare function downloadFile(content: string, filename: string, mimeType?: string): void;
27
- /**
28
- * Converts file attachments to context items
29
- */
30
- export declare function fileAttachmentsToContextItems(completedAttachments: FileAttachment[], pendingAttachments: FileAttachment[]): ContextItem[];
31
- /**
32
- * Formats a single tool call as indented text lines for a chat export.
33
- */
34
- export declare function formatToolCallForExport(toolCall: ToolCall): string;
35
- /**
36
- * Formats a list of chat messages into a plain-text transcript. Tool call
37
- * details are only included when `includeToolCalls` is enabled. When a message
38
- * retains its interleaved `children`, text and tool calls are emitted in the
39
- * exact order they occurred; otherwise it falls back to the flat content plus a
40
- * trailing tool call block.
41
- */
42
- export declare function formatChatTranscript(messages: ChatMessage[], { includeToolCalls }?: {
43
- includeToolCalls?: boolean | undefined;
44
- }): string;
45
- /**
46
- * Builds a timestamped filename for an exported chat transcript, optionally
47
- * prefixed with a slugified agent name.
48
- */
49
- export declare function createChatExportFilename(agentName?: string): string;