rivet-design 0.5.3 → 0.5.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.
@@ -0,0 +1,14 @@
1
+ export declare const SKILL_VERSION = 2;
2
+ export declare const SKILL_PATH: string;
3
+ export declare const SKILL_VERSION_MARKER = "[//]: # (rivet-skill-version: 2)";
4
+ export declare const SKILL_CONTENT = "[//]: # (rivet-skill-version: 2)\n# Rivet Visual Editor\n\nUse these tools to make visual changes to a running web app and apply them to source code.\n\n## Starting a session\n\n1. Call `detect_project` \u2014 returns `detectedPort` (the actual running port, may differ from `defaultPort`) and `portActive`\n2. If `portActive` is false, start the dev server in the background:\n ```bash\n cd {projectPath} && {packageManager} run {devCommand} &\n ```\n Then call `detect_project` again until `portActive` is true\n3. Call `open_visual_editor({ port: detectedPort })` \u2014 always pass `detectedPort`, never assume the default\n4. Tell the user: \"Rivet is open \u2014 make your visual changes and click 'Send to Claude Code' when ready.\"\n\n## Editing loop\n\n1. Call `watch_for_changes({ sessionId })` \u2014 blocks until the user clicks \"Send to Claude Code\" (up to 60s by default)\n2. If it times out (`hasChanges: false`), call it again to keep waiting\n3. When `hasChanges: true`, apply the changes to the source files listed in `sourceFiles`\n4. Hot reload happens automatically after file changes\n5. Tell the user what you changed, then loop back to step 1\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- Use `watch_for_changes` for interactive sessions, not `get_pending_changes`\n- `get_pending_changes` is a non-blocking immediate check \u2014 only use it to poll without blocking\n- The dev server stays running after `close_visual_editor`\n";
5
+ /**
6
+ * Write the companion Claude skill file.
7
+ * Idempotent — skips if the current version is already installed.
8
+ */
9
+ /**
10
+ * Returns true if the skill file is current or was successfully written,
11
+ * false if the write failed.
12
+ */
13
+ export declare function writeSkillFileIfNeeded(): boolean;
14
+ //# sourceMappingURL=skillWriter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skillWriter.d.ts","sourceRoot":"","sources":["../../src/utils/skillWriter.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,UAAU,QAAwD,CAAC;AAChF,eAAO,MAAM,oBAAoB,qCAAoD,CAAC;AAEtF,eAAO,MAAM,aAAa,+qDAmCzB,CAAC;AAEF;;;GAGG;AACH;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAqBhD"}
@@ -0,0 +1,82 @@
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.SKILL_CONTENT = exports.SKILL_VERSION_MARKER = exports.SKILL_PATH = exports.SKILL_VERSION = void 0;
7
+ exports.writeSkillFileIfNeeded = writeSkillFileIfNeeded;
8
+ const fs_1 = __importDefault(require("fs"));
9
+ const path_1 = __importDefault(require("path"));
10
+ const os_1 = __importDefault(require("os"));
11
+ const logger_1 = require("./logger");
12
+ const log = (0, logger_1.createLogger)('SkillWriter');
13
+ // Skill file version — increment when content changes
14
+ exports.SKILL_VERSION = 2;
15
+ exports.SKILL_PATH = path_1.default.join(os_1.default.homedir(), '.claude', 'skills', 'rivet');
16
+ exports.SKILL_VERSION_MARKER = `[//]: # (rivet-skill-version: ${exports.SKILL_VERSION})`;
17
+ exports.SKILL_CONTENT = `${exports.SKILL_VERSION_MARKER}
18
+ # Rivet Visual Editor
19
+
20
+ Use these tools to make visual changes to a running web app and apply them to source code.
21
+
22
+ ## Starting a session
23
+
24
+ 1. Call \`detect_project\` — returns \`detectedPort\` (the actual running port, may differ from \`defaultPort\`) and \`portActive\`
25
+ 2. If \`portActive\` is false, start the dev server in the background:
26
+ \`\`\`bash
27
+ cd {projectPath} && {packageManager} run {devCommand} &
28
+ \`\`\`
29
+ Then call \`detect_project\` again until \`portActive\` is true
30
+ 3. Call \`open_visual_editor({ port: detectedPort })\` — always pass \`detectedPort\`, never assume the default
31
+ 4. Tell the user: "Rivet is open — make your visual changes and click 'Send to Claude Code' when ready."
32
+
33
+ ## Editing loop
34
+
35
+ 1. Call \`watch_for_changes({ sessionId })\` — blocks until the user clicks "Send to Claude Code" (up to 60s by default)
36
+ 2. If it times out (\`hasChanges: false\`), call it again to keep waiting
37
+ 3. When \`hasChanges: true\`, apply the changes to the source files listed in \`sourceFiles\`
38
+ 4. Hot reload happens automatically after file changes
39
+ 5. Tell the user what you changed, then loop back to step 1
40
+
41
+ ## Ending a session
42
+
43
+ When the user says they're done, call \`close_visual_editor({ sessionId })\`.
44
+
45
+ ## Rules
46
+
47
+ - **Always call \`detect_project\` first** — never assume the dev server is running
48
+ - **Never auto-commit** after applying visual changes — let the user decide
49
+ - Use \`watch_for_changes\` for interactive sessions, not \`get_pending_changes\`
50
+ - \`get_pending_changes\` is a non-blocking immediate check — only use it to poll without blocking
51
+ - The dev server stays running after \`close_visual_editor\`
52
+ `;
53
+ /**
54
+ * Write the companion Claude skill file.
55
+ * Idempotent — skips if the current version is already installed.
56
+ */
57
+ /**
58
+ * Returns true if the skill file is current or was successfully written,
59
+ * false if the write failed.
60
+ */
61
+ function writeSkillFileIfNeeded() {
62
+ try {
63
+ const skillDir = path_1.default.dirname(exports.SKILL_PATH);
64
+ if (!fs_1.default.existsSync(skillDir)) {
65
+ fs_1.default.mkdirSync(skillDir, { recursive: true });
66
+ }
67
+ if (fs_1.default.existsSync(exports.SKILL_PATH)) {
68
+ const existing = fs_1.default.readFileSync(exports.SKILL_PATH, 'utf8');
69
+ if (existing.includes(exports.SKILL_VERSION_MARKER)) {
70
+ return true; // Already up to date
71
+ }
72
+ }
73
+ fs_1.default.writeFileSync(exports.SKILL_PATH, exports.SKILL_CONTENT, 'utf8');
74
+ log.info('Wrote Rivet Claude skill file');
75
+ return true;
76
+ }
77
+ catch (error) {
78
+ log.debug('Could not write skill file:', error);
79
+ return false;
80
+ }
81
+ }
82
+ //# sourceMappingURL=skillWriter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skillWriter.js","sourceRoot":"","sources":["../../src/utils/skillWriter.ts"],"names":[],"mappings":";;;;;;AAyDA,wDAqBC;AA9ED,4CAAoB;AACpB,gDAAwB;AACxB,4CAAoB;AACpB,qCAAwC;AAExC,MAAM,GAAG,GAAG,IAAA,qBAAY,EAAC,aAAa,CAAC,CAAC;AAExC,sDAAsD;AACzC,QAAA,aAAa,GAAG,CAAC,CAAC;AAClB,QAAA,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,YAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AACnE,QAAA,oBAAoB,GAAG,iCAAiC,qBAAa,GAAG,CAAC;AAEzE,QAAA,aAAa,GAAG,GAAG,4BAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCnD,CAAC;AAEF;;;GAGG;AACH;;;GAGG;AACH,SAAgB,sBAAsB;IACpC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,cAAI,CAAC,OAAO,CAAC,kBAAU,CAAC,CAAC;QAC1C,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC7B,YAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC9C,CAAC;QAED,IAAI,YAAE,CAAC,UAAU,CAAC,kBAAU,CAAC,EAAE,CAAC;YAC9B,MAAM,QAAQ,GAAG,YAAE,CAAC,YAAY,CAAC,kBAAU,EAAE,MAAM,CAAC,CAAC;YACrD,IAAI,QAAQ,CAAC,QAAQ,CAAC,4BAAoB,CAAC,EAAE,CAAC;gBAC5C,OAAO,IAAI,CAAC,CAAC,qBAAqB;YACpC,CAAC;QACH,CAAC;QAED,YAAE,CAAC,aAAa,CAAC,kBAAU,EAAE,qBAAa,EAAE,MAAM,CAAC,CAAC;QACpD,GAAG,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;QAC1C,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,GAAG,CAAC,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;QAChD,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rivet-design",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "description": "Local visual web development tool with AI-powered code modification",
5
5
  "main": "dist/index.js",
6
6
  "workspaces": [
@@ -112,7 +112,7 @@
112
112
  "lint-staged": "^16.1.6",
113
113
  "prettier": "^3.6.2",
114
114
  "prettier-plugin-tailwindcss": "^0.6.14",
115
- "supabase": "^2.47.2",
115
+ "supabase": "2.47.2",
116
116
  "supertest": "^7.1.4",
117
117
  "ts-jest": "^29.4.4",
118
118
  "ts-node": "^10.9.2"