@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,346 +0,0 @@
1
- import { exec } from 'node:child_process';
2
- import { access, mkdir, readFile, writeFile } from 'node:fs/promises';
3
- import { promisify } from 'node:util';
4
- import { Command } from '@commander-js/extra-typings';
5
- import chalk from 'chalk';
6
- import inquirer from 'inquirer';
7
- import ora from 'ora';
8
- const execAsync = promisify(exec);
9
- const DEV_DEPENDENCIES = {
10
- '@biomejs/biome': '^2.3.4',
11
- '@semantic-release/changelog': '^6.0.3',
12
- '@semantic-release/git': '^10.0.1',
13
- '@tsconfig/node22': '^22.0.2',
14
- '@types/node': '^24.10.0',
15
- '@vitest/coverage-v8': '^4.0.8',
16
- concurrently: '^9.2.1',
17
- husky: '^9.1.7',
18
- 'lint-staged': '^16.2.6',
19
- 'lockfile-lint': '^4.14.1',
20
- 'ls-engines': '^0.9.3',
21
- 'npm-package-json-lint': '^8.0.0',
22
- 'npm-package-json-lint-config-default': '^7.0.1',
23
- publint: '^0.3.15',
24
- rimraf: '^6.1.0',
25
- 'semantic-release': '^25.0.2',
26
- typescript: '^5.9.3',
27
- vitest: '^4.0.8',
28
- };
29
- const SCRIPTS = {
30
- lint: 'concurrently npm:lint:* --prefixColors auto',
31
- 'lint:format': 'biome check --write',
32
- 'lint:lockfile': 'lockfile-lint --path package-lock.json',
33
- 'lint:engines': 'ls-engines',
34
- 'lint:package': 'npmPkgJsonLint .',
35
- 'lint:publish': 'publint --strict',
36
- test: 'vitest run',
37
- 'test:coverage': 'vitest run --coverage',
38
- check: 'npm run clean && npm run test:coverage && npm run build && npm run lint && npm run clean',
39
- prepare: 'husky',
40
- clean: 'rimraf --glob ./{src,test}/**/*.{d.ts,js} ./vitest*.{d.ts,js}',
41
- prebuild: 'npm run clean',
42
- build: 'tsc',
43
- release: 'semantic-release',
44
- };
45
- async function fileExists(path) {
46
- try {
47
- await access(path);
48
- return true;
49
- }
50
- catch {
51
- return false;
52
- }
53
- }
54
- export const setup = new Command()
55
- .name('setup')
56
- .description('Add standard configuration to an existing project')
57
- .option('-y, --yes', 'Skip prompts and use defaults')
58
- .action(async (options) => {
59
- const answers = options.yes
60
- ? { configs: ['all'] }
61
- : await inquirer.prompt([
62
- {
63
- type: 'checkbox',
64
- name: 'configs',
65
- message: 'Select configurations to add:',
66
- choices: [
67
- { name: 'All', value: 'all', checked: true },
68
- { name: 'TypeScript (tsconfig.json)', value: 'typescript' },
69
- { name: 'Biome (biome.json)', value: 'biome' },
70
- { name: 'Vitest (vitest.config.ts)', value: 'vitest' },
71
- { name: 'Lint-staged (.lintstagedrc)', value: 'lintstaged' },
72
- { name: 'EditorConfig (.editorconfig)', value: 'editorconfig' },
73
- { name: 'Package JSON Lint (.npmpackagejsonlintrc.json)', value: 'packagejsonlint' },
74
- { name: 'Husky (.husky/pre-commit)', value: 'husky' },
75
- { name: 'Dependencies', value: 'deps' },
76
- { name: 'Scripts', value: 'scripts' },
77
- ],
78
- },
79
- ]);
80
- const selected = answers.configs.includes('all')
81
- ? [
82
- 'typescript',
83
- 'biome',
84
- 'vitest',
85
- 'lintstaged',
86
- 'editorconfig',
87
- 'packagejsonlint',
88
- 'husky',
89
- 'deps',
90
- 'scripts',
91
- ]
92
- : answers.configs;
93
- const spinner = ora('Setting up project...').start();
94
- try {
95
- // Update package.json
96
- if (selected.includes('deps') || selected.includes('scripts')) {
97
- const pkgPath = 'package.json';
98
- if (!(await fileExists(pkgPath))) {
99
- spinner.fail(chalk.red('package.json not found. Run this in a project directory.'));
100
- process.exit(1);
101
- }
102
- const pkgContent = await readFile(pkgPath, 'utf-8');
103
- const pkg = JSON.parse(pkgContent);
104
- if (selected.includes('deps')) {
105
- spinner.text = 'Adding dependencies...';
106
- pkg.devDependencies = { ...pkg.devDependencies, ...DEV_DEPENDENCIES };
107
- }
108
- if (selected.includes('scripts')) {
109
- spinner.text = 'Adding scripts...';
110
- pkg.scripts = { ...pkg.scripts, ...SCRIPTS };
111
- if (!pkg.engines) {
112
- pkg.engines = { node: '>= 20.17' };
113
- }
114
- if (!pkg.publishConfig) {
115
- pkg.publishConfig = { access: 'public', provenance: true };
116
- }
117
- if (!pkg.release) {
118
- pkg.release = {
119
- plugins: [
120
- '@semantic-release/commit-analyzer',
121
- '@semantic-release/release-notes-generator',
122
- '@semantic-release/changelog',
123
- '@semantic-release/npm',
124
- '@semantic-release/github',
125
- '@semantic-release/git',
126
- ],
127
- };
128
- }
129
- }
130
- await writeFile(pkgPath, JSON.stringify(pkg, null, 2));
131
- }
132
- // TypeScript
133
- if (selected.includes('typescript') && !(await fileExists('tsconfig.json'))) {
134
- spinner.text = 'Creating tsconfig.json...';
135
- const tsconfig = {
136
- extends: '@tsconfig/node22/tsconfig.json',
137
- compilerOptions: {
138
- declaration: true,
139
- skipLibCheck: true,
140
- },
141
- };
142
- await writeFile('tsconfig.json', JSON.stringify(tsconfig, null, 2));
143
- }
144
- // Biome
145
- if (selected.includes('biome') && !(await fileExists('biome.json'))) {
146
- spinner.text = 'Creating biome.json...';
147
- const biome = {
148
- $schema: 'https://biomejs.dev/schemas/2.3.4/schema.json',
149
- vcs: { enabled: true, clientKind: 'git', useIgnoreFile: true },
150
- files: { ignoreUnknown: false },
151
- formatter: { enabled: true, useEditorconfig: true, lineWidth: 100 },
152
- linter: {
153
- enabled: true,
154
- rules: { recommended: true, suspicious: { noUnknownAtRules: 'off' } },
155
- domains: { test: 'recommended' },
156
- },
157
- javascript: { formatter: { quoteStyle: 'single' } },
158
- assist: {
159
- enabled: true,
160
- actions: {
161
- source: {
162
- organizeImports: {
163
- level: 'on',
164
- options: {
165
- groups: [
166
- ':URL:',
167
- ':BLANK_LINE:',
168
- [':BUN:', ':NODE:'],
169
- ':BLANK_LINE:',
170
- [':PACKAGE_WITH_PROTOCOL:', ':PACKAGE:'],
171
- ':BLANK_LINE:',
172
- ':ALIAS:',
173
- ':BLANK_LINE:',
174
- ':PATH:',
175
- ],
176
- },
177
- },
178
- },
179
- },
180
- },
181
- };
182
- await writeFile('biome.json', JSON.stringify(biome, null, 2));
183
- }
184
- // Vitest
185
- if (selected.includes('vitest') && !(await fileExists('vitest.config.ts'))) {
186
- spinner.text = 'Creating vitest.config.ts...';
187
- const vitestConfig = `import { defineConfig } from 'vitest/config';
188
-
189
- export default defineConfig({
190
- test: {
191
- globals: true,
192
- environment: 'node',
193
- },
194
- });
195
- `;
196
- await writeFile('vitest.config.ts', vitestConfig);
197
- }
198
- // Lint-staged
199
- if (selected.includes('lintstaged') && !(await fileExists('.lintstagedrc'))) {
200
- spinner.text = 'Creating .lintstagedrc...';
201
- const lintStaged = `"*.{ts,tsx}":
202
- - "bash -c 'npm test'"
203
-
204
- "package.json":
205
- - "bash -c 'npm test'"
206
- - "bash -c 'npm run build'"
207
- - "bash -c 'npm run lint:lockfile'"
208
- - "bash -c 'npm run lint:engines'"
209
- - "bash -c 'npm run lint:publish'"
210
- - "bash -c 'npm run clean'"
211
-
212
- "*.{ts,tsx,json,yaml,graphql,md,css,scss,html}":
213
- - "biome check --write --no-errors-on-unmatched --files-ignore-unknown=true"
214
- `;
215
- await writeFile('.lintstagedrc', lintStaged);
216
- }
217
- // EditorConfig
218
- if (selected.includes('editorconfig') && !(await fileExists('.editorconfig'))) {
219
- spinner.text = 'Creating .editorconfig...';
220
- const editorconfig = `# http://editorconfig.org/
221
- root = true
222
-
223
- [*]
224
- charset = utf-8
225
- end_of_line = lf
226
- insert_final_newline = true
227
- indent_style = space
228
- indent_size = 2
229
- trim_trailing_whitespace = true
230
-
231
- [*.md]
232
- trim_trailing_whitespace = false
233
-
234
- [Makefile]
235
- indent_style = tab
236
- `;
237
- await writeFile('.editorconfig', editorconfig);
238
- }
239
- // Package JSON Lint
240
- if (selected.includes('packagejsonlint') &&
241
- !(await fileExists('.npmpackagejsonlintrc.json'))) {
242
- spinner.text = 'Creating .npmpackagejsonlintrc.json...';
243
- // Get author from package.json if it exists
244
- let author = 'Your Name <your.email@example.com>';
245
- try {
246
- const pkgContent = await readFile('package.json', 'utf-8');
247
- const pkg = JSON.parse(pkgContent);
248
- if (pkg.author) {
249
- author = pkg.author;
250
- }
251
- }
252
- catch {
253
- // Ignore if package.json doesn't exist or can't be read
254
- }
255
- const npmPackageJsonLintrc = {
256
- rules: {
257
- 'require-author': 'error',
258
- 'require-description': 'error',
259
- 'require-engines': 'error',
260
- 'require-license': 'error',
261
- 'require-name': 'error',
262
- 'require-repository': 'error',
263
- 'require-version': 'error',
264
- 'require-bugs': 'error',
265
- 'require-homepage': 'error',
266
- 'require-keywords': 'error',
267
- 'bin-type': 'error',
268
- 'config-type': 'error',
269
- 'description-type': 'error',
270
- 'devDependencies-type': 'error',
271
- 'directories-type': 'error',
272
- 'engines-type': 'error',
273
- 'files-type': 'error',
274
- 'homepage-type': 'error',
275
- 'keywords-type': 'error',
276
- 'license-type': 'error',
277
- 'main-type': 'error',
278
- 'man-type': 'error',
279
- 'name-type': 'error',
280
- 'preferGlobal-type': 'error',
281
- 'private-type': 'error',
282
- 'repository-type': 'error',
283
- 'scripts-type': 'error',
284
- 'version-type': 'error',
285
- 'valid-values-author': ['error', [author]],
286
- 'valid-values-private': ['error', [false]],
287
- 'no-restricted-dependencies': ['error', ['gulping-npm-package-json-lint']],
288
- 'no-restricted-pre-release-dependencies': ['error', ['gulping-npm-package-json-lint']],
289
- 'no-restricted-devDependencies': ['error', ['gulping-npm-package-json-lint']],
290
- 'no-restricted-pre-release-devDependencies': [
291
- 'error',
292
- ['gulping-npm-package-json-lint'],
293
- ],
294
- 'name-format': 'error',
295
- 'version-format': 'error',
296
- },
297
- };
298
- await writeFile('.npmpackagejsonlintrc.json', JSON.stringify(npmPackageJsonLintrc, null, 2));
299
- }
300
- // Husky
301
- if (selected.includes('husky')) {
302
- spinner.text = 'Creating .husky/pre-commit...';
303
- await mkdir('.husky', { recursive: true });
304
- if (!(await fileExists('.husky/pre-commit'))) {
305
- const preCommit = `export NVM_DIR="$HOME/.nvm"
306
- [ -s "$NVM_DIR/nvm.sh" ] && \\. "$NVM_DIR/nvm.sh"
307
-
308
- lint-staged --concurrent false
309
- git update-index --again
310
- `;
311
- await writeFile('.husky/pre-commit', preCommit);
312
- await execAsync('chmod +x .husky/pre-commit');
313
- }
314
- }
315
- // Install dependencies
316
- if (selected.includes('deps')) {
317
- spinner.text = 'Installing dependencies...';
318
- await execAsync('npm install');
319
- }
320
- spinner.succeed(chalk.green('✓ Project setup complete!'));
321
- console.log('\nAdded configurations:');
322
- if (selected.includes('typescript'))
323
- console.log(chalk.cyan(' ✓ tsconfig.json'));
324
- if (selected.includes('biome'))
325
- console.log(chalk.cyan(' ✓ biome.json'));
326
- if (selected.includes('vitest'))
327
- console.log(chalk.cyan(' ✓ vitest.config.ts'));
328
- if (selected.includes('lintstaged'))
329
- console.log(chalk.cyan(' ✓ .lintstagedrc'));
330
- if (selected.includes('editorconfig'))
331
- console.log(chalk.cyan(' ✓ .editorconfig'));
332
- if (selected.includes('packagejsonlint'))
333
- console.log(chalk.cyan(' ✓ .npmpackagejsonlintrc.json'));
334
- if (selected.includes('husky'))
335
- console.log(chalk.cyan(' ✓ .husky/pre-commit'));
336
- if (selected.includes('deps'))
337
- console.log(chalk.cyan(' ✓ Dependencies'));
338
- if (selected.includes('scripts'))
339
- console.log(chalk.cyan(' ✓ Scripts'));
340
- }
341
- catch (error) {
342
- spinner.fail(chalk.red('Failed to setup project'));
343
- console.error(error);
344
- process.exit(1);
345
- }
346
- });
package/cli/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
package/cli/index.js DELETED
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env node
2
- import { Command } from '@commander-js/extra-typings';
3
- import { bootstrap } from './commands/bootstrap.js';
4
- import { caoCommand } from './commands/cao/index.js';
5
- import { setup } from './commands/setup.js';
6
- const program = new Command()
7
- .name('dev')
8
- .description('Shared configurations & AI agents for software projects')
9
- .version('0.1.0');
10
- program.addCommand(bootstrap);
11
- program.addCommand(setup);
12
- program.addCommand(caoCommand);
13
- program.parse();
@@ -1,8 +0,0 @@
1
- export interface Agent {
2
- name: string;
3
- path: string;
4
- category: string;
5
- subcategory?: string;
6
- description?: string;
7
- }
8
- export declare function getAllAgents(): Promise<Agent[]>;
@@ -1,55 +0,0 @@
1
- import { readdir, readFile } from 'node:fs/promises';
2
- import { join } from 'node:path';
3
- import { paths } from './paths.js';
4
- export async function getAllAgents() {
5
- const agents = [];
6
- const categories = await readdir(paths.agents, { withFileTypes: true });
7
- for (const category of categories) {
8
- if (!category.isDirectory())
9
- continue;
10
- const categoryPath = join(paths.agents, category.name);
11
- const items = await readdir(categoryPath, { withFileTypes: true });
12
- for (const item of items) {
13
- if (item.isDirectory()) {
14
- // Subcategory (es: web/frontend)
15
- const subcategoryPath = join(categoryPath, item.name);
16
- const files = await readdir(subcategoryPath);
17
- for (const file of files) {
18
- if (file.endsWith('.md')) {
19
- const agentPath = join(subcategoryPath, file);
20
- const description = await extractDescription(agentPath);
21
- agents.push({
22
- name: file.replace('.md', ''),
23
- path: agentPath,
24
- category: category.name,
25
- subcategory: item.name,
26
- description,
27
- });
28
- }
29
- }
30
- }
31
- else if (item.name.endsWith('.md')) {
32
- // Direct agent file (es: data/data_engineer.md)
33
- const agentPath = join(categoryPath, item.name);
34
- const description = await extractDescription(agentPath);
35
- agents.push({
36
- name: item.name.replace('.md', ''),
37
- path: agentPath,
38
- category: category.name,
39
- description,
40
- });
41
- }
42
- }
43
- }
44
- return agents;
45
- }
46
- async function extractDescription(agentPath) {
47
- try {
48
- const content = await readFile(agentPath, 'utf-8');
49
- const match = content.match(/^description:\s*["']?(.+?)["']?$/m);
50
- return match?.[1];
51
- }
52
- catch {
53
- return undefined;
54
- }
55
- }
@@ -1,11 +0,0 @@
1
- export declare function runCommand(command: string): Promise<{
2
- stdout: string;
3
- stderr: string;
4
- }>;
5
- export declare function runInteractiveCommand(command: string): Promise<void>;
6
- export declare function installCao(): Promise<void>;
7
- export declare function installAgent(agentPath: string): Promise<void>;
8
- export declare function launchAgent(agentName: string): Promise<void>;
9
- export declare function startServer(): Promise<void>;
10
- export declare function getInstalledAgents(): Promise<string[]>;
11
- export declare function uninstallAgent(agentName: string): Promise<void>;
package/cli/utils/cao.js DELETED
@@ -1,56 +0,0 @@
1
- import { exec, spawn } from 'node:child_process';
2
- import { readdir, unlink } from 'node:fs/promises';
3
- import { homedir } from 'node:os';
4
- import { join } from 'node:path';
5
- import { promisify } from 'node:util';
6
- const execAsync = promisify(exec);
7
- const CAO_AGENT_DIR = join(homedir(), '.aws', 'cli-agent-orchestrator', 'agent-context');
8
- export async function runCommand(command) {
9
- return execAsync(command);
10
- }
11
- export async function runInteractiveCommand(command) {
12
- return new Promise((resolve, reject) => {
13
- const child = spawn(command, {
14
- shell: true,
15
- stdio: 'inherit',
16
- });
17
- child.on('close', (code) => {
18
- if (code === 0) {
19
- resolve();
20
- }
21
- else {
22
- reject(new Error(`Command failed with exit code ${code}`));
23
- }
24
- });
25
- child.on('error', reject);
26
- });
27
- }
28
- export async function installCao() {
29
- // Install tmux config
30
- await runInteractiveCommand('curl -s https://raw.githubusercontent.com/awslabs/cli-agent-orchestrator/refs/heads/main/tmux-install.sh -o /tmp/tmux-install.sh && bash /tmp/tmux-install.sh || true');
31
- // Install uv
32
- await runInteractiveCommand('curl -LsSf https://astral.sh/uv/install.sh | sh');
33
- // Install CAO
34
- await runInteractiveCommand('uv tool install git+https://github.com/awslabs/cli-agent-orchestrator.git@main --upgrade');
35
- }
36
- export async function installAgent(agentPath) {
37
- await runInteractiveCommand(`cao install "${agentPath}"`);
38
- }
39
- export async function launchAgent(agentName) {
40
- await runInteractiveCommand(`cao launch --agents ${agentName}`);
41
- }
42
- export async function startServer() {
43
- await runInteractiveCommand('cao-server');
44
- }
45
- export async function getInstalledAgents() {
46
- try {
47
- const files = await readdir(CAO_AGENT_DIR);
48
- return files.filter((f) => f.endsWith('.md')).map((f) => f.replace('.md', ''));
49
- }
50
- catch {
51
- return [];
52
- }
53
- }
54
- export async function uninstallAgent(agentName) {
55
- await unlink(join(CAO_AGENT_DIR, `${agentName}.md`));
56
- }
@@ -1,5 +0,0 @@
1
- export declare const paths: {
2
- root: string;
3
- agents: string;
4
- templates: string;
5
- };
@@ -1,11 +0,0 @@
1
- import { dirname, join } from 'node:path';
2
- import { fileURLToPath } from 'node:url';
3
- const __filename = fileURLToPath(import.meta.url);
4
- const __dirname = dirname(__filename);
5
- export const paths = {
6
- // Root del pacchetto @zweer/dev
7
- root: join(__dirname, '../..'),
8
- // Cartelle del pacchetto
9
- agents: join(__dirname, '../../agents'),
10
- templates: join(__dirname, '../../templates'),
11
- };