rivet-design 0.26.2 → 0.27.1
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/DirectionRefReservations.d.ts +11 -0
- package/dist/agent-variants/DirectionRefReservations.js +47 -0
- package/dist/agent-variants/PreviewRuntime.js +20 -7
- package/dist/agent-variants/SessionStore.d.ts +10 -1
- package/dist/agent-variants/SessionStore.js +25 -2
- package/dist/agent-variants/WorkItemRequestTimes.d.ts +6 -0
- package/dist/agent-variants/WorkItemRequestTimes.js +21 -0
- package/dist/agent-variants/WorktreeOrchestrator.d.ts +2 -1
- package/dist/agent-variants/WorktreeOrchestrator.js +92 -78
- package/dist/agent-variants/contracts.d.ts +120 -116
- package/dist/agent-variants/existingStaticEntry.d.ts +34 -0
- package/dist/agent-variants/existingStaticEntry.js +136 -0
- package/dist/agent-variants/staticPreviewFiles.js +1 -1
- package/dist/agent-variants/variant-project-runtime.d.ts +2 -1
- package/dist/agent-variants/variantsTelemetry.d.ts +8 -0
- package/dist/agent-variants/variantsTelemetry.js +5 -0
- package/dist/agent-variants/workItemInput.d.ts +168 -146
- package/dist/agent-variants/workItemInput.js +12 -1
- package/dist/cli/commands/directionTarget.d.ts +23 -0
- package/dist/cli/commands/directionTarget.js +87 -0
- package/dist/cli/commands/mcpServe.js +1 -0
- package/dist/cli/commands/open.js +28 -4
- package/dist/cli/commands/serve.js +2 -0
- package/dist/cli/commands/variants.js +36 -43
- package/dist/cli/envelope.d.ts +1 -1
- package/dist/cli/envelope.js +1 -0
- package/dist/cli/handoff.d.ts +1 -0
- package/dist/cli/handoff.js +20 -4
- package/dist/cli/projectRuntimeUpgrade.d.ts +11 -0
- package/dist/cli/projectRuntimeUpgrade.js +43 -11
- 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 +38 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +14 -5
- package/dist/mcp/explorationSchema.js +1 -1
- package/dist/mcp/getExploration.js +11 -5
- package/dist/proxy-middleware/proxy-config.js +7 -0
- package/dist/routes/agentVariants.js +4 -0
- package/dist/routes/cli.js +10 -1
- package/dist/routes/library/middleware.js +11 -5
- package/dist/server.js +20 -6
- package/dist/services/DependencyPreparationService.js +57 -19
- package/dist/services/GuidanceVerifierRunner.js +4 -4
- package/dist/services/ProjectLibrary.d.ts +4 -1
- package/dist/services/ProjectLibrary.js +14 -9
- package/dist/services/ProjectPackageManager.d.ts +5 -0
- package/dist/services/ProjectPackageManager.js +33 -11
- package/dist/services/ProjectRuntimeService.d.ts +8 -0
- package/dist/services/ProjectRuntimeService.js +15 -2
- package/dist/services/TelemetryService.d.ts +13 -2
- package/dist/services/TelemetryService.js +29 -0
- package/dist/services/VariantHistoryService.d.ts +8 -0
- package/dist/services/VariantHistoryService.js +40 -0
- package/dist/services/WorktreeManager.d.ts +1 -0
- package/dist/services/WorktreeManager.js +17 -0
- package/dist/services/createAgentVariantsOrchestrator.js +9 -2
- package/dist/services/directionRefs.d.ts +21 -0
- package/dist/services/directionRefs.js +148 -0
- package/dist/services/profiles/DesignProfiles.js +16 -8
- package/dist/services/projectDirections.d.ts +22 -0
- package/dist/services/projectDirections.js +38 -0
- package/dist/types/direction-ref.d.ts +36 -0
- package/dist/types/direction-ref.js +3 -0
- package/dist/types/guidance-verifier.d.ts +7 -5
- package/dist/types/guidance-verifier.js +14 -1
- package/dist/types/variant-history.d.ts +3 -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 +7 -6
- package/dist/utils/skills/cursor-rules.d.ts +1 -1
- package/dist/utils/skills/cursor-rules.js +1 -1
- package/dist/utils/subprocessEnvironment.d.ts +1 -1
- package/dist/utils/subprocessEnvironment.js +0 -1
- package/package.json +4 -4
- package/src/ui/dist/assets/LibraryEntry-BZ5EdFgA.js +37 -0
- package/src/ui/dist/assets/main-MepMmTwb.css +1 -0
- package/src/ui/dist/assets/main-RriU35pI.js +497 -0
- package/src/ui/dist/index.html +2 -2
- package/dist/services/StaticPreviewServer.d.ts +0 -8
- package/dist/services/StaticPreviewServer.js +0 -207
- package/src/ui/dist/assets/LibraryEntry-92R_T-Xa.js +0 -37
- package/src/ui/dist/assets/main-D0UmAaUe.css +0 -1
- package/src/ui/dist/assets/main-DgEfJvYu.js +0 -497
- package/src/ui/dist/fonts/Goldman-Bold.woff2 +0 -0
- package/src/ui/dist/fonts/Goldman-Regular.woff2 +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { VariantHistoryService } from '../services/VariantHistoryService';
|
|
2
|
+
import type { DirectionRef } from '../types/direction-ref';
|
|
3
|
+
export declare class DirectionRefReservations {
|
|
4
|
+
private readonly taken;
|
|
5
|
+
reserve(label: string): DirectionRef;
|
|
6
|
+
load(args: {
|
|
7
|
+
projectPath: string;
|
|
8
|
+
history: VariantHistoryService;
|
|
9
|
+
}): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=DirectionRefReservations.d.ts.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DirectionRefReservations = void 0;
|
|
4
|
+
const directionRefs_1 = require("../services/directionRefs");
|
|
5
|
+
const projectDirections_1 = require("../services/projectDirections");
|
|
6
|
+
const logger_1 = require("../utils/logger");
|
|
7
|
+
const log = (0, logger_1.createLogger)('DirectionRefReservations');
|
|
8
|
+
class DirectionRefReservations {
|
|
9
|
+
taken = new Set();
|
|
10
|
+
reserve(label) {
|
|
11
|
+
const directionRef = (0, directionRefs_1.nextDirectionRef)({ label, taken: this.taken });
|
|
12
|
+
this.taken.add(directionRef);
|
|
13
|
+
return directionRef;
|
|
14
|
+
}
|
|
15
|
+
async load(args) {
|
|
16
|
+
let directions;
|
|
17
|
+
try {
|
|
18
|
+
directions = await (0, projectDirections_1.listProjectDirections)({
|
|
19
|
+
kind: 'history',
|
|
20
|
+
history: args.history,
|
|
21
|
+
projectPath: args.projectPath,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
log.warn('Direction ref history could not be listed', error);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
for (const direction of directions) {
|
|
29
|
+
this.taken.add(direction.directionRef);
|
|
30
|
+
if (direction.manifest.directionRef)
|
|
31
|
+
continue;
|
|
32
|
+
try {
|
|
33
|
+
await args.history.assignDirectionRef({
|
|
34
|
+
projectPath: direction.projectPath,
|
|
35
|
+
sessionId: direction.manifest.sessionId,
|
|
36
|
+
variantId: direction.manifest.variantId,
|
|
37
|
+
directionRef: direction.directionRef,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
log.warn(`Direction ref backfill failed for ${direction.manifest.sessionId}:${direction.manifest.variantId}`, error);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.DirectionRefReservations = DirectionRefReservations;
|
|
47
|
+
//# sourceMappingURL=DirectionRefReservations.js.map
|
|
@@ -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
|
}
|
|
@@ -2,6 +2,8 @@ import type { GuidanceDocument } from '../types/guidance';
|
|
|
2
2
|
import type { WorkerSelection } from '../types/change-request-types';
|
|
3
3
|
import { type VariantReference } from '../types/variant-reference';
|
|
4
4
|
import { type Brief, type ActiveVariantSnapshot, type LeasedWorkItemDescriptor, type ProjectContext, type Stage, type StartVariantsBriefContent, type StaticPreviewTargetElement, type Target, type TerminalSummary, type VariantContextBinding, type VariantContextBundle, type VariantQaResult, type VariantWorkItemContext, type WorkItem, type WorkItemKind, type WorkItemStatus, type WorkerFidelity, type WorkerRuntimeInfo } from './contracts';
|
|
5
|
+
import { DirectionRefReservations } from './DirectionRefReservations';
|
|
6
|
+
import type { DirectionRef } from '../types/direction-ref';
|
|
5
7
|
import { type VariantWorkItemInput, type VariantWorkItemInputByKind, type VariantWorkItemKind } from './workItemInput';
|
|
6
8
|
export declare const DEFAULT_LEASE_TTL_MS: number;
|
|
7
9
|
export declare const SCAFFOLD_LEASE_TTL_MS: number;
|
|
@@ -60,7 +62,8 @@ export declare const buildImageRefs: (artifacts: ReadonlyArray<{
|
|
|
60
62
|
export declare class SessionStore {
|
|
61
63
|
private readonly sessions;
|
|
62
64
|
private readonly clock;
|
|
63
|
-
|
|
65
|
+
readonly directionRefs: DirectionRefReservations;
|
|
66
|
+
constructor(clock?: SessionStoreClock, directionRefs?: DirectionRefReservations);
|
|
64
67
|
propose(args: ProposeArgs): ProposeResult;
|
|
65
68
|
reportBriefs(args: {
|
|
66
69
|
sessionId: string;
|
|
@@ -163,6 +166,7 @@ export declare class SessionStore {
|
|
|
163
166
|
references?: VariantReference[];
|
|
164
167
|
previewRoutes?: string[];
|
|
165
168
|
runLabel?: string;
|
|
169
|
+
sourceDirectionRef?: DirectionRef;
|
|
166
170
|
}): {
|
|
167
171
|
workItemId: string;
|
|
168
172
|
briefId: string;
|
|
@@ -180,12 +184,17 @@ export declare class SessionStore {
|
|
|
180
184
|
references?: VariantReference[];
|
|
181
185
|
previewRoutes?: string[];
|
|
182
186
|
runLabel?: string;
|
|
187
|
+
sourceDirectionRef?: DirectionRef;
|
|
183
188
|
projectContext: ProjectContext;
|
|
184
189
|
}): {
|
|
185
190
|
sessionId: string;
|
|
186
191
|
workItemId: string;
|
|
187
192
|
briefId: string;
|
|
188
193
|
};
|
|
194
|
+
claimDirectionRef(args: {
|
|
195
|
+
sessionId: string;
|
|
196
|
+
workItemId: string;
|
|
197
|
+
}): DirectionRef;
|
|
189
198
|
private findAdoptedVariant;
|
|
190
199
|
assignVariantPreviewRoutes(args: {
|
|
191
200
|
sessionId: string;
|
|
@@ -7,6 +7,7 @@ const crypto_1 = require("crypto");
|
|
|
7
7
|
const errors_1 = require("./errors");
|
|
8
8
|
const contracts_1 = require("./contracts");
|
|
9
9
|
const briefContent_1 = require("./briefContent");
|
|
10
|
+
const DirectionRefReservations_1 = require("./DirectionRefReservations");
|
|
10
11
|
const runLabel_1 = require("./runLabel");
|
|
11
12
|
const runPlan_1 = require("./runPlan");
|
|
12
13
|
const workItemInput_1 = require("./workItemInput");
|
|
@@ -185,8 +186,10 @@ const resolveVariantWorkItemContext = (args) => {
|
|
|
185
186
|
class SessionStore {
|
|
186
187
|
sessions = new Map();
|
|
187
188
|
clock;
|
|
188
|
-
|
|
189
|
+
directionRefs;
|
|
190
|
+
constructor(clock = SYSTEM_CLOCK, directionRefs = new DirectionRefReservations_1.DirectionRefReservations()) {
|
|
189
191
|
this.clock = clock;
|
|
192
|
+
this.directionRefs = directionRefs;
|
|
190
193
|
}
|
|
191
194
|
propose(args) {
|
|
192
195
|
const sessionId = args.sessionId ?? (0, crypto_1.randomUUID)();
|
|
@@ -345,6 +348,7 @@ class SessionStore {
|
|
|
345
348
|
input: {
|
|
346
349
|
briefId: brief.briefId,
|
|
347
350
|
briefLabel: brief.label,
|
|
351
|
+
directionRef: this.directionRefs.reserve(brief.label),
|
|
348
352
|
briefBody: sel.bodyOverride ?? brief.body,
|
|
349
353
|
instruction: session.prompt,
|
|
350
354
|
guidance: session.guidance,
|
|
@@ -376,6 +380,7 @@ class SessionStore {
|
|
|
376
380
|
input: {
|
|
377
381
|
briefId: brief.briefId,
|
|
378
382
|
briefLabel: brief.label,
|
|
383
|
+
directionRef: this.directionRefs.reserve(brief.label),
|
|
379
384
|
briefBody: sel.bodyOverride ?? brief.body,
|
|
380
385
|
instruction: session.prompt,
|
|
381
386
|
guidance: session.guidance,
|
|
@@ -582,6 +587,7 @@ class SessionStore {
|
|
|
582
587
|
guidance: args.guidance ?? [],
|
|
583
588
|
briefId: targetInput.briefId,
|
|
584
589
|
briefLabel: targetInput.briefLabel,
|
|
590
|
+
...(0, workItemInput_1.shownDirectionRef)(targetInput),
|
|
585
591
|
briefBody: targetInput.briefBody,
|
|
586
592
|
references: targetInput.references,
|
|
587
593
|
...(targetInput.briefNotes
|
|
@@ -660,6 +666,7 @@ class SessionStore {
|
|
|
660
666
|
},
|
|
661
667
|
}
|
|
662
668
|
: sourceInput.context;
|
|
669
|
+
const briefLabel = brief?.label ?? `${labelBase}${suffix}`;
|
|
663
670
|
const item = {
|
|
664
671
|
id: (0, crypto_1.randomUUID)(),
|
|
665
672
|
kind: 'static_preview',
|
|
@@ -668,7 +675,8 @@ class SessionStore {
|
|
|
668
675
|
dependsOn: [],
|
|
669
676
|
input: {
|
|
670
677
|
briefId: `${sourceInput.briefId ?? 'v'}-vary-${(0, crypto_1.randomUUID)().slice(0, 8)}`,
|
|
671
|
-
briefLabel
|
|
678
|
+
briefLabel,
|
|
679
|
+
directionRef: this.directionRefs.reserve(briefLabel),
|
|
672
680
|
briefBody: brief?.body ?? prettyInstruction,
|
|
673
681
|
...(brief?.notes ? { briefNotes: brief.notes } : {}),
|
|
674
682
|
...(previewRoutes.length ? { previewRoutes } : {}),
|
|
@@ -757,6 +765,7 @@ class SessionStore {
|
|
|
757
765
|
input: {
|
|
758
766
|
briefId: brief.briefId,
|
|
759
767
|
briefLabel: brief.label,
|
|
768
|
+
directionRef: this.directionRefs.reserve(brief.label),
|
|
760
769
|
briefBody: brief.body,
|
|
761
770
|
references: (0, variant_reference_1.mergeVariantReferences)(sourceInput?.references, context?.references),
|
|
762
771
|
instruction: args.instruction,
|
|
@@ -815,6 +824,9 @@ class SessionStore {
|
|
|
815
824
|
input: {
|
|
816
825
|
briefId,
|
|
817
826
|
briefLabel: args.label,
|
|
827
|
+
...(args.sourceDirectionRef
|
|
828
|
+
? { sourceDirectionRef: args.sourceDirectionRef }
|
|
829
|
+
: {}),
|
|
818
830
|
...(args.description ? { briefBody: args.description } : {}),
|
|
819
831
|
...(args.runLabel ? { runLabel: args.runLabel } : {}),
|
|
820
832
|
adoptedFrom: { ...args.source },
|
|
@@ -854,6 +866,7 @@ class SessionStore {
|
|
|
854
866
|
references: args.references,
|
|
855
867
|
previewRoutes: args.previewRoutes,
|
|
856
868
|
runLabel: args.runLabel,
|
|
869
|
+
sourceDirectionRef: args.sourceDirectionRef,
|
|
857
870
|
});
|
|
858
871
|
return {
|
|
859
872
|
sessionId,
|
|
@@ -861,6 +874,15 @@ class SessionStore {
|
|
|
861
874
|
briefId: adopted.briefId,
|
|
862
875
|
};
|
|
863
876
|
}
|
|
877
|
+
claimDirectionRef(args) {
|
|
878
|
+
const item = this.requireWorkItem(this.requireSession(args.sessionId), args.workItemId);
|
|
879
|
+
if (!(0, workItemInput_1.isVariantWorkItem)(item))
|
|
880
|
+
throw new errors_1.AgentVariantsError('WORK_ITEM_NOT_FOUND', `Work item ${item.id} is a ${item.kind} work item, not a direction`);
|
|
881
|
+
const directionRef = item.input.directionRef ??
|
|
882
|
+
this.directionRefs.reserve(item.input.briefLabel ?? '');
|
|
883
|
+
item.input.directionRef = directionRef;
|
|
884
|
+
return directionRef;
|
|
885
|
+
}
|
|
864
886
|
findAdoptedVariant(session, source) {
|
|
865
887
|
for (const item of session.workItems.values()) {
|
|
866
888
|
if (item.removed || !(0, workItemInput_1.isVariantWorkItem)(item))
|
|
@@ -1427,6 +1449,7 @@ class SessionStore {
|
|
|
1427
1449
|
? { previewRoutes: [...input.previewRoutes] }
|
|
1428
1450
|
: {}),
|
|
1429
1451
|
briefId: input.briefId ?? '',
|
|
1452
|
+
...(0, workItemInput_1.shownDirectionRef)(input),
|
|
1430
1453
|
label: input.briefLabel ?? 'Variant',
|
|
1431
1454
|
references: input.references,
|
|
1432
1455
|
status: item.status,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare class WorkItemRequestTimes {
|
|
2
|
+
private readonly requestedAt;
|
|
3
|
+
record(workItemIds: readonly string[], requestedAt: number): void;
|
|
4
|
+
elapsedSinceRequestMs(workItemId: string, at: number | undefined): number | null;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=WorkItemRequestTimes.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WorkItemRequestTimes = void 0;
|
|
4
|
+
class WorkItemRequestTimes {
|
|
5
|
+
requestedAt = new Map();
|
|
6
|
+
record(workItemIds, requestedAt) {
|
|
7
|
+
for (const workItemId of workItemIds) {
|
|
8
|
+
if (!this.requestedAt.has(workItemId)) {
|
|
9
|
+
this.requestedAt.set(workItemId, requestedAt);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
elapsedSinceRequestMs(workItemId, at) {
|
|
14
|
+
const requestedAt = this.requestedAt.get(workItemId);
|
|
15
|
+
if (requestedAt === undefined || at === undefined)
|
|
16
|
+
return null;
|
|
17
|
+
return at - requestedAt;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.WorkItemRequestTimes = WorkItemRequestTimes;
|
|
21
|
+
//# sourceMappingURL=WorkItemRequestTimes.js.map
|
|
@@ -4,7 +4,7 @@ import type { VariantStartRequest, VariantStartResult } from './variant-start-ty
|
|
|
4
4
|
import { AgentVariantsError } from './errors';
|
|
5
5
|
import { SessionStore, type ApprovedBriefSelection, type ApproveResult, type ProposeArgs, type ProposeResult, type ReportCompleteResult, type RequestWorkResult } from './SessionStore';
|
|
6
6
|
import type { ActiveProjectContext, AdoptPastVariantArgs, BootstrapPastVariantSessionArgs, BootstrapPastVariantSessionResult, ActiveVariantSnapshot, Brief, ProjectContext, Stage, TerminalSummary, VariantContextBinding, HostVariantWorkItemSnapshot, VariantQaResult, WorkItemStatus } from './contracts';
|
|
7
|
-
import type
|
|
7
|
+
import { type VariantWorkItemInput } from './workItemInput';
|
|
8
8
|
import { VariantHistoryService } from '../services/VariantHistoryService';
|
|
9
9
|
import type { MCPVariantsTelemetryMetadata } from '../services/MCPVariantsTelemetry';
|
|
10
10
|
import type { ProjectEnvironment, WorktreeManagerLike } from './variant-project-runtime';
|
|
@@ -249,6 +249,7 @@ export declare class AgentVariantsOrchestrator {
|
|
|
249
249
|
private readonly pendingHistoryPersists;
|
|
250
250
|
private trackHistoryPersist;
|
|
251
251
|
settleHistoryPersists(): Promise<void>;
|
|
252
|
+
loadDirectionRefs(): Promise<void>;
|
|
252
253
|
private getSavedVariant;
|
|
253
254
|
isHistoryDurableForRestart(isForced?: boolean): Promise<boolean>;
|
|
254
255
|
private persistCompletedExistingVariant;
|