Skip to content

Commit 9af1477

Browse files
committed
TNE-Code
1 parent 8d5dab3 commit 9af1477

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+7107
-621
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build and Attach to Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-and-attach:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write # Required for uploading release assets
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js and pnpm
18+
uses: ./.github/actions/setup-node-pnpm
19+
with:
20+
skip-checkout: 'true'
21+
22+
- name: Create .env file
23+
run: echo "POSTHOG_API_KEY=${{ secrets.POSTHOG_API_KEY }}" >> .env
24+
25+
- name: Build and Package Extension
26+
run: |
27+
pnpm bundle
28+
pnpm vsix
29+
30+
- name: Get package version
31+
id: version
32+
run: echo "version=$(node -p "require('./src/package.json').version")" >> $GITHUB_OUTPUT
33+
34+
- name: Upload VSIX to Release
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
run: |
38+
gh release upload ${{ github.event.release.tag_name }} \
39+
bin/tne-code-${{ steps.version.outputs.version }}.vsix \
40+
--clobber

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,3 @@ logs
4343
.idea/
4444
.qodo/
4545
.vercel
46-
.roo/mcp.json

.roomodes

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ customModes:
22
- slug: test
33
name: 🧪 Test
44
roleDefinition: >-
5-
You are Roo, a Jest testing specialist with deep expertise in:
5+
You are TNE-Code, a Jest testing specialist with deep expertise in:
66

77
- Writing and maintaining Jest test suites
88

@@ -61,7 +61,7 @@ customModes:
6161
- slug: design-engineer
6262
name: 🎨 Design Engineer
6363
roleDefinition: >-
64-
You are Roo, an expert Design Engineer focused on VSCode Extension
64+
You are TNE-Code, an expert Design Engineer focused on VSCode Extension
6565
development. Your expertise includes:
6666

