agentplane 0.3.14 → 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 +508 -323
- 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 +5 -1
- 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-close.command.d.ts.map +1 -1
- package/dist/commands/task/hosted-close.command.js +23 -2
- 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,34 +1,14 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
|
-
import path from "node:path";
|
|
3
2
|
import { exitCodeForError } from "../../cli/exit-codes.js";
|
|
4
3
|
import { CliError } from "../../shared/errors.js";
|
|
5
|
-
import { evolveRunnerRunState } from "../artifacts.js";
|
|
6
4
|
import { runnerAdapterCancelledResult, runnerAdapterFailureResult, runnerAdapterSuccessResult, } from "./shared.js";
|
|
7
|
-
import {
|
|
5
|
+
import { buildRunnerExecutionArtifacts, durationMs } from "./runtime-shared.js";
|
|
8
6
|
import { exitCodeForSignal, runSupervisedProcess, } from "../process-supervision.js";
|
|
9
7
|
import { InvalidRunnerResultManifestError, applyRunnerResultManifest, manifestFromRunnerResult, preserveRunnerResultManifestSource, preserveInvalidRunnerResultManifest, readRunnerResultManifest, writeRunnerResultManifest, } from "../result-manifest.js";
|
|
10
8
|
import { RunnerRunRepository } from "../run-repository.js";
|
|
11
9
|
import { assertRunnerManifestArtifactPolicy, readRecipeArtifactPrefixesFromRunnerEnv, } from "../result-manifest-policy.js";
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
const CODEX_SANDBOX_VALUES = new Set(["read-only", "workspace-write", "danger-full-access"]);
|
|
15
|
-
const SUPPORTED_CODEX_SANDBOXES = [...CODEX_SANDBOX_VALUES];
|
|
16
|
-
const CODEX_RUN_PROFILE_CAPABILITIES = {
|
|
17
|
-
adapter_id: "codex",
|
|
18
|
-
fields: {
|
|
19
|
-
sandbox: {
|
|
20
|
-
level: "native",
|
|
21
|
-
channel: "argv",
|
|
22
|
-
supported_values: SUPPORTED_CODEX_SANDBOXES,
|
|
23
|
-
note: "Recipe sandbox is enforced through codex --sandbox argv mapping.",
|
|
24
|
-
},
|
|
25
|
-
writes_artifacts_to: {
|
|
26
|
-
level: "advisory",
|
|
27
|
-
channel: "env",
|
|
28
|
-
note: "Recipe artifact prefixes are exported through env and enforced post-run against external manifest artifacts and evidence paths.",
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
};
|
|
10
|
+
import { appendRunnerExecutionEvent, appendRunnerResultEvent, assertAdapterBundle, assertAdapterInvocation, writeRunnerExecutionState, writeRunnerResultState, } from "./base.js";
|
|
11
|
+
import { buildCodexInvocation, CODEX_RUN_PROFILE_CAPABILITIES } from "./codex-preparation.js";
|
|
32
12
|
function byteLength(text) {
|
|
33
13
|
return Buffer.byteLength(text ?? "", "utf8");
|
|
34
14
|
}
|
|
@@ -46,64 +26,15 @@ function buildCodexArtifacts(opts) {
|
|
|
46
26
|
return buildRunnerExecutionArtifacts({ ...opts, include_output_last_message: true });
|
|
47
27
|
}
|
|
48
28
|
function assertCodexBundle(bundle) {
|
|
49
|
-
|
|
50
|
-
throw new Error(`Codex adapter cannot prepare bundle for adapter_id=${JSON.stringify(bundle.execution.adapter_id)}`);
|
|
51
|
-
}
|
|
52
|
-
if (!bundle.execution.artifact_paths.bundle_path.trim()) {
|
|
53
|
-
throw new Error("Codex adapter requires a non-empty bundle path");
|
|
54
|
-
}
|
|
55
|
-
if (!bundle.execution.artifact_paths.run_dir.trim()) {
|
|
56
|
-
throw new Error("Codex adapter requires a non-empty run dir");
|
|
57
|
-
}
|
|
29
|
+
assertAdapterBundle({ adapterId: "codex", label: "Codex", bundle });
|
|
58
30
|
}
|
|
59
31
|
function assertCodexInvocation(invocation) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
if (!invocation.run_dir.trim()) {
|
|
67
|
-
throw new Error("Codex adapter invocation is missing run_dir");
|
|
68
|
-
}
|
|
69
|
-
if (!invocation.state_path.trim()) {
|
|
70
|
-
throw new Error("Codex adapter invocation is missing state_path");
|
|
71
|
-
}
|
|
72
|
-
if (!invocation.events_path.trim()) {
|
|
73
|
-
throw new Error("Codex adapter invocation is missing events_path");
|
|
74
|
-
}
|
|
75
|
-
if (!invocation.result_path.trim()) {
|
|
76
|
-
throw new Error("Codex adapter invocation is missing result_path");
|
|
77
|
-
}
|
|
78
|
-
if (!invocation.trace_path.trim()) {
|
|
79
|
-
throw new Error("Codex adapter invocation is missing trace_path");
|
|
80
|
-
}
|
|
81
|
-
if (!invocation.stderr_path.trim()) {
|
|
82
|
-
throw new Error("Codex adapter invocation is missing stderr_path");
|
|
83
|
-
}
|
|
84
|
-
if (!invocation.bootstrap_path?.trim()) {
|
|
85
|
-
throw new Error("Codex adapter invocation is missing bootstrap_path");
|
|
86
|
-
}
|
|
87
|
-
if (invocation.argv.length < 5) {
|
|
88
|
-
throw new Error("Codex adapter invocation is missing normalized argv metadata");
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
function resolveCodexSandbox(value) {
|
|
92
|
-
const normalized = typeof value === "string" ? value.trim() : "";
|
|
93
|
-
if (!normalized)
|
|
94
|
-
return "danger-full-access";
|
|
95
|
-
if (CODEX_SANDBOX_VALUES.has(normalized))
|
|
96
|
-
return normalized;
|
|
97
|
-
throw new CliError({
|
|
98
|
-
exitCode: 8,
|
|
99
|
-
code: "E_RUNTIME",
|
|
100
|
-
message: `Codex runner does not support recipe sandbox ${JSON.stringify(normalized)}; ` +
|
|
101
|
-
`supported values: ${SUPPORTED_CODEX_SANDBOXES.join(", ")}.`,
|
|
102
|
-
context: {
|
|
103
|
-
adapter_id: "codex",
|
|
104
|
-
requested_sandbox: normalized,
|
|
105
|
-
supported_sandboxes: SUPPORTED_CODEX_SANDBOXES,
|
|
106
|
-
},
|
|
32
|
+
assertAdapterInvocation({
|
|
33
|
+
adapterId: "codex",
|
|
34
|
+
label: "Codex",
|
|
35
|
+
invocation,
|
|
36
|
+
requireBootstrap: true,
|
|
37
|
+
minArgvLength: 5,
|
|
107
38
|
});
|
|
108
39
|
}
|
|
109
40
|
function assertExecuteModeManifest(opts) {
|
|
@@ -136,48 +67,7 @@ export class CodexRunnerAdapter {
|
|
|
136
67
|
}
|
|
137
68
|
prepare(bundle) {
|
|
138
69
|
assertCodexBundle(bundle);
|
|
139
|
-
|
|
140
|
-
const runProfile = readRecipeRunProfile(bundle.recipe);
|
|
141
|
-
const sandbox = resolveCodexSandbox(runProfile?.sandbox);
|
|
142
|
-
const recipeEnv = buildRecipeRunnerEnv(bundle.recipe);
|
|
143
|
-
return Promise.resolve({
|
|
144
|
-
adapter_id: this.id,
|
|
145
|
-
run_id: execution.run_id,
|
|
146
|
-
run_dir: execution.artifact_paths.run_dir,
|
|
147
|
-
bundle_path: execution.artifact_paths.bundle_path,
|
|
148
|
-
state_path: execution.artifact_paths.state_path,
|
|
149
|
-
events_path: execution.artifact_paths.events_path,
|
|
150
|
-
result_path: execution.artifact_paths.result_path,
|
|
151
|
-
trace_path: execution.artifact_paths.trace_path,
|
|
152
|
-
stderr_path: execution.artifact_paths.stderr_path,
|
|
153
|
-
trace_policy: execution.trace_policy,
|
|
154
|
-
timeout_policy: execution.timeout_policy,
|
|
155
|
-
bootstrap_path: execution.artifact_paths.bootstrap_path,
|
|
156
|
-
output_last_message_path: path.join(execution.artifact_paths.run_dir, CODEX_LAST_MESSAGE_FILENAME),
|
|
157
|
-
argv: [
|
|
158
|
-
"codex",
|
|
159
|
-
"-a",
|
|
160
|
-
"never",
|
|
161
|
-
"exec",
|
|
162
|
-
"--json",
|
|
163
|
-
"--output-last-message",
|
|
164
|
-
path.join(execution.artifact_paths.run_dir, CODEX_LAST_MESSAGE_FILENAME),
|
|
165
|
-
"-C",
|
|
166
|
-
bundle.repository.git_root,
|
|
167
|
-
"-s",
|
|
168
|
-
sandbox,
|
|
169
|
-
"-",
|
|
170
|
-
],
|
|
171
|
-
env: {
|
|
172
|
-
AGENTPLANE_RUNNER_ADAPTER: this.id,
|
|
173
|
-
AGENTPLANE_RUNNER_MODE: execution.mode,
|
|
174
|
-
AGENTPLANE_RUNNER_API_VERSION: bundle.runner_api_version,
|
|
175
|
-
AGENTPLANE_RUNNER_TARGET: bundle.target.kind,
|
|
176
|
-
AGENTPLANE_RUNNER_RESULT_PATH: execution.artifact_paths.result_path,
|
|
177
|
-
...recipeEnv,
|
|
178
|
-
},
|
|
179
|
-
dry_run: execution.mode === "dry_run",
|
|
180
|
-
});
|
|
70
|
+
return Promise.resolve(buildCodexInvocation({ adapterId: this.id, bundle }));
|
|
181
71
|
}
|
|
182
72
|
execute(invocation) {
|
|
183
73
|
const started_at = new Date().toISOString();
|
|
@@ -281,46 +171,19 @@ export class CodexRunnerAdapter {
|
|
|
281
171
|
result_path: invocation.result_path,
|
|
282
172
|
manifest: manifestFromRunnerResult(result),
|
|
283
173
|
});
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
heartbeat_at: processResult.heartbeat_at,
|
|
296
|
-
exit_signal: processResult.exit_signal,
|
|
297
|
-
timeout_reason: processResult.timeout_reason,
|
|
298
|
-
timeout_requested_at: processResult.timeout_requested_at,
|
|
299
|
-
terminate_sent_at: processResult.terminate_sent_at,
|
|
300
|
-
kill_sent_at: processResult.kill_sent_at,
|
|
301
|
-
force_killed: processResult.force_killed,
|
|
302
|
-
},
|
|
303
|
-
}));
|
|
304
|
-
}
|
|
305
|
-
await repository.appendEvent({
|
|
306
|
-
at: result.ended_at,
|
|
307
|
-
type: "runner_execute_finish",
|
|
174
|
+
await writeRunnerExecutionState({
|
|
175
|
+
repository,
|
|
176
|
+
result,
|
|
177
|
+
processResult,
|
|
178
|
+
command: invocation.argv.join(" "),
|
|
179
|
+
});
|
|
180
|
+
await appendRunnerExecutionEvent({
|
|
181
|
+
repository,
|
|
182
|
+
invocation,
|
|
183
|
+
result,
|
|
184
|
+
processResult,
|
|
308
185
|
message: `codex exec finished with status=${result.status}`,
|
|
309
|
-
|
|
310
|
-
...buildInvocationEventData(invocation),
|
|
311
|
-
pid: processResult.pid,
|
|
312
|
-
exit_signal: processResult.exit_signal,
|
|
313
|
-
cancel_requested_at: processResult.cancel_requested_at,
|
|
314
|
-
cancel_signal: processResult.cancel_signal,
|
|
315
|
-
timeout_reason: processResult.timeout_reason,
|
|
316
|
-
timeout_requested_at: processResult.timeout_requested_at,
|
|
317
|
-
terminate_sent_at: processResult.terminate_sent_at,
|
|
318
|
-
kill_sent_at: processResult.kill_sent_at,
|
|
319
|
-
force_killed: processResult.force_killed,
|
|
320
|
-
exit_code: result.exit_code,
|
|
321
|
-
output_paths,
|
|
322
|
-
metrics: result.metrics,
|
|
323
|
-
},
|
|
186
|
+
outputPaths: output_paths,
|
|
324
187
|
});
|
|
325
188
|
return result;
|
|
326
189
|
}
|
|
@@ -359,23 +222,15 @@ export class CodexRunnerAdapter {
|
|
|
359
222
|
capabilities_used: ["codex.exec"],
|
|
360
223
|
}),
|
|
361
224
|
});
|
|
362
|
-
const
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
}));
|
|
369
|
-
}
|
|
370
|
-
await RunnerRunRepository.fromInvocation(invocation).appendEvent({
|
|
371
|
-
at: result.ended_at,
|
|
225
|
+
const repository = RunnerRunRepository.fromInvocation(invocation);
|
|
226
|
+
await writeRunnerResultState({ repository, result });
|
|
227
|
+
await appendRunnerResultEvent({
|
|
228
|
+
repository,
|
|
229
|
+
invocation,
|
|
230
|
+
result,
|
|
372
231
|
type: "runner_execute_error",
|
|
373
232
|
message: result.stderr_summary ?? "codex exec failed",
|
|
374
|
-
|
|
375
|
-
...buildInvocationEventData(invocation),
|
|
376
|
-
output_paths,
|
|
377
|
-
metrics: result.metrics,
|
|
378
|
-
},
|
|
233
|
+
outputPaths: output_paths,
|
|
379
234
|
});
|
|
380
235
|
return result;
|
|
381
236
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { RunnerCustomConfig } from "@agentplaneorg/core";
|
|
2
|
+
import type { RunnerAdapterCapabilities, RunnerContextBundle, RunnerInvocation } from "../types.js";
|
|
3
|
+
export declare function buildCustomCapabilities(config: RunnerCustomConfig | undefined): RunnerAdapterCapabilities;
|
|
4
|
+
export declare function buildCustomInvocation(opts: {
|
|
5
|
+
adapterId: "custom";
|
|
6
|
+
config: RunnerCustomConfig | undefined;
|
|
7
|
+
bundle: RunnerContextBundle;
|
|
8
|
+
}): RunnerInvocation;
|
|
9
|
+
//# sourceMappingURL=custom-preparation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-preparation.d.ts","sourceRoot":"","sources":["../../../src/runner/adapters/custom-preparation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAI9D,OAAO,KAAK,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAepG,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,kBAAkB,GAAG,SAAS,GACrC,yBAAyB,CAiC3B;AA0HD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE;IAC1C,SAAS,EAAE,QAAQ,CAAC;IACpB,MAAM,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACvC,MAAM,EAAE,mBAAmB,CAAC;CAC7B,GAAG,gBAAgB,CAgDnB"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { exitCodeForError } from "../../cli/exit-codes.js";
|
|
2
|
+
import { CliError } from "../../shared/errors.js";
|
|
3
|
+
import { buildRecipeRunnerEnv, readRecipeRunProfile } from "./recipe-run-profile.js";
|
|
4
|
+
const CUSTOM_SANDBOX_WRAPPER_SUPPORTED_VALUES = ["workspace-write"];
|
|
5
|
+
function normalizeCustomEnforcement(config) {
|
|
6
|
+
return {
|
|
7
|
+
mode: config?.enforcement?.mode ?? "none",
|
|
8
|
+
platform: config?.enforcement?.platform ?? "auto",
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export function buildCustomCapabilities(config) {
|
|
12
|
+
const enforcement = normalizeCustomEnforcement(config);
|
|
13
|
+
const configuredModeNote = `Configured via runner.custom.enforcement.mode=${JSON.stringify(enforcement.mode)} ` +
|
|
14
|
+
`(platform=${JSON.stringify(enforcement.platform)}).`;
|
|
15
|
+
return {
|
|
16
|
+
adapter_id: "custom",
|
|
17
|
+
fields: {
|
|
18
|
+
sandbox: enforcement.mode === "codex_sandbox_full_auto"
|
|
19
|
+
? {
|
|
20
|
+
level: "wrapper",
|
|
21
|
+
channel: "argv",
|
|
22
|
+
supported_values: [...CUSTOM_SANDBOX_WRAPPER_SUPPORTED_VALUES],
|
|
23
|
+
note: `${configuredModeNote} Custom runner sandbox is enforced through ` +
|
|
24
|
+
"`codex sandbox <platform> --full-auto` and currently supports workspace-write only, " +
|
|
25
|
+
"because the shared runner contract requires writable result and trace artifacts inside run_dir.",
|
|
26
|
+
}
|
|
27
|
+
: {
|
|
28
|
+
level: "advisory",
|
|
29
|
+
channel: "env",
|
|
30
|
+
note: `${configuredModeNote} Custom runner receives sandbox intent through env only; ` +
|
|
31
|
+
"the adapter does not enforce it.",
|
|
32
|
+
},
|
|
33
|
+
writes_artifacts_to: {
|
|
34
|
+
level: "advisory",
|
|
35
|
+
channel: "env",
|
|
36
|
+
note: "Recipe artifact prefixes are exported through env and enforced post-run against external manifest artifacts and evidence paths.",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function resolveCodexSandboxPlatform(value) {
|
|
42
|
+
const currentPlatform = (() => {
|
|
43
|
+
switch (process.platform) {
|
|
44
|
+
case "darwin": {
|
|
45
|
+
return "macos";
|
|
46
|
+
}
|
|
47
|
+
case "linux": {
|
|
48
|
+
return "linux";
|
|
49
|
+
}
|
|
50
|
+
case "win32": {
|
|
51
|
+
return "windows";
|
|
52
|
+
}
|
|
53
|
+
default: {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
})();
|
|
58
|
+
if (!currentPlatform) {
|
|
59
|
+
throw new CliError({
|
|
60
|
+
exitCode: exitCodeForError("E_RUNTIME"),
|
|
61
|
+
code: "E_RUNTIME",
|
|
62
|
+
message: `Custom runner codex sandbox wrapper does not support current platform ${JSON.stringify(process.platform)}.`,
|
|
63
|
+
context: {
|
|
64
|
+
adapter_id: "custom",
|
|
65
|
+
wrapper_mode: "codex_sandbox_full_auto",
|
|
66
|
+
platform: process.platform,
|
|
67
|
+
policy_field: "sandbox",
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
if (value && value !== "auto") {
|
|
72
|
+
if (value !== currentPlatform) {
|
|
73
|
+
throw new CliError({
|
|
74
|
+
exitCode: exitCodeForError("E_RUNTIME"),
|
|
75
|
+
code: "E_RUNTIME",
|
|
76
|
+
message: `Custom runner codex sandbox wrapper is configured for ${JSON.stringify(value)} but current platform is ` +
|
|
77
|
+
`${JSON.stringify(currentPlatform)}.`,
|
|
78
|
+
context: {
|
|
79
|
+
adapter_id: "custom",
|
|
80
|
+
wrapper_mode: "codex_sandbox_full_auto",
|
|
81
|
+
configured_platform: value,
|
|
82
|
+
platform: currentPlatform,
|
|
83
|
+
policy_field: "sandbox",
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return value;
|
|
88
|
+
}
|
|
89
|
+
return currentPlatform;
|
|
90
|
+
}
|
|
91
|
+
function unsupportedCustomSandboxError(opts) {
|
|
92
|
+
const baseContext = {
|
|
93
|
+
adapter_id: "custom",
|
|
94
|
+
wrapper_mode: opts.enforcementMode,
|
|
95
|
+
policy_field: "sandbox",
|
|
96
|
+
declared_value: opts.requestedSandbox,
|
|
97
|
+
supported_values: CUSTOM_SANDBOX_WRAPPER_SUPPORTED_VALUES,
|
|
98
|
+
};
|
|
99
|
+
if (opts.requestedSandbox === "read-only") {
|
|
100
|
+
return new CliError({
|
|
101
|
+
exitCode: exitCodeForError("E_RUNTIME"),
|
|
102
|
+
code: "E_RUNTIME",
|
|
103
|
+
message: `Custom runner wrapper mode ${JSON.stringify(opts.enforcementMode)} cannot support recipe sandbox ` +
|
|
104
|
+
`${JSON.stringify(opts.requestedSandbox)} because the shared runner contract requires write access ` +
|
|
105
|
+
"to result.json and trace artifacts inside run_dir, while the default codex sandbox blocks writes " +
|
|
106
|
+
"to cwd and TMPDIR. Supported values: workspace-write.",
|
|
107
|
+
context: baseContext,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
return new CliError({
|
|
111
|
+
exitCode: exitCodeForError("E_RUNTIME"),
|
|
112
|
+
code: "E_RUNTIME",
|
|
113
|
+
message: `Custom runner wrapper mode ${JSON.stringify(opts.enforcementMode)} does not support recipe sandbox ` +
|
|
114
|
+
`${JSON.stringify(opts.requestedSandbox)}; supported values: ${CUSTOM_SANDBOX_WRAPPER_SUPPORTED_VALUES.join(", ")}.`,
|
|
115
|
+
context: baseContext,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function buildCustomCommand(opts) {
|
|
119
|
+
const enforcement = normalizeCustomEnforcement(opts.config);
|
|
120
|
+
if (enforcement.mode !== "codex_sandbox_full_auto")
|
|
121
|
+
return opts.command;
|
|
122
|
+
const runProfile = readRecipeRunProfile(opts.bundle.recipe);
|
|
123
|
+
const requestedSandbox = typeof runProfile?.sandbox === "string" ? runProfile.sandbox.trim() : "";
|
|
124
|
+
if (!requestedSandbox)
|
|
125
|
+
return opts.command;
|
|
126
|
+
if (!CUSTOM_SANDBOX_WRAPPER_SUPPORTED_VALUES.includes(requestedSandbox)) {
|
|
127
|
+
throw unsupportedCustomSandboxError({
|
|
128
|
+
enforcementMode: enforcement.mode,
|
|
129
|
+
requestedSandbox,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
return [
|
|
133
|
+
"codex",
|
|
134
|
+
"sandbox",
|
|
135
|
+
resolveCodexSandboxPlatform(enforcement.platform),
|
|
136
|
+
"--full-auto",
|
|
137
|
+
...opts.command,
|
|
138
|
+
];
|
|
139
|
+
}
|
|
140
|
+
function normalizeCustomCommand(value) {
|
|
141
|
+
return Array.isArray(value)
|
|
142
|
+
? value.map((entry) => entry.trim()).filter((entry) => entry.length > 0)
|
|
143
|
+
: [];
|
|
144
|
+
}
|
|
145
|
+
export function buildCustomInvocation(opts) {
|
|
146
|
+
const command = normalizeCustomCommand(opts.config?.command);
|
|
147
|
+
if (command.length === 0) {
|
|
148
|
+
throw new Error("Custom runner adapter requires config.runner.custom.command to contain at least one argv element");
|
|
149
|
+
}
|
|
150
|
+
const { execution } = opts.bundle;
|
|
151
|
+
const recipeEnv = buildRecipeRunnerEnv(opts.bundle.recipe);
|
|
152
|
+
const enforcement = normalizeCustomEnforcement(opts.config);
|
|
153
|
+
const preparedCommand = buildCustomCommand({
|
|
154
|
+
config: opts.config,
|
|
155
|
+
bundle: opts.bundle,
|
|
156
|
+
command,
|
|
157
|
+
});
|
|
158
|
+
return {
|
|
159
|
+
adapter_id: opts.adapterId,
|
|
160
|
+
run_id: execution.run_id,
|
|
161
|
+
run_dir: execution.artifact_paths.run_dir,
|
|
162
|
+
bundle_path: execution.artifact_paths.bundle_path,
|
|
163
|
+
state_path: execution.artifact_paths.state_path,
|
|
164
|
+
events_path: execution.artifact_paths.events_path,
|
|
165
|
+
result_path: execution.artifact_paths.result_path,
|
|
166
|
+
trace_path: execution.artifact_paths.trace_path,
|
|
167
|
+
stderr_path: execution.artifact_paths.stderr_path,
|
|
168
|
+
trace_policy: execution.trace_policy,
|
|
169
|
+
timeout_policy: execution.timeout_policy,
|
|
170
|
+
bootstrap_path: execution.artifact_paths.bootstrap_path,
|
|
171
|
+
output_last_message_path: null,
|
|
172
|
+
argv: preparedCommand,
|
|
173
|
+
env: {
|
|
174
|
+
...opts.config?.env,
|
|
175
|
+
AGENTPLANE_RUNNER_ADAPTER: opts.adapterId,
|
|
176
|
+
AGENTPLANE_RUNNER_MODE: execution.mode,
|
|
177
|
+
AGENTPLANE_RUNNER_API_VERSION: opts.bundle.runner_api_version,
|
|
178
|
+
AGENTPLANE_RUNNER_TARGET: opts.bundle.target.kind,
|
|
179
|
+
AGENTPLANE_RUNNER_BUNDLE_PATH: execution.artifact_paths.bundle_path,
|
|
180
|
+
AGENTPLANE_RUNNER_RUN_DIR: execution.artifact_paths.run_dir,
|
|
181
|
+
AGENTPLANE_RUNNER_BOOTSTRAP_PATH: execution.artifact_paths.bootstrap_path,
|
|
182
|
+
AGENTPLANE_RUNNER_STATE_PATH: execution.artifact_paths.state_path,
|
|
183
|
+
AGENTPLANE_RUNNER_EVENTS_PATH: execution.artifact_paths.events_path,
|
|
184
|
+
AGENTPLANE_RUNNER_RESULT_PATH: execution.artifact_paths.result_path,
|
|
185
|
+
AGENTPLANE_RUNNER_ENFORCEMENT_MODE: enforcement.mode ?? "none",
|
|
186
|
+
AGENTPLANE_RUNNER_ENFORCEMENT_PLATFORM: enforcement.platform ?? "auto",
|
|
187
|
+
...recipeEnv,
|
|
188
|
+
},
|
|
189
|
+
dry_run: execution.mode === "dry_run",
|
|
190
|
+
};
|
|
191
|
+
}
|
|
@@ -1 +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;
|
|
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;AAG9D,OAAO,KAAK,EACV,yBAAyB,EACzB,mBAAmB,EACnB,gBAAgB,EAEhB,YAAY,EACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;AAwFrB,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;IAW/D,OAAO,CAAC,UAAU,EAAE,gBAAgB,GAAG,OAAO,CAAC,YAAY,CAAC;CA4K7D"}
|