agentplane 0.1.9 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/assets/AGENTS.md +281 -70
- package/assets/agents/CODER.json +1 -0
- package/assets/agents/INTEGRATOR.json +1 -0
- package/assets/agents/ORCHESTRATOR.json +1 -0
- package/assets/agents/PLANNER.json +1 -0
- package/assets/agents/TESTER.json +1 -0
- package/dist/backends/task-backend/load.d.ts +13 -0
- package/dist/backends/task-backend/load.d.ts.map +1 -0
- package/dist/backends/task-backend/load.js +58 -0
- package/dist/backends/task-backend/local-backend.d.ts +28 -0
- package/dist/backends/task-backend/local-backend.d.ts.map +1 -0
- package/dist/backends/task-backend/local-backend.js +335 -0
- package/dist/backends/task-backend/redmine/client.d.ts +8 -0
- package/dist/backends/task-backend/redmine/client.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/client.js +60 -0
- package/dist/backends/task-backend/redmine/comments.d.ts +12 -0
- package/dist/backends/task-backend/redmine/comments.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/comments.js +54 -0
- package/dist/backends/task-backend/redmine/fields.d.ts +9 -0
- package/dist/backends/task-backend/redmine/fields.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/fields.js +38 -0
- package/dist/backends/task-backend/redmine/mapping.d.ts +20 -0
- package/dist/backends/task-backend/redmine/mapping.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/mapping.js +114 -0
- package/dist/backends/task-backend/redmine/parse.d.ts +3 -0
- package/dist/backends/task-backend/redmine/parse.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/parse.js +27 -0
- package/dist/backends/task-backend/redmine/remote.d.ts +19 -0
- package/dist/backends/task-backend/redmine/remote.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/remote.js +82 -0
- package/dist/backends/task-backend/redmine-backend.d.ts +80 -0
- package/dist/backends/task-backend/redmine-backend.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine-backend.js +505 -0
- package/dist/backends/task-backend/shared/concurrency.d.ts +3 -0
- package/dist/backends/task-backend/shared/concurrency.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/concurrency.js +21 -0
- package/dist/backends/task-backend/shared/constants.d.ts +4 -0
- package/dist/backends/task-backend/shared/constants.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/constants.js +4 -0
- package/dist/backends/task-backend/shared/doc.d.ts +11 -0
- package/dist/backends/task-backend/shared/doc.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/doc.js +78 -0
- package/dist/backends/task-backend/shared/errors.d.ts +10 -0
- package/dist/backends/task-backend/shared/errors.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/errors.js +18 -0
- package/dist/backends/task-backend/shared/events.d.ts +3 -0
- package/dist/backends/task-backend/shared/events.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/events.js +29 -0
- package/dist/backends/task-backend/shared/export.d.ts +15 -0
- package/dist/backends/task-backend/shared/export.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/export.js +60 -0
- package/dist/backends/task-backend/shared/id.d.ts +13 -0
- package/dist/backends/task-backend/shared/id.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/id.js +17 -0
- package/dist/backends/task-backend/shared/normalize.d.ts +8 -0
- package/dist/backends/task-backend/shared/normalize.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/normalize.js +54 -0
- package/dist/backends/task-backend/shared/record.d.ts +4 -0
- package/dist/backends/task-backend/shared/record.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/record.js +53 -0
- package/dist/backends/task-backend/shared/strings.d.ts +4 -0
- package/dist/backends/task-backend/shared/strings.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/strings.js +21 -0
- package/dist/backends/task-backend/shared/types.d.ts +84 -0
- package/dist/backends/task-backend/shared/types.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/types.js +1 -0
- package/dist/backends/task-backend/shared.d.ts +11 -0
- package/dist/backends/task-backend/shared.d.ts.map +1 -0
- package/dist/backends/task-backend/shared.js +9 -0
- package/dist/backends/task-backend.d.ts +4 -204
- package/dist/backends/task-backend.d.ts.map +1 -1
- package/dist/backends/task-backend.js +4 -1366
- package/dist/backends/task-index.js +2 -2
- package/dist/cli/archive.d.ts +0 -2
- package/dist/cli/archive.d.ts.map +1 -1
- package/dist/cli/archive.js +1 -2
- package/dist/cli/command-guide.d.ts.map +1 -1
- package/dist/cli/command-guide.js +25 -8
- package/dist/cli/parse/lifecycle.d.ts +64 -0
- package/dist/cli/parse/lifecycle.d.ts.map +1 -0
- package/dist/cli/parse/lifecycle.js +280 -0
- package/dist/cli/run-cli/command-catalog.d.ts +16 -0
- package/dist/cli/run-cli/command-catalog.d.ts.map +1 -0
- package/dist/cli/run-cli/command-catalog.js +204 -0
- package/dist/cli/run-cli/commands/config.d.ts +20 -0
- package/dist/cli/run-cli/commands/config.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/config.js +130 -0
- package/dist/cli/run-cli/commands/core.d.ts +14 -0
- package/dist/cli/run-cli/commands/core.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/core.js +144 -0
- package/dist/cli/run-cli/commands/ide.d.ts +13 -0
- package/dist/cli/run-cli/commands/ide.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/ide.js +67 -0
- package/dist/cli/run-cli/commands/init/base-branch.d.ts +9 -0
- package/dist/cli/run-cli/commands/init/base-branch.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/base-branch.js +11 -0
- package/dist/cli/run-cli/commands/init/conflicts.d.ts +11 -0
- package/dist/cli/run-cli/commands/init/conflicts.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/conflicts.js +42 -0
- package/dist/cli/run-cli/commands/init/git.d.ts +8 -0
- package/dist/cli/run-cli/commands/init/git.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/git.js +12 -0
- package/dist/cli/run-cli/commands/init/ide-sync.d.ts +9 -0
- package/dist/cli/run-cli/commands/init/ide-sync.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/ide-sync.js +18 -0
- package/dist/cli/run-cli/commands/init/recipes.d.ts +2 -0
- package/dist/cli/run-cli/commands/init/recipes.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/recipes.js +11 -0
- package/dist/cli/run-cli/commands/init/write-agents.d.ts +11 -0
- package/dist/cli/run-cli/commands/init/write-agents.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/write-agents.js +30 -0
- package/dist/cli/run-cli/commands/init/write-config.d.ts +15 -0
- package/dist/cli/run-cli/commands/init/write-config.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/write-config.js +45 -0
- package/dist/cli/run-cli/commands/init.d.ts +21 -0
- package/dist/cli/run-cli/commands/init.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init.js +332 -0
- package/dist/cli/run-cli/registry.run.d.ts +4 -0
- package/dist/cli/run-cli/registry.run.d.ts.map +1 -0
- package/dist/cli/run-cli/registry.run.js +19 -0
- package/dist/cli/run-cli.d.ts.map +1 -1
- package/dist/cli/run-cli.js +182 -2463
- package/dist/cli/spec/docs-render.d.ts +3 -0
- package/dist/cli/spec/docs-render.d.ts.map +1 -0
- package/dist/cli/spec/docs-render.js +118 -0
- package/dist/cli/spec/errors.d.ts +9 -0
- package/dist/cli/spec/errors.d.ts.map +1 -0
- package/dist/cli/spec/errors.js +18 -0
- package/dist/cli/spec/help-render.d.ts +43 -0
- package/dist/cli/spec/help-render.d.ts.map +1 -0
- package/dist/cli/spec/help-render.js +185 -0
- package/dist/cli/spec/help.d.ts +10 -0
- package/dist/cli/spec/help.d.ts.map +1 -0
- package/dist/cli/spec/help.js +64 -0
- package/dist/cli/spec/parse.d.ts +8 -0
- package/dist/cli/spec/parse.d.ts.map +1 -0
- package/dist/cli/spec/parse.js +188 -0
- package/dist/cli/spec/registry.d.ts +12 -0
- package/dist/cli/spec/registry.d.ts.map +1 -0
- package/dist/cli/spec/registry.js +47 -0
- package/dist/cli/spec/spec.d.ts +76 -0
- package/dist/cli/spec/spec.d.ts.map +1 -0
- package/dist/cli/spec/spec.js +1 -0
- package/dist/cli/spec/suggest.d.ts +2 -0
- package/dist/cli/spec/suggest.d.ts.map +1 -0
- package/dist/cli/spec/suggest.js +45 -0
- package/dist/commands/backend/sync.command.d.ts +12 -0
- package/dist/commands/backend/sync.command.d.ts.map +1 -0
- package/dist/commands/backend/sync.command.js +79 -0
- package/dist/commands/backend.d.ts +21 -8
- package/dist/commands/backend.d.ts.map +1 -1
- package/dist/commands/backend.js +28 -165
- package/dist/commands/block.command.d.ts +19 -0
- package/dist/commands/block.command.d.ts.map +1 -0
- package/dist/commands/block.command.js +143 -0
- package/dist/commands/branch/base.command.d.ts +20 -0
- package/dist/commands/branch/base.command.d.ts.map +1 -0
- package/dist/commands/branch/base.command.js +110 -0
- package/dist/commands/branch/base.d.ts +19 -0
- package/dist/commands/branch/base.d.ts.map +1 -0
- package/dist/commands/branch/base.js +114 -0
- package/dist/commands/branch/cleanup-merged.d.ts +11 -0
- package/dist/commands/branch/cleanup-merged.d.ts.map +1 -0
- package/dist/commands/branch/cleanup-merged.js +141 -0
- package/dist/commands/branch/index.d.ts +6 -59
- package/dist/commands/branch/index.d.ts.map +1 -1
- package/dist/commands/branch/index.js +6 -513
- package/dist/commands/branch/internal/archive-pr.d.ts +2 -0
- package/dist/commands/branch/internal/archive-pr.d.ts.map +1 -0
- package/dist/commands/branch/internal/archive-pr.js +17 -0
- package/dist/commands/branch/internal/work-validate.d.ts +3 -0
- package/dist/commands/branch/internal/work-validate.d.ts.map +1 -0
- package/dist/commands/branch/internal/work-validate.js +27 -0
- package/dist/commands/branch/remove.command.d.ts +10 -0
- package/dist/commands/branch/remove.command.d.ts.map +1 -0
- package/dist/commands/branch/remove.command.js +63 -0
- package/dist/commands/branch/remove.d.ts +9 -0
- package/dist/commands/branch/remove.d.ts.map +1 -0
- package/dist/commands/branch/remove.js +65 -0
- package/dist/commands/branch/status.command.d.ts +8 -0
- package/dist/commands/branch/status.command.d.ts.map +1 -0
- package/dist/commands/branch/status.command.js +36 -0
- package/dist/commands/branch/status.d.ts +7 -0
- package/dist/commands/branch/status.d.ts.map +1 -0
- package/dist/commands/branch/status.js +60 -0
- package/dist/commands/branch/work-start.command.d.ts +11 -0
- package/dist/commands/branch/work-start.command.d.ts.map +1 -0
- package/dist/commands/branch/work-start.command.js +80 -0
- package/dist/commands/branch/work-start.d.ts +11 -0
- package/dist/commands/branch/work-start.d.ts.map +1 -0
- package/dist/commands/branch/work-start.js +120 -0
- package/dist/commands/cleanup/merged.command.d.ts +17 -0
- package/dist/commands/cleanup/merged.command.d.ts.map +1 -0
- package/dist/commands/cleanup/merged.command.js +75 -0
- package/dist/commands/commit.command.d.ts +6 -0
- package/dist/commands/commit.command.d.ts.map +1 -0
- package/dist/commands/commit.command.js +24 -0
- package/dist/commands/commit.spec.d.ts +18 -0
- package/dist/commands/commit.spec.d.ts.map +1 -0
- package/dist/commands/commit.spec.js +119 -0
- package/dist/commands/docs/cli.command.d.ts +9 -0
- package/dist/commands/docs/cli.command.d.ts.map +1 -0
- package/dist/commands/docs/cli.command.js +51 -0
- package/dist/commands/finish.command.d.ts +28 -0
- package/dist/commands/finish.command.d.ts.map +1 -0
- package/dist/commands/finish.command.js +237 -0
- package/dist/commands/guard/clean.command.d.ts +7 -0
- package/dist/commands/guard/clean.command.d.ts.map +1 -0
- package/dist/commands/guard/clean.command.js +14 -0
- package/dist/commands/guard/commit.command.d.ts +19 -0
- package/dist/commands/guard/commit.command.d.ts.map +1 -0
- package/dist/commands/guard/commit.command.js +132 -0
- package/dist/commands/guard/guard.command.d.ts +5 -0
- package/dist/commands/guard/guard.command.d.ts.map +1 -0
- package/dist/commands/guard/guard.command.js +21 -0
- package/dist/commands/guard/impl/allow.d.ts +18 -0
- package/dist/commands/guard/impl/allow.d.ts.map +1 -0
- package/dist/commands/guard/impl/allow.js +77 -0
- package/dist/commands/guard/impl/close-message.d.ts +16 -0
- package/dist/commands/guard/impl/close-message.d.ts.map +1 -0
- package/dist/commands/guard/impl/close-message.js +156 -0
- package/dist/commands/guard/impl/commands.d.ts +32 -0
- package/dist/commands/guard/impl/commands.d.ts.map +1 -0
- package/dist/commands/guard/impl/commands.js +191 -0
- package/dist/commands/guard/impl/comment-commit.d.ts +25 -0
- package/dist/commands/guard/impl/comment-commit.d.ts.map +1 -0
- package/dist/commands/guard/impl/comment-commit.js +137 -0
- package/dist/commands/guard/impl/env.d.ts +10 -0
- package/dist/commands/guard/impl/env.d.ts.map +1 -0
- package/dist/commands/guard/impl/env.js +12 -0
- package/dist/commands/guard/impl/policy.d.ts +19 -0
- package/dist/commands/guard/impl/policy.d.ts.map +1 -0
- package/dist/commands/guard/impl/policy.js +46 -0
- package/dist/commands/guard/index.d.ts +4 -87
- package/dist/commands/guard/index.d.ts.map +1 -1
- package/dist/commands/guard/index.js +4 -481
- package/dist/commands/guard/suggest-allow.command.d.ts +7 -0
- package/dist/commands/guard/suggest-allow.command.d.ts.map +1 -0
- package/dist/commands/guard/suggest-allow.command.js +28 -0
- package/dist/commands/hooks/hooks.command.d.ts +5 -0
- package/dist/commands/hooks/hooks.command.d.ts.map +1 -0
- package/dist/commands/hooks/hooks.command.js +18 -0
- package/dist/commands/hooks/index.d.ts.map +1 -1
- package/dist/commands/hooks/index.js +36 -81
- package/dist/commands/hooks/install.command.d.ts +7 -0
- package/dist/commands/hooks/install.command.d.ts.map +1 -0
- package/dist/commands/hooks/install.command.js +14 -0
- package/dist/commands/hooks/run.command.d.ts +9 -0
- package/dist/commands/hooks/run.command.d.ts.map +1 -0
- package/dist/commands/hooks/run.command.js +39 -0
- package/dist/commands/hooks/uninstall.command.d.ts +7 -0
- package/dist/commands/hooks/uninstall.command.d.ts.map +1 -0
- package/dist/commands/hooks/uninstall.command.js +16 -0
- package/dist/commands/integrate.command.d.ts +14 -0
- package/dist/commands/integrate.command.d.ts.map +1 -0
- package/dist/commands/integrate.command.js +61 -0
- package/dist/commands/pr/check.d.ts +8 -0
- package/dist/commands/pr/check.d.ts.map +1 -0
- package/dist/commands/pr/check.js +78 -0
- package/dist/commands/pr/index.d.ts +5 -45
- package/dist/commands/pr/index.d.ts.map +1 -1
- package/dist/commands/pr/index.js +5 -857
- package/dist/commands/pr/integrate/artifacts.d.ts +14 -0
- package/dist/commands/pr/integrate/artifacts.d.ts.map +1 -0
- package/dist/commands/pr/integrate/artifacts.js +45 -0
- package/dist/commands/pr/integrate/cmd.d.ts +14 -0
- package/dist/commands/pr/integrate/cmd.d.ts.map +1 -0
- package/dist/commands/pr/integrate/cmd.js +150 -0
- package/dist/commands/pr/integrate/internal/finalize.d.ts +25 -0
- package/dist/commands/pr/integrate/internal/finalize.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/finalize.js +86 -0
- package/dist/commands/pr/integrate/internal/merge.d.ts +40 -0
- package/dist/commands/pr/integrate/internal/merge.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/merge.js +138 -0
- package/dist/commands/pr/integrate/internal/prepare.d.ts +33 -0
- package/dist/commands/pr/integrate/internal/prepare.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/prepare.js +142 -0
- package/dist/commands/pr/integrate/internal/worktree.d.ts +14 -0
- package/dist/commands/pr/integrate/internal/worktree.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/worktree.js +51 -0
- package/dist/commands/pr/integrate/verify.d.ts +22 -0
- package/dist/commands/pr/integrate/verify.d.ts.map +1 -0
- package/dist/commands/pr/integrate/verify.js +60 -0
- package/dist/commands/pr/integrate.d.ts +2 -0
- package/dist/commands/pr/integrate.d.ts.map +1 -0
- package/dist/commands/pr/integrate.js +1 -0
- package/dist/commands/pr/internal/pr-paths.d.ts +29 -0
- package/dist/commands/pr/internal/pr-paths.d.ts.map +1 -0
- package/dist/commands/pr/internal/pr-paths.js +38 -0
- package/dist/commands/pr/internal/review-template.d.ts +9 -0
- package/dist/commands/pr/internal/review-template.d.ts.map +1 -0
- package/dist/commands/pr/internal/review-template.js +62 -0
- package/dist/commands/pr/note.d.ts +10 -0
- package/dist/commands/pr/note.d.ts.map +1 -0
- package/dist/commands/pr/note.js +50 -0
- package/dist/commands/pr/open.d.ts +10 -0
- package/dist/commands/pr/open.d.ts.map +1 -0
- package/dist/commands/pr/open.js +80 -0
- package/dist/commands/pr/pr.command.d.ts +33 -0
- package/dist/commands/pr/pr.command.d.ts.map +1 -0
- package/dist/commands/pr/pr.command.js +172 -0
- package/dist/commands/pr/update.d.ts +8 -0
- package/dist/commands/pr/update.d.ts.map +1 -0
- package/dist/commands/pr/update.js +103 -0
- package/dist/commands/ready.command.d.ts +8 -0
- package/dist/commands/ready.command.d.ts.map +1 -0
- package/dist/commands/ready.command.js +28 -0
- package/dist/commands/recipes/cache-prune.command.d.ts +6 -0
- package/dist/commands/recipes/cache-prune.command.d.ts.map +1 -0
- package/dist/commands/recipes/cache-prune.command.js +30 -0
- package/dist/commands/recipes/cache.command.d.ts +6 -0
- package/dist/commands/recipes/cache.command.d.ts.map +1 -0
- package/dist/commands/recipes/cache.command.js +37 -0
- package/dist/commands/recipes/explain.command.d.ts +7 -0
- package/dist/commands/recipes/explain.command.d.ts.map +1 -0
- package/dist/commands/recipes/explain.command.js +10 -0
- package/dist/commands/recipes/impl/apply.d.ts +16 -0
- package/dist/commands/recipes/impl/apply.d.ts.map +1 -0
- package/dist/commands/recipes/impl/apply.js +97 -0
- package/dist/commands/recipes/impl/archive.d.ts +2 -0
- package/dist/commands/recipes/impl/archive.d.ts.map +1 -0
- package/dist/commands/recipes/impl/archive.js +19 -0
- package/dist/commands/recipes/impl/commands/cache-prune.d.ts +7 -0
- package/dist/commands/recipes/impl/commands/cache-prune.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/cache-prune.js +94 -0
- package/dist/commands/recipes/impl/commands/explain.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/explain.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/explain.js +88 -0
- package/dist/commands/recipes/impl/commands/info.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/info.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/info.js +58 -0
- package/dist/commands/recipes/impl/commands/install.d.ts +11 -0
- package/dist/commands/recipes/impl/commands/install.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/install.js +212 -0
- package/dist/commands/recipes/impl/commands/list-remote.d.ts +7 -0
- package/dist/commands/recipes/impl/commands/list-remote.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/list-remote.js +53 -0
- package/dist/commands/recipes/impl/commands/list.d.ts +7 -0
- package/dist/commands/recipes/impl/commands/list.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/list.js +38 -0
- package/dist/commands/recipes/impl/commands/remove.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/remove.js +35 -0
- package/dist/commands/recipes/impl/commands.d.ts +8 -0
- package/dist/commands/recipes/impl/commands.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands.js +7 -0
- package/dist/commands/recipes/impl/constants.d.ts +13 -0
- package/dist/commands/recipes/impl/constants.d.ts.map +1 -0
- package/dist/commands/recipes/impl/constants.js +16 -0
- package/dist/commands/recipes/impl/format.d.ts +2 -0
- package/dist/commands/recipes/impl/format.d.ts.map +1 -0
- package/dist/commands/recipes/impl/format.js +9 -0
- package/dist/commands/recipes/impl/index.d.ts +12 -0
- package/dist/commands/recipes/impl/index.d.ts.map +1 -0
- package/dist/commands/recipes/impl/index.js +150 -0
- package/dist/commands/recipes/impl/installed-recipes.d.ts +4 -0
- package/dist/commands/recipes/impl/installed-recipes.d.ts.map +1 -0
- package/dist/commands/recipes/impl/installed-recipes.js +58 -0
- package/dist/commands/recipes/impl/manifest.d.ts +4 -0
- package/dist/commands/recipes/impl/manifest.d.ts.map +1 -0
- package/dist/commands/recipes/impl/manifest.js +43 -0
- package/dist/commands/recipes/impl/normalize.d.ts +5 -0
- package/dist/commands/recipes/impl/normalize.d.ts.map +1 -0
- package/dist/commands/recipes/impl/normalize.js +50 -0
- package/dist/commands/recipes/impl/paths.d.ts +13 -0
- package/dist/commands/recipes/impl/paths.d.ts.map +1 -0
- package/dist/commands/recipes/impl/paths.js +27 -0
- package/dist/commands/recipes/impl/project.d.ts +8 -0
- package/dist/commands/recipes/impl/project.d.ts.map +1 -0
- package/dist/commands/recipes/impl/project.js +23 -0
- package/dist/commands/recipes/impl/scenario.d.ts +16 -0
- package/dist/commands/recipes/impl/scenario.d.ts.map +1 -0
- package/dist/commands/recipes/impl/scenario.js +128 -0
- package/dist/commands/recipes/impl/types.d.ts +107 -0
- package/dist/commands/recipes/impl/types.d.ts.map +1 -0
- package/dist/commands/recipes/impl/types.js +1 -0
- package/dist/commands/recipes/info.command.d.ts +7 -0
- package/dist/commands/recipes/info.command.d.ts.map +1 -0
- package/dist/commands/recipes/info.command.js +10 -0
- package/dist/commands/recipes/install.command.d.ts +12 -0
- package/dist/commands/recipes/install.command.d.ts.map +1 -0
- package/dist/commands/recipes/install.command.js +161 -0
- package/dist/commands/recipes/list-remote.command.d.ts +6 -0
- package/dist/commands/recipes/list-remote.command.d.ts.map +1 -0
- package/dist/commands/recipes/list-remote.command.js +46 -0
- package/dist/commands/recipes/list.command.d.ts +6 -0
- package/dist/commands/recipes/list.command.d.ts.map +1 -0
- package/dist/commands/recipes/list.command.js +39 -0
- package/dist/commands/recipes/recipes.command.d.ts +6 -0
- package/dist/commands/recipes/recipes.command.d.ts.map +1 -0
- package/dist/commands/recipes/recipes.command.js +45 -0
- package/dist/commands/recipes/remove.command.d.ts +7 -0
- package/dist/commands/recipes/remove.command.d.ts.map +1 -0
- package/dist/commands/recipes/remove.command.js +10 -0
- package/dist/commands/recipes.d.ts +7 -81
- package/dist/commands/recipes.d.ts.map +1 -1
- package/dist/commands/recipes.js +6 -1457
- package/dist/commands/scenario/impl/commands.d.ts +19 -0
- package/dist/commands/scenario/impl/commands.d.ts.map +1 -0
- package/dist/commands/scenario/impl/commands.js +336 -0
- package/dist/commands/scenario/impl/report.d.ts +30 -0
- package/dist/commands/scenario/impl/report.d.ts.map +1 -0
- package/dist/commands/scenario/impl/report.js +99 -0
- package/dist/commands/scenario/info.command.d.ts +8 -0
- package/dist/commands/scenario/info.command.d.ts.map +1 -0
- package/dist/commands/scenario/info.command.js +27 -0
- package/dist/commands/scenario/list.command.d.ts +5 -0
- package/dist/commands/scenario/list.command.d.ts.map +1 -0
- package/dist/commands/scenario/list.command.js +9 -0
- package/dist/commands/scenario/run.command.d.ts +8 -0
- package/dist/commands/scenario/run.command.d.ts.map +1 -0
- package/dist/commands/scenario/run.command.js +27 -0
- package/dist/commands/scenario/scenario.command.d.ts +6 -0
- package/dist/commands/scenario/scenario.command.d.ts.map +1 -0
- package/dist/commands/scenario/scenario.command.js +37 -0
- package/dist/commands/scenario.d.ts +1 -6
- package/dist/commands/scenario.d.ts.map +1 -1
- package/dist/commands/scenario.js +1 -501
- package/dist/commands/shared/git-context.d.ts +23 -0
- package/dist/commands/shared/git-context.d.ts.map +1 -0
- package/dist/commands/shared/git-context.js +140 -0
- package/dist/commands/shared/policy-deny.d.ts +3 -0
- package/dist/commands/shared/policy-deny.d.ts.map +1 -0
- package/dist/commands/shared/policy-deny.js +12 -0
- package/dist/commands/shared/task-backend.d.ts +17 -5
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +34 -5
- package/dist/commands/shared/task-store.d.ts +16 -0
- package/dist/commands/shared/task-store.d.ts.map +1 -0
- package/dist/commands/shared/task-store.js +142 -0
- package/dist/commands/start.command.d.ts +19 -0
- package/dist/commands/start.command.d.ts.map +1 -0
- package/dist/commands/start.command.js +143 -0
- package/dist/commands/sync.command.d.ts +6 -0
- package/dist/commands/sync.command.d.ts.map +1 -0
- package/dist/commands/sync.command.js +57 -0
- package/dist/commands/task/add.command.d.ts +18 -0
- package/dist/commands/task/add.command.d.ts.map +1 -0
- package/dist/commands/task/add.command.js +157 -0
- package/dist/commands/task/add.d.ts +13 -3
- package/dist/commands/task/add.d.ts.map +1 -1
- package/dist/commands/task/add.js +21 -126
- package/dist/commands/task/block.d.ts +2 -2
- package/dist/commands/task/block.d.ts.map +1 -1
- package/dist/commands/task/block.js +13 -9
- package/dist/commands/task/comment.command.d.ts +10 -0
- package/dist/commands/task/comment.command.d.ts.map +1 -0
- package/dist/commands/task/comment.command.js +57 -0
- package/dist/commands/task/comment.d.ts +2 -0
- package/dist/commands/task/comment.d.ts.map +1 -1
- package/dist/commands/task/comment.js +10 -7
- package/dist/commands/task/derive.command.d.ts +13 -0
- package/dist/commands/task/derive.command.d.ts.map +1 -0
- package/dist/commands/task/derive.command.js +94 -0
- package/dist/commands/task/derive.d.ts +13 -0
- package/dist/commands/task/derive.d.ts.map +1 -0
- package/dist/commands/task/derive.js +71 -0
- package/dist/commands/task/doc-set.command.d.ts +12 -0
- package/dist/commands/task/doc-set.command.d.ts.map +1 -0
- package/dist/commands/task/doc-set.command.js +82 -0
- package/dist/commands/task/doc-show.command.d.ts +10 -0
- package/dist/commands/task/doc-show.command.d.ts.map +1 -0
- package/dist/commands/task/doc-show.command.js +54 -0
- package/dist/commands/task/doc.command.d.ts +7 -0
- package/dist/commands/task/doc.command.d.ts.map +1 -0
- package/dist/commands/task/doc.command.js +22 -0
- package/dist/commands/task/doc.d.ts +9 -6
- package/dist/commands/task/doc.d.ts.map +1 -1
- package/dist/commands/task/doc.js +61 -113
- package/dist/commands/task/export.command.d.ts +6 -0
- package/dist/commands/task/export.command.d.ts.map +1 -0
- package/dist/commands/task/export.command.js +17 -0
- package/dist/commands/task/export.d.ts +2 -0
- package/dist/commands/task/export.d.ts.map +1 -1
- package/dist/commands/task/export.js +7 -9
- package/dist/commands/task/finish.d.ts +5 -4
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +50 -17
- package/dist/commands/task/index.d.ts +14 -13
- package/dist/commands/task/index.d.ts.map +1 -1
- package/dist/commands/task/index.js +13 -13
- package/dist/commands/task/lint.command.d.ts +5 -0
- package/dist/commands/task/lint.command.d.ts.map +1 -0
- package/dist/commands/task/lint.command.js +11 -0
- package/dist/commands/task/list.command.d.ts +9 -0
- package/dist/commands/task/list.command.d.ts.map +1 -0
- package/dist/commands/task/list.command.js +68 -0
- package/dist/commands/task/list.d.ts +6 -2
- package/dist/commands/task/list.d.ts.map +1 -1
- package/dist/commands/task/list.js +12 -15
- package/dist/commands/task/migrate-doc.command.d.ts +9 -0
- package/dist/commands/task/migrate-doc.command.d.ts.map +1 -0
- package/dist/commands/task/migrate-doc.command.js +65 -0
- package/dist/commands/task/migrate-doc.d.ts +3 -3
- package/dist/commands/task/migrate-doc.d.ts.map +1 -1
- package/dist/commands/task/migrate-doc.js +40 -47
- package/dist/commands/task/migrate.command.d.ts +10 -0
- package/dist/commands/task/migrate.command.d.ts.map +1 -0
- package/dist/commands/task/migrate.command.js +50 -0
- package/dist/commands/task/migrate.d.ts +5 -1
- package/dist/commands/task/migrate.d.ts.map +1 -1
- package/dist/commands/task/migrate.js +10 -44
- package/dist/commands/task/new.command.d.ts +6 -0
- package/dist/commands/task/new.command.d.ts.map +1 -0
- package/dist/commands/task/new.command.js +13 -0
- package/dist/commands/task/new.d.ts +13 -4
- package/dist/commands/task/new.d.ts.map +1 -1
- package/dist/commands/task/new.js +30 -92
- package/dist/commands/task/new.spec.d.ts +4 -0
- package/dist/commands/task/new.spec.d.ts.map +1 -0
- package/dist/commands/task/new.spec.js +79 -0
- package/dist/commands/task/next.command.d.ts +9 -0
- package/dist/commands/task/next.command.d.ts.map +1 -0
- package/dist/commands/task/next.command.js +89 -0
- package/dist/commands/task/next.d.ts +4 -1
- package/dist/commands/task/next.d.ts.map +1 -1
- package/dist/commands/task/next.js +15 -16
- package/dist/commands/task/normalize.command.d.ts +9 -0
- package/dist/commands/task/normalize.command.d.ts.map +1 -0
- package/dist/commands/task/normalize.command.js +39 -0
- package/dist/commands/task/normalize.d.ts +4 -1
- package/dist/commands/task/normalize.d.ts.map +1 -1
- package/dist/commands/task/normalize.js +18 -31
- package/dist/commands/task/plan-approve.command.d.ts +10 -0
- package/dist/commands/task/plan-approve.command.d.ts.map +1 -0
- package/dist/commands/task/plan-approve.command.js +54 -0
- package/dist/commands/task/plan-reject.command.d.ts +10 -0
- package/dist/commands/task/plan-reject.command.d.ts.map +1 -0
- package/dist/commands/task/plan-reject.command.js +59 -0
- package/dist/commands/task/plan-set.command.d.ts +11 -0
- package/dist/commands/task/plan-set.command.d.ts.map +1 -0
- package/dist/commands/task/plan-set.command.js +76 -0
- package/dist/commands/task/plan.d.ts +23 -10
- package/dist/commands/task/plan.d.ts.map +1 -1
- package/dist/commands/task/plan.js +182 -177
- package/dist/commands/task/ready.d.ts +2 -0
- package/dist/commands/task/ready.d.ts.map +1 -1
- package/dist/commands/task/ready.js +4 -6
- package/dist/commands/task/scaffold.command.d.ts +12 -0
- package/dist/commands/task/scaffold.command.d.ts.map +1 -0
- package/dist/commands/task/scaffold.command.js +73 -0
- package/dist/commands/task/scaffold.d.ts +7 -3
- package/dist/commands/task/scaffold.d.ts.map +1 -1
- package/dist/commands/task/scaffold.js +57 -67
- package/dist/commands/task/scrub.command.d.ts +11 -0
- package/dist/commands/task/scrub.command.d.ts.map +1 -0
- package/dist/commands/task/scrub.command.js +72 -0
- package/dist/commands/task/scrub.d.ts +6 -3
- package/dist/commands/task/scrub.d.ts.map +1 -1
- package/dist/commands/task/scrub.js +12 -68
- package/dist/commands/task/search.command.d.ts +11 -0
- package/dist/commands/task/search.command.d.ts.map +1 -0
- package/dist/commands/task/search.command.js +101 -0
- package/dist/commands/task/search.d.ts +5 -1
- package/dist/commands/task/search.d.ts.map +1 -1
- package/dist/commands/task/search.js +14 -23
- package/dist/commands/task/set-status.command.d.ts +21 -0
- package/dist/commands/task/set-status.command.d.ts.map +1 -0
- package/dist/commands/task/set-status.command.js +171 -0
- package/dist/commands/task/set-status.d.ts +2 -0
- package/dist/commands/task/set-status.d.ts.map +1 -1
- package/dist/commands/task/set-status.js +14 -8
- package/dist/commands/task/shared.d.ts +5 -0
- package/dist/commands/task/shared.d.ts.map +1 -1
- package/dist/commands/task/shared.js +50 -0
- package/dist/commands/task/show.command.d.ts +8 -0
- package/dist/commands/task/show.command.d.ts.map +1 -0
- package/dist/commands/task/show.command.js +19 -0
- package/dist/commands/task/show.d.ts +2 -0
- package/dist/commands/task/show.d.ts.map +1 -1
- package/dist/commands/task/show.js +5 -7
- package/dist/commands/task/start.d.ts +2 -2
- package/dist/commands/task/start.d.ts.map +1 -1
- package/dist/commands/task/start.js +48 -11
- package/dist/commands/task/update.command.d.ts +18 -0
- package/dist/commands/task/update.command.d.ts.map +1 -0
- package/dist/commands/task/update.command.js +141 -0
- package/dist/commands/task/update.d.ts +13 -3
- package/dist/commands/task/update.d.ts.map +1 -1
- package/dist/commands/task/update.js +31 -122
- package/dist/commands/task/verify-ok.command.d.ts +13 -0
- package/dist/commands/task/verify-ok.command.d.ts.map +1 -0
- package/dist/commands/task/verify-ok.command.js +83 -0
- package/dist/commands/task/verify-record.d.ts +30 -8
- package/dist/commands/task/verify-record.d.ts.map +1 -1
- package/dist/commands/task/verify-record.js +107 -117
- package/dist/commands/task/verify-rework.command.d.ts +13 -0
- package/dist/commands/task/verify-rework.command.d.ts.map +1 -0
- package/dist/commands/task/verify-rework.command.js +83 -0
- package/dist/commands/task/verify-show.command.d.ts +9 -0
- package/dist/commands/task/verify-show.command.d.ts.map +1 -0
- package/dist/commands/task/verify-show.command.js +38 -0
- package/dist/commands/task/verify.command.d.ts +7 -0
- package/dist/commands/task/verify.command.d.ts.map +1 -0
- package/dist/commands/task/verify.command.js +20 -0
- package/dist/commands/upgrade.command.d.ts +6 -0
- package/dist/commands/upgrade.command.d.ts.map +1 -0
- package/dist/commands/upgrade.command.js +104 -0
- package/dist/commands/upgrade.d.ts +13 -2
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +12 -80
- package/dist/commands/verify.command.d.ts +16 -0
- package/dist/commands/verify.command.d.ts.map +1 -0
- package/dist/commands/verify.command.js +113 -0
- package/dist/commands/workflow.d.ts +4 -6
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +4 -7
- package/dist/meta/release.d.ts +2 -0
- package/dist/meta/release.d.ts.map +1 -0
- package/dist/meta/release.js +50 -0
- package/dist/policy/evaluate.d.ts +3 -0
- package/dist/policy/evaluate.d.ts.map +1 -0
- package/dist/policy/evaluate.js +27 -0
- package/dist/policy/result.d.ts +7 -0
- package/dist/policy/result.d.ts.map +1 -0
- package/dist/policy/result.js +21 -0
- package/dist/policy/rules/allowlist.d.ts +3 -0
- package/dist/policy/rules/allowlist.d.ts.map +1 -0
- package/dist/policy/rules/allowlist.js +30 -0
- package/dist/policy/rules/branch-pr-base.d.ts +3 -0
- package/dist/policy/rules/branch-pr-base.d.ts.map +1 -0
- package/dist/policy/rules/branch-pr-base.js +43 -0
- package/dist/policy/rules/clean-tree.d.ts +3 -0
- package/dist/policy/rules/clean-tree.d.ts.map +1 -0
- package/dist/policy/rules/clean-tree.js +19 -0
- package/dist/policy/rules/commit-subject.d.ts +3 -0
- package/dist/policy/rules/commit-subject.d.ts.map +1 -0
- package/dist/policy/rules/commit-subject.js +33 -0
- package/dist/policy/rules/protected-paths.d.ts +3 -0
- package/dist/policy/rules/protected-paths.d.ts.map +1 -0
- package/dist/policy/rules/protected-paths.js +53 -0
- package/dist/policy/types.d.ts +38 -0
- package/dist/policy/types.d.ts.map +1 -0
- package/dist/policy/types.js +1 -0
- package/dist/shared/write-if-changed.d.ts +3 -0
- package/dist/shared/write-if-changed.d.ts.map +1 -0
- package/dist/shared/write-if-changed.js +25 -0
- package/package.json +2 -2
- package/dist/cli/help.d.ts +0 -2
- package/dist/cli/help.d.ts.map +0 -1
- package/dist/cli/help.js +0 -127
- package/dist/commands/task/verify.d.ts +0 -2
- package/dist/commands/task/verify.d.ts.map +0 -1
- package/dist/commands/task/verify.js +0 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CommandContext } from "../../shared/task-backend.js";
|
|
2
|
+
export declare function readAndValidatePrArtifacts(opts: {
|
|
3
|
+
ctx: CommandContext;
|
|
4
|
+
resolved: {
|
|
5
|
+
gitRoot: string;
|
|
6
|
+
};
|
|
7
|
+
prDir: string;
|
|
8
|
+
metaPath: string;
|
|
9
|
+
branch: string;
|
|
10
|
+
taskId: string;
|
|
11
|
+
}): Promise<{
|
|
12
|
+
verifyLogText: string | null;
|
|
13
|
+
}>;
|
|
14
|
+
//# sourceMappingURL=artifacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../../../src/commands/pr/integrate/artifacts.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAWnE,wBAAsB,0BAA0B,CAAC,IAAI,EAAE;IACrD,GAAG,EAAE,cAAc,CAAC;IACpB,QAAQ,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC;IACV,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,CAAC,CA0CD"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { CliError } from "../../../shared/errors.js";
|
|
3
|
+
import { readPrArtifact } from "../internal/pr-paths.js";
|
|
4
|
+
import { validateReviewContents } from "../internal/review-template.js";
|
|
5
|
+
export async function readAndValidatePrArtifacts(opts) {
|
|
6
|
+
const readPrArtifactTyped = readPrArtifact;
|
|
7
|
+
const { prDir } = opts;
|
|
8
|
+
const diffstatPath = path.join(prDir, "diffstat.txt");
|
|
9
|
+
const verifyLogPath = path.join(prDir, "verify.log");
|
|
10
|
+
const reviewPath = path.join(prDir, "review.md");
|
|
11
|
+
const errors = [];
|
|
12
|
+
const relDiffstat = path.relative(opts.resolved.gitRoot, diffstatPath);
|
|
13
|
+
const relVerifyLog = path.relative(opts.resolved.gitRoot, verifyLogPath);
|
|
14
|
+
const relReview = path.relative(opts.resolved.gitRoot, reviewPath);
|
|
15
|
+
const diffstatText = await readPrArtifactTyped({
|
|
16
|
+
resolved: opts.resolved,
|
|
17
|
+
prDir,
|
|
18
|
+
fileName: "diffstat.txt",
|
|
19
|
+
branch: opts.branch,
|
|
20
|
+
});
|
|
21
|
+
if (diffstatText === null)
|
|
22
|
+
errors.push(`Missing ${relDiffstat}`);
|
|
23
|
+
const verifyLogText = await readPrArtifactTyped({
|
|
24
|
+
resolved: opts.resolved,
|
|
25
|
+
prDir,
|
|
26
|
+
fileName: "verify.log",
|
|
27
|
+
branch: opts.branch,
|
|
28
|
+
});
|
|
29
|
+
if (verifyLogText === null)
|
|
30
|
+
errors.push(`Missing ${relVerifyLog}`);
|
|
31
|
+
const reviewText = await readPrArtifactTyped({
|
|
32
|
+
resolved: opts.resolved,
|
|
33
|
+
prDir,
|
|
34
|
+
fileName: "review.md",
|
|
35
|
+
branch: opts.branch,
|
|
36
|
+
});
|
|
37
|
+
if (reviewText === null)
|
|
38
|
+
errors.push(`Missing ${relReview}`);
|
|
39
|
+
if (reviewText)
|
|
40
|
+
validateReviewContents(reviewText, errors);
|
|
41
|
+
if (errors.length > 0) {
|
|
42
|
+
throw new CliError({ exitCode: 3, code: "E_VALIDATION", message: errors.join("\n") });
|
|
43
|
+
}
|
|
44
|
+
return { verifyLogText };
|
|
45
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CommandContext } from "../../shared/task-backend.js";
|
|
2
|
+
export declare function cmdIntegrate(opts: {
|
|
3
|
+
ctx?: CommandContext;
|
|
4
|
+
cwd: string;
|
|
5
|
+
rootOverride?: string;
|
|
6
|
+
taskId: string;
|
|
7
|
+
branch?: string;
|
|
8
|
+
base?: string;
|
|
9
|
+
mergeStrategy: "squash" | "merge" | "rebase";
|
|
10
|
+
runVerify: boolean;
|
|
11
|
+
dryRun: boolean;
|
|
12
|
+
quiet: boolean;
|
|
13
|
+
}): Promise<number>;
|
|
14
|
+
//# sourceMappingURL=cmd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cmd.d.ts","sourceRoot":"","sources":["../../../../src/commands/pr/integrate/cmd.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAQnE,wBAAsB,YAAY,CAAC,IAAI,EAAE;IACvC,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC7C,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAqKlB"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { mapBackendError } from "../../../cli/error-map.js";
|
|
2
|
+
import { successMessage } from "../../../cli/output.js";
|
|
3
|
+
import { CliError } from "../../../shared/errors.js";
|
|
4
|
+
import { execFileAsync, gitEnv } from "../../shared/git.js";
|
|
5
|
+
import { gitRevParse } from "../../shared/git-ops.js";
|
|
6
|
+
import { finalizeIntegrate } from "./internal/finalize.js";
|
|
7
|
+
import { runMergeCommit, runRebaseFastForward, runSquashMerge } from "./internal/merge.js";
|
|
8
|
+
import { prepareIntegrate } from "./internal/prepare.js";
|
|
9
|
+
import { resolveWorktreeForIntegrate } from "./internal/worktree.js";
|
|
10
|
+
import { runVerifyCommands } from "./verify.js";
|
|
11
|
+
export async function cmdIntegrate(opts) {
|
|
12
|
+
let tempWorktreePath = null;
|
|
13
|
+
let createdTempWorktree = false;
|
|
14
|
+
try {
|
|
15
|
+
const prepared = await prepareIntegrate({
|
|
16
|
+
ctx: opts.ctx,
|
|
17
|
+
cwd: opts.cwd,
|
|
18
|
+
rootOverride: opts.rootOverride,
|
|
19
|
+
taskId: opts.taskId,
|
|
20
|
+
branch: opts.branch,
|
|
21
|
+
base: opts.base,
|
|
22
|
+
runVerify: opts.runVerify,
|
|
23
|
+
});
|
|
24
|
+
const { resolved, loadedConfig, task, prDir, metaPath, diffstatPath, verifyLogPath, metaSource, branch, base, verifyLogText, } = prepared;
|
|
25
|
+
const verifyCommands = prepared.verifyCommands;
|
|
26
|
+
let alreadyVerifiedSha = prepared.alreadyVerifiedSha;
|
|
27
|
+
let shouldRunVerify = prepared.shouldRunVerify;
|
|
28
|
+
let branchHeadSha = prepared.branchHeadSha;
|
|
29
|
+
if (opts.dryRun) {
|
|
30
|
+
if (!opts.quiet) {
|
|
31
|
+
process.stdout.write(`${successMessage("integrate dry-run", task.id, `base=${base} branch=${branch} verify=${shouldRunVerify ? "yes" : "no"}`)}\n`);
|
|
32
|
+
}
|
|
33
|
+
return 0;
|
|
34
|
+
}
|
|
35
|
+
const wt = await resolveWorktreeForIntegrate({
|
|
36
|
+
gitRoot: resolved.gitRoot,
|
|
37
|
+
worktreesDirRel: loadedConfig.paths.worktrees_dir,
|
|
38
|
+
branch,
|
|
39
|
+
taskId: task.id,
|
|
40
|
+
mergeStrategy: opts.mergeStrategy,
|
|
41
|
+
shouldRunVerify,
|
|
42
|
+
});
|
|
43
|
+
let worktreePath = wt.worktreePath;
|
|
44
|
+
tempWorktreePath = wt.tempWorktreePath;
|
|
45
|
+
createdTempWorktree = wt.createdTempWorktree;
|
|
46
|
+
const verifyEntries = [];
|
|
47
|
+
if (opts.mergeStrategy !== "rebase" && shouldRunVerify && verifyCommands.length > 0) {
|
|
48
|
+
if (!worktreePath) {
|
|
49
|
+
throw new CliError({
|
|
50
|
+
exitCode: 2,
|
|
51
|
+
code: "E_USAGE",
|
|
52
|
+
message: "Unable to locate or create a worktree for verify execution",
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
verifyEntries.push(...(await runVerifyCommands({
|
|
56
|
+
commands: verifyCommands,
|
|
57
|
+
worktreePath,
|
|
58
|
+
branchHeadSha,
|
|
59
|
+
quiet: opts.quiet,
|
|
60
|
+
taskId: task.id,
|
|
61
|
+
})));
|
|
62
|
+
}
|
|
63
|
+
const baseShaBeforeMerge = await gitRevParse(resolved.gitRoot, [base]);
|
|
64
|
+
const headBeforeMerge = await gitRevParse(resolved.gitRoot, ["HEAD"]);
|
|
65
|
+
let mergeHash = "";
|
|
66
|
+
if (opts.mergeStrategy === "squash") {
|
|
67
|
+
mergeHash = await runSquashMerge({
|
|
68
|
+
gitRoot: resolved.gitRoot,
|
|
69
|
+
base,
|
|
70
|
+
branch,
|
|
71
|
+
headBeforeMerge,
|
|
72
|
+
taskId: task.id,
|
|
73
|
+
genericTokens: loadedConfig.commit.generic_tokens,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
else if (opts.mergeStrategy === "merge") {
|
|
77
|
+
mergeHash = await runMergeCommit({ gitRoot: resolved.gitRoot, branch, taskId: task.id });
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
if (!worktreePath) {
|
|
81
|
+
throw new CliError({
|
|
82
|
+
exitCode: 2,
|
|
83
|
+
code: "E_USAGE",
|
|
84
|
+
message: "rebase strategy requires an existing worktree for the task branch",
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
const rebaseRes = await runRebaseFastForward({
|
|
88
|
+
gitRoot: resolved.gitRoot,
|
|
89
|
+
worktreePath,
|
|
90
|
+
base,
|
|
91
|
+
branch,
|
|
92
|
+
headBeforeMerge,
|
|
93
|
+
rawVerify: task.verify,
|
|
94
|
+
metaSource: metaSource ?? null,
|
|
95
|
+
verifyLogText,
|
|
96
|
+
runVerify: opts.runVerify,
|
|
97
|
+
verifyCommands,
|
|
98
|
+
alreadyVerifiedSha,
|
|
99
|
+
shouldRunVerify,
|
|
100
|
+
quiet: opts.quiet,
|
|
101
|
+
taskId: task.id,
|
|
102
|
+
});
|
|
103
|
+
mergeHash = rebaseRes.mergeHash;
|
|
104
|
+
branchHeadSha = rebaseRes.branchHeadSha;
|
|
105
|
+
alreadyVerifiedSha = rebaseRes.alreadyVerifiedSha;
|
|
106
|
+
shouldRunVerify = rebaseRes.shouldRunVerify;
|
|
107
|
+
verifyEntries.push(...rebaseRes.verifyEntries);
|
|
108
|
+
}
|
|
109
|
+
await finalizeIntegrate({
|
|
110
|
+
cwd: opts.cwd,
|
|
111
|
+
rootOverride: opts.rootOverride,
|
|
112
|
+
gitRoot: resolved.gitRoot,
|
|
113
|
+
prDir,
|
|
114
|
+
metaPath,
|
|
115
|
+
diffstatPath,
|
|
116
|
+
verifyLogPath,
|
|
117
|
+
taskId: task.id,
|
|
118
|
+
branch,
|
|
119
|
+
base,
|
|
120
|
+
mergeStrategy: opts.mergeStrategy,
|
|
121
|
+
mergeHash,
|
|
122
|
+
branchHeadSha,
|
|
123
|
+
baseShaBeforeMerge,
|
|
124
|
+
verifyEntries,
|
|
125
|
+
verifyCommands,
|
|
126
|
+
alreadyVerifiedSha,
|
|
127
|
+
shouldRunVerify,
|
|
128
|
+
quiet: opts.quiet,
|
|
129
|
+
});
|
|
130
|
+
return 0;
|
|
131
|
+
}
|
|
132
|
+
catch (err) {
|
|
133
|
+
if (err instanceof CliError)
|
|
134
|
+
throw err;
|
|
135
|
+
throw mapBackendError(err, { command: "integrate", root: opts.rootOverride ?? null });
|
|
136
|
+
}
|
|
137
|
+
finally {
|
|
138
|
+
if (createdTempWorktree && tempWorktreePath) {
|
|
139
|
+
try {
|
|
140
|
+
await execFileAsync("git", ["worktree", "remove", "--force", tempWorktreePath], {
|
|
141
|
+
cwd: opts.cwd,
|
|
142
|
+
env: gitEnv(),
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
// ignore cleanup errors
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare function finalizeIntegrate(opts: {
|
|
2
|
+
cwd: string;
|
|
3
|
+
rootOverride?: string;
|
|
4
|
+
gitRoot: string;
|
|
5
|
+
prDir: string;
|
|
6
|
+
metaPath: string;
|
|
7
|
+
diffstatPath: string;
|
|
8
|
+
verifyLogPath: string;
|
|
9
|
+
taskId: string;
|
|
10
|
+
branch: string;
|
|
11
|
+
base: string;
|
|
12
|
+
mergeStrategy: "squash" | "merge" | "rebase";
|
|
13
|
+
mergeHash: string;
|
|
14
|
+
branchHeadSha: string;
|
|
15
|
+
baseShaBeforeMerge: string;
|
|
16
|
+
verifyEntries: {
|
|
17
|
+
header: string;
|
|
18
|
+
content: string;
|
|
19
|
+
}[];
|
|
20
|
+
verifyCommands: string[];
|
|
21
|
+
alreadyVerifiedSha: string | null;
|
|
22
|
+
shouldRunVerify: boolean;
|
|
23
|
+
quiet: boolean;
|
|
24
|
+
}): Promise<void>;
|
|
25
|
+
//# sourceMappingURL=finalize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"finalize.d.ts","sourceRoot":"","sources":["../../../../../src/commands/pr/integrate/internal/finalize.ts"],"names":[],"mappings":"AAmBA,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IAEf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;IAE3B,aAAa,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACrD,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,eAAe,EAAE,OAAO,CAAC;IAEzB,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsFhB"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import { fileExists } from "../../../../cli/fs-utils.js";
|
|
4
|
+
import { successMessage } from "../../../../cli/output.js";
|
|
5
|
+
import { CliError } from "../../../../shared/errors.js";
|
|
6
|
+
import { writeJsonStableIfChanged, writeTextIfChanged, } from "../../../../shared/write-if-changed.js";
|
|
7
|
+
import { gitDiffStat } from "../../../shared/git-diff.js";
|
|
8
|
+
import { appendVerifyLog, parsePrMeta } from "../../../shared/pr-meta.js";
|
|
9
|
+
import { cmdFinish } from "../../../task/index.js";
|
|
10
|
+
function nowIso() {
|
|
11
|
+
return new Date().toISOString();
|
|
12
|
+
}
|
|
13
|
+
export async function finalizeIntegrate(opts) {
|
|
14
|
+
if (!(await fileExists(opts.prDir))) {
|
|
15
|
+
throw new CliError({
|
|
16
|
+
exitCode: 3,
|
|
17
|
+
code: "E_VALIDATION",
|
|
18
|
+
message: `Missing PR artifact dir after merge: ${path.relative(opts.gitRoot, opts.prDir)}`,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
if (opts.verifyEntries.length > 0) {
|
|
22
|
+
for (const entry of opts.verifyEntries) {
|
|
23
|
+
await appendVerifyLog(opts.verifyLogPath, entry.header, entry.content);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const rawMeta = await readFile(opts.metaPath, "utf8");
|
|
27
|
+
const mergedMeta = parsePrMeta(rawMeta, opts.taskId);
|
|
28
|
+
const now = nowIso();
|
|
29
|
+
const nextMeta = {
|
|
30
|
+
...mergedMeta,
|
|
31
|
+
branch: opts.branch,
|
|
32
|
+
base: opts.base,
|
|
33
|
+
merge_strategy: opts.mergeStrategy,
|
|
34
|
+
status: "MERGED",
|
|
35
|
+
merged_at: mergedMeta.merged_at ?? now,
|
|
36
|
+
merge_commit: opts.mergeHash,
|
|
37
|
+
head_sha: opts.branchHeadSha,
|
|
38
|
+
updated_at: now,
|
|
39
|
+
};
|
|
40
|
+
if (opts.verifyCommands.length > 0 && (opts.shouldRunVerify || opts.alreadyVerifiedSha)) {
|
|
41
|
+
nextMeta.last_verified_sha = opts.branchHeadSha;
|
|
42
|
+
nextMeta.last_verified_at = now;
|
|
43
|
+
nextMeta.verify = mergedMeta.verify
|
|
44
|
+
? { ...mergedMeta.verify, status: "pass" }
|
|
45
|
+
: { status: "pass", command: opts.verifyCommands.join(" && ") };
|
|
46
|
+
}
|
|
47
|
+
await writeJsonStableIfChanged(opts.metaPath, nextMeta);
|
|
48
|
+
const diffstat = await gitDiffStat(opts.gitRoot, opts.baseShaBeforeMerge, opts.branch);
|
|
49
|
+
await writeTextIfChanged(opts.diffstatPath, diffstat ? `${diffstat}\n` : "");
|
|
50
|
+
const verifyDesc = opts.verifyCommands.length === 0
|
|
51
|
+
? "skipped(no commands)"
|
|
52
|
+
: opts.shouldRunVerify
|
|
53
|
+
? "ran"
|
|
54
|
+
: opts.alreadyVerifiedSha
|
|
55
|
+
? `skipped(already verified_sha=${opts.alreadyVerifiedSha})`
|
|
56
|
+
: "skipped";
|
|
57
|
+
const finishBody = `Verified: Integrated via ${opts.mergeStrategy}; verify=${verifyDesc}; pr=${path.relative(opts.gitRoot, opts.prDir)}.`;
|
|
58
|
+
await cmdFinish({
|
|
59
|
+
cwd: opts.cwd,
|
|
60
|
+
rootOverride: opts.rootOverride,
|
|
61
|
+
taskIds: [opts.taskId],
|
|
62
|
+
author: "INTEGRATOR",
|
|
63
|
+
body: finishBody,
|
|
64
|
+
result: `integrate: ${opts.mergeStrategy} ${opts.branch}`,
|
|
65
|
+
risk: undefined,
|
|
66
|
+
breaking: false,
|
|
67
|
+
commit: undefined,
|
|
68
|
+
force: false,
|
|
69
|
+
commitFromComment: false,
|
|
70
|
+
commitEmoji: undefined,
|
|
71
|
+
commitAllow: [],
|
|
72
|
+
commitAutoAllow: false,
|
|
73
|
+
commitAllowTasks: false,
|
|
74
|
+
commitRequireClean: false,
|
|
75
|
+
statusCommit: false,
|
|
76
|
+
statusCommitEmoji: undefined,
|
|
77
|
+
statusCommitAllow: [],
|
|
78
|
+
statusCommitAutoAllow: false,
|
|
79
|
+
statusCommitRequireClean: false,
|
|
80
|
+
confirmStatusCommit: false,
|
|
81
|
+
quiet: opts.quiet,
|
|
82
|
+
});
|
|
83
|
+
if (!opts.quiet) {
|
|
84
|
+
process.stdout.write(`${successMessage("integrate", opts.taskId, `merge=${opts.mergeHash.slice(0, 12)}`)}\n`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { PrMeta } from "../../../shared/pr-meta.js";
|
|
2
|
+
export declare function runSquashMerge(opts: {
|
|
3
|
+
gitRoot: string;
|
|
4
|
+
base: string;
|
|
5
|
+
branch: string;
|
|
6
|
+
headBeforeMerge: string;
|
|
7
|
+
taskId: string;
|
|
8
|
+
genericTokens: string[];
|
|
9
|
+
}): Promise<string>;
|
|
10
|
+
export declare function runMergeCommit(opts: {
|
|
11
|
+
gitRoot: string;
|
|
12
|
+
branch: string;
|
|
13
|
+
taskId: string;
|
|
14
|
+
}): Promise<string>;
|
|
15
|
+
export declare function runRebaseFastForward(opts: {
|
|
16
|
+
gitRoot: string;
|
|
17
|
+
worktreePath: string;
|
|
18
|
+
base: string;
|
|
19
|
+
branch: string;
|
|
20
|
+
headBeforeMerge: string;
|
|
21
|
+
rawVerify: string[];
|
|
22
|
+
metaSource: PrMeta | null;
|
|
23
|
+
verifyLogText: string;
|
|
24
|
+
runVerify: boolean;
|
|
25
|
+
verifyCommands: string[];
|
|
26
|
+
alreadyVerifiedSha: string | null;
|
|
27
|
+
shouldRunVerify: boolean;
|
|
28
|
+
quiet: boolean;
|
|
29
|
+
taskId: string;
|
|
30
|
+
}): Promise<{
|
|
31
|
+
mergeHash: string;
|
|
32
|
+
branchHeadSha: string;
|
|
33
|
+
verifyEntries: {
|
|
34
|
+
header: string;
|
|
35
|
+
content: string;
|
|
36
|
+
}[];
|
|
37
|
+
alreadyVerifiedSha: string | null;
|
|
38
|
+
shouldRunVerify: boolean;
|
|
39
|
+
}>;
|
|
40
|
+
//# sourceMappingURL=merge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../../../../src/commands/pr/integrate/internal/merge.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAIzD,wBAAsB,cAAc,CAAC,IAAI,EAAE;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB,GAAG,OAAO,CAAC,MAAM,CAAC,CAuElB;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAoBlB;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,eAAe,EAAE,OAAO,CAAC;IACzB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC;IACV,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACrD,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC,CAsDD"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { extractTaskSuffix, validateCommitSubject } from "@agentplaneorg/core";
|
|
2
|
+
import { CliError } from "../../../../shared/errors.js";
|
|
3
|
+
import { execFileAsync, gitEnv } from "../../../shared/git.js";
|
|
4
|
+
import { gitRevParse } from "../../../shared/git-ops.js";
|
|
5
|
+
import { computeVerifyState, runVerifyCommands } from "../verify.js";
|
|
6
|
+
export async function runSquashMerge(opts) {
|
|
7
|
+
try {
|
|
8
|
+
await execFileAsync("git", ["merge", "--squash", opts.branch], {
|
|
9
|
+
cwd: opts.gitRoot,
|
|
10
|
+
env: gitEnv(),
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
catch (err) {
|
|
14
|
+
await execFileAsync("git", ["reset", "--hard", opts.headBeforeMerge], {
|
|
15
|
+
cwd: opts.gitRoot,
|
|
16
|
+
env: gitEnv(),
|
|
17
|
+
});
|
|
18
|
+
const message = err instanceof Error ? err.message : "git merge --squash failed";
|
|
19
|
+
throw new CliError({ exitCode: 2, code: "E_GIT", message });
|
|
20
|
+
}
|
|
21
|
+
const { stdout: staged } = await execFileAsync("git", ["diff", "--cached", "--name-only"], {
|
|
22
|
+
cwd: opts.gitRoot,
|
|
23
|
+
env: gitEnv(),
|
|
24
|
+
});
|
|
25
|
+
if (!staged.trim()) {
|
|
26
|
+
await execFileAsync("git", ["reset", "--hard", opts.headBeforeMerge], {
|
|
27
|
+
cwd: opts.gitRoot,
|
|
28
|
+
env: gitEnv(),
|
|
29
|
+
});
|
|
30
|
+
throw new CliError({
|
|
31
|
+
exitCode: 2,
|
|
32
|
+
code: "E_USAGE",
|
|
33
|
+
message: `Nothing to integrate: ${opts.branch} is already merged into ${opts.base}`,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
const { stdout: subjectOut } = await execFileAsync("git", ["log", "-1", "--pretty=format:%s", opts.branch], {
|
|
37
|
+
cwd: opts.gitRoot,
|
|
38
|
+
env: gitEnv(),
|
|
39
|
+
});
|
|
40
|
+
let subject = subjectOut.trim();
|
|
41
|
+
const subjectPolicy = validateCommitSubject({
|
|
42
|
+
subject,
|
|
43
|
+
taskId: opts.taskId,
|
|
44
|
+
genericTokens: opts.genericTokens,
|
|
45
|
+
});
|
|
46
|
+
if (!subjectPolicy.ok) {
|
|
47
|
+
const suffix = extractTaskSuffix(opts.taskId);
|
|
48
|
+
subject = `🧩 ${suffix} integrate: squash ${opts.branch}`;
|
|
49
|
+
}
|
|
50
|
+
const env = {
|
|
51
|
+
...process.env,
|
|
52
|
+
AGENTPLANE_TASK_ID: opts.taskId,
|
|
53
|
+
AGENTPLANE_ALLOW_BASE: "1",
|
|
54
|
+
AGENTPLANE_ALLOW_TASKS: "0",
|
|
55
|
+
};
|
|
56
|
+
try {
|
|
57
|
+
await execFileAsync("git", ["commit", "-m", subject], {
|
|
58
|
+
cwd: opts.gitRoot,
|
|
59
|
+
env,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
catch (err) {
|
|
63
|
+
await execFileAsync("git", ["reset", "--hard", opts.headBeforeMerge], {
|
|
64
|
+
cwd: opts.gitRoot,
|
|
65
|
+
env: gitEnv(),
|
|
66
|
+
});
|
|
67
|
+
const message = err instanceof Error ? err.message : "git commit failed";
|
|
68
|
+
throw new CliError({ exitCode: 2, code: "E_GIT", message });
|
|
69
|
+
}
|
|
70
|
+
return await gitRevParse(opts.gitRoot, ["HEAD"]);
|
|
71
|
+
}
|
|
72
|
+
export async function runMergeCommit(opts) {
|
|
73
|
+
const suffix = extractTaskSuffix(opts.taskId);
|
|
74
|
+
const env = {
|
|
75
|
+
...process.env,
|
|
76
|
+
AGENTPLANE_TASK_ID: opts.taskId,
|
|
77
|
+
AGENTPLANE_ALLOW_BASE: "1",
|
|
78
|
+
AGENTPLANE_ALLOW_TASKS: "0",
|
|
79
|
+
};
|
|
80
|
+
try {
|
|
81
|
+
await execFileAsync("git", ["merge", "--no-ff", opts.branch, "-m", `🔀 ${suffix} integrate: merge ${opts.branch}`], { cwd: opts.gitRoot, env });
|
|
82
|
+
}
|
|
83
|
+
catch (err) {
|
|
84
|
+
await execFileAsync("git", ["merge", "--abort"], { cwd: opts.gitRoot, env: gitEnv() });
|
|
85
|
+
const message = err instanceof Error ? err.message : "git merge failed";
|
|
86
|
+
throw new CliError({ exitCode: 2, code: "E_GIT", message });
|
|
87
|
+
}
|
|
88
|
+
return await gitRevParse(opts.gitRoot, ["HEAD"]);
|
|
89
|
+
}
|
|
90
|
+
export async function runRebaseFastForward(opts) {
|
|
91
|
+
try {
|
|
92
|
+
await execFileAsync("git", ["rebase", opts.base], { cwd: opts.worktreePath, env: gitEnv() });
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
95
|
+
await execFileAsync("git", ["rebase", "--abort"], { cwd: opts.worktreePath, env: gitEnv() });
|
|
96
|
+
const message = err instanceof Error ? err.message : "git rebase failed";
|
|
97
|
+
throw new CliError({ exitCode: 2, code: "E_GIT", message });
|
|
98
|
+
}
|
|
99
|
+
let branchHeadSha = await gitRevParse(opts.gitRoot, [opts.branch]);
|
|
100
|
+
let alreadyVerifiedSha = opts.alreadyVerifiedSha;
|
|
101
|
+
let shouldRunVerify = opts.shouldRunVerify;
|
|
102
|
+
if (!opts.runVerify && opts.verifyCommands.length > 0) {
|
|
103
|
+
({ alreadyVerifiedSha, shouldRunVerify } = computeVerifyState({
|
|
104
|
+
rawVerify: opts.rawVerify,
|
|
105
|
+
metaLastVerifiedSha: opts.metaSource?.last_verified_sha ?? null,
|
|
106
|
+
verifyLogText: opts.verifyLogText,
|
|
107
|
+
branchHeadSha,
|
|
108
|
+
runVerify: false,
|
|
109
|
+
}));
|
|
110
|
+
}
|
|
111
|
+
const verifyEntries = [];
|
|
112
|
+
if (shouldRunVerify && opts.verifyCommands.length > 0) {
|
|
113
|
+
verifyEntries.push(...(await runVerifyCommands({
|
|
114
|
+
commands: opts.verifyCommands,
|
|
115
|
+
worktreePath: opts.worktreePath,
|
|
116
|
+
branchHeadSha,
|
|
117
|
+
quiet: opts.quiet,
|
|
118
|
+
taskId: opts.taskId,
|
|
119
|
+
})));
|
|
120
|
+
}
|
|
121
|
+
try {
|
|
122
|
+
await execFileAsync("git", ["merge", "--ff-only", opts.branch], {
|
|
123
|
+
cwd: opts.gitRoot,
|
|
124
|
+
env: gitEnv(),
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
catch (err) {
|
|
128
|
+
await execFileAsync("git", ["reset", "--hard", opts.headBeforeMerge], {
|
|
129
|
+
cwd: opts.gitRoot,
|
|
130
|
+
env: gitEnv(),
|
|
131
|
+
}).catch(() => null);
|
|
132
|
+
const message = err instanceof Error ? err.message : "git merge --ff-only failed";
|
|
133
|
+
throw new CliError({ exitCode: 2, code: "E_GIT", message });
|
|
134
|
+
}
|
|
135
|
+
const mergeHash = await gitRevParse(opts.gitRoot, ["HEAD"]);
|
|
136
|
+
branchHeadSha = await gitRevParse(opts.gitRoot, [opts.branch]);
|
|
137
|
+
return { mergeHash, branchHeadSha, verifyEntries, alreadyVerifiedSha, shouldRunVerify };
|
|
138
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { loadBackendTask, type CommandContext } from "../../../shared/task-backend.js";
|
|
2
|
+
import { type PrMeta } from "../../../shared/pr-meta.js";
|
|
3
|
+
export type PreparedIntegrate = {
|
|
4
|
+
ctx: CommandContext;
|
|
5
|
+
resolved: CommandContext["resolvedProject"];
|
|
6
|
+
loadedConfig: CommandContext["config"];
|
|
7
|
+
task: Awaited<ReturnType<typeof loadBackendTask>>["task"];
|
|
8
|
+
baseBranch: string;
|
|
9
|
+
currentBranch: string;
|
|
10
|
+
prDir: string;
|
|
11
|
+
metaPath: string;
|
|
12
|
+
diffstatPath: string;
|
|
13
|
+
verifyLogPath: string;
|
|
14
|
+
meta: PrMeta | null;
|
|
15
|
+
metaSource: PrMeta;
|
|
16
|
+
branch: string;
|
|
17
|
+
base: string;
|
|
18
|
+
verifyLogText: string;
|
|
19
|
+
branchHeadSha: string;
|
|
20
|
+
verifyCommands: string[];
|
|
21
|
+
alreadyVerifiedSha: string | null;
|
|
22
|
+
shouldRunVerify: boolean;
|
|
23
|
+
};
|
|
24
|
+
export declare function prepareIntegrate(opts: {
|
|
25
|
+
ctx?: CommandContext;
|
|
26
|
+
cwd: string;
|
|
27
|
+
rootOverride?: string;
|
|
28
|
+
taskId: string;
|
|
29
|
+
branch?: string;
|
|
30
|
+
base?: string;
|
|
31
|
+
runVerify: boolean;
|
|
32
|
+
}): Promise<PreparedIntegrate>;
|
|
33
|
+
//# sourceMappingURL=prepare.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepare.d.ts","sourceRoot":"","sources":["../../../../../src/commands/pr/integrate/internal/prepare.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,eAAe,EAEf,KAAK,cAAc,EACpB,MAAM,iCAAiC,CAAC;AAUzC,OAAO,EAAe,KAAK,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEtE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,EAAE,cAAc,CAAC;IACpB,QAAQ,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAC;IAC5C,YAAY,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;IACvC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAE1D,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IAEtB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IAEtB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IAEb,aAAa,EAAE,MAAM,CAAC;IAEtB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,wBAAsB,gBAAgB,CAAC,IAAI,EAAE;IAC3C,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;CACpB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAoJ7B"}
|