agentplane 0.3.15 → 0.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/policy/incidents.md +7 -0
- package/bin/agentplane.js +1 -1
- package/bin/framework-dev-contract.js +1 -0
- package/dist/.build-manifest.json +506 -321
- package/dist/backends/task-backend/load.d.ts.map +1 -1
- package/dist/backends/task-backend/load.js +32 -19
- package/dist/backends/task-backend/local-backend-doc.d.ts.map +1 -1
- package/dist/backends/task-backend/local-backend-doc.js +1 -1
- package/dist/backends/task-backend/redmine/backend-runtime.d.ts +147 -0
- package/dist/backends/task-backend/redmine/backend-runtime.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-runtime.js +258 -0
- package/dist/backends/task-backend/redmine/backend-sync/context.d.ts +44 -0
- package/dist/backends/task-backend/redmine/backend-sync/context.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/context.js +8 -0
- package/dist/backends/task-backend/redmine/backend-sync/ids.d.ts +6 -0
- package/dist/backends/task-backend/redmine/backend-sync/ids.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/ids.js +21 -0
- package/dist/backends/task-backend/redmine/backend-sync/migration.d.ts +4 -0
- package/dist/backends/task-backend/redmine/backend-sync/migration.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/migration.js +87 -0
- package/dist/backends/task-backend/redmine/backend-sync/status.d.ts +10 -0
- package/dist/backends/task-backend/redmine/backend-sync/status.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/status.js +78 -0
- package/dist/backends/task-backend/redmine/backend-sync/sync.d.ts +12 -0
- package/dist/backends/task-backend/redmine/backend-sync/sync.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/sync.js +82 -0
- package/dist/backends/task-backend/redmine/backend-sync/write.d.ts +5 -0
- package/dist/backends/task-backend/redmine/backend-sync/write.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/backend-sync/write.js +100 -0
- package/dist/backends/task-backend/redmine/backend-sync.d.ts +6 -66
- package/dist/backends/task-backend/redmine/backend-sync.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine/backend-sync.js +5 -367
- package/dist/backends/task-backend/redmine-backend.d.ts +2 -33
- package/dist/backends/task-backend/redmine-backend.d.ts.map +1 -1
- package/dist/backends/task-backend/redmine-backend.js +26 -241
- package/dist/backends/task-backend/shared/errors.d.ts +12 -0
- package/dist/backends/task-backend/shared/errors.d.ts.map +1 -1
- package/dist/backends/task-backend/shared/errors.js +12 -0
- package/dist/cli/archive.d.ts.map +1 -1
- package/dist/cli/archive.js +3 -5
- package/dist/cli/error-map.d.ts +7 -1
- package/dist/cli/error-map.d.ts.map +1 -1
- package/dist/cli/error-map.js +231 -19
- package/dist/cli/exit-codes.d.ts +14 -2
- package/dist/cli/exit-codes.d.ts.map +1 -1
- package/dist/cli/exit-codes.js +24 -11
- package/dist/cli/output.d.ts +3 -0
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +25 -14
- package/dist/cli/prompts.d.ts.map +1 -1
- package/dist/cli/prompts.js +44 -0
- package/dist/cli/run-cli/command-catalog/core.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/core.js +34 -76
- package/dist/cli/run-cli/command-catalog/lifecycle.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/lifecycle.js +23 -26
- package/dist/cli/run-cli/command-catalog/project.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/project.js +39 -54
- package/dist/cli/run-cli/command-catalog/shared.d.ts +15 -3
- package/dist/cli/run-cli/command-catalog/shared.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/shared.js +19 -6
- package/dist/cli/run-cli/command-catalog/task.d.ts.map +1 -1
- package/dist/cli/run-cli/command-catalog/task.js +63 -57
- package/dist/cli/run-cli/command-loaders.d.ts +174 -0
- package/dist/cli/run-cli/command-loaders.d.ts.map +1 -0
- package/dist/cli/run-cli/command-loaders.js +128 -0
- package/dist/cli/run-cli/commands/init/model.d.ts +42 -0
- package/dist/cli/run-cli/commands/init/model.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/orchestrate.d.ts +9 -0
- package/dist/cli/run-cli/commands/init/orchestrate.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/orchestrate.js +321 -0
- package/dist/cli/run-cli/commands/init/parsers.d.ts +5 -0
- package/dist/cli/run-cli/commands/init/parsers.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/parsers.js +36 -0
- package/dist/cli/run-cli/commands/init/presets.d.ts +15 -0
- package/dist/cli/run-cli/commands/init/presets.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/presets.js +63 -0
- package/dist/cli/run-cli/commands/init/spec.d.ts +5 -0
- package/dist/cli/run-cli/commands/init/spec.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/spec.js +212 -0
- package/dist/cli/run-cli/commands/init/write-config.d.ts +1 -0
- package/dist/cli/run-cli/commands/init/write-config.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init/write-config.js +1 -0
- package/dist/cli/run-cli/commands/init/write-gitignore.js +1 -1
- package/dist/cli/run-cli/commands/init.d.ts +1 -28
- package/dist/cli/run-cli/commands/init.d.ts.map +1 -1
- package/dist/cli/run-cli/commands/init.js +1 -596
- package/dist/cli/run-cli/update-warning.d.ts +1 -0
- package/dist/cli/run-cli/update-warning.d.ts.map +1 -1
- package/dist/cli/run-cli/update-warning.js +10 -2
- package/dist/cli/run-cli.d.ts.map +1 -1
- package/dist/cli/run-cli.js +1 -2
- package/dist/cli/spec/errors.d.ts +13 -1
- package/dist/cli/spec/errors.d.ts.map +1 -1
- package/dist/cli/spec/errors.js +14 -4
- package/dist/commands/backend.d.ts.map +1 -1
- package/dist/commands/backend.js +66 -118
- package/dist/commands/block.spec.js +1 -1
- package/dist/commands/branch/work-start.js +1 -1
- package/dist/commands/commit.spec.js +1 -1
- package/dist/commands/doctor/branch-pr.js +1 -1
- package/dist/commands/doctor/fixes.js +1 -1
- package/dist/commands/doctor/runtime.d.ts.map +1 -1
- package/dist/commands/doctor/runtime.js +2 -2
- package/dist/commands/doctor/workspace.js +1 -1
- package/dist/commands/finish.spec.js +1 -1
- package/dist/commands/guard/commit.command.js +1 -1
- package/dist/commands/guard/impl/clean.d.ts +6 -0
- package/dist/commands/guard/impl/clean.d.ts.map +1 -0
- package/dist/commands/guard/impl/clean.js +29 -0
- package/dist/commands/guard/impl/close-dirt.d.ts +6 -0
- package/dist/commands/guard/impl/close-dirt.d.ts.map +1 -0
- package/dist/commands/guard/impl/close-dirt.js +56 -0
- package/dist/commands/guard/impl/commands.d.ts +4 -36
- package/dist/commands/guard/impl/commands.d.ts.map +1 -1
- package/dist/commands/guard/impl/commands.js +4 -549
- package/dist/commands/guard/impl/comment-commit.js +1 -1
- package/dist/commands/guard/impl/commit-diagnostics.d.ts +4 -0
- package/dist/commands/guard/impl/commit-diagnostics.d.ts.map +1 -0
- package/dist/commands/guard/impl/commit-diagnostics.js +150 -0
- package/dist/commands/guard/impl/commit.d.ts +25 -0
- package/dist/commands/guard/impl/commit.d.ts.map +1 -0
- package/dist/commands/guard/impl/commit.js +366 -0
- package/dist/commands/guard/impl/guard-commit.d.ts +3 -0
- package/dist/commands/guard/impl/guard-commit.d.ts.map +1 -0
- package/dist/commands/guard/impl/guard-commit.js +21 -0
- package/dist/commands/guard/impl/policy.d.ts +1 -0
- package/dist/commands/guard/impl/policy.d.ts.map +1 -1
- package/dist/commands/guard/impl/policy.js +9 -2
- package/dist/commands/guard/impl/suggest.d.ts +6 -0
- package/dist/commands/guard/impl/suggest.d.ts.map +1 -0
- package/dist/commands/guard/impl/suggest.js +33 -0
- package/dist/commands/hooks/index.d.ts +3 -0
- package/dist/commands/hooks/index.d.ts.map +1 -1
- package/dist/commands/hooks/index.js +27 -10
- package/dist/commands/pr/integrate/cmd.js +1 -1
- package/dist/commands/pr/integrate/internal/prepare.js +1 -1
- package/dist/commands/pr/internal/auto-commit.d.ts.map +1 -1
- package/dist/commands/pr/internal/auto-commit.js +2 -5
- package/dist/commands/pr/internal/gh-api.d.ts.map +1 -1
- package/dist/commands/pr/internal/gh-api.js +15 -8
- package/dist/commands/pr/internal/sync-branch.d.ts +0 -1
- package/dist/commands/pr/internal/sync-branch.d.ts.map +1 -1
- package/dist/commands/pr/internal/sync-branch.js +2 -5
- package/dist/commands/pr/internal/sync.d.ts.map +1 -1
- package/dist/commands/pr/internal/sync.js +30 -0
- package/dist/commands/pr/open.d.ts.map +1 -1
- package/dist/commands/pr/open.js +98 -8
- package/dist/commands/recipes/impl/resolver.js +1 -1
- package/dist/commands/recipes/impl/version.js +1 -1
- package/dist/commands/release/apply.command.js +1 -1
- package/dist/commands/release/apply.mutation.d.ts +1 -0
- package/dist/commands/release/apply.mutation.d.ts.map +1 -1
- package/dist/commands/release/apply.mutation.js +4 -0
- package/dist/commands/release/apply.pipeline/finalize.d.ts +21 -0
- package/dist/commands/release/apply.pipeline/finalize.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline/finalize.js +80 -0
- package/dist/commands/release/apply.pipeline/mutation.d.ts +18 -0
- package/dist/commands/release/apply.pipeline/mutation.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline/mutation.js +78 -0
- package/dist/commands/release/apply.pipeline/preflight.d.ts +25 -0
- package/dist/commands/release/apply.pipeline/preflight.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline/preflight.js +69 -0
- package/dist/commands/release/apply.pipeline/shared.d.ts +2 -0
- package/dist/commands/release/apply.pipeline/shared.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline/shared.js +5 -0
- package/dist/commands/release/apply.pipeline/state.d.ts +25 -0
- package/dist/commands/release/apply.pipeline/state.d.ts.map +1 -0
- package/dist/commands/release/apply.pipeline/state.js +129 -0
- package/dist/commands/release/apply.pipeline.d.ts +1 -1
- package/dist/commands/release/apply.pipeline.d.ts.map +1 -1
- package/dist/commands/release/apply.pipeline.js +4 -347
- package/dist/commands/release/apply.preflight.d.ts +9 -6
- package/dist/commands/release/apply.preflight.d.ts.map +1 -1
- package/dist/commands/release/apply.preflight.js +71 -51
- package/dist/commands/runtime.command.d.ts +2 -2
- package/dist/commands/runtime.command.d.ts.map +1 -1
- package/dist/commands/runtime.command.js +2 -2
- package/dist/commands/scenario/impl/commands.d.ts.map +1 -1
- package/dist/commands/scenario/impl/commands.js +52 -39
- package/dist/commands/scenario/impl/report.d.ts.map +1 -1
- package/dist/commands/scenario/impl/report.js +4 -7
- package/dist/commands/shared/allow-prefix-policy.d.ts.map +1 -0
- package/dist/{shared → commands/shared}/allow-prefix-policy.js +1 -1
- package/dist/commands/shared/comment-format.d.ts.map +1 -0
- package/dist/commands/shared/diagnostics.d.ts.map +1 -0
- package/dist/commands/shared/git-context.d.ts +1 -27
- package/dist/commands/shared/git-context.d.ts.map +1 -1
- package/dist/commands/shared/git-context.js +1 -156
- package/dist/commands/shared/git-diff.d.ts +1 -10
- package/dist/commands/shared/git-diff.d.ts.map +1 -1
- package/dist/commands/shared/git-diff.js +1 -49
- package/dist/commands/shared/git-ops.d.ts +1 -14
- package/dist/commands/shared/git-ops.d.ts.map +1 -1
- package/dist/commands/shared/git-ops.js +20 -150
- package/dist/commands/shared/git-worktree.d.ts +1 -9
- package/dist/commands/shared/git-worktree.d.ts.map +1 -1
- package/dist/commands/shared/git-worktree.js +1 -68
- package/dist/commands/shared/git.d.ts +1 -3
- package/dist/commands/shared/git.d.ts.map +1 -1
- package/dist/commands/shared/git.js +1 -14
- package/dist/commands/shared/policy-deny.d.ts +1 -1
- package/dist/commands/shared/reconcile-check.js +1 -1
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +24 -2
- package/dist/commands/shared/task-store/intents.d.ts.map +1 -1
- package/dist/commands/shared/task-store/intents.js +1 -1
- package/dist/commands/start.spec.js +1 -1
- package/dist/commands/task/close-tail-state.d.ts +7 -0
- package/dist/commands/task/close-tail-state.d.ts.map +1 -0
- package/dist/commands/task/close-tail-state.js +18 -0
- package/dist/commands/task/derive.js +1 -1
- package/dist/commands/task/finish-close.d.ts +22 -0
- package/dist/commands/task/finish-close.d.ts.map +1 -0
- package/dist/commands/task/finish-close.js +119 -0
- package/dist/commands/task/finish-command.d.ts +3 -0
- package/dist/commands/task/finish-command.d.ts.map +1 -0
- package/dist/commands/task/finish-command.js +56 -0
- package/dist/commands/task/finish-execute.d.ts +8 -0
- package/dist/commands/task/finish-execute.d.ts.map +1 -0
- package/dist/commands/task/finish-execute.js +272 -0
- package/dist/commands/task/finish-findings.d.ts +20 -0
- package/dist/commands/task/finish-findings.d.ts.map +1 -0
- package/dist/commands/task/finish-findings.js +27 -0
- package/dist/commands/task/finish-plan.d.ts +7 -0
- package/dist/commands/task/finish-plan.d.ts.map +1 -0
- package/dist/commands/task/finish-plan.js +157 -0
- package/dist/commands/task/finish-types.d.ts +69 -0
- package/dist/commands/task/finish-types.d.ts.map +1 -0
- package/dist/commands/task/finish.d.ts +1 -42
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +1 -527
- package/dist/commands/task/hosted-close-pr.command.d.ts.map +1 -1
- package/dist/commands/task/hosted-close-pr.command.js +29 -4
- package/dist/commands/task/hosted-merge-sync/builders.d.ts +35 -0
- package/dist/commands/task/hosted-merge-sync/builders.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync/builders.js +148 -0
- package/dist/commands/task/hosted-merge-sync/github.d.ts +10 -0
- package/dist/commands/task/hosted-merge-sync/github.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync/github.js +113 -0
- package/dist/commands/task/hosted-merge-sync/local-branch.d.ts +12 -0
- package/dist/commands/task/hosted-merge-sync/local-branch.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync/local-branch.js +143 -0
- package/dist/commands/task/hosted-merge-sync/model.d.ts +47 -0
- package/dist/commands/task/hosted-merge-sync/model.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync/pr-meta.d.ts +12 -0
- package/dist/commands/task/hosted-merge-sync/pr-meta.d.ts.map +1 -0
- package/dist/commands/task/hosted-merge-sync/pr-meta.js +26 -0
- package/dist/commands/task/hosted-merge-sync.d.ts +5 -63
- package/dist/commands/task/hosted-merge-sync.d.ts.map +1 -1
- package/dist/commands/task/hosted-merge-sync.js +10 -444
- package/dist/commands/task/new.js +1 -1
- package/dist/commands/task/set-status.command.js +1 -1
- package/dist/commands/task/shared/direct-work-lock.d.ts.map +1 -0
- package/dist/commands/task/shared/git-log.d.ts.map +1 -0
- package/dist/commands/task/shared/transitions.d.ts +1 -1
- package/dist/commands/task/shared/transitions.d.ts.map +1 -1
- package/dist/commands/task/shared/transitions.js +4 -6
- package/dist/commands/upgrade/apply.js +1 -1
- package/dist/commands/workflow-playbook.command.d.ts.map +1 -1
- package/dist/commands/workflow-playbook.command.js +8 -7
- package/dist/harness/hooks-lifecycle.d.ts.map +1 -1
- package/dist/harness/hooks-lifecycle.js +11 -7
- package/dist/meta/release.d.ts.map +1 -1
- package/dist/meta/release.js +8 -4
- package/dist/policy/engine.d.ts +1 -1
- package/dist/policy/evaluate.d.ts +1 -1
- package/dist/policy/{types.d.ts → model.d.ts} +1 -1
- package/dist/policy/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/policy/result.d.ts +1 -1
- package/dist/policy/rules/allowlist.d.ts +1 -1
- package/dist/policy/rules/branch-pr-base.d.ts +1 -1
- package/dist/policy/rules/clean-tree.d.ts +1 -1
- package/dist/policy/rules/commit-subject.d.ts +1 -1
- package/dist/policy/rules/protected-paths.d.ts +1 -1
- package/dist/runner/adapters/base.d.ts +42 -0
- package/dist/runner/adapters/base.d.ts.map +1 -0
- package/dist/runner/adapters/base.js +107 -0
- package/dist/runner/adapters/codex-preparation.d.ts +7 -0
- package/dist/runner/adapters/codex-preparation.d.ts.map +1 -0
- package/dist/runner/adapters/codex-preparation.js +86 -0
- package/dist/runner/adapters/codex.d.ts.map +1 -1
- package/dist/runner/adapters/codex.js +30 -175
- package/dist/runner/adapters/custom-preparation.d.ts +9 -0
- package/dist/runner/adapters/custom-preparation.d.ts.map +1 -0
- package/dist/runner/adapters/custom-preparation.js +191 -0
- package/dist/runner/adapters/custom.d.ts.map +1 -1
- package/dist/runner/adapters/custom.js +26 -279
- package/dist/runner/process-supervision/run.d.ts +30 -0
- package/dist/runner/process-supervision/run.d.ts.map +1 -0
- package/dist/runner/process-supervision/run.js +349 -0
- package/dist/runner/process-supervision/signals.d.ts +16 -0
- package/dist/runner/process-supervision/signals.d.ts.map +1 -0
- package/dist/runner/process-supervision/signals.js +85 -0
- package/dist/runner/process-supervision/state.d.ts +10 -0
- package/dist/runner/process-supervision/state.d.ts.map +1 -0
- package/dist/runner/process-supervision/state.js +42 -0
- package/dist/runner/process-supervision/streams.d.ts +6 -0
- package/dist/runner/process-supervision/streams.d.ts.map +1 -0
- package/dist/runner/process-supervision/streams.js +23 -0
- package/dist/runner/process-supervision.d.ts +5 -47
- package/dist/runner/process-supervision.d.ts.map +1 -1
- package/dist/runner/process-supervision.js +3 -490
- package/dist/runner/usecases/scenario-materialize-task.js +1 -1
- package/dist/runtime/approvals/index.d.ts +1 -1
- package/dist/runtime/approvals/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/approvals/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/approvals/runtime.d.ts +1 -1
- package/dist/runtime/behavior/index.d.ts +1 -1
- package/dist/runtime/behavior/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/behavior/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/behavior/resolve.d.ts +1 -1
- package/dist/runtime/capabilities/backend.d.ts +1 -1
- package/dist/runtime/capabilities/index.d.ts +1 -1
- package/dist/runtime/capabilities/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/capabilities/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/capabilities/model.js +1 -0
- package/dist/runtime/capabilities/recipe.d.ts +1 -1
- package/dist/runtime/capabilities/registry.d.ts +1 -1
- package/dist/runtime/capabilities/runner.d.ts +1 -1
- package/dist/runtime/execution-context.d.ts.map +1 -1
- package/dist/runtime/execution-context.js +16 -0
- package/dist/runtime/execution-profile/index.d.ts +1 -1
- package/dist/runtime/execution-profile/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/execution-profile/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/execution-profile/model.js +1 -0
- package/dist/runtime/execution-profile/resolve.d.ts +1 -1
- package/dist/runtime/explain/index.d.ts +1 -1
- package/dist/runtime/explain/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/explain/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/explain/model.js +1 -0
- package/dist/runtime/explain/resolve.d.ts +1 -1
- package/dist/runtime/protocol/index.d.ts +1 -1
- package/dist/runtime/protocol/index.js +1 -1
- package/dist/runtime/protocol/{types.d.ts → model.d.ts} +1 -1
- package/dist/runtime/protocol/{types.d.ts.map → model.d.ts.map} +1 -1
- package/dist/runtime/protocol/resolve.d.ts +1 -1
- package/dist/runtime/protocol/resolve.js +1 -1
- package/dist/runtime/shared/repo-cli-version.d.ts.map +1 -0
- package/dist/{shared → runtime/shared}/repo-cli-version.js +1 -1
- package/dist/runtime/shared/runtime-artifacts.d.ts.map +1 -0
- package/dist/{shared → runtime/shared}/runtime-source.d.ts +1 -1
- package/dist/runtime/shared/runtime-source.d.ts.map +1 -0
- package/dist/{shared → runtime/shared}/runtime-source.js +1 -1
- package/dist/runtime/shared/version-compare.d.ts.map +1 -0
- package/dist/runtime/task-intake/resolve.js +1 -1
- package/dist/shared/errors.d.ts +52 -2
- package/dist/shared/errors.d.ts.map +1 -1
- package/dist/shared/errors.js +66 -4
- package/dist/shared/trace-events.d.ts +13 -0
- package/dist/shared/trace-events.d.ts.map +1 -0
- package/dist/shared/trace-events.js +17 -0
- package/dist/{shared/task-doc-conflicts.d.ts → task-doc/conflicts.d.ts} +1 -1
- package/dist/task-doc/conflicts.d.ts.map +1 -0
- package/dist/{shared/task-doc-conflicts.js → task-doc/conflicts.js} +1 -1
- package/dist/{shared/task-doc-state.d.ts → task-doc/state.d.ts} +1 -1
- package/dist/task-doc/state.d.ts.map +1 -0
- package/package.json +8 -8
- package/dist/cli/run-cli/error-guidance.d.ts +0 -9
- package/dist/cli/run-cli/error-guidance.d.ts.map +0 -1
- package/dist/cli/run-cli/error-guidance.js +0 -210
- package/dist/cli/run-cli.test-helpers.d.ts +0 -2
- package/dist/cli/run-cli.test-helpers.d.ts.map +0 -1
- package/dist/cli/run-cli.test-helpers.js +0 -1
- package/dist/commands/recipes.test-helpers.d.ts +0 -202
- package/dist/commands/recipes.test-helpers.d.ts.map +0 -1
- package/dist/commands/recipes.test-helpers.js +0 -483
- package/dist/commands/release.test-helpers.d.ts +0 -38
- package/dist/commands/release.test-helpers.d.ts.map +0 -1
- package/dist/commands/release.test-helpers.js +0 -55
- package/dist/commands/task.test-helpers.d.ts +0 -13
- package/dist/commands/task.test-helpers.d.ts.map +0 -1
- package/dist/commands/task.test-helpers.js +0 -65
- package/dist/runner/test-helpers.d.ts +0 -30
- package/dist/runner/test-helpers.d.ts.map +0 -1
- package/dist/runner/test-helpers.js +0 -97
- package/dist/shared/agent-emoji.d.ts +0 -5
- package/dist/shared/agent-emoji.d.ts.map +0 -1
- package/dist/shared/agent-emoji.js +0 -51
- package/dist/shared/allow-prefix-policy.d.ts.map +0 -1
- package/dist/shared/comment-format.d.ts.map +0 -1
- package/dist/shared/diagnostics.d.ts.map +0 -1
- package/dist/shared/direct-work-lock.d.ts.map +0 -1
- package/dist/shared/git-log.d.ts.map +0 -1
- package/dist/shared/repo-cli-version.d.ts.map +0 -1
- package/dist/shared/runtime-artifacts.d.ts.map +0 -1
- package/dist/shared/runtime-source.d.ts.map +0 -1
- package/dist/shared/task-doc-conflicts.d.ts.map +0 -1
- package/dist/shared/task-doc-state.d.ts.map +0 -1
- package/dist/shared/version-compare.d.ts.map +0 -1
- package/dist/testing/cli-harness/recipe-archives.d.ts +0 -28
- package/dist/testing/cli-harness/recipe-archives.d.ts.map +0 -1
- package/dist/testing/cli-harness/recipe-archives.js +0 -374
- package/dist/testing/cli-harness/stdio.d.ts +0 -26
- package/dist/testing/cli-harness/stdio.d.ts.map +0 -1
- package/dist/testing/cli-harness/stdio.js +0 -84
- package/dist/testing/cli-harness.d.ts +0 -25
- package/dist/testing/cli-harness.d.ts.map +0 -1
- package/dist/testing/cli-harness.js +0 -313
- package/dist/testing/index.d.ts +0 -2
- package/dist/testing/index.d.ts.map +0 -1
- package/dist/testing/index.js +0 -1
- /package/dist/{policy/types.js → cli/run-cli/commands/init/model.js} +0 -0
- /package/dist/{shared → commands/shared}/allow-prefix-policy.d.ts +0 -0
- /package/dist/{shared → commands/shared}/comment-format.d.ts +0 -0
- /package/dist/{shared → commands/shared}/comment-format.js +0 -0
- /package/dist/{shared → commands/shared}/diagnostics.d.ts +0 -0
- /package/dist/{shared → commands/shared}/diagnostics.js +0 -0
- /package/dist/{runtime/approvals/types.js → commands/task/finish-types.js} +0 -0
- /package/dist/{runtime/behavior/types.js → commands/task/hosted-merge-sync/model.js} +0 -0
- /package/dist/{shared → commands/task/shared}/direct-work-lock.d.ts +0 -0
- /package/dist/{shared → commands/task/shared}/direct-work-lock.js +0 -0
- /package/dist/{shared → commands/task/shared}/git-log.d.ts +0 -0
- /package/dist/{shared → commands/task/shared}/git-log.js +0 -0
- /package/dist/{runtime/capabilities/types.js → policy/model.js} +0 -0
- /package/dist/runtime/{execution-profile/types.js → approvals/model.js} +0 -0
- /package/dist/runtime/{explain/types.js → behavior/model.js} +0 -0
- /package/dist/runtime/protocol/{types.js → model.js} +0 -0
- /package/dist/{shared → runtime/shared}/repo-cli-version.d.ts +0 -0
- /package/dist/{shared → runtime/shared}/runtime-artifacts.d.ts +0 -0
- /package/dist/{shared → runtime/shared}/runtime-artifacts.js +0 -0
- /package/dist/{shared → runtime/shared}/version-compare.d.ts +0 -0
- /package/dist/{shared → runtime/shared}/version-compare.js +0 -0
- /package/dist/{shared/task-doc-state.js → task-doc/state.js} +0 -0
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import { isRecord } from "../../shared/guards.js";
|
|
2
|
-
import { appendCommentNotes as appendCommentNotesImpl, normalizeComments as normalizeCommentsImpl, } from "./redmine/comments.js";
|
|
3
|
-
import { requestJson as requestRedmineJson } from "./redmine/client.js";
|
|
4
|
-
import { appendCustomField as appendRedmineCustomField, customFieldValue as redmineCustomFieldValue, setIssueCustomFieldValue as setRedmineIssueCustomFieldValue, } from "./redmine/fields.js";
|
|
5
|
-
import { doneRatioForStatus, issueToTask as issueToTaskImpl, startDateFromTaskId, taskToIssuePayload as taskToIssuePayloadImpl, } from "./redmine/mapping.js";
|
|
6
|
-
import { coerceDocVersion as coerceRedmineDocVersion, maybeParseJson as maybeParseRedmineJson, } from "./redmine/parse.js";
|
|
7
|
-
import { findIssueByTaskId as findIssueByTaskIdImpl, listTasksRemote as listTasksRemoteImpl, } from "./redmine/remote.js";
|
|
8
2
|
import { getRedmineTask, getRedmineTaskDoc, getRedmineTasks, listRedmineProjectionTasks, listRedmineTasks, normalizeRedmineTasks, exportRedmineProjectionSnapshot, exportRedmineTasksJson, setRedmineTaskDoc, touchRedmineTaskDocMetadata, } from "./redmine/backend-cache-doc.js";
|
|
9
|
-
import {
|
|
10
|
-
import { generateRedmineTaskId,
|
|
3
|
+
import { inspectRedmineConfiguration } from "./redmine/backend-report.js";
|
|
4
|
+
import { generateRedmineTaskId, migrateRedmineCanonicalState, syncPullRedmine, syncRedmine, writeRedmineTask, writeRedmineTasks, } from "./redmine/backend-sync.js";
|
|
5
|
+
import { createRedmineCacheDocContext, createRedmineReportContext, createRedmineSyncContext, redmineBackendRuntimeMethods, } from "./redmine/backend-runtime.js";
|
|
11
6
|
import { readRedmineEnv } from "./redmine/env.js";
|
|
12
|
-
import { BackendError,
|
|
7
|
+
import { BackendError, firstNonEmptyString, redmineConfigMissingEnvMessage, } from "./shared.js";
|
|
13
8
|
export class RedmineBackend {
|
|
14
9
|
id = "redmine";
|
|
15
10
|
capabilities = {
|
|
@@ -88,275 +83,65 @@ export class RedmineBackend {
|
|
|
88
83
|
this.reverseStatus.set(value, key);
|
|
89
84
|
}
|
|
90
85
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
cache: this.cache,
|
|
94
|
-
customFields: this.customFields,
|
|
95
|
-
ownerAgent: this.ownerAgent,
|
|
96
|
-
batchSize: this.batchSize,
|
|
97
|
-
findIssueByTaskId: async (taskId) => await this.findIssueByTaskId(taskId),
|
|
98
|
-
issueToTask: (issue, taskIdOverride) => this.issueToTask(issue, taskIdOverride),
|
|
99
|
-
customFieldValue: (issue, fieldId) => this.customFieldValue(issue, fieldId),
|
|
100
|
-
appendCustomField: (fields, key, value) => this.appendCustomField(fields, key, value),
|
|
101
|
-
requestJson: async (method, reqPath, payload, params) => await this.requestJson(method, reqPath, payload, params),
|
|
102
|
-
assertExpectedRevisionSupported: (taskId, opts) => this.assertExpectedRevisionSupported(taskId, opts),
|
|
103
|
-
assertExpectedRevision: (taskId, expectedRevision, currentRevision) => this.assertExpectedRevision(taskId, expectedRevision, currentRevision),
|
|
104
|
-
cacheTask: async (task, dirty) => await this.cacheTask(task, dirty),
|
|
105
|
-
};
|
|
86
|
+
setInferredStatusByTaskStatus(next) {
|
|
87
|
+
this.inferredStatusByTaskStatus = next;
|
|
106
88
|
}
|
|
107
|
-
|
|
108
|
-
return
|
|
109
|
-
projectId: this.projectId,
|
|
110
|
-
customFields: this.customFields,
|
|
111
|
-
requestJson: async (method, reqPath, payload, params) => await this.requestJson(method, reqPath, payload, params),
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
syncContext() {
|
|
115
|
-
return {
|
|
116
|
-
cache: this.cache,
|
|
117
|
-
customFields: this.customFields,
|
|
118
|
-
ownerAgent: this.ownerAgent,
|
|
119
|
-
projectId: this.projectId,
|
|
120
|
-
batchSize: this.batchSize,
|
|
121
|
-
batchPauseMs: this.batchPauseMs,
|
|
122
|
-
statusMap: this.statusMap,
|
|
123
|
-
issueCache: this.issueCache,
|
|
124
|
-
inferredStatusByTaskStatus: this.inferredStatusByTaskStatus,
|
|
125
|
-
setInferredStatusByTaskStatus: (next) => {
|
|
126
|
-
this.inferredStatusByTaskStatus = next;
|
|
127
|
-
},
|
|
128
|
-
listTasksRemote: async () => await this.listTasksRemote(),
|
|
129
|
-
writeTask: async (task, opts) => await this.writeTask(task, opts),
|
|
130
|
-
writeTasks: async (tasks, opts) => await this.writeTasks(tasks, opts),
|
|
131
|
-
findIssueByTaskId: async (taskId) => await this.findIssueByTaskId(taskId),
|
|
132
|
-
issueToTask: (issue, taskIdOverride) => this.issueToTask(issue, taskIdOverride),
|
|
133
|
-
taskToIssuePayload: (task, existingIssue) => this.taskToIssuePayload(task, existingIssue),
|
|
134
|
-
appendCustomField: (fields, key, value) => this.appendCustomField(fields, key, value),
|
|
135
|
-
customFieldValue: (issue, fieldId) => this.customFieldValue(issue, fieldId),
|
|
136
|
-
maybeParseJson: (value) => this.maybeParseJson(value),
|
|
137
|
-
normalizeComments: (value) => this.normalizeComments(value),
|
|
138
|
-
appendCommentNotes: async (issueId, existingComments, desiredComments) => await this.appendCommentNotes(issueId, existingComments, desiredComments),
|
|
139
|
-
cacheTask: async (task, dirty) => await this.cacheTask(task, dirty),
|
|
140
|
-
assertExpectedRevisionSupported: (taskId, opts) => this.assertExpectedRevisionSupported(taskId, opts),
|
|
141
|
-
assertExpectedRevision: (taskId, expectedRevision, currentRevision) => this.assertExpectedRevision(taskId, expectedRevision, currentRevision),
|
|
142
|
-
ensureDocMetadata: (task) => this.ensureDocMetadata(task),
|
|
143
|
-
diffTasks: (localTask, remoteTask) => this.diffTasks(localTask, remoteTask),
|
|
144
|
-
tasksDiffer: (localTask, remoteTask) => this.tasksDiffer(localTask, remoteTask),
|
|
145
|
-
taskIdFieldId: () => this.taskIdFieldId(),
|
|
146
|
-
setIssueCustomFieldValue: (issue, fieldId, value) => this.setIssueCustomFieldValue(issue, fieldId, value),
|
|
147
|
-
requestJson: async (method, reqPath, payload, params, opts) => await this.requestJson(method, reqPath, payload, params, opts),
|
|
148
|
-
};
|
|
89
|
+
runtimeHost() {
|
|
90
|
+
return this;
|
|
149
91
|
}
|
|
150
92
|
async generateTaskId(opts) {
|
|
151
|
-
return await generateRedmineTaskId(this.
|
|
93
|
+
return await generateRedmineTaskId(createRedmineSyncContext(this.runtimeHost()), opts);
|
|
152
94
|
}
|
|
153
95
|
async listTasks() {
|
|
154
|
-
return await listRedmineTasks(this.
|
|
96
|
+
return await listRedmineTasks(createRedmineCacheDocContext(this.runtimeHost()));
|
|
155
97
|
}
|
|
156
98
|
async listProjectionTasks() {
|
|
157
|
-
return await listRedmineProjectionTasks(this.
|
|
99
|
+
return await listRedmineProjectionTasks(createRedmineCacheDocContext(this.runtimeHost()));
|
|
158
100
|
}
|
|
159
101
|
async exportTasksJson(outputPath) {
|
|
160
|
-
await exportRedmineTasksJson(this.
|
|
102
|
+
await exportRedmineTasksJson(createRedmineCacheDocContext(this.runtimeHost()), outputPath);
|
|
161
103
|
}
|
|
162
104
|
async exportProjectionSnapshot(outputPath) {
|
|
163
|
-
await exportRedmineProjectionSnapshot(this.
|
|
105
|
+
await exportRedmineProjectionSnapshot(createRedmineCacheDocContext(this.runtimeHost()), outputPath);
|
|
164
106
|
}
|
|
165
107
|
async refreshProjection(opts) {
|
|
166
108
|
if (!opts.allowNetwork) {
|
|
167
109
|
throw new BackendError("Projection refresh requires network access approval", "E_BACKEND");
|
|
168
110
|
}
|
|
169
|
-
await this.
|
|
111
|
+
await syncPullRedmine(createRedmineSyncContext(this.runtimeHost()), opts.conflict ?? "prefer-remote", opts.quiet ?? true);
|
|
170
112
|
}
|
|
171
113
|
async normalizeTasks() {
|
|
172
|
-
return await normalizeRedmineTasks(this.
|
|
114
|
+
return await normalizeRedmineTasks(createRedmineCacheDocContext(this.runtimeHost()));
|
|
173
115
|
}
|
|
174
116
|
async migrateCanonicalState() {
|
|
175
|
-
return await migrateRedmineCanonicalState(this.
|
|
117
|
+
return await migrateRedmineCanonicalState(createRedmineSyncContext(this.runtimeHost()));
|
|
176
118
|
}
|
|
177
119
|
async inspectConfiguration() {
|
|
178
|
-
return await inspectRedmineConfiguration(this.
|
|
120
|
+
return await inspectRedmineConfiguration(createRedmineReportContext(this.runtimeHost()));
|
|
179
121
|
}
|
|
180
122
|
async getTask(taskId) {
|
|
181
|
-
return await getRedmineTask(this.
|
|
123
|
+
return await getRedmineTask(createRedmineCacheDocContext(this.runtimeHost()), taskId);
|
|
182
124
|
}
|
|
183
125
|
async getTasks(taskIds) {
|
|
184
|
-
return await getRedmineTasks(this.
|
|
126
|
+
return await getRedmineTasks(createRedmineCacheDocContext(this.runtimeHost()), taskIds);
|
|
185
127
|
}
|
|
186
128
|
async getTaskDoc(taskId) {
|
|
187
|
-
return await getRedmineTaskDoc(this.
|
|
129
|
+
return await getRedmineTaskDoc(createRedmineCacheDocContext(this.runtimeHost()), taskId);
|
|
188
130
|
}
|
|
189
131
|
async setTaskDoc(taskId, doc, updatedBy, opts) {
|
|
190
|
-
await setRedmineTaskDoc(this.
|
|
132
|
+
await setRedmineTaskDoc(createRedmineCacheDocContext(this.runtimeHost()), taskId, doc, updatedBy, opts);
|
|
191
133
|
}
|
|
192
134
|
async touchTaskDocMetadata(taskId, updatedBy, opts) {
|
|
193
|
-
await touchRedmineTaskDocMetadata(this.
|
|
135
|
+
await touchRedmineTaskDocMetadata(createRedmineCacheDocContext(this.runtimeHost()), taskId, updatedBy, opts);
|
|
194
136
|
}
|
|
195
137
|
async writeTask(task, opts) {
|
|
196
|
-
await writeRedmineTask(this.
|
|
138
|
+
await writeRedmineTask(createRedmineSyncContext(this.runtimeHost()), task, opts);
|
|
197
139
|
}
|
|
198
140
|
async writeTasks(tasks, opts) {
|
|
199
|
-
await writeRedmineTasks(this.
|
|
141
|
+
await writeRedmineTasks(createRedmineSyncContext(this.runtimeHost()), tasks, opts);
|
|
200
142
|
}
|
|
201
143
|
async sync(opts) {
|
|
202
|
-
await syncRedmine(this.
|
|
203
|
-
}
|
|
204
|
-
ensureDocMetadata(task) {
|
|
205
|
-
if (task.doc === undefined)
|
|
206
|
-
return;
|
|
207
|
-
task.doc_version = normalizeDocVersion(task.doc_version);
|
|
208
|
-
task.doc_updated_at ??= nowIso();
|
|
209
|
-
task.doc_updated_by ??= DEFAULT_DOC_UPDATED_BY;
|
|
210
|
-
}
|
|
211
|
-
async syncPush(quiet, confirm) {
|
|
212
|
-
await syncPushRedmine(this.syncContext(), quiet, confirm);
|
|
213
|
-
}
|
|
214
|
-
async syncPull(conflict, quiet) {
|
|
215
|
-
await syncPullRedmine(this.syncContext(), conflict, quiet);
|
|
216
|
-
}
|
|
217
|
-
async handleConflict(taskId, localTask, remoteTask, conflict) {
|
|
218
|
-
await handleRedmineConflict(this.syncContext(), taskId, localTask, remoteTask, conflict);
|
|
219
|
-
}
|
|
220
|
-
diffTasks(localTask, remoteTask) {
|
|
221
|
-
return diffRedmineTasks(localTask, remoteTask);
|
|
222
|
-
}
|
|
223
|
-
tasksDiffer(localTask, remoteTask) {
|
|
224
|
-
return redmineTasksDiffer(localTask, remoteTask);
|
|
225
|
-
}
|
|
226
|
-
async cacheTask(task, dirty) {
|
|
227
|
-
if (!this.cache)
|
|
228
|
-
return;
|
|
229
|
-
const next = { ...task, dirty };
|
|
230
|
-
await this.cache.writeTask(next);
|
|
231
|
-
}
|
|
232
|
-
assertExpectedRevisionSupported(taskId, opts) {
|
|
233
|
-
if (opts?.expectedRevision === undefined)
|
|
234
|
-
return;
|
|
235
|
-
if (this.capabilities.supports_revision_guarded_writes)
|
|
236
|
-
return;
|
|
237
|
-
throw new BackendError(`Task revision guarding is unavailable for ${taskId} without AGENTPLANE_REDMINE_CUSTOM_FIELDS_CANONICAL_STATE`, "E_BACKEND");
|
|
238
|
-
}
|
|
239
|
-
assertExpectedRevision(taskId, expectedRevision, currentRevision) {
|
|
240
|
-
if (expectedRevision === undefined)
|
|
241
|
-
return;
|
|
242
|
-
const expected = Math.trunc(expectedRevision);
|
|
243
|
-
if (expected <= 0 || expected === currentRevision)
|
|
244
|
-
return;
|
|
245
|
-
throw new BackendError(`Task revision changed concurrently: ${taskId} ` +
|
|
246
|
-
`(expected revision ${expected}, current revision ${currentRevision})`, "E_BACKEND");
|
|
247
|
-
}
|
|
248
|
-
taskIdFieldId() {
|
|
249
|
-
const fieldId = this.customFields?.task_id;
|
|
250
|
-
if (fieldId)
|
|
251
|
-
return fieldId;
|
|
252
|
-
throw new BackendError(redmineConfigMissingEnvMessage("AGENTPLANE_REDMINE_CUSTOM_FIELDS_TASK_ID"), "E_BACKEND");
|
|
253
|
-
}
|
|
254
|
-
setIssueCustomFieldValue(issue, fieldId, value) {
|
|
255
|
-
setRedmineIssueCustomFieldValue(issue, fieldId, value);
|
|
256
|
-
}
|
|
257
|
-
async listTasksRemote() {
|
|
258
|
-
const taskFieldId = this.taskIdFieldId();
|
|
259
|
-
return await listTasksRemoteImpl({
|
|
260
|
-
projectId: this.projectId,
|
|
261
|
-
taskFieldId,
|
|
262
|
-
issueCache: this.issueCache,
|
|
263
|
-
requestJson: async (method, reqPath, payload, params) => await this.requestJson(method, reqPath, payload, params),
|
|
264
|
-
customFieldValue: (issue, fieldId) => this.customFieldValue(issue, fieldId),
|
|
265
|
-
issueToTask: (issue, taskIdOverride) => this.issueToTask(issue, taskIdOverride),
|
|
266
|
-
});
|
|
267
|
-
}
|
|
268
|
-
issueFromPayload(payload) {
|
|
269
|
-
return isRecord(payload.issue) ? payload.issue : null;
|
|
270
|
-
}
|
|
271
|
-
async inferStatusIdForTaskStatus(statusRaw) {
|
|
272
|
-
return await inferRedmineStatusIdForTaskStatus(this.syncContext(), statusRaw);
|
|
273
|
-
}
|
|
274
|
-
async loadInferredStatusByTaskStatus() {
|
|
275
|
-
return await loadRedmineInferredStatusByTaskStatus(this.syncContext());
|
|
276
|
-
}
|
|
277
|
-
selectInferredStatus(statuses, target) {
|
|
278
|
-
return selectRedmineInferredStatus(statuses, target);
|
|
279
|
-
}
|
|
280
|
-
async findIssueByTaskId(taskId) {
|
|
281
|
-
const taskFieldId = this.taskIdFieldId();
|
|
282
|
-
return await findIssueByTaskIdImpl({
|
|
283
|
-
taskId,
|
|
284
|
-
projectId: this.projectId,
|
|
285
|
-
taskFieldId,
|
|
286
|
-
issueCache: this.issueCache,
|
|
287
|
-
requestJson: async (method, reqPath, payload, params) => await this.requestJson(method, reqPath, payload, params),
|
|
288
|
-
customFieldValue: (issue, fieldId) => this.customFieldValue(issue, fieldId),
|
|
289
|
-
refreshList: async () => {
|
|
290
|
-
await this.listTasksRemote();
|
|
291
|
-
},
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
issueToTask(issue, taskIdOverride) {
|
|
295
|
-
return issueToTaskImpl({
|
|
296
|
-
issue,
|
|
297
|
-
taskIdOverride,
|
|
298
|
-
reverseStatus: this.reverseStatus,
|
|
299
|
-
customFields: this.customFields,
|
|
300
|
-
ownerAgent: this.ownerAgent,
|
|
301
|
-
defaultDocVersion: DOC_VERSION,
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
taskToIssuePayload(task, existingIssue) {
|
|
305
|
-
return taskToIssuePayloadImpl({
|
|
306
|
-
task,
|
|
307
|
-
existingIssue,
|
|
308
|
-
statusMap: this.statusMap,
|
|
309
|
-
assigneeId: this.assigneeId,
|
|
310
|
-
customFields: this.customFields,
|
|
311
|
-
appendCustomField: (fields, key, value) => this.appendCustomField(fields, key, value),
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
appendCustomField(fields, key, value) {
|
|
315
|
-
appendRedmineCustomField({ customFields: this.customFields, fields, key, value });
|
|
316
|
-
}
|
|
317
|
-
normalizeComments(value) {
|
|
318
|
-
return normalizeCommentsImpl(value);
|
|
319
|
-
}
|
|
320
|
-
async appendCommentNotes(issueId, existingComments, desiredComments) {
|
|
321
|
-
await appendCommentNotesImpl({
|
|
322
|
-
issueId,
|
|
323
|
-
existingComments,
|
|
324
|
-
desiredComments,
|
|
325
|
-
requestJson: async (method, reqPath, payload, params) => await this.requestJson(method, reqPath, payload, params),
|
|
326
|
-
});
|
|
327
|
-
}
|
|
328
|
-
startDateFromTaskId(taskId) {
|
|
329
|
-
return startDateFromTaskId(taskId);
|
|
330
|
-
}
|
|
331
|
-
doneRatioForStatus(status) {
|
|
332
|
-
return doneRatioForStatus(status);
|
|
333
|
-
}
|
|
334
|
-
commentsToPairs(comments) {
|
|
335
|
-
const pairs = [];
|
|
336
|
-
for (const comment of comments) {
|
|
337
|
-
const author = toStringSafe(comment.author).trim();
|
|
338
|
-
const body = toStringSafe(comment.body).trim();
|
|
339
|
-
if (!author && !body)
|
|
340
|
-
continue;
|
|
341
|
-
pairs.push([author, body]);
|
|
342
|
-
}
|
|
343
|
-
return pairs;
|
|
344
|
-
}
|
|
345
|
-
formatCommentNote(author = "unknown", body = "") {
|
|
346
|
-
const authorText = author;
|
|
347
|
-
const bodyText = body;
|
|
348
|
-
return `[comment] ${authorText}: ${bodyText}`.trim();
|
|
349
|
-
}
|
|
350
|
-
customFieldValue(issue, fieldId) {
|
|
351
|
-
return redmineCustomFieldValue(issue, fieldId);
|
|
352
|
-
}
|
|
353
|
-
maybeParseJson(value) {
|
|
354
|
-
return maybeParseRedmineJson(value);
|
|
355
|
-
}
|
|
356
|
-
coerceDocVersion(value) {
|
|
357
|
-
return coerceRedmineDocVersion(value);
|
|
358
|
-
}
|
|
359
|
-
async requestJson(method, reqPath, payload, params, opts) {
|
|
360
|
-
return await requestRedmineJson({ baseUrl: this.baseUrl, apiKey: this.apiKey }, method, reqPath, payload, params, opts);
|
|
144
|
+
await syncRedmine(createRedmineSyncContext(this.runtimeHost()), opts);
|
|
361
145
|
}
|
|
362
146
|
}
|
|
147
|
+
Object.assign(RedmineBackend.prototype, redmineBackendRuntimeMethods);
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Backend-local Redmine/task-backend error surface.
|
|
3
|
+
*
|
|
4
|
+
* Allowed here:
|
|
5
|
+
* - backend transport/domain errors and messages
|
|
6
|
+
* - backend-specific retry/unavailable sentinel types
|
|
7
|
+
*
|
|
8
|
+
* Do not add:
|
|
9
|
+
* - CLI usage helpers
|
|
10
|
+
* - shared cross-command error containers
|
|
11
|
+
* - generic runtime failures that are not backend-owned
|
|
12
|
+
*/
|
|
1
13
|
export declare class BackendError extends Error {
|
|
2
14
|
code: "E_BACKEND" | "E_NETWORK";
|
|
3
15
|
constructor(message: string, code: "E_BACKEND" | "E_NETWORK");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/backends/task-backend/shared/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAa,SAAQ,KAAK;IACrC,IAAI,EAAE,WAAW,GAAG,WAAW,CAAC;gBACpB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,WAAW;CAI7D;AAED,qBAAa,kBAAmB,SAAQ,YAAY;gBACtC,OAAO,EAAE,MAAM;CAG5B;AAED,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,MAAM,CAG9E;AAED,wBAAgB,8BAA8B,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpF;AAED,wBAAgB,4BAA4B,IAAI,MAAM,CAErD"}
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/backends/task-backend/shared/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACrC,IAAI,EAAE,WAAW,GAAG,WAAW,CAAC;gBACpB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,WAAW;CAI7D;AAED,qBAAa,kBAAmB,SAAQ,YAAY;gBACtC,OAAO,EAAE,MAAM;CAG5B;AAED,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,MAAM,CAG9E;AAED,wBAAgB,8BAA8B,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpF;AAED,wBAAgB,4BAA4B,IAAI,MAAM,CAErD"}
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Backend-local Redmine/task-backend error surface.
|
|
3
|
+
*
|
|
4
|
+
* Allowed here:
|
|
5
|
+
* - backend transport/domain errors and messages
|
|
6
|
+
* - backend-specific retry/unavailable sentinel types
|
|
7
|
+
*
|
|
8
|
+
* Do not add:
|
|
9
|
+
* - CLI usage helpers
|
|
10
|
+
* - shared cross-command error containers
|
|
11
|
+
* - generic runtime failures that are not backend-owned
|
|
12
|
+
*/
|
|
1
13
|
export class BackendError extends Error {
|
|
2
14
|
code;
|
|
3
15
|
constructor(message, code) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"archive.d.ts","sourceRoot":"","sources":["../../src/cli/archive.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"archive.d.ts","sourceRoot":"","sources":["../../src/cli/archive.ts"],"names":[],"mappings":"AAUA,KAAK,WAAW,GAAG,KAAK,GAAG,KAAK,CAAC;AAOjC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAsB,eAAe,CACnC,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,WAAW,GAChB,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAS9B;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAKtE;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBhB;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,iBAAiB,EAAE,CA2BjG"}
|
package/dist/cli/archive.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { execFile } from "node:child_process";
|
|
2
1
|
import { readFile } from "node:fs/promises";
|
|
3
|
-
import { promisify } from "node:util";
|
|
4
2
|
import path from "node:path";
|
|
5
3
|
import { gunzipSync } from "node:zlib";
|
|
4
|
+
import { runProcess } from "@agentplaneorg/core";
|
|
6
5
|
import yauzl from "yauzl";
|
|
7
6
|
import { CliError } from "../shared/errors.js";
|
|
8
7
|
import { exitCodeForError } from "./exit-codes.js";
|
|
9
|
-
const execFileAsync = promisify(execFile);
|
|
10
8
|
export async function validateArchive(archivePath, type) {
|
|
11
9
|
if (type === "zip") {
|
|
12
10
|
const entries = await listZipEntries(archivePath);
|
|
@@ -45,10 +43,10 @@ export async function extractArchive(opts) {
|
|
|
45
43
|
});
|
|
46
44
|
}
|
|
47
45
|
if (archiveType === "tar") {
|
|
48
|
-
await
|
|
46
|
+
await runProcess({ command: "tar", args: ["-xzf", opts.archivePath, "-C", opts.destDir] });
|
|
49
47
|
return;
|
|
50
48
|
}
|
|
51
|
-
await
|
|
49
|
+
await runProcess({ command: "unzip", args: ["-q", opts.archivePath, "-d", opts.destDir] });
|
|
52
50
|
}
|
|
53
51
|
export function validateArchiveEntries(entries, symlinks) {
|
|
54
52
|
const issues = [];
|
package/dist/cli/error-map.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import { CliError } from "../shared/errors.js";
|
|
1
|
+
import type { CliError } from "../shared/errors.js";
|
|
2
|
+
export type NextAction = {
|
|
3
|
+
command: string;
|
|
4
|
+
reason: string;
|
|
5
|
+
reasonCode?: string;
|
|
6
|
+
};
|
|
2
7
|
export declare function mapCoreError(err: unknown, context: Record<string, unknown>): CliError;
|
|
3
8
|
export declare function mapBackendError(err: unknown, context: Record<string, unknown>): CliError;
|
|
9
|
+
export declare function writeError(err: CliError, jsonErrors: boolean): void;
|
|
4
10
|
//# sourceMappingURL=error-map.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-map.d.ts","sourceRoot":"","sources":["../../src/cli/error-map.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"error-map.d.ts","sourceRoot":"","sources":["../../src/cli/error-map.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAIpD,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAsBF,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,QAAQ,CAqCrF;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,QAAQ,CAMxF;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,GAAG,IAAI,CA6CnE"}
|