@agents-at-scale/ark 0.1.35-rc2 → 0.1.35

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 (215) hide show
  1. package/dist/commands/cluster/index.d.ts +1 -2
  2. package/dist/commands/cluster/index.js +5 -3
  3. package/dist/commands/completion.js +2 -159
  4. package/dist/commands/config.d.ts +3 -0
  5. package/dist/commands/config.js +321 -38
  6. package/dist/commands/generate/config.js +24 -5
  7. package/dist/commands/generate/generators/agent.js +2 -2
  8. package/dist/commands/generate/generators/mcpserver.d.ts +1 -2
  9. package/dist/commands/generate/generators/mcpserver.js +5 -26
  10. package/dist/commands/generate/generators/project.js +41 -22
  11. package/dist/commands/generate/generators/team.js +2 -2
  12. package/dist/commands/generate/index.d.ts +1 -2
  13. package/dist/commands/generate/index.js +1 -1
  14. package/dist/components/statusChecker.d.ts +23 -13
  15. package/dist/components/statusChecker.js +129 -295
  16. package/dist/config.d.ts +22 -3
  17. package/dist/config.js +161 -10
  18. package/dist/index.d.ts +1 -1
  19. package/dist/index.js +42 -44
  20. package/dist/lib/cluster.d.ts +1 -2
  21. package/dist/lib/cluster.js +16 -37
  22. package/dist/lib/config.d.ts +80 -28
  23. package/dist/lib/config.js +205 -70
  24. package/dist/lib/consts.d.ts +1 -0
  25. package/dist/lib/consts.js +2 -0
  26. package/dist/lib/errors.js +1 -1
  27. package/dist/lib/exec.d.ts +4 -0
  28. package/dist/lib/exec.js +11 -0
  29. package/dist/lib/types.d.ts +3 -17
  30. package/dist/ui/MainMenu.d.ts +1 -5
  31. package/dist/ui/MainMenu.js +91 -222
  32. package/dist/ui/statusFormatter.d.ts +7 -22
  33. package/dist/ui/statusFormatter.js +39 -39
  34. package/package.json +5 -17
  35. package/dist/arkServices.d.ts +0 -42
  36. package/dist/arkServices.js +0 -138
  37. package/dist/arkServices.spec.d.ts +0 -1
  38. package/dist/arkServices.spec.js +0 -24
  39. package/dist/charts/charts.d.ts +0 -5
  40. package/dist/charts/charts.js +0 -6
  41. package/dist/charts/dependencies.d.ts +0 -6
  42. package/dist/charts/dependencies.js +0 -50
  43. package/dist/charts/types.d.ts +0 -40
  44. package/dist/charts/types.js +0 -1
  45. package/dist/commands/agents/index.d.ts +0 -3
  46. package/dist/commands/agents/index.js +0 -51
  47. package/dist/commands/agents/index.spec.d.ts +0 -1
  48. package/dist/commands/agents/index.spec.js +0 -67
  49. package/dist/commands/agents/selector.d.ts +0 -8
  50. package/dist/commands/agents/selector.js +0 -53
  51. package/dist/commands/agents.d.ts +0 -2
  52. package/dist/commands/agents.js +0 -53
  53. package/dist/commands/chat/index.d.ts +0 -3
  54. package/dist/commands/chat/index.js +0 -29
  55. package/dist/commands/chat.d.ts +0 -2
  56. package/dist/commands/chat.js +0 -45
  57. package/dist/commands/cluster/get.d.ts +0 -2
  58. package/dist/commands/cluster/get.js +0 -39
  59. package/dist/commands/cluster/get.spec.d.ts +0 -1
  60. package/dist/commands/cluster/get.spec.js +0 -92
  61. package/dist/commands/cluster/index.spec.d.ts +0 -1
  62. package/dist/commands/cluster/index.spec.js +0 -24
  63. package/dist/commands/completion/index.d.ts +0 -3
  64. package/dist/commands/completion/index.js +0 -290
  65. package/dist/commands/completion/index.spec.d.ts +0 -1
  66. package/dist/commands/completion/index.spec.js +0 -34
  67. package/dist/commands/config/index.d.ts +0 -3
  68. package/dist/commands/config/index.js +0 -42
  69. package/dist/commands/config/index.spec.d.ts +0 -1
  70. package/dist/commands/config/index.spec.js +0 -78
  71. package/dist/commands/dashboard/index.d.ts +0 -4
  72. package/dist/commands/dashboard/index.js +0 -39
  73. package/dist/commands/dashboard.d.ts +0 -3
  74. package/dist/commands/dashboard.js +0 -39
  75. package/dist/commands/dev/index.d.ts +0 -3
  76. package/dist/commands/dev/index.js +0 -9
  77. package/dist/commands/dev/tool/check.d.ts +0 -2
  78. package/dist/commands/dev/tool/check.js +0 -142
  79. package/dist/commands/dev/tool/clean.d.ts +0 -2
  80. package/dist/commands/dev/tool/clean.js +0 -153
  81. package/dist/commands/dev/tool/generate.d.ts +0 -2
  82. package/dist/commands/dev/tool/generate.js +0 -28
  83. package/dist/commands/dev/tool/index.d.ts +0 -2
  84. package/dist/commands/dev/tool/index.js +0 -14
  85. package/dist/commands/dev/tool/init.d.ts +0 -2
  86. package/dist/commands/dev/tool/init.js +0 -320
  87. package/dist/commands/dev/tool/shared.d.ts +0 -5
  88. package/dist/commands/dev/tool/shared.js +0 -256
  89. package/dist/commands/dev/tool/status.d.ts +0 -2
  90. package/dist/commands/dev/tool/status.js +0 -136
  91. package/dist/commands/dev/tool-generate.spec.d.ts +0 -1
  92. package/dist/commands/dev/tool-generate.spec.js +0 -163
  93. package/dist/commands/dev/tool.d.ts +0 -2
  94. package/dist/commands/dev/tool.js +0 -559
  95. package/dist/commands/dev/tool.spec.d.ts +0 -1
  96. package/dist/commands/dev/tool.spec.js +0 -48
  97. package/dist/commands/docs/index.d.ts +0 -4
  98. package/dist/commands/docs/index.js +0 -18
  99. package/dist/commands/install/index.d.ts +0 -8
  100. package/dist/commands/install/index.js +0 -300
  101. package/dist/commands/install/index.spec.d.ts +0 -1
  102. package/dist/commands/install/index.spec.js +0 -143
  103. package/dist/commands/install.d.ts +0 -3
  104. package/dist/commands/install.js +0 -147
  105. package/dist/commands/models/create.d.ts +0 -1
  106. package/dist/commands/models/create.js +0 -213
  107. package/dist/commands/models/create.spec.d.ts +0 -1
  108. package/dist/commands/models/create.spec.js +0 -125
  109. package/dist/commands/models/index.d.ts +0 -3
  110. package/dist/commands/models/index.js +0 -60
  111. package/dist/commands/models/index.spec.d.ts +0 -1
  112. package/dist/commands/models/index.spec.js +0 -76
  113. package/dist/commands/models/selector.d.ts +0 -8
  114. package/dist/commands/models/selector.js +0 -53
  115. package/dist/commands/query/index.d.ts +0 -3
  116. package/dist/commands/query/index.js +0 -131
  117. package/dist/commands/routes/index.d.ts +0 -3
  118. package/dist/commands/routes/index.js +0 -93
  119. package/dist/commands/routes.d.ts +0 -2
  120. package/dist/commands/routes.js +0 -101
  121. package/dist/commands/status/index.d.ts +0 -4
  122. package/dist/commands/status/index.js +0 -262
  123. package/dist/commands/status.d.ts +0 -3
  124. package/dist/commands/status.js +0 -33
  125. package/dist/commands/targets/index.d.ts +0 -3
  126. package/dist/commands/targets/index.js +0 -65
  127. package/dist/commands/targets/index.spec.d.ts +0 -1
  128. package/dist/commands/targets/index.spec.js +0 -105
  129. package/dist/commands/targets.d.ts +0 -2
  130. package/dist/commands/targets.js +0 -65
  131. package/dist/commands/teams/index.d.ts +0 -3
  132. package/dist/commands/teams/index.js +0 -49
  133. package/dist/commands/teams/index.spec.d.ts +0 -1
  134. package/dist/commands/teams/index.spec.js +0 -70
  135. package/dist/commands/teams/selector.d.ts +0 -8
  136. package/dist/commands/teams/selector.js +0 -55
  137. package/dist/commands/tools/index.d.ts +0 -3
  138. package/dist/commands/tools/index.js +0 -49
  139. package/dist/commands/tools/index.spec.d.ts +0 -1
  140. package/dist/commands/tools/index.spec.js +0 -70
  141. package/dist/commands/tools/selector.d.ts +0 -8
  142. package/dist/commands/tools/selector.js +0 -53
  143. package/dist/commands/uninstall/index.d.ts +0 -3
  144. package/dist/commands/uninstall/index.js +0 -106
  145. package/dist/commands/uninstall/index.spec.d.ts +0 -1
  146. package/dist/commands/uninstall/index.spec.js +0 -125
  147. package/dist/commands/uninstall.d.ts +0 -2
  148. package/dist/commands/uninstall.js +0 -83
  149. package/dist/components/ChatUI.d.ts +0 -16
  150. package/dist/components/ChatUI.js +0 -801
  151. package/dist/components/StatusView.d.ts +0 -10
  152. package/dist/components/StatusView.js +0 -39
  153. package/dist/lib/arkApiClient.d.ts +0 -53
  154. package/dist/lib/arkApiClient.js +0 -102
  155. package/dist/lib/arkApiProxy.d.ts +0 -9
  156. package/dist/lib/arkApiProxy.js +0 -22
  157. package/dist/lib/arkServiceProxy.d.ts +0 -14
  158. package/dist/lib/arkServiceProxy.js +0 -95
  159. package/dist/lib/arkStatus.d.ts +0 -10
  160. package/dist/lib/arkStatus.js +0 -79
  161. package/dist/lib/arkStatus.spec.d.ts +0 -1
  162. package/dist/lib/arkStatus.spec.js +0 -49
  163. package/dist/lib/chatClient.d.ts +0 -33
  164. package/dist/lib/chatClient.js +0 -99
  165. package/dist/lib/cluster.spec.d.ts +0 -1
  166. package/dist/lib/cluster.spec.js +0 -338
  167. package/dist/lib/commandUtils.d.ts +0 -4
  168. package/dist/lib/commandUtils.js +0 -18
  169. package/dist/lib/commandUtils.test.d.ts +0 -1
  170. package/dist/lib/commandUtils.test.js +0 -44
  171. package/dist/lib/commands.d.ts +0 -16
  172. package/dist/lib/commands.js +0 -29
  173. package/dist/lib/commands.spec.d.ts +0 -1
  174. package/dist/lib/commands.spec.js +0 -146
  175. package/dist/lib/config.spec.d.ts +0 -1
  176. package/dist/lib/config.spec.js +0 -99
  177. package/dist/lib/config.test.d.ts +0 -1
  178. package/dist/lib/config.test.js +0 -93
  179. package/dist/lib/consts.spec.d.ts +0 -1
  180. package/dist/lib/consts.spec.js +0 -15
  181. package/dist/lib/dev/tools/analyzer.d.ts +0 -30
  182. package/dist/lib/dev/tools/analyzer.js +0 -190
  183. package/dist/lib/dev/tools/discover_tools.py +0 -392
  184. package/dist/lib/dev/tools/mcp-types.d.ts +0 -28
  185. package/dist/lib/dev/tools/mcp-types.js +0 -86
  186. package/dist/lib/dev/tools/types.d.ts +0 -50
  187. package/dist/lib/dev/tools/types.js +0 -1
  188. package/dist/lib/errors.spec.d.ts +0 -1
  189. package/dist/lib/errors.spec.js +0 -221
  190. package/dist/lib/nextSteps.d.ts +0 -4
  191. package/dist/lib/nextSteps.js +0 -20
  192. package/dist/lib/nextSteps.spec.d.ts +0 -1
  193. package/dist/lib/nextSteps.spec.js +0 -59
  194. package/dist/lib/output.d.ts +0 -36
  195. package/dist/lib/output.js +0 -89
  196. package/dist/lib/output.spec.d.ts +0 -1
  197. package/dist/lib/output.spec.js +0 -123
  198. package/dist/lib/portUtils.d.ts +0 -8
  199. package/dist/lib/portUtils.js +0 -39
  200. package/dist/lib/startup.d.ts +0 -9
  201. package/dist/lib/startup.js +0 -93
  202. package/dist/lib/startup.spec.d.ts +0 -1
  203. package/dist/lib/startup.spec.js +0 -168
  204. package/dist/types/types.d.ts +0 -40
  205. package/dist/types/types.js +0 -1
  206. package/dist/ui/AgentSelector.d.ts +0 -8
  207. package/dist/ui/AgentSelector.js +0 -53
  208. package/dist/ui/ModelSelector.d.ts +0 -8
  209. package/dist/ui/ModelSelector.js +0 -53
  210. package/dist/ui/TeamSelector.d.ts +0 -8
  211. package/dist/ui/TeamSelector.js +0 -55
  212. package/dist/ui/ToolSelector.d.ts +0 -8
  213. package/dist/ui/ToolSelector.js +0 -53
  214. package/dist/ui/statusFormatter.spec.d.ts +0 -1
  215. package/dist/ui/statusFormatter.spec.js +0 -58
