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":"manifestParts.js","sourceRoot":"","sources":["../../src/integration/manifestParts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,IAAI,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CAAC,CAAC,CAAC;QAClE,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC;IACzC,CAAC;AACH,CAAC"}
@@ -0,0 +1,75 @@
1
+ import { type Manifest } from './manifest.js';
2
+ import { type UploadOptions } from './manifestUpload.js';
3
+ /**
4
+ * Where a manifest goes after a build, and what is kept on disk.
5
+ *
6
+ * Today there is one destination: the developer's own `.feedback/manifests/`. Upload lands in
7
+ * step 5, against an API that does not exist yet. The seam is here rather than in the plugin
8
+ * so that adding the second destination does not mean touching the build, and so the disk
9
+ * path stays a real destination rather than becoming a stub - it is how a manifest is
10
+ * inspected, and how CI can archive one as an artefact.
11
+ */
12
+ export declare function deliverManifest(projectRoot: string, manifest: Manifest): Promise<string>;
13
+ /**
14
+ * How many manifests stay on this machine.
15
+ *
16
+ * Twenty, by recency, and nothing cleverer. The number is chosen for the case it has to
17
+ * cover: a developer with a few branches in flight, rebuilding each of them several times.
18
+ * Ten is tight enough to purge a branch you are still working on; a hundred is a directory
19
+ * nobody ever looks at. Manifests are small - around 20KB for a hundred anchors - so the cost
20
+ * of being generous here is measured in megabytes.
21
+ */
22
+ export declare const localManifestsKept = 20;
23
+ /**
24
+ * Prunes the local staging directory.
25
+ *
26
+ * **This is not the retention rule in spec 2.2, and the difference matters.** That rule keeps
27
+ * every manifest with at least one comment against it, plus the ten most recent. It can only
28
+ * run in the cloud, because the cloud is the only place that holds both the manifests and the
29
+ * comments. This machine has the manifests and no idea which of them anyone has commented on,
30
+ * so "keep the ones with comments" is not a policy it is able to apply - it would have to ask
31
+ * the network on every build, which is exactly the kind of dependency a build should not have.
32
+ *
33
+ * So the local policy is recency, chosen on its own merits rather than as an approximation of
34
+ * the cloud's. Two rules that look alike are worth separating explicitly, or someone later
35
+ * implements one and believes they have implemented both.
36
+ *
37
+ * **Known consequence.** Purging a manifest locally breaks offline resolution of comments made
38
+ * against that build until the developer can connect to re-fetch it, or rebuilds that
39
+ * commit to regenerate it. Regeneration works only because ids are deterministic - and only
40
+ * while the secret has not rotated, which is now a second condition and the reason the secret
41
+ * fingerprint is recorded. This is an accepted trade rather than an oversight: keeping every
42
+ * manifest forever is the alternative, and that directory grows without bound.
43
+ */
44
+ export declare function pruneManifests(projectRoot: string, keep?: number): Promise<string[]>;
45
+ /** Every manifest on this machine, newest first. */
46
+ export declare function listManifests(projectRoot: string): Promise<string[]>;
47
+ /**
48
+ * Reads one build's manifest from this machine.
49
+ *
50
+ * Returns null when it is not here, which is an ordinary situation rather than an error: it
51
+ * may have been pruned, or made on a colleague's machine. The caller decides whether to
52
+ * re-fetch, regenerate, or tell the developer (`feedback pull` says which builds it could not find).
53
+ */
54
+ export declare function readManifest(projectRoot: string, buildId: string): Promise<Manifest | null>;
55
+ export declare function markPending(projectRoot: string, buildId: string, reason: string): Promise<void>;
56
+ export declare function clearPending(projectRoot: string, buildId: string): Promise<void>;
57
+ export declare function pendingManifests(projectRoot: string): Promise<string[]>;
58
+ /**
59
+ * Sends every manifest this machine still owes the cloud.
60
+ *
61
+ * This is what makes "retryable" something a developer can act on rather than a claim in a
62
+ * warning. Without it, the failed-delivery rule would say the manifest is safe on disk and
63
+ * offer no way to move it.
64
+ *
65
+ * A manifest whose file has been pruned cannot be re-sent, and says so rather than failing
66
+ * silently: the recovery there is to rebuild that commit, which works because ids are derived
67
+ * from the source and the secret rather than stored.
68
+ */
69
+ export declare function pushPendingManifests(projectRoot: string, options: Omit<UploadOptions, 'apiBase'> & {
70
+ apiBase: string;
71
+ }): Promise<{
72
+ buildId: string;
73
+ ok: boolean;
74
+ reason?: string;
75
+ }[]>;
@@ -0,0 +1,157 @@
1
+ import { readdir, readFile, stat, unlink, writeFile } from 'node:fs/promises';
2
+ import path from 'node:path';
3
+ import { writeManifest, manifestPath, isValidBuildId } from './manifest.js';
4
+ import { uploadManifest, describeFailure } from './manifestUpload.js';
5
+ /**
6
+ * Where a manifest goes after a build, and what is kept on disk.
7
+ *
8
+ * Today there is one destination: the developer's own `.feedback/manifests/`. Upload lands in
9
+ * step 5, against an API that does not exist yet. The seam is here rather than in the plugin
10
+ * so that adding the second destination does not mean touching the build, and so the disk
11
+ * path stays a real destination rather than becoming a stub - it is how a manifest is
12
+ * inspected, and how CI can archive one as an artefact.
13
+ */
14
+ export async function deliverManifest(projectRoot, manifest) {
15
+ return writeManifest(projectRoot, manifest);
16
+ }
17
+ /**
18
+ * How many manifests stay on this machine.
19
+ *
20
+ * Twenty, by recency, and nothing cleverer. The number is chosen for the case it has to
21
+ * cover: a developer with a few branches in flight, rebuilding each of them several times.
22
+ * Ten is tight enough to purge a branch you are still working on; a hundred is a directory
23
+ * nobody ever looks at. Manifests are small - around 20KB for a hundred anchors - so the cost
24
+ * of being generous here is measured in megabytes.
25
+ */
26
+ export const localManifestsKept = 20;
27
+ /**
28
+ * Prunes the local staging directory.
29
+ *
30
+ * **This is not the retention rule in spec 2.2, and the difference matters.** That rule keeps
31
+ * every manifest with at least one comment against it, plus the ten most recent. It can only
32
+ * run in the cloud, because the cloud is the only place that holds both the manifests and the
33
+ * comments. This machine has the manifests and no idea which of them anyone has commented on,
34
+ * so "keep the ones with comments" is not a policy it is able to apply - it would have to ask
35
+ * the network on every build, which is exactly the kind of dependency a build should not have.
36
+ *
37
+ * So the local policy is recency, chosen on its own merits rather than as an approximation of
38
+ * the cloud's. Two rules that look alike are worth separating explicitly, or someone later
39
+ * implements one and believes they have implemented both.
40
+ *
41
+ * **Known consequence.** Purging a manifest locally breaks offline resolution of comments made
42
+ * against that build until the developer can connect to re-fetch it, or rebuilds that
43
+ * commit to regenerate it. Regeneration works only because ids are deterministic - and only
44
+ * while the secret has not rotated, which is now a second condition and the reason the secret
45
+ * fingerprint is recorded. This is an accepted trade rather than an oversight: keeping every
46
+ * manifest forever is the alternative, and that directory grows without bound.
47
+ */
48
+ export async function pruneManifests(projectRoot, keep = localManifestsKept) {
49
+ const directory = path.dirname(manifestPath(projectRoot, 'x'));
50
+ const names = await readdir(directory).catch(() => []);
51
+ const files = names.filter((name) => name.endsWith('.json'));
52
+ if (files.length <= keep) {
53
+ return [];
54
+ }
55
+ const dated = await Promise.all(files.map(async (name) => {
56
+ const full = path.join(directory, name);
57
+ const info = await stat(full).catch(() => null);
58
+ return { name, full, at: info?.mtimeMs ?? 0 };
59
+ }));
60
+ const doomed = dated.sort((a, b) => b.at - a.at).slice(keep);
61
+ for (const entry of doomed) {
62
+ await unlink(entry.full).catch(() => undefined);
63
+ // The pending marker goes with it. Left behind, it makes `feedback push` report a manifest
64
+ // it cannot send on every run, for as long as the project exists - a permanent non-zero
65
+ // exit and a warning nobody can act on, which is how a real warning stops being read.
66
+ await unlink(`${entry.full}.pending`).catch(() => undefined);
67
+ }
68
+ return doomed.map((entry) => entry.name);
69
+ }
70
+ /** Every manifest on this machine, newest first. */
71
+ export async function listManifests(projectRoot) {
72
+ const directory = path.dirname(manifestPath(projectRoot, 'x'));
73
+ const names = await readdir(directory).catch(() => []);
74
+ const dated = await Promise.all(names
75
+ .filter((name) => name.endsWith('.json'))
76
+ .map(async (name) => {
77
+ const info = await stat(path.join(directory, name)).catch(() => null);
78
+ return { name, at: info?.mtimeMs ?? 0 };
79
+ }));
80
+ return dated.sort((a, b) => b.at - a.at).map((entry) => entry.name);
81
+ }
82
+ /**
83
+ * Reads one build's manifest from this machine.
84
+ *
85
+ * Returns null when it is not here, which is an ordinary situation rather than an error: it
86
+ * may have been pruned, or made on a colleague's machine. The caller decides whether to
87
+ * re-fetch, regenerate, or tell the developer (`feedback pull` says which builds it could not find).
88
+ */
89
+ export async function readManifest(projectRoot, buildId) {
90
+ if (!isValidBuildId(buildId))
91
+ return null;
92
+ const raw = await readFile(manifestPath(projectRoot, buildId), 'utf8').catch(() => null);
93
+ if (raw === null) {
94
+ return null;
95
+ }
96
+ try {
97
+ return JSON.parse(raw);
98
+ }
99
+ catch {
100
+ return null;
101
+ }
102
+ }
103
+ /**
104
+ * Manifests written locally that the cloud has not acknowledged.
105
+ *
106
+ * Recorded as a sibling marker file rather than by asking the API, so it works offline - which
107
+ * is the situation that produced the undelivered manifest in the first place.
108
+ */
109
+ function pendingMarker(projectRoot, buildId) {
110
+ return `${manifestPath(projectRoot, buildId)}.pending`;
111
+ }
112
+ export async function markPending(projectRoot, buildId, reason) {
113
+ await writeFile(pendingMarker(projectRoot, buildId), `${new Date().toISOString()} ${reason}\n`, 'utf8');
114
+ }
115
+ export async function clearPending(projectRoot, buildId) {
116
+ await unlink(pendingMarker(projectRoot, buildId)).catch(() => undefined);
117
+ }
118
+ export async function pendingManifests(projectRoot) {
119
+ const directory = path.dirname(manifestPath(projectRoot, 'x'));
120
+ const names = await readdir(directory).catch(() => []);
121
+ return names.filter((name) => name.endsWith('.json.pending')).map((name) => name.replace(/\.json\.pending$/, ''));
122
+ }
123
+ /**
124
+ * Sends every manifest this machine still owes the cloud.
125
+ *
126
+ * This is what makes "retryable" something a developer can act on rather than a claim in a
127
+ * warning. Without it, the failed-delivery rule would say the manifest is safe on disk and
128
+ * offer no way to move it.
129
+ *
130
+ * A manifest whose file has been pruned cannot be re-sent, and says so rather than failing
131
+ * silently: the recovery there is to rebuild that commit, which works because ids are derived
132
+ * from the source and the secret rather than stored.
133
+ */
134
+ export async function pushPendingManifests(projectRoot, options) {
135
+ const pending = await pendingManifests(projectRoot);
136
+ const outcomes = [];
137
+ for (const buildId of pending) {
138
+ const manifest = await readManifest(projectRoot, buildId);
139
+ if (!manifest) {
140
+ outcomes.push({
141
+ buildId, ok: false,
142
+ reason: 'the manifest file is no longer on this machine; rebuild that commit to regenerate it',
143
+ });
144
+ continue;
145
+ }
146
+ const outcome = await uploadManifest(manifest, options);
147
+ if (outcome.ok) {
148
+ await clearPending(projectRoot, buildId);
149
+ outcomes.push({ buildId, ok: true });
150
+ }
151
+ else {
152
+ outcomes.push({ buildId, ok: false, reason: describeFailure(outcome) });
153
+ }
154
+ }
155
+ return outcomes;
156
+ }
157
+ //# sourceMappingURL=manifestSink.js.map
@@ -0,0 +1 @@
1
+ {"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AAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAC1D,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,QAAQ,CAAC,IAAI,CAAC;gBACZ,OAAO,EAAE,EAAE,EAAE,KAAK;gBAClB,MAAM,EAAE,sFAAsF;aAC/F,CAAC,CAAC;YACH,SAAS;QACX,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACxD,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC;YACf,MAAM,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;YACzC,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;QACvC,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,64 @@
1
+ import type { Manifest } from './manifest.js';
2
+ /**
3
+ * Sending a manifest to the cloud.
4
+ *
5
+ * Three decisions worth stating, because each one has a failure it is avoiding.
6
+ *
7
+ * **The secret never travels.** The body is signed with it and the signature is sent instead.
8
+ * A secret posted on every build is a secret in every CI log, every proxy that records request
9
+ * bodies, and every error report that captures a payload. It travels once, at link, and this
10
+ * path proves possession of it rather than handing it over. Signing the compressed bytes - the
11
+ * ones actually on the wire - means integrity covers what arrives, not what was intended.
12
+ *
13
+ * **A failure here never fails the build.** Deliberately the opposite of a missing secret,
14
+ * which does. The difference is what each does to the artefact: a missing secret changes what
15
+ * the bundle contains, so shipping it would publish the file tree; a failed upload changes
16
+ * nothing about the bundle. Blocking a deployment over our own bookkeeping is a worse failure
17
+ * than a preview whose comments do not resolve for an hour.
18
+ *
19
+ * **A 4xx is not retried.** A malformed body or a bad signature will not become valid on the
20
+ * second attempt; retrying it three times only delays the warning the developer needs to see.
21
+ */
22
+ export declare const maxManifestBytes: number;
23
+ /**
24
+ * Keep the existing 4 MiB compressed cap for legacy upload compatibility and bounded requests
25
+ * across hosting providers. The measured 50,000-anchor fixture is about 0.98 MB gzipped;
26
+ * this client limit is independent of the API deployment's own request limits.
27
+ */
28
+ export type ManifestFailurePolicy = 'warn-and-pend' | 'throw-and-pend';
29
+ export type UploadOutcome = {
30
+ ok: true;
31
+ buildId: string;
32
+ attempts: number;
33
+ bytes: number;
34
+ } | {
35
+ ok: false;
36
+ buildId: string;
37
+ attempts: number;
38
+ reason: string;
39
+ retryable: boolean;
40
+ };
41
+ export type UploadOptions = {
42
+ apiBase: string;
43
+ projectId: string;
44
+ secret: string;
45
+ /**
46
+ * Ten seconds. Long enough that a legitimately large manifest on a poor connection still
47
+ * lands - a timeout tuned to a fast laptop turns a working upload into a false failure on a
48
+ * big app, and nobody notices until a customer with 2,000 components complains.
49
+ */
50
+ timeoutMs?: number;
51
+ attempts?: number;
52
+ /** Injected so tests can run without sleeping through the backoff. */
53
+ sleep?: (ms: number) => Promise<void>;
54
+ fetchImpl?: typeof fetch;
55
+ };
56
+ export declare function uploadManifest(manifest: Manifest, options: UploadOptions): Promise<UploadOutcome>;
57
+ /** What the developer reads in the build log when it did not land. */
58
+ export declare function describeFailure(outcome: Extract<UploadOutcome, {
59
+ ok: false;
60
+ }>): string;
61
+ /** Metro cloud bundles are app-bound, so publishing without their manifest is not a valid build. */
62
+ export declare function describeBlockingFailure(outcome: Extract<UploadOutcome, {
63
+ ok: false;
64
+ }>, target?: Manifest['target']): string;
@@ -0,0 +1,177 @@
1
+ import { createHmac } from 'node:crypto';
2
+ import { gzipSync } from 'node:zlib';
3
+ import { pluginPath, routedFetch } from './apiRoutes.js';
4
+ /**
5
+ * Sending a manifest to the cloud.
6
+ *
7
+ * Three decisions worth stating, because each one has a failure it is avoiding.
8
+ *
9
+ * **The secret never travels.** The body is signed with it and the signature is sent instead.
10
+ * A secret posted on every build is a secret in every CI log, every proxy that records request
11
+ * bodies, and every error report that captures a payload. It travels once, at link, and this
12
+ * path proves possession of it rather than handing it over. Signing the compressed bytes - the
13
+ * ones actually on the wire - means integrity covers what arrives, not what was intended.
14
+ *
15
+ * **A failure here never fails the build.** Deliberately the opposite of a missing secret,
16
+ * which does. The difference is what each does to the artefact: a missing secret changes what
17
+ * the bundle contains, so shipping it would publish the file tree; a failed upload changes
18
+ * nothing about the bundle. Blocking a deployment over our own bookkeeping is a worse failure
19
+ * than a preview whose comments do not resolve for an hour.
20
+ *
21
+ * **A 4xx is not retried.** A malformed body or a bad signature will not become valid on the
22
+ * second attempt; retrying it three times only delays the warning the developer needs to see.
23
+ */
24
+ export const maxManifestBytes = 4 * 1024 * 1024;
25
+ function signManifest(secret, body) {
26
+ return createHmac('sha256', secret).update(body).digest('hex');
27
+ }
28
+ export async function uploadManifest(manifest, options) {
29
+ const { apiBase, projectId, secret, timeoutMs = 10_000, attempts: maxAttempts = 3, sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms)), fetchImpl = fetch, } = options;
30
+ const body = gzipSync(Buffer.from(JSON.stringify(manifest), 'utf8'));
31
+ if (body.length > maxManifestBytes) {
32
+ return {
33
+ ok: false, buildId: manifest.buildId, attempts: 0, retryable: false,
34
+ reason: `the manifest is ${(body.length / 1024 / 1024).toFixed(1)}MB compressed, over the ` +
35
+ `${(maxManifestBytes / 1024 / 1024).toFixed(1)}MB limit. This should not happen below ` +
36
+ 'roughly 200,000 anchors; please report it.',
37
+ };
38
+ }
39
+ const signature = signManifest(secret, body);
40
+ let attempt = 0;
41
+ let lastReason = 'no attempt was made';
42
+ while (attempt < maxAttempts) {
43
+ attempt += 1;
44
+ try {
45
+ // The route set the API speaks (apiRoutes.ts): the same signed bytes either way.
46
+ const { response } = await routedFetch(apiBase, fetchImpl, (legacy) => ({ url: `${apiBase.replace(/\/$/, '')}${pluginPath(legacy, 'manifests')}`, init: {
47
+ method: 'POST',
48
+ // Signed: a redirect would replay the signature and body to wherever it points.
49
+ redirect: 'error',
50
+ headers: {
51
+ 'content-type': 'application/json',
52
+ 'content-encoding': 'gzip',
53
+ 'x-feedback-project': projectId,
54
+ 'x-feedback-signature': signature,
55
+ 'x-feedback-build': manifest.buildId,
56
+ },
57
+ body: body,
58
+ signal: AbortSignal.timeout(timeoutMs),
59
+ } }));
60
+ if (response.ok) {
61
+ // A 200 is not the same as a stored manifest. The server states what it stored, and a
62
+ // reply that does not is treated as a failure: the alternative is a preview whose
63
+ // comments never resolve, with nothing anywhere saying why.
64
+ const acknowledged = await readAcknowledgement(response, manifest);
65
+ if (acknowledged.ok) {
66
+ return { ok: true, buildId: manifest.buildId, attempts: attempt, bytes: body.length };
67
+ }
68
+ return {
69
+ ok: false, buildId: manifest.buildId, attempts: attempt, retryable: true,
70
+ reason: acknowledged.reason,
71
+ };
72
+ }
73
+ // 4xx will not become valid on a retry; only the warning is delayed.
74
+ if (response.status >= 400 && response.status < 500) {
75
+ return {
76
+ ok: false, buildId: manifest.buildId, attempts: attempt, retryable: false,
77
+ reason: `the server rejected it (${response.status} ${response.statusText})`,
78
+ };
79
+ }
80
+ lastReason = `the server returned ${response.status}`;
81
+ }
82
+ catch (error) {
83
+ lastReason = describe(error);
84
+ }
85
+ if (attempt < maxAttempts) {
86
+ await sleep(Math.min(250 * 2 ** (attempt - 1), 2_000));
87
+ }
88
+ }
89
+ return { ok: false, buildId: manifest.buildId, attempts: attempt, retryable: true, reason: lastReason };
90
+ }
91
+ /**
92
+ * Whether the server actually stored what we sent.
93
+ *
94
+ * A truncated request that the server accepts, or a 200 with an empty body, is the worst case
95
+ * this path has: the client sees success and never retries, and the manifest is not there.
96
+ * Requiring the server to echo the build id and the entry count turns that into a failure the
97
+ * developer is told about.
98
+ */
99
+ async function readAcknowledgement(response, manifest) {
100
+ const text = await response.text().catch(() => '');
101
+ if (!text.trim()) {
102
+ return { ok: false, reason: 'the server replied 200 with an empty body, so nothing confirms it was stored' };
103
+ }
104
+ let parsed;
105
+ try {
106
+ parsed = JSON.parse(text);
107
+ }
108
+ catch {
109
+ return { ok: false, reason: `the server replied 200 with a body that is not JSON: ${text.slice(0, 80)}` };
110
+ }
111
+ if (parsed.buildId !== manifest.buildId) {
112
+ return { ok: false, reason: `the server acknowledged a different build (${String(parsed.buildId)})` };
113
+ }
114
+ if (parsed.entries !== manifest.entries.length) {
115
+ return {
116
+ ok: false,
117
+ reason: `the server stored ${String(parsed.entries)} of ${manifest.entries.length} anchors`,
118
+ };
119
+ }
120
+ return { ok: true };
121
+ }
122
+ function describe(error) {
123
+ if (!(error instanceof Error))
124
+ return String(error);
125
+ if (error.name === 'TimeoutError' || error.name === 'AbortError')
126
+ return 'it timed out';
127
+ // Node wraps fetch failures, sometimes several layers deep and sometimes in an AggregateError
128
+ // when more than one address was tried. Reporting the outer "fetch failed" tells a developer
129
+ // nothing they can act on, and this message is the whole of what they get.
130
+ const code = findCode(error);
131
+ if (code === 'ENOTFOUND' || code === 'EAI_AGAIN')
132
+ return 'the API host could not be resolved (ENOTFOUND)';
133
+ if (code === 'ECONNREFUSED')
134
+ return 'the connection was refused (ECONNREFUSED)';
135
+ if (code === 'ECONNRESET')
136
+ return 'the connection was reset (ECONNRESET)';
137
+ if (code === 'CERT_HAS_EXPIRED')
138
+ return "the API's TLS certificate has expired";
139
+ if (code)
140
+ return `${error.message} (${code})`;
141
+ // No code anywhere: Node's fetch reports client-side rejections - a blocked port, an
142
+ // unsupported scheme - as a bare "fetch failed" with the real reason one level down. Saying
143
+ // only "fetch failed" gives the developer nothing to act on.
144
+ const cause = error.cause;
145
+ const detail = cause instanceof Error ? cause.message : null;
146
+ return detail && detail !== error.message ? `${error.message}: ${detail}` : error.message;
147
+ }
148
+ /** The first error code in the cause chain, including inside an AggregateError. */
149
+ function findCode(error, depth = 0) {
150
+ if (depth > 5 || !(error instanceof Error))
151
+ return null;
152
+ const code = error.code;
153
+ if (typeof code === 'string')
154
+ return code;
155
+ if (error instanceof AggregateError) {
156
+ for (const inner of error.errors) {
157
+ const found = findCode(inner, depth + 1);
158
+ if (found)
159
+ return found;
160
+ }
161
+ }
162
+ return findCode(error.cause, depth + 1);
163
+ }
164
+ /** What the developer reads in the build log when it did not land. */
165
+ export function describeFailure(outcome) {
166
+ return (` feedback: the manifest for build ${outcome.buildId} was not delivered: ${outcome.reason}.\n` +
167
+ ' The build is fine and the bundle is unaffected. Comments made against this build will ' +
168
+ 'not resolve until the manifest arrives.\n' +
169
+ ` ${outcome.retryable ? 'Run `feedback push` to send it again.' : 'This will not succeed on a retry.'}`);
170
+ }
171
+ /** Metro cloud bundles are app-bound, so publishing without their manifest is not a valid build. */
172
+ export function describeBlockingFailure(outcome, target) {
173
+ const app = target ? ` for ${target.platform}/${target.identifier}` : '';
174
+ return (`feedback: the app-bound manifest${app} for build ${outcome.buildId} was not delivered: ${outcome.reason}. ` +
175
+ `The manifest is pending locally; ${outcome.retryable ? 'run `feedback push` after the service recovers' : 'correct the project/app configuration before rebuilding'}.`);
176
+ }
177
+ //# sourceMappingURL=manifestUpload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifestUpload.js","sourceRoot":"","sources":["../../src/integration/manifestUpload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AA6BhD,SAAS,YAAY,CAAC,MAAc,EAAE,IAAY;IAChD,OAAO,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACjE,CAAC;AAED,MAAM,CAAC,K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C,CAAC,mCAAmC,EAAE,CAC3G,CAAC;AACJ,CAAC;AAED,oGAAoG;AACpG,MAAM,UAAU,uBAAuB,CACrC,OAA8C,EAC9C,MAA2B;IAE3B,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,QAAQ,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACzE,OAAO,CACL,mCAAmC,GAAG,cAAc,OAAO,CAAC,OAAO,uBAAuB,OAAO,CAAC,MAAM,IAAI;QAC5G,oCAAoC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,gDAAgD,CAAC,CAAC,CAAC,yDAAyD,GAAG,CACxK,CAAC;AACJ,CAAC"}
@@ -0,0 +1,55 @@
1
+ import { type IncomingMessage, type ServerResponse } from 'node:http';
2
+ export type FeedbackMiddleware = (request: IncomingMessage, response: ServerResponse, next: (error?: unknown) => void) => void;
3
+ export type MiddlewareOptions = {
4
+ /**
5
+ * Current sidecar port. Called with `revive` when the sidecar stopped answering, so the
6
+ * host can restart it and hand back a live port.
7
+ */
8
+ resolveSidecarPort: (revive?: boolean) => Promise<number>;
9
+ /** Sent with every request so a sidecar serving another project rejects it. */
10
+ projectRoot: string;
11
+ /** Public path the overlay entry is served from. */
12
+ overlayBasePath?: string;
13
+ /** Path prefix proxied to the sidecar. */
14
+ apiBasePath?: string;
15
+ /**
16
+ * Dev-server review links: answer `GET <overlayBasePath>/branch` with the Git
17
+ * branch checked out now, which their reviewers' Cloud comments are labelled with.
18
+ */
19
+ devReviewBranch?: boolean;
20
+ /**
21
+ * Requests reach this middleware through a proxy on this machine (Next's rewrites), which
22
+ * overwrites `x-forwarded-host` with the Host the browser used. That Host stands in for the
23
+ * request's own; the browser's address is not known, so loopback is judged by Host alone.
24
+ */
25
+ forwardedHost?: boolean;
26
+ /**
27
+ * Trust the direct connection address as the native reviewer's identity. This is opt-in for
28
+ * in-process dev servers such as Metro, which receive the device connection before proxying it.
29
+ */
30
+ trustedClientAddress?: 'socket';
31
+ /**
32
+ * Refuse `/__fb` requests whose Host is neither loopback nor an IP address, for dev servers
33
+ * with no Host check of their own: otherwise a DNS-rebinding page is "same origin".
34
+ */
35
+ checkHost?: boolean;
36
+ /** Host-owned public config, served after the same Host/origin checks as sidecar routes. */
37
+ publicConfig?: (request: IncomingMessage) => Promise<unknown>;
38
+ };
39
+ export declare const defaultOverlayBasePath = "/__feedback";
40
+ export declare const defaultApiBasePath = "/__fb";
41
+ /**
42
+ * Connect-style middleware shared by every builder adapter.
43
+ *
44
+ * It does the two host-independent jobs: serve the overlay bundle, and proxy the API to
45
+ * the sidecar so the overlay only ever calls same-origin relative URLs (SPEC 4.1).
46
+ * Any builder exposing a Node middleware stack can mount this unchanged.
47
+ */
48
+ /**
49
+ * Refuses CORS preflights for the API before a dev server's own CORS handling can grant them
50
+ * (Vite's default reflects other localhost origins). Mount ahead of everything else.
51
+ */
52
+ export declare function refuseApiPreflight(apiBasePath?: string): FeedbackMiddleware;
53
+ export declare function createFeedbackMiddleware({ resolveSidecarPort, projectRoot, overlayBasePath, apiBasePath, forwardedHost, trustedClientAddress, checkHost, publicConfig, devReviewBranch, }: MiddlewareOptions): FeedbackMiddleware;
54
+ export declare function serveBranch(projectRoot: string, response: ServerResponse): Promise<void>;
55
+ export declare function serveOverlayAsset(assetName: string, response: ServerResponse): Promise<void>;