rivet-design 0.17.3 → 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 +9 -611
  15. package/dist/agent-variants/WorktreeOrchestrator.d.ts.map +1 -1
  16. package/dist/agent-variants/WorktreeOrchestrator.js +111 -1468
  17. package/dist/agent-variants/WorktreeOrchestrator.js.map +1 -1
  18. package/dist/agent-variants/WorktreeOrchestrator.testHelpers.d.ts +0 -7
  19. package/dist/agent-variants/WorktreeOrchestrator.testHelpers.d.ts.map +1 -1
  20. package/dist/agent-variants/WorktreeOrchestrator.testHelpers.js +2 -25
  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 +5 -493
  31. package/dist/agent-variants/contracts.d.ts.map +1 -1
  32. package/dist/agent-variants/contracts.js +2 -167
  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 +3 -3
  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 +7 -7
  322. package/dist/proxy-middleware/preview-bridge.js.map +1 -1
  323. package/dist/proxy-middleware/preview-connections.d.ts +8 -0
  324. package/dist/proxy-middleware/preview-connections.d.ts.map +1 -0
  325. package/dist/proxy-middleware/preview-connections.js +29 -0
  326. package/dist/proxy-middleware/preview-connections.js.map +1 -0
  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 +41 -90
  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 +14 -325
  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 +3 -4
  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 +28 -0
  434. package/dist/services/DependencyPreparationService.d.ts.map +1 -0
  435. package/dist/services/DependencyPreparationService.js +322 -0
  436. package/dist/services/DependencyPreparationService.js.map +1 -0
  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 +2 -32
  450. package/dist/services/HistoryReplayService.d.ts.map +1 -1
  451. package/dist/services/HistoryReplayService.js +55 -65
  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 -22
  478. package/dist/services/OperatingSystemServices.d.ts.map +1 -1
  479. package/dist/services/OperatingSystemServices.js +22 -80
  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 +23 -0
  510. package/dist/services/ProjectPackageManager.d.ts.map +1 -0
  511. package/dist/services/ProjectPackageManager.js +185 -0
  512. package/dist/services/ProjectPackageManager.js.map +1 -0
  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 +2 -101
  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 +1 -220
  593. package/dist/services/WorktreeManager.d.ts.map +1 -1
  594. package/dist/services/WorktreeManager.js +75 -372
  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 +1 -15
  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 +2 -16
  713. package/dist/utils/devServerError.d.ts.map +1 -1
  714. package/dist/utils/devServerError.js +4 -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 +2 -8
  733. package/dist/utils/htmlDocument.d.ts.map +1 -1
  734. package/dist/utils/htmlDocument.js +20 -16
  735. package/dist/utils/htmlDocument.js.map +1 -1
  736. package/dist/utils/internalGitIdentity.d.ts +2 -0
  737. package/dist/utils/internalGitIdentity.d.ts.map +1 -0
  738. package/dist/utils/internalGitIdentity.js +12 -0
  739. package/dist/utils/internalGitIdentity.js.map +1 -0
  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 +1 -14
  757. package/dist/utils/portUtils.d.ts.map +1 -1
  758. package/dist/utils/portUtils.js +1 -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 +15 -14
  789. package/scripts/verify-node-version.cjs +0 -3
  790. package/src/ui/dist/assets/{LibraryApp-PQNnarmo.js → LibraryApp-x6PbzlGr.js} +1 -1
  791. package/src/ui/dist/assets/{main-C7hdsU-C.js → main-BW1Odsqp.js} +76 -76
  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
@@ -15,72 +15,27 @@ const designCatalog_1 = require("./templates/designCatalog");
15
15
  const viteReactTs_1 = require("./templates/viteReactTs");
16
16
  const devServerError_1 = require("../utils/devServerError");
17
17
  const portUtils_1 = require("../utils/portUtils");
18
- const cloneOrCopyDirSync_1 = require("../utils/cloneOrCopyDirSync");
18
+ const internalGitIdentity_1 = require("../utils/internalGitIdentity");
19
+ const ProjectPackageManager_1 = require("./ProjectPackageManager");
19
20
  const OperatingSystemServices_1 = require("./OperatingSystemServices");
20
21
  const log = (0, logger_1.createLogger)('WorktreeManager');
21
- // How long a freshly-spawned dev server may go SILENT (no stdout/stderr)
22
- // before we give up on it answering on its port. Inactivity-based rather than
23
- // a flat wall clock: a large Next/Vite project's cold first compile can chew
24
- // through 30s+ while chattering progress output, and killing it mid-compile
25
- // manufactured `timeout` failures. A server that is still printing is still
26
- // making progress; only a genuinely silent one is presumed wedged. The probe
27
- // fails fast on early process exit regardless.
28
22
  const DEV_SERVER_READY_INACTIVITY_MS = 30_000;
29
- // Absolute ceiling on the readiness wait, however chatty the process is —
30
- // bounds worst-case UX for a dev server that logs forever without serving.
31
23
  const DEV_SERVER_READY_MAX_MS = 120_000;
32
24
  const DEV_SERVER_PROBE_TIMEOUT_MS = 1_000;
33
- // Keep a rolling tail of the dev server's output so a failed start is
34
- // diagnosable (which port it tried, EADDRINUSE, missing script) without
35
- // retaining unbounded logs.
36
25
  const DEV_SERVER_OUTPUT_TAIL_LIMIT = 4_000;
37
- // Abort any git child process that goes silent (no stdout/stderr) for this
38
- // long. Provisioning worktrees for a large project (e.g. React Native, whose
39
- // working tree carries native build dirs) used to hang indefinitely because
40
- // none of these git calls had a timeout — a stuck `worktree add`/`commit`
41
- // would stall the whole `start_variants` tool call. `block` resets on every
42
- // data chunk, so a slow-but-progressing checkout keeps running; only a
43
- // genuinely wedged process (lock contention, credential/hook prompt) trips it.
44
26
  const GIT_BLOCK_TIMEOUT_MS = 120_000;
