@agents-at-scale/ark 0.1.35-rc.1 → 0.1.35-rc2

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 (130) hide show
  1. package/dist/arkServices.d.ts +4 -12
  2. package/dist/arkServices.js +19 -34
  3. package/dist/arkServices.spec.d.ts +1 -0
  4. package/dist/arkServices.spec.js +24 -0
  5. package/dist/commands/agents/index.d.ts +2 -1
  6. package/dist/commands/agents/index.js +2 -7
  7. package/dist/commands/agents/index.spec.d.ts +1 -0
  8. package/dist/commands/agents/index.spec.js +67 -0
  9. package/dist/commands/chat/index.d.ts +2 -1
  10. package/dist/commands/chat/index.js +5 -21
  11. package/dist/commands/cluster/get.spec.d.ts +1 -0
  12. package/dist/commands/cluster/get.spec.js +92 -0
  13. package/dist/commands/cluster/index.d.ts +2 -1
  14. package/dist/commands/cluster/index.js +1 -1
  15. package/dist/commands/cluster/index.spec.d.ts +1 -0
  16. package/dist/commands/cluster/index.spec.js +24 -0
  17. package/dist/commands/completion/index.d.ts +2 -1
  18. package/dist/commands/completion/index.js +24 -2
  19. package/dist/commands/completion/index.spec.d.ts +1 -0
  20. package/dist/commands/completion/index.spec.js +34 -0
  21. package/dist/commands/config/index.d.ts +2 -1
  22. package/dist/commands/config/index.js +2 -2
  23. package/dist/commands/config/index.spec.d.ts +1 -0
  24. package/dist/commands/config/index.spec.js +78 -0
  25. package/dist/commands/dashboard/index.d.ts +2 -1
  26. package/dist/commands/dashboard/index.js +1 -1
  27. package/dist/commands/dev/index.d.ts +2 -1
  28. package/dist/commands/dev/index.js +1 -1
  29. package/dist/commands/dev/tool-generate.spec.d.ts +1 -0
  30. package/dist/commands/dev/tool-generate.spec.js +163 -0
  31. package/dist/commands/dev/tool.spec.d.ts +1 -0
  32. package/dist/commands/dev/tool.spec.js +48 -0
  33. package/dist/commands/docs/index.d.ts +4 -0
  34. package/dist/commands/docs/index.js +18 -0
  35. package/dist/commands/generate/generators/project.js +22 -41
  36. package/dist/commands/generate/index.d.ts +2 -1
  37. package/dist/commands/generate/index.js +1 -1
  38. package/dist/commands/install/index.d.ts +4 -2
  39. package/dist/commands/install/index.js +225 -90
  40. package/dist/commands/install/index.spec.d.ts +1 -0
  41. package/dist/commands/install/index.spec.js +143 -0
  42. package/dist/commands/models/create.spec.d.ts +1 -0
  43. package/dist/commands/models/create.spec.js +125 -0
  44. package/dist/commands/models/index.d.ts +2 -1
  45. package/dist/commands/models/index.js +2 -7
  46. package/dist/commands/models/index.spec.d.ts +1 -0
  47. package/dist/commands/models/index.spec.js +76 -0
  48. package/dist/commands/query/index.d.ts +3 -0
  49. package/dist/commands/query/index.js +131 -0
  50. package/dist/commands/routes/index.d.ts +2 -1
  51. package/dist/commands/routes/index.js +1 -9
  52. package/dist/commands/status/index.d.ts +3 -2
  53. package/dist/commands/status/index.js +240 -11
  54. package/dist/commands/targets/index.d.ts +2 -1
  55. package/dist/commands/targets/index.js +1 -1
  56. package/dist/commands/targets/index.spec.d.ts +1 -0
  57. package/dist/commands/targets/index.spec.js +105 -0
  58. package/dist/commands/teams/index.d.ts +2 -1
  59. package/dist/commands/teams/index.js +2 -7
  60. package/dist/commands/teams/index.spec.d.ts +1 -0
  61. package/dist/commands/teams/index.spec.js +70 -0
  62. package/dist/commands/tools/index.d.ts +2 -1
  63. package/dist/commands/tools/index.js +2 -7
  64. package/dist/commands/tools/index.spec.d.ts +1 -0
  65. package/dist/commands/tools/index.spec.js +70 -0
  66. package/dist/commands/uninstall/index.d.ts +2 -1
  67. package/dist/commands/uninstall/index.js +66 -44
  68. package/dist/commands/uninstall/index.spec.d.ts +1 -0
  69. package/dist/commands/uninstall/index.spec.js +125 -0
  70. package/dist/components/ChatUI.js +4 -4
  71. package/dist/components/statusChecker.d.ts +5 -12
  72. package/dist/components/statusChecker.js +193 -90
  73. package/dist/config.d.ts +3 -22
  74. package/dist/config.js +7 -151
  75. package/dist/index.js +26 -19
  76. package/dist/lib/arkServiceProxy.js +4 -2
  77. package/dist/lib/arkStatus.d.ts +5 -0
  78. package/dist/lib/arkStatus.js +61 -2
  79. package/dist/lib/arkStatus.spec.d.ts +1 -0
  80. package/dist/lib/arkStatus.spec.js +49 -0
  81. package/dist/lib/chatClient.js +1 -3
  82. package/dist/lib/cluster.js +11 -14
  83. package/dist/lib/cluster.spec.d.ts +1 -0
  84. package/dist/lib/cluster.spec.js +338 -0
  85. package/dist/lib/commandUtils.js +7 -7
  86. package/dist/lib/commands.d.ts +16 -0
  87. package/dist/lib/commands.js +29 -0
  88. package/dist/lib/commands.spec.d.ts +1 -0
  89. package/dist/lib/commands.spec.js +146 -0
  90. package/dist/lib/config.d.ts +4 -0
  91. package/dist/lib/config.js +6 -4
  92. package/dist/lib/config.spec.d.ts +1 -0
  93. package/dist/lib/config.spec.js +99 -0
  94. package/dist/lib/consts.d.ts +0 -1
  95. package/dist/lib/consts.js +0 -2
  96. package/dist/lib/consts.spec.d.ts +1 -0
  97. package/dist/lib/consts.spec.js +15 -0
  98. package/dist/lib/errors.js +1 -1
  99. package/dist/lib/errors.spec.d.ts +1 -0
  100. package/dist/lib/errors.spec.js +221 -0
  101. package/dist/lib/exec.d.ts +0 -4
  102. package/dist/lib/exec.js +0 -11
  103. package/dist/lib/nextSteps.d.ts +4 -0
  104. package/dist/lib/nextSteps.js +20 -0
  105. package/dist/lib/nextSteps.spec.d.ts +1 -0
  106. package/dist/lib/nextSteps.spec.js +59 -0
  107. package/dist/lib/output.spec.d.ts +1 -0
  108. package/dist/lib/output.spec.js +123 -0
  109. package/dist/lib/portUtils.d.ts +8 -0
  110. package/dist/lib/portUtils.js +39 -0
  111. package/dist/lib/startup.d.ts +9 -0
  112. package/dist/lib/startup.js +93 -0
  113. package/dist/lib/startup.spec.d.ts +1 -0
  114. package/dist/lib/startup.spec.js +168 -0
  115. package/dist/lib/types.d.ts +9 -0
  116. package/dist/ui/AgentSelector.d.ts +8 -0
  117. package/dist/ui/AgentSelector.js +53 -0
  118. package/dist/ui/MainMenu.d.ts +5 -1
  119. package/dist/ui/MainMenu.js +117 -54
  120. package/dist/ui/ModelSelector.d.ts +8 -0
  121. package/dist/ui/ModelSelector.js +53 -0
  122. package/dist/ui/TeamSelector.d.ts +8 -0
  123. package/dist/ui/TeamSelector.js +55 -0
  124. package/dist/ui/ToolSelector.d.ts +8 -0
  125. package/dist/ui/ToolSelector.js +53 -0
  126. package/dist/ui/statusFormatter.d.ts +22 -10
  127. package/dist/ui/statusFormatter.js +37 -109
  128. package/dist/ui/statusFormatter.spec.d.ts +1 -0
  129. package/dist/ui/statusFormatter.spec.js +58 -0
  130. package/package.json +3 -3
