@agents-at-scale/ark 0.1.35-rc.1 → 0.1.35-rc1
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.
- package/dist/arkServices.d.ts +4 -12
- package/dist/arkServices.js +19 -34
- package/dist/arkServices.spec.d.ts +1 -0
- package/dist/arkServices.spec.js +24 -0
- package/dist/commands/agents/index.d.ts +2 -1
- package/dist/commands/agents/index.js +2 -7
- package/dist/commands/agents/index.spec.d.ts +1 -0
- package/dist/commands/agents/index.spec.js +67 -0
- package/dist/commands/chat/index.d.ts +2 -1
- package/dist/commands/chat/index.js +5 -21
- package/dist/commands/cluster/get.spec.d.ts +1 -0
- package/dist/commands/cluster/get.spec.js +92 -0
- package/dist/commands/cluster/index.d.ts +2 -1
- package/dist/commands/cluster/index.js +1 -1
- package/dist/commands/cluster/index.spec.d.ts +1 -0
- package/dist/commands/cluster/index.spec.js +24 -0
- package/dist/commands/completion/index.d.ts +2 -1
- package/dist/commands/completion/index.js +1 -1
- package/dist/commands/completion/index.spec.d.ts +1 -0
- package/dist/commands/completion/index.spec.js +34 -0
- package/dist/commands/config/index.d.ts +2 -1
- package/dist/commands/config/index.js +2 -2
- package/dist/commands/config/index.spec.d.ts +1 -0
- package/dist/commands/config/index.spec.js +78 -0
- package/dist/commands/dashboard/index.d.ts +2 -1
- package/dist/commands/dashboard/index.js +1 -1
- package/dist/commands/dev/index.d.ts +2 -1
- package/dist/commands/dev/index.js +1 -1
- package/dist/commands/dev/tool-generate.spec.d.ts +1 -0
- package/dist/commands/dev/tool-generate.spec.js +163 -0
- package/dist/commands/dev/tool.spec.d.ts +1 -0
- package/dist/commands/dev/tool.spec.js +48 -0
- package/dist/commands/generate/generators/project.js +22 -41
- package/dist/commands/generate/index.d.ts +2 -1
- package/dist/commands/generate/index.js +1 -1
- package/dist/commands/install/index.d.ts +4 -2
- package/dist/commands/install/index.js +215 -78
- package/dist/commands/install/index.spec.d.ts +1 -0
- package/dist/commands/install/index.spec.js +135 -0
- package/dist/commands/models/create.spec.d.ts +1 -0
- package/dist/commands/models/create.spec.js +125 -0
- package/dist/commands/models/index.d.ts +2 -1
- package/dist/commands/models/index.js +2 -7
- package/dist/commands/models/index.spec.d.ts +1 -0
- package/dist/commands/models/index.spec.js +76 -0
- package/dist/commands/routes/index.d.ts +2 -1
- package/dist/commands/routes/index.js +1 -9
- package/dist/commands/status/index.d.ts +3 -2
- package/dist/commands/status/index.js +210 -11
- package/dist/commands/targets/index.d.ts +2 -1
- package/dist/commands/targets/index.js +1 -1
- package/dist/commands/targets/index.spec.d.ts +1 -0
- package/dist/commands/targets/index.spec.js +105 -0
- package/dist/commands/teams/index.d.ts +2 -1
- package/dist/commands/teams/index.js +2 -7
- package/dist/commands/teams/index.spec.d.ts +1 -0
- package/dist/commands/teams/index.spec.js +70 -0
- package/dist/commands/tools/index.d.ts +2 -1
- package/dist/commands/tools/index.js +2 -7
- package/dist/commands/tools/index.spec.d.ts +1 -0
- package/dist/commands/tools/index.spec.js +70 -0
- package/dist/commands/uninstall/index.d.ts +2 -1
- package/dist/commands/uninstall/index.js +61 -38
- package/dist/commands/uninstall/index.spec.d.ts +1 -0
- package/dist/commands/uninstall/index.spec.js +117 -0
- package/dist/components/ChatUI.js +4 -4
- package/dist/components/statusChecker.d.ts +5 -12
- package/dist/components/statusChecker.js +172 -89
- package/dist/config.d.ts +3 -22
- package/dist/config.js +7 -151
- package/dist/index.js +22 -19
- package/dist/lib/arkServiceProxy.js +4 -2
- package/dist/lib/arkStatus.d.ts +5 -0
- package/dist/lib/arkStatus.js +61 -2
- package/dist/lib/arkStatus.spec.d.ts +1 -0
- package/dist/lib/arkStatus.spec.js +49 -0
- package/dist/lib/chatClient.js +1 -3
- package/dist/lib/cluster.js +11 -14
- package/dist/lib/cluster.spec.d.ts +1 -0
- package/dist/lib/cluster.spec.js +338 -0
- package/dist/lib/commandUtils.js +7 -7
- package/dist/lib/commands.d.ts +16 -0
- package/dist/lib/commands.js +29 -0
- package/dist/lib/commands.spec.d.ts +1 -0
- package/dist/lib/commands.spec.js +146 -0
- package/dist/lib/config.d.ts +2 -0
- package/dist/lib/config.js +6 -4
- package/dist/lib/config.spec.d.ts +1 -0
- package/dist/lib/config.spec.js +99 -0
- package/dist/lib/consts.d.ts +0 -1
- package/dist/lib/consts.js +0 -2
- package/dist/lib/consts.spec.d.ts +1 -0
- package/dist/lib/consts.spec.js +15 -0
- package/dist/lib/errors.js +1 -1
- package/dist/lib/errors.spec.d.ts +1 -0
- package/dist/lib/errors.spec.js +221 -0
- package/dist/lib/exec.d.ts +0 -4
- package/dist/lib/exec.js +0 -11
- package/dist/lib/output.spec.d.ts +1 -0
- package/dist/lib/output.spec.js +123 -0
- package/dist/lib/portUtils.d.ts +8 -0
- package/dist/lib/portUtils.js +39 -0
- package/dist/lib/startup.d.ts +5 -0
- package/dist/lib/startup.js +73 -0
- package/dist/lib/startup.spec.d.ts +1 -0
- package/dist/lib/startup.spec.js +168 -0
- package/dist/lib/types.d.ts +2 -0
- package/dist/ui/AgentSelector.d.ts +8 -0
- package/dist/ui/AgentSelector.js +53 -0
- package/dist/ui/MainMenu.d.ts +5 -1
- package/dist/ui/MainMenu.js +117 -54
- package/dist/ui/ModelSelector.d.ts +8 -0
- package/dist/ui/ModelSelector.js +53 -0
- package/dist/ui/TeamSelector.d.ts +8 -0
- package/dist/ui/TeamSelector.js +55 -0
- package/dist/ui/ToolSelector.d.ts +8 -0
- package/dist/ui/ToolSelector.js +53 -0
- package/dist/ui/statusFormatter.d.ts +22 -10
- package/dist/ui/statusFormatter.js +37 -109
- package/dist/ui/statusFormatter.spec.d.ts +1 -0
- package/dist/ui/statusFormatter.spec.js +58 -0
- package/package.json +3 -3
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jest } from '@jest/globals';
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
const mockExeca = jest.fn();
|
|
4
|
+
jest.unstable_mockModule('execa', () => ({
|
|
5
|
+
execa: mockExeca,
|
|
6
|
+
}));
|
|
7
|
+
const mockOutput = {
|
|
8
|
+
info: jest.fn(),
|
|
9
|
+
error: jest.fn(),
|
|
10
|
+
};
|
|
11
|
+
jest.unstable_mockModule('../../lib/output.js', () => ({
|
|
12
|
+
default: mockOutput,
|
|
13
|
+
}));
|
|
14
|
+
const mockExit = jest.spyOn(process, 'exit').mockImplementation((() => {
|
|
15
|
+
throw new Error('process.exit called');
|
|
16
|
+
}));
|
|
17
|
+
const mockConsoleLog = jest.spyOn(console, 'log').mockImplementation(() => { });
|
|
18
|
+
const { createToolsCommand } = await import('./index.js');
|
|
19
|
+
describe('tools command', () => {
|
|
20
|
+
beforeEach(() => {
|
|
21
|
+
jest.clearAllMocks();
|
|
22
|
+
});
|
|
23
|
+
it('creates command with correct structure', () => {
|
|
24
|
+
const command = createToolsCommand({});
|
|
25
|
+
expect(command).toBeInstanceOf(Command);
|
|
26
|
+
expect(command.name()).toBe('tools');
|
|
27
|
+
});
|
|
28
|
+
it('lists tools in text format', async () => {
|
|
29
|
+
const mockTools = {
|
|
30
|
+
items: [
|
|
31
|
+
{ metadata: { name: 'github-mcp' } },
|
|
32
|
+
{ metadata: { name: 'slack-mcp' } },
|
|
33
|
+
],
|
|
34
|
+
};
|
|
35
|
+
mockExeca.mockResolvedValue({ stdout: JSON.stringify(mockTools) });
|
|
36
|
+
const command = createToolsCommand({});
|
|
37
|
+
await command.parseAsync(['node', 'test']);
|
|
38
|
+
expect(mockExeca).toHaveBeenCalledWith('kubectl', ['get', 'mcpservers', '-o', 'json'], { stdio: 'pipe' });
|
|
39
|
+
expect(mockConsoleLog).toHaveBeenCalledWith('github-mcp');
|
|
40
|
+
expect(mockConsoleLog).toHaveBeenCalledWith('slack-mcp');
|
|
41
|
+
});
|
|
42
|
+
it('lists tools in json format', async () => {
|
|
43
|
+
const mockTools = {
|
|
44
|
+
items: [{ metadata: { name: 'github-mcp' } }],
|
|
45
|
+
};
|
|
46
|
+
mockExeca.mockResolvedValue({ stdout: JSON.stringify(mockTools) });
|
|
47
|
+
const command = createToolsCommand({});
|
|
48
|
+
await command.parseAsync(['node', 'test', '-o', 'json']);
|
|
49
|
+
expect(mockConsoleLog).toHaveBeenCalledWith(JSON.stringify(mockTools.items, null, 2));
|
|
50
|
+
});
|
|
51
|
+
it('shows info when no tools', async () => {
|
|
52
|
+
mockExeca.mockResolvedValue({ stdout: JSON.stringify({ items: [] }) });
|
|
53
|
+
const command = createToolsCommand({});
|
|
54
|
+
await command.parseAsync(['node', 'test']);
|
|
55
|
+
expect(mockOutput.info).toHaveBeenCalledWith('No tools found');
|
|
56
|
+
});
|
|
57
|
+
it('handles errors', async () => {
|
|
58
|
+
mockExeca.mockRejectedValue(new Error('kubectl failed'));
|
|
59
|
+
const command = createToolsCommand({});
|
|
60
|
+
await expect(command.parseAsync(['node', 'test'])).rejects.toThrow('process.exit called');
|
|
61
|
+
expect(mockOutput.error).toHaveBeenCalledWith('fetching tools:', 'kubectl failed');
|
|
62
|
+
expect(mockExit).toHaveBeenCalledWith(1);
|
|
63
|
+
});
|
|
64
|
+
it('list subcommand works', async () => {
|
|
65
|
+
mockExeca.mockResolvedValue({ stdout: JSON.stringify({ items: [] }) });
|
|
66
|
+
const command = createToolsCommand({});
|
|
67
|
+
await command.parseAsync(['node', 'test', 'list']);
|
|
68
|
+
expect(mockExeca).toHaveBeenCalled();
|
|
69
|
+
});
|
|
70
|
+
});
|
|
@@ -1,26 +1,19 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
|
-
import {
|
|
3
|
+
import { execute } from '../../lib/commands.js';
|
|
4
4
|
import inquirer from 'inquirer';
|
|
5
|
-
import { isCommandAvailable } from '../../lib/commandUtils.js';
|
|
6
5
|
import { getClusterInfo } from '../../lib/cluster.js';
|
|
7
6
|
import output from '../../lib/output.js';
|
|
8
7
|
import { getInstallableServices } from '../../arkServices.js';
|
|
9
|
-
async function
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (
|
|
13
|
-
|
|
14
|
-
output.info('https://helm.sh/docs/intro/install/');
|
|
15
|
-
process.exit(1);
|
|
16
|
-
}
|
|
17
|
-
// Check if kubectl is installed
|
|
18
|
-
const kubectlInstalled = await isCommandAvailable('kubectl');
|
|
19
|
-
if (!kubectlInstalled) {
|
|
20
|
-
output.error('kubectl is not installed. please install kubectl first:');
|
|
21
|
-
output.info('https://kubernetes.io/docs/tasks/tools/');
|
|
22
|
-
process.exit(1);
|
|
8
|
+
async function uninstallService(service, verbose = false) {
|
|
9
|
+
const helmArgs = ['uninstall', service.helmReleaseName, '--ignore-not-found'];
|
|
10
|
+
// Only add namespace flag if service has explicit namespace
|
|
11
|
+
if (service.namespace) {
|
|
12
|
+
helmArgs.push('--namespace', service.namespace);
|
|
23
13
|
}
|
|
14
|
+
await execute('helm', helmArgs, { stdio: 'inherit' }, { verbose });
|
|
15
|
+
}
|
|
16
|
+
async function uninstallArk(serviceName, options = {}) {
|
|
24
17
|
// Check cluster connectivity
|
|
25
18
|
const clusterInfo = await getClusterInfo();
|
|
26
19
|
if (clusterInfo.error) {
|
|
@@ -36,34 +29,62 @@ async function uninstallArk(options = {}) {
|
|
|
36
29
|
output.info(`ip: ${clusterInfo.ip}`);
|
|
37
30
|
}
|
|
38
31
|
console.log(); // Add blank line after cluster info
|
|
32
|
+
// If a specific service is requested, uninstall only that service
|
|
33
|
+
if (serviceName) {
|
|
34
|
+
const services = getInstallableServices();
|
|
35
|
+
const service = Object.values(services).find((s) => s.name === serviceName);
|
|
36
|
+
if (!service) {
|
|
37
|
+
output.error(`service '${serviceName}' not found`);
|
|
38
|
+
output.info('available services:');
|
|
39
|
+
for (const s of Object.values(services)) {
|
|
40
|
+
output.info(` ${s.name}`);
|
|
41
|
+
}
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
44
|
+
output.info(`uninstalling ${service.name}...`);
|
|
45
|
+
try {
|
|
46
|
+
await uninstallService(service, options.verbose);
|
|
47
|
+
output.success(`${service.name} uninstalled successfully`);
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
output.error(`failed to uninstall ${service.name}`);
|
|
51
|
+
console.error(error);
|
|
52
|
+
process.exit(1);
|
|
53
|
+
}
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
39
56
|
// Get installable services and iterate through them in reverse order for clean uninstall
|
|
40
57
|
const services = getInstallableServices();
|
|
41
58
|
const serviceEntries = Object.entries(services).reverse();
|
|
42
59
|
for (const [, service] of serviceEntries) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
60
|
+
let shouldUninstall = false;
|
|
61
|
+
try {
|
|
62
|
+
// Ask for confirmation
|
|
63
|
+
shouldUninstall =
|
|
64
|
+
options.yes ||
|
|
65
|
+
(await inquirer.prompt([
|
|
66
|
+
{
|
|
67
|
+
type: 'confirm',
|
|
68
|
+
name: 'shouldUninstall',
|
|
69
|
+
message: `uninstall ${chalk.bold(service.name)}? ${service.description ? chalk.gray(`(${service.description.toLowerCase()})`) : ''}`,
|
|
70
|
+
default: true,
|
|
71
|
+
},
|
|
72
|
+
])).shouldUninstall;
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
// Handle Ctrl-C gracefully
|
|
76
|
+
if (error && error.name === 'ExitPromptError') {
|
|
77
|
+
console.log('\nUninstallation cancelled');
|
|
78
|
+
process.exit(130); // Standard exit code for SIGINT
|
|
79
|
+
}
|
|
80
|
+
throw error;
|
|
81
|
+
}
|
|
52
82
|
if (!shouldUninstall) {
|
|
53
83
|
output.warning(`skipping ${service.name}`);
|
|
54
84
|
continue;
|
|
55
85
|
}
|
|
56
86
|
try {
|
|
57
|
-
|
|
58
|
-
await execa('helm', [
|
|
59
|
-
'uninstall',
|
|
60
|
-
service.helmReleaseName,
|
|
61
|
-
'--namespace',
|
|
62
|
-
service.namespace,
|
|
63
|
-
'--ignore-not-found',
|
|
64
|
-
], {
|
|
65
|
-
stdio: 'inherit',
|
|
66
|
-
});
|
|
87
|
+
await uninstallService(service, options.verbose);
|
|
67
88
|
console.log(); // Add blank line after command output
|
|
68
89
|
}
|
|
69
90
|
catch {
|
|
@@ -72,13 +93,15 @@ async function uninstallArk(options = {}) {
|
|
|
72
93
|
}
|
|
73
94
|
}
|
|
74
95
|
}
|
|
75
|
-
export function createUninstallCommand() {
|
|
96
|
+
export function createUninstallCommand(_) {
|
|
76
97
|
const command = new Command('uninstall');
|
|
77
98
|
command
|
|
78
99
|
.description('Uninstall ARK components using Helm')
|
|
100
|
+
.argument('[service]', 'specific service to uninstall, or all if omitted')
|
|
79
101
|
.option('-y, --yes', 'automatically confirm all uninstallations')
|
|
80
|
-
.
|
|
81
|
-
|
|
102
|
+
.option('-v, --verbose', 'show commands being executed')
|
|
103
|
+
.action(async (service, options) => {
|
|
104
|
+
await uninstallArk(service, options);
|
|
82
105
|
});
|
|
83
106
|
return command;
|
|
84
107
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { jest } from '@jest/globals';
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
const mockExeca = jest.fn(() => Promise.resolve());
|
|
4
|
+
jest.unstable_mockModule('execa', () => ({
|
|
5
|
+
execa: mockExeca,
|
|
6
|
+
}));
|
|
7
|
+
const mockGetClusterInfo = jest.fn();
|
|
8
|
+
jest.unstable_mockModule('../../lib/cluster.js', () => ({
|
|
9
|
+
getClusterInfo: mockGetClusterInfo,
|
|
10
|
+
}));
|
|
11
|
+
const mockGetInstallableServices = jest.fn();
|
|
12
|
+
jest.unstable_mockModule('../../arkServices.js', () => ({
|
|
13
|
+
getInstallableServices: mockGetInstallableServices,
|
|
14
|
+
}));
|
|
15
|
+
const mockOutput = {
|
|
16
|
+
error: jest.fn(),
|
|
17
|
+
info: jest.fn(),
|
|
18
|
+
success: jest.fn(),
|
|
19
|
+
warning: jest.fn(),
|
|
20
|
+
};
|
|
21
|
+
jest.unstable_mockModule('../../lib/output.js', () => ({
|
|
22
|
+
default: mockOutput,
|
|
23
|
+
}));
|
|
24
|
+
const mockExit = jest.spyOn(process, 'exit').mockImplementation((() => {
|
|
25
|
+
throw new Error('process.exit called');
|
|
26
|
+
}));
|
|
27
|
+
jest.spyOn(console, 'log').mockImplementation(() => { });
|
|
28
|
+
jest.spyOn(console, 'error').mockImplementation(() => { });
|
|
29
|
+
const { createUninstallCommand } = await import('./index.js');
|
|
30
|
+
describe('uninstall command', () => {
|
|
31
|
+
beforeEach(() => {
|
|
32
|
+
jest.clearAllMocks();
|
|
33
|
+
mockGetClusterInfo.mockResolvedValue({
|
|
34
|
+
context: 'test-cluster',
|
|
35
|
+
type: 'minikube',
|
|
36
|
+
namespace: 'default',
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
it('creates command with correct structure', () => {
|
|
40
|
+
const command = createUninstallCommand({});
|
|
41
|
+
expect(command).toBeInstanceOf(Command);
|
|
42
|
+
expect(command.name()).toBe('uninstall');
|
|
43
|
+
});
|
|
44
|
+
it('uninstalls single service with correct helm parameters', async () => {
|
|
45
|
+
const mockService = {
|
|
46
|
+
name: 'ark-api',
|
|
47
|
+
helmReleaseName: 'ark-api',
|
|
48
|
+
namespace: 'ark-system',
|
|
49
|
+
};
|
|
50
|
+
mockGetInstallableServices.mockReturnValue({
|
|
51
|
+
'ark-api': mockService,
|
|
52
|
+
});
|
|
53
|
+
const command = createUninstallCommand({});
|
|
54
|
+
await command.parseAsync(['node', 'test', 'ark-api']);
|
|
55
|
+
expect(mockExeca).toHaveBeenCalledWith('helm', [
|
|
56
|
+
'uninstall',
|
|
57
|
+
'ark-api',
|
|
58
|
+
'--ignore-not-found',
|
|
59
|
+
'--namespace',
|
|
60
|
+
'ark-system',
|
|
61
|
+
], {
|
|
62
|
+
stdio: 'inherit',
|
|
63
|
+
});
|
|
64
|
+
expect(mockOutput.success).toHaveBeenCalledWith('ark-api uninstalled successfully');
|
|
65
|
+
});
|
|
66
|
+
it('shows error when service not found', async () => {
|
|
67
|
+
mockGetInstallableServices.mockReturnValue({
|
|
68
|
+
'ark-api': { name: 'ark-api' },
|
|
69
|
+
'ark-controller': { name: 'ark-controller' },
|
|
70
|
+
});
|
|
71
|
+
const command = createUninstallCommand({});
|
|
72
|
+
await expect(command.parseAsync(['node', 'test', 'invalid-service'])).rejects.toThrow('process.exit called');
|
|
73
|
+
expect(mockOutput.error).toHaveBeenCalledWith("service 'invalid-service' not found");
|
|
74
|
+
expect(mockOutput.info).toHaveBeenCalledWith('available services:');
|
|
75
|
+
expect(mockOutput.info).toHaveBeenCalledWith(' ark-api');
|
|
76
|
+
expect(mockOutput.info).toHaveBeenCalledWith(' ark-controller');
|
|
77
|
+
expect(mockExit).toHaveBeenCalledWith(1);
|
|
78
|
+
});
|
|
79
|
+
it('handles service without namespace (uses current context)', async () => {
|
|
80
|
+
const mockService = {
|
|
81
|
+
name: 'ark-dashboard',
|
|
82
|
+
helmReleaseName: 'ark-dashboard',
|
|
83
|
+
// namespace is undefined - should use current context
|
|
84
|
+
};
|
|
85
|
+
mockGetInstallableServices.mockReturnValue({
|
|
86
|
+
'ark-dashboard': mockService,
|
|
87
|
+
});
|
|
88
|
+
const command = createUninstallCommand({});
|
|
89
|
+
await command.parseAsync(['node', 'test', 'ark-dashboard']);
|
|
90
|
+
// Should NOT include --namespace flag
|
|
91
|
+
expect(mockExeca).toHaveBeenCalledWith('helm', ['uninstall', 'ark-dashboard', '--ignore-not-found'], {
|
|
92
|
+
stdio: 'inherit',
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
it('handles helm uninstall error gracefully', async () => {
|
|
96
|
+
const mockService = {
|
|
97
|
+
name: 'ark-api',
|
|
98
|
+
helmReleaseName: 'ark-api',
|
|
99
|
+
namespace: 'ark-system',
|
|
100
|
+
};
|
|
101
|
+
mockGetInstallableServices.mockReturnValue({
|
|
102
|
+
'ark-api': mockService,
|
|
103
|
+
});
|
|
104
|
+
mockExeca.mockRejectedValue(new Error('helm failed'));
|
|
105
|
+
const command = createUninstallCommand({});
|
|
106
|
+
await expect(command.parseAsync(['node', 'test', 'ark-api'])).rejects.toThrow('process.exit called');
|
|
107
|
+
expect(mockOutput.error).toHaveBeenCalledWith('failed to uninstall ark-api');
|
|
108
|
+
expect(mockExit).toHaveBeenCalledWith(1);
|
|
109
|
+
});
|
|
110
|
+
it('exits when cluster not connected', async () => {
|
|
111
|
+
mockGetClusterInfo.mockResolvedValue({ error: true });
|
|
112
|
+
const command = createUninstallCommand({});
|
|
113
|
+
await expect(command.parseAsync(['node', 'test', 'ark-api'])).rejects.toThrow('process.exit called');
|
|
114
|
+
expect(mockOutput.error).toHaveBeenCalledWith('no kubernetes cluster detected');
|
|
115
|
+
expect(mockExit).toHaveBeenCalledWith(1);
|
|
116
|
+
});
|
|
117
|
+
});
|
|
@@ -8,10 +8,10 @@ import { marked } from 'marked';
|
|
|
8
8
|
// @ts-ignore - no types available
|
|
9
9
|
import TerminalRenderer from 'marked-terminal';
|
|
10
10
|
import { ChatClient, } from '../lib/chatClient.js';
|
|
11
|
-
import { AgentSelector } from '../
|
|
12
|
-
import { ModelSelector } from '../
|
|
13
|
-
import { TeamSelector } from '../
|
|
14
|
-
import { ToolSelector } from '../
|
|
11
|
+
import { AgentSelector } from '../ui/AgentSelector.js';
|
|
12
|
+
import { ModelSelector } from '../ui/ModelSelector.js';
|
|
13
|
+
import { TeamSelector } from '../ui/TeamSelector.js';
|
|
14
|
+
import { ToolSelector } from '../ui/ToolSelector.js';
|
|
15
15
|
// Generate a unique ID for messages
|
|
16
16
|
let messageIdCounter = 0;
|
|
17
17
|
const generateMessageId = () => {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { StatusData, CommandVersionConfig } from '../lib/types.js';
|
|
2
|
-
import { ArkClient } from '../lib/arkClient.js';
|
|
3
2
|
export declare const getNodeVersion: () => CommandVersionConfig;
|
|
4
3
|
export declare const getNpmVersion: () => CommandVersionConfig;
|
|
5
4
|
export declare const getKubectlVersion: () => CommandVersionConfig;
|
|
@@ -8,13 +7,15 @@ export declare const getHelmVersion: () => CommandVersionConfig;
|
|
|
8
7
|
export declare const getMinikubeVersion: () => CommandVersionConfig;
|
|
9
8
|
export declare const getKindVersion: () => CommandVersionConfig;
|
|
10
9
|
export declare class StatusChecker {
|
|
11
|
-
private arkClient;
|
|
12
|
-
private kubernetesManager;
|
|
13
|
-
constructor(arkClient: ArkClient);
|
|
14
10
|
/**
|
|
15
11
|
* Get version of a command
|
|
16
12
|
*/
|
|
17
13
|
private getCommandVersion;
|
|
14
|
+
/**
|
|
15
|
+
* Check combined deployment and helm status
|
|
16
|
+
* Gets health from deployment, version/revision from Helm
|
|
17
|
+
*/
|
|
18
|
+
private checkCombinedStatus;
|
|
18
19
|
/**
|
|
19
20
|
* Check deployment status
|
|
20
21
|
*/
|
|
@@ -23,14 +24,6 @@ export declare class StatusChecker {
|
|
|
23
24
|
* Check helm release status (fallback for services without deployments)
|
|
24
25
|
*/
|
|
25
26
|
private checkHelmStatus;
|
|
26
|
-
/**
|
|
27
|
-
* Return a "not installed" status for a service
|
|
28
|
-
*/
|
|
29
|
-
private createNotInstalledStatus;
|
|
30
|
-
/**
|
|
31
|
-
* Check Kubernetes service health via pods and endpoints
|
|
32
|
-
*/
|
|
33
|
-
private checkKubernetesService;
|
|
34
27
|
/**
|
|
35
28
|
* Check system dependencies
|
|
36
29
|
*/
|