@flanksource/clicky-ui 0.3.72 → 0.3.74

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 (355) hide show
  1. package/dist/ai.cjs +5 -0
  2. package/dist/ai.js +3 -1
  3. package/dist/comment-anchoring.cjs +3 -0
  4. package/dist/comment-anchoring.js +2 -1
  5. package/dist/comments/CommentCapture.cjs +6 -8
  6. package/dist/comments/CommentCapture.cjs.map +1 -1
  7. package/dist/comments/CommentCapture.d.ts.map +1 -1
  8. package/dist/comments/CommentCapture.js +6 -8
  9. package/dist/comments/CommentCapture.js.map +1 -1
  10. package/dist/comments/CommentComposer.cjs +12 -8
  11. package/dist/comments/CommentComposer.cjs.map +1 -1
  12. package/dist/comments/CommentComposer.d.ts.map +1 -1
  13. package/dist/comments/CommentComposer.js +12 -8
  14. package/dist/comments/CommentComposer.js.map +1 -1
  15. package/dist/comments/CommentThread.cjs +2 -1
  16. package/dist/comments/CommentThread.cjs.map +1 -1
  17. package/dist/comments/CommentThread.d.ts +1 -1
  18. package/dist/comments/CommentThread.d.ts.map +1 -1
  19. package/dist/comments/CommentThread.js +2 -1
  20. package/dist/comments/CommentThread.js.map +1 -1
  21. package/dist/comments/CommentThreadList.cjs +5 -3
  22. package/dist/comments/CommentThreadList.cjs.map +1 -1
  23. package/dist/comments/CommentThreadList.d.ts +1 -1
  24. package/dist/comments/CommentThreadList.d.ts.map +1 -1
  25. package/dist/comments/CommentThreadList.js +5 -3
  26. package/dist/comments/CommentThreadList.js.map +1 -1
  27. package/dist/comments/anchoring/dom-anchor.cjs +32 -4
  28. package/dist/comments/anchoring/dom-anchor.cjs.map +1 -1
  29. package/dist/comments/anchoring/dom-anchor.d.ts +8 -4
  30. package/dist/comments/anchoring/dom-anchor.d.ts.map +1 -1
  31. package/dist/comments/anchoring/dom-anchor.js +31 -5
  32. package/dist/comments/anchoring/dom-anchor.js.map +1 -1
  33. package/dist/comments/anchoring/frame-anchor.cjs +74 -0
  34. package/dist/comments/anchoring/frame-anchor.cjs.map +1 -0
  35. package/dist/comments/anchoring/frame-anchor.d.ts +21 -0
  36. package/dist/comments/anchoring/frame-anchor.d.ts.map +1 -0
  37. package/dist/comments/anchoring/frame-anchor.js +70 -0
  38. package/dist/comments/anchoring/frame-anchor.js.map +1 -0
  39. package/dist/comments/comment-detail.d.ts +1 -0
  40. package/dist/comments/comment-detail.d.ts.map +1 -1
  41. package/dist/comments/comment-types.cjs.map +1 -1
  42. package/dist/comments/comment-types.d.ts +2 -0
  43. package/dist/comments/comment-types.d.ts.map +1 -1
  44. package/dist/comments/comment-types.js.map +1 -1
  45. package/dist/comments/gavel/CommentInbox.cjs +49 -59
  46. package/dist/comments/gavel/CommentInbox.cjs.map +1 -1
  47. package/dist/comments/gavel/CommentInbox.d.ts +12 -8
  48. package/dist/comments/gavel/CommentInbox.d.ts.map +1 -1
  49. package/dist/comments/gavel/CommentInbox.js +51 -61
  50. package/dist/comments/gavel/CommentInbox.js.map +1 -1
  51. package/dist/comments/gavel/CommentInboxThread.cjs.map +1 -1
  52. package/dist/comments/gavel/CommentInboxThread.d.ts +1 -3
  53. package/dist/comments/gavel/CommentInboxThread.d.ts.map +1 -1
  54. package/dist/comments/gavel/CommentInboxThread.js.map +1 -1
  55. package/dist/comments/gavel/comment-agent-assignment.cjs +41 -0
  56. package/dist/comments/gavel/comment-agent-assignment.cjs.map +1 -0
  57. package/dist/comments/gavel/comment-agent-assignment.d.ts +15 -0
  58. package/dist/comments/gavel/comment-agent-assignment.d.ts.map +1 -0
  59. package/dist/comments/gavel/comment-agent-assignment.js +39 -0
  60. package/dist/comments/gavel/comment-agent-assignment.js.map +1 -0
  61. package/dist/comments/gavel/gavel-projection.cjs +43 -13
  62. package/dist/comments/gavel/gavel-projection.cjs.map +1 -1
  63. package/dist/comments/gavel/gavel-projection.d.ts +3 -0
  64. package/dist/comments/gavel/gavel-projection.d.ts.map +1 -1
  65. package/dist/comments/gavel/gavel-projection.js +43 -14
  66. package/dist/comments/gavel/gavel-projection.js.map +1 -1
  67. package/dist/comments/gavel/inbox-model.cjs +3 -12
  68. package/dist/comments/gavel/inbox-model.cjs.map +1 -1
  69. package/dist/comments/gavel/inbox-model.d.ts +2 -2
  70. package/dist/comments/gavel/inbox-model.d.ts.map +1 -1
  71. package/dist/comments/gavel/inbox-model.js +4 -12
  72. package/dist/comments/gavel/inbox-model.js.map +1 -1
  73. package/dist/comments/gavel/inbox-prompt.cjs +1 -0
  74. package/dist/comments/gavel/inbox-prompt.cjs.map +1 -1
  75. package/dist/comments/gavel/inbox-prompt.d.ts.map +1 -1
  76. package/dist/comments/gavel/inbox-prompt.js +1 -0
  77. package/dist/comments/gavel/inbox-prompt.js.map +1 -1
  78. package/dist/comments/gavel/index.d.ts +1 -0
  79. package/dist/comments/gavel/index.d.ts.map +1 -1
  80. package/dist/comments-gavel.cjs +5 -1
  81. package/dist/comments-gavel.js +4 -3
  82. package/dist/comments.cjs +5 -0
  83. package/dist/comments.d.ts +1 -0
  84. package/dist/comments.d.ts.map +1 -1
  85. package/dist/comments.js +3 -1
  86. package/dist/components/AccordionList.cjs +2 -2
  87. package/dist/components/AccordionList.cjs.map +1 -1
  88. package/dist/components/AccordionList.js +2 -2
  89. package/dist/components/AccordionList.js.map +1 -1
  90. package/dist/components/examples/form-extensions/extension.d.ts +1 -1
  91. package/dist/components/examples/form-extensions/extension.d.ts.map +1 -1
  92. package/dist/components/json-schema-form-array-add-menu.cjs +44 -0
  93. package/dist/components/json-schema-form-array-add-menu.cjs.map +1 -0
  94. package/dist/components/json-schema-form-array-add-menu.d.ts +10 -0
  95. package/dist/components/json-schema-form-array-add-menu.d.ts.map +1 -0
  96. package/dist/components/json-schema-form-array-add-menu.js +44 -0
  97. package/dist/components/json-schema-form-array-add-menu.js.map +1 -0
  98. package/dist/components/json-schema-form-exclusive-key-select.cjs +28 -0
  99. package/dist/components/json-schema-form-exclusive-key-select.cjs.map +1 -0
  100. package/dist/components/json-schema-form-exclusive-key-select.d.ts +12 -0
  101. package/dist/components/json-schema-form-exclusive-key-select.d.ts.map +1 -0
  102. package/dist/components/json-schema-form-exclusive-key-select.js +28 -0
  103. package/dist/components/json-schema-form-exclusive-key-select.js.map +1 -0
  104. package/dist/components/json-schema-form-exclusive-keys.cjs +23 -0
  105. package/dist/components/json-schema-form-exclusive-keys.cjs.map +1 -0
  106. package/dist/components/json-schema-form-exclusive-keys.d.ts +8 -0
  107. package/dist/components/json-schema-form-exclusive-keys.d.ts.map +1 -0
  108. package/dist/components/json-schema-form-exclusive-keys.js +22 -0
  109. package/dist/components/json-schema-form-exclusive-keys.js.map +1 -0
  110. package/dist/components/json-schema-form-layout.cjs +18 -5
  111. package/dist/components/json-schema-form-layout.cjs.map +1 -1
  112. package/dist/components/json-schema-form-layout.d.ts +3 -1
  113. package/dist/components/json-schema-form-layout.d.ts.map +1 -1
  114. package/dist/components/json-schema-form-layout.js +19 -6
  115. package/dist/components/json-schema-form-layout.js.map +1 -1
  116. package/dist/components/json-schema-form-object-array-view.cjs +13 -7
  117. package/dist/components/json-schema-form-object-array-view.cjs.map +1 -1
  118. package/dist/components/json-schema-form-object-array-view.d.ts.map +1 -1
  119. package/dist/components/json-schema-form-object-array-view.js +13 -7
  120. package/dist/components/json-schema-form-object-array-view.js.map +1 -1
  121. package/dist/components/json-schema-form-object.cjs +6 -0
  122. package/dist/components/json-schema-form-object.cjs.map +1 -1
  123. package/dist/components/json-schema-form-object.d.ts.map +1 -1
  124. package/dist/components/json-schema-form-object.js +6 -0
  125. package/dist/components/json-schema-form-object.js.map +1 -1
  126. package/dist/components/json-schema-form-render.cjs +56 -35
  127. package/dist/components/json-schema-form-render.cjs.map +1 -1
  128. package/dist/components/json-schema-form-render.d.ts +1 -0
  129. package/dist/components/json-schema-form-render.d.ts.map +1 -1
  130. package/dist/components/json-schema-form-render.js +56 -35
  131. package/dist/components/json-schema-form-render.js.map +1 -1
  132. package/dist/components/json-schema-form-resolve.cjs +1 -0
  133. package/dist/components/json-schema-form-resolve.cjs.map +1 -1
  134. package/dist/components/json-schema-form-resolve.d.ts +2 -1
  135. package/dist/components/json-schema-form-resolve.d.ts.map +1 -1
  136. package/dist/components/json-schema-form-resolve.js +1 -1
  137. package/dist/components/json-schema-form-resolve.js.map +1 -1
  138. package/dist/components/json-schema-form-runtime-types.d.ts +8 -0
  139. package/dist/components/json-schema-form-runtime-types.d.ts.map +1 -1
  140. package/dist/components/json-schema-form-section-actions.cjs +12 -0
  141. package/dist/components/json-schema-form-section-actions.cjs.map +1 -0
  142. package/dist/components/json-schema-form-section-actions.d.ts +8 -0
  143. package/dist/components/json-schema-form-section-actions.d.ts.map +1 -0
  144. package/dist/components/json-schema-form-section-actions.js +11 -0
  145. package/dist/components/json-schema-form-section-actions.js.map +1 -0
  146. package/dist/components/json-schema-form-sibling-prefix.cjs +23 -0
  147. package/dist/components/json-schema-form-sibling-prefix.cjs.map +1 -0
  148. package/dist/components/json-schema-form-sibling-prefix.d.ts +9 -0
  149. package/dist/components/json-schema-form-sibling-prefix.d.ts.map +1 -0
  150. package/dist/components/json-schema-form-sibling-prefix.js +23 -0
  151. package/dist/components/json-schema-form-sibling-prefix.js.map +1 -0
  152. package/dist/components/json-schema-form-sibling-select.cjs +25 -0
  153. package/dist/components/json-schema-form-sibling-select.cjs.map +1 -0
  154. package/dist/components/json-schema-form-sibling-select.d.ts +9 -0
  155. package/dist/components/json-schema-form-sibling-select.d.ts.map +1 -0
  156. package/dist/components/json-schema-form-sibling-select.js +25 -0
  157. package/dist/components/json-schema-form-sibling-select.js.map +1 -0
  158. package/dist/components/json-schema-form-table-array.cjs +4 -3
  159. package/dist/components/json-schema-form-table-array.cjs.map +1 -1
  160. package/dist/components/json-schema-form-table-array.js +4 -3
  161. package/dist/components/json-schema-form-table-array.js.map +1 -1
  162. package/dist/components/json-schema-form-tags-combobox.cjs +54 -24
  163. package/dist/components/json-schema-form-tags-combobox.cjs.map +1 -1
  164. package/dist/components/json-schema-form-tags-combobox.d.ts.map +1 -1
  165. package/dist/components/json-schema-form-tags-combobox.js +55 -25
  166. package/dist/components/json-schema-form-tags-combobox.js.map +1 -1
  167. package/dist/components.cjs +2 -0
  168. package/dist/components.d.ts +2 -1
  169. package/dist/components.d.ts.map +1 -1
  170. package/dist/components.js +2 -1
  171. package/dist/data/LogViewer.cjs +90 -19
  172. package/dist/data/LogViewer.cjs.map +1 -1
  173. package/dist/data/LogViewer.d.ts +9 -5
  174. package/dist/data/LogViewer.d.ts.map +1 -1
  175. package/dist/data/LogViewer.js +91 -20
  176. package/dist/data/LogViewer.js.map +1 -1
  177. package/dist/data/TaskProgress.cjs +5 -5
  178. package/dist/data/TaskProgress.cjs.map +1 -1
  179. package/dist/data/TaskProgress.js +5 -5
  180. package/dist/data/TaskProgress.js.map +1 -1
  181. package/dist/data/ai/SessionChatComposer.cjs +44 -22
  182. package/dist/data/ai/SessionChatComposer.cjs.map +1 -1
  183. package/dist/data/ai/SessionChatComposer.d.ts.map +1 -1
  184. package/dist/data/ai/SessionChatComposer.js +44 -22
  185. package/dist/data/ai/SessionChatComposer.js.map +1 -1
  186. package/dist/data/ai/SessionInspector.cjs +1 -1
  187. package/dist/data/ai/SessionInspector.cjs.map +1 -1
  188. package/dist/data/ai/SessionInspector.d.ts.map +1 -1
  189. package/dist/data/ai/SessionInspector.host-tabs.cjs +12 -0
  190. package/dist/data/ai/SessionInspector.host-tabs.cjs.map +1 -1
  191. package/dist/data/ai/SessionInspector.host-tabs.d.ts +4 -1
  192. package/dist/data/ai/SessionInspector.host-tabs.d.ts.map +1 -1
  193. package/dist/data/ai/SessionInspector.host-tabs.js +12 -1
  194. package/dist/data/ai/SessionInspector.host-tabs.js.map +1 -1
  195. package/dist/data/ai/SessionInspector.js +2 -2
  196. package/dist/data/ai/SessionInspector.js.map +1 -1
  197. package/dist/data/ai/SessionInspector.legacy.cjs +1 -1
  198. package/dist/data/ai/SessionInspector.legacy.cjs.map +1 -1
  199. package/dist/data/ai/SessionInspector.legacy.d.ts.map +1 -1
  200. package/dist/data/ai/SessionInspector.legacy.js +2 -2
  201. package/dist/data/ai/SessionInspector.legacy.js.map +1 -1
  202. package/dist/data/ai/SessionInspector.transcript.cjs +5 -19
  203. package/dist/data/ai/SessionInspector.transcript.cjs.map +1 -1
  204. package/dist/data/ai/SessionInspector.transcript.d.ts.map +1 -1
  205. package/dist/data/ai/SessionInspector.transcript.js +6 -20
  206. package/dist/data/ai/SessionInspector.transcript.js.map +1 -1
  207. package/dist/data/ai/SessionPicker.cjs +159 -0
  208. package/dist/data/ai/SessionPicker.cjs.map +1 -0
  209. package/dist/data/ai/SessionPicker.d.ts +39 -0
  210. package/dist/data/ai/SessionPicker.d.ts.map +1 -0
  211. package/dist/data/ai/SessionPicker.js +159 -0
  212. package/dist/data/ai/SessionPicker.js.map +1 -0
  213. package/dist/data/ai/SessionPicker.model.cjs +21 -0
  214. package/dist/data/ai/SessionPicker.model.cjs.map +1 -0
  215. package/dist/data/ai/SessionPicker.model.d.ts +26 -0
  216. package/dist/data/ai/SessionPicker.model.d.ts.map +1 -0
  217. package/dist/data/ai/SessionPicker.model.js +20 -0
  218. package/dist/data/ai/SessionPicker.model.js.map +1 -0
  219. package/dist/data/ai/SessionTail.cjs +25 -15
  220. package/dist/data/ai/SessionTail.cjs.map +1 -1
  221. package/dist/data/ai/SessionTail.d.ts.map +1 -1
  222. package/dist/data/ai/SessionTail.js +25 -15
  223. package/dist/data/ai/SessionTail.js.map +1 -1
  224. package/dist/data/ai/SessionViewer.input.cjs +59 -1
  225. package/dist/data/ai/SessionViewer.input.cjs.map +1 -1
  226. package/dist/data/ai/SessionViewer.input.d.ts +22 -0
  227. package/dist/data/ai/SessionViewer.input.d.ts.map +1 -1
  228. package/dist/data/ai/SessionViewer.input.js +58 -2
  229. package/dist/data/ai/SessionViewer.input.js.map +1 -1
  230. package/dist/data/ai/SessionViewer.rows.cjs +10 -3
  231. package/dist/data/ai/SessionViewer.rows.cjs.map +1 -1
  232. package/dist/data/ai/SessionViewer.rows.d.ts.map +1 -1
  233. package/dist/data/ai/SessionViewer.rows.js +11 -4
  234. package/dist/data/ai/SessionViewer.rows.js.map +1 -1
  235. package/dist/data/ai/SessionViewer.tool-details.cjs +35 -0
  236. package/dist/data/ai/SessionViewer.tool-details.cjs.map +1 -1
  237. package/dist/data/ai/SessionViewer.tool-details.d.ts +10 -1
  238. package/dist/data/ai/SessionViewer.tool-details.d.ts.map +1 -1
  239. package/dist/data/ai/SessionViewer.tool-details.js +35 -1
  240. package/dist/data/ai/SessionViewer.tool-details.js.map +1 -1
  241. package/dist/data/ai/SessionViewer.tool-row.cjs +5 -1
  242. package/dist/data/ai/SessionViewer.tool-row.cjs.map +1 -1
  243. package/dist/data/ai/SessionViewer.tool-row.d.ts.map +1 -1
  244. package/dist/data/ai/SessionViewer.tool-row.js +7 -3
  245. package/dist/data/ai/SessionViewer.tool-row.js.map +1 -1
  246. package/dist/data/ai/index.d.ts +2 -0
  247. package/dist/data/ai/index.d.ts.map +1 -1
  248. package/dist/data/code-diff.cjs +51 -45
  249. package/dist/data/code-diff.cjs.map +1 -1
  250. package/dist/data/code-diff.d.ts.map +1 -1
  251. package/dist/data/code-diff.js +51 -45
  252. package/dist/data/code-diff.js.map +1 -1
  253. package/dist/data/git/GitChangeList.cjs +40 -7
  254. package/dist/data/git/GitChangeList.cjs.map +1 -1
  255. package/dist/data/git/GitChangeList.d.ts +3 -0
  256. package/dist/data/git/GitChangeList.d.ts.map +1 -1
  257. package/dist/data/git/GitChangeList.js +40 -7
  258. package/dist/data/git/GitChangeList.js.map +1 -1
  259. package/dist/data/git/pickers/GitFilePicker.cjs +19 -7
  260. package/dist/data/git/pickers/GitFilePicker.cjs.map +1 -1
  261. package/dist/data/git/pickers/GitFilePicker.d.ts +4 -2
  262. package/dist/data/git/pickers/GitFilePicker.d.ts.map +1 -1
  263. package/dist/data/git/pickers/GitFilePicker.js +19 -7
  264. package/dist/data/git/pickers/GitFilePicker.js.map +1 -1
  265. package/dist/data/git/pickers/GitPickers.cjs +3 -3
  266. package/dist/data/git/pickers/GitPickers.cjs.map +1 -1
  267. package/dist/data/git/pickers/GitPickers.js +3 -3
  268. package/dist/data/git/pickers/GitPickers.js.map +1 -1
  269. package/dist/data/git/pickers/GitPickersDemo.d.ts.map +1 -1
  270. package/dist/data/git/pickers/GitSourcePicker.cjs +11 -4
  271. package/dist/data/git/pickers/GitSourcePicker.cjs.map +1 -1
  272. package/dist/data/git/pickers/GitSourcePicker.d.ts +4 -2
  273. package/dist/data/git/pickers/GitSourcePicker.d.ts.map +1 -1
  274. package/dist/data/git/pickers/GitSourcePicker.js +11 -4
  275. package/dist/data/git/pickers/GitSourcePicker.js.map +1 -1
  276. package/dist/data/git/pickers/ReferencePicker.cjs +27 -3
  277. package/dist/data/git/pickers/ReferencePicker.cjs.map +1 -1
  278. package/dist/data/git/pickers/ReferencePicker.d.ts.map +1 -1
  279. package/dist/data/git/pickers/ReferencePicker.js +27 -3
  280. package/dist/data/git/pickers/ReferencePicker.js.map +1 -1
  281. package/dist/data/git/pickers/RepositoryCatalogPicker.cjs +2 -1
  282. package/dist/data/git/pickers/RepositoryCatalogPicker.cjs.map +1 -1
  283. package/dist/data/git/pickers/RepositoryCatalogPicker.d.ts +3 -2
  284. package/dist/data/git/pickers/RepositoryCatalogPicker.d.ts.map +1 -1
  285. package/dist/data/git/pickers/RepositoryCatalogPicker.js +2 -1
  286. package/dist/data/git/pickers/RepositoryCatalogPicker.js.map +1 -1
  287. package/dist/data/git/pickers/types.d.ts +7 -0
  288. package/dist/data/git/pickers/types.d.ts.map +1 -1
  289. package/dist/data/lint/LintList.cjs +89 -89
  290. package/dist/data/lint/LintList.cjs.map +1 -1
  291. package/dist/data/lint/LintList.d.ts +3 -2
  292. package/dist/data/lint/LintList.d.ts.map +1 -1
  293. package/dist/data/lint/LintList.js +90 -90
  294. package/dist/data/lint/LintList.js.map +1 -1
  295. package/dist/data/log-sections.cjs +152 -21
  296. package/dist/data/log-sections.cjs.map +1 -1
  297. package/dist/data/log-sections.d.ts +31 -6
  298. package/dist/data/log-sections.d.ts.map +1 -1
  299. package/dist/data/log-sections.js +151 -22
  300. package/dist/data/log-sections.js.map +1 -1
  301. package/dist/data/test-runner/TestDetailPanel.cjs +1 -1
  302. package/dist/data/test-runner/TestDetailPanel.cjs.map +1 -1
  303. package/dist/data/test-runner/TestDetailPanel.js +1 -1
  304. package/dist/data/test-runner/TestDetailPanel.js.map +1 -1
  305. package/dist/data/test-runner/TestFailureDetail.cjs +10 -8
  306. package/dist/data/test-runner/TestFailureDetail.cjs.map +1 -1
  307. package/dist/data/test-runner/TestFailureDetail.d.ts +3 -2
  308. package/dist/data/test-runner/TestFailureDetail.d.ts.map +1 -1
  309. package/dist/data/test-runner/TestFailureDetail.js +10 -8
  310. package/dist/data/test-runner/TestFailureDetail.js.map +1 -1
  311. package/dist/data/test-runner/TestTreeNode.cjs +9 -4
  312. package/dist/data/test-runner/TestTreeNode.cjs.map +1 -1
  313. package/dist/data/test-runner/TestTreeNode.d.ts.map +1 -1
  314. package/dist/data/test-runner/TestTreeNode.js +9 -4
  315. package/dist/data/test-runner/TestTreeNode.js.map +1 -1
  316. package/dist/data/test-runner/attempts.cjs +2 -1
  317. package/dist/data/test-runner/attempts.cjs.map +1 -1
  318. package/dist/data/test-runner/attempts.d.ts.map +1 -1
  319. package/dist/data/test-runner/attempts.js +2 -1
  320. package/dist/data/test-runner/attempts.js.map +1 -1
  321. package/dist/data/test-runner/copy.cjs +1 -2
  322. package/dist/data/test-runner/copy.cjs.map +1 -1
  323. package/dist/data/test-runner/copy.d.ts.map +1 -1
  324. package/dist/data/test-runner/copy.js +1 -2
  325. package/dist/data/test-runner/copy.js.map +1 -1
  326. package/dist/data/test-runner/types.d.ts +3 -0
  327. package/dist/data/test-runner/types.d.ts.map +1 -1
  328. package/dist/data/traces/GoProfileView.cjs +10 -7
  329. package/dist/data/traces/GoProfileView.cjs.map +1 -1
  330. package/dist/data/traces/GoProfileView.d.ts.map +1 -1
  331. package/dist/data/traces/GoProfileView.js +10 -7
  332. package/dist/data/traces/GoProfileView.js.map +1 -1
  333. package/dist/data/verification/adapters.cjs +1 -0
  334. package/dist/data/verification/adapters.cjs.map +1 -1
  335. package/dist/data/verification/adapters.d.ts.map +1 -1
  336. package/dist/data/verification/adapters.js +1 -0
  337. package/dist/data/verification/adapters.js.map +1 -1
  338. package/dist/data/version-info.cjs +3 -3
  339. package/dist/data/version-info.js +3 -3
  340. package/dist/data.cjs +2 -2
  341. package/dist/data.d.ts +1 -1
  342. package/dist/data.d.ts.map +1 -1
  343. package/dist/data.js +2 -2
  344. package/dist/index.cjs +8 -1
  345. package/dist/index.js +5 -2
  346. package/dist/runtime/barrels.json +6604 -6582
  347. package/dist/runtime/importmap.json +2129 -2120
  348. package/dist/styles.css +1 -1
  349. package/package.json +1 -1
  350. package/dist/comments/gavel/CommentInboxReview.cjs +0 -169
  351. package/dist/comments/gavel/CommentInboxReview.cjs.map +0 -1
  352. package/dist/comments/gavel/CommentInboxReview.d.ts +0 -20
  353. package/dist/comments/gavel/CommentInboxReview.d.ts.map +0 -1
  354. package/dist/comments/gavel/CommentInboxReview.js +0 -169
  355. package/dist/comments/gavel/CommentInboxReview.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CommentInbox.js","names":[],"sources":["../../../src/comments/gavel/CommentInbox.tsx"],"sourcesContent":["import { useMemo, useRef, useState, type ReactNode } from \"react\";\nimport { Button } from \"../../components/button\";\nimport type { FilterBarFilter } from \"../../components/FilterBar\";\nimport { Badge } from \"../../data/Badge\";\nimport { formatRelativeTime } from \"../../data/cells/timestamp-format\";\nimport { DataTable, type DataTableColumn } from \"../../data/DataTable\";\nimport { Icon } from \"../../data/Icon\";\nimport { UiFile, UiGlobe, UiImage } from \"../../icons\";\nimport { toneToBadgeTone } from \"../comment-utils\";\nimport { DriftBadge } from \"../DriftList\";\nimport { DEFAULT_COMMENT_STATUSES, type CommentConfig } from \"../comment-types\";\nimport { CommentInboxCopy } from \"./CommentInboxCopy\";\nimport { CommentInboxReview } from \"./CommentInboxReview\";\nimport { CommentInboxThread, type CommentInboxActions } from \"./CommentInboxThread\";\nimport {\n inboxAuthorOptions,\n filterInbox,\n groupInbox,\n inboxItems,\n INBOX_KIND_OPTIONS,\n INBOX_PHASE_OPTIONS,\n inboxProjectOptions,\n resolvedReviewQueue,\n INBOX_STATUS_OPTIONS,\n type InboxFilters,\n type InboxItem,\n type InboxListing,\n type InboxTargetKind,\n} from \"./inbox-model\";\n\nexport type CommentInboxProps = {\n /** One listing per scope, as gavel's comments API returns them. `undefined` while the first load is pending. */\n listings: readonly InboxListing[] | undefined;\n /** A failed load or refresh; shown beside the filters and, once there are rows, beside them. */\n error?: string | null | undefined;\n /** Controlled filters, so a host can keep them in the URL. */\n filters: InboxFilters;\n onFiltersChange: (filters: InboxFilters) => void;\n /** Receives the thread with its resolved anchor, for the host to open the file at its line, the page or the image. */\n onOpen: (item: InboxItem) => void;\n /** Where gavel is served; copy-as-prompt points the agent's API calls here. */\n baseUrl: string;\n /** Handlers for acting on a thread. A capability a host does not pass is not offered. */\n actions?: CommentInboxActions;\n /** Statuses and assignees for the thread cards. Defaults to open, in progress, resolved and closed. */\n config?: CommentConfig;\n className?: string;\n};\n\nconst DEFAULT_CONFIG: CommentConfig = { statuses: DEFAULT_COMMENT_STATUSES };\nconst KIND_ICON = { file: UiFile, page: UiGlobe, image: UiImage } as const;\nconst KIND_LABEL: Record<InboxTargetKind, string> = { file: \"file\", page: \"page\", image: \"image\" };\n\nconst placeOf = (item: InboxItem) => (item.line === undefined ? item.label : `${item.label}:${item.line}`);\n\nfunction filterControls(filters: InboxFilters, set: (patch: Partial<InboxFilters>) => void, items: readonly InboxItem[], listings: readonly InboxListing[]): FilterBarFilter[] {\n const choice = (key: \"status\" | \"phase\" | \"author\" | \"project\" | \"kind\", label: string, options: { value: string; label: string }[]): FilterBarFilter => ({\n key,\n kind: \"enum\",\n label,\n value: filters[key],\n options,\n onChange: (value) => set({ [key]: value }),\n });\n return [\n choice(\"status\", \"Status\", INBOX_STATUS_OPTIONS),\n choice(\"phase\", \"Phase\", INBOX_PHASE_OPTIONS),\n choice(\"author\", \"Author\", inboxAuthorOptions(items)),\n choice(\"project\", \"Project\", inboxProjectOptions(listings)),\n choice(\"kind\", \"Target\", INBOX_KIND_OPTIONS),\n { key: \"unread\", kind: \"boolean\", label: \"Unread only\", value: filters.unread, onChange: (unread) => set({ unread }) },\n ];\n}\n\nfunction ThreadCell({ item }: { item: InboxItem }) {\n const replies = item.thread.messages?.length ?? 0;\n return (\n <div className=\"flex min-w-0 items-center gap-1.5\">\n {item.thread.unread && (\n <Badge tone=\"info\" variant=\"soft\" size=\"xs\" clickToCopy={false}>\n Unread\n </Badge>\n )}\n <span className=\"line-clamp-2 min-w-0\">{item.thread.bodyMarkdown}</span>\n {replies > 0 && <span className=\"shrink-0 text-xs text-muted-foreground\">{replies === 1 ? \"1 reply\" : `${replies} replies`}</span>}\n </div>\n );\n}\n\nfunction TargetCell({ item, onOpen }: { item: InboxItem; onOpen: (item: InboxItem) => void }) {\n const drift = item.anchor && item.anchor.state !== \"matched\" ? item.anchor.state : undefined;\n return (\n <div className=\"flex min-w-0 items-center gap-1.5\">\n <Icon icon={KIND_ICON[item.kind]} className=\"shrink-0 text-muted-foreground\" />\n <button\n type=\"button\"\n className=\"truncate font-mono text-xs text-primary hover:underline\"\n aria-label={`Open ${placeOf(item)}`}\n title={`Open ${placeOf(item)}`}\n onClick={(event) => {\n event.stopPropagation();\n onOpen(item);\n }}\n >\n {placeOf(item)}\n </button>\n {drift && <DriftBadge state={drift} />}\n </div>\n );\n}\n\nfunction StatusCell({ status, config }: { status: string; config: CommentConfig }) {\n const configured = config.statuses.find((entry) => entry.value === status);\n return (\n <Badge variant=\"soft\" size=\"xs\" tone={toneToBadgeTone(configured?.tone)} clickToCopy={false}>\n {configured?.label ?? status}\n </Badge>\n );\n}\n\n/**\n * Every comment thread across targets, whatever surface wrote it: files, pages\n * and images, grouped by target and newest first behind controlled filters that\n * stay visible when nothing matches. Copy-as-prompt hands the filtered selection\n * to an LLM, Claude or Codex, and the review queue lets a human close resolved\n * work or reopen it with feedback.\n */\nexport function CommentInbox({ listings, error, filters, onFiltersChange, onOpen, baseUrl, actions = {}, config = DEFAULT_CONFIG, className }: CommentInboxProps) {\n const [reviewing, setReviewing] = useState(false);\n const [reviewId, setReviewId] = useState<string | undefined>();\n const [expanded, setExpanded] = useState<string[]>([]);\n const items = useMemo(() => inboxItems(listings ?? []), [listings]);\n const visible = useMemo(() => groupInbox(filterInbox(items, filters)).flatMap((group) => group.items), [items, filters]);\n const queue = useMemo(() => resolvedReviewQueue(filterInbox(items, { ...filters, status: \"resolved\" })), [items, filters]);\n const unresolved = items.filter((item) => config.statuses.some((status) => status.value === item.thread.status && status.unresolved)).length;\n // FilterBar's \"Clear all\" clears each filter in turn within one event, so patches merge onto the latest filters.\n const latest = useRef(filters);\n latest.current = filters;\n const set = (patch: Partial<InboxFilters>) => {\n latest.current = { ...latest.current, ...patch };\n onFiltersChange(latest.current);\n };\n\n const { onClose, onReopenWithFeedback, onMarkRead } = actions;\n const canReview = onClose !== undefined && onReopenWithFeedback !== undefined;\n const unreadTargets = new Set(items.filter((item) => item.thread.unread).map((item) => `${item.scope}\\n${item.uri}`));\n\n if (reviewing && canReview) {\n return (\n <div className={className} data-testid=\"comment-inbox-review\">\n <CommentInboxReview\n queue={queue}\n selectedId={reviewId}\n config={config}\n actions={{ ...actions, onClose, onReopenWithFeedback }}\n onSelect={setReviewId}\n onOpen={onOpen}\n onExit={() => setReviewing(false)}\n />\n </div>\n );\n }\n\n const columns: DataTableColumn<InboxItem>[] = [\n { key: \"thread\", label: \"Thread\", sortable: false, grow: true, accessor: (item) => item.thread.bodyMarkdown, render: (_value, item) => <ThreadCell item={item} /> },\n { key: \"target\", label: \"Target\", sortable: false, accessor: placeOf, render: (_value, item) => <TargetCell item={item} onOpen={onOpen} /> },\n { key: \"status\", label: \"Status\", sortable: false, accessor: (item) => item.thread.status, render: (value) => <StatusCell status={String(value)} config={config} /> },\n { key: \"phase\", label: \"Phase\", sortable: false, accessor: (item) => item.thread.phase },\n { key: \"author\", label: \"Author\", sortable: false, accessor: (item) => item.thread.author.label ?? item.thread.author.id },\n { key: \"activity\", label: \"Updated\", sortable: false, accessor: (item) => item.activity, render: (value) => formatRelativeTime(new Date(String(value))) },\n ];\n\n const groupMeta = (_key: string, rows: InboxItem[]): ReactNode => {\n const first = rows[0];\n if (!first) return null;\n return (\n <span className=\"flex items-center gap-2\">\n <Badge variant=\"soft\" size=\"xs\" clickToCopy={false}>\n {KIND_LABEL[first.kind]}\n </Badge>\n <span>{first.project}</span>\n {unreadTargets.has(`${first.scope}\\n${first.uri}`) && (\n <Badge tone=\"info\" variant=\"soft\" size=\"xs\" clickToCopy={false}>\n Unread\n </Badge>\n )}\n {unreadTargets.has(`${first.scope}\\n${first.uri}`) && onMarkRead && (\n <Button size=\"sm\" variant=\"ghost\" aria-label={`Mark ${first.label} read`} onClick={() => void onMarkRead({ scope: first.scope, uri: first.uri })}>\n Mark read\n </Button>\n )}\n </span>\n );\n };\n\n const notReady = listings === undefined;\n return (\n <section aria-label=\"Comment inbox\" className={`flex h-full min-h-0 flex-col gap-3 p-density-3 ${className ?? \"\"}`} data-testid=\"comment-inbox\">\n <header className=\"flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between\">\n <div className=\"min-w-0\">\n <h1 className=\"text-lg font-semibold\">Comments</h1>\n <p className=\"text-sm text-muted-foreground\">{notReady ? \"Loading…\" : `${unresolved} unresolved across ${listings.length === 1 ? \"1 project\" : `${listings.length} projects`}`}</p>\n </div>\n <div className=\"flex flex-wrap items-start gap-2 sm:justify-end\">\n {canReview && (\n <Button\n size=\"sm\"\n variant=\"outline\"\n disabled={queue.length === 0}\n onClick={() => {\n setReviewId(queue[0]?.thread.id);\n setReviewing(true);\n }}\n >\n Review resolved ({queue.length})\n </Button>\n )}\n <CommentInboxCopy items={visible} scopes={(listings ?? []).map((listing) => listing.scope)} filters={filters} baseUrl={baseUrl} />\n </div>\n </header>\n {listings && error && (\n <p role=\"alert\" className=\"text-sm text-destructive\">\n Refreshing comments failed: {error}\n </p>\n )}\n <DataTable\n className=\"min-h-0 flex-1\"\n data={visible}\n columns={columns}\n getRowId={(item) => `${item.scope}\\n${item.thread.id}`}\n grouping={{ getGroupKey: (item) => `${item.scope}\\n${item.uri}`, getGroupLabel: (_key, rows) => rows[0]?.label, getGroupMeta: groupMeta }}\n loading={notReady && !error}\n error={notReady && error ? `Comments could not be loaded: ${error}` : undefined}\n emptyMessage={items.length === 0 ? \"No comment threads yet\" : \"No threads match these filters\"}\n manualFilter\n externalSearch={{ value: filters.q, onChange: (q) => set({ q }), placeholder: \"Comment text or path…\", ariaLabel: \"Search comments\" }}\n externalFilters={filterControls(filters, set, items, listings ?? [])}\n expandedRowIds={expanded}\n onExpandedRowIdsChange={setExpanded}\n renderExpandedRow={(item) => <CommentInboxThread item={item} config={config} actions={actions} />}\n />\n </section>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiDA,IAAM,iBAAgC,EAAE,UAAU,yBAAyB;AAC3E,IAAM,YAAY;CAAE,MAAM;CAAQ,MAAM;CAAS,OAAO;AAAQ;AAChE,IAAM,aAA8C;CAAE,MAAM;CAAQ,MAAM;CAAQ,OAAO;AAAQ;AAEjG,IAAM,WAAW,SAAqB,KAAK,SAAS,KAAA,IAAY,KAAK,QAAQ,GAAG,KAAK,MAAM,GAAG,KAAK;AAEnG,SAAS,eAAe,SAAuB,KAA6C,OAA6B,UAAsD;CAC7K,MAAM,UAAU,KAAyD,OAAe,aAAkE;EACxJ;EACA,MAAM;EACN;EACA,OAAO,QAAQ;EACf;EACA,WAAW,UAAU,IAAI,GAAG,MAAM,MAAM,CAAC;CAC3C;CACA,OAAO;EACL,OAAO,UAAU,UAAU,oBAAoB;EAC/C,OAAO,SAAS,SAAS,mBAAmB;EAC5C,OAAO,UAAU,UAAU,mBAAmB,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AD;IAAG,MAAK;IAAQ,WAAU;IAA1B,UAAA,CAAqD,gCACtB,KAC5B;;GAEL,oBAAC,WAAD;IACE,WAAU;IACV,MAAM;IACG;IACT,WAAW,SAAS,GAAG,KAAK,MAAM,IAAI,KAAK,OAAO;IAClD,UAAU;KAAE,cAAc,SAAS,GAAG,KAAK,MAAM,IAAI,KAAK;KAAO,gBAAgB,MAAM,SAAS,KAAK,EAAE,EAAE;KAAO,cAAc;IAAU;IACxI,SAAS,YAAY,CAAC;IACtB,OAAO,YAAY,QAAQ,iCAAiC,UAAU,KAAA;IACtE,cAAc,MAAM,WAAW,IAAI,2BAA2B;IAC9D,cAAA;IACA,gBAAgB;KAAE,OAAO,QAAQ;KAAG,WAAW,MAAM,IAAI,EAAE,EAAE,CAAC;KAAG,aAAa;KAAyB,WAAW;IAAkB;IACpI,iBAAiB,eAAe,SAAS,KAAK,OAAO,YAAY,CAAC,CAAC;IACnE,gBAAgB;IAChB,wBAAwB;IACxB,oBAAoB,SAAS,oBAAC,oBAAD;KAA0B;KAAc;KAAiB;IAAU,CAAA;GACjG,CAAA;EACM;;AAEb"}