@@ -0,0 +1,78 @@
1
+ import { jest } from '@jest/globals';
2
+ import { Command } from 'commander';
3
+ const mockLoadConfig = jest.fn();
4
+ const mockGetConfigPaths = jest.fn();
5
+ const mockFormatConfig = jest.fn();
6
+ jest.unstable_mockModule('../../lib/config.js', () => ({
7
+ loadConfig: mockLoadConfig,
8
+ getConfigPaths: mockGetConfigPaths,
9
+ formatConfig: mockFormatConfig,
10
+ }));
11
+ const mockExistsSync = jest.fn();
12
+ jest.unstable_mockModule('fs', () => ({
13
+ default: {
14
+ existsSync: mockExistsSync,
15
+ },
16
+ existsSync: mockExistsSync,
17
+ }));
18
+ const mockConsoleLog = jest.spyOn(console, 'log').mockImplementation(() => { });
19
+ const { createConfigCommand } = await import('./index.js');
20
+ describe('config command', () => {
21
+ beforeEach(() => {
22
+ jest.clearAllMocks();
23
+ // Reset environment variables
24
+ delete process.env.ARK_CHAT_STREAMING;
25
+ delete process.env.ARK_CHAT_OUTPUT_FORMAT;
26
+ });
27
+ it('creates command with correct structure', () => {
28
+ const command = createConfigCommand({});
29
+ expect(command).toBeInstanceOf(Command);
30
+ expect(command.name()).toBe('config');
31
+ });
32
+ it('displays config paths and environment variables', async () => {
33
+ const mockConfig = { defaultModel: 'test-model' };
34
+ const mockPaths = {
35
+ user: '/home/user/.arkrc.yaml',
36
+ project: '/project/.arkrc.yaml',
37
+ };
38
+ mockLoadConfig.mockReturnValue(mockConfig);
39
+ mockGetConfigPaths.mockReturnValue(mockPaths);
40
+ mockFormatConfig.mockReturnValue('formatted config');
41
+ mockExistsSync.mockReturnValue(true);
42
+ const command = createConfigCommand({});
43
+ await command.parseAsync(['node', 'test']);
44
+ expect(mockLoadConfig).toHaveBeenCalled();
45
+ expect(mockGetConfigPaths).toHaveBeenCalled();
46
+ expect(mockFormatConfig).toHaveBeenCalledWith(mockConfig);
47
+ expect(mockExistsSync).toHaveBeenCalledWith(mockPaths.user);
48
+ expect(mockExistsSync).toHaveBeenCalledWith(mockPaths.project);
49
+ });
50
+ it('shows when config files do not exist', async () => {
51
+ const mockPaths = {
52
+ user: '/home/user/.arkrc.yaml',
53
+ project: '/project/.arkrc.yaml',
54
+ };
55
+ mockLoadConfig.mockReturnValue({});
56
+ mockGetConfigPaths.mockReturnValue(mockPaths);
57
+ mockFormatConfig.mockReturnValue('');
58
+ mockExistsSync.mockReturnValue(false);
59
+ const command = createConfigCommand({});
60
+ await command.parseAsync(['node', 'test']);
61
+ expect(mockExistsSync).toHaveBeenCalledWith(mockPaths.user);
62
+ expect(mockExistsSync).toHaveBeenCalledWith(mockPaths.project);
63
+ // Should show that files don't exist
64
+ expect(mockConsoleLog).toHaveBeenCalled();
65
+ });
66
+ it('displays environment variables when set', async () => {
67
+ process.env.ARK_CHAT_STREAMING = 'true';
68
+ process.env.ARK_CHAT_OUTPUT_FORMAT = 'json';
69
+ mockLoadConfig.mockReturnValue({});
70
+ mockGetConfigPaths.mockReturnValue({ user: '', project: '' });
71
+ mockFormatConfig.mockReturnValue('');
72
+ mockExistsSync.mockReturnValue(false);
73
+ const command = createConfigCommand({});
74
+ await command.parseAsync(['node', 'test']);
75
+ // Should display the environment variables
76
+ expect(mockConsoleLog).toHaveBeenCalled();
77
+ });
78
+ });
@@ -1,3 +1,4 @@
1
1
  import { Command } from 'commander';
