@zweer/dev 1.3.0 → 2.0.0

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.
Files changed (131) hide show
  1. package/README.md +68 -795
  2. package/configs/_biome.json +38 -0
  3. package/configs/commitlint.config.ts +1 -0
  4. package/configs/editorconfig +16 -0
  5. package/configs/lefthook.yml +38 -0
  6. package/configs/lockfile-lintrc.json +6 -0
  7. package/configs/npmpackagejsonlintrc.json +34 -0
  8. package/configs/tsconfig.json +9 -0
  9. package/configs/tsdown.config.ts +8 -0
  10. package/configs/vitest.config.ts +12 -0
  11. package/dist/index.d.mts +1 -0
  12. package/dist/index.mjs +247 -0
  13. package/dist/index.mjs.map +1 -0
  14. package/kiro/agents/zweer-setup.json +38 -0
  15. package/kiro/prompts/zweer-setup.md +55 -0
  16. package/kiro/skills/agent-template/SKILL.md +22 -0
  17. package/kiro/skills/agent-template/references/base.json +38 -0
  18. package/kiro/skills/agent-template/references/example-monorepo-library.json +60 -0
  19. package/kiro/skills/agent-template/references/example-webapp-vercel.json +54 -0
  20. package/kiro/skills/prompt-template/SKILL.md +23 -0
  21. package/kiro/skills/prompt-template/references/example-library.md +56 -0
  22. package/kiro/skills/prompt-template/references/example-webapp.md +57 -0
  23. package/kiro/skills/skill-templates/SKILL.md +23 -0
  24. package/kiro/skills/skill-templates/references/new-package.md +72 -0
  25. package/kiro/skills/steering-templates/SKILL.md +31 -0
  26. package/kiro/skills/steering-templates/references/build-tooling.md +62 -0
  27. package/kiro/skills/steering-templates/references/code-style.md +83 -0
  28. package/kiro/skills/steering-templates/references/commit-conventions.md +58 -0
  29. package/kiro/skills/steering-templates/references/interaction.md +41 -0
  30. package/kiro/skills/steering-templates/references/testing.md +61 -0
  31. package/kiro/steering/build-tooling.md +62 -0
  32. package/kiro/steering/code-style.md +83 -0
  33. package/kiro/steering/commit-conventions.md +58 -0
  34. package/kiro/steering/interaction.md +41 -0
  35. package/kiro/steering/testing.md +61 -0
  36. package/package.json +42 -57
  37. package/templates/monorepo/CHANGELOG.md +5 -0
  38. package/templates/monorepo/README.md +22 -0
  39. package/templates/monorepo/package.json +30 -0
  40. package/templates/monorepo/packages/core/CHANGELOG.md +5 -0
  41. package/templates/monorepo/packages/core/README.md +21 -0
  42. package/templates/monorepo/packages/core/package.json +28 -0
  43. package/templates/monorepo/packages/core/src/index.ts +3 -0
  44. package/templates/monorepo/packages/core/test/index.test.ts +9 -0
  45. package/templates/monorepo/tsdown.config.ts +12 -0
  46. package/templates/monorepo/vitest.config.ts +12 -0
  47. package/templates/single/CHANGELOG.md +5 -0
  48. package/templates/single/README.md +30 -0
  49. package/templates/single/package.json +38 -0
  50. package/templates/single/src/index.ts +3 -0
  51. package/templates/single/test/index.test.ts +9 -0
  52. package/templates/single/tsdown.config.ts +11 -0
  53. package/workflows/base/ci.yml +24 -0
  54. package/workflows/base/dependabot-auto-merge.yml +43 -0
  55. package/workflows/base/dependabot-lockfile.yml +34 -0
  56. package/workflows/base/dependabot.yml +39 -0
  57. package/workflows/base/pr.yml +41 -0
  58. package/workflows/base/security.yml +25 -0
  59. package/workflows/docs/docs.yml +47 -0
  60. package/workflows/library/npm.yml +45 -0
  61. package/agents/data/zweer_data_engineer.md +0 -436
  62. package/agents/design/zweer_ui_designer.md +0 -171
  63. package/agents/design/zweer_ui_ux.md +0 -124
  64. package/agents/infrastructure/zweer_infra_cdk.md +0 -701
  65. package/agents/infrastructure/zweer_infra_devops.md +0 -148
  66. package/agents/infrastructure/zweer_infra_observability.md +0 -610
  67. package/agents/infrastructure/zweer_infra_terraform.md +0 -658
  68. package/agents/mobile/zweer_mobile_android.md +0 -636
  69. package/agents/mobile/zweer_mobile_flutter.md +0 -623
  70. package/agents/mobile/zweer_mobile_ionic.md +0 -550
  71. package/agents/mobile/zweer_mobile_ios.md +0 -504
  72. package/agents/mobile/zweer_mobile_react_native.md +0 -561
  73. package/agents/quality/zweer_qa_documentation.md +0 -202
  74. package/agents/quality/zweer_qa_performance.md +0 -160
  75. package/agents/quality/zweer_qa_security.md +0 -197
  76. package/agents/quality/zweer_qa_testing.md +0 -189
  77. package/agents/services/zweer_svc_api_gateway.md +0 -553
  78. package/agents/services/zweer_svc_containers.md +0 -575
  79. package/agents/services/zweer_svc_lambda.md +0 -373
  80. package/agents/services/zweer_svc_messaging.md +0 -543
  81. package/agents/services/zweer_svc_microservices.md +0 -502
  82. package/agents/web/zweer_web_api_integration.md +0 -500
  83. package/agents/web/zweer_web_backend.md +0 -358
  84. package/agents/web/zweer_web_database.md +0 -357
  85. package/agents/web/zweer_web_frontend.md +0 -375
  86. package/agents/web/zweer_web_reader.md +0 -229
  87. package/agents/write/zweer_write_content.md +0 -499
  88. package/agents/write/zweer_write_narrative.md +0 -409
  89. package/agents/write/zweer_write_style.md +0 -247
  90. package/agents/write/zweer_write_warmth.md +0 -282
  91. package/cli/commands/bootstrap.d.ts +0 -4
  92. package/cli/commands/bootstrap.js +0 -377
  93. package/cli/commands/cao/agent/create.d.ts +0 -25
  94. package/cli/commands/cao/agent/create.js +0 -221
  95. package/cli/commands/cao/agent/index.d.ts +0 -2
  96. package/cli/commands/cao/agent/index.js +0 -8
  97. package/cli/commands/cao/agent/list.d.ts +0 -3
  98. package/cli/commands/cao/agent/list.js +0 -29
  99. package/cli/commands/cao/agent/remove.d.ts +0 -5
  100. package/cli/commands/cao/agent/remove.js +0 -39
  101. package/cli/commands/cao/index.d.ts +0 -2
  102. package/cli/commands/cao/index.js +0 -20
  103. package/cli/commands/cao/install.d.ts +0 -10
  104. package/cli/commands/cao/install.js +0 -59
  105. package/cli/commands/cao/launch.d.ts +0 -3
  106. package/cli/commands/cao/launch.js +0 -21
  107. package/cli/commands/cao/list.d.ts +0 -6
  108. package/cli/commands/cao/list.js +0 -36
  109. package/cli/commands/cao/server.d.ts +0 -3
  110. package/cli/commands/cao/server.js +0 -20
  111. package/cli/commands/cao/status.d.ts +0 -2
  112. package/cli/commands/cao/status.js +0 -25
  113. package/cli/commands/cao/sync.d.ts +0 -6
  114. package/cli/commands/cao/sync.js +0 -52
  115. package/cli/commands/cao/uninstall.d.ts +0 -2
  116. package/cli/commands/cao/uninstall.js +0 -16
  117. package/cli/commands/setup.d.ts +0 -4
  118. package/cli/commands/setup.js +0 -346
  119. package/cli/index.d.ts +0 -2
  120. package/cli/index.js +0 -13
  121. package/cli/utils/agents.d.ts +0 -8
  122. package/cli/utils/agents.js +0 -55
  123. package/cli/utils/cao.d.ts +0 -11
  124. package/cli/utils/cao.js +0 -56
  125. package/cli/utils/paths.d.ts +0 -5
  126. package/cli/utils/paths.js +0 -11
  127. package/templates/orchestrator_lambda.md +0 -263
  128. package/templates/orchestrator_microservices.md +0 -345
  129. package/templates/orchestrator_mobile.md +0 -199
  130. package/templates/orchestrator_webapp.md +0 -190
  131. package/templates/orchestrator_writing.md +0 -306
