Commit graph

9 commits

Author SHA1 Message Date
1bc6a6447d Prepare 0.4.0 release 2026-05-05 01:42:08 -04:00
1e263f08c0 fix: tolerate numeric args from MCP JSON in all kanban commands
Replace fragile 'as String'/'as String?' casts in callAsTool() with
string interpolation so that numeric values sent by MCP JSON clients
(double instead of String) no longer throw a type cast error.

Fixes: type 'double' is not a subtype of type 'String' in type cast

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-25 16:01:36 -04:00
53f9493364 Add ProjectDirs extension pattern and injectable clock
- core: Add ProjectDirs helper class on ProjectContext (context.dirs)
  with project getter for .project/ dir; feature packages extend it
  via extension methods to expose their own dirs

- kanban: Add KanbanDirs extension on ProjectDirs exposing .kanban;
  replace all 14 p.join(context.root, '.project', 'kanban') call
  sites with context.dirs.kanban; drop now-unused path imports

- kanban: Add clock: DateTime Function() field to TicketStore
  (defaults to DateTime.now); use clock().toUtc() in create() for
  deterministic timestamps in tests

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-23 23:15:38 -04:00
8d787235b9 Refactor filesystem access to package:file
Replace dart:io File/Directory with package:file abstractions so that
tests can use MemoryFileSystem instead of mutating the process-global
Directory.current.

- Add file: ^7.0.1 to core and kanban dependencies
- ProjectContext.find() accepts FileSystem fs parameter
- TicketStore, KanbanInitHook, InitCommand, all kanban commands accept
  FileSystem fs (defaulting to LocalFileSystem())
- KanbanCommand and registerCommands() thread fs to subcommands
- Tests rewritten to use MemoryFileSystem() — no Directory.current mutation
- Remove dart_test.yaml (concurrency: 1 no longer needed)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-23 22:26:09 -04:00
037f5fde28 Four polish fixes
1. get shows milestones/labels: GetCommand._format() now shows Milestones:/Labels:
   lines when non-empty, between Created: and Links:

2. unarchive command: kanban unarchive --id <id> [--column <col>] restores a
   ticket from archive/ back to a column (default: first configured column);
   registered as 'kanban_unarchive_ticket' MCP tool (15 tools total)

3. Test isolation: add dart_test.yaml (concurrency: 1) — Directory.current is
   a process-global OS chdir(); concurrent test files in the same process
   would race. Now dart test packages/core packages/kanban passes cleanly.

4. update empty multi-option fix: --milestone '' / --label '' with empty
   strings now filters them out (treats as 'clear to empty') rather than
   writing spurious empty-string YAML list entries

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-23 22:10:12 -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
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
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
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