rivet-design 0.11.9 → 0.11.10
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/config/flags.d.ts +3 -0
- package/dist/config/flags.d.ts.map +1 -1
- package/dist/config/flags.js +1 -0
- package/dist/config/flags.js.map +1 -1
- package/dist/install/harnesses.js +1 -1
- package/dist/mcp/agent-variants/contracts.d.ts +2 -2
- package/dist/mcp/agent-variants/contracts.d.ts.map +1 -1
- package/dist/mcp/agent-variants/contracts.js +1 -1
- package/dist/mcp/agent-variants/contracts.js.map +1 -1
- package/dist/mcp/agent-variants/tools.d.ts +2 -0
- package/dist/mcp/agent-variants/tools.d.ts.map +1 -1
- package/dist/mcp/agent-variants/tools.js +8 -2
- package/dist/mcp/agent-variants/tools.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +144 -69
- package/dist/mcp/server.js.map +1 -1
- package/dist/routes/agentVariants.d.ts.map +1 -1
- package/dist/routes/agentVariants.js +10 -0
- package/dist/routes/agentVariants.js.map +1 -1
- package/dist/server.js +5 -6
- package/dist/server.js.map +1 -1
- package/dist/services/ProjectDetectionService.d.ts.map +1 -1
- package/dist/services/ProjectDetectionService.js +9 -4
- package/dist/services/ProjectDetectionService.js.map +1 -1
- package/dist/services/staticProjectTarget.d.ts +19 -0
- package/dist/services/staticProjectTarget.d.ts.map +1 -0
- package/dist/services/staticProjectTarget.js +97 -0
- package/dist/services/staticProjectTarget.js.map +1 -0
- package/dist/services/staticStarter.d.ts.map +1 -1
- package/dist/services/staticStarter.js +2 -1
- package/dist/services/staticStarter.js.map +1 -1
- package/dist/utils/skills/claude-skill.d.ts +1 -1
- package/dist/utils/skills/claude-skill.js +7 -7
- package/dist/utils/skills/cursor-rules.d.ts +1 -1
- package/dist/utils/skills/cursor-rules.js +7 -7
- package/dist/utils/skills/shared-variants-protocol.js +3 -3
- package/package.json +1 -1
- package/src/ui/dist/assets/main-CYm60Rod.js +641 -0
- package/src/ui/dist/index.html +1 -1
- package/src/ui/dist/assets/main-BtohezP4.js +0 -641
|
@@ -0,0 +1,97 @@
|
|
|
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.needsStaticEntryPath = exports.resolveStaticProjectTarget = exports.listStaticHtmlEntryFiles = exports.isStaticHtmlFilePath = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const STATIC_HTML_EXTENSIONS = new Set(['.html', '.htm']);
|
|
10
|
+
const DEFAULT_STATIC_ENTRY = 'index.html';
|
|
11
|
+
/** Returns true when a path points at an HTML document Rivet can serve directly. */
|
|
12
|
+
const isStaticHtmlFilePath = (filePath) => STATIC_HTML_EXTENSIONS.has(path_1.default.extname(filePath).toLowerCase());
|
|
13
|
+
exports.isStaticHtmlFilePath = isStaticHtmlFilePath;
|
|
14
|
+
/** Lists top-level HTML documents in stable order for static project entry selection. */
|
|
15
|
+
const listStaticHtmlEntryFiles = (projectPath) => {
|
|
16
|
+
if (!fs_1.default.existsSync(projectPath))
|
|
17
|
+
return [];
|
|
18
|
+
const stats = fs_1.default.statSync(projectPath);
|
|
19
|
+
if (!stats.isDirectory())
|
|
20
|
+
return [];
|
|
21
|
+
return fs_1.default
|
|
22
|
+
.readdirSync(projectPath, { withFileTypes: true })
|
|
23
|
+
.filter((entry) => entry.isFile() && (0, exports.isStaticHtmlFilePath)(entry.name))
|
|
24
|
+
.map((entry) => entry.name)
|
|
25
|
+
.sort((left, right) => left.localeCompare(right));
|
|
26
|
+
};
|
|
27
|
+
exports.listStaticHtmlEntryFiles = listStaticHtmlEntryFiles;
|
|
28
|
+
const normalizeEntryPath = (entryPath) => entryPath.split(path_1.default.sep).join('/');
|
|
29
|
+
const resolveEntryPath = (projectPath, entryPath) => {
|
|
30
|
+
const resolvedProjectPath = path_1.default.resolve(projectPath);
|
|
31
|
+
const resolvedEntryPath = path_1.default.isAbsolute(entryPath)
|
|
32
|
+
? path_1.default.resolve(entryPath)
|
|
33
|
+
: path_1.default.resolve(resolvedProjectPath, entryPath);
|
|
34
|
+
const relativeEntryPath = path_1.default.relative(resolvedProjectPath, resolvedEntryPath);
|
|
35
|
+
if (relativeEntryPath === '' ||
|
|
36
|
+
relativeEntryPath.startsWith('..') ||
|
|
37
|
+
path_1.default.isAbsolute(relativeEntryPath)) {
|
|
38
|
+
throw new Error(`Static entry must be inside projectPath: ${entryPath}`);
|
|
39
|
+
}
|
|
40
|
+
return normalizeEntryPath(relativeEntryPath);
|
|
41
|
+
};
|
|
42
|
+
/** Resolves a folder or direct HTML file into the static root and entry file. */
|
|
43
|
+
const resolveStaticProjectTarget = ({ targetPath, entryPath, }) => {
|
|
44
|
+
const resolvedTargetPath = path_1.default.resolve(targetPath);
|
|
45
|
+
if (!fs_1.default.existsSync(resolvedTargetPath)) {
|
|
46
|
+
throw new Error(`Project path does not exist: ${resolvedTargetPath}`);
|
|
47
|
+
}
|
|
48
|
+
const targetStats = fs_1.default.statSync(resolvedTargetPath);
|
|
49
|
+
if (targetStats.isFile()) {
|
|
50
|
+
if (!(0, exports.isStaticHtmlFilePath)(resolvedTargetPath)) {
|
|
51
|
+
throw new Error(`Static project file must be an HTML file: ${targetPath}`);
|
|
52
|
+
}
|
|
53
|
+
const projectPath = path_1.default.dirname(resolvedTargetPath);
|
|
54
|
+
return {
|
|
55
|
+
projectPath,
|
|
56
|
+
entryPath: path_1.default.basename(resolvedTargetPath),
|
|
57
|
+
htmlEntryFiles: (0, exports.listStaticHtmlEntryFiles)(projectPath),
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
if (!targetStats.isDirectory()) {
|
|
61
|
+
throw new Error(`Project path must be a directory or HTML file: ${targetPath}`);
|
|
62
|
+
}
|
|
63
|
+
const htmlEntryFiles = (0, exports.listStaticHtmlEntryFiles)(resolvedTargetPath);
|
|
64
|
+
if (entryPath) {
|
|
65
|
+
return {
|
|
66
|
+
projectPath: resolvedTargetPath,
|
|
67
|
+
entryPath: resolveEntryPath(resolvedTargetPath, entryPath),
|
|
68
|
+
htmlEntryFiles,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
if (htmlEntryFiles.includes(DEFAULT_STATIC_ENTRY)) {
|
|
72
|
+
return {
|
|
73
|
+
projectPath: resolvedTargetPath,
|
|
74
|
+
entryPath: DEFAULT_STATIC_ENTRY,
|
|
75
|
+
htmlEntryFiles,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
if (htmlEntryFiles.length === 1) {
|
|
79
|
+
return {
|
|
80
|
+
projectPath: resolvedTargetPath,
|
|
81
|
+
entryPath: htmlEntryFiles[0],
|
|
82
|
+
htmlEntryFiles,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
projectPath: resolvedTargetPath,
|
|
87
|
+
entryPath: DEFAULT_STATIC_ENTRY,
|
|
88
|
+
htmlEntryFiles,
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
exports.resolveStaticProjectTarget = resolveStaticProjectTarget;
|
|
92
|
+
/** Returns true when a static folder needs the caller to choose among HTML files. */
|
|
93
|
+
const needsStaticEntryPath = (target) => target.htmlEntryFiles.length > 1 &&
|
|
94
|
+
!target.htmlEntryFiles.includes(DEFAULT_STATIC_ENTRY) &&
|
|
95
|
+
target.entryPath === DEFAULT_STATIC_ENTRY;
|
|
96
|
+
exports.needsStaticEntryPath = needsStaticEntryPath;
|
|
97
|
+
//# sourceMappingURL=staticProjectTarget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"staticProjectTarget.js","sourceRoot":"","sources":["../../src/services/staticProjectTarget.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAEx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,CAAC;AAH/B,QAAA,oBAAoB,wBAGW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staticStarter.d.ts","sourceRoot":"","sources":["../../src/services/staticStarter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"staticStarter.d.ts","sourceRoot":"","sources":["../../src/services/staticStarter.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,k1FAoG/B,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAiBtE"}
|
|
@@ -8,6 +8,7 @@ exports.ensureStaticStarterCanvas = ensureStaticStarterCanvas;
|
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
10
|
const logger_1 = require("../utils/logger");
|
|
11
|
+
const staticProjectTarget_1 = require("./staticProjectTarget");
|
|
11
12
|
const log = (0, logger_1.createLogger)('staticStarter');
|
|
12
13
|
/**
|
|
13
14
|
* Minimal, dependency-free landing page written into an empty static workspace
|
|
@@ -132,7 +133,7 @@ exports.STATIC_STARTER_HTML = `<!doctype html>
|
|
|
132
133
|
*/
|
|
133
134
|
function ensureStaticStarterCanvas(projectPath) {
|
|
134
135
|
try {
|
|
135
|
-
if (
|
|
136
|
+
if ((0, staticProjectTarget_1.listStaticHtmlEntryFiles)(projectPath).length > 0)
|
|
136
137
|
return false;
|
|
137
138
|
if (fs_1.default.existsSync(path_1.default.join(projectPath, '.rivet')))
|
|
138
139
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"staticStarter.js","sourceRoot":"","sources":["../../src/services/staticStarter.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"staticStarter.js","sourceRoot":"","sources":["../../src/services/staticStarter.ts"],"names":[],"mappings":";;;;;;AAiIA,8DAiBC;AAlJD,4CAAoB;AACpB,gDAAwB;AACxB,4CAA+C;AAC/C,+DAAiE;AAEjE,MAAM,GAAG,GAAG,IAAA,qBAAY,EAAC,eAAe,CAAC,CAAC;AAE1C;;;;GAIG;AACU,QAAA,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoGlC,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,SAAgB,yBAAyB,CAAC,WAAmB;IAC3D,IAAI,CAAC;QACH,IAAI,IAAA,8CAAwB,EAAC,WAAW,CAAC,CAAC,MAAM,GAAG,CAAC;YAAE,OAAO,KAAK,CAAC;QACnE,IAAI,YAAE,CAAC,UAAU,CAAC,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC;QAClE,YAAE,CAAC,aAAa,CACd,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,EACpC,2BAAmB,EACnB,MAAM,CACP,CAAC;QACF,GAAG,CAAC,IAAI,CACN,yDAAyD,WAAW,EAAE,CACvE,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,GAAG,CAAC,IAAI,CAAC,yCAAyC,WAAW,GAAG,EAAE,GAAG,CAAC,CAAC;QACvE,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
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 =
|
|
5
|
+
exports.CLAUDE_SKILL_VERSION = 24;
|
|
6
6
|
const CLAUDE_SKILL_VERSION_MARKER = `[//]: # (rivet-skill-version: ${exports.CLAUDE_SKILL_VERSION})`;
|
|
7
7
|
exports.CLAUDE_SKILL_DIR = 'rivet';
|
|
8
8
|
exports.CLAUDE_SKILL_FILENAME = 'SKILL.md';
|
|
@@ -17,13 +17,13 @@ const AGENT_VARIANTS_SECTION = (0, shared_variants_protocol_1.buildAgentVariants
|
|
|
17
17
|
});
|
|
18
18
|
exports.CLAUDE_SKILL_CONTENT = `---
|
|
19
19
|
name: rivet
|
|
20
|
-
description: Rivet —
|
|
20
|
+
description: Rivet — design agent for point-and-click UI changes ("open rivet", "use rivet", "make a visual change") and 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.
|
|
21
21
|
---
|
|
22
22
|
|
|
23
23
|
${CLAUDE_SKILL_VERSION_MARKER}
|
|
24
24
|
# Rivet
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
Rivet is a **design agent** with two flows: the **visual editor** (point-and-click changes to a web app — including an empty or HTML-only folder, which opens in static mode) and the **agent-variants flow** (explore N parallel design directions before committing).
|
|
27
27
|
|
|
28
28
|
${shared_variants_protocol_1.PICKING_THE_FLOW_TABLE}
|
|
29
29
|
|
|
@@ -31,10 +31,10 @@ ${shared_variants_protocol_1.PICKING_THE_FLOW_TABLE}
|
|
|
31
31
|
|
|
32
32
|
## Starting a session
|
|
33
33
|
|
|
34
|
-
An **empty
|
|
34
|
+
An **empty folder, HTML-only folder, or standalone HTML file is a valid target** — \`open_visual_editor\` detects the framework and starts the right preview backend. When the user says "open rivet" / "use rivet here" in such a target, open the editor — do NOT refuse or reroute to variants because there's "no app yet."
|
|
35
35
|
|
|
36
|
-
1. Call \`
|
|
37
|
-
2.
|
|
36
|
+
1. Call \`open_visual_editor({ projectPath })\` — pass a specific HTML file as \`projectPath\` when the user names one; otherwise pass the folder. Do NOT pass \`startPort\` or any port unless the user provided a running server.
|
|
37
|
+
2. If \`opened: false\`, follow \`nextStep\` / \`nextAction\`; for \`entry_path_required\`, call \`open_visual_editor\` again with the target HTML file or \`entryPath\`.
|
|
38
38
|
3. Tell the user: "Rivet is ready — make your visual changes and click 'Send to Claude Code'."
|
|
39
39
|
4. Call \`watch_for_changes({ sessionId })\` to wait for the user's changes.
|
|
40
40
|
|
|
@@ -57,7 +57,7 @@ When the user says they're done, call \`close_visual_editor({ sessionId })\`.
|
|
|
57
57
|
|
|
58
58
|
## Rules
|
|
59
59
|
|
|
60
|
-
-
|
|
60
|
+
- Call \`open_visual_editor\` directly; it detects the project and starts the preview backend
|
|
61
61
|
- **Always use \`watch_for_changes\`** to wait for user changes — do NOT use Monitor, background shell commands, or manual polling
|
|
62
62
|
- **Never auto-commit** after applying visual changes — let the user decide
|
|
63
63
|
- The dev server stays running after \`close_visual_editor\`
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CURSOR_RULES_CONTENT = exports.CURSOR_RULES_FILENAME = exports.CURSOR_RULES_VERSION = void 0;
|
|
4
4
|
const shared_variants_protocol_1 = require("./shared-variants-protocol");
|
|
5
|
-
exports.CURSOR_RULES_VERSION =
|
|
5
|
+
exports.CURSOR_RULES_VERSION = 23;
|
|
6
6
|
exports.CURSOR_RULES_FILENAME = 'rivet.mdc';
|
|
7
7
|
const CURSOR_RULES_VERSION_MARKER = `rivet-rules-version: ${exports.CURSOR_RULES_VERSION}`;
|
|
8
8
|
const AGENT_VARIANTS_SECTION = (0, shared_variants_protocol_1.buildAgentVariantsSection)({
|
|
@@ -15,13 +15,13 @@ const AGENT_VARIANTS_SECTION = (0, shared_variants_protocol_1.buildAgentVariants
|
|
|
15
15
|
nativeGenLabel: 'Task tool',
|
|
16
16
|
});
|
|
17
17
|
exports.CURSOR_RULES_CONTENT = `---
|
|
18
|
-
description: Rivet —
|
|
18
|
+
description: Rivet — design agent for point-and-click UI changes ("open rivet", "open the visual editor") and exploring N parallel design directions ("create variants", "show me options for X", "build me X from scratch", "create a new Y app")
|
|
19
19
|
alwaysApply: false
|
|
20
20
|
---
|
|
21
21
|
<!-- ${CURSOR_RULES_VERSION_MARKER} -->
|
|
22
22
|
# Rivet
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
Rivet is a **design agent** with two flows: the **visual editor** (point-and-click changes to a web app — including an empty or HTML-only folder, which opens in static mode) and the **agent-variants flow** (explore N parallel design directions before committing).
|
|
25
25
|
|
|
26
26
|
> Tip: type \`@rivet.mdc\` in chat to invoke this rule manually.
|
|
27
27
|
|
|
@@ -31,10 +31,10 @@ ${shared_variants_protocol_1.PICKING_THE_FLOW_TABLE}
|
|
|
31
31
|
|
|
32
32
|
## Starting a session
|
|
33
33
|
|
|
34
|
-
An **empty
|
|
34
|
+
An **empty folder, HTML-only folder, or standalone HTML file is a valid target** — \`open_visual_editor\` detects the framework and starts the right preview backend. When the user says "open rivet" / "use rivet here" in such a target, open the editor — do NOT refuse or reroute to variants because there's "no app yet."
|
|
35
35
|
|
|
36
|
-
1. Call \`
|
|
37
|
-
2.
|
|
36
|
+
1. Call \`open_visual_editor({ projectPath })\` — pass a specific HTML file as \`projectPath\` when the user names one; otherwise pass the folder. Do NOT pass \`startPort\` or any port unless the user provided a running server.
|
|
37
|
+
2. If \`opened: false\`, follow \`nextStep\` / \`nextAction\`; for \`entry_path_required\`, call \`open_visual_editor\` again with the target HTML file or \`entryPath\`.
|
|
38
38
|
3. Tell the user: "Rivet is ready — make your visual changes and click 'Send to Cursor'."
|
|
39
39
|
4. Call \`watch_for_changes({ sessionId })\` to wait for the user's changes.
|
|
40
40
|
|
|
@@ -55,7 +55,7 @@ When the user says they're done, call \`close_visual_editor({ sessionId })\`.
|
|
|
55
55
|
|
|
56
56
|
## Rules
|
|
57
57
|
|
|
58
|
-
-
|
|
58
|
+
- Call \`open_visual_editor\` directly; it detects the project and starts the preview backend
|
|
59
59
|
- **Always use \`watch_for_changes\`** to wait for user changes — do NOT use Monitor, background shell commands, or manual polling
|
|
60
60
|
- **Never auto-commit** after applying visual changes — let the user decide
|
|
61
61
|
- Always stop and ask before re-entering the watch loop
|
|
@@ -47,7 +47,7 @@ There are three sub-flows. Pick by project state:
|
|
|
47
47
|
- \`target\` (optional): \`{ type: 'element'|'file'|'route', ref }\` — set this for refinement requests pinned to a specific element/file/route
|
|
48
48
|
- \`projectPath\` (optional): defaults to the MCP server's cwd; pass explicitly if the variants target a different directory
|
|
49
49
|
|
|
50
|
-
Response: \`{ sessionId, stage: 'work_items_ready', mode: 'existing', leaseId, leaseTtlMs, variants: [{ variantId, briefId, label, workItem }], project: { projectPath, framework }, visualEditor? }\`. The server already detected the framework, opened the Rivet visual editor (share \`visualEditor.url\` with the user immediately), and started every variant — you do NOT need to call \`
|
|
50
|
+
Response: \`{ sessionId, stage: 'work_items_ready', mode: 'existing', leaseId, leaseTtlMs, variants: [{ variantId, briefId, label, workItem }], project: { projectPath, framework }, visualEditor? }\`. The server already detected the framework, opened the Rivet visual editor (share \`visualEditor.url\` with the user immediately), and started every variant — you do NOT need to call \`open_visual_editor\` or \`continue_variants(request_work)\`. Each \`variants[i].workItem\` carries \`input.worktreePath\` (where to edit files) and \`attempt\`.
|
|
51
51
|
|
|
52
52
|
2. ${opts.step9}
|
|
53
53
|
|
|
@@ -82,7 +82,7 @@ For brand-new projects the user describes from scratch ("build me a Vite todo ap
|
|
|
82
82
|
- \`framework\` (optional, defaults to \`'vite'\`)
|
|
83
83
|
- \`destinationParent\` (optional, absolute path; defaults to the user's home dir)
|
|
84
84
|
|
|
85
|
-
Response: \`{ sessionId, stage: 'work_items_ready', mode: 'zero_to_one', leaseId, leaseTtlMs, variants: [...], scaffoldBaseWorkItemId, destinationPath, visualEditor? }\`. The server opened the editor for you if \`visualEditor\` is present — share \`visualEditor.url\` with the user immediately ("Generating variants — watch here: <url>"). Skip the manual \`
|
|
85
|
+
Response: \`{ sessionId, stage: 'work_items_ready', mode: 'zero_to_one', leaseId, leaseTtlMs, variants: [...], scaffoldBaseWorkItemId, destinationPath, visualEditor? }\`. The server opened the editor for you if \`visualEditor\` is present — share \`visualEditor.url\` with the user immediately ("Generating variants — watch here: <url>"). Skip the manual \`open_visual_editor\` step here because the zero-to-one destination is a brand-new directory the server derives. This applies ONLY to the not-yet-created zero-to-one destination. An **existing** empty or HTML-only folder is a perfectly valid \`open_visual_editor\` target (it opens in static mode) — do not generalize this skip to "empty dirs can't be opened." Each \`variants[i].workItem\` carries \`input\` and \`attempt\`.
|
|
86
86
|
|
|
87
87
|
2. **From here, follow Sub-flow A steps 2-5** (parallel code-gen with first-line label using each variant's \`workItem.input.worktreePath\` and the shared \`leaseId\`, then ready, watch, apply). The work items are \`static_preview\` for zero-to-one — agent output must be passed to \`report_variant_complete\` as a JSON **object** with shape \`{ html: string, css?: string, js?: string }\` (self-contained HTML, no React/Vite-only imports). Do NOT stringify it — pass \`output: { html: "<!doctype html>..." }\`, not \`output: "{\\"html\\": \\"...\\"}"\`. On commit, the apply payload is \`payload.kind === 'project-created'\` — the server materialized the chosen variant to \`destinationPath\`.
|
|
88
88
|
|
|
@@ -130,7 +130,7 @@ ${describe_motion_protocol_1.DESCRIBE_MOTION_PROTOCOL}
|
|
|
130
130
|
|
|
131
131
|
- **Never** generate variants natively (${opts.nativeGenLabel}, parallel tool calls, your own creative process) without going through \`start_variants\` first.
|
|
132
132
|
- Always pass the user's prompt verbatim — don't paraphrase.
|
|
133
|
-
- Prefer \`start_variants\` (with the matching \`mode\`) over the older \`propose_variants\` → \`report_variant_briefs\` → \`approve_variant_briefs\` chain. The unified call also handles
|
|
133
|
+
- Prefer \`start_variants\` (with the matching \`mode\`) over the older \`propose_variants\` → \`report_variant_briefs\` → \`approve_variant_briefs\` chain. The unified call also handles project detection, \`open_visual_editor\`, and \`continue_variants(request_work)\` server-side. The older variant tools and standalone \`open_visual_editor\` stay registered for the Visual Editor flow (point-and-click changes without variants).
|
|
134
134
|
- For source-grounded fresh projects, pass the raw references as \`userContext\` to \`start_variants\` and do the design/motion extraction DURING source planning (report \`extract_design_system\` / \`describe_motion\` actions with metadata) — don't pre-summarize references before kickoff.
|
|
135
135
|
- Briefs are never an approval gate — reporting them starts the directions immediately. Do not pause to ask the user "do these look good?" before generating. If you mention briefs in chat at all they are PLAIN TEXT; do not render UI, open a browser tab, or fabricate a URL.
|
|
136
136
|
- The user picks AFTER seeing the variants render LIVE in the iframe, not before. Hand off to the iframe chip for visual cycling + commit.
|