@flanksource/clicky-ui 0.3.25 → 0.3.26

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 (470) hide show
  1. package/NOTICE.md +1 -0
  2. package/dist/ai.cjs +4 -0
  3. package/dist/ai.cjs.map +1 -1
  4. package/dist/ai.js +6 -2
  5. package/dist/ai.js.map +1 -1
  6. package/dist/chat.cjs +8 -0
  7. package/dist/chat.cjs.map +1 -1
  8. package/dist/chat.js +9 -1
  9. package/dist/chat.js.map +1 -1
  10. package/dist/comments/CommentCard.cjs +89 -14
  11. package/dist/comments/CommentCard.cjs.map +1 -1
  12. package/dist/comments/CommentCard.d.ts.map +1 -1
  13. package/dist/comments/CommentCard.js +90 -15
  14. package/dist/comments/CommentCard.js.map +1 -1
  15. package/dist/comments/CommentComposer.cjs +25 -2
  16. package/dist/comments/CommentComposer.cjs.map +1 -1
  17. package/dist/comments/CommentComposer.d.ts.map +1 -1
  18. package/dist/comments/CommentComposer.js +25 -2
  19. package/dist/comments/CommentComposer.js.map +1 -1
  20. package/dist/comments/CommentProvider.cjs +21 -14
  21. package/dist/comments/CommentProvider.cjs.map +1 -1
  22. package/dist/comments/CommentProvider.d.ts +1 -1
  23. package/dist/comments/CommentProvider.d.ts.map +1 -1
  24. package/dist/comments/CommentProvider.js +21 -14
  25. package/dist/comments/CommentProvider.js.map +1 -1
  26. package/dist/comments/CommentSidePanel.cjs +1 -1
  27. package/dist/comments/CommentSidePanel.cjs.map +1 -1
  28. package/dist/comments/CommentSidePanel.js +1 -1
  29. package/dist/comments/CommentSidePanel.js.map +1 -1
  30. package/dist/comments/comment-types.cjs.map +1 -1
  31. package/dist/comments/comment-types.d.ts +6 -0
  32. package/dist/comments/comment-types.d.ts.map +1 -1
  33. package/dist/comments/comment-types.js.map +1 -1
  34. package/dist/components/DimensionField.cjs +56 -0
  35. package/dist/components/DimensionField.cjs.map +1 -0
  36. package/dist/components/DimensionField.d.ts +17 -0
  37. package/dist/components/DimensionField.d.ts.map +1 -0
  38. package/dist/components/DimensionField.js +56 -0
  39. package/dist/components/DimensionField.js.map +1 -0
  40. package/dist/components.cjs +4 -0
  41. package/dist/components.cjs.map +1 -1
  42. package/dist/components.d.ts +2 -0
  43. package/dist/components.d.ts.map +1 -1
  44. package/dist/components.js +4 -0
  45. package/dist/components.js.map +1 -1
  46. package/dist/data/Clicky.cjs +4 -5
  47. package/dist/data/Clicky.cjs.map +1 -1
  48. package/dist/data/Clicky.d.ts.map +1 -1
  49. package/dist/data/Clicky.js +4 -5
  50. package/dist/data/Clicky.js.map +1 -1
  51. package/dist/data/TaskExecDetails.cjs +8 -3
  52. package/dist/data/TaskExecDetails.cjs.map +1 -1
  53. package/dist/data/TaskExecDetails.d.ts +4 -0
  54. package/dist/data/TaskExecDetails.d.ts.map +1 -1
  55. package/dist/data/TaskExecDetails.js +9 -4
  56. package/dist/data/TaskExecDetails.js.map +1 -1
  57. package/dist/data/TaskManagerButton.cjs +101 -7
  58. package/dist/data/TaskManagerButton.cjs.map +1 -1
  59. package/dist/data/TaskManagerButton.d.ts +6 -1
  60. package/dist/data/TaskManagerButton.d.ts.map +1 -1
  61. package/dist/data/TaskManagerButton.js +103 -9
  62. package/dist/data/TaskManagerButton.js.map +1 -1
  63. package/dist/data/TaskProcessDetails.cjs +2 -0
  64. package/dist/data/TaskProcessDetails.cjs.map +1 -1
  65. package/dist/data/TaskProcessDetails.d.ts.map +1 -1
  66. package/dist/data/TaskProcessDetails.js +2 -0
  67. package/dist/data/TaskProcessDetails.js.map +1 -1
  68. package/dist/data/TaskProgress.cjs +14 -4
  69. package/dist/data/TaskProgress.cjs.map +1 -1
  70. package/dist/data/TaskProgress.js +14 -4
  71. package/dist/data/TaskProgress.js.map +1 -1
  72. package/dist/data/TaskSnapshot.cjs.map +1 -1
  73. package/dist/data/TaskSnapshot.d.ts +1 -0
  74. package/dist/data/TaskSnapshot.d.ts.map +1 -1
  75. package/dist/data/TaskSnapshot.js.map +1 -1
  76. package/dist/data/ai/ChatWindow.cjs +18 -23
  77. package/dist/data/ai/ChatWindow.cjs.map +1 -1
  78. package/dist/data/ai/ChatWindow.d.ts +1 -1
  79. package/dist/data/ai/ChatWindow.d.ts.map +1 -1
  80. package/dist/data/ai/ChatWindow.js +19 -24
  81. package/dist/data/ai/ChatWindow.js.map +1 -1
  82. package/dist/data/ai/ChatWindow.preferences.cjs +12 -21
  83. package/dist/data/ai/ChatWindow.preferences.cjs.map +1 -1
  84. package/dist/data/ai/ChatWindow.preferences.d.ts +3 -2
  85. package/dist/data/ai/ChatWindow.preferences.d.ts.map +1 -1
  86. package/dist/data/ai/ChatWindow.preferences.js +12 -21
  87. package/dist/data/ai/ChatWindow.preferences.js.map +1 -1
  88. package/dist/data/ai/ChatWindow.tool-catalog.cjs +21 -38
  89. package/dist/data/ai/ChatWindow.tool-catalog.cjs.map +1 -1
  90. package/dist/data/ai/ChatWindow.tool-catalog.d.ts +5 -5
  91. package/dist/data/ai/ChatWindow.tool-catalog.d.ts.map +1 -1
  92. package/dist/data/ai/ChatWindow.tool-catalog.js +21 -38
  93. package/dist/data/ai/ChatWindow.tool-catalog.js.map +1 -1
  94. package/dist/data/ai/ChatWindow.types.d.ts +2 -2
  95. package/dist/data/ai/ChatWindow.types.d.ts.map +1 -1
  96. package/dist/data/ai/ChatWindowManager.cjs +2 -2
  97. package/dist/data/ai/ChatWindowManager.cjs.map +1 -1
  98. package/dist/data/ai/ChatWindowManager.js +2 -2
  99. package/dist/data/ai/ChatWindowManager.js.map +1 -1
  100. package/dist/data/ai/ChatWindowRequestBody.cjs +4 -2
  101. package/dist/data/ai/ChatWindowRequestBody.cjs.map +1 -1
  102. package/dist/data/ai/ChatWindowRequestBody.d.ts +15 -3
  103. package/dist/data/ai/ChatWindowRequestBody.d.ts.map +1 -1
  104. package/dist/data/ai/ChatWindowRequestBody.js +4 -2
  105. package/dist/data/ai/ChatWindowRequestBody.js.map +1 -1
  106. package/dist/data/ai/ToolPreferences.cjs +5 -5
  107. package/dist/data/ai/ToolPreferences.cjs.map +1 -1
  108. package/dist/data/ai/ToolPreferences.d.ts +6 -5
  109. package/dist/data/ai/ToolPreferences.d.ts.map +1 -1
  110. package/dist/data/ai/ToolPreferences.js +5 -5
  111. package/dist/data/ai/ToolPreferences.js.map +1 -1
  112. package/dist/data/ai/ToolPreferences.model.cjs +61 -37
  113. package/dist/data/ai/ToolPreferences.model.cjs.map +1 -1
  114. package/dist/data/ai/ToolPreferences.model.d.ts +32 -13
  115. package/dist/data/ai/ToolPreferences.model.d.ts.map +1 -1
  116. package/dist/data/ai/ToolPreferences.model.js +62 -38
  117. package/dist/data/ai/ToolPreferences.model.js.map +1 -1
  118. package/dist/data/ai/ToolPreferencesList.cjs +17 -20
  119. package/dist/data/ai/ToolPreferencesList.cjs.map +1 -1
  120. package/dist/data/ai/ToolPreferencesList.d.ts +16 -7
  121. package/dist/data/ai/ToolPreferencesList.d.ts.map +1 -1
  122. package/dist/data/ai/ToolPreferencesList.js +18 -21
  123. package/dist/data/ai/ToolPreferencesList.js.map +1 -1
  124. package/dist/data/ai/chat-window-context.cjs +1 -1
  125. package/dist/data/ai/chat-window-context.cjs.map +1 -1
  126. package/dist/data/ai/chat-window-context.d.ts +7 -7
  127. package/dist/data/ai/chat-window-context.d.ts.map +1 -1
  128. package/dist/data/ai/chat-window-context.js +1 -1
  129. package/dist/data/ai/chat-window-context.js.map +1 -1
  130. package/dist/data/ai/index.d.ts +3 -1
  131. package/dist/data/ai/index.d.ts.map +1 -1
  132. package/dist/data/chat/clickyOperationsToTools.cjs +2 -1
  133. package/dist/data/chat/clickyOperationsToTools.cjs.map +1 -1
  134. package/dist/data/chat/clickyOperationsToTools.d.ts.map +1 -1
  135. package/dist/data/chat/clickyOperationsToTools.js +2 -1
  136. package/dist/data/chat/clickyOperationsToTools.js.map +1 -1
  137. package/dist/data/chat/index.d.ts +2 -1
  138. package/dist/data/chat/index.d.ts.map +1 -1
  139. package/dist/data/chat/tool-policy.cjs +132 -0
  140. package/dist/data/chat/tool-policy.cjs.map +1 -0
  141. package/dist/data/chat/tool-policy.d.ts +81 -0
  142. package/dist/data/chat/tool-policy.d.ts.map +1 -0
  143. package/dist/data/chat/tool-policy.js +132 -0
  144. package/dist/data/chat/tool-policy.js.map +1 -0
  145. package/dist/data/chat/types.cjs +20 -0
  146. package/dist/data/chat/types.cjs.map +1 -1
  147. package/dist/data/chat/types.d.ts +22 -2
  148. package/dist/data/chat/types.d.ts.map +1 -1
  149. package/dist/data/chat/types.js +20 -0
  150. package/dist/data/chat/types.js.map +1 -1
  151. package/dist/data/debugConsoleSignal.cjs +64 -0
  152. package/dist/data/debugConsoleSignal.cjs.map +1 -0
  153. package/dist/data/debugConsoleSignal.d.ts +83 -0
  154. package/dist/data/debugConsoleSignal.d.ts.map +1 -0
  155. package/dist/data/debugConsoleSignal.js +64 -0
  156. package/dist/data/debugConsoleSignal.js.map +1 -0
  157. package/dist/data/har/HarPanel.cjs +20 -14
  158. package/dist/data/har/HarPanel.cjs.map +1 -1
  159. package/dist/data/har/HarPanel.d.ts.map +1 -1
  160. package/dist/data/har/HarPanel.js +20 -14
  161. package/dist/data/har/HarPanel.js.map +1 -1
  162. package/dist/data/har/types.d.ts +18 -0
  163. package/dist/data/har/types.d.ts.map +1 -1
  164. package/dist/data/query-browser/QueryBrowser.cjs +4 -42
  165. package/dist/data/query-browser/QueryBrowser.cjs.map +1 -1
  166. package/dist/data/query-browser/QueryBrowser.d.ts.map +1 -1
  167. package/dist/data/query-browser/QueryBrowser.js +5 -43
  168. package/dist/data/query-browser/QueryBrowser.js.map +1 -1
  169. package/dist/data/query-browser/QueryBrowser.types.cjs.map +1 -1
  170. package/dist/data/query-browser/QueryBrowser.types.d.ts +0 -1
  171. package/dist/data/query-browser/QueryBrowser.types.d.ts.map +1 -1
  172. package/dist/data/query-browser/QueryBrowser.types.js.map +1 -1
  173. package/dist/data/useDebugAction.cjs +29 -0
  174. package/dist/data/useDebugAction.cjs.map +1 -0
  175. package/dist/data/useDebugAction.d.ts +16 -0
  176. package/dist/data/useDebugAction.d.ts.map +1 -0
  177. package/dist/data/useDebugAction.js +29 -0
  178. package/dist/data/useDebugAction.js.map +1 -0
  179. package/dist/data/version-info.cjs +3 -3
  180. package/dist/data/version-info.js +3 -3
  181. package/dist/data.cjs +16 -8
  182. package/dist/data.cjs.map +1 -1
  183. package/dist/data.d.ts +3 -2
  184. package/dist/data.d.ts.map +1 -1
  185. package/dist/data.js +16 -8
  186. package/dist/devtools/DebugConsole.cjs +138 -0
  187. package/dist/devtools/DebugConsole.cjs.map +1 -0
  188. package/dist/devtools/DebugConsole.d.ts +23 -0
  189. package/dist/devtools/DebugConsole.d.ts.map +1 -0
  190. package/dist/devtools/DebugConsole.js +138 -0
  191. package/dist/devtools/DebugConsole.js.map +1 -0
  192. package/dist/devtools/DebugConsoleButton.cjs +59 -0
  193. package/dist/devtools/DebugConsoleButton.cjs.map +1 -0
  194. package/dist/devtools/DebugConsoleButton.d.ts +20 -0
  195. package/dist/devtools/DebugConsoleButton.d.ts.map +1 -0
  196. package/dist/devtools/DebugConsoleButton.js +59 -0
  197. package/dist/devtools/DebugConsoleButton.js.map +1 -0
  198. package/dist/devtools/DebugConsoleDock.cjs +112 -0
  199. package/dist/devtools/DebugConsoleDock.cjs.map +1 -0
  200. package/dist/devtools/DebugConsoleDock.d.ts +26 -0
  201. package/dist/devtools/DebugConsoleDock.d.ts.map +1 -0
  202. package/dist/devtools/DebugConsoleDock.js +112 -0
  203. package/dist/devtools/DebugConsoleDock.js.map +1 -0
  204. package/dist/devtools/ExecutionDetail.cjs +135 -0
  205. package/dist/devtools/ExecutionDetail.cjs.map +1 -0
  206. package/dist/devtools/ExecutionDetail.d.ts +19 -0
  207. package/dist/devtools/ExecutionDetail.d.ts.map +1 -0
  208. package/dist/devtools/ExecutionDetail.js +135 -0
  209. package/dist/devtools/ExecutionDetail.js.map +1 -0
  210. package/dist/devtools/debugClient.cjs +172 -0
  211. package/dist/devtools/debugClient.cjs.map +1 -0
  212. package/dist/devtools/debugClient.d.ts +98 -0
  213. package/dist/devtools/debugClient.d.ts.map +1 -0
  214. package/dist/devtools/debugClient.js +172 -0
  215. package/dist/devtools/debugClient.js.map +1 -0
  216. package/dist/devtools/debugStore.cjs +115 -0
  217. package/dist/devtools/debugStore.cjs.map +1 -0
  218. package/dist/devtools/debugStore.d.ts +83 -0
  219. package/dist/devtools/debugStore.d.ts.map +1 -0
  220. package/dist/devtools/debugStore.js +115 -0
  221. package/dist/devtools/debugStore.js.map +1 -0
  222. package/dist/devtools/dockState.cjs +51 -0
  223. package/dist/devtools/dockState.cjs.map +1 -0
  224. package/dist/devtools/dockState.d.ts +31 -0
  225. package/dist/devtools/dockState.d.ts.map +1 -0
  226. package/dist/devtools/dockState.js +51 -0
  227. package/dist/devtools/dockState.js.map +1 -0
  228. package/dist/devtools/tabs/ConsoleTab.cjs +36 -0
  229. package/dist/devtools/tabs/ConsoleTab.cjs.map +1 -0
  230. package/dist/devtools/tabs/ConsoleTab.d.ts +19 -0
  231. package/dist/devtools/tabs/ConsoleTab.d.ts.map +1 -0
  232. package/dist/devtools/tabs/ConsoleTab.js +36 -0
  233. package/dist/devtools/tabs/ConsoleTab.js.map +1 -0
  234. package/dist/devtools/tabs/InspectionCaches.cjs +150 -0
  235. package/dist/devtools/tabs/InspectionCaches.cjs.map +1 -0
  236. package/dist/devtools/tabs/InspectionCaches.d.ts +23 -0
  237. package/dist/devtools/tabs/InspectionCaches.d.ts.map +1 -0
  238. package/dist/devtools/tabs/InspectionCaches.js +150 -0
  239. package/dist/devtools/tabs/InspectionCaches.js.map +1 -0
  240. package/dist/devtools/tabs/InspectionTab.cjs +316 -0
  241. package/dist/devtools/tabs/InspectionTab.cjs.map +1 -0
  242. package/dist/devtools/tabs/InspectionTab.d.ts +27 -0
  243. package/dist/devtools/tabs/InspectionTab.d.ts.map +1 -0
  244. package/dist/devtools/tabs/InspectionTab.js +316 -0
  245. package/dist/devtools/tabs/InspectionTab.js.map +1 -0
  246. package/dist/devtools/tabs/NetworkTab.cjs +91 -0
  247. package/dist/devtools/tabs/NetworkTab.cjs.map +1 -0
  248. package/dist/devtools/tabs/NetworkTab.d.ts +20 -0
  249. package/dist/devtools/tabs/NetworkTab.d.ts.map +1 -0
  250. package/dist/devtools/tabs/NetworkTab.js +91 -0
  251. package/dist/devtools/tabs/NetworkTab.js.map +1 -0
  252. package/dist/devtools/tabs/QueriesTab.cjs +85 -0
  253. package/dist/devtools/tabs/QueriesTab.cjs.map +1 -0
  254. package/dist/devtools/tabs/QueriesTab.d.ts +24 -0
  255. package/dist/devtools/tabs/QueriesTab.d.ts.map +1 -0
  256. package/dist/devtools/tabs/QueriesTab.js +85 -0
  257. package/dist/devtools/tabs/QueriesTab.js.map +1 -0
  258. package/dist/devtools/types.cjs +26 -0
  259. package/dist/devtools/types.cjs.map +1 -0
  260. package/dist/devtools/types.d.ts +235 -0
  261. package/dist/devtools/types.d.ts.map +1 -0
  262. package/dist/devtools/types.js +26 -0
  263. package/dist/devtools/types.js.map +1 -0
  264. package/dist/devtools/useDebugStream.cjs +46 -0
  265. package/dist/devtools/useDebugStream.cjs.map +1 -0
  266. package/dist/devtools/useDebugStream.d.ts +23 -0
  267. package/dist/devtools/useDebugStream.d.ts.map +1 -0
  268. package/dist/devtools/useDebugStream.js +46 -0
  269. package/dist/devtools/useDebugStream.js.map +1 -0
  270. package/dist/devtools.cjs +51 -0
  271. package/dist/devtools.cjs.map +1 -0
  272. package/dist/devtools.d.ts +37 -0
  273. package/dist/devtools.d.ts.map +1 -0
  274. package/dist/devtools.js +51 -0
  275. package/dist/devtools.js.map +1 -0
  276. package/dist/icons/components/UiOpenScad.cjs +10 -0
  277. package/dist/icons/components/UiOpenScad.cjs.map +1 -0
  278. package/dist/icons/components/UiOpenScad.d.ts +9 -0
  279. package/dist/icons/components/UiOpenScad.d.ts.map +1 -0
  280. package/dist/icons/components/UiOpenScad.js +10 -0
  281. package/dist/icons/components/UiOpenScad.js.map +1 -0
  282. package/dist/icons/index.d.ts +1 -0
  283. package/dist/icons/index.d.ts.map +1 -1
  284. package/dist/icons/registry.cjs +2 -0
  285. package/dist/icons/registry.cjs.map +1 -1
  286. package/dist/icons/registry.d.ts.map +1 -1
  287. package/dist/icons/registry.js +2 -0
  288. package/dist/icons/registry.js.map +1 -1
  289. package/dist/icons.cjs +2 -0
  290. package/dist/icons.cjs.map +1 -1
  291. package/dist/icons.js +2 -0
  292. package/dist/icons.js.map +1 -1
  293. package/dist/index.cjs +20 -8
  294. package/dist/index.cjs.map +1 -1
  295. package/dist/index.js +20 -8
  296. package/dist/index.js.map +1 -1
  297. package/dist/layout/AppShell.cjs +15 -10
  298. package/dist/layout/AppShell.cjs.map +1 -1
  299. package/dist/layout/AppShell.d.ts +11 -0
  300. package/dist/layout/AppShell.d.ts.map +1 -1
  301. package/dist/layout/AppShell.js +15 -10
  302. package/dist/layout/AppShell.js.map +1 -1
  303. package/dist/layout/AppShell.nav.cjs +170 -49
  304. package/dist/layout/AppShell.nav.cjs.map +1 -1
  305. package/dist/layout/AppShell.nav.d.ts.map +1 -1
  306. package/dist/layout/AppShell.nav.js +170 -49
  307. package/dist/layout/AppShell.nav.js.map +1 -1
  308. package/dist/overlay/CellActions.cjs +18 -124
  309. package/dist/overlay/CellActions.cjs.map +1 -1
  310. package/dist/overlay/CellActions.d.ts +1 -1
  311. package/dist/overlay/CellActions.d.ts.map +1 -1
  312. package/dist/overlay/CellActions.js +18 -124
  313. package/dist/overlay/CellActions.js.map +1 -1
  314. package/dist/overlay/ContextMenu.cjs +144 -0
  315. package/dist/overlay/ContextMenu.cjs.map +1 -0
  316. package/dist/overlay/ContextMenu.d.ts +8 -0
  317. package/dist/overlay/ContextMenu.d.ts.map +1 -0
  318. package/dist/overlay/ContextMenu.js +144 -0
  319. package/dist/overlay/ContextMenu.js.map +1 -0
  320. package/dist/profiles/connections/connectionBrowserModel.cjs +14 -65
  321. package/dist/profiles/connections/connectionBrowserModel.cjs.map +1 -1
  322. package/dist/profiles/connections/connectionBrowserModel.d.ts +35 -35
  323. package/dist/profiles/connections/connectionBrowserModel.d.ts.map +1 -1
  324. package/dist/profiles/connections/connectionBrowserModel.js +14 -65
  325. package/dist/profiles/connections/connectionBrowserModel.js.map +1 -1
  326. package/dist/profiles/connections/connectionQueryWorkspace.cjs +29 -9
  327. package/dist/profiles/connections/connectionQueryWorkspace.cjs.map +1 -1
  328. package/dist/profiles/connections/connectionQueryWorkspace.d.ts +3 -2
  329. package/dist/profiles/connections/connectionQueryWorkspace.d.ts.map +1 -1
  330. package/dist/profiles/connections/connectionQueryWorkspace.js +30 -10
  331. package/dist/profiles/connections/connectionQueryWorkspace.js.map +1 -1
  332. package/dist/profiles/connections/connectionQueryWorkspaceModel.cjs +15 -0
  333. package/dist/profiles/connections/connectionQueryWorkspaceModel.cjs.map +1 -1
  334. package/dist/profiles/connections/connectionQueryWorkspaceModel.d.ts +22 -1
  335. package/dist/profiles/connections/connectionQueryWorkspaceModel.d.ts.map +1 -1
  336. package/dist/profiles/connections/connectionQueryWorkspaceModel.js +15 -0
  337. package/dist/profiles/connections/connectionQueryWorkspaceModel.js.map +1 -1
  338. package/dist/profiles/connections/index.d.ts +1 -0
  339. package/dist/profiles/connections/index.d.ts.map +1 -1
  340. package/dist/profiles/connections/inspectionStatus.cjs +44 -0
  341. package/dist/profiles/connections/inspectionStatus.cjs.map +1 -0
  342. package/dist/profiles/connections/inspectionStatus.d.ts +5 -0
  343. package/dist/profiles/connections/inspectionStatus.d.ts.map +1 -0
  344. package/dist/profiles/connections/inspectionStatus.js +44 -0
  345. package/dist/profiles/connections/inspectionStatus.js.map +1 -0
  346. package/dist/profiles/connections/useInspection.cjs +123 -0
  347. package/dist/profiles/connections/useInspection.cjs.map +1 -0
  348. package/dist/profiles/connections/useInspection.d.ts +35 -0
  349. package/dist/profiles/connections/useInspection.d.ts.map +1 -0
  350. package/dist/profiles/connections/useInspection.js +123 -0
  351. package/dist/profiles/connections/useInspection.js.map +1 -0
  352. package/dist/profiles/editor/profileBuilderWorkspace.cjs +55 -23
  353. package/dist/profiles/editor/profileBuilderWorkspace.cjs.map +1 -1
  354. package/dist/profiles/editor/profileBuilderWorkspace.d.ts.map +1 -1
  355. package/dist/profiles/editor/profileBuilderWorkspace.js +56 -24
  356. package/dist/profiles/editor/profileBuilderWorkspace.js.map +1 -1
  357. package/dist/profiles/elasticsearch/esQueryBuilder.cjs +12 -3
  358. package/dist/profiles/elasticsearch/esQueryBuilder.cjs.map +1 -1
  359. package/dist/profiles/elasticsearch/esQueryBuilder.d.ts +2 -2
  360. package/dist/profiles/elasticsearch/esQueryBuilder.d.ts.map +1 -1
  361. package/dist/profiles/elasticsearch/esQueryBuilder.js +12 -3
  362. package/dist/profiles/elasticsearch/esQueryBuilder.js.map +1 -1
  363. package/dist/profiles/fields/profileFieldEditor.cjs +137 -22
  364. package/dist/profiles/fields/profileFieldEditor.cjs.map +1 -1
  365. package/dist/profiles/fields/profileFieldEditor.d.ts.map +1 -1
  366. package/dist/profiles/fields/profileFieldEditor.js +137 -22
  367. package/dist/profiles/fields/profileFieldEditor.js.map +1 -1
  368. package/dist/profiles/fields/profileFieldFilterEditor.cjs +171 -82
  369. package/dist/profiles/fields/profileFieldFilterEditor.cjs.map +1 -1
  370. package/dist/profiles/fields/profileFieldFilterEditor.d.ts +0 -9
  371. package/dist/profiles/fields/profileFieldFilterEditor.d.ts.map +1 -1
  372. package/dist/profiles/fields/profileFieldFilterEditor.js +174 -85
  373. package/dist/profiles/fields/profileFieldFilterEditor.js.map +1 -1
  374. package/dist/profiles/fields/profileFieldIcons.cjs +6 -3
  375. package/dist/profiles/fields/profileFieldIcons.cjs.map +1 -1
  376. package/dist/profiles/fields/profileFieldIcons.js +6 -3
  377. package/dist/profiles/fields/profileFieldIcons.js.map +1 -1
  378. package/dist/profiles/query/profileSampleFilterLookup.cjs +34 -0
  379. package/dist/profiles/query/profileSampleFilterLookup.cjs.map +1 -0
  380. package/dist/profiles/query/profileSampleFilterLookup.d.ts +12 -0
  381. package/dist/profiles/query/profileSampleFilterLookup.d.ts.map +1 -0
  382. package/dist/profiles/query/profileSampleFilterLookup.js +34 -0
  383. package/dist/profiles/query/profileSampleFilterLookup.js.map +1 -0
  384. package/dist/profiles/query/profileSamplePayload.cjs +6 -4
  385. package/dist/profiles/query/profileSamplePayload.cjs.map +1 -1
  386. package/dist/profiles/query/profileSamplePayload.d.ts +11 -4
  387. package/dist/profiles/query/profileSamplePayload.d.ts.map +1 -1
  388. package/dist/profiles/query/profileSamplePayload.js +6 -4
  389. package/dist/profiles/query/profileSamplePayload.js.map +1 -1
  390. package/dist/profiles/query/profileSampleResult.cjs +26 -0
  391. package/dist/profiles/query/profileSampleResult.cjs.map +1 -0
  392. package/dist/profiles/query/profileSampleResult.d.ts +11 -0
  393. package/dist/profiles/query/profileSampleResult.d.ts.map +1 -0
  394. package/dist/profiles/query/profileSampleResult.js +26 -0
  395. package/dist/profiles/query/profileSampleResult.js.map +1 -0
  396. package/dist/profiles/query/queryTargetPicker.cjs +5 -3
  397. package/dist/profiles/query/queryTargetPicker.cjs.map +1 -1
  398. package/dist/profiles/query/queryTargetPicker.d.ts +3 -2
  399. package/dist/profiles/query/queryTargetPicker.d.ts.map +1 -1
  400. package/dist/profiles/query/queryTargetPicker.js +5 -3
  401. package/dist/profiles/query/queryTargetPicker.js.map +1 -1
  402. package/dist/profiles/wizard/profileWizard.cjs +14 -5
  403. package/dist/profiles/wizard/profileWizard.cjs.map +1 -1
  404. package/dist/profiles/wizard/profileWizard.d.ts.map +1 -1
  405. package/dist/profiles/wizard/profileWizard.js +15 -6
  406. package/dist/profiles/wizard/profileWizard.js.map +1 -1
  407. package/dist/profiles/wizard/profileWizardModel.cjs +35 -6
  408. package/dist/profiles/wizard/profileWizardModel.cjs.map +1 -1
  409. package/dist/profiles/wizard/profileWizardModel.d.ts +29 -4
  410. package/dist/profiles/wizard/profileWizardModel.d.ts.map +1 -1
  411. package/dist/profiles/wizard/profileWizardModel.js +35 -6
  412. package/dist/profiles/wizard/profileWizardModel.js.map +1 -1
  413. package/dist/profiles/wizard/profileWizardQueryStep.cjs +44 -11
  414. package/dist/profiles/wizard/profileWizardQueryStep.cjs.map +1 -1
  415. package/dist/profiles/wizard/profileWizardQueryStep.d.ts.map +1 -1
  416. package/dist/profiles/wizard/profileWizardQueryStep.js +46 -13
  417. package/dist/profiles/wizard/profileWizardQueryStep.js.map +1 -1
  418. package/dist/profiles/wizard/profileWizardSteps.cjs +33 -2
  419. package/dist/profiles/wizard/profileWizardSteps.cjs.map +1 -1
  420. package/dist/profiles/wizard/profileWizardSteps.d.ts +11 -2
  421. package/dist/profiles/wizard/profileWizardSteps.d.ts.map +1 -1
  422. package/dist/profiles/wizard/profileWizardSteps.js +33 -2
  423. package/dist/profiles/wizard/profileWizardSteps.js.map +1 -1
  424. package/dist/profiles.cjs +8 -2
  425. package/dist/profiles.cjs.map +1 -1
  426. package/dist/profiles.js +10 -4
  427. package/dist/profiles.js.map +1 -1
  428. package/dist/rpc/FilterForm.cjs +21 -237
  429. package/dist/rpc/FilterForm.cjs.map +1 -1
  430. package/dist/rpc/FilterForm.d.ts +3 -1
  431. package/dist/rpc/FilterForm.d.ts.map +1 -1
  432. package/dist/rpc/FilterForm.js +21 -237
  433. package/dist/rpc/FilterForm.js.map +1 -1
  434. package/dist/rpc/FilterFormFields.cjs +240 -0
  435. package/dist/rpc/FilterFormFields.cjs.map +1 -0
  436. package/dist/rpc/FilterFormFields.d.ts +12 -0
  437. package/dist/rpc/FilterFormFields.d.ts.map +1 -0
  438. package/dist/rpc/FilterFormFields.js +240 -0
  439. package/dist/rpc/FilterFormFields.js.map +1 -0
  440. package/dist/rpc/router.cjs +3 -2
  441. package/dist/rpc/router.cjs.map +1 -1
  442. package/dist/rpc/router.d.ts.map +1 -1
  443. package/dist/rpc/router.js +3 -2
  444. package/dist/rpc/router.js.map +1 -1
  445. package/dist/rpc/types.cjs.map +1 -1
  446. package/dist/rpc/types.d.ts +3 -1
  447. package/dist/rpc/types.d.ts.map +1 -1
  448. package/dist/rpc/types.js.map +1 -1
  449. package/dist/styles.css +1 -1
  450. package/package.json +6 -1
  451. package/dist/data/query-info/QueryInfoDialog.cjs +0 -106
  452. package/dist/data/query-info/QueryInfoDialog.cjs.map +0 -1
  453. package/dist/data/query-info/QueryInfoDialog.d.ts +0 -16
  454. package/dist/data/query-info/QueryInfoDialog.d.ts.map +0 -1
  455. package/dist/data/query-info/QueryInfoDialog.js +0 -106
  456. package/dist/data/query-info/QueryInfoDialog.js.map +0 -1
  457. package/dist/data/query-info/index.d.ts +0 -4
  458. package/dist/data/query-info/index.d.ts.map +0 -1
  459. package/dist/data/query-info/queryInfo.cjs +0 -42
  460. package/dist/data/query-info/queryInfo.cjs.map +0 -1
  461. package/dist/data/query-info/queryInfo.d.ts +0 -45
  462. package/dist/data/query-info/queryInfo.d.ts.map +0 -1
  463. package/dist/data/query-info/queryInfo.js +0 -42
  464. package/dist/data/query-info/queryInfo.js.map +0 -1
  465. package/dist/data/query-info/useQueryInfo.cjs +0 -48
  466. package/dist/data/query-info/useQueryInfo.cjs.map +0 -1
  467. package/dist/data/query-info/useQueryInfo.d.ts +0 -26
  468. package/dist/data/query-info/useQueryInfo.d.ts.map +0 -1
  469. package/dist/data/query-info/useQueryInfo.js +0 -48
  470. package/dist/data/query-info/useQueryInfo.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-policy.cjs","sources":["../../../src/data/chat/tool-policy.ts"],"sourcesContent":["import type { ToolMeta, ToolPolicy } from \"./types\";\nimport { normalizeToolPolicy } from \"./types\";\n\n/** The client half of Captain's ordered tool-permission policy.\n *\n * A tool's authority is decided by an ordered rule list evaluated\n * last-match-wins: weakest rule first, strongest last. The layers this file\n * composes are the surface's rules (what the page the chat opened on declares)\n * followed by the user's own (what they toggled in the preferences popover), so\n * a toggle beats the surface and the surface beats the application's baseline —\n * which the server appends underneath both.\n *\n * The matching is a port of Go's `commons/collections.MatchItems`, and it is a\n * port rather than a re-interpretation on purpose: the same rule list is\n * evaluated on both sides of the wire — here to render what a tool will do, and\n * on the server to enforce it — and a client that disagreed would show a state\n * the request does not produce. */\n\n/** A glob pattern list. A bare string is one pattern, so a rule can be written\n * `{ group: \"provider.xero.*\" }` without list ceremony. */\nexport type MatchPatterns = string | string[];\n\n/** Which tools a rule applies to. Every declared facet must match (AND across\n * facets); within one facet the patterns are alternatives (OR). An undeclared\n * facet does not constrain. */\nexport type ToolMatch = {\n name?: MatchPatterns;\n group?: MatchPatterns;\n parent?: MatchPatterns;\n entity?: MatchPatterns;\n action?: MatchPatterns;\n verb?: MatchPatterns;\n method?: MatchPatterns;\n scope?: MatchPatterns;\n /** A declared hint requires the tool to declare the same hint with the same\n * value. An undeclared hint on the tool does NOT match: \"this tool never said\n * whether it is read-only\" and \"this tool said it is not\" are different\n * claims, and reading the first as the second is how an unannotated tool\n * would inherit a permissive rule. */\n readOnly?: boolean;\n destructive?: boolean;\n idempotent?: boolean;\n};\n\n/** One ordered rule: the tools it selects and the authority they get. */\nexport type PermissionRule = ToolMatch & { policy: ToolPolicy };\n\n/** The ordered rule list, evaluated last-match-wins. */\nexport type PermissionPolicy = PermissionRule[];\n\nconst MATCH_FACETS = [\n \"name\",\n \"group\",\n \"parent\",\n \"entity\",\n \"action\",\n \"verb\",\n \"method\",\n \"scope\",\n] as const;\n\n/** Reports whether `item` satisfies these patterns, following MatchItems:\n * `!` negates and takes precedence over any positive match, `*` wildcards a\n * prefix, suffix or the whole item, matching is case-insensitive, and one\n * string may carry comma-separated alternatives. An empty list matches\n * everything — an undeclared facet imposes no constraint. */\nexport function matchItems(\n item: string,\n patterns: MatchPatterns | undefined,\n): boolean {\n const normalized = normalizePatterns(patterns);\n if (normalized.length === 0) return true;\n // Exclusions are checked first so `!` wins however the rule was written:\n // [\"a*\", \"!abc\"] must reject \"abc\" rather than accept it on the wildcard.\n const sorted = [...normalized].sort(\n (a, b) => exclusionRank(a) - exclusionRank(b),\n );\n for (const pattern of sorted) {\n if (pattern.startsWith(\"!\")) {\n if (matchPattern(item, pattern.slice(1))) return false;\n continue;\n }\n if (matchPattern(item, pattern)) return true;\n }\n // Every pattern excluded and none of them matched, so the item is admitted.\n return sorted.every((pattern) => pattern.startsWith(\"!\"));\n}\n\nfunction normalizePatterns(patterns: MatchPatterns | undefined): string[] {\n if (patterns === undefined) return [];\n const list = typeof patterns === \"string\" ? [patterns] : patterns;\n const out: string[] = [];\n for (const raw of list) {\n if (typeof raw !== \"string\") continue;\n const parts = raw.split(\",\");\n for (const part of parts) {\n const trimmed = part.trim();\n if (trimmed === \"\" && parts.length > 1) continue;\n if (trimmed !== \"\") out.push(trimmed);\n }\n }\n return out;\n}\n\nfunction exclusionRank(pattern: string): number {\n if (pattern === \"!*\") return 0;\n return pattern.startsWith(\"!\") ? 1 : 2;\n}\n\nfunction matchPattern(item: string, pattern: string): boolean {\n if (pattern === \"*\") return true;\n const value = item.toLowerCase();\n const glob = pattern.toLowerCase();\n if (value === glob) return true;\n if (glob.startsWith(\"*\") && glob.endsWith(\"*\")) {\n if (value.includes(glob.slice(1, -1))) return true;\n }\n if (glob.startsWith(\"*\") && value.endsWith(glob.slice(1))) return true;\n if (glob.endsWith(\"*\") && value.startsWith(glob.slice(0, -1))) return true;\n return false;\n}\n\n/** Resolves the authority for one tool: the policy of the LAST rule that\n * matches it, or undefined when no rule does.\n *\n * Last, not first, because the list runs weakest to strongest — a user rule\n * appended after a surface rule is meant to win. A first-match-wins reading\n * would invert the whole contract. */\nexport function resolveToolPolicy(\n policy: PermissionPolicy | undefined,\n tool: ToolMeta,\n): ToolPolicy | undefined {\n let resolved: ToolPolicy | undefined;\n for (const rule of policy ?? []) {\n if (matchesTool(rule, tool)) resolved = rule.policy;\n }\n return resolved;\n}\n\nexport function matchesTool(match: ToolMatch, tool: ToolMeta): boolean {\n const facets: Record<(typeof MATCH_FACETS)[number], string> = {\n name: tool.name ?? \"\",\n group: tool.group ?? \"\",\n parent: tool.parent ?? \"\",\n entity: tool.entity ?? \"\",\n action: tool.action ?? \"\",\n verb: tool.verb ?? \"\",\n method: tool.method ?? \"\",\n scope: tool.scope ?? \"\",\n };\n for (const facet of MATCH_FACETS) {\n if (!matchItems(facets[facet], match[facet])) return false;\n }\n return (\n matchesHint(match.readOnly, tool.annotations?.readOnlyHint) &&\n matchesHint(match.destructive, tool.annotations?.destructiveHint) &&\n matchesHint(match.idempotent, tool.annotations?.idempotentHint)\n );\n}\n\nfunction matchesHint(want: boolean | undefined, have: boolean | undefined) {\n if (want === undefined) return true;\n return have !== undefined && have === want;\n}\n\n/** Lowers a flat tool→policy map into ordered rules, so the legacy shape and the\n * rule list share one evaluation path instead of two that can disagree.\n *\n * A key is ambiguous — it may name a tool or its group — so each key emits both\n * a group rule and a name rule, with every group rule placed before every name\n * rule. A key that names a group matches no tool name and vice versa, so the\n * ambiguity costs nothing; and where a key is both, the name rule comes later\n * and wins. That is exactly the precedence the popover needs, where a per-tool\n * toggle must beat the group toggle above it.\n *\n * Keys are sorted so the request body is stable: an unstable order would make\n * every render look like a changed request. */\nexport function toolPolicyFromPreferences(\n prefs: Record<string, ToolPolicy> | undefined,\n): PermissionPolicy {\n const keys = Object.keys(prefs ?? {})\n .filter((key) => key.trim() !== \"\")\n .sort();\n if (keys.length === 0) return [];\n const policies = new Map<string, ToolPolicy>();\n for (const key of keys) {\n const policy = normalizeToolPolicy(prefs?.[key]);\n if (policy) policies.set(key, policy);\n }\n const ordered = [...policies.keys()];\n return [\n ...ordered.map((key) => ({ group: key, policy: policies.get(key)! })),\n ...ordered.map((key) => ({ name: key, policy: policies.get(key)! })),\n ];\n}\n\n/** Appends `later` onto `earlier`, the later winning. Composition rather than\n * mutation, so one caller's user rules cannot leak into another's. */\nexport function appendToolPolicy(\n earlier: PermissionPolicy | undefined,\n later: PermissionPolicy | undefined,\n): PermissionPolicy {\n return [...(earlier ?? []), ...(later ?? [])];\n}\n\n/** Parses a rule list off the wire, dropping anything malformed rather than\n * letting it silently become the last word on every tool: a rule with no facet\n * matches everything, and being last-match-wins that is the one mistake with\n * unbounded reach. */\nexport function normalizeToolPolicyRules(value: unknown): PermissionPolicy {\n if (!Array.isArray(value)) return [];\n const rules: PermissionPolicy = [];\n for (const raw of value) {\n if (!raw || typeof raw !== \"object\" || Array.isArray(raw)) continue;\n const item = raw as Record<string, unknown>;\n const policy = normalizeToolPolicy(item.policy);\n if (!policy) continue;\n const match: ToolMatch = {};\n for (const facet of MATCH_FACETS) {\n const patterns = normalizePatterns(item[facet] as MatchPatterns);\n if (patterns.length > 0) match[facet] = patterns;\n }\n for (const hint of [\"readOnly\", \"destructive\", \"idempotent\"] as const) {\n if (typeof item[hint] === \"boolean\") match[hint] = item[hint] as boolean;\n }\n if (Object.keys(match).length === 0) continue;\n rules.push({ ...match, policy });\n }\n return rules;\n}\n"],"names":["normalizeToolPolicy"],"mappings":";;;AAkDA,MAAM,eAAe;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAOO,SAAS,WACd,MACA,UACS;AACT,QAAM,aAAa,kBAAkB,QAAQ;AAC7C,MAAI,WAAW,WAAW,EAAG,QAAO;AAGpC,QAAM,SAAS,CAAC,GAAG,UAAU,EAAE;AAAA,IAC7B,CAAC,GAAG,MAAM,cAAc,CAAC,IAAI,cAAc,CAAC;AAAA,EAAA;AAE9C,aAAW,WAAW,QAAQ;AAC5B,QAAI,QAAQ,WAAW,GAAG,GAAG;AAC3B,UAAI,aAAa,MAAM,QAAQ,MAAM,CAAC,CAAC,EAAG,QAAO;AACjD;AAAA,IACF;AACA,QAAI,aAAa,MAAM,OAAO,EAAG,QAAO;AAAA,EAC1C;AAEA,SAAO,OAAO,MAAM,CAAC,YAAY,QAAQ,WAAW,GAAG,CAAC;AAC1D;AAEA,SAAS,kBAAkB,UAA+C;AACxE,MAAI,aAAa,OAAW,QAAO,CAAA;AACnC,QAAM,OAAO,OAAO,a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,OAAkC;AACzE,MAAI,CAAC,MAAM,QAAQ,KAAK,UAAU,CAAA;AAClC,QAAM,QAA0B,CAAA;AAChC,aAAW,OAAO,OAAO;AACvB,QAAI,CAAC,OAAO,OAAO,QAAQ,YAAY,MAAM,QAAQ,GAAG,EAAG;AAC3D,UAAM,OAAO;AACb,UAAM,SAASA,MAAAA,oBAAoB,KAAK,MAAM;AAC9C,QAAI,CAAC,OAAQ;AACb,UAAM,QAAmB,CAAA;AACzB,eAAW,SAAS,cAAc;AAChC,YAAM,WAAW,kBAAkB,KAAK,KAAK,CAAkB;AAC/D,UAAI,SAAS,SAAS,EAAG,OAAM,KAAK,IAAI;AAAA,IAC1C;AACA,eAAW,QAAQ,CAAC,YAAY,eAAe,YAAY,GAAY;AACrE,UAAI,OAAO,KAAK,IAAI,MAAM,UAAW,OAAM,IAAI,IAAI,KAAK,IAAI;AAAA,IAC9D;AACA,QAAI,OAAO,KAAK,KAAK,EAAE,WAAW,EAAG;AACrC,UAAM,KAAK,EAAE,GAAG,OAAO,QAAQ;AAAA,EACjC;AACA,SAAO;AACT;;;;;;;"}
