rivet-design 0.23.1 → 0.24.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 (386) hide show
  1. package/dist/agent-variants/SessionStore.d.ts +6 -0
  2. package/dist/agent-variants/SessionStore.d.ts.map +1 -1
  3. package/dist/agent-variants/SessionStore.js +21 -4
  4. package/dist/agent-variants/SessionStore.js.map +1 -1
  5. package/dist/agent-variants/WorkerExecutorService.d.ts.map +1 -1
  6. package/dist/agent-variants/WorkerExecutorService.js +37 -10
  7. package/dist/agent-variants/WorkerExecutorService.js.map +1 -1
  8. package/dist/agent-variants/WorktreeOrchestrator.d.ts +3 -32
  9. package/dist/agent-variants/WorktreeOrchestrator.d.ts.map +1 -1
  10. package/dist/agent-variants/WorktreeOrchestrator.js +9 -0
  11. package/dist/agent-variants/WorktreeOrchestrator.js.map +1 -1
  12. package/dist/agent-variants/contracts.d.ts +290 -288
  13. package/dist/agent-variants/contracts.d.ts.map +1 -1
  14. package/dist/agent-variants/contracts.js.map +1 -1
  15. package/dist/agent-variants/staticPreviewRefinements.d.ts +2 -0
  16. package/dist/agent-variants/staticPreviewRefinements.d.ts.map +1 -1
  17. package/dist/agent-variants/staticPreviewRefinements.js +3 -0
  18. package/dist/agent-variants/staticPreviewRefinements.js.map +1 -1
  19. package/dist/agent-variants/variant-start-types.d.ts +38 -0
  20. package/dist/agent-variants/variant-start-types.d.ts.map +1 -0
  21. package/dist/agent-variants/variant-start-types.js +3 -0
  22. package/dist/agent-variants/variant-start-types.js.map +1 -0
  23. package/dist/agent-variants/videoKeyframes.d.ts.map +1 -1
  24. package/dist/agent-variants/videoKeyframes.js +3 -2
  25. package/dist/agent-variants/videoKeyframes.js.map +1 -1
  26. package/dist/agent-variants/workItemBriefing.d.ts +1 -0
  27. package/dist/agent-variants/workItemBriefing.d.ts.map +1 -1
  28. package/dist/agent-variants/workItemBriefing.js +20 -6
  29. package/dist/agent-variants/workItemBriefing.js.map +1 -1
  30. package/dist/agent-variants/workItemInput.d.ts +196 -186
  31. package/dist/agent-variants/workItemInput.d.ts.map +1 -1
  32. package/dist/agent-variants/workItemInput.js +1 -0
  33. package/dist/agent-variants/workItemInput.js.map +1 -1
  34. package/dist/agent-variants/workerRuntime.d.ts +8 -1
  35. package/dist/agent-variants/workerRuntime.d.ts.map +1 -1
  36. package/dist/agent-variants/workerRuntime.js +59 -40
  37. package/dist/agent-variants/workerRuntime.js.map +1 -1
  38. package/dist/cli/browser.d.ts.map +1 -1
  39. package/dist/cli/browser.js +5 -3
  40. package/dist/cli/browser.js.map +1 -1
  41. package/dist/cli/client.d.ts.map +1 -1
  42. package/dist/cli/client.js +23 -3
  43. package/dist/cli/client.js.map +1 -1
  44. package/dist/cli/commands/context.d.ts.map +1 -1
  45. package/dist/cli/commands/context.js +10 -35
  46. package/dist/cli/commands/context.js.map +1 -1
  47. package/dist/cli/commands/contextRequest.d.ts +1 -0
  48. package/dist/cli/commands/contextRequest.d.ts.map +1 -1
  49. package/dist/cli/commands/contextRequest.js +8 -1
  50. package/dist/cli/commands/contextRequest.js.map +1 -1
  51. package/dist/cli/commands/contextVerification.d.ts +12 -0
  52. package/dist/cli/commands/contextVerification.d.ts.map +1 -0
  53. package/dist/cli/commands/contextVerification.js +48 -0
  54. package/dist/cli/commands/contextVerification.js.map +1 -0
  55. package/dist/cli/commands/guidanceReferences.d.ts +1 -1
  56. package/dist/cli/commands/mcpServe.d.ts +1 -3
  57. package/dist/cli/commands/mcpServe.d.ts.map +1 -1
  58. package/dist/cli/commands/mcpServe.js +21 -744
  59. package/dist/cli/commands/mcpServe.js.map +1 -1
  60. package/dist/cli/commands/open.d.ts.map +1 -1
  61. package/dist/cli/commands/open.js +2 -1
  62. package/dist/cli/commands/open.js.map +1 -1
  63. package/dist/cli/commands/profile.d.ts.map +1 -1
  64. package/dist/cli/commands/profile.js +2 -1
  65. package/dist/cli/commands/profile.js.map +1 -1
  66. package/dist/cli/commands/serve.d.ts.map +1 -1
  67. package/dist/cli/commands/serve.js +0 -2
  68. package/dist/cli/commands/serve.js.map +1 -1
  69. package/dist/cli/commands/shared.d.ts.map +1 -1
  70. package/dist/cli/commands/shared.js +5 -2
  71. package/dist/cli/commands/shared.js.map +1 -1
  72. package/dist/cli/commands/status.d.ts.map +1 -1
  73. package/dist/cli/commands/status.js +4 -1
  74. package/dist/cli/commands/status.js.map +1 -1
  75. package/dist/cli/commands/variants.d.ts.map +1 -1
  76. package/dist/cli/commands/variants.js +2 -1
  77. package/dist/cli/commands/variants.js.map +1 -1
  78. package/dist/cli/editorSession.d.ts +27 -0
  79. package/dist/cli/editorSession.d.ts.map +1 -0
  80. package/dist/cli/editorSession.js +50 -0
  81. package/dist/cli/editorSession.js.map +1 -0
  82. package/dist/cli/entry.d.ts.map +1 -1
  83. package/dist/cli/entry.js +2 -0
  84. package/dist/cli/entry.js.map +1 -1
  85. package/dist/cli/hostWorkNextAction.d.ts +3 -5
  86. package/dist/cli/hostWorkNextAction.d.ts.map +1 -1
  87. package/dist/cli/hostWorkNextAction.js +7 -23
  88. package/dist/cli/hostWorkNextAction.js.map +1 -1
  89. package/dist/cli/router.d.ts.map +1 -1
  90. package/dist/cli/router.js +4 -2
  91. package/dist/cli/router.js.map +1 -1
  92. package/dist/cli/serverHandshake.d.ts +1 -0
  93. package/dist/cli/serverHandshake.d.ts.map +1 -1
  94. package/dist/cli/serverHandshake.js.map +1 -1
  95. package/dist/cli/serverUnavailable.d.ts +1 -1
  96. package/dist/cli/serverUnavailable.d.ts.map +1 -1
  97. package/dist/cli/serverUnavailable.js +1 -0
  98. package/dist/cli/serverUnavailable.js.map +1 -1
  99. package/dist/config/flags.d.ts +3 -0
  100. package/dist/config/flags.d.ts.map +1 -1
  101. package/dist/config/flags.js +1 -0
  102. package/dist/config/flags.js.map +1 -1
  103. package/dist/config/pluginMetrics.d.ts +2 -0
  104. package/dist/config/pluginMetrics.d.ts.map +1 -0
  105. package/dist/config/pluginMetrics.js +234 -0
  106. package/dist/config/pluginMetrics.js.map +1 -0
  107. package/dist/config/telemetryPolicy.d.ts +8 -0
  108. package/dist/config/telemetryPolicy.d.ts.map +1 -0
  109. package/dist/config/telemetryPolicy.js +25 -0
  110. package/dist/config/telemetryPolicy.js.map +1 -0
  111. package/dist/index-core.d.ts +0 -1
  112. package/dist/index-core.d.ts.map +1 -1
  113. package/dist/index-core.js +1 -3
  114. package/dist/index-core.js.map +1 -1
  115. package/dist/index.d.ts.map +1 -1
  116. package/dist/index.js +10 -15
  117. package/dist/index.js.map +1 -1
  118. package/dist/install/allowlists.d.ts.map +1 -1
  119. package/dist/install/allowlists.js +6 -1
  120. package/dist/install/allowlists.js.map +1 -1
  121. package/dist/install/automaticCliUpdate.d.ts.map +1 -1
  122. package/dist/install/automaticCliUpdate.js +9 -2
  123. package/dist/install/automaticCliUpdate.js.map +1 -1
  124. package/dist/install/channelCli.d.ts.map +1 -1
  125. package/dist/install/channelCli.js +2 -1
  126. package/dist/install/channelCli.js.map +1 -1
  127. package/dist/install/channelManager.d.ts.map +1 -1
  128. package/dist/install/channelManager.js +11 -6
  129. package/dist/install/channelManager.js.map +1 -1
  130. package/dist/install/globalBootstrap.d.ts.map +1 -1
  131. package/dist/install/globalBootstrap.js +5 -1
  132. package/dist/install/globalBootstrap.js.map +1 -1
  133. package/dist/install/harnesses.js +1 -1
  134. package/dist/install/mcpRegistration.d.ts.map +1 -1
  135. package/dist/install/mcpRegistration.js +7 -4
  136. package/dist/install/mcpRegistration.js.map +1 -1
  137. package/dist/library/HubClient.d.ts.map +1 -1
  138. package/dist/library/HubClient.js +25 -5
  139. package/dist/library/HubClient.js.map +1 -1
  140. package/dist/mcp/designContextTools.d.ts +3 -0
  141. package/dist/mcp/designContextTools.d.ts.map +1 -0
  142. package/dist/mcp/designContextTools.js +44 -0
  143. package/dist/mcp/designContextTools.js.map +1 -0
  144. package/dist/mcp/explorationSchema.d.ts +56 -0
  145. package/dist/mcp/explorationSchema.d.ts.map +1 -0
  146. package/dist/mcp/explorationSchema.js +123 -0
  147. package/dist/mcp/explorationSchema.js.map +1 -0
  148. package/dist/mcp/explorationTools.d.ts +3 -0
  149. package/dist/mcp/explorationTools.d.ts.map +1 -0
  150. package/dist/mcp/explorationTools.js +117 -0
  151. package/dist/mcp/explorationTools.js.map +1 -0
  152. package/dist/mcp/getExploration.d.ts +13 -0
  153. package/dist/mcp/getExploration.d.ts.map +1 -0
  154. package/dist/mcp/getExploration.js +130 -0
  155. package/dist/mcp/getExploration.js.map +1 -0
  156. package/dist/mcp/intentTool.d.ts +60 -0
  157. package/dist/mcp/intentTool.d.ts.map +1 -0
  158. package/dist/mcp/intentTool.js +57 -0
  159. package/dist/mcp/intentTool.js.map +1 -0
  160. package/dist/mcp/preferenceTools.d.ts +3 -0
  161. package/dist/mcp/preferenceTools.d.ts.map +1 -0
  162. package/dist/mcp/preferenceTools.js +164 -0
  163. package/dist/mcp/preferenceTools.js.map +1 -0
  164. package/dist/mcp/profileAccess.d.ts +4 -0
  165. package/dist/mcp/profileAccess.d.ts.map +1 -0
  166. package/dist/mcp/profileAccess.js +31 -0
  167. package/dist/mcp/profileAccess.js.map +1 -0
  168. package/dist/mcp/referenceTools.d.ts +3 -0
  169. package/dist/mcp/referenceTools.d.ts.map +1 -0
  170. package/dist/mcp/referenceTools.js +128 -0
  171. package/dist/mcp/referenceTools.js.map +1 -0
  172. package/dist/prototype-host.js +37 -2
  173. package/dist/prototype-host.js.map +1 -1
  174. package/dist/routes/agentVariants.d.ts.map +1 -1
  175. package/dist/routes/agentVariants.js +10 -36
  176. package/dist/routes/agentVariants.js.map +1 -1
  177. package/dist/routes/editorAccess.d.ts +3 -0
  178. package/dist/routes/editorAccess.d.ts.map +1 -0
  179. package/dist/routes/editorAccess.js +33 -0
  180. package/dist/routes/editorAccess.js.map +1 -0
  181. package/dist/routes/library/app.d.ts.map +1 -1
  182. package/dist/routes/library/app.js +2 -0
  183. package/dist/routes/library/app.js.map +1 -1
  184. package/dist/routes/library/index.d.ts.map +1 -1
  185. package/dist/routes/library/index.js +2 -0
  186. package/dist/routes/library/index.js.map +1 -1
  187. package/dist/routes/shareAvailability.d.ts +8 -0
  188. package/dist/routes/shareAvailability.d.ts.map +1 -0
  189. package/dist/routes/shareAvailability.js +25 -0
  190. package/dist/routes/shareAvailability.js.map +1 -0
  191. package/dist/routes/telemetry.d.ts +4 -0
  192. package/dist/routes/telemetry.d.ts.map +1 -0
  193. package/dist/routes/telemetry.js +60 -0
  194. package/dist/routes/telemetry.js.map +1 -0
  195. package/dist/routes/variantRequestSchema.d.ts +33 -4
  196. package/dist/routes/variantRequestSchema.d.ts.map +1 -1
  197. package/dist/routes/variantRequestSchema.js +13 -1
  198. package/dist/routes/variantRequestSchema.js.map +1 -1
  199. package/dist/server.d.ts +2 -2
  200. package/dist/server.d.ts.map +1 -1
  201. package/dist/server.js +230 -127
  202. package/dist/server.js.map +1 -1
  203. package/dist/services/CliLogForwarder.js +2 -1
  204. package/dist/services/CliLogForwarder.js.map +1 -1
  205. package/dist/services/ConfigManager.d.ts +7 -0
  206. package/dist/services/ConfigManager.d.ts.map +1 -1
  207. package/dist/services/ConfigManager.js +31 -24
  208. package/dist/services/ConfigManager.js.map +1 -1
  209. package/dist/services/DependencyPreparationService.d.ts.map +1 -1
  210. package/dist/services/DependencyPreparationService.js +2 -1
  211. package/dist/services/DependencyPreparationService.js.map +1 -1
  212. package/dist/services/FeatureFlagService.d.ts.map +1 -1
  213. package/dist/services/FeatureFlagService.js +13 -2
  214. package/dist/services/FeatureFlagService.js.map +1 -1
  215. package/dist/services/GuidanceVerifierRunner.d.ts +0 -1
  216. package/dist/services/GuidanceVerifierRunner.d.ts.map +1 -1
  217. package/dist/services/GuidanceVerifierRunner.js +11 -22
  218. package/dist/services/GuidanceVerifierRunner.js.map +1 -1
  219. package/dist/services/IntegrationsClient.d.ts +3 -3
  220. package/dist/services/OperatingSystemServices.d.ts +1 -0
  221. package/dist/services/OperatingSystemServices.d.ts.map +1 -1
  222. package/dist/services/OperatingSystemServices.js +3 -2
  223. package/dist/services/OperatingSystemServices.js.map +1 -1
  224. package/dist/services/ProjectDetectionService.d.ts.map +1 -1
  225. package/dist/services/ProjectDetectionService.js +6 -4
  226. package/dist/services/ProjectDetectionService.js.map +1 -1
  227. package/dist/services/ProjectFolderPicker.d.ts.map +1 -1
  228. package/dist/services/ProjectFolderPicker.js +2 -0
  229. package/dist/services/ProjectFolderPicker.js.map +1 -1
  230. package/dist/services/ProjectLibrary.d.ts +2 -0
  231. package/dist/services/ProjectLibrary.d.ts.map +1 -1
  232. package/dist/services/ProjectLibrary.js +16 -6
  233. package/dist/services/ProjectLibrary.js.map +1 -1
  234. package/dist/services/ProjectRegistry.d.ts +3 -2
  235. package/dist/services/ProjectRegistry.d.ts.map +1 -1
  236. package/dist/services/ProjectRegistry.js +4 -0
  237. package/dist/services/ProjectRegistry.js.map +1 -1
  238. package/dist/services/PrototypeBuildService.d.ts.map +1 -1
  239. package/dist/services/PrototypeBuildService.js +2 -1
  240. package/dist/services/PrototypeBuildService.js.map +1 -1
  241. package/dist/services/StaticPreviewServer.d.ts.map +1 -1
  242. package/dist/services/StaticPreviewServer.js +2 -1
  243. package/dist/services/StaticPreviewServer.js.map +1 -1
  244. package/dist/services/TelemetryService.d.ts +3 -1
  245. package/dist/services/TelemetryService.d.ts.map +1 -1
  246. package/dist/services/TelemetryService.js +60 -21
  247. package/dist/services/TelemetryService.js.map +1 -1
  248. package/dist/services/TreeStore.d.ts.map +1 -1
  249. package/dist/services/TreeStore.js +7 -2
  250. package/dist/services/TreeStore.js.map +1 -1
  251. package/dist/services/VariantGenerationService.d.ts.map +1 -1
  252. package/dist/services/VariantGenerationService.js +6 -7
  253. package/dist/services/VariantGenerationService.js.map +1 -1
  254. package/dist/services/VariantRunService.d.ts.map +1 -1
  255. package/dist/services/VariantRunService.js +10 -6
  256. package/dist/services/VariantRunService.js.map +1 -1
  257. package/dist/services/WorktreeManager.d.ts.map +1 -1
  258. package/dist/services/WorktreeManager.js +9 -1
  259. package/dist/services/WorktreeManager.js.map +1 -1
  260. package/dist/services/packageManagerProcess.d.ts.map +1 -1
  261. package/dist/services/packageManagerProcess.js +3 -0
  262. package/dist/services/packageManagerProcess.js.map +1 -1
  263. package/dist/services/profiles/DesignProfiles.d.ts +286 -66
  264. package/dist/services/profiles/DesignProfiles.d.ts.map +1 -1
  265. package/dist/services/profiles/DesignProfiles.js +346 -91
  266. package/dist/services/profiles/DesignProfiles.js.map +1 -1
  267. package/dist/services/profiles/MemoryRuntime.d.ts.map +1 -1
  268. package/dist/services/profiles/MemoryRuntime.js +4 -6
  269. package/dist/services/profiles/MemoryRuntime.js.map +1 -1
  270. package/dist/services/profiles/ProfileAgent.d.ts.map +1 -1
  271. package/dist/services/profiles/ProfileAgent.js +4 -3
  272. package/dist/services/profiles/ProfileAgent.js.map +1 -1
  273. package/dist/services/profiles/ProfileImports.d.ts +2 -2
  274. package/dist/services/profiles/ProfilePlanning.d.ts +4 -4
  275. package/dist/services/profiles/ProfilePreparation.d.ts.map +1 -1
  276. package/dist/services/profiles/ProfilePreparation.js +1 -0
  277. package/dist/services/profiles/ProfilePreparation.js.map +1 -1
  278. package/dist/services/profiles/ProfileVariants.d.ts +1 -1
  279. package/dist/services/profiles/ProfileVariants.d.ts.map +1 -1
  280. package/dist/services/profiles/ProfileVariants.js +1 -1
  281. package/dist/services/profiles/ProfileVariants.js.map +1 -1
  282. package/dist/services/profiles/ReferenceReader.d.ts +3 -3
  283. package/dist/services/profiles/profileContext.d.ts +1 -1
  284. package/dist/services/stopRuntimeProcess.d.ts.map +1 -1
  285. package/dist/services/stopRuntimeProcess.js +2 -0
  286. package/dist/services/stopRuntimeProcess.js.map +1 -1
  287. package/dist/storage/library/BundleMetadataStore.d.ts +1 -0
  288. package/dist/storage/library/BundleMetadataStore.d.ts.map +1 -1
  289. package/dist/storage/library/BundleMetadataStore.js +17 -0
  290. package/dist/storage/library/BundleMetadataStore.js.map +1 -1
  291. package/dist/storage/library/ProjectPreviewCache.d.ts +2 -2
  292. package/dist/storage/library/ProjectRecords.d.ts +1 -0
  293. package/dist/storage/library/ProjectRecords.d.ts.map +1 -1
  294. package/dist/storage/library/ProjectRecords.js +7 -0
  295. package/dist/storage/library/ProjectRecords.js.map +1 -1
  296. package/dist/storage/library/database.d.ts +4 -0
  297. package/dist/storage/library/database.d.ts.map +1 -1
  298. package/dist/storage/library/database.js +18 -1
  299. package/dist/storage/library/database.js.map +1 -1
  300. package/dist/storage/profiles/ProfilePlans.d.ts +19 -18
  301. package/dist/storage/profiles/ProfilePlans.d.ts.map +1 -1
  302. package/dist/storage/profiles/ProfilePlans.js +5 -2
  303. package/dist/storage/profiles/ProfilePlans.js.map +1 -1
  304. package/dist/storage/profiles/ProfileRecords.d.ts +45 -14
  305. package/dist/storage/profiles/ProfileRecords.d.ts.map +1 -1
  306. package/dist/storage/profiles/ProfileRecords.js +59 -4
  307. package/dist/storage/profiles/ProfileRecords.js.map +1 -1
  308. package/dist/storage/profiles/planSchema.d.ts +5 -5
  309. package/dist/storage/profiles/schema.d.ts +8 -8
  310. package/dist/types/cosmos-profile.d.ts +6 -6
  311. package/dist/types/cosmos.d.ts +10 -10
  312. package/dist/types/design-profile.d.ts +32 -32
  313. package/dist/types/guidance-references.d.ts +20 -20
  314. package/dist/types/guidance.d.ts +144 -144
  315. package/dist/types/reference-connectors.d.ts +12 -12
  316. package/dist/types/reference-onboarding.d.ts +58 -58
  317. package/dist/types/reference-pages.d.ts +8 -8
  318. package/dist/types/variant-reference.d.ts +4 -4
  319. package/dist/types/x-bookmarks.d.ts +16 -16
  320. package/dist/utils/cloneOrCopyDirSync.d.ts.map +1 -1
  321. package/dist/utils/cloneOrCopyDirSync.js +2 -0
  322. package/dist/utils/cloneOrCopyDirSync.js.map +1 -1
  323. package/dist/utils/editorAccess.d.ts +8 -0
  324. package/dist/utils/editorAccess.d.ts.map +1 -0
  325. package/dist/utils/editorAccess.js +23 -0
  326. package/dist/utils/editorAccess.js.map +1 -0
  327. package/dist/utils/hostedLogPrivacy.d.ts +2 -0
  328. package/dist/utils/hostedLogPrivacy.d.ts.map +1 -0
  329. package/dist/utils/hostedLogPrivacy.js +29 -0
  330. package/dist/utils/hostedLogPrivacy.js.map +1 -0
  331. package/dist/utils/hostedLogging.d.ts +2 -0
  332. package/dist/utils/hostedLogging.d.ts.map +1 -0
  333. package/dist/utils/hostedLogging.js +18 -0
  334. package/dist/utils/hostedLogging.js.map +1 -0
  335. package/dist/utils/loginShellPath.d.ts.map +1 -1
  336. package/dist/utils/loginShellPath.js +2 -0
  337. package/dist/utils/loginShellPath.js.map +1 -1
  338. package/dist/utils/skills/claude-skill.d.ts +1 -1
  339. package/dist/utils/skills/claude-skill.js +1 -1
  340. package/dist/utils/skills/cli-guidance.d.ts +1 -1
  341. package/dist/utils/skills/cli-guidance.d.ts.map +1 -1
  342. package/dist/utils/skills/cli-guidance.js +56 -27
  343. package/dist/utils/skills/cli-guidance.js.map +1 -1
  344. package/dist/utils/skills/codex-skill.d.ts +1 -1
  345. package/dist/utils/skills/codex-skill.d.ts.map +1 -1
  346. package/dist/utils/skills/codex-skill.js +6 -2
  347. package/dist/utils/skills/codex-skill.js.map +1 -1
  348. package/dist/utils/skills/cursor-rules.d.ts +1 -1
  349. package/dist/utils/skills/cursor-rules.js +1 -1
  350. package/dist/utils/subprocessEnvironment.d.ts +6 -0
  351. package/dist/utils/subprocessEnvironment.d.ts.map +1 -0
  352. package/dist/utils/subprocessEnvironment.js +214 -0
  353. package/dist/utils/subprocessEnvironment.js.map +1 -0
  354. package/package.json +8 -4
  355. package/src/ui/dist/assets/{LibraryEntry-BUwOgHmJ.js → LibraryEntry-DS6EDW1V.js} +2 -2
  356. package/src/ui/dist/assets/main-CdH16hGP.js +435 -0
  357. package/src/ui/dist/index.html +1 -1
  358. package/dist/routes/git.d.ts +0 -5
  359. package/dist/routes/git.d.ts.map +0 -1
  360. package/dist/routes/git.js +0 -261
  361. package/dist/routes/git.js.map +0 -1
  362. package/dist/services/CommitMessageGenerator.d.ts +0 -7
  363. package/dist/services/CommitMessageGenerator.d.ts.map +0 -1
  364. package/dist/services/CommitMessageGenerator.js +0 -16
  365. package/dist/services/CommitMessageGenerator.js.map +0 -1
  366. package/dist/services/LocalGitService.d.ts +0 -61
  367. package/dist/services/LocalGitService.d.ts.map +0 -1
  368. package/dist/services/LocalGitService.js +0 -561
  369. package/dist/services/LocalGitService.js.map +0 -1
  370. package/dist/services/PRTitleGenerator.d.ts +0 -9
  371. package/dist/services/PRTitleGenerator.d.ts.map +0 -1
  372. package/dist/services/PRTitleGenerator.js +0 -36
  373. package/dist/services/PRTitleGenerator.js.map +0 -1
  374. package/dist/services/SessionService.d.ts +0 -38
  375. package/dist/services/SessionService.d.ts.map +0 -1
  376. package/dist/services/SessionService.js +0 -189
  377. package/dist/services/SessionService.js.map +0 -1
  378. package/dist/utils/branchNames.d.ts +0 -2
  379. package/dist/utils/branchNames.d.ts.map +0 -1
  380. package/dist/utils/branchNames.js +0 -92
  381. package/dist/utils/branchNames.js.map +0 -1
  382. package/dist/utils/hostAgentEnv.d.ts +0 -2
  383. package/dist/utils/hostAgentEnv.d.ts.map +0 -1
  384. package/dist/utils/hostAgentEnv.js +0 -15
  385. package/dist/utils/hostAgentEnv.js.map +0 -1
  386. package/src/ui/dist/assets/main-DQKavyjz.js +0 -435
