rivet-design 0.17.4 → 0.17.5

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 (798) hide show
  1. package/bin/rivet.js +0 -16
  2. package/dist/agent-variants/SessionStore.d.ts +0 -239
  3. package/dist/agent-variants/SessionStore.d.ts.map +1 -1
  4. package/dist/agent-variants/SessionStore.js +10 -368
  5. package/dist/agent-variants/SessionStore.js.map +1 -1
  6. package/dist/agent-variants/VariantWorkspaceManager.d.ts +0 -10
  7. package/dist/agent-variants/VariantWorkspaceManager.d.ts.map +1 -1
  8. package/dist/agent-variants/VariantWorkspaceManager.js +0 -17
  9. package/dist/agent-variants/VariantWorkspaceManager.js.map +1 -1
  10. package/dist/agent-variants/WorkerExecutorService.d.ts +1 -105
  11. package/dist/agent-variants/WorkerExecutorService.d.ts.map +1 -1
  12. package/dist/agent-variants/WorkerExecutorService.js +11 -182
  13. package/dist/agent-variants/WorkerExecutorService.js.map +1 -1
  14. package/dist/agent-variants/WorktreeOrchestrator.d.ts +0 -597
  15. package/dist/agent-variants/WorktreeOrchestrator.d.ts.map +1 -1
  16. package/dist/agent-variants/WorktreeOrchestrator.js +4 -1273
  17. package/dist/agent-variants/WorktreeOrchestrator.js.map +1 -1
  18. package/dist/agent-variants/WorktreeOrchestrator.testHelpers.d.ts +0 -6
  19. package/dist/agent-variants/WorktreeOrchestrator.testHelpers.d.ts.map +1 -1
  20. package/dist/agent-variants/WorktreeOrchestrator.testHelpers.js +0 -23
  21. package/dist/agent-variants/WorktreeOrchestrator.testHelpers.js.map +1 -1
  22. package/dist/agent-variants/briefContent.d.ts +0 -11
  23. package/dist/agent-variants/briefContent.d.ts.map +1 -1
  24. package/dist/agent-variants/briefContent.js +0 -12
  25. package/dist/agent-variants/briefContent.js.map +1 -1
  26. package/dist/agent-variants/contextAssets.d.ts +0 -3
  27. package/dist/agent-variants/contextAssets.d.ts.map +1 -1
  28. package/dist/agent-variants/contextAssets.js +0 -3
  29. package/dist/agent-variants/contextAssets.js.map +1 -1
  30. package/dist/agent-variants/contracts.d.ts +4 -492
  31. package/dist/agent-variants/contracts.d.ts.map +1 -1
  32. package/dist/agent-variants/contracts.js +0 -165
  33. package/dist/agent-variants/contracts.js.map +1 -1
  34. package/dist/agent-variants/createProjectArtifacts.d.ts +0 -17
  35. package/dist/agent-variants/createProjectArtifacts.d.ts.map +1 -1
  36. package/dist/agent-variants/createProjectArtifacts.js +0 -10
  37. package/dist/agent-variants/createProjectArtifacts.js.map +1 -1
  38. package/dist/agent-variants/diffQa.d.ts +0 -1
  39. package/dist/agent-variants/diffQa.d.ts.map +1 -1
  40. package/dist/agent-variants/diffQa.js +0 -1
  41. package/dist/agent-variants/diffQa.js.map +1 -1
  42. package/dist/agent-variants/directionAuthoring.d.ts +0 -13
  43. package/dist/agent-variants/directionAuthoring.d.ts.map +1 -1
  44. package/dist/agent-variants/directionAuthoring.js +12 -46
  45. package/dist/agent-variants/directionAuthoring.js.map +1 -1
  46. package/dist/agent-variants/elementRefToTarget.d.ts +0 -17
  47. package/dist/agent-variants/elementRefToTarget.d.ts.map +1 -1
  48. package/dist/agent-variants/elementRefToTarget.js +0 -17
  49. package/dist/agent-variants/elementRefToTarget.js.map +1 -1
  50. package/dist/agent-variants/generatedDestination.d.ts +0 -3
  51. package/dist/agent-variants/generatedDestination.d.ts.map +1 -1
  52. package/dist/agent-variants/generatedDestination.js +0 -3
  53. package/dist/agent-variants/generatedDestination.js.map +1 -1
  54. package/dist/agent-variants/previewQa.d.ts +0 -6
  55. package/dist/agent-variants/previewQa.d.ts.map +1 -1
  56. package/dist/agent-variants/previewQa.js +0 -5
  57. package/dist/agent-variants/previewQa.js.map +1 -1
  58. package/dist/agent-variants/runLabel.d.ts +0 -15
  59. package/dist/agent-variants/runLabel.d.ts.map +1 -1
  60. package/dist/agent-variants/runLabel.js +0 -19
  61. package/dist/agent-variants/runLabel.js.map +1 -1
  62. package/dist/agent-variants/runPlan.d.ts +3 -84
  63. package/dist/agent-variants/runPlan.d.ts.map +1 -1
  64. package/dist/agent-variants/runPlan.js +0 -51
  65. package/dist/agent-variants/runPlan.js.map +1 -1
  66. package/dist/agent-variants/sourceContext.d.ts +0 -10
  67. package/dist/agent-variants/sourceContext.d.ts.map +1 -1
  68. package/dist/agent-variants/sourceContext.js +0 -36
  69. package/dist/agent-variants/sourceContext.js.map +1 -1
  70. package/dist/agent-variants/variantContext.d.ts +0 -6
  71. package/dist/agent-variants/variantContext.d.ts.map +1 -1
  72. package/dist/agent-variants/variantContext.js +0 -9
  73. package/dist/agent-variants/variantContext.js.map +1 -1
  74. package/dist/agent-variants/videoKeyframes.d.ts +0 -7
  75. package/dist/agent-variants/videoKeyframes.d.ts.map +1 -1
  76. package/dist/agent-variants/videoKeyframes.js +0 -7
  77. package/dist/agent-variants/videoKeyframes.js.map +1 -1
  78. package/dist/agent-variants/workItemBriefing.d.ts +0 -21
  79. package/dist/agent-variants/workItemBriefing.d.ts.map +1 -1
  80. package/dist/agent-variants/workItemBriefing.js +0 -49
  81. package/dist/agent-variants/workItemBriefing.js.map +1 -1
  82. package/dist/agent-variants/workerRuntime.d.ts +1 -137
  83. package/dist/agent-variants/workerRuntime.d.ts.map +1 -1
  84. package/dist/agent-variants/workerRuntime.js +8 -147
  85. package/dist/agent-variants/workerRuntime.js.map +1 -1
  86. package/dist/cli/browser.d.ts +0 -1
  87. package/dist/cli/browser.d.ts.map +1 -1
  88. package/dist/cli/browser.js +0 -1
  89. package/dist/cli/browser.js.map +1 -1
  90. package/dist/cli/callerRunnerPaths.d.ts +0 -50
  91. package/dist/cli/callerRunnerPaths.d.ts.map +1 -1
  92. package/dist/cli/callerRunnerPaths.js +0 -59
  93. package/dist/cli/callerRunnerPaths.js.map +1 -1
  94. package/dist/cli/client.d.ts +0 -18
  95. package/dist/cli/client.d.ts.map +1 -1
  96. package/dist/cli/client.js +0 -28
  97. package/dist/cli/client.js.map +1 -1
  98. package/dist/cli/commandNames.d.ts +0 -7
  99. package/dist/cli/commandNames.d.ts.map +1 -1
  100. package/dist/cli/commandNames.js +0 -7
  101. package/dist/cli/commandNames.js.map +1 -1
  102. package/dist/cli/commands/auth.d.ts +0 -6
  103. package/dist/cli/commands/auth.d.ts.map +1 -1
  104. package/dist/cli/commands/auth.js +0 -6
  105. package/dist/cli/commands/auth.js.map +1 -1
  106. package/dist/cli/commands/elementSelector.d.ts +0 -6
  107. package/dist/cli/commands/elementSelector.d.ts.map +1 -1
  108. package/dist/cli/commands/elementSelector.js +0 -7
  109. package/dist/cli/commands/elementSelector.js.map +1 -1
  110. package/dist/cli/commands/evidence.d.ts +0 -6
  111. package/dist/cli/commands/evidence.d.ts.map +1 -1
  112. package/dist/cli/commands/evidence.js +0 -6
  113. package/dist/cli/commands/evidence.js.map +1 -1
  114. package/dist/cli/commands/libraryOpen.d.ts +0 -1
  115. package/dist/cli/commands/libraryOpen.d.ts.map +1 -1
  116. package/dist/cli/commands/libraryOpen.js +0 -4
  117. package/dist/cli/commands/libraryOpen.js.map +1 -1
  118. package/dist/cli/commands/mcpServe.d.ts +0 -24
  119. package/dist/cli/commands/mcpServe.d.ts.map +1 -1
  120. package/dist/cli/commands/mcpServe.js +31 -102
  121. package/dist/cli/commands/mcpServe.js.map +1 -1
  122. package/dist/cli/commands/open.d.ts +0 -8
  123. package/dist/cli/commands/open.d.ts.map +1 -1
  124. package/dist/cli/commands/open.js +0 -57
  125. package/dist/cli/commands/open.js.map +1 -1
  126. package/dist/cli/commands/reference.d.ts +0 -5
  127. package/dist/cli/commands/reference.d.ts.map +1 -1
  128. package/dist/cli/commands/reference.js +0 -27
  129. package/dist/cli/commands/reference.js.map +1 -1
  130. package/dist/cli/commands/serve.d.ts +0 -5
  131. package/dist/cli/commands/serve.d.ts.map +1 -1
  132. package/dist/cli/commands/serve.js +0 -34
  133. package/dist/cli/commands/serve.js.map +1 -1
  134. package/dist/cli/commands/shared.d.ts +0 -16
  135. package/dist/cli/commands/shared.d.ts.map +1 -1
  136. package/dist/cli/commands/shared.js +0 -19
  137. package/dist/cli/commands/shared.js.map +1 -1
  138. package/dist/cli/commands/status.d.ts +0 -6
  139. package/dist/cli/commands/status.d.ts.map +1 -1
  140. package/dist/cli/commands/status.js +0 -11
  141. package/dist/cli/commands/status.js.map +1 -1
  142. package/dist/cli/commands/stop.d.ts +0 -5
  143. package/dist/cli/commands/stop.d.ts.map +1 -1
  144. package/dist/cli/commands/stop.js +0 -6
  145. package/dist/cli/commands/stop.js.map +1 -1
  146. package/dist/cli/commands/update.d.ts +0 -1
  147. package/dist/cli/commands/update.d.ts.map +1 -1
  148. package/dist/cli/commands/update.js +0 -1
  149. package/dist/cli/commands/update.js.map +1 -1
  150. package/dist/cli/commands/variants.d.ts +0 -1
  151. package/dist/cli/commands/variants.d.ts.map +1 -1
  152. package/dist/cli/commands/variants.js +0 -31
  153. package/dist/cli/commands/variants.js.map +1 -1
  154. package/dist/cli/commands/wait.d.ts +0 -21
  155. package/dist/cli/commands/wait.d.ts.map +1 -1
  156. package/dist/cli/commands/wait.js +0 -23
  157. package/dist/cli/commands/wait.js.map +1 -1
  158. package/dist/cli/entry.d.ts +0 -10
  159. package/dist/cli/entry.d.ts.map +1 -1
  160. package/dist/cli/entry.js +0 -13
  161. package/dist/cli/entry.js.map +1 -1
  162. package/dist/cli/envelope.d.ts +1 -25
  163. package/dist/cli/envelope.d.ts.map +1 -1
  164. package/dist/cli/envelope.js +0 -19
  165. package/dist/cli/envelope.js.map +1 -1
  166. package/dist/cli/flags.d.ts +0 -7
  167. package/dist/cli/flags.d.ts.map +1 -1
  168. package/dist/cli/flags.js +0 -7
  169. package/dist/cli/flags.js.map +1 -1
  170. package/dist/cli/handoff.d.ts +0 -33
  171. package/dist/cli/handoff.d.ts.map +1 -1
  172. package/dist/cli/handoff.js +0 -42
  173. package/dist/cli/handoff.js.map +1 -1
  174. package/dist/cli/handoffStore.d.ts +0 -11
  175. package/dist/cli/handoffStore.d.ts.map +1 -1
  176. package/dist/cli/handoffStore.js +0 -10
  177. package/dist/cli/handoffStore.js.map +1 -1
  178. package/dist/cli/hostWorkNextAction.d.ts +0 -11
  179. package/dist/cli/hostWorkNextAction.d.ts.map +1 -1
  180. package/dist/cli/hostWorkNextAction.js +0 -4
  181. package/dist/cli/hostWorkNextAction.js.map +1 -1
  182. package/dist/cli/io.d.ts +0 -9
  183. package/dist/cli/io.d.ts.map +1 -1
  184. package/dist/cli/io.js +0 -1
  185. package/dist/cli/io.js.map +1 -1
  186. package/dist/cli/resolveDefaultNodeEnv.d.ts +0 -5
  187. package/dist/cli/resolveDefaultNodeEnv.d.ts.map +1 -1
  188. package/dist/cli/resolveDefaultNodeEnv.js +0 -5
  189. package/dist/cli/resolveDefaultNodeEnv.js.map +1 -1
  190. package/dist/cli/router.d.ts +0 -21
  191. package/dist/cli/router.d.ts.map +1 -1
  192. package/dist/cli/router.js +0 -46
  193. package/dist/cli/router.js.map +1 -1
  194. package/dist/cli/runnerSelection.d.ts +0 -58
  195. package/dist/cli/runnerSelection.d.ts.map +1 -1
  196. package/dist/cli/runnerSelection.js +0 -16
  197. package/dist/cli/runnerSelection.js.map +1 -1
  198. package/dist/cli/serverHandshake.d.ts +0 -36
  199. package/dist/cli/serverHandshake.d.ts.map +1 -1
  200. package/dist/cli/serverHandshake.js +0 -29
  201. package/dist/cli/serverHandshake.js.map +1 -1
  202. package/dist/cli/serverUnavailable.d.ts +0 -1
  203. package/dist/cli/serverUnavailable.d.ts.map +1 -1
  204. package/dist/cli/serverUnavailable.js +0 -1
  205. package/dist/cli/serverUnavailable.js.map +1 -1
  206. package/dist/cli/serverVersion.d.ts +0 -22
  207. package/dist/cli/serverVersion.d.ts.map +1 -1
  208. package/dist/cli/serverVersion.js +0 -12
  209. package/dist/cli/serverVersion.js.map +1 -1
  210. package/dist/cli/telemetry.d.ts +0 -4
  211. package/dist/cli/telemetry.d.ts.map +1 -1
  212. package/dist/cli/telemetry.js +0 -4
  213. package/dist/cli/telemetry.js.map +1 -1
  214. package/dist/config/evaluateFlags.d.ts +0 -4
  215. package/dist/config/evaluateFlags.d.ts.map +1 -1
  216. package/dist/config/evaluateFlags.js +0 -11
  217. package/dist/config/evaluateFlags.js.map +1 -1
  218. package/dist/config/featureFlagUserKey.d.ts +0 -3
  219. package/dist/config/featureFlagUserKey.d.ts.map +1 -1
  220. package/dist/config/featureFlagUserKey.js +0 -3
  221. package/dist/config/featureFlagUserKey.js.map +1 -1
  222. package/dist/config/flags.d.ts +0 -14
  223. package/dist/config/flags.d.ts.map +1 -1
  224. package/dist/config/flags.js +0 -27
  225. package/dist/config/flags.js.map +1 -1
  226. package/dist/config/proxy.d.ts +0 -3
  227. package/dist/config/proxy.d.ts.map +1 -1
  228. package/dist/config/proxy.js +0 -11
  229. package/dist/config/proxy.js.map +1 -1
  230. package/dist/config/telemetry.d.ts +0 -13
  231. package/dist/config/telemetry.d.ts.map +1 -1
  232. package/dist/config/telemetry.js +0 -13
  233. package/dist/config/telemetry.js.map +1 -1
  234. package/dist/config/telemetryContract.d.ts +0 -1
  235. package/dist/config/telemetryContract.d.ts.map +1 -1
  236. package/dist/config/telemetryContract.js +0 -1
  237. package/dist/config/telemetryContract.js.map +1 -1
  238. package/dist/hosts/workerDefaults.d.ts +0 -69
  239. package/dist/hosts/workerDefaults.d.ts.map +1 -1
  240. package/dist/hosts/workerDefaults.js +0 -68
  241. package/dist/hosts/workerDefaults.js.map +1 -1
  242. package/dist/index-core.d.ts.map +1 -1
  243. package/dist/index-core.js +0 -2
  244. package/dist/index-core.js.map +1 -1
  245. package/dist/index.d.ts +0 -20
  246. package/dist/index.d.ts.map +1 -1
  247. package/dist/index.js +2 -105
  248. package/dist/index.js.map +1 -1
  249. package/dist/install/allowlists.d.ts +0 -32
  250. package/dist/install/allowlists.d.ts.map +1 -1
  251. package/dist/install/allowlists.js +0 -44
  252. package/dist/install/allowlists.js.map +1 -1
  253. package/dist/install/automaticCliUpdate.d.ts +0 -6
  254. package/dist/install/automaticCliUpdate.d.ts.map +1 -1
  255. package/dist/install/automaticCliUpdate.js +0 -13
  256. package/dist/install/automaticCliUpdate.js.map +1 -1
  257. package/dist/install/channelCli.d.ts +0 -1
  258. package/dist/install/channelCli.d.ts.map +1 -1
  259. package/dist/install/channelCli.js +0 -3
  260. package/dist/install/channelCli.js.map +1 -1
  261. package/dist/install/channelManager.d.ts +0 -14
  262. package/dist/install/channelManager.d.ts.map +1 -1
  263. package/dist/install/channelManager.js +0 -22
  264. package/dist/install/channelManager.js.map +1 -1
  265. package/dist/install/codexGuidance.d.ts +0 -1
  266. package/dist/install/codexGuidance.d.ts.map +1 -1
  267. package/dist/install/codexGuidance.js +0 -7
  268. package/dist/install/codexGuidance.js.map +1 -1
  269. package/dist/install/globalBootstrap.d.ts +0 -25
  270. package/dist/install/globalBootstrap.d.ts.map +1 -1
  271. package/dist/install/globalBootstrap.js +0 -10
  272. package/dist/install/globalBootstrap.js.map +1 -1
  273. package/dist/install/harnesses.d.ts +0 -66
  274. package/dist/install/harnesses.d.ts.map +1 -1
  275. package/dist/install/harnesses.js +0 -60
  276. package/dist/install/harnesses.js.map +1 -1
  277. package/dist/install/installationChannel.d.ts +0 -1
  278. package/dist/install/installationChannel.d.ts.map +1 -1
  279. package/dist/install/installationChannel.js +0 -1
  280. package/dist/install/installationChannel.js.map +1 -1
  281. package/dist/install/legacyMcp.d.ts +0 -23
  282. package/dist/install/legacyMcp.d.ts.map +1 -1
  283. package/dist/install/legacyMcp.js +3 -46
  284. package/dist/install/legacyMcp.js.map +1 -1
  285. package/dist/install/mcpRegistration.d.ts +0 -41
  286. package/dist/install/mcpRegistration.d.ts.map +1 -1
  287. package/dist/install/mcpRegistration.js +2 -70
  288. package/dist/install/mcpRegistration.js.map +1 -1
  289. package/dist/library/HubClient.d.ts +0 -2
  290. package/dist/library/HubClient.d.ts.map +1 -1
  291. package/dist/library/HubClient.js +0 -4
  292. package/dist/library/HubClient.js.map +1 -1
  293. package/dist/library/HubServer.d.ts +0 -1
  294. package/dist/library/HubServer.d.ts.map +1 -1
  295. package/dist/library/HubServer.js +0 -1
  296. package/dist/library/HubServer.js.map +1 -1
  297. package/dist/library/StaticPreviewServer.d.ts +0 -1
  298. package/dist/library/StaticPreviewServer.d.ts.map +1 -1
  299. package/dist/library/StaticPreviewServer.js +0 -1
  300. package/dist/library/StaticPreviewServer.js.map +1 -1
  301. package/dist/library/http.d.ts +0 -2
  302. package/dist/library/http.d.ts.map +1 -1
  303. package/dist/library/http.js +0 -2
  304. package/dist/library/http.js.map +1 -1
  305. package/dist/library/importFiles.d.ts +0 -6
  306. package/dist/library/importFiles.d.ts.map +1 -1
  307. package/dist/library/importFiles.js +45 -11
  308. package/dist/library/importFiles.js.map +1 -1
  309. package/dist/mcp/changeBatchClassification.d.ts +0 -40
  310. package/dist/mcp/changeBatchClassification.d.ts.map +1 -1
  311. package/dist/mcp/changeBatchClassification.js +0 -34
  312. package/dist/mcp/changeBatchClassification.js.map +1 -1
  313. package/dist/prompts/commentVariationPrompts.d.ts +0 -5
  314. package/dist/prompts/commentVariationPrompts.d.ts.map +1 -1
  315. package/dist/prompts/commentVariationPrompts.js +0 -5
  316. package/dist/prompts/commentVariationPrompts.js.map +1 -1
  317. package/dist/prototype-host.js +0 -15
  318. package/dist/prototype-host.js.map +1 -1
  319. package/dist/proxy-middleware/preview-bridge.d.ts +0 -2
  320. package/dist/proxy-middleware/preview-bridge.d.ts.map +1 -1
  321. package/dist/proxy-middleware/preview-bridge.js +0 -2
  322. package/dist/proxy-middleware/preview-bridge.js.map +1 -1
  323. package/dist/proxy-middleware/preview-connections.d.ts +0 -1
  324. package/dist/proxy-middleware/preview-connections.d.ts.map +1 -1
  325. package/dist/proxy-middleware/preview-connections.js +0 -1
  326. package/dist/proxy-middleware/preview-connections.js.map +1 -1
  327. package/dist/proxy-middleware/proxy-config.d.ts +0 -12
  328. package/dist/proxy-middleware/proxy-config.d.ts.map +1 -1
  329. package/dist/proxy-middleware/proxy-config.js +2 -49
  330. package/dist/proxy-middleware/proxy-config.js.map +1 -1
  331. package/dist/routes/account.d.ts +0 -1
  332. package/dist/routes/account.d.ts.map +1 -1
  333. package/dist/routes/account.js +0 -2
  334. package/dist/routes/account.js.map +1 -1
  335. package/dist/routes/agentVariants.d.ts +0 -15
  336. package/dist/routes/agentVariants.d.ts.map +1 -1
  337. package/dist/routes/agentVariants.js +6 -320
  338. package/dist/routes/agentVariants.js.map +1 -1
  339. package/dist/routes/cli.d.ts +0 -17
  340. package/dist/routes/cli.d.ts.map +1 -1
  341. package/dist/routes/cli.js +0 -13
  342. package/dist/routes/cli.js.map +1 -1
  343. package/dist/routes/emptyStatePage.d.ts +0 -12
  344. package/dist/routes/emptyStatePage.d.ts.map +1 -1
  345. package/dist/routes/emptyStatePage.js +0 -12
  346. package/dist/routes/emptyStatePage.js.map +1 -1
  347. package/dist/routes/git.d.ts.map +1 -1
  348. package/dist/routes/git.js +0 -13
  349. package/dist/routes/git.js.map +1 -1
  350. package/dist/routes/inlineStartTracker.d.ts +0 -16
  351. package/dist/routes/inlineStartTracker.d.ts.map +1 -1
  352. package/dist/routes/inlineStartTracker.js.map +1 -1
  353. package/dist/routes/integrations.d.ts +0 -6
  354. package/dist/routes/integrations.d.ts.map +1 -1
  355. package/dist/routes/integrations.js +0 -6
  356. package/dist/routes/integrations.js.map +1 -1
  357. package/dist/routes/library/app.d.ts +0 -1
  358. package/dist/routes/library/app.d.ts.map +1 -1
  359. package/dist/routes/library/app.js +0 -1
  360. package/dist/routes/library/app.js.map +1 -1
  361. package/dist/routes/library/index.d.ts +0 -1
  362. package/dist/routes/library/index.d.ts.map +1 -1
  363. package/dist/routes/library/index.js +0 -1
  364. package/dist/routes/library/index.js.map +1 -1
  365. package/dist/routes/library/middleware.d.ts +0 -3
  366. package/dist/routes/library/middleware.d.ts.map +1 -1
  367. package/dist/routes/library/middleware.js +0 -4
  368. package/dist/routes/library/middleware.js.map +1 -1
  369. package/dist/routes/library/navigation.d.ts +0 -1
  370. package/dist/routes/library/navigation.d.ts.map +1 -1
  371. package/dist/routes/library/navigation.js +0 -1
  372. package/dist/routes/library/navigation.js.map +1 -1
  373. package/dist/routes/library/projects.d.ts +0 -1
  374. package/dist/routes/library/projects.d.ts.map +1 -1
  375. package/dist/routes/library/projects.js +0 -1
  376. package/dist/routes/library/projects.js.map +1 -1
  377. package/dist/routes/library/staticPreview.d.ts +0 -1
  378. package/dist/routes/library/staticPreview.d.ts.map +1 -1
  379. package/dist/routes/library/staticPreview.js +0 -1
  380. package/dist/routes/library/staticPreview.js.map +1 -1
  381. package/dist/routes/library/variants.d.ts +0 -1
  382. package/dist/routes/library/variants.d.ts.map +1 -1
  383. package/dist/routes/library/variants.js +0 -1
  384. package/dist/routes/library/variants.js.map +1 -1
  385. package/dist/routes/mcp.d.ts +0 -3
  386. package/dist/routes/mcp.d.ts.map +1 -1
  387. package/dist/routes/mcp.js +0 -5
  388. package/dist/routes/mcp.js.map +1 -1
  389. package/dist/routes/prototypeHost.d.ts +0 -2
  390. package/dist/routes/prototypeHost.d.ts.map +1 -1
  391. package/dist/routes/prototypeHost.js +6 -32
  392. package/dist/routes/prototypeHost.js.map +1 -1
  393. package/dist/routes/static.d.ts +0 -3
  394. package/dist/routes/static.d.ts.map +1 -1
  395. package/dist/routes/static.js +0 -6
  396. package/dist/routes/static.js.map +1 -1
  397. package/dist/routes/support.d.ts +0 -3
  398. package/dist/routes/support.d.ts.map +1 -1
  399. package/dist/routes/support.js +0 -3
  400. package/dist/routes/support.js.map +1 -1
  401. package/dist/server.d.ts +0 -42
  402. package/dist/server.d.ts.map +1 -1
  403. package/dist/server.js +1 -129
  404. package/dist/server.js.map +1 -1
  405. package/dist/services/AuthService.d.ts +0 -76
  406. package/dist/services/AuthService.d.ts.map +1 -1
  407. package/dist/services/AuthService.js +0 -112
  408. package/dist/services/AuthService.js.map +1 -1
  409. package/dist/services/BrowserAgentClient.d.ts +1 -21
  410. package/dist/services/BrowserAgentClient.d.ts.map +1 -1
  411. package/dist/services/BrowserAgentClient.js +0 -10
  412. package/dist/services/BrowserAgentClient.js.map +1 -1
  413. package/dist/services/BundleStore.d.ts +0 -18
  414. package/dist/services/BundleStore.d.ts.map +1 -1
  415. package/dist/services/BundleStore.js +0 -10
  416. package/dist/services/BundleStore.js.map +1 -1
  417. package/dist/services/CliLogForwarder.d.ts +0 -26
  418. package/dist/services/CliLogForwarder.d.ts.map +1 -1
  419. package/dist/services/CliLogForwarder.js +1 -33
  420. package/dist/services/CliLogForwarder.js.map +1 -1
  421. package/dist/services/CommitMessageGenerator.d.ts +0 -6
  422. package/dist/services/CommitMessageGenerator.d.ts.map +1 -1
  423. package/dist/services/CommitMessageGenerator.js +0 -3
  424. package/dist/services/CommitMessageGenerator.js.map +1 -1
  425. package/dist/services/ComponentSearchService.d.ts +2 -16
  426. package/dist/services/ComponentSearchService.d.ts.map +1 -1
  427. package/dist/services/ComponentSearchService.js +2 -56
  428. package/dist/services/ComponentSearchService.js.map +1 -1
  429. package/dist/services/ConfigManager.d.ts +0 -113
  430. package/dist/services/ConfigManager.d.ts.map +1 -1
  431. package/dist/services/ConfigManager.js +0 -101
  432. package/dist/services/ConfigManager.js.map +1 -1
  433. package/dist/services/DependencyPreparationService.d.ts +0 -6
  434. package/dist/services/DependencyPreparationService.d.ts.map +1 -1
  435. package/dist/services/DependencyPreparationService.js +0 -22
  436. package/dist/services/DependencyPreparationService.js.map +1 -1
  437. package/dist/services/DevServerRuntimeService.d.ts +0 -20
  438. package/dist/services/DevServerRuntimeService.d.ts.map +1 -1
  439. package/dist/services/DevServerRuntimeService.js +0 -46
  440. package/dist/services/DevServerRuntimeService.js.map +1 -1
  441. package/dist/services/FeatureFlagService.d.ts +0 -15
  442. package/dist/services/FeatureFlagService.d.ts.map +1 -1
  443. package/dist/services/FeatureFlagService.js +0 -23
  444. package/dist/services/FeatureFlagService.js.map +1 -1
  445. package/dist/services/GatewayClient.d.ts +0 -27
  446. package/dist/services/GatewayClient.d.ts.map +1 -1
  447. package/dist/services/GatewayClient.js +0 -25
  448. package/dist/services/GatewayClient.js.map +1 -1
  449. package/dist/services/HistoryReplayService.d.ts +0 -31
  450. package/dist/services/HistoryReplayService.d.ts.map +1 -1
  451. package/dist/services/HistoryReplayService.js +2 -55
  452. package/dist/services/HistoryReplayService.js.map +1 -1
  453. package/dist/services/HubDiscovery.d.ts +0 -8
  454. package/dist/services/HubDiscovery.d.ts.map +1 -1
  455. package/dist/services/HubDiscovery.js +0 -8
  456. package/dist/services/HubDiscovery.js.map +1 -1
  457. package/dist/services/HubNavigation.d.ts +0 -6
  458. package/dist/services/HubNavigation.d.ts.map +1 -1
  459. package/dist/services/HubNavigation.js +5 -8
  460. package/dist/services/HubNavigation.js.map +1 -1
  461. package/dist/services/IntegrationsClient.d.ts +0 -34
  462. package/dist/services/IntegrationsClient.d.ts.map +1 -1
  463. package/dist/services/IntegrationsClient.js +0 -27
  464. package/dist/services/IntegrationsClient.js.map +1 -1
  465. package/dist/services/LocalGitService.d.ts +0 -57
  466. package/dist/services/LocalGitService.d.ts.map +1 -1
  467. package/dist/services/LocalGitService.js +4 -85
  468. package/dist/services/LocalGitService.js.map +1 -1
  469. package/dist/services/MCPOnboardingTelemetry.d.ts +0 -9
  470. package/dist/services/MCPOnboardingTelemetry.d.ts.map +1 -1
  471. package/dist/services/MCPOnboardingTelemetry.js +0 -9
  472. package/dist/services/MCPOnboardingTelemetry.js.map +1 -1
  473. package/dist/services/MCPVariantsTelemetry.d.ts +0 -2
  474. package/dist/services/MCPVariantsTelemetry.d.ts.map +1 -1
  475. package/dist/services/MCPVariantsTelemetry.js +0 -2
  476. package/dist/services/MCPVariantsTelemetry.js.map +1 -1
  477. package/dist/services/OperatingSystemServices.d.ts +0 -12
  478. package/dist/services/OperatingSystemServices.d.ts.map +1 -1
  479. package/dist/services/OperatingSystemServices.js +0 -7
  480. package/dist/services/OperatingSystemServices.js.map +1 -1
  481. package/dist/services/PRTitleGenerator.d.ts +0 -7
  482. package/dist/services/PRTitleGenerator.d.ts.map +1 -1
  483. package/dist/services/PRTitleGenerator.js +0 -3
  484. package/dist/services/PRTitleGenerator.js.map +1 -1
  485. package/dist/services/ProjectCardPreviews.d.ts +0 -5
  486. package/dist/services/ProjectCardPreviews.d.ts.map +1 -1
  487. package/dist/services/ProjectCardPreviews.js +0 -5
  488. package/dist/services/ProjectCardPreviews.js.map +1 -1
  489. package/dist/services/ProjectDetectionService.d.ts +0 -4
  490. package/dist/services/ProjectDetectionService.d.ts.map +1 -1
  491. package/dist/services/ProjectDetectionService.js +2 -44
  492. package/dist/services/ProjectDetectionService.js.map +1 -1
  493. package/dist/services/ProjectFolderPicker.d.ts +0 -3
  494. package/dist/services/ProjectFolderPicker.d.ts.map +1 -1
  495. package/dist/services/ProjectFolderPicker.js +0 -4
  496. package/dist/services/ProjectFolderPicker.js.map +1 -1
  497. package/dist/services/ProjectImport.d.ts +0 -1
  498. package/dist/services/ProjectImport.d.ts.map +1 -1
  499. package/dist/services/ProjectImport.js +0 -3
  500. package/dist/services/ProjectImport.js.map +1 -1
  501. package/dist/services/ProjectLibrary.d.ts +0 -18
  502. package/dist/services/ProjectLibrary.d.ts.map +1 -1
  503. package/dist/services/ProjectLibrary.js +0 -20
  504. package/dist/services/ProjectLibrary.js.map +1 -1
  505. package/dist/services/ProjectMetadataStore.d.ts +0 -73
  506. package/dist/services/ProjectMetadataStore.d.ts.map +1 -1
  507. package/dist/services/ProjectMetadataStore.js +0 -90
  508. package/dist/services/ProjectMetadataStore.js.map +1 -1
  509. package/dist/services/ProjectPackageManager.d.ts +0 -12
  510. package/dist/services/ProjectPackageManager.d.ts.map +1 -1
  511. package/dist/services/ProjectPackageManager.js +0 -16
  512. package/dist/services/ProjectPackageManager.js.map +1 -1
  513. package/dist/services/ProjectRegistry.d.ts +0 -16
  514. package/dist/services/ProjectRegistry.d.ts.map +1 -1
  515. package/dist/services/ProjectRegistry.js +0 -18
  516. package/dist/services/ProjectRegistry.js.map +1 -1
  517. package/dist/services/ProjectRuntimeService.d.ts +0 -4
  518. package/dist/services/ProjectRuntimeService.d.ts.map +1 -1
  519. package/dist/services/ProjectRuntimeService.js +0 -5
  520. package/dist/services/ProjectRuntimeService.js.map +1 -1
  521. package/dist/services/ProjectScreenshotService.d.ts +0 -5
  522. package/dist/services/ProjectScreenshotService.d.ts.map +1 -1
  523. package/dist/services/ProjectScreenshotService.js +0 -6
  524. package/dist/services/ProjectScreenshotService.js.map +1 -1
  525. package/dist/services/ProjectStorage.d.ts +0 -4
  526. package/dist/services/ProjectStorage.d.ts.map +1 -1
  527. package/dist/services/ProjectStorage.js +0 -4
  528. package/dist/services/ProjectStorage.js.map +1 -1
  529. package/dist/services/PrototypeBuildService.d.ts +1 -23
  530. package/dist/services/PrototypeBuildService.d.ts.map +1 -1
  531. package/dist/services/PrototypeBuildService.js +6 -31
  532. package/dist/services/PrototypeBuildService.js.map +1 -1
  533. package/dist/services/PrototypeDeployService.d.ts +0 -20
  534. package/dist/services/PrototypeDeployService.d.ts.map +1 -1
  535. package/dist/services/PrototypeDeployService.js +1 -24
  536. package/dist/services/PrototypeDeployService.js.map +1 -1
  537. package/dist/services/RequestAuthContext.d.ts +0 -5
  538. package/dist/services/RequestAuthContext.d.ts.map +1 -1
  539. package/dist/services/RequestAuthContext.js +0 -5
  540. package/dist/services/RequestAuthContext.js.map +1 -1
  541. package/dist/services/SessionBridgeService.d.ts.map +1 -1
  542. package/dist/services/SessionBridgeService.js +0 -2
  543. package/dist/services/SessionBridgeService.js.map +1 -1
  544. package/dist/services/SessionService.d.ts +0 -4
  545. package/dist/services/SessionService.d.ts.map +1 -1
  546. package/dist/services/SessionService.js +1 -22
  547. package/dist/services/SessionService.js.map +1 -1
  548. package/dist/services/StaticFileService.d.ts +0 -9
  549. package/dist/services/StaticFileService.d.ts.map +1 -1
  550. package/dist/services/StaticFileService.js +0 -11
  551. package/dist/services/StaticFileService.js.map +1 -1
  552. package/dist/services/StaticLibraryPreviews.d.ts +0 -3
  553. package/dist/services/StaticLibraryPreviews.d.ts.map +1 -1
  554. package/dist/services/StaticLibraryPreviews.js +0 -3
  555. package/dist/services/StaticLibraryPreviews.js.map +1 -1
  556. package/dist/services/StaticPreviewServer.d.ts +0 -16
  557. package/dist/services/StaticPreviewServer.d.ts.map +1 -1
  558. package/dist/services/StaticPreviewServer.js +2 -28
  559. package/dist/services/StaticPreviewServer.js.map +1 -1
  560. package/dist/services/SupabaseAuthService.d.ts +0 -11
  561. package/dist/services/SupabaseAuthService.d.ts.map +1 -1
  562. package/dist/services/SupabaseAuthService.js +0 -11
  563. package/dist/services/SupabaseAuthService.js.map +1 -1
  564. package/dist/services/SupportTicketService.d.ts +0 -4
  565. package/dist/services/SupportTicketService.d.ts.map +1 -1
  566. package/dist/services/SupportTicketService.js +0 -4
  567. package/dist/services/SupportTicketService.js.map +1 -1
  568. package/dist/services/TelemetryService.d.ts +0 -182
  569. package/dist/services/TelemetryService.d.ts.map +1 -1
  570. package/dist/services/TelemetryService.js +0 -193
  571. package/dist/services/TelemetryService.js.map +1 -1
  572. package/dist/services/TreeStore.d.ts +0 -72
  573. package/dist/services/TreeStore.d.ts.map +1 -1
  574. package/dist/services/TreeStore.js +0 -93
  575. package/dist/services/TreeStore.js.map +1 -1
  576. package/dist/services/VariantGenerationService.d.ts +0 -32
  577. package/dist/services/VariantGenerationService.d.ts.map +1 -1
  578. package/dist/services/VariantGenerationService.js +5 -62
  579. package/dist/services/VariantGenerationService.js.map +1 -1
  580. package/dist/services/VariantHistoryService.d.ts +0 -114
  581. package/dist/services/VariantHistoryService.d.ts.map +1 -1
  582. package/dist/services/VariantHistoryService.js +2 -144
  583. package/dist/services/VariantHistoryService.js.map +1 -1
  584. package/dist/services/VariantRunService.d.ts +0 -31
  585. package/dist/services/VariantRunService.d.ts.map +1 -1
  586. package/dist/services/VariantRunService.js +0 -35
  587. package/dist/services/VariantRunService.js.map +1 -1
  588. package/dist/services/VariantsRuntime.d.ts +0 -3
  589. package/dist/services/VariantsRuntime.d.ts.map +1 -1
  590. package/dist/services/VariantsRuntime.js +0 -5
  591. package/dist/services/VariantsRuntime.js.map +1 -1
  592. package/dist/services/WorktreeManager.d.ts +0 -217
  593. package/dist/services/WorktreeManager.d.ts.map +1 -1
  594. package/dist/services/WorktreeManager.js +3 -321
  595. package/dist/services/WorktreeManager.js.map +1 -1
  596. package/dist/services/accessTokenRefresh.d.ts +0 -25
  597. package/dist/services/accessTokenRefresh.d.ts.map +1 -1
  598. package/dist/services/accessTokenRefresh.js +0 -25
  599. package/dist/services/accessTokenRefresh.js.map +1 -1
  600. package/dist/services/adapters/TailwindTokenAdapter.d.ts +0 -29
  601. package/dist/services/adapters/TailwindTokenAdapter.d.ts.map +1 -1
  602. package/dist/services/adapters/TailwindTokenAdapter.js +1 -46
  603. package/dist/services/adapters/TailwindTokenAdapter.js.map +1 -1
  604. package/dist/services/createAgentVariantsOrchestrator.d.ts +0 -18
  605. package/dist/services/createAgentVariantsOrchestrator.d.ts.map +1 -1
  606. package/dist/services/createAgentVariantsOrchestrator.js +0 -22
  607. package/dist/services/createAgentVariantsOrchestrator.js.map +1 -1
  608. package/dist/services/extractors/CSSVariableExtractor.d.ts +0 -25
  609. package/dist/services/extractors/CSSVariableExtractor.d.ts.map +1 -1
  610. package/dist/services/extractors/CSSVariableExtractor.js +1 -42
  611. package/dist/services/extractors/CSSVariableExtractor.js.map +1 -1
  612. package/dist/services/historyRoots.d.ts +0 -12
  613. package/dist/services/historyRoots.d.ts.map +1 -1
  614. package/dist/services/historyRoots.js +0 -13
  615. package/dist/services/historyRoots.js.map +1 -1
  616. package/dist/services/libraryErrors.d.ts +0 -1
  617. package/dist/services/libraryErrors.d.ts.map +1 -1
  618. package/dist/services/libraryErrors.js +0 -1
  619. package/dist/services/libraryErrors.js.map +1 -1
  620. package/dist/services/pendingLogin.d.ts +0 -13
  621. package/dist/services/pendingLogin.d.ts.map +1 -1
  622. package/dist/services/pendingLogin.js +0 -3
  623. package/dist/services/pendingLogin.js.map +1 -1
  624. package/dist/services/staticProjectTarget.d.ts +0 -4
  625. package/dist/services/staticProjectTarget.d.ts.map +1 -1
  626. package/dist/services/staticProjectTarget.js +0 -4
  627. package/dist/services/staticProjectTarget.js.map +1 -1
  628. package/dist/services/staticStarter.d.ts +0 -20
  629. package/dist/services/staticStarter.d.ts.map +1 -1
  630. package/dist/services/staticStarter.js +0 -20
  631. package/dist/services/staticStarter.js.map +1 -1
  632. package/dist/services/templates/designCatalog.d.ts +0 -11
  633. package/dist/services/templates/designCatalog.d.ts.map +1 -1
  634. package/dist/services/templates/designCatalog.js +0 -26
  635. package/dist/services/templates/designCatalog.js.map +1 -1
  636. package/dist/services/templates/viteReactTs.d.ts +0 -26
  637. package/dist/services/templates/viteReactTs.d.ts.map +1 -1
  638. package/dist/services/templates/viteReactTs.js +0 -20
  639. package/dist/services/templates/viteReactTs.js.map +1 -1
  640. package/dist/storage/library/BundleMetadataStore.d.ts +0 -16
  641. package/dist/storage/library/BundleMetadataStore.d.ts.map +1 -1
  642. package/dist/storage/library/BundleMetadataStore.js +0 -17
  643. package/dist/storage/library/BundleMetadataStore.js.map +1 -1
  644. package/dist/storage/library/CoordinatorRecords.d.ts +0 -9
  645. package/dist/storage/library/CoordinatorRecords.d.ts.map +1 -1
  646. package/dist/storage/library/CoordinatorRecords.js +0 -9
  647. package/dist/storage/library/CoordinatorRecords.js.map +1 -1
  648. package/dist/storage/library/ProjectPreviewCache.d.ts +0 -4
  649. package/dist/storage/library/ProjectPreviewCache.d.ts.map +1 -1
  650. package/dist/storage/library/ProjectPreviewCache.js +0 -4
  651. package/dist/storage/library/ProjectPreviewCache.js.map +1 -1
  652. package/dist/storage/library/ProjectRecords.d.ts +0 -17
  653. package/dist/storage/library/ProjectRecords.d.ts.map +1 -1
  654. package/dist/storage/library/ProjectRecords.js +0 -17
  655. package/dist/storage/library/ProjectRecords.js.map +1 -1
  656. package/dist/storage/library/database.d.ts +0 -3
  657. package/dist/storage/library/database.d.ts.map +1 -1
  658. package/dist/storage/library/database.js +0 -3
  659. package/dist/storage/library/database.js.map +1 -1
  660. package/dist/storage/library/migrations.d.ts +0 -2
  661. package/dist/storage/library/migrations.d.ts.map +1 -1
  662. package/dist/storage/library/migrations.js +0 -2
  663. package/dist/storage/library/migrations.js.map +1 -1
  664. package/dist/storage/library/sourcePresentation.d.ts +0 -1
  665. package/dist/storage/library/sourcePresentation.d.ts.map +1 -1
  666. package/dist/storage/library/sourcePresentation.js +0 -1
  667. package/dist/storage/library/sourcePresentation.js.map +1 -1
  668. package/dist/storage/project-metadata/ProjectMetadataRecords.d.ts +0 -11
  669. package/dist/storage/project-metadata/ProjectMetadataRecords.d.ts.map +1 -1
  670. package/dist/storage/project-metadata/ProjectMetadataRecords.js +0 -13
  671. package/dist/storage/project-metadata/ProjectMetadataRecords.js.map +1 -1
  672. package/dist/storage/project-metadata/database.d.ts +0 -1
  673. package/dist/storage/project-metadata/database.d.ts.map +1 -1
  674. package/dist/storage/project-metadata/database.js +0 -7
  675. package/dist/storage/project-metadata/database.js.map +1 -1
  676. package/dist/storage/project-metadata/migrations.d.ts +0 -42
  677. package/dist/storage/project-metadata/migrations.d.ts.map +1 -1
  678. package/dist/storage/project-metadata/migrations.js +0 -41
  679. package/dist/storage/project-metadata/migrations.js.map +1 -1
  680. package/dist/types/account.d.ts +0 -1
  681. package/dist/types/account.d.ts.map +1 -1
  682. package/dist/types/change-request-types.d.ts +0 -167
  683. package/dist/types/change-request-types.d.ts.map +1 -1
  684. package/dist/types/change-types.d.ts +0 -1
  685. package/dist/types/change-types.d.ts.map +1 -1
  686. package/dist/types/change-types.js +0 -1
  687. package/dist/types/change-types.js.map +1 -1
  688. package/dist/types/project-library.d.ts +0 -1
  689. package/dist/types/project-library.d.ts.map +1 -1
  690. package/dist/types/style-manipulation-types.d.ts +0 -69
  691. package/dist/types/style-manipulation-types.d.ts.map +1 -1
  692. package/dist/types/style-manipulation-types.js +0 -26
  693. package/dist/types/style-manipulation-types.js.map +1 -1
  694. package/dist/types/token-types.d.ts +0 -30
  695. package/dist/types/token-types.d.ts.map +1 -1
  696. package/dist/types/token-types.js +0 -1
  697. package/dist/types/token-types.js.map +1 -1
  698. package/dist/types/variant-history.d.ts +0 -39
  699. package/dist/types/variant-history.d.ts.map +1 -1
  700. package/dist/utils/branchNames.d.ts +0 -1
  701. package/dist/utils/branchNames.d.ts.map +1 -1
  702. package/dist/utils/branchNames.js +0 -2
  703. package/dist/utils/branchNames.js.map +1 -1
  704. package/dist/utils/cloneOrCopyDirSync.d.ts +0 -12
  705. package/dist/utils/cloneOrCopyDirSync.d.ts.map +1 -1
  706. package/dist/utils/cloneOrCopyDirSync.js +0 -16
  707. package/dist/utils/cloneOrCopyDirSync.js.map +1 -1
  708. package/dist/utils/devServerCommand.d.ts +0 -23
  709. package/dist/utils/devServerCommand.d.ts.map +1 -1
  710. package/dist/utils/devServerCommand.js +0 -24
  711. package/dist/utils/devServerCommand.js.map +1 -1
  712. package/dist/utils/devServerError.d.ts +0 -16
  713. package/dist/utils/devServerError.d.ts.map +1 -1
  714. package/dist/utils/devServerError.js +0 -17
  715. package/dist/utils/devServerError.js.map +1 -1
  716. package/dist/utils/displayLocale.d.ts +0 -2
  717. package/dist/utils/displayLocale.d.ts.map +1 -1
  718. package/dist/utils/displayLocale.js +0 -2
  719. package/dist/utils/displayLocale.js.map +1 -1
  720. package/dist/utils/elementFileHintSignals.d.ts +0 -5
  721. package/dist/utils/elementFileHintSignals.d.ts.map +1 -1
  722. package/dist/utils/elementFileHintSignals.js +0 -5
  723. package/dist/utils/elementFileHintSignals.js.map +1 -1
  724. package/dist/utils/formatElementTargetingContext.d.ts +0 -6
  725. package/dist/utils/formatElementTargetingContext.d.ts.map +1 -1
  726. package/dist/utils/formatElementTargetingContext.js +3 -9
  727. package/dist/utils/formatElementTargetingContext.js.map +1 -1
  728. package/dist/utils/hostAgentEnv.d.ts +0 -17
  729. package/dist/utils/hostAgentEnv.d.ts.map +1 -1
  730. package/dist/utils/hostAgentEnv.js +0 -17
  731. package/dist/utils/hostAgentEnv.js.map +1 -1
  732. package/dist/utils/htmlDocument.d.ts +0 -5
  733. package/dist/utils/htmlDocument.d.ts.map +1 -1
  734. package/dist/utils/htmlDocument.js +2 -7
  735. package/dist/utils/htmlDocument.js.map +1 -1
  736. package/dist/utils/internalGitIdentity.d.ts +0 -5
  737. package/dist/utils/internalGitIdentity.d.ts.map +1 -1
  738. package/dist/utils/internalGitIdentity.js +0 -5
  739. package/dist/utils/internalGitIdentity.js.map +1 -1
  740. package/dist/utils/logger.d.ts +0 -5
  741. package/dist/utils/logger.d.ts.map +1 -1
  742. package/dist/utils/logger.js +2 -19
  743. package/dist/utils/logger.js.map +1 -1
  744. package/dist/utils/loginShellPath.d.ts +0 -9
  745. package/dist/utils/loginShellPath.d.ts.map +1 -1
  746. package/dist/utils/loginShellPath.js +0 -69
  747. package/dist/utils/loginShellPath.js.map +1 -1
  748. package/dist/utils/loopback.d.ts +0 -1
  749. package/dist/utils/loopback.d.ts.map +1 -1
  750. package/dist/utils/loopback.js +0 -1
  751. package/dist/utils/loopback.js.map +1 -1
  752. package/dist/utils/pid.d.ts +0 -1
  753. package/dist/utils/pid.d.ts.map +1 -1
  754. package/dist/utils/pid.js +0 -1
  755. package/dist/utils/pid.js.map +1 -1
  756. package/dist/utils/portUtils.d.ts +0 -15
  757. package/dist/utils/portUtils.d.ts.map +1 -1
  758. package/dist/utils/portUtils.js +0 -21
  759. package/dist/utils/portUtils.js.map +1 -1
  760. package/dist/utils/queueAccess.d.ts +0 -9
  761. package/dist/utils/queueAccess.d.ts.map +1 -1
  762. package/dist/utils/queueAccess.js +0 -9
  763. package/dist/utils/queueAccess.js.map +1 -1
  764. package/dist/utils/skillWriter.d.ts +0 -17
  765. package/dist/utils/skillWriter.d.ts.map +1 -1
  766. package/dist/utils/skillWriter.js +0 -20
  767. package/dist/utils/skillWriter.js.map +1 -1
  768. package/dist/utils/skills/claude-skill.d.ts +0 -5
  769. package/dist/utils/skills/claude-skill.d.ts.map +1 -1
  770. package/dist/utils/skills/claude-skill.js +0 -5
  771. package/dist/utils/skills/claude-skill.js.map +1 -1
  772. package/dist/utils/skills/cli-guidance.d.ts +0 -8
  773. package/dist/utils/skills/cli-guidance.d.ts.map +1 -1
  774. package/dist/utils/skills/cli-guidance.js +0 -8
  775. package/dist/utils/skills/cli-guidance.js.map +1 -1
  776. package/dist/utils/skills/cursor-rules.d.ts +0 -6
  777. package/dist/utils/skills/cursor-rules.d.ts.map +1 -1
  778. package/dist/utils/skills/cursor-rules.js +0 -6
  779. package/dist/utils/skills/cursor-rules.js.map +1 -1
  780. package/dist/utils/variantPreviewPort.d.ts +0 -3
  781. package/dist/utils/variantPreviewPort.d.ts.map +1 -1
  782. package/dist/utils/variantPreviewPort.js +0 -3
  783. package/dist/utils/variantPreviewPort.js.map +1 -1
  784. package/dist/utils/windowPlacement.d.ts +0 -4
  785. package/dist/utils/windowPlacement.d.ts.map +1 -1
  786. package/dist/utils/windowPlacement.js +0 -4
  787. package/dist/utils/windowPlacement.js.map +1 -1
  788. package/package.json +12 -13
  789. package/scripts/verify-node-version.cjs +0 -3
  790. package/src/ui/dist/assets/{LibraryApp-qbLqcNxM.js → LibraryApp-x6PbzlGr.js} +1 -1
  791. package/src/ui/dist/assets/{main-touv07Dk.js → main-BW1Odsqp.js} +75 -75
  792. package/src/ui/dist/assets/main-DDQRZm89.css +1 -0
  793. package/src/ui/dist/index.html +2 -2
  794. package/dist/utils/skills/describe-motion-protocol.d.ts +0 -10
  795. package/dist/utils/skills/describe-motion-protocol.d.ts.map +0 -1
  796. package/dist/utils/skills/describe-motion-protocol.js +0 -231
  797. package/dist/utils/skills/describe-motion-protocol.js.map +0 -1
  798. package/src/ui/dist/assets/main-BUZjlAHd.css +0 -1