@@ -1,136 +0,0 @@
1
- import { Command } from 'commander';
2
- import chalk from 'chalk';
3
- import path from 'path';
4
- import ora from 'ora';
5
- import output from '../../../lib/output.js';
6
- import { ArkDevToolAnalyzer } from '../../../lib/dev/tools/analyzer.js';
7
- import { toMCPTool } from '../../../lib/dev/tools/mcp-types.js';
8
- async function statusTool(toolPath, options) {
9
- const absolutePath = path.resolve(toolPath);
10
- const analyzer = new ArkDevToolAnalyzer();
11
- const isJson = options.output === 'json';
12
- // Build up result object as we go
13
- const result = {
14
- path: absolutePath,
15
- projectRoot: null,
16
- error: null,
17
- platform: null,
18
- projectType: null,
19
- projectName: null,
20
- projectVersion: null,
21
- hasFastmcp: false,
22
- fastmcpVersion: null,
23
- tools: [],
24
- toolDiscoveryError: null
25
- };
26
- if (!isJson) {
27
- console.log();
28
- }
29
- // Single spinner for all analysis (skip for JSON output)
30
- const analyzeSpinner = isJson ? null : ora(`analyzing ${absolutePath}`).start();
31
- // Small delay to let user see what's happening (skip for JSON)
32
- if (!isJson) {
33
- await new Promise(resolve => setTimeout(resolve, 500));
34
- }
35
- // Collect all information
36
- const project = await analyzer.discoverProject(absolutePath);
37
- if (!project || !project.exists) {
38
- result.error = 'path not found';
39
- if (isJson) {
40
- console.log(JSON.stringify(result, null, 2));
41
- }
42
- else {
43
- analyzeSpinner.stop();
44
- output.error(`path not found: ${absolutePath}`);
45
- }
46
- process.exit(1);
47
- }
48
- if (!project.is_directory) {
49
- result.error = 'path is not a directory';
50
- if (isJson) {
51
- console.log(JSON.stringify(result, null, 2));
52
- }
53
- else {
54
- analyzeSpinner.stop();
55
- output.error(`path is not a directory: ${absolutePath}`);
56
- }
57
- process.exit(1);
58
- }
59
- if (!project.platform) {
60
- result.error = 'platform unknown - no pyproject.toml or requirements.txt found';
61
- if (isJson) {
62
- console.log(JSON.stringify(result, null, 2));
63
- }
64
- else {
65
- analyzeSpinner.stop();
66
- output.error(`no pyproject.toml or requirements.txt found in: ${absolutePath}`);
67
- }
68
- process.exit(1);
69
- }
70
- // Update result with project info
71
- result.platform = project.platform;
72
- result.projectType = project.project_type;
73
- result.projectName = project.project_name;
74
- result.projectVersion = project.project_version;
75
- result.hasFastmcp = project.has_fastmcp;
76
- result.fastmcpVersion = project.fastmcp_version;
77
- result.projectRoot = absolutePath; // Store the project root
78
- // Discover tools recursively in the project
79
- const rawTools = [];
80
- try {
81
- const projectTools = await analyzer.findProjectTools(absolutePath);
82
- if (projectTools && projectTools.tools) {
83
- rawTools.push(...projectTools.tools);
84
- }
85
- }
86
- catch (error) {
87
- result.toolDiscoveryError = error instanceof Error ? error.message : 'Unknown error';
88
- }
89
- // Store tools in the appropriate format
90
- result.tools = isJson ? rawTools.map(toMCPTool) : rawTools;
91
- if (isJson) {
92
- // Output raw JSON
93
- console.log(JSON.stringify(result, null, 2));
94
- return;
95
- }
96
- analyzeSpinner.succeed('analysis complete');
97
- console.log();
98
- // Display summary in cleaner format
99
- output.section(path.basename(absolutePath));
100
- // Platform
101
- output.statusCheck('found', 'platform', result.platform);
102
- // Project type with name and version in gray
103
- let projectDetails = '';
104
- if (result.projectName) {
105
- projectDetails = result.projectName;
106
- if (result.projectVersion) {
107
- projectDetails += ` v${result.projectVersion}`;
108
- }
109
- }
110
- output.statusCheck('found', 'project', result.projectType, projectDetails);
111
- // Framework with version in gray
112
- if (result.hasFastmcp) {
113
- const fastmcpDetails = result.fastmcpVersion ? `v${result.fastmcpVersion}` : undefined;
114
- output.statusCheck('found', 'framework', 'fastmcp', fastmcpDetails);
115
- }
116
- else {
117
- output.statusCheck('missing', 'framework', 'fastmcp');
118
- }
119
- // Tools with details
120
- output.statusCheck('found', 'tools', result.tools.length.toString());
121
- if (result.tools.length > 0) {
122
- for (const tool of result.tools) {
123
- const description = tool.docstring ? tool.docstring.split('\n')[0] : '';
124
- console.log(chalk.gray(` - ${tool.name}: ${description}`));
125
- }
126
- }
127
- }
128
- export function createStatusCommand() {
129
- const statusCommand = new Command('status');
130
- statusCommand
131
- .description('Check the status of an MCP tool project')
132
- .argument('<path>', 'Path to the tool directory')
133
- .option('-o, --output <format>', 'Output format (json)', 'text')
134
- .action(statusTool);
135
- return statusCommand;
136
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,163 +0,0 @@
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
- });
@@ -1,2 +0,0 @@
1
- import { Command } from 'commander';
2
- export declare function createToolCommand(): Command;