6767
- Implementing UI designs with high fidelity using React, Shadcn, Tailwind
@@ -102,7 +102,7 @@ customModes:
102102
source: project
103103
- slug: release-engineer
104104
name: 🚀 Release Engineer
105-
roleDefinition: You are Roo, a release engineer specialized in automating the
105+
roleDefinition: You are TNE-Code, a release engineer specialized in automating the
106106
release process for software projects. You have expertise in version
107107
control, changelogs, release notes, creating changesets, and coordinating
108108
with translation teams to ensure a smooth release process.
@@ -172,8 +172,8 @@ customModes:
172172
- browser
173173
source: project
174174
- slug: translate
175-
name: 🌐 Translate
176-
roleDefinition: You are Roo, a linguistic specialist focused on translating and
175+
name: ✍️ Translate
176+
roleDefinition: You are TNE-Code, a linguistic specialist focused on translating and
177177
managing localization files. Your responsibility is to help maintain and
178178
update translation files for the application, ensuring consistency and
179179
accuracy across all language resources.
Lines changed: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
1+
# Run GraphAI Tool Implementation Plan
2+
3+
## Overview
4+
5+
This document outlines the implementation plan for adding a `run_graphai` tool to Roo Code. The tool will execute GraphAI workflow files when they are in the context, similar to how the reference GraphAI debugger VS Code extension works.
6+
7+
## Background Analysis
8+
9+
### Current Roo Code Architecture
10+
11+
- Tools are defined in [`src/shared/tools.ts`](../src/shared/tools.ts)
12+
- Tool implementations are in [`src/core/tools/`](../src/core/tools/)
13+
- Tools are organized into groups: read, edit, browser, command, mcp, modes
14+
- The [`execute_command`](../src/core/tools/executeCommandTool.ts) tool provides a good template for CLI-based tools
15+
16+
### GraphAI File Structure
17+
18+
GraphAI files use YAML or JSON format with this structure:
19+
```yaml
20+
agents:
21+
node_name:
22+
agent: agent_type
23+
name: "Display Name"
24+
description: "Node description"
25+
inputs:
26+
input_name: ":source_node"
27+
```
28+
29+
### Reference Implementation
30+
31+
The GraphAI debugger extension executes GraphAI files using:
32+
- CLI command: `graphai <filepath>`
33+
- File validation for `.yaml`, `.yml`, `.json` extensions
34+
- Error handling with LLM analysis
35+
- Interactive webview for output display
36+
37+
## Implementation Plan
38+
39+
### Phase 1: Core Tool Registration
40+
41+
```mermaid
42+
graph TD
43+
A[Add run_graphai to ToolName type] --> B[Create RunGraphaiToolUse interface]
44+
B --> C[Add tool to TOOL_DISPLAY_NAMES]
45+
C --> D[Add tool to command group]
46+
D --> E[Create runGraphaiTool.ts implementation]
47+
E --> F[Register tool in presentAssistantMessage.ts]
48+
F --> G[Add tool description]
49+
```
50+
51+
### Phase 2: File Changes Required
52+
53+
#### 1. `src/shared/tools.ts`
54+
- Add `run_graphai: "run graphai workflows"` to `TOOL_DISPLAY_NAMES`
55+
- Create `RunGraphaiToolUse` interface:
56+
```typescript
57+
export interface RunGraphaiToolUse extends ToolUse {
58+
name: "run_graphai"
59+
params: Partial<Pick<Record<ToolParamName, string>, "path">>
60+
}
61+
```
62+
- Add to `command` tool group alongside `execute_command`
63+
64+
#### 2. `src/core/tools/runGraphaiTool.ts` (NEW FILE)
65+
- Similar structure to `executeCommandTool.ts`
66+
- Validate GraphAI file format (`.yaml`, `.yml`, `.json`)
67+
- Execute `graphai <filepath>` command using existing terminal infrastructure
68+
- Handle GraphAI-specific error patterns
69+
- Provide enhanced error messages for common GraphAI issues
70+
71+
#### 3. `src/core/assistant-message/presentAssistantMessage.ts`
72+
- Add case for `"run_graphai"` in tool execution switch
73+
- Add tool name display logic
74+
75+
#### 4. `src/core/prompts/tools/run-graphai.ts` (NEW FILE)
76+
- Create tool description following existing patterns
77+
- Add to `src/core/prompts/tools/index.ts`
78+
79+
### Phase 3: Tool Implementation Details
80+
81+
#### File Validation Logic
82+
```typescript
83+
function isValidGraphAIFile(filePath: string): boolean {
84+
const ext = path.extname(filePath).toLowerCase()
85+
return ['.yaml', '.yml', '.json'].includes(ext)
86+
}
87+
88+
function validateGraphAIContent(content: string, filePath: string): boolean {
89+
// Parse and validate GraphAI structure
90+
// Check for required sections (agents/nodes)
91+
// Return validation result
92+
}
93+
```
94+
95+
#### Command Execution
96+
```typescript
97+
// Similar to executeCommandTool but with GraphAI-specific handling
98+
const command = `graphai "${filePath}"`
99+
// Execute using existing terminal infrastructure
100+
// Parse GraphAI-specific output and errors
101+
```
102+
103+
#### Tool Description Format
104+
```markdown
105+
## run_graphai
106+
Description: Execute a GraphAI workflow file. This tool runs GraphAI YAML or JSON files using the graphai CLI command. GraphAI files define agent workflows with nodes and connections for AI-powered data processing pipelines.
107+
108+
Parameters:
109+
- path: (required) Path to the GraphAI YAML or JSON file to execute
110+
111+
Usage:
112+
<run_graphai>
113+
<path>path/to/workflow.yaml</path>
114+
</run_graphai>
115+
116+
Example: Running a GraphAI workflow
117+
<run_graphai>
118+
<path>./workflows/data-processing.yaml</path>
119+
</run_graphai>
120+
```
121+
122+
### Phase 4: Enhanced Features
123+
124+
#### GraphAI-Specific Enhancements
125+
1. **File Validation**
126+
- Check if file is a valid GraphAI YAML/JSON
127+
- Validate basic GraphAI structure (has `agents` or `nodes` section)
128+
- Provide helpful error messages for invalid files
129+
130+
2. **Context Awareness**
131+
- Auto-detect GraphAI files in workspace
132+
- Suggest running GraphAI when GraphAI files are in context
133+
- Integration with file reading tools
134+
135+
3. **Error Handling**
136+
- Parse GraphAI-specific error messages
137+
- Provide suggestions for common GraphAI issues
138+
- Integration with existing error handling patterns
139+
140+
## Implementation Strategy
141+
142+
### Step 1: Basic Tool Registration
143+
1. Add tool definition to shared types
144+
2. Create basic tool implementation
145+
3. Register in tool execution pipeline
146+
147+
### Step 2: CLI Integration
148+
1. Implement GraphAI CLI execution
149+
2. Handle file validation
150+
3. Process command output
151+
152+
### Step 3: Error Handling
153+
1. Add GraphAI-specific error parsing
154+
2. Implement helpful error messages
155+
3. Integration with existing error patterns
156+
157+
### Step 4: Context Integration
158+
1. Auto-detection of GraphAI files
159+
2. Smart suggestions when GraphAI files are present
160+
3. Integration with file reading tools
161+
162+
## Integration Points
163+
164+
### With Existing Tools
165+
- `read_file` for reading GraphAI files
166+
- `execute_command` for CLI execution patterns
167+
- `list_files` for discovering GraphAI files
168+
169+
### With Tool Groups
170+
- Add to `command` group alongside `execute_command`
171+
- Consider creating a new `graphai` group if more GraphAI tools are planned
172+
173+
### With Error Handling
174+
- Leverage existing error handling infrastructure
175+
- Add GraphAI-specific error patterns and suggestions
176+
177+
## Future Enhancements
178+
179+
### Advanced GraphAI Integration
180+
- Direct npm package usage for better control
181+
- GraphAI workflow visualization
182+
- Interactive debugging capabilities
183+
184+
### Workflow Management
185+
- GraphAI workflow templates
186+
- Workflow validation and linting
187+
- Performance monitoring
188+
189+
### AI-Powered Features
190+
- Automatic workflow generation
191+
- Error analysis and suggestions
192+
- Workflow optimization recommendations
193+
194+
## Testing Strategy
195+
196+
### Unit Tests
197+
- Test file validation logic
198+
- Test command execution
199+
- Test error handling
200+
201+
### Integration Tests
202+
- Test with sample GraphAI files
203+
- Test error scenarios
204+
- Test tool registration
205+
206+
### Manual Testing
207+
- Test with reference GraphAI files
208+
- Test error handling with invalid files
209+
- Test integration with other tools
210+
211+
## Success Criteria
212+
213+
1. ✅ Tool successfully registered in Roo Code
214+
2. ✅ Can execute valid GraphAI YAML/JSON files
215+
3. ✅ Provides helpful error messages for invalid files
216+
4. ✅ Integrates seamlessly with existing tool ecosystem
217+
5. ✅ Follows Roo Code coding patterns and conventions
218+
6. ✅ Includes comprehensive documentation and tests
219+
220+
## Implementation Notes
221+
222+
- Follow existing patterns from `executeCommandTool.ts`
223+
- Ensure proper error handling and user feedback
224+
- Maintain consistency with Roo Code's tool architecture
225+
- Consider future extensibility for advanced GraphAI features
226+
- Leverage existing terminal and command execution infrastructure
227+
228+
This implementation will provide a solid foundation for GraphAI workflow execution within Roo Code while maintaining consistency with existing patterns and allowing for future enhancements.

0 commit comments

Comments
 (0)