rivet-design 0.9.2 → 0.9.4

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 (157) hide show
  1. package/dist/mcp/agent-variants/SessionStore.d.ts +78 -2
  2. package/dist/mcp/agent-variants/SessionStore.d.ts.map +1 -1
  3. package/dist/mcp/agent-variants/SessionStore.js +464 -62
  4. package/dist/mcp/agent-variants/SessionStore.js.map +1 -1
  5. package/dist/mcp/agent-variants/WorktreeOrchestrator.d.ts +331 -9
  6. package/dist/mcp/agent-variants/WorktreeOrchestrator.d.ts.map +1 -1
  7. package/dist/mcp/agent-variants/WorktreeOrchestrator.js +1985 -61
  8. package/dist/mcp/agent-variants/WorktreeOrchestrator.js.map +1 -1
  9. package/dist/mcp/agent-variants/WorktreeOrchestrator.testHelpers.d.ts +65 -0
  10. package/dist/mcp/agent-variants/WorktreeOrchestrator.testHelpers.d.ts.map +1 -0
  11. package/dist/mcp/agent-variants/WorktreeOrchestrator.testHelpers.js +162 -0
  12. package/dist/mcp/agent-variants/WorktreeOrchestrator.testHelpers.js.map +1 -0
  13. package/dist/mcp/agent-variants/contracts.d.ts +2508 -10
  14. package/dist/mcp/agent-variants/contracts.d.ts.map +1 -1
  15. package/dist/mcp/agent-variants/contracts.js +295 -5
  16. package/dist/mcp/agent-variants/contracts.js.map +1 -1
  17. package/dist/mcp/agent-variants/createProjectArtifacts.d.ts +78 -0
  18. package/dist/mcp/agent-variants/createProjectArtifacts.d.ts.map +1 -0
  19. package/dist/mcp/agent-variants/createProjectArtifacts.js +123 -0
  20. package/dist/mcp/agent-variants/createProjectArtifacts.js.map +1 -0
  21. package/dist/mcp/agent-variants/createZeroToOneTool.d.ts +241 -0
  22. package/dist/mcp/agent-variants/createZeroToOneTool.d.ts.map +1 -0
  23. package/dist/mcp/agent-variants/createZeroToOneTool.js +213 -0
  24. package/dist/mcp/agent-variants/createZeroToOneTool.js.map +1 -0
  25. package/dist/mcp/agent-variants/designContextStore.d.ts +160 -0
  26. package/dist/mcp/agent-variants/designContextStore.d.ts.map +1 -0
  27. package/dist/mcp/agent-variants/designContextStore.js +295 -0
  28. package/dist/mcp/agent-variants/designContextStore.js.map +1 -0
  29. package/dist/mcp/agent-variants/elementRefToTarget.d.ts +21 -0
  30. package/dist/mcp/agent-variants/elementRefToTarget.d.ts.map +1 -0
  31. package/dist/mcp/agent-variants/elementRefToTarget.js +47 -0
  32. package/dist/mcp/agent-variants/elementRefToTarget.js.map +1 -0
  33. package/dist/mcp/agent-variants/errors.d.ts +1 -1
  34. package/dist/mcp/agent-variants/errors.d.ts.map +1 -1
  35. package/dist/mcp/agent-variants/errors.js +7 -0
  36. package/dist/mcp/agent-variants/errors.js.map +1 -1
  37. package/dist/mcp/agent-variants/index.d.ts +4 -2
  38. package/dist/mcp/agent-variants/index.d.ts.map +1 -1
  39. package/dist/mcp/agent-variants/index.js +7 -1
  40. package/dist/mcp/agent-variants/index.js.map +1 -1
  41. package/dist/mcp/agent-variants/inspirationDesignContext.d.ts +440 -0
  42. package/dist/mcp/agent-variants/inspirationDesignContext.d.ts.map +1 -0
  43. package/dist/mcp/agent-variants/inspirationDesignContext.js +2467 -0
  44. package/dist/mcp/agent-variants/inspirationDesignContext.js.map +1 -0
  45. package/dist/mcp/agent-variants/pendingChangesAdapter.d.ts.map +1 -1
  46. package/dist/mcp/agent-variants/pendingChangesAdapter.js +21 -7
  47. package/dist/mcp/agent-variants/pendingChangesAdapter.js.map +1 -1
  48. package/dist/mcp/agent-variants/previewQa.d.ts +61 -0
  49. package/dist/mcp/agent-variants/previewQa.d.ts.map +1 -0
  50. package/dist/mcp/agent-variants/previewQa.js +374 -0
  51. package/dist/mcp/agent-variants/previewQa.js.map +1 -0
  52. package/dist/mcp/agent-variants/sourceContext.d.ts +8 -0
  53. package/dist/mcp/agent-variants/sourceContext.d.ts.map +1 -0
  54. package/dist/mcp/agent-variants/sourceContext.js +183 -0
  55. package/dist/mcp/agent-variants/sourceContext.js.map +1 -0
  56. package/dist/mcp/agent-variants/tools.d.ts +36 -0
  57. package/dist/mcp/agent-variants/tools.d.ts.map +1 -1
  58. package/dist/mcp/agent-variants/tools.js +451 -19
  59. package/dist/mcp/agent-variants/tools.js.map +1 -1
  60. package/dist/mcp/changeBatchClassification.d.ts +30 -0
  61. package/dist/mcp/changeBatchClassification.d.ts.map +1 -0
  62. package/dist/mcp/changeBatchClassification.js +65 -0
  63. package/dist/mcp/changeBatchClassification.js.map +1 -0
  64. package/dist/mcp/server.d.ts.map +1 -1
  65. package/dist/mcp/server.js +258 -41
  66. package/dist/mcp/server.js.map +1 -1
  67. package/dist/prompts/agentModPrompts.js +4 -4
  68. package/dist/prompts/agentModPrompts.js.map +1 -1
  69. package/dist/proxy-middleware/proxy-config.d.ts.map +1 -1
  70. package/dist/proxy-middleware/proxy-config.js +1 -15
  71. package/dist/proxy-middleware/proxy-config.js.map +1 -1
  72. package/dist/routes/agentVariants.d.ts +3 -1
  73. package/dist/routes/agentVariants.d.ts.map +1 -1
  74. package/dist/routes/agentVariants.js +138 -13
  75. package/dist/routes/agentVariants.js.map +1 -1
  76. package/dist/routes/mcp.d.ts +7 -1
  77. package/dist/routes/mcp.d.ts.map +1 -1
  78. package/dist/routes/mcp.js +139 -16
  79. package/dist/routes/mcp.js.map +1 -1
  80. package/dist/server.d.ts.map +1 -1
  81. package/dist/server.js +23 -5
  82. package/dist/server.js.map +1 -1
  83. package/dist/services/ProjectDetectionService.d.ts.map +1 -1
  84. package/dist/services/ProjectDetectionService.js +9 -0
  85. package/dist/services/ProjectDetectionService.js.map +1 -1
  86. package/dist/services/SessionBridgeService.d.ts +22 -0
  87. package/dist/services/SessionBridgeService.d.ts.map +1 -1
  88. package/dist/services/SessionBridgeService.js +61 -0
  89. package/dist/services/SessionBridgeService.js.map +1 -1
  90. package/dist/services/TelemetryService.d.ts +121 -0
  91. package/dist/services/TelemetryService.d.ts.map +1 -1
  92. package/dist/services/TelemetryService.js +155 -0
  93. package/dist/services/TelemetryService.js.map +1 -1
  94. package/dist/services/WorktreeManager.d.ts +116 -6
  95. package/dist/services/WorktreeManager.d.ts.map +1 -1
  96. package/dist/services/WorktreeManager.js +394 -19
  97. package/dist/services/WorktreeManager.js.map +1 -1
  98. package/dist/services/agent/AgentModService.js +6 -6
  99. package/dist/services/agent/AgentModService.js.map +1 -1
  100. package/dist/services/templates/designCatalog.d.ts +27 -0
  101. package/dist/services/templates/designCatalog.d.ts.map +1 -0
  102. package/dist/services/templates/designCatalog.js +141 -0
  103. package/dist/services/templates/designCatalog.js.map +1 -0
  104. package/dist/services/templates/designmd/airbnb.md +545 -0
  105. package/dist/services/templates/designmd/airtable.md +554 -0
  106. package/dist/services/templates/designmd/apple.md +562 -0
  107. package/dist/services/templates/designmd/binance.md +634 -0
  108. package/dist/services/templates/designmd/bmw-m.md +503 -0
  109. package/dist/services/templates/designmd/bmw.md +544 -0
  110. package/dist/services/templates/designmd/bugatti.md +454 -0
  111. package/dist/services/templates/designmd/cal.md +542 -0
  112. package/dist/services/templates/designmd/claude.md +589 -0
  113. package/dist/services/templates/designmd/clay.md +541 -0
  114. package/dist/services/templates/designmd/cohere.md +451 -0
  115. package/dist/services/templates/designmd/cursor.md +537 -0
  116. package/dist/services/templates/designmd/expo.md +526 -0
  117. package/dist/services/templates/designmd/figma.md +578 -0
  118. package/dist/services/templates/designmd/framer.md +544 -0
  119. package/dist/services/templates/designmd/hp.md +670 -0
  120. package/dist/services/templates/designmd/linear.app.md +548 -0
  121. package/dist/services/templates/designmd/mintlify.md +852 -0
  122. package/dist/services/templates/designmd/miro.md +825 -0
  123. package/dist/services/templates/designmd/notion.md +821 -0
  124. package/dist/services/templates/designmd/raycast.md +669 -0
  125. package/dist/services/templates/designmd/resend.md +585 -0
  126. package/dist/services/templates/designmd/sentry.md +262 -0
  127. package/dist/services/templates/designmd/shopify.md +350 -0
  128. package/dist/services/templates/designmd/spotify.md +246 -0
  129. package/dist/services/templates/designmd/stripe.md +322 -0
  130. package/dist/services/templates/designmd/supabase.md +255 -0
  131. package/dist/services/templates/designmd/superhuman.md +252 -0
  132. package/dist/services/templates/designmd/uber.md +295 -0
  133. package/dist/services/templates/designmd/vercel.md +310 -0
  134. package/dist/services/templates/viteReactTs.d.ts +48 -0
  135. package/dist/services/templates/viteReactTs.d.ts.map +1 -0
  136. package/dist/services/templates/viteReactTs.js +274 -0
  137. package/dist/services/templates/viteReactTs.js.map +1 -0
  138. package/dist/types/change-request-types.d.ts +29 -3
  139. package/dist/types/change-request-types.d.ts.map +1 -1
  140. package/dist/utils/skills/claude-skill.d.ts +2 -2
  141. package/dist/utils/skills/claude-skill.d.ts.map +1 -1
  142. package/dist/utils/skills/claude-skill.js +19 -98
  143. package/dist/utils/skills/claude-skill.js.map +1 -1
  144. package/dist/utils/skills/cursor-rules.d.ts +2 -2
  145. package/dist/utils/skills/cursor-rules.d.ts.map +1 -1
  146. package/dist/utils/skills/cursor-rules.js +15 -80
  147. package/dist/utils/skills/cursor-rules.js.map +1 -1
  148. package/dist/utils/skills/shared-variants-protocol.d.ts +23 -0
  149. package/dist/utils/skills/shared-variants-protocol.d.ts.map +1 -0
  150. package/dist/utils/skills/shared-variants-protocol.js +130 -0
  151. package/dist/utils/skills/shared-variants-protocol.js.map +1 -0
  152. package/package.json +6 -6
  153. package/src/ui/dist/assets/main-CpX7fB64.js +382 -0
  154. package/src/ui/dist/assets/main-Qqe2_oMT.css +1 -0
  155. package/src/ui/dist/index.html +2 -2
  156. package/src/ui/dist/assets/main-AsPCtLsx.js +0 -382
  157. 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_plan", "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_plan", "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,723 @@ export declare const projectContextExisting: z.ZodObject<{
36
44
  }, {
37
45
  kind: "existing";
38
46
  }>;
