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,1106 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { resolveHarnessPackageVersion } from "../p-dev/package-version.js";
|
|
3
|
+
import { isPackagedPDevRuntime } from "../p-dev/runtime-mode.js";
|
|
4
|
+
import { GitHubApiError } from "../github/client.js";
|
|
5
|
+
import { readExistingEnvFile } from "./env-merge.js";
|
|
6
|
+
import { buildHarnessProvisioningPreviewContext, normalizeRepoSlug, serializeHarnessProvisioningPreviewContext, validateSubmittedHarnessProvisioningFingerprint, } from "./harness-provisioning-context.js";
|
|
7
|
+
import { buildHarnessManagedRepoMarker, HARNESS_MANAGED_REPO_MARKER_FILE, markersAreEquivalentForOperation, markerValidForExistingWorkspace, parseHarnessManagedRepoMarkerJson, validateManagedMarkerForReconnect, } from "./harness-managed-repo-marker.js";
|
|
8
|
+
import { buildPendingValidationContext, clearHarnessProvisioningPendingState, readHarnessProvisioningPendingState, validatePendingProvisioningState, withHarnessProvisioningMutex, writeHarnessProvisioningPendingStateAtomic, } from "./harness-provisioning-pending-state.js";
|
|
9
|
+
import { parseRepoSlug } from "./github-remote-setup-live.js";
|
|
10
|
+
import { assessPackagedProvisioningTokenCapabilities, } from "./github-workflow-permissions.js";
|
|
11
|
+
import { HARNESS_DEFAULT_DESTINATION_DESCRIPTION, HARNESS_DEFAULT_DESTINATION_REPO_NAME, HARNESS_LEGACY_PUBLIC_SOURCE_REPO, HARNESS_TEMPLATE_IDENTITY_FILE, HARNESS_TEMPLATE_OWNER, HARNESS_TEMPLATE_REPO, parseHarnessTemplateIdentityJson, } from "./harness-template-identity.js";
|
|
12
|
+
import { persistGithubDispatchRepository } from "./local-apply-actions.js";
|
|
13
|
+
import { resolveLocalFilePaths } from "./setup-state.js";
|
|
14
|
+
const POST_CREATE_POLL_MAX_DELAY_MS = 8_000;
|
|
15
|
+
function resolvePostCreatePollConfig() {
|
|
16
|
+
return {
|
|
17
|
+
timeoutMs: Number(process.env.HARNESS_PROVISIONING_POLL_TIMEOUT_MS ?? 60_000),
|
|
18
|
+
initialDelayMs: Number(process.env.HARNESS_PROVISIONING_POLL_INITIAL_DELAY_MS ?? 1_000),
|
|
19
|
+
maxDelayMs: Number(process.env.HARNESS_PROVISIONING_POLL_MAX_DELAY_MS ??
|
|
20
|
+
POST_CREATE_POLL_MAX_DELAY_MS),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function sleep(ms) {
|
|
24
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
25
|
+
}
|
|
26
|
+
function buildFingerprint(input) {
|
|
27
|
+
return JSON.stringify(input);
|
|
28
|
+
}
|
|
29
|
+
function destinationSlug(login) {
|
|
30
|
+
return `${login}/${HARNESS_DEFAULT_DESTINATION_REPO_NAME}`;
|
|
31
|
+
}
|
|
32
|
+
function readSavedRepositoryId(existingEnv) {
|
|
33
|
+
const raw = existingEnv?.values.GITHUB_DISPATCH_REPOSITORY_ID?.trim();
|
|
34
|
+
if (!raw) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
const parsed = Number(raw);
|
|
38
|
+
if (!Number.isInteger(parsed) || parsed <= 0) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
return parsed;
|
|
42
|
+
}
|
|
43
|
+
function buildProvisioningPreviewFingerprint(input) {
|
|
44
|
+
const context = buildHarnessProvisioningPreviewContext({
|
|
45
|
+
operationId: input.operationId,
|
|
46
|
+
user: input.user,
|
|
47
|
+
destination: input.destination,
|
|
48
|
+
templateDefaultBranch: input.templatePreview.defaultBranch,
|
|
49
|
+
templateHeadSha: input.templatePreview.headSha,
|
|
50
|
+
templateIdentity: input.templatePreview.identity.identity,
|
|
51
|
+
classification: input.classification,
|
|
52
|
+
envBaseline: input.envBaseline,
|
|
53
|
+
pDevVersion: input.pDevVersion,
|
|
54
|
+
resumedFromPending: input.resumedFromPending,
|
|
55
|
+
creationPreviewFingerprint: input.creationPreviewFingerprint,
|
|
56
|
+
});
|
|
57
|
+
return serializeHarnessProvisioningPreviewContext(context);
|
|
58
|
+
}
|
|
59
|
+
async function resolveProvisioningOperation(input) {
|
|
60
|
+
if (input.requestedOperationId) {
|
|
61
|
+
const pending = await readHarnessProvisioningPendingState(input.cwd);
|
|
62
|
+
if (pending && pending.operationId !== input.requestedOperationId) {
|
|
63
|
+
return {
|
|
64
|
+
ok: false,
|
|
65
|
+
state: "concurrent-request-recovered",
|
|
66
|
+
message: "Another provisioning operation is already in progress for this workspace.",
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
ok: true,
|
|
71
|
+
operationId: input.requestedOperationId,
|
|
72
|
+
resumedFromPending: Boolean(pending),
|
|
73
|
+
creationPreviewFingerprint: pending?.previewFingerprint ?? null,
|
|
74
|
+
pending,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
const pending = await readHarnessProvisioningPendingState(input.cwd);
|
|
78
|
+
if (!pending) {
|
|
79
|
+
return {
|
|
80
|
+
ok: true,
|
|
81
|
+
operationId: randomUUID(),
|
|
82
|
+
resumedFromPending: false,
|
|
83
|
+
creationPreviewFingerprint: null,
|
|
84
|
+
pending: null,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
const validation = validatePendingProvisioningState(pending, buildPendingValidationContext({
|
|
88
|
+
authenticatedUserId: input.user.id,
|
|
89
|
+
authenticatedLogin: input.user.login,
|
|
90
|
+
targetOwner: input.user.login,
|
|
91
|
+
targetRepo: HARNESS_DEFAULT_DESTINATION_REPO_NAME,
|
|
92
|
+
templateIdentity: input.templatePreview.identity.identity.templateIdentity,
|
|
93
|
+
templateVersion: input.templatePreview.identity.identity.templateVersion,
|
|
94
|
+
compatibilityVersion: input.templatePreview.identity.identity.compatibilityVersion,
|
|
95
|
+
templateContentId: input.templatePreview.identity.identity.templateContentId,
|
|
96
|
+
templateDefaultBranch: input.templatePreview.defaultBranch,
|
|
97
|
+
templateHeadSha: input.templatePreview.headSha,
|
|
98
|
+
}));
|
|
99
|
+
if (!validation.ok) {
|
|
100
|
+
return {
|
|
101
|
+
ok: false,
|
|
102
|
+
state: "same-name-unmanaged-collision",
|
|
103
|
+
message: validation.reason,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
ok: true,
|
|
108
|
+
operationId: pending.operationId,
|
|
109
|
+
resumedFromPending: true,
|
|
110
|
+
creationPreviewFingerprint: pending.previewFingerprint,
|
|
111
|
+
pending,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
function pendingMatchesDestinationTemplateIdentity(pending, templateIdentity) {
|
|
115
|
+
return (pending.templateIdentity === templateIdentity.templateIdentity &&
|
|
116
|
+
pending.templateVersion === templateIdentity.templateVersion &&
|
|
117
|
+
pending.compatibilityVersion === templateIdentity.compatibilityVersion &&
|
|
118
|
+
pending.templateContentId === templateIdentity.templateContentId);
|
|
119
|
+
}
|
|
120
|
+
async function loadTemplatePreview(provider) {
|
|
121
|
+
const template = await provider.getRepositoryMetadata(HARNESS_TEMPLATE_OWNER, HARNESS_TEMPLATE_REPO);
|
|
122
|
+
if (!template || !template.isTemplate) {
|
|
123
|
+
return {
|
|
124
|
+
ok: false,
|
|
125
|
+
state: "template-unavailable",
|
|
126
|
+
message: "The approved p-dev harness template is missing or not marked as a GitHub template.",
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
const headSha = await provider.getRepositoryDefaultBranchHead(HARNESS_TEMPLATE_OWNER, HARNESS_TEMPLATE_REPO, template.defaultBranch);
|
|
130
|
+
const identityRaw = await provider.readRepositoryFileContent(HARNESS_TEMPLATE_OWNER, HARNESS_TEMPLATE_REPO, HARNESS_TEMPLATE_IDENTITY_FILE, headSha);
|
|
131
|
+
if (!identityRaw) {
|
|
132
|
+
return {
|
|
133
|
+
ok: false,
|
|
134
|
+
state: "template-identity-missing",
|
|
135
|
+
message: "Template identity file is missing from the approved template.",
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
const parsed = parseHarnessTemplateIdentityJson(identityRaw);
|
|
139
|
+
if (!parsed.ok) {
|
|
140
|
+
return {
|
|
141
|
+
ok: false,
|
|
142
|
+
state: "template-identity-invalid",
|
|
143
|
+
message: parsed.reason,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
ok: true,
|
|
148
|
+
defaultBranch: template.defaultBranch,
|
|
149
|
+
headSha,
|
|
150
|
+
identityRaw,
|
|
151
|
+
identity: parsed,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
async function validateExplicitPackagedRepo(provider, repoSlug, savedRepositoryId) {
|
|
155
|
+
if (repoSlug === HARNESS_LEGACY_PUBLIC_SOURCE_REPO) {
|
|
156
|
+
return {
|
|
157
|
+
ok: false,
|
|
158
|
+
state: "explicit-packaged-repo-legacy-source",
|
|
159
|
+
message: "Saved harness repo points at the public source repo. Use advanced recovery to adopt a private managed workspace.",
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
let resolvedSlug = normalizeRepoSlug(repoSlug);
|
|
163
|
+
let metadata = null;
|
|
164
|
+
if (savedRepositoryId) {
|
|
165
|
+
metadata = await provider.getRepositoryMetadataById(savedRepositoryId);
|
|
166
|
+
if (!metadata) {
|
|
167
|
+
return {
|
|
168
|
+
ok: false,
|
|
169
|
+
state: "explicit-packaged-repo-invalid",
|
|
170
|
+
message: `Saved harness repository ID ${savedRepositoryId} is missing or inaccessible.`,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
resolvedSlug = normalizeRepoSlug(`${metadata.owner}/${metadata.repo}`);
|
|
174
|
+
if (normalizeRepoSlug(repoSlug) !== resolvedSlug &&
|
|
175
|
+
savedRepositoryId !== metadata.repositoryId) {
|
|
176
|
+
return {
|
|
177
|
+
ok: false,
|
|
178
|
+
state: "explicit-packaged-repo-invalid",
|
|
179
|
+
message: `Saved harness repo ${repoSlug} does not match repository ID ${savedRepositoryId}.`,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
const { owner, repo } = parseRepoSlug(resolvedSlug);
|
|
185
|
+
metadata = await provider.getRepositoryMetadata(owner, repo);
|
|
186
|
+
}
|
|
187
|
+
if (!metadata) {
|
|
188
|
+
return {
|
|
189
|
+
ok: false,
|
|
190
|
+
state: "explicit-packaged-repo-invalid",
|
|
191
|
+
message: `Saved harness repo ${repoSlug} is missing or inaccessible.`,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
if (savedRepositoryId && metadata.repositoryId !== savedRepositoryId) {
|
|
195
|
+
return {
|
|
196
|
+
ok: false,
|
|
197
|
+
state: "explicit-packaged-repo-invalid",
|
|
198
|
+
message: `Saved harness repository ID does not match GitHub metadata for ${resolvedSlug}.`,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
if (!metadata.private || metadata.visibility !== "private") {
|
|
202
|
+
return {
|
|
203
|
+
ok: false,
|
|
204
|
+
state: "explicit-packaged-repo-invalid",
|
|
205
|
+
message: `Saved harness repo ${resolvedSlug} must be private in packaged mode.`,
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
if (!metadata.permissions.admin) {
|
|
209
|
+
return {
|
|
210
|
+
ok: false,
|
|
211
|
+
state: "explicit-packaged-repo-invalid",
|
|
212
|
+
message: `Saved harness repo ${resolvedSlug} requires admin access.`,
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
const markerRaw = await provider.readRepositoryFileContent(metadata.owner, metadata.repo, HARNESS_MANAGED_REPO_MARKER_FILE, metadata.defaultBranch);
|
|
216
|
+
if (!markerRaw) {
|
|
217
|
+
return {
|
|
218
|
+
ok: false,
|
|
219
|
+
state: "explicit-packaged-repo-invalid",
|
|
220
|
+
message: `Saved harness repo ${resolvedSlug} is missing a compatible managed marker.`,
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
const marker = parseHarnessManagedRepoMarkerJson(markerRaw);
|
|
224
|
+
if (!marker.ok) {
|
|
225
|
+
return {
|
|
226
|
+
ok: false,
|
|
227
|
+
state: "explicit-packaged-repo-invalid",
|
|
228
|
+
message: marker.reason,
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
const reconnect = validateManagedMarkerForReconnect(marker.marker, resolvedSlug, { repositoryId: metadata.repositoryId });
|
|
232
|
+
if (!reconnect.ok) {
|
|
233
|
+
return {
|
|
234
|
+
ok: false,
|
|
235
|
+
state: "explicit-packaged-repo-invalid",
|
|
236
|
+
message: reconnect.reason,
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
return {
|
|
240
|
+
ok: true,
|
|
241
|
+
repoSlug: resolvedSlug,
|
|
242
|
+
repositoryId: metadata.repositoryId,
|
|
243
|
+
marker,
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
async function classifyDestinationRepo(provider, user, cwd, templatePreview) {
|
|
247
|
+
const repoSlug = destinationSlug(user.login);
|
|
248
|
+
const { owner, repo } = parseRepoSlug(repoSlug);
|
|
249
|
+
const metadata = await provider.getRepositoryMetadata(owner, repo);
|
|
250
|
+
if (!metadata) {
|
|
251
|
+
return { kind: "absent" };
|
|
252
|
+
}
|
|
253
|
+
if (!metadata.private || metadata.visibility !== "private") {
|
|
254
|
+
return { kind: "public-collision" };
|
|
255
|
+
}
|
|
256
|
+
if (!metadata.permissions.admin) {
|
|
257
|
+
return { kind: "unmanaged-collision" };
|
|
258
|
+
}
|
|
259
|
+
const markerRaw = await provider.readRepositoryFileContent(owner, repo, HARNESS_MANAGED_REPO_MARKER_FILE, metadata.defaultBranch);
|
|
260
|
+
if (markerRaw) {
|
|
261
|
+
const marker = parseHarnessManagedRepoMarkerJson(markerRaw);
|
|
262
|
+
if (!marker.ok) {
|
|
263
|
+
return { kind: "malformed-marker", reason: marker.reason };
|
|
264
|
+
}
|
|
265
|
+
const reconnect = validateManagedMarkerForReconnect(marker.marker, repoSlug, {
|
|
266
|
+
repositoryId: metadata.repositoryId,
|
|
267
|
+
});
|
|
268
|
+
if (!reconnect.ok) {
|
|
269
|
+
return { kind: "malformed-marker", reason: reconnect.reason };
|
|
270
|
+
}
|
|
271
|
+
return {
|
|
272
|
+
kind: "valid-managed",
|
|
273
|
+
repoSlug,
|
|
274
|
+
repositoryId: metadata.repositoryId,
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
const templateRaw = await provider.readRepositoryFileContent(owner, repo, HARNESS_TEMPLATE_IDENTITY_FILE, metadata.defaultBranch);
|
|
278
|
+
if (templateRaw) {
|
|
279
|
+
const parsedTemplate = parseHarnessTemplateIdentityJson(templateRaw);
|
|
280
|
+
if (!parsedTemplate.ok) {
|
|
281
|
+
return {
|
|
282
|
+
kind: "malformed-marker",
|
|
283
|
+
reason: `Generated repository template identity is invalid: ${parsedTemplate.reason}`,
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
const pending = await readHarnessProvisioningPendingState(cwd);
|
|
287
|
+
if (pending && templatePreview) {
|
|
288
|
+
const validation = validatePendingProvisioningState(pending, buildPendingValidationContext({
|
|
289
|
+
authenticatedUserId: user.id,
|
|
290
|
+
authenticatedLogin: user.login,
|
|
291
|
+
targetOwner: user.login,
|
|
292
|
+
targetRepo: HARNESS_DEFAULT_DESTINATION_REPO_NAME,
|
|
293
|
+
templateIdentity: templatePreview.identity.identity.templateIdentity,
|
|
294
|
+
templateVersion: templatePreview.identity.identity.templateVersion,
|
|
295
|
+
compatibilityVersion: templatePreview.identity.identity.compatibilityVersion,
|
|
296
|
+
templateContentId: templatePreview.identity.identity.templateContentId,
|
|
297
|
+
templateDefaultBranch: templatePreview.defaultBranch,
|
|
298
|
+
templateHeadSha: templatePreview.headSha,
|
|
299
|
+
}));
|
|
300
|
+
if (validation.ok &&
|
|
301
|
+
pendingMatchesDestinationTemplateIdentity(pending, parsedTemplate.identity)) {
|
|
302
|
+
return { kind: "template-only-with-pending" };
|
|
303
|
+
}
|
|
304
|
+
if (!validation.ok) {
|
|
305
|
+
return { kind: "unmanaged-collision" };
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
return { kind: "template-only-without-pending" };
|
|
309
|
+
}
|
|
310
|
+
return { kind: "unmanaged-collision" };
|
|
311
|
+
}
|
|
312
|
+
async function pollGeneratedRepository(provider, repoSlug, expectedContentId) {
|
|
313
|
+
const { owner, repo } = parseRepoSlug(repoSlug);
|
|
314
|
+
const { timeoutMs, initialDelayMs, maxDelayMs } = resolvePostCreatePollConfig();
|
|
315
|
+
const started = Date.now();
|
|
316
|
+
let delay = initialDelayMs;
|
|
317
|
+
while (Date.now() - started < timeoutMs) {
|
|
318
|
+
const metadata = await provider.getRepositoryMetadata(owner, repo);
|
|
319
|
+
if (metadata?.private && metadata.permissions.admin) {
|
|
320
|
+
const identityRaw = await provider.readRepositoryFileContent(owner, repo, HARNESS_TEMPLATE_IDENTITY_FILE, metadata.defaultBranch);
|
|
321
|
+
if (identityRaw) {
|
|
322
|
+
const parsed = parseHarnessTemplateIdentityJson(identityRaw);
|
|
323
|
+
if (parsed.ok &&
|
|
324
|
+
parsed.identity.templateContentId === expectedContentId) {
|
|
325
|
+
return {
|
|
326
|
+
ok: true,
|
|
327
|
+
defaultBranch: metadata.defaultBranch,
|
|
328
|
+
repositoryId: metadata.repositoryId,
|
|
329
|
+
identity: parsed,
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
await sleep(delay);
|
|
335
|
+
delay = Math.min(delay * 2, maxDelayMs);
|
|
336
|
+
}
|
|
337
|
+
return {
|
|
338
|
+
ok: false,
|
|
339
|
+
timedOut: true,
|
|
340
|
+
message: "Timed out waiting for the generated harness workspace to become ready. Retry Step 1 Continue.",
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
async function finalizeManagedMarker(provider, input) {
|
|
344
|
+
const { owner, repo } = parseRepoSlug(input.repoSlug);
|
|
345
|
+
const metadata = await provider.getRepositoryMetadata(owner, repo);
|
|
346
|
+
if (!metadata) {
|
|
347
|
+
return {
|
|
348
|
+
ok: false,
|
|
349
|
+
message: `Generated harness workspace ${input.repoSlug} is not accessible for marker finalization.`,
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
if (metadata.repositoryId !== input.repositoryId) {
|
|
353
|
+
return {
|
|
354
|
+
ok: false,
|
|
355
|
+
message: `Generated harness workspace repository ID mismatch for ${input.repoSlug}.`,
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
const expectedMarker = buildHarnessManagedRepoMarker({
|
|
359
|
+
repository: input.repoSlug,
|
|
360
|
+
repositoryId: input.repositoryId,
|
|
361
|
+
templateIdentity: input.templateIdentity.identity,
|
|
362
|
+
defaultBranch: input.defaultBranch,
|
|
363
|
+
sourceHeadSha: input.templateHeadSha,
|
|
364
|
+
operationId: input.operationId,
|
|
365
|
+
createdByGithubUserId: input.user.id,
|
|
366
|
+
createdByLogin: input.user.login,
|
|
367
|
+
pDevVersion: input.pDevVersion,
|
|
368
|
+
});
|
|
369
|
+
const existingRaw = await provider.readRepositoryFileContent(owner, repo, HARNESS_MANAGED_REPO_MARKER_FILE, input.defaultBranch);
|
|
370
|
+
if (existingRaw) {
|
|
371
|
+
const existing = parseHarnessManagedRepoMarkerJson(existingRaw);
|
|
372
|
+
if (!existing.ok) {
|
|
373
|
+
return { ok: false, message: existing.reason };
|
|
374
|
+
}
|
|
375
|
+
if (markersAreEquivalentForOperation(existing.marker, expectedMarker) ||
|
|
376
|
+
markerValidForExistingWorkspace(existing.marker, input.repoSlug, {
|
|
377
|
+
repositoryId: input.repositoryId,
|
|
378
|
+
})) {
|
|
379
|
+
return { ok: true };
|
|
380
|
+
}
|
|
381
|
+
return {
|
|
382
|
+
ok: false,
|
|
383
|
+
message: "Existing managed marker belongs to a different operation or repository.",
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
try {
|
|
387
|
+
await provider.writeRepositoryFile({
|
|
388
|
+
owner,
|
|
389
|
+
repo,
|
|
390
|
+
path: HARNESS_MANAGED_REPO_MARKER_FILE,
|
|
391
|
+
branch: input.defaultBranch,
|
|
392
|
+
message: "Initialize p-dev managed harness workspace marker",
|
|
393
|
+
content: `${JSON.stringify(expectedMarker, null, 2)}\n`,
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
catch (error) {
|
|
397
|
+
return {
|
|
398
|
+
ok: false,
|
|
399
|
+
message: error instanceof Error
|
|
400
|
+
? error.message
|
|
401
|
+
: "Failed to write managed harness workspace marker.",
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
return { ok: true };
|
|
405
|
+
}
|
|
406
|
+
export async function loadHarnessRepoProvisioningSummary(options) {
|
|
407
|
+
const runtimeMode = isPackagedPDevRuntime()
|
|
408
|
+
? "packaged"
|
|
409
|
+
: process.env.P_DEV_RUNTIME_MODE?.trim()
|
|
410
|
+
? "source"
|
|
411
|
+
: "unknown";
|
|
412
|
+
const paths = resolveLocalFilePaths(options.cwd);
|
|
413
|
+
const existingEnv = await readExistingEnvFile(paths);
|
|
414
|
+
const explicitRepo = existingEnv?.values.GITHUB_DISPATCH_REPOSITORY?.trim();
|
|
415
|
+
const pending = await readHarnessProvisioningPendingState(options.cwd);
|
|
416
|
+
const base = {
|
|
417
|
+
runtimeMode,
|
|
418
|
+
harnessDispatchRepo: explicitRepo ?? null,
|
|
419
|
+
authenticatedLogin: null,
|
|
420
|
+
verifiedSavedRepo: false,
|
|
421
|
+
connectedAutomatically: false,
|
|
422
|
+
};
|
|
423
|
+
if (!isPackagedPDevRuntime()) {
|
|
424
|
+
return {
|
|
425
|
+
...base,
|
|
426
|
+
eligible: false,
|
|
427
|
+
state: runtimeMode === "source" ? "skipped-source-mode" : "skipped-not-packaged",
|
|
428
|
+
message: runtimeMode === "source"
|
|
429
|
+
? "Source mode does not auto-provision a harness workspace."
|
|
430
|
+
: "Packaged runtime mode is not active.",
|
|
431
|
+
recoverable: false,
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
if (pending) {
|
|
435
|
+
return {
|
|
436
|
+
...base,
|
|
437
|
+
eligible: true,
|
|
438
|
+
state: "repo-created-pending-verification",
|
|
439
|
+
message: "Harness workspace provisioning is incomplete. Retry Step 1 Continue to resume.",
|
|
440
|
+
recoverable: true,
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
if (!explicitRepo) {
|
|
444
|
+
return {
|
|
445
|
+
...base,
|
|
446
|
+
eligible: true,
|
|
447
|
+
state: "repo-absent",
|
|
448
|
+
message: "Packaged workspace provisioning has not completed yet.",
|
|
449
|
+
recoverable: true,
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
if (!options.provider) {
|
|
453
|
+
return {
|
|
454
|
+
...base,
|
|
455
|
+
eligible: true,
|
|
456
|
+
state: "explicit-repo-present",
|
|
457
|
+
message: `Saved harness workspace ${explicitRepo} requires server validation.`,
|
|
458
|
+
recoverable: true,
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
const capabilities = await options.provider.inspectTokenCapabilities();
|
|
462
|
+
const validated = await validateExplicitPackagedRepo(options.provider, explicitRepo, readSavedRepositoryId(existingEnv));
|
|
463
|
+
if (!validated.ok) {
|
|
464
|
+
return {
|
|
465
|
+
...base,
|
|
466
|
+
eligible: true,
|
|
467
|
+
state: validated.state,
|
|
468
|
+
authenticatedLogin: capabilities.login,
|
|
469
|
+
message: validated.message,
|
|
470
|
+
recoverable: true,
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
const isDefaultDestination = explicitRepo === destinationSlug(capabilities.login) ||
|
|
474
|
+
explicitRepo === destinationSlug(validated.marker.marker.createdByLogin ?? "");
|
|
475
|
+
return {
|
|
476
|
+
...base,
|
|
477
|
+
eligible: true,
|
|
478
|
+
state: "verified-and-persisted",
|
|
479
|
+
harnessDispatchRepo: explicitRepo,
|
|
480
|
+
authenticatedLogin: capabilities.login,
|
|
481
|
+
message: `Connected to validated harness workspace ${explicitRepo}.`,
|
|
482
|
+
recoverable: false,
|
|
483
|
+
verifiedSavedRepo: true,
|
|
484
|
+
connectedAutomatically: isDefaultDestination && Boolean(validated.marker.marker.operationId),
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
export async function previewHarnessRepoProvisioning(options) {
|
|
488
|
+
if (!isPackagedPDevRuntime()) {
|
|
489
|
+
return {
|
|
490
|
+
state: "skipped-not-packaged",
|
|
491
|
+
fingerprint: buildFingerprint({ action: "preview", skipped: true }),
|
|
492
|
+
operationId: options.operationId ?? randomUUID(),
|
|
493
|
+
creationPreviewFingerprint: null,
|
|
494
|
+
resumedFromPending: false,
|
|
495
|
+
harnessDispatchRepo: null,
|
|
496
|
+
authenticatedLogin: null,
|
|
497
|
+
templateOwner: HARNESS_TEMPLATE_OWNER,
|
|
498
|
+
templateRepo: HARNESS_TEMPLATE_REPO,
|
|
499
|
+
templateDefaultBranch: "main",
|
|
500
|
+
templateHeadSha: "",
|
|
501
|
+
templateContentId: null,
|
|
502
|
+
message: "Packaged runtime mode is not active.",
|
|
503
|
+
recoverable: false,
|
|
504
|
+
willCreateRepository: false,
|
|
505
|
+
tokenCapabilities: {
|
|
506
|
+
tokenType: "unknown",
|
|
507
|
+
hasRepoScope: false,
|
|
508
|
+
hasWorkflowScope: false,
|
|
509
|
+
scopeAmbiguous: true,
|
|
510
|
+
},
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
const paths = resolveLocalFilePaths(options.cwd);
|
|
514
|
+
const existingEnv = await readExistingEnvFile(paths);
|
|
515
|
+
const explicitRepo = existingEnv?.values.GITHUB_DISPATCH_REPOSITORY?.trim();
|
|
516
|
+
const pDevVersion = resolveHarnessPackageVersion();
|
|
517
|
+
const capabilities = await options.provider.inspectTokenCapabilities();
|
|
518
|
+
const tokenMetadata = {
|
|
519
|
+
login: capabilities.login,
|
|
520
|
+
tokenType: capabilities.tokenType,
|
|
521
|
+
oauthScopes: [],
|
|
522
|
+
hasRepoScope: capabilities.hasRepoScope,
|
|
523
|
+
hasWorkflowScope: capabilities.hasWorkflowScope,
|
|
524
|
+
};
|
|
525
|
+
const capabilityCheck = assessPackagedProvisioningTokenCapabilities({
|
|
526
|
+
...tokenMetadata,
|
|
527
|
+
oauthScopes: capabilities.scopeAmbiguous || capabilities.tokenType !== "classic"
|
|
528
|
+
? []
|
|
529
|
+
: [
|
|
530
|
+
...(capabilities.hasRepoScope ? ["repo"] : []),
|
|
531
|
+
...(capabilities.hasWorkflowScope ? ["workflow"] : []),
|
|
532
|
+
],
|
|
533
|
+
});
|
|
534
|
+
if (capabilities.scopeAmbiguous) {
|
|
535
|
+
const operationId = options.operationId ?? randomUUID();
|
|
536
|
+
return {
|
|
537
|
+
state: "token-scope-ambiguous",
|
|
538
|
+
fingerprint: buildFingerprint({ action: "preview", operationId }),
|
|
539
|
+
operationId,
|
|
540
|
+
creationPreviewFingerprint: null,
|
|
541
|
+
resumedFromPending: false,
|
|
542
|
+
harnessDispatchRepo: explicitRepo ?? null,
|
|
543
|
+
authenticatedLogin: capabilities.login,
|
|
544
|
+
templateOwner: HARNESS_TEMPLATE_OWNER,
|
|
545
|
+
templateRepo: HARNESS_TEMPLATE_REPO,
|
|
546
|
+
templateDefaultBranch: "main",
|
|
547
|
+
templateHeadSha: "",
|
|
548
|
+
templateContentId: null,
|
|
549
|
+
message: capabilityCheck.ok
|
|
550
|
+
? "Token scope metadata is ambiguous."
|
|
551
|
+
: capabilityCheck.message,
|
|
552
|
+
recoverable: true,
|
|
553
|
+
willCreateRepository: false,
|
|
554
|
+
tokenCapabilities: {
|
|
555
|
+
tokenType: capabilities.tokenType,
|
|
556
|
+
hasRepoScope: capabilities.hasRepoScope,
|
|
557
|
+
hasWorkflowScope: capabilities.hasWorkflowScope,
|
|
558
|
+
scopeAmbiguous: capabilities.scopeAmbiguous,
|
|
559
|
+
},
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
if (!capabilityCheck.ok) {
|
|
563
|
+
const state = capabilities.tokenType === "fine-grained"
|
|
564
|
+
? "token-unsupported"
|
|
565
|
+
: capabilities.tokenType === "unknown"
|
|
566
|
+
? "token-scope-ambiguous"
|
|
567
|
+
: "token-insufficient";
|
|
568
|
+
const operationId = options.operationId ?? randomUUID();
|
|
569
|
+
return {
|
|
570
|
+
state,
|
|
571
|
+
fingerprint: buildFingerprint({ action: "preview", operationId }),
|
|
572
|
+
operationId,
|
|
573
|
+
creationPreviewFingerprint: null,
|
|
574
|
+
resumedFromPending: false,
|
|
575
|
+
harnessDispatchRepo: explicitRepo ?? null,
|
|
576
|
+
authenticatedLogin: capabilities.login,
|
|
577
|
+
templateOwner: HARNESS_TEMPLATE_OWNER,
|
|
578
|
+
templateRepo: HARNESS_TEMPLATE_REPO,
|
|
579
|
+
templateDefaultBranch: "main",
|
|
580
|
+
templateHeadSha: "",
|
|
581
|
+
templateContentId: null,
|
|
582
|
+
message: capabilityCheck.message,
|
|
583
|
+
recoverable: true,
|
|
584
|
+
willCreateRepository: false,
|
|
585
|
+
tokenCapabilities: {
|
|
586
|
+
tokenType: capabilities.tokenType,
|
|
587
|
+
hasRepoScope: capabilities.hasRepoScope,
|
|
588
|
+
hasWorkflowScope: capabilities.hasWorkflowScope,
|
|
589
|
+
scopeAmbiguous: capabilities.scopeAmbiguous,
|
|
590
|
+
},
|
|
591
|
+
};
|
|
592
|
+
}
|
|
593
|
+
const user = await options.provider.resolveAuthenticatedUser();
|
|
594
|
+
if (explicitRepo) {
|
|
595
|
+
const operationId = options.operationId ?? randomUUID();
|
|
596
|
+
const explicit = await validateExplicitPackagedRepo(options.provider, explicitRepo, readSavedRepositoryId(existingEnv));
|
|
597
|
+
const fingerprint = buildFingerprint({
|
|
598
|
+
action: "preview",
|
|
599
|
+
operationId,
|
|
600
|
+
authenticatedLogin: user.login,
|
|
601
|
+
explicitRepo,
|
|
602
|
+
pDevVersion,
|
|
603
|
+
});
|
|
604
|
+
if (!explicit.ok) {
|
|
605
|
+
return {
|
|
606
|
+
state: explicit.state,
|
|
607
|
+
fingerprint,
|
|
608
|
+
operationId,
|
|
609
|
+
creationPreviewFingerprint: null,
|
|
610
|
+
resumedFromPending: false,
|
|
611
|
+
harnessDispatchRepo: explicitRepo,
|
|
612
|
+
authenticatedLogin: user.login,
|
|
613
|
+
templateOwner: HARNESS_TEMPLATE_OWNER,
|
|
614
|
+
templateRepo: HARNESS_TEMPLATE_REPO,
|
|
615
|
+
templateDefaultBranch: "main",
|
|
616
|
+
templateHeadSha: "",
|
|
617
|
+
templateContentId: null,
|
|
618
|
+
message: explicit.message,
|
|
619
|
+
recoverable: true,
|
|
620
|
+
willCreateRepository: false,
|
|
621
|
+
tokenCapabilities: {
|
|
622
|
+
tokenType: capabilities.tokenType,
|
|
623
|
+
hasRepoScope: capabilities.hasRepoScope,
|
|
624
|
+
hasWorkflowScope: capabilities.hasWorkflowScope,
|
|
625
|
+
scopeAmbiguous: capabilities.scopeAmbiguous,
|
|
626
|
+
},
|
|
627
|
+
};
|
|
628
|
+
}
|
|
629
|
+
return {
|
|
630
|
+
state: "explicit-repo-present",
|
|
631
|
+
fingerprint,
|
|
632
|
+
operationId,
|
|
633
|
+
creationPreviewFingerprint: null,
|
|
634
|
+
resumedFromPending: false,
|
|
635
|
+
harnessDispatchRepo: explicitRepo,
|
|
636
|
+
authenticatedLogin: user.login,
|
|
637
|
+
templateOwner: HARNESS_TEMPLATE_OWNER,
|
|
638
|
+
templateRepo: HARNESS_TEMPLATE_REPO,
|
|
639
|
+
templateDefaultBranch: "main",
|
|
640
|
+
templateHeadSha: "",
|
|
641
|
+
templateContentId: explicit.marker.marker.createdFromTemplate.templateContentId,
|
|
642
|
+
message: `Reconnecting to saved harness workspace ${explicitRepo}.`,
|
|
643
|
+
recoverable: false,
|
|
644
|
+
willCreateRepository: false,
|
|
645
|
+
tokenCapabilities: {
|
|
646
|
+
tokenType: capabilities.tokenType,
|
|
647
|
+
hasRepoScope: capabilities.hasRepoScope,
|
|
648
|
+
hasWorkflowScope: capabilities.hasWorkflowScope,
|
|
649
|
+
scopeAmbiguous: capabilities.scopeAmbiguous,
|
|
650
|
+
},
|
|
651
|
+
};
|
|
652
|
+
}
|
|
653
|
+
const templatePreview = await loadTemplatePreview(options.provider);
|
|
654
|
+
if (!templatePreview.ok) {
|
|
655
|
+
const operationId = options.operationId ?? randomUUID();
|
|
656
|
+
return {
|
|
657
|
+
state: templatePreview.state,
|
|
658
|
+
fingerprint: buildFingerprint({ action: "preview", operationId }),
|
|
659
|
+
operationId,
|
|
660
|
+
creationPreviewFingerprint: null,
|
|
661
|
+
resumedFromPending: false,
|
|
662
|
+
harnessDispatchRepo: null,
|
|
663
|
+
authenticatedLogin: user.login,
|
|
664
|
+
templateOwner: HARNESS_TEMPLATE_OWNER,
|
|
665
|
+
templateRepo: HARNESS_TEMPLATE_REPO,
|
|
666
|
+
templateDefaultBranch: "main",
|
|
667
|
+
templateHeadSha: "",
|
|
668
|
+
templateContentId: null,
|
|
669
|
+
message: templatePreview.message,
|
|
670
|
+
recoverable: false,
|
|
671
|
+
willCreateRepository: false,
|
|
672
|
+
tokenCapabilities: {
|
|
673
|
+
tokenType: capabilities.tokenType,
|
|
674
|
+
hasRepoScope: capabilities.hasRepoScope,
|
|
675
|
+
hasWorkflowScope: capabilities.hasWorkflowScope,
|
|
676
|
+
scopeAmbiguous: capabilities.scopeAmbiguous,
|
|
677
|
+
},
|
|
678
|
+
};
|
|
679
|
+
}
|
|
680
|
+
const resolvedOperation = await resolveProvisioningOperation({
|
|
681
|
+
cwd: options.cwd,
|
|
682
|
+
requestedOperationId: options.operationId,
|
|
683
|
+
user,
|
|
684
|
+
templatePreview,
|
|
685
|
+
});
|
|
686
|
+
if (!resolvedOperation.ok) {
|
|
687
|
+
return {
|
|
688
|
+
state: resolvedOperation.state,
|
|
689
|
+
fingerprint: buildFingerprint({
|
|
690
|
+
action: "preview",
|
|
691
|
+
conflict: resolvedOperation.message,
|
|
692
|
+
}),
|
|
693
|
+
operationId: options.operationId ?? randomUUID(),
|
|
694
|
+
creationPreviewFingerprint: null,
|
|
695
|
+
resumedFromPending: false,
|
|
696
|
+
harnessDispatchRepo: null,
|
|
697
|
+
authenticatedLogin: user.login,
|
|
698
|
+
templateOwner: HARNESS_TEMPLATE_OWNER,
|
|
699
|
+
templateRepo: HARNESS_TEMPLATE_REPO,
|
|
700
|
+
templateDefaultBranch: templatePreview.defaultBranch,
|
|
701
|
+
templateHeadSha: templatePreview.headSha,
|
|
702
|
+
templateContentId: templatePreview.identity.identity.templateContentId,
|
|
703
|
+
message: resolvedOperation.message,
|
|
704
|
+
recoverable: true,
|
|
705
|
+
willCreateRepository: false,
|
|
706
|
+
tokenCapabilities: {
|
|
707
|
+
tokenType: capabilities.tokenType,
|
|
708
|
+
hasRepoScope: capabilities.hasRepoScope,
|
|
709
|
+
hasWorkflowScope: capabilities.hasWorkflowScope,
|
|
710
|
+
scopeAmbiguous: capabilities.scopeAmbiguous,
|
|
711
|
+
},
|
|
712
|
+
};
|
|
713
|
+
}
|
|
714
|
+
const { operationId, resumedFromPending, creationPreviewFingerprint, } = resolvedOperation;
|
|
715
|
+
const destination = destinationSlug(user.login);
|
|
716
|
+
const classification = await classifyDestinationRepo(options.provider, user, options.cwd, templatePreview);
|
|
717
|
+
let state = "template-preview-ready";
|
|
718
|
+
let message = `p-dev will create or reconnect ${destination} as your private harness workspace.`;
|
|
719
|
+
let willCreateRepository = false;
|
|
720
|
+
switch (classification.kind) {
|
|
721
|
+
case "absent":
|
|
722
|
+
state = "repo-absent";
|
|
723
|
+
willCreateRepository = true;
|
|
724
|
+
message = `p-dev will create private harness workspace ${destination} from the approved template.`;
|
|
725
|
+
break;
|
|
726
|
+
case "valid-managed":
|
|
727
|
+
state = "valid-existing-managed-repo";
|
|
728
|
+
message = `Reconnecting to existing managed harness workspace ${destination}.`;
|
|
729
|
+
break;
|
|
730
|
+
case "public-collision":
|
|
731
|
+
state = "same-name-public-collision";
|
|
732
|
+
message = `${destination} exists but is not private. p-dev will not change it automatically.`;
|
|
733
|
+
break;
|
|
734
|
+
case "unmanaged-collision":
|
|
735
|
+
state = "same-name-unmanaged-collision";
|
|
736
|
+
message = `${destination} exists without a compatible managed marker.`;
|
|
737
|
+
break;
|
|
738
|
+
case "malformed-marker":
|
|
739
|
+
state = "same-name-malformed-marker";
|
|
740
|
+
message = classification.reason;
|
|
741
|
+
break;
|
|
742
|
+
case "template-only-without-pending":
|
|
743
|
+
state = "same-name-template-only-without-pending";
|
|
744
|
+
message = `${destination} looks like an unmanaged generated repo.`;
|
|
745
|
+
break;
|
|
746
|
+
case "template-only-with-pending":
|
|
747
|
+
state = "same-name-template-only-with-pending";
|
|
748
|
+
message = `Resuming marker finalization for ${destination}.`;
|
|
749
|
+
break;
|
|
750
|
+
}
|
|
751
|
+
const fingerprint = buildProvisioningPreviewFingerprint({
|
|
752
|
+
operationId,
|
|
753
|
+
user,
|
|
754
|
+
destination,
|
|
755
|
+
templatePreview,
|
|
756
|
+
classification: classification.kind,
|
|
757
|
+
envBaseline: existingEnv?.values.GITHUB_DISPATCH_REPOSITORY ?? "",
|
|
758
|
+
pDevVersion,
|
|
759
|
+
resumedFromPending,
|
|
760
|
+
creationPreviewFingerprint,
|
|
761
|
+
});
|
|
762
|
+
return {
|
|
763
|
+
state,
|
|
764
|
+
fingerprint,
|
|
765
|
+
operationId,
|
|
766
|
+
creationPreviewFingerprint,
|
|
767
|
+
resumedFromPending,
|
|
768
|
+
harnessDispatchRepo: classification.kind === "valid-managed" ? destination : null,
|
|
769
|
+
authenticatedLogin: user.login,
|
|
770
|
+
templateOwner: HARNESS_TEMPLATE_OWNER,
|
|
771
|
+
templateRepo: HARNESS_TEMPLATE_REPO,
|
|
772
|
+
templateDefaultBranch: templatePreview.defaultBranch,
|
|
773
|
+
templateHeadSha: templatePreview.headSha,
|
|
774
|
+
templateContentId: templatePreview.identity.identity.templateContentId,
|
|
775
|
+
message,
|
|
776
|
+
recoverable: state === "repo-absent" ||
|
|
777
|
+
state === "valid-existing-managed-repo" ||
|
|
778
|
+
state === "same-name-template-only-with-pending",
|
|
779
|
+
willCreateRepository,
|
|
780
|
+
tokenCapabilities: {
|
|
781
|
+
tokenType: capabilities.tokenType,
|
|
782
|
+
hasRepoScope: capabilities.hasRepoScope,
|
|
783
|
+
hasWorkflowScope: capabilities.hasWorkflowScope,
|
|
784
|
+
scopeAmbiguous: capabilities.scopeAmbiguous,
|
|
785
|
+
},
|
|
786
|
+
};
|
|
787
|
+
}
|
|
788
|
+
export async function applyHarnessRepoProvisioning(options) {
|
|
789
|
+
return withHarnessProvisioningMutex(resolveLocalFilePaths(options.cwd).cwd, async () => applyHarnessRepoProvisioningLocked(options));
|
|
790
|
+
}
|
|
791
|
+
async function applyHarnessRepoProvisioningLocked(options) {
|
|
792
|
+
const preview = await previewHarnessRepoProvisioning({
|
|
793
|
+
cwd: options.cwd,
|
|
794
|
+
provider: options.provider,
|
|
795
|
+
operationId: options.operationId,
|
|
796
|
+
});
|
|
797
|
+
if (!options.confirmed) {
|
|
798
|
+
return {
|
|
799
|
+
state: preview.state,
|
|
800
|
+
harnessDispatchRepo: preview.harnessDispatchRepo,
|
|
801
|
+
message: "Confirmation is required before provisioning.",
|
|
802
|
+
recoverable: true,
|
|
803
|
+
persisted: false,
|
|
804
|
+
};
|
|
805
|
+
}
|
|
806
|
+
if (preview.fingerprint !== options.fingerprint) {
|
|
807
|
+
return {
|
|
808
|
+
state: "template-preview-stale",
|
|
809
|
+
harnessDispatchRepo: preview.harnessDispatchRepo,
|
|
810
|
+
message: "Provisioning preview is stale. Retry Step 1 Continue.",
|
|
811
|
+
recoverable: true,
|
|
812
|
+
persisted: false,
|
|
813
|
+
};
|
|
814
|
+
}
|
|
815
|
+
if (preview.state === "skipped-not-packaged" ||
|
|
816
|
+
preview.state === "token-unsupported" ||
|
|
817
|
+
preview.state === "token-insufficient" ||
|
|
818
|
+
preview.state === "token-scope-ambiguous" ||
|
|
819
|
+
preview.state === "template-unavailable" ||
|
|
820
|
+
preview.state === "template-identity-missing" ||
|
|
821
|
+
preview.state === "template-identity-invalid" ||
|
|
822
|
+
preview.state === "template-incompatible" ||
|
|
823
|
+
preview.state === "same-name-public-collision" ||
|
|
824
|
+
preview.state === "same-name-unmanaged-collision" ||
|
|
825
|
+
preview.state === "same-name-malformed-marker" ||
|
|
826
|
+
preview.state === "same-name-template-only-without-pending" ||
|
|
827
|
+
preview.state === "explicit-packaged-repo-invalid" ||
|
|
828
|
+
preview.state === "explicit-packaged-repo-legacy-source") {
|
|
829
|
+
return {
|
|
830
|
+
state: preview.state,
|
|
831
|
+
harnessDispatchRepo: preview.harnessDispatchRepo,
|
|
832
|
+
message: preview.message,
|
|
833
|
+
recoverable: preview.recoverable,
|
|
834
|
+
persisted: false,
|
|
835
|
+
};
|
|
836
|
+
}
|
|
837
|
+
const user = await options.provider.resolveAuthenticatedUser();
|
|
838
|
+
const pDevVersion = resolveHarnessPackageVersion();
|
|
839
|
+
const paths = resolveLocalFilePaths(options.cwd);
|
|
840
|
+
const existingEnv = await readExistingEnvFile(paths);
|
|
841
|
+
const explicitRepo = existingEnv?.values.GITHUB_DISPATCH_REPOSITORY?.trim();
|
|
842
|
+
let targetRepo = explicitRepo ?? destinationSlug(user.login);
|
|
843
|
+
if (explicitRepo) {
|
|
844
|
+
const explicit = await validateExplicitPackagedRepo(options.provider, explicitRepo, readSavedRepositoryId(existingEnv));
|
|
845
|
+
if (!explicit.ok) {
|
|
846
|
+
return {
|
|
847
|
+
state: explicit.state,
|
|
848
|
+
harnessDispatchRepo: explicitRepo,
|
|
849
|
+
message: explicit.message,
|
|
850
|
+
recoverable: true,
|
|
851
|
+
persisted: false,
|
|
852
|
+
};
|
|
853
|
+
}
|
|
854
|
+
const persist = await persistGithubDispatchRepository({
|
|
855
|
+
cwd: options.cwd,
|
|
856
|
+
githubDispatchRepository: explicit.repoSlug,
|
|
857
|
+
githubDispatchRepositoryId: explicit.repositoryId,
|
|
858
|
+
});
|
|
859
|
+
if (persist.outcome !== "changed" && persist.outcome !== "skipped") {
|
|
860
|
+
return {
|
|
861
|
+
state: "created-but-persistence-failed",
|
|
862
|
+
harnessDispatchRepo: explicit.repoSlug,
|
|
863
|
+
message: persist.reason ?? "Failed to persist GITHUB_DISPATCH_REPOSITORY.",
|
|
864
|
+
recoverable: true,
|
|
865
|
+
persisted: false,
|
|
866
|
+
};
|
|
867
|
+
}
|
|
868
|
+
await clearHarnessProvisioningPendingState(options.cwd);
|
|
869
|
+
return {
|
|
870
|
+
state: "verified-and-persisted",
|
|
871
|
+
harnessDispatchRepo: explicit.repoSlug,
|
|
872
|
+
message: `Connected to saved harness workspace ${explicit.repoSlug}.`,
|
|
873
|
+
recoverable: false,
|
|
874
|
+
persisted: true,
|
|
875
|
+
};
|
|
876
|
+
}
|
|
877
|
+
const templatePreview = await loadTemplatePreview(options.provider);
|
|
878
|
+
if (!templatePreview.ok) {
|
|
879
|
+
return {
|
|
880
|
+
state: templatePreview.state,
|
|
881
|
+
harnessDispatchRepo: null,
|
|
882
|
+
message: templatePreview.message,
|
|
883
|
+
recoverable: false,
|
|
884
|
+
persisted: false,
|
|
885
|
+
};
|
|
886
|
+
}
|
|
887
|
+
const classification = await classifyDestinationRepo(options.provider, user, options.cwd, templatePreview);
|
|
888
|
+
const currentContext = buildHarnessProvisioningPreviewContext({
|
|
889
|
+
operationId: options.operationId,
|
|
890
|
+
user,
|
|
891
|
+
destination: destinationSlug(user.login),
|
|
892
|
+
templateDefaultBranch: templatePreview.defaultBranch,
|
|
893
|
+
templateHeadSha: templatePreview.headSha,
|
|
894
|
+
templateIdentity: templatePreview.identity.identity,
|
|
895
|
+
classification: classification.kind,
|
|
896
|
+
envBaseline: existingEnv?.values.GITHUB_DISPATCH_REPOSITORY ?? "",
|
|
897
|
+
pDevVersion,
|
|
898
|
+
resumedFromPending: preview.resumedFromPending,
|
|
899
|
+
creationPreviewFingerprint: preview.creationPreviewFingerprint,
|
|
900
|
+
});
|
|
901
|
+
const contextValidation = validateSubmittedHarnessProvisioningFingerprint({
|
|
902
|
+
submittedFingerprint: options.fingerprint,
|
|
903
|
+
currentContext,
|
|
904
|
+
});
|
|
905
|
+
if (!contextValidation.ok) {
|
|
906
|
+
return {
|
|
907
|
+
state: "template-preview-stale",
|
|
908
|
+
harnessDispatchRepo: null,
|
|
909
|
+
message: contextValidation.message,
|
|
910
|
+
recoverable: true,
|
|
911
|
+
persisted: false,
|
|
912
|
+
};
|
|
913
|
+
}
|
|
914
|
+
let targetRepositoryId = classification.kind === "valid-managed"
|
|
915
|
+
? classification.repositoryId
|
|
916
|
+
: undefined;
|
|
917
|
+
const pending = await readHarnessProvisioningPendingState(options.cwd);
|
|
918
|
+
if (preview.resumedFromPending) {
|
|
919
|
+
if (!pending || !preview.creationPreviewFingerprint) {
|
|
920
|
+
return {
|
|
921
|
+
state: "same-name-template-only-without-pending",
|
|
922
|
+
harnessDispatchRepo: destinationSlug(user.login),
|
|
923
|
+
message: "Matching local pending provisioning evidence is required to resume.",
|
|
924
|
+
recoverable: true,
|
|
925
|
+
persisted: false,
|
|
926
|
+
};
|
|
927
|
+
}
|
|
928
|
+
const pendingValidation = validatePendingProvisioningState(pending, buildPendingValidationContext({
|
|
929
|
+
operationId: options.operationId,
|
|
930
|
+
authenticatedUserId: user.id,
|
|
931
|
+
authenticatedLogin: user.login,
|
|
932
|
+
targetOwner: user.login,
|
|
933
|
+
targetRepo: HARNESS_DEFAULT_DESTINATION_REPO_NAME,
|
|
934
|
+
templateIdentity: templatePreview.identity.identity.templateIdentity,
|
|
935
|
+
templateVersion: templatePreview.identity.identity.templateVersion,
|
|
936
|
+
compatibilityVersion: templatePreview.identity.identity.compatibilityVersion,
|
|
937
|
+
templateContentId: templatePreview.identity.identity.templateContentId,
|
|
938
|
+
templateDefaultBranch: templatePreview.defaultBranch,
|
|
939
|
+
templateHeadSha: templatePreview.headSha,
|
|
940
|
+
previewFingerprint: preview.creationPreviewFingerprint,
|
|
941
|
+
}));
|
|
942
|
+
if (!pendingValidation.ok) {
|
|
943
|
+
return {
|
|
944
|
+
state: "same-name-unmanaged-collision",
|
|
945
|
+
harnessDispatchRepo: destinationSlug(user.login),
|
|
946
|
+
message: pendingValidation.reason,
|
|
947
|
+
recoverable: true,
|
|
948
|
+
persisted: false,
|
|
949
|
+
};
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
else if (pending &&
|
|
953
|
+
preview.state !== "valid-existing-managed-repo" &&
|
|
954
|
+
classification.kind !== "valid-managed") {
|
|
955
|
+
return {
|
|
956
|
+
state: "concurrent-request-recovered",
|
|
957
|
+
harnessDispatchRepo: null,
|
|
958
|
+
message: "Another provisioning operation is already in progress for this workspace.",
|
|
959
|
+
recoverable: true,
|
|
960
|
+
persisted: false,
|
|
961
|
+
};
|
|
962
|
+
}
|
|
963
|
+
if (classification.kind === "valid-managed") {
|
|
964
|
+
targetRepo = classification.repoSlug;
|
|
965
|
+
}
|
|
966
|
+
else if (classification.kind === "absent" &&
|
|
967
|
+
!preview.resumedFromPending) {
|
|
968
|
+
const creationFingerprint = preview.creationPreviewFingerprint ?? options.fingerprint;
|
|
969
|
+
await writeHarnessProvisioningPendingStateAtomic({
|
|
970
|
+
operationId: options.operationId,
|
|
971
|
+
authenticatedUserId: user.id,
|
|
972
|
+
authenticatedLogin: user.login,
|
|
973
|
+
targetOwner: user.login,
|
|
974
|
+
targetRepo: HARNESS_DEFAULT_DESTINATION_REPO_NAME,
|
|
975
|
+
templateOwner: HARNESS_TEMPLATE_OWNER,
|
|
976
|
+
templateRepo: HARNESS_TEMPLATE_REPO,
|
|
977
|
+
templateIdentity: templatePreview.identity.identity.templateIdentity,
|
|
978
|
+
templateVersion: templatePreview.identity.identity.templateVersion,
|
|
979
|
+
compatibilityVersion: templatePreview.identity.identity.compatibilityVersion,
|
|
980
|
+
templateContentId: templatePreview.identity.identity.templateContentId,
|
|
981
|
+
templateDefaultBranch: templatePreview.defaultBranch,
|
|
982
|
+
templateHeadSha: templatePreview.headSha,
|
|
983
|
+
previewFingerprint: creationFingerprint,
|
|
984
|
+
startedAt: new Date().toISOString(),
|
|
985
|
+
}, options.cwd);
|
|
986
|
+
try {
|
|
987
|
+
const created = await options.provider.createRepositoryFromTemplate({
|
|
988
|
+
templateOwner: HARNESS_TEMPLATE_OWNER,
|
|
989
|
+
templateRepo: HARNESS_TEMPLATE_REPO,
|
|
990
|
+
owner: user.login,
|
|
991
|
+
name: HARNESS_DEFAULT_DESTINATION_REPO_NAME,
|
|
992
|
+
description: HARNESS_DEFAULT_DESTINATION_DESCRIPTION,
|
|
993
|
+
private: true,
|
|
994
|
+
includeAllBranches: false,
|
|
995
|
+
});
|
|
996
|
+
targetRepo = created.fullName;
|
|
997
|
+
targetRepositoryId = created.repositoryId;
|
|
998
|
+
}
|
|
999
|
+
catch (error) {
|
|
1000
|
+
const recovered = await classifyDestinationRepo(options.provider, user, options.cwd, templatePreview);
|
|
1001
|
+
if (recovered.kind === "valid-managed" ||
|
|
1002
|
+
recovered.kind === "template-only-with-pending") {
|
|
1003
|
+
targetRepo = destinationSlug(user.login);
|
|
1004
|
+
}
|
|
1005
|
+
else if (error instanceof GitHubApiError && error.status === 422) {
|
|
1006
|
+
const retryClassification = await classifyDestinationRepo(options.provider, user, options.cwd, templatePreview);
|
|
1007
|
+
if (retryClassification.kind === "absent") {
|
|
1008
|
+
return {
|
|
1009
|
+
state: "api-timeout-unknown",
|
|
1010
|
+
harnessDispatchRepo: destinationSlug(user.login),
|
|
1011
|
+
message: "Repository creation returned an ambiguous result. Retry Step 1 Continue.",
|
|
1012
|
+
recoverable: true,
|
|
1013
|
+
persisted: false,
|
|
1014
|
+
};
|
|
1015
|
+
}
|
|
1016
|
+
targetRepo = destinationSlug(user.login);
|
|
1017
|
+
}
|
|
1018
|
+
else {
|
|
1019
|
+
return {
|
|
1020
|
+
state: "api-timeout-unknown",
|
|
1021
|
+
harnessDispatchRepo: destinationSlug(user.login),
|
|
1022
|
+
message: error instanceof Error
|
|
1023
|
+
? error.message
|
|
1024
|
+
: "Repository creation failed unexpectedly.",
|
|
1025
|
+
recoverable: true,
|
|
1026
|
+
persisted: false,
|
|
1027
|
+
};
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
else if (classification.kind === "template-only-with-pending") {
|
|
1032
|
+
targetRepo = destinationSlug(user.login);
|
|
1033
|
+
}
|
|
1034
|
+
else {
|
|
1035
|
+
return {
|
|
1036
|
+
state: preview.state,
|
|
1037
|
+
harnessDispatchRepo: preview.harnessDispatchRepo,
|
|
1038
|
+
message: preview.message,
|
|
1039
|
+
recoverable: preview.recoverable,
|
|
1040
|
+
persisted: false,
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
const poll = await pollGeneratedRepository(options.provider, targetRepo, templatePreview.identity.identity.templateContentId);
|
|
1044
|
+
if (!poll.ok) {
|
|
1045
|
+
return {
|
|
1046
|
+
state: poll.timedOut ? "api-timeout-unknown" : "repo-created-pending-verification",
|
|
1047
|
+
harnessDispatchRepo: targetRepo,
|
|
1048
|
+
message: poll.message,
|
|
1049
|
+
recoverable: true,
|
|
1050
|
+
persisted: false,
|
|
1051
|
+
};
|
|
1052
|
+
}
|
|
1053
|
+
const resolvedRepositoryId = targetRepositoryId ?? poll.repositoryId;
|
|
1054
|
+
if (targetRepositoryId !== undefined &&
|
|
1055
|
+
targetRepositoryId !== poll.repositoryId) {
|
|
1056
|
+
return {
|
|
1057
|
+
state: "repo-created-pending-verification",
|
|
1058
|
+
harnessDispatchRepo: targetRepo,
|
|
1059
|
+
message: `Generated harness workspace repository ID mismatch for ${targetRepo}.`,
|
|
1060
|
+
recoverable: true,
|
|
1061
|
+
persisted: false,
|
|
1062
|
+
};
|
|
1063
|
+
}
|
|
1064
|
+
const markerResult = await finalizeManagedMarker(options.provider, {
|
|
1065
|
+
repoSlug: targetRepo,
|
|
1066
|
+
repositoryId: resolvedRepositoryId,
|
|
1067
|
+
defaultBranch: poll.defaultBranch,
|
|
1068
|
+
templateIdentity: poll.identity,
|
|
1069
|
+
templateHeadSha: pending?.templateHeadSha ?? templatePreview.headSha,
|
|
1070
|
+
operationId: options.operationId,
|
|
1071
|
+
user,
|
|
1072
|
+
pDevVersion,
|
|
1073
|
+
});
|
|
1074
|
+
if (!markerResult.ok) {
|
|
1075
|
+
return {
|
|
1076
|
+
state: "marker-write-pending",
|
|
1077
|
+
harnessDispatchRepo: targetRepo,
|
|
1078
|
+
message: markerResult.message,
|
|
1079
|
+
recoverable: true,
|
|
1080
|
+
persisted: false,
|
|
1081
|
+
};
|
|
1082
|
+
}
|
|
1083
|
+
const persist = await persistGithubDispatchRepository({
|
|
1084
|
+
cwd: options.cwd,
|
|
1085
|
+
githubDispatchRepository: targetRepo,
|
|
1086
|
+
githubDispatchRepositoryId: resolvedRepositoryId,
|
|
1087
|
+
});
|
|
1088
|
+
if (persist.outcome !== "changed" && persist.outcome !== "skipped") {
|
|
1089
|
+
return {
|
|
1090
|
+
state: "created-but-persistence-failed",
|
|
1091
|
+
harnessDispatchRepo: targetRepo,
|
|
1092
|
+
message: persist.reason ?? "Failed to persist GITHUB_DISPATCH_REPOSITORY.",
|
|
1093
|
+
recoverable: true,
|
|
1094
|
+
persisted: false,
|
|
1095
|
+
};
|
|
1096
|
+
}
|
|
1097
|
+
await clearHarnessProvisioningPendingState(options.cwd);
|
|
1098
|
+
return {
|
|
1099
|
+
state: "verified-and-persisted",
|
|
1100
|
+
harnessDispatchRepo: targetRepo,
|
|
1101
|
+
message: `Private harness workspace ${targetRepo} is connected.`,
|
|
1102
|
+
recoverable: false,
|
|
1103
|
+
persisted: true,
|
|
1104
|
+
};
|
|
1105
|
+
}
|
|
1106
|
+
//# sourceMappingURL=harness-repo-provisioning.js.map
|