@flanksource/clicky-ui 0.3.24 → 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 (491) 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/Chat.cjs +8 -4
  133. package/dist/data/chat/Chat.cjs.map +1 -1
  134. package/dist/data/chat/Chat.d.ts.map +1 -1
  135. package/dist/data/chat/Chat.js +8 -4
  136. package/dist/data/chat/Chat.js.map +1 -1
  137. package/dist/data/chat/ChatRuntimeToolbar.cjs +11 -7
  138. package/dist/data/chat/ChatRuntimeToolbar.cjs.map +1 -1
  139. package/dist/data/chat/ChatRuntimeToolbar.d.ts.map +1 -1
  140. package/dist/data/chat/ChatRuntimeToolbar.js +11 -7
  141. package/dist/data/chat/ChatRuntimeToolbar.js.map +1 -1
  142. package/dist/data/chat/ContextMeter.cjs +64 -27
  143. package/dist/data/chat/ContextMeter.cjs.map +1 -1
  144. package/dist/data/chat/ContextMeter.d.ts +11 -4
  145. package/dist/data/chat/ContextMeter.d.ts.map +1 -1
  146. package/dist/data/chat/ContextMeter.js +64 -27
  147. package/dist/data/chat/ContextMeter.js.map +1 -1
  148. package/dist/data/chat/clickyOperationsToTools.cjs +2 -1
  149. package/dist/data/chat/clickyOperationsToTools.cjs.map +1 -1
  150. package/dist/data/chat/clickyOperationsToTools.d.ts.map +1 -1
  151. package/dist/data/chat/clickyOperationsToTools.js +2 -1
  152. package/dist/data/chat/clickyOperationsToTools.js.map +1 -1
  153. package/dist/data/chat/index.d.ts +2 -1
  154. package/dist/data/chat/index.d.ts.map +1 -1
  155. package/dist/data/chat/tool-policy.cjs +132 -0
  156. package/dist/data/chat/tool-policy.cjs.map +1 -0
  157. package/dist/data/chat/tool-policy.d.ts +81 -0
  158. package/dist/data/chat/tool-policy.d.ts.map +1 -0
  159. package/dist/data/chat/tool-policy.js +132 -0
  160. package/dist/data/chat/tool-policy.js.map +1 -0
  161. package/dist/data/chat/types.cjs +20 -0
  162. package/dist/data/chat/types.cjs.map +1 -1
  163. package/dist/data/chat/types.d.ts +41 -2
  164. package/dist/data/chat/types.d.ts.map +1 -1
  165. package/dist/data/chat/types.js +20 -0
  166. package/dist/data/chat/types.js.map +1 -1
  167. package/dist/data/chat/usage-snapshot.cjs +10 -1
  168. package/dist/data/chat/usage-snapshot.cjs.map +1 -1
  169. package/dist/data/chat/usage-snapshot.d.ts.map +1 -1
  170. package/dist/data/chat/usage-snapshot.js +10 -1
  171. package/dist/data/chat/usage-snapshot.js.map +1 -1
  172. package/dist/data/debugConsoleSignal.cjs +64 -0
  173. package/dist/data/debugConsoleSignal.cjs.map +1 -0
  174. package/dist/data/debugConsoleSignal.d.ts +83 -0
  175. package/dist/data/debugConsoleSignal.d.ts.map +1 -0
  176. package/dist/data/debugConsoleSignal.js +64 -0
  177. package/dist/data/debugConsoleSignal.js.map +1 -0
  178. package/dist/data/har/HarPanel.cjs +20 -14
  179. package/dist/data/har/HarPanel.cjs.map +1 -1
  180. package/dist/data/har/HarPanel.d.ts.map +1 -1
  181. package/dist/data/har/HarPanel.js +20 -14
  182. package/dist/data/har/HarPanel.js.map +1 -1
  183. package/dist/data/har/types.d.ts +18 -0
  184. package/dist/data/har/types.d.ts.map +1 -1
  185. package/dist/data/query-browser/QueryBrowser.cjs +4 -42
  186. package/dist/data/query-browser/QueryBrowser.cjs.map +1 -1
  187. package/dist/data/query-browser/QueryBrowser.d.ts.map +1 -1
  188. package/dist/data/query-browser/QueryBrowser.js +5 -43
  189. package/dist/data/query-browser/QueryBrowser.js.map +1 -1
  190. package/dist/data/query-browser/QueryBrowser.types.cjs.map +1 -1
  191. package/dist/data/query-browser/QueryBrowser.types.d.ts +0 -1
  192. package/dist/data/query-browser/QueryBrowser.types.d.ts.map +1 -1
  193. package/dist/data/query-browser/QueryBrowser.types.js.map +1 -1
  194. package/dist/data/useDebugAction.cjs +29 -0
  195. package/dist/data/useDebugAction.cjs.map +1 -0
  196. package/dist/data/useDebugAction.d.ts +16 -0
  197. package/dist/data/useDebugAction.d.ts.map +1 -0
  198. package/dist/data/useDebugAction.js +29 -0
  199. package/dist/data/useDebugAction.js.map +1 -0
  200. package/dist/data/version-info.cjs +3 -3
  201. package/dist/data/version-info.js +3 -3
  202. package/dist/data.cjs +16 -8
  203. package/dist/data.cjs.map +1 -1
  204. package/dist/data.d.ts +3 -2
  205. package/dist/data.d.ts.map +1 -1
  206. package/dist/data.js +16 -8
  207. package/dist/devtools/DebugConsole.cjs +138 -0
  208. package/dist/devtools/DebugConsole.cjs.map +1 -0
  209. package/dist/devtools/DebugConsole.d.ts +23 -0
  210. package/dist/devtools/DebugConsole.d.ts.map +1 -0
  211. package/dist/devtools/DebugConsole.js +138 -0
  212. package/dist/devtools/DebugConsole.js.map +1 -0
  213. package/dist/devtools/DebugConsoleButton.cjs +59 -0
  214. package/dist/devtools/DebugConsoleButton.cjs.map +1 -0
  215. package/dist/devtools/DebugConsoleButton.d.ts +20 -0
  216. package/dist/devtools/DebugConsoleButton.d.ts.map +1 -0
  217. package/dist/devtools/DebugConsoleButton.js +59 -0
  218. package/dist/devtools/DebugConsoleButton.js.map +1 -0
  219. package/dist/devtools/DebugConsoleDock.cjs +112 -0
  220. package/dist/devtools/DebugConsoleDock.cjs.map +1 -0
  221. package/dist/devtools/DebugConsoleDock.d.ts +26 -0
  222. package/dist/devtools/DebugConsoleDock.d.ts.map +1 -0
  223. package/dist/devtools/DebugConsoleDock.js +112 -0
  224. package/dist/devtools/DebugConsoleDock.js.map +1 -0
  225. package/dist/devtools/ExecutionDetail.cjs +135 -0
  226. package/dist/devtools/ExecutionDetail.cjs.map +1 -0
  227. package/dist/devtools/ExecutionDetail.d.ts +19 -0
  228. package/dist/devtools/ExecutionDetail.d.ts.map +1 -0
  229. package/dist/devtools/ExecutionDetail.js +135 -0
  230. package/dist/devtools/ExecutionDetail.js.map +1 -0
  231. package/dist/devtools/debugClient.cjs +172 -0
  232. package/dist/devtools/debugClient.cjs.map +1 -0
  233. package/dist/devtools/debugClient.d.ts +98 -0
  234. package/dist/devtools/debugClient.d.ts.map +1 -0
  235. package/dist/devtools/debugClient.js +172 -0
  236. package/dist/devtools/debugClient.js.map +1 -0
  237. package/dist/devtools/debugStore.cjs +115 -0
  238. package/dist/devtools/debugStore.cjs.map +1 -0
  239. package/dist/devtools/debugStore.d.ts +83 -0
  240. package/dist/devtools/debugStore.d.ts.map +1 -0
  241. package/dist/devtools/debugStore.js +115 -0
  242. package/dist/devtools/debugStore.js.map +1 -0
  243. package/dist/devtools/dockState.cjs +51 -0
  244. package/dist/devtools/dockState.cjs.map +1 -0
  245. package/dist/devtools/dockState.d.ts +31 -0
  246. package/dist/devtools/dockState.d.ts.map +1 -0
  247. package/dist/devtools/dockState.js +51 -0
  248. package/dist/devtools/dockState.js.map +1 -0
  249. package/dist/devtools/tabs/ConsoleTab.cjs +36 -0
  250. package/dist/devtools/tabs/ConsoleTab.cjs.map +1 -0
  251. package/dist/devtools/tabs/ConsoleTab.d.ts +19 -0
  252. package/dist/devtools/tabs/ConsoleTab.d.ts.map +1 -0
  253. package/dist/devtools/tabs/ConsoleTab.js +36 -0
  254. package/dist/devtools/tabs/ConsoleTab.js.map +1 -0
  255. package/dist/devtools/tabs/InspectionCaches.cjs +150 -0
  256. package/dist/devtools/tabs/InspectionCaches.cjs.map +1 -0
  257. package/dist/devtools/tabs/InspectionCaches.d.ts +23 -0
  258. package/dist/devtools/tabs/InspectionCaches.d.ts.map +1 -0
  259. package/dist/devtools/tabs/InspectionCaches.js +150 -0
  260. package/dist/devtools/tabs/InspectionCaches.js.map +1 -0
  261. package/dist/devtools/tabs/InspectionTab.cjs +316 -0
  262. package/dist/devtools/tabs/InspectionTab.cjs.map +1 -0
  263. package/dist/devtools/tabs/InspectionTab.d.ts +27 -0
  264. package/dist/devtools/tabs/InspectionTab.d.ts.map +1 -0
  265. package/dist/devtools/tabs/InspectionTab.js +316 -0
  266. package/dist/devtools/tabs/InspectionTab.js.map +1 -0
  267. package/dist/devtools/tabs/NetworkTab.cjs +91 -0
  268. package/dist/devtools/tabs/NetworkTab.cjs.map +1 -0
  269. package/dist/devtools/tabs/NetworkTab.d.ts +20 -0
  270. package/dist/devtools/tabs/NetworkTab.d.ts.map +1 -0
  271. package/dist/devtools/tabs/NetworkTab.js +91 -0
  272. package/dist/devtools/tabs/NetworkTab.js.map +1 -0
  273. package/dist/devtools/tabs/QueriesTab.cjs +85 -0
  274. package/dist/devtools/tabs/QueriesTab.cjs.map +1 -0
  275. package/dist/devtools/tabs/QueriesTab.d.ts +24 -0
  276. package/dist/devtools/tabs/QueriesTab.d.ts.map +1 -0
  277. package/dist/devtools/tabs/QueriesTab.js +85 -0
  278. package/dist/devtools/tabs/QueriesTab.js.map +1 -0
  279. package/dist/devtools/types.cjs +26 -0
  280. package/dist/devtools/types.cjs.map +1 -0
  281. package/dist/devtools/types.d.ts +235 -0
  282. package/dist/devtools/types.d.ts.map +1 -0
  283. package/dist/devtools/types.js +26 -0
  284. package/dist/devtools/types.js.map +1 -0
  285. package/dist/devtools/useDebugStream.cjs +46 -0
  286. package/dist/devtools/useDebugStream.cjs.map +1 -0
  287. package/dist/devtools/useDebugStream.d.ts +23 -0
  288. package/dist/devtools/useDebugStream.d.ts.map +1 -0
  289. package/dist/devtools/useDebugStream.js +46 -0
  290. package/dist/devtools/useDebugStream.js.map +1 -0
  291. package/dist/devtools.cjs +51 -0
  292. package/dist/devtools.cjs.map +1 -0
  293. package/dist/devtools.d.ts +37 -0
  294. package/dist/devtools.d.ts.map +1 -0
  295. package/dist/devtools.js +51 -0
  296. package/dist/devtools.js.map +1 -0
  297. package/dist/icons/components/UiOpenScad.cjs +10 -0
  298. package/dist/icons/components/UiOpenScad.cjs.map +1 -0
  299. package/dist/icons/components/UiOpenScad.d.ts +9 -0
  300. package/dist/icons/components/UiOpenScad.d.ts.map +1 -0
  301. package/dist/icons/components/UiOpenScad.js +10 -0
  302. package/dist/icons/components/UiOpenScad.js.map +1 -0
  303. package/dist/icons/index.d.ts +1 -0
  304. package/dist/icons/index.d.ts.map +1 -1
  305. package/dist/icons/registry.cjs +2 -0
  306. package/dist/icons/registry.cjs.map +1 -1
  307. package/dist/icons/registry.d.ts.map +1 -1
  308. package/dist/icons/registry.js +2 -0
  309. package/dist/icons/registry.js.map +1 -1
  310. package/dist/icons.cjs +2 -0
  311. package/dist/icons.cjs.map +1 -1
  312. package/dist/icons.js +2 -0
  313. package/dist/icons.js.map +1 -1
  314. package/dist/index.cjs +20 -8
  315. package/dist/index.cjs.map +1 -1
  316. package/dist/index.js +20 -8
  317. package/dist/index.js.map +1 -1
  318. package/dist/layout/AppShell.cjs +15 -10
  319. package/dist/layout/AppShell.cjs.map +1 -1
  320. package/dist/layout/AppShell.d.ts +11 -0
  321. package/dist/layout/AppShell.d.ts.map +1 -1
  322. package/dist/layout/AppShell.js +15 -10
  323. package/dist/layout/AppShell.js.map +1 -1
  324. package/dist/layout/AppShell.nav.cjs +170 -49
  325. package/dist/layout/AppShell.nav.cjs.map +1 -1
  326. package/dist/layout/AppShell.nav.d.ts.map +1 -1
  327. package/dist/layout/AppShell.nav.js +170 -49
  328. package/dist/layout/AppShell.nav.js.map +1 -1
  329. package/dist/overlay/CellActions.cjs +18 -124
  330. package/dist/overlay/CellActions.cjs.map +1 -1
  331. package/dist/overlay/CellActions.d.ts +1 -1
  332. package/dist/overlay/CellActions.d.ts.map +1 -1
  333. package/dist/overlay/CellActions.js +18 -124
  334. package/dist/overlay/CellActions.js.map +1 -1
  335. package/dist/overlay/ContextMenu.cjs +144 -0
  336. package/dist/overlay/ContextMenu.cjs.map +1 -0
  337. package/dist/overlay/ContextMenu.d.ts +8 -0
  338. package/dist/overlay/ContextMenu.d.ts.map +1 -0
  339. package/dist/overlay/ContextMenu.js +144 -0
  340. package/dist/overlay/ContextMenu.js.map +1 -0
  341. package/dist/profiles/connections/connectionBrowserModel.cjs +14 -65
  342. package/dist/profiles/connections/connectionBrowserModel.cjs.map +1 -1
  343. package/dist/profiles/connections/connectionBrowserModel.d.ts +35 -35
  344. package/dist/profiles/connections/connectionBrowserModel.d.ts.map +1 -1
  345. package/dist/profiles/connections/connectionBrowserModel.js +14 -65
  346. package/dist/profiles/connections/connectionBrowserModel.js.map +1 -1
  347. package/dist/profiles/connections/connectionQueryWorkspace.cjs +29 -9
  348. package/dist/profiles/connections/connectionQueryWorkspace.cjs.map +1 -1
  349. package/dist/profiles/connections/connectionQueryWorkspace.d.ts +3 -2
  350. package/dist/profiles/connections/connectionQueryWorkspace.d.ts.map +1 -1
  351. package/dist/profiles/connections/connectionQueryWorkspace.js +30 -10
  352. package/dist/profiles/connections/connectionQueryWorkspace.js.map +1 -1
  353. package/dist/profiles/connections/connectionQueryWorkspaceModel.cjs +15 -0
  354. package/dist/profiles/connections/connectionQueryWorkspaceModel.cjs.map +1 -1
  355. package/dist/profiles/connections/connectionQueryWorkspaceModel.d.ts +22 -1
  356. package/dist/profiles/connections/connectionQueryWorkspaceModel.d.ts.map +1 -1
  357. package/dist/profiles/connections/connectionQueryWorkspaceModel.js +15 -0
  358. package/dist/profiles/connections/connectionQueryWorkspaceModel.js.map +1 -1
  359. package/dist/profiles/connections/index.d.ts +1 -0
  360. package/dist/profiles/connections/index.d.ts.map +1 -1
  361. package/dist/profiles/connections/inspectionStatus.cjs +44 -0
  362. package/dist/profiles/connections/inspectionStatus.cjs.map +1 -0
  363. package/dist/profiles/connections/inspectionStatus.d.ts +5 -0
  364. package/dist/profiles/connections/inspectionStatus.d.ts.map +1 -0
  365. package/dist/profiles/connections/inspectionStatus.js +44 -0
  366. package/dist/profiles/connections/inspectionStatus.js.map +1 -0
  367. package/dist/profiles/connections/useInspection.cjs +123 -0
  368. package/dist/profiles/connections/useInspection.cjs.map +1 -0
  369. package/dist/profiles/connections/useInspection.d.ts +35 -0
  370. package/dist/profiles/connections/useInspection.d.ts.map +1 -0
  371. package/dist/profiles/connections/useInspection.js +123 -0
  372. package/dist/profiles/connections/useInspection.js.map +1 -0
  373. package/dist/profiles/editor/profileBuilderWorkspace.cjs +55 -23
  374. package/dist/profiles/editor/profileBuilderWorkspace.cjs.map +1 -1
  375. package/dist/profiles/editor/profileBuilderWorkspace.d.ts.map +1 -1
  376. package/dist/profiles/editor/profileBuilderWorkspace.js +56 -24
  377. package/dist/profiles/editor/profileBuilderWorkspace.js.map +1 -1
  378. package/dist/profiles/elasticsearch/esQueryBuilder.cjs +12 -3
  379. package/dist/profiles/elasticsearch/esQueryBuilder.cjs.map +1 -1
  380. package/dist/profiles/elasticsearch/esQueryBuilder.d.ts +2 -2
  381. package/dist/profiles/elasticsearch/esQueryBuilder.d.ts.map +1 -1
  382. package/dist/profiles/elasticsearch/esQueryBuilder.js +12 -3
  383. package/dist/profiles/elasticsearch/esQueryBuilder.js.map +1 -1
  384. package/dist/profiles/fields/profileFieldEditor.cjs +137 -22
  385. package/dist/profiles/fields/profileFieldEditor.cjs.map +1 -1
  386. package/dist/profiles/fields/profileFieldEditor.d.ts.map +1 -1
  387. package/dist/profiles/fields/profileFieldEditor.js +137 -22
  388. package/dist/profiles/fields/profileFieldEditor.js.map +1 -1
  389. package/dist/profiles/fields/profileFieldFilterEditor.cjs +171 -82
  390. package/dist/profiles/fields/profileFieldFilterEditor.cjs.map +1 -1
  391. package/dist/profiles/fields/profileFieldFilterEditor.d.ts +0 -9
  392. package/dist/profiles/fields/profileFieldFilterEditor.d.ts.map +1 -1
  393. package/dist/profiles/fields/profileFieldFilterEditor.js +174 -85
  394. package/dist/profiles/fields/profileFieldFilterEditor.js.map +1 -1
  395. package/dist/profiles/fields/profileFieldIcons.cjs +6 -3
  396. package/dist/profiles/fields/profileFieldIcons.cjs.map +1 -1
  397. package/dist/profiles/fields/profileFieldIcons.js +6 -3
  398. package/dist/profiles/fields/profileFieldIcons.js.map +1 -1
  399. package/dist/profiles/query/profileSampleFilterLookup.cjs +34 -0
  400. package/dist/profiles/query/profileSampleFilterLookup.cjs.map +1 -0
  401. package/dist/profiles/query/profileSampleFilterLookup.d.ts +12 -0
  402. package/dist/profiles/query/profileSampleFilterLookup.d.ts.map +1 -0
  403. package/dist/profiles/query/profileSampleFilterLookup.js +34 -0
  404. package/dist/profiles/query/profileSampleFilterLookup.js.map +1 -0
  405. package/dist/profiles/query/profileSamplePayload.cjs +6 -4
  406. package/dist/profiles/query/profileSamplePayload.cjs.map +1 -1
  407. package/dist/profiles/query/profileSamplePayload.d.ts +11 -4
  408. package/dist/profiles/query/profileSamplePayload.d.ts.map +1 -1
  409. package/dist/profiles/query/profileSamplePayload.js +6 -4
  410. package/dist/profiles/query/profileSamplePayload.js.map +1 -1
  411. package/dist/profiles/query/profileSampleResult.cjs +26 -0
  412. package/dist/profiles/query/profileSampleResult.cjs.map +1 -0
  413. package/dist/profiles/query/profileSampleResult.d.ts +11 -0
  414. package/dist/profiles/query/profileSampleResult.d.ts.map +1 -0
  415. package/dist/profiles/query/profileSampleResult.js +26 -0
  416. package/dist/profiles/query/profileSampleResult.js.map +1 -0
  417. package/dist/profiles/query/queryTargetPicker.cjs +5 -3
  418. package/dist/profiles/query/queryTargetPicker.cjs.map +1 -1
  419. package/dist/profiles/query/queryTargetPicker.d.ts +3 -2
  420. package/dist/profiles/query/queryTargetPicker.d.ts.map +1 -1
  421. package/dist/profiles/query/queryTargetPicker.js +5 -3
  422. package/dist/profiles/query/queryTargetPicker.js.map +1 -1
  423. package/dist/profiles/wizard/profileWizard.cjs +14 -5
  424. package/dist/profiles/wizard/profileWizard.cjs.map +1 -1
  425. package/dist/profiles/wizard/profileWizard.d.ts.map +1 -1
  426. package/dist/profiles/wizard/profileWizard.js +15 -6
  427. package/dist/profiles/wizard/profileWizard.js.map +1 -1
  428. package/dist/profiles/wizard/profileWizardModel.cjs +35 -6
  429. package/dist/profiles/wizard/profileWizardModel.cjs.map +1 -1
  430. package/dist/profiles/wizard/profileWizardModel.d.ts +29 -4
  431. package/dist/profiles/wizard/profileWizardModel.d.ts.map +1 -1
  432. package/dist/profiles/wizard/profileWizardModel.js +35 -6
  433. package/dist/profiles/wizard/profileWizardModel.js.map +1 -1
  434. package/dist/profiles/wizard/profileWizardQueryStep.cjs +44 -11
  435. package/dist/profiles/wizard/profileWizardQueryStep.cjs.map +1 -1
  436. package/dist/profiles/wizard/profileWizardQueryStep.d.ts.map +1 -1
  437. package/dist/profiles/wizard/profileWizardQueryStep.js +46 -13
  438. package/dist/profiles/wizard/profileWizardQueryStep.js.map +1 -1
  439. package/dist/profiles/wizard/profileWizardSteps.cjs +33 -2
  440. package/dist/profiles/wizard/profileWizardSteps.cjs.map +1 -1
  441. package/dist/profiles/wizard/profileWizardSteps.d.ts +11 -2
  442. package/dist/profiles/wizard/profileWizardSteps.d.ts.map +1 -1
  443. package/dist/profiles/wizard/profileWizardSteps.js +33 -2
  444. package/dist/profiles/wizard/profileWizardSteps.js.map +1 -1
  445. package/dist/profiles.cjs +8 -2
  446. package/dist/profiles.cjs.map +1 -1
  447. package/dist/profiles.js +10 -4
  448. package/dist/profiles.js.map +1 -1
  449. package/dist/rpc/FilterForm.cjs +21 -237
  450. package/dist/rpc/FilterForm.cjs.map +1 -1
  451. package/dist/rpc/FilterForm.d.ts +3 -1
  452. package/dist/rpc/FilterForm.d.ts.map +1 -1
  453. package/dist/rpc/FilterForm.js +21 -237
  454. package/dist/rpc/FilterForm.js.map +1 -1
  455. package/dist/rpc/FilterFormFields.cjs +240 -0
  456. package/dist/rpc/FilterFormFields.cjs.map +1 -0
  457. package/dist/rpc/FilterFormFields.d.ts +12 -0
  458. package/dist/rpc/FilterFormFields.d.ts.map +1 -0
  459. package/dist/rpc/FilterFormFields.js +240 -0
  460. package/dist/rpc/FilterFormFields.js.map +1 -0
  461. package/dist/rpc/router.cjs +3 -2
  462. package/dist/rpc/router.cjs.map +1 -1
  463. package/dist/rpc/router.d.ts.map +1 -1
  464. package/dist/rpc/router.js +3 -2
  465. package/dist/rpc/router.js.map +1 -1
  466. package/dist/rpc/types.cjs.map +1 -1
  467. package/dist/rpc/types.d.ts +3 -1
  468. package/dist/rpc/types.d.ts.map +1 -1
  469. package/dist/rpc/types.js.map +1 -1
  470. package/dist/styles.css +1 -1
  471. package/package.json +6 -1
  472. package/dist/data/query-info/QueryInfoDialog.cjs +0 -106
  473. package/dist/data/query-info/QueryInfoDialog.cjs.map +0 -1
  474. package/dist/data/query-info/QueryInfoDialog.d.ts +0 -16
  475. package/dist/data/query-info/QueryInfoDialog.d.ts.map +0 -1
  476. package/dist/data/query-info/QueryInfoDialog.js +0 -106
  477. package/dist/data/query-info/QueryInfoDialog.js.map +0 -1
  478. package/dist/data/query-info/index.d.ts +0 -4
  479. package/dist/data/query-info/index.d.ts.map +0 -1
  480. package/dist/data/query-info/queryInfo.cjs +0 -42
  481. package/dist/data/query-info/queryInfo.cjs.map +0 -1
  482. package/dist/data/query-info/queryInfo.d.ts +0 -45
  483. package/dist/data/query-info/queryInfo.d.ts.map +0 -1
  484. package/dist/data/query-info/queryInfo.js +0 -42
  485. package/dist/data/query-info/queryInfo.js.map +0 -1
  486. package/dist/data/query-info/useQueryInfo.cjs +0 -48
  487. package/dist/data/query-info/useQueryInfo.cjs.map +0 -1
  488. package/dist/data/query-info/useQueryInfo.d.ts +0 -26
  489. package/dist/data/query-info/useQueryInfo.d.ts.map +0 -1
  490. package/dist/data/query-info/useQueryInfo.js +0 -48
  491. package/dist/data/query-info/useQueryInfo.js.map +0 -1
