agentplane 0.1.8 → 0.2.0
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/README.md +4 -4
- package/assets/AGENTS.md +294 -72
- package/assets/agents/CODER.json +1 -0
- package/assets/agents/INTEGRATOR.json +1 -0
- package/assets/agents/ORCHESTRATOR.json +1 -0
- package/assets/agents/PLANNER.json +1 -0
- package/assets/agents/TESTER.json +1 -0
- package/dist/backends/task-backend/load.d.ts +13 -0
- package/dist/backends/task-backend/load.d.ts.map +1 -0
- package/dist/backends/task-backend/load.js +58 -0
- package/dist/backends/task-backend/local-backend.d.ts +28 -0
- package/dist/backends/task-backend/local-backend.d.ts.map +1 -0
- package/dist/backends/task-backend/local-backend.js +335 -0
- package/dist/backends/task-backend/redmine/client.d.ts +8 -0
- package/dist/backends/task-backend/redmine/client.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/client.js +60 -0
- package/dist/backends/task-backend/redmine/comments.d.ts +12 -0
- package/dist/backends/task-backend/redmine/comments.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/comments.js +54 -0
- package/dist/backends/task-backend/redmine/fields.d.ts +9 -0
- package/dist/backends/task-backend/redmine/fields.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/fields.js +38 -0
- package/dist/backends/task-backend/redmine/mapping.d.ts +20 -0
- package/dist/backends/task-backend/redmine/mapping.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/mapping.js +114 -0
- package/dist/backends/task-backend/redmine/parse.d.ts +3 -0
- package/dist/backends/task-backend/redmine/parse.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/parse.js +27 -0
- package/dist/backends/task-backend/redmine/remote.d.ts +19 -0
- package/dist/backends/task-backend/redmine/remote.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine/remote.js +82 -0
- package/dist/backends/task-backend/redmine-backend.d.ts +80 -0
- package/dist/backends/task-backend/redmine-backend.d.ts.map +1 -0
- package/dist/backends/task-backend/redmine-backend.js +505 -0
- package/dist/backends/task-backend/shared/concurrency.d.ts +3 -0
- package/dist/backends/task-backend/shared/concurrency.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/concurrency.js +21 -0
- package/dist/backends/task-backend/shared/constants.d.ts +4 -0
- package/dist/backends/task-backend/shared/constants.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/constants.js +4 -0
- package/dist/backends/task-backend/shared/doc.d.ts +11 -0
- package/dist/backends/task-backend/shared/doc.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/doc.js +78 -0
- package/dist/backends/task-backend/shared/errors.d.ts +10 -0
- package/dist/backends/task-backend/shared/errors.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/errors.js +18 -0
- package/dist/backends/task-backend/shared/events.d.ts +3 -0
- package/dist/backends/task-backend/shared/events.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/events.js +29 -0
- package/dist/backends/task-backend/shared/export.d.ts +15 -0
- package/dist/backends/task-backend/shared/export.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/export.js +60 -0
- package/dist/backends/task-backend/shared/id.d.ts +13 -0
- package/dist/backends/task-backend/shared/id.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/id.js +17 -0
- package/dist/backends/task-backend/shared/normalize.d.ts +8 -0
- package/dist/backends/task-backend/shared/normalize.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/normalize.js +54 -0
- package/dist/backends/task-backend/shared/record.d.ts +4 -0
- package/dist/backends/task-backend/shared/record.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/record.js +53 -0
- package/dist/backends/task-backend/shared/strings.d.ts +4 -0
- package/dist/backends/task-backend/shared/strings.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/strings.js +21 -0
- package/dist/backends/task-backend/shared/types.d.ts +84 -0
- package/dist/backends/task-backend/shared/types.d.ts.map +1 -0
- package/dist/backends/task-backend/shared/types.js +1 -0
- package/dist/backends/task-backend/shared.d.ts +11 -0
- package/dist/backends/task-backend/shared.d.ts.map +1 -0
- package/dist/backends/task-backend/shared.js +9 -0
- package/dist/backends/task-backend.d.ts +4 -192
- package/dist/backends/task-backend.d.ts.map +1 -1
- package/dist/backends/task-backend.js +4 -1329
- package/dist/backends/task-index.js +2 -2
- package/dist/cli/archive.d.ts +0 -2
- package/dist/cli/archive.d.ts.map +1 -1
- package/dist/cli/archive.js +1 -2
- package/dist/cli/command-guide.d.ts.map +1 -1
- package/dist/cli/command-guide.js +28 -12
- package/dist/cli/parse/lifecycle.d.ts +64 -0
- package/dist/cli/parse/lifecycle.d.ts.map +1 -0
- package/dist/cli/parse/lifecycle.js +280 -0
- package/dist/cli/run-cli/command-catalog.d.ts +16 -0
- package/dist/cli/run-cli/command-catalog.d.ts.map +1 -0
- package/dist/cli/run-cli/command-catalog.js +204 -0
- package/dist/cli/run-cli/commands/config.d.ts +20 -0
- package/dist/cli/run-cli/commands/config.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/config.js +130 -0
- package/dist/cli/run-cli/commands/core.d.ts +14 -0
- package/dist/cli/run-cli/commands/core.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/core.js +144 -0
- package/dist/cli/run-cli/commands/ide.d.ts +13 -0
- package/dist/cli/run-cli/commands/ide.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/ide.js +67 -0
- package/dist/cli/run-cli/commands/init/base-branch.d.ts +9 -0
- package/dist/cli/run-cli/commands/init/base-branch.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/base-branch.js +11 -0
- package/dist/cli/run-cli/commands/init/conflicts.d.ts +11 -0
- package/dist/cli/run-cli/commands/init/conflicts.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/conflicts.js +42 -0
- package/dist/cli/run-cli/commands/init/git.d.ts +8 -0
- package/dist/cli/run-cli/commands/init/git.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/git.js +12 -0
- package/dist/cli/run-cli/commands/init/ide-sync.d.ts +9 -0
- package/dist/cli/run-cli/commands/init/ide-sync.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/ide-sync.js +18 -0
- package/dist/cli/run-cli/commands/init/recipes.d.ts +2 -0
- package/dist/cli/run-cli/commands/init/recipes.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/recipes.js +11 -0
- package/dist/cli/run-cli/commands/init/write-agents.d.ts +11 -0
- package/dist/cli/run-cli/commands/init/write-agents.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/write-agents.js +30 -0
- package/dist/cli/run-cli/commands/init/write-config.d.ts +15 -0
- package/dist/cli/run-cli/commands/init/write-config.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init/write-config.js +45 -0
- package/dist/cli/run-cli/commands/init.d.ts +21 -0
- package/dist/cli/run-cli/commands/init.d.ts.map +1 -0
- package/dist/cli/run-cli/commands/init.js +332 -0
- package/dist/cli/run-cli/registry.run.d.ts +4 -0
- package/dist/cli/run-cli/registry.run.d.ts.map +1 -0
- package/dist/cli/run-cli/registry.run.js +19 -0
- package/dist/cli/run-cli.d.ts.map +1 -1
- package/dist/cli/run-cli.js +182 -2408
- package/dist/cli/spec/docs-render.d.ts +3 -0
- package/dist/cli/spec/docs-render.d.ts.map +1 -0
- package/dist/cli/spec/docs-render.js +118 -0
- package/dist/cli/spec/errors.d.ts +9 -0
- package/dist/cli/spec/errors.d.ts.map +1 -0
- package/dist/cli/spec/errors.js +18 -0
- package/dist/cli/spec/help-render.d.ts +43 -0
- package/dist/cli/spec/help-render.d.ts.map +1 -0
- package/dist/cli/spec/help-render.js +185 -0
- package/dist/cli/spec/help.d.ts +10 -0
- package/dist/cli/spec/help.d.ts.map +1 -0
- package/dist/cli/spec/help.js +64 -0
- package/dist/cli/spec/parse.d.ts +8 -0
- package/dist/cli/spec/parse.d.ts.map +1 -0
- package/dist/cli/spec/parse.js +188 -0
- package/dist/cli/spec/registry.d.ts +12 -0
- package/dist/cli/spec/registry.d.ts.map +1 -0
- package/dist/cli/spec/registry.js +47 -0
- package/dist/cli/spec/spec.d.ts +76 -0
- package/dist/cli/spec/spec.d.ts.map +1 -0
- package/dist/cli/spec/spec.js +1 -0
- package/dist/cli/spec/suggest.d.ts +2 -0
- package/dist/cli/spec/suggest.d.ts.map +1 -0
- package/dist/cli/spec/suggest.js +45 -0
- package/dist/commands/backend/sync.command.d.ts +12 -0
- package/dist/commands/backend/sync.command.d.ts.map +1 -0
- package/dist/commands/backend/sync.command.js +79 -0
- package/dist/commands/backend.d.ts +21 -8
- package/dist/commands/backend.d.ts.map +1 -1
- package/dist/commands/backend.js +28 -165
- package/dist/commands/block.command.d.ts +19 -0
- package/dist/commands/block.command.d.ts.map +1 -0
- package/dist/commands/block.command.js +143 -0
- package/dist/commands/branch/base.command.d.ts +20 -0
- package/dist/commands/branch/base.command.d.ts.map +1 -0
- package/dist/commands/branch/base.command.js +110 -0
- package/dist/commands/branch/base.d.ts +19 -0
- package/dist/commands/branch/base.d.ts.map +1 -0
- package/dist/commands/branch/base.js +114 -0
- package/dist/commands/branch/cleanup-merged.d.ts +11 -0
- package/dist/commands/branch/cleanup-merged.d.ts.map +1 -0
- package/dist/commands/branch/cleanup-merged.js +141 -0
- package/dist/commands/branch/index.d.ts +6 -59
- package/dist/commands/branch/index.d.ts.map +1 -1
- package/dist/commands/branch/index.js +6 -513
- package/dist/commands/branch/internal/archive-pr.d.ts +2 -0
- package/dist/commands/branch/internal/archive-pr.d.ts.map +1 -0
- package/dist/commands/branch/internal/archive-pr.js +17 -0
- package/dist/commands/branch/internal/work-validate.d.ts +3 -0
- package/dist/commands/branch/internal/work-validate.d.ts.map +1 -0
- package/dist/commands/branch/internal/work-validate.js +27 -0
- package/dist/commands/branch/remove.command.d.ts +10 -0
- package/dist/commands/branch/remove.command.d.ts.map +1 -0
- package/dist/commands/branch/remove.command.js +63 -0
- package/dist/commands/branch/remove.d.ts +9 -0
- package/dist/commands/branch/remove.d.ts.map +1 -0
- package/dist/commands/branch/remove.js +65 -0
- package/dist/commands/branch/status.command.d.ts +8 -0
- package/dist/commands/branch/status.command.d.ts.map +1 -0
- package/dist/commands/branch/status.command.js +36 -0
- package/dist/commands/branch/status.d.ts +7 -0
- package/dist/commands/branch/status.d.ts.map +1 -0
- package/dist/commands/branch/status.js +60 -0
- package/dist/commands/branch/work-start.command.d.ts +11 -0
- package/dist/commands/branch/work-start.command.d.ts.map +1 -0
- package/dist/commands/branch/work-start.command.js +80 -0
- package/dist/commands/branch/work-start.d.ts +11 -0
- package/dist/commands/branch/work-start.d.ts.map +1 -0
- package/dist/commands/branch/work-start.js +120 -0
- package/dist/commands/cleanup/merged.command.d.ts +17 -0
- package/dist/commands/cleanup/merged.command.d.ts.map +1 -0
- package/dist/commands/cleanup/merged.command.js +75 -0
- package/dist/commands/commit.command.d.ts +6 -0
- package/dist/commands/commit.command.d.ts.map +1 -0
- package/dist/commands/commit.command.js +24 -0
- package/dist/commands/commit.spec.d.ts +18 -0
- package/dist/commands/commit.spec.d.ts.map +1 -0
- package/dist/commands/commit.spec.js +119 -0
- package/dist/commands/docs/cli.command.d.ts +9 -0
- package/dist/commands/docs/cli.command.d.ts.map +1 -0
- package/dist/commands/docs/cli.command.js +51 -0
- package/dist/commands/finish.command.d.ts +28 -0
- package/dist/commands/finish.command.d.ts.map +1 -0
- package/dist/commands/finish.command.js +237 -0
- package/dist/commands/guard/clean.command.d.ts +7 -0
- package/dist/commands/guard/clean.command.d.ts.map +1 -0
- package/dist/commands/guard/clean.command.js +14 -0
- package/dist/commands/guard/commit.command.d.ts +19 -0
- package/dist/commands/guard/commit.command.d.ts.map +1 -0
- package/dist/commands/guard/commit.command.js +132 -0
- package/dist/commands/guard/guard.command.d.ts +5 -0
- package/dist/commands/guard/guard.command.d.ts.map +1 -0
- package/dist/commands/guard/guard.command.js +21 -0
- package/dist/commands/guard/impl/allow.d.ts +18 -0
- package/dist/commands/guard/impl/allow.d.ts.map +1 -0
- package/dist/commands/guard/impl/allow.js +77 -0
- package/dist/commands/guard/impl/close-message.d.ts +16 -0
- package/dist/commands/guard/impl/close-message.d.ts.map +1 -0
- package/dist/commands/guard/impl/close-message.js +156 -0
- package/dist/commands/guard/impl/commands.d.ts +32 -0
- package/dist/commands/guard/impl/commands.d.ts.map +1 -0
- package/dist/commands/guard/impl/commands.js +191 -0
- package/dist/commands/guard/impl/comment-commit.d.ts +25 -0
- package/dist/commands/guard/impl/comment-commit.d.ts.map +1 -0
- package/dist/commands/guard/impl/comment-commit.js +137 -0
- package/dist/commands/guard/impl/env.d.ts +10 -0
- package/dist/commands/guard/impl/env.d.ts.map +1 -0
- package/dist/commands/guard/impl/env.js +12 -0
- package/dist/commands/guard/impl/policy.d.ts +19 -0
- package/dist/commands/guard/impl/policy.d.ts.map +1 -0
- package/dist/commands/guard/impl/policy.js +46 -0
- package/dist/commands/guard/index.d.ts +4 -66
- package/dist/commands/guard/index.d.ts.map +1 -1
- package/dist/commands/guard/index.js +4 -367
- package/dist/commands/guard/suggest-allow.command.d.ts +7 -0
- package/dist/commands/guard/suggest-allow.command.d.ts.map +1 -0
- package/dist/commands/guard/suggest-allow.command.js +28 -0
- package/dist/commands/hooks/hooks.command.d.ts +5 -0
- package/dist/commands/hooks/hooks.command.d.ts.map +1 -0
- package/dist/commands/hooks/hooks.command.js +18 -0
- package/dist/commands/hooks/index.d.ts.map +1 -1
- package/dist/commands/hooks/index.js +42 -77
- package/dist/commands/hooks/install.command.d.ts +7 -0
- package/dist/commands/hooks/install.command.d.ts.map +1 -0
- package/dist/commands/hooks/install.command.js +14 -0
- package/dist/commands/hooks/run.command.d.ts +9 -0
- package/dist/commands/hooks/run.command.d.ts.map +1 -0
- package/dist/commands/hooks/run.command.js +39 -0
- package/dist/commands/hooks/uninstall.command.d.ts +7 -0
- package/dist/commands/hooks/uninstall.command.d.ts.map +1 -0
- package/dist/commands/hooks/uninstall.command.js +16 -0
- package/dist/commands/integrate.command.d.ts +14 -0
- package/dist/commands/integrate.command.d.ts.map +1 -0
- package/dist/commands/integrate.command.js +61 -0
- package/dist/commands/pr/check.d.ts +8 -0
- package/dist/commands/pr/check.d.ts.map +1 -0
- package/dist/commands/pr/check.js +78 -0
- package/dist/commands/pr/index.d.ts +5 -45
- package/dist/commands/pr/index.d.ts.map +1 -1
- package/dist/commands/pr/index.js +5 -857
- package/dist/commands/pr/integrate/artifacts.d.ts +14 -0
- package/dist/commands/pr/integrate/artifacts.d.ts.map +1 -0
- package/dist/commands/pr/integrate/artifacts.js +45 -0
- package/dist/commands/pr/integrate/cmd.d.ts +14 -0
- package/dist/commands/pr/integrate/cmd.d.ts.map +1 -0
- package/dist/commands/pr/integrate/cmd.js +150 -0
- package/dist/commands/pr/integrate/internal/finalize.d.ts +25 -0
- package/dist/commands/pr/integrate/internal/finalize.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/finalize.js +86 -0
- package/dist/commands/pr/integrate/internal/merge.d.ts +40 -0
- package/dist/commands/pr/integrate/internal/merge.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/merge.js +138 -0
- package/dist/commands/pr/integrate/internal/prepare.d.ts +33 -0
- package/dist/commands/pr/integrate/internal/prepare.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/prepare.js +142 -0
- package/dist/commands/pr/integrate/internal/worktree.d.ts +14 -0
- package/dist/commands/pr/integrate/internal/worktree.d.ts.map +1 -0
- package/dist/commands/pr/integrate/internal/worktree.js +51 -0
- package/dist/commands/pr/integrate/verify.d.ts +22 -0
- package/dist/commands/pr/integrate/verify.d.ts.map +1 -0
- package/dist/commands/pr/integrate/verify.js +60 -0
- package/dist/commands/pr/integrate.d.ts +2 -0
- package/dist/commands/pr/integrate.d.ts.map +1 -0
- package/dist/commands/pr/integrate.js +1 -0
- package/dist/commands/pr/internal/pr-paths.d.ts +29 -0
- package/dist/commands/pr/internal/pr-paths.d.ts.map +1 -0
- package/dist/commands/pr/internal/pr-paths.js +38 -0
- package/dist/commands/pr/internal/review-template.d.ts +9 -0
- package/dist/commands/pr/internal/review-template.d.ts.map +1 -0
- package/dist/commands/pr/internal/review-template.js +62 -0
- package/dist/commands/pr/note.d.ts +10 -0
- package/dist/commands/pr/note.d.ts.map +1 -0
- package/dist/commands/pr/note.js +50 -0
- package/dist/commands/pr/open.d.ts +10 -0
- package/dist/commands/pr/open.d.ts.map +1 -0
- package/dist/commands/pr/open.js +80 -0
- package/dist/commands/pr/pr.command.d.ts +33 -0
- package/dist/commands/pr/pr.command.d.ts.map +1 -0
- package/dist/commands/pr/pr.command.js +172 -0
- package/dist/commands/pr/update.d.ts +8 -0
- package/dist/commands/pr/update.d.ts.map +1 -0
- package/dist/commands/pr/update.js +103 -0
- package/dist/commands/ready.command.d.ts +8 -0
- package/dist/commands/ready.command.d.ts.map +1 -0
- package/dist/commands/ready.command.js +28 -0
- package/dist/commands/recipes/cache-prune.command.d.ts +6 -0
- package/dist/commands/recipes/cache-prune.command.d.ts.map +1 -0
- package/dist/commands/recipes/cache-prune.command.js +30 -0
- package/dist/commands/recipes/cache.command.d.ts +6 -0
- package/dist/commands/recipes/cache.command.d.ts.map +1 -0
- package/dist/commands/recipes/cache.command.js +37 -0
- package/dist/commands/recipes/explain.command.d.ts +7 -0
- package/dist/commands/recipes/explain.command.d.ts.map +1 -0
- package/dist/commands/recipes/explain.command.js +10 -0
- package/dist/commands/recipes/impl/apply.d.ts +16 -0
- package/dist/commands/recipes/impl/apply.d.ts.map +1 -0
- package/dist/commands/recipes/impl/apply.js +97 -0
- package/dist/commands/recipes/impl/archive.d.ts +2 -0
- package/dist/commands/recipes/impl/archive.d.ts.map +1 -0
- package/dist/commands/recipes/impl/archive.js +19 -0
- package/dist/commands/recipes/impl/commands/cache-prune.d.ts +7 -0
- package/dist/commands/recipes/impl/commands/cache-prune.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/cache-prune.js +94 -0
- package/dist/commands/recipes/impl/commands/explain.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/explain.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/explain.js +88 -0
- package/dist/commands/recipes/impl/commands/info.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/info.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/info.js +58 -0
- package/dist/commands/recipes/impl/commands/install.d.ts +11 -0
- package/dist/commands/recipes/impl/commands/install.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/install.js +212 -0
- package/dist/commands/recipes/impl/commands/list-remote.d.ts +7 -0
- package/dist/commands/recipes/impl/commands/list-remote.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/list-remote.js +53 -0
- package/dist/commands/recipes/impl/commands/list.d.ts +7 -0
- package/dist/commands/recipes/impl/commands/list.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/list.js +38 -0
- package/dist/commands/recipes/impl/commands/remove.d.ts +6 -0
- package/dist/commands/recipes/impl/commands/remove.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands/remove.js +35 -0
- package/dist/commands/recipes/impl/commands.d.ts +8 -0
- package/dist/commands/recipes/impl/commands.d.ts.map +1 -0
- package/dist/commands/recipes/impl/commands.js +7 -0
- package/dist/commands/recipes/impl/constants.d.ts +13 -0
- package/dist/commands/recipes/impl/constants.d.ts.map +1 -0
- package/dist/commands/recipes/impl/constants.js +16 -0
- package/dist/commands/recipes/impl/format.d.ts +2 -0
- package/dist/commands/recipes/impl/format.d.ts.map +1 -0
- package/dist/commands/recipes/impl/format.js +9 -0
- package/dist/commands/recipes/impl/index.d.ts +12 -0
- package/dist/commands/recipes/impl/index.d.ts.map +1 -0
- package/dist/commands/recipes/impl/index.js +150 -0
- package/dist/commands/recipes/impl/installed-recipes.d.ts +4 -0
- package/dist/commands/recipes/impl/installed-recipes.d.ts.map +1 -0
- package/dist/commands/recipes/impl/installed-recipes.js +58 -0
- package/dist/commands/recipes/impl/manifest.d.ts +4 -0
- package/dist/commands/recipes/impl/manifest.d.ts.map +1 -0
- package/dist/commands/recipes/impl/manifest.js +43 -0
- package/dist/commands/recipes/impl/normalize.d.ts +5 -0
- package/dist/commands/recipes/impl/normalize.d.ts.map +1 -0
- package/dist/commands/recipes/impl/normalize.js +50 -0
- package/dist/commands/recipes/impl/paths.d.ts +13 -0
- package/dist/commands/recipes/impl/paths.d.ts.map +1 -0
- package/dist/commands/recipes/impl/paths.js +27 -0
- package/dist/commands/recipes/impl/project.d.ts +8 -0
- package/dist/commands/recipes/impl/project.d.ts.map +1 -0
- package/dist/commands/recipes/impl/project.js +23 -0
- package/dist/commands/recipes/impl/scenario.d.ts +16 -0
- package/dist/commands/recipes/impl/scenario.d.ts.map +1 -0
- package/dist/commands/recipes/impl/scenario.js +128 -0
- package/dist/commands/recipes/impl/types.d.ts +107 -0
- package/dist/commands/recipes/impl/types.d.ts.map +1 -0
- package/dist/commands/recipes/impl/types.js +1 -0
- package/dist/commands/recipes/info.command.d.ts +7 -0
- package/dist/commands/recipes/info.command.d.ts.map +1 -0
- package/dist/commands/recipes/info.command.js +10 -0
- package/dist/commands/recipes/install.command.d.ts +12 -0
- package/dist/commands/recipes/install.command.d.ts.map +1 -0
- package/dist/commands/recipes/install.command.js +161 -0
- package/dist/commands/recipes/list-remote.command.d.ts +6 -0
- package/dist/commands/recipes/list-remote.command.d.ts.map +1 -0
- package/dist/commands/recipes/list-remote.command.js +46 -0
- package/dist/commands/recipes/list.command.d.ts +6 -0
- package/dist/commands/recipes/list.command.d.ts.map +1 -0
- package/dist/commands/recipes/list.command.js +39 -0
- package/dist/commands/recipes/recipes.command.d.ts +6 -0
- package/dist/commands/recipes/recipes.command.d.ts.map +1 -0
- package/dist/commands/recipes/recipes.command.js +45 -0
- package/dist/commands/recipes/remove.command.d.ts +7 -0
- package/dist/commands/recipes/remove.command.d.ts.map +1 -0
- package/dist/commands/recipes/remove.command.js +10 -0
- package/dist/commands/recipes.d.ts +7 -12
- package/dist/commands/recipes.d.ts.map +1 -1
- package/dist/commands/recipes.js +6 -1963
- package/dist/commands/scenario/impl/commands.d.ts +19 -0
- package/dist/commands/scenario/impl/commands.d.ts.map +1 -0
- package/dist/commands/scenario/impl/commands.js +336 -0
- package/dist/commands/scenario/impl/report.d.ts +30 -0
- package/dist/commands/scenario/impl/report.d.ts.map +1 -0
- package/dist/commands/scenario/impl/report.js +99 -0
- package/dist/commands/scenario/info.command.d.ts +8 -0
- package/dist/commands/scenario/info.command.d.ts.map +1 -0
- package/dist/commands/scenario/info.command.js +27 -0
- package/dist/commands/scenario/list.command.d.ts +5 -0
- package/dist/commands/scenario/list.command.d.ts.map +1 -0
- package/dist/commands/scenario/list.command.js +9 -0
- package/dist/commands/scenario/run.command.d.ts +8 -0
- package/dist/commands/scenario/run.command.d.ts.map +1 -0
- package/dist/commands/scenario/run.command.js +27 -0
- package/dist/commands/scenario/scenario.command.d.ts +6 -0
- package/dist/commands/scenario/scenario.command.d.ts.map +1 -0
- package/dist/commands/scenario/scenario.command.js +37 -0
- package/dist/commands/scenario.d.ts +2 -0
- package/dist/commands/scenario.d.ts.map +1 -0
- package/dist/commands/scenario.js +1 -0
- package/dist/commands/shared/git-context.d.ts +23 -0
- package/dist/commands/shared/git-context.d.ts.map +1 -0
- package/dist/commands/shared/git-context.js +140 -0
- package/dist/commands/shared/policy-deny.d.ts +3 -0
- package/dist/commands/shared/policy-deny.d.ts.map +1 -0
- package/dist/commands/shared/policy-deny.js +12 -0
- package/dist/commands/shared/task-backend.d.ts +31 -3
- package/dist/commands/shared/task-backend.d.ts.map +1 -1
- package/dist/commands/shared/task-backend.js +42 -5
- package/dist/commands/shared/task-store.d.ts +16 -0
- package/dist/commands/shared/task-store.d.ts.map +1 -0
- package/dist/commands/shared/task-store.js +142 -0
- package/dist/commands/start.command.d.ts +19 -0
- package/dist/commands/start.command.d.ts.map +1 -0
- package/dist/commands/start.command.js +143 -0
- package/dist/commands/sync.command.d.ts +6 -0
- package/dist/commands/sync.command.d.ts.map +1 -0
- package/dist/commands/sync.command.js +57 -0
- package/dist/commands/task/add.command.d.ts +18 -0
- package/dist/commands/task/add.command.d.ts.map +1 -0
- package/dist/commands/task/add.command.js +157 -0
- package/dist/commands/task/add.d.ts +13 -3
- package/dist/commands/task/add.d.ts.map +1 -1
- package/dist/commands/task/add.js +21 -126
- package/dist/commands/task/block.d.ts +2 -2
- package/dist/commands/task/block.d.ts.map +1 -1
- package/dist/commands/task/block.js +31 -21
- package/dist/commands/task/comment.command.d.ts +10 -0
- package/dist/commands/task/comment.command.d.ts.map +1 -0
- package/dist/commands/task/comment.command.js +57 -0
- package/dist/commands/task/comment.d.ts +2 -0
- package/dist/commands/task/comment.d.ts.map +1 -1
- package/dist/commands/task/comment.js +19 -9
- package/dist/commands/task/derive.command.d.ts +13 -0
- package/dist/commands/task/derive.command.d.ts.map +1 -0
- package/dist/commands/task/derive.command.js +94 -0
- package/dist/commands/task/derive.d.ts +13 -0
- package/dist/commands/task/derive.d.ts.map +1 -0
- package/dist/commands/task/derive.js +71 -0
- package/dist/commands/task/doc-set.command.d.ts +12 -0
- package/dist/commands/task/doc-set.command.d.ts.map +1 -0
- package/dist/commands/task/doc-set.command.js +82 -0
- package/dist/commands/task/doc-show.command.d.ts +10 -0
- package/dist/commands/task/doc-show.command.d.ts.map +1 -0
- package/dist/commands/task/doc-show.command.js +54 -0
- package/dist/commands/task/doc.command.d.ts +7 -0
- package/dist/commands/task/doc.command.d.ts.map +1 -0
- package/dist/commands/task/doc.command.js +22 -0
- package/dist/commands/task/doc.d.ts +9 -6
- package/dist/commands/task/doc.d.ts.map +1 -1
- package/dist/commands/task/doc.js +61 -113
- package/dist/commands/task/export.command.d.ts +6 -0
- package/dist/commands/task/export.command.d.ts.map +1 -0
- package/dist/commands/task/export.command.js +17 -0
- package/dist/commands/task/export.d.ts +2 -0
- package/dist/commands/task/export.d.ts.map +1 -1
- package/dist/commands/task/export.js +7 -9
- package/dist/commands/task/finish.d.ts +5 -4
- package/dist/commands/task/finish.d.ts.map +1 -1
- package/dist/commands/task/finish.js +80 -37
- package/dist/commands/task/index.d.ts +14 -13
- package/dist/commands/task/index.d.ts.map +1 -1
- package/dist/commands/task/index.js +13 -13
- package/dist/commands/task/lint.command.d.ts +5 -0
- package/dist/commands/task/lint.command.d.ts.map +1 -0
- package/dist/commands/task/lint.command.js +11 -0
- package/dist/commands/task/list.command.d.ts +9 -0
- package/dist/commands/task/list.command.d.ts.map +1 -0
- package/dist/commands/task/list.command.js +68 -0
- package/dist/commands/task/list.d.ts +6 -2
- package/dist/commands/task/list.d.ts.map +1 -1
- package/dist/commands/task/list.js +12 -15
- package/dist/commands/task/migrate-doc.command.d.ts +9 -0
- package/dist/commands/task/migrate-doc.command.d.ts.map +1 -0
- package/dist/commands/task/migrate-doc.command.js +65 -0
- package/dist/commands/task/migrate-doc.d.ts +3 -3
- package/dist/commands/task/migrate-doc.d.ts.map +1 -1
- package/dist/commands/task/migrate-doc.js +40 -47
- package/dist/commands/task/migrate.command.d.ts +10 -0
- package/dist/commands/task/migrate.command.d.ts.map +1 -0
- package/dist/commands/task/migrate.command.js +50 -0
- package/dist/commands/task/migrate.d.ts +5 -1
- package/dist/commands/task/migrate.d.ts.map +1 -1
- package/dist/commands/task/migrate.js +10 -44
- package/dist/commands/task/new.command.d.ts +6 -0
- package/dist/commands/task/new.command.d.ts.map +1 -0
- package/dist/commands/task/new.command.js +13 -0
- package/dist/commands/task/new.d.ts +13 -4
- package/dist/commands/task/new.d.ts.map +1 -1
- package/dist/commands/task/new.js +30 -92
- package/dist/commands/task/new.spec.d.ts +4 -0
- package/dist/commands/task/new.spec.d.ts.map +1 -0
- package/dist/commands/task/new.spec.js +79 -0
- package/dist/commands/task/next.command.d.ts +9 -0
- package/dist/commands/task/next.command.d.ts.map +1 -0
- package/dist/commands/task/next.command.js +89 -0
- package/dist/commands/task/next.d.ts +4 -1
- package/dist/commands/task/next.d.ts.map +1 -1
- package/dist/commands/task/next.js +15 -16
- package/dist/commands/task/normalize.command.d.ts +9 -0
- package/dist/commands/task/normalize.command.d.ts.map +1 -0
- package/dist/commands/task/normalize.command.js +39 -0
- package/dist/commands/task/normalize.d.ts +4 -1
- package/dist/commands/task/normalize.d.ts.map +1 -1
- package/dist/commands/task/normalize.js +18 -31
- package/dist/commands/task/plan-approve.command.d.ts +10 -0
- package/dist/commands/task/plan-approve.command.d.ts.map +1 -0
- package/dist/commands/task/plan-approve.command.js +54 -0
- package/dist/commands/task/plan-reject.command.d.ts +10 -0
- package/dist/commands/task/plan-reject.command.d.ts.map +1 -0
- package/dist/commands/task/plan-reject.command.js +59 -0
- package/dist/commands/task/plan-set.command.d.ts +11 -0
- package/dist/commands/task/plan-set.command.d.ts.map +1 -0
- package/dist/commands/task/plan-set.command.js +76 -0
- package/dist/commands/task/plan.d.ts +23 -10
- package/dist/commands/task/plan.d.ts.map +1 -1
- package/dist/commands/task/plan.js +182 -177
- package/dist/commands/task/ready.d.ts +2 -0
- package/dist/commands/task/ready.d.ts.map +1 -1
- package/dist/commands/task/ready.js +4 -6
- package/dist/commands/task/scaffold.command.d.ts +12 -0
- package/dist/commands/task/scaffold.command.d.ts.map +1 -0
- package/dist/commands/task/scaffold.command.js +73 -0
- package/dist/commands/task/scaffold.d.ts +7 -3
- package/dist/commands/task/scaffold.d.ts.map +1 -1
- package/dist/commands/task/scaffold.js +57 -67
- package/dist/commands/task/scrub.command.d.ts +11 -0
- package/dist/commands/task/scrub.command.d.ts.map +1 -0
- package/dist/commands/task/scrub.command.js +72 -0
- package/dist/commands/task/scrub.d.ts +6 -3
- package/dist/commands/task/scrub.d.ts.map +1 -1
- package/dist/commands/task/scrub.js +12 -68
- package/dist/commands/task/search.command.d.ts +11 -0
- package/dist/commands/task/search.command.d.ts.map +1 -0
- package/dist/commands/task/search.command.js +101 -0
- package/dist/commands/task/search.d.ts +5 -1
- package/dist/commands/task/search.d.ts.map +1 -1
- package/dist/commands/task/search.js +14 -23
- package/dist/commands/task/set-status.command.d.ts +21 -0
- package/dist/commands/task/set-status.command.d.ts.map +1 -0
- package/dist/commands/task/set-status.command.js +171 -0
- package/dist/commands/task/set-status.d.ts +2 -0
- package/dist/commands/task/set-status.d.ts.map +1 -1
- package/dist/commands/task/set-status.js +32 -12
- package/dist/commands/task/shared.d.ts +8 -2
- package/dist/commands/task/shared.d.ts.map +1 -1
- package/dist/commands/task/shared.js +68 -28
- package/dist/commands/task/show.command.d.ts +8 -0
- package/dist/commands/task/show.command.d.ts.map +1 -0
- package/dist/commands/task/show.command.js +19 -0
- package/dist/commands/task/show.d.ts +2 -0
- package/dist/commands/task/show.d.ts.map +1 -1
- package/dist/commands/task/show.js +5 -7
- package/dist/commands/task/start.d.ts +2 -2
- package/dist/commands/task/start.d.ts.map +1 -1
- package/dist/commands/task/start.js +66 -23
- package/dist/commands/task/update.command.d.ts +18 -0
- package/dist/commands/task/update.command.d.ts.map +1 -0
- package/dist/commands/task/update.command.js +141 -0
- package/dist/commands/task/update.d.ts +13 -3
- package/dist/commands/task/update.d.ts.map +1 -1
- package/dist/commands/task/update.js +31 -122
- package/dist/commands/task/verify-ok.command.d.ts +13 -0
- package/dist/commands/task/verify-ok.command.d.ts.map +1 -0
- package/dist/commands/task/verify-ok.command.js +83 -0
- package/dist/commands/task/verify-record.d.ts +30 -8
- package/dist/commands/task/verify-record.d.ts.map +1 -1
- package/dist/commands/task/verify-record.js +114 -117
- package/dist/commands/task/verify-rework.command.d.ts +13 -0
- package/dist/commands/task/verify-rework.command.d.ts.map +1 -0
- package/dist/commands/task/verify-rework.command.js +83 -0
- package/dist/commands/task/verify-show.command.d.ts +9 -0
- package/dist/commands/task/verify-show.command.d.ts.map +1 -0
- package/dist/commands/task/verify-show.command.js +38 -0
- package/dist/commands/task/verify.command.d.ts +7 -0
- package/dist/commands/task/verify.command.d.ts.map +1 -0
- package/dist/commands/task/verify.command.js +20 -0
- package/dist/commands/upgrade.command.d.ts +6 -0
- package/dist/commands/upgrade.command.d.ts.map +1 -0
- package/dist/commands/upgrade.command.js +104 -0
- package/dist/commands/upgrade.d.ts +13 -2
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +12 -80
- package/dist/commands/verify.command.d.ts +16 -0
- package/dist/commands/verify.command.d.ts.map +1 -0
- package/dist/commands/verify.command.js +113 -0
- package/dist/commands/workflow.d.ts +4 -6
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +4 -7
- package/dist/meta/release.d.ts +2 -0
- package/dist/meta/release.d.ts.map +1 -0
- package/dist/meta/release.js +50 -0
- package/dist/policy/evaluate.d.ts +3 -0
- package/dist/policy/evaluate.d.ts.map +1 -0
- package/dist/policy/evaluate.js +27 -0
- package/dist/policy/result.d.ts +7 -0
- package/dist/policy/result.d.ts.map +1 -0
- package/dist/policy/result.js +21 -0
- package/dist/policy/rules/allowlist.d.ts +3 -0
- package/dist/policy/rules/allowlist.d.ts.map +1 -0
- package/dist/policy/rules/allowlist.js +30 -0
- package/dist/policy/rules/branch-pr-base.d.ts +3 -0
- package/dist/policy/rules/branch-pr-base.d.ts.map +1 -0
- package/dist/policy/rules/branch-pr-base.js +43 -0
- package/dist/policy/rules/clean-tree.d.ts +3 -0
- package/dist/policy/rules/clean-tree.d.ts.map +1 -0
- package/dist/policy/rules/clean-tree.js +19 -0
- package/dist/policy/rules/commit-subject.d.ts +3 -0
- package/dist/policy/rules/commit-subject.d.ts.map +1 -0
- package/dist/policy/rules/commit-subject.js +33 -0
- package/dist/policy/rules/protected-paths.d.ts +3 -0
- package/dist/policy/rules/protected-paths.d.ts.map +1 -0
- package/dist/policy/rules/protected-paths.js +53 -0
- package/dist/policy/types.d.ts +38 -0
- package/dist/policy/types.d.ts.map +1 -0
- package/dist/policy/types.js +1 -0
- package/dist/shared/git-log.d.ts +5 -0
- package/dist/shared/git-log.d.ts.map +1 -0
- package/dist/shared/git-log.js +14 -0
- package/dist/shared/git-path.d.ts +3 -0
- package/dist/shared/git-path.d.ts.map +1 -0
- package/dist/shared/git-path.js +30 -0
- package/dist/shared/guards.d.ts +2 -0
- package/dist/shared/guards.d.ts.map +1 -0
- package/dist/shared/guards.js +3 -0
- package/dist/shared/protected-paths.d.ts +12 -0
- package/dist/shared/protected-paths.d.ts.map +1 -0
- package/dist/shared/protected-paths.js +51 -0
- package/dist/shared/strings.d.ts +2 -0
- package/dist/shared/strings.d.ts.map +1 -0
- package/dist/shared/strings.js +14 -0
- package/dist/shared/write-if-changed.d.ts +3 -0
- package/dist/shared/write-if-changed.d.ts.map +1 -0
- package/dist/shared/write-if-changed.js +25 -0
- package/package.json +2 -2
- package/dist/cli/help.d.ts +0 -2
- package/dist/cli/help.d.ts.map +0 -1
- package/dist/cli/help.js +0 -127
- package/dist/commands/task/verify.d.ts +0 -2
- package/dist/commands/task/verify.d.ts.map +0 -1
- package/dist/commands/task/verify.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/backends/task-backend/shared/events.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAiB,MAAM,YAAY,CAAC;AAI3D,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,EAAE,CAsB3D"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { isRecord } from "../../../shared/guards.js";
|
|
2
|
+
const TASK_EVENT_TYPES = new Set(["status", "comment", "verify"]);
|
|
3
|
+
export function normalizeEvents(value) {
|
|
4
|
+
if (!Array.isArray(value))
|
|
5
|
+
return [];
|
|
6
|
+
const events = [];
|
|
7
|
+
for (const entry of value) {
|
|
8
|
+
if (!isRecord(entry))
|
|
9
|
+
continue;
|
|
10
|
+
const type = typeof entry.type === "string" ? entry.type : "";
|
|
11
|
+
if (!TASK_EVENT_TYPES.has(type))
|
|
12
|
+
continue;
|
|
13
|
+
const at = typeof entry.at === "string" ? entry.at : "";
|
|
14
|
+
const author = typeof entry.author === "string" ? entry.author : "";
|
|
15
|
+
if (!at.trim() || !author.trim())
|
|
16
|
+
continue;
|
|
17
|
+
events.push({
|
|
18
|
+
type: type,
|
|
19
|
+
at,
|
|
20
|
+
author,
|
|
21
|
+
from: typeof entry.from === "string" ? entry.from : undefined,
|
|
22
|
+
to: typeof entry.to === "string" ? entry.to : undefined,
|
|
23
|
+
state: typeof entry.state === "string" ? entry.state : undefined,
|
|
24
|
+
note: typeof entry.note === "string" ? entry.note : undefined,
|
|
25
|
+
body: typeof entry.body === "string" ? entry.body : undefined,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return events;
|
|
29
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TaskData } from "./types.js";
|
|
2
|
+
export declare function buildTasksExportSnapshotFromTasks(tasks: TaskData[]): {
|
|
3
|
+
tasks: TaskData[];
|
|
4
|
+
meta: {
|
|
5
|
+
schema_version: 1;
|
|
6
|
+
managed_by: string;
|
|
7
|
+
checksum_algo: "sha256";
|
|
8
|
+
checksum: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare function writeTasksExportFromTasks(opts: {
|
|
12
|
+
outputPath: string;
|
|
13
|
+
tasks: TaskData[];
|
|
14
|
+
}): Promise<void>;
|
|
15
|
+
//# sourceMappingURL=export.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../../../src/backends/task-backend/shared/export.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,QAAQ,EAAa,MAAM,YAAY,CAAC;AA0CtD,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG;IACpE,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,IAAI,EAAE;QAAE,cAAc,EAAE,CAAC,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,QAAQ,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5F,CAcA;AAED,wBAAsB,yBAAyB,CAAC,IAAI,EAAE;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CAIhB"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { mkdir } from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { canonicalizeJson } from "@agentplaneorg/core";
|
|
5
|
+
import { writeJsonStableIfChanged } from "../../../shared/write-if-changed.js";
|
|
6
|
+
import { DEFAULT_DOC_UPDATED_BY, DOC_VERSION } from "./constants.js";
|
|
7
|
+
import { resolveDocUpdatedByFromTask } from "./doc.js";
|
|
8
|
+
import { toStringArray } from "./strings.js";
|
|
9
|
+
function taskDataToExport(task) {
|
|
10
|
+
const base = {
|
|
11
|
+
...task,
|
|
12
|
+
id: task.id,
|
|
13
|
+
title: task.title ?? "",
|
|
14
|
+
description: task.description ?? "",
|
|
15
|
+
status: task.status ?? "",
|
|
16
|
+
priority: typeof task.priority === "number" ? String(task.priority) : (task.priority ?? ""),
|
|
17
|
+
owner: task.owner ?? "",
|
|
18
|
+
depends_on: toStringArray(task.depends_on),
|
|
19
|
+
tags: toStringArray(task.tags),
|
|
20
|
+
verify: toStringArray(task.verify),
|
|
21
|
+
commit: task.commit ?? null,
|
|
22
|
+
comments: Array.isArray(task.comments)
|
|
23
|
+
? task.comments.filter((item) => !!item && typeof item.author === "string" && typeof item.body === "string")
|
|
24
|
+
: [],
|
|
25
|
+
doc_version: task.doc_version ?? DOC_VERSION,
|
|
26
|
+
doc_updated_at: task.doc_updated_at ?? "",
|
|
27
|
+
doc_updated_by: resolveDocUpdatedByFromTask(task, DEFAULT_DOC_UPDATED_BY),
|
|
28
|
+
dirty: Boolean(task.dirty),
|
|
29
|
+
id_source: task.id_source ?? "generated",
|
|
30
|
+
};
|
|
31
|
+
const events = Array.isArray(task.events)
|
|
32
|
+
? task.events.filter((event) => !!event &&
|
|
33
|
+
typeof event.type === "string" &&
|
|
34
|
+
typeof event.at === "string" &&
|
|
35
|
+
typeof event.author === "string")
|
|
36
|
+
: [];
|
|
37
|
+
if (events.length > 0)
|
|
38
|
+
return { ...base, events };
|
|
39
|
+
return base;
|
|
40
|
+
}
|
|
41
|
+
export function buildTasksExportSnapshotFromTasks(tasks) {
|
|
42
|
+
const exportTasks = tasks.map((task) => taskDataToExport(task));
|
|
43
|
+
const sorted = exportTasks.toSorted((a, b) => a.id.localeCompare(b.id));
|
|
44
|
+
const canonical = JSON.stringify(canonicalizeJson({ tasks: sorted }));
|
|
45
|
+
const checksum = createHash("sha256").update(canonical, "utf8").digest("hex");
|
|
46
|
+
return {
|
|
47
|
+
tasks: sorted,
|
|
48
|
+
meta: {
|
|
49
|
+
schema_version: 1,
|
|
50
|
+
managed_by: "agentplane",
|
|
51
|
+
checksum_algo: "sha256",
|
|
52
|
+
checksum,
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export async function writeTasksExportFromTasks(opts) {
|
|
57
|
+
const snapshot = buildTasksExportSnapshotFromTasks(opts.tasks);
|
|
58
|
+
await mkdir(path.dirname(opts.outputPath), { recursive: true });
|
|
59
|
+
await writeJsonStableIfChanged(opts.outputPath, snapshot);
|
|
60
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type GenerateTaskId = (opts: {
|
|
2
|
+
length: number;
|
|
3
|
+
attempts: number;
|
|
4
|
+
isAvailable?: (taskId: string) => boolean | Promise<boolean>;
|
|
5
|
+
date?: Date;
|
|
6
|
+
}) => Promise<string>;
|
|
7
|
+
export declare const generateTaskId: GenerateTaskId;
|
|
8
|
+
export declare function validateTaskId(taskId: string): void;
|
|
9
|
+
export declare function missingTaskIdMessage(): string;
|
|
10
|
+
export declare function unknownTaskIdMessage(taskId: string): string;
|
|
11
|
+
export declare function invalidLengthMessage(value: number, min: number): string;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../../../src/backends/task-backend/shared/id.ts"],"names":[],"mappings":"AAIA,KAAK,cAAc,GAAG,CAAC,IAAI,EAAE;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7D,IAAI,CAAC,EAAE,IAAI,CAAC;CACb,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAEtB,eAAO,MAAM,cAAc,EAAE,cAAmC,CAAC;AAEjE,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAGnD;AAED,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEvE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { generateTaskId as generateTaskIdCore } from "@agentplaneorg/core";
|
|
2
|
+
import { TASK_ID_RE } from "./constants.js";
|
|
3
|
+
export const generateTaskId = generateTaskIdCore;
|
|
4
|
+
export function validateTaskId(taskId) {
|
|
5
|
+
if (TASK_ID_RE.test(taskId))
|
|
6
|
+
return;
|
|
7
|
+
throw new Error(`Invalid task id: ${taskId} (expected YYYYMMDDHHMM-XXXX)`);
|
|
8
|
+
}
|
|
9
|
+
export function missingTaskIdMessage() {
|
|
10
|
+
return "Missing task id (expected non-empty value)";
|
|
11
|
+
}
|
|
12
|
+
export function unknownTaskIdMessage(taskId) {
|
|
13
|
+
return `Unknown task id: ${taskId}`;
|
|
14
|
+
}
|
|
15
|
+
export function invalidLengthMessage(value, min) {
|
|
16
|
+
return `Invalid length: ${value} (expected >= ${min})`;
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PlanApproval, VerificationResult } from "./types.js";
|
|
2
|
+
export declare function normalizeDependsOn(value: unknown): string[];
|
|
3
|
+
export declare function normalizePriority(value: unknown): string;
|
|
4
|
+
export declare function defaultPlanApproval(): PlanApproval;
|
|
5
|
+
export declare function defaultVerificationResult(): VerificationResult;
|
|
6
|
+
export declare function normalizePlanApproval(value: unknown): PlanApproval | null;
|
|
7
|
+
export declare function normalizeVerificationResult(value: unknown): VerificationResult | null;
|
|
8
|
+
//# sourceMappingURL=normalize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../../src/backends/task-backend/shared/normalize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGnE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAM3D;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CASxD;AAED,wBAAgB,mBAAmB,IAAI,YAAY,CAElD;AAED,wBAAgB,yBAAyB,IAAI,kBAAkB,CAE9D;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,GAAG,IAAI,CAUzE;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,kBAAkB,GAAG,IAAI,CAUrF"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { isRecord } from "../../../shared/guards.js";
|
|
2
|
+
import { toStringSafe } from "./strings.js";
|
|
3
|
+
export function normalizeDependsOn(value) {
|
|
4
|
+
if (Array.isArray(value)) {
|
|
5
|
+
return value.filter((v) => typeof v === "string" && v.trim() !== "[]");
|
|
6
|
+
}
|
|
7
|
+
if (typeof value === "string" && value.trim() === "[]")
|
|
8
|
+
return [];
|
|
9
|
+
return [];
|
|
10
|
+
}
|
|
11
|
+
export function normalizePriority(value) {
|
|
12
|
+
const raw = toStringSafe(value).trim().toLowerCase();
|
|
13
|
+
if (!raw)
|
|
14
|
+
return "med";
|
|
15
|
+
if (raw === "low")
|
|
16
|
+
return "low";
|
|
17
|
+
if (raw === "normal")
|
|
18
|
+
return "normal";
|
|
19
|
+
if (raw === "medium" || raw === "med")
|
|
20
|
+
return "med";
|
|
21
|
+
if (raw === "high")
|
|
22
|
+
return "high";
|
|
23
|
+
if (raw === "urgent" || raw === "immediate")
|
|
24
|
+
return "high";
|
|
25
|
+
return "med";
|
|
26
|
+
}
|
|
27
|
+
export function defaultPlanApproval() {
|
|
28
|
+
return { state: "pending", updated_at: null, updated_by: null, note: null };
|
|
29
|
+
}
|
|
30
|
+
export function defaultVerificationResult() {
|
|
31
|
+
return { state: "pending", updated_at: null, updated_by: null, note: null };
|
|
32
|
+
}
|
|
33
|
+
export function normalizePlanApproval(value) {
|
|
34
|
+
if (!isRecord(value))
|
|
35
|
+
return null;
|
|
36
|
+
const state = typeof value.state === "string" ? value.state : "";
|
|
37
|
+
if (state !== "pending" && state !== "approved" && state !== "rejected")
|
|
38
|
+
return null;
|
|
39
|
+
const updatedAt = value.updated_at === null || typeof value.updated_at === "string" ? value.updated_at : null;
|
|
40
|
+
const updatedBy = value.updated_by === null || typeof value.updated_by === "string" ? value.updated_by : null;
|
|
41
|
+
const note = value.note === null || typeof value.note === "string" ? value.note : null;
|
|
42
|
+
return { state, updated_at: updatedAt, updated_by: updatedBy, note };
|
|
43
|
+
}
|
|
44
|
+
export function normalizeVerificationResult(value) {
|
|
45
|
+
if (!isRecord(value))
|
|
46
|
+
return null;
|
|
47
|
+
const state = typeof value.state === "string" ? value.state : "";
|
|
48
|
+
if (state !== "pending" && state !== "ok" && state !== "needs_rework")
|
|
49
|
+
return null;
|
|
50
|
+
const updatedAt = value.updated_at === null || typeof value.updated_at === "string" ? value.updated_at : null;
|
|
51
|
+
const updatedBy = value.updated_by === null || typeof value.updated_by === "string" ? value.updated_by : null;
|
|
52
|
+
const note = value.note === null || typeof value.note === "string" ? value.note : null;
|
|
53
|
+
return { state, updated_at: updatedAt, updated_by: updatedBy, note };
|
|
54
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../../../src/backends/task-backend/shared/record.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAYtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,QAAQ,CAwD7D"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { isRecord } from "../../../shared/guards.js";
|
|
2
|
+
import { extractTaskDoc } from "./doc.js";
|
|
3
|
+
import { normalizeEvents } from "./events.js";
|
|
4
|
+
import { normalizeDependsOn, normalizePlanApproval, normalizeVerificationResult, } from "./normalize.js";
|
|
5
|
+
import { toStringArray } from "./strings.js";
|
|
6
|
+
export function taskRecordToData(record) {
|
|
7
|
+
const fm = record.frontmatter;
|
|
8
|
+
const comments = Array.isArray(fm.comments)
|
|
9
|
+
? fm.comments
|
|
10
|
+
.filter((item) => isRecord(item))
|
|
11
|
+
.filter((item) => typeof item.author === "string" && typeof item.body === "string")
|
|
12
|
+
.map((item) => ({ author: item.author, body: item.body }))
|
|
13
|
+
: [];
|
|
14
|
+
const commit = isRecord(fm.commit) &&
|
|
15
|
+
typeof fm.commit.hash === "string" &&
|
|
16
|
+
typeof fm.commit.message === "string"
|
|
17
|
+
? { hash: fm.commit.hash, message: fm.commit.message }
|
|
18
|
+
: null;
|
|
19
|
+
const events = normalizeEvents(fm.events);
|
|
20
|
+
const planApproval = normalizePlanApproval(fm.plan_approval);
|
|
21
|
+
const verification = normalizeVerificationResult(fm.verification);
|
|
22
|
+
const baseId = typeof fm.id === "string" ? fm.id : typeof record.id === "string" ? record.id : "";
|
|
23
|
+
const task = {
|
|
24
|
+
id: baseId.trim(),
|
|
25
|
+
title: typeof fm.title === "string" ? fm.title : "",
|
|
26
|
+
result_summary: typeof fm.result_summary === "string" ? fm.result_summary : undefined,
|
|
27
|
+
risk_level: fm.risk_level === "low" || fm.risk_level === "med" || fm.risk_level === "high"
|
|
28
|
+
? fm.risk_level
|
|
29
|
+
: undefined,
|
|
30
|
+
breaking: typeof fm.breaking === "boolean" ? fm.breaking : undefined,
|
|
31
|
+
description: typeof fm.description === "string" ? fm.description : "",
|
|
32
|
+
status: typeof fm.status === "string" ? fm.status : "TODO",
|
|
33
|
+
priority: typeof fm.priority === "string" || typeof fm.priority === "number" ? fm.priority : "",
|
|
34
|
+
owner: typeof fm.owner === "string" ? fm.owner : "",
|
|
35
|
+
depends_on: normalizeDependsOn(fm.depends_on),
|
|
36
|
+
tags: toStringArray(fm.tags),
|
|
37
|
+
verify: toStringArray(fm.verify),
|
|
38
|
+
plan_approval: planApproval ?? undefined,
|
|
39
|
+
verification: verification ?? undefined,
|
|
40
|
+
commit,
|
|
41
|
+
comments,
|
|
42
|
+
events,
|
|
43
|
+
doc_version: typeof fm.doc_version === "number" ? fm.doc_version : undefined,
|
|
44
|
+
doc_updated_at: typeof fm.doc_updated_at === "string" ? fm.doc_updated_at : undefined,
|
|
45
|
+
doc_updated_by: typeof fm.doc_updated_by === "string" ? fm.doc_updated_by : undefined,
|
|
46
|
+
dirty: typeof fm.dirty === "boolean" ? fm.dirty : undefined,
|
|
47
|
+
id_source: typeof fm.id_source === "string" ? fm.id_source : undefined,
|
|
48
|
+
};
|
|
49
|
+
const doc = extractTaskDoc(record.body);
|
|
50
|
+
if (doc)
|
|
51
|
+
task.doc = doc;
|
|
52
|
+
return task;
|
|
53
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../../../src/backends/task-backend/shared/strings.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAMnD;AAED,wBAAgB,mBAAmB,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAOhE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAGtD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export function toStringSafe(value) {
|
|
2
|
+
if (typeof value === "string")
|
|
3
|
+
return value;
|
|
4
|
+
if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") {
|
|
5
|
+
return String(value);
|
|
6
|
+
}
|
|
7
|
+
return "";
|
|
8
|
+
}
|
|
9
|
+
export function firstNonEmptyString(...values) {
|
|
10
|
+
for (const value of values) {
|
|
11
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
12
|
+
return value.trim();
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return "";
|
|
16
|
+
}
|
|
17
|
+
export function toStringArray(value) {
|
|
18
|
+
if (!Array.isArray(value))
|
|
19
|
+
return [];
|
|
20
|
+
return value.filter((v) => typeof v === "string");
|
|
21
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export type PlanApprovalState = "pending" | "approved" | "rejected";
|
|
2
|
+
export type PlanApproval = {
|
|
3
|
+
state: PlanApprovalState;
|
|
4
|
+
updated_at: string | null;
|
|
5
|
+
updated_by: string | null;
|
|
6
|
+
note: string | null;
|
|
7
|
+
};
|
|
8
|
+
export type VerificationState = "pending" | "ok" | "needs_rework";
|
|
9
|
+
export type VerificationResult = {
|
|
10
|
+
state: VerificationState;
|
|
11
|
+
updated_at: string | null;
|
|
12
|
+
updated_by: string | null;
|
|
13
|
+
note: string | null;
|
|
14
|
+
};
|
|
15
|
+
export type TaskEventType = "status" | "comment" | "verify";
|
|
16
|
+
export type TaskEvent = {
|
|
17
|
+
type: TaskEventType;
|
|
18
|
+
at: string;
|
|
19
|
+
author: string;
|
|
20
|
+
from?: string;
|
|
21
|
+
to?: string;
|
|
22
|
+
state?: string;
|
|
23
|
+
note?: string;
|
|
24
|
+
body?: string;
|
|
25
|
+
};
|
|
26
|
+
export type TaskData = {
|
|
27
|
+
id: string;
|
|
28
|
+
title: string;
|
|
29
|
+
result_summary?: string;
|
|
30
|
+
risk_level?: "low" | "med" | "high";
|
|
31
|
+
breaking?: boolean;
|
|
32
|
+
description: string;
|
|
33
|
+
status: string;
|
|
34
|
+
priority: string | number;
|
|
35
|
+
owner: string;
|
|
36
|
+
depends_on: string[];
|
|
37
|
+
tags: string[];
|
|
38
|
+
verify: string[];
|
|
39
|
+
plan_approval?: PlanApproval;
|
|
40
|
+
verification?: VerificationResult;
|
|
41
|
+
commit?: {
|
|
42
|
+
hash: string;
|
|
43
|
+
message: string;
|
|
44
|
+
} | null;
|
|
45
|
+
comments?: {
|
|
46
|
+
author: string;
|
|
47
|
+
body: string;
|
|
48
|
+
}[];
|
|
49
|
+
events?: TaskEvent[];
|
|
50
|
+
doc?: string;
|
|
51
|
+
doc_version?: number;
|
|
52
|
+
doc_updated_at?: string;
|
|
53
|
+
doc_updated_by?: string;
|
|
54
|
+
dirty?: boolean;
|
|
55
|
+
id_source?: string;
|
|
56
|
+
};
|
|
57
|
+
export type TaskDocMeta = Pick<TaskData, "doc" | "doc_version" | "doc_updated_at" | "doc_updated_by">;
|
|
58
|
+
export type TaskBackend = {
|
|
59
|
+
id: string;
|
|
60
|
+
listTasks(): Promise<TaskData[]>;
|
|
61
|
+
getTask(taskId: string): Promise<TaskData | null>;
|
|
62
|
+
getTasks?(taskIds: string[]): Promise<(TaskData | null)[]>;
|
|
63
|
+
writeTask(task: TaskData): Promise<void>;
|
|
64
|
+
writeTasks?(tasks: TaskData[]): Promise<void>;
|
|
65
|
+
normalizeTasks?(): Promise<{
|
|
66
|
+
scanned: number;
|
|
67
|
+
changed: number;
|
|
68
|
+
}>;
|
|
69
|
+
exportTasksJson?(outputPath: string): Promise<void>;
|
|
70
|
+
getTaskDoc?(taskId: string): Promise<string>;
|
|
71
|
+
setTaskDoc?(taskId: string, doc: string, updatedBy?: string): Promise<void>;
|
|
72
|
+
touchTaskDocMetadata?(taskId: string, updatedBy?: string): Promise<void>;
|
|
73
|
+
sync?(opts: {
|
|
74
|
+
direction: "push" | "pull";
|
|
75
|
+
conflict: "diff" | "prefer-local" | "prefer-remote" | "fail";
|
|
76
|
+
quiet: boolean;
|
|
77
|
+
confirm: boolean;
|
|
78
|
+
}): Promise<void>;
|
|
79
|
+
generateTaskId?(opts: {
|
|
80
|
+
length: number;
|
|
81
|
+
attempts: number;
|
|
82
|
+
}): Promise<string>;
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/backends/task-backend/shared/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { DEFAULT_DOC_UPDATED_BY, DOC_VERSION, TASK_ID_RE } from "./shared/constants.js";
|
|
2
|
+
export type { PlanApproval, PlanApprovalState, TaskBackend, TaskData, TaskDocMeta, TaskEvent, TaskEventType, VerificationResult, VerificationState, } from "./shared/types.js";
|
|
3
|
+
export * from "./shared/concurrency.js";
|
|
4
|
+
export * from "./shared/doc.js";
|
|
5
|
+
export * from "./shared/errors.js";
|
|
6
|
+
export * from "./shared/export.js";
|
|
7
|
+
export * from "./shared/id.js";
|
|
8
|
+
export { defaultPlanApproval, defaultVerificationResult, normalizeDependsOn, normalizePriority, } from "./shared/normalize.js";
|
|
9
|
+
export * from "./shared/record.js";
|
|
10
|
+
export * from "./shared/strings.js";
|
|
11
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/backends/task-backend/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExF,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,QAAQ,EACR,WAAW,EACX,SAAS,EACT,aAAa,EACb,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAE3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { DEFAULT_DOC_UPDATED_BY, DOC_VERSION, TASK_ID_RE } from "./shared/constants.js";
|
|
2
|
+
export * from "./shared/concurrency.js";
|
|
3
|
+
export * from "./shared/doc.js";
|
|
4
|
+
export * from "./shared/errors.js";
|
|
5
|
+
export * from "./shared/export.js";
|
|
6
|
+
export * from "./shared/id.js";
|
|
7
|
+
export { defaultPlanApproval, defaultVerificationResult, normalizeDependsOn, normalizePriority, } from "./shared/normalize.js";
|
|
8
|
+
export * from "./shared/record.js";
|
|
9
|
+
export * from "./shared/strings.js";
|
|
@@ -1,193 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
updated_at: string | null;
|
|
6
|
-
updated_by: string | null;
|
|
7
|
-
note: string | null;
|
|
8
|
-
};
|
|
9
|
-
export type VerificationState = "pending" | "ok" | "needs_rework";
|
|
10
|
-
export type VerificationResult = {
|
|
11
|
-
state: VerificationState;
|
|
12
|
-
updated_at: string | null;
|
|
13
|
-
updated_by: string | null;
|
|
14
|
-
note: string | null;
|
|
15
|
-
};
|
|
16
|
-
type ExtractTaskDoc = (body: string) => string;
|
|
17
|
-
type MergeTaskDoc = (body: string, doc: string) => string;
|
|
18
|
-
declare const extractTaskDoc: ExtractTaskDoc;
|
|
19
|
-
declare const mergeTaskDoc: MergeTaskDoc;
|
|
20
|
-
export { extractTaskDoc, mergeTaskDoc };
|
|
21
|
-
export type TaskData = {
|
|
22
|
-
id: string;
|
|
23
|
-
title: string;
|
|
24
|
-
description: string;
|
|
25
|
-
status: string;
|
|
26
|
-
priority: string | number;
|
|
27
|
-
owner: string;
|
|
28
|
-
depends_on: string[];
|
|
29
|
-
tags: string[];
|
|
30
|
-
verify: string[];
|
|
31
|
-
plan_approval?: PlanApproval;
|
|
32
|
-
verification?: VerificationResult;
|
|
33
|
-
commit?: {
|
|
34
|
-
hash: string;
|
|
35
|
-
message: string;
|
|
36
|
-
} | null;
|
|
37
|
-
comments?: {
|
|
38
|
-
author: string;
|
|
39
|
-
body: string;
|
|
40
|
-
}[];
|
|
41
|
-
doc?: string;
|
|
42
|
-
doc_version?: number;
|
|
43
|
-
doc_updated_at?: string;
|
|
44
|
-
doc_updated_by?: string;
|
|
45
|
-
dirty?: boolean;
|
|
46
|
-
id_source?: string;
|
|
47
|
-
};
|
|
48
|
-
export type TaskBackend = {
|
|
49
|
-
id: string;
|
|
50
|
-
listTasks(): Promise<TaskData[]>;
|
|
51
|
-
getTask(taskId: string): Promise<TaskData | null>;
|
|
52
|
-
writeTask(task: TaskData): Promise<void>;
|
|
53
|
-
writeTasks?(tasks: TaskData[]): Promise<void>;
|
|
54
|
-
exportTasksJson?(outputPath: string): Promise<void>;
|
|
55
|
-
getTaskDoc?(taskId: string): Promise<string>;
|
|
56
|
-
setTaskDoc?(taskId: string, doc: string, updatedBy?: string): Promise<void>;
|
|
57
|
-
touchTaskDocMetadata?(taskId: string, updatedBy?: string): Promise<void>;
|
|
58
|
-
sync?(opts: {
|
|
59
|
-
direction: "push" | "pull";
|
|
60
|
-
conflict: "diff" | "prefer-local" | "prefer-remote" | "fail";
|
|
61
|
-
quiet: boolean;
|
|
62
|
-
confirm: boolean;
|
|
63
|
-
}): Promise<void>;
|
|
64
|
-
generateTaskId?(opts: {
|
|
65
|
-
length: number;
|
|
66
|
-
attempts: number;
|
|
67
|
-
}): Promise<string>;
|
|
68
|
-
};
|
|
69
|
-
export declare class BackendError extends Error {
|
|
70
|
-
code: "E_BACKEND" | "E_NETWORK";
|
|
71
|
-
constructor(message: string, code: "E_BACKEND" | "E_NETWORK");
|
|
72
|
-
}
|
|
73
|
-
export declare class RedmineUnavailable extends BackendError {
|
|
74
|
-
constructor(message: string);
|
|
75
|
-
}
|
|
76
|
-
export declare function taskRecordToData(record: TaskRecord): TaskData;
|
|
77
|
-
export declare function buildTasksExportSnapshotFromTasks(tasks: TaskData[]): {
|
|
78
|
-
tasks: TaskData[];
|
|
79
|
-
meta: {
|
|
80
|
-
schema_version: 1;
|
|
81
|
-
managed_by: string;
|
|
82
|
-
checksum_algo: "sha256";
|
|
83
|
-
checksum: string;
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
export declare function writeTasksExportFromTasks(opts: {
|
|
87
|
-
outputPath: string;
|
|
88
|
-
tasks: TaskData[];
|
|
89
|
-
}): Promise<void>;
|
|
90
|
-
export declare class LocalBackend implements TaskBackend {
|
|
91
|
-
id: string;
|
|
92
|
-
root: string;
|
|
93
|
-
updatedBy: string;
|
|
94
|
-
constructor(settings?: {
|
|
95
|
-
dir?: string;
|
|
96
|
-
updatedBy?: string;
|
|
97
|
-
});
|
|
98
|
-
generateTaskId(opts: {
|
|
99
|
-
length: number;
|
|
100
|
-
attempts: number;
|
|
101
|
-
}): Promise<string>;
|
|
102
|
-
listTasks(): Promise<TaskData[]>;
|
|
103
|
-
getTask(taskId: string): Promise<TaskData | null>;
|
|
104
|
-
getTaskDoc(taskId: string): Promise<string>;
|
|
105
|
-
writeTask(task: TaskData): Promise<void>;
|
|
106
|
-
setTaskDoc(taskId: string, doc: string, updatedBy?: string): Promise<void>;
|
|
107
|
-
touchTaskDocMetadata(taskId: string, updatedBy?: string): Promise<void>;
|
|
108
|
-
writeTasks(tasks: TaskData[]): Promise<void>;
|
|
109
|
-
exportTasksJson(outputPath: string): Promise<void>;
|
|
110
|
-
}
|
|
111
|
-
type RedmineSettings = {
|
|
112
|
-
url?: string;
|
|
113
|
-
api_key?: string;
|
|
114
|
-
project_id?: string;
|
|
115
|
-
status_map?: Record<string, unknown>;
|
|
116
|
-
custom_fields?: Record<string, unknown>;
|
|
117
|
-
batch_size?: number;
|
|
118
|
-
batch_pause?: number;
|
|
119
|
-
owner_agent?: string;
|
|
120
|
-
cache_dir?: string;
|
|
121
|
-
};
|
|
122
|
-
export declare class RedmineBackend implements TaskBackend {
|
|
123
|
-
id: string;
|
|
124
|
-
baseUrl: string;
|
|
125
|
-
apiKey: string;
|
|
126
|
-
projectId: string;
|
|
127
|
-
assigneeId: number | null;
|
|
128
|
-
ownerAgent: string;
|
|
129
|
-
statusMap: Record<string, unknown>;
|
|
130
|
-
customFields: Record<string, unknown>;
|
|
131
|
-
batchSize: number;
|
|
132
|
-
batchPause: number;
|
|
133
|
-
cache: LocalBackend | null;
|
|
134
|
-
issueCache: Map<string, Record<string, unknown>>;
|
|
135
|
-
reverseStatus: Map<number, string>;
|
|
136
|
-
constructor(settings: RedmineSettings, opts: {
|
|
137
|
-
cache?: LocalBackend | null;
|
|
138
|
-
});
|
|
139
|
-
generateTaskId(opts: {
|
|
140
|
-
length: number;
|
|
141
|
-
attempts: number;
|
|
142
|
-
}): Promise<string>;
|
|
143
|
-
listTasks(): Promise<TaskData[]>;
|
|
144
|
-
exportTasksJson(outputPath: string): Promise<void>;
|
|
145
|
-
getTask(taskId: string): Promise<TaskData | null>;
|
|
146
|
-
getTaskDoc(taskId: string): Promise<string>;
|
|
147
|
-
setTaskDoc(taskId: string, doc: string, updatedBy?: string): Promise<void>;
|
|
148
|
-
touchTaskDocMetadata(taskId: string, updatedBy?: string): Promise<void>;
|
|
149
|
-
writeTask(task: TaskData): Promise<void>;
|
|
150
|
-
writeTasks(tasks: TaskData[]): Promise<void>;
|
|
151
|
-
sync(opts: {
|
|
152
|
-
direction: "push" | "pull";
|
|
153
|
-
conflict: "diff" | "prefer-local" | "prefer-remote" | "fail";
|
|
154
|
-
quiet: boolean;
|
|
155
|
-
confirm: boolean;
|
|
156
|
-
}): Promise<void>;
|
|
157
|
-
private ensureDocMetadata;
|
|
158
|
-
private syncPush;
|
|
159
|
-
private syncPull;
|
|
160
|
-
private handleConflict;
|
|
161
|
-
private diffTasks;
|
|
162
|
-
private tasksDiffer;
|
|
163
|
-
private cacheTask;
|
|
164
|
-
private taskIdFieldId;
|
|
165
|
-
private setIssueCustomFieldValue;
|
|
166
|
-
private listTasksRemote;
|
|
167
|
-
private issueFromPayload;
|
|
168
|
-
private findIssueByTaskId;
|
|
169
|
-
private issueToTask;
|
|
170
|
-
private taskToIssuePayload;
|
|
171
|
-
private appendCustomField;
|
|
172
|
-
private normalizeComments;
|
|
173
|
-
private commentsToPairs;
|
|
174
|
-
private formatCommentNote;
|
|
175
|
-
private appendCommentNotes;
|
|
176
|
-
private startDateFromTaskId;
|
|
177
|
-
private doneRatioForStatus;
|
|
178
|
-
private customFieldValue;
|
|
179
|
-
private maybeParseJson;
|
|
180
|
-
private coerceDocVersion;
|
|
181
|
-
private requestJson;
|
|
182
|
-
}
|
|
183
|
-
export declare function loadTaskBackend(opts: {
|
|
184
|
-
cwd: string;
|
|
185
|
-
rootOverride?: string | null;
|
|
186
|
-
}): Promise<{
|
|
187
|
-
backend: TaskBackend;
|
|
188
|
-
backendId: string;
|
|
189
|
-
resolved: ResolvedProject;
|
|
190
|
-
config: AgentplaneConfig;
|
|
191
|
-
backendConfigPath: string;
|
|
192
|
-
}>;
|
|
1
|
+
export { BackendError, RedmineUnavailable, buildTasksExportSnapshotFromTasks, extractTaskDoc, mergeTaskDoc, taskRecordToData, writeTasksExportFromTasks, type PlanApproval, type PlanApprovalState, type TaskBackend, type TaskData, type TaskEvent, type TaskEventType, type VerificationResult, type VerificationState, } from "./task-backend/shared.js";
|
|
2
|
+
export { LocalBackend } from "./task-backend/local-backend.js";
|
|
3
|
+
export { RedmineBackend } from "./task-backend/redmine-backend.js";
|
|
4
|
+
export { loadTaskBackend } from "./task-backend/load.js";
|
|
193
5
|
//# sourceMappingURL=task-backend.d.ts.map
|