rivet-design 0.9.1 → 0.9.3

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 (138) hide show
  1. package/dist/mcp/agent-variants/SessionStore.d.ts +63 -2
  2. package/dist/mcp/agent-variants/SessionStore.d.ts.map +1 -1
  3. package/dist/mcp/agent-variants/SessionStore.js +331 -71
  4. package/dist/mcp/agent-variants/SessionStore.js.map +1 -1
  5. package/dist/mcp/agent-variants/WorktreeOrchestrator.d.ts +197 -8
  6. package/dist/mcp/agent-variants/WorktreeOrchestrator.d.ts.map +1 -1
  7. package/dist/mcp/agent-variants/WorktreeOrchestrator.js +805 -46
  8. package/dist/mcp/agent-variants/WorktreeOrchestrator.js.map +1 -1
  9. package/dist/mcp/agent-variants/contracts.d.ts +1101 -9
  10. package/dist/mcp/agent-variants/contracts.d.ts.map +1 -1
  11. package/dist/mcp/agent-variants/contracts.js +131 -5
  12. package/dist/mcp/agent-variants/contracts.js.map +1 -1
  13. package/dist/mcp/agent-variants/createZeroToOneTool.d.ts +205 -0
  14. package/dist/mcp/agent-variants/createZeroToOneTool.d.ts.map +1 -0
  15. package/dist/mcp/agent-variants/createZeroToOneTool.js +295 -0
  16. package/dist/mcp/agent-variants/createZeroToOneTool.js.map +1 -0
  17. package/dist/mcp/agent-variants/designContextStore.d.ts +160 -0
  18. package/dist/mcp/agent-variants/designContextStore.d.ts.map +1 -0
  19. package/dist/mcp/agent-variants/designContextStore.js +295 -0
  20. package/dist/mcp/agent-variants/designContextStore.js.map +1 -0
  21. package/dist/mcp/agent-variants/elementRefToTarget.d.ts +21 -0
  22. package/dist/mcp/agent-variants/elementRefToTarget.d.ts.map +1 -0
  23. package/dist/mcp/agent-variants/elementRefToTarget.js +47 -0
  24. package/dist/mcp/agent-variants/elementRefToTarget.js.map +1 -0
  25. package/dist/mcp/agent-variants/errors.d.ts +1 -1
  26. package/dist/mcp/agent-variants/errors.d.ts.map +1 -1
  27. package/dist/mcp/agent-variants/errors.js +6 -0
  28. package/dist/mcp/agent-variants/errors.js.map +1 -1
  29. package/dist/mcp/agent-variants/index.d.ts +4 -1
  30. package/dist/mcp/agent-variants/index.d.ts.map +1 -1
  31. package/dist/mcp/agent-variants/index.js +7 -1
  32. package/dist/mcp/agent-variants/index.js.map +1 -1
  33. package/dist/mcp/agent-variants/inspirationDesignContext.d.ts +430 -0
  34. package/dist/mcp/agent-variants/inspirationDesignContext.d.ts.map +1 -0
  35. package/dist/mcp/agent-variants/inspirationDesignContext.js +2379 -0
  36. package/dist/mcp/agent-variants/inspirationDesignContext.js.map +1 -0
  37. package/dist/mcp/agent-variants/pendingChangesAdapter.d.ts.map +1 -1
  38. package/dist/mcp/agent-variants/pendingChangesAdapter.js +10 -7
  39. package/dist/mcp/agent-variants/pendingChangesAdapter.js.map +1 -1
  40. package/dist/mcp/agent-variants/sourceContext.d.ts +7 -0
  41. package/dist/mcp/agent-variants/sourceContext.d.ts.map +1 -0
  42. package/dist/mcp/agent-variants/sourceContext.js +158 -0
  43. package/dist/mcp/agent-variants/sourceContext.js.map +1 -0
  44. package/dist/mcp/agent-variants/tools.d.ts +14 -0
  45. package/dist/mcp/agent-variants/tools.d.ts.map +1 -1
  46. package/dist/mcp/agent-variants/tools.js +330 -15
  47. package/dist/mcp/agent-variants/tools.js.map +1 -1
  48. package/dist/mcp/changeBatchClassification.d.ts +30 -0
  49. package/dist/mcp/changeBatchClassification.d.ts.map +1 -0
  50. package/dist/mcp/changeBatchClassification.js +65 -0
  51. package/dist/mcp/changeBatchClassification.js.map +1 -0
  52. package/dist/mcp/server.d.ts.map +1 -1
  53. package/dist/mcp/server.js +237 -39
  54. package/dist/mcp/server.js.map +1 -1
  55. package/dist/proxy-middleware/proxy-config.d.ts.map +1 -1
  56. package/dist/proxy-middleware/proxy-config.js +1 -15
  57. package/dist/proxy-middleware/proxy-config.js.map +1 -1
  58. package/dist/routes/agentVariants.d.ts +3 -1
  59. package/dist/routes/agentVariants.d.ts.map +1 -1
  60. package/dist/routes/agentVariants.js +131 -13
  61. package/dist/routes/agentVariants.js.map +1 -1
  62. package/dist/routes/mcp.d.ts +7 -1
  63. package/dist/routes/mcp.d.ts.map +1 -1
  64. package/dist/routes/mcp.js +139 -16
  65. package/dist/routes/mcp.js.map +1 -1
  66. package/dist/server.d.ts.map +1 -1
  67. package/dist/server.js +2 -2
  68. package/dist/server.js.map +1 -1
  69. package/dist/services/SessionBridgeService.d.ts +22 -0
  70. package/dist/services/SessionBridgeService.d.ts.map +1 -1
  71. package/dist/services/SessionBridgeService.js +61 -0
  72. package/dist/services/SessionBridgeService.js.map +1 -1
  73. package/dist/services/TelemetryService.d.ts +121 -0
  74. package/dist/services/TelemetryService.d.ts.map +1 -1
  75. package/dist/services/TelemetryService.js +155 -0
  76. package/dist/services/TelemetryService.js.map +1 -1
  77. package/dist/services/WorktreeManager.d.ts +57 -5
  78. package/dist/services/WorktreeManager.d.ts.map +1 -1
  79. package/dist/services/WorktreeManager.js +205 -13
  80. package/dist/services/WorktreeManager.js.map +1 -1
  81. package/dist/services/templates/designCatalog.d.ts +27 -0
  82. package/dist/services/templates/designCatalog.d.ts.map +1 -0
  83. package/dist/services/templates/designCatalog.js +141 -0
  84. package/dist/services/templates/designCatalog.js.map +1 -0
  85. package/dist/services/templates/designmd/airbnb.md +545 -0
  86. package/dist/services/templates/designmd/airtable.md +554 -0
  87. package/dist/services/templates/designmd/apple.md +562 -0
  88. package/dist/services/templates/designmd/binance.md +634 -0
  89. package/dist/services/templates/designmd/bmw-m.md +503 -0
  90. package/dist/services/templates/designmd/bmw.md +544 -0
  91. package/dist/services/templates/designmd/bugatti.md +454 -0
  92. package/dist/services/templates/designmd/cal.md +542 -0
  93. package/dist/services/templates/designmd/claude.md +589 -0
  94. package/dist/services/templates/designmd/clay.md +541 -0
  95. package/dist/services/templates/designmd/cohere.md +451 -0
  96. package/dist/services/templates/designmd/cursor.md +537 -0
  97. package/dist/services/templates/designmd/expo.md +526 -0
  98. package/dist/services/templates/designmd/figma.md +578 -0
  99. package/dist/services/templates/designmd/framer.md +544 -0
  100. package/dist/services/templates/designmd/hp.md +670 -0
  101. package/dist/services/templates/designmd/linear.app.md +548 -0
  102. package/dist/services/templates/designmd/mintlify.md +852 -0
  103. package/dist/services/templates/designmd/miro.md +825 -0
  104. package/dist/services/templates/designmd/notion.md +821 -0
  105. package/dist/services/templates/designmd/raycast.md +669 -0
  106. package/dist/services/templates/designmd/resend.md +585 -0
  107. package/dist/services/templates/designmd/sentry.md +262 -0
  108. package/dist/services/templates/designmd/shopify.md +350 -0
  109. package/dist/services/templates/designmd/spotify.md +246 -0
  110. package/dist/services/templates/designmd/stripe.md +322 -0
  111. package/dist/services/templates/designmd/supabase.md +255 -0
  112. package/dist/services/templates/designmd/superhuman.md +252 -0
  113. package/dist/services/templates/designmd/uber.md +295 -0
  114. package/dist/services/templates/designmd/vercel.md +310 -0
  115. package/dist/services/templates/viteReactTs.d.ts +42 -0
  116. package/dist/services/templates/viteReactTs.d.ts.map +1 -0
  117. package/dist/services/templates/viteReactTs.js +267 -0
  118. package/dist/services/templates/viteReactTs.js.map +1 -0
  119. package/dist/types/change-request-types.d.ts +15 -3
  120. package/dist/types/change-request-types.d.ts.map +1 -1
  121. package/dist/utils/skills/claude-skill.d.ts +2 -2
  122. package/dist/utils/skills/claude-skill.d.ts.map +1 -1
  123. package/dist/utils/skills/claude-skill.js +19 -98
  124. package/dist/utils/skills/claude-skill.js.map +1 -1
  125. package/dist/utils/skills/cursor-rules.d.ts +2 -2
  126. package/dist/utils/skills/cursor-rules.d.ts.map +1 -1
  127. package/dist/utils/skills/cursor-rules.js +15 -80
  128. package/dist/utils/skills/cursor-rules.js.map +1 -1
  129. package/dist/utils/skills/shared-variants-protocol.d.ts +23 -0
  130. package/dist/utils/skills/shared-variants-protocol.d.ts.map +1 -0
  131. package/dist/utils/skills/shared-variants-protocol.js +131 -0
  132. package/dist/utils/skills/shared-variants-protocol.js.map +1 -0
  133. package/package.json +4 -3
  134. package/src/ui/dist/assets/main-C9jfEp80.css +1 -0
  135. package/src/ui/dist/assets/main-DejhsBWR.js +382 -0
  136. package/src/ui/dist/index.html +2 -2
  137. package/src/ui/dist/assets/main-Bv0LuxKz.js +0 -382
  138. package/src/ui/dist/assets/main-BzmseUDd.css +0 -1
