@agents-at-scale/ark 0.1.34 → 0.1.35-rc.1
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 +50 -0
- package/dist/arkServices.js +153 -0
- package/dist/charts/charts.d.ts +5 -0
- package/dist/charts/charts.js +6 -0
- package/dist/charts/dependencies.d.ts +6 -0
- package/dist/charts/dependencies.js +50 -0
- package/dist/charts/types.d.ts +40 -0
- package/dist/charts/types.js +1 -0
- package/dist/commands/agents/index.d.ts +2 -0
- package/dist/commands/agents/index.js +56 -0
- package/dist/commands/agents/selector.d.ts +8 -0
- package/dist/commands/agents/selector.js +53 -0
- package/dist/commands/agents.d.ts +2 -0
- package/dist/commands/agents.js +53 -0
- package/dist/commands/chat/index.d.ts +2 -0
- package/dist/commands/chat/index.js +45 -0
- package/dist/commands/chat.d.ts +2 -0
- package/dist/commands/chat.js +45 -0
- package/dist/commands/cluster/get.d.ts +2 -0
- package/dist/commands/cluster/get.js +39 -0
- package/dist/commands/cluster/index.js +2 -4
- package/dist/commands/completion/index.d.ts +2 -0
- package/dist/commands/completion/index.js +268 -0
- package/dist/commands/completion.js +159 -2
- package/dist/commands/config/index.d.ts +2 -0
- package/dist/commands/config/index.js +42 -0
- package/dist/commands/config.d.ts +0 -3
- package/dist/commands/config.js +38 -321
- package/dist/commands/dashboard/index.d.ts +3 -0
- package/dist/commands/dashboard/index.js +39 -0
- package/dist/commands/dashboard.d.ts +3 -0
- package/dist/commands/dashboard.js +39 -0
- package/dist/commands/dev/index.d.ts +2 -0
- package/dist/commands/dev/index.js +9 -0
- package/dist/commands/dev/tool/check.d.ts +2 -0
- package/dist/commands/dev/tool/check.js +142 -0
- package/dist/commands/dev/tool/clean.d.ts +2 -0
- package/dist/commands/dev/tool/clean.js +153 -0
- package/dist/commands/dev/tool/generate.d.ts +2 -0
- package/dist/commands/dev/tool/generate.js +28 -0
- package/dist/commands/dev/tool/index.d.ts +2 -0
- package/dist/commands/dev/tool/index.js +14 -0
- package/dist/commands/dev/tool/init.d.ts +2 -0
- package/dist/commands/dev/tool/init.js +320 -0
- package/dist/commands/dev/tool/shared.d.ts +5 -0
- package/dist/commands/dev/tool/shared.js +256 -0
- package/dist/commands/dev/tool/status.d.ts +2 -0
- package/dist/commands/dev/tool/status.js +136 -0
- package/dist/commands/dev/tool.d.ts +2 -0
- package/dist/commands/dev/tool.js +559 -0
- package/dist/commands/generate/config.js +5 -24
- package/dist/commands/generate/generators/mcpserver.d.ts +2 -1
- package/dist/commands/generate/generators/mcpserver.js +26 -5
- package/dist/commands/install/index.d.ts +6 -0
- package/dist/commands/install/index.js +165 -0
- package/dist/commands/install.d.ts +3 -0
- package/dist/commands/install.js +147 -0
- package/dist/commands/models/create.d.ts +1 -0
- package/dist/commands/models/create.js +213 -0
- package/dist/commands/models/index.d.ts +2 -0
- package/dist/commands/models/index.js +65 -0
- package/dist/commands/models/selector.d.ts +8 -0
- package/dist/commands/models/selector.js +53 -0
- package/dist/commands/routes/index.d.ts +2 -0
- package/dist/commands/routes/index.js +101 -0
- package/dist/commands/routes.d.ts +2 -0
- package/dist/commands/routes.js +101 -0
- package/dist/commands/status/index.d.ts +3 -0
- package/dist/commands/status/index.js +33 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.js +33 -0
- package/dist/commands/targets/index.d.ts +2 -0
- package/dist/commands/targets/index.js +65 -0
- package/dist/commands/targets.d.ts +2 -0
- package/dist/commands/targets.js +65 -0
- package/dist/commands/teams/index.d.ts +2 -0
- package/dist/commands/teams/index.js +54 -0
- package/dist/commands/teams/selector.d.ts +8 -0
- package/dist/commands/teams/selector.js +55 -0
- package/dist/commands/tools/index.d.ts +2 -0
- package/dist/commands/tools/index.js +54 -0
- package/dist/commands/tools/selector.d.ts +8 -0
- package/dist/commands/tools/selector.js +53 -0
- package/dist/commands/uninstall/index.d.ts +2 -0
- package/dist/commands/uninstall/index.js +84 -0
- package/dist/commands/uninstall.d.ts +2 -0
- package/dist/commands/uninstall.js +83 -0
- package/dist/components/ChatUI.d.ts +16 -0
- package/dist/components/ChatUI.js +801 -0
- package/dist/components/StatusView.d.ts +10 -0
- package/dist/components/StatusView.js +39 -0
- package/dist/components/statusChecker.d.ts +10 -13
- package/dist/components/statusChecker.js +128 -65
- package/dist/config.js +3 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.js +31 -36
- package/dist/lib/arkApiClient.d.ts +53 -0
- package/dist/lib/arkApiClient.js +102 -0
- package/dist/lib/arkApiProxy.d.ts +9 -0
- package/dist/lib/arkApiProxy.js +22 -0
- package/dist/lib/arkServiceProxy.d.ts +14 -0
- package/dist/lib/arkServiceProxy.js +93 -0
- package/dist/lib/arkStatus.d.ts +5 -0
- package/dist/lib/arkStatus.js +20 -0
- package/dist/lib/chatClient.d.ts +33 -0
- package/dist/lib/chatClient.js +101 -0
- package/dist/lib/cluster.d.ts +2 -1
- package/dist/lib/cluster.js +27 -3
- package/dist/lib/commandUtils.d.ts +4 -0
- package/dist/lib/commandUtils.js +18 -0
- package/dist/lib/commandUtils.test.d.ts +1 -0
- package/dist/lib/commandUtils.test.js +44 -0
- package/dist/lib/config.d.ts +24 -80
- package/dist/lib/config.js +68 -205
- package/dist/lib/config.test.d.ts +1 -0
- package/dist/lib/config.test.js +93 -0
- package/dist/lib/dev/tools/analyzer.d.ts +30 -0
- package/dist/lib/dev/tools/analyzer.js +190 -0
- package/dist/lib/dev/tools/discover_tools.py +392 -0
- package/dist/lib/dev/tools/mcp-types.d.ts +28 -0
- package/dist/lib/dev/tools/mcp-types.js +86 -0
- package/dist/lib/dev/tools/types.d.ts +50 -0
- package/dist/lib/dev/tools/types.js +1 -0
- package/dist/lib/output.d.ts +36 -0
- package/dist/lib/output.js +89 -0
- package/dist/lib/types.d.ts +8 -3
- package/dist/types/types.d.ts +40 -0
- package/dist/types/types.js +1 -0
- package/dist/ui/MainMenu.js +158 -90
- package/dist/ui/statusFormatter.d.ts +4 -1
- package/dist/ui/statusFormatter.js +91 -19
- package/package.json +16 -4
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
import { Box, Text, useInput } from 'ink';
|
|
4
|
+
export function ToolSelector({ arkApiClient, onSelect, onExit, }) {
|
|
5
|
+
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
6
|
+
const [tools, setTools] = useState([]);
|
|
7
|
+
const [loading, setLoading] = useState(true);
|
|
8
|
+
const [error, setError] = useState(null);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
arkApiClient
|
|
11
|
+
.getTools()
|
|
12
|
+
.then((fetchedTools) => {
|
|
13
|
+
setTools(fetchedTools);
|
|
14
|
+
setLoading(false);
|
|
15
|
+
})
|
|
16
|
+
.catch((err) => {
|
|
17
|
+
setError(err.message || 'Failed to fetch tools');
|
|
18
|
+
setLoading(false);
|
|
19
|
+
});
|
|
20
|
+
}, [arkApiClient]);
|
|
21
|
+
useInput((input, key) => {
|
|
22
|
+
if (key.escape) {
|
|
23
|
+
onExit();
|
|
24
|
+
}
|
|
25
|
+
else if (key.upArrow || input === 'k') {
|
|
26
|
+
setSelectedIndex((prev) => (prev === 0 ? tools.length - 1 : prev - 1));
|
|
27
|
+
}
|
|
28
|
+
else if (key.downArrow || input === 'j') {
|
|
29
|
+
setSelectedIndex((prev) => (prev === tools.length - 1 ? 0 : prev + 1));
|
|
30
|
+
}
|
|
31
|
+
else if (key.return) {
|
|
32
|
+
onSelect(tools[selectedIndex]);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
// Handle number keys for quick selection
|
|
36
|
+
const num = parseInt(input, 10);
|
|
37
|
+
if (!isNaN(num) && num >= 1 && num <= tools.length) {
|
|
38
|
+
onSelect(tools[num - 1]);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
if (loading) {
|
|
43
|
+
return (_jsx(Box, { children: _jsx(Text, { children: "Loading tools..." }) }));
|
|
44
|
+
}
|
|
45
|
+
if (error) {
|
|
46
|
+
return (_jsx(Box, { children: _jsxs(Text, { color: "red", children: ["Error: ", error] }) }));
|
|
47
|
+
}
|
|
48
|
+
if (tools.length === 0) {
|
|
49
|
+
return (_jsx(Box, { children: _jsx(Text, { children: "No tools available" }) }));
|
|
50
|
+
}
|
|
51
|
+
const selectedTool = tools[selectedIndex];
|
|
52
|
+
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: "gray", paddingX: 2, paddingY: 1, children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { bold: true, children: "Select Tool" }) }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { dimColor: true, children: "Choose a tool to start a conversation with" }) }), _jsx(Box, { flexDirection: "column", children: tools.map((tool, index) => (_jsx(Box, { marginBottom: 0, children: _jsxs(Text, { color: index === selectedIndex ? 'green' : undefined, children: [index === selectedIndex ? '❯ ' : ' ', index + 1, ". ", tool.name] }) }, tool.name))) }), selectedTool && selectedTool.description && (_jsx(Box, { marginTop: 1, paddingLeft: 2, children: _jsx(Text, { dimColor: true, wrap: "wrap", children: selectedTool.description }) })), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: "Enter to confirm \u00B7 Number to select \u00B7 Esc to exit" }) })] }));
|
|
53
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { execa } from 'execa';
|
|
4
|
+
import inquirer from 'inquirer';
|
|
5
|
+
import { isCommandAvailable } from '../../lib/commandUtils.js';
|
|
6
|
+
import { getClusterInfo } from '../../lib/cluster.js';
|
|
7
|
+
import output from '../../lib/output.js';
|
|
8
|
+
import { getInstallableServices } from '../../arkServices.js';
|
|
9
|
+
async function uninstallArk(options = {}) {
|
|
10
|
+
// Check if helm is installed
|
|
11
|
+
const helmInstalled = await isCommandAvailable('helm');
|
|
12
|
+
if (!helmInstalled) {
|
|
13
|
+
output.error('helm is not installed. please install helm first:');
|
|
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);
|
|
23
|
+
}
|
|
24
|
+
// Check cluster connectivity
|
|
25
|
+
const clusterInfo = await getClusterInfo();
|
|
26
|
+
if (clusterInfo.error) {
|
|
27
|
+
output.error('no kubernetes cluster detected');
|
|
28
|
+
output.info('please ensure you have a running cluster and kubectl is configured.');
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
// Show cluster info
|
|
32
|
+
output.success(`connected to cluster: ${chalk.bold(clusterInfo.context)}`);
|
|
33
|
+
output.info(`type: ${clusterInfo.type}`);
|
|
34
|
+
output.info(`namespace: ${clusterInfo.namespace}`);
|
|
35
|
+
if (clusterInfo.ip) {
|
|
36
|
+
output.info(`ip: ${clusterInfo.ip}`);
|
|
37
|
+
}
|
|
38
|
+
console.log(); // Add blank line after cluster info
|
|
39
|
+
// Get installable services and iterate through them in reverse order for clean uninstall
|
|
40
|
+
const services = getInstallableServices();
|
|
41
|
+
const serviceEntries = Object.entries(services).reverse();
|
|
42
|
+
for (const [, service] of serviceEntries) {
|
|
43
|
+
// Ask for confirmation
|
|
44
|
+
const shouldUninstall = options.yes || (await inquirer.prompt([
|
|
45
|
+
{
|
|
46
|
+
type: 'confirm',
|
|
47
|
+
name: 'shouldUninstall',
|
|
48
|
+
message: `uninstall ${chalk.bold(service.name)}? ${service.description ? chalk.gray(`(${service.description.toLowerCase()})`) : ''}`,
|
|
49
|
+
default: true,
|
|
50
|
+
},
|
|
51
|
+
])).shouldUninstall;
|
|
52
|
+
if (!shouldUninstall) {
|
|
53
|
+
output.warning(`skipping ${service.name}`);
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
// Uninstall the release
|
|
58
|
+
await execa('helm', [
|
|
59
|
+
'uninstall',
|
|
60
|
+
service.helmReleaseName,
|
|
61
|
+
'--namespace',
|
|
62
|
+
service.namespace,
|
|
63
|
+
'--ignore-not-found',
|
|
64
|
+
], {
|
|
65
|
+
stdio: 'inherit',
|
|
66
|
+
});
|
|
67
|
+
console.log(); // Add blank line after command output
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
// Continue with remaining charts on error
|
|
71
|
+
console.log(); // Add blank line after error output
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
export function createUninstallCommand() {
|
|
76
|
+
const command = new Command('uninstall');
|
|
77
|
+
command
|
|
78
|
+
.description('Uninstall ARK components using Helm')
|
|
79
|
+
.option('-y, --yes', 'automatically confirm all uninstallations')
|
|
80
|
+
.action(async (options) => {
|
|
81
|
+
await uninstallArk(options);
|
|
82
|
+
});
|
|
83
|
+
return command;
|
|
84
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { execa } from 'execa';
|
|
4
|
+
import inquirer from 'inquirer';
|
|
5
|
+
import { isCommandAvailable } from '../lib/commandUtils.js';
|
|
6
|
+
import { getClusterInfo } from '../lib/cluster.js';
|
|
7
|
+
import output from '../lib/output.js';
|
|
8
|
+
import { getInstallableServices } from '../arkServices.js';
|
|
9
|
+
async function uninstallArk() {
|
|
10
|
+
// Check if helm is installed
|
|
11
|
+
const helmInstalled = await isCommandAvailable('helm');
|
|
12
|
+
if (!helmInstalled) {
|
|
13
|
+
output.error('helm is not installed. please install helm first:');
|
|
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);
|
|
23
|
+
}
|
|
24
|
+
// Check cluster connectivity
|
|
25
|
+
const clusterInfo = await getClusterInfo();
|
|
26
|
+
if (clusterInfo.error) {
|
|
27
|
+
output.error('no kubernetes cluster detected');
|
|
28
|
+
output.info('please ensure you have a running cluster and kubectl is configured.');
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
// Show cluster info
|
|
32
|
+
output.success(`connected to cluster: ${chalk.bold(clusterInfo.context)}`);
|
|
33
|
+
output.info(`type: ${clusterInfo.type}`);
|
|
34
|
+
output.info(`namespace: ${clusterInfo.namespace}`);
|
|
35
|
+
if (clusterInfo.ip) {
|
|
36
|
+
output.info(`ip: ${clusterInfo.ip}`);
|
|
37
|
+
}
|
|
38
|
+
console.log(); // Add blank line after cluster info
|
|
39
|
+
// Get installable services and iterate through them in reverse order for clean uninstall
|
|
40
|
+
const services = getInstallableServices();
|
|
41
|
+
const serviceEntries = Object.entries(services).reverse();
|
|
42
|
+
for (const [, service] of serviceEntries) {
|
|
43
|
+
// Ask for confirmation
|
|
44
|
+
const { shouldUninstall } = await inquirer.prompt([
|
|
45
|
+
{
|
|
46
|
+
type: 'confirm',
|
|
47
|
+
name: 'shouldUninstall',
|
|
48
|
+
message: `uninstall ${chalk.bold(service.name)}? ${service.description ? chalk.gray(`(${service.description.toLowerCase()})`) : ''}`,
|
|
49
|
+
default: true,
|
|
50
|
+
},
|
|
51
|
+
]);
|
|
52
|
+
if (!shouldUninstall) {
|
|
53
|
+
output.warning(`skipping ${service.name}`);
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
// Uninstall the release
|
|
58
|
+
await execa('helm', [
|
|
59
|
+
'uninstall',
|
|
60
|
+
service.helmReleaseName,
|
|
61
|
+
'--namespace',
|
|
62
|
+
service.namespace,
|
|
63
|
+
'--ignore-not-found',
|
|
64
|
+
], {
|
|
65
|
+
stdio: 'inherit',
|
|
66
|
+
});
|
|
67
|
+
console.log(); // Add blank line after command output
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
// Continue with remaining charts on error
|
|
71
|
+
console.log(); // Add blank line after error output
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
export function createUninstallCommand() {
|
|
76
|
+
const command = new Command('uninstall');
|
|
77
|
+
command
|
|
78
|
+
.description('Uninstall ARK components using Helm')
|
|
79
|
+
.action(async () => {
|
|
80
|
+
await uninstallArk();
|
|
81
|
+
});
|
|
82
|
+
return command;
|
|
83
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ArkApiClient } from '../lib/arkApiClient.js';
|
|
3
|
+
import { ArkApiProxy } from '../lib/arkApiProxy.js';
|
|
4
|
+
interface ChatUIProps {
|
|
5
|
+
initialTargetId?: string;
|
|
6
|
+
arkApiClient: ArkApiClient;
|
|
7
|
+
arkApiProxy: ArkApiProxy;
|
|
8
|
+
config?: {
|
|
9
|
+
chat?: {
|
|
10
|
+
streaming?: boolean;
|
|
11
|
+
outputFormat?: 'text' | 'markdown';
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
declare const ChatUI: React.FC<ChatUIProps>;
|
|
16
|
+
export default ChatUI;
|