@@ -31,16 +31,6 @@ const htmlDocument_1 = require("../utils/htmlDocument");
31
31
  const log = (0, logger_1.createLogger)('AgentVariantsRouter');
32
32
  const DIRECTION_TITLE_MAX_WORDS = 5;
33
33
  const DIRECTION_SUBTITLE_MAX_WORDS = 10;
34
- /**
35
- * Public CDN hosts agent-generated previews are allowed to load code/assets
36
- * from. We don't control which CDN the agent emits: p5.js, three.js, and
37
- * friends get pulled from cdnjs / jsdelivr / esm.sh / skypack at least as often
38
- * as unpkg. An unpkg-only allowlist silently CSP-blocked those scripts, leaving
39
- * WebGL/canvas sketches blank — and because the violation fires inside the
40
- * cross-origin preview iframe, it never surfaced in our telemetry (parent saw
41
- * zero console errors). Keep this list as the de-facto set; add hosts as we
42
- * observe them rather than reaching for a wildcard.
43
- */
44
34
  const PREVIEW_CDN_HOSTS = [
45
35
  'https://unpkg.com',
46
36
  'https://cdn.jsdelivr.net',
@@ -48,40 +38,6 @@ const PREVIEW_CDN_HOSTS = [
48
38
  'https://esm.sh',
49
39
  'https://cdn.skypack.dev',
50
40
  ].join(' ');
51
- /**
52
- * CSP for agent-generated static previews. Shared by the live static-preview
53
- * route and the variant-history preview route so a variant renders identically
54
- * whether it's served fresh or replayed from a snapshot.
55
- *
56
- * Previews are served same-origin (the Rivet core server) and embedded in an
57
- * iframe that deliberately keeps `allow-same-origin` (the visual editor reaches
58
- * into the iframe DOM), so agent JS runs with the Rivet origin's privileges.
59
- * This policy is the main thing bounding that blast radius — note the absence
60
- * of `'unsafe-eval'` and of any wildcard host. `connect-src` is intentionally
61
- * NOT `*`: it stops agent JS from exfiltrating anything it can read to an
62
- * arbitrary server.
63
- *
64
- * THE RIGHT LONG-TERM FIX is to stop allowlisting CDNs entirely by serving
65
- * previews from an ISOLATED ORIGIN (separate port/origin, drop
66
- * `allow-same-origin`) and driving the visual editor over `postMessage`. The
67
- * embedded-mode preview bridge (`src/proxy-middleware/preview-bridge.ts`)
68
- * already implements exactly this handshake — migrating the default static
69
- * preview onto it is the work. Once the preview no longer shares Rivet's origin
70
- * or storage, this CSP can be loosened to `script-src https:` (or dropped)
71
- * without widening blast radius, and the per-CDN allowlist above goes away.
72
- * Until that migration lands, broadening PREVIEW_CDN_HOSTS is the stopgap.
73
- */
74
- /**
75
- * CSP for agent-generated static previews. Previews are served same-origin on
76
- * the isolated preview port, so `'self'` resolves to the preview document's own
77
- * origin and its sibling assets (CSS/JS/GLB/textures) load normally.
78
- *
79
- * `frame-ancestors` must also allow the editor origin: with the isolated
80
- * preview origin the editor lives on a different origin than the preview, so
81
- * `'self'` alone would block the editor from framing the variant preview
82
- * (`frame-ancestors 'self' → refused to connect`). See
83
- * docs/preview-target-addressing-design.md.
84
- */
85
41
  const buildStaticPreviewCsp = (parentFrameOrigin, libraryOrigin) => {
86
42
  const frameAncestors = ["'self'", parentFrameOrigin, libraryOrigin]
87
43
  .filter(Boolean)
@@ -253,9 +209,7 @@ const inlineVariantBody = v3_1.z.object({
253
209
  .passthrough())
254
210
  .min(1),
255
211
  sourceFiles: v3_1.z.array(v3_1.z.string()).optional(),
256
- /** Vary on an existing variant: attaches to the active session. */
257
212
  target: inlineVariantTargetSchema.optional(),
258
- /** Vary on an HTML-only static preview: forks it via the refine flow. */
259
213
  staticPreviewTarget: inlineStaticPreviewTargetSchema.optional(),
260
214
  telemetryContext: v3_1.z
261
215
  .object({
@@ -266,9 +220,6 @@ const inlineVariantBody = v3_1.z.object({
266
220
  traceId: v3_1.z.string().optional(),
267
221
  agentRunId: v3_1.z.string().optional(),
268
222
  initiator: inlineInitiatorSchema,
269
- /** Explicit per-request worker runtime choice ("run my workers on opus
270
- * from this Codex session"). Flag-relayed by the host agent, never
271
- * inferred — see WorkerSelection in change-request-types. */
272
223
  workerSelection: v3_1.z
273
224
  .object({
274
225
  provider: v3_1.z.enum(['claude', 'codex', 'cursor']).optional(),
@@ -288,17 +239,12 @@ const hostVariantCompleteBody = v3_1.z.object({
288
239
  title: v3_1.z.string().min(1).max(120).optional(),
289
240
  description: v3_1.z.string().min(1).max(400).optional(),
290
241
  });
291
- // Shared by the active-session and history rename routes. Trim first so a
292
- // whitespace-only title is rejected, and cap the length so an over-long label
293
- // can't bloat the snapshot or the on-disk manifest.
294
242
  const renameLabelSchema = v3_1.z.preprocess((v) => (typeof v === 'string' ? v.trim() : v), v3_1.z.string().min(1).max(120));
295
243
  const renameBody = v3_1.z.object({
296
244
  label: renameLabelSchema,
297
245
  projectPath: v3_1.z.string().optional(),
298
246
  });
299
247
  const RENAME_VALIDATION_MESSAGE = 'Invalid rename — `label` must be a non-empty string of at most 120 characters.';
300
- // Run-folder rename — one call re-homes one session request batch, live and
301
- // history alike; the client never fans out per-variant.
302
248
  const renameRunBody = v3_1.z.object({
303
249
  sessionId: v3_1.z.string().min(1),
304
250
  requestId: v3_1.z.string().min(1).optional(),
@@ -306,10 +252,6 @@ const renameRunBody = v3_1.z.object({
306
252
  label: renameLabelSchema,
307
253
  projectPath: v3_1.z.string().optional(),
308
254
  });
309
- // The variants panel's UI arrangement (pinned items + user-arranged order),
310
- // persisted as one metadata_state row in the project's rivet.db. Keys are
311
- // panel-owned opaque strings (`row:…`/`group:…` pin keys, group keys, row
312
- // keys); the caps only bound a runaway payload, not the shape's semantics.
313
255
  const uiStateKeySchema = v3_1.z.string().min(1).max(500);
314
256
  const uiStateSchema = v3_1.z.object({
315
257
  pinned: v3_1.z.array(uiStateKeySchema).max(1000),
@@ -326,20 +268,6 @@ const uiStatePutBody = v3_1.z.object({
326
268
  uiState: uiStateSchema,
327
269
  projectPath: v3_1.z.string().optional(),
328
270
  });
329
- /**
330
- * Express routes that back the iframe variants chip.
331
- *
332
- * - GET /api/variants/active — current active session state for the chip
333
- * - GET /api/variants/:sessionId — explicit session lookup
334
- * - POST /api/variants/:sessionId/preview-port — switch proxy to a variant's
335
- * dev server (or null to restore the user's default dev server)
336
- * - GET /api/variants/:sessionId/static/:variantId — serve static preview HTML
337
- * - GET /api/variants/:sessionId/design-md/:artifactId — serve raw DESIGN.md
338
- * - GET /api/variants/:sessionId/design-md/:artifactId/view — serve DesignMD page
339
- * - POST /api/variants/:sessionId/commit — user picked this variant in the
340
- * chip; orchestrator enqueues the diff onto pending changes
341
- * - POST /api/variants/:sessionId/cancel — dismiss the variants session
342
- */
343
271
  const HISTORY_STATUSES = new Set([
344
272
  'completed',
345
273
  'committed',
@@ -364,16 +292,10 @@ const escapeHtml = (value) => value.replace(/[&<>"']/g, (char) => {
364
292
  return char;
365
293
  }
366
294
  });
367
- /**
368
- * Selects the best persisted human label to describe a public variant share.
369
- */
370
295
  const getVariantShareTitle = (manifest) => {
371
296
  const title = [manifest.label, manifest.brief, manifest.sessionPrompt].find((candidate) => candidate.trim().length > 0);
372
297
  return (0, PrototypeDeployService_1.normalizePrototypeShareTitle)(title) ?? VARIANT_SHARE_TITLE_FALLBACK;
373
298
  };
374
- /**
375
- * Selects the run prompt for a public canvas share, with a stable fallback.
376
- */
377
299
  const getCanvasShareTitle = (sessionPrompt) => {
378
300
  return ((0, PrototypeDeployService_1.normalizePrototypeShareTitle)(sessionPrompt) ?? CANVAS_SHARE_TITLE_FALLBACK);
379
301
  };
@@ -381,9 +303,6 @@ const CANVAS_IFRAME_SANDBOX = 'allow-scripts allow-forms allow-popups';
381
303
  const RIVET_SOCIAL_IMAGE_URL = 'https://rivet.design/images/rivet-social.png';
382
304
  const RIVET_DEFAULT_SHARE_DESCRIPTION = 'Built with Rivet — the visual editor for design';
383
305
  const UNSUPPORTED_PROTOTYPE_DEPLOY_MESSAGE = "This prototype can't be deployed — only buildable app directions or static previews are supported.";
384
- /**
385
- * Render a public canvas page that puts every deployed direction in one shareable view.
386
- */
387
306
  const buildCanvasShareHtml = (args) => {
388
307
  const prompt = args.sessionPrompt.trim();
389
308
  const variantCards = args.variants
@@ -539,7 +458,6 @@ ${variantCards}
539
458
  </body>
540
459
  </html>`;
541
460
  };
542
- /** Resolve a Rivet-generated subproject path to the workspace that owns variant history. */
543
461
  const generatedProjectWorkspaceRoot = (projectPath) => {
544
462
  const normalized = path_1.default.normalize(projectPath);
545
463
  const segments = normalized.split(path_1.default.sep);
@@ -550,14 +468,6 @@ const generatedProjectWorkspaceRoot = (projectPath) => {
550
468
  const rootPath = segments.slice(0, rivetIndex).join(path_1.default.sep);
551
469
  return path_1.default.resolve(rootPath || path_1.default.parse(normalized).root);
552
470
  };
553
- /**
554
- * Stamp the live {@link WatcherLiveness} onto a variants snapshot so the UI can
555
- * detect a stale host-agent watch loop off real queue/waiter state. Applied to
556
- * BOTH active and inactive snapshots — a change can strand with no variants
557
- * session active — while the variant FIFO depth (`pendingVariantRequests`) is
558
- * still only stamped on active snapshots, preserving prior behavior. Returns
559
- * the snapshot untouched when no liveness is available (no bridge).
560
- */
561
471
  const stampWatcherLiveness = (snapshot, liveness, pendingVariantRequestCount, activeLeases = []) => {
562
472
  if (!liveness || typeof snapshot !== 'object' || snapshot === null) {
563
473
  return snapshot;
@@ -579,19 +489,11 @@ const stampWatcherLiveness = (snapshot, liveness, pendingVariantRequestCount, ac
579
489
  exports.stampWatcherLiveness = stampWatcherLiveness;
580
490
  const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHistoryOverride, deployServiceOverride, variantRunService, historyReplayOverride, previewBridge, inlineStartTrackerOverride) => {
581
491
  const router = (0, express_1.Router)();
582
- // `agent_variants.*` events from this router (preview switches, active-project
583
- // transitions) must carry the browser's PostHog $session_id to link to a
584
- // session replay; the bridge holds it. Falls back to raw telemetry when no
585
- // bridge is wired (e.g. demo mounts), where no browser session is available.
586
492
  const variantsTelemetry = telemetry && bridge
587
493
  ? (0, createAgentVariantsOrchestrator_1.withVariantsSessionReplayLinking)(telemetry, bridge)
588
494
  : telemetry;
589
495
  const variantHistory = variantHistoryOverride ?? new VariantHistoryService_1.VariantHistoryService();
590
496
  const deployService = deployServiceOverride ?? new PrototypeDeployService_1.PrototypeDeployService();
591
- // Replay shares the orchestrator's WorktreeManager instance: the
592
- // reserved-but-not-yet-bound port set is per-instance, so a separate
593
- // manager could hand a live variant's pending port to a replay
594
- // (EADDRINUSE for whichever binds second).
595
497
  const historyReplay = historyReplayOverride ??
596
498
  new HistoryReplayService_1.HistoryReplayService({
597
499
  history: variantHistory,
@@ -613,11 +515,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
613
515
  }
614
516
  next();
615
517
  });
616
- /**
617
- * Stamp the live watcher liveness onto a snapshot before it leaves the server.
618
- * The `typeof` guards keep partial bridge mocks (and a missing bridge) from
619
- * throwing — production always has the real bridge methods.
620
- */
621
518
  const stampLiveness = (snapshot) => (0, exports.stampWatcherLiveness)(snapshot, bridge && typeof bridge.getWatcherLiveness === 'function'
622
519
  ? bridge.getWatcherLiveness()
623
520
  : null, bridge && typeof bridge.pendingVariantRequestCount === 'function'
@@ -631,7 +528,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
631
528
  }
632
529
  return bridge?.getProjectPath() ?? null;
633
530
  };
634
- /** Resolve every project root that can own history for the requested route. */
635
531
  const resolveHistoryProjectPaths = (params) => {
636
532
  const seen = new Set();
637
533
  const candidates = [];
@@ -656,15 +552,10 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
656
552
  }
657
553
  }
658
554
  catch {
659
- // Persisted sessions may outlive in-memory orchestrator state.
660
555
  }
661
556
  }
662
557
  const upwardRoot = generatedProjectWorkspaceRoot(params.projectPath);
663
558
  addCandidate(upwardRoot);
664
- // Rediscover fresh-session workdirs nested under a repo root. Without this,
665
- // a stop/restart drops the in-memory session (and its `workspacePath`), so
666
- // reopening the root — whose own `.rivet/variants` is empty — would surface
667
- // none of the directions stored under `<root>/.rivet/<slug>/.rivet/variants`.
668
559
  for (const scanRoot of [params.projectPath, upwardRoot]) {
669
560
  if (!scanRoot)
670
561
  continue;
@@ -701,15 +592,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
701
592
  }
702
593
  return { kind: 'existing', projectPath: args.projectPath };
703
594
  };
704
- /**
705
- * Resolve a variant reference whose session is no longer active from
706
- * persisted history and adopt it — into the usable active session, or a
707
- * fresh one — so targeted requests keep working after restarts and newer
708
- * runs. This is the same adoption flow the editor uses when a past
709
- * direction is edited; the CLI/agent path simply reuses it.
710
- */
711
- /** @effect Rejects a request that would displace or mutate an actively
712
- * generating session. Ready/terminal sessions rotate normally. */
713
595
  const rejectBlockedVariantSession = (res, snapshot) => {
714
596
  if (!(0, variantSessionStart_1.isVariantSessionStartBlocked)(snapshot))
715
597
  return false;
@@ -717,9 +599,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
717
599
  const sessionId = snapshot.active === true ? snapshot.sessionId : undefined;
718
600
  res.status(400).json({
719
601
  error: 'Variants session already active',
720
- // Name the blocker so callers are not flying blind, and never
721
- // recommend cancel as remediation: cancelling to unblock destroys
722
- // the user's in-progress work. Only a human should decide that.
723
602
  details: `A variants session is active${sessionId
724
603
  ? ` (session ${sessionId}${stage ? `, stage ${stage}` : ''})`
725
604
  : ''}. Wait for it to settle (poll status), target it with --target to refine it, or ask the user before cancelling anything.`,
@@ -763,8 +642,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
763
642
  'its artifact instead.',
764
643
  };
765
644
  }
766
- // The history lookup is async — a run may have started meanwhile. Never
767
- // adopt into (or displace) a session that is actively generating.
768
645
  const raceSnapshot = orchestrator.buildActiveSnapshot();
769
646
  if ((0, variantSessionStart_1.isVariantSessionStartBlocked)(raceSnapshot)) {
770
647
  return { ok: false, kind: 'blocked', snapshot: raceSnapshot };
@@ -800,9 +677,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
800
677
  });
801
678
  return true;
802
679
  };
803
- /**
804
- * Resolve the saved app directory a deploy build should run from.
805
- */
806
680
  const resolveDeployableAppDir = async (args) => {
807
681
  const manifest = args.variant.manifest;
808
682
  if (manifest.projectKind === 'fresh' &&
@@ -825,9 +699,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
825
699
  }
826
700
  return appDir;
827
701
  };
828
- /**
829
- * Deploy one persisted variant and append the returned public URL to history.
830
- */
831
702
  const deployPersistedVariant = async (args) => {
832
703
  const existingDeployments = args.variant.manifest.deployments ?? [];
833
704
  const latestDeployment = existingDeployments.length > 0
@@ -849,8 +720,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
849
720
  const title = getVariantShareTitle(args.variant.manifest);
850
721
  let result;
851
722
  if (preview.kind === 'static') {
852
- // Already a built static bundle (e.g. a history static-preview variant)
853
- // — upload files/ directly, no build needed.
854
723
  result = await deployService.deployStatic(filesDir, {
855
724
  title,
856
725
  entryPath: preview.entryPath,
@@ -910,13 +779,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
910
779
  });
911
780
  return;
912
781
  }
913
- // Resolve a variant target that points at an HTML-only static preview:
914
- // those requests fork through the refine flow rather than code-gen (a
915
- // static preview has no worktree to edit). Gate on the TRUE work-item kind
916
- // — never on HTML presence or the client's claim: an existing-project
917
- // `code_gen` variant materialized as a static preview serves HTML and
918
- // displays as `static_artifact`, but owns a worktree and MUST fork via the
919
- // code_gen path (the static fork would reject it with VARIANT_NOT_EDITABLE).
920
782
  const batchTarget = parsed.data.target;
921
783
  const claimedStaticTarget = parsed.data.staticPreviewTarget ??
922
784
  (batchTarget
@@ -955,20 +817,10 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
955
817
  return;
956
818
  }
957
819
  const activeVariantsSession = orchestrator.buildActiveSnapshot();
958
- // A targeted request against the CURRENTLY active session attaches to it
959
- // directly. A reference to any other session — the originating session
960
- // ended, the server restarted, or a newer run replaced it — resolves
961
- // through persisted history: adopt the snapshot (into the usable active
962
- // session, or a fresh one) and retarget the request at the adopted live
963
- // variant. Copied variant references stay actionable for their whole
964
- // lifetime, not just while their session is in memory.
965
820
  let effectiveTarget = batchTarget ?? staticPreviewTarget;
966
821
  const isPersistedTargetRequest = Boolean(effectiveTarget &&
967
822
  (activeVariantsSession.active !== true ||
968
823
  effectiveTarget.sessionId !== activeVariantsSession.sessionId));
969
- // Adoption creates or mutates a session, so persisted-target requests
970
- // follow the same intake rules as untargeted starts: never displace an
971
- // actively generating session, and never race an in-flight start.
972
824
  if ((isPersistedTargetRequest || !effectiveTarget) &&
973
825
  rejectBlockedVariantSession(res, activeVariantsSession)) {
974
826
  return;
@@ -1029,10 +881,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
1029
881
  variantId: adoption.workItemId,
1030
882
  }
1031
883
  : undefined;
1032
- // Rewrite EVERY pointer at the dead reference — the batch-level
1033
- // fields and the per-change `target`/`staticPreviewTarget` pair the
1034
- // editor sends (the refine flow prefers the per-change static target,
1035
- // so leaving it stale would aim the refine at the ended session).
1036
884
  const matchesStaleTarget = (candidate) => Boolean(candidate &&
1037
885
  candidate.sessionId === staleTarget.sessionId &&
1038
886
  candidate.variantId === staleTarget.variantId);
@@ -1062,16 +910,17 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
1062
910
  };
1063
911
  effectiveTarget = liveTarget;
1064
912
  }
913
+ const refineStaticPreviewBatch = variantRunService.refineStaticPreviewBatch?.bind(variantRunService);
1065
914
  const isStaticPreviewFork = Boolean(request.staticPreviewTarget);
1066
- if (isStaticPreviewFork && !variantRunService.refineStaticPreviewBatch) {
915
+ if (isStaticPreviewFork && !refineStaticPreviewBatch) {
1067
916
  res.status(503).json({
1068
917
  error: 'Static preview refinement unavailable',
1069
918
  reason: 'inline_variants_unavailable',
1070
919
  });
1071
920
  return;
1072
921
  }
1073
- const result = isStaticPreviewFork
1074
- ? await variantRunService.refineStaticPreviewBatch(request)
922
+ const result = isStaticPreviewFork && refineStaticPreviewBatch
923
+ ? await refineStaticPreviewBatch(request)
1075
924
  : await variantRunService.startElementVariants(request);
1076
925
  if (!result.success) {
1077
926
  res.status(500).json({
@@ -1147,16 +996,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
1147
996
  starting: inlineStartTracker.isStarting(),
1148
997
  }));
1149
998
  });
1150
- /**
1151
- * Server-Sent Events stream for the iframe chip. Pushes a fresh
1152
- * ActiveSnapshot whenever the orchestrator's state changes (propose,
1153
- * approve, report-complete, dev-server-up, terminal, cancel, commit) so
1154
- * the chip never has to poll.
1155
- *
1156
- * Heartbeats every 30s as comments (`: heartbeat\n\n`) to keep
1157
- * intermediate proxies from killing the connection on idle. EventSource
1158
- * auto-reconnects on disconnect.
1159
- */
1160
999
  router.get('/variants/events', (req, res) => {
1161
1000
  if (rejectNonLocalRequest(req, res))
1162
1001
  return;
@@ -1167,10 +1006,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
1167
1006
  'X-Accel-Buffering': 'no',
1168
1007
  });
1169
1008
  res.flushHeaders?.();
1170
- // Stamp each snapshot with the live variant-request FIFO depth + watcher
1171
- // liveness. Both live on the bridge (not the orchestrator), so
1172
- // buildActiveSnapshot() can't fill them in — we add them here at write time
1173
- // so the initial state and every subscribed update carry them.
1174
1009
  const writeSnapshot = (snapshot) => {
1175
1010
  try {
1176
1011
  const activeSnapshot = snapshot && typeof snapshot === 'object'
@@ -1185,20 +1020,13 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
1185
1020
  log.warn('SSE write failed (client likely disconnected)', err);
1186
1021
  }
1187
1022
  };
1188
- // Initial state so the chip can render immediately.
1189
1023
  writeSnapshot(orchestrator.buildActiveSnapshot());
1190
1024
  const unsubscribe = orchestrator.subscribeToEvents(writeSnapshot);
1191
- // Re-push on bridge queue/waiter changes too. A change the user sends with
1192
- // no host agent draining it never produces an orchestrator event, so
1193
- // without this the stale-watcher banner would never see the strand.
1194
1025
  const unsubscribeLiveness = bridge && typeof bridge.onWatcherLivenessChange === 'function'
1195
1026
  ? bridge.onWatcherLivenessChange(() => {
1196
1027
  writeSnapshot(orchestrator.buildActiveSnapshot());
1197
1028
  })
1198
1029
  : undefined;
1199
- // A live SSE subscriber means a Rivet page is open; track it so the MCP
1200
- // server can skip re-opening a duplicate browser tab when the variants flow
1201
- // re-enters an already-active editor session.
1202
1030
  const releaseUiClient = orchestrator.registerUiClient();
1203
1031
  const heartbeat = setInterval(() => {
1204
1032
  try {
@@ -1206,7 +1034,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
1206
1034
  res.write(': heartbeat\n\n');
1207
1035
  }
1208
1036
  catch {
1209
- // ignore — close handler will clean up
1210
1037
  }
1211
1038
  }, 30_000);
1212
1039
  req.on('close', () => {
@@ -1218,7 +1045,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
1218
1045
  res.end();
1219
1046
  }
1220
1047
  catch {
1221
- // already ended
1222
1048
  }
1223
1049
  });
1224
1050
  });
@@ -1254,11 +1080,7 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
1254
1080
  return;
1255
1081
  }
1256
1082
  try {
1257
- const entries = (await Promise.all(resolveHistoryProjectPaths({ projectPath }).map((historyProjectPath) =>
1258
- // Reads the SQLite metadata index when it's usable and falls
1259
- // back to the manifest walk otherwise — same entries, faster
1260
- // list. Detail/preview routes stay manifest/file-backed.
1261
- variantHistory.listVariantsFromIndex({
1083
+ const entries = (await Promise.all(resolveHistoryProjectPaths({ projectPath }).map((historyProjectPath) => variantHistory.listVariantsFromIndex({
1262
1084
  projectPath: historyProjectPath,
1263
1085
  status: statusParam,
1264
1086
  })))).flat();
@@ -1268,10 +1090,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
1268
1090
  }
1269
1091
  const uniqueEntries = Array.from(entriesById.values()).sort((a, b) => b.manifest.createdAt.localeCompare(a.manifest.createdAt));
1270
1092
  const limitedEntries = limit !== undefined ? uniqueEntries.slice(0, limit) : uniqueEntries;
1271
- // Removed and cancelled variants are retained on disk but never surfaced
1272
- // in the default history list. Keeps dismissed and cancelled directions
1273
- // hidden once the session is no longer active, matching the
1274
- // list_past_variants MCP tool.
1275
1093
  const visibleEntries = statusParam === 'removed'
1276
1094
  ? limitedEntries
1277
1095
  : limitedEntries.filter((entry) => entry.manifest.status !== 'removed' &&
@@ -1296,14 +1114,8 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
1296
1114
  preview: entry.manifest.preview,
1297
1115
  artifact: entry.manifest.artifact,
1298
1116
  parentVariant: entry.manifest.parentVariant,
1299
- // Tree-store fields (absent on legacy entries): `serve` tells the
1300
- // panel how a tree-backed entry previews (static → history preview
1301
- // route; dev-server → the replay run route), `hasTree` marks the
1302
- // entry as snapshot-backed at all.
1303
1117
  ...(entry.manifest.serve ? { serve: entry.manifest.serve } : {}),
1304
1118
  hasTree: Boolean(entry.manifest.tree),
1305
- // The runtime that built this direction (vendor/model/effort) —
1306
- // absent on legacy entries and host-agent-executed variants.
1307
1119
  ...(entry.manifest.runtime
1308
1120
  ? { runtime: entry.manifest.runtime }
1309
1121
  : {}),
@@ -1314,10 +1126,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
1314
1126
  sendError(res, err);
1315
1127
  }
1316
1128
  });
1317
- // The variants panel's UI arrangement (pins + custom order). Stored in the
1318
- // project's rivet.db metadata_state — per-project and shared across
1319
- // browsers, unlike the panel's other localStorage preferences. Not
1320
- // rebuildable: losing the database resets the arrangement.
1321
1129
  router.get('/variants/ui-state', async (req, res) => {
1322
1130
  if (rejectNonLocalRequest(req, res))
1323
1131
  return;
@@ -1337,7 +1145,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
1337
1145
  stored = JSON.parse(raw);
1338
1146
  }
1339
1147
  catch {
1340
- // A corrupt row reads as "nothing stored" — the next PUT heals it.
1341
1148
  }
1342
1149
  }
1343
1150
  const parsed = uiStateSchema.safeParse(stored);
@@ -1377,13 +1184,8 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
1377
1184
  sendError(res, err);
1378
1185
  }
1379
1186
  });
1380
- // The entry route resolves the saved document's canonical URL. HTML files
1381
- // served below that URL receive the document policy and preview bridge.
1382
1187
  router.get('/variants/history/:sessionId/:variantId/preview', async (req, res) => serveHistoryPreview(req, res, variantHistory, resolveProjectPath, resolveHistoryProjectPaths, { isDocument: true }, previewBridge));
1383
1188
  router.get('/variants/history/:sessionId/:variantId/preview/{*assetPath}', async (req, res) => serveHistoryPreview(req, res, variantHistory, resolveProjectPath, resolveHistoryProjectPaths, { isDocument: false }, previewBridge));
1384
- // Stop history replay servers. Registered before the
1385
- // parameterized history routes purely for clarity — method+arity keep it
1386
- // unambiguous either way.
1387
1189
  router.post('/variants/history/replay/stop', async (req, res) => {
1388
1190
  if (rejectNonLocalRequest(req, res))
1389
1191
  return;
@@ -1397,12 +1199,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
1397
1199
  }
1398
1200
  res.json({ stopped: true });
1399
1201
  });
1400
- /**
1401
- * Boot a past dev-server variant from its tree-store ref: materialize the
1402
- * exact tree, overlay runtime (.env / node_modules), start the persisted
1403
- * serve recipe, and optionally retarget the main preview proxy at the new
1404
- * port. See docs/variant-history-tree-store-design.md.
1405
- */
1406
1202
  router.post('/variants/history/:sessionId/:variantId/run', async (req, res) => {
1407
1203
  if (rejectNonLocalRequest(req, res))
1408
1204
  return;
@@ -1603,13 +1399,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
1603
1399
  sendError(res, err);
1604
1400
  }
1605
1401
  });
1606
- /**
1607
- * Adopt a PAST (history) variant into the active session as a first-class
1608
- * succeeded variant, so the user's first edit on a selected past direction
1609
- * routes to a real session member. Resolves the persisted snapshot from
1610
- * history, then hands the rehydration `files/` dir to the orchestrator. The
1611
- * UI calls this on first comment/Vary against a selected past variant.
1612
- */
1613
1402
  router.post('/variants/adopt-past', async (req, res) => {
1614
1403
  if (rejectNonLocalRequest(req, res))
1615
1404
  return;
@@ -1755,43 +1544,21 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
1755
1544
  });
1756
1545
  return;
1757
1546
  }
1758
- // Only inject `<base href>` when the variant actually has sibling
1759
- // assets to serve. Otherwise the inlined HTML is self-contained and
1760
- // the base tag would only serve to mis-resolve any incidental
1761
- // relative URLs (e.g. `<a href="something">`) against the asset
1762
- // sub-path. The hasAssets check also avoids the trailing-slash
1763
- // fragment-link quirk for the common no-assets case.
1764
1547
  const hasAssets = orchestrator.hasStaticPreviewAssets(sessionId, variantId);
1765
1548
  if (hasAssets &&
1766
1549
  !req.originalUrl.includes('?') &&
1767
1550
  !req.originalUrl.endsWith('/')) {
1768
- // Document URL must end in `/` so the browser's `document.URL` and
1769
- // the `<base href>` agree. Otherwise fragment-only links
1770
- // (`<a href="#section">`) resolve to the base-href URL — different
1771
- // from the current URL — and the browser does a full navigation,
1772
- // hitting the asset route with an empty path → 404. Redirect to
1773
- // the canonical trailing-slash form before serving.
1774
1551
  res.redirect(301, req.originalUrl + '/');
1775
1552
  return;
1776
1553
  }
1777
1554
  const withBaseHref = hasAssets
1778
- ? injectBaseHref(html,
1779
- // Trailing slash is required so `./avatar.glb` resolves to
1780
- // `.../static/<vid>/avatar.glb`, not `.../static/avatar.glb`.
1781
- `/api/variants/${encodeURIComponent(sessionId)}/static/${encodeURIComponent(variantId)}/`)
1555
+ ? injectBaseHref(html, `/api/variants/${encodeURIComponent(sessionId)}/static/${encodeURIComponent(variantId)}/`)
1782
1556
  : html;
1783
- // In embedded mode the visual editor drives this iframe over the preview
1784
- // bridge; without the injected listener, selecting/commenting on the
1785
- // variant times out (`Preview bridge timed out`) and the comment input
1786
- // never opens. Mirror the base static route (`routes/static.ts`).
1787
1557
  const finalHtml = previewBridge?.isEnabled
1788
1558
  ? (0, preview_bridge_1.injectPreviewBridge)(withBaseHref, {
1789
1559
  expectedParentOrigin: previewBridge.expectedParentOrigin,
1790
1560
  })
1791
1561
  : withBaseHref;
1792
- // Constrain the blast radius of agent-generated scripts. See
1793
- // buildStaticPreviewCsp for the policy and the isolated-origin migration
1794
- // that will eventually let us drop the per-CDN allowlist.
1795
1562
  res
1796
1563
  .status(200)
1797
1564
  .type('html')
@@ -1871,13 +1638,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
1871
1638
  sendError(res, err);
1872
1639
  }
1873
1640
  });
1874
- /**
1875
- * Serve sibling assets the variant's HTML references (e.g. `./avatar.glb`,
1876
- * `./hero.png`). The agent reports `output.assetBase` alongside the inline
1877
- * HTML; the orchestrator sandboxes it inside the fresh-session workspace
1878
- * and exposes a resolver. Path-traversal-rejected requests + missing files
1879
- * return 404. Loopback-only.
1880
- */
1881
1641
  router.get('/variants/:sessionId/static/:variantId/{*assetPath}', (req, res) => {
1882
1642
  if (rejectNonLocalRequest(req, res))
1883
1643
  return;
@@ -1895,10 +1655,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
1895
1655
  });
1896
1656
  return;
1897
1657
  }
1898
- // `dotfiles: 'allow'` because workspacePath is typically nested
1899
- // under a `.rivet/` directory (Rivet's per-project state dir) —
1900
- // sendFile's default 'ignore' setting 404s anything with a hidden
1901
- // segment, which would always trigger here.
1902
1658
  res.sendFile(abs, {
1903
1659
  dotfiles: 'allow',
1904
1660
  headers: { 'Cache-Control': 'no-store' },
@@ -1957,14 +1713,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
1957
1713
  }
1958
1714
  try {
1959
1715
  bridge.rebindProjectPath(result.destinationPath);
1960
- // Do NOT call switchPreviewPort(null) here on the fresh vite_app
1961
- // path: commitVariant has already spawned a fresh dev server at
1962
- // destinationPath and retargeted the proxy to its port via the
1963
- // orchestrator's switchPreviewPort callback. Calling null here
1964
- // would route the proxy to the default upstream (the user's repo,
1965
- // which has no dev server) and the iframe would show "preview
1966
- // disconnected" — exactly the regression we're fixing. The
1967
- // committed dev server lives until the next propose / shutdown.
1968
1716
  await orchestrator.cleanupCommittedSession(sessionId);
1969
1717
  variantsTelemetry?.trackAgentVariantsActiveProjectTransition({
1970
1718
  sessionId,
@@ -2002,18 +1750,10 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
2002
1750
  sendError(res, err);
2003
1751
  }
2004
1752
  });
2005
- /**
2006
- * Deploy a fresh-project (Vite) variant to the public Prototype Preview Host
2007
- * and return a shareable URL. Builds locally, uploads the static bundle with
2008
- * the user's Rivet JWT, and records the deployment in the variant manifest so
2009
- * the chip can re-show ("Copy link") without rebuilding.
2010
- */
2011
1753
  router.post('/variants/:sessionId/deploy', async (req, res) => {
2012
1754
  if (rejectNonLocalRequest(req, res))
2013
1755
  return;
2014
1756
  const sessionId = req.params.sessionId;
2015
- // Gated behind the `deployPrototype` flag (default off). Mirrors the UI
2016
- // gate so the endpoint can't be driven while the feature is dark.
2017
1757
  const flags = await (0, evaluateFlags_1.getFeatureFlags)({
2018
1758
  userKey: (0, featureFlagUserKey_1.getConfigFeatureFlagUserKey)({ headers: req.headers }),
2019
1759
  });
@@ -2082,11 +1822,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
2082
1822
  });
2083
1823
  }
2084
1824
  });
2085
- /**
2086
- * Deploy a fresh-project canvas to the public Prototype Preview Host. The
2087
- * canvas page embeds every requested direction so one public URL can be used
2088
- * for review instead of sharing one URL per variant.
2089
- */
2090
1825
  router.post('/variants/:sessionId/canvas/deploy', async (req, res) => {
2091
1826
  if (rejectNonLocalRequest(req, res))
2092
1827
  return;
@@ -2248,9 +1983,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
2248
1983
  sendError(res, err);
2249
1984
  }
2250
1985
  });
2251
- // Remove a single variant from the UI: hides it from the active snapshot for
2252
- // good while retaining it in `.rivet/variants/` as `removed`. Distinct from
2253
- // /cancel (which tears down the whole session).
2254
1986
  router.post('/variants/:sessionId/:variantId/remove', async (req, res) => {
2255
1987
  if (rejectNonLocalRequest(req, res))
2256
1988
  return;
@@ -2263,8 +1995,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
2263
1995
  sendError(res, err);
2264
1996
  }
2265
1997
  });
2266
- // Rename a live (active-session) variant. Patches the in-memory work item and
2267
- // its on-disk manifest, then re-pushes the snapshot over SSE.
2268
1998
  router.post('/variants/:sessionId/:variantId/rename', async (req, res) => {
2269
1999
  if (rejectNonLocalRequest(req, res))
2270
2000
  return;
@@ -2289,8 +2019,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
2289
2019
  sendError(res, err);
2290
2020
  }
2291
2021
  });
2292
- // Rename one run request batch across live state and every resolved history
2293
- // root in one call.
2294
2022
  router.post('/variants/runs/rename', async (req, res) => {
2295
2023
  if (rejectNonLocalRequest(req, res))
2296
2024
  return;
@@ -2314,8 +2042,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
2314
2042
  });
2315
2043
  liveRenamedCount = result.renamedCount;
2316
2044
  }
2317
- // History is best-effort even without a resolvable project path — a
2318
- // fresh-session run may have nothing persisted yet.
2319
2045
  const projectPath = resolveProjectPath(parsed.data.projectPath);
2320
2046
  let historyRenamedCount = 0;
2321
2047
  if (projectPath) {
@@ -2339,9 +2065,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
2339
2065
  sendError(res, err);
2340
2066
  }
2341
2067
  });
2342
- // Rename a past (history) variant — no active session involved, so this writes
2343
- // straight to the persisted manifest. Takes the workspace projectPath the same
2344
- // way the history list/preview routes do.
2345
2068
  router.post('/variants/history/:sessionId/:variantId/rename', async (req, res) => {
2346
2069
  if (rejectNonLocalRequest(req, res))
2347
2070
  return;
@@ -2387,10 +2110,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
2387
2110
  sendError(res, err);
2388
2111
  }
2389
2112
  });
2390
- // Remove a past (history) variant — flips its persisted manifest to `removed`
2391
- // so it drops out of the default history list. Non-destructive: the snapshot
2392
- // stays on disk, matching the active-session remove flow. Takes the workspace
2393
- // projectPath the same way the other history routes do.
2394
2113
  router.post('/variants/history/:sessionId/:variantId/remove', async (req, res) => {
2395
2114
  if (rejectNonLocalRequest(req, res))
2396
2115
  return;
@@ -2424,13 +2143,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
2424
2143
  return router;
2425
2144
  };
2426
2145
  exports.createAgentVariantsRouter = createAgentVariantsRouter;
2427
- /**
2428
- * Serve one saved static preview file from a variant history snapshot.
2429
- *
2430
- * The entry route redirects to the saved HTML filename so relative embeds,
2431
- * assets and fragment links resolve naturally. HTML responses carry the
2432
- * preview CSP and bridge; other sibling assets carry neither.
2433
- */
2434
2146
  const serveHistoryPreview = async (req, res, variantHistory, resolveProjectPath, resolveHistoryProjectPaths, { isDocument }, previewBridge) => {
2435
2147
  if (rejectNonLocalRequest(req, res))
2436
2148
  return;
@@ -2488,17 +2200,11 @@ const serveHistoryPreview = async (req, res, variantHistory, resolveProjectPath,
2488
2200
  return;
2489
2201
  }
2490
2202
  if (isDocument) {
2491
- // Give the history entry its saved filename as the browser's document URL:
2492
- // /preview -> /preview/pages/index.html makes ./demo.html resolve under
2493
- // /preview/pages/. A <base> tag would also retarget fragment-only links
2494
- // such as #details, which must stay within the displayed document.
2495
2203
  const previewRoot = `/api/variants/history/${encodeURIComponent(sessionId)}/${encodeURIComponent(variantId)}/preview/`;
2496
- // Encode filenames (including spaces and #) without encoding directory separators.
2497
2204
  const entryPath = file.relativePath
2498
2205
  .split('/')
2499
2206
  .map(encodeURIComponent)
2500
2207
  .join('/');
2501
- // Keep preview options and project lookup parameters through the redirect.
2502
2208
  const queryIndex = req.originalUrl.indexOf('?');
2503
2209
  const query = queryIndex === -1 ? '' : req.originalUrl.slice(queryIndex);
2504
2210
  res
@@ -2508,16 +2214,11 @@ const serveHistoryPreview = async (req, res, variantHistory, resolveProjectPath,
2508
2214
  }
2509
2215
  const contentType = path_1.default.extname(file.absolutePath) || 'html';
2510
2216
  res.status(200).type(contentType).set('Cache-Control', 'no-store');
2511
- // HTML siblings can be embedded documents too, so they need the same
2512
- // permissions as the entry. CSS, scripts and images retain their raw bytes.
2513
2217
  if (/\.html?$/i.test(file.relativePath)) {
2514
2218
  const html = file.body.toString('utf8');
2515
2219
  res
2516
2220
  .set('Content-Security-Policy', buildStaticPreviewCsp(previewBridge?.expectedParentOrigin, previewBridge?.resolveLibraryOrigin?.()))
2517
2221
  .set('X-Content-Type-Options', 'nosniff');
2518
- // Embedded mode drives this snapshot iframe over the preview bridge; the
2519
- // listener must be present or selecting/commenting on a past variant
2520
- // times out (`Preview bridge timed out`). Matches the live static route.
2521
2222
  if (previewBridge?.isEnabled) {
2522
2223
  res.send((0, preview_bridge_1.injectPreviewBridge)(html, {
2523
2224
  expectedParentOrigin: previewBridge.expectedParentOrigin,
@@ -2540,10 +2241,6 @@ const serveHistoryPreview = async (req, res, variantHistory, resolveProjectPath,
2540
2241
  sendError(res, err);
2541
2242
  }
2542
2243
  };
2543
- /**
2544
- * Validates the raw history-preview URL suffix before Express can normalize an
2545
- * encoded traversal segment away from req.params.
2546
- */
2547
2244
  const getInvalidRawHistoryPreviewAssetPath = (req) => {
2548
2245
  const rawPath = req.originalUrl.split('?')[0] ?? '';
2549
2246
  const marker = '/preview/';
@@ -2565,9 +2262,6 @@ const getInvalidRawHistoryPreviewAssetPath = (req) => {
2565
2262
  }
2566
2263
  return null;
2567
2264
  };
2568
- /**
2569
- * Resolve a child path while rejecting paths that escape the intended root.
2570
- */
2571
2265
  const resolvePathWithinRoot = (rootPath, childPath) => {
2572
2266
  const absolutePath = path_1.default.resolve(rootPath, childPath);
2573
2267
  const relativePath = path_1.default.relative(rootPath, absolutePath);
@@ -2639,17 +2333,9 @@ const toActiveProjectContext = (projectContext) => {
2639
2333
  : {}),
2640
2334
  };
2641
2335
  };
2642
- /** Map persisted artifact shape to the public history summary kind. */
2643
2336
  const manifestKind = (manifest) => {
2644
2337
  return manifest.artifact.kind === 'diff' ? 'diff' : 'project-created';
2645
2338
  };
2646
- /**
2647
- * Inject a `<base href>` tag into the variant HTML so relative URLs
2648
- * resolve against the asset-serving sub-path. Idempotent: if the HTML
2649
- * already declares a `<base>` tag we leave it alone (the agent opted in
2650
- * to its own resolution rules). Documents without a head tag receive the base
2651
- * after their html tag or doctype, outside any embedded markup.
2652
- */
2653
2339
  const injectBaseHref = (html, baseHref) => (0, htmlDocument_1.insertHtmlHeadElements)(html, [
2654
2340
  {
2655
2341
  tagName: 'base',