@@ -36,58 +36,32 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
36
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.handleMcpServe = exports.buildMcpServer = exports.isStaleAttachError = exports.isReferenceHost = void 0;
39
+ exports.handleMcpServe = exports.buildMcpServer = exports.isStaleAttachError = void 0;
40
+ const explorationTools_1 = require("../../mcp/explorationTools");
41
+ const designContextTools_1 = require("../../mcp/designContextTools");
40
42
  const fs_1 = __importDefault(require("fs"));
41
43
  const path_1 = __importDefault(require("path"));
42
44
  const util_1 = __importDefault(require("util"));
43
45
  const v3_1 = require("zod/v3");
44
- const design_library_1 = require("../../types/design-library");
45
46
  const envelope_1 = require("../envelope");
46
47
  const flags_1 = require("../flags");
47
48
  const shared_1 = require("./shared");
48
49
  const client_1 = require("../client");
49
- const contracts_1 = require("../../agent-variants/contracts");
50
50
  const ConfigManager_1 = require("../../services/ConfigManager");
51
51
  const handoff_1 = require("../handoff");
52
- const callerModel_1 = require("../callerModel");
53
52
  const telemetry_1 = require("../telemetry");
54
- const displayLocale_1 = require("../../utils/displayLocale");
55
53
  const pluginContext_1 = require("../../hosts/pluginContext");
