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

@@ -58,4 +58,33 @@ Session WFS-user-auth resumed
- Paused at: 2025-09-15T14:30:00Z
- Resumed at: 2025-09-15T15:45:00Z
- Ready for: /workflow:execute
```
```
## session_manager Tool Alternative
Use `ccw tool exec session_manager` for session resume:
### Update Session Status
```bash
# Update status to active
ccw tool exec session_manager '{
"operation": "update",
"session_id": "WFS-xxx",
"content_type": "session",
"content": {
"status": "active",
"resumed_at": "2025-12-10T08:00:00Z"
}
}'
```
### Read Session Status
```bash
ccw tool exec session_manager '{"operation":"read","session_id":"WFS-xxx","content_type":"session"}'
```
### Operation Reference
| Old Pattern | session_manager |
|------------|-----------------|
| `jq -r '.status' session.json` | `{"operation":"read","content_type":"session"}` |
| `jq '.status = "active"' ... > temp.json && mv` | `{"operation":"update","content":{"status":"active"}}` |
| `jq '.resumed_at = "..."'` | `{"operation":"update","content":{"resumed_at":"..."}}` |