@@ -1,9 +1,9 @@
1
1
  import { z } from 'zod/v3';
2
2
  import { ERROR_CODES, type ErrorCode } from './errors';
3
- export declare const STAGES: readonly ["awaiting_briefs", "awaiting_approval", "work_items_ready", "waiting_for_results", "ready", "degraded", "failed", "cancelled"];
3
+ export declare const STAGES: readonly ["awaiting_source_research", "awaiting_briefs", "awaiting_approval", "work_items_ready", "waiting_for_results", "ready", "degraded", "failed", "cancelled"];
4
4
  export type Stage = (typeof STAGES)[number];
5
5
  export declare const TERMINAL_STAGES: ReadonlySet<Stage>;
6
- export declare const WORK_ITEM_KINDS: readonly ["brief", "scaffold_base", "code_gen", "cleanup_runtime"];
6
+ export declare const WORK_ITEM_KINDS: readonly ["source_research", "brief", "scaffold_base", "static_preview", "code_gen", "cleanup_runtime"];
7
7
  export type WorkItemKind = (typeof WORK_ITEM_KINDS)[number];
8
8
  export declare const WORK_ITEM_STATUSES: readonly ["pending", "running", "succeeded", "failed", "cancelled"];
9
9
  export type WorkItemStatus = (typeof WORK_ITEM_STATUSES)[number];
@@ -28,6 +28,14 @@ export interface WorkItem {
28
28
  };
29
29
  lease?: LeaseRecord;
30
30
  acceptedReports: string[];
31
+ /**
32
+ * When true, the work item is owned by the server (no external lease ever
33
+ * issued, no `request_work` surfacing). Used for `scaffold_base` items in
34
+ * fresh-project sessions where the server runs the actual scaffold +
35
+ * `npm install` in the background and reports completion via
36
+ * `SessionStore.completeInternal`.
37
+ */
38
+ internal?: boolean;
31
39
  }
