@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/lib/config.js
CHANGED
|
@@ -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
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
25
|
-
|
|
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 (
|
|
28
|
-
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
60
|
+
/**
|
|
61
|
+
* Save configuration to file
|
|
62
|
+
*/
|
|
63
|
+
saveConfig(config) {
|
|
35
64
|
try {
|
|
36
|
-
const
|
|
37
|
-
|
|
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 (
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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 (
|
|
70
|
-
|
|
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
|
}
|
package/dist/lib/consts.d.ts
CHANGED
|
@@ -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.";
|
package/dist/lib/consts.js
CHANGED
|
@@ -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.';
|
package/dist/lib/errors.js
CHANGED
|
@@ -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)
|
package/dist/lib/exec.d.ts
CHANGED
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);
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -13,18 +13,13 @@ export interface KubernetesConfig {
|
|
|
13
13
|
namespace?: string;
|
|
14
14
|
inCluster: boolean;
|
|
15
15
|
}
|
|
16
|
-
export
|
|
17
|
-
export type ServiceStatus = {
|
|
16
|
+
export interface ServiceStatus {
|
|
18
17
|
name: string;
|
|
19
|
-
status: 'healthy' | '
|
|
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
|
-
|
|
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;
|
package/dist/ui/MainMenu.d.ts
CHANGED