Commit graph

10 commits

Author SHA1 Message Date
31f9ba4726 dew init with module init hooks (DEW-0010)
- DewInitHook interface and DewInitOptions added to packages/core/src/init.dart
- InitCommand: creates .project/dew.yaml from default template, calls hooks
  --path/-p option (default '.'), --[no-]gitkeep flag (default true)
- CommandRegistry gains initHooks list and registerInitHook()
- KanbanInitHook: creates column dirs, archive/, attachments/ under
  .project/kanban/; adds .gitkeep to freshly-created dirs when enabled
- KanbanInitHook registered in kanban.registerCommands()
- CLI wires InitCommand(registry.initHooks) as a top-level command

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-23 19:58:53 -04:00
a25411d4fa Config refactor: DewConfig.raw + per-package extensions (DEW-0007)
DewConfig in core is now a thin YamlMap wrapper. Feature-specific config
classes live in their own packages and expose themselves via Dart extensions:

- KanbanConfig, ColumnConfig, TicketTypeConfig + KanbanDewConfig extension
  moved to packages/kanban/lib/src/kanban_config.dart
- McpConfig + McpDewConfig extension added to
  packages/mcp/lib/src/mcp_config.dart
- DewConfig.fromYaml() now trivially wraps the raw YamlMap
- All call sites unchanged: context.config.kanban.* / context.config.mcp.*
- Added yaml dependency to dew_mcp pubspec
- Updated core test to validate raw yaml instead of typed fields
- Fixed cross-suite Directory.current isolation (existing issue, not introduced)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-23 19:54:35 -04:00
951f0d8bc8 Storage refactor: tickets in column subdirs, drop redundant column frontmatter
- TicketStore rewritten: tickets live in .project/kanban/<column>/<id>.md
- _findTicketFile() searches all column subdirs (one level deep)
- update() moves the file when column changes
- delete() cleans up attachments/<id>/ if present
- _nextNumber() scans all subdirs including archive
- Ticket.fromFileContent() now takes column as explicit parameter
- Ticket.toFileContent() drops column field (derived from path)
- _yamlQuote() added to safely quote titles containing ': '
- dew.yaml: columns changed to backlog/doing/done (alphabetical order)
- Existing tickets migrated to .project/kanban/backlog/

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-23 19:42:21 -04:00
08f4d5c7cf Upgrade ticket links to typed bidirectional relationships
Link types: blocks/is_blocked_by, relates_to (symmetric),
duplicates/is_duplicated_by, parent_of/child_of

- Add TicketLink(targetId, type) class and linkTypeInverses map to
  ticket.dart
- Update Ticket.links from List<String> to List<TicketLink>
- Update toFileContent/fromFileContent for new {id, type} YAML format
- Update TicketStore.linkTickets to accept a type, write the forward
  link and automatically write the inverse on the target ticket
- Update TicketStore.unlinkTickets to remove both sides
- Update LinkCommand with mandatory --type/-y option (enum of all valid
  types); describe inverse in output message
- Update GetCommand to display typed links in ticket output
- Update all tests: typed roundtrip, bidirectional store tests for
  blocks, relates_to (symmetric), parent_of/child_of, unlink both sides
- 29 tests pass, dart analyze clean

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-23 19:21:25 -04:00
4efa1078ea Add stats, move, link, and unlink kanban tools
- Add links field to Ticket model (YAML frontmatter list, roundtrips
  correctly; omitted from file when empty)
- Add TicketStore.linkTickets(), unlinkTickets(), and stats() methods
- Add StatsCommand (kanban_stats) — ticket counts by column and type
- Add MoveCommand (kanban_move_ticket) — validated column transition
- Add LinkCommand (kanban_link_tickets) — track ticket dependencies
- Add UnlinkCommand (kanban_unlink_tickets) — remove ticket links
- Register all 4 new subcommands in KanbanCommand (12 total)
- All 27 tests pass, dart analyze clean

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-23 17:10:09 -04:00
7b83572f7a Unified command-tool registration via DewToolCommand mixin
- Add DewToolCommand mixin that auto-derives MCP tool JSON Schema from
  ArgParser, eliminating the need to define CLI commands and MCP tools
  separately
- Add schemaFromArgParser() to generate JSON Schema from ArgParser options
- Add CommandRegistry.mcpTools recursive collector for all DewToolCommand
  subcommands
- Refactor all kanban subcommands to use the mixin; switch get/update/delete
  from positional rest args to --id / -i option for schema compatibility
- Promote list to a proper CLI subcommand (was MCP-only before)
- Add search, comment, and config subcommands (CLI + MCP tools)
- Add TicketStore.addComment() for non-destructive comment appending
- Simplify mcp.registerCommands() to take only CommandRegistry
- Simplify CLI entry point (no more KanbanToolProvider/McpToolRegistry)
- Delete stale files: kanban_tool_provider.dart, mcp_tool_provider.dart,
  mcp_tool_registry.dart (superseded by DewToolCommand mixin)
- Add tools/mcp_client.dart debug client for manual MCP server testing
- Update .vscode/mcp.json with correct server config

All 26 tests pass, dart analyze clean.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-23 16:30:43 -04:00
a74bd94547 Implement MCP tool registry and kanban tool provider
- Add McpTool + McpToolProvider interface to core
- Add McpToolRegistry to mcp package (aggregates providers)
- Add DewMcpServer (MCPServer + ToolsSupport via dart_mcp 0.5.0)
- Add 'mcp serve' subcommand — starts a real stdio MCP server
- Implement KanbanToolProvider with 5 tools:
  kanban_create_ticket, kanban_list_tickets, kanban_get_ticket,
  kanban_update_ticket, kanban_delete_ticket
- Wire McpToolRegistry + KanbanToolProvider in CLI
- 26 tests passing, dart analyze clean

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-23 15:29:46 -04:00
a1c36f7136 Implement kanban subcommands (create, get, update, delete)
- Add ProjectContext and DewConfig models to core
- Add Ticket model with YAML frontmatter serialisation
- Add TicketStore with auto-incrementing 4-digit IDs
- Implement create/get/update/delete subcommands under KanbanCommand
- Expand tests: ProjectContext, Ticket roundtrip, TicketStore CRUD (19 total)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-23 14:47:25 -04:00
0723c7d996 Scaffold docs, packages, and command registration
- Flesh out docs/index.md, docs/config.md, docs/features/mcp.md,
  docs/features/kanban.md with full content and aligned tables
- Fix .markdownlint-cli2.mjs config (rules were outside 'config' key)
- Add packages/mcp as a standalone MCP server package
- Update all pubspec descriptions
- Implement DewCommand + CommandRegistry in core
- Implement KanbanCommand and McpCommand stubs with registerCommands()
- Wire CLI entry point using CommandRunner + CommandRegistry
- Add 'melos run dew' script for running the CLI from workspace root
- Update tests across core, kanban, mcp packages

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-23 14:29:09 -04:00
b3201fde7b chore: Initial Commit 2026-04-23 13:09:11 -04:00