@mindfoldhq/trellis 0.6.4 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +1 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/channel/messages.js +1 -1
- package/dist/commands/channel/supervisor.d.ts.map +1 -1
- package/dist/commands/channel/supervisor.js +34 -2
- package/dist/commands/channel/supervisor.js.map +1 -1
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/uninstall.d.ts.map +1 -1
- package/dist/commands/uninstall.js +1 -0
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +23 -11
- package/dist/commands/update.js.map +1 -1
- package/dist/configurators/index.d.ts.map +1 -1
- package/dist/configurators/index.js +20 -0
- package/dist/configurators/index.js.map +1 -1
- package/dist/configurators/pi.d.ts.map +1 -1
- package/dist/configurators/pi.js +14 -4
- package/dist/configurators/pi.js.map +1 -1
- package/dist/configurators/trae.d.ts +17 -0
- package/dist/configurators/trae.d.ts.map +1 -0
- package/dist/configurators/trae.js +42 -0
- package/dist/configurators/trae.js.map +1 -0
- package/dist/configurators/zcode.js +3 -3
- package/dist/configurators/zcode.js.map +1 -1
- package/dist/migrations/manifests/0.6.5.json +9 -0
- package/dist/templates/codex/skills/brainstorm/SKILL.md +19 -1
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-hooks.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md +1 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +2 -2
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +2 -0
- package/dist/templates/common/skills/brainstorm.md +19 -1
- package/dist/templates/copilot/prompts/brainstorm.prompt.md +19 -1
- package/dist/templates/pi/agents/trellis-check.md +1 -1
- package/dist/templates/pi/agents/trellis-implement.md +1 -1
- package/dist/templates/pi/agents/trellis-research.md +1 -1
- package/dist/templates/pi/extensions/trellis/index.ts.txt +84 -8
- package/dist/templates/shared-hooks/index.d.ts +1 -1
- package/dist/templates/shared-hooks/index.d.ts.map +1 -1
- package/dist/templates/shared-hooks/index.js +1 -0
- package/dist/templates/shared-hooks/index.js.map +1 -1
- package/dist/templates/shared-hooks/inject-workflow-state.py +39 -4
- package/dist/templates/shared-hooks/session-start.py +5 -0
- package/dist/templates/trae/agents/trellis-check.md +108 -0
- package/dist/templates/trae/agents/trellis-implement.md +103 -0
- package/dist/templates/trae/agents/trellis-research.md +137 -0
- package/dist/templates/trae/hooks.json +27 -0
- package/dist/templates/trae/index.d.ts +15 -0
- package/dist/templates/trae/index.d.ts.map +1 -0
- package/dist/templates/trae/index.js +15 -0
- package/dist/templates/trae/index.js.map +1 -0
- package/dist/templates/trellis/scripts/common/active_task.py +2 -0
- package/dist/templates/trellis/scripts/common/cli_adapter.py +37 -11
- package/dist/templates/trellis/scripts/common/task_store.py +1 -0
- package/dist/templates/trellis/workflow.md +21 -19
- package/dist/types/ai-tools.d.ts +4 -4
- package/dist/types/ai-tools.d.ts.map +1 -1
- package/dist/types/ai-tools.js +16 -0
- package/dist/types/ai-tools.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: trellis-check
|
|
3
|
+
description: |
|
|
4
|
+
Code quality check expert. Reviews code changes against specs and self-fixes issues.
|
|
5
|
+
tools: Read, Write, Edit, Bash, Glob, Grep
|
|
6
|
+
---
|
|
7
|
+
# Check Agent
|
|
8
|
+
|
|
9
|
+
You are the Check Agent in the Trellis workflow.
|
|
10
|
+
|
|
11
|
+
## Recursion Guard
|
|
12
|
+
|
|
13
|
+
You are already the `trellis-check` sub-agent that the main session dispatched. Do the review and fixes directly.
|
|
14
|
+
|
|
15
|
+
- Do NOT spawn another `trellis-check` or `trellis-implement` sub-agent.
|
|
16
|
+
- If SessionStart context, workflow-state breadcrumbs, or workflow.md say to dispatch `trellis-implement` / `trellis-check`, treat that as a main-session instruction that is already satisfied by your current role.
|
|
17
|
+
- Only the main session may dispatch Trellis implement/check agents. If more implementation work is needed, report that recommendation instead of spawning.
|
|
18
|
+
|
|
19
|
+
## Context
|
|
20
|
+
|
|
21
|
+
Before checking, read:
|
|
22
|
+
- `.trellis/spec/` - Development guidelines
|
|
23
|
+
- Task `prd.md` - Requirements document
|
|
24
|
+
- Task `design.md` - Technical design (if exists)
|
|
25
|
+
- Task `implement.md` - Execution plan (if exists)
|
|
26
|
+
- Pre-commit checklist for quality standards
|
|
27
|
+
|
|
28
|
+
## Core Responsibilities
|
|
29
|
+
|
|
30
|
+
1. **Get code changes** - Use git diff to get uncommitted code
|
|
31
|
+
2. **Review task artifacts** - Check changes against prd.md, design.md if present, and implement.md if present
|
|
32
|
+
3. **Check against specs** - Verify code follows guidelines
|
|
33
|
+
4. **Self-fix** - Fix issues yourself, not just report them
|
|
34
|
+
5. **Run verification** - typecheck and lint
|
|
35
|
+
|
|
36
|
+
## Important
|
|
37
|
+
|
|
38
|
+
**Fix issues yourself**, don't just report them.
|
|
39
|
+
|
|
40
|
+
You have write and edit tools, you can modify code directly.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Workflow
|
|
45
|
+
|
|
46
|
+
### Step 1: Get Changes
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
git diff --name-only # List changed files
|
|
50
|
+
git diff # View specific changes
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Step 2: Check Against Specs and Task Artifacts
|
|
54
|
+
|
|
55
|
+
Read the task's prd.md, design.md if present, and implement.md if present, then read relevant specs in `.trellis/spec/` to check code:
|
|
56
|
+
|
|
57
|
+
- Does it satisfy the task requirements
|
|
58
|
+
- Does it follow the technical design and implementation plan when present
|
|
59
|
+
- Does it follow directory structure conventions
|
|
60
|
+
- Does it follow naming conventions
|
|
61
|
+
- Does it follow code patterns
|
|
62
|
+
- Are there missing types
|
|
63
|
+
- Are there potential bugs
|
|
64
|
+
|
|
65
|
+
### Step 3: Self-Fix
|
|
66
|
+
|
|
67
|
+
After finding issues:
|
|
68
|
+
|
|
69
|
+
1. Fix the issue directly (use edit tool)
|
|
70
|
+
2. Record what was fixed
|
|
71
|
+
3. Continue checking other issues
|
|
72
|
+
|
|
73
|
+
### Step 4: Run Verification
|
|
74
|
+
|
|
75
|
+
Run project's lint and typecheck commands to verify changes.
|
|
76
|
+
|
|
77
|
+
If failed, fix issues and re-run.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Report Format
|
|
82
|
+
|
|
83
|
+
```markdown
|
|
84
|
+
## Self-Check Complete
|
|
85
|
+
|
|
86
|
+
### Files Checked
|
|
87
|
+
|
|
88
|
+
- src/components/Feature.tsx
|
|
89
|
+
- src/hooks/useFeature.ts
|
|
90
|
+
|
|
91
|
+
### Issues Found and Fixed
|
|
92
|
+
|
|
93
|
+
1. `<file>:<line>` - <what was fixed>
|
|
94
|
+
2. `<file>:<line>` - <what was fixed>
|
|
95
|
+
|
|
96
|
+
### Issues Not Fixed
|
|
97
|
+
|
|
98
|
+
(If there are issues that cannot be self-fixed, list them here with reasons)
|
|
99
|
+
|
|
100
|
+
### Verification Results
|
|
101
|
+
|
|
102
|
+
- TypeCheck: Passed
|
|
103
|
+
- Lint: Passed
|
|
104
|
+
|
|
105
|
+
### Summary
|
|
106
|
+
|
|
107
|
+
Checked X files, found Y issues, all fixed.
|
|
108
|
+
```
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: trellis-implement
|
|
3
|
+
description: |
|
|
4
|
+
Code implementation expert. Understands specs and requirements, then implements features. No git commit allowed.
|
|
5
|
+
tools: Read, Write, Edit, Bash, Glob, Grep
|
|
6
|
+
---
|
|
7
|
+
# Implement Agent
|
|
8
|
+
|
|
9
|
+
You are the Implement Agent in the Trellis workflow.
|
|
10
|
+
|
|
11
|
+
## Recursion Guard
|
|
12
|
+
|
|
13
|
+
You are already the `trellis-implement` sub-agent that the main session dispatched. Do the implementation work directly.
|
|
14
|
+
|
|
15
|
+
- Do NOT spawn another `trellis-implement` or `trellis-check` sub-agent.
|
|
16
|
+
- If SessionStart context, workflow-state breadcrumbs, or workflow.md say to dispatch `trellis-implement` / `trellis-check`, treat that as a main-session instruction that is already satisfied by your current role.
|
|
17
|
+
- Only the main session may dispatch Trellis implement/check agents. If more parallel work is needed, report that recommendation instead of spawning.
|
|
18
|
+
|
|
19
|
+
## Context
|
|
20
|
+
|
|
21
|
+
Before implementing, read:
|
|
22
|
+
- `.trellis/workflow.md` - Project workflow
|
|
23
|
+
- `.trellis/spec/` - Development guidelines
|
|
24
|
+
- Task `prd.md` - Requirements document
|
|
25
|
+
- Task `design.md` - Technical design (if exists)
|
|
26
|
+
- Task `implement.md` - Execution plan (if exists)
|
|
27
|
+
|
|
28
|
+
## Core Responsibilities
|
|
29
|
+
|
|
30
|
+
1. **Understand specs** - Read relevant spec files in `.trellis/spec/`
|
|
31
|
+
2. **Understand task artifacts** - Read prd.md, design.md if present, and implement.md if present
|
|
32
|
+
3. **Implement features** - Write code following specs and task artifacts
|
|
33
|
+
4. **Self-check** - Ensure code quality
|
|
34
|
+
5. **Report results** - Report completion status
|
|
35
|
+
|
|
36
|
+
## Forbidden Operations
|
|
37
|
+
|
|
38
|
+
**Do NOT execute these git commands:**
|
|
39
|
+
|
|
40
|
+
- `git commit`
|
|
41
|
+
- `git push`
|
|
42
|
+
- `git merge`
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Workflow
|
|
47
|
+
|
|
48
|
+
### 1. Understand Specs
|
|
49
|
+
|
|
50
|
+
Read relevant specs based on task type:
|
|
51
|
+
|
|
52
|
+
- Spec layers: `.trellis/spec/<package>/<layer>/`
|
|
53
|
+
- Shared guides: `.trellis/spec/guides/`
|
|
54
|
+
|
|
55
|
+
### 2. Understand Requirements
|
|
56
|
+
|
|
57
|
+
Read the task's prd.md, design.md if present, and implement.md if present:
|
|
58
|
+
|
|
59
|
+
- What are the core requirements
|
|
60
|
+
- Key points of technical design
|
|
61
|
+
- Implementation order, validation commands, and rollback points
|
|
62
|
+
|
|
63
|
+
### 3. Implement Features
|
|
64
|
+
|
|
65
|
+
- Write code following specs and task artifacts
|
|
66
|
+
- Follow existing code patterns
|
|
67
|
+
- Only do what's required, no over-engineering
|
|
68
|
+
|
|
69
|
+
### 4. Verify
|
|
70
|
+
|
|
71
|
+
Run project's lint and typecheck commands to verify changes.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Report Format
|
|
76
|
+
|
|
77
|
+
```markdown
|
|
78
|
+
## Implementation Complete
|
|
79
|
+
|
|
80
|
+
### Files Modified
|
|
81
|
+
|
|
82
|
+
- `src/components/Feature.tsx` - New component
|
|
83
|
+
- `src/hooks/useFeature.ts` - New hook
|
|
84
|
+
|
|
85
|
+
### Implementation Summary
|
|
86
|
+
|
|
87
|
+
1. Created Feature component...
|
|
88
|
+
2. Added useFeature hook...
|
|
89
|
+
|
|
90
|
+
### Verification Results
|
|
91
|
+
|
|
92
|
+
- Lint: Passed
|
|
93
|
+
- TypeCheck: Passed
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Code Standards
|
|
99
|
+
|
|
100
|
+
- Follow existing code patterns
|
|
101
|
+
- Don't add unnecessary abstractions
|
|
102
|
+
- Only do what's required, no over-engineering
|
|
103
|
+
- Keep code readable
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: trellis-research
|
|
3
|
+
description: |
|
|
4
|
+
Code and tech search expert. Finds files, patterns, and tech solutions, and PERSISTS every finding to the current task's research/ directory. No code modifications outside that directory.
|
|
5
|
+
tools: Read, Write, Glob, Grep, Bash, Skill, mcp__*
|
|
6
|
+
---
|
|
7
|
+
# Research Agent
|
|
8
|
+
|
|
9
|
+
You are the Research Agent in the Trellis workflow.
|
|
10
|
+
|
|
11
|
+
## Core Principle
|
|
12
|
+
|
|
13
|
+
**You do one thing: find, explain, and PERSIST information.**
|
|
14
|
+
|
|
15
|
+
Conversations get compacted; files don't. Every research output MUST end up as a file under `{TASK_DIR}/research/`. Returning findings only through the chat reply is a failure — the caller cannot read them next session.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Core Responsibilities
|
|
20
|
+
|
|
21
|
+
1. **Internal Search** — locate files/components, understand code logic, discover patterns (Glob, Grep, Read)
|
|
22
|
+
2. **External Search** — library docs, API references, best practices (web search)
|
|
23
|
+
3. **Persist** — write each research topic to `{TASK_DIR}/research/<topic>.md`
|
|
24
|
+
4. **Report** — return file paths + one-line summaries to the main agent (not full content)
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Workflow
|
|
29
|
+
|
|
30
|
+
### Step 1: Resolve Current Task
|
|
31
|
+
|
|
32
|
+
Run `python3 ./.trellis/scripts/task.py current --source` → active task path. If no active task is set, ask the user where to write output; do NOT guess.
|
|
33
|
+
|
|
34
|
+
Ensure `{TASK_DIR}/research/` exists:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
mkdir -p <TASK_DIR>/research
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Step 2: Understand Search Request
|
|
41
|
+
|
|
42
|
+
Classify: internal / external / mixed. Determine scope (global / specific directory) and expected shape (file list / pattern notes / tech comparison).
|
|
43
|
+
|
|
44
|
+
### Step 3: Execute Search
|
|
45
|
+
|
|
46
|
+
Run independent searches in parallel (Glob + Grep + web) for efficiency.
|
|
47
|
+
|
|
48
|
+
### Step 4: Persist Each Topic
|
|
49
|
+
|
|
50
|
+
For each distinct research topic, Write a markdown file at `{TASK_DIR}/research/<topic-slug>.md`. Use the File Format below.
|
|
51
|
+
|
|
52
|
+
### Step 5: Report to Main Agent
|
|
53
|
+
|
|
54
|
+
Reply with ONLY:
|
|
55
|
+
|
|
56
|
+
- List of files written (paths relative to repo root)
|
|
57
|
+
- One-line summary per file
|
|
58
|
+
- Any critical caveats that the main agent needs to know right now
|
|
59
|
+
|
|
60
|
+
Do NOT paste full research content into the reply. The files are the contract.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Scope Limits (Strict)
|
|
65
|
+
|
|
66
|
+
### Write ALLOWED
|
|
67
|
+
|
|
68
|
+
- `{TASK_DIR}/research/*.md` — your own output
|
|
69
|
+
- Creating `{TASK_DIR}/research/` if it doesn't exist (via `mkdir -p`)
|
|
70
|
+
|
|
71
|
+
### Write FORBIDDEN
|
|
72
|
+
|
|
73
|
+
- Code files (`src/`, `lib/`, …)
|
|
74
|
+
- Spec files (`.trellis/spec/`) — main agent should use `update-spec` skill instead
|
|
75
|
+
- `.trellis/scripts/`, `.trellis/workflow.md`, platform config (`.claude/`, `.cursor/`, `.trae/`, etc.)
|
|
76
|
+
- Other task directories
|
|
77
|
+
- Any git operation (commit / push / branch / merge)
|
|
78
|
+
|
|
79
|
+
If the user asks you to edit code, decline and suggest spawning `implement` instead.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## File Format
|
|
84
|
+
|
|
85
|
+
Each `{TASK_DIR}/research/<topic>.md` should follow:
|
|
86
|
+
|
|
87
|
+
```markdown
|
|
88
|
+
# Research: <topic>
|
|
89
|
+
|
|
90
|
+
- **Query**: <original query>
|
|
91
|
+
- **Scope**: <internal / external / mixed>
|
|
92
|
+
- **Date**: <YYYY-MM-DD>
|
|
93
|
+
|
|
94
|
+
## Findings
|
|
95
|
+
|
|
96
|
+
### Files Found
|
|
97
|
+
|
|
98
|
+
| File Path | Description |
|
|
99
|
+
|---|---|
|
|
100
|
+
| `src/services/xxx.ts` | Main implementation |
|
|
101
|
+
| `src/types/xxx.ts` | Type definitions |
|
|
102
|
+
|
|
103
|
+
### Code Patterns
|
|
104
|
+
|
|
105
|
+
<describe patterns, cite file:line>
|
|
106
|
+
|
|
107
|
+
### External References
|
|
108
|
+
|
|
109
|
+
- [Library X docs](url) — <why relevant, version constraints>
|
|
110
|
+
|
|
111
|
+
### Related Specs
|
|
112
|
+
|
|
113
|
+
- `.trellis/spec/xxx.md` — <description>
|
|
114
|
+
|
|
115
|
+
## Caveats / Not Found
|
|
116
|
+
|
|
117
|
+
<anything incomplete or uncertain>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Guidelines
|
|
123
|
+
|
|
124
|
+
### DO
|
|
125
|
+
|
|
126
|
+
- Provide specific file paths and line numbers
|
|
127
|
+
- Quote actual code snippets
|
|
128
|
+
- Persist every topic to its own file
|
|
129
|
+
- Return file paths in your reply, not the full content
|
|
130
|
+
- Mark "not found" explicitly when searches come up empty
|
|
131
|
+
|
|
132
|
+
### DON'T
|
|
133
|
+
|
|
134
|
+
- Don't write code or modify files outside `{TASK_DIR}/research/`
|
|
135
|
+
- Don't guess uncertain info
|
|
136
|
+
- Don't paste full research text into the reply (files are the deliverable)
|
|
137
|
+
- Don't propose improvements or critique implementation (that's not your role)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"hooks": {
|
|
4
|
+
"SessionStart": [
|
|
5
|
+
{
|
|
6
|
+
"hooks": [
|
|
7
|
+
{
|
|
8
|
+
"type": "command",
|
|
9
|
+
"command": "{{PYTHON_CMD}} .trae/hooks/session-start.py",
|
|
10
|
+
"timeout": 30
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"UserPromptSubmit": [
|
|
16
|
+
{
|
|
17
|
+
"hooks": [
|
|
18
|
+
{
|
|
19
|
+
"type": "command",
|
|
20
|
+
"command": "{{PYTHON_CMD}} .trae/hooks/inject-workflow-state.py",
|
|
21
|
+
"timeout": 15
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trae IDE templates
|
|
3
|
+
*
|
|
4
|
+
* These are GENERIC templates for user projects.
|
|
5
|
+
*
|
|
6
|
+
* Directory structure:
|
|
7
|
+
* trae/
|
|
8
|
+
* ├── agents/ # Multi-agent pipeline agents (Markdown)
|
|
9
|
+
* └── hooks.json # Hook configuration
|
|
10
|
+
*/
|
|
11
|
+
import { type AgentTemplate, type HookTemplate } from "../template-utils.js";
|
|
12
|
+
export type { AgentTemplate, HookTemplate };
|
|
13
|
+
export declare const getAllAgents: () => AgentTemplate[];
|
|
14
|
+
export declare const getSettingsTemplate: () => HookTemplate;
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/trae/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC;AAI5C,eAAO,MAAM,YAAY,QAAO,aAAa,EAAoB,CAAC;AAClE,eAAO,MAAM,mBAAmB,QAAO,YACZ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trae IDE templates
|
|
3
|
+
*
|
|
4
|
+
* These are GENERIC templates for user projects.
|
|
5
|
+
*
|
|
6
|
+
* Directory structure:
|
|
7
|
+
* trae/
|
|
8
|
+
* ├── agents/ # Multi-agent pipeline agents (Markdown)
|
|
9
|
+
* └── hooks.json # Hook configuration
|
|
10
|
+
*/
|
|
11
|
+
import { createTemplateReader, } from "../template-utils.js";
|
|
12
|
+
const { listMdAgents, getSettings } = createTemplateReader(import.meta.url);
|
|
13
|
+
export const getAllAgents = () => listMdAgents();
|
|
14
|
+
export const getSettingsTemplate = () => getSettings("hooks.json");
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/trae/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,oBAAoB,GAGrB,MAAM,sBAAsB,CAAC;AAI9B,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,oBAAoB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE5E,MAAM,CAAC,MAAM,YAAY,GAAG,GAAoB,EAAE,CAAC,YAAY,EAAE,CAAC;AAClE,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAiB,EAAE,CACpD,WAAW,CAAC,YAAY,CAAC,CAAC"}
|
|
@@ -43,6 +43,7 @@ _KNOWN_PLATFORMS = {
|
|
|
43
43
|
"kiro",
|
|
44
44
|
"copilot",
|
|
45
45
|
"pi",
|
|
46
|
+
"trae",
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
_ENV_SESSION_KEYS: tuple[tuple[str, tuple[str, ...]], ...] = (
|
|
@@ -57,6 +58,7 @@ _ENV_SESSION_KEYS: tuple[tuple[str, tuple[str, ...]], ...] = (
|
|
|
57
58
|
("kiro", ("KIRO_SESSION_ID",)),
|
|
58
59
|
("copilot", ("COPILOT_SESSION_ID", "COPILOT_SESSIONID")),
|
|
59
60
|
("pi", ("PI_SESSION_ID", "PI_SESSIONID")),
|
|
61
|
+
("trae", ("TRAE_SESSION_ID",)),
|
|
60
62
|
)
|
|
61
63
|
_ENV_CONVERSATION_KEYS: tuple[tuple[str, tuple[str, ...]], ...] = (
|
|
62
64
|
("cursor", ("CURSOR_CONVERSATION_ID", "CURSOR_CONVERSATIONID")),
|
|
@@ -19,6 +19,7 @@ Supported platforms:
|
|
|
19
19
|
- copilot: GitHub Copilot (VS Code)
|
|
20
20
|
- droid: Factory Droid (commands-based)
|
|
21
21
|
- pi: Pi Agent (extension-backed)
|
|
22
|
+
- trae: Trae IDE (IDE-only, hooks-based)
|
|
22
23
|
|
|
23
24
|
Usage:
|
|
24
25
|
from common.cli_adapter import CLIAdapter
|
|
@@ -53,6 +54,7 @@ Platform = Literal[
|
|
|
53
54
|
"copilot",
|
|
54
55
|
"droid",
|
|
55
56
|
"pi",
|
|
57
|
+
"trae",
|
|
56
58
|
]
|
|
57
59
|
|
|
58
60
|
|
|
@@ -97,7 +99,7 @@ class CLIAdapter:
|
|
|
97
99
|
"""Get platform-specific config directory name.
|
|
98
100
|
|
|
99
101
|
Returns:
|
|
100
|
-
Directory name ('.claude', '.opencode', '.cursor', '.iflow', '.codex', '.kilocode', '.kiro', '.gemini', '.agent', '.devin', '.qoder', '.codebuddy', '.github/copilot', '.factory', or '.
|
|
102
|
+
Directory name ('.claude', '.opencode', '.cursor', '.iflow', '.codex', '.kilocode', '.kiro', '.gemini', '.agent', '.devin', '.qoder', '.codebuddy', '.github/copilot', '.factory', '.pi', or '.trae')
|
|
101
103
|
"""
|
|
102
104
|
if self.platform == "opencode":
|
|
103
105
|
return ".opencode"
|
|
@@ -127,6 +129,8 @@ class CLIAdapter:
|
|
|
127
129
|
return ".factory"
|
|
128
130
|
elif self.platform == "pi":
|
|
129
131
|
return ".pi"
|
|
132
|
+
elif self.platform == "trae":
|
|
133
|
+
return ".trae"
|
|
130
134
|
else:
|
|
131
135
|
return ".claude"
|
|
132
136
|
|
|
@@ -137,7 +141,7 @@ class CLIAdapter:
|
|
|
137
141
|
project_root: Project root directory
|
|
138
142
|
|
|
139
143
|
Returns:
|
|
140
|
-
Path to config directory (.claude, .opencode, .cursor, .iflow, .codex, .kilocode, .kiro, .gemini, .agent, .devin, .qoder, .codebuddy, .github/copilot, .factory, or .
|
|
144
|
+
Path to config directory (.claude, .opencode, .cursor, .iflow, .codex, .kilocode, .kiro, .gemini, .agent, .devin, .qoder, .codebuddy, .github/copilot, .factory, .pi, or .trae)
|
|
141
145
|
"""
|
|
142
146
|
return project_root / self.config_dir_name
|
|
143
147
|
|
|
@@ -305,6 +309,8 @@ class CLIAdapter:
|
|
|
305
309
|
return {}
|
|
306
310
|
elif self.platform == "pi":
|
|
307
311
|
return {}
|
|
312
|
+
elif self.platform == "trae":
|
|
313
|
+
return {}
|
|
308
314
|
else:
|
|
309
315
|
return {"CLAUDE_NON_INTERACTIVE": "1"}
|
|
310
316
|
|
|
@@ -390,6 +396,10 @@ class CLIAdapter:
|
|
|
390
396
|
)
|
|
391
397
|
elif self.platform == "pi":
|
|
392
398
|
cmd = ["pi", "-p", prompt]
|
|
399
|
+
elif self.platform == "trae":
|
|
400
|
+
raise ValueError(
|
|
401
|
+
"Trae is IDE-only; CLI agent run is not supported."
|
|
402
|
+
)
|
|
393
403
|
|
|
394
404
|
else: # claude
|
|
395
405
|
cmd = ["claude", "-p"]
|
|
@@ -456,6 +466,10 @@ class CLIAdapter:
|
|
|
456
466
|
)
|
|
457
467
|
elif self.platform == "pi":
|
|
458
468
|
return ["pi", "-c", session_id]
|
|
469
|
+
elif self.platform == "trae":
|
|
470
|
+
raise ValueError(
|
|
471
|
+
"Trae is IDE-only; CLI resume is not supported."
|
|
472
|
+
)
|
|
459
473
|
else:
|
|
460
474
|
return ["claude", "--resume", session_id]
|
|
461
475
|
|
|
@@ -530,6 +544,8 @@ class CLIAdapter:
|
|
|
530
544
|
return "droid"
|
|
531
545
|
elif self.platform == "pi":
|
|
532
546
|
return "pi"
|
|
547
|
+
elif self.platform == "trae":
|
|
548
|
+
return "trae"
|
|
533
549
|
else:
|
|
534
550
|
return "claude"
|
|
535
551
|
|
|
@@ -594,7 +610,7 @@ def get_cli_adapter(platform: str = "claude") -> CLIAdapter:
|
|
|
594
610
|
"""Get CLI adapter for the specified platform.
|
|
595
611
|
|
|
596
612
|
Args:
|
|
597
|
-
platform: Platform name ('claude', 'opencode', 'cursor', 'iflow', 'codex', 'kilo', 'kiro', 'gemini', 'antigravity', 'devin', 'qoder', 'codebuddy', 'copilot', 'droid', or '
|
|
613
|
+
platform: Platform name ('claude', 'opencode', 'cursor', 'iflow', 'codex', 'kilo', 'kiro', 'gemini', 'antigravity', 'devin', 'qoder', 'codebuddy', 'copilot', 'droid', 'pi', or 'trae')
|
|
598
614
|
|
|
599
615
|
Returns:
|
|
600
616
|
CLIAdapter instance
|
|
@@ -625,9 +641,10 @@ def get_cli_adapter(platform: str = "claude") -> CLIAdapter:
|
|
|
625
641
|
"copilot",
|
|
626
642
|
"droid",
|
|
627
643
|
"pi",
|
|
644
|
+
"trae",
|
|
628
645
|
):
|
|
629
646
|
raise ValueError(
|
|
630
|
-
f"Unsupported platform: {platform} (must be 'claude', 'opencode', 'cursor', 'iflow', 'codex', 'kilo', 'kiro', 'gemini', 'antigravity', 'devin', 'qoder', 'codebuddy', 'copilot', 'droid', or '
|
|
647
|
+
f"Unsupported platform: {platform} (must be 'claude', 'opencode', 'cursor', 'iflow', 'codex', 'kilo', 'kiro', 'gemini', 'antigravity', 'devin', 'qoder', 'codebuddy', 'copilot', 'droid', 'pi', or 'trae')"
|
|
631
648
|
)
|
|
632
649
|
|
|
633
650
|
return CLIAdapter(platform=platform) # type: ignore
|
|
@@ -650,6 +667,7 @@ _ALL_PLATFORM_CONFIG_DIRS = (
|
|
|
650
667
|
".github/copilot",
|
|
651
668
|
".factory",
|
|
652
669
|
".pi",
|
|
670
|
+
".trae",
|
|
653
671
|
)
|
|
654
672
|
"""Platform-specific config directory names used by detect_platform exclusion
|
|
655
673
|
checks. `.agents/skills/` is NOT listed here: it is a shared cross-platform
|
|
@@ -675,22 +693,25 @@ def detect_platform(project_root: Path) -> Platform:
|
|
|
675
693
|
2. .opencode directory exists → opencode
|
|
676
694
|
3. .iflow directory exists → iflow
|
|
677
695
|
4. .cursor directory exists (without .claude) → cursor
|
|
678
|
-
5. .
|
|
679
|
-
6. .
|
|
680
|
-
7. .
|
|
681
|
-
8. .
|
|
696
|
+
5. .gemini directory exists → gemini
|
|
697
|
+
6. .codex exists and no other platform dirs → codex
|
|
698
|
+
7. .kilocode directory exists → kilo
|
|
699
|
+
8. .kiro/skills exists and no other platform dirs → kiro
|
|
682
700
|
9. .agent/workflows exists and no other platform dirs → antigravity
|
|
683
701
|
10. .devin/workflows (or legacy .windsurf/workflows) exists and no other platform dirs → devin
|
|
684
702
|
11. .codebuddy directory exists → codebuddy
|
|
685
703
|
12. .qoder directory exists → qoder
|
|
686
|
-
13. .
|
|
687
|
-
14.
|
|
704
|
+
13. .github/copilot directory exists → copilot
|
|
705
|
+
14. .factory directory exists → droid
|
|
706
|
+
15. .pi directory exists → pi
|
|
707
|
+
16. .trae directory exists → trae
|
|
708
|
+
17. Default → claude
|
|
688
709
|
|
|
689
710
|
Args:
|
|
690
711
|
project_root: Project root directory
|
|
691
712
|
|
|
692
713
|
Returns:
|
|
693
|
-
Detected platform ('claude', 'opencode', 'cursor', 'iflow', 'codex', 'kilo', 'kiro', 'gemini', 'antigravity', 'devin', 'qoder', 'codebuddy', 'copilot', 'droid', 'pi', or default 'claude')
|
|
714
|
+
Detected platform ('claude', 'opencode', 'cursor', 'iflow', 'codex', 'kilo', 'kiro', 'gemini', 'antigravity', 'devin', 'qoder', 'codebuddy', 'copilot', 'droid', 'pi', 'trae', or default 'claude')
|
|
694
715
|
"""
|
|
695
716
|
import os
|
|
696
717
|
|
|
@@ -715,6 +736,7 @@ def detect_platform(project_root: Path) -> Platform:
|
|
|
715
736
|
"copilot",
|
|
716
737
|
"droid",
|
|
717
738
|
"pi",
|
|
739
|
+
"trae",
|
|
718
740
|
):
|
|
719
741
|
return env_platform # type: ignore
|
|
720
742
|
|
|
@@ -791,6 +813,10 @@ def detect_platform(project_root: Path) -> Platform:
|
|
|
791
813
|
if (project_root / ".pi").is_dir():
|
|
792
814
|
return "pi"
|
|
793
815
|
|
|
816
|
+
# Check for .trae directory (Trae IDE-specific)
|
|
817
|
+
if (project_root / ".trae").is_dir():
|
|
818
|
+
return "trae"
|
|
819
|
+
|
|
794
820
|
# Fallback: checkout only has the Codex shared-skills layer
|
|
795
821
|
# (.agents/skills/trellis-* dirs) and no explicit platform config dir.
|
|
796
822
|
# Happens on fresh clones where .codex/ is gitignored/absent but the
|