@@ -0,0 +1,81 @@
1
+ import { ToolMeta, ToolPolicy } from './types';
2
+ /** The client half of Captain's ordered tool-permission policy.
3
+ *
4
+ * A tool's authority is decided by an ordered rule list evaluated
5
+ * last-match-wins: weakest rule first, strongest last. The layers this file
6
+ * composes are the surface's rules (what the page the chat opened on declares)
7
+ * followed by the user's own (what they toggled in the preferences popover), so
8
+ * a toggle beats the surface and the surface beats the application's baseline —
9
+ * which the server appends underneath both.
10
+ *
11
+ * The matching is a port of Go's `commons/collections.MatchItems`, and it is a
12
+ * port rather than a re-interpretation on purpose: the same rule list is
13
+ * evaluated on both sides of the wire — here to render what a tool will do, and
14
+ * on the server to enforce it — and a client that disagreed would show a state
15
+ * the request does not produce. */
16
+ /** A glob pattern list. A bare string is one pattern, so a rule can be written
17
+ * `{ group: "provider.xero.*" }` without list ceremony. */
18
+ export type MatchPatterns = string | string[];
19
+ /** Which tools a rule applies to. Every declared facet must match (AND across
20
+ * facets); within one facet the patterns are alternatives (OR). An undeclared
21
+ * facet does not constrain. */
22
+ export type ToolMatch = {
23
+ name?: MatchPatterns;
24
+ group?: MatchPatterns;
25
+ parent?: MatchPatterns;
26
+ entity?: MatchPatterns;
27
+ action?: MatchPatterns;
28
+ verb?: MatchPatterns;
29
+ method?: MatchPatterns;
30
+ scope?: MatchPatterns;
31
+ /** A declared hint requires the tool to declare the same hint with the same
32
+ * value. An undeclared hint on the tool does NOT match: "this tool never said
33
+ * whether it is read-only" and "this tool said it is not" are different
34
+ * claims, and reading the first as the second is how an unannotated tool
35
+ * would inherit a permissive rule. */
36
+ readOnly?: boolean;
37
+ destructive?: boolean;
38
+ idempotent?: boolean;
39
+ };
40
+ /** One ordered rule: the tools it selects and the authority they get. */
41
+ export type PermissionRule = ToolMatch & {
42
+ policy: ToolPolicy;
43
+ };
44
+ /** The ordered rule list, evaluated last-match-wins. */
45
+ export type PermissionPolicy = PermissionRule[];
46
+ /** Reports whether `item` satisfies these patterns, following MatchItems:
47
+ * `!` negates and takes precedence over any positive match, `*` wildcards a
48
+ * prefix, suffix or the whole item, matching is case-insensitive, and one
49
+ * string may carry comma-separated alternatives. An empty list matches
50
+ * everything — an undeclared facet imposes no constraint. */
51
+ export declare function matchItems(item: string, patterns: MatchPatterns | undefined): boolean;
52
+ /** Resolves the authority for one tool: the policy of the LAST rule that
53
+ * matches it, or undefined when no rule does.
54
+ *
55
+ * Last, not first, because the list runs weakest to strongest — a user rule
56
+ * appended after a surface rule is meant to win. A first-match-wins reading
57
+ * would invert the whole contract. */
58
+ export declare function resolveToolPolicy(policy: PermissionPolicy | undefined, tool: ToolMeta): ToolPolicy | undefined;
59
+ export declare function matchesTool(match: ToolMatch, tool: ToolMeta): boolean;
60
+ /** Lowers a flat tool→policy map into ordered rules, so the legacy shape and the
61
+ * rule list share one evaluation path instead of two that can disagree.
62
+ *
63
+ * A key is ambiguous — it may name a tool or its group — so each key emits both
64
+ * a group rule and a name rule, with every group rule placed before every name
65
+ * rule. A key that names a group matches no tool name and vice versa, so the
66
+ * ambiguity costs nothing; and where a key is both, the name rule comes later
67
+ * and wins. That is exactly the precedence the popover needs, where a per-tool
68
+ * toggle must beat the group toggle above it.
69
+ *
70
+ * Keys are sorted so the request body is stable: an unstable order would make
71
+ * every render look like a changed request. */
72
+ export declare function toolPolicyFromPreferences(prefs: Record<string, ToolPolicy> | undefined): PermissionPolicy;
73
+ /** Appends `later` onto `earlier`, the later winning. Composition rather than
74
+ * mutation, so one caller's user rules cannot leak into another's. */
75
+ export declare function appendToolPolicy(earlier: PermissionPolicy | undefined, later: PermissionPolicy | undefined): PermissionPolicy;
76
+ /** Parses a rule list off the wire, dropping anything malformed rather than
77
+ * letting it silently become the last word on every tool: a rule with no facet
78
+ * matches everything, and being last-match-wins that is the one mistake with
79
+ * unbounded reach. */
80
+ export declare function normalizeToolPolicyRules(value: unknown): PermissionPolicy;
81
+ //# sourceMappingURL=tool-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-policy.d.ts","sourceRoot":"","sources":["../../../src/data/chat/tool-policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGpD;;;;;;;;;;;;;oCAaoC;AAEpC;4DAC4D;AAC5D,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;AAE9C;;gCAEgC;AAChC,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB;;;;2CAIuC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,yEAAyE;AACzE,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG;IAAE,MAAM,EAAE,UAAU,CAAA;CAAE,CAAC;AAEhE,wDAAwD;AACxD,MAAM,MAAM,gBAAgB,GAAG,cAAc,EAAE,CAAC;AAahD;;;;8DAI8D;AAC9D,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,aAAa,GAAG,SAAS,GAClC,OAAO,CAiBT;AAoCD;;;;;uCAKuC;AACvC,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,gBAAgB,GAAG,SAAS,EACpC,IAAI,EAAE,QAAQ,GACb,UAAU,GAAG,SAAS,CAMxB;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,CAmBrE;AAOD;;;;;;;;;;;gDAWgD;AAChD,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,SAAS,GAC5C,gBAAgB,CAelB;AAED;uEACuE;AACvE,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,gBAAgB,GAAG,SAAS,EACrC,KAAK,EAAE,gBAAgB,GAAG,SAAS,GAClC,gBAAgB,CAElB;AAED;;;uBAGuB;AACvB,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAoBzE"}
@@ -0,0 +1,132 @@
1
+ import { normalizeToolPolicy } from "./types.js";
2
+ const MATCH_FACETS = [
3
+ "name",
4
+ "group",
5
+ "parent",
6
+ "entity",
7
+ "action",
8
+ "verb",
9
+ "method",
10
+ "scope"
11
+ ];
12
+ function matchItems(item, patterns) {
13
+ const normalized = normalizePatterns(patterns);
14
+ if (normalized.length === 0) return true;
15
+ const sorted = [...normalized].sort(
16
+ (a, b) => exclusionRank(a) - exclusionRank(b)
17
+ );
18
+ for (const pattern of sorted) {
19
+ if (pattern.startsWith("!")) {
20
+ if (matchPattern(item, pattern.slice(1))) return false;
21
+ continue;
22
+ }
23
+ if (matchPattern(item, pattern)) return true;
24
+ }
25
+ return sorted.every((pattern) => pattern.startsWith("!"));
26
+ }
27
+ function normalizePatterns(patterns) {
28
+ if (patterns === void 0) return [];
29
+ const list = typeof patterns === "string" ? [patterns] : patterns;
30
+ const out = [];
31
+ for (const raw of list) {
32
+ if (typeof raw !== "string") continue;
33
+ const parts = raw.split(",");
34
+ for (const part of parts) {
35
+ const trimmed = part.trim();
36
+ if (trimmed === "" && parts.length > 1) continue;
37
+ if (trimmed !== "") out.push(trimmed);
38
+ }
39
+ }
40
+ return out;
41
+ }
42
+ function exclusionRank(pattern) {
43
+ if (pattern === "!*") return 0;
44
+ return pattern.startsWith("!") ? 1 : 2;
45
+ }
46
+ function matchPattern(item, pattern) {
47
+ if (pattern === "*") return true;
48
+ const value = item.toLowerCase();
49
+ const glob = pattern.toLowerCase();
50
+ if (value === glob) return true;
51
+ if (glob.startsWith("*") && glob.endsWith("*")) {
52
+ if (value.includes(glob.slice(1, -1))) return true;
53
+ }
54
+ if (glob.startsWith("*") && value.endsWith(glob.slice(1))) return true;
55
+ if (glob.endsWith("*") && value.startsWith(glob.slice(0, -1))) return true;
56
+ return false;
57
+ }
58
+ function resolveToolPolicy(policy, tool) {
59
+ let resolved;
60
+ for (const rule of policy ?? []) {
61
+ if (matchesTool(rule, tool)) resolved = rule.policy;
62
+ }
63
+ return resolved;
64
+ }
65
+ function matchesTool(match, tool) {
66
+ var _a, _b, _c;
67
+ const facets = {
68
+ name: tool.name ?? "",
69
+ group: tool.group ?? "",
70
+ parent: tool.parent ?? "",
71
+ entity: tool.entity ?? "",
72
+ action: tool.action ?? "",
73
+ verb: tool.verb ?? "",
74
+ method: tool.method ?? "",
75
+ scope: tool.scope ?? ""
76
+ };
77
+ for (const facet of MATCH_FACETS) {
78
+ if (!matchItems(facets[facet], match[facet])) return false;
79
+ }
80
+ return matchesHint(match.readOnly, (_a = tool.annotations) == null ? void 0 : _a.readOnlyHint) && matchesHint(match.destructive, (_b = tool.annotations) == null ? void 0 : _b.destructiveHint) && matchesHint(match.idempotent, (_c = tool.annotations) == null ? void 0 : _c.idempotentHint);
81
+ }
82
+ function matchesHint(want, have) {
83
+ if (want === void 0) return true;
84
+ return have !== void 0 && have === want;
85
+ }
86
+ function toolPolicyFromPreferences(prefs) {
87
+ const keys = Object.keys(prefs ?? {}).filter((key) => key.trim() !== "").sort();
88
+ if (keys.length === 0) return [];
89
+ const policies = /* @__PURE__ */ new Map();
90
+ for (const key of keys) {
91
+ const policy = normalizeToolPolicy(prefs == null ? void 0 : prefs[key]);
92
+ if (policy) policies.set(key, policy);
93
+ }
94
+ const ordered = [...policies.keys()];
95
+ return [
96
+ ...ordered.map((key) => ({ group: key, policy: policies.get(key) })),
97
+ ...ordered.map((key) => ({ name: key, policy: policies.get(key) }))
98
+ ];
99
+ }
100
+ function appendToolPolicy(earlier, later) {
101
+ return [...earlier ?? [], ...later ?? []];
102
+ }
103
+ function normalizeToolPolicyRules(value) {
104
+ if (!Array.isArray(value)) return [];
105
+ const rules = [];
106
+ for (const raw of value) {
107
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) continue;
108
+ const item = raw;
109
+ const policy = normalizeToolPolicy(item.policy);
110
+ if (!policy) continue;
111
+ const match = {};
112
+ for (const facet of MATCH_FACETS) {
113
+ const patterns = normalizePatterns(item[facet]);
114
+ if (patterns.length > 0) match[facet] = patterns;
115
+ }
116
+ for (const hint of ["readOnly", "destructive", "idempotent"]) {
117
+ if (typeof item[hint] === "boolean") match[hint] = item[hint];
118
+ }
119
+ if (Object.keys(match).length === 0) continue;
120
+ rules.push({ ...match, policy });
121
+ }
122
+ return rules;
123
+ }
124
+ export {
125
+ appendToolPolicy,
126
+ matchItems,
127
+ matchesTool,
128
+ normalizeToolPolicyRules,
129
+ resolveToolPolicy,
130
+ toolPolicyFromPreferences
131
+ };
132
+ //# sourceMappingURL=tool-policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-policy.js","sources":["../../../src/data/chat/tool-policy.ts"],"sourcesContent":["import type { ToolMeta, ToolPolicy } from \"./types\";\nimport { normalizeToolPolicy } from \"./types\";\n\n/** The client half of Captain's ordered tool-permission policy.\n *\n * A tool's authority is decided by an ordered rule list evaluated\n * last-match-wins: weakest rule first, strongest last. The layers this file\n * composes are the surface's rules (what the page the chat opened on declares)\n * followed by the user's own (what they toggled in the preferences popover), so\n * a toggle beats the surface and the surface beats the application's baseline —\n * which the server appends underneath both.\n *\n * The matching is a port of Go's `commons/collections.MatchItems`, and it is a\n * port rather than a re-interpretation on purpose: the same rule list is\n * evaluated on both sides of the wire — here to render what a tool will do, and\n * on the server to enforce it — and a client that disagreed would show a state\n * the request does not produce. */\n\n/** A glob pattern list. A bare string is one pattern, so a rule can be written\n * `{ group: \"provider.xero.*\" }` without list ceremony. */\nexport type MatchPatterns = string | string[];\n\n/** Which tools a rule applies to. Every declared facet must match (AND across\n * facets); within one facet the patterns are alternatives (OR). An undeclared\n * facet does not constrain. */\nexport type ToolMatch = {\n name?: MatchPatterns;\n group?: MatchPatterns;\n parent?: MatchPatterns;\n entity?: MatchPatterns;\n action?: MatchPatterns;\n verb?: MatchPatterns;\n method?: MatchPatterns;\n scope?: MatchPatterns;\n /** A declared hint requires the tool to declare the same hint with the same\n * value. An undeclared hint on the tool does NOT match: \"this tool never said\n * whether it is read-only\" and \"this tool said it is not\" are different\n * claims, and reading the first as the second is how an unannotated tool\n * would inherit a permissive rule. */\n readOnly?: boolean;\n destructive?: boolean;\n idempotent?: boolean;\n};\n\n/** One ordered rule: the tools it selects and the authority they get. */\nexport type PermissionRule = ToolMatch & { policy: ToolPolicy };\n\n/** The ordered rule list, evaluated last-match-wins. */\nexport type PermissionPolicy = PermissionRule[];\n\nconst MATCH_FACETS = [\n \"name\",\n \"group\",\n \"parent\",\n \"entity\",\n \"action\",\n \"verb\",\n \"method\",\n \"scope\",\n] as const;\n\n/** Reports whether `item` satisfies these patterns, following MatchItems:\n * `!` negates and takes precedence over any positive match, `*` wildcards a\n * prefix, suffix or the whole item, matching is case-insensitive, and one\n * string may carry comma-separated alternatives. An empty list matches\n * everything — an undeclared facet imposes no constraint. */\nexport function matchItems(\n item: string,\n patterns: MatchPatterns | undefined,\n): boolean {\n const normalized = normalizePatterns(patterns);\n if (normalized.length === 0) return true;\n // Exclusions are checked first so `!` wins however the rule was written:\n // [\"a*\", \"!abc\"] must reject \"abc\" rather than accept it on the wildcard.\n const sorted = [...normalized].sort(\n (a, b) => exclusionRank(a) - exclusionRank(b),\n );\n for (const pattern of sorted) {\n if (pattern.startsWith(\"!\")) {\n if (matchPattern(item, pattern.slice(1))) return false;\n continue;\n }\n if (matchPattern(item, pattern)) return true;\n }\n // Every pattern excluded and none of them matched, so the item is admitted.\n return sorted.every((pattern) => pattern.startsWith(\"!\"));\n}\n\nfunction normalizePatterns(patterns: MatchPatterns | undefined): string[] {\n if (patterns === undefined) return [];\n const list = typeof patterns === \"string\" ? [patterns] : patterns;\n const out: string[] = [];\n for (const raw of list) {\n if (typeof raw !== \"string\") continue;\n const parts = raw.split(\",\");\n for (const part of parts) {\n const trimmed = part.trim();\n if (trimmed === \"\" && parts.length > 1) continue;\n if (trimmed !== \"\") out.push(trimmed);\n }\n }\n return out;\n}\n\nfunction exclusionRank(pattern: string): number {\n if (pattern === \"!*\") return 0;\n return pattern.startsWith(\"!\") ? 1 : 2;\n}\n\nfunction matchPattern(item: string, pattern: string): boolean {\n if (pattern === \"*\") return true;\n const value = item.toLowerCase();\n const glob = pattern.toLowerCase();\n if (value === glob) return true;\n if (glob.startsWith(\"*\") && glob.endsWith(\"*\")) {\n if (value.includes(glob.slice(1, -1))) return true;\n }\n if (glob.startsWith(\"*\") && value.endsWith(glob.slice(1))) return true;\n if (glob.endsWith(\"*\") && value.startsWith(glob.slice(0, -1))) return true;\n return false;\n}\n\n/** Resolves the authority for one tool: the policy of the LAST rule that\n * matches it, or undefined when no rule does.\n *\n * Last, not first, because the list runs weakest to strongest — a user rule\n * appended after a surface rule is meant to win. A first-match-wins reading\n * would invert the whole contract. */\nexport function resolveToolPolicy(\n policy: PermissionPolicy | undefined,\n tool: ToolMeta,\n): ToolPolicy | undefined {\n let resolved: ToolPolicy | undefined;\n for (const rule of policy ?? []) {\n if (matchesTool(rule, tool)) resolved = rule.policy;\n }\n return resolved;\n}\n\nexport function matchesTool(match: ToolMatch, tool: ToolMeta): boolean {\n const facets: Record<(typeof MATCH_FACETS)[number], string> = {\n name: tool.name ?? \"\",\n group: tool.group ?? \"\",\n parent: tool.parent ?? \"\",\n entity: tool.entity ?? \"\",\n action: tool.action ?? \"\",\n verb: tool.verb ?? \"\",\n method: tool.method ?? \"\",\n scope: tool.scope ?? \"\",\n };\n for (const facet of MATCH_FACETS) {\n if (!matchItems(facets[facet], match[facet])) return false;\n }\n return (\n matchesHint(match.readOnly, tool.annotations?.readOnlyHint) &&\n matchesHint(match.destructive, tool.annotations?.destructiveHint) &&\n matchesHint(match.idempotent, tool.annotations?.idempotentHint)\n );\n}\n\nfunction matchesHint(want: boolean | undefined, have: boolean | undefined) {\n if (want === undefined) return true;\n return have !== undefined && have === want;\n}\n\n/** Lowers a flat tool→policy map into ordered rules, so the legacy shape and the\n * rule list share one evaluation path instead of two that can disagree.\n *\n * A key is ambiguous — it may name a tool or its group — so each key emits both\n * a group rule and a name rule, with every group rule placed before every name\n * rule. A key that names a group matches no tool name and vice versa, so the\n * ambiguity costs nothing; and where a key is both, the name rule comes later\n * and wins. That is exactly the precedence the popover needs, where a per-tool\n * toggle must beat the group toggle above it.\n *\n * Keys are sorted so the request body is stable: an unstable order would make\n * every render look like a changed request. */\nexport function toolPolicyFromPreferences(\n prefs: Record<string, ToolPolicy> | undefined,\n): PermissionPolicy {\n const keys = Object.keys(prefs ?? {})\n .filter((key) => key.trim() !== \"\")\n .sort();\n if (keys.length === 0) return [];\n const policies = new Map<string, ToolPolicy>();\n for (const key of keys) {\n const policy = normalizeToolPolicy(prefs?.[key]);\n if (policy) policies.set(key, policy);\n }\n const ordered = [...policies.keys()];\n return [\n ...ordered.map((key) => ({ group: key, policy: policies.get(key)! })),\n ...ordered.map((key) => ({ name: key, policy: policies.get(key)! })),\n ];\n}\n\n/** Appends `later` onto `earlier`, the later winning. Composition rather than\n * mutation, so one caller's user rules cannot leak into another's. */\nexport function appendToolPolicy(\n earlier: PermissionPolicy | undefined,\n later: PermissionPolicy | undefined,\n): PermissionPolicy {\n return [...(earlier ?? []), ...(later ?? [])];\n}\n\n/** Parses a rule list off the wire, dropping anything malformed rather than\n * letting it silently become the last word on every tool: a rule with no facet\n * matches everything, and being last-match-wins that is the one mistake with\n * unbounded reach. */\nexport function normalizeToolPolicyRules(value: unknown): PermissionPolicy {\n if (!Array.isArray(value)) return [];\n const rules: PermissionPolicy = [];\n for (const raw of value) {\n if (!raw || typeof raw !== \"object\" || Array.isArray(raw)) continue;\n const item = raw as Record<string, unknown>;\n const policy = normalizeToolPolicy(item.policy);\n if (!policy) continue;\n const match: ToolMatch = {};\n for (const facet of MATCH_FACETS) {\n const patterns = normalizePatterns(item[facet] as MatchPatterns);\n if (patterns.length > 0) match[facet] = patterns;\n }\n for (const hint of [\"readOnly\", \"destructive\", \"idempotent\"] as const) {\n if (typeof item[hint] === \"boolean\") match[hint] = item[hint] as boolean;\n }\n if (Object.keys(match).length === 0) continue;\n rules.push({ ...match, policy });\n }\n return rules;\n}\n"],"names":[],"mappings":";AAkDA,MAAM,eAAe;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAOO,SAAS,WACd,MACA,UACS;AACT,QAAM,aAAa,kBAAkB,QAAQ;AAC7C,MAAI,WAAW,WAAW,EAAG,Q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
  }
