rivet-design 0.26.1 → 0.27.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/bin/rivet.js +13 -0
- package/dist/agent-variants/PreviewRuntime.js +20 -7
- package/dist/agent-variants/WorkerExecutorService.d.ts +0 -2
- package/dist/agent-variants/WorkerExecutorService.js +0 -18
- package/dist/agent-variants/WorktreeOrchestrator.testHelpers.js +0 -8
- package/dist/agent-variants/contracts.d.ts +1001 -4868
- package/dist/agent-variants/contracts.js +1 -121
- package/dist/agent-variants/index.d.ts +1 -1
- package/dist/agent-variants/variantsTelemetry.d.ts +4 -8
- package/dist/agent-variants/variantsTelemetry.js +3 -0
- package/dist/agent-variants/workItemInput.d.ts +386 -386
- package/dist/cli/commands/contextRequest.js +1 -1
- package/dist/cli/commands/guidanceReferences.d.ts +2 -2
- package/dist/cli/commands/guidanceVerifierPackage.d.ts +2 -2
- package/dist/cli/commands/mcpServe.js +1 -0
- package/dist/cli/commands/serve.js +2 -0
- package/dist/cli/editorSession.d.ts +1 -13
- package/dist/cli/handoff.d.ts +1 -0
- package/dist/cli/handoff.js +20 -4
- package/dist/cli/router.js +1 -0
- package/dist/cli/runtimeInterruption.d.ts +2 -16
- package/dist/cli/telemetry.d.ts +10 -0
- package/dist/cli/telemetry.js +37 -1
- package/dist/config/pluginMetrics.js +36 -1
- package/dist/hosts/workerDefaults.d.ts +0 -11
- package/dist/hosts/workerDefaults.js +1 -30
- package/dist/index-core.d.ts +0 -1
- package/dist/index.d.ts +19 -0
- package/dist/index.js +15 -6
- package/dist/install/automaticCliUpdate.d.ts +1 -0
- package/dist/install/automaticCliUpdate.js +32 -22
- package/dist/install/channelCli.d.ts +1 -1
- package/dist/install/channelCli.js +11 -6
- package/dist/install/channelManager.d.ts +5 -2
- package/dist/install/globalBootstrap.d.ts +5 -3
- package/dist/install/globalBootstrap.js +21 -9
- package/dist/install/npmCommand.d.ts +15 -0
- package/dist/install/npmCommand.js +59 -0
- package/dist/routes/agentVariants.js +3 -14
- package/dist/routes/library/browserAccess.js +6 -2
- package/dist/routes/library/guidance.js +3 -1
- package/dist/routes/library/middleware.js +15 -9
- package/dist/routes/library/navigation.js +3 -1
- package/dist/routes/library/profiles.js +5 -5
- package/dist/routes/library/projects.js +17 -7
- package/dist/routes/library/referenceOnboarding.js +4 -2
- package/dist/routes/library/schemas.d.ts +2 -15
- package/dist/routes/telemetry.js +1 -1
- package/dist/routes/variantRequestSchema.d.ts +4 -4
- package/dist/routes/variantRequestSchema.js +7 -2
- package/dist/server.js +8 -0
- package/dist/services/AuthService.d.ts +3 -56
- package/dist/services/AuthService.js +0 -28
- package/dist/services/ConfigManager.d.ts +0 -2
- package/dist/services/ConfigManager.js +0 -14
- package/dist/services/DependencyPreparationService.js +57 -19
- package/dist/services/GuidanceVerifierRunner.js +4 -4
- package/dist/services/HubDiscovery.d.ts +1 -9
- package/dist/services/IntegrationsClient.d.ts +16 -16
- package/dist/services/MCPOnboardingTelemetry.d.ts +0 -14
- package/dist/services/MCPOnboardingTelemetry.js +0 -62
- package/dist/services/ProjectPackageManager.d.ts +5 -0
- package/dist/services/ProjectPackageManager.js +33 -11
- package/dist/services/ProjectRegistry.d.ts +5 -24
- package/dist/services/TelemetryService.d.ts +9 -64
- package/dist/services/TelemetryService.js +10 -113
- package/dist/services/TreeStore.d.ts +0 -2
- package/dist/services/TreeStore.js +0 -24
- package/dist/services/WorktreeManager.js +5 -0
- package/dist/services/profiles/DesignProfiles.d.ts +180 -125
- package/dist/services/profiles/DesignProfiles.js +16 -8
- package/dist/services/profiles/ProfilePlanning.d.ts +38 -38
- package/dist/services/profiles/ReferenceReader.d.ts +14 -14
- package/dist/services/profiles/modelContract.js +4 -4
- package/dist/storage/library/ProjectPreviewCache.d.ts +1 -13
- package/dist/storage/profiles/ProfilePlans.d.ts +137 -137
- package/dist/storage/profiles/ProfileRecords.d.ts +62 -37
- package/dist/storage/profiles/planSchema.d.ts +40 -40
- package/dist/storage/profiles/schema.d.ts +16 -16
- package/dist/types/api-responses.d.ts +174 -0
- package/dist/types/api-responses.js +108 -0
- package/dist/types/cosmos-profile.d.ts +17 -105
- package/dist/types/cosmos.d.ts +48 -266
- package/dist/types/design-library.d.ts +230 -61
- package/dist/types/design-library.js +38 -1
- package/dist/types/design-profile.d.ts +220 -529
- package/dist/types/design-profile.js +5 -1
- package/dist/types/guidance-references.d.ts +68 -316
- package/dist/types/guidance-verifier.d.ts +69 -560
- package/dist/types/guidance-verifier.js +15 -2
- package/dist/types/guidance.d.ts +182 -1643
- package/dist/types/guidance.js +4 -1
- package/dist/types/project-library.d.ts +60 -30
- package/dist/types/project-library.js +32 -1
- package/dist/types/reference-connectors.d.ts +38 -162
- package/dist/types/reference-onboarding.d.ts +144 -878
- package/dist/types/reference-pages.d.ts +27 -139
- package/dist/types/x-bookmarks.d.ts +40 -296
- package/dist/utils/devServerError.d.ts +5 -0
- package/dist/utils/devServerError.js +4 -0
- package/dist/utils/displayLocale.d.ts +0 -1
- package/dist/utils/displayLocale.js +1 -3
- package/dist/utils/failureReason.d.ts +16 -0
- package/dist/utils/failureReason.js +106 -0
- package/dist/utils/hostedLogPrivacy.d.ts +1 -0
- package/dist/utils/hostedLogPrivacy.js +10 -4
- package/dist/utils/skills/claude-skill.d.ts +1 -1
- package/dist/utils/skills/claude-skill.js +1 -1
- package/dist/utils/skills/cli-guidance.d.ts +1 -1
- package/dist/utils/skills/cli-guidance.js +3 -3
- package/dist/utils/skills/cursor-rules.d.ts +1 -1
- package/dist/utils/skills/cursor-rules.js +1 -1
- package/package.json +5 -5
- package/src/ui/dist/assets/LibraryEntry-RI9Lc7P3.js +37 -0
- package/src/ui/dist/assets/main-D0UmAaUe.css +1 -0
- package/src/ui/dist/assets/main-DgrLzS5j.js +497 -0
- package/src/ui/dist/index.html +2 -2
- package/dist/types/change-types.d.ts +0 -66
- package/dist/types/change-types.js +0 -3
- package/src/ui/dist/assets/LibraryEntry-Cr4GFYXW.js +0 -37
- package/src/ui/dist/assets/main-W3oTuTTl.css +0 -1
- package/src/ui/dist/assets/main-tPO1OCpZ.js +0 -439
package/bin/rivet.js
CHANGED
|
@@ -6,6 +6,19 @@ const fs = require('fs');
|
|
|
6
6
|
const path = require('path');
|
|
7
7
|
const childProcess = require('child_process');
|
|
8
8
|
|
|
9
|
+
const {
|
|
10
|
+
assertSupportedNodeVersion,
|
|
11
|
+
} = require('../scripts/verify-node-version.cjs');
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
assertSupportedNodeVersion(process.versions.node);
|
|
15
|
+
} catch (error) {
|
|
16
|
+
process.stderr.write(
|
|
17
|
+
`\n${error.message}\nNode.js runtime: ${process.execPath}\n\n`,
|
|
18
|
+
);
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
|
|
9
22
|
const packageRoot = path.resolve(__dirname, '..');
|
|
10
23
|
let packageMetadata = null;
|
|
11
24
|
try {
|
|
@@ -14,12 +14,14 @@ const logger_1 = require("../utils/logger");
|
|
|
14
14
|
const variantWorkspaceFiles_1 = require("./variantWorkspaceFiles");
|
|
15
15
|
const variantsTelemetry_1 = require("./variantsTelemetry");
|
|
16
16
|
const errorMessage_1 = require("../utils/errorMessage");
|
|
17
|
+
const failureReason_1 = require("../utils/failureReason");
|
|
17
18
|
const pathContainment_1 = require("../utils/pathContainment");
|
|
18
19
|
const log = (0, logger_1.createLogger)('PreviewRuntime');
|
|
19
20
|
const FRESH_DEV_SERVER_HOST = '127.0.0.1';
|
|
20
21
|
const FRESH_DEV_SERVER_DEFAULT_PORT = 5173;
|
|
21
22
|
const DEV_SERVER_START_MAX_ATTEMPTS = 3;
|
|
22
23
|
const DEV_SERVER_MAX_AUTO_RESTARTS = 2;
|
|
24
|
+
const REPORTED_FAILURE_REASONS = new Set(['dependency_install_failed', 'spawn_error']);
|
|
23
25
|
class PreviewRuntime {
|
|
24
26
|
deps;
|
|
25
27
|
sessions = new Map();
|
|
@@ -180,9 +182,11 @@ class PreviewRuntime {
|
|
|
180
182
|
}).catch((error) => {
|
|
181
183
|
throw new devServerError_1.DevServerStartError({
|
|
182
184
|
message: (0, errorMessage_1.errorMessage)(error),
|
|
185
|
+
summary: (0, errorMessage_1.errorMessage)(error),
|
|
183
186
|
detail: '',
|
|
184
187
|
reason: 'dependency_install_failed',
|
|
185
188
|
portInUse: false,
|
|
189
|
+
reasonCode: (0, failureReason_1.failureReasonCode)(error),
|
|
186
190
|
});
|
|
187
191
|
})
|
|
188
192
|
: null;
|
|
@@ -305,13 +309,13 @@ class PreviewRuntime {
|
|
|
305
309
|
reason: 'dependency_install_failed',
|
|
306
310
|
portInUse: false,
|
|
307
311
|
detail: (0, errorMessage_1.errorMessage)(installError),
|
|
308
|
-
}, startedAt,
|
|
312
|
+
}, startedAt, installError, missingDepsOutput);
|
|
309
313
|
return undefined;
|
|
310
314
|
}
|
|
311
315
|
}
|
|
312
316
|
continue;
|
|
313
317
|
}
|
|
314
|
-
this.failVariant(args, { reason, portInUse }, startedAt,
|
|
318
|
+
this.failVariant(args, { reason, portInUse }, startedAt, error, missingDepsOutput);
|
|
315
319
|
return undefined;
|
|
316
320
|
}
|
|
317
321
|
finally {
|
|
@@ -356,9 +360,13 @@ class PreviewRuntime {
|
|
|
356
360
|
});
|
|
357
361
|
}
|
|
358
362
|
failVariant(args, failure, startedAt, error, missingDeps) {
|
|
363
|
+
const devError = (0, devServerError_1.isDevServerStartError)(error) ? error : undefined;
|
|
364
|
+
const detail = devError?.detail ||
|
|
365
|
+
failure.detail ||
|
|
366
|
+
(error === undefined ? '' : (0, errorMessage_1.errorMessage)(error));
|
|
359
367
|
this.requireSession(args.sessionId).failures.set(args.workItemId, {
|
|
360
368
|
...failure,
|
|
361
|
-
...(
|
|
369
|
+
...(detail ? { detail } : {}),
|
|
362
370
|
});
|
|
363
371
|
let errorCode = 'DEV_SERVER_START_FAILED';
|
|
364
372
|
if (failure.reason === 'dependency_install_failed') {
|
|
@@ -366,15 +374,19 @@ class PreviewRuntime {
|
|
|
366
374
|
}
|
|
367
375
|
if (failure.reason === 'missing_dev_script')
|
|
368
376
|
errorCode = 'DEV_SCRIPT_MISSING';
|
|
377
|
+
const reportedError = REPORTED_FAILURE_REASONS.has(failure.reason)
|
|
378
|
+
? error
|
|
379
|
+
: undefined;
|
|
369
380
|
(0, variantsTelemetry_1.trackFreshDevServerFailed)(this.deps.telemetry, {
|
|
370
381
|
sessionId: args.sessionId,
|
|
371
382
|
variantId: args.workItemId,
|
|
372
383
|
errorCode,
|
|
373
384
|
reason: failure.reason,
|
|
374
385
|
portInUse: failure.portInUse,
|
|
375
|
-
exitCode:
|
|
376
|
-
signal:
|
|
386
|
+
exitCode: devError?.exitCode,
|
|
387
|
+
signal: devError?.signal,
|
|
377
388
|
missingDeps,
|
|
389
|
+
error: reportedError,
|
|
378
390
|
});
|
|
379
391
|
(0, variantsTelemetry_1.trackPreviewFailed)(this.deps.telemetry, {
|
|
380
392
|
sessionId: args.sessionId,
|
|
@@ -385,9 +397,10 @@ class PreviewRuntime {
|
|
|
385
397
|
reason: failure.reason,
|
|
386
398
|
portInUse: failure.portInUse,
|
|
387
399
|
durationMs: Date.now() - startedAt,
|
|
388
|
-
exitCode:
|
|
389
|
-
signal:
|
|
400
|
+
exitCode: devError?.exitCode,
|
|
401
|
+
signal: devError?.signal,
|
|
390
402
|
missingDeps,
|
|
403
|
+
error: reportedError,
|
|
391
404
|
});
|
|
392
405
|
this.deps.changed();
|
|
393
406
|
}
|
|
@@ -98,7 +98,6 @@ export declare class WorkerExecutorService {
|
|
|
98
98
|
private readonly referenceCreateTierOverridden;
|
|
99
99
|
private readonly timeoutMs;
|
|
100
100
|
private readonly rateLimitRetryDelayMs;
|
|
101
|
-
private runtimeAvailable?;
|
|
102
101
|
private readonly childrenBySession;
|
|
103
102
|
private readonly cancelledSessions;
|
|
104
103
|
private readonly backoffWakersBySession;
|
|
@@ -115,7 +114,6 @@ export declare class WorkerExecutorService {
|
|
|
115
114
|
selection?: WorkerSelection;
|
|
116
115
|
signal?: AbortSignal;
|
|
117
116
|
}): Promise<WorkerRuntimeDecision>;
|
|
118
|
-
isRuntimeAvailable(): boolean;
|
|
119
117
|
cancelSession(sessionId: string): void;
|
|
120
118
|
private backoff;
|
|
121
119
|
run(sessionId: string, workItemIds: string[], lease?: {
|
|
@@ -136,7 +136,6 @@ class WorkerExecutorService {
|
|
|
136
136
|
referenceCreateTierOverridden;
|
|
137
137
|
timeoutMs;
|
|
138
138
|
rateLimitRetryDelayMs;
|
|
139
|
-
runtimeAvailable;
|
|
140
139
|
childrenBySession = new Map();
|
|
141
140
|
cancelledSessions = new Set();
|
|
142
141
|
backoffWakersBySession = new Map();
|
|
@@ -212,23 +211,6 @@ class WorkerExecutorService {
|
|
|
212
211
|
async resolveRuntime(args) {
|
|
213
212
|
return this.resolver.resolve(args);
|
|
214
213
|
}
|
|
215
|
-
isRuntimeAvailable() {
|
|
216
|
-
if (this.runtimeAvailable === undefined) {
|
|
217
|
-
try {
|
|
218
|
-
(0, child_process_1.execFileSync)(this.workerCommand, ['--version'], {
|
|
219
|
-
env: this.defaultAdapter.spawnEnv(),
|
|
220
|
-
stdio: 'ignore',
|
|
221
|
-
timeout: 10_000,
|
|
222
|
-
});
|
|
223
|
-
this.runtimeAvailable = true;
|
|
224
|
-
}
|
|
225
|
-
catch {
|
|
226
|
-
log.warn(`worker runtime '${this.workerCommand}' unavailable — executor falling back to host path`);
|
|
227
|
-
this.runtimeAvailable = false;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
return this.runtimeAvailable;
|
|
231
|
-
}
|
|
232
214
|
cancelSession(sessionId) {
|
|
233
215
|
this.cancelledSessions.add(sessionId);
|
|
234
216
|
for (const pid of this.childrenBySession.get(sessionId) ?? []) {
|
|
@@ -139,10 +139,6 @@ function buildOrchestrator(opts = {}) {
|
|
|
139
139
|
},
|
|
140
140
|
telemetry: {
|
|
141
141
|
track: (event, properties) => harness.telemetryEvents.push({ event, properties }),
|
|
142
|
-
trackAgentVariantsSourceContextQuality: (properties) => harness.telemetryEvents.push({
|
|
143
|
-
event: 'agent_variants.source_context_quality',
|
|
144
|
-
properties,
|
|
145
|
-
}),
|
|
146
142
|
trackAgentVariantsBriefQuality: (properties) => harness.telemetryEvents.push({
|
|
147
143
|
event: 'agent_variants.brief_quality',
|
|
148
144
|
properties,
|
|
@@ -155,10 +151,6 @@ function buildOrchestrator(opts = {}) {
|
|
|
155
151
|
event: 'agent_variants.request_accepted',
|
|
156
152
|
properties,
|
|
157
153
|
}),
|
|
158
|
-
trackAgentVariantsRequestRejected: (properties) => harness.telemetryEvents.push({
|
|
159
|
-
event: 'agent_variants.request_rejected',
|
|
160
|
-
properties,
|
|
161
|
-
}),
|
|
162
154
|
trackAgentVariantsBriefsStarted: (properties) => harness.telemetryEvents.push({
|
|
163
155
|
event: 'agent_variants.briefs_started',
|
|
164
156
|
properties,
|