feat(ccw): add session manager tool with auto workspace detection

- Add session_manager tool for workflow session lifecycle management
- Add ccw session CLI command with subcommands:
  - list, init, status, task, stats, delete, read, write, update, archive, mkdir
- Implement auto workspace detection (traverse up to find .workflow)
- Implement auto session location detection (active, archived, lite-plan, lite-fix)
- Add dashboard notifications for tool executions via WebSocket
- Add granular event types (SESSION_CREATED, TASK_UPDATED, etc.)
- Add status_history auto-tracking for task status changes
- Update workflow session commands to document ccw session usage

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
catlog22
2025-12-10 19:26:53 +08:00
parent df104d6e9b
commit 598bea9b21
11 changed files with 2003 additions and 6 deletions

View File

@@ -7,6 +7,7 @@ import { uninstallCommand } from './commands/uninstall.js';
import { upgradeCommand } from './commands/upgrade.js';
import { listCommand } from './commands/list.js';
import { toolCommand } from './commands/tool.js';
import { sessionCommand } from './commands/session.js';
import { readFileSync, existsSync } from 'fs';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';
@@ -115,5 +116,22 @@ export function run(argv) {
.option('--new <text>', 'New text (for edit_file)')
.action((subcommand, args, options) => toolCommand(subcommand, args, options));
// Session command
program
.command('session [subcommand] [args...]')
.description('Workflow session lifecycle management')
.option('--location <loc>', 'Location filter: active|archived|both')
.option('--type <type>', 'Content type or session type')
.option('--content <json>', 'Content for write/update')
.option('--task-id <id>', 'Task ID for task content')
.option('--filename <name>', 'Filename for process/chat/etc')
.option('--dimension <dim>', 'Dimension for review-dim')
.option('--iteration <iter>', 'Iteration for review-iter')
.option('--subdir <dir>', 'Subdirectory for mkdir')
.option('--raw', 'Output raw content only')
.option('--no-metadata', 'Exclude metadata from list')
.option('--no-update-status', 'Skip status update on archive')
.action((subcommand, args, options) => sessionCommand(subcommand, args, options));
program.parse(argv);
}