rivet-design 0.17.4 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (938) hide show
  1. package/bin/rivet.js +0 -16
  2. package/dist/agent-variants/SessionStore.d.ts +5 -240
  3. package/dist/agent-variants/SessionStore.d.ts.map +1 -1
  4. package/dist/agent-variants/SessionStore.js +42 -371
  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 +6 -598
  15. package/dist/agent-variants/WorktreeOrchestrator.d.ts.map +1 -1
  16. package/dist/agent-variants/WorktreeOrchestrator.js +55 -1288
  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 +2016 -600
  31. package/dist/agent-variants/contracts.d.ts.map +1 -1
  32. package/dist/agent-variants/contracts.js +10 -174
  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 +6 -7
  71. package/dist/agent-variants/variantContext.d.ts.map +1 -1
  72. package/dist/agent-variants/variantContext.js +69 -10
  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 +1 -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 +126 -106
  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/profile.d.ts +3 -0
  127. package/dist/cli/commands/profile.d.ts.map +1 -0
  128. package/dist/cli/commands/profile.js +192 -0
  129. package/dist/cli/commands/profile.js.map +1 -0
  130. package/dist/cli/commands/reference.d.ts +0 -5
  131. package/dist/cli/commands/reference.d.ts.map +1 -1
  132. package/dist/cli/commands/reference.js +4 -27
  133. package/dist/cli/commands/reference.js.map +1 -1
  134. package/dist/cli/commands/serve.d.ts +0 -5
  135. package/dist/cli/commands/serve.d.ts.map +1 -1
  136. package/dist/cli/commands/serve.js +0 -34
  137. package/dist/cli/commands/serve.js.map +1 -1
  138. package/dist/cli/commands/shared.d.ts +0 -16
  139. package/dist/cli/commands/shared.d.ts.map +1 -1
  140. package/dist/cli/commands/shared.js +0 -19
  141. package/dist/cli/commands/shared.js.map +1 -1
  142. package/dist/cli/commands/status.d.ts +0 -6
  143. package/dist/cli/commands/status.d.ts.map +1 -1
  144. package/dist/cli/commands/status.js +0 -11
  145. package/dist/cli/commands/status.js.map +1 -1
  146. package/dist/cli/commands/stop.d.ts +0 -5
  147. package/dist/cli/commands/stop.d.ts.map +1 -1
  148. package/dist/cli/commands/stop.js +0 -6
  149. package/dist/cli/commands/stop.js.map +1 -1
  150. package/dist/cli/commands/update.d.ts +0 -1
  151. package/dist/cli/commands/update.d.ts.map +1 -1
  152. package/dist/cli/commands/update.js +0 -1
  153. package/dist/cli/commands/update.js.map +1 -1
  154. package/dist/cli/commands/variants.d.ts +0 -1
  155. package/dist/cli/commands/variants.d.ts.map +1 -1
  156. package/dist/cli/commands/variants.js +13 -32
  157. package/dist/cli/commands/variants.js.map +1 -1
  158. package/dist/cli/commands/wait.d.ts +0 -21
  159. package/dist/cli/commands/wait.d.ts.map +1 -1
  160. package/dist/cli/commands/wait.js +0 -23
  161. package/dist/cli/commands/wait.js.map +1 -1
  162. package/dist/cli/entry.d.ts +0 -10
  163. package/dist/cli/entry.d.ts.map +1 -1
  164. package/dist/cli/entry.js +0 -13
  165. package/dist/cli/entry.js.map +1 -1
  166. package/dist/cli/envelope.d.ts +1 -25
  167. package/dist/cli/envelope.d.ts.map +1 -1
  168. package/dist/cli/envelope.js +0 -19
  169. package/dist/cli/envelope.js.map +1 -1
  170. package/dist/cli/flags.d.ts +0 -7
  171. package/dist/cli/flags.d.ts.map +1 -1
  172. package/dist/cli/flags.js +0 -7
  173. package/dist/cli/flags.js.map +1 -1
  174. package/dist/cli/handoff.d.ts +0 -33
  175. package/dist/cli/handoff.d.ts.map +1 -1
  176. package/dist/cli/handoff.js +0 -42
  177. package/dist/cli/handoff.js.map +1 -1
  178. package/dist/cli/handoffStore.d.ts +0 -11
  179. package/dist/cli/handoffStore.d.ts.map +1 -1
  180. package/dist/cli/handoffStore.js +0 -10
  181. package/dist/cli/handoffStore.js.map +1 -1
  182. package/dist/cli/hostWorkNextAction.d.ts +0 -11
  183. package/dist/cli/hostWorkNextAction.d.ts.map +1 -1
  184. package/dist/cli/hostWorkNextAction.js +0 -4
  185. package/dist/cli/hostWorkNextAction.js.map +1 -1
  186. package/dist/cli/io.d.ts +0 -9
  187. package/dist/cli/io.d.ts.map +1 -1
  188. package/dist/cli/io.js +0 -1
  189. package/dist/cli/io.js.map +1 -1
  190. package/dist/cli/resolveDefaultNodeEnv.d.ts +0 -5
  191. package/dist/cli/resolveDefaultNodeEnv.d.ts.map +1 -1
  192. package/dist/cli/resolveDefaultNodeEnv.js +0 -5
  193. package/dist/cli/resolveDefaultNodeEnv.js.map +1 -1
  194. package/dist/cli/router.d.ts +0 -21
  195. package/dist/cli/router.d.ts.map +1 -1
  196. package/dist/cli/router.js +8 -46
  197. package/dist/cli/router.js.map +1 -1
  198. package/dist/cli/runnerSelection.d.ts +0 -58
  199. package/dist/cli/runnerSelection.d.ts.map +1 -1
  200. package/dist/cli/runnerSelection.js +0 -16
  201. package/dist/cli/runnerSelection.js.map +1 -1
  202. package/dist/cli/serverHandshake.d.ts +0 -36
  203. package/dist/cli/serverHandshake.d.ts.map +1 -1
  204. package/dist/cli/serverHandshake.js +0 -29
  205. package/dist/cli/serverHandshake.js.map +1 -1
  206. package/dist/cli/serverUnavailable.d.ts +0 -1
  207. package/dist/cli/serverUnavailable.d.ts.map +1 -1
  208. package/dist/cli/serverUnavailable.js +0 -1
  209. package/dist/cli/serverUnavailable.js.map +1 -1
  210. package/dist/cli/serverVersion.d.ts +0 -22
  211. package/dist/cli/serverVersion.d.ts.map +1 -1
  212. package/dist/cli/serverVersion.js +0 -12
  213. package/dist/cli/serverVersion.js.map +1 -1
  214. package/dist/cli/telemetry.d.ts +0 -4
  215. package/dist/cli/telemetry.d.ts.map +1 -1
  216. package/dist/cli/telemetry.js +0 -4
  217. package/dist/cli/telemetry.js.map +1 -1
  218. package/dist/config/evaluateFlags.d.ts +0 -4
  219. package/dist/config/evaluateFlags.d.ts.map +1 -1
  220. package/dist/config/evaluateFlags.js +0 -11
  221. package/dist/config/evaluateFlags.js.map +1 -1
  222. package/dist/config/featureFlagUserKey.d.ts +0 -3
  223. package/dist/config/featureFlagUserKey.d.ts.map +1 -1
  224. package/dist/config/featureFlagUserKey.js +0 -3
  225. package/dist/config/featureFlagUserKey.js.map +1 -1
  226. package/dist/config/flags.d.ts +0 -14
  227. package/dist/config/flags.d.ts.map +1 -1
  228. package/dist/config/flags.js +0 -27
  229. package/dist/config/flags.js.map +1 -1
  230. package/dist/config/proxy.d.ts +0 -3
  231. package/dist/config/proxy.d.ts.map +1 -1
  232. package/dist/config/proxy.js +0 -11
  233. package/dist/config/proxy.js.map +1 -1
  234. package/dist/config/telemetry.d.ts +0 -13
  235. package/dist/config/telemetry.d.ts.map +1 -1
  236. package/dist/config/telemetry.js +0 -13
  237. package/dist/config/telemetry.js.map +1 -1
  238. package/dist/config/telemetryContract.d.ts +0 -1
  239. package/dist/config/telemetryContract.d.ts.map +1 -1
  240. package/dist/config/telemetryContract.js +0 -1
  241. package/dist/config/telemetryContract.js.map +1 -1
  242. package/dist/hosts/workerDefaults.d.ts +0 -69
  243. package/dist/hosts/workerDefaults.d.ts.map +1 -1
  244. package/dist/hosts/workerDefaults.js +0 -68
  245. package/dist/hosts/workerDefaults.js.map +1 -1
  246. package/dist/index-core.d.ts.map +1 -1
  247. package/dist/index-core.js +0 -2
  248. package/dist/index-core.js.map +1 -1
  249. package/dist/index.d.ts +0 -20
  250. package/dist/index.d.ts.map +1 -1
  251. package/dist/index.js +2 -105
  252. package/dist/index.js.map +1 -1
  253. package/dist/install/allowlists.d.ts +0 -32
  254. package/dist/install/allowlists.d.ts.map +1 -1
  255. package/dist/install/allowlists.js +0 -44
  256. package/dist/install/allowlists.js.map +1 -1
  257. package/dist/install/automaticCliUpdate.d.ts +0 -6
  258. package/dist/install/automaticCliUpdate.d.ts.map +1 -1
  259. package/dist/install/automaticCliUpdate.js +0 -13
  260. package/dist/install/automaticCliUpdate.js.map +1 -1
  261. package/dist/install/channelCli.d.ts +0 -1
  262. package/dist/install/channelCli.d.ts.map +1 -1
  263. package/dist/install/channelCli.js +0 -3
  264. package/dist/install/channelCli.js.map +1 -1
  265. package/dist/install/channelManager.d.ts +0 -14
  266. package/dist/install/channelManager.d.ts.map +1 -1
  267. package/dist/install/channelManager.js +0 -22
  268. package/dist/install/channelManager.js.map +1 -1
  269. package/dist/install/codexGuidance.d.ts +0 -1
  270. package/dist/install/codexGuidance.d.ts.map +1 -1
  271. package/dist/install/codexGuidance.js +0 -7
  272. package/dist/install/codexGuidance.js.map +1 -1
  273. package/dist/install/globalBootstrap.d.ts +0 -25
  274. package/dist/install/globalBootstrap.d.ts.map +1 -1
  275. package/dist/install/globalBootstrap.js +0 -10
  276. package/dist/install/globalBootstrap.js.map +1 -1
  277. package/dist/install/harnesses.d.ts +0 -66
  278. package/dist/install/harnesses.d.ts.map +1 -1
  279. package/dist/install/harnesses.js +0 -60
  280. package/dist/install/harnesses.js.map +1 -1
  281. package/dist/install/installationChannel.d.ts +0 -1
  282. package/dist/install/installationChannel.d.ts.map +1 -1
  283. package/dist/install/installationChannel.js +0 -1
  284. package/dist/install/installationChannel.js.map +1 -1
  285. package/dist/install/legacyMcp.d.ts +0 -23
  286. package/dist/install/legacyMcp.d.ts.map +1 -1
  287. package/dist/install/legacyMcp.js +3 -46
  288. package/dist/install/legacyMcp.js.map +1 -1
  289. package/dist/install/mcpRegistration.d.ts +0 -41
  290. package/dist/install/mcpRegistration.d.ts.map +1 -1
  291. package/dist/install/mcpRegistration.js +2 -70
  292. package/dist/install/mcpRegistration.js.map +1 -1
  293. package/dist/library/HubClient.d.ts +1 -2
  294. package/dist/library/HubClient.d.ts.map +1 -1
  295. package/dist/library/HubClient.js +11 -5
  296. package/dist/library/HubClient.js.map +1 -1
  297. package/dist/library/HubServer.d.ts +0 -1
  298. package/dist/library/HubServer.d.ts.map +1 -1
  299. package/dist/library/HubServer.js +19 -1
  300. package/dist/library/HubServer.js.map +1 -1
  301. package/dist/library/StaticPreviewServer.d.ts +0 -1
  302. package/dist/library/StaticPreviewServer.d.ts.map +1 -1
  303. package/dist/library/StaticPreviewServer.js +0 -1
  304. package/dist/library/StaticPreviewServer.js.map +1 -1
  305. package/dist/library/http.d.ts +0 -2
  306. package/dist/library/http.d.ts.map +1 -1
  307. package/dist/library/http.js +0 -2
  308. package/dist/library/http.js.map +1 -1
  309. package/dist/library/importFiles.d.ts +0 -6
  310. package/dist/library/importFiles.d.ts.map +1 -1
  311. package/dist/library/importFiles.js +45 -11
  312. package/dist/library/importFiles.js.map +1 -1
  313. package/dist/mcp/changeBatchClassification.d.ts +0 -40
  314. package/dist/mcp/changeBatchClassification.d.ts.map +1 -1
  315. package/dist/mcp/changeBatchClassification.js +0 -34
  316. package/dist/mcp/changeBatchClassification.js.map +1 -1
  317. package/dist/prompts/commentVariationPrompts.d.ts +0 -5
  318. package/dist/prompts/commentVariationPrompts.d.ts.map +1 -1
  319. package/dist/prompts/commentVariationPrompts.js +0 -5
  320. package/dist/prompts/commentVariationPrompts.js.map +1 -1
  321. package/dist/prototype-host.js +0 -15
  322. package/dist/prototype-host.js.map +1 -1
  323. package/dist/proxy-middleware/preview-bridge.d.ts +0 -2
  324. package/dist/proxy-middleware/preview-bridge.d.ts.map +1 -1
  325. package/dist/proxy-middleware/preview-bridge.js +0 -2
  326. package/dist/proxy-middleware/preview-bridge.js.map +1 -1
  327. package/dist/proxy-middleware/preview-connections.d.ts +0 -1
  328. package/dist/proxy-middleware/preview-connections.d.ts.map +1 -1
  329. package/dist/proxy-middleware/preview-connections.js +0 -1
  330. package/dist/proxy-middleware/preview-connections.js.map +1 -1
  331. package/dist/proxy-middleware/proxy-config.d.ts +0 -12
  332. package/dist/proxy-middleware/proxy-config.d.ts.map +1 -1
  333. package/dist/proxy-middleware/proxy-config.js +2 -49
  334. package/dist/proxy-middleware/proxy-config.js.map +1 -1
  335. package/dist/routes/account.d.ts +0 -1
  336. package/dist/routes/account.d.ts.map +1 -1
  337. package/dist/routes/account.js +0 -2
  338. package/dist/routes/account.js.map +1 -1
  339. package/dist/routes/agentVariants.d.ts +0 -15
  340. package/dist/routes/agentVariants.d.ts.map +1 -1
  341. package/dist/routes/agentVariants.js +132 -329
  342. package/dist/routes/agentVariants.js.map +1 -1
  343. package/dist/routes/cli.d.ts +0 -17
  344. package/dist/routes/cli.d.ts.map +1 -1
  345. package/dist/routes/cli.js +0 -13
  346. package/dist/routes/cli.js.map +1 -1
  347. package/dist/routes/emptyStatePage.d.ts +0 -12
  348. package/dist/routes/emptyStatePage.d.ts.map +1 -1
  349. package/dist/routes/emptyStatePage.js +0 -12
  350. package/dist/routes/emptyStatePage.js.map +1 -1
  351. package/dist/routes/git.d.ts.map +1 -1
  352. package/dist/routes/git.js +0 -13
  353. package/dist/routes/git.js.map +1 -1
  354. package/dist/routes/inlineStartTracker.d.ts +0 -16
  355. package/dist/routes/inlineStartTracker.d.ts.map +1 -1
  356. package/dist/routes/inlineStartTracker.js.map +1 -1
  357. package/dist/routes/integrations.d.ts +0 -6
  358. package/dist/routes/integrations.d.ts.map +1 -1
  359. package/dist/routes/integrations.js +0 -6
  360. package/dist/routes/integrations.js.map +1 -1
  361. package/dist/routes/library/app.d.ts +0 -1
  362. package/dist/routes/library/app.d.ts.map +1 -1
  363. package/dist/routes/library/app.js +1 -3
  364. package/dist/routes/library/app.js.map +1 -1
  365. package/dist/routes/library/index.d.ts +0 -1
  366. package/dist/routes/library/index.d.ts.map +1 -1
  367. package/dist/routes/library/index.js +3 -1
  368. package/dist/routes/library/index.js.map +1 -1
  369. package/dist/routes/library/middleware.d.ts +0 -3
  370. package/dist/routes/library/middleware.d.ts.map +1 -1
  371. package/dist/routes/library/middleware.js +0 -4
  372. package/dist/routes/library/middleware.js.map +1 -1
  373. package/dist/routes/library/navigation.d.ts +0 -1
  374. package/dist/routes/library/navigation.d.ts.map +1 -1
  375. package/dist/routes/library/navigation.js +0 -1
  376. package/dist/routes/library/navigation.js.map +1 -1
  377. package/dist/routes/library/profiles.d.ts +5 -0
  378. package/dist/routes/library/profiles.d.ts.map +1 -0
  379. package/dist/routes/library/profiles.js +182 -0
  380. package/dist/routes/library/profiles.js.map +1 -0
  381. package/dist/routes/library/projects.d.ts +0 -1
  382. package/dist/routes/library/projects.d.ts.map +1 -1
  383. package/dist/routes/library/projects.js +0 -1
  384. package/dist/routes/library/projects.js.map +1 -1
  385. package/dist/routes/library/schemas.d.ts +2 -2
  386. package/dist/routes/library/staticPreview.d.ts +0 -1
  387. package/dist/routes/library/staticPreview.d.ts.map +1 -1
  388. package/dist/routes/library/staticPreview.js +0 -1
  389. package/dist/routes/library/staticPreview.js.map +1 -1
  390. package/dist/routes/library/types.d.ts +2 -0
  391. package/dist/routes/library/types.d.ts.map +1 -1
  392. package/dist/routes/library/variants.d.ts +0 -1
  393. package/dist/routes/library/variants.d.ts.map +1 -1
  394. package/dist/routes/library/variants.js +0 -1
  395. package/dist/routes/library/variants.js.map +1 -1
  396. package/dist/routes/mcp.d.ts +0 -3
  397. package/dist/routes/mcp.d.ts.map +1 -1
  398. package/dist/routes/mcp.js +0 -5
  399. package/dist/routes/mcp.js.map +1 -1
  400. package/dist/routes/prototypeHost.d.ts +0 -2
  401. package/dist/routes/prototypeHost.d.ts.map +1 -1
  402. package/dist/routes/prototypeHost.js +6 -32
  403. package/dist/routes/prototypeHost.js.map +1 -1
  404. package/dist/routes/static.d.ts +0 -3
  405. package/dist/routes/static.d.ts.map +1 -1
  406. package/dist/routes/static.js +0 -6
  407. package/dist/routes/static.js.map +1 -1
  408. package/dist/routes/support.d.ts +0 -3
  409. package/dist/routes/support.d.ts.map +1 -1
  410. package/dist/routes/support.js +0 -3
  411. package/dist/routes/support.js.map +1 -1
  412. package/dist/server.d.ts +0 -42
  413. package/dist/server.d.ts.map +1 -1
  414. package/dist/server.js +1 -129
  415. package/dist/server.js.map +1 -1
  416. package/dist/services/AuthService.d.ts +0 -76
  417. package/dist/services/AuthService.d.ts.map +1 -1
  418. package/dist/services/AuthService.js +0 -112
  419. package/dist/services/AuthService.js.map +1 -1
  420. package/dist/services/BrowserAgentClient.d.ts +1 -21
  421. package/dist/services/BrowserAgentClient.d.ts.map +1 -1
  422. package/dist/services/BrowserAgentClient.js +0 -10
  423. package/dist/services/BrowserAgentClient.js.map +1 -1
  424. package/dist/services/BundleStore.d.ts +0 -18
  425. package/dist/services/BundleStore.d.ts.map +1 -1
  426. package/dist/services/BundleStore.js +0 -10
  427. package/dist/services/BundleStore.js.map +1 -1
  428. package/dist/services/CliLogForwarder.d.ts +0 -26
  429. package/dist/services/CliLogForwarder.d.ts.map +1 -1
  430. package/dist/services/CliLogForwarder.js +1 -33
  431. package/dist/services/CliLogForwarder.js.map +1 -1
  432. package/dist/services/CommitMessageGenerator.d.ts +0 -6
  433. package/dist/services/CommitMessageGenerator.d.ts.map +1 -1
  434. package/dist/services/CommitMessageGenerator.js +0 -3
  435. package/dist/services/CommitMessageGenerator.js.map +1 -1
  436. package/dist/services/ComponentSearchService.d.ts +2 -16
  437. package/dist/services/ComponentSearchService.d.ts.map +1 -1
  438. package/dist/services/ComponentSearchService.js +2 -56
  439. package/dist/services/ComponentSearchService.js.map +1 -1
  440. package/dist/services/ConfigManager.d.ts +0 -113
  441. package/dist/services/ConfigManager.d.ts.map +1 -1
  442. package/dist/services/ConfigManager.js +0 -101
  443. package/dist/services/ConfigManager.js.map +1 -1
  444. package/dist/services/DependencyPreparationService.d.ts +0 -6
  445. package/dist/services/DependencyPreparationService.d.ts.map +1 -1
  446. package/dist/services/DependencyPreparationService.js +0 -22
  447. package/dist/services/DependencyPreparationService.js.map +1 -1
  448. package/dist/services/DevServerRuntimeService.d.ts +0 -20
  449. package/dist/services/DevServerRuntimeService.d.ts.map +1 -1
  450. package/dist/services/DevServerRuntimeService.js +0 -46
  451. package/dist/services/DevServerRuntimeService.js.map +1 -1
  452. package/dist/services/FeatureFlagService.d.ts +0 -15
  453. package/dist/services/FeatureFlagService.d.ts.map +1 -1
  454. package/dist/services/FeatureFlagService.js +0 -23
  455. package/dist/services/FeatureFlagService.js.map +1 -1
  456. package/dist/services/GatewayClient.d.ts +0 -27
  457. package/dist/services/GatewayClient.d.ts.map +1 -1
  458. package/dist/services/GatewayClient.js +0 -25
  459. package/dist/services/GatewayClient.js.map +1 -1
  460. package/dist/services/HistoryReplayService.d.ts +0 -31
  461. package/dist/services/HistoryReplayService.d.ts.map +1 -1
  462. package/dist/services/HistoryReplayService.js +2 -55
  463. package/dist/services/HistoryReplayService.js.map +1 -1
  464. package/dist/services/HubDiscovery.d.ts +0 -8
  465. package/dist/services/HubDiscovery.d.ts.map +1 -1
  466. package/dist/services/HubDiscovery.js +0 -8
  467. package/dist/services/HubDiscovery.js.map +1 -1
  468. package/dist/services/HubNavigation.d.ts +0 -6
  469. package/dist/services/HubNavigation.d.ts.map +1 -1
  470. package/dist/services/HubNavigation.js +5 -8
  471. package/dist/services/HubNavigation.js.map +1 -1
  472. package/dist/services/IntegrationsClient.d.ts +20 -38
  473. package/dist/services/IntegrationsClient.d.ts.map +1 -1
  474. package/dist/services/IntegrationsClient.js +71 -31
  475. package/dist/services/IntegrationsClient.js.map +1 -1
  476. package/dist/services/LocalGitService.d.ts +0 -57
  477. package/dist/services/LocalGitService.d.ts.map +1 -1
  478. package/dist/services/LocalGitService.js +4 -85
  479. package/dist/services/LocalGitService.js.map +1 -1
  480. package/dist/services/MCPOnboardingTelemetry.d.ts +0 -9
  481. package/dist/services/MCPOnboardingTelemetry.d.ts.map +1 -1
  482. package/dist/services/MCPOnboardingTelemetry.js +0 -9
  483. package/dist/services/MCPOnboardingTelemetry.js.map +1 -1
  484. package/dist/services/MCPVariantsTelemetry.d.ts +0 -2
  485. package/dist/services/MCPVariantsTelemetry.d.ts.map +1 -1
  486. package/dist/services/MCPVariantsTelemetry.js +0 -2
  487. package/dist/services/MCPVariantsTelemetry.js.map +1 -1
  488. package/dist/services/OperatingSystemServices.d.ts +0 -12
  489. package/dist/services/OperatingSystemServices.d.ts.map +1 -1
  490. package/dist/services/OperatingSystemServices.js +0 -7
  491. package/dist/services/OperatingSystemServices.js.map +1 -1
  492. package/dist/services/PRTitleGenerator.d.ts +0 -7
  493. package/dist/services/PRTitleGenerator.d.ts.map +1 -1
  494. package/dist/services/PRTitleGenerator.js +0 -3
  495. package/dist/services/PRTitleGenerator.js.map +1 -1
  496. package/dist/services/ProjectCardPreviews.d.ts +0 -5
  497. package/dist/services/ProjectCardPreviews.d.ts.map +1 -1
  498. package/dist/services/ProjectCardPreviews.js +0 -5
  499. package/dist/services/ProjectCardPreviews.js.map +1 -1
  500. package/dist/services/ProjectDetectionService.d.ts +0 -4
  501. package/dist/services/ProjectDetectionService.d.ts.map +1 -1
  502. package/dist/services/ProjectDetectionService.js +2 -44
  503. package/dist/services/ProjectDetectionService.js.map +1 -1
  504. package/dist/services/ProjectFolderPicker.d.ts +0 -3
  505. package/dist/services/ProjectFolderPicker.d.ts.map +1 -1
  506. package/dist/services/ProjectFolderPicker.js +0 -4
  507. package/dist/services/ProjectFolderPicker.js.map +1 -1
  508. package/dist/services/ProjectImport.d.ts +0 -1
  509. package/dist/services/ProjectImport.d.ts.map +1 -1
  510. package/dist/services/ProjectImport.js +0 -3
  511. package/dist/services/ProjectImport.js.map +1 -1
  512. package/dist/services/ProjectLibrary.d.ts +0 -18
  513. package/dist/services/ProjectLibrary.d.ts.map +1 -1
  514. package/dist/services/ProjectLibrary.js +0 -20
  515. package/dist/services/ProjectLibrary.js.map +1 -1
  516. package/dist/services/ProjectMetadataStore.d.ts +0 -73
  517. package/dist/services/ProjectMetadataStore.d.ts.map +1 -1
  518. package/dist/services/ProjectMetadataStore.js +0 -90
  519. package/dist/services/ProjectMetadataStore.js.map +1 -1
  520. package/dist/services/ProjectPackageManager.d.ts +0 -12
  521. package/dist/services/ProjectPackageManager.d.ts.map +1 -1
  522. package/dist/services/ProjectPackageManager.js +0 -16
  523. package/dist/services/ProjectPackageManager.js.map +1 -1
  524. package/dist/services/ProjectRegistry.d.ts +2 -18
  525. package/dist/services/ProjectRegistry.d.ts.map +1 -1
  526. package/dist/services/ProjectRegistry.js +0 -18
  527. package/dist/services/ProjectRegistry.js.map +1 -1
  528. package/dist/services/ProjectRuntimeService.d.ts +0 -4
  529. package/dist/services/ProjectRuntimeService.d.ts.map +1 -1
  530. package/dist/services/ProjectRuntimeService.js +0 -5
  531. package/dist/services/ProjectRuntimeService.js.map +1 -1
  532. package/dist/services/ProjectScreenshotService.d.ts +0 -5
  533. package/dist/services/ProjectScreenshotService.d.ts.map +1 -1
  534. package/dist/services/ProjectScreenshotService.js +0 -6
  535. package/dist/services/ProjectScreenshotService.js.map +1 -1
  536. package/dist/services/ProjectStorage.d.ts +0 -4
  537. package/dist/services/ProjectStorage.d.ts.map +1 -1
  538. package/dist/services/ProjectStorage.js +0 -4
  539. package/dist/services/ProjectStorage.js.map +1 -1
  540. package/dist/services/PrototypeBuildService.d.ts +1 -23
  541. package/dist/services/PrototypeBuildService.d.ts.map +1 -1
  542. package/dist/services/PrototypeBuildService.js +6 -31
  543. package/dist/services/PrototypeBuildService.js.map +1 -1
  544. package/dist/services/PrototypeDeployService.d.ts +0 -20
  545. package/dist/services/PrototypeDeployService.d.ts.map +1 -1
  546. package/dist/services/PrototypeDeployService.js +1 -24
  547. package/dist/services/PrototypeDeployService.js.map +1 -1
  548. package/dist/services/RequestAuthContext.d.ts +0 -5
  549. package/dist/services/RequestAuthContext.d.ts.map +1 -1
  550. package/dist/services/RequestAuthContext.js +0 -5
  551. package/dist/services/RequestAuthContext.js.map +1 -1
  552. package/dist/services/SessionBridgeService.d.ts.map +1 -1
  553. package/dist/services/SessionBridgeService.js +0 -2
  554. package/dist/services/SessionBridgeService.js.map +1 -1
  555. package/dist/services/SessionService.d.ts +0 -4
  556. package/dist/services/SessionService.d.ts.map +1 -1
  557. package/dist/services/SessionService.js +1 -22
  558. package/dist/services/SessionService.js.map +1 -1
  559. package/dist/services/StaticFileService.d.ts +0 -9
  560. package/dist/services/StaticFileService.d.ts.map +1 -1
  561. package/dist/services/StaticFileService.js +0 -11
  562. package/dist/services/StaticFileService.js.map +1 -1
  563. package/dist/services/StaticLibraryPreviews.d.ts +0 -3
  564. package/dist/services/StaticLibraryPreviews.d.ts.map +1 -1
  565. package/dist/services/StaticLibraryPreviews.js +0 -3
  566. package/dist/services/StaticLibraryPreviews.js.map +1 -1
  567. package/dist/services/StaticPreviewServer.d.ts +0 -16
  568. package/dist/services/StaticPreviewServer.d.ts.map +1 -1
  569. package/dist/services/StaticPreviewServer.js +2 -28
  570. package/dist/services/StaticPreviewServer.js.map +1 -1
  571. package/dist/services/SupabaseAuthService.d.ts +0 -11
  572. package/dist/services/SupabaseAuthService.d.ts.map +1 -1
  573. package/dist/services/SupabaseAuthService.js +0 -11
  574. package/dist/services/SupabaseAuthService.js.map +1 -1
  575. package/dist/services/SupportTicketService.d.ts +0 -4
  576. package/dist/services/SupportTicketService.d.ts.map +1 -1
  577. package/dist/services/SupportTicketService.js +0 -4
  578. package/dist/services/SupportTicketService.js.map +1 -1
  579. package/dist/services/TelemetryService.d.ts +9 -182
  580. package/dist/services/TelemetryService.d.ts.map +1 -1
  581. package/dist/services/TelemetryService.js +11 -195
  582. package/dist/services/TelemetryService.js.map +1 -1
  583. package/dist/services/TreeStore.d.ts +0 -72
  584. package/dist/services/TreeStore.d.ts.map +1 -1
  585. package/dist/services/TreeStore.js +0 -93
  586. package/dist/services/TreeStore.js.map +1 -1
  587. package/dist/services/VariantGenerationService.d.ts +1 -32
  588. package/dist/services/VariantGenerationService.d.ts.map +1 -1
  589. package/dist/services/VariantGenerationService.js +36 -66
  590. package/dist/services/VariantGenerationService.js.map +1 -1
  591. package/dist/services/VariantHistoryService.d.ts +12 -114
  592. package/dist/services/VariantHistoryService.d.ts.map +1 -1
  593. package/dist/services/VariantHistoryService.js +56 -144
  594. package/dist/services/VariantHistoryService.js.map +1 -1
  595. package/dist/services/VariantRunService.d.ts +6 -31
  596. package/dist/services/VariantRunService.d.ts.map +1 -1
  597. package/dist/services/VariantRunService.js +86 -37
  598. package/dist/services/VariantRunService.js.map +1 -1
  599. package/dist/services/VariantsRuntime.d.ts +0 -3
  600. package/dist/services/VariantsRuntime.d.ts.map +1 -1
  601. package/dist/services/VariantsRuntime.js +2 -5
  602. package/dist/services/VariantsRuntime.js.map +1 -1
  603. package/dist/services/WorktreeManager.d.ts +0 -217
  604. package/dist/services/WorktreeManager.d.ts.map +1 -1
  605. package/dist/services/WorktreeManager.js +3 -321
  606. package/dist/services/WorktreeManager.js.map +1 -1
  607. package/dist/services/accessTokenRefresh.d.ts +0 -25
  608. package/dist/services/accessTokenRefresh.d.ts.map +1 -1
  609. package/dist/services/accessTokenRefresh.js +0 -25
  610. package/dist/services/accessTokenRefresh.js.map +1 -1
  611. package/dist/services/adapters/TailwindTokenAdapter.d.ts +0 -29
  612. package/dist/services/adapters/TailwindTokenAdapter.d.ts.map +1 -1
  613. package/dist/services/adapters/TailwindTokenAdapter.js +1 -46
  614. package/dist/services/adapters/TailwindTokenAdapter.js.map +1 -1
  615. package/dist/services/createAgentVariantsOrchestrator.d.ts +0 -18
  616. package/dist/services/createAgentVariantsOrchestrator.d.ts.map +1 -1
  617. package/dist/services/createAgentVariantsOrchestrator.js +0 -22
  618. package/dist/services/createAgentVariantsOrchestrator.js.map +1 -1
  619. package/dist/services/extractors/CSSVariableExtractor.d.ts +0 -25
  620. package/dist/services/extractors/CSSVariableExtractor.d.ts.map +1 -1
  621. package/dist/services/extractors/CSSVariableExtractor.js +1 -42
  622. package/dist/services/extractors/CSSVariableExtractor.js.map +1 -1
  623. package/dist/services/historyRoots.d.ts +0 -12
  624. package/dist/services/historyRoots.d.ts.map +1 -1
  625. package/dist/services/historyRoots.js +0 -13
  626. package/dist/services/historyRoots.js.map +1 -1
  627. package/dist/services/libraryErrors.d.ts +0 -1
  628. package/dist/services/libraryErrors.d.ts.map +1 -1
  629. package/dist/services/libraryErrors.js +0 -1
  630. package/dist/services/libraryErrors.js.map +1 -1
  631. package/dist/services/pendingLogin.d.ts +0 -13
  632. package/dist/services/pendingLogin.d.ts.map +1 -1
  633. package/dist/services/pendingLogin.js +0 -3
  634. package/dist/services/pendingLogin.js.map +1 -1
  635. package/dist/services/profiles/DesignProfiles.d.ts +446 -0
  636. package/dist/services/profiles/DesignProfiles.d.ts.map +1 -0
  637. package/dist/services/profiles/DesignProfiles.js +552 -0
  638. package/dist/services/profiles/DesignProfiles.js.map +1 -0
  639. package/dist/services/profiles/MemoryModelService.d.ts +14 -0
  640. package/dist/services/profiles/MemoryModelService.d.ts.map +1 -0
  641. package/dist/services/profiles/MemoryModelService.js +113 -0
  642. package/dist/services/profiles/MemoryModelService.js.map +1 -0
  643. package/dist/services/profiles/MemoryRuntime.d.ts +26 -0
  644. package/dist/services/profiles/MemoryRuntime.d.ts.map +1 -0
  645. package/dist/services/profiles/MemoryRuntime.js +192 -0
  646. package/dist/services/profiles/MemoryRuntime.js.map +1 -0
  647. package/dist/services/profiles/ProfileAgent.d.ts +20 -0
  648. package/dist/services/profiles/ProfileAgent.d.ts.map +1 -0
  649. package/dist/services/profiles/ProfileAgent.js +196 -0
  650. package/dist/services/profiles/ProfileAgent.js.map +1 -0
  651. package/dist/services/profiles/ProfileAnalysis.d.ts +23 -0
  652. package/dist/services/profiles/ProfileAnalysis.d.ts.map +1 -0
  653. package/dist/services/profiles/ProfileAnalysis.js +114 -0
  654. package/dist/services/profiles/ProfileAnalysis.js.map +1 -0
  655. package/dist/services/profiles/ProfileImportSchedule.d.ts +15 -0
  656. package/dist/services/profiles/ProfileImportSchedule.d.ts.map +1 -0
  657. package/dist/services/profiles/ProfileImportSchedule.js +40 -0
  658. package/dist/services/profiles/ProfileImportSchedule.js.map +1 -0
  659. package/dist/services/profiles/ProfileImports.d.ts +47 -0
  660. package/dist/services/profiles/ProfileImports.d.ts.map +1 -0
  661. package/dist/services/profiles/ProfileImports.js +248 -0
  662. package/dist/services/profiles/ProfileImports.js.map +1 -0
  663. package/dist/services/profiles/ProfileIndex.d.ts +18 -0
  664. package/dist/services/profiles/ProfileIndex.d.ts.map +1 -0
  665. package/dist/services/profiles/ProfileIndex.js +119 -0
  666. package/dist/services/profiles/ProfileIndex.js.map +1 -0
  667. package/dist/services/profiles/ProfileMedia.d.ts +10 -0
  668. package/dist/services/profiles/ProfileMedia.d.ts.map +1 -0
  669. package/dist/services/profiles/ProfileMedia.js +76 -0
  670. package/dist/services/profiles/ProfileMedia.js.map +1 -0
  671. package/dist/services/profiles/ProfilePreparation.d.ts +17 -0
  672. package/dist/services/profiles/ProfilePreparation.d.ts.map +1 -0
  673. package/dist/services/profiles/ProfilePreparation.js +214 -0
  674. package/dist/services/profiles/ProfilePreparation.js.map +1 -0
  675. package/dist/services/profiles/ProfileVariants.d.ts +33 -0
  676. package/dist/services/profiles/ProfileVariants.d.ts.map +1 -0
  677. package/dist/services/profiles/ProfileVariants.js +129 -0
  678. package/dist/services/profiles/ProfileVariants.js.map +1 -0
  679. package/dist/services/profiles/analysisBatch.d.ts +53 -0
  680. package/dist/services/profiles/analysisBatch.d.ts.map +1 -0
  681. package/dist/services/profiles/analysisBatch.js +86 -0
  682. package/dist/services/profiles/analysisBatch.js.map +1 -0
  683. package/dist/services/profiles/boardPage.d.ts +12 -0
  684. package/dist/services/profiles/boardPage.d.ts.map +1 -0
  685. package/dist/services/profiles/boardPage.js +156 -0
  686. package/dist/services/profiles/boardPage.js.map +1 -0
  687. package/dist/services/profiles/engineAccess.d.ts +2 -0
  688. package/dist/services/profiles/engineAccess.d.ts.map +1 -0
  689. package/dist/services/profiles/engineAccess.js +55 -0
  690. package/dist/services/profiles/engineAccess.js.map +1 -0
  691. package/dist/services/profiles/memoryComponents.d.ts +7 -0
  692. package/dist/services/profiles/memoryComponents.d.ts.map +1 -0
  693. package/dist/services/profiles/memoryComponents.js +105 -0
  694. package/dist/services/profiles/memoryComponents.js.map +1 -0
  695. package/dist/services/profiles/modelContract.d.ts +14 -0
  696. package/dist/services/profiles/modelContract.d.ts.map +1 -0
  697. package/dist/services/profiles/modelContract.js +124 -0
  698. package/dist/services/profiles/modelContract.js.map +1 -0
  699. package/dist/services/profiles/nativeImages.d.ts +3 -0
  700. package/dist/services/profiles/nativeImages.d.ts.map +1 -0
  701. package/dist/services/profiles/nativeImages.js +72 -0
  702. package/dist/services/profiles/nativeImages.js.map +1 -0
  703. package/dist/services/profiles/profileAccount.d.ts +4 -0
  704. package/dist/services/profiles/profileAccount.d.ts.map +1 -0
  705. package/dist/services/profiles/profileAccount.js +21 -0
  706. package/dist/services/profiles/profileAccount.js.map +1 -0
  707. package/dist/services/profiles/profileContext.d.ts +18 -0
  708. package/dist/services/profiles/profileContext.d.ts.map +1 -0
  709. package/dist/services/profiles/profileContext.js +189 -0
  710. package/dist/services/profiles/profileContext.js.map +1 -0
  711. package/dist/services/profiles/profileEvidence.d.ts +3 -0
  712. package/dist/services/profiles/profileEvidence.d.ts.map +1 -0
  713. package/dist/services/profiles/profileEvidence.js +15 -0
  714. package/dist/services/profiles/profileEvidence.js.map +1 -0
  715. package/dist/services/profiles/profileQueries.d.ts +2 -0
  716. package/dist/services/profiles/profileQueries.d.ts.map +1 -0
  717. package/dist/services/profiles/profileQueries.js +23 -0
  718. package/dist/services/profiles/profileQueries.js.map +1 -0
  719. package/dist/services/profiles/profileSelection.d.ts +29 -0
  720. package/dist/services/profiles/profileSelection.d.ts.map +1 -0
  721. package/dist/services/profiles/profileSelection.js +43 -0
  722. package/dist/services/profiles/profileSelection.js.map +1 -0
  723. package/dist/services/profiles/xPage.d.ts +4 -0
  724. package/dist/services/profiles/xPage.d.ts.map +1 -0
  725. package/dist/services/profiles/xPage.js +58 -0
  726. package/dist/services/profiles/xPage.js.map +1 -0
  727. package/dist/services/referenceImages.d.ts +17 -0
  728. package/dist/services/referenceImages.d.ts.map +1 -0
  729. package/dist/services/referenceImages.js +138 -0
  730. package/dist/services/referenceImages.js.map +1 -0
  731. package/dist/services/staticProjectTarget.d.ts +0 -4
  732. package/dist/services/staticProjectTarget.d.ts.map +1 -1
  733. package/dist/services/staticProjectTarget.js +0 -4
  734. package/dist/services/staticProjectTarget.js.map +1 -1
  735. package/dist/services/staticStarter.d.ts +0 -20
  736. package/dist/services/staticStarter.d.ts.map +1 -1
  737. package/dist/services/staticStarter.js +0 -20
  738. package/dist/services/staticStarter.js.map +1 -1
  739. package/dist/services/templates/designCatalog.d.ts +0 -11
  740. package/dist/services/templates/designCatalog.d.ts.map +1 -1
  741. package/dist/services/templates/designCatalog.js +0 -26
  742. package/dist/services/templates/designCatalog.js.map +1 -1
  743. package/dist/services/templates/viteReactTs.d.ts +0 -26
  744. package/dist/services/templates/viteReactTs.d.ts.map +1 -1
  745. package/dist/services/templates/viteReactTs.js +0 -20
  746. package/dist/services/templates/viteReactTs.js.map +1 -1
  747. package/dist/storage/library/BundleMetadataStore.d.ts +0 -16
  748. package/dist/storage/library/BundleMetadataStore.d.ts.map +1 -1
  749. package/dist/storage/library/BundleMetadataStore.js +0 -17
  750. package/dist/storage/library/BundleMetadataStore.js.map +1 -1
  751. package/dist/storage/library/CoordinatorRecords.d.ts +0 -9
  752. package/dist/storage/library/CoordinatorRecords.d.ts.map +1 -1
  753. package/dist/storage/library/CoordinatorRecords.js +0 -9
  754. package/dist/storage/library/CoordinatorRecords.js.map +1 -1
  755. package/dist/storage/library/ProjectPreviewCache.d.ts +0 -4
  756. package/dist/storage/library/ProjectPreviewCache.d.ts.map +1 -1
  757. package/dist/storage/library/ProjectPreviewCache.js +0 -4
  758. package/dist/storage/library/ProjectPreviewCache.js.map +1 -1
  759. package/dist/storage/library/ProjectRecords.d.ts +0 -17
  760. package/dist/storage/library/ProjectRecords.d.ts.map +1 -1
  761. package/dist/storage/library/ProjectRecords.js +0 -17
  762. package/dist/storage/library/ProjectRecords.js.map +1 -1
  763. package/dist/storage/library/database.d.ts +0 -3
  764. package/dist/storage/library/database.d.ts.map +1 -1
  765. package/dist/storage/library/database.js +0 -3
  766. package/dist/storage/library/database.js.map +1 -1
  767. package/dist/storage/library/migrations.d.ts +0 -2
  768. package/dist/storage/library/migrations.d.ts.map +1 -1
  769. package/dist/storage/library/migrations.js +0 -2
  770. package/dist/storage/library/migrations.js.map +1 -1
  771. package/dist/storage/library/sourcePresentation.d.ts +0 -1
  772. package/dist/storage/library/sourcePresentation.d.ts.map +1 -1
  773. package/dist/storage/library/sourcePresentation.js +0 -1
  774. package/dist/storage/library/sourcePresentation.js.map +1 -1
  775. package/dist/storage/profiles/ProfileRecords.d.ts +199 -0
  776. package/dist/storage/profiles/ProfileRecords.d.ts.map +1 -0
  777. package/dist/storage/profiles/ProfileRecords.js +659 -0
  778. package/dist/storage/profiles/ProfileRecords.js.map +1 -0
  779. package/dist/storage/profiles/contextReceipts.d.ts +14 -0
  780. package/dist/storage/profiles/contextReceipts.d.ts.map +1 -0
  781. package/dist/storage/profiles/contextReceipts.js +52 -0
  782. package/dist/storage/profiles/contextReceipts.js.map +1 -0
  783. package/dist/storage/profiles/migrations.d.ts +4 -0
  784. package/dist/storage/profiles/migrations.d.ts.map +1 -0
  785. package/dist/storage/profiles/migrations.js +41 -0
  786. package/dist/storage/profiles/migrations.js.map +1 -0
  787. package/dist/storage/profiles/schema.d.ts +961 -0
  788. package/dist/storage/profiles/schema.d.ts.map +1 -0
  789. package/dist/storage/profiles/schema.js +102 -0
  790. package/dist/storage/profiles/schema.js.map +1 -0
  791. package/dist/storage/project-metadata/ProjectMetadataRecords.d.ts +0 -11
  792. package/dist/storage/project-metadata/ProjectMetadataRecords.d.ts.map +1 -1
  793. package/dist/storage/project-metadata/ProjectMetadataRecords.js +0 -13
  794. package/dist/storage/project-metadata/ProjectMetadataRecords.js.map +1 -1
  795. package/dist/storage/project-metadata/database.d.ts +0 -1
  796. package/dist/storage/project-metadata/database.d.ts.map +1 -1
  797. package/dist/storage/project-metadata/database.js +0 -7
  798. package/dist/storage/project-metadata/database.js.map +1 -1
  799. package/dist/storage/project-metadata/migrations.d.ts +0 -42
  800. package/dist/storage/project-metadata/migrations.d.ts.map +1 -1
  801. package/dist/storage/project-metadata/migrations.js +0 -41
  802. package/dist/storage/project-metadata/migrations.js.map +1 -1
  803. package/dist/types/account.d.ts +0 -1
  804. package/dist/types/account.d.ts.map +1 -1
  805. package/dist/types/change-request-types.d.ts +5 -167
  806. package/dist/types/change-request-types.d.ts.map +1 -1
  807. package/dist/types/change-types.d.ts +0 -1
  808. package/dist/types/change-types.d.ts.map +1 -1
  809. package/dist/types/change-types.js +0 -1
  810. package/dist/types/change-types.js.map +1 -1
  811. package/dist/types/design-profile.d.ts +570 -0
  812. package/dist/types/design-profile.d.ts.map +1 -0
  813. package/dist/types/design-profile.js +127 -0
  814. package/dist/types/design-profile.js.map +1 -0
  815. package/dist/types/project-library.d.ts +0 -1
  816. package/dist/types/project-library.d.ts.map +1 -1
  817. package/dist/types/style-manipulation-types.d.ts +0 -69
  818. package/dist/types/style-manipulation-types.d.ts.map +1 -1
  819. package/dist/types/style-manipulation-types.js +0 -26
  820. package/dist/types/style-manipulation-types.js.map +1 -1
  821. package/dist/types/token-types.d.ts +0 -30
  822. package/dist/types/token-types.d.ts.map +1 -1
  823. package/dist/types/token-types.js +0 -1
  824. package/dist/types/token-types.js.map +1 -1
  825. package/dist/types/variant-history.d.ts +3 -39
  826. package/dist/types/variant-history.d.ts.map +1 -1
  827. package/dist/types/variant-reference.d.ts +46 -0
  828. package/dist/types/variant-reference.d.ts.map +1 -0
  829. package/dist/types/variant-reference.js +58 -0
  830. package/dist/types/variant-reference.js.map +1 -0
  831. package/dist/types/x-bookmarks.d.ts +352 -0
  832. package/dist/types/x-bookmarks.d.ts.map +1 -0
  833. package/dist/types/x-bookmarks.js +56 -0
  834. package/dist/types/x-bookmarks.js.map +1 -0
  835. package/dist/utils/ProviderRateLimit.d.ts +7 -0
  836. package/dist/utils/ProviderRateLimit.d.ts.map +1 -0
  837. package/dist/utils/ProviderRateLimit.js +36 -0
  838. package/dist/utils/ProviderRateLimit.js.map +1 -0
  839. package/dist/utils/branchNames.d.ts +0 -1
  840. package/dist/utils/branchNames.d.ts.map +1 -1
  841. package/dist/utils/branchNames.js +0 -2
  842. package/dist/utils/branchNames.js.map +1 -1
  843. package/dist/utils/cloneOrCopyDirSync.d.ts +0 -12
  844. package/dist/utils/cloneOrCopyDirSync.d.ts.map +1 -1
  845. package/dist/utils/cloneOrCopyDirSync.js +0 -16
  846. package/dist/utils/cloneOrCopyDirSync.js.map +1 -1
  847. package/dist/utils/devServerCommand.d.ts +0 -23
  848. package/dist/utils/devServerCommand.d.ts.map +1 -1
  849. package/dist/utils/devServerCommand.js +0 -24
  850. package/dist/utils/devServerCommand.js.map +1 -1
  851. package/dist/utils/devServerError.d.ts +0 -16
  852. package/dist/utils/devServerError.d.ts.map +1 -1
  853. package/dist/utils/devServerError.js +0 -17
  854. package/dist/utils/devServerError.js.map +1 -1
  855. package/dist/utils/displayLocale.d.ts +0 -2
  856. package/dist/utils/displayLocale.d.ts.map +1 -1
  857. package/dist/utils/displayLocale.js +0 -2
  858. package/dist/utils/displayLocale.js.map +1 -1
  859. package/dist/utils/elementFileHintSignals.d.ts +0 -5
  860. package/dist/utils/elementFileHintSignals.d.ts.map +1 -1
  861. package/dist/utils/elementFileHintSignals.js +0 -5
  862. package/dist/utils/elementFileHintSignals.js.map +1 -1
  863. package/dist/utils/formatElementTargetingContext.d.ts +0 -6
  864. package/dist/utils/formatElementTargetingContext.d.ts.map +1 -1
  865. package/dist/utils/formatElementTargetingContext.js +3 -9
  866. package/dist/utils/formatElementTargetingContext.js.map +1 -1
  867. package/dist/utils/hostAgentEnv.d.ts +0 -17
  868. package/dist/utils/hostAgentEnv.d.ts.map +1 -1
  869. package/dist/utils/hostAgentEnv.js +0 -17
  870. package/dist/utils/hostAgentEnv.js.map +1 -1
  871. package/dist/utils/htmlDocument.d.ts +0 -5
  872. package/dist/utils/htmlDocument.d.ts.map +1 -1
  873. package/dist/utils/htmlDocument.js +2 -7
  874. package/dist/utils/htmlDocument.js.map +1 -1
  875. package/dist/utils/internalGitIdentity.d.ts +0 -5
  876. package/dist/utils/internalGitIdentity.d.ts.map +1 -1
  877. package/dist/utils/internalGitIdentity.js +0 -5
  878. package/dist/utils/internalGitIdentity.js.map +1 -1
  879. package/dist/utils/logger.d.ts +0 -5
  880. package/dist/utils/logger.d.ts.map +1 -1
  881. package/dist/utils/logger.js +2 -19
  882. package/dist/utils/logger.js.map +1 -1
  883. package/dist/utils/loginShellPath.d.ts +0 -9
  884. package/dist/utils/loginShellPath.d.ts.map +1 -1
  885. package/dist/utils/loginShellPath.js +0 -69
  886. package/dist/utils/loginShellPath.js.map +1 -1
  887. package/dist/utils/loopback.d.ts +0 -1
  888. package/dist/utils/loopback.d.ts.map +1 -1
  889. package/dist/utils/loopback.js +0 -1
  890. package/dist/utils/loopback.js.map +1 -1
  891. package/dist/utils/pid.d.ts +0 -1
  892. package/dist/utils/pid.d.ts.map +1 -1
  893. package/dist/utils/pid.js +0 -1
  894. package/dist/utils/pid.js.map +1 -1
  895. package/dist/utils/portUtils.d.ts +0 -15
  896. package/dist/utils/portUtils.d.ts.map +1 -1
  897. package/dist/utils/portUtils.js +0 -21
  898. package/dist/utils/portUtils.js.map +1 -1
  899. package/dist/utils/queueAccess.d.ts +0 -9
  900. package/dist/utils/queueAccess.d.ts.map +1 -1
  901. package/dist/utils/queueAccess.js +0 -9
  902. package/dist/utils/queueAccess.js.map +1 -1
  903. package/dist/utils/skillWriter.d.ts +0 -17
  904. package/dist/utils/skillWriter.d.ts.map +1 -1
  905. package/dist/utils/skillWriter.js +0 -20
  906. package/dist/utils/skillWriter.js.map +1 -1
  907. package/dist/utils/skills/claude-skill.d.ts +0 -5
  908. package/dist/utils/skills/claude-skill.d.ts.map +1 -1
  909. package/dist/utils/skills/claude-skill.js +0 -5
  910. package/dist/utils/skills/claude-skill.js.map +1 -1
  911. package/dist/utils/skills/cli-guidance.d.ts +1 -9
  912. package/dist/utils/skills/cli-guidance.d.ts.map +1 -1
  913. package/dist/utils/skills/cli-guidance.js +6 -10
  914. package/dist/utils/skills/cli-guidance.js.map +1 -1
  915. package/dist/utils/skills/cursor-rules.d.ts +0 -6
  916. package/dist/utils/skills/cursor-rules.d.ts.map +1 -1
  917. package/dist/utils/skills/cursor-rules.js +0 -6
  918. package/dist/utils/skills/cursor-rules.js.map +1 -1
  919. package/dist/utils/variantPreviewPort.d.ts +0 -3
  920. package/dist/utils/variantPreviewPort.d.ts.map +1 -1
  921. package/dist/utils/variantPreviewPort.js +0 -3
  922. package/dist/utils/variantPreviewPort.js.map +1 -1
  923. package/dist/utils/windowPlacement.d.ts +0 -4
  924. package/dist/utils/windowPlacement.d.ts.map +1 -1
  925. package/dist/utils/windowPlacement.js +0 -4
  926. package/dist/utils/windowPlacement.js.map +1 -1
  927. package/package.json +13 -13
  928. package/scripts/verify-node-version.cjs +0 -3
  929. package/src/ui/dist/assets/{LibraryApp-qbLqcNxM.js → LibraryApp-Bu7hVbt_.js} +1 -1
  930. package/src/ui/dist/assets/main-CHyx_rEa.css +1 -0
  931. package/src/ui/dist/assets/main-CuiPb_rl.js +438 -0
  932. package/src/ui/dist/index.html +2 -2
  933. package/dist/utils/skills/describe-motion-protocol.d.ts +0 -10
  934. package/dist/utils/skills/describe-motion-protocol.d.ts.map +0 -1
  935. package/dist/utils/skills/describe-motion-protocol.js +0 -231
  936. package/dist/utils/skills/describe-motion-protocol.js.map +0 -1
  937. package/src/ui/dist/assets/main-BUZjlAHd.css +0 -1
  938. package/src/ui/dist/assets/main-touv07Dk.js +0 -438