@@ -1,221 +0,0 @@
1
- import { mkdir, readFile, writeFile } from 'node:fs/promises';
2
- import { basename, join } from 'node:path';
3
- import { Command } from '@commander-js/extra-typings';
4
- import chalk from 'chalk';
5
- import inquirer from 'inquirer';
6
- import { paths } from '../../../utils/paths.js';
7
- export async function createAgent(config) {
8
- // Read template
9
- const templatePath = join(paths.templates, `${config.template}.md`);
10
- let template = await readFile(templatePath, 'utf-8');
11
- // Replace common placeholders
12
- template = template
13
- .replace(/\{\{PROJECT_NAME\}\}/g, config.projectName)
14
- .replace(/\{\{PROJECT_PATH\}\}/g, config.projectPath);
15
- // Replace template-specific placeholders
16
- if (config.techStack)
17
- template = template.replace(/\{\{TECH_STACK\}\}/g, config.techStack);
18
- if (config.projectStructure)
19
- template = template.replace(/\{\{PROJECT_STRUCTURE\}\}/g, config.projectStructure);
20
- if (config.platform)
21
- template = template.replace(/\{\{PLATFORM\}\}/g, config.platform);
22
- if (config.targetPlatforms)
23
- template = template.replace(/\{\{TARGET_PLATFORMS\}\}/g, config.targetPlatforms);
24
- if (config.iacTool)
25
- template = template.replace(/\{\{IAC_TOOL\}\}/g, config.iacTool);
26
- if (config.runtime)
27
- template = template.replace(/\{\{RUNTIME\}\}/g, config.runtime);
28
- if (config.serviceMesh)
29
- template = template.replace(/\{\{SERVICE_MESH\}\}/g, config.serviceMesh);
30
- if (config.contentType)
31
- template = template.replace(/\{\{CONTENT_TYPE\}\}/g, config.contentType);
32
- if (config.audience)
33
- template = template.replace(/\{\{AUDIENCE\}\}/g, config.audience);
34
- if (config.tone)
35
- template = template.replace(/\{\{TONE\}\}/g, config.tone);
36
- // Replace any remaining placeholders with empty string
37
- template = template.replace(/\{\{[A-Z_]+\}\}/g, '');
38
- // Create .cao/agents directory
39
- const caoDir = join(config.projectPath, '.cao', 'agents');
40
- await mkdir(caoDir, { recursive: true });
41
- // Write agent file
42
- const agentPath = join(caoDir, `${config.name}.md`);
43
- await writeFile(agentPath, template);
44
- return { agentPath };
45
- }
46
- export function getDefaultConfig(cwd, name, template) {
47
- const projectName = basename(cwd);
48
- const baseConfig = {
49
- name: name || `${projectName}_orchestrator`,
50
- projectName,
51
- projectPath: cwd,
52
- template: template || 'orchestrator_webapp',
53
- };
54
- // Template-specific defaults
55
- switch (template) {
56
- case 'orchestrator_mobile':
57
- return {
58
- ...baseConfig,
59
- platform: 'React Native',
60
- targetPlatforms: 'iOS, Android',
61
- };
62
- case 'orchestrator_lambda':
63
- return {
64
- ...baseConfig,
65
- iacTool: 'AWS CDK',
66
- runtime: 'Node.js 20',
67
- };
68
- case 'orchestrator_microservices':
69
- return {
70
- ...baseConfig,
71
- platform: 'EKS',
72
- serviceMesh: 'None',
73
- };
74
- case 'orchestrator_writing':
75
- return {
76
- ...baseConfig,
77
- contentType: 'Blog',
78
- audience: 'Developers',
79
- tone: 'Professional',
80
- };
81
- default:
82
- return {
83
- ...baseConfig,
84
- techStack: 'Next.js, TypeScript, PostgreSQL',
85
- projectStructure: 'app/, components/, lib/',
86
- };
87
- }
88
- }
89
- export const createCommand = new Command()
90
- .name('create')
91
- .description('Create a new agent in current project')
92
- .argument('[name]', 'Agent name')
93
- .option('-t, --template <template>', 'Template to use (orchestrator_webapp, orchestrator_mobile, orchestrator_lambda, orchestrator_microservices, orchestrator_writing)', 'orchestrator_webapp')
94
- .option('-y, --yes', 'Skip prompts and use defaults')
95
- .action(async (name, options) => {
96
- const cwd = process.cwd();
97
- let config = getDefaultConfig(cwd, name, options.template);
98
- if (!options.yes) {
99
- // Common prompts
100
- const commonAnswers = await inquirer.prompt([
101
- {
102
- type: 'input',
103
- name: 'name',
104
- message: 'Agent name:',
105
- default: config.name,
106
- },
107
- {
108
- type: 'input',
109
- name: 'projectName',
110
- message: 'Project name:',
111
- default: config.projectName,
112
- },
113
- ]);
114
- config = { ...config, ...commonAnswers };
115
- // Template-specific prompts
116
- let specificAnswers = {};
117
- switch (options.template) {
118
- case 'orchestrator_mobile':
119
- specificAnswers = await inquirer.prompt([
120
- {
121
- type: 'input',
122
- name: 'platform',
123
- message: 'Mobile platform:',
124
- default: config.platform,
125
- },
126
- {
127
- type: 'input',
128
- name: 'targetPlatforms',
129
- message: 'Target platforms:',
130
- default: config.targetPlatforms,
131
- },
132
- ]);
133
- break;
134
- case 'orchestrator_lambda':
135
- specificAnswers = await inquirer.prompt([
136
- {
137
- type: 'input',
138
- name: 'iacTool',
139
- message: 'IaC tool:',
140
- default: config.iacTool,
141
- },
142
- {
143
- type: 'input',
144
- name: 'runtime',
145
- message: 'Lambda runtime:',
146
- default: config.runtime,
147
- },
148
- ]);
149
- break;
150
- case 'orchestrator_microservices':
151
- specificAnswers = await inquirer.prompt([
152
- {
153
- type: 'input',
154
- name: 'platform',
155
- message: 'Container platform:',
156
- default: config.platform,
157
- },
158
- {
159
- type: 'input',
160
- name: 'serviceMesh',
161
- message: 'Service mesh:',
162
- default: config.serviceMesh,
163
- },
164
- ]);
165
- break;
166
- case 'orchestrator_writing':
167
- specificAnswers = await inquirer.prompt([
168
- {
169
- type: 'input',
170
- name: 'contentType',
171
- message: 'Content type:',
172
- default: config.contentType,
173
- },
174
- {
175
- type: 'input',
176
- name: 'audience',
177
- message: 'Target audience:',
178
- default: config.audience,
179
- },
180
- {
181
- type: 'input',
182
- name: 'tone',
183
- message: 'Tone:',
184
- default: config.tone,
185
- },
186
- ]);
187
- break;
188
- default:
189
- specificAnswers = await inquirer.prompt([
190
- {
191
- type: 'input',
192
- name: 'techStack',
193
- message: 'Tech stack:',
194
- default: config.techStack,
195
- },
196
- {
197
- type: 'input',
198
- name: 'projectStructure',
199
- message: 'Main folders:',
200
- default: config.projectStructure,
201
- },
202
- ]);
203
- }
204
- config = { ...config, ...specificAnswers };
205
- }
206
- console.log(chalk.cyan(`\nšŸŽÆ Creating agent: ${config.name}\n`));
207
- try {
208
- const { agentPath } = await createAgent(config);
209
- console.log(chalk.green(`āœ” Agent created: ${agentPath}\n`));
210
- console.log(chalk.dim('Next steps:'));
211
- console.log(chalk.dim(' 1. Edit the agent to add project-specific details'));
212
- console.log(chalk.dim(' 2. Run: dev cao sync'));
213
- console.log(chalk.dim(` 3. Run: dev cao launch ${config.name}`));
214
- console.log();
215
- }
216
- catch (error) {
217
- console.error(chalk.red('āœ– Failed to create agent'));
218
- console.error(error);
219
- process.exit(1);
220
- }
221
- });
@@ -1,2 +0,0 @@
1
- import { Command } from '@commander-js/extra-typings';
2
- export declare const agentCommand: Command<[], {}>;
@@ -1,8 +0,0 @@
1
- import { Command } from '@commander-js/extra-typings';
2
- import { createCommand } from './create.js';
3
- import { listCommand } from './list.js';
4
- import { removeCommand } from './remove.js';
5
- export const agentCommand = new Command().name('agent').description('Manage local project agents');
6
- agentCommand.addCommand(createCommand);
7
- agentCommand.addCommand(listCommand);
8
- agentCommand.addCommand(removeCommand);
@@ -1,3 +0,0 @@
1
- import { Command } from '@commander-js/extra-typings';
2
- export declare function getLocalAgents(): Promise<string[]>;
3
- export declare const listCommand: Command<[], {}>;
@@ -1,29 +0,0 @@
1
- import { readdir } from 'node:fs/promises';
2
- import { Command } from '@commander-js/extra-typings';
3
- import chalk from 'chalk';
4
- export async function getLocalAgents() {
5
- const caoAgentsDir = '.cao/agents';
6
- try {
7
- const files = await readdir(caoAgentsDir);
8
- return files.filter((f) => f.endsWith('.md')).map((f) => f.replace('.md', ''));
9
- }
10
- catch {
11
- return [];
12
- }
13
- }
14
- export const listCommand = new Command()
15
- .name('list')
16
- .description('List all local agents in .cao/agents/')
17
- .action(async () => {
18
- const agents = await getLocalAgents();
19
- if (agents.length === 0) {
20
- console.log(chalk.yellow('No local agents found in .cao/agents/'));
21
- console.log(chalk.dim('\nCreate one with: dev cao agent create <name>'));
22
- return;
23
- }
24
- console.log(chalk.bold(`\nLocal Agents (${agents.length}):\n`));
25
- for (const agent of agents) {
26
- console.log(chalk.cyan(` • ${agent}`));
27
- }
28
- console.log();
29
- });
@@ -1,5 +0,0 @@
1
- import { Command } from '@commander-js/extra-typings';
2
- export declare function removeAgent(name: string): Promise<void>;
3
- export declare const removeCommand: Command<[string], {
4
- yes?: true | undefined;
5
- }>;
@@ -1,39 +0,0 @@
1
- import { unlink } from 'node:fs/promises';
2
- import { join } from 'node:path';
3
- import { Command } from '@commander-js/extra-typings';
4
- import chalk from 'chalk';
5
- import inquirer from 'inquirer';
6
- export async function removeAgent(name) {
7
- const agentPath = join('.cao/agents', `${name}.md`);
8
- await unlink(agentPath);
9
- }
10
- export const removeCommand = new Command()
11
- .name('remove')
12
- .description('Remove a local agent')
13
- .argument('<name>', 'Agent name to remove')
14
- .option('-y, --yes', 'Skip confirmation')
15
- .action(async (name, options) => {
16
- if (!options.yes) {
17
- const { confirm } = await inquirer.prompt([
18
- {
19
- type: 'confirm',
20
- name: 'confirm',
21
- message: `Are you sure you want to remove ${name}?`,
22
- default: false,
23
- },
24
- ]);
25
- if (!confirm) {
26
- console.log(chalk.yellow('Cancelled'));
27
- return;
28
- }
29
- }
30
- try {
31
- await removeAgent(name);
32
- console.log(chalk.green(`āœ” Agent ${name} removed`));
33
- }
34
- catch (error) {
35
- console.error(chalk.red(`āœ– Failed to remove agent ${name}`));
36
- console.error(error);
37
- process.exit(1);
38
- }
39
- });
@@ -1,2 +0,0 @@
1
- import { Command } from '@commander-js/extra-typings';
2
- export declare const caoCommand: Command<[], {}>;
@@ -1,20 +0,0 @@
1
- import { Command } from '@commander-js/extra-typings';
2
- import { agentCommand } from './agent/index.js';
3
- import { installCommand } from './install.js';
4
- import { launchCommand } from './launch.js';
5
- import { listCommand } from './list.js';
6
- import { serverCommand } from './server.js';
7
- import { statusCommand } from './status.js';
8
- import { syncCommand } from './sync.js';
9
- import { uninstallCommand } from './uninstall.js';
10
- export const caoCommand = new Command()
11
- .name('cao')
12
- .description('Manage CAO (CLI Agent Orchestrator) and agents')
13
- .addCommand(agentCommand)
14
- .addCommand(installCommand)
15
- .addCommand(uninstallCommand)
16
- .addCommand(syncCommand)
17
- .addCommand(serverCommand)
18
- .addCommand(launchCommand)
19
- .addCommand(listCommand)
20
- .addCommand(statusCommand);
@@ -1,10 +0,0 @@
1
- import { Command } from '@commander-js/extra-typings';
2
- export declare function executeInstallCao(): Promise<void>;
3
- export declare function executeInstallAgents(): Promise<{
4
- installed: number;
5
- failed: number;
6
- }>;
7
- export declare const installCommand: Command<[], {
8
- caoOnly?: true | undefined;
9
- agentsOnly?: true | undefined;
10
- }>;
@@ -1,59 +0,0 @@
1
- import { Command } from '@commander-js/extra-typings';
2
- import chalk from 'chalk';
3
- import ora from 'ora';
4
- import { getAllAgents } from '../../utils/agents.js';
5
- import { installAgent, installCao } from '../../utils/cao.js';
6
- export async function executeInstallCao() {
7
- await installCao();
8
- }
9
- export async function executeInstallAgents() {
10
- const agents = await getAllAgents();
11
- let installed = 0;
12
- let failed = 0;
13
- for (const agent of agents) {
14
- try {
15
- await installAgent(agent.path);
16
- installed++;
17
- }
18
- catch {
19
- failed++;
20
- }
21
- }
22
- return { installed, failed };
23
- }
24
- export const installCommand = new Command()
25
- .name('install')
26
- .description('Install CAO and all common agents')
27
- .option('--cao-only', 'Install only CAO')
28
- .option('--agents-only', 'Install only agents')
29
- .action(async (options) => {
30
- const installCaoOnly = options.caoOnly;
31
- const installAgentsOnly = options.agentsOnly;
32
- // Install CAO
33
- if (!installAgentsOnly) {
34
- const spinner = ora('Installing CAO prerequisites...').start();
35
- spinner.stop();
36
- try {
37
- await executeInstallCao();
38
- console.log(chalk.green('āœ” CAO installed successfully'));
39
- }
40
- catch (error) {
41
- console.error(chalk.red('āœ– Failed to install CAO'));
42
- console.error(error);
43
- process.exit(1);
44
- }
45
- }
46
- // Install agents
47
- if (!installCaoOnly) {
48
- const agents = await getAllAgents();
49
- console.log(chalk.cyan(`Installing ${agents.length} agents...`));
50
- const { installed, failed } = await executeInstallAgents();
51
- if (failed === 0) {
52
- console.log(chalk.green(`āœ” All ${installed} agents installed successfully`));
53
- }
54
- else {
55
- console.log(chalk.yellow(`⚠ Installed ${installed} agents, ${failed} failed`));
56
- }
57
- }
58
- console.log(chalk.bold.green('\nāœ… Installation complete!\n'));
59
- });
@@ -1,3 +0,0 @@
1
- import { Command } from '@commander-js/extra-typings';
2
- export declare function executeLaunch(agentName: string): Promise<void>;
3
- export declare const launchCommand: Command<[string], {}>;
@@ -1,21 +0,0 @@
1
- import { Command } from '@commander-js/extra-typings';
2
- import chalk from 'chalk';
3
- import { launchAgent } from '../../utils/cao.js';
4
- export async function executeLaunch(agentName) {
5
- await launchAgent(agentName);
6
- }
7
- export const launchCommand = new Command()
8
- .name('launch')
9
- .description('Launch a specific agent')
10
- .argument('<agent>', 'Agent name to launch')
11
- .action(async (agentName) => {
12
- console.log(chalk.cyan(`šŸš€ Launching ${agentName}...\n`));
13
- try {
14
- await executeLaunch(agentName);
15
- }
16
- catch (error) {
17
- console.error(chalk.red(`Failed to launch ${agentName}`));
18
- console.error(error);
19
- process.exit(1);
20
- }
21
- });
@@ -1,6 +0,0 @@
1
- import { Command } from '@commander-js/extra-typings';
2
- import { type Agent } from '../../utils/agents.js';
3
- export declare function groupAgentsByCategory(agents: Agent[]): Record<string, Agent[]>;
4
- export declare const listCommand: Command<[], {
5
- installed?: true | undefined;
6
- }>;
@@ -1,36 +0,0 @@
1
- import { Command } from '@commander-js/extra-typings';
2
- import chalk from 'chalk';
3
- import { getAllAgents } from '../../utils/agents.js';
4
- import { getInstalledAgents } from '../../utils/cao.js';
5
- export function groupAgentsByCategory(agents) {
6
- return agents.reduce((acc, agent) => {
7
- const key = agent.subcategory ? `${agent.category}/${agent.subcategory}` : agent.category;
8
- if (!acc[key])
9
- acc[key] = [];
10
- acc[key].push(agent);
11
- return acc;
12
- }, {});
13
- }
14
- export const listCommand = new Command()
15
- .name('list')
16
- .description('List all available agents')
17
- .option('--installed', 'Show only installed agents')
18
- .action(async (options) => {
19
- const agents = await getAllAgents();
20
- const installed = await getInstalledAgents();
21
- const installedSet = new Set(installed);
22
- const filtered = options.installed ? agents.filter((a) => installedSet.has(a.name)) : agents;
23
- console.log(chalk.bold(`\nšŸ“¦ ${options.installed ? 'Installed' : 'Available'} Agents:\n`));
24
- const grouped = groupAgentsByCategory(filtered);
25
- for (const [category, categoryAgents] of Object.entries(grouped)) {
26
- console.log(chalk.cyan(`\n${category}:`));
27
- for (const agent of categoryAgents) {
28
- const isInstalled = installedSet.has(agent.name);
29
- const status = isInstalled ? chalk.green('āœ“') : chalk.gray('ā—‹');
30
- const desc = agent.description ? chalk.gray(` - ${agent.description}`) : '';
31
- console.log(` ${status} ${chalk.green(agent.name)}${desc}`);
32
- }
33
- }
34
- const installedCount = filtered.filter((a) => installedSet.has(a.name)).length;
35
- console.log(chalk.gray(`\nTotal: ${filtered.length} agents (${installedCount} installed, ${filtered.length - installedCount} available)\n`));
36
- });
@@ -1,3 +0,0 @@
1
- import { Command } from '@commander-js/extra-typings';
2
- export declare function executeServer(): Promise<void>;
3
- export declare const serverCommand: Command<[], {}>;
@@ -1,20 +0,0 @@
1
- import { Command } from '@commander-js/extra-typings';
2
- import chalk from 'chalk';
3
- import { startServer } from '../../utils/cao.js';
4
- export async function executeServer() {
5
- await startServer();
6
- }
7
- export const serverCommand = new Command()
8
- .name('server')
9
- .description('Launch the CAO server')
10
- .action(async () => {
11
- console.log(chalk.cyan('šŸš€ Starting CAO server...\n'));
12
- try {
13
- await executeServer();
14
- }
15
- catch (error) {
16
- console.error(chalk.red('Failed to start server'));
17
- console.error(error);
18
- process.exit(1);
19
- }
20
- });
@@ -1,2 +0,0 @@
1
- import { Command } from '@commander-js/extra-typings';
2
- export declare const statusCommand: Command<[], {}>;
@@ -1,25 +0,0 @@
1
- import { Command } from '@commander-js/extra-typings';
2
- import chalk from 'chalk';
3
- import { getAllAgents } from '../../utils/agents.js';
4
- import { getInstalledAgents } from '../../utils/cao.js';
5
- export const statusCommand = new Command()
6
- .name('status')
7
- .description('Show installation status of all agents')
8
- .action(async () => {
9
- const agents = await getAllAgents();
10
- const installed = await getInstalledAgents();
11
- const installedSet = new Set(installed);
12
- const installedAgents = agents.filter((a) => installedSet.has(a.name));
13
- const notInstalledAgents = agents.filter((a) => !installedSet.has(a.name));
14
- console.log(chalk.bold('\nšŸ“Š Agent Installation Status\n'));
15
- console.log(chalk.green(`āœ“ Installed: ${installedAgents.length}`));
16
- console.log(chalk.gray(`ā—‹ Not installed: ${notInstalledAgents.length}`));
17
- console.log(chalk.cyan(`šŸ“¦ Total: ${agents.length}\n`));
18
- if (notInstalledAgents.length > 0) {
19
- console.log(chalk.yellow('Not installed agents:'));
20
- for (const agent of notInstalledAgents) {
21
- console.log(chalk.gray(` ā—‹ ${agent.name}`));
22
- }
23
- console.log();
24
- }
25
- });
@@ -1,6 +0,0 @@
1
- import { Command } from '@commander-js/extra-typings';
2
- export declare function executeSync(): Promise<{
3
- installed: number;
4
- failed: number;
5
- }>;
6
- export declare const syncCommand: Command<[], {}>;
@@ -1,52 +0,0 @@
1
- import { readdir } from 'node:fs/promises';
2
- import { join } from 'node:path';
3
- import { Command } from '@commander-js/extra-typings';
4
- import chalk from 'chalk';
5
- import { installAgent } from '../../utils/cao.js';
6
- export async function executeSync() {
7
- const caoAgentsDir = '.cao/agents';
8
- let installed = 0;
9
- let failed = 0;
10
- try {
11
- const files = await readdir(caoAgentsDir);
12
- const agentFiles = files.filter((f) => f.endsWith('.md'));
13
- for (const file of agentFiles) {
14
- const agentPath = join(caoAgentsDir, file);
15
- try {
16
- await installAgent(agentPath);
17
- console.log(chalk.green(` āœ” ${file}`));
18
- installed++;
19
- }
20
- catch (error) {
21
- console.log(chalk.red(` āœ– ${file}`));
22
- console.error(chalk.dim(` ${error}`));
23
- failed++;
24
- }
25
- }
26
- }
27
- catch (error) {
28
- throw new Error(`Failed to read .cao/agents directory: ${error}`);
29
- }
30
- return { installed, failed };
31
- }
32
- export const syncCommand = new Command()
33
- .name('sync')
34
- .description('Sync all local agents from .cao/agents/')
35
- .action(async () => {
36
- console.log(chalk.cyan('Syncing local agents...\n'));
37
- try {
38
- const { installed, failed } = await executeSync();
39
- console.log();
40
- if (failed === 0) {
41
- console.log(chalk.green(`āœ” All ${installed} agents synced successfully`));
42
- }
43
- else {
44
- console.log(chalk.yellow(`⚠ Synced ${installed} agents, ${failed} failed`));
45
- }
46
- }
47
- catch (error) {
48
- console.error(chalk.red('āœ– Failed to sync agents'));
49
- console.error(error);
50
- process.exit(1);
51
- }
52
- });
@@ -1,2 +0,0 @@
1
- import { Command } from '@commander-js/extra-typings';
2
- export declare const uninstallCommand: Command<[string], {}>;
@@ -1,16 +0,0 @@
1
- import { Command } from '@commander-js/extra-typings';
2
- import chalk from 'chalk';
3
- import { getInstalledAgents, uninstallAgent } from '../../utils/cao.js';
4
- export const uninstallCommand = new Command()
5
- .name('uninstall')
6
- .description('Uninstall an agent')
7
- .argument('<agent>', 'Agent name to uninstall')
8
- .action(async (agentName) => {
9
- const installed = await getInstalledAgents();
10
- if (!installed.includes(agentName)) {
11
- console.error(chalk.red(`\nāŒ Agent "${agentName}" is not installed\n`));
12
- process.exit(1);
13
- }
14
- await uninstallAgent(agentName);
15
- console.log(chalk.green(`\nāœ“ Agent "${agentName}" uninstalled successfully\n`));
16
- });
@@ -1,4 +0,0 @@
1
- import { Command } from '@commander-js/extra-typings';
2
- export declare const setup: Command<[], {
3
- yes?: true | undefined;
4
- }>;