rivet-design 0.9.9 → 0.10.0
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/config/proxy.d.ts +1 -0
- package/dist/config/proxy.d.ts.map +1 -1
- package/dist/config/proxy.js +9 -1
- package/dist/config/proxy.js.map +1 -1
- package/dist/demo/sessionRuntime.js +1 -1
- package/dist/demo/sessionRuntime.js.map +1 -1
- package/dist/hosted-demo.js +4 -1
- package/dist/hosted-demo.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/agent-variants/contracts.d.ts +50 -49
- package/dist/mcp/agent-variants/contracts.d.ts.map +1 -1
- package/dist/mcp/agent-variants/contracts.js.map +1 -1
- package/dist/mcp/agent-variants/createZeroToOneTool.d.ts +4 -4
- package/dist/mcp/agent-variants/createZeroToOneTool.js +1 -1
- package/dist/mcp/agent-variants/createZeroToOneTool.js.map +1 -1
- package/dist/mcp/agent-variants/tools.d.ts.map +1 -1
- package/dist/mcp/agent-variants/tools.js +36 -14
- package/dist/mcp/agent-variants/tools.js.map +1 -1
- package/dist/mcp/auth/tools.d.ts +36 -0
- package/dist/mcp/auth/tools.d.ts.map +1 -0
- package/dist/mcp/auth/tools.js +164 -0
- package/dist/mcp/auth/tools.js.map +1 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +23 -9
- package/dist/mcp/server.js.map +1 -1
- package/dist/prototype-host.d.ts +2 -0
- package/dist/prototype-host.d.ts.map +1 -0
- package/dist/prototype-host.js +56 -0
- package/dist/prototype-host.js.map +1 -0
- package/dist/routes/agentVariants.d.ts +2 -1
- package/dist/routes/agentVariants.d.ts.map +1 -1
- package/dist/routes/agentVariants.js +104 -1
- package/dist/routes/agentVariants.js.map +1 -1
- package/dist/routes/prototypeHost.d.ts +13 -0
- package/dist/routes/prototypeHost.d.ts.map +1 -0
- package/dist/routes/prototypeHost.js +207 -0
- package/dist/routes/prototypeHost.js.map +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +8 -2
- package/dist/server.js.map +1 -1
- package/dist/services/AuthService.d.ts +27 -1
- package/dist/services/AuthService.d.ts.map +1 -1
- package/dist/services/AuthService.js +302 -8
- package/dist/services/AuthService.js.map +1 -1
- package/dist/services/BundleStore.d.ts +36 -0
- package/dist/services/BundleStore.d.ts.map +1 -0
- package/dist/services/BundleStore.js +102 -0
- package/dist/services/BundleStore.js.map +1 -0
- package/dist/services/ConfigManager.d.ts +20 -2
- package/dist/services/ConfigManager.d.ts.map +1 -1
- package/dist/services/ConfigManager.js +46 -2
- package/dist/services/ConfigManager.js.map +1 -1
- package/dist/services/HostedDemoAuthSessionService.d.ts +2 -0
- package/dist/services/HostedDemoAuthSessionService.d.ts.map +1 -1
- package/dist/services/HostedDemoAuthSessionService.js.map +1 -1
- package/dist/services/HostedDemoAuthSessionStore.d.ts +1 -0
- package/dist/services/HostedDemoAuthSessionStore.d.ts.map +1 -1
- package/dist/services/HostedDemoAuthSessionStore.js.map +1 -1
- package/dist/services/PrototypeBuildService.d.ts +38 -0
- package/dist/services/PrototypeBuildService.d.ts.map +1 -0
- package/dist/services/PrototypeBuildService.js +165 -0
- package/dist/services/PrototypeBuildService.js.map +1 -0
- package/dist/services/PrototypeDeployService.d.ts +34 -0
- package/dist/services/PrototypeDeployService.d.ts.map +1 -0
- package/dist/services/PrototypeDeployService.js +115 -0
- package/dist/services/PrototypeDeployService.js.map +1 -0
- package/dist/services/RequestAuthContext.d.ts +1 -0
- package/dist/services/RequestAuthContext.d.ts.map +1 -1
- package/dist/services/RequestAuthContext.js.map +1 -1
- package/dist/services/SupabaseAuthService.d.ts +25 -0
- package/dist/services/SupabaseAuthService.d.ts.map +1 -0
- package/dist/services/SupabaseAuthService.js +56 -0
- package/dist/services/SupabaseAuthService.js.map +1 -0
- package/dist/services/TelemetryService.d.ts +26 -8
- package/dist/services/TelemetryService.d.ts.map +1 -1
- package/dist/services/TelemetryService.js +42 -20
- package/dist/services/TelemetryService.js.map +1 -1
- package/dist/services/VariantHistoryService.d.ts +23 -0
- package/dist/services/VariantHistoryService.d.ts.map +1 -1
- package/dist/services/VariantHistoryService.js +37 -1
- package/dist/services/VariantHistoryService.js.map +1 -1
- package/dist/services/accessTokenRefresh.d.ts +6 -0
- package/dist/services/accessTokenRefresh.d.ts.map +1 -1
- package/dist/services/accessTokenRefresh.js +27 -1
- package/dist/services/accessTokenRefresh.js.map +1 -1
- package/dist/utils/skills/claude-skill.js +1 -1
- package/dist/utils/skills/cursor-rules.js +1 -1
- package/dist/utils/skills/shared-variants-protocol.js +5 -5
- package/package.json +3 -2
- package/src/ui/dist/assets/{main-DXMHtjqM.js → main-CIJUZXe8.js} +120 -120
- package/src/ui/dist/index.html +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resetHostedDemoTokenRefreshSingleFlightForTests = exports.runHostedDemoTokenRefreshSingleFlight = exports.refreshAccessTokenViaProxy = exports.shouldProactivelyRefreshAccessToken = exports.getJwtSecondsUntilExpiry = exports.ACCESS_TOKEN_PROACTIVE_REFRESH_THRESHOLD_SECONDS = void 0;
|
|
3
|
+
exports.resetHostedDemoTokenRefreshSingleFlightForTests = exports.runHostedDemoTokenRefreshSingleFlight = exports.refreshAccessTokenViaProxy = exports.shouldProactivelyRefreshAccessToken = exports.getJwtSub = exports.getJwtSecondsUntilExpiry = exports.ACCESS_TOKEN_PROACTIVE_REFRESH_THRESHOLD_SECONDS = void 0;
|
|
4
4
|
const logger_1 = require("../utils/logger");
|
|
5
5
|
const log = (0, logger_1.createLogger)('AccessTokenRefresh');
|
|
6
6
|
/**
|
|
@@ -34,6 +34,32 @@ const getJwtSecondsUntilExpiry = (accessToken) => {
|
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
exports.getJwtSecondsUntilExpiry = getJwtSecondsUntilExpiry;
|
|
37
|
+
/**
|
|
38
|
+
* Returns the JWT `sub` claim (Supabase user id), or null when the token cannot
|
|
39
|
+
* be decoded. No signature verification — callers use this only to recover the
|
|
40
|
+
* canonical user id from a token we already trust locally.
|
|
41
|
+
*/
|
|
42
|
+
const getJwtSub = (accessToken) => {
|
|
43
|
+
if (!accessToken) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
const segment = accessToken.split('.')[1];
|
|
48
|
+
if (!segment) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
const normalized = segment.replace(/-/g, '+').replace(/_/g, '/');
|
|
52
|
+
const padded = normalized.padEnd(Math.ceil(normalized.length / 4) * 4, '=');
|
|
53
|
+
const decoded = JSON.parse(Buffer.from(padded, 'base64').toString('utf8'));
|
|
54
|
+
return typeof decoded.sub === 'string' && decoded.sub.length > 0
|
|
55
|
+
? decoded.sub
|
|
56
|
+
: null;
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
exports.getJwtSub = getJwtSub;
|
|
37
63
|
/**
|
|
38
64
|
* Returns true when the access token should be refreshed before use (expired, unreadable, or within threshold).
|
|
39
65
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accessTokenRefresh.js","sourceRoot":"","sources":["../../src/services/accessTokenRefresh.ts"],"names":[],"mappings":";;;AAAA,4CAA+C;AAE/C,MAAM,GAAG,GAAG,IAAA,qBAAY,EAAC,oBAAoB,CAAC,CAAC;AAE/C;;;GAGG;AACU,QAAA,gDAAgD,GAAG,GAAG,CAAC;AAEpE;;GAEG;AACI,MAAM,wBAAwB,GAAG,CAAC,WAAmB,EAAiB,EAAE;IAC7E,IAAI,CAAC,WAAW,EAAE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,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAClD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAbW,QAAA,qCAAqC,yCAahD;AAEF,+DAA+D;AACxD,MAAM,+CAA+C,GAAG,GAAS,EAAE;IACxE,yBAAyB,CAAC,KAAK,EAAE,CAAC;AACpC,CAAC,CAAC;AAFW,QAAA,+CAA+C,mDAE1D"}
|
|
@@ -8,7 +8,7 @@ exports.CLAUDE_SKILL_DIR = 'rivet';
|
|
|
8
8
|
exports.CLAUDE_SKILL_FILENAME = 'SKILL.md';
|
|
9
9
|
const AGENT_VARIANTS_SECTION = (0, shared_variants_protocol_1.buildAgentVariantsSection)({
|
|
10
10
|
inChatEmphasis: 'IN THIS CHAT',
|
|
11
|
-
step9: `**Run all
|
|
11
|
+
step9: `**Run all code-gen items IN PARALLEL.** Spawn one \`Task\` tool call per work 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
12
|
- Reads \`input.briefBody\` and \`input.target\`
|
|
13
13
|
- Edits files in \`input.worktreePath\` (each variant has its own isolated worktree)
|
|
14
14
|
- Calls \`report_variant_complete({ sessionId, workItemId, leaseId, attempt, status: 'succeeded' })\` itself. On failure, status \`'failed'\` with error description.`,
|
|
@@ -7,7 +7,7 @@ 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)({
|
|
9
9
|
inChatEmphasis: 'in chat',
|
|
10
|
-
step9: `**Run all
|
|
10
|
+
step9: `**Run all code-gen items IN PARALLEL** via parallel tool calls in a single response. For each:
|
|
11
11
|
- Read \`input.briefBody\` and \`input.target\`
|
|
12
12
|
- Edit files in \`input.worktreePath\` (each variant has its own isolated worktree)
|
|
13
13
|
- Call \`report_variant_complete({ sessionId, workItemId, leaseId, attempt, status: 'succeeded' })\`. On failure, status \`'failed'\` with error description.`,
|
|
@@ -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
|
|
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 \`detect_project\`, \`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
|
|
|
@@ -73,7 +73,7 @@ There are three sub-flows. Pick by project state:
|
|
|
73
73
|
|
|
74
74
|
### Sub-flow B: Fresh project (prompt-only) — use \`start_variants({ mode: 'zero_to_one' })\`
|
|
75
75
|
|
|
76
|
-
For brand-new projects the user describes from scratch ("build me a Vite todo app", "make a Pomodoro timer", "scaffold a kanban board"), use the same single-call kickoff. The server derives the destination directory, opens the editor on it,
|
|
76
|
+
For brand-new projects the user describes from scratch ("build me a Vite todo app", "make a Pomodoro timer", "scaffold a kanban board"), use the same single-call kickoff. The server derives the destination directory, opens the editor on it, starts all variants, and returns everything in one response. No in-chat approval gate.
|
|
77
77
|
|
|
78
78
|
1. **Call \`start_variants\`** with:
|
|
79
79
|
- \`prompt\`: the user's request verbatim
|
|
@@ -92,7 +92,7 @@ For brand-new projects the user describes from scratch ("build me a Vite todo ap
|
|
|
92
92
|
|
|
93
93
|
**Trigger:** the user provided inspiration URLs ("like stripe.com"), attached an image in chat (pasted screenshot/mockup), attached a video/gif/screen recording ("match this animation", "build the hover from this clip"), referenced an image or video file path (e.g. \`~/Desktop/mockup.png\`, \`~/Desktop/hover.mov\`), or supplied written design context. Image-only and video-only requests with no URLs are valid and belong in this sub-flow — do not fall back to Sub-flow B.
|
|
94
94
|
|
|
95
|
-
Use \`create_zero_to_one_project\` for this sub-flow. \`start_variants({ mode: 'zero_to_one' })\` rejects any request whose \`sourceContext\` carries \`sourceUrls\`, \`sourceArtifacts\`, or \`sourceIntent\` — that handler is prompt-only (Sub-flow B). The source-research
|
|
95
|
+
Use \`create_zero_to_one_project\` for this sub-flow. \`start_variants({ mode: 'zero_to_one' })\` rejects any request whose \`sourceContext\` carries \`sourceUrls\`, \`sourceArtifacts\`, or \`sourceIntent\` — that handler is prompt-only (Sub-flow B). The source-research hop is only wired into \`create_zero_to_one_project\`.
|
|
96
96
|
|
|
97
97
|
1. **Call \`create_zero_to_one_project\`** with:
|
|
98
98
|
- \`prompt\`: the user's request verbatim
|
|
@@ -112,7 +112,7 @@ Use \`create_zero_to_one_project\` for this sub-flow. \`start_variants({ mode: '
|
|
|
112
112
|
|
|
113
113
|
3. **Call \`report_source_plan\`** with \`{ sessionId, workItemId, leaseId, attempt, sourcePlan }\`. Response: \`{ stage: 'awaiting_briefs', briefWorkItem, executionPlan, nextAction: 'report_variant_briefs' }\`.
|
|
114
114
|
|
|
115
|
-
4. **
|
|
115
|
+
4. **Report briefs and start generating — no approval gate.** Call \`report_variant_briefs\` with N briefs; the server starts every direction immediately and returns \`stage: 'work_items_ready'\`. Do NOT pause to ask the user to approve the briefs first. Then call \`continue_variants({ action: 'request_work' })\` and follow Sub-flow A steps 2-5. Work items are \`static_preview\` or \`code_gen\` depending on \`executionPlan.mode\`. On commit, the apply payload is \`payload.kind === 'project-created'\` — the server materialized the chosen variant to \`destinationPath\`.
|
|
116
116
|
|
|
117
117
|
---
|
|
118
118
|
|
|
@@ -126,7 +126,7 @@ ${describe_motion_protocol_1.DESCRIBE_MOTION_PROTOCOL}
|
|
|
126
126
|
- Always pass the user's prompt verbatim — don't paraphrase.
|
|
127
127
|
- Prefer \`start_variants\` (with the matching \`mode\`) over the older \`propose_variants\` → \`report_variant_briefs\` → \`approve_variant_briefs\` chain. The unified call also handles \`detect_project\`, \`open_visual_editor\`, and \`continue_variants(request_work)\` server-side. The older tools and standalone \`detect_project\` / \`open_visual_editor\` stay registered for the Visual Editor flow (point-and-click changes without variants).
|
|
128
128
|
- For source-grounded fresh projects, run \`extract_inspiration_context\` FIRST and forward its output into \`start_variants\` — don't try to pack inspiration URLs into \`start_variants\` directly without extraction.
|
|
129
|
-
- Briefs
|
|
129
|
+
- 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.
|
|
130
130
|
- The user picks AFTER seeing the variants render LIVE in the iframe, not before. Hand off to the iframe chip for visual cycling + commit.
|
|
131
131
|
- 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.
|
|
132
132
|
- Parallel code-gen is the only step where you fan out — every other step is one tool call.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rivet-design",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Local visual web development tool with AI-powered code modification",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"workspaces": [
|
|
@@ -44,7 +44,8 @@
|
|
|
44
44
|
"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 ../..",
|
|
45
45
|
"check:pre-push": "yarn test",
|
|
46
46
|
"desktop": "yarn build && cd desktop && yarn dev",
|
|
47
|
-
"start:hosted-demo": "node dist/hosted-demo.js"
|
|
47
|
+
"start:hosted-demo": "node dist/hosted-demo.js",
|
|
48
|
+
"start:prototype-host": "node dist/prototype-host.js"
|
|
48
49
|
},
|
|
49
50
|
"dependencies": {
|
|
50
51
|
"@anthropic-ai/claude-agent-sdk": "^0.1.42",
|