@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.
Files changed (207) 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 -275
  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 -40
  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 -26
  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 -10
  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 -268
  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/install/index.d.ts +0 -8
  98. package/dist/commands/install/index.js +0 -302
  99. package/dist/commands/install/index.spec.d.ts +0 -1
  100. package/dist/commands/install/index.spec.js +0 -135
  101. package/dist/commands/install.d.ts +0 -3
  102. package/dist/commands/install.js +0 -147
  103. package/dist/commands/models/create.d.ts +0 -1
  104. package/dist/commands/models/create.js +0 -213
  105. package/dist/commands/models/create.spec.d.ts +0 -1
  106. package/dist/commands/models/create.spec.js +0 -125
  107. package/dist/commands/models/index.d.ts +0 -3
  108. package/dist/commands/models/index.js +0 -60
  109. package/dist/commands/models/index.spec.d.ts +0 -1
  110. package/dist/commands/models/index.spec.js +0 -76
  111. package/dist/commands/models/selector.d.ts +0 -8
  112. package/dist/commands/models/selector.js +0 -53
  113. package/dist/commands/routes/index.d.ts +0 -3
  114. package/dist/commands/routes/index.js +0 -93
  115. package/dist/commands/routes.d.ts +0 -2
  116. package/dist/commands/routes.js +0 -101
  117. package/dist/commands/status/index.d.ts +0 -4
  118. package/dist/commands/status/index.js +0 -232
  119. package/dist/commands/status.d.ts +0 -3
  120. package/dist/commands/status.js +0 -33
  121. package/dist/commands/targets/index.d.ts +0 -3
  122. package/dist/commands/targets/index.js +0 -65
  123. package/dist/commands/targets/index.spec.d.ts +0 -1
  124. package/dist/commands/targets/index.spec.js +0 -105
  125. package/dist/commands/targets.d.ts +0 -2
  126. package/dist/commands/targets.js +0 -65
  127. package/dist/commands/teams/index.d.ts +0 -3
  128. package/dist/commands/teams/index.js +0 -49
  129. package/dist/commands/teams/index.spec.d.ts +0 -1
  130. package/dist/commands/teams/index.spec.js +0 -70
  131. package/dist/commands/teams/selector.d.ts +0 -8
  132. package/dist/commands/teams/selector.js +0 -55
  133. package/dist/commands/tools/index.d.ts +0 -3
  134. package/dist/commands/tools/index.js +0 -49
  135. package/dist/commands/tools/index.spec.d.ts +0 -1
  136. package/dist/commands/tools/index.spec.js +0 -70
  137. package/dist/commands/tools/selector.d.ts +0 -8
  138. package/dist/commands/tools/selector.js +0 -53
  139. package/dist/commands/uninstall/index.d.ts +0 -3
  140. package/dist/commands/uninstall/index.js +0 -107
  141. package/dist/commands/uninstall/index.spec.d.ts +0 -1
  142. package/dist/commands/uninstall/index.spec.js +0 -117
  143. package/dist/commands/uninstall.d.ts +0 -2
  144. package/dist/commands/uninstall.js +0 -83
  145. package/dist/components/ChatUI.d.ts +0 -16
  146. package/dist/components/ChatUI.js +0 -801
  147. package/dist/components/StatusView.d.ts +0 -10
  148. package/dist/components/StatusView.js +0 -39
  149. package/dist/lib/arkApiClient.d.ts +0 -53
  150. package/dist/lib/arkApiClient.js +0 -102
  151. package/dist/lib/arkApiProxy.d.ts +0 -9
  152. package/dist/lib/arkApiProxy.js +0 -22
  153. package/dist/lib/arkServiceProxy.d.ts +0 -14
  154. package/dist/lib/arkServiceProxy.js +0 -95
  155. package/dist/lib/arkStatus.d.ts +0 -10
  156. package/dist/lib/arkStatus.js +0 -79
  157. package/dist/lib/arkStatus.spec.d.ts +0 -1
  158. package/dist/lib/arkStatus.spec.js +0 -49
  159. package/dist/lib/chatClient.d.ts +0 -33
  160. package/dist/lib/chatClient.js +0 -99
  161. package/dist/lib/cluster.spec.d.ts +0 -1
  162. package/dist/lib/cluster.spec.js +0 -338
  163. package/dist/lib/commandUtils.d.ts +0 -4
  164. package/dist/lib/commandUtils.js +0 -18
  165. package/dist/lib/commandUtils.test.d.ts +0 -1
  166. package/dist/lib/commandUtils.test.js +0 -44
  167. package/dist/lib/commands.d.ts +0 -16
  168. package/dist/lib/commands.js +0 -29
  169. package/dist/lib/commands.spec.d.ts +0 -1
  170. package/dist/lib/commands.spec.js +0 -146
  171. package/dist/lib/config.spec.d.ts +0 -1
  172. package/dist/lib/config.spec.js +0 -99
  173. package/dist/lib/config.test.d.ts +0 -1
  174. package/dist/lib/config.test.js +0 -93
  175. package/dist/lib/consts.spec.d.ts +0 -1
  176. package/dist/lib/consts.spec.js +0 -15
  177. package/dist/lib/dev/tools/analyzer.d.ts +0 -30
  178. package/dist/lib/dev/tools/analyzer.js +0 -190
  179. package/dist/lib/dev/tools/discover_tools.py +0 -392
  180. package/dist/lib/dev/tools/mcp-types.d.ts +0 -28
  181. package/dist/lib/dev/tools/mcp-types.js +0 -86
  182. package/dist/lib/dev/tools/types.d.ts +0 -50
  183. package/dist/lib/dev/tools/types.js +0 -1
  184. package/dist/lib/errors.spec.d.ts +0 -1
  185. package/dist/lib/errors.spec.js +0 -221
  186. package/dist/lib/output.d.ts +0 -36
  187. package/dist/lib/output.js +0 -89
  188. package/dist/lib/output.spec.d.ts +0 -1
  189. package/dist/lib/output.spec.js +0 -123
  190. package/dist/lib/portUtils.d.ts +0 -8
  191. package/dist/lib/portUtils.js +0 -39
  192. package/dist/lib/startup.d.ts +0 -5
  193. package/dist/lib/startup.js +0 -73
  194. package/dist/lib/startup.spec.d.ts +0 -1
  195. package/dist/lib/startup.spec.js +0 -168
  196. package/dist/types/types.d.ts +0 -40
  197. package/dist/types/types.js +0 -1
  198. package/dist/ui/AgentSelector.d.ts +0 -8
  199. package/dist/ui/AgentSelector.js +0 -53
  200. package/dist/ui/ModelSelector.d.ts +0 -8
  201. package/dist/ui/ModelSelector.js +0 -53
  202. package/dist/ui/TeamSelector.d.ts +0 -8
  203. package/dist/ui/TeamSelector.js +0 -55
  204. package/dist/ui/ToolSelector.d.ts +0 -8
  205. package/dist/ui/ToolSelector.js +0 -53
  206. package/dist/ui/statusFormatter.spec.d.ts +0 -1
  207. package/dist/ui/statusFormatter.spec.js +0 -58