47
+ export declare const sourceIntentRoleSchema: z.ZodEnum<["design_source", "interaction_reference", "asset_source", "content_reference", "other"]>;
48
+ export declare const sourceIntentConfidenceSchema: z.ZodEnum<["low", "medium", "high"]>;
49
+ export declare const sourceIntentEntrySchema: z.ZodObject<{
50
+ url: z.ZodString;
51
+ role: z.ZodEnum<["design_source", "interaction_reference", "asset_source", "content_reference", "other"]>;
52
+ confidence: z.ZodEnum<["low", "medium", "high"]>;
53
+ reason: z.ZodString;
54
+ }, "strip", z.ZodTypeAny, {
55
+ reason: string;
56
+ url: string;
57
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
58
+ confidence: "low" | "medium" | "high";
59
+ }, {
60
+ reason: string;
61
+ url: string;
62
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
63
+ confidence: "low" | "medium" | "high";
64
+ }>;
65
+ export declare const sourceIntentArtifactSchema: z.ZodObject<{
66
+ sources: z.ZodArray<z.ZodObject<{
67
+ url: z.ZodString;
68
+ role: z.ZodEnum<["design_source", "interaction_reference", "asset_source", "content_reference", "other"]>;
69
+ confidence: z.ZodEnum<["low", "medium", "high"]>;
70
+ reason: z.ZodString;
71
+ }, "strip", z.ZodTypeAny, {
72
+ reason: string;
73
+ url: string;
74
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
75
+ confidence: "low" | "medium" | "high";
76
+ }, {
77
+ reason: string;
78
+ url: string;
79
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
80
+ confidence: "low" | "medium" | "high";
81
+ }>, "many">;
82
+ }, "strip", z.ZodTypeAny, {
83
+ sources: {
84
+ reason: string;
85
+ url: string;
86
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
87
+ confidence: "low" | "medium" | "high";
88
+ }[];
89
+ }, {
90
+ sources: {
91
+ reason: string;
92
+ url: string;
93
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
94
+ confidence: "low" | "medium" | "high";
95
+ }[];
96
+ }>;
97
+ export type SourceIntentRole = z.infer<typeof sourceIntentRoleSchema>;
98
+ export type SourceIntentConfidence = z.infer<typeof sourceIntentConfidenceSchema>;
99
+ export type SourceIntentEntry = z.infer<typeof sourceIntentEntrySchema>;
100
+ export type SourceIntentArtifact = z.infer<typeof sourceIntentArtifactSchema>;
101
+ export declare const designContextEntrySchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
102
+ kind: z.ZodLiteral<"slug">;
103
+ slug: z.ZodString;
104
+ }, "strip", z.ZodTypeAny, {
105
+ slug: string;
106
+ kind: "slug";
107
+ }, {
108
+ slug: string;
109
+ kind: "slug";
110
+ }>, z.ZodObject<{
111
+ kind: z.ZodLiteral<"markdown">;
112
+ content: z.ZodString;
113
+ label: z.ZodString;
114
+ }, "strip", z.ZodTypeAny, {
115
+ kind: "markdown";
116
+ label: string;
117
+ content: string;
118
+ }, {
119
+ kind: "markdown";
120
+ label: string;
121
+ content: string;
122
+ }>]>;
123
+ export declare const sourceArtifactKindSchema: z.ZodEnum<["urlText", "siteBrief", "visualBrief", "screenshotNotes"]>;
124
+ export declare const sourceArtifactInputSchema: z.ZodObject<{
125
+ kind: z.ZodEnum<["urlText", "siteBrief", "visualBrief", "screenshotNotes"]>;
126
+ label: z.ZodString;
127
+ content: z.ZodString;
128
+ }, "strip", z.ZodTypeAny, {
129
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
130
+ label: string;
131
+ content: string;
132
+ }, {
133
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
134
+ label: string;
135
+ content: string;
136
+ }>;
137
+ export declare const sourceRoleSchema: z.ZodEnum<["primary", "inspiration", "competitor"]>;
138
+ export declare const sourceRoleEntrySchema: z.ZodObject<{
139
+ url: z.ZodString;
140
+ role: z.ZodEnum<["primary", "inspiration", "competitor"]>;
141
+ rationale: z.ZodOptional<z.ZodString>;
142
+ }, "strip", z.ZodTypeAny, {
143
+ url: string;
144
+ role: "primary" | "inspiration" | "competitor";
145
+ rationale?: string | undefined;
146
+ }, {
147
+ url: string;
148
+ role: "primary" | "inspiration" | "competitor";
149
+ rationale?: string | undefined;
150
+ }>;
151
+ export declare const sourceContextArtifactSchema: z.ZodObject<{
152
+ sourceFindings: z.ZodArray<z.ZodString, "many">;
153
+ sectionInventory: z.ZodArray<z.ZodString, "many">;
154
+ visualObservations: z.ZodArray<z.ZodString, "many">;
155
+ sourceRoles: z.ZodArray<z.ZodObject<{
156
+ url: z.ZodString;
157
+ role: z.ZodEnum<["primary", "inspiration", "competitor"]>;
158
+ rationale: z.ZodOptional<z.ZodString>;
159
+ }, "strip", z.ZodTypeAny, {
160
+ url: string;
161
+ role: "primary" | "inspiration" | "competitor";
162
+ rationale?: string | undefined;
163
+ }, {
164
+ url: string;
165
+ role: "primary" | "inspiration" | "competitor";
166
+ rationale?: string | undefined;
167
+ }>, "many">;
168
+ qualityBar: z.ZodArray<z.ZodString, "many">;
169
+ screenshotReferences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
170
+ risks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
171
+ }, "strip", z.ZodTypeAny, {
172
+ sourceFindings: string[];
173
+ sectionInventory: string[];
174
+ visualObservations: string[];
175
+ sourceRoles: {
176
+ url: string;
177
+ role: "primary" | "inspiration" | "competitor";
178
+ rationale?: string | undefined;
179
+ }[];
180
+ qualityBar: string[];
181
+ screenshotReferences?: string[] | undefined;
182
+ risks?: string[] | undefined;
183
+ }, {
184
+ sourceFindings: string[];
185
+ sectionInventory: string[];
186
+ visualObservations: string[];
187
+ sourceRoles: {
188
+ url: string;
189
+ role: "primary" | "inspiration" | "competitor";
190
+ rationale?: string | undefined;
191
+ }[];
192
+ qualityBar: string[];
193
+ screenshotReferences?: string[] | undefined;
194
+ risks?: string[] | undefined;
195
+ }>;
196
+ export declare const sourceContextInputSchema: z.ZodObject<{
197
+ sourceUrls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
198
+ preserveBrand: z.ZodOptional<z.ZodBoolean>;
199
+ sourceArtifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
200
+ kind: z.ZodEnum<["urlText", "siteBrief", "visualBrief", "screenshotNotes"]>;
201
+ label: z.ZodString;
202
+ content: z.ZodString;
203
+ }, "strip", z.ZodTypeAny, {
204
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
205
+ label: string;
206
+ content: string;
207
+ }, {
208
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
209
+ label: string;
210
+ content: string;
211
+ }>, "many">>;
212
+ artifact: z.ZodOptional<z.ZodObject<{
213
+ sourceFindings: z.ZodArray<z.ZodString, "many">;
214
+ sectionInventory: z.ZodArray<z.ZodString, "many">;
215
+ visualObservations: z.ZodArray<z.ZodString, "many">;
216
+ sourceRoles: z.ZodArray<z.ZodObject<{
217
+ url: z.ZodString;
218
+ role: z.ZodEnum<["primary", "inspiration", "competitor"]>;
219
+ rationale: z.ZodOptional<z.ZodString>;
220
+ }, "strip", z.ZodTypeAny, {
221
+ url: string;
222
+ role: "primary" | "inspiration" | "competitor";
223
+ rationale?: string | undefined;
224
+ }, {
225
+ url: string;
226
+ role: "primary" | "inspiration" | "competitor";
227
+ rationale?: string | undefined;
228
+ }>, "many">;
229
+ qualityBar: z.ZodArray<z.ZodString, "many">;
230
+ screenshotReferences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
231
+ risks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
232
+ }, "strip", z.ZodTypeAny, {
233
+ sourceFindings: string[];
234
+ sectionInventory: string[];
235
+ visualObservations: string[];
236
+ sourceRoles: {
237
+ url: string;
238
+ role: "primary" | "inspiration" | "competitor";
239
+ rationale?: string | undefined;
240
+ }[];
241
+ qualityBar: string[];
242
+ screenshotReferences?: string[] | undefined;
243
+ risks?: string[] | undefined;
244
+ }, {
245
+ sourceFindings: string[];
246
+ sectionInventory: string[];
247
+ visualObservations: string[];
248
+ sourceRoles: {
249
+ url: string;
250
+ role: "primary" | "inspiration" | "competitor";
251
+ rationale?: string | undefined;
252
+ }[];
253
+ qualityBar: string[];
254
+ screenshotReferences?: string[] | undefined;
255
+ risks?: string[] | undefined;
256
+ }>>;
257
+ sourceIntent: z.ZodOptional<z.ZodObject<{
258
+ sources: z.ZodArray<z.ZodObject<{
259
+ url: z.ZodString;
260
+ role: z.ZodEnum<["design_source", "interaction_reference", "asset_source", "content_reference", "other"]>;
261
+ confidence: z.ZodEnum<["low", "medium", "high"]>;
262
+ reason: z.ZodString;
263
+ }, "strip", z.ZodTypeAny, {
264
+ reason: string;
265
+ url: string;
266
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
267
+ confidence: "low" | "medium" | "high";
268
+ }, {
269
+ reason: string;
270
+ url: string;
271
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
272
+ confidence: "low" | "medium" | "high";
273
+ }>, "many">;
274
+ }, "strip", z.ZodTypeAny, {
275
+ sources: {
276
+ reason: string;
277
+ url: string;
278
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
279
+ confidence: "low" | "medium" | "high";
280
+ }[];
281
+ }, {
282
+ sources: {
283
+ reason: string;
284
+ url: string;
285
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
286
+ confidence: "low" | "medium" | "high";
287
+ }[];
288
+ }>>;
289
+ designDecision: z.ZodOptional<z.ZodEnum<["let_rivet_choose", "go_custom"]>>;
290
+ }, "strip", z.ZodTypeAny, {
291
+ sourceUrls?: string[] | undefined;
292
+ preserveBrand?: boolean | undefined;
293
+ sourceArtifacts?: {
294
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
295
+ label: string;
296
+ content: string;
297
+ }[] | undefined;
298
+ artifact?: {
299
+ sourceFindings: string[];
300
+ sectionInventory: string[];
301
+ visualObservations: string[];
302
+ sourceRoles: {
303
+ url: string;
304
+ role: "primary" | "inspiration" | "competitor";
305
+ rationale?: string | undefined;
306
+ }[];
307
+ qualityBar: string[];
308
+ screenshotReferences?: string[] | undefined;
309
+ risks?: string[] | undefined;
310
+ } | undefined;
311
+ sourceIntent?: {
312
+ sources: {
313
+ reason: string;
314
+ url: string;
315
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
316
+ confidence: "low" | "medium" | "high";
317
+ }[];
318
+ } | undefined;
319
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
320
+ }, {
321
+ sourceUrls?: string[] | undefined;
322
+ preserveBrand?: boolean | undefined;
323
+ sourceArtifacts?: {
324
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
325
+ label: string;
326
+ content: string;
327
+ }[] | undefined;
328
+ artifact?: {
329
+ sourceFindings: string[];
330
+ sectionInventory: string[];
331
+ visualObservations: string[];
332
+ sourceRoles: {
333
+ url: string;
334
+ role: "primary" | "inspiration" | "competitor";
335
+ rationale?: string | undefined;
336
+ }[];
337
+ qualityBar: string[];
338
+ screenshotReferences?: string[] | undefined;
339
+ risks?: string[] | undefined;
340
+ } | undefined;
341
+ sourceIntent?: {
342
+ sources: {
343
+ reason: string;
344
+ url: string;
345
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
346
+ confidence: "low" | "medium" | "high";
347
+ }[];
348
+ } | undefined;
349
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
350
+ }>;
351
+ export declare const executionModeSchema: z.ZodEnum<["static_preview", "vite_app"]>;
352
+ export declare const executionConfidenceSchema: z.ZodEnum<["low", "medium", "high"]>;
353
+ /**
354
+ * One file to copy from an absolute disk path into the generated project.
355
+ * `destination` is project-relative (e.g. `public/assets/avatar.glb`);
356
+ * `referenceAs` is the served path the generated code should use (e.g.
357
+ * `/assets/avatar.glb`). The agent decides asset routing at planning time
358
+ * so MCP can materialize the same layout for every variant.
359
+ */
360
+ export declare const assetPlanEntrySchema: z.ZodObject<{
361
+ source: z.ZodString;
362
+ destination: z.ZodString;
363
+ referenceAs: z.ZodString;
364
+ }, "strip", z.ZodTypeAny, {
365
+ source: string;
366
+ destination: string;
367
+ referenceAs: string;
368
+ }, {
369
+ source: string;
370
+ destination: string;
371
+ referenceAs: string;
372
+ }>;
373
+ export declare const executionCapabilityPlanSchema: z.ZodObject<{
374
+ mode: z.ZodEnum<["static_preview", "vite_app"]>;
375
+ confidence: z.ZodEnum<["low", "medium", "high"]>;
376
+ reason: z.ZodString;
377
+ assetPlan: z.ZodOptional<z.ZodArray<z.ZodObject<{
378
+ source: z.ZodString;
379
+ destination: z.ZodString;
380
+ referenceAs: z.ZodString;
381
+ }, "strip", z.ZodTypeAny, {
382
+ source: string;
383
+ destination: string;
384
+ referenceAs: string;
385
+ }, {
386
+ source: string;
387
+ destination: string;
388
+ referenceAs: string;
389
+ }>, "many">>;
390
+ runtimeRequirements: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
391
+ userQuestion: z.ZodOptional<z.ZodString>;
392
+ }, "strip", z.ZodTypeAny, {
393
+ mode: "static_preview" | "vite_app";
394
+ reason: string;
395
+ confidence: "low" | "medium" | "high";
396
+ assetPlan?: {
397
+ source: string;
398
+ destination: string;
399
+ referenceAs: string;
400
+ }[] | undefined;
401
+ runtimeRequirements?: string[] | undefined;
402
+ userQuestion?: string | undefined;
403
+ }, {
404
+ mode: "static_preview" | "vite_app";
405
+ reason: string;
406
+ confidence: "low" | "medium" | "high";
407
+ assetPlan?: {
408
+ source: string;
409
+ destination: string;
410
+ referenceAs: string;
411
+ }[] | undefined;
412
+ runtimeRequirements?: string[] | undefined;
413
+ userQuestion?: string | undefined;
414
+ }>;
415
+ export type ExecutionMode = z.infer<typeof executionModeSchema>;
416
+ export type ExecutionConfidence = z.infer<typeof executionConfidenceSchema>;
417
+ export type AssetPlanEntry = z.infer<typeof assetPlanEntrySchema>;
418
+ export type ExecutionCapabilityPlan = z.infer<typeof executionCapabilityPlanSchema>;
39
419
  export declare const projectContextFresh: z.ZodObject<{
40
420
  kind: z.ZodLiteral<"fresh">;
41
421
  workspacePath: z.ZodString;
42
422
  framework: z.ZodOptional<z.ZodEnum<["vite", "next", "astro", "remix"]>>;
423
+ assetSourceRoot: z.ZodOptional<z.ZodString>;
424
+ /** Per-variant-slot design context. Slug entries resolve bundled catalog
425
+ * markdown; markdown entries are written directly as `DESIGN.md`. The
426
+ * order matches code-gen variant slot order. */
427
+ designContext: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
428
+ kind: z.ZodLiteral<"slug">;
429
+ slug: z.ZodString;
430
+ }, "strip", z.ZodTypeAny, {
431
+ slug: string;
432
+ kind: "slug";
433
+ }, {
434
+ slug: string;
435
+ kind: "slug";
436
+ }>, z.ZodObject<{
437
+ kind: z.ZodLiteral<"markdown">;
438
+ content: z.ZodString;
439
+ label: z.ZodString;
440
+ }, "strip", z.ZodTypeAny, {
441
+ kind: "markdown";
442
+ label: string;
443
+ content: string;
444
+ }, {
445
+ kind: "markdown";
446
+ label: string;
447
+ content: string;
448
+ }>]>, "many">>;
449
+ sourceContext: z.ZodOptional<z.ZodObject<{
450
+ sourceUrls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
451
+ preserveBrand: z.ZodOptional<z.ZodBoolean>;
452
+ sourceArtifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
453
+ kind: z.ZodEnum<["urlText", "siteBrief", "visualBrief", "screenshotNotes"]>;
454
+ label: z.ZodString;
455
+ content: z.ZodString;
456
+ }, "strip", z.ZodTypeAny, {
457
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
458
+ label: string;
459
+ content: string;
460
+ }, {
461
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
462
+ label: string;
463
+ content: string;
464
+ }>, "many">>;
465
+ artifact: z.ZodOptional<z.ZodObject<{
466
+ sourceFindings: z.ZodArray<z.ZodString, "many">;
467
+ sectionInventory: z.ZodArray<z.ZodString, "many">;
468
+ visualObservations: z.ZodArray<z.ZodString, "many">;
469
+ sourceRoles: z.ZodArray<z.ZodObject<{
470
+ url: z.ZodString;
471
+ role: z.ZodEnum<["primary", "inspiration", "competitor"]>;
472
+ rationale: z.ZodOptional<z.ZodString>;
473
+ }, "strip", z.ZodTypeAny, {
474
+ url: string;
475
+ role: "primary" | "inspiration" | "competitor";
476
+ rationale?: string | undefined;
477
+ }, {
478
+ url: string;
479
+ role: "primary" | "inspiration" | "competitor";
480
+ rationale?: string | undefined;
481
+ }>, "many">;
482
+ qualityBar: z.ZodArray<z.ZodString, "many">;
483
+ screenshotReferences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
484
+ risks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
485
+ }, "strip", z.ZodTypeAny, {
486
+ sourceFindings: string[];
487
+ sectionInventory: string[];
488
+ visualObservations: string[];
489
+ sourceRoles: {
490
+ url: string;
491
+ role: "primary" | "inspiration" | "competitor";
492
+ rationale?: string | undefined;
493
+ }[];
494
+ qualityBar: string[];
495
+ screenshotReferences?: string[] | undefined;
496
+ risks?: string[] | undefined;
497
+ }, {
498
+ sourceFindings: string[];
499
+ sectionInventory: string[];
500
+ visualObservations: string[];
501
+ sourceRoles: {
502
+ url: string;
503
+ role: "primary" | "inspiration" | "competitor";
504
+ rationale?: string | undefined;
505
+ }[];
506
+ qualityBar: string[];
507
+ screenshotReferences?: string[] | undefined;
508
+ risks?: string[] | undefined;
509
+ }>>;
510
+ sourceIntent: z.ZodOptional<z.ZodObject<{
511
+ sources: z.ZodArray<z.ZodObject<{
512
+ url: z.ZodString;
513
+ role: z.ZodEnum<["design_source", "interaction_reference", "asset_source", "content_reference", "other"]>;
514
+ confidence: z.ZodEnum<["low", "medium", "high"]>;
515
+ reason: z.ZodString;
516
+ }, "strip", z.ZodTypeAny, {
517
+ reason: string;
518
+ url: string;
519
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
520
+ confidence: "low" | "medium" | "high";
521
+ }, {
522
+ reason: string;
523
+ url: string;
524
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
525
+ confidence: "low" | "medium" | "high";
526
+ }>, "many">;
527
+ }, "strip", z.ZodTypeAny, {
528
+ sources: {
529
+ reason: string;
530
+ url: string;
531
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
532
+ confidence: "low" | "medium" | "high";
533
+ }[];
534
+ }, {
535
+ sources: {
536
+ reason: string;
537
+ url: string;
538
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
539
+ confidence: "low" | "medium" | "high";
540
+ }[];
541
+ }>>;
542
+ designDecision: z.ZodOptional<z.ZodEnum<["let_rivet_choose", "go_custom"]>>;
543
+ }, "strip", z.ZodTypeAny, {
544
+ sourceUrls?: string[] | undefined;
545
+ preserveBrand?: boolean | undefined;
546
+ sourceArtifacts?: {
547
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
548
+ label: string;
549
+ content: string;
550
+ }[] | undefined;
551
+ artifact?: {
552
+ sourceFindings: string[];
553
+ sectionInventory: string[];
554
+ visualObservations: string[];
555
+ sourceRoles: {
556
+ url: string;
557
+ role: "primary" | "inspiration" | "competitor";
558
+ rationale?: string | undefined;
559
+ }[];
560
+ qualityBar: string[];
561
+ screenshotReferences?: string[] | undefined;
562
+ risks?: string[] | undefined;
563
+ } | undefined;
564
+ sourceIntent?: {
565
+ sources: {
566
+ reason: string;
567
+ url: string;
568
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
569
+ confidence: "low" | "medium" | "high";
570
+ }[];
571
+ } | undefined;
572
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
573
+ }, {
574
+ sourceUrls?: string[] | undefined;
575
+ preserveBrand?: boolean | undefined;
576
+ sourceArtifacts?: {
577
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
578
+ label: string;
579
+ content: string;
580
+ }[] | undefined;
581
+ artifact?: {
582
+ sourceFindings: string[];
583
+ sectionInventory: string[];
584
+ visualObservations: string[];
585
+ sourceRoles: {
586
+ url: string;
587
+ role: "primary" | "inspiration" | "competitor";
588
+ rationale?: string | undefined;
589
+ }[];
590
+ qualityBar: string[];
591
+ screenshotReferences?: string[] | undefined;
592
+ risks?: string[] | undefined;
593
+ } | undefined;
594
+ sourceIntent?: {
595
+ sources: {
596
+ reason: string;
597
+ url: string;
598
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
599
+ confidence: "low" | "medium" | "high";
600
+ }[];
601
+ } | undefined;
602
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
603
+ }>>;
604
+ /** Agent-supplied execution plan from `report_source_plan`. Drives the
605
+ * generation routing decision at approve() time: `static_preview` keeps
606
+ * the lightweight HTML-only path; `vite_app` provisions a real Vite
607
+ * worktree per variant and copies any large assets from `assetPlan`. */
608
+ executionPlan: z.ZodOptional<z.ZodObject<{
609
+ mode: z.ZodEnum<["static_preview", "vite_app"]>;
610
+ confidence: z.ZodEnum<["low", "medium", "high"]>;
611
+ reason: z.ZodString;
612
+ assetPlan: z.ZodOptional<z.ZodArray<z.ZodObject<{
613
+ source: z.ZodString;
614
+ destination: z.ZodString;
615
+ referenceAs: z.ZodString;
616
+ }, "strip", z.ZodTypeAny, {
617
+ source: string;
618
+ destination: string;
619
+ referenceAs: string;
620
+ }, {
621
+ source: string;
622
+ destination: string;
623
+ referenceAs: string;
624
+ }>, "many">>;
625
+ runtimeRequirements: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
626
+ userQuestion: z.ZodOptional<z.ZodString>;
627
+ }, "strip", z.ZodTypeAny, {
628
+ mode: "static_preview" | "vite_app";
629
+ reason: string;
630
+ confidence: "low" | "medium" | "high";
631
+ assetPlan?: {
632
+ source: string;
633
+ destination: string;
634
+ referenceAs: string;
635
+ }[] | undefined;
636
+ runtimeRequirements?: string[] | undefined;
637
+ userQuestion?: string | undefined;
638
+ }, {
639
+ mode: "static_preview" | "vite_app";
640
+ reason: string;
641
+ confidence: "low" | "medium" | "high";
642
+ assetPlan?: {
643
+ source: string;
644
+ destination: string;
645
+ referenceAs: string;
646
+ }[] | undefined;
647
+ runtimeRequirements?: string[] | undefined;
648
+ userQuestion?: string | undefined;
649
+ }>>;
43
650
  }, "strip", z.ZodTypeAny, {
44
651
  kind: "fresh";
45
652
  workspacePath: string;
46
653
  framework?: "next" | "vite" | "remix" | "astro" | undefined;
654
+ assetSourceRoot?: string | undefined;
655
+ designContext?: ({
656
+ slug: string;
657
+ kind: "slug";
658
+ } | {
659
+ kind: "markdown";
660
+ label: string;
661
+ content: string;
662
+ })[] | undefined;
663
+ sourceContext?: {
664
+ sourceUrls?: string[] | undefined;
665
+ preserveBrand?: boolean | undefined;
666
+ sourceArtifacts?: {
667
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
668
+ label: string;
669
+ content: string;
670
+ }[] | undefined;
671
+ artifact?: {
672
+ sourceFindings: string[];
673
+ sectionInventory: string[];
674
+ visualObservations: string[];
675
+ sourceRoles: {
676
+ url: string;
677
+ role: "primary" | "inspiration" | "competitor";
678
+ rationale?: string | undefined;
679
+ }[];
680
+ qualityBar: string[];
681
+ screenshotReferences?: string[] | undefined;
682
+ risks?: string[] | undefined;
683
+ } | undefined;
684
+ sourceIntent?: {
685
+ sources: {
686
+ reason: string;
687
+ url: string;
688
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
689
+ confidence: "low" | "medium" | "high";
690
+ }[];
691
+ } | undefined;
692
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
693
+ } | undefined;
694
+ executionPlan?: {
695
+ mode: "static_preview" | "vite_app";
696
+ reason: string;
697
+ confidence: "low" | "medium" | "high";
698
+ assetPlan?: {
699
+ source: string;
700
+ destination: string;
701
+ referenceAs: string;
702
+ }[] | undefined;
703
+ runtimeRequirements?: string[] | undefined;
704
+ userQuestion?: string | undefined;
705
+ } | undefined;
47
706
  }, {
48
707
  kind: "fresh";
49
708
  workspacePath: string;
50
709
  framework?: "next" | "vite" | "remix" | "astro" | undefined;
710
+ assetSourceRoot?: string | undefined;
711
+ designContext?: ({
712
+ slug: string;
713
+ kind: "slug";
714
+ } | {
715
+ kind: "markdown";
716
+ label: string;
717
+ content: string;
718
+ })[] | undefined;
719
+ sourceContext?: {
720
+ sourceUrls?: string[] | undefined;
721
+ preserveBrand?: boolean | undefined;
722
+ sourceArtifacts?: {
723
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
724
+ label: string;
725
+ content: string;
726
+ }[] | undefined;
727
+ artifact?: {
728
+ sourceFindings: string[];
729
+ sectionInventory: string[];
730
+ visualObservations: string[];
731
+ sourceRoles: {
732
+ url: string;
733
+ role: "primary" | "inspiration" | "competitor";
734
+ rationale?: string | undefined;
735
+ }[];
736
+ qualityBar: string[];
737
+ screenshotReferences?: string[] | undefined;
738
+ risks?: string[] | undefined;
739
+ } | undefined;
740
+ sourceIntent?: {
741
+ sources: {
742
+ reason: string;
743
+ url: string;
744
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
745
+ confidence: "low" | "medium" | "high";
746
+ }[];
747
+ } | undefined;
748
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
749
+ } | undefined;
750
+ executionPlan?: {
751
+ mode: "static_preview" | "vite_app";
752
+ reason: string;
753
+ confidence: "low" | "medium" | "high";
754
+ assetPlan?: {
755
+ source: string;
756
+ destination: string;
757
+ referenceAs: string;
758
+ }[] | undefined;
759
+ runtimeRequirements?: string[] | undefined;
760
+ userQuestion?: string | undefined;
761
+ } | undefined;
51
762
  }>;