32
40
  export declare const projectContextExisting: z.ZodObject<{
33
41
  kind: z.ZodLiteral<"existing">;
@@ -36,20 +44,416 @@ export declare const projectContextExisting: z.ZodObject<{
36
44
  }, {
37
45
  kind: "existing";
38
46
  }>;
47
+ export declare const designContextEntrySchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
48
+ kind: z.ZodLiteral<"slug">;
49
+ slug: z.ZodString;
50
+ }, "strip", z.ZodTypeAny, {
51
+ slug: string;
52
+ kind: "slug";
53
+ }, {
54
+ slug: string;
55
+ kind: "slug";
56
+ }>, z.ZodObject<{
57
+ kind: z.ZodLiteral<"markdown">;
58
+ content: z.ZodString;
59
+ label: z.ZodString;
60
+ }, "strip", z.ZodTypeAny, {
61
+ kind: "markdown";
62
+ content: string;
63
+ label: string;
64
+ }, {
65
+ kind: "markdown";
66
+ content: string;
67
+ label: string;
68
+ }>]>;
69
+ export declare const sourceArtifactKindSchema: z.ZodEnum<["urlText", "siteBrief", "visualBrief", "screenshotNotes"]>;
70
+ export declare const sourceArtifactInputSchema: z.ZodObject<{
71
+ kind: z.ZodEnum<["urlText", "siteBrief", "visualBrief", "screenshotNotes"]>;
72
+ label: z.ZodString;
73
+ content: z.ZodString;
74
+ }, "strip", z.ZodTypeAny, {
75
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
76
+ content: string;
77
+ label: string;
78
+ }, {
79
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
80
+ content: string;
81
+ label: string;
82
+ }>;
83
+ export declare const sourceRoleSchema: z.ZodEnum<["primary", "inspiration", "competitor"]>;
84
+ export declare const sourceRoleEntrySchema: z.ZodObject<{
85
+ url: z.ZodString;
86
+ role: z.ZodEnum<["primary", "inspiration", "competitor"]>;
87
+ rationale: z.ZodOptional<z.ZodString>;
88
+ }, "strip", z.ZodTypeAny, {
89
+ url: string;
90
+ role: "primary" | "inspiration" | "competitor";
91
+ rationale?: string | undefined;
92
+ }, {
93
+ url: string;
94
+ role: "primary" | "inspiration" | "competitor";
95
+ rationale?: string | undefined;
96
+ }>;
97
+ export declare const sourceContextArtifactSchema: z.ZodObject<{
98
+ sourceFindings: z.ZodArray<z.ZodString, "many">;
99
+ sectionInventory: z.ZodArray<z.ZodString, "many">;
100
+ visualObservations: z.ZodArray<z.ZodString, "many">;
101
+ sourceRoles: z.ZodArray<z.ZodObject<{
102
+ url: z.ZodString;
103
+ role: z.ZodEnum<["primary", "inspiration", "competitor"]>;
104
+ rationale: z.ZodOptional<z.ZodString>;
105
+ }, "strip", z.ZodTypeAny, {
106
+ url: string;
107
+ role: "primary" | "inspiration" | "competitor";
108
+ rationale?: string | undefined;
109
+ }, {
110
+ url: string;
111
+ role: "primary" | "inspiration" | "competitor";
112
+ rationale?: string | undefined;
113
+ }>, "many">;
114
+ qualityBar: z.ZodArray<z.ZodString, "many">;
115
+ screenshotReferences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
116
+ risks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
117
+ }, "strip", z.ZodTypeAny, {
118
+ sourceFindings: string[];
119
+ sectionInventory: string[];
120
+ visualObservations: string[];
121
+ sourceRoles: {
122
+ url: string;
123
+ role: "primary" | "inspiration" | "competitor";
124
+ rationale?: string | undefined;
125
+ }[];
126
+ qualityBar: string[];
127
+ screenshotReferences?: string[] | undefined;
128
+ risks?: string[] | undefined;
129
+ }, {
130
+ sourceFindings: string[];
131
+ sectionInventory: string[];
132
+ visualObservations: string[];
133
+ sourceRoles: {
134
+ url: string;
135
+ role: "primary" | "inspiration" | "competitor";
136
+ rationale?: string | undefined;
137
+ }[];
138
+ qualityBar: string[];
139
+ screenshotReferences?: string[] | undefined;
140
+ risks?: string[] | undefined;
141
+ }>;
142
+ export declare const sourceContextInputSchema: z.ZodObject<{
143
+ sourceUrls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
144
+ preserveBrand: z.ZodOptional<z.ZodBoolean>;
145
+ sourceArtifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
146
+ kind: z.ZodEnum<["urlText", "siteBrief", "visualBrief", "screenshotNotes"]>;
147
+ label: z.ZodString;
148
+ content: z.ZodString;
149
+ }, "strip", z.ZodTypeAny, {
150
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
151
+ content: string;
152
+ label: string;
153
+ }, {
154
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
155
+ content: string;
156
+ label: string;
157
+ }>, "many">>;
158
+ artifact: z.ZodOptional<z.ZodObject<{
159
+ sourceFindings: z.ZodArray<z.ZodString, "many">;
160
+ sectionInventory: z.ZodArray<z.ZodString, "many">;
161
+ visualObservations: z.ZodArray<z.ZodString, "many">;
162
+ sourceRoles: z.ZodArray<z.ZodObject<{
163
+ url: z.ZodString;
164
+ role: z.ZodEnum<["primary", "inspiration", "competitor"]>;
165
+ rationale: z.ZodOptional<z.ZodString>;
166
+ }, "strip", z.ZodTypeAny, {
167
+ url: string;
168
+ role: "primary" | "inspiration" | "competitor";
169
+ rationale?: string | undefined;
170
+ }, {
171
+ url: string;
172
+ role: "primary" | "inspiration" | "competitor";
173
+ rationale?: string | undefined;
174
+ }>, "many">;
175
+ qualityBar: z.ZodArray<z.ZodString, "many">;
176
+ screenshotReferences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
177
+ risks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
178
+ }, "strip", z.ZodTypeAny, {
179
+ sourceFindings: string[];
180
+ sectionInventory: string[];
181
+ visualObservations: string[];
182
+ sourceRoles: {
183
+ url: string;
184
+ role: "primary" | "inspiration" | "competitor";
185
+ rationale?: string | undefined;
186
+ }[];
187
+ qualityBar: string[];
188
+ screenshotReferences?: string[] | undefined;
189
+ risks?: string[] | undefined;
190
+ }, {
191
+ sourceFindings: string[];
192
+ sectionInventory: string[];
193
+ visualObservations: string[];
194
+ sourceRoles: {
195
+ url: string;
196
+ role: "primary" | "inspiration" | "competitor";
197
+ rationale?: string | undefined;
198
+ }[];
199
+ qualityBar: string[];
200
+ screenshotReferences?: string[] | undefined;
201
+ risks?: string[] | undefined;
202
+ }>>;
203
+ designDecision: z.ZodOptional<z.ZodEnum<["let_rivet_choose", "go_custom"]>>;
204
+ }, "strip", z.ZodTypeAny, {
205
+ sourceUrls?: string[] | undefined;
206
+ preserveBrand?: boolean | undefined;
207
+ sourceArtifacts?: {
208
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
209
+ content: string;
210
+ label: string;
211
+ }[] | undefined;
212
+ artifact?: {
213
+ sourceFindings: string[];
214
+ sectionInventory: string[];
215
+ visualObservations: string[];
216
+ sourceRoles: {
217
+ url: string;
218
+ role: "primary" | "inspiration" | "competitor";
219
+ rationale?: string | undefined;
220
+ }[];
221
+ qualityBar: string[];
222
+ screenshotReferences?: string[] | undefined;
223
+ risks?: string[] | undefined;
224
+ } | undefined;
225
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
226
+ }, {
227
+ sourceUrls?: string[] | undefined;
228
+ preserveBrand?: boolean | undefined;
229
+ sourceArtifacts?: {
230
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
231
+ content: string;
232
+ label: string;
233
+ }[] | undefined;
234
+ artifact?: {
235
+ sourceFindings: string[];
236
+ sectionInventory: string[];
237
+ visualObservations: string[];
238
+ sourceRoles: {
239
+ url: string;
240
+ role: "primary" | "inspiration" | "competitor";
241
+ rationale?: string | undefined;
242
+ }[];
243
+ qualityBar: string[];
244
+ screenshotReferences?: string[] | undefined;
245
+ risks?: string[] | undefined;
246
+ } | undefined;
247
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
248
+ }>;
39
249
  export declare const projectContextFresh: z.ZodObject<{
40
250
  kind: z.ZodLiteral<"fresh">;
41
251
  workspacePath: z.ZodString;
42
252
  framework: z.ZodOptional<z.ZodEnum<["vite", "next", "astro", "remix"]>>;
253
+ /** Per-variant-slot design context. Slug entries resolve bundled catalog
254
+ * markdown; markdown entries are written directly as `DESIGN.md`. The
255
+ * order matches code-gen variant slot order. */
256
+ designContext: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
257
+ kind: z.ZodLiteral<"slug">;
258
+ slug: z.ZodString;
259
+ }, "strip", z.ZodTypeAny, {
260
+ slug: string;
261
+ kind: "slug";
262
+ }, {
263
+ slug: string;
264
+ kind: "slug";
265
+ }>, z.ZodObject<{
266
+ kind: z.ZodLiteral<"markdown">;
267
+ content: z.ZodString;
268
+ label: z.ZodString;
269
+ }, "strip", z.ZodTypeAny, {
270
+ kind: "markdown";
271
+ content: string;
272
+ label: string;
273
+ }, {
274
+ kind: "markdown";
275
+ content: string;
276
+ label: string;
277
+ }>]>, "many">>;
278
+ sourceContext: z.ZodOptional<z.ZodObject<{
279
+ sourceUrls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
280
+ preserveBrand: z.ZodOptional<z.ZodBoolean>;
281
+ sourceArtifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
282
+ kind: z.ZodEnum<["urlText", "siteBrief", "visualBrief", "screenshotNotes"]>;
283
+ label: z.ZodString;
284
+ content: z.ZodString;
285
+ }, "strip", z.ZodTypeAny, {
286
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
287
+ content: string;
288
+ label: string;
289
+ }, {
290
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
291
+ content: string;
292
+ label: string;
293
+ }>, "many">>;
294
+ artifact: z.ZodOptional<z.ZodObject<{
295
+ sourceFindings: z.ZodArray<z.ZodString, "many">;
296
+ sectionInventory: z.ZodArray<z.ZodString, "many">;
297
+ visualObservations: z.ZodArray<z.ZodString, "many">;
298
+ sourceRoles: z.ZodArray<z.ZodObject<{
299
+ url: z.ZodString;
300
+ role: z.ZodEnum<["primary", "inspiration", "competitor"]>;
301
+ rationale: z.ZodOptional<z.ZodString>;
302
+ }, "strip", z.ZodTypeAny, {
303
+ url: string;
304
+ role: "primary" | "inspiration" | "competitor";
305
+ rationale?: string | undefined;
306
+ }, {
307
+ url: string;
308
+ role: "primary" | "inspiration" | "competitor";
309
+ rationale?: string | undefined;
310
+ }>, "many">;
311
+ qualityBar: z.ZodArray<z.ZodString, "many">;
312
+ screenshotReferences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
313
+ risks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
314
+ }, "strip", z.ZodTypeAny, {
315
+ sourceFindings: string[];
316
+ sectionInventory: string[];
317
+ visualObservations: string[];
318
+ sourceRoles: {
319
+ url: string;
320
+ role: "primary" | "inspiration" | "competitor";
321
+ rationale?: string | undefined;
322
+ }[];
323
+ qualityBar: string[];
324
+ screenshotReferences?: string[] | undefined;
325
+ risks?: string[] | undefined;
326
+ }, {
327
+ sourceFindings: string[];
328
+ sectionInventory: string[];
329
+ visualObservations: string[];
330
+ sourceRoles: {
331
+ url: string;
332
+ role: "primary" | "inspiration" | "competitor";
333
+ rationale?: string | undefined;
334
+ }[];
335
+ qualityBar: string[];
336
+ screenshotReferences?: string[] | undefined;
337
+ risks?: string[] | undefined;
338
+ }>>;
339
+ designDecision: z.ZodOptional<z.ZodEnum<["let_rivet_choose", "go_custom"]>>;
340
+ }, "strip", z.ZodTypeAny, {
341
+ sourceUrls?: string[] | undefined;
342
+ preserveBrand?: boolean | undefined;
343
+ sourceArtifacts?: {
344
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
345
+ content: string;
346
+ label: string;
347
+ }[] | undefined;
348
+ artifact?: {
349
+ sourceFindings: string[];
350
+ sectionInventory: string[];
351
+ visualObservations: string[];
352
+ sourceRoles: {
353
+ url: string;
354
+ role: "primary" | "inspiration" | "competitor";
355
+ rationale?: string | undefined;
356
+ }[];
357
+ qualityBar: string[];
358
+ screenshotReferences?: string[] | undefined;
359
+ risks?: string[] | undefined;
360
+ } | undefined;
361
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
362
+ }, {
363
+ sourceUrls?: string[] | undefined;
364
+ preserveBrand?: boolean | undefined;
365
+ sourceArtifacts?: {
366
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
367
+ content: string;
368
+ label: string;
369
+ }[] | undefined;
370
+ artifact?: {
371
+ sourceFindings: string[];
372
+ sectionInventory: string[];
373
+ visualObservations: string[];
374
+ sourceRoles: {
375
+ url: string;
376
+ role: "primary" | "inspiration" | "competitor";
377
+ rationale?: string | undefined;
378
+ }[];
379
+ qualityBar: string[];
380
+ screenshotReferences?: string[] | undefined;
381
+ risks?: string[] | undefined;
382
+ } | undefined;
383
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
384
+ }>>;
43
385
  }, "strip", z.ZodTypeAny, {
44
386
  kind: "fresh";
45
387
  workspacePath: string;
46
388
  framework?: "next" | "vite" | "remix" | "astro" | undefined;
389
+ designContext?: ({
390
+ slug: string;
391
+ kind: "slug";
392
+ } | {
393
+ kind: "markdown";
394
+ content: string;
395
+ label: string;
396
+ })[] | undefined;
397
+ sourceContext?: {
398
+ sourceUrls?: string[] | undefined;
399
+ preserveBrand?: boolean | undefined;
400
+ sourceArtifacts?: {
401
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
402
+ content: string;
403
+ label: string;
404
+ }[] | undefined;
405
+ artifact?: {
406
+ sourceFindings: string[];
407
+ sectionInventory: string[];
408
+ visualObservations: string[];
409
+ sourceRoles: {
410
+ url: string;
411
+ role: "primary" | "inspiration" | "competitor";
412
+ rationale?: string | undefined;
413
+ }[];
414
+ qualityBar: string[];
415
+ screenshotReferences?: string[] | undefined;
416
+ risks?: string[] | undefined;
417
+ } | undefined;
418
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
419
+ } | undefined;
47
420
  }, {
48
421
  kind: "fresh";
49
422
  workspacePath: string;
50
423
  framework?: "next" | "vite" | "remix" | "astro" | undefined;
424
+ designContext?: ({
425
+ slug: string;
426
+ kind: "slug";
427
+ } | {
428
+ kind: "markdown";
429
+ content: string;
430
+ label: string;
431
+ })[] | undefined;
432
+ sourceContext?: {
433
+ sourceUrls?: string[] | undefined;
434
+ preserveBrand?: boolean | undefined;
435
+ sourceArtifacts?: {
436
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
437
+ content: string;
438
+ label: string;
439
+ }[] | undefined;
440
+ artifact?: {
441
+ sourceFindings: string[];
442
+ sectionInventory: string[];
443
+ visualObservations: string[];
444
+ sourceRoles: {
445
+ url: string;
446
+ role: "primary" | "inspiration" | "competitor";
447
+ rationale?: string | undefined;
448
+ }[];
449
+ qualityBar: string[];
450
+ screenshotReferences?: string[] | undefined;
451
+ risks?: string[] | undefined;
452
+ } | undefined;
453
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
454
+ } | undefined;
51
455
  }>;
