-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Expand file tree
/
Copy pathavian.ts
More file actions
34 lines (29 loc) · 785 Bytes
/
avian.ts
File metadata and controls
34 lines (29 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
* Avian Command Adapter
*
* Formats commands for Avian following its frontmatter specification.
*/
import path from 'path';
import type { CommandContent, ToolCommandAdapter } from '../types.js';
/**
* Avian adapter for command generation.
* File path: .avian/commands/opsx/<id>.md
* Frontmatter: name, description, category, tags
*/
export const avianAdapter: ToolCommandAdapter = {
toolId: 'avian',
getFilePath(commandId: string): string {
return path.join('.avian', 'commands', 'opsx', `${commandId}.md`);
},
formatFile(content: CommandContent): string {
const tagsStr = content.tags.join(', ');
return `---
name: ${content.name}
description: ${content.description}
category: ${content.category}
tags: [${tagsStr}]
---
${content.body}
`;
},
};