45
27
  const GIT_OPTS = { timeout: { block: GIT_BLOCK_TIMEOUT_MS } };
46
- // Existing-project worktrees still go under /tmp — `git worktree add` refuses
47
- // to nest inside the main worktree, so the user's project tree is off-limits
48
- // and /tmp is the right neutral location.
49
28
  const EXISTING_WORKTREE_BASE = '/tmp';
50
- // Fresh-project worktrees live under destinationParent so commit time is a
51
- // same-volume rename instead of a cross-volume cp. Tucked under a
52
- // dot-prefixed dir so the editor file tree collapses them cleanly.
53
29
  exports.FRESH_WORKTREES_DIRNAME = '.rivet-variants';
54
30
  const WORKTREE_PREFIX = 'rivet-variants';
55
31
  const SESSION_ID_PATTERN = /^[A-Za-z0-9_-]+$/;
56
- // Include the PID so each server instance only cleans up its own worktrees.
57
32
  exports.INSTANCE_PREFIX = `${WORKTREE_PREFIX}-pid${process.pid}`;
58
- // Registry of every destinationParent that has ever housed a fresh-worktree
59
- // root in this user account. Read at startup so orphan cleanup can sweep
60
- // roots created by prior MCP processes that crashed before teardown ran.
61
33
  const FRESH_ROOTS_REGISTRY_PATH = path_1.default.join(os_1.default.homedir(), '.rivet', 'fresh-worktree-roots.json');
62
34
  const FRESH_SESSION_ERROR = 'Fresh-project sessions have no source project — this operation requires an existing project path.';