@@ -0,0 +1,12 @@
1
+ import { FilterBarFilter, FilterBarRangeProps } from '../components/FilterBar';
2
+ export type ParameterGridProps = {
3
+ filters: FilterBarFilter[];
4
+ timeRange?: FilterBarRangeProps | undefined;
5
+ autoSubmit: boolean;
6
+ isSubmitting: boolean;
7
+ submitLabel: string;
8
+ submittingLabel: string;
9
+ className?: string | undefined;
10
+ };
11
+ export declare function ParameterGrid({ filters, timeRange, autoSubmit, isSubmitting, submitLabel, submittingLabel, className, }: ParameterGridProps): import("react/jsx-runtime").JSX.Element;
12
+ //# sourceMappingURL=FilterFormFields.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FilterFormFields.d.ts","sourceRoot":"","sources":["../../src/rpc/FilterFormFields.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,eAAe,EAEpB,KAAK,mBAAmB,EACzB,MAAM,yBAAyB,CAAC;AAIjC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,SAAS,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC;IAC5C,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,SAAS,EACT,UAAU,EACV,YAAY,EACZ,WAAW,EACX,eAAe,EACf,SAAS,GACV,EAAE,kBAAkB,2CAmBpB"}
@@ -0,0 +1,240 @@
1
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
+ import { Button } from "../components/button.js";
3
+ import { Combobox } from "../components/Combobox.js";
4
+ import { TimeRange } from "../components/TimeRange.js";
5
+ import { cn } from "../lib/utils.js";
6
+ function ParameterGrid({
7
+ filters,
8
+ timeRange,
9
+ autoSubmit,
10
+ isSubmitting,
11
+ submitLabel,
12
+ submittingLabel,
13
+ className
14
+ }) {
15
+ return /* @__PURE__ */ jsxs("div", { className: cn("space-y-3", className), children: [
16
+ /* @__PURE__ */ jsxs("div", { className: "divide-y divide-border border-y border-border", children: [
17
+ filters.map((filter) => /* @__PURE__ */ jsx(ParameterRow, { filter }, filter.key)),
18
+ timeRange && /* @__PURE__ */ jsx(TimeRangeRow, { timeRange })
19
+ ] }),
20
+ !autoSubmit && /* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx(Button, { type: "submit", disabled: isSubmitting, children: isSubmitting ? submittingLabel : submitLabel }) })
21
+ ] });
22
+ }
23
+ function ParameterRow({ filter }) {
24
+ const id = `clicky-param-${filter.key.replace(/[^a-zA-Z0-9_-]/g, "-")}`;
25
+ return /* @__PURE__ */ jsxs(
26
+ "div",
27
+ {
28
+ title: filter.description,
29
+ className: cn(
30
+ "grid grid-cols-1 gap-2 py-2 sm:grid-cols-[minmax(8rem,14rem)_minmax(0,1fr)] sm:items-center",
31
+ filter.disabled && "opacity-60"
32
+ ),
33
+ children: [
34
+ /* @__PURE__ */ jsx("label", { htmlFor: id, className: "text-sm font-medium text-muted-foreground", children: filter.label }),
35
+ /* @__PURE__ */ jsx("div", { className: "min-w-0", children: renderParameterInput(filter, id) })
36
+ ]
37
+ }
38
+ );
39
+ }
40
+ function renderParameterInput(filter, id) {
41
+ if (filter.kind === "date-range") {
42
+ return /* @__PURE__ */ jsx(
43
+ TimeRange,
44
+ {
45
+ kind: filter.timeEnabled === false ? "date" : "time",
46
+ label: filter.label,
47
+ align: "left",
48
+ from: filter.from ?? "",
49
+ to: filter.to ?? "",
50
+ onApply: filter.onApply,
51
+ ...filter.disabled !== void 0 ? { disabled: filter.disabled } : {},
52
+ ...filter.presets ? { presets: filter.presets } : {},
53
+ ...filter.timeEnabled !== void 0 ? { timeEnabled: filter.timeEnabled } : {},
54
+ ...filter.timeZone ? { timeZone: filter.timeZone } : {},
55
+ ...filter.timeZones ? { timeZones: filter.timeZones } : {},
56
+ ...filter.fromPlaceholder ? { fromPlaceholder: filter.fromPlaceholder } : {},
57
+ ...filter.toPlaceholder ? { toPlaceholder: filter.toPlaceholder } : {}
58
+ }
59
+ );
60
+ }
61
+ if (filter.kind === "enum") {
62
+ return /* @__PURE__ */ jsxs(
63
+ "select",
64
+ {
65
+ id,
66
+ "aria-label": filter.label,
67
+ className: inputClassName,
68
+ value: filter.value,
69
+ disabled: filter.disabled,
70
+ onChange: (event) => filter.onChange(event.target.value),
71
+ children: [
72
+ /* @__PURE__ */ jsx("option", { value: "", children: filter.placeholder ?? "" }),
73
+ filter.options.map((option) => /* @__PURE__ */ jsx("option", { value: option.value, children: option.label ?? option.value }, option.value))
74
+ ]
75
+ }
76
+ );
77
+ }
78
+ if (filter.kind === "boolean") {
79
+ return /* @__PURE__ */ jsx("div", { className: "flex h-8 items-center", children: /* @__PURE__ */ jsx(
80
+ "input",
81
+ {
82
+ id,
83
+ type: "checkbox",
84
+ "aria-label": filter.label,
85
+ className: "h-4 w-4 accent-primary disabled:cursor-not-allowed",
86
+ checked: filter.value,
87
+ disabled: filter.disabled,
88
+ onChange: (event) => filter.onChange(event.target.checked)
89
+ }
90
+ ) });
91
+ }
92
+ if (filter.kind === "lookup") {
93
+ const listId = `${id}-options`;
94
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
95
+ /* @__PURE__ */ jsx(
96
+ "input",
97
+ {
98
+ id,
99
+ type: filter.inputType === "number" ? "number" : "text",
100
+ "aria-label": filter.label,
101
+ className: inputClassName,
102
+ ...filter.placeholder !== void 0 ? { placeholder: filter.placeholder } : {},
103
+ value: filter.value,
104
+ list: listId,
105
+ disabled: filter.disabled,
106
+ onChange: (event) => filter.onChange(event.target.value)
107
+ }
108
+ ),
109
+ /* @__PURE__ */ jsx("datalist", { id: listId, children: filter.options.map((option) => /* @__PURE__ */ jsx(
110
+ "option",
111
+ {
112
+ value: option.value,
113
+ label: option.label ?? option.value,
114
+ disabled: option.disabled
115
+ },
116
+ option.value
117
+ )) })
118
+ ] });
119
+ }
120
+ if (filter.kind === "lookup-multi") {
121
+ const listId = `${id}-options`;
122
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
123
+ /* @__PURE__ */ jsx(
124
+ "input",
125
+ {
126
+ id,
127
+ type: "text",
128
+ "aria-label": filter.label,
129
+ className: inputClassName,
130
+ ...filter.placeholder !== void 0 ? { placeholder: filter.placeholder } : {},
131
+ value: filter.value.join(", "),
132
+ list: listId,
133
+ disabled: filter.disabled,
134
+ onChange: (event) => filter.onChange(splitCommaValues(event.target.value))
135
+ }
136
+ ),
137
+ /* @__PURE__ */ jsx("datalist", { id: listId, children: filter.options.map((option) => /* @__PURE__ */ jsx(
138
+ "option",
139
+ {
140
+ value: option.value,
141
+ label: option.label ?? option.value,
142
+ disabled: option.disabled
143
+ },
144
+ option.value
145
+ )) })
146
+ ] });
147
+ }
148
+ if (filter.kind === "multi") {
149
+ return /* @__PURE__ */ jsx(MultiParameterInput, { filter, id });
150
+ }
151
+ if (filter.kind === "text") {
152
+ return /* @__PURE__ */ jsx(
153
+ "input",
154
+ {
155
+ id,
156
+ type: "text",
157
+ "aria-label": filter.label,
158
+ className: inputClassName,
159
+ ...filter.placeholder !== void 0 ? { placeholder: filter.placeholder } : {},
160
+ value: filter.value,
161
+ disabled: filter.disabled,
162
+ onChange: (event) => filter.onChange(event.target.value)
163
+ }
164
+ );
165
+ }
166
+ return /* @__PURE__ */ jsx(
167
+ "input",
168
+ {
169
+ id,
170
+ type: "text",
171
+ "aria-label": filter.label,
172
+ className: inputClassName,
173
+ value: JSON.stringify(filter.value),
174
+ disabled: true,
175
+ readOnly: true
176
+ }
177
+ );
178
+ }
179
+ function MultiParameterInput({
180
+ filter,
181
+ id
182
+ }) {
183
+ const moreCount = filter.truncated && filter.total ? Math.max(filter.total - filter.options.length, 0) : 0;
184
+ return /* @__PURE__ */ jsx(
185
+ Combobox,
186
+ {
187
+ multiple: true,
188
+ id,
189
+ ariaLabel: filter.label,
190
+ value: Object.keys(filter.value),
191
+ options: filter.options.map((option) => ({
192
+ value: option.value,
193
+ label: typeof option.label === "string" ? option.label : option.title ?? option.value,
194
+ ...option.disabled !== void 0 ? { disabled: option.disabled } : {},
195
+ ...option.title !== void 0 ? { title: option.title } : {}
196
+ })),
197
+ onChange: (values) => {
198
+ const next = {};
199
+ for (const value of values)
200
+ next[value] = filter.value[value] ?? "include";
201
+ filter.onChange(next);
202
+ },
203
+ allowCustomValue: filter.allowCustomValue ?? false,
204
+ ...filter.placeholder !== void 0 ? { placeholder: filter.placeholder } : {},
205
+ ...filter.disabled !== void 0 ? { disabled: filter.disabled } : {},
206
+ ...filter.className !== void 0 ? { className: filter.className } : {},
207
+ ...moreCount > 0 ? { footer: `… and ${moreCount.toLocaleString()} more` } : {}
208
+ }
209
+ );
210
+ }
211
+ function TimeRangeRow({ timeRange }) {
212
+ return /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-2 py-2 sm:grid-cols-[minmax(8rem,14rem)_minmax(0,1fr)] sm:items-center", children: [
213
+ /* @__PURE__ */ jsx("div", { className: "text-sm font-medium text-muted-foreground", children: "Time range" }),
214
+ /* @__PURE__ */ jsx("div", { className: "min-w-0", children: /* @__PURE__ */ jsx(
215
+ TimeRange,
216
+ {
217
+ kind: timeRange.timeEnabled ? "time" : "date",
218
+ label: "Time range",
219
+ align: "left",
220
+ from: timeRange.from ?? "",
221
+ to: timeRange.to ?? "",
222
+ onApply: timeRange.onApply,
223
+ ...timeRange.presets ? { presets: timeRange.presets } : {},
224
+ ...timeRange.timeEnabled !== void 0 ? { timeEnabled: timeRange.timeEnabled } : {},
225
+ ...timeRange.timeZone ? { timeZone: timeRange.timeZone } : {},
226
+ ...timeRange.timeZones ? { timeZones: timeRange.timeZones } : {},
227
+ ...timeRange.fromPlaceholder ? { fromPlaceholder: timeRange.fromPlaceholder } : {},
228
+ ...timeRange.toPlaceholder ? { toPlaceholder: timeRange.toPlaceholder } : {}
229
+ }
230
+ ) })
231
+ ] });
232
+ }
233
+ function splitCommaValues(value) {
234
+ return value.split(",").map((item) => item.trim()).filter(Boolean);
235
+ }
236
+ const inputClassName = "h-8 w-full min-w-0 rounded-md border border-input bg-background px-2 text-sm text-foreground outline-none placeholder:text-placeholder disabled:cursor-not-allowed disabled:bg-muted/40 focus-visible:ring-2 focus-visible:ring-ring";
237
+ export {
238
+ ParameterGrid
239
+ };
240
+ //# sourceMappingURL=FilterFormFields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FilterFormFields.js","sources":["../../src/rpc/FilterFormFields.tsx"],"sourcesContent":["import { Button } from \"../components/button\";\nimport { Combobox } from \"../components/Combobox\";\nimport {\n type FilterBarFilter,\n type FilterBarMultiFilter,\n type FilterBarRangeProps,\n} from \"../components/FilterBar\";\nimport { TimeRange } from \"../components/TimeRange\";\nimport { cn } from \"../lib/utils\";\n\nexport type ParameterGridProps = {\n filters: FilterBarFilter[];\n timeRange?: FilterBarRangeProps | undefined;\n autoSubmit: boolean;\n isSubmitting: boolean;\n submitLabel: string;\n submittingLabel: string;\n className?: string | undefined;\n};\n\nexport function ParameterGrid({\n filters,\n timeRange,\n autoSubmit,\n isSubmitting,\n submitLabel,\n submittingLabel,\n className,\n}: ParameterGridProps) {\n return (\n <div className={cn(\"space-y-3\", className)}>\n <div className=\"divide-y divide-border border-y border-border\">\n {filters.map((filter) => (\n <ParameterRow key={filter.key} filter={filter} />\n ))}\n {timeRange && <TimeRangeRow timeRange={timeRange} />}\n </div>\n\n {!autoSubmit && (\n <div className=\"flex justify-end\">\n <Button type=\"submit\" disabled={isSubmitting}>\n {isSubmitting ? submittingLabel : submitLabel}\n </Button>\n </div>\n )}\n </div>\n );\n}\n\nfunction ParameterRow({ filter }: { filter: FilterBarFilter }) {\n const id = `clicky-param-${filter.key.replace(/[^a-zA-Z0-9_-]/g, \"-\")}`;\n\n return (\n <div\n title={filter.description}\n className={cn(\n \"grid grid-cols-1 gap-2 py-2 sm:grid-cols-[minmax(8rem,14rem)_minmax(0,1fr)] sm:items-center\",\n filter.disabled && \"opacity-60\",\n )}\n >\n <label htmlFor={id} className=\"text-sm font-medium text-muted-foreground\">\n {filter.label}\n </label>\n <div className=\"min-w-0\">{renderParameterInput(filter, id)}</div>\n </div>\n );\n}\n\nfunction renderParameterInput(filter: FilterBarFilter, id: string) {\n if (filter.kind === \"date-range\") {\n return (\n <TimeRange\n kind={filter.timeEnabled === false ? \"date\" : \"time\"}\n label={filter.label}\n align=\"left\"\n from={filter.from ?? \"\"}\n to={filter.to ?? \"\"}\n onApply={filter.onApply}\n {...(filter.disabled !== undefined\n ? { disabled: filter.disabled }\n : {})}\n {...(filter.presets ? { presets: filter.presets } : {})}\n {...(filter.timeEnabled !== undefined\n ? { timeEnabled: filter.timeEnabled }\n : {})}\n {...(filter.timeZone ? { timeZone: filter.timeZone } : {})}\n {...(filter.timeZones ? { timeZones: filter.timeZones } : {})}\n {...(filter.fromPlaceholder\n ? { fromPlaceholder: filter.fromPlaceholder }\n : {})}\n {...(filter.toPlaceholder\n ? { toPlaceholder: filter.toPlaceholder }\n : {})}\n />\n );\n }\n\n if (filter.kind === \"enum\") {\n return (\n <select\n id={id}\n aria-label={filter.label}\n className={inputClassName}\n value={filter.value}\n disabled={filter.disabled}\n onChange={(event) => filter.onChange(event.target.value)}\n >\n <option value=\"\">{filter.placeholder ?? \"\"}</option>\n {filter.options.map((option) => (\n <option key={option.value} value={option.value}>\n {option.label ?? option.value}\n </option>\n ))}\n </select>\n );\n }\n\n if (filter.kind === \"boolean\") {\n return (\n <div className=\"flex h-8 items-center\">\n <input\n id={id}\n type=\"checkbox\"\n aria-label={filter.label}\n className=\"h-4 w-4 accent-primary disabled:cursor-not-allowed\"\n checked={filter.value}\n disabled={filter.disabled}\n onChange={(event) => filter.onChange(event.target.checked)}\n />\n </div>\n );\n }\n\n if (filter.kind === \"lookup\") {\n const listId = `${id}-options`;\n return (\n <>\n <input\n id={id}\n type={filter.inputType === \"number\" ? \"number\" : \"text\"}\n aria-label={filter.label}\n className={inputClassName}\n {...(filter.placeholder !== undefined\n ? { placeholder: filter.placeholder }\n : {})}\n value={filter.value}\n list={listId}\n disabled={filter.disabled}\n onChange={(event) => filter.onChange(event.target.value)}\n />\n <datalist id={listId}>\n {filter.options.map((option) => (\n <option\n key={option.value}\n value={option.value}\n label={option.label ?? option.value}\n disabled={option.disabled}\n />\n ))}\n </datalist>\n </>\n );\n }\n\n if (filter.kind === \"lookup-multi\") {\n const listId = `${id}-options`;\n return (\n <>\n <input\n id={id}\n type=\"text\"\n aria-label={filter.label}\n className={inputClassName}\n {...(filter.placeholder !== undefined\n ? { placeholder: filter.placeholder }\n : {})}\n value={filter.value.join(\", \")}\n list={listId}\n disabled={filter.disabled}\n onChange={(event) =>\n filter.onChange(splitCommaValues(event.target.value))\n }\n />\n <datalist id={listId}>\n {filter.options.map((option) => (\n <option\n key={option.value}\n value={option.value}\n label={option.label ?? option.value}\n disabled={option.disabled}\n />\n ))}\n </datalist>\n </>\n );\n }\n\n if (filter.kind === \"multi\") {\n return <MultiParameterInput filter={filter} id={id} />;\n }\n\n if (filter.kind === \"text\") {\n return (\n <input\n id={id}\n type=\"text\"\n aria-label={filter.label}\n className={inputClassName}\n {...(filter.placeholder !== undefined\n ? { placeholder: filter.placeholder }\n : {})}\n value={filter.value}\n disabled={filter.disabled}\n onChange={(event) => filter.onChange(event.target.value)}\n />\n );\n }\n\n return (\n <input\n id={id}\n type=\"text\"\n aria-label={filter.label}\n className={inputClassName}\n value={JSON.stringify(filter.value)}\n disabled\n readOnly\n />\n );\n}\n\nfunction MultiParameterInput({\n filter,\n id,\n}: {\n filter: FilterBarMultiFilter;\n id: string;\n}) {\n const moreCount =\n filter.truncated && filter.total\n ? Math.max(filter.total - filter.options.length, 0)\n : 0;\n return (\n <Combobox\n multiple\n id={id}\n ariaLabel={filter.label}\n value={Object.keys(filter.value)}\n options={filter.options.map((option) => ({\n value: option.value,\n label:\n typeof option.label === \"string\"\n ? option.label\n : (option.title ?? option.value),\n ...(option.disabled !== undefined ? { disabled: option.disabled } : {}),\n ...(option.title !== undefined ? { title: option.title } : {}),\n }))}\n onChange={(values) => {\n const next: FilterBarMultiFilter[\"value\"] = {};\n for (const value of values)\n next[value] = filter.value[value] ?? \"include\";\n filter.onChange(next);\n }}\n allowCustomValue={filter.allowCustomValue ?? false}\n {...(filter.placeholder !== undefined\n ? { placeholder: filter.placeholder }\n : {})}\n {...(filter.disabled !== undefined ? { disabled: filter.disabled } : {})}\n {...(filter.className !== undefined\n ? { className: filter.className }\n : {})}\n {...(moreCount > 0\n ? { footer: `… and ${moreCount.toLocaleString()} more` }\n : {})}\n />\n );\n}\n\nfunction TimeRangeRow({ timeRange }: { timeRange: FilterBarRangeProps }) {\n return (\n <div className=\"grid grid-cols-1 gap-2 py-2 sm:grid-cols-[minmax(8rem,14rem)_minmax(0,1fr)] sm:items-center\">\n <div className=\"text-sm font-medium text-muted-foreground\">\n Time range\n </div>\n <div className=\"min-w-0\">\n <TimeRange\n kind={timeRange.timeEnabled ? \"time\" : \"date\"}\n label=\"Time range\"\n align=\"left\"\n from={timeRange.from ?? \"\"}\n to={timeRange.to ?? \"\"}\n onApply={timeRange.onApply}\n {...(timeRange.presets ? { presets: timeRange.presets } : {})}\n {...(timeRange.timeEnabled !== undefined\n ? { timeEnabled: timeRange.timeEnabled }\n : {})}\n {...(timeRange.timeZone ? { timeZone: timeRange.timeZone } : {})}\n {...(timeRange.timeZones ? { timeZones: timeRange.timeZones } : {})}\n {...(timeRange.fromPlaceholder\n ? { fromPlaceholder: timeRange.fromPlaceholder }\n : {})}\n {...(timeRange.toPlaceholder\n ? { toPlaceholder: timeRange.toPlaceholder }\n : {})}\n />\n </div>\n </div>\n );\n}\n\nfunction splitCommaValues(value: string) {\n return value\n .split(\",\")\n .map((item) => item.trim())\n .filter(Boolean);\n}\n\nconst inputClassName =\n \"h-8 w-full min-w-0 rounded-md border border-input bg-background px-2 text-sm text-foreground outline-none placeholder:text-placeholder disabled:cursor-not-allowed disabled:bg-muted/40 focus-visible:ring-2 focus-visible:ring-ring\";\n"],"names":[],"mappings":";;;;;AAoBO,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAuB;AACrB,8BACG,OAAA,EAAI,WAAW,GAAG,aAAa,SAAS,GACvC,UAAA;AAAA,IAAA,qBAAC,OAAA,EAAI,WAAU,iDACZ,UAAA;AAAA,MAAA,QAAQ,IAAI,CAAC,WACZ,oBAAC,gBAA8B,OAAA,GAAZ,OAAO,GAAqB,CAChD;AAAA,MACA,aAAa,oBAAC,cAAA,EAAa,UAAA,CAAsB;AAAA,IAAA,GACpD;AAAA,IAEC,CAAC,cACA,oBAAC,OAAA,EAAI,WAAU,oBACb,UAAA,oBAAC,QAAA,EAAO,MAAK,UAAS,UAAU,cAC7B,UAAA,eAAe,kBAAkB,aACpC,EAAA,CACF;AAAA,EAAA,GAEJ;AAEJ;AAEA,SAAS,aAAa,EAAE,UAAuC;AAC7D,QAAM,KAAK,gBAAgB,OAAO,IAAI,QAAQ,mBAAmB,GAAG,CAAC;AAErE,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAO,OAAO;AAAA,MACd,WAAW;AAAA,QACT;AAAA,QACA,OAAO,YAAY;AAA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,EAAE,QAAQ,SAAS,UAAU,eAAA,CAAgB,YAC7C,CAAA;AAAA,IAAC;AAAA,EAAA;AAGX;AAEA,SAAS,aAAa,EAAE,aAAiD;AACvE,SACE,qBAAC,OAAA,EAAI,WAAU,+FACb,UAAA;AAAA,IAAA,oBAAC,OAAA,EAAI,WAAU,6CAA4C,UAAA,cAE3D;AAAA,IACA,oBAAC,OAAA,EAAI,WAAU,WACb,UAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAM,UAAU,cAAc,SAAS;AAAA,QACvC,OAAM;AAAA,QACN,OAAM;AAAA,QACN,MAAM,UAAU,QAAQ;AAAA,QACxB,IAAI,UAAU,MAAM;AAAA,QACpB,SAAS,UAAU;AAAA,QAClB,GAAI,UAAU,UAAU,EAAE,SAAS,UAAU,QAAA,IAAY,CAAA;AAAA,QACzD,GAAI,UAAU,gBAAgB,SAC3B,EAAE,aAAa,UAAU,YAAA,IACzB,CAAA;AAAA,QACH,GAAI,UAAU,WAAW,EAAE,UAAU,UAAU,SAAA,IAAa,CAAA;AAAA,QAC5D,GAAI,UAAU,YAAY,EAAE,WAAW,UAAU,UAAA,IAAc,CAAA;AAAA,QAC/D,GAAI,UAAU,kBACX,EAAE,iBAAiB,UAAU,gBAAA,IAC7B,CAAA;AAAA,QACH,GAAI,UAAU,gBACX,EAAE,eAAe,UAAU,cAAA,IAC3B,CAAA;AAAA,MAAC;AAAA,IAAA,EACP,CACF;AAAA,EAAA,GACF;AAEJ;AAEA,SAAS,iBAAiB,OAAe;AACvC,SAAO,MACJ,MAAM,GAAG,EACT,IAAI,CAAC,SAAS,KAAK,KAAA,CAAM,EACzB,OAAO,OAAO;AACnB;AAEA,MAAM,iBACJ;"}
@@ -11,11 +11,12 @@ function subscribeToHistory(onChange) {
11
11
  return () => window.removeEventListener("popstate", onChange);
12
12
  }