52
- export declare const projectContextSchema: z.ZodUnion<[z.ZodObject<{
763
+ export declare const projectContextSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
53
764
  kind: z.ZodLiteral<"existing">;
54
765
  }, "strip", z.ZodTypeAny, {
55
766
  kind: "existing";
@@ -59,16 +770,477 @@ export declare const projectContextSchema: z.ZodUnion<[z.ZodObject<{
59
770
  kind: z.ZodLiteral<"fresh">;
60
771
  workspacePath: z.ZodString;
61
772
  framework: z.ZodOptional<z.ZodEnum<["vite", "next", "astro", "remix"]>>;
773
+ assetSourceRoot: z.ZodOptional<z.ZodString>;
774
+ /** Per-variant-slot design context. Slug entries resolve bundled catalog
775
+ * markdown; markdown entries are written directly as `DESIGN.md`. The
776
+ * order matches code-gen variant slot order. */
777
+ designContext: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
778
+ kind: z.ZodLiteral<"slug">;
779
+ slug: z.ZodString;
780
+ }, "strip", z.ZodTypeAny, {
781
+ slug: string;
782
+ kind: "slug";
783
+ }, {
784
+ slug: string;
785
+ kind: "slug";
786
+ }>, z.ZodObject<{
787
+ kind: z.ZodLiteral<"markdown">;
788
+ content: z.ZodString;
789
+ label: z.ZodString;
790
+ }, "strip", z.ZodTypeAny, {
791
+ kind: "markdown";
792
+ label: string;
793
+ content: string;
794
+ }, {
795
+ kind: "markdown";
796
+ label: string;
797
+ content: string;
798
+ }>]>, "many">>;
799
+ sourceContext: z.ZodOptional<z.ZodObject<{
800
+ sourceUrls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
801
+ preserveBrand: z.ZodOptional<z.ZodBoolean>;
802
+ sourceArtifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
803
+ kind: z.ZodEnum<["urlText", "siteBrief", "visualBrief", "screenshotNotes"]>;
804
+ label: z.ZodString;
805
+ content: z.ZodString;
806
+ }, "strip", z.ZodTypeAny, {
807
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
808
+ label: string;
809
+ content: string;
810
+ }, {
811
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
812
+ label: string;
813
+ content: string;
814
+ }>, "many">>;
815
+ artifact: z.ZodOptional<z.ZodObject<{
816
+ sourceFindings: z.ZodArray<z.ZodString, "many">;
817
+ sectionInventory: z.ZodArray<z.ZodString, "many">;
818
+ visualObservations: z.ZodArray<z.ZodString, "many">;
819
+ sourceRoles: z.ZodArray<z.ZodObject<{
820
+ url: z.ZodString;
821
+ role: z.ZodEnum<["primary", "inspiration", "competitor"]>;
822
+ rationale: z.ZodOptional<z.ZodString>;
823
+ }, "strip", z.ZodTypeAny, {
824
+ url: string;
825
+ role: "primary" | "inspiration" | "competitor";
826
+ rationale?: string | undefined;
827
+ }, {
828
+ url: string;
829
+ role: "primary" | "inspiration" | "competitor";
830
+ rationale?: string | undefined;
831
+ }>, "many">;
832
+ qualityBar: z.ZodArray<z.ZodString, "many">;
833
+ screenshotReferences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
834
+ risks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
835
+ }, "strip", z.ZodTypeAny, {
836
+ sourceFindings: string[];
837
+ sectionInventory: string[];
838
+ visualObservations: string[];
839
+ sourceRoles: {
840
+ url: string;
841
+ role: "primary" | "inspiration" | "competitor";
842
+ rationale?: string | undefined;
843
+ }[];
844
+ qualityBar: string[];
845
+ screenshotReferences?: string[] | undefined;
846
+ risks?: string[] | undefined;
847
+ }, {
848
+ sourceFindings: string[];
849
+ sectionInventory: string[];
850
+ visualObservations: string[];
851
+ sourceRoles: {
852
+ url: string;
853
+ role: "primary" | "inspiration" | "competitor";
854
+ rationale?: string | undefined;
855
+ }[];
856
+ qualityBar: string[];
857
+ screenshotReferences?: string[] | undefined;
858
+ risks?: string[] | undefined;
859
+ }>>;
860
+ sourceIntent: z.ZodOptional<z.ZodObject<{
861
+ sources: z.ZodArray<z.ZodObject<{
862
+ url: z.ZodString;
863
+ role: z.ZodEnum<["design_source", "interaction_reference", "asset_source", "content_reference", "other"]>;
864
+ confidence: z.ZodEnum<["low", "medium", "high"]>;
865
+ reason: z.ZodString;
866
+ }, "strip", z.ZodTypeAny, {
867
+ reason: string;
868
+ url: string;
869
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
870
+ confidence: "low" | "medium" | "high";
871
+ }, {
872
+ reason: string;
873
+ url: string;
874
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
875
+ confidence: "low" | "medium" | "high";
876
+ }>, "many">;
877
+ }, "strip", z.ZodTypeAny, {
878
+ sources: {
879
+ reason: string;
880
+ url: string;
881
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
882
+ confidence: "low" | "medium" | "high";
883
+ }[];
884
+ }, {
885
+ sources: {
886
+ reason: string;
887
+ url: string;
888
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
889
+ confidence: "low" | "medium" | "high";
890
+ }[];
891
+ }>>;
892
+ designDecision: z.ZodOptional<z.ZodEnum<["let_rivet_choose", "go_custom"]>>;
893
+ }, "strip", z.ZodTypeAny, {
894
+ sourceUrls?: string[] | undefined;
895
+ preserveBrand?: boolean | undefined;
896
+ sourceArtifacts?: {
897
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
898
+ label: string;
899
+ content: string;
900
+ }[] | undefined;
901
+ artifact?: {
902
+ sourceFindings: string[];
903
+ sectionInventory: string[];
904
+ visualObservations: string[];
905
+ sourceRoles: {
906
+ url: string;
907
+ role: "primary" | "inspiration" | "competitor";
908
+ rationale?: string | undefined;
909
+ }[];
910
+ qualityBar: string[];
911
+ screenshotReferences?: string[] | undefined;
912
+ risks?: string[] | undefined;
913
+ } | undefined;
914
+ sourceIntent?: {
915
+ sources: {
916
+ reason: string;
917
+ url: string;
918
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
919
+ confidence: "low" | "medium" | "high";
920
+ }[];
921
+ } | undefined;
922
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
923
+ }, {
924
+ sourceUrls?: string[] | undefined;
925
+ preserveBrand?: boolean | undefined;
926
+ sourceArtifacts?: {
927
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
928
+ label: string;
929
+ content: string;
930
+ }[] | undefined;
931
+ artifact?: {
932
+ sourceFindings: string[];
933
+ sectionInventory: string[];
934
+ visualObservations: string[];
935
+ sourceRoles: {
936
+ url: string;
937
+ role: "primary" | "inspiration" | "competitor";
938
+ rationale?: string | undefined;
939
+ }[];
940
+ qualityBar: string[];
941
+ screenshotReferences?: string[] | undefined;
942
+ risks?: string[] | undefined;
943
+ } | undefined;
944
+ sourceIntent?: {
945
+ sources: {
946
+ reason: string;
947
+ url: string;
948
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
949
+ confidence: "low" | "medium" | "high";
950
+ }[];
951
+ } | undefined;
952
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
953
+ }>>;
954
+ /** Agent-supplied execution plan from `report_source_plan`. Drives the
955
+ * generation routing decision at approve() time: `static_preview` keeps
956
+ * the lightweight HTML-only path; `vite_app` provisions a real Vite
957
+ * worktree per variant and copies any large assets from `assetPlan`. */
958
+ executionPlan: z.ZodOptional<z.ZodObject<{
959
+ mode: z.ZodEnum<["static_preview", "vite_app"]>;
960
+ confidence: z.ZodEnum<["low", "medium", "high"]>;
961
+ reason: z.ZodString;
962
+ assetPlan: z.ZodOptional<z.ZodArray<z.ZodObject<{
963
+ source: z.ZodString;
964
+ destination: z.ZodString;
965
+ referenceAs: z.ZodString;
966
+ }, "strip", z.ZodTypeAny, {
967
+ source: string;
968
+ destination: string;
969
+ referenceAs: string;
970
+ }, {
971
+ source: string;
972
+ destination: string;
973
+ referenceAs: string;
974
+ }>, "many">>;
975
+ runtimeRequirements: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
976
+ userQuestion: z.ZodOptional<z.ZodString>;
977
+ }, "strip", z.ZodTypeAny, {
978
+ mode: "static_preview" | "vite_app";
979
+ reason: string;
980
+ confidence: "low" | "medium" | "high";
981
+ assetPlan?: {
982
+ source: string;
983
+ destination: string;
984
+ referenceAs: string;
985
+ }[] | undefined;
986
+ runtimeRequirements?: string[] | undefined;
987
+ userQuestion?: string | undefined;
988
+ }, {
989
+ mode: "static_preview" | "vite_app";
990
+ reason: string;
991
+ confidence: "low" | "medium" | "high";
992
+ assetPlan?: {
993
+ source: string;
994
+ destination: string;
995
+ referenceAs: string;
996
+ }[] | undefined;
997
+ runtimeRequirements?: string[] | undefined;
998
+ userQuestion?: string | undefined;
999
+ }>>;
62
1000
  }, "strip", z.ZodTypeAny, {
63
1001
  kind: "fresh";
64
1002
  workspacePath: string;
65
1003
  framework?: "next" | "vite" | "remix" | "astro" | undefined;
1004
+ assetSourceRoot?: string | undefined;
1005
+ designContext?: ({
1006
+ slug: string;
1007
+ kind: "slug";
1008
+ } | {
1009
+ kind: "markdown";
1010
+ label: string;
1011
+ content: string;
1012
+ })[] | undefined;
1013
+ sourceContext?: {
1014
+ sourceUrls?: string[] | undefined;
1015
+ preserveBrand?: boolean | undefined;
1016
+ sourceArtifacts?: {
1017
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
1018
+ label: string;
1019
+ content: string;
1020
+ }[] | undefined;
1021
+ artifact?: {
1022
+ sourceFindings: string[];
1023
+ sectionInventory: string[];
1024
+ visualObservations: string[];
1025
+ sourceRoles: {
1026
+ url: string;
1027
+ role: "primary" | "inspiration" | "competitor";
1028
+ rationale?: string | undefined;
1029
+ }[];
1030
+ qualityBar: string[];
1031
+ screenshotReferences?: string[] | undefined;
1032
+ risks?: string[] | undefined;
1033
+ } | undefined;
1034
+ sourceIntent?: {
1035
+ sources: {
1036
+ reason: string;
1037
+ url: string;
1038
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
1039
+ confidence: "low" | "medium" | "high";
1040
+ }[];
1041
+ } | undefined;
1042
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
1043
+ } | undefined;
1044
+ executionPlan?: {
1045
+ mode: "static_preview" | "vite_app";
1046
+ reason: string;
1047
+ confidence: "low" | "medium" | "high";
1048
+ assetPlan?: {
1049
+ source: string;
1050
+ destination: string;
1051
+ referenceAs: string;
1052
+ }[] | undefined;
1053
+ runtimeRequirements?: string[] | undefined;
1054
+ userQuestion?: string | undefined;
1055
+ } | undefined;
66
1056
  }, {
67
1057
  kind: "fresh";
68
1058
  workspacePath: string;
69
1059
  framework?: "next" | "vite" | "remix" | "astro" | undefined;
1060
+ assetSourceRoot?: string | undefined;
1061
+ designContext?: ({
1062
+ slug: string;
1063
+ kind: "slug";
1064
+ } | {
1065
+ kind: "markdown";
1066
+ label: string;
1067
+ content: string;
1068
+ })[] | undefined;
1069
+ sourceContext?: {
1070
+ sourceUrls?: string[] | undefined;
1071
+ preserveBrand?: boolean | undefined;
1072
+ sourceArtifacts?: {
1073
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
1074
+ label: string;
1075
+ content: string;
1076
+ }[] | undefined;
1077
+ artifact?: {
1078
+ sourceFindings: string[];
1079
+ sectionInventory: string[];
1080
+ visualObservations: string[];
1081
+ sourceRoles: {
1082
+ url: string;
1083
+ role: "primary" | "inspiration" | "competitor";
1084
+ rationale?: string | undefined;
1085
+ }[];
1086
+ qualityBar: string[];
1087
+ screenshotReferences?: string[] | undefined;
1088
+ risks?: string[] | undefined;
1089
+ } | undefined;
1090
+ sourceIntent?: {
1091
+ sources: {
1092
+ reason: string;
1093
+ url: string;
1094
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
1095
+ confidence: "low" | "medium" | "high";
1096
+ }[];
1097
+ } | undefined;
1098
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
1099
+ } | undefined;
1100
+ executionPlan?: {
1101
+ mode: "static_preview" | "vite_app";
1102
+ reason: string;
1103
+ confidence: "low" | "medium" | "high";
1104
+ assetPlan?: {
1105
+ source: string;
1106
+ destination: string;
1107
+ referenceAs: string;
1108
+ }[] | undefined;
1109
+ runtimeRequirements?: string[] | undefined;
1110
+ userQuestion?: string | undefined;
1111
+ } | undefined;
70
1112
  }>]>;