52
- export declare const projectContextSchema: z.ZodUnion<[z.ZodObject<{
456
+ export declare const projectContextSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
53
457
  kind: z.ZodLiteral<"existing">;
54
458
  }, "strip", z.ZodTypeAny, {
55
459
  kind: "existing";
@@ -59,16 +463,269 @@ export declare const projectContextSchema: z.ZodUnion<[z.ZodObject<{
59
463
  kind: z.ZodLiteral<"fresh">;
60
464
  workspacePath: z.ZodString;
61
465
  framework: z.ZodOptional<z.ZodEnum<["vite", "next", "astro", "remix"]>>;
466
+ /** Per-variant-slot design context. Slug entries resolve bundled catalog
467
+ * markdown; markdown entries are written directly as `DESIGN.md`. The
468
+ * order matches code-gen variant slot order. */
469
+ designContext: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
470
+ kind: z.ZodLiteral<"slug">;
471
+ slug: z.ZodString;
472
+ }, "strip", z.ZodTypeAny, {
473
+ slug: string;
474
+ kind: "slug";
475
+ }, {
476
+ slug: string;
477
+ kind: "slug";
478
+ }>, z.ZodObject<{
479
+ kind: z.ZodLiteral<"markdown">;
480
+ content: z.ZodString;
481
+ label: z.ZodString;
482
+ }, "strip", z.ZodTypeAny, {
483
+ kind: "markdown";
484
+ content: string;
485
+ label: string;
486
+ }, {
487
+ kind: "markdown";
488
+ content: string;
489
+ label: string;
490
+ }>]>, "many">>;
491
+ sourceContext: z.ZodOptional<z.ZodObject<{
492
+ sourceUrls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
493
+ preserveBrand: z.ZodOptional<z.ZodBoolean>;
494
+ sourceArtifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
495
+ kind: z.ZodEnum<["urlText", "siteBrief", "visualBrief", "screenshotNotes"]>;
496
+ label: z.ZodString;
497
+ content: z.ZodString;
498
+ }, "strip", z.ZodTypeAny, {
499
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
500
+ content: string;
501
+ label: string;
502
+ }, {
503
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
504
+ content: string;
505
+ label: string;
506
+ }>, "many">>;
507
+ artifact: z.ZodOptional<z.ZodObject<{
508
+ sourceFindings: z.ZodArray<z.ZodString, "many">;
509
+ sectionInventory: z.ZodArray<z.ZodString, "many">;
510
+ visualObservations: z.ZodArray<z.ZodString, "many">;
511
+ sourceRoles: z.ZodArray<z.ZodObject<{
512
+ url: z.ZodString;
513
+ role: z.ZodEnum<["primary", "inspiration", "competitor"]>;
514
+ rationale: z.ZodOptional<z.ZodString>;
515
+ }, "strip", z.ZodTypeAny, {
516
+ url: string;
517
+ role: "primary" | "inspiration" | "competitor";
518
+ rationale?: string | undefined;
519
+ }, {
520
+ url: string;
521
+ role: "primary" | "inspiration" | "competitor";
522
+ rationale?: string | undefined;
523
+ }>, "many">;
524
+ qualityBar: z.ZodArray<z.ZodString, "many">;
525
+ screenshotReferences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
526
+ risks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
527
+ }, "strip", z.ZodTypeAny, {
528
+ sourceFindings: string[];
529
+ sectionInventory: string[];
530
+ visualObservations: string[];
531
+ sourceRoles: {
532
+ url: string;
533
+ role: "primary" | "inspiration" | "competitor";
534
+ rationale?: string | undefined;
535
+ }[];
536
+ qualityBar: string[];
537
+ screenshotReferences?: string[] | undefined;
538
+ risks?: string[] | undefined;
539
+ }, {
540
+ sourceFindings: string[];
541
+ sectionInventory: string[];
542
+ visualObservations: string[];
543
+ sourceRoles: {
544
+ url: string;
545
+ role: "primary" | "inspiration" | "competitor";
546
+ rationale?: string | undefined;
547
+ }[];
548
+ qualityBar: string[];
549
+ screenshotReferences?: string[] | undefined;
550
+ risks?: string[] | undefined;
551
+ }>>;
552
+ designDecision: z.ZodOptional<z.ZodEnum<["let_rivet_choose", "go_custom"]>>;
553
+ }, "strip", z.ZodTypeAny, {
554
+ sourceUrls?: string[] | undefined;
555
+ preserveBrand?: boolean | undefined;
556
+ sourceArtifacts?: {
557
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
558
+ content: string;
559
+ label: string;
560
+ }[] | undefined;
561
+ artifact?: {
562
+ sourceFindings: string[];
563
+ sectionInventory: string[];
564
+ visualObservations: string[];
565
+ sourceRoles: {
566
+ url: string;
567
+ role: "primary" | "inspiration" | "competitor";
568
+ rationale?: string | undefined;
569
+ }[];
570
+ qualityBar: string[];
571
+ screenshotReferences?: string[] | undefined;
572
+ risks?: string[] | undefined;
573
+ } | undefined;
574
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
575
+ }, {
576
+ sourceUrls?: string[] | undefined;
577
+ preserveBrand?: boolean | undefined;
578
+ sourceArtifacts?: {
579
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
580
+ content: string;
581
+ label: string;
582
+ }[] | undefined;
583
+ artifact?: {
584
+ sourceFindings: string[];
585
+ sectionInventory: string[];
586
+ visualObservations: string[];
587
+ sourceRoles: {
588
+ url: string;
589
+ role: "primary" | "inspiration" | "competitor";
590
+ rationale?: string | undefined;
591
+ }[];
592
+ qualityBar: string[];
593
+ screenshotReferences?: string[] | undefined;
594
+ risks?: string[] | undefined;
595
+ } | undefined;
596
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
597
+ }>>;
62
598
  }, "strip", z.ZodTypeAny, {
63
599
  kind: "fresh";
64
600
  workspacePath: string;
65
601
  framework?: "next" | "vite" | "remix" | "astro" | undefined;
602
+ designContext?: ({
603
+ slug: string;
604
+ kind: "slug";
605
+ } | {
606
+ kind: "markdown";
607
+ content: string;
608
+ label: string;
609
+ })[] | undefined;
610
+ sourceContext?: {
611
+ sourceUrls?: string[] | undefined;
612
+ preserveBrand?: boolean | undefined;
613
+ sourceArtifacts?: {
614
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
615
+ content: string;
616
+ label: string;
617
+ }[] | undefined;
618
+ artifact?: {
619
+ sourceFindings: string[];
620
+ sectionInventory: string[];
621
+ visualObservations: string[];
622
+ sourceRoles: {
623
+ url: string;
624
+ role: "primary" | "inspiration" | "competitor";
625
+ rationale?: string | undefined;
626
+ }[];
627
+ qualityBar: string[];
628
+ screenshotReferences?: string[] | undefined;
629
+ risks?: string[] | undefined;
630
+ } | undefined;
631
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
632
+ } | undefined;
66
633
  }, {
67
634
  kind: "fresh";
68
635
  workspacePath: string;
69
636
  framework?: "next" | "vite" | "remix" | "astro" | undefined;
637
+ designContext?: ({
638
+ slug: string;
639
+ kind: "slug";
640
+ } | {
641
+ kind: "markdown";
642
+ content: string;
643
+ label: string;
644
+ })[] | undefined;
645
+ sourceContext?: {
646
+ sourceUrls?: string[] | undefined;
647
+ preserveBrand?: boolean | undefined;
648
+ sourceArtifacts?: {
649
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
650
+ content: string;
651
+ label: string;
652
+ }[] | undefined;
653
+ artifact?: {
654
+ sourceFindings: string[];
655
+ sectionInventory: string[];
656
+ visualObservations: string[];
657
+ sourceRoles: {
658
+ url: string;
659
+ role: "primary" | "inspiration" | "competitor";
660
+ rationale?: string | undefined;
661
+ }[];
662
+ qualityBar: string[];
663
+ screenshotReferences?: string[] | undefined;
664
+ risks?: string[] | undefined;
665
+ } | undefined;
666
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
667
+ } | undefined;
70
668
  }>]>;