13
13
  function useBrowserRouter() {
14
- const pathname = react.useSyncExternalStore(
14
+ const location = react.useSyncExternalStore(
15
15
  subscribeToHistory,
16
- () => window.location.pathname,
16
+ () => `${window.location.pathname}${window.location.search}${window.location.hash}`,
17
17
  () => "/"
18
18
  );
19
+ const pathname = location.split(/[?#]/, 1)[0] || "/";
19
20
  const navigate = react.useCallback((to, opts) => {
20
21
  if (typeof window === "undefined") return;
21
22
  if (opts == null ? void 0 : opts.replace)
@@ -1 +1 @@
1
- {"version":3,"file":"router.cjs","sources":["../../src/rpc/router.tsx"],"sourcesContent":["import {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useState,\n useSyncExternalStore,\n type MouseEvent as ReactMouseEvent,\n} from \"react\";\nimport type { RenderLink } from \"./EndpointList\";\n\n// A RouterAdapter bundles the three navigation concerns clicky-ui nav surfaces\n// need — the current location, how to render a link, and how to navigate\n// imperatively — into one object the host supplies once (via RouterProvider).\n// This keeps the library router-agnostic: a react-router host builds the adapter\n// from its own hooks, while router-less hosts/tests use the browser or memory\n// adapters below. Nothing here imports any router package.\nexport interface RouterAdapter {\n /** Current path, used to compute active nav state. */\n pathname: string;\n /** Render a navigation link (host's <Link>, a plain <a>, etc.). */\n renderLink: RenderLink;\n /** Navigate imperatively. `replace` swaps the current entry instead of pushing. */\n navigate: (to: string, opts?: { replace?: boolean }) => void;\n}\n\n// RouterContext is consumed by useRouter and provided by RouterProvider (in its\n// own module so this file exports only hooks/values, keeping fast-refresh happy).\nexport const RouterContext = createContext<RouterAdapter | null>(null);\n\n// A plain left-click on a same-tab link is the only case we intercept for\n// client-side navigation; modifier/middle clicks and new-tab links fall through\n// to the browser so \"open in new tab\" and friends keep working.\nfunction isPlainLeftClick(event: ReactMouseEvent<HTMLAnchorElement>): boolean {\n return (\n !event.defaultPrevented &&\n event.button === 0 &&\n !event.metaKey &&\n !event.ctrlKey &&\n !event.shiftKey &&\n !event.altKey &&\n event.currentTarget.target !== \"_blank\"\n );\n}\n\nfunction subscribeToHistory(onChange: () => void): () => void {\n window.addEventListener(\"popstate\", onChange);\n return () => window.removeEventListener(\"popstate\", onChange);\n}\n\n/** Live browser adapter: location from history, real <a href> links that\n * navigate client-side via the History API (like react-router's <Link>). This\n * is the router-agnostic default when no RouterProvider is mounted. */\nexport function useBrowserRouter(): RouterAdapter {\n const pathname = useSyncExternalStore(\n subscribeToHistory,\n () => window.location.pathname,\n () => \"/\",\n );\n const navigate = useCallback((to: string, opts?: { replace?: boolean }) => {\n if (typeof window === \"undefined\") return;\n if (opts?.replace)\n window.history.replaceState(window.history.state, \"\", to);\n else window.history.pushState(window.history.state, \"\", to);\n window.dispatchEvent(new PopStateEvent(\"popstate\"));\n }, []);\n const renderLink = useCallback<RenderLink>(\n ({ to, className, children, title, key }) => (\n <a\n key={key}\n href={to}\n className={className}\n title={title}\n onClick={(event) => {\n if (!isPlainLeftClick(event)) return;\n event.preventDefault();\n navigate(to);\n }}\n >\n {children}\n </a>\n ),\n [navigate],\n );\n return useMemo(\n () => ({ pathname, renderLink, navigate }),\n [pathname, renderLink, navigate],\n );\n}\n\n/** In-memory adapter for demos and tests: location lives in React state, links\n * intercept clicks to update it, and navigation never touches the browser URL —\n * so a router-less demo can switch routes without hijacking the host page. */\nexport function useMemoryRouter(initialPath: string): RouterAdapter {\n const [pathname, setPathname] = useState(initialPath);\n const navigate = useCallback((to: string) => setPathname(to), []);\n const renderLink = useCallback<RenderLink>(\n ({ to, className, children, title, key }) => (\n <a\n key={key}\n href={to}\n className={className}\n title={title}\n onClick={(event) => {\n event.preventDefault();\n setPathname(to);\n }}\n >\n {children}\n </a>\n ),\n [],\n );\n return useMemo(\n () => ({ pathname, renderLink, navigate }),\n [pathname, renderLink, navigate],\n );\n}\n\n/** Resolve the active adapter: an explicit RouterProvider wins, otherwise fall\n * back to a live browser adapter (the documented router-agnostic default). */\nexport function useRouter(): RouterAdapter {\n const ctx = useContext(RouterContext);\n const browser = useBrowserRouter();\n return ctx ?? browser;\n}\n"],"names":["createContext","useSyncExternalStore","useCallback","jsx","useMemo","useState","useContext"],"mappings":";;;;AA4BO,MAAM,gBAAgBA,MAAAA,cAAoC,IAAI;A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S,WAAW;AACpD,QAAM,WAAWH,MAAAA,YAAY,CAAC,OAAe,YAAY,EAAE,GAAG,EAAE;AAChE,QAAM,aAAaA,MAAAA;AAAAA,IACjB,CAAC,EAAE,IAAI,WAAW,UAAU,OAAO,UACjCC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QAEC,MAAM;AAAA,QACN;AAAA,QACA;AAAA,QACA,SAAS,CAAC,UAAU;AAClB,gBAAM,eAAA;AACN,sBAAY,EAAE;AAAA,QAChB;AAAA,QAEC;AAAA,MAAA;AAAA,MATI;AAAA,IAAA;AAAA,IAYT,CAAA;AAAA,EAAC;AAEH,SAAOC,MAAAA;AAAAA,IACL,OAAO,EAAE,UAAU,YAAY;IAC/B,CAAC,UAAU,YAAY,QAAQ;AAAA,EAAA;AAEnC;AAIO,SAAS,YAA2B;AACzC,QAAM,MAAME,MAAAA,WAAW,aAAa;AACpC,QAAM,UAAU,iBAAA;AAChB,SAAO,OAAO;AAChB;;;;;"}
1
+ {"version":3,"file":"router.cjs","sources":["../../src/rpc/router.tsx"],"sourcesContent":["import {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useState,\n useSyncExternalStore,\n type MouseEvent as ReactMouseEvent,\n} from \"react\";\nimport type { RenderLink } from \"./EndpointList\";\n\n// A RouterAdapter bundles the three navigation concerns clicky-ui nav surfaces\n// need — the current location, how to render a link, and how to navigate\n// imperatively — into one object the host supplies once (via RouterProvider).\n// This keeps the library router-agnostic: a react-router host builds the adapter\n// from its own hooks, while router-less hosts/tests use the browser or memory\n// adapters below. Nothing here imports any router package.\nexport interface RouterAdapter {\n /** Current path, used to compute active nav state. */\n pathname: string;\n /** Render a navigation link (host's <Link>, a plain <a>, etc.). */\n renderLink: RenderLink;\n /** Navigate imperatively. `replace` swaps the current entry instead of pushing. */\n navigate: (to: string, opts?: { replace?: boolean }) => void;\n}\n\n// RouterContext is consumed by useRouter and provided by RouterProvider (in its\n// own module so this file exports only hooks/values, keeping fast-refresh happy).\nexport const RouterContext = createContext<RouterAdapter | null>(null);\n\n// A plain left-click on a same-tab link is the only case we intercept for\n// client-side navigation; modifier/middle clicks and new-tab links fall through\n// to the browser so \"open in new tab\" and friends keep working.\nfunction isPlainLeftClick(event: ReactMouseEvent<HTMLAnchorElement>): boolean {\n return (\n !event.defaultPrevented &&\n event.button === 0 &&\n !event.metaKey &&\n !event.ctrlKey &&\n !event.shiftKey &&\n !event.altKey &&\n event.currentTarget.target !== \"_blank\"\n );\n}\n\nfunction subscribeToHistory(onChange: () => void): () => void {\n window.addEventListener(\"popstate\", onChange);\n return () => window.removeEventListener(\"popstate\", onChange);\n}\n\n/** Live browser adapter: location from history, real <a href> links that\n * navigate client-side via the History API (like react-router's <Link>). This\n * is the router-agnostic default when no RouterProvider is mounted. */\nexport function useBrowserRouter(): RouterAdapter {\n const location = useSyncExternalStore(\n subscribeToHistory,\n () => `${window.location.pathname}${window.location.search}${window.location.hash}`,\n () => \"/\",\n );\n const pathname = location.split(/[?#]/, 1)[0] || \"/\";\n const navigate = useCallback((to: string, opts?: { replace?: boolean }) => {\n if (typeof window === \"undefined\") return;\n if (opts?.replace)\n window.history.replaceState(window.history.state, \"\", to);\n else window.history.pushState(window.history.state, \"\", to);\n window.dispatchEvent(new PopStateEvent(\"popstate\"));\n }, []);\n const renderLink = useCallback<RenderLink>(\n ({ to, className, children, title, key }) => (\n <a\n key={key}\n href={to}\n className={className}\n title={title}\n onClick={(event) => {\n if (!isPlainLeftClick(event)) return;\n event.preventDefault();\n navigate(to);\n }}\n >\n {children}\n </a>\n ),\n [navigate],\n );\n return useMemo(\n () => ({ pathname, renderLink, navigate }),\n [pathname, renderLink, navigate],\n );\n}\n\n/** In-memory adapter for demos and tests: location lives in React state, links\n * intercept clicks to update it, and navigation never touches the browser URL —\n * so a router-less demo can switch routes without hijacking the host page. */\nexport function useMemoryRouter(initialPath: string): RouterAdapter {\n const [pathname, setPathname] = useState(initialPath);\n const navigate = useCallback((to: string) => setPathname(to), []);\n const renderLink = useCallback<RenderLink>(\n ({ to, className, children, title, key }) => (\n <a\n key={key}\n href={to}\n className={className}\n title={title}\n onClick={(event) => {\n event.preventDefault();\n setPathname(to);\n }}\n >\n {children}\n </a>\n ),\n [],\n );\n return useMemo(\n () => ({ pathname, renderLink, navigate }),\n [pathname, renderLink, navigate],\n );\n}\n\n/** Resolve the active adapter: an explicit RouterProvider wins, otherwise fall\n * back to a live browser adapter (the documented router-agnostic default). */\nexport function useRouter(): RouterAdapter {\n const ctx = useContext(RouterContext);\n const browser = useBrowserRouter();\n return ctx ?? browser;\n}\n"],"names":["createContext","useSyncExternalStore","useCallback","jsx","useMemo","useState","useContext"],"mappings":";;;;AA4BO,MAAM,gBAAgBA,MAAAA,cAAoC,IAAI;AAKrE,SAAS,iBAAiB,OAAoD;AAC5E,SACE,CAAC,MAAM,oBACP,MAAM,WAAW,KACjB,CAAC,MAAM,WACP,CAAC,MAAM,WACP,CAAC,MAAM,YACP,CAAC,MAAM,UACP,MAAM,cAAc,WAAW;AAEnC;AAEA,SAAS,mBAAmB,UAAkC;AAC5D,SAAO,iBAAiB,YAAY,QAAQ;AAC5C,SAAO,MAAM,OAAO,oBAAoB,YAAY,QAAQ;AAC9D;AAKO,SAAS,mBAAkC;AAChD,QAAM,WAAWC,MAAAA;AAAAA,IACf;AAAA,IACA,MAAM,GAAG,OAAO,SAAS,QAAQ,GAAG,OAAO,SAAS,MAAM,GAAG,OAAO,SAAS,IAAI;AAAA,IACjF,MAAM;AAAA,EAAA;AAER,QAAM,WAAW,SAAS,MAAM,QAAQ,CAAC,EAAE,CAAC,KAAK;AACjD,QAAM,WAAWC,MAAAA,YAAY,CAAC,IAAY,SAAiC;AACzE,QAAI,OAAO,WAAW,YAAa;AACnC,QAAI,6BAAM;AACR,aAAO,QAAQ,aAAa,OAAO,QAAQ,OAAO,IAAI,EAAE;AAAA,gBAC9C,QAAQ,UAAU,OAAO,QAAQ,OAAO,IAAI,EAAE;AAC1D,WAAO,cAAc,IAAI,cAAc,UA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ourceRoot":"","sources":["../../src/rpc/router.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAQjD,MAAM,WAAW,aAAa;IAC5B,sDAAsD;IACtD,QAAQ,EAAE,MAAM,CAAC;IACjB,mEAAmE;IACnE,UAAU,EAAE,UAAU,CAAC;IACvB,mFAAmF;IACnF,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;CAC9D;AAID,eAAO,MAAM,aAAa,+CAA4C,CAAC;AAsBvE;;wEAEwE;AACxE,wBAAgB,gBAAgB,IAAI,aAAa,CAmChD;AAED;;+EAE+E;AAC/E,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,CAwBlE;AAED;+EAC+E;AAC/E,wBAAgB,SAAS,IAAI,aAAa,CAIzC"}
1
+ {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/rpc/router.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAQjD,MAAM,WAAW,aAAa;IAC5B,sDAAsD;IACtD,QAAQ,EAAE,MAAM,CAAC;IACjB,mEAAmE;IACnE,UAAU,EAAE,UAAU,CAAC;IACvB,mFAAmF;IACnF,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;CAC9D;AAID,eAAO,MAAM,aAAa,+CAA4C,CAAC;AAsBvE;;wEAEwE;AACxE,wBAAgB,gBAAgB,IAAI,aAAa,CAoChD;AAED;;+EAE+E;AAC/E,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,CAwBlE;AAED;+EAC+E;AAC/E,wBAAgB,SAAS,IAAI,aAAa,CAIzC"}
@@ -9,11 +9,12 @@ function subscribeToHistory(onChange) {
9
9
  return () => window.removeEventListener("popstate", onChange);
10
10
  }
11
11
  function useBrowserRouter() {
12
- const pathname = useSyncExternalStore(
12
+ const location = useSyncExternalStore(
13
13
  subscribeToHistory,
14
- () => window.location.pathname,
14
+ () => `${window.location.pathname}${window.location.search}${window.location.hash}`,
15
15
  () => "/"
16
16
  );
17
+ const pathname = location.split(/[?#]/, 1)[0] || "/";
17
18
  const navigate = useCallback((to, opts) => {
18
19
  if (typeof window === "undefined") return;
19
20
  if (opts == null ? void 0 : opts.replace)
@@ -1 +1 @@
1
- {"version":3,"file":"router.js","sources":["../../src/rpc/router.tsx"],"sourcesContent":["import {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useState,\n useSyncExternalStore,\n type MouseEvent as ReactMouseEvent,\n} from \"react\";\nimport type { RenderLink } from \"./EndpointList\";\n\n// A RouterAdapter bundles the three navigation concerns clicky-ui nav surfaces\n// need — the current location, how to render a link, and how to navigate\n// imperatively — into one object the host supplies once (via RouterProvider).\n// This keeps the library router-agnostic: a react-router host builds the adapter\n// from its own hooks, while router-less hosts/tests use the browser or memory\n// adapters below. Nothing here imports any router package.\nexport interface RouterAdapter {\n /** Current path, used to compute active nav state. */\n pathname: string;\n /** Render a navigation link (host's <Link>, a plain <a>, etc.). */\n renderLink: RenderLink;\n /** Navigate imperatively. `replace` swaps the current entry instead of pushing. */\n navigate: (to: string, opts?: { replace?: boolean }) => void;\n}\n\n// RouterContext is consumed by useRouter and provided by RouterProvider (in its\n// own module so this file exports only hooks/values, keeping fast-refresh happy).\nexport const RouterContext = createContext<RouterAdapter | null>(null);\n\n// A plain left-click on a same-tab link is the only case we intercept for\n// client-side navigation; modifier/middle clicks and new-tab links fall through\n// to the browser so \"open in new tab\" and friends keep working.\nfunction isPlainLeftClick(event: ReactMouseEvent<HTMLAnchorElement>): boolean {\n return (\n !event.defaultPrevented &&\n event.button === 0 &&\n !event.metaKey &&\n !event.ctrlKey &&\n !event.shiftKey &&\n !event.altKey &&\n event.currentTarget.target !== \"_blank\"\n );\n}\n\nfunction subscribeToHistory(onChange: () => void): () => void {\n window.addEventListener(\"popstate\", onChange);\n return () => window.removeEventListener(\"popstate\", onChange);\n}\n\n/** Live browser adapter: location from history, real <a href> links that\n * navigate client-side via the History API (like react-router's <Link>). This\n * is the router-agnostic default when no RouterProvider is mounted. */\nexport function useBrowserRouter(): RouterAdapter {\n const pathname = useSyncExternalStore(\n subscribeToHistory,\n () => window.location.pathname,\n () => \"/\",\n );\n const navigate = useCallback((to: string, opts?: { replace?: boolean }) => {\n if (typeof window === \"undefined\") return;\n if (opts?.replace)\n window.history.replaceState(window.history.state, \"\", to);\n else window.history.pushState(window.history.state, \"\", to);\n window.dispatchEvent(new PopStateEvent(\"popstate\"));\n }, []);\n const renderLink = useCallback<RenderLink>(\n ({ to, className, children, title, key }) => (\n <a\n key={key}\n href={to}\n className={className}\n title={title}\n onClick={(event) => {\n if (!isPlainLeftClick(event)) return;\n event.preventDefault();\n navigate(to);\n }}\n >\n {children}\n </a>\n ),\n [navigate],\n );\n return useMemo(\n () => ({ pathname, renderLink, navigate }),\n [pathname, renderLink, navigate],\n );\n}\n\n/** In-memory adapter for demos and tests: location lives in React state, links\n * intercept clicks to update it, and navigation never touches the browser URL —\n * so a router-less demo can switch routes without hijacking the host page. */\nexport function useMemoryRouter(initialPath: string): RouterAdapter {\n const [pathname, setPathname] = useState(initialPath);\n const navigate = useCallback((to: string) => setPathname(to), []);\n const renderLink = useCallback<RenderLink>(\n ({ to, className, children, title, key }) => (\n <a\n key={key}\n href={to}\n className={className}\n title={title}\n onClick={(event) => {\n event.preventDefault();\n setPathname(to);\n }}\n >\n {children}\n </a>\n ),\n [],\n );\n return useMemo(\n () => ({ pathname, renderLink, navigate }),\n [pathname, renderLink, navigate],\n );\n}\n\n/** Resolve the active adapter: an explicit RouterProvider wins, otherwise fall\n * back to a live browser adapter (the documented router-agnostic default). */\nexport function useRouter(): RouterAdapter {\n const ct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B,aAAoC;AAClE,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,WAAW;AACpD,QAAM,WAAW,YAAY,CAAC,OAAe,YAAY,EAAE,GAAG,EAAE;AAChE,QAAM,aAAa;AAAA,IACjB,CAAC,EAAE,IAAI,WAAW,UAAU,OAAO,UACjC;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,MAAM;AAAA,QACN;AAAA,QACA;AAAA,QACA,SAAS,CAAC,UAAU;AAClB,gBAAM,eAAA;AACN,sBAAY,EAAE;AAAA,QAChB;AAAA,QAEC;AAAA,MAAA;AAAA,MATI;AAAA,IAAA;AAAA,IAYT,CAAA;AAAA,EAAC;AAEH,SAAO;AAAA,IACL,OAAO,EAAE,UAAU,YAAY;IAC/B,CAAC,UAAU,YAAY,QAAQ;AAAA,EAAA;AAEnC;AAIO,SAAS,YAA2B;AACzC,QAAM,MAAM,WAAW,aAAa;AACpC,QAAM,UAAU,iBAAA;AAChB,SAAO,OAAO;AAChB;"}
1
+ {"version":3,"file":"router.js","sources":["../../src/rpc/router.tsx"],"sourcesContent":["import {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useState,\n useSyncExternalStore,\n type MouseEvent as ReactMouseEvent,\n} from \"react\";\nimport type { RenderLink } from \"./EndpointList\";\n\n// A RouterAdapter bundles the three navigation concerns clicky-ui nav surfaces\n// need — the current location, how to render a link, and how to navigate\n// imperatively — into one object the host supplies once (via RouterProvider).\n// This keeps the library router-agnostic: a react-router host builds the adapter\n// from its own hooks, while router-less hosts/tests use the browser or memory\n// adapters below. Nothing here imports any router package.\nexport interface RouterAdapter {\n /** Current path, used to compute active nav state. */\n pathname: string;\n /** Render a navigation link (host's <Link>, a plain <a>, etc.). */\n renderLink: RenderLink;\n /** Navigate imperatively. `replace` swaps the current entry instead of pushing. */\n navigate: (to: string, opts?: { replace?: boolean }) => void;\n}\n\n// RouterContext is consumed by useRouter and provided by RouterProvider (in its\n// own module so this file exports only hooks/values, keeping fast-refresh happy).\nexport const RouterContext = createContext<RouterAdapter | null>(null);\n\n// A plain left-click on a same-tab link is the only case we intercept for\n// client-side navigation; modifier/middle clicks and new-tab links fall through\n// to the browser so \"open in new tab\" and friends keep working.\nfunction isPlainLeftClick(event: ReactMouseEvent<HTMLAnchorElement>): boolean {\n return (\n !event.defaultPrevented &&\n event.button === 0 &&\n !event.metaKey &&\n !event.ctrlKey &&\n !event.shiftKey &&\n !event.altKey &&\n event.currentTarget.target !== \"_blank\"\n );\n}\n\nfunction subscribeToHistory(onChange: () => void): () => void {\n window.addEventListener(\"popstate\", onChange);\n return () => window.removeEventListener(\"popstate\", onChange);\n}\n\n/** Live browser adapter: location from history, real <a href> links that\n * navigate client-side via the History API (like react-router's <Link>). This\n * is the router-agnostic default when no RouterProvider is mounted. */\nexport function useBrowserRouter(): RouterAdapter {\n const location = useSyncExternalStore(\n subscribeToHistory,\n () => `${window.location.pathname}${window.location.search}${window.location.hash}`,\n () => \"/\",\n );\n const pathname = location.split(/[?#]/, 1)[0] || \"/\";\n const navigate = useCallback((to: string, opts?: { replace?: boolean }) => {\n if (typeof window === \"undefined\") return;\n if (opts?.replace)\n window.history.replaceState(window.history.state, \"\", to);\n else window.history.pushState(window.history.state, \"\", to);\n window.dispatchEvent(new PopStateEvent(\"popstate\"));\n }, []);\n const renderLink = useCallback<RenderLink>(\n ({ to, className, children, title, key }) => (\n <a\n key={key}\n href={to}\n className={className}\n title={title}\n onClick={(event) => {\n if (!isPlainLeftClick(event)) return;\n event.preventDefault();\n navigate(to);\n }}\n >\n {children}\n </a>\n ),\n [navigate],\n );\n return useMemo(\n () => ({ pathname, renderLink, navigate }),\n [pathname, renderLink, navigate],\n );\n}\n\n/** In-memory adapter for demos and tests: location lives in React state, links\n * intercept clicks to update it, and navigation never touches the browser URL —\n * so a router-less demo can switch routes without hijacking the host page. */\nexport function useMemoryRouter(initialPath: string): RouterAdapter {\n const [pathname, setPathname] = useState(initialPath);\n const navigate = useCallback((to: string) => setPathname(to), []);\n const renderLink = useCallback<RenderLink>(\n ({ to, className, children, title, key }) => (\n <a\n key={key}\n href={to}\n className={className}\n title={title}\n onClick={(event) => {\n event.preventDefault();\n setPathname(to);\n }}\n >\n {children}\n </a>\n ),\n [],\n );\n return useMemo(\n () => ({ pathname, renderLink, navigate }),\n [pathname, renderLink, navigate],\n );\n}\n\n/** Resolve the active adapter: an explicit RouterProvider wins, otherwise fall\n * back to a live browser adapter (the documented router-agnostic default). */\nexport function useRouter(): RouterAdapter {\n const ctx = useContext(RouterContext);\n const browser = useBrowserRouter();\n return ctx ?? browser;\n}\n"],"names":[],"mappings":";;AA4BO,MAAM,gBAAgB,cAAoC,IAAI;AAKrE,SAAS,iBAAiB,OAAoD;AAC5E,SACE,CAAC,MAAM,oBACP,MAAM,WAAW,KACjB,CAAC,MAAM,WACP,CAAC,MAAM,WACP,CAAC,MAAM,YACP,CAAC,MAAM,UACP,MAAM,cAAc,WAAW;AAEnC;AAEA,SAAS,mBAAmB,UAAkC;AAC5D,SAAO,iBAAiB,YAAY,QAAQ;AAC5C,SAAO,MAAM,OAAO,oBAAoB,YAAY,QAAQ;AAC9D;AAKO,SAAS,mBAAkC;AAChD,QAAM,WAAW;AAAA,IACf;AAAA,IACA,MAAM,GAAG,OAAO,SAAS,QAAQ,GAAG,OAAO,SAAS,MAAM,GAAG,OAAO,SAAS,IAAI;AAAA,IACjF,MAAM;AAAA,EAAA;AAER,QAAM,WAAW,SAAS,MAAM,QAAQ,CAAC,EAAE,CAAC,KAAK;AACjD,QAAM,WAAW,YAAY,CAAC,IAAY,SAAiC;AACzE,QAAI,OAAO,WAAW,YAAa;AACnC,QAAI,6BAAM;AACR,aAAO,QAAQ,aAAa,OAAO,QAAQ,OAAO,IAAI,EAAE;AAAA,gBAC9C,QAAQ,UAAU,OAAO,QAAQ,OAAO,IAAI,EAAE;AAC1D,WAAO,cAAc,IAAI,cAAc,UAAU,CAAC;AAAA,EACpD,GAAG,CAAA,CAAE;AACL,QAAM,aAAa;AAAA,IACjB,CAAC,EAAE,IAAI,WAAW,UAAU,OAAO,UACjC;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,MAAM;AAAA,QACN;AAAA,QACA;AAAA,QACA,SAAS,CAAC,UAAU;AAClB,cAAI,CAAC,iBAAiB,KAAK,EAAG;AAC9B,gBAAM,eAAA;AACN,mBAAS,EAAE;AAAA,QACb;AAAA,QAEC;AAAA,MAAA;AAAA,MAVI;AAAA,IAAA;AAAA,IAaT,CAAC,QAAQ;AAAA,EAAA;AAEX,SAAO;AAAA,IACL,OAAO,EAAE,UAAU,YAAY;IAC/B,CAAC,UAAU,YAAY,QAAQ;AAAA,EAAA;AAEnC;AAKO,SAAS,gBAAgB,aAAoC;AAClE,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,WAAW;AACpD,QAAM,WAAW,YAAY,CAAC,OAAe,YAAY,EAAE,GAAG,EAAE;AAChE,QAAM,aAAa;AAAA,IACjB,CAAC,EAAE,IAAI,WAAW,UAAU,OAAO,UACjC;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,MAAM;AAAA,QACN;AAAA,QACA;AAAA,QACA,SAAS,CAAC,UAAU;AAClB,gBAAM,eAAA;AACN,sBAAY,EAAE;AAAA,QAChB;AAAA,QAEC;AAAA,MAAA;AAAA,MATI;AAAA,IAAA;AAAA,IAYT,CAAA;AAAA,EAAC;AAEH,SAAO;AAAA,IACL,OAAO,EAAE,UAAU,YAAY;IAC/B,CAAC,UAAU,YAAY,QAAQ;AAAA,EAAA;AAEnC;AAIO,SAAS,YAA2B;AACzC,QAAM,MAAM,WAAW,aAAa;AACpC,QAAM,UAAU,iBAAA;AAChB,SAAO,OAAO;AAChB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","sources":["../../src/rpc/types.ts"],"sourcesContent":["import type { ClickyNode } from \"../data/Clicky\";\nimport type { TimeRangePresetGroup } from \"../components/TimeRange\";\n\nexport interface ExecutionRequest {\n args?: string[];\n flags?: Record<string, string>;\n}\n\nexport type OperationRequestValues = Record<string, string | string[]>;\n\nexport interface ExecutionPagination {\n total?: number;\n limit?: number;\n offset?: number;\n\n // totalRelation says whether total is a count or a lower bound. A backend\n // that stops counting past a threshold reports \"gte\", and rendering that as\n // a count would state a number nobody promised.\n totalRelation?: \"eq\" | \"gte\";\n\n // hasMore is the server's answer, not an inference from the page length: a\n // short page and the end of the data are different facts.\n hasMore?: boolean;\n\n // nextCursor resumes after this page. Opaque — it is passed back unchanged\n // and never parsed, because a client that can read one can forge one.\n nextCursor?: string;\n\n // truncated reports that the server stopped short of the whole result, so a\n // partial answer is never rendered as a complete one.\n truncated?: boolean;\n}\n\nexport interface ExecutionResponse {\n success: boolean;\n message?: string;\n output?: string;\n stdout?: string;\n stderr?: string;\n exit_code: number;\n error?: string;\n cli?: string;\n input?: ExecutionRequest;\n contentType?: string;\n requestUrl?: string;\n responseHeaders?: Record<string, string>;\n pagination?: ExecutionPagination;\n blob?: Blob;\n parsed?: unknown;\n}\n\nexport interface OpenAPISchema {\n type?: string;\n format?: string;\n default?: unknown;\n enum?: unknown[];\n description?: string;\n properties?: Record<string, OpenAPISchema>;\n items?: OpenAPISchema;\n oneOf?: OpenAPISchema[];\n additionalProperties?: OpenAPISchema | boolean;\n nullable?: boolean;\n}\n\n// ClickyParameterRole tells the UI which widget owns a parameter:\n// \"search\" — render as the FilterBar's dedicated search input\n// \"filter\" — render as a FilterBar chip on the DataTable\n// \"limit\" — feed into DataTable pagination's pageSize\n// \"offset\" — feed into DataTable pagination's page (or skip)\n// \"cursor\" — carry the opaque position the previous page returned\n// \"sort\" — select a public server-side sort key from a table header\n// \"order\" — carry that sort's asc/desc direction\n// \"time-from\" — left edge of a time-range picker\n// \"time-to\" — right edge of a time-range picker\n// Set server-side by clicky's converter (see paramRole in clicky/rpc/openapi.go).\nexport type ClickyParameterRole =\n | \"search\"\n | \"filter\"\n | \"limit\"\n | \"offset\"\n | \"cursor\"\n | \"sort\"\n | \"order\"\n | \"time-from\"\n | \"time-to\";\n\nexport interface ClickyParameterMeta {\n role?: ClickyParameterRole;\n}\n\n/**\n * A parameter's pointer to its filter control, set server-side.\n *\n * `$ref` names the control's SHAPE — which control this is — and is present on\n * every generated filter, because a control's identity never varies with the\n * values currently selected. `url`/`filter`/`searchParam` are the separate\n * question of where its OPTIONS come from, and are present only when the\n * backend can enumerate them: a range has no list to offer.\n */\nexport interface ClickyParameterLookup {\n /** JSON pointer into `components[\"x-clicky-filters\"]`. */\n $ref?: string;\n url?: string;\n filter?: string;\n searchParam?: string;\n multi?: boolean;\n}\n\n/**\n * One entry of `components[\"x-clicky-filters\"]`: a filter control's shape,\n * published once per spec and invariant for the life of it.\n *\n * Distinct from OperationLookupFilter, which is the per-request answer to \"what\n * values can this filter take right now\" and may legitimately narrow as other\n * filters are selected. Reading shape from here rather than from a lookup\n * response is what keeps a control from decaying into a text box while its\n * options are in flight.\n */\nexport interface ClickyFilterShape {\n label?: string;\n type?: OperationLookupFilterType;\n multi?: boolean;\n}\n\nexport interface OpenAPIParameter {\n name: string;\n in: \"query\" | \"path\" | \"header\";\n description?: string;\n required?: boolean;\n schema?: OpenAPISchema;\n /** Hint text shown inside the empty input. Distinct from `description`,\n * which is help text and must NOT be used as a placeholder. */\n placeholder?: string;\n \"x-clicky\"?: ClickyParameterMeta;\n \"x-clicky-lookup\"?: ClickyParameterLookup;\n /** Vendor-extension placeholder, set server-side by clicky's converter.\n * Takes precedence over `placeholder` when both are present. */\n \"x-clicky-placeholder\"?: string;\n}\n\n/** Resolves the input placeholder for a parameter, drawing ONLY from explicit\n * placeholder fields — never from `description` (help text). Returns undefined\n * when no placeholder is declared so callers can apply their own fallback. */\nexport function parameterPlaceholder(\n param: OpenAPIParameter,\n): string | undefined {\n return param[\"x-clicky-placeholder\"] ?? param.placeholder;\n}\n\nexport interface OpenAPIOperation {\n tags?: string[];\n summary?: string;\n description?: string;\n operationId?: string;\n parameters?: OpenAPIParameter[];\n requestBody?: {\n content?: Record<string, { schema?: OpenAPISchema }>;\n };\n // Optional because nothing here reads it, and a server may serve this catalog\n // with the response schemas reduced to a stub — they are over half the bytes\n // of a spec whose only job here is to describe what can be called.\n responses?: Record<string, unknown>;\n \"x-clicky\"?: ClickyOperationMeta;\n}\n\nexport interface OpenAPISpec {\n openapi: string;\n info: { title: string; description?: string; version: string };\n paths: Record<string, Record<string, OpenAPIOperation>>;\n tags?: Array<{ name: string; description?: string }>;\n components?: {\n \"x-clicky-filters\"?: Record<string, ClickyFilterShape>;\n };\n \"x-clicky\"?: ClickySpecMeta;\n}\n\nexport interface ResolvedOperation {\n path: string;\n method: string;\n operation: OpenAPIOperation;\n}\n\nexport interface DomainDefinition {\n key: string;\n title: string;\n description: string;\n icon?: string;\n emptyTitle?: string;\n emptyDescription?: string;\n}\n\nexport interface ClickySpecMeta {\n surfaces?: ClickySurface[];\n}\n\nexport interface ClickySurface {\n key: string;\n entity: string;\n title: string;\n parent?: string;\n admin?: boolean;\n description?: string;\n /** Opaque icon name emitted by the backend (x-clicky-icon), resolved to a glyph in the UI. */\n icon?: string;\n /**\n * Hierarchy position within `parent`, \"/\"-separated (x-clicky-path) — e.g.\n * \"jms/incoming/disbursements\". The backend has already applied whatever\n * delimiter its own naming convention uses, so the UI never guesses one.\n * Absent — the default — means the parent group renders as a flat list.\n */\n path?: string;\n}\n\nexport interface ClickyOperationMeta {\n command?: string;\n surface?: string;\n verb: \"list\" | \"get\" | \"create\" | \"update\" | \"delete\" | \"action\";\n scope: \"collection\" | \"entity\";\n actionName?: string;\n idParam?: string;\n supportsLookup?: boolean;\n supportsFilterMode?: boolean;\n group?: string;\n toolHints?: ClickyToolHints;\n export?: ClickyExportMeta;\n}\n\nexport interface ClickyExportMeta {\n formats?: string[];\n scopes?: Array<\"page\" | \"all\">;\n allRowsMode?: \"streaming\" | \"buffered\";\n formatMaxRows?: Record<string, number>;\n}\n\nexport interface ClickyToolHints {\n title?: string;\n readOnlyHint?: boolean;\n destructiveHint?: boolean;\n idempotentHint?: boolean;\n openWorldHint?: boolean;\n icon?: string;\n group?: string;\n parent?: string;\n defaultPermission?: \"on\" | \"ask\" | \"off\" | \"auto\";\n strict?: boolean;\n}\n\nexport type OperationLookupFilterType =\n | \"bool\"\n | \"number\"\n | \"date\"\n /** Both edges of a range under one parameter, as \">=from,<=to\". */\n | \"date-range\"\n /** A \"date-range\" with the clock taken off it: whole days, same grammar. */\n | \"day-range\"\n /**\n * A numeric range over elapsed time. Same grammar as \"number\"; the operands\n * are the column's own unit, which `unit` names.\n */\n | \"duration\"\n | \"from\"\n | \"to\"\n | \"multi-filter\"\n /** A Kubernetes workload selected inside a profile's target scope. */\n | \"workload\"\n /** Kubernetes label values, grouped by key when options are key=value pairs. */\n | \"labels\"\n /**\n * An exact-value selection with nothing to enumerate — a UUID column, say.\n * Same wire grammar as \"multi-filter\"; typed rather than picked, because a\n * dropdown over identifiers is a page of the rows.\n */\n | \"value\";\n\nexport interface OperationLookupFilter {\n label?: string;\n options?: Record<string, ClickyNode>;\n selected?: Record<string, ClickyNode>;\n multi?: boolean;\n type?: OperationLookupFilterType;\n /** True when `options` is only the head of a larger set (server-side capped). */\n truncated?: boolean;\n /** True distinct count behind a truncated option set; drives \"… and N more\". */\n total?: number;\n presets?: Array<\n { label: string; from: string; to: string } | TimeRangePresetGroup\n >;\n timeEnabled?: boolean;\n timeZone?: string;\n timeZones?: string[];\n /** The unit a \"duration\" filter's operands are written in (\"ms\" or \"s\"), so\n * the control labels itself in the numbers the column is stored in. Absent\n * means milliseconds. */\n unit?: string;\n}\n\nexport interface OperationLookupResponse {\n filters: Record<string, OperationLookupFilter>;\n}\n\nexport function isPositionalParam(p: OpenAPIParameter): boolean {\n return (\n p.name === \"args\" ||\n p.description?.toLowerCase().includes(\"positional argument\") === true\n );\n}\n"],"names":[],"mappings":";;AA+IO,SAAS,qBACd,OACoB;AACpB,SAAO,MAAM,sBAAsB,KAAK,MAAM;AAChD;AAyJO,SAAS,kBAAkB,GAA8B;;AAC9D,SACE,EAAE,SAAS,YACX,OAAE,gBAAF,mBAAe,cAAc,SAAS,4BAA2B;AAErE;;;"}
1
+ {"version":3,"file":"types.cjs","sources":["../../src/rpc/types.ts"],"sourcesContent":["import type { ClickyNode } from \"../data/Clicky\";\nimport type { TimeRangePresetGroup } from \"../components/TimeRange\";\n\nexport interface ExecutionRequest {\n args?: string[];\n flags?: Record<string, string>;\n}\n\nexport type OperationRequestValues = Record<string, string | string[]>;\n\nexport interface ExecutionPagination {\n total?: number;\n limit?: number;\n offset?: number;\n\n // totalRelation says whether total is a count or a lower bound. A backend\n // that stops counting past a threshold reports \"gte\", and rendering that as\n // a count would state a number nobody promised.\n totalRelation?: \"eq\" | \"gte\";\n\n // hasMore is the server's answer, not an inference from the page length: a\n // short page and the end of the data are different facts.\n hasMore?: boolean;\n\n // nextCursor resumes after this page. Opaque — it is passed back unchanged\n // and never parsed, because a client that can read one can forge one.\n nextCursor?: string;\n\n // truncated reports that the server stopped short of the whole result, so a\n // partial answer is never rendered as a complete one.\n truncated?: boolean;\n}\n\nexport interface ExecutionResponse {\n success: boolean;\n message?: string;\n output?: string;\n stdout?: string;\n stderr?: string;\n exit_code: number;\n error?: string;\n cli?: string;\n input?: ExecutionRequest;\n contentType?: string;\n requestUrl?: string;\n responseHeaders?: Record<string, string>;\n pagination?: ExecutionPagination;\n blob?: Blob;\n parsed?: unknown;\n}\n\nexport interface OpenAPISchema {\n type?: string;\n format?: string;\n default?: unknown;\n enum?: unknown[];\n description?: string;\n properties?: Record<string, OpenAPISchema>;\n items?: OpenAPISchema;\n oneOf?: OpenAPISchema[];\n additionalProperties?: OpenAPISchema | boolean;\n nullable?: boolean;\n}\n\n// ClickyParameterRole tells the UI which widget owns a parameter:\n// \"search\" — render as the FilterBar's dedicated search input\n// \"filter\" — render as a FilterBar chip on the DataTable\n// \"limit\" — feed into DataTable pagination's pageSize\n// \"offset\" — feed into DataTable pagination's page (or skip)\n// \"cursor\" — carry the opaque position the previous page returned\n// \"sort\" — select a public server-side sort key from a table header\n// \"order\" — carry that sort's asc/desc direction\n// \"time-from\" — left edge of a time-range picker\n// \"time-to\" — right edge of a time-range picker\n// Set server-side by clicky's converter (see paramRole in clicky/rpc/openapi.go).\nexport type ClickyParameterRole =\n | \"search\"\n | \"filter\"\n | \"limit\"\n | \"offset\"\n | \"cursor\"\n | \"sort\"\n | \"order\"\n | \"time-from\"\n | \"time-to\";\n\nexport interface ClickyParameterMeta {\n role?: ClickyParameterRole;\n}\n\n/**\n * A parameter's pointer to its filter control, set server-side.\n *\n * `$ref` names the control's SHAPE — which control this is — and is present on\n * every generated filter, because a control's identity never varies with the\n * values currently selected. `url`/`filter`/`searchParam` are the separate\n * question of where its OPTIONS come from, and are present only when the\n * backend can enumerate them: a range has no list to offer.\n */\nexport interface ClickyParameterLookup {\n /** JSON pointer into `components[\"x-clicky-filters\"]`. */\n $ref?: string;\n url?: string;\n filter?: string;\n searchParam?: string;\n multi?: boolean;\n}\n\n/**\n * One entry of `components[\"x-clicky-filters\"]`: a filter control's shape,\n * published once per spec and invariant for the life of it.\n *\n * Distinct from OperationLookupFilter, which is the per-request answer to \"what\n * values can this filter take right now\" and may legitimately narrow as other\n * filters are selected. Reading shape from here rather than from a lookup\n * response is what keeps a control from decaying into a text box while its\n * options are in flight.\n */\nexport interface ClickyFilterShape {\n label?: string;\n type?: OperationLookupFilterType;\n multi?: boolean;\n}\n\nexport interface OpenAPIParameter {\n name: string;\n in: \"query\" | \"path\" | \"header\";\n description?: string;\n required?: boolean;\n schema?: OpenAPISchema;\n /** Hint text shown inside the empty input. Distinct from `description`,\n * which is help text and must NOT be used as a placeholder. */\n placeholder?: string;\n \"x-clicky\"?: ClickyParameterMeta;\n \"x-clicky-lookup\"?: ClickyParameterLookup;\n /** Vendor-extension placeholder, set server-side by clicky's converter.\n * Takes precedence over `placeholder` when both are present. */\n \"x-clicky-placeholder\"?: string;\n}\n\n/** Resolves the input placeholder for a parameter, drawing ONLY from explicit\n * placeholder fields — never from `description` (help text). Returns undefined\n * when no placeholder is declared so callers can apply their own fallback. */\nexport function parameterPlaceholder(\n param: OpenAPIParameter,\n): string | undefined {\n return param[\"x-clicky-placeholder\"] ?? param.placeholder;\n}\n\nexport interface OpenAPIOperation {\n tags?: string[];\n summary?: string;\n description?: string;\n operationId?: string;\n parameters?: OpenAPIParameter[];\n requestBody?: {\n content?: Record<string, { schema?: OpenAPISchema }>;\n };\n // Optional because nothing here reads it, and a server may serve this catalog\n // with the response schemas reduced to a stub — they are over half the bytes\n // of a spec whose only job here is to describe what can be called.\n responses?: Record<string, unknown>;\n \"x-clicky\"?: ClickyOperationMeta;\n}\n\nexport interface OpenAPISpec {\n openapi: string;\n info: { title: string; description?: string; version: string };\n paths: Record<string, Record<string, OpenAPIOperation>>;\n tags?: Array<{ name: string; description?: string }>;\n components?: {\n \"x-clicky-filters\"?: Record<string, ClickyFilterShape>;\n };\n \"x-clicky\"?: ClickySpecMeta;\n}\n\nexport interface ResolvedOperation {\n path: string;\n method: string;\n operation: OpenAPIOperation;\n}\n\nexport interface DomainDefinition {\n key: string;\n title: string;\n description: string;\n icon?: string;\n emptyTitle?: string;\n emptyDescription?: string;\n}\n\nexport interface ClickySpecMeta {\n surfaces?: ClickySurface[];\n}\n\nexport interface ClickySurface {\n key: string;\n entity: string;\n title: string;\n parent?: string;\n admin?: boolean;\n description?: string;\n /** Opaque icon name emitted by the backend (x-clicky-icon), resolved to a glyph in the UI. */\n icon?: string;\n /**\n * Hierarchy position within `parent`, \"/\"-separated (x-clicky-path) — e.g.\n * \"jms/incoming/disbursements\". The backend has already applied whatever\n * delimiter its own naming convention uses, so the UI never guesses one.\n * Absent — the default — means the parent group renders as a flat list.\n */\n path?: string;\n}\n\nexport interface ClickyOperationMeta {\n command?: string;\n surface?: string;\n verb: \"list\" | \"get\" | \"create\" | \"update\" | \"delete\" | \"action\";\n scope: \"collection\" | \"entity\";\n actionName?: string;\n idParam?: string;\n supportsLookup?: boolean;\n supportsFilterMode?: boolean;\n group?: string;\n toolHints?: ClickyToolHints;\n export?: ClickyExportMeta;\n}\n\nexport interface ClickyExportMeta {\n formats?: string[];\n scopes?: Array<\"page\" | \"all\">;\n allRowsMode?: \"streaming\" | \"buffered\";\n formatMaxRows?: Record<string, number>;\n}\n\nexport interface ClickyToolHints {\n title?: string;\n readOnlyHint?: boolean;\n destructiveHint?: boolean;\n idempotentHint?: boolean;\n openWorldHint?: boolean;\n icon?: string;\n group?: string;\n parent?: string;\n /** Captain's tool vocabulary. The legacy `on`/`off` spellings are still\n * accepted on decode and mean `allow`/`deny`. */\n defaultPermission?: \"allow\" | \"ask\" | \"deny\" | \"auto\" | \"on\" | \"off\";\n strict?: boolean;\n}\n\nexport type OperationLookupFilterType =\n | \"bool\"\n | \"number\"\n | \"date\"\n /** Both edges of a range under one parameter, as \">=from,<=to\". */\n | \"date-range\"\n /** A \"date-range\" with the clock taken off it: whole days, same grammar. */\n | \"day-range\"\n /**\n * A numeric range over elapsed time. Same grammar as \"number\"; the operands\n * are the column's own unit, which `unit` names.\n */\n | \"duration\"\n | \"from\"\n | \"to\"\n | \"multi-filter\"\n /** A Kubernetes workload selected inside a profile's target scope. */\n | \"workload\"\n /** Kubernetes label values, grouped by key when options are key=value pairs. */\n | \"labels\"\n /**\n * An exact-value selection with nothing to enumerate — a UUID column, say.\n * Same wire grammar as \"multi-filter\"; typed rather than picked, because a\n * dropdown over identifiers is a page of the rows.\n */\n | \"value\";\n\nexport interface OperationLookupFilter {\n label?: string;\n options?: Record<string, ClickyNode>;\n selected?: Record<string, ClickyNode>;\n multi?: boolean;\n type?: OperationLookupFilterType;\n /** True when `options` is only the head of a larger set (server-side capped). */\n truncated?: boolean;\n /** True distinct count behind a truncated option set; drives \"… and N more\". */\n total?: number;\n presets?: Array<\n { label: string; from: string; to: string } | TimeRangePresetGroup\n >;\n timeEnabled?: boolean;\n timeZone?: string;\n timeZones?: string[];\n /** The unit a \"duration\" filter's operands are written in (\"ms\" or \"s\"), so\n * the control labels itself in the numbers the column is stored in. Absent\n * means milliseconds. */\n unit?: string;\n}\n\nexport interface OperationLookupResponse {\n filters: Record<string, OperationLookupFilter>;\n}\n\nexport function isPositionalParam(p: OpenAPIParameter): boolean {\n return (\n p.name === \"args\" ||\n p.description?.toLowerCase().includes(\"positional argument\") === true\n );\n}\n"],"names":[],"mappings":";;AA+IO,SAAS,qBACd,OACoB;AACpB,SAAO,MAAM,sBAAsB,KAAK,MAAM;AAChD;AA2JO,SAAS,kBAAkB,GAA8B;;AAC9D,SACE,EAAE,SAAS,YACX,OAAE,gBAAF,mBAAe,cAAc,SAAS,4BAA2B;AAErE;;;"}
@@ -190,7 +190,9 @@ export interface ClickyToolHints {
190
190
  icon?: string;
191
191
  group?: string;
192
192
  parent?: string;
193
- defaultPermission?: "on" | "ask" | "off" | "auto";
193
+ /** Captain's tool vocabulary. The legacy `on`/`off` spellings are still
194
+ * accepted on decode and mean `allow`/`deny`. */
195
+ defaultPermission?: "allow" | "ask" | "deny" | "auto" | "on" | "off";
194
196
  strict?: boolean;
195
197
  }
196
198
  export type OperationLookupFilterType = "bool" | "number" | "date"
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/rpc/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEpE,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAED,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;AAEvE,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAKhB,aAAa,CAAC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M;AACR,mEAAmE;GACjE,YAAY;AACd,4EAA4E;GAC1E,WAAW;AACb;;;GAGG;GACD,UAAU,GACV,MAAM,GACN,IAAI,GACJ,cAAc;AAChB,sEAAsE;GACpE,UAAU;AACZ,gFAAgF;GAC9E,QAAQ;AACV;;;;GAIG;GACD,OAAO,CAAC;AAEZ,MAAM,WAAW,qBAAqB;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACtC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,yBAAyB,CAAC;IACjC,iFAAiF;IACjF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,KAAK,CACb;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,oBAAoB,CACnE,CAAC;IACF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB;;8BAE0B;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;CAChD;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAK9D"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../src/rpc/types.ts"],"sourcesContent":["import type { ClickyNode } from \"../data/Clicky\";\nimport type { TimeRangePresetGroup } from \"../components/TimeRange\";\n\nexport interface ExecutionRequest {\n args?: string[];\n flags?: Record<string, string>;\n}\n\nexport type OperationRequestValues = Record<string, string | string[]>;\n\nexport interface ExecutionPagination {\n total?: number;\n limit?: number;\n offset?: number;\n\n // totalRelation says whether total is a count or a lower bound. A backend\n // that stops counting past a threshold reports \"gte\", and rendering that as\n // a count would state a number nobody promised.\n totalRelation?: \"eq\" | \"gte\";\n\n // hasMore is the server's answer, not an inference from the page length: a\n // short page and the end of the data are different facts.\n hasMore?: boolean;\n\n // nextCursor resumes after this page. Opaque — it is passed back unchanged\n // and never parsed, because a client that can read one can forge one.\n nextCursor?: string;\n\n // truncated reports that the server stopped short of the whole result, so a\n // partial answer is never rendered as a complete one.\n truncated?: boolean;\n}\n\nexport interface ExecutionResponse {\n success: boolean;\n message?: string;\n output?: string;\n stdout?: string;\n stderr?: string;\n exit_code: number;\n error?: string;\n cli?: string;\n input?: ExecutionRequest;\n contentType?: string;\n requestUrl?: string;\n responseHeaders?: Record<string, string>;\n pagination?: ExecutionPagination;\n blob?: Blob;\n parsed?: unknown;\n}\n\nexport interface OpenAPISchema {\n type?: string;\n format?: string;\n default?: unknown;\n enum?: unknown[];\n description?: string;\n properties?: Record<string, OpenAPISchema>;\n items?: OpenAPISchema;\n oneOf?: OpenAPISchema[];\n additionalProperties?: OpenAPISchema | boolean;\n nullable?: boolean;\n}\n\n// ClickyParameterRole tells the UI which widget owns a parameter:\n// \"search\" — render as the FilterBar's dedicated search input\n// \"filter\" — render as a FilterBar chip on the DataTable\n// \"limit\" — feed into DataTable pagination's pageSize\n// \"offset\" — feed into DataTable pagination's page (or skip)\n// \"cursor\" — carry the opaque position the previous page returned\n// \"sort\" — select a public server-side sort key from a table header\n// \"order\" — carry that sort's asc/desc direction\n// \"time-from\" — left edge of a time-range picker\n// \"time-to\" — right edge of a time-range picker\n// Set server-side by clicky's converter (see paramRole in clicky/rpc/openapi.go).\nexport type ClickyParameterRole =\n | \"search\"\n | \"filter\"\n | \"limit\"\n | \"offset\"\n | \"cursor\"\n | \"sort\"\n | \"order\"\n | \"time-from\"\n | \"time-to\";\n\nexport interface ClickyParameterMeta {\n role?: ClickyParameterRole;\n}\n\n/**\n * A parameter's pointer to its filter control, set server-side.\n *\n * `$ref` names the control's SHAPE — which control this is — and is present on\n * every generated filter, because a control's identity never varies with the\n * values currently selected. `url`/`filter`/`searchParam` are the separate\n * question of where its OPTIONS come from, and are present only when the\n * backend can enumerate them: a range has no list to offer.\n */\nexport interface ClickyParameterLookup {\n /** JSON pointer into `components[\"x-clicky-filters\"]`. */\n $ref?: string;\n url?: string;\n filter?: string;\n searchParam?: string;\n multi?: boolean;\n}\n\n/**\n * One entry of `components[\"x-clicky-filters\"]`: a filter control's shape,\n * published once per spec and invariant for the life of it.\n *\n * Distinct from OperationLookupFilter, which is the per-request answer to \"what\n * values can this filter take right now\" and may legitimately narrow as other\n * filters are selected. Reading shape from here rather than from a lookup\n * response is what keeps a control from decaying into a text box while its\n * options are in flight.\n */\nexport interface ClickyFilterShape {\n label?: string;\n type?: OperationLookupFilterType;\n multi?: boolean;\n}\n\nexport interface OpenAPIParameter {\n name: string;\n in: \"query\" | \"path\" | \"header\";\n description?: string;\n required?: boolean;\n schema?: OpenAPISchema;\n /** Hint text shown inside the empty input. Distinct from `description`,\n * which is help text and must NOT be used as a placeholder. */\n placeholder?: string;\n \"x-clicky\"?: ClickyParameterMeta;\n \"x-clicky-lookup\"?: ClickyParameterLookup;\n /** Vendor-extension placeholder, set server-side by clicky's converter.\n * Takes precedence over `placeholder` when both are present. */\n \"x-clicky-placeholder\"?: string;\n}\n\n/** Resolves the input placeholder for a parameter, drawing ONLY from explicit\n * placeholder fields — never from `description` (help text). Returns undefined\n * when no placeholder is declared so callers can apply their own fallback. */\nexport function parameterPlaceholder(\n param: OpenAPIParameter,\n): string | undefined {\n return param[\"x-clicky-placeholder\"] ?? param.placeholder;\n}\n\nexport interface OpenAPIOperation {\n tags?: string[];\n summary?: string;\n description?: string;\n operationId?: string;\n parameters?: OpenAPIParameter[];\n requestBody?: {\n content?: Record<string, { schema?: OpenAPISchema }>;\n };\n // Optional because nothing here reads it, and a server may serve this catalog\n // with the response schemas reduced to a stub — they are over half the bytes\n // of a spec whose only job here is to describe what can be called.\n responses?: Record<string, unknown>;\n \"x-clicky\"?: ClickyOperationMeta;\n}\n\nexport interface OpenAPISpec {\n openapi: string;\n info: { title: string; description?: string; version: string };\n paths: Record<string, Record<string, OpenAPIOperation>>;\n tags?: Array<{ name: string; description?: string }>;\n components?: {\n \"x-clicky-filters\"?: Record<string, ClickyFilterShape>;\n };\n \"x-clicky\"?: ClickySpecMeta;\n}\n\nexport interface ResolvedOperation {\n path: string;\n method: string;\n operation: OpenAPIOperation;\n}\n\nexport interface DomainDefinition {\n key: string;\n title: string;\n description: string;\n icon?: string;\n emptyTitle?: string;\n emptyDescription?: string;\n}\n\nexport interface ClickySpecMeta {\n surfaces?: ClickySurface[];\n}\n\nexport interface ClickySurface {\n key: string;\n entity: string;\n title: string;\n parent?: string;\n admin?: boolean;\n description?: string;\n /** Opaque icon name emitted by the backend (x-clicky-icon), resolved to a glyph in the UI. */\n icon?: string;\n /**\n * Hierarchy position within `parent`, \"/\"-separated (x-clicky-path) — e.g.\n * \"jms/incoming/disbursements\". The backend has already applied whatever\n * delimiter its own naming convention uses, so the UI never guesses one.\n * Absent — the default — means the parent group renders as a flat list.\n */\n path?: string;\n}\n\nexport interface ClickyOperationMeta {\n command?: string;\n surface?: string;\n verb: \"list\" | \"get\" | \"create\" | \"update\" | \"delete\" | \"action\";\n scope: \"collection\" | \"entity\";\n actionName?: string;\n idParam?: string;\n supportsLookup?: boolean;\n supportsFilterMode?: boolean;\n group?: string;\n toolHints?: ClickyToolHints;\n export?: ClickyExportMeta;\n}\n\nexport interface ClickyExportMeta {\n formats?: string[];\n scopes?: Array<\"page\" | \"all\">;\n allRowsMode?: \"streaming\" | \"buffered\";\n formatMaxRows?: Record<string, number>;\n}\n\nexport interface ClickyToolHints {\n title?: string;\n readOnlyHint?: boolean;\n destructiveHint?: boolean;\n idempotentHint?: boolean;\n openWorldHint?: boolean;\n icon?: string;\n group?: string;\n parent?: string;\n defaultPermission?: \"on\" | \"ask\" | \"off\" | \"auto\";\n strict?: boolean;\n}\n\nexport type OperationLookupFilterType =\n | \"bool\"\n | \"number\"\n | \"date\"\n /** Both edges of a range under one parameter, as \">=from,<=to\". */\n | \"date-range\"\n /** A \"date-range\" with the clock taken off it: whole days, same grammar. */\n | \"day-range\"\n /**\n * A numeric range over elapsed time. Same grammar as \"number\"; the operands\n * are the column's own unit, which `unit` names.\n */\n | \"duration\"\n | \"from\"\n | \"to\"\n | \"multi-filter\"\n /** A Kubernetes workload selected inside a profile's target scope. */\n | \"workload\"\n /** Kubernetes label values, grouped by key when options are key=value pairs. */\n | \"labels\"\n /**\n * An exact-value selection with nothing to enumerate — a UUID column, say.\n * Same wire grammar as \"multi-filter\"; typed rather than picked, because a\n * dropdown over identifiers is a page of the rows.\n */\n | \"value\";\n\nexport interface OperationLookupFilter {\n label?: string;\n options?: Record<string, ClickyNode>;\n selected?: Record<string, ClickyNode>;\n multi?: boolean;\n type?: OperationLookupFilterType;\n /** True when `options` is only the head of a larger set (server-side capped). */\n truncated?: boolean;\n /** True distinct count behind a truncated option set; drives \"… and N more\". */\n total?: number;\n presets?: Array<\n { label: string; from: string; to: string } | TimeRangePresetGroup\n >;\n timeEnabled?: boolean;\n timeZone?: string;\n timeZones?: string[];\n /** The unit a \"duration\" filter's operands are written in (\"ms\" or \"s\"), so\n * the control labels itself in the numbers the column is stored in. Absent\n * means milliseconds. */\n unit?: string;\n}\n\nexport interface OperationLookupResponse {\n filters: Record<string, OperationLookupFilter>;\n}\n\nexport function isPositionalParam(p: OpenAPIParameter): boolean {\n return (\n p.name === \"args\" ||\n p.description?.toLowerCase().includes(\"positional argument\") === true\n );\n}\n"],"names":[],"mappings":"AA+IO,SAAS,qBACd,OACoB;AACpB,SAAO,MAAM,sBAAsB,KAAK,MAAM;AAChD;AAyJO,SAAS,kBAAkB,GAA8B;AA7JzD;AA8JL,SACE,EAAE,SAAS,YACX,OAAE,gBAAF,mBAAe,cAAc,SAAS,4BAA2B;AAErE;"}
1
+ {"version":3,"file":"types.js","sources":["../../src/rpc/types.ts"],"sourcesContent":["import type { ClickyNode } from \"../data/Clicky\";\nimport type { TimeRangePresetGroup } from \"../components/TimeRange\";\n\nexport interface ExecutionRequest {\n args?: string[];\n flags?: Record<string, string>;\n}\n\nexport type OperationRequestValues = Record<string, string | string[]>;\n\nexport interface ExecutionPagination {\n total?: number;\n limit?: number;\n offset?: number;\n\n // totalRelation says whether total is a count or a lower bound. A backend\n // that stops counting past a threshold reports \"gte\", and rendering that as\n // a count would state a number nobody promised.\n totalRelation?: \"eq\" | \"gte\";\n\n // hasMore is the server's answer, not an inference from the page length: a\n // short page and the end of the data are different facts.\n hasMore?: boolean;\n\n // nextCursor resumes after this page. Opaque — it is passed back unchanged\n // and never parsed, because a client that can read one can forge one.\n nextCursor?: string;\n\n // truncated reports that the server stopped short of the whole result, so a\n // partial answer is never rendered as a complete one.\n truncated?: boolean;\n}\n\nexport interface ExecutionResponse {\n success: boolean;\n message?: string;\n output?: string;\n stdout?: string;\n stderr?: string;\n exit_code: number;\n error?: string;\n cli?: string;\n input?: ExecutionRequest;\n contentType?: string;\n requestUrl?: string;\n responseHeaders?: Record<string, string>;\n pagination?: ExecutionPagination;\n blob?: Blob;\n parsed?: unknown;\n}\n\nexport interface OpenAPISchema {\n type?: string;\n format?: string;\n default?: unknown;\n enum?: unknown[];\n description?: string;\n properties?: Record<string, OpenAPISchema>;\n items?: OpenAPISchema;\n oneOf?: OpenAPISchema[];\n additionalProperties?: OpenAPISchema | boolean;\n nullable?: boolean;\n}\n\n// ClickyParameterRole tells the UI which widget owns a parameter:\n// \"search\" — render as the FilterBar's dedicated search input\n// \"filter\" — render as a FilterBar chip on the DataTable\n// \"limit\" — feed into DataTable pagination's pageSize\n// \"offset\" — feed into DataTable pagination's page (or skip)\n// \"cursor\" — carry the opaque position the previous page returned\n// \"sort\" — select a public server-side sort key from a table header\n// \"order\" — carry that sort's asc/desc direction\n// \"time-from\" — left edge of a time-range picker\n// \"time-to\" — right edge of a time-range picker\n// Set server-side by clicky's converter (see paramRole in clicky/rpc/openapi.go).\nexport type ClickyParameterRole =\n | \"search\"\n | \"filter\"\n | \"limit\"\n | \"offset\"\n | \"cursor\"\n | \"sort\"\n | \"order\"\n | \"time-from\"\n | \"time-to\";\n\nexport interface ClickyParameterMeta {\n role?: ClickyParameterRole;\n}\n\n/**\n * A parameter's pointer to its filter control, set server-side.\n *\n * `$ref` names the control's SHAPE — which control this is — and is present on\n * every generated filter, because a control's identity never varies with the\n * values currently selected. `url`/`filter`/`searchParam` are the separate\n * question of where its OPTIONS come from, and are present only when the\n * backend can enumerate them: a range has no list to offer.\n */\nexport interface ClickyParameterLookup {\n /** JSON pointer into `components[\"x-clicky-filters\"]`. */\n $ref?: string;\n url?: string;\n filter?: string;\n searchParam?: string;\n multi?: boolean;\n}\n\n/**\n * One entry of `components[\"x-clicky-filters\"]`: a filter control's shape,\n * published once per spec and invariant for the life of it.\n *\n * Distinct from OperationLookupFilter, which is the per-request answer to \"what\n * values can this filter take right now\" and may legitimately narrow as other\n * filters are selected. Reading shape from here rather than from a lookup\n * response is what keeps a control from decaying into a text box while its\n * options are in flight.\n */\nexport interface ClickyFilterShape {\n label?: string;\n type?: OperationLookupFilterType;\n multi?: boolean;\n}\n\nexport interface OpenAPIParameter {\n name: string;\n in: \"query\" | \"path\" | \"header\";\n description?: string;\n required?: boolean;\n schema?: OpenAPISchema;\n /** Hint text shown inside the empty input. Distinct from `description`,\n * which is help text and must NOT be used as a placeholder. */\n placeholder?: string;\n \"x-clicky\"?: ClickyParameterMeta;\n \"x-clicky-lookup\"?: ClickyParameterLookup;\n /** Vendor-extension placeholder, set server-side by clicky's converter.\n * Takes precedence over `placeholder` when both are present. */\n \"x-clicky-placeholder\"?: string;\n}\n\n/** Resolves the input placeholder for a parameter, drawing ONLY from explicit\n * placeholder fields — never from `description` (help text). Returns undefined\n * when no placeholder is declared so callers can apply their own fallback. */\nexport function parameterPlaceholder(\n param: OpenAPIParameter,\n): string | undefined {\n return param[\"x-clicky-placeholder\"] ?? param.placeholder;\n}\n\nexport interface OpenAPIOperation {\n tags?: string[];\n summary?: string;\n description?: string;\n operationId?: string;\n parameters?: OpenAPIParameter[];\n requestBody?: {\n content?: Record<string, { schema?: OpenAPISchema }>;\n };\n // Optional because nothing here reads it, and a server may serve this catalog\n // with the response schemas reduced to a stub — they are over half the bytes\n // of a spec whose only job here is to describe what can be called.\n responses?: Record<string, unknown>;\n \"x-clicky\"?: ClickyOperationMeta;\n}\n\nexport interface OpenAPISpec {\n openapi: string;\n info: { title: string; description?: string; version: string };\n paths: Record<string, Record<string, OpenAPIOperation>>;\n tags?: Array<{ name: string; description?: string }>;\n components?: {\n \"x-clicky-filters\"?: Record<string, ClickyFilterShape>;\n };\n \"x-clicky\"?: ClickySpecMeta;\n}\n\nexport interface ResolvedOperation {\n path: string;\n method: string;\n operation: OpenAPIOperation;\n}\n\nexport interface DomainDefinition {\n key: string;\n title: string;\n description: string;\n icon?: string;\n emptyTitle?: string;\n emptyDescription?: string;\n}\n\nexport interface ClickySpecMeta {\n surfaces?: ClickySurface[];\n}\n\nexport interface ClickySurface {\n key: string;\n entity: string;\n title: string;\n parent?: string;\n admin?: boolean;\n description?: string;\n /** Opaque icon name emitted by the backend (x-clicky-icon), resolved to a glyph in the UI. */\n icon?: string;\n /**\n * Hierarchy position within `parent`, \"/\"-separated (x-clicky-path) — e.g.\n * \"jms/incoming/disbursements\". The backend has already applied whatever\n * delimiter its own naming convention uses, so the UI never guesses one.\n * Absent — the default — means the parent group renders as a flat list.\n */\n path?: string;\n}\n\nexport interface ClickyOperationMeta {\n command?: string;\n surface?: string;\n verb: \"list\" | \"get\" | \"create\" | \"update\" | \"delete\" | \"action\";\n scope: \"collection\" | \"entity\";\n actionName?: string;\n idParam?: string;\n supportsLookup?: boolean;\n supportsFilterMode?: boolean;\n group?: string;\n toolHints?: ClickyToolHints;\n export?: ClickyExportMeta;\n}\n\nexport interface ClickyExportMeta {\n formats?: string[];\n scopes?: Array<\"page\" | \"all\">;\n allRowsMode?: \"streaming\" | \"buffered\";\n formatMaxRows?: Record<string, number>;\n}\n\nexport interface ClickyToolHints {\n title?: string;\n readOnlyHint?: boolean;\n destructiveHint?: boolean;\n idempotentHint?: boolean;\n openWorldHint?: boolean;\n icon?: string;\n group?: string;\n parent?: string;\n /** Captain's tool vocabulary. The legacy `on`/`off` spellings are still\n * accepted on decode and mean `allow`/`deny`. */\n defaultPermission?: \"allow\" | \"ask\" | \"deny\" | \"auto\" | \"on\" | \"off\";\n strict?: boolean;\n}\n\nexport type OperationLookupFilterType =\n | \"bool\"\n | \"number\"\n | \"date\"\n /** Both edges of a range under one parameter, as \">=from,<=to\". */\n | \"date-range\"\n /** A \"date-range\" with the clock taken off it: whole days, same grammar. */\n | \"day-range\"\n /**\n * A numeric range over elapsed time. Same grammar as \"number\"; the operands\n * are the column's own unit, which `unit` names.\n */\n | \"duration\"\n | \"from\"\n | \"to\"\n | \"multi-filter\"\n /** A Kubernetes workload selected inside a profile's target scope. */\n | \"workload\"\n /** Kubernetes label values, grouped by key when options are key=value pairs. */\n | \"labels\"\n /**\n * An exact-value selection with nothing to enumerate — a UUID column, say.\n * Same wire grammar as \"multi-filter\"; typed rather than picked, because a\n * dropdown over identifiers is a page of the rows.\n */\n | \"value\";\n\nexport interface OperationLookupFilter {\n label?: string;\n options?: Record<string, ClickyNode>;\n selected?: Record<string, ClickyNode>;\n multi?: boolean;\n type?: OperationLookupFilterType;\n /** True when `options` is only the head of a larger set (server-side capped). */\n truncated?: boolean;\n /** True distinct count behind a truncated option set; drives \"… and N more\". */\n total?: number;\n presets?: Array<\n { label: string; from: string; to: string } | TimeRangePresetGroup\n >;\n timeEnabled?: boolean;\n timeZone?: string;\n timeZones?: string[];\n /** The unit a \"duration\" filter's operands are written in (\"ms\" or \"s\"), so\n * the control labels itself in the numbers the column is stored in. Absent\n * means milliseconds. */\n unit?: string;\n}\n\nexport interface OperationLookupResponse {\n filters: Record<string, OperationLookupFilter>;\n}\n\nexport function isPositionalParam(p: OpenAPIParameter): boolean {\n return (\n p.name === \"args\" ||\n p.description?.toLowerCase().includes(\"positional argument\") === true\n );\n}\n"],"names":[],"mappings":"AA+IO,SAAS,qBACd,OACoB;AACpB,SAAO,MAAM,sBAAsB,KAAK,MAAM;AAChD;AA2JO,SAAS,kBAAkB,GAA8B;AA/JzD;AAgKL,SACE,EAAE,SAAS,YACX,OAAE,gBAAF,mBAAe,cAAc,SAAS,4BAA2B;AAErE;"}