@agents-at-scale/ark 0.1.35-rc1 → 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.
- package/dist/commands/cluster/index.d.ts +1 -2
- package/dist/commands/cluster/index.js +5 -3
- package/dist/commands/completion.js +2 -159
- package/dist/commands/config.d.ts +3 -0
- package/dist/commands/config.js +321 -38
- package/dist/commands/generate/config.js +24 -5
- package/dist/commands/generate/generators/agent.js +2 -2
- package/dist/commands/generate/generators/mcpserver.d.ts +1 -2
- package/dist/commands/generate/generators/mcpserver.js +5 -26
- package/dist/commands/generate/generators/project.js +41 -22
- package/dist/commands/generate/generators/team.js +2 -2
- package/dist/commands/generate/index.d.ts +1 -2
- package/dist/commands/generate/index.js +1 -1
- package/dist/components/statusChecker.d.ts +23 -13
- package/dist/components/statusChecker.js +129 -275
- package/dist/config.d.ts +22 -3
- package/dist/config.js +161 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.js +42 -40
- package/dist/lib/cluster.d.ts +1 -2
- package/dist/lib/cluster.js +16 -37
- package/dist/lib/config.d.ts +80 -26
- package/dist/lib/config.js +205 -70
- package/dist/lib/consts.d.ts +1 -0
- package/dist/lib/consts.js +2 -0
- package/dist/lib/errors.js +1 -1
- package/dist/lib/exec.d.ts +4 -0
- package/dist/lib/exec.js +11 -0
- package/dist/lib/types.d.ts +3 -10
- package/dist/ui/MainMenu.d.ts +1 -5
- package/dist/ui/MainMenu.js +91 -222
- package/dist/ui/statusFormatter.d.ts +7 -22
- package/dist/ui/statusFormatter.js +39 -39
- package/package.json +5 -17
- package/dist/arkServices.d.ts +0 -42
- package/dist/arkServices.js +0 -138
- package/dist/arkServices.spec.d.ts +0 -1
- package/dist/arkServices.spec.js +0 -24
- package/dist/charts/charts.d.ts +0 -5
- package/dist/charts/charts.js +0 -6
- package/dist/charts/dependencies.d.ts +0 -6
- package/dist/charts/dependencies.js +0 -50
- package/dist/charts/types.d.ts +0 -40
- package/dist/charts/types.js +0 -1
- package/dist/commands/agents/index.d.ts +0 -3
- package/dist/commands/agents/index.js +0 -51
- package/dist/commands/agents/index.spec.d.ts +0 -1
- package/dist/commands/agents/index.spec.js +0 -67
- package/dist/commands/agents/selector.d.ts +0 -8
- package/dist/commands/agents/selector.js +0 -53
- package/dist/commands/agents.d.ts +0 -2
- package/dist/commands/agents.js +0 -53
- package/dist/commands/chat/index.d.ts +0 -3
- package/dist/commands/chat/index.js +0 -29
- package/dist/commands/chat.d.ts +0 -2
- package/dist/commands/chat.js +0 -45
- package/dist/commands/cluster/get.d.ts +0 -2
- package/dist/commands/cluster/get.js +0 -39
- package/dist/commands/cluster/get.spec.d.ts +0 -1
- package/dist/commands/cluster/get.spec.js +0 -92
- package/dist/commands/cluster/index.spec.d.ts +0 -1
- package/dist/commands/cluster/index.spec.js +0 -24
- package/dist/commands/completion/index.d.ts +0 -3
- package/dist/commands/completion/index.js +0 -268
- package/dist/commands/completion/index.spec.d.ts +0 -1
- package/dist/commands/completion/index.spec.js +0 -34
- package/dist/commands/config/index.d.ts +0 -3
- package/dist/commands/config/index.js +0 -42
- package/dist/commands/config/index.spec.d.ts +0 -1
- package/dist/commands/config/index.spec.js +0 -78
- package/dist/commands/dashboard/index.d.ts +0 -4
- package/dist/commands/dashboard/index.js +0 -39
- package/dist/commands/dashboard.d.ts +0 -3
- package/dist/commands/dashboard.js +0 -39
- package/dist/commands/dev/index.d.ts +0 -3
- package/dist/commands/dev/index.js +0 -9
- package/dist/commands/dev/tool/check.d.ts +0 -2
- package/dist/commands/dev/tool/check.js +0 -142
- package/dist/commands/dev/tool/clean.d.ts +0 -2
- package/dist/commands/dev/tool/clean.js +0 -153
- package/dist/commands/dev/tool/generate.d.ts +0 -2
- package/dist/commands/dev/tool/generate.js +0 -28
- package/dist/commands/dev/tool/index.d.ts +0 -2
- package/dist/commands/dev/tool/index.js +0 -14
- package/dist/commands/dev/tool/init.d.ts +0 -2
- package/dist/commands/dev/tool/init.js +0 -320
- package/dist/commands/dev/tool/shared.d.ts +0 -5
- package/dist/commands/dev/tool/shared.js +0 -256
- package/dist/commands/dev/tool/status.d.ts +0 -2
- package/dist/commands/dev/tool/status.js +0 -136
- package/dist/commands/dev/tool-generate.spec.d.ts +0 -1
- package/dist/commands/dev/tool-generate.spec.js +0 -163
- package/dist/commands/dev/tool.d.ts +0 -2
- package/dist/commands/dev/tool.js +0 -559
- package/dist/commands/dev/tool.spec.d.ts +0 -1
- package/dist/commands/dev/tool.spec.js +0 -48
- package/dist/commands/install/index.d.ts +0 -8
- package/dist/commands/install/index.js +0 -302
- package/dist/commands/install/index.spec.d.ts +0 -1
- package/dist/commands/install/index.spec.js +0 -135
- package/dist/commands/install.d.ts +0 -3
- package/dist/commands/install.js +0 -147
- package/dist/commands/models/create.d.ts +0 -1
- package/dist/commands/models/create.js +0 -213
- package/dist/commands/models/create.spec.d.ts +0 -1
- package/dist/commands/models/create.spec.js +0 -125
- package/dist/commands/models/index.d.ts +0 -3
- package/dist/commands/models/index.js +0 -60
- package/dist/commands/models/index.spec.d.ts +0 -1
- package/dist/commands/models/index.spec.js +0 -76
- package/dist/commands/models/selector.d.ts +0 -8
- package/dist/commands/models/selector.js +0 -53
- package/dist/commands/routes/index.d.ts +0 -3
- package/dist/commands/routes/index.js +0 -93
- package/dist/commands/routes.d.ts +0 -2
- package/dist/commands/routes.js +0 -101
- package/dist/commands/status/index.d.ts +0 -4
- package/dist/commands/status/index.js +0 -232
- package/dist/commands/status.d.ts +0 -3
- package/dist/commands/status.js +0 -33
- package/dist/commands/targets/index.d.ts +0 -3
- package/dist/commands/targets/index.js +0 -65
- package/dist/commands/targets/index.spec.d.ts +0 -1
- package/dist/commands/targets/index.spec.js +0 -105
- package/dist/commands/targets.d.ts +0 -2
- package/dist/commands/targets.js +0 -65
- package/dist/commands/teams/index.d.ts +0 -3
- package/dist/commands/teams/index.js +0 -49
- package/dist/commands/teams/index.spec.d.ts +0 -1
- package/dist/commands/teams/index.spec.js +0 -70
- package/dist/commands/teams/selector.d.ts +0 -8
- package/dist/commands/teams/selector.js +0 -55
- package/dist/commands/tools/index.d.ts +0 -3
- package/dist/commands/tools/index.js +0 -49
- package/dist/commands/tools/index.spec.d.ts +0 -1
- package/dist/commands/tools/index.spec.js +0 -70
- package/dist/commands/tools/selector.d.ts +0 -8
- package/dist/commands/tools/selector.js +0 -53
- package/dist/commands/uninstall/index.d.ts +0 -3
- package/dist/commands/uninstall/index.js +0 -107
- package/dist/commands/uninstall/index.spec.d.ts +0 -1
- package/dist/commands/uninstall/index.spec.js +0 -117
- package/dist/commands/uninstall.d.ts +0 -2
- package/dist/commands/uninstall.js +0 -83
- package/dist/components/ChatUI.d.ts +0 -16
- package/dist/components/ChatUI.js +0 -801
- package/dist/components/StatusView.d.ts +0 -10
- package/dist/components/StatusView.js +0 -39
- package/dist/lib/arkApiClient.d.ts +0 -53
- package/dist/lib/arkApiClient.js +0 -102
- package/dist/lib/arkApiProxy.d.ts +0 -9
- package/dist/lib/arkApiProxy.js +0 -22
- package/dist/lib/arkServiceProxy.d.ts +0 -14
- package/dist/lib/arkServiceProxy.js +0 -95
- package/dist/lib/arkStatus.d.ts +0 -10
- package/dist/lib/arkStatus.js +0 -79
- package/dist/lib/arkStatus.spec.d.ts +0 -1
- package/dist/lib/arkStatus.spec.js +0 -49
- package/dist/lib/chatClient.d.ts +0 -33
- package/dist/lib/chatClient.js +0 -99
- package/dist/lib/cluster.spec.d.ts +0 -1
- package/dist/lib/cluster.spec.js +0 -338
- package/dist/lib/commandUtils.d.ts +0 -4
- package/dist/lib/commandUtils.js +0 -18
- package/dist/lib/commandUtils.test.d.ts +0 -1
- package/dist/lib/commandUtils.test.js +0 -44
- package/dist/lib/commands.d.ts +0 -16
- package/dist/lib/commands.js +0 -29
- package/dist/lib/commands.spec.d.ts +0 -1
- package/dist/lib/commands.spec.js +0 -146
- package/dist/lib/config.spec.d.ts +0 -1
- package/dist/lib/config.spec.js +0 -99
- package/dist/lib/config.test.d.ts +0 -1
- package/dist/lib/config.test.js +0 -93
- package/dist/lib/consts.spec.d.ts +0 -1
- package/dist/lib/consts.spec.js +0 -15
- package/dist/lib/dev/tools/analyzer.d.ts +0 -30
- package/dist/lib/dev/tools/analyzer.js +0 -190
- package/dist/lib/dev/tools/discover_tools.py +0 -392
- package/dist/lib/dev/tools/mcp-types.d.ts +0 -28
- package/dist/lib/dev/tools/mcp-types.js +0 -86
- package/dist/lib/dev/tools/types.d.ts +0 -50
- package/dist/lib/dev/tools/types.js +0 -1
- package/dist/lib/errors.spec.d.ts +0 -1
- package/dist/lib/errors.spec.js +0 -221
- package/dist/lib/output.d.ts +0 -36
- package/dist/lib/output.js +0 -89
- package/dist/lib/output.spec.d.ts +0 -1
- package/dist/lib/output.spec.js +0 -123
- package/dist/lib/portUtils.d.ts +0 -8
- package/dist/lib/portUtils.js +0 -39
- package/dist/lib/startup.d.ts +0 -5
- package/dist/lib/startup.js +0 -73
- package/dist/lib/startup.spec.d.ts +0 -1
- package/dist/lib/startup.spec.js +0 -168
- package/dist/types/types.d.ts +0 -40
- package/dist/types/types.js +0 -1
- package/dist/ui/AgentSelector.d.ts +0 -8
- package/dist/ui/AgentSelector.js +0 -53
- package/dist/ui/ModelSelector.d.ts +0 -8
- package/dist/ui/ModelSelector.js +0 -53
- package/dist/ui/TeamSelector.d.ts +0 -8
- package/dist/ui/TeamSelector.js +0 -55
- package/dist/ui/ToolSelector.d.ts +0 -8
- package/dist/ui/ToolSelector.js +0 -53
- package/dist/ui/statusFormatter.spec.d.ts +0 -1
- package/dist/ui/statusFormatter.spec.js +0 -58
package/dist/ui/MainMenu.js
CHANGED
|
@@ -1,232 +1,70 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Text, Box,
|
|
3
|
-
import
|
|
2
|
+
import { Text, Box, useInput } from 'ink';
|
|
3
|
+
import SelectInput from 'ink-select-input';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
console.clear();
|
|
22
|
-
// Small delay to ensure everything is flushed
|
|
23
|
-
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
const MainMenu = ({ config }) => {
|
|
27
|
-
const [selectedIndex, setSelectedIndex] = React.useState(0);
|
|
28
|
-
const [arkReady, setArkReady] = React.useState(null);
|
|
29
|
-
const [isChecking, setIsChecking] = React.useState(true);
|
|
30
|
-
React.useEffect(() => {
|
|
31
|
-
const checkArkStatus = async () => {
|
|
32
|
-
setIsChecking(true);
|
|
33
|
-
const ready = await isArkReady();
|
|
34
|
-
setArkReady(ready);
|
|
35
|
-
setIsChecking(false);
|
|
36
|
-
// Reset selected index to 0 after status check
|
|
37
|
-
setSelectedIndex(0);
|
|
38
|
-
};
|
|
39
|
-
checkArkStatus();
|
|
40
|
-
}, []);
|
|
41
|
-
// Handle Ctrl+C to properly unmount Ink and restore terminal
|
|
42
|
-
React.useEffect(() => {
|
|
43
|
-
const handleExit = () => {
|
|
44
|
-
const app = globalThis.inkApp;
|
|
45
|
-
if (app) {
|
|
46
|
-
app.unmount();
|
|
47
|
-
}
|
|
48
|
-
process.exit(0);
|
|
49
|
-
};
|
|
50
|
-
process.on('SIGINT', handleExit);
|
|
51
|
-
return () => {
|
|
52
|
-
process.removeListener('SIGINT', handleExit);
|
|
53
|
-
};
|
|
54
|
-
}, []);
|
|
55
|
-
// Check if upgrade is available
|
|
56
|
-
const hasUpgrade = React.useMemo(() => {
|
|
57
|
-
if (!config.currentVersion || !config.latestVersion)
|
|
58
|
-
return false;
|
|
59
|
-
// Simple version comparison
|
|
60
|
-
return config.currentVersion !== config.latestVersion;
|
|
61
|
-
}, [config.currentVersion, config.latestVersion]);
|
|
62
|
-
const allChoices = [
|
|
63
|
-
{
|
|
64
|
-
label: 'Chat',
|
|
65
|
-
description: 'Interactive chat with Ark agents',
|
|
66
|
-
value: 'chat',
|
|
67
|
-
command: 'ark chat',
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
label: 'Install',
|
|
71
|
-
description: 'Install Ark',
|
|
72
|
-
value: 'install',
|
|
73
|
-
command: 'ark install',
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
label: 'Upgrade',
|
|
77
|
-
description: `Upgrade Ark from ${config.currentVersion} to ${config.latestVersion}`,
|
|
78
|
-
value: 'upgrade',
|
|
79
|
-
command: 'ark install -y',
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
label: 'Dashboard',
|
|
83
|
-
description: 'Open Ark dashboard in browser',
|
|
84
|
-
value: 'dashboard',
|
|
85
|
-
command: 'ark dashboard',
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
label: 'Status',
|
|
89
|
-
description: 'Check Ark services status',
|
|
90
|
-
value: 'status',
|
|
91
|
-
command: 'ark status',
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
label: 'Generate',
|
|
95
|
-
description: 'Generate new Ark components',
|
|
96
|
-
value: 'generate',
|
|
97
|
-
command: 'ark generate',
|
|
98
|
-
},
|
|
99
|
-
{ label: 'Exit', description: 'Exit Ark CLI', value: 'exit' },
|
|
5
|
+
import DashboardCLI from '../components/DashboardCLI.js';
|
|
6
|
+
import GeneratorUI from '../components/GeneratorUI.js';
|
|
7
|
+
import { StatusChecker } from '../components/statusChecker.js';
|
|
8
|
+
import { ConfigManager } from '../config.js';
|
|
9
|
+
import { ArkClient } from '../lib/arkClient.js';
|
|
10
|
+
const EXIT_TIMEOUT_MS = 1000;
|
|
11
|
+
const MainMenu = () => {
|
|
12
|
+
const [selectedChoice, setSelectedChoice] = React.useState(null);
|
|
13
|
+
const [statusData, setStatusData] = React.useState(null);
|
|
14
|
+
const [isLoading, setIsLoading] = React.useState(false);
|
|
15
|
+
const [error, setError] = React.useState(null);
|
|
16
|
+
const choices = [
|
|
17
|
+
{ label: '🏷️ Dashboard', value: 'dashboard' },
|
|
18
|
+
{ label: '🔍 Status Check', value: 'status' },
|
|
19
|
+
{ label: '🎯 Generate', value: 'generate' },
|
|
20
|
+
{ label: '👋 Exit', value: 'exit' },
|
|
100
21
|
];
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
// Only show Install, Status, and Exit when Ark is not ready
|
|
108
|
-
return allChoices.filter((choice) => ['install', 'status', 'exit'].includes(choice.value));
|
|
22
|
+
React.useEffect(() => {
|
|
23
|
+
if (selectedChoice === 'exit') {
|
|
24
|
+
const timer = setTimeout(() => {
|
|
25
|
+
process.exit(0);
|
|
26
|
+
}, EXIT_TIMEOUT_MS);
|
|
27
|
+
return () => clearTimeout(timer);
|
|
109
28
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
return false;
|
|
115
|
-
// Only show upgrade if there's actually an upgrade available
|
|
116
|
-
if (choice.value === 'upgrade' && !hasUpgrade)
|
|
117
|
-
return false;
|
|
118
|
-
return true;
|
|
119
|
-
});
|
|
120
|
-
return filteredChoices;
|
|
121
|
-
}, [arkReady, isChecking, hasUpgrade, allChoices]);
|
|
122
|
-
useInput((input, key) => {
|
|
123
|
-
// Don't process input while checking status
|
|
124
|
-
if (isChecking)
|
|
125
|
-
return;
|
|
126
|
-
if (key.upArrow || input === 'k') {
|
|
127
|
-
setSelectedIndex((prev) => (prev > 0 ? prev - 1 : choices.length - 1));
|
|
29
|
+
}, [selectedChoice]);
|
|
30
|
+
React.useEffect(() => {
|
|
31
|
+
if (selectedChoice === 'status' && !statusData && !isLoading) {
|
|
32
|
+
checkStatus();
|
|
128
33
|
}
|
|
129
|
-
|
|
130
|
-
|
|
34
|
+
}, [selectedChoice, statusData, isLoading]);
|
|
35
|
+
const checkStatus = async () => {
|
|
36
|
+
setIsLoading(true);
|
|
37
|
+
setError(null);
|
|
38
|
+
try {
|
|
39
|
+
const configManager = new ConfigManager();
|
|
40
|
+
const apiBaseUrl = await configManager.getApiBaseUrl();
|
|
41
|
+
const serviceUrls = await configManager.getServiceUrls();
|
|
42
|
+
const arkClient = new ArkClient(apiBaseUrl);
|
|
43
|
+
const statusChecker = new StatusChecker(arkClient);
|
|
44
|
+
const status = await statusChecker.checkAll(serviceUrls, apiBaseUrl);
|
|
45
|
+
setStatusData(status);
|
|
131
46
|
}
|
|
132
|
-
|
|
133
|
-
|
|
47
|
+
catch (err) {
|
|
48
|
+
setError(err instanceof Error ? err.message : 'Unknown error occurred');
|
|
134
49
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
const num = parseInt(input, 10);
|
|
138
|
-
if (!isNaN(num) && num >= 1 && num <= choices.length) {
|
|
139
|
-
handleSelect(choices[num - 1]);
|
|
140
|
-
}
|
|
50
|
+
finally {
|
|
51
|
+
setIsLoading(false);
|
|
141
52
|
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
// Unmount fullscreen app and clear screen.
|
|
150
|
-
await unmountInkApp();
|
|
151
|
-
// Import and start ChatUI in the same process
|
|
152
|
-
const { render } = await import('ink');
|
|
153
|
-
const { ArkApiProxy } = await import('../lib/arkApiProxy.js');
|
|
154
|
-
const ChatUI = (await import('../components/ChatUI.js')).default;
|
|
155
|
-
try {
|
|
156
|
-
const proxy = new ArkApiProxy();
|
|
157
|
-
const arkApiClient = await proxy.start();
|
|
158
|
-
// Render ChatUI as a new Ink app
|
|
159
|
-
render(_jsx(ChatUI, { arkApiClient: arkApiClient, arkApiProxy: proxy }));
|
|
160
|
-
}
|
|
161
|
-
catch (error) {
|
|
162
|
-
const output = (await import('../lib/output.js')).default;
|
|
163
|
-
output.error(error instanceof Error
|
|
164
|
-
? error.message
|
|
165
|
-
: 'Failed to connect to Ark API');
|
|
166
|
-
process.exit(1);
|
|
167
|
-
}
|
|
168
|
-
break;
|
|
169
|
-
}
|
|
170
|
-
case 'install': {
|
|
171
|
-
// Unmount fullscreen app and clear screen.
|
|
172
|
-
await unmountInkApp();
|
|
173
|
-
// Spawn as a new process to avoid Ink/inquirer signal conflicts
|
|
174
|
-
const { execFileSync } = await import('child_process');
|
|
175
|
-
try {
|
|
176
|
-
execFileSync(process.execPath, [process.argv[1], 'install'], {
|
|
177
|
-
stdio: 'inherit',
|
|
178
|
-
env: { ...process.env, FORCE_COLOR: '1' },
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
catch (error) {
|
|
182
|
-
// execFileSync throws if the process exits with non-zero
|
|
183
|
-
process.exit(error.status || 1);
|
|
184
|
-
}
|
|
185
|
-
process.exit(0);
|
|
186
|
-
break; // Add break even though process.exit prevents reaching here
|
|
187
|
-
}
|
|
188
|
-
case 'upgrade': {
|
|
189
|
-
// Unmount fullscreen app and clear screen.
|
|
190
|
-
await unmountInkApp();
|
|
191
|
-
// Spawn as a new process with -y flag for automatic upgrade
|
|
192
|
-
const { execFileSync } = await import('child_process');
|
|
193
|
-
try {
|
|
194
|
-
execFileSync(process.execPath, [process.argv[1], 'install', '-y'], {
|
|
195
|
-
stdio: 'inherit',
|
|
196
|
-
env: { ...process.env, FORCE_COLOR: '1' },
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
catch (error) {
|
|
200
|
-
// execFileSync throws if the process exits with non-zero
|
|
201
|
-
process.exit(error.status || 1);
|
|
53
|
+
};
|
|
54
|
+
useInput((input, key) => {
|
|
55
|
+
if (selectedChoice && selectedChoice !== 'exit') {
|
|
56
|
+
if (key.escape || input === 'q' || key.return) {
|
|
57
|
+
// For generate, only reset on specific key combinations to avoid conflicts
|
|
58
|
+
if (selectedChoice === 'generate' && !(key.escape || input === 'q')) {
|
|
59
|
+
return;
|
|
202
60
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
case 'dashboard': {
|
|
207
|
-
// Unmount fullscreen app and clear screen.
|
|
208
|
-
await unmountInkApp();
|
|
209
|
-
const { openDashboard } = await import('../commands/dashboard/index.js');
|
|
210
|
-
await openDashboard();
|
|
211
|
-
break;
|
|
212
|
-
}
|
|
213
|
-
case 'status': {
|
|
214
|
-
// Unmount fullscreen app and clear screen.
|
|
215
|
-
await unmountInkApp();
|
|
216
|
-
const { checkStatus } = await import('../commands/status/index.js');
|
|
217
|
-
await checkStatus(config);
|
|
218
|
-
process.exit(0);
|
|
219
|
-
break; // Add break even though process.exit prevents reaching here
|
|
220
|
-
}
|
|
221
|
-
case 'generate': {
|
|
222
|
-
const GeneratorUI = (await import('../components/GeneratorUI.js'))
|
|
223
|
-
.default;
|
|
224
|
-
render(_jsx(GeneratorUI, {}));
|
|
225
|
-
break;
|
|
61
|
+
setSelectedChoice(null);
|
|
62
|
+
setStatusData(null);
|
|
63
|
+
setError(null);
|
|
226
64
|
}
|
|
227
65
|
}
|
|
228
|
-
};
|
|
229
|
-
|
|
66
|
+
});
|
|
67
|
+
const renderBanner = () => (_jsxs(Box, { flexDirection: "column", alignItems: "center", marginBottom: 1, children: [_jsx(Text, { color: "cyan", bold: true, children: `
|
|
230
68
|
╔═══════════════════════════════════════╗
|
|
231
69
|
║ ║
|
|
232
70
|
║ █████╗ ██████╗ ██╗ ██╗ ║
|
|
@@ -239,9 +77,40 @@ const MainMenu = ({ config }) => {
|
|
|
239
77
|
║ Agents at Scale Platform ║
|
|
240
78
|
║ ║
|
|
241
79
|
╚═══════════════════════════════════════╝
|
|
242
|
-
` }),
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
80
|
+
` }), _jsx(Text, { color: "green", bold: true, children: "Welcome to ARK! \uD83D\uDE80" }), _jsx(Text, { color: "gray", children: "Interactive terminal interface for ARK agents" })] }));
|
|
81
|
+
const renderServiceStatus = (service) => {
|
|
82
|
+
const statusColor = service.status === 'healthy'
|
|
83
|
+
? 'green'
|
|
84
|
+
: service.status === 'unhealthy'
|
|
85
|
+
? 'red'
|
|
86
|
+
: 'yellow';
|
|
87
|
+
const statusIcon = service.status === 'healthy'
|
|
88
|
+
? '✓'
|
|
89
|
+
: service.status === 'unhealthy'
|
|
90
|
+
? '✗'
|
|
91
|
+
: '?';
|
|
92
|
+
return (_jsxs(Box, { flexDirection: "column", marginLeft: 2, children: [_jsxs(Box, { children: [_jsxs(Text, { color: statusColor, children: [statusIcon, " "] }), _jsxs(Text, { bold: true, children: [service.name, ": "] }), _jsx(Text, { color: statusColor, children: service.status })] }), service.url && (_jsx(Box, { marginLeft: 2, children: _jsxs(Text, { color: "gray", children: ["URL: ", service.url] }) })), service.details && (_jsx(Box, { marginLeft: 2, children: _jsx(Text, { color: "gray", children: service.details }) }))] }, service.name));
|
|
93
|
+
};
|
|
94
|
+
const renderDependencyStatus = (dep) => {
|
|
95
|
+
const statusColor = dep.installed ? 'green' : 'red';
|
|
96
|
+
const statusIcon = dep.installed ? '✓' : '✗';
|
|
97
|
+
const statusText = dep.installed ? 'installed' : 'missing';
|
|
98
|
+
return (_jsxs(Box, { flexDirection: "column", marginLeft: 2, children: [_jsxs(Box, { children: [_jsxs(Text, { color: statusColor, children: [statusIcon, " "] }), _jsxs(Text, { bold: true, children: [dep.name, ": "] }), _jsx(Text, { color: statusColor, children: statusText })] }), dep.version && (_jsx(Box, { marginLeft: 2, children: _jsxs(Text, { color: "gray", children: ["Version: ", dep.version] }) })), dep.details && (_jsx(Box, { marginLeft: 2, children: _jsx(Text, { color: "gray", children: dep.details }) }))] }, dep.name));
|
|
99
|
+
};
|
|
100
|
+
const renderStatus = () => {
|
|
101
|
+
if (isLoading) {
|
|
102
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: "yellow", children: "\uD83D\uDD0D Checking ARK system status..." }), _jsx(Text, { color: "gray", children: "Please wait while we verify services and dependencies." })] }));
|
|
103
|
+
}
|
|
104
|
+
if (error) {
|
|
105
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: "red", children: "\u274C Error checking status:" }), _jsx(Text, { color: "red", children: error }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "gray", children: "Press ESC, 'q', or Enter to return to menu..." }) })] }));
|
|
106
|
+
}
|
|
107
|
+
if (!statusData) {
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: "cyan", bold: true, children: "\uD83D\uDD0D ARK System Status" }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "cyan", bold: true, children: "\uD83D\uDCE1 ARK Services:" }) }), statusData.services.map(renderServiceStatus), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "cyan", bold: true, children: "\uD83D\uDEE0\uFE0F System Dependencies:" }) }), statusData.dependencies.map(renderDependencyStatus), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "gray", children: "Press ESC, 'q', or Enter to return to menu..." }) })] }));
|
|
111
|
+
};
|
|
112
|
+
return (_jsxs(_Fragment, { children: [renderBanner(), !selectedChoice && (_jsx(SelectInput, { items: choices, onSelect: (choice) => {
|
|
113
|
+
setSelectedChoice(choice.value);
|
|
114
|
+
} })), selectedChoice === 'status' && renderStatus(), selectedChoice === 'dashboard' && (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: "green", children: "\uD83C\uDFF7\uFE0F Dashboard feature selected" }), _jsx(DashboardCLI, {})] })), selectedChoice === 'generate' && _jsx(GeneratorUI, {}), selectedChoice === 'exit' && _jsx(Text, { color: "yellow", children: "\uD83D\uDC4B Goodbye!" })] }));
|
|
246
115
|
};
|
|
247
116
|
export default MainMenu;
|
|
@@ -1,24 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
export interface StatusLine {
|
|
3
|
-
icon: string;
|
|
4
|
-
iconColor?: StatusColor;
|
|
5
|
-
status: string;
|
|
6
|
-
statusColor?: StatusColor;
|
|
7
|
-
name: string;
|
|
8
|
-
nameColor?: StatusColor;
|
|
9
|
-
details?: string;
|
|
10
|
-
subtext?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface StatusSection {
|
|
13
|
-
title: string;
|
|
14
|
-
lines: StatusLine[];
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Simple status formatter that just formats sections and lines
|
|
18
|
-
* The caller is responsible for deciding what to show
|
|
19
|
-
*/
|
|
1
|
+
import { StatusData } from '../lib/types.js';
|
|
20
2
|
export declare class StatusFormatter {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Print status check results to console
|
|
5
|
+
*/
|
|
6
|
+
static printStatus(statusData: StatusData): void;
|
|
7
|
+
private static printService;
|
|
8
|
+
private static printDependency;
|
|
24
9
|
}
|
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
|
-
/**
|
|
3
|
-
* Simple status formatter that just formats sections and lines
|
|
4
|
-
* The caller is responsible for deciding what to show
|
|
5
|
-
*/
|
|
6
2
|
export class StatusFormatter {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Print status check results to console
|
|
5
|
+
*/
|
|
6
|
+
static printStatus(statusData) {
|
|
7
|
+
console.log(chalk.cyan.bold('\n🔍 ARK System Status Check'));
|
|
8
|
+
console.log(chalk.gray('Checking ARK services and dependencies...\n'));
|
|
9
|
+
// Print services status
|
|
10
|
+
console.log(chalk.cyan.bold('📡 ARK Services:'));
|
|
11
|
+
for (const service of statusData.services) {
|
|
12
|
+
StatusFormatter.printService(service);
|
|
13
|
+
}
|
|
14
|
+
// Print dependencies status
|
|
15
|
+
console.log(chalk.cyan.bold('\n🛠️ System Dependencies:'));
|
|
16
|
+
for (const dep of statusData.dependencies) {
|
|
17
|
+
StatusFormatter.printDependency(dep);
|
|
18
|
+
}
|
|
16
19
|
console.log();
|
|
17
20
|
}
|
|
18
|
-
static
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
static printService(service) {
|
|
22
|
+
const statusColor = service.status === 'healthy'
|
|
23
|
+
? chalk.green('✓ healthy')
|
|
24
|
+
: service.status === 'unhealthy'
|
|
25
|
+
? chalk.red('✗ unhealthy')
|
|
26
|
+
: chalk.yellow('? not installed');
|
|
27
|
+
console.log(` • ${chalk.bold(service.name)}: ${statusColor}`);
|
|
28
|
+
if (service.url) {
|
|
29
|
+
console.log(` ${chalk.gray(`URL: ${service.url}`)}`);
|
|
30
|
+
}
|
|
31
|
+
if (service.details) {
|
|
32
|
+
console.log(` ${chalk.gray(service.details)}`);
|
|
33
|
+
}
|
|
31
34
|
}
|
|
32
|
-
static
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
`
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
console.log(parts.join(' '));
|
|
43
|
-
if (line.subtext) {
|
|
44
|
-
console.log(` ${chalk.gray(line.subtext)}`);
|
|
35
|
+
static printDependency(dep) {
|
|
36
|
+
const statusColor = dep.installed
|
|
37
|
+
? chalk.green('✓ installed')
|
|
38
|
+
: chalk.red('✗ missing');
|
|
39
|
+
console.log(` • ${chalk.bold(dep.name)}: ${statusColor}`);
|
|
40
|
+
if (dep.version) {
|
|
41
|
+
console.log(` ${chalk.gray(`Version: ${dep.version}`)}`);
|
|
42
|
+
}
|
|
43
|
+
if (dep.details) {
|
|
44
|
+
console.log(` ${chalk.gray(dep.details)}`);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agents-at-scale/ark",
|
|
3
|
-
"version": "0.1.35
|
|
3
|
+
"version": "0.1.35",
|
|
4
4
|
"description": "ARK CLI - Interactive terminal interface for ARK agents",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -12,13 +12,11 @@
|
|
|
12
12
|
],
|
|
13
13
|
"scripts": {
|
|
14
14
|
"build": "tsc && chmod +x dist/index.js",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"start": "NODE_NO_WARNINGS=1 node dist/index.js",
|
|
15
|
+
"dev": "node --loader ts-node/esm src/index.tsx",
|
|
16
|
+
"start": "node dist/index.js",
|
|
18
17
|
"clean": "rm -rf dist",
|
|
19
18
|
"lint": "eslint src/ --fix && prettier --write src/",
|
|
20
19
|
"lint:check": "eslint src/ && prettier --check src/",
|
|
21
|
-
"test": "NODE_OPTIONS=\"--experimental-vm-modules\" jest --coverage --coverageDirectory=./artifacts/coverage --coverageReporters=text --coverageReporters=lcov --coverageReporters=text-summary",
|
|
22
20
|
"postinstall": "echo \"ARK CLI installed! Run 'ark' to try it out.\""
|
|
23
21
|
},
|
|
24
22
|
"keywords": [
|
|
@@ -41,7 +39,7 @@
|
|
|
41
39
|
},
|
|
42
40
|
"dependencies": {
|
|
43
41
|
"@kubernetes/client-node": "^1.3.0",
|
|
44
|
-
"@
|
|
42
|
+
"@types/react": "^19.1.8",
|
|
45
43
|
"axios": "^1.7.7",
|
|
46
44
|
"chalk": "^4.1.2",
|
|
47
45
|
"commander": "^12.1.0",
|
|
@@ -49,33 +47,23 @@
|
|
|
49
47
|
"execa": "^9.6.0",
|
|
50
48
|
"ink": "^6.0.1",
|
|
51
49
|
"ink-select-input": "^6.2.0",
|
|
52
|
-
"ink-spinner": "^5.0.0",
|
|
53
50
|
"ink-text-input": "^6.0.0",
|
|
54
51
|
"inquirer": "^12.1.0",
|
|
55
|
-
"marked": "^15.0.12",
|
|
56
|
-
"marked-terminal": "^7.3.0",
|
|
57
52
|
"open": "^10.2.0",
|
|
58
|
-
"openai": "^5.19.1",
|
|
59
|
-
"ora": "^8.2.0",
|
|
60
53
|
"react": "^19.1.0",
|
|
54
|
+
"simple-git": "^3.28.0",
|
|
61
55
|
"yaml": "^2.6.1"
|
|
62
56
|
},
|
|
63
57
|
"devDependencies": {
|
|
64
58
|
"@eslint/js": "^9.17.0",
|
|
65
|
-
"@jest/globals": "^30.1.2",
|
|
66
59
|
"@types/debug": "^4.1.12",
|
|
67
60
|
"@types/inquirer": "^9.0.7",
|
|
68
|
-
"@types/jest": "^30.0.0",
|
|
69
61
|
"@types/node": "^22.10.2",
|
|
70
|
-
"@types/react": "^19.1.13",
|
|
71
62
|
"@typescript-eslint/eslint-plugin": "^8.20.0",
|
|
72
63
|
"@typescript-eslint/parser": "^8.20.0",
|
|
73
64
|
"eslint": "^9.17.0",
|
|
74
|
-
"jest": "^30.1.3",
|
|
75
65
|
"prettier": "^3.6.2",
|
|
76
|
-
"ts-jest": "^29.4.1",
|
|
77
66
|
"ts-node": "^10.9.2",
|
|
78
|
-
"tsx": "^4.20.5",
|
|
79
67
|
"typescript": "^5.7.2"
|
|
80
68
|
},
|
|
81
69
|
"engines": {
|
package/dist/arkServices.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Centralized ARK service definitions used by both install and status commands
|
|
3
|
-
*/
|
|
4
|
-
export interface ArkService {
|
|
5
|
-
name: string;
|
|
6
|
-
helmReleaseName: string;
|
|
7
|
-
description: string;
|
|
8
|
-
enabled: boolean;
|
|
9
|
-
namespace?: string;
|
|
10
|
-
chartPath?: string;
|
|
11
|
-
installArgs?: string[];
|
|
12
|
-
k8sServiceName?: string;
|
|
13
|
-
k8sServicePort?: number;
|
|
14
|
-
k8sPortForwardLocalPort?: number;
|
|
15
|
-
k8sDeploymentName?: string;
|
|
16
|
-
k8sDevDeploymentName?: string;
|
|
17
|
-
}
|
|
18
|
-
export interface ServiceCollection {
|
|
19
|
-
[key: string]: ArkService;
|
|
20
|
-
}
|
|
21
|
-
export interface ArkDependency {
|
|
22
|
-
name: string;
|
|
23
|
-
command: string;
|
|
24
|
-
args: string[];
|
|
25
|
-
description: string;
|
|
26
|
-
}
|
|
27
|
-
export interface DependencyCollection {
|
|
28
|
-
[key: string]: ArkDependency;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Dependencies that should be installed before ARK services
|
|
32
|
-
* Note: Dependencies will be installed in the order they are defined here
|
|
33
|
-
*/
|
|
34
|
-
export declare const arkDependencies: DependencyCollection;
|
|
35
|
-
/**
|
|
36
|
-
* Core ARK services with their installation and status check configurations
|
|
37
|
-
*/
|
|
38
|
-
export declare const arkServices: ServiceCollection;
|
|
39
|
-
/**
|
|
40
|
-
* Get services that can be installed via Helm charts (only enabled services)
|
|
41
|
-
*/
|
|
42
|
-
export declare function getInstallableServices(): ServiceCollection;
|