rivet-design 0.5.7 → 0.5.9
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/index.d.ts.map +1 -1
- package/dist/index.js +219 -18
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -5
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +20 -6
- package/dist/mcp/server.js.map +1 -1
- package/dist/server.d.ts +2 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +12 -1
- package/dist/server.js.map +1 -1
- package/dist/utils/skillWriter.d.ts +10 -7
- package/dist/utils/skillWriter.d.ts.map +1 -1
- package/dist/utils/skillWriter.js +51 -53
- package/dist/utils/skillWriter.js.map +1 -1
- package/dist/utils/skills/claude-skill.d.ts +6 -0
- package/dist/utils/skills/claude-skill.d.ts.map +1 -0
- package/dist/utils/skills/claude-skill.js +49 -0
- package/dist/utils/skills/claude-skill.js.map +1 -0
- package/dist/utils/skills/cursor-rules.d.ts +5 -0
- package/dist/utils/skills/cursor-rules.d.ts.map +1 -0
- package/dist/utils/skills/cursor-rules.js +49 -0
- package/dist/utils/skills/cursor-rules.js.map +1 -0
- package/package.json +1 -1
- package/src/ui/dist/assets/{main-DAIpACRO.js → main-BOpG2zGa.js} +62 -62
- package/src/ui/dist/index.html +1 -1
- package/dist/routes/electron.d.ts +0 -8
- package/dist/routes/electron.d.ts.map +0 -1
- package/dist/routes/electron.js +0 -127
- package/dist/routes/electron.js.map +0 -1
- package/dist/services/ElectronBridgeService.d.ts +0 -149
- package/dist/services/ElectronBridgeService.d.ts.map +0 -1
- package/dist/services/ElectronBridgeService.js +0 -332
- package/dist/services/ElectronBridgeService.js.map +0 -1
- package/dist/services/FileModificationService.d.ts +0 -33
- package/dist/services/FileModificationService.d.ts.map +0 -1
- package/dist/services/FileModificationService.js +0 -111
- package/dist/services/FileModificationService.js.map +0 -1
- package/dist/services/LLMService.d.ts +0 -92
- package/dist/services/LLMService.d.ts.map +0 -1
- package/dist/services/LLMService.js +0 -371
- package/dist/services/LLMService.js.map +0 -1
- package/dist/services/ScriptInjectionService.d.ts +0 -8
- package/dist/services/ScriptInjectionService.d.ts.map +0 -1
- package/dist/services/ScriptInjectionService.js +0 -172
- package/dist/services/ScriptInjectionService.js.map +0 -1
- package/dist/types/proxy-types.d.ts +0 -39
- package/dist/types/proxy-types.d.ts.map +0 -1
- package/dist/types/proxy-types.js +0 -3
- package/dist/types/proxy-types.js.map +0 -1
|
@@ -1,172 +0,0 @@
|
|
|
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.ScriptInjectionService = exports.RIVET_SCRIPT_REMOVAL_PATTERN = void 0;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const logger_1 = require("../utils/logger");
|
|
10
|
-
const log = (0, logger_1.createLogger)('ScriptInjectionService');
|
|
11
|
-
// Combination of next & vite inject paths
|
|
12
|
-
const STANDARD_INJECT_PATHS = [
|
|
13
|
-
'app/layout.tsx',
|
|
14
|
-
'src/app/layout.tsx',
|
|
15
|
-
'pages/_app.tsx',
|
|
16
|
-
'src/pages/_app.tsx',
|
|
17
|
-
// Monorepo patterns
|
|
18
|
-
'apps/web/app/layout.tsx',
|
|
19
|
-
'apps/web/src/app/layout.tsx',
|
|
20
|
-
'apps/web/pages/_app.tsx',
|
|
21
|
-
'apps/web/src/pages/_app.tsx',
|
|
22
|
-
'apps/frontend/app/layout.tsx',
|
|
23
|
-
'apps/frontend/src/app/layout.tsx',
|
|
24
|
-
'apps/frontend/pages/_app.tsx',
|
|
25
|
-
'apps/frontend/src/pages/_app.tsx',
|
|
26
|
-
'packages/web/app/layout.tsx',
|
|
27
|
-
'packages/web/src/app/layout.tsx',
|
|
28
|
-
'packages/web/pages/_app.tsx',
|
|
29
|
-
'packages/web/src/pages/_app.tsx',
|
|
30
|
-
// Vite inject paths
|
|
31
|
-
'index.html',
|
|
32
|
-
'apps/web/index.html',
|
|
33
|
-
'apps/frontend/index.html',
|
|
34
|
-
'packages/web/index.html',
|
|
35
|
-
];
|
|
36
|
-
// Regex pattern used to remove the injected script tag
|
|
37
|
-
exports.RIVET_SCRIPT_REMOVAL_PATTERN = /\s*<script[^>]*id="rivet-selection-script"[^>]*>[\s\S]*?<\/script>\s*/g;
|
|
38
|
-
class ScriptInjectionService {
|
|
39
|
-
selectionScript;
|
|
40
|
-
constructor() {
|
|
41
|
-
// Load the selection script
|
|
42
|
-
try {
|
|
43
|
-
const scriptPath = path_1.default.join(__dirname, '../scripts/selection-script.js');
|
|
44
|
-
this.selectionScript = fs_1.default.readFileSync(scriptPath, 'utf8');
|
|
45
|
-
}
|
|
46
|
-
catch (error) {
|
|
47
|
-
log.error('Failed to load selection script:', error);
|
|
48
|
-
this.selectionScript = '// Selection script not found';
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
async injectScript(projectPath, customInjectPath, rivetPort = 4000) {
|
|
52
|
-
log.info('Injecting Rivet selection script...');
|
|
53
|
-
// Use custom inject path if provided, otherwise determine paths based on framework
|
|
54
|
-
let injectPaths;
|
|
55
|
-
if (customInjectPath) {
|
|
56
|
-
log.info(`Using custom inject path: ${customInjectPath}`);
|
|
57
|
-
injectPaths = [customInjectPath];
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
// Default to standard paths for unknown frameworks
|
|
61
|
-
log.debug('Unknown framework, defaulting to standard paths');
|
|
62
|
-
injectPaths = STANDARD_INJECT_PATHS;
|
|
63
|
-
}
|
|
64
|
-
const layoutPaths = injectPaths.map((relativePath) => path_1.default.join(projectPath, relativePath));
|
|
65
|
-
let layoutPath = null;
|
|
66
|
-
for (const testPath of layoutPaths) {
|
|
67
|
-
log.debug(`🔍 Checking if file exists: ${testPath}`);
|
|
68
|
-
if (fs_1.default.existsSync(testPath)) {
|
|
69
|
-
layoutPath = testPath;
|
|
70
|
-
log.info(`✅ Found layout file at: ${layoutPath}`);
|
|
71
|
-
break;
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
log.debug(`❌ File does not exist: ${testPath}`);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
if (!layoutPath) {
|
|
78
|
-
log.warn('⚠️ No layout file found, skipping script injection');
|
|
79
|
-
log.debug('📂 Searched paths:', layoutPaths);
|
|
80
|
-
log.debug('🔍 Files in project root:');
|
|
81
|
-
try {
|
|
82
|
-
const rootFiles = fs_1.default
|
|
83
|
-
.readdirSync(projectPath)
|
|
84
|
-
.filter((f) => f.endsWith('.tsx') || f.endsWith('.ts') || f.endsWith('.html'));
|
|
85
|
-
log.debug(' ', rootFiles);
|
|
86
|
-
}
|
|
87
|
-
catch (e) {
|
|
88
|
-
log.debug(' Could not read project root', e);
|
|
89
|
-
}
|
|
90
|
-
return null;
|
|
91
|
-
}
|
|
92
|
-
try {
|
|
93
|
-
log.debug(`📖 Reading layout file: ${layoutPath}`);
|
|
94
|
-
const layoutContent = fs_1.default.readFileSync(layoutPath, 'utf8');
|
|
95
|
-
log.debug(`📄 Layout file length: ${layoutContent.length} characters`);
|
|
96
|
-
if (layoutContent.includes('rivet-selection-script')) {
|
|
97
|
-
log.info('✅ Selection script already injected');
|
|
98
|
-
return path_1.default.relative(projectPath, layoutPath);
|
|
99
|
-
}
|
|
100
|
-
log.debug('💉 Script not found, proceeding with injection...');
|
|
101
|
-
const scriptTag = `<script src="http://localhost:${rivetPort}/api/selection-script" id="rivet-selection-script"></script>`;
|
|
102
|
-
log.debug(`📝 Created script tag (${scriptTag.length} characters)`);
|
|
103
|
-
let modifiedContent;
|
|
104
|
-
let injectionMethod = '';
|
|
105
|
-
if (layoutContent.includes('</head>')) {
|
|
106
|
-
modifiedContent = layoutContent.replace('</head>', ` ${scriptTag}\n </head>`);
|
|
107
|
-
injectionMethod = 'before </head>';
|
|
108
|
-
}
|
|
109
|
-
else if (layoutContent.includes('</body>')) {
|
|
110
|
-
modifiedContent = layoutContent.replace('</body>', ` ${scriptTag}\n </body>`);
|
|
111
|
-
injectionMethod = 'before </body>';
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
// For React components, inject at the end of the return statement
|
|
115
|
-
const returnMatch = layoutContent.match(/return\s*\(\s*(<[^>]+>)/);
|
|
116
|
-
if (returnMatch) {
|
|
117
|
-
const firstTag = returnMatch[1];
|
|
118
|
-
modifiedContent = layoutContent.replace(firstTag, firstTag + `\n ${scriptTag}`);
|
|
119
|
-
injectionMethod = `after first tag: ${firstTag}`;
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
log.warn('⚠️ Could not find injection point in layout file');
|
|
123
|
-
log.debug('📄 Layout file preview (first 500 chars):');
|
|
124
|
-
log.debug(layoutContent.substring(0, 500));
|
|
125
|
-
return null;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
log.debug(`🎯 Injection method: ${injectionMethod}`);
|
|
129
|
-
// Write back the modified content
|
|
130
|
-
log.debug(`💾 Writing modified content back to: ${layoutPath}`);
|
|
131
|
-
fs_1.default.writeFileSync(layoutPath, modifiedContent);
|
|
132
|
-
log.info(`✅ Selection script injected into ${layoutPath} (${injectionMethod})`);
|
|
133
|
-
return path_1.default.relative(projectPath, layoutPath);
|
|
134
|
-
}
|
|
135
|
-
catch (error) {
|
|
136
|
-
log.error('Failed to inject selection script:', error);
|
|
137
|
-
return null;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
async removeScript(projectPath, customInjectPath) {
|
|
141
|
-
log.info('Removing Rivet selection script...');
|
|
142
|
-
// Use custom inject path if provided, otherwise determine paths based on framework
|
|
143
|
-
let injectPaths;
|
|
144
|
-
if (customInjectPath) {
|
|
145
|
-
log.info(`Using custom inject path for removal: ${customInjectPath}`);
|
|
146
|
-
injectPaths = [customInjectPath];
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
injectPaths = STANDARD_INJECT_PATHS;
|
|
150
|
-
}
|
|
151
|
-
const layoutPaths = injectPaths.map((relativePath) => path_1.default.join(projectPath, relativePath));
|
|
152
|
-
for (const layoutPath of layoutPaths) {
|
|
153
|
-
if (!fs_1.default.existsSync(layoutPath))
|
|
154
|
-
continue;
|
|
155
|
-
try {
|
|
156
|
-
const layoutContent = fs_1.default.readFileSync(layoutPath, 'utf8');
|
|
157
|
-
// Remove the injected script
|
|
158
|
-
if (layoutContent.includes('rivet-selection-script')) {
|
|
159
|
-
// Remove the entire script tag and surrounding whitespace
|
|
160
|
-
const modifiedContent = layoutContent.replace(/\s*<script[^>]*id="rivet-selection-script"[^>]*>[\s\S]*?<\/script>\s*/g, '');
|
|
161
|
-
fs_1.default.writeFileSync(layoutPath, modifiedContent);
|
|
162
|
-
log.info(`Selection script removed from ${layoutPath}`);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
catch (error) {
|
|
166
|
-
log.error(`Failed to remove selection script from ${layoutPath}:`, error);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
exports.ScriptInjectionService = ScriptInjectionService;
|
|
172
|
-
//# sourceMappingURL=ScriptInjectionService.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ScriptInjectionService.js","sourceRoot":"","sources":["../../src/services/ScriptInjectionService.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,4CAA+C;AAE/C,MAAM,GAAG,GAAG,IAAA,qBAAY,EAAC,wBAAwB,CAAC,CAAC;AAEnD,0CAA0C;AAC1C,MAAM,qBAAqB,GAAG;IAC5B,gBAAgB;IAChB,oBAAoB;IACpB,gBAAgB;IAChB,oBAAoB;IACpB,oBAAoB;IACpB,yBAAyB;IACzB,6BAA6B;IAC7B,yBAAyB;IACzB,6BA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AAY,EAAE,EAAE,CACnD,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,CACrC,CAAC;QAEF,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;YACrC,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,UAAU,CAAC;gBAAE,SAAS;YAEzC,IAAI,CAAC;gBACH,MAAM,aAAa,GAAG,YAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;gBAE1D,6BAA6B;gBAC7B,IAAI,aAAa,CAAC,QAAQ,CAAC,wBAAwB,CAAC,EAAE,CAAC;oBACrD,0DAA0D;oBAC1D,MAAM,eAAe,GAAG,aAAa,CAAC,OAAO,CAC3C,wEAAwE,EACxE,EAAE,CACH,CAAC;oBAEF,YAAE,CAAC,aAAa,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;oBAC9C,GAAG,CAAC,IAAI,CAAC,iCAAiC,UAAU,EAAE,CAAC,CAAC;gBAC1D,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,GAAG,CAAC,KAAK,CACP,0CAA0C,UAAU,GAAG,EACvD,KAAK,CACN,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAhLD,wDAgLC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
type SchemaRegistry = 'CodeModificationSchema';
|
|
2
|
-
export type ProxyRequest = {
|
|
3
|
-
provider: 'anthropic' | 'openai';
|
|
4
|
-
model: string;
|
|
5
|
-
messages: Array<{
|
|
6
|
-
role: 'user' | 'assistant' | 'system';
|
|
7
|
-
content: string | Array<{
|
|
8
|
-
type: string;
|
|
9
|
-
text?: string;
|
|
10
|
-
source?: {
|
|
11
|
-
type: string;
|
|
12
|
-
media_type: string;
|
|
13
|
-
data: string;
|
|
14
|
-
};
|
|
15
|
-
}>;
|
|
16
|
-
}>;
|
|
17
|
-
temperature?: number;
|
|
18
|
-
maxTokens?: number;
|
|
19
|
-
stream?: boolean;
|
|
20
|
-
schema?: SchemaRegistry;
|
|
21
|
-
prompt?: string;
|
|
22
|
-
image?: string;
|
|
23
|
-
};
|
|
24
|
-
export type ProxyResponse = {
|
|
25
|
-
success: boolean;
|
|
26
|
-
data?: {
|
|
27
|
-
text: string;
|
|
28
|
-
finishReason?: string;
|
|
29
|
-
};
|
|
30
|
-
error?: string;
|
|
31
|
-
usage?: {
|
|
32
|
-
promptTokens: number;
|
|
33
|
-
completionTokens: number;
|
|
34
|
-
totalTokens: number;
|
|
35
|
-
cost: number;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
export {};
|
|
39
|
-
//# sourceMappingURL=proxy-types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"proxy-types.d.ts","sourceRoot":"","sources":["../../src/types/proxy-types.ts"],"names":[],"mappings":"AACA,KAAK,cAAc,GAAG,wBAAwB,CAAC;AAE/C,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,WAAW,GAAG,QAAQ,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC;QACd,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;QACtC,OAAO,EACH,MAAM,GACN,KAAK,CAAC;YACJ,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,MAAM,CAAC,EAAE;gBAAE,IAAI,EAAE,MAAM,CAAC;gBAAC,UAAU,EAAE,MAAM,CAAC;gBAAC,IAAI,EAAE,MAAM,CAAA;aAAE,CAAC;SAC7D,CAAC,CAAC;KACR,CAAC,CAAC;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE;QACN,YAAY,EAAE,MAAM,CAAC;QACrB,gBAAgB,EAAE,MAAM,CAAC;QACzB,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"proxy-types.js","sourceRoot":"","sources":["../../src/types/proxy-types.ts"],"names":[],"mappings":""}
|