ontrackd 0.0.1 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (684) hide show
  1. package/LICENSE +14 -0
  2. package/README.md +126 -2
  3. package/dist/cli/build.d.ts +1 -0
  4. package/dist/cli/build.js +172 -0
  5. package/dist/cli/build.js.map +1 -0
  6. package/dist/cli/cloud.d.ts +20 -0
  7. package/dist/cli/cloud.js +395 -0
  8. package/dist/cli/cloud.js.map +1 -0
  9. package/dist/cli/feedback.d.ts +4 -0
  10. package/dist/cli/feedback.js +90 -0
  11. package/dist/cli/feedback.js.map +1 -0
  12. package/dist/cli/hugo.d.ts +1 -0
  13. package/dist/cli/hugo.js +396 -0
  14. package/dist/cli/hugo.js.map +1 -0
  15. package/dist/cli/init.d.ts +8 -0
  16. package/dist/cli/init.js +346 -0
  17. package/dist/cli/init.js.map +1 -0
  18. package/dist/cli/invite.d.ts +2 -0
  19. package/dist/cli/invite.js +65 -0
  20. package/dist/cli/invite.js.map +1 -0
  21. package/dist/cli/link.d.ts +20 -0
  22. package/dist/cli/link.js +287 -0
  23. package/dist/cli/link.js.map +1 -0
  24. package/dist/cli/pull.d.ts +31 -0
  25. package/dist/cli/pull.js +273 -0
  26. package/dist/cli/pull.js.map +1 -0
  27. package/dist/cli/push.d.ts +9 -0
  28. package/dist/cli/push.js +57 -0
  29. package/dist/cli/push.js.map +1 -0
  30. package/dist/cli/remote.d.ts +1 -0
  31. package/dist/cli/remote.js +114 -0
  32. package/dist/cli/remote.js.map +1 -0
  33. package/dist/cli/serve.d.ts +1 -0
  34. package/dist/cli/serve.js +178 -0
  35. package/dist/cli/serve.js.map +1 -0
  36. package/dist/cli/sidecar.d.ts +9 -0
  37. package/dist/cli/sidecar.js +23 -0
  38. package/dist/cli/sidecar.js.map +1 -0
  39. package/dist/core/anchorId.d.ts +42 -0
  40. package/dist/core/anchorId.js +50 -0
  41. package/dist/core/anchorId.js.map +1 -0
  42. package/dist/core/apiKind.d.ts +42 -0
  43. package/dist/core/apiKind.js +83 -0
  44. package/dist/core/apiKind.js.map +1 -0
  45. package/dist/core/astroAnchors.d.ts +39 -0
  46. package/dist/core/astroAnchors.js +217 -0
  47. package/dist/core/astroAnchors.js.map +1 -0
  48. package/dist/core/attachmentTypes.d.ts +74 -0
  49. package/dist/core/attachmentTypes.js +199 -0
  50. package/dist/core/attachmentTypes.js.map +1 -0
  51. package/dist/core/elementHints.d.ts +40 -0
  52. package/dist/core/elementHints.js +116 -0
  53. package/dist/core/elementHints.js.map +1 -0
  54. package/dist/core/exportTaskDoc.d.ts +81 -0
  55. package/dist/core/exportTaskDoc.js +828 -0
  56. package/dist/core/exportTaskDoc.js.map +1 -0
  57. package/dist/core/feedbackTypes.d.ts +241 -0
  58. package/dist/core/feedbackTypes.js +2 -0
  59. package/dist/core/feedbackTypes.js.map +1 -0
  60. package/dist/core/fingerprint.d.ts +12 -0
  61. package/dist/core/fingerprint.js +24 -0
  62. package/dist/core/fingerprint.js.map +1 -0
  63. package/dist/core/htmlAnchors.d.ts +18 -0
  64. package/dist/core/htmlAnchors.js +157 -0
  65. package/dist/core/htmlAnchors.js.map +1 -0
  66. package/dist/core/imageSniff.d.ts +7 -0
  67. package/dist/core/imageSniff.js +12 -0
  68. package/dist/core/imageSniff.js.map +1 -0
  69. package/dist/core/ordering.d.ts +16 -0
  70. package/dist/core/ordering.js +10 -0
  71. package/dist/core/ordering.js.map +1 -0
  72. package/dist/core/oxcAst.d.ts +39 -0
  73. package/dist/core/oxcAst.js +147 -0
  74. package/dist/core/oxcAst.js.map +1 -0
  75. package/dist/core/pageUrl.d.ts +10 -0
  76. package/dist/core/pageUrl.js +27 -0
  77. package/dist/core/pageUrl.js.map +1 -0
  78. package/dist/core/participants.d.ts +14 -0
  79. package/dist/core/participants.js +38 -0
  80. package/dist/core/participants.js.map +1 -0
  81. package/dist/core/ports.d.ts +86 -0
  82. package/dist/core/ports.js +2 -0
  83. package/dist/core/ports.js.map +1 -0
  84. package/dist/core/projectSecret.d.ts +9 -0
  85. package/dist/core/projectSecret.js +57 -0
  86. package/dist/core/projectSecret.js.map +1 -0
  87. package/dist/core/recipe.d.ts +117 -0
  88. package/dist/core/recipe.js +181 -0
  89. package/dist/core/recipe.js.map +1 -0
  90. package/dist/core/recordingSummary.d.ts +12 -0
  91. package/dist/core/recordingSummary.js +150 -0
  92. package/dist/core/recordingSummary.js.map +1 -0
  93. package/dist/core/resolveAnchors.d.ts +70 -0
  94. package/dist/core/resolveAnchors.js +101 -0
  95. package/dist/core/resolveAnchors.js.map +1 -0
  96. package/dist/core/scriptImport.d.ts +10 -0
  97. package/dist/core/scriptImport.js +18 -0
  98. package/dist/core/scriptImport.js.map +1 -0
  99. package/dist/core/sourceAnchors.d.ts +62 -0
  100. package/dist/core/sourceAnchors.js +82 -0
  101. package/dist/core/sourceAnchors.js.map +1 -0
  102. package/dist/core/sourceContext.d.ts +62 -0
  103. package/dist/core/sourceContext.js +182 -0
  104. package/dist/core/sourceContext.js.map +1 -0
  105. package/dist/core/sourcePath.d.ts +2 -0
  106. package/dist/core/sourcePath.js +11 -0
  107. package/dist/core/sourcePath.js.map +1 -0
  108. package/dist/core/staleness.d.ts +118 -0
  109. package/dist/core/staleness.js +155 -0
  110. package/dist/core/staleness.js.map +1 -0
  111. package/dist/core/styleOrigin.d.ts +98 -0
  112. package/dist/core/styleOrigin.js +142 -0
  113. package/dist/core/styleOrigin.js.map +1 -0
  114. package/dist/core/svelteAnchors.d.ts +18 -0
  115. package/dist/core/svelteAnchors.js +125 -0
  116. package/dist/core/svelteAnchors.js.map +1 -0
  117. package/dist/core/taskFiles.d.ts +31 -0
  118. package/dist/core/taskFiles.js +55 -0
  119. package/dist/core/taskFiles.js.map +1 -0
  120. package/dist/core/untrusted.d.ts +57 -0
  121. package/dist/core/untrusted.js +268 -0
  122. package/dist/core/untrusted.js.map +1 -0
  123. package/dist/core/vueAnchors.d.ts +21 -0
  124. package/dist/core/vueAnchors.js +130 -0
  125. package/dist/core/vueAnchors.js.map +1 -0
  126. package/dist/expo/app/Avatar.d.ts +6 -0
  127. package/dist/expo/app/Avatar.js +12 -0
  128. package/dist/expo/app/Avatar.js.map +1 -0
  129. package/dist/expo/app/Bars.d.ts +9 -0
  130. package/dist/expo/app/Bars.js +38 -0
  131. package/dist/expo/app/Bars.js.map +1 -0
  132. package/dist/expo/app/CommentThreadSheet.d.ts +35 -0
  133. package/dist/expo/app/CommentThreadSheet.js +200 -0
  134. package/dist/expo/app/CommentThreadSheet.js.map +1 -0
  135. package/dist/expo/app/CommentsSheet.d.ts +22 -0
  136. package/dist/expo/app/CommentsSheet.js +76 -0
  137. package/dist/expo/app/CommentsSheet.js.map +1 -0
  138. package/dist/expo/app/Files.d.ts +16 -0
  139. package/dist/expo/app/Files.js +62 -0
  140. package/dist/expo/app/Files.js.map +1 -0
  141. package/dist/expo/app/Highlight.d.ts +5 -0
  142. package/dist/expo/app/Highlight.js +12 -0
  143. package/dist/expo/app/Highlight.js.map +1 -0
  144. package/dist/expo/app/Icon.d.ts +9 -0
  145. package/dist/expo/app/Icon.js +22 -0
  146. package/dist/expo/app/Icon.js.map +1 -0
  147. package/dist/expo/app/MarkerPins.d.ts +10 -0
  148. package/dist/expo/app/MarkerPins.js +70 -0
  149. package/dist/expo/app/MarkerPins.js.map +1 -0
  150. package/dist/expo/app/Provider.d.ts +13 -0
  151. package/dist/expo/app/Provider.js +597 -0
  152. package/dist/expo/app/Provider.js.map +1 -0
  153. package/dist/expo/app/Sheet.d.ts +53 -0
  154. package/dist/expo/app/Sheet.js +106 -0
  155. package/dist/expo/app/Sheet.js.map +1 -0
  156. package/dist/expo/app/Toolbar.d.ts +26 -0
  157. package/dist/expo/app/Toolbar.js +71 -0
  158. package/dist/expo/app/Toolbar.js.map +1 -0
  159. package/dist/expo/app/adapter.d.ts +55 -0
  160. package/dist/expo/app/adapter.js +145 -0
  161. package/dist/expo/app/adapter.js.map +1 -0
  162. package/dist/expo/app/api.d.ts +68 -0
  163. package/dist/expo/app/api.js +86 -0
  164. package/dist/expo/app/api.js.map +1 -0
  165. package/dist/expo/app/assets/attach.png +0 -0
  166. package/dist/expo/app/assets/close.png +0 -0
  167. package/dist/expo/app/assets/comment.png +0 -0
  168. package/dist/expo/app/assets/edit.png +0 -0
  169. package/dist/expo/app/assets/file.png +0 -0
  170. package/dist/expo/app/assets/narrow.png +0 -0
  171. package/dist/expo/app/assets/panel.png +0 -0
  172. package/dist/expo/app/assets/pins.png +0 -0
  173. package/dist/expo/app/assets/pinsOff.png +0 -0
  174. package/dist/expo/app/assets/remove.png +0 -0
  175. package/dist/expo/app/assets/reopen.png +0 -0
  176. package/dist/expo/app/assets/resolve.png +0 -0
  177. package/dist/expo/app/assets/send.png +0 -0
  178. package/dist/expo/app/assets/widen.png +0 -0
  179. package/dist/expo/app/attachments.d.ts +93 -0
  180. package/dist/expo/app/attachments.js +181 -0
  181. package/dist/expo/app/attachments.js.map +1 -0
  182. package/dist/expo/app/cloudApi.d.ts +63 -0
  183. package/dist/expo/app/cloudApi.js +330 -0
  184. package/dist/expo/app/cloudApi.js.map +1 -0
  185. package/dist/expo/app/cloudAuth.d.ts +20 -0
  186. package/dist/expo/app/cloudAuth.js +71 -0
  187. package/dist/expo/app/cloudAuth.js.map +1 -0
  188. package/dist/expo/app/cloudHttp.d.ts +20 -0
  189. package/dist/expo/app/cloudHttp.js +46 -0
  190. package/dist/expo/app/cloudHttp.js.map +1 -0
  191. package/dist/expo/app/cloudSession.d.ts +30 -0
  192. package/dist/expo/app/cloudSession.js +72 -0
  193. package/dist/expo/app/cloudSession.js.map +1 -0
  194. package/dist/expo/app/comments.d.ts +20 -0
  195. package/dist/expo/app/comments.js +131 -0
  196. package/dist/expo/app/comments.js.map +1 -0
  197. package/dist/expo/app/devMenuNone.d.ts +5 -0
  198. package/dist/expo/app/devMenuNone.js +3 -0
  199. package/dist/expo/app/devMenuNone.js.map +1 -0
  200. package/dist/expo/app/devServerNone.d.ts +4 -0
  201. package/dist/expo/app/devServerNone.js +4 -0
  202. package/dist/expo/app/devServerNone.js.map +1 -0
  203. package/dist/expo/app/embeddedConfig.d.ts +1 -0
  204. package/dist/expo/app/embeddedConfig.js +12 -0
  205. package/dist/expo/app/embeddedConfig.js.map +1 -0
  206. package/dist/expo/app/embeddedConfigCloud.d.ts +2 -0
  207. package/dist/expo/app/embeddedConfigCloud.js +8 -0
  208. package/dist/expo/app/embeddedConfigCloud.js.map +1 -0
  209. package/dist/expo/app/embeddedConfigNone.d.ts +2 -0
  210. package/dist/expo/app/embeddedConfigNone.js +3 -0
  211. package/dist/expo/app/embeddedConfigNone.js.map +1 -0
  212. package/dist/expo/app/expo.d.ts +4 -0
  213. package/dist/expo/app/expo.js +35 -0
  214. package/dist/expo/app/expo.js.map +1 -0
  215. package/dist/expo/app/expoGo.d.ts +4 -0
  216. package/dist/expo/app/expoGo.js +33 -0
  217. package/dist/expo/app/expoGo.js.map +1 -0
  218. package/dist/expo/app/expoPickers.d.ts +11 -0
  219. package/dist/expo/app/expoPickers.js +91 -0
  220. package/dist/expo/app/expoPickers.js.map +1 -0
  221. package/dist/expo/app/expoRandom.d.ts +6 -0
  222. package/dist/expo/app/expoRandom.js +21 -0
  223. package/dist/expo/app/expoRandom.js.map +1 -0
  224. package/dist/expo/app/idle.d.ts +4 -0
  225. package/dist/expo/app/idle.js +7 -0
  226. package/dist/expo/app/idle.js.map +1 -0
  227. package/dist/expo/app/index.d.ts +3 -0
  228. package/dist/expo/app/index.js +3 -0
  229. package/dist/expo/app/index.js.map +1 -0
  230. package/dist/expo/app/interactions.d.ts +38 -0
  231. package/dist/expo/app/interactions.js +40 -0
  232. package/dist/expo/app/interactions.js.map +1 -0
  233. package/dist/expo/app/markers.d.ts +28 -0
  234. package/dist/expo/app/markers.js +187 -0
  235. package/dist/expo/app/markers.js.map +1 -0
  236. package/dist/expo/app/movedAnchors.d.ts +46 -0
  237. package/dist/expo/app/movedAnchors.js +39 -0
  238. package/dist/expo/app/movedAnchors.js.map +1 -0
  239. package/dist/expo/app/native.d.ts +12 -0
  240. package/dist/expo/app/native.js +78 -0
  241. package/dist/expo/app/native.js.map +1 -0
  242. package/dist/expo/app/panel.d.ts +27 -0
  243. package/dist/expo/app/panel.js +37 -0
  244. package/dist/expo/app/panel.js.map +1 -0
  245. package/dist/expo/app/payload.d.ts +43 -0
  246. package/dist/expo/app/payload.js +22 -0
  247. package/dist/expo/app/payload.js.map +1 -0
  248. package/dist/expo/app/pick.d.ts +14 -0
  249. package/dist/expo/app/pick.js +124 -0
  250. package/dist/expo/app/pick.js.map +1 -0
  251. package/dist/expo/app/pickerNone.d.ts +1 -0
  252. package/dist/expo/app/pickerNone.js +2 -0
  253. package/dist/expo/app/pickerNone.js.map +1 -0
  254. package/dist/expo/app/placement.d.ts +53 -0
  255. package/dist/expo/app/placement.js +100 -0
  256. package/dist/expo/app/placement.js.map +1 -0
  257. package/dist/expo/app/random.d.ts +13 -0
  258. package/dist/expo/app/random.js +56 -0
  259. package/dist/expo/app/random.js.map +1 -0
  260. package/dist/expo/app/reactNative.d.ts +2 -0
  261. package/dist/expo/app/reactNative.js +3 -0
  262. package/dist/expo/app/reactNative.js.map +1 -0
  263. package/dist/expo/app/runtimeConfig.d.ts +30 -0
  264. package/dist/expo/app/runtimeConfig.js +104 -0
  265. package/dist/expo/app/runtimeConfig.js.map +1 -0
  266. package/dist/expo/app/sheetMotion.d.ts +22 -0
  267. package/dist/expo/app/sheetMotion.js +39 -0
  268. package/dist/expo/app/sheetMotion.js.map +1 -0
  269. package/dist/expo/app/signIn.d.ts +32 -0
  270. package/dist/expo/app/signIn.js +28 -0
  271. package/dist/expo/app/signIn.js.map +1 -0
  272. package/dist/expo/app/state.d.ts +45 -0
  273. package/dist/expo/app/state.js +32 -0
  274. package/dist/expo/app/state.js.map +1 -0
  275. package/dist/expo/app/theme.d.ts +15 -0
  276. package/dist/expo/app/theme.js +9 -0
  277. package/dist/expo/app/theme.js.map +1 -0
  278. package/dist/expo/app/types.d.ts +87 -0
  279. package/dist/expo/app/types.js +2 -0
  280. package/dist/expo/app/types.js.map +1 -0
  281. package/dist/expo/app/useCloudReviewer.d.ts +75 -0
  282. package/dist/expo/app/useCloudReviewer.js +211 -0
  283. package/dist/expo/app/useCloudReviewer.js.map +1 -0
  284. package/dist/expo/app/useComments.d.ts +64 -0
  285. package/dist/expo/app/useComments.js +156 -0
  286. package/dist/expo/app/useComments.js.map +1 -0
  287. package/dist/expo/app/useUploads.d.ts +32 -0
  288. package/dist/expo/app/useUploads.js +106 -0
  289. package/dist/expo/app/useUploads.js.map +1 -0
  290. package/dist/expo/expoGoMetro.cjs +83 -0
  291. package/dist/expo/expoMetro.cjs +86 -0
  292. package/dist/expo/metro.cjs +304 -0
  293. package/dist/expo/metroBuild.d.ts +22 -0
  294. package/dist/expo/metroBuild.js +169 -0
  295. package/dist/expo/metroBuild.js.map +1 -0
  296. package/dist/expo/middleware.d.ts +11 -0
  297. package/dist/expo/middleware.js +26 -0
  298. package/dist/expo/middleware.js.map +1 -0
  299. package/dist/expo/mode.d.ts +20 -0
  300. package/dist/expo/mode.js +37 -0
  301. package/dist/expo/mode.js.map +1 -0
  302. package/dist/expo/publicConfig.d.ts +37 -0
  303. package/dist/expo/publicConfig.js +87 -0
  304. package/dist/expo/publicConfig.js.map +1 -0
  305. package/dist/expo/transform.d.ts +22 -0
  306. package/dist/expo/transform.js +38 -0
  307. package/dist/expo/transform.js.map +1 -0
  308. package/dist/expo/transformer.cjs +73 -0
  309. package/dist/index.d.ts +21 -0
  310. package/dist/index.js +17 -0
  311. package/dist/index.js.map +1 -0
  312. package/dist/integration/apiRoutes.d.ts +2 -0
  313. package/dist/integration/apiRoutes.js +3 -0
  314. package/dist/integration/apiRoutes.js.map +1 -0
  315. package/dist/integration/buildCredentials.d.ts +12 -0
  316. package/dist/integration/buildCredentials.js +97 -0
  317. package/dist/integration/buildCredentials.js.map +1 -0
  318. package/dist/integration/buildSession.d.ts +8 -0
  319. package/dist/integration/buildSession.js +96 -0
  320. package/dist/integration/buildSession.js.map +1 -0
  321. package/dist/integration/bundleCheck.d.ts +43 -0
  322. package/dist/integration/bundleCheck.js +111 -0
  323. package/dist/integration/bundleCheck.js.map +1 -0
  324. package/dist/integration/commentPull.d.ts +134 -0
  325. package/dist/integration/commentPull.js +260 -0
  326. package/dist/integration/commentPull.js.map +1 -0
  327. package/dist/integration/configuredApi.d.ts +7 -0
  328. package/dist/integration/configuredApi.js +24 -0
  329. package/dist/integration/configuredApi.js.map +1 -0
  330. package/dist/integration/devCloud.d.ts +27 -0
  331. package/dist/integration/devCloud.js +56 -0
  332. package/dist/integration/devCloud.js.map +1 -0
  333. package/dist/integration/devReviewLinks.d.ts +2 -0
  334. package/dist/integration/devReviewLinks.js +10 -0
  335. package/dist/integration/devReviewLinks.js.map +1 -0
  336. package/dist/integration/gitBranch.d.ts +19 -0
  337. package/dist/integration/gitBranch.js +56 -0
  338. package/dist/integration/gitBranch.js.map +1 -0
  339. package/dist/integration/importPlan.d.ts +19 -0
  340. package/dist/integration/importPlan.js +90 -0
  341. package/dist/integration/importPlan.js.map +1 -0
  342. package/dist/integration/index.d.ts +14 -0
  343. package/dist/integration/index.js +13 -0
  344. package/dist/integration/index.js.map +1 -0
  345. package/dist/integration/manifest.d.ts +120 -0
  346. package/dist/integration/manifest.js +147 -0
  347. package/dist/integration/manifest.js.map +1 -0
  348. package/dist/integration/manifestParts.d.ts +29 -0
  349. package/dist/integration/manifestParts.js +65 -0
  350. package/dist/integration/manifestParts.js.map +1 -0
  351. package/dist/integration/manifestSink.d.ts +75 -0
  352. package/dist/integration/manifestSink.js +157 -0
  353. package/dist/integration/manifestSink.js.map +1 -0
  354. package/dist/integration/manifestUpload.d.ts +64 -0
  355. package/dist/integration/manifestUpload.js +177 -0
  356. package/dist/integration/manifestUpload.js.map +1 -0
  357. package/dist/integration/middleware.d.ts +55 -0
  358. package/dist/integration/middleware.js +379 -0
  359. package/dist/integration/middleware.js.map +1 -0
  360. package/dist/integration/nextStyles.d.ts +4 -0
  361. package/dist/integration/nextStyles.js +121 -0
  362. package/dist/integration/nextStyles.js.map +1 -0
  363. package/dist/integration/requestGuards.d.ts +71 -0
  364. package/dist/integration/requestGuards.js +255 -0
  365. package/dist/integration/requestGuards.js.map +1 -0
  366. package/dist/integration/sharedBuild.d.ts +71 -0
  367. package/dist/integration/sharedBuild.js +105 -0
  368. package/dist/integration/sharedBuild.js.map +1 -0
  369. package/dist/integration/sharedInject.d.ts +88 -0
  370. package/dist/integration/sharedInject.js +164 -0
  371. package/dist/integration/sharedInject.js.map +1 -0
  372. package/dist/integration/sidecarProcess.d.ts +26 -0
  373. package/dist/integration/sidecarProcess.js +137 -0
  374. package/dist/integration/sidecarProcess.js.map +1 -0
  375. package/dist/integration/styleCollector.d.ts +49 -0
  376. package/dist/integration/styleCollector.js +220 -0
  377. package/dist/integration/styleCollector.js.map +1 -0
  378. package/dist/integration/transform.d.ts +24 -0
  379. package/dist/integration/transform.js +36 -0
  380. package/dist/integration/transform.js.map +1 -0
  381. package/dist/integration/tunnelClient.d.ts +44 -0
  382. package/dist/integration/tunnelClient.js +148 -0
  383. package/dist/integration/tunnelClient.js.map +1 -0
  384. package/dist/integration/tunnelProtocol.d.ts +152 -0
  385. package/dist/integration/tunnelProtocol.js +110 -0
  386. package/dist/integration/tunnelProtocol.js.map +1 -0
  387. package/dist/mcp/cli.d.ts +2 -0
  388. package/dist/mcp/cli.js +327 -0
  389. package/dist/mcp/cli.js.map +1 -0
  390. package/dist/mcp/cloudRefresh.d.ts +36 -0
  391. package/dist/mcp/cloudRefresh.js +52 -0
  392. package/dist/mcp/cloudRefresh.js.map +1 -0
  393. package/dist/mcp/context.d.ts +7 -0
  394. package/dist/mcp/context.js +18 -0
  395. package/dist/mcp/context.js.map +1 -0
  396. package/dist/mcp/files.d.ts +66 -0
  397. package/dist/mcp/files.js +157 -0
  398. package/dist/mcp/files.js.map +1 -0
  399. package/dist/mcp/search.d.ts +3 -0
  400. package/dist/mcp/search.js +9 -0
  401. package/dist/mcp/search.js.map +1 -0
  402. package/dist/mcp/server.d.ts +50 -0
  403. package/dist/mcp/server.js +555 -0
  404. package/dist/mcp/server.js.map +1 -0
  405. package/dist/overlay/anchors.d.ts +130 -0
  406. package/dist/overlay/anchors.js +365 -0
  407. package/dist/overlay/anchors.js.map +1 -0
  408. package/dist/overlay/api.d.ts +150 -0
  409. package/dist/overlay/api.js +259 -0
  410. package/dist/overlay/api.js.map +1 -0
  411. package/dist/overlay/attachments.d.ts +60 -0
  412. package/dist/overlay/attachments.js +163 -0
  413. package/dist/overlay/attachments.js.map +1 -0
  414. package/dist/overlay/browser.d.ts +1 -0
  415. package/dist/overlay/browser.js +203 -0
  416. package/dist/overlay/browser.js.map +1 -0
  417. package/dist/overlay/chip.d.ts +27 -0
  418. package/dist/overlay/chip.js +31 -0
  419. package/dist/overlay/chip.js.map +1 -0
  420. package/dist/overlay/compact.d.ts +11 -0
  421. package/dist/overlay/compact.js +21 -0
  422. package/dist/overlay/compact.js.map +1 -0
  423. package/dist/overlay/cssScope.d.ts +46 -0
  424. package/dist/overlay/cssScope.js +180 -0
  425. package/dist/overlay/cssScope.js.map +1 -0
  426. package/dist/overlay/cursor.d.ts +2 -0
  427. package/dist/overlay/cursor.js +68 -0
  428. package/dist/overlay/cursor.js.map +1 -0
  429. package/dist/overlay/devBrowser.d.ts +1 -0
  430. package/dist/overlay/devBrowser.js +18 -0
  431. package/dist/overlay/devBrowser.js.map +1 -0
  432. package/dist/overlay/devReview.d.ts +4 -0
  433. package/dist/overlay/devReview.js +18 -0
  434. package/dist/overlay/devReview.js.map +1 -0
  435. package/dist/overlay/directReviewer.d.ts +149 -0
  436. package/dist/overlay/directReviewer.js +448 -0
  437. package/dist/overlay/directReviewer.js.map +1 -0
  438. package/dist/overlay/elementDescription.d.ts +10 -0
  439. package/dist/overlay/elementDescription.js +251 -0
  440. package/dist/overlay/elementDescription.js.map +1 -0
  441. package/dist/overlay/icons.d.ts +8 -0
  442. package/dist/overlay/icons.js +36 -0
  443. package/dist/overlay/icons.js.map +1 -0
  444. package/dist/overlay/identity.d.ts +48 -0
  445. package/dist/overlay/identity.js +125 -0
  446. package/dist/overlay/identity.js.map +1 -0
  447. package/dist/overlay/localMachine.d.ts +23 -0
  448. package/dist/overlay/localMachine.js +40 -0
  449. package/dist/overlay/localMachine.js.map +1 -0
  450. package/dist/overlay/magicLink.d.ts +10 -0
  451. package/dist/overlay/magicLink.js +87 -0
  452. package/dist/overlay/magicLink.js.map +1 -0
  453. package/dist/overlay/modern-screenshot.js +1676 -0
  454. package/dist/overlay/movedAnchors.d.ts +30 -0
  455. package/dist/overlay/movedAnchors.js +128 -0
  456. package/dist/overlay/movedAnchors.js.map +1 -0
  457. package/dist/overlay/notificationGroups.d.ts +2 -0
  458. package/dist/overlay/notificationGroups.js +41 -0
  459. package/dist/overlay/notificationGroups.js.map +1 -0
  460. package/dist/overlay/permissions.d.ts +10 -0
  461. package/dist/overlay/permissions.js +9 -0
  462. package/dist/overlay/permissions.js.map +1 -0
  463. package/dist/overlay/pinGroups.d.ts +16 -0
  464. package/dist/overlay/pinGroups.js +17 -0
  465. package/dist/overlay/pinGroups.js.map +1 -0
  466. package/dist/overlay/presence.d.ts +50 -0
  467. package/dist/overlay/presence.js +258 -0
  468. package/dist/overlay/presence.js.map +1 -0
  469. package/dist/overlay/projectChannel.d.ts +11 -0
  470. package/dist/overlay/projectChannel.js +111 -0
  471. package/dist/overlay/projectChannel.js.map +1 -0
  472. package/dist/overlay/recorder.d.ts +56 -0
  473. package/dist/overlay/recorder.js +130 -0
  474. package/dist/overlay/recorder.js.map +1 -0
  475. package/dist/overlay/reviewMode.d.ts +21 -0
  476. package/dist/overlay/reviewMode.js +59 -0
  477. package/dist/overlay/reviewMode.js.map +1 -0
  478. package/dist/overlay/reviewerAuth.d.ts +131 -0
  479. package/dist/overlay/reviewerAuth.js +279 -0
  480. package/dist/overlay/reviewerAuth.js.map +1 -0
  481. package/dist/overlay/route.d.ts +18 -0
  482. package/dist/overlay/route.js +56 -0
  483. package/dist/overlay/route.js.map +1 -0
  484. package/dist/overlay/rrweb-record.js +63 -0
  485. package/dist/overlay/runtime.d.ts +1 -0
  486. package/dist/overlay/runtime.js +4857 -0
  487. package/dist/overlay/runtime.js.map +1 -0
  488. package/dist/overlay/session.d.ts +32 -0
  489. package/dist/overlay/session.js +76 -0
  490. package/dist/overlay/session.js.map +1 -0
  491. package/dist/overlay/sharedMode.d.ts +38 -0
  492. package/dist/overlay/sharedMode.js +37 -0
  493. package/dist/overlay/sharedMode.js.map +1 -0
  494. package/dist/overlay/sheet.d.ts +73 -0
  495. package/dist/overlay/sheet.js +278 -0
  496. package/dist/overlay/sheet.js.map +1 -0
  497. package/dist/overlay/snapshot.d.ts +26 -0
  498. package/dist/overlay/snapshot.js +185 -0
  499. package/dist/overlay/snapshot.js.map +1 -0
  500. package/dist/overlay/state.d.ts +63 -0
  501. package/dist/overlay/state.js +241 -0
  502. package/dist/overlay/state.js.map +1 -0
  503. package/dist/overlay/steps.d.ts +22 -0
  504. package/dist/overlay/steps.js +34 -0
  505. package/dist/overlay/steps.js.map +1 -0
  506. package/dist/overlay/styles.d.ts +7 -0
  507. package/dist/overlay/styles.js +1449 -0
  508. package/dist/overlay/styles.js.map +1 -0
  509. package/dist/overlay/trace.d.ts +19 -0
  510. package/dist/overlay/trace.js +29 -0
  511. package/dist/overlay/trace.js.map +1 -0
  512. package/dist/overlay/upload.d.ts +35 -0
  513. package/dist/overlay/upload.js +99 -0
  514. package/dist/overlay/upload.js.map +1 -0
  515. package/dist/plugin/astro.d.ts +31 -0
  516. package/dist/plugin/astro.js +22 -0
  517. package/dist/plugin/astro.js.map +1 -0
  518. package/dist/plugin/eleventy.d.ts +44 -0
  519. package/dist/plugin/eleventy.js +186 -0
  520. package/dist/plugin/eleventy.js.map +1 -0
  521. package/dist/plugin/next-loader.cjs +11 -0
  522. package/dist/plugin/next.d.ts +29 -0
  523. package/dist/plugin/next.js +176 -0
  524. package/dist/plugin/next.js.map +1 -0
  525. package/dist/plugin/nextOverlay.d.ts +2 -0
  526. package/dist/plugin/nextOverlay.js +22 -0
  527. package/dist/plugin/nextOverlay.js.map +1 -0
  528. package/dist/plugin/nextTransform.d.ts +19 -0
  529. package/dist/plugin/nextTransform.js +29 -0
  530. package/dist/plugin/nextTransform.js.map +1 -0
  531. package/dist/plugin/rsbuild.d.ts +25 -0
  532. package/dist/plugin/rsbuild.js +56 -0
  533. package/dist/plugin/rsbuild.js.map +1 -0
  534. package/dist/plugin/vite.d.ts +39 -0
  535. package/dist/plugin/vite.js +582 -0
  536. package/dist/plugin/vite.js.map +1 -0
  537. package/dist/plugin/webpack.d.ts +69 -0
  538. package/dist/plugin/webpack.js +192 -0
  539. package/dist/plugin/webpack.js.map +1 -0
  540. package/dist/remote/account.d.ts +41 -0
  541. package/dist/remote/account.js +177 -0
  542. package/dist/remote/account.js.map +1 -0
  543. package/dist/remote/base64url.d.ts +14 -0
  544. package/dist/remote/base64url.js +71 -0
  545. package/dist/remote/base64url.js.map +1 -0
  546. package/dist/remote/branchLabel.d.ts +12 -0
  547. package/dist/remote/branchLabel.js +20 -0
  548. package/dist/remote/branchLabel.js.map +1 -0
  549. package/dist/remote/client.d.ts +340 -0
  550. package/dist/remote/client.js +424 -0
  551. package/dist/remote/client.js.map +1 -0
  552. package/dist/remote/cloudApi.d.ts +72 -0
  553. package/dist/remote/cloudApi.js +72 -0
  554. package/dist/remote/cloudApi.js.map +1 -0
  555. package/dist/remote/codec.d.ts +54 -0
  556. package/dist/remote/codec.js +62 -0
  557. package/dist/remote/codec.js.map +1 -0
  558. package/dist/remote/config.d.ts +30 -0
  559. package/dist/remote/config.js +112 -0
  560. package/dist/remote/config.js.map +1 -0
  561. package/dist/remote/content-schema.d.ts +428 -0
  562. package/dist/remote/content-schema.js +209 -0
  563. package/dist/remote/content-schema.js.map +1 -0
  564. package/dist/remote/content.d.ts +44 -0
  565. package/dist/remote/content.js +75 -0
  566. package/dist/remote/content.js.map +1 -0
  567. package/dist/remote/envelope.d.ts +76 -0
  568. package/dist/remote/envelope.js +109 -0
  569. package/dist/remote/envelope.js.map +1 -0
  570. package/dist/remote/errors.d.ts +55 -0
  571. package/dist/remote/errors.js +63 -0
  572. package/dist/remote/errors.js.map +1 -0
  573. package/dist/remote/ids.d.ts +8 -0
  574. package/dist/remote/ids.js +25 -0
  575. package/dist/remote/ids.js.map +1 -0
  576. package/dist/remote/index.d.ts +7 -0
  577. package/dist/remote/index.js +8 -0
  578. package/dist/remote/index.js.map +1 -0
  579. package/dist/remote/keys.d.ts +62 -0
  580. package/dist/remote/keys.js +162 -0
  581. package/dist/remote/keys.js.map +1 -0
  582. package/dist/remote/localAnchors.d.ts +4 -0
  583. package/dist/remote/localAnchors.js +23 -0
  584. package/dist/remote/localAnchors.js.map +1 -0
  585. package/dist/remote/mapping.d.ts +11 -0
  586. package/dist/remote/mapping.js +22 -0
  587. package/dist/remote/mapping.js.map +1 -0
  588. package/dist/remote/presence.d.ts +63 -0
  589. package/dist/remote/presence.js +143 -0
  590. package/dist/remote/presence.js.map +1 -0
  591. package/dist/remote/realtime.d.ts +142 -0
  592. package/dist/remote/realtime.js +326 -0
  593. package/dist/remote/realtime.js.map +1 -0
  594. package/dist/remote/store.d.ts +183 -0
  595. package/dist/remote/store.js +907 -0
  596. package/dist/remote/store.js.map +1 -0
  597. package/dist/remote/sync.d.ts +113 -0
  598. package/dist/remote/sync.js +370 -0
  599. package/dist/remote/sync.js.map +1 -0
  600. package/dist/remote/types.d.ts +99 -0
  601. package/dist/remote/types.js +6 -0
  602. package/dist/remote/types.js.map +1 -0
  603. package/dist/setup/agents.d.ts +23 -0
  604. package/dist/setup/agents.js +80 -0
  605. package/dist/setup/agents.js.map +1 -0
  606. package/dist/setup/configure.d.ts +27 -0
  607. package/dist/setup/configure.js +201 -0
  608. package/dist/setup/configure.js.map +1 -0
  609. package/dist/setup/connect.d.ts +60 -0
  610. package/dist/setup/connect.js +244 -0
  611. package/dist/setup/connect.js.map +1 -0
  612. package/dist/setup/detect.d.ts +67 -0
  613. package/dist/setup/detect.js +168 -0
  614. package/dist/setup/detect.js.map +1 -0
  615. package/dist/setup/frameworks.d.ts +41 -0
  616. package/dist/setup/frameworks.js +81 -0
  617. package/dist/setup/frameworks.js.map +1 -0
  618. package/dist/sidecar/cli.d.ts +1 -0
  619. package/dist/sidecar/cli.js +70 -0
  620. package/dist/sidecar/cli.js.map +1 -0
  621. package/dist/sidecar/cloudSync.d.ts +33 -0
  622. package/dist/sidecar/cloudSync.js +139 -0
  623. package/dist/sidecar/cloudSync.js.map +1 -0
  624. package/dist/sidecar/commentFiles.d.ts +59 -0
  625. package/dist/sidecar/commentFiles.js +217 -0
  626. package/dist/sidecar/commentFiles.js.map +1 -0
  627. package/dist/sidecar/cssAttribution.d.ts +26 -0
  628. package/dist/sidecar/cssAttribution.js +114 -0
  629. package/dist/sidecar/cssAttribution.js.map +1 -0
  630. package/dist/sidecar/exportTasks.d.ts +38 -0
  631. package/dist/sidecar/exportTasks.js +249 -0
  632. package/dist/sidecar/exportTasks.js.map +1 -0
  633. package/dist/sidecar/http.d.ts +20 -0
  634. package/dist/sidecar/http.js +904 -0
  635. package/dist/sidecar/http.js.map +1 -0
  636. package/dist/sidecar/inviteTarget.d.ts +4 -0
  637. package/dist/sidecar/inviteTarget.js +32 -0
  638. package/dist/sidecar/inviteTarget.js.map +1 -0
  639. package/dist/sidecar/presence.d.ts +4 -0
  640. package/dist/sidecar/presence.js +92 -0
  641. package/dist/sidecar/presence.js.map +1 -0
  642. package/dist/storage/cliSession.d.ts +8 -0
  643. package/dist/storage/cliSession.js +41 -0
  644. package/dist/storage/cliSession.js.map +1 -0
  645. package/dist/storage/devStyleMap.d.ts +12 -0
  646. package/dist/storage/devStyleMap.js +31 -0
  647. package/dist/storage/devStyleMap.js.map +1 -0
  648. package/dist/storage/fileCache.d.ts +34 -0
  649. package/dist/storage/fileCache.js +122 -0
  650. package/dist/storage/fileCache.js.map +1 -0
  651. package/dist/storage/localAttachments.d.ts +82 -0
  652. package/dist/storage/localAttachments.js +276 -0
  653. package/dist/storage/localAttachments.js.map +1 -0
  654. package/dist/storage/localComments.d.ts +31 -0
  655. package/dist/storage/localComments.js +159 -0
  656. package/dist/storage/localComments.js.map +1 -0
  657. package/dist/storage/localCredentials.d.ts +74 -0
  658. package/dist/storage/localCredentials.js +210 -0
  659. package/dist/storage/localCredentials.js.map +1 -0
  660. package/dist/storage/localParticipants.d.ts +33 -0
  661. package/dist/storage/localParticipants.js +110 -0
  662. package/dist/storage/localParticipants.js.map +1 -0
  663. package/dist/storage/localRecipe.d.ts +22 -0
  664. package/dist/storage/localRecipe.js +46 -0
  665. package/dist/storage/localRecipe.js.map +1 -0
  666. package/dist/storage/localScreenshots.d.ts +23 -0
  667. package/dist/storage/localScreenshots.js +55 -0
  668. package/dist/storage/localScreenshots.js.map +1 -0
  669. package/dist/storage/localSource.d.ts +31 -0
  670. package/dist/storage/localSource.js +175 -0
  671. package/dist/storage/localSource.js.map +1 -0
  672. package/dist/storage/pulledComments.d.ts +81 -0
  673. package/dist/storage/pulledComments.js +107 -0
  674. package/dist/storage/pulledComments.js.map +1 -0
  675. package/dist/storage/remoteRecipe.d.ts +7 -0
  676. package/dist/storage/remoteRecipe.js +85 -0
  677. package/dist/storage/remoteRecipe.js.map +1 -0
  678. package/dist/storage/savedRemote.d.ts +2 -0
  679. package/dist/storage/savedRemote.js +22 -0
  680. package/dist/storage/savedRemote.js.map +1 -0
  681. package/dist/storage/sidecarAccess.d.ts +7 -0
  682. package/dist/storage/sidecarAccess.js +68 -0
  683. package/dist/storage/sidecarAccess.js.map +1 -0
  684. package/package.json +306 -4
