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,30 +0,0 @@
|
|
|
1
|
-
import type { RunnerContextBundle } from "./types.js";
|
|
2
|
-
type MakeRunnerContextBundleOptions = {
|
|
3
|
-
adapterId?: string;
|
|
4
|
-
taskId?: string;
|
|
5
|
-
runId?: string;
|
|
6
|
-
gitRoot?: string;
|
|
7
|
-
workflowDir?: string;
|
|
8
|
-
title?: string;
|
|
9
|
-
description?: string;
|
|
10
|
-
status?: string;
|
|
11
|
-
owner?: string;
|
|
12
|
-
priority?: string;
|
|
13
|
-
tags?: string[];
|
|
14
|
-
mode?: RunnerContextBundle["execution"]["mode"];
|
|
15
|
-
doc?: string;
|
|
16
|
-
sections?: Record<string, string>;
|
|
17
|
-
basePrompts?: RunnerContextBundle["base_prompts"];
|
|
18
|
-
target?: RunnerContextBundle["target"];
|
|
19
|
-
recipe?: RunnerContextBundle["recipe"];
|
|
20
|
-
repository?: Partial<RunnerContextBundle["repository"]>;
|
|
21
|
-
task?: Partial<RunnerContextBundle["task"]>;
|
|
22
|
-
execution?: Partial<Omit<RunnerContextBundle["execution"], "artifact_paths">> & {
|
|
23
|
-
artifact_paths?: Partial<RunnerContextBundle["execution"]["artifact_paths"]>;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
export declare function setRunnerBundleRunDir(bundle: RunnerContextBundle, runDir: string): void;
|
|
27
|
-
export declare function makeRunnerContextBundle(opts?: MakeRunnerContextBundleOptions): RunnerContextBundle;
|
|
28
|
-
export declare function writeRunnerExecutable(root: string, commandName: string, content: string | readonly string[]): Promise<string>;
|
|
29
|
-
export {};
|
|
30
|
-
//# sourceMappingURL=test-helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-helpers.d.ts","sourceRoot":"","sources":["../../src/runner/test-helpers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAItD,KAAK,8BAA8B,GAAG;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,CAAC,EAAE,mBAAmB,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;IAChD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,WAAW,CAAC,EAAE,mBAAmB,CAAC,cAAc,CAAC,CAAC;IAClD,MAAM,CAAC,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACvC,MAAM,CAAC,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC,CAAC;IACxD,IAAI,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5C,SAAS,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,EAAE,gBAAgB,CAAC,CAAC,GAAG;QAC9E,cAAc,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC;KAC9E,CAAC;CACH,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CASvF;AAED,wBAAgB,uBAAuB,CACrC,IAAI,GAAE,8BAAmC,GACxC,mBAAmB,CA8ErB;AAED,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,GAClC,OAAO,CAAC,MAAM,CAAC,CAEjB"}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { RUNNER_API_VERSION, RUNNER_BUNDLE_SCHEMA_VERSION } from "./types.js";
|
|
3
|
-
import { writeExecutableFile } from "../test-helpers/fs.js";
|
|
4
|
-
export function setRunnerBundleRunDir(bundle, runDir) {
|
|
5
|
-
bundle.execution.artifact_paths.run_dir = runDir;
|
|
6
|
-
bundle.execution.artifact_paths.bundle_path = path.join(runDir, "bundle.json");
|
|
7
|
-
bundle.execution.artifact_paths.bootstrap_path = path.join(runDir, "bootstrap.md");
|
|
8
|
-
bundle.execution.artifact_paths.state_path = path.join(runDir, "run-state.json");
|
|
9
|
-
bundle.execution.artifact_paths.events_path = path.join(runDir, "events.jsonl");
|
|
10
|
-
bundle.execution.artifact_paths.result_path = path.join(runDir, "result.json");
|
|
11
|
-
bundle.execution.artifact_paths.trace_path = path.join(runDir, "agent-trace.jsonl");
|
|
12
|
-
bundle.execution.artifact_paths.stderr_path = path.join(runDir, "stderr.log");
|
|
13
|
-
}
|
|
14
|
-
export function makeRunnerContextBundle(opts = {}) {
|
|
15
|
-
const taskId = opts.taskId ?? "202603231410-ABC123";
|
|
16
|
-
const runId = opts.runId ?? "run-123";
|
|
17
|
-
const gitRoot = opts.gitRoot ?? "/repo";
|
|
18
|
-
const workflowDir = opts.workflowDir ?? ".agentplane/tasks";
|
|
19
|
-
const runDir = path.join(gitRoot, workflowDir, taskId, "runs", runId);
|
|
20
|
-
const title = opts.title ?? "Adapter test";
|
|
21
|
-
const description = opts.description ?? "Adapter test task";
|
|
22
|
-
const status = opts.status ?? "TODO";
|
|
23
|
-
const adapterId = opts.adapterId ?? "codex";
|
|
24
|
-
const executionPathOverrides = opts.execution?.artifact_paths ?? {};
|
|
25
|
-
const executionRest = opts.execution ? { ...opts.execution } : null;
|
|
26
|
-
if (executionRest)
|
|
27
|
-
delete executionRest.artifact_paths;
|
|
28
|
-
const execution = {
|
|
29
|
-
adapter_id: adapterId,
|
|
30
|
-
mode: opts.mode ?? "dry_run",
|
|
31
|
-
run_id: runId,
|
|
32
|
-
timeout_policy: {
|
|
33
|
-
wall_clock_ms: 900_000,
|
|
34
|
-
idle_ms: 180_000,
|
|
35
|
-
terminate_grace_ms: 1500,
|
|
36
|
-
},
|
|
37
|
-
trace_policy: {
|
|
38
|
-
mode: "raw",
|
|
39
|
-
max_tail_bytes: 65_536,
|
|
40
|
-
capture_stderr: true,
|
|
41
|
-
},
|
|
42
|
-
artifact_paths: {
|
|
43
|
-
run_dir: runDir,
|
|
44
|
-
bundle_path: path.join(runDir, "bundle.json"),
|
|
45
|
-
bootstrap_path: path.join(runDir, "bootstrap.md"),
|
|
46
|
-
state_path: path.join(runDir, "run-state.json"),
|
|
47
|
-
events_path: path.join(runDir, "events.jsonl"),
|
|
48
|
-
result_path: path.join(runDir, "result.json"),
|
|
49
|
-
trace_path: path.join(runDir, "agent-trace.jsonl"),
|
|
50
|
-
stderr_path: path.join(runDir, "stderr.log"),
|
|
51
|
-
...executionPathOverrides,
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
if (executionRest)
|
|
55
|
-
Object.assign(execution, executionRest);
|
|
56
|
-
const bundle = {
|
|
57
|
-
schema_version: RUNNER_BUNDLE_SCHEMA_VERSION,
|
|
58
|
-
runner_api_version: RUNNER_API_VERSION,
|
|
59
|
-
target: opts.target ?? { kind: "task", task_id: taskId },
|
|
60
|
-
base_prompts: opts.basePrompts ?? [],
|
|
61
|
-
repository: {
|
|
62
|
-
git_root: gitRoot,
|
|
63
|
-
workflow_dir: workflowDir,
|
|
64
|
-
backend_id: "local",
|
|
65
|
-
backend_config_path: path.join(gitRoot, ".agentplane/backends/local/backend.json"),
|
|
66
|
-
branch: "main",
|
|
67
|
-
head_commit: null,
|
|
68
|
-
...opts.repository,
|
|
69
|
-
},
|
|
70
|
-
task: {
|
|
71
|
-
task_id: taskId,
|
|
72
|
-
data: {
|
|
73
|
-
id: taskId,
|
|
74
|
-
title,
|
|
75
|
-
description,
|
|
76
|
-
status,
|
|
77
|
-
priority: opts.priority ?? "med",
|
|
78
|
-
owner: opts.owner ?? "CODER",
|
|
79
|
-
depends_on: [],
|
|
80
|
-
tags: opts.tags ?? ["code"],
|
|
81
|
-
verify: [],
|
|
82
|
-
},
|
|
83
|
-
frontmatter: { id: taskId, title },
|
|
84
|
-
doc: opts.doc ?? "## Summary\n",
|
|
85
|
-
sections: opts.sections ?? { Summary: "" },
|
|
86
|
-
comments: [],
|
|
87
|
-
events: [],
|
|
88
|
-
...opts.task,
|
|
89
|
-
},
|
|
90
|
-
execution,
|
|
91
|
-
...(opts.recipe ? { recipe: opts.recipe } : {}),
|
|
92
|
-
};
|
|
93
|
-
return bundle;
|
|
94
|
-
}
|
|
95
|
-
export async function writeRunnerExecutable(root, commandName, content) {
|
|
96
|
-
return await writeExecutableFile(root, path.join("bin", commandName), content);
|
|
97
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent-emoji.d.ts","sourceRoot":"","sources":["../../src/shared/agent-emoji.ts"],"names":[],"mappings":"AAmCA,wBAAsB,0BAA0B,CAAC,IAAI,EAAE;IACrD,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,MAAM,CAAC,CAmBlB"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { readFile } from "node:fs/promises";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { fileExists } from "../cli/fs-utils.js";
|
|
4
|
-
const FALLBACK_EMOJIS = ["🧭", "🧠", "🏗️", "🧪", "🛠️", "🔧", "🧩", "🔍", "📦"];
|
|
5
|
-
const WELL_KNOWN_AGENT_EMOJI = {
|
|
6
|
-
ORCHESTRATOR: "🧭",
|
|
7
|
-
PLANNER: "🧠",
|
|
8
|
-
CREATOR: "🏗️",
|
|
9
|
-
INTEGRATOR: "🧩",
|
|
10
|
-
TESTER: "🧪",
|
|
11
|
-
CODER: "🛠️",
|
|
12
|
-
};
|
|
13
|
-
function stableHash32(input) {
|
|
14
|
-
// Simple, stable FNV-1a 32-bit hash (good enough for deterministic emoji selection).
|
|
15
|
-
// FNV-1a offset basis / prime in decimal to avoid numeric-separator style lint quirks.
|
|
16
|
-
let h = 2_166_136_261;
|
|
17
|
-
for (const ch of input) {
|
|
18
|
-
const cp = ch.codePointAt(0) ?? 0;
|
|
19
|
-
h ^= cp;
|
|
20
|
-
h = Math.imul(h, 16_777_619);
|
|
21
|
-
}
|
|
22
|
-
return h >>> 0;
|
|
23
|
-
}
|
|
24
|
-
function fallbackEmojiForAgentId(agentId) {
|
|
25
|
-
const wellKnown = WELL_KNOWN_AGENT_EMOJI[agentId];
|
|
26
|
-
if (wellKnown)
|
|
27
|
-
return wellKnown;
|
|
28
|
-
const idx = stableHash32(agentId) % FALLBACK_EMOJIS.length;
|
|
29
|
-
return FALLBACK_EMOJIS[idx] ?? "🧩";
|
|
30
|
-
}
|
|
31
|
-
// Prefer an explicit agent-level commit_emoji before falling back to deterministic defaults.
|
|
32
|
-
export async function resolveCommitEmojiForAgent(opts) {
|
|
33
|
-
const agentId = opts.agentId.trim();
|
|
34
|
-
if (!agentId)
|
|
35
|
-
return "🧩";
|
|
36
|
-
// Allow users to override the emoji per agent by adding `commit_emoji` to the agent json file.
|
|
37
|
-
const agentPath = path.join(opts.agentsDirAbs, `${agentId}.json`);
|
|
38
|
-
if (await fileExists(agentPath)) {
|
|
39
|
-
try {
|
|
40
|
-
const text = await readFile(agentPath, "utf8");
|
|
41
|
-
const parsed = JSON.parse(text);
|
|
42
|
-
const emoji = parsed && typeof parsed.commit_emoji === "string" ? parsed.commit_emoji.trim() : "";
|
|
43
|
-
if (emoji)
|
|
44
|
-
return emoji;
|
|
45
|
-
}
|
|
46
|
-
catch {
|
|
47
|
-
// ignore; fallback below
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return fallbackEmojiForAgentId(agentId);
|
|
51
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"allow-prefix-policy.d.ts","sourceRoot":"","sources":["../../src/shared/allow-prefix-policy.ts"],"names":[],"mappings":"AAEA,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAEtE;AAED,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKnE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"comment-format.d.ts","sourceRoot":"","sources":["../../src/shared/comment-format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAI5D,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIlE;AAiCD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAwB3F;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAgBzF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../src/shared/diagnostics.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,uBAAuB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAMvD,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,uBAAuB,GAAG,SAAS,EAC5C,UAAU,EAAE,cAAc,GACzB,uBAAuB,CAiBzB;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,uBAAuB,GAAG,SAAS,GAC3C,OAAO,CAAC,cAAc,CAAC,CAqBzB;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC5C,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,GAAG,MAAM,CAaT"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"direct-work-lock.d.ts","sourceRoot":"","sources":["../../src/shared/direct-work-lock.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,wBAAsB,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAkB9F"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"git-log.d.ts","sourceRoot":"","sources":["../../src/shared/git-log.ts"],"names":[],"mappings":"AAAA,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAYxF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"repo-cli-version.d.ts","sourceRoot":"","sources":["../../src/shared/repo-cli-version.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAQ5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAG7D,MAAM,MAAM,mBAAmB,GAC3B,cAAc,GACd,WAAW,GACX,qBAAqB,GACrB,2BAA2B,CAAC;AAEhC,MAAM,MAAM,yBAAyB,GAAG;IACtC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,KAAK,EAAE,mBAAmB,CAAC;IAC3B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,GAAG,IAAI,CAKjF;AA+BD,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,iBAAiB,GACzB,yBAAyB,CAuC3B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-artifacts.d.ts","sourceRoot":"","sources":["../../src/shared/runtime-artifacts.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,kWAc1B,CAAC;AAEX,eAAO,MAAM,4BAA4B,yIAM/B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-source.d.ts","sourceRoot":"","sources":["../../src/shared/runtime-source.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,8BAA8B,CAAC;AAOtC,MAAM,MAAM,WAAW,GACnB,kBAAkB,GAClB,qBAAqB,GACrB,4BAA4B,GAC5B,YAAY,GACZ,oBAAoB,CAAC;AAEzB,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,EAAE,sBAAsB,CAAC;IAClC,gBAAgB,EAAE;QAChB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;QAC9B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;KACzB,CAAC;IACF,UAAU,EAAE,mBAAmB,CAAC;IAChC,IAAI,EAAE,mBAAmB,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG;IAC5C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC,CAAC;AA6HF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAQ7D;AAED,wBAAgB,wBAAwB,CACtC,OAAO,GAAE,+BAAoC,GAC5C,iBAAiB,CAoCnB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"task-doc-conflicts.d.ts","sourceRoot":"","sources":["../../src/shared/task-doc-conflicts.ts"],"names":[],"mappings":"AAYA,wBAAgB,qBAAqB,CAAC,IAAI,EAAE;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACxC,GAAG,IAAI,CAaP;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACzC,GAAG,IAAI,CAiBP"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"task-doc-state.d.ts","sourceRoot":"","sources":["../../src/shared/task-doc-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACpB,MAAM,qBAAqB,CAAC;AAE7B,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,sBAAsB,EAAE,GAAG,IAAI,CAAC;CACrD,uDAiBA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"version-compare.d.ts","sourceRoot":"","sources":["../../src/shared/version-compare.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB,CAWrE;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAanE"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export declare function createRecipeArchive(opts?: {
|
|
2
|
-
id?: string;
|
|
3
|
-
version?: string;
|
|
4
|
-
name?: string;
|
|
5
|
-
summary?: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
tags?: string[];
|
|
8
|
-
format?: "tar" | "zip";
|
|
9
|
-
wrapDir?: boolean;
|
|
10
|
-
}): Promise<{
|
|
11
|
-
archivePath: string;
|
|
12
|
-
manifest: Record<string, unknown>;
|
|
13
|
-
}>;
|
|
14
|
-
export declare function createRecipeArchiveWithManifest(opts: {
|
|
15
|
-
manifest: Record<string, unknown>;
|
|
16
|
-
files?: Record<string, string>;
|
|
17
|
-
format?: "tar" | "zip";
|
|
18
|
-
wrapDir?: boolean;
|
|
19
|
-
}): Promise<string>;
|
|
20
|
-
export declare function createUnsafeRecipeArchive(opts: {
|
|
21
|
-
format: "tar" | "zip";
|
|
22
|
-
entryPath?: string;
|
|
23
|
-
}): Promise<string>;
|
|
24
|
-
export declare function createUpgradeBundle(files: Record<string, string>): Promise<{
|
|
25
|
-
bundlePath: string;
|
|
26
|
-
checksumPath: string;
|
|
27
|
-
}>;
|
|
28
|
-
//# sourceMappingURL=recipe-archives.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"recipe-archives.d.ts","sourceRoot":"","sources":["../../../src/testing/cli-harness/recipe-archives.ts"],"names":[],"mappings":"AAgBA,wBAAsB,mBAAmB,CAAC,IAAI,CAAC,EAAE;IAC/C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,OAAO,CAAC;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAAC,CAsKtE;AAED,wBAAsB,+BAA+B,CAAC,IAAI,EAAE;IAC1D,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,OAAO,CAAC,MAAM,CAAC,CAyBlB;AAED,wBAAsB,yBAAyB,CAAC,IAAI,EAAE;IACpD,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,MAAM,CAAC,CA+GlB;AAyDD,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC;IAChF,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC,CAkDD"}
|
|
@@ -1,374 +0,0 @@
|
|
|
1
|
-
import { execFile } from "node:child_process";
|
|
2
|
-
import { createHash } from "node:crypto";
|
|
3
|
-
import { mkdir, mkdtemp, readFile, writeFile } from "node:fs/promises";
|
|
4
|
-
import os from "node:os";
|
|
5
|
-
import path from "node:path";
|
|
6
|
-
import { fileURLToPath } from "node:url";
|
|
7
|
-
import { promisify } from "node:util";
|
|
8
|
-
import { gzipSync } from "node:zlib";
|
|
9
|
-
const execFileAsync = promisify(execFile);
|
|
10
|
-
const recipeArchiveCache = new Map();
|
|
11
|
-
export async function createRecipeArchive(opts) {
|
|
12
|
-
const normalizedTags = opts?.tags ? [...opts.tags].toSorted() : undefined;
|
|
13
|
-
const cacheKey = JSON.stringify({
|
|
14
|
-
id: opts?.id ?? "viewer",
|
|
15
|
-
version: opts?.version ?? "1.2.3",
|
|
16
|
-
name: opts?.name ?? "Viewer",
|
|
17
|
-
summary: opts?.summary ?? "Preview task artifacts",
|
|
18
|
-
description: opts?.description ?? "Provides a local viewer for task artifacts.",
|
|
19
|
-
tags: normalizedTags,
|
|
20
|
-
format: opts?.format ?? "tar",
|
|
21
|
-
wrapDir: opts?.wrapDir ?? false,
|
|
22
|
-
});
|
|
23
|
-
const cached = recipeArchiveCache.get(cacheKey);
|
|
24
|
-
if (cached)
|
|
25
|
-
return cached;
|
|
26
|
-
const baseDir = await mkdtemp(path.join(os.tmpdir(), "agentplane-recipe-"));
|
|
27
|
-
const recipeDir = path.join(baseDir, opts?.wrapDir ? "bundle" : "recipe");
|
|
28
|
-
await mkdir(recipeDir, { recursive: true });
|
|
29
|
-
const manifest = {
|
|
30
|
-
schema_version: "1",
|
|
31
|
-
id: opts?.id ?? "viewer",
|
|
32
|
-
version: opts?.version ?? "1.2.3",
|
|
33
|
-
name: opts?.name ?? "Viewer",
|
|
34
|
-
summary: opts?.summary ?? "Preview task artifacts",
|
|
35
|
-
description: opts?.description ?? "Provides a local viewer for task artifacts.",
|
|
36
|
-
compatibility: {
|
|
37
|
-
min_agentplane_version: "0.3.5",
|
|
38
|
-
manifest_api_version: "1",
|
|
39
|
-
scenario_api_version: "1",
|
|
40
|
-
runtime_api_version: "1",
|
|
41
|
-
platforms: ["darwin", "linux"],
|
|
42
|
-
repo_types: ["generic"],
|
|
43
|
-
},
|
|
44
|
-
skills: [
|
|
45
|
-
{
|
|
46
|
-
id: "RECIPE_SKILL",
|
|
47
|
-
summary: "Recipe analysis skill",
|
|
48
|
-
file: "skills/analysis.md",
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
agents: [
|
|
52
|
-
{
|
|
53
|
-
id: "RECIPE_AGENT",
|
|
54
|
-
display_name: "Recipe Agent",
|
|
55
|
-
role: "executor",
|
|
56
|
-
summary: "Recipe agent",
|
|
57
|
-
skills: ["RECIPE_SKILL"],
|
|
58
|
-
tools: ["RECIPE_TOOL"],
|
|
59
|
-
file: "agents/recipe.md",
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
tools: [
|
|
63
|
-
{ id: "RECIPE_TOOL", summary: "Recipe tool", runtime: "node", entrypoint: "tools/run.js" },
|
|
64
|
-
],
|
|
65
|
-
scenarios: [
|
|
66
|
-
{
|
|
67
|
-
id: "RECIPE_SCENARIO",
|
|
68
|
-
name: "Recipe Scenario",
|
|
69
|
-
summary: "Recipe scenario",
|
|
70
|
-
use_when: ["Task artifacts need local preview"],
|
|
71
|
-
required_inputs: ["task_id"],
|
|
72
|
-
outputs: ["report"],
|
|
73
|
-
permissions: ["filesystem-write"],
|
|
74
|
-
artifacts: ["artifact.txt"],
|
|
75
|
-
agents_involved: ["RECIPE_AGENT"],
|
|
76
|
-
skills_used: ["RECIPE_SKILL"],
|
|
77
|
-
tools_used: ["RECIPE_TOOL"],
|
|
78
|
-
run_profile: {
|
|
79
|
-
mode: "analysis",
|
|
80
|
-
sandbox: "workspace-write",
|
|
81
|
-
writes_artifacts_to: ["logs/", "reports/"],
|
|
82
|
-
},
|
|
83
|
-
file: "scenarios/recipe-scenario.json",
|
|
84
|
-
},
|
|
85
|
-
],
|
|
86
|
-
};
|
|
87
|
-
if (normalizedTags) {
|
|
88
|
-
manifest.tags = normalizedTags;
|
|
89
|
-
}
|
|
90
|
-
await writeFile(path.join(recipeDir, "manifest.json"), JSON.stringify(manifest, null, 2), "utf8");
|
|
91
|
-
const agentsDir = path.join(recipeDir, "agents");
|
|
92
|
-
await mkdir(agentsDir, { recursive: true });
|
|
93
|
-
await writeFile(path.join(agentsDir, "recipe.md"), [
|
|
94
|
-
"# Recipe Agent",
|
|
95
|
-
"",
|
|
96
|
-
"Role: executor",
|
|
97
|
-
"",
|
|
98
|
-
"Instructions:",
|
|
99
|
-
"- Use recipe local policy.",
|
|
100
|
-
"- Materialize the declared scenario artifacts.",
|
|
101
|
-
].join("\n"), "utf8");
|
|
102
|
-
const skillsDir = path.join(recipeDir, "skills");
|
|
103
|
-
await mkdir(skillsDir, { recursive: true });
|
|
104
|
-
await writeFile(path.join(skillsDir, "analysis.md"), [
|
|
105
|
-
"# Recipe Skill",
|
|
106
|
-
"",
|
|
107
|
-
"- Inspect the generated bundle before acting.",
|
|
108
|
-
"- Keep recipe-owned artifacts inside the declared output paths.",
|
|
109
|
-
].join("\n"), "utf8");
|
|
110
|
-
const toolsDir = path.join(recipeDir, "tools");
|
|
111
|
-
await mkdir(toolsDir, { recursive: true });
|
|
112
|
-
await writeFile(path.join(toolsDir, "run.js"), [
|
|
113
|
-
'const fs = require("node:fs");',
|
|
114
|
-
'fs.writeFileSync(process.env.AGENTPLANE_RUN_DIR + "/artifact.txt", "ok");',
|
|
115
|
-
].join("\n"), "utf8");
|
|
116
|
-
const scenariosDir = path.join(recipeDir, "scenarios");
|
|
117
|
-
await mkdir(scenariosDir, { recursive: true });
|
|
118
|
-
await writeFile(path.join(scenariosDir, "recipe-scenario.json"), JSON.stringify({
|
|
119
|
-
schema_version: "1",
|
|
120
|
-
id: "RECIPE_SCENARIO",
|
|
121
|
-
summary: "Recipe scenario",
|
|
122
|
-
goal: "Preview installed tasks.",
|
|
123
|
-
task_template: {
|
|
124
|
-
title: "Recipe scenario task",
|
|
125
|
-
description: "Materialize a task from the recipe scenario.",
|
|
126
|
-
owner: "CODER",
|
|
127
|
-
priority: "med",
|
|
128
|
-
tags: ["code", "recipes"],
|
|
129
|
-
verify: ["bunx vitest run packages/agentplane/src/commands/recipes.scenario.test.ts"],
|
|
130
|
-
doc: {
|
|
131
|
-
summary: "Recipe-backed task execution.",
|
|
132
|
-
scope: "Run the scenario without task materialization heuristics.",
|
|
133
|
-
plan: "1. Materialize the task. 2. Execute the shared runner.",
|
|
134
|
-
verify_steps: "1. Run scenario execution tests.",
|
|
135
|
-
rollback_plan: "Revert the generated task and runner artifacts.",
|
|
136
|
-
},
|
|
137
|
-
},
|
|
138
|
-
inputs: [{ name: "task_id", type: "string" }],
|
|
139
|
-
outputs: [{ name: "report", type: "html" }],
|
|
140
|
-
steps: [{ tool: "RECIPE_TOOL" }],
|
|
141
|
-
}, null, 2), "utf8");
|
|
142
|
-
const format = opts?.format ?? "tar";
|
|
143
|
-
const archivePath = format === "zip" ? path.join(baseDir, "recipe.zip") : path.join(baseDir, "recipe.tar.gz");
|
|
144
|
-
if (format === "zip") {
|
|
145
|
-
await (opts?.wrapDir
|
|
146
|
-
? execFileAsync("zip", ["-qr", archivePath, path.basename(recipeDir)], { cwd: baseDir })
|
|
147
|
-
: execFileAsync("zip", ["-qr", archivePath, "."], { cwd: recipeDir }));
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
await (opts?.wrapDir
|
|
151
|
-
? execFileAsync("tar", ["-czf", archivePath, "-C", baseDir, path.basename(recipeDir)])
|
|
152
|
-
: execFileAsync("tar", ["-czf", archivePath, "-C", recipeDir, "."]));
|
|
153
|
-
}
|
|
154
|
-
const payload = { archivePath, manifest };
|
|
155
|
-
recipeArchiveCache.set(cacheKey, payload);
|
|
156
|
-
return payload;
|
|
157
|
-
}
|
|
158
|
-
export async function createRecipeArchiveWithManifest(opts) {
|
|
159
|
-
const baseDir = await mkdtemp(path.join(os.tmpdir(), "agentplane-recipe-bad-"));
|
|
160
|
-
const recipeDir = path.join(baseDir, opts.wrapDir ? "bundle" : "recipe");
|
|
161
|
-
await mkdir(recipeDir, { recursive: true });
|
|
162
|
-
await writeFile(path.join(recipeDir, "manifest.json"), JSON.stringify(opts.manifest, null, 2));
|
|
163
|
-
if (opts.files) {
|
|
164
|
-
for (const [relPath, content] of Object.entries(opts.files)) {
|
|
165
|
-
const fullPath = path.join(recipeDir, relPath);
|
|
166
|
-
await mkdir(path.dirname(fullPath), { recursive: true });
|
|
167
|
-
await writeFile(fullPath, content, "utf8");
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
const format = opts.format ?? "tar";
|
|
171
|
-
const archivePath = format === "zip" ? path.join(baseDir, "recipe.zip") : path.join(baseDir, "recipe.tar.gz");
|
|
172
|
-
if (format === "zip") {
|
|
173
|
-
await (opts.wrapDir
|
|
174
|
-
? execFileAsync("zip", ["-qr", archivePath, path.basename(recipeDir)], { cwd: baseDir })
|
|
175
|
-
: execFileAsync("zip", ["-qr", archivePath, "."], { cwd: recipeDir }));
|
|
176
|
-
}
|
|
177
|
-
else {
|
|
178
|
-
await (opts.wrapDir
|
|
179
|
-
? execFileAsync("tar", ["-czf", archivePath, "-C", baseDir, path.basename(recipeDir)])
|
|
180
|
-
: execFileAsync("tar", ["-czf", archivePath, "-C", recipeDir, "."]));
|
|
181
|
-
}
|
|
182
|
-
return archivePath;
|
|
183
|
-
}
|
|
184
|
-
export async function createUnsafeRecipeArchive(opts) {
|
|
185
|
-
const baseDir = await mkdtemp(path.join(os.tmpdir(), "agentplane-recipe-unsafe-"));
|
|
186
|
-
const recipeDir = path.join(baseDir, "recipe");
|
|
187
|
-
await mkdir(recipeDir, { recursive: true });
|
|
188
|
-
const manifest = {
|
|
189
|
-
schema_version: "1",
|
|
190
|
-
id: "unsafe",
|
|
191
|
-
version: "0.0.1",
|
|
192
|
-
name: "Unsafe",
|
|
193
|
-
summary: "Unsafe recipe",
|
|
194
|
-
description: "Used for archive validation tests.",
|
|
195
|
-
skills: [
|
|
196
|
-
{
|
|
197
|
-
id: "RECIPE_SKILL",
|
|
198
|
-
summary: "Recipe skill",
|
|
199
|
-
file: "skills/recipe.md",
|
|
200
|
-
},
|
|
201
|
-
],
|
|
202
|
-
agents: [
|
|
203
|
-
{
|
|
204
|
-
id: "RECIPE_AGENT",
|
|
205
|
-
display_name: "Recipe Agent",
|
|
206
|
-
role: "executor",
|
|
207
|
-
summary: "Recipe agent",
|
|
208
|
-
skills: ["RECIPE_SKILL"],
|
|
209
|
-
tools: ["RECIPE_TOOL"],
|
|
210
|
-
file: "agents/recipe.md",
|
|
211
|
-
},
|
|
212
|
-
],
|
|
213
|
-
tools: [
|
|
214
|
-
{ id: "RECIPE_TOOL", summary: "Recipe tool", runtime: "bash", entrypoint: "tools/run.sh" },
|
|
215
|
-
],
|
|
216
|
-
scenarios: [
|
|
217
|
-
{
|
|
218
|
-
id: "RECIPE_SCENARIO",
|
|
219
|
-
name: "Recipe Scenario",
|
|
220
|
-
summary: "Recipe scenario",
|
|
221
|
-
use_when: ["Unsafe validation fixture"],
|
|
222
|
-
required_inputs: [],
|
|
223
|
-
outputs: [],
|
|
224
|
-
permissions: [],
|
|
225
|
-
artifacts: [],
|
|
226
|
-
agents_involved: ["RECIPE_AGENT"],
|
|
227
|
-
skills_used: ["RECIPE_SKILL"],
|
|
228
|
-
tools_used: ["RECIPE_TOOL"],
|
|
229
|
-
run_profile: { mode: "analysis" },
|
|
230
|
-
file: "scenarios/recipe-scenario.json",
|
|
231
|
-
},
|
|
232
|
-
],
|
|
233
|
-
};
|
|
234
|
-
await writeFile(path.join(recipeDir, "manifest.json"), JSON.stringify(manifest, null, 2), "utf8");
|
|
235
|
-
const agentsDir = path.join(recipeDir, "agents");
|
|
236
|
-
await mkdir(agentsDir, { recursive: true });
|
|
237
|
-
await writeFile(path.join(agentsDir, "recipe.md"), "# Recipe Agent\n\nFollow the unsafe archive validation path.\n", "utf8");
|
|
238
|
-
const skillsDir = path.join(recipeDir, "skills");
|
|
239
|
-
await mkdir(skillsDir, { recursive: true });
|
|
240
|
-
await writeFile(path.join(skillsDir, "recipe.md"), "# Recipe Skill\n\nInspect archive contents before materialization.\n", "utf8");
|
|
241
|
-
const toolsDir = path.join(recipeDir, "tools");
|
|
242
|
-
await mkdir(toolsDir, { recursive: true });
|
|
243
|
-
await writeFile(path.join(toolsDir, "run.sh"), "#!/usr/bin/env bash\n", "utf8");
|
|
244
|
-
const scenariosDir = path.join(recipeDir, "scenarios");
|
|
245
|
-
await mkdir(scenariosDir, { recursive: true });
|
|
246
|
-
await writeFile(path.join(scenariosDir, "recipe-scenario.json"), JSON.stringify({
|
|
247
|
-
schema_version: "1",
|
|
248
|
-
id: "RECIPE_SCENARIO",
|
|
249
|
-
summary: "Recipe scenario",
|
|
250
|
-
goal: "Exercise unsafe archive validation.",
|
|
251
|
-
task_template: {
|
|
252
|
-
title: "Unsafe archive task",
|
|
253
|
-
description: "Validate unsafe archive handling.",
|
|
254
|
-
owner: "CODER",
|
|
255
|
-
},
|
|
256
|
-
inputs: [],
|
|
257
|
-
outputs: [],
|
|
258
|
-
steps: [{ tool: "RECIPE_TOOL" }],
|
|
259
|
-
}, null, 2), "utf8");
|
|
260
|
-
const entryPath = opts.entryPath ?? "../evil.txt";
|
|
261
|
-
await writeFile(path.join(baseDir, "evil.txt"), "evil", "utf8");
|
|
262
|
-
const archivePath = opts.format === "zip" ? path.join(baseDir, "unsafe.zip") : path.join(baseDir, "unsafe.tar.gz");
|
|
263
|
-
if (opts.format === "zip") {
|
|
264
|
-
await execFileAsync("zip", ["-qr", archivePath, ".", entryPath], { cwd: recipeDir });
|
|
265
|
-
return archivePath;
|
|
266
|
-
}
|
|
267
|
-
const tar = buildTar([
|
|
268
|
-
{
|
|
269
|
-
name: "./manifest.json",
|
|
270
|
-
data: Buffer.from(JSON.stringify(manifest, null, 2) + "\n", "utf8"),
|
|
271
|
-
},
|
|
272
|
-
{ name: entryPath, data: Buffer.from("evil\n", "utf8") },
|
|
273
|
-
]);
|
|
274
|
-
const gz = gzipSync(tar);
|
|
275
|
-
await writeFile(archivePath, gz);
|
|
276
|
-
return archivePath;
|
|
277
|
-
}
|
|
278
|
-
function buildTar(entries) {
|
|
279
|
-
const out = [];
|
|
280
|
-
for (const ent of entries) {
|
|
281
|
-
const header = tarHeader({
|
|
282
|
-
name: ent.name,
|
|
283
|
-
size: ent.data.length,
|
|
284
|
-
mtime: 0,
|
|
285
|
-
typeflag: "0",
|
|
286
|
-
});
|
|
287
|
-
out.push(header, ent.data, zeroPadTo512(ent.data.length));
|
|
288
|
-
}
|
|
289
|
-
out.push(Buffer.alloc(1024, 0));
|
|
290
|
-
return Buffer.concat(out);
|
|
291
|
-
}
|
|
292
|
-
function zeroPadTo512(n) {
|
|
293
|
-
const rem = n % 512;
|
|
294
|
-
if (rem === 0)
|
|
295
|
-
return Buffer.alloc(0);
|
|
296
|
-
return Buffer.alloc(512 - rem, 0);
|
|
297
|
-
}
|
|
298
|
-
function tarHeader(opts) {
|
|
299
|
-
const buf = Buffer.alloc(512, 0);
|
|
300
|
-
writeTarString(buf, 0, 100, opts.name);
|
|
301
|
-
writeTarOctal(buf, 100, 8, 0o644);
|
|
302
|
-
writeTarOctal(buf, 108, 8, 0);
|
|
303
|
-
writeTarOctal(buf, 116, 8, 0);
|
|
304
|
-
writeTarOctal(buf, 124, 12, opts.size);
|
|
305
|
-
writeTarOctal(buf, 136, 12, opts.mtime);
|
|
306
|
-
buf.fill(0x20, 148, 156);
|
|
307
|
-
writeTarString(buf, 156, 1, opts.typeflag);
|
|
308
|
-
writeTarString(buf, 257, 6, "ustar");
|
|
309
|
-
writeTarString(buf, 263, 2, "00");
|
|
310
|
-
const sum = buf.reduce((acc, b) => acc + b, 0);
|
|
311
|
-
writeTarChecksum(buf, sum);
|
|
312
|
-
return buf;
|
|
313
|
-
}
|
|
314
|
-
function writeTarString(buf, offset, length, value) {
|
|
315
|
-
const b = Buffer.from(value, "utf8");
|
|
316
|
-
b.copy(buf, offset, 0, Math.min(length, b.length));
|
|
317
|
-
}
|
|
318
|
-
function writeTarOctal(buf, offset, length, value) {
|
|
319
|
-
const raw = Math.max(0, value).toString(8);
|
|
320
|
-
const padded = raw.padStart(length - 1, "0") + "\0";
|
|
321
|
-
writeTarString(buf, offset, length, padded);
|
|
322
|
-
}
|
|
323
|
-
function writeTarChecksum(buf, sum) {
|
|
324
|
-
const raw = Math.max(0, sum).toString(8).padStart(6, "0");
|
|
325
|
-
writeTarString(buf, 148, 8, `${raw}\0 `);
|
|
326
|
-
}
|
|
327
|
-
export async function createUpgradeBundle(files) {
|
|
328
|
-
const manifestUrl = new URL("../../../assets/framework.manifest.json", import.meta.url);
|
|
329
|
-
const manifestText = typeof files["framework.manifest.json"] === "string"
|
|
330
|
-
? files["framework.manifest.json"]
|
|
331
|
-
: await readFile(fileURLToPath(manifestUrl), "utf8");
|
|
332
|
-
const manifest = JSON.parse(manifestText);
|
|
333
|
-
const normalizedFiles = {};
|
|
334
|
-
for (const [relPath, content] of Object.entries(files)) {
|
|
335
|
-
const mapped = relPath.startsWith(".agentplane/agents/")
|
|
336
|
-
? relPath.replace(/^\.agentplane\/agents\//, "agents/")
|
|
337
|
-
: relPath;
|
|
338
|
-
normalizedFiles[mapped] = content;
|
|
339
|
-
}
|
|
340
|
-
normalizedFiles["framework.manifest.json"] ??= manifestText;
|
|
341
|
-
if (manifest.schema_version === 1 && Array.isArray(manifest.files)) {
|
|
342
|
-
for (const entry of manifest.files) {
|
|
343
|
-
if (!entry?.required)
|
|
344
|
-
continue;
|
|
345
|
-
const sourceRel = (entry.source_path ?? entry.path ?? "").trim();
|
|
346
|
-
if (!sourceRel)
|
|
347
|
-
continue;
|
|
348
|
-
if (normalizedFiles[sourceRel] !== undefined)
|
|
349
|
-
continue;
|
|
350
|
-
if (entry.type === "json")
|
|
351
|
-
normalizedFiles[sourceRel] = "{}\n";
|
|
352
|
-
else if (sourceRel.endsWith(".md"))
|
|
353
|
-
normalizedFiles[sourceRel] = "# AGENTS\n";
|
|
354
|
-
else
|
|
355
|
-
normalizedFiles[sourceRel] = "\n";
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
const baseDir = await mkdtemp(path.join(os.tmpdir(), "agentplane-upgrade-bundle-"));
|
|
359
|
-
const bundleDir = path.join(baseDir, "bundle");
|
|
360
|
-
await mkdir(bundleDir, { recursive: true });
|
|
361
|
-
for (const [relPath, content] of Object.entries(normalizedFiles)) {
|
|
362
|
-
const fullPath = path.join(bundleDir, relPath);
|
|
363
|
-
await mkdir(path.dirname(fullPath), { recursive: true });
|
|
364
|
-
await writeFile(fullPath, content, "utf8");
|
|
365
|
-
}
|
|
366
|
-
const bundlePath = path.join(baseDir, "agentplane-upgrade.tar.gz");
|
|
367
|
-
await execFileAsync("tar", ["-czf", bundlePath, "-C", bundleDir, "."]);
|
|
368
|
-
const checksum = createHash("sha256")
|
|
369
|
-
.update(await readFile(bundlePath))
|
|
370
|
-
.digest("hex");
|
|
371
|
-
const checksumPath = `${bundlePath}.sha256`;
|
|
372
|
-
await writeFile(checksumPath, `${checksum} agentplane-upgrade.tar.gz\n`, "utf8");
|
|
373
|
-
return { bundlePath, checksumPath };
|
|
374
|
-
}
|