p-dev-harness 0.3.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/LICENSE +21 -0
- package/README.md +53 -0
- package/bin/p-dev.js +2 -0
- package/dist/agents/cursor-provider.d.ts +3 -0
- package/dist/agents/cursor-provider.d.ts.map +1 -0
- package/dist/agents/cursor-provider.js +60 -0
- package/dist/agents/cursor-provider.js.map +1 -0
- package/dist/agents/index.d.ts +12 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +24 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/provider.d.ts +4 -0
- package/dist/agents/provider.d.ts.map +1 -0
- package/dist/agents/provider.js +5 -0
- package/dist/agents/provider.js.map +1 -0
- package/dist/agents/types.d.ts +59 -0
- package/dist/agents/types.d.ts.map +1 -0
- package/dist/agents/types.js +2 -0
- package/dist/agents/types.js.map +1 -0
- package/dist/artifacts/events.d.ts +8 -0
- package/dist/artifacts/events.d.ts.map +1 -0
- package/dist/artifacts/events.js +23 -0
- package/dist/artifacts/events.js.map +1 -0
- package/dist/artifacts/manifest-fields.d.ts +8 -0
- package/dist/artifacts/manifest-fields.d.ts.map +1 -0
- package/dist/artifacts/manifest-fields.js +10 -0
- package/dist/artifacts/manifest-fields.js.map +1 -0
- package/dist/artifacts/manifest.d.ts +4 -0
- package/dist/artifacts/manifest.d.ts.map +1 -0
- package/dist/artifacts/manifest.js +11 -0
- package/dist/artifacts/manifest.js.map +1 -0
- package/dist/artifacts/paths.d.ts +36 -0
- package/dist/artifacts/paths.d.ts.map +1 -0
- package/dist/artifacts/paths.js +107 -0
- package/dist/artifacts/paths.js.map +1 -0
- package/dist/artifacts/redact.d.ts +3 -0
- package/dist/artifacts/redact.d.ts.map +1 -0
- package/dist/artifacts/redact.js +45 -0
- package/dist/artifacts/redact.js.map +1 -0
- package/dist/artifacts/run-id.d.ts +2 -0
- package/dist/artifacts/run-id.d.ts.map +1 -0
- package/dist/artifacts/run-id.js +5 -0
- package/dist/artifacts/run-id.js.map +1 -0
- package/dist/artifacts/snapshot.d.ts +3 -0
- package/dist/artifacts/snapshot.d.ts.map +1 -0
- package/dist/artifacts/snapshot.js +9 -0
- package/dist/artifacts/snapshot.js.map +1 -0
- package/dist/artifacts/summary.d.ts +9 -0
- package/dist/artifacts/summary.d.ts.map +1 -0
- package/dist/artifacts/summary.js +68 -0
- package/dist/artifacts/summary.js.map +1 -0
- package/dist/cli/commands/diagnose-vercel-bridge.d.ts +5 -0
- package/dist/cli/commands/diagnose-vercel-bridge.d.ts.map +1 -0
- package/dist/cli/commands/diagnose-vercel-bridge.js +20 -0
- package/dist/cli/commands/diagnose-vercel-bridge.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +6 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +190 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/inspect.d.ts +5 -0
- package/dist/cli/commands/inspect.d.ts.map +1 -0
- package/dist/cli/commands/inspect.js +39 -0
- package/dist/cli/commands/inspect.js.map +1 -0
- package/dist/cli/commands/operator-init.d.ts +5 -0
- package/dist/cli/commands/operator-init.d.ts.map +1 -0
- package/dist/cli/commands/operator-init.js +30 -0
- package/dist/cli/commands/operator-init.js.map +1 -0
- package/dist/cli/commands/redact-output.d.ts +2 -0
- package/dist/cli/commands/redact-output.d.ts.map +1 -0
- package/dist/cli/commands/redact-output.js +18 -0
- package/dist/cli/commands/redact-output.js.map +1 -0
- package/dist/cli/commands/resolve-route.d.ts +10 -0
- package/dist/cli/commands/resolve-route.d.ts.map +1 -0
- package/dist/cli/commands/resolve-route.js +67 -0
- package/dist/cli/commands/resolve-route.js.map +1 -0
- package/dist/cli/commands/run.d.ts +12 -0
- package/dist/cli/commands/run.d.ts.map +1 -0
- package/dist/cli/commands/run.js +36 -0
- package/dist/cli/commands/run.js.map +1 -0
- package/dist/cli/commands/sync-production.d.ts +25 -0
- package/dist/cli/commands/sync-production.d.ts.map +1 -0
- package/dist/cli/commands/sync-production.js +147 -0
- package/dist/cli/commands/sync-production.js.map +1 -0
- package/dist/cli/commands/validate-issue.d.ts +9 -0
- package/dist/cli/commands/validate-issue.d.ts.map +1 -0
- package/dist/cli/commands/validate-issue.js +53 -0
- package/dist/cli/commands/validate-issue.js.map +1 -0
- package/dist/cli/exit-codes.d.ts +5 -0
- package/dist/cli/exit-codes.d.ts.map +1 -0
- package/dist/cli/exit-codes.js +5 -0
- package/dist/cli/exit-codes.js.map +1 -0
- package/dist/cli/finalize-exit.d.ts +6 -0
- package/dist/cli/finalize-exit.d.ts.map +1 -0
- package/dist/cli/finalize-exit.js +9 -0
- package/dist/cli/finalize-exit.js.map +1 -0
- package/dist/cli/program.d.ts +3 -0
- package/dist/cli/program.d.ts.map +1 -0
- package/dist/cli/program.js +150 -0
- package/dist/cli/program.js.map +1 -0
- package/dist/config/defaults.d.ts +31 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/defaults.js +34 -0
- package/dist/config/defaults.js.map +1 -0
- package/dist/config/load-config.d.ts +17 -0
- package/dist/config/load-config.d.ts.map +1 -0
- package/dist/config/load-config.js +57 -0
- package/dist/config/load-config.js.map +1 -0
- package/dist/config/load-dotenv.d.ts +2 -0
- package/dist/config/load-dotenv.d.ts.map +1 -0
- package/dist/config/load-dotenv.js +11 -0
- package/dist/config/load-dotenv.js.map +1 -0
- package/dist/config/resolve-config.d.ts +12 -0
- package/dist/config/resolve-config.d.ts.map +1 -0
- package/dist/config/resolve-config.js +98 -0
- package/dist/config/resolve-config.js.map +1 -0
- package/dist/config/schema.d.ts +505 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +110 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/config/status-names.d.ts +25 -0
- package/dist/config/status-names.d.ts.map +1 -0
- package/dist/config/status-names.js +41 -0
- package/dist/config/status-names.js.map +1 -0
- package/dist/config/types.d.ts +2 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +2 -0
- package/dist/config/types.js.map +1 -0
- package/dist/cursor/agent-factory.d.ts +24 -0
- package/dist/cursor/agent-factory.d.ts.map +1 -0
- package/dist/cursor/agent-factory.js +91 -0
- package/dist/cursor/agent-factory.js.map +1 -0
- package/dist/cursor/errors.d.ts +4 -0
- package/dist/cursor/errors.d.ts.map +1 -0
- package/dist/cursor/errors.js +14 -0
- package/dist/cursor/errors.js.map +1 -0
- package/dist/cursor/git-result.d.ts +8 -0
- package/dist/cursor/git-result.d.ts.map +1 -0
- package/dist/cursor/git-result.js +43 -0
- package/dist/cursor/git-result.js.map +1 -0
- package/dist/cursor/model.d.ts +31 -0
- package/dist/cursor/model.d.ts.map +1 -0
- package/dist/cursor/model.js +41 -0
- package/dist/cursor/model.js.map +1 -0
- package/dist/cursor/revision-git-result.d.ts +4 -0
- package/dist/cursor/revision-git-result.d.ts.map +1 -0
- package/dist/cursor/revision-git-result.js +43 -0
- package/dist/cursor/revision-git-result.js.map +1 -0
- package/dist/cursor/run-cleanup.d.ts +6 -0
- package/dist/cursor/run-cleanup.d.ts.map +1 -0
- package/dist/cursor/run-cleanup.js +22 -0
- package/dist/cursor/run-cleanup.js.map +1 -0
- package/dist/cursor/run-observer.d.ts +45 -0
- package/dist/cursor/run-observer.d.ts.map +1 -0
- package/dist/cursor/run-observer.js +228 -0
- package/dist/cursor/run-observer.js.map +1 -0
- package/dist/cursor/urls.d.ts +3 -0
- package/dist/cursor/urls.d.ts.map +1 -0
- package/dist/cursor/urls.js +12 -0
- package/dist/cursor/urls.js.map +1 -0
- package/dist/fixture/frontmatter.d.ts +11 -0
- package/dist/fixture/frontmatter.d.ts.map +1 -0
- package/dist/fixture/frontmatter.js +45 -0
- package/dist/fixture/frontmatter.js.map +1 -0
- package/dist/github/actions-url.d.ts +3 -0
- package/dist/github/actions-url.d.ts.map +1 -0
- package/dist/github/actions-url.js +13 -0
- package/dist/github/actions-url.js.map +1 -0
- package/dist/github/base-branch.d.ts +25 -0
- package/dist/github/base-branch.d.ts.map +1 -0
- package/dist/github/base-branch.js +73 -0
- package/dist/github/base-branch.js.map +1 -0
- package/dist/github/check-policy.d.ts +12 -0
- package/dist/github/check-policy.d.ts.map +1 -0
- package/dist/github/check-policy.js +71 -0
- package/dist/github/check-policy.js.map +1 -0
- package/dist/github/client.d.ts +227 -0
- package/dist/github/client.d.ts.map +1 -0
- package/dist/github/client.js +244 -0
- package/dist/github/client.js.map +1 -0
- package/dist/github/commit-reachability.d.ts +34 -0
- package/dist/github/commit-reachability.d.ts.map +1 -0
- package/dist/github/commit-reachability.js +85 -0
- package/dist/github/commit-reachability.js.map +1 -0
- package/dist/github/links.d.ts +5 -0
- package/dist/github/links.d.ts.map +1 -0
- package/dist/github/links.js +17 -0
- package/dist/github/links.js.map +1 -0
- package/dist/github/merge-result.d.ts +8 -0
- package/dist/github/merge-result.d.ts.map +1 -0
- package/dist/github/merge-result.js +22 -0
- package/dist/github/merge-result.js.map +1 -0
- package/dist/github/pr-discovery.d.ts +12 -0
- package/dist/github/pr-discovery.d.ts.map +1 -0
- package/dist/github/pr-discovery.js +33 -0
- package/dist/github/pr-discovery.js.map +1 -0
- package/dist/github/pr-inspector.d.ts +48 -0
- package/dist/github/pr-inspector.d.ts.map +1 -0
- package/dist/github/pr-inspector.js +190 -0
- package/dist/github/pr-inspector.js.map +1 -0
- package/dist/github/pr-url.d.ts +8 -0
- package/dist/github/pr-url.d.ts.map +1 -0
- package/dist/github/pr-url.js +15 -0
- package/dist/github/pr-url.js.map +1 -0
- package/dist/gui/configure-health.d.ts +15 -0
- package/dist/gui/configure-health.d.ts.map +1 -0
- package/dist/gui/configure-health.js +124 -0
- package/dist/gui/configure-health.js.map +1 -0
- package/dist/gui/dev-server-process.d.ts +25 -0
- package/dist/gui/dev-server-process.d.ts.map +1 -0
- package/dist/gui/dev-server-process.js +165 -0
- package/dist/gui/dev-server-process.js.map +1 -0
- package/dist/gui/port.d.ts +17 -0
- package/dist/gui/port.d.ts.map +1 -0
- package/dist/gui/port.js +50 -0
- package/dist/gui/port.js.map +1 -0
- package/dist/gui/repo-root.d.ts +4 -0
- package/dist/gui/repo-root.d.ts.map +1 -0
- package/dist/gui/repo-root.js +49 -0
- package/dist/gui/repo-root.js.map +1 -0
- package/dist/gui/start-configure-stable.d.ts +3 -0
- package/dist/gui/start-configure-stable.d.ts.map +1 -0
- package/dist/gui/start-configure-stable.js +92 -0
- package/dist/gui/start-configure-stable.js.map +1 -0
- package/dist/gui/start-gui.d.ts +3 -0
- package/dist/gui/start-gui.d.ts.map +1 -0
- package/dist/gui/start-gui.js +90 -0
- package/dist/gui/start-gui.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/linear/client.d.ts +14 -0
- package/dist/linear/client.d.ts.map +1 -0
- package/dist/linear/client.js +30 -0
- package/dist/linear/client.js.map +1 -0
- package/dist/linear/comment-card.d.ts +24 -0
- package/dist/linear/comment-card.d.ts.map +1 -0
- package/dist/linear/comment-card.js +45 -0
- package/dist/linear/comment-card.js.map +1 -0
- package/dist/linear/comments.d.ts +179 -0
- package/dist/linear/comments.d.ts.map +1 -0
- package/dist/linear/comments.js +551 -0
- package/dist/linear/comments.js.map +1 -0
- package/dist/linear/handoff-comment.d.ts +3 -0
- package/dist/linear/handoff-comment.d.ts.map +1 -0
- package/dist/linear/handoff-comment.js +11 -0
- package/dist/linear/handoff-comment.js.map +1 -0
- package/dist/linear/implementation-comment.d.ts +3 -0
- package/dist/linear/implementation-comment.d.ts.map +1 -0
- package/dist/linear/implementation-comment.js +11 -0
- package/dist/linear/implementation-comment.js.map +1 -0
- package/dist/linear/issue-query.d.ts +14 -0
- package/dist/linear/issue-query.d.ts.map +1 -0
- package/dist/linear/issue-query.js +47 -0
- package/dist/linear/issue-query.js.map +1 -0
- package/dist/linear/markers.d.ts +46 -0
- package/dist/linear/markers.d.ts.map +1 -0
- package/dist/linear/markers.js +179 -0
- package/dist/linear/markers.js.map +1 -0
- package/dist/linear/merge-source-comment.d.ts +10 -0
- package/dist/linear/merge-source-comment.d.ts.map +1 -0
- package/dist/linear/merge-source-comment.js +29 -0
- package/dist/linear/merge-source-comment.js.map +1 -0
- package/dist/linear/parser.d.ts +4 -0
- package/dist/linear/parser.d.ts.map +1 -0
- package/dist/linear/parser.js +86 -0
- package/dist/linear/parser.js.map +1 -0
- package/dist/linear/phase-labels.d.ts +8 -0
- package/dist/linear/phase-labels.d.ts.map +1 -0
- package/dist/linear/phase-labels.js +38 -0
- package/dist/linear/phase-labels.js.map +1 -0
- package/dist/linear/planning-comment.d.ts +3 -0
- package/dist/linear/planning-comment.d.ts.map +1 -0
- package/dist/linear/planning-comment.js +11 -0
- package/dist/linear/planning-comment.js.map +1 -0
- package/dist/linear/pm-feedback-comment.d.ts +3 -0
- package/dist/linear/pm-feedback-comment.d.ts.map +1 -0
- package/dist/linear/pm-feedback-comment.js +29 -0
- package/dist/linear/pm-feedback-comment.js.map +1 -0
- package/dist/linear/revision-comment.d.ts +3 -0
- package/dist/linear/revision-comment.d.ts.map +1 -0
- package/dist/linear/revision-comment.js +11 -0
- package/dist/linear/revision-comment.js.map +1 -0
- package/dist/linear/states.d.ts +3 -0
- package/dist/linear/states.d.ts.map +1 -0
- package/dist/linear/states.js +13 -0
- package/dist/linear/states.js.map +1 -0
- package/dist/linear/writer.d.ts +36 -0
- package/dist/linear/writer.d.ts.map +1 -0
- package/dist/linear/writer.js +105 -0
- package/dist/linear/writer.js.map +1 -0
- package/dist/p-dev/browser.d.ts +9 -0
- package/dist/p-dev/browser.d.ts.map +1 -0
- package/dist/p-dev/browser.js +15 -0
- package/dist/p-dev/browser.js.map +1 -0
- package/dist/p-dev/cli.d.ts +10 -0
- package/dist/p-dev/cli.d.ts.map +1 -0
- package/dist/p-dev/cli.js +73 -0
- package/dist/p-dev/cli.js.map +1 -0
- package/dist/p-dev/launch.d.ts +20 -0
- package/dist/p-dev/launch.d.ts.map +1 -0
- package/dist/p-dev/launch.js +107 -0
- package/dist/p-dev/launch.js.map +1 -0
- package/dist/p-dev/main.d.ts +3 -0
- package/dist/p-dev/main.d.ts.map +1 -0
- package/dist/p-dev/main.js +10 -0
- package/dist/p-dev/main.js.map +1 -0
- package/dist/p-dev/next-bin.d.ts +2 -0
- package/dist/p-dev/next-bin.d.ts.map +1 -0
- package/dist/p-dev/next-bin.js +8 -0
- package/dist/p-dev/next-bin.js.map +1 -0
- package/dist/p-dev/node-version.d.ts +9 -0
- package/dist/p-dev/node-version.d.ts.map +1 -0
- package/dist/p-dev/node-version.js +31 -0
- package/dist/p-dev/node-version.js.map +1 -0
- package/dist/p-dev/package-paths.d.ts +5 -0
- package/dist/p-dev/package-paths.d.ts.map +1 -0
- package/dist/p-dev/package-paths.js +34 -0
- package/dist/p-dev/package-paths.js.map +1 -0
- package/dist/p-dev/package-version.d.ts +6 -0
- package/dist/p-dev/package-version.d.ts.map +1 -0
- package/dist/p-dev/package-version.js +40 -0
- package/dist/p-dev/package-version.js.map +1 -0
- package/dist/p-dev/runtime-mode.d.ts +6 -0
- package/dist/p-dev/runtime-mode.d.ts.map +1 -0
- package/dist/p-dev/runtime-mode.js +18 -0
- package/dist/p-dev/runtime-mode.js.map +1 -0
- package/dist/p-dev/shutdown.d.ts +7 -0
- package/dist/p-dev/shutdown.d.ts.map +1 -0
- package/dist/p-dev/shutdown.js +55 -0
- package/dist/p-dev/shutdown.js.map +1 -0
- package/dist/p-dev/workspace.d.ts +22 -0
- package/dist/p-dev/workspace.d.ts.map +1 -0
- package/dist/p-dev/workspace.js +74 -0
- package/dist/p-dev/workspace.js.map +1 -0
- package/dist/preview/production-from-merge.d.ts +34 -0
- package/dist/preview/production-from-merge.d.ts.map +1 -0
- package/dist/preview/production-from-merge.js +94 -0
- package/dist/preview/production-from-merge.js.map +1 -0
- package/dist/preview/urls.d.ts +16 -0
- package/dist/preview/urls.d.ts.map +1 -0
- package/dist/preview/urls.js +13 -0
- package/dist/preview/urls.js.map +1 -0
- package/dist/preview/vercel-from-pr.d.ts +19 -0
- package/dist/preview/vercel-from-pr.d.ts.map +1 -0
- package/dist/preview/vercel-from-pr.js +91 -0
- package/dist/preview/vercel-from-pr.js.map +1 -0
- package/dist/prompts/branch-name.d.ts +3 -0
- package/dist/prompts/branch-name.d.ts.map +1 -0
- package/dist/prompts/branch-name.js +15 -0
- package/dist/prompts/branch-name.js.map +1 -0
- package/dist/prompts/builder.d.ts +21 -0
- package/dist/prompts/builder.d.ts.map +1 -0
- package/dist/prompts/builder.js +51 -0
- package/dist/prompts/builder.js.map +1 -0
- package/dist/prompts/integration-repair-builder.d.ts +20 -0
- package/dist/prompts/integration-repair-builder.d.ts.map +1 -0
- package/dist/prompts/integration-repair-builder.js +37 -0
- package/dist/prompts/integration-repair-builder.js.map +1 -0
- package/dist/prompts/revision-builder.d.ts +19 -0
- package/dist/prompts/revision-builder.d.ts.map +1 -0
- package/dist/prompts/revision-builder.js +34 -0
- package/dist/prompts/revision-builder.js.map +1 -0
- package/dist/resolver/allowed-repos.d.ts +3 -0
- package/dist/resolver/allowed-repos.d.ts.map +1 -0
- package/dist/resolver/allowed-repos.js +10 -0
- package/dist/resolver/allowed-repos.js.map +1 -0
- package/dist/resolver/errors.d.ts +6 -0
- package/dist/resolver/errors.d.ts.map +1 -0
- package/dist/resolver/errors.js +9 -0
- package/dist/resolver/errors.js.map +1 -0
- package/dist/resolver/normalize-repo.d.ts +4 -0
- package/dist/resolver/normalize-repo.d.ts.map +1 -0
- package/dist/resolver/normalize-repo.js +25 -0
- package/dist/resolver/normalize-repo.js.map +1 -0
- package/dist/resolver/target-repo.d.ts +20 -0
- package/dist/resolver/target-repo.d.ts.map +1 -0
- package/dist/resolver/target-repo.js +73 -0
- package/dist/resolver/target-repo.js.map +1 -0
- package/dist/runner/building-recovery.d.ts +5 -0
- package/dist/runner/building-recovery.d.ts.map +1 -0
- package/dist/runner/building-recovery.js +18 -0
- package/dist/runner/building-recovery.js.map +1 -0
- package/dist/runner/dry-run.d.ts +13 -0
- package/dist/runner/dry-run.d.ts.map +1 -0
- package/dist/runner/dry-run.js +108 -0
- package/dist/runner/dry-run.js.map +1 -0
- package/dist/runner/errors.d.ts +22 -0
- package/dist/runner/errors.d.ts.map +1 -0
- package/dist/runner/errors.js +41 -0
- package/dist/runner/errors.js.map +1 -0
- package/dist/runner/execution-environment.d.ts +25 -0
- package/dist/runner/execution-environment.d.ts.map +1 -0
- package/dist/runner/execution-environment.js +122 -0
- package/dist/runner/execution-environment.js.map +1 -0
- package/dist/runner/fixture.d.ts +4 -0
- package/dist/runner/fixture.d.ts.map +1 -0
- package/dist/runner/fixture.js +18 -0
- package/dist/runner/fixture.js.map +1 -0
- package/dist/runner/idempotency.d.ts +29 -0
- package/dist/runner/idempotency.d.ts.map +1 -0
- package/dist/runner/idempotency.js +295 -0
- package/dist/runner/idempotency.js.map +1 -0
- package/dist/runner/orchestrator.d.ts +19 -0
- package/dist/runner/orchestrator.d.ts.map +1 -0
- package/dist/runner/orchestrator.js +149 -0
- package/dist/runner/orchestrator.js.map +1 -0
- package/dist/runner/phase-args.d.ts +11 -0
- package/dist/runner/phase-args.d.ts.map +1 -0
- package/dist/runner/phase-args.js +35 -0
- package/dist/runner/phase-args.js.map +1 -0
- package/dist/runner/phase-infer.d.ts +7 -0
- package/dist/runner/phase-infer.d.ts.map +1 -0
- package/dist/runner/phase-infer.js +45 -0
- package/dist/runner/phase-infer.js.map +1 -0
- package/dist/runner/phases/handoff.d.ts +13 -0
- package/dist/runner/phases/handoff.d.ts.map +1 -0
- package/dist/runner/phases/handoff.js +422 -0
- package/dist/runner/phases/handoff.js.map +1 -0
- package/dist/runner/phases/implementation.d.ts +13 -0
- package/dist/runner/phases/implementation.d.ts.map +1 -0
- package/dist/runner/phases/implementation.js +435 -0
- package/dist/runner/phases/implementation.js.map +1 -0
- package/dist/runner/phases/integration-repair.d.ts +31 -0
- package/dist/runner/phases/integration-repair.d.ts.map +1 -0
- package/dist/runner/phases/integration-repair.js +379 -0
- package/dist/runner/phases/integration-repair.js.map +1 -0
- package/dist/runner/phases/merge.d.ts +13 -0
- package/dist/runner/phases/merge.d.ts.map +1 -0
- package/dist/runner/phases/merge.js +816 -0
- package/dist/runner/phases/merge.js.map +1 -0
- package/dist/runner/phases/planning.d.ts +13 -0
- package/dist/runner/phases/planning.d.ts.map +1 -0
- package/dist/runner/phases/planning.js +306 -0
- package/dist/runner/phases/planning.js.map +1 -0
- package/dist/runner/phases/production-sync.d.ts +16 -0
- package/dist/runner/phases/production-sync.d.ts.map +1 -0
- package/dist/runner/phases/production-sync.js +215 -0
- package/dist/runner/phases/production-sync.js.map +1 -0
- package/dist/runner/phases/revision.d.ts +13 -0
- package/dist/runner/phases/revision.d.ts.map +1 -0
- package/dist/runner/phases/revision.js +565 -0
- package/dist/runner/phases/revision.js.map +1 -0
- package/dist/runner/preflight.d.ts +45 -0
- package/dist/runner/preflight.d.ts.map +1 -0
- package/dist/runner/preflight.js +148 -0
- package/dist/runner/preflight.js.map +1 -0
- package/dist/runner/resolve-route.d.ts +25 -0
- package/dist/runner/resolve-route.d.ts.map +1 -0
- package/dist/runner/resolve-route.js +81 -0
- package/dist/runner/resolve-route.js.map +1 -0
- package/dist/setup/config-builder.d.ts +7 -0
- package/dist/setup/config-builder.d.ts.map +1 -0
- package/dist/setup/config-builder.js +109 -0
- package/dist/setup/config-builder.js.map +1 -0
- package/dist/setup/config-local-editor.d.ts +37 -0
- package/dist/setup/config-local-editor.d.ts.map +1 -0
- package/dist/setup/config-local-editor.js +187 -0
- package/dist/setup/config-local-editor.js.map +1 -0
- package/dist/setup/config-writer.d.ts +20 -0
- package/dist/setup/config-writer.d.ts.map +1 -0
- package/dist/setup/config-writer.js +132 -0
- package/dist/setup/config-writer.js.map +1 -0
- package/dist/setup/control-plane-readiness-server.d.ts +5 -0
- package/dist/setup/control-plane-readiness-server.d.ts.map +1 -0
- package/dist/setup/control-plane-readiness-server.js +9 -0
- package/dist/setup/control-plane-readiness-server.js.map +1 -0
- package/dist/setup/control-plane-readiness.d.ts +23 -0
- package/dist/setup/control-plane-readiness.d.ts.map +1 -0
- package/dist/setup/control-plane-readiness.js +216 -0
- package/dist/setup/control-plane-readiness.js.map +1 -0
- package/dist/setup/control-plane-setup-state.d.ts +6 -0
- package/dist/setup/control-plane-setup-state.d.ts.map +1 -0
- package/dist/setup/control-plane-setup-state.js +41 -0
- package/dist/setup/control-plane-setup-state.js.map +1 -0
- package/dist/setup/control-plane-types.d.ts +97 -0
- package/dist/setup/control-plane-types.d.ts.map +1 -0
- package/dist/setup/control-plane-types.js +2 -0
- package/dist/setup/control-plane-types.js.map +1 -0
- package/dist/setup/doctor-summary.d.ts +16 -0
- package/dist/setup/doctor-summary.d.ts.map +1 -0
- package/dist/setup/doctor-summary.js +62 -0
- package/dist/setup/doctor-summary.js.map +1 -0
- package/dist/setup/env-merge.d.ts +26 -0
- package/dist/setup/env-merge.d.ts.map +1 -0
- package/dist/setup/env-merge.js +201 -0
- package/dist/setup/env-merge.js.map +1 -0
- package/dist/setup/env-writer.d.ts +17 -0
- package/dist/setup/env-writer.d.ts.map +1 -0
- package/dist/setup/env-writer.js +129 -0
- package/dist/setup/env-writer.js.map +1 -0
- package/dist/setup/first-run-readiness.d.ts +204 -0
- package/dist/setup/first-run-readiness.d.ts.map +1 -0
- package/dist/setup/first-run-readiness.js +911 -0
- package/dist/setup/first-run-readiness.js.map +1 -0
- package/dist/setup/generated-instructions.d.ts +19 -0
- package/dist/setup/generated-instructions.d.ts.map +1 -0
- package/dist/setup/generated-instructions.js +70 -0
- package/dist/setup/generated-instructions.js.map +1 -0
- package/dist/setup/github-dispatch-token.d.ts +12 -0
- package/dist/setup/github-dispatch-token.d.ts.map +1 -0
- package/dist/setup/github-dispatch-token.js +66 -0
- package/dist/setup/github-dispatch-token.js.map +1 -0
- package/dist/setup/github-remote-provider.d.ts +192 -0
- package/dist/setup/github-remote-provider.d.ts.map +1 -0
- package/dist/setup/github-remote-provider.js +302 -0
- package/dist/setup/github-remote-provider.js.map +1 -0
- package/dist/setup/github-remote-setup-live.d.ts +49 -0
- package/dist/setup/github-remote-setup-live.d.ts.map +1 -0
- package/dist/setup/github-remote-setup-live.js +400 -0
- package/dist/setup/github-remote-setup-live.js.map +1 -0
- package/dist/setup/github-repo-slug.d.ts +3 -0
- package/dist/setup/github-repo-slug.d.ts.map +1 -0
- package/dist/setup/github-repo-slug.js +23 -0
- package/dist/setup/github-repo-slug.js.map +1 -0
- package/dist/setup/github-secret-encryption.d.ts +2 -0
- package/dist/setup/github-secret-encryption.d.ts.map +1 -0
- package/dist/setup/github-secret-encryption.js +8 -0
- package/dist/setup/github-secret-encryption.js.map +1 -0
- package/dist/setup/github-workflow-permissions.d.ts +54 -0
- package/dist/setup/github-workflow-permissions.d.ts.map +1 -0
- package/dist/setup/github-workflow-permissions.js +110 -0
- package/dist/setup/github-workflow-permissions.js.map +1 -0
- package/dist/setup/gui-view-model.d.ts +85 -0
- package/dist/setup/gui-view-model.d.ts.map +1 -0
- package/dist/setup/gui-view-model.js +404 -0
- package/dist/setup/gui-view-model.js.map +1 -0
- package/dist/setup/guided-config-form.d.ts +8 -0
- package/dist/setup/guided-config-form.d.ts.map +1 -0
- package/dist/setup/guided-config-form.js +36 -0
- package/dist/setup/guided-config-form.js.map +1 -0
- package/dist/setup/harness-dispatch-repo.d.ts +23 -0
- package/dist/setup/harness-dispatch-repo.d.ts.map +1 -0
- package/dist/setup/harness-dispatch-repo.js +110 -0
- package/dist/setup/harness-dispatch-repo.js.map +1 -0
- package/dist/setup/harness-managed-repo-marker.d.ts +59 -0
- package/dist/setup/harness-managed-repo-marker.d.ts.map +1 -0
- package/dist/setup/harness-managed-repo-marker.js +289 -0
- package/dist/setup/harness-managed-repo-marker.js.map +1 -0
- package/dist/setup/harness-provisioning-context.d.ts +58 -0
- package/dist/setup/harness-provisioning-context.d.ts.map +1 -0
- package/dist/setup/harness-provisioning-context.js +204 -0
- package/dist/setup/harness-provisioning-context.js.map +1 -0
- package/dist/setup/harness-provisioning-pending-state.d.ts +59 -0
- package/dist/setup/harness-provisioning-pending-state.d.ts.map +1 -0
- package/dist/setup/harness-provisioning-pending-state.js +167 -0
- package/dist/setup/harness-provisioning-pending-state.js.map +1 -0
- package/dist/setup/harness-repo-provisioning.d.ts +61 -0
- package/dist/setup/harness-repo-provisioning.d.ts.map +1 -0
- package/dist/setup/harness-repo-provisioning.js +1106 -0
- package/dist/setup/harness-repo-provisioning.js.map +1 -0
- package/dist/setup/harness-secret-fingerprint.d.ts +21 -0
- package/dist/setup/harness-secret-fingerprint.d.ts.map +1 -0
- package/dist/setup/harness-secret-fingerprint.js +25 -0
- package/dist/setup/harness-secret-fingerprint.js.map +1 -0
- package/dist/setup/harness-secret-setup.d.ts +81 -0
- package/dist/setup/harness-secret-setup.d.ts.map +1 -0
- package/dist/setup/harness-secret-setup.js +290 -0
- package/dist/setup/harness-secret-setup.js.map +1 -0
- package/dist/setup/harness-template-identity.d.ts +48 -0
- package/dist/setup/harness-template-identity.d.ts.map +1 -0
- package/dist/setup/harness-template-identity.js +114 -0
- package/dist/setup/harness-template-identity.js.map +1 -0
- package/dist/setup/linear-setup-apply.d.ts +30 -0
- package/dist/setup/linear-setup-apply.d.ts.map +1 -0
- package/dist/setup/linear-setup-apply.js +192 -0
- package/dist/setup/linear-setup-apply.js.map +1 -0
- package/dist/setup/linear-setup-client.d.ts +70 -0
- package/dist/setup/linear-setup-client.d.ts.map +1 -0
- package/dist/setup/linear-setup-client.js +180 -0
- package/dist/setup/linear-setup-client.js.map +1 -0
- package/dist/setup/linear-setup-plan.d.ts +88 -0
- package/dist/setup/linear-setup-plan.d.ts.map +1 -0
- package/dist/setup/linear-setup-plan.js +239 -0
- package/dist/setup/linear-setup-plan.js.map +1 -0
- package/dist/setup/linear-setup-summary.d.ts +12 -0
- package/dist/setup/linear-setup-summary.d.ts.map +1 -0
- package/dist/setup/linear-setup-summary.js +21 -0
- package/dist/setup/linear-setup-summary.js.map +1 -0
- package/dist/setup/linear-status-contract.d.ts +15 -0
- package/dist/setup/linear-status-contract.d.ts.map +1 -0
- package/dist/setup/linear-status-contract.js +79 -0
- package/dist/setup/linear-status-contract.js.map +1 -0
- package/dist/setup/linear-webhook-env-local.d.ts +10 -0
- package/dist/setup/linear-webhook-env-local.d.ts.map +1 -0
- package/dist/setup/linear-webhook-env-local.js +74 -0
- package/dist/setup/linear-webhook-env-local.js.map +1 -0
- package/dist/setup/linear-webhook-secret.d.ts +63 -0
- package/dist/setup/linear-webhook-secret.d.ts.map +1 -0
- package/dist/setup/linear-webhook-secret.js +335 -0
- package/dist/setup/linear-webhook-secret.js.map +1 -0
- package/dist/setup/local-apply-actions.d.ts +85 -0
- package/dist/setup/local-apply-actions.d.ts.map +1 -0
- package/dist/setup/local-apply-actions.js +303 -0
- package/dist/setup/local-apply-actions.js.map +1 -0
- package/dist/setup/local-readiness-checks.d.ts +16 -0
- package/dist/setup/local-readiness-checks.d.ts.map +1 -0
- package/dist/setup/local-readiness-checks.js +164 -0
- package/dist/setup/local-readiness-checks.js.map +1 -0
- package/dist/setup/mock-target-workflow-finalization.d.ts +24 -0
- package/dist/setup/mock-target-workflow-finalization.d.ts.map +1 -0
- package/dist/setup/mock-target-workflow-finalization.js +367 -0
- package/dist/setup/mock-target-workflow-finalization.js.map +1 -0
- package/dist/setup/model-settings.d.ts +17 -0
- package/dist/setup/model-settings.d.ts.map +1 -0
- package/dist/setup/model-settings.js +46 -0
- package/dist/setup/model-settings.js.map +1 -0
- package/dist/setup/permission-model.d.ts +46 -0
- package/dist/setup/permission-model.d.ts.map +1 -0
- package/dist/setup/permission-model.js +56 -0
- package/dist/setup/permission-model.js.map +1 -0
- package/dist/setup/redact-secrets.d.ts +17 -0
- package/dist/setup/redact-secrets.d.ts.map +1 -0
- package/dist/setup/redact-secrets.js +51 -0
- package/dist/setup/redact-secrets.js.map +1 -0
- package/dist/setup/remote-actions.d.ts +136 -0
- package/dist/setup/remote-actions.d.ts.map +1 -0
- package/dist/setup/remote-actions.js +75 -0
- package/dist/setup/remote-actions.js.map +1 -0
- package/dist/setup/remote-apply-actions.d.ts +32 -0
- package/dist/setup/remote-apply-actions.d.ts.map +1 -0
- package/dist/setup/remote-apply-actions.js +242 -0
- package/dist/setup/remote-apply-actions.js.map +1 -0
- package/dist/setup/remote-preview-fingerprint.d.ts +15 -0
- package/dist/setup/remote-preview-fingerprint.d.ts.map +1 -0
- package/dist/setup/remote-preview-fingerprint.js +20 -0
- package/dist/setup/remote-preview-fingerprint.js.map +1 -0
- package/dist/setup/remote-setup-summary.d.ts +28 -0
- package/dist/setup/remote-setup-summary.d.ts.map +1 -0
- package/dist/setup/remote-setup-summary.js +93 -0
- package/dist/setup/remote-setup-summary.js.map +1 -0
- package/dist/setup/secret-change-token.d.ts +2 -0
- package/dist/setup/secret-change-token.d.ts.map +1 -0
- package/dist/setup/secret-change-token.js +14 -0
- package/dist/setup/secret-change-token.js.map +1 -0
- package/dist/setup/service-verification.d.ts +60 -0
- package/dist/setup/service-verification.d.ts.map +1 -0
- package/dist/setup/service-verification.js +419 -0
- package/dist/setup/service-verification.js.map +1 -0
- package/dist/setup/setup-actions.d.ts +126 -0
- package/dist/setup/setup-actions.d.ts.map +1 -0
- package/dist/setup/setup-actions.js +128 -0
- package/dist/setup/setup-actions.js.map +1 -0
- package/dist/setup/setup-github-auth.d.ts +5 -0
- package/dist/setup/setup-github-auth.d.ts.map +1 -0
- package/dist/setup/setup-github-auth.js +12 -0
- package/dist/setup/setup-github-auth.js.map +1 -0
- package/dist/setup/setup-state.d.ts +51 -0
- package/dist/setup/setup-state.d.ts.map +1 -0
- package/dist/setup/setup-state.js +19 -0
- package/dist/setup/setup-state.js.map +1 -0
- package/dist/setup/stale-smoke-repo.d.ts +40 -0
- package/dist/setup/stale-smoke-repo.d.ts.map +1 -0
- package/dist/setup/stale-smoke-repo.js +77 -0
- package/dist/setup/stale-smoke-repo.js.map +1 -0
- package/dist/setup/sync-downstream-summaries.d.ts +22 -0
- package/dist/setup/sync-downstream-summaries.d.ts.map +1 -0
- package/dist/setup/sync-downstream-summaries.js +54 -0
- package/dist/setup/sync-downstream-summaries.js.map +1 -0
- package/dist/setup/target-workflow-finalization-lock.d.ts +17 -0
- package/dist/setup/target-workflow-finalization-lock.d.ts.map +1 -0
- package/dist/setup/target-workflow-finalization-lock.js +72 -0
- package/dist/setup/target-workflow-finalization-lock.js.map +1 -0
- package/dist/setup/target-workflow-finalization-types.d.ts +32 -0
- package/dist/setup/target-workflow-finalization-types.d.ts.map +1 -0
- package/dist/setup/target-workflow-finalization-types.js +4 -0
- package/dist/setup/target-workflow-finalization-types.js.map +1 -0
- package/dist/setup/target-workflow-finalization.d.ts +19 -0
- package/dist/setup/target-workflow-finalization.d.ts.map +1 -0
- package/dist/setup/target-workflow-finalization.js +690 -0
- package/dist/setup/target-workflow-finalization.js.map +1 -0
- package/dist/setup/target-workflow-setup.d.ts +63 -0
- package/dist/setup/target-workflow-setup.d.ts.map +1 -0
- package/dist/setup/target-workflow-setup.js +167 -0
- package/dist/setup/target-workflow-setup.js.map +1 -0
- package/dist/setup/test-only-provisioning-provider.d.ts +11 -0
- package/dist/setup/test-only-provisioning-provider.d.ts.map +1 -0
- package/dist/setup/test-only-provisioning-provider.js +37 -0
- package/dist/setup/test-only-provisioning-provider.js.map +1 -0
- package/dist/setup/test-only-remote-setup-provider.d.ts +11 -0
- package/dist/setup/test-only-remote-setup-provider.d.ts.map +1 -0
- package/dist/setup/test-only-remote-setup-provider.js +37 -0
- package/dist/setup/test-only-remote-setup-provider.js.map +1 -0
- package/dist/setup/vercel-bridge-diagnostics.d.ts +101 -0
- package/dist/setup/vercel-bridge-diagnostics.d.ts.map +1 -0
- package/dist/setup/vercel-bridge-diagnostics.js +353 -0
- package/dist/setup/vercel-bridge-diagnostics.js.map +1 -0
- package/dist/setup/vercel-bridge-options.d.ts +35 -0
- package/dist/setup/vercel-bridge-options.d.ts.map +1 -0
- package/dist/setup/vercel-bridge-options.js +95 -0
- package/dist/setup/vercel-bridge-options.js.map +1 -0
- package/dist/setup/vercel-bridge-readiness.d.ts +38 -0
- package/dist/setup/vercel-bridge-readiness.d.ts.map +1 -0
- package/dist/setup/vercel-bridge-readiness.js +85 -0
- package/dist/setup/vercel-bridge-readiness.js.map +1 -0
- package/dist/setup/vercel-bridge-redeploy-poll.d.ts +46 -0
- package/dist/setup/vercel-bridge-redeploy-poll.d.ts.map +1 -0
- package/dist/setup/vercel-bridge-redeploy-poll.js +571 -0
- package/dist/setup/vercel-bridge-redeploy-poll.js.map +1 -0
- package/dist/setup/vercel-bridge-redeploy-state.d.ts +16 -0
- package/dist/setup/vercel-bridge-redeploy-state.d.ts.map +1 -0
- package/dist/setup/vercel-bridge-redeploy-state.js +27 -0
- package/dist/setup/vercel-bridge-redeploy-state.js.map +1 -0
- package/dist/setup/vercel-bridge-structured-log.d.ts +34 -0
- package/dist/setup/vercel-bridge-structured-log.d.ts.map +1 -0
- package/dist/setup/vercel-bridge-structured-log.js +30 -0
- package/dist/setup/vercel-bridge-structured-log.js.map +1 -0
- package/dist/setup/vercel-bridge-verification.d.ts +22 -0
- package/dist/setup/vercel-bridge-verification.d.ts.map +1 -0
- package/dist/setup/vercel-bridge-verification.js +38 -0
- package/dist/setup/vercel-bridge-verification.js.map +1 -0
- package/dist/setup/vercel-production-redeploy.d.ts +57 -0
- package/dist/setup/vercel-production-redeploy.d.ts.map +1 -0
- package/dist/setup/vercel-production-redeploy.js +180 -0
- package/dist/setup/vercel-production-redeploy.js.map +1 -0
- package/dist/setup/vercel-setup-apply.d.ts +69 -0
- package/dist/setup/vercel-setup-apply.d.ts.map +1 -0
- package/dist/setup/vercel-setup-apply.js +779 -0
- package/dist/setup/vercel-setup-apply.js.map +1 -0
- package/dist/setup/vercel-setup-client.d.ts +134 -0
- package/dist/setup/vercel-setup-client.d.ts.map +1 -0
- package/dist/setup/vercel-setup-client.js +416 -0
- package/dist/setup/vercel-setup-client.js.map +1 -0
- package/dist/setup/vercel-setup-plan.d.ts +132 -0
- package/dist/setup/vercel-setup-plan.d.ts.map +1 -0
- package/dist/setup/vercel-setup-plan.js +452 -0
- package/dist/setup/vercel-setup-plan.js.map +1 -0
- package/dist/setup/vercel-setup-summary.d.ts +11 -0
- package/dist/setup/vercel-setup-summary.d.ts.map +1 -0
- package/dist/setup/vercel-setup-summary.js +29 -0
- package/dist/setup/vercel-setup-summary.js.map +1 -0
- package/dist/setup/vercel-webhook-probe.d.ts +17 -0
- package/dist/setup/vercel-webhook-probe.d.ts.map +1 -0
- package/dist/setup/vercel-webhook-probe.js +125 -0
- package/dist/setup/vercel-webhook-probe.js.map +1 -0
- package/dist/setup/workflow-install-merge-errors.d.ts +12 -0
- package/dist/setup/workflow-install-merge-errors.d.ts.map +1 -0
- package/dist/setup/workflow-install-merge-errors.js +130 -0
- package/dist/setup/workflow-install-merge-errors.js.map +1 -0
- package/dist/types/parsed-issue.d.ts +9 -0
- package/dist/types/parsed-issue.d.ts.map +1 -0
- package/dist/types/parsed-issue.js +2 -0
- package/dist/types/parsed-issue.js.map +1 -0
- package/dist/types/run.d.ts +46 -0
- package/dist/types/run.d.ts.map +1 -0
- package/dist/types/run.js +2 -0
- package/dist/types/run.js.map +1 -0
- package/dist/validate/constants.d.ts +3 -0
- package/dist/validate/constants.d.ts.map +1 -0
- package/dist/validate/constants.js +3 -0
- package/dist/validate/constants.js.map +1 -0
- package/dist/validate/issue.d.ts +15 -0
- package/dist/validate/issue.d.ts.map +1 -0
- package/dist/validate/issue.js +177 -0
- package/dist/validate/issue.js.map +1 -0
- package/dist/validate/report.d.ts +3 -0
- package/dist/validate/report.d.ts.map +1 -0
- package/dist/validate/report.js +62 -0
- package/dist/validate/report.js.map +1 -0
- package/dist/validate/types.d.ts +30 -0
- package/dist/validate/types.d.ts.map +1 -0
- package/dist/validate/types.js +2 -0
- package/dist/validate/types.js.map +1 -0
- package/dist/webhook/dispatch-github.d.ts +6 -0
- package/dist/webhook/dispatch-github.d.ts.map +1 -0
- package/dist/webhook/dispatch-github.js +33 -0
- package/dist/webhook/dispatch-github.js.map +1 -0
- package/dist/webhook/dispatch-statuses.d.ts +8 -0
- package/dist/webhook/dispatch-statuses.d.ts.map +1 -0
- package/dist/webhook/dispatch-statuses.js +19 -0
- package/dist/webhook/dispatch-statuses.js.map +1 -0
- package/dist/webhook/extract-issue-key.d.ts +10 -0
- package/dist/webhook/extract-issue-key.d.ts.map +1 -0
- package/dist/webhook/extract-issue-key.js +33 -0
- package/dist/webhook/extract-issue-key.js.map +1 -0
- package/dist/webhook/filter.d.ts +9 -0
- package/dist/webhook/filter.d.ts.map +1 -0
- package/dist/webhook/filter.js +27 -0
- package/dist/webhook/filter.js.map +1 -0
- package/dist/webhook/handle-linear-webhook.d.ts +20 -0
- package/dist/webhook/handle-linear-webhook.d.ts.map +1 -0
- package/dist/webhook/handle-linear-webhook.js +139 -0
- package/dist/webhook/handle-linear-webhook.js.map +1 -0
- package/dist/webhook/parse-linear-issue-event.d.ts +31 -0
- package/dist/webhook/parse-linear-issue-event.d.ts.map +1 -0
- package/dist/webhook/parse-linear-issue-event.js +60 -0
- package/dist/webhook/parse-linear-issue-event.js.map +1 -0
- package/dist/webhook/redact-log.d.ts +15 -0
- package/dist/webhook/redact-log.d.ts.map +1 -0
- package/dist/webhook/redact-log.js +13 -0
- package/dist/webhook/redact-log.js.map +1 -0
- package/dist/webhook/types.d.ts +61 -0
- package/dist/webhook/types.d.ts.map +1 -0
- package/dist/webhook/types.js +2 -0
- package/dist/webhook/types.js.map +1 -0
- package/dist/webhook/verify.d.ts +16 -0
- package/dist/webhook/verify.d.ts.map +1 -0
- package/dist/webhook/verify.js +36 -0
- package/dist/webhook/verify.js.map +1 -0
- package/dist/webhook/workflow-command.d.ts +3 -0
- package/dist/webhook/workflow-command.d.ts.map +1 -0
- package/dist/webhook/workflow-command.js +7 -0
- package/dist/webhook/workflow-command.js.map +1 -0
- package/dist/workflow/dispatch-metadata.d.ts +4 -0
- package/dist/workflow/dispatch-metadata.d.ts.map +1 -0
- package/dist/workflow/dispatch-metadata.js +50 -0
- package/dist/workflow/dispatch-metadata.js.map +1 -0
- package/dist/workflow/manifest-summary.d.ts +10 -0
- package/dist/workflow/manifest-summary.d.ts.map +1 -0
- package/dist/workflow/manifest-summary.js +47 -0
- package/dist/workflow/manifest-summary.js.map +1 -0
- package/dist/workflow/production-sync-dispatch.d.ts +13 -0
- package/dist/workflow/production-sync-dispatch.d.ts.map +1 -0
- package/dist/workflow/production-sync-dispatch.js +38 -0
- package/dist/workflow/production-sync-dispatch.js.map +1 -0
- package/dist/workflow/summarize-manifest.d.ts +2 -0
- package/dist/workflow/summarize-manifest.d.ts.map +1 -0
- package/dist/workflow/summarize-manifest.js +15 -0
- package/dist/workflow/summarize-manifest.js.map +1 -0
- package/dist/workflow/validate.d.ts +7 -0
- package/dist/workflow/validate.d.ts.map +1 -0
- package/dist/workflow/validate.js +32 -0
- package/dist/workflow/validate.js.map +1 -0
- package/dist/workflow/write-dispatch-metadata.d.ts +2 -0
- package/dist/workflow/write-dispatch-metadata.d.ts.map +1 -0
- package/dist/workflow/write-dispatch-metadata.js +4 -0
- package/dist/workflow/write-dispatch-metadata.js.map +1 -0
- package/gui/.next/BUILD_ID +1 -0
- package/gui/.next/app-build-manifest.json +232 -0
- package/gui/.next/app-path-routes-manifest.json +33 -0
- package/gui/.next/build-manifest.json +33 -0
- package/gui/.next/diagnostics/build-diagnostics.json +6 -0
- package/gui/.next/diagnostics/framework.json +1 -0
- package/gui/.next/export-marker.json +6 -0
- package/gui/.next/images-manifest.json +58 -0
- package/gui/.next/next-minimal-server.js.nft.json +1 -0
- package/gui/.next/next-server.js.nft.json +1 -0
- package/gui/.next/package.json +1 -0
- package/gui/.next/prerender-manifest.json +61 -0
- package/gui/.next/react-loadable-manifest.json +1 -0
- package/gui/.next/required-server-files.json +333 -0
- package/gui/.next/routes-manifest.json +59 -0
- package/gui/.next/server/app/_not-found/page.js +2 -0
- package/gui/.next/server/app/_not-found/page.js.nft.json +1 -0
- package/gui/.next/server/app/_not-found/page_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/_not-found.html +1 -0
- package/gui/.next/server/app/_not-found.meta +8 -0
- package/gui/.next/server/app/_not-found.rsc +17 -0
- package/gui/.next/server/app/api/setup/apply-connect-services/route.js +1 -0
- package/gui/.next/server/app/api/setup/apply-connect-services/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/apply-connect-services/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/apply-harness-repo-provisioning/route.js +1 -0
- package/gui/.next/server/app/api/setup/apply-harness-repo-provisioning/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/apply-harness-repo-provisioning/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/apply-harness-secrets/route.js +1 -0
- package/gui/.next/server/app/api/setup/apply-harness-secrets/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/apply-harness-secrets/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/apply-linear-setup/route.js +1 -0
- package/gui/.next/server/app/api/setup/apply-linear-setup/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/apply-linear-setup/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/apply-local-files/route.js +1 -0
- package/gui/.next/server/app/api/setup/apply-local-files/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/apply-local-files/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/apply-target-workflow/route.js +1 -0
- package/gui/.next/server/app/api/setup/apply-target-workflow/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/apply-target-workflow/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/apply-vercel-bridge/route.js +1 -0
- package/gui/.next/server/app/api/setup/apply-vercel-bridge/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/apply-vercel-bridge/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/finalize-target-workflow/route.js +1 -0
- package/gui/.next/server/app/api/setup/finalize-target-workflow/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/finalize-target-workflow/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/harness-provisioning-summary/route.js +1 -0
- package/gui/.next/server/app/api/setup/harness-provisioning-summary/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/harness-provisioning-summary/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/linear-options/route.js +1 -0
- package/gui/.next/server/app/api/setup/linear-options/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/linear-options/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/linear-summary/route.js +1 -0
- package/gui/.next/server/app/api/setup/linear-summary/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/linear-summary/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/local-readiness/route.js +1 -0
- package/gui/.next/server/app/api/setup/local-readiness/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/local-readiness/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/manual-harness-secret-values/route.js +1 -0
- package/gui/.next/server/app/api/setup/manual-harness-secret-values/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/manual-harness-secret-values/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/preview-connect-services/route.js +1 -0
- package/gui/.next/server/app/api/setup/preview-connect-services/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/preview-connect-services/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/preview-harness-repo-provisioning/route.js +1 -0
- package/gui/.next/server/app/api/setup/preview-harness-repo-provisioning/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/preview-harness-repo-provisioning/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/preview-harness-secrets/route.js +1 -0
- package/gui/.next/server/app/api/setup/preview-harness-secrets/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/preview-harness-secrets/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/preview-linear-setup/route.js +1 -0
- package/gui/.next/server/app/api/setup/preview-linear-setup/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/preview-linear-setup/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/preview-local-files/route.js +1 -0
- package/gui/.next/server/app/api/setup/preview-local-files/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/preview-local-files/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/preview-target-workflow/route.js +1 -0
- package/gui/.next/server/app/api/setup/preview-target-workflow/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/preview-target-workflow/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/preview-vercel-bridge/route.js +1 -0
- package/gui/.next/server/app/api/setup/preview-vercel-bridge/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/preview-vercel-bridge/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/remote-summary/route.js +1 -0
- package/gui/.next/server/app/api/setup/remote-summary/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/remote-summary/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/summary/route.js +1 -0
- package/gui/.next/server/app/api/setup/summary/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/summary/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/vercel-bridge-options/route.js +1 -0
- package/gui/.next/server/app/api/setup/vercel-bridge-options/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/vercel-bridge-options/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/vercel-bridge-redeploy-status/route.js +1 -0
- package/gui/.next/server/app/api/setup/vercel-bridge-redeploy-status/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/vercel-bridge-redeploy-status/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/vercel-summary/route.js +1 -0
- package/gui/.next/server/app/api/setup/vercel-summary/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/vercel-summary/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/verify-harness-repo/route.js +1 -0
- package/gui/.next/server/app/api/setup/verify-harness-repo/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/verify-harness-repo/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/verify-service/route.js +1 -0
- package/gui/.next/server/app/api/setup/verify-service/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/verify-service/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/api/setup/verify-target-repo/route.js +1 -0
- package/gui/.next/server/app/api/setup/verify-target-repo/route.js.nft.json +1 -0
- package/gui/.next/server/app/api/setup/verify-target-repo/route_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/index.html +1 -0
- package/gui/.next/server/app/index.meta +9 -0
- package/gui/.next/server/app/index.rsc +18 -0
- package/gui/.next/server/app/page.js +2 -0
- package/gui/.next/server/app/page.js.nft.json +1 -0
- package/gui/.next/server/app/page_client-reference-manifest.js +1 -0
- package/gui/.next/server/app/settings/configure/page.js +10 -0
- package/gui/.next/server/app/settings/configure/page.js.nft.json +1 -0
- package/gui/.next/server/app/settings/configure/page_client-reference-manifest.js +1 -0
- package/gui/.next/server/app-paths-manifest.json +33 -0
- package/gui/.next/server/chunks/120.js +81 -0
- package/gui/.next/server/chunks/200.js +1 -0
- package/gui/.next/server/chunks/332.js +9 -0
- package/gui/.next/server/chunks/383.js +6 -0
- package/gui/.next/server/chunks/477.js +16 -0
- package/gui/.next/server/chunks/585.js +1 -0
- package/gui/.next/server/chunks/711.js +1 -0
- package/gui/.next/server/chunks/900.js +1 -0
- package/gui/.next/server/chunks/901.js +22 -0
- package/gui/.next/server/functions-config-manifest.json +4 -0
- package/gui/.next/server/interception-route-rewrite-manifest.js +1 -0
- package/gui/.next/server/middleware-build-manifest.js +1 -0
- package/gui/.next/server/middleware-manifest.json +6 -0
- package/gui/.next/server/middleware-react-loadable-manifest.js +1 -0
- package/gui/.next/server/next-font-manifest.js +1 -0
- package/gui/.next/server/next-font-manifest.json +1 -0
- package/gui/.next/server/pages/404.html +1 -0
- package/gui/.next/server/pages/500.html +1 -0
- package/gui/.next/server/pages/_app.js +1 -0
- package/gui/.next/server/pages/_app.js.nft.json +1 -0
- package/gui/.next/server/pages/_document.js +1 -0
- package/gui/.next/server/pages/_document.js.nft.json +1 -0
- package/gui/.next/server/pages/_error.js +19 -0
- package/gui/.next/server/pages/_error.js.nft.json +1 -0
- package/gui/.next/server/pages-manifest.json +6 -0
- package/gui/.next/server/server-reference-manifest.js +1 -0
- package/gui/.next/server/server-reference-manifest.json +1 -0
- package/gui/.next/server/webpack-runtime.js +1 -0
- package/gui/.next/static/7x8X_k4tESvkyqRnNCC9E/_buildManifest.js +1 -0
- package/gui/.next/static/7x8X_k4tESvkyqRnNCC9E/_ssgManifest.js +1 -0
- package/gui/.next/static/chunks/17a9af85-3150126cc8b0fbba.js +1 -0
- package/gui/.next/static/chunks/18-7be73bec2ceaa744.js +1 -0
- package/gui/.next/static/chunks/51af2d27-9a58e6b5db9a3047.js +1 -0
- package/gui/.next/static/chunks/661-5fc9351358e2f084.js +1 -0
- package/gui/.next/static/chunks/87c73c54-24122e7b92478d00.js +1 -0
- package/gui/.next/static/chunks/app/_not-found/page-f15332c94524c284.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/apply-connect-services/route-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/apply-harness-repo-provisioning/route-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/apply-harness-secrets/route-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/apply-linear-setup/route-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/apply-local-files/route-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/apply-target-workflow/route-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/apply-vercel-bridge/route-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/finalize-target-workflow/route-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/harness-provisioning-summary/route-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/linear-options/route-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/linear-summary/route-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/local-readiness/route-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/manual-harness-secret-values/route-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/preview-connect-services/route-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/preview-harness-repo-provisioning/route-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/preview-harness-secrets/route-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/preview-linear-setup/route-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/preview-local-files/route-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/preview-target-workflow/route-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/preview-vercel-bridge/route-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/remote-summary/route-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/summary/route-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/vercel-bridge-options/route-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/vercel-bridge-redeploy-status/route-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/vercel-summary/route-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/verify-harness-repo/route-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/verify-service/route-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/api/setup/verify-target-repo/route-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/layout-10445a363bff6a38.js +1 -0
- package/gui/.next/static/chunks/app/page-979ec1702bd9938a.js +1 -0
- package/gui/.next/static/chunks/app/settings/configure/page-25b2288ace2949a1.js +1 -0
- package/gui/.next/static/chunks/framework-7318ce553e854ad6.js +1 -0
- package/gui/.next/static/chunks/main-app-732547e2b1a794b6.js +1 -0
- package/gui/.next/static/chunks/main-f7a784f5852cbbd1.js +1 -0
- package/gui/.next/static/chunks/pages/_app-2e239ff05bfdf6d6.js +1 -0
- package/gui/.next/static/chunks/pages/_error-bda15e7831eec981.js +1 -0
- package/gui/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/gui/.next/static/chunks/webpack-1e50074b7e886e1b.js +1 -0
- package/gui/.next/static/css/cc2acc71c03f3b4b.css +3 -0
- package/gui/.next/static/media/19cfc7226ec3afaa-s.woff2 +0 -0
- package/gui/.next/static/media/21350d82a1f187e9-s.woff2 +0 -0
- package/gui/.next/static/media/8e9860b6e62d6359-s.woff2 +0 -0
- package/gui/.next/static/media/ba9851c3c22cd980-s.woff2 +0 -0
- package/gui/.next/static/media/c5fe6dc8356a8c31-s.woff2 +0 -0
- package/gui/.next/static/media/df0a9ae256c0569c-s.woff2 +0 -0
- package/gui/.next/static/media/e4af272ccee01ff0-s.p.woff2 +0 -0
- package/gui/.next/trace +4 -0
- package/gui/.next/types/app/api/setup/apply-connect-services/route.ts +347 -0
- package/gui/.next/types/app/api/setup/apply-harness-repo-provisioning/route.ts +347 -0
- package/gui/.next/types/app/api/setup/apply-harness-secrets/route.ts +347 -0
- package/gui/.next/types/app/api/setup/apply-linear-setup/route.ts +347 -0
- package/gui/.next/types/app/api/setup/apply-local-files/route.ts +347 -0
- package/gui/.next/types/app/api/setup/apply-target-workflow/route.ts +347 -0
- package/gui/.next/types/app/api/setup/apply-vercel-bridge/route.ts +347 -0
- package/gui/.next/types/app/api/setup/finalize-target-workflow/route.ts +347 -0
- package/gui/.next/types/app/api/setup/harness-provisioning-summary/route.ts +347 -0
- package/gui/.next/types/app/api/setup/linear-options/route.ts +347 -0
- package/gui/.next/types/app/api/setup/linear-summary/route.ts +347 -0
- package/gui/.next/types/app/api/setup/local-readiness/route.ts +347 -0
- package/gui/.next/types/app/api/setup/manual-harness-secret-values/route.ts +347 -0
- package/gui/.next/types/app/api/setup/preview-connect-services/route.ts +347 -0
- package/gui/.next/types/app/api/setup/preview-harness-repo-provisioning/route.ts +347 -0
- package/gui/.next/types/app/api/setup/preview-harness-secrets/route.ts +347 -0
- package/gui/.next/types/app/api/setup/preview-linear-setup/route.ts +347 -0
- package/gui/.next/types/app/api/setup/preview-local-files/route.ts +347 -0
- package/gui/.next/types/app/api/setup/preview-target-workflow/route.ts +347 -0
- package/gui/.next/types/app/api/setup/preview-vercel-bridge/route.ts +347 -0
- package/gui/.next/types/app/api/setup/remote-summary/route.ts +347 -0
- package/gui/.next/types/app/api/setup/summary/route.ts +347 -0
- package/gui/.next/types/app/api/setup/vercel-bridge-options/route.ts +347 -0
- package/gui/.next/types/app/api/setup/vercel-bridge-redeploy-status/route.ts +347 -0
- package/gui/.next/types/app/api/setup/vercel-summary/route.ts +347 -0
- package/gui/.next/types/app/api/setup/verify-harness-repo/route.ts +347 -0
- package/gui/.next/types/app/api/setup/verify-service/route.ts +347 -0
- package/gui/.next/types/app/api/setup/verify-target-repo/route.ts +347 -0
- package/gui/.next/types/app/layout.ts +84 -0
- package/gui/.next/types/app/page.ts +84 -0
- package/gui/.next/types/app/settings/configure/page.ts +84 -0
- package/gui/.next/types/cache-life.d.ts +141 -0
- package/gui/.next/types/package.json +1 -0
- package/gui/.next/types/routes.d.ts +101 -0
- package/gui/.next/types/validator.ts +331 -0
- package/gui/next.config.mjs +13 -0
- package/gui/postcss.config.mjs +8 -0
- package/gui/public/setup/github-token/github-pat-generate-classic.png +0 -0
- package/gui/public/setup/github-token/github-pat-generate-new-token.png +0 -0
- package/gui/public/setup/github-token/github-pat-verify-email.png +0 -0
- package/package.json +62 -0
- package/templates/.env.example +37 -0
- package/templates/.harness/config.example.json +83 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{75:(e,t,r)=>{"use strict";r.d(t,{ThemeProvider:()=>a});var s=r(4568),n=r(4560);function a(e){let{children:t}=e;return(0,s.jsx)(n.N,{attribute:"class",defaultTheme:"system",enableSystem:!0,children:t})}},1437:()=>{},4493:e=>{e.exports={style:{fontFamily:"'Inter', 'Inter Fallback'",fontStyle:"normal"},className:"__className_f367f3",variable:"__variable_f367f3"}},4560:(e,t,r)=>{"use strict";r.d(t,{D:()=>m,N:()=>c});var s=r(7620),n=(e,t,r,s,n,a,l,o)=>{let i=document.documentElement,m=["light","dark"];function c(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,s=r&&a?n.map(e=>a[e]||e):n;r?(i.classList.remove(...s),i.classList.add(a&&a[t]?a[t]:t)):i.setAttribute(e,t)}),r=t,o&&m.includes(r)&&(i.style.colorScheme=r)}if(s)c(s);else try{let e=localStorage.getItem(t)||r,s=l&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;c(s)}catch(e){}},a=["light","dark"],l="(prefers-color-scheme: dark)",o=s.createContext(void 0),i={setTheme:e=>{},themes:[]},m=()=>{var e;return null!=(e=s.useContext(o))?e:i},c=e=>s.useContext(o)?s.createElement(s.Fragment,null,e.children):s.createElement(u,{...e}),d=["light","dark"],u=e=>{let{forcedTheme:t,disableTransitionOnChange:r=!1,enableSystem:n=!0,enableColorScheme:i=!0,storageKey:m="theme",themes:c=d,defaultTheme:u=n?"system":"light",attribute:v="data-theme",value:p,children:g,nonce:S,scriptProps:E}=e,[k,w]=s.useState(()=>y(m,u)),[T,C]=s.useState(()=>"system"===k?b():k),_=p?Object.values(p):c,L=s.useCallback(e=>{let t=e;if(!t)return;"system"===e&&n&&(t=b());let s=p?p[t]:t,l=r?f(S):null,o=document.documentElement,m=e=>{"class"===e?(o.classList.remove(..._),s&&o.classList.add(s)):e.startsWith("data-")&&(s?o.setAttribute(e,s):o.removeAttribute(e))};if(Array.isArray(v)?v.forEach(m):m(v),i){let e=a.includes(u)?u:null,r=a.includes(t)?t:e;o.style.colorScheme=r}null==l||l()},[S]),N=s.useCallback(e=>{let t="function"==typeof e?e(k):e;w(t);try{localStorage.setItem(m,t)}catch(e){}},[k]),A=s.useCallback(e=>{C(b(e)),"system"===k&&n&&!t&&L("system")},[k,t]);s.useEffect(()=>{let e=window.matchMedia(l);return e.addListener(A),A(e),()=>e.removeListener(A)},[A]),s.useEffect(()=>{let e=e=>{e.key===m&&(e.newValue?w(e.newValue):N(u))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[N]),s.useEffect(()=>{L(null!=t?t:k)},[t,k]);let P=s.useMemo(()=>({theme:k,setTheme:N,forcedTheme:t,resolvedTheme:"system"===k?T:k,themes:n?[...c,"system"]:c,systemTheme:n?T:void 0}),[k,N,t,T,n,c]);return s.createElement(o.Provider,{value:P},s.createElement(h,{forcedTheme:t,storageKey:m,attribute:v,enableSystem:n,enableColorScheme:i,defaultTheme:u,value:p,themes:c,nonce:S,scriptProps:E}),g)},h=s.memo(e=>{let{forcedTheme:t,storageKey:r,attribute:a,enableSystem:l,enableColorScheme:o,defaultTheme:i,value:m,themes:c,nonce:d,scriptProps:u}=e,h=JSON.stringify([a,r,i,t,c,m,l,o]).slice(1,-1);return s.createElement("script",{...u,suppressHydrationWarning:!0,nonce:"",dangerouslySetInnerHTML:{__html:"(".concat(n.toString(),")(").concat(h,")")}})}),y=(e,t)=>{let r;try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t},f=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},b=e=>(e||(e=window.matchMedia(l)),e.matches?"dark":"light")},8471:(e,t,r)=>{Promise.resolve().then(r.bind(r,75)),Promise.resolve().then(r.t.bind(r,4493,23)),Promise.resolve().then(r.t.bind(r,1437,23))}},e=>{e.O(0,[179,587,18,358],()=>e(e.s=8471)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6,30,36,82,86,122,146,220,221,228,286,353,362,385,464,474,576,622,649,672,776,787,806,903,926,931,974,976,993],{1680:()=>{}},_=>{_.O(0,[587,18,358],()=>_(_.s=1680)),_N_E=_.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[217],{656:(e,t,r)=>{"use strict";r.d(t,{ThemeToggle:()=>c});var s=r(4568),n=r(2568),a=r(1115),i=r(4560),l=r(7620),o=r(6845);function c(){let{resolvedTheme:e,setTheme:t}=(0,i.D)(),[r,c]=(0,l.useState)(!1);if((0,l.useEffect)(()=>{c(!0)},[]),!r)return(0,s.jsx)(o.$,{type:"button",variant:"ghost",size:"sm",className:"h-8 w-8 px-0",disabled:!0,children:(0,s.jsx)("span",{className:"sr-only",children:"Toggle theme"})});let d="dark"===e;return(0,s.jsxs)(o.$,{type:"button",variant:"ghost",size:"sm",className:"inline-flex h-8 items-center gap-2 px-2",onClick:()=>t(d?"light":"dark"),children:[d?(0,s.jsx)(n.A,{className:"h-4 w-4","aria-hidden":!0}):(0,s.jsx)(a.A,{className:"h-4 w-4","aria-hidden":!0}),(0,s.jsx)("span",{className:"text-sm",children:d?"Light":"Dark"}),(0,s.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}},826:(e,t,r)=>{"use strict";r.d(t,{cn:()=>a});var s=r(2902),n=r(3714);function a(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,n.QP)((0,s.$)(t))}},6845:(e,t,r)=>{"use strict";r.d(t,{$:()=>c});var s=r(4568),n=r(7620),a=r(7398),i=r(4616),l=r(826);let o=(0,i.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"}}),c=n.forwardRef((e,t)=>{let{className:r,variant:n,size:i,asChild:c=!1,...d}=e,u=c?a.DX:"button";return(0,s.jsx)(u,{className:(0,l.cn)(o({variant:n,size:i,className:r})),ref:t,...d})});c.displayName="Button"},8890:(e,t,r)=>{"use strict";r.d(t,{ConfigureExperience:()=>tf});var s=r(4568),n=r(7620);let a={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=[],s=[];for(let e of i){let n=t.get(e);if("present"!==n){if("unknown"===n){s.push(e);continue}r.push(e)}}return{allPresent:0===r.length&&0===s.length,missing:r,unknown:s}}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,s,n,a,i,l,o,c;let d=e.setupSummary.configSummary;return{configResolved:e.setupSummary.overview.configResolved,operatorConfigResolved:e.setupSummary.overview.operatorConfigResolved,linearTeamKeyFromConfig:null!=(a=null==(t=e.controlPlaneContext)?void 0:t.linearTeamKeyFromConfig)?a:null,linearTeamKeyFromControlPlane:null!=(i=null==(n=e.controlPlaneContext)||null==(s=n.state)||null==(r=s.linear)?void 0:r.teamKey)?i:null,repoIds:(null!=(l=null==d?void 0:d.repos)?l:[]).map(e=>e.id).sort((e,t)=>e.localeCompare(t)),repoTargets:(null!=(o=null==d?void 0:d.repos)?o:[]).map(e=>({id:e.id,targetRepo:e.targetRepo})).sort((e,t)=>e.id.localeCompare(t.id)),allowedTargetRepos:[...null!=(c=null==d?void 0:d.allowedTargetRepos)?c:[]].sort((e,t)=>e.localeCompare(t))}}(e))}a.remoteRead,a.remoteSecretWrite,a.remoteRead,a.remoteRepoWrite,["Ready for Planning","Ready for Build","PR Open","Needs Revision","Ready to Merge"].map(e=>e.toLowerCase());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,s;return null!=(s=null==(r=e.localFiles.find(e=>e.label===t))?void 0:r.exists)&&s}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,s,n){let a=[],l=[];if(s&&o(s,t.harnessRepoAccess))return{blockers:a,warnings:l};for(let e of(t.githubTokenConfigured||f(a,{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(a,{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(a,{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(a,{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(a,{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)&&f(a,{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}),n&&function(e){var t,r;let s=null==(r=e.state)||null==(t=r.linear)?void 0:t.teamKey,n=e.linearTeamKeyFromConfig;return!!s&&!!n&&s!==n}(n)&&f(a,{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:a.sort((e,t)=>e.priority-t.priority),warnings:l.sort((e,t)=>e.priority-t.priority)}}function x(e){let t=l(e.harnessSecretStatuses);return e.harnessDispatchRepoResolved&&"denied"!==e.harnessRepoAccess&&t.allPresent}function y(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||y(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 j(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 k(e){return e.replace(/^Blocked:\s*/,"").replace(/^Setup needed:\s*/,"")}function S(e){var t,r,s,n,a,i,l,h;let x=null!=(a=e.staleSmokeDiagnostics)?a:{hasStaleConfig:!1,findings:[],staleTargetRepos:[]},y=null!=(i=e.controlPlaneContext)?i:{state:null},w=function(e){let t=[];return e.envKeyPresence.LINEAR_API_KEY||c(t,{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(t,{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(t,{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(t,{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.sort((e,t)=>e.priority-t.priority)}(e.summary),b=function(e,t){var r;let s=[],n=null==(r=e.state)?void 0:r.linear;return(null==n?void 0:n.teamKey)?n.statusCoverageComplete||n.manualComplete||c(s,{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(s,{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)&&c(s,{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"}),s.sort((e,t)=>e.priority-t.priority)}(y,e.uiState),S=function(e,t){var r,s,n,a,i,l,o,d;let u=[],p=null==(r=e.state)?void 0:r.vercel,m=null==(n=e.state)||null==(s=n.linear)?void 0:s.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 Vercel 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 Vercel 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 Vercel bridge apply.",priority:165,tone:"error"}),m&&(null==(a=p.envVarPresence)?void 0:a.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 Vercel 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: Vercel webhook bridge setup is not complete yet.",action:"Next: Preview and apply Vercel bridge env vars and webhook readiness.",priority:160});return(null==t?void 0:t.vercelPreviewStale)&&c(u,{id:"vercel-preview-stale",stepId:"vercel-bridge",message:"Blocked: Vercel bridge preview is out of date.",action:"Next: Regenerate the Vercel bridge preview, then confirm and apply.",priority:167,tone:"error"}),u.sort((e,t)=>e.priority-t.priority)}(y,e.uiState),N=function(e,t,r){let s=[];return m(e,".env.local")||f(s,{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(s,{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(s,{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(s,{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(s,{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(s,{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(s,{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})),s.sort((e,t)=>e.priority-t.priority)}(e.summary,e.uiState,x),C=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,x,y),E=d({setupSummary:e.summary,controlPlaneContext:y}),P={blockers:j({blockers:R.blockers,evidence:null==(t=e.uiState)?void 0:t.cloudSecretsApplyEvidence,currentConfigStateFingerprint:E}),warnings:R.warnings},I=function(e,t,r){let s=[],n=[];if(r&&o(r,t.harnessRepoAccess))return{blockers:s,warnings:n};for(let r of(t.githubTokenConfigured||f(s,{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(s,{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(s,{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(s,{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(n,{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:s.sort((e,t)=>e.priority-t.priority),warnings:n.sort((e,t)=>e.priority-t.priority)}}(e.summary,e.remoteSummary,x),T=0===w.length,A=0===b.length,_=0===S.length,K=_&&0===N.length,O=K&&0===C.blockers.length&&e.summary.overview.readyForLocalDoctor,H=null!=(l=null==(r=e.uiState)?void 0:r.localReadinessReviewed)&&l,B=O&&H,G=B&&0===P.blockers.length,F=null!=(h=null==(s=e.uiState)?void 0:s.cloudSecretsReviewed)&&h,L=G&&F,U=L&&0===I.blockers.length,V=[...w,...b,...S,...N,...C.blockers,...P.blockers,...I.blockers].sort((e,t)=>e.priority-t.priority),D=[...C.warnings,...P.warnings,...I.warnings].sort((e,t)=>e.priority-t.priority),Y=T?A?_?K?B?L?U?"ready-for-first-run":"target-workflow":"cloud-secrets":"local-readiness":"local-setup":"vercel-bridge":"linear-workspace":"connect-services",M={"connect-services":w,"linear-workspace":b,"vercel-bridge":S,"local-setup":N,"local-readiness":C.blockers,"cloud-secrets":P.blockers,"target-workflow":I.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}]},$=u.map(e=>{var t,r;let s=function(e,t,r,s,n,a,i,l){switch(e){case"connect-services":return!0;case"linear-workspace":return t;case"vercel-bridge":return r;case"local-setup":return s;case"local-readiness":return n;case"cloud-secrets":return a;case"target-workflow":return i;case"ready-for-first-run":return l}}(e,T,A,_,K,B,L,U),n=M[e],a="local-readiness"===e?C.warnings:"cloud-secrets"===e?P.warnings:"target-workflow"===e?I.warnings:[],i="connect-services"===e?T:"linear-workspace"===e?A:"vercel-bridge"===e?_:"local-setup"===e?K:"local-readiness"===e?B:"cloud-secrets"===e?L:U,l=e===Y;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:s,blockers:n,complete:i,isCurrent:l}),summary:"ready-for-first-run"===e&&U?"Harness setup is ready for a future first run.":null!=(r=null==(t=n[0])?void 0:t.message)?r:"Continue ".concat(p[e].toLowerCase(),"."),blockers:n,warnings:a,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,V),inspectable:!0,actionable:s&&(l||n.length>0)}}),z=V[0],W=z?{id:z.id,label:z.action.replace(/^Next:\s*/,""),stepId:z.stepId}:null==(n=$.find(e=>e.id===Y))?void 0:n.primaryAction,J=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:k(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:k(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:z,staleSmokeDiagnostics:x});return{steps:$,currentStepId:Y,highestPriorityBlocker:z,nextRecommendedAction:W,primaryTask:J,staleSmokeDiagnostics:x,remoteSetupBlockedByUpstream:x.hasStaleConfig,readyForFirstRun:U,localReadinessBlockersCleared:O,localReadinessReviewed:H,localReadinessComplete:B,cloudSecretsBlockersCleared:G,cloudSecretsReviewed:F,nonBlockingWarnings:D,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."}}let N={sectionStack:"flex flex-col gap-6"},C={section:"space-y-6",cardHeader:"space-y-1.5 pb-4",list:"space-y-3",inline:"flex flex-wrap items-center gap-2",stackSm:"space-y-2"},R={pageTitle:"text-2xl font-semibold tracking-tight md:text-3xl",pageDescription:"text-sm text-muted-foreground md:text-base",twoColumnGrid:"grid grid-cols-1 gap-4 md:grid-cols-2",previewPanel:"overflow-x-auto rounded-md border border-border bg-muted/40 p-4 text-xs md:text-sm"},E={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"},P=["connect-services","linear-workspace","vercel-bridge","local-setup","local-readiness","cloud-secrets","target-workflow","ready-for-first-run"],I=["connect-services","linear-workspace","vercel-bridge","choose-target-repos","local-readiness","cloud-secrets","target-workflow","ready-for-first-run"];function T(e){return I.indexOf(e)}function A(e){var t;let r=T(e);return r<=0?null:null!=(t=I[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"}}var O=r(6845),H=r(4616),B=r(826);let G=(0,H.F)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",outline:"text-foreground",success:"border-transparent bg-emerald-100 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-200",warning:"border-transparent bg-amber-100 text-amber-800 dark:bg-amber-950 dark:text-amber-200",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80"}},defaultVariants:{variant:"default"}});function F(e){let{className:t,variant:r,...n}=e;return(0,s.jsx)("div",{className:(0,B.cn)(G({variant:r}),t),...n})}function L(e){let{label:t,variant:r="secondary",className:n}=e;return(0,s.jsx)(F,{variant:r,className:(0,B.cn)(n),children:t})}var U=r(9760),V=r(8653);let D=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,s.jsx)("div",{ref:t,className:(0,B.cn)("rounded-xl border border-border bg-card text-card-foreground shadow-sm",r),...n})});D.displayName="Card";let Y=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,s.jsx)("div",{ref:t,className:(0,B.cn)("flex flex-col space-y-1.5 p-6",r),...n})});Y.displayName="CardHeader";let M=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,s.jsx)("div",{ref:t,className:(0,B.cn)("font-semibold leading-none tracking-tight",r),...n})});M.displayName="CardTitle";let $=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,s.jsx)("div",{ref:t,className:(0,B.cn)("text-sm text-muted-foreground",r),...n})});$.displayName="CardDescription";let z=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,s.jsx)("div",{ref:t,className:(0,B.cn)("p-6 pt-0",r),...n})});function W(e){let{title:t,description:r,children:n,className:a}=e;return(0,s.jsxs)(D,{className:a,children:[(0,s.jsxs)(Y,{className:C.cardHeader,children:[(0,s.jsx)(M,{children:t}),r?(0,s.jsx)($,{children:r}):null]}),(0,s.jsx)(z,{className:(0,B.cn)(C.stackSm),children:n})]})}function J(e){let{readiness:t}=e,r=t.steps.find(e=>e.id===t.currentStepId);return(0,s.jsx)(W,{title:"Setup readiness",description:"One recommended next action at a time.",children:(0,s.jsxs)("div",{className:C.stackSm,children:[(0,s.jsxs)("div",{className:C.inline,children:[(0,s.jsx)(L,{label:t.readyForFirstRun?"Ready for first run":"Setup in progress",variant:t.readyForFirstRun?"success":"warning"}),r?(0,s.jsx)(L,{label:"Current step: ".concat(r.label),variant:"secondary"}):null]}),t.highestPriorityBlocker?(0,s.jsxs)("div",{className:"setup_needed"===t.highestPriorityBlocker.tone?"flex items-start gap-3 rounded-md border border-border bg-muted/30 p-3":"flex items-start gap-3 rounded-md border border-destructive/30 bg-destructive/5 p-3",children:["setup_needed"===t.highestPriorityBlocker.tone?(0,s.jsx)(U.A,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}):(0,s.jsx)(V.A,{className:"mt-0.5 size-4 shrink-0 text-destructive"}),(0,s.jsxs)("div",{className:C.stackSm,children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:t.highestPriorityBlocker.message.replace(/^Blocked:\s*/,"").replace(/^Setup needed:\s*/,"")}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:t.highestPriorityBlocker.action})]})]}):t.nextRecommendedAction?(0,s.jsxs)("div",{className:"flex items-start gap-3 rounded-md border border-border bg-muted/30 p-3",children:[(0,s.jsx)(U.A,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}),(0,s.jsxs)("div",{className:C.stackSm,children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Next recommended action"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:t.nextRecommendedAction.label})]})]}):null,t.nonBlockingWarnings.length>0&&!t.remoteSetupBlockedByUpstream?(0,s.jsx)("ul",{className:"list-disc space-y-1 pl-5 text-sm text-muted-foreground",children:t.nonBlockingWarnings.map(e=>(0,s.jsx)("li",{children:e.message},e.id))}):t.remoteSetupBlockedByUpstream?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Remote setup details stay collapsed until harness repo access is fixed."}):null]})})}z.displayName="CardContent";var q=r(7186);let Z=n.forwardRef((e,t)=>{let{className:r,orientation:n="horizontal",...a}=e;return(0,s.jsx)("div",{ref:t,className:(0,B.cn)("shrink-0 bg-border","horizontal"===n?"h-px w-full":"h-full w-px",r),...a})});Z.displayName="Separator";let Q=n.forwardRef((e,t)=>{let{className:r,type:n,...a}=e;return(0,s.jsx)("input",{type:n,className:(0,B.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",r),ref:t,...a})});Q.displayName="Input";let X=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,s.jsx)("label",{ref:t,className:(0,B.cn)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),...n})});X.displayName="Label";var ee=r(1342);let et="size-4 shrink-0 text-muted-foreground";function er(e){let{serviceKey:t,className:r}=e,n=(0,B.cn)(et,r);switch(t){case"LINEAR_API_KEY":return(0,s.jsx)(ee.iU0,{className:n,"aria-hidden":"true"});case"CURSOR_API_KEY":return(0,s.jsx)(ee.biF,{className:n,"aria-hidden":"true"});case"GITHUB_TOKEN":return(0,s.jsx)(ee.SrF,{className:n,"aria-hidden":"true"});case"VERCEL_TOKEN":return(0,s.jsx)(ee.ogR,{className:n,"aria-hidden":"true"})}}function es(e){let{className:t}=e;return(0,s.jsx)(ee.SrF,{className:(0,B.cn)(et,t),"aria-hidden":"true"})}var en=r(4653);function ea(e){let{message:t,failed:r=!1,className:n}=e;return(0,s.jsxs)("p",{className:(0,B.cn)("flex items-center gap-2 text-sm",r?"text-destructive":"text-muted-foreground",n),children:[r?null:(0,s.jsx)(en.A7C,{className:"size-4 shrink-0 text-green-600","aria-hidden":"true"}),(0,s.jsx)("span",{children:t})]})}function ei(e){let t=e.trim(),r=0;for(let e=0;e<t.length;e++)r=(r<<5)-r+t.charCodeAt(e)|0;return"fp:".concat(r,":").concat(t.length)}function el(e,t){return"connected"===e.state&&!!t.trim()&&e.verifiedValueFingerprint===ei(t)}function eo(e){let t=e.typedToken.trim();return t?{tokenForRequest:t,source:"typed",fingerprint:ei(t)}:e.hasSavedToken?{source:"saved",fingerprint:"saved-local"}:null}function ec(e,t,r){return!!r&&!!function(e,t){if(!e||"connected"!==e.state)return!1;let r=t.trim();return!!r&&e.verifiedTargetRepo===r}(e,t)&&(null==e?void 0:e.verifiedGithubTokenFingerprint)===r}function ed(e){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"guided-repo-".concat(e)}let eu="https://github.com/settings/tokens",ep=[{id:"repo",description:"read and write repository contents, including private target repos and harness repo secrets"},{id:"workflow",description:"update GitHub Actions workflow files when the harness opens workflow install PRs"}];var em=r(2536);let eh={generateNewToken:"/setup/github-token/github-pat-generate-new-token.png",generateClassic:"/setup/github-token/github-pat-generate-classic.png",verifyEmail:"/setup/github-token/github-pat-verify-email.png"};function ef(e){let{src:t,alt:r}=e;return(0,s.jsx)("div",{className:"overflow-hidden rounded-md border border-border bg-muted/20",children:(0,s.jsx)(em.default,{src:t,alt:r,width:640,height:360,className:"h-auto w-full max-w-sm",sizes:"(max-width: 640px) 100vw, 320px"})})}function eg(){return(0,s.jsxs)("details",{className:"rounded-md border border-border/80 bg-muted/10 p-3",children:[(0,s.jsx)("summary",{className:"cursor-pointer text-sm text-muted-foreground hover:text-foreground",children:"How do I get a GitHub token?"}),(0,s.jsxs)("ol",{className:"mt-3 list-decimal space-y-4 pl-5 text-sm text-muted-foreground",children:[(0,s.jsxs)("li",{className:"space-y-1",children:[(0,s.jsxs)("p",{children:["Go to"," ",(0,s.jsx)("a",{href:eu,target:"_blank",rel:"noopener noreferrer",className:"text-foreground underline underline-offset-2",children:eu}),"."]}),(0,s.jsxs)("p",{className:E.secretHint,children:["Open ",(0,s.jsx)("strong",{className:"font-medium text-foreground",children:"Personal access tokens"})," ","and choose the ",(0,s.jsx)("strong",{className:"font-medium text-foreground",children:"Tokens (classic)"})," ","tab if GitHub shows both classic and fine-grained options."]})]}),(0,s.jsxs)("li",{className:"space-y-2",children:[(0,s.jsxs)("p",{children:["Click ",(0,s.jsx)("strong",{className:"font-medium text-foreground",children:"Generate new token"}),"."]}),(0,s.jsx)(ef,{src:eh.generateNewToken,alt:"GitHub Personal access tokens page with Generate new token button"})]}),(0,s.jsxs)("li",{className:"space-y-2",children:[(0,s.jsxs)("p",{children:["Choose"," ",(0,s.jsx)("strong",{className:"font-medium text-foreground",children:"Generate new token (classic)"}),"."]}),(0,s.jsx)("p",{className:E.secretHint,children:"Use classic for the guided happy path. Fine-grained tokens can work, but they require repo-specific permissions and are better for advanced setup."}),(0,s.jsx)(ef,{src:eh.generateClassic,alt:"GitHub dropdown showing Generate new token classic for general use"})]}),(0,s.jsxs)("li",{className:"space-y-2",children:[(0,s.jsx)("p",{children:"If GitHub asks you to verify your email, complete that step before continuing."}),(0,s.jsx)(ef,{src:eh.verifyEmail,alt:"GitHub email verification prompt with Verify via email button"})]}),(0,s.jsxs)("li",{children:["Give the token a clear name, for example"," ",(0,s.jsx)("strong",{className:"font-medium text-foreground",children:"Product Development Harness"}),"."]}),(0,s.jsxs)("li",{className:"space-y-1",children:[(0,s.jsx)("p",{children:"Select these scopes:"}),(0,s.jsx)("ul",{className:"list-disc space-y-1 pl-5",children:ep.map(e=>(0,s.jsxs)("li",{children:[(0,s.jsx)("strong",{className:"font-medium text-foreground",children:e.id})," — ",e.description]},e.id))})]}),(0,s.jsxs)("li",{children:["Click ",(0,s.jsx)("strong",{className:"font-medium text-foreground",children:"Generate token"})," ","at the bottom of the page."]}),(0,s.jsxs)("li",{className:"space-y-1",children:[(0,s.jsx)("p",{children:"Copy the token immediately and store it somewhere safe. GitHub only shows it once."}),(0,s.jsx)("p",{className:E.secretHint,children:"Paste the copied token into the field above, then click Verify."})]})]}),(0,s.jsxs)("div",{className:"mt-4 rounded-md border border-dashed border-border/80 bg-background/50 p-3 text-xs text-muted-foreground",children:[(0,s.jsx)("p",{className:"font-medium text-foreground",children:"Advanced option"}),(0,s.jsx)("p",{className:"mt-1",children:"Fine-grained tokens can also work if they have access to each target repo and include Contents write plus Workflows write permissions. Use this only if you want repo-specific access control."})]})]})}let ev={LINEAR_API_KEY:{state:"unchecked"},CURSOR_API_KEY:{state:"unchecked"},GITHUB_TOKEN:{state:"unchecked"},VERCEL_TOKEN:{state:"unchecked"}},ex=[{key:"LINEAR_API_KEY",id:"linear-api-key",displayName:"Linear",valueKey:"linearApiKey",helperText:"Lets the harness read and update Linear issues.",inputLabel:"Go to Linear, create or copy your API key, then paste it here."},{key:"CURSOR_API_KEY",id:"cursor-api-key",displayName:"Cursor",valueKey:"cursorApiKey",helperText:"Used to spin up Cursor agents that do the planning and development work.",inputLabel:"Go to Cursor, create or copy your API key, then paste it here."},{key:"GITHUB_TOKEN",id:"github-token",displayName:"GitHub",valueKey:"githubToken",helperText:"Use a classic GitHub personal access token with repo and workflow access. This lets the harness check your repos, save encrypted setup secrets, and open workflow install PRs later.",inputLabel:"Paste your GitHub token"},{key:"VERCEL_TOKEN",id:"vercel-token",displayName:"Vercel",valueKey:"vercelToken",helperText:"Used to create or access Vercel previews so implementation work can be verified before code is merged.",inputLabel:"Go to Vercel, create or copy your token, then paste it here."}];function ey(e){let{values:t,presence:r,highlightDispatchRepo:n=!1,variant:a="advanced",verification:i=ev,verifyingKey:l=null,onChange:o,onVerifyService:c,onServiceBlur:d}=e,u=e=>{o({...t,...e})};return"guided-services"===a?(0,s.jsx)("div",{className:"space-y-4",children:ex.map(e=>(0,s.jsx)(ew,{id:e.id,serviceKey:e.key,displayName:e.displayName,envKey:e.key,helperText:e.helperText,inputLabel:e.inputLabel,present:r[e.key],value:t[e.valueKey],verification:i[e.key],verifying:l===e.key,onChange:t=>u({[e.valueKey]:t}),onVerify:c?()=>c(e.key):void 0,onBlur:d?()=>d(e.key):void 0},e.key))}):(0,s.jsxs)("div",{className:E.fieldGrid,children:[(0,s.jsxs)("div",{className:E.fieldStack,children:[(0,s.jsx)(X,{htmlFor:"harness-config-path",children:"HARNESS_CONFIG_PATH"}),(0,s.jsx)(Q,{id:"harness-config-path",value:t.harnessConfigPath,onChange:e=>u({harnessConfigPath:e.target.value}),autoComplete:"off"}),(0,s.jsx)("p",{className:E.secretHint,children:"Recommended: .harness/config.local.json"})]}),(0,s.jsxs)("div",{className:E.fieldStack,children:[(0,s.jsx)(X,{htmlFor:"github-dispatch-repository",children:"GITHUB_DISPATCH_REPOSITORY"}),(0,s.jsx)(Q,{id:"github-dispatch-repository",value:t.githubDispatchRepository,onChange:e=>u({githubDispatchRepository:e.target.value}),autoComplete:"off",className:n?"border-destructive/60":void 0}),(0,s.jsxs)("p",{className:E.secretHint,children:["Harness repo used for remote setup checks and Actions secret writes.",n?" This value still points at an old disposable smoke-test repo.":" Defaults to git remote origin when unset."]})]}),ex.map(e=>(0,s.jsx)(eb,{id:e.id,label:e.key,present:r[e.key],value:t[e.valueKey],onChange:t=>u({[e.valueKey]:t})},e.key))]})}function ew(e){let{id:t,serviceKey:r,displayName:n,envKey:a,helperText:i,inputLabel:l,present:o,value:c,verification:d,verifying:u,onChange:p,onVerify:m,onBlur:h}=e,f=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"}}}(d.state),g=c.trim(),v="connected"===d.state&&(g?el(d,g):o),x="failed"===d.state&&(g?"failed"===d.state&&!!g.trim()&&d.attemptedValueFingerprint===ei(g):o),y=v&&!!d.message,w=x&&!!d.message,b=u||v||!g&&!o;return(0,s.jsxs)("div",{className:"rounded-lg border border-border bg-card p-4 space-y-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("p",{className:"inline-flex items-center gap-2 text-sm font-medium",children:[(0,s.jsx)(er,{serviceKey:r}),(0,s.jsx)("span",{children:n})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:a})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[o?(0,s.jsx)(L,{label:"Saved locally",variant:"secondary"}):null,(0,s.jsx)(L,{label:f.label,variant:f.variant})]})]}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:i}),(0,s.jsxs)("div",{className:E.fieldStack,children:[(0,s.jsx)(X,{htmlFor:t,children:null!=l?l:a}),(0,s.jsx)(Q,{id:t,type:"password",value:c,onChange:e=>p(e.target.value),onBlur:h,placeholder:o?"Leave blank to keep existing value":"Enter value",autoComplete:"off"})]}),"GITHUB_TOKEN"===r?(0,s.jsx)(eg,{}):null,(0,s.jsxs)("div",{className:"flex flex-col items-start gap-2",children:[y?(0,s.jsx)(ea,{message:d.message}):w?(0,s.jsx)(ea,{message:d.message,failed:!0}):o&&"unchecked"===d.state&&!g?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"A key is already saved in `.env.local`. Verify it if you want to confirm it still works."}):null,d.limitation&&(v||x)?(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:d.limitation}):null,m?(0,s.jsx)(O.$,{type:"button",variant:"outline",size:"sm",onClick:m,disabled:b,children:u?"Verifying and saving…":v?"Verified":"Verify and save"}):null]})]})}function eb(e){let{id:t,label:r,present:n,value:a,helperText:i,onChange:l}=e;return(0,s.jsxs)("div",{className:E.fieldStack,children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(X,{htmlFor:t,children:r}),(0,s.jsx)(L,{label:n?"Set":"Not configured yet",variant:n?"success":"secondary"})]}),(0,s.jsx)(Q,{id:t,type:"password",value:a,onChange:e=>l(e.target.value),placeholder:n?"Leave blank to keep existing value":"Enter value",autoComplete:"off"}),i?(0,s.jsx)("p",{className:E.secretHint,children:i}):n?(0,s.jsx)("p",{className:E.secretHint,children:"Existing values are never shown. Leave blank to preserve a set key."}):null]})}let ej=n.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,s.jsx)("textarea",{className:(0,B.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",r),ref:t,...n})});ej.displayName="Textarea";let ek=/^https:\/\/github\.com\/[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+\/?$/;function eS(e){var t,r,a,i,l,o,c,d,u,p,m,h,f;let{values:g,highlightStaleTarget:v=!1,variant:x="advanced",suggestedHarnessDispatchRepo:y,savedHarnessDispatchRepository:w="",harnessRepoVerification:b={state:"unchecked"},verifyingHarnessRepo:j=!1,guidedRepos:k,repoVerification:S={},verifyingRepoRowId:N=null,onChange:C,onGuidedReposChange:R,onVerifyRepo:P,onRepoBlur:I,onAddRepo:T,onRemoveRepo:A,harnessDispatchRepository:_="",onHarnessDispatchRepositoryChange:K,onVerifyAndUseHarnessRepo:H,harnessConnectedAutomatically:B=!1,githubTokenSourceHint:G,activeGithubTokenFingerprint:F=null}=e,[U,V]=(0,n.useState)({}),[D,Y]=(0,n.useState)(!1),[M,$]=(0,n.useState)(_),z=_.trim()||w.trim()||(null==y?void 0:y.trim())||"",W=w.trim()?"Saved in .env.local":(null==y?void 0:y.trim())?"Detected from git remote":"Not detected yet",J=_.trim(),q="connected"===b.state&&b.verifiedRepo===J&&(!F||b.verifiedGithubTokenFingerprint===F),Z=(e,t)=>{var r;let s=[...g.repos];s[e]={...null!=(r=s[e])?r:{id:"",targetRepo:""},...t},C({...g,repos:s})},ee=(e,t)=>{k&&R&&R(k.map(r=>r.rowId===e?{...r,...t}:r))};if("guided-minimal"===x){let e=k&&k.length>0?k:[{rowId:"fallback-repo",id:"",targetRepo:""}];return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:E.fieldStack,children:[(0,s.jsx)(X,{htmlFor:"harness-dispatch-repository-guided",children:"Harness workspace"}),D?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Q,{id:"harness-dispatch-repository-guided",value:M,onChange:e=>$(e.target.value),autoComplete:"off"}),(0,s.jsx)("p",{className:E.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"===b.state&&b.message?(0,s.jsx)(ea,{message:b.message,failed:!0}):null,b.limitation?(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:b.limitation}):null,(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[H?(0,s.jsx)(O.$,{type:"button",size:"sm",onClick:()=>H(M),disabled:j||!M.trim(),children:j?"Verifying harness repo…":"Verify and use harness repo"}):null,(0,s.jsx)(O.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>{$(J||z),Y(!1)},children:"Cancel"})]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"text-sm font-medium break-all",children:J||z||"Not connected yet"}),(0,s.jsx)("p",{className:E.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."}),B?(0,s.jsx)("p",{className:E.secretHint,children:"Connected automatically during Step 1."}):(0,s.jsx)("p",{className:E.secretHint,children:W}),w.trim()&&(null==y?void 0:y.trim())&&w.trim()!==y.trim()?(0,s.jsxs)("p",{className:E.secretHint,children:["Detected git remote: ",y,". Your saved override in `.env.local` takes precedence."]}):null,!w.trim()&&(null==y?void 0:y.trim())&&z===y?(0,s.jsx)("p",{className:E.secretHint,children:"If this detected repo is correct, you do not need to change it."}):null,q&&b.message?(0,s.jsx)(ea,{message:b.message}):null,B||q||!J?null:(0,s.jsx)("p",{className:E.secretHint,children:"Verify and use this harness repo before creating local setup files."}),(0,s.jsx)(O.$,{type:"button",variant:"outline",size:"sm",onClick:()=>{$(J||z),Y(!0)},children:B?"Use a different or existing harness repo":J?"Update harness repo":"Enter harness repo"})]})]}),(0,s.jsx)("div",{className:"space-y-4",children:e.map((e,t)=>{var r,n,a;let i=null!=(r=S[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=ec(i,o,F),d=function(e,t,r){if(!r||!e||"failed"!==e.state)return!1;let s=t.trim();return!!s&&e.attemptedTargetRepo===s&&e.attemptedGithubTokenFingerprint===r}(i,o,F),u=N===e.rowId?"Checking repo + workflow access…":c?"Verified":"Verify repo + workflow access",p=N===e.rowId||c||!ek.test(o);return(0,s.jsxs)("div",{className:"rounded-lg border border-border bg-card p-4 space-y-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,s.jsxs)("p",{className:"inline-flex items-center gap-2 text-sm font-medium",children:[(0,s.jsx)(es,{}),(0,s.jsxs)("span",{children:["Target repo ",t+1]})]}),(0,s.jsx)(L,{label:l.label,variant:l.variant})]}),(0,s.jsxs)("div",{className:E.fieldStack,children:[(0,s.jsx)(X,{htmlFor:"target-repo-".concat(e.rowId),children:"Target repo URL"}),(0,s.jsx)(Q,{id:"target-repo-".concat(e.rowId),value:e.targetRepo,onChange:t=>ee(e.rowId,{targetRepo:t.target.value}),onBlur:()=>null==I?void 0:I(e.rowId),placeholder:"https://github.com/acme/my-product",className:v&&0===t?"border-destructive/60":void 0,autoComplete:"off"}),(0,s.jsx)("p",{className:E.secretHint,children:"Copy-paste the main repo URL."}),v&&0===t?(0,s.jsx)("p",{className:E.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,s.jsx)(ea,{message:"Connected"}):d&&i.message?(0,s.jsx)(ea,{message:i.message,failed:!0}):null,i.limitation&&(c||d)?(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:i.limitation}):null,(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[P?(0,s.jsx)(O.$,{type:"button",variant:"outline",size:"sm",onClick:()=>P(e.rowId),disabled:p,children:u}):null,t>0&&A?(0,s.jsx)(O.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>A(e.rowId),children:"Remove repo"}):null]}),(0,s.jsxs)("div",{className:E.fieldStack,children:[(0,s.jsx)(O.$,{type:"button",variant:"outline",size:"sm",onClick:()=>V(t=>({...t,[e.rowId]:!t[e.rowId]})),children:U[e.rowId]?"Hide advanced branch settings":"Advanced branch settings"}),U[e.rowId]?(0,s.jsxs)("div",{className:E.fieldGrid,children:[(0,s.jsxs)("div",{className:E.fieldStack,children:[(0,s.jsx)(X,{htmlFor:"guided-base-branch-".concat(e.rowId),children:"Base branch"}),(0,s.jsx)(Q,{id:"guided-base-branch-".concat(e.rowId),value:null!=(n=e.baseBranch)?n:"",onChange:t=>ee(e.rowId,{baseBranch:t.target.value}),placeholder:"dev",autoComplete:"off"})]}),(0,s.jsxs)("div",{className:E.fieldStack,children:[(0,s.jsx)(X,{htmlFor:"guided-production-branch-".concat(e.rowId),children:"Production branch"}),(0,s.jsx)(Q,{id:"guided-production-branch-".concat(e.rowId),value:null!=(a=e.productionBranch)?a:"",onChange:t=>ee(e.rowId,{productionBranch:t.target.value}),placeholder:"main",autoComplete:"off"})]}),(0,s.jsx)("p",{className:E.secretHint,children:"Leave blank to use defaults: dev for base branch and main for production branch."})]}):null]})]},e.rowId)})}),T?(0,s.jsx)(O.$,{type:"button",variant:"outline",onClick:T,children:"Add additional repo"}):null]})}let et=null!=(t=g.repos[0])?t:{id:"",targetRepo:""};return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:E.fieldGrid,children:[(0,s.jsxs)("div",{className:E.fieldStack,children:[(0,s.jsx)(X,{htmlFor:"linear-team-key",children:"Linear team key"}),(0,s.jsx)(Q,{id:"linear-team-key",value:null!=(r=g.linearTeamKey)?r:"",onChange:e=>C({...g,linearTeamKey:e.target.value})})]}),(0,s.jsxs)("div",{className:E.fieldStack,children:[(0,s.jsx)(X,{htmlFor:"model-id",children:"Model ID"}),(0,s.jsx)(Q,{id:"model-id",value:null!=(a=g.modelId)?a:"",onChange:e=>C({...g,modelId:e.target.value})}),(0,s.jsx)("p",{className:E.secretHint,children:"Local setup only. Harness runs use standard Composer 2.5 policy."})]})]}),(0,s.jsxs)("div",{className:E.fieldGrid,children:[(0,s.jsxs)("div",{className:E.fieldStack,children:[(0,s.jsx)(X,{htmlFor:"repo-id",children:"Repo config ID"}),(0,s.jsx)(Q,{id:"repo-id",value:et.id,onChange:e=>Z(0,{id:e.target.value})})]}),(0,s.jsxs)("div",{className:E.fieldStack,children:[(0,s.jsx)(X,{htmlFor:"target-repo",children:"Target repo URL"}),(0,s.jsx)(Q,{id:"target-repo",value:et.targetRepo,onChange:e=>Z(0,{targetRepo:e.target.value}),className:v?"border-destructive/60":void 0}),v?(0,s.jsx)("p",{className:E.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,s.jsxs)("div",{className:E.fieldStack,children:[(0,s.jsx)(X,{htmlFor:"linear-projects",children:"Linear projects"}),(0,s.jsx)(Q,{id:"linear-projects",value:null!=(i=et.linearProjects)?i:"",onChange:e=>Z(0,{linearProjects:e.target.value}),placeholder:"Comma-separated"})]}),(0,s.jsxs)("div",{className:E.fieldStack,children:[(0,s.jsx)(X,{htmlFor:"linear-teams",children:"Linear teams"}),(0,s.jsx)(Q,{id:"linear-teams",value:null!=(l=et.linearTeams)?l:"",onChange:e=>Z(0,{linearTeams:e.target.value}),placeholder:"Comma-separated"})]}),(0,s.jsxs)("div",{className:E.fieldStack,children:[(0,s.jsx)(X,{htmlFor:"base-branch",children:"Base branch"}),(0,s.jsx)(Q,{id:"base-branch",value:null!=(o=et.baseBranch)?o:"",onChange:e=>Z(0,{baseBranch:e.target.value}),placeholder:"dev"})]}),(0,s.jsxs)("div",{className:E.fieldStack,children:[(0,s.jsx)(X,{htmlFor:"production-branch",children:"Production branch"}),(0,s.jsx)(Q,{id:"production-branch",value:null!=(c=et.productionBranch)?c:"",onChange:e=>Z(0,{productionBranch:e.target.value}),placeholder:"main"})]}),(0,s.jsxs)("div",{className:E.fieldStack,children:[(0,s.jsx)(X,{htmlFor:"preview-provider",children:"Preview provider"}),(0,s.jsx)(Q,{id:"preview-provider",value:null!=(d=et.previewProvider)?d:"",onChange:e=>Z(0,{previewProvider:e.target.value}),placeholder:"vercel"})]}),(0,s.jsxs)("div",{className:E.fieldStack,children:[(0,s.jsx)(X,{htmlFor:"integration-preview-url",children:"Integration preview URL"}),(0,s.jsx)(Q,{id:"integration-preview-url",value:null!=(u=et.integrationPreviewUrl)?u:"",onChange:e=>Z(0,{integrationPreviewUrl:e.target.value})})]}),(0,s.jsxs)("div",{className:E.fieldStack,children:[(0,s.jsx)(X,{htmlFor:"production-url",children:"Production URL"}),(0,s.jsx)(Q,{id:"production-url",value:null!=(p=et.productionUrl)?p:"",onChange:e=>Z(0,{productionUrl:e.target.value})})]}),(0,s.jsxs)("div",{className:E.fieldStack,children:[(0,s.jsx)(X,{htmlFor:"integration-success-status",children:"Integration success status"}),(0,s.jsx)(Q,{id:"integration-success-status",value:null!=(m=et.integrationSuccessStatus)?m:"",onChange:e=>Z(0,{integrationSuccessStatus:e.target.value}),placeholder:"Merged to Dev"})]}),(0,s.jsxs)("div",{className:E.fieldStack,children:[(0,s.jsx)(X,{htmlFor:"production-success-status",children:"Production success status"}),(0,s.jsx)(Q,{id:"production-success-status",value:null!=(h=et.productionSuccessStatus)?h:"",onChange:e=>Z(0,{productionSuccessStatus:e.target.value}),placeholder:"Merged / Deployed"})]})]}),(0,s.jsxs)("div",{className:E.fieldStack,children:[(0,s.jsx)(X,{htmlFor:"validation-commands",children:"Validation commands"}),(0,s.jsx)(ej,{id:"validation-commands",value:null!=(f=et.validationCommands)?f:"",onChange:e=>Z(0,{validationCommands:e.target.value}),placeholder:"One command per line",rows:4})]})]})}function eN(e){let{title:t,content:r,className:n}=e;return(0,s.jsxs)("div",{className:(0,B.cn)(C.stackSm,n),children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:t}),(0,s.jsx)("pre",{className:(0,B.cn)(R.previewPanel,"font-mono whitespace-pre-wrap"),children:null!=r?r:"No preview available."})]})}function eC(e){let{envPreview:t,configPreview:r,validationError:n,variant:a="advanced",isLoading:i=!1}=e;return i?null:t||r||n?(0,s.jsxs)("div",{className:"space-y-4",children:[n?(0,s.jsx)("p",{className:"text-sm text-destructive",children:n}):null,t?(0,s.jsx)(eN,{title:".env.local preview (redacted)",content:t}):null,r?(0,s.jsx)(eN,{title:".harness/config.local.json preview",content:r}):null]}):"guided"===a?null:(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Generate a preview to review redacted local file changes before applying."})}let eR=n.forwardRef((e,t)=>{let{className:r,type:n="checkbox",...a}=e;return(0,s.jsx)("input",{type:n,className:(0,B.cn)("h-4 w-4 shrink-0 cursor-pointer rounded border border-input accent-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",r),ref:t,...a})});function eE(e){let{plan:t,confirmed:r,onConfirmedChange:n,disabled:a=!1,disabledReason:i,variant:l="advanced",intent:o="create"}=e;return"guided"===l?(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)(eR,{id:"confirm-local-write-guided",checked:r,disabled:a,onChange:e=>n(e.target.checked)}),(0,s.jsx)(X,{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."})]}),a&&i&&i.includes("validation")?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:i}):null]}):(0,s.jsxs)("div",{className:E.confirmationBox,children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Confirm local file writes"}),(0,s.jsxs)("ul",{className:"list-disc space-y-1 pl-5 text-sm text-muted-foreground",children:[(0,s.jsxs)("li",{children:[".env.local — ",(null==t?void 0:t.envAction)==="update"?"update":"create"]}),(0,s.jsxs)("li",{children:[".harness/config.local.json —"," ",(null==t?void 0:t.configAction)==="update"?"update":"create"]}),(0,s.jsx)("li",{children:"Files are local, gitignored, and written only on this machine."}),(0,s.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,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)(eR,{id:"confirm-local-write",checked:r,disabled:a,onChange:e=>n(e.target.checked)}),(0,s.jsx)(X,{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."})]}),a&&i?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:i}):null]})}function eP(e){let{className:t,...r}=e;return(0,s.jsx)("div",{className:(0,B.cn)("animate-pulse rounded-md bg-muted",t),...r})}function eI(e){let{open:t,onOpenChange:r,isLoading:n,previewError:a,envPreview:i,configPreview:l,validationError:o,previewIsCurrent:c}=e;return(0,s.jsxs)("details",{open:t,className:"rounded-md border border-border bg-background p-3",children:[(0,s.jsx)("summary",{className:"cursor-pointer text-sm font-medium",onClick:e=>{e.preventDefault(),r(!t)},children:"Review generated files"}),(0,s.jsx)("div",{className:"mt-3 space-y-3",children:n?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Generating redacted local file changes…"}),(0,s.jsxs)("div",{className:"space-y-2","aria-hidden":"true",children:[(0,s.jsx)(eP,{className:"h-4 w-[60%]"}),(0,s.jsx)(eP,{className:"h-24 w-full"}),(0,s.jsx)(eP,{className:"h-4 w-[40%]"}),(0,s.jsx)(eP,{className:"h-32 w-full"})]})]}):a?(0,s.jsx)("p",{className:"text-sm text-destructive",children:a}):(0,s.jsx)(eC,{variant:"guided",envPreview:c?i:void 0,configPreview:c?l:void 0,validationError:c?o:void 0})})]})}function eT(e){let{success:t,message:r,summary:n}=e;return(0,s.jsxs)("div",{className:"space-y-3 rounded-md border border-border p-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(L,{label:t?"Applied":"Failed",variant:t?"success":"destructive"}),(0,s.jsx)("p",{className:"text-sm font-medium",children:r})]}),t&&n?(0,s.jsxs)("dl",{className:"grid grid-cols-1 gap-3 text-sm md:grid-cols-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-muted-foreground",children:"Local files present"}),(0,s.jsx)("dd",{children:n.overview.localFilesPresent?"Yes":"No"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-muted-foreground",children:"Config resolved"}),(0,s.jsx)("dd",{children:n.overview.configResolved?"Yes":"No"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-muted-foreground",children:"LINEAR_API_KEY"}),(0,s.jsx)("dd",{children:n.envKeyPresence.LINEAR_API_KEY?"Set":"Missing"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-muted-foreground",children:"CURSOR_API_KEY"}),(0,s.jsx)("dd",{children:n.envKeyPresence.CURSOR_API_KEY?"Set":"Missing"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-muted-foreground",children:"GITHUB_TOKEN"}),(0,s.jsx)("dd",{children:n.envKeyPresence.GITHUB_TOKEN?"Set":"Missing"})]})]}):null]})}eR.displayName="Checkbox";var eA=r(9100),e_=r(743);function eK(e){let{stepKey:t,children:r,className:n}=e,a=(0,q.I)();return(0,s.jsx)(eA.N,{mode:"wait",initial:!1,children:(0,s.jsx)(e_.P.div,{className:(0,B.cn)(n),variants:a?{initial:{opacity:0},animate:{opacity:1,transition:{duration:.15,ease:[.2,0,0,1]}},exit:{opacity:0,transition:{duration:.12,ease:[.3,0,1,1]}}}:{initial:{opacity:0,y:12},animate:{opacity:1,y:0,transition:{duration:.28,ease:[.2,0,0,1]}},exit:{opacity:0,y:-8,transition:{duration:.22,ease:[.3,0,1,1]}}},initial:"initial",animate:"animate",exit:"exit",children:r},t)})}let eO={LINEAR_API_KEY:"linear",CURSOR_API_KEY:"cursor",GITHUB_TOKEN:"github",VERCEL_TOKEN:"vercel"},eH={LINEAR_API_KEY:"linearApiKey",CURSOR_API_KEY:"cursorApiKey",GITHUB_TOKEN:"githubToken",VERCEL_TOKEN:"vercelToken"};function eB(e){var t;let{mode:r="advanced",guidedStep:a,onGuidedStepChange:i,initialEnv:l,initialConfig:o,highlightStaleDispatch:c=!1,highlightStaleTarget:d=!1,onSummaryUpdated:u,onUiStateChange:p,onGuidedLocalApplySuccess:m,onConnectServicesComplete:h,localSetupFilesExist:f=!1}=e,g=(0,q.I)(),v=(0,n.useRef)(null),x=(0,n.useRef)(1),[y,w]=(0,n.useState)("connect-services"),b=null!=a?a:y,[j,k]=(0,n.useState)({harnessConfigPath:l.harnessConfigPath,githubDispatchRepository:l.githubDispatchRepository||l.suggestedHarnessDispatchRepo||"",linearApiKey:"",cursorApiKey:"",githubToken:"",vercelToken:""}),[S,N]=(0,n.useState)(o),[R,P]=(0,n.useState)(()=>(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return(e.repos.length>0?e.repos:[{id:"",targetRepo:""}]).map((e,r)=>({...e,rowId:ed(t+r)}))})(o,x.current)),[I,T]=(0,n.useState)(l.secretPresence),[A,_]=(0,n.useState)(ev),[K,H]=(0,n.useState)(null),[B,G]=(0,n.useState)({}),[F,L]=(0,n.useState)(null),[U,V]=(0,n.useState)({state:"unchecked"}),[D,Y]=(0,n.useState)(null),[M,$]=(0,n.useState)(null),[z,J]=(0,n.useState)(!1),[Q,X]=(0,n.useState)(null),[ee,et]=(0,n.useState)(null),[er,es]=(0,n.useState)(!1),[en,ea]=(0,n.useState)(!1),[eu,ep]=(0,n.useState)(null),[em,eh]=(0,n.useState)(null),[ef,eg]=(0,n.useState)(!1),[ex,ew]=(0,n.useState)(null),[eb,ej]=(0,n.useState)(null),[eN,eR]=(0,n.useState)(null),[eP,eA]=(0,n.useState)(null),[e_,eB]=(0,n.useState)(null),eG=(0,n.useMemo)(()=>({...S,repos:R.map(e=>{let{rowId:t,...r}=e;return r})}),[S,R]),eF=(0,n.useMemo)(()=>"guided"===r?function(e){if(!e.repos.length)return e;let t=function(e){let t=new Set,r=[];for(let s of e){let e=s.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:""}(s.targetRepo)||"target-repo",n=e,a=2;for(;t.has(n);)n="".concat(e,"-").concat(a),a+=1;t.add(n),r.push(n)}return r}(e.repos);return{...e,repos:e.repos.map((e,r)=>{var s;return{...e,id:null!=(s=t[r])?s:e.id}})}}(eG):S,[S,eG,r]),eL=(0,n.useMemo)(()=>({env:j,config:eF}),[j,eF]),eU=null!==eu&&null!==em&&JSON.stringify(em)===JSON.stringify(eL);(0,n.useEffect)(()=>{"guided"===r&&void 0!==a&&w(a)},[a,r]),(0,n.useEffect)(()=>{null==p||p({localPreviewStale:null!==eu&&!eU})},[p,eu,eU]);let eV=(0,n.useCallback)(e=>{if(i)return void i(e);w(e)},[i]);(0,n.useCallback)(e=>{eV(e),requestAnimationFrame(()=>{var e;null==(e=v.current)||e.scrollIntoView({block:"start",behavior:g?"auto":"smooth"})})},[g,eV]);let eD=e=>{if(!I[e]||"connected"!==A[e].state)return!1;let t=j[eH[e]].trim();return!t||el(A[e],t)},eY=eD("LINEAR_API_KEY")&&eD("CURSOR_API_KEY")&&eD("GITHUB_TOKEN")&&eD("VERCEL_TOKEN"),eM=I.LINEAR_API_KEY&&I.CURSOR_API_KEY&&I.GITHUB_TOKEN&&I.VERCEL_TOKEN,e$="guided"===r&&"choose-target-repos"===b,ez=(0,n.useMemo)(()=>eo({typedToken:j.githubToken,hasSavedToken:I.GITHUB_TOKEN}),[j.githubToken,I.GITHUB_TOKEN]);eF.repos.length>0&&eF.repos;let eW=R.every(e=>ek.test(e.targetRepo.trim())),eJ=R.every(e=>{var t;return ec(B[e.rowId],e.targetRepo.trim(),null!=(t=null==ez?void 0:ez.fingerprint)?t:null)}),eq=j.githubDispatchRepository.trim()||(null==(t=l.savedHarnessDispatchRepository)?void 0:t.trim())||"",eZ=eq.length>0&&(M===eq||"connected"===U.state&&U.verifiedRepo===eq&&(!(null==ez?void 0:ez.fingerprint)||U.verifiedGithubTokenFingerprint===ez.fingerprint));(0,n.useEffect)(()=>{if("guided"!==r||"choose-target-repos"!==b)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?($(r.harnessDispatchRepo),k(e=>({...e,githubDispatchRepository:r.harnessDispatchRepo})),r.connectedAutomatically&&Y(r.harnessDispatchRepo),V({state:"connected",verifiedRepo:r.harnessDispatchRepo,message:r.message})):$(null)}catch(t){e||$(null)}})(),()=>{e=!0}},[b,r]),(0,n.useEffect)(()=>{M||D||V({state:"unchecked"})},[null==ez?void 0:ez.fingerprint,D,M]);let eQ=(0,n.useCallback)(async()=>{J(!0),et(null),X("Setting up your private p-dev workspace...");try{var e,t,r;let s=await fetch("/api/setup/preview-harness-repo-provisioning",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),n=await s.json();if(!s.ok)throw Error(null!=(e=n.error)?e:"Provisioning preview failed");if("skipped-not-packaged"===n.state){null==h||h();return}let a=await fetch("/api/setup/apply-harness-repo-provisioning",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({confirmed:!0,fingerprint:n.fingerprint,operationId:n.operationId})}),i=await a.json();if(!a.ok)throw Error(null!=(t=i.error)?t:"Provisioning apply failed");if("verified-and-persisted"!==i.apply.state){if(i.apply.recoverable)return void et(i.apply.message);throw Error(null!=(r=i.apply.message)?r:"Harness workspace provisioning did not complete.")}let l=i.apply.harnessDispatchRepo;l&&(Y(l),k(e=>({...e,githubDispatchRepository:l})),V({state:"connected",verifiedRepo:l,message:i.apply.message})),null==u||u(i.summary),X(i.apply.message),null==h||h()}catch(e){et(e instanceof Error?e.message:"Harness workspace provisioning failed")}finally{J(!1)}},[h,u]),eX=()=>{eB(null),eA(null),eR(null)},e0=(0,n.useCallback)(()=>{eX(),ep(null),eh(null),ej(null),eg(!1)},[]),e1=e=>{_(t=>({...t,[e]:{state:"unchecked"}}))},e2=(0,n.useCallback)(()=>{G({})},[]),e4=(0,n.useCallback)(e=>{G(t=>{let r={...t};for(let s of e){let e=t[s.rowId];if(!e)continue;let n=s.targetRepo.trim();e.verifiedTargetRepo&&e.verifiedTargetRepo!==n?r[s.rowId]={state:"unchecked"}:e.attemptedTargetRepo&&e.attemptedTargetRepo!==n&&(r[s.rowId]={state:"unchecked"})}return r})},[]),e3=(0,n.useCallback)(async e=>{var t,r;let s=await fetch("/api/setup/preview-connect-services",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(j)}),n=await s.json();if(!s.ok)throw Error(null!=(t=n.error)?t:"Preview failed");let a=await fetch("/api/setup/apply-connect-services",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:j,confirmed:!0,fingerprint:n.fingerprint})}),i=await a.json();if(!a.ok)throw Error(null!=(r=i.error)?r:"Save failed");null==u||u(i.summary),T({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}),k(t=>({...t,[eH[e]]:""}))},[j,u]),e6=(0,n.useCallback)(async e=>{let t=j[eH[e]].trim(),r=t?ei(t):void 0;H(e),_(t=>({...t,[e]:{state:"checking"}}));try{let n=await fetch("/api/setup/verify-service",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({service:eO[e],...t?{token:t}:{}})}),a=await n.json();if(!n.ok){var s;throw Error(null!=(s=a.error)?s:"Verification failed")}if("connected"!==a.status)return void _(t=>({...t,[e]:{state:"failed",attemptedValueFingerprint:r,message:a.message,limitation:a.limitation,label:a.label}}));t&&await e3(e),_(t=>({...t,[e]:{state:"connected",verifiedValueFingerprint:r,message:a.message,limitation:a.limitation,label:a.label}}))}catch(t){_(s=>({...s,[e]:{state:"failed",attemptedValueFingerprint:r,message:t instanceof Error?t.message:"Verification failed"}}))}finally{H(null)}},[j,e3]),e5=(0,n.useCallback)(async e=>{var t,r;let s=e.trim(),n=eo({typedToken:j.githubToken,hasSavedToken:I.GITHUB_TOKEN}),a=null!=(t=null==n?void 0:n.fingerprint)?t:null;es(!0),V({state:"checking"});try{let e=await fetch("/api/setup/verify-harness-repo",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({harnessDispatchRepo:s,...(null==n?void 0:n.tokenForRequest)?{githubToken:n.tokenForRequest}:{}})}),t=await e.json();if(!e.ok)throw Error(null!=(r=t.error)?r:"Harness repo verification failed");"connected"===t.status&&t.repoSlug?(e0(),k(e=>({...e,githubDispatchRepository:t.repoSlug})),V({state:"connected",verifiedRepo:t.repoSlug,verifiedGithubTokenFingerprint:null!=a?a:void 0,message:t.message,limitation:t.limitation})):V({state:"failed",message:t.message,limitation:t.limitation})}catch(e){V({state:"failed",message:e instanceof Error?e.message:"Harness repo verification failed"})}finally{es(!1)}},[j.githubToken,e0,I.GITHUB_TOKEN]),e8=(0,n.useCallback)(async e=>{var t,r;let s=R.find(t=>t.rowId===e);if(!s)return;let n=s.targetRepo.trim(),a=eo({typedToken:j.githubToken,hasSavedToken:I.GITHUB_TOKEN}),i=null!=(t=null==a?void 0:a.fingerprint)?t:null;L(e),G(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:n,...(null==a?void 0:a.tokenForRequest)?{githubToken:a.tokenForRequest}:{}})}),s=await t.json();if(!t.ok)throw Error(null!=(r=s.error)?r:"Repo verification failed");G(t=>({...t,[e]:"connected"===s.status&&!1!==s.workflowInstallReady?{state:"connected",verifiedTargetRepo:n,verifiedGithubTokenFingerprint:null!=i?i:void 0,message:s.message,repoSlug:s.repoSlug,limitation:s.limitation,workflowInstallReady:s.workflowInstallReady}:{state:"failed",attemptedTargetRepo:n,attemptedGithubTokenFingerprint:null!=i?i:void 0,message:s.message,repoSlug:s.repoSlug,limitation:s.limitation,workflowInstallReady:s.workflowInstallReady}}))}catch(t){G(r=>({...r,[e]:{state:"failed",attemptedTargetRepo:n,attemptedGithubTokenFingerprint:null!=i?i:void 0,message:t instanceof Error?t.message:"Repo verification failed"}}))}finally{L(null)}},[j.githubToken,R,I.GITHUB_TOKEN]),e7=(0,n.useCallback)(e=>{let t=j[eH[e]].trim();t&&(el(A[e],t)||e6(e))},[j,A,e6]),e9=(0,n.useCallback)(e=>{var t;let r=R.find(t=>t.rowId===e);r&&ek.test(r.targetRepo.trim())&&(ec(B[e],r.targetRepo.trim(),null!=(t=null==ez?void 0:ez.fingerprint)?t:null)||e8(e))},[null==ez?void 0:ez.fingerprint,R,B,e8]),te=(0,n.useCallback)(async()=>{let e=await fetch("/api/setup/preview-local-files",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(eL)}),t=await e.json();if(!e.ok){var r;throw Error(null!=(r=t.error)?r:"Preview failed")}return ep(t),eh(eL),t},[eL]),tt=(0,n.useCallback)(async()=>{ew("preview"),ej(null),eg(!1);try{await te(),ea(!0)}catch(e){ep(null),eh(null),ej(e instanceof Error?e.message:"Preview failed"),ea(!0)}finally{ew(null)}},[te]),tr=(0,n.useCallback)(e=>{ea(e),e&&!eU&&"preview"!==ex&&tt()},[tt,ex,eU]),ts=async()=>{if(e$){if(!ef)return}else if(!eu||!eU||!ef)return;ew("apply"),eX();try{let t=e$?eU&&eu?eu:await te():eu;if(!t)throw Error("Preview failed");if(t.validationError)throw Error(t.validationError);let s=await fetch("/api/setup/apply-local-files",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...eL,confirmed:!0,fingerprint:t.fingerprint})}),n=await s.json();if(!s.ok){var e;throw Error(null!=(e=n.error)?e:"Apply failed")}null==u||u(n.summary),T({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}),k(e=>({...e,linearApiKey:"",cursorApiKey:"",githubToken:"",vercelToken:""})),ep(null),eh(null),eg(!1),ea(!1),"guided"===r?null==m||m():(eB(!0),eA(n.summary))}catch(e){eB(!1),eR(e instanceof Error?e.message:"Apply failed")}finally{ew(null)}},tn=async()=>{await ts()},ta=null!==ex?"Wait for the current action to finish.":void 0,ti=eU?(null==eu?void 0:eu.validationError)?"Fix validation errors before confirming this write.":void 0:"Generate a preview before you can confirm this write.",tl=(null==eu?void 0:eu.validationError)?"Fix validation errors before confirming this write.":void 0,to=null!=ti?ti:ef?void 0:"Confirm that you understand local setup files will be created on this machine.",tc=null===ex&&eM&&eW&&eJ&&eZ&&ef,td=null!==ex?"Wait for the current action to finish.":eM?eW?eJ?eZ?ef?(null==eu?void 0:eu.validationError)?"Fix validation errors before creating setup files.":void 0:"Confirm that you understand local setup files will be ".concat(f?"updated":"created"," on this machine."):eq?"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(f?"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.",tu=f?"Update local setup files":"Create local setup files",tp=f?"Updating…":"Creating…";return"guided"===r?(0,s.jsxs)("div",{className:C.section,children:[(0,s.jsx)("div",{ref:v}),(0,s.jsx)(eK,{stepKey:b,children:(()=>{switch(b){case"connect-services":return(0,s.jsxs)(W,{title:"Step 1 of ".concat(7," \xb7 Connect services"),description:"Add the API keys the harness needs on this machine.",children:[(0,s.jsx)(ey,{values:j,presence:I,variant:"guided-services",verification:A,verifyingKey:K,onChange:e=>{e0(),k(e),e.linearApiKey!==j.linearApiKey&&e1("LINEAR_API_KEY"),e.cursorApiKey!==j.cursorApiKey&&e1("CURSOR_API_KEY"),e.githubToken!==j.githubToken&&(e1("GITHUB_TOKEN"),e2()),e.vercelToken!==j.vercelToken&&e1("VERCEL_TOKEN")},onVerifyService:e6,onServiceBlur:e7}),(0,s.jsx)("div",{className:E.actions,children:(0,s.jsx)(O.$,{type:"button",onClick:()=>{eQ()},disabled:!eY||z,children:z?"Setting up your private p-dev workspace...":"Continue and set up private p-dev workspace"})}),eY?(0,s.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,s.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."}),Q?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:Q}):null,ee?(0,s.jsx)("p",{className:"text-sm text-destructive",children:ee}):null]});case"choose-target-repos":var e;return(0,s.jsxs)(W,{title:"Step 4 of ".concat(7," \xb7 Choose target repo(s) and create setup files"),description:"Tell the harness which GitHub repo(s) it should work against, then create local setup files on this machine.",children:[(0,s.jsx)(eS,{values:eG,highlightStaleTarget:d,variant:"guided-minimal",harnessDispatchRepository:j.githubDispatchRepository,savedHarnessDispatchRepository:l.savedHarnessDispatchRepository,suggestedHarnessDispatchRepo:l.suggestedHarnessDispatchRepo,harnessRepoVerification:U,verifyingHarnessRepo:er,onHarnessDispatchRepositoryChange:e=>{e0(),V({state:"unchecked"}),k(t=>({...t,githubDispatchRepository:e}))},onVerifyAndUseHarnessRepo:e=>{e5(e)},harnessConnectedAutomatically:D===eq&&M===eq&&!!eq,guidedRepos:R,repoVerification:B,verifyingRepoRowId:F,onChange:e=>{e0(),N(e)},onGuidedReposChange:e=>{e0(),e4(e),P(e)},onVerifyRepo:e8,onRepoBlur:e9,activeGithubTokenFingerprint:null!=(e=null==ez?void 0:ez.fingerprint)?e:null,onAddRepo:()=>{e0(),x.current+=1;let e=ed(x.current);P(t=>[...t,{rowId:e,id:"",targetRepo:""}])},onRemoveRepo:e=>{e0(),P(t=>t.filter(t=>t.rowId!==e)),G(t=>{let r={...t};return delete r[e],r})}}),(0,s.jsx)(Z,{className:"my-6"}),(0,s.jsxs)("div",{className:"rounded-md border border-border bg-muted/20 p-4 space-y-3",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:tu}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:f?"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,s.jsx)(eI,{open:en,onOpenChange:tr,isLoading:"preview"===ex,previewError:null!=eb?eb:void 0,envPreview:eU?null==eu?void 0:eu.envPreview:void 0,configPreview:eU?null==eu?void 0:eu.configPreview:void 0,validationError:eU?null==eu?void 0:eu.validationError:void 0,previewIsCurrent:eU}),(0,s.jsx)(eE,{variant:"guided",intent:f?"update":"create",plan:eU?null==eu?void 0:eu.plan:void 0,confirmed:ef,disabled:!!(null==eu?void 0:eu.validationError),disabledReason:tl,onConfirmedChange:eg})]}),(0,s.jsx)("div",{className:E.actions,children:(0,s.jsx)(O.$,{type:"button",onClick:tn,disabled:!tc,"data-primary-preview-button":"true",children:"apply"===ex?tp:tu})}),!tc&&td?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:td}):null]})}})()}),eN?(0,s.jsx)(eT,{success:!1,message:eN}):null]}):(0,s.jsxs)("div",{className:C.section,children:[(0,s.jsx)(W,{title:"Environment (.env.local)",description:"Edit local env keys. Existing secret values are never shown.",children:(0,s.jsx)(ey,{values:j,presence:I,highlightDispatchRepo:c,variant:"advanced",onChange:e=>{e0(),k(e)}})}),(0,s.jsx)(W,{title:"Target repo config",description:"Guided fields for .harness/config.local.json.",children:(0,s.jsx)(eS,{values:S,highlightStaleTarget:d,variant:"advanced",onChange:e=>{e0(),N(e)}})}),(0,s.jsxs)(W,{title:"Preview local changes",description:"Required before apply. Secret values are redacted in previews.",children:[(0,s.jsx)(eC,{envPreview:eU?null==eu?void 0:eu.envPreview:void 0,configPreview:eU?null==eu?void 0:eu.configPreview:void 0,validationError:eU?null==eu?void 0:eu.validationError:void 0}),(0,s.jsx)("div",{className:E.actions,children:(0,s.jsx)(O.$,{type:"button",onClick:tt,disabled:null!==ex,"data-primary-preview-button":"true",children:"preview"===ex?"Generating preview…":"Preview setup files"})}),ta?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:ta}):null]}),(0,s.jsxs)(W,{title:"Confirm and apply",description:"Writes only local gitignored setup files through setup core.",children:[(0,s.jsx)(eE,{plan:eU?null==eu?void 0:eu.plan:void 0,confirmed:ef,disabled:!eU||!!(null==eu?void 0:eu.validationError),disabledReason:ti,onConfirmedChange:eg}),(0,s.jsx)("div",{className:E.actions,children:(0,s.jsx)(O.$,{type:"button",onClick:ts,disabled:null!==ex||!eU||!ef||!!(null==eu?void 0:eu.validationError),children:"apply"===ex?"Creating…":"Create local setup files"})}),to?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:to}):null]}),eN?(0,s.jsx)(eT,{success:!1,message:eN}):null,null===e_||eN?null:(0,s.jsx)(eT,{success:e_,message:e_?"Local setup files were written successfully.":"Apply failed.",summary:null!=eP?eP:void 0})]})}let eG={LINEAR_API_KEY:"LINEAR_API_KEY",CURSOR_API_KEY:"CURSOR_API_KEY",HARNESS_GITHUB_TOKEN:"HARNESS_GITHUB_TOKEN"};function eF(e){return"present"===e?"success":"missing"===e?"warning":"secondary"}function eL(e){var t,r,n,a,i;let{values:l,secretStatuses:o,onChange:c}=e,d=e=>{c({...l,...e})},u=new Map(o.map(e=>[e.name,e.status]));return(0,s.jsxs)("div",{className:E.fieldGrid,children:[(0,s.jsxs)("div",{className:E.fieldStack,children:[(0,s.jsx)(X,{children:"HARNESS_CONFIG_JSON_B64"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Generated server-side from validated `.harness/config.local.json` during apply. Never shown in previews or responses."}),(0,s.jsx)(L,{label:null!=(t=u.get("HARNESS_CONFIG_JSON_B64"))?t:"unknown",variant:eF(null!=(r=u.get("HARNESS_CONFIG_JSON_B64"))?r:"unknown")})]}),(0,s.jsx)(eU,{id:"remote-linear-api-key",label:eG.LINEAR_API_KEY,status:null!=(n=u.get("LINEAR_API_KEY"))?n:"unknown",value:l.linearApiKey,onChange:e=>d({linearApiKey:e})}),(0,s.jsx)(eU,{id:"remote-cursor-api-key",label:eG.CURSOR_API_KEY,status:null!=(a=u.get("CURSOR_API_KEY"))?a:"unknown",value:l.cursorApiKey,onChange:e=>d({cursorApiKey:e})}),(0,s.jsx)(eU,{id:"remote-harness-github-token",label:eG.HARNESS_GITHUB_TOKEN,status:null!=(i=u.get("HARNESS_GITHUB_TOKEN"))?i:"unknown",value:l.harnessGithubToken,onChange:e=>d({harnessGithubToken:e})})]})}function eU(e){let{id:t,label:r,status:n,value:a,onChange:i}=e;return(0,s.jsxs)("div",{className:E.fieldStack,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsx)(X,{htmlFor:t,children:r}),(0,s.jsx)(L,{label:n,variant:eF(n)})]}),(0,s.jsx)(Q,{id:t,type:"password",value:a,autoComplete:"off",onChange:e=>i(e.target.value)}),(0,s.jsx)("p",{className:E.secretHint,children:"Existing GitHub Actions secret values are never readable. Leave blank to preserve an existing secret when status is present."})]})}function eV(e){let{harnessSecretPreview:t,targetWorkflowPreview:r}=e;return t||r?t?(0,s.jsxs)("div",{className:"space-y-4",children:[t.validationError?(0,s.jsx)("p",{className:"text-sm text-destructive",children:t.validationError}):null,(0,s.jsxs)("dl",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 text-sm",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-muted-foreground",children:"Harness dispatch repo"}),(0,s.jsx)("dd",{className:"font-medium break-all",children:t.harnessDispatchRepo})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-muted-foreground",children:"Repo access"}),(0,s.jsx)("dd",{className:"font-medium",children:t.repoAccess})]})]}),(0,s.jsx)(eN,{title:"Secret write plan (key names only)",content:t.secretWritePlan.map(e=>"".concat(e.name,": ").concat(e.action," (").concat(e.source,")")).join("\n")}),(0,s.jsx)(eN,{title:"Manual copy-paste alternative",content:t.manualInstructions.join("\n")})]}):r?(0,s.jsxs)("div",{className:"space-y-4",children:[r.validationError?(0,s.jsx)("p",{className:"text-sm text-destructive",children:r.validationError}):null,(0,s.jsx)(eN,{title:"Workflow install preview",content:r.workflowPreviewSummary}),(0,s.jsx)(eN,{title:"Manual copy-paste alternative",content:r.manualInstructions.join("\n")})]}):null:(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Generate a preview before confirming any remote write."})}let eD={"remote-secret-write":{advanced:{title:"Confirm harness repo Actions secret writes",bullets:["Writes encrypted GitHub Actions secrets to the harness dispatch repo only.","HARNESS_CONFIG_JSON_B64 is generated server-side from local config.","Secret values are never returned in previews, results, or errors.","No target repo branches, PRs, Linear writes, or harness phases will run."],label:"I reviewed the harness secret preview and want to write these Actions secrets."},guided:{title:"Confirm cloud secrets write",bullets:["This writes encrypted GitHub Actions secrets to the harness repo.","Preflight runs automatically before apply when you skip preview.","It does not run the harness, create branches, open PRs, or change your target app.","Secret values are never shown in previews, results, or errors."],label:"I understand this will create or update encrypted GitHub Actions secrets in the harness repo."}},"vercel-bridge-write":{advanced:{title:"Confirm Vercel bridge setup writes",bullets:["May create or reuse Vercel team and project resources when selected.","Writes required Vercel production environment variables for the bridge.","May create or verify the Linear Issue webhook for automation.","Secret values are never returned in previews, results, or errors."],label:"I reviewed the Vercel settings preview and want to apply these changes."},guided:{title:"Confirm Vercel settings write",bullets:["This may create or update Vercel production environment variables and configure the Linear webhook bridge.","It does not run the harness, create branches, open PRs, or change your target app.","Secret values are never shown in previews, results, or errors."],label:"I understand this will write Vercel environment variables and configure the Linear webhook bridge."}},"remote-repo-write":{advanced:{title:"Confirm target workflow branch and PR install",bullets:["Creates or updates an install branch and opens or reuses a PR.","Never writes directly to the target repo production or main branch.","No harness repo secret writes, Linear writes, or harness phases will run."],label:"I reviewed the workflow preview and want to create or update the install PR."},guided:{title:"Confirm workflow install PR",bullets:["This may create or update an install branch and open or reuse a PR.","It does not merge the PR, write directly to main/production, run the harness, or write Linear."],label:"I reviewed the workflow preview and want to create or update the workflow install PR."}},"linear-write":{advanced:{title:"Confirm Linear workspace writes",bullets:["May create or update Linear teams, projects, and workflow statuses.","Preview is read-only until you confirm this write.","No harness phases, GitHub dispatch, or target repo changes run from this step."],label:"I reviewed the Linear setup preview and want to apply workspace changes."},guided:{title:"Confirm Linear workspace setup",bullets:["This may create missing Linear workflow statuses or workspace resources.","It does not run harness automation or modify your target app repo."],label:"I understand this will apply Linear workspace setup changes."}}};function eY(e){let{scope:t,confirmed:r,disabled:n=!1,disabledReason:a,variant:i="advanced",onConfirmedChange:l}=e,o=eD[t][i];return(0,s.jsxs)("div",{className:E.confirmationBox,children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:o.title}),(0,s.jsx)("ul",{className:"list-disc space-y-1 pl-5 text-sm text-muted-foreground",children:o.bullets.map(e=>(0,s.jsx)("li",{children:e},e))}),(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)(eR,{id:"confirm-".concat(t),checked:r,disabled:n,onChange:e=>l(e.target.checked)}),(0,s.jsx)(X,{htmlFor:"confirm-".concat(t),className:"text-sm leading-snug",children:o.label})]}),n&&a?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:a}):null]})}function eM(e){var t,r;let{repo:a,onApplied:i,onGuidedApplySuccess:l,blockedByUpstream:o=!1,variant:c="advanced"}=e,[d,u]=(0,n.useState)(null),[p,m]=(0,n.useState)(null),[h,f]=(0,n.useState)(!1),[g,v]=(0,n.useState)(null),[x,y]=(0,n.useState)(null),[w,b]=(0,n.useState)(null),j="".concat(a.repoConfigId,":").concat(a.targetRepo,":").concat(a.productionBranch),k=null!==d&&p===j,S=async()=>{v("preview"),y(null),b(null),f(!1);try{let t=await fetch("/api/setup/preview-target-workflow",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoConfigId:a.repoConfigId,targetRepo:a.targetRepo,productionBranch:a.productionBranch})}),r=await t.json();if(!t.ok){var e;throw Error(null!=(e=r.error)?e:"Preview failed")}u(r),m(j)}catch(e){u(null),m(null),y(e instanceof Error?e.message:"Preview failed")}finally{v(null)}},N=async()=>{if(d&&k&&h){v("apply"),y(null);try{let t=await fetch("/api/setup/apply-target-workflow",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoConfigId:a.repoConfigId,targetRepo:a.targetRepo,productionBranch:a.productionBranch,confirmed:!0,fingerprint:d.fingerprint})}),r=await t.json();if(!t.ok){var e;throw Error(null!=(e=r.error)?e:"Apply failed")}let s=r.apply,n=r.finalization;u(null),m(null),f(!1),"guided"===c?null==l||l(s,n):b(s),i()}catch(e){y(e instanceof Error?e.message:"Apply failed")}finally{v(null)}}},C=(0,n.useMemo)(()=>w?"already-installed"===w.outcome?"Workflow already installed on production branch. No PR opened.":w.prUrl?"Workflow install ".concat(w.outcome,": ").concat(w.prUrl):"Workflow install ".concat(w.outcome," on branch ").concat(w.branchName,"."):null,[w]),R=o?"Fix harness repo access before target workflow setup can be previewed.":void 0,P=R||(k?(null==d?void 0:d.validationError)?"Fix validation errors before confirming this write.":void 0:"Generate a preview before you can confirm this write."),I=null!=P?P:h?void 0:"guided"===c?"Confirm the preview before creating the workflow install PR.":"Confirm the preview before applying the workflow install PR.",T="apply"===g?"Creating PR…":"guided"===c?"present"===a.workflowStatus?"Update workflow install PR":"Create workflow install PR":"Apply workflow PR";return(0,s.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,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:a.repoConfigId}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground break-all",children:a.targetRepo}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Production branch: ",a.productionBranch]})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsx)(L,{label:"Access: ".concat(a.repoAccess),variant:"available"===(t=a.repoAccess)?"success":"denied"===t?"destructive":"secondary"}),(0,s.jsx)(L,{label:"Workflow: ".concat(a.workflowStatus),variant:"present"===(r=a.workflowStatus)?"success":"differs"===r||"missing"===r?"warning":"secondary"})]})]}):null,(0,s.jsx)(eV,{targetWorkflowPreview:k&&null!=d?d:void 0}),(0,s.jsx)(eY,{scope:"remote-repo-write",variant:c,confirmed:h,disabled:!k||!!(null==d?void 0:d.validationError)||o,disabledReason:P,onConfirmedChange:f}),(0,s.jsxs)("div",{className:E.actions,children:[(0,s.jsx)(O.$,{type:"button",onClick:S,disabled:null!==g||o,children:"preview"===g?"Generating preview…":"guided"===c?"Preview workflow install PR":"Preview workflow PR"}),(0,s.jsx)(O.$,{type:"button",onClick:N,disabled:null!==g||!k||!h||!!(null==d?void 0:d.validationError)||o,children:T})]}),R?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:R}):null,I&&!R?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:I}):null,x?(0,s.jsx)(eT,{success:!1,message:x}):null,"advanced"===c&&C?(0,s.jsx)(eT,{success:!0,message:C}):null]})}function e$(e){var t;let{initialSummary:r,onSummaryUpdated:a,onUiStateChange:i,blockedByUpstream:l=!1}=e,[o,c]=(0,n.useState)(r),[d,u]=(0,n.useState)({linearApiKey:"",cursorApiKey:"",harnessGithubToken:""}),[p,m]=(0,n.useState)(null),[h,f]=(0,n.useState)(null),[g,v]=(0,n.useState)(!1),[x,y]=(0,n.useState)(null),[w,b]=(0,n.useState)(null),[j,k]=(0,n.useState)(null);(0,n.useEffect)(()=>{c(r)},[r]);let S=(0,n.useMemo)(()=>({linearApiKey:d.linearApiKey||void 0,cursorApiKey:d.cursorApiKey||void 0,harnessGithubToken:d.harnessGithubToken||void 0}),[d]),N=null!==p&&null!==h&&JSON.stringify(h)===JSON.stringify(d);(0,n.useEffect)(()=>{null==i||i({remoteSecretPreviewStale:null!==p&&!N})},[i,p,N]);let R=(0,n.useCallback)(async()=>{y("refresh");try{let t=await fetch("/api/setup/remote-summary"),r=await t.json();if(!t.ok){var e;throw Error(null!=(e=r.error)?e:"Remote summary refresh failed")}c(r),null==a||a(r)}catch(e){b(e instanceof Error?e.message:"Remote summary refresh failed")}finally{y(null)}},[a]),P=()=>{k(null),b(null)},I=async()=>{y("preview"),P(),v(!1);try{let t=await fetch("/api/setup/preview-harness-secrets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(S)}),r=await t.json();if(!t.ok){var e;throw Error(null!=(e=r.error)?e:"Preview failed")}m(r),f({...d})}catch(e){m(null),f(null),b(e instanceof Error?e.message:"Preview failed")}finally{y(null)}},T=async()=>{if(p&&N&&g){y("apply"),P();try{let t=await fetch("/api/setup/apply-harness-secrets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...S,confirmed:!0,fingerprint:p.fingerprint})}),r=await t.json();if(!t.ok){var e;throw Error(null!=(e=r.error)?e:"Apply failed")}k(r.apply),c(r.summary),null==a||a(r.summary),u({linearApiKey:"",cursorApiKey:"",harnessGithubToken:""}),m(null),f(null),v(!1)}catch(e){b(e instanceof Error?e.message:"Apply failed")}finally{y(null)}}},A=j?"Wrote ".concat(j.writtenSecrets.map(e=>e.name).join(", ")||"no secrets","."):null,_=l?"Fix harness repo access in local setup before remote secrets or workflow checks can continue.":void 0,K=null!=_?_:o.githubTokenConfigured?null!==x?"Wait for the current action to finish.":void 0:"Set GITHUB_TOKEN in `.env.local` before previewing remote harness secret writes.",H=_||(N?(null==p?void 0:p.validationError)?"Fix validation errors before confirming this write.":void 0:"Generate a preview before you can confirm this write."),B=null!=H?H:g?void 0:"Confirm the preview before applying harness repo Actions secrets.";return(0,s.jsxs)("div",{className:C.section,children:[(0,s.jsx)(W,{title:"Remote setup",description:"Preview and apply harness repo Actions secrets and target workflow install PRs. Each action requires its own preview and confirmation.",children:(0,s.jsxs)("dl",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 text-sm",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-muted-foreground",children:"GITHUB_TOKEN in .env.local"}),(0,s.jsx)("dd",{children:(0,s.jsx)(L,{label:o.githubTokenConfigured?"Configured":"Missing",variant:o.githubTokenConfigured?"success":"warning"})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-muted-foreground",children:"Harness dispatch repo"}),(0,s.jsx)("dd",{className:"font-medium break-all",children:o.harnessDispatchRepo})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-muted-foreground",children:"Dispatch repo source"}),(0,s.jsx)("dd",{className:"font-medium",children:o.harnessDispatchRepoSource})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-muted-foreground",children:"Harness repo access"}),(0,s.jsx)("dd",{children:(0,s.jsx)(L,{label:o.harnessRepoAccess,variant:"available"===(t=o.harnessRepoAccess)?"success":"denied"===t?"destructive":"secondary"})})]})]})}),l?(0,s.jsxs)(W,{title:"Blocked until repo access is fixed",description:"Remote setup details stay hidden until the harness dispatch repo is corrected.",children:[(0,s.jsxs)("p",{className:"text-sm text-muted-foreground",children:[_," Use the local setup fix above, then refresh this page after applying."]}),(0,s.jsx)("div",{className:E.actions,children:(0,s.jsx)(O.$,{type:"button",onClick:R,disabled:null!==x,children:"refresh"===x?"Refreshing…":"Refresh remote setup"})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(W,{title:"Harness repo Actions secrets",description:"Write encrypted secrets to the harness dispatch repo. HARNESS_CONFIG_JSON_B64 is generated server-side.",children:[(0,s.jsx)(eL,{values:d,secretStatuses:o.harnessSecretStatuses,onChange:e=>{P(),m(null),f(null),v(!1),u(e)}}),(0,s.jsx)(eV,{harnessSecretPreview:N&&null!=p?p:void 0}),(0,s.jsx)(eY,{scope:"remote-secret-write",confirmed:g,disabled:!N||!!(null==p?void 0:p.validationError),disabledReason:H,onConfirmedChange:v}),(0,s.jsxs)("div",{className:E.actions,children:[(0,s.jsx)(O.$,{type:"button",onClick:I,disabled:null!==x||!o.githubTokenConfigured||!!_,children:"preview"===x?"Generating preview…":"Preview harness secrets"}),(0,s.jsx)(O.$,{type:"button",onClick:T,disabled:null!==x||!N||!g||!!(null==p?void 0:p.validationError),children:"apply"===x?"Applying…":"Apply harness secrets"})]}),K?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:K}):null,B?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:B}):null,w?(0,s.jsx)(eT,{success:!1,message:w}):null,A?(0,s.jsx)(eT,{success:!0,message:A}):null]}),(0,s.jsx)(W,{title:"Target workflow install PRs",description:"One install PR card per configured target repo. Never writes directly to production branches.",children:0===o.targetRepos.length?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Resolve `.harness/config.local.json` to show target workflow cards."}):(0,s.jsx)("div",{className:C.stackSm,children:o.targetRepos.map(e=>(0,s.jsx)(eM,{repo:e,onApplied:R,blockedByUpstream:l},e.repoConfigId))})})]})]})}var ez=r(2316),eW=r(2835),eJ=r(6970),eq=r(844);function eZ(e){let{items:t,className:r}=e;return(0,s.jsx)("ul",{className:(0,B.cn)(C.list,r),children:t.map(e=>{let t=function(e){switch(e){case"complete":return ez.A;case"blocked":return eW.A;default:return eJ.A}}(e.status);return(0,s.jsxs)("li",{className:"flex items-start gap-3 rounded-md border border-border bg-muted/30 p-3",children:[(0,s.jsx)(t,{className:(0,B.cn)("mt-0.5 size-4 shrink-0",function(e){switch(e){case"complete":return"text-emerald-600";case"blocked":return"text-destructive";default:return"text-muted-foreground"}}(e.status))}),(0,s.jsxs)("div",{className:C.stackSm,children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:e.label}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:e.detail})]})]},e.id)})})}function eQ(e){let{checks:t,className:r}=e;return(0,s.jsx)("ul",{className:(0,B.cn)(C.list,r),children:t.map(e=>{let t=e.skipped?eJ.A:e.ok?ez.A:eW.A,r=e.skipped?"text-muted-foreground":e.ok?"text-emerald-600":"text-destructive";return(0,s.jsxs)("li",{className:"flex items-start gap-3",children:[(0,s.jsx)(t,{className:(0,B.cn)("mt-0.5 size-4 shrink-0",r)}),(0,s.jsxs)("div",{className:C.stackSm,children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:e.label}),e.detail?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:e.detail}):null]})]},e.label)})})}function eX(e){let{checks:t,className:r}=e;return(0,s.jsx)("ul",{className:(0,B.cn)(C.list,r),children:t.map(e=>{let t=function(e){switch(e){case"passed":return ez.A;case"failed":return eW.A;case"checking":return eq.A;default:return eJ.A}}(e.status);return(0,s.jsxs)("li",{className:"flex items-start gap-3 rounded-md border border-border bg-muted/30 p-3",children:[(0,s.jsx)(t,{className:(0,B.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,s.jsxs)("div",{className:(0,B.cn)(C.stackSm,"min-w-0 flex-1"),children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:e.label}),(0,s.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,s.jsx)("p",{className:"text-sm text-muted-foreground",children:e.detail}):null,"failed"===e.status&&e.action?(0,s.jsx)("p",{className:"text-sm text-foreground",children:e.action}):null]})]},e.id)})})}function e0(e){var t;let{summary:r,checklistItems:n}=e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(W,{title:"Overview",description:"Current harness setup state and active config source.",children:(0,s.jsxs)("dl",{className:R.twoColumnGrid,children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-muted-foreground",children:"Config source"}),(0,s.jsx)("dd",{className:"text-sm font-medium",children:r.configSource.kind})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-muted-foreground",children:"Source label"}),(0,s.jsx)("dd",{className:"text-sm font-medium break-all",children:r.configSource.label})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-muted-foreground",children:"Local files present"}),(0,s.jsx)("dd",{className:"text-sm font-medium",children:r.overview.localFilesPresent?"Yes":"No"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-muted-foreground",children:"Ready for CLI doctor"}),(0,s.jsx)("dd",{className:"text-sm font-medium",children:r.overview.readyForLocalDoctor?"Yes":"No"})]})]})}),(0,s.jsx)(W,{title:"Local files",description:"Gitignored operator files used for local harness setup.",children:(0,s.jsx)("ul",{className:C.list,children:r.localFiles.map(e=>(0,s.jsxs)("li",{className:"flex items-center justify-between gap-4 rounded-md border border-border p-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:e.label}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground break-all",children:e.path})]}),(0,s.jsx)(L,{label:e.exists?"Present":"Missing",variant:e.exists?"success":"warning"})]},e.path))})}),r.configSummary?(0,s.jsxs)(W,{title:"Config summary",description:"Parsed harness config metadata without secret values.",children:[(0,s.jsxs)("dl",{className:R.twoColumnGrid,children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-muted-foreground",children:"Repo count"}),(0,s.jsx)("dd",{className:"text-sm font-medium",children:r.configSummary.repoCount})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-muted-foreground",children:"Linear team key"}),(0,s.jsx)("dd",{className:"text-sm font-medium",children:null!=(t=r.configSummary.linearTeamKey)?t:"Not set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-muted-foreground",children:"Model"}),(0,s.jsx)("dd",{className:"text-sm font-medium",children:r.configSummary.model.resolvedModelId})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-muted-foreground",children:"Model source"}),(0,s.jsx)("dd",{className:"text-sm font-medium",children:r.configSummary.model.source})]})]}),(0,s.jsx)(Z,{}),(0,s.jsx)("ul",{className:C.list,children:r.configSummary.repos.map(e=>(0,s.jsxs)("li",{className:"rounded-md border border-border bg-muted/20 p-3",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:e.id}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:e.targetRepo}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:[e.baseBranch," → ",e.productionBranch,e.previewProvider?" \xb7 ".concat(e.previewProvider):""]})]},e.id))})]}):null,(0,s.jsx)(W,{title:"Environment key presence",description:"Whether required keys are set in .env.local. Values are never displayed.",children:(0,s.jsx)("dl",{className:R.twoColumnGrid,children:Object.entries(r.envKeyPresence).map(e=>{let[t,r]=e;return(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-sm text-muted-foreground",children:t}),(0,s.jsx)("dd",{children:(0,s.jsx)(L,{label:r?"Set":"Missing",variant:r?"success":"warning"})})]},t)})})}),(0,s.jsxs)(W,{title:"Reference previews",description:"Read-only dry-run previews from setup core.",children:[(0,s.jsx)(eN,{title:".env.local reference preview",content:r.generatedPreviews.envLocal}),(0,s.jsx)(eN,{title:".harness/config.local.json reference preview",content:r.generatedPreviews.configLocal})]}),(0,s.jsx)(W,{title:"Setup checklist",description:"Recommended next actions before a future first harness run.",children:(0,s.jsx)(eZ,{items:n})}),(0,s.jsx)(W,{title:"Doctor summary",description:r.doctor.remoteChecksNote,children:(0,s.jsx)(eQ,{checks:r.doctor.checks})}),(0,s.jsx)(W,{title:"Manual instructions",description:"Copy-paste setup guidance for local and remote setup.",children:r.instructionPreviews.map(e=>{var t;return(0,s.jsxs)("div",{className:C.stackSm,children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:e.reason}),(0,s.jsx)("ul",{className:"list-disc space-y-2 pl-5 text-sm text-muted-foreground",children:null==(t=e.manualInstructions)?void 0:t.map(e=>(0,s.jsx)("li",{children:e},e))})]},e.actionId)})})]})}function e1(e){let{title:t,children:r}=e;return(0,s.jsxs)("section",{className:N.sectionStack,children:[(0,s.jsx)("h3",{className:"text-base font-semibold",children:t}),r]})}function e2(e){let{summary:t,remoteSummary:r,readiness:n,formDefaults:a,onSummaryUpdated:i,onRemoteSummaryUpdated:l,onLocalUiStateChange:o,onRemoteUiStateChange:c}=e;return(0,s.jsxs)("div",{className:N.sectionStack,children:[(0,s.jsx)(e1,{title:"Phase 1 \xb7 Local setup",children:(0,s.jsx)(eB,{mode:"advanced",initialEnv:a.env,initialConfig:a.config,onSummaryUpdated:i,onUiStateChange:o})}),(0,s.jsx)(e1,{title:"Phase 2 \xb7 Local readiness",children:(0,s.jsx)(W,{title:"Doctor summary",description:t.doctor.remoteChecksNote,children:(0,s.jsx)(eQ,{checks:t.doctor.checks})})}),(0,s.jsx)(e1,{title:"Phase 3 \xb7 Remote setup",children:(0,s.jsx)(e$,{initialSummary:r,onSummaryUpdated:l,onUiStateChange:c,blockedByUpstream:n.remoteSetupBlockedByUpstream})}),(0,s.jsx)(e1,{title:"Phase 4 \xb7 Ready for first run",children:(0,s.jsx)(W,{title:"Final readiness",description:"Confirms setup readiness without triggering a live harness run.",children:(0,s.jsxs)("div",{className:C.stackSm,children:[(0,s.jsx)(L,{label:n.readyForFirstRun?"Ready for first run":"Blocked for first run",variant:n.readyForFirstRun?"success":"warning"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:n.prohibitedActionsNote})]})})}),(0,s.jsx)(e1,{title:"Diagnostics and reference",children:(0,s.jsx)(e0,{summary:t,checklistItems:n.steps.map(e=>{var t,r;return{id:e.id,label:e.label,detail:null!=(r=null==(t=e.blockers[0])?void 0:t.action)?r:e.summary,status:"complete"===e.status?"complete":"blocked"===e.status?"blocked":"pending"}})})})]})}let e4="w-full rounded-md border border-input bg-background px-3 py-2 text-sm";function e3(e){var t,r,a,i,l,o,c,d,u,p,m,h,f,g,v,x;let{readiness:y,initialSummary:w,linearApiKeyConfigured:b,onSummaryUpdated:j,onUiStateChange:k,onContinue:S}=e,[N,R]=(0,n.useState)(w),[P,I]=(0,n.useState)("existing"),[T,A]=(0,n.useState)(null!=(h=null==(r=N.controlPlane)||null==(t=r.linear)?void 0:t.teamId)?h:""),[_,K]=(0,n.useState)(null!=(f=null==(i=N.controlPlane)||null==(a=i.linear)?void 0:a.teamKey)?f:""),[H,B]=(0,n.useState)(null!=(g=null==(o=N.controlPlane)||null==(l=o.linear)?void 0:l.teamName)?g:""),[G,F]=(0,n.useState)("existing"),[U,V]=(0,n.useState)(null!=(v=null==(d=N.controlPlane)||null==(c=d.linear)?void 0:c.projectId)?v:""),[D,Y]=(0,n.useState)(null!=(x=null==(p=N.controlPlane)||null==(u=p.linear)?void 0:u.projectName)?x:""),[M,$]=(0,n.useState)([]),[z,J]=(0,n.useState)([]),[q,Z]=(0,n.useState)(!1),[ee,et]=(0,n.useState)(null),[er,es]=(0,n.useState)(null),[en,ea]=(0,n.useState)(!1),[ei,el]=(0,n.useState)(!1),[eo,ec]=(0,n.useState)(null),[ed,eu]=(0,n.useState)(null),[ep,em]=(0,n.useState)(null),[eh,ef]=(0,n.useState)(null),[eg,ev]=(0,n.useState)(!1);(0,n.useEffect)(()=>{R(w)},[w]);let ex=null!==er&&en;(0,n.useEffect)(()=>{null==k||k({linearPreviewStale:null!==er&&!ex})},[k,er,ex]);let ey=null!=b?b:N.linearApiKeyConfigured,ew=(0,n.useCallback)(()=>{ev(!1),ef(null)},[]),eb=(0,n.useCallback)(()=>{es(null),ea(!1),ew()},[ew]),ej=(0,n.useCallback)(async()=>{if(ey){Z(!0),et(null);try{var e,t,r;let s=await fetch("/api/setup/linear-options"),n=await s.json();if(!s.ok)throw Error(null!=(e=n.error)?e:"Failed to load Linear teams and projects");$(null!=(t=n.teams)?t:[]),J(null!=(r=n.projects)?r:[])}catch(e){$([]),J([]),et(e instanceof Error?e.message:"Failed to load Linear teams and projects")}finally{Z(!1)}}},[ey]);(0,n.useEffect)(()=>{ej()},[ej]);let ek=(0,n.useMemo)(()=>{if(!T)return z;let e=z.filter(e=>0===e.teamIds.length||e.teamIds.includes(T));return e.length>0?e:z},[z,T]),eS=(0,n.useCallback)(async()=>{ec("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")}R(r),null==j||j(r)}catch(e){eu(e instanceof Error?e.message:"Linear summary refresh failed")}finally{ec(null)}},[j]),eN=(0,n.useCallback)(()=>({team:{mode:P,teamId:"existing"===P?T:void 0,teamKey:"create"===P?_:void 0,teamName:"create"===P?H:void 0},project:{mode:G,projectId:"existing"===G?U:void 0,projectName:"create"===G?D:void 0}}),[U,G,D,T,_,P,H]),eC=(0,n.useCallback)(async()=>{let e=await fetch("/api/setup/preview-linear-setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(eN())}),t=await e.json();if(!e.ok){var r;throw Error(null!=(r=t.error)?r:"Preview failed")}return es(t),ea(!0),t},[eN]),eR=(0,n.useCallback)(async()=>{ec("preview"),eu(null),em(null),ew(),el(!1);try{await eC()}catch(e){es(null),ea(!1),em(e instanceof Error?e.message:"Preview failed")}finally{ec(null)}},[ew,eC]),eE=async()=>{if(ei){ec("apply"),eu(null),ew();try{let t=ex&&er?er:await eC();if(t.validationError)throw Error(t.validationError);let r=await fetch("/api/setup/apply-linear-setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plan:eN(),confirmed:!0,fingerprint:t.fingerprint})}),s=await r.json();if(!r.ok){var e;throw Error(null!=(e=s.error)?e:"Apply failed")}let n=s.apply;if(!n.verified)throw Error("Linear workspace apply finished, but post-apply verification did not pass.");ef(n),R(s.summary),null==j||j(s.summary),ev(!0),es(null),ea(!1),el(!1),ej()}catch(e){eu(e instanceof Error?e.message:"Apply failed")}finally{ec(null)}}},eP=eg||(null==(m=y.steps.find(e=>"linear-workspace"===e.id))?void 0:m.status)==="complete"||N.workspace.configured,eI="existing"===P?!!T&&("existing"===G?!!U:!!D):!!(_&&H)&&("existing"===G?!!U:!!D);return(0,s.jsx)(W,{title:"Step 2 of ".concat(7," \xb7 Set up Linear workspace"),description:"Choose or create the Linear team and project, then ensure issue workflow statuses exist for the team.",children:(0,s.jsx)("div",{className:C.stackSm,children:ey?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(X,{htmlFor:"linear-team-mode",children:"Team"}),(0,s.jsxs)("select",{id:"linear-team-mode",className:e4,value:P,onChange:e=>{I(e.target.value),eb()},children:[(0,s.jsx)("option",{value:"existing",children:"Use existing team"}),(0,s.jsx)("option",{value:"create",children:"Create new team"})]}),"existing"===P?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("select",{className:e4,value:T,onChange:e=>{A(e.target.value),V(""),eb()},disabled:q,children:[(0,s.jsx)("option",{value:"",children:"Select a team…"}),M.map(e=>(0,s.jsxs)("option",{value:e.id,children:[e.name," (",e.key,")"]},e.id))]}),q?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading Linear teams…"}):null,q||0!==M.length?null:(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"No Linear teams found for this API key."})]}):(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(Q,{placeholder:"Team name",value:H,onChange:e=>{B(e.target.value),eb()}}),(0,s.jsx)(Q,{placeholder:"Team key (e.g. ENG)",value:_,onChange:e=>{K(e.target.value),eb()}})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(X,{htmlFor:"linear-project-mode",children:"Project"}),(0,s.jsxs)("select",{id:"linear-project-mode",className:e4,value:G,onChange:e=>{F(e.target.value),eb()},children:[(0,s.jsx)("option",{value:"existing",children:"Use existing project"}),(0,s.jsx)("option",{value:"create",children:"Create new project"})]}),"existing"===G?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("select",{className:e4,value:U,onChange:e=>{V(e.target.value),eb()},disabled:q,children:[(0,s.jsx)("option",{value:"",children:"Select a project…"}),ek.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name},e.id))]}),q?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading Linear projects…"}):null,q||0!==ek.length?null:(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"No Linear projects found for this API key."}),!q&&ek.length>0&&T&&z.some(e=>e.teamIds.length>0)&&ek.length===z.length?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Showing all workspace projects because team association could not be narrowed further."}):null]}):(0,s.jsx)(Q,{placeholder:"Project name",value:D,onChange:e=>{Y(e.target.value),eb()}})]})]}),ee?(0,s.jsx)("p",{className:"text-sm text-destructive",children:ee}):null,(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[N.workspace.configured?(0,s.jsx)(L,{label:"Team ".concat(N.workspace.teamKey," configured"),variant:"success"}):null,(0,s.jsx)(O.$,{type:"button",variant:"outline",size:"sm",onClick:()=>void eR(),disabled:null!==eo,children:"preview"===eo?"Previewing…":"Preview Linear setup"}),(0,s.jsx)(O.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>void eS(),disabled:null!==eo,children:"Refresh"})]}),ex&&er?(0,s.jsxs)("div",{className:"rounded-md border border-border bg-muted/10 p-3 text-sm space-y-2",children:[(0,s.jsxs)("p",{children:["Missing creatable statuses:"," ",er.missingStatuses.length>0?er.missingStatuses.join(", "):"none"]}),(0,s.jsxs)("p",{children:["Dispatch triggers: ",er.dispatchTriggerStatuses.join(", ")]}),er.manualSteps.length>0?(0,s.jsx)("ul",{className:"list-disc pl-5 text-muted-foreground",children:er.manualSteps.map(e=>(0,s.jsx)("li",{children:e},e))}):null,ep?(0,s.jsx)("p",{className:"text-destructive",children:ep}):null]}):null,(0,s.jsx)(eY,{scope:"linear-write",variant:"guided",confirmed:ei,disabled:null!==eo||!eI,disabledReason:eI?void 0:"Select or enter the Linear team and project before confirming.",onConfirmedChange:el}),eg?null:(0,s.jsx)("div",{className:E.actions,children:(0,s.jsx)(O.$,{type:"button",onClick:()=>void eE(),disabled:null!==eo||!ei||!eI||!!(null==er?void 0:er.validationError),children:"apply"===eo?"Applying…":"Apply Linear workspace setup"})}),ed?(0,s.jsx)(eT,{success:!1,message:ed}):null,eg&&eh?(0,s.jsx)(eT,{success:!0,message:"Linear workspace verified. Created: ".concat(eh.created.join(", ")||"none",". Reused: ").concat(eh.skipped.join(", ")||"none",".")}):null,eP?(0,s.jsx)(O.$,{type:"button",onClick:S,children:"Continue to Vercel bridge"}):null]}):(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Add your Linear API key in Step 1 before configuring the Linear workspace."})})})}async function e6(e,t){let r=await e.text();if(!r.trim())throw Error("Setup request failed: ".concat(t," returned HTTP ").concat(e.status," with an empty response body"));try{return JSON.parse(r)}catch(r){throw Error("Setup request failed: ".concat(t," returned HTTP ").concat(e.status," with an invalid JSON body"))}}let e5="Vercel production redeploy is in progress. Wait for verification to finish before changing settings.",e8="w-full rounded-md border border-input bg-background px-3 py-2 text-sm";function e7(e){var t,r,a,i,l,o,c,d,u,p,m,h,f,g,v;let{readiness:x,initialSummary:y,onSummaryUpdated:w,onUiStateChange:b,onContinue:j}=e,[k,S]=(0,n.useState)(y),[N,R]=(0,n.useState)([]),[P,I]=(0,n.useState)([]),[T,A]=(0,n.useState)({teamCreate:!0,projectCreate:!0}),[_,K]=(0,n.useState)("existing"),[H,B]=(0,n.useState)(null!=(u=null==(r=k.controlPlane)||null==(t=r.vercel)?void 0:t.teamId)?u:""),[G,F]=(0,n.useState)(""),[L,U]=(0,n.useState)(""),[V,D]=(0,n.useState)("existing"),[Y,M]=(0,n.useState)(null!=(p=null==(i=k.controlPlane)||null==(a=i.vercel)?void 0:a.projectId)?p:""),[$,z]=(0,n.useState)(""),[J,q]=(0,n.useState)(null!=(m=k.linearTeamKey)?m:""),[Z,ee]=(0,n.useState)(!1),[et,er]=(0,n.useState)(""),[es,en]=(0,n.useState)(null),[ea,ei]=(0,n.useState)(!1),[el,eo]=(0,n.useState)(null),[ec,ed]=(0,n.useState)(!1),[eu,ep]=(0,n.useState)(!1),[em,eh]=(0,n.useState)(null),[ef,eg]=(0,n.useState)(null),[ev,ex]=(0,n.useState)(null),[ey,ew]=(0,n.useState)(null),[eb,ej]=(0,n.useState)(null),[ek,eS]=(0,n.useState)(!1),[eN,eC]=(0,n.useState)(!1),[eR,eE]=(0,n.useState)(null),[eP,eI]=(0,n.useState)(!1),eA=(v={setupPending:ek,pollActionId:eb}).setupPending||!!v.pollActionId,e_=eA||null!==em;(0,n.useEffect)(()=>{S(y),y.linearTeamKey&&q(y.linearTeamKey)},[y]);let eK=null!==el&&ec;(0,n.useEffect)(()=>{null==b||b({vercelPreviewStale:null!==el&&!eK})},[b,el,eK]);let eO=(0,n.useCallback)(async e=>{ei(!0),en(null);try{var t,r,s,n,a;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");R(null!=(s=o.scopes)?s:[]),I(null!=(n=o.projects)?n:[]),A(null!=(a=o.capabilities)?a:{teamCreate:!0,projectCreate:!0}),o.harnessTeamKey&&q(o.harnessTeamKey),ee(!o.githubDispatch.eligible),void 0===e&&void 0!==o.selectedScopeId&&B(o.selectedScopeId),M(e=>{var t;return o.projects.some(t=>t.id===e)?e:null!=(t=o.selectedProjectId)?t:""}),o.loadError&&en(o.loadError)}catch(e){en(e instanceof Error?e.message:"Failed to load Vercel settings options")}finally{ei(!1)}},[]);(0,n.useEffect)(()=>{k.vercelTokenConfigured&&eO()},[eO,k.vercelTokenConfigured]);let eH=(0,n.useCallback)(async()=>{eh("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")}S(r),null==w||w(r)}catch(e){eg(e instanceof Error?e.message:"Vercel summary refresh failed")}finally{eh(null)}},[w]),eB=(0,n.useCallback)(e=>{eA&&(null==e?void 0:e.force)!==!0||(eo(null),ed(!1),eC(!1),ew(null),ej(null),eS(!1),eE(null),eI(!1))},[eA]),eG=(0,n.useCallback)(()=>{var e,t;return{team:{mode:_,teamId:"existing"===_?H:void 0,teamName:"create"===_&&G||void 0,teamSlug:"create"===_&&L||void 0},project:{mode:V,projectId:"existing"===V&&Y||void 0,projectName:"create"===V&&$||void 0},teamId:"existing"===_&&H||void 0,projectId:"existing"===V&&Y||void 0,projectName:"create"===V&&$||void 0,linearTeamId:null==(t=k.controlPlane)||null==(e=t.linear)?void 0:e.teamId,envInput:{GITHUB_DISPATCH_TOKEN:Z&&et||void 0,HARNESS_TEAM_KEY:J||void 0}}},[et,J,Y,V,$,Z,null==(o=k.controlPlane)||null==(l=o.linear)?void 0:l.teamId,H,_,G,L]),eF=(0,n.useCallback)(async(e,t)=>{var r,s,n;if(ew(e),"deployment-required"===e.status){eg(null!=(s=null==(r=e.deploymentRequired)?void 0:r.message)?s:"Deployment required before applying settings."),eC(!1),eS(!1),ej(null),eO("existing"===_?H:void 0),eo(null),ed(!1),ep(!1);return}S(t),null==w||w(t),eC(e.verified),eS(!!e.setupPending),ej(null!=(n=e.pollActionId)?n:null),e.linearWebhookSetup.manualCopySecret?(eE(e.linearWebhookSetup.manualCopySecret),eI(!1)):eE(null),eo(null),ed(!1),ep(!1),eO("existing"===_?H:void 0)},[eO,w,H,_]),eL=(0,n.useCallback)(async()=>{if(eb){eh("poll"),eg(null);try{var e;let t=await fetch("/api/setup/vercel-bridge-redeploy-status",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({actionId:eb})}),r=await e6(t,"POST /api/setup/vercel-bridge-redeploy-status");if(!t.ok)throw Error(null!=(e=r.error)?e:"Redeploy status check failed");let s=r.apply;await eF(s,r.summary),(s.verified&&s.signedProbeVerified||!s.setupPending&&(s.setupBlocked||"failed"===s.productionRedeployStatus||"timeout"===s.productionRedeployStatus||"no_source_deployment"===s.productionRedeployStatus))&&(eS(!1),ej(null))}catch(e){eg(e instanceof Error?e.message:"Redeploy status check failed"),eS(!1)}finally{eh(null)}}},[eF,eb]);(0,n.useEffect)(()=>{if(!ek||!eb)return;let e=window.setInterval(()=>{eL()},5e3);return eL(),()=>{window.clearInterval(e)}},[eb,eL,ek]);let eU=(0,n.useCallback)(async()=>{let e=await fetch("/api/setup/preview-vercel-bridge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(eG())}),t=await e.json();if(!e.ok){var r;throw Error(null!=(r=t.error)?r:"Preview failed")}return eo(t),ed(!0),t},[eG]),eV=(0,n.useCallback)(async()=>{if(!eA){eh("preview"),eg(null),ex(null),eB(),ep(!1);try{await eU()}catch(e){eo(null),ed(!1),ex(e instanceof Error?e.message:"Preview failed")}finally{eh(null)}}},[eB,eA,eU]),eD=async e=>{if((!eA||(null==e?void 0:e.verifyOnly))&&(eu||(null==e?void 0:e.verifyOnly))){eh("apply"),eg(null),(null==e?void 0:e.verifyOnly)||eB();try{let r=eK&&el?el:await eU();if(r.validationError)throw Error(r.validationError);let s=await fetch("/api/setup/apply-vercel-bridge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plan:eG(),confirmed:!0,fingerprint:r.fingerprint,verifyOnly:(null==e?void 0:e.verifyOnly)===!0})}),n=await e6(s,"POST /api/setup/apply-vercel-bridge");if(!s.ok){var t;throw Error(null!=(t=n.error)?t:"Apply failed")}await eF(n.apply,n.summary)}catch(e){eg(e instanceof Error?e.message:"Apply failed")}finally{eh(null)}}},eM="existing"===_?!!J&&("existing"===V?!!Y:!!$):!!(L&&J)&&("existing"===V?!!Y:!!$),e$=eN&&(null==ey?void 0:ey.signedProbeVerified)===!0||k.readiness.ready;return(0,s.jsx)(W,{title:"Step 3 of ".concat(7," \xb7 Configure Vercel settings"),description:"Choose the Vercel team and project this setup should use for automation and preview checks. Env var presence alone is not enough; the bridge must pass signed delivery verification against production.",children:(0,s.jsx)("div",{className:C.stackSm,children:k.vercelTokenConfigured?(0,s.jsxs)(s.Fragment,{children:[eA?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:e5}):null,(0,s.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(X,{htmlFor:"vercel-team-mode",children:"Vercel team name"}),T.teamCreate?(0,s.jsxs)("select",{id:"vercel-team-mode",className:e8,value:_,onChange:e=>{eA||(K(e.target.value),eB())},disabled:e_,children:[(0,s.jsx)("option",{value:"existing",children:"Use existing team"}),(0,s.jsx)("option",{value:"create",children:"Create new team"})]}):null,"existing"===_?(0,s.jsx)("select",{id:"vercel-team-name",className:e8,value:H,onChange:e=>{eA||(B(e.target.value),M(""),eB(),eO(e.target.value))},disabled:e_||ea,children:N.map(e=>(0,s.jsx)("option",{value:e.id,children:e.label},e.id||"personal"))}):(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(Q,{placeholder:"Team name",value:G,onChange:e=>{eA||(F(e.target.value),eB())},disabled:e_}),(0,s.jsx)(Q,{placeholder:"Team slug",value:L,onChange:e=>{eA||(U(e.target.value),eB())},disabled:e_})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(X,{htmlFor:"vercel-project-mode",children:"Vercel project"}),T.projectCreate?(0,s.jsxs)("select",{id:"vercel-project-mode",className:e8,value:V,onChange:e=>{eA||(D(e.target.value),eB())},disabled:e_,children:[(0,s.jsx)("option",{value:"existing",children:"Use existing project"}),(0,s.jsx)("option",{value:"create",children:"Create new project"})]}):null,"existing"===V?(0,s.jsxs)("select",{id:"vercel-project-id",className:e8,value:Y,onChange:e=>{eA||(M(e.target.value),eB())},disabled:e_||ea||0===P.length,children:[(0,s.jsx)("option",{value:"",children:"Select a project…"}),P.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name},e.id))]}):(0,s.jsx)(Q,{placeholder:"Project name",value:$,onChange:e=>{eA||(z(e.target.value),eB())},disabled:e_})]})]}),ea?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading Vercel teams and projects…"}):null,es?(0,s.jsx)("p",{className:"text-sm text-destructive",children:es}):null,Z?(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(X,{htmlFor:"github-dispatch-token",children:"GITHUB_DISPATCH_TOKEN override"}),(0,s.jsx)(Q,{id:"github-dispatch-token",type:"password",value:et,onChange:e=>{eA||(er(e.target.value),eB())},disabled:e_})]}):null,(0,s.jsxs)("div",{className:E.actions,children:[(0,s.jsx)(O.$,{type:"button",variant:"outline",onClick:()=>void eV(),disabled:e_||!eM,children:"preview"===em?"Previewing…":"Preview Vercel settings"}),(0,s.jsx)(O.$,{type:"button",variant:"ghost",onClick:()=>void eH(),disabled:e_,children:"Refresh"})]}),eK&&el?(0,s.jsxs)("div",{className:"rounded-md border border-border bg-muted/10 p-3 text-sm space-y-2",children:[(0,s.jsxs)("p",{children:["Webhook URL: ",null!=(h=el.webhookUrl)?h:"unknown"]}),(0,s.jsxs)("p",{children:["Endpoint reachable:"," ",el.endpointReachable?"yes":"no"]}),(0,s.jsxs)("p",{children:["GitHub dispatch source: ",null!=(f=el.githubDispatchSource)?f:"unknown"]}),(0,s.jsxs)("p",{children:["Linear webhook secret mode:"," ",null!=(g=el.linearWebhookSecretMode)?g:"unknown"]}),(0,s.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,s.jsxs)("p",{children:["Signed probe verified:"," ",el.signedProbeVerified?"yes":"no (runs on apply)"]}),"ready"!==el.deploymentStatus?(0,s.jsxs)("p",{className:"text-amber-700 dark:text-amber-400",children:["Deployment status: ",el.deploymentStatus]}):null,el.manualSteps.length>0?(0,s.jsx)("ul",{className:"list-disc pl-5 text-muted-foreground",children:el.manualSteps.map(e=>(0,s.jsx)("li",{children:e},e))}):null,ev?(0,s.jsx)("p",{className:"text-destructive",children:ev}):null]}):null,(0,s.jsx)(eY,{scope:"vercel-bridge-write",variant:"guided",confirmed:eu,disabled:e_||!eM,disabledReason:eA?e5:eM?"create"===_?"This will create provider resources in Vercel when you apply.":void 0:"Select or enter the Vercel team and project before confirming.",onConfirmedChange:e=>{eA||ep(e)}}),eN?null:(0,s.jsxs)("div",{className:E.actions,children:[(0,s.jsx)(O.$,{type:"button",onClick:()=>void eD(),disabled:e_||!eu||!eM||!!(null==el?void 0:el.validationError),children:"apply"===em?"Applying Vercel settings…":"poll"===em?"Waiting for production redeploy…":"Apply Vercel Settings"}),eA||!ey||ey.setupPending||ey.verified&&ey.signedProbeVerified||!ey.setupBlocked&&(!ey.deploymentRedeployRequired||ey.signedProbeVerified)&&(!ey.productionRedeployTriggered||"ready"!==ey.productionRedeployStatus||ey.signedProbeVerified)?null:(0,s.jsx)(O.$,{type:"button",variant:"outline",onClick:()=>void eD({verifyOnly:!0}),disabled:null!==em||!eM,children:"apply"===em?"Verifying…":"Retry verification"})]}),(null==ey||null==(c=ey.orchestrationSteps)?void 0:c.length)||ek?(0,s.jsxs)("ul",{className:"list-disc pl-5 text-sm text-muted-foreground",children:[null==ey||null==(d=ey.orchestrationSteps)?void 0:d.map(e=>(0,s.jsxs)("li",{children:[e.message,"failed"===e.status?" (failed)":""]},"".concat(e.phase,"-").concat(e.status))),ek?(0,s.jsx)("li",{children:"poll"===em?"Checking Vercel deployment status…":"Waiting for Vercel deployment READY…"}):null]}):null,ef?(0,s.jsx)(eT,{success:!1,message:ef}):null,ey?(0,s.jsx)(eT,{success:ey.verified,message:function(e){var t,r,s,n,a,i,l,o,c,d,u,p,m;if("deployment-required"===e.status)return"".concat(null!=(l=null==(a=e.deploymentRequired)?void 0:a.message)?l:"Deployment required."," ").concat(null!=(o=null==(i=e.deploymentRequired)?void 0:i.nextSteps.join(" "))?o:"");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==(s=e.project)?void 0:s.outcome)?u:"unchanged"," ").concat(null!=(p=null==(n=e.project)?void 0:n.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",".")),e.setupBlocked?(h.push(e.setupBlocked.message),e.setupBlocked.nextSteps.length>0&&h.push(e.setupBlocked.nextSteps.join(" "))):!e.deploymentRedeployRequired||e.signedProbeVerified||e.productionRedeployTriggered||h.push("Redeploy production in Vercel, then use Retry verification (this will not rotate secrets or rewrite env vars)."),h.join(" ")}(ey)}):null,eR?(0,s.jsxs)("div",{className:"rounded-md border border-amber-500/40 bg-amber-500/5 p-3 text-sm space-y-2",children:[(0,s.jsx)("p",{className:"font-medium",children:"Manual Linear webhook secret (one-time)"}),(0,s.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,s.jsx)(Q,{readOnly:!0,value:eR}),(0,s.jsxs)("label",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"checkbox",checked:eP,onChange:e=>eI(e.target.checked)}),"I copied the webhook secret into Linear."]}),(null==ey?void 0:ey.linearWebhookSetup.manualSteps.length)?(0,s.jsx)("ul",{className:"list-disc pl-5 text-muted-foreground",children:ey.linearWebhookSetup.manualSteps.map(e=>(0,s.jsx)("li",{children:e},e))}):null]}):null,e$?(0,s.jsx)(O.$,{type:"button",onClick:j,children:"Continue to target repo setup"}):null]}):(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Add VERCEL_TOKEN in Step 1 before configuring Vercel settings."})})})}function e9(e){let{readiness:t,onContinue:r}=e,[a,i]=(0,n.useState)([]),[l,o]=(0,n.useState)(!0),[c,d]=(0,n.useState)(null),[u,p]=(0,n.useState)(!1),m=(0,n.useCallback)(async()=>{o(!0),d(null),p(!1),i([]);try{let t=await fetch("/api/setup/local-readiness"),r=await t.json();if(!t.ok){var e;throw Error(null!=(e=r.error)?e:"Local readiness check failed")}let s=r.checks;i(s.map(e=>({id:e.id,label:e.label,status:"checking"}))),await new Promise(e=>setTimeout(e,0)),i(s.map(e=>({id:e.id,label:e.label,status:"passed"===e.status?"passed":"failed",detail:e.detail,action:e.action}))),p(!!r.allPassed)}catch(e){d(e instanceof Error?e.message:"Could not run local readiness checks"),i([])}finally{o(!1)}},[]);(0,n.useEffect)(()=>{m()},[m]);let h=u&&!l&&!t.localReadinessReviewed;return(0,s.jsx)(W,{title:"Step 5 of ".concat(7," \xb7 Check local readiness"),description:"We're checking whether this machine is ready for remote setup.",children:(0,s.jsxs)("div",{className:C.stackSm,children:[l&&0===a.length?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Running local readiness checks…"}):null,c?(0,s.jsxs)("div",{className:C.stackSm,children:[(0,s.jsx)("p",{className:"text-sm text-destructive",children:c}),(0,s.jsx)(O.$,{type:"button",variant:"outline",onClick:()=>void m(),children:"Retry checks"})]}):null,a.length>0?(0,s.jsx)(eX,{checks:a}):null,u&&!l?(0,s.jsx)("p",{className:"text-sm font-medium text-emerald-700",children:"Local readiness passed."}):null,h?(0,s.jsx)(O.$,{type:"button",onClick:r,children:"Continue to cloud secrets"}):null]})})}function te(e){return e.current+=1,e.current}function tt(e,t){return t===e.current}function tr(e){let{open:t,onOpenChange:r,isLoading:n,previewError:a,preview:i,previewIsCurrent:l}=e;return(0,s.jsxs)("details",{open:t,className:"rounded-md border border-border bg-background p-3",children:[(0,s.jsx)("summary",{className:"cursor-pointer text-sm font-medium",onClick:e=>{e.preventDefault(),r(!t)},children:"Review generated secrets (optional)"}),(0,s.jsx)("div",{className:"mt-3 space-y-3",children:n?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Generating redacted cloud secrets preview…"}),(0,s.jsxs)("div",{className:"space-y-2","aria-hidden":"true",children:[(0,s.jsx)(eP,{className:"h-4 w-[60%]"}),(0,s.jsx)(eP,{className:"h-24 w-full"})]})]}):a?(0,s.jsx)("p",{className:"text-sm text-destructive",children:a}):(0,s.jsx)(eV,{harnessSecretPreview:l?i:void 0})})]})}function ts(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 tn(e){let{blocker:t}=e;return(0,s.jsxs)("div",{className:"space-y-2 rounded-md border border-destructive/30 bg-destructive/5 p-4",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:t.message}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:t.action})]})}async function ta(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 ti(e){var t,r,a;let{readiness:l,setupSummary:o,controlPlaneContext:c,remoteSecretPreviewStale:u=!1,cloudSecretsApplyEvidence:p,initialSummary:m,onSummaryUpdated:h,onUiStateChange:f,onContinue:g,blockedByUpstream:b=!1,onGoToHarnessRepo:k,onGoToConnectServices:S}=e,[N,R]=(0,n.useState)(m),[P,I]=(0,n.useState)(null),[T,A]=(0,n.useState)(!1),[_,K]=(0,n.useState)(null),[H,B]=(0,n.useState)(!1),[G,F]=(0,n.useState)(!1),[L,U]=(0,n.useState)(!1),[V,D]=(0,n.useState)(null),[Y,M]=(0,n.useState)(null),[$,z]=(0,n.useState)(null),[J,q]=(0,n.useState)(null),[Z,Q]=(0,n.useState)(!1),[ee,et]=(0,n.useState)(!1),[er,es]=(0,n.useState)(!1),[en,ea]=(0,n.useState)(null),[ei,el]=(0,n.useState)(!1),[eo,ec]=(0,n.useState)(null),[ed,eu]=(0,n.useState)(null),[ep,em]=(0,n.useState)(null),[eh,ef]=(0,n.useState)(null),eg=(0,n.useRef)({current:0}),ev=(0,n.useRef)(!1),ex=(0,n.useMemo)(()=>d({setupSummary:o,controlPlaneContext:c}),[o,c]),ey=(0,n.useCallback)((e,t)=>{var r,s;tt((s=r={tracker:eg.current,revision:t,summary:e,install:e=>{R(e),null==h||h(e)}}).tracker,s.revision)&&r.install(r.summary)},[h]);(0,n.useEffect)(()=>{ey(m,te(eg.current))},[m,ey]),(0,n.useEffect)(()=>()=>{ea(null),el(!1)},[]);let ew=(0,n.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"manual",t=te(eg.current);D("mount"===e?"mount-refresh":"refresh"),"mount"===e?ef(null):M(null);try{let e=await fetch("/api/setup/remote-summary"),s=await e.json();if(!e.ok){var r;throw Error(null!=(r=s.error)?r:"Remote summary refresh failed")}if(!tt(eg.current,t))return null;return ey(s,t),s}catch(s){if(!tt(eg.current,t))return null;let r=s instanceof Error?s.message:"Remote summary refresh failed";return"mount"===e?ef(r):M(r),null}finally{tt(eg.current,t)&&D(null)}},[ey]);(0,n.useEffect)(()=>{ev.current||(ev.current=!0,ew("mount"))},[ew]);let eb=null!==_&&H;(0,n.useEffect)(()=>{null==f||f({remoteSecretPreviewStale:null!==_&&!eb})},[f,_,eb]);let ej=(0,n.useMemo)(()=>N.githubTokenConfigured?N.harnessDispatchRepoResolved?"denied"===N.harnessRepoAccess?{allowed:!1,reason:"Blocked: GitHub denied access to ".concat(N.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"!==N.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"},[N]),ek=b||!ej.allowed,eS=b?"Fix harness repo access in local setup before cloud secrets can be configured.":ej.reason,eN=b?"Return to Step 4 and verify your harness repo, then refresh.":ej.action,eC=N.harnessSecretStatuses.some(e=>"missing"===e.status),eE=(0,n.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:N.harnessDispatchRepo}).steps,[N.harnessDispatchRepo]),eP=(0,n.useCallback)(()=>{K(null),B(!1),z(null),q(null),Q(!1),U(!1),F(!1),M(null)},[]),eI=(0,n.useCallback)(()=>{ea(null),el(!1),ec(null),eu(null),et(!1),em(null)},[]),eA=(0,n.useCallback)(e=>{I(e),"automatic"===e?eI():eP()},[eP,eI]),e_=(0,n.useCallback)(()=>{ea(null),el(!1),ec(null),em(null)},[]),eK=(0,n.useCallback)((e,t)=>{A(!0),null==f||f({remoteSecretPreviewStale:!1}),"automatic"===e?(Q(!0),t&&(null==f||f({remoteSecretPreviewStale:!1,cloudSecretsApplyEvidence:t}))):et(!0)},[f]),eO=(0,n.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 K(t),B(!0),t},[]),eH=(0,n.useCallback)(async()=>{D("preview"),M(null),z(null),q(null),Q(!1),U(!1);try{await eO()}catch(e){K(null),B(!1),z(e instanceof Error?e.message:"Preview failed")}finally{D(null)}},[eO]),eB=(0,n.useCallback)(e=>{ek||(F(e),e&&!eb&&"preview"!==V&&eH())},[eH,V,eb,ek]),eG=async()=>{if(!L||ek||"apply"===V)return;let e=te(eg.current);D("apply"),M(null),Q(!1);try{let r=eb&&_?_:await eO();if(r.validationError)throw Error(r.validationError);let s=await fetch("/api/setup/apply-harness-secrets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({confirmed:!0,fingerprint:r.fingerprint})}),n=await s.json();if(!s.ok){var t;throw Error(null!=(t=n.error)?t:"Apply failed")}if(!tt(eg.current,e))return;let a=n.summary,i=n.apply,l=n.evidence;q(i),ey(a,e),K(null),B(!1),U(!1),F(!1),x(a)?eK("automatic",l):M("Write request completed, but verification failed: ".concat(ts(a),". Refresh or retry."))}catch(t){if(!tt(eg.current,e))return;M(t instanceof Error?t.message:"Apply failed")}finally{tt(eg.current,e)&&D(null)}},eF=async()=>{if(!ek){if(!er)return void ec("Confirm the sensitivity warning before generating manual copy values.");D("manual-values"),ec(null),em(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")}ea(r),el(!1),r.missing.length>0&&ec("Some values are unavailable locally: ".concat(r.missing.join(", ")))}catch(e){e_(),ec(e instanceof Error?e.message:"Manual value generation failed")}finally{D(null)}}},eL=async()=>{if(!ek){D("manual-verify"),eu(null),et(!1);try{let e=await ew("manual");if(!e)return;x(e)?(eK("manual"),eu(ts(e)),e_()):eu(ts(e))}finally{D(null)}}},eU=async(e,t)=>{if(!t)return void em("".concat(e," is not available to copy."));try{await ta(t),em("Copied ".concat(e," to clipboard."))}catch(t){em(t instanceof Error?t.message:"Could not copy ".concat(e,"."))}},eV=(0,n.useMemo)(()=>(function(e){var t,r,s,n;let a=x(e.summary),i=null!=(s=e.previewStaleCleared)&&s,l={...e.uiState,remoteSecretPreviewStale:!i&&(null==(t=e.uiState)?void 0:t.remoteSecretPreviewStale)},o=j({blockers:v(e.setupSummary,e.summary,l,e.staleSmokeDiagnostics,e.controlPlaneContext).blockers,evidence:(n={postApplyVerificationReady:a,previewStaleCleared:i,evidence:null==(r=e.uiState)?void 0:r.cloudSecretsApplyEvidence,currentConfigStateFingerprint:d({setupSummary:e.setupSummary,controlPlaneContext:e.controlPlaneContext})}).evidence,currentConfigStateFingerprint:n.currentConfigStateFingerprint,previewStaleCleared:n.previewStaleCleared,postApplyVerificationReady:n.postApplyVerificationReady});return{canContinue:a&&e.localReadinessComplete&&0===o.length,postApplyVerificationReady:a,blockers:o}})({summary:N,setupSummary:o,localReadinessComplete:l.localReadinessComplete,uiState:{remoteSecretPreviewStale:u,cloudSecretsApplyEvidence:p},staleSmokeDiagnostics:l.staleSmokeDiagnostics,controlPlaneContext:c,previewStaleCleared:T}),[N,o,l.localReadinessComplete,l.staleSmokeDiagnostics,u,p,c,T]),eD=w({evidence:p,currentConfigStateFingerprint:ex,harnessDispatchRepo:N.harnessDispatchRepo}),eM=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&&y({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:P,loading:V,applyError:Y,applyResult:J,verifiedAutomaticSuccess:Z,cloudSecretsApplyEvidence:p,eligibility:eV,currentConfigStateFingerprint:ex,harnessDispatchRepo:N.harnessDispatchRepo}),e$=ek?eS:(null==_?void 0:_.validationError)?"Fix validation errors before confirming this write.":void 0,ez=null!=e$?e$:L?"success"===eM.kind?"Automatic secret write already verified for the current config.":void 0:"Confirm the GitHub Actions secret write before applying.",eW=("automatic"===P&&(Z||eD)||"manual"===P&&ee)&&eV.canContinue&&!l.cloudSecretsReviewed&&!V&&!ek,eJ=ee&&null!==ed&&eV.canContinue,eq=ee&&null!==ed&&!eV.canContinue,eZ=eV.blockers[0],eQ=null!==V||!L||!!(null==_?void 0:_.validationError)||ek||"success"===eM.kind;return(0,s.jsx)(W,{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,s.jsxs)("div",{className:C.stackSm,children:["mount-refresh"===V?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Refreshing harness repo and secret status…"}):null,eh?(0,s.jsxs)("div",{className:"space-y-2 rounded-md border border-destructive/30 bg-destructive/5 p-4",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:eh}),(0,s.jsx)(O.$,{type:"button",variant:"outline",onClick:()=>void ew("mount"),disabled:null!==V,children:"Retry refresh"})]}):null,ek?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"space-y-2 rounded-md border border-destructive/30 bg-destructive/5 p-4",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:eS}),eN?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:eN}):null]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:["step4-harness-repo"===ej.route&&k?(0,s.jsx)(O.$,{type:"button",onClick:k,children:"Go to Step 4 harness repo"}):null,"connect-services"===ej.route&&S?(0,s.jsx)(O.$,{type:"button",onClick:S,children:"Go to Step 1 services"}):null,(0,s.jsx)(O.$,{type:"button",variant:"outline",onClick:()=>void ew("manual"),disabled:null!==V,children:"refresh"===V?"Refreshing…":"Refresh"})]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("fieldset",{className:"space-y-3",children:[(0,s.jsx)("legend",{className:"text-sm font-medium",children:"Setup type"}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:gap-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(eR,{id:"setup-type-automatic",type:"radio",name:"cloud-secrets-setup-type",checked:"automatic"===P,onChange:()=>eA("automatic")}),(0,s.jsx)(X,{htmlFor:"setup-type-automatic",className:"text-sm",children:"Automatic setup"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(eR,{id:"setup-type-manual",type:"radio",name:"cloud-secrets-setup-type",checked:"manual"===P,onChange:()=>eA("manual")}),(0,s.jsx)(X,{htmlFor:"setup-type-manual",className:"text-sm",children:"Manual setup"})]})]})]}),"automatic"===P?(0,s.jsxs)("div",{className:"rounded-md border border-border bg-muted/10 p-4 space-y-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Automatic setup"}),(0,s.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,s.jsx)(tr,{open:G,onOpenChange:eB,isLoading:"preview"===V,previewError:null!=$?$:void 0,preview:null!=_?_:void 0,previewIsCurrent:eb}),(0,s.jsx)(eY,{scope:"remote-secret-write",variant:"guided",confirmed:L,disabled:ek||!!(null==_?void 0:_.validationError),disabledReason:e$,onConfirmedChange:U}),(0,s.jsxs)("div",{className:E.actions,children:[(0,s.jsx)(O.$,{type:"button",onClick:()=>void eG(),disabled:eQ,variant:"success"===eM.kind?"outline":"default",children:"apply"===V?"Writing secrets…":eC?"Create encrypted GitHub Actions secrets":"Update encrypted GitHub Actions secrets"}),eM.showRefresh?(0,s.jsx)(O.$,{type:"button",variant:"outline",onClick:()=>void ew("manual"),disabled:null!==V,children:"refresh"===V?"Refreshing…":"Refresh"}):null,eM.showRetry?(0,s.jsx)(O.$,{type:"button",variant:"outline",onClick:()=>void eH(),disabled:null!==V,children:"preview"===V?"Refreshing preview…":"Preview again"}):null]}),ez&&!ek?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:ez}):null]}):null,"manual"===P?(0,s.jsxs)("div",{className:"rounded-md border border-border bg-background p-4 space-y-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Manual setup"}),(0,s.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,s.jsx)("ul",{className:"list-disc space-y-1 pl-5 text-sm text-muted-foreground",children:eE.map(e=>(0,s.jsx)("li",{children:e},e))}),(0,s.jsxs)("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3 space-y-3",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-destructive",children:"Sensitive values warning"}),(0,s.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,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)(eR,{id:"manual-values-warning",checked:er,onChange:e=>es(e.target.checked)}),(0,s.jsx)(X,{htmlFor:"manual-values-warning",className:"text-sm leading-snug",children:"I understand these values are sensitive and will handle them carefully."})]})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)(O.$,{type:"button",variant:"outline",onClick:()=>void eF(),disabled:null!==V||!er,children:"manual-values"===V?"Generating manual copy values…":"Generate manual copy values"}),en?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(O.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>el(e=>!e),children:ei?"Hide values":"Show values"}),(0,s.jsx)(O.$,{type:"button",variant:"ghost",size:"sm",onClick:e_,children:"Clear values"})]}):null]}),eo?(0,s.jsx)("p",{className:"text-sm text-destructive",children:eo}):null,ep?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:ep}):null,en?(0,s.jsx)("div",{className:"space-y-3",children:i.map(e=>{let t=en.values[e];return(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-md border border-border p-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:e}),ei&&t?(0,s.jsx)("p",{className:"mt-1 break-all font-mono text-xs text-muted-foreground",children:t}):(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:t?"Value ready to copy.":"Value unavailable locally."})]}),(0,s.jsx)(O.$,{type:"button",variant:"outline",size:"sm",disabled:!t,onClick:()=>void eU(e,t),children:"Copy value"})]},e)})}):null,(0,s.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,s.jsx)("div",{className:E.actions,children:(0,s.jsx)(O.$,{type:"button",variant:"outline",onClick:()=>void eL(),disabled:null!==V,children:"manual-verify"===V?"Verifying manual setup…":"Verify manual setup"})}),ed&&!ee?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:ed}):null]}):null,"apply-failed"===eM.kind||"verification-inconclusive"===eM.kind?(0,s.jsx)(eT,{success:!1,message:null!=(t=eM.message)?t:"Automatic apply failed."}):null,"success"===eM.kind?(0,s.jsx)(eT,{success:!0,message:null!=(r=eM.message)?r:"Automatic apply succeeded."}):null,"stale-after-apply"===eM.kind?(0,s.jsx)(eT,{success:!1,message:null!=(a=eM.message)?a:"Config changed after apply."}):null,"success-blocked"===eM.kind&&eM.primaryBlocker?(0,s.jsx)(tn,{blocker:eM.primaryBlocker}):null,eJ?(0,s.jsx)(eT,{success:!0,message:ed}):null,eq&&eZ?(0,s.jsx)(tn,{blocker:eZ}):null,eW?(0,s.jsx)(O.$,{type:"button",onClick:g,children:"Continue to target workflow"}):null]})]})})}function tl(e){var t;let{finalization:r,onRetry:n,retrying:a=!1}=e,i="blocked"===r.lifecycle,l="complete"===r.lifecycle;return(0,s.jsxs)("div",{className:"rounded-md border border-border bg-muted/20 p-4 space-y-3",children:[(0,s.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:(0,s.jsx)(L,{label:function(e){switch(e){case"preparing":return"Creating workflow install";case"pr-created":case"pr-updated":return"Workflow install PR ready";case"waiting-for-checks":return"Waiting for checks";case"updating-branch":return"Updating install branch";case"merging":return"Merging automatically";case"verifying":return"Verifying workflow";case"complete":return"Workflow installed";case"blocked":return"Workflow install blocked";default:return"Finalizing workflow install"}}(r.lifecycle),variant:"complete"===(t=r.lifecycle)?"success":"blocked"===t?"destructive":"waiting-for-checks"===t||"verifying"===t?"warning":"secondary"})}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:r.message}),i?(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[r.canRetry&&n?(0,s.jsx)(O.$,{type:"button",onClick:n,disabled:a,children:a?"Retrying…":"Retry finalization"}):null,r.requiresGitHubIntervention&&r.prUrl?(0,s.jsx)(O.$,{asChild:!0,variant:"outline",children:(0,s.jsx)("a",{href:r.prUrl,target:"_blank",rel:"noopener noreferrer",children:"Open GitHub details"})}):null]}):null,i||l||!r.prUrl?null:(0,s.jsxs)("details",{className:"text-xs text-muted-foreground",children:[(0,s.jsx)("summary",{className:"cursor-pointer",children:"Advanced details"}),(0,s.jsxs)("p",{className:"mt-2 break-all",children:["Install PR: ",r.prUrl]})]})]})}function to(e){let{repoConfigId:t}=e;return(0,s.jsxs)("div",{className:"rounded-md border border-border bg-muted/20 p-4 space-y-2",children:[(0,s.jsx)(L,{label:"Workflow ready",variant:"success"}),(0,s.jsxs)("p",{className:"text-sm text-muted-foreground",children:[t," has the expected harness workflow on its production branch."]})]})}function tc(e){return e.targetRepos.length>0&&e.targetRepos.every(e=>"present"===e.workflowStatus)}function td(e){return"pr-created"===e.outcome||"pr-updated"===e.outcome||"branch-updated"===e.outcome}function tu(e){return!!e&&"complete"!==e.lifecycle&&("blocked"!==e.lifecycle||!!e.canRetry)}function tp(e){return(null==e?void 0:e.lifecycle)==="complete"||(null==e?void 0:e.lifecycle)==="blocked"&&!e.canRetry}function tm(e){let{initialSummary:t,onSummaryUpdated:r,onWorkflowSetupComplete:a,onWorkflowAwaitingMergeChange:i,pendingInstallByRepo:l={},finalizationByRepo:o={},onPendingInstallChange:c,onFinalizationChange:d,blockedByUpstream:u=!1}=e,[p,m]=(0,n.useState)(t),[h,f]=(0,n.useState)(o),g=(0,n.useRef)(0);(0,n.useEffect)(()=>{m(t)},[t]),(0,n.useEffect)(()=>{f(o)},[o]);let v=(0,n.useCallback)(async()=>{let e=await fetch("/api/setup/remote-summary"),t=await e.json();if(!e.ok){var s;throw Error(null!=(s=t.error)?s:"Remote summary refresh failed")}return m(t),null==r||r(t),t},[r]),x=(0,n.useCallback)(async(e,t)=>{let s=p.targetRepos.find(t=>t.repoConfigId===e);if(!s)return;let n=await fetch("/api/setup/finalize-target-workflow",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoConfigId:s.repoConfigId,targetRepo:s.targetRepo,productionBranch:s.productionBranch,prUrl:null==t?void 0:t.prUrl,branchName:null==t?void 0:t.branchName})}),o=await n.json();if(!n.ok){var u;throw Error(null!=(u=o.error)?u:"Workflow finalization failed")}let h=o.finalization,g=o.summary;if(f(t=>{let r=t[e];if(r&&tp(r)&&!tp(h))return t;let s={...t,[e]:h};return null==d||d(s),s}),m(g),null==r||r(g),"complete"===h.lifecycle){let t={...l};delete t[e],null==c||c(t)}return tc(g)&&(null==c||c({}),null==i||i(!1),null==a||a()),h},[d,c,r,i,a,l,p.targetRepos]),y=(0,n.useCallback)((e,t)=>{let r=g.current+1;g.current=r,(async()=>{for(;g.current===r;){try{let r=await x(e,t);if(!tu(r))break}catch(e){break}await new Promise(e=>setTimeout(e,2e3))}})()},[x]);(0,n.useEffect)(()=>{tc(p)&&(null==a||a())},[a,p]),(0,n.useEffect)(()=>{let e=Object.entries(h).some(e=>{let[,t]=e;return tu(t)});null==i||i(e)},[h,i]),(0,n.useEffect)(()=>{for(let[e,t]of Object.entries(l)){if(!td(t))continue;let r=h[e];!(r&&tp(r))&&(!r||tu(r))&&y(e,t)}},[h,l,y]);let w=(0,n.useCallback)(async(e,t,r)=>{let s={...l};if("already-installed"===t.outcome){delete s[e],null==c||c(s),await v();return}if(td(t)&&(s[e]=t),null==c||c(s),r){let t={...h,[e]:r};f(t),null==d||d(t)}td(t)&&y(e,t)},[h,d,c,l,v,y]),b=Object.values(h).some(e=>tu(e));return(0,s.jsx)(W,{title:"Step 7 of ".concat(7," \xb7 Install target repo workflow"),description:b?"Installing the harness workflow automatically. Setup will 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,s.jsxs)("div",{className:C.stackSm,children:[(0,s.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===p.targetRepos.length?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Resolve your local harness config to show target repo workflow cards."}):(0,s.jsx)("div",{className:C.stackSm,children:p.targetRepos.map(e=>{let t=l[e.repoConfigId],r=h[e.repoConfigId],n="present"===e.workflowStatus;return(0,s.jsxs)("div",{className:"rounded-md border border-border bg-background p-4 space-y-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:e.repoConfigId}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground break-all",children:e.targetRepo}),(0,s.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)]})]}),n?(0,s.jsx)(to,{repoConfigId:e.repoConfigId}):r?(0,s.jsx)(tl,{finalization:r,onRetry:r.canRetry?()=>void x(e.repoConfigId,t):void 0}):t&&td(t)?(0,s.jsx)(tl,{finalization:{repoConfigId:e.repoConfigId,targetRepo:e.targetRepo,targetRepoSlug:e.targetRepo,productionBranch:e.productionBranch,branchName:t.branchName,lifecycle:"preparing",message:"Starting automatic workflow install finalization.",workflowStatus:e.workflowStatus,canRetry:!1,requiresGitHubIntervention:!1,advancedThisRequest:!1,lockContended:!1}}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Preview and confirm to create or update the workflow install PR. Finalization runs automatically after apply."}),(0,s.jsx)(eM,{repo:e,variant:"guided",onApplied:()=>void 0,onGuidedApplySuccess:(t,r)=>void w(e.repoConfigId,t,r),blockedByUpstream:u})]})]},e.repoConfigId)})})]})})}function th(e){var t,r,s;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==(s=e.summary.configSummary)?void 0:s.linearTeamKey}}function tf(e){let{initialSummary:t,initialRemoteSummary:r,initialLinearSummary:a,initialVercelSummary:i,formDefaults:l}=e,[o,c]=(0,n.useState)("guided"),[u,p]=(0,n.useState)(t),[m,h]=(0,n.useState)(r),[f,g]=(0,n.useState)(a),[v,x]=(0,n.useState)(i),[w,b]=(0,n.useState)({}),j=(0,n.useMemo)(()=>th({linearSummary:f,vercelSummary:v,summary:u}),[f,v,u]),[k,E]=(0,n.useState)(()=>K({currentStepId:S({summary:t,remoteSummary:r,uiState:{},staleSmokeDiagnostics:r.staleSmokeDiagnostics,controlPlaneContext:th({linearSummary:a,vercelSummary:i,summary:t})}).currentStepId,summary:t})),[I,H]=(0,n.useState)({}),[B,G]=(0,n.useState)({}),[F,U]=(0,n.useState)(!1),V=(0,n.useRef)(null),D=(0,n.useMemo)(()=>S({summary:u,remoteSummary:m,uiState:w,staleSmokeDiagnostics:m.staleSmokeDiagnostics,controlPlaneContext:j}),[u,m,w,j]);(0,n.useEffect)(()=>{let e=D.currentStepId,t=V.current;if(null===t){V.current=e;return}(function(e,t){return("connect-services"!==e||"linear-workspace"!==t)&&P.indexOf(t)-P.indexOf(e)>0})(t,e)&&E(K({currentStepId:e,summary:u})),V.current=e},[D.currentStepId,u]),(0,n.useEffect)(()=>{D.readyForFirstRun&&E("ready-for-first-run")},[D.readyForFirstRun]),(0,n.useEffect)(()=>{"ready-for-first-run"!==k||D.readyForFirstRun||E(K({currentStepId:D.currentStepId,summary:u}))},[k,D.readyForFirstRun,D.currentStepId,u]);let Y=D.staleSmokeDiagnostics.staleTargetRepos.length>0,M=!!D.staleSmokeDiagnostics.staleHarnessDispatchRepo,$=(0,n.useMemo)(()=>{let e=l.env.suggestedHarnessDispatchRepo,t=D.staleSmokeDiagnostics.staleHarnessDispatchRepo&&e;return{harnessConfigPath:l.env.harnessConfigPath,githubDispatchRepository:t?null!=e?e:"":l.env.githubDispatchRepository||e||"",savedHarnessDispatchRepository:l.env.githubDispatchRepository,suggestedHarnessDispatchRepo:e,secretPresence:{LINEAR_API_KEY:u.envKeyPresence.LINEAR_API_KEY,CURSOR_API_KEY:u.envKeyPresence.CURSOR_API_KEY,GITHUB_TOKEN:u.envKeyPresence.GITHUB_TOKEN,VERCEL_TOKEN:u.envKeyPresence.VERCEL_TOKEN}}},[l.env,D.staleSmokeDiagnostics.staleHarnessDispatchRepo,u.envKeyPresence.CURSOR_API_KEY,u.envKeyPresence.GITHUB_TOKEN,u.envKeyPresence.LINEAR_API_KEY,u.envKeyPresence.VERCEL_TOKEN]),z=(0,n.useCallback)(e=>{b(t=>t.localPreviewStale===e.localPreviewStale?t:{...t,localPreviewStale:e.localPreviewStale})},[]),q=(0,n.useCallback)(e=>{b(t=>{let r=t;if(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})},[]),Z=(0,n.useCallback)(e=>{b(t=>t.linearPreviewStale===e.linearPreviewStale?t:{...t,linearPreviewStale:e.linearPreviewStale})},[]),Q=(0,n.useCallback)(e=>{b(t=>t.vercelPreviewStale===e.vercelPreviewStale?t:{...t,vercelPreviewStale:e.vercelPreviewStale})},[]),X=(0,n.useCallback)(async()=>{E("linear-workspace");try{let e=await fetch("/api/setup/linear-summary"),t=await e.json();e.ok&&g(t)}catch(e){}},[]),ee=(0,n.useCallback)(()=>{E("vercel-bridge")},[]),et=(0,n.useCallback)(()=>{E("choose-target-repos")},[]),er=(0,n.useCallback)(()=>{b(e=>({...e,localReadinessReviewed:!0})),E("cloud-secrets")},[]),es=(0,n.useCallback)(()=>{b(e=>({...e,cloudSecretsReviewed:!0})),E("target-workflow")},[]),en=(0,n.useCallback)(e=>{p(e),g(t=>{var r;return r=e.envKeyPresence,{...t,linearApiKeyConfigured:r.LINEAR_API_KEY}}),x(t=>{var r;return r=e.envKeyPresence,{...t,vercelTokenConfigured:r.VERCEL_TOKEN,linearApiKeyConfigured:r.LINEAR_API_KEY}}),h(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)),b(t=>{let r=th({linearSummary:f,vercelSummary:v,summary:e}),s=y({evidence:t.cloudSecretsApplyEvidence,currentConfigStateFingerprint:d({setupSummary:e,controlPlaneContext:r}),harnessDispatchRepo:m.harnessDispatchRepo});return{...t,linearPreviewStale:!0,vercelPreviewStale:!0,remoteSecretPreviewStale:!0,cloudSecretsApplyEvidence:s?void 0:t.cloudSecretsApplyEvidence}})},[f,m.harnessDispatchRepo,v]),ea=(0,n.useCallback)(()=>{U(!1),H({}),G({})},[]),ei=(0,n.useCallback)(()=>{b(e=>({...e,localReadinessReviewed:!1,cloudSecretsReviewed:!1,cloudSecretsApplyEvidence:void 0,remoteSecretPreviewStale:!0,localPreviewStale:!1})),E("local-readiness")},[]);(0,n.useCallback)(e=>{E(e)},[]);let el=(0,n.useCallback)(e=>{if("connect-services"===e||"linear-workspace"===e||"vercel-bridge"===e||"choose-target-repos"===e)return void b(t=>({...t,localReadinessReviewed:!1,cloudSecretsReviewed:!1,cloudSecretsApplyEvidence:void 0,remoteSecretPreviewStale:!0,linearPreviewStale:"connect-services"===e||"linear-workspace"===e||t.linearPreviewStale,vercelPreviewStale:"connect-services"===e||"linear-workspace"===e||"vercel-bridge"===e||t.vercelPreviewStale}));"local-readiness"===e&&b(e=>({...e,cloudSecretsReviewed:!1,cloudSecretsApplyEvidence:void 0,remoteSecretPreviewStale:!0}))},[]),eo=(0,n.useCallback)(()=>{let e=A(k);if(!e)return;let t=function(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}({target:e,currentStepId:D.currentStepId});E(t),el(t)},[k,el,D.currentStepId]),ec="guided"===o&&null!==A(k),ed=(0,n.useRef)(null),eu=u.overview.operatorConfigResolved?"Config resolved":u.overview.configResolved?"Template config loaded":"Not configured yet",ep=u.overview.operatorConfigResolved?"success":"secondary",em=D.readyForFirstRun?"Setup complete":F?"Finalizing workflow install":"Setup in progress";return(0,s.jsxs)("div",{className:N.sectionStack,children:[(0,s.jsxs)("section",{className:C.section,children:[(0,s.jsxs)("div",{className:C.stackSm,children:[(0,s.jsx)("h2",{className:R.pageTitle,children:"Settings / Configure"}),(0,s.jsx)("p",{className:R.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,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[ec?(0,s.jsx)(O.$,{type:"button",variant:"ghost",size:"sm",className:"text-muted-foreground",onClick:eo,children:"Back"}):null,(0,s.jsxs)("div",{className:C.inline,children:[(0,s.jsx)(L,{label:em,variant:D.readyForFirstRun?"success":"warning"}),"advanced"===o?(0,s.jsx)(L,{label:eu,variant:ep}):null]})]}),"guided"===o?(0,s.jsx)(O.$,{type:"button",variant:"outline",size:"sm",onClick:()=>c("advanced"),children:"Advanced checklist view"}):(0,s.jsx)(O.$,{type:"button",variant:"outline",size:"sm",onClick:()=>c("guided"),children:"Back to guided flow"})]})]}),"advanced"===o?(0,s.jsx)(J,{readiness:D}):null,"guided"===o?(0,s.jsx)("div",{className:C.section,children:(0,s.jsx)("div",{ref:ed,children:(()=>{switch(k){case"connect-services":return(0,s.jsx)(eB,{mode:"guided",guidedStep:"connect-services",initialEnv:$,initialConfig:l.config,onSummaryUpdated:en,onConnectServicesComplete:X},"guided-connect-services");case"linear-workspace":return(0,s.jsx)(e3,{readiness:D,initialSummary:f,linearApiKeyConfigured:u.envKeyPresence.LINEAR_API_KEY,onSummaryUpdated:g,onUiStateChange:Z,onContinue:ee});case"vercel-bridge":return(0,s.jsx)(e7,{readiness:D,initialSummary:v,onSummaryUpdated:x,onUiStateChange:Q,onContinue:et});case"choose-target-repos":return(0,s.jsx)(eB,{mode:"guided",guidedStep:"choose-target-repos",initialEnv:$,initialConfig:l.config,highlightStaleDispatch:M,highlightStaleTarget:Y,onSummaryUpdated:en,onUiStateChange:z,onGuidedLocalApplySuccess:ei,localSetupFilesExist:_(u)},"guided-local-setup");case"local-readiness":return(0,s.jsx)(e9,{readiness:D,onContinue:er});case"cloud-secrets":return(0,s.jsx)(ti,{readiness:D,setupSummary:u,controlPlaneContext:j,remoteSecretPreviewStale:w.remoteSecretPreviewStale,cloudSecretsApplyEvidence:w.cloudSecretsApplyEvidence,initialSummary:m,onSummaryUpdated:h,onUiStateChange:q,onContinue:es,blockedByUpstream:D.remoteSetupBlockedByUpstream,onGoToHarnessRepo:()=>E("choose-target-repos"),onGoToConnectServices:()=>E("connect-services")});case"target-workflow":return(0,s.jsx)(tm,{initialSummary:m,onSummaryUpdated:h,onWorkflowSetupComplete:ea,onWorkflowAwaitingMergeChange:U,pendingInstallByRepo:I,finalizationByRepo:B,onPendingInstallChange:H,onFinalizationChange:G,blockedByUpstream:D.remoteSetupBlockedByUpstream});case"ready-for-first-run":return(0,s.jsx)(W,{title:"Setup complete",description:"Harness setup is ready for a future first run.",children:(0,s.jsxs)("div",{className:C.stackSm,children:[(0,s.jsx)(L,{label:"Setup complete",variant:"success"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Your harness setup is ready. The target workflow install finished automatically when production verification succeeded. A later milestone can add a safe first-issue dry run or no-op harness validation."}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:D.prohibitedActionsNote})]})})}})()})}):(0,s.jsx)(e2,{summary:u,remoteSummary:m,readiness:D,formDefaults:l,onSummaryUpdated:p,onRemoteSummaryUpdated:h,onLocalUiStateChange:z,onRemoteUiStateChange:q})]})}},9375:(e,t,r)=>{Promise.resolve().then(r.bind(r,8890)),Promise.resolve().then(r.bind(r,656)),Promise.resolve().then(r.t.bind(r,9664,23))}},e=>{e.O(0,[691,845,661,587,18,358],()=>e(e.s=9375)),_N_E=e.O()}]);
|