71
1113
  export type ProjectContext = z.infer<typeof projectContextSchema>;
1114
+ export type DesignContextEntry = z.infer<typeof designContextEntrySchema>;
1115
+ export type SourceArtifactInput = z.infer<typeof sourceArtifactInputSchema>;
1116
+ export type SourceRole = z.infer<typeof sourceRoleSchema>;
1117
+ export type SourceContextArtifact = z.infer<typeof sourceContextArtifactSchema>;
1118
+ export type SourceContextInput = z.infer<typeof sourceContextInputSchema>;
1119
+ export type VariantDesignSource = {
1120
+ kind: 'slug';
1121
+ slug: string;
1122
+ displayName: string;
1123
+ } | {
1124
+ kind: 'markdown';
1125
+ label: string;
1126
+ };
1127
+ export type VariantPreviewSource = {
1128
+ kind: 'dev_server';
1129
+ port: number;
1130
+ } | {
1131
+ kind: 'static_artifact';
1132
+ url: string;
1133
+ };
1134
+ export type ActiveProjectContext = {
1135
+ kind: 'existing';
1136
+ } | {
1137
+ kind: 'fresh';
1138
+ workspacePath: string;
1139
+ framework?: 'vite' | 'next' | 'astro' | 'remix';
1140
+ designContext?: Array<{
1141
+ kind: 'slug';
1142
+ slug: string;
1143
+ } | {
1144
+ kind: 'markdown';
1145
+ label: string;
1146
+ }>;
1147
+ sourceContext?: {
1148
+ sourceCount: number;
1149
+ isSourceGrounded: boolean;
1150
+ };
1151
+ /** Compact summary of the agent's execution plan, suitable for chip /
1152
+ * artifact rendering. The full plan stays on the project context. */
1153
+ executionPlan?: {
1154
+ mode: ExecutionMode;
1155
+ confidence: ExecutionConfidence;
1156
+ reason: string;
1157
+ assetCount: number;
1158
+ runtimeRequirementCount: number;
1159
+ };
1160
+ };
1161
+ export interface ActiveVariantActions {
1162
+ view?: {
1163
+ enabled: boolean;
1164
+ reason?: string;
1165
+ };
1166
+ commit?: {
1167
+ enabled: boolean;
1168
+ reason?: string;
1169
+ };
1170
+ }
1171
+ export interface ActiveVariantSnapshot {
1172
+ workItemId: string;
1173
+ briefId: string;
1174
+ label: string;
1175
+ status: WorkItemStatus;
1176
+ design?: VariantDesignSource;
1177
+ preview?: VariantPreviewSource;
1178
+ port?: number;
1179
+ errorCode?: string;
1180
+ actions?: ActiveVariantActions;
1181
+ /**
1182
+ * Objective post-generation QA verdict. Present once the orchestrator has
1183
+ * run preview QA against the variant's deliverable (asset reachability,
1184
+ * runtime/console health). Surfaced on the chip so the user can see why
1185
+ * a variant is not committable. `not_run` indicates QA has not yet been
1186
+ * exercised for this variant kind (e.g. existing-project `code_gen`).
1187
+ */
1188
+ qa?: VariantQaResult;
1189
+ }
1190
+ /**
1191
+ * Kinds of supporting artifact a variants session can surface to the UI.
1192
+ * `design_context` is the only kind populated today (the DESIGN.md used or
1193
+ * generated for a 0→1 run); the other kinds reserve shape for source
1194
+ * research bundles, QA reports, and persisted asset manifests so the
1195
+ * snapshot contract stays stable as those land.
1196
+ */
1197
+ export declare const VARIANT_ARTIFACT_KINDS: readonly ["design_context", "source_context", "qa_report", "asset"];
1198
+ export type VariantArtifactKind = (typeof VARIANT_ARTIFACT_KINDS)[number];
1199
+ export type VariantArtifactStatus = 'ready' | 'warning' | 'failed';
1200
+ export type VariantArtifactSource = 'agent_browser' | 'cache' | 'static' | 'manual';
1201
+ export type VariantArtifactContentType = 'text/markdown' | 'application/json' | 'text/plain';
1202
+ /**
1203
+ * Stable, transport-safe shape for one supporting artifact attached to a
1204
+ * variants session. For `design_context` artifacts the full markdown
1205
+ * content is required (the UI renders it inline); other kinds may omit
1206
+ * `content` and surface metadata only.
1207
+ */
1208
+ export interface VariantSessionArtifact {
1209
+ id: string;
1210
+ kind: VariantArtifactKind;
1211
+ label: string;
1212
+ summary?: string;
1213
+ usedByVariantCount?: number;
1214
+ status?: VariantArtifactStatus;
1215
+ source?: VariantArtifactSource;
1216
+ contentType?: VariantArtifactContentType;
1217
+ content?: string;
1218
+ path?: string;
1219
+ warnings?: string[];
1220
+ }
1221
+ export type VariantQaStatus = 'passed' | 'failed' | 'not_run';
1222
+ /**
1223
+ * Categorical QA failure mode. Mirrors the failure surfaces the gate
1224
+ * checks for static previews — referenced assets that fail to load, code
1225
+ * that throws on initial render, or a preview document that couldn't be
1226
+ * fetched at all. Kept small so the user-facing prompt can stay legible.
1227
+ */
1228
+ export type VariantQaIssueKind = 'asset_load_failed' | 'console_error' | 'preview_unavailable';
1229
+ export interface VariantQaIssue {
1230
+ kind: VariantQaIssueKind;
1231
+ /** Asset URL or runtime source location that triggered the failure. */
1232
+ detail: string;
1233
+ /** Optional human-readable extra context — e.g. HTTP status, error message. */
1234
+ message?: string;
1235
+ }
1236
+ export interface VariantQaResult {
1237
+ status: VariantQaStatus;
1238
+ issues: VariantQaIssue[];
1239
+ /** Compact, user-facing summary suitable for chip + prompt rendering. */
1240
+ summary: string;
1241
+ /** Source of the inspected preview (the URL or marker the runner used). */
1242
+ checkedSource?: string;
1243
+ }
72
1244
  export declare const targetSchema: z.ZodObject<{
73
1245
  type: z.ZodEnum<["element", "file", "route"]>;
74
1246
  ref: z.ZodString;
@@ -84,16 +1256,31 @@ export declare const briefSchema: z.ZodObject<{
84
1256
  briefId: z.ZodString;
85
1257
  label: z.ZodString;
86
1258
  body: z.ZodString;
1259
+ /**
1260
+ * Optional per-brief visual reference URL. Uses the same synchronous
1261
+ * network-target guard as inspiration URLs before downstream agents fetch it.
1262
+ */
1263
+ visualReferenceUrl: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
87
1264
  }, "strip", z.ZodTypeAny, {
88
- briefId: string;
89
1265
  label: string;
90
1266
  body: string;
91
- }, {
92
1267
  briefId: string;
1268
+ visualReferenceUrl?: string | undefined;
1269
+ }, {
93
1270
  label: string;
94
1271
  body: string;
1272
+ briefId: string;
1273
+ visualReferenceUrl?: string | undefined;
95
1274
  }>;
96
1275
  export type Brief = z.infer<typeof briefSchema>;
1276
+ /**
1277
+ * Inclusive bounds for the number of variants a single propose_variants run
1278
+ * may produce. Exported as named constants so the UI (parseVariantCount),
1279
+ * the /api/mcp/queue-changes intake Zod schema, and the propose_variants tool
1280
+ * schema all consume the same source of truth.
1281
+ */
1282
+ export declare const VARIANT_COUNT_MIN = 2;
1283
+ export declare const VARIANT_COUNT_MAX = 8;
97
1284
  export declare const proposeVariantsInput: {
98
1285
  sessionId: z.ZodOptional<z.ZodString>;
99
1286
  clientRequestId: z.ZodOptional<z.ZodString>;
@@ -109,7 +1296,7 @@ export declare const proposeVariantsInput: {
109
1296
  type: "element" | "file" | "route";
110
1297
  ref: string;
111
1298
  }>>;
112
- projectContext: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
1299
+ projectContext: z.ZodOptional<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
113
1300
  kind: z.ZodLiteral<"existing">;
114
1301
  }, "strip", z.ZodTypeAny, {
115
1302
  kind: "existing";
@@ -119,14 +1306,345 @@ export declare const proposeVariantsInput: {
119
1306
  kind: z.ZodLiteral<"fresh">;
120
1307
  workspacePath: z.ZodString;
121
1308
  framework: z.ZodOptional<z.ZodEnum<["vite", "next", "astro", "remix"]>>;
1309
+ assetSourceRoot: z.ZodOptional<z.ZodString>;
1310
+ /** Per-variant-slot design context. Slug entries resolve bundled catalog
1311
+ * markdown; markdown entries are written directly as `DESIGN.md`. The
1312
+ * order matches code-gen variant slot order. */
1313
+ designContext: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1314
+ kind: z.ZodLiteral<"slug">;
1315
+ slug: z.ZodString;
1316
+ }, "strip", z.ZodTypeAny, {
1317
+ slug: string;
1318
+ kind: "slug";
1319
+ }, {
1320
+ slug: string;
1321
+ kind: "slug";
1322
+ }>, z.ZodObject<{
1323
+ kind: z.ZodLiteral<"markdown">;
1324
+ content: z.ZodString;
1325
+ label: z.ZodString;
1326
+ }, "strip", z.ZodTypeAny, {
1327
+ kind: "markdown";
1328
+ label: string;
1329
+ content: string;
1330
+ }, {
1331
+ kind: "markdown";
1332
+ label: string;
1333
+ content: string;
1334
+ }>]>, "many">>;
1335
+ sourceContext: z.ZodOptional<z.ZodObject<{
1336
+ sourceUrls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1337
+ preserveBrand: z.ZodOptional<z.ZodBoolean>;
1338
+ sourceArtifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
1339
+ kind: z.ZodEnum<["urlText", "siteBrief", "visualBrief", "screenshotNotes"]>;
1340
+ label: z.ZodString;
1341
+ content: z.ZodString;
1342
+ }, "strip", z.ZodTypeAny, {
1343
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
1344
+ label: string;
1345
+ content: string;
1346
+ }, {
1347
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
1348
+ label: string;
1349
+ content: string;
1350
+ }>, "many">>;
1351
+ artifact: z.ZodOptional<z.ZodObject<{
1352
+ sourceFindings: z.ZodArray<z.ZodString, "many">;
1353
+ sectionInventory: z.ZodArray<z.ZodString, "many">;
1354
+ visualObservations: z.ZodArray<z.ZodString, "many">;
1355
+ sourceRoles: z.ZodArray<z.ZodObject<{
1356
+ url: z.ZodString;
1357
+ role: z.ZodEnum<["primary", "inspiration", "competitor"]>;
1358
+ rationale: z.ZodOptional<z.ZodString>;
1359
+ }, "strip", z.ZodTypeAny, {
1360
+ url: string;
1361
+ role: "primary" | "inspiration" | "competitor";
1362
+ rationale?: string | undefined;
1363
+ }, {
1364
+ url: string;
1365
+ role: "primary" | "inspiration" | "competitor";
1366
+ rationale?: string | undefined;
1367
+ }>, "many">;
1368
+ qualityBar: z.ZodArray<z.ZodString, "many">;
1369
+ screenshotReferences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1370
+ risks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1371
+ }, "strip", z.ZodTypeAny, {
1372
+ sourceFindings: string[];
1373
+ sectionInventory: string[];
1374
+ visualObservations: string[];
1375
+ sourceRoles: {
1376
+ url: string;
1377
+ role: "primary" | "inspiration" | "competitor";
1378
+ rationale?: string | undefined;
1379
+ }[];
1380
+ qualityBar: string[];
1381
+ screenshotReferences?: string[] | undefined;
1382
+ risks?: string[] | undefined;
1383
+ }, {
1384
+ sourceFindings: string[];
1385
+ sectionInventory: string[];
1386
+ visualObservations: string[];
1387
+ sourceRoles: {
1388
+ url: string;
1389
+ role: "primary" | "inspiration" | "competitor";
1390
+ rationale?: string | undefined;
1391
+ }[];
1392
+ qualityBar: string[];
1393
+ screenshotReferences?: string[] | undefined;
1394
+ risks?: string[] | undefined;
1395
+ }>>;
1396
+ sourceIntent: z.ZodOptional<z.ZodObject<{
1397
+ sources: z.ZodArray<z.ZodObject<{
1398
+ url: z.ZodString;
1399
+ role: z.ZodEnum<["design_source", "interaction_reference", "asset_source", "content_reference", "other"]>;
1400
+ confidence: z.ZodEnum<["low", "medium", "high"]>;
1401
+ reason: z.ZodString;
1402
+ }, "strip", z.ZodTypeAny, {
1403
+ reason: string;
1404
+ url: string;
1405
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
1406
+ confidence: "low" | "medium" | "high";
1407
+ }, {
1408
+ reason: string;
1409
+ url: string;
1410
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
1411
+ confidence: "low" | "medium" | "high";
1412
+ }>, "many">;
1413
+ }, "strip", z.ZodTypeAny, {
1414
+ sources: {
1415
+ reason: string;
1416
+ url: string;
1417
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
1418
+ confidence: "low" | "medium" | "high";
1419
+ }[];
1420
+ }, {
1421
+ sources: {
1422
+ reason: string;
1423
+ url: string;
1424
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
1425
+ confidence: "low" | "medium" | "high";
1426
+ }[];
1427
+ }>>;
1428
+ designDecision: z.ZodOptional<z.ZodEnum<["let_rivet_choose", "go_custom"]>>;
1429
+ }, "strip", z.ZodTypeAny, {
1430
+ sourceUrls?: string[] | undefined;
1431
+ preserveBrand?: boolean | undefined;
1432
+ sourceArtifacts?: {
1433
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
1434
+ label: string;
1435
+ content: string;
1436
+ }[] | undefined;
1437
+ artifact?: {
1438
+ sourceFindings: string[];
1439
+ sectionInventory: string[];
1440
+ visualObservations: string[];
1441
+ sourceRoles: {
1442
+ url: string;
1443
+ role: "primary" | "inspiration" | "competitor";
1444
+ rationale?: string | undefined;
1445
+ }[];
1446
+ qualityBar: string[];
1447
+ screenshotReferences?: string[] | undefined;
1448
+ risks?: string[] | undefined;
1449
+ } | undefined;
1450
+ sourceIntent?: {
1451
+ sources: {
1452
+ reason: string;
1453
+ url: string;
1454
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
1455
+ confidence: "low" | "medium" | "high";
1456
+ }[];
1457
+ } | undefined;
1458
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
1459
+ }, {
1460
+ sourceUrls?: string[] | undefined;
1461
+ preserveBrand?: boolean | undefined;
1462
+ sourceArtifacts?: {
1463
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
1464
+ label: string;
1465
+ content: string;
1466
+ }[] | undefined;
1467
+ artifact?: {
1468
+ sourceFindings: string[];
1469
+ sectionInventory: string[];
1470
+ visualObservations: string[];
1471
+ sourceRoles: {
1472
+ url: string;
1473
+ role: "primary" | "inspiration" | "competitor";
1474
+ rationale?: string | undefined;
1475
+ }[];
1476
+ qualityBar: string[];
1477
+ screenshotReferences?: string[] | undefined;
1478
+ risks?: string[] | undefined;
1479
+ } | undefined;
1480
+ sourceIntent?: {
1481
+ sources: {
1482
+ reason: string;
1483
+ url: string;
1484
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
1485
+ confidence: "low" | "medium" | "high";
1486
+ }[];
1487
+ } | undefined;
1488
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
1489
+ }>>;
1490
+ /** Agent-supplied execution plan from `report_source_plan`. Drives the
1491
+ * generation routing decision at approve() time: `static_preview` keeps
1492
+ * the lightweight HTML-only path; `vite_app` provisions a real Vite
1493
+ * worktree per variant and copies any large assets from `assetPlan`. */
1494
+ executionPlan: z.ZodOptional<z.ZodObject<{
1495
+ mode: z.ZodEnum<["static_preview", "vite_app"]>;
1496
+ confidence: z.ZodEnum<["low", "medium", "high"]>;
1497
+ reason: z.ZodString;
1498
+ assetPlan: z.ZodOptional<z.ZodArray<z.ZodObject<{
1499
+ source: z.ZodString;
1500
+ destination: z.ZodString;
1501
+ referenceAs: z.ZodString;
1502
+ }, "strip", z.ZodTypeAny, {
1503
+ source: string;
1504
+ destination: string;
1505
+ referenceAs: string;
1506
+ }, {
1507
+ source: string;
1508
+ destination: string;
1509
+ referenceAs: string;
1510
+ }>, "many">>;
1511
+ runtimeRequirements: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1512
+ userQuestion: z.ZodOptional<z.ZodString>;
1513
+ }, "strip", z.ZodTypeAny, {
1514
+ mode: "static_preview" | "vite_app";
1515
+ reason: string;
1516
+ confidence: "low" | "medium" | "high";
1517
+ assetPlan?: {
1518
+ source: string;
1519
+ destination: string;
1520
+ referenceAs: string;
1521
+ }[] | undefined;
1522
+ runtimeRequirements?: string[] | undefined;
1523
+ userQuestion?: string | undefined;
1524
+ }, {
1525
+ mode: "static_preview" | "vite_app";
1526
+ reason: string;
1527
+ confidence: "low" | "medium" | "high";
1528
+ assetPlan?: {
1529
+ source: string;
1530
+ destination: string;
1531
+ referenceAs: string;
1532
+ }[] | undefined;
1533
+ runtimeRequirements?: string[] | undefined;
1534
+ userQuestion?: string | undefined;
1535
+ }>>;
122
1536
  }, "strip", z.ZodTypeAny, {
123
1537
  kind: "fresh";
124
1538
  workspacePath: string;
125
1539
  framework?: "next" | "vite" | "remix" | "astro" | undefined;
1540
+ assetSourceRoot?: string | undefined;
1541
+ designContext?: ({
1542
+ slug: string;
1543
+ kind: "slug";
1544
+ } | {
1545
+ kind: "markdown";
1546
+ label: string;
1547
+ content: string;
1548
+ })[] | undefined;
1549
+ sourceContext?: {
1550
+ sourceUrls?: string[] | undefined;
1551
+ preserveBrand?: boolean | undefined;
1552
+ sourceArtifacts?: {
1553
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
1554
+ label: string;
1555
+ content: string;
1556
+ }[] | undefined;
1557
+ artifact?: {
1558
+ sourceFindings: string[];
1559
+ sectionInventory: string[];
1560
+ visualObservations: string[];
1561
+ sourceRoles: {
1562
+ url: string;
1563
+ role: "primary" | "inspiration" | "competitor";
1564
+ rationale?: string | undefined;
1565
+ }[];
1566
+ qualityBar: string[];
1567
+ screenshotReferences?: string[] | undefined;
1568
+ risks?: string[] | undefined;
1569
+ } | undefined;
1570
+ sourceIntent?: {
1571
+ sources: {
1572
+ reason: string;
1573
+ url: string;
1574
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
1575
+ confidence: "low" | "medium" | "high";
1576
+ }[];
1577
+ } | undefined;
1578
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
1579
+ } | undefined;
1580
+ executionPlan?: {
1581
+ mode: "static_preview" | "vite_app";
1582
+ reason: string;
1583
+ confidence: "low" | "medium" | "high";
1584
+ assetPlan?: {
1585
+ source: string;
1586
+ destination: string;
1587
+ referenceAs: string;
1588
+ }[] | undefined;
1589
+ runtimeRequirements?: string[] | undefined;
1590
+ userQuestion?: string | undefined;
1591
+ } | undefined;
126
1592
  }, {
127
1593
  kind: "fresh";
128
1594
  workspacePath: string;
129
1595
  framework?: "next" | "vite" | "remix" | "astro" | undefined;
1596
+ assetSourceRoot?: string | undefined;
1597
+ designContext?: ({
1598
+ slug: string;
1599
+ kind: "slug";
1600
+ } | {
1601
+ kind: "markdown";
1602
+ label: string;
1603
+ content: string;
1604
+ })[] | undefined;
1605
+ sourceContext?: {
1606
+ sourceUrls?: string[] | undefined;
1607
+ preserveBrand?: boolean | undefined;
1608
+ sourceArtifacts?: {
1609
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
1610
+ label: string;
1611
+ content: string;
1612
+ }[] | undefined;
1613
+ artifact?: {
1614
+ sourceFindings: string[];
1615
+ sectionInventory: string[];
1616
+ visualObservations: string[];
1617
+ sourceRoles: {
1618
+ url: string;
1619
+ role: "primary" | "inspiration" | "competitor";
1620
+ rationale?: string | undefined;
1621
+ }[];
1622
+ qualityBar: string[];
1623
+ screenshotReferences?: string[] | undefined;
1624
+ risks?: string[] | undefined;
1625
+ } | undefined;
1626
+ sourceIntent?: {
1627
+ sources: {
1628
+ reason: string;
1629
+ url: string;
1630
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
1631
+ confidence: "low" | "medium" | "high";
1632
+ }[];
1633
+ } | undefined;
1634
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
1635
+ } | undefined;
1636
+ executionPlan?: {
1637
+ mode: "static_preview" | "vite_app";
1638
+ reason: string;
1639
+ confidence: "low" | "medium" | "high";
1640
+ assetPlan?: {
1641
+ source: string;
1642
+ destination: string;
1643
+ referenceAs: string;
1644
+ }[] | undefined;
1645
+ runtimeRequirements?: string[] | undefined;
1646
+ userQuestion?: string | undefined;
1647
+ } | undefined;
130
1648
  }>]>>;
