@flanksource/clicky-ui 0.3.16 → 0.3.18

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 (871) hide show
  1. package/dist/ai.cjs +12 -6
  2. package/dist/ai.cjs.map +1 -1
  3. package/dist/ai.js +10 -4
  4. package/dist/ai.js.map +1 -1
  5. package/dist/chat.cjs +36 -0
  6. package/dist/chat.cjs.map +1 -1
  7. package/dist/chat.js +37 -1
  8. package/dist/chat.js.map +1 -1
  9. package/dist/components/Combobox.cjs +122 -153
  10. package/dist/components/Combobox.cjs.map +1 -1
  11. package/dist/components/Combobox.d.ts.map +1 -1
  12. package/dist/components/Combobox.js +124 -155
  13. package/dist/components/Combobox.js.map +1 -1
  14. package/dist/components/ComboboxControl.cjs +145 -0
  15. package/dist/components/ComboboxControl.cjs.map +1 -0
  16. package/dist/components/ComboboxControl.d.ts +37 -0
  17. package/dist/components/ComboboxControl.d.ts.map +1 -0
  18. package/dist/components/ComboboxControl.js +145 -0
  19. package/dist/components/ComboboxControl.js.map +1 -0
  20. package/dist/components/ComboboxMenu.cjs +31 -14
  21. package/dist/components/ComboboxMenu.cjs.map +1 -1
  22. package/dist/components/ComboboxMenu.d.ts.map +1 -1
  23. package/dist/components/ComboboxMenu.js +31 -14
  24. package/dist/components/ComboboxMenu.js.map +1 -1
  25. package/dist/components/ComboboxTags.cjs +40 -0
  26. package/dist/components/ComboboxTags.cjs.map +1 -0
  27. package/dist/components/ComboboxTags.d.ts +8 -0
  28. package/dist/components/ComboboxTags.d.ts.map +1 -0
  29. package/dist/components/ComboboxTags.js +40 -0
  30. package/dist/components/ComboboxTags.js.map +1 -0
  31. package/dist/components/ErrorWrapper.cjs +168 -0
  32. package/dist/components/ErrorWrapper.cjs.map +1 -0
  33. package/dist/components/ErrorWrapper.d.ts +19 -0
  34. package/dist/components/ErrorWrapper.d.ts.map +1 -0
  35. package/dist/components/ErrorWrapper.js +168 -0
  36. package/dist/components/ErrorWrapper.js.map +1 -0
  37. package/dist/components/FilterBar.cjs +64 -2
  38. package/dist/components/FilterBar.cjs.map +1 -1
  39. package/dist/components/FilterBar.d.ts +18 -1
  40. package/dist/components/FilterBar.d.ts.map +1 -1
  41. package/dist/components/FilterBar.js +64 -2
  42. package/dist/components/FilterBar.js.map +1 -1
  43. package/dist/components/JSONPathField.cjs +91 -0
  44. package/dist/components/JSONPathField.cjs.map +1 -0
  45. package/dist/components/JSONPathField.d.ts +19 -0
  46. package/dist/components/JSONPathField.d.ts.map +1 -0
  47. package/dist/components/JSONPathField.js +91 -0
  48. package/dist/components/JSONPathField.js.map +1 -0
  49. package/dist/components/JsonSchemaForm.cjs +8 -4
  50. package/dist/components/JsonSchemaForm.cjs.map +1 -1
  51. package/dist/components/JsonSchemaForm.d.ts.map +1 -1
  52. package/dist/components/JsonSchemaForm.js +8 -4
  53. package/dist/components/JsonSchemaForm.js.map +1 -1
  54. package/dist/components/TreePickerField.cjs +22 -4
  55. package/dist/components/TreePickerField.cjs.map +1 -1
  56. package/dist/components/TreePickerField.d.ts +22 -2
  57. package/dist/components/TreePickerField.d.ts.map +1 -1
  58. package/dist/components/TreePickerField.js +22 -4
  59. package/dist/components/TreePickerField.js.map +1 -1
  60. package/dist/components/TriStateToggle.cjs +53 -0
  61. package/dist/components/TriStateToggle.cjs.map +1 -0
  62. package/dist/components/TriStateToggle.d.ts +27 -0
  63. package/dist/components/TriStateToggle.d.ts.map +1 -0
  64. package/dist/components/TriStateToggle.js +53 -0
  65. package/dist/components/TriStateToggle.js.map +1 -0
  66. package/dist/components/combobox-types.d.ts +16 -1
  67. package/dist/components/combobox-types.d.ts.map +1 -1
  68. package/dist/components/combobox-utils.cjs +26 -0
  69. package/dist/components/combobox-utils.cjs.map +1 -1
  70. package/dist/components/combobox-utils.d.ts +10 -0
  71. package/dist/components/combobox-utils.d.ts.map +1 -1
  72. package/dist/components/combobox-utils.js +26 -0
  73. package/dist/components/combobox-utils.js.map +1 -1
  74. package/dist/components/filter-bar-utils.cjs +5 -0
  75. package/dist/components/filter-bar-utils.cjs.map +1 -1
  76. package/dist/components/filter-bar-utils.d.ts.map +1 -1
  77. package/dist/components/filter-bar-utils.js +5 -0
  78. package/dist/components/filter-bar-utils.js.map +1 -1
  79. package/dist/components/json-schema-form-accordion-array.cjs +290 -0
  80. package/dist/components/json-schema-form-accordion-array.cjs.map +1 -0
  81. package/dist/components/json-schema-form-accordion-array.d.ts +7 -0
  82. package/dist/components/json-schema-form-accordion-array.d.ts.map +1 -0
  83. package/dist/components/json-schema-form-accordion-array.js +290 -0
  84. package/dist/components/json-schema-form-accordion-array.js.map +1 -0
  85. package/dist/components/json-schema-form-array.cjs +99 -110
  86. package/dist/components/json-schema-form-array.cjs.map +1 -1
  87. package/dist/components/json-schema-form-array.d.ts +1 -1
  88. package/dist/components/json-schema-form-array.d.ts.map +1 -1
  89. package/dist/components/json-schema-form-array.js +98 -109
  90. package/dist/components/json-schema-form-array.js.map +1 -1
  91. package/dist/components/json-schema-form-error-display.cjs +4 -2
  92. package/dist/components/json-schema-form-error-display.cjs.map +1 -1
  93. package/dist/components/json-schema-form-error-display.d.ts +4 -2
  94. package/dist/components/json-schema-form-error-display.d.ts.map +1 -1
  95. package/dist/components/json-schema-form-error-display.js +4 -2
  96. package/dist/components/json-schema-form-error-display.js.map +1 -1
  97. package/dist/components/json-schema-form-extensions.cjs +10 -0
  98. package/dist/components/json-schema-form-extensions.cjs.map +1 -0
  99. package/dist/components/json-schema-form-extensions.d.ts +8 -0
  100. package/dist/components/json-schema-form-extensions.d.ts.map +1 -0
  101. package/dist/components/json-schema-form-extensions.js +10 -0
  102. package/dist/components/json-schema-form-extensions.js.map +1 -0
  103. package/dist/components/json-schema-form-fields.cjs +25 -101
  104. package/dist/components/json-schema-form-fields.cjs.map +1 -1
  105. package/dist/components/json-schema-form-fields.d.ts +1 -32
  106. package/dist/components/json-schema-form-fields.d.ts.map +1 -1
  107. package/dist/components/json-schema-form-fields.js +28 -104
  108. package/dist/components/json-schema-form-fields.js.map +1 -1
  109. package/dist/components/json-schema-form-item-summary.cjs +131 -0
  110. package/dist/components/json-schema-form-item-summary.cjs.map +1 -0
  111. package/dist/components/json-schema-form-item-summary.d.ts +13 -0
  112. package/dist/components/json-schema-form-item-summary.d.ts.map +1 -0
  113. package/dist/components/json-schema-form-item-summary.js +131 -0
  114. package/dist/components/json-schema-form-item-summary.js.map +1 -0
  115. package/dist/components/json-schema-form-layout.cjs +156 -0
  116. package/dist/components/json-schema-form-layout.cjs.map +1 -0
  117. package/dist/components/json-schema-form-layout.d.ts +43 -0
  118. package/dist/components/json-schema-form-layout.d.ts.map +1 -0
  119. package/dist/components/json-schema-form-layout.js +156 -0
  120. package/dist/components/json-schema-form-layout.js.map +1 -0
  121. package/dist/components/json-schema-form-lookup-tree.cjs +149 -0
  122. package/dist/components/json-schema-form-lookup-tree.cjs.map +1 -0
  123. package/dist/components/json-schema-form-lookup-tree.d.ts +22 -0
  124. package/dist/components/json-schema-form-lookup-tree.d.ts.map +1 -0
  125. package/dist/components/json-schema-form-lookup-tree.js +149 -0
  126. package/dist/components/json-schema-form-lookup-tree.js.map +1 -0
  127. package/dist/components/json-schema-form-object.cjs +11 -4
  128. package/dist/components/json-schema-form-object.cjs.map +1 -1
  129. package/dist/components/json-schema-form-object.d.ts.map +1 -1
  130. package/dist/components/json-schema-form-object.js +11 -4
  131. package/dist/components/json-schema-form-object.js.map +1 -1
  132. package/dist/components/json-schema-form-render.cjs +51 -28
  133. package/dist/components/json-schema-form-render.cjs.map +1 -1
  134. package/dist/components/json-schema-form-render.d.ts.map +1 -1
  135. package/dist/components/json-schema-form-render.js +51 -28
  136. package/dist/components/json-schema-form-render.js.map +1 -1
  137. package/dist/components/json-schema-form-resolve.cjs +62 -13
  138. package/dist/components/json-schema-form-resolve.cjs.map +1 -1
  139. package/dist/components/json-schema-form-resolve.d.ts +1 -0
  140. package/dist/components/json-schema-form-resolve.d.ts.map +1 -1
  141. package/dist/components/json-schema-form-resolve.js +62 -13
  142. package/dist/components/json-schema-form-resolve.js.map +1 -1
  143. package/dist/components/json-schema-form-table-array.cjs +123 -0
  144. package/dist/components/json-schema-form-table-array.cjs.map +1 -0
  145. package/dist/components/json-schema-form-table-array.d.ts +7 -0
  146. package/dist/components/json-schema-form-table-array.d.ts.map +1 -0
  147. package/dist/components/json-schema-form-table-array.js +123 -0
  148. package/dist/components/json-schema-form-table-array.js.map +1 -0
  149. package/dist/components/json-schema-form-tone.cjs +34 -0
  150. package/dist/components/json-schema-form-tone.cjs.map +1 -0
  151. package/dist/components/json-schema-form-tone.d.ts +8 -0
  152. package/dist/components/json-schema-form-tone.d.ts.map +1 -0
  153. package/dist/components/json-schema-form-tone.js +34 -0
  154. package/dist/components/json-schema-form-tone.js.map +1 -0
  155. package/dist/components/json-schema-form-types.d.ts +79 -10
  156. package/dist/components/json-schema-form-types.d.ts.map +1 -1
  157. package/dist/components/json-schema-form-utils.cjs +47 -4
  158. package/dist/components/json-schema-form-utils.cjs.map +1 -1
  159. package/dist/components/json-schema-form-utils.d.ts +19 -4
  160. package/dist/components/json-schema-form-utils.d.ts.map +1 -1
  161. package/dist/components/json-schema-form-utils.js +47 -4
  162. package/dist/components/json-schema-form-utils.js.map +1 -1
  163. package/dist/components/tri-state.cjs +8 -0
  164. package/dist/components/tri-state.cjs.map +1 -0
  165. package/dist/components/tri-state.d.ts +5 -0
  166. package/dist/components/tri-state.d.ts.map +1 -0
  167. package/dist/components/tri-state.js +8 -0
  168. package/dist/components/tri-state.js.map +1 -0
  169. package/dist/components/useComboboxLayout.cjs +59 -0
  170. package/dist/components/useComboboxLayout.cjs.map +1 -0
  171. package/dist/components/useComboboxLayout.d.ts +5 -0
  172. package/dist/components/useComboboxLayout.d.ts.map +1 -0
  173. package/dist/components/useComboboxLayout.js +59 -0
  174. package/dist/components/useComboboxLayout.js.map +1 -0
  175. package/dist/components.cjs +21 -0
  176. package/dist/components.cjs.map +1 -1
  177. package/dist/components.d.ts +14 -4
  178. package/dist/components.d.ts.map +1 -1
  179. package/dist/components.js +22 -1
  180. package/dist/components.js.map +1 -1
  181. package/dist/data/Clicky.cjs +51 -2
  182. package/dist/data/Clicky.cjs.map +1 -1
  183. package/dist/data/Clicky.d.ts +10 -1
  184. package/dist/data/Clicky.d.ts.map +1 -1
  185. package/dist/data/Clicky.js +51 -2
  186. package/dist/data/Clicky.js.map +1 -1
  187. package/dist/data/DataTable.cjs +215 -63
  188. package/dist/data/DataTable.cjs.map +1 -1
  189. package/dist/data/DataTable.d.ts +65 -3
  190. package/dist/data/DataTable.d.ts.map +1 -1
  191. package/dist/data/DataTable.js +215 -63
  192. package/dist/data/DataTable.js.map +1 -1
  193. package/dist/data/LogsTable.cjs +10 -1
  194. package/dist/data/LogsTable.cjs.map +1 -1
  195. package/dist/data/LogsTable.d.ts +3 -1
  196. package/dist/data/LogsTable.d.ts.map +1 -1
  197. package/dist/data/LogsTable.js +10 -1
  198. package/dist/data/LogsTable.js.map +1 -1
  199. package/dist/data/ServerTimingBadge.cjs +64 -0
  200. package/dist/data/ServerTimingBadge.cjs.map +1 -0
  201. package/dist/data/ServerTimingBadge.d.ts +9 -0
  202. package/dist/data/ServerTimingBadge.d.ts.map +1 -0
  203. package/dist/data/ServerTimingBadge.js +64 -0
  204. package/dist/data/ServerTimingBadge.js.map +1 -0
  205. package/dist/data/TaskManager.cjs +99 -14
  206. package/dist/data/TaskManager.cjs.map +1 -1
  207. package/dist/data/TaskManager.d.ts.map +1 -1
  208. package/dist/data/TaskManager.js +100 -15
  209. package/dist/data/TaskManager.js.map +1 -1
  210. package/dist/data/TaskProgress.cjs +50 -11
  211. package/dist/data/TaskProgress.cjs.map +1 -1
  212. package/dist/data/TaskProgress.d.ts +2 -1
  213. package/dist/data/TaskProgress.d.ts.map +1 -1
  214. package/dist/data/TaskProgress.js +50 -11
  215. package/dist/data/TaskProgress.js.map +1 -1
  216. package/dist/data/ai/AdvancedChatConfig.cjs +289 -0
  217. package/dist/data/ai/AdvancedChatConfig.cjs.map +1 -0
  218. package/dist/data/ai/AdvancedChatConfig.d.ts +21 -0
  219. package/dist/data/ai/AdvancedChatConfig.d.ts.map +1 -0
  220. package/dist/data/ai/AdvancedChatConfig.js +289 -0
  221. package/dist/data/ai/AdvancedChatConfig.js.map +1 -0
  222. package/dist/data/ai/AdvancedCostsPanel.cjs +120 -0
  223. package/dist/data/ai/AdvancedCostsPanel.cjs.map +1 -0
  224. package/dist/data/ai/AdvancedCostsPanel.d.ts +16 -0
  225. package/dist/data/ai/AdvancedCostsPanel.d.ts.map +1 -0
  226. package/dist/data/ai/AdvancedCostsPanel.js +120 -0
  227. package/dist/data/ai/AdvancedCostsPanel.js.map +1 -0
  228. package/dist/data/ai/ChatWindow.catalogs.cjs +74 -0
  229. package/dist/data/ai/ChatWindow.catalogs.cjs.map +1 -0
  230. package/dist/data/ai/ChatWindow.catalogs.d.ts +16 -0
  231. package/dist/data/ai/ChatWindow.catalogs.d.ts.map +1 -0
  232. package/dist/data/ai/ChatWindow.catalogs.js +74 -0
  233. package/dist/data/ai/ChatWindow.catalogs.js.map +1 -0
  234. package/dist/data/ai/ChatWindow.cjs +86 -100
  235. package/dist/data/ai/ChatWindow.cjs.map +1 -1
  236. package/dist/data/ai/ChatWindow.d.ts +1 -1
  237. package/dist/data/ai/ChatWindow.d.ts.map +1 -1
  238. package/dist/data/ai/ChatWindow.js +88 -102
  239. package/dist/data/ai/ChatWindow.js.map +1 -1
  240. package/dist/data/ai/ChatWindow.preferences.cjs.map +1 -1
  241. package/dist/data/ai/ChatWindow.preferences.d.ts +2 -4
  242. package/dist/data/ai/ChatWindow.preferences.d.ts.map +1 -1
  243. package/dist/data/ai/ChatWindow.preferences.js.map +1 -1
  244. package/dist/data/ai/ChatWindow.runtime.cjs +120 -0
  245. package/dist/data/ai/ChatWindow.runtime.cjs.map +1 -0
  246. package/dist/data/ai/ChatWindow.runtime.d.ts +20 -0
  247. package/dist/data/ai/ChatWindow.runtime.d.ts.map +1 -0
  248. package/dist/data/ai/ChatWindow.runtime.js +120 -0
  249. package/dist/data/ai/ChatWindow.runtime.js.map +1 -0
  250. package/dist/data/ai/ChatWindow.thread-status.cjs +14 -0
  251. package/dist/data/ai/ChatWindow.thread-status.cjs.map +1 -0
  252. package/dist/data/ai/ChatWindow.thread-status.d.ts +5 -0
  253. package/dist/data/ai/ChatWindow.thread-status.d.ts.map +1 -0
  254. package/dist/data/ai/ChatWindow.thread-status.js +14 -0
  255. package/dist/data/ai/ChatWindow.thread-status.js.map +1 -0
  256. package/dist/data/ai/ChatWindow.thread.cjs +68 -0
  257. package/dist/data/ai/ChatWindow.thread.cjs.map +1 -0
  258. package/dist/data/ai/ChatWindow.thread.d.ts +16 -0
  259. package/dist/data/ai/ChatWindow.thread.d.ts.map +1 -0
  260. package/dist/data/ai/ChatWindow.thread.js +68 -0
  261. package/dist/data/ai/ChatWindow.thread.js.map +1 -0
  262. package/dist/data/ai/ChatWindow.tool-catalog.cjs +20 -0
  263. package/dist/data/ai/ChatWindow.tool-catalog.cjs.map +1 -1
  264. package/dist/data/ai/ChatWindow.tool-catalog.d.ts +17 -1
  265. package/dist/data/ai/ChatWindow.tool-catalog.d.ts.map +1 -1
  266. package/dist/data/ai/ChatWindow.tool-catalog.js +20 -0
  267. package/dist/data/ai/ChatWindow.tool-catalog.js.map +1 -1
  268. package/dist/data/ai/ChatWindow.types.d.ts +13 -5
  269. package/dist/data/ai/ChatWindow.types.d.ts.map +1 -1
  270. package/dist/data/ai/ChatWindowManager.cjs +3 -1
  271. package/dist/data/ai/ChatWindowManager.cjs.map +1 -1
  272. package/dist/data/ai/ChatWindowManager.d.ts.map +1 -1
  273. package/dist/data/ai/ChatWindowManager.js +3 -1
  274. package/dist/data/ai/ChatWindowManager.js.map +1 -1
  275. package/dist/data/ai/PromptPicker/PromptPicker.cjs +1 -1
  276. package/dist/data/ai/PromptPicker/PromptPicker.cjs.map +1 -1
  277. package/dist/data/ai/PromptPicker/PromptPicker.d.ts +1 -1
  278. package/dist/data/ai/PromptPicker/PromptPicker.d.ts.map +1 -1
  279. package/dist/data/ai/PromptPicker/PromptPicker.js +1 -1
  280. package/dist/data/ai/PromptPicker/PromptPicker.js.map +1 -1
  281. package/dist/data/ai/PromptRunEditor/index.cjs +101 -89
  282. package/dist/data/ai/PromptRunEditor/index.cjs.map +1 -1
  283. package/dist/data/ai/PromptRunEditor/index.d.ts +6 -10
  284. package/dist/data/ai/PromptRunEditor/index.d.ts.map +1 -1
  285. package/dist/data/ai/PromptRunEditor/index.js +103 -91
  286. package/dist/data/ai/PromptRunEditor/index.js.map +1 -1
  287. package/dist/data/ai/PromptRunEditor/model.cjs +47 -0
  288. package/dist/data/ai/PromptRunEditor/model.cjs.map +1 -0
  289. package/dist/data/ai/PromptRunEditor/model.d.ts +17 -0
  290. package/dist/data/ai/PromptRunEditor/model.d.ts.map +1 -0
  291. package/dist/data/ai/PromptRunEditor/model.js +47 -0
  292. package/dist/data/ai/PromptRunEditor/model.js.map +1 -0
  293. package/dist/data/ai/RuntimeModePicker.cjs +1 -1
  294. package/dist/data/ai/RuntimeModePicker.cjs.map +1 -1
  295. package/dist/data/ai/RuntimeModePicker.d.ts +1 -1
  296. package/dist/data/ai/RuntimeModePicker.d.ts.map +1 -1
  297. package/dist/data/ai/RuntimeModePicker.js +1 -1
  298. package/dist/data/ai/RuntimeModePicker.js.map +1 -1
  299. package/dist/data/ai/SessionInspector.files.cjs +26 -43
  300. package/dist/data/ai/SessionInspector.files.cjs.map +1 -1
  301. package/dist/data/ai/SessionInspector.files.d.ts.map +1 -1
  302. package/dist/data/ai/SessionInspector.files.js +26 -43
  303. package/dist/data/ai/SessionInspector.files.js.map +1 -1
  304. package/dist/data/ai/SessionInspector.hierarchy.cjs +1 -1
  305. package/dist/data/ai/SessionInspector.hierarchy.cjs.map +1 -1
  306. package/dist/data/ai/SessionInspector.hierarchy.js +1 -1
  307. package/dist/data/ai/SessionInspector.hierarchy.js.map +1 -1
  308. package/dist/data/ai/SessionInspector.model.cjs +1 -1
  309. package/dist/data/ai/SessionInspector.model.cjs.map +1 -1
  310. package/dist/data/ai/SessionInspector.model.js +1 -1
  311. package/dist/data/ai/SessionInspector.model.js.map +1 -1
  312. package/dist/data/ai/SessionViewer.header.cjs +17 -9
  313. package/dist/data/ai/SessionViewer.header.cjs.map +1 -1
  314. package/dist/data/ai/SessionViewer.header.d.ts.map +1 -1
  315. package/dist/data/ai/SessionViewer.header.js +17 -9
  316. package/dist/data/ai/SessionViewer.header.js.map +1 -1
  317. package/dist/data/ai/SessionViewer.model.cjs +2 -0
  318. package/dist/data/ai/SessionViewer.model.cjs.map +1 -1
  319. package/dist/data/ai/SessionViewer.model.d.ts +4 -0
  320. package/dist/data/ai/SessionViewer.model.d.ts.map +1 -1
  321. package/dist/data/ai/SessionViewer.model.js +2 -0
  322. package/dist/data/ai/SessionViewer.model.js.map +1 -1
  323. package/dist/data/ai/SessionViewer.rows.cjs +4 -16
  324. package/dist/data/ai/SessionViewer.rows.cjs.map +1 -1
  325. package/dist/data/ai/SessionViewer.rows.d.ts.map +1 -1
  326. package/dist/data/ai/SessionViewer.rows.js +4 -16
  327. package/dist/data/ai/SessionViewer.rows.js.map +1 -1
  328. package/dist/data/ai/SessionViewer.unified.d.ts +1 -0
  329. package/dist/data/ai/SessionViewer.unified.d.ts.map +1 -1
  330. package/dist/data/ai/SpecRuntimeEditor/ModelSection.cjs +12 -3
  331. package/dist/data/ai/SpecRuntimeEditor/ModelSection.cjs.map +1 -1
  332. package/dist/data/ai/SpecRuntimeEditor/ModelSection.d.ts +1 -1
  333. package/dist/data/ai/SpecRuntimeEditor/ModelSection.d.ts.map +1 -1
  334. package/dist/data/ai/SpecRuntimeEditor/ModelSection.js +12 -3
  335. package/dist/data/ai/SpecRuntimeEditor/ModelSection.js.map +1 -1
  336. package/dist/data/ai/SpecRuntimeEditor/VerifySection.cjs.map +1 -1
  337. package/dist/data/ai/SpecRuntimeEditor/VerifySection.d.ts +1 -1
  338. package/dist/data/ai/SpecRuntimeEditor/VerifySection.d.ts.map +1 -1
  339. package/dist/data/ai/SpecRuntimeEditor/VerifySection.js.map +1 -1
  340. package/dist/data/ai/SpecRuntimeEditor/index.cjs.map +1 -1
  341. package/dist/data/ai/SpecRuntimeEditor/index.d.ts +2 -2
  342. package/dist/data/ai/SpecRuntimeEditor/index.d.ts.map +1 -1
  343. package/dist/data/ai/SpecRuntimeEditor/index.js.map +1 -1
  344. package/dist/data/ai/ThreadPicker.cjs +65 -3
  345. package/dist/data/ai/ThreadPicker.cjs.map +1 -1
  346. package/dist/data/ai/ThreadPicker.d.ts +13 -5
  347. package/dist/data/ai/ThreadPicker.d.ts.map +1 -1
  348. package/dist/data/ai/ThreadPicker.js +65 -3
  349. package/dist/data/ai/ThreadPicker.js.map +1 -1
  350. package/dist/data/ai/ToolPreferences.cjs +65 -685
  351. package/dist/data/ai/ToolPreferences.cjs.map +1 -1
  352. package/dist/data/ai/ToolPreferences.d.ts +15 -17
  353. package/dist/data/ai/ToolPreferences.d.ts.map +1 -1
  354. package/dist/data/ai/ToolPreferences.js +64 -683
  355. package/dist/data/ai/ToolPreferences.js.map +1 -1
  356. package/dist/data/ai/ToolPreferences.model.cjs +148 -0
  357. package/dist/data/ai/ToolPreferences.model.cjs.map +1 -0
  358. package/dist/data/ai/ToolPreferences.model.d.ts +31 -0
  359. package/dist/data/ai/ToolPreferences.model.d.ts.map +1 -0
  360. package/dist/data/ai/ToolPreferences.model.js +148 -0
  361. package/dist/data/ai/ToolPreferences.model.js.map +1 -0
  362. package/dist/data/ai/ToolPreferencesList.cjs +270 -0
  363. package/dist/data/ai/ToolPreferencesList.cjs.map +1 -0
  364. package/dist/data/ai/ToolPreferencesList.d.ts +18 -0
  365. package/dist/data/ai/ToolPreferencesList.d.ts.map +1 -0
  366. package/dist/data/ai/ToolPreferencesList.js +270 -0
  367. package/dist/data/ai/ToolPreferencesList.js.map +1 -0
  368. package/dist/data/ai/agent-action-icons.cjs.map +1 -1
  369. package/dist/data/ai/agent-action-icons.js.map +1 -1
  370. package/dist/data/ai/chat-window-context.cjs +4 -1
  371. package/dist/data/ai/chat-window-context.cjs.map +1 -1
  372. package/dist/data/ai/chat-window-context.d.ts +7 -0
  373. package/dist/data/ai/chat-window-context.d.ts.map +1 -1
  374. package/dist/data/ai/chat-window-context.js +4 -1
  375. package/dist/data/ai/chat-window-context.js.map +1 -1
  376. package/dist/data/ai/index.d.ts +7 -3
  377. package/dist/data/ai/index.d.ts.map +1 -1
  378. package/dist/data/ai/session-tones.cjs +67 -0
  379. package/dist/data/ai/session-tones.cjs.map +1 -0
  380. package/dist/data/ai/session-tones.d.ts +34 -0
  381. package/dist/data/ai/session-tones.d.ts.map +1 -0
  382. package/dist/data/ai/session-tones.js +67 -0
  383. package/dist/data/ai/session-tones.js.map +1 -0
  384. package/dist/data/ai/thread-costs.cjs +39 -0
  385. package/dist/data/ai/thread-costs.cjs.map +1 -0
  386. package/dist/data/ai/thread-costs.d.ts +62 -0
  387. package/dist/data/ai/thread-costs.d.ts.map +1 -0
  388. package/dist/data/ai/thread-costs.js +39 -0
  389. package/dist/data/ai/thread-costs.js.map +1 -0
  390. package/dist/data/cells/CellFilterActions.cjs +68 -0
  391. package/dist/data/cells/CellFilterActions.cjs.map +1 -0
  392. package/dist/data/cells/CellFilterActions.d.ts +15 -0
  393. package/dist/data/cells/CellFilterActions.d.ts.map +1 -0
  394. package/dist/data/cells/CellFilterActions.js +68 -0
  395. package/dist/data/cells/CellFilterActions.js.map +1 -0
  396. package/dist/data/chat/Chat.cjs +192 -80
  397. package/dist/data/chat/Chat.cjs.map +1 -1
  398. package/dist/data/chat/Chat.d.ts +24 -4
  399. package/dist/data/chat/Chat.d.ts.map +1 -1
  400. package/dist/data/chat/Chat.fixtures.cjs +48 -3
  401. package/dist/data/chat/Chat.fixtures.cjs.map +1 -1
  402. package/dist/data/chat/Chat.fixtures.d.ts +1 -1
  403. package/dist/data/chat/Chat.fixtures.d.ts.map +1 -1
  404. package/dist/data/chat/Chat.fixtures.js +48 -3
  405. package/dist/data/chat/Chat.fixtures.js.map +1 -1
  406. package/dist/data/chat/Chat.js +195 -83
  407. package/dist/data/chat/Chat.js.map +1 -1
  408. package/dist/data/chat/Chat.runtime.cjs +63 -0
  409. package/dist/data/chat/Chat.runtime.cjs.map +1 -0
  410. package/dist/data/chat/Chat.runtime.d.ts +16 -0
  411. package/dist/data/chat/Chat.runtime.d.ts.map +1 -0
  412. package/dist/data/chat/Chat.runtime.js +63 -0
  413. package/dist/data/chat/Chat.runtime.js.map +1 -0
  414. package/dist/data/chat/ChatRuntimeToolbar.cjs +62 -0
  415. package/dist/data/chat/ChatRuntimeToolbar.cjs.map +1 -0
  416. package/dist/data/chat/ChatRuntimeToolbar.d.ts +14 -0
  417. package/dist/data/chat/ChatRuntimeToolbar.d.ts.map +1 -0
  418. package/dist/data/chat/ChatRuntimeToolbar.js +62 -0
  419. package/dist/data/chat/ChatRuntimeToolbar.js.map +1 -0
  420. package/dist/data/chat/ContextMeter.cjs +144 -73
  421. package/dist/data/chat/ContextMeter.cjs.map +1 -1
  422. package/dist/data/chat/ContextMeter.d.ts +8 -3
  423. package/dist/data/chat/ContextMeter.d.ts.map +1 -1
  424. package/dist/data/chat/ContextMeter.js +144 -73
  425. package/dist/data/chat/ContextMeter.js.map +1 -1
  426. package/dist/data/chat/ToolCall.cjs +86 -24
  427. package/dist/data/chat/ToolCall.cjs.map +1 -1
  428. package/dist/data/chat/ToolCall.d.ts +12 -5
  429. package/dist/data/chat/ToolCall.d.ts.map +1 -1
  430. package/dist/data/chat/ToolCall.js +86 -24
  431. package/dist/data/chat/ToolCall.js.map +1 -1
  432. package/dist/data/chat/approval.cjs +64 -0
  433. package/dist/data/chat/approval.cjs.map +1 -0
  434. package/dist/data/chat/approval.d.ts +18 -0
  435. package/dist/data/chat/approval.d.ts.map +1 -0
  436. package/dist/data/chat/approval.js +64 -0
  437. package/dist/data/chat/approval.js.map +1 -0
  438. package/dist/data/chat/index.d.ts +5 -3
  439. package/dist/data/chat/index.d.ts.map +1 -1
  440. package/dist/data/chat/tool-render/ToolArgs.cjs +50 -0
  441. package/dist/data/chat/tool-render/ToolArgs.cjs.map +1 -0
  442. package/dist/data/chat/tool-render/ToolArgs.d.ts +7 -0
  443. package/dist/data/chat/tool-render/ToolArgs.d.ts.map +1 -0
  444. package/dist/data/chat/tool-render/ToolArgs.js +50 -0
  445. package/dist/data/chat/tool-render/ToolArgs.js.map +1 -0
  446. package/dist/data/chat/tool-render/ToolParams.cjs +155 -0
  447. package/dist/data/chat/tool-render/ToolParams.cjs.map +1 -0
  448. package/dist/data/chat/tool-render/ToolParams.d.ts +20 -0
  449. package/dist/data/chat/tool-render/ToolParams.d.ts.map +1 -0
  450. package/dist/data/chat/tool-render/ToolParams.js +155 -0
  451. package/dist/data/chat/tool-render/ToolParams.js.map +1 -0
  452. package/dist/data/chat/tool-render/ToolValue.cjs +140 -0
  453. package/dist/data/chat/tool-render/ToolValue.cjs.map +1 -0
  454. package/dist/data/chat/tool-render/ToolValue.d.ts +16 -0
  455. package/dist/data/chat/tool-render/ToolValue.d.ts.map +1 -0
  456. package/dist/data/chat/tool-render/ToolValue.js +140 -0
  457. package/dist/data/chat/tool-render/ToolValue.js.map +1 -0
  458. package/dist/data/chat/tool-render/adapter.cjs +48 -0
  459. package/dist/data/chat/tool-render/adapter.cjs.map +1 -0
  460. package/dist/data/chat/tool-render/adapter.d.ts +57 -0
  461. package/dist/data/chat/tool-render/adapter.d.ts.map +1 -0
  462. package/dist/data/chat/tool-render/adapter.js +48 -0
  463. package/dist/data/chat/tool-render/adapter.js.map +1 -0
  464. package/dist/data/chat/tool-render/context.cjs +16 -0
  465. package/dist/data/chat/tool-render/context.cjs.map +1 -0
  466. package/dist/data/chat/tool-render/context.d.ts +6 -0
  467. package/dist/data/chat/tool-render/context.d.ts.map +1 -0
  468. package/dist/data/chat/tool-render/context.js +16 -0
  469. package/dist/data/chat/tool-render/context.js.map +1 -0
  470. package/dist/data/chat/tool-render/defaults.cjs +45 -0
  471. package/dist/data/chat/tool-render/defaults.cjs.map +1 -0
  472. package/dist/data/chat/tool-render/defaults.d.ts +11 -0
  473. package/dist/data/chat/tool-render/defaults.d.ts.map +1 -0
  474. package/dist/data/chat/tool-render/defaults.js +45 -0
  475. package/dist/data/chat/tool-render/defaults.js.map +1 -0
  476. package/dist/data/chat/tool-render/index.d.ts +13 -0
  477. package/dist/data/chat/tool-render/index.d.ts.map +1 -0
  478. package/dist/data/chat/tool-render/known-tool-views.cjs +208 -0
  479. package/dist/data/chat/tool-render/known-tool-views.cjs.map +1 -0
  480. package/dist/data/chat/tool-render/known-tool-views.d.ts +10 -0
  481. package/dist/data/chat/tool-render/known-tool-views.d.ts.map +1 -0
  482. package/dist/data/chat/tool-render/known-tool-views.js +208 -0
  483. package/dist/data/chat/tool-render/known-tool-views.js.map +1 -0
  484. package/dist/data/chat/tool-render/known-tools.cjs +58 -0
  485. package/dist/data/chat/tool-render/known-tools.cjs.map +1 -0
  486. package/dist/data/chat/tool-render/known-tools.d.ts +4 -0
  487. package/dist/data/chat/tool-render/known-tools.d.ts.map +1 -0
  488. package/dist/data/chat/tool-render/known-tools.js +58 -0
  489. package/dist/data/chat/tool-render/known-tools.js.map +1 -0
  490. package/dist/data/chat/tool-render/normalize.cjs +42 -0
  491. package/dist/data/chat/tool-render/normalize.cjs.map +1 -0
  492. package/dist/data/chat/tool-render/normalize.d.ts +13 -0
  493. package/dist/data/chat/tool-render/normalize.d.ts.map +1 -0
  494. package/dist/data/chat/tool-render/normalize.js +42 -0
  495. package/dist/data/chat/tool-render/normalize.js.map +1 -0
  496. package/dist/data/chat/tool-render/registry.cjs +14 -0
  497. package/dist/data/chat/tool-render/registry.cjs.map +1 -0
  498. package/dist/data/chat/tool-render/registry.d.ts +7 -0
  499. package/dist/data/chat/tool-render/registry.d.ts.map +1 -0
  500. package/dist/data/chat/tool-render/registry.js +14 -0
  501. package/dist/data/chat/tool-render/registry.js.map +1 -0
  502. package/dist/data/chat/tool-render/schema.cjs +57 -0
  503. package/dist/data/chat/tool-render/schema.cjs.map +1 -0
  504. package/dist/data/chat/tool-render/schema.d.ts +28 -0
  505. package/dist/data/chat/tool-render/schema.d.ts.map +1 -0
  506. package/dist/data/chat/tool-render/schema.js +57 -0
  507. package/dist/data/chat/tool-render/schema.js.map +1 -0
  508. package/dist/data/chat/tool-render/shape.cjs +94 -0
  509. package/dist/data/chat/tool-render/shape.cjs.map +1 -0
  510. package/dist/data/chat/tool-render/shape.d.ts +39 -0
  511. package/dist/data/chat/tool-render/shape.d.ts.map +1 -0
  512. package/dist/data/chat/tool-render/shape.js +94 -0
  513. package/dist/data/chat/tool-render/shape.js.map +1 -0
  514. package/dist/data/chat/tool-render/summary.cjs +34 -0
  515. package/dist/data/chat/tool-render/summary.cjs.map +1 -0
  516. package/dist/data/chat/tool-render/summary.d.ts +8 -0
  517. package/dist/data/chat/tool-render/summary.d.ts.map +1 -0
  518. package/dist/data/chat/tool-render/summary.js +34 -0
  519. package/dist/data/chat/tool-render/summary.js.map +1 -0
  520. package/dist/data/chat/types.cjs.map +1 -1
  521. package/dist/data/chat/types.d.ts +19 -0
  522. package/dist/data/chat/types.d.ts.map +1 -1
  523. package/dist/data/chat/types.js.map +1 -1
  524. package/dist/data/chat/usage-snapshot.cjs +17 -0
  525. package/dist/data/chat/usage-snapshot.cjs.map +1 -0
  526. package/dist/data/chat/usage-snapshot.d.ts +21 -0
  527. package/dist/data/chat/usage-snapshot.d.ts.map +1 -0
  528. package/dist/data/chat/usage-snapshot.js +17 -0
  529. package/dist/data/chat/usage-snapshot.js.map +1 -0
  530. package/dist/data/data-table-filter-values.cjs +83 -0
  531. package/dist/data/data-table-filter-values.cjs.map +1 -0
  532. package/dist/data/data-table-filter-values.d.ts +18 -0
  533. package/dist/data/data-table-filter-values.d.ts.map +1 -0
  534. package/dist/data/data-table-filter-values.js +83 -0
  535. package/dist/data/data-table-filter-values.js.map +1 -0
  536. package/dist/data/data-table-server-filters.cjs +171 -0
  537. package/dist/data/data-table-server-filters.cjs.map +1 -0
  538. package/dist/data/data-table-server-filters.d.ts +128 -0
  539. package/dist/data/data-table-server-filters.d.ts.map +1 -0
  540. package/dist/data/data-table-server-filters.js +171 -0
  541. package/dist/data/data-table-server-filters.js.map +1 -0
  542. package/dist/data/query-browser/QueryBrowser.cjs +96 -19
  543. package/dist/data/query-browser/QueryBrowser.cjs.map +1 -1
  544. package/dist/data/query-browser/QueryBrowser.d.ts +37 -6
  545. package/dist/data/query-browser/QueryBrowser.d.ts.map +1 -1
  546. package/dist/data/query-browser/QueryBrowser.js +96 -19
  547. package/dist/data/query-browser/QueryBrowser.js.map +1 -1
  548. package/dist/data/query-browser/index.d.ts +1 -1
  549. package/dist/data/query-browser/index.d.ts.map +1 -1
  550. package/dist/data/runtime/ProviderStatusPanel.cjs +187 -0
  551. package/dist/data/runtime/ProviderStatusPanel.cjs.map +1 -0
  552. package/dist/data/runtime/ProviderStatusPanel.d.ts +10 -0
  553. package/dist/data/runtime/ProviderStatusPanel.d.ts.map +1 -0
  554. package/dist/data/runtime/ProviderStatusPanel.js +187 -0
  555. package/dist/data/runtime/ProviderStatusPanel.js.map +1 -0
  556. package/dist/data/runtime/RuntimeBar.cjs +147 -0
  557. package/dist/data/runtime/RuntimeBar.cjs.map +1 -0
  558. package/dist/data/runtime/RuntimeBar.d.ts +22 -0
  559. package/dist/data/runtime/RuntimeBar.d.ts.map +1 -0
  560. package/dist/data/runtime/RuntimeBar.js +147 -0
  561. package/dist/data/runtime/RuntimeBar.js.map +1 -0
  562. package/dist/data/runtime/RuntimeBar.model.cjs +14 -0
  563. package/dist/data/runtime/RuntimeBar.model.cjs.map +1 -0
  564. package/dist/data/runtime/RuntimeBar.model.d.ts +10 -0
  565. package/dist/data/runtime/RuntimeBar.model.d.ts.map +1 -0
  566. package/dist/data/runtime/RuntimeBar.model.js +14 -0
  567. package/dist/data/runtime/RuntimeBar.model.js.map +1 -0
  568. package/dist/data/runtime/RuntimeBarCombo.cjs +354 -0
  569. package/dist/data/runtime/RuntimeBarCombo.cjs.map +1 -0
  570. package/dist/data/runtime/RuntimeBarCombo.d.ts +23 -0
  571. package/dist/data/runtime/RuntimeBarCombo.d.ts.map +1 -0
  572. package/dist/data/runtime/RuntimeBarCombo.js +354 -0
  573. package/dist/data/runtime/RuntimeBarCombo.js.map +1 -0
  574. package/dist/data/{ai/RuntimeBar.cjs → runtime/RuntimeBarSegments.cjs} +93 -87
  575. package/dist/data/runtime/RuntimeBarSegments.cjs.map +1 -0
  576. package/dist/data/runtime/RuntimeBarSegments.d.ts +25 -0
  577. package/dist/data/runtime/RuntimeBarSegments.d.ts.map +1 -0
  578. package/dist/data/{ai/RuntimeBar.js → runtime/RuntimeBarSegments.js} +96 -90
  579. package/dist/data/runtime/RuntimeBarSegments.js.map +1 -0
  580. package/dist/data/runtime/availability.cjs +11 -0
  581. package/dist/data/runtime/availability.cjs.map +1 -0
  582. package/dist/data/runtime/availability.d.ts +6 -0
  583. package/dist/data/runtime/availability.d.ts.map +1 -0
  584. package/dist/data/runtime/availability.js +11 -0
  585. package/dist/data/runtime/availability.js.map +1 -0
  586. package/dist/data/{ai → runtime}/model-capabilities.cjs +12 -1
  587. package/dist/data/runtime/model-capabilities.cjs.map +1 -0
  588. package/dist/data/{ai → runtime}/model-capabilities.d.ts +2 -6
  589. package/dist/data/runtime/model-capabilities.d.ts.map +1 -0
  590. package/dist/data/{ai → runtime}/model-capabilities.js +12 -1
  591. package/dist/data/runtime/model-capabilities.js.map +1 -0
  592. package/dist/data/runtime/provider-status.cjs +106 -0
  593. package/dist/data/runtime/provider-status.cjs.map +1 -0
  594. package/dist/data/runtime/provider-status.d.ts +24 -0
  595. package/dist/data/runtime/provider-status.d.ts.map +1 -0
  596. package/dist/data/runtime/provider-status.js +106 -0
  597. package/dist/data/runtime/provider-status.js.map +1 -0
  598. package/dist/data/{ai → runtime}/runtime-mode.cjs +123 -22
  599. package/dist/data/runtime/runtime-mode.cjs.map +1 -0
  600. package/dist/data/{ai → runtime}/runtime-mode.d.ts +8 -1
  601. package/dist/data/runtime/runtime-mode.d.ts.map +1 -0
  602. package/dist/data/{ai → runtime}/runtime-mode.js +123 -22
  603. package/dist/data/runtime/runtime-mode.js.map +1 -0
  604. package/dist/data/server-timing.cjs +120 -0
  605. package/dist/data/server-timing.cjs.map +1 -0
  606. package/dist/data/server-timing.d.ts +11 -0
  607. package/dist/data/server-timing.d.ts.map +1 -0
  608. package/dist/data/server-timing.js +120 -0
  609. package/dist/data/server-timing.js.map +1 -0
  610. package/dist/data/task-query-keys.cjs +26 -0
  611. package/dist/data/task-query-keys.cjs.map +1 -0
  612. package/dist/data/task-query-keys.d.ts +27 -0
  613. package/dist/data/task-query-keys.d.ts.map +1 -0
  614. package/dist/data/task-query-keys.js +26 -0
  615. package/dist/data/task-query-keys.js.map +1 -0
  616. package/dist/data/version-info.cjs +3 -3
  617. package/dist/data/version-info.js +3 -3
  618. package/dist/data.cjs +23 -0
  619. package/dist/data.cjs.map +1 -1
  620. package/dist/data.d.ts +8 -2
  621. package/dist/data.d.ts.map +1 -1
  622. package/dist/data.js +23 -0
  623. package/dist/data.js.map +1 -1
  624. package/dist/hooks/use-hotkey.cjs +6 -1
  625. package/dist/hooks/use-hotkey.cjs.map +1 -1
  626. package/dist/hooks/use-hotkey.d.ts.map +1 -1
  627. package/dist/hooks/use-hotkey.js +6 -1
  628. package/dist/hooks/use-hotkey.js.map +1 -1
  629. package/dist/hooks/use-task-run.cjs +7 -4
  630. package/dist/hooks/use-task-run.cjs.map +1 -1
  631. package/dist/hooks/use-task-run.d.ts +12 -0
  632. package/dist/hooks/use-task-run.d.ts.map +1 -1
  633. package/dist/hooks/use-task-run.js +7 -4
  634. package/dist/hooks/use-task-run.js.map +1 -1
  635. package/dist/icons/index.d.ts +1 -0
  636. package/dist/icons/index.d.ts.map +1 -1
  637. package/dist/icons/registry.cjs +692 -0
  638. package/dist/icons/registry.cjs.map +1 -0
  639. package/dist/icons/registry.d.ts +21 -0
  640. package/dist/icons/registry.d.ts.map +1 -0
  641. package/dist/icons/registry.js +692 -0
  642. package/dist/icons/registry.js.map +1 -0
  643. package/dist/icons.cjs +3 -0
  644. package/dist/icons.cjs.map +1 -1
  645. package/dist/icons.js +4 -1
  646. package/dist/icons.js.map +1 -1
  647. package/dist/index.cjs +54 -0
  648. package/dist/index.cjs.map +1 -1
  649. package/dist/index.js +56 -2
  650. package/dist/index.js.map +1 -1
  651. package/dist/layout/AppShell.cjs +93 -57
  652. package/dist/layout/AppShell.cjs.map +1 -1
  653. package/dist/layout/AppShell.d.ts +49 -1
  654. package/dist/layout/AppShell.d.ts.map +1 -1
  655. package/dist/layout/AppShell.js +93 -57
  656. package/dist/layout/AppShell.js.map +1 -1
  657. package/dist/layout/AppShell.nav.cjs +144 -19
  658. package/dist/layout/AppShell.nav.cjs.map +1 -1
  659. package/dist/layout/AppShell.nav.d.ts +6 -1
  660. package/dist/layout/AppShell.nav.d.ts.map +1 -1
  661. package/dist/layout/AppShell.nav.js +144 -19
  662. package/dist/layout/AppShell.nav.js.map +1 -1
  663. package/dist/layout/SplitPane.cjs +23 -7
  664. package/dist/layout/SplitPane.cjs.map +1 -1
  665. package/dist/layout/SplitPane.d.ts +3 -1
  666. package/dist/layout/SplitPane.d.ts.map +1 -1
  667. package/dist/layout/SplitPane.js +23 -7
  668. package/dist/layout/SplitPane.js.map +1 -1
  669. package/dist/lib/format.cjs +86 -4
  670. package/dist/lib/format.cjs.map +1 -1
  671. package/dist/lib/format.d.ts +69 -0
  672. package/dist/lib/format.d.ts.map +1 -1
  673. package/dist/lib/format.js +86 -4
  674. package/dist/lib/format.js.map +1 -1
  675. package/dist/lib/path-tree.cjs +69 -0
  676. package/dist/lib/path-tree.cjs.map +1 -0
  677. package/dist/lib/path-tree.d.ts +54 -0
  678. package/dist/lib/path-tree.d.ts.map +1 -0
  679. package/dist/lib/path-tree.js +69 -0
  680. package/dist/lib/path-tree.js.map +1 -0
  681. package/dist/monaco.d.ts +1 -0
  682. package/dist/monaco.d.ts.map +1 -1
  683. package/dist/overlay/DropdownMenuSubmenu.cjs +13 -7
  684. package/dist/overlay/DropdownMenuSubmenu.cjs.map +1 -1
  685. package/dist/overlay/DropdownMenuSubmenu.d.ts.map +1 -1
  686. package/dist/overlay/DropdownMenuSubmenu.js +13 -7
  687. package/dist/overlay/DropdownMenuSubmenu.js.map +1 -1
  688. package/dist/overlay/HoverCard.cjs.map +1 -1
  689. package/dist/overlay/HoverCard.d.ts +2 -2
  690. package/dist/overlay/HoverCard.d.ts.map +1 -1
  691. package/dist/overlay/HoverCard.js.map +1 -1
  692. package/dist/overlay/Tour.cjs +173 -0
  693. package/dist/overlay/Tour.cjs.map +1 -0
  694. package/dist/overlay/Tour.d.ts +61 -0
  695. package/dist/overlay/Tour.d.ts.map +1 -0
  696. package/dist/overlay/Tour.js +173 -0
  697. package/dist/overlay/Tour.js.map +1 -0
  698. package/dist/overlay/TourCard.cjs +108 -0
  699. package/dist/overlay/TourCard.cjs.map +1 -0
  700. package/dist/overlay/TourCard.d.ts +23 -0
  701. package/dist/overlay/TourCard.d.ts.map +1 -0
  702. package/dist/overlay/TourCard.js +108 -0
  703. package/dist/overlay/TourCard.js.map +1 -0
  704. package/dist/overlay/TourProvider.cjs +160 -0
  705. package/dist/overlay/TourProvider.cjs.map +1 -0
  706. package/dist/overlay/TourProvider.d.ts +31 -0
  707. package/dist/overlay/TourProvider.d.ts.map +1 -0
  708. package/dist/overlay/TourProvider.js +160 -0
  709. package/dist/overlay/TourProvider.js.map +1 -0
  710. package/dist/overlay/TourSpotlight.cjs +47 -0
  711. package/dist/overlay/TourSpotlight.cjs.map +1 -0
  712. package/dist/overlay/TourSpotlight.d.ts +12 -0
  713. package/dist/overlay/TourSpotlight.d.ts.map +1 -0
  714. package/dist/overlay/TourSpotlight.js +47 -0
  715. package/dist/overlay/TourSpotlight.js.map +1 -0
  716. package/dist/overlay/modalStack.cjs +18 -4
  717. package/dist/overlay/modalStack.cjs.map +1 -1
  718. package/dist/overlay/modalStack.d.ts +10 -2
  719. package/dist/overlay/modalStack.d.ts.map +1 -1
  720. package/dist/overlay/modalStack.js +19 -5
  721. package/dist/overlay/modalStack.js.map +1 -1
  722. package/dist/overlay/tour-anchor.cjs +114 -0
  723. package/dist/overlay/tour-anchor.cjs.map +1 -0
  724. package/dist/overlay/tour-anchor.d.ts +30 -0
  725. package/dist/overlay/tour-anchor.d.ts.map +1 -0
  726. package/dist/overlay/tour-anchor.js +114 -0
  727. package/dist/overlay/tour-anchor.js.map +1 -0
  728. package/dist/overlay/tour-context.cjs +12 -0
  729. package/dist/overlay/tour-context.cjs.map +1 -0
  730. package/dist/overlay/tour-context.d.ts +40 -0
  731. package/dist/overlay/tour-context.d.ts.map +1 -0
  732. package/dist/overlay/tour-context.js +12 -0
  733. package/dist/overlay/tour-context.js.map +1 -0
  734. package/dist/overlay/tour-geometry.cjs +65 -0
  735. package/dist/overlay/tour-geometry.cjs.map +1 -0
  736. package/dist/overlay/tour-geometry.d.ts +47 -0
  737. package/dist/overlay/tour-geometry.d.ts.map +1 -0
  738. package/dist/overlay/tour-geometry.js +65 -0
  739. package/dist/overlay/tour-geometry.js.map +1 -0
  740. package/dist/overlay/tour-model.cjs +79 -0
  741. package/dist/overlay/tour-model.cjs.map +1 -0
  742. package/dist/overlay/tour-model.d.ts +29 -0
  743. package/dist/overlay/tour-model.d.ts.map +1 -0
  744. package/dist/overlay/tour-model.js +79 -0
  745. package/dist/overlay/tour-model.js.map +1 -0
  746. package/dist/overlay/tour-progress.cjs +54 -0
  747. package/dist/overlay/tour-progress.cjs.map +1 -0
  748. package/dist/overlay/tour-progress.d.ts +40 -0
  749. package/dist/overlay/tour-progress.d.ts.map +1 -0
  750. package/dist/overlay/tour-progress.js +54 -0
  751. package/dist/overlay/tour-progress.js.map +1 -0
  752. package/dist/overlay/tour-types.d.ts +144 -0
  753. package/dist/overlay/tour-types.d.ts.map +1 -0
  754. package/dist/overlay/use-tour-anchor.cjs +43 -0
  755. package/dist/overlay/use-tour-anchor.cjs.map +1 -0
  756. package/dist/overlay/use-tour-anchor.d.ts +23 -0
  757. package/dist/overlay/use-tour-anchor.d.ts.map +1 -0
  758. package/dist/overlay/use-tour-anchor.js +43 -0
  759. package/dist/overlay/use-tour-anchor.js.map +1 -0
  760. package/dist/overlay/use-tour-rect.cjs +33 -0
  761. package/dist/overlay/use-tour-rect.cjs.map +1 -0
  762. package/dist/overlay/use-tour-rect.d.ts +12 -0
  763. package/dist/overlay/use-tour-rect.d.ts.map +1 -0
  764. package/dist/overlay/use-tour-rect.js +33 -0
  765. package/dist/overlay/use-tour-rect.js.map +1 -0
  766. package/dist/overlay/use-tour-step.cjs +66 -0
  767. package/dist/overlay/use-tour-step.cjs.map +1 -0
  768. package/dist/overlay/use-tour-step.d.ts +45 -0
  769. package/dist/overlay/use-tour-step.d.ts.map +1 -0
  770. package/dist/overlay/use-tour-step.js +66 -0
  771. package/dist/overlay/use-tour-step.js.map +1 -0
  772. package/dist/overlay/zIndex.cjs +8 -0
  773. package/dist/overlay/zIndex.cjs.map +1 -1
  774. package/dist/overlay/zIndex.d.ts +8 -0
  775. package/dist/overlay/zIndex.d.ts.map +1 -1
  776. package/dist/overlay/zIndex.js +8 -0
  777. package/dist/overlay/zIndex.js.map +1 -1
  778. package/dist/rpc/CommandOutput.cjs +8 -0
  779. package/dist/rpc/CommandOutput.cjs.map +1 -1
  780. package/dist/rpc/CommandOutput.d.ts +4 -1
  781. package/dist/rpc/CommandOutput.d.ts.map +1 -1
  782. package/dist/rpc/CommandOutput.js +8 -0
  783. package/dist/rpc/CommandOutput.js.map +1 -1
  784. package/dist/rpc/EntityExplorerApp.cjs +10 -16
  785. package/dist/rpc/EntityExplorerApp.cjs.map +1 -1
  786. package/dist/rpc/EntityExplorerApp.d.ts.map +1 -1
  787. package/dist/rpc/EntityExplorerApp.js +10 -16
  788. package/dist/rpc/EntityExplorerApp.js.map +1 -1
  789. package/dist/rpc/OperationActionBar.cjs +1 -1
  790. package/dist/rpc/OperationActionBar.cjs.map +1 -1
  791. package/dist/rpc/OperationActionBar.js +1 -1
  792. package/dist/rpc/OperationActionBar.js.map +1 -1
  793. package/dist/rpc/OperationCatalog.cjs +111 -58
  794. package/dist/rpc/OperationCatalog.cjs.map +1 -1
  795. package/dist/rpc/OperationCatalog.d.ts +1 -6
  796. package/dist/rpc/OperationCatalog.d.ts.map +1 -1
  797. package/dist/rpc/OperationCatalog.js +112 -59
  798. package/dist/rpc/OperationCatalog.js.map +1 -1
  799. package/dist/rpc/OperationResultView.cjs +44 -0
  800. package/dist/rpc/OperationResultView.cjs.map +1 -1
  801. package/dist/rpc/OperationResultView.d.ts +8 -1
  802. package/dist/rpc/OperationResultView.d.ts.map +1 -1
  803. package/dist/rpc/OperationResultView.js +44 -0
  804. package/dist/rpc/OperationResultView.js.map +1 -1
  805. package/dist/rpc/SchemaActionForm.cjs +2 -21
  806. package/dist/rpc/SchemaActionForm.cjs.map +1 -1
  807. package/dist/rpc/SchemaActionForm.d.ts.map +1 -1
  808. package/dist/rpc/SchemaActionForm.js +3 -22
  809. package/dist/rpc/SchemaActionForm.js.map +1 -1
  810. package/dist/rpc/apiClient.cjs +16 -2
  811. package/dist/rpc/apiClient.cjs.map +1 -1
  812. package/dist/rpc/apiClient.d.ts.map +1 -1
  813. package/dist/rpc/apiClient.js +16 -2
  814. package/dist/rpc/apiClient.js.map +1 -1
  815. package/dist/rpc/formMetadata.cjs +89 -49
  816. package/dist/rpc/formMetadata.cjs.map +1 -1
  817. package/dist/rpc/formMetadata.d.ts +14 -6
  818. package/dist/rpc/formMetadata.d.ts.map +1 -1
  819. package/dist/rpc/formMetadata.js +87 -47
  820. package/dist/rpc/formMetadata.js.map +1 -1
  821. package/dist/rpc/operationFilterSearch.cjs +23 -0
  822. package/dist/rpc/operationFilterSearch.cjs.map +1 -0
  823. package/dist/rpc/operationFilterSearch.d.ts +22 -0
  824. package/dist/rpc/operationFilterSearch.d.ts.map +1 -0
  825. package/dist/rpc/operationFilterSearch.js +23 -0
  826. package/dist/rpc/operationFilterSearch.js.map +1 -0
  827. package/dist/rpc/operationLookupFetcher.cjs +28 -0
  828. package/dist/rpc/operationLookupFetcher.cjs.map +1 -0
  829. package/dist/rpc/operationLookupFetcher.d.ts +17 -0
  830. package/dist/rpc/operationLookupFetcher.d.ts.map +1 -0
  831. package/dist/rpc/operationLookupFetcher.js +28 -0
  832. package/dist/rpc/operationLookupFetcher.js.map +1 -0
  833. package/dist/rpc/surfaceNav.cjs +77 -0
  834. package/dist/rpc/surfaceNav.cjs.map +1 -0
  835. package/dist/rpc/surfaceNav.d.ts +19 -0
  836. package/dist/rpc/surfaceNav.d.ts.map +1 -0
  837. package/dist/rpc/surfaceNav.js +77 -0
  838. package/dist/rpc/surfaceNav.js.map +1 -0
  839. package/dist/rpc/types.cjs.map +1 -1
  840. package/dist/rpc/types.d.ts +12 -1
  841. package/dist/rpc/types.d.ts.map +1 -1
  842. package/dist/rpc/types.js.map +1 -1
  843. package/dist/rpc.cjs +2 -0
  844. package/dist/rpc.cjs.map +1 -1
  845. package/dist/rpc.d.ts +1 -0
  846. package/dist/rpc.d.ts.map +1 -1
  847. package/dist/rpc.js +2 -0
  848. package/dist/rpc.js.map +1 -1
  849. package/dist/styles.css +1 -1
  850. package/dist/tailwind-preset.cjs +4 -0
  851. package/dist/tailwind-preset.cjs.map +1 -1
  852. package/dist/tailwind-preset.d.ts.map +1 -1
  853. package/dist/tailwind-preset.js +4 -0
  854. package/dist/tailwind-preset.js.map +1 -1
  855. package/dist/utils.cjs +8 -0
  856. package/dist/utils.cjs.map +1 -1
  857. package/dist/utils.d.ts +2 -1
  858. package/dist/utils.d.ts.map +1 -1
  859. package/dist/utils.js +10 -2
  860. package/dist/utils.js.map +1 -1
  861. package/package.json +1 -1
  862. package/dist/data/ai/RuntimeBar.cjs.map +0 -1
  863. package/dist/data/ai/RuntimeBar.d.ts +0 -27
  864. package/dist/data/ai/RuntimeBar.d.ts.map +0 -1
  865. package/dist/data/ai/RuntimeBar.js.map +0 -1
  866. package/dist/data/ai/model-capabilities.cjs.map +0 -1
  867. package/dist/data/ai/model-capabilities.d.ts.map +0 -1
  868. package/dist/data/ai/model-capabilities.js.map +0 -1
  869. package/dist/data/ai/runtime-mode.cjs.map +0 -1
  870. package/dist/data/ai/runtime-mode.d.ts.map +0 -1
  871. package/dist/data/ai/runtime-mode.js.map +0 -1
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const ENVELOPE_KEYS = /* @__PURE__ */ new Set(["output", "isError"]);
4
+ const MAX_UNWRAP_DEPTH = 4;
5
+ function isPlainObject(value) {
6
+ return typeof value === "object" && value !== null && !Array.isArray(value);
7
+ }
8
+ function isOutputEnvelope(value) {
9
+ if (!isPlainObject(value)) return false;
10
+ const keys = Object.keys(value);
11
+ return keys.includes("output") && keys.every((key) => ENVELOPE_KEYS.has(key));
12
+ }
13
+ function parseJsonish(text) {
14
+ const trimmed = text.trim();
15
+ if (!trimmed.startsWith("{") && !trimmed.startsWith("[")) return null;
16
+ try {
17
+ return { parsed: JSON.parse(trimmed) };
18
+ } catch {
19
+ return null;
20
+ }
21
+ }
22
+ function normalizeToolOutput(raw) {
23
+ let value = raw;
24
+ let isError = false;
25
+ for (let depth = 0; depth < MAX_UNWRAP_DEPTH; depth += 1) {
26
+ if (isOutputEnvelope(value)) {
27
+ if (value.isError === true) isError = true;
28
+ value = value.output;
29
+ continue;
30
+ }
31
+ if (typeof value === "string") {
32
+ const parsed = parseJsonish(value);
33
+ if (!parsed) return { value, isError, text: value };
34
+ value = parsed.parsed;
35
+ continue;
36
+ }
37
+ break;
38
+ }
39
+ return { value, isError };
40
+ }
41
+ exports.normalizeToolOutput = normalizeToolOutput;
42
+ //# sourceMappingURL=normalize.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize.cjs","sources":["../../../../src/data/chat/tool-render/normalize.ts"],"sourcesContent":["// L0 of the tool-render pipeline: undo the transport envelope before any\n// renderer sees a tool result.\n//\n// The Go backend (captain/pkg/aichat/events.go) emits a completed tool result\n// as `{\"output\": \"<json string>\", \"isError\"?: true}` — the payload is JSON\n// encoded *twice*. Persisted threads store the same shape, so both the live\n// stream and a reloaded thread need the same unwrap. Nothing downstream should\n// ever have to know about the envelope.\n\nexport type NormalizedToolOutput = {\n /** Envelope-unwrapped, JSON-parsed value. */\n value: unknown;\n /** True when the transport envelope carried `isError: true`. */\n isError: boolean;\n /** The original text when the payload was a string that is not JSON. */\n text?: string;\n};\n\nconst ENVELOPE_KEYS = new Set([\"output\", \"isError\"]);\nconst MAX_UNWRAP_DEPTH = 4;\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/** True for the transport envelope only: an object carrying `output` and\n * nothing beyond `isError`. The subset check is what stops a legitimate\n * record that happens to have an `output` field from being eaten. */\nfunction isOutputEnvelope(value: unknown): value is { output: unknown; isError?: boolean } {\n if (!isPlainObject(value)) return false;\n const keys = Object.keys(value);\n return keys.includes(\"output\") && keys.every((key) => ENVELOPE_KEYS.has(key));\n}\n\nfunction parseJsonish(text: string): { parsed: unknown } | null {\n const trimmed = text.trim();\n if (!trimmed.startsWith(\"{\") && !trimmed.startsWith(\"[\")) return null;\n try {\n return { parsed: JSON.parse(trimmed) as unknown };\n } catch {\n return null;\n }\n}\n\n/** Unwraps the transport `{output, isError}` envelope and parses JSON-looking\n * strings. Identity for anything else — a non-JSON string is returned\n * untouched (and also surfaced as `text`). */\nexport function normalizeToolOutput(raw: unknown): NormalizedToolOutput {\n let value = raw;\n let isError = false;\n\n for (let depth = 0; depth < MAX_UNWRAP_DEPTH; depth += 1) {\n if (isOutputEnvelope(value)) {\n if (value.isError === true) isError = true;\n value = value.output;\n continue;\n }\n if (typeof value === \"string\") {\n const parsed = parseJsonish(value);\n if (!parsed) return { value, isError, text: value };\n value = parsed.parsed;\n continue;\n }\n break;\n }\n\n return { value, isError };\n}\n"],"names":[],"mappings":";;AAkBA,MAAM,gBAAgB,oBAAI,IAAI,CAAC,UAAU,SAAS,CAAC;AACnD,MAAM,mBAAmB;AAEzB,SAAS,cAAc,OAAkD;AACvE,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAKA,SAAS,iBAAiB,OAAiE;AACzF,MAAI,CAAC,cAAc,KAAK,EAAG,QAAO;AAClC,QAAM,OAAO,OAAO,KAAK,KAAK;AAC9B,SAAO,KAAK,SAAS,QAAQ,KAAK,KAAK,MAAM,CAAC,QAAQ,cAAc,IAAI,GAAG,CAAC;AAC9E;AAEA,SAAS,aAAa,MAA0C;AAC9D,QAAM,UAAU,KAAK,KAAA;AACrB,MAAI,CAAC,QAAQ,WAAW,GAAG,KAAK,CAAC,QAAQ,WAAW,GAAG,EAAG,QAAO;AACjE,MAAI;AACF,WAAO,EAAE,QAAQ,KAAK,MAAM,OAAO,EAAA;AAAA,EACrC,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAKO,SAAS,oBAAoB,KAAoC;AACtE,MAAI,QAAQ;AACZ,MAAI,UAAU;AAEd,WAAS,QAAQ,GAAG,QAAQ,kBAAkB,SAAS,GAAG;AACxD,QAAI,iBAAiB,KAAK,GAAG;AAC3B,UAAI,MAAM,YAAY,KAAM,WAAU;AACtC,cAAQ,MAAM;AACd;AAAA,IACF;AACA,QAAI,OAAO,UAAU,UAAU;AAC7B,YAAM,SAAS,aAAa,KAAK;AACjC,UAAI,CAAC,OAAQ,QAAO,EAAE,OAAO,SAAS,MAAM,MAAA;AAC5C,cAAQ,OAAO;AACf;AAAA,IACF;AACA;AAAA,EACF;AAEA,SAAO,EAAE,OAAO,QAAA;AAClB;;"}
@@ -0,0 +1,13 @@
1
+ export type NormalizedToolOutput = {
2
+ /** Envelope-unwrapped, JSON-parsed value. */
3
+ value: unknown;
4
+ /** True when the transport envelope carried `isError: true`. */
5
+ isError: boolean;
6
+ /** The original text when the payload was a string that is not JSON. */
7
+ text?: string;
8
+ };
9
+ /** Unwraps the transport `{output, isError}` envelope and parses JSON-looking
10
+ * strings. Identity for anything else — a non-JSON string is returned
11
+ * untouched (and also surfaced as `text`). */
12
+ export declare function normalizeToolOutput(raw: unknown): NormalizedToolOutput;
13
+ //# sourceMappingURL=normalize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../../src/data/chat/tool-render/normalize.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,oBAAoB,GAAG;IACjC,6CAA6C;IAC7C,KAAK,EAAE,OAAO,CAAC;IACf,gEAAgE;IAChE,OAAO,EAAE,OAAO,CAAC;IACjB,wEAAwE;IACxE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AA4BF;;+CAE+C;AAC/C,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,oBAAoB,CAoBtE"}
@@ -0,0 +1,42 @@
1
+ const ENVELOPE_KEYS = /* @__PURE__ */ new Set(["output", "isError"]);
2
+ const MAX_UNWRAP_DEPTH = 4;
3
+ function isPlainObject(value) {
4
+ return typeof value === "object" && value !== null && !Array.isArray(value);
5
+ }
6
+ function isOutputEnvelope(value) {
7
+ if (!isPlainObject(value)) return false;
8
+ const keys = Object.keys(value);
9
+ return keys.includes("output") && keys.every((key) => ENVELOPE_KEYS.has(key));
10
+ }
11
+ function parseJsonish(text) {
12
+ const trimmed = text.trim();
13
+ if (!trimmed.startsWith("{") && !trimmed.startsWith("[")) return null;
14
+ try {
15
+ return { parsed: JSON.parse(trimmed) };
16
+ } catch {
17
+ return null;
18
+ }
19
+ }
20
+ function normalizeToolOutput(raw) {
21
+ let value = raw;
22
+ let isError = false;
23
+ for (let depth = 0; depth < MAX_UNWRAP_DEPTH; depth += 1) {
24
+ if (isOutputEnvelope(value)) {
25
+ if (value.isError === true) isError = true;
26
+ value = value.output;
27
+ continue;
28
+ }
29
+ if (typeof value === "string") {
30
+ const parsed = parseJsonish(value);
31
+ if (!parsed) return { value, isError, text: value };
32
+ value = parsed.parsed;
33
+ continue;
34
+ }
35
+ break;
36
+ }
37
+ return { value, isError };
38
+ }
39
+ export {
40
+ normalizeToolOutput
41
+ };
42
+ //# sourceMappingURL=normalize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize.js","sources":["../../../../src/data/chat/tool-render/normalize.ts"],"sourcesContent":["// L0 of the tool-render pipeline: undo the transport envelope before any\n// renderer sees a tool result.\n//\n// The Go backend (captain/pkg/aichat/events.go) emits a completed tool result\n// as `{\"output\": \"<json string>\", \"isError\"?: true}` — the payload is JSON\n// encoded *twice*. Persisted threads store the same shape, so both the live\n// stream and a reloaded thread need the same unwrap. Nothing downstream should\n// ever have to know about the envelope.\n\nexport type NormalizedToolOutput = {\n /** Envelope-unwrapped, JSON-parsed value. */\n value: unknown;\n /** True when the transport envelope carried `isError: true`. */\n isError: boolean;\n /** The original text when the payload was a string that is not JSON. */\n text?: string;\n};\n\nconst ENVELOPE_KEYS = new Set([\"output\", \"isError\"]);\nconst MAX_UNWRAP_DEPTH = 4;\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/** True for the transport envelope only: an object carrying `output` and\n * nothing beyond `isError`. The subset check is what stops a legitimate\n * record that happens to have an `output` field from being eaten. */\nfunction isOutputEnvelope(value: unknown): value is { output: unknown; isError?: boolean } {\n if (!isPlainObject(value)) return false;\n const keys = Object.keys(value);\n return keys.includes(\"output\") && keys.every((key) => ENVELOPE_KEYS.has(key));\n}\n\nfunction parseJsonish(text: string): { parsed: unknown } | null {\n const trimmed = text.trim();\n if (!trimmed.startsWith(\"{\") && !trimmed.startsWith(\"[\")) return null;\n try {\n return { parsed: JSON.parse(trimmed) as unknown };\n } catch {\n return null;\n }\n}\n\n/** Unwraps the transport `{output, isError}` envelope and parses JSON-looking\n * strings. Identity for anything else — a non-JSON string is returned\n * untouched (and also surfaced as `text`). */\nexport function normalizeToolOutput(raw: unknown): NormalizedToolOutput {\n let value = raw;\n let isError = false;\n\n for (let depth = 0; depth < MAX_UNWRAP_DEPTH; depth += 1) {\n if (isOutputEnvelope(value)) {\n if (value.isError === true) isError = true;\n value = value.output;\n continue;\n }\n if (typeof value === \"string\") {\n const parsed = parseJsonish(value);\n if (!parsed) return { value, isError, text: value };\n value = parsed.parsed;\n continue;\n }\n break;\n }\n\n return { value, isError };\n}\n"],"names":[],"mappings":"AAkBA,MAAM,gBAAgB,oBAAI,IAAI,CAAC,UAAU,SAAS,CAAC;AACnD,MAAM,mBAAmB;AAEzB,SAAS,cAAc,OAAkD;AACvE,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAKA,SAAS,iBAAiB,OAAiE;AACzF,MAAI,CAAC,cAAc,KAAK,EAAG,QAAO;AAClC,QAAM,OAAO,OAAO,KAAK,KAAK;AAC9B,SAAO,KAAK,SAAS,QAAQ,KAAK,KAAK,MAAM,CAAC,QAAQ,cAAc,IAAI,GAAG,CAAC;AAC9E;AAEA,SAAS,aAAa,MAA0C;AAC9D,QAAM,UAAU,KAAK,KAAA;AACrB,MAAI,CAAC,QAAQ,WAAW,GAAG,KAAK,CAAC,QAAQ,WAAW,GAAG,EAAG,QAAO;AACjE,MAAI;AACF,WAAO,EAAE,QAAQ,KAAK,MAAM,OAAO,EAAA;AAAA,EACrC,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAKO,SAAS,oBAAoB,KAAoC;AACtE,MAAI,QAAQ;AACZ,MAAI,UAAU;AAEd,WAAS,QAAQ,GAAG,QAAQ,kBAAkB,SAAS,GAAG;AACxD,QAAI,iBAAiB,KAAK,GAAG;AAC3B,UAAI,MAAM,YAAY,KAAM,WAAU;AACtC,cAAQ,MAAM;AACd;AAAA,IACF;AACA,QAAI,OAAO,UAAU,UAAU;AAC7B,YAAM,SAAS,aAAa,KAAK;AACjC,UAAI,CAAC,OAAQ,QAAO,EAAE,OAAO,SAAS,MAAM,MAAA;AAC5C,cAAQ,OAAO;AACf;AAAA,IACF;AACA;AAAA,EACF;AAEA,SAAO,EAAE,OAAO,QAAA;AAClB;"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const adapter = require("./adapter.cjs");
4
+ const defaults = require("./defaults.cjs");
5
+ function createToolRenderRegistry(adapters = [], options = {}) {
6
+ return new adapter.ToolRenderRegistry([...adapters, ...defaults.defaultToolRenderAdapters], options);
7
+ }
8
+ function toToolRenderRegistry(input, options = {}) {
9
+ if (input instanceof adapter.ToolRenderRegistry) return input.with(options);
10
+ return createToolRenderRegistry(input ?? [], options);
11
+ }
12
+ exports.createToolRenderRegistry = createToolRenderRegistry;
13
+ exports.toToolRenderRegistry = toToolRenderRegistry;
14
+ //# sourceMappingURL=registry.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.cjs","sources":["../../../../src/data/chat/tool-render/registry.ts"],"sourcesContent":["// Registry factories. Kept apart from adapter.ts so the contract file never\n// has to import the built-in renderers (which would close an import cycle).\n\nimport {\n ToolRenderRegistry,\n type ToolRenderAdapter,\n type ToolRenderRegistryOptions,\n} from \"./adapter\";\nimport { defaultToolRenderAdapters } from \"./defaults\";\n\n/** Host adapters first, the built-in heuristics appended after — hosts win and\n * the defaults are always the floor. */\nexport function createToolRenderRegistry(\n adapters: ToolRenderAdapter[] = [],\n options: ToolRenderRegistryOptions = {},\n): ToolRenderRegistry {\n return new ToolRenderRegistry([...adapters, ...defaultToolRenderAdapters], options);\n}\n\n/** Accepts either form of the `toolRenderers` prop and merges registry options. */\nexport function toToolRenderRegistry(\n input: ToolRenderAdapter[] | ToolRenderRegistry | undefined,\n options: ToolRenderRegistryOptions = {},\n): ToolRenderRegistry {\n if (input instanceof ToolRenderRegistry) return input.with(options);\n return createToolRenderRegistry(input ?? [], options);\n}\n"],"names":["ToolRenderRegistry","defaultToolRenderAdapters"],"mappings":";;;;AAYO,SAAS,yBACd,WAAgC,IAChC,UAAqC,CAAA,GACjB;AACpB,SAAO,IAAIA,QAAAA,mBAAmB,CAAC,GAAG,UAAU,GAAGC,SAAAA,yBAAyB,GAAG,OAAO;AACpF;AAGO,SAAS,qBACd,OACA,UAAqC,IACjB;AACpB,MAAI,iBAAiBD,QAAAA,mBAAoB,QAAO,MAAM,KAAK,OAAO;AAClE,SAAO,yBAAyB,SAAS,CAAA,GAAI,OAAO;AACtD;;;"}
@@ -0,0 +1,7 @@
1
+ import { ToolRenderRegistry, ToolRenderAdapter, ToolRenderRegistryOptions } from './adapter';
2
+ /** Host adapters first, the built-in heuristics appended after — hosts win and
3
+ * the defaults are always the floor. */
4
+ export declare function createToolRenderRegistry(adapters?: ToolRenderAdapter[], options?: ToolRenderRegistryOptions): ToolRenderRegistry;
5
+ /** Accepts either form of the `toolRenderers` prop and merges registry options. */
6
+ export declare function toToolRenderRegistry(input: ToolRenderAdapter[] | ToolRenderRegistry | undefined, options?: ToolRenderRegistryOptions): ToolRenderRegistry;
7
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/data/chat/tool-render/registry.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,kBAAkB,EAClB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC/B,MAAM,WAAW,CAAC;AAGnB;yCACyC;AACzC,wBAAgB,wBAAwB,CACtC,QAAQ,GAAE,iBAAiB,EAAO,EAClC,OAAO,GAAE,yBAA8B,GACtC,kBAAkB,CAEpB;AAED,mFAAmF;AACnF,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,iBAAiB,EAAE,GAAG,kBAAkB,GAAG,SAAS,EAC3D,OAAO,GAAE,yBAA8B,GACtC,kBAAkB,CAGpB"}
@@ -0,0 +1,14 @@
1
+ import { ToolRenderRegistry } from "./adapter.js";
2
+ import { defaultToolRenderAdapters } from "./defaults.js";
3
+ function createToolRenderRegistry(adapters = [], options = {}) {
4
+ return new ToolRenderRegistry([...adapters, ...defaultToolRenderAdapters], options);
5
+ }
6
+ function toToolRenderRegistry(input, options = {}) {
7
+ if (input instanceof ToolRenderRegistry) return input.with(options);
8
+ return createToolRenderRegistry(input ?? [], options);
9
+ }
10
+ export {
11
+ createToolRenderRegistry,
12
+ toToolRenderRegistry
13
+ };
14
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sources":["../../../../src/data/chat/tool-render/registry.ts"],"sourcesContent":["// Registry factories. Kept apart from adapter.ts so the contract file never\n// has to import the built-in renderers (which would close an import cycle).\n\nimport {\n ToolRenderRegistry,\n type ToolRenderAdapter,\n type ToolRenderRegistryOptions,\n} from \"./adapter\";\nimport { defaultToolRenderAdapters } from \"./defaults\";\n\n/** Host adapters first, the built-in heuristics appended after — hosts win and\n * the defaults are always the floor. */\nexport function createToolRenderRegistry(\n adapters: ToolRenderAdapter[] = [],\n options: ToolRenderRegistryOptions = {},\n): ToolRenderRegistry {\n return new ToolRenderRegistry([...adapters, ...defaultToolRenderAdapters], options);\n}\n\n/** Accepts either form of the `toolRenderers` prop and merges registry options. */\nexport function toToolRenderRegistry(\n input: ToolRenderAdapter[] | ToolRenderRegistry | undefined,\n options: ToolRenderRegistryOptions = {},\n): ToolRenderRegistry {\n if (input instanceof ToolRenderRegistry) return input.with(options);\n return createToolRenderRegistry(input ?? [], options);\n}\n"],"names":[],"mappings":";;AAYO,SAAS,yBACd,WAAgC,IAChC,UAAqC,CAAA,GACjB;AACpB,SAAO,IAAI,mBAAmB,CAAC,GAAG,UAAU,GAAG,yBAAyB,GAAG,OAAO;AACpF;AAGO,SAAS,qBACd,OACA,UAAqC,IACjB;AACpB,MAAI,iBAAiB,mBAAoB,QAAO,MAAM,KAAK,OAAO;AAClE,SAAO,yBAAyB,SAAS,CAAA,GAAI,OAAO;AACtD;"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ function propertyType(property) {
4
+ const { type } = property;
5
+ if (typeof type === "string") return type;
6
+ if (Array.isArray(type)) return type.find((entry) => entry !== "null");
7
+ return void 0;
8
+ }
9
+ function enumLabelsOf(property) {
10
+ const labels = property["x-enum-labels"];
11
+ return labels && Object.keys(labels).length > 0 ? labels : void 0;
12
+ }
13
+ function fieldMetaFromSchema(schema) {
14
+ const properties = schema == null ? void 0 : schema.properties;
15
+ if (!properties) return {};
16
+ const required = new Set((schema == null ? void 0 : schema.required) ?? []);
17
+ const explicitOrder = (schema == null ? void 0 : schema["x-order"]) ?? [];
18
+ const fields = {};
19
+ Object.entries(properties).forEach(([key, property], index) => {
20
+ const orderIndex = explicitOrder.indexOf(key);
21
+ const type = propertyType(property);
22
+ const labels = enumLabelsOf(property);
23
+ fields[key] = {
24
+ key,
25
+ label: property.title ?? key,
26
+ required: required.has(key),
27
+ order: orderIndex >= 0 ? orderIndex : explicitOrder.length + index,
28
+ ...property.description ? { description: property.description } : {},
29
+ ...type ? { type } : {},
30
+ ...property.format ? { format: property.format } : {},
31
+ ...labels ? { enumLabels: labels } : {}
32
+ };
33
+ });
34
+ return fields;
35
+ }
36
+ function orderFieldKeys(keys, fields) {
37
+ return [...keys].sort((a, b) => {
38
+ var _a, _b;
39
+ const left = (_a = fields[a]) == null ? void 0 : _a.order;
40
+ const right = (_b = fields[b]) == null ? void 0 : _b.order;
41
+ if (left === void 0 && right === void 0) return 0;
42
+ if (left === void 0) return 1;
43
+ if (right === void 0) return -1;
44
+ return left - right;
45
+ });
46
+ }
47
+ function listItemsSchema(schema) {
48
+ var _a;
49
+ if (!schema) return void 0;
50
+ const data = (_a = schema.properties) == null ? void 0 : _a["data"];
51
+ if (data == null ? void 0 : data.items) return data.items;
52
+ return schema.items;
53
+ }
54
+ exports.fieldMetaFromSchema = fieldMetaFromSchema;
55
+ exports.listItemsSchema = listItemsSchema;
56
+ exports.orderFieldKeys = orderFieldKeys;
57
+ //# sourceMappingURL=schema.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.cjs","sources":["../../../../src/data/chat/tool-render/schema.ts"],"sourcesContent":["// L1 of the tool-render pipeline: per-field metadata mined from a tool's\n// JSON-Schema, when the catalog published one. Every read is optional — tools\n// without a schema (custom, MCP, map-returning ops) fall through to the value\n// heuristics in shape.ts, which is the normal case.\n\nimport type { JsonSchemaObject, JsonSchemaProperty } from \"../../../components/json-schema-form-types\";\nimport type { ChatToolInputSchema } from \"../types\";\n\nexport type ToolFieldMeta = {\n key: string;\n /** `schema.title` when present, else the raw key. Raw keys are deliberate:\n * these are API field names, and a user approving a write op needs the exact\n * name. Humanising them would also break the collapsed/expanded text\n * assertions pinned by ToolCall.test.tsx. */\n label: string;\n description?: string;\n type?: string;\n format?: string;\n enumLabels?: Record<string, string>;\n required: boolean;\n order: number;\n};\n\ntype AnySchema = ChatToolInputSchema | JsonSchemaObject | JsonSchemaProperty;\n\nfunction propertyType(property: JsonSchemaProperty): string | undefined {\n const { type } = property;\n if (typeof type === \"string\") return type;\n if (Array.isArray(type)) return type.find((entry) => entry !== \"null\");\n return undefined;\n}\n\nfunction enumLabelsOf(property: JsonSchemaProperty): Record<string, string> | undefined {\n const labels = property[\"x-enum-labels\"];\n return labels && Object.keys(labels).length > 0 ? labels : undefined;\n}\n\n/** Field metadata keyed by property name. Returns an empty map when no schema\n * (or a schema with no properties) is supplied. */\nexport function fieldMetaFromSchema(schema: AnySchema | undefined): Record<string, ToolFieldMeta> {\n const properties = schema?.properties;\n if (!properties) return {};\n\n const required = new Set(schema?.required ?? []);\n const explicitOrder = schema?.[\"x-order\"] ?? [];\n const fields: Record<string, ToolFieldMeta> = {};\n\n Object.entries(properties).forEach(([key, property], index) => {\n const orderIndex = explicitOrder.indexOf(key);\n const type = propertyType(property);\n const labels = enumLabelsOf(property);\n fields[key] = {\n key,\n label: property.title ?? key,\n required: required.has(key),\n order: orderIndex >= 0 ? orderIndex : explicitOrder.length + index,\n ...(property.description ? { description: property.description } : {}),\n ...(type ? { type } : {}),\n ...(property.format ? { format: property.format } : {}),\n ...(labels ? { enumLabels: labels } : {}),\n };\n });\n\n return fields;\n}\n\n/** Orders keys by the schema's declared order (`x-order`, then property order),\n * leaving keys the schema does not know about in their original order after. */\nexport function orderFieldKeys(keys: string[], fields: Record<string, ToolFieldMeta>): string[] {\n return [...keys].sort((a, b) => {\n const left = fields[a]?.order;\n const right = fields[b]?.order;\n if (left === undefined && right === undefined) return 0;\n if (left === undefined) return 1;\n if (right === undefined) return -1;\n return left - right;\n });\n}\n\n/** The item schema behind a list result: the clicky `PagedResult` envelope's\n * `properties.data.items`, or a bare array schema's `items`. */\nexport function listItemsSchema(schema: AnySchema | undefined): JsonSchemaProperty | undefined {\n if (!schema) return undefined;\n const data = schema.properties?.[\"data\"];\n if (data?.items) return data.items;\n return schema.items;\n}\n"],"names":[],"mappings":";;AAyBA,SAAS,aAAa,UAAkD;AACtE,QAAM,EAAE,SAAS;AACjB,MAAI,OAAO,SAAS,SAAU,QAAO;AACrC,MAAI,MAAM,QAAQ,IAAI,EAAG,QAAO,KAAK,KAAK,CAAC,UAAU,UAAU,MAAM;AACrE,SAAO;AACT;AAEA,SAAS,aAAa,UAAkE;AACtF,QAAM,SAAS,SAAS,eAAe;AACvC,SAAO,UAAU,OAAO,KAAK,MAAM,EAAE,SAAS,IAAI,SAAS;AAC7D;AAIO,SAAS,oBAAoB,QAA8D;AAChG,QAAM,aAAa,iCAAQ;AAC3B,MAAI,CAAC,WAAY,QAAO,CAAA;AAExB,QAAM,WAAW,IAAI,KAAI,iCAAQ,aAAY,CAAA,CAAE;AAC/C,QAAM,iBAAgB,iCAAS,eAAc,CAAA;AAC7C,QAAM,SAAwC,CAAA;AAE9C,SAAO,QAAQ,UAAU,EAAE,QAAQ,CAAC,CAAC,KAAK,QAAQ,GAAG,UAAU;AAC7D,UAAM,aAAa,cAAc,QAAQ,GAAG;AAC5C,UAAM,OAAO,aAAa,QAAQ;AAClC,UAAM,SAAS,aAAa,QAAQ;AACpC,WAAO,GAAG,IAAI;AAAA,MACZ;AAAA,MACA,OAAO,SAAS,SAAS;AAAA,MACzB,UAAU,SAAS,IAAI,GAAG;AAAA,MAC1B,OAAO,cAAc,IAAI,aAAa,cAAc,SAAS;AAAA,MAC7D,GAAI,SAAS,cAAc,EAAE,aAAa,SAAS,YAAA,IAAgB,CAAA;AAAA,MACnE,GAAI,OAAO,EAAE,KAAA,IAAS,CAAA;AAAA,MACtB,GAAI,SAAS,SAAS,EAAE,QAAQ,SAAS,OAAA,IAAW,CAAA;AAAA,MACpD,GAAI,SAAS,EAAE,YAAY,WAAW,CAAA;AAAA,IAAC;AAAA,EAE3C,CAAC;AAED,SAAO;AACT;AAIO,SAAS,eAAe,MAAgB,QAAiD;AAC9F,SAAO,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,MAAM;;AAC9B,UAAM,QAAO,YAAO,CAAC,MAAR,mBAAW;AACxB,UAAM,SAAQ,YAAO,CAAC,MAAR,mBAAW;AACzB,QAAI,SAAS,UAAa,UAAU,OAAW,QAAO;AACtD,QAAI,SAAS,OAAW,QAAO;AAC/B,QAAI,UAAU,OAAW,QAAO;AAChC,WAAO,OAAO;AAAA,EAChB,CAAC;AACH;AAIO,SAAS,gBAAgB,QAA+D;;AAC7F,MAAI,CAAC,OAAQ,QAAO;AACpB,QAAM,QAAO,YAAO,eAAP,mBAAoB;AACjC,MAAI,6BAAM,MAAO,QAAO,KAAK;AAC7B,SAAO,OAAO;AAChB;;;;"}
@@ -0,0 +1,28 @@
1
+ import { JsonSchemaObject, JsonSchemaProperty } from '../../../components/json-schema-form-types';
2
+ import { ChatToolInputSchema } from '../types';
3
+ export type ToolFieldMeta = {
4
+ key: string;
5
+ /** `schema.title` when present, else the raw key. Raw keys are deliberate:
6
+ * these are API field names, and a user approving a write op needs the exact
7
+ * name. Humanising them would also break the collapsed/expanded text
8
+ * assertions pinned by ToolCall.test.tsx. */
9
+ label: string;
10
+ description?: string;
11
+ type?: string;
12
+ format?: string;
13
+ enumLabels?: Record<string, string>;
14
+ required: boolean;
15
+ order: number;
16
+ };
17
+ type AnySchema = ChatToolInputSchema | JsonSchemaObject | JsonSchemaProperty;
18
+ /** Field metadata keyed by property name. Returns an empty map when no schema
19
+ * (or a schema with no properties) is supplied. */
20
+ export declare function fieldMetaFromSchema(schema: AnySchema | undefined): Record<string, ToolFieldMeta>;
21
+ /** Orders keys by the schema's declared order (`x-order`, then property order),
22
+ * leaving keys the schema does not know about in their original order after. */
23
+ export declare function orderFieldKeys(keys: string[], fields: Record<string, ToolFieldMeta>): string[];
24
+ /** The item schema behind a list result: the clicky `PagedResult` envelope's
25
+ * `properties.data.items`, or a bare array schema's `items`. */
26
+ export declare function listItemsSchema(schema: AnySchema | undefined): JsonSchemaProperty | undefined;
27
+ export {};
28
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/data/chat/tool-render/schema.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AACvG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ;;;kDAG8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,SAAS,GAAG,mBAAmB,GAAG,gBAAgB,GAAG,kBAAkB,CAAC;AAc7E;oDACoD;AACpD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAyBhG;AAED;iFACiF;AACjF,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,MAAM,EAAE,CAS9F;AAED;iEACiE;AACjE,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,kBAAkB,GAAG,SAAS,CAK7F"}
@@ -0,0 +1,57 @@
1
+ function propertyType(property) {
2
+ const { type } = property;
3
+ if (typeof type === "string") return type;
4
+ if (Array.isArray(type)) return type.find((entry) => entry !== "null");
5
+ return void 0;
6
+ }
7
+ function enumLabelsOf(property) {
8
+ const labels = property["x-enum-labels"];
9
+ return labels && Object.keys(labels).length > 0 ? labels : void 0;
10
+ }
11
+ function fieldMetaFromSchema(schema) {
12
+ const properties = schema == null ? void 0 : schema.properties;
13
+ if (!properties) return {};
14
+ const required = new Set((schema == null ? void 0 : schema.required) ?? []);
15
+ const explicitOrder = (schema == null ? void 0 : schema["x-order"]) ?? [];
16
+ const fields = {};
17
+ Object.entries(properties).forEach(([key, property], index) => {
18
+ const orderIndex = explicitOrder.indexOf(key);
19
+ const type = propertyType(property);
20
+ const labels = enumLabelsOf(property);
21
+ fields[key] = {
22
+ key,
23
+ label: property.title ?? key,
24
+ required: required.has(key),
25
+ order: orderIndex >= 0 ? orderIndex : explicitOrder.length + index,
26
+ ...property.description ? { description: property.description } : {},
27
+ ...type ? { type } : {},
28
+ ...property.format ? { format: property.format } : {},
29
+ ...labels ? { enumLabels: labels } : {}
30
+ };
31
+ });
32
+ return fields;
33
+ }
34
+ function orderFieldKeys(keys, fields) {
35
+ return [...keys].sort((a, b) => {
36
+ var _a, _b;
37
+ const left = (_a = fields[a]) == null ? void 0 : _a.order;
38
+ const right = (_b = fields[b]) == null ? void 0 : _b.order;
39
+ if (left === void 0 && right === void 0) return 0;
40
+ if (left === void 0) return 1;
41
+ if (right === void 0) return -1;
42
+ return left - right;
43
+ });
44
+ }
45
+ function listItemsSchema(schema) {
46
+ var _a;
47
+ if (!schema) return void 0;
48
+ const data = (_a = schema.properties) == null ? void 0 : _a["data"];
49
+ if (data == null ? void 0 : data.items) return data.items;
50
+ return schema.items;
51
+ }
52
+ export {
53
+ fieldMetaFromSchema,
54
+ listItemsSchema,
55
+ orderFieldKeys
56
+ };
57
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sources":["../../../../src/data/chat/tool-render/schema.ts"],"sourcesContent":["// L1 of the tool-render pipeline: per-field metadata mined from a tool's\n// JSON-Schema, when the catalog published one. Every read is optional — tools\n// without a schema (custom, MCP, map-returning ops) fall through to the value\n// heuristics in shape.ts, which is the normal case.\n\nimport type { JsonSchemaObject, JsonSchemaProperty } from \"../../../components/json-schema-form-types\";\nimport type { ChatToolInputSchema } from \"../types\";\n\nexport type ToolFieldMeta = {\n key: string;\n /** `schema.title` when present, else the raw key. Raw keys are deliberate:\n * these are API field names, and a user approving a write op needs the exact\n * name. Humanising them would also break the collapsed/expanded text\n * assertions pinned by ToolCall.test.tsx. */\n label: string;\n description?: string;\n type?: string;\n format?: string;\n enumLabels?: Record<string, string>;\n required: boolean;\n order: number;\n};\n\ntype AnySchema = ChatToolInputSchema | JsonSchemaObject | JsonSchemaProperty;\n\nfunction propertyType(property: JsonSchemaProperty): string | undefined {\n const { type } = property;\n if (typeof type === \"string\") return type;\n if (Array.isArray(type)) return type.find((entry) => entry !== \"null\");\n return undefined;\n}\n\nfunction enumLabelsOf(property: JsonSchemaProperty): Record<string, string> | undefined {\n const labels = property[\"x-enum-labels\"];\n return labels && Object.keys(labels).length > 0 ? labels : undefined;\n}\n\n/** Field metadata keyed by property name. Returns an empty map when no schema\n * (or a schema with no properties) is supplied. */\nexport function fieldMetaFromSchema(schema: AnySchema | undefined): Record<string, ToolFieldMeta> {\n const properties = schema?.properties;\n if (!properties) return {};\n\n const required = new Set(schema?.required ?? []);\n const explicitOrder = schema?.[\"x-order\"] ?? [];\n const fields: Record<string, ToolFieldMeta> = {};\n\n Object.entries(properties).forEach(([key, property], index) => {\n const orderIndex = explicitOrder.indexOf(key);\n const type = propertyType(property);\n const labels = enumLabelsOf(property);\n fields[key] = {\n key,\n label: property.title ?? key,\n required: required.has(key),\n order: orderIndex >= 0 ? orderIndex : explicitOrder.length + index,\n ...(property.description ? { description: property.description } : {}),\n ...(type ? { type } : {}),\n ...(property.format ? { format: property.format } : {}),\n ...(labels ? { enumLabels: labels } : {}),\n };\n });\n\n return fields;\n}\n\n/** Orders keys by the schema's declared order (`x-order`, then property order),\n * leaving keys the schema does not know about in their original order after. */\nexport function orderFieldKeys(keys: string[], fields: Record<string, ToolFieldMeta>): string[] {\n return [...keys].sort((a, b) => {\n const left = fields[a]?.order;\n const right = fields[b]?.order;\n if (left === undefined && right === undefined) return 0;\n if (left === undefined) return 1;\n if (right === undefined) return -1;\n return left - right;\n });\n}\n\n/** The item schema behind a list result: the clicky `PagedResult` envelope's\n * `properties.data.items`, or a bare array schema's `items`. */\nexport function listItemsSchema(schema: AnySchema | undefined): JsonSchemaProperty | undefined {\n if (!schema) return undefined;\n const data = schema.properties?.[\"data\"];\n if (data?.items) return data.items;\n return schema.items;\n}\n"],"names":[],"mappings":"AAyBA,SAAS,aAAa,UAAkD;AACtE,QAAM,EAAE,SAAS;AACjB,MAAI,OAAO,SAAS,SAAU,QAAO;AACrC,MAAI,MAAM,QAAQ,IAAI,EAAG,QAAO,KAAK,KAAK,CAAC,UAAU,UAAU,MAAM;AACrE,SAAO;AACT;AAEA,SAAS,aAAa,UAAkE;AACtF,QAAM,SAAS,SAAS,eAAe;AACvC,SAAO,UAAU,OAAO,KAAK,MAAM,EAAE,SAAS,IAAI,SAAS;AAC7D;AAIO,SAAS,oBAAoB,QAA8D;AAChG,QAAM,aAAa,iCAAQ;AAC3B,MAAI,CAAC,WAAY,QAAO,CAAA;AAExB,QAAM,WAAW,IAAI,KAAI,iCAAQ,aAAY,CAAA,CAAE;AAC/C,QAAM,iBAAgB,iCAAS,eAAc,CAAA;AAC7C,QAAM,SAAwC,CAAA;AAE9C,SAAO,QAAQ,UAAU,EAAE,QAAQ,CAAC,CAAC,KAAK,QAAQ,GAAG,UAAU;AAC7D,UAAM,aAAa,cAAc,QAAQ,GAAG;AAC5C,UAAM,OAAO,aAAa,QAAQ;AAClC,UAAM,SAAS,aAAa,QAAQ;AACpC,WAAO,GAAG,IAAI;AAAA,MACZ;AAAA,MACA,OAAO,SAAS,SAAS;AAAA,MACzB,UAAU,SAAS,IAAI,GAAG;AAAA,MAC1B,OAAO,cAAc,IAAI,aAAa,cAAc,SAAS;AAAA,MAC7D,GAAI,SAAS,cAAc,EAAE,aAAa,SAAS,YAAA,IAAgB,CAAA;AAAA,MACnE,GAAI,OAAO,EAAE,KAAA,IAAS,CAAA;AAAA,MACtB,GAAI,SAAS,SAAS,EAAE,QAAQ,SAAS,OAAA,IAAW,CAAA;AAAA,MACpD,GAAI,SAAS,EAAE,YAAY,WAAW,CAAA;AAAA,IAAC;AAAA,EAE3C,CAAC;AAED,SAAO;AACT;AAIO,SAAS,eAAe,MAAgB,QAAiD;AAC9F,SAAO,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,MAAM;AA5ClC;AA6CI,UAAM,QAAO,YAAO,CAAC,MAAR,mBAAW;AACxB,UAAM,SAAQ,YAAO,CAAC,MAAR,mBAAW;AACzB,QAAI,SAAS,UAAa,UAAU,OAAW,QAAO;AACtD,QAAI,SAAS,OAAW,QAAO;AAC/B,QAAI,UAAU,OAAW,QAAO;AAChC,WAAO,OAAO;AAAA,EAChB,CAAC;AACH;AAIO,SAAS,gBAAgB,QAA+D;AAxD/F;AAyDE,MAAI,CAAC,OAAQ,QAAO;AACpB,QAAM,QAAO,YAAO,eAAP,mBAAoB;AACjC,MAAI,6BAAM,MAAO,QAAO,KAAK;AAC7B,SAAO,OAAO;AAChB;"}
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const COLUMN_SCAN_ROWS = 50;
4
+ const DEFAULT_MAX_COLUMNS = 8;
5
+ const CELL_TEXT_LIMIT = 80;
6
+ const LEADING_KEYS = ["id", "code", "name", "title"];
7
+ function isPlainObject(value) {
8
+ return typeof value === "object" && value !== null && !Array.isArray(value);
9
+ }
10
+ function objectRows(items) {
11
+ return items.every(isPlainObject) ? items : null;
12
+ }
13
+ function numberField(source, key) {
14
+ const value = source[key];
15
+ return typeof value === "number" ? value : void 0;
16
+ }
17
+ function pageInfo(value) {
18
+ const page = isPlainObject(value["page"]) ? value["page"] : value;
19
+ const limit = numberField(page, "limit");
20
+ const offset = numberField(page, "offset");
21
+ const total = numberField(page, "total");
22
+ if (limit === void 0 && offset === void 0 && total === void 0) return null;
23
+ return {
24
+ ...limit !== void 0 ? { limit } : {},
25
+ ...offset !== void 0 ? { offset } : {},
26
+ ...total !== void 0 ? { total } : {}
27
+ };
28
+ }
29
+ function classifyToolValue(value) {
30
+ if (value === void 0 || value === null) return { shape: "empty" };
31
+ if (typeof value === "string") {
32
+ return value.trim() === "" ? { shape: "empty" } : { shape: "scalar", value };
33
+ }
34
+ if (typeof value === "number" || typeof value === "boolean") {
35
+ return { shape: "scalar", value };
36
+ }
37
+ if (Array.isArray(value)) {
38
+ if (value.length === 0) return { shape: "empty" };
39
+ return { shape: "list", items: value, rows: objectRows(value) };
40
+ }
41
+ if (!isPlainObject(value)) return { shape: "empty" };
42
+ const keys = Object.keys(value);
43
+ if (keys.length === 0) return { shape: "empty" };
44
+ const data = value["data"];
45
+ if (Array.isArray(data)) {
46
+ const page = pageInfo(value);
47
+ if (page) return { shape: "paged", items: data, rows: objectRows(data), page };
48
+ return { shape: "list", items: data, rows: objectRows(data) };
49
+ }
50
+ if (keys.every((key) => typeof value[key] === "number")) {
51
+ return { shape: "counts", record: value };
52
+ }
53
+ return { shape: "record", record: value };
54
+ }
55
+ function cellText(value) {
56
+ if (value === null || value === void 0) return "";
57
+ if (typeof value === "string") return value;
58
+ if (typeof value === "number" || typeof value === "boolean") return String(value);
59
+ const text = JSON.stringify(value) ?? "";
60
+ return text.length > CELL_TEXT_LIMIT ? `${text.slice(0, CELL_TEXT_LIMIT)}…` : text;
61
+ }
62
+ function isTimestampKey(key, field) {
63
+ if ((field == null ? void 0 : field.format) === "date-time" || (field == null ? void 0 : field.format) === "date") return true;
64
+ return /(_at|At|date|Date)$/.test(key);
65
+ }
66
+ function columnRank(key) {
67
+ const index = LEADING_KEYS.indexOf(key);
68
+ return index >= 0 ? index : LEADING_KEYS.length;
69
+ }
70
+ function deriveColumns(rows, options = {}) {
71
+ const fields = options.fields ?? {};
72
+ const max = options.max ?? DEFAULT_MAX_COLUMNS;
73
+ const keys = [];
74
+ for (const row of rows.slice(0, COLUMN_SCAN_ROWS)) {
75
+ for (const key of Object.keys(row)) {
76
+ if (!keys.includes(key)) keys.push(key);
77
+ }
78
+ }
79
+ return keys.sort((a, b) => columnRank(a) - columnRank(b)).slice(0, max).map((key) => {
80
+ const field = fields[key];
81
+ const timestamp = isTimestampKey(key, field);
82
+ const allNumeric = rows.every((row) => row[key] === void 0 || typeof row[key] === "number");
83
+ return {
84
+ key,
85
+ label: (field == null ? void 0 : field.label) ?? key,
86
+ // `kind` supplies DataTable's own renderer, so only stringify otherwise.
87
+ ...timestamp ? { kind: "timestamp" } : { render: (value) => cellText(value) },
88
+ ...allNumeric ? { align: "right" } : {}
89
+ };
90
+ });
91
+ }
92
+ exports.classifyToolValue = classifyToolValue;
93
+ exports.deriveColumns = deriveColumns;
94
+ //# sourceMappingURL=shape.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shape.cjs","sources":["../../../../src/data/chat/tool-render/shape.ts"],"sourcesContent":["// L2 of the tool-render pipeline: classify a tool result by its value alone,\n// so tools with no published schema still render as something better than a\n// JSON blob. The shapes mirror what clicky operations actually return: a\n// PagedResult envelope, a bare list, one record, a bag of counts, or a scalar.\n\nimport type { DataTableColumn } from \"../../DataTable\";\nimport type { ToolFieldMeta } from \"./schema\";\n\nexport type ToolValueShape = \"paged\" | \"list\" | \"record\" | \"counts\" | \"scalar\" | \"empty\";\n\nexport type ToolPageInfo = { limit?: number; offset?: number; total?: number };\n\nexport type ClassifiedToolValue =\n | { shape: \"empty\" }\n | { shape: \"scalar\"; value: string | number | boolean }\n | { shape: \"counts\"; record: Record<string, number> }\n | { shape: \"record\"; record: Record<string, unknown> }\n | { shape: \"list\"; items: unknown[]; rows: Record<string, unknown>[] | null }\n | { shape: \"paged\"; items: unknown[]; rows: Record<string, unknown>[] | null; page: ToolPageInfo };\n\nconst COLUMN_SCAN_ROWS = 50;\nconst DEFAULT_MAX_COLUMNS = 8;\nconst CELL_TEXT_LIMIT = 80;\nconst LEADING_KEYS = [\"id\", \"code\", \"name\", \"title\"];\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction objectRows(items: unknown[]): Record<string, unknown>[] | null {\n return items.every(isPlainObject) ? (items as Record<string, unknown>[]) : null;\n}\n\nfunction numberField(source: Record<string, unknown>, key: string): number | undefined {\n const value = source[key];\n return typeof value === \"number\" ? value : undefined;\n}\n\nfunction pageInfo(value: Record<string, unknown>): ToolPageInfo | null {\n const page = isPlainObject(value[\"page\"]) ? value[\"page\"] : value;\n const limit = numberField(page, \"limit\");\n const offset = numberField(page, \"offset\");\n const total = numberField(page, \"total\");\n if (limit === undefined && offset === undefined && total === undefined) return null;\n return {\n ...(limit !== undefined ? { limit } : {}),\n ...(offset !== undefined ? { offset } : {}),\n ...(total !== undefined ? { total } : {}),\n };\n}\n\n/** Classify a normalized tool result. Ordering matters: the paged envelope is\n * checked before the generic record, and an all-numeric record before it. */\nexport function classifyToolValue(value: unknown): ClassifiedToolValue {\n if (value === undefined || value === null) return { shape: \"empty\" };\n\n if (typeof value === \"string\") {\n return value.trim() === \"\" ? { shape: \"empty\" } : { shape: \"scalar\", value };\n }\n if (typeof value === \"number\" || typeof value === \"boolean\") {\n return { shape: \"scalar\", value };\n }\n\n if (Array.isArray(value)) {\n if (value.length === 0) return { shape: \"empty\" };\n return { shape: \"list\", items: value, rows: objectRows(value) };\n }\n\n if (!isPlainObject(value)) return { shape: \"empty\" };\n\n const keys = Object.keys(value);\n if (keys.length === 0) return { shape: \"empty\" };\n\n const data = value[\"data\"];\n if (Array.isArray(data)) {\n const page = pageInfo(value);\n if (page) return { shape: \"paged\", items: data, rows: objectRows(data), page };\n return { shape: \"list\", items: data, rows: objectRows(data) };\n }\n\n if (keys.every((key) => typeof value[key] === \"number\")) {\n return { shape: \"counts\", record: value as Record<string, number> };\n }\n\n return { shape: \"record\", record: value };\n}\n\nfunction cellText(value: unknown): string {\n if (value === null || value === undefined) return \"\";\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n const text = JSON.stringify(value) ?? \"\";\n return text.length > CELL_TEXT_LIMIT ? `${text.slice(0, CELL_TEXT_LIMIT)}…` : text;\n}\n\nfunction isTimestampKey(key: string, field?: ToolFieldMeta): boolean {\n if (field?.format === \"date-time\" || field?.format === \"date\") return true;\n return /(_at|At|date|Date)$/.test(key);\n}\n\nfunction columnRank(key: string): number {\n const index = LEADING_KEYS.indexOf(key);\n return index >= 0 ? index : LEADING_KEYS.length;\n}\n\n/** Columns derived from the union of row keys, capped so a wide record does not\n * blow out a chat bubble. Labels come from the schema when one was published. */\nexport function deriveColumns(\n rows: Record<string, unknown>[],\n options: { fields?: Record<string, ToolFieldMeta> | undefined; max?: number | undefined } = {},\n): DataTableColumn<Record<string, unknown>>[] {\n const fields = options.fields ?? {};\n const max = options.max ?? DEFAULT_MAX_COLUMNS;\n\n const keys: string[] = [];\n for (const row of rows.slice(0, COLUMN_SCAN_ROWS)) {\n for (const key of Object.keys(row)) {\n if (!keys.includes(key)) keys.push(key);\n }\n }\n\n return keys\n .sort((a, b) => columnRank(a) - columnRank(b))\n .slice(0, max)\n .map((key) => {\n const field = fields[key];\n const timestamp = isTimestampKey(key, field);\n const allNumeric = rows.every((row) => row[key] === undefined || typeof row[key] === \"number\");\n return {\n key,\n label: field?.label ?? key,\n // `kind` supplies DataTable's own renderer, so only stringify otherwise.\n ...(timestamp\n ? { kind: \"timestamp\" as const }\n : { render: (value: unknown) => cellText(value) }),\n ...(allNumeric ? { align: \"right\" as const } : {}),\n };\n });\n}\n"],"names":[],"mappings":"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"}
@@ -0,0 +1,39 @@
1
+ import { DataTableColumn } from '../../DataTable';
2
+ import { ToolFieldMeta } from './schema';
3
+ export type ToolValueShape = "paged" | "list" | "record" | "counts" | "scalar" | "empty";
4
+ export type ToolPageInfo = {
5
+ limit?: number;
6
+ offset?: number;
7
+ total?: number;
8
+ };
9
+ export type ClassifiedToolValue = {
10
+ shape: "empty";
11
+ } | {
12
+ shape: "scalar";
13
+ value: string | number | boolean;
14
+ } | {
15
+ shape: "counts";
16
+ record: Record<string, number>;
17
+ } | {
18
+ shape: "record";
19
+ record: Record<string, unknown>;
20
+ } | {
21
+ shape: "list";
22
+ items: unknown[];
23
+ rows: Record<string, unknown>[] | null;
24
+ } | {
25
+ shape: "paged";
26
+ items: unknown[];
27
+ rows: Record<string, unknown>[] | null;
28
+ page: ToolPageInfo;
29
+ };
30
+ /** Classify a normalized tool result. Ordering matters: the paged envelope is
31
+ * checked before the generic record, and an all-numeric record before it. */
32
+ export declare function classifyToolValue(value: unknown): ClassifiedToolValue;
33
+ /** Columns derived from the union of row keys, capped so a wide record does not
34
+ * blow out a chat bubble. Labels come from the schema when one was published. */
35
+ export declare function deriveColumns(rows: Record<string, unknown>[], options?: {
36
+ fields?: Record<string, ToolFieldMeta> | undefined;
37
+ max?: number | undefined;
38
+ }): DataTableColumn<Record<string, unknown>>[];
39
+ //# sourceMappingURL=shape.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shape.d.ts","sourceRoot":"","sources":["../../../../src/data/chat/tool-render/shape.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEzF,MAAM,MAAM,YAAY,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/E,MAAM,MAAM,mBAAmB,GAC3B;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,GAClB;IAAE,KAAK,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;CAAE,GACrD;IAAE,KAAK,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GACnD;IAAE,KAAK,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GACpD;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,EAAE,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,IAAI,CAAA;CAAE,GAC3E;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,EAAE,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC;IAAC,IAAI,EAAE,YAAY,CAAA;CAAE,CAAC;AAiCrG;8EAC8E;AAC9E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,mBAAmB,CAgCrE;AAoBD;kFACkF;AAClF,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAC/B,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,SAAS,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAO,GAC7F,eAAe,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CA4B5C"}
@@ -0,0 +1,94 @@
1
+ const COLUMN_SCAN_ROWS = 50;
2
+ const DEFAULT_MAX_COLUMNS = 8;
3
+ const CELL_TEXT_LIMIT = 80;
4
+ const LEADING_KEYS = ["id", "code", "name", "title"];
5
+ function isPlainObject(value) {
6
+ return typeof value === "object" && value !== null && !Array.isArray(value);
7
+ }
8
+ function objectRows(items) {
9
+ return items.every(isPlainObject) ? items : null;
10
+ }
11
+ function numberField(source, key) {
12
+ const value = source[key];
13
+ return typeof value === "number" ? value : void 0;
14
+ }
15
+ function pageInfo(value) {
16
+ const page = isPlainObject(value["page"]) ? value["page"] : value;
17
+ const limit = numberField(page, "limit");
18
+ const offset = numberField(page, "offset");
19
+ const total = numberField(page, "total");
20
+ if (limit === void 0 && offset === void 0 && total === void 0) return null;
21
+ return {
22
+ ...limit !== void 0 ? { limit } : {},
23
+ ...offset !== void 0 ? { offset } : {},
24
+ ...total !== void 0 ? { total } : {}
25
+ };
26
+ }
27
+ function classifyToolValue(value) {
28
+ if (value === void 0 || value === null) return { shape: "empty" };
29
+ if (typeof value === "string") {
30
+ return value.trim() === "" ? { shape: "empty" } : { shape: "scalar", value };
31
+ }
32
+ if (typeof value === "number" || typeof value === "boolean") {
33
+ return { shape: "scalar", value };
34
+ }
35
+ if (Array.isArray(value)) {
36
+ if (value.length === 0) return { shape: "empty" };
37
+ return { shape: "list", items: value, rows: objectRows(value) };
38
+ }
39
+ if (!isPlainObject(value)) return { shape: "empty" };
40
+ const keys = Object.keys(value);
41
+ if (keys.length === 0) return { shape: "empty" };
42
+ const data = value["data"];
43
+ if (Array.isArray(data)) {
44
+ const page = pageInfo(value);
45
+ if (page) return { shape: "paged", items: data, rows: objectRows(data), page };
46
+ return { shape: "list", items: data, rows: objectRows(data) };
47
+ }
48
+ if (keys.every((key) => typeof value[key] === "number")) {
49
+ return { shape: "counts", record: value };
50
+ }
51
+ return { shape: "record", record: value };
52
+ }
53
+ function cellText(value) {
54
+ if (value === null || value === void 0) return "";
55
+ if (typeof value === "string") return value;
56
+ if (typeof value === "number" || typeof value === "boolean") return String(value);
57
+ const text = JSON.stringify(value) ?? "";
58
+ return text.length > CELL_TEXT_LIMIT ? `${text.slice(0, CELL_TEXT_LIMIT)}…` : text;
59
+ }
60
+ function isTimestampKey(key, field) {
61
+ if ((field == null ? void 0 : field.format) === "date-time" || (field == null ? void 0 : field.format) === "date") return true;
62
+ return /(_at|At|date|Date)$/.test(key);
63
+ }
64
+ function columnRank(key) {
65
+ const index = LEADING_KEYS.indexOf(key);
66
+ return index >= 0 ? index : LEADING_KEYS.length;
67
+ }
68
+ function deriveColumns(rows, options = {}) {
69
+ const fields = options.fields ?? {};
70
+ const max = options.max ?? DEFAULT_MAX_COLUMNS;
71
+ const keys = [];
72
+ for (const row of rows.slice(0, COLUMN_SCAN_ROWS)) {
73
+ for (const key of Object.keys(row)) {
74
+ if (!keys.includes(key)) keys.push(key);
75
+ }
76
+ }
77
+ return keys.sort((a, b) => columnRank(a) - columnRank(b)).slice(0, max).map((key) => {
78
+ const field = fields[key];
79
+ const timestamp = isTimestampKey(key, field);
80
+ const allNumeric = rows.every((row) => row[key] === void 0 || typeof row[key] === "number");
81
+ return {
82
+ key,
83
+ label: (field == null ? void 0 : field.label) ?? key,
84
+ // `kind` supplies DataTable's own renderer, so only stringify otherwise.
85
+ ...timestamp ? { kind: "timestamp" } : { render: (value) => cellText(value) },
86
+ ...allNumeric ? { align: "right" } : {}
87
+ };
88
+ });
89
+ }
90
+ export {
91
+ classifyToolValue,
92
+ deriveColumns
93
+ };
94
+ //# sourceMappingURL=shape.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shape.js","sources":["../../../../src/data/chat/tool-render/shape.ts"],"sourcesContent":["// L2 of the tool-render pipeline: classify a tool result by its value alone,\n// so tools with no published schema still render as something better than a\n// JSON blob. The shapes mirror what clicky operations actually return: a\n// PagedResult envelope, a bare list, one record, a bag of counts, or a scalar.\n\nimport type { DataTableColumn } from \"../../DataTable\";\nimport type { ToolFieldMeta } from \"./schema\";\n\nexport type ToolValueShape = \"paged\" | \"list\" | \"record\" | \"counts\" | \"scalar\" | \"empty\";\n\nexport type ToolPageInfo = { limit?: number; offset?: number; total?: number };\n\nexport type ClassifiedToolValue =\n | { shape: \"empty\" }\n | { shape: \"scalar\"; value: string | number | boolean }\n | { shape: \"counts\"; record: Record<string, number> }\n | { shape: \"record\"; record: Record<string, unknown> }\n | { shape: \"list\"; items: unknown[]; rows: Record<string, unknown>[] | null }\n | { shape: \"paged\"; items: unknown[]; rows: Record<string, unknown>[] | null; page: ToolPageInfo };\n\nconst COLUMN_SCAN_ROWS = 50;\nconst DEFAULT_MAX_COLUMNS = 8;\nconst CELL_TEXT_LIMIT = 80;\nconst LEADING_KEYS = [\"id\", \"code\", \"name\", \"title\"];\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction objectRows(items: unknown[]): Record<string, unknown>[] | null {\n return items.every(isPlainObject) ? (items as Record<string, unknown>[]) : null;\n}\n\nfunction numberField(source: Record<string, unknown>, key: string): number | undefined {\n const value = source[key];\n return typeof value === \"number\" ? value : undefined;\n}\n\nfunction pageInfo(value: Record<string, unknown>): ToolPageInfo | null {\n const page = isPlainObject(value[\"page\"]) ? value[\"page\"] : value;\n const limit = numberField(page, \"limit\");\n const offset = numberField(page, \"offset\");\n const total = numberField(page, \"total\");\n if (limit === undefined && offset === undefined && total === undefined) return null;\n return {\n ...(limit !== undefined ? { limit } : {}),\n ...(offset !== undefined ? { offset } : {}),\n ...(total !== undefined ? { total } : {}),\n };\n}\n\n/** Classify a normalized tool result. Ordering matters: the paged envelope is\n * checked before the generic record, and an all-numeric record before it. */\nexport function classifyToolValue(value: unknown): ClassifiedToolValue {\n if (value === undefined || value === null) return { shape: \"empty\" };\n\n if (typeof value === \"string\") {\n return value.trim() === \"\" ? { shape: \"empty\" } : { shape: \"scalar\", value };\n }\n if (typeof value === \"number\" || typeof value === \"boolean\") {\n return { shape: \"scalar\", value };\n }\n\n if (Array.isArray(value)) {\n if (value.length === 0) return { shape: \"empty\" };\n return { shape: \"list\", items: value, rows: objectRows(value) };\n }\n\n if (!isPlainObject(value)) return { shape: \"empty\" };\n\n const keys = Object.keys(value);\n if (keys.length === 0) return { shape: \"empty\" };\n\n const data = value[\"data\"];\n if (Array.isArray(data)) {\n const page = pageInfo(value);\n if (page) return { shape: \"paged\", items: data, rows: objectRows(data), page };\n return { shape: \"list\", items: data, rows: objectRows(data) };\n }\n\n if (keys.every((key) => typeof value[key] === \"number\")) {\n return { shape: \"counts\", record: value as Record<string, number> };\n }\n\n return { shape: \"record\", record: value };\n}\n\nfunction cellText(value: unknown): string {\n if (value === null || value === undefined) return \"\";\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n const text = JSON.stringify(value) ?? \"\";\n return text.length > CELL_TEXT_LIMIT ? `${text.slice(0, CELL_TEXT_LIMIT)}…` : text;\n}\n\nfunction isTimestampKey(key: string, field?: ToolFieldMeta): boolean {\n if (field?.format === \"date-time\" || field?.format === \"date\") return true;\n return /(_at|At|date|Date)$/.test(key);\n}\n\nfunction columnRank(key: string): number {\n const index = LEADING_KEYS.indexOf(key);\n return index >= 0 ? index : LEADING_KEYS.length;\n}\n\n/** Columns derived from the union of row keys, capped so a wide record does not\n * blow out a chat bubble. Labels come from the schema when one was published. */\nexport function deriveColumns(\n rows: Record<string, unknown>[],\n options: { fields?: Record<string, ToolFieldMeta> | undefined; max?: number | undefined } = {},\n): DataTableColumn<Record<string, unknown>>[] {\n const fields = options.fields ?? {};\n const max = options.max ?? DEFAULT_MAX_COLUMNS;\n\n const keys: string[] = [];\n for (const row of rows.slice(0, COLUMN_SCAN_ROWS)) {\n for (const key of Object.keys(row)) {\n if (!keys.includes(key)) keys.push(key);\n }\n }\n\n return keys\n .sort((a, b) => columnRank(a) - columnRank(b))\n .slice(0, max)\n .map((key) => {\n const field = fields[key];\n const timestamp = isTimestampKey(key, field);\n const allNumeric = rows.every((row) => row[key] === undefined || typeof row[key] === \"number\");\n return {\n key,\n label: field?.label ?? key,\n // `kind` supplies DataTable's own renderer, so only stringify otherwise.\n ...(timestamp\n ? { kind: \"timestamp\" as const }\n : { render: (value: unknown) => cellText(value) }),\n ...(allNumeric ? { align: \"right\" as const } : {}),\n };\n });\n}\n"],"names":[],"mappings":"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"}