ontrackd 0.0.1 → 0.11.1

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 +133 -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 +40 -0
  535. package/dist/plugin/vite.js +585 -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,62 @@
1
+ import MagicString from 'magic-string';
2
+ export type SourceAnchorOptions = {
3
+ /** Project-relative path recorded in the anchor, e.g. `src/components/Card.tsx`. */
4
+ sourceId: string;
5
+ attributeName?: string;
6
+ componentAttributeName?: string;
7
+ /**
8
+ * The project secret, when this build is publishing opaque ids.
9
+ *
10
+ * Present means shared mode: every element is stamped with an HMAC of its location instead
11
+ * of the location itself, and the component name is not emitted at all - a name like
12
+ * `PricingCard` is a smaller leak than a path but it is still the codebase describing
13
+ * itself to anyone with the link.
14
+ */
15
+ secret?: string;
16
+ };
17
+ /** One anchor, as the manifest records it. Emitted only in shared mode. */
18
+ export type AnchorRecord = {
19
+ id: string;
20
+ file: string;
21
+ line: number;
22
+ column: number;
23
+ component: string | null;
24
+ };
25
+ /**
26
+ * A plain raw source map.
27
+ *
28
+ * magic-string types `sourcesContent` as `(string | null)[]`, which most bundlers refuse.
29
+ * Normalising here keeps that detail out of every adapter.
30
+ */
31
+ export type RawSourceMap = {
32
+ version: number;
33
+ file?: string;
34
+ sources: string[];
35
+ sourcesContent: string[];
36
+ names: string[];
37
+ mappings: string;
38
+ };
39
+ export type AnchorResult = {
40
+ code: string;
41
+ map: RawSourceMap;
42
+ /** How many elements were anchored, useful for sanity checks. */
43
+ injected: number;
44
+ /**
45
+ * What each id in this file stands for. Empty in local mode, where the attribute already
46
+ * says it. The build collects these into the manifest.
47
+ */
48
+ anchors: AnchorRecord[];
49
+ };
50
+ /**
51
+ * Stamps every JSX element with the source location it was written at.
52
+ *
53
+ * The file is spliced rather than re-printed: only the new attributes are inserted, so the
54
+ * code the browser receives is the developer's own, character for character. A transform
55
+ * that reformats the file it is instrumenting makes every stack trace and every breakpoint
56
+ * approximate, which is a poor trade for a tool meant to be invisible.
57
+ */
58
+ export declare function injectSourceAnchors(code: string, filename: string, { sourceId, attributeName, componentAttributeName, secret, }: SourceAnchorOptions): AnchorResult | null;
59
+ /** What a shared build stamps. Deliberately not the same attribute as local mode. */
60
+ export declare const idAttributeName = "data-fb-id";
61
+ export declare function rawMap(magic: MagicString, filename: string): RawSourceMap;
62
+ export declare function escapeAttribute(value: string): string;
@@ -0,0 +1,82 @@
1
+ import MagicString from 'magic-string';
2
+ import { anchorId } from './anchorId.js';
3
+ import { enclosingComponentName, hasJsxAttribute, isFragmentElement, lineStarts, parseProgram, positionAt, walk, } from './oxcAst.js';
4
+ /**
5
+ * Stamps every JSX element with the source location it was written at.
6
+ *
7
+ * The file is spliced rather than re-printed: only the new attributes are inserted, so the
8
+ * code the browser receives is the developer's own, character for character. A transform
9
+ * that reformats the file it is instrumenting makes every stack trace and every breakpoint
10
+ * approximate, which is a poor trade for a tool meant to be invisible.
11
+ */
12
+ export function injectSourceAnchors(code, filename, { sourceId, attributeName = 'data-fb-src', componentAttributeName = 'data-fb-component', secret, }) {
13
+ const program = parseProgram(code, filename);
14
+ if (!program) {
15
+ return null;
16
+ }
17
+ const starts = lineStarts(code);
18
+ const magic = new MagicString(code);
19
+ const anchors = [];
20
+ let injected = 0;
21
+ walk(program, (node, ancestors) => {
22
+ // Guard on whichever attribute this mode stamps, or a shared build would skip nothing
23
+ // and a local build would skip the wrong thing.
24
+ const stamped = secret === undefined ? attributeName : idAttributeName;
25
+ if (node.type !== 'JSXOpeningElement' || isFragmentElement(node) || hasJsxAttribute(node, stamped)) {
26
+ return;
27
+ }
28
+ const at = positionAt(starts, node.start);
29
+ const componentName = hasJsxAttribute(node, componentAttributeName)
30
+ ? null
31
+ : enclosingComponentName(ancestors);
32
+ // Insert straight after the tag name, or after its type arguments, which is always a
33
+ // valid place for an attribute and leaves every other character untouched.
34
+ const insertAt = insertionPoint(node);
35
+ if (secret === undefined) {
36
+ const attributes = (componentName ? ` ${componentAttributeName}="${escapeAttribute(componentName)}"` : '') +
37
+ ` ${attributeName}="${escapeAttribute(`${sourceId}:${at.line}:${at.column}`)}"`;
38
+ magic.appendLeft(insertAt, attributes);
39
+ injected += 1;
40
+ return;
41
+ }
42
+ // Shared mode: the id alone. No path, no component name, nothing the bundle can be read
43
+ // backwards from. The manifest carries what it means, and the manifest does not ship to
44
+ // the browser.
45
+ const id = anchorId(secret, sourceId, at.line, at.column);
46
+ magic.appendLeft(insertAt, ` ${idAttributeName}="${id}"`);
47
+ anchors.push({ id, file: sourceId, line: at.line, column: at.column, component: componentName });
48
+ injected += 1;
49
+ });
50
+ return {
51
+ code: injected === 0 ? code : magic.toString(),
52
+ map: rawMap(magic, filename),
53
+ injected,
54
+ anchors,
55
+ };
56
+ }
57
+ /** What a shared build stamps. Deliberately not the same attribute as local mode. */
58
+ export const idAttributeName = 'data-fb-id';
59
+ // Shared with the Astro path, which produces the same result shape from a different parser.
60
+ export function rawMap(magic, filename) {
61
+ const map = magic.generateMap({ source: filename, hires: true, includeContent: true });
62
+ return {
63
+ version: Number(map.version),
64
+ file: map.file ?? undefined,
65
+ sources: map.sources.map((source) => source ?? filename),
66
+ sourcesContent: (map.sourcesContent ?? []).map((content) => content ?? ''),
67
+ names: map.names,
68
+ mappings: map.mappings,
69
+ };
70
+ }
71
+ function insertionPoint(opening) {
72
+ const typeArguments = opening.typeArguments;
73
+ if (typeArguments?.end) {
74
+ return typeArguments.end;
75
+ }
76
+ const name = opening.name;
77
+ return name?.end ?? opening.start + 1;
78
+ }
79
+ export function escapeAttribute(value) {
80
+ return value.replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/</g, '&lt;');
81
+ }
82
+ //# sourceMappingURL=sourceAnchors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sourceAnchors.js","sourceRoot":"","sources":["../../src/core/sourceAnchors.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,UAAU,EACV,IAAI,GAEL,MAAM,aAAa,CAAC;AAsDrB;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CACjC,IAAY,EACZ,QAAgB,EAChB,EACE,QAAQ,EACR,aAAa,GAAG,aAAa,EAC7B,sBAAsB,GAAG,mBAAmB,EAC5C,MAAM,GACc;IAEtB,MAAM,OAAO,GAAG,YAAY,CAAC,IAAI,EAAE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AC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,IAAI,QAAQ,CAAC;QACxD,cAAc,EAAE,CAAC,GAAG,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,IAAI,EAAE,CAAC;QAC1E,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,QAAQ,EAAE,GAAG,CAAC,QAAQ;KACvB,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,OAAa;IACnC,MAAM,aAAa,GAAG,OAAO,CAAC,aAAiC,CAAC;IAChE,IAAI,aAAa,EAAE,GAAG,EAAE,CAAC;QACvB,OAAO,aAAa,CAAC,GAAG,CAAC;IAC3B,CAAC;IAED,MAAM,IAAI,GAAG,OAAO,CAAC,IAAwB,CAAC;IAC9C,OAAO,IAAI,EAAE,GAAG,IAAI,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAa;IAC3C,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACpF,CAAC"}
@@ -0,0 +1,62 @@
1
+ import { countLines } from './oxcAst.js';
2
+ export type Span = {
3
+ startLine: number;
4
+ endLine: number;
5
+ };
6
+ export { countLines };
7
+ export type ImportBinding = {
8
+ /** Local binding name, e.g. `PriceLockup`. */
9
+ name: string;
10
+ /** Module specifier as written, e.g. `./PriceLockup`. */
11
+ source: string;
12
+ /** Project-relative file this resolves to, when it is a local module. */
13
+ resolvedFile: string | null;
14
+ /** Span of the component that file exports, so it can be read by range. */
15
+ span?: (Span & {
16
+ fileLineCount?: number;
17
+ }) | null;
18
+ /** Lines where this binding is actually used, so callers can keep only what is nearby. */
19
+ usageLines: number[];
20
+ };
21
+ export type SourceContext = {
22
+ file: string;
23
+ fileLineCount: number;
24
+ /** The component function enclosing the anchor. */
25
+ component: (Span & {
26
+ name: string | null;
27
+ }) | null;
28
+ /** The JSX element the anchor points at, including its children. */
29
+ element: (Span & {
30
+ tag: string;
31
+ className: string | null;
32
+ }) | null;
33
+ /** Local components and helpers referenced inside the enclosing component. */
34
+ imports: ImportBinding[];
35
+ };
36
+ export type ResolvedImport = {
37
+ file: string;
38
+ span?: (Span & {
39
+ fileLineCount?: number;
40
+ }) | null;
41
+ };
42
+ export type ResolveImport = (specifier: string, fromFile: string) => Promise<ResolvedImport | null>;
43
+ /**
44
+ * Span of the component a file exports, so a referenced child can be quoted by range
45
+ * rather than sending the agent to open the whole file.
46
+ *
47
+ * Blind testing showed every agent opened the shared `Button` component regardless of the
48
+ * work order naming its path: knowing where a component lives is not the same as knowing
49
+ * what props and classes it accepts.
50
+ */
51
+ export declare function readExportedComponentSpan(code: string, file: string): Promise<(Span & {
52
+ name: string | null;
53
+ }) | null>;
54
+ /**
55
+ * Locates an anchor precisely inside its file: which component encloses it, how far the
56
+ * anchored element extends, and where the components it uses are defined.
57
+ *
58
+ * This is what keeps an agent from reading a whole repository to make a two-line change.
59
+ * The anchor alone says which file; this says which lines, and removes the need to grep
60
+ * for every child component referenced nearby.
61
+ */
62
+ export declare function readSourceContext(code: string, file: string, line: number, column: number, resolveImport?: ResolveImport): Promise<SourceContext>;
@@ -0,0 +1,182 @@
1
+ import { countLines, enclosingComponentName, isFunctionNode, jsxTagName, lineAt, lineStarts, parseProgram, positionAt, walk, } from './oxcAst.js';
2
+ export { countLines };
3
+ /**
4
+ * Span of the component a file exports, so a referenced child can be quoted by range
5
+ * rather than sending the agent to open the whole file.
6
+ *
7
+ * Blind testing showed every agent opened the shared `Button` component regardless of the
8
+ * work order naming its path: knowing where a component lives is not the same as knowing
9
+ * what props and classes it accepts.
10
+ */
11
+ export async function readExportedComponentSpan(code, file) {
12
+ const program = parseProgram(code, file);
13
+ if (!program) {
14
+ return null;
15
+ }
16
+ const starts = lineStarts(code);
17
+ let span = null;
18
+ walk(program, (node) => {
19
+ if (span) {
20
+ return false;
21
+ }
22
+ if (node.type !== 'ExportNamedDeclaration' && node.type !== 'ExportDefaultDeclaration') {
23
+ return;
24
+ }
25
+ span = spanOfExport(node, starts);
26
+ });
27
+ return span;
28
+ }
29
+ function spanOfExport(node, starts) {
30
+ const declaration = node.declaration;
31
+ if (!declaration) {
32
+ return null;
33
+ }
34
+ const toSpan = (target, name) => ({
35
+ name,
36
+ startLine: lineAt(starts, target.start),
37
+ endLine: lineAt(starts, target.end),
38
+ });
39
+ if (declaration.type === 'FunctionDeclaration') {
40
+ return toSpan(declaration, declaration.id?.name ?? null);
41
+ }
42
+ if (declaration.type === 'VariableDeclaration') {
43
+ const first = declaration.declarations?.[0];
44
+ const name = first?.id?.type === 'Identifier' ? first.id.name : null;
45
+ return toSpan(declaration, name);
46
+ }
47
+ return toSpan(node, null);
48
+ }
49
+ /**
50
+ * Locates an anchor precisely inside its file: which component encloses it, how far the
51
+ * anchored element extends, and where the components it uses are defined.
52
+ *
53
+ * This is what keeps an agent from reading a whole repository to make a two-line change.
54
+ * The anchor alone says which file; this says which lines, and removes the need to grep
55
+ * for every child component referenced nearby.
56
+ */
57
+ export async function readSourceContext(code, file, line, column, resolveImport) {
58
+ const fileLineCount = countLines(code);
59
+ const program = parseProgram(code, file);
60
+ if (!program) {
61
+ // Unparseable source: callers fall back to a plain line window.
62
+ return { file, fileLineCount, component: null, element: null, imports: [] };
63
+ }
64
+ const starts = lineStarts(code);
65
+ const importsByName = new Map();
66
+ let target = null;
67
+ walk(program, (node, ancestors) => {
68
+ if (node.type === 'ImportDeclaration') {
69
+ for (const specifier of node.specifiers ?? []) {
70
+ if (specifier.local?.name) {
71
+ importsByName.set(specifier.local.name, node.source.value);
72
+ }
73
+ }
74
+ return;
75
+ }
76
+ if (target || node.type !== 'JSXOpeningElement') {
77
+ return;
78
+ }
79
+ const at = positionAt(starts, node.start);
80
+ if (at.line === line && at.column === column) {
81
+ target = { opening: node, ancestors: [...ancestors] };
82
+ }
83
+ });
84
+ if (!target) {
85
+ return { file, fileLineCount, component: null, element: null, imports: [] };
86
+ }
87
+ const { opening, ancestors } = target;
88
+ const parent = ancestors[ancestors.length - 1];
89
+ const elementEnd = parent?.type === 'JSXElement' ? parent.end : opening.end;
90
+ const componentNode = [...ancestors].reverse().find((node) => isFunctionNode(node));
91
+ const componentSpan = componentNode ? declarationSpan(componentNode, ancestors) : null;
92
+ const found = {
93
+ component: componentSpan
94
+ ? {
95
+ name: enclosingComponentName(ancestors),
96
+ startLine: lineAt(starts, componentSpan.start),
97
+ endLine: lineAt(starts, componentSpan.end),
98
+ }
99
+ : null,
100
+ element: {
101
+ tag: jsxTagName(opening.name) ?? 'element',
102
+ className: classNameOf(opening, code),
103
+ startLine: lineAt(starts, opening.start),
104
+ endLine: lineAt(starts, elementEnd),
105
+ },
106
+ };
107
+ const referenced = componentNode ? referencedImports(componentNode, importsByName, starts) : [];
108
+ const imports = [];
109
+ for (const binding of referenced) {
110
+ const resolved = resolveImport ? await resolveImport(binding.source, file) : null;
111
+ imports.push({ ...binding, resolvedFile: resolved?.file ?? null, span: resolved?.span ?? null });
112
+ }
113
+ return { file, fileLineCount, component: found.component, element: found.element, imports };
114
+ }
115
+ /**
116
+ * The span to report for a component. For `const Name = () => …` the declaration is the
117
+ * useful range, so that reading it starts at the name rather than at the arrow.
118
+ */
119
+ function declarationSpan(functionNode, ancestors) {
120
+ const index = ancestors.indexOf(functionNode);
121
+ const parent = index >= 0 ? ancestors[index - 1] : undefined;
122
+ if (parent?.type === 'VariableDeclarator') {
123
+ const grandparent = index >= 1 ? ancestors[index - 2] : undefined;
124
+ if (grandparent?.type === 'VariableDeclaration') {
125
+ return grandparent;
126
+ }
127
+ }
128
+ return functionNode;
129
+ }
130
+ /**
131
+ * Components and helpers used inside the enclosing component, each with the lines where
132
+ * they appear. Recording usage lines lets the exporter keep only the ones near the change
133
+ * rather than every import in the file.
134
+ */
135
+ function referencedImports(scope, importsByName, starts) {
136
+ const used = new Map();
137
+ walk(scope, (node) => {
138
+ if (node.type !== 'Identifier' && node.type !== 'JSXIdentifier') {
139
+ return;
140
+ }
141
+ const source = importsByName.get(node.name);
142
+ if (!source) {
143
+ return;
144
+ }
145
+ const entry = used.get(node.name) ?? { source, usageLines: new Set() };
146
+ entry.usageLines.add(lineAt(starts, node.start));
147
+ used.set(node.name, entry);
148
+ });
149
+ return [...used.entries()]
150
+ .map(([name, entry]) => ({
151
+ name,
152
+ source: entry.source,
153
+ usageLines: [...entry.usageLines].sort((left, right) => left - right),
154
+ }))
155
+ .sort((left, right) => left.name.localeCompare(right.name));
156
+ }
157
+ /** The current styling on the target element, which is usually what a visual note is about. */
158
+ function classNameOf(opening, code) {
159
+ for (const attribute of opening.attributes ?? []) {
160
+ if (attribute.type !== 'JSXAttribute') {
161
+ continue;
162
+ }
163
+ const name = attribute.name?.name;
164
+ if (name !== 'className' && name !== 'class') {
165
+ continue;
166
+ }
167
+ const value = attribute.value;
168
+ if (value?.type === 'Literal' && typeof value.value === 'string') {
169
+ return value.value;
170
+ }
171
+ if (value?.type === 'StringLiteral' && typeof value.value === 'string') {
172
+ return value.value;
173
+ }
174
+ if (value?.type === 'JSXExpressionContainer') {
175
+ // Computed, so the literal text would be misleading.
176
+ return null;
177
+ }
178
+ }
179
+ void code;
180
+ return null;
181
+ }
182
+ //# sourceMappingURL=sourceContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sourceContext.js","sourceRoot":"","sources":["../../src/core/sourceContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,sBAAsB,EACtB,cAAc,EACd,UAAU,EACV,MAAM,EACN,UAAU,EACV,YAAY,EACZ,UAAU,EACV,IAAI,GAEL,MAAM,aAAa,CAAC;AAIrB,OAAO,EAAE,UAAU,EAAE,CAAC;AA6BtB;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,IAA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,KAAK,wBAAwB,EAAE,CAAC;YAC7C,qDAAqD;YACrD,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,KAAK,IAAI,CAAC;IACV,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function sourceIdForFile(projectRoot: string, filename: string): string;
2
+ export declare function cleanModuleId(id: string): string;
@@ -0,0 +1,11 @@
1
+ import path from 'node:path';
2
+ export function sourceIdForFile(projectRoot, filename) {
3
+ return toPosixPath(path.relative(projectRoot, filename));
4
+ }
5
+ export function cleanModuleId(id) {
6
+ return id.split('?')[0];
7
+ }
8
+ function toPosixPath(filePath) {
9
+ return filePath.split(path.sep).join('/');
10
+ }
11
+ //# sourceMappingURL=sourcePath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sourcePath.js","sourceRoot":"","sources":["../../src/core/sourcePath.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,UAAU,eAAe,CAAC,WAAmB,EAAE,QAAgB;IACnE,OAAO,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,EAAU;IACtC,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1B,CAAC;AAED,SAAS,WAAW,CAAC,QAAgB;IACnC,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,118 @@
1
+ import type { Comment } from './feedbackTypes.js';
2
+ /**
3
+ * Whether the code still looks the way it did when the comment was left.
4
+ *
5
+ * A comment made on a deployed preview points at a commit. By the time it is read the working
6
+ * tree has usually moved, and "line 47 of PriceCard.tsx" now means something else. The line
7
+ * number still resolves - that is the problem. It resolves to whatever is there now, silently,
8
+ * and the work order hands an agent an excerpt of unrelated code with every appearance of
9
+ * precision.
10
+ *
11
+ * The manifest records a hash of the lines around each anchor. Recomputing it against the
12
+ * working tree turns a silent wrong answer into a stated one.
13
+ *
14
+ * **It does follow code that moved, and only by exact match.** If the identical window hashes
15
+ * somewhere else in the file, the anchor is relocated there: that is arithmetic, not a guess,
16
+ * and it covers the most ordinary edit there is - adding a line above something shifts every
17
+ * anchor below it.
18
+ *
19
+ * **What it will not do is find the nearest similar element.** Fuzzy matching would be right
20
+ * often enough to be dangerous, and this tool's entire claim is that it names the correct lines;
21
+ * a heuristic that is usually correct is worse than an admission, because nobody checks the ones
22
+ * it gets wrong. Two identical windows in one file are reported as unverifiable for the same
23
+ * reason - choosing between them would be the guess.
24
+ */
25
+ export type AnchorFreshness =
26
+ /** The window hashes the same. The comment still points where it did. */
27
+ {
28
+ state: 'fresh';
29
+ file: string;
30
+ line: number;
31
+ }
32
+ /**
33
+ * The code is not at that line any more, but the identical window is somewhere else in the
34
+ * file. Lines were added or removed above it; the element itself is untouched.
35
+ *
36
+ * **This is an exact hash match, not a similarity score.** The window either hashes to the
37
+ * recorded value or it does not. That is what makes following it safe where a "nearest similar
38
+ * element" heuristic would not be: there is no threshold to tune and no confidence to
39
+ * misjudge. Where more than one line matches - a file with two identical blocks - this
40
+ * declines and reports `moved`, because choosing between them would be the guess.
41
+ */
42
+ | {
43
+ state: 'relocated';
44
+ file: string;
45
+ line: number;
46
+ from: number;
47
+ }
48
+ /** The file is there, the window is not what it was. The element has been edited or moved. */
49
+ | {
50
+ state: 'moved';
51
+ file: string;
52
+ line: number;
53
+ }
54
+ /** The file is missing, or the line is past its end. */
55
+ | {
56
+ state: 'gone';
57
+ file: string;
58
+ line: number;
59
+ }
60
+ /**
61
+ * No fingerprint was recorded for this anchor, so nothing can be said.
62
+ *
63
+ * Reported rather than treated as fresh. A comment from a build made before fingerprints
64
+ * existed is not evidence that the code is unchanged, and rendering it as fresh would be the
65
+ * tool asserting something it does not know.
66
+ */
67
+ | {
68
+ state: 'unknown';
69
+ file: string;
70
+ line: number;
71
+ };
72
+ export type CommentFreshness = {
73
+ commentId: string;
74
+ anchors: AnchorFreshness[];
75
+ /**
76
+ * True when an anchor could not be accounted for: edited, deleted, or never fingerprinted.
77
+ *
78
+ * **Relocation does not make a comment suspect.** We know exactly where that code went, so
79
+ * there is nothing for the agent to be careful about - warning here would train people to
80
+ * ignore the warning in the cases that matter.
81
+ */
82
+ suspect: boolean;
83
+ /** True when at least one anchor was followed to a new line. Stated, but not as a warning. */
84
+ relocated: boolean;
85
+ };
86
+ /** What the manifest said about an anchor, keyed by the id the comment carries. */
87
+ export type FingerprintIndex = {
88
+ fingerprintOf(anchorId: string): string | undefined;
89
+ };
90
+ export declare function fingerprintsFrom(entries: {
91
+ id: string;
92
+ fingerprint: string;
93
+ }[]): FingerprintIndex;
94
+ export type ReadSource = (file: string) => Promise<string | null>;
95
+ /**
96
+ * Checks every anchor on a comment against the working tree.
97
+ *
98
+ * Runs after resolution, not before: it needs the file and line that the ids resolved to. The
99
+ * comment passed in is the resolved one.
100
+ */
101
+ export declare function checkFreshness(comment: Comment, index: FingerprintIndex, readSource: ReadSource): Promise<CommentFreshness>;
102
+ /**
103
+ * Moves a comment's anchors to where the code actually is.
104
+ *
105
+ * Applied after the check, so the work order quotes the element the reviewer pointed at rather
106
+ * than whatever now sits at the recorded line number. Only exact matches move; anything the
107
+ * check could not account for is left exactly as it was, because a wrong line that looks
108
+ * deliberate is worse than one that is flagged.
109
+ */
110
+ export declare function applyRelocations(comment: Comment, freshness: CommentFreshness): Comment;
111
+ /**
112
+ * How a stale anchor is described in the work order.
113
+ *
114
+ * Says what to do, not only what happened. An agent told "this may be stale" will proceed
115
+ * anyway; an agent told the excerpt may not be the code the reviewer saw, and to stop if it
116
+ * does not match the description, has something to check against.
117
+ */
118
+ export declare function freshnessNotice(freshness: CommentFreshness): string | null;