131
1649
  };
132
1650
  export type ProposeVariantsInput = {
@@ -146,16 +1664,490 @@ export declare const reportVariantBriefsInput: {
146
1664
  briefId: z.ZodString;
147
1665
  label: z.ZodString;
148
1666
  body: z.ZodString;
1667
+ /**
1668
+ * Optional per-brief visual reference URL. Uses the same synchronous
1669
+ * network-target guard as inspiration URLs before downstream agents fetch it.
1670
+ */
1671
+ visualReferenceUrl: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
149
1672
  }, "strip", z.ZodTypeAny, {
150
- briefId: string;
151
1673
  label: string;
152
1674
  body: string;
153
- }, {
154
1675
  briefId: string;
1676
+ visualReferenceUrl?: string | undefined;
1677
+ }, {
155
1678
  label: string;
156
1679
  body: string;
1680
+ briefId: string;
1681
+ visualReferenceUrl?: string | undefined;
157
1682
  }>, "many">;
158
1683
  };
1684
+ declare const browserDesignContextSchema: z.ZodObject<{
1685
+ url: z.ZodString;
1686
+ label: z.ZodString;
1687
+ markdown: z.ZodString;
1688
+ }, "strip", z.ZodTypeAny, {
1689
+ markdown: string;
1690
+ url: string;
1691
+ label: string;
1692
+ }, {
1693
+ markdown: string;
1694
+ url: string;
1695
+ label: string;
1696
+ }>;
1697
+ /**
1698
+ * Consolidated planning artifact reported by the agent in a single tool call.
1699
+ * Combines URL/role classification, research findings, browser-extracted
1700
+ * DESIGN.md per design_source URL, and the static_preview vs vite_app
1701
+ * execution decision. Replaces the prior `report_source_intent` +
1702
+ * `report_source_context` round-trips so source-grounded sessions only need
1703
+ * one planning hop before briefs.
1704
+ */
1705
+ export declare const sourcePlanArtifactSchema: z.ZodObject<{
1706
+ sourceIntent: z.ZodObject<{
1707
+ sources: z.ZodArray<z.ZodObject<{
1708
+ url: z.ZodString;
1709
+ role: z.ZodEnum<["design_source", "interaction_reference", "asset_source", "content_reference", "other"]>;
1710
+ confidence: z.ZodEnum<["low", "medium", "high"]>;
1711
+ reason: z.ZodString;
1712
+ }, "strip", z.ZodTypeAny, {
1713
+ reason: string;
1714
+ url: string;
1715
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
1716
+ confidence: "low" | "medium" | "high";
1717
+ }, {
1718
+ reason: string;
1719
+ url: string;
1720
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
1721
+ confidence: "low" | "medium" | "high";
1722
+ }>, "many">;
1723
+ }, "strip", z.ZodTypeAny, {
1724
+ sources: {
1725
+ reason: string;
1726
+ url: string;
1727
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
1728
+ confidence: "low" | "medium" | "high";
1729
+ }[];
1730
+ }, {
1731
+ sources: {
1732
+ reason: string;
1733
+ url: string;
1734
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
1735
+ confidence: "low" | "medium" | "high";
1736
+ }[];
1737
+ }>;
1738
+ sourceContext: z.ZodObject<{
1739
+ sourceFindings: z.ZodArray<z.ZodString, "many">;
1740
+ sectionInventory: z.ZodArray<z.ZodString, "many">;
1741
+ visualObservations: z.ZodArray<z.ZodString, "many">;
1742
+ sourceRoles: z.ZodArray<z.ZodObject<{
1743
+ url: z.ZodString;
1744
+ role: z.ZodEnum<["primary", "inspiration", "competitor"]>;
1745
+ rationale: z.ZodOptional<z.ZodString>;
1746
+ }, "strip", z.ZodTypeAny, {
1747
+ url: string;
1748
+ role: "primary" | "inspiration" | "competitor";
1749
+ rationale?: string | undefined;
1750
+ }, {
1751
+ url: string;
1752
+ role: "primary" | "inspiration" | "competitor";
1753
+ rationale?: string | undefined;
1754
+ }>, "many">;
1755
+ qualityBar: z.ZodArray<z.ZodString, "many">;
1756
+ screenshotReferences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1757
+ risks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1758
+ }, "strip", z.ZodTypeAny, {
1759
+ sourceFindings: string[];
1760
+ sectionInventory: string[];
1761
+ visualObservations: string[];
1762
+ sourceRoles: {
1763
+ url: string;
1764
+ role: "primary" | "inspiration" | "competitor";
1765
+ rationale?: string | undefined;
1766
+ }[];
1767
+ qualityBar: string[];
1768
+ screenshotReferences?: string[] | undefined;
1769
+ risks?: string[] | undefined;
1770
+ }, {
1771
+ sourceFindings: string[];
1772
+ sectionInventory: string[];
1773
+ visualObservations: string[];
1774
+ sourceRoles: {
1775
+ url: string;
1776
+ role: "primary" | "inspiration" | "competitor";
1777
+ rationale?: string | undefined;
1778
+ }[];
1779
+ qualityBar: string[];
1780
+ screenshotReferences?: string[] | undefined;
1781
+ risks?: string[] | undefined;
1782
+ }>;
1783
+ designContexts: z.ZodOptional<z.ZodArray<z.ZodObject<{
1784
+ url: z.ZodString;
1785
+ label: z.ZodString;
1786
+ markdown: z.ZodString;
1787
+ }, "strip", z.ZodTypeAny, {
1788
+ markdown: string;
1789
+ url: string;
1790
+ label: string;
1791
+ }, {
1792
+ markdown: string;
1793
+ url: string;
1794
+ label: string;
1795
+ }>, "many">>;
1796
+ executionPlan: z.ZodObject<{
1797
+ mode: z.ZodEnum<["static_preview", "vite_app"]>;
1798
+ confidence: z.ZodEnum<["low", "medium", "high"]>;
1799
+ reason: z.ZodString;
1800
+ assetPlan: z.ZodOptional<z.ZodArray<z.ZodObject<{
1801
+ source: z.ZodString;
1802
+ destination: z.ZodString;
1803
+ referenceAs: z.ZodString;
1804
+ }, "strip", z.ZodTypeAny, {
1805
+ source: string;
1806
+ destination: string;
1807
+ referenceAs: string;
1808
+ }, {
1809
+ source: string;
1810
+ destination: string;
1811
+ referenceAs: string;
1812
+ }>, "many">>;
1813
+ runtimeRequirements: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1814
+ userQuestion: z.ZodOptional<z.ZodString>;
1815
+ }, "strip", z.ZodTypeAny, {
1816
+ mode: "static_preview" | "vite_app";
1817
+ reason: string;
1818
+ confidence: "low" | "medium" | "high";
1819
+ assetPlan?: {
1820
+ source: string;
1821
+ destination: string;
1822
+ referenceAs: string;
1823
+ }[] | undefined;
1824
+ runtimeRequirements?: string[] | undefined;
1825
+ userQuestion?: string | undefined;
1826
+ }, {
1827
+ mode: "static_preview" | "vite_app";
1828
+ reason: string;
1829
+ confidence: "low" | "medium" | "high";
1830
+ assetPlan?: {
1831
+ source: string;
1832
+ destination: string;
1833
+ referenceAs: string;
1834
+ }[] | undefined;
1835
+ runtimeRequirements?: string[] | undefined;
1836
+ userQuestion?: string | undefined;
1837
+ }>;
1838
+ }, "strip", z.ZodTypeAny, {
1839
+ sourceIntent: {
1840
+ sources: {
1841
+ reason: string;
1842
+ url: string;
1843
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
1844
+ confidence: "low" | "medium" | "high";
1845
+ }[];
1846
+ };
1847
+ sourceContext: {
1848
+ sourceFindings: string[];
1849
+ sectionInventory: string[];
1850
+ visualObservations: string[];
1851
+ sourceRoles: {
1852
+ url: string;
1853
+ role: "primary" | "inspiration" | "competitor";
1854
+ rationale?: string | undefined;
1855
+ }[];
1856
+ qualityBar: string[];
1857
+ screenshotReferences?: string[] | undefined;
1858
+ risks?: string[] | undefined;
1859
+ };
1860
+ executionPlan: {
1861
+ mode: "static_preview" | "vite_app";
1862
+ reason: string;
1863
+ confidence: "low" | "medium" | "high";
1864
+ assetPlan?: {
1865
+ source: string;
1866
+ destination: string;
1867
+ referenceAs: string;
1868
+ }[] | undefined;
1869
+ runtimeRequirements?: string[] | undefined;
1870
+ userQuestion?: string | undefined;
1871
+ };
1872
+ designContexts?: {
1873
+ markdown: string;
1874
+ url: string;
1875
+ label: string;
1876
+ }[] | undefined;
1877
+ }, {
1878
+ sourceIntent: {
1879
+ sources: {
1880
+ reason: string;
1881
+ url: string;
1882
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
1883
+ confidence: "low" | "medium" | "high";
1884
+ }[];
1885
+ };
1886
+ sourceContext: {
1887
+ sourceFindings: string[];
1888
+ sectionInventory: string[];
1889
+ visualObservations: string[];
1890
+ sourceRoles: {
1891
+ url: string;
1892
+ role: "primary" | "inspiration" | "competitor";
1893
+ rationale?: string | undefined;
1894
+ }[];
1895
+ qualityBar: string[];
1896
+ screenshotReferences?: string[] | undefined;
1897
+ risks?: string[] | undefined;
1898
+ };
1899
+ executionPlan: {
1900
+ mode: "static_preview" | "vite_app";
1901
+ reason: string;
1902
+ confidence: "low" | "medium" | "high";
1903
+ assetPlan?: {
1904
+ source: string;
1905
+ destination: string;
1906
+ referenceAs: string;
1907
+ }[] | undefined;
1908
+ runtimeRequirements?: string[] | undefined;
1909
+ userQuestion?: string | undefined;
1910
+ };
1911
+ designContexts?: {
1912
+ markdown: string;
1913
+ url: string;
1914
+ label: string;
1915
+ }[] | undefined;
1916
+ }>;
1917
+ export type SourcePlanArtifact = z.infer<typeof sourcePlanArtifactSchema>;
1918
+ export type BrowserDesignContext = z.infer<typeof browserDesignContextSchema>;
1919
+ export declare const reportSourcePlanInput: {
1920
+ sessionId: z.ZodString;
1921
+ workItemId: z.ZodString;
1922
+ attempt: z.ZodNumber;
1923
+ leaseId: z.ZodString;
1924
+ sourcePlan: z.ZodObject<{
1925
+ sourceIntent: z.ZodObject<{
1926
+ sources: z.ZodArray<z.ZodObject<{
1927
+ url: z.ZodString;
1928
+ role: z.ZodEnum<["design_source", "interaction_reference", "asset_source", "content_reference", "other"]>;
1929
+ confidence: z.ZodEnum<["low", "medium", "high"]>;
1930
+ reason: z.ZodString;
1931
+ }, "strip", z.ZodTypeAny, {
1932
+ reason: string;
1933
+ url: string;
1934
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
1935
+ confidence: "low" | "medium" | "high";
1936
+ }, {
1937
+ reason: string;
1938
+ url: string;
1939
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
1940
+ confidence: "low" | "medium" | "high";
1941
+ }>, "many">;
1942
+ }, "strip", z.ZodTypeAny, {
1943
+ sources: {
1944
+ reason: string;
1945
+ url: string;
1946
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
1947
+ confidence: "low" | "medium" | "high";
1948
+ }[];
1949
+ }, {
1950
+ sources: {
1951
+ reason: string;
1952
+ url: string;
1953
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
1954
+ confidence: "low" | "medium" | "high";
1955
+ }[];
1956
+ }>;
1957
+ sourceContext: z.ZodObject<{
1958
+ sourceFindings: z.ZodArray<z.ZodString, "many">;
1959
+ sectionInventory: z.ZodArray<z.ZodString, "many">;
1960
+ visualObservations: z.ZodArray<z.ZodString, "many">;
1961
+ sourceRoles: z.ZodArray<z.ZodObject<{
1962
+ url: z.ZodString;
1963
+ role: z.ZodEnum<["primary", "inspiration", "competitor"]>;
1964
+ rationale: z.ZodOptional<z.ZodString>;
1965
+ }, "strip", z.ZodTypeAny, {
1966
+ url: string;
1967
+ role: "primary" | "inspiration" | "competitor";
1968
+ rationale?: string | undefined;
1969
+ }, {
1970
+ url: string;
1971
+ role: "primary" | "inspiration" | "competitor";
1972
+ rationale?: string | undefined;
1973
+ }>, "many">;
1974
+ qualityBar: z.ZodArray<z.ZodString, "many">;
1975
+ screenshotReferences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1976
+ risks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1977
+ }, "strip", z.ZodTypeAny, {
1978
+ sourceFindings: string[];
1979
+ sectionInventory: string[];
1980
+ visualObservations: string[];
1981
+ sourceRoles: {
1982
+ url: string;
1983
+ role: "primary" | "inspiration" | "competitor";
1984
+ rationale?: string | undefined;
1985
+ }[];
1986
+ qualityBar: string[];
1987
+ screenshotReferences?: string[] | undefined;
1988
+ risks?: string[] | undefined;
1989
+ }, {
1990
+ sourceFindings: string[];
1991
+ sectionInventory: string[];
1992
+ visualObservations: string[];
1993
+ sourceRoles: {
1994
+ url: string;
1995
+ role: "primary" | "inspiration" | "competitor";
1996
+ rationale?: string | undefined;
1997
+ }[];
1998
+ qualityBar: string[];
1999
+ screenshotReferences?: string[] | undefined;
2000
+ risks?: string[] | undefined;
2001
+ }>;
2002
+ designContexts: z.ZodOptional<z.ZodArray<z.ZodObject<{
2003
+ url: z.ZodString;
2004
+ label: z.ZodString;
2005
+ markdown: z.ZodString;
2006
+ }, "strip", z.ZodTypeAny, {
2007
+ markdown: string;
2008
+ url: string;
2009
+ label: string;
2010
+ }, {
2011
+ markdown: string;
2012
+ url: string;
2013
+ label: string;
2014
+ }>, "many">>;
2015
+ executionPlan: z.ZodObject<{
2016
+ mode: z.ZodEnum<["static_preview", "vite_app"]>;
2017
+ confidence: z.ZodEnum<["low", "medium", "high"]>;
2018
+ reason: z.ZodString;
2019
+ assetPlan: z.ZodOptional<z.ZodArray<z.ZodObject<{
2020
+ source: z.ZodString;
2021
+ destination: z.ZodString;
2022
+ referenceAs: z.ZodString;
2023
+ }, "strip", z.ZodTypeAny, {
2024
+ source: string;
2025
+ destination: string;
2026
+ referenceAs: string;
2027
+ }, {
2028
+ source: string;
2029
+ destination: string;
2030
+ referenceAs: string;
2031
+ }>, "many">>;
2032
+ runtimeRequirements: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2033
+ userQuestion: z.ZodOptional<z.ZodString>;
2034
+ }, "strip", z.ZodTypeAny, {
2035
+ mode: "static_preview" | "vite_app";
2036
+ reason: string;
2037
+ confidence: "low" | "medium" | "high";
2038
+ assetPlan?: {
2039
+ source: string;
2040
+ destination: string;
2041
+ referenceAs: string;
2042
+ }[] | undefined;
2043
+ runtimeRequirements?: string[] | undefined;
2044
+ userQuestion?: string | undefined;
2045
+ }, {
2046
+ mode: "static_preview" | "vite_app";
2047
+ reason: string;
2048
+ confidence: "low" | "medium" | "high";
2049
+ assetPlan?: {
2050
+ source: string;
2051
+ destination: string;
2052
+ referenceAs: string;
2053
+ }[] | undefined;
2054
+ runtimeRequirements?: string[] | undefined;
2055
+ userQuestion?: string | undefined;
2056
+ }>;
2057
+ }, "strip", z.ZodTypeAny, {
2058
+ sourceIntent: {
2059
+ sources: {
2060
+ reason: string;
2061
+ url: string;
2062
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
2063
+ confidence: "low" | "medium" | "high";
2064
+ }[];
2065
+ };
2066
+ sourceContext: {
2067
+ sourceFindings: string[];
2068
+ sectionInventory: string[];
2069
+ visualObservations: string[];
2070
+ sourceRoles: {
2071
+ url: string;
2072
+ role: "primary" | "inspiration" | "competitor";
2073
+ rationale?: string | undefined;
2074
+ }[];
2075
+ qualityBar: string[];
2076
+ screenshotReferences?: string[] | undefined;
2077
+ risks?: string[] | undefined;
2078
+ };
2079
+ executionPlan: {
2080
+ mode: "static_preview" | "vite_app";
2081
+ reason: string;
2082
+ confidence: "low" | "medium" | "high";
2083
+ assetPlan?: {
2084
+ source: string;
2085
+ destination: string;
2086
+ referenceAs: string;
2087
+ }[] | undefined;
2088
+ runtimeRequirements?: string[] | undefined;
2089
+ userQuestion?: string | undefined;
2090
+ };
2091
+ designContexts?: {
2092
+ markdown: string;
2093
+ url: string;
2094
+ label: string;
2095
+ }[] | undefined;
2096
+ }, {
2097
+ sourceIntent: {
2098
+ sources: {
2099
+ reason: string;
2100
+ url: string;
2101
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
2102
+ confidence: "low" | "medium" | "high";
2103
+ }[];
2104
+ };
2105
+ sourceContext: {
2106
+ sourceFindings: string[];
2107
+ sectionInventory: string[];
2108
+ visualObservations: string[];
2109
+ sourceRoles: {
2110
+ url: string;
2111
+ role: "primary" | "inspiration" | "competitor";
2112
+ rationale?: string | undefined;
2113
+ }[];
2114
+ qualityBar: string[];
2115
+ screenshotReferences?: string[] | undefined;
2116
+ risks?: string[] | undefined;
2117
+ };
2118
+ executionPlan: {
2119
+ mode: "static_preview" | "vite_app";
2120
+ reason: string;
2121
+ confidence: "low" | "medium" | "high";
2122
+ assetPlan?: {
2123
+ source: string;
2124
+ destination: string;
2125
+ referenceAs: string;
2126
+ }[] | undefined;
2127
+ runtimeRequirements?: string[] | undefined;
2128
+ userQuestion?: string | undefined;
2129
+ };
2130
+ designContexts?: {
2131
+ markdown: string;
2132
+ url: string;
2133
+ label: string;
2134
+ }[] | undefined;
2135
+ }>;
2136
+ };
2137
+ export type ReportSourcePlanInput = {
2138
+ sessionId: string;
2139
+ workItemId: string;
2140
+ attempt: number;
2141
+ leaseId: string;
2142
+ sourcePlan: SourcePlanArtifact;
2143
+ };
2144
+ export interface SourcePlanWorkItemDescriptor {
2145
+ id: string;
2146
+ kind: 'source_plan';
2147
+ attempt: number;
2148
+ input: unknown;
2149
+ output_schema: unknown;
2150
+ }
159
2151
  export type ReportVariantBriefsInput = {
160
2152
  sessionId: string;
161
2153
  workItemId: string;
@@ -166,6 +2158,9 @@ export type ReportVariantBriefsInput = {
166
2158
  export declare const approveVariantBriefsInput: {
167
2159
  sessionId: z.ZodString;
168
2160
  briefIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2161
+ confirmedByUser: z.ZodOptional<z.ZodBoolean>;
2162
+ bypassRequestedByUser: z.ZodOptional<z.ZodBoolean>;
2163
+ bypassReason: z.ZodOptional<z.ZodString>;
169
2164
  selections: z.ZodOptional<z.ZodArray<z.ZodObject<{
170
2165
  briefId: z.ZodString;
171
2166
  bodyOverride: z.ZodOptional<z.ZodString>;
@@ -180,6 +2175,9 @@ export declare const approveVariantBriefsInput: {
180
2175
  export type ApproveVariantBriefsInput = {
181
2176
  sessionId: string;
182
2177
  briefIds?: string[];
2178
+ confirmedByUser?: boolean;
2179
+ bypassRequestedByUser?: boolean;
2180
+ bypassReason?: string;
183
2181
  selections?: Array<{
184
2182
  briefId: string;
185
2183
  bodyOverride?: string;
@@ -199,16 +2197,24 @@ export type ApproveVariantBriefsOutput = {
199
2197
  export declare const commitVariantInput: {
200
2198
  sessionId: z.ZodString;
201
2199
  variantId: z.ZodString;
2200
+ confirmedByUser: z.ZodOptional<z.ZodBoolean>;
2201
+ bypassRequestedByUser: z.ZodOptional<z.ZodBoolean>;
2202
+ bypassReason: z.ZodOptional<z.ZodString>;
202
2203
  };
203
2204
  export type CommitVariantInput = {
204
2205
  sessionId: string;
205
2206
  variantId: string;
2207
+ confirmedByUser?: boolean;
2208
+ bypassRequestedByUser?: boolean;
2209
+ bypassReason?: string;
206
2210
  };
207
2211
  export type CommitVariantOutput = {
208
2212
  stage: Stage;
209
2213
  enqueued: boolean;
210
2214
  duplicate: boolean;
211
2215
  changedFilesCount: number;
2216
+ payloadKind?: 'diff' | 'diff-applied' | 'project-created';
2217
+ destinationPath?: string;
212
2218
  } | {
213
2219
  stage: 'failed';
214
2220
  errorCode: ErrorCode;
@@ -246,6 +2252,9 @@ export declare const reportVariantCompleteInput: {
246
2252
  code: string;
247
2253
  }>>;
248
2254
  terminalChunk: z.ZodOptional<z.ZodString>;
2255
+ tokensIn: z.ZodOptional<z.ZodNumber>;
2256
+ tokensOut: z.ZodOptional<z.ZodNumber>;
2257
+ model: z.ZodOptional<z.ZodString>;
249
2258
  };
250
2259
  export type ReportVariantCompleteInput = {
251
2260
  sessionId: string;
@@ -259,6 +2268,60 @@ export type ReportVariantCompleteInput = {
259
2268
  message: string;
260
2269
  };
261
2270
  terminalChunk?: string;
2271
+ tokensIn?: number;
2272
+ tokensOut?: number;
2273
+ model?: string;
2274
+ };
2275
+ /**
2276
+ * Stateless inspiration-extraction kickoff. Agents call this before
2277
+ * `start_variants(mode='zero_to_one')` when the user provides inspiration
2278
+ * URLs or other source artifacts, then pass the returned `designContext`
2279
+ * (and optional `sourceContext` echo) into `start_variants`.
2280
+ */
2281
+ export declare const extractInspirationContextInput: {
2282
+ prompt: z.ZodString;
2283
+ count: z.ZodNumber;
2284
+ urls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2285
+ preserveBrand: z.ZodOptional<z.ZodBoolean>;
2286
+ sourceArtifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
2287
+ kind: z.ZodEnum<["urlText", "siteBrief", "visualBrief", "screenshotNotes"]>;
2288
+ label: z.ZodString;
2289
+ content: z.ZodString;
2290
+ }, "strip", z.ZodTypeAny, {
2291
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
2292
+ label: string;
2293
+ content: string;
2294
+ }, {
2295
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
2296
+ label: string;
2297
+ content: string;
2298
+ }>, "many">>;
2299
+ /** When true, bypass any cache entry and force a fresh fetch + extract. */
2300
+ forceRefresh: z.ZodOptional<z.ZodBoolean>;
2301
+ /** Caller-supplied correlation id, echoed into telemetry so this stateless
2302
+ * extraction can be tied to the subsequent `start_variants` call (which
2303
+ * accepts the same field) even though no session exists yet. */
2304
+ clientRequestId: z.ZodOptional<z.ZodString>;
2305
+ };
2306
+ export type ExtractInspirationContextInput = {
2307
+ prompt: string;
2308
+ count: number;
2309
+ urls?: string[];
2310
+ preserveBrand?: boolean;
2311
+ sourceArtifacts?: SourceArtifactInput[];
2312
+ forceRefresh?: boolean;
2313
+ clientRequestId?: string;
2314
+ };
2315
+ export type ExtractInspirationContextOutput = {
2316
+ designContext: DesignContextEntry[];
2317
+ warnings: string[];
2318
+ /** Echoed back so the agent can forward the same shape into
2319
+ * `start_variants(mode='zero_to_one')` without reconstructing it. */
2320
+ sourceContext?: SourceContextInput;
2321
+ } | {
2322
+ stage: 'failed';
2323
+ errorCode: ErrorCode;
2324
+ message: string;
262
2325
  };
263
2326
  export declare const cancelVariantsInput: {
264
2327
  sessionId: z.ZodString;
@@ -268,6 +2331,342 @@ export type CancelVariantsInput = {
268
2331
  sessionId: string;
269
2332
  reason?: string;
270
2333
  };
2334
+ export declare const cancelVariantInput: {
2335
+ sessionId: z.ZodString;
2336
+ variantId: z.ZodString;
2337
+ reason: z.ZodOptional<z.ZodString>;
2338
+ };
2339
+ export type CancelVariantInput = {
2340
+ sessionId: string;
2341
+ variantId: string;
2342
+ reason?: string;
2343
+ };
2344
+ export type CancelVariantOutput = {
2345
+ sessionId: string;
2346
+ variantId: string;
2347
+ finalStatus: WorkItemStatus;
2348
+ sessionStage: Stage;
2349
+ alreadyTerminal: boolean;
2350
+ } | {
2351
+ stage: 'failed';
2352
+ errorCode: ErrorCode;
2353
+ message: string;
2354
+ };
2355
+ export declare const startVariantsMode: z.ZodEnum<["existing", "zero_to_one"]>;
2356
+ /**
2357
+ * Brief content supplied by the agent through `start_variants`. The server
2358
+ * generates briefIds, so the agent only provides label + body (and an
2359
+ * optional visualReferenceUrl). Shape matches `briefSchema` minus briefId.
2360
+ */
2361
+ export declare const startVariantsBriefContent: z.ZodObject<Omit<{
2362
+ briefId: z.ZodString;
2363
+ label: z.ZodString;
2364
+ body: z.ZodString;
2365
+ /**
2366
+ * Optional per-brief visual reference URL. Uses the same synchronous
2367
+ * network-target guard as inspiration URLs before downstream agents fetch it.
2368
+ */
2369
+ visualReferenceUrl: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
2370
+ }, "briefId">, "strip", z.ZodTypeAny, {
2371
+ label: string;
2372
+ body: string;
2373
+ visualReferenceUrl?: string | undefined;
2374
+ }, {
2375
+ label: string;
2376
+ body: string;
2377
+ visualReferenceUrl?: string | undefined;
2378
+ }>;
2379
+ export declare const startVariantsInput: {
2380
+ prompt: z.ZodString;
2381
+ count: z.ZodOptional<z.ZodNumber>;
2382
+ mode: z.ZodEnum<["existing", "zero_to_one"]>;
2383
+ target: z.ZodOptional<z.ZodObject<{
2384
+ type: z.ZodEnum<["element", "file", "route"]>;
2385
+ ref: z.ZodString;
2386
+ }, "strip", z.ZodTypeAny, {
2387
+ type: "element" | "file" | "route";
2388
+ ref: string;
2389
+ }, {
2390
+ type: "element" | "file" | "route";
2391
+ ref: string;
2392
+ }>>;
2393
+ /**
2394
+ * Per-variant briefs supplied by the agent. When omitted, the server
2395
+ * falls back to a generic "Variant N" label + the prompt verbatim for
2396
+ * each body — UI shows that as the variant name/description, so the
2397
+ * agent should always supply briefs for human-readable variants. When
2398
+ * `briefs` is provided, its length determines the variant count
2399
+ * (overriding any explicit `count`).
2400
+ */
2401
+ briefs: z.ZodOptional<z.ZodArray<z.ZodObject<Omit<{
2402
+ briefId: z.ZodString;
2403
+ label: z.ZodString;
2404
+ body: z.ZodString;
2405
+ /**
2406
+ * Optional per-brief visual reference URL. Uses the same synchronous
2407
+ * network-target guard as inspiration URLs before downstream agents fetch it.
2408
+ */
2409
+ visualReferenceUrl: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
2410
+ }, "briefId">, "strip", z.ZodTypeAny, {
2411
+ label: string;
2412
+ body: string;
2413
+ visualReferenceUrl?: string | undefined;
2414
+ }, {
2415
+ label: string;
2416
+ body: string;
2417
+ visualReferenceUrl?: string | undefined;
2418
+ }>, "many">>;
2419
+ /** Zero-to-one only: framework for the scaffolded project. Defaults to 'vite'. */
2420
+ framework: z.ZodOptional<z.ZodEnum<["vite"]>>;
2421
+ /** Zero-to-one only: absolute parent directory under which Rivet derives
2422
+ * a slugified project folder. Defaults to the user's home dir. */
2423
+ destinationParent: z.ZodOptional<z.ZodString>;
2424
+ /** Existing only: absolute path to the project. Defaults to the MCP
2425
+ * server's current working directory. Used to detect framework and
2426
+ * auto-open the visual editor without a separate detect_project call. */
2427
+ projectPath: z.ZodOptional<z.ZodString>;
2428
+ /** Zero-to-one only: per-variant-slot design context produced upstream by
2429
+ * `extract_inspiration_context`. Threaded into the fresh worktree as
2430
+ * DESIGN.md per slot. Slot order matches variant order. */
2431
+ designContext: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
2432
+ kind: z.ZodLiteral<"slug">;
2433
+ slug: z.ZodString;
2434
+ }, "strip", z.ZodTypeAny, {
2435
+ slug: string;
2436
+ kind: "slug";
2437
+ }, {
2438
+ slug: string;
2439
+ kind: "slug";
2440
+ }>, z.ZodObject<{
2441
+ kind: z.ZodLiteral<"markdown">;
2442
+ content: z.ZodString;
2443
+ label: z.ZodString;
2444
+ }, "strip", z.ZodTypeAny, {
2445
+ kind: "markdown";
2446
+ label: string;
2447
+ content: string;
2448
+ }, {
2449
+ kind: "markdown";
2450
+ label: string;
2451
+ content: string;
2452
+ }>]>, "many">>;
2453
+ /** Zero-to-one only: optional source-context metadata (inspiration URLs,
2454
+ * preserveBrand flag, sourceArtifacts). Forwarded to the worktree
2455
+ * scaffold so SOURCE_CONTEXT.md is written. */
2456
+ sourceContext: z.ZodOptional<z.ZodObject<{
2457
+ sourceUrls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2458
+ preserveBrand: z.ZodOptional<z.ZodBoolean>;
2459
+ sourceArtifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
2460
+ kind: z.ZodEnum<["urlText", "siteBrief", "visualBrief", "screenshotNotes"]>;
2461
+ label: z.ZodString;
2462
+ content: z.ZodString;
2463
+ }, "strip", z.ZodTypeAny, {
2464
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
2465
+ label: string;
2466
+ content: string;
2467
+ }, {
2468
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
2469
+ label: string;
2470
+ content: string;
2471
+ }>, "many">>;
2472
+ artifact: z.ZodOptional<z.ZodObject<{
2473
+ sourceFindings: z.ZodArray<z.ZodString, "many">;
2474
+ sectionInventory: z.ZodArray<z.ZodString, "many">;
2475
+ visualObservations: z.ZodArray<z.ZodString, "many">;
2476
+ sourceRoles: z.ZodArray<z.ZodObject<{
2477
+ url: z.ZodString;
2478
+ role: z.ZodEnum<["primary", "inspiration", "competitor"]>;
2479
+ rationale: z.ZodOptional<z.ZodString>;
2480
+ }, "strip", z.ZodTypeAny, {
2481
+ url: string;
2482
+ role: "primary" | "inspiration" | "competitor";
2483
+ rationale?: string | undefined;
2484
+ }, {
2485
+ url: string;
2486
+ role: "primary" | "inspiration" | "competitor";
2487
+ rationale?: string | undefined;
2488
+ }>, "many">;
2489
+ qualityBar: z.ZodArray<z.ZodString, "many">;
2490
+ screenshotReferences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2491
+ risks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2492
+ }, "strip", z.ZodTypeAny, {
2493
+ sourceFindings: string[];
2494
+ sectionInventory: string[];
2495
+ visualObservations: string[];
2496
+ sourceRoles: {
2497
+ url: string;
2498
+ role: "primary" | "inspiration" | "competitor";
2499
+ rationale?: string | undefined;
2500
+ }[];
2501
+ qualityBar: string[];
2502
+ screenshotReferences?: string[] | undefined;
2503
+ risks?: string[] | undefined;
2504
+ }, {
2505
+ sourceFindings: string[];
2506
+ sectionInventory: string[];
2507
+ visualObservations: string[];
2508
+ sourceRoles: {
2509
+ url: string;
2510
+ role: "primary" | "inspiration" | "competitor";
2511
+ rationale?: string | undefined;
2512
+ }[];
2513
+ qualityBar: string[];
2514
+ screenshotReferences?: string[] | undefined;
2515
+ risks?: string[] | undefined;
2516
+ }>>;
2517
+ sourceIntent: z.ZodOptional<z.ZodObject<{
2518
+ sources: z.ZodArray<z.ZodObject<{
2519
+ url: z.ZodString;
2520
+ role: z.ZodEnum<["design_source", "interaction_reference", "asset_source", "content_reference", "other"]>;
2521
+ confidence: z.ZodEnum<["low", "medium", "high"]>;
2522
+ reason: z.ZodString;
2523
+ }, "strip", z.ZodTypeAny, {
2524
+ reason: string;
2525
+ url: string;
2526
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
2527
+ confidence: "low" | "medium" | "high";
2528
+ }, {
2529
+ reason: string;
2530
+ url: string;
2531
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
2532
+ confidence: "low" | "medium" | "high";
2533
+ }>, "many">;
2534
+ }, "strip", z.ZodTypeAny, {
2535
+ sources: {
2536
+ reason: string;
2537
+ url: string;
2538
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
2539
+ confidence: "low" | "medium" | "high";
2540
+ }[];
2541
+ }, {
2542
+ sources: {
2543
+ reason: string;
2544
+ url: string;
2545
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
2546
+ confidence: "low" | "medium" | "high";
2547
+ }[];
2548
+ }>>;
2549
+ designDecision: z.ZodOptional<z.ZodEnum<["let_rivet_choose", "go_custom"]>>;
2550
+ }, "strip", z.ZodTypeAny, {
2551
+ sourceUrls?: string[] | undefined;
2552
+ preserveBrand?: boolean | undefined;
2553
+ sourceArtifacts?: {
2554
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
2555
+ label: string;
2556
+ content: string;
2557
+ }[] | undefined;
2558
+ artifact?: {
2559
+ sourceFindings: string[];
2560
+ sectionInventory: string[];
2561
+ visualObservations: string[];
2562
+ sourceRoles: {
2563
+ url: string;
2564
+ role: "primary" | "inspiration" | "competitor";
2565
+ rationale?: string | undefined;
2566
+ }[];
2567
+ qualityBar: string[];
2568
+ screenshotReferences?: string[] | undefined;
2569
+ risks?: string[] | undefined;
2570
+ } | undefined;
2571
+ sourceIntent?: {
2572
+ sources: {
2573
+ reason: string;
2574
+ url: string;
2575
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
2576
+ confidence: "low" | "medium" | "high";
2577
+ }[];
2578
+ } | undefined;
2579
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
2580
+ }, {
2581
+ sourceUrls?: string[] | undefined;
2582
+ preserveBrand?: boolean | undefined;
2583
+ sourceArtifacts?: {
2584
+ kind: "urlText" | "siteBrief" | "visualBrief" | "screenshotNotes";
2585
+ label: string;
2586
+ content: string;
2587
+ }[] | undefined;
2588
+ artifact?: {
2589
+ sourceFindings: string[];
2590
+ sectionInventory: string[];
2591
+ visualObservations: string[];
2592
+ sourceRoles: {
2593
+ url: string;
2594
+ role: "primary" | "inspiration" | "competitor";
2595
+ rationale?: string | undefined;
2596
+ }[];
2597
+ qualityBar: string[];
2598
+ screenshotReferences?: string[] | undefined;
2599
+ risks?: string[] | undefined;
2600
+ } | undefined;
2601
+ sourceIntent?: {
2602
+ sources: {
2603
+ reason: string;
2604
+ url: string;
2605
+ role: "other" | "design_source" | "interaction_reference" | "asset_source" | "content_reference";
2606
+ confidence: "low" | "medium" | "high";
2607
+ }[];
2608
+ } | undefined;
2609
+ designDecision?: "let_rivet_choose" | "go_custom" | undefined;
2610
+ }>>;
2611
+ clientRequestId: z.ZodOptional<z.ZodString>;
2612
+ };
2613
+ export type StartVariantsBriefContent = z.infer<typeof startVariantsBriefContent>;
2614
+ export type StartVariantsInput = {
2615
+ prompt: string;
2616
+ count?: number;
2617
+ mode: 'existing' | 'zero_to_one';
2618
+ target?: Target;
2619
+ framework?: 'vite';
2620
+ destinationParent?: string;
2621
+ projectPath?: string;
2622
+ designContext?: DesignContextEntry[];
2623
+ sourceContext?: SourceContextInput;
2624
+ clientRequestId?: string;
2625
+ briefs?: StartVariantsBriefContent[];
2626
+ };
2627
+ /**
2628
+ * Variant entry in the start_variants response. Carries everything the
2629
+ * agent needs to begin code-gen immediately — no follow-up
2630
+ * continue_variants(request_work) call required.
2631
+ */
2632
+ export interface StartedVariantDescriptor {
2633
+ variantId: string;
2634
+ briefId: string;
2635
+ label: string;
2636
+ status: 'pending';
2637
+ /** Same payload `continue_variants(request_work)` would return per
2638
+ * leased item: kind, attempt, dependsOn, input (with worktreePath),
2639
+ * output_schema. */
2640
+ workItem: LeasedWorkItemDescriptor;
2641
+ }
2642
+ export type StartVariantsOutput = {
2643
+ sessionId: string;
2644
+ stage: 'work_items_ready';
2645
+ mode: 'existing' | 'zero_to_one';
2646
+ /** Lease covers every variant in the `variants` array. The agent
2647
+ * passes this back to `report_variant_complete` for each item. */
2648
+ leaseId: string;
2649
+ leaseTtlMs: number;
2650
+ variants: StartedVariantDescriptor[];
2651
+ scaffoldBaseWorkItemId: string | null;
2652
+ /** Populated only for zero_to_one: the future project directory. */
2653
+ destinationPath?: string;
2654
+ /** Populated when the server opened the editor server-side — for
2655
+ * zero_to_one always, for existing when projectPath was provided
2656
+ * or could be detected. */
2657
+ visualEditor?: VisualEditorAttachment;
2658
+ /** Detected framework / project metadata (existing mode), so the
2659
+ * agent doesn't need a separate detect_project call. */
2660
+ project?: {
2661
+ projectPath: string;
2662
+ framework: string;
2663
+ };
2664
+ nextAction: 'report_variant_complete';
2665
+ } | {
2666
+ stage: 'failed';
2667
+ errorCode: ErrorCode;
2668
+ message: string;
2669
+ };
271
2670
  export interface BriefWorkItemDescriptor {
272
2671
  id: string;
273
2672
  kind: 'brief';
@@ -283,11 +2682,25 @@ export interface LeasedWorkItemDescriptor {
283
2682
  input: unknown;
284
2683
  output_schema: unknown;
285
2684
  }
2685
+ export interface VisualEditorAttachment {
2686
+ sessionId: string;
2687
+ url: string;
2688
+ rivetPort: number;
2689
+ opened: boolean;
2690
+ attached: boolean;
2691
+ }
286
2692
  export type ProposeVariantsOutput = {
2693
+ sessionId: string;
2694
+ stage: 'awaiting_source_plan';
2695
+ sourcePlanWorkItem: SourcePlanWorkItemDescriptor;
2696
+ nextAction: 'continue_variants';
2697
+ visualEditor?: VisualEditorAttachment;
2698
+ } | {
287
2699
  sessionId: string;
288
2700
  stage: 'awaiting_briefs';
289
2701
  briefWorkItem: BriefWorkItemDescriptor;
290
2702
  nextAction: 'report_variant_briefs';
2703
+ visualEditor?: VisualEditorAttachment;
291
2704
  } | {
292
2705
  stage: 'cancelled';
293
2706
  } | {
@@ -298,15 +2711,44 @@ export type ProposeVariantsOutput = {
298
2711
  export type ReportVariantBriefsOutput = {
299
2712
  stage: 'awaiting_approval';
300
2713
  briefs: Brief[];
2714
+ approvalPrompt: string;
301
2715
  nextAction: 'continue_variants';
302
2716
  } | {
303
2717
  stage: 'failed';
304
2718
  errorCode: ErrorCode;
305
2719
  message: string;
306
2720
  };
2721
+ export type ReportSourcePlanOutput = {
2722
+ stage: 'awaiting_briefs';
2723
+ briefWorkItem: BriefWorkItemDescriptor;
2724
+ executionPlan: {
2725
+ mode: ExecutionMode;
2726
+ confidence: ExecutionConfidence;
2727
+ reason: string;
2728
+ assetCount: number;
2729
+ runtimeRequirementCount: number;
2730
+ };
2731
+ nextAction: 'report_variant_briefs';
2732
+ } | {
2733
+ stage: 'failed';
2734
+ errorCode: ErrorCode;
2735
+ message: string;
2736
+ };
307
2737
  export type ContinueVariantsOutput = {
2738
+ stage: 'awaiting_source_plan';
2739
+ progress: {
2740
+ ready: number;
2741
+ total: number;
2742
+ };
2743
+ } | {
2744
+ stage: 'awaiting_source_plan';
2745
+ leaseId: string;
2746
+ leaseTtlMs: number;
2747
+ leasedWorkItems: LeasedWorkItemDescriptor[];
2748
+ } | {
308
2749
  stage: 'awaiting_approval';
309
2750
  briefs: Brief[];
2751
+ approvalPrompt: string;
310
2752
  } | {
311
2753
  stage: 'work_items_ready';
312
2754
  leaseId: string;
@@ -321,6 +2763,18 @@ export type ContinueVariantsOutput = {
321
2763
  } | {
322
2764
  stage: 'ready' | 'degraded' | 'failed' | 'cancelled';
323
2765
  summary: TerminalSummary;
2766
+ /** Human-readable retry/continue/cancel prompt populated when any
2767
+ * succeeded-then-QA-failed variant is present in the summary. The
2768
+ * calling agent should surface this directly to the user. */
2769
+ qaPrompt?: string;
2770
+ /** Per-variant QA verdicts for variants with a `qa` result. Only
2771
+ * variants with a non-`not_run` status are included so the field
2772
+ * stays empty when nothing interesting has happened. */
2773
+ qa?: Array<{
2774
+ workItemId: string;
2775
+ label?: string;
2776
+ qa: VariantQaResult;
2777
+ }>;
324
2778
  };
325
2779
  export type ReportVariantCompleteOutput = {
326
2780
  stage: 'waiting_for_results';
@@ -331,6 +2785,13 @@ export type ReportVariantCompleteOutput = {
331
2785
  } | {
332
2786
  stage: 'ready' | 'degraded' | 'failed' | 'cancelled';
333
2787
  summary: TerminalSummary;
2788
+ /** See `ContinueVariantsOutput.qaPrompt`. */
2789
+ qaPrompt?: string;
2790
+ qa?: Array<{
2791
+ workItemId: string;
2792
+ label?: string;
2793
+ qa: VariantQaResult;
2794
+ }>;
334
2795
  };
335
2796
  export type CancelVariantsOutput = {
336
2797
  stage: 'cancelled';
@@ -350,16 +2811,53 @@ export interface TerminalSummary {
350
2811
  label?: string;
351
2812
  }>;
352
2813
  }
353
- export type VariantPickPayload = {
2814
+ export type VariantPickPayload =
2815
+ /**
2816
+ * Server-internal raw diff payload. Retained so unit tests and callers that
2817
+ * predate server-side apply can still introspect the diff body. The
2818
+ * production commit path now applies the diff before enqueueing and emits
2819
+ * `diff-applied` to the bridge so MCP agents don't re-apply.
2820
+ */
2821
+ {
354
2822
  kind: 'diff';
355
2823
  diff: string;
356
2824
  target?: Target;
357
2825
  changedFilesCount: number;
358
- } | {
2826
+ }
2827
+ /**
2828
+ * Agent-facing post-apply state for existing-project picks. The variant's
2829
+ * unified diff has already been applied to the user's working tree
2830
+ * (uncommitted). Agents must NOT run `git apply` again — just inform the
2831
+ * user and proceed.
2832
+ */
2833
+ | {
2834
+ kind: 'diff-applied';
2835
+ diff: string;
2836
+ target?: Target;
2837
+ changedFilesCount: number;
2838
+ note: string;
2839
+ }
2840
+ /**
2841
+ * Server-internal pre-materialize state for fresh-project picks. Held while
2842
+ * the orchestrator copies `sourceWorktreePath` to `destinationPath`. Never
2843
+ * crosses to agents — the agent-facing payload is `project-created`.
2844
+ */
2845
+ | {
359
2846
  kind: 'new-project';
360
2847
  destinationPath: string;
361
2848
  sourceWorktreePath: string;
362
2849
  changedFilesCount: number;
2850
+ }
2851
+ /**
2852
+ * Agent-facing post-materialize state for fresh-project picks. The project
2853
+ * already exists on disk at `destinationPath`; the agent only needs to
2854
+ * optionally install dependencies and continue from there.
2855
+ */
2856
+ | {
2857
+ kind: 'project-created';
2858
+ destinationPath: string;
2859
+ changedFilesCount: number;
2860
+ note: string;
363
2861
  };
364
2862
  export interface VariantPickEnvelope {
365
2863
  sourceSessionId: string;