71
669
  export type ProjectContext = z.infer<typeof projectContextSchema>;
670
+ export type DesignContextEntry = z.infer<typeof designContextEntrySchema>;
671
+ export type SourceArtifactInput = z.infer<typeof sourceArtifactInputSchema>;
672
+ export type SourceRole = z.infer<typeof sourceRoleSchema>;
673
+ export type SourceContextArtifact = z.infer<typeof sourceContextArtifactSchema>;
674
+ export type SourceContextInput = z.infer<typeof sourceContextInputSchema>;
675
+ export type VariantDesignSource = {
676
+ kind: 'slug';
677
+ slug: string;
678
+ displayName: string;
679
+ } | {
680
+ kind: 'markdown';
681
+ label: string;
682
+ };
683
+ export type VariantPreviewSource = {
684
+ kind: 'dev_server';
685
+ port: number;
686
+ } | {
687
+ kind: 'static_artifact';
688
+ url: string;
689
+ };
690
+ export type ActiveProjectContext = {
691
+ kind: 'existing';
692
+ } | {
693
+ kind: 'fresh';
694
+ workspacePath: string;
695
+ framework?: 'vite' | 'next' | 'astro' | 'remix';
696
+ designContext?: Array<{
697
+ kind: 'slug';
698
+ slug: string;
699
+ } | {
700
+ kind: 'markdown';
701
+ label: string;
702
+ }>;
703
+ sourceContext?: {
704
+ sourceCount: number;
705
+ isSourceGrounded: boolean;
706
+ };
707
+ };
708
+ export interface ActiveVariantActions {
709
+ view?: {
710
+ enabled: boolean;
711
+ reason?: string;
712
+ };
713
+ commit?: {
714
+ enabled: boolean;
715
+ reason?: string;
716
+ };
717
+ }
718
+ export interface ActiveVariantSnapshot {
719
+ workItemId: string;
720
+ briefId: string;
721
+ label: string;
722
+ status: WorkItemStatus;
723
+ design?: VariantDesignSource;
724
+ preview?: VariantPreviewSource;
725
+ port?: number;
726
+ errorCode?: string;
727
+ actions?: ActiveVariantActions;
728
+ }
72
729
  export declare const targetSchema: z.ZodObject<{
73
730
  type: z.ZodEnum<["element", "file", "route"]>;
74
731
  ref: z.ZodString;
@@ -85,15 +742,23 @@ export declare const briefSchema: z.ZodObject<{
85
742
  label: z.ZodString;
86
743
  body: z.ZodString;
87
744
  }, "strip", z.ZodTypeAny, {
88
- briefId: string;
89
745
  label: string;
746
+ briefId: string;
90
747
  body: string;
91
748
  }, {
92
- briefId: string;
93
749
  label: string;
750
+ briefId: string;
94
751
  body: string;
95
752
  }>;
96
753
  export type Brief = z.infer<typeof briefSchema>;
754
+ /**
755
+ * Inclusive bounds for the number of variants a single propose_variants run
756
+ * may produce. Exported as named constants so the UI (parseVariantCount),
757
+ * the /api/mcp/queue-changes intake Zod schema, and the propose_variants tool
758
+ * schema all consume the same source of truth.
759
+ */
760
+ export declare const VARIANT_COUNT_MIN = 2;
761
+ export declare const VARIANT_COUNT_MAX = 8;
97
762
  export declare const proposeVariantsInput: {
98
763
  sessionId: z.ZodOptional<z.ZodString>;
99
764
  clientRequestId: z.ZodOptional<z.ZodString>;
@@ -109,7 +774,7 @@ export declare const proposeVariantsInput: {
109
774
  type: "element" | "file" | "route";
110
775
  ref: string;
111
776
  }>>;
112
- projectContext: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
777
+ projectContext: z.ZodOptional<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
113
778
  kind: z.ZodLiteral<"existing">;
114
779
  }, "strip", z.ZodTypeAny, {
115
780
  kind: "existing";
@@ -119,14 +784,208 @@ export declare const proposeVariantsInput: {
119
784
  kind: z.ZodLiteral<"fresh">;
120
785
  workspacePath: z.ZodString;
121
786
  framework: z.ZodOptional<z.ZodEnum<["vite", "next", "astro", "remix"]>>;
787
+ /** Per-variant-slot design context. Slug entries resolve bundled catalog
788
+ * markdown; markdown entries are written directly as `DESIGN.md`. The
789
+ * order matches code-gen variant slot order. */
790
+ designContext: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
791
+ kind: z.ZodLiteral<"slug">;
792
+ slug: z.ZodString;
793
+ }, "strip", z.ZodTypeAny, {
794
+ slug: string;
795
+ kind: "slug";
796
+ }, {
797
+ slug: string;
798
+ kind: "slug";
799
+ }>, z.ZodObject<{
800
+ kind: z.ZodLiteral<"markdown">;
801
+ content: z.ZodString;
802
+ label: z.ZodString;
803
+ }, "strip", z.ZodTypeAny, {
804
+ kind: "markdown";
805
+ content: string;
806
+ label: string;
807
+ }, {
808
+ kind: "markdown";
809
+ content: string;
810
+ label: string;
811
+ }>]>, "many">>;
812
+ sourceContext: z.ZodOptional<z.ZodObject<{
813
+ sourceUrls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
814
+ preserveBrand: z.ZodOptional<z.ZodBoolean>;
815
+ sourceArtifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
816
+ kind: z.ZodEnum<["urlText", "siteBrief", "visualBrief", "screenshotNotes"]>;
817
+ label: z.ZodString;
818
+ content: z.ZodString;
819
+ }, "strip", z.ZodTypeAny, {
820
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
821
+ content: string;
822
+ label: string;
823
+ }, {
824
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
825
+ content: string;
826
+ label: string;
827
+ }>, "many">>;
828
+ artifact: z.ZodOptional<z.ZodObject<{
829
+ sourceFindings: z.ZodArray<z.ZodString, "many">;
830
+ sectionInventory: z.ZodArray<z.ZodString, "many">;
831
+ visualObservations: z.ZodArray<z.ZodString, "many">;
832
+ sourceRoles: z.ZodArray<z.ZodObject<{
833
+ url: z.ZodString;
834
+ role: z.ZodEnum<["primary", "inspiration", "competitor"]>;
835
+ rationale: z.ZodOptional<z.ZodString>;
836
+ }, "strip", z.ZodTypeAny, {
837
+ url: string;
838
+ role: "primary" | "inspiration" | "competitor";
839
+ rationale?: string | undefined;
840
+ }, {
841
+ url: string;
842
+ role: "primary" | "inspiration" | "competitor";
843
+ rationale?: string | undefined;
844
+ }>, "many">;
845
+ qualityBar: z.ZodArray<z.ZodString, "many">;
846
+ screenshotReferences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
847
+ risks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
848
+ }, "strip", z.ZodTypeAny, {
849
+ sourceFindings: string[];
850
+ sectionInventory: string[];
851
+ visualObservations: string[];
852
+ sourceRoles: {
853
+ url: string;
854
+ role: "primary" | "inspiration" | "competitor";
855
+ rationale?: string | undefined;
856
+ }[];
857
+ qualityBar: string[];
858
+ screenshotReferences?: string[] | undefined;
859
+ risks?: string[] | undefined;
860
+ }, {
861
+ sourceFindings: string[];
862
+ sectionInventory: string[];
863
+ visualObservations: string[];
864
+ sourceRoles: {
865
+ url: string;
866
+ role: "primary" | "inspiration" | "competitor";
867
+ rationale?: string | undefined;
868
+ }[];
869
+ qualityBar: string[];
870
+ screenshotReferences?: string[] | undefined;
871
+ risks?: string[] | undefined;
872
+ }>>;
873
+ designDecision: z.ZodOptional<z.ZodEnum<["let_rivet_choose", "go_custom"]>>;
874
+ }, "strip", z.ZodTypeAny, {
875
+ sourceUrls?: string[] | undefined;
876
+ preserveBrand?: boolean | undefined;
877
+ sourceArtifacts?: {
878
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
879
+ content: string;
880
+ label: string;
881
+ }[] | undefined;
882
+ artifact?: {
883
+ sourceFindings: string[];
884
+ sectionInventory: string[];
885
+ visualObservations: string[];
886
+ sourceRoles: {
887
+ url: string;
888
+ role: "primary" | "inspiration" | "competitor";
889
+ rationale?: string | undefined;
890
+ }[];
891
+ qualityBar: string[];
892
+ screenshotReferences?: string[] | undefined;
893
+ risks?: string[] | undefined;
894
+ } | undefined;
895
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
896
+ }, {
897
+ sourceUrls?: string[] | undefined;
898
+ preserveBrand?: boolean | undefined;
899
+ sourceArtifacts?: {
900
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
901
+ content: string;
902
+ label: string;
903
+ }[] | undefined;
904
+ artifact?: {
905
+ sourceFindings: string[];
906
+ sectionInventory: string[];
907
+ visualObservations: string[];
908
+ sourceRoles: {
909
+ url: string;
910
+ role: "primary" | "inspiration" | "competitor";
911
+ rationale?: string | undefined;
912
+ }[];
913
+ qualityBar: string[];
914
+ screenshotReferences?: string[] | undefined;
915
+ risks?: string[] | undefined;
916
+ } | undefined;
917
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
918
+ }>>;
122
919
  }, "strip", z.ZodTypeAny, {
123
920
  kind: "fresh";
124
921
  workspacePath: string;
125
922
  framework?: "next" | "vite" | "remix" | "astro" | undefined;
923
+ designContext?: ({
924
+ slug: string;
925
+ kind: "slug";
926
+ } | {
927
+ kind: "markdown";
928
+ content: string;
929
+ label: string;
930
+ })[] | undefined;
931
+ sourceContext?: {
932
+ sourceUrls?: string[] | undefined;
933
+ preserveBrand?: boolean | undefined;
934
+ sourceArtifacts?: {
935
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
936
+ content: string;
937
+ label: string;
938
+ }[] | undefined;
939
+ artifact?: {
940
+ sourceFindings: string[];
941
+ sectionInventory: string[];
942
+ visualObservations: string[];
943
+ sourceRoles: {
944
+ url: string;
945
+ role: "primary" | "inspiration" | "competitor";
946
+ rationale?: string | undefined;
947
+ }[];
948
+ qualityBar: string[];
949
+ screenshotReferences?: string[] | undefined;
950
+ risks?: string[] | undefined;
951
+ } | undefined;
952
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
953
+ } | undefined;
126
954
  }, {
127
955
  kind: "fresh";
128
956
  workspacePath: string;
129
957
  framework?: "next" | "vite" | "remix" | "astro" | undefined;
958
+ designContext?: ({
959
+ slug: string;
960
+ kind: "slug";
961
+ } | {
962
+ kind: "markdown";
963
+ content: string;
964
+ label: string;
965
+ })[] | undefined;
966
+ sourceContext?: {
967
+ sourceUrls?: string[] | undefined;
968
+ preserveBrand?: boolean | undefined;
969
+ sourceArtifacts?: {
970
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
971
+ content: string;
972
+ label: string;
973
+ }[] | undefined;
974
+ artifact?: {
975
+ sourceFindings: string[];
976
+ sectionInventory: string[];
977
+ visualObservations: string[];
978
+ sourceRoles: {
979
+ url: string;
980
+ role: "primary" | "inspiration" | "competitor";
981
+ rationale?: string | undefined;
982
+ }[];
983
+ qualityBar: string[];
984
+ screenshotReferences?: string[] | undefined;
985
+ risks?: string[] | undefined;
986
+ } | undefined;
987
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
988
+ } | undefined;
130
989
  }>]>>;
