rivet-design 0.12.3 → 0.13.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/README.md +50 -26
- package/README.npm.md +50 -26
- package/bin/rivet.js +39 -24
- package/dist/{mcp/agent-variants → agent-variants}/SessionStore.d.ts +11 -19
- package/dist/agent-variants/SessionStore.d.ts.map +1 -0
- package/dist/{mcp/agent-variants → agent-variants}/SessionStore.js +77 -80
- package/dist/agent-variants/SessionStore.js.map +1 -0
- package/dist/{mcp/agent-variants → agent-variants}/WorktreeOrchestrator.d.ts +53 -21
- package/dist/agent-variants/WorktreeOrchestrator.d.ts.map +1 -0
- package/dist/{mcp/agent-variants → agent-variants}/WorktreeOrchestrator.js +291 -49
- package/dist/agent-variants/WorktreeOrchestrator.js.map +1 -0
- package/dist/{mcp/agent-variants → agent-variants}/WorktreeOrchestrator.testHelpers.d.ts +1 -9
- package/dist/agent-variants/WorktreeOrchestrator.testHelpers.d.ts.map +1 -0
- package/dist/{mcp/agent-variants → agent-variants}/WorktreeOrchestrator.testHelpers.js +3 -18
- package/dist/agent-variants/WorktreeOrchestrator.testHelpers.js.map +1 -0
- package/dist/agent-variants/briefContent.d.ts.map +1 -0
- package/dist/agent-variants/briefContent.js.map +1 -0
- package/dist/{mcp/agent-variants → agent-variants}/contracts.d.ts +715 -721
- package/dist/agent-variants/contracts.d.ts.map +1 -0
- package/dist/{mcp/agent-variants → agent-variants}/contracts.js +2 -3
- package/dist/agent-variants/contracts.js.map +1 -0
- package/dist/agent-variants/createProjectArtifacts.d.ts.map +1 -0
- package/dist/agent-variants/createProjectArtifacts.js.map +1 -0
- package/dist/agent-variants/diffQa.d.ts.map +1 -0
- package/dist/agent-variants/diffQa.js.map +1 -0
- package/dist/{mcp/agent-variants → agent-variants}/elementRefToTarget.d.ts +1 -1
- package/dist/agent-variants/elementRefToTarget.d.ts.map +1 -0
- package/dist/agent-variants/elementRefToTarget.js.map +1 -0
- package/dist/agent-variants/errors.d.ts.map +1 -0
- package/dist/agent-variants/errors.js.map +1 -0
- package/dist/agent-variants/generatedDestination.d.ts +29 -0
- package/dist/agent-variants/generatedDestination.d.ts.map +1 -0
- package/dist/agent-variants/generatedDestination.js +59 -0
- package/dist/agent-variants/generatedDestination.js.map +1 -0
- package/dist/{mcp/agent-variants → agent-variants}/index.d.ts +3 -6
- package/dist/agent-variants/index.d.ts.map +1 -0
- package/dist/{mcp/agent-variants → agent-variants}/index.js +3 -6
- package/dist/agent-variants/index.js.map +1 -0
- package/dist/agent-variants/previewQa.d.ts.map +1 -0
- package/dist/agent-variants/previewQa.js.map +1 -0
- package/dist/agent-variants/runLabel.d.ts.map +1 -0
- package/dist/agent-variants/runLabel.js.map +1 -0
- package/dist/agent-variants/runPlan.d.ts.map +1 -0
- package/dist/agent-variants/runPlan.js.map +1 -0
- package/dist/agent-variants/sourceContext.d.ts.map +1 -0
- package/dist/agent-variants/sourceContext.js.map +1 -0
- package/dist/agent-variants/variantContext.d.ts.map +1 -0
- package/dist/agent-variants/variantContext.js.map +1 -0
- package/dist/cli/client.d.ts +43 -0
- package/dist/cli/client.d.ts.map +1 -0
- package/dist/cli/client.js +109 -0
- package/dist/cli/client.js.map +1 -0
- package/dist/cli/commandNames.d.ts +9 -0
- package/dist/cli/commandNames.d.ts.map +1 -0
- package/dist/cli/commandNames.js +24 -0
- package/dist/cli/commandNames.js.map +1 -0
- package/dist/cli/commands/auth.d.ts +10 -0
- package/dist/cli/commands/auth.d.ts.map +1 -0
- package/dist/cli/commands/auth.js +81 -0
- package/dist/cli/commands/auth.js.map +1 -0
- package/dist/cli/commands/elementSelector.d.ts +10 -0
- package/dist/cli/commands/elementSelector.d.ts.map +1 -0
- package/dist/cli/commands/elementSelector.js +41 -0
- package/dist/cli/commands/elementSelector.js.map +1 -0
- package/dist/cli/commands/evidence.d.ts +9 -0
- package/dist/cli/commands/evidence.d.ts.map +1 -0
- package/dist/cli/commands/evidence.js +85 -0
- package/dist/cli/commands/evidence.js.map +1 -0
- package/dist/cli/commands/mcpServe.d.ts +40 -0
- package/dist/cli/commands/mcpServe.d.ts.map +1 -0
- package/dist/cli/commands/mcpServe.js +440 -0
- package/dist/cli/commands/mcpServe.js.map +1 -0
- package/dist/cli/commands/open.d.ts +28 -0
- package/dist/cli/commands/open.d.ts.map +1 -0
- package/dist/cli/commands/open.js +280 -0
- package/dist/cli/commands/open.js.map +1 -0
- package/dist/cli/commands/reference.d.ts +8 -0
- package/dist/cli/commands/reference.d.ts.map +1 -0
- package/dist/cli/commands/reference.js +101 -0
- package/dist/cli/commands/reference.js.map +1 -0
- package/dist/cli/commands/serve.d.ts +9 -0
- package/dist/cli/commands/serve.d.ts.map +1 -0
- package/dist/cli/commands/serve.js +182 -0
- package/dist/cli/commands/serve.js.map +1 -0
- package/dist/cli/commands/shared.d.ts +31 -0
- package/dist/cli/commands/shared.d.ts.map +1 -0
- package/dist/cli/commands/shared.js +82 -0
- package/dist/cli/commands/shared.js.map +1 -0
- package/dist/cli/commands/status.d.ts +10 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +61 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/stop.d.ts +8 -0
- package/dist/cli/commands/stop.d.ts.map +1 -0
- package/dist/cli/commands/stop.js +41 -0
- package/dist/cli/commands/stop.js.map +1 -0
- package/dist/cli/commands/variants.d.ts +4 -0
- package/dist/cli/commands/variants.d.ts.map +1 -0
- package/dist/cli/commands/variants.js +374 -0
- package/dist/cli/commands/variants.js.map +1 -0
- package/dist/cli/commands/wait.d.ts +10 -0
- package/dist/cli/commands/wait.d.ts.map +1 -0
- package/dist/cli/commands/wait.js +101 -0
- package/dist/cli/commands/wait.js.map +1 -0
- package/dist/cli/entry.d.ts +12 -0
- package/dist/cli/entry.d.ts.map +1 -0
- package/dist/cli/entry.js +61 -0
- package/dist/cli/entry.js.map +1 -0
- package/dist/cli/envelope.d.ts +60 -0
- package/dist/cli/envelope.d.ts.map +1 -0
- package/dist/cli/envelope.js +57 -0
- package/dist/cli/envelope.js.map +1 -0
- package/dist/cli/flags.d.ts +20 -0
- package/dist/cli/flags.d.ts.map +1 -0
- package/dist/cli/flags.js +72 -0
- package/dist/cli/flags.js.map +1 -0
- package/dist/cli/handoff.d.ts +54 -0
- package/dist/cli/handoff.d.ts.map +1 -0
- package/dist/cli/handoff.js +106 -0
- package/dist/cli/handoff.js.map +1 -0
- package/dist/cli/handoffStore.d.ts +24 -0
- package/dist/cli/handoffStore.d.ts.map +1 -0
- package/dist/cli/handoffStore.js +49 -0
- package/dist/cli/handoffStore.js.map +1 -0
- package/dist/cli/hostWorkNextAction.d.ts +45 -0
- package/dist/cli/hostWorkNextAction.d.ts.map +1 -0
- package/dist/cli/hostWorkNextAction.js +43 -0
- package/dist/cli/hostWorkNextAction.js.map +1 -0
- package/dist/cli/io.d.ts +17 -0
- package/dist/cli/io.d.ts.map +1 -0
- package/dist/cli/io.js +19 -0
- package/dist/cli/io.js.map +1 -0
- package/dist/cli/router.d.ts +23 -0
- package/dist/cli/router.d.ts.map +1 -0
- package/dist/cli/router.js +236 -0
- package/dist/cli/router.js.map +1 -0
- package/dist/cli/runnerSelection.d.ts +60 -0
- package/dist/cli/runnerSelection.d.ts.map +1 -0
- package/dist/cli/runnerSelection.js +93 -0
- package/dist/cli/runnerSelection.js.map +1 -0
- package/dist/cli/serverHandshake.d.ts +51 -0
- package/dist/cli/serverHandshake.d.ts.map +1 -0
- package/dist/cli/serverHandshake.js +144 -0
- package/dist/cli/serverHandshake.js.map +1 -0
- package/dist/index.d.ts +2 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +84 -138
- package/dist/index.js.map +1 -1
- package/dist/install/allowlists.d.ts +65 -0
- package/dist/install/allowlists.d.ts.map +1 -0
- package/dist/install/allowlists.js +333 -0
- package/dist/install/allowlists.js.map +1 -0
- package/dist/install/codexGuidance.d.ts +11 -0
- package/dist/install/codexGuidance.d.ts.map +1 -0
- package/dist/install/codexGuidance.js +90 -0
- package/dist/install/codexGuidance.js.map +1 -0
- package/dist/install/harnesses.d.ts +37 -26
- package/dist/install/harnesses.d.ts.map +1 -1
- package/dist/install/harnesses.js +312 -502
- package/dist/install/harnesses.js.map +1 -1
- package/dist/install/legacyMcp.d.ts +26 -0
- package/dist/install/legacyMcp.d.ts.map +1 -0
- package/dist/install/legacyMcp.js +160 -0
- package/dist/install/legacyMcp.js.map +1 -0
- package/dist/install/mcpRegistration.d.ts +45 -0
- package/dist/install/mcpRegistration.d.ts.map +1 -0
- package/dist/install/mcpRegistration.js +215 -0
- package/dist/install/mcpRegistration.js.map +1 -0
- package/dist/mcp/changeBatchClassification.d.ts +18 -20
- package/dist/mcp/changeBatchClassification.d.ts.map +1 -1
- package/dist/mcp/changeBatchClassification.js +41 -46
- package/dist/mcp/changeBatchClassification.js.map +1 -1
- package/dist/proxy-middleware/proxy-config.d.ts +6 -0
- package/dist/proxy-middleware/proxy-config.d.ts.map +1 -1
- package/dist/proxy-middleware/proxy-config.js +162 -5
- package/dist/proxy-middleware/proxy-config.js.map +1 -1
- package/dist/routes/agentVariants.d.ts +14 -2
- package/dist/routes/agentVariants.d.ts.map +1 -1
- package/dist/routes/agentVariants.js +321 -65
- package/dist/routes/agentVariants.js.map +1 -1
- package/dist/routes/cli.d.ts +31 -0
- package/dist/routes/cli.d.ts.map +1 -0
- package/dist/routes/cli.js +95 -0
- package/dist/routes/cli.js.map +1 -0
- package/dist/routes/git.d.ts +1 -0
- package/dist/routes/git.d.ts.map +1 -1
- package/dist/routes/git.js +2 -1
- package/dist/routes/git.js.map +1 -1
- package/dist/routes/inlineStartTracker.d.ts +23 -0
- package/dist/routes/inlineStartTracker.d.ts.map +1 -0
- package/dist/routes/inlineStartTracker.js +17 -0
- package/dist/routes/inlineStartTracker.js.map +1 -0
- package/dist/routes/mcp.d.ts +2 -12
- package/dist/routes/mcp.d.ts.map +1 -1
- package/dist/routes/mcp.js +4 -785
- package/dist/routes/mcp.js.map +1 -1
- package/dist/server.d.ts +24 -9
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +169 -33
- package/dist/server.js.map +1 -1
- package/dist/services/CommitMessageGenerator.d.ts +9 -1
- package/dist/services/CommitMessageGenerator.d.ts.map +1 -1
- package/dist/services/CommitMessageGenerator.js +4 -1
- package/dist/services/CommitMessageGenerator.js.map +1 -1
- package/dist/services/ComponentSearchService.d.ts +4 -1
- package/dist/services/ComponentSearchService.d.ts.map +1 -1
- package/dist/services/ComponentSearchService.js.map +1 -1
- package/dist/services/ConfigManager.d.ts +8 -0
- package/dist/services/ConfigManager.d.ts.map +1 -1
- package/dist/services/ConfigManager.js +9 -0
- package/dist/services/ConfigManager.js.map +1 -1
- package/dist/services/HistoryReplayService.d.ts +20 -9
- package/dist/services/HistoryReplayService.d.ts.map +1 -1
- package/dist/services/HistoryReplayService.js +99 -43
- package/dist/services/HistoryReplayService.js.map +1 -1
- package/dist/services/MCPVariantsTelemetry.d.ts +1 -1
- package/dist/services/MCPVariantsTelemetry.d.ts.map +1 -1
- package/dist/services/MCPVariantsTelemetry.js +1 -0
- package/dist/services/MCPVariantsTelemetry.js.map +1 -1
- package/dist/services/PRTitleGenerator.d.ts +10 -2
- package/dist/services/PRTitleGenerator.d.ts.map +1 -1
- package/dist/services/PRTitleGenerator.js +8 -2
- package/dist/services/PRTitleGenerator.js.map +1 -1
- package/dist/services/ProjectDetectionService.d.ts.map +1 -1
- package/dist/services/ProjectDetectionService.js +14 -4
- package/dist/services/ProjectDetectionService.js.map +1 -1
- package/dist/services/ProjectMetadataStore.d.ts +115 -0
- package/dist/services/ProjectMetadataStore.d.ts.map +1 -0
- package/dist/services/ProjectMetadataStore.js +336 -0
- package/dist/services/ProjectMetadataStore.js.map +1 -0
- package/dist/services/SessionBridgeService.d.ts +52 -224
- package/dist/services/SessionBridgeService.d.ts.map +1 -1
- package/dist/services/SessionBridgeService.js +97 -649
- package/dist/services/SessionBridgeService.js.map +1 -1
- package/dist/services/SessionService.d.ts +4 -1
- package/dist/services/SessionService.d.ts.map +1 -1
- package/dist/services/SessionService.js +7 -4
- package/dist/services/SessionService.js.map +1 -1
- package/dist/services/StaticFileService.d.ts.map +1 -1
- package/dist/services/StaticFileService.js +6 -0
- package/dist/services/StaticFileService.js.map +1 -1
- package/dist/services/TelemetryService.d.ts +16 -80
- package/dist/services/TelemetryService.d.ts.map +1 -1
- package/dist/services/TelemetryService.js +18 -94
- package/dist/services/TelemetryService.js.map +1 -1
- package/dist/services/VariantGenerationService.d.ts +52 -0
- package/dist/services/VariantGenerationService.d.ts.map +1 -0
- package/dist/services/VariantGenerationService.js +272 -0
- package/dist/services/VariantGenerationService.js.map +1 -0
- package/dist/services/VariantHistoryService.d.ts +37 -1
- package/dist/services/VariantHistoryService.d.ts.map +1 -1
- package/dist/services/VariantHistoryService.js +122 -1
- package/dist/services/VariantHistoryService.js.map +1 -1
- package/dist/services/VariantRunService.d.ts +25 -6
- package/dist/services/VariantRunService.d.ts.map +1 -1
- package/dist/services/VariantRunService.js +98 -4
- package/dist/services/VariantRunService.js.map +1 -1
- package/dist/services/VariantsRuntime.d.ts +1 -3
- package/dist/services/VariantsRuntime.d.ts.map +1 -1
- package/dist/services/VariantsRuntime.js +0 -1
- package/dist/services/VariantsRuntime.js.map +1 -1
- package/dist/services/WorktreeManager.d.ts +1 -1
- package/dist/services/WorktreeManager.d.ts.map +1 -1
- package/dist/services/createAgentVariantsOrchestrator.d.ts +2 -2
- package/dist/services/createAgentVariantsOrchestrator.d.ts.map +1 -1
- package/dist/services/createAgentVariantsOrchestrator.js +2 -3
- package/dist/services/createAgentVariantsOrchestrator.js.map +1 -1
- package/dist/services/projectMetadataMigrations.d.ts +59 -0
- package/dist/services/projectMetadataMigrations.d.ts.map +1 -0
- package/dist/services/projectMetadataMigrations.js +109 -0
- package/dist/services/projectMetadataMigrations.js.map +1 -0
- package/dist/types/change-request-types.d.ts +22 -0
- package/dist/types/change-request-types.d.ts.map +1 -1
- package/dist/utils/logger.d.ts +2 -1
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +3 -7
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/loopback.d.ts +3 -0
- package/dist/utils/loopback.d.ts.map +1 -0
- package/dist/utils/loopback.js +13 -0
- package/dist/utils/loopback.js.map +1 -0
- package/dist/utils/pid.d.ts +3 -0
- package/dist/utils/pid.d.ts.map +1 -0
- package/dist/utils/pid.js +15 -0
- package/dist/utils/pid.js.map +1 -0
- package/dist/utils/queueAccess.d.ts +7 -0
- package/dist/utils/queueAccess.d.ts.map +1 -1
- package/dist/utils/queueAccess.js +8 -1
- package/dist/utils/queueAccess.js.map +1 -1
- package/dist/utils/shouldRecordHostedDemoSessionAction.d.ts +3 -3
- package/dist/utils/shouldRecordHostedDemoSessionAction.d.ts.map +1 -1
- package/dist/utils/shouldRecordHostedDemoSessionAction.js +3 -19
- package/dist/utils/shouldRecordHostedDemoSessionAction.js.map +1 -1
- package/dist/utils/skillWriter.d.ts.map +1 -1
- package/dist/utils/skillWriter.js +12 -11
- package/dist/utils/skillWriter.js.map +1 -1
- package/dist/utils/skills/claude-skill.d.ts +7 -2
- package/dist/utils/skills/claude-skill.d.ts.map +1 -1
- package/dist/utils/skills/claude-skill.js +10 -83
- package/dist/utils/skills/claude-skill.js.map +1 -1
- package/dist/utils/skills/cli-guidance.d.ts +12 -0
- package/dist/utils/skills/cli-guidance.d.ts.map +1 -0
- package/dist/utils/skills/cli-guidance.js +57 -0
- package/dist/utils/skills/cli-guidance.js.map +1 -0
- package/dist/utils/skills/cursor-rules.d.ts +8 -2
- package/dist/utils/skills/cursor-rules.d.ts.map +1 -1
- package/dist/utils/skills/cursor-rules.js +11 -80
- package/dist/utils/skills/cursor-rules.js.map +1 -1
- package/dist/utils/variantSessionStart.d.ts +1 -1
- package/dist/utils/variantSessionStart.d.ts.map +1 -1
- package/dist/utils/variantSessionStart.js +1 -1
- package/dist/utils/variantSessionStart.js.map +1 -1
- package/package.json +4 -4
- package/src/ui/dist/assets/main-BWOvFoal.js +419 -0
- package/src/ui/dist/assets/main-Dyos9I29.css +1 -0
- package/src/ui/dist/index.html +2 -2
- package/dist/mcp/agent-variants/SessionStore.d.ts.map +0 -1
- package/dist/mcp/agent-variants/SessionStore.js.map +0 -1
- package/dist/mcp/agent-variants/WorktreeOrchestrator.d.ts.map +0 -1
- package/dist/mcp/agent-variants/WorktreeOrchestrator.js.map +0 -1
- package/dist/mcp/agent-variants/WorktreeOrchestrator.testHelpers.d.ts.map +0 -1
- package/dist/mcp/agent-variants/WorktreeOrchestrator.testHelpers.js.map +0 -1
- package/dist/mcp/agent-variants/areNaSourceContext.d.ts +0 -20
- package/dist/mcp/agent-variants/areNaSourceContext.d.ts.map +0 -1
- package/dist/mcp/agent-variants/areNaSourceContext.js +0 -118
- package/dist/mcp/agent-variants/areNaSourceContext.js.map +0 -1
- package/dist/mcp/agent-variants/briefContent.d.ts.map +0 -1
- package/dist/mcp/agent-variants/briefContent.js.map +0 -1
- package/dist/mcp/agent-variants/contracts.d.ts.map +0 -1
- package/dist/mcp/agent-variants/contracts.js.map +0 -1
- package/dist/mcp/agent-variants/createProjectArtifacts.d.ts.map +0 -1
- package/dist/mcp/agent-variants/createProjectArtifacts.js.map +0 -1
- package/dist/mcp/agent-variants/createZeroToOneTool.d.ts +0 -63
- package/dist/mcp/agent-variants/createZeroToOneTool.d.ts.map +0 -1
- package/dist/mcp/agent-variants/createZeroToOneTool.js +0 -265
- package/dist/mcp/agent-variants/createZeroToOneTool.js.map +0 -1
- package/dist/mcp/agent-variants/diffQa.d.ts.map +0 -1
- package/dist/mcp/agent-variants/diffQa.js.map +0 -1
- package/dist/mcp/agent-variants/elementRefToTarget.d.ts.map +0 -1
- package/dist/mcp/agent-variants/elementRefToTarget.js.map +0 -1
- package/dist/mcp/agent-variants/errors.d.ts.map +0 -1
- package/dist/mcp/agent-variants/errors.js.map +0 -1
- package/dist/mcp/agent-variants/generatedDestination.d.ts +0 -75
- package/dist/mcp/agent-variants/generatedDestination.d.ts.map +0 -1
- package/dist/mcp/agent-variants/generatedDestination.js +0 -103
- package/dist/mcp/agent-variants/generatedDestination.js.map +0 -1
- package/dist/mcp/agent-variants/index.d.ts.map +0 -1
- package/dist/mcp/agent-variants/index.js.map +0 -1
- package/dist/mcp/agent-variants/pendingChangesAdapter.d.ts +0 -38
- package/dist/mcp/agent-variants/pendingChangesAdapter.d.ts.map +0 -1
- package/dist/mcp/agent-variants/pendingChangesAdapter.js +0 -93
- package/dist/mcp/agent-variants/pendingChangesAdapter.js.map +0 -1
- package/dist/mcp/agent-variants/pinterestSourceContext.d.ts +0 -23
- package/dist/mcp/agent-variants/pinterestSourceContext.d.ts.map +0 -1
- package/dist/mcp/agent-variants/pinterestSourceContext.js +0 -137
- package/dist/mcp/agent-variants/pinterestSourceContext.js.map +0 -1
- package/dist/mcp/agent-variants/previewQa.d.ts.map +0 -1
- package/dist/mcp/agent-variants/previewQa.js.map +0 -1
- package/dist/mcp/agent-variants/runLabel.d.ts.map +0 -1
- package/dist/mcp/agent-variants/runLabel.js.map +0 -1
- package/dist/mcp/agent-variants/runPlan.d.ts.map +0 -1
- package/dist/mcp/agent-variants/runPlan.js.map +0 -1
- package/dist/mcp/agent-variants/sourceContext.d.ts.map +0 -1
- package/dist/mcp/agent-variants/sourceContext.js.map +0 -1
- package/dist/mcp/agent-variants/tools.d.ts +0 -187
- package/dist/mcp/agent-variants/tools.d.ts.map +0 -1
- package/dist/mcp/agent-variants/tools.js +0 -1165
- package/dist/mcp/agent-variants/tools.js.map +0 -1
- package/dist/mcp/agent-variants/variantContext.d.ts.map +0 -1
- package/dist/mcp/agent-variants/variantContext.js.map +0 -1
- package/dist/mcp/auth/httpOAuthProvider.d.ts +0 -103
- package/dist/mcp/auth/httpOAuthProvider.d.ts.map +0 -1
- package/dist/mcp/auth/httpOAuthProvider.js +0 -735
- package/dist/mcp/auth/httpOAuthProvider.js.map +0 -1
- package/dist/mcp/auth/tools.d.ts +0 -39
- package/dist/mcp/auth/tools.d.ts.map +0 -1
- package/dist/mcp/auth/tools.js +0 -304
- package/dist/mcp/auth/tools.js.map +0 -1
- package/dist/mcp/branding.d.ts +0 -4
- package/dist/mcp/branding.d.ts.map +0 -1
- package/dist/mcp/branding.js +0 -8
- package/dist/mcp/branding.js.map +0 -1
- package/dist/mcp/hostedServer.d.ts +0 -27
- package/dist/mcp/hostedServer.d.ts.map +0 -1
- package/dist/mcp/hostedServer.js +0 -71
- package/dist/mcp/hostedServer.js.map +0 -1
- package/dist/mcp/httpServer.d.ts +0 -63
- package/dist/mcp/httpServer.d.ts.map +0 -1
- package/dist/mcp/httpServer.js +0 -602
- package/dist/mcp/httpServer.js.map +0 -1
- package/dist/mcp/instructions.d.ts +0 -25
- package/dist/mcp/instructions.d.ts.map +0 -1
- package/dist/mcp/instructions.js +0 -39
- package/dist/mcp/instructions.js.map +0 -1
- package/dist/mcp/integrations/tools.d.ts +0 -19
- package/dist/mcp/integrations/tools.d.ts.map +0 -1
- package/dist/mcp/integrations/tools.js +0 -101
- package/dist/mcp/integrations/tools.js.map +0 -1
- package/dist/mcp/server.d.ts +0 -214
- package/dist/mcp/server.d.ts.map +0 -1
- package/dist/mcp/server.js +0 -2536
- package/dist/mcp/server.js.map +0 -1
- package/dist/mcp/toolAnalytics.d.ts +0 -26
- package/dist/mcp/toolAnalytics.d.ts.map +0 -1
- package/dist/mcp/toolAnalytics.js +0 -95
- package/dist/mcp/toolAnalytics.js.map +0 -1
- package/dist/mcp/types.d.ts +0 -7
- package/dist/mcp/types.d.ts.map +0 -1
- package/dist/mcp/types.js +0 -3
- package/dist/mcp/types.js.map +0 -1
- package/dist/mcp/watchLoopResumePrompt.d.ts +0 -16
- package/dist/mcp/watchLoopResumePrompt.d.ts.map +0 -1
- package/dist/mcp/watchLoopResumePrompt.js +0 -21
- package/dist/mcp/watchLoopResumePrompt.js.map +0 -1
- package/dist/prompts/agentModPrompts.d.ts +0 -4
- package/dist/prompts/agentModPrompts.d.ts.map +0 -1
- package/dist/prompts/agentModPrompts.js +0 -34
- package/dist/prompts/agentModPrompts.js.map +0 -1
- package/dist/prompts/tokenWriterPrompts.d.ts +0 -4
- package/dist/prompts/tokenWriterPrompts.d.ts.map +0 -1
- package/dist/prompts/tokenWriterPrompts.js +0 -59
- package/dist/prompts/tokenWriterPrompts.js.map +0 -1
- package/dist/routes/comments.d.ts +0 -3
- package/dist/routes/comments.d.ts.map +0 -1
- package/dist/routes/comments.js +0 -113
- package/dist/routes/comments.js.map +0 -1
- package/dist/routes/components.d.ts +0 -7
- package/dist/routes/components.d.ts.map +0 -1
- package/dist/routes/components.js +0 -88
- package/dist/routes/components.js.map +0 -1
- package/dist/routes/controls.d.ts +0 -7
- package/dist/routes/controls.d.ts.map +0 -1
- package/dist/routes/controls.js +0 -50
- package/dist/routes/controls.js.map +0 -1
- package/dist/routes/design.d.ts +0 -2
- package/dist/routes/design.d.ts.map +0 -1
- package/dist/routes/design.js +0 -29
- package/dist/routes/design.js.map +0 -1
- package/dist/routes/modifications.d.ts +0 -10
- package/dist/routes/modifications.d.ts.map +0 -1
- package/dist/routes/modifications.js +0 -394
- package/dist/routes/modifications.js.map +0 -1
- package/dist/routes/tokens.d.ts +0 -2
- package/dist/routes/tokens.d.ts.map +0 -1
- package/dist/routes/tokens.js +0 -115
- package/dist/routes/tokens.js.map +0 -1
- package/dist/services/AgentSessionService.d.ts +0 -91
- package/dist/services/AgentSessionService.d.ts.map +0 -1
- package/dist/services/AgentSessionService.js +0 -282
- package/dist/services/AgentSessionService.js.map +0 -1
- package/dist/services/BridgeBatchPipeline.d.ts +0 -103
- package/dist/services/BridgeBatchPipeline.d.ts.map +0 -1
- package/dist/services/BridgeBatchPipeline.js +0 -295
- package/dist/services/BridgeBatchPipeline.js.map +0 -1
- package/dist/services/BridgeQueueStore.d.ts +0 -28
- package/dist/services/BridgeQueueStore.d.ts.map +0 -1
- package/dist/services/BridgeQueueStore.js +0 -88
- package/dist/services/BridgeQueueStore.js.map +0 -1
- package/dist/services/CSSTokenWriter.d.ts +0 -22
- package/dist/services/CSSTokenWriter.d.ts.map +0 -1
- package/dist/services/CSSTokenWriter.js +0 -116
- package/dist/services/CSSTokenWriter.js.map +0 -1
- package/dist/services/DesignTokenService.d.ts +0 -39
- package/dist/services/DesignTokenService.d.ts.map +0 -1
- package/dist/services/DesignTokenService.js +0 -100
- package/dist/services/DesignTokenService.js.map +0 -1
- package/dist/services/InlineVariantGenerationService.d.ts +0 -51
- package/dist/services/InlineVariantGenerationService.d.ts.map +0 -1
- package/dist/services/InlineVariantGenerationService.js +0 -475
- package/dist/services/InlineVariantGenerationService.js.map +0 -1
- package/dist/services/InterfaceGenerationService.d.ts +0 -12
- package/dist/services/InterfaceGenerationService.d.ts.map +0 -1
- package/dist/services/InterfaceGenerationService.js +0 -256
- package/dist/services/InterfaceGenerationService.js.map +0 -1
- package/dist/services/TailwindConfigWriter.d.ts +0 -24
- package/dist/services/TailwindConfigWriter.d.ts.map +0 -1
- package/dist/services/TailwindConfigWriter.js +0 -105
- package/dist/services/TailwindConfigWriter.js.map +0 -1
- package/dist/services/TerminalAgentRunner.d.ts +0 -65
- package/dist/services/TerminalAgentRunner.d.ts.map +0 -1
- package/dist/services/TerminalAgentRunner.js +0 -511
- package/dist/services/TerminalAgentRunner.js.map +0 -1
- package/dist/services/VisualVariantAgentRunner.d.ts +0 -20
- package/dist/services/VisualVariantAgentRunner.d.ts.map +0 -1
- package/dist/services/VisualVariantAgentRunner.js +0 -66
- package/dist/services/VisualVariantAgentRunner.js.map +0 -1
- package/dist/services/adapters/TailwindCSSTokenAdapter.d.ts +0 -35
- package/dist/services/adapters/TailwindCSSTokenAdapter.d.ts.map +0 -1
- package/dist/services/adapters/TailwindCSSTokenAdapter.js +0 -278
- package/dist/services/adapters/TailwindCSSTokenAdapter.js.map +0 -1
- package/dist/services/agent/AgentCore.d.ts +0 -126
- package/dist/services/agent/AgentCore.d.ts.map +0 -1
- package/dist/services/agent/AgentCore.js +0 -759
- package/dist/services/agent/AgentCore.js.map +0 -1
- package/dist/services/agent/AgentModService.d.ts +0 -98
- package/dist/services/agent/AgentModService.d.ts.map +0 -1
- package/dist/services/agent/AgentModService.js +0 -400
- package/dist/services/agent/AgentModService.js.map +0 -1
- package/dist/services/agent/index.d.ts +0 -2
- package/dist/services/agent/index.d.ts.map +0 -1
- package/dist/services/agent/index.js +0 -6
- package/dist/services/agent/index.js.map +0 -1
- package/dist/types/editor-interface-types.d.ts +0 -67
- package/dist/types/editor-interface-types.d.ts.map +0 -1
- package/dist/types/editor-interface-types.js +0 -12
- package/dist/types/editor-interface-types.js.map +0 -1
- package/dist/utils/elementRefToContext.d.ts +0 -4
- package/dist/utils/elementRefToContext.d.ts.map +0 -1
- package/dist/utils/elementRefToContext.js +0 -63
- package/dist/utils/elementRefToContext.js.map +0 -1
- package/dist/utils/skills/shared-variants-protocol.d.ts +0 -69
- package/dist/utils/skills/shared-variants-protocol.d.ts.map +0 -1
- package/dist/utils/skills/shared-variants-protocol.js +0 -292
- package/dist/utils/skills/shared-variants-protocol.js.map +0 -1
- package/src/ui/dist/assets/main-CLAqO1bm.js +0 -656
- package/src/ui/dist/assets/main-Ke-Q9lWa.css +0 -1
- /package/dist/{mcp/agent-variants → agent-variants}/briefContent.d.ts +0 -0
- /package/dist/{mcp/agent-variants → agent-variants}/briefContent.js +0 -0
- /package/dist/{mcp/agent-variants → agent-variants}/createProjectArtifacts.d.ts +0 -0
- /package/dist/{mcp/agent-variants → agent-variants}/createProjectArtifacts.js +0 -0
- /package/dist/{mcp/agent-variants → agent-variants}/diffQa.d.ts +0 -0
- /package/dist/{mcp/agent-variants → agent-variants}/diffQa.js +0 -0
- /package/dist/{mcp/agent-variants → agent-variants}/elementRefToTarget.js +0 -0
- /package/dist/{mcp/agent-variants → agent-variants}/errors.d.ts +0 -0
- /package/dist/{mcp/agent-variants → agent-variants}/errors.js +0 -0
- /package/dist/{mcp/agent-variants → agent-variants}/previewQa.d.ts +0 -0
- /package/dist/{mcp/agent-variants → agent-variants}/previewQa.js +0 -0
- /package/dist/{mcp/agent-variants → agent-variants}/runLabel.d.ts +0 -0
- /package/dist/{mcp/agent-variants → agent-variants}/runLabel.js +0 -0
- /package/dist/{mcp/agent-variants → agent-variants}/runPlan.d.ts +0 -0
- /package/dist/{mcp/agent-variants → agent-variants}/runPlan.js +0 -0
- /package/dist/{mcp/agent-variants → agent-variants}/sourceContext.d.ts +0 -0
- /package/dist/{mcp/agent-variants → agent-variants}/sourceContext.js +0 -0
- /package/dist/{mcp/agent-variants → agent-variants}/variantContext.d.ts +0 -0
- /package/dist/{mcp/agent-variants → agent-variants}/variantContext.js +0 -0
|
@@ -12,23 +12,54 @@ const os_1 = __importDefault(require("os"));
|
|
|
12
12
|
const path_1 = __importDefault(require("path"));
|
|
13
13
|
const child_process_1 = require("child_process");
|
|
14
14
|
const simple_git_1 = require("simple-git");
|
|
15
|
-
const logger_1 = require("
|
|
16
|
-
const devServerError_1 = require("
|
|
15
|
+
const logger_1 = require("../utils/logger");
|
|
16
|
+
const devServerError_1 = require("../utils/devServerError");
|
|
17
17
|
const errors_1 = require("./errors");
|
|
18
18
|
const createProjectArtifacts_1 = require("./createProjectArtifacts");
|
|
19
19
|
const contracts_1 = require("./contracts");
|
|
20
20
|
const briefContent_1 = require("./briefContent");
|
|
21
21
|
const runLabel_1 = require("./runLabel");
|
|
22
22
|
const runPlan_1 = require("./runPlan");
|
|
23
|
-
const viteReactTs_1 = require("
|
|
24
|
-
const StaticPreviewServer_1 = require("
|
|
25
|
-
const designCatalog_1 = require("
|
|
23
|
+
const viteReactTs_1 = require("../services/templates/viteReactTs");
|
|
24
|
+
const StaticPreviewServer_1 = require("../services/StaticPreviewServer");
|
|
25
|
+
const designCatalog_1 = require("../services/templates/designCatalog");
|
|
26
26
|
const previewQa_1 = require("./previewQa");
|
|
27
27
|
const diffQa_1 = require("./diffQa");
|
|
28
|
-
const VariantHistoryService_1 = require("
|
|
28
|
+
const VariantHistoryService_1 = require("../services/VariantHistoryService");
|
|
29
29
|
const variantContext_1 = require("./variantContext");
|
|
30
30
|
const log = (0, logger_1.createLogger)('AgentVariantsOrchestrator');
|
|
31
31
|
const FRESH_DEV_SERVER_HOST = '127.0.0.1';
|
|
32
|
+
const BRIEF_LABEL_MAX_LENGTH = 48;
|
|
33
|
+
const GENERIC_BRIEF_LABELS = new Set([
|
|
34
|
+
'variant',
|
|
35
|
+
'direction',
|
|
36
|
+
'option',
|
|
37
|
+
'untitled',
|
|
38
|
+
]);
|
|
39
|
+
const DIRECTIONAL_BRIEF_LABELS = [
|
|
40
|
+
'Refined Focus',
|
|
41
|
+
'Bold Contrast',
|
|
42
|
+
'Airy Layout',
|
|
43
|
+
'Editorial Polish',
|
|
44
|
+
'Playful Accent',
|
|
45
|
+
'Calm Minimal',
|
|
46
|
+
'Dense Utility',
|
|
47
|
+
'Sharp Detail',
|
|
48
|
+
];
|
|
49
|
+
const BRIEF_LABEL_ALTERNATIVES = [
|
|
50
|
+
'Focus',
|
|
51
|
+
'Contrast',
|
|
52
|
+
'Layout',
|
|
53
|
+
'Editorial',
|
|
54
|
+
'Accent',
|
|
55
|
+
'Minimal',
|
|
56
|
+
'Utility',
|
|
57
|
+
'Detail',
|
|
58
|
+
'Motion',
|
|
59
|
+
'Depth',
|
|
60
|
+
'Density',
|
|
61
|
+
'Color',
|
|
62
|
+
];
|
|
32
63
|
// Upper bound on waiting for in-flight history persists during session
|
|
33
64
|
// teardown. Generous enough for a full-repo snapshot on a large project;
|
|
34
65
|
// small enough that a wedged git subprocess (which has its own 120s block
|
|
@@ -62,6 +93,18 @@ const PROVISION_TIMEOUT_MS = (() => {
|
|
|
62
93
|
? parsed
|
|
63
94
|
: DEFAULT_PROVISION_TIMEOUT_MS;
|
|
64
95
|
})();
|
|
96
|
+
// Active variant dev servers are useful only while the Rivet app is being used.
|
|
97
|
+
// Reclaim them after app/API silence so abandoned sessions do not pin one child
|
|
98
|
+
// process per succeeded variant forever. The session state and worktrees stay
|
|
99
|
+
// intact; only live preview ports are cleared.
|
|
100
|
+
const DEFAULT_ACTIVE_VARIANT_SERVER_IDLE_TTL_MS = 30 * 60 * 1000;
|
|
101
|
+
const ACTIVE_VARIANT_SERVER_IDLE_TTL_MS = (() => {
|
|
102
|
+
const raw = process.env.RIVET_ACTIVE_VARIANT_SERVER_IDLE_TTL_MS;
|
|
103
|
+
const parsed = raw ? Number.parseInt(raw, 10) : NaN;
|
|
104
|
+
return Number.isFinite(parsed) && parsed > 0
|
|
105
|
+
? parsed
|
|
106
|
+
: DEFAULT_ACTIVE_VARIANT_SERVER_IDLE_TTL_MS;
|
|
107
|
+
})();
|
|
65
108
|
/** Sentinel so callers can distinguish a provisioning timeout from other errors. */
|
|
66
109
|
class ProvisionTimeoutError extends Error {
|
|
67
110
|
timeoutMs;
|
|
@@ -311,6 +354,64 @@ const DESIGN_CREATION_ACTION_RE = /\b(create|build|design|make|redesign|refresh|
|
|
|
311
354
|
const DESIGN_CREATION_SURFACE_RE = /\b(home\s?page|landing page|dashboard|screen|site|website|app|page|ui|interface|component|hero)\b/i;
|
|
312
355
|
const NON_VISUAL_CHANGE_RE = /\b(api|backend|database|event|lint|query|server|test|tracking|typecheck)\b/i;
|
|
313
356
|
const DIFF_CAPTURE_FAILURE_SUMMARY = 'Unable to verify the generated design diff; regenerate this variant so Rivet can confirm source changes.';
|
|
357
|
+
const briefLabelKey = (value) => value.trim().toLowerCase().replace(/\s+/g, ' ');
|
|
358
|
+
const truncateBriefLabel = (value) => {
|
|
359
|
+
const normalized = value.trim().replace(/\s+/g, ' ');
|
|
360
|
+
if (normalized.length <= BRIEF_LABEL_MAX_LENGTH) {
|
|
361
|
+
return normalized;
|
|
362
|
+
}
|
|
363
|
+
return `${normalized.slice(0, BRIEF_LABEL_MAX_LENGTH - 1).trimEnd()}…`;
|
|
364
|
+
};
|
|
365
|
+
const suffixFromGenericLabel = (label, slotIndex) => {
|
|
366
|
+
const words = label.trim().split(/\s+/).filter(Boolean);
|
|
367
|
+
return (words[words.length - 1] ??
|
|
368
|
+
BRIEF_LABEL_ALTERNATIVES[slotIndex % BRIEF_LABEL_ALTERNATIVES.length]);
|
|
369
|
+
};
|
|
370
|
+
const makeSpecificBriefLabel = (args) => {
|
|
371
|
+
const label = truncateBriefLabel(args.label);
|
|
372
|
+
if (!GENERIC_BRIEF_LABELS.has(briefLabelKey(label))) {
|
|
373
|
+
return label;
|
|
374
|
+
}
|
|
375
|
+
return truncateBriefLabel(`${args.runLabel} ${suffixFromGenericLabel(label, args.slotIndex)}`);
|
|
376
|
+
};
|
|
377
|
+
const firstUnusedDirectionalBriefLabel = (slotIndex, usedLabels) => {
|
|
378
|
+
for (let offset = 0; offset < DIRECTIONAL_BRIEF_LABELS.length; offset++) {
|
|
379
|
+
const candidate = truncateBriefLabel(DIRECTIONAL_BRIEF_LABELS[(slotIndex + offset) % DIRECTIONAL_BRIEF_LABELS.length]);
|
|
380
|
+
if (!usedLabels.has(briefLabelKey(candidate))) {
|
|
381
|
+
return candidate;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
return null;
|
|
385
|
+
};
|
|
386
|
+
const uniquifyBriefLabel = (args) => {
|
|
387
|
+
const preferred = makeSpecificBriefLabel(args);
|
|
388
|
+
if (!args.usedLabels.has(briefLabelKey(preferred))) {
|
|
389
|
+
args.usedLabels.add(briefLabelKey(preferred));
|
|
390
|
+
return preferred;
|
|
391
|
+
}
|
|
392
|
+
const directional = firstUnusedDirectionalBriefLabel(args.slotIndex, args.usedLabels);
|
|
393
|
+
if (directional) {
|
|
394
|
+
args.usedLabels.add(briefLabelKey(directional));
|
|
395
|
+
return directional;
|
|
396
|
+
}
|
|
397
|
+
for (let offset = 0; offset < BRIEF_LABEL_ALTERNATIVES.length; offset++) {
|
|
398
|
+
const alternative = BRIEF_LABEL_ALTERNATIVES[(args.slotIndex + offset) % BRIEF_LABEL_ALTERNATIVES.length];
|
|
399
|
+
const candidate = truncateBriefLabel(`${args.runLabel} ${alternative}`);
|
|
400
|
+
if (!args.usedLabels.has(briefLabelKey(candidate))) {
|
|
401
|
+
args.usedLabels.add(briefLabelKey(candidate));
|
|
402
|
+
return candidate;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
let suffix = 2;
|
|
406
|
+
while (true) {
|
|
407
|
+
const candidate = truncateBriefLabel(`${args.runLabel} ${suffix}`);
|
|
408
|
+
if (!args.usedLabels.has(briefLabelKey(candidate))) {
|
|
409
|
+
args.usedLabels.add(briefLabelKey(candidate));
|
|
410
|
+
return candidate;
|
|
411
|
+
}
|
|
412
|
+
suffix += 1;
|
|
413
|
+
}
|
|
414
|
+
};
|
|
314
415
|
const buildDiffCaptureFailureQa = (detail, message) => ({
|
|
315
416
|
status: 'failed',
|
|
316
417
|
issues: [
|
|
@@ -334,20 +435,18 @@ const isDesignCreationCodeGenInput = (input, prompt) => {
|
|
|
334
435
|
};
|
|
335
436
|
/**
|
|
336
437
|
* Wraps SessionStore for the operations that have side effects: approve
|
|
337
|
-
* (provision worktrees), reportComplete (capture diff
|
|
338
|
-
*
|
|
339
|
-
*
|
|
438
|
+
* (provision worktrees), reportComplete (capture diff), commit (apply picked
|
|
439
|
+
* output), cancel (teardown). Pure read paths bypass and call SessionStore
|
|
440
|
+
* directly.
|
|
340
441
|
*
|
|
341
442
|
* This is the terminal-native variant of the orchestrator: the user picks
|
|
342
443
|
* a single brief upfront, so there's only ever one code-gen item per
|
|
343
444
|
* session and no live preview / proxy retarget. Once the agent reports
|
|
344
|
-
* the variant succeeded, the
|
|
345
|
-
* pick step.
|
|
445
|
+
* the variant succeeded, the CLI can commit the chosen output directly.
|
|
346
446
|
*/
|
|
347
447
|
class AgentVariantsOrchestrator {
|
|
348
448
|
store;
|
|
349
449
|
worktrees;
|
|
350
|
-
adapter;
|
|
351
450
|
resolveEnv;
|
|
352
451
|
telemetry;
|
|
353
452
|
installDependencies;
|
|
@@ -358,6 +457,7 @@ class AgentVariantsOrchestrator {
|
|
|
358
457
|
variantHistory;
|
|
359
458
|
startStaticPreviewServerImpl;
|
|
360
459
|
provisionTimeoutMs;
|
|
460
|
+
activeVariantServerIdleTtlMs;
|
|
361
461
|
resources = new Map();
|
|
362
462
|
/**
|
|
363
463
|
* Committed dev servers from prior sessions that survived teardown. The
|
|
@@ -388,7 +488,6 @@ class AgentVariantsOrchestrator {
|
|
|
388
488
|
constructor(deps) {
|
|
389
489
|
this.store = deps.store;
|
|
390
490
|
this.worktrees = deps.worktreeManager;
|
|
391
|
-
this.adapter = deps.pendingChangesAdapter;
|
|
392
491
|
this.resolveEnv = deps.resolveProjectEnvironment;
|
|
393
492
|
this.telemetry = deps.telemetry ?? NOOP_TELEMETRY;
|
|
394
493
|
this.installDependencies =
|
|
@@ -402,6 +501,8 @@ class AgentVariantsOrchestrator {
|
|
|
402
501
|
this.startStaticPreviewServerImpl =
|
|
403
502
|
deps.startStaticPreviewServer ?? StaticPreviewServer_1.startStaticPreviewServer;
|
|
404
503
|
this.provisionTimeoutMs = deps.provisionTimeoutMs ?? PROVISION_TIMEOUT_MS;
|
|
504
|
+
this.activeVariantServerIdleTtlMs =
|
|
505
|
+
deps.activeVariantServerIdleTtlMs ?? ACTIVE_VARIANT_SERVER_IDLE_TTL_MS;
|
|
405
506
|
}
|
|
406
507
|
// --- Pure delegations (no side effects) ---------------------------------
|
|
407
508
|
propose(args) {
|
|
@@ -414,6 +515,7 @@ class AgentVariantsOrchestrator {
|
|
|
414
515
|
const result = this.store.propose(args);
|
|
415
516
|
this.activeSessionId = result.sessionId;
|
|
416
517
|
this.ensureResources(result.sessionId);
|
|
518
|
+
this.touchSession(result.sessionId);
|
|
417
519
|
const projectContext = args.projectContext ?? { kind: 'existing' };
|
|
418
520
|
const mode = this.getVariantsTelemetryMode(projectContext, args.target);
|
|
419
521
|
this.startVariantsRound({
|
|
@@ -483,6 +585,7 @@ class AgentVariantsOrchestrator {
|
|
|
483
585
|
registerUiClient() {
|
|
484
586
|
this.uiClientCount += 1;
|
|
485
587
|
this.lastUiClientActivityAt = Date.now();
|
|
588
|
+
this.touchActiveSession();
|
|
486
589
|
let released = false;
|
|
487
590
|
return () => {
|
|
488
591
|
if (released)
|
|
@@ -502,6 +605,19 @@ class AgentVariantsOrchestrator {
|
|
|
502
605
|
return (Date.now() - this.lastUiClientActivityAt <
|
|
503
606
|
AgentVariantsOrchestrator.UI_CLIENT_GRACE_MS);
|
|
504
607
|
}
|
|
608
|
+
/** @effect Records activity for the current variants session, if one exists. */
|
|
609
|
+
touchActiveSession() {
|
|
610
|
+
if (!this.activeSessionId)
|
|
611
|
+
return;
|
|
612
|
+
this.touchSession(this.activeSessionId);
|
|
613
|
+
}
|
|
614
|
+
/** @effect Resets idle cleanup for active variant preview servers. */
|
|
615
|
+
touchSession(sessionId) {
|
|
616
|
+
const resources = this.resources.get(sessionId);
|
|
617
|
+
if (!resources || resources.cleanupStarted)
|
|
618
|
+
return;
|
|
619
|
+
this.scheduleActivePreviewIdleTimer(resources);
|
|
620
|
+
}
|
|
505
621
|
/** Build the snapshot the chip cares about. Reads from SessionStore +
|
|
506
622
|
* per-resource state; safe to call at any time. */
|
|
507
623
|
buildActiveSnapshot() {
|
|
@@ -525,6 +641,7 @@ class AgentVariantsOrchestrator {
|
|
|
525
641
|
? projectContext.workspacePath
|
|
526
642
|
: undefined;
|
|
527
643
|
const artifacts = buildSessionArtifacts(sessionId, sessionProjectContext);
|
|
644
|
+
const hostWork = this.getHostWork(sessionId);
|
|
528
645
|
return {
|
|
529
646
|
active: true,
|
|
530
647
|
sessionId,
|
|
@@ -536,8 +653,21 @@ class AgentVariantsOrchestrator {
|
|
|
536
653
|
projectContext,
|
|
537
654
|
...(destinationPath ? { destinationPath } : {}),
|
|
538
655
|
...(artifacts.length > 0 ? { artifacts } : {}),
|
|
656
|
+
...(hostWork.length > 0 ? { hostWork } : {}),
|
|
539
657
|
};
|
|
540
658
|
}
|
|
659
|
+
getHostWork(sessionId) {
|
|
660
|
+
return this.store.getHostWork(sessionId).map((item) => {
|
|
661
|
+
const worktreePath = this.getWorktreePath(sessionId, item.workId);
|
|
662
|
+
const baseInput = item.input && typeof item.input === 'object'
|
|
663
|
+
? item.input
|
|
664
|
+
: {};
|
|
665
|
+
return {
|
|
666
|
+
...item,
|
|
667
|
+
input: { ...baseInput, worktreePath },
|
|
668
|
+
};
|
|
669
|
+
});
|
|
670
|
+
}
|
|
541
671
|
getVariantsTelemetryMode(projectContext, _target) {
|
|
542
672
|
if (projectContext.kind === 'fresh' && projectContext.variantContext) {
|
|
543
673
|
return 'source_grounded';
|
|
@@ -739,6 +869,7 @@ class AgentVariantsOrchestrator {
|
|
|
739
869
|
}
|
|
740
870
|
emitChange() {
|
|
741
871
|
try {
|
|
872
|
+
this.touchActiveSession();
|
|
742
873
|
this.events.emit('change', this.buildActiveSnapshot());
|
|
743
874
|
}
|
|
744
875
|
catch (err) {
|
|
@@ -1150,6 +1281,22 @@ class AgentVariantsOrchestrator {
|
|
|
1150
1281
|
return false;
|
|
1151
1282
|
}
|
|
1152
1283
|
}
|
|
1284
|
+
/**
|
|
1285
|
+
* Resolve the history source for a forked Vary row. If the immediate parent
|
|
1286
|
+
* is an adopted past direction, collapse against that original history row;
|
|
1287
|
+
* otherwise collapse against the same-session parent variant.
|
|
1288
|
+
*/
|
|
1289
|
+
resolveHistoryParentVariant(sessionId, sourceVariantId) {
|
|
1290
|
+
if (!sourceVariantId)
|
|
1291
|
+
return undefined;
|
|
1292
|
+
try {
|
|
1293
|
+
const sourceInput = this.store.getWorkItemInput(sessionId, sourceVariantId);
|
|
1294
|
+
return (sourceInput?.adoptedFrom ?? { sessionId, variantId: sourceVariantId });
|
|
1295
|
+
}
|
|
1296
|
+
catch {
|
|
1297
|
+
return { sessionId, variantId: sourceVariantId };
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1153
1300
|
getVariantPick(sessionId) {
|
|
1154
1301
|
return this.store.getVariantPick(sessionId);
|
|
1155
1302
|
}
|
|
@@ -1346,6 +1493,33 @@ class AgentVariantsOrchestrator {
|
|
|
1346
1493
|
getDevServerPort(sessionId, workItemId) {
|
|
1347
1494
|
return this.resources.get(sessionId)?.worktrees.get(workItemId)?.port;
|
|
1348
1495
|
}
|
|
1496
|
+
/**
|
|
1497
|
+
* @effect Resolves the dev server port for a preview request and refreshes
|
|
1498
|
+
* active-preview retention for that session while the port is still live.
|
|
1499
|
+
*/
|
|
1500
|
+
resolveDevServerPortForPreview(sessionId, workItemId) {
|
|
1501
|
+
const port = this.getDevServerPort(sessionId, workItemId);
|
|
1502
|
+
if (typeof port === 'number') {
|
|
1503
|
+
this.touchSession(sessionId);
|
|
1504
|
+
}
|
|
1505
|
+
return port;
|
|
1506
|
+
}
|
|
1507
|
+
/**
|
|
1508
|
+
* True work-item kind for a variant, or undefined when the session/item is
|
|
1509
|
+
* unknown. This is the authoritative routing signal for Vary/refine intakes:
|
|
1510
|
+
* an existing-project `code_gen` variant materialized as a static preview
|
|
1511
|
+
* (registerExistingStaticPreview) DISPLAYS as `static_artifact` and serves
|
|
1512
|
+
* HTML, but must fork via the code_gen/worktree path — HTML presence is not
|
|
1513
|
+
* a valid discriminator.
|
|
1514
|
+
*/
|
|
1515
|
+
getVariantWorkItemKind(sessionId, workItemId) {
|
|
1516
|
+
try {
|
|
1517
|
+
return this.store.getWorkItemKind(sessionId, workItemId);
|
|
1518
|
+
}
|
|
1519
|
+
catch {
|
|
1520
|
+
return undefined;
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
1349
1523
|
getStaticPreviewHtml(sessionId, workItemId) {
|
|
1350
1524
|
// Primary: read the materialized index.html from the variant's per-variant
|
|
1351
1525
|
// directory (written by handleSucceededReport). The directory is the source
|
|
@@ -1523,6 +1697,11 @@ class AgentVariantsOrchestrator {
|
|
|
1523
1697
|
count,
|
|
1524
1698
|
briefs: args.briefs,
|
|
1525
1699
|
uniqueBriefIds: Boolean(appendSessionId),
|
|
1700
|
+
existingLabels: appendSessionId
|
|
1701
|
+
? this.store
|
|
1702
|
+
.getVariants(appendSessionId)
|
|
1703
|
+
.map((variant) => variant.label)
|
|
1704
|
+
: [],
|
|
1526
1705
|
});
|
|
1527
1706
|
let sessionId;
|
|
1528
1707
|
let variantIds;
|
|
@@ -1537,12 +1716,14 @@ class AgentVariantsOrchestrator {
|
|
|
1537
1716
|
? { variantContext: projectContext.variantContext }
|
|
1538
1717
|
: {}),
|
|
1539
1718
|
};
|
|
1540
|
-
const { createdWorkItemIds } =
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1719
|
+
const { createdWorkItemIds } = this.store.appendCodeGenVariants({
|
|
1720
|
+
...forkArgs,
|
|
1721
|
+
// Fork parent (Vary on a variant): seeds each new worktree from the
|
|
1722
|
+
// parent's tree instead of the base tree. Absent for a plain append.
|
|
1723
|
+
...(args.sourceVariantId
|
|
1724
|
+
? { sourceVariantId: args.sourceVariantId }
|
|
1725
|
+
: {}),
|
|
1726
|
+
});
|
|
1546
1727
|
variantIds = createdWorkItemIds;
|
|
1547
1728
|
this.startVariantsRound({
|
|
1548
1729
|
sessionId,
|
|
@@ -1665,31 +1846,42 @@ class AgentVariantsOrchestrator {
|
|
|
1665
1846
|
};
|
|
1666
1847
|
}
|
|
1667
1848
|
/**
|
|
1668
|
-
* Build the per-variant briefs for a unified start.
|
|
1669
|
-
*
|
|
1670
|
-
*
|
|
1671
|
-
*
|
|
1672
|
-
*
|
|
1673
|
-
* batch's briefIds can't collide with
|
|
1849
|
+
* Build the per-variant briefs for a unified start. Supplied briefs keep
|
|
1850
|
+
* meaningful direction labels, while duplicate or empty labels are made
|
|
1851
|
+
* unique against the visible session rows. The fallback derives a short
|
|
1852
|
+
* run-intent label from the prompt (e.g. "make it brighter" →
|
|
1853
|
+
* "Brighter 1/2/…") rather than an indistinct "Variant N". `uniqueBriefIds`
|
|
1854
|
+
* is set for the append path so the new batch's briefIds can't collide with
|
|
1855
|
+
* the live session's existing ones.
|
|
1674
1856
|
*/
|
|
1675
1857
|
buildUnifiedBriefs(args) {
|
|
1676
1858
|
const briefId = (i) => args.uniqueBriefIds ? `v-${(0, crypto_1.randomUUID)().slice(0, 8)}` : `v${i + 1}`;
|
|
1859
|
+
const runLabel = args.runLabel?.trim() || (0, runLabel_1.deriveRunLabel)(args.prompt);
|
|
1860
|
+
const usedLabels = new Set((args.existingLabels ?? []).map(briefLabelKey));
|
|
1861
|
+
const withUniqueLabel = (brief, slotIndex) => ({
|
|
1862
|
+
...brief,
|
|
1863
|
+
label: uniquifyBriefLabel({
|
|
1864
|
+
label: brief.label,
|
|
1865
|
+
runLabel,
|
|
1866
|
+
slotIndex,
|
|
1867
|
+
usedLabels,
|
|
1868
|
+
}),
|
|
1869
|
+
});
|
|
1677
1870
|
if (args.briefs) {
|
|
1678
|
-
return args.briefs.map((b, i) => (0, briefContent_1.normalizeBriefContent)({
|
|
1871
|
+
return args.briefs.map((b, i) => withUniqueLabel((0, briefContent_1.normalizeBriefContent)({
|
|
1679
1872
|
briefId: briefId(i),
|
|
1680
1873
|
label: b.label,
|
|
1681
1874
|
body: b.body,
|
|
1682
1875
|
...(b.visualReferenceUrl
|
|
1683
1876
|
? { visualReferenceUrl: b.visualReferenceUrl }
|
|
1684
1877
|
: {}),
|
|
1685
|
-
}));
|
|
1878
|
+
}), i));
|
|
1686
1879
|
}
|
|
1687
|
-
|
|
1688
|
-
return Array.from({ length: args.count }, (_, i) => ({
|
|
1880
|
+
return Array.from({ length: args.count }, (_, i) => withUniqueLabel({
|
|
1689
1881
|
briefId: briefId(i),
|
|
1690
1882
|
label: args.count > 1 ? `${runLabel} ${i + 1}` : runLabel,
|
|
1691
1883
|
body: synthesizeUnifiedBriefBody(args.prompt, i + 1, args.count),
|
|
1692
|
-
}));
|
|
1884
|
+
}, i));
|
|
1693
1885
|
}
|
|
1694
1886
|
/**
|
|
1695
1887
|
* The active sessionId IF it is an existing-project session for `projectPath`
|
|
@@ -2099,10 +2291,10 @@ class AgentVariantsOrchestrator {
|
|
|
2099
2291
|
};
|
|
2100
2292
|
}
|
|
2101
2293
|
/**
|
|
2102
|
-
* User has reviewed the rendered variants
|
|
2103
|
-
*
|
|
2104
|
-
*
|
|
2105
|
-
*
|
|
2294
|
+
* User has reviewed the rendered variants and picked one. Look up the
|
|
2295
|
+
* captured diff or generated project, apply it to the destination, and record
|
|
2296
|
+
* the pick. Idempotent on (sessionId, variantId): repeating the call returns
|
|
2297
|
+
* duplicate=true without applying again.
|
|
2106
2298
|
*/
|
|
2107
2299
|
async commitVariant(args) {
|
|
2108
2300
|
// Serialize per-session so two overlapping commits can't both run
|
|
@@ -2144,13 +2336,11 @@ class AgentVariantsOrchestrator {
|
|
|
2144
2336
|
// without going back through resources (which may have been torn down).
|
|
2145
2337
|
const existingPick = this.store.getVariantPick(args.sessionId);
|
|
2146
2338
|
if (existingPick && existingPick.variantId === args.variantId) {
|
|
2147
|
-
// Retry-safe history flip. If the first commit attempt
|
|
2148
|
-
// successfully but the history-persist task crashed
|
|
2149
|
-
//
|
|
2150
|
-
//
|
|
2151
|
-
//
|
|
2152
|
-
// terminal-status guard in `markStatus` makes this safely
|
|
2153
|
-
// idempotent.
|
|
2339
|
+
// Retry-safe history flip. If the first commit attempt applied
|
|
2340
|
+
// successfully but the history-persist task crashed, the chosen variant
|
|
2341
|
+
// stays at `completed` instead of `committed` on disk. Re-run the flip on
|
|
2342
|
+
// every duplicate attempt; the terminal-status guard in `markStatus`
|
|
2343
|
+
// makes this safely idempotent.
|
|
2154
2344
|
const projectContext = this.store.getProjectContext(args.sessionId);
|
|
2155
2345
|
let historyProjectPath;
|
|
2156
2346
|
if (projectContext.kind === 'fresh') {
|
|
@@ -2526,10 +2716,8 @@ class AgentVariantsOrchestrator {
|
|
|
2526
2716
|
throw new errors_1.AgentVariantsError('INVALID_STAGE_ACTION', `Variant ${args.variantId} has no captured diff yet — wait for report_variant_complete(succeeded) first`);
|
|
2527
2717
|
}
|
|
2528
2718
|
changedFilesCount = countDiffFiles(record.diff);
|
|
2529
|
-
// Apply the diff to the user's working tree
|
|
2530
|
-
//
|
|
2531
|
-
// enqueued the diff for an agent to apply; non-MCP sessions had no
|
|
2532
|
-
// agent and the variant was effectively lost.
|
|
2719
|
+
// Apply the diff to the user's working tree so the variant lands on the
|
|
2720
|
+
// current branch uncommitted.
|
|
2533
2721
|
if (!this.worktrees.applyDiffToProject) {
|
|
2534
2722
|
throw new errors_1.AgentVariantsError('RUNTIME_VALIDATION_FAILED', 'WorktreeManager does not support applying diffs to the project tree');
|
|
2535
2723
|
}
|
|
@@ -2584,7 +2772,6 @@ class AgentVariantsOrchestrator {
|
|
|
2584
2772
|
catch (err) {
|
|
2585
2773
|
log.warn(`persistVariantHistoryAtCommit failed for session ${args.sessionId}`, err);
|
|
2586
2774
|
}
|
|
2587
|
-
const enqueueResult = this.adapter.enqueue(envelope);
|
|
2588
2775
|
resources.committedVariantIds.add(args.variantId);
|
|
2589
2776
|
// For fresh `new-project` commits the committed variant IS the user's
|
|
2590
2777
|
// final result — there's no dev server to fall back to. Keep the session
|
|
@@ -2610,7 +2797,7 @@ class AgentVariantsOrchestrator {
|
|
|
2610
2797
|
isFresh: projectContext.kind === 'fresh',
|
|
2611
2798
|
});
|
|
2612
2799
|
this.emitChange();
|
|
2613
|
-
log.info(`Variant ${args.variantId} (${input.briefLabel}) committed by user
|
|
2800
|
+
log.info(`Variant ${args.variantId} (${input.briefLabel}) committed by user`);
|
|
2614
2801
|
if (!args.skipTeardown) {
|
|
2615
2802
|
// Once a variant is committed, the unpicked worktrees are no longer
|
|
2616
2803
|
// useful. Schedule teardown in the background so the agent's
|
|
@@ -2620,8 +2807,8 @@ class AgentVariantsOrchestrator {
|
|
|
2620
2807
|
});
|
|
2621
2808
|
}
|
|
2622
2809
|
return {
|
|
2623
|
-
enqueued:
|
|
2624
|
-
duplicate:
|
|
2810
|
+
enqueued: true,
|
|
2811
|
+
duplicate: false,
|
|
2625
2812
|
changedFilesCount,
|
|
2626
2813
|
payloadKind: payload.kind,
|
|
2627
2814
|
destinationPath: envelopeDestination,
|
|
@@ -3249,6 +3436,7 @@ class AgentVariantsOrchestrator {
|
|
|
3249
3436
|
durationMs: Date.now() - previewStartedAt,
|
|
3250
3437
|
});
|
|
3251
3438
|
log.info(`Variant ${args.workItemId} dev server up on port ${port} (worktree ${args.record.worktreePath}; cmd: ${dev.cmd} ${dev.args.join(' ')})`);
|
|
3439
|
+
this.touchSession(args.sessionId);
|
|
3252
3440
|
return port;
|
|
3253
3441
|
}
|
|
3254
3442
|
catch (err) {
|
|
@@ -3676,6 +3864,7 @@ class AgentVariantsOrchestrator {
|
|
|
3676
3864
|
snapshotDir,
|
|
3677
3865
|
baseDir,
|
|
3678
3866
|
serve,
|
|
3867
|
+
parentVariant: this.resolveHistoryParentVariant(args.sessionId, input.sourceVariantId),
|
|
3679
3868
|
});
|
|
3680
3869
|
}
|
|
3681
3870
|
/**
|
|
@@ -3913,6 +4102,7 @@ class AgentVariantsOrchestrator {
|
|
|
3913
4102
|
designSource: designArtifact?.source,
|
|
3914
4103
|
snapshotDir: sourceDir,
|
|
3915
4104
|
serve,
|
|
4105
|
+
parentVariant: this.resolveHistoryParentVariant(args.sessionId, input.sourceVariantId),
|
|
3916
4106
|
});
|
|
3917
4107
|
}
|
|
3918
4108
|
finally {
|
|
@@ -4437,6 +4627,7 @@ class AgentVariantsOrchestrator {
|
|
|
4437
4627
|
* stub dirs at the old paths.
|
|
4438
4628
|
*/
|
|
4439
4629
|
async stopAllDevServersForSession(resources) {
|
|
4630
|
+
this.clearActivePreviewIdleTimer(resources);
|
|
4440
4631
|
const stops = [];
|
|
4441
4632
|
for (const record of resources.worktrees.values()) {
|
|
4442
4633
|
if (!record.devServerProcess)
|
|
@@ -4449,6 +4640,56 @@ class AgentVariantsOrchestrator {
|
|
|
4449
4640
|
record.port = undefined;
|
|
4450
4641
|
}
|
|
4451
4642
|
await Promise.all(stops);
|
|
4643
|
+
return stops.length;
|
|
4644
|
+
}
|
|
4645
|
+
scheduleActivePreviewIdleTimer(resources) {
|
|
4646
|
+
if (!Number.isFinite(this.activeVariantServerIdleTtlMs) ||
|
|
4647
|
+
this.activeVariantServerIdleTtlMs <= 0) {
|
|
4648
|
+
return;
|
|
4649
|
+
}
|
|
4650
|
+
this.clearActivePreviewIdleTimer(resources);
|
|
4651
|
+
resources.activePreviewIdleTimer = setTimeout(() => {
|
|
4652
|
+
resources.activePreviewIdleTimer = undefined;
|
|
4653
|
+
void this.stopIdleVariantDevServers(resources.sessionId);
|
|
4654
|
+
}, this.activeVariantServerIdleTtlMs);
|
|
4655
|
+
resources.activePreviewIdleTimer.unref?.();
|
|
4656
|
+
}
|
|
4657
|
+
clearActivePreviewIdleTimer(resources) {
|
|
4658
|
+
if (!resources.activePreviewIdleTimer)
|
|
4659
|
+
return;
|
|
4660
|
+
clearTimeout(resources.activePreviewIdleTimer);
|
|
4661
|
+
resources.activePreviewIdleTimer = undefined;
|
|
4662
|
+
}
|
|
4663
|
+
/** @effect Stops idle variant child processes and clears dead preview ports. */
|
|
4664
|
+
async stopIdleVariantDevServers(sessionId) {
|
|
4665
|
+
const resources = this.resources.get(sessionId);
|
|
4666
|
+
if (!resources || resources.cleanupStarted)
|
|
4667
|
+
return;
|
|
4668
|
+
if (resources.activePreviewIdleStop) {
|
|
4669
|
+
await resources.activePreviewIdleStop;
|
|
4670
|
+
return;
|
|
4671
|
+
}
|
|
4672
|
+
const stop = (async () => {
|
|
4673
|
+
const stoppedCount = await this.stopAllDevServersForSession(resources);
|
|
4674
|
+
if (stoppedCount === 0)
|
|
4675
|
+
return;
|
|
4676
|
+
log.info(`Stopped ${stoppedCount} idle variant dev server(s) for session ${sessionId}`);
|
|
4677
|
+
// Keep the current behavior bounded: expired previews become unavailable
|
|
4678
|
+
// until fresh generation or another path explicitly starts servers again.
|
|
4679
|
+
try {
|
|
4680
|
+
this.switchPreviewPort?.(null);
|
|
4681
|
+
}
|
|
4682
|
+
catch (err) {
|
|
4683
|
+
log.warn(`switchPreviewPort(null) after idle variant server cleanup failed for ${sessionId}`, err);
|
|
4684
|
+
}
|
|
4685
|
+
this.emitChange();
|
|
4686
|
+
})().finally(() => {
|
|
4687
|
+
if (resources.activePreviewIdleStop === stop) {
|
|
4688
|
+
resources.activePreviewIdleStop = undefined;
|
|
4689
|
+
}
|
|
4690
|
+
});
|
|
4691
|
+
resources.activePreviewIdleStop = stop;
|
|
4692
|
+
await stop;
|
|
4452
4693
|
}
|
|
4453
4694
|
/**
|
|
4454
4695
|
* Spawn a fresh dev server at the user-facing destinationPath and retarget
|
|
@@ -4551,6 +4792,7 @@ class AgentVariantsOrchestrator {
|
|
|
4551
4792
|
if (resources.cleanupStarted)
|
|
4552
4793
|
return;
|
|
4553
4794
|
resources.cleanupStarted = true;
|
|
4795
|
+
this.clearActivePreviewIdleTimer(resources);
|
|
4554
4796
|
log.info(`Tearing down session ${sessionId} (reason: ${reason})`);
|
|
4555
4797
|
// Drain in-flight history persists BEFORE deleting worktrees: a tree
|
|
4556
4798
|
// snapshot's `git add -A --work-tree <worktree>` racing the deletion
|