Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
27 changes: 27 additions & 0 deletions src/core/command-generation/adapters/easycode.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Easy Code Command Adapter
*
* Formats commands for Easy Code using TOML format.
* Easy Code stores commands as TOML files at .easycode/commands/opsx/<id>.toml
*/

import path from 'path';
import type { CommandContent, ToolCommandAdapter } from '../types.js';

/**
* Easy Code adapter for command generation.
* File path: .easycode/commands/opsx/<id>.toml
* Format: TOML with description string and prompt multiline literal string
*/
export const easycodeAdapter: ToolCommandAdapter = {
toolId: 'easycode',

getFilePath(commandId: string): string {
return path.join('.easycode', 'commands', 'opsx', `${commandId}.toml`);
},

formatFile(content: CommandContent): string {
const safeDesc = content.description.replace(/"/g, '\\"');
return `description = "${safeDesc}"\n\nprompt = '''\n${content.body}\n'''\n`;
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
},
};
1 change: 1 addition & 0 deletions src/core/command-generation/adapters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export { continueAdapter } from './continue.js';
export { costrictAdapter } from './costrict.js';
export { crushAdapter } from './crush.js';
export { cursorAdapter } from './cursor.js';
export { easycodeAdapter } from './easycode.js';
export { factoryAdapter } from './factory.js';
export { geminiAdapter } from './gemini.js';
export { githubCopilotAdapter } from './github-copilot.js';
Expand Down
2 changes: 2 additions & 0 deletions src/core/command-generation/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { continueAdapter } from './adapters/continue.js';
import { costrictAdapter } from './adapters/costrict.js';
import { crushAdapter } from './adapters/crush.js';
import { cursorAdapter } from './adapters/cursor.js';
import { easycodeAdapter } from './adapters/easycode.js';
import { factoryAdapter } from './adapters/factory.js';
import { geminiAdapter } from './adapters/gemini.js';
import { githubCopilotAdapter } from './adapters/github-copilot.js';
Expand Down Expand Up @@ -55,6 +56,7 @@ export class CommandAdapterRegistry {
CommandAdapterRegistry.register(costrictAdapter);
CommandAdapterRegistry.register(crushAdapter);
CommandAdapterRegistry.register(cursorAdapter);
CommandAdapterRegistry.register(easycodeAdapter);
CommandAdapterRegistry.register(factoryAdapter);
CommandAdapterRegistry.register(geminiAdapter);
CommandAdapterRegistry.register(githubCopilotAdapter);
Expand Down
1 change: 1 addition & 0 deletions src/core/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const AI_TOOLS: AIToolOption[] = [
{ name: 'CoStrict', value: 'costrict', available: true, successLabel: 'CoStrict', skillsDir: '.cospec' },
{ name: 'Crush', value: 'crush', available: true, successLabel: 'Crush', skillsDir: '.crush' },
{ name: 'Cursor', value: 'cursor', available: true, successLabel: 'Cursor', skillsDir: '.cursor' },
{ name: 'Easy Code', value: 'easycode', available: true, successLabel: 'Easy Code', skillsDir: '.easycode' },
{ name: 'Factory Droid', value: 'factory', available: true, successLabel: 'Factory Droid', skillsDir: '.factory' },
{ name: 'Gemini CLI', value: 'gemini', available: true, successLabel: 'Gemini CLI', skillsDir: '.gemini' },
{ name: 'GitHub Copilot', value: 'github-copilot', available: true, successLabel: 'GitHub Copilot', skillsDir: '.github', detectionPaths: ['.github/copilot-instructions.md', '.github/instructions', '.github/workflows/copilot-setup-steps.yml', '.github/prompts', '.github/agents', '.github/skills', '.github/.mcp.json'] },
Expand Down