@proletariat/cli 0.3.33 → 0.3.35
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/dist/commands/action/create.d.ts +1 -0
- package/dist/commands/action/delete.d.ts +1 -0
- package/dist/commands/action/index.d.ts +1 -0
- package/dist/commands/action/list.d.ts +1 -0
- package/dist/commands/action/list.js +0 -6
- package/dist/commands/action/run.d.ts +1 -0
- package/dist/commands/action/show.d.ts +1 -0
- package/dist/commands/action/update.d.ts +1 -0
- package/dist/commands/agent/auth.d.ts +5 -2
- package/dist/commands/agent/auth.js +10 -17
- package/dist/commands/agent/cleanup.d.ts +2 -1
- package/dist/commands/agent/cleanup.js +0 -6
- package/dist/commands/agent/discover.d.ts +2 -1
- package/dist/commands/agent/discover.js +2 -6
- package/dist/commands/agent/index.d.ts +1 -0
- package/dist/commands/agent/index.js +11 -9
- package/dist/commands/agent/list.d.ts +1 -0
- package/dist/commands/agent/login.d.ts +1 -0
- package/dist/commands/agent/login.js +1 -7
- package/dist/commands/agent/rebuild.d.ts +2 -1
- package/dist/commands/agent/rebuild.js +0 -6
- package/dist/commands/agent/remove.d.ts +2 -1
- package/dist/commands/agent/remove.js +0 -6
- package/dist/commands/agent/restart.d.ts +1 -0
- package/dist/commands/agent/restart.js +1 -7
- package/dist/commands/agent/shell.d.ts +1 -0
- package/dist/commands/agent/shell.js +1 -7
- package/dist/commands/agent/staff/add.d.ts +1 -0
- package/dist/commands/agent/staff/add.js +1 -0
- package/dist/commands/agent/staff/index.d.ts +15 -0
- package/dist/commands/agent/staff/index.js +83 -0
- package/dist/commands/agent/staff/list.d.ts +1 -0
- package/dist/commands/agent/staff/list.js +1 -0
- package/dist/commands/agent/staff/remove.d.ts +1 -0
- package/dist/commands/agent/staff/remove.js +1 -0
- package/dist/commands/agent/status.d.ts +1 -0
- package/dist/commands/agent/status.js +1 -7
- package/dist/commands/agent/themes/add-names.d.ts +1 -0
- package/dist/commands/agent/themes/add-names.js +1 -0
- package/dist/commands/agent/themes/create.d.ts +1 -0
- package/dist/commands/agent/themes/create.js +1 -0
- package/dist/commands/agent/themes/index.d.ts +10 -0
- package/dist/commands/agent/themes/index.js +144 -0
- package/dist/commands/agent/themes/list.d.ts +1 -0
- package/dist/commands/agent/themes/list.js +1 -0
- package/dist/commands/agent/themes/set.d.ts +1 -0
- package/dist/commands/agent/themes/set.js +1 -0
- package/dist/commands/agent/visit.d.ts +1 -0
- package/dist/commands/agent/visit.js +1 -7
- package/dist/commands/agents/themes/add-names.d.ts +1 -0
- package/dist/commands/agents/themes/add-names.js +1 -0
- package/dist/commands/agents/themes/create.d.ts +1 -0
- package/dist/commands/agents/themes/create.js +1 -0
- package/dist/commands/agents/themes/list.d.ts +1 -0
- package/dist/commands/agents/themes/list.js +1 -0
- package/dist/commands/autocomplete/setup.d.ts +1 -0
- package/dist/commands/board/index.d.ts +1 -0
- package/dist/commands/board/view.d.ts +1 -0
- package/dist/commands/board/watch.d.ts +1 -0
- package/dist/commands/branch/create.d.ts +1 -0
- package/dist/commands/branch/create.js +0 -6
- package/dist/commands/branch/index.d.ts +1 -0
- package/dist/commands/branch/index.js +0 -7
- package/dist/commands/branch/list.d.ts +1 -0
- package/dist/commands/branch/validate.d.ts +1 -0
- package/dist/commands/branch/where.d.ts +1 -0
- package/dist/commands/branch/where.js +3 -9
- package/dist/commands/category/create.d.ts +1 -0
- package/dist/commands/category/delete.d.ts +1 -0
- package/dist/commands/category/index.d.ts +1 -0
- package/dist/commands/category/list.d.ts +1 -0
- package/dist/commands/category/list.js +2 -2
- package/dist/commands/category/rename.d.ts +1 -0
- package/dist/commands/claude.d.ts +2 -1
- package/dist/commands/claude.js +2 -6
- package/dist/commands/commit.d.ts +2 -1
- package/dist/commands/commit.js +2 -6
- package/dist/commands/config/index.d.ts +2 -1
- package/dist/commands/config/index.js +3 -7
- package/dist/commands/diet.d.ts +1 -0
- package/dist/commands/docker/clean.d.ts +1 -0
- package/dist/commands/docker/index.d.ts +1 -0
- package/dist/commands/docker/list.d.ts +1 -0
- package/dist/commands/docker/logs.d.ts +2 -0
- package/dist/commands/docker/logs.js +2 -0
- package/dist/commands/docker/prune.d.ts +1 -0
- package/dist/commands/docker/restart.d.ts +1 -0
- package/dist/commands/docker/shell.d.ts +2 -0
- package/dist/commands/docker/shell.js +2 -0
- package/dist/commands/docker/start.d.ts +2 -0
- package/dist/commands/docker/start.js +2 -0
- package/dist/commands/docker/status.d.ts +1 -0
- package/dist/commands/docker/stop.d.ts +1 -0
- package/dist/commands/epic/activate.d.ts +1 -0
- package/dist/commands/epic/activate.js +1 -7
- package/dist/commands/epic/archive.d.ts +2 -1
- package/dist/commands/epic/archive.js +0 -6
- package/dist/commands/epic/create.d.ts +2 -1
- package/dist/commands/epic/create.js +0 -6
- package/dist/commands/epic/delete.d.ts +1 -0
- package/dist/commands/epic/index.d.ts +1 -0
- package/dist/commands/epic/index.js +0 -7
- package/dist/commands/epic/list.d.ts +1 -0
- package/dist/commands/epic/move.d.ts +2 -1
- package/dist/commands/epic/move.js +0 -6
- package/dist/commands/epic/progress.d.ts +2 -1
- package/dist/commands/epic/progress.js +0 -6
- package/dist/commands/epic/project.d.ts +2 -1
- package/dist/commands/epic/project.js +0 -6
- package/dist/commands/epic/reorder.d.ts +1 -0
- package/dist/commands/epic/reorder.js +0 -6
- package/dist/commands/epic/spec.d.ts +2 -1
- package/dist/commands/epic/spec.js +0 -6
- package/dist/commands/epic/ticket.d.ts +2 -1
- package/dist/commands/epic/ticket.js +0 -6
- package/dist/commands/epic/view.d.ts +1 -0
- package/dist/commands/epic/view.js +1 -7
- package/dist/commands/execution/config.d.ts +2 -1
- package/dist/commands/execution/config.js +1 -7
- package/dist/commands/execution/index.d.ts +1 -0
- package/dist/commands/execution/index.js +1 -8
- package/dist/commands/execution/list.d.ts +1 -0
- package/dist/commands/execution/logs.d.ts +1 -0
- package/dist/commands/execution/logs.js +1 -7
- package/dist/commands/execution/stop.d.ts +1 -0
- package/dist/commands/execution/stop.js +1 -7
- package/dist/commands/execution/view.d.ts +1 -0
- package/dist/commands/execution/view.js +2 -8
- package/dist/commands/feedback/index.d.ts +1 -0
- package/dist/commands/feedback/list.d.ts +1 -0
- package/dist/commands/feedback/submit.d.ts +1 -0
- package/dist/commands/feedback/view.d.ts +1 -0
- package/dist/commands/gh/index.d.ts +1 -0
- package/dist/commands/gh/login.d.ts +1 -0
- package/dist/commands/gh/status.d.ts +1 -0
- package/dist/commands/gh/token.d.ts +1 -0
- package/dist/commands/init.d.ts +2 -1
- package/dist/commands/init.js +3 -8
- package/dist/commands/label/create.d.ts +20 -0
- package/dist/commands/label/create.js +56 -0
- package/dist/commands/label/delete.d.ts +17 -0
- package/dist/commands/label/delete.js +31 -0
- package/dist/commands/label/group/create.d.ts +20 -0
- package/dist/commands/label/group/create.js +54 -0
- package/dist/commands/label/group/list.d.ts +14 -0
- package/dist/commands/label/group/list.js +51 -0
- package/dist/commands/label/index.d.ts +15 -0
- package/dist/commands/label/index.js +58 -0
- package/dist/commands/label/list.d.ts +16 -0
- package/dist/commands/label/list.js +82 -0
- package/dist/commands/link/create.d.ts +1 -0
- package/dist/commands/link/create.js +0 -6
- package/dist/commands/link/index.d.ts +1 -0
- package/dist/commands/link/index.js +1 -7
- package/dist/commands/link/list.d.ts +1 -0
- package/dist/commands/link/list.js +3 -8
- package/dist/commands/link/remove.d.ts +1 -0
- package/dist/commands/link/remove.js +0 -6
- package/dist/commands/mcp-server.js +2 -1
- package/dist/commands/phase/create.d.ts +1 -0
- package/dist/commands/phase/create.js +1 -1
- package/dist/commands/phase/delete.d.ts +1 -0
- package/dist/commands/phase/delete.js +1 -1
- package/dist/commands/phase/list.d.ts +1 -0
- package/dist/commands/phase/move.d.ts +1 -0
- package/dist/commands/phase/move.js +2 -2
- package/dist/commands/phase/template/apply.d.ts +26 -0
- package/dist/commands/phase/template/apply.js +14 -0
- package/dist/commands/phase/template/create.d.ts +23 -0
- package/dist/commands/phase/template/create.js +14 -0
- package/dist/commands/phase/template/delete.d.ts +18 -0
- package/dist/commands/phase/template/delete.js +61 -0
- package/dist/commands/phase/template/list.d.ts +17 -0
- package/dist/commands/phase/template/list.js +88 -0
- package/dist/commands/phase/template/update.d.ts +1 -0
- package/dist/commands/phase/template/update.js +1 -0
- package/dist/commands/phase/update.d.ts +1 -0
- package/dist/commands/phase/update.js +2 -2
- package/dist/commands/pmo/init.d.ts +4 -3
- package/dist/commands/pmo/init.js +2 -7
- package/dist/commands/pr/create.d.ts +1 -0
- package/dist/commands/pr/index.d.ts +1 -0
- package/dist/commands/pr/link.d.ts +1 -0
- package/dist/commands/pr/list.d.ts +1 -0
- package/dist/commands/pr/status.d.ts +1 -0
- package/dist/commands/priority/add.d.ts +1 -0
- package/dist/commands/priority/add.js +1 -1
- package/dist/commands/priority/list.d.ts +1 -0
- package/dist/commands/priority/remove.d.ts +1 -0
- package/dist/commands/priority/set.d.ts +1 -0
- package/dist/commands/project/archive.d.ts +1 -0
- package/dist/commands/project/create.d.ts +1 -0
- package/dist/commands/project/delete.d.ts +1 -0
- package/dist/commands/project/index.d.ts +1 -0
- package/dist/commands/project/list.d.ts +1 -0
- package/dist/commands/project/spec.d.ts +1 -0
- package/dist/commands/project/unarchive.d.ts +1 -0
- package/dist/commands/project/update.d.ts +1 -0
- package/dist/commands/project/update.js +0 -2
- package/dist/commands/project/view.d.ts +1 -0
- package/dist/commands/pull.d.ts +1 -0
- package/dist/commands/repo/add.d.ts +1 -0
- package/dist/commands/repo/add.js +0 -6
- package/dist/commands/repo/create.d.ts +1 -0
- package/dist/commands/repo/index.d.ts +1 -0
- package/dist/commands/repo/list.d.ts +1 -0
- package/dist/commands/repo/remove.d.ts +1 -0
- package/dist/commands/repo/view.d.ts +1 -0
- package/dist/commands/roadmap/add-project.d.ts +1 -0
- package/dist/commands/roadmap/add-project.js +0 -6
- package/dist/commands/roadmap/create.d.ts +1 -0
- package/dist/commands/roadmap/create.js +0 -6
- package/dist/commands/roadmap/delete.d.ts +1 -0
- package/dist/commands/roadmap/delete.js +0 -6
- package/dist/commands/roadmap/generate.d.ts +1 -0
- package/dist/commands/roadmap/generate.js +1 -8
- package/dist/commands/roadmap/index.d.ts +1 -0
- package/dist/commands/roadmap/index.js +0 -7
- package/dist/commands/roadmap/list.d.ts +1 -0
- package/dist/commands/roadmap/remove-project.d.ts +1 -0
- package/dist/commands/roadmap/remove-project.js +0 -6
- package/dist/commands/roadmap/reorder.d.ts +1 -0
- package/dist/commands/roadmap/reorder.js +0 -6
- package/dist/commands/roadmap/update.d.ts +1 -0
- package/dist/commands/roadmap/update.js +0 -6
- package/dist/commands/roadmap/view.d.ts +1 -0
- package/dist/commands/roadmap/view.js +1 -7
- package/dist/commands/session/attach.d.ts +2 -1
- package/dist/commands/session/attach.js +0 -6
- package/dist/commands/session/health.d.ts +1 -0
- package/dist/commands/session/health.js +1 -1
- package/dist/commands/session/index.d.ts +1 -0
- package/dist/commands/session/index.js +0 -7
- package/dist/commands/session/list.d.ts +1 -0
- package/dist/commands/spec/create.d.ts +1 -0
- package/dist/commands/spec/delete.d.ts +1 -0
- package/dist/commands/spec/edit.d.ts +1 -0
- package/dist/commands/spec/index.d.ts +1 -0
- package/dist/commands/spec/link/depends.d.ts +18 -0
- package/dist/commands/spec/link/depends.js +86 -0
- package/dist/commands/spec/link/index.d.ts +17 -0
- package/dist/commands/spec/link/index.js +92 -0
- package/dist/commands/spec/link/remove.d.ts +18 -0
- package/dist/commands/spec/link/remove.js +90 -0
- package/dist/commands/spec/list.d.ts +1 -0
- package/dist/commands/spec/plan.d.ts +1 -0
- package/dist/commands/spec/ticket.d.ts +1 -0
- package/dist/commands/spec/view.d.ts +1 -0
- package/dist/commands/staff/add.d.ts +3 -2
- package/dist/commands/staff/add.js +2 -6
- package/dist/commands/staff/index.d.ts +2 -1
- package/dist/commands/staff/index.js +0 -6
- package/dist/commands/staff/list.d.ts +1 -0
- package/dist/commands/staff/remove.d.ts +2 -1
- package/dist/commands/staff/remove.js +0 -6
- package/dist/commands/status/category.d.ts +1 -0
- package/dist/commands/status/create.d.ts +1 -0
- package/dist/commands/status/delete.d.ts +1 -0
- package/dist/commands/status/index.d.ts +1 -0
- package/dist/commands/status/list.d.ts +1 -0
- package/dist/commands/status/move.d.ts +1 -0
- package/dist/commands/status/update.d.ts +1 -0
- package/dist/commands/support/book.d.ts +1 -0
- package/dist/commands/support/discord.d.ts +1 -0
- package/dist/commands/support/docs.d.ts +1 -0
- package/dist/commands/support/index.d.ts +1 -0
- package/dist/commands/support/issues.d.ts +1 -0
- package/dist/commands/support/logs.d.ts +1 -0
- package/dist/commands/support/logs.js +2 -2
- package/dist/commands/template/apply.d.ts +1 -0
- package/dist/commands/template/apply.js +5 -10
- package/dist/commands/template/create.d.ts +1 -0
- package/dist/commands/template/create.js +1 -7
- package/dist/commands/template/delete.d.ts +1 -0
- package/dist/commands/template/delete.js +0 -6
- package/dist/commands/template/index.d.ts +1 -0
- package/dist/commands/template/index.js +2 -7
- package/dist/commands/template/list.d.ts +1 -0
- package/dist/commands/template/list.js +1 -7
- package/dist/commands/template/save.d.ts +1 -0
- package/dist/commands/template/save.js +0 -6
- package/dist/commands/template/update.d.ts +1 -0
- package/dist/commands/template/update.js +0 -6
- package/dist/commands/terminal/title.d.ts +1 -0
- package/dist/commands/theme/index.d.ts +1 -0
- package/dist/commands/theme/index.js +2 -7
- package/dist/commands/theme/list.d.ts +1 -0
- package/dist/commands/theme/set.d.ts +1 -0
- package/dist/commands/theme/set.js +3 -7
- package/dist/commands/ticket/bulk.d.ts +1 -0
- package/dist/commands/ticket/bulk.js +0 -7
- package/dist/commands/ticket/category.d.ts +1 -0
- package/dist/commands/ticket/complete.d.ts +2 -1
- package/dist/commands/ticket/complete.js +2 -8
- package/dist/commands/ticket/create.d.ts +2 -1
- package/dist/commands/ticket/create.js +0 -6
- package/dist/commands/ticket/delete.d.ts +2 -1
- package/dist/commands/ticket/delete.js +0 -6
- package/dist/commands/ticket/edit.d.ts +1 -0
- package/dist/commands/ticket/edit.js +0 -6
- package/dist/commands/ticket/epic.d.ts +2 -1
- package/dist/commands/ticket/epic.js +0 -6
- package/dist/commands/ticket/index.d.ts +1 -0
- package/dist/commands/ticket/index.js +6 -9
- package/dist/commands/ticket/link/block.d.ts +15 -0
- package/dist/commands/ticket/link/block.js +95 -0
- package/dist/commands/ticket/link/index.d.ts +14 -0
- package/dist/commands/ticket/link/index.js +96 -0
- package/dist/commands/ticket/list.d.ts +2 -0
- package/dist/commands/ticket/list.js +6 -0
- package/dist/commands/ticket/move.d.ts +2 -1
- package/dist/commands/ticket/move.js +2 -8
- package/dist/commands/ticket/project.d.ts +2 -1
- package/dist/commands/ticket/project.js +0 -6
- package/dist/commands/ticket/reassign.d.ts +2 -1
- package/dist/commands/ticket/reassign.js +0 -6
- package/dist/commands/ticket/resolve.d.ts +68 -0
- package/dist/commands/ticket/resolve.js +294 -0
- package/dist/commands/ticket/spec.d.ts +2 -1
- package/dist/commands/ticket/spec.js +0 -6
- package/dist/commands/ticket/status.d.ts +1 -0
- package/dist/commands/ticket/status.js +1 -7
- package/dist/commands/ticket/template/apply.d.ts +26 -0
- package/dist/commands/ticket/template/apply.js +14 -0
- package/dist/commands/ticket/template/delete.d.ts +18 -0
- package/dist/commands/ticket/template/delete.js +61 -0
- package/dist/commands/ticket/template/list.d.ts +17 -0
- package/dist/commands/ticket/template/list.js +77 -0
- package/dist/commands/ticket/template/save.d.ts +17 -0
- package/dist/commands/ticket/template/save.js +97 -0
- package/dist/commands/ticket/update.d.ts +2 -1
- package/dist/commands/ticket/update.js +0 -6
- package/dist/commands/ticket/view.d.ts +2 -0
- package/dist/commands/ticket/view.js +2 -7
- package/dist/commands/whoami.d.ts +1 -0
- package/dist/commands/work/complete.d.ts +1 -0
- package/dist/commands/work/complete.js +1 -7
- package/dist/commands/work/index.d.ts +1 -0
- package/dist/commands/work/index.js +4 -7
- package/dist/commands/work/ready.d.ts +2 -1
- package/dist/commands/work/ready.js +38 -14
- package/dist/commands/work/resolve.d.ts +15 -0
- package/dist/commands/work/resolve.js +76 -0
- package/dist/commands/work/revise.d.ts +2 -1
- package/dist/commands/work/revise.js +0 -6
- package/dist/commands/work/spawn-all.d.ts +2 -1
- package/dist/commands/work/spawn-all.js +2 -6
- package/dist/commands/work/spawn.d.ts +2 -1
- package/dist/commands/work/spawn.js +4 -10
- package/dist/commands/work/start.d.ts +3 -1
- package/dist/commands/work/start.js +52 -23
- package/dist/commands/work/watch.d.ts +2 -1
- package/dist/commands/work/watch.js +0 -6
- package/dist/commands/workflow/create.d.ts +1 -0
- package/dist/commands/workflow/delete.d.ts +1 -0
- package/dist/commands/workflow/index.d.ts +1 -0
- package/dist/commands/workflow/index.js +1 -7
- package/dist/commands/workflow/list.d.ts +1 -0
- package/dist/commands/workflow/switch.d.ts +1 -0
- package/dist/commands/workflow/view.d.ts +1 -0
- package/dist/commands/workspace/add.d.ts +2 -0
- package/dist/commands/workspace/add.js +2 -0
- package/dist/commands/workspace/list.d.ts +1 -0
- package/dist/commands/workspace/list.js +4 -8
- package/dist/commands/workspace/prune.d.ts +1 -0
- package/dist/commands/workspace/prune.js +4 -6
- package/dist/commands/workspace/remove.d.ts +1 -0
- package/dist/commands/workspace/remove.js +3 -7
- package/dist/commands/workspace/use.d.ts +1 -0
- package/dist/commands/workspace/use.js +3 -7
- package/dist/lib/database/drizzle-schema.d.ts +1 -1
- package/dist/lib/database/index.d.ts +1 -1
- package/dist/lib/database/index.js +20 -0
- package/dist/lib/execution/devcontainer.js +3 -1
- package/dist/lib/execution/runners.d.ts +7 -2
- package/dist/lib/execution/runners.js +18 -10
- package/dist/lib/execution/types.d.ts +1 -0
- package/dist/lib/flags/resolver.js +1 -0
- package/dist/lib/mcp/helpers.d.ts +1 -2
- package/dist/lib/mcp/tools/diet.js +1 -0
- package/dist/lib/mcp/tools/index.d.ts +1 -0
- package/dist/lib/mcp/tools/index.js +1 -0
- package/dist/lib/mcp/tools/label.d.ts +6 -0
- package/dist/lib/mcp/tools/label.js +338 -0
- package/dist/lib/mcp/tools/ticket.js +53 -17
- package/dist/lib/multiline-input.js +6 -18
- package/dist/lib/pmo/base-command.d.ts +4 -2
- package/dist/lib/pmo/base-command.js +9 -4
- package/dist/lib/pmo/schema.d.ts +6 -0
- package/dist/lib/pmo/schema.js +44 -0
- package/dist/lib/pmo/storage/base.d.ts +6 -0
- package/dist/lib/pmo/storage/base.js +185 -7
- package/dist/lib/pmo/storage/index.d.ts +23 -1
- package/dist/lib/pmo/storage/index.js +59 -1
- package/dist/lib/pmo/storage/labels.d.ts +55 -0
- package/dist/lib/pmo/storage/labels.js +346 -0
- package/dist/lib/pmo/storage/tickets.js +17 -0
- package/dist/lib/pmo/storage/types.d.ts +24 -0
- package/dist/lib/pmo/types.d.ts +44 -0
- package/dist/lib/pmo/utils.js +1 -1
- package/dist/lib/prompt-json.d.ts +5 -2
- package/dist/lib/prompt-json.js +4 -4
- package/oclif.manifest.json +6571 -3748
- package/package.json +1 -1
package/dist/lib/pmo/schema.js
CHANGED
|
@@ -41,6 +41,10 @@ export const PMO_TABLES = {
|
|
|
41
41
|
// Roadmap tables (ordered collections of projects for documentation)
|
|
42
42
|
roadmaps: 'pmo_roadmaps', // Named roadmap definitions
|
|
43
43
|
roadmap_projects: 'pmo_roadmap_projects', // Many-to-many: roadmaps ↔ projects with ordering
|
|
44
|
+
// Label system tables
|
|
45
|
+
label_groups: 'pmo_label_groups',
|
|
46
|
+
labels: 'pmo_labels',
|
|
47
|
+
ticket_labels: 'pmo_ticket_labels',
|
|
44
48
|
// Legacy tables (deprecated, kept for migration)
|
|
45
49
|
columns: 'pmo_columns', // DEPRECATED: use workflow_statuses
|
|
46
50
|
board_tickets: 'pmo_board_tickets', // DEPRECATED: tickets now use status_id directly
|
|
@@ -427,6 +431,37 @@ export const PMO_TABLE_SCHEMAS = {
|
|
|
427
431
|
suggested_subtasks TEXT NOT NULL DEFAULT '[]',
|
|
428
432
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
429
433
|
)`,
|
|
434
|
+
// Label groups (workspace-scoped grouping for labels)
|
|
435
|
+
label_groups: `
|
|
436
|
+
CREATE TABLE IF NOT EXISTS ${PMO_TABLES.label_groups} (
|
|
437
|
+
id TEXT PRIMARY KEY,
|
|
438
|
+
name TEXT NOT NULL UNIQUE,
|
|
439
|
+
description TEXT,
|
|
440
|
+
is_exclusive INTEGER NOT NULL DEFAULT 1,
|
|
441
|
+
is_required INTEGER NOT NULL DEFAULT 0,
|
|
442
|
+
position INTEGER NOT NULL DEFAULT 0,
|
|
443
|
+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
444
|
+
)`,
|
|
445
|
+
// Labels (workspace-scoped, optionally grouped)
|
|
446
|
+
labels: `
|
|
447
|
+
CREATE TABLE IF NOT EXISTS ${PMO_TABLES.labels} (
|
|
448
|
+
id TEXT PRIMARY KEY,
|
|
449
|
+
name TEXT NOT NULL,
|
|
450
|
+
color TEXT,
|
|
451
|
+
description TEXT,
|
|
452
|
+
group_id TEXT REFERENCES ${PMO_TABLES.label_groups}(id) ON DELETE SET NULL,
|
|
453
|
+
position INTEGER NOT NULL DEFAULT 0,
|
|
454
|
+
is_builtin INTEGER NOT NULL DEFAULT 0,
|
|
455
|
+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
456
|
+
UNIQUE(name, group_id)
|
|
457
|
+
)`,
|
|
458
|
+
// Junction table: ticket-label associations (replaces JSON labels field)
|
|
459
|
+
ticket_labels: `
|
|
460
|
+
CREATE TABLE IF NOT EXISTS ${PMO_TABLES.ticket_labels} (
|
|
461
|
+
ticket_id TEXT NOT NULL REFERENCES ${PMO_TABLES.tickets}(id) ON DELETE CASCADE,
|
|
462
|
+
label_id TEXT NOT NULL REFERENCES ${PMO_TABLES.labels}(id) ON DELETE CASCADE,
|
|
463
|
+
PRIMARY KEY (ticket_id, label_id)
|
|
464
|
+
)`,
|
|
430
465
|
// Roadmap definitions (named collections of projects for documentation)
|
|
431
466
|
roadmaps: `
|
|
432
467
|
CREATE TABLE IF NOT EXISTS ${PMO_TABLES.roadmaps} (
|
|
@@ -502,6 +537,12 @@ export const PMO_INDEXES = `
|
|
|
502
537
|
CREATE INDEX IF NOT EXISTS idx_pmo_roadmap_projects_position ON ${PMO_TABLES.roadmap_projects}(roadmap_id, position);
|
|
503
538
|
CREATE INDEX IF NOT EXISTS idx_pmo_categories_type ON ${PMO_TABLES.categories}(type);
|
|
504
539
|
CREATE INDEX IF NOT EXISTS idx_pmo_categories_position ON ${PMO_TABLES.categories}(type, position);
|
|
540
|
+
CREATE INDEX IF NOT EXISTS idx_pmo_label_groups_position ON ${PMO_TABLES.label_groups}(position);
|
|
541
|
+
CREATE INDEX IF NOT EXISTS idx_pmo_labels_group ON ${PMO_TABLES.labels}(group_id);
|
|
542
|
+
CREATE INDEX IF NOT EXISTS idx_pmo_labels_position ON ${PMO_TABLES.labels}(group_id, position);
|
|
543
|
+
CREATE INDEX IF NOT EXISTS idx_pmo_labels_builtin ON ${PMO_TABLES.labels}(is_builtin);
|
|
544
|
+
CREATE INDEX IF NOT EXISTS idx_pmo_ticket_labels_ticket ON ${PMO_TABLES.ticket_labels}(ticket_id);
|
|
545
|
+
CREATE INDEX IF NOT EXISTS idx_pmo_ticket_labels_label ON ${PMO_TABLES.ticket_labels}(label_id);
|
|
505
546
|
`;
|
|
506
547
|
// =============================================================================
|
|
507
548
|
// Combined Schema
|
|
@@ -540,6 +581,9 @@ export const PMO_SCHEMA_SQL = [
|
|
|
540
581
|
PMO_TABLE_SCHEMAS.id_sequences, // Sequence counters for ID generation
|
|
541
582
|
PMO_TABLE_SCHEMAS.actions, // Work actions (reusable agent prompts)
|
|
542
583
|
PMO_TABLE_SCHEMAS.ticket_templates, // Ticket templates for quick creation
|
|
584
|
+
PMO_TABLE_SCHEMAS.label_groups, // Label groups (before labels for FK)
|
|
585
|
+
PMO_TABLE_SCHEMAS.labels, // Labels (before ticket_labels for FK)
|
|
586
|
+
PMO_TABLE_SCHEMAS.ticket_labels, // Ticket-label junction table
|
|
543
587
|
PMO_TABLE_SCHEMAS.roadmaps, // Named roadmap definitions
|
|
544
588
|
PMO_TABLE_SCHEMAS.roadmap_projects, // Roadmap-to-project associations
|
|
545
589
|
// Legacy tables (kept for migration, will be dropped after data migrated)
|
|
@@ -42,6 +42,12 @@ export declare function seedBuiltinCategories(db: Database.Database): void;
|
|
|
42
42
|
* Preserves any existing user-defined priority scale.
|
|
43
43
|
*/
|
|
44
44
|
export declare function seedDefaultPriorities(db: Database.Database): void;
|
|
45
|
+
/**
|
|
46
|
+
* Seed built-in label groups and labels.
|
|
47
|
+
* Creates Function, Type, and Area groups with their labels.
|
|
48
|
+
* Migrates existing ticket category values to Function labels.
|
|
49
|
+
*/
|
|
50
|
+
export declare function seedBuiltinLabels(db: Database.Database): void;
|
|
45
51
|
/**
|
|
46
52
|
* Update board timestamp for a project.
|
|
47
53
|
*/
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { PMO_TABLES, PMO_SCHEMA_SQL, validateTicketSchema } from '../schema.js';
|
|
6
6
|
import { TICKET_CATEGORIES, STATE_CATEGORY_ORDER } from '../types.js';
|
|
7
7
|
import { BUILTIN_TEMPLATES } from '../templates-builtin.js';
|
|
8
|
-
import {
|
|
8
|
+
import { setWorkspacePriorities, DEFAULT_PRIORITIES } from '../utils.js';
|
|
9
9
|
const T = PMO_TABLES;
|
|
10
10
|
/**
|
|
11
11
|
* Initialize PMO tables in the database.
|
|
@@ -20,6 +20,7 @@ export function initializePMOTables(db) {
|
|
|
20
20
|
seedBuiltinActions(db);
|
|
21
21
|
seedBuiltinTicketTemplates(db);
|
|
22
22
|
seedDefaultPriorities(db); // Seed default priority scale if not set
|
|
23
|
+
seedBuiltinLabels(db); // Seed built-in label groups and labels
|
|
23
24
|
validateTicketSchema(db);
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
@@ -467,6 +468,22 @@ Analyze this ticket and improve its definition:
|
|
|
467
468
|
|
|
468
469
|
Do NOT implement the ticket - only improve its definition so it's ready to be worked on.
|
|
469
470
|
|
|
471
|
+
## Flagging Ambiguities
|
|
472
|
+
|
|
473
|
+
If you identify ambiguities or questions that need human clarification, add them to the description using this **exact format**:
|
|
474
|
+
|
|
475
|
+
\`\`\`
|
|
476
|
+
**Q1:** Should the API use REST or GraphQL?
|
|
477
|
+
**Q2:** What is the expected timeout for sessions?
|
|
478
|
+
**Q3:** Should this feature be behind a feature flag?
|
|
479
|
+
\`\`\`
|
|
480
|
+
|
|
481
|
+
When questions are added:
|
|
482
|
+
- Add the \`needs-clarification\` label: \`--add-label "needs-clarification"\`
|
|
483
|
+
- Questions can later be resolved with \`prlt ticket resolve\` or \`prlt work resolve\`
|
|
484
|
+
|
|
485
|
+
If NO ambiguities are found, add the \`ready\` label instead.
|
|
486
|
+
|
|
470
487
|
**AI Agent Tip:** When running \`prlt\` commands without all required arguments, use \`--json\` to receive interactive prompts as structured JSON.
|
|
471
488
|
|
|
472
489
|
## Ticket Schema Reference
|
|
@@ -522,12 +539,62 @@ Requirements:
|
|
|
522
539
|
- Use \`--clear-subtasks\` if replacing existing subtasks
|
|
523
540
|
- Use \`--clear-ac\` if replacing existing acceptance criteria
|
|
524
541
|
|
|
542
|
+
**Tip:** Use \`prlt ticket view <id>\` to see full ticket details at any time.
|
|
543
|
+
|
|
525
544
|
After updating, output a brief summary of your grooming changes.`,
|
|
526
545
|
suggestedForCategories: ['backlog'],
|
|
527
546
|
defaultMoveToCategory: 'unstarted',
|
|
528
547
|
modifiesCode: false,
|
|
529
548
|
position: 0,
|
|
530
549
|
},
|
|
550
|
+
{
|
|
551
|
+
id: 'resolve',
|
|
552
|
+
name: 'Resolve',
|
|
553
|
+
description: 'Help human resolve ambiguity questions flagged during grooming',
|
|
554
|
+
prompt: `${PRLT_USAGE_RULE}
|
|
555
|
+
|
|
556
|
+
---
|
|
557
|
+
|
|
558
|
+
# Action: Resolve Ambiguities
|
|
559
|
+
|
|
560
|
+
This ticket has been groomed and has open questions (Q1, Q2, etc.) that need human answers.
|
|
561
|
+
|
|
562
|
+
Your job is to help the human answer each question by:
|
|
563
|
+
1. Reading the ticket description to find all **Q1:**, **Q2:**, etc. questions
|
|
564
|
+
2. For each question, explore the codebase to find relevant context
|
|
565
|
+
3. Present each question to the human with your findings and a suggested answer
|
|
566
|
+
4. Collect the human's answer (they may accept your suggestion or provide their own)
|
|
567
|
+
5. Write the resolved answers back into the ticket description
|
|
568
|
+
|
|
569
|
+
## Process
|
|
570
|
+
|
|
571
|
+
For each question:
|
|
572
|
+
1. **Search the codebase** for relevant context (files, patterns, existing implementations)
|
|
573
|
+
2. **Present your findings**: "Q1: Should this use REST or GraphQL? I found you're already using GraphQL in \`src/api/schema.ts\`..."
|
|
574
|
+
3. **Suggest an answer** based on the codebase context
|
|
575
|
+
4. **Ask the human** to confirm or provide their own answer
|
|
576
|
+
5. After collecting all answers, update the ticket:
|
|
577
|
+
\`\`\`bash
|
|
578
|
+
prlt ticket edit {{TICKET_ID}} --description "updated description with answers"
|
|
579
|
+
prlt ticket edit {{TICKET_ID}} --remove-label "needs-clarification" --add-label "ready"
|
|
580
|
+
\`\`\`
|
|
581
|
+
|
|
582
|
+
## Important
|
|
583
|
+
- This is an INTERACTIVE session - always ask the human before writing answers
|
|
584
|
+
- If the ticket has acceptance criteria or subtasks that need updating based on answers, update those too
|
|
585
|
+
- After resolving, move the ticket to the Ready column if all questions are answered`,
|
|
586
|
+
endPrompt: `After resolving all questions:
|
|
587
|
+
1. Update the ticket description with answers below each question
|
|
588
|
+
2. Remove the \`needs-clarification\` label and add \`ready\` label
|
|
589
|
+
3. Update acceptance criteria and subtasks if answers affect them
|
|
590
|
+
|
|
591
|
+
\`\`\`bash
|
|
592
|
+
prlt ticket edit {{TICKET_ID}} --description "..." --remove-label "needs-clarification" --add-label "ready"
|
|
593
|
+
\`\`\``,
|
|
594
|
+
suggestedForCategories: [],
|
|
595
|
+
modifiesCode: false,
|
|
596
|
+
position: 1,
|
|
597
|
+
},
|
|
531
598
|
{
|
|
532
599
|
id: 'implement',
|
|
533
600
|
name: 'Implement',
|
|
@@ -579,7 +646,7 @@ When complete, the ticket should be ready for code review.`,
|
|
|
579
646
|
suggestedForCategories: ['unstarted', 'started'],
|
|
580
647
|
defaultMoveToCategory: 'started',
|
|
581
648
|
modifiesCode: true,
|
|
582
|
-
position:
|
|
649
|
+
position: 2,
|
|
583
650
|
},
|
|
584
651
|
{
|
|
585
652
|
id: 'continue',
|
|
@@ -624,7 +691,7 @@ git add -A && prlt commit "your change" && git push
|
|
|
624
691
|
suggestedForCategories: ['started'],
|
|
625
692
|
defaultMoveToCategory: 'started',
|
|
626
693
|
modifiesCode: true,
|
|
627
|
-
position:
|
|
694
|
+
position: 3,
|
|
628
695
|
},
|
|
629
696
|
{
|
|
630
697
|
id: 'test',
|
|
@@ -666,7 +733,7 @@ git add -A && prlt commit "add tests for X" && git push
|
|
|
666
733
|
**IMPORTANT:** Use the global \`prlt\` command.`,
|
|
667
734
|
suggestedForCategories: ['started', 'completed'],
|
|
668
735
|
modifiesCode: true,
|
|
669
|
-
position:
|
|
736
|
+
position: 4,
|
|
670
737
|
},
|
|
671
738
|
{
|
|
672
739
|
id: 'review',
|
|
@@ -689,7 +756,7 @@ Output a review summary with your findings and any concerns.`,
|
|
|
689
756
|
No commits are needed for code review.`,
|
|
690
757
|
suggestedForCategories: ['started', 'completed'],
|
|
691
758
|
modifiesCode: false,
|
|
692
|
-
position:
|
|
759
|
+
position: 5,
|
|
693
760
|
},
|
|
694
761
|
{
|
|
695
762
|
id: 'revise',
|
|
@@ -715,7 +782,7 @@ The PR will be updated automatically.`,
|
|
|
715
782
|
suggestedForCategories: ['completed'],
|
|
716
783
|
defaultMoveToCategory: 'started',
|
|
717
784
|
modifiesCode: true,
|
|
718
|
-
position:
|
|
785
|
+
position: 6,
|
|
719
786
|
},
|
|
720
787
|
];
|
|
721
788
|
// Use INSERT OR REPLACE to always update builtin actions with latest prompts
|
|
@@ -920,7 +987,6 @@ export function seedBuiltinCategories(db) {
|
|
|
920
987
|
* Preserves any existing user-defined priority scale.
|
|
921
988
|
*/
|
|
922
989
|
export function seedDefaultPriorities(db) {
|
|
923
|
-
const existing = getWorkspacePriorities(db);
|
|
924
990
|
// getWorkspacePriorities returns DEFAULT_PRIORITIES if not set,
|
|
925
991
|
// but we need to check if it's actually stored in the DB
|
|
926
992
|
const row = db.prepare(`SELECT value FROM ${T.settings} WHERE key = 'priorities'`).get();
|
|
@@ -929,6 +995,118 @@ export function seedDefaultPriorities(db) {
|
|
|
929
995
|
setWorkspacePriorities(db, [...DEFAULT_PRIORITIES]);
|
|
930
996
|
}
|
|
931
997
|
}
|
|
998
|
+
/**
|
|
999
|
+
* Seed built-in label groups and labels.
|
|
1000
|
+
* Creates Function, Type, and Area groups with their labels.
|
|
1001
|
+
* Migrates existing ticket category values to Function labels.
|
|
1002
|
+
*/
|
|
1003
|
+
export function seedBuiltinLabels(db) {
|
|
1004
|
+
const now = new Date().toISOString();
|
|
1005
|
+
const insertGroup = db.prepare(`
|
|
1006
|
+
INSERT OR IGNORE INTO ${T.label_groups} (id, name, description, is_exclusive, is_required, position, created_at)
|
|
1007
|
+
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
1008
|
+
`);
|
|
1009
|
+
const insertLabel = db.prepare(`
|
|
1010
|
+
INSERT OR IGNORE INTO ${T.labels} (id, name, color, description, group_id, position, is_builtin, created_at)
|
|
1011
|
+
VALUES (?, ?, ?, ?, ?, ?, 1, ?)
|
|
1012
|
+
`);
|
|
1013
|
+
// Built-in label groups
|
|
1014
|
+
const groups = [
|
|
1015
|
+
{
|
|
1016
|
+
id: 'function',
|
|
1017
|
+
name: 'Function',
|
|
1018
|
+
description: 'Business function category (diet enforcement)',
|
|
1019
|
+
isExclusive: true,
|
|
1020
|
+
isRequired: true,
|
|
1021
|
+
position: 0,
|
|
1022
|
+
labels: [
|
|
1023
|
+
{ id: 'fn-ship', name: 'ship', description: 'Core product development', color: '#2da44e' },
|
|
1024
|
+
{ id: 'fn-grow', name: 'grow', description: 'Marketing, adoption, community', color: '#bf8700' },
|
|
1025
|
+
{ id: 'fn-support', name: 'support', description: 'Docs, error messages, onboarding', color: '#0969da' },
|
|
1026
|
+
{ id: 'fn-bizops', name: 'bizops', description: 'Infrastructure, CI/CD, operations', color: '#8250df' },
|
|
1027
|
+
{ id: 'fn-strategy', name: 'strategy', description: 'Design decisions, spikes, retros, planning', color: '#cf222e' },
|
|
1028
|
+
],
|
|
1029
|
+
},
|
|
1030
|
+
{
|
|
1031
|
+
id: 'type',
|
|
1032
|
+
name: 'Type',
|
|
1033
|
+
description: 'Work type classification',
|
|
1034
|
+
isExclusive: true,
|
|
1035
|
+
isRequired: false,
|
|
1036
|
+
position: 1,
|
|
1037
|
+
labels: [
|
|
1038
|
+
{ id: 'type-bug', name: 'bug', description: 'Bug fix', color: '#cf222e' },
|
|
1039
|
+
{ id: 'type-feature', name: 'feature', description: 'New feature', color: '#2da44e' },
|
|
1040
|
+
{ id: 'type-improvement', name: 'improvement', description: 'Enhancement to existing feature', color: '#0969da' },
|
|
1041
|
+
{ id: 'type-task', name: 'task', description: 'General task', color: '#6e7781' },
|
|
1042
|
+
],
|
|
1043
|
+
},
|
|
1044
|
+
{
|
|
1045
|
+
id: 'area',
|
|
1046
|
+
name: 'Area',
|
|
1047
|
+
description: 'System area (non-exclusive)',
|
|
1048
|
+
isExclusive: false,
|
|
1049
|
+
isRequired: false,
|
|
1050
|
+
position: 2,
|
|
1051
|
+
labels: [
|
|
1052
|
+
{ id: 'area-cli', name: 'cli', description: 'CLI tool', color: '#0969da' },
|
|
1053
|
+
{ id: 'area-pmo', name: 'pmo', description: 'Project management', color: '#8250df' },
|
|
1054
|
+
{ id: 'area-agent', name: 'agent', description: 'Agent system', color: '#2da44e' },
|
|
1055
|
+
{ id: 'area-docker', name: 'docker', description: 'Docker integration', color: '#bf8700' },
|
|
1056
|
+
{ id: 'area-mcp', name: 'mcp', description: 'MCP server', color: '#cf222e' },
|
|
1057
|
+
{ id: 'area-desktop', name: 'desktop', description: 'Desktop app', color: '#6e7781' },
|
|
1058
|
+
],
|
|
1059
|
+
},
|
|
1060
|
+
];
|
|
1061
|
+
for (const group of groups) {
|
|
1062
|
+
insertGroup.run(group.id, group.name, group.description, group.isExclusive ? 1 : 0, group.isRequired ? 1 : 0, group.position, now);
|
|
1063
|
+
for (let i = 0; i < group.labels.length; i++) {
|
|
1064
|
+
const label = group.labels[i];
|
|
1065
|
+
insertLabel.run(label.id, label.name, label.color, label.description, group.id, i, now);
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
// Migrate existing category column values to Function label group
|
|
1069
|
+
// Only run if there are tickets with category set but no Function label yet
|
|
1070
|
+
migrateCategoryToFunctionLabels(db);
|
|
1071
|
+
}
|
|
1072
|
+
/**
|
|
1073
|
+
* Migrate existing ticket category values to Function label group entries.
|
|
1074
|
+
* Maps known category names to function labels (e.g., 'ship' -> fn-ship).
|
|
1075
|
+
* This is idempotent - only creates associations that don't exist yet.
|
|
1076
|
+
*/
|
|
1077
|
+
function migrateCategoryToFunctionLabels(db) {
|
|
1078
|
+
// Map of old category values to function label IDs
|
|
1079
|
+
// The ticket's category field contains values like 'feature', 'bug', etc.
|
|
1080
|
+
// The diet system uses ship/grow/support/bizops/strategy which are different
|
|
1081
|
+
// from ticket categories. The diet categories map to the Function label group.
|
|
1082
|
+
// Since existing categories (feature, bug, etc.) don't map to Function labels,
|
|
1083
|
+
// we only migrate if the category field happens to contain a Function label name.
|
|
1084
|
+
const functionLabelMap = {
|
|
1085
|
+
ship: 'fn-ship',
|
|
1086
|
+
grow: 'fn-grow',
|
|
1087
|
+
support: 'fn-support',
|
|
1088
|
+
bizops: 'fn-bizops',
|
|
1089
|
+
strategy: 'fn-strategy',
|
|
1090
|
+
};
|
|
1091
|
+
const tickets = db.prepare(`
|
|
1092
|
+
SELECT id, category FROM ${T.tickets}
|
|
1093
|
+
WHERE category IS NOT NULL AND category != ''
|
|
1094
|
+
`).all();
|
|
1095
|
+
const insertTicketLabel = db.prepare(`
|
|
1096
|
+
INSERT OR IGNORE INTO ${T.ticket_labels} (ticket_id, label_id)
|
|
1097
|
+
VALUES (?, ?)
|
|
1098
|
+
`);
|
|
1099
|
+
for (const ticket of tickets) {
|
|
1100
|
+
const labelId = functionLabelMap[ticket.category.toLowerCase()];
|
|
1101
|
+
if (labelId) {
|
|
1102
|
+
// Check label exists before inserting
|
|
1103
|
+
const labelExists = db.prepare(`SELECT id FROM ${T.labels} WHERE id = ?`).get(labelId);
|
|
1104
|
+
if (labelExists) {
|
|
1105
|
+
insertTicketLabel.run(ticket.id, labelId);
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
932
1110
|
/**
|
|
933
1111
|
* Update board timestamp for a project.
|
|
934
1112
|
*/
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import Database from 'better-sqlite3';
|
|
11
11
|
import { DrizzleDB } from '../../database/drizzle.js';
|
|
12
|
-
import { AcceptanceCriterion, Board, BoardConfig, BoardView, BoardViewFilter, BoardViewFilters, Category, CategoryFilter, CategoryType, Column, CreateTicketInput, Epic, EpicDependency, EpicDependencyType, EpicFilter, PhaseFilter, PhaseTemplate, PhaseTemplateFilter, PMOStorage, Project, ProjectFilter, ProjectPhase, Roadmap, RoadmapFilter, RoadmapProject, Spec, SpecDependency, SpecDependencyType, SpecFilter, StateCategory, Subtask, SyncResult, SyncStatus, Ticket, TicketDependency, TicketDependencyType, TicketFilter, TicketTemplate, TicketTemplateFilter, WorkAction, WorkActionFilter, Workflow, WorkflowFilter, WorkflowStatus } from '../types.js';
|
|
12
|
+
import { AcceptanceCriterion, Board, BoardConfig, BoardView, BoardViewFilter, BoardViewFilters, Category, CategoryFilter, CategoryType, Column, CreateTicketInput, Epic, EpicDependency, EpicDependencyType, EpicFilter, PhaseFilter, PhaseTemplate, PhaseTemplateFilter, PMOStorage, Project, ProjectFilter, ProjectPhase, Roadmap, RoadmapFilter, RoadmapProject, Spec, SpecDependency, SpecDependencyType, SpecFilter, StateCategory, Subtask, SyncResult, SyncStatus, Ticket, TicketDependency, TicketDependencyType, TicketFilter, TicketTemplate, TicketTemplateFilter, WorkAction, WorkActionFilter, Workflow, WorkflowFilter, WorkflowStatus, Label, LabelFilter, LabelGroup, LabelGroupFilter } from '../types.js';
|
|
13
13
|
export declare class SQLiteStorage implements PMOStorage {
|
|
14
14
|
readonly type: "sqlite";
|
|
15
15
|
private db;
|
|
@@ -29,6 +29,7 @@ export declare class SQLiteStorage implements PMOStorage {
|
|
|
29
29
|
private viewStorage;
|
|
30
30
|
private roadmapStorage;
|
|
31
31
|
private categoryStorage;
|
|
32
|
+
private labelStorage;
|
|
32
33
|
constructor(dbPath: string);
|
|
33
34
|
/**
|
|
34
35
|
* Get the underlying database connection.
|
|
@@ -203,6 +204,27 @@ export declare class SQLiteStorage implements PMOStorage {
|
|
|
203
204
|
deleteCategory(id: string): Promise<void>;
|
|
204
205
|
getCategoryNames(type: CategoryType): Promise<string[]>;
|
|
205
206
|
isValidCategory(name: string, type: CategoryType): Promise<boolean>;
|
|
207
|
+
listLabelGroups(filter?: LabelGroupFilter): Promise<LabelGroup[]>;
|
|
208
|
+
getLabelGroup(id: string): Promise<LabelGroup | null>;
|
|
209
|
+
getLabelGroupByName(name: string): Promise<LabelGroup | null>;
|
|
210
|
+
createLabelGroup(group: Partial<LabelGroup> & {
|
|
211
|
+
name: string;
|
|
212
|
+
}): Promise<LabelGroup>;
|
|
213
|
+
updateLabelGroup(id: string, changes: Partial<LabelGroup>): Promise<LabelGroup>;
|
|
214
|
+
deleteLabelGroup(id: string): Promise<void>;
|
|
215
|
+
listLabels(filter?: LabelFilter): Promise<Label[]>;
|
|
216
|
+
getLabel(id: string): Promise<Label | null>;
|
|
217
|
+
getLabelByName(name: string, groupId?: string): Promise<Label | null>;
|
|
218
|
+
createLabel(label: Partial<Label> & {
|
|
219
|
+
name: string;
|
|
220
|
+
}): Promise<Label>;
|
|
221
|
+
updateLabel(id: string, changes: Partial<Label>): Promise<Label>;
|
|
222
|
+
deleteLabel(id: string): Promise<void>;
|
|
223
|
+
addLabelToTicket(ticketId: string, labelId: string): Promise<void>;
|
|
224
|
+
removeLabelFromTicket(ticketId: string, labelId: string): Promise<void>;
|
|
225
|
+
getLabelsForTicket(ticketId: string): Promise<Label[]>;
|
|
226
|
+
addLabelToTicketByName(ticketId: string, labelName: string): Promise<void>;
|
|
227
|
+
removeLabelFromTicketByName(ticketId: string, labelName: string): Promise<void>;
|
|
206
228
|
pull(): Promise<SyncResult>;
|
|
207
229
|
push(): Promise<SyncResult>;
|
|
208
230
|
status(): Promise<SyncStatus>;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import Database from 'better-sqlite3';
|
|
11
11
|
import { createDrizzleConnection } from '../../database/drizzle.js';
|
|
12
12
|
import { PMO_TABLES, PMO_SCHEMA_SQL, validateTicketSchema } from '../schema.js';
|
|
13
|
-
import { runMigrations, seedBuiltinWorkflows, seedBuiltinPhases, seedBuiltinPhaseTemplates, seedBuiltinActions, seedBuiltinTicketTemplates, seedBuiltinCategories, updateBoardTimestamp, } from './base.js';
|
|
13
|
+
import { runMigrations, seedBuiltinWorkflows, seedBuiltinPhases, seedBuiltinPhaseTemplates, seedBuiltinActions, seedBuiltinTicketTemplates, seedBuiltinCategories, seedBuiltinLabels, updateBoardTimestamp, } from './base.js';
|
|
14
14
|
import { ProjectStorage } from './projects.js';
|
|
15
15
|
import { TicketStorage } from './tickets.js';
|
|
16
16
|
import { SubtaskStorage, AcceptanceCriteriaStorage } from './subtasks.js';
|
|
@@ -24,6 +24,7 @@ import { ActionStorage } from './actions.js';
|
|
|
24
24
|
import { ViewStorage } from './views.js';
|
|
25
25
|
import { RoadmapStorage } from './roadmaps.js';
|
|
26
26
|
import { CategoryStorage } from './categories.js';
|
|
27
|
+
import { LabelStorage } from './labels.js';
|
|
27
28
|
const T = PMO_TABLES;
|
|
28
29
|
export class SQLiteStorage {
|
|
29
30
|
type = 'sqlite';
|
|
@@ -45,6 +46,7 @@ export class SQLiteStorage {
|
|
|
45
46
|
viewStorage;
|
|
46
47
|
roadmapStorage;
|
|
47
48
|
categoryStorage;
|
|
49
|
+
labelStorage;
|
|
48
50
|
constructor(dbPath) {
|
|
49
51
|
this.dbPath = dbPath;
|
|
50
52
|
// Open database (creates if doesn't exist)
|
|
@@ -74,6 +76,7 @@ export class SQLiteStorage {
|
|
|
74
76
|
this.viewStorage = new ViewStorage(ctx);
|
|
75
77
|
this.roadmapStorage = new RoadmapStorage(ctx);
|
|
76
78
|
this.categoryStorage = new CategoryStorage(ctx);
|
|
79
|
+
this.labelStorage = new LabelStorage(ctx);
|
|
77
80
|
// Ensure PMO tables exist
|
|
78
81
|
this.ensurePMOTables();
|
|
79
82
|
}
|
|
@@ -104,6 +107,7 @@ export class SQLiteStorage {
|
|
|
104
107
|
seedBuiltinActions(this.db);
|
|
105
108
|
seedBuiltinTicketTemplates(this.db);
|
|
106
109
|
seedBuiltinCategories(this.db);
|
|
110
|
+
seedBuiltinLabels(this.db);
|
|
107
111
|
// Validate schema
|
|
108
112
|
validateTicketSchema(this.db);
|
|
109
113
|
}
|
|
@@ -616,6 +620,60 @@ export class SQLiteStorage {
|
|
|
616
620
|
return this.categoryStorage.isValidCategory(name, type);
|
|
617
621
|
}
|
|
618
622
|
// ===========================================================================
|
|
623
|
+
// Label Operations
|
|
624
|
+
// ===========================================================================
|
|
625
|
+
async listLabelGroups(filter) {
|
|
626
|
+
return this.labelStorage.listLabelGroups(filter);
|
|
627
|
+
}
|
|
628
|
+
async getLabelGroup(id) {
|
|
629
|
+
return this.labelStorage.getLabelGroup(id);
|
|
630
|
+
}
|
|
631
|
+
async getLabelGroupByName(name) {
|
|
632
|
+
return this.labelStorage.getLabelGroupByName(name);
|
|
633
|
+
}
|
|
634
|
+
async createLabelGroup(group) {
|
|
635
|
+
return this.labelStorage.createLabelGroup(group);
|
|
636
|
+
}
|
|
637
|
+
async updateLabelGroup(id, changes) {
|
|
638
|
+
return this.labelStorage.updateLabelGroup(id, changes);
|
|
639
|
+
}
|
|
640
|
+
async deleteLabelGroup(id) {
|
|
641
|
+
return this.labelStorage.deleteLabelGroup(id);
|
|
642
|
+
}
|
|
643
|
+
async listLabels(filter) {
|
|
644
|
+
return this.labelStorage.listLabels(filter);
|
|
645
|
+
}
|
|
646
|
+
async getLabel(id) {
|
|
647
|
+
return this.labelStorage.getLabel(id);
|
|
648
|
+
}
|
|
649
|
+
async getLabelByName(name, groupId) {
|
|
650
|
+
return this.labelStorage.getLabelByName(name, groupId);
|
|
651
|
+
}
|
|
652
|
+
async createLabel(label) {
|
|
653
|
+
return this.labelStorage.createLabel(label);
|
|
654
|
+
}
|
|
655
|
+
async updateLabel(id, changes) {
|
|
656
|
+
return this.labelStorage.updateLabel(id, changes);
|
|
657
|
+
}
|
|
658
|
+
async deleteLabel(id) {
|
|
659
|
+
return this.labelStorage.deleteLabel(id);
|
|
660
|
+
}
|
|
661
|
+
async addLabelToTicket(ticketId, labelId) {
|
|
662
|
+
return this.labelStorage.addLabelToTicket(ticketId, labelId);
|
|
663
|
+
}
|
|
664
|
+
async removeLabelFromTicket(ticketId, labelId) {
|
|
665
|
+
return this.labelStorage.removeLabelFromTicket(ticketId, labelId);
|
|
666
|
+
}
|
|
667
|
+
async getLabelsForTicket(ticketId) {
|
|
668
|
+
return this.labelStorage.getLabelsForTicket(ticketId);
|
|
669
|
+
}
|
|
670
|
+
async addLabelToTicketByName(ticketId, labelName) {
|
|
671
|
+
return this.labelStorage.addLabelToTicketByName(ticketId, labelName);
|
|
672
|
+
}
|
|
673
|
+
async removeLabelFromTicketByName(ticketId, labelName) {
|
|
674
|
+
return this.labelStorage.removeLabelFromTicketByName(ticketId, labelName);
|
|
675
|
+
}
|
|
676
|
+
// ===========================================================================
|
|
619
677
|
// Sync Operations (no-op for pure SQLite)
|
|
620
678
|
// ===========================================================================
|
|
621
679
|
async pull() {
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Label storage operations for PMO.
|
|
3
|
+
* Handles CRUD for labels, label groups, and ticket-label associations.
|
|
4
|
+
* Enforces group exclusivity constraints.
|
|
5
|
+
*/
|
|
6
|
+
import { Label, LabelFilter, LabelGroup, LabelGroupFilter } from '../types.js';
|
|
7
|
+
import { StorageContext } from './types.js';
|
|
8
|
+
export declare class LabelStorage {
|
|
9
|
+
private ctx;
|
|
10
|
+
constructor(ctx: StorageContext);
|
|
11
|
+
listLabelGroups(filter?: LabelGroupFilter): Promise<LabelGroup[]>;
|
|
12
|
+
getLabelGroup(id: string): Promise<LabelGroup | null>;
|
|
13
|
+
getLabelGroupByName(name: string): Promise<LabelGroup | null>;
|
|
14
|
+
createLabelGroup(group: Partial<LabelGroup> & {
|
|
15
|
+
name: string;
|
|
16
|
+
}): Promise<LabelGroup>;
|
|
17
|
+
updateLabelGroup(id: string, changes: Partial<LabelGroup>): Promise<LabelGroup>;
|
|
18
|
+
deleteLabelGroup(id: string): Promise<void>;
|
|
19
|
+
listLabels(filter?: LabelFilter): Promise<Label[]>;
|
|
20
|
+
getLabel(id: string): Promise<Label | null>;
|
|
21
|
+
getLabelByName(name: string, groupId?: string): Promise<Label | null>;
|
|
22
|
+
createLabel(label: Partial<Label> & {
|
|
23
|
+
name: string;
|
|
24
|
+
}): Promise<Label>;
|
|
25
|
+
updateLabel(id: string, changes: Partial<Label>): Promise<Label>;
|
|
26
|
+
deleteLabel(id: string): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Add a label to a ticket.
|
|
29
|
+
* Enforces group exclusivity: if the label belongs to an exclusive group,
|
|
30
|
+
* removes any existing label from the same group first.
|
|
31
|
+
*/
|
|
32
|
+
addLabelToTicket(ticketId: string, labelId: string): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Remove a label from a ticket.
|
|
35
|
+
*/
|
|
36
|
+
removeLabelFromTicket(ticketId: string, labelId: string): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Get all labels for a ticket.
|
|
39
|
+
*/
|
|
40
|
+
getLabelsForTicket(ticketId: string): Promise<Label[]>;
|
|
41
|
+
/**
|
|
42
|
+
* Add a label to a ticket by name.
|
|
43
|
+
* Resolves the label name to an ID first.
|
|
44
|
+
* If the label name matches a group:label pattern, resolves within that group.
|
|
45
|
+
*/
|
|
46
|
+
addLabelToTicketByName(ticketId: string, labelName: string): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Remove a label from a ticket by name.
|
|
49
|
+
*/
|
|
50
|
+
removeLabelFromTicketByName(ticketId: string, labelName: string): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Resolve a label by name or group:name pattern.
|
|
53
|
+
*/
|
|
54
|
+
private resolveLabelByName;
|
|
55
|
+
}
|