@@ -1,88 +1,223 @@
1
+ /**
2
+ * Configuration management for ARK CLI
3
+ */
1
4
  import fs from 'fs';
2
5
  import path from 'path';
3
6
  import os from 'os';
4
- import yaml from 'yaml';
5
- /**
6
- * Load configuration from multiple sources with proper precedence:
7
- * 1. Defaults
8
- * 2. ~/.arkrc.yaml (user config)
9
- * 3. .arkrc.yaml (project config)
10
- * 4. Environment variables (override all)
11
- */
12
- export function loadConfig() {
13
- // Start with defaults
14
- const config = {
15
- chat: {
16
- streaming: true,
17
- outputFormat: 'text',
18
- },
19
- };
20
- // Load user config from home directory
21
- const userConfigPath = path.join(os.homedir(), '.arkrc.yaml');
22
- if (fs.existsSync(userConfigPath)) {
7
+ import { SecurityUtils } from './security.js';
8
+ import { ValidationError } from './errors.js';
9
+ export const DEFAULT_CONFIG = {
10
+ defaultProjectType: 'with-samples',
11
+ defaultDestination: process.cwd(),
12
+ skipGitByDefault: false,
13
+ skipModelsbyDefault: false,
14
+ preferredEditor: process.env.EDITOR || 'code',
15
+ colorOutput: true,
16
+ verboseOutput: false,
17
+ defaultModelProvider: 'azure',
18
+ customTemplates: {},
19
+ parallelOperations: true,
20
+ maxConcurrentFiles: 10,
21
+ fileWatchingEnabled: false,
22
+ telemetryEnabled: false,
23
+ errorReporting: false,
24
+ };
25
+ export class ConfigManager {
26
+ constructor() {
27
+ this.configPath = this.getConfigPath();
28
+ this.config = this.loadConfig();
29
+ }
30
+ /**
31
+ * Get the path to the configuration file
32
+ */
33
+ getConfigPath() {
34
+ const configDir = process.env.ARK_CONFIG_DIR || path.join(os.homedir(), '.config', 'ark');
35
+ // Ensure config directory exists
36
+ if (!fs.existsSync(configDir)) {
37
+ fs.mkdirSync(configDir, { recursive: true, mode: 0o755 });
38
+ }
39
+ return path.join(configDir, 'config.json');
40
+ }
41
+ /**
42
+ * Load configuration from file or create with defaults
43
+ */
44
+ loadConfig() {
23
45
  try {
24
- const userConfig = yaml.parse(fs.readFileSync(userConfigPath, 'utf-8'));
25
- mergeConfig(config, userConfig);
46
+ if (fs.existsSync(this.configPath)) {
47
+ const configContent = fs.readFileSync(this.configPath, 'utf-8');
48
+ const userConfig = JSON.parse(configContent);
49
+ // Merge with defaults to ensure all properties exist
50
+ return { ...DEFAULT_CONFIG, ...userConfig };
51
+ }
26
52
  }
27
- catch (e) {
28
- const message = e instanceof Error ? e.message : 'Unknown error';
29
- throw new Error(`Invalid YAML in ${userConfigPath}: ${message}`);
53
+ catch (error) {
54
+ console.warn(`Warning: Failed to load config from ${this.configPath}: ${error}`);
30
55
  }
56
+ // Return defaults and save them
57
+ this.saveConfig(DEFAULT_CONFIG);
58
+ return { ...DEFAULT_CONFIG };
31
59
  }
32
- // Load project config from current directory
33
- const projectConfigPath = path.join(process.cwd(), '.arkrc.yaml');
34
- if (fs.existsSync(projectConfigPath)) {
60
+ /**
61
+ * Save configuration to file
62
+ */
63
+ saveConfig(config) {
35
64
  try {
36
- const projectConfig = yaml.parse(fs.readFileSync(projectConfigPath, 'utf-8'));
37
- mergeConfig(config, projectConfig);
65
+ const configContent = JSON.stringify(config, null, 2);
66
+ SecurityUtils.validatePath(this.configPath, 'config file');
67
+ fs.writeFileSync(this.configPath, configContent, {
68
+ mode: 0o600, // Owner read/write only
69
+ flag: 'w',
70
+ });
38
71
  }
39
- catch (e) {
40
- const message = e instanceof Error ? e.message : 'Unknown error';
41
- throw new Error(`Invalid YAML in ${projectConfigPath}: ${message}`);
72
+ catch (error) {
73
+ throw new ValidationError(`Failed to save configuration: ${error}`, 'config', [
74
+ 'Check file permissions',
75
+ 'Ensure config directory exists',
76
+ 'Verify disk space',
77
+ ]);
42
78
  }
43
79
  }
44
- // Apply environment variable overrides
45
- if (process.env.ARK_CHAT_STREAMING !== undefined) {
46
- config.chat = config.chat || {};
47
- config.chat.streaming =
48
- process.env.ARK_CHAT_STREAMING === '1' ||
49
- process.env.ARK_CHAT_STREAMING === 'true';
80
+ /**
81
+ * Get the current configuration
82
+ */
83
+ getConfig() {
84
+ return { ...this.config };
85
+ }
86
+ /**
87
+ * Update configuration
88
+ */
89
+ updateConfig(updates) {
90
+ this.config = { ...this.config, ...updates };
91
+ this.saveConfig(this.config);
92
+ }
93
+ /**
94
+ * Reset configuration to defaults
95
+ */
96
+ resetConfig() {
97
+ this.config = { ...DEFAULT_CONFIG };
98
+ this.saveConfig(this.config);
50
99
  }
51
- if (process.env.ARK_CHAT_OUTPUT_FORMAT !== undefined) {
52
- config.chat = config.chat || {};
53
- const format = process.env.ARK_CHAT_OUTPUT_FORMAT.toLowerCase();
54
- if (format === 'markdown' || format === 'text') {
55
- config.chat.outputFormat = format;
100
+ /**
101
+ * Get a specific configuration value
102
+ */
103
+ get(key) {
104
+ return this.config[key];
105
+ }
106
+ /**
107
+ * Set a specific configuration value
108
+ */
109
+ set(key, value) {
110
+ this.config[key] = value;
111
+ this.saveConfig(this.config);
112
+ }
113
+ /**
114
+ * Validate configuration values
115
+ */
116
+ validateConfig() {
117
+ const config = this.config;
118
+ // Validate project type
119
+ if (!['empty', 'with-samples'].includes(config.defaultProjectType)) {
120
+ throw new ValidationError(`Invalid defaultProjectType: ${config.defaultProjectType}`, 'defaultProjectType', ['Must be "empty" or "with-samples"']);
121
+ }
122
+ // Validate model provider
123
+ const validProviders = ['azure', 'openai', 'claude', 'gemini', 'custom'];
124
+ if (!validProviders.includes(config.defaultModelProvider)) {
125
+ throw new ValidationError(`Invalid defaultModelProvider: ${config.defaultModelProvider}`, 'defaultModelProvider', [`Must be one of: ${validProviders.join(', ')}`]);
126
+ }
127
+ // Validate numeric values
128
+ if (config.maxConcurrentFiles < 1 || config.maxConcurrentFiles > 100) {
129
+ throw new ValidationError(`Invalid maxConcurrentFiles: ${config.maxConcurrentFiles}`, 'maxConcurrentFiles', ['Must be between 1 and 100']);
130
+ }
131
+ // Validate paths
132
+ if (config.defaultDestination) {
133
+ SecurityUtils.validatePath(config.defaultDestination, 'default destination');
134
+ }
135
+ if (config.templateDirectory) {
136
+ SecurityUtils.validatePath(config.templateDirectory, 'template directory');
56
137
  }
57
138
  }
58
- return config;
59
- }
60
- /**
61
- * Merge source config into target config (mutates target)
62
- */
63
- function mergeConfig(target, source) {
64
- if (source.chat) {
65
- target.chat = target.chat || {};
66
- if (source.chat.streaming !== undefined) {
67
- target.chat.streaming = source.chat.streaming;
139
+ /**
140
+ * Get environment variable overrides
141
+ */
142
+ getEnvironmentOverrides() {
143
+ const overrides = {};
144
+ // Check for environment variable overrides
145
+ if (process.env.ARK_DEFAULT_PROJECT_TYPE) {
146
+ const projectType = process.env.ARK_DEFAULT_PROJECT_TYPE;
147
+ if (['empty', 'with-samples'].includes(projectType)) {
148
+ overrides.defaultProjectType = projectType;
149
+ }
68
150
  }
69
- if (source.chat.outputFormat !== undefined) {
70
- target.chat.outputFormat = source.chat.outputFormat;
151
+ if (process.env.ARK_DEFAULT_DESTINATION) {
152
+ overrides.defaultDestination = process.env.ARK_DEFAULT_DESTINATION;
71
153
  }
154
+ if (process.env.ARK_SKIP_GIT) {
155
+ overrides.skipGitByDefault = process.env.ARK_SKIP_GIT === 'true';
156
+ }
157
+ if (process.env.ARK_SKIP_MODELS) {
158
+ overrides.skipModelsbyDefault = process.env.ARK_SKIP_MODELS === 'true';
159
+ }
160
+ if (process.env.ARK_COLOR_OUTPUT) {
161
+ overrides.colorOutput = process.env.ARK_COLOR_OUTPUT !== 'false';
162
+ }
163
+ if (process.env.ARK_VERBOSE) {
164
+ overrides.verboseOutput = process.env.ARK_VERBOSE === 'true';
165
+ }
166
+ if (process.env.ARK_DEFAULT_MODEL_PROVIDER) {
167
+ const provider = process.env.ARK_DEFAULT_MODEL_PROVIDER;
168
+ const validProviders = [
169
+ 'azure',
170
+ 'openai',
171
+ 'claude',
172
+ 'gemini',
173
+ 'custom',
174
+ ];
175
+ if (validProviders.includes(provider)) {
176
+ overrides.defaultModelProvider =
177
+ provider;
178
+ }
179
+ }
180
+ return overrides;
181
+ }
182
+ /**
183
+ * Get merged configuration with environment overrides
184
+ */
185
+ getMergedConfig() {
186
+ const envOverrides = this.getEnvironmentOverrides();
187
+ return { ...this.config, ...envOverrides };
188
+ }
189
+ /**
190
+ * Export configuration for backup
191
+ */
192
+ exportConfig() {
193
+ return JSON.stringify(this.config, null, 2);
194
+ }
195
+ /**
196
+ * Import configuration from backup
197
+ */
198
+ importConfig(configJson) {
199
+ try {
200
+ const importedConfig = JSON.parse(configJson);
201
+ // Validate the imported config
202
+ const tempManager = new ConfigManager();
203
+ tempManager.config = { ...DEFAULT_CONFIG, ...importedConfig };
204
+ tempManager.validateConfig();
205
+ // If validation passes, update our config
206
+ this.config = tempManager.config;
207
+ this.saveConfig(this.config);
208
+ }
209
+ catch (error) {
210
+ throw new ValidationError(`Failed to import configuration: ${error}`, 'config', [
211
+ 'Check JSON syntax',
212
+ 'Ensure all required fields are present',
213
+ 'Verify configuration values are valid',
214
+ ]);
215
+ }
216
+ }
217
+ /**
218
+ * Get configuration file path for CLI display
219
+ */
220
+ getConfigFilePath() {
221
+ return this.configPath;
72
222
  }
73
- }
74
- /**
75
- * Get the paths checked for config files
76
- */
77
- export function getConfigPaths() {
78
- return {
79
- user: path.join(os.homedir(), '.arkrc.yaml'),
80
- project: path.join(process.cwd(), '.arkrc.yaml'),
81
- };
82
- }
83
- /**
84
- * Format config as YAML for display
85
- */
86
- export function formatConfig(config) {
87
- return yaml.stringify(config);
88
223
  }
@@ -7,3 +7,4 @@ export declare const DEFAULT_ARK_DASHBOARD_URL = "http://localhost:3000";
7
7
  export declare const DEFAULT_ARK_A2A_URL = "http://localhost:8080";
8
8
  export declare const DEFAULT_ARK_MEMORY_URL = "http://localhost:8081";
9
9
  export declare const DEFAULT_ARK_OTEL_URL = "http://localhost:4318";
10
+ export declare const ARK_REPO_ERROR_MESSAGE = "Error: This command must be run inside the ARK repository.";
@@ -11,3 +11,5 @@ export const DEFAULT_ARK_DASHBOARD_URL = 'http://localhost:3000';
11
11
  export const DEFAULT_ARK_A2A_URL = 'http://localhost:8080';
12
12
  export const DEFAULT_ARK_MEMORY_URL = 'http://localhost:8081';
13
13
  export const DEFAULT_ARK_OTEL_URL = 'http://localhost:4318';
14
+ // Error message for different ARK repo
15
+ export const ARK_REPO_ERROR_MESSAGE = 'Error: This command must be run inside the ARK repository.';
@@ -162,9 +162,9 @@ export class InputValidator {
162
162
  if (!kebabRegex.test(trimmed)) {
163
163
  const suggestions = [];
164
164
  const normalized = trimmed
165
- .replace(/([a-z])([A-Z])/g, '$1-$2') // Handle camelCase first
166
165
  .toLowerCase()
167
166
  .replace(/[\s_]+/g, '-')
167
+ .replace(/([a-z])([A-Z])/g, '$1-$2')
168
168
  .replace(/-{2,}/g, '-') // Replace 2+ consecutive hyphens with single hyphen (ReDoS-safe)
169
169
  .replace(/^-/, '') // Remove single leading hyphen (ReDoS-safe)
170
170
  .replace(/-$/, ''); // Remove single trailing hyphen (ReDoS-safe)
@@ -1 +1,5 @@
1
+ export declare function executeCommand(command: string, args?: string[]): Promise<{
2
+ stdout: string;
3
+ stderr: string;
4
+ }>;
1
5
  export declare function fileExists(path: string): boolean;
package/dist/lib/exec.js CHANGED
@@ -1,4 +1,15 @@
1
1
  import fs from 'fs';
2
+ import { execa } from 'execa';
3
+ export async function executeCommand(command, args = []) {
4
+ try {
5
+ const result = await execa(command, args);
6
+ return { stdout: result.stdout, stderr: result.stderr };
7
+ }
8
+ catch (error) {
9
+ const errorMessage = error instanceof Error ? error.message : String(error);
10
+ throw new Error(`Command failed: ${command} ${args.join(' ')}\n${errorMessage}`);
11
+ }
12
+ }
2
13
  export function fileExists(path) {
3
14
  try {
4
15
  return fs.existsSync(path);
@@ -13,18 +13,13 @@ export interface KubernetesConfig {
13
13
  namespace?: string;
14
14
  inCluster: boolean;
15
15
  }
16
- export type DeploymentStatus = 'available' | 'progressing' | 'replicafailure' | 'failed' | 'not found' | 'unknown';
17
- export type ServiceStatus = {
16
+ export interface ServiceStatus {
18
17
  name: string;
19
- status: 'healthy' | 'warning' | 'unhealthy' | 'not installed' | 'not ready';
20
- deploymentStatus?: DeploymentStatus;
18
+ status: 'healthy' | 'unhealthy' | 'not installed';
21
19
  url?: string;
22
20
  version?: string;
23
- revision?: string;
24
21
  details?: string;
25
- isDev?: boolean;
26
- namespace?: string;
27
- };
22
+ }
28
23
  export interface DependencyStatus {
29
24
  name: string;
30
25
  installed: boolean;
@@ -34,8 +29,6 @@ export interface DependencyStatus {
34
29
  export interface StatusData {
35
30
  services: ServiceStatus[];
36
31
  dependencies: DependencyStatus[];
37
- arkReady?: boolean;
38
- defaultModelExists?: boolean;
39
32
  }
40
33
  export interface CommandVersionConfig {
41
34
  command: string;
@@ -1,7 +1,3 @@
1
1
  import * as React from 'react';
2
- import type { ArkConfig } from '../lib/config.js';
3
- interface MainMenuProps {
4
- config: ArkConfig;
5
- }
6
- declare const MainMenu: React.FC<MainMenuProps>;
2
+ declare const MainMenu: React.FC;
7
3
  export default MainMenu;