131
990
  };
132
991
  export type ProposeVariantsInput = {
@@ -147,15 +1006,73 @@ export declare const reportVariantBriefsInput: {
147
1006
  label: z.ZodString;
148
1007
  body: z.ZodString;
149
1008
  }, "strip", z.ZodTypeAny, {
150
- briefId: string;
151
1009
  label: string;
1010
+ briefId: string;
152
1011
  body: string;
153
1012
  }, {
154
- briefId: string;
155
1013
  label: string;
1014
+ briefId: string;
156
1015
  body: string;
157
1016
  }>, "many">;
158
1017
  };
1018
+ export declare const reportSourceContextInput: {
1019
+ sessionId: z.ZodString;
1020
+ workItemId: z.ZodString;
1021
+ attempt: z.ZodNumber;
1022
+ leaseId: z.ZodString;
1023
+ sourceContext: z.ZodObject<{
1024
+ sourceFindings: z.ZodArray<z.ZodString, "many">;
1025
+ sectionInventory: z.ZodArray<z.ZodString, "many">;
1026
+ visualObservations: z.ZodArray<z.ZodString, "many">;
1027
+ sourceRoles: z.ZodArray<z.ZodObject<{
1028
+ url: z.ZodString;
1029
+ role: z.ZodEnum<["primary", "inspiration", "competitor"]>;
1030
+ rationale: z.ZodOptional<z.ZodString>;
1031
+ }, "strip", z.ZodTypeAny, {
1032
+ url: string;
1033
+ role: "primary" | "inspiration" | "competitor";
1034
+ rationale?: string | undefined;
1035
+ }, {
1036
+ url: string;
1037
+ role: "primary" | "inspiration" | "competitor";
1038
+ rationale?: string | undefined;
1039
+ }>, "many">;
1040
+ qualityBar: z.ZodArray<z.ZodString, "many">;
1041
+ screenshotReferences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1042
+ risks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1043
+ }, "strip", z.ZodTypeAny, {
1044
+ sourceFindings: string[];
1045
+ sectionInventory: string[];
1046
+ visualObservations: string[];
1047
+ sourceRoles: {
1048
+ url: string;
1049
+ role: "primary" | "inspiration" | "competitor";
1050
+ rationale?: string | undefined;
1051
+ }[];
1052
+ qualityBar: string[];
1053
+ screenshotReferences?: string[] | undefined;
1054
+ risks?: string[] | undefined;
1055
+ }, {
1056
+ sourceFindings: string[];
1057
+ sectionInventory: string[];
1058
+ visualObservations: string[];
1059
+ sourceRoles: {
1060
+ url: string;
1061
+ role: "primary" | "inspiration" | "competitor";
1062
+ rationale?: string | undefined;
1063
+ }[];
1064
+ qualityBar: string[];
1065
+ screenshotReferences?: string[] | undefined;
1066
+ risks?: string[] | undefined;
1067
+ }>;
1068
+ };
1069
+ export type ReportSourceContextInput = {
1070
+ sessionId: string;
1071
+ workItemId: string;
1072
+ attempt: number;
1073
+ leaseId: string;
1074
+ sourceContext: SourceContextArtifact;
1075
+ };
159
1076
  export type ReportVariantBriefsInput = {
160
1077
  sessionId: string;
161
1078
  workItemId: string;
@@ -166,6 +1083,9 @@ export type ReportVariantBriefsInput = {
166
1083
  export declare const approveVariantBriefsInput: {
167
1084
  sessionId: z.ZodString;
168
1085
  briefIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1086
+ confirmedByUser: z.ZodOptional<z.ZodBoolean>;
1087
+ bypassRequestedByUser: z.ZodOptional<z.ZodBoolean>;
1088
+ bypassReason: z.ZodOptional<z.ZodString>;
169
1089
  selections: z.ZodOptional<z.ZodArray<z.ZodObject<{
170
1090
  briefId: z.ZodString;
171
1091
  bodyOverride: z.ZodOptional<z.ZodString>;
@@ -180,6 +1100,9 @@ export declare const approveVariantBriefsInput: {
180
1100
  export type ApproveVariantBriefsInput = {
181
1101
  sessionId: string;
182
1102
  briefIds?: string[];
1103
+ confirmedByUser?: boolean;
1104
+ bypassRequestedByUser?: boolean;
1105
+ bypassReason?: string;
183
1106
  selections?: Array<{
184
1107
  briefId: string;
185
1108
  bodyOverride?: string;
@@ -199,16 +1122,24 @@ export type ApproveVariantBriefsOutput = {
199
1122
  export declare const commitVariantInput: {
200
1123
  sessionId: z.ZodString;
201
1124
  variantId: z.ZodString;
1125
+ confirmedByUser: z.ZodOptional<z.ZodBoolean>;
1126
+ bypassRequestedByUser: z.ZodOptional<z.ZodBoolean>;
1127
+ bypassReason: z.ZodOptional<z.ZodString>;
202
1128
  };
203
1129
  export type CommitVariantInput = {
204
1130
  sessionId: string;
205
1131
  variantId: string;
1132
+ confirmedByUser?: boolean;
1133
+ bypassRequestedByUser?: boolean;
1134
+ bypassReason?: string;
206
1135
  };
207
1136
  export type CommitVariantOutput = {
208
1137
  stage: Stage;
209
1138
  enqueued: boolean;
210
1139
  duplicate: boolean;
211
1140
  changedFilesCount: number;
1141
+ payloadKind?: 'diff' | 'project-created';
1142
+ destinationPath?: string;
212
1143
  } | {
213
1144
  stage: 'failed';
214
1145
  errorCode: ErrorCode;
@@ -246,6 +1177,9 @@ export declare const reportVariantCompleteInput: {
246
1177
  code: string;
247
1178
  }>>;
248
1179
  terminalChunk: z.ZodOptional<z.ZodString>;
1180
+ tokensIn: z.ZodOptional<z.ZodNumber>;
1181
+ tokensOut: z.ZodOptional<z.ZodNumber>;
1182
+ model: z.ZodOptional<z.ZodString>;
249
1183
  };
250
1184
  export type ReportVariantCompleteInput = {
251
1185
  sessionId: string;
@@ -259,6 +1193,9 @@ export type ReportVariantCompleteInput = {
259
1193
  message: string;
260
1194
  };
261
1195
  terminalChunk?: string;
1196
+ tokensIn?: number;
1197
+ tokensOut?: number;
1198
+ model?: string;
262
1199
  };
263
1200
  export declare const cancelVariantsInput: {
264
1201
  sessionId: z.ZodString;
@@ -268,6 +1205,106 @@ export type CancelVariantsInput = {
268
1205
  sessionId: string;
269
1206
  reason?: string;
270
1207
  };
1208
+ export declare const cancelVariantInput: {
1209
+ sessionId: z.ZodString;
1210
+ variantId: z.ZodString;
1211
+ reason: z.ZodOptional<z.ZodString>;
1212
+ };
1213
+ export type CancelVariantInput = {
1214
+ sessionId: string;
1215
+ variantId: string;
1216
+ reason?: string;
1217
+ };
1218
+ export type CancelVariantOutput = {
1219
+ sessionId: string;
1220
+ variantId: string;
1221
+ finalStatus: WorkItemStatus;
1222
+ sessionStage: Stage;
1223
+ alreadyTerminal: boolean;
1224
+ } | {
1225
+ stage: 'failed';
1226
+ errorCode: ErrorCode;
1227
+ message: string;
1228
+ };
1229
+ export declare const startVariantsMode: z.ZodEnum<["existing", "zero_to_one"]>;
1230
+ export declare const startVariantsInput: {
1231
+ prompt: z.ZodString;
1232
+ count: z.ZodOptional<z.ZodNumber>;
1233
+ mode: z.ZodEnum<["existing", "zero_to_one"]>;
1234
+ target: z.ZodOptional<z.ZodObject<{
1235
+ type: z.ZodEnum<["element", "file", "route"]>;
1236
+ ref: z.ZodString;
1237
+ }, "strip", z.ZodTypeAny, {
1238
+ type: "element" | "file" | "route";
1239
+ ref: string;
1240
+ }, {
1241
+ type: "element" | "file" | "route";
1242
+ ref: string;
1243
+ }>>;
1244
+ /** Zero-to-one only: framework for the scaffolded project. Defaults to 'vite'. */
1245
+ framework: z.ZodOptional<z.ZodEnum<["vite"]>>;
1246
+ /** Zero-to-one only: absolute parent directory under which Rivet derives
1247
+ * a slugified project folder. Defaults to the user's home dir. */
1248
+ destinationParent: z.ZodOptional<z.ZodString>;
1249
+ /** Existing only: absolute path to the project. Defaults to the MCP
1250
+ * server's current working directory. Used to detect framework and
1251
+ * auto-open the visual editor without a separate detect_project call. */
1252
+ projectPath: z.ZodOptional<z.ZodString>;
1253
+ clientRequestId: z.ZodOptional<z.ZodString>;
1254
+ };
1255
+ export type StartVariantsInput = {
1256
+ prompt: string;
1257
+ count?: number;
1258
+ mode: 'existing' | 'zero_to_one';
1259
+ target?: Target;
1260
+ framework?: 'vite';
1261
+ destinationParent?: string;
1262
+ projectPath?: string;
1263
+ clientRequestId?: string;
1264
+ };
1265
+ /**
1266
+ * Variant entry in the start_variants response. Carries everything the
1267
+ * agent needs to begin code-gen immediately — no follow-up
1268
+ * continue_variants(request_work) call required.
1269
+ */
1270
+ export interface StartedVariantDescriptor {
1271
+ variantId: string;
1272
+ briefId: string;
1273
+ label: string;
1274
+ status: 'pending';
1275
+ /** Same payload `continue_variants(request_work)` would return per
1276
+ * leased item: kind, attempt, dependsOn, input (with worktreePath),
1277
+ * output_schema. */
1278
+ workItem: LeasedWorkItemDescriptor;
1279
+ }
1280
+ export type StartVariantsOutput = {
1281
+ sessionId: string;
1282
+ stage: 'work_items_ready';
1283
+ mode: 'existing' | 'zero_to_one';
1284
+ /** Lease covers every variant in the `variants` array. The agent
1285
+ * passes this back to `report_variant_complete` for each item. */
1286
+ leaseId: string;
1287
+ leaseTtlMs: number;
1288
+ variants: StartedVariantDescriptor[];
1289
+ scaffoldBaseWorkItemId: string | null;
1290
+ /** Populated only for zero_to_one: the future project directory. */
1291
+ destinationPath?: string;
1292
+ /** Populated when the server opened the editor server-side — for
1293
+ * zero_to_one always, for existing when projectPath was provided
1294
+ * or could be detected. */
1295
+ visualEditor?: VisualEditorAttachment;
1296
+ /** Detected framework / project metadata (existing mode), so the
1297
+ * agent doesn't need a separate detect_project call. */
1298
+ project?: {
1299
+ projectPath: string;
1300
+ framework: string;
1301
+ };
1302
+ nextAction: 'report_variant_complete';
1303
+ } | {
1304
+ stage: 'failed';
1305
+ errorCode: ErrorCode;
1306
+ message: string;
1307
+ };
271
1308
  export interface BriefWorkItemDescriptor {
272
1309
  id: string;
273
1310
  kind: 'brief';
@@ -275,6 +1312,13 @@ export interface BriefWorkItemDescriptor {
275
1312
  input: unknown;
276
1313
  output_schema: unknown;
277
1314
  }
1315
+ export interface SourceResearchWorkItemDescriptor {
1316
+ id: string;
1317
+ kind: 'source_research';
1318
+ attempt: number;
1319
+ input: unknown;
1320
+ output_schema: unknown;
1321
+ }
278
1322
  export interface LeasedWorkItemDescriptor {
279
1323
  id: string;
280
1324
  kind: WorkItemKind;
@@ -283,11 +1327,25 @@ export interface LeasedWorkItemDescriptor {
283
1327
  input: unknown;
284
1328
  output_schema: unknown;
285
1329
  }
1330
+ export interface VisualEditorAttachment {
1331
+ sessionId: string;
1332
+ url: string;
1333
+ rivetPort: number;
1334
+ opened: boolean;
1335
+ attached: boolean;
1336
+ }
286
1337
  export type ProposeVariantsOutput = {
1338
+ sessionId: string;
1339
+ stage: 'awaiting_source_research';
1340
+ sourceResearchWorkItem: SourceResearchWorkItemDescriptor;
1341
+ nextAction: 'continue_variants';
1342
+ visualEditor?: VisualEditorAttachment;
1343
+ } | {
287
1344
  sessionId: string;
288
1345
  stage: 'awaiting_briefs';
289
1346
  briefWorkItem: BriefWorkItemDescriptor;
290
1347
  nextAction: 'report_variant_briefs';
1348
+ visualEditor?: VisualEditorAttachment;
291
1349
  } | {
292
1350
  stage: 'cancelled';
293
1351
  } | {
@@ -298,15 +1356,32 @@ export type ProposeVariantsOutput = {
298
1356
  export type ReportVariantBriefsOutput = {
299
1357
  stage: 'awaiting_approval';
300
1358
  briefs: Brief[];
1359
+ approvalPrompt: string;
301
1360
  nextAction: 'continue_variants';
302
1361
  } | {
303
1362
  stage: 'failed';
304
1363
  errorCode: ErrorCode;
305
1364
  message: string;
306
1365
  };
1366
+ export type ReportSourceContextOutput = {
1367
+ stage: 'awaiting_briefs';
1368
+ briefWorkItem: BriefWorkItemDescriptor;
1369
+ nextAction: 'report_variant_briefs';
1370
+ } | {
1371
+ stage: 'failed';
1372
+ errorCode: ErrorCode;
1373
+ message: string;
1374
+ };
307
1375
  export type ContinueVariantsOutput = {
1376
+ stage: 'awaiting_source_research';
1377
+ progress: {
1378
+ ready: number;
1379
+ total: number;
1380
+ };
1381
+ } | {
308
1382
  stage: 'awaiting_approval';
309
1383
  briefs: Brief[];
1384
+ approvalPrompt: string;
310
1385
  } | {
311
1386
  stage: 'work_items_ready';
312
1387
  leaseId: string;
@@ -355,11 +1430,28 @@ export type VariantPickPayload = {
355
1430
  diff: string;
356
1431
  target?: Target;
357
1432
  changedFilesCount: number;
358
- } | {
1433
+ }
1434
+ /**
1435
+ * Server-internal pre-materialize state for fresh-project picks. Held while
1436
+ * the orchestrator copies `sourceWorktreePath` to `destinationPath`. Never
1437
+ * crosses to agents — the agent-facing payload is `project-created`.
1438
+ */
1439
+ | {
359
1440
  kind: 'new-project';
360
1441
  destinationPath: string;
361
1442
  sourceWorktreePath: string;
362
1443
  changedFilesCount: number;
1444
+ }
1445
+ /**
1446
+ * Agent-facing post-materialize state for fresh-project picks. The project
1447
+ * already exists on disk at `destinationPath`; the agent only needs to
1448
+ * optionally install dependencies and continue from there.
1449
+ */
1450
+ | {
1451
+ kind: 'project-created';
1452
+ destinationPath: string;
1453
+ changedFilesCount: number;
1454
+ note: string;
363
1455
  };
364
1456
  export interface VariantPickEnvelope {
365
1457
  sourceSessionId: string;