p-dev-harness 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -4
- package/dist/agents/cursor-provider.d.ts.map +1 -1
- package/dist/agents/cursor-provider.js +9 -8
- package/dist/agents/cursor-provider.js.map +1 -1
- package/dist/agents/index.d.ts +3 -4
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +2 -5
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/types.d.ts +36 -2
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/artifacts/redact.d.ts +2 -0
- package/dist/artifacts/redact.d.ts.map +1 -1
- package/dist/artifacts/redact.js +15 -1
- package/dist/artifacts/redact.js.map +1 -1
- package/dist/artifacts/write-json-out-manifest.d.ts +17 -0
- package/dist/artifacts/write-json-out-manifest.d.ts.map +1 -0
- package/dist/artifacts/write-json-out-manifest.js +68 -0
- package/dist/artifacts/write-json-out-manifest.js.map +1 -0
- package/dist/cli/commands/canary-runner-config.d.ts +2 -0
- package/dist/cli/commands/canary-runner-config.d.ts.map +1 -0
- package/dist/cli/commands/canary-runner-config.js +6 -0
- package/dist/cli/commands/canary-runner-config.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -1
- package/dist/cli/commands/doctor.js +129 -0
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/resolve-route.d.ts.map +1 -1
- package/dist/cli/commands/resolve-route.js +5 -0
- package/dist/cli/commands/resolve-route.js.map +1 -1
- package/dist/cli/commands/run.d.ts +1 -0
- package/dist/cli/commands/run.d.ts.map +1 -1
- package/dist/cli/commands/run.js +54 -12
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/cli/commands/sync-managed-runner.d.ts +7 -0
- package/dist/cli/commands/sync-managed-runner.d.ts.map +1 -0
- package/dist/cli/commands/sync-managed-runner.js +89 -0
- package/dist/cli/commands/sync-managed-runner.js.map +1 -0
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +27 -0
- package/dist/cli/program.js.map +1 -1
- package/dist/config/assert-cloud-config-fingerprint.d.ts +10 -0
- package/dist/config/assert-cloud-config-fingerprint.d.ts.map +1 -0
- package/dist/config/assert-cloud-config-fingerprint.js +26 -0
- package/dist/config/assert-cloud-config-fingerprint.js.map +1 -0
- package/dist/config/cloud-config-fingerprint.d.ts +26 -0
- package/dist/config/cloud-config-fingerprint.d.ts.map +1 -0
- package/dist/config/cloud-config-fingerprint.js +64 -0
- package/dist/config/cloud-config-fingerprint.js.map +1 -0
- package/dist/config/legacy-linear-top-level.d.ts +16 -0
- package/dist/config/legacy-linear-top-level.d.ts.map +1 -0
- package/dist/config/legacy-linear-top-level.js +42 -0
- package/dist/config/legacy-linear-top-level.js.map +1 -0
- package/dist/config/linear-association-gate.d.ts +26 -0
- package/dist/config/linear-association-gate.d.ts.map +1 -0
- package/dist/config/linear-association-gate.js +46 -0
- package/dist/config/linear-association-gate.js.map +1 -0
- package/dist/config/resolve-linear-team.d.ts +10 -0
- package/dist/config/resolve-linear-team.d.ts.map +1 -0
- package/dist/config/resolve-linear-team.js +24 -0
- package/dist/config/resolve-linear-team.js.map +1 -0
- package/dist/config/resolve-linear-workspace.d.ts +83 -0
- package/dist/config/resolve-linear-workspace.d.ts.map +1 -0
- package/dist/config/resolve-linear-workspace.js +244 -0
- package/dist/config/resolve-linear-workspace.js.map +1 -0
- package/dist/config/role-models.d.ts +160 -0
- package/dist/config/role-models.d.ts.map +1 -0
- package/dist/config/role-models.js +31 -0
- package/dist/config/role-models.js.map +1 -0
- package/dist/config/runner-upgrade-sync-gate.d.ts +10 -0
- package/dist/config/runner-upgrade-sync-gate.d.ts.map +1 -0
- package/dist/config/runner-upgrade-sync-gate.js +24 -0
- package/dist/config/runner-upgrade-sync-gate.js.map +1 -0
- package/dist/config/schema.d.ts +266 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +14 -0
- package/dist/config/schema.js.map +1 -1
- package/dist/config/types.d.ts +1 -1
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/workspace-root.d.ts +7 -0
- package/dist/config/workspace-root.d.ts.map +1 -0
- package/dist/config/workspace-root.js +21 -0
- package/dist/config/workspace-root.js.map +1 -0
- package/dist/cursor/agent-factory.d.ts +8 -0
- package/dist/cursor/agent-factory.d.ts.map +1 -1
- package/dist/cursor/agent-factory.js +34 -5
- package/dist/cursor/agent-factory.js.map +1 -1
- package/dist/cursor/builder-resume-errors.d.ts +3 -0
- package/dist/cursor/builder-resume-errors.d.ts.map +1 -0
- package/dist/cursor/builder-resume-errors.js +32 -0
- package/dist/cursor/builder-resume-errors.js.map +1 -0
- package/dist/cursor/model.d.ts +18 -22
- package/dist/cursor/model.d.ts.map +1 -1
- package/dist/cursor/model.js +73 -25
- package/dist/cursor/model.js.map +1 -1
- package/dist/cursor/run-observer.d.ts +8 -1
- package/dist/cursor/run-observer.d.ts.map +1 -1
- package/dist/cursor/run-observer.js +9 -1
- package/dist/cursor/run-observer.js.map +1 -1
- package/dist/github/auth-verification-retry.d.ts +12 -0
- package/dist/github/auth-verification-retry.d.ts.map +1 -0
- package/dist/github/auth-verification-retry.js +47 -0
- package/dist/github/auth-verification-retry.js.map +1 -0
- package/dist/github/client.d.ts +53 -4
- package/dist/github/client.d.ts.map +1 -1
- package/dist/github/client.js +108 -7
- package/dist/github/client.js.map +1 -1
- package/dist/gui/configure-health.js +2 -2
- package/dist/gui/configure-health.js.map +1 -1
- package/dist/gui/repo-root.d.ts +3 -0
- package/dist/gui/repo-root.d.ts.map +1 -1
- package/dist/gui/repo-root.js +16 -1
- package/dist/gui/repo-root.js.map +1 -1
- package/dist/gui/start-configure-stable.js +6 -2
- package/dist/gui/start-configure-stable.js.map +1 -1
- package/dist/gui/start-gui.js +7 -3
- package/dist/gui/start-gui.js.map +1 -1
- package/dist/linear/client.d.ts +4 -0
- package/dist/linear/client.d.ts.map +1 -1
- package/dist/linear/client.js +7 -0
- package/dist/linear/client.js.map +1 -1
- package/dist/linear/comments.d.ts +9 -0
- package/dist/linear/comments.d.ts.map +1 -1
- package/dist/linear/comments.js +34 -0
- package/dist/linear/comments.js.map +1 -1
- package/dist/linear/issue-query.d.ts +1 -0
- package/dist/linear/issue-query.d.ts.map +1 -1
- package/dist/linear/issue-query.js +3 -0
- package/dist/linear/issue-query.js.map +1 -1
- package/dist/linear/markers.d.ts +7 -0
- package/dist/linear/markers.d.ts.map +1 -1
- package/dist/linear/markers.js +21 -0
- package/dist/linear/markers.js.map +1 -1
- package/dist/linear/parser.d.ts +2 -1
- package/dist/linear/parser.d.ts.map +1 -1
- package/dist/linear/parser.js +46 -0
- package/dist/linear/parser.js.map +1 -1
- package/dist/linear/project-harness-metadata.d.ts +10 -0
- package/dist/linear/project-harness-metadata.d.ts.map +1 -0
- package/dist/linear/project-harness-metadata.js +109 -0
- package/dist/linear/project-harness-metadata.js.map +1 -0
- package/dist/linear/project-metadata-sync.d.ts +29 -0
- package/dist/linear/project-metadata-sync.d.ts.map +1 -0
- package/dist/linear/project-metadata-sync.js +64 -0
- package/dist/linear/project-metadata-sync.js.map +1 -0
- package/dist/linear/run-status-comment.d.ts +49 -0
- package/dist/linear/run-status-comment.d.ts.map +1 -0
- package/dist/linear/run-status-comment.js +118 -0
- package/dist/linear/run-status-comment.js.map +1 -0
- package/dist/linear/writer.d.ts +8 -0
- package/dist/linear/writer.d.ts.map +1 -1
- package/dist/linear/writer.js +13 -0
- package/dist/linear/writer.js.map +1 -1
- package/dist/observability/adapters/fake.d.ts +17 -0
- package/dist/observability/adapters/fake.d.ts.map +1 -0
- package/dist/observability/adapters/fake.js +205 -0
- package/dist/observability/adapters/fake.js.map +1 -0
- package/dist/observability/adapters/noop.d.ts +5 -0
- package/dist/observability/adapters/noop.d.ts.map +1 -0
- package/dist/observability/adapters/noop.js +51 -0
- package/dist/observability/adapters/noop.js.map +1 -0
- package/dist/observability/adapters/posthog.d.ts +12 -0
- package/dist/observability/adapters/posthog.d.ts.map +1 -0
- package/dist/observability/adapters/posthog.js +142 -0
- package/dist/observability/adapters/posthog.js.map +1 -0
- package/dist/observability/adapters/sentry.d.ts +12 -0
- package/dist/observability/adapters/sentry.d.ts.map +1 -0
- package/dist/observability/adapters/sentry.js +217 -0
- package/dist/observability/adapters/sentry.js.map +1 -0
- package/dist/observability/analytics-schemas.d.ts +59 -0
- package/dist/observability/analytics-schemas.d.ts.map +1 -0
- package/dist/observability/analytics-schemas.js +119 -0
- package/dist/observability/analytics-schemas.js.map +1 -0
- package/dist/observability/consent.d.ts +14 -0
- package/dist/observability/consent.d.ts.map +1 -0
- package/dist/observability/consent.js +35 -0
- package/dist/observability/consent.js.map +1 -0
- package/dist/observability/constants.d.ts +18 -0
- package/dist/observability/constants.d.ts.map +1 -0
- package/dist/observability/constants.js +18 -0
- package/dist/observability/constants.js.map +1 -0
- package/dist/observability/context.d.ts +21 -0
- package/dist/observability/context.d.ts.map +1 -0
- package/dist/observability/context.js +105 -0
- package/dist/observability/context.js.map +1 -0
- package/dist/observability/facade-runtime-state.d.ts +17 -0
- package/dist/observability/facade-runtime-state.d.ts.map +1 -0
- package/dist/observability/facade-runtime-state.js +23 -0
- package/dist/observability/facade-runtime-state.js.map +1 -0
- package/dist/observability/facade.d.ts +44 -0
- package/dist/observability/facade.d.ts.map +1 -0
- package/dist/observability/facade.js +432 -0
- package/dist/observability/facade.js.map +1 -0
- package/dist/observability/fatal-handlers.d.ts +4 -0
- package/dist/observability/fatal-handlers.d.ts.map +1 -0
- package/dist/observability/fatal-handlers.js +54 -0
- package/dist/observability/fatal-handlers.js.map +1 -0
- package/dist/observability/identity.d.ts +4 -0
- package/dist/observability/identity.d.ts.map +1 -0
- package/dist/observability/identity.js +11 -0
- package/dist/observability/identity.js.map +1 -0
- package/dist/observability/index.d.ts +9 -0
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/index.js +6 -0
- package/dist/observability/index.js.map +1 -0
- package/dist/observability/local-state.d.ts +14 -0
- package/dist/observability/local-state.d.ts.map +1 -0
- package/dist/observability/local-state.js +107 -0
- package/dist/observability/local-state.js.map +1 -0
- package/dist/observability/package-config.d.ts +11 -0
- package/dist/observability/package-config.d.ts.map +1 -0
- package/dist/observability/package-config.js +117 -0
- package/dist/observability/package-config.js.map +1 -0
- package/dist/observability/posthog-dashboard-contract.d.ts +46 -0
- package/dist/observability/posthog-dashboard-contract.d.ts.map +1 -0
- package/dist/observability/posthog-dashboard-contract.js +200 -0
- package/dist/observability/posthog-dashboard-contract.js.map +1 -0
- package/dist/observability/privacy-schema.d.ts +13 -0
- package/dist/observability/privacy-schema.d.ts.map +1 -0
- package/dist/observability/privacy-schema.js +204 -0
- package/dist/observability/privacy-schema.js.map +1 -0
- package/dist/observability/product-error-messages.d.ts +2 -0
- package/dist/observability/product-error-messages.d.ts.map +1 -0
- package/dist/observability/product-error-messages.js +15 -0
- package/dist/observability/product-error-messages.js.map +1 -0
- package/dist/observability/product-errors.d.ts +12 -0
- package/dist/observability/product-errors.d.ts.map +1 -0
- package/dist/observability/product-errors.js +109 -0
- package/dist/observability/product-errors.js.map +1 -0
- package/dist/observability/provisioning-analytics.d.ts +12 -0
- package/dist/observability/provisioning-analytics.d.ts.map +1 -0
- package/dist/observability/provisioning-analytics.js +11 -0
- package/dist/observability/provisioning-analytics.js.map +1 -0
- package/dist/observability/redaction.d.ts +10 -0
- package/dist/observability/redaction.d.ts.map +1 -0
- package/dist/observability/redaction.js +72 -0
- package/dist/observability/redaction.js.map +1 -0
- package/dist/observability/runtime-eligibility.d.ts +6 -0
- package/dist/observability/runtime-eligibility.d.ts.map +1 -0
- package/dist/observability/runtime-eligibility.js +33 -0
- package/dist/observability/runtime-eligibility.js.map +1 -0
- package/dist/observability/sentry-outbound-privacy.d.ts +12 -0
- package/dist/observability/sentry-outbound-privacy.d.ts.map +1 -0
- package/dist/observability/sentry-outbound-privacy.js +168 -0
- package/dist/observability/sentry-outbound-privacy.js.map +1 -0
- package/dist/observability/session-dedupe.d.ts +8 -0
- package/dist/observability/session-dedupe.d.ts.map +1 -0
- package/dist/observability/session-dedupe.js +42 -0
- package/dist/observability/session-dedupe.js.map +1 -0
- package/dist/observability/session-handoff.d.ts +10 -0
- package/dist/observability/session-handoff.d.ts.map +1 -0
- package/dist/observability/session-handoff.js +25 -0
- package/dist/observability/session-handoff.js.map +1 -0
- package/dist/observability/transport-lifecycle.d.ts +20 -0
- package/dist/observability/transport-lifecycle.d.ts.map +1 -0
- package/dist/observability/transport-lifecycle.js +69 -0
- package/dist/observability/transport-lifecycle.js.map +1 -0
- package/dist/observability/types.d.ts +189 -0
- package/dist/observability/types.d.ts.map +1 -0
- package/dist/observability/types.js +2 -0
- package/dist/observability/types.js.map +1 -0
- package/dist/p-dev/cli.d.ts +1 -1
- package/dist/p-dev/cli.d.ts.map +1 -1
- package/dist/p-dev/cli.js +1 -1
- package/dist/p-dev/cli.js.map +1 -1
- package/dist/p-dev/git-object-plumbing.d.ts +20 -0
- package/dist/p-dev/git-object-plumbing.d.ts.map +1 -1
- package/dist/p-dev/git-object-plumbing.js +106 -13
- package/dist/p-dev/git-object-plumbing.js.map +1 -1
- package/dist/p-dev/launch.d.ts.map +1 -1
- package/dist/p-dev/launch.js +77 -15
- package/dist/p-dev/launch.js.map +1 -1
- package/dist/p-dev/main.js +9 -1
- package/dist/p-dev/main.js.map +1 -1
- package/dist/p-dev/package-paths.d.ts +12 -0
- package/dist/p-dev/package-paths.d.ts.map +1 -1
- package/dist/p-dev/package-paths.js +48 -2
- package/dist/p-dev/package-paths.js.map +1 -1
- package/dist/p-dev/workspace-snapshot-generator.d.ts.map +1 -1
- package/dist/p-dev/workspace-snapshot-generator.js +18 -0
- package/dist/p-dev/workspace-snapshot-generator.js.map +1 -1
- package/dist/p-dev/workspace-snapshot-manifest.d.ts.map +1 -1
- package/dist/p-dev/workspace-snapshot-manifest.js +48 -0
- package/dist/p-dev/workspace-snapshot-manifest.js.map +1 -1
- package/dist/p-dev/workspace-snapshot-types.d.ts +8 -0
- package/dist/p-dev/workspace-snapshot-types.d.ts.map +1 -1
- package/dist/preview/preview-capability.d.ts +9 -0
- package/dist/preview/preview-capability.d.ts.map +1 -0
- package/dist/preview/preview-capability.js +15 -0
- package/dist/preview/preview-capability.js.map +1 -0
- package/dist/product/initialization-state.d.ts +15 -0
- package/dist/product/initialization-state.d.ts.map +1 -0
- package/dist/product/initialization-state.js +37 -0
- package/dist/product/initialization-state.js.map +1 -0
- package/dist/product/product-marker.d.ts +77 -0
- package/dist/product/product-marker.d.ts.map +1 -0
- package/dist/product/product-marker.js +62 -0
- package/dist/product/product-marker.js.map +1 -0
- package/dist/product/read-product-marker.d.ts +15 -0
- package/dist/product/read-product-marker.d.ts.map +1 -0
- package/dist/product/read-product-marker.js +28 -0
- package/dist/product/read-product-marker.js.map +1 -0
- package/dist/prompts/builder.d.ts +10 -1
- package/dist/prompts/builder.d.ts.map +1 -1
- package/dist/prompts/builder.js +16 -2
- package/dist/prompts/builder.js.map +1 -1
- package/dist/resolver/errors.d.ts +1 -1
- package/dist/resolver/errors.d.ts.map +1 -1
- package/dist/resolver/errors.js.map +1 -1
- package/dist/resolver/target-repo.d.ts +4 -1
- package/dist/resolver/target-repo.d.ts.map +1 -1
- package/dist/resolver/target-repo.js +40 -0
- package/dist/resolver/target-repo.js.map +1 -1
- package/dist/runner/builder-thread-acquire.d.ts +41 -0
- package/dist/runner/builder-thread-acquire.d.ts.map +1 -0
- package/dist/runner/builder-thread-acquire.js +224 -0
- package/dist/runner/builder-thread-acquire.js.map +1 -0
- package/dist/runner/builder-thread-evidence.d.ts +13 -0
- package/dist/runner/builder-thread-evidence.d.ts.map +1 -0
- package/dist/runner/builder-thread-evidence.js +23 -0
- package/dist/runner/builder-thread-evidence.js.map +1 -0
- package/dist/runner/builder-thread-idempotency.d.ts +17 -0
- package/dist/runner/builder-thread-idempotency.d.ts.map +1 -0
- package/dist/runner/builder-thread-idempotency.js +12 -0
- package/dist/runner/builder-thread-idempotency.js.map +1 -0
- package/dist/runner/builder-thread-lineage-errors.d.ts +7 -0
- package/dist/runner/builder-thread-lineage-errors.d.ts.map +1 -0
- package/dist/runner/builder-thread-lineage-errors.js +11 -0
- package/dist/runner/builder-thread-lineage-errors.js.map +1 -0
- package/dist/runner/builder-thread-lineage.d.ts +18 -0
- package/dist/runner/builder-thread-lineage.d.ts.map +1 -0
- package/dist/runner/builder-thread-lineage.js +342 -0
- package/dist/runner/builder-thread-lineage.js.map +1 -0
- package/dist/runner/builder-thread-types.d.ts +30 -0
- package/dist/runner/builder-thread-types.d.ts.map +1 -0
- package/dist/runner/builder-thread-types.js +2 -0
- package/dist/runner/builder-thread-types.js.map +1 -0
- package/dist/runner/delivery-dedup.d.ts +26 -0
- package/dist/runner/delivery-dedup.d.ts.map +1 -0
- package/dist/runner/delivery-dedup.js +44 -0
- package/dist/runner/delivery-dedup.js.map +1 -0
- package/dist/runner/failure-finalization.d.ts +34 -0
- package/dist/runner/failure-finalization.d.ts.map +1 -0
- package/dist/runner/failure-finalization.js +154 -0
- package/dist/runner/failure-finalization.js.map +1 -0
- package/dist/runner/fixture.d.ts +1 -1
- package/dist/runner/fixture.d.ts.map +1 -1
- package/dist/runner/fixture.js +3 -0
- package/dist/runner/fixture.js.map +1 -1
- package/dist/runner/phases/handoff.d.ts.map +1 -1
- package/dist/runner/phases/handoff.js +59 -32
- package/dist/runner/phases/handoff.js.map +1 -1
- package/dist/runner/phases/implementation.d.ts.map +1 -1
- package/dist/runner/phases/implementation.js +147 -24
- package/dist/runner/phases/implementation.js.map +1 -1
- package/dist/runner/phases/integration-repair.d.ts +18 -0
- package/dist/runner/phases/integration-repair.d.ts.map +1 -1
- package/dist/runner/phases/integration-repair.js +93 -7
- package/dist/runner/phases/integration-repair.js.map +1 -1
- package/dist/runner/phases/merge.d.ts.map +1 -1
- package/dist/runner/phases/merge.js +129 -51
- package/dist/runner/phases/merge.js.map +1 -1
- package/dist/runner/phases/planning.d.ts.map +1 -1
- package/dist/runner/phases/planning.js +46 -8
- package/dist/runner/phases/planning.js.map +1 -1
- package/dist/runner/phases/production-sync.d.ts.map +1 -1
- package/dist/runner/phases/production-sync.js +28 -4
- package/dist/runner/phases/production-sync.js.map +1 -1
- package/dist/runner/phases/revision.d.ts.map +1 -1
- package/dist/runner/phases/revision.js +112 -32
- package/dist/runner/phases/revision.js.map +1 -1
- package/dist/runner/preflight.d.ts +2 -0
- package/dist/runner/preflight.d.ts.map +1 -1
- package/dist/runner/preflight.js +112 -3
- package/dist/runner/preflight.js.map +1 -1
- package/dist/runner/resolve-route.d.ts +1 -0
- package/dist/runner/resolve-route.d.ts.map +1 -1
- package/dist/runner/resolve-route.js +26 -0
- package/dist/runner/resolve-route.js.map +1 -1
- package/dist/runner/run-generation.d.ts +2 -0
- package/dist/runner/run-generation.d.ts.map +1 -0
- package/dist/runner/run-generation.js +19 -0
- package/dist/runner/run-generation.js.map +1 -0
- package/dist/runner/uninitialized-product-routing.d.ts +24 -0
- package/dist/runner/uninitialized-product-routing.d.ts.map +1 -0
- package/dist/runner/uninitialized-product-routing.js +70 -0
- package/dist/runner/uninitialized-product-routing.js.map +1 -0
- package/dist/setup/config-builder.d.ts.map +1 -1
- package/dist/setup/config-builder.js +12 -0
- package/dist/setup/config-builder.js.map +1 -1
- package/dist/setup/control-plane-readiness.d.ts +8 -1
- package/dist/setup/control-plane-readiness.d.ts.map +1 -1
- package/dist/setup/control-plane-readiness.js +63 -19
- package/dist/setup/control-plane-readiness.js.map +1 -1
- package/dist/setup/control-plane-setup-state.d.ts +13 -3
- package/dist/setup/control-plane-setup-state.d.ts.map +1 -1
- package/dist/setup/control-plane-setup-state.js +30 -3
- package/dist/setup/control-plane-setup-state.js.map +1 -1
- package/dist/setup/control-plane-state-lock.d.ts +12 -0
- package/dist/setup/control-plane-state-lock.d.ts.map +1 -0
- package/dist/setup/control-plane-state-lock.js +79 -0
- package/dist/setup/control-plane-state-lock.js.map +1 -0
- package/dist/setup/control-plane-types.d.ts +72 -1
- package/dist/setup/control-plane-types.d.ts.map +1 -1
- package/dist/setup/first-run-readiness.d.ts +4 -0
- package/dist/setup/first-run-readiness.d.ts.map +1 -1
- package/dist/setup/first-run-readiness.js +2 -2
- package/dist/setup/first-run-readiness.js.map +1 -1
- package/dist/setup/git-askpass-credentials.d.ts +19 -0
- package/dist/setup/git-askpass-credentials.d.ts.map +1 -0
- package/dist/setup/git-askpass-credentials.js +60 -0
- package/dist/setup/git-askpass-credentials.js.map +1 -0
- package/dist/setup/github-dispatch-token.d.ts +4 -0
- package/dist/setup/github-dispatch-token.d.ts.map +1 -1
- package/dist/setup/github-dispatch-token.js +23 -3
- package/dist/setup/github-dispatch-token.js.map +1 -1
- package/dist/setup/github-remote-provider.d.ts +44 -0
- package/dist/setup/github-remote-provider.d.ts.map +1 -1
- package/dist/setup/github-remote-provider.js +22 -2
- package/dist/setup/github-remote-provider.js.map +1 -1
- package/dist/setup/github-remote-setup-live.d.ts +30 -1
- package/dist/setup/github-remote-setup-live.d.ts.map +1 -1
- package/dist/setup/github-remote-setup-live.js +68 -11
- package/dist/setup/github-remote-setup-live.js.map +1 -1
- package/dist/setup/github-repository-name.d.ts +15 -0
- package/dist/setup/github-repository-name.d.ts.map +1 -0
- package/dist/setup/github-repository-name.js +54 -0
- package/dist/setup/github-repository-name.js.map +1 -0
- package/dist/setup/github-target-repository-provider-live.d.ts +35 -0
- package/dist/setup/github-target-repository-provider-live.d.ts.map +1 -0
- package/dist/setup/github-target-repository-provider-live.js +236 -0
- package/dist/setup/github-target-repository-provider-live.js.map +1 -0
- package/dist/setup/github-target-repository-provider-mock.d.ts +47 -0
- package/dist/setup/github-target-repository-provider-mock.d.ts.map +1 -0
- package/dist/setup/github-target-repository-provider-mock.js +189 -0
- package/dist/setup/github-target-repository-provider-mock.js.map +1 -0
- package/dist/setup/github-target-repository-provider.d.ts +44 -0
- package/dist/setup/github-target-repository-provider.d.ts.map +1 -0
- package/dist/setup/github-target-repository-provider.js +7 -0
- package/dist/setup/github-target-repository-provider.js.map +1 -0
- package/dist/setup/github-workflow-permissions.d.ts +1 -1
- package/dist/setup/github-workflow-permissions.d.ts.map +1 -1
- package/dist/setup/github-workflow-permissions.js +1 -1
- package/dist/setup/github-workflow-permissions.js.map +1 -1
- package/dist/setup/gui-view-model.d.ts +5 -0
- package/dist/setup/gui-view-model.d.ts.map +1 -1
- package/dist/setup/gui-view-model.js +5 -0
- package/dist/setup/gui-view-model.js.map +1 -1
- package/dist/setup/harness-dispatch-repo.d.ts +16 -2
- package/dist/setup/harness-dispatch-repo.d.ts.map +1 -1
- package/dist/setup/harness-dispatch-repo.js +113 -22
- package/dist/setup/harness-dispatch-repo.js.map +1 -1
- package/dist/setup/harness-managed-repo-marker.d.ts +1 -0
- package/dist/setup/harness-managed-repo-marker.d.ts.map +1 -1
- package/dist/setup/harness-managed-repo-marker.js +18 -0
- package/dist/setup/harness-managed-repo-marker.js.map +1 -1
- package/dist/setup/harness-provisioning-last-run.d.ts +27 -0
- package/dist/setup/harness-provisioning-last-run.d.ts.map +1 -0
- package/dist/setup/harness-provisioning-last-run.js +94 -0
- package/dist/setup/harness-provisioning-last-run.js.map +1 -0
- package/dist/setup/harness-provisioning-pending-state.d.ts +1 -1
- package/dist/setup/harness-provisioning-pending-state.d.ts.map +1 -1
- package/dist/setup/harness-provisioning-pending-state.js.map +1 -1
- package/dist/setup/harness-provisioning-progress.d.ts +58 -0
- package/dist/setup/harness-provisioning-progress.d.ts.map +1 -0
- package/dist/setup/harness-provisioning-progress.js +134 -0
- package/dist/setup/harness-provisioning-progress.js.map +1 -0
- package/dist/setup/harness-repo-provisioning.d.ts +11 -0
- package/dist/setup/harness-repo-provisioning.d.ts.map +1 -1
- package/dist/setup/harness-repo-provisioning.js +98 -6
- package/dist/setup/harness-repo-provisioning.js.map +1 -1
- package/dist/setup/harness-snapshot-git-transport.d.ts +92 -0
- package/dist/setup/harness-snapshot-git-transport.d.ts.map +1 -0
- package/dist/setup/harness-snapshot-git-transport.js +544 -0
- package/dist/setup/harness-snapshot-git-transport.js.map +1 -0
- package/dist/setup/harness-snapshot-provisioning-helpers.d.ts +1 -1
- package/dist/setup/harness-snapshot-provisioning-helpers.d.ts.map +1 -1
- package/dist/setup/harness-snapshot-provisioning-helpers.js.map +1 -1
- package/dist/setup/harness-snapshot-provisioning.d.ts +12 -1
- package/dist/setup/harness-snapshot-provisioning.d.ts.map +1 -1
- package/dist/setup/harness-snapshot-provisioning.js +298 -73
- package/dist/setup/harness-snapshot-provisioning.js.map +1 -1
- package/dist/setup/harness-step-readiness-server.d.ts +11 -0
- package/dist/setup/harness-step-readiness-server.d.ts.map +1 -0
- package/dist/setup/harness-step-readiness-server.js +24 -0
- package/dist/setup/harness-step-readiness-server.js.map +1 -0
- package/dist/setup/harness-step-readiness.d.ts +21 -0
- package/dist/setup/harness-step-readiness.d.ts.map +1 -0
- package/dist/setup/harness-step-readiness.js +40 -0
- package/dist/setup/harness-step-readiness.js.map +1 -0
- package/dist/setup/harness-workspace-snapshot-loader.d.ts +6 -1
- package/dist/setup/harness-workspace-snapshot-loader.d.ts.map +1 -1
- package/dist/setup/harness-workspace-snapshot-loader.js +45 -12
- package/dist/setup/harness-workspace-snapshot-loader.js.map +1 -1
- package/dist/setup/initial-setup-lifecycle.d.ts +51 -0
- package/dist/setup/initial-setup-lifecycle.d.ts.map +1 -0
- package/dist/setup/initial-setup-lifecycle.js +93 -0
- package/dist/setup/initial-setup-lifecycle.js.map +1 -0
- package/dist/setup/linear-category-labels.d.ts +2 -0
- package/dist/setup/linear-category-labels.d.ts.map +1 -0
- package/dist/setup/linear-category-labels.js +19 -0
- package/dist/setup/linear-category-labels.js.map +1 -0
- package/dist/setup/linear-setup-apply.d.ts +1 -0
- package/dist/setup/linear-setup-apply.d.ts.map +1 -1
- package/dist/setup/linear-setup-apply.js +67 -16
- package/dist/setup/linear-setup-apply.js.map +1 -1
- package/dist/setup/linear-setup-client.d.ts +24 -0
- package/dist/setup/linear-setup-client.d.ts.map +1 -1
- package/dist/setup/linear-setup-client.js +61 -0
- package/dist/setup/linear-setup-client.js.map +1 -1
- package/dist/setup/linear-setup-plan.d.ts +22 -1
- package/dist/setup/linear-setup-plan.d.ts.map +1 -1
- package/dist/setup/linear-setup-plan.js +69 -6
- package/dist/setup/linear-setup-plan.js.map +1 -1
- package/dist/setup/linear-setup-progress.d.ts +30 -0
- package/dist/setup/linear-setup-progress.d.ts.map +1 -0
- package/dist/setup/linear-setup-progress.js +71 -0
- package/dist/setup/linear-setup-progress.js.map +1 -0
- package/dist/setup/linear-status-contract.d.ts +2 -1
- package/dist/setup/linear-status-contract.d.ts.map +1 -1
- package/dist/setup/linear-status-contract.js +26 -67
- package/dist/setup/linear-status-contract.js.map +1 -1
- package/dist/setup/linear-workflow-status-repair.d.ts +36 -0
- package/dist/setup/linear-workflow-status-repair.d.ts.map +1 -0
- package/dist/setup/linear-workflow-status-repair.js +187 -0
- package/dist/setup/linear-workflow-status-repair.js.map +1 -0
- package/dist/setup/linear-workspace-apply.d.ts +25 -0
- package/dist/setup/linear-workspace-apply.d.ts.map +1 -0
- package/dist/setup/linear-workspace-apply.js +212 -0
- package/dist/setup/linear-workspace-apply.js.map +1 -0
- package/dist/setup/linear-workspace-drift.d.ts +2 -0
- package/dist/setup/linear-workspace-drift.d.ts.map +1 -0
- package/dist/setup/linear-workspace-drift.js +2 -0
- package/dist/setup/linear-workspace-drift.js.map +1 -0
- package/dist/setup/linear-workspace-migration.d.ts +43 -0
- package/dist/setup/linear-workspace-migration.d.ts.map +1 -0
- package/dist/setup/linear-workspace-migration.js +212 -0
- package/dist/setup/linear-workspace-migration.js.map +1 -0
- package/dist/setup/linear-workspace-plan.d.ts +92 -0
- package/dist/setup/linear-workspace-plan.d.ts.map +1 -0
- package/dist/setup/linear-workspace-plan.js +283 -0
- package/dist/setup/linear-workspace-plan.js.map +1 -0
- package/dist/setup/local-readiness-checks.d.ts +17 -0
- package/dist/setup/local-readiness-checks.d.ts.map +1 -1
- package/dist/setup/local-readiness-checks.js +86 -23
- package/dist/setup/local-readiness-checks.js.map +1 -1
- package/dist/setup/mock-target-workflow-finalization.d.ts.map +1 -1
- package/dist/setup/mock-target-workflow-finalization.js +27 -4
- package/dist/setup/mock-target-workflow-finalization.js.map +1 -1
- package/dist/setup/packaged-default-route.d.ts +15 -0
- package/dist/setup/packaged-default-route.d.ts.map +1 -0
- package/dist/setup/packaged-default-route.js +17 -0
- package/dist/setup/packaged-default-route.js.map +1 -0
- package/dist/setup/release-sync-managed-runner.d.ts +61 -0
- package/dist/setup/release-sync-managed-runner.d.ts.map +1 -0
- package/dist/setup/release-sync-managed-runner.js +364 -0
- package/dist/setup/release-sync-managed-runner.js.map +1 -0
- package/dist/setup/remote-apply-actions.d.ts.map +1 -1
- package/dist/setup/remote-apply-actions.js +23 -0
- package/dist/setup/remote-apply-actions.js.map +1 -1
- package/dist/setup/runner-upgrade-canary-dispatch.d.ts +19 -0
- package/dist/setup/runner-upgrade-canary-dispatch.d.ts.map +1 -0
- package/dist/setup/runner-upgrade-canary-dispatch.js +38 -0
- package/dist/setup/runner-upgrade-canary-dispatch.js.map +1 -0
- package/dist/setup/runner-upgrade-canary.d.ts +23 -0
- package/dist/setup/runner-upgrade-canary.d.ts.map +1 -0
- package/dist/setup/runner-upgrade-canary.js +146 -0
- package/dist/setup/runner-upgrade-canary.js.map +1 -0
- package/dist/setup/runner-upgrade-evidence.d.ts +14 -0
- package/dist/setup/runner-upgrade-evidence.d.ts.map +1 -0
- package/dist/setup/runner-upgrade-evidence.js +9 -0
- package/dist/setup/runner-upgrade-evidence.js.map +1 -0
- package/dist/setup/runner-upgrade-pending-state.d.ts +30 -0
- package/dist/setup/runner-upgrade-pending-state.d.ts.map +1 -0
- package/dist/setup/runner-upgrade-pending-state.js +75 -0
- package/dist/setup/runner-upgrade-pending-state.js.map +1 -0
- package/dist/setup/runner-upgrade-progress.d.ts +38 -0
- package/dist/setup/runner-upgrade-progress.d.ts.map +1 -0
- package/dist/setup/runner-upgrade-progress.js +95 -0
- package/dist/setup/runner-upgrade-progress.js.map +1 -0
- package/dist/setup/runner-upgrade-provider-live.d.ts +5 -0
- package/dist/setup/runner-upgrade-provider-live.d.ts.map +1 -0
- package/dist/setup/runner-upgrade-provider-live.js +338 -0
- package/dist/setup/runner-upgrade-provider-live.js.map +1 -0
- package/dist/setup/runner-upgrade-provider.d.ts +231 -0
- package/dist/setup/runner-upgrade-provider.d.ts.map +1 -0
- package/dist/setup/runner-upgrade-provider.js +466 -0
- package/dist/setup/runner-upgrade-provider.js.map +1 -0
- package/dist/setup/runner-upgrade-status-cache.d.ts +13 -0
- package/dist/setup/runner-upgrade-status-cache.d.ts.map +1 -0
- package/dist/setup/runner-upgrade-status-cache.js +39 -0
- package/dist/setup/runner-upgrade-status-cache.js.map +1 -0
- package/dist/setup/runner-upgrade-three-way.d.ts +28 -0
- package/dist/setup/runner-upgrade-three-way.d.ts.map +1 -0
- package/dist/setup/runner-upgrade-three-way.js +102 -0
- package/dist/setup/runner-upgrade-three-way.js.map +1 -0
- package/dist/setup/runner-upgrade-timeouts.d.ts +72 -0
- package/dist/setup/runner-upgrade-timeouts.d.ts.map +1 -0
- package/dist/setup/runner-upgrade-timeouts.js +261 -0
- package/dist/setup/runner-upgrade-timeouts.js.map +1 -0
- package/dist/setup/runner-upgrade-types.d.ts +84 -0
- package/dist/setup/runner-upgrade-types.d.ts.map +1 -0
- package/dist/setup/runner-upgrade-types.js +64 -0
- package/dist/setup/runner-upgrade-types.js.map +1 -0
- package/dist/setup/runner-upgrade-worker.d.ts +17 -0
- package/dist/setup/runner-upgrade-worker.d.ts.map +1 -0
- package/dist/setup/runner-upgrade-worker.js +115 -0
- package/dist/setup/runner-upgrade-worker.js.map +1 -0
- package/dist/setup/runner-upgrade.d.ts +57 -0
- package/dist/setup/runner-upgrade.d.ts.map +1 -0
- package/dist/setup/runner-upgrade.js +1311 -0
- package/dist/setup/runner-upgrade.js.map +1 -0
- package/dist/setup/service-verification.d.ts +18 -1
- package/dist/setup/service-verification.d.ts.map +1 -1
- package/dist/setup/service-verification.js +110 -19
- package/dist/setup/service-verification.js.map +1 -1
- package/dist/setup/settings-config-patch.d.ts +69 -0
- package/dist/setup/settings-config-patch.d.ts.map +1 -0
- package/dist/setup/settings-config-patch.js +312 -0
- package/dist/setup/settings-config-patch.js.map +1 -0
- package/dist/setup/setup-state.d.ts +1 -0
- package/dist/setup/setup-state.d.ts.map +1 -1
- package/dist/setup/setup-state.js +11 -1
- package/dist/setup/setup-state.js.map +1 -1
- package/dist/setup/step6-automatic-control-state.d.ts +21 -0
- package/dist/setup/step6-automatic-control-state.d.ts.map +1 -0
- package/dist/setup/step6-automatic-control-state.js +28 -0
- package/dist/setup/step6-automatic-control-state.js.map +1 -0
- package/dist/setup/sync-harness-config-cloud.d.ts +23 -0
- package/dist/setup/sync-harness-config-cloud.d.ts.map +1 -0
- package/dist/setup/sync-harness-config-cloud.js +91 -0
- package/dist/setup/sync-harness-config-cloud.js.map +1 -0
- package/dist/setup/target-repo-provisioning-pending-state.d.ts +42 -0
- package/dist/setup/target-repo-provisioning-pending-state.d.ts.map +1 -0
- package/dist/setup/target-repo-provisioning-pending-state.js +95 -0
- package/dist/setup/target-repo-provisioning-pending-state.js.map +1 -0
- package/dist/setup/target-repo-provisioning.d.ts +67 -0
- package/dist/setup/target-repo-provisioning.d.ts.map +1 -0
- package/dist/setup/target-repo-provisioning.js +473 -0
- package/dist/setup/target-repo-provisioning.js.map +1 -0
- package/dist/setup/target-workflow-finalization-progress.d.ts +43 -0
- package/dist/setup/target-workflow-finalization-progress.d.ts.map +1 -0
- package/dist/setup/target-workflow-finalization-progress.js +83 -0
- package/dist/setup/target-workflow-finalization-progress.js.map +1 -0
- package/dist/setup/target-workflow-finalization-types.d.ts +21 -1
- package/dist/setup/target-workflow-finalization-types.d.ts.map +1 -1
- package/dist/setup/target-workflow-finalization-types.js +75 -0
- package/dist/setup/target-workflow-finalization-types.js.map +1 -1
- package/dist/setup/target-workflow-finalization.d.ts.map +1 -1
- package/dist/setup/target-workflow-finalization.js +618 -15
- package/dist/setup/target-workflow-finalization.js.map +1 -1
- package/dist/setup/target-workflow-setup.d.ts.map +1 -1
- package/dist/setup/target-workflow-setup.js +2 -0
- package/dist/setup/target-workflow-setup.js.map +1 -1
- package/dist/setup/test-only-runner-upgrade-provider.d.ts +11 -0
- package/dist/setup/test-only-runner-upgrade-provider.d.ts.map +1 -0
- package/dist/setup/test-only-runner-upgrade-provider.js +37 -0
- package/dist/setup/test-only-runner-upgrade-provider.js.map +1 -0
- package/dist/setup/test-only-target-repo-provisioning-provider.d.ts +7 -0
- package/dist/setup/test-only-target-repo-provisioning-provider.d.ts.map +1 -0
- package/dist/setup/test-only-target-repo-provisioning-provider.js +33 -0
- package/dist/setup/test-only-target-repo-provisioning-provider.js.map +1 -0
- package/dist/setup/vercel-bridge-artifact.d.ts +7 -0
- package/dist/setup/vercel-bridge-artifact.d.ts.map +1 -0
- package/dist/setup/vercel-bridge-artifact.js +164 -0
- package/dist/setup/vercel-bridge-artifact.js.map +1 -0
- package/dist/setup/vercel-bridge-deploy.d.ts +42 -0
- package/dist/setup/vercel-bridge-deploy.d.ts.map +1 -0
- package/dist/setup/vercel-bridge-deploy.js +138 -0
- package/dist/setup/vercel-bridge-deploy.js.map +1 -0
- package/dist/setup/vercel-bridge-diagnostics.js +1 -1
- package/dist/setup/vercel-bridge-diagnostics.js.map +1 -1
- package/dist/setup/vercel-bridge-options.d.ts +2 -0
- package/dist/setup/vercel-bridge-options.d.ts.map +1 -1
- package/dist/setup/vercel-bridge-options.js +2 -0
- package/dist/setup/vercel-bridge-options.js.map +1 -1
- package/dist/setup/vercel-bridge-orchestration-summary.d.ts +13 -0
- package/dist/setup/vercel-bridge-orchestration-summary.d.ts.map +1 -0
- package/dist/setup/vercel-bridge-orchestration-summary.js +22 -0
- package/dist/setup/vercel-bridge-orchestration-summary.js.map +1 -0
- package/dist/setup/vercel-bridge-project-marker.d.ts +5 -0
- package/dist/setup/vercel-bridge-project-marker.d.ts.map +1 -0
- package/dist/setup/vercel-bridge-project-marker.js +6 -0
- package/dist/setup/vercel-bridge-project-marker.js.map +1 -0
- package/dist/setup/vercel-bridge-readiness.d.ts +1 -0
- package/dist/setup/vercel-bridge-readiness.d.ts.map +1 -1
- package/dist/setup/vercel-bridge-readiness.js +1 -1
- package/dist/setup/vercel-bridge-readiness.js.map +1 -1
- package/dist/setup/vercel-bridge-redeploy-normalize.d.ts +18 -0
- package/dist/setup/vercel-bridge-redeploy-normalize.d.ts.map +1 -0
- package/dist/setup/vercel-bridge-redeploy-normalize.js +175 -0
- package/dist/setup/vercel-bridge-redeploy-normalize.js.map +1 -0
- package/dist/setup/vercel-bridge-redeploy-poll.d.ts +7 -1
- package/dist/setup/vercel-bridge-redeploy-poll.d.ts.map +1 -1
- package/dist/setup/vercel-bridge-redeploy-poll.js +329 -166
- package/dist/setup/vercel-bridge-redeploy-poll.js.map +1 -1
- package/dist/setup/vercel-bridge-redeploy-state.d.ts.map +1 -1
- package/dist/setup/vercel-bridge-redeploy-state.js +3 -0
- package/dist/setup/vercel-bridge-redeploy-state.js.map +1 -1
- package/dist/setup/vercel-bridge-structured-log.d.ts +5 -0
- package/dist/setup/vercel-bridge-structured-log.d.ts.map +1 -1
- package/dist/setup/vercel-bridge-structured-log.js.map +1 -1
- package/dist/setup/vercel-project-name.d.ts +7 -0
- package/dist/setup/vercel-project-name.d.ts.map +1 -0
- package/dist/setup/vercel-project-name.js +26 -0
- package/dist/setup/vercel-project-name.js.map +1 -0
- package/dist/setup/vercel-setup-apply.d.ts +7 -2
- package/dist/setup/vercel-setup-apply.d.ts.map +1 -1
- package/dist/setup/vercel-setup-apply.js +315 -38
- package/dist/setup/vercel-setup-apply.js.map +1 -1
- package/dist/setup/vercel-setup-client.d.ts +26 -1
- package/dist/setup/vercel-setup-client.d.ts.map +1 -1
- package/dist/setup/vercel-setup-client.js +50 -1
- package/dist/setup/vercel-setup-client.js.map +1 -1
- package/dist/setup/vercel-setup-plan.d.ts +5 -0
- package/dist/setup/vercel-setup-plan.d.ts.map +1 -1
- package/dist/setup/vercel-setup-plan.js +65 -13
- package/dist/setup/vercel-setup-plan.js.map +1 -1
- package/dist/setup/vercel-setup-summary.d.ts +3 -0
- package/dist/setup/vercel-setup-summary.d.ts.map +1 -1
- package/dist/setup/vercel-setup-summary.js +4 -0
- package/dist/setup/vercel-setup-summary.js.map +1 -1
- package/dist/setup/workflow-config-snapshot.d.ts +8 -0
- package/dist/setup/workflow-config-snapshot.d.ts.map +1 -0
- package/dist/setup/workflow-config-snapshot.js +13 -0
- package/dist/setup/workflow-config-snapshot.js.map +1 -0
- package/dist/setup/workflow-install-branch-recovery.d.ts +116 -0
- package/dist/setup/workflow-install-branch-recovery.d.ts.map +1 -0
- package/dist/setup/workflow-install-branch-recovery.js +385 -0
- package/dist/setup/workflow-install-branch-recovery.js.map +1 -0
- package/dist/setup/workflow-install-merge-errors.d.ts +5 -2
- package/dist/setup/workflow-install-merge-errors.d.ts.map +1 -1
- package/dist/setup/workflow-install-merge-errors.js +51 -17
- package/dist/setup/workflow-install-merge-errors.js.map +1 -1
- package/dist/setup/workflow-install-merge-gate.d.ts +10 -0
- package/dist/setup/workflow-install-merge-gate.d.ts.map +1 -0
- package/dist/setup/workflow-install-merge-gate.js +21 -0
- package/dist/setup/workflow-install-merge-gate.js.map +1 -0
- package/dist/setup/workflow-model-save-queue.d.ts +16 -0
- package/dist/setup/workflow-model-save-queue.d.ts.map +1 -0
- package/dist/setup/workflow-model-save-queue.js +174 -0
- package/dist/setup/workflow-model-save-queue.js.map +1 -0
- package/dist/setup/workflow-model-sync-lock.d.ts +12 -0
- package/dist/setup/workflow-model-sync-lock.d.ts.map +1 -0
- package/dist/setup/workflow-model-sync-lock.js +79 -0
- package/dist/setup/workflow-model-sync-lock.js.map +1 -0
- package/dist/setup/workflow-model-sync.d.ts +34 -0
- package/dist/setup/workflow-model-sync.d.ts.map +1 -0
- package/dist/setup/workflow-model-sync.js +163 -0
- package/dist/setup/workflow-model-sync.js.map +1 -0
- package/dist/setup/workflow-models-sync-evidence.d.ts +12 -0
- package/dist/setup/workflow-models-sync-evidence.d.ts.map +1 -0
- package/dist/setup/workflow-models-sync-evidence.js +15 -0
- package/dist/setup/workflow-models-sync-evidence.js.map +1 -0
- package/dist/types/parsed-issue.d.ts +8 -0
- package/dist/types/parsed-issue.d.ts.map +1 -1
- package/dist/types/run.d.ts +18 -3
- package/dist/types/run.d.ts.map +1 -1
- package/dist/validate/issue.d.ts +5 -0
- package/dist/validate/issue.d.ts.map +1 -1
- package/dist/validate/issue.js +23 -3
- package/dist/validate/issue.js.map +1 -1
- package/dist/validate/types.d.ts +3 -0
- package/dist/validate/types.d.ts.map +1 -1
- package/dist/webhook/dispatch-statuses.d.ts +1 -1
- package/dist/webhook/dispatch-statuses.d.ts.map +1 -1
- package/dist/webhook/dispatch-statuses.js +4 -13
- package/dist/webhook/dispatch-statuses.js.map +1 -1
- package/dist/webhook/filter.d.ts +5 -2
- package/dist/webhook/filter.d.ts.map +1 -1
- package/dist/webhook/filter.js +15 -1
- package/dist/webhook/filter.js.map +1 -1
- package/dist/webhook/handle-linear-webhook.d.ts.map +1 -1
- package/dist/webhook/handle-linear-webhook.js +15 -1
- package/dist/webhook/handle-linear-webhook.js.map +1 -1
- package/dist/webhook/parse-linear-issue-event.d.ts +6 -0
- package/dist/webhook/parse-linear-issue-event.d.ts.map +1 -1
- package/dist/webhook/parse-linear-issue-event.js +2 -0
- package/dist/webhook/parse-linear-issue-event.js.map +1 -1
- package/dist/webhook/types.d.ts +3 -1
- package/dist/webhook/types.d.ts.map +1 -1
- package/dist/workflow/canonical-product-development-workflow.d.ts +106 -0
- package/dist/workflow/canonical-product-development-workflow.d.ts.map +1 -0
- package/dist/workflow/canonical-product-development-workflow.js +425 -0
- package/dist/workflow/canonical-product-development-workflow.js.map +1 -0
- package/dist/workflow/canonical-workflow-gate.d.ts +33 -0
- package/dist/workflow/canonical-workflow-gate.d.ts.map +1 -0
- package/dist/workflow/canonical-workflow-gate.js +164 -0
- package/dist/workflow/canonical-workflow-gate.js.map +1 -0
- package/dist/workflow/canonical-workflow-validation.d.ts +44 -0
- package/dist/workflow/canonical-workflow-validation.d.ts.map +1 -0
- package/dist/workflow/canonical-workflow-validation.js +193 -0
- package/dist/workflow/canonical-workflow-validation.js.map +1 -0
- package/dist/workflow/finalize-harness-run.d.ts +2 -0
- package/dist/workflow/finalize-harness-run.d.ts.map +1 -0
- package/dist/workflow/finalize-harness-run.js +62 -0
- package/dist/workflow/finalize-harness-run.js.map +1 -0
- package/dist/workflow/preflight-canonical.d.ts +11 -0
- package/dist/workflow/preflight-canonical.d.ts.map +1 -0
- package/dist/workflow/preflight-canonical.js +20 -0
- package/dist/workflow/preflight-canonical.js.map +1 -0
- package/dist/workflow/write-fallback-manifest.d.ts +2 -0
- package/dist/workflow/write-fallback-manifest.d.ts.map +1 -0
- package/dist/workflow/write-fallback-manifest.js +30 -0
- package/dist/workflow/write-fallback-manifest.js.map +1 -0
- package/dist/workflow-page/bootstrap.d.ts +21 -0
- package/dist/workflow-page/bootstrap.d.ts.map +1 -0
- package/dist/workflow-page/bootstrap.js +185 -0
- package/dist/workflow-page/bootstrap.js.map +1 -0
- package/dist/workflow-page/catalog-validation.d.ts +33 -0
- package/dist/workflow-page/catalog-validation.d.ts.map +1 -0
- package/dist/workflow-page/catalog-validation.js +105 -0
- package/dist/workflow-page/catalog-validation.js.map +1 -0
- package/dist/workflow-page/constants.d.ts +7 -0
- package/dist/workflow-page/constants.d.ts.map +1 -0
- package/dist/workflow-page/constants.js +18 -0
- package/dist/workflow-page/constants.js.map +1 -0
- package/dist/workflow-page/current-workflow.d.ts +18 -0
- package/dist/workflow-page/current-workflow.d.ts.map +1 -0
- package/dist/workflow-page/current-workflow.js +142 -0
- package/dist/workflow-page/current-workflow.js.map +1 -0
- package/dist/workflow-page/fingerprint.d.ts +3 -0
- package/dist/workflow-page/fingerprint.d.ts.map +1 -0
- package/dist/workflow-page/fingerprint.js +8 -0
- package/dist/workflow-page/fingerprint.js.map +1 -0
- package/dist/workflow-page/fixture-definition.d.ts +13 -0
- package/dist/workflow-page/fixture-definition.d.ts.map +1 -0
- package/dist/workflow-page/fixture-definition.js +2 -0
- package/dist/workflow-page/fixture-definition.js.map +1 -0
- package/dist/workflow-page/fixture-role-models.d.ts +19 -0
- package/dist/workflow-page/fixture-role-models.d.ts.map +1 -0
- package/dist/workflow-page/fixture-role-models.js +32 -0
- package/dist/workflow-page/fixture-role-models.js.map +1 -0
- package/dist/workflow-page/fixtures/basic-current-workflow.d.ts +5 -0
- package/dist/workflow-page/fixtures/basic-current-workflow.d.ts.map +1 -0
- package/dist/workflow-page/fixtures/basic-current-workflow.js +36 -0
- package/dist/workflow-page/fixtures/basic-current-workflow.js.map +1 -0
- package/dist/workflow-page/fixtures/branching-pr-review.d.ts +3 -0
- package/dist/workflow-page/fixtures/branching-pr-review.d.ts.map +1 -0
- package/dist/workflow-page/fixtures/branching-pr-review.js +10 -0
- package/dist/workflow-page/fixtures/branching-pr-review.js.map +1 -0
- package/dist/workflow-page/fixtures/canonical-violations.d.ts +6 -0
- package/dist/workflow-page/fixtures/canonical-violations.d.ts.map +1 -0
- package/dist/workflow-page/fixtures/canonical-violations.js +19 -0
- package/dist/workflow-page/fixtures/canonical-violations.js.map +1 -0
- package/dist/workflow-page/fixtures/credential-errors.d.ts +3 -0
- package/dist/workflow-page/fixtures/credential-errors.d.ts.map +1 -0
- package/dist/workflow-page/fixtures/credential-errors.js +12 -0
- package/dist/workflow-page/fixtures/credential-errors.js.map +1 -0
- package/dist/workflow-page/fixtures/empty-linear-statuses.d.ts +3 -0
- package/dist/workflow-page/fixtures/empty-linear-statuses.d.ts.map +1 -0
- package/dist/workflow-page/fixtures/empty-linear-statuses.js +9 -0
- package/dist/workflow-page/fixtures/empty-linear-statuses.js.map +1 -0
- package/dist/workflow-page/fixtures/hundred-node-performance.d.ts +3 -0
- package/dist/workflow-page/fixtures/hundred-node-performance.d.ts.map +1 -0
- package/dist/workflow-page/fixtures/hundred-node-performance.js +21 -0
- package/dist/workflow-page/fixtures/hundred-node-performance.js.map +1 -0
- package/dist/workflow-page/fixtures/index.d.ts +6 -0
- package/dist/workflow-page/fixtures/index.d.ts.map +1 -0
- package/dist/workflow-page/fixtures/index.js +24 -0
- package/dist/workflow-page/fixtures/index.js.map +1 -0
- package/dist/workflow-page/fixtures/model-catalog-snapshot.d.ts +10 -0
- package/dist/workflow-page/fixtures/model-catalog-snapshot.d.ts.map +1 -0
- package/dist/workflow-page/fixtures/model-catalog-snapshot.js +29 -0
- package/dist/workflow-page/fixtures/model-catalog-snapshot.js.map +1 -0
- package/dist/workflow-page/fixtures/workflow-scopes.d.ts +4 -0
- package/dist/workflow-page/fixtures/workflow-scopes.d.ts.map +1 -0
- package/dist/workflow-page/fixtures/workflow-scopes.js +16 -0
- package/dist/workflow-page/fixtures/workflow-scopes.js.map +1 -0
- package/dist/workflow-page/linear-status-source.d.ts +15 -0
- package/dist/workflow-page/linear-status-source.d.ts.map +1 -0
- package/dist/workflow-page/linear-status-source.js +44 -0
- package/dist/workflow-page/linear-status-source.js.map +1 -0
- package/dist/workflow-page/model-catalog-lookup.d.ts +3 -0
- package/dist/workflow-page/model-catalog-lookup.d.ts.map +1 -0
- package/dist/workflow-page/model-catalog-lookup.js +4 -0
- package/dist/workflow-page/model-catalog-lookup.js.map +1 -0
- package/dist/workflow-page/model-catalog-utils.d.ts +19 -0
- package/dist/workflow-page/model-catalog-utils.d.ts.map +1 -0
- package/dist/workflow-page/model-catalog-utils.js +46 -0
- package/dist/workflow-page/model-catalog-utils.js.map +1 -0
- package/dist/workflow-page/model-catalog.d.ts +12 -0
- package/dist/workflow-page/model-catalog.d.ts.map +1 -0
- package/dist/workflow-page/model-catalog.js +40 -0
- package/dist/workflow-page/model-catalog.js.map +1 -0
- package/dist/workflow-page/scope-branches.d.ts +11 -0
- package/dist/workflow-page/scope-branches.d.ts.map +1 -0
- package/dist/workflow-page/scope-branches.js +18 -0
- package/dist/workflow-page/scope-branches.js.map +1 -0
- package/dist/workflow-page/source-context.d.ts +13 -0
- package/dist/workflow-page/source-context.d.ts.map +1 -0
- package/dist/workflow-page/source-context.js +61 -0
- package/dist/workflow-page/source-context.js.map +1 -0
- package/dist/workflow-page/types.d.ts +108 -0
- package/dist/workflow-page/types.d.ts.map +1 -0
- package/dist/workflow-page/types.js +2 -0
- package/dist/workflow-page/types.js.map +1 -0
- package/dist/workflow-page/workflow-scopes.d.ts +16 -0
- package/dist/workflow-page/workflow-scopes.d.ts.map +1 -0
- package/dist/workflow-page/workflow-scopes.js +55 -0
- package/dist/workflow-page/workflow-scopes.js.map +1 -0
- package/gui/.next/BUILD_ID +1 -1
- package/gui/.next/app-build-manifest.json +376 -115
- package/gui/.next/app-path-routes-manifest.json +44 -15
- package/gui/.next/build-manifest.json +12 -12
- package/gui/.next/next-minimal-server.js.nft.json +1 -1
- package/gui/.next/next-server.js.nft.json +1 -1
- package/gui/.next/prerender-manifest.json +0 -24
- package/gui/.next/required-server-files.json +4 -3
- package/gui/.next/routes-manifest.json +54 -0
- package/gui/.next/server/app/_not-found/page.js +2 -2
- package/gui/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/gui/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/_not-found.html +1 -1
- package/gui/.next/server/app/_not-found.rsc +3 -3
- package/gui/.next/server/app/api/observability/event/route.js +1 -0
- package/gui/.next/server/app/api/observability/event/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/observability/event/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/observability/preferences/route.js +1 -0
- package/gui/.next/server/app/api/observability/preferences/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/observability/preferences/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/operations/bootstrap/route.js +1 -0
- package/gui/.next/server/app/api/operations/bootstrap/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/operations/bootstrap/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/operations/draft/route.js +1 -0
- package/gui/.next/server/app/api/operations/draft/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/operations/draft/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/settings/apply-config-patch/route.js +8 -0
- package/gui/.next/server/app/api/settings/apply-config-patch/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/settings/apply-config-patch/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/settings/preview-config-patch/route.js +8 -0
- package/gui/.next/server/app/api/settings/preview-config-patch/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/settings/preview-config-patch/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/apply-connect-services/route.js +1 -1
- package/gui/.next/server/app/api/setup/apply-connect-services/route.js.nft.json +1 -1
- package/gui/.next/server/app/api/setup/apply-connect-services/route_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/api/setup/apply-harness-repo-provisioning/route.js +1 -1
- package/gui/.next/server/app/api/setup/apply-harness-repo-provisioning/route.js.nft.json +1 -1
- package/gui/.next/server/app/api/setup/apply-harness-repo-provisioning/route_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/api/setup/apply-harness-secrets/route.js +1 -1
- package/gui/.next/server/app/api/setup/apply-harness-secrets/route.js.nft.json +1 -1
- package/gui/.next/server/app/api/setup/apply-harness-secrets/route_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/api/setup/apply-linear-setup/route.js +1 -1
- package/gui/.next/server/app/api/setup/apply-linear-setup/route.js.nft.json +1 -1
- package/gui/.next/server/app/api/setup/apply-linear-setup/route_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/api/setup/apply-linear-workspace/route.js +1 -0
- package/gui/.next/server/app/api/setup/apply-linear-workspace/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/apply-linear-workspace/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/apply-local-files/route.js +1 -1
- package/gui/.next/server/app/api/setup/apply-local-files/route.js.nft.json +1 -1
- package/gui/.next/server/app/api/setup/apply-local-files/route_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/api/setup/apply-runner-upgrade/route.js +1 -0
- package/gui/.next/server/app/api/setup/apply-runner-upgrade/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/apply-runner-upgrade/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/apply-target-repo-provisioning/route.js +1 -0
- package/gui/.next/server/app/api/setup/apply-target-repo-provisioning/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/apply-target-repo-provisioning/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/apply-target-workflow/route.js +1 -1
- package/gui/.next/server/app/api/setup/apply-target-workflow/route.js.nft.json +1 -1
- package/gui/.next/server/app/api/setup/apply-target-workflow/route_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/api/setup/apply-vercel-bridge/route.js +1 -1
- package/gui/.next/server/app/api/setup/apply-vercel-bridge/route.js.nft.json +1 -1
- package/gui/.next/server/app/api/setup/apply-vercel-bridge/route_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/api/setup/complete-initial-setup/route.js +1 -0
- package/gui/.next/server/app/api/setup/complete-initial-setup/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/complete-initial-setup/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/finalize-target-workflow/route.js +1 -1
- package/gui/.next/server/app/api/setup/finalize-target-workflow/route.js.nft.json +1 -1
- package/gui/.next/server/app/api/setup/finalize-target-workflow/route_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/api/setup/harness-provisioning-progress/route.js +1 -0
- package/gui/.next/server/app/api/setup/harness-provisioning-progress/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/harness-provisioning-progress/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/harness-provisioning-summary/route.js +1 -1
- package/gui/.next/server/app/api/setup/harness-provisioning-summary/route.js.nft.json +1 -1
- package/gui/.next/server/app/api/setup/harness-provisioning-summary/route_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/api/setup/linear-options/route.js +1 -1
- package/gui/.next/server/app/api/setup/linear-options/route.js.nft.json +1 -1
- package/gui/.next/server/app/api/setup/linear-options/route_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/api/setup/linear-setup-progress/route.js +1 -0
- package/gui/.next/server/app/api/setup/linear-setup-progress/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/linear-setup-progress/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/linear-summary/route.js +1 -1
- package/gui/.next/server/app/api/setup/linear-summary/route.js.nft.json +1 -1
- package/gui/.next/server/app/api/setup/linear-summary/route_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/api/setup/linear-workspace-editor-state/route.js +1 -0
- package/gui/.next/server/app/api/setup/linear-workspace-editor-state/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/linear-workspace-editor-state/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/local-readiness/route.js +3 -1
- package/gui/.next/server/app/api/setup/local-readiness/route.js.nft.json +1 -1
- package/gui/.next/server/app/api/setup/local-readiness/route_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/api/setup/manual-harness-secret-values/route.js +1 -1
- package/gui/.next/server/app/api/setup/manual-harness-secret-values/route.js.nft.json +1 -1
- package/gui/.next/server/app/api/setup/manual-harness-secret-values/route_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/api/setup/preview-connect-services/route.js +1 -1
- package/gui/.next/server/app/api/setup/preview-connect-services/route.js.nft.json +1 -1
- package/gui/.next/server/app/api/setup/preview-connect-services/route_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/api/setup/preview-harness-repo-provisioning/route.js +1 -1
- package/gui/.next/server/app/api/setup/preview-harness-repo-provisioning/route.js.nft.json +1 -1
- package/gui/.next/server/app/api/setup/preview-harness-repo-provisioning/route_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/api/setup/preview-harness-secrets/route.js +1 -1
- package/gui/.next/server/app/api/setup/preview-harness-secrets/route.js.nft.json +1 -1
- package/gui/.next/server/app/api/setup/preview-harness-secrets/route_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/api/setup/preview-linear-setup/route.js +1 -1
- package/gui/.next/server/app/api/setup/preview-linear-setup/route.js.nft.json +1 -1
- package/gui/.next/server/app/api/setup/preview-linear-setup/route_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/api/setup/preview-linear-workspace/route.js +1 -0
- package/gui/.next/server/app/api/setup/preview-linear-workspace/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/preview-linear-workspace/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/preview-local-files/route.js +1 -1
- package/gui/.next/server/app/api/setup/preview-local-files/route.js.nft.json +1 -1
- package/gui/.next/server/app/api/setup/preview-local-files/route_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/api/setup/preview-runner-upgrade/route.js +1 -0
- package/gui/.next/server/app/api/setup/preview-runner-upgrade/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/preview-runner-upgrade/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/preview-target-repo-provisioning/route.js +1 -0
- package/gui/.next/server/app/api/setup/preview-target-repo-provisioning/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/preview-target-repo-provisioning/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/preview-target-workflow/route.js +1 -1
- package/gui/.next/server/app/api/setup/preview-target-workflow/route.js.nft.json +1 -1
- package/gui/.next/server/app/api/setup/preview-target-workflow/route_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/api/setup/preview-vercel-bridge/route.js +1 -1
- package/gui/.next/server/app/api/setup/preview-vercel-bridge/route.js.nft.json +1 -1
- package/gui/.next/server/app/api/setup/preview-vercel-bridge/route_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/api/setup/remote-summary/route.js +1 -1
- package/gui/.next/server/app/api/setup/remote-summary/route.js.nft.json +1 -1
- package/gui/.next/server/app/api/setup/remote-summary/route_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/api/setup/runner-upgrade-progress/route.js +1 -0
- package/gui/.next/server/app/api/setup/runner-upgrade-progress/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/runner-upgrade-progress/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/runner-upgrade-status/route.js +1 -0
- package/gui/.next/server/app/api/setup/runner-upgrade-status/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/runner-upgrade-status/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/summary/route.js +1 -1
- package/gui/.next/server/app/api/setup/summary/route.js.nft.json +1 -1
- package/gui/.next/server/app/api/setup/summary/route_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/api/setup/vercel-bridge-options/route.js +1 -1
- package/gui/.next/server/app/api/setup/vercel-bridge-options/route.js.nft.json +1 -1
- package/gui/.next/server/app/api/setup/vercel-bridge-options/route_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/api/setup/vercel-bridge-redeploy-status/route.js +1 -1
- package/gui/.next/server/app/api/setup/vercel-bridge-redeploy-status/route.js.nft.json +1 -1
- package/gui/.next/server/app/api/setup/vercel-bridge-redeploy-status/route_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/api/setup/vercel-summary/route.js +1 -1
- package/gui/.next/server/app/api/setup/vercel-summary/route.js.nft.json +1 -1
- package/gui/.next/server/app/api/setup/vercel-summary/route_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/api/setup/verify-harness-repo/route.js +1 -1
- package/gui/.next/server/app/api/setup/verify-harness-repo/route.js.nft.json +1 -1
- package/gui/.next/server/app/api/setup/verify-harness-repo/route_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/api/setup/verify-service/route.js +1 -1
- package/gui/.next/server/app/api/setup/verify-service/route.js.nft.json +1 -1
- package/gui/.next/server/app/api/setup/verify-service/route_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/api/setup/verify-target-repo/route.js +1 -1
- package/gui/.next/server/app/api/setup/verify-target-repo/route.js.nft.json +1 -1
- package/gui/.next/server/app/api/setup/verify-target-repo/route_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/api/workflow/bootstrap/route.js +1 -0
- package/gui/.next/server/app/api/workflow/bootstrap/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/workflow/bootstrap/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/workflow/models/route.js +1 -0
- package/gui/.next/server/app/api/workflow/models/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/workflow/models/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/operations/page.js +2 -0
- package/gui/.next/server/app/operations/page.js.nft.json +1 -0
- package/gui/.next/server/app/operations/page_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/page.js +3 -2
- package/gui/.next/server/app/page.js.nft.json +1 -1
- package/gui/.next/server/app/page_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/settings/(console)/connections/page.js +2 -0
- package/gui/.next/server/app/settings/(console)/connections/page.js.nft.json +1 -0
- package/gui/.next/server/app/settings/(console)/connections/page_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/settings/(console)/data-sharing/page.js +2 -0
- package/gui/.next/server/app/settings/(console)/data-sharing/page.js.nft.json +1 -0
- package/gui/.next/server/app/settings/(console)/data-sharing/page_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/settings/(console)/deployments/page.js +2 -0
- package/gui/.next/server/app/settings/(console)/deployments/page.js.nft.json +1 -0
- package/gui/.next/server/app/settings/(console)/deployments/page_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/settings/(console)/linear/page.js +10 -0
- package/gui/.next/server/app/settings/(console)/linear/page.js.nft.json +1 -0
- package/gui/.next/server/app/settings/(console)/linear/page_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/settings/(console)/models/page.js +2 -0
- package/gui/.next/server/app/settings/(console)/models/page.js.nft.json +1 -0
- package/gui/.next/server/app/settings/(console)/models/page_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/settings/(console)/page.js +2 -0
- package/gui/.next/server/app/settings/(console)/page.js.nft.json +1 -0
- package/gui/.next/server/app/settings/(console)/page_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/settings/(console)/repositories/page.js +6 -0
- package/gui/.next/server/app/settings/(console)/repositories/page.js.nft.json +1 -0
- package/gui/.next/server/app/settings/(console)/repositories/page_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/settings/configure/page.js +4 -4
- package/gui/.next/server/app/settings/configure/page.js.nft.json +1 -1
- package/gui/.next/server/app/settings/configure/page_client-reference-manifest.js +1 -1
- package/gui/.next/server/app/workflow/page.js +2 -0
- package/gui/.next/server/app/workflow/page.js.nft.json +1 -0
- package/gui/.next/server/app/workflow/page_client-reference-manifest.js +1 -0
- package/gui/.next/server/app-paths-manifest.json +44 -15
- package/gui/.next/server/chunks/105.js +2 -0
- package/gui/.next/server/chunks/1304.js +200 -0
- package/gui/.next/server/chunks/1536.js +1 -0
- package/gui/.next/server/chunks/1948.js +59 -0
- package/gui/.next/server/chunks/2470.js +3 -0
- package/gui/.next/server/chunks/2581.js +2 -0
- package/gui/.next/server/chunks/383.js +1 -1
- package/gui/.next/server/chunks/521.js +1 -0
- package/gui/.next/server/chunks/553.js +1 -0
- package/gui/.next/server/chunks/5827.js +1 -0
- package/gui/.next/server/chunks/6408.js +1 -0
- package/gui/.next/server/chunks/641.js +1 -0
- package/gui/.next/server/chunks/6482.js +1 -0
- package/gui/.next/server/chunks/6801.js +1 -0
- package/gui/.next/server/chunks/6890.js +1 -0
- package/gui/.next/server/chunks/7201.js +1 -0
- package/gui/.next/server/chunks/7221.js +1 -0
- package/gui/.next/server/chunks/{332.js → 7332.js} +1 -1
- package/gui/.next/server/chunks/7527.js +1 -0
- package/gui/.next/server/chunks/8312.js +1 -0
- package/gui/.next/server/chunks/8476.js +8 -0
- package/gui/.next/server/chunks/8764.js +16 -0
- package/gui/.next/server/chunks/8819.js +22 -0
- package/gui/.next/server/chunks/8825.js +1 -0
- package/gui/.next/server/chunks/9148.js +1 -0
- package/gui/.next/server/chunks/9454.js +1 -0
- package/gui/.next/server/instrumentation.js +1 -0
- package/gui/.next/server/instrumentation.js.nft.json +1 -0
- package/gui/.next/server/middleware-build-manifest.js +1 -1
- package/gui/.next/server/pages/404.html +1 -1
- package/gui/.next/server/pages/500.html +1 -1
- package/gui/.next/server/pages/_document.js +1 -1
- package/gui/.next/server/pages/_document.js.nft.json +1 -1
- package/gui/.next/server/pages/_error.js +2 -2
- package/gui/.next/server/pages/_error.js.nft.json +1 -1
- package/gui/.next/server/pages-manifest.json +1 -1
- package/gui/.next/server/webpack-runtime.js +1 -1
- package/gui/.next/static/chunks/3800-379a4b854a7eb1dc.js +1 -0
- package/gui/.next/static/chunks/464-7503c96bb839c213.js +1 -0
- package/gui/.next/static/chunks/5567-672d065d2668f1ea.js +1 -0
- package/gui/.next/static/chunks/6240-d3f8028539091853.js +1 -0
- package/gui/.next/static/chunks/7420-cb03f2f94db611c4.js +1 -0
- package/gui/.next/static/chunks/8002-528c2e589bc54111.js +1 -0
- package/gui/.next/static/chunks/9188-540635591aa2baf5.js +1 -0
- package/gui/.next/static/chunks/9289-00509b3e0c520cce.js +1 -0
- package/gui/.next/static/chunks/9576-6d94e3d152f876e7.js +1 -0
- package/gui/.next/static/chunks/app/_not-found/page-89865576110e31f0.js +1 -0
- package/gui/.next/static/chunks/app/api/observability/event/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/observability/preferences/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/operations/bootstrap/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/operations/draft/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/settings/apply-config-patch/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/settings/preview-config-patch/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/apply-connect-services/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/apply-harness-repo-provisioning/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/apply-harness-secrets/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/apply-linear-setup/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/apply-linear-workspace/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/apply-local-files/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/apply-runner-upgrade/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/apply-target-repo-provisioning/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/apply-target-workflow/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/apply-vercel-bridge/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/complete-initial-setup/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/finalize-target-workflow/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/harness-provisioning-progress/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/harness-provisioning-summary/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/linear-options/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/linear-setup-progress/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/linear-summary/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/linear-workspace-editor-state/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/local-readiness/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/manual-harness-secret-values/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/preview-connect-services/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/preview-harness-repo-provisioning/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/preview-harness-secrets/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/preview-linear-setup/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/preview-linear-workspace/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/preview-local-files/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/preview-runner-upgrade/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/preview-target-repo-provisioning/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/preview-target-workflow/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/preview-vercel-bridge/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/remote-summary/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/runner-upgrade-progress/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/runner-upgrade-status/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/summary/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/vercel-bridge-options/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/vercel-bridge-redeploy-status/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/vercel-summary/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/verify-harness-repo/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/verify-service/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/verify-target-repo/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/workflow/bootstrap/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/api/workflow/models/route-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/layout-ec756afb9686f579.js +1 -0
- package/gui/.next/static/chunks/app/operations/page-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/page-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/settings/(console)/connections/page-95847d89fc70089a.js +1 -0
- package/gui/.next/static/chunks/app/settings/(console)/data-sharing/page-3e0d8fe941c7334e.js +1 -0
- package/gui/.next/static/chunks/app/settings/(console)/deployments/page-e3aaff205f09b567.js +1 -0
- package/gui/.next/static/chunks/app/settings/(console)/layout-74ce539ae02dc765.js +1 -0
- package/gui/.next/static/chunks/app/settings/(console)/linear/page-0a1e73b5ec66af90.js +1 -0
- package/gui/.next/static/chunks/app/settings/(console)/models/page-336406c2905983c9.js +1 -0
- package/gui/.next/static/chunks/app/settings/(console)/page-08ffe80f6f4603f6.js +1 -0
- package/gui/.next/static/chunks/app/settings/(console)/repositories/page-b1f7159c7771b16a.js +1 -0
- package/gui/.next/static/chunks/app/settings/configure/loading-5f1e73b910fbd9da.js +1 -0
- package/gui/.next/static/chunks/app/settings/configure/page-54b7572655b9f60f.js +1 -0
- package/gui/.next/static/chunks/app/workflow/page-8087b342a6ece93c.js +1 -0
- package/gui/.next/static/chunks/framework-dc88dc15d5e043e1.js +1 -0
- package/gui/.next/static/chunks/main-5b390d9aaa7199a5.js +1 -0
- package/gui/.next/static/chunks/main-app-7fbf1b54aaed0242.js +1 -0
- package/gui/.next/static/chunks/pages/{_app-2e239ff05bfdf6d6.js → _app-50fa07b56b2d29ac.js} +1 -1
- package/gui/.next/static/chunks/pages/_error-fed8688bdd23f211.js +1 -0
- package/gui/.next/static/chunks/{webpack-1e50074b7e886e1b.js → webpack-b27d2f88ec3d35a4.js} +1 -1
- package/gui/.next/static/css/b7b323a34ac09e0b.css +3 -0
- package/gui/.next/static/wM7YWpWgyTcGc7H5h1u7U/_buildManifest.js +1 -0
- package/gui/.next/trace +6 -4
- package/gui/.next/types/app/api/observability/event/route.ts +347 -0
- package/gui/.next/types/app/api/observability/preferences/route.ts +347 -0
- package/gui/.next/types/app/api/operations/bootstrap/route.ts +347 -0
- package/gui/.next/types/app/api/operations/draft/route.ts +347 -0
- package/gui/.next/types/app/api/settings/apply-config-patch/route.ts +347 -0
- package/gui/.next/types/app/api/settings/preview-config-patch/route.ts +347 -0
- package/gui/.next/types/app/api/setup/apply-linear-workspace/route.ts +347 -0
- package/gui/.next/types/app/api/setup/apply-runner-upgrade/route.ts +347 -0
- package/gui/.next/types/app/api/setup/apply-target-repo-provisioning/route.ts +347 -0
- package/gui/.next/types/app/api/setup/complete-initial-setup/route.ts +347 -0
- package/gui/.next/types/app/api/setup/harness-provisioning-progress/route.ts +347 -0
- package/gui/.next/types/app/api/setup/linear-setup-progress/route.ts +347 -0
- package/gui/.next/types/app/api/setup/linear-workspace-editor-state/route.ts +347 -0
- package/gui/.next/types/app/api/setup/preview-linear-workspace/route.ts +347 -0
- package/gui/.next/types/app/api/setup/preview-runner-upgrade/route.ts +347 -0
- package/gui/.next/types/app/api/setup/preview-target-repo-provisioning/route.ts +347 -0
- package/gui/.next/types/app/api/setup/runner-upgrade-progress/route.ts +347 -0
- package/gui/.next/types/app/api/setup/runner-upgrade-status/route.ts +347 -0
- package/gui/.next/types/app/api/workflow/bootstrap/route.ts +347 -0
- package/gui/.next/types/app/api/workflow/models/route.ts +347 -0
- package/gui/.next/types/app/operations/page.ts +84 -0
- package/gui/.next/types/app/settings/(console)/connections/page.ts +84 -0
- package/gui/.next/types/app/settings/(console)/data-sharing/page.ts +84 -0
- package/gui/.next/types/app/settings/(console)/deployments/page.ts +84 -0
- package/gui/.next/types/app/settings/(console)/layout.ts +84 -0
- package/gui/.next/types/app/settings/(console)/linear/page.ts +84 -0
- package/gui/.next/types/app/settings/(console)/models/page.ts +84 -0
- package/gui/.next/types/app/settings/(console)/page.ts +84 -0
- package/gui/.next/types/app/settings/(console)/repositories/page.ts +84 -0
- package/gui/.next/types/app/workflow/page.ts +84 -0
- package/gui/.next/types/routes.d.ts +33 -3
- package/gui/.next/types/validator.ts +270 -0
- package/observability.public.json +6 -0
- package/package.json +5 -1
- package/templates/.harness/config.example.json +1 -0
- package/workspace-snapshot/files/.agents/skills/implementation/SKILL.md +4 -0
- package/workspace-snapshot/files/.agents/skills/issue-intake/SKILL.md +13 -1
- package/workspace-snapshot/files/.agents/skills/planner/SKILL.md +10 -0
- package/workspace-snapshot/files/.github/workflows/harness-auto-runner.yml +38 -11
- package/workspace-snapshot/files/.github/workflows/p-dev-runner-config-canary.yml +24 -0
- package/workspace-snapshot/files/.harness/config.example.json +1 -0
- package/workspace-snapshot/files/AGENTS.md +13 -2
- package/workspace-snapshot/files/ARCHITECTURE.md +23 -6
- package/workspace-snapshot/files/CHANGELOG.md +50 -5
- package/workspace-snapshot/files/README.md +10 -4
- package/workspace-snapshot/files/ROADMAP.md +10 -1
- package/workspace-snapshot/files/apps/gui/app/api/observability/event/route.ts +36 -0
- package/workspace-snapshot/files/apps/gui/app/api/observability/preferences/route.ts +88 -0
- package/workspace-snapshot/files/apps/gui/app/api/operations/bootstrap/route.ts +8 -0
- package/workspace-snapshot/files/apps/gui/app/api/operations/draft/route.ts +15 -0
- package/workspace-snapshot/files/apps/gui/app/api/settings/apply-config-patch/route.ts +52 -0
- package/workspace-snapshot/files/apps/gui/app/api/settings/preview-config-patch/route.ts +40 -0
- package/workspace-snapshot/files/apps/gui/app/api/setup/apply-harness-repo-provisioning/route.ts +6 -5
- package/workspace-snapshot/files/apps/gui/app/api/setup/apply-linear-workspace/route.ts +23 -0
- package/workspace-snapshot/files/apps/gui/app/api/setup/apply-runner-upgrade/route.ts +33 -0
- package/workspace-snapshot/files/apps/gui/app/api/setup/apply-target-repo-provisioning/route.ts +38 -0
- package/workspace-snapshot/files/apps/gui/app/api/setup/apply-vercel-bridge/route.ts +7 -1
- package/workspace-snapshot/files/apps/gui/app/api/setup/complete-initial-setup/route.ts +49 -0
- package/workspace-snapshot/files/apps/gui/app/api/setup/harness-provisioning-progress/route.ts +21 -0
- package/workspace-snapshot/files/apps/gui/app/api/setup/linear-setup-progress/route.ts +17 -0
- package/workspace-snapshot/files/apps/gui/app/api/setup/linear-workspace-editor-state/route.ts +17 -0
- package/workspace-snapshot/files/apps/gui/app/api/setup/local-readiness/route.ts +52 -13
- package/workspace-snapshot/files/apps/gui/app/api/setup/preview-linear-workspace/route.ts +22 -0
- package/workspace-snapshot/files/apps/gui/app/api/setup/preview-runner-upgrade/route.ts +17 -0
- package/workspace-snapshot/files/apps/gui/app/api/setup/preview-target-repo-provisioning/route.ts +34 -0
- package/workspace-snapshot/files/apps/gui/app/api/setup/runner-upgrade-progress/route.ts +17 -0
- package/workspace-snapshot/files/apps/gui/app/api/setup/runner-upgrade-status/route.ts +72 -0
- package/workspace-snapshot/files/apps/gui/app/api/setup/verify-service/route.ts +2 -2
- package/workspace-snapshot/files/apps/gui/app/api/setup/verify-target-repo/route.ts +9 -2
- package/workspace-snapshot/files/apps/gui/app/api/workflow/bootstrap/route.ts +24 -0
- package/workspace-snapshot/files/apps/gui/app/api/workflow/models/route.ts +86 -0
- package/workspace-snapshot/files/apps/gui/app/operations/page.tsx +23 -0
- package/workspace-snapshot/files/apps/gui/app/page.tsx +8 -2
- package/workspace-snapshot/files/apps/gui/app/settings/(console)/connections/page.tsx +27 -0
- package/workspace-snapshot/files/apps/gui/app/settings/(console)/data-sharing/page.tsx +25 -0
- package/workspace-snapshot/files/apps/gui/app/settings/(console)/deployments/page.tsx +28 -0
- package/workspace-snapshot/files/apps/gui/app/settings/(console)/layout.tsx +45 -0
- package/workspace-snapshot/files/apps/gui/app/settings/(console)/linear/page.tsx +20 -0
- package/workspace-snapshot/files/apps/gui/app/settings/(console)/models/page.tsx +14 -0
- package/workspace-snapshot/files/apps/gui/app/settings/(console)/page.tsx +7 -0
- package/workspace-snapshot/files/apps/gui/app/settings/(console)/repositories/page.tsx +29 -0
- package/workspace-snapshot/files/apps/gui/app/settings/configure/loading.tsx +25 -0
- package/workspace-snapshot/files/apps/gui/app/settings/configure/page.tsx +76 -7
- package/workspace-snapshot/files/apps/gui/app/workflow/page.tsx +24 -0
- package/workspace-snapshot/files/apps/gui/components/custom/app-shell.tsx +26 -32
- package/workspace-snapshot/files/apps/gui/components/custom/application-header.tsx +64 -0
- package/workspace-snapshot/files/apps/gui/components/custom/configure-experience.tsx +347 -85
- package/workspace-snapshot/files/apps/gui/components/custom/configure-page-content.tsx +15 -0
- package/workspace-snapshot/files/apps/gui/components/custom/configure-workflow.tsx +675 -112
- package/workspace-snapshot/files/apps/gui/components/custom/data-sharing-preferences.tsx +159 -0
- package/workspace-snapshot/files/apps/gui/components/custom/environment-config-form.tsx +31 -13
- package/workspace-snapshot/files/apps/gui/components/custom/guided-cloud-secrets-card.tsx +99 -46
- package/workspace-snapshot/files/apps/gui/components/custom/guided-linear-workspace-card.tsx +974 -148
- package/workspace-snapshot/files/apps/gui/components/custom/guided-local-readiness-card.tsx +153 -35
- package/workspace-snapshot/files/apps/gui/components/custom/guided-operation-panel.tsx +102 -0
- package/workspace-snapshot/files/apps/gui/components/custom/guided-progress-check.tsx +37 -0
- package/workspace-snapshot/files/apps/gui/components/custom/guided-setup-progress.tsx +114 -0
- package/workspace-snapshot/files/apps/gui/components/custom/guided-step-success-panel.tsx +50 -0
- package/workspace-snapshot/files/apps/gui/components/custom/guided-step-transition.tsx +81 -27
- package/workspace-snapshot/files/apps/gui/components/custom/guided-target-workflow-card.tsx +267 -60
- package/workspace-snapshot/files/apps/gui/components/custom/guided-vercel-bridge-card.tsx +341 -179
- package/workspace-snapshot/files/apps/gui/components/custom/observability-settings-card.tsx +23 -0
- package/workspace-snapshot/files/apps/gui/components/custom/remote-action-confirmation.tsx +13 -11
- package/workspace-snapshot/files/apps/gui/components/custom/review-workflow-changes-disclosure.tsx +59 -0
- package/workspace-snapshot/files/apps/gui/components/custom/settings-menu.tsx +109 -0
- package/workspace-snapshot/files/apps/gui/components/custom/setup-checklist.tsx +47 -29
- package/workspace-snapshot/files/apps/gui/components/custom/target-repo-config-form.tsx +22 -2
- package/workspace-snapshot/files/apps/gui/components/custom/target-repo-create-connect.tsx +419 -0
- package/workspace-snapshot/files/apps/gui/components/custom/target-workflow-pr-card.tsx +105 -43
- package/workspace-snapshot/files/apps/gui/components/custom/theme-toggle.tsx +3 -11
- package/workspace-snapshot/files/apps/gui/components/custom/vercel-bridge-orchestration-status.tsx +65 -0
- package/workspace-snapshot/files/apps/gui/components/custom/workflow-install-pending-panel.tsx +125 -53
- package/workspace-snapshot/files/apps/gui/components/settings/editors/connections-settings-editor.tsx +261 -0
- package/workspace-snapshot/files/apps/gui/components/settings/editors/deployments-settings-editor.tsx +397 -0
- package/workspace-snapshot/files/apps/gui/components/settings/editors/linear-settings-editor.tsx +512 -0
- package/workspace-snapshot/files/apps/gui/components/settings/editors/repositories-settings-editor.tsx +749 -0
- package/workspace-snapshot/files/apps/gui/components/settings/editors/runner-upgrade-settings-card.tsx +533 -0
- package/workspace-snapshot/files/apps/gui/components/settings/settings-models-client.tsx +102 -0
- package/workspace-snapshot/files/apps/gui/components/settings/settings-mutation-panel.tsx +125 -0
- package/workspace-snapshot/files/apps/gui/components/settings/settings-shell.tsx +46 -0
- package/workspace-snapshot/files/apps/gui/components/ui/dropdown-menu.tsx +257 -0
- package/workspace-snapshot/files/apps/gui/components/ui/guided-select.tsx +22 -0
- package/workspace-snapshot/files/apps/gui/components/workflow/workflow-cards-section.tsx +206 -0
- package/workspace-snapshot/files/apps/gui/components/workflow/workflow-health-panel.tsx +43 -0
- package/workspace-snapshot/files/apps/gui/components/workflow/workflow-model-control.tsx +111 -0
- package/workspace-snapshot/files/apps/gui/components/workflow/workflow-page-client.tsx +161 -0
- package/workspace-snapshot/files/apps/gui/components/workflow/workflow-scope-selector.tsx +41 -0
- package/workspace-snapshot/files/apps/gui/instrumentation.ts +136 -0
- package/workspace-snapshot/files/apps/gui/lib/configure-navigation-timing.ts +53 -0
- package/workspace-snapshot/files/apps/gui/lib/constants/form.ts +5 -0
- package/workspace-snapshot/files/apps/gui/lib/constants/layout.ts +10 -3
- package/workspace-snapshot/files/apps/gui/lib/guided-setup.ts +222 -0
- package/workspace-snapshot/files/apps/gui/lib/linear-association-draft.ts +93 -0
- package/workspace-snapshot/files/apps/gui/lib/local-readiness-visual-queue.ts +61 -0
- package/workspace-snapshot/files/apps/gui/lib/observability-client.ts +21 -0
- package/workspace-snapshot/files/apps/gui/lib/observability-preferences.ts +19 -0
- package/workspace-snapshot/files/apps/gui/lib/observability-request-guard.ts +136 -0
- package/workspace-snapshot/files/apps/gui/lib/observability-route.ts +75 -0
- package/workspace-snapshot/files/apps/gui/lib/settings/load-harness-config-summary.ts +20 -0
- package/workspace-snapshot/files/apps/gui/lib/settings/load-repositories-overview.ts +37 -0
- package/workspace-snapshot/files/apps/gui/lib/settings/load-settings-editor-data.ts +51 -0
- package/workspace-snapshot/files/apps/gui/lib/settings/load-target-repo-overview-fields.ts +124 -0
- package/workspace-snapshot/files/apps/gui/lib/settings/runner-upgrade-feature-flag.ts +9 -0
- package/workspace-snapshot/files/apps/gui/lib/settings/runner-upgrade-ssr.ts +13 -0
- package/workspace-snapshot/files/apps/gui/lib/settings/runner-upgrade-ui-gates.ts +87 -0
- package/workspace-snapshot/files/apps/gui/lib/settings/settings-mutation.ts +49 -0
- package/workspace-snapshot/files/apps/gui/lib/settings/settings-navigation.ts +10 -0
- package/workspace-snapshot/files/apps/gui/lib/settings/settings-setup-client.ts +312 -0
- package/workspace-snapshot/files/apps/gui/lib/setup-server.ts +608 -17
- package/workspace-snapshot/files/apps/gui/lib/use-theme-toggle.ts +26 -0
- package/workspace-snapshot/files/apps/gui/lib/vercel-bridge-polling-ui.ts +88 -1
- package/workspace-snapshot/files/apps/gui/lib/verification-state.ts +97 -1
- package/workspace-snapshot/files/apps/gui/lib/workflow/api-client.ts +84 -0
- package/workspace-snapshot/files/apps/gui/lib/workflow/use-model-autosave.ts +90 -0
- package/workspace-snapshot/files/apps/gui/lib/workflow/use-workflow-model-save.ts +265 -0
- package/workspace-snapshot/files/apps/gui/lib/workflow/workflow-health.ts +53 -0
- package/workspace-snapshot/files/apps/gui/lib/workflow/workflow-ownership.ts +47 -0
- package/workspace-snapshot/files/apps/gui/lib/workflow/workflow-status-content.ts +149 -0
- package/workspace-snapshot/files/apps/gui/lib/workflow/workflow-violation-messages.ts +49 -0
- package/workspace-snapshot/files/apps/gui/lib/workflow-server.ts +307 -0
- package/workspace-snapshot/files/apps/gui/next.config.ts +8 -3
- package/workspace-snapshot/files/docs/architecture/canonical-product-development-workflow.md +70 -0
- package/workspace-snapshot/files/docs/architecture/linear-automation-state-machine.md +26 -10
- package/workspace-snapshot/files/docs/design/product-development-harness-gui.md +0 -1
- package/workspace-snapshot/files/docs/getting-started.md +2 -2
- package/workspace-snapshot/files/docs/gui-local.md +3 -3
- package/workspace-snapshot/files/docs/gui-remote-setup.md +2 -2
- package/workspace-snapshot/files/docs/issue-intake.md +12 -0
- package/workspace-snapshot/files/docs/observability-and-privacy.md +247 -0
- package/workspace-snapshot/files/docs/operator-config.md +16 -1
- package/workspace-snapshot/files/docs/p-dev.md +43 -9
- package/workspace-snapshot/files/docs/releases/release-process.md +135 -7
- package/workspace-snapshot/files/docs/releases/v0.3.1.md +42 -6
- package/workspace-snapshot/files/docs/releases/v0.4.0.md +93 -0
- package/workspace-snapshot/files/docs/security.md +8 -0
- package/workspace-snapshot/files/docs/settings-console.md +44 -0
- package/workspace-snapshot/files/harness.config.schema.json +114 -0
- package/workspace-snapshot/files/package-lock.json +1881 -95
- package/workspace-snapshot/files/package.json +10 -2
- package/workspace-snapshot/files/packages/p-dev/README.md +12 -4
- package/workspace-snapshot/files/packages/p-dev/observability.public.json +6 -0
- package/workspace-snapshot/files/packages/p-dev/package.json +5 -1
- package/workspace-snapshot/files/prompts/issue-intake-chatgpt.md +4 -0
- package/workspace-snapshot/files/scripts/configure-browser-matrix.config.ts +40 -0
- package/workspace-snapshot/files/scripts/configure-browser-matrix.spec.ts +294 -0
- package/workspace-snapshot/files/scripts/configure-step4-harness-readiness.config.ts +118 -0
- package/workspace-snapshot/files/scripts/configure-step4-harness-readiness.spec.ts +80 -0
- package/workspace-snapshot/files/scripts/prepare-configure-browser-workspace.ts +138 -0
- package/workspace-snapshot/files/scripts/prepare-p-dev-package.ts +9 -0
- package/workspace-snapshot/files/scripts/workflow-browser-matrix.config.ts +27 -0
- package/workspace-snapshot/files/scripts/workflow-browser-matrix.spec.ts +151 -0
- package/workspace-snapshot/files/src/agents/cursor-provider.ts +12 -14
- package/workspace-snapshot/files/src/agents/index.ts +8 -12
- package/workspace-snapshot/files/src/agents/types.ts +40 -4
- package/workspace-snapshot/files/src/artifacts/redact.ts +18 -2
- package/workspace-snapshot/files/src/artifacts/write-json-out-manifest.ts +90 -0
- package/workspace-snapshot/files/src/cli/commands/canary-runner-config.ts +6 -0
- package/workspace-snapshot/files/src/cli/commands/doctor.ts +148 -0
- package/workspace-snapshot/files/src/cli/commands/resolve-route.ts +5 -0
- package/workspace-snapshot/files/src/cli/commands/run.ts +65 -17
- package/workspace-snapshot/files/src/cli/commands/sync-managed-runner.ts +126 -0
- package/workspace-snapshot/files/src/cli/program.ts +47 -0
- package/workspace-snapshot/files/src/config/assert-cloud-config-fingerprint.ts +36 -0
- package/workspace-snapshot/files/src/config/cloud-config-fingerprint.ts +90 -0
- package/workspace-snapshot/files/src/config/legacy-linear-top-level.ts +69 -0
- package/workspace-snapshot/files/src/config/linear-association-gate.ts +80 -0
- package/workspace-snapshot/files/src/config/resolve-linear-team.ts +41 -0
- package/workspace-snapshot/files/src/config/resolve-linear-workspace.ts +391 -0
- package/workspace-snapshot/files/src/config/role-models.ts +39 -0
- package/workspace-snapshot/files/src/config/runner-upgrade-sync-gate.ts +26 -0
- package/workspace-snapshot/files/src/config/schema.ts +17 -0
- package/workspace-snapshot/files/src/config/types.ts +5 -1
- package/workspace-snapshot/files/src/config/workspace-root.ts +28 -0
- package/workspace-snapshot/files/src/cursor/agent-factory.ts +51 -5
- package/workspace-snapshot/files/src/cursor/builder-resume-errors.ts +41 -0
- package/workspace-snapshot/files/src/cursor/model.ts +106 -25
- package/workspace-snapshot/files/src/cursor/run-observer.ts +15 -2
- package/workspace-snapshot/files/src/github/auth-verification-retry.ts +63 -0
- package/workspace-snapshot/files/src/github/client.ts +204 -5
- package/workspace-snapshot/files/src/gui/configure-health.ts +2 -2
- package/workspace-snapshot/files/src/gui/repo-root.ts +20 -1
- package/workspace-snapshot/files/src/gui/start-configure-stable.ts +6 -2
- package/workspace-snapshot/files/src/gui/start-gui.ts +8 -3
- package/workspace-snapshot/files/src/linear/client.ts +10 -0
- package/workspace-snapshot/files/src/linear/comments.ts +52 -0
- package/workspace-snapshot/files/src/linear/issue-query.ts +4 -0
- package/workspace-snapshot/files/src/linear/markers.ts +28 -0
- package/workspace-snapshot/files/src/linear/parser.ts +61 -1
- package/workspace-snapshot/files/src/linear/project-harness-metadata.ts +147 -0
- package/workspace-snapshot/files/src/linear/project-metadata-sync.ts +115 -0
- package/workspace-snapshot/files/src/linear/run-status-comment.ts +197 -0
- package/workspace-snapshot/files/src/linear/writer.ts +25 -0
- package/workspace-snapshot/files/src/observability/adapters/fake.ts +267 -0
- package/workspace-snapshot/files/src/observability/adapters/noop.ts +62 -0
- package/workspace-snapshot/files/src/observability/adapters/posthog.ts +165 -0
- package/workspace-snapshot/files/src/observability/adapters/sentry.ts +276 -0
- package/workspace-snapshot/files/src/observability/analytics-schemas.ts +150 -0
- package/workspace-snapshot/files/src/observability/consent.ts +70 -0
- package/workspace-snapshot/files/src/observability/constants.ts +25 -0
- package/workspace-snapshot/files/src/observability/context.ts +152 -0
- package/workspace-snapshot/files/src/observability/facade-runtime-state.ts +47 -0
- package/workspace-snapshot/files/src/observability/facade.ts +628 -0
- package/workspace-snapshot/files/src/observability/fatal-handlers.ts +60 -0
- package/workspace-snapshot/files/src/observability/identity.ts +13 -0
- package/workspace-snapshot/files/src/observability/index.ts +47 -0
- package/workspace-snapshot/files/src/observability/local-state.ts +142 -0
- package/workspace-snapshot/files/src/observability/package-config.ts +180 -0
- package/workspace-snapshot/files/src/observability/posthog-dashboard-contract.ts +277 -0
- package/workspace-snapshot/files/src/observability/privacy-schema.ts +229 -0
- package/workspace-snapshot/files/src/observability/product-error-messages.ts +19 -0
- package/workspace-snapshot/files/src/observability/product-errors.ts +139 -0
- package/workspace-snapshot/files/src/observability/provisioning-analytics.ts +28 -0
- package/workspace-snapshot/files/src/observability/redaction.ts +85 -0
- package/workspace-snapshot/files/src/observability/runtime-eligibility.ts +50 -0
- package/workspace-snapshot/files/src/observability/sentry-outbound-privacy.ts +216 -0
- package/workspace-snapshot/files/src/observability/session-dedupe.ts +73 -0
- package/workspace-snapshot/files/src/observability/session-handoff.ts +47 -0
- package/workspace-snapshot/files/src/observability/transport-lifecycle.ts +93 -0
- package/workspace-snapshot/files/src/observability/types.ts +265 -0
- package/workspace-snapshot/files/src/p-dev/cli.ts +1 -1
- package/workspace-snapshot/files/src/p-dev/git-object-plumbing.ts +139 -14
- package/workspace-snapshot/files/src/p-dev/launch.ts +93 -14
- package/workspace-snapshot/files/src/p-dev/main.ts +12 -1
- package/workspace-snapshot/files/src/p-dev/package-paths.ts +72 -2
- package/workspace-snapshot/files/src/p-dev/workspace-snapshot-generator.ts +21 -0
- package/workspace-snapshot/files/src/p-dev/workspace-snapshot-manifest.ts +53 -0
- package/workspace-snapshot/files/src/p-dev/workspace-snapshot-types.ts +8 -0
- package/workspace-snapshot/files/src/preview/preview-capability.ts +21 -0
- package/workspace-snapshot/files/src/product/initialization-state.ts +65 -0
- package/workspace-snapshot/files/src/product/product-marker.ts +76 -0
- package/workspace-snapshot/files/src/product/read-product-marker.ts +63 -0
- package/workspace-snapshot/files/src/prompts/builder.ts +31 -1
- package/workspace-snapshot/files/src/prompts/implementation.md +6 -0
- package/workspace-snapshot/files/src/prompts/integration-repair.md +6 -0
- package/workspace-snapshot/files/src/prompts/planning.md +8 -0
- package/workspace-snapshot/files/src/prompts/revision.md +7 -0
- package/workspace-snapshot/files/src/resolver/errors.ts +3 -1
- package/workspace-snapshot/files/src/resolver/target-repo.ts +60 -1
- package/workspace-snapshot/files/src/runner/builder-thread-acquire.ts +321 -0
- package/workspace-snapshot/files/src/runner/builder-thread-evidence.ts +40 -0
- package/workspace-snapshot/files/src/runner/builder-thread-idempotency.ts +27 -0
- package/workspace-snapshot/files/src/runner/builder-thread-lineage-errors.ts +23 -0
- package/workspace-snapshot/files/src/runner/builder-thread-lineage.ts +555 -0
- package/workspace-snapshot/files/src/runner/builder-thread-types.ts +41 -0
- package/workspace-snapshot/files/src/runner/delivery-dedup.ts +78 -0
- package/workspace-snapshot/files/src/runner/failure-finalization.ts +234 -0
- package/workspace-snapshot/files/src/runner/fixture.ts +6 -1
- package/workspace-snapshot/files/src/runner/phases/handoff.ts +74 -46
- package/workspace-snapshot/files/src/runner/phases/implementation.ts +174 -28
- package/workspace-snapshot/files/src/runner/phases/integration-repair.ts +123 -7
- package/workspace-snapshot/files/src/runner/phases/merge.ts +145 -67
- package/workspace-snapshot/files/src/runner/phases/planning.ts +50 -7
- package/workspace-snapshot/files/src/runner/phases/production-sync.ts +37 -4
- package/workspace-snapshot/files/src/runner/phases/revision.ts +130 -44
- package/workspace-snapshot/files/src/runner/preflight.ts +134 -7
- package/workspace-snapshot/files/src/runner/resolve-route.ts +29 -0
- package/workspace-snapshot/files/src/runner/run-generation.ts +21 -0
- package/workspace-snapshot/files/src/runner/uninitialized-product-routing.ts +121 -0
- package/workspace-snapshot/files/src/setup/config-builder.ts +14 -0
- package/workspace-snapshot/files/src/setup/control-plane-readiness.ts +92 -18
- package/workspace-snapshot/files/src/setup/control-plane-setup-state.ts +61 -5
- package/workspace-snapshot/files/src/setup/control-plane-state-lock.ts +103 -0
- package/workspace-snapshot/files/src/setup/control-plane-types.ts +100 -1
- package/workspace-snapshot/files/src/setup/first-run-readiness.ts +9 -2
- package/workspace-snapshot/files/src/setup/git-askpass-credentials.ts +80 -0
- package/workspace-snapshot/files/src/setup/github-dispatch-token.ts +34 -3
- package/workspace-snapshot/files/src/setup/github-remote-provider.ts +78 -2
- package/workspace-snapshot/files/src/setup/github-remote-setup-live.ts +113 -11
- package/workspace-snapshot/files/src/setup/github-repository-name.ts +63 -0
- package/workspace-snapshot/files/src/setup/github-target-repository-provider-live.ts +323 -0
- package/workspace-snapshot/files/src/setup/github-target-repository-provider-mock.ts +284 -0
- package/workspace-snapshot/files/src/setup/github-target-repository-provider.ts +86 -0
- package/workspace-snapshot/files/src/setup/github-workflow-permissions.ts +2 -1
- package/workspace-snapshot/files/src/setup/gui-view-model.ts +10 -0
- package/workspace-snapshot/files/src/setup/harness-dispatch-repo.ts +157 -25
- package/workspace-snapshot/files/src/setup/harness-managed-repo-marker.ts +24 -0
- package/workspace-snapshot/files/src/setup/harness-provisioning-last-run.ts +152 -0
- package/workspace-snapshot/files/src/setup/harness-provisioning-pending-state.ts +3 -0
- package/workspace-snapshot/files/src/setup/harness-provisioning-progress.ts +213 -0
- package/workspace-snapshot/files/src/setup/harness-repo-provisioning.ts +135 -6
- package/workspace-snapshot/files/src/setup/harness-snapshot-git-transport.ts +846 -0
- package/workspace-snapshot/files/src/setup/harness-snapshot-provisioning-helpers.ts +4 -1
- package/workspace-snapshot/files/src/setup/harness-snapshot-provisioning.ts +352 -81
- package/workspace-snapshot/files/src/setup/harness-step-readiness-server.ts +39 -0
- package/workspace-snapshot/files/src/setup/harness-step-readiness.ts +72 -0
- package/workspace-snapshot/files/src/setup/harness-workspace-snapshot-loader.ts +59 -12
- package/workspace-snapshot/files/src/setup/initial-setup-lifecycle.ts +181 -0
- package/workspace-snapshot/files/src/setup/linear-category-labels.ts +18 -0
- package/workspace-snapshot/files/src/setup/linear-setup-apply.ts +97 -17
- package/workspace-snapshot/files/src/setup/linear-setup-client.ts +96 -0
- package/workspace-snapshot/files/src/setup/linear-setup-plan.ts +105 -11
- package/workspace-snapshot/files/src/setup/linear-setup-progress.ts +113 -0
- package/workspace-snapshot/files/src/setup/linear-status-contract.ts +36 -77
- package/workspace-snapshot/files/src/setup/linear-workflow-status-repair.ts +278 -0
- package/workspace-snapshot/files/src/setup/linear-workspace-apply.ts +309 -0
- package/workspace-snapshot/files/src/setup/linear-workspace-drift.ts +4 -0
- package/workspace-snapshot/files/src/setup/linear-workspace-migration.ts +314 -0
- package/workspace-snapshot/files/src/setup/linear-workspace-plan.ts +407 -0
- package/workspace-snapshot/files/src/setup/local-readiness-checks.ts +163 -31
- package/workspace-snapshot/files/src/setup/mock-target-workflow-finalization.ts +30 -4
- package/workspace-snapshot/files/src/setup/packaged-default-route.ts +29 -0
- package/workspace-snapshot/files/src/setup/release-sync-managed-runner.ts +604 -0
- package/workspace-snapshot/files/src/setup/remote-apply-actions.ts +33 -0
- package/workspace-snapshot/files/src/setup/runner-upgrade-canary-dispatch.ts +69 -0
- package/workspace-snapshot/files/src/setup/runner-upgrade-canary.ts +213 -0
- package/workspace-snapshot/files/src/setup/runner-upgrade-evidence.ts +30 -0
- package/workspace-snapshot/files/src/setup/runner-upgrade-pending-state.ts +116 -0
- package/workspace-snapshot/files/src/setup/runner-upgrade-progress.ts +150 -0
- package/workspace-snapshot/files/src/setup/runner-upgrade-provider-live.ts +520 -0
- package/workspace-snapshot/files/src/setup/runner-upgrade-provider.ts +852 -0
- package/workspace-snapshot/files/src/setup/runner-upgrade-status-cache.ts +61 -0
- package/workspace-snapshot/files/src/setup/runner-upgrade-three-way.ts +162 -0
- package/workspace-snapshot/files/src/setup/runner-upgrade-timeouts.ts +386 -0
- package/workspace-snapshot/files/src/setup/runner-upgrade-types.ts +176 -0
- package/workspace-snapshot/files/src/setup/runner-upgrade-worker.ts +149 -0
- package/workspace-snapshot/files/src/setup/runner-upgrade.ts +1926 -0
- package/workspace-snapshot/files/src/setup/service-verification.ts +160 -20
- package/workspace-snapshot/files/src/setup/settings-config-patch.ts +461 -0
- package/workspace-snapshot/files/src/setup/setup-state.ts +12 -1
- package/workspace-snapshot/files/src/setup/step6-automatic-control-state.ts +59 -0
- package/workspace-snapshot/files/src/setup/sync-harness-config-cloud.ts +128 -0
- package/workspace-snapshot/files/src/setup/target-repo-provisioning-pending-state.ts +160 -0
- package/workspace-snapshot/files/src/setup/target-repo-provisioning.ts +704 -0
- package/workspace-snapshot/files/src/setup/target-workflow-finalization-progress.ts +166 -0
- package/workspace-snapshot/files/src/setup/target-workflow-finalization-types.ts +128 -1
- package/workspace-snapshot/files/src/setup/target-workflow-finalization.ts +806 -15
- package/workspace-snapshot/files/src/setup/target-workflow-setup.ts +2 -0
- package/workspace-snapshot/files/src/setup/test-only-runner-upgrade-provider.ts +51 -0
- package/workspace-snapshot/files/src/setup/test-only-target-repo-provisioning-provider.ts +47 -0
- package/workspace-snapshot/files/src/setup/vercel-bridge-artifact.ts +174 -0
- package/workspace-snapshot/files/src/setup/vercel-bridge-deploy.ts +217 -0
- package/workspace-snapshot/files/src/setup/vercel-bridge-diagnostics.ts +1 -1
- package/workspace-snapshot/files/src/setup/vercel-bridge-options.ts +4 -0
- package/workspace-snapshot/files/src/setup/vercel-bridge-orchestration-summary.ts +46 -0
- package/workspace-snapshot/files/src/setup/vercel-bridge-project-marker.ts +8 -0
- package/workspace-snapshot/files/src/setup/vercel-bridge-readiness.ts +2 -1
- package/workspace-snapshot/files/src/setup/vercel-bridge-redeploy-normalize.ts +244 -0
- package/workspace-snapshot/files/src/setup/vercel-bridge-redeploy-poll.ts +406 -190
- package/workspace-snapshot/files/src/setup/vercel-bridge-redeploy-state.ts +3 -0
- package/workspace-snapshot/files/src/setup/vercel-bridge-structured-log.ts +5 -0
- package/workspace-snapshot/files/src/setup/vercel-project-name.ts +38 -0
- package/workspace-snapshot/files/src/setup/vercel-setup-apply.ts +386 -40
- package/workspace-snapshot/files/src/setup/vercel-setup-client.ts +97 -3
- package/workspace-snapshot/files/src/setup/vercel-setup-plan.ts +84 -14
- package/workspace-snapshot/files/src/setup/vercel-setup-summary.ts +10 -0
- package/workspace-snapshot/files/src/setup/workflow-config-snapshot.ts +22 -0
- package/workspace-snapshot/files/src/setup/workflow-install-branch-recovery.ts +660 -0
- package/workspace-snapshot/files/src/setup/workflow-install-merge-errors.ts +70 -20
- package/workspace-snapshot/files/src/setup/workflow-install-merge-gate.ts +25 -0
- package/workspace-snapshot/files/src/setup/workflow-model-save-queue.ts +251 -0
- package/workspace-snapshot/files/src/setup/workflow-model-sync-lock.ts +103 -0
- package/workspace-snapshot/files/src/setup/workflow-model-sync.ts +259 -0
- package/workspace-snapshot/files/src/setup/workflow-models-sync-evidence.ts +34 -0
- package/workspace-snapshot/files/src/types/parsed-issue.ts +9 -0
- package/workspace-snapshot/files/src/types/run.ts +44 -1
- package/workspace-snapshot/files/src/validate/issue.ts +52 -6
- package/workspace-snapshot/files/src/validate/types.ts +3 -0
- package/workspace-snapshot/files/src/webhook/dispatch-statuses.ts +8 -16
- package/workspace-snapshot/files/src/webhook/filter.ts +24 -1
- package/workspace-snapshot/files/src/webhook/handle-linear-webhook.ts +15 -1
- package/workspace-snapshot/files/src/webhook/parse-linear-issue-event.ts +4 -0
- package/workspace-snapshot/files/src/webhook/types.ts +4 -1
- package/workspace-snapshot/files/src/workflow/canonical-product-development-workflow.ts +584 -0
- package/workspace-snapshot/files/src/workflow/canonical-workflow-gate.ts +255 -0
- package/workspace-snapshot/files/src/workflow/canonical-workflow-validation.ts +297 -0
- package/workspace-snapshot/files/src/workflow/finalize-harness-run.ts +83 -0
- package/workspace-snapshot/files/src/workflow/preflight-canonical.ts +40 -0
- package/workspace-snapshot/files/src/workflow/write-fallback-manifest.ts +39 -0
- package/workspace-snapshot/files/src/workflow-page/bootstrap.ts +277 -0
- package/workspace-snapshot/files/src/workflow-page/catalog-validation.ts +158 -0
- package/workspace-snapshot/files/src/workflow-page/constants.ts +22 -0
- package/workspace-snapshot/files/src/workflow-page/current-workflow.ts +225 -0
- package/workspace-snapshot/files/src/workflow-page/fingerprint.ts +9 -0
- package/workspace-snapshot/files/src/workflow-page/fixture-definition.ts +16 -0
- package/workspace-snapshot/files/src/workflow-page/fixture-role-models.ts +50 -0
- package/workspace-snapshot/files/src/workflow-page/fixtures/basic-current-workflow.ts +39 -0
- package/workspace-snapshot/files/src/workflow-page/fixtures/branching-pr-review.ts +11 -0
- package/workspace-snapshot/files/src/workflow-page/fixtures/canonical-violations.ts +50 -0
- package/workspace-snapshot/files/src/workflow-page/fixtures/credential-errors.ts +13 -0
- package/workspace-snapshot/files/src/workflow-page/fixtures/empty-linear-statuses.ts +10 -0
- package/workspace-snapshot/files/src/workflow-page/fixtures/hundred-node-performance.ts +23 -0
- package/workspace-snapshot/files/src/workflow-page/fixtures/index.ts +37 -0
- package/workspace-snapshot/files/src/workflow-page/fixtures/model-catalog-snapshot.ts +34 -0
- package/workspace-snapshot/files/src/workflow-page/fixtures/workflow-scopes.ts +18 -0
- package/workspace-snapshot/files/src/workflow-page/linear-status-source.ts +65 -0
- package/workspace-snapshot/files/src/workflow-page/model-catalog-lookup.ts +8 -0
- package/workspace-snapshot/files/src/workflow-page/model-catalog-utils.ts +83 -0
- package/workspace-snapshot/files/src/workflow-page/model-catalog.ts +60 -0
- package/workspace-snapshot/files/src/workflow-page/scope-branches.ts +27 -0
- package/workspace-snapshot/files/src/workflow-page/source-context.ts +91 -0
- package/workspace-snapshot/files/src/workflow-page/types.ts +134 -0
- package/workspace-snapshot/files/src/workflow-page/workflow-scopes.ts +73 -0
- package/workspace-snapshot/files/tests/agents/cursor-provider.test.ts +41 -29
- package/workspace-snapshot/files/tests/artifacts/redact.test.ts +11 -0
- package/workspace-snapshot/files/tests/cli/json-out-manifest.test.ts +96 -0
- package/workspace-snapshot/files/tests/config/cloud-config-fingerprint.test.ts +62 -0
- package/workspace-snapshot/files/tests/config/legacy-linear-top-level.test.ts +86 -0
- package/workspace-snapshot/files/tests/config/onboarding-cloud-runner-contract.test.ts +139 -0
- package/workspace-snapshot/files/tests/config/resolve-linear-workspace.test.ts +314 -0
- package/workspace-snapshot/files/tests/config/role-models.test.ts +35 -0
- package/workspace-snapshot/files/tests/cursor/agent-factory.test.ts +124 -0
- package/workspace-snapshot/files/tests/cursor/role-models.test.ts +52 -0
- package/workspace-snapshot/files/tests/cursor/run-observer.test.ts +36 -0
- package/workspace-snapshot/files/tests/fixtures/workflows/harness-auto-runner-with-production-sync.yml +36 -11
- package/workspace-snapshot/files/tests/github/auth-verification-retry.test.ts +141 -0
- package/workspace-snapshot/files/tests/gui/app-shell-settings-menu.test.ts +115 -0
- package/workspace-snapshot/files/tests/gui/configure-fix-loop.test.ts +50 -37
- package/workspace-snapshot/files/tests/gui/configure-navigation-contract.test.ts +107 -0
- package/workspace-snapshot/files/tests/gui/configure-target-repo-create.test.ts +103 -0
- package/workspace-snapshot/files/tests/gui/configure-workflow-readiness.test.ts +117 -0
- package/workspace-snapshot/files/tests/gui/data-sharing-preferences.test.ts +43 -0
- package/workspace-snapshot/files/tests/gui/design-system.test.ts +65 -5
- package/workspace-snapshot/files/tests/gui/guided-linear-workspace-card.test.ts +168 -0
- package/workspace-snapshot/files/tests/gui/guided-operation-ux.test.ts +100 -0
- package/workspace-snapshot/files/tests/gui/guided-setup-progress.test.ts +267 -0
- package/workspace-snapshot/files/tests/gui/guided-setup.test.ts +60 -0
- package/workspace-snapshot/files/tests/gui/guided-target-workflow-polling.test.ts +38 -0
- package/workspace-snapshot/files/tests/gui/linear-association-draft.test.ts +93 -0
- package/workspace-snapshot/files/tests/gui/local-readiness-stream.test.ts +154 -0
- package/workspace-snapshot/files/tests/gui/local-readiness-visual-queue.test.ts +69 -0
- package/workspace-snapshot/files/tests/gui/local-readiness-workspace.test.ts +299 -0
- package/workspace-snapshot/files/tests/gui/m6-configure-boundaries.test.ts +177 -35
- package/workspace-snapshot/files/tests/gui/observability-preferences-route.test.ts +343 -0
- package/workspace-snapshot/files/tests/gui/observability-request-guard.test.ts +177 -0
- package/workspace-snapshot/files/tests/gui/packaged-harness-cloud-secrets-routes.test.ts +16 -0
- package/workspace-snapshot/files/tests/gui/packaged-runner-upgrade-routes.test.ts +532 -0
- package/workspace-snapshot/files/tests/gui/packaged-target-repo-provisioning-routes.test.ts +108 -0
- package/workspace-snapshot/files/tests/gui/repo-root.test.ts +55 -0
- package/workspace-snapshot/files/tests/gui/runner-upgrade-settings-card.test.ts +97 -0
- package/workspace-snapshot/files/tests/gui/settings-cursor.test.ts +39 -0
- package/workspace-snapshot/files/tests/gui/settings-deployments-autoload.test.ts +57 -0
- package/workspace-snapshot/files/tests/gui/settings-mutation-editors.test.ts +154 -0
- package/workspace-snapshot/files/tests/gui/settings-navigation.test.ts +95 -0
- package/workspace-snapshot/files/tests/gui/settings-repositories-page.test.ts +54 -0
- package/workspace-snapshot/files/tests/gui/step7-settings-polish.test.ts +180 -0
- package/workspace-snapshot/files/tests/gui/target-workflow-pr-card.test.ts +68 -0
- package/workspace-snapshot/files/tests/gui/vercel-bridge-polling-ui.test.ts +50 -1
- package/workspace-snapshot/files/tests/gui/verification-state.test.ts +45 -0
- package/workspace-snapshot/files/tests/gui/workflow-bootstrap-route.test.ts +78 -0
- package/workspace-snapshot/files/tests/gui/workflow-model-autosave.test.ts +36 -0
- package/workspace-snapshot/files/tests/gui/workflow-source-ui.test.ts +22 -0
- package/workspace-snapshot/files/tests/gui/workflow-violation-messages.test.ts +39 -0
- package/workspace-snapshot/files/tests/gui/workflow-workspace.test.ts +188 -0
- package/workspace-snapshot/files/tests/linear/markers.test.ts +29 -0
- package/workspace-snapshot/files/tests/linear/run-status-comment.test.ts +143 -0
- package/workspace-snapshot/files/tests/observability/analytics-schemas.test.ts +74 -0
- package/workspace-snapshot/files/tests/observability/context.test.ts +132 -0
- package/workspace-snapshot/files/tests/observability/fatal-process.test.ts +106 -0
- package/workspace-snapshot/files/tests/observability/foundation.test.ts +229 -0
- package/workspace-snapshot/files/tests/observability/instrumentation-dev-startup.test.ts +79 -0
- package/workspace-snapshot/files/tests/observability/lifecycle.test.ts +348 -0
- package/workspace-snapshot/files/tests/observability/package-config.test.ts +66 -0
- package/workspace-snapshot/files/tests/observability/packaged-config.test.ts +47 -0
- package/workspace-snapshot/files/tests/observability/posthog-dashboard-contract.test.ts +133 -0
- package/workspace-snapshot/files/tests/observability/posthog-envelope.test.ts +167 -0
- package/workspace-snapshot/files/tests/observability/posthog-shutdown.test.ts +68 -0
- package/workspace-snapshot/files/tests/observability/privacy-schema.test.ts +83 -0
- package/workspace-snapshot/files/tests/observability/provisioning-analytics.test.ts +54 -0
- package/workspace-snapshot/files/tests/observability/public-config-enablement.test.ts +48 -0
- package/workspace-snapshot/files/tests/observability/sentry-envelope.test.ts +289 -0
- package/workspace-snapshot/files/tests/observability/sentry-outbound-privacy.test.ts +141 -0
- package/workspace-snapshot/files/tests/observability/sentry-privacy-assertions.ts +52 -0
- package/workspace-snapshot/files/tests/observability/sentry-server-only.test.ts +68 -0
- package/workspace-snapshot/files/tests/observability/sentry-transport.test.ts +88 -0
- package/workspace-snapshot/files/tests/observability/session-dedupe.test.ts +117 -0
- package/workspace-snapshot/files/tests/observability/snapshot-exclusion.test.ts +9 -0
- package/workspace-snapshot/files/tests/p-dev/cli.test.ts +2 -2
- package/workspace-snapshot/files/tests/p-dev/git-object-plumbing.test.ts +49 -0
- package/workspace-snapshot/files/tests/p-dev/installed-tarball-gui.test.ts +475 -0
- package/workspace-snapshot/files/tests/p-dev/installed-tarball-loopback.test.ts +986 -0
- package/workspace-snapshot/files/tests/p-dev/installed-tarball-snapshot-provisioning.test.ts +361 -0
- package/workspace-snapshot/files/tests/p-dev/launch.test.ts +55 -3
- package/workspace-snapshot/files/tests/p-dev/package-manifest.test.ts +3 -1
- package/workspace-snapshot/files/tests/p-dev/package-packed-artifact.test.ts +115 -10
- package/workspace-snapshot/files/tests/p-dev/package-paths.test.ts +51 -0
- package/workspace-snapshot/files/tests/p-dev/package-version.test.ts +1 -1
- package/workspace-snapshot/files/tests/p-dev/packaged-workspace-setup.test.ts +1 -1
- package/workspace-snapshot/files/tests/p-dev/workspace-snapshot-policy.test.ts +6 -0
- package/workspace-snapshot/files/tests/product/initialization-state.test.ts +78 -0
- package/workspace-snapshot/files/tests/product/read-product-marker.test.ts +46 -0
- package/workspace-snapshot/files/tests/prompts/builder.test.ts +1 -0
- package/workspace-snapshot/files/tests/prompts/implementation-builder.test.ts +1 -0
- package/workspace-snapshot/files/tests/prompts/issue-intake-chatgpt.test.ts +1 -0
- package/workspace-snapshot/files/tests/resolver/target-repo.test.ts +66 -0
- package/workspace-snapshot/files/tests/runner/builder-thread-acquire.test.ts +288 -0
- package/workspace-snapshot/files/tests/runner/builder-thread-idempotency.test.ts +42 -0
- package/workspace-snapshot/files/tests/runner/builder-thread-lineage.test.ts +206 -0
- package/workspace-snapshot/files/tests/runner/delivery-dedup.test.ts +53 -0
- package/workspace-snapshot/files/tests/runner/failure-finalization-runner-upgrade.test.ts +112 -0
- package/workspace-snapshot/files/tests/runner/failure-finalization.test.ts +203 -0
- package/workspace-snapshot/files/tests/runner/handoff.test.ts +66 -0
- package/workspace-snapshot/files/tests/runner/idempotency-handoff.test.ts +1 -0
- package/workspace-snapshot/files/tests/runner/idempotency-implementation.test.ts +1 -0
- package/workspace-snapshot/files/tests/runner/idempotency-revision.test.ts +1 -0
- package/workspace-snapshot/files/tests/runner/idempotency.test.ts +1 -0
- package/workspace-snapshot/files/tests/runner/implementation.test.ts +24 -5
- package/workspace-snapshot/files/tests/runner/integration-repair.test.ts +21 -6
- package/workspace-snapshot/files/tests/runner/merge-linear-metadata.test.ts +90 -0
- package/workspace-snapshot/files/tests/runner/merge.test.ts +79 -0
- package/workspace-snapshot/files/tests/runner/planning.test.ts +9 -0
- package/workspace-snapshot/files/tests/runner/preflight-canonical.test.ts +73 -0
- package/workspace-snapshot/files/tests/runner/preflight-fail-closed.integration.test.ts +418 -0
- package/workspace-snapshot/files/tests/runner/preview-capability.test.ts +46 -0
- package/workspace-snapshot/files/tests/runner/resolve-route.test.ts +6 -0
- package/workspace-snapshot/files/tests/runner/revision.test.ts +117 -9
- package/workspace-snapshot/files/tests/runner/uninitialized-product-routing.test.ts +120 -0
- package/workspace-snapshot/files/tests/setup/control-plane-readiness.test.ts +86 -0
- package/workspace-snapshot/files/tests/setup/control-plane-state-lock.test.ts +67 -0
- package/workspace-snapshot/files/tests/setup/first-run-readiness.test.ts +134 -2
- package/workspace-snapshot/files/tests/setup/github-dispatch-token.test.ts +49 -1
- package/workspace-snapshot/files/tests/setup/github-repository-name.test.ts +28 -0
- package/workspace-snapshot/files/tests/setup/gui-remote-storage.test.ts +0 -2
- package/workspace-snapshot/files/tests/setup/harness-dispatch-repo.test.ts +292 -3
- package/workspace-snapshot/files/tests/setup/harness-snapshot-bulk-fixture.ts +72 -0
- package/workspace-snapshot/files/tests/setup/harness-snapshot-bulk-installed.test.ts +93 -0
- package/workspace-snapshot/files/tests/setup/harness-snapshot-git-transport.test.ts +518 -0
- package/workspace-snapshot/files/tests/setup/harness-step-readiness.test.ts +145 -0
- package/workspace-snapshot/files/tests/setup/harness-workspace-snapshot-loader.test.ts +142 -0
- package/workspace-snapshot/files/tests/setup/initial-setup-lifecycle.test.ts +220 -0
- package/workspace-snapshot/files/tests/setup/linear-setup-apply.test.ts +7 -4
- package/workspace-snapshot/files/tests/setup/linear-setup-plan.test.ts +46 -3
- package/workspace-snapshot/files/tests/setup/linear-workflow-status-repair.test.ts +314 -0
- package/workspace-snapshot/files/tests/setup/linear-workspace-migration.test.ts +173 -0
- package/workspace-snapshot/files/tests/setup/linear-workspace-plan.test.ts +247 -0
- package/workspace-snapshot/files/tests/setup/local-apply-actions.test.ts +13 -0
- package/workspace-snapshot/files/tests/setup/local-readiness-checks.test.ts +25 -1
- package/workspace-snapshot/files/tests/setup/mock-canonical-preflight.ts +14 -0
- package/workspace-snapshot/files/tests/setup/packaged-default-route.test.ts +85 -0
- package/workspace-snapshot/files/tests/setup/release-sync-managed-runner.test.ts +385 -0
- package/workspace-snapshot/files/tests/setup/runner-upgrade-canary.test.ts +201 -0
- package/workspace-snapshot/files/tests/setup/runner-upgrade-three-way.test.ts +226 -0
- package/workspace-snapshot/files/tests/setup/runner-upgrade.test.ts +702 -0
- package/workspace-snapshot/files/tests/setup/service-verification.test.ts +197 -18
- package/workspace-snapshot/files/tests/setup/settings-config-patch.test.ts +280 -0
- package/workspace-snapshot/files/tests/setup/setup-state.test.ts +47 -0
- package/workspace-snapshot/files/tests/setup/step6-automatic-apply-outcome.test.ts +1 -0
- package/workspace-snapshot/files/tests/setup/step6-automatic-control-state.test.ts +73 -0
- package/workspace-snapshot/files/tests/setup/target-repo-provisioning.test.ts +307 -0
- package/workspace-snapshot/files/tests/setup/target-workflow-finalization-progress.test.ts +71 -0
- package/workspace-snapshot/files/tests/setup/target-workflow-finalization-step-github.test.ts +240 -0
- package/workspace-snapshot/files/tests/setup/vercel-bridge-redeploy-normalize.test.ts +106 -0
- package/workspace-snapshot/files/tests/setup/vercel-bridge-redeploy-poll.test.ts +78 -4
- package/workspace-snapshot/files/tests/setup/vercel-setup-apply.test.ts +278 -3
- package/workspace-snapshot/files/tests/setup/vercel-setup-client.test.ts +76 -0
- package/workspace-snapshot/files/tests/setup/vercel-setup-plan.test.ts +58 -0
- package/workspace-snapshot/files/tests/setup/workflow-install-branch-recovery-commit.test.ts +144 -0
- package/workspace-snapshot/files/tests/setup/workflow-install-branch-recovery.test.ts +133 -0
- package/workspace-snapshot/files/tests/setup/workflow-install-merge-errors.test.ts +66 -1
- package/workspace-snapshot/files/tests/setup/workflow-install-merge-gate.test.ts +58 -0
- package/workspace-snapshot/files/tests/setup/workflow-model-save-queue.test.ts +139 -0
- package/workspace-snapshot/files/tests/setup/workflow-model-sync.test.ts +141 -0
- package/workspace-snapshot/files/tests/validate-issue/uninitialized-product.test.ts +108 -0
- package/workspace-snapshot/files/tests/webhook/filter.test.ts +55 -0
- package/workspace-snapshot/files/tests/webhook/harness-auto-runner-workflow.test.ts +7 -0
- package/workspace-snapshot/files/tests/workflow/canonical-product-development-workflow.test.ts +193 -0
- package/workspace-snapshot/files/tests/workflow/canonical-workflow-validation.test.ts +202 -0
- package/workspace-snapshot/files/tests/workflow/workflow-shell-safety.test.ts +5 -2
- package/workspace-snapshot/files/vitest.config.ts +5 -0
- package/workspace-snapshot/manifest.json +3604 -836
- package/workspace-snapshot/object-pack/snapshot-2735d42c938e514f27a9b2aaf5fa2fcc68019075.idx +0 -0
- package/workspace-snapshot/object-pack/snapshot-2735d42c938e514f27a9b2aaf5fa2fcc68019075.pack +0 -0
- package/gui/.next/server/app/index.html +0 -1
- package/gui/.next/server/app/index.meta +0 -9
- package/gui/.next/server/app/index.rsc +0 -18
- package/gui/.next/server/chunks/200.js +0 -1
- package/gui/.next/server/chunks/477.js +0 -16
- package/gui/.next/server/chunks/585.js +0 -1
- package/gui/.next/server/chunks/647.js +0 -82
- package/gui/.next/server/chunks/711.js +0 -1
- package/gui/.next/server/chunks/900.js +0 -1
- package/gui/.next/server/chunks/901.js +0 -22
- package/gui/.next/static/ZGJuemeaiW4yT7CTlmjdG/_buildManifest.js +0 -1
- package/gui/.next/static/chunks/661-5fc9351358e2f084.js +0 -1
- package/gui/.next/static/chunks/app/_not-found/page-f15332c94524c284.js +0 -1
- package/gui/.next/static/chunks/app/api/setup/apply-connect-services/route-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/api/setup/apply-harness-repo-provisioning/route-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/api/setup/apply-harness-secrets/route-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/api/setup/apply-linear-setup/route-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/api/setup/apply-local-files/route-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/api/setup/apply-target-workflow/route-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/api/setup/apply-vercel-bridge/route-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/api/setup/finalize-target-workflow/route-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/api/setup/harness-provisioning-summary/route-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/api/setup/linear-options/route-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/api/setup/linear-summary/route-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/api/setup/local-readiness/route-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/api/setup/manual-harness-secret-values/route-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/api/setup/preview-connect-services/route-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/api/setup/preview-harness-repo-provisioning/route-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/api/setup/preview-harness-secrets/route-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/api/setup/preview-linear-setup/route-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/api/setup/preview-local-files/route-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/api/setup/preview-target-workflow/route-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/api/setup/preview-vercel-bridge/route-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/api/setup/remote-summary/route-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/api/setup/summary/route-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/api/setup/vercel-bridge-options/route-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/api/setup/vercel-bridge-redeploy-status/route-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/api/setup/vercel-summary/route-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/api/setup/verify-harness-repo/route-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/api/setup/verify-service/route-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/api/setup/verify-target-repo/route-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/layout-10445a363bff6a38.js +0 -1
- package/gui/.next/static/chunks/app/page-979ec1702bd9938a.js +0 -1
- package/gui/.next/static/chunks/app/settings/configure/page-25b2288ace2949a1.js +0 -1
- package/gui/.next/static/chunks/framework-7318ce553e854ad6.js +0 -1
- package/gui/.next/static/chunks/main-app-732547e2b1a794b6.js +0 -1
- package/gui/.next/static/chunks/main-f7a784f5852cbbd1.js +0 -1
- package/gui/.next/static/chunks/pages/_error-bda15e7831eec981.js +0 -1
- package/gui/.next/static/css/781f3c93b6d7425a.css +0 -3
- package/workspace-snapshot/files/apps/gui/components/custom/setup-dashboard.tsx +0 -124
- package/workspace-snapshot/files/apps/gui/components/custom/setup-readonly-sections.tsx +0 -210
- /package/gui/.next/static/{ZGJuemeaiW4yT7CTlmjdG → wM7YWpWgyTcGc7H5h1u7U}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1217],{100:(e,t,r)=>{"use strict";function n(e){return"".concat(e.workspaceId,":").concat(e.teamId,":").concat(e.projectId)}function a(e){let t=new Map;for(let n of e){var r;let e=null!=(r=t.get(n.teamId))?r:[];e.push(n),t.set(n.teamId,e)}return t}function s(e){var t;let r=null==(t=e.teamName)?void 0:t.trim();return r&&r!==e.teamKey?"".concat(r," (").concat(e.teamKey,")"):r||e.teamKey}r.d(t,{W:()=>s,iF:()=>n,um:()=>a})},2465:(e,t,r)=>{"use strict";r.d(t,{M:()=>i,y:()=>l});var n=r(4568),a=r(7186),s=r(743);function i(e){var t;let{phases:r,supportingText:i,busy:l=!0}=e,o=null!=(t=(0,a.I)())&&t,c=r.find(e=>"active"===e.status);return(0,n.jsxs)("div",{className:"space-y-3 rounded-md border border-border bg-muted/10 p-4","aria-live":"polite","aria-busy":l,"data-testid":"guided-operation-panel",children:[(0,n.jsx)("ul",{className:"space-y-2",children:r.map(e=>{let t="active"===e.status,r="complete"===e.status;return(0,n.jsxs)("li",{className:"flex items-start gap-2 text-sm","data-phase-status":e.status,children:[(0,n.jsx)("span",{className:r?"mt-0.5 text-emerald-600 dark:text-emerald-400":t?"mt-0.5 text-foreground":"mt-0.5 text-muted-foreground","aria-hidden":"true",children:r?"✓":t?"●":"○"}),t&&!o?(0,n.jsx)(s.P.span,{className:"font-medium text-foreground",animate:{opacity:[.55,1,.55]},transition:{duration:1.6,repeat:1/0,ease:"easeInOut"},children:e.label}):(0,n.jsx)("span",{className:t?"font-medium text-foreground":r?"text-foreground":"text-muted-foreground",children:e.label})]},e.id)})}),i||c?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:null!=i?i:null==c?void 0:c.label}):null]})}function l(e){return e.labels.map((t,r)=>({id:"phase-".concat(r),label:t,status:r<e.activeIndex?"complete":r===e.activeIndex?"active":"pending"}))}},2811:(e,t,r)=>{Promise.resolve().then(r.bind(r,4160)),Promise.resolve().then(r.bind(r,7366)),Promise.resolve().then(r.t.bind(r,9664,23))},3968:(e,t,r)=>{"use strict";r.d(t,{i:()=>p});var n=r(4568),a=r(7620),s=r(826);let i=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)("div",{ref:t,className:(0,s.cn)("rounded-xl border border-border bg-card text-card-foreground shadow-sm",r),...a})});i.displayName="Card";let l=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)("div",{ref:t,className:(0,s.cn)("flex flex-col space-y-1.5 p-6",r),...a})});l.displayName="CardHeader";let o=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)("div",{ref:t,className:(0,s.cn)("font-semibold leading-none tracking-tight",r),...a})});o.displayName="CardTitle";let c=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)("div",{ref:t,className:(0,s.cn)("text-sm text-muted-foreground",r),...a})});c.displayName="CardDescription";let d=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)("div",{ref:t,className:(0,s.cn)("p-6 pt-0",r),...a})});d.displayName="CardContent";var u=r(7431);function p(e){let{title:t,description:r,children:a,className:p}=e;return(0,n.jsxs)(i,{className:p,children:[(0,n.jsxs)(l,{className:u.Es.cardHeader,children:[(0,n.jsx)(o,{children:t}),r?(0,n.jsx)(c,{children:r}):null]}),(0,n.jsx)(d,{className:(0,s.cn)(u.Es.stackSm),children:a})]})}},4160:(e,t,r)=>{"use strict";r.d(t,{ConfigureExperience:()=>ta});var n=r(4568),a=r(7620);let s={remoteRead:{scope:"remote-read",confirmation:"standard",manualAlternative:!0},remoteSecretWrite:{scope:"remote-secret-write",confirmation:"strong",manualAlternative:!0},remoteRepoWrite:{scope:"remote-repo-write",confirmation:"strong",manualAlternative:!0}},i=["HARNESS_CONFIG_JSON_B64","LINEAR_API_KEY","CURSOR_API_KEY","HARNESS_GITHUB_TOKEN"];function l(e){let t=new Map(e.map(e=>[e.name,e.status])),r=[],n=[];for(let e of i){let a=t.get(e);if("present"!==a){if("unknown"===a){n.push(e);continue}r.push(e)}}return{allPresent:0===r.length&&0===n.length,missing:r,unknown:n}}function o(e,t){return e.hasStaleConfig&&(void 0!==e.staleHarnessDispatchRepo||"denied"===t)}function c(e,t){var r;e.push({blocking:!0,tone:null!=(r=t.tone)?r:"setup_needed",...t})}function d(e){return JSON.stringify(function(e){var t,r,n,a,s,i,l,o,c,d;let u=e.setupSummary.configSummary,p=(null!=(s=null==u?void 0:u.repos)?s:[]).flatMap(e=>{var t;return(null!=(t=e.linearAssociations)?t:[]).map(t=>"".concat(e.id,":").concat(t.workspaceId,":").concat(t.teamId,":").concat(t.projectId))}).sort((e,t)=>e.localeCompare(t));return{configResolved:e.setupSummary.overview.configResolved,operatorConfigResolved:e.setupSummary.overview.operatorConfigResolved,linearTeamKeyFromConfig:null!=(i=null==(t=e.controlPlaneContext)?void 0:t.linearTeamKeyFromConfig)?i:null,linearTeamKeyFromControlPlane:null!=(l=null==(a=e.controlPlaneContext)||null==(n=a.state)||null==(r=n.linear)?void 0:r.teamKey)?l:null,associationKeys:p,repoIds:(null!=(o=null==u?void 0:u.repos)?o:[]).map(e=>e.id).sort((e,t)=>e.localeCompare(t)),repoTargets:(null!=(c=null==u?void 0:u.repos)?c:[]).map(e=>({id:e.id,targetRepo:e.targetRepo})).sort((e,t)=>e.id.localeCompare(t.id)),allowedTargetRepos:[...null!=(d=null==u?void 0:u.allowedTargetRepos)?d:[]].sort((e,t)=>e.localeCompare(t))}}(e))}s.remoteRead,s.remoteSecretWrite,s.remoteRead,s.remoteRepoWrite,r(6289)._u.map(e=>({name:e.name,category:e.category,role:e.role,creatable:e.creatable}));let u=["connect-services","linear-workspace","vercel-bridge","local-setup","local-readiness","cloud-secrets","target-workflow","ready-for-first-run"],p={"connect-services":"Connect services","linear-workspace":"Set up Linear workspace","vercel-bridge":"Set up Vercel webhook bridge","local-setup":"Choose target repo(s)","local-readiness":"Check local readiness","cloud-secrets":"Connect cloud secrets","target-workflow":"Install target repo workflow","ready-for-first-run":"Ready for first run"};function m(e,t){var r,n;return null!=(n=null==(r=e.localFiles.find(e=>e.label===t))?void 0:r.exists)&&n}let h=new Set(["missing-env-local","missing-config-local","missing-harness-config-path","missing-linear-key","missing-cursor-key","missing-github-token","missing-vercel-token","config-unresolved","linear-workspace-not-applied","vercel-bridge-not-applied"]);function f(e,t){var r;e.push({blocking:!0,tone:null!=(r=t.tone)?r:h.has(t.id)?"setup_needed":"error",...t})}function g(e,t){e.push({...t,blocking:!1})}function v(e,t,r,n,a){let s=[],l=[];if(n&&o(n,t.harnessRepoAccess))return{blockers:s,warnings:l};for(let e of(t.githubTokenConfigured||f(s,{id:"missing-github-token-remote",stepId:"cloud-secrets",message:"Blocked: GITHUB_TOKEN is required for cloud secrets setup.",action:"Next: Add GITHUB_TOKEN in local setup, then return to Connect cloud secrets.",priority:300}),t.harnessDispatchRepoResolved||f(s,{id:"harness-dispatch-repo-unresolved",stepId:"cloud-secrets",message:"Blocked: Harness dispatch repo could not be resolved.",action:"Next: Return to Step 4, enter your harness repo, and use Verify and use harness repo.",priority:301}),"denied"===t.harnessRepoAccess?f(s,{id:"harness-repo-access-denied",stepId:"cloud-secrets",message:"Blocked: I tried to check ".concat(t.harnessDispatchRepo," and GitHub denied access."),action:"Next: Return to Step 4 to correct the harness repo, or update GITHUB_TOKEN permissions in Step 1 and verify again.",priority:302}):"unknown"===t.harnessRepoAccess&&t.harnessDispatchRepoResolved&&f(s,{id:"harness-repo-access-unknown",stepId:"cloud-secrets",message:"Blocked: Harness repo access could not be verified yet.",action:"Next: Return to Step 4 and use Verify and use harness repo, or refresh after saving GITHUB_TOKEN in Step 1.",priority:303}),function(e){let t=new Map(e.harnessSecretStatuses.map(e=>[e.name,e.status]));return i.filter(e=>"missing"===t.get(e))}(t)))f(s,{id:"missing-harness-secret-".concat(e),stepId:"cloud-secrets",message:"Blocked: Required cloud secret ".concat(e," is missing."),action:"Next: Review generated secrets, confirm, then create or update encrypted GitHub Actions secrets.",priority:303});for(let e of t.harnessSecretStatuses)"unknown"===e.status&&t.githubTokenConfigured&&g(l,{id:"harness-secret-unknown-".concat(e.name),stepId:"cloud-secrets",message:"Cloud secret ".concat(e.name," status is unknown."),action:"Refresh cloud secrets setup to re-check secret presence.",priority:591});return(null==r?void 0:r.remoteSecretPreviewStale)&&r.cloudSecretsPreviewOpened&&f(s,{id:"remote-secret-preview-stale",stepId:"cloud-secrets",message:"Blocked: Cloud secrets preview is out of date.",action:"Next: Regenerate the secrets preview, then confirm and create or update secrets.",priority:307}),a&&function(e){var t,r,n,a,s,i,l,o;let c=null==(r=e.state)||null==(t=r.linear)?void 0:t.teamKey,d=e.linearTeamKeyFromConfig;if(c&&d&&c!==d)return!0;let u=null==(s=e.state)||null==(a=s.linearWorkspace)||null==(n=a.appliedFingerprint)?void 0:n.trim(),p=null!=(o=null==(l=e.state)||null==(i=l.linearWorkspace)?void 0:i.teams)?o:[];return!!u&&0===p.length}(a)&&f(s,{id:"cloud-secrets-stale-linear-config",stepId:"cloud-secrets",message:"Blocked: HARNESS_CONFIG_JSON_B64 is stale after Linear workspace changes.",action:"Next: Regenerate cloud secrets preview after updating local config, then apply.",priority:308,tone:"error"}),{blockers:s.sort((e,t)=>e.priority-t.priority),warnings:l.sort((e,t)=>e.priority-t.priority)}}function y(e){let t=l(e.harnessSecretStatuses);return e.harnessDispatchRepoResolved&&"denied"!==e.harnessRepoAccess&&t.allPresent}function x(e){return!!e.evidence&&(!!e.evidence.harnessDispatchRepo&&!!e.harnessDispatchRepo&&e.evidence.harnessDispatchRepo!==e.harnessDispatchRepo||e.evidence.configStateFingerprint!==e.currentConfigStateFingerprint)}function w(e){return!(!e.evidence||x(e))&&b({evidence:e.evidence,currentConfigStateFingerprint:e.currentConfigStateFingerprint})}function b(e){return!!e.evidence&&"automatic"===e.evidence.path&&!!e.evidence.harnessConfigJsonB64Written&&e.evidence.configStateFingerprint===e.currentConfigStateFingerprint}function k(e){return e.blockers.filter(t=>"remote-secret-preview-stale"===t.id?!(e.previewStaleCleared&&e.postApplyVerificationReady):"cloud-secrets-stale-linear-config"!==t.id||!b({evidence:e.evidence,currentConfigStateFingerprint:e.currentConfigStateFingerprint}))}function j(e){return e.githubTokenConfigured?e.harnessDispatchRepoResolved?"denied"===e.harnessRepoAccess?{allowed:!1,reason:"Blocked: GitHub denied access to ".concat(e.harnessDispatchRepo,"."),action:"Return to Step 4 to correct the harness repo, or update GITHUB_TOKEN permissions in Step 1 and verify again.",route:"step4-harness-repo"}:"available"!==e.harnessRepoAccess?{allowed:!1,reason:"Blocked: Harness repo access could not be verified yet.",action:"Return to Step 4 and use Verify and use harness repo, then refresh cloud secrets setup.",route:"step4-harness-repo"}:{allowed:!0}:{allowed:!1,reason:"Blocked: Harness dispatch repo could not be resolved.",action:"Return to Step 4, enter your harness repo, and use Verify and use harness repo.",route:"step4-harness-repo"}:{allowed:!1,reason:"Blocked: GITHUB_TOKEN is required for cloud secrets setup.",action:"Add GITHUB_TOKEN in Step 1, then return to cloud secrets setup.",route:"connect-services"}}function S(e){return e.replace(/^Blocked:\s*/,"").replace(/^Setup needed:\s*/,"")}function C(e){var t,r,n,a,s,i,l,h;let y=null!=(s=e.staleSmokeDiagnostics)?s:{hasStaleConfig:!1,findings:[],staleTargetRepos:[]},x=null!=(i=e.controlPlaneContext)?i:{state:null},w=function(e,t){let r=[];return e.envKeyPresence.LINEAR_API_KEY||c(r,{id:"missing-linear-key",stepId:"connect-services",message:"Setup needed: LINEAR_API_KEY is not configured yet.",action:"Add it in Step 1 \xb7 Connect services.",priority:103}),e.envKeyPresence.CURSOR_API_KEY||c(r,{id:"missing-cursor-key",stepId:"connect-services",message:"Setup needed: CURSOR_API_KEY is not configured yet.",action:"Add it in Step 1 \xb7 Connect services.",priority:104}),e.envKeyPresence.GITHUB_TOKEN||c(r,{id:"missing-github-token",stepId:"connect-services",message:"Setup needed: GITHUB_TOKEN is not configured yet.",action:"Add it in Step 1 \xb7 Connect services.",priority:105}),e.envKeyPresence.VERCEL_TOKEN||c(r,{id:"missing-vercel-token",stepId:"connect-services",message:"Setup needed: VERCEL_TOKEN is not configured yet.",action:"Add it in Step 1 \xb7 Connect services.",priority:106}),t&&"verified-and-persisted"!==t.state&&"skipped-source-mode"!==t.state&&"skipped-not-packaged"!==t.state&&c(r,{id:"harness-workspace-not-provisioned",stepId:"connect-services",message:"Blocked: Harness workspace provisioning is not complete (".concat(t.state,")."),action:"Next: Verify and save service keys, then use Set up workspace in Step 1.",priority:107,tone:t.recoverable?"setup_needed":"error"}),r.sort((e,t)=>e.priority-t.priority)}(e.summary,e.harnessProvisioningSummary),b=function(e,t){var r,n;let a=[],s=null==(r=e.state)?void 0:r.linearWorkspace,i=null==(n=e.state)?void 0:n.linear,l=!!((null==s?void 0:s.teams.some(e=>e.projects.length>0))||(null==i?void 0:i.teamKey)),o=!!((null==s?void 0:s.teams.every(e=>"healthy"===e.health||e.projects.every(e=>"healthy"===e.health)))||(null==i?void 0:i.statusCoverageComplete)||(null==i?void 0:i.manualComplete));return l?o||c(a,{id:"linear-status-coverage-incomplete",stepId:"linear-workspace",message:"Blocked: Required Linear workflow statuses are still missing.",action:"Next: Complete Linear workspace setup or confirm manual status coverage.",priority:151}):c(a,{id:"linear-workspace-not-applied",stepId:"linear-workspace",message:"Setup needed: Linear workspace setup is not complete yet.",action:"Next: Preview and apply Linear team, project, and workflow statuses.",priority:150}),(null==t?void 0:t.linearPreviewStale)&&!l&&c(a,{id:"linear-preview-stale",stepId:"linear-workspace",message:"Blocked: Linear setup preview is out of date.",action:"Next: Regenerate the Linear setup preview, then confirm and apply.",priority:152,tone:"error"}),a.sort((e,t)=>e.priority-t.priority)}(x,e.uiState),j=function(e,t){var r,n,a,s,i,l,o,d;let u=[],p=null==(r=e.state)?void 0:r.vercel,m=null==(a=e.state)||null==(n=a.linear)?void 0:n.teamKey;if(null==p?void 0:p.projectId){for(let[e,t]of(p.endpointReachable||c(u,{id:"vercel-endpoint-unreachable",stepId:"vercel-bridge",message:"Blocked: Vercel /api/linear-webhook endpoint is not reachable yet.",action:"Next: Deploy the bridge project and confirm the public webhook route is reachable.",priority:161,tone:"error"}),Object.entries(null!=(o=p.envVarPresence)?o:{})))"missing"===t&&c(u,{id:"vercel-env-missing-".concat(e),stepId:"vercel-bridge",message:"Blocked: Vercel production env var ".concat(e," is missing."),action:"Next: Apply Vercel bridge env vars or set them manually.",priority:162,tone:"error"});p.linearWebhookVerified||c(u,{id:"linear-webhook-unverified",stepId:"vercel-bridge",message:"Blocked: Linear Issue webhook is not verified for the PDev automation bridge URL.",action:"Next: Create or verify the Linear webhook, then refresh bridge readiness.",priority:163,tone:"error"}),p.signedProbeVerified||c(u,{id:"signed-probe-unverified",stepId:"vercel-bridge",message:"Blocked: Signed webhook delivery verification has not passed against production.",action:"Next: Apply PDev automation bridge settings and wait for signed probe verification to pass.",priority:164,tone:"error"}),p.deploymentRedeployRequired&&c(u,{id:"vercel-redeploy-required",stepId:"vercel-bridge",message:"Blocked: Vercel production must be redeployed after env var changes before signed verification can pass.",action:"Next: Redeploy production, then retry PDev automation bridge apply.",priority:165,tone:"error"}),m&&(null==(s=p.envVarPresence)?void 0:s.HARNESS_TEAM_KEY)==="present"&&(null==(l=e.state)||null==(i=l.linear)?void 0:i.teamKey)&&((d={configuredTeamKey:e.state.linear.teamKey,selectedTeamKey:m}).configuredTeamKey&&d.selectedTeamKey&&d.configuredTeamKey!==d.selectedTeamKey||d.configuredProjectId&&d.selectedProjectId&&d.configuredProjectId!==d.selectedProjectId||d.configuredProductionUrl&&d.selectedProductionUrl&&d.configuredProductionUrl!==d.selectedProductionUrl||0)&&c(u,{id:"vercel-team-key-stale",stepId:"vercel-bridge",message:"Blocked: Vercel HARNESS_TEAM_KEY may be stale after Linear team changes.",action:"Next: Re-apply PDev automation bridge setup with the current team key.",priority:166,tone:"error"})}else c(u,{id:"vercel-bridge-not-applied",stepId:"vercel-bridge",message:"Setup needed: PDev automation bridge setup is not complete yet.",action:"Next: Preview and apply PDev automation bridge env vars and webhook readiness.",priority:160});return(null==t?void 0:t.vercelPreviewStale)&&!(null==p?void 0:p.projectId)&&c(u,{id:"vercel-preview-stale",stepId:"vercel-bridge",message:"Blocked: PDev automation bridge preview is out of date.",action:"Next: Regenerate the PDev automation bridge preview, then confirm and apply.",priority:167,tone:"error"}),u.sort((e,t)=>e.priority-t.priority)}(x,e.uiState),C=function(e,t,r){let n=[];return m(e,".env.local")||f(n,{id:"missing-env-local",stepId:"local-setup",message:"Setup needed: create .env.local on this machine.",action:"Add your target repo in Step 4, then preview setup files.",priority:100}),m(e,".harness/config.local.json")||f(n,{id:"missing-config-local",stepId:"local-setup",message:"Setup needed: create .harness/config.local.json.",action:"Choose your target repo in Step 4, then preview setup files.",priority:101}),e.envKeyPresence.HARNESS_CONFIG_PATH||f(n,{id:"missing-harness-config-path",stepId:"local-setup",message:"Setup needed: HARNESS_CONFIG_PATH is not configured yet.",action:"This is set automatically when you create local setup files.",priority:102}),e.overview.configResolved||e.configSource.parseError||f(n,{id:"config-unresolved",stepId:"local-setup",message:"Setup needed: harness config is not configured locally yet.",action:"Complete Step 4 to create local setup files.",priority:106}),(null==t?void 0:t.localPreviewStale)&&f(n,{id:"local-preview-stale",stepId:"local-setup",message:"Blocked: Local preview is out of date.",action:"Next: Regenerate preview after your latest edits, then confirm and apply.",priority:107}),(null==r?void 0:r.hasStaleConfig)&&(r.staleHarnessDispatchRepo&&f(n,{id:"stale-smoke-dispatch-repo",stepId:"local-setup",message:"Blocked: Your setup points at an old disposable smoke-test harness repo.",action:"Next: Reset GITHUB_DISPATCH_REPOSITORY to your current harness repo, preview local setup, then apply.",priority:108}),r.staleTargetRepos.length>0&&f(n,{id:"stale-smoke-target-repo",stepId:"local-setup",message:"Blocked: Target repo config still points at an old disposable smoke-test repo.",action:"Next: Enter your intended target repo in Local setup, preview local setup, then apply.",priority:109})),n.sort((e,t)=>e.priority-t.priority)}(e.summary,e.uiState,y),N=function(e){let t=[];return e.configSource.parseError&&f(t,{id:"config-parse-error",stepId:"local-readiness",message:"Blocked: Harness config does not parse.",action:"Next: Fix .harness/config.local.json validation errors in Local setup.",priority:200}),e.configSummary&&!e.configSummary.closureValid&&f(t,{id:"allowed-target-repos-closure",stepId:"local-readiness",message:"Blocked: allowedTargetRepos does not cover every configured target repo.",action:"Next: Update target repo config so allowedTargetRepos includes each mapping.",priority:201}),{blockers:t.sort((e,t)=>e.priority-t.priority),warnings:[].sort((e,t)=>e.priority-t.priority)}}(e.summary),R=v(e.summary,e.remoteSummary,e.uiState,y,x),I=d({setupSummary:e.summary,controlPlaneContext:x}),P={blockers:k({blockers:R.blockers,evidence:null==(t=e.uiState)?void 0:t.cloudSecretsApplyEvidence,currentConfigStateFingerprint:I}),warnings:R.warnings},E=function(e,t,r){let n=[],a=[];if(r&&o(r,t.harnessRepoAccess))return{blockers:n,warnings:a};for(let r of(t.githubTokenConfigured||f(n,{id:"missing-github-token-remote-workflow",stepId:"target-workflow",message:"Blocked: GITHUB_TOKEN is required for workflow install.",action:"Next: Add GITHUB_TOKEN in local setup, then return to workflow install.",priority:310}),0===t.targetRepos.length&&e.overview.configResolved&&f(n,{id:"missing-target-repos",stepId:"target-workflow",message:"Blocked: No target repos are configured for workflow install.",action:"Next: Add at least one target repo mapping in local setup.",priority:304}),t.targetRepos)){if("denied"===r.repoAccess&&f(n,{id:"target-repo-access-denied-".concat(r.repoConfigId),stepId:"target-workflow",message:"Blocked: GitHub access to ".concat(r.targetRepo," was denied."),action:"Next: Grant workflow and PR permissions for this target repo, then refresh.",priority:305}),"missing"===r.workflowStatus||"differs"===r.workflowStatus){let e="missing"===r.workflowStatus?"missing":"outdated";f(n,{id:"target-workflow-".concat(r.workflowStatus,"-").concat(r.repoConfigId),stepId:"target-workflow",message:"Blocked: Target workflow is ".concat(e," for ").concat(r.repoConfigId,"."),action:"Next: Preview the workflow install PR, confirm, then create or update the install PR.",priority:306})}"unknown"===r.workflowStatus&&t.githubTokenConfigured&&g(a,{id:"target-workflow-unknown-".concat(r.repoConfigId),stepId:"target-workflow",message:"Target workflow status is unknown for ".concat(r.repoConfigId,"."),action:"Refresh workflow install setup to re-check workflow presence.",priority:592})}return{blockers:n.sort((e,t)=>e.priority-t.priority),warnings:a.sort((e,t)=>e.priority-t.priority)}}(e.summary,e.remoteSummary,y),T=0===w.length,A=0===b.length,_=0===j.length,K=_&&0===C.length,O=K&&0===N.blockers.length&&e.summary.overview.readyForLocalDoctor,L=null!=(l=null==(r=e.uiState)?void 0:r.localReadinessReviewed)&&l,F=O&&L,H=F&&0===P.blockers.length,B=null!=(h=null==(n=e.uiState)?void 0:n.cloudSecretsReviewed)&&h,D=H&&B,U=D&&0===E.blockers.length,G=[...w,...b,...j,...C,...N.blockers,...P.blockers,...E.blockers].sort((e,t)=>e.priority-t.priority),V=[...N.warnings,...P.warnings,...E.warnings].sort((e,t)=>e.priority-t.priority),M=T?A?_?K?F?D?U?"ready-for-first-run":"target-workflow":"cloud-secrets":"local-readiness":"local-setup":"vercel-bridge":"linear-workspace":"connect-services",W={"connect-services":w,"linear-workspace":b,"vercel-bridge":j,"local-setup":C,"local-readiness":N.blockers,"cloud-secrets":P.blockers,"target-workflow":E.blockers,"ready-for-first-run":U?[]:[{id:"not-ready-for-first-run",stepId:"ready-for-first-run",message:"Blocked: Harness setup is not ready for a first run yet.",action:"Next: Complete the earlier setup steps first.",priority:400,blocking:!0}]},Y=u.map(e=>{var t,r;let n=function(e,t,r,n,a,s,i,l){switch(e){case"connect-services":return!0;case"linear-workspace":return t;case"vercel-bridge":return r;case"local-setup":return n;case"local-readiness":return a;case"cloud-secrets":return s;case"target-workflow":return i;case"ready-for-first-run":return l}}(e,T,A,_,K,F,D,U),a=W[e],s="local-readiness"===e?N.warnings:"cloud-secrets"===e?P.warnings:"target-workflow"===e?E.warnings:[],i="connect-services"===e?T:"linear-workspace"===e?A:"vercel-bridge"===e?_:"local-setup"===e?K:"local-readiness"===e?F:"cloud-secrets"===e?D:U,l=e===M;return{id:e,label:p[e],status:function(e){if(!e.prerequisitesMet)return"not_started";if(e.complete)return"complete";if(e.blockers.length>0){var t;return e.isCurrent&&(t=e.blockers).length>0&&t.every(e=>"setup_needed"===e.tone)?"in_progress":"blocked"}return e.isCurrent?"in_progress":"ready"}({stepId:e,prerequisitesMet:n,blockers:a,complete:i,isCurrent:l}),summary:"ready-for-first-run"===e&&U?"Harness setup is ready for a future first run.":null!=(r=null==(t=a[0])?void 0:t.message)?r:"Continue ".concat(p[e].toLowerCase(),"."),blockers:a,warnings:s,primaryAction:function(e,t){let r=t.find(t=>t.stepId===e);if(r)return{id:r.id,label:r.action.replace(/^Next:\s*/,""),stepId:e};switch(e){case"connect-services":return{id:"preview-connect-services",label:"Connect services",stepId:e};case"linear-workspace":return{id:"complete-linear-workspace",label:"Set up Linear workspace",stepId:e};case"vercel-bridge":return{id:"complete-vercel-bridge",label:"Set up Vercel webhook bridge",stepId:e};case"local-setup":return{id:"preview-local-files",label:"Preview setup files",stepId:e};case"local-readiness":return{id:"review-local-readiness",label:"Review local readiness checks",stepId:e};case"cloud-secrets":return{id:"complete-cloud-secrets",label:"Connect cloud secrets",stepId:e};case"target-workflow":return{id:"complete-target-workflow",label:"Install target repo workflow",stepId:e};case"ready-for-first-run":return{id:"review-first-run-readiness",label:"Review final readiness state",stepId:e}}}(e,G),inspectable:!0,actionable:n&&(l||a.length>0)}}),J=G[0],q=J?{id:J.id,label:J.action.replace(/^Next:\s*/,""),stepId:J.stepId}:null==(a=Y.find(e=>e.id===M))?void 0:a.primaryAction,$=function(e){var t;if(e.staleSmokeDiagnostics.hasStaleConfig){let t=e.staleSmokeDiagnostics.staleTargetRepos.length>0,r=e.staleSmokeDiagnostics.suggestedHarnessDispatchRepo;return{id:"fix-stale-smoke-config",stepId:"local-setup",title:"I need this from you now",problem:"Your setup points at an old disposable smoke-test repo.",whyItMatters:"That repo may have been deleted after the M5.5 smoke test, so GitHub access checks fail.",neededFromYou:t?r?"Reset GITHUB_DISPATCH_REPOSITORY to ".concat(r,", and enter the target repo you actually intend to use."):"Reset the stale harness dispatch repo and enter the target repo you actually intend to use.":r?"Reset GITHUB_DISPATCH_REPOSITORY to ".concat(r,"."):"Reset the stale harness dispatch repo to your current harness repo.",primaryCtaLabel:"Preview setup files",secondaryCtaLabel:"Show technical details",tone:"error"}}if((null==(t=e.highestPriorityBlocker)?void 0:t.id)==="harness-repo-access-denied")return{id:"confirm-harness-repo-access",stepId:"cloud-secrets",title:"I need this from you now",problem:S(e.highestPriorityBlocker.message),whyItMatters:"Cloud secrets setup cannot continue until the harness dispatch repo is reachable with your GitHub token.",neededFromYou:"Confirm the harness dispatch repo is the one you intend to use, or fix local setup if it is wrong.",primaryCtaLabel:"Connect cloud secrets",secondaryCtaLabel:"Show technical details",tone:"error"};if(e.highestPriorityBlocker){let t="setup_needed"===e.highestPriorityBlocker.tone,r="missing-config-local"===e.highestPriorityBlocker.id||"config-unresolved"===e.highestPriorityBlocker.id?"Step 4 of 7 \xb7 Choose target repo":"connect-services"===e.highestPriorityBlocker.stepId?"Step 1 of 7 \xb7 Connect services":"linear-workspace"===e.highestPriorityBlocker.stepId?"Step 2 of 7 \xb7 Set up Linear workspace":"vercel-bridge"===e.highestPriorityBlocker.stepId?"Step 3 of 7 \xb7 Set up Vercel webhook bridge":"Step 1 of 7 \xb7 Connect services";return{id:e.highestPriorityBlocker.id,stepId:e.highestPriorityBlocker.stepId,title:t?r:"I need this from you now",problem:S(e.highestPriorityBlocker.message),whyItMatters:t?"This is normal for a first-time setup. Nothing is broken yet.":"Setup cannot continue until this blocker is resolved.",neededFromYou:e.highestPriorityBlocker.action.replace(/^Next:\s*/,""),primaryCtaLabel:t?"cloud-secrets"===e.highestPriorityBlocker.stepId||"target-workflow"===e.highestPriorityBlocker.stepId?"cloud-secrets"===e.highestPriorityBlocker.stepId?"Connect cloud secrets":"Install target repo workflow":("missing-config-local"===e.highestPriorityBlocker.id||e.highestPriorityBlocker.id,"Continue"):e.highestPriorityBlocker.action.replace(/^Next:\s*/,""),secondaryCtaLabel:"Show technical details",tone:t?"setup_needed":"error"}}}({highestPriorityBlocker:J,staleSmokeDiagnostics:y});return{steps:Y,currentStepId:M,highestPriorityBlocker:J,nextRecommendedAction:q,primaryTask:$,staleSmokeDiagnostics:y,remoteSetupBlockedByUpstream:y.hasStaleConfig,readyForFirstRun:U,localReadinessBlockersCleared:O,localReadinessReviewed:L,localReadinessComplete:F,cloudSecretsBlockersCleared:H,cloudSecretsReviewed:B,nonBlockingWarnings:V,prohibitedActionsNote:"M6 confirms setup readiness only. It does not trigger harness phases, Linear automation, cloud workflow dispatch, implementation branches, or issue-work PRs. A later milestone may add a safe first-issue dry run."}}var N=r(4277),R=r(7431);let I=["connect-services","linear-workspace","vercel-bridge","local-setup","local-readiness","cloud-secrets","target-workflow","ready-for-first-run"],P=["connect-services","linear-workspace","vercel-bridge","choose-target-repos","local-readiness","cloud-secrets","target-workflow","ready-for-first-run"],E=[{id:"connect-services",shortLabel:"Services",accessibleLabel:"Connect services"},{id:"linear-workspace",shortLabel:"Linear",accessibleLabel:"Set up Linear workspace"},{id:"vercel-bridge",shortLabel:"Bridge",accessibleLabel:"Set up PDev automation bridge"},{id:"choose-target-repos",shortLabel:"Repositories",accessibleLabel:"Choose target repositories"},{id:"local-readiness",shortLabel:"Readiness",accessibleLabel:"Check local readiness"},{id:"cloud-secrets",shortLabel:"Secrets",accessibleLabel:"Connect cloud secrets"},{id:"target-workflow",shortLabel:"Workflow",accessibleLabel:"Install target workflow"}];function T(e){return P.indexOf(e)}function A(e){var t;let r=T(e);return r<=0?null:null!=(t=P[r-1])?t:null}function _(e){return e.overview.localFilesPresent}function K(e){switch(e.currentStepId){case"connect-services":return"connect-services";case"linear-workspace":return"linear-workspace";case"vercel-bridge":return"vercel-bridge";case"local-setup":var t,r;return null!=(r=null==(t=e.summary.localFiles.find(e=>".env.local"===e.label))?void 0:t.exists)&&r&&_(e.summary),"choose-target-repos";case"local-readiness":return"local-readiness";case"cloud-secrets":return"cloud-secrets";case"target-workflow":return"target-workflow";case"ready-for-first-run":return"ready-for-first-run"}}function O(e,t){return I.indexOf(e)-I.indexOf(t)}function L(e){var t;let r=function(e){switch(e){case"connect-services":return"connect-services";case"linear-workspace":return"linear-workspace";case"vercel-bridge":return"vercel-bridge";case"local-setup":return"choose-target-repos";case"local-readiness":return"local-readiness";case"cloud-secrets":return"cloud-secrets";case"target-workflow":return"target-workflow";case"ready-for-first-run":return"ready-for-first-run"}}(e.currentStepId);return(t=e.target,T(t)-T(r)>0)?r:e.target}var F=r(6845),H=r(9664),B=r.n(H),D=r(5102),U=r(7186);function G(e,t){let r=e.trim(),n=null==t?void 0:t.trim();return!!(r&&n&&r===n)}var V=r(826);let M=a.forwardRef((e,t)=>{let{className:r,orientation:a="horizontal",...s}=e;return(0,n.jsx)("div",{ref:t,className:(0,V.cn)("shrink-0 bg-border","horizontal"===a?"h-px w-full":"h-full w-px",r),...s})});M.displayName="Separator";var W=r(3968),Y=r(1980),J=r(2779),q=r(8049),$=r(4715),z=r(1784),Z=r(5716),X=r(5750);let Q=/^https:\/\/github\.com\/[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+\/?$/;function ee(e){var t,r,s,i,l,o,c,d,u,p,m,h,f;let{values:g,highlightStaleTarget:v=!1,variant:y="advanced",guidedSection:x="full",suggestedHarnessDispatchRepo:w,savedHarnessDispatchRepository:b="",harnessRepoVerification:k={state:"unchecked"},verifyingHarnessRepo:j=!1,guidedRepos:S,repoVerification:C={},verifyingRepoRowId:N=null,onChange:I,onGuidedReposChange:P,onVerifyRepo:E,onRepoBlur:T,onAddRepo:A,onRemoveRepo:_,harnessDispatchRepository:K="",onHarnessDispatchRepositoryChange:O,onVerifyAndUseHarnessRepo:L,harnessConnectedAutomatically:H=!1,harnessRepoInheritedFromStep1:B=!1,githubTokenSourceHint:U,activeGithubTokenFingerprint:G=null}=e,[V,M]=(0,a.useState)({}),[W,Y]=(0,a.useState)(!1),[ee,et]=(0,a.useState)(K),er=K.trim()||b.trim()||(null==w?void 0:w.trim())||"",en=b.trim()?"Saved in .env.local":(null==w?void 0:w.trim())?"Detected from git remote":"Not detected yet",ea=K.trim(),es="connected"===k.state&&k.verifiedRepo===ea&&(!G||k.verifiedGithubTokenFingerprint===G),ei=(e,t)=>{var r;let n=[...g.repos];n[e]={...null!=(r=n[e])?r:{id:"",targetRepo:""},...t},I({...g,repos:n})},el=(e,t)=>{S&&P&&P(S.map(r=>r.rowId===e?{...r,...t}:r))};if("guided-minimal"===y){let e=S&&S.length>0?S:[{rowId:"fallback-repo",id:"",targetRepo:""}],t="full"===x||"target-repos"===x;return(0,n.jsxs)("div",{className:"space-y-6",children:["full"===x||"harness"===x?(0,n.jsxs)("div",{className:R.PI.fieldStack,children:[(0,n.jsx)(q.J,{htmlFor:"harness-dispatch-repository-guided",children:"Harness workspace"}),W?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(J.p,{id:"harness-dispatch-repository-guided",value:ee,onChange:e=>et(e.target.value),autoComplete:"off"}),(0,n.jsx)("p",{className:R.PI.secretHint,children:"Enter the harness repo slug or GitHub URL. Saving to `.env.local` happens when you verify and use this repo, then create or update local setup files."}),"failed"===k.state&&k.message?(0,n.jsx)(Z.r,{message:k.message,failed:!0}):null,k.limitation?(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:k.limitation}):null,(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[L?(0,n.jsx)(F.$,{type:"button",size:"sm",onClick:()=>L(ee),disabled:j||!ee.trim(),children:j?"Verifying harness repo…":"Verify and use harness repo"}):null,(0,n.jsx)(F.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>{et(ea||er),Y(!1)},children:"Cancel"})]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"text-sm font-medium break-all",children:ea||er||"Not connected yet"}),(0,n.jsx)("p",{className:R.PI.secretHint,children:"This is the private GitHub repo where harness GitHub Actions secrets and future dispatch/workflow setup are configured. It is not your target app repo."}),H?(0,n.jsx)("p",{className:R.PI.secretHint,children:"Connected automatically during Step 1."}):B?(0,n.jsx)("p",{className:R.PI.secretHint,children:"Connected during Step 1. You can use a different harness repo if needed."}):(0,n.jsx)("p",{className:R.PI.secretHint,children:en}),b.trim()&&(null==w?void 0:w.trim())&&b.trim()!==w.trim()?(0,n.jsxs)("p",{className:R.PI.secretHint,children:["Detected git remote: ",w,". Your saved override in `.env.local` takes precedence."]}):null,!b.trim()&&(null==w?void 0:w.trim())&&er===w?(0,n.jsx)("p",{className:R.PI.secretHint,children:"If this detected repo is correct, you do not need to change it."}):null,es&&k.message?(0,n.jsx)(Z.r,{message:k.message}):null,H||B||es||!ea?null:(0,n.jsx)("p",{className:R.PI.secretHint,children:"Verify and use this harness repo before creating local setup files."}),(0,n.jsx)(F.$,{type:"button",variant:"outline",size:"sm",onClick:()=>{et(ea||er),Y(!0)},children:H?"Use a different or existing harness repo":ea?"Update harness repo":"Enter harness repo"})]})]}):null,t?(0,n.jsx)("div",{className:"space-y-4",children:e.map((e,t)=>{var r,a,s;let i=null!=(r=C[e.rowId])?r:{state:"unchecked"},l=function(e){switch(e){case"checking":return{label:"Checking",variant:"secondary"};case"connected":return{label:"Connected",variant:"success"};case"failed":return{label:"Failed",variant:"destructive"};default:return{label:"Not connected yet",variant:"secondary"}}}(i.state),o=e.targetRepo.trim(),c=(0,X.bE)(i,o,G),d=(0,X.YQ)(i,o,G),u=N===e.rowId?"Checking repo + workflow access…":c?"Verified":"Verify repo + workflow access",p=N===e.rowId||c||!Q.test(o);return(0,n.jsxs)("div",{className:"rounded-lg border border-border bg-card p-4 space-y-3",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,n.jsxs)("p",{className:"inline-flex items-center gap-2 text-sm font-medium",children:[(0,n.jsx)(z.S,{}),(0,n.jsxs)("span",{children:["Target repo ",t+1]})]}),(0,n.jsx)(D.W,{label:l.label,variant:l.variant})]}),(0,n.jsxs)("div",{className:R.PI.fieldStack,children:[(0,n.jsx)(q.J,{htmlFor:"target-repo-".concat(e.rowId),children:"Target repo URL"}),(0,n.jsx)(J.p,{id:"target-repo-".concat(e.rowId),value:e.targetRepo,onChange:t=>el(e.rowId,{targetRepo:t.target.value}),onBlur:()=>null==T?void 0:T(e.rowId),placeholder:"https://github.com/acme/my-product",className:v&&0===t?"border-destructive/60":void 0,autoComplete:"off"}),(0,n.jsx)("p",{className:R.PI.secretHint,children:"Copy-paste the main repo URL."}),v&&0===t?(0,n.jsx)("p",{className:R.PI.secretHint,children:"Enter the target repo you actually intend to use. The app will not guess or invent a replacement repo for you."}):null]}),c?(0,n.jsx)(Z.r,{message:"Connected"}):d&&i.message?(0,n.jsx)(Z.r,{message:i.message,failed:!0}):null,i.limitation&&(c||d)?(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:i.limitation}):null,(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[E?(0,n.jsx)(F.$,{type:"button",variant:"outline",size:"sm",onClick:()=>E(e.rowId),disabled:p,children:u}):null,t>0&&_?(0,n.jsx)(F.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>_(e.rowId),children:"Remove repo"}):null]}),(0,n.jsxs)("div",{className:R.PI.fieldStack,children:[(0,n.jsx)(F.$,{type:"button",variant:"outline",size:"sm",onClick:()=>M(t=>({...t,[e.rowId]:!t[e.rowId]})),children:V[e.rowId]?"Hide advanced branch settings":"Advanced branch settings"}),V[e.rowId]?(0,n.jsxs)("div",{className:R.PI.fieldGrid,children:[(0,n.jsxs)("div",{className:R.PI.fieldStack,children:[(0,n.jsx)(q.J,{htmlFor:"guided-base-branch-".concat(e.rowId),children:"Base branch"}),(0,n.jsx)(J.p,{id:"guided-base-branch-".concat(e.rowId),value:null!=(a=e.baseBranch)?a:"",onChange:t=>el(e.rowId,{baseBranch:t.target.value}),placeholder:"dev",autoComplete:"off"})]}),(0,n.jsxs)("div",{className:R.PI.fieldStack,children:[(0,n.jsx)(q.J,{htmlFor:"guided-production-branch-".concat(e.rowId),children:"Production branch"}),(0,n.jsx)(J.p,{id:"guided-production-branch-".concat(e.rowId),value:null!=(s=e.productionBranch)?s:"",onChange:t=>el(e.rowId,{productionBranch:t.target.value}),placeholder:"main",autoComplete:"off"})]}),(0,n.jsx)("p",{className:R.PI.secretHint,children:"Leave blank to use defaults: dev for base branch and main for production branch."})]}):null]})]},e.rowId)})}):null,t&&A?(0,n.jsx)(F.$,{type:"button",variant:"outline",onClick:A,children:"Add additional repo"}):null]})}let eo=null!=(t=g.repos[0])?t:{id:"",targetRepo:""};return(0,n.jsxs)("div",{className:"space-y-6",children:[(0,n.jsxs)("div",{className:R.PI.fieldGrid,children:[(0,n.jsxs)("div",{className:R.PI.fieldStack,children:[(0,n.jsx)(q.J,{htmlFor:"linear-team-key",children:"Linear team key"}),(0,n.jsx)(J.p,{id:"linear-team-key",value:null!=(r=g.linearTeamKey)?r:"",onChange:e=>I({...g,linearTeamKey:e.target.value})})]}),(0,n.jsxs)("div",{className:R.PI.fieldStack,children:[(0,n.jsx)(q.J,{htmlFor:"model-id",children:"Model ID"}),(0,n.jsx)(J.p,{id:"model-id",value:null!=(s=g.modelId)?s:"",onChange:e=>I({...g,modelId:e.target.value})}),(0,n.jsx)("p",{className:R.PI.secretHint,children:"Local setup only. Harness runs use standard Composer 2.5 policy."})]})]}),(0,n.jsxs)("div",{className:R.PI.fieldGrid,children:[(0,n.jsxs)("div",{className:R.PI.fieldStack,children:[(0,n.jsx)(q.J,{htmlFor:"repo-id",children:"Repo config ID"}),(0,n.jsx)(J.p,{id:"repo-id",value:eo.id,onChange:e=>ei(0,{id:e.target.value})})]}),(0,n.jsxs)("div",{className:R.PI.fieldStack,children:[(0,n.jsx)(q.J,{htmlFor:"target-repo",children:"Target repo URL"}),(0,n.jsx)(J.p,{id:"target-repo",value:eo.targetRepo,onChange:e=>ei(0,{targetRepo:e.target.value}),className:v?"border-destructive/60":void 0}),v?(0,n.jsx)("p",{className:R.PI.secretHint,children:"Enter the target repo you actually intend to use. The app will not guess or invent a replacement repo for you."}):null]}),(0,n.jsxs)("div",{className:R.PI.fieldStack,children:[(0,n.jsx)(q.J,{htmlFor:"linear-projects",children:"Linear projects"}),(0,n.jsx)(J.p,{id:"linear-projects",value:null!=(i=eo.linearProjects)?i:"",onChange:e=>ei(0,{linearProjects:e.target.value}),placeholder:"Comma-separated"})]}),(0,n.jsxs)("div",{className:R.PI.fieldStack,children:[(0,n.jsx)(q.J,{htmlFor:"linear-teams",children:"Linear teams"}),(0,n.jsx)(J.p,{id:"linear-teams",value:null!=(l=eo.linearTeams)?l:"",onChange:e=>ei(0,{linearTeams:e.target.value}),placeholder:"Comma-separated"})]}),(0,n.jsxs)("div",{className:R.PI.fieldStack,children:[(0,n.jsx)(q.J,{htmlFor:"base-branch",children:"Base branch"}),(0,n.jsx)(J.p,{id:"base-branch",value:null!=(o=eo.baseBranch)?o:"",onChange:e=>ei(0,{baseBranch:e.target.value}),placeholder:"dev"})]}),(0,n.jsxs)("div",{className:R.PI.fieldStack,children:[(0,n.jsx)(q.J,{htmlFor:"production-branch",children:"Production branch"}),(0,n.jsx)(J.p,{id:"production-branch",value:null!=(c=eo.productionBranch)?c:"",onChange:e=>ei(0,{productionBranch:e.target.value}),placeholder:"main"})]}),(0,n.jsxs)("div",{className:R.PI.fieldStack,children:[(0,n.jsx)(q.J,{htmlFor:"preview-provider",children:"Preview provider"}),(0,n.jsx)(J.p,{id:"preview-provider",value:null!=(d=eo.previewProvider)?d:"",onChange:e=>ei(0,{previewProvider:e.target.value}),placeholder:"vercel"})]}),(0,n.jsxs)("div",{className:R.PI.fieldStack,children:[(0,n.jsx)(q.J,{htmlFor:"integration-preview-url",children:"Integration preview URL"}),(0,n.jsx)(J.p,{id:"integration-preview-url",value:null!=(u=eo.integrationPreviewUrl)?u:"",onChange:e=>ei(0,{integrationPreviewUrl:e.target.value})})]}),(0,n.jsxs)("div",{className:R.PI.fieldStack,children:[(0,n.jsx)(q.J,{htmlFor:"production-url",children:"Production URL"}),(0,n.jsx)(J.p,{id:"production-url",value:null!=(p=eo.productionUrl)?p:"",onChange:e=>ei(0,{productionUrl:e.target.value})})]}),(0,n.jsxs)("div",{className:R.PI.fieldStack,children:[(0,n.jsx)(q.J,{htmlFor:"integration-success-status",children:"Integration success status"}),(0,n.jsx)(J.p,{id:"integration-success-status",value:null!=(m=eo.integrationSuccessStatus)?m:"",onChange:e=>ei(0,{integrationSuccessStatus:e.target.value}),placeholder:"Merged to Dev"})]}),(0,n.jsxs)("div",{className:R.PI.fieldStack,children:[(0,n.jsx)(q.J,{htmlFor:"production-success-status",children:"Production success status"}),(0,n.jsx)(J.p,{id:"production-success-status",value:null!=(h=eo.productionSuccessStatus)?h:"",onChange:e=>ei(0,{productionSuccessStatus:e.target.value}),placeholder:"Merged / Deployed"})]})]}),(0,n.jsxs)("div",{className:R.PI.fieldStack,children:[(0,n.jsx)(q.J,{htmlFor:"validation-commands",children:"Validation commands"}),(0,n.jsx)($.T,{id:"validation-commands",value:null!=(f=eo.validationCommands)?f:"",onChange:e=>ei(0,{validationCommands:e.target.value}),placeholder:"One command per line",rows:4})]})]})}var et=r(6240);function er(e){let{title:t,content:r,className:a}=e;return(0,n.jsxs)("div",{className:(0,V.cn)(R.Es.stackSm,a),children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:t}),(0,n.jsx)("pre",{className:(0,V.cn)(R.xp.previewPanel,"font-mono whitespace-pre-wrap"),children:null!=r?r:"No preview available."})]})}function en(e){let{envPreview:t,configPreview:r,validationError:a,variant:s="advanced",isLoading:i=!1}=e;return i?null:t||r||a?(0,n.jsxs)("div",{className:"space-y-4",children:[a?(0,n.jsx)("p",{className:"text-sm text-destructive",children:a}):null,t?(0,n.jsx)(er,{title:".env.local preview (redacted)",content:t}):null,r?(0,n.jsx)(er,{title:".harness/config.local.json preview",content:r}):null]}):"guided"===s?null:(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Generate a preview to review redacted local file changes before applying."})}var ea=r(1598);function es(e){let{plan:t,confirmed:r,onConfirmedChange:a,disabled:s=!1,disabledReason:i,variant:l="advanced",intent:o="create"}=e;return"guided"===l?(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsxs)("div",{className:"flex items-start gap-3",children:[(0,n.jsx)(ea.S,{id:"confirm-local-write-guided",checked:r,disabled:s,onChange:e=>a(e.target.checked)}),(0,n.jsx)(q.J,{htmlFor:"confirm-local-write-guided",className:"cursor-pointer text-sm leading-snug",children:"update"===o?"I understand this will update local setup files on this machine.":"I understand this will create local setup files on this machine."})]}),s&&i&&i.includes("validation")?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:i}):null]}):(0,n.jsxs)("div",{className:R.PI.confirmationBox,children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:"Confirm local file writes"}),(0,n.jsxs)("ul",{className:"list-disc space-y-1 pl-5 text-sm text-muted-foreground",children:[(0,n.jsxs)("li",{children:[".env.local — ",(null==t?void 0:t.envAction)==="update"?"update":"create"]}),(0,n.jsxs)("li",{children:[".harness/config.local.json —"," ",(null==t?void 0:t.configAction)==="update"?"update":"create"]}),(0,n.jsx)("li",{children:"Files are local, gitignored, and written only on this machine."}),(0,n.jsx)("li",{children:"No GitHub Actions secrets, target repo workflows, Linear writes, cloud workflow dispatch, tags, releases, settings, or live harness phases will run."})]}),(0,n.jsxs)("div",{className:"flex items-start gap-3",children:[(0,n.jsx)(ea.S,{id:"confirm-local-write",checked:r,disabled:s,onChange:e=>a(e.target.checked)}),(0,n.jsx)(q.J,{htmlFor:"confirm-local-write",className:"cursor-pointer text-sm leading-snug",children:"I reviewed the redacted preview and want to write these local setup files."})]}),s&&i?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:i}):null]})}function ei(e){let{className:t,...r}=e;return(0,n.jsx)("div",{className:(0,V.cn)("animate-pulse rounded-md bg-muted",t),...r})}function el(e){let{open:t,onOpenChange:r,isLoading:a,previewError:s,envPreview:i,configPreview:l,validationError:o,previewIsCurrent:c}=e;return(0,n.jsxs)("details",{open:t,className:"rounded-md border border-border bg-background p-3",children:[(0,n.jsx)("summary",{className:"cursor-pointer text-sm font-medium",onClick:e=>{e.preventDefault(),r(!t)},children:"Review generated files"}),(0,n.jsx)("div",{className:"mt-3 space-y-3",children:a?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Generating redacted local file changes…"}),(0,n.jsxs)("div",{className:"space-y-2","aria-hidden":"true",children:[(0,n.jsx)(ei,{className:"h-4 w-[60%]"}),(0,n.jsx)(ei,{className:"h-24 w-full"}),(0,n.jsx)(ei,{className:"h-4 w-[40%]"}),(0,n.jsx)(ei,{className:"h-32 w-full"})]})]}):s?(0,n.jsx)("p",{className:"text-sm text-destructive",children:s}):(0,n.jsx)(en,{variant:"guided",envPreview:c?i:void 0,configPreview:c?l:void 0,validationError:c?o:void 0})})]})}function eo(e){let{success:t,message:r,summary:a}=e;return(0,n.jsxs)("div",{className:"space-y-3 rounded-md border border-border p-4",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(D.W,{label:t?"Applied":"Failed",variant:t?"success":"destructive"}),(0,n.jsx)("p",{className:"text-sm font-medium",children:r})]}),t&&a?(0,n.jsxs)("dl",{className:"grid grid-cols-1 gap-3 text-sm md:grid-cols-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("dt",{className:"text-muted-foreground",children:"Local files present"}),(0,n.jsx)("dd",{children:a.overview.localFilesPresent?"Yes":"No"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("dt",{className:"text-muted-foreground",children:"Config resolved"}),(0,n.jsx)("dd",{children:a.overview.configResolved?"Yes":"No"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("dt",{className:"text-muted-foreground",children:"LINEAR_API_KEY"}),(0,n.jsx)("dd",{children:a.envKeyPresence.LINEAR_API_KEY?"Set":"Missing"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("dt",{className:"text-muted-foreground",children:"CURSOR_API_KEY"}),(0,n.jsx)("dd",{children:a.envKeyPresence.CURSOR_API_KEY?"Set":"Missing"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("dt",{className:"text-muted-foreground",children:"GITHUB_TOKEN"}),(0,n.jsx)("dd",{children:a.envKeyPresence.GITHUB_TOKEN?"Set":"Missing"})]})]}):null]})}var ec=r(2465);function ed(e){let{heading:t,explanation:r,continueLabel:a,onContinue:s,details:i}=e;return(0,n.jsxs)("div",{className:"space-y-4 rounded-md border border-emerald-500/40 bg-emerald-500/5 p-4","data-testid":"guided-step-success-panel",role:"status",children:[(0,n.jsxs)("div",{className:"flex items-start gap-3",children:[(0,n.jsx)("span",{className:"mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-full border border-emerald-600 text-sm font-semibold text-emerald-700 dark:border-emerald-400 dark:text-emerald-300","aria-hidden":"true",children:"✓"}),(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:t}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:r}),i&&i.length>0?(0,n.jsx)("ul",{className:"mt-2 list-disc space-y-1 pl-5 text-sm text-muted-foreground",children:i.map(e=>(0,n.jsx)("li",{children:e},e))}):null]})]}),(0,n.jsx)(F.$,{type:"button",onClick:s,children:a})]})}let eu=["Connecting to GitHub","Repository reconciliation","Object import","Commit creation","Push","Remote verification","Saving configuration"],ep={"Creating private workspace":1,"Preparing workspace snapshot":2,"Uploading workspace":3,"Verifying workspace":5,"Saving configuration":6},em=new Map(eu.map((e,t)=>[e,t])),eh={LINEAR_API_KEY:"linear",CURSOR_API_KEY:"cursor",GITHUB_TOKEN:"github",VERCEL_TOKEN:"vercel"},ef={LINEAR_API_KEY:"linearApiKey",CURSOR_API_KEY:"cursorApiKey",GITHUB_TOKEN:"githubToken",VERCEL_TOKEN:"vercelToken"};function eg(e){var t,r;let{mode:s="advanced",guidedStep:i,onGuidedStepChange:l,initialEnv:o,initialConfig:c,initialHarnessProvisioningSummary:d,highlightStaleDispatch:u=!1,highlightStaleTarget:p=!1,onSummaryUpdated:m,onHarnessProvisioningSummaryUpdated:h,onUiStateChange:f,onGuidedLocalApplySuccess:g,onConnectServicesComplete:v,onConnectServicesSucceeded:y,onContinue:x,onStepCompleted:w,localSetupFilesExist:b=!1}=e,k=(0,U.I)(),j=(0,a.useRef)(null),S=(0,a.useRef)(1),C=(0,a.useRef)({LINEAR_API_KEY:0,CURSOR_API_KEY:0,GITHUB_TOKEN:0,VERCEL_TOKEN:0}),N=(0,a.useRef)({}),[I,P]=(0,a.useState)("connect-services"),E=null!=i?i:I,[T,A]=(0,a.useState)({harnessConfigPath:o.harnessConfigPath,githubDispatchRepository:o.githubDispatchRepository||o.suggestedHarnessDispatchRepo||"",linearApiKey:"",cursorApiKey:"",githubToken:"",vercelToken:""}),[_,K]=(0,a.useState)(c),[O,L]=(0,a.useState)(()=>(0,X.Kj)(c,S.current)),[H,B]=(0,a.useState)(o.secretPresence),[D,V]=(0,a.useState)(()=>(0,X.FE)(o.serviceConnectionSummaries)),[J,q]=(0,a.useState)(null),[$,z]=(0,a.useState)({}),[Z,er]=(0,a.useState)(null),[ea,ei]=(0,a.useState)({state:"unchecked"}),[eg,ev]=(0,a.useState)(null),[ey,ex]=(0,a.useState)(null),[ew,eb]=(0,a.useState)(null),[ek,ej]=(0,a.useState)(!1),[eS,eC]=(0,a.useState)(null),[eN,eR]=(0,a.useState)(null),[eI,eP]=(0,a.useState)(!1),[eE,eT]=(0,a.useState)([]),[eA,e_]=(0,a.useState)(!1),[eK,eO]=(0,a.useState)([]),eL=(0,a.useRef)(null),eF=(0,a.useRef)(null),[eH,eB]=(0,a.useState)(!1),[eD,eU]=(0,a.useState)(!1),[eG,eV]=(0,a.useState)(null),[eM,eW]=(0,a.useState)(null),[eY,eJ]=(0,a.useState)(!1),[eq,e$]=(0,a.useState)(null),[ez,eZ]=(0,a.useState)(null),[eX,eQ]=(0,a.useState)(null),[e0,e1]=(0,a.useState)(null),[e2,e3]=(0,a.useState)(null),[e4,e6]=(0,a.useState)("create"),[e5,e7]=(0,a.useState)(null),[e8,e9]=(0,a.useState)(!1),te=(0,a.useMemo)(()=>({..._,repos:(0,X.ai)(O)}),[_,O]),tt=(0,a.useMemo)(()=>"guided"===s?function(e){if(!e.repos.length)return e;let t=function(e){let t=new Set,r=[];for(let n of e){let e=n.id.trim()||function(e){var t;let r=e.trim().match(/^https:\/\/github\.com\/[A-Za-z0-9_.-]+\/([A-Za-z0-9_.-]+)\/?$/);return null!=(t=null==r?void 0:r[1])?t:""}(n.targetRepo)||"target-repo",a=e,s=2;for(;t.has(a);)a="".concat(e,"-").concat(s),s+=1;t.add(a),r.push(a)}return r}(e.repos);return{...e,repos:e.repos.map((e,r)=>{var n;return{...e,id:null!=(n=t[r])?n:e.id}})}}(te):_,[_,te,s]),tr=(0,a.useMemo)(()=>({env:T,config:tt}),[T,tt]),tn=null!==eG&&null!==eM&&JSON.stringify(eM)===JSON.stringify(tr);(0,a.useEffect)(()=>{"guided"===s&&void 0!==i&&P(i)},[i,s]),(0,a.useEffect)(()=>()=>{for(let e of Object.values(N.current))null==e||e.controller.abort()},[]),(0,a.useEffect)(()=>{null==f||f({localPreviewStale:null!==eG&&!tn})},[f,eG,tn]);let ta=(0,a.useCallback)(e=>{if(l)return void l(e);P(e)},[l]);(0,a.useCallback)(e=>{ta(e),requestAnimationFrame(()=>{var e;null==(e=j.current)||e.scrollIntoView({block:"start",behavior:k?"auto":"smooth"})})},[k,ta]);let ts=e=>(function(e){if(!e.presence[e.key]||"connected"!==e.verification[e.key].state)return!1;let t=e.envValues[ef[e.key]].trim();return!t||(0,X.Mz)(e.verification[e.key],t)})({key:e,presence:H,verification:D,envValues:T}),ti=ts("LINEAR_API_KEY")&&ts("CURSOR_API_KEY")&&ts("GITHUB_TOKEN")&&ts("VERCEL_TOKEN"),tl=H.LINEAR_API_KEY&&H.CURSOR_API_KEY&&H.GITHUB_TOKEN&&H.VERCEL_TOKEN,to="guided"===s&&"choose-target-repos"===E,tc=(0,a.useMemo)(()=>(0,X.TW)({typedToken:T.githubToken,hasSavedToken:H.GITHUB_TOKEN}),[T.githubToken,H.GITHUB_TOKEN]);tt.repos.length>0&&tt.repos;let td=O.every(e=>Q.test(e.targetRepo.trim())),tu=O.every(e=>{var t;return(0,X.bE)($[e.rowId],e.targetRepo.trim(),null!=(t=null==tc?void 0:tc.fingerprint)?t:null)}),tp=T.githubDispatchRepository.trim()||(null==(t=o.savedHarnessDispatchRepository)?void 0:t.trim())||"",tm=G(tp,ew),th=function(e){let t=e.effectiveRepo.trim();if(!t)return!1;if(G(t,e.step1TrustedRepo)||(null==(r=e.serverValidatedRepo)?void 0:r.trim())===t)return!0;var r,n={effectiveRepo:t,verificationState:e.manualVerification.state,verifiedRepo:e.manualVerification.verifiedRepo,activeGithubTokenFingerprint:e.activeGithubTokenFingerprint,verifiedGithubTokenFingerprint:e.manualVerification.verifiedGithubTokenFingerprint};let a=n.effectiveRepo.trim();return!!a&&"connected"===n.verificationState&&n.verifiedRepo===a&&(!n.activeGithubTokenFingerprint||n.verifiedGithubTokenFingerprint===n.activeGithubTokenFingerprint)}({effectiveRepo:tp,step1TrustedRepo:ew,serverValidatedRepo:ey,manualVerification:ea,activeGithubTokenFingerprint:null!=(r=null==tc?void 0:tc.fingerprint)?r:null});(0,a.useEffect)(()=>{if("guided"!==s||"choose-target-repos"!==E)return;let e=!1;return(async()=>{try{let t=await fetch("/api/setup/harness-provisioning-summary"),r=await t.json();if(!t.ok||e)return;r.verifiedSavedRepo&&r.harnessDispatchRepo?(eb(r.harnessDispatchRepo),ex(r.harnessDispatchRepo),A(e=>({...e,githubDispatchRepository:r.harnessDispatchRepo})),r.connectedAutomatically&&ev(r.harnessDispatchRepo),ei({state:"connected",verifiedRepo:r.harnessDispatchRepo,message:r.message})):(ex(null),eb(null))}catch(t){e||(ex(null),eb(null))}})(),()=>{e=!0}},[E,s]),(0,a.useEffect)(()=>{if("guided"!==s||"choose-target-repos"!==E)return;if(!H.GITHUB_TOKEN)return void e7(null);let e=!1;return e9(!0),(async()=>{try{let t=await fetch("/api/setup/verify-service",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({service:"github"})}),r=await t.json();if(e)return;t.ok&&"connected"===r.status&&r.label?e7(String(r.label)):e7(null)}catch(t){e||e7(null)}finally{e||e9(!1)}})(),()=>{e=!0}},[E,s,H.GITHUB_TOKEN]),(0,a.useEffect)(()=>{ey||eg||ew||ei({state:"unchecked"})},[null==tc?void 0:tc.fingerprint,eg,ey,ew]);let tf=(0,a.useCallback)(async()=>{var e,t,r,n,a,s,i;let l,c=e=>{eT(e),eP(!0),null==y||y()};if("verified-and-persisted"===d.state||"skipped-source-mode"===d.state||"skipped-not-packaged"===d.state){let e=d.harnessDispatchRepo;e&&(eb(e),ex(e),ei({state:"connected",verifiedRepo:e,message:d.message})),c([e?"Workspace reconnected: ".concat(e):"Workspace already verified","Configuration saved"]);return}ej(!0),eR(null),eP(!1),eT([]);let u=null!=(e=eL.current)?e:"undefined"!=typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():"provision-".concat(Date.now(),"-").concat(Math.random().toString(16).slice(2));eL.current=u,eF.current=performance.now(),eC(eu[0]);try{let e,p=await fetch("/api/setup/preview-harness-repo-provisioning",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operationId:u})}),f=await p.json();if(!p.ok)throw Error(null!=(t=f.error)?t:"Provisioning preview failed");if("skipped-not-packaged"===f.state){let e=T.githubDispatchRepository.trim()||(null==(r=o.savedHarnessDispatchRepository)?void 0:r.trim())||(null==(n=o.suggestedHarnessDispatchRepo)?void 0:n.trim())||"";e&&(eb(e),ex(e)),null==h||h({...d,state:"skipped-not-packaged",harnessDispatchRepo:e||null,message:f.message,recoverable:!1}),c([e?"Workspace reconnected: ".concat(e):"Workspace setup skipped for source mode","Configuration saved"]);return}l=setInterval(()=>{fetch("/api/setup/harness-provisioning-progress").then(async e=>{if(!e.ok)return;let t=await e.json();if(t.uiPhaseLabel){let e="number"==typeof t.completed&&"number"==typeof t.total&&t.total>0?" (".concat(t.completed,"/").concat(t.total,")"):"";eC("".concat(t.uiPhaseLabel).concat(e))}}).catch(()=>{})},1e3);let g=new AbortController,v=setTimeout(()=>g.abort(),18e4);try{e=await fetch("/api/setup/apply-harness-repo-provisioning",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({confirmed:!0,fingerprint:f.fingerprint,operationId:null!=(a=f.operationId)?a:u}),signal:g.signal})}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return void eR("Workspace setup timed out after ".concat(Math.round(180),"s. Operation ID: ").concat(f.operationId,". Retry Step 1 Continue to resume or reconcile — the repository may already exist."));throw e}finally{clearTimeout(v)}let y=await e.json();if(!e.ok)throw Error(null!=(s=y.error)?s:"Provisioning apply failed");if("verified-and-persisted"!==y.apply.state){if(y.apply.recoverable){let e=y.apply.uiPhaseLabel?" (".concat(y.apply.uiPhaseLabel,")"):"",t=y.apply.operationId?" Operation ID: ".concat(y.apply.operationId,"."):" Operation ID: ".concat(f.operationId,".");eR("".concat(y.apply.message).concat(e,".").concat(t," Retry will resume or reconcile."));return}throw Error(null!=(i=y.apply.message)?i:"Harness workspace provisioning did not complete.")}let x=y.apply.harnessDispatchRepo;x&&(eb(x),ev(x),A(e=>({...e,githubDispatchRepository:x})),ei({state:"connected",verifiedRepo:x,message:y.apply.message})),null==h||h({...d,state:y.apply.state,harnessDispatchRepo:x,message:y.apply.message,recoverable:y.apply.recoverable,verifiedSavedRepo:"verified-and-persisted"===y.apply.state,connectedAutomatically:!!x}),null==m||m(y.summary);try{let e=await fetch("/api/setup/harness-provisioning-summary"),t=await e.json();e.ok&&(null==h||h(t))}catch(e){}eC(y.apply.message);let w=null!==eF.current?Math.round(performance.now()-eF.current):void 0;c([x?"Workspace created or reconnected: ".concat(x):"Workspace verified","Snapshot uploaded","Workspace verified","Configuration saved",...void 0!==w?["Browser click-to-success: ".concat(w,"ms")]:[]])}catch(e){eR(e instanceof Error?e.message:"Harness workspace provisioning failed")}finally{l&&clearInterval(l),ej(!1)}},[T.githubDispatchRepository,o.savedHarnessDispatchRepository,o.suggestedHarnessDispatchRepo,d,y,h,m]),tg=()=>{e3(null),e1(null),eQ(null)},tv=(0,a.useCallback)(()=>{tg(),eV(null),eW(null),eZ(null),eJ(!1),e_(!1),eO([])},[]),ty=e=>{V(t=>({...t,[e]:{state:"unchecked"}}))},tx=(0,a.useCallback)(()=>{z({})},[]),tw=(0,a.useCallback)(e=>{z(t=>{let r={...t};for(let n of e){let e=t[n.rowId];if(!e)continue;let a=n.targetRepo.trim();e.verifiedTargetRepo&&e.verifiedTargetRepo!==a?r[n.rowId]={state:"unchecked"}:e.attemptedTargetRepo&&e.attemptedTargetRepo!==a&&(r[n.rowId]={state:"unchecked"})}return r})},[]),tb=(0,a.useCallback)(async e=>{var t,r;let n=await fetch("/api/setup/preview-connect-services",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)}),a=await n.json();if(!n.ok)throw Error(null!=(t=a.error)?t:"Preview failed");let s=await fetch("/api/setup/apply-connect-services",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:T,confirmed:!0,fingerprint:a.fingerprint})}),i=await s.json();if(!s.ok)throw Error(null!=(r=i.error)?r:"Save failed");null==m||m(i.summary),B({LINEAR_API_KEY:i.summary.envKeyPresence.LINEAR_API_KEY,CURSOR_API_KEY:i.summary.envKeyPresence.CURSOR_API_KEY,GITHUB_TOKEN:i.summary.envKeyPresence.GITHUB_TOKEN,VERCEL_TOKEN:i.summary.envKeyPresence.VERCEL_TOKEN}),A(t=>({...t,[ef[e]]:""}))},[T,m]),tk=(0,a.useCallback)(async(e,t)=>{let r=T[ef[e]].trim(),n=r?(0,X.ar)(r):void 0,a=r?"typed:".concat(n):"saved",s=N.current[e];if((null==s?void 0:s.requestKey)===a)return s.promise;null==s||s.controller.abort();let i=new AbortController,l=C.current[e]+1;C.current[e]=l,q(e),V(t=>({...t,[e]:{state:"checking"}}));let o=(async()=>{let a=await fetch("/api/setup/verify-service",{method:"POST",headers:{"Content-Type":"application/json"},signal:i.signal,body:JSON.stringify({service:eh[e],...r?{token:r}:{}})}),s=await a.json();if(!a.ok){var o;throw Error(null!=(o=s.error)?o:"Verification failed")}if(C.current[e]===l){if("connected"!==s.status)return void V(t=>({...t,[e]:{state:"failed",attemptedValueFingerprint:n,message:s.message,limitation:s.limitation,label:s.label}}));r&&t.saveOnConnected&&await tb(e),C.current[e]===l&&V(t=>({...t,[e]:{state:"connected",verifiedValueFingerprint:n,message:s.message,limitation:s.limitation,label:s.label}}))}})();N.current[e]={requestKey:a,id:l,controller:i,promise:o};try{await o}catch(t){if(i.signal.aborted||C.current[e]!==l)return;V(r=>({...r,[e]:{state:"failed",attemptedValueFingerprint:n,message:t instanceof Error?t.message:"Verification failed"}}))}finally{var c;(null==(c=N.current[e])?void 0:c.id)===l&&delete N.current[e],C.current[e]===l&&q(null)}},[T,tb]),tj=(0,a.useCallback)(async e=>{await tk(e,{saveOnConnected:!0})},[tk]);(0,a.useEffect)(()=>{if("guided"===s&&"connect-services"===E)for(let e of Object.keys(ef))(function(e){var t;if(!e.presence[e.key]||e.envValues[ef[e.key]].trim()||"unchecked"!==e.verification[e.key].state)return!1;let r=null==(t=e.summaries[e.key])?void 0:t.status;return void 0===r||"missing"===r||"unknown"===r||"stale"===r})({key:e,presence:H,envValues:T,summaries:o.serviceConnectionSummaries,verification:D})&&tk(e,{saveOnConnected:!1})},[T,E,o.serviceConnectionSummaries,s,H,tk,D]);let tS=(0,a.useCallback)(async e=>{var t,r;let n=e.trim(),a=(0,X.TW)({typedToken:T.githubToken,hasSavedToken:H.GITHUB_TOKEN}),s=null!=(t=null==a?void 0:a.fingerprint)?t:null;eB(!0),ei({state:"checking"});try{let e=await fetch("/api/setup/verify-harness-repo",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({harnessDispatchRepo:n,...(null==a?void 0:a.tokenForRequest)?{githubToken:a.tokenForRequest}:{}})}),t=await e.json();if(!e.ok)throw Error(null!=(r=t.error)?r:"Harness repo verification failed");"connected"===t.status&&t.repoSlug?(tv(),A(e=>({...e,githubDispatchRepository:t.repoSlug})),ei({state:"connected",verifiedRepo:t.repoSlug,verifiedGithubTokenFingerprint:null!=s?s:void 0,message:t.message,limitation:t.limitation})):ei({state:"failed",message:t.message,limitation:t.limitation})}catch(e){ei({state:"failed",message:e instanceof Error?e.message:"Harness repo verification failed"})}finally{eB(!1)}},[T.githubToken,tv,H.GITHUB_TOKEN]),tC=(0,a.useCallback)(async e=>{var t,r;let n=O.find(t=>t.rowId===e);if(!n)return;let a=n.targetRepo.trim(),s=(0,X.TW)({typedToken:T.githubToken,hasSavedToken:H.GITHUB_TOKEN}),i=null!=(t=null==s?void 0:s.fingerprint)?t:null;er(e),z(t=>({...t,[e]:{state:"checking"}}));try{let t=await fetch("/api/setup/verify-target-repo",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({targetRepo:a,...(null==s?void 0:s.tokenForRequest)?{githubToken:s.tokenForRequest}:{}})}),n=await t.json();if(!t.ok)throw Error(null!=(r=n.error)?r:"Repo verification failed");z(t=>({...t,[e]:"connected"===n.status&&!1!==n.workflowInstallReady?{state:"connected",verifiedTargetRepo:a,verifiedGithubTokenFingerprint:null!=i?i:void 0,message:n.message,repoSlug:n.repoSlug,limitation:n.limitation,workflowInstallReady:n.workflowInstallReady}:{state:"failed",attemptedTargetRepo:a,attemptedGithubTokenFingerprint:null!=i?i:void 0,message:n.message,repoSlug:n.repoSlug,limitation:n.limitation,workflowInstallReady:n.workflowInstallReady}}))}catch(t){z(r=>({...r,[e]:{state:"failed",attemptedTargetRepo:a,attemptedGithubTokenFingerprint:null!=i?i:void 0,message:t instanceof Error?t.message:"Repo verification failed"}}))}finally{er(null)}},[T.githubToken,O,H.GITHUB_TOKEN]),tN=(0,a.useCallback)(e=>{var t,r,n;tv();let a=null!=(r=null==(t=O[0])?void 0:t.rowId)?r:(0,X.mD)(S.current);L([{rowId:a,id:e.resultingTargetRepoConfigId,targetRepo:e.repositoryUrl,baseBranch:"dev",productionBranch:"main",previewProvider:"none"}]),K(t=>({...t,repos:[{id:e.resultingTargetRepoConfigId,targetRepo:e.repositoryUrl,baseBranch:"dev",productionBranch:"main",previewProvider:"none"}]})),z({[a]:{state:"connected",verifiedTargetRepo:e.repositoryUrl,verifiedGithubTokenFingerprint:null!=(n=null==tc?void 0:tc.fingerprint)?n:void 0,message:"Repository created and ready for local config.",repoSlug:e.repositoryFullName,workflowInstallReady:!1}}),e6("connect")},[null==tc?void 0:tc.fingerprint,O,tv]),tR=(0,a.useCallback)(e=>{let t=T[ef[e]].trim();t&&((0,X.Mz)(D[e],t)||tj(e))},[T,D,tj]),tI=(0,a.useCallback)(e=>{var t;let r=O.find(t=>t.rowId===e);r&&Q.test(r.targetRepo.trim())&&((0,X.bE)($[e],r.targetRepo.trim(),null!=(t=null==tc?void 0:tc.fingerprint)?t:null)||tC(e))},[null==tc?void 0:tc.fingerprint,O,$,tC]),tP=(0,a.useCallback)(async()=>{let e=await fetch("/api/setup/preview-local-files",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(tr)}),t=await e.json();if(!e.ok){var r;throw Error(null!=(r=t.error)?r:"Preview failed")}return eV(t),eW(tr),t},[tr]),tE=(0,a.useCallback)(async()=>{e$("preview"),eZ(null),eJ(!1);try{await tP(),eU(!0)}catch(e){eV(null),eW(null),eZ(e instanceof Error?e.message:"Preview failed"),eU(!0)}finally{e$(null)}},[tP]),tT=(0,a.useCallback)(e=>{eU(e),e&&!tn&&"preview"!==eq&&tE()},[tE,eq,tn]),tA=async()=>{if(to){if(!eY)return}else if(!eG||!tn||!eY)return;e$("apply"),tg();try{let t=to?tn&&eG?eG:await tP():eG;if(!t)throw Error("Preview failed");if(t.validationError)throw Error(t.validationError);let r=await fetch("/api/setup/apply-local-files",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...tr,confirmed:!0,fingerprint:t.fingerprint})}),n=await r.json();if(!r.ok){var e;throw Error(null!=(e=n.error)?e:"Apply failed")}null==m||m(n.summary),B({LINEAR_API_KEY:n.summary.envKeyPresence.LINEAR_API_KEY,CURSOR_API_KEY:n.summary.envKeyPresence.CURSOR_API_KEY,GITHUB_TOKEN:n.summary.envKeyPresence.GITHUB_TOKEN,VERCEL_TOKEN:n.summary.envKeyPresence.VERCEL_TOKEN}),A(e=>({...e,linearApiKey:"",cursorApiKey:"",githubToken:"",vercelToken:""})),eV(null),eW(null),eJ(!1),eU(!1),"guided"===s?(e_(!0),eO([b?"Local setup files updated on this machine.":"Local setup files created on this machine.",".env.local and .harness/config.local.json are ready."]),null==g||g(),null==w||w()):(e3(!0),e1(n.summary))}catch(e){e3(!1),eQ(e instanceof Error?e.message:"Apply failed")}finally{e$(null)}},t_=async()=>{await tA()},tK=null!==eq?"Wait for the current action to finish.":void 0,tO=tn?(null==eG?void 0:eG.validationError)?"Fix validation errors before confirming this write.":void 0:"Generate a preview before you can confirm this write.",tL=(null==eG?void 0:eG.validationError)?"Fix validation errors before confirming this write.":void 0,tF=null!=tO?tO:eY?void 0:"Confirm that you understand local setup files will be created on this machine.",tH=null===eq&&tl&&td&&tu&&th&&eY,tB=null!==eq?"Wait for the current action to finish.":tl?td?tu?th?eY?(null==eG?void 0:eG.validationError)?"Fix validation errors before creating setup files.":void 0:"Confirm that you understand local setup files will be ".concat(b?"updated":"created"," on this machine."):tp?"Verify and use your harness repo before creating local setup files.":"Complete Step 1 harness workspace setup before creating local setup files.":"Verify access for each target repo before ".concat(b?"updating":"creating"," setup files."):"Enter a valid GitHub target repo URL for each repo row to continue.":"Complete Step 1 service setup before creating local files.",tD=b?"Update local setup files":"Create local setup files",tU=b?"Updating…":"Creating…",tG=ek?function(e){if(!e)return 0;let t=eu.find(t=>e.startsWith(t));if(t){var r;return null!=(r=em.get(t))?r:0}let n=Object.entries(ep).find(t=>{let[r]=t;return e.startsWith(r)});return n?n[1]:0}(eS):eu.length;return"guided"===s?(0,n.jsxs)("div",{className:R.Es.section,children:[(0,n.jsx)("div",{ref:j}),(()=>{switch(E){case"connect-services":return(0,n.jsxs)(W.i,{title:"Step 1 of ".concat(7," \xb7 Connect services"),description:"Add the API keys the harness needs on this machine.",children:[(0,n.jsx)(Y.A,{values:T,presence:H,variant:"guided-services",verification:D,verifyingKey:J,onChange:e=>{tv(),eP(!1),eT([]),A(e),e.linearApiKey!==T.linearApiKey&&ty("LINEAR_API_KEY"),e.cursorApiKey!==T.cursorApiKey&&ty("CURSOR_API_KEY"),e.githubToken!==T.githubToken&&(ty("GITHUB_TOKEN"),tx()),e.vercelToken!==T.vercelToken&&ty("VERCEL_TOKEN")},onVerifyService:tj,onServiceBlur:tR}),ek?(0,n.jsx)(ec.M,{phases:(0,ec.y)({labels:[...eu],activeIndex:tG}),supportingText:null!=eS?eS:eu[0]}):null,ek||eI?null:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:R.PI.actions,children:(0,n.jsx)(F.$,{type:"button",onClick:()=>{tf()},disabled:!ti,children:"Set up workspace"})}),ti?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"p-dev will use your GitHub token to create or reconnect your private `p-dev-harness` workspace before continuing."}):(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Verify and save each service key above. Continue unlocks after all four services are verified and saved locally."})]}),!ek&&eI?(0,n.jsx)(ed,{heading:"Workspace setup verified",explanation:"Your private harness workspace and local service configuration are ready.",details:eE,continueLabel:"Continue to Linear workspace",onContinue:null!=v?v:()=>void 0}):null,eN?(0,n.jsx)("p",{className:"text-sm text-destructive",children:eN}):null]});case"choose-target-repos":var e;return(0,n.jsxs)(W.i,{title:"Step 4 of ".concat(7," \xb7 Choose target repo(s) and create setup files"),description:"Create a new product repository or connect an existing GitHub repo, then preview and confirm local setup files on this machine.",children:[(0,n.jsx)(ee,{values:te,highlightStaleTarget:p,variant:"guided-minimal",guidedSection:"harness",harnessDispatchRepository:T.githubDispatchRepository,savedHarnessDispatchRepository:o.savedHarnessDispatchRepository,suggestedHarnessDispatchRepo:o.suggestedHarnessDispatchRepo,harnessRepoVerification:ea,verifyingHarnessRepo:eH,onHarnessDispatchRepositoryChange:e=>{tv(),ei({state:"unchecked"}),A(t=>({...t,githubDispatchRepository:e}))},onVerifyAndUseHarnessRepo:e=>{tS(e)},harnessConnectedAutomatically:eg===tp&&ey===tp&&!!tp,harnessRepoInheritedFromStep1:tm,onChange:e=>{tv(),K(e)}}),(0,n.jsx)(et.A,{mode:e4,onModeChange:e6,githubOwner:e5,githubOwnerLoading:e8,onRepoCreated:tN,onInvalidatePreview:tv,connectContent:(0,n.jsx)(ee,{values:te,highlightStaleTarget:p,variant:"guided-minimal",guidedSection:"target-repos",guidedRepos:O,repoVerification:$,verifyingRepoRowId:Z,onChange:e=>{tv(),K(e)},onGuidedReposChange:e=>{tv(),tw(e),L(e)},onVerifyRepo:tC,onRepoBlur:tI,activeGithubTokenFingerprint:null!=(e=null==tc?void 0:tc.fingerprint)?e:null,onAddRepo:()=>{tv(),S.current+=1;let e=(0,X.mD)(S.current);L(t=>[...t,{rowId:e,id:"",targetRepo:""}])},onRemoveRepo:e=>{tv(),L(t=>t.filter(t=>t.rowId!==e)),z(t=>{let r={...t};return delete r[e],r})}})}),(0,n.jsx)(M,{className:"my-6"}),(0,n.jsxs)("div",{className:"rounded-md border border-border bg-muted/20 p-4 space-y-3",children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:tD}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:b?"Local gitignored setup files already exist on this machine. Preview the changes, confirm, and update `.env.local` and `.harness/config.local.json`.":"This is the point where the app writes local gitignored setup files to this machine: `.env.local` and `.harness/config.local.json`."}),(0,n.jsx)(el,{open:eD,onOpenChange:tT,isLoading:"preview"===eq,previewError:null!=ez?ez:void 0,envPreview:tn?null==eG?void 0:eG.envPreview:void 0,configPreview:tn?null==eG?void 0:eG.configPreview:void 0,validationError:tn?null==eG?void 0:eG.validationError:void 0,previewIsCurrent:tn}),(0,n.jsx)(es,{variant:"guided",intent:b?"update":"create",plan:tn?null==eG?void 0:eG.plan:void 0,confirmed:eY,disabled:!!(null==eG?void 0:eG.validationError),disabledReason:tL,onConfirmedChange:eJ})]}),(0,n.jsx)("div",{className:R.PI.actions,children:(0,n.jsx)(F.$,{type:"button",onClick:t_,disabled:!tH||eA,"data-primary-preview-button":"true",children:"apply"===eq?tU:tD})}),tH||!tB||eA?null:(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:tB}),eA?(0,n.jsx)(ed,{heading:b?"Local setup files updated":"Local setup files created",explanation:"Your target repo configuration and local gitignored setup files are ready on this machine.",details:eK,continueLabel:"Continue to local readiness",onContinue:null!=x?x:()=>void 0}):null]})}})(),eX?(0,n.jsx)(eo,{success:!1,message:eX}):null]}):(0,n.jsxs)("div",{className:R.Es.section,children:[(0,n.jsx)(W.i,{title:"Environment (.env.local)",description:"Edit local env keys. Existing secret values are never shown.",children:(0,n.jsx)(Y.A,{values:T,presence:H,highlightDispatchRepo:u,variant:"advanced",onChange:e=>{tv(),A(e)}})}),(0,n.jsx)(W.i,{title:"Target repo config",description:"Guided fields for .harness/config.local.json.",children:(0,n.jsx)(ee,{values:_,highlightStaleTarget:p,variant:"advanced",onChange:e=>{tv(),K(e)}})}),(0,n.jsxs)(W.i,{title:"Preview local changes",description:"Required before apply. Secret values are redacted in previews.",children:[(0,n.jsx)(en,{envPreview:tn?null==eG?void 0:eG.envPreview:void 0,configPreview:tn?null==eG?void 0:eG.configPreview:void 0,validationError:tn?null==eG?void 0:eG.validationError:void 0}),(0,n.jsx)("div",{className:R.PI.actions,children:(0,n.jsx)(F.$,{type:"button",onClick:tE,disabled:null!==eq,"data-primary-preview-button":"true",children:"preview"===eq?"Generating preview…":"Preview setup files"})}),tK?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:tK}):null]}),(0,n.jsxs)(W.i,{title:"Confirm and apply",description:"Writes only local gitignored setup files through setup core.",children:[(0,n.jsx)(es,{plan:tn?null==eG?void 0:eG.plan:void 0,confirmed:eY,disabled:!tn||!!(null==eG?void 0:eG.validationError),disabledReason:tO,onConfirmedChange:eJ}),(0,n.jsx)("div",{className:R.PI.actions,children:(0,n.jsx)(F.$,{type:"button",onClick:tA,disabled:null!==eq||!tn||!eY||!!(null==eG?void 0:eG.validationError),children:"apply"===eq?"Creating…":"Create local setup files"})}),tF?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:tF}):null]}),eX?(0,n.jsx)(eo,{success:!1,message:eX}):null,null===e2||eX?null:(0,n.jsx)(eo,{success:e2,message:e2?"Local setup files were written successfully.":"Apply failed.",summary:null!=e0?e0:void 0})]})}var ev=r(6309),ey=r(100),ex=r(7368),ew=r(2700),eb=r(2462),ek=r(997);let ej=["Validating Linear plan","Creating or selecting team","Creating or selecting project","Configuring workflow statuses","Verifying Linear workspace"],eS=new Map(ej.map((e,t)=>[e,t]));function eC(e){var t,r,s,i,l,o,c,d,u,p,m,h,f,g,v,y,x,w,b,k,j,S,C,N,I,P;let{readiness:E,initialSummary:T,linearApiKeyConfigured:A,availableRepos:_,onSummaryUpdated:K,onUiStateChange:O,onContinue:L,onStepCompleted:H}=e,[B,U]=(0,a.useState)(T),[G,V]=(0,a.useState)(null),[M,Y]=(0,a.useState)([]),[$,z]=(0,a.useState)([]),[Z,X]=(0,a.useState)("existing"),[Q,ee]=(0,a.useState)(null!=(x=null==(r=B.controlPlane)||null==(t=r.linear)?void 0:t.teamId)?x:""),[et,er]=(0,a.useState)(null!=(w=null==(i=B.controlPlane)||null==(s=i.linear)?void 0:s.teamKey)?w:""),[en,ea]=(0,a.useState)(null!=(b=null==(o=B.controlPlane)||null==(l=o.linear)?void 0:l.teamName)?b:""),[es,ei]=(0,a.useState)("existing"),[el,eu]=(0,a.useState)(null!=(k=null==(d=B.controlPlane)||null==(c=d.linear)?void 0:c.projectId)?k:""),[ep,em]=(0,a.useState)(null!=(j=null==(p=B.controlPlane)||null==(u=p.linear)?void 0:u.projectName)?j:""),[eh,ef]=(0,a.useState)([]),[eg,eC]=(0,a.useState)(""),[eN,eR]=(0,a.useState)([]),[eI,eP]=(0,a.useState)([]),[eE,eT]=(0,a.useState)(""),[eA,e_]=(0,a.useState)("Linear workspace"),[eK,eO]=(0,a.useState)(!1),[eL,eF]=(0,a.useState)(!1),[eH,eB]=(0,a.useState)(null),[eD,eU]=(0,a.useState)(null),[eG,eV]=(0,a.useState)(null),[eM,eW]=(0,a.useState)(null),[eY,eJ]=(0,a.useState)(!1),[eq,e$]=(0,a.useState)(!1),[ez,eZ]=(0,a.useState)("setup"),[eX,eQ]=(0,a.useState)(!1),[e0,e1]=(0,a.useState)(null),[e2,e3]=(0,a.useState)(null),[e4,e6]=(0,a.useState)(null),[e5,e7]=(0,a.useState)(null),[e8,e9]=(0,a.useState)(!1),[te,tt]=(0,a.useState)(0),[tr,tn]=(0,a.useState)(null),ta=(0,a.useRef)(!1);(0,a.useEffect)(()=>{U(T)},[T]);let ts=(0,a.useMemo)(()=>(function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let n=new Map;for(let e of t)for(let t of null!=e?e:[])t.id.trim()&&t.targetRepo.trim()&&n.set(t.id,t);return[...n.values()]})(null==G?void 0:G.repos,_),[_,null==G?void 0:G.repos]);(0,a.useEffect)(()=>{var e;!eg&&(null==(e=ts[0])?void 0:e.id)&&eC(ts[0].id)},[eg,ts]);let ti=null!=(S=ts.find(e=>e.id===eg))?S:ts[0],tl=null!=(C=null==ti?void 0:ti.targetRepo)?C:"",to=null!=(N=null==ti?void 0:ti.id)?N:"",tc=!!(tl&&to),td=ts.length>0,tu="workspace"===ez?eM:eG,tp=null!==tu&&eY;(0,a.useEffect)(()=>{null==O||O({linearPreviewStale:null!==tu&&!tp})},[O,tu,tp]);let tm=null!=A?A:B.linearApiKeyConfigured,th=(0,a.useCallback)(()=>{e9(!1),e7(null)},[]),tf=(0,a.useCallback)(()=>{eV(null),eW(null),eJ(!1),e$(!1),th()},[th]);(0,a.useEffect)(()=>{if("apply"!==e0)return;let e=!1,t=async()=>{try{let t=await fetch("/api/setup/linear-setup-progress");if(!t.ok||e)return;let r=await t.json();if(!r.uiPhaseLabel)return;let n=eS.get(r.uiPhaseLabel);void 0!==n&&tt(r.completed?ej.length:n),tn(r.uiPhaseLabel)}catch(e){}};tt(0),tn(ej[0]),t();let r=window.setInterval(()=>void t(),500);return()=>{e=!0,window.clearInterval(r)}},[e0]);let tg=(0,a.useCallback)(async()=>{eU(null);try{let t=await fetch("/api/setup/linear-workspace-editor-state"),r=await t.json();if(!t.ok){var e;throw Error(null!=(e=r.error)?e:"Failed to load Linear workspace state")}V(r),Y(r.associations),r.workspaceId&&eT(r.workspaceId),r.workspaceName&&e_(r.workspaceName)}catch(e){eU(e instanceof Error?e.message:"Failed to load Linear workspace state")}},[]),tv=(0,a.useCallback)(async()=>{if(tm){eO(!1),eF(!0),eB(null);try{var e,t,r;let n=await fetch("/api/setup/linear-options"),a=await n.json();if(!n.ok)throw Error(null!=(e=a.error)?e:"Failed to load Linear teams and projects");eR(null!=(t=a.teams)?t:[]),eP(null!=(r=a.projects)?r:[]),a.workspaceId&&eT(String(a.workspaceId)),a.workspaceName&&e_(String(a.workspaceName))}catch(e){eR([]),eP([]),eB(e instanceof Error?e.message:"Failed to load Linear teams and projects")}finally{eO(!0),eF(!1)}}},[tm]);(0,a.useEffect)(()=>{tg(),tv()},[tg,tv]);let ty=(0,a.useMemo)(()=>(0,ex.gy)(M),[M]),tx=(0,a.useMemo)(()=>(0,ey.um)(M),[M]),tw=(0,a.useMemo)(()=>"create"!==Z&&Q?eI.filter(e=>0===e.teamIds.length||e.teamIds.includes(Q)):eI,[eI,Q,Z]),tb=tw.length>0,tk=eK&&"existing"===Z&&!tb;(0,a.useEffect)(()=>{if(!eK||"existing"!==Z)return;let e=""===el||tw.some(e=>e.id===el);if(tb){e||(eu(""),tf());return}"create"!==es&&ei("create"),""!==el&&eu(""),("create"!==es||""!==el)&&tf()},[tb,tf,eK,el,es,tw,Z]);let tj=(0,a.useCallback)(async()=>{e1("refresh");try{let t=await fetch("/api/setup/linear-summary"),r=await t.json();if(!t.ok){var e;throw Error(null!=(e=r.error)?e:"Linear summary refresh failed")}U(r),null==K||K(r),await tg()}catch(e){e3(e instanceof Error?e.message:"Linear summary refresh failed")}finally{e1(null)}},[tg,K]),tS=(0,a.useCallback)(()=>({team:{mode:Z,teamId:"existing"===Z?Q:void 0,teamKey:"create"===Z?et:void 0,teamName:"create"===Z?en:void 0},project:{mode:es,projectId:"existing"===es?el:void 0,projectName:"create"===es?ep:void 0,targetRepo:tl||void 0}}),[el,es,ep,tl,Q,et,Z,en]),tC=(0,a.useCallback)(e=>{var t;return{expectedCommittedFingerprint:null!=(t=null==G?void 0:G.expectedCommittedFingerprint)?t:"",workspaceId:eE||(null==G?void 0:G.workspaceId)||"",workspaceName:eA||(null==G?void 0:G.workspaceName)||"Linear workspace",requestedAssociations:e}},[G,eE,eA]),tN="existing"===Z?!!Q&&("existing"===es?eh.length>0||!!el:!!ep):!!(et&&en)&&("existing"===es?!!el:!!ep),tR=(0,a.useCallback)(()=>{if(tN){if(tf(),"existing"===Z&&"existing"===es){let e=eN.find(e=>e.id===Q);if(!e)return;let t=(eh.length>0?eh:el?[el]:[]).map(e=>eI.find(t=>t.id===e)).filter(e=>!!e);tc&&Y(r=>(0,ex.UY)({draft:r,workspaceId:eE||(null==G?void 0:G.workspaceId)||"",team:{id:e.id,key:e.key,name:e.name},projects:t.map(e=>({id:e.id,name:e.name})),targetRepo:tl,repoConfigId:to})),ef([]),el&&eu("");return}z(e=>[...e,{id:crypto.randomUUID(),workspaceId:eE||(null==G?void 0:G.workspaceId)||"",teamMode:Z,teamId:"existing"===Z?Q:void 0,teamKey:"create"===Z?et:void 0,teamName:"create"===Z?en:void 0,projectMode:es,projectId:"existing"===es?el:void 0,projectName:"create"===es?ep:void 0,targetRepo:tc?tl:"",repoConfigId:tc?to:""}]),ef([]),eu(""),em("")}},[tN,eh,null==G?void 0:G.workspaceId,tc,tf,el,es,ep,eI,to,tl,Q,et,Z,en,eN,eE]),tI=(0,a.useCallback)(async()=>{let e=[...M];for(let t of $){let r=await (0,ew.XC)({plan:{team:{mode:t.teamMode,teamId:t.teamId,teamKey:t.teamKey,teamName:t.teamName},project:{mode:t.projectMode,projectId:t.projectId,projectName:t.projectName,targetRepo:t.targetRepo||void 0}},fingerprint:(await (0,ew.PA)({team:{mode:t.teamMode,teamId:t.teamId,teamKey:t.teamKey,teamName:t.teamName},project:{mode:t.projectMode,projectId:t.projectId,projectName:t.projectName,targetRepo:t.targetRepo||void 0}})).fingerprint});if(!r.apply.verified)throw Error("Linear create apply finished without verification.");let n={workspaceId:t.workspaceId||eE||(null==G?void 0:G.workspaceId)||"",teamId:r.apply.team.id,teamKey:r.apply.team.key,teamName:r.apply.team.name,projectId:r.apply.project.id,projectName:r.apply.project.name,targetRepo:t.targetRepo,repoConfigId:t.repoConfigId};e=(0,ex.m5)({draft:e,association:n})}return z([]),Y(e),e},[null==G?void 0:G.workspaceId,M,$,eE]),tP=(0,a.useCallback)(async()=>{if(td&&M.length>0){let e=await (0,ew.b)(tC(M));if(e.validationError)throw Error(e.validationError);return eW(e),eV(null),eZ("workspace"),eJ(!0),e}if(1===M.length&&0===$.length){let e=M[0],t=await (0,ew.PA)({team:{mode:"existing",teamId:e.teamId},project:{mode:"existing",projectId:e.projectId}});return eV(t),eW(null),eZ("setup"),eJ(!0),t}let e=$[0],t=e?await (0,ew.PA)({team:{mode:e.teamMode,teamId:e.teamId,teamKey:e.teamKey,teamName:e.teamName},project:{mode:e.projectMode,projectId:e.projectId,projectName:e.projectName,targetRepo:e.targetRepo||void 0}}):await (0,ew.PA)(tS());return eV(t),eW(null),eZ("setup"),eJ(!0),t},[tS,tC,td,M,$]),tE=(0,a.useCallback)(async()=>{e1("preview"),e3(null),e6(null),th(),eQ(!1);try{await tP(),e$(!0)}catch(e){eV(null),eW(null),eJ(!1),e$(!0),e6(e instanceof Error?e.message:"Preview failed")}finally{e1(null)}},[th,tP]),tT=async()=>{if(eX&&null===e0&&!ta.current){ta.current=!0,e1("apply"),tt(0),tn(ej[0]),e3(null),th();try{let e=M;if($.length>0&&(e=await tI()),0===e.length)throw Error("Add at least one Linear team and project association before applying.");if(td){let t=tp&&"workspace"===ez&&eM?eM:await (0,ew.b)(tC(e));if(t.validationError)throw Error(t.validationError);let r=await (0,ew.xD)({plan:tC(e),fingerprint:t.fingerprint});if(!r.apply.verified)throw Error("Linear workspace apply finished, but post-apply verification did not pass.");U(r.summary),null==K||K(r.summary),null==H||H(),e9(!0),Y(e),e7(r.apply)}else if(1===e.length){let t=e[0],r=tp&&"setup"===ez&&eG?eG:await (0,ew.PA)({team:{mode:"existing",teamId:t.teamId},project:{mode:"existing",projectId:t.projectId}});if(r.validationError)throw Error(r.validationError);let n=await (0,ew.XC)({plan:{team:{mode:"existing",teamId:t.teamId},project:{mode:"existing",projectId:t.projectId}},fingerprint:r.fingerprint});if(!n.apply.verified)throw Error("Linear workspace apply finished, but post-apply verification did not pass.");e7(n.apply),U(n.summary),null==K||K(n.summary),null==H||H(),e9(!0)}else if($.length>0||tN){let t=tp&&"setup"===ez&&eG?eG:await (0,ew.PA)(tS());if(t.validationError)throw Error(t.validationError);let r=await (0,ew.XC)({plan:tS(),fingerprint:t.fingerprint});if(!r.apply.verified)throw Error("Linear workspace apply finished, but post-apply verification did not pass.");let n={workspaceId:eE||(null==G?void 0:G.workspaceId)||"",teamId:r.apply.team.id,teamKey:r.apply.team.key,teamName:r.apply.team.name,projectId:r.apply.project.id,projectName:r.apply.project.name,targetRepo:tl,repoConfigId:to},a=(0,ex.m5)({draft:e,association:n});Y(a),e7(r.apply),U(r.summary),null==K||K(r.summary),null==H||H(),e9(!0)}else throw Error("Configure at least one target repository before applying multiple Linear associations.");eV(null),eW(null),eJ(!1),e$(!1),eQ(!1),tt(ej.length),tn("Linear workspace verified."),tv(),await tg()}catch(e){e3(e instanceof Error?e.message:"Apply failed")}finally{ta.current=!1,e1(null)}}},tA=e8||(null==(m=E.steps.find(e=>"linear-workspace"===e.id))?void 0:m.status)==="complete"||B.workspace.configured,t_=M.length>0||$.length>0||tN,tK="apply"===e0;return(0,n.jsx)(W.i,{title:"Step 2 of ".concat(7," \xb7 Set up Linear workspace"),description:"Add one or more Linear team and project associations, review the draft list, then apply the initial workspace setup.",children:(0,n.jsx)("div",{className:R.Es.stackSm,children:tm?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(q.J,{htmlFor:"linear-team-mode",children:"Team"}),(0,n.jsxs)(eb.l,{id:"linear-team-mode",value:Z,onChange:e=>{X(e.target.value),tf()},disabled:tK,children:[(0,n.jsx)("option",{value:"existing",children:"Use existing team"}),(0,n.jsx)("option",{value:"create",children:"Create new team"})]}),"existing"===Z?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(eb.l,{value:Q,onChange:e=>{ee(e.target.value),eu(""),ef([]),tf()},disabled:tK||eL,children:[(0,n.jsx)("option",{value:"",children:"Select a team…"}),eN.map(e=>(0,n.jsxs)("option",{value:e.id,children:[e.name," (",e.key,")"]},e.id))]}),eL?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading Linear teams…"}):null,eL||0!==eN.length?null:(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"No Linear teams found for this API key."})]}):(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(J.p,{placeholder:"Team name",value:en,disabled:tK,onChange:e=>{ea(e.target.value),tf()}}),(0,n.jsx)(J.p,{placeholder:"Team key (e.g. ENG)",value:et,disabled:tK,onChange:e=>{er(e.target.value),tf()}})]})]}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(q.J,{htmlFor:"linear-project-mode",children:"Project"}),tk?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Create a new project for this Linear team."}):(0,n.jsxs)(eb.l,{id:"linear-project-mode",value:es,onChange:e=>{ei(e.target.value),tf()},disabled:tK,children:[(0,n.jsx)("option",{value:"existing",children:"Use existing project"}),(0,n.jsx)("option",{value:"create",children:"Create new project"})]}),tk||"existing"!==es?(0,n.jsx)(J.p,{placeholder:"Project name",value:ep,disabled:tK,onChange:e=>{em(e.target.value),tf()}}):(0,n.jsxs)(n.Fragment,{children:["existing"===Z&&Q?(0,n.jsx)("div",{className:"space-y-2 rounded-md border border-border/70 p-3",children:0===tw.length?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"No Linear projects are associated with this team."}):tw.map(e=>{let t=(0,ey.iF)({workspaceId:eE||(null==G?void 0:G.workspaceId)||"",teamId:Q,projectId:e.id}),r=ty.has(t);return(0,n.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,n.jsx)("input",{type:"checkbox",disabled:tK||r,checked:eh.includes(e.id),onChange:t=>{ef(r=>t.target.checked?[...r,e.id]:r.filter(t=>t!==e.id)),tf()}}),(0,n.jsxs)("span",{children:[e.name,r?" (already in draft)":""]})]},e.id)})}):(0,n.jsxs)(eb.l,{value:el,onChange:e=>{eu(e.target.value),tf()},disabled:tK||eL,children:[(0,n.jsx)("option",{value:"",children:"Select a project…"}),tw.map(e=>(0,n.jsx)("option",{value:e.id,children:e.name},e.id))]}),eL?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading Linear projects…"}):null]})]})]}),ts.length>0?(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(q.J,{htmlFor:"guided-linear-target-repo",children:"Target repository"}),(0,n.jsx)(eb.l,{id:"guided-linear-target-repo",value:eg,onChange:e=>{eC(e.target.value),tf()},disabled:tK,children:ts.map(e=>(0,n.jsx)("option",{value:e.id,children:e.targetRepo},e.id))})]}):(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Target repositories are not configured yet. You can still draft create selections here; they will map onto the first configured repo when harness config exists."}),(0,n.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:(0,n.jsx)(F.$,{type:"button",variant:"outline",size:"sm",onClick:tR,disabled:tK||!tN,children:"Add to draft"})}),eH?(0,n.jsx)("p",{className:"text-sm text-destructive",children:eH}):null,eD?(0,n.jsx)("p",{className:"text-sm text-destructive",children:eD}):null,(0,n.jsxs)("div",{className:"space-y-3 rounded-md border border-border/70 p-3",children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:"Draft associations"}),0===tx.size&&0===$.length?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"No Linear associations added yet."}):(0,n.jsxs)("div",{className:"space-y-3",children:[[...tx.entries()].map(e=>{var t,r,a;let[s,i]=e;return(0,n.jsxs)("div",{className:"rounded-md border border-border/70 p-3",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,n.jsxs)("p",{className:"text-sm font-medium",children:[(0,ey.W)({teamName:null==(t=i[0])?void 0:t.teamName,teamKey:null!=(a=null==(r=i[0])?void 0:r.teamKey)?a:s})," ","\xb7 ",i.length," project",1===i.length?"":"s"]}),(0,n.jsx)(F.$,{type:"button",variant:"outline",size:"sm",disabled:tK,onClick:()=>{Y(e=>(0,ex.Bw)(e,s)),tf()},children:"Remove team"})]}),(0,n.jsx)("ul",{className:"mt-2 space-y-2",children:i.map(e=>(0,n.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-2 rounded-md bg-muted/30 px-3 py-2 text-sm",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{children:e.projectName}),e.targetRepo?(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:e.targetRepo}):null]}),(0,n.jsx)(F.$,{type:"button",variant:"ghost",size:"sm",disabled:tK,onClick:()=>{Y(t=>(0,ex.df)(t,e)),tf()},children:"Remove"})]},(0,ey.iF)(e)))})]},s)}),$.length>0?(0,n.jsx)("ul",{className:"space-y-2",children:$.map(e=>(0,n.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-2 rounded-md bg-muted/20 px-3 py-2 text-sm",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{children:function(e){var t,r,n,a,s,i;let l="create"===e.teamMode?(0,ey.W)({teamName:e.teamName,teamKey:null!=(t=e.teamKey)?t:"key"}):(0,ey.W)({teamName:e.teamName,teamKey:null!=(n=null!=(r=e.teamKey)?r:e.teamId)?n:"Team"}),o="create"===e.projectMode?null!=(a=e.projectName)?a:"New project":null!=(i=null!=(s=e.projectName)?s:e.projectId)?i:"Project";return"".concat(l," \xb7 ").concat(o)}(e)}),(0,n.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Will be created on apply",e.targetRepo?" \xb7 ".concat(e.targetRepo):""]})]}),(0,n.jsx)(F.$,{type:"button",variant:"ghost",size:"sm",disabled:tK,onClick:()=>{z(t=>t.filter(t=>t.id!==e.id)),tf()},children:"Remove"})]},e.id))}):null]})]}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[B.workspace.configured?(0,n.jsx)(D.W,{label:"Team ".concat((0,ey.W)({teamName:null!=(I=null==(f=B.controlPlane)||null==(h=f.linear)?void 0:h.teamName)?I:null==(y=B.controlPlane)||null==(v=y.linearWorkspace)||null==(g=v.teams[0])?void 0:g.teamName,teamKey:null!=(P=B.workspace.teamKey)?P:""})," configured"),variant:"success"}):null,(0,n.jsx)(F.$,{type:"button",variant:"outline",size:"sm",onClick:()=>void tE(),disabled:null!==e0||!t_,children:"preview"===e0?"Previewing…":"Preview Linear setup"}),(0,n.jsx)(F.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>void tj(),disabled:null!==e0,children:"Refresh"})]}),eq&&tp&&tu?(0,n.jsxs)("div",{className:"rounded-md border border-border bg-muted/10 p-3 text-sm space-y-2",children:["workspace"===ez&&eM?(0,n.jsx)("pre",{className:"whitespace-pre-wrap font-sans text-sm",children:["Teams to add: ".concat(eM.impactSummary.teamsToAdd.join(", ")||"none"),"Projects to add: ".concat(eM.impactSummary.projectsToAdd.join(", ")||"none"),"Teams to repair: ".concat(eM.impactSummary.teamsToRepair.join(", ")||"none"),"Projects to detach: ".concat(eM.impactSummary.projectsToDetach.join(", ")||"none"),...eM.impactSummary.explicitNonActions].join("\n")}):eG?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("p",{children:["Missing creatable statuses:"," ",eG.missingStatuses.length>0?eG.missingStatuses.join(", "):"none"]}),(0,n.jsxs)("p",{children:["Dispatch triggers: ",eG.dispatchTriggerStatuses.join(", ")]}),eG.repairActions.length>0?(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("p",{className:"font-medium",children:"Workflow status repairs"}),(0,n.jsx)("ul",{className:"space-y-2",children:eG.repairActions.map(e=>(0,n.jsxs)("li",{className:"rounded-md border border-border bg-background p-2",children:[(0,n.jsx)("p",{className:"font-medium",children:e.statusName}),(0,n.jsx)("p",{className:"text-muted-foreground",children:e.explanation}),(0,n.jsxs)("p",{children:["Current category:"," ",(0,ev.L)(e.actualCategory)," \xb7 Required:"," ",(0,ev.L)(e.expectedCategory)]}),(0,n.jsxs)("p",{children:["Affected issues: ",e.affectedIssueCount," \xb7 Strategy:"," ",e.repairStrategy]})]},e.existingStatusId))})]}):null,eG.manualSteps.length>0?(0,n.jsx)("ul",{className:"list-disc pl-5 text-muted-foreground",children:eG.manualSteps.map(e=>(0,n.jsx)("li",{children:e},e))}):null]}):null,e4?(0,n.jsx)("p",{className:"text-destructive",children:e4}):null]}):null,"apply"===e0||e8?null:(0,n.jsx)(ek.I,{scope:"linear-write",variant:"guided",confirmed:eX,disabled:null!==e0||!t_,disabledReason:t_?void 0:"Add at least one Linear team and project association before confirming.",onConfirmedChange:eQ}),"apply"===e0?(0,n.jsx)(ec.M,{phases:(0,ec.y)({labels:[...ej],activeIndex:te}),supportingText:tr}):null,e8||"apply"===e0?null:(0,n.jsx)("div",{className:R.PI.actions,children:(0,n.jsx)(F.$,{type:"button",onClick:()=>void tT(),disabled:null!==e0||!eX||!t_||!!(null==tu?void 0:tu.validationError),children:"Apply Linear workspace setup"})}),e2?(0,n.jsx)(eo,{success:!1,message:e2}):null,e8&&e5?(0,n.jsx)(ed,{heading:"Linear workspace verified",explanation:"The selected Linear team, project, and workflow statuses are ready.",details:["created"in e5?"Created: ".concat(e5.created.join(", ")||"none"):"Operations: ".concat(e5.operationsCompleted.length),"skipped"in e5?"Reused: ".concat(e5.skipped.join(", ")||"none"):"Reused: none","repaired"in e5?"Repaired: ".concat(e5.repaired.join(", ")||"none"):"Repaired: none"],continueLabel:"Continue to Vercel bridge",onContinue:L}):null,tA&&!e8?(0,n.jsx)(F.$,{type:"button",onClick:L,children:"Continue to Vercel bridge"}):null]}):(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Add your Linear API key in Step 1 before configuring the Linear workspace."})})})}var eN=r(8277);let eR="Vercel production redeploy is in progress. Wait for verification to finish before changing settings.";function eI(e){let{message:t,phaseLabel:r}=e,[s,i]=(0,a.useState)(t),l=(0,a.useRef)(null),[o,c]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let e=window.matchMedia("(prefers-reduced-motion: reduce)"),t=()=>c(e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]),(0,a.useEffect)(()=>{l.current!==t&&(l.current=t,i(t))},[t]),(0,n.jsx)("div",{className:"rounded-md border border-border bg-muted/20 px-3 py-2 text-sm","aria-live":"polite","aria-atomic":"true",children:(0,n.jsxs)("div",{className:"flex items-start gap-2",children:[(0,n.jsx)("span",{"aria-hidden":"true",className:"mt-1 inline-block h-2 w-2 shrink-0 rounded-full bg-primary ".concat(o?"":"animate-pulse")}),(0,n.jsxs)("div",{className:"min-w-0 space-y-1",children:[r?(0,n.jsx)("p",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:r}):null,(0,n.jsx)("p",{className:"text-foreground break-words ".concat(o?"font-medium":""),children:t}),(0,n.jsx)("span",{className:"sr-only",children:s})]})]})})}let eP=["Validating Vercel selection","Creating or connecting project","Deploying automation bridge","Writing environment variables","Configuring Linear webhook","Verifying signed webhook"];function eE(e){let t=e.orchestration;if(!t)return{setupPending:!1,pollActionId:null,verifiedSuccess:e.readiness.ready};if(t.verified||e.readiness.ready)return{setupPending:!1,pollActionId:null,verifiedSuccess:!0};if(t.active){var r;return{setupPending:!0,pollActionId:null!=(r=t.pollActionId)?r:null,verifiedSuccess:!1}}return{setupPending:!1,pollActionId:null,verifiedSuccess:!1}}function eT(e){var t,r,s,i,l,o,c,d,u,p,m,h,f,g,v,y,x,w,b,k,j,S,C,N,I,P,E;let{readiness:T,initialSummary:A,onSummaryUpdated:_,onUiStateChange:K,onContinue:O,onStepCompleted:L}=e,H=eE(A),[B,D]=(0,a.useState)(A),[U,G]=(0,a.useState)([]),[V,M]=(0,a.useState)([]),[Y,$]=(0,a.useState)({teamCreate:!0,projectCreate:!0}),[z,Z]=(0,a.useState)(!0),[X,Q]=(0,a.useState)(null),[ee,et]=(0,a.useState)("existing"),[er,en]=(0,a.useState)(null!=(m=null==(r=B.controlPlane)||null==(t=r.vercel)?void 0:t.teamId)?m:""),[ea,es]=(0,a.useState)(""),[ei,el]=(0,a.useState)(""),[eu,ep]=(0,a.useState)("existing"),[em,eh]=(0,a.useState)(null!=(h=null==(i=B.controlPlane)||null==(s=i.vercel)?void 0:s.projectId)?h:""),[ef,eg]=(0,a.useState)(""),[ev,ey]=(0,a.useState)(null!=(f=B.linearTeamKey)?f:""),[ex,ew]=(0,a.useState)(null),[ej,eS]=(0,a.useState)(!1),[eC,eT]=(0,a.useState)(null),[eA,e_]=(0,a.useState)(!1),[eK,eO]=(0,a.useState)(!1),[eL,eF]=(0,a.useState)(!1),[eH,eB]=(0,a.useState)(!1),[eD,eU]=(0,a.useState)(null),[eG,eV]=(0,a.useState)(null),[eM,eW]=(0,a.useState)(null),[eY,eJ]=(0,a.useState)(null),[eq,e$]=(0,a.useState)(H.pollActionId),[ez,eZ]=(0,a.useState)(H.setupPending),[eX,eQ]=(0,a.useState)(H.verifiedSuccess),[e0,e1]=(0,a.useState)(null),[e2,e3]=(0,a.useState)(!1),e4=(b={setupPending:ez,pollActionId:eq,orchestration:B.orchestration}).setupPending||!!b.pollActionId||!!(null==(k=b.orchestration)?void 0:k.active),e6=e4||null!==eD,e5="apply"===(j={loading:eD,applyResult:eY,orchestration:B.orchestration}).loading?"Applying Vercel settings…":(null==(S=j.applyResult)?void 0:S.orchestrationStatusMessage)?j.applyResult.orchestrationStatusMessage:(null==(C=j.orchestration)?void 0:C.active)?j.orchestration.statusMessage:void 0,e7=!!(N={applyResult:eY,orchestration:B.orchestration,redeployPollingActive:e4}).applyResult&&!N.redeployPollingActive&&(null==(I=N.orchestration)||!I.active)&&!N.applyResult.setupPending&&!!(N.applyResult.setupBlocked||(null==(P=N.orchestration)?void 0:P.terminal)||N.applyResult.verified&&N.applyResult.signedProbeVerified),e8=(E={verifiedSuccess:eX,redeployPollingActive:e4}).verifiedSuccess||E.redeployPollingActive,e9=(0,a.useMemo)(()=>"create"===eu?function(e){var t;let r=null!=(t=null==e?void 0:e.trim())?t:"";return r.length<1||r.length>100?{valid:!1,normalized:r,error:"Vercel project name must be 1-100 characters."}:r!==r.toLowerCase()?{valid:!1,normalized:r,error:"Vercel project name must be lowercase."}:/^[a-z0-9._-]+$/.test(r)?{valid:!0,normalized:r}:{valid:!1,normalized:r,error:"Vercel project name may only contain lowercase letters, numbers, dots, underscores, and hyphens."}}(ef):{valid:!0,normalized:ef},[eu,ef]);(0,a.useEffect)(()=>{D(A),A.linearTeamKey&&ey(A.linearTeamKey);let e=eE(A);eZ(e.setupPending),e$(e.pollActionId),eQ(e.verifiedSuccess)},[A]);let te=null!==eC&&eA;(0,a.useEffect)(()=>{null==K||K({vercelPreviewStale:null!==eC&&!te})},[K,eC,te]);let tt=(0,a.useCallback)(async e=>{eS(!0),ew(null);try{var t,r,n,a,s;let i=void 0!==e?"?teamId=".concat(encodeURIComponent(e)):"",l=await fetch("/api/setup/vercel-bridge-options".concat(i)),o=await l.json();if(!l.ok)throw Error(null!=(r=null!=(t=o.error)?t:o.loadError)?r:"Failed to load Vercel options");G(null!=(n=o.scopes)?n:[]),M(null!=(a=o.projects)?a:[]),$(null!=(s=o.capabilities)?s:{teamCreate:!0,projectCreate:!0}),o.harnessTeamKey&&ey(o.harnessTeamKey),Z(o.githubDispatch.eligible),Q(o.githubDispatch.eligible?null:o.githubDispatch.message),o.githubDispatch.eligible||(eT(null),e_(!1),eO(!1),eB(!1)),void 0===e&&void 0!==o.selectedScopeId&&en(o.selectedScopeId),eh(e=>{var t;return o.projects.some(t=>t.id===e)?e:null!=(t=o.selectedProjectId)?t:""}),o.loadError&&ew(o.loadError)}catch(e){ew(e instanceof Error?e.message:"Failed to load Vercel settings options")}finally{eS(!1)}},[]);(0,a.useEffect)(()=>{B.vercelTokenConfigured&&tt()},[tt,B.vercelTokenConfigured]);let tr=(0,a.useCallback)(async()=>{eU("refresh");try{let t=await fetch("/api/setup/vercel-summary"),r=await t.json();if(!t.ok){var e;throw Error(null!=(e=r.error)?e:"Vercel summary refresh failed")}D(r),null==_||_(r);let n=eE(r);eZ(n.setupPending),e$(n.pollActionId),eQ(n.verifiedSuccess)}catch(e){eV(e instanceof Error?e.message:"Vercel summary refresh failed")}finally{eU(null)}},[_]),tn=(0,a.useCallback)(e=>{e4&&(null==e?void 0:e.force)!==!0||(eT(null),e_(!1),eO(!1),eQ(!1),eJ(null),e$(null),eZ(!1),e1(null),e3(!1))},[e4]),ta=(0,a.useCallback)(()=>{var e,t;return{team:{mode:ee,teamId:"existing"===ee?er:void 0,teamName:"create"===ee&&ea||void 0,teamSlug:"create"===ee&&ei||void 0},project:{mode:eu,projectId:"existing"===eu&&em||void 0,projectName:"create"===eu&&ef||void 0},allowExistingProjectBridgeInstall:"existing"===eu?eL:void 0,teamId:"existing"===ee&&er||void 0,projectId:"existing"===eu&&em||void 0,projectName:"create"===eu&&ef||void 0,linearTeamId:null==(t=B.controlPlane)||null==(e=t.linear)?void 0:e.teamId,envInput:{HARNESS_TEAM_KEY:ev||void 0}}},[eL,ev,em,eu,ef,null==(o=B.controlPlane)||null==(l=o.linear)?void 0:l.teamId,er,ee,ea,ei]),ts=(0,a.useCallback)(async(e,t)=>{var r,n,a,s,i,l;if(eJ(e),"deployment-required"===e.status){eV(null!=(s=null==(a=e.deploymentRequired)?void 0:a.message)?s:"Deployment required before applying settings."),eQ(!1),eZ(!1),e$(null),tt("existing"===ee?er:void 0),eT(null),e_(!1),eO(!1),eB(!1);return}D(t),null==_||_(t);let o=e.verified&&e.signedProbeVerified;eQ(e.verified),eZ(!!(e.setupPending||(null==(r=t.orchestration)?void 0:r.active))),e$(null!=(l=null!=(i=e.pollActionId)?i:null==(n=t.orchestration)?void 0:n.pollActionId)?l:null),e.linearWebhookSetup.manualCopySecret?(e1(e.linearWebhookSetup.manualCopySecret),e3(!1)):e1(null),eT(null),e_(!1),eO(!1),eB(!1),o&&(null==L||L()),tt("existing"===ee?er:void 0)},[tt,L,_,er,ee]),ti=(0,a.useCallback)(async()=>{var e,t,r,n,a;if(eq){eU("poll"),eV(null);try{let t=await fetch("/api/setup/vercel-bridge-redeploy-status",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({actionId:eq})}),s=await (0,eN.V)(t,"POST /api/setup/vercel-bridge-redeploy-status");if(!t.ok)throw Error(null!=(e=s.error)?e:"Redeploy status check failed");let i=s.apply;await ts(i,s.summary),r=s.summary,(i.verified&&i.signedProbeVerified||!i.setupPending&&(null==(n=r.orchestration)||!n.active)&&(i.setupBlocked||"failed"===i.productionRedeployStatus||"timeout"===i.productionRedeployStatus||"no_source_deployment"===i.productionRedeployStatus||(null==(a=r.orchestration)?void 0:a.terminal)))&&(eZ(!1),e$(null))}catch(e){eV(e instanceof Error?e.message:"Redeploy status check failed"),(null==(t=B.orchestration)?void 0:t.active)||eZ(!1)}finally{eU(null)}}},[ts,eq,null==(c=B.orchestration)?void 0:c.active]);(0,a.useEffect)(()=>{if(!ez||!eq)return;let e=window.setInterval(()=>{ti()},5e3);return ti(),()=>{window.clearInterval(e)}},[eq,ti,ez]);let tl=(0,a.useCallback)(async()=>{let e=await fetch("/api/setup/preview-vercel-bridge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ta())}),t=await e.json();if(!e.ok){var r;throw Error(null!=(r=t.error)?r:"Preview failed")}return eT(t),e_(!0),t},[ta]),to=(0,a.useCallback)(async()=>{if(!e4){eU("preview"),eV(null),eW(null),tn(),eB(!1);try{await tl(),eO(!0)}catch(e){eT(null),e_(!1),eO(!0),eW(e instanceof Error?e.message:"Preview failed")}finally{eU(null)}}},[tn,e4,tl]),tc=async()=>{var e,t;if(!e4&&eH){if(!z)return void eV(null!=X?X:"Saved GITHUB_TOKEN cannot dispatch to the harness repository. Update Step 1 before applying.");if("create"===eu&&!e9.valid)return void eV(null!=(e=e9.error)?e:"Vercel project name is invalid.");eU("apply"),eV(null),tn();try{let e=te&&eC?eC:await tl();if(e.validationError)throw Error(e.validationError);let r=await fetch("/api/setup/apply-vercel-bridge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plan:ta(),confirmed:!0,fingerprint:e.fingerprint})}),n=await (0,eN.V)(r,"POST /api/setup/apply-vercel-bridge");if(!r.ok)throw Error(null!=(t=n.error)?t:"Apply failed");await ts(n.apply,n.summary)}catch(e){eV(e instanceof Error?e.message:"Apply failed")}finally{eU(null)}}},td="existing"===ee?!!ev&&("existing"===eu?!!em:!!ef&&e9.valid):!!(ei&&ev)&&("existing"===eu?!!em:!!ef&&e9.valid),tu=eX&&(null==eY?void 0:eY.signedProbeVerified)===!0||B.readiness.ready,tp="apply"===eD||e4,tm=function(e){var t,r,n,a,s;if("apply"===e.loading)return 0;switch(null==(n=e.applyResult)||null==(r=n.orchestrationSteps)||null==(t=r.find(e=>"active"===e.status))?void 0:t.phase){case"deploying_bridge":return 2;case"writing_env_vars":return 3;case"verifying_webhook":return 5}switch(null!=(s=null==(a=e.applyResult)?void 0:a.orchestrationPhase)?s:e.orchestrationPhase){case"triggered":case"building":case"waiting_for_ready":return 2;case"verifying":case"retry_wait":return 5;case"verified":return eP.length;default:return 0}}({loading:eD,applyResult:eY,orchestrationPhase:null==(d=B.orchestration)?void 0:d.phase}),th=null!=e5?e5:eP[tm];return(0,n.jsx)(W.i,{title:"Step 3 of ".concat(7," \xb7 Configure PDev automation bridge"),description:"Choose the Vercel team and project that hosts the PDev automation bridge.",children:(0,n.jsx)("div",{className:R.Es.stackSm,children:B.vercelTokenConfigured?(0,n.jsxs)(n.Fragment,{children:[e4?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:eR}):null,!z&&X?(0,n.jsx)("p",{className:"text-sm text-destructive",children:X}):null,e5&&!tp?(0,n.jsx)(eI,{message:e5,phaseLabel:function(e){if(e)switch(e){case"triggered":return"Redeploying production";case"building":case"waiting_for_ready":return"Waiting for deployment";case"verifying":return"Verifying webhook";case"retry_wait":return"Retrying verification";case"verified":return"Verified";case"terminal":return"Action required";default:return}}(null!=(g=null==eY?void 0:eY.orchestrationPhase)?g:null==(u=B.orchestration)?void 0:u.phase)}):null,z?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(q.J,{htmlFor:"vercel-team-mode",children:"Vercel team name"}),Y.teamCreate?(0,n.jsxs)(eb.l,{id:"vercel-team-mode",value:ee,onChange:e=>{e4||(et(e.target.value),tn())},disabled:e6,children:[(0,n.jsx)("option",{value:"existing",children:"Use existing team"}),(0,n.jsx)("option",{value:"create",children:"Create new team"})]}):null,"existing"===ee?(0,n.jsx)(eb.l,{id:"vercel-team-name",value:er,onChange:e=>{e4||(en(e.target.value),eh(""),tn(),tt(e.target.value))},disabled:e6||ej,children:U.map(e=>(0,n.jsx)("option",{value:e.id,children:e.label},e.id||"personal"))}):(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(J.p,{placeholder:"Team name",value:ea,onChange:e=>{e4||(es(e.target.value),tn())},disabled:e6}),(0,n.jsx)(J.p,{placeholder:"Team slug",value:ei,onChange:e=>{e4||(el(e.target.value),tn())},disabled:e6})]})]}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(q.J,{htmlFor:"vercel-project-mode",children:"Vercel project"}),Y.projectCreate?(0,n.jsxs)(eb.l,{id:"vercel-project-mode",value:eu,onChange:e=>{e4||(ep(e.target.value),eF(!1),tn())},disabled:e6,children:[(0,n.jsx)("option",{value:"existing",children:"Use existing project"}),(0,n.jsx)("option",{value:"create",children:"Create new project"})]}):null,"existing"===eu?(0,n.jsxs)(eb.l,{id:"vercel-project-id",value:em,onChange:e=>{e4||(eh(e.target.value),eF(!1),tn())},disabled:e6||ej||0===V.length,children:[(0,n.jsx)("option",{value:"",children:"Select a project…"}),V.map(e=>(0,n.jsx)("option",{value:e.id,children:e.name},e.id))]}):(0,n.jsx)(J.p,{placeholder:"Project name",value:ef,onChange:e=>{e4||(eg(e.target.value),tn())},disabled:e6}),"create"===eu&&e9.error?(0,n.jsx)("p",{className:"text-sm text-destructive",children:e9.error}):null,"existing"===eu&&em?(0,n.jsxs)("label",{className:"flex cursor-pointer items-start gap-2 rounded-md border border-border bg-muted/10 p-3 text-sm has-[:disabled]:cursor-not-allowed",children:[(0,n.jsx)("input",{type:"checkbox",className:"mt-0.5 cursor-pointer disabled:cursor-not-allowed",checked:eL,disabled:e6,onChange:e=>{eF(e.target.checked),eT(null),e_(!1),eO(!1),eB(!1)}}),(0,n.jsx)("span",{className:"text-muted-foreground",children:"Allow PDev to install the automation bridge into this existing project if it is not already marked as PDev-managed."})]}):null]})]}),ej?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading Vercel teams and projects…"}):null,ex?(0,n.jsx)("p",{className:"text-sm text-destructive",children:ex}):null,(0,n.jsxs)("div",{className:R.PI.actions,children:[(0,n.jsx)(F.$,{type:"button",variant:"outline",onClick:()=>void to(),disabled:e6||!td,children:"preview"===eD?"Previewing…":"Preview PDev automation bridge"}),(0,n.jsx)(F.$,{type:"button",variant:"ghost",onClick:()=>void tr(),disabled:e6,children:"Refresh"})]}),eK&&te&&eC?(0,n.jsxs)("div",{className:"rounded-md border border-border bg-muted/10 p-3 text-sm space-y-2",children:[(0,n.jsxs)("p",{children:["Webhook URL: ",null!=(v=eC.webhookUrl)?v:"unknown"]}),(0,n.jsxs)("p",{children:["Endpoint reachable:"," ",eC.endpointReachable?"yes":"no"]}),(0,n.jsxs)("p",{children:["GitHub dispatch source: ",null!=(y=eC.githubDispatchSource)?y:"unknown"]}),(0,n.jsxs)("p",{children:["Linear webhook secret mode:"," ",null!=(x=eC.linearWebhookSecretMode)?x:"unknown"]}),(0,n.jsx)("p",{className:"text-muted-foreground",children:"Preview does not run signed verification. Apply writes the webhook secret and runs a signed production probe after env setup."}),(0,n.jsxs)("p",{children:["Signed probe verified:"," ",eC.signedProbeVerified?"yes":"no (runs on apply)"]}),"ready"!==eC.deploymentStatus?(0,n.jsxs)("p",{className:"text-amber-700 dark:text-amber-400",children:["Deployment status: ",eC.deploymentStatus]}):null,eC.manualSteps.length>0?(0,n.jsx)("ul",{className:"list-disc pl-5 text-muted-foreground",children:eC.manualSteps.map(e=>(0,n.jsx)("li",{children:e},e))}):null,eM?(0,n.jsx)("p",{className:"text-destructive",children:eM}):null]}):null,"apply"===eD||tp||eX?null:(0,n.jsx)(ek.I,{scope:"vercel-bridge-write",variant:"guided",confirmed:eH,disabled:e6||!td,disabledReason:e4?eR:td?"create"===ee?"This will create provider resources in Vercel when you apply.":void 0:"Select or enter the Vercel team and project before confirming.",onConfirmedChange:e=>{e4||eB(e)}}),tp?(0,n.jsx)(ec.M,{phases:(0,ec.y)({labels:[...eP],activeIndex:tm}),supportingText:th}):null,e8||tp?null:(0,n.jsx)("div",{className:R.PI.actions,children:(0,n.jsx)(F.$,{type:"button",onClick:()=>void tc(),disabled:e6||!eH||!td||!!(null==eC?void 0:eC.validationError),children:"Apply PDev automation bridge"})}),eG?(0,n.jsx)(eo,{success:!1,message:eG}):null,e7&&eY&&!(eY.verified&&eY.signedProbeVerified)?(0,n.jsx)(eo,{success:eY.verified,message:function(e){var t,r,n,a,s,i,l,o,c,d,u,p,m;if("deployment-required"===e.status)return"".concat(null!=(l=null==(s=e.deploymentRequired)?void 0:s.message)?l:"Deployment required."," ").concat(null!=(o=null==(i=e.deploymentRequired)?void 0:i.nextSteps.join(" "))?o:"");if(e.setupBlocked)return[e.setupBlocked.message,...e.setupBlocked.nextSteps].join(" ");if(e.verified&&e.signedProbeVerified)return"PDev automation bridge verified.";let h=["Vercel team: ".concat(null!=(c=null==(t=e.team)?void 0:t.outcome)?c:"unchanged"," ").concat(null!=(d=null==(r=e.team)?void 0:r.name)?d:"","."),"Vercel project: ".concat(null!=(u=null==(n=e.project)?void 0:n.outcome)?u:"unchanged"," ").concat(null!=(p=null==(a=e.project)?void 0:a.name)?p:e.projectName,"."),"Env vars written: ".concat(e.writtenEnvKeys.join(", ")||"none","."),"Linear webhook setup: ".concat(e.linearWebhookSetup.mode,"."),"Signed probe: ".concat(e.signedProbeVerified?"passed":"failed").concat(e.signedProbeReason?" (".concat(e.signedProbeReason,")"):"",".")];return e.productionRedeployTriggered&&h.push("Production redeploy: ".concat(null!=(m=e.productionRedeployStatus)?m:"unknown",".")),h.join(" ")}(eY)}):null,eX&&(null==eY?void 0:eY.signedProbeVerified)?(0,n.jsx)(ed,{heading:"PDev automation bridge verified",explanation:"The Vercel bridge, environment variables, Linear webhook, and signed production probe are ready.",details:["Project: ".concat(null!=(w=null==(p=eY.project)?void 0:p.name)?w:eY.projectName),"Env vars written: ".concat(eY.writtenEnvKeys.join(", ")||"none"),"Linear webhook: ".concat(eY.linearWebhookSetup.mode)],continueLabel:"Continue to Step 4",onContinue:O}):null,e0?(0,n.jsxs)("div",{className:"rounded-md border border-amber-500/40 bg-amber-500/5 p-3 text-sm space-y-2",children:[(0,n.jsx)("p",{className:"font-medium",children:"Manual Linear webhook secret (one-time)"}),(0,n.jsx)("p",{className:"text-muted-foreground",children:"Copy this secret into the Linear webhook signing secret field. Manual acknowledgement does not verify the bridge; signed delivery verification must pass after you apply again."}),(0,n.jsx)(J.p,{readOnly:!0,value:e0}),(0,n.jsxs)("label",{className:"flex items-center gap-2",children:[(0,n.jsx)("input",{type:"checkbox",checked:e2,onChange:e=>e3(e.target.checked)}),"I copied the webhook secret into Linear."]}),(null==eY?void 0:eY.linearWebhookSetup.manualSteps.length)?(0,n.jsx)("ul",{className:"list-disc pl-5 text-muted-foreground",children:eY.linearWebhookSetup.manualSteps.map(e=>(0,n.jsx)("li",{children:e},e))}):null]}):null,tu&&!eX?(0,n.jsx)(F.$,{type:"button",onClick:O,children:"Continue to target repo setup"}):null]}):null]}):(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Add VERCEL_TOKEN in Step 1 before configuring the PDev automation bridge."})})})}var eA=r(2316),e_=r(2835),eK=r(844),eO=r(6970),eL=r(9100),eF=r(743);function eH(e){var t;let{checks:r,className:a}=e,s=null!=(t=(0,U.I)())&&t;return(0,n.jsx)("ul",{className:(0,V.cn)(R.Es.list,a),children:(0,n.jsx)(eL.N,{initial:!1,children:r.map(e=>{let t=function(e){switch(e){case"passed":return eA.A;case"failed":return e_.A;case"checking":return eK.A;default:return eO.A}}(e.status);return(0,n.jsxs)(eF.P.li,{layout:!s,initial:!s&&{opacity:0,y:8,scale:.98},animate:{opacity:1,y:0,scale:1},exit:s?void 0:{opacity:0,y:-4,scale:.98},transition:s?{duration:0}:{duration:.24,ease:[.2,0,0,1]},className:"flex items-start gap-3 rounded-md border border-border bg-muted/30 p-3",children:[(0,n.jsx)(t,{className:(0,V.cn)("mt-0.5 size-4 shrink-0",function(e){switch(e){case"passed":return"text-emerald-600";case"failed":return"text-destructive";case"checking":return"text-muted-foreground animate-spin";default:return"text-muted-foreground"}}(e.status))}),(0,n.jsxs)("div",{className:(0,V.cn)(R.Es.stackSm,"min-w-0 flex-1"),children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:e.label}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:function(e){switch(e){case"passed":return"Passed";case"failed":return"Failed";case"checking":return"Checking";default:return"Pending"}}(e.status)})]}),e.detail?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:e.detail}):null,"failed"===e.status&&e.action?(0,n.jsx)("p",{className:"text-sm text-foreground",children:e.action}):null]})]},e.id)})})})}class eB{enqueue(e){this.queue.push(e),this.drain()}cancel(){this.cancelled=!0,this.queue=[]}reset(){this.cancelled=!1,this.queue=[],this.draining=!1}async drain(){if(!this.draining&&!this.cancelled){for(this.draining=!0;this.queue.length>0&&!this.cancelled;){let e=this.queue.shift();if(!e)break;this.onDispatch(e),this.reducedMotion||await new Promise(e=>{window.setTimeout(e,280)})}this.draining=!1,this.queue.length>0&&!this.cancelled&&this.drain()}}constructor(e,t){this.onDispatch=e,this.reducedMotion=t,this.queue=[],this.draining=!1,this.cancelled=!1}}function eD(e){let t=e.trim();if(!t)return null;try{return JSON.parse(t)}catch(e){return null}}function eU(e){var t;let{readiness:r,onContinue:s,onStepCompleted:i}=e,l=null!=(t=(0,U.I)())&&t,[o,c]=(0,a.useState)([]),[d,u]=(0,a.useState)(!0),[p,m]=(0,a.useState)(null),[h,f]=(0,a.useState)(!1),[g,v]=(0,a.useState)(!1),y=(0,a.useRef)(0),x=(0,a.useRef)(null),w=(0,a.useRef)(null),b=(0,a.useCallback)(e=>{c(e)},[]),k=(0,a.useCallback)(async()=>{var e,t,r,n;null==(e=x.current)||e.abort(),null==(t=w.current)||t.cancel();let a=y.current+1;y.current=a;let s=new AbortController;x.current=s,u(!0),m(null),f(!1),v(!1),c([]);let i=new eB(e=>{if(y.current===a){if("check-started"===e.type)return void b(t=>t.some(t=>t.id===e.id)?t:[...t,{id:e.id,label:e.label,status:"checking"}]);b(t=>t.map(t=>{var r;return t.id===e.check.id?{id:(r=e.check).id,label:r.label,status:"passed"===r.status?"passed":"failed",detail:r.detail,action:r.action}:t}))}},l);w.current=i;try{let e=await fetch("/api/setup/local-readiness?stream=1",{signal:s.signal});if(!e.ok){let t=await e.json();throw Error(null!=(r=t.error)?r:"Local readiness check failed")}if(!e.body)throw Error("Local readiness stream was empty");let t=e.body.getReader(),l=new TextDecoder,o="";for(;;){let{done:e,value:r}=await t.read();if(e)break;if(y.current!==a)return;let s=(o+=l.decode(r,{stream:!0})).split("\n");for(let e of(o=null!=(n=s.pop())?n:"",s)){let t=eD(e);if(t&&y.current===a){if("run-failed"===t.type)throw Error(t.message);if("run-completed"===t.type){f(t.allPassed);continue}i.enqueue(t)}}}let c=eD(o);if(c&&y.current===a){if("run-failed"===c.type)throw Error(c.message);"run-completed"===c.type?f(c.allPassed):i.enqueue(c)}}catch(e){if(s.signal.aborted)return;m(e instanceof Error?e.message:"Could not run local readiness checks"),c([]),f(!1)}finally{y.current===a&&u(!1)}},[b,l]);(0,a.useEffect)(()=>(k(),()=>{var e,t;null==(e=x.current)||e.abort(),null==(t=w.current)||t.cancel()}),[k]),(0,a.useEffect)(()=>{!h||d||g||(null==i||i(),v(!0))},[h,i,d,g]);let j=o.filter(e=>"passed"===e.status);return(0,n.jsx)(W.i,{title:"Step 5 of ".concat(7," \xb7 Check local readiness"),description:"We're checking whether this machine is ready for remote setup.",children:(0,n.jsxs)("div",{className:R.Es.stackSm,children:[d&&0===o.length?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Running local readiness checks…"}):null,p?(0,n.jsxs)("div",{className:R.Es.stackSm,children:[(0,n.jsx)("p",{className:"text-sm text-destructive",children:p}),(0,n.jsx)(F.$,{type:"button",variant:"outline",onClick:()=>void k(),children:"Retry checks"})]}):null,o.length>0?(0,n.jsx)(eH,{checks:o}):null,!h||d||r.localReadinessReviewed?null:(0,n.jsx)(ed,{heading:"Local readiness passed",explanation:"This machine passed the local readiness checks required before cloud secrets setup.",details:j.length>0?j.map(e=>e.label):["All local readiness checks passed."],continueLabel:"Continue to cloud secrets",onContinue:s})]})})}function eG(e){return e.current+=1,e.current}function eV(e,t){return t===e.current}function eM(e){let{harnessSecretPreview:t,targetWorkflowPreview:r}=e;return t||r?t?(0,n.jsxs)("div",{className:"space-y-4",children:[t.validationError?(0,n.jsx)("p",{className:"text-sm text-destructive",children:t.validationError}):null,(0,n.jsxs)("dl",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 text-sm",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("dt",{className:"text-muted-foreground",children:"Harness dispatch repo"}),(0,n.jsx)("dd",{className:"font-medium break-all",children:t.harnessDispatchRepo})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("dt",{className:"text-muted-foreground",children:"Repo access"}),(0,n.jsx)("dd",{className:"font-medium",children:t.repoAccess})]})]}),(0,n.jsx)(er,{title:"Secret write plan (key names only)",content:t.secretWritePlan.map(e=>"".concat(e.name,": ").concat(e.action," (").concat(e.source,")")).join("\n")}),(0,n.jsx)(er,{title:"Manual copy-paste alternative",content:t.manualInstructions.join("\n")})]}):r?(0,n.jsxs)("div",{className:"space-y-4",children:[r.validationError?(0,n.jsx)("p",{className:"text-sm text-destructive",children:r.validationError}):null,(0,n.jsx)(er,{title:"Workflow install preview",content:r.workflowPreviewSummary}),(0,n.jsx)(er,{title:"Manual copy-paste alternative",content:r.manualInstructions.join("\n")})]}):null:(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Generate a preview before confirming any remote write."})}function eW(e){let{open:t,onOpenChange:r,isLoading:a,previewError:s,preview:i,previewIsCurrent:l}=e;return(0,n.jsxs)("details",{open:t,className:"rounded-md border border-border bg-background p-3",children:[(0,n.jsx)("summary",{className:"cursor-pointer text-sm font-medium",onClick:e=>{e.preventDefault(),r(!t)},children:"Review generated secrets (optional)"}),(0,n.jsx)("div",{className:"mt-3 space-y-3",children:a?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Generating redacted cloud secrets preview…"}),(0,n.jsxs)("div",{className:"space-y-2","aria-hidden":"true",children:[(0,n.jsx)(ei,{className:"h-4 w-[60%]"}),(0,n.jsx)(ei,{className:"h-24 w-full"})]})]}):s?(0,n.jsx)("p",{className:"text-sm text-destructive",children:s}):(0,n.jsx)(eM,{harnessSecretPreview:l?i:void 0})})]})}function eY(e){let t=l(e.harnessSecretStatuses);if(t.allPresent)return"All required GitHub Actions secrets are present in the harness repo.";let r=[];return t.missing.length>0&&r.push("Missing: ".concat(t.missing.join(", "))),t.unknown.length>0&&r.push("Unknown: ".concat(t.unknown.join(", "))),r.join(". ")}function eJ(e){let{blocker:t}=e;return(0,n.jsxs)("div",{className:"space-y-2 rounded-md border border-destructive/30 bg-destructive/5 p-4",children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:t.message}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:t.action})]})}async function eq(e){var t;if("undefined"!=typeof navigator&&(null==(t=navigator.clipboard)?void 0:t.writeText))return void await navigator.clipboard.writeText(e);throw Error("Clipboard is not available in this browser.")}function e$(e){var t,r,s;let{readiness:l,setupSummary:o,controlPlaneContext:c,cloudSecretsPreviewOpened:u=!1,remoteSecretPreviewStale:p=!1,cloudSecretsApplyEvidence:m,initialSummary:h,onSummaryUpdated:f,onUiStateChange:g,onContinue:b,onStepCompleted:S,blockedByUpstream:C=!1,onGoToHarnessRepo:N,onGoToConnectServices:I}=e,[P,E]=(0,a.useState)(h),[T,A]=(0,a.useState)(()=>j(h).allowed?"automatic":null),[_,K]=(0,a.useState)(!1),[O,L]=(0,a.useState)(u),[H,B]=(0,a.useState)(null),[D,U]=(0,a.useState)(!1),[G,V]=(0,a.useState)(!1),[M,Y]=(0,a.useState)(!1),[J,$]=(0,a.useState)(null),[z,Z]=(0,a.useState)(null),[X,Q]=(0,a.useState)(null),[ee,et]=(0,a.useState)(null),[er,en]=(0,a.useState)(!1),[es,ei]=(0,a.useState)(!1),[el,eu]=(0,a.useState)(!1),[ep,em]=(0,a.useState)(null),[eh,ef]=(0,a.useState)(!1),[eg,ev]=(0,a.useState)(null),[ey,ex]=(0,a.useState)(null),[ew,eb]=(0,a.useState)(null),[ej,eS]=(0,a.useState)(null),[eC,eN]=(0,a.useState)(!1),eR=["Preparing repository configuration"],eI=(0,a.useRef)({current:0}),eP=(0,a.useRef)(!1),eE=(0,a.useMemo)(()=>d({setupSummary:o,controlPlaneContext:c}),[o,c]),eT=(0,a.useCallback)((e,t)=>{var r,n;eV((n=r={tracker:eI.current,revision:t,summary:e,install:e=>{E(e),null==f||f(e)}}).tracker,n.revision)&&r.install(r.summary)},[f]);(0,a.useEffect)(()=>{eT(h,eG(eI.current))},[h,eT]),(0,a.useEffect)(()=>()=>{em(null),ef(!1)},[]);let eA=(0,a.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"manual",t=eG(eI.current);$("mount"===e?"mount-refresh":"refresh"),"mount"===e?eS(null):Z(null);try{let e=await fetch("/api/setup/remote-summary"),n=await e.json();if(!e.ok){var r;throw Error(null!=(r=n.error)?r:"Remote summary refresh failed")}if(!eV(eI.current,t))return null;return eT(n,t),n}catch(n){if(!eV(eI.current,t))return null;let r=n instanceof Error?n.message:"Remote summary refresh failed";return"mount"===e?eS(r):Z(r),null}finally{eV(eI.current,t)&&($(null),"mount"===e&&eN(!0))}},[eT]);(0,a.useEffect)(()=>{eP.current||(eP.current=!0,eA("mount"))},[eA]);let e_=null!==H&&D;(0,a.useEffect)(()=>{L(u)},[u]);let eK=O||u;(0,a.useEffect)(()=>{eK&&(null==g||g({remoteSecretPreviewStale:null!==H&&!e_}))},[eK,g,H,e_]);let eO=(0,a.useMemo)(()=>j(P),[P]),eL=C||!eO.allowed,eF=C?"Fix harness repo access in local setup before cloud secrets can be configured.":eO.reason,eH=C?"Return to Step 4 and verify your harness repo, then refresh.":eO.action,eB=P.harnessSecretStatuses.some(e=>"missing"===e.status),eD=(0,a.useMemo)(()=>(function(e){var t;let r=(null==(t=null==e?void 0:e.harnessRepo)?void 0:t.trim())||"<harness-dispatch-repo>";return{summary:"Manual GitHub Actions secret setup for ".concat(r,"."),steps:["Open GitHub repository settings for ".concat(r,"."),"Navigate to Settings → Secrets and variables → Actions.","Create or update these secret names: ".concat("HARNESS_CONFIG_JSON_B64, LINEAR_API_KEY, CURSOR_API_KEY, HARNESS_GITHUB_TOKEN","."),"Set HARNESS_CONFIG_JSON_B64 from the base64-encoded full private harness config.","Set LINEAR_API_KEY, CURSOR_API_KEY, and HARNESS_GITHUB_TOKEN from your operator credentials.","Never print secret values in logs, docs, PR comments, or generated setup previews."]}})({harnessRepo:P.harnessDispatchRepo}).steps,[P.harnessDispatchRepo]),eU=(0,a.useCallback)(()=>{B(null),U(!1),Q(null),et(null),en(!1),Y(!1),V(!1),Z(null)},[]),eM=(0,a.useCallback)(()=>{em(null),ef(!1),ev(null),ex(null),ei(!1),eb(null)},[]),e$=(0,a.useCallback)(e=>{A(e),"automatic"===e?eM():eU()},[eU,eM]),ez=(0,a.useCallback)(()=>{em(null),ef(!1),ev(null),eb(null)},[]),eZ=(0,a.useCallback)((e,t)=>{K(!0),null==g||g({remoteSecretPreviewStale:!1}),"automatic"===e?(en(!0),t&&(null==g||g({remoteSecretPreviewStale:!1,cloudSecretsApplyEvidence:t}))):ei(!0),null==S||S()},[S,g]),eX=(0,a.useCallback)(async()=>{let e=await fetch("/api/setup/preview-harness-secrets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),t=await e.json();if(!e.ok){var r;throw Error(null!=(r=t.error)?r:"Preview failed")}return B(t),U(!0),t},[]),eQ=(0,a.useCallback)(()=>{L(!0),null==g||g({cloudSecretsPreviewOpened:!0})},[g]),e0=(0,a.useCallback)(async()=>{$("preview"),Z(null),Q(null),et(null),en(!1),Y(!1),eQ();try{await eX()}catch(e){B(null),U(!1),Q(e instanceof Error?e.message:"Preview failed")}finally{$(null)}},[eQ,eX]),e1=(0,a.useCallback)(e=>{!eL&&(V(e),e&&(eQ(),e_||"preview"===J||e0()))},[e0,J,eQ,e_,eL]),e2=async()=>{if(!M||eL||"apply"===J)return;let e=eG(eI.current);$("apply"),Z(null),en(!1);try{let r=e_&&H?H:await eX();if(r.validationError)throw Error(r.validationError);let n=await fetch("/api/setup/apply-harness-secrets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({confirmed:!0,fingerprint:r.fingerprint})}),a=await n.json();if(!n.ok){var t;throw Error(null!=(t=a.error)?t:"Apply failed")}if(!eV(eI.current,e))return;let s=a.summary,i=a.apply,l=a.evidence;et(i),eT(s,e),B(null),U(!1),Y(!1),V(!1),y(s)?eZ("automatic",l):Z("Write request completed, but verification failed: ".concat(eY(s),". Refresh or retry."))}catch(t){if(!eV(eI.current,e))return;Z(t instanceof Error?t.message:"Apply failed")}finally{eV(eI.current,e)&&$(null)}},e3=async()=>{if(!eL){if(!el)return void ev("Confirm the sensitivity warning before generating manual copy values.");$("manual-values"),ev(null),eb(null);try{let t=await fetch("/api/setup/manual-harness-secret-values",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({confirmedSensitiveReveal:!0})}),r=await t.json();if(!t.ok){var e;throw Error(null!=(e=r.error)?e:"Manual value generation failed")}em(r),ef(!1),r.missing.length>0&&ev("Some values are unavailable locally: ".concat(r.missing.join(", ")))}catch(e){ez(),ev(e instanceof Error?e.message:"Manual value generation failed")}finally{$(null)}}},e4=async()=>{if(!eL){$("manual-verify"),ex(null),ei(!1);try{let e=await eA("manual");if(!e)return;y(e)?(eZ("manual"),ex(eY(e)),ez()):ex(eY(e))}finally{$(null)}}},e6=async(e,t)=>{if(!t)return void eb("".concat(e," is not available to copy."));try{await eq(t),eb("Copied ".concat(e," to clipboard."))}catch(t){eb(t instanceof Error?t.message:"Could not copy ".concat(e,"."))}},e5=(0,a.useMemo)(()=>(function(e){var t,r,n,a;let s=y(e.summary),i=null!=(n=e.previewStaleCleared)&&n,l={...e.uiState,remoteSecretPreviewStale:!i&&(null==(t=e.uiState)?void 0:t.remoteSecretPreviewStale)},o=k({blockers:v(e.setupSummary,e.summary,l,e.staleSmokeDiagnostics,e.controlPlaneContext).blockers,evidence:(a={postApplyVerificationReady:s,previewStaleCleared:i,evidence:null==(r=e.uiState)?void 0:r.cloudSecretsApplyEvidence,currentConfigStateFingerprint:d({setupSummary:e.setupSummary,controlPlaneContext:e.controlPlaneContext})}).evidence,currentConfigStateFingerprint:a.currentConfigStateFingerprint,previewStaleCleared:a.previewStaleCleared,postApplyVerificationReady:a.postApplyVerificationReady});return{canContinue:s&&e.localReadinessComplete&&0===o.length,postApplyVerificationReady:s,blockers:o}})({summary:P,setupSummary:o,localReadinessComplete:l.localReadinessComplete,uiState:{remoteSecretPreviewStale:p,cloudSecretsApplyEvidence:m,cloudSecretsPreviewOpened:eK},staleSmokeDiagnostics:l.staleSmokeDiagnostics,controlPlaneContext:c,previewStaleCleared:_}),[P,o,l.localReadinessComplete,l.staleSmokeDiagnostics,p,m,c,_,eK]),e7=w({evidence:m,currentConfigStateFingerprint:eE,harnessDispatchRepo:P.harnessDispatchRepo}),e8=function(e){if("automatic"!==e.setupType||"apply"===e.loading)return{kind:"idle"};if(e.applyError)return{kind:"apply-failed",message:e.applyError,showRetry:!0};let t=w({evidence:e.cloudSecretsApplyEvidence,currentConfigStateFingerprint:e.currentConfigStateFingerprint,harnessDispatchRepo:e.harnessDispatchRepo});return e.verifiedAutomaticSuccess||e.applyResult&&t?e.cloudSecretsApplyEvidence&&x({evidence:e.cloudSecretsApplyEvidence,currentConfigStateFingerprint:e.currentConfigStateFingerprint,harnessDispatchRepo:e.harnessDispatchRepo})?{kind:"stale-after-apply",message:"Local or control-plane config changed after the last automatic secret write. Preview and apply again to refresh HARNESS_CONFIG_JSON_B64.",showRetry:!0,primaryBlocker:e.eligibility.blockers.find(e=>"cloud-secrets-stale-linear-config"===e.id)}:e.eligibility.postApplyVerificationReady?e.eligibility.canContinue?{kind:"success",message:"Encrypted GitHub Actions secrets were created or updated successfully.",canContinue:!0}:{kind:"success-blocked",message:"Automatic secret write succeeded, but Step 6 is not ready to continue yet.",primaryBlocker:e.eligibility.blockers[0],showRefresh:!0,showRetry:!0}:{kind:"verification-inconclusive",message:"Write request completed, but remote secret verification is not ready yet. Refresh or retry.",showRefresh:!0,showRetry:!0}:{kind:"idle"}}({setupType:T,loading:J,applyError:z,applyResult:ee,verifiedAutomaticSuccess:er,cloudSecretsApplyEvidence:m,eligibility:e5,currentConfigStateFingerprint:eE,harnessDispatchRepo:P.harnessDispatchRepo}),e9=function(e){let t=e.remoteActionsBlocked||!!e.previewValidationError,r=e.remoteActionsBlocked?e.remoteActionsBlockedReason:e.previewValidationError?"Fix validation errors before confirming this write.":void 0,n=null!==e.loading||!e.confirmed||!!e.previewValidationError||e.remoteActionsBlocked||"success"===e.automaticOutcomeKind,a=null!=r?r:e.confirmed?"success"===e.automaticOutcomeKind?"Automatic secret write already verified for the current config.":void 0:"Confirm the GitHub Actions secret write before applying.";return{confirmDisabled:t,confirmDisabledReason:r,applyDisabled:n,applyDisabledReason:a,stalePreviewBlockerActive:e.remoteSecretPreviewStale&&e.cloudSecretsPreviewOpened}}({setupType:T,confirmed:M,loading:J,remoteActionsBlocked:eL,remoteActionsBlockedReason:eF,previewValidationError:null==H?void 0:H.validationError,automaticOutcomeKind:e8.kind,cloudSecretsPreviewOpened:eK,remoteSecretPreviewStale:p}),te=e9.confirmDisabledReason,tt=e9.applyDisabledReason,tr=e9.applyDisabled,tn="automatic"===T&&(er||e7)||"manual"===T&&es,ta=tn&&e5.canContinue&&!l.cloudSecretsReviewed&&!J&&!eL,ts=!eC,ti=eC&&eL&&!ts,tl=es&&null!==ey&&e5.canContinue,to=es&&null!==ey&&!e5.canContinue,tc=e5.blockers[0];return(0,n.jsx)(W.i,{title:"Step 6 of ".concat(7," ","\xb7"," Connect cloud secrets"),description:"Your local setup is ready. Choose automatic GitHub Actions secret setup or manual setup in GitHub, then verify before continuing.",children:(0,n.jsxs)("div",{className:R.Es.stackSm,children:[ts?(0,n.jsx)(ec.M,{phases:(0,ec.y)({labels:[...eR],activeIndex:0}),supportingText:eR[0]}):null,eC&&ej?(0,n.jsxs)("div",{className:"space-y-2 rounded-md border border-destructive/30 bg-destructive/5 p-4",children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:ej}),(0,n.jsx)(F.$,{type:"button",variant:"outline",onClick:()=>void eA("mount"),disabled:null!==J,children:"Retry refresh"})]}):null,ti?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"space-y-2 rounded-md border border-destructive/30 bg-destructive/5 p-4",children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:eF}),eH?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:eH}):null]}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:["step4-harness-repo"===eO.route&&N?(0,n.jsx)(F.$,{type:"button",onClick:N,children:"Go to Step 4 harness repo"}):null,"connect-services"===eO.route&&I?(0,n.jsx)(F.$,{type:"button",onClick:I,children:"Go to Step 1 services"}):null,(0,n.jsx)(F.$,{type:"button",variant:"outline",onClick:()=>void eA("manual"),disabled:null!==J,children:"refresh"===J?"Refreshing…":"Refresh"})]})]}):eC?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("fieldset",{className:"space-y-3",children:[(0,n.jsx)("legend",{className:"text-sm font-medium",children:"Setup type"}),(0,n.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:gap-6",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)(ea.S,{id:"setup-type-automatic",type:"radio",name:"cloud-secrets-setup-type",checked:"automatic"===T,onChange:()=>e$("automatic")}),(0,n.jsx)(q.J,{htmlFor:"setup-type-automatic",className:"text-sm",children:"Automatic setup"})]}),(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)(ea.S,{id:"setup-type-manual",type:"radio",name:"cloud-secrets-setup-type",checked:"manual"===T,onChange:()=>e$("manual")}),(0,n.jsx)(q.J,{htmlFor:"setup-type-manual",className:"text-sm",children:"Manual setup"})]})]})]}),"automatic"===T?(0,n.jsxs)("div",{className:"rounded-md border border-border bg-muted/10 p-4 space-y-4",children:[(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:"Automatic setup"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Write encrypted GitHub Actions secrets to the harness repo through the GitHub API. Preview is optional; preflight runs before apply when you skip preview."})]}),(0,n.jsx)(eW,{open:G,onOpenChange:e1,isLoading:"preview"===J,previewError:null!=X?X:void 0,preview:null!=H?H:void 0,previewIsCurrent:e_}),"apply"===J||tn?null:(0,n.jsx)(ek.I,{scope:"remote-secret-write",variant:"guided",confirmed:M,disabled:e9.confirmDisabled,disabledReason:te,onConfirmedChange:Y}),(0,n.jsxs)("div",{className:R.PI.actions,children:[(0,n.jsx)(F.$,{type:"button",onClick:()=>void e2(),disabled:tr,variant:"success"===e8.kind?"outline":"default",children:"apply"===J?"Writing secrets…":eB?"Create encrypted GitHub Actions secrets":"Update encrypted GitHub Actions secrets"}),e8.showRefresh?(0,n.jsx)(F.$,{type:"button",variant:"outline",onClick:()=>void eA("manual"),disabled:null!==J,children:"refresh"===J?"Refreshing…":"Refresh"}):null,e8.showRetry?(0,n.jsx)(F.$,{type:"button",variant:"outline",onClick:()=>void e0(),disabled:null!==J,children:"preview"===J?"Refreshing preview…":"Preview again"}):null]}),tt&&!eL?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:tt}):null]}):null,"manual"===T?(0,n.jsxs)("div",{className:"rounded-md border border-border bg-background p-4 space-y-4",children:[(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:"Manual setup"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Create or update the required GitHub Actions secrets yourself in the harness repo, then run verify-only checks here."})]}),(0,n.jsx)("ul",{className:"list-disc space-y-1 pl-5 text-sm text-muted-foreground",children:eD.map(e=>(0,n.jsx)("li",{children:e},e))}),(0,n.jsxs)("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3 space-y-3",children:[(0,n.jsx)("p",{className:"text-sm font-medium text-destructive",children:"Sensitive values warning"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Manual copy values are secret. Do not paste them into logs, PRs, issues, screenshots, chat, or saved notes."}),(0,n.jsxs)("div",{className:"flex items-start gap-3",children:[(0,n.jsx)(ea.S,{id:"manual-values-warning",checked:el,onChange:e=>eu(e.target.checked)}),(0,n.jsx)(q.J,{htmlFor:"manual-values-warning",className:"text-sm leading-snug",children:"I understand these values are sensitive and will handle them carefully."})]})]}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsx)(F.$,{type:"button",variant:"outline",onClick:()=>void e3(),disabled:null!==J||!el,children:"manual-values"===J?"Generating manual copy values…":"Generate manual copy values"}),ep?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(F.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>ef(e=>!e),children:eh?"Hide values":"Show values"}),(0,n.jsx)(F.$,{type:"button",variant:"ghost",size:"sm",onClick:ez,children:"Clear values"})]}):null]}),eg?(0,n.jsx)("p",{className:"text-sm text-destructive",children:eg}):null,ew?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:ew}):null,ep?(0,n.jsx)("div",{className:"space-y-3",children:i.map(e=>{let t=ep.values[e];return(0,n.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-md border border-border p-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:e}),eh&&t?(0,n.jsx)("p",{className:"mt-1 break-all font-mono text-xs text-muted-foreground",children:t}):(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:t?"Value ready to copy.":"Value unavailable locally."})]}),(0,n.jsx)(F.$,{type:"button",variant:"outline",size:"sm",disabled:!t,onClick:()=>void e6(e,t),children:"Copy value"})]},e)})}):null,(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"GitHub does not allow secret values to be read back. Verify-only confirms required secret names exist and the harness repo is reachable; it cannot prove the values match your local config or keys."}),(0,n.jsx)("div",{className:R.PI.actions,children:(0,n.jsx)(F.$,{type:"button",variant:"outline",onClick:()=>void e4(),disabled:null!==J,children:"manual-verify"===J?"Verifying manual setup…":"Verify manual setup"})}),ey&&!es?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:ey}):null]}):null,"apply-failed"===e8.kind||"verification-inconclusive"===e8.kind?(0,n.jsx)(eo,{success:!1,message:null!=(t=e8.message)?t:"Automatic apply failed."}):null,"success"===e8.kind?(0,n.jsx)(eo,{success:!0,message:null!=(r=e8.message)?r:"Automatic apply succeeded."}):null,"stale-after-apply"===e8.kind?(0,n.jsx)(eo,{success:!1,message:null!=(s=e8.message)?s:"Config changed after apply."}):null,"success-blocked"===e8.kind&&e8.primaryBlocker?(0,n.jsx)(eJ,{blocker:e8.primaryBlocker}):null,tl?(0,n.jsx)(eo,{success:!0,message:ey}):null,to&&tc?(0,n.jsx)(eJ,{blocker:tc}):null,ta?(0,n.jsx)(ed,{heading:"Cloud secrets verified",explanation:"Required GitHub Actions secrets are present in the harness repo and ready for target workflow install.",details:["automatic"===T?"Automatic GitHub Actions secret setup verified.":"Manual GitHub Actions secret setup verified.",eY(P)],continueLabel:"Continue to target workflow",onContinue:b}):null]}):null]})})}let ez=["preparing-workflow-installation","creating-or-refreshing-install-branch","verifying-install-pull-request","waiting-for-github-checks","merging-workflow-installation","verifying-production-workflow"],eZ={"preparing-workflow-installation":"Preparing workflow installation","creating-or-refreshing-install-branch":"Creating or refreshing install branch","verifying-install-pull-request":"Verifying install pull request","waiting-for-github-checks":"Waiting for GitHub checks","merging-workflow-installation":"Merging workflow installation","verifying-production-workflow":"Verifying production workflow"};function eX(e){let{open:t,onOpenChange:r,isLoading:a,previewError:s,preview:i,previewIsCurrent:l}=e;return(0,n.jsxs)("details",{open:t,className:"rounded-md border border-border bg-background p-3",children:[(0,n.jsx)("summary",{className:"cursor-pointer text-sm font-medium",onClick:e=>{e.preventDefault(),r(!t)},children:"Review planned workflow changes (optional)"}),(0,n.jsx)("div",{className:"mt-3 space-y-3",children:a?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Generating workflow install preview…"}),(0,n.jsxs)("div",{className:"space-y-2","aria-hidden":"true",children:[(0,n.jsx)(ei,{className:"h-4 w-[60%]"}),(0,n.jsx)(ei,{className:"h-24 w-full"})]})]}):s?(0,n.jsx)("p",{className:"text-sm text-destructive",children:s}):(0,n.jsx)(eM,{targetWorkflowPreview:l?i:void 0})})]})}function eQ(e){var t,r;let{repo:s,onApplied:i,onGuidedApplySuccess:l,blockedByUpstream:o=!1,variant:c="advanced"}=e,[d,u]=(0,a.useState)(null),[p,m]=(0,a.useState)(null),[h,f]=(0,a.useState)(null),[g,v]=(0,a.useState)(!1),[y,x]=(0,a.useState)(!1),[w,b]=(0,a.useState)(null),[k,j]=(0,a.useState)(null),[S,C]=(0,a.useState)(null),N="".concat(s.repoConfigId,":").concat(s.targetRepo,":").concat(s.productionBranch),I=null!==d&&p===N,P=(0,a.useCallback)(async()=>{let e=await fetch("/api/setup/preview-target-workflow",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoConfigId:s.repoConfigId,targetRepo:s.targetRepo,productionBranch:s.productionBranch})}),t=await e.json();if(!e.ok){var r;throw Error(null!=(r=t.error)?r:"Preview failed")}return u(t),m(N),f(null),t},[N,s.productionBranch,s.repoConfigId,s.targetRepo]),E=async()=>{b("preview"),j(null),f(null),C(null),x(!1);try{await P()}catch(t){u(null),m(null);let e=t instanceof Error?t.message:"Preview failed";f(e),j(e)}finally{b(null)}},T=(0,a.useCallback)(e=>{o||(v(e),e&&!I&&"preview"!==w&&E())},[o,w,I]),A=async()=>{if(y){b("apply"),j(null);try{let t=I&&d?d:await P();if(t.validationError)throw Error(t.validationError);let r=await fetch("/api/setup/apply-target-workflow",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoConfigId:s.repoConfigId,targetRepo:s.targetRepo,productionBranch:s.productionBranch,confirmed:!0,fingerprint:t.fingerprint})}),n=await r.json();if(!r.ok){var e;throw Error(null!=(e=n.error)?e:"Apply failed")}let a=n.apply,o=n.finalization;u(null),m(null),x(!1),v(!1),"guided"===c?null==l||l(a,o):C(a),i()}catch(e){j(e instanceof Error?e.message:"Apply failed")}finally{b(null)}}},_=(0,a.useMemo)(()=>S?"already-installed"===S.outcome?"Workflow already installed on production branch. No PR opened.":S.prUrl?"Workflow install ".concat(S.outcome,": ").concat(S.prUrl):"Workflow install ".concat(S.outcome," on branch ").concat(S.branchName,"."):null,[S]),K=o?"Fix harness repo access before target workflow setup can be previewed.":void 0,O=K||("advanced"!==c||I?"advanced"===c&&(null==d?void 0:d.validationError)?"Fix validation errors before confirming this write.":void 0:"Generate a preview before you can confirm this write."),L=null!=O?O:y?void 0:"guided"===c?"Confirm before creating the workflow install PR.":"Confirm the preview before applying the workflow install PR.",H="guided"===c?"Preview workflow install PR":"Preview workflow PR",B="apply"===w?"Creating PR…":"guided"===c?"present"===s.workflowStatus?"Update workflow install PR":"Create workflow install PR":"Apply workflow PR",U="advanced"===c&&(!I||!!(null==d?void 0:d.validationError))||o;return(0,n.jsxs)("div",{className:"guided"===c?"space-y-4":"rounded-md border border-border bg-muted/10 p-4 space-y-4",children:["advanced"===c?(0,n.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:s.repoConfigId}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground break-all",children:s.targetRepo}),(0,n.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Production branch: ",s.productionBranch]})]}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,n.jsx)(D.W,{label:"Access: ".concat(s.repoAccess),variant:"available"===(t=s.repoAccess)?"success":"denied"===t?"destructive":"secondary"}),(0,n.jsx)(D.W,{label:"Workflow: ".concat(function(e,t){if("guided"===t)switch(e){case"present":return"workflow ready";case"missing":return"workflow missing";case"differs":return"workflow outdated";default:return"workflow status unknown"}return e}(s.workflowStatus,c)),variant:"present"===(r=s.workflowStatus)?"success":"differs"===r||"missing"===r?"warning":"secondary"})]})]}):null,"guided"===c?(0,n.jsx)(eX,{open:g,onOpenChange:T,isLoading:"preview"===w,previewError:null!=h?h:void 0,preview:null!=d?d:void 0,previewIsCurrent:I}):(0,n.jsx)(eM,{targetWorkflowPreview:I&&null!=d?d:void 0}),(0,n.jsx)(ek.I,{scope:"remote-repo-write",variant:c,confirmed:y,disabled:U,disabledReason:O,onConfirmedChange:x}),"guided"===c?(0,n.jsx)(F.$,{type:"button",onClick:A,disabled:null!==w||!y||o,children:B}):(0,n.jsxs)("div",{className:R.PI.actions,children:[(0,n.jsx)(F.$,{type:"button",onClick:E,disabled:null!==w||o,children:"preview"===w?"Generating preview…":H}),(0,n.jsx)(F.$,{type:"button",onClick:A,disabled:null!==w||!I||!y||!!(null==d?void 0:d.validationError)||o,children:B})]}),K?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:K}):null,L&&!K?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:L}):null,k?(0,n.jsx)(eo,{success:!1,message:k}):null,"advanced"===c&&_?(0,n.jsx)(eo,{success:!0,message:_}):null]})}function e0(e){let{finalization:t,onRetry:r,retrying:a=!1,variant:s="advanced",transientMessage:i=null,onContinue:l}=e,o="blocked"===t.lifecycle&&!t.retryable,c="complete"===t.lifecycle,d="advanced"===s&&o&&t.requiresGitHubIntervention&&t.prUrl;if(c&&"guided"===s){let e=[t.branchName?"Install branch: ".concat(t.branchName):null,t.prNumber?"Pull request #".concat(t.prNumber," merged"):null,"Production workflow verified.",t.supersededPrNumber?"Superseded empty PR #".concat(t.supersededPrNumber,"."):null].filter(e=>!!e);return(0,n.jsx)(ed,{heading:"Workflow installed",explanation:"The harness workflow is verified on the production branch.",details:e,continueLabel:"Continue to finish setup",onContinue:null!=l?l:()=>void 0})}if(o){var u;return(0,n.jsxs)("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 p-4 space-y-3",children:[(0,n.jsx)(D.W,{label:"Workflow install blocked",variant:"destructive"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:t.message}),(0,n.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Failed phase:"," ",null!=(u=eZ[t.phase])?u:t.phase,t.prUrl?(0,n.jsxs)(n.Fragment,{children:[" \xb7 ",(0,n.jsx)("a",{href:t.prUrl,target:"_blank",rel:"noopener noreferrer",className:"underline",children:"Open PR"})]}):null]}),t.lastSafeCheckpoint?(0,n.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Last checkpoint: ",t.lastSafeCheckpoint]}):null,(0,n.jsxs)("div",{className:"flex flex-wrap gap-2",children:[t.canRetry&&r?(0,n.jsx)(F.$,{type:"button",onClick:r,disabled:a,children:a?"Retrying…":"Retry"}):null,d?(0,n.jsx)(F.$,{asChild:!0,variant:"outline",children:(0,n.jsx)("a",{href:t.prUrl,target:"_blank",rel:"noopener noreferrer",children:"Open GitHub details"})}):null]})]})}let p=ez.map(e=>eZ[e]),m=(0,ec.y)({labels:p,activeIndex:function(e){let t=ez.indexOf(e.phase);return t>=0?t:0}(t)});return(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)(ec.M,{phases:m,supportingText:null!=i?i:t.message,busy:"complete"!==t.lifecycle}),i?(0,n.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Temporarily unable to refresh GitHub status.",t.lastSafeCheckpoint?" Last checkpoint: ".concat(t.lastSafeCheckpoint,"."):"",t.updatedAt?" Last updated: ".concat(new Date(t.updatedAt).toLocaleTimeString(),"."):""]}):null,t.prUrl?(0,n.jsxs)("details",{className:"text-xs text-muted-foreground",children:[(0,n.jsx)("summary",{className:"cursor-pointer",children:"Install details"}),(0,n.jsxs)("p",{className:"mt-2 break-all",children:["PR: ",t.prUrl]}),(0,n.jsxs)("p",{className:"mt-1",children:["Operation: ",t.operationId]})]}):null]})}function e1(e){let{repoConfigId:t,onContinue:r}=e;return r?(0,n.jsx)(ed,{heading:"Workflow ready",explanation:"".concat(t," has the expected harness workflow on its production branch."),continueLabel:"Continue to finish setup",onContinue:r}):(0,n.jsxs)("div",{className:"rounded-md border border-border bg-muted/20 p-4 space-y-2",children:[(0,n.jsx)(D.W,{label:"Workflow ready",variant:"success"}),(0,n.jsxs)("p",{className:"text-sm text-muted-foreground",children:[t," has the expected harness workflow on its production branch."]})]})}function e2(e){return e.targetRepos.length>0&&e.targetRepos.every(e=>"present"===e.workflowStatus)}function e3(e){return"pr-created"===e.outcome||"pr-updated"===e.outcome||"branch-updated"===e.outcome}function e4(e){return!!e&&("complete"===e.lifecycle||"blocked"===e.lifecycle&&!e.retryable)}function e6(e){return!(!e||e4(e))}function e5(e){let{initialSummary:t,onSummaryUpdated:r,onWorkflowSetupComplete:s,onWorkflowAwaitingMergeChange:i,onStepCompleted:l,onContinue:o,pendingInstallByRepo:c={},finalizationByRepo:d={},onPendingInstallChange:u,onFinalizationChange:p,blockedByUpstream:m=!1}=e,[h,f]=(0,a.useState)(t),[g,v]=(0,a.useState)(d),[y,x]=(0,a.useState)({}),[w,b]=(0,a.useState)({}),k=(0,a.useRef)(0),j=(0,a.useRef)({}),S=(0,a.useRef)(!0);(0,a.useEffect)(()=>(S.current=!0,()=>{S.current=!1,k.current+=1}),[]),(0,a.useEffect)(()=>{f(t)},[t]),(0,a.useEffect)(()=>{v(d)},[d]);let C=(0,a.useCallback)(async()=>{let e=await fetch("/api/setup/remote-summary"),t=await e.json();if(!e.ok){var n;throw Error(null!=(n=t.error)?n:"Remote summary refresh failed")}return f(t),null==r||r(t),t},[r]),N=(0,a.useCallback)(async(e,t)=>{var n,a,s;let i=h.targetRepos.find(t=>t.repoConfigId===e);if(!i)return;let o=g[e],d=await fetch("/api/setup/finalize-target-workflow",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoConfigId:i.repoConfigId,targetRepo:i.targetRepo,productionBranch:i.productionBranch,prUrl:null!=(n=null==t?void 0:t.prUrl)?n:null==o?void 0:o.prUrl,branchName:null!=(a=null==t?void 0:t.branchName)?a:null==o?void 0:o.branchName,operationId:null==o?void 0:o.operationId})}),m=await d.json();if(!d.ok){let e=Error(null!=(s=m.error)?s:"Workflow finalization failed");throw e.retryable=!0===m.retryable,e.retryAfterMs="number"==typeof m.retryAfterMs?m.retryAfterMs:void 0,e.errorCode="string"==typeof m.errorCode?m.errorCode:void 0,e}let y=m.finalization,x=m.summary;if(!S.current)return y;if(v(t=>{if(!function(e,t){return!e||(!e4(e)||!!e4(t))&&(e.validatedHeadSha&&t.validatedHeadSha&&e.validatedHeadSha!==t.validatedHeadSha?t.advancedThisRequest:!!("updating-branch"===t.lifecycle&&t.message.includes("Refreshing"))||t.advancedThisRequest||!e.lockContended)}(t[e],y))return t;let r={...t,[e]:y};return null==p||p(r),r}),f(x),null==r||r(x),"complete"===y.lifecycle){let t={...c};delete t[e],null==u||u(t),null==l||l()}return y},[g,p,u,l,r,c,h.targetRepos]),I=(0,a.useCallback)((e,t)=>{let r=k.current+1;k.current=r,j.current[e]=0,(async()=>{for(;k.current===r;)try{let n=await N(e,t);if(!S.current||k.current!==r)break;if(null==n?void 0:n.lockContended){x(t=>({...t,[e]:null})),await new Promise(e=>{var t;return setTimeout(e,null!=(t=n.retryAfterMs)?t:2e3)});continue}if(j.current[e]=0,x(t=>({...t,[e]:null})),!e6(n))break;await new Promise(e=>{var t;return setTimeout(e,null!=(t=null==n?void 0:n.retryAfterMs)?t:2e3)})}catch(a){var n;if(!S.current||k.current!==r)break;let t=(null!=(n=j.current[e])?n:0)+1;if(j.current[e]=t,!1===a.retryable||t>8){v(t=>{let r=t[e];if(!r)return t;let n={...r,lifecycle:"blocked",retryable:!1,canRetry:!0,errorCode:"retry_budget_exhausted",message:r.message||"Workflow install polling stopped after repeated refresh failures.",updatedAt:new Date().toISOString()},a={...t,[e]:n};return null==p||p(a),a}),x(t=>({...t,[e]:null}));break}x(t=>({...t,[e]:"Temporarily unable to refresh GitHub status."})),await new Promise(e=>{var r;return setTimeout(e,Math.min(3e4,Math.min(3e4,(null!=(r=a.retryAfterMs)?r:2e3)*2**Math.max(0,t-1))+Math.floor(2e3*Math.random())))})}})()},[N,p]);(0,a.useEffect)(()=>{let e=Object.entries(g).some(e=>{let[,t]=e;return e6(t)});null==i||i(e)},[g,i]),(0,a.useEffect)(()=>{for(let[e,t]of Object.entries(c)){if(!e3(t))continue;let r=g[e];!(r&&e4(r))&&(!r||e6(r))&&I(e,t)}},[g,c,I]);let P=(0,a.useCallback)(async(e,t,r)=>{b(t=>({...t,[e]:!0}));let n={...c};if("already-installed"===t.outcome){delete n[e],null==u||u(n),await C(),null==l||l();return}if(e3(t)&&(n[e]=t),null==u||u(n),r){let t={...g,[e]:r};v(t),null==p||p(t)}e3(t)&&I(e,t)},[g,p,u,l,c,C,I]),E=Object.values(g).some(e=>e6(e)),T=e2(h)||h.targetRepos.length>0&&h.targetRepos.every(e=>{let t=g[e.repoConfigId];return"present"===e.workflowStatus||(null==t?void 0:t.lifecycle)==="complete"}),A=(0,a.useCallback)(async()=>{let e;if(T){try{e=await C()}catch(e){return}e2(e)&&(null==s||s(),null==o||o())}},[T,o,s,C]);return(0,n.jsx)(W.i,{title:"Step 7 of ".concat(7," \xb7 Install target repo workflow"),description:E?"Installing the harness workflow. Continue when production verification succeeds.":"The harness will create or reuse a workflow install PR, merge it automatically when GitHub permits, and verify the production workflow.",children:(0,n.jsxs)("div",{className:R.Es.stackSm,children:[(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Each target repo gets a deterministic install branch and PR. The harness finalizes the install automatically when checks and branch protection allow."}),0===h.targetRepos.length?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Resolve your local harness config to show target repo workflow cards."}):(0,n.jsx)("div",{className:R.Es.stackSm,children:h.targetRepos.map(e=>{let t=c[e.repoConfigId],r=g[e.repoConfigId],a="present"===e.workflowStatus||(null==r?void 0:r.lifecycle)==="complete",s=w[e.repoConfigId]||!!r||!!(t&&e3(t));return(0,n.jsxs)("div",{className:"rounded-md border border-border bg-background p-4 space-y-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:e.repoConfigId}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground break-all",children:e.targetRepo}),(0,n.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Status: ",function(e){switch(e){case"present":return"workflow ready";case"missing":return"workflow missing";case"differs":return"workflow outdated";default:return"workflow status unknown"}}(e.workflowStatus)]})]}),a?(0,n.jsx)(e1,{repoConfigId:e.repoConfigId,onContinue:T?()=>{A()}:void 0}):r?(0,n.jsx)(e0,{variant:"guided",finalization:r,transientMessage:y[e.repoConfigId],onContinue:T&&"complete"===r.lifecycle?()=>{A()}:void 0,onRetry:r.canRetry||r.retryable?()=>{j.current[e.repoConfigId]=0,I(e.repoConfigId,t)}:void 0}):t&&e3(t)?(0,n.jsx)(e0,{variant:"guided",finalization:{repoConfigId:e.repoConfigId,targetRepo:e.targetRepo,targetRepoSlug:e.targetRepo,productionBranch:e.productionBranch,branchName:t.branchName,lifecycle:"preparing",phase:"preparing-workflow-installation",operationId:crypto.randomUUID(),message:"Starting automatic workflow install finalization.",workflowStatus:e.workflowStatus,canRetry:!0,retryable:!0,retryAfterMs:2e3,lastSafeCheckpoint:"preparing",errorCode:"none",requiresGitHubIntervention:!1,advancedThisRequest:!1,lockContended:!1,updatedAt:new Date().toISOString()}}):s?null:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Confirm to create or update the workflow install PR. Preview is optional. Finalization runs automatically after apply."}),(0,n.jsx)(eQ,{repo:e,variant:"guided",onApplied:()=>void 0,onGuidedApplySuccess:(t,r)=>void P(e.repoConfigId,t,r),blockedByUpstream:m})]})]},e.repoConfigId)})})]})})}async function e7(e,t){if(!(await fetch("/api/observability/event",{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json","x-p-dev-observability-nonce":t},body:JSON.stringify(e)})).ok)return}function e8(e){let{animateDraw:t}=e,r=(0,U.I)(),a=t&&!r;return(0,n.jsx)("svg",{className:"size-3.5 sm:size-4",viewBox:"0 0 16 16","aria-hidden":!0,focusable:"false",children:(0,n.jsx)(eF.P.path,{d:"M3.5 8.5 L6.5 11.5 L12.5 4.5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",initial:a?{pathLength:0}:{pathLength:1},animate:{pathLength:1},transition:a?{duration:.28,ease:[.2,0,0,1]}:{duration:0}})})}function e9(e){let{stages:t}=e,r=(0,U.I)(),s=(0,a.useRef)(new Map),i=(0,a.useRef)(!0),l=t.find(e=>"current"===e.state);return(0,a.useEffect)(()=>{i.current=!1,s.current=new Map(t.map(e=>[e.id,e.state]))},[t]),(0,n.jsxs)("nav",{"aria-label":"Guided setup progress",className:"w-full",children:[(0,n.jsx)("ol",{className:"grid grid-cols-7 gap-1 sm:gap-2",children:t.map(e=>{let t="current"===e.state,a="completed"===e.state;return(0,n.jsx)("li",{"aria-current":t?"step":void 0,className:"min-w-0",children:(0,n.jsxs)("div",{className:"flex flex-col items-center gap-1.5 text-center",children:[(0,n.jsx)(eF.P.div,{layout:!r,className:(0,V.cn)("flex size-7 shrink-0 items-center justify-center rounded-full border text-xs font-medium sm:size-8",a&&"border-primary bg-primary text-primary-foreground",t&&"border-primary bg-background text-foreground",!a&&!t&&"border-border bg-muted text-muted-foreground"),transition:r?{duration:0}:{duration:.2,ease:[.2,0,0,1]},children:a?(0,n.jsx)(e8,{animateDraw:(e=>{if(r||i.current)return!1;let t=s.current.get(e.id);return"completed"===e.state&&"completed"!==t})(e)}):(0,n.jsx)("span",{"aria-hidden":!0,children:e.stepNumber})}),(0,n.jsx)("span",{className:(0,V.cn)("hidden w-full truncate text-[10px] font-medium sm:block sm:text-xs",t?"text-foreground":a?"text-muted-foreground":"text-muted-foreground/80"),children:e.shortLabel}),(0,n.jsx)("span",{className:"sr-only",children:"Step ".concat(e.stepNumber," of ").concat(7,", ").concat(e.accessibleLabel,", ").concat(t?"current":a?"completed":"upcoming")})]})},e.id)})}),l?(0,n.jsx)("p",{"aria-live":"polite",className:"mt-3 text-center text-sm font-medium text-foreground sm:hidden",children:l.shortLabel}):null]})}function te(e){let{stepKey:t,direction:r,children:s,className:i,panelRef:l}=e,o=(0,U.I)(),c=(0,a.useRef)(!1),d=(0,a.useRef)(t);(0,a.useEffect)(()=>{if(d.current!==t){var e;c.current=!!(null==l||null==(e=l.current)?void 0:e.contains(document.activeElement)),d.current=t}},[l,t]);let u=o?{initial:{opacity:0},animate:{opacity:1,transition:{duration:.08,ease:[.2,0,0,1]}},exit:{opacity:0,transition:{duration:.08,ease:[.3,0,1,1]}}}:"forward"===("none"===r?"forward":r)?{initial:{opacity:0,x:"100vw"},animate:{opacity:1,x:0,transition:{duration:.32,ease:[.2,0,0,1]}},exit:{opacity:0,x:"-100vw",transition:{duration:.28,ease:[.32,0,.67,0]}}}:{initial:{opacity:0,x:"-100vw"},animate:{opacity:1,x:0,transition:{duration:.32,ease:[.2,0,0,1]}},exit:{opacity:0,x:"100vw",transition:{duration:.28,ease:[.32,0,.67,0]}}};return(0,n.jsx)("div",{className:"w-full overflow-x-hidden",children:(0,n.jsx)(eL.N,{mode:"wait",initial:!1,children:(0,n.jsx)(eF.P.div,{className:(0,V.cn)(i),variants:u,initial:"none"!==r&&"initial",animate:"animate",exit:"exit",onAnimationComplete:e=>{if("animate"===e&&c.current){var t;!function(e){var t;if(!e)return;let r=null!=(t=e.querySelector("[data-guided-step-focus]"))?t:e.querySelector("h2, h3, button, a, input, select, textarea");null==r||r.focus({preventScroll:!0})}(null!=(t=null==l?void 0:l.current)?t:null),c.current=!1}},children:s},t)})})}var tt=r(7898),tr=r(7885);function tn(e){var t,r,n;return{state:{version:1,linear:null==(t=e.linearSummary.controlPlane)?void 0:t.linear,vercel:null==(r=e.vercelSummary.controlPlane)?void 0:r.vercel},linearTeamKeyFromConfig:null==(n=e.summary.configSummary)?void 0:n.linearTeamKey}}function ta(e){let{initialSummary:t,initialRemoteSummary:r,initialLinearSummary:s,initialVercelSummary:i,initialHarnessProvisioningSummary:l,formDefaults:o,observabilityNonce:c,initialObservabilityPreferences:u}=e,[p,m]=(0,a.useState)(u),[h,f]=(0,a.useState)(u.disclosureShown),[g,v]=(0,a.useState)(t),[y,w]=(0,a.useState)(r),[b,k]=(0,a.useState)(s),[j,S]=(0,a.useState)(i),[I,P]=(0,a.useState)(l),[H,U]=(0,a.useState)({});(0,a.useEffect)(()=>{(0,N.b0)("configure_content_ready")},[]);let G=(0,a.useMemo)(()=>tn({linearSummary:b,vercelSummary:j,summary:g}),[b,j,g]),[V,M]=(0,a.useState)(()=>K({currentStepId:C({summary:t,remoteSummary:r,uiState:{},staleSmokeDiagnostics:r.staleSmokeDiagnostics,harnessProvisioningSummary:l,controlPlaneContext:tn({linearSummary:s,vercelSummary:i,summary:t})}).currentStepId,summary:t})),[Y,J]=(0,a.useState)({}),[q,$]=(0,a.useState)({}),[z,Z]=(0,a.useState)(!1),X=(0,a.useRef)(null),Q=(0,a.useRef)(null),[ee,et]=(0,a.useState)(null),er=(0,a.useCallback)(()=>{Q.current=null},[]),en=(0,a.useCallback)(e=>{et(e)},[]),ea=(0,a.useRef)({}),es=(0,a.useRef)(null),ei=(0,a.useRef)({}),el=(0,a.useCallback)(e=>{var t;es.current=e;let r=null!=(t=ea.current[e])?t:0;ea.current[e]=r+1,ei.current[e]=Date.now();let n=T(e)+1;c&&e7({type:"p_dev_configure_step_viewed",stepId:e,stepNumber:n,resumed:!1,revisited:!1},c)},[c]),eo=(0,a.useCallback)(function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"success";if(!c)return;let n=ei.current[e],a=!Number.isFinite(t=n?Date.now()-n:-1)||t<0?"unknown":t<1e4?"lt_10s":t<3e4?"10s_30s":t<12e4?"30s_2m":t<3e5?"2m_5m":"gt_5m",s=T(e)+1;e7({type:"p_dev_configure_step_completed",stepId:e,stepNumber:s,resumed:!1,revisited:!1,durationBucket:a,completionOutcome:r},c)},[c]);(0,a.useEffect)(()=>{el(V)},[V,el]);let ec=(0,a.useMemo)(()=>C({summary:g,remoteSummary:y,uiState:H,staleSmokeDiagnostics:y.staleSmokeDiagnostics,harnessProvisioningSummary:I,controlPlaneContext:G}),[g,y,H,I,G]);(0,a.useEffect)(()=>{var e,t;let r=ec.currentStepId,n=X.current;if(null===n||null!==ee){X.current=r;return}e=n,t=r,("connect-services"!==e||"linear-workspace"!==t)&&O(t,e)>0&&null===Q.current&&M(K({currentStepId:r,summary:g})),X.current=r},[ee,ec.currentStepId,g]),(0,a.useEffect)(()=>{if(null!==ee)return;let e=L({target:V,currentStepId:ec.currentStepId});e!==V&&(M(e),Q.current=e)},[ee,V,ec.currentStepId]),(0,a.useEffect)(()=>{null===ee&&ec.readyForFirstRun&&M("ready-for-first-run")},[ee,ec.readyForFirstRun]),(0,a.useEffect)(()=>{"ready-for-first-run"!==V||ec.readyForFirstRun||M(K({currentStepId:ec.currentStepId,summary:g}))},[V,ec.readyForFirstRun,ec.currentStepId,g]);let ed=ec.staleSmokeDiagnostics.staleTargetRepos.length>0,eu=!!ec.staleSmokeDiagnostics.staleHarnessDispatchRepo,ep=(0,a.useMemo)(()=>{let e=o.env.suggestedHarnessDispatchRepo,t=ec.staleSmokeDiagnostics.staleHarnessDispatchRepo&&e;return{harnessConfigPath:o.env.harnessConfigPath,githubDispatchRepository:t?null!=e?e:"":o.env.githubDispatchRepository||e||"",savedHarnessDispatchRepository:o.env.githubDispatchRepository,suggestedHarnessDispatchRepo:e,secretPresence:{LINEAR_API_KEY:g.envKeyPresence.LINEAR_API_KEY,CURSOR_API_KEY:g.envKeyPresence.CURSOR_API_KEY,GITHUB_TOKEN:g.envKeyPresence.GITHUB_TOKEN,VERCEL_TOKEN:g.envKeyPresence.VERCEL_TOKEN},serviceConnectionSummaries:o.env.serviceConnectionSummaries}},[o.env,ec.staleSmokeDiagnostics.staleHarnessDispatchRepo,g.envKeyPresence.CURSOR_API_KEY,g.envKeyPresence.GITHUB_TOKEN,g.envKeyPresence.LINEAR_API_KEY,g.envKeyPresence.VERCEL_TOKEN]),em=(0,a.useCallback)(e=>{U(t=>t.localPreviewStale===e.localPreviewStale?t:{...t,localPreviewStale:e.localPreviewStale})},[]),eh=(0,a.useCallback)(e=>{U(t=>{let r=t;if(void 0!==e.cloudSecretsPreviewOpened&&t.cloudSecretsPreviewOpened!==e.cloudSecretsPreviewOpened&&(r={...r,cloudSecretsPreviewOpened:e.cloudSecretsPreviewOpened}),void 0!==e.remoteSecretPreviewStale&&t.remoteSecretPreviewStale!==e.remoteSecretPreviewStale&&(r={...r,remoteSecretPreviewStale:e.remoteSecretPreviewStale}),"cloudSecretsApplyEvidence"in e){if(t.cloudSecretsApplyEvidence===e.cloudSecretsApplyEvidence)return r===t?t:r;r={...r,cloudSecretsApplyEvidence:e.cloudSecretsApplyEvidence}}return r===t?t:r})},[]),ef=(0,a.useCallback)(e=>{U(t=>t.linearPreviewStale===e.linearPreviewStale?t:{...t,linearPreviewStale:e.linearPreviewStale})},[]),ev=(0,a.useCallback)(e=>{U(t=>t.vercelPreviewStale===e.vercelPreviewStale?t:{...t,vercelPreviewStale:e.vercelPreviewStale})},[]),ey=(0,a.useCallback)(async()=>{er(),et(null),eo("connect-services"),M("linear-workspace");try{let e=await fetch("/api/setup/linear-summary"),t=await e.json();e.ok&&k(t)}catch(e){}},[er,eo]),ex=(0,a.useCallback)(e=>{P(e)},[]),ew=(0,a.useCallback)(()=>{er(),et(null),eo("linear-workspace"),M("vercel-bridge")},[er,eo]),eb=(0,a.useCallback)(()=>{er(),et(null),eo("vercel-bridge"),M("choose-target-repos")},[er,eo]),ek=(0,a.useCallback)(()=>{er(),et(null),eo("local-readiness"),U(e=>({...e,localReadinessReviewed:!0})),M("cloud-secrets")},[er,eo]),ej=(0,a.useCallback)(()=>{er(),et(null),eo("cloud-secrets"),U(e=>({...e,cloudSecretsReviewed:!0})),M("target-workflow")},[er,eo]),eS=(0,a.useCallback)(e=>{v(e),k(t=>{var r;return r=e.envKeyPresence,{...t,linearApiKeyConfigured:r.LINEAR_API_KEY}}),S(t=>{var r;return r=e.envKeyPresence,{...t,vercelTokenConfigured:r.VERCEL_TOKEN,linearApiKeyConfigured:r.LINEAR_API_KEY}}),w(t=>(function(e,t){let r=e.harnessSecretStatuses.map(e=>"present"===e.status?e:"missing"===e.status&&function(e,t){switch(t){case"LINEAR_API_KEY":return e.LINEAR_API_KEY;case"CURSOR_API_KEY":return e.CURSOR_API_KEY;case"HARNESS_GITHUB_TOKEN":return e.GITHUB_TOKEN;case"HARNESS_CONFIG_JSON_B64":return!1}}(t,e.name)?{...e,status:"unknown"}:e);return{...e,githubTokenConfigured:t.GITHUB_TOKEN,harnessSecretStatuses:r}})(t,e.envKeyPresence)),U(t=>{let r=tn({linearSummary:b,vercelSummary:j,summary:e}),n=x({evidence:t.cloudSecretsApplyEvidence,currentConfigStateFingerprint:d({setupSummary:e,controlPlaneContext:r}),harnessDispatchRepo:y.harnessDispatchRepo});return{...t,linearPreviewStale:!0,vercelPreviewStale:!0,remoteSecretPreviewStale:!!t.cloudSecretsPreviewOpened||t.remoteSecretPreviewStale,cloudSecretsApplyEvidence:n?void 0:t.cloudSecretsApplyEvidence}})},[b,y.harnessDispatchRepo,j]),eN=(0,a.useCallback)(()=>{eo("target-workflow"),fetch("/api/setup/complete-initial-setup",{method:"POST"}).then(async e=>{e.ok&&(await e.json()).completed&&window.location.assign("/workflow")}).catch(()=>void 0),c&&e7({type:"p_dev_setup_completed"},c)},[c,eo]),eR=(0,a.useCallback)(()=>{U(e=>({...e,localReadinessReviewed:!1,cloudSecretsReviewed:!1,cloudSecretsApplyEvidence:void 0,remoteSecretPreviewStale:!!e.cloudSecretsPreviewOpened,localPreviewStale:!1}))},[]),eI=(0,a.useCallback)(()=>{er(),et(null),eo("choose-target-repos"),M("local-readiness")},[er,eo]),eP=(0,a.useCallback)(()=>{er(),et(null),Z(!1),J({}),$({}),M("ready-for-first-run")},[er]);(0,a.useCallback)(e=>{M(e)},[]);let eE=(0,a.useCallback)(e=>{if("connect-services"===e||"linear-workspace"===e||"vercel-bridge"===e||"choose-target-repos"===e)return void U(t=>({...t,localReadinessReviewed:!1,cloudSecretsReviewed:!1,cloudSecretsApplyEvidence:void 0,remoteSecretPreviewStale:!!t.cloudSecretsPreviewOpened||t.remoteSecretPreviewStale,linearPreviewStale:"connect-services"===e||"linear-workspace"===e||t.linearPreviewStale,vercelPreviewStale:"connect-services"===e||"linear-workspace"===e||"vercel-bridge"===e||t.vercelPreviewStale}));"local-readiness"===e&&U(e=>({...e,cloudSecretsReviewed:!1,cloudSecretsApplyEvidence:void 0,remoteSecretPreviewStale:!!e.cloudSecretsPreviewOpened||e.remoteSecretPreviewStale}))},[]),eA=(0,a.useCallback)(()=>{let e=A(V);if(!e)return;let t=L({target:e,currentStepId:ec.currentStepId});M(t),Q.current=t,eE(t)},[V,eE,ec.currentStepId]),e_=null!==A(V),eK=(0,a.useMemo)(()=>(function(e){var t;let r="ready-for-first-run"===(t=e.displayedStep)?null:t,n=e.readyForFirstRun||"ready-for-first-run"===e.displayedStep;return E.map((t,a)=>{let s,i=function(e,t){if(t.readyForFirstRun||function(e,t){switch(e){case"connect-services":return!!t.summary&&function(e){return e.envKeyPresence.LINEAR_API_KEY&&e.envKeyPresence.CURSOR_API_KEY&&e.envKeyPresence.GITHUB_TOKEN&&e.envKeyPresence.VERCEL_TOKEN}(t.summary);case"linear-workspace":var r,n,a,s,i,l=t.controlPlaneContext;let o=null==l||null==(i=l.state)?void 0:i.linear;return!!(null==o?void 0:o.teamKey)&&(o.statusCoverageComplete||!0===o.manualComplete);case"vercel-bridge":return!!(null==(r=t.controlPlaneContext)||null==(a=r.state)||null==(n=a.vercel)?void 0:n.projectId);case"choose-target-repos":return(null==(s=t.summary)?void 0:s.overview.localFilesPresent)===!0;default:return!1}}(e,{summary:t.summary,controlPlaneContext:t.controlPlaneContext}))return!0;let r="choose-target-repos"===e?"local-setup":e,n=t.readinessSteps.find(e=>e.id===r);return(null==n?void 0:n.status)==="complete"||O(t.readinessCurrentStepId,r)>0}(t.id,{readinessCurrentStepId:e.readinessCurrentStepId,readinessSteps:e.readinessSteps,readyForFirstRun:e.readyForFirstRun,summary:e.summary,controlPlaneContext:e.controlPlaneContext}),l=!n&&r===t.id;return s=n?"completed":l?"current":i?"completed":"upcoming",{...t,state:s,stepNumber:a+1}})})({displayedStep:V,readinessCurrentStepId:ec.currentStepId,readinessSteps:ec.steps,readyForFirstRun:ec.readyForFirstRun,summary:g,controlPlaneContext:G}),[G,V,ec.currentStepId,ec.readyForFirstRun,ec.steps,g]),eO=(0,a.useRef)(null),eL=(0,a.useRef)(V),eF=function(e,t){if(null===e||e===t)return"none";let r=T(e)-T(t);return r<0?"forward":r>0?"backward":"none"}(eL.current,V);(0,a.useEffect)(()=>{eL.current=V},[V]);let eH=ec.readyForFirstRun?"Setup complete":z?"Finalizing workflow install":"Setup in progress",eB=(0,a.useCallback)(e=>{m(e),f(!0),(0,tr.u)(e)&&(es.current=null,el(V))},[V,el]);return h?(0,n.jsxs)("div",{className:"".concat(R.rs.configureContent," ").concat(R.rs.sectionStack),children:[(0,n.jsxs)("section",{className:R.Es.section,children:[(0,n.jsxs)("div",{className:R.Es.stackSm,children:[(0,n.jsx)("h2",{className:R.xp.pageTitle,children:"Initial Harness Configuration"}),(0,n.jsx)("p",{className:R.xp.pageDescription,children:"Guided first-run readiness for the Product Development Harness. Complete local setup, local readiness checks, cloud secrets, and target workflow install before your first future harness run."})]}),(0,n.jsx)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[e_?(0,n.jsx)(F.$,{type:"button",variant:"ghost",size:"sm",className:"text-muted-foreground",onClick:eA,children:"Back"}):null,(0,n.jsx)("div",{className:R.Es.inline,children:(0,n.jsx)(D.W,{label:eH,variant:ec.readyForFirstRun?"success":"warning"})})]})})]}),(0,n.jsx)("section",{className:R.Es.section,children:(0,n.jsx)(e9,{stages:eK})}),(0,n.jsx)("div",{className:R.Es.section,children:(0,n.jsx)("div",{ref:eO,children:(0,n.jsx)(te,{stepKey:V,direction:eF,panelRef:eO,children:(()=>{switch(V){case"connect-services":return(0,n.jsx)(eg,{mode:"guided",guidedStep:"connect-services",initialEnv:ep,initialConfig:o.config,initialHarnessProvisioningSummary:I,onSummaryUpdated:eS,onHarnessProvisioningSummaryUpdated:ex,onConnectServicesComplete:ey,onConnectServicesSucceeded:()=>en("connect-services")},"guided-connect-services");case"linear-workspace":return(0,n.jsx)(eC,{readiness:ec,initialSummary:b,linearApiKeyConfigured:g.envKeyPresence.LINEAR_API_KEY,availableRepos:o.config.repos.filter(e=>e.id.trim()&&e.targetRepo.trim()).map(e=>({id:e.id.trim(),targetRepo:e.targetRepo.trim()})),onSummaryUpdated:k,onUiStateChange:ef,onContinue:ew,onStepCompleted:()=>en("linear-workspace")});case"vercel-bridge":return(0,n.jsx)(eT,{readiness:ec,initialSummary:j,onSummaryUpdated:S,onUiStateChange:ev,onContinue:eb,onStepCompleted:()=>en("vercel-bridge")});case"choose-target-repos":return(0,n.jsx)(eg,{mode:"guided",guidedStep:"choose-target-repos",initialEnv:ep,initialConfig:o.config,initialHarnessProvisioningSummary:I,highlightStaleDispatch:eu,highlightStaleTarget:ed,onSummaryUpdated:eS,onHarnessProvisioningSummaryUpdated:ex,onUiStateChange:em,onGuidedLocalApplySuccess:eR,onContinue:eI,onStepCompleted:()=>en("choose-target-repos"),localSetupFilesExist:_(g)},"guided-local-setup");case"local-readiness":return(0,n.jsx)(eU,{readiness:ec,onContinue:ek,onStepCompleted:()=>en("local-readiness")});case"cloud-secrets":return(0,n.jsx)(e$,{readiness:ec,setupSummary:g,controlPlaneContext:G,cloudSecretsPreviewOpened:H.cloudSecretsPreviewOpened,remoteSecretPreviewStale:H.remoteSecretPreviewStale,cloudSecretsApplyEvidence:H.cloudSecretsApplyEvidence,initialSummary:y,onSummaryUpdated:w,onUiStateChange:eh,onContinue:ej,onStepCompleted:()=>en("cloud-secrets"),blockedByUpstream:ec.remoteSetupBlockedByUpstream,onGoToHarnessRepo:()=>M("choose-target-repos"),onGoToConnectServices:()=>M("connect-services")});case"target-workflow":return(0,n.jsx)(e5,{initialSummary:y,onSummaryUpdated:w,onWorkflowSetupComplete:eN,onWorkflowAwaitingMergeChange:Z,pendingInstallByRepo:Y,finalizationByRepo:q,onPendingInstallChange:J,onFinalizationChange:$,onStepCompleted:()=>en("target-workflow"),onContinue:eP,blockedByUpstream:ec.remoteSetupBlockedByUpstream});case"ready-for-first-run":return(0,n.jsx)(W.i,{title:"Setup complete",description:"Harness setup is ready for workflow configuration and future runs.",children:(0,n.jsxs)("div",{className:R.Es.stackSm,children:[(0,n.jsx)(D.W,{label:"Setup complete",variant:"success"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Your harness setup is ready. The target workflow install finished automatically when production verification succeeded."}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:ec.prohibitedActionsNote}),(0,n.jsx)(F.$,{asChild:!0,children:(0,n.jsx)(B(),{href:"/workflow",children:"Continue to Workflow"})})]})})}})()})})})]}):(0,n.jsx)("div",{className:R.rs.configureContent,children:(0,n.jsx)(tt.DataSharingPreferences,{mode:"onboarding",nonce:c,initialPreferences:p,onOnboardingComplete:eB})})}},4277:(e,t,r)=>{"use strict";r.d(t,{b0:()=>a});let n="1"===r(7011).env.P_DEV_CONFIGURE_TIMING;function a(e){n&&console.info("[configure-timing] client ".concat(e))}},7368:(e,t,r)=>{"use strict";r.d(t,{Bw:()=>i,UY:()=>l,df:()=>s,gy:()=>a,m5:()=>o});var n=r(100);function a(e){return new Set(e.map(e=>(0,n.iF)(e)))}function s(e,t){return e.filter(e=>e.teamId!==t.teamId||e.projectId!==t.projectId)}function i(e,t){return e.filter(e=>e.teamId!==t)}function l(e){if(!e.targetRepo.trim()||!e.repoConfigId.trim())return e.draft;let t=a(e.draft),r=[...e.draft];for(let a of e.projects){let s={workspaceId:e.workspaceId,teamId:e.team.id,teamKey:e.team.key,teamName:e.team.name,projectId:a.id,projectName:a.name,targetRepo:e.targetRepo,repoConfigId:e.repoConfigId},i=(0,n.iF)(s);t.has(i)||(r.push(s),t.add(i))}return r}function o(e){let t=a(e.draft),r=(0,n.iF)(e.association);return t.has(r)?e.draft:[...e.draft,e.association]}},7885:(e,t,r)=>{"use strict";function n(e){return"enabled"===e.analyticsPreference&&"enabled"===e.errorReportingPreference}r.d(t,{u:()=>n})},7898:(e,t,r)=>{"use strict";r.d(t,{DataSharingPreferences:()=>d});var n=r(4568),a=r(7620),s=r(6845),i=r(3968),l=r(7431),o=r(7885);async function c(e,t){let r=await fetch("/api/observability/preferences",{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json","x-p-dev-observability-nonce":t},body:JSON.stringify(e)});if(!r.ok)throw Error("Could not save data sharing preferences.");return await r.json()}function d(e){let{mode:t,nonce:r,initialPreferences:d,onOnboardingComplete:u}=e,[p,m]=(0,a.useState)(()=>(0,o.u)(d)),[h,f]=(0,a.useState)(()=>(0,o.u)(d)),[g,v]=(0,a.useState)(null),[y,x]=(0,a.useState)(!1),[w,b]=(0,a.useState)(!1),k=h!==p,j=(0,a.useCallback)(async e=>{if(!r)return v("Data sharing security token is unavailable."),null;x(!0),v(null),b(!1);try{let n=e?"enabled":"disabled",a=await c({analyticsPreference:n,errorReportingPreference:n,disclosureShown:!0},r);return"settings"===t&&(b(!0),m(e)),a}catch(e){return v(e instanceof Error?e.message:"Could not save data sharing preferences."),null}finally{x(!1)}},[t,r]),S=(0,a.useCallback)(async()=>{let e=await j(h);e&&"onboarding"===t&&(null==u||u({analyticsPreference:e.analyticsPreference,errorReportingPreference:e.errorReportingPreference,disclosureShown:e.disclosureShown}))},[h,t,u,j]);return(0,n.jsx)(i.i,{title:"Data sharing",description:"These preferences are stored locally only.",children:(0,n.jsxs)("div",{className:l.Es.stackSm,children:[(0,n.jsxs)("label",{className:"flex cursor-pointer items-start gap-2 text-sm disabled:cursor-not-allowed has-[:disabled]:cursor-not-allowed",children:[(0,n.jsx)("input",{type:"checkbox",className:"mt-0.5 cursor-pointer disabled:cursor-not-allowed",checked:h,disabled:y,onChange:e=>{f(e.target.checked),b(!1)},"data-guided-step-focus":!0}),(0,n.jsx)("span",{children:"Allow anonymous product analytics and error reports to improve functionality and performance."})]}),"onboarding"===t?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"You can change this at any time in Settings."}):null,(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsx)(s.$,{type:"button",disabled:y||!r||"settings"===t&&!k,onClick:()=>void S(),children:"onboarding"===t?"Continue setup":"Save changes"}),"settings"===t&&w?(0,n.jsx)("span",{className:"text-sm text-muted-foreground",children:"Saved."}):null]}),g?(0,n.jsx)("p",{className:"text-sm text-destructive",children:g}):null]})})}}},e=>{e.O(0,[691,845,9289,3800,8002,7420,9576,464,9188,5567,6240,587,18,7358],()=>e(e.s=2811)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6494],{639:(e,t,r)=>{"use strict";r.d(t,{X:()=>s,r:()=>l});var n=r(7620),i=r(7017);function a(e){return"planning"===e?"planner":"builder"}function s(e,t){var r,n;return t?null!=(n=null==(r=e.find(e=>e.id===t))?void 0:r.displayName)?n:t:"Unknown model"}function l(e){let{bootstrap:t,committedSelections:r,onCommittedSelectionsChange:s,onBootstrapFingerprintChange:l}=e,{optimisticSelections:o,saveErrors:d,handleModelSelect:c,handleModelParameter:u,retrySave:p,saveStateLabel:m}=function(e){let{context:t,committedSelections:r,onCommittedSelectionChange:s,onFingerprintChange:l}=e,[o,d]=(0,n.useState)(r),[c,u]=(0,n.useState)({planning:"idle",implementation:"idle"}),[p,m]=(0,n.useState)({}),f=(0,n.useRef)({}),g=(0,n.useRef)(t.configFingerprint),h=(0,n.useRef)({planning:0,implementation:0});g.current=t.configFingerprint;let b=(0,n.useCallback)(e=>{let t=a(e),n=r[t];d(e=>({...e,[t]:n}))},[r]),x=(0,n.useCallback)(async(e,r,n)=>{let o=a(e);try{let a=await (0,i.S)({role:o,modelId:r.modelId,params:r.parameters,expectedConfigFingerprint:g.current,sourceMode:t.sourceMode,fixtureId:t.fixtureId,scopeId:t.selectedScopeId,sequenceId:n});if(n!==h.current[e])return;g.current=a.configFingerprint,l(a.configFingerprint),s(o,r),u(t=>({...t,[e]:"saved"})),m(t=>{let r={...t};return delete r[e],r})}catch(r){if(n!==h.current[e])return;b(e),u(t=>({...t,[e]:"error"}));let t=(r instanceof Error&&"code"in r,r);m(n=>({...n,[e]:{code:"object"==typeof t&&t&&"code"in t&&"string"==typeof t.code?t.code:void 0,message:r instanceof Error?r.message:"Couldn't save model settings."}}))}},[t.fixtureId,t.selectedScopeId,t.sourceMode,s,l,b]),v=(0,n.useCallback)((e,t)=>{let r=f.current[e];r&&clearTimeout(r),u(t=>({...t,[e]:"saving"})),m(t=>{let r={...t};return delete r[e],r}),f.current[e]=setTimeout(()=>{let r=h.current[e]+1;h.current[e]=r,x(e,t,r)},400)},[x]),w=(0,n.useCallback)(e=>{let t=o[a(e)];v(e,t)},[o,v]),y=(0,n.useCallback)((e,t,r)=>{var n,i;let s=a(e),l=r.find(e=>e.id===t),o=null!=(n=null==l?void 0:l.supportedParameters.filter(e=>"boolean"===e.type).map(e=>{var t;return{id:e.id,value:null!=(t=e.defaultValue)?t:"false"}}))?n:[],c={modelId:t,displayName:null!=(i=null==l?void 0:l.id)?i:t,parameters:o,source:"roleModels"};d(e=>({...e,[s]:c})),v(e,c)},[v]),k=(0,n.useCallback)((e,t,r)=>{let n=a(e),i=o[n],s={...i,parameters:[...i.parameters.filter(e=>e.id!==t),{id:t,value:r}]};d(e=>({...e,[n]:s})),v(e,s)},[o,v]);return{optimisticSelections:o,saveState:c,saveErrors:p,handleModelSelect:y,handleModelParameter:k,retrySave:w,saveStateLabel:e=>{switch(c[e]){case"saving":return"Saving…";case"saved":return"Saved";case"error":return"Couldn't save. Your previous model is still active.";default:return null}},syncCommittedSelections:(0,n.useCallback)(e=>{d(e)},[])}}({context:{sourceMode:t.sourceMode,fixtureId:t.fixtureId,selectedScopeId:t.selectedScopeId,configFingerprint:t.configFingerprint},committedSelections:r,onCommittedSelectionChange:s,onFingerprintChange:l}),f=(0,n.useCallback)((e,r)=>{c(e,r,t.modelCatalog)},[t.modelCatalog,c]),g=(0,n.useCallback)((e,t,r)=>{u(e,t,r)},[u]);return{plannerSelection:o.planner,builderSelection:o.builder,handleModelSelect:f,handleModelParameter:g,retrySave:p,saveStateLabel:m,saveErrorDetail:e=>{var t;return null==(t=d[e])?void 0:t.message}}}},826:(e,t,r)=>{"use strict";r.d(t,{cn:()=>a});var n=r(2902),i=r(3714);function a(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,i.QP)((0,n.$)(t))}},889:(e,t,r)=>{"use strict";r.d(t,{G:()=>a});var n=r(4568),i=r(2462);function a(e){let{label:t,phaseKey:r,disabled:a=!1,modelCatalog:s,modelId:l,parameters:o,saveLabel:d,saveErrorDetail:c,onSelectModel:u,onUpdateModelParameter:p,onRetry:m}=e,f=s.find(e=>e.id===l),g=(null==d?void 0:d.startsWith("Couldn't save"))&&m;return(0,n.jsxs)("div",{className:"space-y-2 rounded-md border border-border bg-muted/30 p-4",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsx)("span",{className:"font-medium",children:t}),d?(0,n.jsx)("span",{className:"text-xs text-muted-foreground","aria-live":"polite",children:d}):null]}),c?(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:c}):null,g?(0,n.jsx)("button",{type:"button",className:"text-xs font-medium text-primary underline-offset-4 hover:underline",onClick:()=>m(r),children:"Retry"}):null,(0,n.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:"Model"}),(0,n.jsx)(i.l,{disabled:a,value:l,onChange:e=>u(r,e.target.value),children:s.filter(e=>"available"===e.availability).map(e=>(0,n.jsx)("option",{value:e.id,children:e.displayName},e.id))})]}),f?f.supportedParameters.filter(e=>"boolean"===e.type).map(e=>{var t;let i=null==(t=o.find(t=>t.id===e.id))?void 0:t.value;return(0,n.jsxs)("label",{className:"flex items-center justify-between gap-2 text-sm",children:[(0,n.jsx)("span",{children:e.label}),(0,n.jsx)("input",{type:"checkbox",role:"switch","aria-label":e.label,disabled:a||!l,checked:"true"===i,onChange:t=>p(r,e.id,t.target.checked?"true":"false")})]},e.id)}):null]})}},5311:(e,t,r)=>{"use strict";r.d(t,{WorkflowPageClient:()=>M});var n=r(4568),i=r(7620),a=r(8049);function s(e){var t,r;let{scopes:i,selectedScopeId:s,disabled:l=!1,onScopeChange:o}=e;return i.length<=1?null:(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsx)(a.J,{htmlFor:"workflow-scope-select",className:"text-xs text-muted-foreground",children:"Workflow scope"}),(0,n.jsx)("select",{id:"workflow-scope-select",className:"max-w-md rounded-md border border-input bg-background px-2 py-1.5 text-sm",value:null!=(r=null!=s?s:null==(t=i[0])?void 0:t.id)?r:"",disabled:l,onChange:e=>o(e.target.value),children:i.map(e=>(0,n.jsx)("option",{value:e.id,children:e.targetRepo},e.id))})]})}function l(e){return e.filter(e=>e.statusKey&&("duplicate"!==e.statusKey||"missing-status"!==e.kind))}function o(e){return new Set(l(e).map(e=>e.statusKey).filter(Boolean)).size}function d(e){let{bootstrap:t}=e;if(function(e){let{healthState:t,violations:r}=e.canonicalWorkflow;return"linear-unavailable"!==t&&("healthy"===t||0===o(r))}(t))return null;let r=o(t.canonicalWorkflow.violations),i="linear-unavailable"===t.canonicalWorkflow.healthState;return(0,n.jsxs)("section",{"aria-label":"Workflow health",className:"rounded-md border p-3 ".concat(i?"border-amber-500/40 bg-amber-500/5 text-amber-800 dark:text-amber-200":"border-destructive/40 bg-destructive/5 text-destructive"),children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:"Workflow health: Needs attention"}),r>0?(0,n.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[r," ",1===r?"status needs":"statuses need"," ","attention"]}):null,i&&0===r?(0,n.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:"Linear is unavailable."}):null]})}var c=r(6289);let u=(0,r(2068).A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),p=[{id:"human",title:"Human-owned",description:"Decisions, approvals, and manual intervention.",statuses:["backlog","pm-review","engineering-review","blocked","canceled","duplicate"]},{id:"harness",title:"Harness-owned",description:"Triggers, handoffs, orchestration, and system transitions.",statuses:["ready-for-planning","ready-for-build","pr-open","needs-revision","ready-to-merge","merging","merged-to-dev","merged-deployed"]},{id:"agent",title:"Agent-owned",description:"Work performed by Cursor Cloud Agents.",statuses:["planning","building","revising"]}];var m=r(6309);let f="No automatic destination.";function g(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return{label:"Destinations",value:t.join(", ")}}function h(e){return{label:"Next status",value:e}}function b(){return{label:"On failure",value:"Blocked"}}function x(e){return{label:"Success",value:e}}function v(){return{label:"Failure",value:"Blocked"}}let w={backlog:{description:"Work waiting for human triage.",fields:[g("Ready for Planning","Ready for Build")]},"pm-review":{description:"Product review of the implemented change and preview.",fields:[g("Needs Revision","Engineering Review")]},"engineering-review":{description:"Engineering approval before merge.",fields:[g("Needs Revision","Ready to Merge")]},blocked:{description:"Automation stopped and requires human intervention.",fields:[{label:"Destinations",value:f}]},canceled:{description:"Work intentionally stopped.",fields:[{label:"Destinations",value:f}]},duplicate:{description:"Work closed because it duplicates another issue.",fields:[{label:"Destinations",value:f}]},"ready-for-planning":{description:"The harness packages the issue and starts planning.",fields:[h("Planning"),b()]},"ready-for-build":{description:"The harness assembles the implementation context and starts the Builder.",fields:[h("Building"),b()]},"pr-open":{description:"The harness finds and inspects the implementation PR, captures preview information, and prepares the PM handoff.",fields:[h("PM Review"),b()]},"needs-revision":{description:"The harness gathers review feedback and sends the existing PR back to the Builder in revision mode.",fields:[h("Revising"),b()]},"ready-to-merge":{description:"The harness begins merge validation and execution.",fields:[h("Merging"),b()]},merging:{description:"The harness evaluates checks, repairs integration problems when necessary, and performs the merge.",fields:[],builderModelNote:"Agent-based integration repair uses the Builder model."},"merged-to-dev":{description:"The change is merged to the integration branch and is waiting for production promotion.",fields:[h("Merged / Deployed")]},"merged-deployed":{description:"The change has reached the configured production branch.",fields:[{label:"Outcome",value:"Workflow complete."}]},planning:{description:"The Planner converts the issue into an implementation-ready plan.",fields:[x("Ready for Build"),v()],showPlannerModel:!0},building:{description:"The Builder implements the work, validates it, and creates or updates the pull request.",fields:[x("PR Open"),v()],showBuilderModel:!0},revising:{description:"The same Builder role applies PM or engineering feedback to the existing branch and pull request.",fields:[x("PM Review"),v()],showBuilderModelReference:!0}};var y=r(639),k=r(889);let j="workflow-expanded-cards";function N(e){let{bootstrap:t,disabled:r=!1,onSelectModel:a,onUpdateModelParameter:s,saveStateLabel:o,saveErrorDetail:d}=e,[f,g]=(0,i.useState)(()=>(function(){try{let e=window.sessionStorage.getItem(j);if(!e)return new Set;return new Set(JSON.parse(e))}catch(e){return new Set}})());(0,i.useEffect)(()=>{window.sessionStorage.setItem(j,JSON.stringify([...f]))},[f]);let h=(0,y.X)(t.modelCatalog,t.builderSelection.modelId);return(0,n.jsx)("div",{className:"grid grid-cols-1 gap-8 lg:grid-cols-3 lg:gap-6",children:p.map(e=>(0,n.jsxs)("section",{"aria-label":e.title,className:"space-y-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{className:"text-base font-semibold",children:e.title}),(0,n.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:e.description})]}),(0,n.jsx)("div",{className:"space-y-2",children:e.statuses.map(e=>{var i,p;let x=(0,c.NK)(e);if(!x)return null;let v=f.has(e),y=(p=t.canonicalWorkflow.violations,l(p).find(t=>t.statusKey===e)),j=y?function(e){if("needs-revision"===e.statusKey&&"wrong-category"===e.kind){var t,r,n,i;let a=function(e){let t=e.match(/expected "([^"]+)", got "([^"]+)"/);return t?{expected:t[1],actual:t[2]}:{}}(e.message),s=null!=(n=null!=(r=a.expected)?r:null==(t=(0,c.NK)("needs-revision"))?void 0:t.category)?n:"unstarted",l=null!=(i=a.actual)?i:"started";return{primary:"Needs Revision is configured as active work in Linear.",body:"Needs Revision should mean work is waiting to begin. Active revision work belongs in Revising.",diagnostic:["Expected Linear category: ".concat((0,m.L)(s)),"Current Linear category: ".concat((0,m.L)(l))]}}return{primary:e.message}}(y):null,N=function(e,t){let r=w[e];return"merging"===e?{...r,fields:["direct-production"===t?{label:"Destinations",value:"Merged / Deployed when integration and production branches are the same"}:{label:"Destinations",value:"Merged to Dev when integration and production branches differ; Merged / Deployed when they are the same"},b()]}:r}(e,t.canonicalWorkflow.mergePathVariant);return(0,n.jsxs)("div",{className:"rounded-md border ".concat(y?"border-destructive/50":"border-border"),children:[(0,n.jsxs)("button",{type:"button",className:"flex w-full cursor-pointer items-center justify-between gap-2 px-3 py-2.5 text-left","aria-expanded":v,onClick:()=>{g(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},children:[(0,n.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,n.jsx)("span",{className:"text-sm font-medium",children:x.name}),y?(0,n.jsx)(u,{className:"size-4 shrink-0 text-destructive","aria-label":"Needs attention"}):null]}),(0,n.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:v?"Collapse":"Expand"})]}),v?(0,n.jsxs)("div",{className:"space-y-2 border-t border-border px-3 py-3 text-sm",children:[j?(0,n.jsxs)("div",{className:"space-y-1 text-destructive",children:[(0,n.jsx)("p",{children:j.primary}),j.body?(0,n.jsx)("p",{children:j.body}):null,null==(i=j.diagnostic)?void 0:i.map(e=>(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:e},e))]}):null,(0,n.jsx)("p",{className:"text-muted-foreground",children:N.description}),N.fields.map(t=>(0,n.jsxs)("p",{children:[(0,n.jsxs)("span",{className:"font-medium",children:[t.label,":"]})," ",t.value]},"".concat(e,"-").concat(t.label))),N.builderModelNote?(0,n.jsx)("p",{className:"text-muted-foreground",children:N.builderModelNote}):null,N.showPlannerModel?(0,n.jsx)(k.G,{label:"Planner model",phaseKey:"planning",disabled:r,modelCatalog:t.modelCatalog,modelId:t.plannerSelection.modelId,parameters:t.plannerSelection.parameters,saveLabel:o("planning"),saveErrorDetail:null==d?void 0:d("planning"),onSelectModel:a,onUpdateModelParameter:s}):null,N.showBuilderModel?(0,n.jsx)(k.G,{label:"Builder model",phaseKey:"implementation",disabled:r,modelCatalog:t.modelCatalog,modelId:t.builderSelection.modelId,parameters:t.builderSelection.parameters,saveLabel:o("implementation"),saveErrorDetail:null==d?void 0:d("implementation"),onSelectModel:a,onUpdateModelParameter:s}):null,N.showBuilderModelReference?(0,n.jsxs)("p",{children:[(0,n.jsx)("span",{className:"font-medium",children:"Uses Builder model:"})," ",h]}):null]}):null]},e)})})]},e.id))})}var S=r(7017);function C(e){return{planner:e.plannerSelection,builder:e.builderSelection}}function M(e){let{initialBootstrap:t}=e,[r,a]=(0,i.useState)(t),[l,o]=(0,i.useState)(()=>C(t)),[c,u]=(0,i.useState)(!1),p=(0,i.useRef)(null),m=(0,i.useRef)(0),f=void 0===r.selectedScopeId&&r.scopes.length>0?"Workflow scope is required.":null,g=(0,i.useCallback)(e=>{a(t=>({...t,configFingerprint:e}))},[]),h=(0,i.useCallback)((e,t)=>{o(r=>({...r,[e]:t}))},[]),{plannerSelection:b,builderSelection:x,handleModelSelect:v,handleModelParameter:w,saveStateLabel:k,saveErrorDetail:j}=(0,y.r)({bootstrap:r,committedSelections:l,onCommittedSelectionsChange:h,onBootstrapFingerprintChange:g}),M=(0,i.useCallback)(async e=>{var t;if(e===r.selectedScopeId||c)return;null==(t=p.current)||t.abort();let n=new AbortController;p.current=n;let i=m.current+1;m.current=i,u(!0);try{let t=await (0,S.w)({sourceMode:r.sourceMode,fixtureId:r.fixtureId,scopeId:e,signal:n.signal});if(i!==m.current)return;a(t),o(C(t))}catch(e){if(e instanceof Error&&"AbortError"===e.name)return}finally{i===m.current&&u(!1)}},[r.fixtureId,r.selectedScopeId,r.sourceMode,c]);if(f)return(0,n.jsxs)("div",{className:"space-y-6",children:[(0,n.jsxs)("header",{className:"space-y-1",children:[(0,n.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:"Workflow"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Review workflow responsibilities and configure the models used for agent work."})]}),(0,n.jsxs)("div",{className:"rounded-md border border-destructive/40 bg-card p-4",children:[(0,n.jsx)("h2",{className:"text-base font-semibold",children:"Workflow configuration unavailable"}),(0,n.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:f})]})]});let I={...r,plannerSelection:b,builderSelection:x};return(0,n.jsxs)("div",{className:"space-y-8","aria-busy":c,children:[(0,n.jsxs)("header",{className:"space-y-1",children:[(0,n.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:"Workflow"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Review workflow responsibilities and configure the models used for agent work."})]}),r.scopes.length>0?(0,n.jsx)(s,{scopes:r.scopes,selectedScopeId:r.selectedScopeId,disabled:c,onScopeChange:e=>void M(e)}):null,(0,n.jsx)(d,{bootstrap:I}),(0,n.jsx)(N,{bootstrap:I,disabled:c,onSelectModel:v,onUpdateModelParameter:w,saveStateLabel:k,saveErrorDetail:j})]})}},6845:(e,t,r)=>{"use strict";r.d(t,{$:()=>d});var n=r(4568),i=r(7620),a=r(6118),s=r(4616),l=r(826);let o=(0,s.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring cursor-pointer disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8"}},defaultVariants:{variant:"default",size:"default"}}),d=i.forwardRef((e,t)=>{let{className:r,variant:i,size:s,asChild:d=!1,...c}=e,u=d?a.DX:"button";return(0,n.jsx)(u,{className:(0,l.cn)(o({variant:i,size:s,className:r})),ref:t,...c})});d.displayName="Button"},7017:(e,t,r)=>{"use strict";function n(e){let t=new URLSearchParams;(null==e?void 0:e.sourceMode)==="fixture"&&e.fixtureId&&(t.set("source","fixture"),t.set("fixture",e.fixtureId)),(null==e?void 0:e.scopeId)&&t.set("scope",e.scopeId);let r=t.toString();return r?"?".concat(r):""}async function i(e){let t=await fetch("/api/workflow/bootstrap".concat(n(e)),{signal:null==e?void 0:e.signal});if(!t.ok)throw Error("Failed to load Workflow bootstrap data.");return await t.json()}async function a(e){var t,r;let i=await fetch("/api/workflow/models".concat(n(e)),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({role:e.role,modelId:e.modelId,params:e.params,expectedConfigFingerprint:e.expectedConfigFingerprint,sourceMode:e.sourceMode,fixtureId:e.fixtureId,scopeId:e.scopeId})}),a=await i.json();if(!i.ok||!a.saved||!a.configFingerprint){let e=Error(null!=(t=a.error)?t:"Couldn't save model settings.");throw e.code=a.code,e}return{configFingerprint:a.configFingerprint,savedAt:null!=(r=a.savedAt)?r:new Date().toISOString(),sequenceId:e.sequenceId}}r.d(t,{S:()=>a,w:()=>i})},7401:(e,t,r)=>{"use strict";r.d(t,{P:()=>n});let n={fieldStack:"space-y-2",fieldGrid:"grid grid-cols-1 gap-4 md:grid-cols-2",actions:"flex flex-wrap items-center gap-3",confirmationBox:"rounded-md border border-border bg-muted/20 p-4 space-y-3",secretHint:"text-xs text-muted-foreground",guidedSelect:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"}},7870:(e,t,r)=>{Promise.resolve().then(r.bind(r,7366)),Promise.resolve().then(r.bind(r,5311)),Promise.resolve().then(r.t.bind(r,9664,23))},8049:(e,t,r)=>{"use strict";r.d(t,{J:()=>s});var n=r(4568),i=r(7620),a=r(826);let s=i.forwardRef((e,t)=>{let{className:r,...i}=e;return(0,n.jsx)("label",{ref:t,className:(0,a.cn)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),...i})});s.displayName="Label"}},e=>{e.O(0,[9289,3800,7420,5567,587,18,7358],()=>e(e.s=7870)),_N_E=e.O()}]);
|