rivet-design 0.26.2 → 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/dist/agent-variants/PreviewRuntime.js +20 -7
- package/dist/agent-variants/contracts.d.ts +116 -116
- package/dist/agent-variants/variantsTelemetry.d.ts +4 -0
- package/dist/agent-variants/variantsTelemetry.js +3 -0
- package/dist/agent-variants/workItemInput.d.ts +146 -146
- package/dist/cli/commands/mcpServe.js +1 -0
- package/dist/cli/commands/serve.js +2 -0
- 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/telemetry.d.ts +10 -0
- package/dist/cli/telemetry.js +37 -1
- package/dist/config/pluginMetrics.js +36 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +14 -5
- package/dist/routes/library/middleware.js +11 -5
- package/dist/server.js +8 -0
- package/dist/services/DependencyPreparationService.js +57 -19
- package/dist/services/GuidanceVerifierRunner.js +4 -4
- package/dist/services/ProjectPackageManager.d.ts +5 -0
- package/dist/services/ProjectPackageManager.js +33 -11
- package/dist/services/TelemetryService.d.ts +8 -2
- package/dist/services/TelemetryService.js +10 -0
- package/dist/services/WorktreeManager.js +5 -0
- package/dist/services/profiles/DesignProfiles.js +16 -8
- package/dist/types/guidance-verifier.d.ts +7 -5
- package/dist/types/guidance-verifier.js +14 -1
- package/dist/utils/devServerError.d.ts +5 -0
- package/dist/utils/devServerError.js +4 -0
- 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 +3 -3
- package/src/ui/dist/assets/{LibraryEntry-92R_T-Xa.js → LibraryEntry-RI9Lc7P3.js} +9 -9
- package/src/ui/dist/assets/main-DgrLzS5j.js +497 -0
- package/src/ui/dist/index.html +1 -1
- package/src/ui/dist/assets/main-DgEfJvYu.js +0 -497
|
@@ -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
|
}
|