@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,232 +1,70 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Text, Box, render, useInput } from 'ink';
3
- import Spinner from 'ink-spinner';
2
+ import { Text, Box, useInput } from 'ink';
3
+ import SelectInput from 'ink-select-input';
4
4
  import * as React from 'react';
5
- import { isArkReady } from '../lib/arkStatus.js';
6
- // Helper function to unmount the main ink app - used when we move from a
7
- // React TUI app to basic input/output.
8
- async function unmountInkApp() {
9
- const app = globalThis.inkApp;
10
- if (app) {
11
- // Unmount the Ink app
12
- app.unmount();
13
- // Clear the global reference
14
- delete globalThis.inkApp;
15
- // Reset terminal to normal mode
16
- if (process.stdin.isTTY) {
17
- process.stdin.setRawMode(false);
18
- process.stdin.pause();
19
- }
20
- // Clear screen
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
- // Filter choices based on Ark readiness
102
- const choices = React.useMemo(() => {
103
- // Don't return any choices while checking
104
- if (isChecking)
105
- return [];
106
- if (!arkReady) {
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
- // Ark is ready - filter out install (already installed) and conditionally show upgrade
111
- const filteredChoices = allChoices.filter((choice) => {
112
- // Never show install when Ark is ready (it's already installed)
113
- if (choice.value === 'install')
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
- else if (key.downArrow || input === 'j') {
130
- setSelectedIndex((prev) => (prev < choices.length - 1 ? prev + 1 : 0));
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
- else if (key.return) {
133
- handleSelect(choices[selectedIndex]);
47
+ catch (err) {
48
+ setError(err instanceof Error ? err.message : 'Unknown error occurred');
134
49
  }
135
- else {
136
- // Handle number keys for quick selection
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
- const handleSelect = async (item) => {
144
- switch (item.value) {
145
- case 'exit':
146
- process.exit(0);
147
- break;
148
- case 'chat': {
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
- process.exit(0);
204
- break; // Add break even though process.exit prevents reaching here
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
- return (_jsxs(_Fragment, { children: [_jsxs(Box, { flexDirection: "column", alignItems: "center", marginBottom: 1, children: [_jsx(Text, { color: "cyan", bold: true, children: `
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
- ` }), isChecking ? (_jsxs(Text, { color: "gray", children: [_jsx(Spinner, { type: "dots" }), " Checking Ark status..."] })) : arkReady ? (_jsxs(Box, { children: [_jsx(Text, { color: "green", bold: true, children: "\u25CF Ark is ready" }), config.currentVersion && (_jsxs(Text, { color: "gray", children: [" (", config.currentVersion, ")"] }))] })) : (_jsx(Text, { color: "yellow", bold: true, children: "\u25CF Ark is not installed" })), config.clusterInfo?.context ? (_jsxs(Text, { children: [_jsx(Text, { color: "gray", children: "Current context: " }), _jsx(Text, { color: "white", bold: true, children: config.clusterInfo.context })] })) : (_jsx(Text, { color: "gray", children: "No Kubernetes context configured" }))] }), !isChecking && (_jsx(Box, { flexDirection: "column", paddingX: 4, marginTop: 1, children: choices.map((choice, index) => {
243
- const isSelected = index === selectedIndex;
244
- return (_jsxs(Box, { flexDirection: "row", paddingY: 0, children: [_jsx(Text, { color: "gray", dimColor: true, children: isSelected ? '❯ ' : ' ' }), _jsxs(Text, { color: "gray", dimColor: true, children: [index + 1, "."] }), _jsx(Box, { marginLeft: 1, width: 20, children: _jsx(Text, { color: isSelected ? 'green' : 'white', bold: isSelected, children: choice.label }) }), _jsx(Text, { color: "gray", children: choice.description })] }, choice.value));
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
- export type StatusColor = 'green' | 'red' | 'yellow' | 'gray' | 'white' | 'cyan' | 'bold';
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
- static printSections(sections: StatusSection[]): void;
22
- private static applyColor;
23
- private static printLine;
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
- static printSections(sections) {
8
- console.log();
9
- sections.forEach((section, index) => {
10
- console.log(chalk.cyan.bold(section.title));
11
- section.lines.forEach((line) => this.printLine(line));
12
- if (index < sections.length - 1) {
13
- console.log();
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 applyColor(text, color) {
19
- if (!color)
20
- return text;
21
- const colorMap = {
22
- green: chalk.green,
23
- red: chalk.red,
24
- yellow: chalk.yellow,
25
- gray: chalk.gray,
26
- white: chalk.white,
27
- cyan: chalk.cyan,
28
- bold: chalk.bold,
29
- };
30
- return colorMap[color](text);
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 printLine(line) {
33
- const icon = this.applyColor(line.icon, line.iconColor);
34
- const status = this.applyColor(line.status, line.statusColor);
35
- // Name formatting is now handled where the name is assembled
36
- const name = this.applyColor(line.name, line.nameColor || 'white');
37
- const parts = [
38
- ` ${icon} ${status}`,
39
- name,
40
- line.details ? chalk.gray(line.details) : '',
41
- ].filter(Boolean);
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-rc2",
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
- "postbuild": "mkdir -p dist/lib/dev/tools && cp src/lib/dev/tools/*.py dist/lib/dev/tools/ 2>/dev/null || true",
16
- "dev": "tsc --watch",
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
- "@modelcontextprotocol/sdk": "^1.18.0",
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": {
@@ -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;