rivet-design 0.13.3 → 0.13.5
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/agent-variants/SessionStore.d.ts +25 -4
- package/dist/agent-variants/SessionStore.d.ts.map +1 -1
- package/dist/agent-variants/SessionStore.js +32 -0
- package/dist/agent-variants/SessionStore.js.map +1 -1
- package/dist/agent-variants/VariantWorkspaceManager.d.ts +43 -0
- package/dist/agent-variants/VariantWorkspaceManager.d.ts.map +1 -0
- package/dist/agent-variants/VariantWorkspaceManager.js +216 -0
- package/dist/agent-variants/VariantWorkspaceManager.js.map +1 -0
- package/dist/agent-variants/WorktreeOrchestrator.d.ts +40 -3
- package/dist/agent-variants/WorktreeOrchestrator.d.ts.map +1 -1
- package/dist/agent-variants/WorktreeOrchestrator.js +424 -62
- package/dist/agent-variants/WorktreeOrchestrator.js.map +1 -1
- package/dist/agent-variants/contracts.d.ts +72 -14
- package/dist/agent-variants/contracts.d.ts.map +1 -1
- package/dist/agent-variants/contracts.js +17 -3
- package/dist/agent-variants/contracts.js.map +1 -1
- package/dist/agent-variants/runLabel.d.ts +5 -4
- package/dist/agent-variants/runLabel.d.ts.map +1 -1
- package/dist/agent-variants/runLabel.js +16 -8
- package/dist/agent-variants/runLabel.js.map +1 -1
- package/dist/agent-variants/workItemBriefing.d.ts +26 -0
- package/dist/agent-variants/workItemBriefing.d.ts.map +1 -0
- package/dist/agent-variants/workItemBriefing.js +110 -0
- package/dist/agent-variants/workItemBriefing.js.map +1 -0
- package/dist/cli/client.d.ts +2 -0
- package/dist/cli/client.d.ts.map +1 -1
- package/dist/cli/client.js +1 -1
- package/dist/cli/client.js.map +1 -1
- package/dist/cli/commands/mcpServe.d.ts.map +1 -1
- package/dist/cli/commands/mcpServe.js +47 -20
- package/dist/cli/commands/mcpServe.js.map +1 -1
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +3 -1
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/variants.d.ts.map +1 -1
- package/dist/cli/commands/variants.js +118 -9
- package/dist/cli/commands/variants.js.map +1 -1
- package/dist/cli/hostWorkNextAction.d.ts +33 -26
- package/dist/cli/hostWorkNextAction.d.ts.map +1 -1
- package/dist/cli/hostWorkNextAction.js +47 -24
- package/dist/cli/hostWorkNextAction.js.map +1 -1
- package/dist/cli/router.js +2 -2
- package/dist/cli/router.js.map +1 -1
- package/dist/hosts/workerDefaults.d.ts +62 -0
- package/dist/hosts/workerDefaults.d.ts.map +1 -0
- package/dist/hosts/workerDefaults.js +77 -0
- package/dist/hosts/workerDefaults.js.map +1 -0
- package/dist/install/harnesses.d.ts.map +1 -1
- package/dist/install/harnesses.js +21 -2
- package/dist/install/harnesses.js.map +1 -1
- package/dist/install/mcpRegistration.d.ts +1 -1
- package/dist/install/mcpRegistration.d.ts.map +1 -1
- package/dist/install/mcpRegistration.js +23 -10
- package/dist/install/mcpRegistration.js.map +1 -1
- package/dist/mcp/changeBatchClassification.d.ts +2 -0
- package/dist/mcp/changeBatchClassification.d.ts.map +1 -1
- package/dist/mcp/changeBatchClassification.js +5 -0
- package/dist/mcp/changeBatchClassification.js.map +1 -1
- package/dist/routes/agentVariants.d.ts.map +1 -1
- package/dist/routes/agentVariants.js +11 -4
- package/dist/routes/agentVariants.js.map +1 -1
- package/dist/routes/emptyStatePage.d.ts +14 -0
- package/dist/routes/emptyStatePage.d.ts.map +1 -0
- package/dist/routes/emptyStatePage.js +601 -0
- package/dist/routes/emptyStatePage.js.map +1 -0
- package/dist/routes/static.d.ts.map +1 -1
- package/dist/routes/static.js +2 -73
- package/dist/routes/static.js.map +1 -1
- package/dist/services/TelemetryService.d.ts +8 -0
- package/dist/services/TelemetryService.d.ts.map +1 -1
- package/dist/services/TelemetryService.js +24 -0
- package/dist/services/TelemetryService.js.map +1 -1
- package/dist/services/VariantGenerationService.d.ts.map +1 -1
- package/dist/services/VariantGenerationService.js +14 -0
- package/dist/services/VariantGenerationService.js.map +1 -1
- package/dist/services/VariantRunService.d.ts +5 -2
- package/dist/services/VariantRunService.d.ts.map +1 -1
- package/dist/services/VariantRunService.js +40 -14
- package/dist/services/VariantRunService.js.map +1 -1
- package/dist/services/WorktreeManager.d.ts.map +1 -1
- package/dist/services/WorktreeManager.js +7 -2
- package/dist/services/WorktreeManager.js.map +1 -1
- package/dist/types/change-request-types.d.ts +5 -0
- package/dist/types/change-request-types.d.ts.map +1 -1
- package/dist/utils/cloneOrCopyDirSync.d.ts +14 -0
- package/dist/utils/cloneOrCopyDirSync.d.ts.map +1 -0
- package/dist/utils/cloneOrCopyDirSync.js +72 -0
- package/dist/utils/cloneOrCopyDirSync.js.map +1 -0
- package/dist/utils/skillWriter.d.ts +8 -0
- package/dist/utils/skillWriter.d.ts.map +1 -1
- package/dist/utils/skillWriter.js +35 -0
- package/dist/utils/skillWriter.js.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 +1 -1
- package/dist/utils/skills/cli-guidance.d.ts +2 -2
- package/dist/utils/skills/cli-guidance.d.ts.map +1 -1
- package/dist/utils/skills/cli-guidance.js +11 -10
- package/dist/utils/skills/cli-guidance.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 +1 -1
- package/package.json +3 -1
- package/src/ui/dist/assets/main-Ct4AXMqD.js +422 -0
- package/src/ui/dist/index.html +1 -1
- package/src/ui/dist/assets/main-Bd9GWv8x.js +0 -419
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.CLI_GUIDANCE_DESCRIPTION = exports.CLI_GUIDANCE_BODY = exports.CLI_GUIDANCE_VERSION = void 0;
|
|
11
|
-
exports.CLI_GUIDANCE_VERSION =
|
|
11
|
+
exports.CLI_GUIDANCE_VERSION = 20;
|
|
12
12
|
exports.CLI_GUIDANCE_BODY = `Rivet helps you **explore multiple design directions** for a web app. You drive it by running \`rivet\` CLI commands. Every command prints exactly one JSON envelope on stdout (\`{ schemaVersion, ok, command, data | error }\`), routes progress to stderr, and never prompts for input.
|
|
13
13
|
|
|
14
14
|
**Exit codes:** 0 ok · 1 operation failed (see \`error.code\`) · 2 usage error · 3 auth required · 4 no server for the project · 5 \`rivet wait\` timeout (work still pending or running — not a failure; the envelope's \`state\` says which).
|
|
@@ -24,11 +24,12 @@ exports.CLI_GUIDANCE_BODY = `Rivet helps you **explore multiple design direction
|
|
|
24
24
|
## Commands
|
|
25
25
|
|
|
26
26
|
- \`rivet open [--project <path>] [--agent claude|codex|cursor] [--rivet-port N] [--user-port N] [--framework nextjs|vite|cra|remix|svelte|static] [--entry <path>] [--no-browser] [--no-git]\` — start or attach the project's editor server (idempotent; returns \`editorUrl\`). It detects the app, attaches to an already-running dev server, or starts one from the app's standard \`dev\`/\`start\`/\`serve\` script when possible. Omit \`--no-browser\` for interactive work so the UI opens for the user.
|
|
27
|
-
- \`rivet variants start --project <path> --instruction <text> [--briefs <json>] [--count N] [--element <selector>] [--fresh] [--target <sessionId>:<variantId>]\` — explore design directions. Agent invocations MUST pass one AI-authored brief per direction; \`briefs.length\` sets the count. Use \`--fresh\` for prompt-only 0-to-1 generation in a blank/new workspace
|
|
28
|
-
- \`rivet variants complete <workId> --project <path> [--session <sessionId>] [--status succeeded|failed|cancelled] [--output <json>] [--error <message>]\` — report one host-agent work item complete after you edit its
|
|
27
|
+
- \`rivet variants start --project <path> --instruction <text> [--run-label <text>] [--briefs <json>] [--count N] [--element <selector>] [--files <json>] [--fresh] [--target <sessionId>:<variantId>]\` — explore design directions. Agent invocations MUST pass an AI-authored 1–3 word batch label through \`rivet_variants\` \`runLabel\` or CLI \`--run-label\`, plus one AI-authored brief per direction; \`briefs.length\` sets the count. Use \`--files\` for already-known project paths, \`--fresh\` for prompt-only 0-to-1 generation in a blank/new workspace, and \`--target\` to Vary an existing direction. Returns a \`workId\` and \`nextAction\` after workspace provisioning.
|
|
28
|
+
- \`rivet variants complete <workId> --project <path> [--session <sessionId>] [--status succeeded|failed|cancelled] [--output <json>] [--error <message>]\` — report one host-agent work item complete after you edit its assigned workspace. Static artifacts are read from disk; do not send them through \`--output\`.
|
|
29
29
|
- \`rivet wait <workId> --project <path> [--timeout <seconds>]\` — bounded block until a work id settles (exit 5 on timeout; re-issue or check status).
|
|
30
30
|
- \`rivet status --project <path> [--watch]\` — session, resolved runner, active run, and the variants snapshot. \`--watch\` streams NDJSON.
|
|
31
31
|
- \`rivet variants status --project <path>\` / \`rivet variants list --project <path> [--history]\` — inspect live or past directions.
|
|
32
|
+
- \`rivet variants get <sessionId>:<variantId> --project <path>\` — retrieve one exact variant, including its local artifact path or diff, from a reference copied by the editor.
|
|
32
33
|
- \`rivet variants commit <variantId> --project <path> [--session <id>]\` — send the chosen direction to the project.
|
|
33
34
|
- \`rivet variants cancel <sessionId> --project <path>\` — cancel a running variants session.
|
|
34
35
|
- \`rivet evidence capture --url <url>\` — rendered design evidence (root variables, element styles, fonts) for a reference URL.
|
|
@@ -38,20 +39,20 @@ exports.CLI_GUIDANCE_BODY = `Rivet helps you **explore multiple design direction
|
|
|
38
39
|
|
|
39
40
|
## Typical flows
|
|
40
41
|
|
|
41
|
-
Before every agent-initiated variants start, author one or more direction briefs as \`[{"label":"…","body":"…"}]\`. Each \`label\` is an AI-authored direction title: 1–5 plain-English words naming what that direction concretely changes, not a vibe or numbered placeholder. Each \`body\` is a concise plain-English subtitle of at most 10 words describing that direction. Use one brief for a single visualization when the user wants Rivet's visualization framework without divergent ideas. For multiple directions, make every brief meaningfully different. Pass the array through the \`rivet_variants\` \`briefs\` field or CLI \`--briefs <json>\`, and omit \`--count\` because the array length is authoritative. Human-direct CLI calls may omit briefs and use Rivet's deterministic fallback.
|
|
42
|
+
Before every agent-initiated variants start, author a 1–3 word batch label plus one or more direction briefs as \`[{"label":"…","body":"…"}]\`. The batch label summarizes the shared request and is passed through \`runLabel\` (MCP) or \`--run-label\` (CLI). Each brief \`label\` is an AI-authored direction title: 1–5 plain-English words naming what that direction concretely changes, not a vibe or numbered placeholder. Each \`body\` is a concise plain-English subtitle of at most 10 words describing that direction. Add an optional \`notes\` string per brief for richer implementation intent (design tokens, motion specs, constraints) — it is delivered verbatim to that direction's worker and never shown in UI chips. Use one brief for a single visualization when the user wants Rivet's visualization framework without divergent ideas. For multiple directions, make every brief meaningfully different. Pass the array through the \`rivet_variants\` \`briefs\` field or CLI \`--briefs <json>\`, and omit \`--count\` because the array length is authoritative. Human-direct CLI calls may omit the batch label and briefs and use Rivet's deterministic fallback.
|
|
42
43
|
|
|
43
44
|
Existing app:
|
|
44
45
|
1. \`rivet open --project <path> --caller-agent cursor --caller-model <model> --caller-session <id>\` → note \`editorUrl\`, \`sessionId\`, and \`resolvedRunner\`.
|
|
45
|
-
2. Author three distinct title/subtitle briefs, then call \`rivet variants start --project <path> --instruction "try three hero layouts" --briefs '[{"label":"Split hero","body":"Moves supporting proof beside the primary call to action."},{"label":"Layered hero","body":"Stacks product imagery behind a compact centered headline."},{"label":"Product-led hero","body":"Lets the product preview dominate the opening composition."}]' --caller-agent cursor --caller-model <model> --caller-session <id>\` → note \`workId\`.
|
|
46
|
-
3. If the start response has \`nextAction.action="complete_host_variant_work"\`, execute it immediately. Otherwise poll \`rivet status --project <path>\` until that \`nextAction\` appears.
|
|
47
|
-
4.
|
|
46
|
+
2. Author a batch label and three distinct title/subtitle briefs, then call \`rivet variants start --project <path> --instruction "try three hero layouts" --run-label "Hero layouts" --briefs '[{"label":"Split hero","body":"Moves supporting proof beside the primary call to action."},{"label":"Layered hero","body":"Stacks product imagery behind a compact centered headline."},{"label":"Product-led hero","body":"Lets the product preview dominate the opening composition."}]' --caller-agent cursor --caller-model <model> --caller-session <id>\` → note \`workId\`.
|
|
47
|
+
3. If the start response has \`nextAction.action="complete_host_variant_work"\`, execute it immediately. Otherwise poll \`rivet status --project <path>\` until that \`nextAction\` appears. Each work item carries a server-authored \`workerPrompt\` pointing at its briefing file — the full packet (direction, mode contract, boundaries, completion command). Follow \`nextAction.parallelism\` exactly: one item → follow its \`workerPrompt\` yourself in the current host; multiple items → spawn every worker in that same turn as background subagents, passing each item's \`workerPrompt\` VERBATIM as the entire worker prompt — compose nothing, and never re-plan or elaborate briefs before spawning. When \`nextAction.worker.agentType\` is set (Claude Code: \`rivet-worker\`, installed by \`rivet install\` with tuned model/effort defaults), spawn each worker AS that subagent type; fall back to your default subagent type only if it is not registered. For \`mode="vary"\` the workspace entry already contains the source direction's finished code: read it first, apply the requested delta with targeted \`Edit\` operations in place, and never rewrite or re-emit the full file — unchanged sections must remain untouched. For \`workspace.kind="artifact_directory"\` the deliverable is \`workspace.rootPath/workspace.entryPath\` (write it in full only when it starts empty, i.e. \`mode="create"\`); for \`workspace.kind="git_worktree"\`, edit the app under \`workspace.projectPath\`.
|
|
48
|
+
4. The briefing file ends with the item's exact \`completeCommand\`: the worker runs \`rivet variants complete <workId> --project <path> --session <sessionId>\` itself as its final step, the moment its workspace is done. Completions are never held back or batched by the coordinator — and because workers self-report, the coordinator does NOT poll status while workers run: check \`rivet status\` once after workers return (or on a single ≥60s wakeup), only to confirm terminal states and surface failures. Rivet reads static HTML from \`workspace.entryPath\` and captures git-worktree changes itself. Do not send inline HTML or repeat project context in the completion payload. If the result says \`requeuedForRegeneration\`, poll status for the renewed lease, address its QA summary, and complete that item once more. If a worker cannot complete it, use \`--status failed --error <message>\`.
|
|
48
49
|
5. Show the user the \`editorUrl\` to compare directions; \`rivet variants commit <variantId> --project <path>\` when they pick one.
|
|
49
50
|
|
|
50
|
-
Fresh 0-to-1: create or use an empty directory, run \`rivet open --project <path> ...\`, author distinct briefs, then run \`rivet variants start --project <path> --fresh --instruction "build a SaaS landing page" --briefs '<json>' ...\`.
|
|
51
|
+
Fresh 0-to-1: create or use an empty directory, run \`rivet open --project <path> ...\`, author a batch label and distinct briefs, then run \`rivet variants start --project <path> --fresh --instruction "build a SaaS landing page" --run-label "SaaS landing" --briefs '<json>' ...\`.
|
|
51
52
|
|
|
52
|
-
Vary an existing direction: after status/list gives you \`sessionId\` and \`variantId\`, author distinct briefs, then run \`rivet variants start --project <path> --target <sessionId>:<variantId> --instruction "make this calmer" --briefs '<json>' ...\`.
|
|
53
|
+
Vary an existing direction: after status/list gives you \`sessionId\` and \`variantId\`, author a batch label and two distinct delta briefs by default, then run \`rivet variants start --project <path> --target <sessionId>:<variantId> --instruction "make this calmer" --run-label "Calmer direction" --briefs '<json>' ...\`. Include \`--files '["src/known-target.tsx"]'\` when the relevant files are already known. Explicit briefs/counts remain authoritative.
|
|
53
54
|
|
|
54
|
-
Rivet owns orchestration; the host agent owns implementation. Do not wait for Rivet to spawn a separate agent. When \`rivet variants start\`, \`rivet status\`, \`rivet_variants\`, or \`rivet_status\` returns \`nextAction.action="complete_host_variant_work"\`, complete those work items from the current host session.
|
|
55
|
+
Rivet owns orchestration; the host agent owns implementation. Do not wait for Rivet to spawn a separate agent. When \`rivet variants start\`, \`rivet status\`, \`rivet_variants\`, or \`rivet_status\` returns \`nextAction.action="complete_host_variant_work"\`, complete those work items from the current host session. Avoid subagent startup for one item. For multiple items, spawn one background worker per isolated workspace in the same turn, and have each worker report its own completion immediately via its \`completeCommand\` (or \`rivet_variants\` action \`complete\`) — a variant's completion must never wait for its siblings.
|
|
55
56
|
|
|
56
57
|
**Never cancel to unblock.** If \`variants start\` is rejected with \`start_in_flight\`, a start is still provisioning (status reports \`variants.starting: true\` — can take minutes); poll status and retry once it clears. If rejected with \`active_session\`, the user has live work: report the conflict and let them decide, or refine the active session with \`--target\`. Cancelling a session destroys the user's in-progress exploration — only do it when the user explicitly asks.`;
|
|
57
58
|
/** One-line description used in host frontmatter/description fields. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-guidance.js","sourceRoot":"","sources":["../../../src/utils/skills/cli-guidance.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEU,QAAA,oBAAoB,GAAG,EAAE,CAAC;AAE1B,QAAA,iBAAiB,GAAG
|
|
1
|
+
{"version":3,"file":"cli-guidance.js","sourceRoot":"","sources":["../../../src/utils/skills/cli-guidance.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEU,QAAA,oBAAoB,GAAG,EAAE,CAAC;AAE1B,QAAA,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ieA6Cgc,CAAC;AAEle,wEAAwE;AAC3D,QAAA,wBAAwB,GACnC,yOAAyO,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* (project scope is where Cursor reads rules files from; the user-scope
|
|
5
5
|
* install writes the command allowlist instead).
|
|
6
6
|
*/
|
|
7
|
-
export declare const CURSOR_RULES_VERSION =
|
|
7
|
+
export declare const CURSOR_RULES_VERSION = 47;
|
|
8
8
|
export declare const CURSOR_RULES_FILENAME = "rivet.mdc";
|
|
9
|
-
export declare const CURSOR_RULES_CONTENT = "---\ndescription: Rivet \u2014 explore multiple design directions for your web app (\"/rivet\", \"use rivet\", \"explore with rivet\", \"create variants of X\", \"show me options for X\", \"open rivet\", \"open the visual editor\"). Drive it with `rivet` CLI commands.\nalwaysApply: false\n---\n<!-- rivet-rules-version: 46 -->\n<!-- rivet-cli-guidance-version: 14 -->\n# Rivet\n\nRivet helps you **explore multiple design directions** for a web app. You drive it by running `rivet` CLI commands. Every command prints exactly one JSON envelope on stdout (`{ schemaVersion, ok, command, data | error }`), routes progress to stderr, and never prompts for input.\n\n**Exit codes:** 0 ok \u00B7 1 operation failed (see `error.code`) \u00B7 2 usage error \u00B7 3 auth required \u00B7 4 no server for the project \u00B7 5 `rivet wait` timeout (work still pending or running \u2014 not a failure; the envelope's `state` says which).\n\n**Identify yourself (handoff).** Add these flags to every invocation so Rivet can attribute work: `--caller-agent claude|codex|cursor`, `--caller-model <your model>`, and `--caller-session <your chat session id>` when you have one. Human-direct invocations omit handoff flags. Never wrap or chain `rivet` with other commands (`&&`, pipes) \u2014 plain invocations are what the host allowlist covers.\n\n**Project path.** Prefer explicit `--project <absolute path>` on every command so follow-up chats attach to the same workspace. For an existing app, pass its repo/app root. For a fresh app, create or use an empty directory first, then open Rivet there and start variants with `--fresh`.\n\n**Browser behavior.** For interactive user workflows, run `rivet open` without `--no-browser` so the Rivet UI opens in the browser. Use `--no-browser` only for headless/background automation, CI/e2e checks, or when the user explicitly asks not to open a browser; in those cases, report the returned `editorUrl`.\n\n**MCP tools (opt-in).** If this host has Rivet MCP tools registered (`rivet_status`, `rivet_variants`, `rivet_design_context` \u2014 the user opted in via `rivet install --mcp`), prefer them over shelling out for status, variants, and design-context work: they drive the same control plane and return the same JSON envelopes, without per-call process cost. Lifecycle and auth stay CLI-only on purpose \u2014 `rivet open`, `rivet stop`, `rivet wait`, and `rivet login` have no MCP tools. There is no blocking/watch tool either: start work with `rivet_variants`; if the result contains `nextAction.action=\"complete_host_variant_work\"`, execute it yourself with parallel subagents when available.\n\n## Commands\n\n- `rivet open [--project <path>] [--agent claude|codex|cursor] [--rivet-port N] [--user-port N] [--framework nextjs|vite|cra|remix|svelte|static] [--entry <path>] [--no-browser] [--no-git]` \u2014 start or attach the project's editor server (idempotent; returns `editorUrl`). It detects the app, attaches to an already-running dev server, or starts one from the app's standard `dev`/`start`/`serve` script when possible. Omit `--no-browser` for interactive work so the UI opens for the user.\n- `rivet variants start --project <path> --instruction <text> [--briefs <json>] [--count N] [--element <selector>] [--fresh] [--target <sessionId>:<variantId>]` \u2014 explore design directions. Agent invocations MUST pass one AI-authored brief per direction; `briefs.length` sets the count. Use `--fresh` for prompt-only 0-to-1 generation in a blank/new workspace; use `--target` to Vary an existing direction. Returns a `workId` immediately, plus `nextAction` when the host agent should implement the variants.\n- `rivet variants complete <workId> --project <path> [--session <sessionId>] [--status succeeded|failed|cancelled] [--output <json>] [--error <message>]` \u2014 report one host-agent work item complete after you edit its worktree.\n- `rivet wait <workId> --project <path> [--timeout <seconds>]` \u2014 bounded block until a work id settles (exit 5 on timeout; re-issue or check status).\n- `rivet status --project <path> [--watch]` \u2014 session, resolved runner, active run, and the variants snapshot. `--watch` streams NDJSON.\n- `rivet variants status --project <path>` / `rivet variants list --project <path> [--history]` \u2014 inspect live or past directions.\n- `rivet variants commit <variantId> --project <path> [--session <id>]` \u2014 send the chosen direction to the project.\n- `rivet variants cancel <sessionId> --project <path>` \u2014 cancel a running variants session.\n- `rivet evidence capture --url <url>` \u2014 rendered design evidence (root variables, element styles, fonts) for a reference URL.\n- `rivet reference fetch <url>` \u2014 Pinterest / Are.na reference data via the user's connected account.\n- `rivet auth status` \u2014 signed-in state. If `authenticated: false`, tell the user to run `rivet login` themselves \u2014 never run login for them.\n- `rivet stop [--project <path>]` \u2014 stop the CLI-owned server.\n\n## Typical flows\n\nBefore every agent-initiated variants start, author one or more direction briefs as `[{\"label\":\"\u2026\",\"body\":\"\u2026\"}]`. Each `label` is an AI-authored direction title: 1\u20135 plain-English words naming what that direction concretely changes, not a vibe or numbered placeholder. Each `body` is a concise plain-English subtitle of at most 10 words describing that direction. Use one brief for a single visualization when the user wants Rivet's visualization framework without divergent ideas. For multiple directions, make every brief meaningfully different. Pass the array through the `rivet_variants` `briefs` field or CLI `--briefs <json>`, and omit `--count` because the array length is authoritative. Human-direct CLI calls may omit briefs and use Rivet's deterministic fallback.\n\nExisting app:\n1. `rivet open --project <path> --caller-agent cursor --caller-model <model> --caller-session <id>` \u2192 note `editorUrl`, `sessionId`, and `resolvedRunner`.\n2. Author three distinct title/subtitle briefs, then call `rivet variants start --project <path> --instruction \"try three hero layouts\" --briefs '[{\"label\":\"Split hero\",\"body\":\"Moves supporting proof beside the primary call to action.\"},{\"label\":\"Layered hero\",\"body\":\"Stacks product imagery behind a compact centered headline.\"},{\"label\":\"Product-led hero\",\"body\":\"Lets the product preview dominate the opening composition.\"}]' --caller-agent cursor --caller-model <model> --caller-session <id>` \u2192 note `workId`.\n3. If the start response has `nextAction.action=\"complete_host_variant_work\"`, execute it immediately. Otherwise poll `rivet status --project <path>` until that `nextAction` appears. The work items are independent: when your host supports subagents or parallel tasks, spawn one worker per item, each editing only its own `worktreePath` according to `briefLabel`, `briefBody`, target, and project context. Follow the item's `outputSchema`.\n4. As each worker finishes, run `rivet variants complete <workId> --project <path> --session <sessionId> --output '{\"worktreePath\":\"<worktreePath>\",\"changedFiles\":[\"relative/path\"]}'`. If a worker cannot complete it, use `--status failed --error <message>`.\n5. Show the user the `editorUrl` to compare directions; `rivet variants commit <variantId> --project <path>` when they pick one.\n\nFresh 0-to-1: create or use an empty directory, run `rivet open --project <path> ...`, author distinct briefs, then run `rivet variants start --project <path> --fresh --instruction \"build a SaaS landing page\" --briefs '<json>' ...`.\n\nVary an existing direction: after status/list gives you `sessionId` and `variantId`, author distinct briefs, then run `rivet variants start --project <path> --target <sessionId>:<variantId> --instruction \"make this calmer\" --briefs '<json>' ...`.\n\nRivet owns orchestration; the host agent owns implementation. Do not wait for Rivet to spawn a separate agent. When `rivet variants start`, `rivet status`, `rivet_variants`, or `rivet_status` returns `nextAction.action=\"complete_host_variant_work\"`, complete those work items from the current host session. Prefer parallelism: use one subagent or parallel task per work item when the host supports it, because each item has an isolated worktree. Report each item with `rivet variants complete` or `rivet_variants` action `complete`.\n\n**Never cancel to unblock.** If `variants start` is rejected with `start_in_flight`, a start is still provisioning (status reports `variants.starting: true` \u2014 can take minutes); poll status and retry once it clears. If rejected with `active_session`, the user has live work: report the conflict and let them decide, or refine the active session with `--target`. Cancelling a session destroys the user's in-progress exploration \u2014 only do it when the user explicitly asks.\n";
|
|
9
|
+
export declare const CURSOR_RULES_CONTENT = "---\ndescription: Rivet \u2014 explore multiple design directions for your web app (\"/rivet\", \"use rivet\", \"explore with rivet\", \"create variants of X\", \"show me options for X\", \"open rivet\", \"open the visual editor\"). Drive it with `rivet` CLI commands.\nalwaysApply: false\n---\n<!-- rivet-rules-version: 47 -->\n<!-- rivet-cli-guidance-version: 20 -->\n# Rivet\n\nRivet helps you **explore multiple design directions** for a web app. You drive it by running `rivet` CLI commands. Every command prints exactly one JSON envelope on stdout (`{ schemaVersion, ok, command, data | error }`), routes progress to stderr, and never prompts for input.\n\n**Exit codes:** 0 ok \u00B7 1 operation failed (see `error.code`) \u00B7 2 usage error \u00B7 3 auth required \u00B7 4 no server for the project \u00B7 5 `rivet wait` timeout (work still pending or running \u2014 not a failure; the envelope's `state` says which).\n\n**Identify yourself (handoff).** Add these flags to every invocation so Rivet can attribute work: `--caller-agent claude|codex|cursor`, `--caller-model <your model>`, and `--caller-session <your chat session id>` when you have one. Human-direct invocations omit handoff flags. Never wrap or chain `rivet` with other commands (`&&`, pipes) \u2014 plain invocations are what the host allowlist covers.\n\n**Project path.** Prefer explicit `--project <absolute path>` on every command so follow-up chats attach to the same workspace. For an existing app, pass its repo/app root. For a fresh app, create or use an empty directory first, then open Rivet there and start variants with `--fresh`.\n\n**Browser behavior.** For interactive user workflows, run `rivet open` without `--no-browser` so the Rivet UI opens in the browser. Use `--no-browser` only for headless/background automation, CI/e2e checks, or when the user explicitly asks not to open a browser; in those cases, report the returned `editorUrl`.\n\n**MCP tools (opt-in).** If this host has Rivet MCP tools registered (`rivet_status`, `rivet_variants`, `rivet_design_context` \u2014 the user opted in via `rivet install --mcp`), prefer them over shelling out for status, variants, and design-context work: they drive the same control plane and return the same JSON envelopes, without per-call process cost. Lifecycle and auth stay CLI-only on purpose \u2014 `rivet open`, `rivet stop`, `rivet wait`, and `rivet login` have no MCP tools. There is no blocking/watch tool either: start work with `rivet_variants`; if the result contains `nextAction.action=\"complete_host_variant_work\"`, execute it yourself with parallel subagents when available.\n\n## Commands\n\n- `rivet open [--project <path>] [--agent claude|codex|cursor] [--rivet-port N] [--user-port N] [--framework nextjs|vite|cra|remix|svelte|static] [--entry <path>] [--no-browser] [--no-git]` \u2014 start or attach the project's editor server (idempotent; returns `editorUrl`). It detects the app, attaches to an already-running dev server, or starts one from the app's standard `dev`/`start`/`serve` script when possible. Omit `--no-browser` for interactive work so the UI opens for the user.\n- `rivet variants start --project <path> --instruction <text> [--run-label <text>] [--briefs <json>] [--count N] [--element <selector>] [--files <json>] [--fresh] [--target <sessionId>:<variantId>]` \u2014 explore design directions. Agent invocations MUST pass an AI-authored 1\u20133 word batch label through `rivet_variants` `runLabel` or CLI `--run-label`, plus one AI-authored brief per direction; `briefs.length` sets the count. Use `--files` for already-known project paths, `--fresh` for prompt-only 0-to-1 generation in a blank/new workspace, and `--target` to Vary an existing direction. Returns a `workId` and `nextAction` after workspace provisioning.\n- `rivet variants complete <workId> --project <path> [--session <sessionId>] [--status succeeded|failed|cancelled] [--output <json>] [--error <message>]` \u2014 report one host-agent work item complete after you edit its assigned workspace. Static artifacts are read from disk; do not send them through `--output`.\n- `rivet wait <workId> --project <path> [--timeout <seconds>]` \u2014 bounded block until a work id settles (exit 5 on timeout; re-issue or check status).\n- `rivet status --project <path> [--watch]` \u2014 session, resolved runner, active run, and the variants snapshot. `--watch` streams NDJSON.\n- `rivet variants status --project <path>` / `rivet variants list --project <path> [--history]` \u2014 inspect live or past directions.\n- `rivet variants get <sessionId>:<variantId> --project <path>` \u2014 retrieve one exact variant, including its local artifact path or diff, from a reference copied by the editor.\n- `rivet variants commit <variantId> --project <path> [--session <id>]` \u2014 send the chosen direction to the project.\n- `rivet variants cancel <sessionId> --project <path>` \u2014 cancel a running variants session.\n- `rivet evidence capture --url <url>` \u2014 rendered design evidence (root variables, element styles, fonts) for a reference URL.\n- `rivet reference fetch <url>` \u2014 Pinterest / Are.na reference data via the user's connected account.\n- `rivet auth status` \u2014 signed-in state. If `authenticated: false`, tell the user to run `rivet login` themselves \u2014 never run login for them.\n- `rivet stop [--project <path>]` \u2014 stop the CLI-owned server.\n\n## Typical flows\n\nBefore every agent-initiated variants start, author a 1\u20133 word batch label plus one or more direction briefs as `[{\"label\":\"\u2026\",\"body\":\"\u2026\"}]`. The batch label summarizes the shared request and is passed through `runLabel` (MCP) or `--run-label` (CLI). Each brief `label` is an AI-authored direction title: 1\u20135 plain-English words naming what that direction concretely changes, not a vibe or numbered placeholder. Each `body` is a concise plain-English subtitle of at most 10 words describing that direction. Add an optional `notes` string per brief for richer implementation intent (design tokens, motion specs, constraints) \u2014 it is delivered verbatim to that direction's worker and never shown in UI chips. Use one brief for a single visualization when the user wants Rivet's visualization framework without divergent ideas. For multiple directions, make every brief meaningfully different. Pass the array through the `rivet_variants` `briefs` field or CLI `--briefs <json>`, and omit `--count` because the array length is authoritative. Human-direct CLI calls may omit the batch label and briefs and use Rivet's deterministic fallback.\n\nExisting app:\n1. `rivet open --project <path> --caller-agent cursor --caller-model <model> --caller-session <id>` \u2192 note `editorUrl`, `sessionId`, and `resolvedRunner`.\n2. Author a batch label and three distinct title/subtitle briefs, then call `rivet variants start --project <path> --instruction \"try three hero layouts\" --run-label \"Hero layouts\" --briefs '[{\"label\":\"Split hero\",\"body\":\"Moves supporting proof beside the primary call to action.\"},{\"label\":\"Layered hero\",\"body\":\"Stacks product imagery behind a compact centered headline.\"},{\"label\":\"Product-led hero\",\"body\":\"Lets the product preview dominate the opening composition.\"}]' --caller-agent cursor --caller-model <model> --caller-session <id>` \u2192 note `workId`.\n3. If the start response has `nextAction.action=\"complete_host_variant_work\"`, execute it immediately. Otherwise poll `rivet status --project <path>` until that `nextAction` appears. Each work item carries a server-authored `workerPrompt` pointing at its briefing file \u2014 the full packet (direction, mode contract, boundaries, completion command). Follow `nextAction.parallelism` exactly: one item \u2192 follow its `workerPrompt` yourself in the current host; multiple items \u2192 spawn every worker in that same turn as background subagents, passing each item's `workerPrompt` VERBATIM as the entire worker prompt \u2014 compose nothing, and never re-plan or elaborate briefs before spawning. When `nextAction.worker.agentType` is set (Claude Code: `rivet-worker`, installed by `rivet install` with tuned model/effort defaults), spawn each worker AS that subagent type; fall back to your default subagent type only if it is not registered. For `mode=\"vary\"` the workspace entry already contains the source direction's finished code: read it first, apply the requested delta with targeted `Edit` operations in place, and never rewrite or re-emit the full file \u2014 unchanged sections must remain untouched. For `workspace.kind=\"artifact_directory\"` the deliverable is `workspace.rootPath/workspace.entryPath` (write it in full only when it starts empty, i.e. `mode=\"create\"`); for `workspace.kind=\"git_worktree\"`, edit the app under `workspace.projectPath`.\n4. The briefing file ends with the item's exact `completeCommand`: the worker runs `rivet variants complete <workId> --project <path> --session <sessionId>` itself as its final step, the moment its workspace is done. Completions are never held back or batched by the coordinator \u2014 and because workers self-report, the coordinator does NOT poll status while workers run: check `rivet status` once after workers return (or on a single \u226560s wakeup), only to confirm terminal states and surface failures. Rivet reads static HTML from `workspace.entryPath` and captures git-worktree changes itself. Do not send inline HTML or repeat project context in the completion payload. If the result says `requeuedForRegeneration`, poll status for the renewed lease, address its QA summary, and complete that item once more. If a worker cannot complete it, use `--status failed --error <message>`.\n5. Show the user the `editorUrl` to compare directions; `rivet variants commit <variantId> --project <path>` when they pick one.\n\nFresh 0-to-1: create or use an empty directory, run `rivet open --project <path> ...`, author a batch label and distinct briefs, then run `rivet variants start --project <path> --fresh --instruction \"build a SaaS landing page\" --run-label \"SaaS landing\" --briefs '<json>' ...`.\n\nVary an existing direction: after status/list gives you `sessionId` and `variantId`, author a batch label and two distinct delta briefs by default, then run `rivet variants start --project <path> --target <sessionId>:<variantId> --instruction \"make this calmer\" --run-label \"Calmer direction\" --briefs '<json>' ...`. Include `--files '[\"src/known-target.tsx\"]'` when the relevant files are already known. Explicit briefs/counts remain authoritative.\n\nRivet owns orchestration; the host agent owns implementation. Do not wait for Rivet to spawn a separate agent. When `rivet variants start`, `rivet status`, `rivet_variants`, or `rivet_status` returns `nextAction.action=\"complete_host_variant_work\"`, complete those work items from the current host session. Avoid subagent startup for one item. For multiple items, spawn one background worker per isolated workspace in the same turn, and have each worker report its own completion immediately via its `completeCommand` (or `rivet_variants` action `complete`) \u2014 a variant's completion must never wait for its siblings.\n\n**Never cancel to unblock.** If `variants start` is rejected with `start_in_flight`, a start is still provisioning (status reports `variants.starting: true` \u2014 can take minutes); poll status and retry once it clears. If rejected with `active_session`, the user has live work: report the conflict and let them decide, or refine the active session with `--target`. Cancelling a session destroys the user's in-progress exploration \u2014 only do it when the user explicitly asks.\n";
|
|
10
10
|
//# 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":"AAMA;;;;;GAKG;AAEH,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,qBAAqB,cAAc,CAAC;AAGjD,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"cursor-rules.d.ts","sourceRoot":"","sources":["../../../src/utils/skills/cursor-rules.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AAEH,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,qBAAqB,cAAc,CAAC;AAGjD,eAAO,MAAM,oBAAoB,u+WAShC,CAAC"}
|
|
@@ -8,7 +8,7 @@ const cli_guidance_1 = require("./cli-guidance");
|
|
|
8
8
|
* (project scope is where Cursor reads rules files from; the user-scope
|
|
9
9
|
* install writes the command allowlist instead).
|
|
10
10
|
*/
|
|
11
|
-
exports.CURSOR_RULES_VERSION =
|
|
11
|
+
exports.CURSOR_RULES_VERSION = 47;
|
|
12
12
|
exports.CURSOR_RULES_FILENAME = 'rivet.mdc';
|
|
13
13
|
const CURSOR_RULES_VERSION_MARKER = `rivet-rules-version: ${exports.CURSOR_RULES_VERSION}`;
|
|
14
14
|
exports.CURSOR_RULES_CONTENT = `---
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rivet-design",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.5",
|
|
4
4
|
"description": "Local visual web development tool with AI-powered code modification",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"workspaces": [
|
|
@@ -46,6 +46,8 @@
|
|
|
46
46
|
"bench:review": "node --import tsx benchmarks/review/server.ts",
|
|
47
47
|
"bench:review:hosted": "BENCH_REVIEW_HOSTED=true BENCH_REVIEW_OPEN=false node --import tsx benchmarks/review/server.ts --hosted",
|
|
48
48
|
"bench:list": "node --import tsx benchmarks/list.ts",
|
|
49
|
+
"bench:test": "node --import tsx --test benchmarks/*.test.ts benchmarks/agents/*.test.ts benchmarks/agents/prompts/*.test.ts benchmarks/review/*.test.ts",
|
|
50
|
+
"bench:typecheck": "tsc -p benchmarks/tsconfig.json",
|
|
49
51
|
"smoke:cli": "node scripts/smoke-cli.mjs",
|
|
50
52
|
"perf:cli": "node scripts/bench-cli.mjs",
|
|
51
53
|
"check:pre-commit": "npx lint-staged && yarn build && cd src/ui && yarn typecheck && cd ../.. && cd src/proxy && yarn build && cd ../.. && cd desktop/renderer && yarn build && cd ../..",
|