Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
6d7829c
test: workflow2
mini2s Sep 17, 2025
e483673
Merge branch 'main' of github.com:mini2s/zgsm into workflow-test2
mini2s Sep 17, 2025
76738d2
feat: add coworkflow support with file monitoring, CodeLens, and task…
mini2s Sep 17, 2025
943d92f
Merge branch 'main' of github.com:mini2s/zgsm into workflow-test2
mini2s Sep 17, 2025
c58a7a6
refactor: update indentation handling and file watching patterns
mini2s Sep 18, 2025
e07f272
refactor: update workflow directory structure and enhance document ha…
mini2s Sep 18, 2025
110bdbf
Merge branch 'main' of github.com:mini2s/zgsm into workflow-test2
mini2s Sep 18, 2025
5908351
feat: add zgsm code mode configuration and workflow modes
mini2s Sep 18, 2025
e58b4e7
feat: add workflow mode and update task display
mini2s Sep 18, 2025
cf95852
refactor: restructure workflow modes and update command mappings
mini2s Sep 19, 2025
d365864
Merge branch 'main' of github.com:mini2s/zgsm into workflow-test2
mini2s Sep 19, 2025
f6292cb
Merge branch main of github.com:mini2s/zgsm into workflow-test2
mini2s Sep 19, 2025
e25321c
修复 ESLint 配置问题
mini2s Sep 19, 2025
1362b58
Merge branch 'main' of github.com:mini2s/zgsm into workflow-test2
mini2s Sep 19, 2025
08d16d0
Merge pull request #463 from mini2s/workflow-test2
mini2s Sep 19, 2025
1f8bc23
feat: add timestamp formatting to chat messages (#464)
mini2s Sep 20, 2025
b59ce0e
Workflow test2 (#465)
mini2s Sep 20, 2025
21258b7
Merge branch 'main' of github.com:zgsm-ai/costrict into workflow-dev
mini2s Sep 21, 2025
010906c
Merge branch 'main' of github.com:zgsm-ai/costrict into workflow-dev
mini2s Sep 23, 2025
d2b2789
refactor(workflow): optimize workflow action handling
mini2s Sep 23, 2025
3a9fcb5
Merge branch 'main' of github.com:zgsm-ai/costrict into workflow-dev
mini2s Sep 23, 2025
9bede79
refactor: rename .coworkflow to .cospec and update workflow templates
mini2s Sep 23, 2025
82f603b
docs: add task status update instructions and task markers
mini2s Sep 23, 2025
e3e0348
docs: fix typo in support-prompt instructions
mini2s Sep 23, 2025
aae7a4a
docs: update task workflow instructions and status update process
mini2s Sep 23, 2025
f0e1e25
build: update version and add test instructions
mini2s Sep 24, 2025
f4859a6
Merge branch 'main' of github.com:zgsm-ai/costrict into workflow-diff…
mini2s Sep 24, 2025
eb3fe1c
Roo to main (#477) (#478)
mini2s Sep 24, 2025
e8e57d5
feat: project wiki (#476)
wantWhatBike Sep 24, 2025
4acfef9
feat: add file diff functionality for workflow updates
mini2s Sep 24, 2025
87227b5
Merge remote-tracking branch 'origin/workflow-dev' into workflow-diff…
mini2s Sep 24, 2025
f4f4988
refactor: move wiki helpers to costrict module and update imports
mini2s Sep 24, 2025
d07079b
feat: add test and project wiki tips with i18n support
mini2s Sep 24, 2025
6a7c293
Merge remote-tracking branch 'origin/main' into workflow-diff-dev
mini2s Sep 24, 2025
85a13fd
feat: add workflow diff and project wiki (#480)
mini2s Sep 24, 2025
cbe7b70
Merge branch 'main' of github.com:zgsm-ai/costrict into workflow-diff…
mini2s Sep 24, 2025
7be1312
feat(cospec): add metadata management and diff integration
mini2s Sep 24, 2025
730d98d
refactor: rename workflow mode to strict mode
mini2s Sep 25, 2025
74f1fa2
feat(checkpoints): enhance checkpoint metadata handling with ClineMes…
mini2s Sep 25, 2025
c1dc0ec
refactor: simplify cospec metadata handling and update workflow integ…
mini2s Sep 25, 2025
a95be8d
Merge branch 'main' of github.com:zgsm-ai/costrict into workflow-diff…
mini2s Sep 26, 2025
11d5b24
Merge branch 'workflow-dev' of github.com:zgsm-ai/costrict into workf…
mini2s Sep 26, 2025
e1dca50
Merge remote-tracking branch 'origin/main' into workflow-diff-dev
mini2s Sep 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .cospec/add-demo/.cometa.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"design": {
"lastTaskId": "",
"lastCheckpointId": ""
},
"requirements": {
"lastTaskId": "",
"lastCheckpointId": ""
},
"tasks": {
"lastTaskId": "",
"lastCheckpointId": ""
}
}
213 changes: 213 additions & 0 deletions .cospec/add-demo/design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
# 前置依赖文件: [requirements.md](./requirements.md)

# Design Document

## Overview

This feature implements comprehensive support for .coworkflow directory Markdown files by adding file monitoring, CodeLens operations, and visual decorations. The implementation follows VS Code extension patterns and integrates with the existing extension architecture.

## Architecture

The feature consists of three main components:

1. **CoworkflowFileWatcher**: Monitors .coworkflow directory files and coordinates updates
2. **CoworkflowCodeLensProvider**: Provides contextual actions via CodeLens for different document types
3. **CoworkflowDecorationProvider**: Manages visual decorations for task status indicators

### Component Interaction Flow

```mermaid
graph TD
A[Extension Activation] --> B[CoworkflowFileWatcher]
B --> C[File System Watchers]
B --> D[CoworkflowCodeLensProvider]
B --> E[CoworkflowDecorationProvider]

C --> F[File Change Events]
F --> D
F --> E

D --> G[CodeLens Actions]
G --> H[Command Execution]

E --> I[Text Editor Decorations]
I --> J[Visual Status Indicators]
```

## Components and Interfaces

### 1. CoworkflowFileWatcher

**Purpose**: Central coordinator for file monitoring and provider management

**Key Responsibilities**:

- Monitor .coworkflow directory for requirements.md, design.md, tasks.md
- Coordinate updates between CodeLens and decoration providers
- Handle workspace changes and re-establish watchers

**Interface**:

```typescript
interface CoworkflowFileWatcher {
initialize(): void
dispose(): void
onFileChanged(uri: vscode.Uri): void
getCoworkflowPath(): string | undefined
}
```

### 2. CoworkflowCodeLensProvider

**Purpose**: Provide contextual actions for different document types

**Key Responsibilities**:

- Parse document structure to identify action locations
- Provide document-specific actions (Update, Run, Retry)
- Handle CodeLens command execution

**Interface**:

```typescript
interface CoworkflowCodeLensProvider extends vscode.CodeLensProvider {
provideCodeLenses(document: vscode.TextDocument): vscode.CodeLens[]
resolveCodeLens(codeLens: vscode.CodeLens): vscode.CodeLens
}
```

**Document-Specific Actions**:

- **requirements.md**: "Update" actions at requirement section headers
- **design.md**: "Update" actions at major section headers
- **tasks.md**: "Run" and "Retry" actions at individual task items

### 3. CoworkflowDecorationProvider

**Purpose**: Manage visual status indicators for tasks

**Key Responsibilities**:

- Parse task status indicators: `[ ]`, `[-]`, `[x]`
- Apply appropriate background decorations
- Update decorations when task status changes

**Interface**:

```typescript
interface CoworkflowDecorationProvider {
updateDecorations(document: vscode.TextDocument): void
dispose(): void
}
```

**Decoration Types**:

- `[ ]` (未开始): No background decoration
- `[-]` (进行中): Light yellow background (`rgba(255, 255, 0, 0.2)`)
- `[x]` (已完成): Light green background (`rgba(0, 255, 0, 0.2)`)

## Data Models

### Task Status Model

```typescript
interface TaskStatus {
line: number
range: vscode.Range
status: "not_started" | "in_progress" | "completed"
text: string
}
```

### CodeLens Action Model

```typescript
interface CoworkflowCodeLens extends vscode.CodeLens {
documentType: "requirements" | "design" | "tasks"
actionType: "update" | "run" | "retry"
context?: {
taskId?: string
sectionTitle?: string
}
}
```

### File Context Model

```typescript
interface CoworkflowFileContext {
uri: vscode.Uri
type: "requirements" | "design" | "tasks"
lastModified: Date
isActive: boolean
}
```

## Error Handling

### File System Errors

- **Missing .coworkflow directory**: Gracefully disable watchers without errors
- **Missing target files**: Handle file absence without crashing providers
- **File permission errors**: Log warnings and continue with available functionality

### Parsing Errors

- **Malformed Markdown**: Provide basic functionality, skip problematic sections
- **Invalid task status**: Default to 'not_started' status for unknown formats
- **Corrupted file content**: Use fallback parsing with error logging

### Provider Errors

- **CodeLens resolution failures**: Return empty CodeLens array
- **Decoration application failures**: Log errors and continue
- **Command execution errors**: Show user-friendly error messages

## Testing Strategy

### Unit Tests

- **CoworkflowFileWatcher**: Test file monitoring, workspace changes, disposal
- **CoworkflowCodeLensProvider**: Test document parsing, CodeLens generation, command resolution
- **CoworkflowDecorationProvider**: Test task status parsing, decoration application

### Integration Tests

- **File System Integration**: Test actual file watching with temporary files
- **VS Code API Integration**: Test CodeLens and decoration providers with mock documents
- **Command Integration**: Test command execution and error handling

### Edge Case Tests

- **Empty files**: Ensure providers handle empty documents
- **Large files**: Test performance with documents containing many tasks
- **Concurrent changes**: Test behavior when multiple files change simultaneously
- **Workspace switching**: Test proper cleanup and re-initialization

## Implementation Phases

### Phase 1: Core Infrastructure

- Implement CoworkflowFileWatcher with basic file monitoring
- Set up provider registration and disposal patterns
- Create basic command structure

### Phase 2: CodeLens Implementation

- Implement CoworkflowCodeLensProvider with document parsing
- Add document-specific action detection
- Implement command handlers for Update, Run, Retry actions

### Phase 3: Decoration Implementation

- Implement CoworkflowDecorationProvider with task status parsing
- Create decoration types for different task statuses
- Add real-time decoration updates

### Phase 4: Integration and Polish

- Integrate all components with extension activation
- Add comprehensive error handling
- Implement performance optimizations
- Add configuration options if needed
62 changes: 62 additions & 0 deletions .cospec/add-demo/requirements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Requirements Document

## Introduction

This feature adds comprehensive support for .coworkflow directory Markdown files in the VS Code extension. It provides file monitoring, CodeLens operations, and visual decorations for task status tracking in requirements.md, design.md, and tasks.md files.

## Requirements

### Requirement 1

**User Story:** As a developer, I want the extension to monitor .coworkflow directory files, so that I can get real-time updates and interactions with my workflow documents.

#### Acceptance Criteria

1. WHEN a .coworkflow directory exists in the workspace THEN the extension SHALL monitor requirements.md, design.md, and tasks.md files
2. WHEN any of these files are created, modified, or deleted THEN the extension SHALL update the corresponding providers and decorations
3. WHEN the workspace changes THEN the extension SHALL re-establish file watchers for the new workspace

### Requirement 2

**User Story:** As a developer, I want CodeLens operations on specific document sections, so that I can quickly perform actions relevant to each document type.

#### Acceptance Criteria

1. WHEN viewing requirements.md THEN the extension SHALL provide "Update" CodeLens actions at appropriate locations
2. WHEN viewing design.md THEN the extension SHALL provide "Update" CodeLens actions at appropriate locations
3. WHEN viewing tasks.md THEN the extension SHALL provide "Run" and "Retry" CodeLens actions for each task item
4. WHEN clicking a CodeLens action THEN the extension SHALL execute the corresponding command with proper context

### Requirement 3

**User Story:** As a developer, I want visual status indicators for tasks, so that I can quickly identify task progress at a glance.

#### Acceptance Criteria

1. WHEN viewing tasks.md THEN tasks with `[ ]` status SHALL have no background decoration
2. WHEN viewing tasks.md THEN tasks with `[-]` status SHALL have a light yellow background decoration
3. WHEN viewing tasks.md THEN tasks with `[x]` status SHALL have a light green background decoration
4. WHEN task status changes THEN decorations SHALL update automatically
5. WHEN multiple tasks exist THEN each SHALL have independent status decoration

### Requirement 4

**User Story:** As a developer, I want the CodeLens to appear at meaningful locations in each document, so that the actions are contextually relevant.

#### Acceptance Criteria

1. WHEN viewing requirements.md THEN CodeLens SHALL appear at requirement section headers
2. WHEN viewing design.md THEN CodeLens SHALL appear at major section headers
3. WHEN viewing tasks.md THEN CodeLens SHALL appear at individual task items
4. WHEN document structure changes THEN CodeLens positions SHALL update accordingly

### Requirement 5

**User Story:** As a developer, I want the extension to handle edge cases gracefully, so that the feature works reliably in various scenarios.

#### Acceptance Criteria

1. WHEN .coworkflow directory doesn't exist THEN the extension SHALL not activate file watchers
2. WHEN monitored files don't exist THEN the extension SHALL handle missing files without errors
3. WHEN files have malformed content THEN the extension SHALL provide basic functionality without crashing
4. WHEN multiple workspaces are open THEN each workspace SHALL have independent file monitoring
Loading
Loading