agentplane 0.3.6 → 0.3.8
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/assets/AGENTS.md +11 -1
- package/assets/RUNNER.md +17 -0
- package/bin/agentplane.js +16 -7
- package/bin/framework-dev-contract.d.ts +6 -0
- package/bin/framework-dev-contract.js +13 -0
- package/bin/stale-dist-policy.js +6 -1
- package/dist/.build-manifest.json +724 -359
- package/dist/adapters/task-backend/task-backend-adapter.d.ts +4 -2
- package/dist/adapters/task-backend/task-backend-adapter.d.ts.map +1 -1
- package/dist/adapters/task-backend/task-backend-adapter.js +15 -2
- package/dist/backends/task-backend/local-backend-doc.d.ts +5 -0
- package/dist/backends/task-backend/local-backend-doc.d.ts.map +1 -0
- package/dist/backends/task-backend/local-backend-doc.js +98 -0
- package/dist/backends/task-backend/local-backend-read.d.ts +7 -0
- package/dist/backends/task-backend/local-backend-read.d.ts.map +1 -0
- package/dist/backends/task-backend/local-backend-read.js +186 -0
- package/dist/backends/task-backend/local-backend-state.d.ts +17 -0
- package/dist/backends/task-backend/local-backend-state.d.ts.map +1 -0
- package/dist/backends/task-backend/local-backend-state.js +50 -0
- package/dist/backends/task-backend/local-backend-write.d.ts +15 -0
- package/dist/backends/task-backend/local-backend-write.d.ts.map +1 -0
- package/dist/backends/task-backend/local-backend-write.js +254 -0
- package/dist/backends/task-backend/local-backend.d.ts +10 -6
- package/dist/backends/task-backend/local-backend.d.ts.map +1 -1
- package/dist/backends/task-backend/local-backend.js +32 -337
- package/dist/backends/task-backend/redmine/backend-cache-doc.d.ts +40 -0
- package/dist/backends/task-backend/redmine/backend-cache-doc.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-cache-doc.js +178 -0
- package/dist/backends/task-backend/redmine/backend-report.d.ts +10 -0
- package/dist/backends/task-backend/redmine/backend-report.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-report.js +43 -0
- package/dist/backends/task-backend/redmine/backend-sync.d.ts +67 -0
- package/dist/backends/task-backend/redmine/backend-sync.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync.js +367 -0
- package/dist/backends/task-backend/redmine/env.d.ts +1 -1
- package/dist/backends/task-backend/redmine/env.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine/env.js +3 -0
- package/dist/backends/task-backend/redmine/inspect.d.ts +11 -0
- package/dist/backends/task-backend/redmine/inspect.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/inspect.js +75 -0
- package/dist/backends/task-backend/redmine/mapping.d.ts +2 -1
- package/dist/backends/task-backend/redmine/mapping.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine/mapping.js +32 -3
- package/dist/backends/task-backend/redmine/parse.d.ts +2 -1
- package/dist/backends/task-backend/redmine/parse.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine/parse.js +5 -3
- package/dist/backends/task-backend/redmine/state.d.ts +19 -0
- package/dist/backends/task-backend/redmine/state.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/state.js +109 -0
- package/dist/backends/task-backend/redmine-backend.d.ts +14 -17
- package/dist/backends/task-backend/redmine-backend.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine-backend.js +121 -379
- package/dist/backends/task-backend/shared/constants.d.ts +2 -1
- package/dist/backends/task-backend/shared/constants.d.ts.map +1 -1
- package/dist/backends/task-backend/shared/constants.js +1 -1
- package/dist/backends/task-backend/shared/doc.d.ts.map +1 -1
- package/dist/backends/task-backend/shared/doc.js +25 -39
- package/dist/backends/task-backend/shared/export.d.ts +2 -9
- package/dist/backends/task-backend/shared/export.d.ts.map +1 -1
- package/dist/backends/task-backend/shared/export.js +73 -8
- package/dist/backends/task-backend/shared/normalize.d.ts +5 -1
- package/dist/backends/task-backend/shared/normalize.d.ts.map +1 -1
- package/dist/backends/task-backend/shared/normalize.js +166 -0
- package/dist/backends/task-backend/shared/record.d.ts +1 -1
- package/dist/backends/task-backend/shared/record.d.ts.map +1 -1
- package/dist/backends/task-backend/shared/record.js +27 -3
- package/dist/backends/task-backend/shared/types.d.ts +76 -36
- package/dist/backends/task-backend/shared/types.d.ts.map +1 -1
- package/dist/backends/task-backend/shared.d.ts +2 -2
- package/dist/backends/task-backend/shared.d.ts.map +1 -1
- package/dist/backends/task-backend/shared.js +1 -1
- package/dist/backends/task-backend.d.ts +1 -1
- package/dist/backends/task-backend.d.ts.map +1 -1
- package/dist/backends/task-backend.js +1 -1
- package/dist/backends/task-index.d.ts +2 -2
- package/dist/backends/task-index.d.ts.map +1 -1
- package/dist/backends/task-index.js +9 -5
- package/dist/cli/bootstrap-guide.d.ts +2 -2
- package/dist/cli/bootstrap-guide.d.ts.map +1 -1
- package/dist/cli/bootstrap-guide.js +10 -10
- package/dist/cli/command-guide.d.ts.map +1 -1
- package/dist/cli/command-guide.js +11 -9
- package/dist/cli/command-invocations.d.ts +4 -0
- package/dist/cli/command-invocations.d.ts.map +1 -0
- package/dist/cli/command-invocations.js +35 -0
- package/dist/cli/command-snippets.d.ts +12 -8
- package/dist/cli/command-snippets.d.ts.map +1 -1
- package/dist/cli/command-snippets.js +14 -8
- package/dist/cli/exit-codes.d.ts.map +1 -1
- package/dist/cli/exit-codes.js +1 -0
- package/dist/cli/group-command.d.ts +18 -0
- package/dist/cli/group-command.d.ts.map +1 -0
- package/dist/cli/group-command.js +45 -0
- package/dist/cli/output.d.ts +29 -0
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +76 -0
- package/dist/cli/prompts.d.ts.map +1 -1
- package/dist/cli/prompts.js +5 -1
- package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/core.js +38 -29
- package/dist/cli/run-cli/command-catalog/lifecycle.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/lifecycle.js +9 -6
- package/dist/cli/run-cli/command-catalog/project.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/project.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/project.js +11 -7
- package/dist/cli/run-cli/command-catalog/shared.d.ts +12 -3
- package/dist/cli/run-cli/command-catalog/shared.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/shared.js +6 -3
- package/dist/cli/run-cli/command-catalog/task.d.ts +1 -1
- package/dist/cli/run-cli/command-catalog/task.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/task.js +46 -11
- package/dist/cli/run-cli/command-catalog.d.ts +11 -1
- package/dist/cli/run-cli/command-catalog.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog.js +29 -0
- package/dist/cli/run-cli/commands/config.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/config.js +52 -6
- package/dist/cli/run-cli/commands/core/agent-profiles.d.ts +34 -0
- package/dist/cli/run-cli/commands/core/agent-profiles.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/core/agent-profiles.js +97 -0
- package/dist/cli/run-cli/commands/core/agents.d.ts +7 -0
- package/dist/cli/run-cli/commands/core/agents.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/core/agents.js +97 -0
- package/dist/cli/run-cli/commands/core/preflight.d.ts +10 -0
- package/dist/cli/run-cli/commands/core/preflight.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/core/preflight.js +286 -0
- package/dist/cli/run-cli/commands/core/quickstart.d.ts +8 -0
- package/dist/cli/run-cli/commands/core/quickstart.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/core/quickstart.js +43 -0
- package/dist/cli/run-cli/commands/core/role.d.ts +9 -0
- package/dist/cli/run-cli/commands/core/role.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/core/role.js +128 -0
- package/dist/cli/run-cli/commands/core.d.ts +4 -24
- package/dist/cli/run-cli/commands/core.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/core.js +4 -630
- package/dist/cli/run-cli/commands/init/write-env.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/write-env.js +12 -0
- package/dist/cli/run-cli/error-guidance.js +10 -0
- package/dist/cli/run-cli/globals.d.ts +5 -2
- package/dist/cli/run-cli/globals.d.ts.map +1 -1
- package/dist/cli/run-cli/globals.js +82 -86
- package/dist/cli/run-cli.d.ts.map +1 -1
- package/dist/cli/run-cli.js +137 -100
- package/dist/cli/run-cli.test-helpers.d.ts +21 -0
- package/dist/cli/run-cli.test-helpers.d.ts.map +1 -1
- package/dist/cli/run-cli.test-helpers.js +90 -4
- package/dist/cli/spec/help.d.ts +10 -2
- package/dist/cli/spec/help.d.ts.map +1 -1
- package/dist/cli/spec/help.js +7 -5
- package/dist/cli/spec/registry.d.ts +27 -1
- package/dist/cli/spec/registry.d.ts.map +1 -1
- package/dist/cli/spec/registry.js +98 -25
- package/dist/commands/backend/sync.command.d.ts +8 -6
- package/dist/commands/backend/sync.command.d.ts.map +1 -1
- package/dist/commands/backend/sync.command.js +75 -14
- package/dist/commands/backend.d.ts +22 -0
- package/dist/commands/backend.d.ts.map +1 -1
- package/dist/commands/backend.js +111 -1
- package/dist/commands/branch/base.command.d.ts +2 -3
- package/dist/commands/branch/base.command.d.ts.map +1 -1
- package/dist/commands/branch/base.command.js +8 -12
- package/dist/commands/branch/base.d.ts.map +1 -1
- package/dist/commands/branch/base.js +11 -7
- package/dist/commands/branch/cleanup-merged.d.ts.map +1 -1
- package/dist/commands/branch/cleanup-merged.js +9 -8
- package/dist/commands/branch/remove.d.ts.map +1 -1
- package/dist/commands/branch/remove.js +4 -3
- package/dist/commands/branch/status.d.ts.map +1 -1
- package/dist/commands/branch/status.js +4 -3
- package/dist/commands/branch/work-start.d.ts.map +1 -1
- package/dist/commands/branch/work-start.js +48 -5
- package/dist/commands/cleanup/merged.command.d.ts +2 -3
- package/dist/commands/cleanup/merged.command.d.ts.map +1 -1
- package/dist/commands/cleanup/merged.command.js +8 -12
- package/dist/commands/commit.spec.d.ts.map +1 -1
- package/dist/commands/commit.spec.js +30 -6
- package/dist/commands/docs/cli.command.js +2 -2
- package/dist/commands/doctor/runtime.js +1 -1
- package/dist/commands/doctor/workflow.d.ts.map +1 -1
- package/dist/commands/doctor/workflow.js +10 -1
- package/dist/commands/doctor/workspace.d.ts +8 -0
- package/dist/commands/doctor/workspace.d.ts.map +1 -1
- package/dist/commands/doctor/workspace.js +127 -3
- package/dist/commands/finish.spec.d.ts.map +1 -1
- package/dist/commands/finish.spec.js +7 -0
- package/dist/commands/guard/commit.command.d.ts.map +1 -1
- package/dist/commands/guard/commit.command.js +30 -6
- package/dist/commands/guard/guard.command.d.ts +3 -3
- package/dist/commands/guard/guard.command.d.ts.map +1 -1
- package/dist/commands/guard/guard.command.js +9 -14
- package/dist/commands/guard/impl/allow.d.ts +4 -0
- package/dist/commands/guard/impl/allow.d.ts.map +1 -1
- package/dist/commands/guard/impl/allow.js +14 -3
- package/dist/commands/guard/impl/commands.d.ts +2 -0
- package/dist/commands/guard/impl/commands.d.ts.map +1 -1
- package/dist/commands/guard/impl/commands.js +66 -9
- package/dist/commands/guard/impl/policy.d.ts +1 -0
- package/dist/commands/guard/impl/policy.d.ts.map +1 -1
- package/dist/commands/guard/impl/policy.js +9 -6
- package/dist/commands/hooks/hooks.command.d.ts +3 -3
- package/dist/commands/hooks/hooks.command.d.ts.map +1 -1
- package/dist/commands/hooks/hooks.command.js +9 -11
- package/dist/commands/pr/check.d.ts.map +1 -1
- package/dist/commands/pr/check.js +90 -18
- package/dist/commands/pr/integrate/cmd.d.ts.map +1 -1
- package/dist/commands/pr/integrate/cmd.js +31 -3
- package/dist/commands/pr/integrate/internal/cleanup.d.ts +12 -0
- package/dist/commands/pr/integrate/internal/cleanup.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/cleanup.js +46 -0
- package/dist/commands/pr/integrate/internal/finalize.d.ts +4 -0
- package/dist/commands/pr/integrate/internal/finalize.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/finalize.js +34 -40
- package/dist/commands/pr/integrate/internal/merge.d.ts +6 -0
- package/dist/commands/pr/integrate/internal/merge.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/merge.js +92 -0
- package/dist/commands/pr/integrate/internal/prepare.d.ts +1 -0
- package/dist/commands/pr/integrate/internal/prepare.d.ts.map +1 -1
- package/dist/commands/pr/integrate/internal/prepare.js +1 -0
- package/dist/commands/pr/integrate/verify.d.ts.map +1 -1
- package/dist/commands/pr/integrate/verify.js +4 -3
- package/dist/commands/pr/note.d.ts.map +1 -1
- package/dist/commands/pr/note.js +3 -2
- package/dist/commands/pr/open.d.ts.map +1 -1
- package/dist/commands/pr/open.js +9 -12
- package/dist/commands/pr/pr.command.d.ts +3 -4
- package/dist/commands/pr/pr.command.d.ts.map +1 -1
- package/dist/commands/pr/pr.command.js +6 -11
- package/dist/commands/pr/update.d.ts.map +1 -1
- package/dist/commands/pr/update.js +5 -10
- package/dist/commands/recipes/cache.command.d.ts +3 -4
- package/dist/commands/recipes/cache.command.d.ts.map +1 -1
- package/dist/commands/recipes/cache.command.js +8 -26
- package/dist/commands/recipes/impl/apply.d.ts +1 -1
- package/dist/commands/recipes/impl/apply.d.ts.map +1 -1
- package/dist/commands/recipes/impl/apply.js +1 -1
- package/dist/commands/recipes/impl/commands/explain.js +1 -1
- package/dist/commands/recipes/impl/commands/install.d.ts.map +1 -1
- package/dist/commands/recipes/impl/commands/install.js +1 -2
- package/dist/commands/recipes/impl/installed-recipes.d.ts +1 -1
- package/dist/commands/recipes/impl/installed-recipes.d.ts.map +1 -1
- package/dist/commands/recipes/impl/installed-recipes.js +1 -2
- package/dist/commands/recipes/impl/manifest.d.ts.map +1 -1
- package/dist/commands/recipes/impl/manifest.js +0 -10
- package/dist/commands/recipes/impl/project-installed-recipes.d.ts +1 -1
- package/dist/commands/recipes/impl/project-installed-recipes.d.ts.map +1 -1
- package/dist/commands/recipes/impl/project-installed-recipes.js +1 -2
- package/dist/commands/recipes/impl/resolver.d.ts +1 -1
- package/dist/commands/recipes/impl/resolver.d.ts.map +1 -1
- package/dist/commands/recipes/impl/resolver.js +26 -16
- package/dist/commands/recipes/impl/scenario.d.ts.map +1 -1
- package/dist/commands/recipes/impl/scenario.js +80 -0
- package/dist/commands/recipes/impl/types.d.ts +27 -13
- package/dist/commands/recipes/impl/types.d.ts.map +1 -1
- package/dist/commands/recipes/recipes.command.d.ts +3 -4
- package/dist/commands/recipes/recipes.command.d.ts.map +1 -1
- package/dist/commands/recipes/recipes.command.js +8 -34
- package/dist/commands/recipes.d.ts +4 -4
- package/dist/commands/recipes.d.ts.map +1 -1
- package/dist/commands/recipes.js +3 -3
- package/dist/commands/recipes.test-helpers.d.ts +17 -0
- package/dist/commands/recipes.test-helpers.d.ts.map +1 -1
- package/dist/commands/recipes.test-helpers.js +56 -2
- package/dist/commands/release/apply.command.d.ts.map +1 -1
- package/dist/commands/release/apply.command.js +77 -56
- package/dist/commands/release/plan.command.d.ts.map +1 -1
- package/dist/commands/release/plan.command.js +7 -3
- package/dist/commands/release/release.command.d.ts +3 -3
- package/dist/commands/release/release.command.d.ts.map +1 -1
- package/dist/commands/release/release.command.js +9 -11
- package/dist/commands/release.test-helpers.d.ts +20 -0
- package/dist/commands/release.test-helpers.d.ts.map +1 -0
- package/dist/commands/release.test-helpers.js +37 -0
- package/dist/commands/runtime.command.d.ts +7 -7
- package/dist/commands/runtime.command.d.ts.map +1 -1
- package/dist/commands/runtime.command.js +29 -33
- package/dist/commands/scenario/execute.command.d.ts +8 -0
- package/dist/commands/scenario/execute.command.d.ts.map +1 -0
- package/dist/commands/scenario/execute.command.js +117 -0
- package/dist/commands/scenario/impl/commands.d.ts.map +1 -1
- package/dist/commands/scenario/impl/commands.js +45 -32
- package/dist/commands/scenario/run.command.js +2 -2
- package/dist/commands/scenario/scenario.command.d.ts +3 -4
- package/dist/commands/scenario/scenario.command.d.ts.map +1 -1
- package/dist/commands/scenario/scenario.command.js +8 -26
- package/dist/commands/shared/git-context.d.ts +1 -0
- package/dist/commands/shared/git-context.d.ts.map +1 -1
- package/dist/commands/shared/git-context.js +4 -2
- package/dist/commands/shared/git-ops.d.ts +1 -0
- package/dist/commands/shared/git-ops.d.ts.map +1 -1
- package/dist/commands/shared/git-ops.js +13 -0
- package/dist/commands/shared/operator-pipeline.d.ts +10 -0
- package/dist/commands/shared/operator-pipeline.d.ts.map +1 -0
- package/dist/commands/shared/operator-pipeline.js +16 -0
- package/dist/commands/shared/pr-meta.d.ts +32 -12
- package/dist/commands/shared/pr-meta.d.ts.map +1 -1
- package/dist/commands/shared/pr-meta.js +49 -14
- package/dist/commands/shared/reconcile-check.d.ts.map +1 -1
- package/dist/commands/shared/reconcile-check.js +28 -3
- package/dist/commands/shared/task-backend.d.ts +11 -7
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +107 -24
- package/dist/commands/shared/task-handoff.d.ts +64 -0
- package/dist/commands/shared/task-handoff.d.ts.map +1 -0
- package/dist/commands/shared/task-handoff.js +151 -0
- package/dist/commands/shared/task-mutation.d.ts +36 -0
- package/dist/commands/shared/task-mutation.d.ts.map +1 -0
- package/dist/commands/shared/task-mutation.js +67 -0
- package/dist/commands/shared/task-store.d.ts +65 -2
- package/dist/commands/shared/task-store.d.ts.map +1 -1
- package/dist/commands/shared/task-store.js +309 -91
- package/dist/commands/task/add.d.ts.map +1 -1
- package/dist/commands/task/add.js +41 -39
- package/dist/commands/task/block.d.ts.map +1 -1
- package/dist/commands/task/block.js +31 -89
- package/dist/commands/task/close-duplicate.d.ts.map +1 -1
- package/dist/commands/task/close-duplicate.js +0 -7
- package/dist/commands/task/close-noop.d.ts.map +1 -1
- package/dist/commands/task/close-noop.js +0 -21
- package/dist/commands/task/close-shared.d.ts +0 -2
- package/dist/commands/task/close-shared.d.ts.map +1 -1
- package/dist/commands/task/close-shared.js +24 -57
- package/dist/commands/task/comment.d.ts.map +1 -1
- package/dist/commands/task/comment.js +48 -42
- package/dist/commands/task/derive.command.d.ts +1 -0
- package/dist/commands/task/derive.command.d.ts.map +1 -1
- package/dist/commands/task/derive.command.js +15 -2
- package/dist/commands/task/derive.d.ts +1 -0
- package/dist/commands/task/derive.d.ts.map +1 -1
- package/dist/commands/task/derive.js +37 -7
- package/dist/commands/task/doc.command.d.ts.map +1 -1
- package/dist/commands/task/doc.command.js +7 -6
- package/dist/commands/task/doc.d.ts.map +1 -1
- package/dist/commands/task/doc.js +68 -61
- package/dist/commands/task/finish-shared.d.ts +60 -0
- package/dist/commands/task/finish-shared.d.ts.map +1 -0
- package/dist/commands/task/finish-shared.js +181 -0
- package/dist/commands/task/finish.d.ts +1 -0
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +73 -204
- package/dist/commands/task/handoff-record.command.d.ts +17 -0
- package/dist/commands/task/handoff-record.command.d.ts.map +1 -0
- package/dist/commands/task/handoff-record.command.js +140 -0
- package/dist/commands/task/handoff-show.command.d.ts +8 -0
- package/dist/commands/task/handoff-show.command.d.ts.map +1 -0
- package/dist/commands/task/handoff-show.command.js +77 -0
- package/dist/commands/task/handoff.command.d.ts +7 -0
- package/dist/commands/task/handoff.command.d.ts.map +1 -0
- package/dist/commands/task/handoff.command.js +21 -0
- package/dist/commands/task/handoff.shared.d.ts +39 -0
- package/dist/commands/task/handoff.shared.d.ts.map +1 -0
- package/dist/commands/task/handoff.shared.js +134 -0
- package/dist/commands/task/hosted-close.command.d.ts +9 -0
- package/dist/commands/task/hosted-close.command.d.ts.map +1 -0
- package/dist/commands/task/hosted-close.command.js +190 -0
- package/dist/commands/task/hosted-merge-sync.d.ts +40 -0
- package/dist/commands/task/hosted-merge-sync.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync.js +277 -0
- package/dist/commands/task/list.d.ts.map +1 -1
- package/dist/commands/task/list.js +7 -24
- package/dist/commands/task/migrate-doc.d.ts +15 -0
- package/dist/commands/task/migrate-doc.d.ts.map +1 -1
- package/dist/commands/task/migrate-doc.js +126 -35
- package/dist/commands/task/new.d.ts.map +1 -1
- package/dist/commands/task/new.js +26 -4
- package/dist/commands/task/next.d.ts.map +1 -1
- package/dist/commands/task/next.js +10 -28
- package/dist/commands/task/normalize.command.d.ts +1 -0
- package/dist/commands/task/normalize.command.d.ts.map +1 -1
- package/dist/commands/task/normalize.command.js +12 -0
- package/dist/commands/task/normalize.d.ts +1 -0
- package/dist/commands/task/normalize.d.ts.map +1 -1
- package/dist/commands/task/normalize.js +21 -9
- package/dist/commands/task/plan.command.d.ts +3 -4
- package/dist/commands/task/plan.command.d.ts.map +1 -1
- package/dist/commands/task/plan.command.js +6 -12
- package/dist/commands/task/plan.d.ts.map +1 -1
- package/dist/commands/task/plan.js +118 -125
- package/dist/commands/task/reclaim.command.d.ts +11 -0
- package/dist/commands/task/reclaim.command.d.ts.map +1 -0
- package/dist/commands/task/reclaim.command.js +102 -0
- package/dist/commands/task/resume-context.command.d.ts +9 -0
- package/dist/commands/task/resume-context.command.d.ts.map +1 -0
- package/dist/commands/task/resume-context.command.js +60 -0
- package/dist/commands/task/run-cancel.command.d.ts +6 -0
- package/dist/commands/task/run-cancel.command.d.ts.map +1 -0
- package/dist/commands/task/run-cancel.command.js +45 -0
- package/dist/commands/task/run-cancel.spec.d.ts +7 -0
- package/dist/commands/task/run-cancel.spec.d.ts.map +1 -0
- package/dist/commands/task/run-cancel.spec.js +20 -0
- package/dist/commands/task/run-resume.command.d.ts +6 -0
- package/dist/commands/task/run-resume.command.d.ts.map +1 -0
- package/dist/commands/task/run-resume.command.js +55 -0
- package/dist/commands/task/run-resume.spec.d.ts +7 -0
- package/dist/commands/task/run-resume.spec.d.ts.map +1 -0
- package/dist/commands/task/run-resume.spec.js +20 -0
- package/dist/commands/task/run-retry.command.d.ts +6 -0
- package/dist/commands/task/run-retry.command.d.ts.map +1 -0
- package/dist/commands/task/run-retry.command.js +56 -0
- package/dist/commands/task/run-retry.spec.d.ts +7 -0
- package/dist/commands/task/run-retry.spec.d.ts.map +1 -0
- package/dist/commands/task/run-retry.spec.js +20 -0
- package/dist/commands/task/run-show.command.d.ts +6 -0
- package/dist/commands/task/run-show.command.d.ts.map +1 -0
- package/dist/commands/task/run-show.command.js +133 -0
- package/dist/commands/task/run-show.spec.d.ts +8 -0
- package/dist/commands/task/run-show.spec.d.ts.map +1 -0
- package/dist/commands/task/run-show.spec.js +44 -0
- package/dist/commands/task/run-tail.command.d.ts +6 -0
- package/dist/commands/task/run-tail.command.d.ts.map +1 -0
- package/dist/commands/task/run-tail.command.js +26 -0
- package/dist/commands/task/run-tail.spec.d.ts +8 -0
- package/dist/commands/task/run-tail.spec.d.ts.map +1 -0
- package/dist/commands/task/run-tail.spec.js +51 -0
- package/dist/commands/task/run-trace.command.d.ts +6 -0
- package/dist/commands/task/run-trace.command.d.ts.map +1 -0
- package/dist/commands/task/run-trace.command.js +25 -0
- package/dist/commands/task/run-trace.spec.d.ts +7 -0
- package/dist/commands/task/run-trace.spec.d.ts.map +1 -0
- package/dist/commands/task/run-trace.spec.js +31 -0
- package/dist/commands/task/run.command.d.ts +6 -0
- package/dist/commands/task/run.command.d.ts.map +1 -0
- package/dist/commands/task/run.command.js +74 -0
- package/dist/commands/task/run.spec.d.ts +7 -0
- package/dist/commands/task/run.spec.d.ts.map +1 -0
- package/dist/commands/task/run.spec.js +26 -0
- package/dist/commands/task/scaffold.d.ts.map +1 -1
- package/dist/commands/task/scaffold.js +4 -2
- package/dist/commands/task/scrub.d.ts.map +1 -1
- package/dist/commands/task/scrub.js +27 -24
- package/dist/commands/task/search.d.ts.map +1 -1
- package/dist/commands/task/search.js +21 -31
- package/dist/commands/task/set-status.d.ts.map +1 -1
- package/dist/commands/task/set-status.js +38 -111
- package/dist/commands/task/shared/dependencies.d.ts +5 -4
- package/dist/commands/task/shared/dependencies.d.ts.map +1 -1
- package/dist/commands/task/shared/dependencies.js +20 -2
- package/dist/commands/task/shared/docs.d.ts +6 -1
- package/dist/commands/task/shared/docs.d.ts.map +1 -1
- package/dist/commands/task/shared/docs.js +14 -1
- package/dist/commands/task/shared/listing.d.ts +16 -2
- package/dist/commands/task/shared/listing.d.ts.map +1 -1
- package/dist/commands/task/shared/listing.js +56 -0
- package/dist/commands/task/shared/transition-command.d.ts +15 -0
- package/dist/commands/task/shared/transition-command.d.ts.map +1 -0
- package/dist/commands/task/shared/transition-command.js +43 -0
- package/dist/commands/task/shared/transitions.d.ts +56 -0
- package/dist/commands/task/shared/transitions.d.ts.map +1 -1
- package/dist/commands/task/shared/transitions.js +82 -8
- package/dist/commands/task/shared/workflow-transition-service.d.ts +75 -0
- package/dist/commands/task/shared/workflow-transition-service.d.ts.map +1 -0
- package/dist/commands/task/shared/workflow-transition-service.js +226 -0
- package/dist/commands/task/shared.d.ts +6 -4
- package/dist/commands/task/shared.d.ts.map +1 -1
- package/dist/commands/task/shared.js +6 -4
- package/dist/commands/task/show.d.ts.map +1 -1
- package/dist/commands/task/show.js +37 -3
- package/dist/commands/task/start.d.ts.map +1 -1
- package/dist/commands/task/start.js +32 -113
- package/dist/commands/task/task.command.d.ts +3 -4
- package/dist/commands/task/task.command.d.ts.map +1 -1
- package/dist/commands/task/task.command.js +22 -37
- package/dist/commands/task/verify-record.d.ts.map +1 -1
- package/dist/commands/task/verify-record.js +21 -146
- package/dist/commands/task/verify.command.d.ts.map +1 -1
- package/dist/commands/task/verify.command.js +7 -6
- package/dist/commands/task.test-helpers.d.ts +13 -0
- package/dist/commands/task.test-helpers.d.ts.map +1 -0
- package/dist/commands/task.test-helpers.js +65 -0
- package/dist/commands/upgrade/apply.d.ts +2 -0
- package/dist/commands/upgrade/apply.d.ts.map +1 -1
- package/dist/commands/upgrade/apply.js +33 -1
- package/dist/commands/upgrade/materialize.d.ts +28 -0
- package/dist/commands/upgrade/materialize.d.ts.map +1 -0
- package/dist/commands/upgrade/materialize.js +154 -0
- package/dist/commands/upgrade/plan.d.ts +18 -0
- package/dist/commands/upgrade/plan.d.ts.map +1 -0
- package/dist/commands/upgrade/plan.js +219 -0
- package/dist/commands/upgrade/policy.d.ts +24 -0
- package/dist/commands/upgrade/policy.d.ts.map +1 -0
- package/dist/commands/upgrade/policy.js +182 -0
- package/dist/commands/upgrade/report.d.ts.map +1 -1
- package/dist/commands/upgrade/report.js +7 -5
- package/dist/commands/upgrade.command.d.ts.map +1 -1
- package/dist/commands/upgrade.command.js +25 -0
- package/dist/commands/upgrade.d.ts +1 -0
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +164 -618
- package/dist/commands/workflow.command.d.ts +3 -4
- package/dist/commands/workflow.command.d.ts.map +1 -1
- package/dist/commands/workflow.command.js +8 -25
- package/dist/policy/rules/allowlist.d.ts.map +1 -1
- package/dist/policy/rules/allowlist.js +12 -9
- package/dist/ports/task-backend-port.d.ts +4 -2
- package/dist/ports/task-backend-port.d.ts.map +1 -1
- package/dist/runner/adapters/codex.d.ts +9 -0
- package/dist/runner/adapters/codex.d.ts.map +1 -0
- package/dist/runner/adapters/codex.js +414 -0
- package/dist/runner/adapters/custom.d.ts +12 -0
- package/dist/runner/adapters/custom.d.ts.map +1 -0
- package/dist/runner/adapters/custom.js +512 -0
- package/dist/runner/adapters/index.d.ts +8 -0
- package/dist/runner/adapters/index.d.ts.map +1 -0
- package/dist/runner/adapters/index.js +15 -0
- package/dist/runner/adapters/recipe-run-profile.d.ts +8 -0
- package/dist/runner/adapters/recipe-run-profile.d.ts.map +1 -0
- package/dist/runner/adapters/recipe-run-profile.js +53 -0
- package/dist/runner/adapters/shared.d.ts +45 -0
- package/dist/runner/adapters/shared.d.ts.map +1 -0
- package/dist/runner/adapters/shared.js +58 -0
- package/dist/runner/artifacts.d.ts +31 -0
- package/dist/runner/artifacts.d.ts.map +1 -0
- package/dist/runner/artifacts.js +153 -0
- package/dist/runner/codex-approval-probe.d.ts +23 -0
- package/dist/runner/codex-approval-probe.d.ts.map +1 -0
- package/dist/runner/codex-approval-probe.js +55 -0
- package/dist/runner/codex-smoke.d.ts +11 -0
- package/dist/runner/codex-smoke.d.ts.map +1 -0
- package/dist/runner/codex-smoke.js +45 -0
- package/dist/runner/config.d.ts +6 -0
- package/dist/runner/config.d.ts.map +1 -0
- package/dist/runner/config.js +15 -0
- package/dist/runner/context/base-prompts.d.ts +10 -0
- package/dist/runner/context/base-prompts.d.ts.map +1 -0
- package/dist/runner/context/base-prompts.js +255 -0
- package/dist/runner/context/recipe-context.d.ts +17 -0
- package/dist/runner/context/recipe-context.d.ts.map +1 -0
- package/dist/runner/context/recipe-context.js +48 -0
- package/dist/runner/context/task-context.d.ts +24 -0
- package/dist/runner/context/task-context.d.ts.map +1 -0
- package/dist/runner/context/task-context.js +266 -0
- package/dist/runner/index.d.ts +12 -0
- package/dist/runner/index.d.ts.map +1 -0
- package/dist/runner/index.js +11 -0
- package/dist/runner/policy-decision.d.ts +12 -0
- package/dist/runner/policy-decision.d.ts.map +1 -0
- package/dist/runner/policy-decision.js +89 -0
- package/dist/runner/policy-display.d.ts +4 -0
- package/dist/runner/policy-display.d.ts.map +1 -0
- package/dist/runner/policy-display.js +41 -0
- package/dist/runner/process-supervision.d.ts +48 -0
- package/dist/runner/process-supervision.d.ts.map +1 -0
- package/dist/runner/process-supervision.js +490 -0
- package/dist/runner/result-manifest-policy.d.ts +9 -0
- package/dist/runner/result-manifest-policy.d.ts.map +1 -0
- package/dist/runner/result-manifest-policy.js +96 -0
- package/dist/runner/result-manifest.d.ts +30 -0
- package/dist/runner/result-manifest.d.ts.map +1 -0
- package/dist/runner/result-manifest.js +322 -0
- package/dist/runner/run-id.d.ts +2 -0
- package/dist/runner/run-id.d.ts.map +1 -0
- package/dist/runner/run-id.js +3 -0
- package/dist/runner/run-repository.d.ts +51 -0
- package/dist/runner/run-repository.d.ts.map +1 -0
- package/dist/runner/run-repository.js +222 -0
- package/dist/runner/task-run-paths.d.ts +19 -0
- package/dist/runner/task-run-paths.d.ts.map +1 -0
- package/dist/runner/task-run-paths.js +25 -0
- package/dist/runner/task-state.d.ts +9 -0
- package/dist/runner/task-state.d.ts.map +1 -0
- package/dist/runner/task-state.js +354 -0
- package/dist/runner/test-helpers.d.ts +30 -0
- package/dist/runner/test-helpers.d.ts.map +1 -0
- package/dist/runner/test-helpers.js +97 -0
- package/dist/runner/trace-artifacts.d.ts +14 -0
- package/dist/runner/trace-artifacts.d.ts.map +1 -0
- package/dist/runner/trace-artifacts.js +80 -0
- package/dist/runner/trace.d.ts +10 -0
- package/dist/runner/trace.d.ts.map +1 -0
- package/dist/runner/trace.js +37 -0
- package/dist/runner/types.d.ts +317 -0
- package/dist/runner/types.d.ts.map +1 -0
- package/dist/runner/types.js +3 -0
- package/dist/runner/usecases/scenario-materialize-task.d.ts +29 -0
- package/dist/runner/usecases/scenario-materialize-task.d.ts.map +1 -0
- package/dist/runner/usecases/scenario-materialize-task.js +151 -0
- package/dist/runner/usecases/task-run-inspect.d.ts +41 -0
- package/dist/runner/usecases/task-run-inspect.d.ts.map +1 -0
- package/dist/runner/usecases/task-run-inspect.js +74 -0
- package/dist/runner/usecases/task-run-lifecycle-cancel.d.ts +10 -0
- package/dist/runner/usecases/task-run-lifecycle-cancel.d.ts.map +1 -0
- package/dist/runner/usecases/task-run-lifecycle-cancel.js +172 -0
- package/dist/runner/usecases/task-run-lifecycle-replay.d.ts +18 -0
- package/dist/runner/usecases/task-run-lifecycle-replay.d.ts.map +1 -0
- package/dist/runner/usecases/task-run-lifecycle-replay.js +128 -0
- package/dist/runner/usecases/task-run-lifecycle-shared.d.ts +45 -0
- package/dist/runner/usecases/task-run-lifecycle-shared.d.ts.map +1 -0
- package/dist/runner/usecases/task-run-lifecycle-shared.js +172 -0
- package/dist/runner/usecases/task-run-lifecycle.d.ts +4 -0
- package/dist/runner/usecases/task-run-lifecycle.d.ts.map +1 -0
- package/dist/runner/usecases/task-run-lifecycle.js +2 -0
- package/dist/runner/usecases/task-run.d.ts +32 -0
- package/dist/runner/usecases/task-run.d.ts.map +1 -0
- package/dist/runner/usecases/task-run.js +278 -0
- package/dist/shared/agent-emoji.d.ts.map +1 -1
- package/dist/shared/agent-emoji.js +1 -0
- package/dist/shared/errors.d.ts +1 -1
- package/dist/shared/errors.d.ts.map +1 -1
- package/dist/shared/guards.d.ts.map +1 -1
- package/dist/shared/guards.js +1 -0
- package/dist/shared/protected-paths.d.ts +10 -0
- package/dist/shared/protected-paths.d.ts.map +1 -1
- package/dist/shared/protected-paths.js +33 -0
- package/dist/shared/repo-cli-version.d.ts.map +1 -1
- package/dist/shared/repo-cli-version.js +7 -5
- package/dist/shared/task-doc-conflicts.d.ts +12 -0
- package/dist/shared/task-doc-conflicts.d.ts.map +1 -0
- package/dist/shared/task-doc-conflicts.js +40 -0
- package/dist/shared/task-doc-state.d.ts +10 -0
- package/dist/shared/task-doc-state.d.ts.map +1 -0
- package/dist/shared/task-doc-state.js +15 -0
- package/dist/test-helpers/fs.d.ts +2 -0
- package/dist/test-helpers/fs.d.ts.map +1 -0
- package/dist/test-helpers/fs.js +9 -0
- package/dist/usecases/context/resolve-context.d.ts +2 -0
- package/dist/usecases/context/resolve-context.d.ts.map +1 -1
- package/dist/usecases/context/resolve-context.js +4 -1
- package/dist/usecases/task/task-list-usecase.d.ts.map +1 -1
- package/dist/usecases/task/task-list-usecase.js +2 -8
- package/dist/workflow-runtime/fix.d.ts +9 -1
- package/dist/workflow-runtime/fix.d.ts.map +1 -1
- package/dist/workflow-runtime/fix.js +9 -1
- package/package.json +3 -2
- package/dist/backends/task-backend.test-helpers.d.ts +0 -4
- package/dist/backends/task-backend.test-helpers.d.ts.map +0 -1
- package/dist/backends/task-backend.test-helpers.js +0 -33
- package/dist/cli/run-cli/catalog.d.ts +0 -7
- package/dist/cli/run-cli/catalog.d.ts.map +0 -1
- package/dist/cli/run-cli/catalog.js +0 -22
- package/dist/cli/run-cli.core.pr-flow.test-helpers.d.ts +0 -3
- package/dist/cli/run-cli.core.pr-flow.test-helpers.d.ts.map +0 -1
- package/dist/cli/run-cli.core.pr-flow.test-helpers.js +0 -41
- package/dist/cli/run-cli.core.tasks.test-helpers.d.ts +0 -2
- package/dist/cli/run-cli.core.tasks.test-helpers.d.ts.map +0 -1
- package/dist/cli/run-cli.core.tasks.test-helpers.js +0 -6
- package/dist/commands/block.command.d.ts +0 -4
- package/dist/commands/block.command.d.ts.map +0 -1
- package/dist/commands/block.command.js +0 -2
- package/dist/commands/doctor.command.d.ts +0 -3
- package/dist/commands/doctor.command.d.ts.map +0 -1
- package/dist/commands/doctor.command.js +0 -2
- package/dist/commands/finish.command.d.ts +0 -4
- package/dist/commands/finish.command.d.ts.map +0 -1
- package/dist/commands/finish.command.js +0 -2
- package/dist/commands/recipes/install.command.d.ts +0 -3
- package/dist/commands/recipes/install.command.d.ts.map +0 -1
- package/dist/commands/recipes/install.command.js +0 -2
- package/dist/commands/start.command.d.ts +0 -4
- package/dist/commands/start.command.d.ts.map +0 -1
- package/dist/commands/start.command.js +0 -2
- package/dist/commands/task/list.command.d.ts +0 -4
- package/dist/commands/task/list.command.d.ts.map +0 -1
- package/dist/commands/task/list.command.js +0 -2
- package/dist/commands/task/next.command.d.ts +0 -4
- package/dist/commands/task/next.command.d.ts.map +0 -1
- package/dist/commands/task/next.command.js +0 -2
- package/dist/commands/task/search.command.d.ts +0 -4
- package/dist/commands/task/search.command.d.ts.map +0 -1
- package/dist/commands/task/search.command.js +0 -2
- package/dist/commands/task/show.command.d.ts +0 -4
- package/dist/commands/task/show.command.d.ts.map +0 -1
- package/dist/commands/task/show.command.js +0 -2
- package/dist/commands/verify.command.d.ts +0 -4
- package/dist/commands/verify.command.d.ts.map +0 -1
- package/dist/commands/verify.command.js +0 -2
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { CommandHandler, CommandSpec } from "../cli/spec/spec.js";
|
|
2
|
-
type
|
|
3
|
-
export declare const workflowSpec: CommandSpec<
|
|
4
|
-
export declare const runWorkflow: CommandHandler<
|
|
5
|
-
export {};
|
|
2
|
+
import { type GroupCommandParsed } from "../cli/group-command.js";
|
|
3
|
+
export declare const workflowSpec: CommandSpec<GroupCommandParsed>;
|
|
4
|
+
export declare const runWorkflow: CommandHandler<GroupCommandParsed>;
|
|
6
5
|
//# sourceMappingURL=workflow.command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.command.d.ts","sourceRoot":"","sources":["../../src/commands/workflow.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"workflow.command.d.ts","sourceRoot":"","sources":["../../src/commands/workflow.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AAEjC,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,kBAAkB,CAOxD,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,cAAc,CAAC,kBAAkB,CAS1D,CAAC"}
|
|
@@ -1,36 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { suggestOne } from "../cli/spec/suggest.js";
|
|
3
|
-
const WORKFLOW_SUBCOMMANDS = ["build", "restore", "debug", "sync", "land"];
|
|
1
|
+
import { loadDirectSubcommandNames, parseGroupCommand, throwGroupCommandUsage, } from "../cli/group-command.js";
|
|
4
2
|
export const workflowSpec = {
|
|
5
3
|
id: ["workflow"],
|
|
6
4
|
group: "Workflow",
|
|
7
5
|
summary: "Workflow contract commands.",
|
|
8
6
|
synopsis: ["agentplane workflow <subcommand> [options]"],
|
|
9
7
|
args: [{ name: "subcommand", required: false, variadic: true, valueHint: "<subcommand>" }],
|
|
10
|
-
parse: () => (
|
|
11
|
-
validateRaw: (raw) => {
|
|
12
|
-
const rest = Array.isArray(raw.args.subcommand) ? raw.args.subcommand : [];
|
|
13
|
-
const sub = rest[0];
|
|
14
|
-
if (!sub) {
|
|
15
|
-
throw usageError({
|
|
16
|
-
spec: workflowSpec,
|
|
17
|
-
command: "workflow",
|
|
18
|
-
message: "Missing workflow subcommand.",
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
const suggestion = suggestOne(String(sub), [...WORKFLOW_SUBCOMMANDS]);
|
|
22
|
-
const suffix = suggestion ? ` Did you mean: ${suggestion}?` : "";
|
|
23
|
-
throw usageError({
|
|
24
|
-
spec: workflowSpec,
|
|
25
|
-
command: "workflow",
|
|
26
|
-
message: `Unknown workflow subcommand: ${String(sub)}.${suffix}`,
|
|
27
|
-
});
|
|
28
|
-
},
|
|
8
|
+
parse: (raw) => parseGroupCommand(raw, "subcommand"),
|
|
29
9
|
};
|
|
30
|
-
export const runWorkflow = (_ctx) => {
|
|
31
|
-
|
|
10
|
+
export const runWorkflow = async (_ctx, p) => {
|
|
11
|
+
throwGroupCommandUsage({
|
|
32
12
|
spec: workflowSpec,
|
|
13
|
+
cmd: p.cmd,
|
|
14
|
+
subcommands: await loadDirectSubcommandNames(["workflow"]),
|
|
33
15
|
command: "workflow",
|
|
34
|
-
|
|
16
|
+
missingMessage: "Missing workflow subcommand.",
|
|
17
|
+
unknownMessage: (subcommand) => `Unknown workflow subcommand: ${subcommand}.`,
|
|
35
18
|
});
|
|
36
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allowlist.d.ts","sourceRoot":"","sources":["../../../src/policy/rules/allowlist.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE/D,wBAAgB,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"allowlist.d.ts","sourceRoot":"","sources":["../../../src/policy/rules/allowlist.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE/D,wBAAgB,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,YAAY,CAqD9D"}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { gitPathIsUnderPrefix, normalizeGitPathPrefix } from "../../shared/git-path.js";
|
|
2
|
-
import {
|
|
2
|
+
import { protectedPathAllowPrefixes } from "../../shared/protected-paths.js";
|
|
3
3
|
import { gitError, okResult } from "../result.js";
|
|
4
4
|
export function allowlistRule(ctx) {
|
|
5
5
|
const allowRaw = ctx.allow?.prefixes ?? [];
|
|
6
6
|
const staged = ctx.git.stagedPaths ?? [];
|
|
7
7
|
const allow = allowRaw.map((p) => normalizeGitPathPrefix(p));
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
:
|
|
15
|
-
|
|
8
|
+
const protectedAllow = protectedPathAllowPrefixes({
|
|
9
|
+
tasksPath: ctx.config.paths.tasks_path,
|
|
10
|
+
workflowDir: ctx.config.paths.workflow_dir,
|
|
11
|
+
taskId: ctx.taskId,
|
|
12
|
+
allowTasks: ctx.allow?.allowTasks === true,
|
|
13
|
+
allowPolicy: ctx.allow?.allowPolicy === true,
|
|
14
|
+
allowConfig: ctx.allow?.allowConfig === true,
|
|
15
|
+
allowHooks: ctx.allow?.allowHooks === true,
|
|
16
|
+
allowCI: ctx.allow?.allowCI === true,
|
|
17
|
+
});
|
|
18
|
+
const effectiveAllow = [...new Set([...allow, ...protectedAllow])];
|
|
16
19
|
if (staged.length === 0) {
|
|
17
20
|
return { ok: false, errors: [gitError("No staged files (git index empty)")], warnings: [] };
|
|
18
21
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import type { TaskData } from "../backends/task-backend.js";
|
|
1
|
+
import type { TaskBackendCapabilities, TaskData, TaskSummary, TaskWriteOptions } from "../backends/task-backend.js";
|
|
2
2
|
export type TaskBackendPort = {
|
|
3
|
+
capabilities: Pick<TaskBackendCapabilities, "canonical_source" | "projection" | "projection_read_mode" | "reads_from_projection_by_default">;
|
|
3
4
|
listTasks(): Promise<TaskData[]>;
|
|
5
|
+
listProjectionTasks?: () => Promise<TaskSummary[]>;
|
|
4
6
|
getTask(id: string): Promise<TaskData | null>;
|
|
5
|
-
writeTask(task: TaskData): Promise<void>;
|
|
7
|
+
writeTask(task: TaskData, opts?: TaskWriteOptions): Promise<void>;
|
|
6
8
|
exportProjectionSnapshot(path: string): Promise<void>;
|
|
7
9
|
};
|
|
8
10
|
//# sourceMappingURL=task-backend-port.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-backend-port.d.ts","sourceRoot":"","sources":["../../src/ports/task-backend-port.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"task-backend-port.d.ts","sourceRoot":"","sources":["../../src/ports/task-backend-port.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,QAAQ,EACR,WAAW,EACX,gBAAgB,EACjB,MAAM,6BAA6B,CAAC;AAErC,MAAM,MAAM,eAAe,GAAG;IAC5B,YAAY,EAAE,IAAI,CAChB,uBAAuB,EACvB,kBAAkB,GAAG,YAAY,GAAG,sBAAsB,GAAG,kCAAkC,CAChG,CAAC;IACF,SAAS,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjC,mBAAmB,CAAC,EAAE,MAAM,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IACnD,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;IAC9C,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { RunnerAdapterCapabilities, RunnerContextBundle, RunnerInvocation, RunnerResult } from "../types.js";
|
|
2
|
+
import { type RunnerAdapter } from "./shared.js";
|
|
3
|
+
export declare class CodexRunnerAdapter implements RunnerAdapter {
|
|
4
|
+
readonly id: "codex";
|
|
5
|
+
describeCapabilities(_bundle: RunnerContextBundle): RunnerAdapterCapabilities;
|
|
6
|
+
prepare(bundle: RunnerContextBundle): Promise<RunnerInvocation>;
|
|
7
|
+
execute(invocation: RunnerInvocation): Promise<RunnerResult>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=codex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../../src/runner/adapters/codex.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,yBAAyB,EACzB,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACb,MAAM,aAAa,CAAC;AAIrB,OAAO,EAKL,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;AAkMrB,qBAAa,kBAAmB,YAAW,aAAa;IACtD,QAAQ,CAAC,EAAE,EAAG,OAAO,CAAU;IAE/B,oBAAoB,CAAC,OAAO,EAAE,mBAAmB,GAAG,yBAAyB;IAI7E,OAAO,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAiD/D,OAAO,CAAC,UAAU,EAAE,gBAAgB,GAAG,OAAO,CAAC,YAAY,CAAC;CAkN7D"}
|
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { exitCodeForError } from "../../cli/exit-codes.js";
|
|
4
|
+
import { CliError } from "../../shared/errors.js";
|
|
5
|
+
import { evolveRunnerRunState } from "../artifacts.js";
|
|
6
|
+
import { runnerArtifactsFromSpecs, runnerAdapterCancelledResult, runnerAdapterFailureResult, runnerAdapterSuccessResult, } from "./shared.js";
|
|
7
|
+
import { exitCodeForSignal, runSupervisedProcess, } from "../process-supervision.js";
|
|
8
|
+
import { InvalidRunnerResultManifestError, applyRunnerResultManifest, manifestFromRunnerResult, preserveRunnerResultManifestSource, preserveInvalidRunnerResultManifest, readRunnerResultManifest, writeRunnerResultManifest, } from "../result-manifest.js";
|
|
9
|
+
import { RunnerRunRepository } from "../run-repository.js";
|
|
10
|
+
import { assertRunnerManifestArtifactPolicy, readRecipeArtifactPrefixesFromRunnerEnv, } from "../result-manifest-policy.js";
|
|
11
|
+
import { buildRecipeRunnerEnv, readRecipeRunProfile } from "./recipe-run-profile.js";
|
|
12
|
+
const CODEX_LAST_MESSAGE_FILENAME = "codex-last-message.md";
|
|
13
|
+
const CODEX_SANDBOX_VALUES = new Set(["read-only", "workspace-write", "danger-full-access"]);
|
|
14
|
+
const SUPPORTED_CODEX_SANDBOXES = [...CODEX_SANDBOX_VALUES];
|
|
15
|
+
const CODEX_RUN_PROFILE_CAPABILITIES = {
|
|
16
|
+
adapter_id: "codex",
|
|
17
|
+
fields: {
|
|
18
|
+
sandbox: {
|
|
19
|
+
level: "native",
|
|
20
|
+
channel: "argv",
|
|
21
|
+
supported_values: SUPPORTED_CODEX_SANDBOXES,
|
|
22
|
+
note: "Recipe sandbox is enforced through codex --sandbox argv mapping.",
|
|
23
|
+
},
|
|
24
|
+
writes_artifacts_to: {
|
|
25
|
+
level: "advisory",
|
|
26
|
+
channel: "env",
|
|
27
|
+
note: "Recipe artifact prefixes are exported through env and enforced post-run against external manifest artifacts and evidence paths.",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
function byteLength(text) {
|
|
32
|
+
return Buffer.byteLength(text ?? "", "utf8");
|
|
33
|
+
}
|
|
34
|
+
function durationMs(startedAt, endedAt) {
|
|
35
|
+
const started = Date.parse(startedAt);
|
|
36
|
+
const ended = Date.parse(endedAt);
|
|
37
|
+
if (Number.isNaN(started) || Number.isNaN(ended))
|
|
38
|
+
return undefined;
|
|
39
|
+
return Math.max(0, ended - started);
|
|
40
|
+
}
|
|
41
|
+
function buildInvocationEventData(invocation) {
|
|
42
|
+
return {
|
|
43
|
+
executable: invocation.argv[0] ?? null,
|
|
44
|
+
argv_count: invocation.argv.length,
|
|
45
|
+
cwd: invocation.run_dir,
|
|
46
|
+
env_keys: Object.keys(invocation.env).toSorted(),
|
|
47
|
+
trace_policy: invocation.trace_policy,
|
|
48
|
+
timeout_policy: invocation.timeout_policy,
|
|
49
|
+
has_bootstrap_path: typeof invocation.bootstrap_path === "string" && invocation.bootstrap_path.trim().length > 0,
|
|
50
|
+
has_output_last_message_path: typeof invocation.output_last_message_path === "string" &&
|
|
51
|
+
invocation.output_last_message_path.trim().length > 0,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
async function readOptionalText(filePath) {
|
|
55
|
+
if (!filePath?.trim())
|
|
56
|
+
return null;
|
|
57
|
+
try {
|
|
58
|
+
return await readFile(filePath, "utf8");
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function buildCodexArtifacts(opts) {
|
|
65
|
+
return (runnerArtifactsFromSpecs([
|
|
66
|
+
{ path: opts.invocation.bundle_path, label: "bundle" },
|
|
67
|
+
{ path: opts.invocation.bootstrap_path, label: "bootstrap" },
|
|
68
|
+
{ path: opts.trace_artifact_path, label: "raw-trace" },
|
|
69
|
+
{ path: opts.trace_archive_path, label: "raw-trace-gzip" },
|
|
70
|
+
{ path: opts.stderr_artifact_path, label: "stderr-log" },
|
|
71
|
+
{ path: opts.stderr_archive_path, label: "stderr-log-gzip" },
|
|
72
|
+
{ path: opts.source_manifest_path, label: "source-result-manifest" },
|
|
73
|
+
{ path: opts.invocation.output_last_message_path, label: "assistant-last-message" },
|
|
74
|
+
{ path: opts.invalid_manifest_path, label: "invalid-result-manifest" },
|
|
75
|
+
{ path: opts.invocation.result_path, label: "result-manifest" },
|
|
76
|
+
]) ?? []);
|
|
77
|
+
}
|
|
78
|
+
function assertCodexBundle(bundle) {
|
|
79
|
+
if (bundle.execution.adapter_id !== "codex") {
|
|
80
|
+
throw new Error(`Codex adapter cannot prepare bundle for adapter_id=${JSON.stringify(bundle.execution.adapter_id)}`);
|
|
81
|
+
}
|
|
82
|
+
if (!bundle.execution.artifact_paths.bundle_path.trim()) {
|
|
83
|
+
throw new Error("Codex adapter requires a non-empty bundle path");
|
|
84
|
+
}
|
|
85
|
+
if (!bundle.execution.artifact_paths.run_dir.trim()) {
|
|
86
|
+
throw new Error("Codex adapter requires a non-empty run dir");
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function assertCodexInvocation(invocation) {
|
|
90
|
+
if (invocation.adapter_id !== "codex") {
|
|
91
|
+
throw new Error(`Codex adapter cannot execute invocation for adapter_id=${JSON.stringify(invocation.adapter_id)}`);
|
|
92
|
+
}
|
|
93
|
+
if (!invocation.bundle_path.trim()) {
|
|
94
|
+
throw new Error("Codex adapter invocation is missing bundle_path");
|
|
95
|
+
}
|
|
96
|
+
if (!invocation.run_dir.trim()) {
|
|
97
|
+
throw new Error("Codex adapter invocation is missing run_dir");
|
|
98
|
+
}
|
|
99
|
+
if (!invocation.state_path.trim()) {
|
|
100
|
+
throw new Error("Codex adapter invocation is missing state_path");
|
|
101
|
+
}
|
|
102
|
+
if (!invocation.events_path.trim()) {
|
|
103
|
+
throw new Error("Codex adapter invocation is missing events_path");
|
|
104
|
+
}
|
|
105
|
+
if (!invocation.result_path.trim()) {
|
|
106
|
+
throw new Error("Codex adapter invocation is missing result_path");
|
|
107
|
+
}
|
|
108
|
+
if (!invocation.trace_path.trim()) {
|
|
109
|
+
throw new Error("Codex adapter invocation is missing trace_path");
|
|
110
|
+
}
|
|
111
|
+
if (!invocation.stderr_path.trim()) {
|
|
112
|
+
throw new Error("Codex adapter invocation is missing stderr_path");
|
|
113
|
+
}
|
|
114
|
+
if (!invocation.bootstrap_path?.trim()) {
|
|
115
|
+
throw new Error("Codex adapter invocation is missing bootstrap_path");
|
|
116
|
+
}
|
|
117
|
+
if (invocation.argv.length < 5) {
|
|
118
|
+
throw new Error("Codex adapter invocation is missing normalized argv metadata");
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function resolveCodexSandbox(value) {
|
|
122
|
+
const normalized = typeof value === "string" ? value.trim() : "";
|
|
123
|
+
if (!normalized)
|
|
124
|
+
return "danger-full-access";
|
|
125
|
+
if (CODEX_SANDBOX_VALUES.has(normalized))
|
|
126
|
+
return normalized;
|
|
127
|
+
throw new CliError({
|
|
128
|
+
exitCode: 8,
|
|
129
|
+
code: "E_RUNTIME",
|
|
130
|
+
message: `Codex runner does not support recipe sandbox ${JSON.stringify(normalized)}; ` +
|
|
131
|
+
`supported values: ${SUPPORTED_CODEX_SANDBOXES.join(", ")}.`,
|
|
132
|
+
context: {
|
|
133
|
+
adapter_id: "codex",
|
|
134
|
+
requested_sandbox: normalized,
|
|
135
|
+
supported_sandboxes: SUPPORTED_CODEX_SANDBOXES,
|
|
136
|
+
},
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
function assertExecuteModeManifest(opts) {
|
|
140
|
+
if (opts.invocation.dry_run)
|
|
141
|
+
return;
|
|
142
|
+
if (opts.processResult.exit_code !== 0)
|
|
143
|
+
return;
|
|
144
|
+
if (opts.processResult.timeout_reason !== null)
|
|
145
|
+
return;
|
|
146
|
+
if (opts.processResult.cancel_requested_at)
|
|
147
|
+
return;
|
|
148
|
+
if (opts.manifest !== null)
|
|
149
|
+
return;
|
|
150
|
+
throw new CliError({
|
|
151
|
+
exitCode: exitCodeForError("E_RUNTIME"),
|
|
152
|
+
code: "E_RUNTIME",
|
|
153
|
+
message: `Codex exited successfully but did not write a valid runner result manifest to ` +
|
|
154
|
+
`${JSON.stringify(opts.invocation.result_path)}.`,
|
|
155
|
+
context: {
|
|
156
|
+
adapter_id: "codex",
|
|
157
|
+
result_path: opts.invocation.result_path,
|
|
158
|
+
exit_code: opts.processResult.exit_code,
|
|
159
|
+
},
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
export class CodexRunnerAdapter {
|
|
163
|
+
id = "codex";
|
|
164
|
+
describeCapabilities(_bundle) {
|
|
165
|
+
return structuredClone(CODEX_RUN_PROFILE_CAPABILITIES);
|
|
166
|
+
}
|
|
167
|
+
prepare(bundle) {
|
|
168
|
+
assertCodexBundle(bundle);
|
|
169
|
+
const { execution } = bundle;
|
|
170
|
+
const runProfile = readRecipeRunProfile(bundle.recipe);
|
|
171
|
+
const sandbox = resolveCodexSandbox(runProfile?.sandbox);
|
|
172
|
+
const recipeEnv = buildRecipeRunnerEnv(bundle.recipe);
|
|
173
|
+
return Promise.resolve({
|
|
174
|
+
adapter_id: this.id,
|
|
175
|
+
run_id: execution.run_id,
|
|
176
|
+
run_dir: execution.artifact_paths.run_dir,
|
|
177
|
+
bundle_path: execution.artifact_paths.bundle_path,
|
|
178
|
+
state_path: execution.artifact_paths.state_path,
|
|
179
|
+
events_path: execution.artifact_paths.events_path,
|
|
180
|
+
result_path: execution.artifact_paths.result_path,
|
|
181
|
+
trace_path: execution.artifact_paths.trace_path,
|
|
182
|
+
stderr_path: execution.artifact_paths.stderr_path,
|
|
183
|
+
trace_policy: execution.trace_policy,
|
|
184
|
+
timeout_policy: execution.timeout_policy,
|
|
185
|
+
bootstrap_path: execution.artifact_paths.bootstrap_path,
|
|
186
|
+
output_last_message_path: path.join(execution.artifact_paths.run_dir, CODEX_LAST_MESSAGE_FILENAME),
|
|
187
|
+
argv: [
|
|
188
|
+
"codex",
|
|
189
|
+
"-a",
|
|
190
|
+
"never",
|
|
191
|
+
"exec",
|
|
192
|
+
"--json",
|
|
193
|
+
"--output-last-message",
|
|
194
|
+
path.join(execution.artifact_paths.run_dir, CODEX_LAST_MESSAGE_FILENAME),
|
|
195
|
+
"-C",
|
|
196
|
+
bundle.repository.git_root,
|
|
197
|
+
"-s",
|
|
198
|
+
sandbox,
|
|
199
|
+
"-",
|
|
200
|
+
],
|
|
201
|
+
env: {
|
|
202
|
+
AGENTPLANE_RUNNER_ADAPTER: this.id,
|
|
203
|
+
AGENTPLANE_RUNNER_MODE: execution.mode,
|
|
204
|
+
AGENTPLANE_RUNNER_API_VERSION: bundle.runner_api_version,
|
|
205
|
+
AGENTPLANE_RUNNER_TARGET: bundle.target.kind,
|
|
206
|
+
AGENTPLANE_RUNNER_RESULT_PATH: execution.artifact_paths.result_path,
|
|
207
|
+
...recipeEnv,
|
|
208
|
+
},
|
|
209
|
+
dry_run: execution.mode === "dry_run",
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
execute(invocation) {
|
|
213
|
+
const started_at = new Date().toISOString();
|
|
214
|
+
let processResult = null;
|
|
215
|
+
return (async () => {
|
|
216
|
+
try {
|
|
217
|
+
assertCodexInvocation(invocation);
|
|
218
|
+
const repository = RunnerRunRepository.fromInvocation(invocation);
|
|
219
|
+
const bootstrapText = await readFile(invocation.bootstrap_path, "utf8");
|
|
220
|
+
processResult = await runSupervisedProcess({
|
|
221
|
+
invocation,
|
|
222
|
+
stdin_text: bootstrapText,
|
|
223
|
+
start_message: "codex exec started",
|
|
224
|
+
});
|
|
225
|
+
const lastMessage = await readOptionalText(invocation.output_last_message_path);
|
|
226
|
+
const artifacts = buildCodexArtifacts({
|
|
227
|
+
invocation,
|
|
228
|
+
trace_artifact_path: processResult.trace_artifact_path,
|
|
229
|
+
trace_archive_path: processResult.trace_archive_path,
|
|
230
|
+
stderr_artifact_path: processResult.stderr_artifact_path,
|
|
231
|
+
stderr_archive_path: processResult.stderr_archive_path,
|
|
232
|
+
});
|
|
233
|
+
const output_paths = artifacts.map((artifact) => artifact.path);
|
|
234
|
+
const success = processResult.exit_code === 0;
|
|
235
|
+
const ended_at = processResult.ended_at;
|
|
236
|
+
const timedOut = processResult.timeout_reason !== null;
|
|
237
|
+
const metrics = {
|
|
238
|
+
duration_ms: durationMs(processResult.started_at, ended_at),
|
|
239
|
+
stdout_bytes: processResult.stdout_bytes,
|
|
240
|
+
stderr_bytes: processResult.stderr_bytes,
|
|
241
|
+
output_last_message_bytes: lastMessage === null ? null : byteLength(lastMessage),
|
|
242
|
+
};
|
|
243
|
+
const baseResult = timedOut
|
|
244
|
+
? runnerAdapterFailureResult({
|
|
245
|
+
err: new Error(`Codex execution timed out (${processResult.timeout_reason}).`),
|
|
246
|
+
summary: `Codex execution timed out (${processResult.timeout_reason}).`,
|
|
247
|
+
stderr_summary: "Timeout details were captured in stderr.log and agent-trace.jsonl.",
|
|
248
|
+
started_at: processResult.started_at,
|
|
249
|
+
ended_at,
|
|
250
|
+
exit_code: 124,
|
|
251
|
+
output_paths,
|
|
252
|
+
metrics,
|
|
253
|
+
timeout_reason: processResult.timeout_reason,
|
|
254
|
+
})
|
|
255
|
+
: processResult.cancel_requested_at
|
|
256
|
+
? runnerAdapterCancelledResult({
|
|
257
|
+
reason: processResult.cancel_signal
|
|
258
|
+
? `Codex runner cancelled via ${processResult.cancel_signal}.`
|
|
259
|
+
: "Codex runner cancelled.",
|
|
260
|
+
summary: "Codex execution was cancelled.",
|
|
261
|
+
stderr_summary: "Cancellation details were recorded in stderr.log and agent-trace.jsonl.",
|
|
262
|
+
started_at: processResult.started_at,
|
|
263
|
+
ended_at,
|
|
264
|
+
exit_code: processResult.exit_code ?? exitCodeForSignal(processResult.exit_signal) ?? null,
|
|
265
|
+
output_paths,
|
|
266
|
+
metrics,
|
|
267
|
+
})
|
|
268
|
+
: success
|
|
269
|
+
? runnerAdapterSuccessResult({
|
|
270
|
+
summary: "Codex execution completed successfully.",
|
|
271
|
+
started_at: processResult.started_at,
|
|
272
|
+
ended_at,
|
|
273
|
+
exit_code: processResult.exit_code ?? 0,
|
|
274
|
+
stdout_summary: lastMessage?.trim()
|
|
275
|
+
? "Assistant output was captured in codex-last-message.md; raw execution trace is in agent-trace.jsonl."
|
|
276
|
+
: "Raw execution trace was captured in agent-trace.jsonl.",
|
|
277
|
+
output_paths,
|
|
278
|
+
metrics,
|
|
279
|
+
})
|
|
280
|
+
: runnerAdapterFailureResult({
|
|
281
|
+
err: new Error(`Codex exited with code ${processResult.exit_code ?? "unknown"}`),
|
|
282
|
+
summary: "Codex execution failed.",
|
|
283
|
+
stderr_summary: "Failure details were captured in stderr.log and agent-trace.jsonl.",
|
|
284
|
+
started_at: processResult.started_at,
|
|
285
|
+
ended_at,
|
|
286
|
+
exit_code: processResult.exit_code ?? exitCodeForSignal(processResult.exit_signal) ?? 1,
|
|
287
|
+
output_paths,
|
|
288
|
+
metrics,
|
|
289
|
+
timeout_reason: processResult.timeout_reason,
|
|
290
|
+
});
|
|
291
|
+
const manifest = await readRunnerResultManifest(invocation.result_path);
|
|
292
|
+
assertRunnerManifestArtifactPolicy({
|
|
293
|
+
adapter_id: invocation.adapter_id,
|
|
294
|
+
allowed_prefixes: readRecipeArtifactPrefixesFromRunnerEnv(invocation.env),
|
|
295
|
+
manifest,
|
|
296
|
+
});
|
|
297
|
+
assertExecuteModeManifest({
|
|
298
|
+
invocation,
|
|
299
|
+
processResult,
|
|
300
|
+
manifest,
|
|
301
|
+
});
|
|
302
|
+
const result = applyRunnerResultManifest({
|
|
303
|
+
base: {
|
|
304
|
+
...baseResult,
|
|
305
|
+
artifacts,
|
|
306
|
+
capabilities_used: ["codex.exec"],
|
|
307
|
+
},
|
|
308
|
+
manifest,
|
|
309
|
+
});
|
|
310
|
+
await writeRunnerResultManifest({
|
|
311
|
+
result_path: invocation.result_path,
|
|
312
|
+
manifest: manifestFromRunnerResult(result),
|
|
313
|
+
});
|
|
314
|
+
const stateAfter = await repository.readState();
|
|
315
|
+
if (stateAfter) {
|
|
316
|
+
await repository.writeState(evolveRunnerRunState({
|
|
317
|
+
state: stateAfter,
|
|
318
|
+
status: result.status,
|
|
319
|
+
result,
|
|
320
|
+
supervision: {
|
|
321
|
+
...stateAfter.supervision,
|
|
322
|
+
pid: processResult.pid,
|
|
323
|
+
command: invocation.argv.join(" "),
|
|
324
|
+
started_at: processResult.started_at,
|
|
325
|
+
heartbeat_at: processResult.heartbeat_at,
|
|
326
|
+
exit_signal: processResult.exit_signal,
|
|
327
|
+
timeout_reason: processResult.timeout_reason,
|
|
328
|
+
timeout_requested_at: processResult.timeout_requested_at,
|
|
329
|
+
terminate_sent_at: processResult.terminate_sent_at,
|
|
330
|
+
kill_sent_at: processResult.kill_sent_at,
|
|
331
|
+
force_killed: processResult.force_killed,
|
|
332
|
+
},
|
|
333
|
+
}));
|
|
334
|
+
}
|
|
335
|
+
await repository.appendEvent({
|
|
336
|
+
at: result.ended_at,
|
|
337
|
+
type: "runner_execute_finish",
|
|
338
|
+
message: `codex exec finished with status=${result.status}`,
|
|
339
|
+
data: {
|
|
340
|
+
...buildInvocationEventData(invocation),
|
|
341
|
+
pid: processResult.pid,
|
|
342
|
+
exit_signal: processResult.exit_signal,
|
|
343
|
+
cancel_requested_at: processResult.cancel_requested_at,
|
|
344
|
+
cancel_signal: processResult.cancel_signal,
|
|
345
|
+
timeout_reason: processResult.timeout_reason,
|
|
346
|
+
timeout_requested_at: processResult.timeout_requested_at,
|
|
347
|
+
terminate_sent_at: processResult.terminate_sent_at,
|
|
348
|
+
kill_sent_at: processResult.kill_sent_at,
|
|
349
|
+
force_killed: processResult.force_killed,
|
|
350
|
+
exit_code: result.exit_code,
|
|
351
|
+
output_paths,
|
|
352
|
+
metrics: result.metrics,
|
|
353
|
+
},
|
|
354
|
+
});
|
|
355
|
+
return result;
|
|
356
|
+
}
|
|
357
|
+
catch (err) {
|
|
358
|
+
const ended_at = new Date().toISOString();
|
|
359
|
+
const sourceManifestPath = await preserveRunnerResultManifestSource(invocation.result_path);
|
|
360
|
+
const invalidManifestPath = err instanceof InvalidRunnerResultManifestError
|
|
361
|
+
? await preserveInvalidRunnerResultManifest({
|
|
362
|
+
result_path: invocation.result_path,
|
|
363
|
+
error: err,
|
|
364
|
+
})
|
|
365
|
+
: null;
|
|
366
|
+
const artifacts = buildCodexArtifacts({
|
|
367
|
+
invocation,
|
|
368
|
+
trace_artifact_path: processResult?.trace_artifact_path,
|
|
369
|
+
trace_archive_path: processResult?.trace_archive_path,
|
|
370
|
+
stderr_artifact_path: processResult?.stderr_artifact_path,
|
|
371
|
+
stderr_archive_path: processResult?.stderr_archive_path,
|
|
372
|
+
source_manifest_path: sourceManifestPath,
|
|
373
|
+
invalid_manifest_path: invalidManifestPath,
|
|
374
|
+
});
|
|
375
|
+
const output_paths = artifacts.map((artifact) => artifact.path);
|
|
376
|
+
const result = runnerAdapterFailureResult({
|
|
377
|
+
err,
|
|
378
|
+
summary: "Codex execution failed before producing a valid result manifest.",
|
|
379
|
+
started_at,
|
|
380
|
+
ended_at,
|
|
381
|
+
exit_code: err instanceof CliError ? err.exitCode : undefined,
|
|
382
|
+
output_paths,
|
|
383
|
+
});
|
|
384
|
+
await writeRunnerResultManifest({
|
|
385
|
+
result_path: invocation.result_path,
|
|
386
|
+
manifest: manifestFromRunnerResult({
|
|
387
|
+
...result,
|
|
388
|
+
artifacts,
|
|
389
|
+
capabilities_used: ["codex.exec"],
|
|
390
|
+
}),
|
|
391
|
+
});
|
|
392
|
+
const stateAfter = await RunnerRunRepository.fromInvocation(invocation).readState();
|
|
393
|
+
if (stateAfter) {
|
|
394
|
+
await RunnerRunRepository.fromInvocation(invocation).writeState(evolveRunnerRunState({
|
|
395
|
+
state: stateAfter,
|
|
396
|
+
status: result.status,
|
|
397
|
+
result,
|
|
398
|
+
}));
|
|
399
|
+
}
|
|
400
|
+
await RunnerRunRepository.fromInvocation(invocation).appendEvent({
|
|
401
|
+
at: result.ended_at,
|
|
402
|
+
type: "runner_execute_error",
|
|
403
|
+
message: result.stderr_summary ?? "codex exec failed",
|
|
404
|
+
data: {
|
|
405
|
+
...buildInvocationEventData(invocation),
|
|
406
|
+
output_paths,
|
|
407
|
+
metrics: result.metrics,
|
|
408
|
+
},
|
|
409
|
+
});
|
|
410
|
+
return result;
|
|
411
|
+
}
|
|
412
|
+
})();
|
|
413
|
+
}
|
|
414
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RunnerCustomConfig } from "@agentplaneorg/core";
|
|
2
|
+
import type { RunnerAdapterCapabilities, RunnerContextBundle, RunnerInvocation, RunnerResult } from "../types.js";
|
|
3
|
+
import { type RunnerAdapter } from "./shared.js";
|
|
4
|
+
export declare class CustomRunnerAdapter implements RunnerAdapter {
|
|
5
|
+
private readonly config;
|
|
6
|
+
readonly id: "custom";
|
|
7
|
+
constructor(config: RunnerCustomConfig | undefined);
|
|
8
|
+
describeCapabilities(_bundle: RunnerContextBundle): RunnerAdapterCapabilities;
|
|
9
|
+
prepare(bundle: RunnerContextBundle): Promise<RunnerInvocation>;
|
|
10
|
+
execute(invocation: RunnerInvocation): Promise<RunnerResult>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=custom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom.d.ts","sourceRoot":"","sources":["../../../src/runner/adapters/custom.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAI9D,OAAO,KAAK,EACV,yBAAyB,EACzB,mBAAmB,EACnB,gBAAgB,EAEhB,YAAY,EACb,MAAM,aAAa,CAAC;AAErB,OAAO,EAKL,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;AA+TrB,qBAAa,mBAAoB,YAAW,aAAa;IAG3C,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,QAAQ,CAAC,EAAE,EAAG,QAAQ,CAAU;gBAEH,MAAM,EAAE,kBAAkB,GAAG,SAAS;IAEnE,oBAAoB,CAAC,OAAO,EAAE,mBAAmB,GAAG,yBAAyB;IAI7E,OAAO,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAmD/D,OAAO,CAAC,UAAU,EAAE,gBAAgB,GAAG,OAAO,CAAC,YAAY,CAAC;CAqN7D"}
|