feat: add support for the Trae tool adapter#672
feat: add support for the Trae tool adapter#672cherrwer wants to merge 4 commits intoFission-AI:mainfrom
Conversation
📝 WalkthroughWalkthroughAdds a new Trae command adapter that formats commands into Markdown with YAML frontmatter, re-exports and registers it, updates docs and .gitignore, and adds tests covering path and formatting behavior. Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client
participant Registry as CommandAdapterRegistry
participant Adapter as traeAdapter
participant FS as FileSystem
Client->>Registry: request adapter for Trae
Registry-->>Client: returns traeAdapter
Client->>Adapter: getFilePath(commandId)
Adapter-->>Client: ".trae/commands/opsx/<id>.md"
Client->>Adapter: formatFile(commandContent)
Adapter->>Adapter: YAML-escape fields, serialize tags, build markdown
Adapter-->>Client: formatted Markdown with frontmatter
Client->>FS: write file to returned path
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.gitignore:
- Around line 149-151: Update the comment for the Trae entry to match the
project's comment style by adding a space after the hash; change the existing
"#Trae" comment to "# Trae" directly above the ".trae/" ignore rule so it is
consistent with other entries (e.g., "# Claude", "# Pnpm") in the .gitignore.
🧹 Nitpick comments (2)
docs/supported-tools.md (1)
36-36: Nit: the(via /opsx:*)annotation is unique to Trae.Other adapters that also use the
commands/opsx/path pattern (Claude, CodeBuddy, Crush, Gemini, Qoder) don't include this annotation. Consider removing it for consistency, or adding it to the other similar entries.src/core/command-generation/adapters/trae.ts (1)
10-22: Consider extracting shared YAML helpers to a common utility.
escapeYamlValueandformatTagsArrayare duplicated across multiple adapters: Claude, Windsurf, and Cursor (and now Trae). Extracting them into a shared module (e.g.,adapters/utils.ts) would reduce maintenance burden when the escaping logic needs updating.Not blocking for this PR since it follows the established pattern.
Summary by CodeRabbit