2
+ import type { ArkConfig } from '../../lib/config.js';
2
3
  export declare function openDashboard(): Promise<void>;
3
- export declare function createDashboardCommand(): Command;
4
+ export declare function createDashboardCommand(_: ArkConfig): Command;
@@ -30,7 +30,7 @@ export async function openDashboard() {
30
30
  process.exit(1);
31
31
  }
32
32
  }
33
- export function createDashboardCommand() {
33
+ export function createDashboardCommand(_) {
34
34
  const dashboardCommand = new Command('dashboard');
35
35
  dashboardCommand
36
36
  .description('Open the ARK dashboard in your browser')
@@ -1,2 +1,3 @@
1
1
  import { Command } from 'commander';
2
- export declare function createDevCommand(): Command;
2
+ import type { ArkConfig } from '../../lib/config.js';
3
+ export declare function createDevCommand(_: ArkConfig): Command;
@@ -1,6 +1,6 @@
1
1
  import { Command } from 'commander';
2
2
  import { createToolCommand } from './tool/index.js';
3
- export function createDevCommand() {
3
+ export function createDevCommand(_) {
4
4
  const devCommand = new Command('dev');
5
5
  devCommand.description('Development tools for ARK');
6
6
  // Add subcommands
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,163 @@
1
+ import { describe, it, expect, beforeEach, afterEach } from '@jest/globals';
2
+ import { execSync } from 'child_process';
3
+ import path from 'path';
4
+ import { fileURLToPath } from 'url';
5
+ import fs from 'fs';
6
+ import os from 'os';
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = path.dirname(__filename);
9
+ describe('ark dev tool generate', () => {
10
+ let tempDir;
11
+ const cliPath = path.join(__dirname, '../../../dist/index.js');
12
+ beforeEach(() => {
13
+ // Create a temp directory for testing
14
+ tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'ark-test-'));
15
+ });
16
+ afterEach(() => {
17
+ // Clean up temp directory
18
+ if (tempDir && fs.existsSync(tempDir)) {
19
+ fs.rmSync(tempDir, { recursive: true, force: true });
20
+ }
21
+ });
22
+ describe('Dockerfile generation', () => {
23
+ it('should generate correct Dockerfile for pyproject type', () => {
24
+ // Create a test .ark.yaml
25
+ const arkYaml = `version: "1.0"
26
+ project:
27
+ path: ${tempDir}
28
+ platform: python3
29
+ type: pyproject
30
+ name: test-tool
31
+ version: 0.2.0
32
+ framework: fastmcp
33
+ frameworkVersion: 0.5.0
34
+ `;
35
+ fs.writeFileSync(path.join(tempDir, '.ark.yaml'), arkYaml);
36
+ // Run the generate command
37
+ execSync(`node ${cliPath} dev tool generate ${tempDir}`, {
38
+ encoding: 'utf8',
39
+ });
40
+ // Check Dockerfile was generated
41
+ const dockerfilePath = path.join(tempDir, 'Dockerfile');
42
+ expect(fs.existsSync(dockerfilePath)).toBe(true);
43
+ // Check Dockerfile content
44
+ const dockerfileContent = fs.readFileSync(dockerfilePath, 'utf-8');
45
+ // Should have uv commands for pyproject
46
+ expect(dockerfileContent).toContain('RUN pip install uv');
47
+ expect(dockerfileContent).toContain('COPY pyproject.toml ./');
48
+ expect(dockerfileContent).toContain('COPY uv.lock* ./');
49
+ expect(dockerfileContent).toContain('RUN uv sync --frozen');
50
+ expect(dockerfileContent).toContain('CMD ["uv", "run", "python", "-m", "test_tool"]');
51
+ // Should NOT have requirements.txt commands
52
+ expect(dockerfileContent).not.toContain('requirements.txt');
53
+ expect(dockerfileContent).not.toContain('pip install --no-cache-dir');
54
+ });
55
+ it('should generate correct Dockerfile for requirements type', () => {
56
+ // Create a test .ark.yaml with requirements type
57
+ const arkYaml = `version: "1.0"
58
+ project:
59
+ path: ${tempDir}
60
+ platform: python3
61
+ type: requirements
62
+ name: test-req-tool
63
+ version: 0.1.0
64
+ `;
65
+ fs.writeFileSync(path.join(tempDir, '.ark.yaml'), arkYaml);
66
+ // Run the generate command
67
+ execSync(`node ${cliPath} dev tool generate ${tempDir}`, {
68
+ encoding: 'utf8',
69
+ });
70
+ // Check Dockerfile was generated
71
+ const dockerfilePath = path.join(tempDir, 'Dockerfile');
72
+ expect(fs.existsSync(dockerfilePath)).toBe(true);
73
+ // Check Dockerfile content
74
+ const dockerfileContent = fs.readFileSync(dockerfilePath, 'utf-8');
75
+ // Should have pip commands for requirements.txt
76
+ expect(dockerfileContent).toContain('COPY requirements.txt ./');
77
+ expect(dockerfileContent).toContain('RUN pip install --no-cache-dir -r requirements.txt');
78
+ expect(dockerfileContent).toContain('CMD ["python", "-m", "test_req_tool"]');
79
+ // Should NOT have uv commands
80
+ expect(dockerfileContent).not.toContain('RUN pip install uv');
81
+ expect(dockerfileContent).not.toContain('pyproject.toml');
82
+ expect(dockerfileContent).not.toContain('uv.lock');
83
+ expect(dockerfileContent).not.toContain('uv sync');
84
+ });
85
+ });
86
+ describe('.dockerignore generation', () => {
87
+ it('should generate comprehensive .dockerignore file', () => {
88
+ // Create a test .ark.yaml
89
+ const arkYaml = `version: "1.0"
90
+ project:
91
+ platform: python3
92
+ type: pyproject
93
+ name: test-tool
94
+ `;
95
+ fs.writeFileSync(path.join(tempDir, '.ark.yaml'), arkYaml);
96
+ // Run the generate command
97
+ execSync(`node ${cliPath} dev tool generate ${tempDir}`, {
98
+ encoding: 'utf8',
99
+ });
100
+ // Check .dockerignore was generated
101
+ const dockerignorePath = path.join(tempDir, '.dockerignore');
102
+ expect(fs.existsSync(dockerignorePath)).toBe(true);
103
+ // Check .dockerignore content
104
+ const dockerignoreContent = fs.readFileSync(dockerignorePath, 'utf-8');
105
+ // Should include Python patterns
106
+ expect(dockerignoreContent).toContain('__pycache__/');
107
+ expect(dockerignoreContent).toContain('*.py[cod]');
108
+ expect(dockerignoreContent).toContain('*.egg-info/');
109
+ // Should include UV patterns
110
+ expect(dockerignoreContent).toContain('.venv/');
111
+ // Should include testing patterns
112
+ expect(dockerignoreContent).toContain('.pytest_cache/');
113
+ expect(dockerignoreContent).toContain('.coverage');
114
+ // Should include IDE patterns
115
+ expect(dockerignoreContent).toContain('.vscode/');
116
+ expect(dockerignoreContent).toContain('.idea/');
117
+ // Should include ARK specific patterns
118
+ expect(dockerignoreContent).toContain('.ark.yaml');
119
+ expect(dockerignoreContent).toContain('devspace.yaml');
120
+ });
121
+ });
122
+ describe('file skip behavior', () => {
123
+ it('should skip existing files without overwriting', () => {
124
+ // Create a test .ark.yaml
125
+ const arkYaml = `version: "1.0"
126
+ project:
127
+ platform: python3
128
+ type: pyproject
129
+ name: test-tool
130
+ `;
131
+ fs.writeFileSync(path.join(tempDir, '.ark.yaml'), arkYaml);
132
+ // Create an existing Dockerfile with custom content
133
+ const customDockerfile = '# My custom Dockerfile\nFROM alpine\n';
134
+ fs.writeFileSync(path.join(tempDir, 'Dockerfile'), customDockerfile);
135
+ // Run the generate command
136
+ const output = execSync(`node ${cliPath} dev tool generate ${tempDir}`, {
137
+ encoding: 'utf8',
138
+ });
139
+ // Check that existing file was not overwritten
140
+ const dockerfileContent = fs.readFileSync(path.join(tempDir, 'Dockerfile'), 'utf-8');
141
+ expect(dockerfileContent).toBe(customDockerfile);
142
+ // Check that output mentions skipping the existing file
143
+ expect(output).toContain('Skipping Dockerfile (already exists)');
144
+ });
145
+ });
146
+ describe('error handling', () => {
147
+ it('should fail when .ark.yaml is missing', () => {
148
+ // Try to run generate without .ark.yaml
149
+ let error = null;
150
+ try {
151
+ execSync(`node ${cliPath} dev tool generate ${tempDir}`, {
152
+ encoding: 'utf8',
153
+ stdio: 'pipe',
154
+ });
155
+ }
156
+ catch (e) {
157
+ error = e;
158
+ }
159
+ expect(error).not.toBeNull();
160
+ expect(error.message).toContain('.ark.yaml not found');
161
+ });
162
+ });
163
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,48 @@
1
+ import { describe, it, expect } from '@jest/globals';
2
+ import { execSync } from 'child_process';
3
+ import path from 'path';
4
+ import { fileURLToPath } from 'url';
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = path.dirname(__filename);
7
+ describe('sample-projects', () => {
8
+ describe('reverse-tool', () => {
9
+ it('should output correct MCP tool format in JSON', () => {
10
+ const projectPath = path.join(__dirname, '../../../samples/reverse_tool');
11
+ const cliPath = path.join(__dirname, '../../../dist/index.js');
12
+ // Run the command and capture output
13
+ const output = execSync(`node ${cliPath} dev tool check ${projectPath} --output json`, { encoding: 'utf8' });
14
+ // Parse the JSON output
15
+ const result = JSON.parse(output);
16
+ // Assert the structure
17
+ expect(result).toHaveProperty('path');
18
+ expect(result).toHaveProperty('projectRoot');
19
+ expect(result.projectRoot).toContain('reverse_tool');
20
+ expect(result).toHaveProperty('platform', 'python3');
21
+ expect(result).toHaveProperty('projectType', 'pyproject');
22
+ expect(result).toHaveProperty('projectName', 'reverse-tool');
23
+ expect(result).toHaveProperty('projectVersion', '0.1.0');
24
+ expect(result).toHaveProperty('hasFastmcp', true);
25
+ expect(result).toHaveProperty('fastmcpVersion', '0.5.0');
26
+ expect(result).toHaveProperty('tools');
27
+ // Assert tools array contains MCP-formatted tool
28
+ expect(result.tools).toHaveLength(1);
29
+ const tool = result.tools[0];
30
+ // Check MCP tool structure
31
+ expect(tool).toHaveProperty('name', 'reverse_message');
32
+ expect(tool).toHaveProperty('title', 'Reverse Message');
33
+ expect(tool).toHaveProperty('description', 'Reverses the text of a message');
34
+ expect(tool).toHaveProperty('inputSchema');
35
+ // Check inputSchema structure
36
+ expect(tool.inputSchema).toEqual({
37
+ type: 'object',
38
+ properties: {
39
+ message: {
40
+ type: 'string',
41
+ description: 'Parameter message',
42
+ },
43
+ },
44
+ required: ['message'],
45
+ });
46
+ });
47
+ });
48
+ });
@@ -0,0 +1,4 @@
1
+ import { Command } from 'commander';
2
+ import type { ArkConfig } from '../../lib/config.js';
3
+ export declare function openDocs(): Promise<void>;
4
+ export declare function createDocsCommand(_: ArkConfig): Command;
@@ -0,0 +1,18 @@
1
+ import chalk from 'chalk';
2
+ import { Command } from 'commander';
3
+ import open from 'open';
4
+ const DOCS_URL = 'https://mckinsey.github.io/agents-at-scale-ark/';
5
+ export async function openDocs() {
6
+ console.log(`Opening ARK documentation: ${chalk.blue(DOCS_URL)}`);
7
+ // Brief pause before opening browser
8
+ await new Promise((resolve) => setTimeout(resolve, 500));
9
+ // Open browser
10
+ await open(DOCS_URL);
11
+ }
12
+ export function createDocsCommand(_) {
13
+ const docsCommand = new Command('docs');
14
+ docsCommand
15
+ .description('Open the ARK documentation in your browser')
16
+ .action(openDocs);
17
+ return docsCommand;
18
+ }
@@ -8,7 +8,7 @@ import { TemplateDiscovery } from '../templateDiscovery.js';
8
8
  import { toKebabCase, validateNameStrict, isValidKubernetesName, } from '../utils/nameUtils.js';
9
9
  import { getInquirerProjectTypeChoices, GENERATOR_DEFAULTS, CLI_CONFIG, } from '../config.js';
10
10
  import { SecurityUtils } from '../../../lib/security.js';
11
- import { EnhancedPrompts, ProgressIndicator } from '../../../lib/progress.js';
11
+ import ora from 'ora';
12
12
  export function createProjectGenerator() {
13
13
  return {
14
14
  name: 'project',
@@ -38,61 +38,40 @@ class ProjectGenerator {
38
38
  }
39
39
  }
40
40
  async generate(name, destination, options) {
41
- const progress = new ProgressIndicator('ARK Agent Project Generator');
42
- // Add steps to progress indicator
43
- progress.addStep('prerequisites', 'Checking prerequisites');
44
- progress.addStep('configuration', 'Gathering project configuration');
45
- if (!options.skipModels) {
46
- progress.addStep('models', 'Configuring model providers');
47
- }
48
- if (!options.skipGit) {
49
- progress.addStep('git', 'Setting up git repository');
50
- }
51
- progress.addStep('generation', 'Generating project files');
52
- progress.addStep('completion', 'Finalizing project setup');
41
+ console.log(chalk.blue(`\nšŸš€ ARK Agent Project Generator\n`));
42
+ const spinner = ora('Checking prerequisites').start();
53
43
  try {
54
44
  // Check prerequisites
55
- progress.startStep('prerequisites');
56
45
  await this.checkPrerequisites();
57
- progress.completeStep('prerequisites', 'Prerequisites validated');
46
+ spinner.succeed('Prerequisites validated');
58
47
  // Get project configuration
59
- progress.startStep('configuration');
48
+ spinner.start('Gathering project configuration');
60
49
  const config = await this.getProjectConfig(name, destination, options);
61
- progress.completeStep('configuration', `Project "${config.name}" configured`);
50
+ spinner.succeed(`Project "${config.name}" configured`);
62
51
  // Discover and configure models (only if not skipped)
63
52
  if (config.configureModels) {
64
- progress.startStep('models');
53
+ spinner.start('Configuring model providers');
65
54
  await this.configureModels(config);
66
- progress.completeStep('models', `Model provider: ${config.selectedModels || 'none'}`);
67
- }
68
- else {
69
- progress.skipStep('models', 'Model configuration skipped');
55
+ spinner.succeed(`Model provider: ${config.selectedModels || 'none'}`);
70
56
  }
71
57
  // Configure git if requested (only if not skipped)
72
58
  if (config.initGit) {
73
- progress.startStep('git');
59
+ spinner.start('Setting up git repository');
74
60
  await this.configureGit(config);
75
- progress.completeStep('git', 'Git repository configured');
76
- }
77
- else {
78
- progress.skipStep('git', 'Git setup skipped');
61
+ spinner.succeed('Git repository configured');
79
62
  }
80
63
  // Generate the project
81
- progress.startStep('generation');
64
+ spinner.start('Generating project files');
82
65
  await this.generateProject(config);
83
- progress.completeStep('generation', 'Project files created');
66
+ spinner.succeed('Project files created');
84
67
  // Finalize
85
- progress.startStep('completion');
68
+ spinner.start('Finalizing project setup');
86
69
  this.showNextSteps(config);
87
- progress.completeStep('completion', 'Project ready');
88
- progress.complete('Project generation');
70
+ spinner.succeed('Project ready');
71
+ console.log(chalk.green(`\nāœ… Project generation completed\n`));
89
72
  }
90
73
  catch (error) {
91
- // Find the current step and mark it as failed
92
- const currentStep = progress['steps'].find((s) => s.status === 'running');
93
- if (currentStep) {
94
- progress.failStep(currentStep.name, `Failed: ${error instanceof Error ? error.message : String(error)}`);
95
- }
74
+ spinner.fail(`Failed: ${error instanceof Error ? error.message : String(error)}`);
96
75
  throw error;
97
76
  }
98
77
  }
@@ -105,7 +84,7 @@ class ProjectGenerator {
105
84
  }
106
85
  catch {
107
86
  requirements.push({ tool: 'git', available: false, required: false });
108
- EnhancedPrompts.showWarning('Git not found - git features will be disabled');
87
+ console.log(chalk.yellow('āš ļø Warning: Git not found - git features will be disabled'));
109
88
  }
110
89
  // Check for deployment tools (optional for project generation)
111
90
  const deploymentTools = ['kubectl', 'helm'];
@@ -121,12 +100,14 @@ class ProjectGenerator {
121
100
  }
122
101
  }
123
102
  if (missingDeploymentTools.length > 0) {
124
- EnhancedPrompts.showInfo(`Optional tools not found: ${missingDeploymentTools.join(', ')}`);
125
- EnhancedPrompts.showTip('Install kubectl and helm later to deploy your project to a cluster');
103
+ console.log(chalk.blue(`ā„¹ļø Optional tools not found: ${missingDeploymentTools.join(', ')}`));
104
+ console.log(chalk.cyan('šŸ’” Tip: Install kubectl and helm later to deploy your project to a cluster'));
126
105
  }
127
106
  }
128
107
  async getProjectConfig(name, destination, options) {
129
- EnhancedPrompts.showSeparator('Project Configuration');
108
+ console.log(chalk.gray(`\n${'─'.repeat(50)}`));
109
+ console.log(chalk.cyan('Project Configuration'));
110
+ console.log(chalk.gray(`${'─'.repeat(50)}\n`));
130
111
  // Use command line options if provided, otherwise prompt
131
112
  let projectType = options.projectType;
132
113
  let parentDir = destination;
@@ -1,4 +1,5 @@
1
1
  import { Command } from 'commander';
2
+ import type { ArkConfig } from '../../lib/config.js';
2
3
  export interface GeneratorOptions {
3
4
  name?: string;
4
5
  destination?: string;
@@ -21,4 +22,4 @@ export interface Generator {
21
22
  templatePath: string;
22
23
  generate(name: string, destination: string, options: GeneratorOptions): Promise<void>;
23
24
  }
24
- export declare function createGenerateCommand(): Command;
25
+ export declare function createGenerateCommand(_: ArkConfig): Command;
@@ -22,7 +22,7 @@ function getDefaultDestination() {
22
22
  return process.cwd();
23
23
  }
24
24
  }
25
- export function createGenerateCommand() {
25
+ export function createGenerateCommand(_) {
26
26
  const generate = new Command('generate');
27
27
  generate
28
28
  .alias('g')
@@ -1,6 +1,8 @@
1
1
  import { Command } from 'commander';
2
- export declare function installArk(options?: {
2
+ import type { ArkConfig } from '../../lib/config.js';
3
+ export declare function installArk(config: ArkConfig, serviceName?: string, options?: {
3
4
  yes?: boolean;
4
5
  waitForReady?: string;
6
+ verbose?: boolean;
5
7
  }): Promise<void>;
6
- export declare function createInstallCommand(): Command;
8
+ export declare function createInstallCommand(config: ArkConfig): Command;