agentplane 0.3.15 → 0.3.16
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/policy/incidents.md +7 -0
- package/bin/agentplane.js +1 -1
- package/bin/framework-dev-contract.js +1 -0
- package/dist/.build-manifest.json +506 -321
- package/dist/backends/task-backend/load.d.ts.map +1 -1
- package/dist/backends/task-backend/load.js +32 -19
- package/dist/backends/task-backend/local-backend-doc.d.ts.map +1 -1
- package/dist/backends/task-backend/local-backend-doc.js +1 -1
- package/dist/backends/task-backend/redmine/backend-runtime.d.ts +147 -0
- package/dist/backends/task-backend/redmine/backend-runtime.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-runtime.js +258 -0
- package/dist/backends/task-backend/redmine/backend-sync/context.d.ts +44 -0
- package/dist/backends/task-backend/redmine/backend-sync/context.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/context.js +8 -0
- package/dist/backends/task-backend/redmine/backend-sync/ids.d.ts +6 -0
- package/dist/backends/task-backend/redmine/backend-sync/ids.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/ids.js +21 -0
- package/dist/backends/task-backend/redmine/backend-sync/migration.d.ts +4 -0
- package/dist/backends/task-backend/redmine/backend-sync/migration.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/migration.js +87 -0
- package/dist/backends/task-backend/redmine/backend-sync/status.d.ts +10 -0
- package/dist/backends/task-backend/redmine/backend-sync/status.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/status.js +78 -0
- package/dist/backends/task-backend/redmine/backend-sync/sync.d.ts +12 -0
- package/dist/backends/task-backend/redmine/backend-sync/sync.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/sync.js +82 -0
- package/dist/backends/task-backend/redmine/backend-sync/write.d.ts +5 -0
- package/dist/backends/task-backend/redmine/backend-sync/write.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/write.js +100 -0
- package/dist/backends/task-backend/redmine/backend-sync.d.ts +6 -66
- package/dist/backends/task-backend/redmine/backend-sync.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine/backend-sync.js +5 -367
- package/dist/backends/task-backend/redmine-backend.d.ts +2 -33
- package/dist/backends/task-backend/redmine-backend.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine-backend.js +26 -241
- package/dist/backends/task-backend/shared/errors.d.ts +12 -0
- package/dist/backends/task-backend/shared/errors.d.ts.map +1 -1
- package/dist/backends/task-backend/shared/errors.js +12 -0
- package/dist/cli/archive.d.ts.map +1 -1
- package/dist/cli/archive.js +3 -5
- package/dist/cli/error-map.d.ts +7 -1
- package/dist/cli/error-map.d.ts.map +1 -1
- package/dist/cli/error-map.js +231 -19
- package/dist/cli/exit-codes.d.ts +14 -2
- package/dist/cli/exit-codes.d.ts.map +1 -1
- package/dist/cli/exit-codes.js +24 -11
- package/dist/cli/output.d.ts +3 -0
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +25 -14
- package/dist/cli/prompts.d.ts.map +1 -1
- package/dist/cli/prompts.js +44 -0
- package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/core.js +34 -76
- package/dist/cli/run-cli/command-catalog/lifecycle.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/lifecycle.js +23 -26
- package/dist/cli/run-cli/command-catalog/project.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/project.js +39 -54
- package/dist/cli/run-cli/command-catalog/shared.d.ts +15 -3
- package/dist/cli/run-cli/command-catalog/shared.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/shared.js +19 -6
- package/dist/cli/run-cli/command-catalog/task.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/task.js +63 -57
- package/dist/cli/run-cli/command-loaders.d.ts +174 -0
- package/dist/cli/run-cli/command-loaders.d.ts.map +1 -0
- package/dist/cli/run-cli/command-loaders.js +128 -0
- package/dist/cli/run-cli/commands/init/model.d.ts +42 -0
- package/dist/cli/run-cli/commands/init/model.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/orchestrate.d.ts +9 -0
- package/dist/cli/run-cli/commands/init/orchestrate.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/orchestrate.js +321 -0
- package/dist/cli/run-cli/commands/init/parsers.d.ts +5 -0
- package/dist/cli/run-cli/commands/init/parsers.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/parsers.js +36 -0
- package/dist/cli/run-cli/commands/init/presets.d.ts +15 -0
- package/dist/cli/run-cli/commands/init/presets.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/presets.js +63 -0
- package/dist/cli/run-cli/commands/init/spec.d.ts +5 -0
- package/dist/cli/run-cli/commands/init/spec.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/spec.js +212 -0
- package/dist/cli/run-cli/commands/init/write-config.d.ts +1 -0
- package/dist/cli/run-cli/commands/init/write-config.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/write-config.js +1 -0
- package/dist/cli/run-cli/commands/init/write-gitignore.js +1 -1
- package/dist/cli/run-cli/commands/init.d.ts +1 -28
- package/dist/cli/run-cli/commands/init.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init.js +1 -596
- package/dist/cli/run-cli/update-warning.d.ts +1 -0
- package/dist/cli/run-cli/update-warning.d.ts.map +1 -1
- package/dist/cli/run-cli/update-warning.js +10 -2
- package/dist/cli/run-cli.d.ts.map +1 -1
- package/dist/cli/run-cli.js +1 -2
- package/dist/cli/spec/errors.d.ts +13 -1
- package/dist/cli/spec/errors.d.ts.map +1 -1
- package/dist/cli/spec/errors.js +14 -4
- package/dist/commands/backend.d.ts.map +1 -1
- package/dist/commands/backend.js +66 -118
- package/dist/commands/block.spec.js +1 -1
- package/dist/commands/branch/work-start.js +1 -1
- package/dist/commands/commit.spec.js +1 -1
- package/dist/commands/doctor/branch-pr.js +1 -1
- package/dist/commands/doctor/fixes.js +1 -1
- package/dist/commands/doctor/runtime.d.ts.map +1 -1
- package/dist/commands/doctor/runtime.js +2 -2
- package/dist/commands/doctor/workspace.js +1 -1
- package/dist/commands/finish.spec.js +1 -1
- package/dist/commands/guard/commit.command.js +1 -1
- package/dist/commands/guard/impl/clean.d.ts +6 -0
- package/dist/commands/guard/impl/clean.d.ts.map +1 -0
- package/dist/commands/guard/impl/clean.js +29 -0
- package/dist/commands/guard/impl/close-dirt.d.ts +6 -0
- package/dist/commands/guard/impl/close-dirt.d.ts.map +1 -0
- package/dist/commands/guard/impl/close-dirt.js +56 -0
- package/dist/commands/guard/impl/commands.d.ts +4 -36
- package/dist/commands/guard/impl/commands.d.ts.map +1 -1
- package/dist/commands/guard/impl/commands.js +4 -549
- package/dist/commands/guard/impl/comment-commit.js +1 -1
- package/dist/commands/guard/impl/commit-diagnostics.d.ts +4 -0
- package/dist/commands/guard/impl/commit-diagnostics.d.ts.map +1 -0
- package/dist/commands/guard/impl/commit-diagnostics.js +150 -0
- package/dist/commands/guard/impl/commit.d.ts +25 -0
- package/dist/commands/guard/impl/commit.d.ts.map +1 -0
- package/dist/commands/guard/impl/commit.js +366 -0
- package/dist/commands/guard/impl/guard-commit.d.ts +3 -0
- package/dist/commands/guard/impl/guard-commit.d.ts.map +1 -0
- package/dist/commands/guard/impl/guard-commit.js +21 -0
- 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 -2
- package/dist/commands/guard/impl/suggest.d.ts +6 -0
- package/dist/commands/guard/impl/suggest.d.ts.map +1 -0
- package/dist/commands/guard/impl/suggest.js +33 -0
- package/dist/commands/hooks/index.d.ts +3 -0
- package/dist/commands/hooks/index.d.ts.map +1 -1
- package/dist/commands/hooks/index.js +27 -10
- package/dist/commands/pr/integrate/cmd.js +1 -1
- package/dist/commands/pr/integrate/internal/prepare.js +1 -1
- package/dist/commands/pr/internal/auto-commit.d.ts.map +1 -1
- package/dist/commands/pr/internal/auto-commit.js +2 -5
- package/dist/commands/pr/internal/gh-api.d.ts.map +1 -1
- package/dist/commands/pr/internal/gh-api.js +15 -8
- package/dist/commands/pr/internal/sync-branch.d.ts +0 -1
- package/dist/commands/pr/internal/sync-branch.d.ts.map +1 -1
- package/dist/commands/pr/internal/sync-branch.js +2 -5
- package/dist/commands/pr/internal/sync.d.ts.map +1 -1
- package/dist/commands/pr/internal/sync.js +30 -0
- package/dist/commands/pr/open.d.ts.map +1 -1
- package/dist/commands/pr/open.js +98 -8
- package/dist/commands/recipes/impl/resolver.js +1 -1
- package/dist/commands/recipes/impl/version.js +1 -1
- package/dist/commands/release/apply.command.js +1 -1
- package/dist/commands/release/apply.mutation.d.ts +1 -0
- package/dist/commands/release/apply.mutation.d.ts.map +1 -1
- package/dist/commands/release/apply.mutation.js +4 -0
- package/dist/commands/release/apply.pipeline/finalize.d.ts +21 -0
- package/dist/commands/release/apply.pipeline/finalize.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline/finalize.js +80 -0
- package/dist/commands/release/apply.pipeline/mutation.d.ts +18 -0
- package/dist/commands/release/apply.pipeline/mutation.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline/mutation.js +78 -0
- package/dist/commands/release/apply.pipeline/preflight.d.ts +25 -0
- package/dist/commands/release/apply.pipeline/preflight.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline/preflight.js +69 -0
- package/dist/commands/release/apply.pipeline/shared.d.ts +2 -0
- package/dist/commands/release/apply.pipeline/shared.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline/shared.js +5 -0
- package/dist/commands/release/apply.pipeline/state.d.ts +25 -0
- package/dist/commands/release/apply.pipeline/state.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline/state.js +129 -0
- package/dist/commands/release/apply.pipeline.d.ts +1 -1
- package/dist/commands/release/apply.pipeline.d.ts.map +1 -1
- package/dist/commands/release/apply.pipeline.js +4 -347
- package/dist/commands/release/apply.preflight.d.ts +9 -6
- package/dist/commands/release/apply.preflight.d.ts.map +1 -1
- package/dist/commands/release/apply.preflight.js +71 -51
- package/dist/commands/runtime.command.d.ts +2 -2
- package/dist/commands/runtime.command.d.ts.map +1 -1
- package/dist/commands/runtime.command.js +2 -2
- package/dist/commands/scenario/impl/commands.d.ts.map +1 -1
- package/dist/commands/scenario/impl/commands.js +52 -39
- package/dist/commands/scenario/impl/report.d.ts.map +1 -1
- package/dist/commands/scenario/impl/report.js +4 -7
- package/dist/commands/shared/allow-prefix-policy.d.ts.map +1 -0
- package/dist/{shared → commands/shared}/allow-prefix-policy.js +1 -1
- package/dist/commands/shared/comment-format.d.ts.map +1 -0
- package/dist/commands/shared/diagnostics.d.ts.map +1 -0
- package/dist/commands/shared/git-context.d.ts +1 -27
- package/dist/commands/shared/git-context.d.ts.map +1 -1
- package/dist/commands/shared/git-context.js +1 -156
- package/dist/commands/shared/git-diff.d.ts +1 -10
- package/dist/commands/shared/git-diff.d.ts.map +1 -1
- package/dist/commands/shared/git-diff.js +1 -49
- package/dist/commands/shared/git-ops.d.ts +1 -14
- package/dist/commands/shared/git-ops.d.ts.map +1 -1
- package/dist/commands/shared/git-ops.js +20 -150
- package/dist/commands/shared/git-worktree.d.ts +1 -9
- package/dist/commands/shared/git-worktree.d.ts.map +1 -1
- package/dist/commands/shared/git-worktree.js +1 -68
- package/dist/commands/shared/git.d.ts +1 -3
- package/dist/commands/shared/git.d.ts.map +1 -1
- package/dist/commands/shared/git.js +1 -14
- package/dist/commands/shared/policy-deny.d.ts +1 -1
- package/dist/commands/shared/reconcile-check.js +1 -1
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +24 -2
- package/dist/commands/shared/task-store/intents.d.ts.map +1 -1
- package/dist/commands/shared/task-store/intents.js +1 -1
- package/dist/commands/start.spec.js +1 -1
- package/dist/commands/task/close-tail-state.d.ts +7 -0
- package/dist/commands/task/close-tail-state.d.ts.map +1 -0
- package/dist/commands/task/close-tail-state.js +18 -0
- package/dist/commands/task/derive.js +1 -1
- package/dist/commands/task/finish-close.d.ts +22 -0
- package/dist/commands/task/finish-close.d.ts.map +1 -0
- package/dist/commands/task/finish-close.js +119 -0
- package/dist/commands/task/finish-command.d.ts +3 -0
- package/dist/commands/task/finish-command.d.ts.map +1 -0
- package/dist/commands/task/finish-command.js +56 -0
- package/dist/commands/task/finish-execute.d.ts +8 -0
- package/dist/commands/task/finish-execute.d.ts.map +1 -0
- package/dist/commands/task/finish-execute.js +272 -0
- package/dist/commands/task/finish-findings.d.ts +20 -0
- package/dist/commands/task/finish-findings.d.ts.map +1 -0
- package/dist/commands/task/finish-findings.js +27 -0
- package/dist/commands/task/finish-plan.d.ts +7 -0
- package/dist/commands/task/finish-plan.d.ts.map +1 -0
- package/dist/commands/task/finish-plan.js +157 -0
- package/dist/commands/task/finish-types.d.ts +69 -0
- package/dist/commands/task/finish-types.d.ts.map +1 -0
- package/dist/commands/task/finish.d.ts +1 -42
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +1 -527
- package/dist/commands/task/hosted-close-pr.command.d.ts.map +1 -1
- package/dist/commands/task/hosted-close-pr.command.js +29 -4
- package/dist/commands/task/hosted-merge-sync/builders.d.ts +35 -0
- package/dist/commands/task/hosted-merge-sync/builders.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync/builders.js +148 -0
- package/dist/commands/task/hosted-merge-sync/github.d.ts +10 -0
- package/dist/commands/task/hosted-merge-sync/github.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync/github.js +113 -0
- package/dist/commands/task/hosted-merge-sync/local-branch.d.ts +12 -0
- package/dist/commands/task/hosted-merge-sync/local-branch.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync/local-branch.js +143 -0
- package/dist/commands/task/hosted-merge-sync/model.d.ts +47 -0
- package/dist/commands/task/hosted-merge-sync/model.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync/pr-meta.d.ts +12 -0
- package/dist/commands/task/hosted-merge-sync/pr-meta.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync/pr-meta.js +26 -0
- package/dist/commands/task/hosted-merge-sync.d.ts +5 -63
- package/dist/commands/task/hosted-merge-sync.d.ts.map +1 -1
- package/dist/commands/task/hosted-merge-sync.js +10 -444
- package/dist/commands/task/new.js +1 -1
- package/dist/commands/task/set-status.command.js +1 -1
- package/dist/commands/task/shared/direct-work-lock.d.ts.map +1 -0
- package/dist/commands/task/shared/git-log.d.ts.map +1 -0
- package/dist/commands/task/shared/transitions.d.ts +1 -1
- package/dist/commands/task/shared/transitions.d.ts.map +1 -1
- package/dist/commands/task/shared/transitions.js +4 -6
- package/dist/commands/upgrade/apply.js +1 -1
- package/dist/commands/workflow-playbook.command.d.ts.map +1 -1
- package/dist/commands/workflow-playbook.command.js +8 -7
- package/dist/harness/hooks-lifecycle.d.ts.map +1 -1
- package/dist/harness/hooks-lifecycle.js +11 -7
- package/dist/meta/release.d.ts.map +1 -1
- package/dist/meta/release.js +8 -4
- package/dist/policy/engine.d.ts +1 -1
- package/dist/policy/evaluate.d.ts +1 -1
- package/dist/policy/{types.d.ts → model.d.ts} +1 -1
- package/dist/policy/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/policy/result.d.ts +1 -1
- package/dist/policy/rules/allowlist.d.ts +1 -1
- package/dist/policy/rules/branch-pr-base.d.ts +1 -1
- package/dist/policy/rules/clean-tree.d.ts +1 -1
- package/dist/policy/rules/commit-subject.d.ts +1 -1
- package/dist/policy/rules/protected-paths.d.ts +1 -1
- package/dist/runner/adapters/base.d.ts +42 -0
- package/dist/runner/adapters/base.d.ts.map +1 -0
- package/dist/runner/adapters/base.js +107 -0
- package/dist/runner/adapters/codex-preparation.d.ts +7 -0
- package/dist/runner/adapters/codex-preparation.d.ts.map +1 -0
- package/dist/runner/adapters/codex-preparation.js +86 -0
- package/dist/runner/adapters/codex.d.ts.map +1 -1
- package/dist/runner/adapters/codex.js +30 -175
- package/dist/runner/adapters/custom-preparation.d.ts +9 -0
- package/dist/runner/adapters/custom-preparation.d.ts.map +1 -0
- package/dist/runner/adapters/custom-preparation.js +191 -0
- package/dist/runner/adapters/custom.d.ts.map +1 -1
- package/dist/runner/adapters/custom.js +26 -279
- package/dist/runner/process-supervision/run.d.ts +30 -0
- package/dist/runner/process-supervision/run.d.ts.map +1 -0
- package/dist/runner/process-supervision/run.js +349 -0
- package/dist/runner/process-supervision/signals.d.ts +16 -0
- package/dist/runner/process-supervision/signals.d.ts.map +1 -0
- package/dist/runner/process-supervision/signals.js +85 -0
- package/dist/runner/process-supervision/state.d.ts +10 -0
- package/dist/runner/process-supervision/state.d.ts.map +1 -0
- package/dist/runner/process-supervision/state.js +42 -0
- package/dist/runner/process-supervision/streams.d.ts +6 -0
- package/dist/runner/process-supervision/streams.d.ts.map +1 -0
- package/dist/runner/process-supervision/streams.js +23 -0
- package/dist/runner/process-supervision.d.ts +5 -47
- package/dist/runner/process-supervision.d.ts.map +1 -1
- package/dist/runner/process-supervision.js +3 -490
- package/dist/runner/usecases/scenario-materialize-task.js +1 -1
- package/dist/runtime/approvals/index.d.ts +1 -1
- package/dist/runtime/approvals/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/approvals/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/approvals/runtime.d.ts +1 -1
- package/dist/runtime/behavior/index.d.ts +1 -1
- package/dist/runtime/behavior/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/behavior/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/behavior/resolve.d.ts +1 -1
- package/dist/runtime/capabilities/backend.d.ts +1 -1
- package/dist/runtime/capabilities/index.d.ts +1 -1
- package/dist/runtime/capabilities/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/capabilities/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/capabilities/model.js +1 -0
- package/dist/runtime/capabilities/recipe.d.ts +1 -1
- package/dist/runtime/capabilities/registry.d.ts +1 -1
- package/dist/runtime/capabilities/runner.d.ts +1 -1
- package/dist/runtime/execution-context.d.ts.map +1 -1
- package/dist/runtime/execution-context.js +16 -0
- package/dist/runtime/execution-profile/index.d.ts +1 -1
- package/dist/runtime/execution-profile/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/execution-profile/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/execution-profile/model.js +1 -0
- package/dist/runtime/execution-profile/resolve.d.ts +1 -1
- package/dist/runtime/explain/index.d.ts +1 -1
- package/dist/runtime/explain/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/explain/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/explain/model.js +1 -0
- package/dist/runtime/explain/resolve.d.ts +1 -1
- package/dist/runtime/protocol/index.d.ts +1 -1
- package/dist/runtime/protocol/index.js +1 -1
- package/dist/runtime/protocol/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/protocol/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/protocol/resolve.d.ts +1 -1
- package/dist/runtime/protocol/resolve.js +1 -1
- package/dist/runtime/shared/repo-cli-version.d.ts.map +1 -0
- package/dist/{shared → runtime/shared}/repo-cli-version.js +1 -1
- package/dist/runtime/shared/runtime-artifacts.d.ts.map +1 -0
- package/dist/{shared → runtime/shared}/runtime-source.d.ts +1 -1
- package/dist/runtime/shared/runtime-source.d.ts.map +1 -0
- package/dist/{shared → runtime/shared}/runtime-source.js +1 -1
- package/dist/runtime/shared/version-compare.d.ts.map +1 -0
- package/dist/runtime/task-intake/resolve.js +1 -1
- package/dist/shared/errors.d.ts +52 -2
- package/dist/shared/errors.d.ts.map +1 -1
- package/dist/shared/errors.js +66 -4
- package/dist/shared/trace-events.d.ts +13 -0
- package/dist/shared/trace-events.d.ts.map +1 -0
- package/dist/shared/trace-events.js +17 -0
- package/dist/{shared/task-doc-conflicts.d.ts → task-doc/conflicts.d.ts} +1 -1
- package/dist/task-doc/conflicts.d.ts.map +1 -0
- package/dist/{shared/task-doc-conflicts.js → task-doc/conflicts.js} +1 -1
- package/dist/{shared/task-doc-state.d.ts → task-doc/state.d.ts} +1 -1
- package/dist/task-doc/state.d.ts.map +1 -0
- package/package.json +8 -8
- package/dist/cli/run-cli/error-guidance.d.ts +0 -9
- package/dist/cli/run-cli/error-guidance.d.ts.map +0 -1
- package/dist/cli/run-cli/error-guidance.js +0 -210
- package/dist/cli/run-cli.test-helpers.d.ts +0 -2
- package/dist/cli/run-cli.test-helpers.d.ts.map +0 -1
- package/dist/cli/run-cli.test-helpers.js +0 -1
- package/dist/commands/recipes.test-helpers.d.ts +0 -202
- package/dist/commands/recipes.test-helpers.d.ts.map +0 -1
- package/dist/commands/recipes.test-helpers.js +0 -483
- package/dist/commands/release.test-helpers.d.ts +0 -38
- package/dist/commands/release.test-helpers.d.ts.map +0 -1
- package/dist/commands/release.test-helpers.js +0 -55
- package/dist/commands/task.test-helpers.d.ts +0 -13
- package/dist/commands/task.test-helpers.d.ts.map +0 -1
- package/dist/commands/task.test-helpers.js +0 -65
- package/dist/runner/test-helpers.d.ts +0 -30
- package/dist/runner/test-helpers.d.ts.map +0 -1
- package/dist/runner/test-helpers.js +0 -97
- package/dist/shared/agent-emoji.d.ts +0 -5
- package/dist/shared/agent-emoji.d.ts.map +0 -1
- package/dist/shared/agent-emoji.js +0 -51
- package/dist/shared/allow-prefix-policy.d.ts.map +0 -1
- package/dist/shared/comment-format.d.ts.map +0 -1
- package/dist/shared/diagnostics.d.ts.map +0 -1
- package/dist/shared/direct-work-lock.d.ts.map +0 -1
- package/dist/shared/git-log.d.ts.map +0 -1
- package/dist/shared/repo-cli-version.d.ts.map +0 -1
- package/dist/shared/runtime-artifacts.d.ts.map +0 -1
- package/dist/shared/runtime-source.d.ts.map +0 -1
- package/dist/shared/task-doc-conflicts.d.ts.map +0 -1
- package/dist/shared/task-doc-state.d.ts.map +0 -1
- package/dist/shared/version-compare.d.ts.map +0 -1
- package/dist/testing/cli-harness/recipe-archives.d.ts +0 -28
- package/dist/testing/cli-harness/recipe-archives.d.ts.map +0 -1
- package/dist/testing/cli-harness/recipe-archives.js +0 -374
- package/dist/testing/cli-harness/stdio.d.ts +0 -26
- package/dist/testing/cli-harness/stdio.d.ts.map +0 -1
- package/dist/testing/cli-harness/stdio.js +0 -84
- package/dist/testing/cli-harness.d.ts +0 -25
- package/dist/testing/cli-harness.d.ts.map +0 -1
- package/dist/testing/cli-harness.js +0 -313
- package/dist/testing/index.d.ts +0 -2
- package/dist/testing/index.d.ts.map +0 -1
- package/dist/testing/index.js +0 -1
- /package/dist/{policy/types.js → cli/run-cli/commands/init/model.js} +0 -0
- /package/dist/{shared → commands/shared}/allow-prefix-policy.d.ts +0 -0
- /package/dist/{shared → commands/shared}/comment-format.d.ts +0 -0
- /package/dist/{shared → commands/shared}/comment-format.js +0 -0
- /package/dist/{shared → commands/shared}/diagnostics.d.ts +0 -0
- /package/dist/{shared → commands/shared}/diagnostics.js +0 -0
- /package/dist/{runtime/approvals/types.js → commands/task/finish-types.js} +0 -0
- /package/dist/{runtime/behavior/types.js → commands/task/hosted-merge-sync/model.js} +0 -0
- /package/dist/{shared → commands/task/shared}/direct-work-lock.d.ts +0 -0
- /package/dist/{shared → commands/task/shared}/direct-work-lock.js +0 -0
- /package/dist/{shared → commands/task/shared}/git-log.d.ts +0 -0
- /package/dist/{shared → commands/task/shared}/git-log.js +0 -0
- /package/dist/{runtime/capabilities/types.js → policy/model.js} +0 -0
- /package/dist/runtime/{execution-profile/types.js → approvals/model.js} +0 -0
- /package/dist/runtime/{explain/types.js → behavior/model.js} +0 -0
- /package/dist/runtime/protocol/{types.js → model.js} +0 -0
- /package/dist/{shared → runtime/shared}/repo-cli-version.d.ts +0 -0
- /package/dist/{shared → runtime/shared}/runtime-artifacts.d.ts +0 -0
- /package/dist/{shared → runtime/shared}/runtime-artifacts.js +0 -0
- /package/dist/{shared → runtime/shared}/version-compare.d.ts +0 -0
- /package/dist/{shared → runtime/shared}/version-compare.js +0 -0
- /package/dist/{shared/task-doc-state.js → task-doc/state.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { startProcess } from "@agentplaneorg/core";
|
|
2
2
|
export async function runLifecycleHook(opts) {
|
|
3
3
|
if (!opts.policy.command || opts.policy.command.trim().length === 0) {
|
|
4
4
|
return {
|
|
@@ -10,9 +10,13 @@ export async function runLifecycleHook(opts) {
|
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
return await new Promise((resolve) => {
|
|
13
|
-
const child =
|
|
13
|
+
const child = startProcess({
|
|
14
|
+
command: "sh",
|
|
15
|
+
args: ["-lc", opts.policy.command],
|
|
14
16
|
cwd: opts.cwd,
|
|
15
|
-
|
|
17
|
+
stdin: "ignore",
|
|
18
|
+
stdout: "pipe",
|
|
19
|
+
stderr: "pipe",
|
|
16
20
|
});
|
|
17
21
|
let output = "";
|
|
18
22
|
let finished = false;
|
|
@@ -20,7 +24,7 @@ export async function runLifecycleHook(opts) {
|
|
|
20
24
|
if (finished)
|
|
21
25
|
return;
|
|
22
26
|
finished = true;
|
|
23
|
-
child.kill("SIGKILL");
|
|
27
|
+
void child.kill("SIGKILL");
|
|
24
28
|
resolve({
|
|
25
29
|
ok: !opts.policy.blocking,
|
|
26
30
|
hook: opts.hook,
|
|
@@ -29,13 +33,13 @@ export async function runLifecycleHook(opts) {
|
|
|
29
33
|
output,
|
|
30
34
|
});
|
|
31
35
|
}, Math.max(1, opts.policy.timeoutMs));
|
|
32
|
-
child.stdout
|
|
36
|
+
child.stdout?.on("data", (chunk) => {
|
|
33
37
|
output += String(chunk);
|
|
34
38
|
});
|
|
35
|
-
child.stderr
|
|
39
|
+
child.stderr?.on("data", (chunk) => {
|
|
36
40
|
output += String(chunk);
|
|
37
41
|
});
|
|
38
|
-
child.on("close", (code) => {
|
|
42
|
+
void child.on("close", (code) => {
|
|
39
43
|
if (finished)
|
|
40
44
|
return;
|
|
41
45
|
finished = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../src/meta/release.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../src/meta/release.ts"],"names":[],"mappings":"AA+BA,wBAAgB,oBAAoB,IAAI,MAAM,GAAG,IAAI,CA4BpD"}
|
package/dist/meta/release.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { execFileSync } from "node:child_process";
|
|
2
1
|
import { existsSync } from "node:fs";
|
|
3
2
|
import path from "node:path";
|
|
4
3
|
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { runProcessSync } from "@agentplaneorg/core";
|
|
5
5
|
import { getVersion } from "./version.js";
|
|
6
6
|
let cachedReleaseDate;
|
|
7
7
|
function findGitRootSync(startDir) {
|
|
@@ -36,10 +36,14 @@ export function getReleaseCommitDate() {
|
|
|
36
36
|
return cachedReleaseDate;
|
|
37
37
|
}
|
|
38
38
|
try {
|
|
39
|
-
const out =
|
|
39
|
+
const out = String(runProcessSync({
|
|
40
|
+
command: "git",
|
|
41
|
+
args: ["-C", gitRoot, "show", "-s", "--format=%cs", tag],
|
|
40
42
|
encoding: "utf8",
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
stdin: "ignore",
|
|
44
|
+
stdout: "pipe",
|
|
45
|
+
stderr: "ignore",
|
|
46
|
+
}).stdout).trim();
|
|
43
47
|
cachedReleaseDate = out || null;
|
|
44
48
|
return cachedReleaseDate;
|
|
45
49
|
}
|
package/dist/policy/engine.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AgentplaneConfig } from "@agentplaneorg/core";
|
|
2
2
|
import { type PolicyActionDescriptor } from "./taxonomy.js";
|
|
3
|
-
import type { PolicyAction, PolicyContext, PolicyProblem } from "./
|
|
3
|
+
import type { PolicyAction, PolicyContext, PolicyProblem } from "./model.js";
|
|
4
4
|
export type PolicyDecision = {
|
|
5
5
|
ok: boolean;
|
|
6
6
|
action: PolicyActionDescriptor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/policy/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC;AAE1C,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,OAAO,GAAG,YAAY,CAAC;AAEnE,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,iBAAiB,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,YAAY,CAAC;IAErB,MAAM,EAAE,gBAAgB,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IAGf,GAAG,EAAE;QACH,WAAW,EAAE,MAAM,EAAE,CAAC;QACtB,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;QAChC,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAC5B,CAAC;IAEF,MAAM,CAAC,EAAE;QACP,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IAEF,KAAK,CAAC,EAAE;QACN,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QACpB,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,CAAC;IAEF,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC"}
|
package/dist/policy/result.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PolicyProblem, PolicyResult } from "./
|
|
1
|
+
import type { PolicyProblem, PolicyResult } from "./model.js";
|
|
2
2
|
export declare function okResult(): PolicyResult;
|
|
3
3
|
export declare function usageError(message: string): PolicyProblem;
|
|
4
4
|
export declare function gitError(message: string): PolicyProblem;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { SupervisedProcessResult } from "../process-supervision.js";
|
|
2
|
+
import type { RunnerRunRepository } from "../run-repository.js";
|
|
3
|
+
import type { RunnerContextBundle, RunnerInvocation, RunnerResult } from "../types.js";
|
|
4
|
+
export declare function assertAdapterBundle(opts: {
|
|
5
|
+
adapterId: string;
|
|
6
|
+
label: string;
|
|
7
|
+
bundle: RunnerContextBundle;
|
|
8
|
+
}): void;
|
|
9
|
+
export declare function assertAdapterInvocation(opts: {
|
|
10
|
+
adapterId: string;
|
|
11
|
+
label: string;
|
|
12
|
+
invocation: RunnerInvocation;
|
|
13
|
+
requireBootstrap?: boolean;
|
|
14
|
+
minArgvLength?: number;
|
|
15
|
+
}): void;
|
|
16
|
+
export declare function writeRunnerExecutionState(opts: {
|
|
17
|
+
repository: RunnerRunRepository;
|
|
18
|
+
result: RunnerResult;
|
|
19
|
+
processResult: SupervisedProcessResult;
|
|
20
|
+
command: string;
|
|
21
|
+
}): Promise<void>;
|
|
22
|
+
export declare function writeRunnerResultState(opts: {
|
|
23
|
+
repository: RunnerRunRepository;
|
|
24
|
+
result: RunnerResult;
|
|
25
|
+
}): Promise<void>;
|
|
26
|
+
export declare function appendRunnerExecutionEvent(opts: {
|
|
27
|
+
repository: RunnerRunRepository;
|
|
28
|
+
invocation: RunnerInvocation;
|
|
29
|
+
result: RunnerResult;
|
|
30
|
+
processResult: SupervisedProcessResult;
|
|
31
|
+
message: string;
|
|
32
|
+
outputPaths: string[];
|
|
33
|
+
}): Promise<void>;
|
|
34
|
+
export declare function appendRunnerResultEvent(opts: {
|
|
35
|
+
repository: RunnerRunRepository;
|
|
36
|
+
invocation: RunnerInvocation;
|
|
37
|
+
result: RunnerResult;
|
|
38
|
+
type: "runner_execute_error" | "runner_execute_finish";
|
|
39
|
+
message: string;
|
|
40
|
+
outputPaths: string[];
|
|
41
|
+
}): Promise<void>;
|
|
42
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/runner/adapters/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAIvF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,mBAAmB,CAAC;CAC7B,GAAG,IAAI,CAYP;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,gBAAgB,CAAC;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG,IAAI,CA2BP;AAED,wBAAsB,yBAAyB,CAAC,IAAI,EAAE;IACpD,UAAU,EAAE,mBAAmB,CAAC;IAChC,MAAM,EAAE,YAAY,CAAC;IACrB,aAAa,EAAE,uBAAuB,CAAC;IACvC,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,IAAI,CAAC,CAuBhB;AAED,wBAAsB,sBAAsB,CAAC,IAAI,EAAE;IACjD,UAAU,EAAE,mBAAmB,CAAC;IAChC,MAAM,EAAE,YAAY,CAAC;CACtB,GAAG,OAAO,CAAC,IAAI,CAAC,CAUhB;AAED,wBAAsB,0BAA0B,CAAC,IAAI,EAAE;IACrD,UAAU,EAAE,mBAAmB,CAAC;IAChC,UAAU,EAAE,gBAAgB,CAAC;IAC7B,MAAM,EAAE,YAAY,CAAC;IACrB,aAAa,EAAE,uBAAuB,CAAC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBhB;AAED,wBAAsB,uBAAuB,CAAC,IAAI,EAAE;IAClD,UAAU,EAAE,mBAAmB,CAAC;IAChC,UAAU,EAAE,gBAAgB,CAAC;IAC7B,MAAM,EAAE,YAAY,CAAC;IACrB,IAAI,EAAE,sBAAsB,GAAG,uBAAuB,CAAC;IACvD,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,GAAG,OAAO,CAAC,IAAI,CAAC,CAYhB"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { evolveRunnerRunState } from "../artifacts.js";
|
|
2
|
+
import { buildInvocationEventData } from "./runtime-shared.js";
|
|
3
|
+
export function assertAdapterBundle(opts) {
|
|
4
|
+
if (opts.bundle.execution.adapter_id !== opts.adapterId) {
|
|
5
|
+
throw new Error(`${opts.label} adapter cannot prepare bundle for adapter_id=${JSON.stringify(opts.bundle.execution.adapter_id)}`);
|
|
6
|
+
}
|
|
7
|
+
if (!opts.bundle.execution.artifact_paths.bundle_path.trim()) {
|
|
8
|
+
throw new Error(`${opts.label} adapter requires a non-empty bundle path`);
|
|
9
|
+
}
|
|
10
|
+
if (!opts.bundle.execution.artifact_paths.run_dir.trim()) {
|
|
11
|
+
throw new Error(`${opts.label} adapter requires a non-empty run dir`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export function assertAdapterInvocation(opts) {
|
|
15
|
+
const { invocation } = opts;
|
|
16
|
+
if (invocation.adapter_id !== opts.adapterId) {
|
|
17
|
+
throw new Error(`${opts.label} adapter cannot execute invocation for adapter_id=${JSON.stringify(invocation.adapter_id)}`);
|
|
18
|
+
}
|
|
19
|
+
const requiredPaths = [
|
|
20
|
+
["bundle_path", invocation.bundle_path],
|
|
21
|
+
["run_dir", invocation.run_dir],
|
|
22
|
+
["state_path", invocation.state_path],
|
|
23
|
+
["events_path", invocation.events_path],
|
|
24
|
+
["result_path", invocation.result_path],
|
|
25
|
+
["trace_path", invocation.trace_path],
|
|
26
|
+
["stderr_path", invocation.stderr_path],
|
|
27
|
+
];
|
|
28
|
+
if (opts.requireBootstrap) {
|
|
29
|
+
requiredPaths.push(["bootstrap_path", invocation.bootstrap_path]);
|
|
30
|
+
}
|
|
31
|
+
for (const [field, value] of requiredPaths) {
|
|
32
|
+
if (!value?.trim()) {
|
|
33
|
+
throw new Error(`${opts.label} adapter invocation is missing ${field}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (opts.minArgvLength !== undefined && invocation.argv.length < opts.minArgvLength) {
|
|
37
|
+
throw new Error(`${opts.label} adapter invocation is missing normalized argv metadata`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export async function writeRunnerExecutionState(opts) {
|
|
41
|
+
const stateAfter = await opts.repository.readState();
|
|
42
|
+
if (!stateAfter)
|
|
43
|
+
return;
|
|
44
|
+
await opts.repository.writeState(evolveRunnerRunState({
|
|
45
|
+
state: stateAfter,
|
|
46
|
+
status: opts.result.status,
|
|
47
|
+
result: opts.result,
|
|
48
|
+
supervision: {
|
|
49
|
+
...stateAfter.supervision,
|
|
50
|
+
pid: opts.processResult.pid,
|
|
51
|
+
command: opts.command,
|
|
52
|
+
started_at: opts.processResult.started_at,
|
|
53
|
+
heartbeat_at: opts.processResult.heartbeat_at,
|
|
54
|
+
exit_signal: opts.processResult.exit_signal,
|
|
55
|
+
timeout_reason: opts.processResult.timeout_reason,
|
|
56
|
+
timeout_requested_at: opts.processResult.timeout_requested_at,
|
|
57
|
+
terminate_sent_at: opts.processResult.terminate_sent_at,
|
|
58
|
+
kill_sent_at: opts.processResult.kill_sent_at,
|
|
59
|
+
force_killed: opts.processResult.force_killed,
|
|
60
|
+
},
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
export async function writeRunnerResultState(opts) {
|
|
64
|
+
const stateAfter = await opts.repository.readState();
|
|
65
|
+
if (!stateAfter)
|
|
66
|
+
return;
|
|
67
|
+
await opts.repository.writeState(evolveRunnerRunState({
|
|
68
|
+
state: stateAfter,
|
|
69
|
+
status: opts.result.status,
|
|
70
|
+
result: opts.result,
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
export async function appendRunnerExecutionEvent(opts) {
|
|
74
|
+
await opts.repository.appendEvent({
|
|
75
|
+
at: opts.result.ended_at,
|
|
76
|
+
type: "runner_execute_finish",
|
|
77
|
+
message: opts.message,
|
|
78
|
+
data: {
|
|
79
|
+
...buildInvocationEventData(opts.invocation),
|
|
80
|
+
pid: opts.processResult.pid,
|
|
81
|
+
exit_signal: opts.processResult.exit_signal,
|
|
82
|
+
cancel_requested_at: opts.processResult.cancel_requested_at,
|
|
83
|
+
cancel_signal: opts.processResult.cancel_signal,
|
|
84
|
+
timeout_reason: opts.processResult.timeout_reason,
|
|
85
|
+
timeout_requested_at: opts.processResult.timeout_requested_at,
|
|
86
|
+
terminate_sent_at: opts.processResult.terminate_sent_at,
|
|
87
|
+
kill_sent_at: opts.processResult.kill_sent_at,
|
|
88
|
+
force_killed: opts.processResult.force_killed,
|
|
89
|
+
exit_code: opts.result.exit_code,
|
|
90
|
+
output_paths: opts.outputPaths,
|
|
91
|
+
metrics: opts.result.metrics,
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
export async function appendRunnerResultEvent(opts) {
|
|
96
|
+
await opts.repository.appendEvent({
|
|
97
|
+
at: opts.result.ended_at,
|
|
98
|
+
type: opts.type,
|
|
99
|
+
message: opts.message,
|
|
100
|
+
data: {
|
|
101
|
+
...buildInvocationEventData(opts.invocation),
|
|
102
|
+
exit_code: opts.result.exit_code,
|
|
103
|
+
output_paths: opts.outputPaths,
|
|
104
|
+
metrics: opts.result.metrics,
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RunnerAdapterCapabilities, RunnerContextBundle, RunnerInvocation } from "../types.js";
|
|
2
|
+
export declare const CODEX_RUN_PROFILE_CAPABILITIES: RunnerAdapterCapabilities;
|
|
3
|
+
export declare function buildCodexInvocation(opts: {
|
|
4
|
+
adapterId: "codex";
|
|
5
|
+
bundle: RunnerContextBundle;
|
|
6
|
+
}): RunnerInvocation;
|
|
7
|
+
//# sourceMappingURL=codex-preparation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex-preparation.d.ts","sourceRoot":"","sources":["../../../src/runner/adapters/codex-preparation.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAOpG,eAAO,MAAM,8BAA8B,EAAE,yBAe5C,CAAC;AAoBF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,mBAAmB,CAAC;CAC7B,GAAG,gBAAgB,CA4CnB"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { exitCodeForError } from "../../cli/exit-codes.js";
|
|
3
|
+
import { CliError } from "../../shared/errors.js";
|
|
4
|
+
import { buildRecipeRunnerEnv, readRecipeRunProfile } from "./recipe-run-profile.js";
|
|
5
|
+
const CODEX_LAST_MESSAGE_FILENAME = "codex-last-message.md";
|
|
6
|
+
const CODEX_SANDBOX_VALUES = new Set(["read-only", "workspace-write", "danger-full-access"]);
|
|
7
|
+
const SUPPORTED_CODEX_SANDBOXES = [...CODEX_SANDBOX_VALUES];
|
|
8
|
+
export const CODEX_RUN_PROFILE_CAPABILITIES = {
|
|
9
|
+
adapter_id: "codex",
|
|
10
|
+
fields: {
|
|
11
|
+
sandbox: {
|
|
12
|
+
level: "native",
|
|
13
|
+
channel: "argv",
|
|
14
|
+
supported_values: SUPPORTED_CODEX_SANDBOXES,
|
|
15
|
+
note: "Recipe sandbox is enforced through codex --sandbox argv mapping.",
|
|
16
|
+
},
|
|
17
|
+
writes_artifacts_to: {
|
|
18
|
+
level: "advisory",
|
|
19
|
+
channel: "env",
|
|
20
|
+
note: "Recipe artifact prefixes are exported through env and enforced post-run against external manifest artifacts and evidence paths.",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
function resolveCodexSandbox(value) {
|
|
25
|
+
const normalized = typeof value === "string" ? value.trim() : "";
|
|
26
|
+
if (!normalized)
|
|
27
|
+
return "danger-full-access";
|
|
28
|
+
if (CODEX_SANDBOX_VALUES.has(normalized))
|
|
29
|
+
return normalized;
|
|
30
|
+
throw new CliError({
|
|
31
|
+
exitCode: exitCodeForError("E_RUNTIME"),
|
|
32
|
+
code: "E_RUNTIME",
|
|
33
|
+
message: `Codex runner does not support recipe sandbox ${JSON.stringify(normalized)}; ` +
|
|
34
|
+
`supported values: ${SUPPORTED_CODEX_SANDBOXES.join(", ")}.`,
|
|
35
|
+
context: {
|
|
36
|
+
adapter_id: "codex",
|
|
37
|
+
requested_sandbox: normalized,
|
|
38
|
+
supported_sandboxes: SUPPORTED_CODEX_SANDBOXES,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
export function buildCodexInvocation(opts) {
|
|
43
|
+
const { execution } = opts.bundle;
|
|
44
|
+
const runProfile = readRecipeRunProfile(opts.bundle.recipe);
|
|
45
|
+
const sandbox = resolveCodexSandbox(runProfile?.sandbox);
|
|
46
|
+
const recipeEnv = buildRecipeRunnerEnv(opts.bundle.recipe);
|
|
47
|
+
const lastMessagePath = path.join(execution.artifact_paths.run_dir, CODEX_LAST_MESSAGE_FILENAME);
|
|
48
|
+
return {
|
|
49
|
+
adapter_id: opts.adapterId,
|
|
50
|
+
run_id: execution.run_id,
|
|
51
|
+
run_dir: execution.artifact_paths.run_dir,
|
|
52
|
+
bundle_path: execution.artifact_paths.bundle_path,
|
|
53
|
+
state_path: execution.artifact_paths.state_path,
|
|
54
|
+
events_path: execution.artifact_paths.events_path,
|
|
55
|
+
result_path: execution.artifact_paths.result_path,
|
|
56
|
+
trace_path: execution.artifact_paths.trace_path,
|
|
57
|
+
stderr_path: execution.artifact_paths.stderr_path,
|
|
58
|
+
trace_policy: execution.trace_policy,
|
|
59
|
+
timeout_policy: execution.timeout_policy,
|
|
60
|
+
bootstrap_path: execution.artifact_paths.bootstrap_path,
|
|
61
|
+
output_last_message_path: lastMessagePath,
|
|
62
|
+
argv: [
|
|
63
|
+
"codex",
|
|
64
|
+
"-a",
|
|
65
|
+
"never",
|
|
66
|
+
"exec",
|
|
67
|
+
"--json",
|
|
68
|
+
"--output-last-message",
|
|
69
|
+
lastMessagePath,
|
|
70
|
+
"-C",
|
|
71
|
+
opts.bundle.repository.git_root,
|
|
72
|
+
"-s",
|
|
73
|
+
sandbox,
|
|
74
|
+
"-",
|
|
75
|
+
],
|
|
76
|
+
env: {
|
|
77
|
+
AGENTPLANE_RUNNER_ADAPTER: opts.adapterId,
|
|
78
|
+
AGENTPLANE_RUNNER_MODE: execution.mode,
|
|
79
|
+
AGENTPLANE_RUNNER_API_VERSION: opts.bundle.runner_api_version,
|
|
80
|
+
AGENTPLANE_RUNNER_TARGET: opts.bundle.target.kind,
|
|
81
|
+
AGENTPLANE_RUNNER_RESULT_PATH: execution.artifact_paths.result_path,
|
|
82
|
+
...recipeEnv,
|
|
83
|
+
},
|
|
84
|
+
dry_run: execution.mode === "dry_run",
|
|
85
|
+
};
|
|
86
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../../src/runner/adapters/codex.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../../src/runner/adapters/codex.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,yBAAyB,EACzB,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACb,MAAM,aAAa,CAAC;AAGrB,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;AA8FrB,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;IAK/D,OAAO,CAAC,UAAU,EAAE,gBAAgB,GAAG,OAAO,CAAC,YAAY,CAAC;CA2K7D"}
|