63
35
  class WorktreeManager {
64
36
  operatingSystemServices;
65
37
  resolveProjectPath;
66
- /**
67
- * Ports handed out by `findFreePortFrom` to a dev server that hasn't bound
68
- * them yet. Until a port is actually listening, a bind/connect probe still
69
- * sees it as free, so without this set two concurrent variant starts would
70
- * both walk away with the same "free" port and collide. Released (see
71
- * `releasePort`) once the dev server has bound the port — at which point the
72
- * listener check sees it taken — or has failed to start.
73
- */
74
38
  reservedPorts = new Set();
75
- /**
76
- * Accepts either a static path, null, or a lazy getter. The getter form
77
- * lets long-lived callers (e.g. the agent-variants orchestrator) defer the
78
- * project path until each operation, since `bridge.getProjectPath()`
79
- * isn't known until `open_visual_editor` runs. A null projectPath is
80
- * allowed for fresh-project sessions that scaffold from scratch and
81
- * therefore have no source repo; methods that need a real project path
82
- * throw a clear error in that case.
83
- */
84
39
  constructor(projectPath, operatingSystemServices = OperatingSystemServices_1.selectedOperatingSystemServices) {
85
40
  this.operatingSystemServices = operatingSystemServices;
86
41
  if (typeof projectPath === 'function') {
@@ -98,29 +53,12 @@ class WorktreeManager {
98
53
  }
99
54
  return resolved;
100
55
  }
101
- /**
102
- * Return the absolute git root for the repo containing this.projectPath.
103
- * When projectPath is a subdirectory (e.g. examples/microsoft-paint inside
104
- * rivet-core), this returns the repo root — not the subdirectory.
105
- */
106
56
  async getGitRoot() {
107
57
  const root = await (0, simple_git_1.simpleGit)(this.projectPath, GIT_OPTS).revparse([
108
58
  '--show-toplevel',
109
59
  ]);
110
60
  return root.trim();
111
61
  }
112
- /**
113
- * Resolve a path to its canonical (symlinks-followed) form.
114
- *
115
- * `getGitRoot` returns a git-canonicalized path (`rev-parse
116
- * --show-toplevel` resolves symlinks), but `this.projectPath` may be a
117
- * symlinked path — on macOS `/tmp` → `/private/tmp`. Computing
118
- * `path.relative` between a canonical git root and a symlinked project path
119
- * yields an ESCAPING relative path (e.g. `../../../tmp/...`), which then
120
- * resolves OUTSIDE the worktree. Canonicalizing both sides first keeps the
121
- * relative path inside the tree. Falls back to a plain `path.resolve` when
122
- * the path doesn't exist yet (realpath throws ENOENT).
123
- */
124
62
  async realPath(p) {
125
63
  try {
126
64
  return await fs_1.default.promises.realpath(p);
@@ -129,21 +67,6 @@ class WorktreeManager {
129
67
  return path_1.default.resolve(p);
130
68
  }
131
69
  }
132
- /**
133
- * Ensure `this.projectPath` is inside a git repo, bootstrapping one if not.
134
- *
135
- * Fresh / blank projects (an empty folder, or a plain HTML preview) that the
136
- * user opens outside any repo would otherwise fail at `git worktree add`
137
- * (and `getGitRoot`'s `rev-parse --show-toplevel`) with "expected a git
138
- * workspace". We `git init` the folder and create an EMPTY initial commit so
139
- * `HEAD` exists — `git worktree add HEAD` requires a commit to point at, so a
140
- * bare `git init` on a blank folder isn't enough. `add -A` first captures
141
- * whatever is already there (e.g. an `index.html`) as the starting point.
142
- *
143
- * No-op when an enclosing repo already has a HEAD commit — we never nest a
144
- * repo inside another. Best-effort: a failure here surfaces at the
145
- * subsequent worktree step rather than masking the original operation.
146
- */
147
70
  async ensureGitRepo() {
148
71
  const projectPath = this.projectPath;
149
72
  const git = (0, simple_git_1.simpleGit)(projectPath, GIT_OPTS);
@@ -166,9 +89,6 @@ class WorktreeManager {
166
89
  else {
167
90
  log.info(`Git repo at ${projectPath} has no HEAD — creating one for Rivet`);
168
91
  }
169
- // Stage anything already present so a non-empty start point (e.g. an
170
- // HTML preview) lands in the initial commit. Empty dir → nothing staged,
171
- // and `--allow-empty` still produces the HEAD commit we need.
172
92
  await git.add(['-A']).catch(() => { });
173
93
  await git.raw([
174
94
  '-c',
@@ -182,18 +102,7 @@ class WorktreeManager {
182
102
  'rivet: initial',
183
103
  ]);
184
104
  }
185
- /**
186
- * Return the path to the project within a worktree.
187
- * When projectPath == gitRoot this is just worktreePath.
188
- * When projectPath is a subdirectory (e.g. rivet-core/examples/microsoft-paint),
189
- * this returns worktreePath/examples/microsoft-paint so the dev server starts
190
- * from the right directory.
191
- */
192
105
  async getProjectCwdInWorktree(worktreePath) {
193
- // Canonicalize both sides so a symlinked projectPath (e.g. /tmp on macOS,
194
- // which is a symlink to /private/tmp) matches the git-resolved gitRoot.
195
- // Without this, path.relative produces an escaping `../../..` path that
196
- // resolves back to the ORIGINAL project dir instead of inside the worktree.
197
106
  const gitRoot = await this.realPath(await this.getGitRoot());
198
107
  const projectPath = await this.realPath(this.projectPath);
199
108
  const relPath = path_1.default.relative(gitRoot, projectPath);
@@ -203,14 +112,7 @@ class WorktreeManager {
203
112
  }
204
113
  return relPath ? path_1.default.join(worktreePath, relPath) : worktreePath;
205
114
  }
206
- /**
207
- * Translate an absolute path that lives inside the main project tree to its
208
- * equivalent path inside a worktree. Paths outside the git root are returned
209
- * unchanged so the method is safe to call on arbitrary strings.
210
- */
211
115
  async translateToWorktreePath(absPath, worktreePath) {
212
- // Canonicalize both sides (see getProjectCwdInWorktree) so a symlinked
213
- // absPath doesn't compute an escaping rel against the git-resolved root.
214
116
  const gitRoot = await this.realPath(await this.getGitRoot());
215
117
  const realAbsPath = await this.realPath(absPath);
216
118
  const rel = path_1.default.relative(gitRoot, realAbsPath);
@@ -218,55 +120,52 @@ class WorktreeManager {
218
120
  return absPath;
219
121
  return path_1.default.join(worktreePath, rel);
220
122
  }
221
- /** Get diff of all uncommitted changes (staged + unstaged) vs HEAD */
222
123
  async getUncommittedPatch() {
223
124
  const git = (0, simple_git_1.simpleGit)(this.projectPath, GIT_OPTS);
224
- const diff = await git.diff(['HEAD']);
125
+ const diff = await git.diff(['--binary', '--full-index', 'HEAD']);
225
126
  return diff;
226
127
  }
227
- /**
228
- * Return untracked, non-ignored file paths relative to the git root.
229
- * These are files present in the working tree but not yet in any commit,
230
- * so `git diff HEAD` won't include them.
231
- */
232
128
  async getUntrackedFiles() {
233
129
  const gitRoot = await this.getGitRoot();
234
130
  const git = (0, simple_git_1.simpleGit)(gitRoot, GIT_OPTS);
235
- const result = await git
236
- .raw(['ls-files', '--others', '--exclude-standard'])
237
- .catch(() => '');
238
- return result.split('\n').filter(Boolean);
131
+ const result = await git.raw([
132
+ 'ls-files',
133
+ '--others',
134
+ '--exclude-standard',
135
+ '-z',
136
+ ]);
137
+ return result.split('\0').filter(Boolean);
239
138
  }
240
- /** Copy untracked files from the source repo into a worktree */
241
139
  copyUntrackedFiles(untrackedFiles, gitRoot, worktreePath) {
242
140
  for (const relPath of untrackedFiles) {
243
141
  try {
244
142
  const src = path_1.default.join(gitRoot, relPath);
245
143
  const dest = path_1.default.join(worktreePath, relPath);
246
144
  fs_1.default.mkdirSync(path_1.default.dirname(dest), { recursive: true });
247
- // Clone-on-write where the filesystem supports it (free), plain copy
248
- // elsewhere — untracked trees can hold large binary assets.
249
145
  fs_1.default.copyFileSync(src, dest, fs_1.default.constants.COPYFILE_FICLONE);
250
146
  }
251
147
  catch (err) {
252
- log.warn(`Could not copy untracked file ${relPath} to worktree:`, err);
148
+ if (err.code === 'ENOENT') {
149
+ log.warn(`Skipped untracked file ${relPath} with no readable source`);
150
+ continue;
151
+ }
152
+ throw new Error(`Could not copy untracked file ${relPath} to worktree: ${err instanceof Error ? err.message : String(err)}`);
253
153
  }
254
154
  }
255
155
  }
256
- /**
257
- * @effect Makes an existing dependency install available in a worktree when the destination is absent.
258
- */
259
- async provisionWorkspaceDependenciesIfAvailable(sourceRoot, destRoot) {
260
- const nodeModulesSource = path_1.default.join(sourceRoot, 'node_modules');
261
- const nodeModulesDest = path_1.default.join(destRoot, 'node_modules');
262
- if (fs_1.default.existsSync(nodeModulesSource) && !fs_1.default.existsSync(nodeModulesDest)) {
263
- await this.operatingSystemServices.workspaceDependencies.provision({
264
- sourceDirectory: nodeModulesSource,
265
- destinationDirectory: nodeModulesDest,
266
- });
267
- }
156
+ async commitDetachedBaseline(worktreeGit, message) {
157
+ const tree = (await worktreeGit.raw(['write-tree'])).trim();
158
+ const baseline = (await worktreeGit.raw([
159
+ ...internalGitIdentity_1.INTERNAL_GIT_IDENTITY_ARGS,
160
+ 'commit-tree',
161
+ tree,
162
+ '-p',
163
+ 'HEAD',
164
+ '-m',
165
+ message,
166
+ ])).trim();
167
+ await worktreeGit.raw(['update-ref', '--no-deref', 'HEAD', baseline]);
268
168
  }
269
- /** Apply a patch string via stdin to the given cwd using git apply */
270
169
  applyPatchViaStdin(patch, cwd) {
271
170
  return new Promise((resolve, reject) => {
272
171
  const cp = (0, child_process_1.spawn)('git', ['apply', '--whitespace=nowarn', '-'], {
@@ -287,74 +186,50 @@ class WorktreeManager {
287
186
  cp.stdin.end();
288
187
  });
289
188
  }
290
- /**
291
- * Create N worktrees for a session, apply uncommitted patch to each, return paths.
292
- *
293
- * `instanceKeyPrefix` namespaces the worktree directory names so a second
294
- * batch appended to the same session (sequential "Vary") does not collide
295
- * with the first batch's `${INSTANCE_PREFIX}-${sessionId}-${i}` paths. It
296
- * stays within the `${INSTANCE_PREFIX}-${sessionId}-` cleanup glob, so
297
- * `cleanupSession` still removes appended worktrees.
298
- */
299
189
  async createWorktrees(sessionId, count, instanceKeyPrefix = '') {
300
190
  this.assertSafeSessionId(sessionId);
301
191
  if (instanceKeyPrefix && !SESSION_ID_PATTERN.test(instanceKeyPrefix)) {
302
192
  throw new Error('Invalid instanceKeyPrefix: expected a safe path segment');
303
193
  }
304
- // Blank / non-repo workspaces (empty folder or a bare HTML preview) have
305
- // no git history for `git worktree add` to branch from — bootstrap one
306
- // first so variants work outside an existing repo.
307
194
  await this.ensureGitRepo();
308
195
  const git = (0, simple_git_1.simpleGit)(this.projectPath, GIT_OPTS);
309
196
  const patch = await this.getUncommittedPatch();
310
197
  const gitRoot = await this.getGitRoot();
311
198
  const untrackedFiles = await this.getUntrackedFiles();
312
199
  const paths = [];
313
- const projectCwdRelative = path_1.default.relative(gitRoot, path_1.default.resolve(this.projectPath));
314
200
  for (let i = 0; i < count; i++) {
315
201
  const worktreePath = path_1.default.join(EXISTING_WORKTREE_BASE, `${exports.INSTANCE_PREFIX}-${sessionId}-${instanceKeyPrefix}${i}`);
202
+ let isWorktreeCreated = false;
316
203
  try {
317
204
  await git.raw(['worktree', 'add', '--detach', worktreePath, 'HEAD']);
318
- // Provision dependency installs in both roots the dev tooling may
319
- // resolve from: the repo root for shared config files and the project
320
- // subdirectory for app-local imports.
321
- const projectCwdInWorktree = projectCwdRelative
322
- ? path_1.default.join(worktreePath, projectCwdRelative)
323
- : worktreePath;
324
- await this.provisionWorkspaceDependenciesIfAvailable(gitRoot, worktreePath);
325
- if (projectCwdInWorktree !== worktreePath) {
326
- await this.provisionWorkspaceDependenciesIfAvailable(this.projectPath, projectCwdInWorktree);
327
- }
328
- // Apply uncommitted changes so agent sees current state, then commit
329
- // them as a "baseline" so getDiff returns only the agent's delta.
330
- // Without this, getDiff (git diff HEAD) would include the user's
331
- // pre-existing changes, and reverting the combined diff would wipe them.
205
+ isWorktreeCreated = true;
332
206
  if (patch.trim()) {
333
- await this.applyPatchViaStdin(patch, worktreePath).catch(() => {
334
- log.warn(`Could not apply uncommitted patch to worktree ${i} — working from HEAD`);
335
- });
207
+ await this.applyPatchViaStdin(patch, worktreePath);
336
208
  }
337
- // Copy untracked files — git diff HEAD only covers tracked files, so
338
- // untracked-but-not-ignored files (e.g. new components not yet committed)
339
- // must be copied manually or the worktree's dev server will fail to
340
- // resolve their imports.
341
209
  if (untrackedFiles.length > 0) {
342
210
  this.copyUntrackedFiles(untrackedFiles, gitRoot, worktreePath);
343
211
  }
344
212
  const wtGit = (0, simple_git_1.simpleGit)(worktreePath, GIT_OPTS);
345
- await wtGit.raw(['add', '-A']).catch(() => { });
346
- await wtGit
347
- .raw([
348
- 'commit',
349
- '--allow-empty',
350
- '--no-gpg-sign',
351
- '-m',
352
- 'rivet: variant baseline',
353
- ])
354
- .catch(() => { });
213
+ await wtGit.raw(['add', '-A']);
214
+ await this.commitDetachedBaseline(wtGit, 'rivet: variant baseline');
355
215
  paths.push(worktreePath);
356
216
  }
357
217
  catch (e) {
218
+ const incompletePaths = isWorktreeCreated
219
+ ? [...paths, worktreePath]
220
+ : paths;
221
+ for (const incompletePath of incompletePaths) {
222
+ try {
223
+ await git.raw(['worktree', 'remove', '--force', incompletePath]);
224
+ }
225
+ catch (cleanupError) {
226
+ log.warn('Could not unregister an incomplete variant worktree', cleanupError);
227
+ await fs_1.default.promises.rm(incompletePath, {
228
+ recursive: true,
229
+ force: true,
230
+ });
231
+ }
232
+ }
358
233
  log.error(`Failed to create worktree ${i}:`, e);
359
234
  const msg = e instanceof Error ? e.message : String(e);
360
235
  if (/block timeout reached/i.test(msg)) {
@@ -368,11 +243,6 @@ class WorktreeManager {
368
243
  }
369
244
  return paths;
370
245
  }
371
- /**
372
- * Copy a variant worktree into N new sibling worktrees. Each destination
373
- * inherits the source tree (including the baseline commit and agent delta)
374
- * so a code_gen "Vary" starts from the parent variant rather than git HEAD.
375
- */
376
246
  async forkWorktreesFrom(sourceWorktreePath, sessionId, count, instanceKeyPrefix = '') {
377
247
  this.assertSafeSessionId(sessionId);
378
248
  if (instanceKeyPrefix && !SESSION_ID_PATTERN.test(instanceKeyPrefix)) {
@@ -386,38 +256,22 @@ class WorktreeManager {
386
256
  for (let i = 0; i < count; i++) {
387
257
  const worktreePath = path_1.default.join(EXISTING_WORKTREE_BASE, `${exports.INSTANCE_PREFIX}-${sessionId}-${instanceKeyPrefix}${i}`);
388
258
  fs_1.default.mkdirSync(path_1.default.dirname(worktreePath), { recursive: true });
389
- // Copy-on-write clone where supported: forking a large parent tree
390
- // completes in milliseconds instead of scaling with repo size.
391
- (0, cloneOrCopyDirSync_1.cloneOrCopyDirSync)(resolvedSource, worktreePath);
259
+ await fs_1.default.promises.cp(resolvedSource, worktreePath, {
260
+ recursive: true,
261
+ verbatimSymlinks: true,
262
+ mode: fs_1.default.constants.COPYFILE_FICLONE,
263
+ filter: (source) => !(0, ProjectPackageManager_1.isInstallOutputPath)(path_1.default.relative(resolvedSource, source)),
264
+ });
392
265
  paths.push(worktreePath);
393
266
  }
394
267
  return paths;
395
268
  }
396
- /** Get git diff of all changes made in a worktree vs HEAD.
397
- *
398
- * `git diff HEAD` only covers tracked files. New files created by the agent
399
- * are untracked and would be silently omitted, breaking imports/styles when
400
- * the diff is applied to the main tree. `git add --intent-to-add .` marks
401
- * every untracked file in the index as a zero-length blob so `git diff HEAD`
402
- * includes them as pure additions without actually staging their content.
403
- */
404
269
  async getDiff(worktreePath) {
405
270
  const git = (0, simple_git_1.simpleGit)(worktreePath);
406
- // Stage new files with intent-to-add so they appear in the diff
407
271
  await git.raw(['add', '--intent-to-add', '.']).catch(() => {
408
- // Non-fatal — if this fails, fall back to tracked-only diff
409
272
  });
410
- return git.diff(['HEAD']);
411
- }
412
- /**
413
- * Apply or revert a diff to the main project working tree.
414
- *
415
- * Because getDiff now diffs against the worktree baseline commit (HEAD +
416
- * user's uncommitted changes), the codeDiff contains only the agent's delta.
417
- * This means git apply --reverse reliably restores to the baseline state
418
- * (user's uncommitted changes intact) without touching git checkout HEAD,
419
- * which would wipe the user's pre-existing work.
420
- */
273
+ return git.diff(['--binary', '--full-index', 'HEAD']);
274
+ }
421
275
  async applyDiff(diff, reverse) {
422
276
  if (!diff.trim())
423
277
  return;
@@ -444,9 +298,6 @@ class WorktreeManager {
444
298
  cp.stdin.end();
445
299
  });
446
300
  }
447
- /**
448
- * Apply a unified diff to the repository that contains the target project path.
449
- */
450
301
  async applyDiffToProject(diff, projectPath) {
451
302
  if (!diff.trim())
452
303
  return;
@@ -454,7 +305,6 @@ class WorktreeManager {
454
305
  const gitRoot = (await git.revparse(['--show-toplevel'])).trim();
455
306
  return this.applyPatchViaStdin(diff, gitRoot);
456
307
  }
457
- /** Bind port 0 to get an OS-assigned free port */
458
308
  getFreePort() {
459
309
  return new Promise((resolve, reject) => {
460
310
  const server = net_1.default.createServer();
@@ -466,24 +316,6 @@ class WorktreeManager {
466
316
  server.on('error', reject);
467
317
  });
468
318
  }
469
- /**
470
- * Find a free port by scanning upward from `startPort` (the framework's
471
- * default, e.g. 3000 for Next, 5173 for Vite). Returns the first port that is
472
- * both bindable and not already reserved by a concurrent variant start, so a
473
- * preview comes up on a sensible, predictable port near the project's normal
474
- * one — and naturally steps past a port the user's own dev server already
475
- * holds — instead of a random high port. Falls back to an OS-assigned port if
476
- * the scan window is exhausted.
477
- *
478
- * Port availability is delegated to {@link findAvailablePort}, which (unlike a
479
- * plain bind check) also rejects a port with an active listener on 127.0.0.1
480
- * or ::1 — the ports that actually carry `localhost` preview traffic.
481
- *
482
- * The returned port is reserved synchronously; the caller MUST `releasePort`
483
- * it once the dev server has bound it or failed to start (the orchestrator
484
- * does this in a `finally`). Reserving here is what stops two concurrent
485
- * starts — neither of which has bound its port yet — from both picking it.
486
- */
487
319
  async findFreePortFrom(startPort, scanWindow = 64) {
488
320
  const base = Number.isInteger(startPort) && startPort > 0 && startPort <= 65535
489
321
  ? startPort
@@ -496,33 +328,23 @@ class WorktreeManager {
496
328
  candidate = await (0, portUtils_1.findAvailablePort)(from);
497
329
  }
498
330
  catch {
499
- break; // no bindable port between `from` and 65535
331
+ break;
500
332
  }
501
333
  if (candidate > limit)
502
- break; // first free port is outside the scan window
503
- // Check-and-claim with no `await` in between, so two concurrent callers
504
- // can't both observe the same port as unreserved before claiming it.
334
+ break;
505
335
  if (!this.reservedPorts.has(candidate)) {
506
336
  this.reservedPorts.add(candidate);
507
337
  return candidate;
508
338
  }
509
- from = candidate + 1; // reserved by a sibling start — step past it
339
+ from = candidate + 1;
510
340
  }
511
- // Scan window exhausted (or every free port in it is reserved by a sibling
512
- // that hasn't bound yet) — fall back to an OS-assigned ephemeral port.
513
341
  const fallback = await this.getFreePort();
514
342
  this.reservedPorts.add(fallback);
515
343
  return fallback;
516
344
  }
517
- /**
518
- * Release a port previously handed out by {@link findFreePortFrom}. Call once
519
- * the dev server has bound it (the listener check now sees it taken, so the
520
- * reservation is redundant) or has failed to start (the port is free again).
521
- */
522
345
  releasePort(port) {
523
346
  this.reservedPorts.delete(port);
524
347
  }
525
- /** Validate a diff via `git apply --check` without modifying files */
526
348
  validateDiff(diff, reverse) {
527
349
  if (!diff.trim())
528
350
  return Promise.resolve();
@@ -549,23 +371,13 @@ class WorktreeManager {
549
371
  cp.stdin.end();
550
372
  });
551
373
  }
552
- /**
553
- * Spawn a dev server and poll until it responds with a non-502 HTTP status
554
- * (max 30s). Throws on timeout.
555
- */
556
374
  async startDevServer(worktreePath, port, cmd, args, env) {
557
375
  const proc = this.operatingSystemServices.projectProcesses.start({ executable: cmd, args }, {
558
376
  cwd: worktreePath,
559
- env: { ...process.env, ...env },
377
+ env: { ...process.env, NODE_ENV: 'development', ...env },
560
378
  stdio: 'pipe',
561
379
  detached: false,
562
380
  });
563
- // Capture a rolling tail of the child's output so a failed start is
564
- // diagnosable (EADDRINUSE, missing dev script, build crash) instead of a
565
- // blind timeout. Draining the pipes is also required: with `stdio: 'pipe'`
566
- // and no consumer, the OS pipe buffer (~64KB) fills within seconds of
567
- // Vite's HMR/request logging and the child blocks on write, freezing the
568
- // dev server even though it passed the readiness probe.
569
381
  let outputTail = '';
570
382
  let lastOutputAt = Date.now();
571
383
  const drain = (data) => {
@@ -575,10 +387,6 @@ class WorktreeManager {
575
387
  };
576
388
  proc.stdout?.on('data', drain);
577
389
  proc.stderr?.on('data', drain);
578
- // Track early termination so the probe can fail fast: a dev server that
579
- // exits (or never spawns) before answering on `port` is never coming up —
580
- // commonly because the project's dev script ignored the injected port and
581
- // tried to bind its own default, which was already taken (EADDRINUSE).
582
390
  const term = {};
583
391
  const onExit = (code, signal) => {
584
392
  term.exited = { code, signal };
@@ -597,8 +405,14 @@ class WorktreeManager {
597
405
  detach();
598
406
  const portInUse = (0, devServerError_1.isPortInUseOutput)(outputTail);
599
407
  const detail = outputTail.trim();
408
+ const failureReason = reason !== 'spawn_error' && (0, devServerError_1.isCompilationFailureOutput)(detail)
409
+ ? 'compile_error'
410
+ : reason;
600
411
  let message;
601
- if (reason === 'spawn_error') {
412
+ if (failureReason === 'compile_error') {
413
+ message = `Dev server could not compile the preview on port ${port}`;
414
+ }
415
+ else if (reason === 'spawn_error') {
602
416
  message = `Dev server failed to spawn on port ${port}: ${term.spawnError?.message ?? 'unknown error'}`;
603
417
  }
604
418
  else if (reason === 'exited') {
@@ -609,7 +423,7 @@ class WorktreeManager {
609
423
  }
610
424
  throw new devServerError_1.DevServerStartError({
611
425
  message: detail ? `${message}\n${detail}` : message,
612
- reason,
426
+ reason: failureReason,
613
427
  portInUse,
614
428
  detail,
615
429
  exitCode: term.exited?.code ?? null,
@@ -626,14 +440,20 @@ class WorktreeManager {
626
440
  const isReady = await (0, portUtils_1.probeLoopbackHttp)(port, {
627
441
  timeoutMs: DEV_SERVER_PROBE_TIMEOUT_MS,
628
442
  });
443
+ if (term.spawnError)
444
+ fail('spawn_error');
445
+ if (term.exited)
446
+ fail('exited');
629
447
  if (isReady) {
630
448
  detach();
631
449
  return proc;
632
450
  }
451
+ if ((0, devServerError_1.isCompilationFailureOutput)(outputTail)) {
452
+ await this.stopDevServer(proc);
453
+ fail('compile_error');
454
+ }
633
455
  await new Promise((r) => setTimeout(r, 500));
634
456
  }
635
- // Deadline hit. If the child died during the final wait, report that
636
- // (actionable) rather than a generic timeout.
637
457
  if (term.spawnError)
638
458
  fail('spawn_error');
639
459
  if (term.exited)
@@ -644,13 +464,9 @@ class WorktreeManager {
644
464
  });
645
465
  }
646
466
  catch {
647
- /* ignore */
648
467
  }
649
468
  return fail('timeout');
650
469
  }
651
- /**
652
- * @effect Stops a project dev server through the selected operating-system service.
653
- */
654
470
  async stopDevServer(proc, timeoutMs = 5_000) {
655
471
  if (proc.killed || proc.exitCode !== null || proc.pid == null)
656
472
  return;
@@ -669,7 +485,6 @@ class WorktreeManager {
669
485
  });
670
486
  }
671
487
  catch {
672
- /* ignore */
673
488
  }
674
489
  let timeout;
675
490
  const timedOut = await Promise.race([
@@ -689,34 +504,17 @@ class WorktreeManager {
689
504
  });
690
505
  }
691
506
  catch {
692
- /* ignore */
693
507
  }
694
508
  await exited;
695
509
  }
696
- /** Remove all worktrees for a session.
697
- *
698
- * For existing-project sessions, asks git to unregister the worktree
699
- * (handles `.git/worktrees/*` cleanup) and falls back to plain rm. For
700
- * fresh-project sessions (no projectPath) the worktrees are detached
701
- * directories with their own `.git` under `<destinationParent>/.rivet-variants/`
702
- * — git registry cleanup is a no-op and we just rm the matching dirs.
703
- *
704
- * `freshDestinationParent` is required when the session was fresh; pass
705
- * `path.dirname(projectContext.workspacePath)` so we know which
706
- * `.rivet-variants/` root to sweep.
707
- */
708
510
  async cleanupSession(sessionId, freshDestinationParent) {
709
511
  this.assertSafeSessionId(sessionId);
710
512
  if (!this.resolveProjectPath()) {
711
- // Fresh sessions: no source repo, no git registry to clean. Just rm.
712
513
  if (freshDestinationParent) {
713
514
  this.cleanupFreshWorktrees(sessionId, freshDestinationParent);
714
515
  }
715
516
  return;
716
517
  }
717
- // GIT_OPTS so cleanup can't re-hang: this path runs from teardown after a
718
- // provision timeout/stall, and an unbounded `git worktree list`/`remove`
719
- // would leave the tool hanging on cleanup instead of returning the error.
720
518
  const git = (0, simple_git_1.simpleGit)(this.projectPath, GIT_OPTS);
721
519
  const pattern = path_1.default.join(EXISTING_WORKTREE_BASE, `${exports.INSTANCE_PREFIX}-${sessionId}-`);
722
520
  try {
@@ -731,7 +529,6 @@ class WorktreeManager {
731
529
  await git.raw(['worktree', 'remove', '--force', wPath]);
732
530
  }
733
531
  catch {
734
- // Force remove directory if git command fails
735
532
  fs_1.default.rmSync(wPath, { recursive: true, force: true });
736
533
  }
737
534
  }
@@ -739,31 +536,10 @@ class WorktreeManager {
739
536
  catch (e) {
740
537
  log.warn('Worktree cleanup error:', e);
741
538
  }
742
- // Always also remove any leftover fresh-style directories for this
743
- // session (e.g. mixed-mode sessions, or git registry mismatch).
744
539
  if (freshDestinationParent) {
745
540
  this.cleanupFreshWorktrees(sessionId, freshDestinationParent);
746
541
  }
747
542
  }
748
- /**
749
- * Create N worktrees for a fresh-project session by writing a template
750
- * bundle into each `<destinationParent>/.rivet-variants/rivet-variants-pid<PID>-<sessionId>-<i>`
751
- * directory, optionally writing a DESIGN.md per slot, and committing a
752
- * baseline.
753
- *
754
- * Worktrees live under the user's destinationParent (not /tmp) so commit
755
- * time can be a same-volume rename instead of a cross-volume copy. The
756
- * destinationParent is registered to a small JSON file so a future MCP
757
- * startup can sweep orphans even when the original process crashed.
758
- *
759
- * Does NOT run `npm install` — the orchestrator dispatches that as a
760
- * background task so failures surface via work-item state without blocking
761
- * the MCP tool response.
762
- *
763
- * @effect Creates directories under destinationParent, writes template
764
- * files, runs git init/add/commit, appends destinationParent to
765
- * the fresh-worktree-roots registry.
766
- */
767
543
  async createFreshWorktrees(sessionId, count, template, designContext, destinationParent) {
768
544
  this.assertSafeSessionId(sessionId);
769
545
  if (!destinationParent || !path_1.default.isAbsolute(destinationParent)) {
@@ -798,19 +574,12 @@ class WorktreeManager {
798
574
  });
799
575
  }
800
576
  catch (err) {
801
- // Best-effort: even without a baseline commit the worktree is usable
802
- // for the agent — log and continue.
803
577
  log.warn(`Fresh worktree ${i}: git init failed`, err);
804
578
  }
805
579
  paths.push(worktreePath);
806
580
  }
807
581
  return paths;
808
582
  }
809
- /**
810
- * Write the per-slot DESIGN.md for a fresh worktree.
811
- *
812
- * @effect Writes DESIGN.md when a design context is available.
813
- */
814
583
  writeDesignContext(worktreePath, slot, entry) {
815
584
  if (!entry)
816
585
  return;
@@ -826,50 +595,12 @@ class WorktreeManager {
826
595
  }
827
596
  log.warn(`Fresh worktree ${slot}: unknown design system slug '${entry.slug}' — DESIGN.md skipped`);
828
597
  }
829
- /**
830
- * Move a worktree to its history location preserving contents. Used by the
831
- * orchestrator at commit time so unchosen variants survive on disk as
832
- * runnable references (siblings of the chosen project).
833
- *
834
- * Returns the destination path (`<historyDir>/<folderName>`).
835
- *
836
- * @effect renames `srcWorktreePath` → `<historyDir>/<folderName>`, creating
837
- * the historyDir if needed.
838
- */
839
598
  moveWorktreeToHistory(srcWorktreePath, historyDir, folderName) {
840
599
  fs_1.default.mkdirSync(historyDir, { recursive: true });
841
600
  const dest = path_1.default.join(historyDir, folderName);
842
601
  fs_1.default.renameSync(srcWorktreePath, dest);
843
602
  return dest;
844
603
  }
845
- /**
846
- * Repoint a worktree's `node_modules` at a relative symlink so it tracks
847
- * the chosen variant's real install after both have moved into their new
848
- * permanent homes. Idempotent — removes any existing entry first.
849
- */
850
- repointNodeModulesSymlink(worktreePath, sharedNodeModulesAbsPath) {
851
- const link = path_1.default.join(worktreePath, 'node_modules');
852
- try {
853
- fs_1.default.rmSync(link, { force: true, recursive: true });
854
- }
855
- catch {
856
- /* may not exist */
857
- }
858
- const target = path_1.default.relative(path_1.default.dirname(link), sharedNodeModulesAbsPath);
859
- fs_1.default.symlinkSync(target, link, 'dir');
860
- }
861
- /** Remove all fresh worktrees for a session.
862
- *
863
- * @effect Removes directories under <destinationParent>/.rivet-variants/
864
- * matching ${INSTANCE_PREFIX}-<sessionId>-*. Also removes the
865
- * .rivet-variants/ parent if it becomes empty so the editor file
866
- * tree doesn't accumulate noise.
867
- *
868
- * When `preserve` is provided, entries whose basenames are in the set are
869
- * skipped — used by the orchestrator after a vite_app commit, where the
870
- * unchosen variant worktrees have already been moved to a sibling history
871
- * dir and must not be re-deleted.
872
- */
873
604
  cleanupFreshWorktrees(sessionId, destinationParent, preserve) {
874
605
  this.assertSafeSessionId(sessionId);
875
606
  if (!destinationParent || !path_1.default.isAbsolute(destinationParent)) {
@@ -889,7 +620,6 @@ class WorktreeManager {
889
620
  force: true,
890
621
  });
891
622
  }
892
- // If the freshRoot is now empty, remove it too.
893
623
  try {
894
624
  const remaining = fs_1.default.readdirSync(freshRoot);
895
625
  if (remaining.length === 0) {
@@ -897,12 +627,9 @@ class WorktreeManager {
897
627
  }
898
628
  }
899
629
  catch {
900
- // Non-fatal — leaving the dir is harmless.
901
630
  }
902
631
  }
903
632
  catch (e) {
904
- // ENOENT is expected when the dir was already cleaned up — only log
905
- // when it's a different failure mode.
906
633
  if (e.code !== 'ENOENT') {
907
634
  log.warn('Fresh worktree cleanup error:', e);
908
635
  }
@@ -915,10 +642,6 @@ class WorktreeManager {
915
642
  }
916
643
  }
917
644
  exports.WorktreeManager = WorktreeManager;
918
- /**
919
- * Read the fresh-worktree-root registry, dropping entries whose dir no
920
- * longer exists so the file stays small.
921
- */
922
645
  const loadFreshWorktreeRoots = () => {
923
646
  try {
924
647
  const raw = fs_1.default.readFileSync(FRESH_ROOTS_REGISTRY_PATH, 'utf8');
@@ -944,11 +667,6 @@ const saveFreshWorktreeRoots = (roots) => {
944
667
  log.warn('Could not persist fresh-worktree-roots registry:', err);
945
668
  }
946
669
  };
947
- /**
948
- * Append a freshRoot path to the registry (de-duped). Called by
949
- * createFreshWorktrees so future MCP startups can sweep orphans even if
950
- * the original process crashed before teardown ran.
951
- */
952
670
  const registerFreshWorktreeRoot = (freshRoot) => {
953
671
  const existing = loadFreshWorktreeRoots();
954
672
  if (existing.includes(freshRoot))
@@ -957,13 +675,6 @@ const registerFreshWorktreeRoot = (freshRoot) => {
957
675
  saveFreshWorktreeRoots(existing);
958
676
  };
959
677
  exports.registerFreshWorktreeRoot = registerFreshWorktreeRoot;
960
- /**
961
- * Sweep orphan worktrees from /tmp (existing-project flow) and from every
962
- * registered fresh-worktree root (fresh-project flow). Filters by
963
- * INSTANCE_PREFIX (includes PID) so each server instance only removes its
964
- * own worktrees and never touches those of sibling instances. Prunes
965
- * registry entries whose directory no longer exists so the file stays small.
966
- */
967
678
  const cleanupOrphanedWorktrees = () => {
968
679
  try {
969
680
  const entries = fs_1.default
@@ -977,7 +688,6 @@ const cleanupOrphanedWorktrees = () => {
977
688
  }
978
689
  }
979
690
  catch {
980
- /* ignore */
981
691
  }
982
692
  const roots = loadFreshWorktreeRoots();
983
693
  const survivingRoots = [];
@@ -1004,19 +714,12 @@ const cleanupOrphanedWorktrees = () => {
1004
714
  }
1005
715
  };
1006
716
  exports.cleanupOrphanedWorktrees = cleanupOrphanedWorktrees;
1007
- // Clean up on natural exit (covers process.exit() calls from server shutdown)
1008
717
  process.on('exit', exports.cleanupOrphanedWorktrees);
1009
- /**
1010
- * Prune stale worktree registry entries for a project (`.git/worktrees/<name>`
1011
- * entries where the referenced directory no longer exists). Safe to call at
1012
- * startup — only removes entries for directories that are already gone.
1013
- */
1014
718
  const pruneWorktrees = async (projectPath) => {
1015
719
  try {
1016
720
  await (0, simple_git_1.simpleGit)(projectPath, GIT_OPTS).raw(['worktree', 'prune']);
1017
721
  }
1018
722
  catch {
1019
- // Non-fatal — prune is best-effort housekeeping
1020
723
  }
1021
724
  };
1022
725
  exports.pruneWorktrees = pruneWorktrees;