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.
- package/dist/mcp/agent-variants/SessionStore.d.ts +78 -2
- package/dist/mcp/agent-variants/SessionStore.d.ts.map +1 -1
- package/dist/mcp/agent-variants/SessionStore.js +464 -62
- package/dist/mcp/agent-variants/SessionStore.js.map +1 -1
- package/dist/mcp/agent-variants/WorktreeOrchestrator.d.ts +331 -9
- package/dist/mcp/agent-variants/WorktreeOrchestrator.d.ts.map +1 -1
- package/dist/mcp/agent-variants/WorktreeOrchestrator.js +1985 -61
- package/dist/mcp/agent-variants/WorktreeOrchestrator.js.map +1 -1
- package/dist/mcp/agent-variants/WorktreeOrchestrator.testHelpers.d.ts +65 -0
- package/dist/mcp/agent-variants/WorktreeOrchestrator.testHelpers.d.ts.map +1 -0
- package/dist/mcp/agent-variants/WorktreeOrchestrator.testHelpers.js +162 -0
- package/dist/mcp/agent-variants/WorktreeOrchestrator.testHelpers.js.map +1 -0
- package/dist/mcp/agent-variants/contracts.d.ts +2508 -10
- package/dist/mcp/agent-variants/contracts.d.ts.map +1 -1
- package/dist/mcp/agent-variants/contracts.js +295 -5
- package/dist/mcp/agent-variants/contracts.js.map +1 -1
- package/dist/mcp/agent-variants/createProjectArtifacts.d.ts +78 -0
- package/dist/mcp/agent-variants/createProjectArtifacts.d.ts.map +1 -0
- package/dist/mcp/agent-variants/createProjectArtifacts.js +123 -0
- package/dist/mcp/agent-variants/createProjectArtifacts.js.map +1 -0
- package/dist/mcp/agent-variants/createZeroToOneTool.d.ts +241 -0
- package/dist/mcp/agent-variants/createZeroToOneTool.d.ts.map +1 -0
- package/dist/mcp/agent-variants/createZeroToOneTool.js +213 -0
- package/dist/mcp/agent-variants/createZeroToOneTool.js.map +1 -0
- package/dist/mcp/agent-variants/designContextStore.d.ts +160 -0
- package/dist/mcp/agent-variants/designContextStore.d.ts.map +1 -0
- package/dist/mcp/agent-variants/designContextStore.js +295 -0
- package/dist/mcp/agent-variants/designContextStore.js.map +1 -0
- package/dist/mcp/agent-variants/elementRefToTarget.d.ts +21 -0
- package/dist/mcp/agent-variants/elementRefToTarget.d.ts.map +1 -0
- package/dist/mcp/agent-variants/elementRefToTarget.js +47 -0
- package/dist/mcp/agent-variants/elementRefToTarget.js.map +1 -0
- package/dist/mcp/agent-variants/errors.d.ts +1 -1
- package/dist/mcp/agent-variants/errors.d.ts.map +1 -1
- package/dist/mcp/agent-variants/errors.js +7 -0
- package/dist/mcp/agent-variants/errors.js.map +1 -1
- package/dist/mcp/agent-variants/index.d.ts +4 -2
- package/dist/mcp/agent-variants/index.d.ts.map +1 -1
- package/dist/mcp/agent-variants/index.js +7 -1
- package/dist/mcp/agent-variants/index.js.map +1 -1
- package/dist/mcp/agent-variants/inspirationDesignContext.d.ts +440 -0
- package/dist/mcp/agent-variants/inspirationDesignContext.d.ts.map +1 -0
- package/dist/mcp/agent-variants/inspirationDesignContext.js +2467 -0
- package/dist/mcp/agent-variants/inspirationDesignContext.js.map +1 -0
- package/dist/mcp/agent-variants/pendingChangesAdapter.d.ts.map +1 -1
- package/dist/mcp/agent-variants/pendingChangesAdapter.js +21 -7
- package/dist/mcp/agent-variants/pendingChangesAdapter.js.map +1 -1
- package/dist/mcp/agent-variants/previewQa.d.ts +61 -0
- package/dist/mcp/agent-variants/previewQa.d.ts.map +1 -0
- package/dist/mcp/agent-variants/previewQa.js +374 -0
- package/dist/mcp/agent-variants/previewQa.js.map +1 -0
- package/dist/mcp/agent-variants/sourceContext.d.ts +8 -0
- package/dist/mcp/agent-variants/sourceContext.d.ts.map +1 -0
- package/dist/mcp/agent-variants/sourceContext.js +183 -0
- package/dist/mcp/agent-variants/sourceContext.js.map +1 -0
- package/dist/mcp/agent-variants/tools.d.ts +36 -0
- package/dist/mcp/agent-variants/tools.d.ts.map +1 -1
- package/dist/mcp/agent-variants/tools.js +451 -19
- package/dist/mcp/agent-variants/tools.js.map +1 -1
- package/dist/mcp/changeBatchClassification.d.ts +30 -0
- package/dist/mcp/changeBatchClassification.d.ts.map +1 -0
- package/dist/mcp/changeBatchClassification.js +65 -0
- package/dist/mcp/changeBatchClassification.js.map +1 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +258 -41
- package/dist/mcp/server.js.map +1 -1
- package/dist/prompts/agentModPrompts.js +4 -4
- package/dist/prompts/agentModPrompts.js.map +1 -1
- package/dist/proxy-middleware/proxy-config.d.ts.map +1 -1
- package/dist/proxy-middleware/proxy-config.js +1 -15
- package/dist/proxy-middleware/proxy-config.js.map +1 -1
- package/dist/routes/agentVariants.d.ts +3 -1
- package/dist/routes/agentVariants.d.ts.map +1 -1
- package/dist/routes/agentVariants.js +138 -13
- package/dist/routes/agentVariants.js.map +1 -1
- package/dist/routes/mcp.d.ts +7 -1
- package/dist/routes/mcp.d.ts.map +1 -1
- package/dist/routes/mcp.js +139 -16
- package/dist/routes/mcp.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +23 -5
- package/dist/server.js.map +1 -1
- package/dist/services/ProjectDetectionService.d.ts.map +1 -1
- package/dist/services/ProjectDetectionService.js +9 -0
- package/dist/services/ProjectDetectionService.js.map +1 -1
- package/dist/services/SessionBridgeService.d.ts +22 -0
- package/dist/services/SessionBridgeService.d.ts.map +1 -1
- package/dist/services/SessionBridgeService.js +61 -0
- package/dist/services/SessionBridgeService.js.map +1 -1
- package/dist/services/TelemetryService.d.ts +121 -0
- package/dist/services/TelemetryService.d.ts.map +1 -1
- package/dist/services/TelemetryService.js +155 -0
- package/dist/services/TelemetryService.js.map +1 -1
- package/dist/services/WorktreeManager.d.ts +116 -6
- package/dist/services/WorktreeManager.d.ts.map +1 -1
- package/dist/services/WorktreeManager.js +394 -19
- package/dist/services/WorktreeManager.js.map +1 -1
- package/dist/services/agent/AgentModService.js +6 -6
- package/dist/services/agent/AgentModService.js.map +1 -1
- package/dist/services/templates/designCatalog.d.ts +27 -0
- package/dist/services/templates/designCatalog.d.ts.map +1 -0
- package/dist/services/templates/designCatalog.js +141 -0
- package/dist/services/templates/designCatalog.js.map +1 -0
- package/dist/services/templates/designmd/airbnb.md +545 -0
- package/dist/services/templates/designmd/airtable.md +554 -0
- package/dist/services/templates/designmd/apple.md +562 -0
- package/dist/services/templates/designmd/binance.md +634 -0
- package/dist/services/templates/designmd/bmw-m.md +503 -0
- package/dist/services/templates/designmd/bmw.md +544 -0
- package/dist/services/templates/designmd/bugatti.md +454 -0
- package/dist/services/templates/designmd/cal.md +542 -0
- package/dist/services/templates/designmd/claude.md +589 -0
- package/dist/services/templates/designmd/clay.md +541 -0
- package/dist/services/templates/designmd/cohere.md +451 -0
- package/dist/services/templates/designmd/cursor.md +537 -0
- package/dist/services/templates/designmd/expo.md +526 -0
- package/dist/services/templates/designmd/figma.md +578 -0
- package/dist/services/templates/designmd/framer.md +544 -0
- package/dist/services/templates/designmd/hp.md +670 -0
- package/dist/services/templates/designmd/linear.app.md +548 -0
- package/dist/services/templates/designmd/mintlify.md +852 -0
- package/dist/services/templates/designmd/miro.md +825 -0
- package/dist/services/templates/designmd/notion.md +821 -0
- package/dist/services/templates/designmd/raycast.md +669 -0
- package/dist/services/templates/designmd/resend.md +585 -0
- package/dist/services/templates/designmd/sentry.md +262 -0
- package/dist/services/templates/designmd/shopify.md +350 -0
- package/dist/services/templates/designmd/spotify.md +246 -0
- package/dist/services/templates/designmd/stripe.md +322 -0
- package/dist/services/templates/designmd/supabase.md +255 -0
- package/dist/services/templates/designmd/superhuman.md +252 -0
- package/dist/services/templates/designmd/uber.md +295 -0
- package/dist/services/templates/designmd/vercel.md +310 -0
- package/dist/services/templates/viteReactTs.d.ts +48 -0
- package/dist/services/templates/viteReactTs.d.ts.map +1 -0
- package/dist/services/templates/viteReactTs.js +274 -0
- package/dist/services/templates/viteReactTs.js.map +1 -0
- package/dist/types/change-request-types.d.ts +29 -3
- package/dist/types/change-request-types.d.ts.map +1 -1
- package/dist/utils/skills/claude-skill.d.ts +2 -2
- package/dist/utils/skills/claude-skill.d.ts.map +1 -1
- package/dist/utils/skills/claude-skill.js +19 -98
- package/dist/utils/skills/claude-skill.js.map +1 -1
- package/dist/utils/skills/cursor-rules.d.ts +2 -2
- package/dist/utils/skills/cursor-rules.d.ts.map +1 -1
- package/dist/utils/skills/cursor-rules.js +15 -80
- package/dist/utils/skills/cursor-rules.js.map +1 -1
- package/dist/utils/skills/shared-variants-protocol.d.ts +23 -0
- package/dist/utils/skills/shared-variants-protocol.d.ts.map +1 -0
- package/dist/utils/skills/shared-variants-protocol.js +130 -0
- package/dist/utils/skills/shared-variants-protocol.js.map +1 -0
- package/package.json +6 -6
- package/src/ui/dist/assets/main-CpX7fB64.js +382 -0
- package/src/ui/dist/assets/main-Qqe2_oMT.css +1 -0
- package/src/ui/dist/index.html +2 -2
- package/src/ui/dist/assets/main-AsPCtLsx.js +0 -382
- package/src/ui/dist/assets/main-BzmseUDd.css +0 -1
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.writeTemplateBundle = exports.writeCreateAppTemplate = exports.isDestinationEmpty = exports.VITE_REACT_TS_TEMPLATE = exports.CREATE_APP_TEMPLATE_FILES = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const TEMPLATE_FILES = [
|
|
10
|
+
{
|
|
11
|
+
relativePath: 'package.json',
|
|
12
|
+
contents: `{
|
|
13
|
+
"name": "rivet-created-app",
|
|
14
|
+
"private": true,
|
|
15
|
+
"version": "0.0.0",
|
|
16
|
+
"type": "module",
|
|
17
|
+
"scripts": {
|
|
18
|
+
"dev": "vite",
|
|
19
|
+
"build": "tsc -b && vite build",
|
|
20
|
+
"preview": "vite preview"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
24
|
+
"typescript": "~5.9.3",
|
|
25
|
+
"vite": "^7.3.1",
|
|
26
|
+
"react": "^19.2.0",
|
|
27
|
+
"react-dom": "^19.2.0"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/react": "^19.2.7",
|
|
31
|
+
"@types/react-dom": "^19.2.3"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
`,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
relativePath: 'index.html',
|
|
38
|
+
contents: `<!doctype html>
|
|
39
|
+
<html lang="en">
|
|
40
|
+
<head>
|
|
41
|
+
<meta charset="UTF-8" />
|
|
42
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
43
|
+
<title>Rivet Created App</title>
|
|
44
|
+
</head>
|
|
45
|
+
<body>
|
|
46
|
+
<div id="root"></div>
|
|
47
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
48
|
+
</body>
|
|
49
|
+
</html>
|
|
50
|
+
`,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
relativePath: 'tsconfig.json',
|
|
54
|
+
contents: `{
|
|
55
|
+
"files": [],
|
|
56
|
+
"references": [
|
|
57
|
+
{ "path": "./tsconfig.app.json" },
|
|
58
|
+
{ "path": "./tsconfig.node.json" }
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
`,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
relativePath: 'tsconfig.app.json',
|
|
65
|
+
contents: `{
|
|
66
|
+
"compilerOptions": {
|
|
67
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
68
|
+
"target": "ES2022",
|
|
69
|
+
"useDefineForClassFields": true,
|
|
70
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
71
|
+
"allowJs": false,
|
|
72
|
+
"skipLibCheck": true,
|
|
73
|
+
"esModuleInterop": true,
|
|
74
|
+
"allowSyntheticDefaultImports": true,
|
|
75
|
+
"strict": true,
|
|
76
|
+
"forceConsistentCasingInFileNames": true,
|
|
77
|
+
"module": "ESNext",
|
|
78
|
+
"moduleResolution": "Bundler",
|
|
79
|
+
"resolveJsonModule": true,
|
|
80
|
+
"isolatedModules": true,
|
|
81
|
+
"noEmit": true,
|
|
82
|
+
"jsx": "react-jsx"
|
|
83
|
+
},
|
|
84
|
+
"include": ["src"]
|
|
85
|
+
}
|
|
86
|
+
`,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
relativePath: 'tsconfig.node.json',
|
|
90
|
+
contents: `{
|
|
91
|
+
"compilerOptions": {
|
|
92
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
93
|
+
"target": "ES2023",
|
|
94
|
+
"lib": ["ES2023"],
|
|
95
|
+
"module": "ESNext",
|
|
96
|
+
"skipLibCheck": true,
|
|
97
|
+
"moduleResolution": "Bundler",
|
|
98
|
+
"allowImportingTsExtensions": true,
|
|
99
|
+
"verbatimModuleSyntax": true,
|
|
100
|
+
"moduleDetection": "force",
|
|
101
|
+
"noEmit": true,
|
|
102
|
+
"strict": true
|
|
103
|
+
},
|
|
104
|
+
"include": ["vite.config.ts"]
|
|
105
|
+
}
|
|
106
|
+
`,
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
relativePath: 'vite.config.ts',
|
|
110
|
+
contents: `import { defineConfig } from 'vite';
|
|
111
|
+
import react from '@vitejs/plugin-react';
|
|
112
|
+
|
|
113
|
+
export default defineConfig({
|
|
114
|
+
plugins: [react()],
|
|
115
|
+
});
|
|
116
|
+
`,
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
relativePath: '.gitignore',
|
|
120
|
+
contents: `node_modules
|
|
121
|
+
dist
|
|
122
|
+
.DS_Store
|
|
123
|
+
.env
|
|
124
|
+
.env.local
|
|
125
|
+
`,
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
relativePath: 'src/main.tsx',
|
|
129
|
+
contents: `import { StrictMode } from 'react';
|
|
130
|
+
import { createRoot } from 'react-dom/client';
|
|
131
|
+
import './index.css';
|
|
132
|
+
import App from './App';
|
|
133
|
+
|
|
134
|
+
createRoot(document.getElementById('root')!).render(
|
|
135
|
+
<StrictMode>
|
|
136
|
+
<App />
|
|
137
|
+
</StrictMode>,
|
|
138
|
+
);
|
|
139
|
+
`,
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
relativePath: 'src/App.tsx',
|
|
143
|
+
contents: `const App = () => {
|
|
144
|
+
return (
|
|
145
|
+
<main className="app-shell">
|
|
146
|
+
<section className="hero">
|
|
147
|
+
<p className="eyebrow">Created with Rivet</p>
|
|
148
|
+
<h1>Describe what should exist, then refine it visually.</h1>
|
|
149
|
+
<p className="lede">
|
|
150
|
+
This starter will be replaced by Rivet's creation agent.
|
|
151
|
+
</p>
|
|
152
|
+
</section>
|
|
153
|
+
</main>
|
|
154
|
+
);
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
export default App;
|
|
158
|
+
`,
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
relativePath: 'src/index.css',
|
|
162
|
+
contents: `:root {
|
|
163
|
+
color: #111111;
|
|
164
|
+
background: #f7f4ef;
|
|
165
|
+
font-family:
|
|
166
|
+
Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
|
|
167
|
+
sans-serif;
|
|
168
|
+
font-synthesis: none;
|
|
169
|
+
text-rendering: optimizeLegibility;
|
|
170
|
+
-webkit-font-smoothing: antialiased;
|
|
171
|
+
-moz-osx-font-smoothing: grayscale;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
* {
|
|
175
|
+
box-sizing: border-box;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
body {
|
|
179
|
+
margin: 0;
|
|
180
|
+
min-width: 320px;
|
|
181
|
+
min-height: 100vh;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
button,
|
|
185
|
+
input,
|
|
186
|
+
textarea {
|
|
187
|
+
font: inherit;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.app-shell {
|
|
191
|
+
min-height: 100vh;
|
|
192
|
+
display: grid;
|
|
193
|
+
place-items: center;
|
|
194
|
+
padding: 48px;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.hero {
|
|
198
|
+
max-width: 760px;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.eyebrow {
|
|
202
|
+
margin: 0 0 16px;
|
|
203
|
+
color: #ff3300;
|
|
204
|
+
font-size: 13px;
|
|
205
|
+
font-weight: 700;
|
|
206
|
+
letter-spacing: 0;
|
|
207
|
+
text-transform: uppercase;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
h1 {
|
|
211
|
+
margin: 0;
|
|
212
|
+
font-size: clamp(42px, 7vw, 88px);
|
|
213
|
+
line-height: 0.95;
|
|
214
|
+
letter-spacing: 0;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.lede {
|
|
218
|
+
max-width: 560px;
|
|
219
|
+
margin: 24px 0 0;
|
|
220
|
+
color: #555555;
|
|
221
|
+
font-size: 20px;
|
|
222
|
+
line-height: 1.5;
|
|
223
|
+
}
|
|
224
|
+
`,
|
|
225
|
+
},
|
|
226
|
+
];
|
|
227
|
+
exports.CREATE_APP_TEMPLATE_FILES = TEMPLATE_FILES;
|
|
228
|
+
exports.VITE_REACT_TS_TEMPLATE = {
|
|
229
|
+
files: TEMPLATE_FILES,
|
|
230
|
+
devCommand: { cmd: 'npm', args: ['run', 'dev'] },
|
|
231
|
+
buildCommand: { cmd: 'npm', args: ['run', 'build'] },
|
|
232
|
+
packageManager: 'npm',
|
|
233
|
+
};
|
|
234
|
+
/**
|
|
235
|
+
* Return true when the destination can receive a generated app.
|
|
236
|
+
*
|
|
237
|
+
* The MCP zero-to-one flow persists artifacts under `.rivet/` before commit,
|
|
238
|
+
* so a destination whose only entry is `.rivet` is still considered empty for
|
|
239
|
+
* the purpose of starting a new session. This matches the commit-time check in
|
|
240
|
+
* `WorktreeOrchestrator.assertDestinationAvailable` so retries on the same
|
|
241
|
+
* path don't fail at create while commit would have proceeded.
|
|
242
|
+
*/
|
|
243
|
+
const isDestinationEmpty = (destinationPath) => {
|
|
244
|
+
if (!fs_1.default.existsSync(destinationPath)) {
|
|
245
|
+
return true;
|
|
246
|
+
}
|
|
247
|
+
const entries = fs_1.default.readdirSync(destinationPath);
|
|
248
|
+
return entries.filter((entry) => entry !== '.rivet').length === 0;
|
|
249
|
+
};
|
|
250
|
+
exports.isDestinationEmpty = isDestinationEmpty;
|
|
251
|
+
/**
|
|
252
|
+
* Write the embedded Vite template into the destination folder.
|
|
253
|
+
*
|
|
254
|
+
* @effect Creates directories and writes files at destinationPath
|
|
255
|
+
*/
|
|
256
|
+
const writeCreateAppTemplate = (destinationPath) => {
|
|
257
|
+
(0, exports.writeTemplateBundle)(exports.VITE_REACT_TS_TEMPLATE, destinationPath);
|
|
258
|
+
};
|
|
259
|
+
exports.writeCreateAppTemplate = writeCreateAppTemplate;
|
|
260
|
+
/**
|
|
261
|
+
* Write an arbitrary template bundle to a destination directory. Used by the
|
|
262
|
+
* MCP fresh-scaffold flow so callers can pin a specific bundle per worktree.
|
|
263
|
+
*
|
|
264
|
+
* @effect Creates directories and writes files at destinationPath
|
|
265
|
+
*/
|
|
266
|
+
const writeTemplateBundle = (bundle, destinationPath) => {
|
|
267
|
+
for (const file of bundle.files) {
|
|
268
|
+
const absolutePath = path_1.default.join(destinationPath, file.relativePath);
|
|
269
|
+
fs_1.default.mkdirSync(path_1.default.dirname(absolutePath), { recursive: true });
|
|
270
|
+
fs_1.default.writeFileSync(absolutePath, file.contents, 'utf8');
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
exports.writeTemplateBundle = writeTemplateBundle;
|
|
274
|
+
//# sourceMappingURL=viteReactTs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viteReactTs.js","sourceRoot":"","sources":["../../../src/services/templates/viteReactTs.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAqBxB,MAAM,cAAc,GAAmB;IACrC;QACE,YAAY,EAAE,cAAc;QAC5B,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;CAsBb;KACE;IACD;QACE,YAAY,EAAE,YAAY;QAC1B,QAAQ,EAAE;;;;;;;;;;;;CAYb;KACE;IACD;QACE,YAAY,EAAE,eAAe;QAC7B,QAAQ,EAAE;;;;;;;CAOb;KACE;IACD;QACE,YAAY,EAAE,mBAAmB;QACjC,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;CAqBb;KACE;IACD;QACE,YAAY,EAAE,oBAAoB;QAClC,QAAQ,EAAE;;;;;;;;;;;;;;;;CAgBb;KACE;IACD;QACE,YAAY,EAAE,gBAAgB;QAC9B,QAAQ,EAAE;;;;;;CAMb;KACE;IACD;QACE,YAAY,EAAE,YAAY;QAC1B,QAAQ,EAAE;;;;;CAKb;KACE;IACD;QACE,YAAY,EAAE,cAAc;QAC5B,QAAQ,EAAE;;;;;;;;;;CAUb;KACE;IACD;QACE,YAAY,EAAE,aAAa;QAC3B,QAAQ,EAAE;;;;;;;;;;;;;;;CAeb;KACE;IACD;QACE,YAAY,EAAE,eAAe;QAC7B,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8Db;KACE;CACF,CAAC;AAEW,QAAA,yBAAyB,GAAmB,cAAc,CAAC;AAE3D,QAAA,sBAAsB,GAAmB;IACpD,KAAK,EAAE,cAAc;IACrB,UAAU,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE;IAChD,YAAY,E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|
61
61
|
instruction: string;
|
|
62
62
|
/** Base64 data-URL images attached as visual reference for the instruction */
|
|
63
63
|
images?: string[];
|
|
64
|
+
/**
|
|
65
|
+
* Marks this comment as a request to run the MCP variants flow on the
|
|
66
|
+
* targeted element instead of performing a direct apply. Undefined → standard
|
|
67
|
+
* comment apply. When present, the MCP server skips beginApplyingRun and
|
|
68
|
+
* routes the batch through propose_variants → approval → continue → commit.
|
|
69
|
+
*/
|
|
70
|
+
variantRequest?: {
|
|
71
|
+
count: number;
|
|
72
|
+
};
|
|
64
73
|
}
|
|
65
74
|
/**
|
|
66
75
|
* A free-text chat instruction not tied to any specific element.
|
|
@@ -102,9 +111,26 @@ export interface VariantChangeItem {
|
|
|
102
111
|
ref: string;
|
|
103
112
|
};
|
|
104
113
|
} | {
|
|
105
|
-
kind: '
|
|
106
|
-
/**
|
|
107
|
-
|
|
114
|
+
kind: 'diff-applied';
|
|
115
|
+
/** Unified diff that has already been applied to the user's working
|
|
116
|
+
* tree (uncommitted). Included for telemetry / audit only — agents
|
|
117
|
+
* MUST NOT re-apply via `git apply`. Just inform the user and
|
|
118
|
+
* proceed. */
|
|
119
|
+
diff: string;
|
|
120
|
+
/** Refinement target (element/file/route), when applicable */
|
|
121
|
+
target?: {
|
|
122
|
+
type: 'element' | 'file' | 'route';
|
|
123
|
+
ref: string;
|
|
124
|
+
};
|
|
125
|
+
/** Human-readable summary of what the server did. */
|
|
126
|
+
note: string;
|
|
127
|
+
} | {
|
|
128
|
+
kind: 'project-created';
|
|
129
|
+
/** Project files have already been copied to `destinationPath` and an
|
|
130
|
+
* initial commit landed. The agent only needs to optionally run
|
|
131
|
+
* `npm install` and continue from there — no further file
|
|
132
|
+
* operations are required. */
|
|
133
|
+
note: string;
|
|
108
134
|
};
|
|
109
135
|
}
|
|
110
136
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-request-types.d.ts","sourceRoot":"","sources":["../../src/types/change-request-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB;;;OAGG;IACH,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,MAAM,UAAU,GAClB,eAAe,GACf,cAAc,GACd,iBAAiB,GACjB,cAAc,GACd,iBAAiB,CAAC;AAEtB,4DAA4D;AAC5D,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,UAAU,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,4DAA4D;AAC5D,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,UAAU,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,UAAU,CAAC;IACpB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"change-request-types.d.ts","sourceRoot":"","sources":["../../src/types/change-request-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,aAAa;IAC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
|
|
|
1
|
-
export declare const CLAUDE_SKILL_VERSION =
|
|
1
|
+
export declare const CLAUDE_SKILL_VERSION = 21;
|
|
2
2
|
export declare const CLAUDE_SKILL_DIR = "rivet";
|
|
3
3
|
export declare const CLAUDE_SKILL_FILENAME = "SKILL.md";
|
|
4
|
-
export declare const CLAUDE_SKILL_CONTENT = "---\nname: rivet\ndescription: Rivet \u2014 two flows. Visual editor for point-and-click UI changes (\"open rivet\", \"use rivet\", \"make a visual change\"). Agent-variants for exploring N parallel design directions before committing (\"create variants of X\", \"show me 3-5 options for X\", \"build me a settings page from scratch\", \"create a new Vite todo app\", \"scaffold a Next.js dashboard\"). Pick the flow based on the user's request \u2014 see \"Picking the flow\" below.\n---\n\n[//]: # (rivet-skill-version: 12)\n# Rivet\n\nTwo flows: the **visual editor** (point-and-click changes to a running web app) and the **agent-variants flow** (explore N parallel design directions before committing).\n\n## Picking the flow\n\n| User says | Flow |\n|---|---|\n| \"open rivet\", \"make a visual change to X\" | **Visual editor** (below) |\n| \"create variants of X\", \"show me 3-5 options for X\", \"explore approaches to X\" | **Agent variants** |\n| \"build me a settings page from scratch\", \"add a feature for Y\" | **Agent variants** (no `target`) |\n| \"create a new Vite todo app\", \"scaffold a Next.js dashboard\" | **Agent variants** (`projectContext.kind=fresh`) |\n\n## Visual Editor flow\n\n## Starting a session\n\n1. Call `detect_project` \u2014 returns project info including `framework` and `projectPath`\n2. Call `open_visual_editor({ projectPath, framework })` \u2014 do NOT pass `startPort` or any port; the tool handles port selection automatically\n4. Tell the user: \"Rivet is ready \u2014 make your visual changes and click 'Send to Claude Code'.\"\n5. Start a background monitor to auto-detect when the user sends changes (see Monitoring below).\n6. You are now free to handle other requests while the monitor runs.\n\n## Monitoring for changes\n\nAfter opening the editor, start a Monitor to watch for changes. The `open_visual_editor` response includes `rivetPort` \u2014 use it:\n\n```\nMonitor:\n description: \"Rivet changes\"\n persistent: true\n command: while sleep 2; do if curl -sf http://localhost:RIVET_PORT/api/mcp/status | grep -q '\"hasPendingIntent\":true'; then echo \"Rivet: user sent changes\"; exit 0; fi; done\n```\n\nReplace `RIVET_PORT` with the actual `rivetPort` from the `open_visual_editor` response.\n\nWhen the monitor notifies you, apply the changes (see below). After applying, **restart the monitor** to watch for the next round.\n\n## Applying changes\n\nWhen the monitor notifies you (or the user asks manually):\n\n1. Call `get_pending_changes({ sessionId })` to pick up queued changes\n2. If `hasChanges: false`, tell the user no changes are pending yet\n3. If `hasChanges: true`, apply the changes to the source files listed in `sourceFiles`\n4. Call `get_pending_changes({ sessionId, message: \"summary of changes\", refresh_git: true })` so the Rivet UI updates\n5. Hot reload happens automatically after file changes\n6. Tell the user what you changed\n7. Restart the monitor to watch for the next round\n\n## Ending a session\n\nWhen the user says they're done, call `close_visual_editor({ sessionId })`.\n\n## Rules\n\n- **Always call `detect_project` first** \u2014 never assume the dev server is running\n- **Never auto-commit** after applying visual changes \u2014 let the user decide\n- The dev server stays running after `close_visual_editor`\n\n---\n\n## Agent Variants flow\n\nFor requests like *\"create variants of X\"*, *\"show me 3-5 options for the dropdown\"*, *\"build me a settings page\"*, or *\"create a new Vite todo app\"* \u2014 DO NOT generate variants natively via the Task tool or parallel tool calls. Use this protocol so the user reviews design directions IN THIS CHAT, sees the actual code variants render in parallel, and picks based on the rendered code.\n\n### Step-by-step\n\n1. **Call `propose_variants`** with:\n - `prompt`: the user's request verbatim\n - `count`: 3-5 (default 4)\n - `target` (optional): `{ type: 'element'|'file'|'route', ref }` \u2014 set this for refinement requests pinned to a specific element/file/route\n - `projectContext` (optional):\n - For brand-new projects: `{ kind: 'fresh', workspacePath: '/abs/path', framework: 'vite'|'next'|'astro'|'remix' }`\n - Otherwise omit (defaults to existing project)\n\n Response: `{ sessionId, briefWorkItem }`. The brief work item carries an `input` blob; you must run it next.\n\n2. **Run the brief work item using YOUR own LLM** \u2014 generate `count` design briefs as `{ briefId, label, body }`. Label is short (\u2264 4 words). Body is 1-2 sentences describing the design direction. Do NOT call any Rivet tool; this is your LLM doing creative work.\n\n3. **Call `report_variant_briefs`** with the briefs, plus the `workItemId` and `attempt: 0`.\n\n3.5. **Ensure the Rivet visual editor is open.** If you haven't already opened it in this session, call `detect_project` then `open_visual_editor({ projectPath, framework })` now \u2014 DON'T wait for the user to ask. The user will need the iframe open to see variants render. If a session is already active (`open_visual_editor` returns a friendly error), just continue. Once the editor opens, the chip at the bottom-center of the iframe will show generation progress.\n\n4. **Show the briefs to the user IN CHAT** as a numbered list. Ask \"Look good or want me to adjust any of them?\" \u2014 DO NOT ask which one to pick. The pick happens AFTER they've seen the actual code.\n Example:\n > Here are 4 directions:\n > 1. **Spring blur** \u2014 Apple-style spring with ambient blur and soft edges\n > 2. **Linear sharp** \u2014 Crisp, fast, minimal padding\n > 3. **Notion soft** \u2014 Rounded, calm, neutral palette\n > 4. **Monoline editorial** \u2014 Tight typography, single accent color\n > Look good, or want me to adjust any of them?\n\n5. **Wait for the user's reply.** Affirmative (\"looks good\", \"go\", \"yep\") \u2192 proceed with all briefs. Tweak request (\"make #2 feel more like Linear\") \u2192 call `approve_variant_briefs` with `selections` containing `bodyOverride` per brief, OR re-run the brief work item with new framing. Reject all \u2192 call `cancel_variants` and start over.\n\n6. **Call `approve_variant_briefs({ sessionId, briefIds: [all chosen briefs] })`**. Response: `{ stage: 'work_items_ready', codeGenWorkItemIds: [...] }` \u2014 one work item per approved brief.\n\n7. **Lease the work** with `continue_variants({ sessionId, action: 'request_work' })`. Response has `leaseId`, `leaseTtlMs`, and `leasedWorkItems[]` \u2014 one per approved brief (plus a preceding `scaffold_base` for fresh-project; lease scaffold first, succeed it, then re-lease for the code-gens).\n\n8. **Run all leased code-gen items IN PARALLEL.** The preferred mechanism in Claude Code is to spawn one Task sub-agent per leased item in a single message \u2014 they execute concurrently. Each sub-agent:\n - Reads `input.briefBody` and `input.target`\n - Edits files in `input.worktreePath` (each variant has its own isolated worktree)\n - Calls `report_variant_complete({ sessionId, workItemId, leaseId, attempt, status: 'succeeded' })` itself. On failure, status `'failed'` with error description.\n\n9. **When all variants are done (`stage: 'ready'` or `'degraded'`), tell the user the variants are ready and explain how to compare them.** Each variant has its own dev server running in an isolated worktree. The Rivet iframe shows a chip at the bottom-center: prev/label/next/check/dismiss. The user cycles between the live, running variants by clicking prev/next (the iframe re-mounts onto the variant's dev server in ~50ms via proxy retarget). When they like one, they click the check on the chip \u2014 that commits the variant.\n Example reply:\n > Variants are ready \u2014 open the Rivet preview and use the chip at the bottom of the iframe to cycle between them. Click the checkmark on the one you want and I'll apply it.\n\n You do NOT need to print diffs in chat. The user picks visually in the iframe.\n\n10. **Watch for the user's pick.** Either:\n a) Use `watch_for_changes({ sessionId })` (existing tool) which blocks until the user clicks the check on the chip, OR\n b) Start a Monitor on `http://localhost:RIVET_PORT/api/mcp/status` like the visual-editor flow does.\n When changes arrive, call `get_pending_changes({ sessionId })` and you'll see a `VariantChangeItem` in `changes[]`.\n\n11. **Apply the variant.** From the `VariantChangeItem` payload:\n - `payload.kind === 'diff'` \u2192 `git apply` the unified diff against the user's project root\n - `payload.kind === 'new-project'` \u2192 copy the contents of `payload.sourceWorktreePath` to `destinationPath`\n Tell the user which variant you applied (use `variantLabel` from the change item).\n\n You can also call `commit_variant({ sessionId, variantId })` yourself if the user expressed their pick in chat instead of clicking the chip (\"go with #2\", \"the spring one\") \u2014 same effect, just routed through the agent rather than the chip.\n\n### Rules\n\n- **Never** generate variants natively (Task sub-agents, parallel tool calls, your own creative process) without going through `propose_variants` first.\n- Always pass the user's prompt verbatim \u2014 don't paraphrase.\n- Briefs are shown as PLAIN TEXT in chat. Do not render UI, open a browser tab, or fabricate a URL.\n- The user picks AFTER seeing the variants render LIVE in the iframe, not before. Step 4 is \"look good or adjust the briefs?\"; step 9 hands off to the iframe chip for visual cycling + commit.\n- Don't dump diffs in chat by default. The iframe chip is the primary review surface. If the user explicitly asks \"show me the diffs\", then print them.\n- Step 8 (parallel code-gen) is the only step where you fan out \u2014 every other step is one tool call.\n- For fresh-project, `scaffold_base` runs first; only after it succeeds are the `code_gen` items leasable. Loop `continue_variants(action='request_work')` after each transition.\n";
|
|
4
|
+
export declare const CLAUDE_SKILL_CONTENT: string;
|
|
5
5
|
//# sourceMappingURL=claude-skill.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-skill.d.ts","sourceRoot":"","sources":["../../../src/utils/skills/claude-skill.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"claude-skill.d.ts","sourceRoot":"","sources":["../../../src/utils/skills/claude-skill.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAGvC,eAAO,MAAM,gBAAgB,UAAU,CAAC;AACxC,eAAO,MAAM,qBAAqB,aAAa,CAAC;AAYhD,eAAO,MAAM,oBAAoB,QAgDhC,CAAC"}
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CLAUDE_SKILL_CONTENT = exports.CLAUDE_SKILL_FILENAME = exports.CLAUDE_SKILL_DIR = exports.CLAUDE_SKILL_VERSION = void 0;
|
|
4
|
-
|
|
4
|
+
const shared_variants_protocol_1 = require("./shared-variants-protocol");
|
|
5
|
+
exports.CLAUDE_SKILL_VERSION = 21;
|
|
5
6
|
const CLAUDE_SKILL_VERSION_MARKER = `[//]: # (rivet-skill-version: ${exports.CLAUDE_SKILL_VERSION})`;
|
|
6
7
|
exports.CLAUDE_SKILL_DIR = 'rivet';
|
|
7
8
|
exports.CLAUDE_SKILL_FILENAME = 'SKILL.md';
|
|
9
|
+
const AGENT_VARIANTS_SECTION = (0, shared_variants_protocol_1.buildAgentVariantsSection)({
|
|
10
|
+
inChatEmphasis: 'IN THIS CHAT',
|
|
11
|
+
step9: `**Run all leased code-gen items IN PARALLEL.** Spawn one \`Task\` tool call per leased item in a single message — they execute concurrently. Use \`subagent_type: 'general-purpose'\` for every call. Do NOT pass a skill name (e.g. \`frontend-design:frontend-design\`) as \`subagent_type\` — skills are not agent types and Task will error with "Agent type … not found". If a relevant skill is installed (e.g. \`frontend-design\`), reference it in the sub-agent's prompt body instead. Each sub-agent:
|
|
12
|
+
- Reads \`input.briefBody\` and \`input.target\`
|
|
13
|
+
- Edits files in \`input.worktreePath\` (each variant has its own isolated worktree)
|
|
14
|
+
- Calls \`report_variant_complete({ sessionId, workItemId, leaseId, attempt, status: 'succeeded' })\` itself. On failure, status \`'failed'\` with error description.`,
|
|
15
|
+
step11Suffix: `When changes arrive, call \`get_pending_changes({ sessionId })\` and you'll see a \`VariantChangeItem\` in \`changes[]\`.`,
|
|
16
|
+
nativeGenLabel: 'Task sub-agents',
|
|
17
|
+
});
|
|
8
18
|
exports.CLAUDE_SKILL_CONTENT = `---
|
|
9
19
|
name: rivet
|
|
10
20
|
description: Rivet — two flows. Visual editor for point-and-click UI changes ("open rivet", "use rivet", "make a visual change"). Agent-variants for exploring N parallel design directions before committing ("create variants of X", "show me 3-5 options for X", "build me a settings page from scratch", "create a new Vite todo app", "scaffold a Next.js dashboard"). Pick the flow based on the user's request — see "Picking the flow" below.
|
|
@@ -15,14 +25,7 @@ ${CLAUDE_SKILL_VERSION_MARKER}
|
|
|
15
25
|
|
|
16
26
|
Two flows: the **visual editor** (point-and-click changes to a running web app) and the **agent-variants flow** (explore N parallel design directions before committing).
|
|
17
27
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
| User says | Flow |
|
|
21
|
-
|---|---|
|
|
22
|
-
| "open rivet", "make a visual change to X" | **Visual editor** (below) |
|
|
23
|
-
| "create variants of X", "show me 3-5 options for X", "explore approaches to X" | **Agent variants** |
|
|
24
|
-
| "build me a settings page from scratch", "add a feature for Y" | **Agent variants** (no \`target\`) |
|
|
25
|
-
| "create a new Vite todo app", "scaffold a Next.js dashboard" | **Agent variants** (\`projectContext.kind=fresh\`) |
|
|
28
|
+
${shared_variants_protocol_1.PICKING_THE_FLOW_TABLE}
|
|
26
29
|
|
|
27
30
|
## Visual Editor flow
|
|
28
31
|
|
|
@@ -30,28 +33,12 @@ Two flows: the **visual editor** (point-and-click changes to a running web app)
|
|
|
30
33
|
|
|
31
34
|
1. Call \`detect_project\` — returns project info including \`framework\` and \`projectPath\`
|
|
32
35
|
2. Call \`open_visual_editor({ projectPath, framework })\` — do NOT pass \`startPort\` or any port; the tool handles port selection automatically
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
6. You are now free to handle other requests while the monitor runs.
|
|
36
|
-
|
|
37
|
-
## Monitoring for changes
|
|
38
|
-
|
|
39
|
-
After opening the editor, start a Monitor to watch for changes. The \`open_visual_editor\` response includes \`rivetPort\` — use it:
|
|
40
|
-
|
|
41
|
-
\`\`\`
|
|
42
|
-
Monitor:
|
|
43
|
-
description: "Rivet changes"
|
|
44
|
-
persistent: true
|
|
45
|
-
command: while sleep 2; do if curl -sf http://localhost:RIVET_PORT/api/mcp/status | grep -q '"hasPendingIntent":true'; then echo "Rivet: user sent changes"; exit 0; fi; done
|
|
46
|
-
\`\`\`
|
|
47
|
-
|
|
48
|
-
Replace \`RIVET_PORT\` with the actual \`rivetPort\` from the \`open_visual_editor\` response.
|
|
49
|
-
|
|
50
|
-
When the monitor notifies you, apply the changes (see below). After applying, **restart the monitor** to watch for the next round.
|
|
36
|
+
3. Tell the user: "Rivet is ready — make your visual changes and click 'Send to Claude Code'."
|
|
37
|
+
4. Call \`watch_for_changes({ sessionId })\` to wait for the user's changes.
|
|
51
38
|
|
|
52
39
|
## Applying changes
|
|
53
40
|
|
|
54
|
-
When
|
|
41
|
+
When \`watch_for_changes\` returns (or the user asks manually):
|
|
55
42
|
|
|
56
43
|
1. Call \`get_pending_changes({ sessionId })\` to pick up queued changes
|
|
57
44
|
2. If \`hasChanges: false\`, tell the user no changes are pending yet
|
|
@@ -59,7 +46,8 @@ When the monitor notifies you (or the user asks manually):
|
|
|
59
46
|
4. Call \`get_pending_changes({ sessionId, message: "summary of changes", refresh_git: true })\` so the Rivet UI updates
|
|
60
47
|
5. Hot reload happens automatically after file changes
|
|
61
48
|
6. Tell the user what you changed
|
|
62
|
-
7.
|
|
49
|
+
7. **STOP and ask the user:** "Want me to keep watching for more Rivet changes, or go back to normal prompting?"
|
|
50
|
+
8. If they want to keep watching, go back to step 1 in the "Applying changes" section
|
|
63
51
|
|
|
64
52
|
## Ending a session
|
|
65
53
|
|
|
@@ -68,79 +56,12 @@ When the user says they're done, call \`close_visual_editor({ sessionId })\`.
|
|
|
68
56
|
## Rules
|
|
69
57
|
|
|
70
58
|
- **Always call \`detect_project\` first** — never assume the dev server is running
|
|
59
|
+
- **Always use \`watch_for_changes\`** to wait for user changes — do NOT use Monitor, background shell commands, or manual polling
|
|
71
60
|
- **Never auto-commit** after applying visual changes — let the user decide
|
|
72
61
|
- The dev server stays running after \`close_visual_editor\`
|
|
73
62
|
|
|
74
63
|
---
|
|
75
64
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
For requests like *"create variants of X"*, *"show me 3-5 options for the dropdown"*, *"build me a settings page"*, or *"create a new Vite todo app"* — DO NOT generate variants natively via the Task tool or parallel tool calls. Use this protocol so the user reviews design directions IN THIS CHAT, sees the actual code variants render in parallel, and picks based on the rendered code.
|
|
79
|
-
|
|
80
|
-
### Step-by-step
|
|
81
|
-
|
|
82
|
-
1. **Call \`propose_variants\`** with:
|
|
83
|
-
- \`prompt\`: the user's request verbatim
|
|
84
|
-
- \`count\`: 3-5 (default 4)
|
|
85
|
-
- \`target\` (optional): \`{ type: 'element'|'file'|'route', ref }\` — set this for refinement requests pinned to a specific element/file/route
|
|
86
|
-
- \`projectContext\` (optional):
|
|
87
|
-
- For brand-new projects: \`{ kind: 'fresh', workspacePath: '/abs/path', framework: 'vite'|'next'|'astro'|'remix' }\`
|
|
88
|
-
- Otherwise omit (defaults to existing project)
|
|
89
|
-
|
|
90
|
-
Response: \`{ sessionId, briefWorkItem }\`. The brief work item carries an \`input\` blob; you must run it next.
|
|
91
|
-
|
|
92
|
-
2. **Run the brief work item using YOUR own LLM** — generate \`count\` design briefs as \`{ briefId, label, body }\`. Label is short (≤ 4 words). Body is 1-2 sentences describing the design direction. Do NOT call any Rivet tool; this is your LLM doing creative work.
|
|
93
|
-
|
|
94
|
-
3. **Call \`report_variant_briefs\`** with the briefs, plus the \`workItemId\` and \`attempt: 0\`.
|
|
95
|
-
|
|
96
|
-
3.5. **Ensure the Rivet visual editor is open.** If you haven't already opened it in this session, call \`detect_project\` then \`open_visual_editor({ projectPath, framework })\` now — DON'T wait for the user to ask. The user will need the iframe open to see variants render. If a session is already active (\`open_visual_editor\` returns a friendly error), just continue. Once the editor opens, the chip at the bottom-center of the iframe will show generation progress.
|
|
97
|
-
|
|
98
|
-
4. **Show the briefs to the user IN CHAT** as a numbered list. Ask "Look good or want me to adjust any of them?" — DO NOT ask which one to pick. The pick happens AFTER they've seen the actual code.
|
|
99
|
-
Example:
|
|
100
|
-
> Here are 4 directions:
|
|
101
|
-
> 1. **Spring blur** — Apple-style spring with ambient blur and soft edges
|
|
102
|
-
> 2. **Linear sharp** — Crisp, fast, minimal padding
|
|
103
|
-
> 3. **Notion soft** — Rounded, calm, neutral palette
|
|
104
|
-
> 4. **Monoline editorial** — Tight typography, single accent color
|
|
105
|
-
> Look good, or want me to adjust any of them?
|
|
106
|
-
|
|
107
|
-
5. **Wait for the user's reply.** Affirmative ("looks good", "go", "yep") → proceed with all briefs. Tweak request ("make #2 feel more like Linear") → call \`approve_variant_briefs\` with \`selections\` containing \`bodyOverride\` per brief, OR re-run the brief work item with new framing. Reject all → call \`cancel_variants\` and start over.
|
|
108
|
-
|
|
109
|
-
6. **Call \`approve_variant_briefs({ sessionId, briefIds: [all chosen briefs] })\`**. Response: \`{ stage: 'work_items_ready', codeGenWorkItemIds: [...] }\` — one work item per approved brief.
|
|
110
|
-
|
|
111
|
-
7. **Lease the work** with \`continue_variants({ sessionId, action: 'request_work' })\`. Response has \`leaseId\`, \`leaseTtlMs\`, and \`leasedWorkItems[]\` — one per approved brief (plus a preceding \`scaffold_base\` for fresh-project; lease scaffold first, succeed it, then re-lease for the code-gens).
|
|
112
|
-
|
|
113
|
-
8. **Run all leased code-gen items IN PARALLEL.** The preferred mechanism in Claude Code is to spawn one Task sub-agent per leased item in a single message — they execute concurrently. Each sub-agent:
|
|
114
|
-
- Reads \`input.briefBody\` and \`input.target\`
|
|
115
|
-
- Edits files in \`input.worktreePath\` (each variant has its own isolated worktree)
|
|
116
|
-
- Calls \`report_variant_complete({ sessionId, workItemId, leaseId, attempt, status: 'succeeded' })\` itself. On failure, status \`'failed'\` with error description.
|
|
117
|
-
|
|
118
|
-
9. **When all variants are done (\`stage: 'ready'\` or \`'degraded'\`), tell the user the variants are ready and explain how to compare them.** Each variant has its own dev server running in an isolated worktree. The Rivet iframe shows a chip at the bottom-center: prev/label/next/check/dismiss. The user cycles between the live, running variants by clicking prev/next (the iframe re-mounts onto the variant's dev server in ~50ms via proxy retarget). When they like one, they click the check on the chip — that commits the variant.
|
|
119
|
-
Example reply:
|
|
120
|
-
> Variants are ready — open the Rivet preview and use the chip at the bottom of the iframe to cycle between them. Click the checkmark on the one you want and I'll apply it.
|
|
121
|
-
|
|
122
|
-
You do NOT need to print diffs in chat. The user picks visually in the iframe.
|
|
123
|
-
|
|
124
|
-
10. **Watch for the user's pick.** Either:
|
|
125
|
-
a) Use \`watch_for_changes({ sessionId })\` (existing tool) which blocks until the user clicks the check on the chip, OR
|
|
126
|
-
b) Start a Monitor on \`http://localhost:RIVET_PORT/api/mcp/status\` like the visual-editor flow does.
|
|
127
|
-
When changes arrive, call \`get_pending_changes({ sessionId })\` and you'll see a \`VariantChangeItem\` in \`changes[]\`.
|
|
128
|
-
|
|
129
|
-
11. **Apply the variant.** From the \`VariantChangeItem\` payload:
|
|
130
|
-
- \`payload.kind === 'diff'\` → \`git apply\` the unified diff against the user's project root
|
|
131
|
-
- \`payload.kind === 'new-project'\` → copy the contents of \`payload.sourceWorktreePath\` to \`destinationPath\`
|
|
132
|
-
Tell the user which variant you applied (use \`variantLabel\` from the change item).
|
|
133
|
-
|
|
134
|
-
You can also call \`commit_variant({ sessionId, variantId })\` yourself if the user expressed their pick in chat instead of clicking the chip ("go with #2", "the spring one") — same effect, just routed through the agent rather than the chip.
|
|
135
|
-
|
|
136
|
-
### Rules
|
|
137
|
-
|
|
138
|
-
- **Never** generate variants natively (Task sub-agents, parallel tool calls, your own creative process) without going through \`propose_variants\` first.
|
|
139
|
-
- Always pass the user's prompt verbatim — don't paraphrase.
|
|
140
|
-
- Briefs are shown as PLAIN TEXT in chat. Do not render UI, open a browser tab, or fabricate a URL.
|
|
141
|
-
- The user picks AFTER seeing the variants render LIVE in the iframe, not before. Step 4 is "look good or adjust the briefs?"; step 9 hands off to the iframe chip for visual cycling + commit.
|
|
142
|
-
- Don't dump diffs in chat by default. The iframe chip is the primary review surface. If the user explicitly asks "show me the diffs", then print them.
|
|
143
|
-
- Step 8 (parallel code-gen) is the only step where you fan out — every other step is one tool call.
|
|
144
|
-
- For fresh-project, \`scaffold_base\` runs first; only after it succeeds are the \`code_gen\` items leasable. Loop \`continue_variants(action='request_work')\` after each transition.
|
|
65
|
+
${AGENT_VARIANTS_SECTION}
|
|
145
66
|
`;
|
|
146
67
|
//# sourceMappingURL=claude-skill.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-skill.js","sourceRoot":"","sources":["../../../src/utils/skills/claude-skill.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"claude-skill.js","sourceRoot":"","sources":["../../../src/utils/skills/claude-skill.ts"],"names":[],"mappings":";;;AAAA,yEAGoC;AAEvB,QAAA,oBAAoB,GAAG,EAAE,CAAC;AACvC,MAAM,2BAA2B,GAAG,iCAAiC,4BAAoB,GAAG,CAAC;AAEhF,QAAA,gBAAgB,GAAG,OAAO,CAAC;AAC3B,QAAA,qBAAqB,GAAG,UAAU,CAAC;AAEhD,MAAM,sBAAsB,GAAG,IAAA,oDAAyB,EAAC;IACvD,cAAc,EAAE,cAAc;IAC9B,KAAK,EAAE;;;yKAGgK;IACvK,YAAY,EAAE,2HAA2H;IACzI,cAAc,EAAE,iBAAiB;CAClC,CAAC,CAAC;AAEU,QAAA,oBAAoB,GAAG;;;;;EAKlC,2BAA2B;;;;;EAK3B,iDAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqCtB,sBAAsB;CACvB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const CURSOR_RULES_VERSION =
|
|
1
|
+
export declare const CURSOR_RULES_VERSION = 20;
|
|
2
2
|
export declare const CURSOR_RULES_FILENAME = "rivet.mdc";
|
|
3
|
-
export declare const CURSOR_RULES_CONTENT
|
|
3
|
+
export declare const CURSOR_RULES_CONTENT: string;
|
|
4
4
|
//# sourceMappingURL=cursor-rules.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursor-rules.d.ts","sourceRoot":"","sources":["../../../src/utils/skills/cursor-rules.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cursor-rules.d.ts","sourceRoot":"","sources":["../../../src/utils/skills/cursor-rules.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,qBAAqB,cAAc,CAAC;AAajD,eAAO,MAAM,oBAAoB,QAgDhC,CAAC"}
|