56
54
  const errorMessage_1 = require("../../utils/errorMessage");
57
- const GuidanceVerifierRunner_1 = require("../../services/GuidanceVerifierRunner");
58
55
  const toolPresentation = (title, behavior) => ({
59
56
  title,
60
57
  annotations: { title, ...behavior },
61
58
  });
62
- const STATUS_PRESENTATION = toolPresentation('Check Rivet status', {
63
- readOnlyHint: true,
64
- destructiveHint: false,
65
- idempotentHint: true,
66
- openWorldHint: true,
67
- });
68
59
  const LOGIN_PRESENTATION = toolPresentation('Sign in to Rivet', {
69
60
  readOnlyHint: false,
70
61
  destructiveHint: false,
71
- idempotentHint: true,
72
- openWorldHint: true,
73
- });
74
- const VARIANTS_PRESENTATION = toolPresentation('Generate design variants', {
75
- readOnlyHint: false,
76
- destructiveHint: true,
77
62
  idempotentHint: false,
78
63
  openWorldHint: true,
79
64
  });
80
- const DESIGN_CONTEXT_PRESENTATION = toolPresentation('Gather design context', {
81
- readOnlyHint: false,
82
- destructiveHint: true,
83
- idempotentHint: false,
84
- openWorldHint: true,
85
- });
86
- const DIRECTION_TITLE_MAX_WORDS = 5;
87
- const DIRECTION_SUBTITLE_MAX_WORDS = 10;
88
- const RELEVANT_FILE_MAX_COUNT = 12;
89
- const SESSION_ID_SEARCH_MAX_DEPTH = 2;
90
- const DISPLAY_LOCALE = (0, displayLocale_1.resolveDisplayLocale)();
91
65
  const readPackageVersion = () => {
92
66
  try {
93
67
  const pkg = JSON.parse(fs_1.default.readFileSync(path_1.default.resolve(__dirname, '../../../package.json'), 'utf8'));
@@ -97,15 +71,6 @@ const readPackageVersion = () => {
97
71
  return '0.0.0';
98
72
  }
99
73
  };
100
- const isReferenceHost = (hostname) => {
101
- const host = hostname.toLowerCase();
102
- return (host === 'are.na' ||
103
- host.endsWith('.are.na') ||
104
- host === 'pin.it' ||
105
- host === 'pinterest.com' ||
106
- host.endsWith('.pinterest.com'));
107
- };
108
- exports.isReferenceHost = isReferenceHost;
109
74
  const isStaleAttachError = (envelope) => {
110
75
  if (envelope.ok) {
111
76
  return false;
@@ -140,31 +105,12 @@ const sessionIdInValue = (value, depth = 0) => {
140
105
  return undefined;
141
106
  };
142
107
  const sessionIdInEnvelope = (envelope) => envelope.ok ? sessionIdInValue(envelope.data) : undefined;
143
- const STATUS_DESCRIPTION = 'Current Rivet session state for this project: server health, active work with workIds, per-variant progress. ' +
144
- 'Read-only, fast (~10ms); poll after starting work — there is no blocking wait. ' +
145
- 'When the response has a nextAction, follow its instructions exactly. ' +
146
- '`variants.starting: true` = a start is still provisioning (can take minutes) — keep polling, never retry or cancel. ' +
147
- "include: ['history'] adds past variant sets; ['auth'] adds signed-in state.";
148
- const VARIANTS_DESCRIPTION = "Drive the variant lifecycle ('directions' in the UI). Actions: 'start' (generate N directions), " +
149
- "'complete' (report one work item done), 'commit' (write a chosen variant to the working tree), 'cancel'. " +
150
- "Before every 'start', including fresh apps, resolve saved instructions with rivet_design_context contextAction=resolve, then author a 1\u20133 word runLabel summarizing the batch and one brief per direction: label = 1\u20135 word title naming the concrete change; body = \u226410-word subtitle; " +
151
- `Write runLabel, label, and body naturally in ${DISPLAY_LOCALE}. ` +
152
- 'optional notes = richer implementation intent (tokens, motion specs, constraints) delivered verbatim to that direction\u2019s worker. briefs.length sets the count. ' +
153
- "Rivet normally builds directions with its own server-side workers: variants in flight with NO nextAction means watch rivet_status until terminal — implement nothing. When a response DOES carry nextAction.action='complete_host_variant_work' (executor unavailable), follow its parallelism instructions EXACTLY: they name the worker agent type when one applies, and each item's workerPrompt points at a server-authored briefing containing the full packet and completion command \u2014 compose nothing, never re-plan briefs, and let each worker self-report the moment it finishes. " +
154
- 'If a completion returns requeuedForRegeneration, poll rivet_status for the renewed lease, address the QA summary, and complete that item again. ' +
155
- "NEVER cancel to unblock a rejected start: 'start_in_flight' = still provisioning (poll until variants.starting clears); 'active_session' = the user has live work \u2014 report the conflict or refine via target. Cancel only when the user explicitly asks.";
156
108
  const LOGIN_DESCRIPTION = 'Sign the user in to Rivet with Google. Opens a browser sign-in, then waits (up to waitSeconds, default 45) for the user to finish and returns status signed_in with their email when they do — so a single call usually completes the whole sign-in. ' +
157
109
  'Call when any tool fails with AUTH_REQUIRED. If it returns status browser_opened instead, the user had not finished within the wait window: tell them to complete the browser sign-in, then call this again (it keeps waiting; the finished sign-in is never lost). ' +
158
110
  'Already signed in returns signed_in immediately.';
111
+ const SESSION_ID_SEARCH_MAX_DEPTH = 2;
159
112
  const LOGIN_WAIT_DEFAULT_SECONDS = 45;
160
113
  const LOGIN_WAIT_MAX_SECONDS = 240;
161
- const DESIGN_CONTEXT_DESCRIPTION = 'Resolve copied Design library references in one batch with profileAction reference, profileId, and referenceKeys (shortId@revision). Default results contain only key, title, imageCount, and hasAnalysis; no image reads or model work. Request isDetailed=true only for references whose full text, analysis, sources, and contextImages you need. View those images and attach them explicitly with rivet_variants contextImages when generating. ' +
162
- 'For reference onboarding, discover a public Cosmos profile URL or referenceProvider pinterest, arena, or x. If authorization_required, show authUrl and repeat discovery after sign-in. Plan selected collectionIds using discoveryId, show the scope and usage disclosure, then import planId with its planRevision and isApproved=true only after explicit user consent. Use onboardingAction later or dismiss with referenceProvider to set one provider preference, or omit referenceProvider for all. ' +
163
- 'Save Pinterest, Are.na, public Cosmos collections (including nested collections), or X bookmarks (https://x.com/i/bookmarks) with profileAction connect. If X returns authorization_required, show authUrl and repeat connect after sign-in. ' +
164
- 'Gather design context from a URL. Pinterest and Are.na URLs return the connected account’s ' +
165
- 'reference data (boards, pins, blocks); any other URL is rendered live and captured as visual ' +
166
- 'evidence (screenshot + rendered-page metadata). When Pinterest needs authorization, present the returned authUrl to the user and retry after they connect. Routing is automatic — just pass the URL. ' +
167
- 'Slow (seconds — network/render bound).';
168
114
  const buildMcpServer = async (options = {}) => {
169
115
  const { McpServer } = await Promise.resolve().then(() => __importStar(require('@modelcontextprotocol/sdk/server/mcp.js')));
170
116
  const { dispatch } = await Promise.resolve().then(() => __importStar(require('../router')));
@@ -174,7 +120,6 @@ const buildMcpServer = async (options = {}) => {
174
120
  ? path_1.default.resolve(options.projectPath)
175
121
  : undefined;
176
122
  (0, client_1.enableAttachCache)();
177
- void (0, client_1.attachToServer)(serveProject ?? process.cwd()).catch(() => null);
178
123
  void Promise.allSettled([
179
124
  Promise.resolve().then(() => __importStar(require('./status'))),
180
125
  Promise.resolve().then(() => __importStar(require('./variants'))),
@@ -196,7 +141,6 @@ const buildMcpServer = async (options = {}) => {
196
141
  const project = toolProject ?? serveProject;
197
142
  return project ? ['--project', project] : [];
198
143
  };
199
- const verificationAbort = new AbortController();
200
144
  const runCommand = async (command, rest, commandOptions = {}) => {
201
145
  const progress = [];
202
146
  const io = {
@@ -205,13 +149,13 @@ const buildMcpServer = async (options = {}) => {
205
149
  };
206
150
  const argv = [
207
151
  ...rest,
152
+ ...(options.noTelemetry ? ['--no-telemetry'] : []),
208
153
  ...handoffArgs,
209
154
  ...(commandOptions.handoffArgs ?? []),
210
155
  ];
211
156
  const startedAt = Date.now();
212
157
  let result;
213
158
  try {
214
- await maybeResumePendingLogin();
215
159
  result = await dispatch(command, argv, io, {
216
160
  signal: commandOptions.signal,
217
161
  });
@@ -245,29 +189,13 @@ const buildMcpServer = async (options = {}) => {
245
189
  catch { }
246
190
  return { envelope: result.envelope, progress };
247
191
  };
248
- const maybeResumePendingLogin = async () => {
249
- try {
250
- const { readPendingLogin } = await Promise.resolve().then(() => __importStar(require('../../services/pendingLogin')));
251
- if (!readPendingLogin()) {
252
- return;
253
- }
254
- const { AuthService } = await Promise.resolve().then(() => __importStar(require('../../services/AuthService')));
255
- const resumed = await new AuthService().resumePendingLogin();
256
- if (resumed?.success) {
257
- telemetry?.track('mcp_login_completed', {
258
- resumed: true,
259
- });
260
- }
261
- }
262
- catch { }
263
- };
264
192
  const toToolResult = (envelope, progress = []) => {
265
193
  const enriched = !envelope.ok && envelope.error.code === 'AUTH_REQUIRED'
266
194
  ? {
267
195
  ...envelope,
268
196
  error: {
269
197
  ...envelope.error,
270
- signIn: 'Call the rivet_login tool — it opens a browser sign-in for the user and their session is picked up automatically afterwards.',
198
+ signIn: 'Call the rivet_login tool — it opens a browser sign-in for the user and call rivet_login again if the browser sign-in is still pending.',
271
199
  },
272
200
  }
273
201
  : envelope;
@@ -347,73 +275,11 @@ const buildMcpServer = async (options = {}) => {
347
275
  return result;
348
276
  });
349
277
  };
350
- mcp.registerTool('rivet_status', {
351
- ...STATUS_PRESENTATION,
352
- description: STATUS_DESCRIPTION,
353
- inputSchema: {
354
- project: v3_1.z
355
- .string()
356
- .optional()
357
- .describe('Project root path; defaults to the server for the current directory'),
358
- include: v3_1.z
359
- .array(v3_1.z.enum(['history', 'auth']))
360
- .optional()
361
- .describe('history = committed/past variant sets; auth = signed-in state'),
362
- },
363
- }, async ({ project, include }) => {
364
- const startedAt = Date.now();
365
- const wantHistory = include?.includes('history') ?? false;
366
- const wantAuth = include?.includes('auth') ?? false;
367
- const [primary, history, auth] = await Promise.all([
368
- runCommand('status', projectArgs(project)),
369
- wantHistory
370
- ? runCommand('variants', [
371
- 'list',
372
- '--history',
373
- ...projectArgs(project),
374
- ])
375
- : Promise.resolve(null),
376
- wantAuth ? runCommand('auth', ['status']) : Promise.resolve(null),
377
- ]);
378
- if (!primary.envelope.ok) {
379
- return completeToolCall({
380
- toolName: 'rivet_status',
381
- startedAt,
382
- envelope: primary.envelope,
383
- progress: primary.progress,
384
- });
385
- }
386
- const data = { status: primary.envelope.data };
387
- if (history) {
388
- data.history = history.envelope.ok
389
- ? history.envelope.data
390
- : { error: history.envelope.error };
391
- }
392
- if (auth) {
393
- data.auth = auth.envelope.ok
394
- ? auth.envelope.data
395
- : { error: auth.envelope.error };
396
- const authData = data.auth;
397
- if (authData && authData.authenticated === false) {
398
- data.auth.signIn =
399
- 'Call the rivet_login tool — it opens a browser sign-in for the user and returns immediately; the finished sign-in is picked up automatically on the next call.';
400
- }
401
- }
402
- return completeToolCall({
403
- toolName: 'rivet_status',
404
- startedAt,
405
- envelope: {
406
- schemaVersion: envelope_1.CLI_SCHEMA_VERSION,
407
- ok: true,
408
- command: 'rivet_status',
409
- data,
410
- },
411
- });
412
- });
413
278
  mcp.registerTool('rivet_login', {
414
279
  ...LOGIN_PRESENTATION,
415
280
  description: LOGIN_DESCRIPTION,
416
- inputSchema: {
281
+ inputSchema: v3_1.z
282
+ .object({
417
283
  waitSeconds: v3_1.z
418
284
  .number()
419
285
  .int()
@@ -421,7 +287,8 @@ const buildMcpServer = async (options = {}) => {
421
287
  .max(LOGIN_WAIT_MAX_SECONDS)
422
288
  .optional()
423
289
  .describe('How long to wait for the user to finish the browser sign-in before returning (default 45). Pass a higher value when the user says they need a moment; 0 returns immediately after opening the browser.'),
424
- },
290
+ })
291
+ .strict(),
425
292
  }, async ({ waitSeconds }) => {
426
293
  const startedAt = Date.now();
427
294
  const loginResult = (data, ok = true) => {
@@ -516,607 +383,19 @@ const buildMcpServer = async (options = {}) => {
516
383
  }, false);
517
384
  }
518
385
  });
519
- mcp.registerTool('rivet_variants', {
520
- ...VARIANTS_PRESENTATION,
521
- description: VARIANTS_DESCRIPTION,
522
- inputSchema: {
523
- action: v3_1.z.enum(['start', 'complete', 'commit', 'cancel']),
524
- instruction: v3_1.z
525
- .string()
526
- .optional()
527
- .describe('start: what to vary and how'),
528
- runLabel: contracts_1.runLabelSchema.describe('start: AI-authored 1–3 word summary shared by every direction in this batch'),
529
- count: v3_1.z
530
- .number()
531
- .int()
532
- .positive()
533
- .optional()
534
- .describe('start: number of variants'),
535
- briefs: v3_1.z
536
- .array(v3_1.z.object({
537
- label: v3_1.z
538
- .string()
539
- .trim()
540
- .min(1)
541
- .max(48)
542
- .refine((label) => label.split(/\s+/).length <= DIRECTION_TITLE_MAX_WORDS, {
543
- message: 'Direction titles must contain at most 5 words',
544
- })
545
- .describe('AI-authored 1–5 word direction title'),
546
- body: v3_1.z
547
- .string()
548
- .trim()
549
- .min(1)
550
- .max(600)
551
- .refine((body) => body.split(/\s+/).length <= DIRECTION_SUBTITLE_MAX_WORDS, {
552
- message: 'Direction subtitles must contain at most 10 words',
553
- })
554
- .describe('Concise direction subtitle of at most 10 words'),
555
- notes: v3_1.z
556
- .string()
557
- .trim()
558
- .min(1)
559
- .max(4000)
560
- .optional()
561
- .describe('Optional implementation notes for this direction, passed verbatim to its worker (design tokens, motion specs, constraints). Not shown in UI chips.'),
562
- visualReferenceUrl: v3_1.z.string().url().optional(),
563
- }))
564
- .min(contracts_1.VARIANT_COUNT_MIN)
565
- .max(contracts_1.VARIANT_COUNT_MAX)
566
- .superRefine((briefs, context) => {
567
- const labels = briefs.map((brief) => brief.label.toLowerCase());
568
- if (new Set(labels).size !== labels.length) {
569
- context.addIssue({
570
- code: v3_1.z.ZodIssueCode.custom,
571
- message: 'Direction titles must be distinct',
572
- });
573
- }
574
- })
575
- .optional()
576
- .describe('start: one AI-authored title/subtitle brief per direction; use one for a single visualization or distinct briefs for divergent ideas; briefs.length sets the variant count'),
577
- element: v3_1.z
578
- .string()
579
- .optional()
580
- .describe('start: CSS selector scoping the variation'),
581
- files: v3_1.z
582
- .array(v3_1.z.string().trim().min(1))
583
- .max(RELEVANT_FILE_MAX_COUNT)
584
- .optional()
585
- .describe('start: known project files for workers to inspect before broader discovery'),
586
- fresh: v3_1.z
587
- .boolean()
588
- .optional()
589
- .describe('start: ignore prior variant context'),
590
- profile: v3_1.z
591
- .enum(['auto', 'off'])
592
- .optional()
593
- .describe('start: saved references are off by default; auto selects relevant references when the user asks for them'),
594
- guidance: v3_1.z
595
- .enum(['auto', 'off'])
596
- .optional()
597
- .describe('start: apply saved instructions, or turn them off for this request only'),
598
- excludedGuidanceIds: v3_1.z
599
- .array(v3_1.z.string().min(1).max(200))
600
- .optional()
601
- .describe('start: saved instruction document IDs to exclude for this request only'),
602
- fidelity: v3_1.z
603
- .enum(['low', 'medium', 'high'])
604
- .optional()
605
- .describe("start: the user's design-fidelity intent. low = fast sketch-grade workers (quick ideas/explorations); medium = balanced; high = the default with maximum deliberation, up to a few minutes (polished/pixel-perfect/final asks). Omit when unstated."),
606
- workerProvider: v3_1.z
607
- .enum(['claude', 'codex', 'cursor'])
608
- .optional()
609
- .describe('start: run the workers on this provider CLI instead of the one matching your caller agent. Pass ONLY when the user explicitly asks ("use opus for the workers") — it spends on that provider\'s subscription, so never infer it.'),
610
- workerModel: v3_1.z
611
- .string()
612
- .trim()
613
- .min(1)
614
- .max(200)
615
- .optional()
616
- .describe('start: pin the worker model id for the selected (or caller-matching) provider. Pass ONLY on an explicit user request; a pinned model never silently falls back.'),
617
- contextImages: v3_1.z
618
- .array(v3_1.z.string().trim().min(1))
619
- .min(1)
620
- .optional()
621
- .describe('start: local reference image file paths (png/jpg/webp/gif/avif). Rivet copies them into the run context and every worker views them natively — pass the actual images instead of describing them in notes.'),
622
- contextAssets: v3_1.z
623
- .array(contracts_1.contextAssetInputSchema)
624
- .min(1)
625
- .max(contracts_1.CONTEXT_ASSET_MAX_ITEMS)
626
- .optional()
627
- .describe('start: local regular files copied into every variant workspace and exposed to workers with stable file and reference paths.'),
628
- referencePages: v3_1.z
629
- .array(v3_1.z.string().trim().min(1))
630
- .min(1)
631
- .max(3)
632
- .optional()
633
- .describe('start (fresh only): reference page URLs. Rivet renders each page server-side (design evidence + screenshot) — pass the raw URLs, never capture evidence or screenshot pages yourself.'),
634
- referenceVideos: v3_1.z
635
- .array(v3_1.z.string().trim().min(1))
636
- .min(1)
637
- .max(2)
638
- .optional()
639
- .describe('start (fresh only): local reference video file paths (mp4/mov/webm/m4v). Rivet samples keyframes server-side — pass the raw paths, never run ffmpeg yourself.'),
640
- target: v3_1.z
641
- .string()
642
- .optional()
643
- .describe('start: sessionId:variantId — refine an existing variant in place'),
644
- workId: v3_1.z.string().optional().describe('complete: host work item id'),
645
- status: v3_1.z
646
- .enum(['succeeded', 'failed', 'cancelled'])
647
- .optional()
648
- .describe('complete: terminal work status'),
649
- output: v3_1.z
650
- .unknown()
651
- .optional()
652
- .describe('complete: optional orchestrator output payload'),
653
- error: v3_1.z.string().optional().describe('complete: failure message'),
654
- title: v3_1.z
655
- .string()
656
- .optional()
657
- .describe('complete: optional variant title'),
658
- description: v3_1.z
659
- .string()
660
- .optional()
661
- .describe('complete: optional variant description'),
662
- variantId: v3_1.z
663
- .string()
664
- .optional()
665
- .describe('commit: the variant to write into the working tree'),
666
- sessionId: v3_1.z
667
- .string()
668
- .optional()
669
- .describe('complete/commit: source session (optional) · cancel: session to cancel (required)'),
670
- project: v3_1.z.string().optional().describe('Project root path'),
671
- },
672
- }, async ({ action, instruction, runLabel, count, briefs, element, files, fresh, fidelity, profile, guidance, excludedGuidanceIds, workerProvider, workerModel, contextImages, contextAssets, referencePages, referenceVideos, target, workId, status, output, error, title, description, variantId, sessionId, project, }, extra) => {
673
- const startedAt = Date.now();
674
- let rest;
675
- if (action === 'start') {
676
- if (!briefs) {
677
- return completeToolCall({
678
- toolName: 'rivet_variants',
679
- operation: action,
680
- startedAt,
681
- envelope: (0, envelope_1.errorResult)('rivet_variants', 'USAGE_ERROR', 'rivet_variants action=start requires briefs with one AI-authored title/subtitle per direction, including fresh starts.').envelope,
682
- });
683
- }
684
- if (!runLabel) {
685
- return completeToolCall({
686
- toolName: 'rivet_variants',
687
- operation: action,
688
- startedAt,
689
- envelope: (0, envelope_1.errorResult)('rivet_variants', 'USAGE_ERROR', 'rivet_variants action=start requires runLabel with an AI-authored 1–3 word batch summary, including fresh starts.').envelope,
690
- });
691
- }
692
- rest = [
693
- 'start',
694
- ...(instruction !== undefined ? ['--instruction', instruction] : []),
695
- ...(runLabel !== undefined ? ['--run-label', runLabel] : []),
696
- ...(count !== undefined ? ['--count', String(count)] : []),
697
- ...(briefs !== undefined ? ['--briefs', JSON.stringify(briefs)] : []),
698
- ...(element !== undefined ? ['--element', element] : []),
699
- ...(files !== undefined ? ['--files', JSON.stringify(files)] : []),
700
- ...(fresh ? ['--fresh'] : []),
701
- ...(profile ? ['--profile', profile] : []),
702
- ...(guidance ? ['--guidance', guidance] : []),
703
- ...(excludedGuidanceIds !== undefined
704
- ? ['--exclude-guidance', JSON.stringify(excludedGuidanceIds)]
705
- : []),
706
- ...(fidelity !== undefined ? ['--fidelity', fidelity] : []),
707
- ...(workerProvider !== undefined
708
- ? ['--worker-provider', workerProvider]
709
- : []),
710
- ...(workerModel !== undefined ? ['--worker-model', workerModel] : []),
711
- ...(contextImages !== undefined
712
- ? ['--context-images', JSON.stringify(contextImages)]
713
- : []),
714
- ...(contextAssets !== undefined
715
- ? ['--context-assets', JSON.stringify(contextAssets)]
716
- : []),
717
- ...(referencePages !== undefined
718
- ? ['--reference-pages', JSON.stringify(referencePages)]
719
- : []),
720
- ...(referenceVideos !== undefined
721
- ? ['--reference-videos', JSON.stringify(referenceVideos)]
722
- : []),
723
- ...(target !== undefined ? ['--target', target] : []),
724
- ];
725
- }
726
- else if (action === 'commit') {
727
- rest = [
728
- 'commit',
729
- ...(variantId !== undefined ? [variantId] : []),
730
- ...(sessionId !== undefined ? ['--session', sessionId] : []),
731
- ];
732
- }
733
- else if (action === 'complete') {
734
- rest = [
735
- 'complete',
736
- ...(workId !== undefined ? [workId] : []),
737
- ...(sessionId !== undefined ? ['--session', sessionId] : []),
738
- ...(status !== undefined ? ['--status', status] : []),
739
- ...(output !== undefined ? ['--output', JSON.stringify(output)] : []),
740
- ...(error !== undefined ? ['--error', error] : []),
741
- ...(title !== undefined ? ['--title', title] : []),
742
- ...(description !== undefined ? ['--description', description] : []),
743
- ];
744
- }
745
- else {
746
- rest = ['cancel', ...(sessionId !== undefined ? [sessionId] : [])];
747
- }
748
- const { envelope, progress } = await runCommand('variants', [...rest, ...projectArgs(project)], { handoffArgs: (0, callerModel_1.callerModelArgsFromToolMeta)(extra._meta) });
749
- return completeToolCall({
750
- toolName: 'rivet_variants',
751
- operation: action,
752
- startedAt,
753
- envelope,
754
- progress,
755
- sessionId: sessionId ??
756
- (target !== undefined ? target.split(':')[0] : undefined),
757
- });
758
- });
759
- mcp.registerTool('rivet_design_context', {
760
- ...DESIGN_CONTEXT_PRESENTATION,
761
- description: DESIGN_CONTEXT_DESCRIPTION,
762
- inputSchema: {
763
- contextAction: v3_1.z
764
- .enum([
765
- 'add',
766
- 'list',
767
- 'show',
768
- 'update',
769
- 'enable',
770
- 'disable',
771
- 'remove',
772
- 'resolve',
773
- 'inspect',
774
- 'verifier',
775
- 'verify',
776
- ])
777
- .optional()
778
- .describe('Manage saved instructions applied across projects. verifier retrieves one source and its checking recipe without execution; verify explicitly runs a saved executable package locally against project and contextVerifierInput. No automatic verification. Separate from optional reference profiles; lookup uses no model.'),
779
- contextId: v3_1.z
780
- .string()
781
- .min(1)
782
- .max(200)
783
- .optional()
784
- .describe('Saved instruction document ID for show, update, enable, disable, remove, verifier, or verify'),
785
- contextFile: v3_1.z
786
- .string()
787
- .min(1)
788
- .optional()
789
- .describe('Local UTF-8 Markdown file copied when adding or updating saved instructions'),
790
- contextVerifier: v3_1.z
791
- .string()
792
- .min(1)
793
- .optional()
794
- .describe('update: local UTF-8 Markdown verifier recipe, saved only after the user agrees to reuse it; requires contextSourceDigest'),
795
- contextVerifierPackage: v3_1.z
796
- .string()
797
- .min(1)
798
- .optional()
799
- .describe('update: local JSON manifest {runtime:"node",entrypoint:"verify.mjs",files:[{name,path}]} for trusted local executable code retained beside contextVerifier; no dependency installation'),
800
- contextVerifierInput: v3_1.z
801
- .string()
802
- .min(1)
803
- .optional()
804
- .describe('verify: required local JSON object with package-specific target URL, selectors, modes and prerequisites; explicit local execution, not a sandbox'),
805
- contextSourceDigest: v3_1.z
806
- .string()
807
- .regex(/^[a-f0-9]{64}$/)
808
- .optional()
809
- .describe('update: exact sourceDigest from contextAction verifier, binding the recipe to the source inspected'),
810
- removeContextVerifier: v3_1.z
811
- .boolean()
812
- .optional()
813
- .describe('update: remove only the saved verifier recipe, preserving its source'),
814
- contextReferences: v3_1.z
815
- .string()
816
- .min(1)
817
- .optional()
818
- .describe('Local JSON reference manifest for context add/update. Entries are {kind:"url"|"repository",url,intent,revision?,files?:[{name,path}]} or {kind:"directory",path,intent}. Repository URLs default to URL-only; existing local repositories or installed libraries use directory pointers without cloning or copying contents. Directory paths resolve relative to the manifest and remain live read-only sources, not snapshots. Omit files and additional setup Markdown unless the user explicitly requests a snapshot or approves a file selection. URLs are not fetched; this does not authorize source ingestion.'),
819
- guidance: v3_1.z
820
- .enum(['auto', 'off'])
821
- .optional()
822
- .describe('resolve: selection mode for this read only'),
823
- excludedGuidanceIds: v3_1.z
824
- .array(v3_1.z.string().min(1).max(200))
825
- .optional()
826
- .describe('resolve: saved instruction document IDs to exclude for this read only'),
827
- url: v3_1.z
828
- .string()
829
- .optional()
830
- .describe('The URL to gather design context from'),
831
- profileAction: v3_1.z
832
- .enum([
833
- 'status',
834
- 'diagnostics',
835
- 'rebuild-index',
836
- 'enable',
837
- 'disable',
838
- 'connect',
839
- 'refresh',
840
- 'pause',
841
- 'resume',
842
- 'retry',
843
- 'add-text',
844
- 'add-images',
845
- 'pins',
846
- 'add-variant',
847
- 'references',
848
- 'reference',
849
- 'include',
850
- 'exclude',
851
- 'remove',
852
- 'suggest',
853
- 'inspect',
854
- 'discover',
855
- 'plan',
856
- 'import',
857
- 'onboarding',
858
- ])
859
- .optional()
860
- .describe('Manage the local cross-project design profile instead of fetching a URL. sourceId also identifies a job for pause/resume/retry.'),
861
- title: v3_1.z.string().optional(),
862
- text: v3_1.z.string().optional(),
863
- files: v3_1.z.array(v3_1.z.string()).optional(),
864
- query: v3_1.z.string().optional(),
865
- sourceId: v3_1.z.string().optional(),
866
- profileId: v3_1.z
867
- .string()
868
- .uuid()
869
- .optional()
870
- .describe('Library identity from the copied command'),
871
- referenceKeys: v3_1.z
872
- .array(v3_1.z.string())
873
- .min(1)
874
- .max(design_library_1.DESIGN_REFERENCE_BATCH_LIMIT)
875
- .optional()
876
- .describe('One or more copied shortId@revision keys to resolve in a single query'),
877
- isDetailed: v3_1.z
878
- .boolean()
879
- .optional()
880
- .describe('Include full saved text, analysis, sources, and validated image paths; default metadata only'),
881
- discoveryId: v3_1.z
882
- .string()
883
- .uuid()
884
- .optional()
885
- .describe('Saved discovery to plan selected collections from'),
886
- planId: v3_1.z
887
- .string()
888
- .uuid()
889
- .optional()
890
- .describe('Saved plan to inspect or explicitly approve'),
891
- planRevision: v3_1.z
892
- .string()
893
- .optional()
894
- .describe('Exact revision shown in the reviewed plan'),
895
- collectionIds: v3_1.z.array(v3_1.z.string()).optional(),
896
- isApproved: v3_1.z
897
- .boolean()
898
- .optional()
899
- .describe('Set true only after the user approves the displayed scope and agent usage'),
900
- onboardingAction: v3_1.z.enum(['later', 'dismiss', 'reset']).optional(),
901
- referenceProvider: v3_1.z
902
- .enum(['cosmos', 'pinterest', 'arena', 'x'])
903
- .optional()
904
- .describe('Provider to discover or set onboarding preferences for. Cosmos discovery requires its public profile URL.'),
905
- requestId: v3_1.z
906
- .string()
907
- .min(1)
908
- .max(200)
909
- .optional()
910
- .describe('Top-level workId from variants start to inspect, or suggestion request identity'),
911
- projectId: v3_1.z
912
- .string()
913
- .optional()
914
- .describe('Stable library project ID for pins or add-variant'),
915
- variantRef: v3_1.z
916
- .string()
917
- .optional()
918
- .describe('Exact sessionId:variantId to save as profile context'),
919
- note: v3_1.z.string().optional(),
920
- imageFile: v3_1.z
921
- .string()
922
- .optional()
923
- .describe('Supplied screenshot for a direction without a saved static preview'),
924
- runtime: v3_1.z.enum(['codex', 'claude', 'cursor']).optional(),
925
- screenshot: v3_1.z
926
- .boolean()
927
- .optional()
928
- .describe('Capture a screenshot (render path only)'),
929
- width: v3_1.z
930
- .number()
931
- .int()
932
- .positive()
933
- .optional()
934
- .describe('Viewport width (render path only)'),
935
- height: v3_1.z
936
- .number()
937
- .int()
938
- .positive()
939
- .optional()
940
- .describe('Viewport height (render path only)'),
941
- project: v3_1.z.string().optional().describe('Project root path'),
942
- },
943
- }, async ({ url, contextAction, contextId, contextFile, contextReferences, contextVerifier, contextVerifierPackage, contextVerifierInput, contextSourceDigest, removeContextVerifier, guidance, excludedGuidanceIds, screenshot, width, height, project, profileAction, title, text, files, query, sourceId, profileId, referenceKeys, isDetailed, discoveryId, planId, planRevision, collectionIds, isApproved, onboardingAction, referenceProvider, requestId, projectId, variantRef, note, imageFile, runtime, }, extra) => {
944
- const startedAt = Date.now();
945
- const hasVerifierUpdate = contextVerifier !== undefined ||
946
- contextVerifierPackage !== undefined ||
947
- contextSourceDigest !== undefined ||
948
- removeContextVerifier === true;
949
- if (contextVerifierInput !== undefined && contextAction !== 'verify')
950
- return completeToolCall({
951
- toolName: 'rivet_design_context',
952
- operation: 'context.verify',
953
- startedAt,
954
- envelope: (0, envelope_1.errorResult)('context.verify', 'USAGE_ERROR', 'contextVerifierInput requires contextAction verify').envelope,
955
- });
956
- if (hasVerifierUpdate && contextAction !== 'update')
957
- return completeToolCall({
958
- toolName: 'rivet_design_context',
959
- operation: 'context.update',
960
- startedAt,
961
- envelope: (0, envelope_1.errorResult)('context.update', 'USAGE_ERROR', 'Verifier changes require contextAction update').envelope,
962
- });
963
- if (contextAction) {
964
- if (profileAction || url) {
965
- return completeToolCall({
966
- toolName: 'rivet_design_context',
967
- operation: `context.${contextAction}`,
968
- startedAt,
969
- envelope: (0, envelope_1.errorResult)('context', 'USAGE_ERROR', 'Choose contextAction without profileAction or url').envelope,
970
- });
971
- }
972
- const isDocumentAction = [
973
- 'show',
974
- 'update',
975
- 'enable',
976
- 'disable',
977
- 'remove',
978
- 'verifier',
979
- 'verify',
980
- ].includes(contextAction);
981
- const isWriteAction = contextAction === 'add' || contextAction === 'update';
982
- const isResolveAction = contextAction === 'resolve';
983
- const result = await runCommand('context', [
984
- contextAction,
985
- ...(isDocumentAction && contextId !== undefined ? [contextId] : []),
986
- ...(contextAction === 'inspect' && requestId !== undefined
987
- ? [requestId]
988
- : []),
989
- ...(isWriteAction && title !== undefined ? ['--title', title] : []),
990
- ...(isWriteAction && contextFile !== undefined
991
- ? ['--file', contextFile]
992
- : []),
993
- ...(isWriteAction && contextReferences !== undefined
994
- ? ['--references', contextReferences]
995
- : []),
996
- ...(contextVerifier !== undefined
997
- ? ['--verifier', contextVerifier]
998
- : []),
999
- ...(contextVerifierPackage !== undefined
1000
- ? ['--verifier-package', contextVerifierPackage]
1001
- : []),
1002
- ...(contextVerifierInput !== undefined
1003
- ? ['--input', contextVerifierInput]
1004
- : []),
1005
- ...(contextSourceDigest !== undefined
1006
- ? ['--source-digest', contextSourceDigest]
1007
- : []),
1008
- ...(removeContextVerifier ? ['--remove-verifier'] : []),
1009
- ...(isResolveAction && guidance !== undefined
1010
- ? ['--guidance', guidance]
1011
- : []),
1012
- ...(isResolveAction && excludedGuidanceIds !== undefined
1013
- ? ['--exclude-guidance', JSON.stringify(excludedGuidanceIds)]
1014
- : []),
1015
- ...projectArgs(project),
1016
- ], { signal: AbortSignal.any([extra.signal, verificationAbort.signal]) });
1017
- return completeToolCall({
1018
- toolName: 'rivet_design_context',
1019
- operation: `context.${contextAction}`,
1020
- startedAt,
1021
- envelope: result.envelope,
1022
- progress: result.progress,
1023
- });
1024
- }
1025
- if (profileAction) {
1026
- const result = await runCommand('profile', [
1027
- profileAction,
1028
- ...(profileAction === 'reference'
1029
- ? [
1030
- ...(profileId ? [profileId] : []),
1031
- ...(referenceKeys ?? []),
1032
- ...(isDetailed ? ['--detail'] : []),
1033
- ]
1034
- : []),
1035
- ...(profileAction === 'connect' && url ? [url] : []),
1036
- ...(profileAction === 'discover' && (url ?? referenceProvider)
1037
- ? [String(url ?? referenceProvider)]
1038
- : []),
1039
- ...(profileAction === 'onboarding' && referenceProvider
1040
- ? ['--provider', referenceProvider]
1041
- : []),
1042
- ...(profileAction === 'plan' && (discoveryId ?? planId)
1043
- ? [String(discoveryId ?? planId)]
1044
- : []),
1045
- ...(profileAction === 'import' && planId ? [planId] : []),
1046
- ...(profileAction === 'onboarding' && onboardingAction
1047
- ? [onboardingAction]
1048
- : []),
1049
- ...(collectionIds
1050
- ? ['--collections', JSON.stringify(collectionIds)]
1051
- : []),
1052
- ...(planRevision ? ['--revision', planRevision] : []),
1053
- ...(isApproved === true ? ['--approve'] : []),
1054
- ...(sourceId ? [sourceId] : []),
1055
- ...(profileAction === 'inspect' && requestId ? [requestId] : []),
1056
- ...(profileAction === 'suggest' && requestId
1057
- ? ['--request-id', requestId]
1058
- : []),
1059
- ...(profileAction === 'add-variant' && variantRef
1060
- ? [variantRef]
1061
- : []),
1062
- ...(projectId ? ['--project-id', projectId] : []),
1063
- ...(note !== undefined ? ['--note', note] : []),
1064
- ...(imageFile ? ['--image-file', imageFile] : []),
1065
- ...(runtime ? ['--runtime', runtime] : []),
1066
- ...(title ? ['--title', title] : []),
1067
- ...(text ? ['--text', text] : []),
1068
- ...(files ? ['--files', JSON.stringify(files)] : []),
1069
- ...(query ? ['--query', query] : []),
1070
- ...projectArgs(project),
1071
- ]);
1072
- return completeToolCall({
1073
- toolName: 'rivet_design_context',
1074
- operation: `profile.${profileAction}`,
1075
- startedAt,
1076
- envelope: result.envelope,
1077
- progress: result.progress,
1078
- });
1079
- }
1080
- let hostname;
1081
- try {
1082
- if (!url)
1083
- throw new Error('A URL or profileAction is required');
1084
- hostname = new URL(url).hostname;
1085
- }
1086
- catch {
1087
- return completeToolCall({
1088
- toolName: 'rivet_design_context',
1089
- startedAt,
1090
- envelope: (0, envelope_1.errorResult)('design_context', 'USAGE_ERROR', `Not a valid URL: ${url}`).envelope,
1091
- });
1092
- }
1093
- const { envelope, progress } = (0, exports.isReferenceHost)(hostname)
1094
- ? await runCommand('reference', ['fetch', url, ...projectArgs(project)])
1095
- : await runCommand('evidence', [
1096
- 'capture',
1097
- '--url',
1098
- url,
1099
- ...(screenshot ? ['--screenshot'] : []),
1100
- ...(width !== undefined ? ['--width', String(width)] : []),
1101
- ...(height !== undefined ? ['--height', String(height)] : []),
1102
- ...projectArgs(project),
1103
- ]);
1104
- return completeToolCall({
1105
- toolName: 'rivet_design_context',
1106
- operation: (0, telemetry_1.designContextKindForEnvelope)(envelope) ??
1107
- ((0, exports.isReferenceHost)(hostname) ? 'reference' : 'website'),
1108
- startedAt,
1109
- envelope,
1110
- progress,
1111
- });
1112
- });
386
+ const dependencies = {
387
+ mcp,
388
+ runCommand,
389
+ projectArgs,
390
+ completeToolCall,
391
+ serveProject,
392
+ callerAgent: callerFields.callerAgent,
393
+ };
394
+ (0, explorationTools_1.registerExplorationTools)(dependencies);
395
+ (0, designContextTools_1.registerDesignContextTools)(dependencies);
1113
396
  return {
1114
397
  mcp,
1115
398
  telemetry,
1116
- cancelVerifications: async () => {
1117
- verificationAbort.abort();
1118
- await (0, GuidanceVerifierRunner_1.cancelGuidanceVerifications)();
1119
- },
1120
399
  };
1121
400
  };
1122
401
  exports.buildMcpServer = buildMcpServer;
@@ -1181,9 +460,7 @@ const handleMcpServe = async (rest, io) => {
1181
460
  if (isClosing)
1182
461
  return;
1183
462
  isClosing = true;
1184
- void built
1185
- .cancelVerifications()
1186
- .then(() => built.telemetry?.shutdown())
463
+ void Promise.resolve(built.telemetry?.shutdown())
1187
464
  .catch(() => { })
1188
465
  .finally(() => process.exit(0));
1189
466
  };