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
package/dist/cli/error-map.js
CHANGED
|
@@ -1,42 +1,254 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { fromZodError, isZodErrorLike } from "zod-validation-error/v3";
|
|
2
|
+
import { readDiagnosticContext } from "../commands/shared/diagnostics.js";
|
|
3
|
+
import { BackendCliError, GitError, IoError, NetworkError, ValidationError, formatJsonError, } from "../shared/errors.js";
|
|
3
4
|
import { BackendError } from "../backends/task-backend.js";
|
|
5
|
+
import { getReasonCodeMeta } from "./reason-codes.js";
|
|
6
|
+
function findZodError(err) {
|
|
7
|
+
if (isZodErrorLike(err))
|
|
8
|
+
return err;
|
|
9
|
+
if (err instanceof Error) {
|
|
10
|
+
const cause = err.cause;
|
|
11
|
+
if (isZodErrorLike(cause))
|
|
12
|
+
return cause;
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
function formatZodErrorForCli(err) {
|
|
17
|
+
return fromZodError(err, { prefix: "Validation error" }).message;
|
|
18
|
+
}
|
|
4
19
|
export function mapCoreError(err, context) {
|
|
5
20
|
const message = err instanceof Error ? err.message : String(err);
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
21
|
+
const zodError = findZodError(err);
|
|
22
|
+
if (zodError) {
|
|
23
|
+
return new ValidationError({
|
|
24
|
+
message: formatZodErrorForCli(zodError),
|
|
25
|
+
context,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
if (message.startsWith("Not a git repository") ||
|
|
29
|
+
message.startsWith("Detached HEAD") ||
|
|
30
|
+
message.includes("failed to resolve current branch")) {
|
|
31
|
+
return new GitError({
|
|
10
32
|
message,
|
|
11
33
|
context,
|
|
12
34
|
});
|
|
13
35
|
}
|
|
14
36
|
if (err instanceof SyntaxError) {
|
|
15
|
-
return new
|
|
16
|
-
exitCode: exitCodeForError("E_VALIDATION"),
|
|
17
|
-
code: "E_VALIDATION",
|
|
37
|
+
return new ValidationError({
|
|
18
38
|
message: `Invalid JSON: ${message}`,
|
|
19
39
|
context,
|
|
20
40
|
});
|
|
21
41
|
}
|
|
22
42
|
if (message.includes("schema_version") || message.startsWith("config.")) {
|
|
23
|
-
return new
|
|
24
|
-
exitCode: exitCodeForError("E_VALIDATION"),
|
|
25
|
-
code: "E_VALIDATION",
|
|
43
|
+
return new ValidationError({
|
|
26
44
|
message,
|
|
27
45
|
context,
|
|
28
46
|
});
|
|
29
47
|
}
|
|
30
|
-
return new
|
|
48
|
+
return new IoError({ message, context });
|
|
31
49
|
}
|
|
32
50
|
export function mapBackendError(err, context) {
|
|
33
51
|
if (err instanceof BackendError) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
message: err.message,
|
|
38
|
-
context,
|
|
39
|
-
});
|
|
52
|
+
if (err.code === "E_NETWORK")
|
|
53
|
+
return new NetworkError({ message: err.message, context });
|
|
54
|
+
return new BackendCliError({ message: err.message, context });
|
|
40
55
|
}
|
|
41
56
|
return mapCoreError(err, context);
|
|
42
57
|
}
|
|
58
|
+
export function writeError(err, jsonErrors) {
|
|
59
|
+
const guidance = resolveErrorGuidance(err);
|
|
60
|
+
const contextReasonCode = typeof err.context?.reason_code === "string" ? String(err.context.reason_code) : undefined;
|
|
61
|
+
const reasonCode = contextReasonCode ?? guidance.nextAction?.reasonCode;
|
|
62
|
+
const reasonDecode = getReasonCodeMeta(reasonCode);
|
|
63
|
+
if (jsonErrors) {
|
|
64
|
+
process.stdout.write(`${formatJsonError(err, {
|
|
65
|
+
state: guidance.state,
|
|
66
|
+
likelyCause: guidance.likelyCause,
|
|
67
|
+
hint: guidance.hint,
|
|
68
|
+
nextAction: guidance.nextAction,
|
|
69
|
+
reasonDecode,
|
|
70
|
+
})}\n`);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const header = `error [${err.code}]`;
|
|
74
|
+
if (err.message.includes("\n")) {
|
|
75
|
+
process.stderr.write(`${header}\n${err.message}\n`);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
process.stderr.write(`${header}: ${err.message}\n`);
|
|
79
|
+
}
|
|
80
|
+
if (guidance.state) {
|
|
81
|
+
process.stderr.write(`state: ${guidance.state}\n`);
|
|
82
|
+
}
|
|
83
|
+
if (guidance.likelyCause) {
|
|
84
|
+
process.stderr.write(`likely_cause: ${guidance.likelyCause}\n`);
|
|
85
|
+
}
|
|
86
|
+
if (guidance.hint) {
|
|
87
|
+
process.stderr.write(`hint: ${guidance.hint}\n`);
|
|
88
|
+
}
|
|
89
|
+
if (guidance.nextAction) {
|
|
90
|
+
process.stderr.write(`next_action: ${guidance.nextAction.command} (${guidance.nextAction.reason})\n`);
|
|
91
|
+
}
|
|
92
|
+
if (reasonDecode) {
|
|
93
|
+
process.stderr.write(`reason_code: ${reasonDecode.code} [${reasonDecode.category}] ${reasonDecode.summary}\n`);
|
|
94
|
+
process.stderr.write(`reason_action: ${reasonDecode.action}\n`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
function resolveErrorGuidance(err) {
|
|
98
|
+
const explicit = readDiagnosticContext(err.context);
|
|
99
|
+
const command = typeof err.context?.command === "string" ? err.context.command : undefined;
|
|
100
|
+
const reasonCode = typeof err.context?.reason_code === "string" ? String(err.context.reason_code) : undefined;
|
|
101
|
+
const usage = command ? `agentplane help ${command} --compact` : "agentplane help";
|
|
102
|
+
const withExplicit = (fallback) => ({
|
|
103
|
+
state: explicit.state ?? fallback.state,
|
|
104
|
+
likelyCause: explicit.likelyCause ?? fallback.likelyCause,
|
|
105
|
+
hint: explicit.hint ?? fallback.hint,
|
|
106
|
+
nextAction: explicit.nextAction ?? fallback.nextAction,
|
|
107
|
+
});
|
|
108
|
+
switch (err.code) {
|
|
109
|
+
case "E_USAGE": {
|
|
110
|
+
if (reasonCode === "sync_backend_mismatch") {
|
|
111
|
+
return withExplicit({
|
|
112
|
+
hint: "Configured backend id mismatch. Check active backend and retry with a matching id.",
|
|
113
|
+
nextAction: {
|
|
114
|
+
command: "agentplane config show",
|
|
115
|
+
reason: "inspect active backend id before running sync",
|
|
116
|
+
reasonCode: "sync_backend_mismatch",
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
return withExplicit({
|
|
121
|
+
hint: `See \`${usage}\` for usage.`,
|
|
122
|
+
nextAction: {
|
|
123
|
+
command: usage,
|
|
124
|
+
reason: "inspect required arguments and flags",
|
|
125
|
+
reasonCode: "usage_help",
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
case "E_GIT": {
|
|
130
|
+
if (reasonCode === "integrate_base_checkout_required") {
|
|
131
|
+
return withExplicit({
|
|
132
|
+
hint: "Integrate must run from the base checkout, not from the task branch worktree.",
|
|
133
|
+
nextAction: {
|
|
134
|
+
command: "git worktree list",
|
|
135
|
+
reason: "locate the registered base checkout if the rerun command is not already provided",
|
|
136
|
+
reasonCode,
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
if (reasonCode === "reconcile_git_state_unreadable") {
|
|
141
|
+
return withExplicit({
|
|
142
|
+
hint: "Reconcile check could not read git state.",
|
|
143
|
+
nextAction: {
|
|
144
|
+
command: "git status --short --untracked-files=no",
|
|
145
|
+
reason: "confirm repository state is readable before mutating commands",
|
|
146
|
+
reasonCode: "reconcile_git_state_unreadable",
|
|
147
|
+
},
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
if (command?.startsWith("branch")) {
|
|
151
|
+
return withExplicit({
|
|
152
|
+
hint: "Check git repo/branch; run `git branch` or pass --root <path>.",
|
|
153
|
+
nextAction: {
|
|
154
|
+
command: "git branch",
|
|
155
|
+
reason: "inspect repository branch state",
|
|
156
|
+
reasonCode: "git_branch_state",
|
|
157
|
+
},
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
if (command === "guard commit" || command === "commit") {
|
|
161
|
+
return withExplicit({
|
|
162
|
+
hint: "Check git status/index; stage changes and retry.",
|
|
163
|
+
nextAction: {
|
|
164
|
+
command: "git status --short",
|
|
165
|
+
reason: "inspect staged/unstaged changes before commit",
|
|
166
|
+
reasonCode: "git_index_state",
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
return withExplicit({
|
|
171
|
+
hint: "Check git repo context; pass --root <path> if needed.",
|
|
172
|
+
nextAction: {
|
|
173
|
+
command: "git status --short --untracked-files=no",
|
|
174
|
+
reason: "confirm repository context and tracked changes",
|
|
175
|
+
reasonCode: "git_context",
|
|
176
|
+
},
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
case "E_HANDOFF": {
|
|
180
|
+
return withExplicit({
|
|
181
|
+
hint: "This is an intentional handoff route, not a local mutation failure.",
|
|
182
|
+
nextAction: {
|
|
183
|
+
command: command === "integrate" ? "agentplane task handoff show <task-id>" : usage,
|
|
184
|
+
reason: "inspect the persisted finalize route and continue through the external handoff path",
|
|
185
|
+
reasonCode: "protected_base_integrate_handoff",
|
|
186
|
+
},
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
case "E_NETWORK": {
|
|
190
|
+
return withExplicit({
|
|
191
|
+
hint: "Check network access and credentials.",
|
|
192
|
+
nextAction: {
|
|
193
|
+
command: "agentplane preflight --json",
|
|
194
|
+
reason: "recheck approvals and network requirements",
|
|
195
|
+
reasonCode: "network_gate",
|
|
196
|
+
},
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
case "E_RUNTIME": {
|
|
200
|
+
return withExplicit({
|
|
201
|
+
hint: "Inspect runner artifacts and the external runner result before retrying.",
|
|
202
|
+
nextAction: {
|
|
203
|
+
command: "agentplane doctor",
|
|
204
|
+
reason: "confirm runtime wiring and recent runner state before rerunning the command",
|
|
205
|
+
reasonCode: "runtime_runner_state",
|
|
206
|
+
},
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
case "E_BACKEND": {
|
|
210
|
+
if (command?.includes("sync")) {
|
|
211
|
+
return withExplicit({
|
|
212
|
+
hint: "Check backend config under .agentplane/backends and retry.",
|
|
213
|
+
nextAction: {
|
|
214
|
+
command: "agentplane config show",
|
|
215
|
+
reason: "verify backend config path and active settings",
|
|
216
|
+
reasonCode: "backend_sync_config",
|
|
217
|
+
},
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
return withExplicit({
|
|
221
|
+
hint: "Check backend config under .agentplane/backends.",
|
|
222
|
+
nextAction: {
|
|
223
|
+
command: "agentplane config show",
|
|
224
|
+
reason: "inspect backend configuration",
|
|
225
|
+
reasonCode: "backend_config",
|
|
226
|
+
},
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
case "E_VALIDATION": {
|
|
230
|
+
if (reasonCode === "reconcile_task_scan_failed" ||
|
|
231
|
+
reasonCode === "reconcile_task_scan_incomplete") {
|
|
232
|
+
return withExplicit({
|
|
233
|
+
hint: "Reconcile check failed due to task scan drift or parse/read errors.",
|
|
234
|
+
nextAction: {
|
|
235
|
+
command: "agentplane task list --strict-read",
|
|
236
|
+
reason: "surface task scan/read failures before retrying mutating commands",
|
|
237
|
+
reasonCode,
|
|
238
|
+
},
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
return withExplicit({
|
|
242
|
+
hint: "Fix invalid config/input shape and rerun.",
|
|
243
|
+
nextAction: {
|
|
244
|
+
command: "agentplane preflight --json",
|
|
245
|
+
reason: "pinpoint validation failure in one report",
|
|
246
|
+
reasonCode: "validation_preflight",
|
|
247
|
+
},
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
default: {
|
|
251
|
+
return withExplicit({});
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
package/dist/cli/exit-codes.d.ts
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
import type
|
|
2
|
-
export declare
|
|
1
|
+
import { type ErrorCode } from "../shared/errors.js";
|
|
2
|
+
export declare enum ExitCode {
|
|
3
|
+
Internal = 1,
|
|
4
|
+
Usage = 2,
|
|
5
|
+
Validation = 3,
|
|
6
|
+
Io = 4,
|
|
7
|
+
Git = 5,
|
|
8
|
+
Backend = 6,
|
|
9
|
+
Network = 7,
|
|
10
|
+
Runtime = 8,
|
|
11
|
+
Handoff = 9
|
|
12
|
+
}
|
|
13
|
+
export declare const ERROR_TO_EXIT: Readonly<Record<ErrorCode, ExitCode>>;
|
|
14
|
+
export declare function exitCodeForError(code: ErrorCode): ExitCode;
|
|
3
15
|
//# sourceMappingURL=exit-codes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exit-codes.d.ts","sourceRoot":"","sources":["../../src/cli/exit-codes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"exit-codes.d.ts","sourceRoot":"","sources":["../../src/cli/exit-codes.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAE/E,oBAAY,QAAQ;IAClB,QAAQ,IAAI;IACZ,KAAK,IAAI;IACT,UAAU,IAAI;IACd,EAAE,IAAI;IACN,GAAG,IAAI;IACP,OAAO,IAAI;IACX,OAAO,IAAI;IACX,OAAO,IAAI;IACX,OAAO,IAAI;CACZ;AAED,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,QAAQ,CAAC,CAU/D,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,GAAG,QAAQ,CAE1D"}
|
package/dist/cli/exit-codes.js
CHANGED
|
@@ -1,14 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { DEFAULT_ERROR_EXIT_CODES } from "../shared/errors.js";
|
|
2
|
+
export var ExitCode;
|
|
3
|
+
(function (ExitCode) {
|
|
4
|
+
ExitCode[ExitCode["Internal"] = 1] = "Internal";
|
|
5
|
+
ExitCode[ExitCode["Usage"] = 2] = "Usage";
|
|
6
|
+
ExitCode[ExitCode["Validation"] = 3] = "Validation";
|
|
7
|
+
ExitCode[ExitCode["Io"] = 4] = "Io";
|
|
8
|
+
ExitCode[ExitCode["Git"] = 5] = "Git";
|
|
9
|
+
ExitCode[ExitCode["Backend"] = 6] = "Backend";
|
|
10
|
+
ExitCode[ExitCode["Network"] = 7] = "Network";
|
|
11
|
+
ExitCode[ExitCode["Runtime"] = 8] = "Runtime";
|
|
12
|
+
ExitCode[ExitCode["Handoff"] = 9] = "Handoff";
|
|
13
|
+
})(ExitCode || (ExitCode = {}));
|
|
14
|
+
export const ERROR_TO_EXIT = {
|
|
15
|
+
E_USAGE: DEFAULT_ERROR_EXIT_CODES.E_USAGE,
|
|
16
|
+
E_VALIDATION: DEFAULT_ERROR_EXIT_CODES.E_VALIDATION,
|
|
17
|
+
E_IO: DEFAULT_ERROR_EXIT_CODES.E_IO,
|
|
18
|
+
E_GIT: DEFAULT_ERROR_EXIT_CODES.E_GIT,
|
|
19
|
+
E_BACKEND: DEFAULT_ERROR_EXIT_CODES.E_BACKEND,
|
|
20
|
+
E_NETWORK: DEFAULT_ERROR_EXIT_CODES.E_NETWORK,
|
|
21
|
+
E_RUNTIME: DEFAULT_ERROR_EXIT_CODES.E_RUNTIME,
|
|
22
|
+
E_HANDOFF: DEFAULT_ERROR_EXIT_CODES.E_HANDOFF,
|
|
23
|
+
E_INTERNAL: DEFAULT_ERROR_EXIT_CODES.E_INTERNAL,
|
|
11
24
|
};
|
|
12
25
|
export function exitCodeForError(code) {
|
|
13
|
-
return
|
|
26
|
+
return ERROR_TO_EXIT[code];
|
|
14
27
|
}
|
package/dist/cli/output.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Logger, type LoggerMode } from "@agentplaneorg/core";
|
|
1
2
|
export type CliOutputWriter = {
|
|
2
3
|
write: (chunk: string) => unknown;
|
|
3
4
|
};
|
|
@@ -68,6 +69,8 @@ export declare function workflowModeMessage(actual: string | undefined, expected
|
|
|
68
69
|
export declare function createCliEmitter(streams?: {
|
|
69
70
|
stdout?: CliOutputWriter;
|
|
70
71
|
stderr?: CliOutputWriter;
|
|
72
|
+
loggerMode?: LoggerMode;
|
|
73
|
+
logger?: Logger;
|
|
71
74
|
}): CliEmitter;
|
|
72
75
|
export declare function emitCommandResult(emitter: CliEmitter, result: CommandResult): void;
|
|
73
76
|
export declare function emitCommandResults(emitter: CliEmitter, results: Iterable<CommandResult>): void;
|
package/dist/cli/output.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/cli/output.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEnD,MAAM,MAAM,cAAc,GACtB,MAAM,GACN;IACE,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;CAC1C,CAAC;AAEN,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACxD,KAAK,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACpE,IAAI,EAAE,CAAC,KAAK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wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAEzF;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAE9E;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAExF;AA4BD,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE;IACzC,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,UAAU,CAsEb;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI,CA2BlF;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAC,aAAa,CAAC,GAAG,IAAI,CAI9F"}
|
package/dist/cli/output.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createLogger } from "@agentplaneorg/core";
|
|
1
2
|
function ensureTrailingNewline(text) {
|
|
2
3
|
return text.endsWith("\n") ? text : `${text}\n`;
|
|
3
4
|
}
|
|
@@ -8,12 +9,6 @@ function renderReportLine(entry) {
|
|
|
8
9
|
return `${entry.label}:`;
|
|
9
10
|
return `${entry.label}: ${String(entry.value)}`;
|
|
10
11
|
}
|
|
11
|
-
function resolveWriter(stdout, stderr, stream) {
|
|
12
|
-
return stream === "stderr" ? stderr : stdout;
|
|
13
|
-
}
|
|
14
|
-
function writeChunk(writer, text) {
|
|
15
|
-
writer.write(text);
|
|
16
|
-
}
|
|
17
12
|
export function successMessage(action, target, details) {
|
|
18
13
|
const base = target ? `${action} ${target}` : action;
|
|
19
14
|
const suffix = details ? ` (${details})` : "";
|
|
@@ -86,23 +81,31 @@ function renderJsonSectionBlock(label, value, indent) {
|
|
|
86
81
|
export function createCliEmitter(streams) {
|
|
87
82
|
const stdout = streams?.stdout ?? process.stdout;
|
|
88
83
|
const stderr = streams?.stderr ?? process.stderr;
|
|
84
|
+
const logger = streams?.logger ?? createLogger({ mode: streams?.loggerMode, stdout, stderr });
|
|
89
85
|
const line = (text, stream = "stdout") => {
|
|
90
|
-
|
|
86
|
+
logger.write({ kind: "line", text, stream });
|
|
91
87
|
};
|
|
92
88
|
const lines = (values, stream = "stdout") => {
|
|
93
|
-
|
|
89
|
+
for (const value of values) {
|
|
90
|
+
logger.write({ kind: "line", text: value, stream });
|
|
91
|
+
}
|
|
94
92
|
};
|
|
95
93
|
const json = (value, stream = "stdout") => {
|
|
96
|
-
|
|
94
|
+
logger.write({ kind: "json", value, stream });
|
|
97
95
|
};
|
|
98
96
|
const jsonSection = (label, value, options) => {
|
|
99
97
|
const block = renderJsonSectionBlock(label, value, options?.indent ?? " ");
|
|
100
98
|
if (!block)
|
|
101
99
|
return;
|
|
102
|
-
|
|
100
|
+
for (const valueLine of block.trimEnd().split("\n")) {
|
|
101
|
+
logger.write({ kind: "line", text: valueLine, stream: options?.stream ?? "stdout" });
|
|
102
|
+
}
|
|
103
103
|
};
|
|
104
104
|
const report = (entries, options) => {
|
|
105
|
-
|
|
105
|
+
const block = renderReportBlock(entries, options);
|
|
106
|
+
for (const valueLine of block.trimEnd().split("\n")) {
|
|
107
|
+
logger.write({ kind: "line", text: valueLine, stream: options?.stream ?? "stdout" });
|
|
108
|
+
}
|
|
106
109
|
};
|
|
107
110
|
return {
|
|
108
111
|
line,
|
|
@@ -111,13 +114,21 @@ export function createCliEmitter(streams) {
|
|
|
111
114
|
jsonSection,
|
|
112
115
|
report,
|
|
113
116
|
info: (message, stream = "stdout") => {
|
|
114
|
-
|
|
117
|
+
logger.write({ kind: "event", level: "info", message: infoMessage(message), stream });
|
|
115
118
|
},
|
|
116
119
|
warn: (message, stream = "stderr") => {
|
|
117
|
-
|
|
120
|
+
logger.write({ kind: "event", level: "warn", message: warnMessage(message), stream });
|
|
118
121
|
},
|
|
119
122
|
success: (action, target, details, stream = "stdout") => {
|
|
120
|
-
|
|
123
|
+
logger.write({
|
|
124
|
+
kind: "event",
|
|
125
|
+
level: "success",
|
|
126
|
+
message: successMessage(action, target, details),
|
|
127
|
+
stream,
|
|
128
|
+
action,
|
|
129
|
+
target,
|
|
130
|
+
details,
|
|
131
|
+
});
|
|
121
132
|
},
|
|
122
133
|
};
|
|
123
134
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/cli/prompts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/cli/prompts.ts"],"names":[],"mappings":"AAkBA,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EAAE,EACjB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,MAAM,CAAC,CA0BjB;AAED,wBAAsB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAuBzF;AAED,wBAAsB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAejE"}
|
package/dist/cli/prompts.js
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
import { createInterface } from "node:readline/promises";
|
|
2
|
+
function shouldUseClackPrompts() {
|
|
3
|
+
return (process.env.AGENTPLANE_PROMPTS !== "plain" &&
|
|
4
|
+
process.stdin.isTTY === true &&
|
|
5
|
+
process.stdout.isTTY === true);
|
|
6
|
+
}
|
|
7
|
+
async function loadClackPrompts() {
|
|
8
|
+
if (!shouldUseClackPrompts())
|
|
9
|
+
return null;
|
|
10
|
+
return await import("@clack/prompts");
|
|
11
|
+
}
|
|
2
12
|
export async function promptChoice(prompt, choices, defaultValue) {
|
|
13
|
+
const clack = await loadClackPrompts();
|
|
14
|
+
if (clack) {
|
|
15
|
+
const answer = await clack.select({
|
|
16
|
+
message: prompt,
|
|
17
|
+
options: choices.map((value) => ({ value, label: value })),
|
|
18
|
+
initialValue: defaultValue,
|
|
19
|
+
});
|
|
20
|
+
if (clack.isCancel(answer)) {
|
|
21
|
+
clack.cancel("Prompt cancelled; using default.");
|
|
22
|
+
return defaultValue;
|
|
23
|
+
}
|
|
24
|
+
return String(answer);
|
|
25
|
+
}
|
|
3
26
|
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
4
27
|
const question = `${prompt} [${choices.join("/")}] (default ${defaultValue}): `;
|
|
5
28
|
const answer = await rl.question(question);
|
|
@@ -14,6 +37,18 @@ export async function promptChoice(prompt, choices, defaultValue) {
|
|
|
14
37
|
return trimmed;
|
|
15
38
|
}
|
|
16
39
|
export async function promptYesNo(prompt, defaultValue) {
|
|
40
|
+
const clack = await loadClackPrompts();
|
|
41
|
+
if (clack) {
|
|
42
|
+
const answer = await clack.confirm({
|
|
43
|
+
message: prompt,
|
|
44
|
+
initialValue: defaultValue,
|
|
45
|
+
});
|
|
46
|
+
if (clack.isCancel(answer)) {
|
|
47
|
+
clack.cancel("Prompt cancelled; using default.");
|
|
48
|
+
return defaultValue;
|
|
49
|
+
}
|
|
50
|
+
return answer;
|
|
51
|
+
}
|
|
17
52
|
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
18
53
|
const question = `${prompt} [${defaultValue ? "Y/n" : "y/N"}]: `;
|
|
19
54
|
const answer = await rl.question(question);
|
|
@@ -28,6 +63,15 @@ export async function promptYesNo(prompt, defaultValue) {
|
|
|
28
63
|
return defaultValue;
|
|
29
64
|
}
|
|
30
65
|
export async function promptInput(prompt) {
|
|
66
|
+
const clack = await loadClackPrompts();
|
|
67
|
+
if (clack) {
|
|
68
|
+
const answer = await clack.text({ message: prompt });
|
|
69
|
+
if (clack.isCancel(answer)) {
|
|
70
|
+
clack.cancel("Prompt cancelled.");
|
|
71
|
+
return "";
|
|
72
|
+
}
|
|
73
|
+
return answer.trim();
|
|
74
|
+
}
|
|
31
75
|
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
32
76
|
const answer = await rl.question(prompt);
|
|
33
77
|
rl.close();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../src/cli/run-cli/command-catalog/core.ts"],"names":[],"mappings":"AAiCA,OAAO,
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../src/cli/run-cli/command-catalog/core.ts"],"names":[],"mappings":"AAiCA,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AA8BhE,eAAO,MAAM,aAAa,6bAoDkB,CAAC"}
|