Commit Graph

11 Commits

Author SHA1 Message Date
starmen1265 6d9bd902ea feat(03-03): implement Orchestrator class
- Add Orchestrator class with handle_message() and handle_callback() entry points
- Command parsing via regex: /gsd:* pattern extraction
- Auto-session-creation per CONTEXT.md decision
- Error handling with try/except returning format_error() cards
- Approval detection integration with ApprovalHandler
- Output truncation to 2000 chars for Feishu card limits
- 18 tests passing with full coverage

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 19:11:32 +08:00
starmen1265 086be891b9 test(03-03): add failing tests for orchestrator
- Test orchestrator initialization with dependencies
- Test command parsing for /gsd:* pattern extraction
- Test handle_message routing (session creation, command execution, error handling)
- Test handle_callback routing for approval workflow
- Add integration-style tests for full flows

18 tests total covering all orchestrator functionality.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 19:11:32 +08:00
starmen1265 16ddc3edaa feat(03-02): implement ProgressMonitor class
- Add ProgressInfo dataclass for progress data
- Add ProgressMonitor class with:
  - PROGRESS_PATTERNS for extraction (percentage, fraction, phase, completion)
  - extract_progress() to find progress indicators in output
  - should_send_update() with 60 second throttling
  - create_progress_card() for Feishu card formatting
- Fix fraction pattern to allow content after fraction (e.g., [3/5 tasks])
- Fix should_send_update() to return False on first call
- Fix test assertions to use kwargs instead of positional args

All 7 tests pass for progress monitoring.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 19:11:31 +08:00
starmen1265 ddd0477498 feat(03-02): implement ApprovalHandler class
- Add ApprovalState dataclass for approval workflow state
- Add ApprovalHandler class with:
  - APPROVAL_PATTERNS for detection (AskUserQuestion, ExitPlanMode, 需要确认, Please confirm)
  - detect_approval_request() to find approval requests in output
  - create_approval_card() with confirm/reject buttons using CardButton
  - handle_callback() to process approval actions
  - In-memory pending_approvals cache
- Fix test assertions to use kwargs instead of positional args

All 8 tests pass for approval handling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 19:11:31 +08:00
starmen1265 efd4892f2f test(03-02): add failing tests for approval handler and progress monitor
- Add test_approval_handler.py with 8 tests for:
  - Approval request detection (AskUserQuestion, 需要确认)
  - Approval card creation with confirm/reject buttons
  - Callback handling (approved, rejected, error)
- Add test_progress_monitor.py with 7 tests for:
  - Progress extraction (percentage, fraction, phase)
  - Update throttling (60 second interval)
  - Progress card formatting

TDD RED phase - tests will fail until implementation is complete.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 19:11:31 +08:00
starmen1265 40cc92ec6e feat(03-01): implement CommandExecutor and OutputCapture classes
- Add CommandResult dataclass for storing execution results
- Add OutputCapture class with prompt detection and stabilization
- Add CommandExecutor class for command execution and error detection
- Support common shell prompts ($, ❯, ➜, >)
- Detect errors in both English and Chinese
- Use 60s default timeout from CONTEXT.md decision
- Mock-based testing (no real tmux required)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 19:11:31 +08:00
starmen1265 6f18550906 test(03-01): add failing tests for command executor
- Test OutputCapture._is_prompt for prompt pattern detection
- Test OutputCapture.capture_until_complete for output capture
- Test CommandExecutor._detect_errors for error keyword detection
- Test CommandExecutor.execute for full command execution flow
- Test CommandResult dataclass for result storage
- Test CommandExecutor.send_command for pane interaction

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 19:11:31 +08:00
starmen1265 72a5ad4441 test(02-01): add failing tests for SKILL.md validation
- Test SKILL.md file exists at skill/SKILL.md
- Test SKILL.md has valid YAML frontmatter
- Test SKILL.md has name field
- Test SKILL.md has description field
- Test description contains /gsd: trigger pattern

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 14:30:54 +08:00
starmen1265 65f6f90c11 test(02-02): add failing tests for FeishuResponseFormatter
- Test format_success returns valid card with green theme
- Test format_error returns red theme
- Test format_info returns blue theme
- Test format with buttons includes actions element
- Test format_paginated adds [N/M] marker
- Test card has required structure (schema 2.0, config, elements)

TDD RED phase - tests will fail until implementation is added.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 14:30:54 +08:00
starmen1265 4113434c72 test(02-03): add failing tests for prompt templates
- TestPromptTemplatesExist: 4 tests for template file existence
- TestPromptLoader: 6 tests for loading and rendering templates
- Tests fail (RED phase) - no templates or loader implemented yet

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 14:30:54 +08:00
starmen1265 96f06f3751 feat: 添加 gsd-openclaw 技能
PR Test / lint (pull_request) Successful in 2s
2026-03-11 10:41:01 +08:00