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 @@
1
+ {"version":3,"file":"devCloud.js","sourceRoot":"","sources":["../../src/integration/devCloud.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,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AAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC;QAC3F,OAAO,MAAM,CAAC,KAAK,CAAC;IACtB,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ /** Only the opt-in dev adapter calls this; publish public routing metadata, never keys. */
2
+ export declare function devReviewOverlayUrl(root: string, overlayBase: string): Promise<string | null>;
@@ -0,0 +1,10 @@
1
+ import { readRemoteConfig } from '../remote/config.js';
2
+ /** Only the opt-in dev adapter calls this; publish public routing metadata, never keys. */
3
+ export async function devReviewOverlayUrl(root, overlayBase) {
4
+ const config = await readRemoteConfig(root);
5
+ if (!config)
6
+ return null;
7
+ const query = new URLSearchParams({ p: config.projectId, s: config.sessionId, a: config.apiUrl });
8
+ return `${overlayBase}/overlay/devBrowser.js?${query}`;
9
+ }
10
+ //# sourceMappingURL=devReviewLinks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devReviewLinks.js","sourceRoot":"","sources":["../../src/integration/devReviewLinks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,2FAA2F;AAC3F,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,IAAY,EAAE,WAAmB;IACzE,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC5C,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,MAAM,KAAK,GAAG,IAAI,eAAe,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IAClG,OAAO,GAAG,WAAW,0BAA0B,KAAK,EAAE,CAAC;AACzD,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The branch this working tree is on, for a build or a dev session that has no CI variables.
3
+ *
4
+ * Branch is filtering metadata and nothing else. It answers "which comments belong to what I
5
+ * am working on"; it never takes part in resolving an anchor. Branch names are rebased,
6
+ * renamed and deleted after merge, and a comment made on one branch may legitimately need
7
+ * fixing on another — so a resolution that depended on the name would break for reasons that
8
+ * have nothing to do with the code. Resolution stays on the opaque id and the fingerprint.
9
+ *
10
+ * Never throws. A project that is not a git checkout, a machine with no git, a shallow clone
11
+ * in a container: all of these are ordinary, and none of them is a reason to fail a build
12
+ * over a label used for filtering.
13
+ */
14
+ export declare function detectBranch(projectRoot: string): string | null;
15
+ /**
16
+ * `detectBranch` without blocking: for the sidecar, which reads the branch each time a comment is
17
+ * written (a developer switches branches while the dev server runs). Same answers, same bounds.
18
+ */
19
+ export declare function detectBranchAsync(projectRoot: string): Promise<string | null>;
@@ -0,0 +1,56 @@
1
+ import { execFile, execFileSync } from 'node:child_process';
2
+ /**
3
+ * The branch this working tree is on, for a build or a dev session that has no CI variables.
4
+ *
5
+ * Branch is filtering metadata and nothing else. It answers "which comments belong to what I
6
+ * am working on"; it never takes part in resolving an anchor. Branch names are rebased,
7
+ * renamed and deleted after merge, and a comment made on one branch may legitimately need
8
+ * fixing on another — so a resolution that depended on the name would break for reasons that
9
+ * have nothing to do with the code. Resolution stays on the opaque id and the fingerprint.
10
+ *
11
+ * Never throws. A project that is not a git checkout, a machine with no git, a shallow clone
12
+ * in a container: all of these are ordinary, and none of them is a reason to fail a build
13
+ * over a label used for filtering.
14
+ */
15
+ export function detectBranch(projectRoot) {
16
+ const head = runGit(projectRoot, ['rev-parse', '--abbrev-ref', 'HEAD']);
17
+ if (head === null) {
18
+ return null;
19
+ }
20
+ // Detached HEAD reports the literal string "HEAD". CI checkouts are routinely detached, so
21
+ // this is the common case rather than an exotic one, and there is no branch to report:
22
+ // saying "HEAD" would put a meaningless label on every CI build and make the filter useless
23
+ // precisely where it matters.
24
+ if (head === 'HEAD' || head.length === 0) {
25
+ return null;
26
+ }
27
+ return head;
28
+ }
29
+ /**
30
+ * `detectBranch` without blocking: for the sidecar, which reads the branch each time a comment is
31
+ * written (a developer switches branches while the dev server runs). Same answers, same bounds.
32
+ */
33
+ export function detectBranchAsync(projectRoot) {
34
+ return new Promise((resolve) => {
35
+ execFile('git', ['rev-parse', '--abbrev-ref', 'HEAD'], { cwd: projectRoot, encoding: 'utf8', timeout: 1_000 }, (error, stdout) => {
36
+ const head = error ? null : stdout.trim();
37
+ resolve(head && head !== 'HEAD' ? head : null);
38
+ });
39
+ });
40
+ }
41
+ function runGit(cwd, args) {
42
+ try {
43
+ return execFileSync('git', args, {
44
+ cwd,
45
+ encoding: 'utf8',
46
+ // Bounded: a build must not hang because git is waiting on something. Under a second is
47
+ // generous for a rev-parse, and failing to it means no branch label, not a failed build.
48
+ timeout: 1_000,
49
+ stdio: ['ignore', 'pipe', 'ignore'],
50
+ }).trim();
51
+ }
52
+ catch {
53
+ return null;
54
+ }
55
+ }
56
+ //# sourceMappingURL=gitBranch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gitBranch.js","sourceRoot":"","sources":["../../src/integration/gitBranch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE5D;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,YAAY,CAAC,WAAmB;IAC9C,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC,WAAW,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC;IACxE,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,2FAA2F;IAC3F,uFAAuF;IACvF,4FAA4F;IAC5F,8BAA8B;IAC9B,IAAI,IAAI,KAAK,MAAM,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,WAAmB;IACnD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,QAAQ,CAAC,KAAK,EAAE,CAAC,WAAW,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YAC/H,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YAC1C,OAAO,CAAC,IAAI,IAAI,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,MAAM,CAAC,GAAW,EAAE,IAAc;IACzC,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE;YAC/B,GAAG;YACH,QAAQ,EAAE,MAAM;YAChB,wFAAwF;YACxF,yFAAyF;YACzF,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC;SACpC,CAAC,CAAC,IAAI,EAAE,CAAC;IACZ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { Comment } from '../core/feedbackTypes.js';
2
+ /** Local comments recomputed into what the cloud accepts: opaque ids, and the manifest entries that explain them. Shared by `feedback link` and the sidecar's cloud sync. */
3
+ type Outcome = 'verified' | 'moved';
4
+ export type Plan = {
5
+ entries: {
6
+ id: string;
7
+ file: string;
8
+ line: number;
9
+ column: number;
10
+ component: string | null;
11
+ fingerprint: string;
12
+ }[];
13
+ comments: unknown[];
14
+ outcomes: Record<Outcome, number>;
15
+ authors: Map<string, number>;
16
+ replies: number;
17
+ };
18
+ export declare function planImport(root: string, comments: Comment[], secret: string): Promise<Plan>;
19
+ export {};
@@ -0,0 +1,90 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ import path from 'node:path';
3
+ import { anchorId } from '../core/anchorId.js';
4
+ import { fingerprintAt } from '../core/fingerprint.js';
5
+ /**
6
+ * Whether the element a local anchor names is still where the anchor says.
7
+ *
8
+ * Local comments carry no fingerprint - they were written against the file on disk and never
9
+ * needed one - so a comment whose code has moved cannot be followed to its new place (spec
10
+ * 8.1's "relocate"). What can be checked honestly is whether an element still starts at that
11
+ * line and column. If not, the comment is imported with its original location and a fingerprint
12
+ * that matches nothing, so every later pull reports it as stale rather than pointing at whatever
13
+ * now occupies that line.
14
+ */
15
+ async function locate(root, anchor, secret, cache) {
16
+ if (!anchor.file || !anchor.line)
17
+ return null;
18
+ let code = cache.get(anchor.file);
19
+ if (code === undefined) {
20
+ code = await readFile(path.join(root, anchor.file), 'utf8').catch(() => null);
21
+ cache.set(anchor.file, code);
22
+ }
23
+ const lines = code?.split('\n') ?? [];
24
+ const at = lines[anchor.line - 1];
25
+ const verified = typeof at === 'string' && at.slice(Math.max(0, anchor.column - 1)).startsWith('<');
26
+ return {
27
+ id: anchorId(secret, anchor.file, anchor.line, anchor.column),
28
+ outcome: (verified ? 'verified' : 'moved'),
29
+ entry: {
30
+ id: anchorId(secret, anchor.file, anchor.line, anchor.column),
31
+ file: anchor.file,
32
+ line: anchor.line,
33
+ column: anchor.column,
34
+ component: anchor.componentName ?? null,
35
+ fingerprint: verified && code ? fingerprintAt(code, anchor.line) : 'moved-before-import',
36
+ },
37
+ };
38
+ }
39
+ export async function planImport(root, comments, secret) {
40
+ const cache = new Map();
41
+ const entries = new Map();
42
+ const plan = { entries: [], comments: [], outcomes: { verified: 0, moved: 0 }, authors: new Map(), replies: 0 };
43
+ const convert = async (anchor, count) => {
44
+ if (!anchor)
45
+ return null;
46
+ const located = await locate(root, anchor, secret, cache);
47
+ if (!located)
48
+ return { id: null, domPath: anchor.domPath, textSnippet: anchor.textSnippet };
49
+ entries.set(located.id, located.entry);
50
+ if (count)
51
+ plan.outcomes[located.outcome] += 1;
52
+ return { id: located.id, domPath: anchor.domPath, textSnippet: anchor.textSnippet };
53
+ };
54
+ for (const comment of comments) {
55
+ plan.authors.set(comment.author, (plan.authors.get(comment.author) ?? 0) + 1);
56
+ const replies = [];
57
+ for (const reply of comment.replies ?? []) {
58
+ replies.push({
59
+ key: reply.id, author: reply.author, body: reply.body, createdAt: reply.createdAt, editedAt: reply.editedAt ?? null,
60
+ anchor: await convert(reply.anchor, false),
61
+ });
62
+ plan.replies += 1;
63
+ }
64
+ const chain = [];
65
+ for (const anchor of comment.anchorChain ?? [])
66
+ chain.push(await convert(anchor, false));
67
+ plan.comments.push({
68
+ key: comment.id,
69
+ author: comment.author,
70
+ body: comment.body,
71
+ status: comment.status,
72
+ createdAt: comment.createdAt,
73
+ editedAt: comment.editedAt ?? null,
74
+ anchor: await convert(comment.anchor, true),
75
+ leafAnchor: await convert(comment.leafAnchor, false),
76
+ anchorChain: chain.filter(Boolean),
77
+ // CSS rules as the browser captured them; the source file is resolved later, locally.
78
+ cssScope: comment.cssScope
79
+ ? { ...comment.cssScope, rules: comment.cssScope.rules.map(({ file: _file, origin: _origin, ...rule }) => rule) }
80
+ : undefined,
81
+ scope: comment.scope,
82
+ pinOffset: comment.pinOffset,
83
+ context: comment.context,
84
+ replies,
85
+ });
86
+ }
87
+ plan.entries = [...entries.values()];
88
+ return plan;
89
+ }
90
+ //# sourceMappingURL=importPlan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"importPlan.js","sourceRoot":"","sources":["../../src/integration/importPlan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAc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AM,EAAE,OAAO,CAAC,MAAM;YACtB,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,IAAI;YAClC,MAAM,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC;YAC3C,UAAU,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC;YACpD,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;YAClC,sFAAsF;YACtF,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBACxB,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE;gBACjH,CAAC,CAAC,SAAS;YACb,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,OAAO;SACR,CAAC,CAAC;IACL,CAAC;IAED,IAAI,CAAC,OAAO,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACrC,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Builder-agnostic integration surface.
3
+ *
4
+ * A builder adapter needs three things from this module: inject anchors in a transform
5
+ * hook, mount the middleware, and inject the overlay script tag. Nothing here imports
6
+ * Vite, so a Webpack, Rspack or Next.js adapter reuses all of it.
7
+ */
8
+ export { createFeedbackMiddleware, defaultApiBasePath, defaultOverlayBasePath } from './middleware.js';
9
+ export type { FeedbackMiddleware, MiddlewareOptions } from './middleware.js';
10
+ export { startOrAttachSidecar } from './sidecarProcess.js';
11
+ export type { SidecarHandle, SidecarLifecycleOptions } from './sidecarProcess.js';
12
+ export { injectSourceAnchors, jsxFilePattern } from './transform.js';
13
+ /** The overlay entry a host must load. Serve it, or import it from the client bundle. */
14
+ export declare const overlayEntryPath = "/__feedback/overlay/browser.js";
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Builder-agnostic integration surface.
3
+ *
4
+ * A builder adapter needs three things from this module: inject anchors in a transform
5
+ * hook, mount the middleware, and inject the overlay script tag. Nothing here imports
6
+ * Vite, so a Webpack, Rspack or Next.js adapter reuses all of it.
7
+ */
8
+ export { createFeedbackMiddleware, defaultApiBasePath, defaultOverlayBasePath } from './middleware.js';
9
+ export { startOrAttachSidecar } from './sidecarProcess.js';
10
+ export { injectSourceAnchors, jsxFilePattern } from './transform.js';
11
+ /** The overlay entry a host must load. Serve it, or import it from the client bundle. */
12
+ export const overlayEntryPath = '/__feedback/overlay/browser.js';
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/integration/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEvG,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErE,yFAAyF;AACzF,MAAM,CAAC,MAAM,gBAAgB,GAAG,gCAAgC,CAAC"}
@@ -0,0 +1,120 @@
1
+ export { fingerprintAt } from '../core/fingerprint.js';
2
+ import type { AnchorRecord } from '../core/sourceAnchors.js';
3
+ import type { StyleMap } from '../core/styleOrigin.js';
4
+ /**
5
+ * What a shared build records so its ids can be read back.
6
+ *
7
+ * Holds paths and component names but never source. `fingerprint` is a hash of the lines
8
+ * around the anchor, which is enough to tell a dev that an anchor has gone stale without the
9
+ * cloud ever storing a line of their code.
10
+ */
11
+ export type ManifestEntry = {
12
+ id: string;
13
+ file: string;
14
+ line: number;
15
+ column: number;
16
+ component: string | null;
17
+ fingerprint: string;
18
+ };
19
+ export type MobileAppIdentity = {
20
+ platform: 'ios' | 'android' | 'expo-go';
21
+ identifier: string;
22
+ };
23
+ export type Manifest = {
24
+ buildId: string;
25
+ commitSha: string | null;
26
+ /**
27
+ * Filtering metadata. Never a resolution key - see `detectBranch`, and the test that
28
+ * resolves the same id under two different branches and asserts the answer is identical.
29
+ */
30
+ branch: string | null;
31
+ /** The canonical mobile application this build targets; absent for Web builds. */
32
+ target?: MobileAppIdentity;
33
+ /** Fixed. Recorded so a future change is detectable rather than silently incompatible. */
34
+ idWidth: number;
35
+ /**
36
+ * Identifies the secret these ids were computed under, without containing it.
37
+ *
38
+ * Lets the resolver tell a rotated secret from stale code. Both look like "nothing
39
+ * resolves"; they need different messages because they need different actions.
40
+ */
41
+ secret: string;
42
+ createdAt: string;
43
+ entries: ManifestEntry[];
44
+ /**
45
+ * Runtime destination resolved while the JavaScript build still has the project secret.
46
+ *
47
+ * Server-rendered integrations fold this manifest into their own build after Vite has
48
+ * finished. Carrying the public session metadata lets their script tag target the same
49
+ * contract session without exposing the secret or repeating API discovery in PHP.
50
+ */
51
+ plan?: 'cloud' | 'standalone';
52
+ sessionId?: string;
53
+ /**
54
+ * Which stylesheet, package or utility framework each selector in this build came from.
55
+ *
56
+ * Paths again, never CSS: the selectors are already public in the shipped stylesheet, and the
57
+ * paths are the same kind of thing `entries` already carries. Absent from builds made before
58
+ * it existed, and from a build whose styles could not be recorded.
59
+ */
60
+ styles?: StyleMap;
61
+ };
62
+ export declare class ManifestCollector {
63
+ private readonly byId;
64
+ /** Ids that resolved to more than one distinct location. Fatal: see `collisions`. */
65
+ private readonly collided;
66
+ add(record: AnchorRecord, fingerprint: string): void;
67
+ /**
68
+ * Two locations sharing an id, which would make one of them unresolvable.
69
+ *
70
+ * The width is fixed rather than widened on collision, so this is not something the build
71
+ * can fix by itself. At 48 bits it should never fire; if it does, the build stops, because
72
+ * a manifest with a collision resolves some comments to the wrong line and there is no way
73
+ * to tell which.
74
+ */
75
+ collisions(): {
76
+ id: string;
77
+ locations: string[];
78
+ }[];
79
+ size(): number;
80
+ build(identity: {
81
+ buildId: string;
82
+ commitSha: string | null;
83
+ branch: string | null;
84
+ target?: MobileAppIdentity;
85
+ }, secret: string): Manifest;
86
+ }
87
+ /**
88
+ * Where the manifest is written before upload.
89
+ *
90
+ * Inside `.feedback`, which the plugin gitignores, and never inside the build output: the
91
+ * whole point is that it does not ship with the bundle.
92
+ */
93
+ export declare function manifestPath(projectRoot: string, buildId: string): string;
94
+ export declare const isValidBuildId: (buildId: unknown) => buildId is string;
95
+ /**
96
+ * A shared build's id, refused at the start of the build rather than when its manifest is
97
+ * written at the end. It names a file on disk and is matched by reviewers' overlays, so only
98
+ * letters, digits, `_` and `-` are allowed.
99
+ */
100
+ export declare function sharedBuildId(buildId: string): string;
101
+ export declare function writeManifest(projectRoot: string, manifest: Manifest): Promise<string>;
102
+ /**
103
+ * The branch a build is made from, or null.
104
+ *
105
+ * CI first, because a CI checkout is often detached and the variable is the only place the
106
+ * branch survives. Falling back to git covers a local build and a dev session, which is
107
+ * where a developer with several branches in flight actually needs the filter.
108
+ */
109
+ export declare function buildBranch(env?: NodeJS.ProcessEnv, projectRoot?: string): string | null;
110
+ /**
111
+ * Identity for this build.
112
+ *
113
+ * Never derived from the manifest alone: two builds of the same commit are the same code but
114
+ * different deployments, and a comment on one must not resolve against the other.
115
+ */
116
+ export declare function buildIdentity(env?: NodeJS.ProcessEnv, projectRoot?: string): {
117
+ buildId: string;
118
+ commitSha: string | null;
119
+ branch: string | null;
120
+ };
@@ -0,0 +1,147 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { mkdir, writeFile } from 'node:fs/promises';
3
+ import path from 'node:path';
4
+ import { anchorIdWidth, secretFingerprint } from '../core/anchorId.js';
5
+ // Re-exported from its old home so the plugin and the tests keep one import.
6
+ export { fingerprintAt } from '../core/fingerprint.js';
7
+ import { detectBranch } from './gitBranch.js';
8
+ const iosAppIdentifier = /^[a-z][a-z0-9_-]*(?:\.[a-z][a-z0-9_-]*)+$/;
9
+ const androidAppIdentifier = /^[a-z][a-z0-9_]*(?:\.[a-z][a-z0-9_]*)+$/;
10
+ const expoAppIdentifierPart = /^[a-z0-9][a-z0-9_-]*$/;
11
+ const maxAppIdentifierLength = 255;
12
+ function mobileTarget(value) {
13
+ if (typeof value !== 'object' || value === null)
14
+ throw new Error('Invalid mobile app target');
15
+ const { platform, identifier } = value;
16
+ if (platform !== 'ios' && platform !== 'android' && platform !== 'expo-go' || typeof identifier !== 'string') {
17
+ throw new Error('Invalid mobile app target');
18
+ }
19
+ if (platform === 'expo-go') {
20
+ const parts = identifier.split('/');
21
+ if (parts.length !== 2)
22
+ throw new Error('Invalid mobile app target');
23
+ const owner = parts[0].trim().toLowerCase();
24
+ const slug = parts[1].trim().toLowerCase();
25
+ if (!expoAppIdentifierPart.test(owner) || !expoAppIdentifierPart.test(slug))
26
+ throw new Error('Invalid mobile app target');
27
+ const normalized = `${owner}/${slug}`;
28
+ if (normalized.length > maxAppIdentifierLength)
29
+ throw new Error('Invalid mobile app target');
30
+ return { platform, identifier: normalized };
31
+ }
32
+ const normalized = identifier.trim().toLowerCase();
33
+ if (normalized.length > maxAppIdentifierLength)
34
+ throw new Error('Invalid mobile app target');
35
+ const valid = platform === 'ios' ? iosAppIdentifier.test(normalized) : androidAppIdentifier.test(normalized);
36
+ if (!valid)
37
+ throw new Error('Invalid mobile app target');
38
+ return { platform, identifier: normalized };
39
+ }
40
+ export class ManifestCollector {
41
+ byId = new Map();
42
+ /** Ids that resolved to more than one distinct location. Fatal: see `collisions`. */
43
+ collided = new Map();
44
+ add(record, fingerprint) {
45
+ const where = `${record.file}:${record.line}:${record.column}`;
46
+ const existing = this.byId.get(record.id);
47
+ if (existing) {
48
+ const existingWhere = `${existing.file}:${existing.line}:${existing.column}`;
49
+ if (existingWhere !== where) {
50
+ const set = this.collided.get(record.id) ?? new Set([existingWhere]);
51
+ set.add(where);
52
+ this.collided.set(record.id, set);
53
+ }
54
+ return;
55
+ }
56
+ this.byId.set(record.id, { ...record, fingerprint });
57
+ }
58
+ /**
59
+ * Two locations sharing an id, which would make one of them unresolvable.
60
+ *
61
+ * The width is fixed rather than widened on collision, so this is not something the build
62
+ * can fix by itself. At 48 bits it should never fire; if it does, the build stops, because
63
+ * a manifest with a collision resolves some comments to the wrong line and there is no way
64
+ * to tell which.
65
+ */
66
+ collisions() {
67
+ return [...this.collided].map(([id, locations]) => ({ id, locations: [...locations] }));
68
+ }
69
+ size() {
70
+ return this.byId.size;
71
+ }
72
+ build(identity, secret) {
73
+ const target = identity.target === undefined ? undefined : mobileTarget(identity.target);
74
+ return {
75
+ buildId: identity.buildId,
76
+ commitSha: identity.commitSha,
77
+ branch: identity.branch,
78
+ ...(target ? { target } : {}),
79
+ idWidth: anchorIdWidth,
80
+ secret: secretFingerprint(secret),
81
+ createdAt: new Date().toISOString(),
82
+ entries: [...this.byId.values()].sort((a, b) => a.file === b.file ? a.line - b.line || a.column - b.column : a.file < b.file ? -1 : 1),
83
+ };
84
+ }
85
+ }
86
+ /**
87
+ * Where the manifest is written before upload.
88
+ *
89
+ * Inside `.feedback`, which the plugin gitignores, and never inside the build output: the
90
+ * whole point is that it does not ship with the bundle.
91
+ */
92
+ export function manifestPath(projectRoot, buildId) {
93
+ // Build ids arrive from the API on pull. Unchecked, `../../package` would name a file to
94
+ // overwrite anywhere the process can write.
95
+ if (!isValidBuildId(buildId))
96
+ throw new Error('Invalid build id for a manifest');
97
+ const directory = path.join(projectRoot, '.feedback', 'manifests');
98
+ const target = path.join(directory, `${buildId}.json`);
99
+ if (path.dirname(target) !== directory)
100
+ throw new Error('Invalid build id for a manifest');
101
+ return target;
102
+ }
103
+ export const isValidBuildId = (buildId) => typeof buildId === 'string' && /^[A-Za-z0-9_-]{1,128}$/.test(buildId);
104
+ /**
105
+ * A shared build's id, refused at the start of the build rather than when its manifest is
106
+ * written at the end. It names a file on disk and is matched by reviewers' overlays, so only
107
+ * letters, digits, `_` and `-` are allowed.
108
+ */
109
+ export function sharedBuildId(buildId) {
110
+ if (isValidBuildId(buildId))
111
+ return buildId;
112
+ throw new Error(`feedback: the build ID "${String(buildId).slice(0, 80)}" must match ^[A-Za-z0-9_-]{1,128}$.\n` +
113
+ ' It comes from FEEDBACK_BUILD_ID (or FEEDBACK_BUILD_SHA plus a CI run id); use only letters, digits, "_" and "-".');
114
+ }
115
+ export async function writeManifest(projectRoot, manifest) {
116
+ const target = manifestPath(projectRoot, manifest.buildId);
117
+ await mkdir(path.dirname(target), { recursive: true });
118
+ await writeFile(target, `${JSON.stringify(manifest, null, 2)}\n`, 'utf8');
119
+ return target;
120
+ }
121
+ /**
122
+ * The branch a build is made from, or null.
123
+ *
124
+ * CI first, because a CI checkout is often detached and the variable is the only place the
125
+ * branch survives. Falling back to git covers a local build and a dev session, which is
126
+ * where a developer with several branches in flight actually needs the filter.
127
+ */
128
+ export function buildBranch(env = process.env, projectRoot) {
129
+ return env.FEEDBACK_BUILD_BRANCH ?? env.VERCEL_GIT_COMMIT_REF ?? env.GITHUB_HEAD_REF
130
+ ?? env.CI_COMMIT_REF_NAME ?? (projectRoot ? detectBranch(projectRoot) : null);
131
+ }
132
+ /**
133
+ * Identity for this build.
134
+ *
135
+ * Never derived from the manifest alone: two builds of the same commit are the same code but
136
+ * different deployments, and a comment on one must not resolve against the other.
137
+ */
138
+ export function buildIdentity(env = process.env, projectRoot) {
139
+ const commitSha = env.FEEDBACK_BUILD_SHA ?? env.VERCEL_GIT_COMMIT_SHA ?? env.GITHUB_SHA ?? env.CI_COMMIT_SHA ?? env.COMMIT_REF ?? null;
140
+ const branch = buildBranch(env, projectRoot);
141
+ const counter = env.FEEDBACK_BUILD_ID ?? env.VERCEL_DEPLOYMENT_ID ?? env.GITHUB_RUN_ID ?? env.CI_JOB_ID ?? null;
142
+ const buildId = commitSha
143
+ ? `${commitSha.slice(0, 12)}-${counter ?? Date.now().toString(36)}`
144
+ : `local-${createHash('sha256').update(`${Date.now()}${Math.random()}`).digest('hex').slice(0, 12)}`;
145
+ return { buildId, commitSha, branch };
146
+ }
147
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/integration/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACvE,6EAA6E;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAiE9C,MAAM,gBAAgB,GAAG,2CAA2C,CAAC;AACrE,MAAM,oBAAoB,GAAG,yCAAyC,CAAC;AACvE,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AACtD,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAEnC,SAAS,YAAY,CAAC,KAAc;IAClC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAC9F,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,KAAqD,CAAC;IACvF,IAAI,QAAQ,KAAK,KAAK,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,SAAS,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;QAC7G,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAC/C,CAAC;IACD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,GAA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C/E,GAAG,CAAC,kBAAkB,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAClF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,MAAyB,OAAO,CAAC,GAAG,EAAE,WAAoB;IACtF,MAAM,SAAS,GACb,GAAG,CAAC,kBAAkB,IAAI,GAAG,CAAC,qBAAqB,IAAI,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC,aAAa,IAAI,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC;IACvH,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IAC7C,MAAM,OAAO,GAAG,GAAG,CAAC,iBAAiB,IAAI,GAAG,CAAC,oBAAoB,IAAI,GAAG,CAAC,aAAa,IAAI,GAAG,CAAC,SAAS,IAAI,IAAI,CAAC;IAEhH,MAAM,OAAO,GAAG,SAAS;QACvB,CAAC,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,OAAO,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE;QACnE,CAAC,CAAC,SAAS,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;IAEvG,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;AACxC,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { type MobileAppIdentity } from './manifest.js';
2
+ import { type ManifestFailurePolicy } from './manifestUpload.js';
3
+ /**
4
+ * Every file's anchors, into one manifest, delivered and uploaded.
5
+ *
6
+ * The same rules as the Vite plugin: a collision stops the build, because it would resolve some
7
+ * comments to the wrong line with no way to tell which; a failed upload only warns, because it
8
+ * changes nothing about the bundle and the manifest stays on disk to be pushed later.
9
+ */
10
+ export type PartsPlan = {
11
+ secret: string;
12
+ projectId: string;
13
+ apiBase: string;
14
+ buildId: string;
15
+ /** Captured when the build plan was created; avoids branch drift before finalization. */
16
+ branch?: string | null;
17
+ /** Canonicalized by the collector before it enters the signed manifest. */
18
+ target?: MobileAppIdentity;
19
+ /** Where the loader wrote each file's anchors. */
20
+ partsDir: string;
21
+ /** Where the build wrote its CSS, for the style map. */
22
+ cssDir: string;
23
+ env?: NodeJS.ProcessEnv;
24
+ fetch?: typeof fetch;
25
+ failurePolicy?: ManifestFailurePolicy;
26
+ /** A later graph of the same build reads these parts again: Metro's lazy chunks do. */
27
+ keepParts?: boolean;
28
+ };
29
+ export declare function assembleManifest(root: string, plan: PartsPlan): Promise<void>;
@@ -0,0 +1,65 @@
1
+ import { readdir, readFile, rm } from 'node:fs/promises';
2
+ import path from 'node:path';
3
+ import { ManifestCollector, buildIdentity } from './manifest.js';
4
+ import { deliverManifest, pruneManifests, markPending, clearPending } from './manifestSink.js';
5
+ import { uploadManifest, describeFailure, describeBlockingFailure } from './manifestUpload.js';
6
+ import { nextStyleMap } from './nextStyles.js';
7
+ import { uploadsManifest } from './buildCredentials.js';
8
+ export async function assembleManifest(root, plan) {
9
+ const collector = new ManifestCollector();
10
+ const files = await readdir(plan.partsDir).catch(() => []);
11
+ for (const name of files) {
12
+ const anchors = JSON.parse(await readFile(path.join(plan.partsDir, name), 'utf8'));
13
+ for (const { fingerprint, ...record } of anchors)
14
+ collector.add(record, fingerprint);
15
+ }
16
+ const collisions = collector.collisions();
17
+ if (collisions.length > 0) {
18
+ throw new Error(`feedback: ${collisions.length} anchor id collision(s) in this build; stopping rather than resolving comments to the wrong line.`);
19
+ }
20
+ const detectedIdentity = buildIdentity(plan.env ?? process.env, root);
21
+ const identity = {
22
+ ...detectedIdentity,
23
+ branch: Object.prototype.hasOwnProperty.call(plan, 'branch') ? plan.branch ?? null : detectedIdentity.branch,
24
+ };
25
+ const built = collector.build({ ...identity, buildId: plan.buildId, ...(plan.target ? { target: plan.target } : {}) }, plan.secret);
26
+ // Which stylesheet, module, package or Tailwind each selector came from, read from the CSS the
27
+ // build wrote. Never fails the build: without it, comments get the old "unavailable" answer.
28
+ const styles = await nextStyleMap(root, plan.cssDir).catch((error) => {
29
+ console.warn(` feedback: styles were not recorded (${error instanceof Error ? error.message : String(error)}).`);
30
+ return null;
31
+ });
32
+ if (styles)
33
+ built.styles = styles;
34
+ const where = await deliverManifest(root, built);
35
+ console.log(` feedback: ${collector.size()} anchors, shared build ${plan.buildId}, manifest at ${where}`);
36
+ const env = plan.env ?? process.env;
37
+ if (!await uploadsManifest(root, env)) {
38
+ if (!plan.keepParts)
39
+ await rm(plan.partsDir, { recursive: true, force: true });
40
+ return; // A Standalone session's manifest stays on this machine.
41
+ }
42
+ const outcome = await uploadManifest(built, {
43
+ apiBase: plan.apiBase,
44
+ projectId: plan.projectId,
45
+ secret: plan.secret,
46
+ ...(plan.fetch ? { fetchImpl: plan.fetch } : {}),
47
+ });
48
+ if (outcome.ok) {
49
+ await clearPending(root, built.buildId);
50
+ console.log(` feedback: manifest uploaded (${outcome.bytes} bytes)`);
51
+ }
52
+ else {
53
+ await markPending(root, built.buildId, outcome.reason);
54
+ }
55
+ await pruneManifests(root);
56
+ if (!plan.keepParts)
57
+ await rm(plan.partsDir, { recursive: true, force: true });
58
+ if (!outcome.ok) {
59
+ if ((plan.failurePolicy ?? 'warn-and-pend') === 'throw-and-pend') {
60
+ throw new Error(describeBlockingFailure(outcome, built.target));
61
+ }
62
+ console.warn(describeFailure(outcome));
63
+ }
64
+ }
65
+ //# sourceMappingURL=manifestParts.js.map