rivet-design 0.17.3 → 0.17.5
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 +0 -239
- package/dist/agent-variants/SessionStore.d.ts.map +1 -1
- package/dist/agent-variants/SessionStore.js +10 -368
- 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 +9 -611
- package/dist/agent-variants/WorktreeOrchestrator.d.ts.map +1 -1
- package/dist/agent-variants/WorktreeOrchestrator.js +111 -1468
- package/dist/agent-variants/WorktreeOrchestrator.js.map +1 -1
- package/dist/agent-variants/WorktreeOrchestrator.testHelpers.d.ts +0 -7
- package/dist/agent-variants/WorktreeOrchestrator.testHelpers.d.ts.map +1 -1
- package/dist/agent-variants/WorktreeOrchestrator.testHelpers.js +2 -25
- 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 +5 -493
- package/dist/agent-variants/contracts.d.ts.map +1 -1
- package/dist/agent-variants/contracts.js +2 -167
- 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 +0 -6
- package/dist/agent-variants/variantContext.d.ts.map +1 -1
- package/dist/agent-variants/variantContext.js +0 -9
- 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 +0 -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 +3 -3
- 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 +31 -102
- 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/reference.d.ts +0 -5
- package/dist/cli/commands/reference.d.ts.map +1 -1
- package/dist/cli/commands/reference.js +0 -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 +0 -31
- 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 +0 -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 +0 -2
- package/dist/library/HubClient.d.ts.map +1 -1
- package/dist/library/HubClient.js +0 -4
- 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 +0 -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 +7 -7
- package/dist/proxy-middleware/preview-bridge.js.map +1 -1
- package/dist/proxy-middleware/preview-connections.d.ts +8 -0
- package/dist/proxy-middleware/preview-connections.d.ts.map +1 -0
- package/dist/proxy-middleware/preview-connections.js +29 -0
- package/dist/proxy-middleware/preview-connections.js.map +1 -0
- 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 +41 -90
- 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 +14 -325
- 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 +0 -1
- 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 +0 -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/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/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/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 +3 -4
- 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 +28 -0
- package/dist/services/DependencyPreparationService.d.ts.map +1 -0
- package/dist/services/DependencyPreparationService.js +322 -0
- package/dist/services/DependencyPreparationService.js.map +1 -0
- 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 +2 -32
- package/dist/services/HistoryReplayService.d.ts.map +1 -1
- package/dist/services/HistoryReplayService.js +55 -65
- 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 +0 -34
- package/dist/services/IntegrationsClient.d.ts.map +1 -1
- package/dist/services/IntegrationsClient.js +0 -27
- 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 -22
- package/dist/services/OperatingSystemServices.d.ts.map +1 -1
- package/dist/services/OperatingSystemServices.js +22 -80
- 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 +23 -0
- package/dist/services/ProjectPackageManager.d.ts.map +1 -0
- package/dist/services/ProjectPackageManager.js +185 -0
- package/dist/services/ProjectPackageManager.js.map +1 -0
- package/dist/services/ProjectRegistry.d.ts +0 -16
- 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 +0 -182
- package/dist/services/TelemetryService.d.ts.map +1 -1
- package/dist/services/TelemetryService.js +0 -193
- 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 +2 -101
- package/dist/services/TreeStore.js.map +1 -1
- package/dist/services/VariantGenerationService.d.ts +0 -32
- package/dist/services/VariantGenerationService.d.ts.map +1 -1
- package/dist/services/VariantGenerationService.js +5 -62
- package/dist/services/VariantGenerationService.js.map +1 -1
- package/dist/services/VariantHistoryService.d.ts +0 -114
- package/dist/services/VariantHistoryService.d.ts.map +1 -1
- package/dist/services/VariantHistoryService.js +2 -144
- package/dist/services/VariantHistoryService.js.map +1 -1
- package/dist/services/VariantRunService.d.ts +0 -31
- package/dist/services/VariantRunService.d.ts.map +1 -1
- package/dist/services/VariantRunService.js +0 -35
- 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 +0 -5
- package/dist/services/VariantsRuntime.js.map +1 -1
- package/dist/services/WorktreeManager.d.ts +1 -220
- package/dist/services/WorktreeManager.d.ts.map +1 -1
- package/dist/services/WorktreeManager.js +75 -372
- 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/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/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 +0 -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/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 +0 -39
- package/dist/types/variant-history.d.ts.map +1 -1
- 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 +1 -15
- 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 +2 -16
- package/dist/utils/devServerError.d.ts.map +1 -1
- package/dist/utils/devServerError.js +4 -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 +2 -8
- package/dist/utils/htmlDocument.d.ts.map +1 -1
- package/dist/utils/htmlDocument.js +20 -16
- package/dist/utils/htmlDocument.js.map +1 -1
- package/dist/utils/internalGitIdentity.d.ts +2 -0
- package/dist/utils/internalGitIdentity.d.ts.map +1 -0
- package/dist/utils/internalGitIdentity.js +12 -0
- package/dist/utils/internalGitIdentity.js.map +1 -0
- 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 +1 -14
- package/dist/utils/portUtils.d.ts.map +1 -1
- package/dist/utils/portUtils.js +1 -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 +0 -8
- package/dist/utils/skills/cli-guidance.d.ts.map +1 -1
- package/dist/utils/skills/cli-guidance.js +0 -8
- 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 +15 -14
- package/scripts/verify-node-version.cjs +0 -3
- package/src/ui/dist/assets/{LibraryApp-PQNnarmo.js → LibraryApp-x6PbzlGr.js} +1 -1
- package/src/ui/dist/assets/{main-C7hdsU-C.js → main-BW1Odsqp.js} +76 -76
- package/src/ui/dist/assets/main-DDQRZm89.css +1 -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
|
@@ -31,16 +31,6 @@ const htmlDocument_1 = require("../utils/htmlDocument");
|
|
|
31
31
|
const log = (0, logger_1.createLogger)('AgentVariantsRouter');
|
|
32
32
|
const DIRECTION_TITLE_MAX_WORDS = 5;
|
|
33
33
|
const DIRECTION_SUBTITLE_MAX_WORDS = 10;
|
|
34
|
-
/**
|
|
35
|
-
* Public CDN hosts agent-generated previews are allowed to load code/assets
|
|
36
|
-
* from. We don't control which CDN the agent emits: p5.js, three.js, and
|
|
37
|
-
* friends get pulled from cdnjs / jsdelivr / esm.sh / skypack at least as often
|
|
38
|
-
* as unpkg. An unpkg-only allowlist silently CSP-blocked those scripts, leaving
|
|
39
|
-
* WebGL/canvas sketches blank — and because the violation fires inside the
|
|
40
|
-
* cross-origin preview iframe, it never surfaced in our telemetry (parent saw
|
|
41
|
-
* zero console errors). Keep this list as the de-facto set; add hosts as we
|
|
42
|
-
* observe them rather than reaching for a wildcard.
|
|
43
|
-
*/
|
|
44
34
|
const PREVIEW_CDN_HOSTS = [
|
|
45
35
|
'https://unpkg.com',
|
|
46
36
|
'https://cdn.jsdelivr.net',
|
|
@@ -48,40 +38,6 @@ const PREVIEW_CDN_HOSTS = [
|
|
|
48
38
|
'https://esm.sh',
|
|
49
39
|
'https://cdn.skypack.dev',
|
|
50
40
|
].join(' ');
|
|
51
|
-
/**
|
|
52
|
-
* CSP for agent-generated static previews. Shared by the live static-preview
|
|
53
|
-
* route and the variant-history preview route so a variant renders identically
|
|
54
|
-
* whether it's served fresh or replayed from a snapshot.
|
|
55
|
-
*
|
|
56
|
-
* Previews are served same-origin (the Rivet core server) and embedded in an
|
|
57
|
-
* iframe that deliberately keeps `allow-same-origin` (the visual editor reaches
|
|
58
|
-
* into the iframe DOM), so agent JS runs with the Rivet origin's privileges.
|
|
59
|
-
* This policy is the main thing bounding that blast radius — note the absence
|
|
60
|
-
* of `'unsafe-eval'` and of any wildcard host. `connect-src` is intentionally
|
|
61
|
-
* NOT `*`: it stops agent JS from exfiltrating anything it can read to an
|
|
62
|
-
* arbitrary server.
|
|
63
|
-
*
|
|
64
|
-
* THE RIGHT LONG-TERM FIX is to stop allowlisting CDNs entirely by serving
|
|
65
|
-
* previews from an ISOLATED ORIGIN (separate port/origin, drop
|
|
66
|
-
* `allow-same-origin`) and driving the visual editor over `postMessage`. The
|
|
67
|
-
* embedded-mode preview bridge (`src/proxy-middleware/preview-bridge.ts`)
|
|
68
|
-
* already implements exactly this handshake — migrating the default static
|
|
69
|
-
* preview onto it is the work. Once the preview no longer shares Rivet's origin
|
|
70
|
-
* or storage, this CSP can be loosened to `script-src https:` (or dropped)
|
|
71
|
-
* without widening blast radius, and the per-CDN allowlist above goes away.
|
|
72
|
-
* Until that migration lands, broadening PREVIEW_CDN_HOSTS is the stopgap.
|
|
73
|
-
*/
|
|
74
|
-
/**
|
|
75
|
-
* CSP for agent-generated static previews. Previews are served same-origin on
|
|
76
|
-
* the isolated preview port, so `'self'` resolves to the preview document's own
|
|
77
|
-
* origin and its sibling assets (CSS/JS/GLB/textures) load normally.
|
|
78
|
-
*
|
|
79
|
-
* `frame-ancestors` must also allow the editor origin: with the isolated
|
|
80
|
-
* preview origin the editor lives on a different origin than the preview, so
|
|
81
|
-
* `'self'` alone would block the editor from framing the variant preview
|
|
82
|
-
* (`frame-ancestors 'self' → refused to connect`). See
|
|
83
|
-
* docs/preview-target-addressing-design.md.
|
|
84
|
-
*/
|
|
85
41
|
const buildStaticPreviewCsp = (parentFrameOrigin, libraryOrigin) => {
|
|
86
42
|
const frameAncestors = ["'self'", parentFrameOrigin, libraryOrigin]
|
|
87
43
|
.filter(Boolean)
|
|
@@ -100,6 +56,7 @@ const buildStaticPreviewCsp = (parentFrameOrigin, libraryOrigin) => {
|
|
|
100
56
|
};
|
|
101
57
|
const previewPortBody = v3_1.z.object({
|
|
102
58
|
variantId: v3_1.z.string().min(1).nullable(),
|
|
59
|
+
retry: v3_1.z.boolean().optional(),
|
|
103
60
|
});
|
|
104
61
|
const commitBody = v3_1.z.object({
|
|
105
62
|
variantId: v3_1.z.string().min(1),
|
|
@@ -252,9 +209,7 @@ const inlineVariantBody = v3_1.z.object({
|
|
|
252
209
|
.passthrough())
|
|
253
210
|
.min(1),
|
|
254
211
|
sourceFiles: v3_1.z.array(v3_1.z.string()).optional(),
|
|
255
|
-
/** Vary on an existing variant: attaches to the active session. */
|
|
256
212
|
target: inlineVariantTargetSchema.optional(),
|
|
257
|
-
/** Vary on an HTML-only static preview: forks it via the refine flow. */
|
|
258
213
|
staticPreviewTarget: inlineStaticPreviewTargetSchema.optional(),
|
|
259
214
|
telemetryContext: v3_1.z
|
|
260
215
|
.object({
|
|
@@ -265,9 +220,6 @@ const inlineVariantBody = v3_1.z.object({
|
|
|
265
220
|
traceId: v3_1.z.string().optional(),
|
|
266
221
|
agentRunId: v3_1.z.string().optional(),
|
|
267
222
|
initiator: inlineInitiatorSchema,
|
|
268
|
-
/** Explicit per-request worker runtime choice ("run my workers on opus
|
|
269
|
-
* from this Codex session"). Flag-relayed by the host agent, never
|
|
270
|
-
* inferred — see WorkerSelection in change-request-types. */
|
|
271
223
|
workerSelection: v3_1.z
|
|
272
224
|
.object({
|
|
273
225
|
provider: v3_1.z.enum(['claude', 'codex', 'cursor']).optional(),
|
|
@@ -287,17 +239,12 @@ const hostVariantCompleteBody = v3_1.z.object({
|
|
|
287
239
|
title: v3_1.z.string().min(1).max(120).optional(),
|
|
288
240
|
description: v3_1.z.string().min(1).max(400).optional(),
|
|
289
241
|
});
|
|
290
|
-
// Shared by the active-session and history rename routes. Trim first so a
|
|
291
|
-
// whitespace-only title is rejected, and cap the length so an over-long label
|
|
292
|
-
// can't bloat the snapshot or the on-disk manifest.
|
|
293
242
|
const renameLabelSchema = v3_1.z.preprocess((v) => (typeof v === 'string' ? v.trim() : v), v3_1.z.string().min(1).max(120));
|
|
294
243
|
const renameBody = v3_1.z.object({
|
|
295
244
|
label: renameLabelSchema,
|
|
296
245
|
projectPath: v3_1.z.string().optional(),
|
|
297
246
|
});
|
|
298
247
|
const RENAME_VALIDATION_MESSAGE = 'Invalid rename — `label` must be a non-empty string of at most 120 characters.';
|
|
299
|
-
// Run-folder rename — one call re-homes one session request batch, live and
|
|
300
|
-
// history alike; the client never fans out per-variant.
|
|
301
248
|
const renameRunBody = v3_1.z.object({
|
|
302
249
|
sessionId: v3_1.z.string().min(1),
|
|
303
250
|
requestId: v3_1.z.string().min(1).optional(),
|
|
@@ -305,10 +252,6 @@ const renameRunBody = v3_1.z.object({
|
|
|
305
252
|
label: renameLabelSchema,
|
|
306
253
|
projectPath: v3_1.z.string().optional(),
|
|
307
254
|
});
|
|
308
|
-
// The variants panel's UI arrangement (pinned items + user-arranged order),
|
|
309
|
-
// persisted as one metadata_state row in the project's rivet.db. Keys are
|
|
310
|
-
// panel-owned opaque strings (`row:…`/`group:…` pin keys, group keys, row
|
|
311
|
-
// keys); the caps only bound a runaway payload, not the shape's semantics.
|
|
312
255
|
const uiStateKeySchema = v3_1.z.string().min(1).max(500);
|
|
313
256
|
const uiStateSchema = v3_1.z.object({
|
|
314
257
|
pinned: v3_1.z.array(uiStateKeySchema).max(1000),
|
|
@@ -325,20 +268,6 @@ const uiStatePutBody = v3_1.z.object({
|
|
|
325
268
|
uiState: uiStateSchema,
|
|
326
269
|
projectPath: v3_1.z.string().optional(),
|
|
327
270
|
});
|
|
328
|
-
/**
|
|
329
|
-
* Express routes that back the iframe variants chip.
|
|
330
|
-
*
|
|
331
|
-
* - GET /api/variants/active — current active session state for the chip
|
|
332
|
-
* - GET /api/variants/:sessionId — explicit session lookup
|
|
333
|
-
* - POST /api/variants/:sessionId/preview-port — switch proxy to a variant's
|
|
334
|
-
* dev server (or null to restore the user's default dev server)
|
|
335
|
-
* - GET /api/variants/:sessionId/static/:variantId — serve static preview HTML
|
|
336
|
-
* - GET /api/variants/:sessionId/design-md/:artifactId — serve raw DESIGN.md
|
|
337
|
-
* - GET /api/variants/:sessionId/design-md/:artifactId/view — serve DesignMD page
|
|
338
|
-
* - POST /api/variants/:sessionId/commit — user picked this variant in the
|
|
339
|
-
* chip; orchestrator enqueues the diff onto pending changes
|
|
340
|
-
* - POST /api/variants/:sessionId/cancel — dismiss the variants session
|
|
341
|
-
*/
|
|
342
271
|
const HISTORY_STATUSES = new Set([
|
|
343
272
|
'completed',
|
|
344
273
|
'committed',
|
|
@@ -363,16 +292,10 @@ const escapeHtml = (value) => value.replace(/[&<>"']/g, (char) => {
|
|
|
363
292
|
return char;
|
|
364
293
|
}
|
|
365
294
|
});
|
|
366
|
-
/**
|
|
367
|
-
* Selects the best persisted human label to describe a public variant share.
|
|
368
|
-
*/
|
|
369
295
|
const getVariantShareTitle = (manifest) => {
|
|
370
296
|
const title = [manifest.label, manifest.brief, manifest.sessionPrompt].find((candidate) => candidate.trim().length > 0);
|
|
371
297
|
return (0, PrototypeDeployService_1.normalizePrototypeShareTitle)(title) ?? VARIANT_SHARE_TITLE_FALLBACK;
|
|
372
298
|
};
|
|
373
|
-
/**
|
|
374
|
-
* Selects the run prompt for a public canvas share, with a stable fallback.
|
|
375
|
-
*/
|
|
376
299
|
const getCanvasShareTitle = (sessionPrompt) => {
|
|
377
300
|
return ((0, PrototypeDeployService_1.normalizePrototypeShareTitle)(sessionPrompt) ?? CANVAS_SHARE_TITLE_FALLBACK);
|
|
378
301
|
};
|
|
@@ -380,9 +303,6 @@ const CANVAS_IFRAME_SANDBOX = 'allow-scripts allow-forms allow-popups';
|
|
|
380
303
|
const RIVET_SOCIAL_IMAGE_URL = 'https://rivet.design/images/rivet-social.png';
|
|
381
304
|
const RIVET_DEFAULT_SHARE_DESCRIPTION = 'Built with Rivet — the visual editor for design';
|
|
382
305
|
const UNSUPPORTED_PROTOTYPE_DEPLOY_MESSAGE = "This prototype can't be deployed — only buildable app directions or static previews are supported.";
|
|
383
|
-
/**
|
|
384
|
-
* Render a public canvas page that puts every deployed direction in one shareable view.
|
|
385
|
-
*/
|
|
386
306
|
const buildCanvasShareHtml = (args) => {
|
|
387
307
|
const prompt = args.sessionPrompt.trim();
|
|
388
308
|
const variantCards = args.variants
|
|
@@ -538,7 +458,6 @@ ${variantCards}
|
|
|
538
458
|
</body>
|
|
539
459
|
</html>`;
|
|
540
460
|
};
|
|
541
|
-
/** Resolve a Rivet-generated subproject path to the workspace that owns variant history. */
|
|
542
461
|
const generatedProjectWorkspaceRoot = (projectPath) => {
|
|
543
462
|
const normalized = path_1.default.normalize(projectPath);
|
|
544
463
|
const segments = normalized.split(path_1.default.sep);
|
|
@@ -549,14 +468,6 @@ const generatedProjectWorkspaceRoot = (projectPath) => {
|
|
|
549
468
|
const rootPath = segments.slice(0, rivetIndex).join(path_1.default.sep);
|
|
550
469
|
return path_1.default.resolve(rootPath || path_1.default.parse(normalized).root);
|
|
551
470
|
};
|
|
552
|
-
/**
|
|
553
|
-
* Stamp the live {@link WatcherLiveness} onto a variants snapshot so the UI can
|
|
554
|
-
* detect a stale host-agent watch loop off real queue/waiter state. Applied to
|
|
555
|
-
* BOTH active and inactive snapshots — a change can strand with no variants
|
|
556
|
-
* session active — while the variant FIFO depth (`pendingVariantRequests`) is
|
|
557
|
-
* still only stamped on active snapshots, preserving prior behavior. Returns
|
|
558
|
-
* the snapshot untouched when no liveness is available (no bridge).
|
|
559
|
-
*/
|
|
560
471
|
const stampWatcherLiveness = (snapshot, liveness, pendingVariantRequestCount, activeLeases = []) => {
|
|
561
472
|
if (!liveness || typeof snapshot !== 'object' || snapshot === null) {
|
|
562
473
|
return snapshot;
|
|
@@ -578,19 +489,11 @@ const stampWatcherLiveness = (snapshot, liveness, pendingVariantRequestCount, ac
|
|
|
578
489
|
exports.stampWatcherLiveness = stampWatcherLiveness;
|
|
579
490
|
const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHistoryOverride, deployServiceOverride, variantRunService, historyReplayOverride, previewBridge, inlineStartTrackerOverride) => {
|
|
580
491
|
const router = (0, express_1.Router)();
|
|
581
|
-
// `agent_variants.*` events from this router (preview switches, active-project
|
|
582
|
-
// transitions) must carry the browser's PostHog $session_id to link to a
|
|
583
|
-
// session replay; the bridge holds it. Falls back to raw telemetry when no
|
|
584
|
-
// bridge is wired (e.g. demo mounts), where no browser session is available.
|
|
585
492
|
const variantsTelemetry = telemetry && bridge
|
|
586
493
|
? (0, createAgentVariantsOrchestrator_1.withVariantsSessionReplayLinking)(telemetry, bridge)
|
|
587
494
|
: telemetry;
|
|
588
495
|
const variantHistory = variantHistoryOverride ?? new VariantHistoryService_1.VariantHistoryService();
|
|
589
496
|
const deployService = deployServiceOverride ?? new PrototypeDeployService_1.PrototypeDeployService();
|
|
590
|
-
// Replay shares the orchestrator's WorktreeManager instance: the
|
|
591
|
-
// reserved-but-not-yet-bound port set is per-instance, so a separate
|
|
592
|
-
// manager could hand a live variant's pending port to a replay
|
|
593
|
-
// (EADDRINUSE for whichever binds second).
|
|
594
497
|
const historyReplay = historyReplayOverride ??
|
|
595
498
|
new HistoryReplayService_1.HistoryReplayService({
|
|
596
499
|
history: variantHistory,
|
|
@@ -612,11 +515,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
612
515
|
}
|
|
613
516
|
next();
|
|
614
517
|
});
|
|
615
|
-
/**
|
|
616
|
-
* Stamp the live watcher liveness onto a snapshot before it leaves the server.
|
|
617
|
-
* The `typeof` guards keep partial bridge mocks (and a missing bridge) from
|
|
618
|
-
* throwing — production always has the real bridge methods.
|
|
619
|
-
*/
|
|
620
518
|
const stampLiveness = (snapshot) => (0, exports.stampWatcherLiveness)(snapshot, bridge && typeof bridge.getWatcherLiveness === 'function'
|
|
621
519
|
? bridge.getWatcherLiveness()
|
|
622
520
|
: null, bridge && typeof bridge.pendingVariantRequestCount === 'function'
|
|
@@ -630,7 +528,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
630
528
|
}
|
|
631
529
|
return bridge?.getProjectPath() ?? null;
|
|
632
530
|
};
|
|
633
|
-
/** Resolve every project root that can own history for the requested route. */
|
|
634
531
|
const resolveHistoryProjectPaths = (params) => {
|
|
635
532
|
const seen = new Set();
|
|
636
533
|
const candidates = [];
|
|
@@ -655,15 +552,10 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
655
552
|
}
|
|
656
553
|
}
|
|
657
554
|
catch {
|
|
658
|
-
// Persisted sessions may outlive in-memory orchestrator state.
|
|
659
555
|
}
|
|
660
556
|
}
|
|
661
557
|
const upwardRoot = generatedProjectWorkspaceRoot(params.projectPath);
|
|
662
558
|
addCandidate(upwardRoot);
|
|
663
|
-
// Rediscover fresh-session workdirs nested under a repo root. Without this,
|
|
664
|
-
// a stop/restart drops the in-memory session (and its `workspacePath`), so
|
|
665
|
-
// reopening the root — whose own `.rivet/variants` is empty — would surface
|
|
666
|
-
// none of the directions stored under `<root>/.rivet/<slug>/.rivet/variants`.
|
|
667
559
|
for (const scanRoot of [params.projectPath, upwardRoot]) {
|
|
668
560
|
if (!scanRoot)
|
|
669
561
|
continue;
|
|
@@ -700,15 +592,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
700
592
|
}
|
|
701
593
|
return { kind: 'existing', projectPath: args.projectPath };
|
|
702
594
|
};
|
|
703
|
-
/**
|
|
704
|
-
* Resolve a variant reference whose session is no longer active from
|
|
705
|
-
* persisted history and adopt it — into the usable active session, or a
|
|
706
|
-
* fresh one — so targeted requests keep working after restarts and newer
|
|
707
|
-
* runs. This is the same adoption flow the editor uses when a past
|
|
708
|
-
* direction is edited; the CLI/agent path simply reuses it.
|
|
709
|
-
*/
|
|
710
|
-
/** @effect Rejects a request that would displace or mutate an actively
|
|
711
|
-
* generating session. Ready/terminal sessions rotate normally. */
|
|
712
595
|
const rejectBlockedVariantSession = (res, snapshot) => {
|
|
713
596
|
if (!(0, variantSessionStart_1.isVariantSessionStartBlocked)(snapshot))
|
|
714
597
|
return false;
|
|
@@ -716,9 +599,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
716
599
|
const sessionId = snapshot.active === true ? snapshot.sessionId : undefined;
|
|
717
600
|
res.status(400).json({
|
|
718
601
|
error: 'Variants session already active',
|
|
719
|
-
// Name the blocker so callers are not flying blind, and never
|
|
720
|
-
// recommend cancel as remediation: cancelling to unblock destroys
|
|
721
|
-
// the user's in-progress work. Only a human should decide that.
|
|
722
602
|
details: `A variants session is active${sessionId
|
|
723
603
|
? ` (session ${sessionId}${stage ? `, stage ${stage}` : ''})`
|
|
724
604
|
: ''}. Wait for it to settle (poll status), target it with --target to refine it, or ask the user before cancelling anything.`,
|
|
@@ -762,8 +642,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
762
642
|
'its artifact instead.',
|
|
763
643
|
};
|
|
764
644
|
}
|
|
765
|
-
// The history lookup is async — a run may have started meanwhile. Never
|
|
766
|
-
// adopt into (or displace) a session that is actively generating.
|
|
767
645
|
const raceSnapshot = orchestrator.buildActiveSnapshot();
|
|
768
646
|
if ((0, variantSessionStart_1.isVariantSessionStartBlocked)(raceSnapshot)) {
|
|
769
647
|
return { ok: false, kind: 'blocked', snapshot: raceSnapshot };
|
|
@@ -799,9 +677,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
799
677
|
});
|
|
800
678
|
return true;
|
|
801
679
|
};
|
|
802
|
-
/**
|
|
803
|
-
* Resolve the saved app directory a deploy build should run from.
|
|
804
|
-
*/
|
|
805
680
|
const resolveDeployableAppDir = async (args) => {
|
|
806
681
|
const manifest = args.variant.manifest;
|
|
807
682
|
if (manifest.projectKind === 'fresh' &&
|
|
@@ -824,9 +699,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
824
699
|
}
|
|
825
700
|
return appDir;
|
|
826
701
|
};
|
|
827
|
-
/**
|
|
828
|
-
* Deploy one persisted variant and append the returned public URL to history.
|
|
829
|
-
*/
|
|
830
702
|
const deployPersistedVariant = async (args) => {
|
|
831
703
|
const existingDeployments = args.variant.manifest.deployments ?? [];
|
|
832
704
|
const latestDeployment = existingDeployments.length > 0
|
|
@@ -848,8 +720,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
848
720
|
const title = getVariantShareTitle(args.variant.manifest);
|
|
849
721
|
let result;
|
|
850
722
|
if (preview.kind === 'static') {
|
|
851
|
-
// Already a built static bundle (e.g. a history static-preview variant)
|
|
852
|
-
// — upload files/ directly, no build needed.
|
|
853
723
|
result = await deployService.deployStatic(filesDir, {
|
|
854
724
|
title,
|
|
855
725
|
entryPath: preview.entryPath,
|
|
@@ -909,13 +779,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
909
779
|
});
|
|
910
780
|
return;
|
|
911
781
|
}
|
|
912
|
-
// Resolve a variant target that points at an HTML-only static preview:
|
|
913
|
-
// those requests fork through the refine flow rather than code-gen (a
|
|
914
|
-
// static preview has no worktree to edit). Gate on the TRUE work-item kind
|
|
915
|
-
// — never on HTML presence or the client's claim: an existing-project
|
|
916
|
-
// `code_gen` variant materialized as a static preview serves HTML and
|
|
917
|
-
// displays as `static_artifact`, but owns a worktree and MUST fork via the
|
|
918
|
-
// code_gen path (the static fork would reject it with VARIANT_NOT_EDITABLE).
|
|
919
782
|
const batchTarget = parsed.data.target;
|
|
920
783
|
const claimedStaticTarget = parsed.data.staticPreviewTarget ??
|
|
921
784
|
(batchTarget
|
|
@@ -954,20 +817,10 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
954
817
|
return;
|
|
955
818
|
}
|
|
956
819
|
const activeVariantsSession = orchestrator.buildActiveSnapshot();
|
|
957
|
-
// A targeted request against the CURRENTLY active session attaches to it
|
|
958
|
-
// directly. A reference to any other session — the originating session
|
|
959
|
-
// ended, the server restarted, or a newer run replaced it — resolves
|
|
960
|
-
// through persisted history: adopt the snapshot (into the usable active
|
|
961
|
-
// session, or a fresh one) and retarget the request at the adopted live
|
|
962
|
-
// variant. Copied variant references stay actionable for their whole
|
|
963
|
-
// lifetime, not just while their session is in memory.
|
|
964
820
|
let effectiveTarget = batchTarget ?? staticPreviewTarget;
|
|
965
821
|
const isPersistedTargetRequest = Boolean(effectiveTarget &&
|
|
966
822
|
(activeVariantsSession.active !== true ||
|
|
967
823
|
effectiveTarget.sessionId !== activeVariantsSession.sessionId));
|
|
968
|
-
// Adoption creates or mutates a session, so persisted-target requests
|
|
969
|
-
// follow the same intake rules as untargeted starts: never displace an
|
|
970
|
-
// actively generating session, and never race an in-flight start.
|
|
971
824
|
if ((isPersistedTargetRequest || !effectiveTarget) &&
|
|
972
825
|
rejectBlockedVariantSession(res, activeVariantsSession)) {
|
|
973
826
|
return;
|
|
@@ -1028,10 +881,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
1028
881
|
variantId: adoption.workItemId,
|
|
1029
882
|
}
|
|
1030
883
|
: undefined;
|
|
1031
|
-
// Rewrite EVERY pointer at the dead reference — the batch-level
|
|
1032
|
-
// fields and the per-change `target`/`staticPreviewTarget` pair the
|
|
1033
|
-
// editor sends (the refine flow prefers the per-change static target,
|
|
1034
|
-
// so leaving it stale would aim the refine at the ended session).
|
|
1035
884
|
const matchesStaleTarget = (candidate) => Boolean(candidate &&
|
|
1036
885
|
candidate.sessionId === staleTarget.sessionId &&
|
|
1037
886
|
candidate.variantId === staleTarget.variantId);
|
|
@@ -1061,16 +910,17 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
1061
910
|
};
|
|
1062
911
|
effectiveTarget = liveTarget;
|
|
1063
912
|
}
|
|
913
|
+
const refineStaticPreviewBatch = variantRunService.refineStaticPreviewBatch?.bind(variantRunService);
|
|
1064
914
|
const isStaticPreviewFork = Boolean(request.staticPreviewTarget);
|
|
1065
|
-
if (isStaticPreviewFork && !
|
|
915
|
+
if (isStaticPreviewFork && !refineStaticPreviewBatch) {
|
|
1066
916
|
res.status(503).json({
|
|
1067
917
|
error: 'Static preview refinement unavailable',
|
|
1068
918
|
reason: 'inline_variants_unavailable',
|
|
1069
919
|
});
|
|
1070
920
|
return;
|
|
1071
921
|
}
|
|
1072
|
-
const result = isStaticPreviewFork
|
|
1073
|
-
? await
|
|
922
|
+
const result = isStaticPreviewFork && refineStaticPreviewBatch
|
|
923
|
+
? await refineStaticPreviewBatch(request)
|
|
1074
924
|
: await variantRunService.startElementVariants(request);
|
|
1075
925
|
if (!result.success) {
|
|
1076
926
|
res.status(500).json({
|
|
@@ -1146,16 +996,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
1146
996
|
starting: inlineStartTracker.isStarting(),
|
|
1147
997
|
}));
|
|
1148
998
|
});
|
|
1149
|
-
/**
|
|
1150
|
-
* Server-Sent Events stream for the iframe chip. Pushes a fresh
|
|
1151
|
-
* ActiveSnapshot whenever the orchestrator's state changes (propose,
|
|
1152
|
-
* approve, report-complete, dev-server-up, terminal, cancel, commit) so
|
|
1153
|
-
* the chip never has to poll.
|
|
1154
|
-
*
|
|
1155
|
-
* Heartbeats every 30s as comments (`: heartbeat\n\n`) to keep
|
|
1156
|
-
* intermediate proxies from killing the connection on idle. EventSource
|
|
1157
|
-
* auto-reconnects on disconnect.
|
|
1158
|
-
*/
|
|
1159
999
|
router.get('/variants/events', (req, res) => {
|
|
1160
1000
|
if (rejectNonLocalRequest(req, res))
|
|
1161
1001
|
return;
|
|
@@ -1166,10 +1006,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
1166
1006
|
'X-Accel-Buffering': 'no',
|
|
1167
1007
|
});
|
|
1168
1008
|
res.flushHeaders?.();
|
|
1169
|
-
// Stamp each snapshot with the live variant-request FIFO depth + watcher
|
|
1170
|
-
// liveness. Both live on the bridge (not the orchestrator), so
|
|
1171
|
-
// buildActiveSnapshot() can't fill them in — we add them here at write time
|
|
1172
|
-
// so the initial state and every subscribed update carry them.
|
|
1173
1009
|
const writeSnapshot = (snapshot) => {
|
|
1174
1010
|
try {
|
|
1175
1011
|
const activeSnapshot = snapshot && typeof snapshot === 'object'
|
|
@@ -1184,20 +1020,13 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
1184
1020
|
log.warn('SSE write failed (client likely disconnected)', err);
|
|
1185
1021
|
}
|
|
1186
1022
|
};
|
|
1187
|
-
// Initial state so the chip can render immediately.
|
|
1188
1023
|
writeSnapshot(orchestrator.buildActiveSnapshot());
|
|
1189
1024
|
const unsubscribe = orchestrator.subscribeToEvents(writeSnapshot);
|
|
1190
|
-
// Re-push on bridge queue/waiter changes too. A change the user sends with
|
|
1191
|
-
// no host agent draining it never produces an orchestrator event, so
|
|
1192
|
-
// without this the stale-watcher banner would never see the strand.
|
|
1193
1025
|
const unsubscribeLiveness = bridge && typeof bridge.onWatcherLivenessChange === 'function'
|
|
1194
1026
|
? bridge.onWatcherLivenessChange(() => {
|
|
1195
1027
|
writeSnapshot(orchestrator.buildActiveSnapshot());
|
|
1196
1028
|
})
|
|
1197
1029
|
: undefined;
|
|
1198
|
-
// A live SSE subscriber means a Rivet page is open; track it so the MCP
|
|
1199
|
-
// server can skip re-opening a duplicate browser tab when the variants flow
|
|
1200
|
-
// re-enters an already-active editor session.
|
|
1201
1030
|
const releaseUiClient = orchestrator.registerUiClient();
|
|
1202
1031
|
const heartbeat = setInterval(() => {
|
|
1203
1032
|
try {
|
|
@@ -1205,7 +1034,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
1205
1034
|
res.write(': heartbeat\n\n');
|
|
1206
1035
|
}
|
|
1207
1036
|
catch {
|
|
1208
|
-
// ignore — close handler will clean up
|
|
1209
1037
|
}
|
|
1210
1038
|
}, 30_000);
|
|
1211
1039
|
req.on('close', () => {
|
|
@@ -1217,7 +1045,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
1217
1045
|
res.end();
|
|
1218
1046
|
}
|
|
1219
1047
|
catch {
|
|
1220
|
-
// already ended
|
|
1221
1048
|
}
|
|
1222
1049
|
});
|
|
1223
1050
|
});
|
|
@@ -1253,11 +1080,7 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
1253
1080
|
return;
|
|
1254
1081
|
}
|
|
1255
1082
|
try {
|
|
1256
|
-
const entries = (await Promise.all(resolveHistoryProjectPaths({ projectPath }).map((historyProjectPath) =>
|
|
1257
|
-
// Reads the SQLite metadata index when it's usable and falls
|
|
1258
|
-
// back to the manifest walk otherwise — same entries, faster
|
|
1259
|
-
// list. Detail/preview routes stay manifest/file-backed.
|
|
1260
|
-
variantHistory.listVariantsFromIndex({
|
|
1083
|
+
const entries = (await Promise.all(resolveHistoryProjectPaths({ projectPath }).map((historyProjectPath) => variantHistory.listVariantsFromIndex({
|
|
1261
1084
|
projectPath: historyProjectPath,
|
|
1262
1085
|
status: statusParam,
|
|
1263
1086
|
})))).flat();
|
|
@@ -1267,10 +1090,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
1267
1090
|
}
|
|
1268
1091
|
const uniqueEntries = Array.from(entriesById.values()).sort((a, b) => b.manifest.createdAt.localeCompare(a.manifest.createdAt));
|
|
1269
1092
|
const limitedEntries = limit !== undefined ? uniqueEntries.slice(0, limit) : uniqueEntries;
|
|
1270
|
-
// Removed and cancelled variants are retained on disk but never surfaced
|
|
1271
|
-
// in the default history list. Keeps dismissed and cancelled directions
|
|
1272
|
-
// hidden once the session is no longer active, matching the
|
|
1273
|
-
// list_past_variants MCP tool.
|
|
1274
1093
|
const visibleEntries = statusParam === 'removed'
|
|
1275
1094
|
? limitedEntries
|
|
1276
1095
|
: limitedEntries.filter((entry) => entry.manifest.status !== 'removed' &&
|
|
@@ -1295,14 +1114,8 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
1295
1114
|
preview: entry.manifest.preview,
|
|
1296
1115
|
artifact: entry.manifest.artifact,
|
|
1297
1116
|
parentVariant: entry.manifest.parentVariant,
|
|
1298
|
-
// Tree-store fields (absent on legacy entries): `serve` tells the
|
|
1299
|
-
// panel how a tree-backed entry previews (static → history preview
|
|
1300
|
-
// route; dev-server → the replay run route), `hasTree` marks the
|
|
1301
|
-
// entry as snapshot-backed at all.
|
|
1302
1117
|
...(entry.manifest.serve ? { serve: entry.manifest.serve } : {}),
|
|
1303
1118
|
hasTree: Boolean(entry.manifest.tree),
|
|
1304
|
-
// The runtime that built this direction (vendor/model/effort) —
|
|
1305
|
-
// absent on legacy entries and host-agent-executed variants.
|
|
1306
1119
|
...(entry.manifest.runtime
|
|
1307
1120
|
? { runtime: entry.manifest.runtime }
|
|
1308
1121
|
: {}),
|
|
@@ -1313,10 +1126,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
1313
1126
|
sendError(res, err);
|
|
1314
1127
|
}
|
|
1315
1128
|
});
|
|
1316
|
-
// The variants panel's UI arrangement (pins + custom order). Stored in the
|
|
1317
|
-
// project's rivet.db metadata_state — per-project and shared across
|
|
1318
|
-
// browsers, unlike the panel's other localStorage preferences. Not
|
|
1319
|
-
// rebuildable: losing the database resets the arrangement.
|
|
1320
1129
|
router.get('/variants/ui-state', async (req, res) => {
|
|
1321
1130
|
if (rejectNonLocalRequest(req, res))
|
|
1322
1131
|
return;
|
|
@@ -1336,7 +1145,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
1336
1145
|
stored = JSON.parse(raw);
|
|
1337
1146
|
}
|
|
1338
1147
|
catch {
|
|
1339
|
-
// A corrupt row reads as "nothing stored" — the next PUT heals it.
|
|
1340
1148
|
}
|
|
1341
1149
|
}
|
|
1342
1150
|
const parsed = uiStateSchema.safeParse(stored);
|
|
@@ -1376,13 +1184,8 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
1376
1184
|
sendError(res, err);
|
|
1377
1185
|
}
|
|
1378
1186
|
});
|
|
1379
|
-
// The entry route resolves the saved document's canonical URL. HTML files
|
|
1380
|
-
// served below that URL receive the document policy and preview bridge.
|
|
1381
1187
|
router.get('/variants/history/:sessionId/:variantId/preview', async (req, res) => serveHistoryPreview(req, res, variantHistory, resolveProjectPath, resolveHistoryProjectPaths, { isDocument: true }, previewBridge));
|
|
1382
1188
|
router.get('/variants/history/:sessionId/:variantId/preview/{*assetPath}', async (req, res) => serveHistoryPreview(req, res, variantHistory, resolveProjectPath, resolveHistoryProjectPaths, { isDocument: false }, previewBridge));
|
|
1383
|
-
// Stop history replay servers. Registered before the
|
|
1384
|
-
// parameterized history routes purely for clarity — method+arity keep it
|
|
1385
|
-
// unambiguous either way.
|
|
1386
1189
|
router.post('/variants/history/replay/stop', async (req, res) => {
|
|
1387
1190
|
if (rejectNonLocalRequest(req, res))
|
|
1388
1191
|
return;
|
|
@@ -1396,12 +1199,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
1396
1199
|
}
|
|
1397
1200
|
res.json({ stopped: true });
|
|
1398
1201
|
});
|
|
1399
|
-
/**
|
|
1400
|
-
* Boot a past dev-server variant from its tree-store ref: materialize the
|
|
1401
|
-
* exact tree, overlay runtime (.env / node_modules), start the persisted
|
|
1402
|
-
* serve recipe, and optionally retarget the main preview proxy at the new
|
|
1403
|
-
* port. See docs/variant-history-tree-store-design.md.
|
|
1404
|
-
*/
|
|
1405
1202
|
router.post('/variants/history/:sessionId/:variantId/run', async (req, res) => {
|
|
1406
1203
|
if (rejectNonLocalRequest(req, res))
|
|
1407
1204
|
return;
|
|
@@ -1553,7 +1350,7 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
1553
1350
|
}
|
|
1554
1351
|
let port = orchestrator.getDevServerPort(sessionId, parsed.data.variantId);
|
|
1555
1352
|
if (typeof port !== 'number') {
|
|
1556
|
-
port = await orchestrator.restoreVariantPreview(sessionId, parsed.data.variantId);
|
|
1353
|
+
port = await orchestrator.restoreVariantPreview(sessionId, parsed.data.variantId, { retryFailed: parsed.data.retry === true });
|
|
1557
1354
|
}
|
|
1558
1355
|
variantsTelemetry?.trackAgentVariantsPreviewSwitchStarted({
|
|
1559
1356
|
sessionId,
|
|
@@ -1602,13 +1399,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
1602
1399
|
sendError(res, err);
|
|
1603
1400
|
}
|
|
1604
1401
|
});
|
|
1605
|
-
/**
|
|
1606
|
-
* Adopt a PAST (history) variant into the active session as a first-class
|
|
1607
|
-
* succeeded variant, so the user's first edit on a selected past direction
|
|
1608
|
-
* routes to a real session member. Resolves the persisted snapshot from
|
|
1609
|
-
* history, then hands the rehydration `files/` dir to the orchestrator. The
|
|
1610
|
-
* UI calls this on first comment/Vary against a selected past variant.
|
|
1611
|
-
*/
|
|
1612
1402
|
router.post('/variants/adopt-past', async (req, res) => {
|
|
1613
1403
|
if (rejectNonLocalRequest(req, res))
|
|
1614
1404
|
return;
|
|
@@ -1754,43 +1544,21 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
1754
1544
|
});
|
|
1755
1545
|
return;
|
|
1756
1546
|
}
|
|
1757
|
-
// Only inject `<base href>` when the variant actually has sibling
|
|
1758
|
-
// assets to serve. Otherwise the inlined HTML is self-contained and
|
|
1759
|
-
// the base tag would only serve to mis-resolve any incidental
|
|
1760
|
-
// relative URLs (e.g. `<a href="something">`) against the asset
|
|
1761
|
-
// sub-path. The hasAssets check also avoids the trailing-slash
|
|
1762
|
-
// fragment-link quirk for the common no-assets case.
|
|
1763
1547
|
const hasAssets = orchestrator.hasStaticPreviewAssets(sessionId, variantId);
|
|
1764
1548
|
if (hasAssets &&
|
|
1765
1549
|
!req.originalUrl.includes('?') &&
|
|
1766
1550
|
!req.originalUrl.endsWith('/')) {
|
|
1767
|
-
// Document URL must end in `/` so the browser's `document.URL` and
|
|
1768
|
-
// the `<base href>` agree. Otherwise fragment-only links
|
|
1769
|
-
// (`<a href="#section">`) resolve to the base-href URL — different
|
|
1770
|
-
// from the current URL — and the browser does a full navigation,
|
|
1771
|
-
// hitting the asset route with an empty path → 404. Redirect to
|
|
1772
|
-
// the canonical trailing-slash form before serving.
|
|
1773
1551
|
res.redirect(301, req.originalUrl + '/');
|
|
1774
1552
|
return;
|
|
1775
1553
|
}
|
|
1776
1554
|
const withBaseHref = hasAssets
|
|
1777
|
-
? injectBaseHref(html,
|
|
1778
|
-
// Trailing slash is required so `./avatar.glb` resolves to
|
|
1779
|
-
// `.../static/<vid>/avatar.glb`, not `.../static/avatar.glb`.
|
|
1780
|
-
`/api/variants/${encodeURIComponent(sessionId)}/static/${encodeURIComponent(variantId)}/`)
|
|
1555
|
+
? injectBaseHref(html, `/api/variants/${encodeURIComponent(sessionId)}/static/${encodeURIComponent(variantId)}/`)
|
|
1781
1556
|
: html;
|
|
1782
|
-
// In embedded mode the visual editor drives this iframe over the preview
|
|
1783
|
-
// bridge; without the injected listener, selecting/commenting on the
|
|
1784
|
-
// variant times out (`Preview bridge timed out`) and the comment input
|
|
1785
|
-
// never opens. Mirror the base static route (`routes/static.ts`).
|
|
1786
1557
|
const finalHtml = previewBridge?.isEnabled
|
|
1787
1558
|
? (0, preview_bridge_1.injectPreviewBridge)(withBaseHref, {
|
|
1788
1559
|
expectedParentOrigin: previewBridge.expectedParentOrigin,
|
|
1789
1560
|
})
|
|
1790
1561
|
: withBaseHref;
|
|
1791
|
-
// Constrain the blast radius of agent-generated scripts. See
|
|
1792
|
-
// buildStaticPreviewCsp for the policy and the isolated-origin migration
|
|
1793
|
-
// that will eventually let us drop the per-CDN allowlist.
|
|
1794
1562
|
res
|
|
1795
1563
|
.status(200)
|
|
1796
1564
|
.type('html')
|
|
@@ -1870,13 +1638,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
1870
1638
|
sendError(res, err);
|
|
1871
1639
|
}
|
|
1872
1640
|
});
|
|
1873
|
-
/**
|
|
1874
|
-
* Serve sibling assets the variant's HTML references (e.g. `./avatar.glb`,
|
|
1875
|
-
* `./hero.png`). The agent reports `output.assetBase` alongside the inline
|
|
1876
|
-
* HTML; the orchestrator sandboxes it inside the fresh-session workspace
|
|
1877
|
-
* and exposes a resolver. Path-traversal-rejected requests + missing files
|
|
1878
|
-
* return 404. Loopback-only.
|
|
1879
|
-
*/
|
|
1880
1641
|
router.get('/variants/:sessionId/static/:variantId/{*assetPath}', (req, res) => {
|
|
1881
1642
|
if (rejectNonLocalRequest(req, res))
|
|
1882
1643
|
return;
|
|
@@ -1894,10 +1655,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
1894
1655
|
});
|
|
1895
1656
|
return;
|
|
1896
1657
|
}
|
|
1897
|
-
// `dotfiles: 'allow'` because workspacePath is typically nested
|
|
1898
|
-
// under a `.rivet/` directory (Rivet's per-project state dir) —
|
|
1899
|
-
// sendFile's default 'ignore' setting 404s anything with a hidden
|
|
1900
|
-
// segment, which would always trigger here.
|
|
1901
1658
|
res.sendFile(abs, {
|
|
1902
1659
|
dotfiles: 'allow',
|
|
1903
1660
|
headers: { 'Cache-Control': 'no-store' },
|
|
@@ -1956,14 +1713,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
1956
1713
|
}
|
|
1957
1714
|
try {
|
|
1958
1715
|
bridge.rebindProjectPath(result.destinationPath);
|
|
1959
|
-
// Do NOT call switchPreviewPort(null) here on the fresh vite_app
|
|
1960
|
-
// path: commitVariant has already spawned a fresh dev server at
|
|
1961
|
-
// destinationPath and retargeted the proxy to its port via the
|
|
1962
|
-
// orchestrator's switchPreviewPort callback. Calling null here
|
|
1963
|
-
// would route the proxy to the default upstream (the user's repo,
|
|
1964
|
-
// which has no dev server) and the iframe would show "preview
|
|
1965
|
-
// disconnected" — exactly the regression we're fixing. The
|
|
1966
|
-
// committed dev server lives until the next propose / shutdown.
|
|
1967
1716
|
await orchestrator.cleanupCommittedSession(sessionId);
|
|
1968
1717
|
variantsTelemetry?.trackAgentVariantsActiveProjectTransition({
|
|
1969
1718
|
sessionId,
|
|
@@ -2001,18 +1750,10 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
2001
1750
|
sendError(res, err);
|
|
2002
1751
|
}
|
|
2003
1752
|
});
|
|
2004
|
-
/**
|
|
2005
|
-
* Deploy a fresh-project (Vite) variant to the public Prototype Preview Host
|
|
2006
|
-
* and return a shareable URL. Builds locally, uploads the static bundle with
|
|
2007
|
-
* the user's Rivet JWT, and records the deployment in the variant manifest so
|
|
2008
|
-
* the chip can re-show ("Copy link") without rebuilding.
|
|
2009
|
-
*/
|
|
2010
1753
|
router.post('/variants/:sessionId/deploy', async (req, res) => {
|
|
2011
1754
|
if (rejectNonLocalRequest(req, res))
|
|
2012
1755
|
return;
|
|
2013
1756
|
const sessionId = req.params.sessionId;
|
|
2014
|
-
// Gated behind the `deployPrototype` flag (default off). Mirrors the UI
|
|
2015
|
-
// gate so the endpoint can't be driven while the feature is dark.
|
|
2016
1757
|
const flags = await (0, evaluateFlags_1.getFeatureFlags)({
|
|
2017
1758
|
userKey: (0, featureFlagUserKey_1.getConfigFeatureFlagUserKey)({ headers: req.headers }),
|
|
2018
1759
|
});
|
|
@@ -2081,11 +1822,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
2081
1822
|
});
|
|
2082
1823
|
}
|
|
2083
1824
|
});
|
|
2084
|
-
/**
|
|
2085
|
-
* Deploy a fresh-project canvas to the public Prototype Preview Host. The
|
|
2086
|
-
* canvas page embeds every requested direction so one public URL can be used
|
|
2087
|
-
* for review instead of sharing one URL per variant.
|
|
2088
|
-
*/
|
|
2089
1825
|
router.post('/variants/:sessionId/canvas/deploy', async (req, res) => {
|
|
2090
1826
|
if (rejectNonLocalRequest(req, res))
|
|
2091
1827
|
return;
|
|
@@ -2247,9 +1983,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
2247
1983
|
sendError(res, err);
|
|
2248
1984
|
}
|
|
2249
1985
|
});
|
|
2250
|
-
// Remove a single variant from the UI: hides it from the active snapshot for
|
|
2251
|
-
// good while retaining it in `.rivet/variants/` as `removed`. Distinct from
|
|
2252
|
-
// /cancel (which tears down the whole session).
|
|
2253
1986
|
router.post('/variants/:sessionId/:variantId/remove', async (req, res) => {
|
|
2254
1987
|
if (rejectNonLocalRequest(req, res))
|
|
2255
1988
|
return;
|
|
@@ -2262,8 +1995,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
2262
1995
|
sendError(res, err);
|
|
2263
1996
|
}
|
|
2264
1997
|
});
|
|
2265
|
-
// Rename a live (active-session) variant. Patches the in-memory work item and
|
|
2266
|
-
// its on-disk manifest, then re-pushes the snapshot over SSE.
|
|
2267
1998
|
router.post('/variants/:sessionId/:variantId/rename', async (req, res) => {
|
|
2268
1999
|
if (rejectNonLocalRequest(req, res))
|
|
2269
2000
|
return;
|
|
@@ -2288,8 +2019,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
2288
2019
|
sendError(res, err);
|
|
2289
2020
|
}
|
|
2290
2021
|
});
|
|
2291
|
-
// Rename one run request batch across live state and every resolved history
|
|
2292
|
-
// root in one call.
|
|
2293
2022
|
router.post('/variants/runs/rename', async (req, res) => {
|
|
2294
2023
|
if (rejectNonLocalRequest(req, res))
|
|
2295
2024
|
return;
|
|
@@ -2313,8 +2042,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
2313
2042
|
});
|
|
2314
2043
|
liveRenamedCount = result.renamedCount;
|
|
2315
2044
|
}
|
|
2316
|
-
// History is best-effort even without a resolvable project path — a
|
|
2317
|
-
// fresh-session run may have nothing persisted yet.
|
|
2318
2045
|
const projectPath = resolveProjectPath(parsed.data.projectPath);
|
|
2319
2046
|
let historyRenamedCount = 0;
|
|
2320
2047
|
if (projectPath) {
|
|
@@ -2338,9 +2065,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
2338
2065
|
sendError(res, err);
|
|
2339
2066
|
}
|
|
2340
2067
|
});
|
|
2341
|
-
// Rename a past (history) variant — no active session involved, so this writes
|
|
2342
|
-
// straight to the persisted manifest. Takes the workspace projectPath the same
|
|
2343
|
-
// way the history list/preview routes do.
|
|
2344
2068
|
router.post('/variants/history/:sessionId/:variantId/rename', async (req, res) => {
|
|
2345
2069
|
if (rejectNonLocalRequest(req, res))
|
|
2346
2070
|
return;
|
|
@@ -2386,10 +2110,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
2386
2110
|
sendError(res, err);
|
|
2387
2111
|
}
|
|
2388
2112
|
});
|
|
2389
|
-
// Remove a past (history) variant — flips its persisted manifest to `removed`
|
|
2390
|
-
// so it drops out of the default history list. Non-destructive: the snapshot
|
|
2391
|
-
// stays on disk, matching the active-session remove flow. Takes the workspace
|
|
2392
|
-
// projectPath the same way the other history routes do.
|
|
2393
2113
|
router.post('/variants/history/:sessionId/:variantId/remove', async (req, res) => {
|
|
2394
2114
|
if (rejectNonLocalRequest(req, res))
|
|
2395
2115
|
return;
|
|
@@ -2423,13 +2143,6 @@ const createAgentVariantsRouter = (orchestrator, bridge, telemetry, variantHisto
|
|
|
2423
2143
|
return router;
|
|
2424
2144
|
};
|
|
2425
2145
|
exports.createAgentVariantsRouter = createAgentVariantsRouter;
|
|
2426
|
-
/**
|
|
2427
|
-
* Serve one saved static preview file from a variant history snapshot.
|
|
2428
|
-
*
|
|
2429
|
-
* The entry route redirects to the saved HTML filename so relative embeds,
|
|
2430
|
-
* assets and fragment links resolve naturally. HTML responses carry the
|
|
2431
|
-
* preview CSP and bridge; other sibling assets carry neither.
|
|
2432
|
-
*/
|
|
2433
2146
|
const serveHistoryPreview = async (req, res, variantHistory, resolveProjectPath, resolveHistoryProjectPaths, { isDocument }, previewBridge) => {
|
|
2434
2147
|
if (rejectNonLocalRequest(req, res))
|
|
2435
2148
|
return;
|
|
@@ -2487,17 +2200,11 @@ const serveHistoryPreview = async (req, res, variantHistory, resolveProjectPath,
|
|
|
2487
2200
|
return;
|
|
2488
2201
|
}
|
|
2489
2202
|
if (isDocument) {
|
|
2490
|
-
// Give the history entry its saved filename as the browser's document URL:
|
|
2491
|
-
// /preview -> /preview/pages/index.html makes ./demo.html resolve under
|
|
2492
|
-
// /preview/pages/. A <base> tag would also retarget fragment-only links
|
|
2493
|
-
// such as #details, which must stay within the displayed document.
|
|
2494
2203
|
const previewRoot = `/api/variants/history/${encodeURIComponent(sessionId)}/${encodeURIComponent(variantId)}/preview/`;
|
|
2495
|
-
// Encode filenames (including spaces and #) without encoding directory separators.
|
|
2496
2204
|
const entryPath = file.relativePath
|
|
2497
2205
|
.split('/')
|
|
2498
2206
|
.map(encodeURIComponent)
|
|
2499
2207
|
.join('/');
|
|
2500
|
-
// Keep preview options and project lookup parameters through the redirect.
|
|
2501
2208
|
const queryIndex = req.originalUrl.indexOf('?');
|
|
2502
2209
|
const query = queryIndex === -1 ? '' : req.originalUrl.slice(queryIndex);
|
|
2503
2210
|
res
|
|
@@ -2507,16 +2214,11 @@ const serveHistoryPreview = async (req, res, variantHistory, resolveProjectPath,
|
|
|
2507
2214
|
}
|
|
2508
2215
|
const contentType = path_1.default.extname(file.absolutePath) || 'html';
|
|
2509
2216
|
res.status(200).type(contentType).set('Cache-Control', 'no-store');
|
|
2510
|
-
// HTML siblings can be embedded documents too, so they need the same
|
|
2511
|
-
// permissions as the entry. CSS, scripts and images retain their raw bytes.
|
|
2512
2217
|
if (/\.html?$/i.test(file.relativePath)) {
|
|
2513
2218
|
const html = file.body.toString('utf8');
|
|
2514
2219
|
res
|
|
2515
2220
|
.set('Content-Security-Policy', buildStaticPreviewCsp(previewBridge?.expectedParentOrigin, previewBridge?.resolveLibraryOrigin?.()))
|
|
2516
2221
|
.set('X-Content-Type-Options', 'nosniff');
|
|
2517
|
-
// Embedded mode drives this snapshot iframe over the preview bridge; the
|
|
2518
|
-
// listener must be present or selecting/commenting on a past variant
|
|
2519
|
-
// times out (`Preview bridge timed out`). Matches the live static route.
|
|
2520
2222
|
if (previewBridge?.isEnabled) {
|
|
2521
2223
|
res.send((0, preview_bridge_1.injectPreviewBridge)(html, {
|
|
2522
2224
|
expectedParentOrigin: previewBridge.expectedParentOrigin,
|
|
@@ -2539,10 +2241,6 @@ const serveHistoryPreview = async (req, res, variantHistory, resolveProjectPath,
|
|
|
2539
2241
|
sendError(res, err);
|
|
2540
2242
|
}
|
|
2541
2243
|
};
|
|
2542
|
-
/**
|
|
2543
|
-
* Validates the raw history-preview URL suffix before Express can normalize an
|
|
2544
|
-
* encoded traversal segment away from req.params.
|
|
2545
|
-
*/
|
|
2546
2244
|
const getInvalidRawHistoryPreviewAssetPath = (req) => {
|
|
2547
2245
|
const rawPath = req.originalUrl.split('?')[0] ?? '';
|
|
2548
2246
|
const marker = '/preview/';
|
|
@@ -2564,9 +2262,6 @@ const getInvalidRawHistoryPreviewAssetPath = (req) => {
|
|
|
2564
2262
|
}
|
|
2565
2263
|
return null;
|
|
2566
2264
|
};
|
|
2567
|
-
/**
|
|
2568
|
-
* Resolve a child path while rejecting paths that escape the intended root.
|
|
2569
|
-
*/
|
|
2570
2265
|
const resolvePathWithinRoot = (rootPath, childPath) => {
|
|
2571
2266
|
const absolutePath = path_1.default.resolve(rootPath, childPath);
|
|
2572
2267
|
const relativePath = path_1.default.relative(rootPath, absolutePath);
|
|
@@ -2638,21 +2333,15 @@ const toActiveProjectContext = (projectContext) => {
|
|
|
2638
2333
|
: {}),
|
|
2639
2334
|
};
|
|
2640
2335
|
};
|
|
2641
|
-
/** Map persisted artifact shape to the public history summary kind. */
|
|
2642
2336
|
const manifestKind = (manifest) => {
|
|
2643
2337
|
return manifest.artifact.kind === 'diff' ? 'diff' : 'project-created';
|
|
2644
2338
|
};
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
*/
|
|
2652
|
-
const injectBaseHref = (html, baseHref) => (0, htmlDocument_1.insertHtmlHeadElement)(html, {
|
|
2653
|
-
tagName: 'base',
|
|
2654
|
-
markup: `<base href="${baseHref.replace(/"/g, '"')}">`,
|
|
2655
|
-
});
|
|
2339
|
+
const injectBaseHref = (html, baseHref) => (0, htmlDocument_1.insertHtmlHeadElements)(html, [
|
|
2340
|
+
{
|
|
2341
|
+
tagName: 'base',
|
|
2342
|
+
markup: `<base href="${baseHref.replace(/"/g, '"')}">`,
|
|
2343
|
+
},
|
|
2344
|
+
]);
|
|
2656
2345
|
function sendError(res, err) {
|
|
2657
2346
|
if (err instanceof agent_variants_1.AgentVariantsError) {
|
|
2658
2347
|
log.warn(`agent-variants route error: ${err.code}: ${err.detail}`);
|