rivet-design 0.17.4 → 0.18.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 +0 -16
- package/dist/agent-variants/SessionStore.d.ts +5 -240
- package/dist/agent-variants/SessionStore.d.ts.map +1 -1
- package/dist/agent-variants/SessionStore.js +42 -371
- package/dist/agent-variants/SessionStore.js.map +1 -1
- package/dist/agent-variants/VariantWorkspaceManager.d.ts +0 -10
- package/dist/agent-variants/VariantWorkspaceManager.d.ts.map +1 -1
- package/dist/agent-variants/VariantWorkspaceManager.js +0 -17
- package/dist/agent-variants/VariantWorkspaceManager.js.map +1 -1
- package/dist/agent-variants/WorkerExecutorService.d.ts +1 -105
- package/dist/agent-variants/WorkerExecutorService.d.ts.map +1 -1
- package/dist/agent-variants/WorkerExecutorService.js +11 -182
- package/dist/agent-variants/WorkerExecutorService.js.map +1 -1
- package/dist/agent-variants/WorktreeOrchestrator.d.ts +6 -598
- package/dist/agent-variants/WorktreeOrchestrator.d.ts.map +1 -1
- package/dist/agent-variants/WorktreeOrchestrator.js +55 -1288
- package/dist/agent-variants/WorktreeOrchestrator.js.map +1 -1
- package/dist/agent-variants/WorktreeOrchestrator.testHelpers.d.ts +0 -6
- package/dist/agent-variants/WorktreeOrchestrator.testHelpers.d.ts.map +1 -1
- package/dist/agent-variants/WorktreeOrchestrator.testHelpers.js +0 -23
- package/dist/agent-variants/WorktreeOrchestrator.testHelpers.js.map +1 -1
- package/dist/agent-variants/briefContent.d.ts +0 -11
- package/dist/agent-variants/briefContent.d.ts.map +1 -1
- package/dist/agent-variants/briefContent.js +0 -12
- package/dist/agent-variants/briefContent.js.map +1 -1
- package/dist/agent-variants/contextAssets.d.ts +0 -3
- package/dist/agent-variants/contextAssets.d.ts.map +1 -1
- package/dist/agent-variants/contextAssets.js +0 -3
- package/dist/agent-variants/contextAssets.js.map +1 -1
- package/dist/agent-variants/contracts.d.ts +2016 -600
- package/dist/agent-variants/contracts.d.ts.map +1 -1
- package/dist/agent-variants/contracts.js +10 -174
- package/dist/agent-variants/contracts.js.map +1 -1
- package/dist/agent-variants/createProjectArtifacts.d.ts +0 -17
- package/dist/agent-variants/createProjectArtifacts.d.ts.map +1 -1
- package/dist/agent-variants/createProjectArtifacts.js +0 -10
- package/dist/agent-variants/createProjectArtifacts.js.map +1 -1
- package/dist/agent-variants/diffQa.d.ts +0 -1
- package/dist/agent-variants/diffQa.d.ts.map +1 -1
- package/dist/agent-variants/diffQa.js +0 -1
- package/dist/agent-variants/diffQa.js.map +1 -1
- package/dist/agent-variants/directionAuthoring.d.ts +0 -13
- package/dist/agent-variants/directionAuthoring.d.ts.map +1 -1
- package/dist/agent-variants/directionAuthoring.js +12 -46
- package/dist/agent-variants/directionAuthoring.js.map +1 -1
- package/dist/agent-variants/elementRefToTarget.d.ts +0 -17
- package/dist/agent-variants/elementRefToTarget.d.ts.map +1 -1
- package/dist/agent-variants/elementRefToTarget.js +0 -17
- package/dist/agent-variants/elementRefToTarget.js.map +1 -1
- package/dist/agent-variants/generatedDestination.d.ts +0 -3
- package/dist/agent-variants/generatedDestination.d.ts.map +1 -1
- package/dist/agent-variants/generatedDestination.js +0 -3
- package/dist/agent-variants/generatedDestination.js.map +1 -1
- package/dist/agent-variants/previewQa.d.ts +0 -6
- package/dist/agent-variants/previewQa.d.ts.map +1 -1
- package/dist/agent-variants/previewQa.js +0 -5
- package/dist/agent-variants/previewQa.js.map +1 -1
- package/dist/agent-variants/runLabel.d.ts +0 -15
- package/dist/agent-variants/runLabel.d.ts.map +1 -1
- package/dist/agent-variants/runLabel.js +0 -19
- package/dist/agent-variants/runLabel.js.map +1 -1
- package/dist/agent-variants/runPlan.d.ts +3 -84
- package/dist/agent-variants/runPlan.d.ts.map +1 -1
- package/dist/agent-variants/runPlan.js +0 -51
- package/dist/agent-variants/runPlan.js.map +1 -1
- package/dist/agent-variants/sourceContext.d.ts +0 -10
- package/dist/agent-variants/sourceContext.d.ts.map +1 -1
- package/dist/agent-variants/sourceContext.js +0 -36
- package/dist/agent-variants/sourceContext.js.map +1 -1
- package/dist/agent-variants/variantContext.d.ts +6 -7
- package/dist/agent-variants/variantContext.d.ts.map +1 -1
- package/dist/agent-variants/variantContext.js +69 -10
- package/dist/agent-variants/variantContext.js.map +1 -1
- package/dist/agent-variants/videoKeyframes.d.ts +0 -7
- package/dist/agent-variants/videoKeyframes.d.ts.map +1 -1
- package/dist/agent-variants/videoKeyframes.js +0 -7
- package/dist/agent-variants/videoKeyframes.js.map +1 -1
- package/dist/agent-variants/workItemBriefing.d.ts +0 -21
- package/dist/agent-variants/workItemBriefing.d.ts.map +1 -1
- package/dist/agent-variants/workItemBriefing.js +0 -49
- package/dist/agent-variants/workItemBriefing.js.map +1 -1
- package/dist/agent-variants/workerRuntime.d.ts +1 -137
- package/dist/agent-variants/workerRuntime.d.ts.map +1 -1
- package/dist/agent-variants/workerRuntime.js +8 -147
- package/dist/agent-variants/workerRuntime.js.map +1 -1
- package/dist/cli/browser.d.ts +0 -1
- package/dist/cli/browser.d.ts.map +1 -1
- package/dist/cli/browser.js +0 -1
- package/dist/cli/browser.js.map +1 -1
- package/dist/cli/callerRunnerPaths.d.ts +0 -50
- package/dist/cli/callerRunnerPaths.d.ts.map +1 -1
- package/dist/cli/callerRunnerPaths.js +0 -59
- package/dist/cli/callerRunnerPaths.js.map +1 -1
- package/dist/cli/client.d.ts +0 -18
- package/dist/cli/client.d.ts.map +1 -1
- package/dist/cli/client.js +0 -28
- package/dist/cli/client.js.map +1 -1
- package/dist/cli/commandNames.d.ts +0 -7
- package/dist/cli/commandNames.d.ts.map +1 -1
- package/dist/cli/commandNames.js +1 -7
- package/dist/cli/commandNames.js.map +1 -1
- package/dist/cli/commands/auth.d.ts +0 -6
- package/dist/cli/commands/auth.d.ts.map +1 -1
- package/dist/cli/commands/auth.js +0 -6
- package/dist/cli/commands/auth.js.map +1 -1
- package/dist/cli/commands/elementSelector.d.ts +0 -6
- package/dist/cli/commands/elementSelector.d.ts.map +1 -1
- package/dist/cli/commands/elementSelector.js +0 -7
- package/dist/cli/commands/elementSelector.js.map +1 -1
- package/dist/cli/commands/evidence.d.ts +0 -6
- package/dist/cli/commands/evidence.d.ts.map +1 -1
- package/dist/cli/commands/evidence.js +0 -6
- package/dist/cli/commands/evidence.js.map +1 -1
- package/dist/cli/commands/libraryOpen.d.ts +0 -1
- package/dist/cli/commands/libraryOpen.d.ts.map +1 -1
- package/dist/cli/commands/libraryOpen.js +0 -4
- package/dist/cli/commands/libraryOpen.js.map +1 -1
- package/dist/cli/commands/mcpServe.d.ts +0 -24
- package/dist/cli/commands/mcpServe.d.ts.map +1 -1
- package/dist/cli/commands/mcpServe.js +126 -106
- package/dist/cli/commands/mcpServe.js.map +1 -1
- package/dist/cli/commands/open.d.ts +0 -8
- package/dist/cli/commands/open.d.ts.map +1 -1
- package/dist/cli/commands/open.js +0 -57
- package/dist/cli/commands/open.js.map +1 -1
- package/dist/cli/commands/profile.d.ts +3 -0
- package/dist/cli/commands/profile.d.ts.map +1 -0
- package/dist/cli/commands/profile.js +192 -0
- package/dist/cli/commands/profile.js.map +1 -0
- package/dist/cli/commands/reference.d.ts +0 -5
- package/dist/cli/commands/reference.d.ts.map +1 -1
- package/dist/cli/commands/reference.js +4 -27
- package/dist/cli/commands/reference.js.map +1 -1
- package/dist/cli/commands/serve.d.ts +0 -5
- package/dist/cli/commands/serve.d.ts.map +1 -1
- package/dist/cli/commands/serve.js +0 -34
- package/dist/cli/commands/serve.js.map +1 -1
- package/dist/cli/commands/shared.d.ts +0 -16
- package/dist/cli/commands/shared.d.ts.map +1 -1
- package/dist/cli/commands/shared.js +0 -19
- package/dist/cli/commands/shared.js.map +1 -1
- package/dist/cli/commands/status.d.ts +0 -6
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +0 -11
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/stop.d.ts +0 -5
- package/dist/cli/commands/stop.d.ts.map +1 -1
- package/dist/cli/commands/stop.js +0 -6
- package/dist/cli/commands/stop.js.map +1 -1
- package/dist/cli/commands/update.d.ts +0 -1
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/update.js +0 -1
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/variants.d.ts +0 -1
- package/dist/cli/commands/variants.d.ts.map +1 -1
- package/dist/cli/commands/variants.js +13 -32
- package/dist/cli/commands/variants.js.map +1 -1
- package/dist/cli/commands/wait.d.ts +0 -21
- package/dist/cli/commands/wait.d.ts.map +1 -1
- package/dist/cli/commands/wait.js +0 -23
- package/dist/cli/commands/wait.js.map +1 -1
- package/dist/cli/entry.d.ts +0 -10
- package/dist/cli/entry.d.ts.map +1 -1
- package/dist/cli/entry.js +0 -13
- package/dist/cli/entry.js.map +1 -1
- package/dist/cli/envelope.d.ts +1 -25
- package/dist/cli/envelope.d.ts.map +1 -1
- package/dist/cli/envelope.js +0 -19
- package/dist/cli/envelope.js.map +1 -1
- package/dist/cli/flags.d.ts +0 -7
- package/dist/cli/flags.d.ts.map +1 -1
- package/dist/cli/flags.js +0 -7
- package/dist/cli/flags.js.map +1 -1
- package/dist/cli/handoff.d.ts +0 -33
- package/dist/cli/handoff.d.ts.map +1 -1
- package/dist/cli/handoff.js +0 -42
- package/dist/cli/handoff.js.map +1 -1
- package/dist/cli/handoffStore.d.ts +0 -11
- package/dist/cli/handoffStore.d.ts.map +1 -1
- package/dist/cli/handoffStore.js +0 -10
- package/dist/cli/handoffStore.js.map +1 -1
- package/dist/cli/hostWorkNextAction.d.ts +0 -11
- package/dist/cli/hostWorkNextAction.d.ts.map +1 -1
- package/dist/cli/hostWorkNextAction.js +0 -4
- package/dist/cli/hostWorkNextAction.js.map +1 -1
- package/dist/cli/io.d.ts +0 -9
- package/dist/cli/io.d.ts.map +1 -1
- package/dist/cli/io.js +0 -1
- package/dist/cli/io.js.map +1 -1
- package/dist/cli/resolveDefaultNodeEnv.d.ts +0 -5
- package/dist/cli/resolveDefaultNodeEnv.d.ts.map +1 -1
- package/dist/cli/resolveDefaultNodeEnv.js +0 -5
- package/dist/cli/resolveDefaultNodeEnv.js.map +1 -1
- package/dist/cli/router.d.ts +0 -21
- package/dist/cli/router.d.ts.map +1 -1
- package/dist/cli/router.js +8 -46
- package/dist/cli/router.js.map +1 -1
- package/dist/cli/runnerSelection.d.ts +0 -58
- package/dist/cli/runnerSelection.d.ts.map +1 -1
- package/dist/cli/runnerSelection.js +0 -16
- package/dist/cli/runnerSelection.js.map +1 -1
- package/dist/cli/serverHandshake.d.ts +0 -36
- package/dist/cli/serverHandshake.d.ts.map +1 -1
- package/dist/cli/serverHandshake.js +0 -29
- package/dist/cli/serverHandshake.js.map +1 -1
- package/dist/cli/serverUnavailable.d.ts +0 -1
- package/dist/cli/serverUnavailable.d.ts.map +1 -1
- package/dist/cli/serverUnavailable.js +0 -1
- package/dist/cli/serverUnavailable.js.map +1 -1
- package/dist/cli/serverVersion.d.ts +0 -22
- package/dist/cli/serverVersion.d.ts.map +1 -1
- package/dist/cli/serverVersion.js +0 -12
- package/dist/cli/serverVersion.js.map +1 -1
- package/dist/cli/telemetry.d.ts +0 -4
- package/dist/cli/telemetry.d.ts.map +1 -1
- package/dist/cli/telemetry.js +0 -4
- package/dist/cli/telemetry.js.map +1 -1
- package/dist/config/evaluateFlags.d.ts +0 -4
- package/dist/config/evaluateFlags.d.ts.map +1 -1
- package/dist/config/evaluateFlags.js +0 -11
- package/dist/config/evaluateFlags.js.map +1 -1
- package/dist/config/featureFlagUserKey.d.ts +0 -3
- package/dist/config/featureFlagUserKey.d.ts.map +1 -1
- package/dist/config/featureFlagUserKey.js +0 -3
- package/dist/config/featureFlagUserKey.js.map +1 -1
- package/dist/config/flags.d.ts +0 -14
- package/dist/config/flags.d.ts.map +1 -1
- package/dist/config/flags.js +0 -27
- package/dist/config/flags.js.map +1 -1
- package/dist/config/proxy.d.ts +0 -3
- package/dist/config/proxy.d.ts.map +1 -1
- package/dist/config/proxy.js +0 -11
- package/dist/config/proxy.js.map +1 -1
- package/dist/config/telemetry.d.ts +0 -13
- package/dist/config/telemetry.d.ts.map +1 -1
- package/dist/config/telemetry.js +0 -13
- package/dist/config/telemetry.js.map +1 -1
- package/dist/config/telemetryContract.d.ts +0 -1
- package/dist/config/telemetryContract.d.ts.map +1 -1
- package/dist/config/telemetryContract.js +0 -1
- package/dist/config/telemetryContract.js.map +1 -1
- package/dist/hosts/workerDefaults.d.ts +0 -69
- package/dist/hosts/workerDefaults.d.ts.map +1 -1
- package/dist/hosts/workerDefaults.js +0 -68
- package/dist/hosts/workerDefaults.js.map +1 -1
- package/dist/index-core.d.ts.map +1 -1
- package/dist/index-core.js +0 -2
- package/dist/index-core.js.map +1 -1
- package/dist/index.d.ts +0 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -105
- package/dist/index.js.map +1 -1
- package/dist/install/allowlists.d.ts +0 -32
- package/dist/install/allowlists.d.ts.map +1 -1
- package/dist/install/allowlists.js +0 -44
- package/dist/install/allowlists.js.map +1 -1
- package/dist/install/automaticCliUpdate.d.ts +0 -6
- package/dist/install/automaticCliUpdate.d.ts.map +1 -1
- package/dist/install/automaticCliUpdate.js +0 -13
- package/dist/install/automaticCliUpdate.js.map +1 -1
- package/dist/install/channelCli.d.ts +0 -1
- package/dist/install/channelCli.d.ts.map +1 -1
- package/dist/install/channelCli.js +0 -3
- package/dist/install/channelCli.js.map +1 -1
- package/dist/install/channelManager.d.ts +0 -14
- package/dist/install/channelManager.d.ts.map +1 -1
- package/dist/install/channelManager.js +0 -22
- package/dist/install/channelManager.js.map +1 -1
- package/dist/install/codexGuidance.d.ts +0 -1
- package/dist/install/codexGuidance.d.ts.map +1 -1
- package/dist/install/codexGuidance.js +0 -7
- package/dist/install/codexGuidance.js.map +1 -1
- package/dist/install/globalBootstrap.d.ts +0 -25
- package/dist/install/globalBootstrap.d.ts.map +1 -1
- package/dist/install/globalBootstrap.js +0 -10
- package/dist/install/globalBootstrap.js.map +1 -1
- package/dist/install/harnesses.d.ts +0 -66
- package/dist/install/harnesses.d.ts.map +1 -1
- package/dist/install/harnesses.js +0 -60
- package/dist/install/harnesses.js.map +1 -1
- package/dist/install/installationChannel.d.ts +0 -1
- package/dist/install/installationChannel.d.ts.map +1 -1
- package/dist/install/installationChannel.js +0 -1
- package/dist/install/installationChannel.js.map +1 -1
- package/dist/install/legacyMcp.d.ts +0 -23
- package/dist/install/legacyMcp.d.ts.map +1 -1
- package/dist/install/legacyMcp.js +3 -46
- package/dist/install/legacyMcp.js.map +1 -1
- package/dist/install/mcpRegistration.d.ts +0 -41
- package/dist/install/mcpRegistration.d.ts.map +1 -1
- package/dist/install/mcpRegistration.js +2 -70
- package/dist/install/mcpRegistration.js.map +1 -1
- package/dist/library/HubClient.d.ts +1 -2
- package/dist/library/HubClient.d.ts.map +1 -1
- package/dist/library/HubClient.js +11 -5
- package/dist/library/HubClient.js.map +1 -1
- package/dist/library/HubServer.d.ts +0 -1
- package/dist/library/HubServer.d.ts.map +1 -1
- package/dist/library/HubServer.js +19 -1
- package/dist/library/HubServer.js.map +1 -1
- package/dist/library/StaticPreviewServer.d.ts +0 -1
- package/dist/library/StaticPreviewServer.d.ts.map +1 -1
- package/dist/library/StaticPreviewServer.js +0 -1
- package/dist/library/StaticPreviewServer.js.map +1 -1
- package/dist/library/http.d.ts +0 -2
- package/dist/library/http.d.ts.map +1 -1
- package/dist/library/http.js +0 -2
- package/dist/library/http.js.map +1 -1
- package/dist/library/importFiles.d.ts +0 -6
- package/dist/library/importFiles.d.ts.map +1 -1
- package/dist/library/importFiles.js +45 -11
- package/dist/library/importFiles.js.map +1 -1
- package/dist/mcp/changeBatchClassification.d.ts +0 -40
- package/dist/mcp/changeBatchClassification.d.ts.map +1 -1
- package/dist/mcp/changeBatchClassification.js +0 -34
- package/dist/mcp/changeBatchClassification.js.map +1 -1
- package/dist/prompts/commentVariationPrompts.d.ts +0 -5
- package/dist/prompts/commentVariationPrompts.d.ts.map +1 -1
- package/dist/prompts/commentVariationPrompts.js +0 -5
- package/dist/prompts/commentVariationPrompts.js.map +1 -1
- package/dist/prototype-host.js +0 -15
- package/dist/prototype-host.js.map +1 -1
- package/dist/proxy-middleware/preview-bridge.d.ts +0 -2
- package/dist/proxy-middleware/preview-bridge.d.ts.map +1 -1
- package/dist/proxy-middleware/preview-bridge.js +0 -2
- package/dist/proxy-middleware/preview-bridge.js.map +1 -1
- package/dist/proxy-middleware/preview-connections.d.ts +0 -1
- package/dist/proxy-middleware/preview-connections.d.ts.map +1 -1
- package/dist/proxy-middleware/preview-connections.js +0 -1
- package/dist/proxy-middleware/preview-connections.js.map +1 -1
- package/dist/proxy-middleware/proxy-config.d.ts +0 -12
- package/dist/proxy-middleware/proxy-config.d.ts.map +1 -1
- package/dist/proxy-middleware/proxy-config.js +2 -49
- package/dist/proxy-middleware/proxy-config.js.map +1 -1
- package/dist/routes/account.d.ts +0 -1
- package/dist/routes/account.d.ts.map +1 -1
- package/dist/routes/account.js +0 -2
- package/dist/routes/account.js.map +1 -1
- package/dist/routes/agentVariants.d.ts +0 -15
- package/dist/routes/agentVariants.d.ts.map +1 -1
- package/dist/routes/agentVariants.js +132 -329
- package/dist/routes/agentVariants.js.map +1 -1
- package/dist/routes/cli.d.ts +0 -17
- package/dist/routes/cli.d.ts.map +1 -1
- package/dist/routes/cli.js +0 -13
- package/dist/routes/cli.js.map +1 -1
- package/dist/routes/emptyStatePage.d.ts +0 -12
- package/dist/routes/emptyStatePage.d.ts.map +1 -1
- package/dist/routes/emptyStatePage.js +0 -12
- package/dist/routes/emptyStatePage.js.map +1 -1
- package/dist/routes/git.d.ts.map +1 -1
- package/dist/routes/git.js +0 -13
- package/dist/routes/git.js.map +1 -1
- package/dist/routes/inlineStartTracker.d.ts +0 -16
- package/dist/routes/inlineStartTracker.d.ts.map +1 -1
- package/dist/routes/inlineStartTracker.js.map +1 -1
- package/dist/routes/integrations.d.ts +0 -6
- package/dist/routes/integrations.d.ts.map +1 -1
- package/dist/routes/integrations.js +0 -6
- package/dist/routes/integrations.js.map +1 -1
- package/dist/routes/library/app.d.ts +0 -1
- package/dist/routes/library/app.d.ts.map +1 -1
- package/dist/routes/library/app.js +1 -3
- package/dist/routes/library/app.js.map +1 -1
- package/dist/routes/library/index.d.ts +0 -1
- package/dist/routes/library/index.d.ts.map +1 -1
- package/dist/routes/library/index.js +3 -1
- package/dist/routes/library/index.js.map +1 -1
- package/dist/routes/library/middleware.d.ts +0 -3
- package/dist/routes/library/middleware.d.ts.map +1 -1
- package/dist/routes/library/middleware.js +0 -4
- package/dist/routes/library/middleware.js.map +1 -1
- package/dist/routes/library/navigation.d.ts +0 -1
- package/dist/routes/library/navigation.d.ts.map +1 -1
- package/dist/routes/library/navigation.js +0 -1
- package/dist/routes/library/navigation.js.map +1 -1
- package/dist/routes/library/profiles.d.ts +5 -0
- package/dist/routes/library/profiles.d.ts.map +1 -0
- package/dist/routes/library/profiles.js +182 -0
- package/dist/routes/library/profiles.js.map +1 -0
- package/dist/routes/library/projects.d.ts +0 -1
- package/dist/routes/library/projects.d.ts.map +1 -1
- package/dist/routes/library/projects.js +0 -1
- package/dist/routes/library/projects.js.map +1 -1
- package/dist/routes/library/schemas.d.ts +2 -2
- package/dist/routes/library/staticPreview.d.ts +0 -1
- package/dist/routes/library/staticPreview.d.ts.map +1 -1
- package/dist/routes/library/staticPreview.js +0 -1
- package/dist/routes/library/staticPreview.js.map +1 -1
- package/dist/routes/library/types.d.ts +2 -0
- package/dist/routes/library/types.d.ts.map +1 -1
- package/dist/routes/library/variants.d.ts +0 -1
- package/dist/routes/library/variants.d.ts.map +1 -1
- package/dist/routes/library/variants.js +0 -1
- package/dist/routes/library/variants.js.map +1 -1
- package/dist/routes/mcp.d.ts +0 -3
- package/dist/routes/mcp.d.ts.map +1 -1
- package/dist/routes/mcp.js +0 -5
- package/dist/routes/mcp.js.map +1 -1
- package/dist/routes/prototypeHost.d.ts +0 -2
- package/dist/routes/prototypeHost.d.ts.map +1 -1
- package/dist/routes/prototypeHost.js +6 -32
- package/dist/routes/prototypeHost.js.map +1 -1
- package/dist/routes/static.d.ts +0 -3
- package/dist/routes/static.d.ts.map +1 -1
- package/dist/routes/static.js +0 -6
- package/dist/routes/static.js.map +1 -1
- package/dist/routes/support.d.ts +0 -3
- package/dist/routes/support.d.ts.map +1 -1
- package/dist/routes/support.js +0 -3
- package/dist/routes/support.js.map +1 -1
- package/dist/server.d.ts +0 -42
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +1 -129
- package/dist/server.js.map +1 -1
- package/dist/services/AuthService.d.ts +0 -76
- package/dist/services/AuthService.d.ts.map +1 -1
- package/dist/services/AuthService.js +0 -112
- package/dist/services/AuthService.js.map +1 -1
- package/dist/services/BrowserAgentClient.d.ts +1 -21
- package/dist/services/BrowserAgentClient.d.ts.map +1 -1
- package/dist/services/BrowserAgentClient.js +0 -10
- package/dist/services/BrowserAgentClient.js.map +1 -1
- package/dist/services/BundleStore.d.ts +0 -18
- package/dist/services/BundleStore.d.ts.map +1 -1
- package/dist/services/BundleStore.js +0 -10
- package/dist/services/BundleStore.js.map +1 -1
- package/dist/services/CliLogForwarder.d.ts +0 -26
- package/dist/services/CliLogForwarder.d.ts.map +1 -1
- package/dist/services/CliLogForwarder.js +1 -33
- package/dist/services/CliLogForwarder.js.map +1 -1
- package/dist/services/CommitMessageGenerator.d.ts +0 -6
- package/dist/services/CommitMessageGenerator.d.ts.map +1 -1
- package/dist/services/CommitMessageGenerator.js +0 -3
- package/dist/services/CommitMessageGenerator.js.map +1 -1
- package/dist/services/ComponentSearchService.d.ts +2 -16
- package/dist/services/ComponentSearchService.d.ts.map +1 -1
- package/dist/services/ComponentSearchService.js +2 -56
- package/dist/services/ComponentSearchService.js.map +1 -1
- package/dist/services/ConfigManager.d.ts +0 -113
- package/dist/services/ConfigManager.d.ts.map +1 -1
- package/dist/services/ConfigManager.js +0 -101
- package/dist/services/ConfigManager.js.map +1 -1
- package/dist/services/DependencyPreparationService.d.ts +0 -6
- package/dist/services/DependencyPreparationService.d.ts.map +1 -1
- package/dist/services/DependencyPreparationService.js +0 -22
- package/dist/services/DependencyPreparationService.js.map +1 -1
- package/dist/services/DevServerRuntimeService.d.ts +0 -20
- package/dist/services/DevServerRuntimeService.d.ts.map +1 -1
- package/dist/services/DevServerRuntimeService.js +0 -46
- package/dist/services/DevServerRuntimeService.js.map +1 -1
- package/dist/services/FeatureFlagService.d.ts +0 -15
- package/dist/services/FeatureFlagService.d.ts.map +1 -1
- package/dist/services/FeatureFlagService.js +0 -23
- package/dist/services/FeatureFlagService.js.map +1 -1
- package/dist/services/GatewayClient.d.ts +0 -27
- package/dist/services/GatewayClient.d.ts.map +1 -1
- package/dist/services/GatewayClient.js +0 -25
- package/dist/services/GatewayClient.js.map +1 -1
- package/dist/services/HistoryReplayService.d.ts +0 -31
- package/dist/services/HistoryReplayService.d.ts.map +1 -1
- package/dist/services/HistoryReplayService.js +2 -55
- package/dist/services/HistoryReplayService.js.map +1 -1
- package/dist/services/HubDiscovery.d.ts +0 -8
- package/dist/services/HubDiscovery.d.ts.map +1 -1
- package/dist/services/HubDiscovery.js +0 -8
- package/dist/services/HubDiscovery.js.map +1 -1
- package/dist/services/HubNavigation.d.ts +0 -6
- package/dist/services/HubNavigation.d.ts.map +1 -1
- package/dist/services/HubNavigation.js +5 -8
- package/dist/services/HubNavigation.js.map +1 -1
- package/dist/services/IntegrationsClient.d.ts +20 -38
- package/dist/services/IntegrationsClient.d.ts.map +1 -1
- package/dist/services/IntegrationsClient.js +71 -31
- package/dist/services/IntegrationsClient.js.map +1 -1
- package/dist/services/LocalGitService.d.ts +0 -57
- package/dist/services/LocalGitService.d.ts.map +1 -1
- package/dist/services/LocalGitService.js +4 -85
- package/dist/services/LocalGitService.js.map +1 -1
- package/dist/services/MCPOnboardingTelemetry.d.ts +0 -9
- package/dist/services/MCPOnboardingTelemetry.d.ts.map +1 -1
- package/dist/services/MCPOnboardingTelemetry.js +0 -9
- package/dist/services/MCPOnboardingTelemetry.js.map +1 -1
- package/dist/services/MCPVariantsTelemetry.d.ts +0 -2
- package/dist/services/MCPVariantsTelemetry.d.ts.map +1 -1
- package/dist/services/MCPVariantsTelemetry.js +0 -2
- package/dist/services/MCPVariantsTelemetry.js.map +1 -1
- package/dist/services/OperatingSystemServices.d.ts +0 -12
- package/dist/services/OperatingSystemServices.d.ts.map +1 -1
- package/dist/services/OperatingSystemServices.js +0 -7
- package/dist/services/OperatingSystemServices.js.map +1 -1
- package/dist/services/PRTitleGenerator.d.ts +0 -7
- package/dist/services/PRTitleGenerator.d.ts.map +1 -1
- package/dist/services/PRTitleGenerator.js +0 -3
- package/dist/services/PRTitleGenerator.js.map +1 -1
- package/dist/services/ProjectCardPreviews.d.ts +0 -5
- package/dist/services/ProjectCardPreviews.d.ts.map +1 -1
- package/dist/services/ProjectCardPreviews.js +0 -5
- package/dist/services/ProjectCardPreviews.js.map +1 -1
- package/dist/services/ProjectDetectionService.d.ts +0 -4
- package/dist/services/ProjectDetectionService.d.ts.map +1 -1
- package/dist/services/ProjectDetectionService.js +2 -44
- package/dist/services/ProjectDetectionService.js.map +1 -1
- package/dist/services/ProjectFolderPicker.d.ts +0 -3
- package/dist/services/ProjectFolderPicker.d.ts.map +1 -1
- package/dist/services/ProjectFolderPicker.js +0 -4
- package/dist/services/ProjectFolderPicker.js.map +1 -1
- package/dist/services/ProjectImport.d.ts +0 -1
- package/dist/services/ProjectImport.d.ts.map +1 -1
- package/dist/services/ProjectImport.js +0 -3
- package/dist/services/ProjectImport.js.map +1 -1
- package/dist/services/ProjectLibrary.d.ts +0 -18
- package/dist/services/ProjectLibrary.d.ts.map +1 -1
- package/dist/services/ProjectLibrary.js +0 -20
- package/dist/services/ProjectLibrary.js.map +1 -1
- package/dist/services/ProjectMetadataStore.d.ts +0 -73
- package/dist/services/ProjectMetadataStore.d.ts.map +1 -1
- package/dist/services/ProjectMetadataStore.js +0 -90
- package/dist/services/ProjectMetadataStore.js.map +1 -1
- package/dist/services/ProjectPackageManager.d.ts +0 -12
- package/dist/services/ProjectPackageManager.d.ts.map +1 -1
- package/dist/services/ProjectPackageManager.js +0 -16
- package/dist/services/ProjectPackageManager.js.map +1 -1
- package/dist/services/ProjectRegistry.d.ts +2 -18
- package/dist/services/ProjectRegistry.d.ts.map +1 -1
- package/dist/services/ProjectRegistry.js +0 -18
- package/dist/services/ProjectRegistry.js.map +1 -1
- package/dist/services/ProjectRuntimeService.d.ts +0 -4
- package/dist/services/ProjectRuntimeService.d.ts.map +1 -1
- package/dist/services/ProjectRuntimeService.js +0 -5
- package/dist/services/ProjectRuntimeService.js.map +1 -1
- package/dist/services/ProjectScreenshotService.d.ts +0 -5
- package/dist/services/ProjectScreenshotService.d.ts.map +1 -1
- package/dist/services/ProjectScreenshotService.js +0 -6
- package/dist/services/ProjectScreenshotService.js.map +1 -1
- package/dist/services/ProjectStorage.d.ts +0 -4
- package/dist/services/ProjectStorage.d.ts.map +1 -1
- package/dist/services/ProjectStorage.js +0 -4
- package/dist/services/ProjectStorage.js.map +1 -1
- package/dist/services/PrototypeBuildService.d.ts +1 -23
- package/dist/services/PrototypeBuildService.d.ts.map +1 -1
- package/dist/services/PrototypeBuildService.js +6 -31
- package/dist/services/PrototypeBuildService.js.map +1 -1
- package/dist/services/PrototypeDeployService.d.ts +0 -20
- package/dist/services/PrototypeDeployService.d.ts.map +1 -1
- package/dist/services/PrototypeDeployService.js +1 -24
- package/dist/services/PrototypeDeployService.js.map +1 -1
- package/dist/services/RequestAuthContext.d.ts +0 -5
- package/dist/services/RequestAuthContext.d.ts.map +1 -1
- package/dist/services/RequestAuthContext.js +0 -5
- package/dist/services/RequestAuthContext.js.map +1 -1
- package/dist/services/SessionBridgeService.d.ts.map +1 -1
- package/dist/services/SessionBridgeService.js +0 -2
- package/dist/services/SessionBridgeService.js.map +1 -1
- package/dist/services/SessionService.d.ts +0 -4
- package/dist/services/SessionService.d.ts.map +1 -1
- package/dist/services/SessionService.js +1 -22
- package/dist/services/SessionService.js.map +1 -1
- package/dist/services/StaticFileService.d.ts +0 -9
- package/dist/services/StaticFileService.d.ts.map +1 -1
- package/dist/services/StaticFileService.js +0 -11
- package/dist/services/StaticFileService.js.map +1 -1
- package/dist/services/StaticLibraryPreviews.d.ts +0 -3
- package/dist/services/StaticLibraryPreviews.d.ts.map +1 -1
- package/dist/services/StaticLibraryPreviews.js +0 -3
- package/dist/services/StaticLibraryPreviews.js.map +1 -1
- package/dist/services/StaticPreviewServer.d.ts +0 -16
- package/dist/services/StaticPreviewServer.d.ts.map +1 -1
- package/dist/services/StaticPreviewServer.js +2 -28
- package/dist/services/StaticPreviewServer.js.map +1 -1
- package/dist/services/SupabaseAuthService.d.ts +0 -11
- package/dist/services/SupabaseAuthService.d.ts.map +1 -1
- package/dist/services/SupabaseAuthService.js +0 -11
- package/dist/services/SupabaseAuthService.js.map +1 -1
- package/dist/services/SupportTicketService.d.ts +0 -4
- package/dist/services/SupportTicketService.d.ts.map +1 -1
- package/dist/services/SupportTicketService.js +0 -4
- package/dist/services/SupportTicketService.js.map +1 -1
- package/dist/services/TelemetryService.d.ts +9 -182
- package/dist/services/TelemetryService.d.ts.map +1 -1
- package/dist/services/TelemetryService.js +11 -195
- package/dist/services/TelemetryService.js.map +1 -1
- package/dist/services/TreeStore.d.ts +0 -72
- package/dist/services/TreeStore.d.ts.map +1 -1
- package/dist/services/TreeStore.js +0 -93
- package/dist/services/TreeStore.js.map +1 -1
- package/dist/services/VariantGenerationService.d.ts +1 -32
- package/dist/services/VariantGenerationService.d.ts.map +1 -1
- package/dist/services/VariantGenerationService.js +36 -66
- package/dist/services/VariantGenerationService.js.map +1 -1
- package/dist/services/VariantHistoryService.d.ts +12 -114
- package/dist/services/VariantHistoryService.d.ts.map +1 -1
- package/dist/services/VariantHistoryService.js +56 -144
- package/dist/services/VariantHistoryService.js.map +1 -1
- package/dist/services/VariantRunService.d.ts +6 -31
- package/dist/services/VariantRunService.d.ts.map +1 -1
- package/dist/services/VariantRunService.js +86 -37
- package/dist/services/VariantRunService.js.map +1 -1
- package/dist/services/VariantsRuntime.d.ts +0 -3
- package/dist/services/VariantsRuntime.d.ts.map +1 -1
- package/dist/services/VariantsRuntime.js +2 -5
- package/dist/services/VariantsRuntime.js.map +1 -1
- package/dist/services/WorktreeManager.d.ts +0 -217
- package/dist/services/WorktreeManager.d.ts.map +1 -1
- package/dist/services/WorktreeManager.js +3 -321
- package/dist/services/WorktreeManager.js.map +1 -1
- package/dist/services/accessTokenRefresh.d.ts +0 -25
- package/dist/services/accessTokenRefresh.d.ts.map +1 -1
- package/dist/services/accessTokenRefresh.js +0 -25
- package/dist/services/accessTokenRefresh.js.map +1 -1
- package/dist/services/adapters/TailwindTokenAdapter.d.ts +0 -29
- package/dist/services/adapters/TailwindTokenAdapter.d.ts.map +1 -1
- package/dist/services/adapters/TailwindTokenAdapter.js +1 -46
- package/dist/services/adapters/TailwindTokenAdapter.js.map +1 -1
- package/dist/services/createAgentVariantsOrchestrator.d.ts +0 -18
- package/dist/services/createAgentVariantsOrchestrator.d.ts.map +1 -1
- package/dist/services/createAgentVariantsOrchestrator.js +0 -22
- package/dist/services/createAgentVariantsOrchestrator.js.map +1 -1
- package/dist/services/extractors/CSSVariableExtractor.d.ts +0 -25
- package/dist/services/extractors/CSSVariableExtractor.d.ts.map +1 -1
- package/dist/services/extractors/CSSVariableExtractor.js +1 -42
- package/dist/services/extractors/CSSVariableExtractor.js.map +1 -1
- package/dist/services/historyRoots.d.ts +0 -12
- package/dist/services/historyRoots.d.ts.map +1 -1
- package/dist/services/historyRoots.js +0 -13
- package/dist/services/historyRoots.js.map +1 -1
- package/dist/services/libraryErrors.d.ts +0 -1
- package/dist/services/libraryErrors.d.ts.map +1 -1
- package/dist/services/libraryErrors.js +0 -1
- package/dist/services/libraryErrors.js.map +1 -1
- package/dist/services/pendingLogin.d.ts +0 -13
- package/dist/services/pendingLogin.d.ts.map +1 -1
- package/dist/services/pendingLogin.js +0 -3
- package/dist/services/pendingLogin.js.map +1 -1
- package/dist/services/profiles/DesignProfiles.d.ts +446 -0
- package/dist/services/profiles/DesignProfiles.d.ts.map +1 -0
- package/dist/services/profiles/DesignProfiles.js +552 -0
- package/dist/services/profiles/DesignProfiles.js.map +1 -0
- package/dist/services/profiles/MemoryModelService.d.ts +14 -0
- package/dist/services/profiles/MemoryModelService.d.ts.map +1 -0
- package/dist/services/profiles/MemoryModelService.js +113 -0
- package/dist/services/profiles/MemoryModelService.js.map +1 -0
- package/dist/services/profiles/MemoryRuntime.d.ts +26 -0
- package/dist/services/profiles/MemoryRuntime.d.ts.map +1 -0
- package/dist/services/profiles/MemoryRuntime.js +192 -0
- package/dist/services/profiles/MemoryRuntime.js.map +1 -0
- package/dist/services/profiles/ProfileAgent.d.ts +20 -0
- package/dist/services/profiles/ProfileAgent.d.ts.map +1 -0
- package/dist/services/profiles/ProfileAgent.js +196 -0
- package/dist/services/profiles/ProfileAgent.js.map +1 -0
- package/dist/services/profiles/ProfileAnalysis.d.ts +23 -0
- package/dist/services/profiles/ProfileAnalysis.d.ts.map +1 -0
- package/dist/services/profiles/ProfileAnalysis.js +114 -0
- package/dist/services/profiles/ProfileAnalysis.js.map +1 -0
- package/dist/services/profiles/ProfileImportSchedule.d.ts +15 -0
- package/dist/services/profiles/ProfileImportSchedule.d.ts.map +1 -0
- package/dist/services/profiles/ProfileImportSchedule.js +40 -0
- package/dist/services/profiles/ProfileImportSchedule.js.map +1 -0
- package/dist/services/profiles/ProfileImports.d.ts +47 -0
- package/dist/services/profiles/ProfileImports.d.ts.map +1 -0
- package/dist/services/profiles/ProfileImports.js +248 -0
- package/dist/services/profiles/ProfileImports.js.map +1 -0
- package/dist/services/profiles/ProfileIndex.d.ts +18 -0
- package/dist/services/profiles/ProfileIndex.d.ts.map +1 -0
- package/dist/services/profiles/ProfileIndex.js +119 -0
- package/dist/services/profiles/ProfileIndex.js.map +1 -0
- package/dist/services/profiles/ProfileMedia.d.ts +10 -0
- package/dist/services/profiles/ProfileMedia.d.ts.map +1 -0
- package/dist/services/profiles/ProfileMedia.js +76 -0
- package/dist/services/profiles/ProfileMedia.js.map +1 -0
- package/dist/services/profiles/ProfilePreparation.d.ts +17 -0
- package/dist/services/profiles/ProfilePreparation.d.ts.map +1 -0
- package/dist/services/profiles/ProfilePreparation.js +214 -0
- package/dist/services/profiles/ProfilePreparation.js.map +1 -0
- package/dist/services/profiles/ProfileVariants.d.ts +33 -0
- package/dist/services/profiles/ProfileVariants.d.ts.map +1 -0
- package/dist/services/profiles/ProfileVariants.js +129 -0
- package/dist/services/profiles/ProfileVariants.js.map +1 -0
- package/dist/services/profiles/analysisBatch.d.ts +53 -0
- package/dist/services/profiles/analysisBatch.d.ts.map +1 -0
- package/dist/services/profiles/analysisBatch.js +86 -0
- package/dist/services/profiles/analysisBatch.js.map +1 -0
- package/dist/services/profiles/boardPage.d.ts +12 -0
- package/dist/services/profiles/boardPage.d.ts.map +1 -0
- package/dist/services/profiles/boardPage.js +156 -0
- package/dist/services/profiles/boardPage.js.map +1 -0
- package/dist/services/profiles/engineAccess.d.ts +2 -0
- package/dist/services/profiles/engineAccess.d.ts.map +1 -0
- package/dist/services/profiles/engineAccess.js +55 -0
- package/dist/services/profiles/engineAccess.js.map +1 -0
- package/dist/services/profiles/memoryComponents.d.ts +7 -0
- package/dist/services/profiles/memoryComponents.d.ts.map +1 -0
- package/dist/services/profiles/memoryComponents.js +105 -0
- package/dist/services/profiles/memoryComponents.js.map +1 -0
- package/dist/services/profiles/modelContract.d.ts +14 -0
- package/dist/services/profiles/modelContract.d.ts.map +1 -0
- package/dist/services/profiles/modelContract.js +124 -0
- package/dist/services/profiles/modelContract.js.map +1 -0
- package/dist/services/profiles/nativeImages.d.ts +3 -0
- package/dist/services/profiles/nativeImages.d.ts.map +1 -0
- package/dist/services/profiles/nativeImages.js +72 -0
- package/dist/services/profiles/nativeImages.js.map +1 -0
- package/dist/services/profiles/profileAccount.d.ts +4 -0
- package/dist/services/profiles/profileAccount.d.ts.map +1 -0
- package/dist/services/profiles/profileAccount.js +21 -0
- package/dist/services/profiles/profileAccount.js.map +1 -0
- package/dist/services/profiles/profileContext.d.ts +18 -0
- package/dist/services/profiles/profileContext.d.ts.map +1 -0
- package/dist/services/profiles/profileContext.js +189 -0
- package/dist/services/profiles/profileContext.js.map +1 -0
- package/dist/services/profiles/profileEvidence.d.ts +3 -0
- package/dist/services/profiles/profileEvidence.d.ts.map +1 -0
- package/dist/services/profiles/profileEvidence.js +15 -0
- package/dist/services/profiles/profileEvidence.js.map +1 -0
- package/dist/services/profiles/profileQueries.d.ts +2 -0
- package/dist/services/profiles/profileQueries.d.ts.map +1 -0
- package/dist/services/profiles/profileQueries.js +23 -0
- package/dist/services/profiles/profileQueries.js.map +1 -0
- package/dist/services/profiles/profileSelection.d.ts +29 -0
- package/dist/services/profiles/profileSelection.d.ts.map +1 -0
- package/dist/services/profiles/profileSelection.js +43 -0
- package/dist/services/profiles/profileSelection.js.map +1 -0
- package/dist/services/profiles/xPage.d.ts +4 -0
- package/dist/services/profiles/xPage.d.ts.map +1 -0
- package/dist/services/profiles/xPage.js +58 -0
- package/dist/services/profiles/xPage.js.map +1 -0
- package/dist/services/referenceImages.d.ts +17 -0
- package/dist/services/referenceImages.d.ts.map +1 -0
- package/dist/services/referenceImages.js +138 -0
- package/dist/services/referenceImages.js.map +1 -0
- package/dist/services/staticProjectTarget.d.ts +0 -4
- package/dist/services/staticProjectTarget.d.ts.map +1 -1
- package/dist/services/staticProjectTarget.js +0 -4
- package/dist/services/staticProjectTarget.js.map +1 -1
- package/dist/services/staticStarter.d.ts +0 -20
- package/dist/services/staticStarter.d.ts.map +1 -1
- package/dist/services/staticStarter.js +0 -20
- package/dist/services/staticStarter.js.map +1 -1
- package/dist/services/templates/designCatalog.d.ts +0 -11
- package/dist/services/templates/designCatalog.d.ts.map +1 -1
- package/dist/services/templates/designCatalog.js +0 -26
- package/dist/services/templates/designCatalog.js.map +1 -1
- package/dist/services/templates/viteReactTs.d.ts +0 -26
- package/dist/services/templates/viteReactTs.d.ts.map +1 -1
- package/dist/services/templates/viteReactTs.js +0 -20
- package/dist/services/templates/viteReactTs.js.map +1 -1
- package/dist/storage/library/BundleMetadataStore.d.ts +0 -16
- package/dist/storage/library/BundleMetadataStore.d.ts.map +1 -1
- package/dist/storage/library/BundleMetadataStore.js +0 -17
- package/dist/storage/library/BundleMetadataStore.js.map +1 -1
- package/dist/storage/library/CoordinatorRecords.d.ts +0 -9
- package/dist/storage/library/CoordinatorRecords.d.ts.map +1 -1
- package/dist/storage/library/CoordinatorRecords.js +0 -9
- package/dist/storage/library/CoordinatorRecords.js.map +1 -1
- package/dist/storage/library/ProjectPreviewCache.d.ts +0 -4
- package/dist/storage/library/ProjectPreviewCache.d.ts.map +1 -1
- package/dist/storage/library/ProjectPreviewCache.js +0 -4
- package/dist/storage/library/ProjectPreviewCache.js.map +1 -1
- package/dist/storage/library/ProjectRecords.d.ts +0 -17
- package/dist/storage/library/ProjectRecords.d.ts.map +1 -1
- package/dist/storage/library/ProjectRecords.js +0 -17
- package/dist/storage/library/ProjectRecords.js.map +1 -1
- package/dist/storage/library/database.d.ts +0 -3
- package/dist/storage/library/database.d.ts.map +1 -1
- package/dist/storage/library/database.js +0 -3
- package/dist/storage/library/database.js.map +1 -1
- package/dist/storage/library/migrations.d.ts +0 -2
- package/dist/storage/library/migrations.d.ts.map +1 -1
- package/dist/storage/library/migrations.js +0 -2
- package/dist/storage/library/migrations.js.map +1 -1
- package/dist/storage/library/sourcePresentation.d.ts +0 -1
- package/dist/storage/library/sourcePresentation.d.ts.map +1 -1
- package/dist/storage/library/sourcePresentation.js +0 -1
- package/dist/storage/library/sourcePresentation.js.map +1 -1
- package/dist/storage/profiles/ProfileRecords.d.ts +199 -0
- package/dist/storage/profiles/ProfileRecords.d.ts.map +1 -0
- package/dist/storage/profiles/ProfileRecords.js +659 -0
- package/dist/storage/profiles/ProfileRecords.js.map +1 -0
- package/dist/storage/profiles/contextReceipts.d.ts +14 -0
- package/dist/storage/profiles/contextReceipts.d.ts.map +1 -0
- package/dist/storage/profiles/contextReceipts.js +52 -0
- package/dist/storage/profiles/contextReceipts.js.map +1 -0
- package/dist/storage/profiles/migrations.d.ts +4 -0
- package/dist/storage/profiles/migrations.d.ts.map +1 -0
- package/dist/storage/profiles/migrations.js +41 -0
- package/dist/storage/profiles/migrations.js.map +1 -0
- package/dist/storage/profiles/schema.d.ts +961 -0
- package/dist/storage/profiles/schema.d.ts.map +1 -0
- package/dist/storage/profiles/schema.js +102 -0
- package/dist/storage/profiles/schema.js.map +1 -0
- package/dist/storage/project-metadata/ProjectMetadataRecords.d.ts +0 -11
- package/dist/storage/project-metadata/ProjectMetadataRecords.d.ts.map +1 -1
- package/dist/storage/project-metadata/ProjectMetadataRecords.js +0 -13
- package/dist/storage/project-metadata/ProjectMetadataRecords.js.map +1 -1
- package/dist/storage/project-metadata/database.d.ts +0 -1
- package/dist/storage/project-metadata/database.d.ts.map +1 -1
- package/dist/storage/project-metadata/database.js +0 -7
- package/dist/storage/project-metadata/database.js.map +1 -1
- package/dist/storage/project-metadata/migrations.d.ts +0 -42
- package/dist/storage/project-metadata/migrations.d.ts.map +1 -1
- package/dist/storage/project-metadata/migrations.js +0 -41
- package/dist/storage/project-metadata/migrations.js.map +1 -1
- package/dist/types/account.d.ts +0 -1
- package/dist/types/account.d.ts.map +1 -1
- package/dist/types/change-request-types.d.ts +5 -167
- package/dist/types/change-request-types.d.ts.map +1 -1
- package/dist/types/change-types.d.ts +0 -1
- package/dist/types/change-types.d.ts.map +1 -1
- package/dist/types/change-types.js +0 -1
- package/dist/types/change-types.js.map +1 -1
- package/dist/types/design-profile.d.ts +570 -0
- package/dist/types/design-profile.d.ts.map +1 -0
- package/dist/types/design-profile.js +127 -0
- package/dist/types/design-profile.js.map +1 -0
- package/dist/types/project-library.d.ts +0 -1
- package/dist/types/project-library.d.ts.map +1 -1
- package/dist/types/style-manipulation-types.d.ts +0 -69
- package/dist/types/style-manipulation-types.d.ts.map +1 -1
- package/dist/types/style-manipulation-types.js +0 -26
- package/dist/types/style-manipulation-types.js.map +1 -1
- package/dist/types/token-types.d.ts +0 -30
- package/dist/types/token-types.d.ts.map +1 -1
- package/dist/types/token-types.js +0 -1
- package/dist/types/token-types.js.map +1 -1
- package/dist/types/variant-history.d.ts +3 -39
- package/dist/types/variant-history.d.ts.map +1 -1
- package/dist/types/variant-reference.d.ts +46 -0
- package/dist/types/variant-reference.d.ts.map +1 -0
- package/dist/types/variant-reference.js +58 -0
- package/dist/types/variant-reference.js.map +1 -0
- package/dist/types/x-bookmarks.d.ts +352 -0
- package/dist/types/x-bookmarks.d.ts.map +1 -0
- package/dist/types/x-bookmarks.js +56 -0
- package/dist/types/x-bookmarks.js.map +1 -0
- package/dist/utils/ProviderRateLimit.d.ts +7 -0
- package/dist/utils/ProviderRateLimit.d.ts.map +1 -0
- package/dist/utils/ProviderRateLimit.js +36 -0
- package/dist/utils/ProviderRateLimit.js.map +1 -0
- package/dist/utils/branchNames.d.ts +0 -1
- package/dist/utils/branchNames.d.ts.map +1 -1
- package/dist/utils/branchNames.js +0 -2
- package/dist/utils/branchNames.js.map +1 -1
- package/dist/utils/cloneOrCopyDirSync.d.ts +0 -12
- package/dist/utils/cloneOrCopyDirSync.d.ts.map +1 -1
- package/dist/utils/cloneOrCopyDirSync.js +0 -16
- package/dist/utils/cloneOrCopyDirSync.js.map +1 -1
- package/dist/utils/devServerCommand.d.ts +0 -23
- package/dist/utils/devServerCommand.d.ts.map +1 -1
- package/dist/utils/devServerCommand.js +0 -24
- package/dist/utils/devServerCommand.js.map +1 -1
- package/dist/utils/devServerError.d.ts +0 -16
- package/dist/utils/devServerError.d.ts.map +1 -1
- package/dist/utils/devServerError.js +0 -17
- package/dist/utils/devServerError.js.map +1 -1
- package/dist/utils/displayLocale.d.ts +0 -2
- package/dist/utils/displayLocale.d.ts.map +1 -1
- package/dist/utils/displayLocale.js +0 -2
- package/dist/utils/displayLocale.js.map +1 -1
- package/dist/utils/elementFileHintSignals.d.ts +0 -5
- package/dist/utils/elementFileHintSignals.d.ts.map +1 -1
- package/dist/utils/elementFileHintSignals.js +0 -5
- package/dist/utils/elementFileHintSignals.js.map +1 -1
- package/dist/utils/formatElementTargetingContext.d.ts +0 -6
- package/dist/utils/formatElementTargetingContext.d.ts.map +1 -1
- package/dist/utils/formatElementTargetingContext.js +3 -9
- package/dist/utils/formatElementTargetingContext.js.map +1 -1
- package/dist/utils/hostAgentEnv.d.ts +0 -17
- package/dist/utils/hostAgentEnv.d.ts.map +1 -1
- package/dist/utils/hostAgentEnv.js +0 -17
- package/dist/utils/hostAgentEnv.js.map +1 -1
- package/dist/utils/htmlDocument.d.ts +0 -5
- package/dist/utils/htmlDocument.d.ts.map +1 -1
- package/dist/utils/htmlDocument.js +2 -7
- package/dist/utils/htmlDocument.js.map +1 -1
- package/dist/utils/internalGitIdentity.d.ts +0 -5
- package/dist/utils/internalGitIdentity.d.ts.map +1 -1
- package/dist/utils/internalGitIdentity.js +0 -5
- package/dist/utils/internalGitIdentity.js.map +1 -1
- package/dist/utils/logger.d.ts +0 -5
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +2 -19
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/loginShellPath.d.ts +0 -9
- package/dist/utils/loginShellPath.d.ts.map +1 -1
- package/dist/utils/loginShellPath.js +0 -69
- package/dist/utils/loginShellPath.js.map +1 -1
- package/dist/utils/loopback.d.ts +0 -1
- package/dist/utils/loopback.d.ts.map +1 -1
- package/dist/utils/loopback.js +0 -1
- package/dist/utils/loopback.js.map +1 -1
- package/dist/utils/pid.d.ts +0 -1
- package/dist/utils/pid.d.ts.map +1 -1
- package/dist/utils/pid.js +0 -1
- package/dist/utils/pid.js.map +1 -1
- package/dist/utils/portUtils.d.ts +0 -15
- package/dist/utils/portUtils.d.ts.map +1 -1
- package/dist/utils/portUtils.js +0 -21
- package/dist/utils/portUtils.js.map +1 -1
- package/dist/utils/queueAccess.d.ts +0 -9
- package/dist/utils/queueAccess.d.ts.map +1 -1
- package/dist/utils/queueAccess.js +0 -9
- package/dist/utils/queueAccess.js.map +1 -1
- package/dist/utils/skillWriter.d.ts +0 -17
- package/dist/utils/skillWriter.d.ts.map +1 -1
- package/dist/utils/skillWriter.js +0 -20
- package/dist/utils/skillWriter.js.map +1 -1
- package/dist/utils/skills/claude-skill.d.ts +0 -5
- package/dist/utils/skills/claude-skill.d.ts.map +1 -1
- package/dist/utils/skills/claude-skill.js +0 -5
- package/dist/utils/skills/claude-skill.js.map +1 -1
- package/dist/utils/skills/cli-guidance.d.ts +1 -9
- package/dist/utils/skills/cli-guidance.d.ts.map +1 -1
- package/dist/utils/skills/cli-guidance.js +6 -10
- package/dist/utils/skills/cli-guidance.js.map +1 -1
- package/dist/utils/skills/cursor-rules.d.ts +0 -6
- package/dist/utils/skills/cursor-rules.d.ts.map +1 -1
- package/dist/utils/skills/cursor-rules.js +0 -6
- package/dist/utils/skills/cursor-rules.js.map +1 -1
- package/dist/utils/variantPreviewPort.d.ts +0 -3
- package/dist/utils/variantPreviewPort.d.ts.map +1 -1
- package/dist/utils/variantPreviewPort.js +0 -3
- package/dist/utils/variantPreviewPort.js.map +1 -1
- package/dist/utils/windowPlacement.d.ts +0 -4
- package/dist/utils/windowPlacement.d.ts.map +1 -1
- package/dist/utils/windowPlacement.js +0 -4
- package/dist/utils/windowPlacement.js.map +1 -1
- package/package.json +13 -13
- package/scripts/verify-node-version.cjs +0 -3
- package/src/ui/dist/assets/{LibraryApp-qbLqcNxM.js → LibraryApp-Bu7hVbt_.js} +1 -1
- package/src/ui/dist/assets/main-CHyx_rEa.css +1 -0
- package/src/ui/dist/assets/main-CuiPb_rl.js +438 -0
- package/src/ui/dist/index.html +2 -2
- package/dist/utils/skills/describe-motion-protocol.d.ts +0 -10
- package/dist/utils/skills/describe-motion-protocol.d.ts.map +0 -1
- package/dist/utils/skills/describe-motion-protocol.js +0 -231
- package/dist/utils/skills/describe-motion-protocol.js.map +0 -1
- package/src/ui/dist/assets/main-BUZjlAHd.css +0 -1
- package/src/ui/dist/assets/main-touv07Dk.js +0 -438
|
@@ -19,69 +19,23 @@ const internalGitIdentity_1 = require("../utils/internalGitIdentity");
|
|
|
19
19
|
const ProjectPackageManager_1 = require("./ProjectPackageManager");
|
|
20
20
|
const OperatingSystemServices_1 = require("./OperatingSystemServices");
|
|
21
21
|
const log = (0, logger_1.createLogger)('WorktreeManager');
|
|
22
|
-
// How long a freshly-spawned dev server may go SILENT (no stdout/stderr)
|
|
23
|
-
// before we give up on it answering on its port. Inactivity-based rather than
|
|
24
|
-
// a flat wall clock: a large Next/Vite project's cold first compile can chew
|
|
25
|
-
// through 30s+ while chattering progress output, and killing it mid-compile
|
|
26
|
-
// manufactured `timeout` failures. A server that is still printing is still
|
|
27
|
-
// making progress; only a genuinely silent one is presumed wedged. The probe
|
|
28
|
-
// fails fast on early process exit regardless.
|
|
29
22
|
const DEV_SERVER_READY_INACTIVITY_MS = 30_000;
|
|
30
|
-
// Absolute ceiling on the readiness wait, however chatty the process is —
|
|
31
|
-
// bounds worst-case UX for a dev server that logs forever without serving.
|
|
32
23
|
const DEV_SERVER_READY_MAX_MS = 120_000;
|
|
33
24
|
const DEV_SERVER_PROBE_TIMEOUT_MS = 1_000;
|
|
34
|
-
// Keep a rolling tail of the dev server's output so a failed start is
|
|
35
|
-
// diagnosable (which port it tried, EADDRINUSE, missing script) without
|
|
36
|
-
// retaining unbounded logs.
|
|
37
25
|
const DEV_SERVER_OUTPUT_TAIL_LIMIT = 4_000;
|
|
38
|
-
// Abort any git child process that goes silent (no stdout/stderr) for this
|
|
39
|
-
// long. Provisioning worktrees for a large project (e.g. React Native, whose
|
|
40
|
-
// working tree carries native build dirs) used to hang indefinitely because
|
|
41
|
-
// none of these git calls had a timeout — a stuck `worktree add`/`commit`
|
|
42
|
-
// would stall the whole `start_variants` tool call. `block` resets on every
|
|
43
|
-
// data chunk, so a slow-but-progressing checkout keeps running; only a
|
|
44
|
-
// genuinely wedged process (lock contention, credential/hook prompt) trips it.
|
|
45
26
|
const GIT_BLOCK_TIMEOUT_MS = 120_000;
|
|
46
27
|
const GIT_OPTS = { timeout: { block: GIT_BLOCK_TIMEOUT_MS } };
|
|
47
|
-
// Existing-project worktrees still go under /tmp — `git worktree add` refuses
|
|
48
|
-
// to nest inside the main worktree, so the user's project tree is off-limits
|
|
49
|
-
// and /tmp is the right neutral location.
|
|
50
28
|
const EXISTING_WORKTREE_BASE = '/tmp';
|
|
51
|
-
// Fresh-project worktrees live under destinationParent so commit time is a
|
|
52
|
-
// same-volume rename instead of a cross-volume cp. Tucked under a
|
|
53
|
-
// dot-prefixed dir so the editor file tree collapses them cleanly.
|
|
54
29
|
exports.FRESH_WORKTREES_DIRNAME = '.rivet-variants';
|
|
55
30
|
const WORKTREE_PREFIX = 'rivet-variants';
|
|
56
31
|
const SESSION_ID_PATTERN = /^[A-Za-z0-9_-]+$/;
|
|
57
|
-
// Include the PID so each server instance only cleans up its own worktrees.
|
|
58
32
|
exports.INSTANCE_PREFIX = `${WORKTREE_PREFIX}-pid${process.pid}`;
|
|
59
|
-
// Registry of every destinationParent that has ever housed a fresh-worktree
|
|
60
|
-
// root in this user account. Read at startup so orphan cleanup can sweep
|
|
61
|
-
// roots created by prior MCP processes that crashed before teardown ran.
|
|
62
33
|
const FRESH_ROOTS_REGISTRY_PATH = path_1.default.join(os_1.default.homedir(), '.rivet', 'fresh-worktree-roots.json');
|
|
63
34
|
const FRESH_SESSION_ERROR = 'Fresh-project sessions have no source project — this operation requires an existing project path.';
|
|
64
35
|
class WorktreeManager {
|
|
65
36
|
operatingSystemServices;
|
|
66
37
|
resolveProjectPath;
|
|
67
|
-
/**
|
|
68
|
-
* Ports handed out by `findFreePortFrom` to a dev server that hasn't bound
|
|
69
|
-
* them yet. Until a port is actually listening, a bind/connect probe still
|
|
70
|
-
* sees it as free, so without this set two concurrent variant starts would
|
|
71
|
-
* both walk away with the same "free" port and collide. Released (see
|
|
72
|
-
* `releasePort`) once the dev server has bound the port — at which point the
|
|
73
|
-
* listener check sees it taken — or has failed to start.
|
|
74
|
-
*/
|
|
75
38
|
reservedPorts = new Set();
|
|
76
|
-
/**
|
|
77
|
-
* Accepts either a static path, null, or a lazy getter. The getter form
|
|
78
|
-
* lets long-lived callers (e.g. the agent-variants orchestrator) defer the
|
|
79
|
-
* project path until each operation, since `bridge.getProjectPath()`
|
|
80
|
-
* isn't known until `open_visual_editor` runs. A null projectPath is
|
|
81
|
-
* allowed for fresh-project sessions that scaffold from scratch and
|
|
82
|
-
* therefore have no source repo; methods that need a real project path
|
|
83
|
-
* throw a clear error in that case.
|
|
84
|
-
*/
|
|
85
39
|
constructor(projectPath, operatingSystemServices = OperatingSystemServices_1.selectedOperatingSystemServices) {
|
|
86
40
|
this.operatingSystemServices = operatingSystemServices;
|
|
87
41
|
if (typeof projectPath === 'function') {
|
|
@@ -99,29 +53,12 @@ class WorktreeManager {
|
|
|
99
53
|
}
|
|
100
54
|
return resolved;
|
|
101
55
|
}
|
|
102
|
-
/**
|
|
103
|
-
* Return the absolute git root for the repo containing this.projectPath.
|
|
104
|
-
* When projectPath is a subdirectory (e.g. examples/microsoft-paint inside
|
|
105
|
-
* rivet-core), this returns the repo root — not the subdirectory.
|
|
106
|
-
*/
|
|
107
56
|
async getGitRoot() {
|
|
108
57
|
const root = await (0, simple_git_1.simpleGit)(this.projectPath, GIT_OPTS).revparse([
|
|
109
58
|
'--show-toplevel',
|
|
110
59
|
]);
|
|
111
60
|
return root.trim();
|
|
112
61
|
}
|
|
113
|
-
/**
|
|
114
|
-
* Resolve a path to its canonical (symlinks-followed) form.
|
|
115
|
-
*
|
|
116
|
-
* `getGitRoot` returns a git-canonicalized path (`rev-parse
|
|
117
|
-
* --show-toplevel` resolves symlinks), but `this.projectPath` may be a
|
|
118
|
-
* symlinked path — on macOS `/tmp` → `/private/tmp`. Computing
|
|
119
|
-
* `path.relative` between a canonical git root and a symlinked project path
|
|
120
|
-
* yields an ESCAPING relative path (e.g. `../../../tmp/...`), which then
|
|
121
|
-
* resolves OUTSIDE the worktree. Canonicalizing both sides first keeps the
|
|
122
|
-
* relative path inside the tree. Falls back to a plain `path.resolve` when
|
|
123
|
-
* the path doesn't exist yet (realpath throws ENOENT).
|
|
124
|
-
*/
|
|
125
62
|
async realPath(p) {
|
|
126
63
|
try {
|
|
127
64
|
return await fs_1.default.promises.realpath(p);
|
|
@@ -130,21 +67,6 @@ class WorktreeManager {
|
|
|
130
67
|
return path_1.default.resolve(p);
|
|
131
68
|
}
|
|
132
69
|
}
|
|
133
|
-
/**
|
|
134
|
-
* Ensure `this.projectPath` is inside a git repo, bootstrapping one if not.
|
|
135
|
-
*
|
|
136
|
-
* Fresh / blank projects (an empty folder, or a plain HTML preview) that the
|
|
137
|
-
* user opens outside any repo would otherwise fail at `git worktree add`
|
|
138
|
-
* (and `getGitRoot`'s `rev-parse --show-toplevel`) with "expected a git
|
|
139
|
-
* workspace". We `git init` the folder and create an EMPTY initial commit so
|
|
140
|
-
* `HEAD` exists — `git worktree add HEAD` requires a commit to point at, so a
|
|
141
|
-
* bare `git init` on a blank folder isn't enough. `add -A` first captures
|
|
142
|
-
* whatever is already there (e.g. an `index.html`) as the starting point.
|
|
143
|
-
*
|
|
144
|
-
* No-op when an enclosing repo already has a HEAD commit — we never nest a
|
|
145
|
-
* repo inside another. Best-effort: a failure here surfaces at the
|
|
146
|
-
* subsequent worktree step rather than masking the original operation.
|
|
147
|
-
*/
|
|
148
70
|
async ensureGitRepo() {
|
|
149
71
|
const projectPath = this.projectPath;
|
|
150
72
|
const git = (0, simple_git_1.simpleGit)(projectPath, GIT_OPTS);
|
|
@@ -167,9 +89,6 @@ class WorktreeManager {
|
|
|
167
89
|
else {
|
|
168
90
|
log.info(`Git repo at ${projectPath} has no HEAD — creating one for Rivet`);
|
|
169
91
|
}
|
|
170
|
-
// Stage anything already present so a non-empty start point (e.g. an
|
|
171
|
-
// HTML preview) lands in the initial commit. Empty dir → nothing staged,
|
|
172
|
-
// and `--allow-empty` still produces the HEAD commit we need.
|
|
173
92
|
await git.add(['-A']).catch(() => { });
|
|
174
93
|
await git.raw([
|
|
175
94
|
'-c',
|
|
@@ -183,18 +102,7 @@ class WorktreeManager {
|
|
|
183
102
|
'rivet: initial',
|
|
184
103
|
]);
|
|
185
104
|
}
|
|
186
|
-
/**
|
|
187
|
-
* Return the path to the project within a worktree.
|
|
188
|
-
* When projectPath == gitRoot this is just worktreePath.
|
|
189
|
-
* When projectPath is a subdirectory (e.g. rivet-core/examples/microsoft-paint),
|
|
190
|
-
* this returns worktreePath/examples/microsoft-paint so the dev server starts
|
|
191
|
-
* from the right directory.
|
|
192
|
-
*/
|
|
193
105
|
async getProjectCwdInWorktree(worktreePath) {
|
|
194
|
-
// Canonicalize both sides so a symlinked projectPath (e.g. /tmp on macOS,
|
|
195
|
-
// which is a symlink to /private/tmp) matches the git-resolved gitRoot.
|
|
196
|
-
// Without this, path.relative produces an escaping `../../..` path that
|
|
197
|
-
// resolves back to the ORIGINAL project dir instead of inside the worktree.
|
|
198
106
|
const gitRoot = await this.realPath(await this.getGitRoot());
|
|
199
107
|
const projectPath = await this.realPath(this.projectPath);
|
|
200
108
|
const relPath = path_1.default.relative(gitRoot, projectPath);
|
|
@@ -204,14 +112,7 @@ class WorktreeManager {
|
|
|
204
112
|
}
|
|
205
113
|
return relPath ? path_1.default.join(worktreePath, relPath) : worktreePath;
|
|
206
114
|
}
|
|
207
|
-
/**
|
|
208
|
-
* Translate an absolute path that lives inside the main project tree to its
|
|
209
|
-
* equivalent path inside a worktree. Paths outside the git root are returned
|
|
210
|
-
* unchanged so the method is safe to call on arbitrary strings.
|
|
211
|
-
*/
|
|
212
115
|
async translateToWorktreePath(absPath, worktreePath) {
|
|
213
|
-
// Canonicalize both sides (see getProjectCwdInWorktree) so a symlinked
|
|
214
|
-
// absPath doesn't compute an escaping rel against the git-resolved root.
|
|
215
116
|
const gitRoot = await this.realPath(await this.getGitRoot());
|
|
216
117
|
const realAbsPath = await this.realPath(absPath);
|
|
217
118
|
const rel = path_1.default.relative(gitRoot, realAbsPath);
|
|
@@ -219,17 +120,11 @@ class WorktreeManager {
|
|
|
219
120
|
return absPath;
|
|
220
121
|
return path_1.default.join(worktreePath, rel);
|
|
221
122
|
}
|
|
222
|
-
/** Get diff of all uncommitted changes (staged + unstaged) vs HEAD */
|
|
223
123
|
async getUncommittedPatch() {
|
|
224
124
|
const git = (0, simple_git_1.simpleGit)(this.projectPath, GIT_OPTS);
|
|
225
125
|
const diff = await git.diff(['--binary', '--full-index', 'HEAD']);
|
|
226
126
|
return diff;
|
|
227
127
|
}
|
|
228
|
-
/**
|
|
229
|
-
* Return untracked, non-ignored file paths relative to the git root.
|
|
230
|
-
* These are files present in the working tree but not yet in any commit,
|
|
231
|
-
* so `git diff HEAD` won't include them.
|
|
232
|
-
*/
|
|
233
128
|
async getUntrackedFiles() {
|
|
234
129
|
const gitRoot = await this.getGitRoot();
|
|
235
130
|
const git = (0, simple_git_1.simpleGit)(gitRoot, GIT_OPTS);
|
|
@@ -241,21 +136,15 @@ class WorktreeManager {
|
|
|
241
136
|
]);
|
|
242
137
|
return result.split('\0').filter(Boolean);
|
|
243
138
|
}
|
|
244
|
-
/** Copy untracked files from the source repo into a worktree */
|
|
245
139
|
copyUntrackedFiles(untrackedFiles, gitRoot, worktreePath) {
|
|
246
140
|
for (const relPath of untrackedFiles) {
|
|
247
141
|
try {
|
|
248
142
|
const src = path_1.default.join(gitRoot, relPath);
|
|
249
143
|
const dest = path_1.default.join(worktreePath, relPath);
|
|
250
144
|
fs_1.default.mkdirSync(path_1.default.dirname(dest), { recursive: true });
|
|
251
|
-
// Clone-on-write where the filesystem supports it (free), plain copy
|
|
252
|
-
// elsewhere — untracked trees can hold large binary assets.
|
|
253
145
|
fs_1.default.copyFileSync(src, dest, fs_1.default.constants.COPYFILE_FICLONE);
|
|
254
146
|
}
|
|
255
147
|
catch (err) {
|
|
256
|
-
// The listing races live edits: a file with no readable source
|
|
257
|
-
// (deleted since `git ls-files`, or a dangling symlink) has nothing
|
|
258
|
-
// to copy. Any other failure aborts provisioning.
|
|
259
148
|
if (err.code === 'ENOENT') {
|
|
260
149
|
log.warn(`Skipped untracked file ${relPath} with no readable source`);
|
|
261
150
|
continue;
|
|
@@ -264,12 +153,6 @@ class WorktreeManager {
|
|
|
264
153
|
}
|
|
265
154
|
}
|
|
266
155
|
}
|
|
267
|
-
/**
|
|
268
|
-
* @effect Commits the staged worktree state onto its detached HEAD with Git
|
|
269
|
-
* plumbing, so project commit hooks can neither block nor mutate the
|
|
270
|
-
* internal baseline. The commit lives only on this worktree's detached HEAD
|
|
271
|
-
* and disappears with it — the user's branches and config are untouched.
|
|
272
|
-
*/
|
|
273
156
|
async commitDetachedBaseline(worktreeGit, message) {
|
|
274
157
|
const tree = (await worktreeGit.raw(['write-tree'])).trim();
|
|
275
158
|
const baseline = (await worktreeGit.raw([
|
|
@@ -283,7 +166,6 @@ class WorktreeManager {
|
|
|
283
166
|
])).trim();
|
|
284
167
|
await worktreeGit.raw(['update-ref', '--no-deref', 'HEAD', baseline]);
|
|
285
168
|
}
|
|
286
|
-
/** Apply a patch string via stdin to the given cwd using git apply */
|
|
287
169
|
applyPatchViaStdin(patch, cwd) {
|
|
288
170
|
return new Promise((resolve, reject) => {
|
|
289
171
|
const cp = (0, child_process_1.spawn)('git', ['apply', '--whitespace=nowarn', '-'], {
|
|
@@ -304,23 +186,11 @@ class WorktreeManager {
|
|
|
304
186
|
cp.stdin.end();
|
|
305
187
|
});
|
|
306
188
|
}
|
|
307
|
-
/**
|
|
308
|
-
* Create N worktrees for a session, apply uncommitted patch to each, return paths.
|
|
309
|
-
*
|
|
310
|
-
* `instanceKeyPrefix` namespaces the worktree directory names so a second
|
|
311
|
-
* batch appended to the same session (sequential "Vary") does not collide
|
|
312
|
-
* with the first batch's `${INSTANCE_PREFIX}-${sessionId}-${i}` paths. It
|
|
313
|
-
* stays within the `${INSTANCE_PREFIX}-${sessionId}-` cleanup glob, so
|
|
314
|
-
* `cleanupSession` still removes appended worktrees.
|
|
315
|
-
*/
|
|
316
189
|
async createWorktrees(sessionId, count, instanceKeyPrefix = '') {
|
|
317
190
|
this.assertSafeSessionId(sessionId);
|
|
318
191
|
if (instanceKeyPrefix && !SESSION_ID_PATTERN.test(instanceKeyPrefix)) {
|
|
319
192
|
throw new Error('Invalid instanceKeyPrefix: expected a safe path segment');
|
|
320
193
|
}
|
|
321
|
-
// Blank / non-repo workspaces (empty folder or a bare HTML preview) have
|
|
322
|
-
// no git history for `git worktree add` to branch from — bootstrap one
|
|
323
|
-
// first so variants work outside an existing repo.
|
|
324
194
|
await this.ensureGitRepo();
|
|
325
195
|
const git = (0, simple_git_1.simpleGit)(this.projectPath, GIT_OPTS);
|
|
326
196
|
const patch = await this.getUncommittedPatch();
|
|
@@ -333,17 +203,9 @@ class WorktreeManager {
|
|
|
333
203
|
try {
|
|
334
204
|
await git.raw(['worktree', 'add', '--detach', worktreePath, 'HEAD']);
|
|
335
205
|
isWorktreeCreated = true;
|
|
336
|
-
// Apply uncommitted changes so agent sees current state, then commit
|
|
337
|
-
// them as a "baseline" so getDiff returns only the agent's delta.
|
|
338
|
-
// Without this, getDiff (git diff HEAD) would include the user's
|
|
339
|
-
// pre-existing changes, and reverting the combined diff would wipe them.
|
|
340
206
|
if (patch.trim()) {
|
|
341
207
|
await this.applyPatchViaStdin(patch, worktreePath);
|
|
342
208
|
}
|
|
343
|
-
// Copy untracked files — git diff HEAD only covers tracked files, so
|
|
344
|
-
// untracked-but-not-ignored files (e.g. new components not yet committed)
|
|
345
|
-
// must be copied manually or the worktree's dev server will fail to
|
|
346
|
-
// resolve their imports.
|
|
347
209
|
if (untrackedFiles.length > 0) {
|
|
348
210
|
this.copyUntrackedFiles(untrackedFiles, gitRoot, worktreePath);
|
|
349
211
|
}
|
|
@@ -353,8 +215,6 @@ class WorktreeManager {
|
|
|
353
215
|
paths.push(worktreePath);
|
|
354
216
|
}
|
|
355
217
|
catch (e) {
|
|
356
|
-
// Roll back only worktrees created by this batch; prior directions
|
|
357
|
-
// in the same session still belong to the user's exploration.
|
|
358
218
|
const incompletePaths = isWorktreeCreated
|
|
359
219
|
? [...paths, worktreePath]
|
|
360
220
|
: paths;
|
|
@@ -383,11 +243,6 @@ class WorktreeManager {
|
|
|
383
243
|
}
|
|
384
244
|
return paths;
|
|
385
245
|
}
|
|
386
|
-
/**
|
|
387
|
-
* Copy a variant worktree into N new sibling worktrees. Each destination
|
|
388
|
-
* inherits the source tree (including the baseline commit and agent delta)
|
|
389
|
-
* so a code_gen "Vary" starts from the parent variant rather than git HEAD.
|
|
390
|
-
*/
|
|
391
246
|
async forkWorktreesFrom(sourceWorktreePath, sessionId, count, instanceKeyPrefix = '') {
|
|
392
247
|
this.assertSafeSessionId(sessionId);
|
|
393
248
|
if (instanceKeyPrefix && !SESSION_ID_PATTERN.test(instanceKeyPrefix)) {
|
|
@@ -401,11 +256,9 @@ class WorktreeManager {
|
|
|
401
256
|
for (let i = 0; i < count; i++) {
|
|
402
257
|
const worktreePath = path_1.default.join(EXISTING_WORKTREE_BASE, `${exports.INSTANCE_PREFIX}-${sessionId}-${instanceKeyPrefix}${i}`);
|
|
403
258
|
fs_1.default.mkdirSync(path_1.default.dirname(worktreePath), { recursive: true });
|
|
404
|
-
// Each fork prepares its dependencies from its own manifests.
|
|
405
259
|
await fs_1.default.promises.cp(resolvedSource, worktreePath, {
|
|
406
260
|
recursive: true,
|
|
407
261
|
verbatimSymlinks: true,
|
|
408
|
-
// Copy-on-write clone on Linux (btrfs/XFS); plain copy elsewhere.
|
|
409
262
|
mode: fs_1.default.constants.COPYFILE_FICLONE,
|
|
410
263
|
filter: (source) => !(0, ProjectPackageManager_1.isInstallOutputPath)(path_1.default.relative(resolvedSource, source)),
|
|
411
264
|
});
|
|
@@ -413,31 +266,12 @@ class WorktreeManager {
|
|
|
413
266
|
}
|
|
414
267
|
return paths;
|
|
415
268
|
}
|
|
416
|
-
/** Get git diff of all changes made in a worktree vs HEAD.
|
|
417
|
-
*
|
|
418
|
-
* `git diff HEAD` only covers tracked files. New files created by the agent
|
|
419
|
-
* are untracked and would be silently omitted, breaking imports/styles when
|
|
420
|
-
* the diff is applied to the main tree. `git add --intent-to-add .` marks
|
|
421
|
-
* every untracked file in the index as a zero-length blob so `git diff HEAD`
|
|
422
|
-
* includes them as pure additions without actually staging their content.
|
|
423
|
-
*/
|
|
424
269
|
async getDiff(worktreePath) {
|
|
425
270
|
const git = (0, simple_git_1.simpleGit)(worktreePath);
|
|
426
|
-
// Stage new files with intent-to-add so they appear in the diff
|
|
427
271
|
await git.raw(['add', '--intent-to-add', '.']).catch(() => {
|
|
428
|
-
// Non-fatal — if this fails, fall back to tracked-only diff
|
|
429
272
|
});
|
|
430
273
|
return git.diff(['--binary', '--full-index', 'HEAD']);
|
|
431
274
|
}
|
|
432
|
-
/**
|
|
433
|
-
* Apply or revert a diff to the main project working tree.
|
|
434
|
-
*
|
|
435
|
-
* Because getDiff now diffs against the worktree baseline commit (HEAD +
|
|
436
|
-
* user's uncommitted changes), the codeDiff contains only the agent's delta.
|
|
437
|
-
* This means git apply --reverse reliably restores to the baseline state
|
|
438
|
-
* (user's uncommitted changes intact) without touching git checkout HEAD,
|
|
439
|
-
* which would wipe the user's pre-existing work.
|
|
440
|
-
*/
|
|
441
275
|
async applyDiff(diff, reverse) {
|
|
442
276
|
if (!diff.trim())
|
|
443
277
|
return;
|
|
@@ -464,9 +298,6 @@ class WorktreeManager {
|
|
|
464
298
|
cp.stdin.end();
|
|
465
299
|
});
|
|
466
300
|
}
|
|
467
|
-
/**
|
|
468
|
-
* Apply a unified diff to the repository that contains the target project path.
|
|
469
|
-
*/
|
|
470
301
|
async applyDiffToProject(diff, projectPath) {
|
|
471
302
|
if (!diff.trim())
|
|
472
303
|
return;
|
|
@@ -474,7 +305,6 @@ class WorktreeManager {
|
|
|
474
305
|
const gitRoot = (await git.revparse(['--show-toplevel'])).trim();
|
|
475
306
|
return this.applyPatchViaStdin(diff, gitRoot);
|
|
476
307
|
}
|
|
477
|
-
/** Bind port 0 to get an OS-assigned free port */
|
|
478
308
|
getFreePort() {
|
|
479
309
|
return new Promise((resolve, reject) => {
|
|
480
310
|
const server = net_1.default.createServer();
|
|
@@ -486,24 +316,6 @@ class WorktreeManager {
|
|
|
486
316
|
server.on('error', reject);
|
|
487
317
|
});
|
|
488
318
|
}
|
|
489
|
-
/**
|
|
490
|
-
* Find a free port by scanning upward from `startPort` (the framework's
|
|
491
|
-
* default, e.g. 3000 for Next, 5173 for Vite). Returns the first port that is
|
|
492
|
-
* both bindable and not already reserved by a concurrent variant start, so a
|
|
493
|
-
* preview comes up on a sensible, predictable port near the project's normal
|
|
494
|
-
* one — and naturally steps past a port the user's own dev server already
|
|
495
|
-
* holds — instead of a random high port. Falls back to an OS-assigned port if
|
|
496
|
-
* the scan window is exhausted.
|
|
497
|
-
*
|
|
498
|
-
* Port availability is delegated to {@link findAvailablePort}, which (unlike a
|
|
499
|
-
* plain bind check) also rejects a port with an active listener on 127.0.0.1
|
|
500
|
-
* or ::1 — the ports that actually carry `localhost` preview traffic.
|
|
501
|
-
*
|
|
502
|
-
* The returned port is reserved synchronously; the caller MUST `releasePort`
|
|
503
|
-
* it once the dev server has bound it or failed to start (the orchestrator
|
|
504
|
-
* does this in a `finally`). Reserving here is what stops two concurrent
|
|
505
|
-
* starts — neither of which has bound its port yet — from both picking it.
|
|
506
|
-
*/
|
|
507
319
|
async findFreePortFrom(startPort, scanWindow = 64) {
|
|
508
320
|
const base = Number.isInteger(startPort) && startPort > 0 && startPort <= 65535
|
|
509
321
|
? startPort
|
|
@@ -516,33 +328,23 @@ class WorktreeManager {
|
|
|
516
328
|
candidate = await (0, portUtils_1.findAvailablePort)(from);
|
|
517
329
|
}
|
|
518
330
|
catch {
|
|
519
|
-
break;
|
|
331
|
+
break;
|
|
520
332
|
}
|
|
521
333
|
if (candidate > limit)
|
|
522
|
-
break;
|
|
523
|
-
// Check-and-claim with no `await` in between, so two concurrent callers
|
|
524
|
-
// can't both observe the same port as unreserved before claiming it.
|
|
334
|
+
break;
|
|
525
335
|
if (!this.reservedPorts.has(candidate)) {
|
|
526
336
|
this.reservedPorts.add(candidate);
|
|
527
337
|
return candidate;
|
|
528
338
|
}
|
|
529
|
-
from = candidate + 1;
|
|
339
|
+
from = candidate + 1;
|
|
530
340
|
}
|
|
531
|
-
// Scan window exhausted (or every free port in it is reserved by a sibling
|
|
532
|
-
// that hasn't bound yet) — fall back to an OS-assigned ephemeral port.
|
|
533
341
|
const fallback = await this.getFreePort();
|
|
534
342
|
this.reservedPorts.add(fallback);
|
|
535
343
|
return fallback;
|
|
536
344
|
}
|
|
537
|
-
/**
|
|
538
|
-
* Release a port previously handed out by {@link findFreePortFrom}. Call once
|
|
539
|
-
* the dev server has bound it (the listener check now sees it taken, so the
|
|
540
|
-
* reservation is redundant) or has failed to start (the port is free again).
|
|
541
|
-
*/
|
|
542
345
|
releasePort(port) {
|
|
543
346
|
this.reservedPorts.delete(port);
|
|
544
347
|
}
|
|
545
|
-
/** Validate a diff via `git apply --check` without modifying files */
|
|
546
348
|
validateDiff(diff, reverse) {
|
|
547
349
|
if (!diff.trim())
|
|
548
350
|
return Promise.resolve();
|
|
@@ -569,26 +371,13 @@ class WorktreeManager {
|
|
|
569
371
|
cp.stdin.end();
|
|
570
372
|
});
|
|
571
373
|
}
|
|
572
|
-
/**
|
|
573
|
-
* Spawn a dev server and poll until it responds without a server error.
|
|
574
|
-
* Compilation failures and process exits fail promptly; active startup output
|
|
575
|
-
* extends the readiness wait up to the hard deadline.
|
|
576
|
-
*/
|
|
577
374
|
async startDevServer(worktreePath, port, cmd, args, env) {
|
|
578
375
|
const proc = this.operatingSystemServices.projectProcesses.start({ executable: cmd, args }, {
|
|
579
376
|
cwd: worktreePath,
|
|
580
|
-
// Preview servers need development transforms even when the installed
|
|
581
|
-
// Rivet CLI runs in production. Explicit recipe settings take priority.
|
|
582
377
|
env: { ...process.env, NODE_ENV: 'development', ...env },
|
|
583
378
|
stdio: 'pipe',
|
|
584
379
|
detached: false,
|
|
585
380
|
});
|
|
586
|
-
// Capture a rolling tail of the child's output so a failed start is
|
|
587
|
-
// diagnosable (EADDRINUSE, missing dev script, build crash) instead of a
|
|
588
|
-
// blind timeout. Draining the pipes is also required: with `stdio: 'pipe'`
|
|
589
|
-
// and no consumer, the OS pipe buffer (~64KB) fills within seconds of
|
|
590
|
-
// Vite's HMR/request logging and the child blocks on write, freezing the
|
|
591
|
-
// dev server even though it passed the readiness probe.
|
|
592
381
|
let outputTail = '';
|
|
593
382
|
let lastOutputAt = Date.now();
|
|
594
383
|
const drain = (data) => {
|
|
@@ -598,10 +387,6 @@ class WorktreeManager {
|
|
|
598
387
|
};
|
|
599
388
|
proc.stdout?.on('data', drain);
|
|
600
389
|
proc.stderr?.on('data', drain);
|
|
601
|
-
// Track early termination so the probe can fail fast: a dev server that
|
|
602
|
-
// exits (or never spawns) before answering on `port` is never coming up —
|
|
603
|
-
// commonly because the project's dev script ignored the injected port and
|
|
604
|
-
// tried to bind its own default, which was already taken (EADDRINUSE).
|
|
605
390
|
const term = {};
|
|
606
391
|
const onExit = (code, signal) => {
|
|
607
392
|
term.exited = { code, signal };
|
|
@@ -669,8 +454,6 @@ class WorktreeManager {
|
|
|
669
454
|
}
|
|
670
455
|
await new Promise((r) => setTimeout(r, 500));
|
|
671
456
|
}
|
|
672
|
-
// Deadline hit. If the child died during the final wait, report that
|
|
673
|
-
// (actionable) rather than a generic timeout.
|
|
674
457
|
if (term.spawnError)
|
|
675
458
|
fail('spawn_error');
|
|
676
459
|
if (term.exited)
|
|
@@ -681,13 +464,9 @@ class WorktreeManager {
|
|
|
681
464
|
});
|
|
682
465
|
}
|
|
683
466
|
catch {
|
|
684
|
-
/* ignore */
|
|
685
467
|
}
|
|
686
468
|
return fail('timeout');
|
|
687
469
|
}
|
|
688
|
-
/**
|
|
689
|
-
* @effect Stops a project dev server through the selected operating-system service.
|
|
690
|
-
*/
|
|
691
470
|
async stopDevServer(proc, timeoutMs = 5_000) {
|
|
692
471
|
if (proc.killed || proc.exitCode !== null || proc.pid == null)
|
|
693
472
|
return;
|
|
@@ -706,7 +485,6 @@ class WorktreeManager {
|
|
|
706
485
|
});
|
|
707
486
|
}
|
|
708
487
|
catch {
|
|
709
|
-
/* ignore */
|
|
710
488
|
}
|
|
711
489
|
let timeout;
|
|
712
490
|
const timedOut = await Promise.race([
|
|
@@ -726,34 +504,17 @@ class WorktreeManager {
|
|
|
726
504
|
});
|
|
727
505
|
}
|
|
728
506
|
catch {
|
|
729
|
-
/* ignore */
|
|
730
507
|
}
|
|
731
508
|
await exited;
|
|
732
509
|
}
|
|
733
|
-
/** Remove all worktrees for a session.
|
|
734
|
-
*
|
|
735
|
-
* For existing-project sessions, asks git to unregister the worktree
|
|
736
|
-
* (handles `.git/worktrees/*` cleanup) and falls back to plain rm. For
|
|
737
|
-
* fresh-project sessions (no projectPath) the worktrees are detached
|
|
738
|
-
* directories with their own `.git` under `<destinationParent>/.rivet-variants/`
|
|
739
|
-
* — git registry cleanup is a no-op and we just rm the matching dirs.
|
|
740
|
-
*
|
|
741
|
-
* `freshDestinationParent` is required when the session was fresh; pass
|
|
742
|
-
* `path.dirname(projectContext.workspacePath)` so we know which
|
|
743
|
-
* `.rivet-variants/` root to sweep.
|
|
744
|
-
*/
|
|
745
510
|
async cleanupSession(sessionId, freshDestinationParent) {
|
|
746
511
|
this.assertSafeSessionId(sessionId);
|
|
747
512
|
if (!this.resolveProjectPath()) {
|
|
748
|
-
// Fresh sessions: no source repo, no git registry to clean. Just rm.
|
|
749
513
|
if (freshDestinationParent) {
|
|
750
514
|
this.cleanupFreshWorktrees(sessionId, freshDestinationParent);
|
|
751
515
|
}
|
|
752
516
|
return;
|
|
753
517
|
}
|
|
754
|
-
// GIT_OPTS so cleanup can't re-hang: this path runs from teardown after a
|
|
755
|
-
// provision timeout/stall, and an unbounded `git worktree list`/`remove`
|
|
756
|
-
// would leave the tool hanging on cleanup instead of returning the error.
|
|
757
518
|
const git = (0, simple_git_1.simpleGit)(this.projectPath, GIT_OPTS);
|
|
758
519
|
const pattern = path_1.default.join(EXISTING_WORKTREE_BASE, `${exports.INSTANCE_PREFIX}-${sessionId}-`);
|
|
759
520
|
try {
|
|
@@ -768,7 +529,6 @@ class WorktreeManager {
|
|
|
768
529
|
await git.raw(['worktree', 'remove', '--force', wPath]);
|
|
769
530
|
}
|
|
770
531
|
catch {
|
|
771
|
-
// Force remove directory if git command fails
|
|
772
532
|
fs_1.default.rmSync(wPath, { recursive: true, force: true });
|
|
773
533
|
}
|
|
774
534
|
}
|
|
@@ -776,31 +536,10 @@ class WorktreeManager {
|
|
|
776
536
|
catch (e) {
|
|
777
537
|
log.warn('Worktree cleanup error:', e);
|
|
778
538
|
}
|
|
779
|
-
// Always also remove any leftover fresh-style directories for this
|
|
780
|
-
// session (e.g. mixed-mode sessions, or git registry mismatch).
|
|
781
539
|
if (freshDestinationParent) {
|
|
782
540
|
this.cleanupFreshWorktrees(sessionId, freshDestinationParent);
|
|
783
541
|
}
|
|
784
542
|
}
|
|
785
|
-
/**
|
|
786
|
-
* Create N worktrees for a fresh-project session by writing a template
|
|
787
|
-
* bundle into each `<destinationParent>/.rivet-variants/rivet-variants-pid<PID>-<sessionId>-<i>`
|
|
788
|
-
* directory, optionally writing a DESIGN.md per slot, and committing a
|
|
789
|
-
* baseline.
|
|
790
|
-
*
|
|
791
|
-
* Worktrees live under the user's destinationParent (not /tmp) so commit
|
|
792
|
-
* time can be a same-volume rename instead of a cross-volume copy. The
|
|
793
|
-
* destinationParent is registered to a small JSON file so a future MCP
|
|
794
|
-
* startup can sweep orphans even when the original process crashed.
|
|
795
|
-
*
|
|
796
|
-
* Does NOT run `npm install` — the orchestrator dispatches that as a
|
|
797
|
-
* background task so failures surface via work-item state without blocking
|
|
798
|
-
* the MCP tool response.
|
|
799
|
-
*
|
|
800
|
-
* @effect Creates directories under destinationParent, writes template
|
|
801
|
-
* files, runs git init/add/commit, appends destinationParent to
|
|
802
|
-
* the fresh-worktree-roots registry.
|
|
803
|
-
*/
|
|
804
543
|
async createFreshWorktrees(sessionId, count, template, designContext, destinationParent) {
|
|
805
544
|
this.assertSafeSessionId(sessionId);
|
|
806
545
|
if (!destinationParent || !path_1.default.isAbsolute(destinationParent)) {
|
|
@@ -835,19 +574,12 @@ class WorktreeManager {
|
|
|
835
574
|
});
|
|
836
575
|
}
|
|
837
576
|
catch (err) {
|
|
838
|
-
// Best-effort: even without a baseline commit the worktree is usable
|
|
839
|
-
// for the agent — log and continue.
|
|
840
577
|
log.warn(`Fresh worktree ${i}: git init failed`, err);
|
|
841
578
|
}
|
|
842
579
|
paths.push(worktreePath);
|
|
843
580
|
}
|
|
844
581
|
return paths;
|
|
845
582
|
}
|
|
846
|
-
/**
|
|
847
|
-
* Write the per-slot DESIGN.md for a fresh worktree.
|
|
848
|
-
*
|
|
849
|
-
* @effect Writes DESIGN.md when a design context is available.
|
|
850
|
-
*/
|
|
851
583
|
writeDesignContext(worktreePath, slot, entry) {
|
|
852
584
|
if (!entry)
|
|
853
585
|
return;
|
|
@@ -863,34 +595,12 @@ class WorktreeManager {
|
|
|
863
595
|
}
|
|
864
596
|
log.warn(`Fresh worktree ${slot}: unknown design system slug '${entry.slug}' — DESIGN.md skipped`);
|
|
865
597
|
}
|
|
866
|
-
/**
|
|
867
|
-
* Move a worktree to its history location preserving contents. Used by the
|
|
868
|
-
* orchestrator at commit time so unchosen variants survive on disk as
|
|
869
|
-
* runnable references (siblings of the chosen project).
|
|
870
|
-
*
|
|
871
|
-
* Returns the destination path (`<historyDir>/<folderName>`).
|
|
872
|
-
*
|
|
873
|
-
* @effect renames `srcWorktreePath` → `<historyDir>/<folderName>`, creating
|
|
874
|
-
* the historyDir if needed.
|
|
875
|
-
*/
|
|
876
598
|
moveWorktreeToHistory(srcWorktreePath, historyDir, folderName) {
|
|
877
599
|
fs_1.default.mkdirSync(historyDir, { recursive: true });
|
|
878
600
|
const dest = path_1.default.join(historyDir, folderName);
|
|
879
601
|
fs_1.default.renameSync(srcWorktreePath, dest);
|
|
880
602
|
return dest;
|
|
881
603
|
}
|
|
882
|
-
/** Remove all fresh worktrees for a session.
|
|
883
|
-
*
|
|
884
|
-
* @effect Removes directories under <destinationParent>/.rivet-variants/
|
|
885
|
-
* matching ${INSTANCE_PREFIX}-<sessionId>-*. Also removes the
|
|
886
|
-
* .rivet-variants/ parent if it becomes empty so the editor file
|
|
887
|
-
* tree doesn't accumulate noise.
|
|
888
|
-
*
|
|
889
|
-
* When `preserve` is provided, entries whose basenames are in the set are
|
|
890
|
-
* skipped — used by the orchestrator after a vite_app commit, where the
|
|
891
|
-
* unchosen variant worktrees have already been moved to a sibling history
|
|
892
|
-
* dir and must not be re-deleted.
|
|
893
|
-
*/
|
|
894
604
|
cleanupFreshWorktrees(sessionId, destinationParent, preserve) {
|
|
895
605
|
this.assertSafeSessionId(sessionId);
|
|
896
606
|
if (!destinationParent || !path_1.default.isAbsolute(destinationParent)) {
|
|
@@ -910,7 +620,6 @@ class WorktreeManager {
|
|
|
910
620
|
force: true,
|
|
911
621
|
});
|
|
912
622
|
}
|
|
913
|
-
// If the freshRoot is now empty, remove it too.
|
|
914
623
|
try {
|
|
915
624
|
const remaining = fs_1.default.readdirSync(freshRoot);
|
|
916
625
|
if (remaining.length === 0) {
|
|
@@ -918,12 +627,9 @@ class WorktreeManager {
|
|
|
918
627
|
}
|
|
919
628
|
}
|
|
920
629
|
catch {
|
|
921
|
-
// Non-fatal — leaving the dir is harmless.
|
|
922
630
|
}
|
|
923
631
|
}
|
|
924
632
|
catch (e) {
|
|
925
|
-
// ENOENT is expected when the dir was already cleaned up — only log
|
|
926
|
-
// when it's a different failure mode.
|
|
927
633
|
if (e.code !== 'ENOENT') {
|
|
928
634
|
log.warn('Fresh worktree cleanup error:', e);
|
|
929
635
|
}
|
|
@@ -936,10 +642,6 @@ class WorktreeManager {
|
|
|
936
642
|
}
|
|
937
643
|
}
|
|
938
644
|
exports.WorktreeManager = WorktreeManager;
|
|
939
|
-
/**
|
|
940
|
-
* Read the fresh-worktree-root registry, dropping entries whose dir no
|
|
941
|
-
* longer exists so the file stays small.
|
|
942
|
-
*/
|
|
943
645
|
const loadFreshWorktreeRoots = () => {
|
|
944
646
|
try {
|
|
945
647
|
const raw = fs_1.default.readFileSync(FRESH_ROOTS_REGISTRY_PATH, 'utf8');
|
|
@@ -965,11 +667,6 @@ const saveFreshWorktreeRoots = (roots) => {
|
|
|
965
667
|
log.warn('Could not persist fresh-worktree-roots registry:', err);
|
|
966
668
|
}
|
|
967
669
|
};
|
|
968
|
-
/**
|
|
969
|
-
* Append a freshRoot path to the registry (de-duped). Called by
|
|
970
|
-
* createFreshWorktrees so future MCP startups can sweep orphans even if
|
|
971
|
-
* the original process crashed before teardown ran.
|
|
972
|
-
*/
|
|
973
670
|
const registerFreshWorktreeRoot = (freshRoot) => {
|
|
974
671
|
const existing = loadFreshWorktreeRoots();
|
|
975
672
|
if (existing.includes(freshRoot))
|
|
@@ -978,13 +675,6 @@ const registerFreshWorktreeRoot = (freshRoot) => {
|
|
|
978
675
|
saveFreshWorktreeRoots(existing);
|
|
979
676
|
};
|
|
980
677
|
exports.registerFreshWorktreeRoot = registerFreshWorktreeRoot;
|
|
981
|
-
/**
|
|
982
|
-
* Sweep orphan worktrees from /tmp (existing-project flow) and from every
|
|
983
|
-
* registered fresh-worktree root (fresh-project flow). Filters by
|
|
984
|
-
* INSTANCE_PREFIX (includes PID) so each server instance only removes its
|
|
985
|
-
* own worktrees and never touches those of sibling instances. Prunes
|
|
986
|
-
* registry entries whose directory no longer exists so the file stays small.
|
|
987
|
-
*/
|
|
988
678
|
const cleanupOrphanedWorktrees = () => {
|
|
989
679
|
try {
|
|
990
680
|
const entries = fs_1.default
|
|
@@ -998,7 +688,6 @@ const cleanupOrphanedWorktrees = () => {
|
|
|
998
688
|
}
|
|
999
689
|
}
|
|
1000
690
|
catch {
|
|
1001
|
-
/* ignore */
|
|
1002
691
|
}
|
|
1003
692
|
const roots = loadFreshWorktreeRoots();
|
|
1004
693
|
const survivingRoots = [];
|
|
@@ -1025,19 +714,12 @@ const cleanupOrphanedWorktrees = () => {
|
|
|
1025
714
|
}
|
|
1026
715
|
};
|
|
1027
716
|
exports.cleanupOrphanedWorktrees = cleanupOrphanedWorktrees;
|
|
1028
|
-
// Clean up on natural exit (covers process.exit() calls from server shutdown)
|
|
1029
717
|
process.on('exit', exports.cleanupOrphanedWorktrees);
|
|
1030
|
-
/**
|
|
1031
|
-
* Prune stale worktree registry entries for a project (`.git/worktrees/<name>`
|
|
1032
|
-
* entries where the referenced directory no longer exists). Safe to call at
|
|
1033
|
-
* startup — only removes entries for directories that are already gone.
|
|
1034
|
-
*/
|
|
1035
718
|
const pruneWorktrees = async (projectPath) => {
|
|
1036
719
|
try {
|
|
1037
720
|
await (0, simple_git_1.simpleGit)(projectPath, GIT_OPTS).raw(['worktree', 'prune']);
|
|
1038
721
|
}
|
|
1039
722
|
catch {
|
|
1040
|
-
// Non-fatal — prune is best-effort housekeeping
|
|
1041
723
|
}
|
|
1042
724
|
};
|
|
1043
725
|
exports.pruneWorktrees = pruneWorktrees;
|