@cleocode/cleo 2026.4.12 → 2026.4.14
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 +27 -0
- package/dist/cli/index.js +121925 -340
- package/dist/cli/index.js.map +7 -1
- package/package.json +7 -7
- package/dist/cli/commander-shim.d.ts +0 -112
- package/dist/cli/commander-shim.d.ts.map +0 -1
- package/dist/cli/commander-shim.js +0 -233
- package/dist/cli/commander-shim.js.map +0 -1
- package/dist/cli/commands/add.d.ts +0 -12
- package/dist/cli/commands/add.d.ts.map +0 -1
- package/dist/cli/commands/add.js +0 -202
- package/dist/cli/commands/add.js.map +0 -1
- package/dist/cli/commands/admin.d.ts +0 -12
- package/dist/cli/commands/admin.d.ts.map +0 -1
- package/dist/cli/commands/admin.js +0 -59
- package/dist/cli/commands/admin.js.map +0 -1
- package/dist/cli/commands/adr.d.ts +0 -27
- package/dist/cli/commands/adr.d.ts.map +0 -1
- package/dist/cli/commands/adr.js +0 -79
- package/dist/cli/commands/adr.js.map +0 -1
- package/dist/cli/commands/agent-profile-status.d.ts +0 -98
- package/dist/cli/commands/agent-profile-status.d.ts.map +0 -1
- package/dist/cli/commands/agent-profile-status.js +0 -71
- package/dist/cli/commands/agent-profile-status.js.map +0 -1
- package/dist/cli/commands/agent.d.ts +0 -38
- package/dist/cli/commands/agent.d.ts.map +0 -1
- package/dist/cli/commands/agent.js +0 -1169
- package/dist/cli/commands/agent.js.map +0 -1
- package/dist/cli/commands/agents.d.ts +0 -17
- package/dist/cli/commands/agents.d.ts.map +0 -1
- package/dist/cli/commands/agents.js +0 -20
- package/dist/cli/commands/agents.js.map +0 -1
- package/dist/cli/commands/analyze.d.ts +0 -12
- package/dist/cli/commands/analyze.d.ts.map +0 -1
- package/dist/cli/commands/analyze.js +0 -20
- package/dist/cli/commands/analyze.js.map +0 -1
- package/dist/cli/commands/archive-stats.d.ts +0 -18
- package/dist/cli/commands/archive-stats.d.ts.map +0 -1
- package/dist/cli/commands/archive-stats.js +0 -49
- package/dist/cli/commands/archive-stats.js.map +0 -1
- package/dist/cli/commands/archive.d.ts +0 -12
- package/dist/cli/commands/archive.d.ts.map +0 -1
- package/dist/cli/commands/archive.js +0 -32
- package/dist/cli/commands/archive.js.map +0 -1
- package/dist/cli/commands/backfill.d.ts +0 -38
- package/dist/cli/commands/backfill.d.ts.map +0 -1
- package/dist/cli/commands/backfill.js +0 -147
- package/dist/cli/commands/backfill.js.map +0 -1
- package/dist/cli/commands/backup.d.ts +0 -9
- package/dist/cli/commands/backup.d.ts.map +0 -1
- package/dist/cli/commands/backup.js +0 -41
- package/dist/cli/commands/backup.js.map +0 -1
- package/dist/cli/commands/blockers.d.ts +0 -7
- package/dist/cli/commands/blockers.d.ts.map +0 -1
- package/dist/cli/commands/blockers.js +0 -16
- package/dist/cli/commands/blockers.js.map +0 -1
- package/dist/cli/commands/brain.d.ts +0 -29
- package/dist/cli/commands/brain.d.ts.map +0 -1
- package/dist/cli/commands/brain.js +0 -107
- package/dist/cli/commands/brain.js.map +0 -1
- package/dist/cli/commands/briefing.d.ts +0 -22
- package/dist/cli/commands/briefing.d.ts.map +0 -1
- package/dist/cli/commands/briefing.js +0 -45
- package/dist/cli/commands/briefing.js.map +0 -1
- package/dist/cli/commands/bug.d.ts +0 -12
- package/dist/cli/commands/bug.d.ts.map +0 -1
- package/dist/cli/commands/bug.js +0 -81
- package/dist/cli/commands/bug.js.map +0 -1
- package/dist/cli/commands/cant.d.ts +0 -32
- package/dist/cli/commands/cant.d.ts.map +0 -1
- package/dist/cli/commands/cant.js +0 -281
- package/dist/cli/commands/cant.js.map +0 -1
- package/dist/cli/commands/check.d.ts +0 -22
- package/dist/cli/commands/check.d.ts.map +0 -1
- package/dist/cli/commands/check.js +0 -164
- package/dist/cli/commands/check.js.map +0 -1
- package/dist/cli/commands/checkpoint.d.ts +0 -15
- package/dist/cli/commands/checkpoint.d.ts.map +0 -1
- package/dist/cli/commands/checkpoint.js +0 -91
- package/dist/cli/commands/checkpoint.js.map +0 -1
- package/dist/cli/commands/code.d.ts +0 -11
- package/dist/cli/commands/code.d.ts.map +0 -1
- package/dist/cli/commands/code.js +0 -114
- package/dist/cli/commands/code.js.map +0 -1
- package/dist/cli/commands/commands.d.ts +0 -13
- package/dist/cli/commands/commands.d.ts.map +0 -1
- package/dist/cli/commands/commands.js +0 -29
- package/dist/cli/commands/commands.js.map +0 -1
- package/dist/cli/commands/complete.d.ts +0 -12
- package/dist/cli/commands/complete.d.ts.map +0 -1
- package/dist/cli/commands/complete.js +0 -92
- package/dist/cli/commands/complete.js.map +0 -1
- package/dist/cli/commands/compliance.d.ts +0 -8
- package/dist/cli/commands/compliance.d.ts.map +0 -1
- package/dist/cli/commands/compliance.js +0 -85
- package/dist/cli/commands/compliance.js.map +0 -1
- package/dist/cli/commands/config.d.ts +0 -10
- package/dist/cli/commands/config.d.ts.map +0 -1
- package/dist/cli/commands/config.js +0 -69
- package/dist/cli/commands/config.js.map +0 -1
- package/dist/cli/commands/consensus.d.ts +0 -13
- package/dist/cli/commands/consensus.d.ts.map +0 -1
- package/dist/cli/commands/consensus.js +0 -45
- package/dist/cli/commands/consensus.js.map +0 -1
- package/dist/cli/commands/context.d.ts +0 -8
- package/dist/cli/commands/context.d.ts.map +0 -1
- package/dist/cli/commands/context.js +0 -40
- package/dist/cli/commands/context.js.map +0 -1
- package/dist/cli/commands/contribution.d.ts +0 -13
- package/dist/cli/commands/contribution.d.ts.map +0 -1
- package/dist/cli/commands/contribution.js +0 -41
- package/dist/cli/commands/contribution.js.map +0 -1
- package/dist/cli/commands/current.d.ts +0 -13
- package/dist/cli/commands/current.d.ts.map +0 -1
- package/dist/cli/commands/current.js +0 -20
- package/dist/cli/commands/current.js.map +0 -1
- package/dist/cli/commands/dash.d.ts +0 -12
- package/dist/cli/commands/dash.d.ts.map +0 -1
- package/dist/cli/commands/dash.js +0 -24
- package/dist/cli/commands/dash.js.map +0 -1
- package/dist/cli/commands/decomposition.d.ts +0 -13
- package/dist/cli/commands/decomposition.d.ts.map +0 -1
- package/dist/cli/commands/decomposition.js +0 -45
- package/dist/cli/commands/decomposition.js.map +0 -1
- package/dist/cli/commands/delete.d.ts +0 -12
- package/dist/cli/commands/delete.d.ts.map +0 -1
- package/dist/cli/commands/delete.js +0 -37
- package/dist/cli/commands/delete.js.map +0 -1
- package/dist/cli/commands/deps.d.ts +0 -24
- package/dist/cli/commands/deps.d.ts.map +0 -1
- package/dist/cli/commands/deps.js +0 -98
- package/dist/cli/commands/deps.js.map +0 -1
- package/dist/cli/commands/detect-drift.d.ts +0 -15
- package/dist/cli/commands/detect-drift.d.ts.map +0 -1
- package/dist/cli/commands/detect-drift.js +0 -424
- package/dist/cli/commands/detect-drift.js.map +0 -1
- package/dist/cli/commands/detect.d.ts +0 -10
- package/dist/cli/commands/detect.d.ts.map +0 -1
- package/dist/cli/commands/detect.js +0 -24
- package/dist/cli/commands/detect.js.map +0 -1
- package/dist/cli/commands/docs.d.ts +0 -13
- package/dist/cli/commands/docs.d.ts.map +0 -1
- package/dist/cli/commands/docs.js +0 -169
- package/dist/cli/commands/docs.js.map +0 -1
- package/dist/cli/commands/doctor.d.ts +0 -15
- package/dist/cli/commands/doctor.d.ts.map +0 -1
- package/dist/cli/commands/doctor.js +0 -133
- package/dist/cli/commands/doctor.js.map +0 -1
- package/dist/cli/commands/dynamic.d.ts +0 -24
- package/dist/cli/commands/dynamic.d.ts.map +0 -1
- package/dist/cli/commands/dynamic.js +0 -27
- package/dist/cli/commands/dynamic.js.map +0 -1
- package/dist/cli/commands/env.d.ts +0 -12
- package/dist/cli/commands/env.d.ts.map +0 -1
- package/dist/cli/commands/env.js +0 -44
- package/dist/cli/commands/env.js.map +0 -1
- package/dist/cli/commands/exists.d.ts +0 -22
- package/dist/cli/commands/exists.d.ts.map +0 -1
- package/dist/cli/commands/exists.js +0 -51
- package/dist/cli/commands/exists.js.map +0 -1
- package/dist/cli/commands/export-tasks.d.ts +0 -10
- package/dist/cli/commands/export-tasks.d.ts.map +0 -1
- package/dist/cli/commands/export-tasks.js +0 -47
- package/dist/cli/commands/export-tasks.js.map +0 -1
- package/dist/cli/commands/export.d.ts +0 -9
- package/dist/cli/commands/export.d.ts.map +0 -1
- package/dist/cli/commands/export.js +0 -46
- package/dist/cli/commands/export.js.map +0 -1
- package/dist/cli/commands/find.d.ts +0 -14
- package/dist/cli/commands/find.d.ts.map +0 -1
- package/dist/cli/commands/find.js +0 -134
- package/dist/cli/commands/find.js.map +0 -1
- package/dist/cli/commands/generate-changelog.d.ts +0 -14
- package/dist/cli/commands/generate-changelog.d.ts.map +0 -1
- package/dist/cli/commands/generate-changelog.js +0 -252
- package/dist/cli/commands/generate-changelog.js.map +0 -1
- package/dist/cli/commands/grade.d.ts +0 -13
- package/dist/cli/commands/grade.d.ts.map +0 -1
- package/dist/cli/commands/grade.js +0 -26
- package/dist/cli/commands/grade.js.map +0 -1
- package/dist/cli/commands/history.d.ts +0 -9
- package/dist/cli/commands/history.d.ts.map +0 -1
- package/dist/cli/commands/history.js +0 -30
- package/dist/cli/commands/history.js.map +0 -1
- package/dist/cli/commands/implementation.d.ts +0 -13
- package/dist/cli/commands/implementation.d.ts.map +0 -1
- package/dist/cli/commands/implementation.js +0 -41
- package/dist/cli/commands/implementation.js.map +0 -1
- package/dist/cli/commands/import-tasks.d.ts +0 -10
- package/dist/cli/commands/import-tasks.d.ts.map +0 -1
- package/dist/cli/commands/import-tasks.js +0 -38
- package/dist/cli/commands/import-tasks.js.map +0 -1
- package/dist/cli/commands/import.d.ts +0 -9
- package/dist/cli/commands/import.d.ts.map +0 -1
- package/dist/cli/commands/import.js +0 -28
- package/dist/cli/commands/import.js.map +0 -1
- package/dist/cli/commands/init.d.ts +0 -34
- package/dist/cli/commands/init.d.ts.map +0 -1
- package/dist/cli/commands/init.js +0 -96
- package/dist/cli/commands/init.js.map +0 -1
- package/dist/cli/commands/inject.d.ts +0 -8
- package/dist/cli/commands/inject.d.ts.map +0 -1
- package/dist/cli/commands/inject.js +0 -28
- package/dist/cli/commands/inject.js.map +0 -1
- package/dist/cli/commands/issue.d.ts +0 -17
- package/dist/cli/commands/issue.d.ts.map +0 -1
- package/dist/cli/commands/issue.js +0 -107
- package/dist/cli/commands/issue.js.map +0 -1
- package/dist/cli/commands/labels.d.ts +0 -13
- package/dist/cli/commands/labels.d.ts.map +0 -1
- package/dist/cli/commands/labels.js +0 -44
- package/dist/cli/commands/labels.js.map +0 -1
- package/dist/cli/commands/lifecycle.d.ts +0 -8
- package/dist/cli/commands/lifecycle.d.ts.map +0 -1
- package/dist/cli/commands/lifecycle.js +0 -84
- package/dist/cli/commands/lifecycle.js.map +0 -1
- package/dist/cli/commands/list.d.ts +0 -14
- package/dist/cli/commands/list.d.ts.map +0 -1
- package/dist/cli/commands/list.js +0 -143
- package/dist/cli/commands/list.js.map +0 -1
- package/dist/cli/commands/log.d.ts +0 -12
- package/dist/cli/commands/log.d.ts.map +0 -1
- package/dist/cli/commands/log.js +0 -30
- package/dist/cli/commands/log.js.map +0 -1
- package/dist/cli/commands/map.d.ts +0 -10
- package/dist/cli/commands/map.d.ts.map +0 -1
- package/dist/cli/commands/map.js +0 -23
- package/dist/cli/commands/map.js.map +0 -1
- package/dist/cli/commands/memory-brain.d.ts +0 -14
- package/dist/cli/commands/memory-brain.d.ts.map +0 -1
- package/dist/cli/commands/memory-brain.js +0 -157
- package/dist/cli/commands/memory-brain.js.map +0 -1
- package/dist/cli/commands/migrate-claude-mem.d.ts +0 -18
- package/dist/cli/commands/migrate-claude-mem.d.ts.map +0 -1
- package/dist/cli/commands/migrate-claude-mem.js +0 -60
- package/dist/cli/commands/migrate-claude-mem.js.map +0 -1
- package/dist/cli/commands/next.d.ts +0 -9
- package/dist/cli/commands/next.d.ts.map +0 -1
- package/dist/cli/commands/next.js +0 -20
- package/dist/cli/commands/next.js.map +0 -1
- package/dist/cli/commands/nexus.d.ts +0 -16
- package/dist/cli/commands/nexus.d.ts.map +0 -1
- package/dist/cli/commands/nexus.js +0 -155
- package/dist/cli/commands/nexus.js.map +0 -1
- package/dist/cli/commands/observe.d.ts +0 -12
- package/dist/cli/commands/observe.d.ts.map +0 -1
- package/dist/cli/commands/observe.js +0 -42
- package/dist/cli/commands/observe.js.map +0 -1
- package/dist/cli/commands/ops.d.ts +0 -10
- package/dist/cli/commands/ops.d.ts.map +0 -1
- package/dist/cli/commands/ops.js +0 -19
- package/dist/cli/commands/ops.js.map +0 -1
- package/dist/cli/commands/orchestrate.d.ts +0 -8
- package/dist/cli/commands/orchestrate.d.ts.map +0 -1
- package/dist/cli/commands/orchestrate.js +0 -58
- package/dist/cli/commands/orchestrate.js.map +0 -1
- package/dist/cli/commands/otel.d.ts +0 -12
- package/dist/cli/commands/otel.d.ts.map +0 -1
- package/dist/cli/commands/otel.js +0 -128
- package/dist/cli/commands/otel.js.map +0 -1
- package/dist/cli/commands/phase.d.ts +0 -12
- package/dist/cli/commands/phase.d.ts.map +0 -1
- package/dist/cli/commands/phase.js +0 -91
- package/dist/cli/commands/phase.js.map +0 -1
- package/dist/cli/commands/phases.d.ts +0 -12
- package/dist/cli/commands/phases.d.ts.map +0 -1
- package/dist/cli/commands/phases.js +0 -37
- package/dist/cli/commands/phases.js.map +0 -1
- package/dist/cli/commands/plan.d.ts +0 -8
- package/dist/cli/commands/plan.d.ts.map +0 -1
- package/dist/cli/commands/plan.js +0 -15
- package/dist/cli/commands/plan.js.map +0 -1
- package/dist/cli/commands/promote.d.ts +0 -7
- package/dist/cli/commands/promote.d.ts.map +0 -1
- package/dist/cli/commands/promote.js +0 -15
- package/dist/cli/commands/promote.js.map +0 -1
- package/dist/cli/commands/reason.d.ts +0 -35
- package/dist/cli/commands/reason.d.ts.map +0 -1
- package/dist/cli/commands/reason.js +0 -104
- package/dist/cli/commands/reason.js.map +0 -1
- package/dist/cli/commands/refresh-memory.d.ts +0 -9
- package/dist/cli/commands/refresh-memory.d.ts.map +0 -1
- package/dist/cli/commands/refresh-memory.js +0 -24
- package/dist/cli/commands/refresh-memory.js.map +0 -1
- package/dist/cli/commands/relates.d.ts +0 -12
- package/dist/cli/commands/relates.d.ts.map +0 -1
- package/dist/cli/commands/relates.js +0 -53
- package/dist/cli/commands/relates.js.map +0 -1
- package/dist/cli/commands/release.d.ts +0 -8
- package/dist/cli/commands/release.d.ts.map +0 -1
- package/dist/cli/commands/release.js +0 -72
- package/dist/cli/commands/release.js.map +0 -1
- package/dist/cli/commands/remote.d.ts +0 -12
- package/dist/cli/commands/remote.d.ts.map +0 -1
- package/dist/cli/commands/remote.js +0 -207
- package/dist/cli/commands/remote.js.map +0 -1
- package/dist/cli/commands/reorder.d.ts +0 -7
- package/dist/cli/commands/reorder.d.ts.map +0 -1
- package/dist/cli/commands/reorder.js +0 -20
- package/dist/cli/commands/reorder.js.map +0 -1
- package/dist/cli/commands/reparent.d.ts +0 -10
- package/dist/cli/commands/reparent.d.ts.map +0 -1
- package/dist/cli/commands/reparent.js +0 -19
- package/dist/cli/commands/reparent.js.map +0 -1
- package/dist/cli/commands/research.d.ts +0 -8
- package/dist/cli/commands/research.d.ts.map +0 -1
- package/dist/cli/commands/research.js +0 -129
- package/dist/cli/commands/research.js.map +0 -1
- package/dist/cli/commands/restore.d.ts +0 -12
- package/dist/cli/commands/restore.d.ts.map +0 -1
- package/dist/cli/commands/restore.js +0 -228
- package/dist/cli/commands/restore.js.map +0 -1
- package/dist/cli/commands/roadmap.d.ts +0 -8
- package/dist/cli/commands/roadmap.d.ts.map +0 -1
- package/dist/cli/commands/roadmap.js +0 -21
- package/dist/cli/commands/roadmap.js.map +0 -1
- package/dist/cli/commands/safestop.d.ts +0 -14
- package/dist/cli/commands/safestop.d.ts.map +0 -1
- package/dist/cli/commands/safestop.js +0 -32
- package/dist/cli/commands/safestop.js.map +0 -1
- package/dist/cli/commands/schema.d.ts +0 -27
- package/dist/cli/commands/schema.d.ts.map +0 -1
- package/dist/cli/commands/schema.js +0 -160
- package/dist/cli/commands/schema.js.map +0 -1
- package/dist/cli/commands/self-update.d.ts +0 -15
- package/dist/cli/commands/self-update.d.ts.map +0 -1
- package/dist/cli/commands/self-update.js +0 -329
- package/dist/cli/commands/self-update.js.map +0 -1
- package/dist/cli/commands/sequence.d.ts +0 -8
- package/dist/cli/commands/sequence.d.ts.map +0 -1
- package/dist/cli/commands/sequence.js +0 -30
- package/dist/cli/commands/sequence.js.map +0 -1
- package/dist/cli/commands/session.d.ts +0 -12
- package/dist/cli/commands/session.d.ts.map +0 -1
- package/dist/cli/commands/session.js +0 -175
- package/dist/cli/commands/session.js.map +0 -1
- package/dist/cli/commands/show.d.ts +0 -13
- package/dist/cli/commands/show.d.ts.map +0 -1
- package/dist/cli/commands/show.js +0 -40
- package/dist/cli/commands/show.js.map +0 -1
- package/dist/cli/commands/skills.d.ts +0 -13
- package/dist/cli/commands/skills.d.ts.map +0 -1
- package/dist/cli/commands/skills.js +0 -131
- package/dist/cli/commands/skills.js.map +0 -1
- package/dist/cli/commands/snapshot.d.ts +0 -9
- package/dist/cli/commands/snapshot.d.ts.map +0 -1
- package/dist/cli/commands/snapshot.js +0 -50
- package/dist/cli/commands/snapshot.js.map +0 -1
- package/dist/cli/commands/specification.d.ts +0 -13
- package/dist/cli/commands/specification.d.ts.map +0 -1
- package/dist/cli/commands/specification.js +0 -45
- package/dist/cli/commands/specification.js.map +0 -1
- package/dist/cli/commands/start.d.ts +0 -13
- package/dist/cli/commands/start.d.ts.map +0 -1
- package/dist/cli/commands/start.js +0 -20
- package/dist/cli/commands/start.js.map +0 -1
- package/dist/cli/commands/stats.d.ts +0 -12
- package/dist/cli/commands/stats.d.ts.map +0 -1
- package/dist/cli/commands/stats.js +0 -35
- package/dist/cli/commands/stats.js.map +0 -1
- package/dist/cli/commands/sticky.d.ts +0 -16
- package/dist/cli/commands/sticky.d.ts.map +0 -1
- package/dist/cli/commands/sticky.js +0 -211
- package/dist/cli/commands/sticky.js.map +0 -1
- package/dist/cli/commands/stop.d.ts +0 -13
- package/dist/cli/commands/stop.d.ts.map +0 -1
- package/dist/cli/commands/stop.js +0 -20
- package/dist/cli/commands/stop.js.map +0 -1
- package/dist/cli/commands/testing.d.ts +0 -13
- package/dist/cli/commands/testing.d.ts.map +0 -1
- package/dist/cli/commands/testing.js +0 -64
- package/dist/cli/commands/testing.js.map +0 -1
- package/dist/cli/commands/token.d.ts +0 -10
- package/dist/cli/commands/token.d.ts.map +0 -1
- package/dist/cli/commands/token.js +0 -135
- package/dist/cli/commands/token.js.map +0 -1
- package/dist/cli/commands/update.d.ts +0 -12
- package/dist/cli/commands/update.d.ts.map +0 -1
- package/dist/cli/commands/update.js +0 -83
- package/dist/cli/commands/update.js.map +0 -1
- package/dist/cli/commands/upgrade.d.ts +0 -18
- package/dist/cli/commands/upgrade.d.ts.map +0 -1
- package/dist/cli/commands/upgrade.js +0 -103
- package/dist/cli/commands/upgrade.js.map +0 -1
- package/dist/cli/commands/validate.d.ts +0 -12
- package/dist/cli/commands/validate.d.ts.map +0 -1
- package/dist/cli/commands/validate.js +0 -23
- package/dist/cli/commands/validate.js.map +0 -1
- package/dist/cli/commands/verify.d.ts +0 -8
- package/dist/cli/commands/verify.d.ts.map +0 -1
- package/dist/cli/commands/verify.js +0 -28
- package/dist/cli/commands/verify.js.map +0 -1
- package/dist/cli/commands/web.d.ts +0 -13
- package/dist/cli/commands/web.d.ts.map +0 -1
- package/dist/cli/commands/web.js +0 -277
- package/dist/cli/commands/web.js.map +0 -1
- package/dist/cli/field-context.d.ts +0 -32
- package/dist/cli/field-context.d.ts.map +0 -1
- package/dist/cli/field-context.js +0 -47
- package/dist/cli/field-context.js.map +0 -1
- package/dist/cli/format-context.d.ts +0 -32
- package/dist/cli/format-context.d.ts.map +0 -1
- package/dist/cli/format-context.js +0 -50
- package/dist/cli/format-context.js.map +0 -1
- package/dist/cli/help-generator.d.ts +0 -74
- package/dist/cli/help-generator.d.ts.map +0 -1
- package/dist/cli/help-generator.js +0 -229
- package/dist/cli/help-generator.js.map +0 -1
- package/dist/cli/index.d.ts +0 -9
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/logger-bootstrap.d.ts +0 -6
- package/dist/cli/logger-bootstrap.d.ts.map +0 -1
- package/dist/cli/logger-bootstrap.js +0 -10
- package/dist/cli/logger-bootstrap.js.map +0 -1
- package/dist/cli/middleware/output-format.d.ts +0 -30
- package/dist/cli/middleware/output-format.d.ts.map +0 -1
- package/dist/cli/middleware/output-format.js +0 -35
- package/dist/cli/middleware/output-format.js.map +0 -1
- package/dist/cli/progress.d.ts +0 -84
- package/dist/cli/progress.d.ts.map +0 -1
- package/dist/cli/progress.js +0 -169
- package/dist/cli/progress.js.map +0 -1
- package/dist/cli/renderers/colors.d.ts +0 -32
- package/dist/cli/renderers/colors.d.ts.map +0 -1
- package/dist/cli/renderers/colors.js +0 -141
- package/dist/cli/renderers/colors.js.map +0 -1
- package/dist/cli/renderers/error.d.ts +0 -13
- package/dist/cli/renderers/error.d.ts.map +0 -1
- package/dist/cli/renderers/error.js +0 -42
- package/dist/cli/renderers/error.js.map +0 -1
- package/dist/cli/renderers/index.d.ts +0 -87
- package/dist/cli/renderers/index.d.ts.map +0 -1
- package/dist/cli/renderers/index.js +0 -262
- package/dist/cli/renderers/index.js.map +0 -1
- package/dist/cli/renderers/lafs-validator.d.ts +0 -91
- package/dist/cli/renderers/lafs-validator.d.ts.map +0 -1
- package/dist/cli/renderers/lafs-validator.js +0 -176
- package/dist/cli/renderers/lafs-validator.js.map +0 -1
- package/dist/cli/renderers/normalizer.d.ts +0 -21
- package/dist/cli/renderers/normalizer.d.ts.map +0 -1
- package/dist/cli/renderers/normalizer.js +0 -106
- package/dist/cli/renderers/normalizer.js.map +0 -1
- package/dist/cli/renderers/system.d.ts +0 -25
- package/dist/cli/renderers/system.d.ts.map +0 -1
- package/dist/cli/renderers/system.js +0 -416
- package/dist/cli/renderers/system.js.map +0 -1
- package/dist/cli/renderers/tasks.d.ts +0 -28
- package/dist/cli/renderers/tasks.d.ts.map +0 -1
- package/dist/cli/renderers/tasks.js +0 -306
- package/dist/cli/renderers/tasks.js.map +0 -1
- package/dist/dispatch/adapters/cli.d.ts +0 -67
- package/dist/dispatch/adapters/cli.d.ts.map +0 -1
- package/dist/dispatch/adapters/cli.js +0 -276
- package/dist/dispatch/adapters/cli.js.map +0 -1
- package/dist/dispatch/context/session-context.d.ts +0 -54
- package/dist/dispatch/context/session-context.d.ts.map +0 -1
- package/dist/dispatch/context/session-context.js +0 -61
- package/dist/dispatch/context/session-context.js.map +0 -1
- package/dist/dispatch/dispatcher.d.ts +0 -23
- package/dist/dispatch/dispatcher.d.ts.map +0 -1
- package/dist/dispatch/dispatcher.js +0 -84
- package/dist/dispatch/dispatcher.js.map +0 -1
- package/dist/dispatch/domains/_base.d.ts +0 -59
- package/dist/dispatch/domains/_base.d.ts.map +0 -1
- package/dist/dispatch/domains/_base.js +0 -77
- package/dist/dispatch/domains/_base.js.map +0 -1
- package/dist/dispatch/domains/_meta.d.ts +0 -23
- package/dist/dispatch/domains/_meta.d.ts.map +0 -1
- package/dist/dispatch/domains/_meta.js +0 -25
- package/dist/dispatch/domains/_meta.js.map +0 -1
- package/dist/dispatch/domains/_routing.d.ts +0 -8
- package/dist/dispatch/domains/_routing.d.ts.map +0 -1
- package/dist/dispatch/domains/_routing.js +0 -20
- package/dist/dispatch/domains/_routing.js.map +0 -1
- package/dist/dispatch/domains/admin.d.ts +0 -25
- package/dist/dispatch/domains/admin.d.ts.map +0 -1
- package/dist/dispatch/domains/admin.js +0 -719
- package/dist/dispatch/domains/admin.js.map +0 -1
- package/dist/dispatch/domains/check.d.ts +0 -22
- package/dist/dispatch/domains/check.d.ts.map +0 -1
- package/dist/dispatch/domains/check.js +0 -360
- package/dist/dispatch/domains/check.js.map +0 -1
- package/dist/dispatch/domains/conduit.d.ts +0 -38
- package/dist/dispatch/domains/conduit.d.ts.map +0 -1
- package/dist/dispatch/domains/conduit.js +0 -247
- package/dist/dispatch/domains/conduit.js.map +0 -1
- package/dist/dispatch/domains/index.d.ts +0 -27
- package/dist/dispatch/domains/index.d.ts.map +0 -1
- package/dist/dispatch/domains/index.js +0 -40
- package/dist/dispatch/domains/index.js.map +0 -1
- package/dist/dispatch/domains/memory.d.ts +0 -22
- package/dist/dispatch/domains/memory.d.ts.map +0 -1
- package/dist/dispatch/domains/memory.js +0 -303
- package/dist/dispatch/domains/memory.js.map +0 -1
- package/dist/dispatch/domains/nexus.d.ts +0 -22
- package/dist/dispatch/domains/nexus.d.ts.map +0 -1
- package/dist/dispatch/domains/nexus.js +0 -286
- package/dist/dispatch/domains/nexus.js.map +0 -1
- package/dist/dispatch/domains/orchestrate.d.ts +0 -19
- package/dist/dispatch/domains/orchestrate.d.ts.map +0 -1
- package/dist/dispatch/domains/orchestrate.js +0 -259
- package/dist/dispatch/domains/orchestrate.js.map +0 -1
- package/dist/dispatch/domains/pipeline.d.ts +0 -35
- package/dist/dispatch/domains/pipeline.d.ts.map +0 -1
- package/dist/dispatch/domains/pipeline.js +0 -593
- package/dist/dispatch/domains/pipeline.js.map +0 -1
- package/dist/dispatch/domains/session.d.ts +0 -22
- package/dist/dispatch/domains/session.d.ts.map +0 -1
- package/dist/dispatch/domains/session.js +0 -257
- package/dist/dispatch/domains/session.js.map +0 -1
- package/dist/dispatch/domains/sticky.d.ts +0 -20
- package/dist/dispatch/domains/sticky.d.ts.map +0 -1
- package/dist/dispatch/domains/sticky.js +0 -164
- package/dist/dispatch/domains/sticky.js.map +0 -1
- package/dist/dispatch/domains/tasks.d.ts +0 -25
- package/dist/dispatch/domains/tasks.d.ts.map +0 -1
- package/dist/dispatch/domains/tasks.js +0 -361
- package/dist/dispatch/domains/tasks.js.map +0 -1
- package/dist/dispatch/domains/tools.d.ts +0 -37
- package/dist/dispatch/domains/tools.d.ts.map +0 -1
- package/dist/dispatch/domains/tools.js +0 -481
- package/dist/dispatch/domains/tools.js.map +0 -1
- package/dist/dispatch/engines/_error.d.ts +0 -119
- package/dist/dispatch/engines/_error.d.ts.map +0 -1
- package/dist/dispatch/engines/_error.js +0 -288
- package/dist/dispatch/engines/_error.js.map +0 -1
- package/dist/dispatch/engines/code-engine.d.ts +0 -18
- package/dist/dispatch/engines/code-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/code-engine.js +0 -71
- package/dist/dispatch/engines/code-engine.js.map +0 -1
- package/dist/dispatch/engines/codebase-map-engine.d.ts +0 -31
- package/dist/dispatch/engines/codebase-map-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/codebase-map-engine.js +0 -43
- package/dist/dispatch/engines/codebase-map-engine.js.map +0 -1
- package/dist/dispatch/engines/config-engine.d.ts +0 -32
- package/dist/dispatch/engines/config-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/config-engine.js +0 -70
- package/dist/dispatch/engines/config-engine.js.map +0 -1
- package/dist/dispatch/engines/hooks-engine.d.ts +0 -96
- package/dist/dispatch/engines/hooks-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/hooks-engine.js +0 -144
- package/dist/dispatch/engines/hooks-engine.js.map +0 -1
- package/dist/dispatch/engines/init-engine.d.ts +0 -56
- package/dist/dispatch/engines/init-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/init-engine.js +0 -78
- package/dist/dispatch/engines/init-engine.js.map +0 -1
- package/dist/dispatch/engines/lifecycle-engine.d.ts +0 -66
- package/dist/dispatch/engines/lifecycle-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/lifecycle-engine.js +0 -224
- package/dist/dispatch/engines/lifecycle-engine.js.map +0 -1
- package/dist/dispatch/engines/memory-engine.d.ts +0 -10
- package/dist/dispatch/engines/memory-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/memory-engine.js +0 -10
- package/dist/dispatch/engines/memory-engine.js.map +0 -1
- package/dist/dispatch/engines/nexus-engine.d.ts +0 -167
- package/dist/dispatch/engines/nexus-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/nexus-engine.js +0 -356
- package/dist/dispatch/engines/nexus-engine.js.map +0 -1
- package/dist/dispatch/engines/orchestrate-engine.d.ts +0 -133
- package/dist/dispatch/engines/orchestrate-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/orchestrate-engine.js +0 -769
- package/dist/dispatch/engines/orchestrate-engine.js.map +0 -1
- package/dist/dispatch/engines/pipeline-engine.d.ts +0 -51
- package/dist/dispatch/engines/pipeline-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/pipeline-engine.js +0 -191
- package/dist/dispatch/engines/pipeline-engine.js.map +0 -1
- package/dist/dispatch/engines/release-engine.d.ts +0 -94
- package/dist/dispatch/engines/release-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/release-engine.js +0 -763
- package/dist/dispatch/engines/release-engine.js.map +0 -1
- package/dist/dispatch/engines/session-engine.d.ts +0 -383
- package/dist/dispatch/engines/session-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/session-engine.js +0 -910
- package/dist/dispatch/engines/session-engine.js.map +0 -1
- package/dist/dispatch/engines/sticky-engine.d.ts +0 -100
- package/dist/dispatch/engines/sticky-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/sticky-engine.js +0 -181
- package/dist/dispatch/engines/sticky-engine.js.map +0 -1
- package/dist/dispatch/engines/system-engine.d.ts +0 -539
- package/dist/dispatch/engines/system-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/system-engine.js +0 -1258
- package/dist/dispatch/engines/system-engine.js.map +0 -1
- package/dist/dispatch/engines/task-engine.d.ts +0 -1055
- package/dist/dispatch/engines/task-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/task-engine.js +0 -1193
- package/dist/dispatch/engines/task-engine.js.map +0 -1
- package/dist/dispatch/engines/template-parser.d.ts +0 -85
- package/dist/dispatch/engines/template-parser.d.ts.map +0 -1
- package/dist/dispatch/engines/template-parser.js +0 -108
- package/dist/dispatch/engines/template-parser.js.map +0 -1
- package/dist/dispatch/engines/tools-engine.d.ts +0 -270
- package/dist/dispatch/engines/tools-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/tools-engine.js +0 -636
- package/dist/dispatch/engines/tools-engine.js.map +0 -1
- package/dist/dispatch/engines/validate-engine.d.ts +0 -218
- package/dist/dispatch/engines/validate-engine.d.ts.map +0 -1
- package/dist/dispatch/engines/validate-engine.js +0 -737
- package/dist/dispatch/engines/validate-engine.js.map +0 -1
- package/dist/dispatch/index.d.ts +0 -20
- package/dist/dispatch/index.d.ts.map +0 -1
- package/dist/dispatch/index.js +0 -19
- package/dist/dispatch/index.js.map +0 -1
- package/dist/dispatch/lib/background-jobs.d.ts +0 -86
- package/dist/dispatch/lib/background-jobs.d.ts.map +0 -1
- package/dist/dispatch/lib/background-jobs.js +0 -183
- package/dist/dispatch/lib/background-jobs.js.map +0 -1
- package/dist/dispatch/lib/budget.d.ts +0 -36
- package/dist/dispatch/lib/budget.d.ts.map +0 -1
- package/dist/dispatch/lib/budget.js +0 -109
- package/dist/dispatch/lib/budget.js.map +0 -1
- package/dist/dispatch/lib/capability-matrix.d.ts +0 -11
- package/dist/dispatch/lib/capability-matrix.d.ts.map +0 -1
- package/dist/dispatch/lib/capability-matrix.js +0 -10
- package/dist/dispatch/lib/capability-matrix.js.map +0 -1
- package/dist/dispatch/lib/config-loader.d.ts +0 -42
- package/dist/dispatch/lib/config-loader.d.ts.map +0 -1
- package/dist/dispatch/lib/config-loader.js +0 -217
- package/dist/dispatch/lib/config-loader.js.map +0 -1
- package/dist/dispatch/lib/config.d.ts +0 -11
- package/dist/dispatch/lib/config.d.ts.map +0 -1
- package/dist/dispatch/lib/config.js +0 -10
- package/dist/dispatch/lib/config.js.map +0 -1
- package/dist/dispatch/lib/defaults.d.ts +0 -115
- package/dist/dispatch/lib/defaults.d.ts.map +0 -1
- package/dist/dispatch/lib/defaults.js +0 -61
- package/dist/dispatch/lib/defaults.js.map +0 -1
- package/dist/dispatch/lib/engine.d.ts +0 -26
- package/dist/dispatch/lib/engine.d.ts.map +0 -1
- package/dist/dispatch/lib/engine.js +0 -46
- package/dist/dispatch/lib/engine.js.map +0 -1
- package/dist/dispatch/lib/exit-codes.d.ts +0 -35
- package/dist/dispatch/lib/exit-codes.d.ts.map +0 -1
- package/dist/dispatch/lib/exit-codes.js +0 -60
- package/dist/dispatch/lib/exit-codes.js.map +0 -1
- package/dist/dispatch/lib/gateway-meta.d.ts +0 -37
- package/dist/dispatch/lib/gateway-meta.d.ts.map +0 -1
- package/dist/dispatch/lib/gateway-meta.js +0 -50
- package/dist/dispatch/lib/gateway-meta.js.map +0 -1
- package/dist/dispatch/lib/job-manager-accessor.d.ts +0 -9
- package/dist/dispatch/lib/job-manager-accessor.d.ts.map +0 -1
- package/dist/dispatch/lib/job-manager-accessor.js +0 -13
- package/dist/dispatch/lib/job-manager-accessor.js.map +0 -1
- package/dist/dispatch/lib/meta.d.ts +0 -26
- package/dist/dispatch/lib/meta.d.ts.map +0 -1
- package/dist/dispatch/lib/meta.js +0 -37
- package/dist/dispatch/lib/meta.js.map +0 -1
- package/dist/dispatch/lib/param-utils.d.ts +0 -11
- package/dist/dispatch/lib/param-utils.d.ts.map +0 -1
- package/dist/dispatch/lib/param-utils.js +0 -10
- package/dist/dispatch/lib/param-utils.js.map +0 -1
- package/dist/dispatch/lib/projections.d.ts +0 -56
- package/dist/dispatch/lib/projections.d.ts.map +0 -1
- package/dist/dispatch/lib/projections.js +0 -65
- package/dist/dispatch/lib/projections.js.map +0 -1
- package/dist/dispatch/lib/proto-envelope.d.ts +0 -56
- package/dist/dispatch/lib/proto-envelope.d.ts.map +0 -1
- package/dist/dispatch/lib/proto-envelope.js +0 -17
- package/dist/dispatch/lib/proto-envelope.js.map +0 -1
- package/dist/dispatch/lib/schema-utils.d.ts +0 -39
- package/dist/dispatch/lib/schema-utils.d.ts.map +0 -1
- package/dist/dispatch/lib/schema-utils.js +0 -88
- package/dist/dispatch/lib/schema-utils.js.map +0 -1
- package/dist/dispatch/lib/security.d.ts +0 -11
- package/dist/dispatch/lib/security.d.ts.map +0 -1
- package/dist/dispatch/lib/security.js +0 -10
- package/dist/dispatch/lib/security.js.map +0 -1
- package/dist/dispatch/middleware/audit.d.ts +0 -23
- package/dist/dispatch/middleware/audit.d.ts.map +0 -1
- package/dist/dispatch/middleware/audit.js +0 -169
- package/dist/dispatch/middleware/audit.js.map +0 -1
- package/dist/dispatch/middleware/field-filter.d.ts +0 -25
- package/dist/dispatch/middleware/field-filter.d.ts.map +0 -1
- package/dist/dispatch/middleware/field-filter.js +0 -70
- package/dist/dispatch/middleware/field-filter.js.map +0 -1
- package/dist/dispatch/middleware/pipeline.d.ts +0 -33
- package/dist/dispatch/middleware/pipeline.d.ts.map +0 -1
- package/dist/dispatch/middleware/pipeline.js +0 -60
- package/dist/dispatch/middleware/pipeline.js.map +0 -1
- package/dist/dispatch/middleware/projection.d.ts +0 -35
- package/dist/dispatch/middleware/projection.d.ts.map +0 -1
- package/dist/dispatch/middleware/projection.js +0 -146
- package/dist/dispatch/middleware/projection.js.map +0 -1
- package/dist/dispatch/middleware/protocol-enforcement.d.ts +0 -30
- package/dist/dispatch/middleware/protocol-enforcement.d.ts.map +0 -1
- package/dist/dispatch/middleware/protocol-enforcement.js +0 -56
- package/dist/dispatch/middleware/protocol-enforcement.js.map +0 -1
- package/dist/dispatch/middleware/rate-limiter.d.ts +0 -72
- package/dist/dispatch/middleware/rate-limiter.d.ts.map +0 -1
- package/dist/dispatch/middleware/rate-limiter.js +0 -127
- package/dist/dispatch/middleware/rate-limiter.js.map +0 -1
- package/dist/dispatch/middleware/sanitizer.d.ts +0 -24
- package/dist/dispatch/middleware/sanitizer.d.ts.map +0 -1
- package/dist/dispatch/middleware/sanitizer.js +0 -56
- package/dist/dispatch/middleware/sanitizer.js.map +0 -1
- package/dist/dispatch/middleware/session-resolver.d.ts +0 -26
- package/dist/dispatch/middleware/session-resolver.d.ts.map +0 -1
- package/dist/dispatch/middleware/session-resolver.js +0 -65
- package/dist/dispatch/middleware/session-resolver.js.map +0 -1
- package/dist/dispatch/middleware/verification-gates.d.ts +0 -22
- package/dist/dispatch/middleware/verification-gates.d.ts.map +0 -1
- package/dist/dispatch/middleware/verification-gates.js +0 -59
- package/dist/dispatch/middleware/verification-gates.js.map +0 -1
- package/dist/dispatch/registry.d.ts +0 -91
- package/dist/dispatch/registry.d.ts.map +0 -1
- package/dist/dispatch/registry.js +0 -3133
- package/dist/dispatch/registry.js.map +0 -1
- package/dist/dispatch/types.d.ts +0 -206
- package/dist/dispatch/types.d.ts.map +0 -1
- package/dist/dispatch/types.js +0 -26
- package/dist/dispatch/types.js.map +0 -1
|
@@ -1,1193 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Task Engine
|
|
3
|
-
*
|
|
4
|
-
* Native TypeScript implementation of core task CRUD operations.
|
|
5
|
-
* Uses StoreProvider (via getStore()) for task/session data access,
|
|
6
|
-
* falling back to direct JSON for config and specialized operations.
|
|
7
|
-
*
|
|
8
|
-
* CRUD operations (show, list, find, exists, create, update, complete, delete, archive)
|
|
9
|
-
* delegate to src/core/tasks/*.
|
|
10
|
-
*
|
|
11
|
-
* Non-CRUD operations delegate to src/core/tasks/task-ops.ts.
|
|
12
|
-
*
|
|
13
|
-
* @task T4657
|
|
14
|
-
* @task T4790
|
|
15
|
-
* @epic T4654
|
|
16
|
-
*/
|
|
17
|
-
// validation-rules.js still used by other engines; core modules handle their own validation
|
|
18
|
-
// Core module imports for accessor-based operations
|
|
19
|
-
import { addTask as coreAddTask, archiveTasks as coreArchiveTasks, completeTask as coreCompleteTask, deleteTask as coreDeleteTask, findTasks as coreFindTasks, listTasks as coreListTasks, showTask as coreShowTask, coreTaskAnalyze, coreTaskBatchValidate, coreTaskBlockers, coreTaskCancel, coreTaskComplexityEstimate, coreTaskDepends, coreTaskDeps, coreTaskDepsCycles, coreTaskDepsOverview, coreTaskExport, coreTaskHistory, coreTaskImport, coreTaskLint, coreTaskNext, coreTaskPromote, coreTaskRelates, coreTaskRelatesAdd, coreTaskReopen, coreTaskReorder, coreTaskReparent, coreTaskRestore, coreTaskStats, coreTaskTree, coreTaskUnarchive, updateTask as coreUpdateTask, getAccessor, predictImpact, toCompact, } from '@cleocode/core/internal';
|
|
20
|
-
import { cleoErrorToEngineError, engineError } from './_error.js';
|
|
21
|
-
/**
|
|
22
|
-
* Convert a core Task to a TaskRecord for backward compatibility.
|
|
23
|
-
* TaskRecord has string-typed status/priority; Task has union types.
|
|
24
|
-
*
|
|
25
|
-
* @task T4657
|
|
26
|
-
* @epic T4654
|
|
27
|
-
*/
|
|
28
|
-
function taskToRecord(task) {
|
|
29
|
-
// Task union-typed fields (status, priority, origin, etc.) widen to string in TaskRecord.
|
|
30
|
-
// Some fields have structural mismatches (blockedBy: string vs string[], etc.)
|
|
31
|
-
// so we explicitly map each field rather than relying on spread.
|
|
32
|
-
return {
|
|
33
|
-
id: task.id,
|
|
34
|
-
title: task.title,
|
|
35
|
-
description: task.description ?? '',
|
|
36
|
-
status: task.status,
|
|
37
|
-
priority: task.priority,
|
|
38
|
-
type: task.type,
|
|
39
|
-
phase: task.phase,
|
|
40
|
-
createdAt: task.createdAt,
|
|
41
|
-
updatedAt: task.updatedAt ?? null,
|
|
42
|
-
completedAt: task.completedAt ?? null,
|
|
43
|
-
cancelledAt: task.cancelledAt ?? null,
|
|
44
|
-
parentId: task.parentId,
|
|
45
|
-
position: task.position,
|
|
46
|
-
positionVersion: task.positionVersion,
|
|
47
|
-
depends: task.depends,
|
|
48
|
-
relates: task.relates,
|
|
49
|
-
files: task.files,
|
|
50
|
-
acceptance: task.acceptance,
|
|
51
|
-
notes: task.notes,
|
|
52
|
-
labels: task.labels,
|
|
53
|
-
size: task.size ?? null,
|
|
54
|
-
epicLifecycle: task.epicLifecycle ?? null,
|
|
55
|
-
noAutoComplete: task.noAutoComplete ?? null,
|
|
56
|
-
verification: task.verification ? { ...task.verification } : null,
|
|
57
|
-
origin: task.origin ?? null,
|
|
58
|
-
cancellationReason: task.cancellationReason,
|
|
59
|
-
blockedBy: task.blockedBy ? [task.blockedBy] : undefined,
|
|
60
|
-
pipelineStage: task.pipelineStage ?? null,
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Convert an array of core Tasks to TaskRecords.
|
|
65
|
-
*
|
|
66
|
-
* @task T4657
|
|
67
|
-
* @epic T4654
|
|
68
|
-
*/
|
|
69
|
-
function tasksToRecords(tasks) {
|
|
70
|
-
return tasks.map(taskToRecord);
|
|
71
|
-
}
|
|
72
|
-
// loadTaskFile and saveTaskFile removed — all operations now use DataAccessor.
|
|
73
|
-
// Config reads (hierarchy limits, phase meta) still use readJsonFile directly
|
|
74
|
-
// since they are NOT domain data (they don't go through the accessor).
|
|
75
|
-
// Priority normalization moved to core/tasks/add.ts (normalizePriority)
|
|
76
|
-
// ===== Query Operations =====
|
|
77
|
-
/**
|
|
78
|
-
* Get a single task by ID.
|
|
79
|
-
*
|
|
80
|
-
* @remarks
|
|
81
|
-
* Fetches the full task record from the data accessor and converts it
|
|
82
|
-
* to the backward-compatible TaskRecord format.
|
|
83
|
-
*
|
|
84
|
-
* @param projectRoot - Absolute path to the project root
|
|
85
|
-
* @param taskId - Task identifier (e.g. "T001")
|
|
86
|
-
* @returns EngineResult containing the task record
|
|
87
|
-
*
|
|
88
|
-
* @example
|
|
89
|
-
* ```typescript
|
|
90
|
-
* const result = await taskShow('/project', 'T42');
|
|
91
|
-
* if (result.success) console.log(result.data.task.title);
|
|
92
|
-
* ```
|
|
93
|
-
*
|
|
94
|
-
* @task T4657
|
|
95
|
-
* @epic T4654
|
|
96
|
-
*/
|
|
97
|
-
export async function taskShow(projectRoot, taskId) {
|
|
98
|
-
try {
|
|
99
|
-
const accessor = await getAccessor(projectRoot);
|
|
100
|
-
const detail = await coreShowTask(taskId, projectRoot, accessor);
|
|
101
|
-
return { success: true, data: { task: taskToRecord(detail) } };
|
|
102
|
-
}
|
|
103
|
-
catch (err) {
|
|
104
|
-
return cleoErrorToEngineError(err, 'E_NOT_INITIALIZED', 'Task database not initialized');
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* List tasks with optional filters.
|
|
109
|
-
*
|
|
110
|
-
* @remarks
|
|
111
|
-
* Supports filtering by parent, status, priority, type, phase, and label.
|
|
112
|
-
* When `compact` is true, returns lightweight CompactTask records.
|
|
113
|
-
* Results are paginated via `limit` and `offset` parameters.
|
|
114
|
-
*
|
|
115
|
-
* @param projectRoot - Absolute path to the project root
|
|
116
|
-
* @param params - Optional filter, pagination, and format parameters
|
|
117
|
-
* @returns EngineResult with task array, total count, and filtered count
|
|
118
|
-
*
|
|
119
|
-
* @example
|
|
120
|
-
* ```typescript
|
|
121
|
-
* const result = await taskList('/project', { status: 'active', limit: 10 });
|
|
122
|
-
* ```
|
|
123
|
-
*
|
|
124
|
-
* @task T4657
|
|
125
|
-
* @epic T4654
|
|
126
|
-
*/
|
|
127
|
-
export async function taskList(projectRoot, params) {
|
|
128
|
-
try {
|
|
129
|
-
const accessor = await getAccessor(projectRoot);
|
|
130
|
-
const result = await coreListTasks({
|
|
131
|
-
parentId: params?.parent ?? undefined,
|
|
132
|
-
status: params?.status,
|
|
133
|
-
priority: params?.priority,
|
|
134
|
-
type: params?.type,
|
|
135
|
-
phase: params?.phase,
|
|
136
|
-
label: params?.label,
|
|
137
|
-
children: params?.children,
|
|
138
|
-
limit: params?.limit,
|
|
139
|
-
offset: params?.offset,
|
|
140
|
-
}, projectRoot, accessor);
|
|
141
|
-
const tasks = params?.compact
|
|
142
|
-
? result.tasks.map((t) => toCompact(t))
|
|
143
|
-
: tasksToRecords(result.tasks);
|
|
144
|
-
if (params?.compact) {
|
|
145
|
-
return {
|
|
146
|
-
success: true,
|
|
147
|
-
data: { tasks, total: result.total, filtered: result.filtered },
|
|
148
|
-
page: result.page,
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
return {
|
|
152
|
-
success: true,
|
|
153
|
-
data: { tasks, total: result.total, filtered: result.filtered },
|
|
154
|
-
page: result.page,
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
catch (err) {
|
|
158
|
-
return cleoErrorToEngineError(err, 'E_NOT_INITIALIZED', 'Task database not initialized');
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Fuzzy search tasks by title/description/ID.
|
|
163
|
-
*
|
|
164
|
-
* @remarks
|
|
165
|
-
* Returns minimal task records to keep context consumption low.
|
|
166
|
-
* Supports exact matching, status filtering, and archive inclusion.
|
|
167
|
-
*
|
|
168
|
-
* @param projectRoot - Absolute path to the project root
|
|
169
|
-
* @param query - Search string to match against title, description, or ID
|
|
170
|
-
* @param limit - Maximum number of results (defaults to 20)
|
|
171
|
-
* @param options - Additional search options
|
|
172
|
-
* @returns EngineResult with matching tasks and total count
|
|
173
|
-
*
|
|
174
|
-
* @example
|
|
175
|
-
* ```typescript
|
|
176
|
-
* const result = await taskFind('/project', 'authentication', 10);
|
|
177
|
-
* ```
|
|
178
|
-
*
|
|
179
|
-
* @task T4657
|
|
180
|
-
* @epic T4654
|
|
181
|
-
*/
|
|
182
|
-
export async function taskFind(projectRoot, query, limit, options) {
|
|
183
|
-
try {
|
|
184
|
-
const accessor = await getAccessor(projectRoot);
|
|
185
|
-
const findResult = await coreFindTasks({
|
|
186
|
-
query,
|
|
187
|
-
id: options?.id,
|
|
188
|
-
exact: options?.exact,
|
|
189
|
-
status: options?.status,
|
|
190
|
-
includeArchive: options?.includeArchive,
|
|
191
|
-
limit: limit ?? 20,
|
|
192
|
-
offset: options?.offset,
|
|
193
|
-
}, projectRoot, accessor);
|
|
194
|
-
const results = findResult.results.map((r) => ({
|
|
195
|
-
id: r.id,
|
|
196
|
-
title: r.title,
|
|
197
|
-
status: r.status,
|
|
198
|
-
priority: r.priority,
|
|
199
|
-
parentId: r.parentId,
|
|
200
|
-
}));
|
|
201
|
-
return { success: true, data: { results, total: results.length } };
|
|
202
|
-
}
|
|
203
|
-
catch (err) {
|
|
204
|
-
return cleoErrorToEngineError(err, 'E_NOT_INITIALIZED', 'Task database not initialized');
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Check if a task exists.
|
|
209
|
-
*
|
|
210
|
-
* @remarks
|
|
211
|
-
* Returns `{ exists: true }` if the task is found, `{ exists: false }` otherwise.
|
|
212
|
-
* Never fails -- catches all errors and returns false.
|
|
213
|
-
*
|
|
214
|
-
* @param projectRoot - Absolute path to the project root
|
|
215
|
-
* @param taskId - Task identifier to check
|
|
216
|
-
* @returns EngineResult with exists flag and the queried taskId
|
|
217
|
-
*
|
|
218
|
-
* @example
|
|
219
|
-
* ```typescript
|
|
220
|
-
* const result = await taskExists('/project', 'T42');
|
|
221
|
-
* if (result.success && result.data.exists) { console.log('exists'); }
|
|
222
|
-
* ```
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
@task
|
|
226
|
-
T4657
|
|
227
|
-
* @epic T4654
|
|
228
|
-
*/
|
|
229
|
-
export async function taskExists(projectRoot, taskId) {
|
|
230
|
-
try {
|
|
231
|
-
const accessor = await getAccessor(projectRoot);
|
|
232
|
-
const exists = await accessor.taskExists(taskId);
|
|
233
|
-
return { success: true, data: { exists, taskId } };
|
|
234
|
-
}
|
|
235
|
-
catch {
|
|
236
|
-
return { success: true, data: { exists: false, taskId } };
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
// ===== Mutate Operations =====
|
|
240
|
-
/**
|
|
241
|
-
* Create a new task.
|
|
242
|
-
*
|
|
243
|
-
* @remarks
|
|
244
|
-
* Validates hierarchy depth, sibling limits, parent type, and circular
|
|
245
|
-
* references before creating the task. Supports dry-run mode for preview.
|
|
246
|
-
*
|
|
247
|
-
* @param projectRoot - Absolute path to the project root
|
|
248
|
-
* @param params - Task creation parameters
|
|
249
|
-
* @returns EngineResult with the created task record and duplicate flag
|
|
250
|
-
*
|
|
251
|
-
* @example
|
|
252
|
-
* ```typescript
|
|
253
|
-
* const result = await taskCreate('/project', {
|
|
254
|
-
* title: 'Implement auth',
|
|
255
|
-
* description: 'Add JWT-based authentication',
|
|
256
|
-
* priority: 'high',
|
|
257
|
-
* });
|
|
258
|
-
* ```
|
|
259
|
-
*/
|
|
260
|
-
export async function taskCreate(projectRoot, params) {
|
|
261
|
-
try {
|
|
262
|
-
const accessor = await getAccessor(projectRoot);
|
|
263
|
-
const result = await coreAddTask({
|
|
264
|
-
title: params.title,
|
|
265
|
-
description: params.description,
|
|
266
|
-
parentId: params.parent || null,
|
|
267
|
-
depends: params.depends,
|
|
268
|
-
priority: params.priority || 'medium',
|
|
269
|
-
labels: params.labels,
|
|
270
|
-
type: params.type || undefined,
|
|
271
|
-
phase: params.phase,
|
|
272
|
-
size: params.size,
|
|
273
|
-
acceptance: params.acceptance,
|
|
274
|
-
notes: params.notes,
|
|
275
|
-
files: params.files,
|
|
276
|
-
dryRun: params.dryRun,
|
|
277
|
-
}, projectRoot, accessor);
|
|
278
|
-
return {
|
|
279
|
-
success: true,
|
|
280
|
-
data: {
|
|
281
|
-
task: taskToRecord(result.task),
|
|
282
|
-
duplicate: result.duplicate ?? false,
|
|
283
|
-
dryRun: params.dryRun,
|
|
284
|
-
},
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
catch (err) {
|
|
288
|
-
return cleoErrorToEngineError(err, 'E_NOT_INITIALIZED', 'Task database not initialized');
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
/**
|
|
292
|
-
* Update a task's fields.
|
|
293
|
-
*
|
|
294
|
-
* @remarks
|
|
295
|
-
* Supports atomic label and dependency operations via addLabels/removeLabels
|
|
296
|
-
* and addDepends/removeDepends. Returns the updated task and a list of
|
|
297
|
-
* changed fields.
|
|
298
|
-
*
|
|
299
|
-
* @param projectRoot - Absolute path to the project root
|
|
300
|
-
* @param taskId - Task identifier to update
|
|
301
|
-
* @param updates - Fields to update (only provided fields are changed)
|
|
302
|
-
* @returns EngineResult with the updated task record and list of changes
|
|
303
|
-
*
|
|
304
|
-
* @example
|
|
305
|
-
* ```typescript
|
|
306
|
-
* const result = await taskUpdate('/project', 'T42', { status: 'active' });
|
|
307
|
-
* ```
|
|
308
|
-
*/
|
|
309
|
-
export async function taskUpdate(projectRoot, taskId, updates) {
|
|
310
|
-
try {
|
|
311
|
-
const accessor = await getAccessor(projectRoot);
|
|
312
|
-
const result = await coreUpdateTask({
|
|
313
|
-
taskId,
|
|
314
|
-
title: updates.title,
|
|
315
|
-
description: updates.description,
|
|
316
|
-
status: updates.status,
|
|
317
|
-
priority: updates.priority,
|
|
318
|
-
notes: updates.notes,
|
|
319
|
-
labels: updates.labels,
|
|
320
|
-
addLabels: updates.addLabels,
|
|
321
|
-
removeLabels: updates.removeLabels,
|
|
322
|
-
depends: updates.depends,
|
|
323
|
-
addDepends: updates.addDepends,
|
|
324
|
-
removeDepends: updates.removeDepends,
|
|
325
|
-
acceptance: updates.acceptance,
|
|
326
|
-
parentId: updates.parent,
|
|
327
|
-
type: updates.type,
|
|
328
|
-
size: updates.size,
|
|
329
|
-
}, projectRoot, accessor);
|
|
330
|
-
return { success: true, data: { task: taskToRecord(result.task), changes: result.changes } };
|
|
331
|
-
}
|
|
332
|
-
catch (err) {
|
|
333
|
-
return cleoErrorToEngineError(err, 'E_NOT_INITIALIZED', 'Task database not initialized');
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
/**
|
|
337
|
-
* Complete a task (set status to done).
|
|
338
|
-
*
|
|
339
|
-
* @remarks
|
|
340
|
-
* May trigger auto-completion of parent tasks and unblocking of dependent
|
|
341
|
-
* tasks. Maps core exit codes to engine error codes for structured error reporting.
|
|
342
|
-
*
|
|
343
|
-
* @param projectRoot - Absolute path to the project root
|
|
344
|
-
* @param taskId - Task identifier to complete
|
|
345
|
-
* @param notes - Optional completion notes
|
|
346
|
-
* @returns EngineResult with the completed task, auto-completed parents, and unblocked tasks
|
|
347
|
-
*
|
|
348
|
-
* @example
|
|
349
|
-
* ```typescript
|
|
350
|
-
* const result = await taskComplete('/project', 'T42', 'All tests passing');
|
|
351
|
-
* ```
|
|
352
|
-
*/
|
|
353
|
-
export async function taskComplete(projectRoot, taskId, notes) {
|
|
354
|
-
try {
|
|
355
|
-
const accessor = await getAccessor(projectRoot);
|
|
356
|
-
const result = await coreCompleteTask({ taskId, notes }, projectRoot, accessor);
|
|
357
|
-
return {
|
|
358
|
-
success: true,
|
|
359
|
-
data: {
|
|
360
|
-
task: result.task,
|
|
361
|
-
...(result.autoCompleted && { autoCompleted: result.autoCompleted }),
|
|
362
|
-
...(result.unblockedTasks && { unblockedTasks: result.unblockedTasks }),
|
|
363
|
-
},
|
|
364
|
-
};
|
|
365
|
-
}
|
|
366
|
-
catch (err) {
|
|
367
|
-
return cleoErrorToEngineError(err, 'E_INTERNAL', 'Failed to complete task');
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
/**
|
|
371
|
-
* Delete a task.
|
|
372
|
-
*
|
|
373
|
-
* @remarks
|
|
374
|
-
* When `force` is true, cascade-deletes child tasks. Otherwise, returns
|
|
375
|
-
* E_HAS_CHILDREN if the task has children.
|
|
376
|
-
*
|
|
377
|
-
* @param projectRoot - Absolute path to the project root
|
|
378
|
-
* @param taskId - Task identifier to delete
|
|
379
|
-
* @param force - When true, enables cascade deletion of children
|
|
380
|
-
* @returns EngineResult with the deleted task and optional cascade info
|
|
381
|
-
*
|
|
382
|
-
* @example
|
|
383
|
-
* ```typescript
|
|
384
|
-
* const result = await taskDelete('/project', 'T42', true);
|
|
385
|
-
* ```
|
|
386
|
-
*/
|
|
387
|
-
export async function taskDelete(projectRoot, taskId, force) {
|
|
388
|
-
try {
|
|
389
|
-
const accessor = await getAccessor(projectRoot);
|
|
390
|
-
const result = await coreDeleteTask({
|
|
391
|
-
taskId,
|
|
392
|
-
force: force ?? false,
|
|
393
|
-
cascade: force ?? false,
|
|
394
|
-
}, projectRoot, accessor);
|
|
395
|
-
return {
|
|
396
|
-
success: true,
|
|
397
|
-
data: {
|
|
398
|
-
deletedTask: taskToRecord(result.deletedTask),
|
|
399
|
-
deleted: true,
|
|
400
|
-
cascadeDeleted: result.cascadeDeleted,
|
|
401
|
-
},
|
|
402
|
-
};
|
|
403
|
-
}
|
|
404
|
-
catch (err) {
|
|
405
|
-
return cleoErrorToEngineError(err, 'E_NOT_INITIALIZED', 'Task database not initialized');
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
/**
|
|
409
|
-
* Archive completed tasks.
|
|
410
|
-
* Moves done/cancelled tasks from active task data to archive.
|
|
411
|
-
*
|
|
412
|
-
* @remarks
|
|
413
|
-
* Archives a specific task by ID, or all tasks completed before a given date.
|
|
414
|
-
* Archived tasks are no longer returned by default queries.
|
|
415
|
-
*
|
|
416
|
-
* @param projectRoot - Absolute path to the project root
|
|
417
|
-
* @param taskId - Optional specific task ID to archive
|
|
418
|
-
* @param before - Optional ISO date string; archives tasks completed before this date
|
|
419
|
-
* @returns EngineResult with count and list of archived task IDs
|
|
420
|
-
*
|
|
421
|
-
* @example
|
|
422
|
-
* ```typescript
|
|
423
|
-
* const result = await taskArchive('/project', undefined, '2026-01-01');
|
|
424
|
-
* ```
|
|
425
|
-
*/
|
|
426
|
-
export async function taskArchive(projectRoot, taskId, before) {
|
|
427
|
-
try {
|
|
428
|
-
const accessor = await getAccessor(projectRoot);
|
|
429
|
-
const result = await coreArchiveTasks({
|
|
430
|
-
taskIds: taskId ? [taskId] : undefined,
|
|
431
|
-
before,
|
|
432
|
-
}, projectRoot, accessor);
|
|
433
|
-
return {
|
|
434
|
-
success: true,
|
|
435
|
-
data: {
|
|
436
|
-
archivedCount: result.archived.length,
|
|
437
|
-
archivedTasks: result.archived.map((id) => ({ id })),
|
|
438
|
-
},
|
|
439
|
-
};
|
|
440
|
-
}
|
|
441
|
-
catch (err) {
|
|
442
|
-
return cleoErrorToEngineError(err, 'E_NOT_INITIALIZED', 'Task database not initialized');
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
// ===== Non-CRUD Operations (delegated to core/tasks/task-ops.ts) =====
|
|
446
|
-
/**
|
|
447
|
-
* Suggest next task to work on based on priority, phase alignment, age, and dependency readiness.
|
|
448
|
-
*
|
|
449
|
-
* @remarks
|
|
450
|
-
* Scores all pending tasks and returns ranked suggestions. When `explain`
|
|
451
|
-
* is true, includes per-task scoring reasons in the response.
|
|
452
|
-
*
|
|
453
|
-
* @param projectRoot - Absolute path to the project root
|
|
454
|
-
* @param params - Optional count limit and explain flag
|
|
455
|
-
* @returns EngineResult with scored suggestions and total candidate count
|
|
456
|
-
*
|
|
457
|
-
* @example
|
|
458
|
-
* ```typescript
|
|
459
|
-
* const result = await taskNext('/project', { count: 3, explain: true });
|
|
460
|
-
* ```
|
|
461
|
-
*
|
|
462
|
-
* @task T4657
|
|
463
|
-
* @task T4790
|
|
464
|
-
* @epic T4654
|
|
465
|
-
*/
|
|
466
|
-
export async function taskNext(projectRoot, params) {
|
|
467
|
-
try {
|
|
468
|
-
const result = await coreTaskNext(projectRoot, params);
|
|
469
|
-
return { success: true, data: result };
|
|
470
|
-
}
|
|
471
|
-
catch {
|
|
472
|
-
return engineError('E_NOT_INITIALIZED', 'Task database not initialized');
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
/**
|
|
476
|
-
* Show blocked tasks and analyze blocking chains.
|
|
477
|
-
*
|
|
478
|
-
* @remarks
|
|
479
|
-
* Identifies all blocked tasks, traces their blocking chains, and highlights
|
|
480
|
-
* critical blockers (tasks that block the most other tasks).
|
|
481
|
-
*
|
|
482
|
-
* @param projectRoot - Absolute path to the project root
|
|
483
|
-
* @param params - Optional analysis and limit parameters
|
|
484
|
-
* @returns EngineResult with blocked tasks, critical blockers, and summary
|
|
485
|
-
*
|
|
486
|
-
* @example
|
|
487
|
-
* ```typescript
|
|
488
|
-
* const result = await taskBlockers('/project', { analyze: true });
|
|
489
|
-
* ```
|
|
490
|
-
*
|
|
491
|
-
* @task T4657
|
|
492
|
-
* @task T4790
|
|
493
|
-
* @epic T4654
|
|
494
|
-
*/
|
|
495
|
-
export async function taskBlockers(projectRoot, params) {
|
|
496
|
-
try {
|
|
497
|
-
const result = await coreTaskBlockers(projectRoot, params);
|
|
498
|
-
return { success: true, data: result };
|
|
499
|
-
}
|
|
500
|
-
catch {
|
|
501
|
-
return engineError('E_NOT_INITIALIZED', 'Task database not initialized');
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
/**
|
|
505
|
-
* Build hierarchy tree.
|
|
506
|
-
*
|
|
507
|
-
* @remarks
|
|
508
|
-
* Returns a tree structure of tasks rooted at the given task ID, or
|
|
509
|
-
* the full project tree when no task ID is specified.
|
|
510
|
-
*
|
|
511
|
-
* @param projectRoot - Absolute path to the project root
|
|
512
|
-
* @param taskId - Optional root task ID for subtree
|
|
513
|
-
* @returns EngineResult with the hierarchical tree data
|
|
514
|
-
*
|
|
515
|
-
* @example
|
|
516
|
-
* ```typescript
|
|
517
|
-
* const result = await taskTree('/project', 'T1');
|
|
518
|
-
* ```
|
|
519
|
-
*
|
|
520
|
-
* @task T4657
|
|
521
|
-
* @task T4790
|
|
522
|
-
* @epic T4654
|
|
523
|
-
*/
|
|
524
|
-
export async function taskTree(projectRoot, taskId) {
|
|
525
|
-
try {
|
|
526
|
-
const result = await coreTaskTree(projectRoot, taskId);
|
|
527
|
-
return { success: true, data: result };
|
|
528
|
-
}
|
|
529
|
-
catch (err) {
|
|
530
|
-
return cleoErrorToEngineError(err, 'E_NOT_INITIALIZED', 'Task database not initialized');
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
/**
|
|
534
|
-
* Show dependencies for a task - both what it depends on and what depends on it.
|
|
535
|
-
*
|
|
536
|
-
* @remarks
|
|
537
|
-
* Returns bidirectional dependency information including unresolved deps
|
|
538
|
-
* and a ready flag indicating whether all dependencies are satisfied.
|
|
539
|
-
*
|
|
540
|
-
* @param projectRoot - Absolute path to the project root
|
|
541
|
-
* @param taskId - Task identifier to inspect
|
|
542
|
-
* @returns EngineResult with dependency information in both directions
|
|
543
|
-
*
|
|
544
|
-
* @example
|
|
545
|
-
* ```typescript
|
|
546
|
-
* const result = await taskDeps('/project', 'T42');
|
|
547
|
-
* ```
|
|
548
|
-
*
|
|
549
|
-
* @task T4657
|
|
550
|
-
* @task T4790
|
|
551
|
-
* @epic T4654
|
|
552
|
-
*/
|
|
553
|
-
export async function taskDeps(projectRoot, taskId) {
|
|
554
|
-
try {
|
|
555
|
-
const result = await coreTaskDeps(projectRoot, taskId);
|
|
556
|
-
return { success: true, data: result };
|
|
557
|
-
}
|
|
558
|
-
catch (err) {
|
|
559
|
-
return cleoErrorToEngineError(err, 'E_NOT_INITIALIZED', 'Task database not initialized');
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
/**
|
|
563
|
-
* Show task relations (existing relates entries).
|
|
564
|
-
*
|
|
565
|
-
* @remarks
|
|
566
|
-
* Lists all `relates` entries for a given task, including the relationship
|
|
567
|
-
* type and optional reason.
|
|
568
|
-
*
|
|
569
|
-
* @param projectRoot - Absolute path to the project root
|
|
570
|
-
* @param taskId - Task identifier to inspect
|
|
571
|
-
* @returns EngineResult with relations array and count
|
|
572
|
-
*
|
|
573
|
-
* @example
|
|
574
|
-
* ```typescript
|
|
575
|
-
* const result = await taskRelates('/project', 'T42');
|
|
576
|
-
* ```
|
|
577
|
-
*
|
|
578
|
-
* @task T4657
|
|
579
|
-
* @task T4790
|
|
580
|
-
* @epic T4654
|
|
581
|
-
*/
|
|
582
|
-
export async function taskRelates(projectRoot, taskId) {
|
|
583
|
-
try {
|
|
584
|
-
const result = await coreTaskRelates(projectRoot, taskId);
|
|
585
|
-
return { success: true, data: result };
|
|
586
|
-
}
|
|
587
|
-
catch (err) {
|
|
588
|
-
return cleoErrorToEngineError(err, 'E_GENERAL', 'Failed to read task relations');
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
/**
|
|
592
|
-
* Add a relation between two tasks.
|
|
593
|
-
*
|
|
594
|
-
* @remarks
|
|
595
|
-
* Valid relation types: related, blocks, duplicates, absorbs, fixes, extends, supersedes.
|
|
596
|
-
*
|
|
597
|
-
* @param projectRoot - Absolute path to the project root
|
|
598
|
-
* @param taskId - Source task identifier
|
|
599
|
-
* @param relatedId - Target task identifier
|
|
600
|
-
* @param type - Relation type (e.g. "blocks", "related")
|
|
601
|
-
* @param reason - Optional explanation for the relation
|
|
602
|
-
* @returns EngineResult confirming the relation was added
|
|
603
|
-
*
|
|
604
|
-
* @example
|
|
605
|
-
* ```typescript
|
|
606
|
-
* const result = await taskRelatesAdd('/project', 'T42', 'T43', 'blocks', 'Needs auth first');
|
|
607
|
-
* ```
|
|
608
|
-
*
|
|
609
|
-
* @task T4790
|
|
610
|
-
*/
|
|
611
|
-
export async function taskRelatesAdd(projectRoot, taskId, relatedId, type, reason) {
|
|
612
|
-
try {
|
|
613
|
-
const result = await coreTaskRelatesAdd(projectRoot, taskId, relatedId, type, reason);
|
|
614
|
-
return { success: true, data: result };
|
|
615
|
-
}
|
|
616
|
-
catch (err) {
|
|
617
|
-
return cleoErrorToEngineError(err, 'E_GENERAL', 'Failed to update task relations');
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
/**
|
|
621
|
-
* Analyze a task for description quality, missing fields, and dependency health.
|
|
622
|
-
*
|
|
623
|
-
* @remarks
|
|
624
|
-
* When no task ID is provided, analyzes all tasks to identify bottlenecks,
|
|
625
|
-
* leverage opportunities, and overall project health metrics.
|
|
626
|
-
*
|
|
627
|
-
* @param projectRoot - Absolute path to the project root
|
|
628
|
-
* @param taskId - Optional specific task to analyze
|
|
629
|
-
* @param params - Optional analysis parameters
|
|
630
|
-
* @returns EngineResult with recommended task, bottlenecks, tiers, and metrics
|
|
631
|
-
*
|
|
632
|
-
* @example
|
|
633
|
-
* ```typescript
|
|
634
|
-
* const result = await taskAnalyze('/project');
|
|
635
|
-
* ```
|
|
636
|
-
*
|
|
637
|
-
* @task T4657
|
|
638
|
-
* @task T4790
|
|
639
|
-
* @epic T4654
|
|
640
|
-
*/
|
|
641
|
-
export async function taskAnalyze(projectRoot, taskId, params) {
|
|
642
|
-
try {
|
|
643
|
-
const result = await coreTaskAnalyze(projectRoot, taskId, params);
|
|
644
|
-
return { success: true, data: result };
|
|
645
|
-
}
|
|
646
|
-
catch (err) {
|
|
647
|
-
return cleoErrorToEngineError(err, 'E_GENERAL', 'Task analysis failed');
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
/**
|
|
651
|
-
* Predict downstream impact of a free-text change description.
|
|
652
|
-
*
|
|
653
|
-
* Delegates to {@link predictImpact} from the intelligence module.
|
|
654
|
-
* Uses keyword matching against task titles/descriptions, then traces
|
|
655
|
-
* the reverse dependency graph for transitive effects.
|
|
656
|
-
*
|
|
657
|
-
* @remarks
|
|
658
|
-
* The impact report includes directly affected tasks, transitively
|
|
659
|
-
* affected tasks (through the dependency graph), and a severity assessment.
|
|
660
|
-
*
|
|
661
|
-
* @param projectRoot - Project root directory
|
|
662
|
-
* @param change - Free-text description of the proposed change
|
|
663
|
-
* @param matchLimit - Maximum seed tasks to match (default: 5)
|
|
664
|
-
* @returns Impact prediction report
|
|
665
|
-
*
|
|
666
|
-
* @example
|
|
667
|
-
* ```typescript
|
|
668
|
-
* const result = await taskImpact('/project', 'Refactor authentication module');
|
|
669
|
-
* ```
|
|
670
|
-
*
|
|
671
|
-
* @task T043
|
|
672
|
-
*/
|
|
673
|
-
export async function taskImpact(projectRoot, change, matchLimit) {
|
|
674
|
-
try {
|
|
675
|
-
const result = await predictImpact(change, projectRoot, undefined, matchLimit);
|
|
676
|
-
return { success: true, data: result };
|
|
677
|
-
}
|
|
678
|
-
catch (err) {
|
|
679
|
-
return cleoErrorToEngineError(err, 'E_GENERAL', 'Impact prediction failed');
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
/**
|
|
683
|
-
* Restore a cancelled task back to pending.
|
|
684
|
-
*
|
|
685
|
-
* @remarks
|
|
686
|
-
* When cascade is true, also restores cancelled children.
|
|
687
|
-
*
|
|
688
|
-
* @param projectRoot - Absolute path to the project root
|
|
689
|
-
* @param taskId - Task identifier to restore
|
|
690
|
-
* @param params - Optional cascade and notes options
|
|
691
|
-
* @returns EngineResult with restored task IDs and count
|
|
692
|
-
*
|
|
693
|
-
* @example
|
|
694
|
-
* ```typescript
|
|
695
|
-
* const result = await taskRestore('/project', 'T42', { cascade: true });
|
|
696
|
-
* ```
|
|
697
|
-
*
|
|
698
|
-
* @task T4790
|
|
699
|
-
*/
|
|
700
|
-
export async function taskRestore(projectRoot, taskId, params) {
|
|
701
|
-
try {
|
|
702
|
-
const result = await coreTaskRestore(projectRoot, taskId, params);
|
|
703
|
-
return { success: true, data: result };
|
|
704
|
-
}
|
|
705
|
-
catch (err) {
|
|
706
|
-
return cleoErrorToEngineError(err, 'E_NOT_INITIALIZED', 'Failed to restore task');
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
/**
|
|
710
|
-
* Move an archived task back to active task data with status 'done' (or specified status).
|
|
711
|
-
*
|
|
712
|
-
* @remarks
|
|
713
|
-
* By default restores with status 'done'. Use `preserveStatus` to keep
|
|
714
|
-
* the original status, or `status` to set a specific status.
|
|
715
|
-
*
|
|
716
|
-
* @param projectRoot - Absolute path to the project root
|
|
717
|
-
* @param taskId - Archived task identifier to restore
|
|
718
|
-
* @param params - Optional status override parameters
|
|
719
|
-
* @returns EngineResult with the unarchived task info
|
|
720
|
-
*
|
|
721
|
-
* @example
|
|
722
|
-
* ```typescript
|
|
723
|
-
* const result = await taskUnarchive('/project', 'T42', { status: 'pending' });
|
|
724
|
-
* ```
|
|
725
|
-
*
|
|
726
|
-
* @task T4790
|
|
727
|
-
*/
|
|
728
|
-
export async function taskUnarchive(projectRoot, taskId, params) {
|
|
729
|
-
try {
|
|
730
|
-
const result = await coreTaskUnarchive(projectRoot, taskId, params);
|
|
731
|
-
return { success: true, data: result };
|
|
732
|
-
}
|
|
733
|
-
catch (err) {
|
|
734
|
-
return cleoErrorToEngineError(err, 'E_NOT_INITIALIZED', 'Failed to unarchive task');
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
/**
|
|
738
|
-
* Change task position within its sibling group.
|
|
739
|
-
*
|
|
740
|
-
* @remarks
|
|
741
|
-
* Reorders a task to the specified zero-based position among its siblings.
|
|
742
|
-
*
|
|
743
|
-
* @param projectRoot - Absolute path to the project root
|
|
744
|
-
* @param taskId - Task identifier to reorder
|
|
745
|
-
* @param position - Target zero-based position
|
|
746
|
-
* @returns EngineResult with new position and total siblings
|
|
747
|
-
*
|
|
748
|
-
* @example
|
|
749
|
-
* ```typescript
|
|
750
|
-
* const result = await taskReorder('/project', 'T42', 0); // move to first
|
|
751
|
-
* ```
|
|
752
|
-
*
|
|
753
|
-
* @task T4790
|
|
754
|
-
*/
|
|
755
|
-
export async function taskReorder(projectRoot, taskId, position) {
|
|
756
|
-
try {
|
|
757
|
-
const result = await coreTaskReorder(projectRoot, taskId, position);
|
|
758
|
-
return { success: true, data: result };
|
|
759
|
-
}
|
|
760
|
-
catch (err) {
|
|
761
|
-
return cleoErrorToEngineError(err, 'E_NOT_INITIALIZED', 'Failed to reorder task');
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
/**
|
|
765
|
-
* Move task under a different parent.
|
|
766
|
-
*
|
|
767
|
-
* @remarks
|
|
768
|
-
* Pass null as `newParentId` to promote the task to a root-level task.
|
|
769
|
-
* Validates hierarchy depth and circular reference constraints.
|
|
770
|
-
*
|
|
771
|
-
* @param projectRoot - Absolute path to the project root
|
|
772
|
-
* @param taskId - Task identifier to move
|
|
773
|
-
* @param newParentId - New parent task ID, or null for root
|
|
774
|
-
* @returns EngineResult with old and new parent information
|
|
775
|
-
*
|
|
776
|
-
* @example
|
|
777
|
-
* ```typescript
|
|
778
|
-
* const result = await taskReparent('/project', 'T42', 'T1');
|
|
779
|
-
* ```
|
|
780
|
-
*
|
|
781
|
-
* @task T4790
|
|
782
|
-
*/
|
|
783
|
-
export async function taskReparent(projectRoot, taskId, newParentId) {
|
|
784
|
-
try {
|
|
785
|
-
const result = await coreTaskReparent(projectRoot, taskId, newParentId);
|
|
786
|
-
return { success: true, data: result };
|
|
787
|
-
}
|
|
788
|
-
catch (err) {
|
|
789
|
-
return cleoErrorToEngineError(err, 'E_NOT_INITIALIZED', 'Failed to reparent task');
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
/**
|
|
793
|
-
* Promote a subtask to task or task to root (remove parent).
|
|
794
|
-
*
|
|
795
|
-
* @remarks
|
|
796
|
-
* Removes the parent reference and may change the task type from subtask to task.
|
|
797
|
-
*
|
|
798
|
-
* @param projectRoot - Absolute path to the project root
|
|
799
|
-
* @param taskId - Task identifier to promote
|
|
800
|
-
* @returns EngineResult with promotion details
|
|
801
|
-
*
|
|
802
|
-
* @example
|
|
803
|
-
* ```typescript
|
|
804
|
-
* const result = await taskPromote('/project', 'T42');
|
|
805
|
-
* ```
|
|
806
|
-
*
|
|
807
|
-
* @task T4790
|
|
808
|
-
*/
|
|
809
|
-
export async function taskPromote(projectRoot, taskId) {
|
|
810
|
-
try {
|
|
811
|
-
const result = await coreTaskPromote(projectRoot, taskId);
|
|
812
|
-
return { success: true, data: result };
|
|
813
|
-
}
|
|
814
|
-
catch (err) {
|
|
815
|
-
return cleoErrorToEngineError(err, 'E_NOT_INITIALIZED', 'Failed to promote task');
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
/**
|
|
819
|
-
* Reopen a completed task (set status back to pending).
|
|
820
|
-
*
|
|
821
|
-
* @remarks
|
|
822
|
-
* Only works on tasks with status 'done'. Optionally sets a different
|
|
823
|
-
* target status and records a reason for reopening.
|
|
824
|
-
*
|
|
825
|
-
* @param projectRoot - Absolute path to the project root
|
|
826
|
-
* @param taskId - Task identifier to reopen
|
|
827
|
-
* @param params - Optional target status and reason
|
|
828
|
-
* @returns EngineResult with reopen details including previous and new status
|
|
829
|
-
*
|
|
830
|
-
* @example
|
|
831
|
-
* ```typescript
|
|
832
|
-
* const result = await taskReopen('/project', 'T42', { reason: 'Tests regressed' });
|
|
833
|
-
* ```
|
|
834
|
-
*
|
|
835
|
-
* @task T4790
|
|
836
|
-
*/
|
|
837
|
-
export async function taskReopen(projectRoot, taskId, params) {
|
|
838
|
-
try {
|
|
839
|
-
const result = await coreTaskReopen(projectRoot, taskId, params);
|
|
840
|
-
return { success: true, data: result };
|
|
841
|
-
}
|
|
842
|
-
catch (err) {
|
|
843
|
-
return cleoErrorToEngineError(err, 'E_NOT_INITIALIZED', 'Failed to reopen task');
|
|
844
|
-
}
|
|
845
|
-
}
|
|
846
|
-
/**
|
|
847
|
-
* Cancel a task (soft terminal state -- reversible via restore).
|
|
848
|
-
*
|
|
849
|
-
* @remarks
|
|
850
|
-
* Sets the task status to cancelled with an optional reason. The task can
|
|
851
|
-
* be restored later via {@link taskRestore}.
|
|
852
|
-
*
|
|
853
|
-
* @param projectRoot - Absolute path to the project root
|
|
854
|
-
* @param taskId - Task identifier to cancel
|
|
855
|
-
* @param reason - Optional cancellation reason
|
|
856
|
-
* @returns EngineResult with cancellation details
|
|
857
|
-
*
|
|
858
|
-
* @example
|
|
859
|
-
* ```typescript
|
|
860
|
-
* const result = await taskCancel('/project', 'T42', 'No longer needed');
|
|
861
|
-
* ```
|
|
862
|
-
*
|
|
863
|
-
* @task T4529
|
|
864
|
-
*/
|
|
865
|
-
export async function taskCancel(projectRoot, taskId, reason) {
|
|
866
|
-
try {
|
|
867
|
-
const result = await coreTaskCancel(projectRoot, taskId, { reason });
|
|
868
|
-
return { success: true, data: result };
|
|
869
|
-
}
|
|
870
|
-
catch (err) {
|
|
871
|
-
return cleoErrorToEngineError(err, 'E_INTERNAL', 'Failed to cancel task');
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
/**
|
|
875
|
-
* Deterministic complexity scoring from task metadata.
|
|
876
|
-
*
|
|
877
|
-
* @remarks
|
|
878
|
-
* Produces a size estimate (small/medium/large) based on dependency depth,
|
|
879
|
-
* subtask count, file count, and other structural factors.
|
|
880
|
-
*
|
|
881
|
-
* @param projectRoot - Absolute path to the project root
|
|
882
|
-
* @param params - Parameters including the task ID to estimate
|
|
883
|
-
* @returns EngineResult with size, score, factors, and structural metrics
|
|
884
|
-
*
|
|
885
|
-
* @example
|
|
886
|
-
* ```typescript
|
|
887
|
-
* const result = await taskComplexityEstimate('/project', { taskId: 'T42' });
|
|
888
|
-
* ```
|
|
889
|
-
*
|
|
890
|
-
* @task T4657
|
|
891
|
-
* @task T4790
|
|
892
|
-
* @epic T4654
|
|
893
|
-
*/
|
|
894
|
-
export async function taskComplexityEstimate(projectRoot, params) {
|
|
895
|
-
try {
|
|
896
|
-
const result = await coreTaskComplexityEstimate(projectRoot, params);
|
|
897
|
-
return { success: true, data: result };
|
|
898
|
-
}
|
|
899
|
-
catch (err) {
|
|
900
|
-
return cleoErrorToEngineError(err, 'E_NOT_INITIALIZED', 'Task database not initialized');
|
|
901
|
-
}
|
|
902
|
-
}
|
|
903
|
-
/**
|
|
904
|
-
* List dependencies for a task in a given direction.
|
|
905
|
-
* @task T4657
|
|
906
|
-
* @task T4790
|
|
907
|
-
* @epic T4654
|
|
908
|
-
*/
|
|
909
|
-
export async function taskDepends(projectRoot, taskId, direction = 'both', tree) {
|
|
910
|
-
try {
|
|
911
|
-
const result = await coreTaskDepends(projectRoot, taskId, direction, tree ? { tree } : undefined);
|
|
912
|
-
return { success: true, data: result };
|
|
913
|
-
}
|
|
914
|
-
catch (err) {
|
|
915
|
-
return cleoErrorToEngineError(err, 'E_NOT_INITIALIZED', 'Task database not initialized');
|
|
916
|
-
}
|
|
917
|
-
}
|
|
918
|
-
/**
|
|
919
|
-
* Overview of all dependencies across the project.
|
|
920
|
-
* @task T5157
|
|
921
|
-
*/
|
|
922
|
-
export async function taskDepsOverview(projectRoot) {
|
|
923
|
-
try {
|
|
924
|
-
const result = await coreTaskDepsOverview(projectRoot);
|
|
925
|
-
return { success: true, data: result };
|
|
926
|
-
}
|
|
927
|
-
catch (err) {
|
|
928
|
-
return cleoErrorToEngineError(err, 'E_NOT_INITIALIZED', 'Failed to load deps overview');
|
|
929
|
-
}
|
|
930
|
-
}
|
|
931
|
-
/**
|
|
932
|
-
* Detect circular dependencies across the project.
|
|
933
|
-
* @task T5157
|
|
934
|
-
*/
|
|
935
|
-
export async function taskDepsCycles(projectRoot) {
|
|
936
|
-
try {
|
|
937
|
-
const result = await coreTaskDepsCycles(projectRoot);
|
|
938
|
-
return { success: true, data: result };
|
|
939
|
-
}
|
|
940
|
-
catch (err) {
|
|
941
|
-
return cleoErrorToEngineError(err, 'E_NOT_INITIALIZED', 'Failed to detect cycles');
|
|
942
|
-
}
|
|
943
|
-
}
|
|
944
|
-
/**
|
|
945
|
-
* Compute task statistics, optionally scoped to an epic.
|
|
946
|
-
* @task T4657
|
|
947
|
-
* @task T4790
|
|
948
|
-
* @epic T4654
|
|
949
|
-
*/
|
|
950
|
-
export async function taskStats(projectRoot, epicId) {
|
|
951
|
-
try {
|
|
952
|
-
const result = await coreTaskStats(projectRoot, epicId);
|
|
953
|
-
return { success: true, data: result };
|
|
954
|
-
}
|
|
955
|
-
catch {
|
|
956
|
-
return engineError('E_NOT_INITIALIZED', 'Task database not initialized');
|
|
957
|
-
}
|
|
958
|
-
}
|
|
959
|
-
/**
|
|
960
|
-
* Export tasks as JSON or CSV.
|
|
961
|
-
* @task T4657
|
|
962
|
-
* @task T4790
|
|
963
|
-
* @epic T4654
|
|
964
|
-
*/
|
|
965
|
-
export async function taskExport(projectRoot, params) {
|
|
966
|
-
try {
|
|
967
|
-
const result = await coreTaskExport(projectRoot, params);
|
|
968
|
-
return { success: true, data: result };
|
|
969
|
-
}
|
|
970
|
-
catch {
|
|
971
|
-
return engineError('E_NOT_INITIALIZED', 'Task database not initialized');
|
|
972
|
-
}
|
|
973
|
-
}
|
|
974
|
-
/**
|
|
975
|
-
* Get task history from the log file.
|
|
976
|
-
* @task T4657
|
|
977
|
-
* @task T4790
|
|
978
|
-
* @epic T4654
|
|
979
|
-
*/
|
|
980
|
-
export async function taskHistory(projectRoot, taskId, limit) {
|
|
981
|
-
try {
|
|
982
|
-
const result = await coreTaskHistory(projectRoot, taskId, limit);
|
|
983
|
-
return { success: true, data: result };
|
|
984
|
-
}
|
|
985
|
-
catch {
|
|
986
|
-
return engineError('E_NOT_INITIALIZED', 'Failed to read task history');
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
/**
|
|
990
|
-
* Lint tasks for common issues.
|
|
991
|
-
* @task T4657
|
|
992
|
-
* @task T4790
|
|
993
|
-
* @epic T4654
|
|
994
|
-
*/
|
|
995
|
-
export async function taskLint(projectRoot, taskId) {
|
|
996
|
-
try {
|
|
997
|
-
const result = await coreTaskLint(projectRoot, taskId);
|
|
998
|
-
return { success: true, data: result };
|
|
999
|
-
}
|
|
1000
|
-
catch (err) {
|
|
1001
|
-
return cleoErrorToEngineError(err, 'E_NOT_INITIALIZED', 'Task database not initialized');
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1004
|
-
/**
|
|
1005
|
-
* Validate multiple tasks at once.
|
|
1006
|
-
* @task T4657
|
|
1007
|
-
* @task T4790
|
|
1008
|
-
* @epic T4654
|
|
1009
|
-
*/
|
|
1010
|
-
export async function taskBatchValidate(projectRoot, taskIds, checkMode = 'full') {
|
|
1011
|
-
try {
|
|
1012
|
-
const result = await coreTaskBatchValidate(projectRoot, taskIds, checkMode);
|
|
1013
|
-
return { success: true, data: result };
|
|
1014
|
-
}
|
|
1015
|
-
catch {
|
|
1016
|
-
return engineError('E_NOT_INITIALIZED', 'Task database not initialized');
|
|
1017
|
-
}
|
|
1018
|
-
}
|
|
1019
|
-
/**
|
|
1020
|
-
* Import tasks from a JSON source string or export package.
|
|
1021
|
-
* @task T4790
|
|
1022
|
-
*/
|
|
1023
|
-
export async function taskImport(projectRoot, source, overwrite) {
|
|
1024
|
-
try {
|
|
1025
|
-
const result = await coreTaskImport(projectRoot, source, overwrite);
|
|
1026
|
-
return { success: true, data: result };
|
|
1027
|
-
}
|
|
1028
|
-
catch (err) {
|
|
1029
|
-
return cleoErrorToEngineError(err, 'E_NOT_INITIALIZED', 'Failed to import tasks');
|
|
1030
|
-
}
|
|
1031
|
-
}
|
|
1032
|
-
/**
|
|
1033
|
-
* Compute a ranked plan: in-progress epics, ready tasks, blockers, bugs.
|
|
1034
|
-
* @task T4815
|
|
1035
|
-
*/
|
|
1036
|
-
export async function taskPlan(projectRoot) {
|
|
1037
|
-
const { coreTaskPlan } = await import('@cleocode/core/internal');
|
|
1038
|
-
try {
|
|
1039
|
-
const result = await coreTaskPlan(projectRoot);
|
|
1040
|
-
return { success: true, data: result };
|
|
1041
|
-
}
|
|
1042
|
-
catch {
|
|
1043
|
-
return engineError('E_NOT_INITIALIZED', 'Task database not initialized');
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
/**
|
|
1047
|
-
* Find related tasks using semantic search or keyword matching.
|
|
1048
|
-
* @task T5672
|
|
1049
|
-
*/
|
|
1050
|
-
export async function taskRelatesFind(projectRoot, taskId, params) {
|
|
1051
|
-
try {
|
|
1052
|
-
const { suggestRelated, discoverRelated } = await import('@cleocode/core/internal');
|
|
1053
|
-
const accessor = await getAccessor(projectRoot);
|
|
1054
|
-
const mode = params?.mode ?? 'suggest';
|
|
1055
|
-
let result;
|
|
1056
|
-
if (mode === 'discover') {
|
|
1057
|
-
result = await discoverRelated(taskId, undefined, accessor);
|
|
1058
|
-
}
|
|
1059
|
-
else {
|
|
1060
|
-
const threshold = params?.threshold ?? 50;
|
|
1061
|
-
result = await suggestRelated(taskId, { threshold }, accessor);
|
|
1062
|
-
}
|
|
1063
|
-
return { success: true, data: result };
|
|
1064
|
-
}
|
|
1065
|
-
catch (err) {
|
|
1066
|
-
return cleoErrorToEngineError(err, 'E_INTERNAL', 'Task plan failed');
|
|
1067
|
-
}
|
|
1068
|
-
}
|
|
1069
|
-
/**
|
|
1070
|
-
* List all labels used in tasks.
|
|
1071
|
-
* @task T5672
|
|
1072
|
-
*/
|
|
1073
|
-
export async function taskLabelList(projectRoot) {
|
|
1074
|
-
try {
|
|
1075
|
-
const { listLabels } = await import('@cleocode/core/internal');
|
|
1076
|
-
const accessor = await getAccessor(projectRoot);
|
|
1077
|
-
const labels = await listLabels(projectRoot, accessor);
|
|
1078
|
-
return { success: true, data: { labels, count: labels.length } };
|
|
1079
|
-
}
|
|
1080
|
-
catch {
|
|
1081
|
-
return engineError('E_NOT_INITIALIZED', 'Task database not initialized');
|
|
1082
|
-
}
|
|
1083
|
-
}
|
|
1084
|
-
/**
|
|
1085
|
-
* Show tasks associated with a label.
|
|
1086
|
-
* @task T5672
|
|
1087
|
-
*/
|
|
1088
|
-
export async function taskLabelShow(projectRoot, label) {
|
|
1089
|
-
try {
|
|
1090
|
-
const { showLabelTasks } = await import('@cleocode/core/internal');
|
|
1091
|
-
const accessor = await getAccessor(projectRoot);
|
|
1092
|
-
const result = await showLabelTasks(label, projectRoot, accessor);
|
|
1093
|
-
return { success: true, data: result };
|
|
1094
|
-
}
|
|
1095
|
-
catch (err) {
|
|
1096
|
-
return cleoErrorToEngineError(err, 'E_INTERNAL', 'Failed to list labels');
|
|
1097
|
-
}
|
|
1098
|
-
}
|
|
1099
|
-
// ---------------------------------------------------------------------------
|
|
1100
|
-
// Sync sub-domain (provider-agnostic task reconciliation)
|
|
1101
|
-
// ---------------------------------------------------------------------------
|
|
1102
|
-
/**
|
|
1103
|
-
* Reconcile external tasks with CLEO as SSoT.
|
|
1104
|
-
*/
|
|
1105
|
-
export async function taskSyncReconcile(projectRoot, params) {
|
|
1106
|
-
try {
|
|
1107
|
-
const { reconcile } = await import('@cleocode/core/internal');
|
|
1108
|
-
const accessor = await getAccessor(projectRoot);
|
|
1109
|
-
const result = await reconcile(params.externalTasks, {
|
|
1110
|
-
providerId: params.providerId,
|
|
1111
|
-
cwd: projectRoot,
|
|
1112
|
-
dryRun: params.dryRun,
|
|
1113
|
-
conflictPolicy: params.conflictPolicy,
|
|
1114
|
-
defaultPhase: params.defaultPhase,
|
|
1115
|
-
defaultLabels: params.defaultLabels,
|
|
1116
|
-
}, accessor);
|
|
1117
|
-
return { success: true, data: result };
|
|
1118
|
-
}
|
|
1119
|
-
catch (err) {
|
|
1120
|
-
return cleoErrorToEngineError(err, 'E_INTERNAL', 'Sync reconcile failed');
|
|
1121
|
-
}
|
|
1122
|
-
}
|
|
1123
|
-
/**
|
|
1124
|
-
* List external task links by provider or task ID.
|
|
1125
|
-
*/
|
|
1126
|
-
export async function taskSyncLinks(projectRoot, params) {
|
|
1127
|
-
try {
|
|
1128
|
-
const { getLinksByProvider, getLinksByTaskId } = await import('@cleocode/core/internal');
|
|
1129
|
-
if (params?.taskId) {
|
|
1130
|
-
const links = await getLinksByTaskId(params.taskId, projectRoot);
|
|
1131
|
-
return { success: true, data: { links, count: links.length } };
|
|
1132
|
-
}
|
|
1133
|
-
if (params?.providerId) {
|
|
1134
|
-
const links = await getLinksByProvider(params.providerId, projectRoot);
|
|
1135
|
-
return { success: true, data: { links, count: links.length } };
|
|
1136
|
-
}
|
|
1137
|
-
return engineError('E_INVALID_INPUT', 'Either providerId or taskId is required');
|
|
1138
|
-
}
|
|
1139
|
-
catch (err) {
|
|
1140
|
-
return cleoErrorToEngineError(err, 'E_INTERNAL', 'Failed to list links');
|
|
1141
|
-
}
|
|
1142
|
-
}
|
|
1143
|
-
/**
|
|
1144
|
-
* Remove all external task links for a provider.
|
|
1145
|
-
*/
|
|
1146
|
-
export async function taskSyncLinksRemove(projectRoot, providerId) {
|
|
1147
|
-
try {
|
|
1148
|
-
const { removeLinksByProvider } = await import('@cleocode/core/internal');
|
|
1149
|
-
const removed = await removeLinksByProvider(providerId, projectRoot);
|
|
1150
|
-
return { success: true, data: { providerId, removed } };
|
|
1151
|
-
}
|
|
1152
|
-
catch (err) {
|
|
1153
|
-
return cleoErrorToEngineError(err, 'E_INTERNAL', 'Failed to remove links');
|
|
1154
|
-
}
|
|
1155
|
-
}
|
|
1156
|
-
/**
|
|
1157
|
-
* Atomically claim a task for an agent.
|
|
1158
|
-
*
|
|
1159
|
-
* Fails if the task is already claimed by a different agent.
|
|
1160
|
-
* No-op if the task is already claimed by the same agent (idempotent).
|
|
1161
|
-
*/
|
|
1162
|
-
export async function taskClaim(projectRoot, taskId, agentId) {
|
|
1163
|
-
try {
|
|
1164
|
-
if (!taskId)
|
|
1165
|
-
return engineError('E_INVALID_INPUT', 'taskId is required');
|
|
1166
|
-
if (!agentId)
|
|
1167
|
-
return engineError('E_INVALID_INPUT', 'agentId is required');
|
|
1168
|
-
const acc = await getAccessor(projectRoot);
|
|
1169
|
-
await acc.claimTask(taskId, agentId);
|
|
1170
|
-
return { success: true, data: { taskId, agentId } };
|
|
1171
|
-
}
|
|
1172
|
-
catch (err) {
|
|
1173
|
-
return cleoErrorToEngineError(err, 'E_INTERNAL', 'Failed to claim task');
|
|
1174
|
-
}
|
|
1175
|
-
}
|
|
1176
|
-
/**
|
|
1177
|
-
* Release an agent's claim on a task, setting assignee to null.
|
|
1178
|
-
*
|
|
1179
|
-
* No-op if the task is not currently claimed.
|
|
1180
|
-
*/
|
|
1181
|
-
export async function taskUnclaim(projectRoot, taskId) {
|
|
1182
|
-
try {
|
|
1183
|
-
if (!taskId)
|
|
1184
|
-
return engineError('E_INVALID_INPUT', 'taskId is required');
|
|
1185
|
-
const acc = await getAccessor(projectRoot);
|
|
1186
|
-
await acc.unclaimTask(taskId);
|
|
1187
|
-
return { success: true, data: { taskId } };
|
|
1188
|
-
}
|
|
1189
|
-
catch (err) {
|
|
1190
|
-
return cleoErrorToEngineError(err, 'E_INTERNAL', 'Failed to unclaim task');
|
|
1191
|
-
}
|
|
1192
|
-
}
|
|
1193
|
-
//# sourceMappingURL=task-engine.js.map
|