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,39 @@
1
+ export type Node = {
2
+ type: string;
3
+ start: number;
4
+ end: number;
5
+ } & Record<string, any>;
6
+ /**
7
+ * Shared parsing helpers built on oxc.
8
+ *
9
+ * oxc reports positions as offsets in UTF-16 code units, which are plain JavaScript string
10
+ * indices, so they can be sliced and handed to magic-string directly. It reports no line
11
+ * or column, so anything that needs those converts here against a line index.
12
+ */
13
+ export declare function parseProgram(code: string, filename: string): Node | null;
14
+ /** Offsets of the first character of every line. */
15
+ export declare function lineStarts(code: string): number[];
16
+ /** Line and column for an offset. Column is 1-based, matching how anchors are stored. */
17
+ export declare function positionAt(starts: number[], offset: number): {
18
+ line: number;
19
+ column: number;
20
+ };
21
+ export declare function lineAt(starts: number[], offset: number): number;
22
+ /** Counts lines the way an editor does, ignoring a trailing newline. */
23
+ export declare function countLines(code: string): number;
24
+ export type Visitor = (node: Node, ancestors: readonly Node[]) => void | false;
25
+ /**
26
+ * Depth-first walk with the ancestor chain.
27
+ *
28
+ * The oxc AST carries no parent links, so callers that need context (which function
29
+ * encloses this element?) get the stack instead. Returning false skips a subtree.
30
+ */
31
+ export declare function walk(root: Node, visit: Visitor): void;
32
+ export declare function isFunctionNode(node: Node): boolean;
33
+ /** The nearest enclosing function that has a name we can attribute the JSX to. */
34
+ export declare function enclosingComponentName(ancestors: readonly Node[]): string | null;
35
+ /** Tag name for a JSX element, following member and namespaced forms. */
36
+ export declare function jsxTagName(name: Node | undefined | null): string | null;
37
+ /** Fragments carry no attributes, so they are never anchored. */
38
+ export declare function isFragmentElement(opening: Node): boolean;
39
+ export declare function hasJsxAttribute(opening: Node, attribute: string): boolean;
@@ -0,0 +1,147 @@
1
+ import { parseSync } from 'oxc-parser';
2
+ /**
3
+ * Shared parsing helpers built on oxc.
4
+ *
5
+ * oxc reports positions as offsets in UTF-16 code units, which are plain JavaScript string
6
+ * indices, so they can be sliced and handed to magic-string directly. It reports no line
7
+ * or column, so anything that needs those converts here against a line index.
8
+ */
9
+ export function parseProgram(code, filename) {
10
+ try {
11
+ const result = parseSync(filename, code, { lang: langFor(filename) });
12
+ if (result.errors.length > 0) {
13
+ return null;
14
+ }
15
+ return result.program;
16
+ }
17
+ catch {
18
+ return null;
19
+ }
20
+ }
21
+ function langFor(filename) {
22
+ if (filename.endsWith('.tsx'))
23
+ return 'tsx';
24
+ if (filename.endsWith('.ts'))
25
+ return 'ts';
26
+ return 'jsx';
27
+ }
28
+ /** Offsets of the first character of every line. */
29
+ export function lineStarts(code) {
30
+ const starts = [0];
31
+ for (let index = 0; index < code.length; index += 1) {
32
+ if (code.charCodeAt(index) === 10) {
33
+ starts.push(index + 1);
34
+ }
35
+ }
36
+ return starts;
37
+ }
38
+ /** Line and column for an offset. Column is 1-based, matching how anchors are stored. */
39
+ export function positionAt(starts, offset) {
40
+ let low = 0;
41
+ let high = starts.length - 1;
42
+ while (low < high) {
43
+ const mid = (low + high + 1) >> 1;
44
+ if (starts[mid] <= offset) {
45
+ low = mid;
46
+ }
47
+ else {
48
+ high = mid - 1;
49
+ }
50
+ }
51
+ return { line: low + 1, column: offset - starts[low] + 1 };
52
+ }
53
+ export function lineAt(starts, offset) {
54
+ return positionAt(starts, offset).line;
55
+ }
56
+ /** Counts lines the way an editor does, ignoring a trailing newline. */
57
+ export function countLines(code) {
58
+ const parts = code.split(/\r?\n/);
59
+ if (parts.length > 0 && parts[parts.length - 1] === '') {
60
+ parts.pop();
61
+ }
62
+ return parts.length;
63
+ }
64
+ /**
65
+ * Depth-first walk with the ancestor chain.
66
+ *
67
+ * The oxc AST carries no parent links, so callers that need context (which function
68
+ * encloses this element?) get the stack instead. Returning false skips a subtree.
69
+ */
70
+ export function walk(root, visit) {
71
+ const ancestors = [];
72
+ const step = (node) => {
73
+ if (!node || typeof node !== 'object') {
74
+ return;
75
+ }
76
+ if (Array.isArray(node)) {
77
+ for (const child of node) {
78
+ step(child);
79
+ }
80
+ return;
81
+ }
82
+ const candidate = node;
83
+ if (typeof candidate.type !== 'string') {
84
+ return;
85
+ }
86
+ if (visit(candidate, ancestors) === false) {
87
+ return;
88
+ }
89
+ ancestors.push(candidate);
90
+ for (const key of Object.keys(candidate)) {
91
+ if (key === 'type' || key === 'start' || key === 'end') {
92
+ continue;
93
+ }
94
+ step(candidate[key]);
95
+ }
96
+ ancestors.pop();
97
+ };
98
+ step(root);
99
+ }
100
+ export function isFunctionNode(node) {
101
+ return (node.type === 'FunctionDeclaration' ||
102
+ node.type === 'FunctionExpression' ||
103
+ node.type === 'ArrowFunctionExpression');
104
+ }
105
+ /** The nearest enclosing function that has a name we can attribute the JSX to. */
106
+ export function enclosingComponentName(ancestors) {
107
+ for (let index = ancestors.length - 1; index >= 0; index -= 1) {
108
+ const node = ancestors[index];
109
+ if (node.type === 'FunctionDeclaration' && node.id?.name) {
110
+ return node.id.name;
111
+ }
112
+ if (node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression') {
113
+ const parent = ancestors[index - 1];
114
+ if (parent?.type === 'VariableDeclarator' && parent.id?.type === 'Identifier') {
115
+ return parent.id.name;
116
+ }
117
+ }
118
+ }
119
+ return null;
120
+ }
121
+ /** Tag name for a JSX element, following member and namespaced forms. */
122
+ export function jsxTagName(name) {
123
+ if (!name)
124
+ return null;
125
+ if (name.type === 'JSXIdentifier')
126
+ return name.name;
127
+ if (name.type === 'JSXMemberExpression')
128
+ return name.property?.name ?? null;
129
+ if (name.type === 'JSXNamespacedName')
130
+ return name.name?.name ?? null;
131
+ return null;
132
+ }
133
+ /** Fragments carry no attributes, so they are never anchored. */
134
+ export function isFragmentElement(opening) {
135
+ const name = opening.name;
136
+ if (!name)
137
+ return true;
138
+ if (name.type === 'JSXIdentifier')
139
+ return name.name === 'Fragment';
140
+ if (name.type === 'JSXMemberExpression')
141
+ return name.property?.name === 'Fragment';
142
+ return false;
143
+ }
144
+ export function hasJsxAttribute(opening, attribute) {
145
+ return (opening.attributes ?? []).some((item) => item.type === 'JSXAttribute' && item.name?.name === attribute);
146
+ }
147
+ //# sourceMappingURL=oxcAst.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oxcAst.js","sourceRoot":"","sources":["../../src/core/oxcAst.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAIvC;;;;;;GAMG;AACH,MAAM,UAAU,Y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AC,UAAqB,IAAI,EAAE,CAAC,CAAC,IAAI,CAChD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,cAAc,IAAI,IAAI,CAAC,IAAI,EAAE,IAAI,KAAK,SAAS,CACxE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The page a comment was made on, as recorded in `context.url` for remote sessions: http(s) only,
3
+ * without the fragment (it may hold a magic link or an app's private state) or userinfo, and
4
+ * within the content schema's 2,000 characters. Cloud content is readable on the server, so Cloud
5
+ * callers also drop the query (`query: false`), which often carries one-time codes or tokens.
6
+ * Null when there is no such URL. Used by the overlay and again by the sidecar, the last hop.
7
+ */
8
+ export declare function pageUrl(href: unknown, { query }?: {
9
+ query?: boolean;
10
+ }): string | null;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * The page a comment was made on, as recorded in `context.url` for remote sessions: http(s) only,
3
+ * without the fragment (it may hold a magic link or an app's private state) or userinfo, and
4
+ * within the content schema's 2,000 characters. Cloud content is readable on the server, so Cloud
5
+ * callers also drop the query (`query: false`), which often carries one-time codes or tokens.
6
+ * Null when there is no such URL. Used by the overlay and again by the sidecar, the last hop.
7
+ */
8
+ export function pageUrl(href, { query = true } = {}) {
9
+ if (typeof href !== 'string')
10
+ return null;
11
+ let url;
12
+ try {
13
+ url = new URL(href);
14
+ }
15
+ catch {
16
+ return null;
17
+ }
18
+ if (url.protocol !== 'http:' && url.protocol !== 'https:')
19
+ return null;
20
+ url.hash = '';
21
+ url.username = '';
22
+ url.password = '';
23
+ if (!query)
24
+ url.search = '';
25
+ return url.href.length <= 2000 ? url.href : null;
26
+ }
27
+ //# sourceMappingURL=pageUrl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pageUrl.js","sourceRoot":"","sources":["../../src/core/pageUrl.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CAAC,IAAa,EAAE,EAAE,KAAK,GAAG,IAAI,KAA0B,EAAE;IAC/E,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC1C,IAAI,GAAQ,CAAC;IACb,IAAI,CAAC;QAAC,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,IAAI,CAAC;IAAC,CAAC;IACnD,IAAI,GAAG,CAAC,QAAQ,KAAK,OAAO,IAAI,GAAG,CAAC,QAAQ,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACvE,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC;IAAC,GAAG,CAAC,QAAQ,GAAG,EAAE,CAAC;IAAC,GAAG,CAAC,QAAQ,GAAG,EAAE,CAAC;IACpD,IAAI,CAAC,KAAK;QAAE,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;IAC5B,OAAO,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AACnD,CAAC"}
@@ -0,0 +1,14 @@
1
+ export type Participant = {
2
+ id: string;
3
+ name: string;
4
+ /** Hex colour for the avatar, derived from the id so it never changes. */
5
+ color: string;
6
+ /** Best-effort, for recognising someone who returns without their stored id. */
7
+ lastIp: string | null;
8
+ lastSeen: string;
9
+ };
10
+ /** Same id always gets the same colour, on every machine, with no coordination. */
11
+ export declare function colorForId(id: string): string;
12
+ /** One or two letters, the way every collaborative tool renders an avatar. */
13
+ export declare function initialsFor(name: string): string;
14
+ export declare function newParticipantId(): string;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Avatar colours. Chosen to stay legible against white text on the dark overlay, and to
3
+ * be distinguishable from each other for the small number of people in one review.
4
+ */
5
+ const avatarColors = [
6
+ '#8b5cf6', // violet
7
+ '#3b82f6', // blue
8
+ '#ec4899', // pink
9
+ '#f59e0b', // amber
10
+ '#10b981', // emerald
11
+ '#ef4444', // red
12
+ '#06b6d4', // cyan
13
+ '#a855f7', // purple
14
+ ];
15
+ /** Same id always gets the same colour, on every machine, with no coordination. */
16
+ export function colorForId(id) {
17
+ let hash = 0;
18
+ for (let index = 0; index < id.length; index += 1) {
19
+ hash = (hash * 31 + id.charCodeAt(index)) >>> 0;
20
+ }
21
+ return avatarColors[hash % avatarColors.length];
22
+ }
23
+ /** One or two letters, the way every collaborative tool renders an avatar. */
24
+ export function initialsFor(name) {
25
+ const parts = name.trim().split(/\s+/).filter(Boolean);
26
+ if (parts.length === 0) {
27
+ return '?';
28
+ }
29
+ if (parts.length === 1) {
30
+ return parts[0].slice(0, 1).toUpperCase();
31
+ }
32
+ return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();
33
+ }
34
+ export function newParticipantId() {
35
+ const bytes = crypto.getRandomValues(new Uint8Array(9));
36
+ return `p_${Array.from(bytes, (b) => b.toString(16).padStart(2, '0')).join('')}`;
37
+ }
38
+ //# sourceMappingURL=participants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"participants.js","sourceRoot":"","sources":["../../src/core/participants.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,MAAM,YAAY,GAAG;IACnB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,OAAO;IAClB,SAAS,EAAE,OAAO;IAClB,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,UAAU;IACrB,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,OAAO;IAClB,SAAS,EAAE,SAAS;CACrB,CAAC;AAEF,mFAAmF;AACnF,MAAM,UAAU,UAAU,CAAC,EAAU;IACnC,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,EAAE,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAClD,IAAI,GAAG,CAAC,IAAI,GAAG,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,YAAY,CAAC,IAAI,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;AAClD,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACvD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,GAAG,CAAC;IACb,CAAC;IACD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAC5C,CAAC;IACD,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AAClE,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,MAAM,KAAK,GAAG,MAAM,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IACxD,OAAO,KAAK,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;AACnF,CAAC"}
@@ -0,0 +1,86 @@
1
+ import type { Comment, Reply } from './feedbackTypes.js';
2
+ import type { Participant } from './participants.js';
3
+ /**
4
+ * The two storage seams, and the difference between them is a safety property rather
5
+ * than a matter of style.
6
+ *
7
+ * `CommentStore` and `ParticipantStore` describe feedback: who said what, about which
8
+ * anchor. They get a second implementation later, backed by a cloud API.
9
+ *
10
+ * `SourceReader` describes the customer's code. It is abstracted so it can be faked in
11
+ * tests, and for no other reason. There is no second implementation and there must never
12
+ * be one: if source reading sat behind a swappable interface, a cloud implementation
13
+ * would be structurally able to read the customer's repository, and the guarantee that
14
+ * resolution never leaves the dev machine would decay from a constraint into a
15
+ * convention. Keeping the ports separate is what makes that guarantee checkable by
16
+ * looking at the types.
17
+ */
18
+ export interface CommentStore {
19
+ list(): Promise<Comment[]>;
20
+ create(input: Omit<Comment, 'id' | 'createdAt' | 'status' | 'replies'>): Promise<Comment>;
21
+ update(id: string, patch: Partial<Pick<Comment, 'body' | 'status'>>): Promise<Comment | null>;
22
+ remove(id: string): Promise<boolean>;
23
+ addReply(commentId: string, input: Omit<Reply, 'id' | 'createdAt'>): Promise<Reply | null>;
24
+ /** Null when either the comment or the reply is missing, matching addReply. */
25
+ updateReply(commentId: string, replyId: string, patch: Partial<Pick<Reply, 'body'>>): Promise<Reply | null>;
26
+ }
27
+ export type IdentifyOutcome = {
28
+ participant: Participant | null;
29
+ matchedBy: 'id' | 'ip' | 'none';
30
+ };
31
+ export interface ParticipantStore {
32
+ list(): Promise<Participant[]>;
33
+ /** Looks someone up by their stored id, falling back to a recent match on the address. */
34
+ identify(id: string | null, ip: string | null): Promise<IdentifyOutcome>;
35
+ save(input: {
36
+ id: string;
37
+ name: string;
38
+ ip: string | null;
39
+ }): Promise<Participant>;
40
+ }
41
+ export type DirectoryEntry = {
42
+ name: string;
43
+ isDirectory: boolean;
44
+ };
45
+ /**
46
+ * Reads the project on this machine. Local only, never substitutable.
47
+ *
48
+ * Every path is project-relative and resolved beneath the project root by the
49
+ * implementation; callers cannot reach outside it. That check lives here rather than at
50
+ * each call site so there is one place to get it right.
51
+ */
52
+ export interface SourceReader {
53
+ /** Absolute project root, needed by callers that must prove which project they serve. */
54
+ readonly projectRoot: string;
55
+ /**
56
+ * Absolute workspace root, or the project root when no workspace is declared.
57
+ *
58
+ * A monorepo app commonly imports its component library, and its stylesheets, from a
59
+ * sibling package outside the app root. Reads bounded to the project root cannot see
60
+ * them, which left every such codebase declining.
61
+ *
62
+ * This is a wider bound for a narrower capability, not a relaxed guard. It is discovered
63
+ * from the repository's own declaration - a pnpm workspace file, or `workspaces` in a
64
+ * package.json - never guessed and never supplied by a reviewer. If nothing declares a
65
+ * workspace it equals `projectRoot`, and behaviour is unchanged.
66
+ */
67
+ readonly workspaceRoot: string;
68
+ /** File contents, or null when the path is missing or escapes the project root. */
69
+ readFile(relativePath: string): Promise<string | null>;
70
+ /** True when the path exists and is a regular file inside the project. */
71
+ isFile(relativePath: string): Promise<boolean>;
72
+ listDirectory(relativePath: string): Promise<DirectoryEntry[]>;
73
+ /** Writes a generated artefact, such as a task doc, beneath the project root. */
74
+ writeArtefact(relativePath: string, contents: string): Promise<void>;
75
+ /**
76
+ * Reads beneath the workspace root, for export-time work on this machine only.
77
+ *
78
+ * Separated from `readFile` because the two have different threat models. `readFile`
79
+ * backs `/__fb/source`, which a remote reviewer's browser can reach in shared mode, so
80
+ * its bound is the project root and stays there. These run in the sidecar, at export,
81
+ * triggered by the developer, and are never wired to an HTTP route. The traversal guard
82
+ * is identical for both; only the permitted root differs.
83
+ */
84
+ readWorkspaceFile(relativePath: string): Promise<string | null>;
85
+ listWorkspaceDirectory(relativePath: string): Promise<DirectoryEntry[]>;
86
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ports.js","sourceRoot":"","sources":["../../src/core/ports.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ export declare function mintSecret(projectId: string): string;
2
+ /**
3
+ * The project this secret belongs to, or null if it does not say.
4
+ *
5
+ * Null for a secret minted before the id travelled inside - those still work, they just need the
6
+ * id supplied alongside. Returning null rather than throwing is what lets both live at once
7
+ * without the caller branching on a format version.
8
+ */
9
+ export declare function projectIdFromSecret(secret: string): string | null;
@@ -0,0 +1,57 @@
1
+ import { randomBytes } from 'node:crypto';
2
+ /**
3
+ * A project secret that says which project it belongs to.
4
+ *
5
+ * ## Why the id is inside it
6
+ *
7
+ * A build used to need two variables, `FEEDBACK_PROJECT_ID` and `FEEDBACK_SECRET`, and the first
8
+ * was redundant the whole time: the secret is per-project and unguessable, so it already
9
+ * identifies the project. Asking for both meant two things to copy, two things to get wrong, and
10
+ * a mismatch between them that fails with a signature error - which reads as a bad secret rather
11
+ * than as a mismatched pair.
12
+ *
13
+ * The alternative was resolving the id over the network at build time. That is a new way for a
14
+ * build to fail, on a request that has nothing to do with producing the artefact, so the id
15
+ * travels inside the value instead.
16
+ *
17
+ * ## Why not detect it from the repository
18
+ *
19
+ * Because the mapping is not one to one in either direction. A monorepo holds several apps, and
20
+ * one app is often built into more than one project - a staging preview and a production one
21
+ * have different reviewers and different comment histories. Nothing on disk distinguishes them.
22
+ * The secret is the identity, and it is the only thing that can be.
23
+ *
24
+ * ## The shape
25
+ *
26
+ * `sk_<projectId>.<material>` — the project id, a dot, then 32 random bytes. The dot is the
27
+ * separator because base64url cannot contain one, so the split is unambiguous however long
28
+ * either half becomes.
29
+ *
30
+ * The id being visible to anyone holding the secret costs nothing: it is public by design and
31
+ * ships inside the bundle, and someone with the secret already has strictly more than the id.
32
+ */
33
+ const secretPrefix = 'sk_';
34
+ export function mintSecret(projectId) {
35
+ return `${secretPrefix}${projectId}.${randomBytes(32).toString('base64url')}`;
36
+ }
37
+ /**
38
+ * The project this secret belongs to, or null if it does not say.
39
+ *
40
+ * Null for a secret minted before the id travelled inside - those still work, they just need the
41
+ * id supplied alongside. Returning null rather than throwing is what lets both live at once
42
+ * without the caller branching on a format version.
43
+ */
44
+ export function projectIdFromSecret(secret) {
45
+ if (!secret.startsWith(secretPrefix))
46
+ return null;
47
+ const rest = secret.slice(secretPrefix.length);
48
+ const at = rest.indexOf('.');
49
+ if (at <= 0)
50
+ return null;
51
+ const projectId = rest.slice(0, at);
52
+ // Shaped like an id we minted: a legacy `p_…` or a Cloud `prj_…` (the Worker's ULID-style
53
+ // id). A loose check here would let a secret with a stray dot in it resolve to nonsense, and
54
+ // the failure would land as an unauthorised upload.
55
+ return /^(?:p_[a-z0-9]{6,32}|prj_[0-7][0-9a-hjkmnp-tv-z]{25})$/.test(projectId) ? projectId : null;
56
+ }
57
+ //# sourceMappingURL=projectSecret.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projectSecret.js","sourceRoot":"","sources":["../../src/core/projectSecret.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,MAAM,YAAY,GAAG,KAAK,CAAC;AAE3B,MAAM,UAAU,UAAU,CAAC,SAAiB;IAC1C,OAAO,GAAG,YAAY,GAAG,SAAS,IAAI,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;AAChF,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAc;IAChD,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC;QAAE,OAAO,IAAI,CAAC;IAClD,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IAC/C,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC7B,IAAI,EAAE,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAEzB,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACpC,0FAA0F;IAC1F,6FAA6F;IAC7F,oDAAoD;IACpD,OAAO,wDAAwD,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;AACrG,CAAC"}
@@ -0,0 +1,117 @@
1
+ /**
2
+ * What the work order says, as data.
3
+ *
4
+ * ## Why this is separate from the code that renders it
5
+ *
6
+ * Almost all of a work order is our prose: the instructions to the agent, how scope is
7
+ * explained, how a stale anchor is worded. Measured on a real document, **82% of the non-blank
8
+ * lines are text and rules; 18% need the source tree.** The 82% is also exactly the part worth
9
+ * improving as we learn what agents actually do with it.
10
+ *
11
+ * Splitting it out lets that part be served by the cloud and improved for everyone, without
12
+ * anyone reinstalling the package. The rendering stays local, because rendering needs the
13
+ * source: excerpts, component spans, imports, design tokens. None of that is in the cloud and
14
+ * none of it should be.
15
+ *
16
+ * What the cloud does hold is the manifest - `manifest_entry` carries `file`, `line` and
17
+ * `component` in plain columns, because resolving an opaque id is what a manifest is for. The
18
+ * boundary is not "the cloud never sees a path"; it is that **the page never carries one**, so
19
+ * anyone holding a preview link cannot read the file tree. An earlier version of this comment
20
+ * claimed the stronger thing, which was never true of the manifest.
21
+ *
22
+ * ## Data, never code
23
+ *
24
+ * A recipe carries **text keyed by a fact, and numbers**. The conditions stay in the package:
25
+ * `if (facts.hasThreads)` is code and ships with the release. A recipe cannot decide to read a
26
+ * different file, or run anything, because there is nothing in it that could.
27
+ *
28
+ * The honest limit of that: a brand-new condition needs a package release, because the local
29
+ * code has to compute the fact. Rewording, reordering, dropping an instruction and tuning how
30
+ * much source is quoted are all free. Given where the 82% sits, that covers the cases we
31
+ * actually iterate on.
32
+ */
33
+ export type RecipeFacts = {
34
+ hasThreads: boolean;
35
+ hasLeafMismatch: boolean;
36
+ hasStyles: boolean;
37
+ hasScopeDirection: boolean;
38
+ cssUnavailable: boolean;
39
+ staleCount: number;
40
+ /** Substituted into `{taskWord}` so one string covers "One task is" and "3 tasks are". */
41
+ taskWord: string;
42
+ };
43
+ export type Recipe = {
44
+ version: number;
45
+ instructions: {
46
+ /** Emitted every time, in order. */
47
+ always: string[];
48
+ /** Emitted when the named fact is true, or greater than zero. */
49
+ when: Partial<Record<keyof RecipeFacts, string[]>>;
50
+ };
51
+ notices: {
52
+ staleAnchor: {
53
+ lead: string;
54
+ gone: string;
55
+ moved: string;
56
+ unknown: string;
57
+ followed: string;
58
+ };
59
+ cssUnavailable: Record<string, string>;
60
+ };
61
+ limits: {
62
+ /** Above this, reading a whole component costs about as much as reading the file. */
63
+ wholeComponentLimit: number;
64
+ /** A referenced component larger than this is quoted from its export rather than line 1. */
65
+ referenceSpanCap: number;
66
+ /** Context kept either side of the element being changed. */
67
+ elementPadding: number;
68
+ /** Lines of the component head that carry props, state and handler declarations. */
69
+ headLines: number;
70
+ };
71
+ };
72
+ /**
73
+ * The recipe that ships with the package.
74
+ *
75
+ * Extracted verbatim from what the renderer used to hold inline, so introducing this changed no
76
+ * output. It is also the floor: an unreachable cloud, a malformed download or a purely local
77
+ * project all land here, and all of them produce exactly the document they produced before.
78
+ */
79
+ export declare const bundledRecipe: Recipe;
80
+ /**
81
+ * Substitutes `{name}` from a set of values.
82
+ *
83
+ * The only transformation a recipe undergoes. An unknown placeholder is left as it is rather
84
+ * than blanked: a visible `{oops}` in the output is a bug someone reports, and an empty gap is a
85
+ * sentence that quietly stops making sense.
86
+ */
87
+ export declare function fill(template: string, values: Record<string, string | number>): string;
88
+ export type RecipeCheck = {
89
+ ok: true;
90
+ recipe: Recipe;
91
+ } | {
92
+ ok: false;
93
+ reason: string;
94
+ };
95
+ /**
96
+ * Checks a downloaded recipe before anything uses it.
97
+ *
98
+ * Structural, and deliberately strict about the parts whose absence would be invisible. A
99
+ * recipe missing `instructions.always` renders a work order with no instructions at all - which
100
+ * looks like a shorter document rather than a broken one, and an agent would follow it happily
101
+ * into the wrong file.
102
+ *
103
+ * Refusing is safe because there is always somewhere to fall back to.
104
+ */
105
+ export declare function checkRecipe(value: unknown): RecipeCheck;
106
+ /**
107
+ * The recipe to render with, given whatever was cached.
108
+ *
109
+ * Falls back rather than failing, and says which it used. An export that stops because our
110
+ * server is unreachable would make our downtime someone else's outage, over text that barely
111
+ * changes.
112
+ */
113
+ export declare function resolveRecipe(cached: unknown): {
114
+ recipe: Recipe;
115
+ source: 'cloud' | 'bundled';
116
+ reason?: string;
117
+ };