54
54
  ];
55
+ function normalizeToolPolicy(value) {
56
+ if (typeof value !== "string") return void 0;
57
+ switch (value.trim().toLowerCase()) {
58
+ case "allow":
59
+ case "on":
60
+ case "enabled":
61
+ return "allow";
62
+ case "ask":
63
+ return "ask";
64
+ case "deny":
65
+ case "off":
66
+ case "disabled":
67
+ return "deny";
68
+ case "auto":
69
+ return "auto";
70
+ default:
71
+ return void 0;
72
+ }
73
+ }
55
74
  function isDynamicToolPart(part) {
56
75
  return part.type === "dynamic-tool";
57
76
  }
@@ -70,6 +89,7 @@ exports.isDynamicToolPart = isDynamicToolPart;
70
89
  exports.isFilePart = isFilePart;
71
90
  exports.isReasoningPart = isReasoningPart;
72
91
  exports.isTypedToolPart = isTypedToolPart;
92
+ exports.normalizeToolPolicy = normalizeToolPolicy;
73
93
  exports.suggestionLabel = suggestionLabel;
74
94
  exports.suggestionPrompt = suggestionPrompt;
75
95
  exports.toolPartName = toolPartName;
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","sources":["../../../src/data/chat/types.ts"],"sourcesContent":["import type {\n UIMessage,\n ToolUIPart,\n DynamicToolUIPart,\n ChatStatus,\n ReasoningUIPart,\n FileUIPart,\n} from \"ai\";\nimport type { ReactNode } from \"react\";\nimport type {\n JsonSchemaObject,\n JsonSchemaProperty as FormJsonSchemaProperty,\n} from \"../../components/json-schema-form-types\";\n\nexport type {\n UIMessage,\n ToolUIPart,\n DynamicToolUIPart,\n ChatStatus,\n ReasoningUIPart,\n FileUIPart,\n};\n\n/** A selectable chat model, as served by the backend's GET /api/chat/models.\n * `configured` is false for catalogued models whose provider has no API key. */\nexport interface ChatModelRuntime {\n model?: string;\n id?: string;\n backend?: string;\n mode?: string;\n temperature?: number;\n effort?: string;\n noCache?: boolean;\n fallbacks?: ChatModelRuntime[];\n}\n\nexport type RuntimeAvailabilityState =\n | \"available\"\n | \"disabled\"\n | \"missing_credentials\"\n | \"not_authenticated\"\n | \"missing_executable\"\n | \"missing_dependency\"\n | \"unsupported\"\n | \"unavailable\";\n\nexport interface RuntimeAvailability {\n state: RuntimeAvailabilityState;\n reason?: string;\n remediation?: string;\n}\n\nexport interface ChatModel {\n id: string;\n provider: string;\n label: string;\n /** Exact Captain Model wire value submitted when this display row is selected. */\n runtime?: ChatModelRuntime;\n reasoning: boolean;\n /** True when backend metadata is authoritative, including explicit unsupported values. */\n capabilitiesKnown?: boolean;\n /** Ordered reasoning-effort tiers accepted by this exact model. */\n supportedEfforts?: string[];\n /** Backend-recommended effort used when the current selection is invalid. */\n defaultEffort?: string;\n /** Whether the model honours the temperature sampling control. */\n temperature?: boolean;\n configured?: boolean;\n availability?: RuntimeAvailability;\n /**\n * The catalog's own declared default — the row a picker seeds with when the\n * caller names no model. At most one row carries it, and a catalog that\n * declares none (or whose default is unconfigured) falls back to the first\n * configured row.\n */\n default?: boolean;\n /** Concrete runtime backends that advertised this model. Empty/omitted means provider-wide. */\n backends?: string[];\n /** Max context tokens — the denominator for a usage gauge. */\n contextWindow?: number;\n /** MIME patterns accepted as model inputs, e.g. image/* or application/pdf. */\n inputMediaTypes?: string[];\n}\n\n/** Per-message metadata the backend rides on the SSE `finish` part\n * (`messageMetadata`), applied by the AI SDK to the assistant `UIMessage`. */\nexport interface ChatMessageMetadata {\n backend?: string;\n executionMode?: string;\n model?: string;\n captainSessionId?: string;\n providerSessionId?: string;\n threadId?: string;\n turnId?: string;\n success?: boolean;\n interrupted?: boolean;\n usage?: ChatUsageBreakdown;\n costBreakdown?: ChatCostBreakdown;\n /** This turn's cost in USD. */\n cost?: number;\n /** Cumulative thread cost in USD (when the turn is persisted to a thread). */\n threadCostUsd?: number;\n /** This turn's input-token count, ≈ current context-window occupancy. */\n contextTokens?: number;\n}\n\n/** A flattened usage snapshot a chat surfaces for a gauge: tokens used out of the\n * model's context window, plus cumulative cost. */\nexport interface ChatUsageSummary {\n usedTokens: number;\n maxTokens: number;\n cost?: number;\n usage?: ChatUsageBreakdown;\n costBreakdown?: ChatCostBreakdown;\n messageCount: number;\n backend?: string;\n executionMode?: string;\n model?: string;\n captainSessionId?: string;\n providerSessionId?: string;\n threadId?: string;\n turnId?: string;\n success?: boolean;\n interrupted?: boolean;\n /** @deprecated Use `model`; retained for compatibility with existing consumers. */\n modelLabel?: string;\n}\n\nexport interface ChatBudgetConfig {\n /** Per-thread/request cost cap in USD. */\n cost?: number;\n /** Max output tokens for one model call. */\n maxTokens?: number;\n}\n\nexport interface ChatUsageBreakdown {\n inputTokens?: number;\n outputTokens?: number;\n reasoningTokens?: number;\n cacheReadTokens?: number;\n cacheWriteTokens?: number;\n totalTokens?: number;\n}\n\nexport interface ChatCostBreakdown {\n model?: string;\n inputUsd?: number;\n outputUsd?: number;\n reasoningUsd?: number;\n cacheReadUsd?: number;\n cacheWriteUsd?: number;\n totalUsd?: number;\n}\n\n/** A suggested prompt shown on the empty state. A bare string is both the label\n * and the submitted text; the object form separates them. */\nexport type Suggestion = string | { label: string; prompt: string };\n\n/** The label shown for a suggestion. */\nexport function suggestionLabel(s: Suggestion): string {\n return typeof s === \"string\" ? s : s.label;\n}\n\n/** The text submitted when a suggestion is clicked. */\nexport function suggestionPrompt(s: Suggestion): string {\n return typeof s === \"string\" ? s : s.prompt;\n}\n\n/** Returns true for an assistant reasoning (\"thinking\") part. */\nexport function isReasoningPart(part: {\n type: string;\n}): part is ReasoningUIPart {\n return part.type === \"reasoning\";\n}\n\n/** Returns true for a file/attachment part. */\nexport function isFilePart(part: { type: string }): part is FileUIPart {\n return part.type === \"file\";\n}\n\n/** A tool part as it appears in an assistant UIMessage — either a typed\n * `tool-<name>` part or the generic `dynamic-tool` part. clicky operations\n * surface as dynamic tools, so the chat UI renders both shapes. */\nexport type AnyToolPart = ToolUIPart | DynamicToolUIPart;\n\n/** Claude Agent SDK permission modes accepted by `permissionMode`. */\nexport const CLAUDE_PERMISSION_MODES = [\n \"default\",\n \"acceptEdits\",\n \"bypassPermissions\",\n \"plan\",\n \"dontAsk\",\n \"auto\",\n] as const;\n\nexport type ClaudePermissionMode = (typeof CLAUDE_PERMISSION_MODES)[number];\n\nexport type ClaudePermissionModeOption = {\n value: ClaudePermissionMode;\n label: string;\n description: string;\n};\n\nexport const CLAUDE_PERMISSION_MODE_OPTIONS: ClaudePermissionModeOption[] = [\n {\n value: \"default\",\n label: \"Default\",\n description:\n \"Prompt for dangerous operations using standard Claude behavior.\",\n },\n {\n value: \"auto\",\n label: \"Auto\",\n description:\n \"Use Claude's classifier to approve or deny permission prompts.\",\n },\n {\n value: \"acceptEdits\",\n label: \"Accept edits\",\n description: \"Automatically accept file edit operations.\",\n },\n {\n value: \"dontAsk\",\n label: \"Don't ask\",\n description: \"Do not prompt; deny actions that are not pre-approved.\",\n },\n {\n value: \"plan\",\n label: \"Plan\",\n description: \"Planning mode with no tool execution.\",\n },\n {\n value: \"bypassPermissions\",\n label: \"Bypass\",\n description:\n \"Bypass permission checks when explicitly allowed by the host.\",\n },\n];\n\n/** Tool metadata shared by the chat shell. It both configures the\n * tool-preferences popover (`name`/`label`/`group`) and carries the schema\n * derived from a clicky RPC operation (`description`/`inputSchema`). The Go\n * backend owns execution; the client uses this only for display and to scope\n * which tools a request may call (passed in the transport `body`). */\nexport type ToolMode = \"on\" | \"ask\" | \"off\" | \"auto\";\n\nexport interface ToolAnnotations {\n title?: string;\n readOnlyHint?: boolean;\n destructiveHint?: boolean;\n idempotentHint?: boolean;\n openWorldHint?: boolean;\n [key: string]: unknown;\n}\n\nexport interface ToolMeta {\n /** Stable tool name sent to the model (the operation id). */\n name: string;\n /** Human-readable label shown in the tool-preferences popover. */\n label: string;\n /** Bucket heading in the popover — the clicky surface for RPC operations. */\n group?: string;\n /** Display title of the tool's parent surface/entity (e.g. \"Xero Accounts\").\n * Used to nest tools under their entity within a group, and as the\n * disambiguating prefix in flat lists so sibling verbs (\"List\", \"Get\") stay\n * distinguishable. Resolved from the operation's `x-clicky.surface`. */\n parent?: string;\n /** Raw entity name of the tool's surface (e.g. \"accounts\"), when known. */\n entity?: string;\n /** Preference key sent to the backend. Defaults to `name`; group-backed\n * clicky tools set this to the backend tool group. */\n preferenceKey?: string;\n /** Initial backend-owned permission when the chat window first sees this tool. */\n defaultPermission?: ToolMode;\n /** Opaque icon name emitted by the backend, resolved by the host UI. */\n icon?: string;\n /** Description shown in tool pickers / tool-call headers. */\n description?: string;\n /** Short usage hints shown in the tool browser. */\n hints?: string[];\n source?: \"clicky\" | \"custom\" | \"mcp\" | string;\n server?: string;\n method?: string;\n path?: string;\n operationName?: string;\n title?: string;\n /** Whether the runtime should treat the tool input schema as strict/closed. */\n strict?: boolean;\n /** Runtime tool annotations/hints, e.g. MCP/Genkit well-known hints. */\n annotations?: ToolAnnotations;\n /** JSON-Schema for the tool's input, assembled from an operation's\n * parameters + request body. Omitted for hand-authored tools. */\n inputSchema?: ChatToolInputSchema;\n outputSchema?: ChatToolInputSchema;\n}\n\nexport type ChatToolInputSchema = JsonSchemaObject;\nexport type JsonSchemaProperty = FormJsonSchemaProperty;\nexport type JSONSchemaProperty = FormJsonSchemaProperty;\n\n/** Returns true for a `dynamic-tool` part (clicky operations surface this way). */\nexport function isDynamicToolPart(part: {\n type: string;\n}): part is DynamicToolUIPart {\n return part.type === \"dynamic-tool\";\n}\n\n/** Returns true for a typed `tool-<name>` part. */\nexport function isTypedToolPart(part: { type: string }): part is ToolUIPart {\n return part.type.startsWith(\"tool-\");\n}\n\n/** The display name of a tool part: the explicit `toolName` for dynamic tools,\n * otherwise the suffix after `tool-`. */\nexport function toolPartName(part: AnyToolPart): string {\n if (isDynamicToolPart(part)) {\n return part.toolName;\n }\n return part.type.slice(\"tool-\".length);\n}\n\nexport interface ToolResultRenderArgs {\n part: AnyToolPart;\n toolName: string;\n output: unknown;\n}\n\nexport type ToolResultRenderer = (args: ToolResultRenderArgs) => ReactNode;\n"],"names":[],"mappings":";;AA+JO,SAAS,gBAAgB,GAAuB;AACrD,SAAO,OAAO,MAAM,WAAW,IAAI,EAAE;AACvC;AAGO,SAAS,iBAAiB,GAAuB;AACtD,SAAO,OAAO,MAAM,WAAW,IAAI,EAAE;AACvC;AAGO,SAAS,gBAAgB,MAEJ;AAC1B,SAAO,KAAK,SAAS;AACvB;AAGO,SAAS,WAAW,MAA4C;AACrE,SAAO,KAAK,SAAS;AACvB;AAQO,MAAM,0BAA0B;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAUO,MAAM,iCAA+D;AAAA,EAC1E;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aACE;AAAA,EAAA;AAAA,EAEJ;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aACE;AAAA,EAAA;AAAA,EAEJ;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,EAAA;AAAA,EAEf;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,EAAA;AAAA,EAEf;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,EAAA;AAAA,EAEf;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aACE;AAAA,EAAA;AAEN;AAgEO,SAAS,kBAAkB,MAEJ;AAC5B,SAAO,KAAK,SAAS;AACvB;AAGO,SAAS,gBAAgB,MAA4C;AAC1E,SAAO,KAAK,KAAK,WAAW,OAAO;AACrC;AAIO,SAAS,aAAa,MAA2B;AACtD,MAAI,kBAAkB,IAAI,GAAG;AAC3B,WAAO,KAAK;AAAA,EACd;AACA,SAAO,KAAK,KAAK,MAAM,QAAQ,MAAM;AACvC;;;;;;;;;;"}
1
+ {"version":3,"file":"types.cjs","sources":["../../../src/data/chat/types.ts"],"sourcesContent":["import type {\n UIMessage,\n ToolUIPart,\n DynamicToolUIPart,\n ChatStatus,\n ReasoningUIPart,\n FileUIPart,\n} from \"ai\";\nimport type { ReactNode } from \"react\";\nimport type {\n JsonSchemaObject,\n JsonSchemaProperty as FormJsonSchemaProperty,\n} from \"../../components/json-schema-form-types\";\n\nexport type {\n UIMessage,\n ToolUIPart,\n DynamicToolUIPart,\n ChatStatus,\n ReasoningUIPart,\n FileUIPart,\n};\n\n/** A selectable chat model, as served by the backend's GET /api/chat/models.\n * `configured` is false for catalogued models whose provider has no API key. */\nexport interface ChatModelRuntime {\n model?: string;\n id?: string;\n backend?: string;\n mode?: string;\n temperature?: number;\n effort?: string;\n noCache?: boolean;\n fallbacks?: ChatModelRuntime[];\n}\n\nexport type RuntimeAvailabilityState =\n | \"available\"\n | \"disabled\"\n | \"missing_credentials\"\n | \"not_authenticated\"\n | \"missing_executable\"\n | \"missing_dependency\"\n | \"unsupported\"\n | \"unavailable\";\n\nexport interface RuntimeAvailability {\n state: RuntimeAvailabilityState;\n reason?: string;\n remediation?: string;\n}\n\nexport interface ChatModel {\n id: string;\n provider: string;\n label: string;\n /** Exact Captain Model wire value submitted when this display row is selected. */\n runtime?: ChatModelRuntime;\n reasoning: boolean;\n /** True when backend metadata is authoritative, including explicit unsupported values. */\n capabilitiesKnown?: boolean;\n /** Ordered reasoning-effort tiers accepted by this exact model. */\n supportedEfforts?: string[];\n /** Backend-recommended effort used when the current selection is invalid. */\n defaultEffort?: string;\n /** Whether the model honours the temperature sampling control. */\n temperature?: boolean;\n configured?: boolean;\n availability?: RuntimeAvailability;\n /**\n * The catalog's own declared default — the row a picker seeds with when the\n * caller names no model. At most one row carries it, and a catalog that\n * declares none (or whose default is unconfigured) falls back to the first\n * configured row.\n */\n default?: boolean;\n /** Concrete runtime backends that advertised this model. Empty/omitted means provider-wide. */\n backends?: string[];\n /** Max context tokens — the denominator for a usage gauge. */\n contextWindow?: number;\n /** MIME patterns accepted as model inputs, e.g. image/* or application/pdf. */\n inputMediaTypes?: string[];\n}\n\n/** Per-message metadata the backend rides on the SSE `finish` part\n * (`messageMetadata`), applied by the AI SDK to the assistant `UIMessage`. */\nexport interface ChatMessageMetadata {\n backend?: string;\n executionMode?: string;\n model?: string;\n captainSessionId?: string;\n providerSessionId?: string;\n threadId?: string;\n turnId?: string;\n success?: boolean;\n interrupted?: boolean;\n usage?: ChatUsageBreakdown;\n costBreakdown?: ChatCostBreakdown;\n /** This turn's cost in USD. */\n cost?: number;\n /** Cumulative thread cost in USD (when the turn is persisted to a thread). */\n threadCostUsd?: number;\n /** This turn's input-token count, ≈ current context-window occupancy. */\n contextTokens?: number;\n}\n\n/** A flattened usage snapshot a chat surfaces for a gauge: tokens used out of the\n * model's context window, plus cumulative cost. */\nexport interface ChatUsageSummary {\n usedTokens: number;\n maxTokens: number;\n cost?: number;\n usage?: ChatUsageBreakdown;\n costBreakdown?: ChatCostBreakdown;\n messageCount: number;\n backend?: string;\n executionMode?: string;\n model?: string;\n captainSessionId?: string;\n providerSessionId?: string;\n threadId?: string;\n turnId?: string;\n success?: boolean;\n interrupted?: boolean;\n /** @deprecated Use `model`; retained for compatibility with existing consumers. */\n modelLabel?: string;\n}\n\nexport interface ChatBudgetConfig {\n /** Per-thread/request cost cap in USD. */\n cost?: number;\n /** Max output tokens for one model call. */\n maxTokens?: number;\n}\n\nexport interface ChatUsageBreakdown {\n inputTokens?: number;\n outputTokens?: number;\n reasoningTokens?: number;\n cacheReadTokens?: number;\n cacheWriteTokens?: number;\n totalTokens?: number;\n}\n\nexport interface ChatCostBreakdown {\n model?: string;\n inputUsd?: number;\n outputUsd?: number;\n reasoningUsd?: number;\n cacheReadUsd?: number;\n cacheWriteUsd?: number;\n totalUsd?: number;\n}\n\n/** A suggested prompt shown on the empty state. A bare string is both the label\n * and the submitted text; the object form separates them. */\nexport type Suggestion = string | { label: string; prompt: string };\n\n/** The label shown for a suggestion. */\nexport function suggestionLabel(s: Suggestion): string {\n return typeof s === \"string\" ? s : s.label;\n}\n\n/** The text submitted when a suggestion is clicked. */\nexport function suggestionPrompt(s: Suggestion): string {\n return typeof s === \"string\" ? s : s.prompt;\n}\n\n/** Returns true for an assistant reasoning (\"thinking\") part. */\nexport function isReasoningPart(part: {\n type: string;\n}): part is ReasoningUIPart {\n return part.type === \"reasoning\";\n}\n\n/** Returns true for a file/attachment part. */\nexport function isFilePart(part: { type: string }): part is FileUIPart {\n return part.type === \"file\";\n}\n\n/** A tool part as it appears in an assistant UIMessage — either a typed\n * `tool-<name>` part or the generic `dynamic-tool` part. clicky operations\n * surface as dynamic tools, so the chat UI renders both shapes. */\nexport type AnyToolPart = ToolUIPart | DynamicToolUIPart;\n\n/** Claude Agent SDK permission modes accepted by `permissionMode`. */\nexport const CLAUDE_PERMISSION_MODES = [\n \"default\",\n \"acceptEdits\",\n \"bypassPermissions\",\n \"plan\",\n \"dontAsk\",\n \"auto\",\n] as const;\n\nexport type ClaudePermissionMode = (typeof CLAUDE_PERMISSION_MODES)[number];\n\nexport type ClaudePermissionModeOption = {\n value: ClaudePermissionMode;\n label: string;\n description: string;\n};\n\nexport const CLAUDE_PERMISSION_MODE_OPTIONS: ClaudePermissionModeOption[] = [\n {\n value: \"default\",\n label: \"Default\",\n description:\n \"Prompt for dangerous operations using standard Claude behavior.\",\n },\n {\n value: \"auto\",\n label: \"Auto\",\n description:\n \"Use Claude's classifier to approve or deny permission prompts.\",\n },\n {\n value: \"acceptEdits\",\n label: \"Accept edits\",\n description: \"Automatically accept file edit operations.\",\n },\n {\n value: \"dontAsk\",\n label: \"Don't ask\",\n description: \"Do not prompt; deny actions that are not pre-approved.\",\n },\n {\n value: \"plan\",\n label: \"Plan\",\n description: \"Planning mode with no tool execution.\",\n },\n {\n value: \"bypassPermissions\",\n label: \"Bypass\",\n description:\n \"Bypass permission checks when explicitly allowed by the host.\",\n },\n];\n\n/** Tool metadata shared by the chat shell. It both configures the\n * tool-preferences popover (`name`/`label`/`group`) and carries the schema\n * derived from a clicky RPC operation (`description`/`inputSchema`). The Go\n * backend owns execution; the client uses this only for display and to scope\n * which tools a request may call (passed in the transport `body`). */\n/** Authority for one tool, in Captain's tool vocabulary. The legacy `on`/`off`\n * spellings are still accepted on the way in (see `normalizeToolPolicyValue`)\n * and mean `allow`/`deny`; they are never produced here. The UI still *labels*\n * these On and Off — see `POLICY_LABEL`. */\nexport type ToolPolicy = \"allow\" | \"ask\" | \"deny\" | \"auto\";\n\n/** Canonicalizes a tool policy from the wire, accepting the legacy `on`/`off`\n * spellings the backend still emits from older catalogs and MCP `_meta`.\n *\n * `on` means allow rather than auto: the catalog encoding has no separate allow\n * list, so `on` was always its way of saying auto-run. Keeping private copies of\n * this rule per call site is how the UI and the server drifted apart, so this is\n * the only one. */\nexport function normalizeToolPolicy(value: unknown): ToolPolicy | undefined {\n if (typeof value !== \"string\") return undefined;\n switch (value.trim().toLowerCase()) {\n case \"allow\":\n case \"on\":\n case \"enabled\":\n return \"allow\";\n case \"ask\":\n return \"ask\";\n case \"deny\":\n case \"off\":\n case \"disabled\":\n return \"deny\";\n case \"auto\":\n return \"auto\";\n default:\n return undefined;\n }\n}\n\nexport interface ToolAnnotations {\n title?: string;\n readOnlyHint?: boolean;\n destructiveHint?: boolean;\n idempotentHint?: boolean;\n openWorldHint?: boolean;\n [key: string]: unknown;\n}\n\nexport interface ToolMeta {\n /** Stable tool name sent to the model (the operation id). */\n name: string;\n /** Human-readable label shown in the tool-preferences popover. */\n label: string;\n /** Bucket heading in the popover — the clicky surface for RPC operations. */\n group?: string;\n /** Display title of the tool's parent surface/entity (e.g. \"Xero Accounts\").\n * Used to nest tools under their entity within a group, and as the\n * disambiguating prefix in flat lists so sibling verbs (\"List\", \"Get\") stay\n * distinguishable. Resolved from the operation's `x-clicky.surface`. */\n parent?: string;\n /** Raw entity name of the tool's surface (e.g. \"accounts\"), when known. */\n entity?: string;\n /** Preference key sent to the backend. Defaults to `name`; group-backed\n * clicky tools set this to the backend tool group. */\n preferenceKey?: string;\n /** Initial backend-owned permission when the chat window first sees this tool. */\n defaultPermission?: ToolPolicy;\n /** Opaque icon name emitted by the backend, resolved by the host UI. */\n icon?: string;\n /** Description shown in tool pickers / tool-call headers. */\n description?: string;\n /** Short usage hints shown in the tool browser. */\n hints?: string[];\n source?: \"clicky\" | \"custom\" | \"mcp\" | string;\n server?: string;\n method?: string;\n path?: string;\n operationName?: string;\n /** The entity verb (list/get/create/update/delete, or a custom action), the\n * custom action's name, and whether the operation addresses a collection or a\n * single entity. Carried so a permission rule resolves the same way here as\n * it does on the server; empty for a tool that projects no clicky operation.\n * @see resolveToolPolicy */\n verb?: string;\n action?: string;\n scope?: string;\n title?: string;\n /** Whether the runtime should treat the tool input schema as strict/closed. */\n strict?: boolean;\n /** Runtime tool annotations/hints, e.g. MCP/Genkit well-known hints. */\n annotations?: ToolAnnotations;\n /** JSON-Schema for the tool's input, assembled from an operation's\n * parameters + request body. Omitted for hand-authored tools. */\n inputSchema?: ChatToolInputSchema;\n outputSchema?: ChatToolInputSchema;\n}\n\nexport type ChatToolInputSchema = JsonSchemaObject;\nexport type JsonSchemaProperty = FormJsonSchemaProperty;\nexport type JSONSchemaProperty = FormJsonSchemaProperty;\n\n/** Returns true for a `dynamic-tool` part (clicky operations surface this way). */\nexport function isDynamicToolPart(part: {\n type: string;\n}): part is DynamicToolUIPart {\n return part.type === \"dynamic-tool\";\n}\n\n/** Returns true for a typed `tool-<name>` part. */\nexport function isTypedToolPart(part: { type: string }): part is ToolUIPart {\n return part.type.startsWith(\"tool-\");\n}\n\n/** The display name of a tool part: the explicit `toolName` for dynamic tools,\n * otherwise the suffix after `tool-`. */\nexport function toolPartName(part: AnyToolPart): string {\n if (isDynamicToolPart(part)) {\n return part.toolName;\n }\n return part.type.slice(\"tool-\".length);\n}\n\nexport interface ToolResultRenderArgs {\n part: AnyToolPart;\n toolName: string;\n output: unknown;\n}\n\nexport type ToolResultRenderer = (args: ToolResultRenderArgs) => ReactNode;\n"],"names":[],"mappings":";;AA+JO,SAAS,gBAAgB,GAAuB;AACrD,SAAO,OAAO,MAAM,WAAW,IAAI,EAAE;AACvC;AAGO,SAAS,iBAAiB,GAAuB;AACtD,SAAO,OAAO,MAAM,WAAW,IAAI,EAAE;AACvC;AAGO,SAAS,gBAAgB,MAEJ;AAC1B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AAM;AACvC;;;;;;;;;;;"}
@@ -152,7 +152,19 @@ export declare const CLAUDE_PERMISSION_MODE_OPTIONS: ClaudePermissionModeOption[
152
152
  * derived from a clicky RPC operation (`description`/`inputSchema`). The Go
153
153
  * backend owns execution; the client uses this only for display and to scope
154
154
  * which tools a request may call (passed in the transport `body`). */
155
- export type ToolMode = "on" | "ask" | "off" | "auto";
155
+ /** Authority for one tool, in Captain's tool vocabulary. The legacy `on`/`off`
156
+ * spellings are still accepted on the way in (see `normalizeToolPolicyValue`)
157
+ * and mean `allow`/`deny`; they are never produced here. The UI still *labels*
158
+ * these On and Off — see `POLICY_LABEL`. */
159
+ export type ToolPolicy = "allow" | "ask" | "deny" | "auto";
160
+ /** Canonicalizes a tool policy from the wire, accepting the legacy `on`/`off`
161
+ * spellings the backend still emits from older catalogs and MCP `_meta`.
162
+ *
163
+ * `on` means allow rather than auto: the catalog encoding has no separate allow
164
+ * list, so `on` was always its way of saying auto-run. Keeping private copies of
165
+ * this rule per call site is how the UI and the server drifted apart, so this is
166
+ * the only one. */
167
+ export declare function normalizeToolPolicy(value: unknown): ToolPolicy | undefined;
156
168
  export interface ToolAnnotations {
157
169
  title?: string;
158
170
  readOnlyHint?: boolean;
@@ -179,7 +191,7 @@ export interface ToolMeta {
179
191
  * clicky tools set this to the backend tool group. */
180
192
  preferenceKey?: string;
181
193
  /** Initial backend-owned permission when the chat window first sees this tool. */
182
- defaultPermission?: ToolMode;
194
+ defaultPermission?: ToolPolicy;
183
195
  /** Opaque icon name emitted by the backend, resolved by the host UI. */
184
196
  icon?: string;
185
197
  /** Description shown in tool pickers / tool-call headers. */
@@ -191,6 +203,14 @@ export interface ToolMeta {
191
203
  method?: string;
192
204
  path?: string;
193
205
  operationName?: string;
206
+ /** The entity verb (list/get/create/update/delete, or a custom action), the
207
+ * custom action's name, and whether the operation addresses a collection or a
208
+ * single entity. Carried so a permission rule resolves the same way here as
209
+ * it does on the server; empty for a tool that projects no clicky operation.
210
+ * @see resolveToolPolicy */
211
+ verb?: string;
212
+ action?: string;
213
+ scope?: string;
194
214
  title?: string;
195
215
  /** Whether the runtime should treat the tool input schema as strict/closed. */
196
216
  strict?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/data/chat/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,eAAe,EACf,UAAU,EACX,MAAM,IAAI,CAAC;AACZ,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EACV,gBAAgB,EAChB,kBAAkB,IAAI,sBAAsB,EAC7C,MAAM,yCAAyC,CAAC;AAEjD,YAAY,EACV,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,eAAe,EACf,UAAU,GACX,CAAC;AAEF;iFACiF;AACjF,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAChC;AAED,MAAM,MAAM,wBAAwB,GAChC,WAAW,GACX,UAAU,GACV,qBAAqB,GACrB,mBAAmB,GACnB,oBAAoB,GACpB,oBAAoB,GACpB,aAAa,GACb,aAAa,CAAC;AAElB,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,wBAAwB,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM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 +50,25 @@ const CLAUDE_PERMISSION_MODE_OPTIONS = [
50
50
  description: "Bypass permission checks when explicitly allowed by the host."
51
51
  }
52
52
  ];
53
+ function normalizeToolPolicy(value) {
54
+ if (typeof value !== "string") return void 0;
55
+ switch (value.trim().toLowerCase()) {
56
+ case "allow":
57
+ case "on":
58
+ case "enabled":
59
+ return "allow";
60
+ case "ask":
61
+ return "ask";
62
+ case "deny":
63
+ case "off":
64
+ case "disabled":
65
+ return "deny";
66
+ case "auto":
67
+ return "auto";
68
+ default:
69
+ return void 0;
70
+ }
71
+ }
53
72
  function isDynamicToolPart(part) {
54
73
  return part.type === "dynamic-tool";
55
74
  }
@@ -69,6 +88,7 @@ export {
69
88
  isFilePart,
70
89
  isReasoningPart,
71
90
  isTypedToolPart,
91
+ normalizeToolPolicy,
72
92
  suggestionLabel,
73
93
  suggestionPrompt,
74
94
  toolPartName
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../../src/data/chat/types.ts"],"sourcesContent":["import type {\n UIMessage,\n ToolUIPart,\n DynamicToolUIPart,\n ChatStatus,\n ReasoningUIPart,\n FileUIPart,\n} from \"ai\";\nimport type { ReactNode } from \"react\";\nimport type {\n JsonSchemaObject,\n JsonSchemaProperty as FormJsonSchemaProperty,\n} from \"../../components/json-schema-form-types\";\n\nexport type {\n UIMessage,\n ToolUIPart,\n DynamicToolUIPart,\n ChatStatus,\n ReasoningUIPart,\n FileUIPart,\n};\n\n/** A selectable chat model, as served by the backend's GET /api/chat/models.\n * `configured` is false for catalogued models whose provider has no API key. */\nexport interface ChatModelRuntime {\n model?: string;\n id?: string;\n backend?: string;\n mode?: string;\n temperature?: number;\n effort?: string;\n noCache?: boolean;\n fallbacks?: ChatModelRuntime[];\n}\n\nexport type RuntimeAvailabilityState =\n | \"available\"\n | \"disabled\"\n | \"missing_credentials\"\n | \"not_authenticated\"\n | \"missing_executable\"\n | \"missing_dependency\"\n | \"unsupported\"\n | \"unavailable\";\n\nexport interface RuntimeAvailability {\n state: RuntimeAvailabilityState;\n reason?: string;\n remediation?: string;\n}\n\nexport interface ChatModel {\n id: string;\n provider: string;\n label: string;\n /** Exact Captain Model wire value submitted when this display row is selected. */\n runtime?: ChatModelRuntime;\n reasoning: boolean;\n /** True when backend metadata is authoritative, including explicit unsupported values. */\n capabilitiesKnown?: boolean;\n /** Ordered reasoning-effort tiers accepted by this exact model. */\n supportedEfforts?: string[];\n /** Backend-recommended effort used when the current selection is invalid. */\n defaultEffort?: string;\n /** Whether the model honours the temperature sampling control. */\n temperature?: boolean;\n configured?: boolean;\n availability?: RuntimeAvailability;\n /**\n * The catalog's own declared default — the row a picker seeds with when the\n * caller names no model. At most one row carries it, and a catalog that\n * declares none (or whose default is unconfigured) falls back to the first\n * configured row.\n */\n default?: boolean;\n /** Concrete runtime backends that advertised this model. Empty/omitted means provider-wide. */\n backends?: string[];\n /** Max context tokens — the denominator for a usage gauge. */\n contextWindow?: number;\n /** MIME patterns accepted as model inputs, e.g. image/* or application/pdf. */\n inputMediaTypes?: string[];\n}\n\n/** Per-message metadata the backend rides on the SSE `finish` part\n * (`messageMetadata`), applied by the AI SDK to the assistant `UIMessage`. */\nexport interface ChatMessageMetadata {\n backend?: string;\n executionMode?: string;\n model?: string;\n captainSessionId?: string;\n providerSessionId?: string;\n threadId?: string;\n turnId?: string;\n success?: boolean;\n interrupted?: boolean;\n usage?: ChatUsageBreakdown;\n costBreakdown?: ChatCostBreakdown;\n /** This turn's cost in USD. */\n cost?: number;\n /** Cumulative thread cost in USD (when the turn is persisted to a thread). */\n threadCostUsd?: number;\n /** This turn's input-token count, ≈ current context-window occupancy. */\n contextTokens?: number;\n}\n\n/** A flattened usage snapshot a chat surfaces for a gauge: tokens used out of the\n * model's context window, plus cumulative cost. */\nexport interface ChatUsageSummary {\n usedTokens: number;\n maxTokens: number;\n cost?: number;\n usage?: ChatUsageBreakdown;\n costBreakdown?: ChatCostBreakdown;\n messageCount: number;\n backend?: string;\n executionMode?: string;\n model?: string;\n captainSessionId?: string;\n providerSessionId?: string;\n threadId?: string;\n turnId?: string;\n success?: boolean;\n interrupted?: boolean;\n /** @deprecated Use `model`; retained for compatibility with existing consumers. */\n modelLabel?: string;\n}\n\nexport interface ChatBudgetConfig {\n /** Per-thread/request cost cap in USD. */\n cost?: number;\n /** Max output tokens for one model call. */\n maxTokens?: number;\n}\n\nexport interface ChatUsageBreakdown {\n inputTokens?: number;\n outputTokens?: number;\n reasoningTokens?: number;\n cacheReadTokens?: number;\n cacheWriteTokens?: number;\n totalTokens?: number;\n}\n\nexport interface ChatCostBreakdown {\n model?: string;\n inputUsd?: number;\n outputUsd?: number;\n reasoningUsd?: number;\n cacheReadUsd?: number;\n cacheWriteUsd?: number;\n totalUsd?: number;\n}\n\n/** A suggested prompt shown on the empty state. A bare string is both the label\n * and the submitted text; the object form separates them. */\nexport type Suggestion = string | { label: string; prompt: string };\n\n/** The label shown for a suggestion. */\nexport function suggestionLabel(s: Suggestion): string {\n return typeof s === \"string\" ? s : s.label;\n}\n\n/** The text submitted when a suggestion is clicked. */\nexport function suggestionPrompt(s: Suggestion): string {\n return typeof s === \"string\" ? s : s.prompt;\n}\n\n/** Returns true for an assistant reasoning (\"thinking\") part. */\nexport function isReasoningPart(part: {\n type: string;\n}): part is ReasoningUIPart {\n return part.type === \"reasoning\";\n}\n\n/** Returns true for a file/attachment part. */\nexport function isFilePart(part: { type: string }): part is FileUIPart {\n return part.type === \"file\";\n}\n\n/** A tool part as it appears in an assistant UIMessage — either a typed\n * `tool-<name>` part or the generic `dynamic-tool` part. clicky operations\n * surface as dynamic tools, so the chat UI renders both shapes. */\nexport type AnyToolPart = ToolUIPart | DynamicToolUIPart;\n\n/** Claude Agent SDK permission modes accepted by `permissionMode`. */\nexport const CLAUDE_PERMISSION_MODES = [\n \"default\",\n \"acceptEdits\",\n \"bypassPermissions\",\n \"plan\",\n \"dontAsk\",\n \"auto\",\n] as const;\n\nexport type ClaudePermissionMode = (typeof CLAUDE_PERMISSION_MODES)[number];\n\nexport type ClaudePermissionModeOption = {\n value: ClaudePermissionMode;\n label: string;\n description: string;\n};\n\nexport const CLAUDE_PERMISSION_MODE_OPTIONS: ClaudePermissionModeOption[] = [\n {\n value: \"default\",\n label: \"Default\",\n description:\n \"Prompt for dangerous operations using standard Claude behavior.\",\n },\n {\n value: \"auto\",\n label: \"Auto\",\n description:\n \"Use Claude's classifier to approve or deny permission prompts.\",\n },\n {\n value: \"acceptEdits\",\n label: \"Accept edits\",\n description: \"Automatically accept file edit operations.\",\n },\n {\n value: \"dontAsk\",\n label: \"Don't ask\",\n description: \"Do not prompt; deny actions that are not pre-approved.\",\n },\n {\n value: \"plan\",\n label: \"Plan\",\n description: \"Planning mode with no tool execution.\",\n },\n {\n value: \"bypassPermissions\",\n label: \"Bypass\",\n description:\n \"Bypass permission checks when explicitly allowed by the host.\",\n },\n];\n\n/** Tool metadata shared by the chat shell. It both configures the\n * tool-preferences popover (`name`/`label`/`group`) and carries the schema\n * derived from a clicky RPC operation (`description`/`inputSchema`). The Go\n * backend owns execution; the client uses this only for display and to scope\n * which tools a request may call (passed in the transport `body`). */\nexport type ToolMode = \"on\" | \"ask\" | \"off\" | \"auto\";\n\nexport interface ToolAnnotations {\n title?: string;\n readOnlyHint?: boolean;\n destructiveHint?: boolean;\n idempotentHint?: boolean;\n openWorldHint?: boolean;\n [key: string]: unknown;\n}\n\nexport interface ToolMeta {\n /** Stable tool name sent to the model (the operation id). */\n name: string;\n /** Human-readable label shown in the tool-preferences popover. */\n label: string;\n /** Bucket heading in the popover — the clicky surface for RPC operations. */\n group?: string;\n /** Display title of the tool's parent surface/entity (e.g. \"Xero Accounts\").\n * Used to nest tools under their entity within a group, and as the\n * disambiguating prefix in flat lists so sibling verbs (\"List\", \"Get\") stay\n * distinguishable. Resolved from the operation's `x-clicky.surface`. */\n parent?: string;\n /** Raw entity name of the tool's surface (e.g. \"accounts\"), when known. */\n entity?: string;\n /** Preference key sent to the backend. Defaults to `name`; group-backed\n * clicky tools set this to the backend tool group. */\n preferenceKey?: string;\n /** Initial backend-owned permission when the chat window first sees this tool. */\n defaultPermission?: ToolMode;\n /** Opaque icon name emitted by the backend, resolved by the host UI. */\n icon?: string;\n /** Description shown in tool pickers / tool-call headers. */\n description?: string;\n /** Short usage hints shown in the tool browser. */\n hints?: string[];\n source?: \"clicky\" | \"custom\" | \"mcp\" | string;\n server?: string;\n method?: string;\n path?: string;\n operationName?: string;\n title?: string;\n /** Whether the runtime should treat the tool input schema as strict/closed. */\n strict?: boolean;\n /** Runtime tool annotations/hints, e.g. MCP/Genkit well-known hints. */\n annotations?: ToolAnnotations;\n /** JSON-Schema for the tool's input, assembled from an operation's\n * parameters + request body. Omitted for hand-authored tools. */\n inputSchema?: ChatToolInputSchema;\n outputSchema?: ChatToolInputSchema;\n}\n\nexport type ChatToolInputSchema = JsonSchemaObject;\nexport type JsonSchemaProperty = FormJsonSchemaProperty;\nexport type JSONSchemaProperty = FormJsonSchemaProperty;\n\n/** Returns true for a `dynamic-tool` part (clicky operations surface this way). */\nexport function isDynamicToolPart(part: {\n type: string;\n}): part is DynamicToolUIPart {\n return part.type === \"dynamic-tool\";\n}\n\n/** Returns true for a typed `tool-<name>` part. */\nexport function isTypedToolPart(part: { type: string }): part is ToolUIPart {\n return part.type.startsWith(\"tool-\");\n}\n\n/** The display name of a tool part: the explicit `toolName` for dynamic tools,\n * otherwise the suffix after `tool-`. */\nexport function toolPartName(part: AnyToolPart): string {\n if (isDynamicToolPart(part)) {\n return part.toolName;\n }\n return part.type.slice(\"tool-\".length);\n}\n\nexport interface ToolResultRenderArgs {\n part: AnyToolPart;\n toolName: string;\n output: unknown;\n}\n\nexport type ToolResultRenderer = (args: ToolResultRenderArgs) => ReactNode;\n"],"names":[],"mappings":"AA+JO,SAAS,gBAAgB,GAAuB;AACrD,SAAO,OAAO,MAAM,WAAW,IAAI,EAAE;AACvC;AAGO,SAAS,iBAAiB,GAAuB;AACtD,SAAO,OAAO,MAAM,WAAW,IAAI,EAAE;AACvC;AAGO,SAAS,gBAAgB,MAEJ;AAC1B,SAAO,KAAK,SAAS;AACvB;AAGO,SAAS,WAAW,MAA4C;AACrE,SAAO,KAAK,SAAS;AACvB;AAQO,MAAM,0BAA0B;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAUO,MAAM,iCAA+D;AAAA,EAC1E;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aACE;AAAA,EAAA;AAAA,EAEJ;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aACE;AAAA,EAAA;AAAA,EAEJ;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,EAAA;AAAA,EAEf;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,EAAA;AAAA,EAEf;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,EAAA;AAAA,EAEf;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aACE;AAAA,EAAA;AAEN;AAgEO,SAAS,kBAAkB,MAEJ;AAC5B,SAAO,KAAK,SAAS;AACvB;AAGO,SAAS,gBAAgB,MAA4C;AAC1E,SAAO,KAAK,KAAK,WAAW,OAAO;AACrC;AAIO,SAAS,aAAa,MAA2B;AACtD,MAAI,kBAAkB,IAAI,GAAG;AAC3B,WAAO,KAAK;AAAA,EACd;AACA,SAAO,KAAK,KAAK,MAAM,QAAQ,MAAM;AACvC;"}
1
+ {"version":3,"file":"types.js","sources":["../../../src/data/chat/types.ts"],"sourcesContent":["import type {\n UIMessage,\n ToolUIPart,\n DynamicToolUIPart,\n ChatStatus,\n ReasoningUIPart,\n FileUIPart,\n} from \"ai\";\nimport type { ReactNode } from \"react\";\nimport type {\n JsonSchemaObject,\n JsonSchemaProperty as FormJsonSchemaProperty,\n} from \"../../components/json-schema-form-types\";\n\nexport type {\n UIMessage,\n ToolUIPart,\n DynamicToolUIPart,\n ChatStatus,\n ReasoningUIPart,\n FileUIPart,\n};\n\n/** A selectable chat model, as served by the backend's GET /api/chat/models.\n * `configured` is false for catalogued models whose provider has no API key. */\nexport interface ChatModelRuntime {\n model?: string;\n id?: string;\n backend?: string;\n mode?: string;\n temperature?: number;\n effort?: string;\n noCache?: boolean;\n fallbacks?: ChatModelRuntime[];\n}\n\nexport type RuntimeAvailabilityState =\n | \"available\"\n | \"disabled\"\n | \"missing_credentials\"\n | \"not_authenticated\"\n | \"missing_executable\"\n | \"missing_dependency\"\n | \"unsupported\"\n | \"unavailable\";\n\nexport interface RuntimeAvailability {\n state: RuntimeAvailabilityState;\n reason?: string;\n remediation?: string;\n}\n\nexport interface ChatModel {\n id: string;\n provider: string;\n label: string;\n /** Exact Captain Model wire value submitted when this display row is selected. */\n runtime?: ChatModelRuntime;\n reasoning: boolean;\n /** True when backend metadata is authoritative, including explicit unsupported values. */\n capabilitiesKnown?: boolean;\n /** Ordered reasoning-effort tiers accepted by this exact model. */\n supportedEfforts?: string[];\n /** Backend-recommended effort used when the current selection is invalid. */\n defaultEffort?: string;\n /** Whether the model honours the temperature sampling control. */\n temperature?: boolean;\n configured?: boolean;\n availability?: RuntimeAvailability;\n /**\n * The catalog's own declared default — the row a picker seeds with when the\n * caller names no model. At most one row carries it, and a catalog that\n * declares none (or whose default is unconfigured) falls back to the first\n * configured row.\n */\n default?: boolean;\n /** Concrete runtime backends that advertised this model. Empty/omitted means provider-wide. */\n backends?: string[];\n /** Max context tokens — the denominator for a usage gauge. */\n contextWindow?: number;\n /** MIME patterns accepted as model inputs, e.g. image/* or application/pdf. */\n inputMediaTypes?: string[];\n}\n\n/** Per-message metadata the backend rides on the SSE `finish` part\n * (`messageMetadata`), applied by the AI SDK to the assistant `UIMessage`. */\nexport interface ChatMessageMetadata {\n backend?: string;\n executionMode?: string;\n model?: string;\n captainSessionId?: string;\n providerSessionId?: string;\n threadId?: string;\n turnId?: string;\n success?: boolean;\n interrupted?: boolean;\n usage?: ChatUsageBreakdown;\n costBreakdown?: ChatCostBreakdown;\n /** This turn's cost in USD. */\n cost?: number;\n /** Cumulative thread cost in USD (when the turn is persisted to a thread). */\n threadCostUsd?: number;\n /** This turn's input-token count, ≈ current context-window occupancy. */\n contextTokens?: number;\n}\n\n/** A flattened usage snapshot a chat surfaces for a gauge: tokens used out of the\n * model's context window, plus cumulative cost. */\nexport interface ChatUsageSummary {\n usedTokens: number;\n maxTokens: number;\n cost?: number;\n usage?: ChatUsageBreakdown;\n costBreakdown?: ChatCostBreakdown;\n messageCount: number;\n backend?: string;\n executionMode?: string;\n model?: string;\n captainSessionId?: string;\n providerSessionId?: string;\n threadId?: string;\n turnId?: string;\n success?: boolean;\n interrupted?: boolean;\n /** @deprecated Use `model`; retained for compatibility with existing consumers. */\n modelLabel?: string;\n}\n\nexport interface ChatBudgetConfig {\n /** Per-thread/request cost cap in USD. */\n cost?: number;\n /** Max output tokens for one model call. */\n maxTokens?: number;\n}\n\nexport interface ChatUsageBreakdown {\n inputTokens?: number;\n outputTokens?: number;\n reasoningTokens?: number;\n cacheReadTokens?: number;\n cacheWriteTokens?: number;\n totalTokens?: number;\n}\n\nexport interface ChatCostBreakdown {\n model?: string;\n inputUsd?: number;\n outputUsd?: number;\n reasoningUsd?: number;\n cacheReadUsd?: number;\n cacheWriteUsd?: number;\n totalUsd?: number;\n}\n\n/** A suggested prompt shown on the empty state. A bare string is both the label\n * and the submitted text; the object form separates them. */\nexport type Suggestion = string | { label: string; prompt: string };\n\n/** The label shown for a suggestion. */\nexport function suggestionLabel(s: Suggestion): string {\n return typeof s === \"string\" ? s : s.label;\n}\n\n/** The text submitted when a suggestion is clicked. */\nexport function suggestionPrompt(s: Suggestion): string {\n return typeof s === \"string\" ? s : s.prompt;\n}\n\n/** Returns true for an assistant reasoning (\"thinking\") part. */\nexport function isReasoningPart(part: {\n type: string;\n}): part is ReasoningUIPart {\n return part.type === \"reasoning\";\n}\n\n/** Returns true for a file/attachment part. */\nexport function isFilePart(part: { type: string }): part is FileUIPart {\n return part.type === \"file\";\n}\n\n/** A tool part as it appears in an assistant UIMessage — either a typed\n * `tool-<name>` part or the generic `dynamic-tool` part. clicky operations\n * surface as dynamic tools, so the chat UI renders both shapes. */\nexport type AnyToolPart = ToolUIPart | DynamicToolUIPart;\n\n/** Claude Agent SDK permission modes accepted by `permissionMode`. */\nexport const CLAUDE_PERMISSION_MODES = [\n \"default\",\n \"acceptEdits\",\n \"bypassPermissions\",\n \"plan\",\n \"dontAsk\",\n \"auto\",\n] as const;\n\nexport type ClaudePermissionMode = (typeof CLAUDE_PERMISSION_MODES)[number];\n\nexport type ClaudePermissionModeOption = {\n value: ClaudePermissionMode;\n label: string;\n description: string;\n};\n\nexport const CLAUDE_PERMISSION_MODE_OPTIONS: ClaudePermissionModeOption[] = [\n {\n value: \"default\",\n label: \"Default\",\n description:\n \"Prompt for dangerous operations using standard Claude behavior.\",\n },\n {\n value: \"auto\",\n label: \"Auto\",\n description:\n \"Use Claude's classifier to approve or deny permission prompts.\",\n },\n {\n value: \"acceptEdits\",\n label: \"Accept edits\",\n description: \"Automatically accept file edit operations.\",\n },\n {\n value: \"dontAsk\",\n label: \"Don't ask\",\n description: \"Do not prompt; deny actions that are not pre-approved.\",\n },\n {\n value: \"plan\",\n label: \"Plan\",\n description: \"Planning mode with no tool execution.\",\n },\n {\n value: \"bypassPermissions\",\n label: \"Bypass\",\n description:\n \"Bypass permission checks when explicitly allowed by the host.\",\n },\n];\n\n/** Tool metadata shared by the chat shell. It both configures the\n * tool-preferences popover (`name`/`label`/`group`) and carries the schema\n * derived from a clicky RPC operation (`description`/`inputSchema`). The Go\n * backend owns execution; the client uses this only for display and to scope\n * which tools a request may call (passed in the transport `body`). */\n/** Authority for one tool, in Captain's tool vocabulary. The legacy `on`/`off`\n * spellings are still accepted on the way in (see `normalizeToolPolicyValue`)\n * and mean `allow`/`deny`; they are never produced here. The UI still *labels*\n * these On and Off — see `POLICY_LABEL`. */\nexport type ToolPolicy = \"allow\" | \"ask\" | \"deny\" | \"auto\";\n\n/** Canonicalizes a tool policy from the wire, accepting the legacy `on`/`off`\n * spellings the backend still emits from older catalogs and MCP `_meta`.\n *\n * `on` means allow rather than auto: the catalog encoding has no separate allow\n * list, so `on` was always its way of saying auto-run. Keeping private copies of\n * this rule per call site is how the UI and the server drifted apart, so this is\n * the only one. */\nexport function normalizeToolPolicy(value: unknown): ToolPolicy | undefined {\n if (typeof value !== \"string\") return undefined;\n switch (value.trim().toLowerCase()) {\n case \"allow\":\n case \"on\":\n case \"enabled\":\n return \"allow\";\n case \"ask\":\n return \"ask\";\n case \"deny\":\n case \"off\":\n case \"disabled\":\n return \"deny\";\n case \"auto\":\n return \"auto\";\n default:\n return undefined;\n }\n}\n\nexport interface ToolAnnotations {\n title?: string;\n readOnlyHint?: boolean;\n destructiveHint?: boolean;\n idempotentHint?: boolean;\n openWorldHint?: boolean;\n [key: string]: unknown;\n}\n\nexport interface ToolMeta {\n /** Stable tool name sent to the model (the operation id). */\n name: string;\n /** Human-readable label shown in the tool-preferences popover. */\n label: string;\n /** Bucket heading in the popover — the clicky surface for RPC operations. */\n group?: string;\n /** Display title of the tool's parent surface/entity (e.g. \"Xero Accounts\").\n * Used to nest tools under their entity within a group, and as the\n * disambiguating prefix in flat lists so sibling verbs (\"List\", \"Get\") stay\n * distinguishable. Resolved from the operation's `x-clicky.surface`. */\n parent?: string;\n /** Raw entity name of the tool's surface (e.g. \"accounts\"), when known. */\n entity?: string;\n /** Preference key sent to the backend. Defaults to `name`; group-backed\n * clicky tools set this to the backend tool group. */\n preferenceKey?: string;\n /** Initial backend-owned permission when the chat window first sees this tool. */\n defaultPermission?: ToolPolicy;\n /** Opaque icon name emitted by the backend, resolved by the host UI. */\n icon?: string;\n /** Description shown in tool pickers / tool-call headers. */\n description?: string;\n /** Short usage hints shown in the tool browser. */\n hints?: string[];\n source?: \"clicky\" | \"custom\" | \"mcp\" | string;\n server?: string;\n method?: string;\n path?: string;\n operationName?: string;\n /** The entity verb (list/get/create/update/delete, or a custom action), the\n * custom action's name, and whether the operation addresses a collection or a\n * single entity. Carried so a permission rule resolves the same way here as\n * it does on the server; empty for a tool that projects no clicky operation.\n * @see resolveToolPolicy */\n verb?: string;\n action?: string;\n scope?: string;\n title?: string;\n /** Whether the runtime should treat the tool input schema as strict/closed. */\n strict?: boolean;\n /** Runtime tool annotations/hints, e.g. MCP/Genkit well-known hints. */\n annotations?: ToolAnnotations;\n /** JSON-Schema for the tool's input, assembled from an operation's\n * parameters + request body. Omitted for hand-authored tools. */\n inputSchema?: ChatToolInputSchema;\n outputSchema?: ChatToolInputSchema;\n}\n\nexport type ChatToolInputSchema = JsonSchemaObject;\nexport type JsonSchemaProperty = FormJsonSchemaProperty;\nexport type JSONSchemaProperty = FormJsonSchemaProperty;\n\n/** Returns true for a `dynamic-tool` part (clicky operations surface this way). */\nexport function isDynamicToolPart(part: {\n type: string;\n}): part is DynamicToolUIPart {\n return part.type === \"dynamic-tool\";\n}\n\n/** Returns true for a typed `tool-<name>` part. */\nexport function isTypedToolPart(part: { type: string }): part is ToolUIPart {\n return part.type.startsWith(\"tool-\");\n}\n\n/** The display name of a tool part: the explicit `toolName` for dynamic tools,\n * otherwise the suffix after `tool-`. */\nexport function toolPartName(part: AnyToolPart): string {\n if (isDynamicToolPart(part)) {\n return part.toolName;\n }\n return part.type.slice(\"tool-\".length);\n}\n\nexport interface ToolResultRenderArgs {\n part: AnyToolPart;\n toolName: string;\n output: unknown;\n}\n\nexport type ToolResultRenderer = (args: ToolResultRenderArgs) => ReactNode;\n"],"names":[],"mappings":"AA+JO,SAAS,gBAAgB,GAAuB;AACrD,SAAO,OAAO,MAAM,WAAW,IAAI,EAAE;AACvC;AAGO,SAAS,iBAAiB,GAAuB;AACtD,SAAO,OAAO,MAAM,WAAW,IAAI,EAAE;AACvC;AAGO,SAAS,gBAAgB,MAEJ;AAC1B,SAAO,KAAK,SAAS;AACvB;AAGO,SAAS,WAAW,MAA4C;AACrE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ineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const listeners = /* @__PURE__ */ new Set();
4
+ const watchers = /* @__PURE__ */ new Set();
5
+ function registerDebugConsole(listener) {
6
+ listeners.add(listener);
7
+ notify();
8
+ return () => {
9
+ listeners.delete(listener);
10
+ notify();
11
+ };
12
+ }
13
+ function subscribeToDebugConsole(onChange) {
14
+ watchers.add(onChange);
15
+ return () => {
16
+ watchers.delete(onChange);
17
+ };
18
+ }
19
+ function notify() {
20
+ for (const watcher of watchers) watcher();
21
+ }
22
+ function debugConsoleAvailable() {
23
+ return listeners.size > 0;
24
+ }
25
+ let consoleOpen = false;
26
+ function setDebugConsoleOpen(open) {
27
+ if (consoleOpen === open) return;
28
+ consoleOpen = open;
29
+ notify();
30
+ }
31
+ function debugConsoleOpen() {
32
+ return consoleOpen && listeners.size > 0;
33
+ }
34
+ function revealDebugConsole(request = {}) {
35
+ for (const listener of listeners) listener(request);
36
+ }
37
+ const DEBUG_CAPTURE_HEADER = "X-Debug-Level";
38
+ const DEBUG_REFRESH_INSPECTION_HEADER = "X-Debug-Refresh-Inspection";
39
+ let captureLevel = "off";
40
+ let refreshInspection = false;
41
+ function setDebugCaptureLevel(level) {
42
+ captureLevel = level;
43
+ }
44
+ function setDebugRefreshInspection(refresh) {
45
+ refreshInspection = refresh;
46
+ }
47
+ function debugCaptureHeaders() {
48
+ if (captureLevel === "off" || listeners.size === 0) return {};
49
+ const headers = { [DEBUG_CAPTURE_HEADER]: captureLevel };
50
+ if (refreshInspection) headers[DEBUG_REFRESH_INSPECTION_HEADER] = "true";
51
+ return headers;
52
+ }
53
+ exports.DEBUG_CAPTURE_HEADER = DEBUG_CAPTURE_HEADER;
54
+ exports.DEBUG_REFRESH_INSPECTION_HEADER = DEBUG_REFRESH_INSPECTION_HEADER;
55
+ exports.debugCaptureHeaders = debugCaptureHeaders;
56
+ exports.debugConsoleAvailable = debugConsoleAvailable;
57
+ exports.debugConsoleOpen = debugConsoleOpen;
58
+ exports.registerDebugConsole = registerDebugConsole;
59
+ exports.revealDebugConsole = revealDebugConsole;
60
+ exports.setDebugCaptureLevel = setDebugCaptureLevel;
61
+ exports.setDebugConsoleOpen = setDebugConsoleOpen;
62
+ exports.setDebugRefreshInspection = setDebugRefreshInspection;
63
+ exports.subscribeToDebugConsole = subscribeToDebugConsole;
64
+ //# sourceMappingURL=debugConsoleSignal.cjs.map