@agents-at-scale/ark 0.1.36-rc1 → 0.1.36

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 (100) hide show
  1. package/package.json +1 -1
  2. package/dist/charts/charts.d.ts +0 -5
  3. package/dist/charts/charts.js +0 -6
  4. package/dist/charts/dependencies.d.ts +0 -6
  5. package/dist/charts/dependencies.js +0 -50
  6. package/dist/charts/types.d.ts +0 -40
  7. package/dist/charts/types.js +0 -1
  8. package/dist/commands/agents/selector.d.ts +0 -8
  9. package/dist/commands/agents/selector.js +0 -53
  10. package/dist/commands/agents.d.ts +0 -2
  11. package/dist/commands/agents.js +0 -53
  12. package/dist/commands/chat.d.ts +0 -2
  13. package/dist/commands/chat.js +0 -45
  14. package/dist/commands/cluster/get-ip.d.ts +0 -2
  15. package/dist/commands/cluster/get-ip.js +0 -32
  16. package/dist/commands/cluster/get-type.d.ts +0 -2
  17. package/dist/commands/cluster/get-type.js +0 -26
  18. package/dist/commands/completion.d.ts +0 -2
  19. package/dist/commands/completion.js +0 -265
  20. package/dist/commands/config.d.ts +0 -2
  21. package/dist/commands/config.js +0 -44
  22. package/dist/commands/dashboard.d.ts +0 -3
  23. package/dist/commands/dashboard.js +0 -39
  24. package/dist/commands/dev/index.d.ts +0 -3
  25. package/dist/commands/dev/index.js +0 -9
  26. package/dist/commands/dev/tool/check.d.ts +0 -2
  27. package/dist/commands/dev/tool/check.js +0 -142
  28. package/dist/commands/dev/tool/clean.d.ts +0 -2
  29. package/dist/commands/dev/tool/clean.js +0 -153
  30. package/dist/commands/dev/tool/generate.d.ts +0 -2
  31. package/dist/commands/dev/tool/generate.js +0 -28
  32. package/dist/commands/dev/tool/index.d.ts +0 -2
  33. package/dist/commands/dev/tool/index.js +0 -14
  34. package/dist/commands/dev/tool/init.d.ts +0 -2
  35. package/dist/commands/dev/tool/init.js +0 -320
  36. package/dist/commands/dev/tool/shared.d.ts +0 -5
  37. package/dist/commands/dev/tool/shared.js +0 -258
  38. package/dist/commands/dev/tool/status.d.ts +0 -2
  39. package/dist/commands/dev/tool/status.js +0 -136
  40. package/dist/commands/dev/tool-generate.spec.d.ts +0 -1
  41. package/dist/commands/dev/tool-generate.spec.js +0 -163
  42. package/dist/commands/dev/tool.d.ts +0 -2
  43. package/dist/commands/dev/tool.js +0 -559
  44. package/dist/commands/dev/tool.spec.d.ts +0 -1
  45. package/dist/commands/dev/tool.spec.js +0 -48
  46. package/dist/commands/install.d.ts +0 -3
  47. package/dist/commands/install.js +0 -147
  48. package/dist/commands/models/selector.d.ts +0 -8
  49. package/dist/commands/models/selector.js +0 -53
  50. package/dist/commands/routes.d.ts +0 -2
  51. package/dist/commands/routes.js +0 -101
  52. package/dist/commands/status.d.ts +0 -3
  53. package/dist/commands/status.js +0 -33
  54. package/dist/commands/targets.d.ts +0 -2
  55. package/dist/commands/targets.js +0 -65
  56. package/dist/commands/teams/selector.d.ts +0 -8
  57. package/dist/commands/teams/selector.js +0 -55
  58. package/dist/commands/tools/selector.d.ts +0 -8
  59. package/dist/commands/tools/selector.js +0 -53
  60. package/dist/commands/uninstall.d.ts +0 -2
  61. package/dist/commands/uninstall.js +0 -83
  62. package/dist/components/DashboardCLI.d.ts +0 -3
  63. package/dist/components/DashboardCLI.js +0 -149
  64. package/dist/components/StatusView.d.ts +0 -10
  65. package/dist/components/StatusView.js +0 -39
  66. package/dist/config.d.ts +0 -23
  67. package/dist/config.js +0 -92
  68. package/dist/lib/arkClient.d.ts +0 -32
  69. package/dist/lib/arkClient.js +0 -43
  70. package/dist/lib/commandUtils.d.ts +0 -4
  71. package/dist/lib/commandUtils.js +0 -18
  72. package/dist/lib/commandUtils.test.d.ts +0 -1
  73. package/dist/lib/commandUtils.test.js +0 -44
  74. package/dist/lib/config.test.d.ts +0 -1
  75. package/dist/lib/config.test.js +0 -93
  76. package/dist/lib/consts.d.ts +0 -9
  77. package/dist/lib/consts.js +0 -13
  78. package/dist/lib/consts.spec.d.ts +0 -1
  79. package/dist/lib/consts.spec.js +0 -15
  80. package/dist/lib/dev/tools/analyzer.d.ts +0 -30
  81. package/dist/lib/dev/tools/analyzer.js +0 -190
  82. package/dist/lib/dev/tools/discover_tools.py +0 -392
  83. package/dist/lib/dev/tools/mcp-types.d.ts +0 -28
  84. package/dist/lib/dev/tools/mcp-types.js +0 -86
  85. package/dist/lib/dev/tools/types.d.ts +0 -50
  86. package/dist/lib/dev/tools/types.js +0 -1
  87. package/dist/lib/exec.d.ts +0 -1
  88. package/dist/lib/exec.js +0 -9
  89. package/dist/lib/gatewayManager.d.ts +0 -24
  90. package/dist/lib/gatewayManager.js +0 -85
  91. package/dist/lib/kubernetes.d.ts +0 -28
  92. package/dist/lib/kubernetes.js +0 -122
  93. package/dist/lib/portUtils.d.ts +0 -8
  94. package/dist/lib/portUtils.js +0 -39
  95. package/dist/lib/progress.d.ts +0 -128
  96. package/dist/lib/progress.js +0 -273
  97. package/dist/lib/queryRunner.d.ts +0 -22
  98. package/dist/lib/queryRunner.js +0 -142
  99. package/dist/lib/wrappers/git.d.ts +0 -2
  100. package/dist/lib/wrappers/git.js +0 -43
@@ -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;