1
+ {"version":3,"file":"CommentInbox.js","names":[],"sources":["../../../src/comments/gavel/CommentInbox.tsx"],"sourcesContent":["import { useLayoutEffect, useMemo, useRef, useState, type ReactNode } from \"react\";\nimport { Button } from \"../../components/button\";\nimport type { FilterBarFilter } from \"../../components/FilterBar\";\nimport { Badge } from \"../../data/Badge\";\nimport { formatRelativeTime } from \"../../data/cells/timestamp-format\";\nimport { DataTable, type DataTableColumn } from \"../../data/DataTable\";\nimport { Icon } from \"../../data/Icon\";\nimport { UiFile, UiGlobe, UiImage } from \"../../icons\";\nimport { toneToBadgeTone } from \"../comment-utils\";\nimport { DriftBadge } from \"../DriftList\";\nimport { DEFAULT_COMMENT_STATUSES, type CommentConfig } from \"../comment-types\";\nimport { CommentInboxCopy } from \"./CommentInboxCopy\";\nimport { CommentInboxThread, type CommentInboxActions } from \"./CommentInboxThread\";\nimport {\n inboxAuthorOptions,\n filterInbox,\n groupInbox,\n inboxItems,\n INBOX_KIND_OPTIONS,\n INBOX_PHASE_OPTIONS,\n inboxProjectOptions,\n INBOX_STATUS_OPTIONS,\n type InboxFilters,\n type InboxItem,\n type InboxListing,\n type InboxTargetKind,\n} from \"./inbox-model\";\n\nexport type CommentInboxProps = {\n /** One listing per scope, as gavel's comments API returns them. `undefined` while the first load is pending. */\n listings: readonly InboxListing[] | undefined;\n /** A failed load or refresh; shown beside the filters and, once there are rows, beside them. */\n error?: string | null | undefined;\n /** Controlled filters, so a host can keep them in the URL. */\n filters: InboxFilters;\n onFiltersChange: (filters: InboxFilters) => void;\n /** Receives the thread with its resolved anchor, for the host to open the file at its line, the page or the image. */\n onOpen: (item: InboxItem) => void;\n canOpen?: (item: InboxItem) => boolean;\n projectOptions?: { value: string; label: string }[];\n expandedThreadId?: string | undefined;\n onExpandedThreadChange?: (id: string | undefined) => void;\n renderThread?: (item: InboxItem) => ReactNode;\n /** Which resolved threads the \"Needs review\" filter keeps; every resolved thread when unset. */\n canReview?: (item: InboxItem) => boolean;\n /** Where gavel is served; copy-as-prompt points the agent's API calls here. */\n baseUrl: string;\n /** Handlers for acting on a thread. A capability a host does not pass is not offered. */\n actions?: CommentInboxActions;\n /** Statuses and assignees for the thread cards. Defaults to open, in progress, resolved and closed. */\n config?: CommentConfig;\n className?: string;\n};\n\nconst DEFAULT_CONFIG: CommentConfig = { statuses: DEFAULT_COMMENT_STATUSES };\nconst KIND_ICON = { file: UiFile, page: UiGlobe, image: UiImage } as const;\nconst KIND_LABEL: Record<InboxTargetKind, string> = { file: \"file\", page: \"page\", image: \"image\" };\n\nconst placeOf = (item: InboxItem) => (item.line === undefined ? item.label : `${item.label}:${item.line}`);\n\nfunction filterControls(filters: InboxFilters, set: (patch: Partial<InboxFilters>) => void, items: readonly InboxItem[], projects: { value: string; label: string }[], reviewCount: number): FilterBarFilter[] {\n const choice = (key: \"status\" | \"phase\" | \"author\" | \"project\" | \"kind\", label: string, options: { value: string; label: string }[]): FilterBarFilter => ({\n key,\n kind: \"enum\",\n label,\n value: filters[key],\n options,\n onChange: (value) => set({ [key]: value }),\n });\n return [\n choice(\"status\", \"Status\", INBOX_STATUS_OPTIONS),\n choice(\"phase\", \"Phase\", INBOX_PHASE_OPTIONS),\n choice(\"author\", \"Author\", inboxAuthorOptions(items)),\n choice(\"project\", \"Project\", projects),\n choice(\"kind\", \"Target\", INBOX_KIND_OPTIONS),\n { key: \"unread\", kind: \"boolean\", label: \"Unread only\", value: filters.unread, onChange: (unread) => set({ unread }) },\n { key: \"review\", kind: \"boolean\", label: `Needs review (${reviewCount})`, value: filters.review, onChange: (review) => set({ review }) },\n ];\n}\n\nfunction ThreadCell({ item }: { item: InboxItem }) {\n const replies = item.thread.messages?.length ?? 0;\n return (\n <div className=\"flex min-w-0 items-center gap-1.5\">\n {item.thread.unread && (\n <Badge tone=\"info\" variant=\"soft\" size=\"xs\" clickToCopy={false}>\n Unread\n </Badge>\n )}\n <span className=\"line-clamp-2 min-w-0\">{item.thread.bodyMarkdown}</span>\n {replies > 0 && <span className=\"shrink-0 text-xs text-muted-foreground\">{replies === 1 ? \"1 reply\" : `${replies} replies`}</span>}\n </div>\n );\n}\n\nfunction TargetCell({ item, onOpen }: { item: InboxItem; onOpen?: ((item: InboxItem) => void) | undefined }) {\n const drift = item.anchor && item.anchor.state !== \"matched\" ? item.anchor.state : undefined;\n return (\n <div className=\"flex min-w-0 items-center gap-1.5\">\n <Icon icon={KIND_ICON[item.kind]} className=\"shrink-0 text-muted-foreground\" />\n {onOpen ? <button\n type=\"button\"\n className=\"truncate font-mono text-xs text-primary hover:underline\"\n aria-label={`Open ${placeOf(item)}`}\n title={`Open ${placeOf(item)}`}\n onClick={(event) => {\n event.stopPropagation();\n onOpen(item);\n }}\n >\n {placeOf(item)}\n </button> : <span className=\"truncate font-mono text-xs\" title={placeOf(item)}>{placeOf(item)}</span>}\n {drift && <DriftBadge state={drift} />}\n </div>\n );\n}\n\nfunction StatusCell({ status, config }: { status: string; config: CommentConfig }) {\n const configured = config.statuses.find((entry) => entry.value === status);\n return (\n <Badge variant=\"soft\" size=\"xs\" tone={toneToBadgeTone(configured?.tone)} clickToCopy={false}>\n {configured?.label ?? status}\n </Badge>\n );\n}\n\n/**\n * Every comment thread across targets, whatever surface wrote it: files, pages\n * and images, grouped by target and newest first behind controlled filters that\n * stay visible when nothing matches. Copy-as-prompt hands the filtered selection\n * to an LLM, Claude or Codex, and the \"Needs review\" filter narrows the list to\n * resolved work awaiting a human's close or reopen.\n */\nconst rowId = (item: InboxItem) => `${item.scope}\\n${item.thread.id}`;\n\nexport function CommentInbox({ listings, error, filters, onFiltersChange, onOpen, canOpen, projectOptions, expandedThreadId, onExpandedThreadChange, renderThread, canReview, baseUrl, actions = {}, config = DEFAULT_CONFIG, className }: CommentInboxProps) {\n const [expanded, setExpanded] = useState<string[]>([]);\n const items = useMemo(() => inboxItems(listings ?? []), [listings]);\n const reviewable = (matched: InboxItem[]) => (canReview ? matched.filter(canReview) : matched);\n const visible = useMemo(() => {\n const matched = filterInbox(items, filters);\n return groupInbox(filters.review ? reviewable(matched) : matched).flatMap((group) => group.items);\n }, [items, filters, canReview]);\n const reviewCount = reviewable(filterInbox(items, { ...filters, review: true })).length;\n const selection = onExpandedThreadChange && visible.find((item) => item.thread.id === expandedThreadId);\n const renderDetails = renderThread ?? ((item: InboxItem) => <CommentInboxThread item={item} config={config} actions={actions} />);\n const unresolved = items.filter((item) => config.statuses.some((status) => status.value === item.thread.status && status.unresolved)).length;\n // FilterBar's \"Clear all\" clears each filter in turn within one event, so patches merge onto the latest filters.\n const latest = useRef(filters);\n useLayoutEffect(() => {\n latest.current = filters;\n });\n const set = (patch: Partial<InboxFilters>) => {\n latest.current = { ...latest.current, ...patch };\n onFiltersChange(latest.current);\n };\n\n const { onMarkRead } = actions;\n const unreadTargets = new Set(items.filter((item) => item.thread.unread).map((item) => `${item.scope}\\n${item.uri}`));\n\n const columns: DataTableColumn<InboxItem>[] = [\n { key: \"thread\", label: \"Thread\", sortable: false, grow: true, accessor: (item) => item.thread.bodyMarkdown, render: (_value, item) => <ThreadCell item={item} /> },\n { key: \"target\", label: \"Target\", sortable: false, accessor: placeOf, render: (_value, item) => <TargetCell item={item} onOpen={!canOpen || canOpen(item) ? onOpen : undefined} /> },\n { key: \"status\", label: \"Status\", sortable: false, accessor: (item) => item.thread.status, render: (value) => <StatusCell status={String(value)} config={config} /> },\n { key: \"phase\", label: \"Phase\", sortable: false, accessor: (item) => item.thread.phase },\n { key: \"author\", label: \"Author\", sortable: false, accessor: (item) => item.thread.author.label ?? item.thread.author.id },\n { key: \"activity\", label: \"Updated\", sortable: false, accessor: (item) => item.activity, render: (value) => formatRelativeTime(new Date(String(value))) },\n ];\n\n const groupMeta = (_key: string, rows: InboxItem[]): ReactNode => {\n const first = rows[0];\n if (!first) return null;\n return (\n <span className=\"flex items-center gap-2\">\n <Badge variant=\"soft\" size=\"xs\" clickToCopy={false}>\n {KIND_LABEL[first.kind]}\n </Badge>\n <span>{first.project}</span>\n {unreadTargets.has(`${first.scope}\\n${first.uri}`) && (\n <Badge tone=\"info\" variant=\"soft\" size=\"xs\" clickToCopy={false}>\n Unread\n </Badge>\n )}\n {unreadTargets.has(`${first.scope}\\n${first.uri}`) && onMarkRead && (\n <Button size=\"sm\" variant=\"ghost\" aria-label={`Mark ${first.label} read`} onClick={() => void onMarkRead({ scope: first.scope, uri: first.uri })}>\n Mark read\n </Button>\n )}\n </span>\n );\n };\n\n const notReady = listings === undefined;\n return (\n <section aria-label=\"Comment inbox\" className={`flex h-full min-h-0 flex-col gap-3 p-density-3 ${className ?? \"\"}`} data-testid=\"comment-inbox\">\n <header className=\"flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between\">\n <div className=\"min-w-0\">\n <h1 className=\"text-lg font-semibold\">Comments</h1>\n <p className=\"text-sm text-muted-foreground\">{notReady ? \"Loading…\" : `${unresolved} unresolved across ${listings.length === 1 ? \"1 project\" : `${listings.length} projects`}`}</p>\n </div>\n <div className=\"flex flex-wrap items-start gap-2 sm:justify-end\">\n <CommentInboxCopy items={visible} scopes={(listings ?? []).map((listing) => listing.scope)} filters={filters} baseUrl={baseUrl} />\n </div>\n </header>\n {listings && error && (\n <p role=\"alert\" className=\"text-sm text-destructive\">\n Refreshing comments failed: {error}\n </p>\n )}\n <DataTable\n className=\"min-h-0 flex-1\"\n data={visible}\n columns={columns}\n getRowId={rowId}\n grouping={{ getGroupKey: (item) => `${item.scope}\\n${item.uri}`, getGroupLabel: (_key, rows) => rows[0]?.label, getGroupMeta: groupMeta }}\n loading={notReady && !error}\n error={notReady && error ? `Comments could not be loaded: ${error}` : undefined}\n emptyMessage={items.length === 0 ? \"No comment threads yet\" : \"No threads match these filters\"}\n manualFilter\n externalSearch={{ value: filters.q, onChange: (q) => set({ q }), placeholder: \"Comment text or path…\", ariaLabel: \"Search comments\" }}\n externalFilters={filterControls(filters, set, items, projectOptions ?? inboxProjectOptions(listings ?? []), reviewCount)}\n expandedRowIds={onExpandedThreadChange ? (selection ? [rowId(selection)] : []) : expanded}\n onExpandedRowIdsChange={onExpandedThreadChange\n ? (ids) => onExpandedThreadChange(visible.find((item) => rowId(item) === ids.at(-1))?.thread.id)\n : setExpanded}\n renderExpandedRow={renderDetails}\n />\n </section>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAsDA,IAAM,iBAAgC,EAAE,UAAU,yBAAyB;AAC3E,IAAM,YAAY;CAAE,MAAM;CAAQ,MAAM;CAAS,OAAO;AAAQ;AAChE,IAAM,aAA8C;CAAE,MAAM;CAAQ,MAAM;CAAQ,OAAO;AAAQ;AAEjG,IAAM,WAAW,SAAqB,KAAK,SAAS,KAAA,IAAY,KAAK,QAAQ,GAAG,KAAK,MAAM,GAAG,KAAK;AAEnG,SAAS,eAAe,SAAuB,KAA6C,OAA6B,UAA8C,aAAwC;CAC7M,MAAM,UAAU,KAAyD,OAAe,aAAkE;EACxJ;EACA,MAAM;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AS,WAAW,IAAI,cAAc,GAAG,SAAS,OAAO;KAAgB,CAAA,CAC/K;IACL,CAAA,GAAA,oBAAC,OAAD;KAAK,WAAU;KACb,UAAA,oBAAC,kBAAD;MAAkB,OAAO;MAAS,SAAS,YAAY,CAAC,EAAA,CAAG,KAAK,YAAY,QAAQ,KAAK;MAAY;MAAkB;KAAU,CAAA;IAC9H,CAAA,CACC;;GACP,YAAY,SACX,qBAAC,KAAD;IAAG,MAAK;IAAQ,WAAU;IAA1B,UAAA,CAAqD,gCACtB,KAC5B;;GAEL,oBAAC,WAAD;IACE,WAAU;IACV,MAAM;IACG;IACT,UAAU;IACV,UAAU;KAAE,cAAc,SAAS,GAAG,KAAK,MAAM,IAAI,KAAK;KAAO,gBAAgB,MAAM,SAAS,KAAK,EAAE,EAAE;KAAO,cAAc;IAAU;IACxI,SAAS,YAAY,CAAC;IACtB,OAAO,YAAY,QAAQ,iCAAiC,UAAU,KAAA;IACtE,cAAc,MAAM,WAAW,IAAI,2BAA2B;IAC9D,cAAA;IACA,gBAAgB;KAAE,OAAO,QAAQ;KAAG,WAAW,MAAM,IAAI,EAAE,EAAE,CAAC;KAAG,aAAa;KAAyB,WAAW;IAAkB;IACpI,iBAAiB,eAAe,SAAS,KAAK,OAAO,kBAAkB,oBAAoB,YAAY,CAAC,CAAC,GAAG,WAAW;IACvH,gBAAgB,yBAA0B,YAAY,CAAC,MAAM,SAAS,CAAC,IAAI,CAAC,IAAK;IACjF,wBAAwB,0BACnB,QAAQ,uBAAuB,QAAQ,MAAM,SAAS,MAAM,IAAI,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,IAC7F;IACJ,mBAAmB;GACpB,CAAA;EACM;;AAEb"}
@@ -1 +1 @@
1
- {"version":3,"file":"CommentInboxThread.cjs","names":["CommentThreadList","projectNative"],"sources":["../../../src/comments/gavel/CommentInboxThread.tsx"],"sourcesContent":["import { CommentThreadList } from \"../CommentThreadList\";\nimport type { CommentConfig } from \"../comment-types\";\nimport { projectNative } from \"./gavel-projection\";\nimport type { InboxItem } from \"./inbox-model\";\n\n/** What a host does with the inbox's threads. Each handler gets the thread with where it lives, so a host spanning scopes knows which to act on. */\nexport type CommentInboxActions = {\n onReply?: (item: InboxItem, body: string) => void | Promise<void>;\n onUpdateStatus?: (item: InboxItem, status: string) => void | Promise<void>;\n /** A human closing resolved work; also the review queue's \"Close & next\". */\n onClose?: (item: InboxItem) => void | Promise<void>;\n onAcknowledge?: (item: InboxItem) => void | Promise<void>;\n /** The review queue's \"Comment & reopen\": reply with `feedback`, then reopen the thread. */\n onReopenWithFeedback?: (item: InboxItem, feedback: string) => void | Promise<void>;\n /** Marks every thread on a target read for the caller (gavel `markRead`). */\n onMarkRead?: (target: { scope: string; uri: string }) => void | Promise<void>;\n};\n\n/** One thread and its replies, acting through the host's handlers. */\nexport function CommentInboxThread({ item, config, actions }: { item: InboxItem; config: CommentConfig; actions: CommentInboxActions }) {\n const { onReply, onUpdateStatus, onClose, onAcknowledge } = actions;\n return (\n <CommentThreadList\n comments={projectNative(item.thread)}\n config={config}\n compact\n defaultExpanded\n {...(onReply ? { onReply: (_parent: unknown, body: string) => onReply(item, body) } : {})}\n {...(onUpdateStatus ? { onUpdateStatus: (_id: string, status: string) => onUpdateStatus(item, status) } : {})}\n {...(onClose ? { onClose: () => onClose(item) } : {})}\n {...(onAcknowledge ? { onAcknowledge: () => onAcknowledge(item) } : {})}\n />\n );\n}\n"],"mappings":";;;;;AAmBA,SAAgB,mBAAmB,EAAE,MAAM,QAAQ,WAAqF;CACtI,MAAM,EAAE,SAAS,gBAAgB,SAAS,kBAAkB;CAC5D,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACA,0BAAAA,mBAAD;EACE,UAAUC,yBAAAA,cAAc,KAAK,MAAM;EAC3B;EACR,SAAA;EACA,iBAAA;EACA,GAAK,UAAU,EAAE,UAAU,SAAkB,SAAiB,QAAQ,MAAM,IAAI,EAAE,IAAI,CAAC;EACvF,GAAK,iBAAiB,EAAE,iBAAiB,KAAa,WAAmB,eAAe,MAAM,MAAM,EAAE,IAAI,CAAC;EAC3G,GAAK,UAAU,EAAE,eAAe,QAAQ,IAAI,EAAE,IAAI,CAAC;EACnD,GAAK,gBAAgB,EAAE,qBAAqB,cAAc,IAAI,EAAE,IAAI,CAAC;CACtE,CAAA;AAEL"}
1
+ {"version":3,"file":"CommentInboxThread.cjs","names":["CommentThreadList","projectNative"],"sources":["../../../src/comments/gavel/CommentInboxThread.tsx"],"sourcesContent":["import { CommentThreadList } from \"../CommentThreadList\";\nimport type { CommentConfig } from \"../comment-types\";\nimport { projectNative } from \"./gavel-projection\";\nimport type { InboxItem } from \"./inbox-model\";\n\n/** What a host does with the inbox's threads. Each handler gets the thread with where it lives, so a host spanning scopes knows which to act on. */\nexport type CommentInboxActions = {\n onReply?: (item: InboxItem, body: string) => void | Promise<void>;\n onUpdateStatus?: (item: InboxItem, status: string) => void | Promise<void>;\n /** A human closing resolved work. */\n onClose?: (item: InboxItem) => void | Promise<void>;\n onAcknowledge?: (item: InboxItem) => void | Promise<void>;\n /** Marks every thread on a target read for the caller (gavel `markRead`). */\n onMarkRead?: (target: { scope: string; uri: string }) => void | Promise<void>;\n};\n\n/** One thread and its replies, acting through the host's handlers. */\nexport function CommentInboxThread({ item, config, actions }: { item: InboxItem; config: CommentConfig; actions: CommentInboxActions }) {\n const { onReply, onUpdateStatus, onClose, onAcknowledge } = actions;\n return (\n <CommentThreadList\n comments={projectNative(item.thread)}\n config={config}\n compact\n defaultExpanded\n {...(onReply ? { onReply: (_parent: unknown, body: string) => onReply(item, body) } : {})}\n {...(onUpdateStatus ? { onUpdateStatus: (_id: string, status: string) => onUpdateStatus(item, status) } : {})}\n {...(onClose ? { onClose: () => onClose(item) } : {})}\n {...(onAcknowledge ? { onAcknowledge: () => onAcknowledge(item) } : {})}\n />\n );\n}\n"],"mappings":";;;;;AAiBA,SAAgB,mBAAmB,EAAE,MAAM,QAAQ,WAAqF;CACtI,MAAM,EAAE,SAAS,gBAAgB,SAAS,kBAAkB;CAC5D,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACA,0BAAAA,mBAAD;EACE,UAAUC,yBAAAA,cAAc,KAAK,MAAM;EAC3B;EACR,SAAA;EACA,iBAAA;EACA,GAAK,UAAU,EAAE,UAAU,SAAkB,SAAiB,QAAQ,MAAM,IAAI,EAAE,IAAI,CAAC;EACvF,GAAK,iBAAiB,EAAE,iBAAiB,KAAa,WAAmB,eAAe,MAAM,MAAM,EAAE,IAAI,CAAC;EAC3G,GAAK,UAAU,EAAE,eAAe,QAAQ,IAAI,EAAE,IAAI,CAAC;EACnD,GAAK,gBAAgB,EAAE,qBAAqB,cAAc,IAAI,EAAE,IAAI,CAAC;CACtE,CAAA;AAEL"}
@@ -4,11 +4,9 @@ import { InboxItem } from './inbox-model.js';
4
4
  export type CommentInboxActions = {
5
5
  onReply?: (item: InboxItem, body: string) => void | Promise<void>;
6
6
  onUpdateStatus?: (item: InboxItem, status: string) => void | Promise<void>;
7
- /** A human closing resolved work; also the review queue's "Close & next". */
7
+ /** A human closing resolved work. */
8
8
  onClose?: (item: InboxItem) => void | Promise<void>;
9
9
  onAcknowledge?: (item: InboxItem) => void | Promise<void>;
10
- /** The review queue's "Comment & reopen": reply with `feedback`, then reopen the thread. */
11
- onReopenWithFeedback?: (item: InboxItem, feedback: string) => void | Promise<void>;
12
10
  /** Marks every thread on a target read for the caller (gavel `markRead`). */
13
11
  onMarkRead?: (target: {
14
12
  scope: string;
@@ -1 +1 @@
1
- {"version":3,"file":"CommentInboxThread.d.ts","sourceRoot":"","sources":["../../../src/comments/gavel/CommentInboxThread.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C,oJAAoJ;AACpJ,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,CAAC,EAAE,CAAC,IA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AI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3E,qCAAqC;IACrC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,6EAA6E;IAC7E,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/E,CAAC;AAEF,sEAAsE;AACtE,wBAAgB,kBAAkB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,aAAa,CAAC;IAAC,OAAO,EAAE,mBAAmB,CAAA;CAAE,+BAcrI"}
@@ -1 +1 @@
1
- {"version":3,"file":"CommentInboxThread.js","names":[],"sources":["../../../src/comments/gavel/CommentInboxThread.tsx"],"sourcesContent":["import { CommentThreadList } from \"../CommentThreadList\";\nimport type { CommentConfig } from \"../comment-types\";\nimport { projectNative } from \"./gavel-projection\";\nimport type { InboxItem } from \"./inbox-model\";\n\n/** What a host does with the inbox's threads. Each handler gets the thread with where it lives, so a host spanning scopes knows which to act on. */\nexport type CommentInboxActions = {\n onReply?: (item: InboxItem, body: string) => void | Promise<void>;\n onUpdateStatus?: (item: InboxItem, status: string) => void | Promise<void>;\n /** A human closing resolved work; also the review queue's \"Close & next\". */\n onClose?: (item: InboxItem) => void | Promise<void>;\n onAcknowledge?: (item: InboxItem) => void | Promise<void>;\n /** The review queue's \"Comment & reopen\": reply with `feedback`, then reopen the thread. */\n onReopenWithFeedback?: (item: InboxItem, feedback: string) => void | Promise<void>;\n /** Marks every thread on a target read for the caller (gavel `markRead`). */\n onMarkRead?: (target: { scope: string; uri: string }) => void | Promise<void>;\n};\n\n/** One thread and its replies, acting through the host's handlers. */\nexport function CommentInboxThread({ item, config, actions }: { item: InboxItem; config: CommentConfig; actions: CommentInboxActions }) {\n const { onReply, onUpdateStatus, onClose, onAcknowledge } = actions;\n return (\n <CommentThreadList\n comments={projectNative(item.thread)}\n config={config}\n compact\n defaultExpanded\n {...(onReply ? { onReply: (_parent: unknown, body: string) => onReply(item, body) } : {})}\n {...(onUpdateStatus ? { onUpdateStatus: (_id: string, status: string) => onUpdateStatus(item, status) } : {})}\n {...(onClose ? { onClose: () => onClose(item) } : {})}\n {...(onAcknowledge ? { onAcknowledge: () => onAcknowledge(item) } : {})}\n />\n );\n}\n"],"mappings":";;;;;AAmBA,SAAgB,mBAAmB,EAAE,MAAM,QAAQ,WAAqF;CACtI,MAAM,EAAE,SAAS,gBAAgB,SAAS,kBAAkB;CAC5D,OACE,oBAAC,mBAAD;EACE,UAAU,cAAc,KAAK,MAAM;EAC3B;EACR,SAAA;EACA,iBAAA;EACA,GAAK,UAAU,EAAE,UAAU,SAAkB,SAAiB,QAAQ,MAAM,IAAI,EAAE,IAAI,CAAC;EACvF,GAAK,iBAAiB,EAAE,iBAAiB,KAAa,WAAmB,eAAe,MAAM,MAAM,EAAE,IAAI,CAAC;EAC3G,GAAK,UAAU,EAAE,eAAe,QAAQ,IAAI,EAAE,IAAI,CAAC;EACnD,GAAK,gBAAgB,EAAE,qBAAqB,cAAc,IAAI,EAAE,IAAI,CAAC;CACtE,CAAA;AAEL"}
1
+ {"version":3,"file":"CommentInboxThread.js","names":[],"sources":["../../../src/comments/gavel/CommentInboxThread.tsx"],"sourcesContent":["import { CommentThreadList } from \"../CommentThreadList\";\nimport type { CommentConfig } from \"../comment-types\";\nimport { projectNative } from \"./gavel-projection\";\nimport type { InboxItem } from \"./inbox-model\";\n\n/** What a host does with the inbox's threads. Each handler gets the thread with where it lives, so a host spanning scopes knows which to act on. */\nexport type CommentInboxActions = {\n onReply?: (item: InboxItem, body: string) => void | Promise<void>;\n onUpdateStatus?: (item: InboxItem, status: string) => void | Promise<void>;\n /** A human closing resolved work. */\n onClose?: (item: InboxItem) => void | Promise<void>;\n onAcknowledge?: (item: InboxItem) => void | Promise<void>;\n /** Marks every thread on a target read for the caller (gavel `markRead`). */\n onMarkRead?: (target: { scope: string; uri: string }) => void | Promise<void>;\n};\n\n/** One thread and its replies, acting through the host's handlers. */\nexport function CommentInboxThread({ item, config, actions }: { item: InboxItem; config: CommentConfig; actions: CommentInboxActions }) {\n const { onReply, onUpdateStatus, onClose, onAcknowledge } = actions;\n return (\n <CommentThreadList\n comments={projectNative(item.thread)}\n config={config}\n compact\n defaultExpanded\n {...(onReply ? { onReply: (_parent: unknown, body: string) => onReply(item, body) } : {})}\n {...(onUpdateStatus ? { onUpdateStatus: (_id: string, status: string) => onUpdateStatus(item, status) } : {})}\n {...(onClose ? { onClose: () => onClose(item) } : {})}\n {...(onAcknowledge ? { onAcknowledge: () => onAcknowledge(item) } : {})}\n />\n );\n}\n"],"mappings":";;;;;AAiBA,SAAgB,mBAAmB,EAAE,MAAM,QAAQ,WAAqF;CACtI,MAAM,EAAE,SAAS,gBAAgB,SAAS,kBAAkB;CAC5D,OACE,oBAAC,mBAAD;EACE,UAAU,cAAc,KAAK,MAAM;EAC3B;EACR,SAAA;EACA,iBAAA;EACA,GAAK,UAAU,EAAE,UAAU,SAAkB,SAAiB,QAAQ,MAAM,IAAI,EAAE,IAAI,CAAC;EACvF,GAAK,iBAAiB,EAAE,iBAAiB,KAAa,WAAmB,eAAe,MAAM,MAAM,EAAE,IAAI,CAAC;EAC3G,GAAK,UAAU,EAAE,eAAe,QAAQ,IAAI,EAAE,IAAI,CAAC;EACnD,GAAK,gBAAgB,EAAE,qBAAqB,cAAc,IAAI,EAAE,IAAI,CAAC;CACtE,CAAA;AAEL"}
@@ -0,0 +1,41 @@
1
+ const require_ContextMeter_model = require("../../data/chat/ContextMeter.model.cjs");
2
+ const require_UiSliders = require("../../icons/components/UiSliders.cjs");
3
+ const require_agent_delivery = require("../agent-delivery.cjs");
4
+ // src/comments/gavel/comment-agent-assignment.ts
5
+ function orderedCommentAgentSessions(sessions) {
6
+ return [...sessions.filter((session) => session.status !== "ended"), ...sessions.filter((session) => session.status === "ended")];
7
+ }
8
+ function commentAgentSessionLabel(session) {
9
+ return session.resumable ? `${session.title} · resumes` : session.title;
10
+ }
11
+ function commentAgentAssignmentItems(options) {
12
+ const { sessions, currentSessionId, model, disabled, onSession, onNew, onAdvanced } = options;
13
+ return [
14
+ ...orderedCommentAgentSessions(sessions).filter((session) => session.id !== currentSessionId).map((session) => ({
15
+ label: commentAgentSessionLabel(session),
16
+ icon: require_agent_delivery.agentGlyph(session.model ?? session.source).icon,
17
+ title: session.resumable ? `Resumes the ended session ${session.title} with this thread` : `Deliver this thread into the session ${session.title}`,
18
+ disabled: disabled || session.status === "ended" && !session.resumable,
19
+ onSelect: () => onSession(session)
20
+ })),
21
+ {
22
+ label: model ? `New ${require_ContextMeter_model.shortContextModelName(model)}` : "New session (Gavel's default)",
23
+ icon: require_agent_delivery.agentGlyph(model ?? "").icon,
24
+ title: "Start a new agent session for this thread with the configured runtime",
25
+ disabled,
26
+ onSelect: onNew
27
+ },
28
+ {
29
+ label: "Advanced…",
30
+ icon: require_UiSliders.UiSliders,
31
+ title: "Choose the model and settings of a new session for this thread",
32
+ disabled,
33
+ onSelect: onAdvanced
34
+ }
35
+ ];
36
+ }
37
+ exports.commentAgentAssignmentItems = commentAgentAssignmentItems;
38
+ exports.commentAgentSessionLabel = commentAgentSessionLabel;
39
+ exports.orderedCommentAgentSessions = orderedCommentAgentSessions;
40
+
41
+ //# sourceMappingURL=comment-agent-assignment.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comment-agent-assignment.cjs","names":["agentGlyph","shortContextModelName","UiSliders"],"sources":["../../../src/comments/gavel/comment-agent-assignment.ts"],"sourcesContent":["import { shortContextModelName } from \"../../data/chat/ContextMeter.model\";\nimport { UiSliders } from \"../../icons\";\nimport type { DropdownMenuItem } from \"../../overlay/DropdownMenu\";\nimport { agentGlyph } from \"../agent-delivery\";\nimport type { GavelAgentSession } from \"./gavel-delivery\";\n\nexport function orderedCommentAgentSessions(sessions: readonly GavelAgentSession[]): GavelAgentSession[] {\n return [...sessions.filter(session => session.status !== \"ended\"), ...sessions.filter(session => session.status === \"ended\")];\n}\n\nexport function commentAgentSessionLabel(session: GavelAgentSession): string {\n return session.resumable ? `${session.title} · resumes` : session.title;\n}\n\nexport type CommentAgentAssignmentOptions = {\n sessions: readonly GavelAgentSession[];\n currentSessionId: string | undefined;\n model?: string | undefined;\n disabled: boolean;\n onSession: (session: GavelAgentSession) => void;\n onNew: () => void;\n onAdvanced: () => void;\n};\n\nexport function commentAgentAssignmentItems(options: CommentAgentAssignmentOptions): DropdownMenuItem[] {\n const { sessions, currentSessionId, model, disabled, onSession, onNew, onAdvanced } = options;\n return [\n ...orderedCommentAgentSessions(sessions)\n .filter(session => session.id !== currentSessionId)\n .map(session => ({\n label: commentAgentSessionLabel(session),\n icon: agentGlyph(session.model ?? session.source).icon,\n title: session.resumable ? `Resumes the ended session ${session.title} with this thread` : `Deliver this thread into the session ${session.title}`,\n disabled: disabled || (session.status === \"ended\" && !session.resumable),\n onSelect: () => onSession(session),\n })),\n {\n label: model ? `New ${shortContextModelName(model)}` : \"New session (Gavel's default)\",\n icon: agentGlyph(model ?? \"\").icon,\n title: \"Start a new agent session for this thread with the configured runtime\",\n disabled,\n onSelect: onNew,\n },\n {\n label: \"Advanced…\",\n icon: UiSliders,\n title: \"Choose the model and settings of a new session for this thread\",\n disabled,\n onSelect: onAdvanced,\n },\n ];\n}\n"],"mappings":";;;;AAMA,SAAgB,4BAA4B,UAA6D;CACvG,OAAO,CAAC,GAAG,SAAS,QAAO,YAAW,QAAQ,WAAW,OAAO,GAAG,GAAG,SAAS,QAAO,YAAW,QAAQ,WAAW,OAAO,CAAC;AAC9H;AAEA,SAAgB,yBAAyB,SAAoC;CAC3E,OAAO,QAAQ,YAAY,GAAG,QAAQ,MAAM,cAAc,QAAQ;AACpE;AAYA,SAAgB,4BAA4B,SAA4D;CACtG,MAAM,EAAE,UAAU,kBAAkB,OAAO,UAAU,WAAW,OAAO,eAAe;CACtF,OAAO;EACL,GAAG,4BAA4B,QAAQ,CAAC,CACrC,QAAO,YAAW,QAAQ,OAAO,gBAAgB,CAAC,CAClD,KAAI,aAAY;GACf,OAAO,yBAAyB,OAAO;GACvC,MAAMA,uBAAAA,WAAW,QAAQ,SAAS,QAAQ,MAAM,CAAC,CAAC;GAClD,OAAO,QAAQ,YAAY,6BAA6B,QAAQ,MAAM,qBAAqB,wCAAwC,QAAQ;GAC3I,UAAU,YAAa,QAAQ,WAAW,WAAW,CAAC,QAAQ;GAC9D,gBAAgB,UAAU,OAAO;EACnC,EAAE;EACJ;GACE,OAAO,QAAQ,OAAOC,2BAAAA,sBAAsB,KAAK,MAAM;GACvD,MAAMD,uBAAAA,WAAW,SAAS,EAAE,CAAC,CAAC;GAC9B,OAAO;GACP;GACA,UAAU;EACZ;EACA;GACE,OAAO;GACP,MAAME,kBAAAA;GACN,OAAO;GACP;GACA,UAAU;EACZ;CACF;AACF"}
@@ -0,0 +1,15 @@
1
+ import { DropdownMenuItem } from '../../overlay/DropdownMenu.js';
2
+ import { GavelAgentSession } from './gavel-delivery.js';
3
+ export declare function orderedCommentAgentSessions(sessions: readonly GavelAgentSession[]): GavelAgentSession[];
4
+ export declare function commentAgentSessionLabel(session: GavelAgentSession): string;
5
+ export type CommentAgentAssignmentOptions = {
6
+ sessions: readonly GavelAgentSession[];
7
+ currentSessionId: string | undefined;
8
+ model?: string | undefined;
9
+ disabled: boolean;
10
+ onSession: (session: GavelAgentSession) => void;
11
+ onNew: () => void;
12
+ onAdvanced: () => void;
13
+ };
14
+ export declare function commentAgentAssignmentItems(options: CommentAgentAssignmentOptions): DropdownMenuItem[];
15
+ //# sourceMappingURL=comment-agent-assignment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comment-agent-assignment.d.ts","sourceRoot":"","sources":["../../../src/comments/gavel/comment-agent-assignment.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,GAAG,iBAAiB,EAAE,CAEvG;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAE3E;AAED,MAAM,MAAM,6BAA6B,GAAG;IAC1C,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACvC,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAChD,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,6BAA6B,GAAG,gBAAgB,EAAE,CA2BtG"}
@@ -0,0 +1,39 @@
1
+ import { shortContextModelName } from "../../data/chat/ContextMeter.model.js";
2
+ import { UiSliders } from "../../icons/components/UiSliders.js";
3
+ import { agentGlyph } from "../agent-delivery.js";
4
+ // src/comments/gavel/comment-agent-assignment.ts
5
+ function orderedCommentAgentSessions(sessions) {
6
+ return [...sessions.filter((session) => session.status !== "ended"), ...sessions.filter((session) => session.status === "ended")];
7
+ }
8
+ function commentAgentSessionLabel(session) {
9
+ return session.resumable ? `${session.title} · resumes` : session.title;
10
+ }
11
+ function commentAgentAssignmentItems(options) {
12
+ const { sessions, currentSessionId, model, disabled, onSession, onNew, onAdvanced } = options;
13
+ return [
14
+ ...orderedCommentAgentSessions(sessions).filter((session) => session.id !== currentSessionId).map((session) => ({
15
+ label: commentAgentSessionLabel(session),
16
+ icon: agentGlyph(session.model ?? session.source).icon,
17
+ title: session.resumable ? `Resumes the ended session ${session.title} with this thread` : `Deliver this thread into the session ${session.title}`,
18
+ disabled: disabled || session.status === "ended" && !session.resumable,
19
+ onSelect: () => onSession(session)
20
+ })),
21
+ {
22
+ label: model ? `New ${shortContextModelName(model)}` : "New session (Gavel's default)",
23
+ icon: agentGlyph(model ?? "").icon,
24
+ title: "Start a new agent session for this thread with the configured runtime",
25
+ disabled,
26
+ onSelect: onNew
27
+ },
28
+ {
29
+ label: "Advanced…",
30
+ icon: UiSliders,
31
+ title: "Choose the model and settings of a new session for this thread",
32
+ disabled,
33
+ onSelect: onAdvanced
34
+ }
35
+ ];
36
+ }
37
+ export { commentAgentAssignmentItems, commentAgentSessionLabel, orderedCommentAgentSessions };
38
+
39
+ //# sourceMappingURL=comment-agent-assignment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comment-agent-assignment.js","names":[],"sources":["../../../src/comments/gavel/comment-agent-assignment.ts"],"sourcesContent":["import { shortContextModelName } from \"../../data/chat/ContextMeter.model\";\nimport { UiSliders } from \"../../icons\";\nimport type { DropdownMenuItem } from \"../../overlay/DropdownMenu\";\nimport { agentGlyph } from \"../agent-delivery\";\nimport type { GavelAgentSession } from \"./gavel-delivery\";\n\nexport function orderedCommentAgentSessions(sessions: readonly GavelAgentSession[]): GavelAgentSession[] {\n return [...sessions.filter(session => session.status !== \"ended\"), ...sessions.filter(session => session.status === \"ended\")];\n}\n\nexport function commentAgentSessionLabel(session: GavelAgentSession): string {\n return session.resumable ? `${session.title} · resumes` : session.title;\n}\n\nexport type CommentAgentAssignmentOptions = {\n sessions: readonly GavelAgentSession[];\n currentSessionId: string | undefined;\n model?: string | undefined;\n disabled: boolean;\n onSession: (session: GavelAgentSession) => void;\n onNew: () => void;\n onAdvanced: () => void;\n};\n\nexport function commentAgentAssignmentItems(options: CommentAgentAssignmentOptions): DropdownMenuItem[] {\n const { sessions, currentSessionId, model, disabled, onSession, onNew, onAdvanced } = options;\n return [\n ...orderedCommentAgentSessions(sessions)\n .filter(session => session.id !== currentSessionId)\n .map(session => ({\n label: commentAgentSessionLabel(session),\n icon: agentGlyph(session.model ?? session.source).icon,\n title: session.resumable ? `Resumes the ended session ${session.title} with this thread` : `Deliver this thread into the session ${session.title}`,\n disabled: disabled || (session.status === \"ended\" && !session.resumable),\n onSelect: () => onSession(session),\n })),\n {\n label: model ? `New ${shortContextModelName(model)}` : \"New session (Gavel's default)\",\n icon: agentGlyph(model ?? \"\").icon,\n title: \"Start a new agent session for this thread with the configured runtime\",\n disabled,\n onSelect: onNew,\n },\n {\n label: \"Advanced…\",\n icon: UiSliders,\n title: \"Choose the model and settings of a new session for this thread\",\n disabled,\n onSelect: onAdvanced,\n },\n ];\n}\n"],"mappings":";;;;AAMA,SAAgB,4BAA4B,UAA6D;CACvG,OAAO,CAAC,GAAG,SAAS,QAAO,YAAW,QAAQ,WAAW,OAAO,GAAG,GAAG,SAAS,QAAO,YAAW,QAAQ,WAAW,OAAO,CAAC;AAC9H;AAEA,SAAgB,yBAAyB,SAAoC;CAC3E,OAAO,QAAQ,YAAY,GAAG,QAAQ,MAAM,cAAc,QAAQ;AACpE;AAYA,SAAgB,4BAA4B,SAA4D;CACtG,MAAM,EAAE,UAAU,kBAAkB,OAAO,UAAU,WAAW,OAAO,eAAe;CACtF,OAAO;EACL,GAAG,4BAA4B,QAAQ,CAAC,CACrC,QAAO,YAAW,QAAQ,OAAO,gBAAgB,CAAC,CAClD,KAAI,aAAY;GACf,OAAO,yBAAyB,OAAO;GACvC,MAAM,WAAW,QAAQ,SAAS,QAAQ,MAAM,CAAC,CAAC;GAClD,OAAO,QAAQ,YAAY,6BAA6B,QAAQ,MAAM,qBAAqB,wCAAwC,QAAQ;GAC3I,UAAU,YAAa,QAAQ,WAAW,WAAW,CAAC,QAAQ;GAC9D,gBAAgB,UAAU,OAAO;EACnC,EAAE;EACJ;GACE,OAAO,QAAQ,OAAO,sBAAsB,KAAK,MAAM;GACvD,MAAM,WAAW,SAAS,EAAE,CAAC,CAAC;GAC9B,OAAO;GACP;GACA,UAAU;EACZ;EACA;GACE,OAAO;GACP,MAAM;GACN,OAAO;GACP;GACA,UAAU;EACZ;CACF;AACF"}
@@ -33,6 +33,15 @@ function authorFor(actor) {
33
33
  kind: actor.kind === "agent" ? "agent" : "user"
34
34
  };
35
35
  }
36
+ /** A reply's author, naming the hand-off's session when an agent wrote it since the hand-off was requested. */
37
+ function replyAuthorFor(message, run) {
38
+ const author = authorFor(message.author);
39
+ const sessionId = run?.sessionId;
40
+ return sessionId && message.author.kind === "agent" && Date.parse(message.createdAt) >= Date.parse(run.requestedAt) ? {
41
+ ...author,
42
+ sessionId
43
+ } : author;
44
+ }
36
45
  /** A proposal as the thread shows it: who decided it becomes an author. */
37
46
  function proposalFor(proposal) {
38
47
  const { decidedBy, ...rest } = proposal;
@@ -69,11 +78,15 @@ function anchorOfSelector(selector) {
69
78
  switch (selector.kind) {
70
79
  case "document": return {};
71
80
  case "code-range":
72
- if (!isRecord(selector.patch)) throw new Error("a code-range selector needs a patch");
73
- return {
81
+ if (isRecord(selector.patch)) return {
74
82
  anchor: require_patch_anchor.patchAnchor(selector.patch),
75
83
  ...quote
76
84
  };
85
+ if (typeof selector.revision === "string" && hasCodeLines(selector)) return {};
86
+ throw new Error("a code-range selector needs a patch or a revision and lines");
87
+ case "diff-range":
88
+ if (hasCodeLines(selector) && typeof selector.baseCommit === "string" && typeof selector.headCommit === "string" && (selector.side === "old" || selector.side === "new")) return {};
89
+ throw new Error("a diff-range selector needs a path, commits, side and lines");
77
90
  case "region": return { anchor: require_region_anchor.regionAnchor(selector.region) };
78
91
  case "dom":
79
92
  if (typeof selector.anchor !== "string" || selector.anchor === "") throw new Error("a dom selector needs an anchor");
@@ -84,7 +97,30 @@ function anchorOfSelector(selector) {
84
97
  default: throw new Error(`unknown target selector kind ${JSON.stringify(selector.kind)}; expected document, code-range, region or dom`);
85
98
  }
86
99
  }
100
+ function hasCodeLines(selector) {
101
+ const { path, startLine, endLine } = selector;
102
+ return typeof path === "string" && path.length > 0 && typeof startLine === "number" && Number.isInteger(startLine) && startLine > 0 && typeof endLine === "number" && Number.isInteger(endLine) && endLine >= startLine;
103
+ }
87
104
  var isoOf = (time) => new Date(time).toISOString();
105
+ function commentCaptureOf(c, attachmentUrl) {
106
+ const element = c.content?.playground?.element;
107
+ const selector = isRecord(c.target.selector) ? c.target.selector : void 0;
108
+ const html = typeof selector?.html === "string" ? selector.html : "";
109
+ const image = c.attachments?.find(({ name, messageId }) => name === "screenshot.png" && !messageId);
110
+ if (!element && !html && !image) return void 0;
111
+ const pageUrl = element?.pageUrl ?? c.content?.page?.url;
112
+ return {
113
+ source: "",
114
+ html,
115
+ ...element,
116
+ ...pageUrl ? { pageUrl } : {},
117
+ ...image ? { screenshot: {
118
+ status: "captured",
119
+ filename: "screenshot.png",
120
+ url: attachmentUrl(c.id, image.id)
121
+ } } : {}
122
+ };
123
+ }
88
124
  /**
89
125
  * Any native thread in the comment components' shape, whoever wrote it: the
90
126
  * root, then its replies. Needs no playground metadata; the anchor and quote
@@ -115,7 +151,7 @@ function projectNative(c) {
115
151
  parentId: c.id,
116
152
  version: c.version,
117
153
  body: m.bodyMarkdown,
118
- author: authorFor(m.author),
154
+ author: replyAuthorFor(m, c.content?.agentRun),
119
155
  createdAt: isoOf(m.createdAt),
120
156
  anchor: root.anchor ?? null,
121
157
  ...m.content?.proposal ? { proposal: proposalFor(m.content.proposal) } : {}
@@ -130,7 +166,7 @@ function project(c, options) {
130
166
  const playground = c.content?.playground;
131
167
  if (!playground?.page) throw new Error(`Comment ${c.id} is missing playground metadata`);
132
168
  const { page: _page, assignee: _assignee, ...fields } = playground;
133
- const capture = c.attachments?.find((a) => a.name === "screenshot.png");
169
+ const element = fields.element && commentCaptureOf(c, options.attachmentUrl);
134
170
  const root = {
135
171
  ...fields,
136
172
  id: c.id,
@@ -145,14 +181,7 @@ function project(c, options) {
145
181
  closedAt: new Date(c.outcome.at).toISOString(),
146
182
  closedBy: fields.closedBy ?? authorFor(c.outcome.actor)
147
183
  } : {},
148
- ...capture && fields.element ? { element: {
149
- ...fields.element,
150
- screenshot: {
151
- status: "captured",
152
- filename: "screenshot.png",
153
- url: options.attachmentUrl(c.id, capture.id)
154
- }
155
- } } : {},
184
+ ...element ? { element } : {},
156
185
  ...c.content?.agentRun ? { agentRun: agentRunFor(c.content.agentRun, c.messages ?? []) } : {}
157
186
  };
158
187
  return [root, ...(c.messages ?? []).map((m) => ({
@@ -162,7 +191,7 @@ function project(c, options) {
162
191
  rootId: c.id,
163
192
  version: c.version,
164
193
  body: m.bodyMarkdown,
165
- author: m.content?.playground?.author ?? authorFor(m.author),
194
+ author: m.content?.playground?.author ?? replyAuthorFor(m, c.content?.agentRun),
166
195
  createdAt: new Date(m.createdAt).toISOString(),
167
196
  parentId: c.id,
168
197
  anchor: root.anchor ?? null
@@ -171,6 +200,7 @@ function project(c, options) {
171
200
  exports.anchorOfSelector = anchorOfSelector;
172
201
  exports.bodyFor = bodyFor;
173
202
  exports.commentActor = commentActor;
203
+ exports.commentCaptureOf = commentCaptureOf;
174
204
  exports.contentFor = contentFor;
175
205
  exports.localUser = localUser;
176
206
  exports.project = project;
@@ -1 +1 @@
1
- {"version":3,"file":"gavel-projection.cjs","names":["patchAnchor","regionAnchor"],"sources":["../../../src/comments/gavel/gavel-projection.ts"],"sourcesContent":["import { patchAnchor } from \"../anchoring/patch-anchor\";\nimport { regionAnchor } from \"../anchoring/region-anchor\";\nimport type { PatchAnchor, RegionAnchor, TextQuote } from \"../annotation-types\";\nimport type { StoredAgentRun, StoredAuthor, StoredComment, StoredProposal } from \"./comments-store\";\nimport type { CommentEdits } from \"./gavel-delivery\";\n\n/*\n * Pure projection between gavel's native comments and the comment components'\n * shape. `projectNative` reads any comment gavel holds (editor, CLI, agent,\n * extension, playground); `project` is the opt-in one for comments that carry\n * the playground's own metadata. Browser safe: the playground server and the\n * Chrome extension's gavel client both import it, so the mapping lives in one place.\n */\n\n/** The workflow phase gavel files a thread under. */\nexport type CommentPhase = \"active\" | \"awaiting_outcome\" | \"final\";\n\nexport type Actor = { kind: string; id: string; label?: string };\nexport type Target = {\n uri: string;\n scopeUri: string;\n kind: string;\n label?: string;\n selector?: unknown;\n};\ntype NativeMessage = {\n id: string;\n bodyMarkdown: string;\n author: Actor;\n createdAt: string;\n /** An agent's reply may carry only `proposal`; the playground fields are the web UI's own. */\n content?: Partial<Content> & { proposal?: NativeProposal };\n};\n/** A patch an agent proposed in a reply, as gavel stores it under the message's `content.proposal`. */\nexport type NativeProposal = Omit<StoredProposal, \"decidedBy\"> & { decidedBy?: Actor };\n/** The hand-off gavel records under `content.agentRun`, in clicky-ui's CommentAgentRun shape. */\nexport type NativeAgentRun = {\n sessionId?: string;\n requestedAt: string;\n state: string;\n error?: string;\n target?: { label: string; channel?: string };\n /** The delivery's edits policy: a `propose` run answers with a proposal and never resolves the thread itself. */\n edits?: CommentEdits;\n};\n/** What a comment stored in `content`: the playground and extension write their own fields, and gavel records an agent hand-off. Editor, CLI and agent comments have none. */\nexport type Content = {\n /** The playground's own fields; only comments it wrote carry them. */\n playground?: Partial<StoredComment> & { page: string };\n /** The web page a browser extension commented on. */\n page?: { url: string; title: string };\n agentRun?: NativeAgentRun;\n};\nexport type NativeComment = {\n id: string;\n bodyMarkdown: string;\n author: Actor;\n target: Target;\n status: string;\n phase: CommentPhase;\n /** Who holds the thread; a delivery assigns the agent it hands the thread to. */\n assignee?: Actor | null;\n version: number;\n createdAt: string;\n updatedAt: string;\n content?: Content;\n messages?: NativeMessage[];\n attachments?: { id: string; name: string }[];\n outcome?: { at: string; actor: Actor };\n};\nexport type Action = {\n id: string;\n expectedVersion: number;\n action: string;\n bodyMarkdown?: string;\n messageId?: string;\n content?: Content;\n target?: Target;\n assignee?: Actor | null;\n /** The resolution or closure summary. */\n summary?: string;\n evidence?: string[];\n /** `accept-proposal`: apply the proposed patch to the working tree or stage it in the index. */\n mode?: \"apply\" | \"stage\";\n};\n\nconst AGENT_RUN_STATES: readonly StoredAgentRun[\"state\"][] = [\"queued\", \"sent\", \"done\", \"error\"];\n\nexport function commentActor(author: StoredAuthor): Actor {\n return {\n kind: author.kind ?? \"user\",\n id: author.id ?? `${author.kind ?? \"user\"}:${author.name}`,\n label: author.name,\n };\n}\nexport const localUser: StoredAuthor = { name: \"You\", kind: \"user\" };\nexport const bodyFor = (comment: StoredComment) =>\n comment.body.trim()\n ? comment.body\n : comment.reviewDecision === \"approved\"\n ? \"Approved\"\n : comment.rating === \"positive\"\n ? \"Positive feedback\"\n : \"Negative feedback\";\nexport function contentFor(page: string, comment: StoredComment): Content {\n const {\n id: _id,\n version: _version,\n rootId: _rootId,\n createdAt: _created,\n updatedAt: _updated,\n status: _status,\n parentId: _parent,\n ...fields\n } = comment;\n return { playground: { ...fields, page } };\n}\nfunction authorFor(actor: Actor): StoredAuthor {\n return {\n id: actor.id,\n name: actor.label ?? actor.id,\n kind: actor.kind === \"agent\" ? \"agent\" : \"user\",\n };\n}\n/** A proposal as the thread shows it: who decided it becomes an author. */\nexport function proposalFor(proposal: NativeProposal): StoredProposal {\n const { decidedBy, ...rest } = proposal;\n return { ...rest, ...(decidedBy ? { decidedBy: authorFor(decidedBy) } : {}) };\n}\n/** The first reply an agent wrote in the thread at or after the hand-off was requested. */\nfunction firstAgentReply(messages: NativeMessage[], requestedAt: string): string | undefined {\n const since = Date.parse(requestedAt);\n const times = messages\n .filter((m) => m.author.kind === \"agent\" && Date.parse(m.createdAt) >= since)\n .map((m) => Date.parse(m.createdAt));\n return times.length > 0 ? new Date(Math.min(...times)).toISOString() : undefined;\n}\nfunction agentRunFor(run: NativeAgentRun, messages: NativeMessage[]): StoredAgentRun {\n if (!AGENT_RUN_STATES.includes(run.state as StoredAgentRun[\"state\"]))\n throw new Error(`Unknown agent run state ${JSON.stringify(run.state)}; expected ${AGENT_RUN_STATES.join(\", \")}`);\n const repliedAt = firstAgentReply(messages, run.requestedAt);\n return {\n ...(repliedAt ? { repliedAt } : {}),\n ...(run.sessionId ? { sessionId: run.sessionId } : {}),\n requestedAt: run.requestedAt,\n state: run.state as StoredAgentRun[\"state\"],\n ...(run.error ? { error: run.error } : {}),\n ...(run.target ? { target: run.target } : {}),\n ...(run.edits ? { edits: run.edits } : {}),\n };\n}\n\nconst isRecord = (value: unknown): value is Record<string, unknown> => typeof value === \"object\" && value !== null && !Array.isArray(value);\n\n/** The comment components' anchor, and the selected words kept beside it, for a gavel selector. A selector gavel would not have accepted throws. */\nexport function anchorOfSelector(selector: unknown): { anchor?: string; quote?: TextQuote } {\n if (selector === undefined || selector === null) return {};\n if (!isRecord(selector) || typeof selector.kind !== \"string\") throw new Error(`a target selector must be an object with a kind, got ${JSON.stringify(selector)}`);\n const quote = isRecord(selector.quote) ? { quote: selector.quote as TextQuote } : {};\n switch (selector.kind) {\n case \"document\":\n return {};\n case \"code-range\":\n if (!isRecord(selector.patch)) throw new Error(\"a code-range selector needs a patch\");\n return { anchor: patchAnchor(selector.patch as PatchAnchor), ...quote };\n case \"region\":\n return { anchor: regionAnchor(selector.region as RegionAnchor) };\n case \"dom\":\n if (typeof selector.anchor !== \"string\" || selector.anchor === \"\") throw new Error(\"a dom selector needs an anchor\");\n return { anchor: selector.anchor, ...quote };\n default:\n throw new Error(`unknown target selector kind ${JSON.stringify(selector.kind)}; expected document, code-range, region or dom`);\n }\n}\n\nconst isoOf = (time: string) => new Date(time).toISOString();\n\n/**\n * Any native thread in the comment components' shape, whoever wrote it: the\n * root, then its replies. Needs no playground metadata; the anchor and quote\n * come from the target's selector.\n */\nexport function projectNative(c: NativeComment): StoredComment[] {\n const { anchor, quote } = anchorOfSelector(c.target.selector);\n const root: StoredComment = {\n id: c.id,\n version: c.version,\n body: c.bodyMarkdown,\n author: authorFor(c.author),\n status: c.status,\n createdAt: isoOf(c.createdAt),\n ...(c.updatedAt !== c.createdAt ? { updatedAt: isoOf(c.updatedAt) } : {}),\n ...(c.assignee ? { assignee: authorFor(c.assignee) } : {}),\n ...(c.outcome ? { closedAt: isoOf(c.outcome.at), closedBy: authorFor(c.outcome.actor) } : {}),\n ...(anchor ? { anchor } : {}),\n ...(quote ? { quote } : {}),\n ...(c.content?.agentRun ? { agentRun: agentRunFor(c.content.agentRun, c.messages ?? []) } : {}),\n };\n return [\n root,\n ...(c.messages ?? []).map(\n (m): StoredComment => ({\n id: m.id,\n rootId: c.id,\n parentId: c.id,\n version: c.version,\n body: m.bodyMarkdown,\n author: authorFor(m.author),\n createdAt: isoOf(m.createdAt),\n anchor: root.anchor ?? null,\n ...(m.content?.proposal ? { proposal: proposalFor(m.content.proposal) } : {}),\n }),\n ),\n ];\n}\n\n/**\n * Opt-in projection for comments written by the playground or the extension,\n * which keep their own fields under `content.playground`; a comment without\n * them throws. `attachmentUrl` is where the host serves a comment's attachment: the playground proxies it, the extension reads gavel directly.\n */\nexport function project(\n c: NativeComment,\n options: { attachmentUrl: (commentId: string, attachmentId: string) => string },\n): StoredComment[] {\n const playground = c.content?.playground;\n if (!playground?.page)\n throw new Error(`Comment ${c.id} is missing playground metadata`);\n // Gavel owns the assignee; a copy left in the playground fields is never the current one.\n const { page: _page, assignee: _assignee, ...fields } = playground;\n const capture = c.attachments?.find((a) => a.name === \"screenshot.png\");\n const root: StoredComment = {\n ...fields,\n id: c.id,\n version: c.version,\n body: fields.body === \"\" ? \"\" : c.bodyMarkdown,\n author: fields.author ?? authorFor(c.author),\n ...(c.assignee ? { assignee: authorFor(c.assignee) } : {}),\n status: c.status,\n createdAt: new Date(c.createdAt).toISOString(),\n ...(c.updatedAt !== c.createdAt\n ? { updatedAt: new Date(c.updatedAt).toISOString() }\n : {}),\n ...(c.outcome\n ? {\n closedAt: new Date(c.outcome.at).toISOString(),\n closedBy: fields.closedBy ?? authorFor(c.outcome.actor),\n }\n : {}),\n ...(capture && fields.element\n ? {\n element: {\n ...fields.element,\n screenshot: {\n status: \"captured\",\n filename: \"screenshot.png\",\n url: options.attachmentUrl(c.id, capture.id),\n },\n },\n }\n : {}),\n ...(c.content?.agentRun ? { agentRun: agentRunFor(c.content.agentRun, c.messages ?? []) } : {}),\n };\n return [\n root,\n ...(c.messages ?? []).map((m) => ({\n ...m.content?.playground,\n ...(m.content?.proposal ? { proposal: proposalFor(m.content.proposal) } : {}),\n id: m.id,\n rootId: c.id,\n version: c.version,\n body: m.bodyMarkdown,\n author: m.content?.playground?.author ?? authorFor(m.author),\n createdAt: new Date(m.createdAt).toISOString(),\n parentId: c.id,\n anchor: root.anchor ?? null,\n })),\n ];\n}\n"],"mappings":";;;AAsFA,IAAM,mBAAuD;CAAC;CAAU;CAAQ;CAAQ;AAAO;AAE/F,SAAgB,aAAa,QAA6B;CACxD,OAAO;EACL,MAAM,OAAO,QAAQ;EACrB,IAAI,OAAO,MAAM,GAAG,OAAO,QAAQ,OAAO,GAAG,OAAO;EACpD,OAAO,OAAO;CAChB;AACF;AACA,IAAa,YAA0B;CAAE,MAAM;CAAO,MAAM;AAAO;AACnE,IAAa,WAAW,YACtB,QAAQ,KAAK,KAAK,IACd,QAAQ,OACR,QAAQ,mBAAmB,aACzB,aACA,QAAQ,WAAW,aACjB,sBACA;AACV,SAAgB,WAAW,MAAc,SAAiC;CACxE,MAAM,EACJ,IAAI,KACJ,SAAS,UACT,QAAQ,SACR,WAAW,UACX,WAAW,UACX,QAAQ,SACR,UAAU,SACV,GAAG,WACD;CACJ,OAAO,EAAE,YAAY;EAAE,GAAG;EAAQ;CAAK,EAAE;AAC3C;AACA,SAAS,UAAU,OAA4B;CAC7C,OAAO;EACL,IAAI,MAAM;EACV,MAAM,M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AAI,EAAE,cAAc,EAAE,YAClB,EAAE,WAAW,IAAI,KAAK,EAAE,SAAS,CAAC,CAAC,YAAY,EAAE,IACjD,CAAC;EACL,GAAI,EAAE,UACF;GACE,UAAU,IAAI,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,YAAY;GAC7C,UAAU,OAAO,YAAY,UAAU,EAAE,QAAQ,KAAK;EACxD,IACA,CAAC;EACL,GAAI,WAAW,OAAO,UAClB,EACE,SAAS;GACP,GAAG,OAAO;GACV,YAAY;IACV,QAAQ;IACR,UAAU;IACV,KAAK,QAAQ,cAAc,EAAE,IAAI,QAAQ,EAAE;GAC7C;EACF,EACF,IACA,CAAC;EACL,GAAI,EAAE,SAAS,WAAW,EAAE,UAAU,YAAY,EAAE,QAAQ,UAAU,EAAE,YAAY,CAAC,CAAC,EAAE,IAAI,CAAC;CAC/F;CACA,OAAO,CACL,MACA,IAAI,EAAE,YAAY,CAAC,EAAA,CAAG,KAAK,OAAO;EAChC,GAAG,EAAE,SAAS;EACd,GAAI,EAAE,SAAS,WAAW,EAAE,UAAU,YAAY,EAAE,QAAQ,QAAQ,EAAE,IAAI,CAAC;EAC3E,IAAI,EAAE;EACN,QAAQ,EAAE;EACV,SAAS,EAAE;EACX,MAAM,EAAE;EACR,QAAQ,EAAE,SAAS,YAAY,UAAU,UAAU,EAAE,MAAM;EAC3D,WAAW,IAAI,KAAK,EAAE,SAAS,CAAC,CAAC,YAAY;EAC7C,UAAU,EAAE;EACZ,QAAQ,KAAK,UAAU;CACzB,EAAE,CACJ;AACF"}
1
+ {"version":3,"file":"gavel-projection.cjs","names":["patchAnchor","regionAnchor"],"sources":["../../../src/comments/gavel/gavel-projection.ts"],"sourcesContent":["import { patchAnchor } from \"../anchoring/patch-anchor\";\nimport { regionAnchor } from \"../anchoring/region-anchor\";\nimport type { PatchAnchor, RegionAnchor, TextQuote } from \"../annotation-types\";\nimport type { StoredAgentRun, StoredAuthor, StoredComment, StoredProposal } from \"./comments-store\";\nimport type { CommentElementContext } from \"./comments-model\";\nimport type { CommentEdits } from \"./gavel-delivery\";\n\n/*\n * Pure projection between gavel's native comments and the comment components'\n * shape. `projectNative` reads any comment gavel holds (editor, CLI, agent,\n * extension, playground); `project` is the opt-in one for comments that carry\n * the playground's own metadata. Browser safe: the playground server and the\n * Chrome extension's gavel client both import it, so the mapping lives in one place.\n */\n\n/** The workflow phase gavel files a thread under. */\nexport type CommentPhase = \"active\" | \"awaiting_outcome\" | \"final\";\n\nexport type Actor = { kind: string; id: string; label?: string };\nexport type Target = {\n uri: string;\n scopeUri: string;\n kind: string;\n label?: string;\n selector?: unknown;\n};\ntype NativeMessage = {\n id: string;\n bodyMarkdown: string;\n author: Actor;\n createdAt: string;\n /** An agent's reply may carry only `proposal`; the playground fields are the web UI's own. */\n content?: Partial<Content> & { proposal?: NativeProposal };\n};\n/** A patch an agent proposed in a reply, as gavel stores it under the message's `content.proposal`. */\nexport type NativeProposal = Omit<StoredProposal, \"decidedBy\"> & { decidedBy?: Actor };\n/** The hand-off gavel records under `content.agentRun`, in clicky-ui's CommentAgentRun shape. */\nexport type NativeAgentRun = {\n sessionId?: string;\n requestedAt: string;\n state: string;\n error?: string;\n target?: { label: string; channel?: string };\n /** The delivery's edits policy: a `propose` run answers with a proposal and never resolves the thread itself. */\n edits?: CommentEdits;\n};\n/** What a comment stored in `content`: the playground and extension write their own fields, and gavel records an agent hand-off. Editor, CLI and agent comments have none. */\nexport type Content = {\n /** The playground's own fields; only comments it wrote carry them. */\n playground?: Partial<StoredComment> & { page: string };\n /** The web page a browser extension commented on. */\n page?: { url: string; title: string };\n agentRun?: NativeAgentRun;\n};\nexport type NativeComment = {\n id: string;\n bodyMarkdown: string;\n author: Actor;\n target: Target;\n status: string;\n phase: CommentPhase;\n /** Who holds the thread; a delivery assigns the agent it hands the thread to. */\n assignee?: Actor | null;\n version: number;\n createdAt: string;\n updatedAt: string;\n content?: Content;\n messages?: NativeMessage[];\n attachments?: { id: string; name: string; messageId?: string }[];\n outcome?: { at: string; actor: Actor };\n};\nexport type Action = {\n id: string;\n expectedVersion: number;\n action: string;\n bodyMarkdown?: string;\n messageId?: string;\n content?: Content;\n target?: Target;\n assignee?: Actor | null;\n /** The resolution or closure summary. */\n summary?: string;\n evidence?: string[];\n /** `accept-proposal`: apply the proposed patch to the working tree or stage it in the index. */\n mode?: \"apply\" | \"stage\";\n};\n\nconst AGENT_RUN_STATES: readonly StoredAgentRun[\"state\"][] = [\"queued\", \"sent\", \"done\", \"error\"];\n\nexport function commentActor(author: StoredAuthor): Actor {\n return {\n kind: author.kind ?? \"user\",\n id: author.id ?? `${author.kind ?? \"user\"}:${author.name}`,\n label: author.name,\n };\n}\nexport const localUser: StoredAuthor = { name: \"You\", kind: \"user\" };\nexport const bodyFor = (comment: StoredComment) =>\n comment.body.trim()\n ? comment.body\n : comment.reviewDecision === \"approved\"\n ? \"Approved\"\n : comment.rating === \"positive\"\n ? \"Positive feedback\"\n : \"Negative feedback\";\nexport function contentFor(page: string, comment: StoredComment): Content {\n const {\n id: _id,\n version: _version,\n rootId: _rootId,\n createdAt: _created,\n updatedAt: _updated,\n status: _status,\n parentId: _parent,\n ...fields\n } = comment;\n return { playground: { ...fields, page } };\n}\nfunction authorFor(actor: Actor): StoredAuthor {\n return {\n id: actor.id,\n name: actor.label ?? actor.id,\n kind: actor.kind === \"agent\" ? \"agent\" : \"user\",\n };\n}\n/** A reply's author, naming the hand-off's session when an agent wrote it since the hand-off was requested. */\nfunction replyAuthorFor(message: NativeMessage, run: NativeAgentRun | undefined): StoredAuthor {\n const author = authorFor(message.author);\n const sessionId = run?.sessionId;\n const fromRun = sessionId && message.author.kind === \"agent\" && Date.parse(message.createdAt) >= Date.parse(run.requestedAt);\n return fromRun ? { ...author, sessionId } : author;\n}\n/** A proposal as the thread shows it: who decided it becomes an author. */\nexport function proposalFor(proposal: NativeProposal): StoredProposal {\n const { decidedBy, ...rest } = proposal;\n return { ...rest, ...(decidedBy ? { decidedBy: authorFor(decidedBy) } : {}) };\n}\n/** The first reply an agent wrote in the thread at or after the hand-off was requested. */\nfunction firstAgentReply(messages: NativeMessage[], requestedAt: string): string | undefined {\n const since = Date.parse(requestedAt);\n const times = messages\n .filter((m) => m.author.kind === \"agent\" && Date.parse(m.createdAt) >= since)\n .map((m) => Date.parse(m.createdAt));\n return times.length > 0 ? new Date(Math.min(...times)).toISOString() : undefined;\n}\nfunction agentRunFor(run: NativeAgentRun, messages: NativeMessage[]): StoredAgentRun {\n if (!AGENT_RUN_STATES.includes(run.state as StoredAgentRun[\"state\"]))\n throw new Error(`Unknown agent run state ${JSON.stringify(run.state)}; expected ${AGENT_RUN_STATES.join(\", \")}`);\n const repliedAt = firstAgentReply(messages, run.requestedAt);\n return {\n ...(repliedAt ? { repliedAt } : {}),\n ...(run.sessionId ? { sessionId: run.sessionId } : {}),\n requestedAt: run.requestedAt,\n state: run.state as StoredAgentRun[\"state\"],\n ...(run.error ? { error: run.error } : {}),\n ...(run.target ? { target: run.target } : {}),\n ...(run.edits ? { edits: run.edits } : {}),\n };\n}\n\nconst isRecord = (value: unknown): value is Record<string, unknown> => typeof value === \"object\" && value !== null && !Array.isArray(value);\n\n/** The comment components' anchor, and the selected words kept beside it, for a gavel selector. A selector gavel would not have accepted throws. */\nexport function anchorOfSelector(selector: unknown): { anchor?: string; quote?: TextQuote } {\n if (selector === undefined || selector === null) return {};\n if (!isRecord(selector) || typeof selector.kind !== \"string\") throw new Error(`a target selector must be an object with a kind, got ${JSON.stringify(selector)}`);\n const quote = isRecord(selector.quote) ? { quote: selector.quote as TextQuote } : {};\n switch (selector.kind) {\n case \"document\":\n return {};\n case \"code-range\":\n if (isRecord(selector.patch)) return { anchor: patchAnchor(selector.patch as PatchAnchor), ...quote };\n if (typeof selector.revision === \"string\" && hasCodeLines(selector)) return {};\n throw new Error(\"a code-range selector needs a patch or a revision and lines\");\n case \"diff-range\":\n if (hasCodeLines(selector) && typeof selector.baseCommit === \"string\" && typeof selector.headCommit === \"string\" && (selector.side === \"old\" || selector.side === \"new\")) return {};\n throw new Error(\"a diff-range selector needs a path, commits, side and lines\");\n case \"region\":\n return { anchor: regionAnchor(selector.region as RegionAnchor) };\n case \"dom\":\n if (typeof selector.anchor !== \"string\" || selector.anchor === \"\") throw new Error(\"a dom selector needs an anchor\");\n return { anchor: selector.anchor, ...quote };\n default:\n throw new Error(`unknown target selector kind ${JSON.stringify(selector.kind)}; expected document, code-range, region or dom`);\n }\n}\n\nfunction hasCodeLines(selector: Record<string, unknown>): boolean {\n const { path, startLine, endLine } = selector;\n return typeof path === \"string\" && path.length > 0\n && typeof startLine === \"number\" && Number.isInteger(startLine) && startLine > 0\n && typeof endLine === \"number\" && Number.isInteger(endLine) && endLine >= startLine;\n}\n\nconst isoOf = (time: string) => new Date(time).toISOString();\n\nexport function commentCaptureOf(c: NativeComment, attachmentUrl: (commentId: string, attachmentId: string) => string): CommentElementContext | undefined {\n const element = c.content?.playground?.element;\n const selector = isRecord(c.target.selector) ? c.target.selector : undefined;\n const html = typeof selector?.html === \"string\" ? selector.html : \"\";\n const image = c.attachments?.find(({ name, messageId }) => name === \"screenshot.png\" && !messageId);\n if (!element && !html && !image) return undefined;\n const pageUrl = element?.pageUrl ?? c.content?.page?.url;\n return {\n source: \"\",\n html,\n ...element,\n ...(pageUrl ? { pageUrl } : {}),\n ...(image ? { screenshot: { status: \"captured\", filename: \"screenshot.png\", url: attachmentUrl(c.id, image.id) } } : {}),\n };\n}\n\n/**\n * Any native thread in the comment components' shape, whoever wrote it: the\n * root, then its replies. Needs no playground metadata; the anchor and quote\n * come from the target's selector.\n */\nexport function projectNative(c: NativeComment): StoredComment[] {\n const { anchor, quote } = anchorOfSelector(c.target.selector);\n const root: StoredComment = {\n id: c.id,\n version: c.version,\n body: c.bodyMarkdown,\n author: authorFor(c.author),\n status: c.status,\n createdAt: isoOf(c.createdAt),\n ...(c.updatedAt !== c.createdAt ? { updatedAt: isoOf(c.updatedAt) } : {}),\n ...(c.assignee ? { assignee: authorFor(c.assignee) } : {}),\n ...(c.outcome ? { closedAt: isoOf(c.outcome.at), closedBy: authorFor(c.outcome.actor) } : {}),\n ...(anchor ? { anchor } : {}),\n ...(quote ? { quote } : {}),\n ...(c.content?.agentRun ? { agentRun: agentRunFor(c.content.agentRun, c.messages ?? []) } : {}),\n };\n return [\n root,\n ...(c.messages ?? []).map(\n (m): StoredComment => ({\n id: m.id,\n rootId: c.id,\n parentId: c.id,\n version: c.version,\n body: m.bodyMarkdown,\n author: replyAuthorFor(m, c.content?.agentRun),\n createdAt: isoOf(m.createdAt),\n anchor: root.anchor ?? null,\n ...(m.content?.proposal ? { proposal: proposalFor(m.content.proposal) } : {}),\n }),\n ),\n ];\n}\n\n/**\n * Opt-in projection for comments written by the playground or the extension,\n * which keep their own fields under `content.playground`; a comment without\n * them throws. `attachmentUrl` is where the host serves a comment's attachment: the playground proxies it, the extension reads gavel directly.\n */\nexport function project(\n c: NativeComment,\n options: { attachmentUrl: (commentId: string, attachmentId: string) => string },\n): StoredComment[] {\n const playground = c.content?.playground;\n if (!playground?.page)\n throw new Error(`Comment ${c.id} is missing playground metadata`);\n // Gavel owns the assignee; a copy left in the playground fields is never the current one.\n const { page: _page, assignee: _assignee, ...fields } = playground;\n const element = fields.element && commentCaptureOf(c, options.attachmentUrl);\n const root: StoredComment = {\n ...fields,\n id: c.id,\n version: c.version,\n body: fields.body === \"\" ? \"\" : c.bodyMarkdown,\n author: fields.author ?? authorFor(c.author),\n ...(c.assignee ? { assignee: authorFor(c.assignee) } : {}),\n status: c.status,\n createdAt: new Date(c.createdAt).toISOString(),\n ...(c.updatedAt !== c.createdAt\n ? { updatedAt: new Date(c.updatedAt).toISOString() }\n : {}),\n ...(c.outcome\n ? {\n closedAt: new Date(c.outcome.at).toISOString(),\n closedBy: fields.closedBy ?? authorFor(c.outcome.actor),\n }\n : {}),\n ...(element ? { element } : {}),\n ...(c.content?.agentRun ? { agentRun: agentRunFor(c.content.agentRun, c.messages ?? []) } : {}),\n };\n return [\n root,\n ...(c.messages ?? []).map((m) => ({\n ...m.content?.playground,\n ...(m.content?.proposal ? { proposal: proposalFor(m.content.proposal) } : {}),\n id: m.id,\n rootId: c.id,\n version: c.version,\n body: m.bodyMarkdown,\n author: m.content?.playground?.author ?? replyAuthorFor(m, c.content?.agentRun),\n createdAt: new Date(m.createdAt).toISOString(),\n parentId: c.id,\n anchor: root.anchor ?? null,\n })),\n ];\n}\n"],"mappings":";;;AAuFA,IAAM,mBAAuD;CAAC;CAAU;CAAQ;CAAQ;AAAO;AAE/F,SAAgB,aAAa,QAA6B;CACxD,OAAO;EACL,MAAM,OAAO,QAAQ;EACrB,IAAI,OAAO,MAAM,GAAG,OAAO,QAAQ,OAAO,GAAG,OAAO;EACpD,OAAO,OAAO;CAChB;AACF;AACA,IAAa,YAA0B;CAAE,MAAM;CAAO,MAAM;AAAO;AACnE,IAAa,WAAW,YACtB,QAAQ,KAAK,KAAK,IACd,QAAQ,OACR,QAAQ,mBAAmB,aACzB,aACA,QAAQ,WAAW,aACjB,sBACA;AACV,SAAgB,WAAW,MAAc,SAAiC;CACxE,MAAM,EACJ,IAAI,KACJ,SAAS,UACT,QAAQ,SACR,WAAW,UACX,WAAW,UACX,QAAQ,SACR,UAAU,SACV,GAAG,WACD;CACJ,OAAO,EAAE,YAAY;EAAE,GAAG;EAAQ;CAAK,EAAE;AAC3C;AACA,SAAS,UAAU,OAA4B;CAC7C,OAAO;EACL,IAAI,MAAM;EACV,MAAM,MAAM,SAAS,MAAM;EAC3B,MAAM,MAAM,SAAS,UAAU,UAAU;CAC3C;AACF;;AAEA,SAAS,eAAe,SAAwB,KAA+C;CAC7F,MAAM,SAAS,UAAU,QAAQ,MAAM;CACvC,MAAM,YAAY,KAAK;CAEvB,OADgB,aAAa,QAAQ,OAAO,SAAS,WAAW,KAAK,MAAM,QAAQ,SAAS,KAAK,KAAK,MAAM,IAAI,WAAW,IAC1G;EAAE,GAAG;EAAQ;CAAU,IAAI;AAC9C;;AAEA,SAAgB,YAA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xD,IACA,CAAC;EACL,GAAI,UAAU,EAAE,QAAQ,IAAI,CAAC;EAC7B,GAAI,EAAE,SAAS,WAAW,EAAE,UAAU,YAAY,EAAE,QAAQ,UAAU,EAAE,YAAY,CAAC,CAAC,EAAE,IAAI,CAAC;CAC/F;CACA,OAAO,CACL,MACA,IAAI,EAAE,YAAY,CAAC,EAAA,CAAG,KAAK,OAAO;EAChC,GAAG,EAAE,SAAS;EACd,GAAI,EAAE,SAAS,WAAW,EAAE,UAAU,YAAY,EAAE,QAAQ,QAAQ,EAAE,IAAI,CAAC;EAC3E,IAAI,EAAE;EACN,QAAQ,EAAE;EACV,SAAS,EAAE;EACX,MAAM,EAAE;EACR,QAAQ,EAAE,SAAS,YAAY,UAAU,eAAe,GAAG,EAAE,SAAS,QAAQ;EAC9E,WAAW,IAAI,KAAK,EAAE,SAAS,CAAC,CAAC,YAAY;EAC7C,UAAU,EAAE;EACZ,QAAQ,KAAK,UAAU;CACzB,EAAE,CACJ;AACF"}
@@ -1,5 +1,6 @@
1
1
  import { TextQuote } from '../annotation-types.js';
2
2
  import { StoredAuthor, StoredComment, StoredProposal } from './comments-store.js';
3
+ import { CommentElementContext } from './comments-model.js';
3
4
  import { CommentEdits } from './gavel-delivery.js';
4
5
  /** The workflow phase gavel files a thread under. */
5
6
  export type CommentPhase = "active" | "awaiting_outcome" | "final";
@@ -72,6 +73,7 @@ export type NativeComment = {
72
73
  attachments?: {
73
74
  id: string;
74
75
  name: string;
76
+ messageId?: string;
75
77
  }[];
76
78
  outcome?: {
77
79
  at: string;
@@ -104,6 +106,7 @@ export declare function anchorOfSelector(selector: unknown): {
104
106
  anchor?: string;
105
107
  quote?: TextQuote;
106
108
  };
109
+ export declare function commentCaptureOf(c: NativeComment, attachmentUrl: (commentId: string, attachmentId: string) => string): CommentElementContext | undefined;
107
110
  /**
108
111
  * Any native thread in the comment components' shape, whoever wrote it: the
109
112
  * root, then its replies. Needs no playground metadata; the anchor and quote
@@ -1 +1 @@
1
- {"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