@@ -0,0 +1,130 @@
1
+ import type { Anchor } from '../core/feedbackTypes.js';
2
+ export declare const anchorAttribute = "data-fb-src";
3
+ export declare const componentAttribute = "data-fb-component";
4
+ /**
5
+ * What a shared build stamps instead. One overlay serves both modes: it reads whichever
6
+ * attribute is on the page rather than being told which mode it is in, so there is no
7
+ * configuration to get wrong and no way for the two to disagree.
8
+ */
9
+ export declare const idAttribute = "data-fb-id";
10
+ /** Either attribute, for the selectors that need to find anchored elements. */
11
+ export declare const anchoredSelector = "[data-fb-src],[data-fb-id]";
12
+ /**
13
+ * What identifies this element's source, in whichever form the page carries.
14
+ *
15
+ * Every "how many of these are on the page" question goes through this rather than reading
16
+ * the attribute directly, so counting works the same in both modes. Reading `data-fb-src`
17
+ * directly would silently count one in a shared build, and the scope question - which is
18
+ * entirely built on those counts - would stop being asked at all.
19
+ */
20
+ export declare function anchorKeyOf(element: Element): {
21
+ attribute: string;
22
+ value: string;
23
+ } | null;
24
+ export type AnchorCandidate = {
25
+ element: HTMLElement;
26
+ anchor: Anchor;
27
+ };
28
+ /**
29
+ * Walks from the clicked node up to the root, collecting every anchored ancestor.
30
+ * Index 0 is the clicked leaf; higher indices are progressively broader components.
31
+ * SPEC 7.4: the leaf is usually not what the reviewer means, so the whole chain is offered.
32
+ */
33
+ export declare function anchorCandidatesFor(start: Element): AnchorCandidate[];
34
+ /** An element with no anchor: no id, no file, found again by its description alone. */
35
+ export declare function plainAnchorFor(element: HTMLElement): Anchor;
36
+ export declare function anchorForElement(element: HTMLElement): Anchor | null;
37
+ /**
38
+ * Re-locates the element a stored anchor points at, after a reload or a code change.
39
+ *
40
+ * A source anchor identifies a piece of *code*, not a rendered instance: one `PricingCard`
41
+ * in the source becomes three cards on the page, all carrying the same `data-fb-src`.
42
+ * Picking the first match would drop the pin on the wrong card, so the recorded DOM path
43
+ * is tried first to pin down which instance was commented on, with the source anchor and
44
+ * the captured text as fallbacks for when the DOM has shifted.
45
+ */
46
+ export declare function locateAnchor(anchor: Anchor, context?: AnchorContext): HTMLElement | null;
47
+ /**
48
+ * What else a comment recorded about where its element sat: its anchored ancestors, innermost
49
+ * first, and how many elements carried each one when it was left.
50
+ */
51
+ export type AnchorContext = {
52
+ chain?: Anchor[] | null;
53
+ chainInstances?: number[] | null;
54
+ };
55
+ /**
56
+ * Every element carrying this anchor, in document order: several when it is rendered in a loop.
57
+ * Anchors can come from a peer, so a value that makes an invalid selector is an anchor that is
58
+ * not on this page, never an exception.
59
+ */
60
+ export declare function anchorMatches(anchor: Pick<Anchor, 'id' | 'file' | 'line' | 'column'>): HTMLElement[];
61
+ export declare function componentNameFor(element: HTMLElement): string | null;
62
+ export declare function anchorLabel(anchor: Anchor): string;
63
+ export type SelectionScope = {
64
+ /** Elements on the page carrying this same source position, at the moment of the click. */
65
+ instancesOnPage: number;
66
+ /**
67
+ * How many elements carry each position in the chain, innermost first.
68
+ *
69
+ * This is what turns the task doc from a description into a location. When some ancestor
70
+ * renders exactly once, that ancestor is the call site, and an agent can be told where to
71
+ * make the change rather than warned that the anchor is shared. Computing it is the same
72
+ * walk as the counts above, so it costs one pass.
73
+ */
74
+ chainInstances: number[];
75
+ /** What the reviewer said the comment covers. Absent when the question was not asked. */
76
+ choice?: 'one' | 'all';
77
+ /**
78
+ * Elements whose entire anchor chain is identical to this one's.
79
+ *
80
+ * More than one means no source position can single this element out: three cards from
81
+ * a `.map` share every position in their chains. The change such a reviewer wants is
82
+ * usually a conditional prop or a data edit, not a change to the JSX.
83
+ */
84
+ siblingsSharingChain: number;
85
+ };
86
+ /**
87
+ * How much of the page the chosen anchor actually covers.
88
+ *
89
+ * This cannot be answered from the build. One source position renders N times — a `.map`
90
+ * over an array is one position and forty elements — and the transform only ever sees
91
+ * source text. The count exists at runtime and nowhere else, so it is taken here, at the
92
+ * moment of the click, and travels with the comment.
93
+ */
94
+ export declare function instancesOf(element: Element): number;
95
+ /** Every element rendered from the same source position as this one, including it. */
96
+ export declare function siblingInstances(element: HTMLElement): HTMLElement[];
97
+ export declare function scopeFor(element: HTMLElement, chain?: HTMLElement[]): SelectionScope;
98
+ /**
99
+ * Source files rendering inside the selected element, read from its subtree.
100
+ *
101
+ * Taken at click time from the DOM rather than derived from the chain, because the chain
102
+ * only records what the reviewer walked *through*. 79% of measured comments never widen at
103
+ * all, so a chain-derived list is empty for the common case — a direct click on a
104
+ * container — which is precisely the case that needs it. Reading the subtree does not care
105
+ * how the reviewer got there.
106
+ */
107
+ /**
108
+ * What the selection renders, read from its subtree.
109
+ *
110
+ * Returns file paths on a local page and anchor ids on a shared one, because an id is all
111
+ * the browser has and a path cannot be derived from it there. Both are resolved to paths at
112
+ * export, on the machine that can. Callers must not assume these strings are paths.
113
+ */
114
+ export declare function filesInsideSelection(element: HTMLElement): string[];
115
+ /**
116
+ * Whether a comment belongs on the page being shown.
117
+ *
118
+ * The page it was left on, as a rule: a shared component like a page header renders different
119
+ * content on every page, so a comment about the header on /catalogue must not appear on
120
+ * /facturation. The exception is anything inside a dialog. A dialog is the same wherever it is
121
+ * opened from - a "new case" dialog can be opened from three pages - and a comment left on it
122
+ * from one of them is about the dialog, not about the page behind it. So a comment whose element
123
+ * is on screen inside a dialog belongs here, whatever page it was written on.
124
+ */
125
+ export declare function belongsOnThisPage(comment: {
126
+ context?: {
127
+ route?: string;
128
+ } | null;
129
+ anchor: Anchor;
130
+ }): boolean;
@@ -0,0 +1,365 @@
1
+ import { locateDescribed, summarizeDescription } from './elementDescription.js';
2
+ export const anchorAttribute = 'data-fb-src';
3
+ export const componentAttribute = 'data-fb-component';
4
+ /**
5
+ * What a shared build stamps instead. One overlay serves both modes: it reads whichever
6
+ * attribute is on the page rather than being told which mode it is in, so there is no
7
+ * configuration to get wrong and no way for the two to disagree.
8
+ */
9
+ export const idAttribute = 'data-fb-id';
10
+ /** Either attribute, for the selectors that need to find anchored elements. */
11
+ export const anchoredSelector = `[${anchorAttribute}],[${idAttribute}]`;
12
+ /**
13
+ * What identifies this element's source, in whichever form the page carries.
14
+ *
15
+ * Every "how many of these are on the page" question goes through this rather than reading
16
+ * the attribute directly, so counting works the same in both modes. Reading `data-fb-src`
17
+ * directly would silently count one in a shared build, and the scope question - which is
18
+ * entirely built on those counts - would stop being asked at all.
19
+ */
20
+ export function anchorKeyOf(element) {
21
+ const source = element.getAttribute(anchorAttribute);
22
+ if (source) {
23
+ return { attribute: anchorAttribute, value: source };
24
+ }
25
+ const id = element.getAttribute(idAttribute);
26
+ return id ? { attribute: idAttribute, value: id } : null;
27
+ }
28
+ function sameSourceSelector(key) {
29
+ return `[${key.attribute}="${cssEscape(key.value)}"]`;
30
+ }
31
+ /**
32
+ * Walks from the clicked node up to the root, collecting every anchored ancestor.
33
+ * Index 0 is the clicked leaf; higher indices are progressively broader components.
34
+ * SPEC 7.4: the leaf is usually not what the reviewer means, so the whole chain is offered.
35
+ */
36
+ export function anchorCandidatesFor(start) {
37
+ const candidates = [];
38
+ let current = start;
39
+ while (current && current !== document.documentElement) {
40
+ if (current instanceof HTMLElement) {
41
+ const anchor = anchorForElement(current);
42
+ if (anchor) {
43
+ candidates.push({ element: current, anchor });
44
+ }
45
+ }
46
+ current = current.parentElement;
47
+ }
48
+ if (candidates.length > 0)
49
+ return candidates;
50
+ /*
51
+ * Nothing on the way up carries an anchor: a site installed with only a script tag, or an element
52
+ * a package rendered outside anything the build stamped. It used to end here, and the click went
53
+ * through to the page as if the widget were not there - on a site with no anchors, nothing could
54
+ * be commented on at all. The element and its ancestors are offered instead, plain, so the reviewer
55
+ * can still widen to what they meant; each is described when the comment is saved.
56
+ */
57
+ current = start;
58
+ while (current && current !== document.body && current !== document.documentElement && candidates.length < 8) {
59
+ if (current instanceof HTMLElement)
60
+ candidates.push({ element: current, anchor: plainAnchorFor(current) });
61
+ current = current.parentElement;
62
+ }
63
+ return candidates;
64
+ }
65
+ /** An element with no anchor: no id, no file, found again by its description alone. */
66
+ export function plainAnchorFor(element) {
67
+ return {
68
+ id: null,
69
+ file: '',
70
+ line: 0,
71
+ column: 0,
72
+ componentName: null,
73
+ domPath: domPathFor(element),
74
+ textSnippet: textSnippetFor(element),
75
+ };
76
+ }
77
+ export function anchorForElement(element) {
78
+ const raw = element.getAttribute(anchorAttribute);
79
+ if (!raw) {
80
+ // Shared build: an id and nothing else. The location is filled in on the developer's
81
+ // machine at export, and is deliberately not guessable from here.
82
+ const id = element.getAttribute(idAttribute);
83
+ if (!id) {
84
+ return null;
85
+ }
86
+ return {
87
+ id,
88
+ file: '',
89
+ line: 0,
90
+ column: 0,
91
+ componentName: null,
92
+ domPath: domPathFor(element),
93
+ textSnippet: textSnippetFor(element),
94
+ };
95
+ }
96
+ const match = /^(.*):(\d+):(\d+)$/.exec(raw);
97
+ if (!match) {
98
+ return null;
99
+ }
100
+ return {
101
+ file: match[1],
102
+ line: Number(match[2]),
103
+ column: Number(match[3]),
104
+ componentName: componentNameFor(element),
105
+ domPath: domPathFor(element),
106
+ textSnippet: textSnippetFor(element),
107
+ };
108
+ }
109
+ /**
110
+ * Re-locates the element a stored anchor points at, after a reload or a code change.
111
+ *
112
+ * A source anchor identifies a piece of *code*, not a rendered instance: one `PricingCard`
113
+ * in the source becomes three cards on the page, all carrying the same `data-fb-src`.
114
+ * Picking the first match would drop the pin on the wrong card, so the recorded DOM path
115
+ * is tried first to pin down which instance was commented on, with the source anchor and
116
+ * the captured text as fallbacks for when the DOM has shifted.
117
+ */
118
+ export function locateAnchor(anchor, context = {}) {
119
+ // Anchors come from stored content any reviewer can write: a selector that does not parse is
120
+ // an anchor that is not on this page, never an exception out of render.
121
+ try {
122
+ return locateStoredAnchor(anchor, context);
123
+ }
124
+ catch {
125
+ return null;
126
+ }
127
+ }
128
+ function locateStoredAnchor(anchor, context) {
129
+ // No anchor at all, only what the element looked like: found by description, which is built to
130
+ // survive a different window size where the tag-and-index path is not.
131
+ if (!anchor.id && !anchor.file) {
132
+ return locateDescribed(anchor.element) ?? (anchor.element ? null : queryPath(anchor.domPath));
133
+ }
134
+ // An id matches exactly, which is the one way shared mode is easier than local: there is
135
+ // no path to normalise and no chance of two spellings of the same file.
136
+ const matches = anchorMatches(anchor);
137
+ if (matches.length === 1) {
138
+ return matches[0];
139
+ }
140
+ // Several instances of the same component, or none. The DOM path disambiguates: every element
141
+ // it reaches, since a path cut short is a descendant selector and can reach more than one.
142
+ const byPath = queryPathAll(anchor.domPath);
143
+ if (matches.length === 0) {
144
+ // The anchor is gone from this page - a later build, a different route's markup. Where it was,
145
+ // or what the element looked like, may still find it.
146
+ return byPath[0] ?? locateDescribed(anchor.element);
147
+ }
148
+ const onPath = byPath.filter((element) => matches.includes(element));
149
+ if (onPath.length === 1) {
150
+ return onPath[0];
151
+ }
152
+ // The path reaches none of them (a comment stored with a broken one) or several. An ancestor the
153
+ // page rendered once when the comment was left is where this copy is called from.
154
+ const byCallSite = insideCallSite(matches, context);
155
+ if (byCallSite) {
156
+ return byCallSite;
157
+ }
158
+ const candidates = onPath.length > 0 ? onPath : matches;
159
+ if (anchor.textSnippet) {
160
+ const byText = candidates.find((element) => element.textContent?.replace(/\s+/g, ' ').trim().slice(0, 120) === anchor.textSnippet);
161
+ if (byText) {
162
+ return byText;
163
+ }
164
+ }
165
+ return candidates[0];
166
+ }
167
+ /**
168
+ * The one match that sits in, or around, an ancestor the comment's chain says rendered once.
169
+ *
170
+ * Innermost first: the nearest such ancestor is the copy's own call site (the hero form's wrapper,
171
+ * not the page's `main`, which holds every copy and so says nothing).
172
+ */
173
+ function insideCallSite(matches, { chain, chainInstances }) {
174
+ if (!chain || !chainInstances)
175
+ return null;
176
+ for (let index = 0; index < chain.length; index++) {
177
+ const entry = chain[index];
178
+ if (chainInstances[index] !== 1 || !entry || (!entry.id && !entry.file))
179
+ continue;
180
+ const found = anchorMatches(entry);
181
+ if (found.length !== 1)
182
+ continue;
183
+ const related = matches.filter((match) => found[0].contains(match) || match.contains(found[0]));
184
+ if (related.length === 1)
185
+ return related[0];
186
+ }
187
+ return null;
188
+ }
189
+ /**
190
+ * Every element carrying this anchor, in document order: several when it is rendered in a loop.
191
+ * Anchors can come from a peer, so a value that makes an invalid selector is an anchor that is
192
+ * not on this page, never an exception.
193
+ */
194
+ export function anchorMatches(anchor) {
195
+ const selector = anchor.id
196
+ ? `[${idAttribute}="${cssEscape(anchor.id)}"]`
197
+ : `[${anchorAttribute}="${cssEscape(`${anchor.file}:${anchor.line}:${anchor.column}`)}"]`;
198
+ try {
199
+ return Array.from(document.querySelectorAll(selector));
200
+ }
201
+ catch {
202
+ return [];
203
+ }
204
+ }
205
+ function queryPath(domPath) {
206
+ return queryPathAll(domPath)[0] ?? null;
207
+ }
208
+ function queryPathAll(domPath) {
209
+ if (!domPath)
210
+ return [];
211
+ try {
212
+ return Array.from(document.querySelectorAll(domPath));
213
+ }
214
+ catch {
215
+ return [];
216
+ }
217
+ }
218
+ export function componentNameFor(element) {
219
+ const explicit = element.getAttribute(componentAttribute);
220
+ if (explicit) {
221
+ return explicit;
222
+ }
223
+ const source = element.getAttribute(anchorAttribute);
224
+ if (!source) {
225
+ return null;
226
+ }
227
+ const filename = source.split(':')[0]?.split('/').pop() ?? null;
228
+ return filename ? filename.replace(/\.[jt]sx?$/, '') : null;
229
+ }
230
+ export function anchorLabel(anchor) {
231
+ if (!anchor.file)
232
+ return summarizeDescription(anchor.element);
233
+ const file = anchor.file.split('/').pop() ?? anchor.file;
234
+ return `${anchor.componentName ?? 'element'} · ${file}:${anchor.line}`;
235
+ }
236
+ function textSnippetFor(element) {
237
+ const text = element.textContent?.replace(/\s+/g, ' ').trim() ?? '';
238
+ return text ? text.slice(0, 120) : null;
239
+ }
240
+ // Deep enough to reach the body on real pages (anchored chains have been measured 17 deep, with
241
+ // plain elements between them), and short enough for what the API keeps: 1024 characters for a
242
+ // cursor's path, 2000 for a comment's.
243
+ const maxPathSegments = 32;
244
+ const maxPathCharacters = 900;
245
+ function domPathFor(element) {
246
+ const segments = [];
247
+ let length = 0;
248
+ let current = element;
249
+ while (current && current !== document.body) {
250
+ const parent = current.parentElement;
251
+ if (!parent) {
252
+ break;
253
+ }
254
+ const siblings = Array.from(parent.children).filter((child) => child.tagName === current.tagName);
255
+ const index = siblings.indexOf(current) + 1;
256
+ const segment = `${current.tagName.toLowerCase()}:nth-of-type(${index})`;
257
+ if (segments.length === maxPathSegments || length + segment.length + 3 > maxPathCharacters) {
258
+ break;
259
+ }
260
+ segments.unshift(segment);
261
+ length += segment.length + 3;
262
+ current = parent;
263
+ }
264
+ // From the body only when the walk got there. Cut short, the path is a descendant selector,
265
+ // which still reaches the element; `body > …` with the top levels missing reaches nothing.
266
+ return current === document.body ? `body > ${segments.join(' > ')}` : segments.join(' > ');
267
+ }
268
+ function cssEscape(value) {
269
+ return value.replace(/["\\]/g, '\\$&');
270
+ }
271
+ function chainSignature(element) {
272
+ const parts = [];
273
+ for (let node = element; node && node !== document.documentElement; node = node.parentElement) {
274
+ const src = node.getAttribute(anchorAttribute);
275
+ if (src)
276
+ parts.push(src);
277
+ }
278
+ return parts.join('>');
279
+ }
280
+ /**
281
+ * How much of the page the chosen anchor actually covers.
282
+ *
283
+ * This cannot be answered from the build. One source position renders N times — a `.map`
284
+ * over an array is one position and forty elements — and the transform only ever sees
285
+ * source text. The count exists at runtime and nowhere else, so it is taken here, at the
286
+ * moment of the click, and travels with the comment.
287
+ */
288
+ export function instancesOf(element) {
289
+ const key = anchorKeyOf(element);
290
+ return key ? document.querySelectorAll(sameSourceSelector(key)).length : 1;
291
+ }
292
+ /** Every element rendered from the same source position as this one, including it. */
293
+ export function siblingInstances(element) {
294
+ const key = anchorKeyOf(element);
295
+ if (!key)
296
+ return [element];
297
+ return Array.from(document.querySelectorAll(sameSourceSelector(key)));
298
+ }
299
+ export function scopeFor(element, chain = []) {
300
+ const instancesOnPage = instancesOf(element);
301
+ const signature = chainSignature(element);
302
+ let siblingsSharingChain = 0;
303
+ for (const other of Array.from(document.querySelectorAll(anchoredSelector))) {
304
+ if (chainSignature(other) === signature)
305
+ siblingsSharingChain += 1;
306
+ }
307
+ return { instancesOnPage, siblingsSharingChain, chainInstances: chain.map(instancesOf) };
308
+ }
309
+ /** Bounded: a page-level container can hold hundreds, and the doc has to stay readable. */
310
+ const maxInsideFiles = 24;
311
+ /**
312
+ * Source files rendering inside the selected element, read from its subtree.
313
+ *
314
+ * Taken at click time from the DOM rather than derived from the chain, because the chain
315
+ * only records what the reviewer walked *through*. 79% of measured comments never widen at
316
+ * all, so a chain-derived list is empty for the common case — a direct click on a
317
+ * container — which is precisely the case that needs it. Reading the subtree does not care
318
+ * how the reviewer got there.
319
+ */
320
+ /**
321
+ * What the selection renders, read from its subtree.
322
+ *
323
+ * Returns file paths on a local page and anchor ids on a shared one, because an id is all
324
+ * the browser has and a path cannot be derived from it there. Both are resolved to paths at
325
+ * export, on the machine that can. Callers must not assume these strings are paths.
326
+ */
327
+ export function filesInsideSelection(element) {
328
+ const fileOf = (value) => value.slice(0, value.lastIndexOf(':', value.lastIndexOf(':') - 1));
329
+ const own = element.getAttribute(anchorAttribute);
330
+ const ownKey = own ? fileOf(own) : element.getAttribute(idAttribute);
331
+ const found = [];
332
+ const seen = new Set(ownKey ? [ownKey] : []);
333
+ for (const node of Array.from(element.querySelectorAll(anchoredSelector))) {
334
+ const src = node.getAttribute(anchorAttribute);
335
+ // One id per element rather than one per file: which ids share a file is a question only
336
+ // the manifest can answer, so the de-duplication that matters happens at export.
337
+ const key = src ? fileOf(src) : node.getAttribute(idAttribute);
338
+ if (!key || seen.has(key))
339
+ continue;
340
+ seen.add(key);
341
+ found.push(key);
342
+ if (found.length >= maxInsideFiles)
343
+ break;
344
+ }
345
+ return found;
346
+ }
347
+ /** Containers that open over any page: dialogs, modal sheets, popovers. */
348
+ const opensOverAnyPage = '[role="dialog"], [role="alertdialog"], dialog, [aria-modal="true"], [popover], [data-radix-popper-content-wrapper]';
349
+ /**
350
+ * Whether a comment belongs on the page being shown.
351
+ *
352
+ * The page it was left on, as a rule: a shared component like a page header renders different
353
+ * content on every page, so a comment about the header on /catalogue must not appear on
354
+ * /facturation. The exception is anything inside a dialog. A dialog is the same wherever it is
355
+ * opened from - a "new case" dialog can be opened from three pages - and a comment left on it
356
+ * from one of them is about the dialog, not about the page behind it. So a comment whose element
357
+ * is on screen inside a dialog belongs here, whatever page it was written on.
358
+ */
359
+ export function belongsOnThisPage(comment) {
360
+ const route = comment.context?.route;
361
+ if (!route || route === window.location.pathname)
362
+ return true;
363
+ return Boolean(locateAnchor(comment.anchor)?.closest(opensOverAnyPage));
364
+ }
365
+ //# sourceMappingURL=anchors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anchors.js","sourceRoot":"","sources":["../../src/overlay/anchors.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEhF,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC;AAC7C,MAAM,CAAC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AACtD;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,YAAY,CAAC;AAExC,+EAA+E;AAC/E,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,eAAe,MAAM,WAAW,GAAG,CAAC;AAExE;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,OAAgB;IAC1C,MAAM,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;IACrD,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IACvD,CAAC;IAED,MAAM,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IAC7C,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC3D,CAAC;AAED,SAAS,kBAAkB,CAAC,GAAyC;IACnE,OAAO,IAAI,GAAG,CAAC,SAAS,KAAK,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;AACxD,CAAC;AAOD;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,MAAM,UAAU,GAAsB,EAAE,CAAC;IACzC,IAAI,OAAO,GAAmB,KAAK,CAAC;IAEpC,OAAO,OA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,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACd,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChB,IAAI,KAAK,CAAC,MAAM,IAAI,cAAc;YAAE,MAAM;IAC5C,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,2EAA2E;AAC3E,MAAM,gBAAgB,GAAG,oHAAoH,CAAC;AAE9I;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAgE;IAChG,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC;IACrC,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,MAAM,CAAC,QAAQ,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC9D,OAAO,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC;AAC1E,CAAC"}
@@ -0,0 +1,150 @@
1
+ import { type ApiTarget } from '../core/apiKind.js';
2
+ import type { DirectReviewer } from './directReviewer.js';
3
+ import type { Anchor, Comment } from '../core/feedbackTypes.js';
4
+ import { type Upload } from './upload.js';
5
+ import type { RecordingLimit } from './recorder.js';
6
+ export declare function configureDirectApi(reviewer: DirectReviewer | null): void;
7
+ export declare function configureApi(options: {
8
+ target?: ApiTarget & {
9
+ projectId: string;
10
+ };
11
+ base?: string;
12
+ token?: string | null;
13
+ buildId?: string | null;
14
+ actorId?: string | null;
15
+ }): void;
16
+ /**
17
+ * The session is gone: expired, or revoked from the dashboard.
18
+ *
19
+ * Its own type so a caller can tell it from a network failure or a rejected write. The two need
20
+ * opposite responses - one needs the reviewer to sign in again, the other needs a retry - and a
21
+ * caller that cannot distinguish them will pick wrong for one of the two.
22
+ *
23
+ * Never thrown in local mode: the sidecar has no authentication to fail.
24
+ */
25
+ export declare class SessionExpiredError extends Error {
26
+ constructor();
27
+ }
28
+ /**
29
+ * The API refused one action (403): someone else's comment, without the admin role. The sign-in is
30
+ * still good, so the reviewer is told and stays signed in; signing in again would not change it.
31
+ */
32
+ export declare class NotAllowedError extends Error {
33
+ constructor(message?: string);
34
+ }
35
+ export type ExportResponse = {
36
+ markdown: string;
37
+ path: string;
38
+ count: number;
39
+ };
40
+ export type NotificationEvent = {
41
+ /** v0 per-item read identity. */
42
+ id?: string;
43
+ sessionId?: string;
44
+ commentId: string;
45
+ kind: 'comment' | 'reply';
46
+ actor: string;
47
+ actorId: string | null;
48
+ body: string;
49
+ route: string | null;
50
+ createdAt: string;
51
+ unread: boolean;
52
+ };
53
+ export type NotificationGroup = {
54
+ title: string;
55
+ events: NotificationEvent[];
56
+ unread: number;
57
+ };
58
+ export declare let remoteFeedbackStatus: {
59
+ pending: number;
60
+ connected: boolean;
61
+ error: string | null;
62
+ } | null;
63
+ /**
64
+ * Whether the composer offers the paperclip: a Cloud session or a sidecar that keeps files; never
65
+ * Standalone. With a comment id, for a reply in that thread: not when another session holds it.
66
+ */
67
+ export declare function attachmentsAvailable(commentId?: string): boolean;
68
+ /** Whether Record can be offered at all: a Cloud session. The plan's limit is asked of `api.recordingLimit()`. */
69
+ export declare const recordingSupported: () => boolean;
70
+ export declare const api: {
71
+ /**
72
+ * Who the signed-in reviewer is.
73
+ *
74
+ * Only meaningful in shared mode; the local path answers this from a nickname in the browser.
75
+ * The overlay needs it before a comment exists, because the pin cursor and the composer both
76
+ * carry the reviewer's initials - and drawing a `?` until their first comment comes back is
77
+ * the one moment they cannot recognise themselves.
78
+ */
79
+ viewer(): Promise<{
80
+ id: string;
81
+ name: string;
82
+ email: string;
83
+ }>;
84
+ /**
85
+ * What happened while the developer was not looking (spec 7.2).
86
+ *
87
+ * Shared mode only. The local path has one person on it, so there is nobody to be notified
88
+ * about - and a bell that is always empty is worse than no bell.
89
+ */
90
+ notifications(): Promise<any>;
91
+ markNotificationsRead(ids?: string[]): Promise<any>;
92
+ listComments(): Promise<Comment[]>;
93
+ createComment(input: {
94
+ author: string;
95
+ authorId: string | null;
96
+ body: string;
97
+ anchor: Anchor;
98
+ leafAnchor: Anchor | null;
99
+ anchorChain?: Anchor[];
100
+ insideSelection?: string[];
101
+ cssScope?: Comment["cssScope"];
102
+ scope?: {
103
+ instancesOnPage: number;
104
+ siblingsSharingChain: number;
105
+ };
106
+ pinOffset?: {
107
+ x: number;
108
+ y: number;
109
+ };
110
+ context: Comment["context"];
111
+ attachmentIds?: string[];
112
+ }): Promise<Comment>;
113
+ /**
114
+ * The picture of the element, sent after the comment it belongs to exists. The size and what
115
+ * it may be missing ride in the query, so the body stays the image and nothing else.
116
+ */
117
+ uploadScreenshot(commentId: string, snapshot: {
118
+ blob: Blob;
119
+ width: number;
120
+ height: number;
121
+ incomplete: string[];
122
+ }): Promise<void>;
123
+ /** A file for the message being written, sent as soon as it is added (spec: upload timing). */
124
+ uploadAttachment(file: File, onProgress: (fraction: number) => void): Promise<Upload>;
125
+ /** What the plan lets a recording be: null where nothing can be recorded to. */
126
+ recordingLimit(): Promise<RecordingLimit | null>;
127
+ /** A file taken out of the composer. Best effort: it expires within the hour anyway. */
128
+ discardUpload(id: string): Promise<void>;
129
+ /** A sent file's bytes, to show or to save. */
130
+ attachmentBlob(commentId: string, attachmentId: string): Promise<Blob>;
131
+ trace(events: unknown[]): Promise<void>;
132
+ updateComment(id: string, patch: {
133
+ body?: string;
134
+ status?: "open" | "resolved";
135
+ }): Promise<Comment>;
136
+ updateReply(commentId: string, replyId: string, body: string): Promise<import("../core/feedbackTypes.js").Reply>;
137
+ deleteComment(id: string): Promise<void>;
138
+ addReply(id: string, input: {
139
+ author: string;
140
+ authorId: string | null;
141
+ body: string;
142
+ anchor: Anchor;
143
+ attachmentIds?: string[];
144
+ }): Promise<import("../core/feedbackTypes.js").Reply>;
145
+ exportTasks(input: {
146
+ commentIds?: string[];
147
+ route?: string | null;
148
+ }): Promise<ExportResponse>;
149
+ };
150
+ export declare function renderable(comments: unknown): Comment[];