@@ -1,15 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SessionStore = exports.buildImageRefs = exports.SOURCE_PLAN_ACTION_OPTIONS = exports.SOURCE_PLAN_OUTPUT_SCHEMA = exports.SCAFFOLD_LEASE_TTL_MS = exports.DEFAULT_LEASE_TTL_MS = void 0;
4
+ const variant_reference_1 = require("../types/variant-reference");
4
5
  const crypto_1 = require("crypto");
5
6
  const errors_1 = require("./errors");
6
7
  const contracts_1 = require("./contracts");
7
8
  const briefContent_1 = require("./briefContent");
8
9
  const runLabel_1 = require("./runLabel");
9
10
  const runPlan_1 = require("./runPlan");
10
- /** The variant card subtitle must stay ≤ 10 words (matches the UI's
11
- * summarizeVariantSubtitle). briefBody can be longer because it also feeds
12
- * code_gen, so cap only the UI-facing description copy sent over the wire. */
13
11
  const MAX_SUBTITLE_WORDS = 10;
14
12
  const MAX_RELEVANT_FILES = 12;
15
13
  const capSubtitleWords = (text) => {
@@ -19,25 +17,12 @@ const capSubtitleWords = (text) => {
19
17
  : `${words.slice(0, MAX_SUBTITLE_WORDS).join(' ')}…`;
20
18
  };
21
19
  const mergeRelevantFiles = (...groups) => Array.from(new Set(groups.flatMap((group) => group ?? []).filter(Boolean))).slice(0, MAX_RELEVANT_FILES);
22
- /** TTL for a lease on a code_gen work item. Bumped to 20min after a timing
23
- * audit found first-variant single-round code-gen routinely runs 540–950s
24
- * (4+ Task sub-agents in parallel), so the previous 10min cap was the most
25
- * frequently binding lease and caused recoverable LEASE_EXPIRED churn. The
26
- * recovery path (re-lease + re-report) works, but the re-lease delay before
27
- * the chip's pills lit up was noticeable. */
28
20
  exports.DEFAULT_LEASE_TTL_MS = 20 * 60 * 1000;
29
- /** TTL for a lease on a scaffold_base work item. Longer than code_gen because
30
- * npm/yarn create can be slow on a cold cache. Raised to 30min alongside the
31
- * code_gen bump; scaffold timing has never bound, but a longer lease is safe. */
32
21
  exports.SCAFFOLD_LEASE_TTL_MS = 30 * 60 * 1000;
33
22
  const SYSTEM_CLOCK = { now: () => Date.now() };
34
- /** True when a work item is a past variant adopted into the active session
35
- * (see {@link SessionStore.appendAdoptedStaticVariant}). Adopted variants are
36
- * surfaced as session members but excluded from generation accounting. */
37
23
  function isAdoptedVariant(item) {
38
24
  return Boolean(item.input.adoptedFrom);
39
25
  }
40
- /** True when a static preview is a Vary sibling forked from another variant. */
41
26
  function isForkedStaticPreviewVariant(item) {
42
27
  return (item.kind === 'static_preview' &&
43
28
  Boolean(item.input.sourceVariantId));
@@ -50,7 +35,6 @@ function leaseTtlForKind(kind) {
50
35
  ? exports.SCAFFOLD_LEASE_TTL_MS
51
36
  : exports.DEFAULT_LEASE_TTL_MS;
52
37
  }
53
- /** Describes the work item contract returned to an agent lease holder. */
54
38
  function descriptorFor(item) {
55
39
  return {
56
40
  id: item.id,
@@ -83,7 +67,6 @@ exports.SOURCE_PLAN_ACTION_OPTIONS = [
83
67
  instructions: 'Inspect interaction references natively and use the Rivet Describe Motion protocol to produce motion_guidance metadata.',
84
68
  },
85
69
  ];
86
- /** Returns the completion payload shape required for each leased work item. */
87
70
  function outputSchemaFor(kind) {
88
71
  switch (kind) {
89
72
  case 'source_plan':
@@ -147,19 +130,10 @@ const briefWorkItemContext = (projectContext) => {
147
130
  },
148
131
  };
149
132
  };
150
- // Source-artifact kinds that represent agent-described attached images.
151
- // These need their own DESIGN.md slot in the source_plan output, alongside
152
- // any URL-keyed entries. `siteBrief` / `urlText` are pasted text — they
153
- // feed SOURCE_CONTEXT only and do NOT get a DESIGN.md.
154
133
  const IMAGE_ARTIFACT_KINDS = new Set([
155
134
  'visualBrief',
156
135
  'screenshotNotes',
157
136
  ]);
158
- /**
159
- * Stable per-session ref for image-derived design sources. Indexed over the
160
- * filtered list of image-kind artifacts so the ref survives reordering of
161
- * text-only artifacts in the same `sourceArtifacts` array.
162
- */
163
137
  const buildImageRefs = (artifacts) => {
164
138
  if (!artifacts)
165
139
  return [];
@@ -172,12 +146,6 @@ const buildImageRefs = (artifacts) => {
172
146
  return refs;
173
147
  };
174
148
  exports.buildImageRefs = buildImageRefs;
175
- /**
176
- * Source-grounded fresh sessions require a single `source_plan` planning hop
177
- * before briefs. The hop fires when Rivet has captured a read-only user
178
- * context bundle (the sole source-intake surface). The source-plan agent
179
- * inspects raw context and reports actions plus metadata.
180
- */
181
149
  const requiresSourcePlan = (projectContext) => projectContext.kind === 'fresh' && Boolean(projectContext.variantContext);
182
150
  const listSection = (title, items) => {
183
151
  if (items.length === 0)
@@ -185,9 +153,6 @@ const listSection = (title, items) => {
185
153
  return [`## ${title}`, '', ...items.map((item) => `- ${item}`), ''];
186
154
  };
187
155
  const hasSharedSource = (sourceIds, candidateSourceIds) => candidateSourceIds.some((sourceId) => sourceIds.includes(sourceId));
188
- /**
189
- * Formats motion metadata that applies to the same raw sources as the design metadata.
190
- */
191
156
  const buildMotionGuidanceMarkdown = (sourceIds, metadata) => {
192
157
  const matchingMotion = metadata.filter((entry) => entry.kind === 'motion_guidance' &&
193
158
  hasSharedSource(sourceIds, entry.sourceIds));
@@ -208,9 +173,6 @@ const buildMotionGuidanceMarkdown = (sourceIds, metadata) => {
208
173
  }
209
174
  return lines;
210
175
  };
211
- /**
212
- * Converts design-system metadata into the markdown artifact variant agents consume.
213
- */
214
176
  const buildDesignMarkdownFromMetadata = (entry, metadata) => {
215
177
  if (entry.data.designMarkdown) {
216
178
  return entry.data.designMarkdown;
@@ -231,9 +193,6 @@ const buildDesignMarkdownFromMetadata = (entry, metadata) => {
231
193
  ];
232
194
  return `${lines.join('\n').trim()}\n`;
233
195
  };
234
- /**
235
- * Builds design-context entries from action metadata when the report does not provide them directly.
236
- */
237
196
  const designContextsFromActionMetadata = (metadata) => {
238
197
  if (!metadata)
239
198
  return [];
@@ -273,25 +232,13 @@ const METADATA_KIND_BY_ACTION_KIND = {
273
232
  extract_design_system: 'design_system',
274
233
  describe_motion: 'motion_guidance',
275
234
  };
276
- /**
277
- * Validates the reported source plan's action/metadata invariants:
278
- * - metadata is produced BY actions, so metadata reported with zero actions
279
- * is rejected (it would otherwise build DESIGN.md from an orphaned payload);
280
- * - every metadata entry references real raw-context sources;
281
- * - every reported action produces the metadata kind it claims to.
282
- */
283
235
  const validateActionMetadataOutputs = (args) => {
284
236
  const actions = args.sourcePlan.actions;
285
237
  const metadata = args.sourcePlan.metadata;
286
- // Metadata is produced BY actions. A plan that reports metadata with no
287
- // actions has nothing to produce it — reject rather than silently building
288
- // design context from an orphaned, otherwise-unvalidated payload.
289
238
  if (actions.length === 0 && metadata.length > 0) {
290
239
  throw new errors_1.AgentVariantsError('SOURCE_CONTEXT_INVALID', 'source_plan reported metadata without any actions; metadata must be produced by a reported action');
291
240
  }
292
241
  const sourceIds = new Set(args.bundle?.userContext.map((source) => source.id) ?? []);
293
- // Validate metadata sourceIds independently of `actions` so an empty action
294
- // list can never skip the check wholesale.
295
242
  for (const entry of metadata) {
296
243
  const unknownSourceIds = entry.sourceIds.filter((sourceId) => sourceIds.size > 0 && !sourceIds.has(sourceId));
297
244
  if (unknownSourceIds.length > 0) {
@@ -366,6 +313,7 @@ const resolveVariantWorkItemContext = (args) => {
366
313
  contextBundlePath: args.bundle.contextBundlePath,
367
314
  userContext,
368
315
  rivetMetadata,
316
+ references: (0, variant_reference_1.mergeVariantReferences)(...userContext.map((source) => 'references' in source ? source.references : undefined)),
369
317
  ...(args.bundle.contextAssets?.length
370
318
  ? { contextAssets: args.bundle.contextAssets }
371
319
  : {}),
@@ -382,7 +330,6 @@ class SessionStore {
382
330
  constructor(clock = SYSTEM_CLOCK) {
383
331
  this.clock = clock;
384
332
  }
385
- // --- Lifecycle ----------------------------------------------------------
386
333
  propose(args) {
387
334
  const sessionId = args.sessionId ?? (0, crypto_1.randomUUID)();
388
335
  if (this.sessions.has(sessionId)) {
@@ -457,8 +404,6 @@ class SessionStore {
457
404
  }
458
405
  reportBriefs(args) {
459
406
  const session = this.requireSession(args.sessionId);
460
- // Idempotent replay: accept regardless of current stage so retries after a
461
- // stage advance still return the same response without mutating state.
462
407
  const fp = fingerprint([
463
408
  'reportBriefs',
464
409
  args.sessionId,
@@ -522,8 +467,6 @@ class SessionStore {
522
467
  }
523
468
  this.validatePlanningReport(item, args.leaseId, args.attempt);
524
469
  const { executionPlan, actions, metadata, bindings } = args.sourcePlan;
525
- // Canonical path: every reported action must produce its matching metadata
526
- // kind, and action sourceIds must reference real raw-context sources.
527
470
  validateActionMetadataOutputs({
528
471
  bundle: session.projectContext.kind === 'fresh'
529
472
  ? session.projectContext.variantContext
@@ -531,13 +474,6 @@ class SessionStore {
531
474
  sourcePlan: args.sourcePlan,
532
475
  });
533
476
  if (session.projectContext.kind === 'fresh') {
534
- // Derive DESIGN.md context directly from `design_system` action
535
- // metadata. Each entry uses explicit `designMarkdown` when present, or
536
- // is synthesized from the structured observations. Brief fan-out
537
- // (provisionFreshWorktrees) reads slot [min(briefIndex, length-1)] with
538
- // a slot-0 fallback, so a single design system ships one shared markdown
539
- // while multiple design systems land on deterministic slots in report
540
- // order.
541
477
  const projectDesignContexts = designContextsFromActionMetadata(metadata);
542
478
  session.projectContext = {
543
479
  ...session.projectContext,
@@ -603,25 +539,12 @@ class SessionStore {
603
539
  const executionPlan = session.projectContext.kind === 'fresh'
604
540
  ? session.projectContext.executionPlan
605
541
  : undefined;
606
- // Surface an agent-flagged clarification as a hard blocker rather than
607
- // silently downgrading to a static preview. The agent sets
608
- // `userQuestion` when it cannot decide between static_preview and
609
- // vite_app without more info from the user.
610
542
  if (executionPlan?.userQuestion) {
611
543
  throw new errors_1.AgentVariantsError('MISSING_REQUIRED_INPUT', executionPlan.userQuestion);
612
544
  }
613
- // Resolve the canonical run plan once. The topology decision below (and
614
- // the orchestrator's provision/commit decisions later) read off this
615
- // single source of truth rather than re-deriving from `kind` /
616
- // `executionPlan.mode`. Fresh sessions default to static_preview when no
617
- // plan was reported (source-less zero-to-one); source-grounded sessions
618
- // carry an executionPlan from `report_source_plan`.
619
545
  const policy = (0, runPlan_1.resolveRunPlanPolicy)(session.projectContext);
620
546
  const wantsStaticPreview = policy.topology === 'static_preview';
621
547
  const codeGenIds = [];
622
- // For generated Vite apps, code_gen items depend on a single scaffold_base
623
- // item so the orchestrator can do the Vite skeleton + npm install + asset
624
- // copy before the agent leases the code_gen.
625
548
  let scaffoldBaseId;
626
549
  if (policy.needsScaffoldBase) {
627
550
  scaffoldBaseId = (0, crypto_1.randomUUID)();
@@ -643,15 +566,10 @@ class SessionStore {
643
566
  if (briefIndex === -1)
644
567
  return;
645
568
  const brief = session.briefs[briefIndex];
646
- // D-VR2: Plumb the optional per-brief visualReferenceUrl into the
647
- // resulting work-item input. Omitted (not nulled) when absent so the
648
- // shape stays backward-compatible for callers that destructure.
649
569
  const visualRef = brief.visualReferenceUrl
650
570
  ? { visualReferenceUrl: brief.visualReferenceUrl }
651
571
  : {};
652
572
  const context = resolveVariantWorkItemContext({
653
- // Existing-project sessions also carry a server-owned context bundle
654
- // (no source_plan stage), so thread it for both kinds.
655
573
  bundle: session.projectContext.variantContext,
656
574
  projectContext: session.projectContext,
657
575
  brief,
@@ -664,8 +582,6 @@ class SessionStore {
664
582
  ? freshDesignContext[Math.min(briefIndex, freshDesignContext.length - 1)]
665
583
  : undefined;
666
584
  if (wantsStaticPreview) {
667
- // Generated + static_preview: HTML is the deliverable. No scaffold or
668
- // code_gen — the static_preview item is leased directly.
669
585
  const staticPreviewItem = {
670
586
  id: (0, crypto_1.randomUUID)(),
671
587
  kind: 'static_preview',
@@ -685,7 +601,7 @@ class SessionStore {
685
601
  ...(session.fidelity ? { fidelity: session.fidelity } : {}),
686
602
  projectContext: session.projectContext,
687
603
  ...(designContextEntry ? { designContextEntry } : {}),
688
- ...(context ? { context } : {}),
604
+ ...(context ? { context, references: context.references } : {}),
689
605
  },
690
606
  acceptedReports: [],
691
607
  };
@@ -693,15 +609,6 @@ class SessionStore {
693
609
  session.workItemOrder.push(staticPreviewItem.id);
694
610
  }
695
611
  else {
696
- // Existing project OR fresh+vite_app: code_gen against a worktree.
697
- // Fresh+vite_app additionally depends on scaffold_base so the agent
698
- // doesn't lease code_gen before the Vite skeleton lands.
699
- //
700
- // Per-slot designContextEntry is read by provisionFreshWorktrees to
701
- // decide what DESIGN.md to write per variant. Falls back to slot 0
702
- // when the session has fewer designContext entries than variants
703
- // (the common case after report_source_plan ships one shared
704
- // markdown).
705
612
  const codeGenItem = {
706
613
  id: (0, crypto_1.randomUUID)(),
707
614
  kind: 'code_gen',
@@ -722,7 +629,7 @@ class SessionStore {
722
629
  ...(session.fidelity ? { fidelity: session.fidelity } : {}),
723
630
  projectContext: session.projectContext,
724
631
  ...(designContextEntry ? { designContextEntry } : {}),
725
- ...(context ? { context } : {}),
632
+ ...(context ? { context, references: context.references } : {}),
726
633
  },
727
634
  acceptedReports: [],
728
635
  };
@@ -739,7 +646,6 @@ class SessionStore {
739
646
  scaffoldBaseWorkItemId: scaffoldBaseId,
740
647
  };
741
648
  }
742
- // --- Lease management ---------------------------------------------------
743
649
  requestWork(args) {
744
650
  const session = this.requireSession(args.sessionId);
745
651
  this.assertStage(session, [
@@ -749,9 +655,6 @@ class SessionStore {
749
655
  ]);
750
656
  this.expireStaleLeases(session);
751
657
  let leasable = this.leasableItems(session);
752
- // Targeted lease: restrict to a single named item so callers that just
753
- // enqueued a specific work item (e.g. refineVariant) can't accidentally
754
- // lease an unrelated leasable item that happens to sort earlier.
755
658
  if (args.workItemId !== undefined) {
756
659
  const target = leasable.find((item) => item.id === args.workItemId);
757
660
  if (!target) {
@@ -760,19 +663,12 @@ class SessionStore {
760
663
  leasable = [target];
761
664
  }
762
665
  else if (args.workItemIds !== undefined) {
763
- // Scoped lease: restrict to a specific batch's work items so concurrent
764
- // owners (e.g. several watchers each handling their own Vary run) don't
765
- // greedily lease each other's items. Leases whatever subset of the
766
- // requested ids is still leasable; only errors if NONE are.
767
666
  const wanted = new Set(args.workItemIds);
768
667
  leasable = leasable.filter((item) => wanted.has(item.id));
769
668
  if (leasable.length === 0) {
770
669
  throw new errors_1.AgentVariantsError('INVALID_STAGE_ACTION', 'None of the requested work items are currently leasable (already leased, running, or done)');
771
670
  }
772
671
  }
773
- // `workItemIds` takes precedence over `requestedLeaseCount`: a scoped batch
774
- // leases ALL of its still-leasable items, not a count-capped subset (the
775
- // scoping above already narrowed `leasable` to exactly that batch).
776
672
  const limit = args.workItemIds !== undefined
777
673
  ? leasable.length
778
674
  : (args.requestedLeaseCount ?? leasable.length);
@@ -806,15 +702,6 @@ class SessionStore {
806
702
  }
807
703
  reportComplete(args) {
808
704
  const session = this.requireSession(args.sessionId);
809
- // Cooperative abort: if the work item was removed/cancelled while the agent
810
- // was still working it (delete-while-loading, cancel_variant, or session
811
- // cancel), its lease was deliberately cleared. Returning an opaque
812
- // STALE_LEASE here forces the agent to guess; instead hand back an explicit
813
- // `aborted` so it drops this work item right away — no retry, no recording
814
- // soon-to-be-discarded output. Checked before the terminal-stage, lease,
815
- // and fingerprint gates so it still fires once removal has driven the
816
- // session terminal. Uses a non-throwing lookup so a report for an item that
817
- // never existed still falls through to requireWorkItem's clear error.
818
705
  const abortTarget = session.workItems.get(args.workItemId);
819
706
  if (abortTarget &&
820
707
  (abortTarget.removed || abortTarget.status === 'cancelled')) {
@@ -825,8 +712,6 @@ class SessionStore {
825
712
  };
826
713
  }
827
714
  if (contracts_1.TERMINAL_STAGES.has(session.stage)) {
828
- // idempotent: terminal sessions accept replays of accepted fingerprints,
829
- // reject new mutating reports.
830
715
  const fp = fingerprint([
831
716
  'reportComplete',
832
717
  args.sessionId,
@@ -855,7 +740,6 @@ class SessionStore {
855
740
  return cached;
856
741
  this.validateLease(item, args.leaseId, args.attempt);
857
742
  if (args.status === 'running') {
858
- // mid-status heartbeat: extend lease, return progress.
859
743
  const now = this.clock.now();
860
744
  if (item.lease) {
861
745
  item.lease.leaseExpiresAt = now + leaseTtlForKind(item.kind);
@@ -870,9 +754,6 @@ class SessionStore {
870
754
  item.error = args.error;
871
755
  if (args.runtime)
872
756
  item.runtime = args.runtime;
873
- // Apply an agent-synthesized title/description so the variant card shows a
874
- // meaningful name (parent identity + the change) instead of the provisional
875
- // instruction text. Only on success; capped so the label stays short.
876
757
  if (args.status === 'succeeded' && (args.title || args.description)) {
877
758
  const input = item.input;
878
759
  if (args.title)
@@ -885,24 +766,10 @@ class SessionStore {
885
766
  if (args.status === 'failed') {
886
767
  this.cascadeDependencyFailure(session, item.id);
887
768
  }
888
- else if (args.status === 'succeeded') {
889
- // succeeded items unblock dependents — handled in leasableItems()
890
- }
891
769
  const result = this.evaluateTerminal(session);
892
770
  session.acceptedFingerprints.set(fp, result);
893
771
  return result;
894
772
  }
895
- /**
896
- * Re-open a succeeded variant work item for one QA-driven regeneration.
897
- * Consumes the agent's report (validating the lease), then resets the item
898
- * to `pending` so it becomes leasable again via `request_work`, stashing the
899
- * QA notes onto its input so the re-leased descriptor carries the notes the
900
- * agent must address before re-reporting.
901
- *
902
- * The work item never reaches a terminal status, so the session stays in
903
- * `waiting_for_results` and never goes terminal off the back of a QA
904
- * failure. Idempotent on replay via the accepted-fingerprint cache.
905
- */
906
773
  requeueForRegeneration(args) {
907
774
  const session = this.requireSession(args.sessionId);
908
775
  const fp = fingerprint([
@@ -918,8 +785,6 @@ class SessionStore {
918
785
  this.assertStage(session, ['work_items_ready', 'waiting_for_results']);
919
786
  const item = this.requireWorkItem(session, args.workItemId);
920
787
  this.validateLease(item, args.leaseId, args.attempt);
921
- // Reset to pending so request_work re-surfaces it. The re-lease increments
922
- // `attempt`, so the regenerated report carries a fresh fingerprint.
923
788
  item.status = 'pending';
924
789
  item.lease = undefined;
925
790
  item.output = undefined;
@@ -933,11 +798,6 @@ class SessionStore {
933
798
  session.acceptedFingerprints.set(fp, result);
934
799
  return result;
935
800
  }
936
- /**
937
- * Creates a refinable HTML work item for a completed static preview variant.
938
- * The target variant remains the user-facing snapshot; this work item only
939
- * tracks the in-flight refinement and is surfaced through its `refinement`.
940
- */
941
801
  createRefineVariantWorkItem(args) {
942
802
  const session = this.requireSession(args.sessionId);
943
803
  const target = this.requireWorkItem(session, args.variantId);
@@ -970,6 +830,7 @@ class SessionStore {
970
830
  briefId: targetInput.briefId,
971
831
  briefLabel: targetInput.briefLabel,
972
832
  briefBody: targetInput.briefBody,
833
+ references: targetInput.references,
973
834
  ...(targetInput.briefNotes
974
835
  ? { briefNotes: targetInput.briefNotes }
975
836
  : {}),
@@ -988,15 +849,6 @@ class SessionStore {
988
849
  session.stage = 'work_items_ready';
989
850
  return item;
990
851
  }
991
- /**
992
- * Fork a completed static_preview variant into N NEW sibling variants. Unlike
993
- * {@link createRefineVariantWorkItem} (which overwrites the source variant in
994
- * place), each forked item is a fresh `static_preview` work item with its own
995
- * id, seeded from the source variant's HTML (`currentHtml`) plus the user's
996
- * instruction. This backs the "Vary" action, where `variantRequest.count`
997
- * asks for N new explorations rather than an in-place edit. Returns the
998
- * created items so the caller can lease them via the normal request-work path.
999
- */
1000
852
  createForkedStaticPreviewWorkItems(args) {
1001
853
  const session = this.requireSession(args.sessionId);
1002
854
  const source = this.requireWorkItem(session, args.sourceVariantId);
@@ -1022,10 +874,6 @@ class SessionStore {
1022
874
  source.output?.html;
1023
875
  const briefs = args.briefs?.map(briefContent_1.normalizeBriefContent);
1024
876
  const total = Math.min(briefs?.length ?? Math.max(Math.trunc(args.count) || 1, 1), contracts_1.VARIANT_COUNT_MAX);
1025
- // Label/describe forked variants by the CHANGE requested (the Vary
1026
- // instruction), not the source brief — otherwise every run on the same
1027
- // variant reads identically ("<source> · variation N") and concurrent runs
1028
- // are indistinguishable in the Directions list.
1029
877
  const instruction = args.instruction.trim();
1030
878
  const prettyInstruction = instruction
1031
879
  ? instruction.charAt(0).toUpperCase() + instruction.slice(1)
@@ -1038,6 +886,27 @@ class SessionStore {
1038
886
  const labelBase = prettyInstruction.length > LABEL_MAX - suffix.length
1039
887
  ? `${prettyInstruction.slice(0, LABEL_MAX - suffix.length - 1)}…`
1040
888
  : prettyInstruction;
889
+ const context = args.additionalContext
890
+ ? {
891
+ ...sourceInput.context,
892
+ contextBundlePath: args.additionalContext.contextBundlePath,
893
+ references: (0, variant_reference_1.mergeVariantReferences)(sourceInput.context?.references, ...args.additionalContext.userContext.map((source) => 'references' in source ? source.references : undefined)),
894
+ userContext: [
895
+ ...(sourceInput.context?.userContext ?? []),
896
+ ...args.additionalContext.userContext,
897
+ ],
898
+ rivetMetadata: [
899
+ ...(sourceInput.context?.rivetMetadata ?? []),
900
+ ...args.additionalContext.rivetMetadata,
901
+ ],
902
+ brief: {
903
+ ...brief,
904
+ briefId: sourceInput.briefId ?? 'vary',
905
+ label: brief?.label ?? labelBase,
906
+ body: brief?.body ?? prettyInstruction,
907
+ },
908
+ }
909
+ : sourceInput.context;
1041
910
  const item = {
1042
911
  id: (0, crypto_1.randomUUID)(),
1043
912
  kind: 'static_preview',
@@ -1046,18 +915,15 @@ class SessionStore {
1046
915
  dependsOn: [],
1047
916
  input: {
1048
917
  briefId: `${sourceInput.briefId ?? 'v'}-vary-${(0, crypto_1.randomUUID)().slice(0, 8)}`,
1049
- // Agent-authored metadata is visible from the start. Human-direct
1050
- // fallback metadata can still be replaced on completion.
1051
918
  briefLabel: brief?.label ?? `${labelBase}${suffix}`,
1052
919
  briefBody: brief?.body ?? prettyInstruction,
920
+ references: (0, variant_reference_1.mergeVariantReferences)(sourceInput.references, context?.references),
1053
921
  ...(args.runLabel ? { runLabel: args.runLabel } : {}),
1054
922
  ...(brief?.visualReferenceUrl
1055
923
  ? { visualReferenceUrl: brief.visualReferenceUrl }
1056
924
  : {}),
1057
925
  instruction: args.instruction,
1058
926
  sourceVariantId: args.sourceVariantId,
1059
- // Parent identity, so the agent can synthesize a name/description that
1060
- // combines the source variant with the requested change.
1061
927
  ...(sourceInput.briefLabel
1062
928
  ? { sourceLabel: sourceInput.briefLabel }
1063
929
  : {}),
@@ -1069,39 +935,18 @@ class SessionStore {
1069
935
  ...(args.requestId ? { requestId: args.requestId } : {}),
1070
936
  ...(args.fidelity ? { fidelity: args.fidelity } : {}),
1071
937
  projectContext: sourceInput.projectContext ?? session.projectContext,
1072
- ...(sourceInput.context ? { context: sourceInput.context } : {}),
938
+ ...(context ? { context } : {}),
1073
939
  ...(relevantFiles.length > 0 ? { relevantFiles } : {}),
1074
940
  },
1075
941
  acceptedReports: [],
1076
942
  };
1077
943
  session.workItems.set(item.id, item);
1078
- // Surface newest siblings at the top of the Directions list: unshift each
1079
- // in creation order so the batch ends up [variation N … variation 1]
1080
- // ahead of the pre-existing variants.
1081
944
  session.workItemOrder.unshift(item.id);
1082
945
  created.push(item);
1083
946
  }
1084
947
  session.stage = 'work_items_ready';
1085
948
  return created;
1086
949
  }
1087
- /**
1088
- * Append new code_gen variants to an EXISTING-project session that already
1089
- * holds variants — the worktree-backed analog of
1090
- * {@link createForkedStaticPreviewWorkItems}. A second "Vary" on an existing
1091
- * project lands here so its variants ACCUMULATE in the live session instead
1092
- * of orphaning the prior ones in a fresh, superseding session. The new items
1093
- * are leasable via {@link requestWork} exactly like the initial code_gen
1094
- * batch; the orchestrator provisions a worktree per item and runs each
1095
- * through the normal completion/preview pipeline.
1096
- *
1097
- * With `sourceVariantId`, forks a succeeded code_gen parent: each new item
1098
- * is stamped with the source id (+ sourceLabel/sourceBody) so the
1099
- * orchestrator seeds its worktree from the parent's tree rather than git
1100
- * HEAD / Original. Backs code_gen "Vary" targeting a parent variant.
1101
- *
1102
- * Reopens the session to `work_items_ready` so the appended pending work is
1103
- * visible and drives the stage back through generation to ready/degraded.
1104
- */
1105
950
  appendCodeGenVariants(args) {
1106
951
  const session = this.requireSession(args.sessionId);
1107
952
  const source = args.sourceVariantId
@@ -1158,6 +1003,7 @@ class SessionStore {
1158
1003
  briefId: brief.briefId,
1159
1004
  briefLabel: brief.label,
1160
1005
  briefBody: brief.body,
1006
+ references: (0, variant_reference_1.mergeVariantReferences)(sourceInput.references, context?.references),
1161
1007
  instruction: args.instruction,
1162
1008
  ...(brief.notes ? { briefNotes: brief.notes } : {}),
1163
1009
  ...visualRef,
@@ -1180,8 +1026,6 @@ class SessionStore {
1180
1026
  acceptedReports: [],
1181
1027
  };
1182
1028
  session.workItems.set(item.id, item);
1183
- // Surface the newest Vary batch at the top of the Directions list, matching
1184
- // the static-preview fork ordering.
1185
1029
  session.workItemOrder.unshift(item.id);
1186
1030
  session.briefs.push(brief);
1187
1031
  createdWorkItemIds.push(item.id);
@@ -1189,24 +1033,6 @@ class SessionStore {
1189
1033
  session.stage = 'work_items_ready';
1190
1034
  return { createdWorkItemIds, briefs: args.briefs };
1191
1035
  }
1192
- /**
1193
- * Adopt a PAST variant (from a prior session's persisted history) into THIS
1194
- * active session as a first-class, already-`succeeded` `static_preview`
1195
- * variant. Triggered when the user makes their first edit (a comment or a
1196
- * Vary) on a selected past direction: the past variant is rehydrated as a
1197
- * live session member so the comment/refine machinery scopes and routes to it
1198
- * exactly like a freshly-generated variant. The caller (orchestrator) registers
1199
- * the static-preview record that points at the rehydrated files so the snapshot
1200
- * surfaces it as a `static_artifact`.
1201
- *
1202
- * Kept as `static_preview` regardless of the host session's primary variant
1203
- * kind so {@link createRefineVariantWorkItem} / {@link createForkedStaticPreviewWorkItems}
1204
- * accept it. Adopted variants are pre-completed artifacts, so they are excluded
1205
- * from progress/summary/terminal accounting and never reopen the session.
1206
- *
1207
- * Idempotent: re-adopting the same `{sessionId, variantId}` returns the
1208
- * existing work item id (`created: false`) rather than duplicating it.
1209
- */
1210
1036
  appendAdoptedStaticVariant(args) {
1211
1037
  const session = this.requireSession(args.sessionId);
1212
1038
  if (session.stage === 'cancelled' || session.stage === 'failed') {
@@ -1237,32 +1063,15 @@ class SessionStore {
1237
1063
  ...(args.description ? { briefBody: args.description } : {}),
1238
1064
  ...(args.runLabel ? { runLabel: args.runLabel } : {}),
1239
1065
  adoptedFrom: { ...args.source },
1066
+ references: (0, variant_reference_1.mergeVariantReferences)(args.references),
1240
1067
  projectContext: session.projectContext,
1241
1068
  },
1242
1069
  acceptedReports: [],
1243
1070
  };
1244
1071
  session.workItems.set(item.id, item);
1245
- // Adoption is triggered by the user's first in-place edit (a comment /
1246
- // refine) on an ALREADY-DISPLAYED past direction — not a request for a new
1247
- // exploration. Appending (rather than unshifting to the top) preserves the
1248
- // positions of the existing active variants so a refined card does NOT
1249
- // leapfrog a newer Vary/fork batch. Genuinely new variants (Vary / fork /
1250
- // append) still surface at the top via their own `unshift` paths. Stage is
1251
- // intentionally left untouched — the adopted variant is already complete,
1252
- // so the session must not reopen to `work_items_ready`.
1253
1072
  session.workItemOrder.push(item.id);
1254
1073
  return { workItemId: item.id, briefId, created: true };
1255
1074
  }
1256
- /**
1257
- * Create an active session whose initial visible direction is a static
1258
- * variant rehydrated from persisted history.
1259
- *
1260
- * This is the no-usable-session counterpart to
1261
- * {@link appendAdoptedStaticVariant}: the session starts terminal/ready
1262
- * because the adopted artifact is already generated, and the adopted work item
1263
- * remains excluded from generation progress because this run did not generate
1264
- * fresh variants.
1265
- */
1266
1075
  createSessionFromStaticHistoryVariant(args) {
1267
1076
  const sessionId = (0, crypto_1.randomUUID)();
1268
1077
  const record = {
@@ -1285,6 +1094,7 @@ class SessionStore {
1285
1094
  source: args.source,
1286
1095
  label: args.label,
1287
1096
  description: args.description,
1097
+ references: args.references,
1288
1098
  runLabel: args.runLabel,
1289
1099
  });
1290
1100
  return {
@@ -1293,7 +1103,6 @@ class SessionStore {
1293
1103
  briefId: adopted.briefId,
1294
1104
  };
1295
1105
  }
1296
- /** Find an already-adopted variant by its source identity, or undefined. */
1297
1106
  findAdoptedVariant(session, source) {
1298
1107
  for (const item of session.workItems.values()) {
1299
1108
  if (item.removed)
@@ -1308,13 +1117,6 @@ class SessionStore {
1308
1117
  }
1309
1118
  return undefined;
1310
1119
  }
1311
- /**
1312
- * Stamp a UI correlation id onto already-created variant work items so the
1313
- * snapshot surfaces it and the panel can map its optimistic placeholders to
1314
- * the real cards (see {@link ActiveVariantSnapshot.requestId}). Skips ids
1315
- * that are unknown to the session. Used by `start_variants` for both the
1316
- * initial batch and the appended (accumulated) batch.
1317
- */
1318
1120
  assignVariantRequestId(sessionId, workItemIds, requestId) {
1319
1121
  const session = this.requireSession(sessionId);
1320
1122
  for (const id of workItemIds) {
@@ -1325,14 +1127,6 @@ class SessionStore {
1325
1127
  item.input = { ...input, requestId };
1326
1128
  }
1327
1129
  }
1328
- /**
1329
- * Fold a newer instruction into a variant's still-pending refinement. Used
1330
- * when a second refinement is requested for a variant that already has a
1331
- * queued (not yet leased) refinement: the new instruction is appended so the
1332
- * agent applies both rather than dropping the later request. The latest
1333
- * request's fidelity replaces the queued choice; omission restores the
1334
- * server default. Returns false when no pending refinement exists.
1335
- */
1336
1130
  appendPendingRefineVariantInstruction(args) {
1337
1131
  const session = this.requireSession(args.sessionId);
1338
1132
  const refineItem = [...session.workItems.values()].find((item) => {
@@ -1356,11 +1150,6 @@ class SessionStore {
1356
1150
  }
1357
1151
  return true;
1358
1152
  }
1359
- /**
1360
- * Lease the pending refinement already associated with a specific static
1361
- * preview variant. Keeps multi-target refinement batches independent of
1362
- * work-item order.
1363
- */
1364
1153
  leaseRefineItemForVariant(args) {
1365
1154
  const session = this.requireSession(args.sessionId);
1366
1155
  const runningRefinement = [...session.workItems.values()].find((item) => {
@@ -1387,15 +1176,6 @@ class SessionStore {
1387
1176
  workItemId: refineItem.id,
1388
1177
  });
1389
1178
  }
1390
- /**
1391
- * Mark a server-owned work item as succeeded without going through the
1392
- * lease + agent-report path. Used for `scaffold_base` items where the
1393
- * orchestrator runs the scaffold + npm install in the background and needs
1394
- * to unblock dependent code_gen items when it's done.
1395
- *
1396
- * Bypasses lease validation because no lease was ever issued for internal
1397
- * items. Idempotent: completing an already-succeeded item is a no-op.
1398
- */
1399
1179
  completeInternal(args) {
1400
1180
  const session = this.requireSession(args.sessionId);
1401
1181
  const item = this.requireWorkItem(session, args.workItemId);
@@ -1410,11 +1190,6 @@ class SessionStore {
1410
1190
  item.lease = undefined;
1411
1191
  return this.evaluateTerminal(session);
1412
1192
  }
1413
- /**
1414
- * Mark a server-owned work item as failed, cascading DEPENDENCY_FAILED to
1415
- * its dependents. Used when the orchestrator's background scaffold work
1416
- * (npm install, file writes) fails and we need the session to degrade.
1417
- */
1418
1193
  failInternal(args) {
1419
1194
  const session = this.requireSession(args.sessionId);
1420
1195
  const item = this.requireWorkItem(session, args.workItemId);
@@ -1430,7 +1205,6 @@ class SessionStore {
1430
1205
  this.cascadeDependencyFailure(session, item.id);
1431
1206
  return this.evaluateTerminal(session);
1432
1207
  }
1433
- // --- Cancel / cleanup ---------------------------------------------------
1434
1208
  cancel(args) {
1435
1209
  const session = this.requireSession(args.sessionId);
1436
1210
  if (session.stage === 'cancelled') {
@@ -1444,18 +1218,8 @@ class SessionStore {
1444
1218
  item.lease = undefined;
1445
1219
  }
1446
1220
  }
1447
- // No cleanup_runtime items in Phase 1; status starts as pending until
1448
- // Phase 2 wires the worktree teardown.
1449
1221
  return { stage: 'cancelled', cleanupStatus: 'pending' };
1450
1222
  }
1451
- /**
1452
- * Cancel a single work item without tearing down its sibling variants or
1453
- * the session itself. Idempotent on terminal states — already-cancelled,
1454
- * succeeded, or failed items return their current status with
1455
- * `alreadyTerminal: true` and no state change. Triggers
1456
- * `evaluateTerminal` so the session can reach a terminal stage if this
1457
- * was the last in-flight item.
1458
- */
1459
1223
  cancelWorkItem(args) {
1460
1224
  const session = this.requireSession(args.sessionId);
1461
1225
  const item = this.requireWorkItem(session, args.workItemId);
@@ -1479,14 +1243,6 @@ class SessionStore {
1479
1243
  alreadyTerminal: false,
1480
1244
  };
1481
1245
  }
1482
- /**
1483
- * Remove a variant from the UI. The work item is retained in the session
1484
- * (and the caller persists it to `.rivet/variants/` as `removed`) but its
1485
- * `removed` flag excludes it from the active snapshot, progress/summary, and
1486
- * terminal evaluation — so it is never rendered again. Any in-flight work is
1487
- * cancelled first so the hidden variant doesn't keep a lease or resurface via
1488
- * `request_work`; terminal variants keep their final status. Idempotent.
1489
- */
1490
1246
  removeWorkItem(args) {
1491
1247
  const session = this.requireSession(args.sessionId);
1492
1248
  const item = this.requireWorkItem(session, args.workItemId);
@@ -1503,10 +1259,6 @@ class SessionStore {
1503
1259
  item.lease = undefined;
1504
1260
  }
1505
1261
  item.removed = true;
1506
- // Cancel any in-flight refinement for this variant too — otherwise a
1507
- // pending/running refine_variant keeps the session busy (evaluateTerminal
1508
- // waits on it) and request_work could keep leasing hidden refinement work
1509
- // after the parent variant was removed.
1510
1262
  for (const other of session.workItems.values()) {
1511
1263
  if (other.kind !== 'refine_variant')
1512
1264
  continue;
@@ -1526,12 +1278,6 @@ class SessionStore {
1526
1278
  alreadyRemoved: false,
1527
1279
  };
1528
1280
  }
1529
- /**
1530
- * Rename a variant: patches the brief label held in the work item's `input`
1531
- * blob (the same field `variantsOf` reads for the snapshot `label`), so the
1532
- * next `emitChange` pushes the new title to the UI. Pure metadata edit — it
1533
- * never touches status, lease, or refinement state. Idempotent.
1534
- */
1535
1281
  renameWorkItem(args) {
1536
1282
  const session = this.requireSession(args.sessionId);
1537
1283
  const item = this.requireWorkItem(session, args.workItemId);
@@ -1543,12 +1289,6 @@ class SessionStore {
1543
1289
  sessionStage: session.stage,
1544
1290
  };
1545
1291
  }
1546
- /**
1547
- * Re-home every non-removed work item in one request batch whose effective
1548
- * run label matches. The explicit request id prevents same-label batches in
1549
- * one session from affecting each other; an absent id selects the session's
1550
- * initial batch. The new label is stamped per item as `input.runLabel`.
1551
- */
1552
1292
  renameRun(args) {
1553
1293
  const session = this.requireSession(args.sessionId);
1554
1294
  const sessionFallback = session.runLabel ?? (0, runLabel_1.deriveRunLabel)(session.prompt);
@@ -1568,7 +1308,6 @@ class SessionStore {
1568
1308
  }
1569
1309
  return { workItemIds, sessionStage: session.stage };
1570
1310
  }
1571
- // --- Variant pick handoff ----------------------------------------------
1572
1311
  recordVariantPick(args) {
1573
1312
  const session = this.requireSession(args.sessionId);
1574
1313
  if (!['ready', 'degraded'].includes(session.stage)) {
@@ -1584,15 +1323,12 @@ class SessionStore {
1584
1323
  session.variantPick = args.envelope;
1585
1324
  return { duplicate: false };
1586
1325
  }
1587
- // --- Read accessors -----------------------------------------------------
1588
1326
  getStage(sessionId) {
1589
1327
  return this.requireSession(sessionId).stage;
1590
1328
  }
1591
1329
  getPrompt(sessionId) {
1592
1330
  return this.requireSession(sessionId).prompt;
1593
1331
  }
1594
- /** The run's label — the agent-provided one if present, else a heuristic
1595
- * derived from the prompt. */
1596
1332
  getRunLabel(sessionId) {
1597
1333
  const session = this.requireSession(sessionId);
1598
1334
  return session.runLabel ?? (0, runLabel_1.deriveRunLabel)(session.prompt);
@@ -1611,8 +1347,6 @@ class SessionStore {
1611
1347
  const session = this.requireSession(sessionId);
1612
1348
  return this.variantsOf(session);
1613
1349
  }
1614
- /** Record the run's worker-runtime lease summary (see
1615
- * ActiveSnapshot.workerRuntime). Latest batch wins. */
1616
1350
  setWorkerRuntime(sessionId, summary) {
1617
1351
  const session = this.sessions.get(sessionId);
1618
1352
  if (session)
@@ -1621,16 +1355,15 @@ class SessionStore {
1621
1355
  getWorkerRuntime(sessionId) {
1622
1356
  return this.sessions.get(sessionId)?.workerRuntime;
1623
1357
  }
1624
- /** The runtime that executed a work item's worker, when the executor
1625
- * reported one — read at history-persist time so manifests carry it. */
1626
1358
  getWorkItemRuntime(sessionId, workItemId) {
1627
1359
  return this.sessions.get(sessionId)?.workItems.get(workItemId)?.runtime;
1628
1360
  }
1629
1361
  getHostWork(sessionId) {
1630
1362
  const session = this.requireSession(sessionId);
1631
- return [...session.workItems.values()]
1632
- .filter((item) => item.lease && item.status === 'running')
1633
- .map((item) => {
1363
+ return [...session.workItems.values()].flatMap((item) => {
1364
+ const { lease } = item;
1365
+ if (!lease || item.status !== 'running')
1366
+ return [];
1634
1367
  const input = item.input && typeof item.input === 'object'
1635
1368
  ? item.input
1636
1369
  : {};
@@ -1642,10 +1375,10 @@ class SessionStore {
1642
1375
  variantId,
1643
1376
  kind: item.kind,
1644
1377
  status: item.status,
1645
- leaseId: item.lease.leaseId,
1646
- leaseOwner: item.lease.leaseOwner,
1647
- attempt: item.lease.attempt,
1648
- leaseExpiresAt: item.lease.leaseExpiresAt,
1378
+ leaseId: lease.leaseId,
1379
+ leaseOwner: lease.leaseOwner,
1380
+ attempt: lease.attempt,
1381
+ leaseExpiresAt: lease.leaseExpiresAt,
1649
1382
  input: item.input,
1650
1383
  outputSchema: outputSchemaFor(item.kind),
1651
1384
  };
@@ -1654,7 +1387,6 @@ class SessionStore {
1654
1387
  getVariantPick(sessionId) {
1655
1388
  return this.requireSession(sessionId).variantPick;
1656
1389
  }
1657
- /** Validates a report lease without mutating the work item. */
1658
1390
  validateReportLease(args) {
1659
1391
  const session = this.requireSession(args.sessionId);
1660
1392
  const item = this.requireWorkItem(session, args.workItemId);
@@ -1663,8 +1395,6 @@ class SessionStore {
1663
1395
  hasSession(sessionId) {
1664
1396
  return this.sessions.has(sessionId);
1665
1397
  }
1666
- /** Read a work item's input blob — used by the orchestrator to recover
1667
- * briefLabel / target / projectContext when committing the output. */
1668
1398
  getWorkItemInput(sessionId, workItemId) {
1669
1399
  const session = this.requireSession(sessionId);
1670
1400
  const item = this.requireWorkItem(session, workItemId);
@@ -1675,37 +1405,24 @@ class SessionStore {
1675
1405
  const item = this.requireWorkItem(session, workItemId);
1676
1406
  return item.output;
1677
1407
  }
1678
- /** Returns the authoritative status after report validation and post-processing. */
1679
1408
  getWorkItemStatus(sessionId, workItemId) {
1680
1409
  const session = this.requireSession(sessionId);
1681
1410
  return this.requireWorkItem(session, workItemId).status;
1682
1411
  }
1683
- /** Replaces a completed work item's output after server-side post-processing. */
1684
1412
  replaceWorkItemOutput(sessionId, workItemId, output) {
1685
1413
  const session = this.requireSession(sessionId);
1686
1414
  const item = this.requireWorkItem(session, workItemId);
1687
1415
  item.output = output;
1688
1416
  }
1689
- /** Read a work item's `kind` discriminator (brief | source_plan |
1690
- * static_preview | code_gen | scaffold_base). Used by callers that need to
1691
- * branch their validation on the work-item shape — e.g. enforcing the
1692
- * inline-HTML contract on static_preview `succeeded` reports. */
1693
1417
  getWorkItemKind(sessionId, workItemId) {
1694
1418
  const session = this.requireSession(sessionId);
1695
1419
  const item = this.requireWorkItem(session, workItemId);
1696
1420
  return item.kind;
1697
1421
  }
1698
- /** True when the work item forks an existing variant (execution mode
1699
- * "vary"). Non-throwing so telemetry callers can read it on any item:
1700
- * unknown session or work item reads as not-a-fork. */
1701
1422
  isVaryForkWorkItem(sessionId, workItemId) {
1702
1423
  const item = this.sessions.get(sessionId)?.workItems.get(workItemId);
1703
1424
  return Boolean(item && item.input.sourceVariantId);
1704
1425
  }
1705
- /** True when the work item was removed or cancelled out from under the agent.
1706
- * The orchestrator checks this to short-circuit the schema/QA gates before a
1707
- * `report_variant_complete` it's about to abort. Non-throwing: unknown
1708
- * session or work item reads as not-aborted. */
1709
1426
  isWorkItemAborted(sessionId, workItemId) {
1710
1427
  const session = this.sessions.get(sessionId);
1711
1428
  if (!session)
@@ -1713,11 +1430,9 @@ class SessionStore {
1713
1430
  const item = session.workItems.get(workItemId);
1714
1431
  return Boolean(item && (item.removed || item.status === 'cancelled'));
1715
1432
  }
1716
- /** Read the projectContext for a session (existing | fresh). */
1717
1433
  getProjectContext(sessionId) {
1718
1434
  return this.requireSession(sessionId).projectContext;
1719
1435
  }
1720
- // --- Internals ----------------------------------------------------------
1721
1436
  requireSession(sessionId) {
1722
1437
  const s = this.sessions.get(sessionId);
1723
1438
  if (!s) {
@@ -1737,19 +1452,6 @@ class SessionStore {
1737
1452
  throw new errors_1.AgentVariantsError('INVALID_STAGE_ACTION', `Action not allowed in stage ${session.stage}; allowed: ${allowed.join(', ')}`);
1738
1453
  }
1739
1454
  }
1740
- /**
1741
- * Validates a report against a planning work item (source_plan or brief).
1742
- *
1743
- * Planning items are single-planner and attempt-gated. `propose` /
1744
- * `start_variants` hand back the source_plan item, and `report_source_plan`
1745
- * hands back the brief item, WITHOUT issuing a lease — so the agent reports
1746
- * against them directly (no `request_work` round-trip) and may carry a stale
1747
- * or guessed `leaseId` from an earlier stage. When the item carries an active
1748
- * lease (the agent went through `request_work`, e.g. a recovery re-lease),
1749
- * validate it strictly. Otherwise gate on `attempt` alone and ignore any
1750
- * provided leaseId, so a direct report no longer fails with LEASE_MISMATCH
1751
- * and force a wasteful re-request → re-report round-trip.
1752
- */
1753
1455
  validatePlanningReport(item, leaseId, attempt) {
1754
1456
  if (item.lease) {
1755
1457
  this.validateLease(item, leaseId ?? '', attempt);
@@ -1788,9 +1490,10 @@ class SessionStore {
1788
1490
  const out = [];
1789
1491
  for (const id of session.workItemOrder) {
1790
1492
  const item = session.workItems.get(id);
1493
+ if (!item)
1494
+ throw new Error(`Missing ordered work item: ${id}`);
1791
1495
  if (item.kind === 'brief')
1792
1496
  continue;
1793
- // Server-owned items never surface to external agents.
1794
1497
  if (item.internal)
1795
1498
  continue;
1796
1499
  if (item.status !== 'pending')
@@ -1843,23 +1546,10 @@ class SessionStore {
1843
1546
  }
1844
1547
  terminalItems(session) {
1845
1548
  const kind = this.variantWorkItemKind(session);
1846
- // Removed variants are excluded everywhere progress/summary/terminal
1847
- // accounting reads from, so a removed variant neither blocks the session
1848
- // from going terminal nor inflates the ready/total counts. Adopted past
1849
- // variants are likewise excluded: they are pre-completed artifacts pulled in
1850
- // for editing, not part of this run's generation, so they must not inflate
1851
- // progress/total or flip a failed run to degraded.
1852
1549
  return [...session.workItems.values()].filter((i) => (i.kind === kind || isForkedStaticPreviewVariant(i)) &&
1853
1550
  !i.removed &&
1854
1551
  !isAdoptedVariant(i));
1855
1552
  }
1856
- /**
1857
- * The work-item kind that represents a user-facing variant for this
1858
- * session. Drives both progress accounting and the active variants
1859
- * snapshot. Fresh+vite_app sessions use `code_gen` like existing
1860
- * projects; fresh+static_preview (the default for source-less 0→1)
1861
- * keeps `static_preview` as the deliverable.
1862
- */
1863
1553
  variantWorkItemKind(session) {
1864
1554
  if (session.projectContext.kind !== 'fresh')
1865
1555
  return 'code_gen';
@@ -1876,9 +1566,6 @@ class SessionStore {
1876
1566
  };
1877
1567
  }
1878
1568
  const items = this.terminalItems(session);
1879
- // No live variants (e.g. the user removed them all) — don't flip an empty
1880
- // session to a terminal "ready" state with zero successes; leave the stage
1881
- // as-is.
1882
1569
  if (items.length === 0) {
1883
1570
  return {
1884
1571
  stage: session.stage,
@@ -1974,23 +1661,13 @@ class SessionStore {
1974
1661
  workItemId: item.id,
1975
1662
  briefId: input.briefId ?? '',
1976
1663
  label: input.briefLabel ?? 'Variant',
1664
+ references: input.references,
1977
1665
  status: item.status,
1978
- // The filter above admits only code_gen / static_preview items
1979
- // (incl. adopted + forked static previews). Clients route Vary/apply
1980
- // on this — never on the display preview kind, which diverges for
1981
- // existing-project code_gen variants materialized as static HTML.
1982
1666
  workItemKind: item.kind,
1983
1667
  createdAt: new Date(session.createdAt).toISOString(),
1984
- // Prefer the per-item label stamped by an appended Vary batch; the
1985
- // session-level fallback is correct only for the first batch (its
1986
- // prompt is the session prompt). Without this, accumulated batches
1987
- // all show batch 1's tag.
1988
1668
  runLabel: input.runLabel ??
1989
1669
  session.runLabel ??
1990
1670
  (0, runLabel_1.deriveRunLabel)(session.prompt),
1991
- // Correlation id of the UI request that produced this variant (a fork)
1992
- // or, for an in-place refine, the request driving its refinement —
1993
- // lets the UI map its optimistic placeholders to real cards.
1994
1671
  ...(input.requestId
1995
1672
  ? { requestId: input.requestId }
1996
1673
  : refineRequestId
@@ -2020,9 +1697,6 @@ class SessionStore {
2020
1697
  }
2021
1698
  : {}),
2022
1699
  ...(item.error?.code ? { errorCode: String(item.error.code) } : {}),
2023
- // The failure detail (exit code + stderr/result tail) must survive
2024
- // into the snapshot — dropping it here reduced every executor
2025
- // failure to a bare EXECUTOR_WORKER_FAILED in `variants status`.
2026
1700
  ...(item.error?.message
2027
1701
  ? { errorMessage: capErrorMessage(item.error.message) }
2028
1702
  : {}),
@@ -2032,9 +1706,6 @@ class SessionStore {
2032
1706
  }
2033
1707
  }
2034
1708
  exports.SessionStore = SessionStore;
2035
- /** Snapshot-side bound on failure detail. The executor already caps its
2036
- * stderr/result capture, but host-reported errors are unbounded — the
2037
- * status envelope should never balloon on a chatty failure. */
2038
1709
  function capErrorMessage(message) {
2039
1710
  const MAX = 1000;
2040
1711
  return message.length > MAX ? `${message.slice(0, MAX)}…` : message;