@edgible-team/cli 1.0.2 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/ai.js +1 -1
- package/dist/detection/tools.d.ts +16 -0
- package/dist/detection/tools.d.ts.map +1 -0
- package/dist/detection/tools.js +305 -0
- package/dist/services/LocalAgentManager.d.ts.map +1 -1
- package/dist/services/LocalAgentManager.js +1 -3
- package/dist/services/daemon/LaunchdDaemonManager.d.ts.map +1 -1
- package/dist/services/daemon/LaunchdDaemonManager.js +48 -6
- package/package.json +2 -2
- package/recipes/compose/open-webui/.env +1 -0
package/dist/commands/ai.js
CHANGED
|
@@ -1108,7 +1108,7 @@ async function checkModelAvailable(modelName) {
|
|
|
1108
1108
|
*/
|
|
1109
1109
|
async function pullModel(modelName) {
|
|
1110
1110
|
try {
|
|
1111
|
-
(0, child_process_1.execSync)(`ollama pull ${modelName}`, {
|
|
1111
|
+
(0, child_process_1.execSync)(`OLLAMA_HOST=127.0.0.1:11435 ollama pull ${modelName}`, {
|
|
1112
1112
|
encoding: 'utf8',
|
|
1113
1113
|
stdio: 'inherit',
|
|
1114
1114
|
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface DetectedTool {
|
|
2
|
+
name: string;
|
|
3
|
+
version?: string;
|
|
4
|
+
available: boolean;
|
|
5
|
+
command: string;
|
|
6
|
+
category: 'container' | 'vm' | 'orchestration' | 'cloud' | 'other';
|
|
7
|
+
description: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class ToolDetector {
|
|
10
|
+
private static tools;
|
|
11
|
+
static detectTools(): Promise<DetectedTool[]>;
|
|
12
|
+
private static getToolVersion;
|
|
13
|
+
static displayDetectedTools(tools: DetectedTool[]): void;
|
|
14
|
+
static getToolSummary(tools: DetectedTool[]): string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/detection/tools.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,WAAW,GAAG,IAAI,GAAG,eAAe,GAAG,OAAO,GAAG,OAAO,CAAC;IACnE,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAC,KAAK,CAkLlB;WAEkB,WAAW,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IA8B1D,OAAO,CAAC,MAAM,CAAC,cAAc;WA6Df,oBAAoB,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,IAAI;WAqCjD,cAAc,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,MAAM;CAM5D"}
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ToolDetector = void 0;
|
|
7
|
+
const child_process_1 = require("child_process");
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
class ToolDetector {
|
|
10
|
+
static async detectTools() {
|
|
11
|
+
const detectedTools = [];
|
|
12
|
+
for (const tool of this.tools) {
|
|
13
|
+
try {
|
|
14
|
+
const version = this.getToolVersion(tool.command);
|
|
15
|
+
if (version !== null) {
|
|
16
|
+
detectedTools.push({
|
|
17
|
+
...tool,
|
|
18
|
+
available: true,
|
|
19
|
+
version: version
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
detectedTools.push({
|
|
24
|
+
...tool,
|
|
25
|
+
available: false
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
// Tool not available
|
|
31
|
+
detectedTools.push({
|
|
32
|
+
...tool,
|
|
33
|
+
available: false
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return detectedTools;
|
|
38
|
+
}
|
|
39
|
+
static getToolVersion(command) {
|
|
40
|
+
try {
|
|
41
|
+
// Special handling for different tools
|
|
42
|
+
if (command === 'docker') {
|
|
43
|
+
const output = (0, child_process_1.execSync)('docker --version', { encoding: 'utf8', timeout: 5000 });
|
|
44
|
+
return output.trim().replace('Docker version ', '');
|
|
45
|
+
}
|
|
46
|
+
if (command === 'kubectl') {
|
|
47
|
+
const output = (0, child_process_1.execSync)('kubectl version --client', { encoding: 'utf8', timeout: 5000 });
|
|
48
|
+
const lines = output.split('\n');
|
|
49
|
+
const versionLine = lines.find(line => line.includes('Client Version:'));
|
|
50
|
+
return versionLine ? versionLine.trim().replace('Client Version: ', '') : 'Unknown';
|
|
51
|
+
}
|
|
52
|
+
if (command === 'aws') {
|
|
53
|
+
const output = (0, child_process_1.execSync)('aws --version', { encoding: 'utf8', timeout: 5000 });
|
|
54
|
+
return output.trim().replace('aws-cli/', '');
|
|
55
|
+
}
|
|
56
|
+
if (command === 'az') {
|
|
57
|
+
const output = (0, child_process_1.execSync)('az --version', { encoding: 'utf8', timeout: 5000 });
|
|
58
|
+
const lines = output.split('\n');
|
|
59
|
+
const versionLine = lines.find(line => line.includes('azure-cli'));
|
|
60
|
+
return versionLine ? versionLine.trim().replace('azure-cli ', '') : 'Unknown';
|
|
61
|
+
}
|
|
62
|
+
if (command === 'gcloud') {
|
|
63
|
+
const output = (0, child_process_1.execSync)('gcloud --version', { encoding: 'utf8', timeout: 5000 });
|
|
64
|
+
const lines = output.split('\n');
|
|
65
|
+
const versionLine = lines.find(line => line.includes('Google Cloud SDK'));
|
|
66
|
+
return versionLine ? versionLine.trim().replace('Google Cloud SDK ', '') : 'Unknown';
|
|
67
|
+
}
|
|
68
|
+
if (command === 'terraform') {
|
|
69
|
+
const output = (0, child_process_1.execSync)('terraform --version', { encoding: 'utf8', timeout: 5000 });
|
|
70
|
+
const lines = output.split('\n');
|
|
71
|
+
const versionLine = lines.find(line => line.includes('Terraform v'));
|
|
72
|
+
return versionLine ? versionLine.trim().replace('Terraform v', '') : 'Unknown';
|
|
73
|
+
}
|
|
74
|
+
if (command === 'powershell') {
|
|
75
|
+
// Check if we're on Windows and PowerShell is available
|
|
76
|
+
if (process.platform === 'win32') {
|
|
77
|
+
const output = (0, child_process_1.execSync)('powershell -Command "$PSVersionTable.PSVersion"', { encoding: 'utf8', timeout: 5000 });
|
|
78
|
+
return output.trim();
|
|
79
|
+
}
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
// Generic version detection
|
|
83
|
+
const output = (0, child_process_1.execSync)(`${command} --version`, { encoding: 'utf8', timeout: 5000 });
|
|
84
|
+
const lines = output.split('\n');
|
|
85
|
+
const versionLine = lines[0];
|
|
86
|
+
return versionLine ? versionLine.trim() : 'Unknown';
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
static displayDetectedTools(tools) {
|
|
93
|
+
const availableTools = tools.filter(tool => tool.available);
|
|
94
|
+
const unavailableTools = tools.filter(tool => !tool.available);
|
|
95
|
+
if (availableTools.length === 0) {
|
|
96
|
+
console.log(chalk_1.default.yellow('⚠ No container/VM/workload management tools detected'));
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
console.log(chalk_1.default.blue.bold('\n🔧 Detected Infrastructure Tools:\n'));
|
|
100
|
+
// Group tools by category
|
|
101
|
+
const categories = {
|
|
102
|
+
container: availableTools.filter(tool => tool.category === 'container'),
|
|
103
|
+
vm: availableTools.filter(tool => tool.category === 'vm'),
|
|
104
|
+
orchestration: availableTools.filter(tool => tool.category === 'orchestration'),
|
|
105
|
+
cloud: availableTools.filter(tool => tool.category === 'cloud'),
|
|
106
|
+
other: availableTools.filter(tool => tool.category === 'other')
|
|
107
|
+
};
|
|
108
|
+
Object.entries(categories).forEach(([category, categoryTools]) => {
|
|
109
|
+
if (categoryTools.length > 0) {
|
|
110
|
+
console.log(chalk_1.default.cyan.bold(`📦 ${category.charAt(0).toUpperCase() + category.slice(1)}:`));
|
|
111
|
+
categoryTools.forEach(tool => {
|
|
112
|
+
const versionText = tool.version ? ` (${tool.version})` : '';
|
|
113
|
+
console.log(chalk_1.default.green(` ✓ ${tool.name}${versionText}`));
|
|
114
|
+
console.log(chalk_1.default.gray(` ${tool.description}`));
|
|
115
|
+
});
|
|
116
|
+
console.log('');
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
if (unavailableTools.length > 0) {
|
|
120
|
+
console.log(chalk_1.default.gray(`💡 ${unavailableTools.length} additional tools not detected (${unavailableTools.map(t => t.name).join(', ')})`));
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
static getToolSummary(tools) {
|
|
124
|
+
const availableTools = tools.filter(tool => tool.available);
|
|
125
|
+
const categories = new Set(availableTools.map(tool => tool.category));
|
|
126
|
+
return `${availableTools.length} tools detected across ${categories.size} categories`;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
exports.ToolDetector = ToolDetector;
|
|
130
|
+
ToolDetector.tools = [
|
|
131
|
+
// Container runtimes
|
|
132
|
+
{
|
|
133
|
+
name: 'Docker',
|
|
134
|
+
command: 'docker',
|
|
135
|
+
category: 'container',
|
|
136
|
+
description: 'Container runtime and platform',
|
|
137
|
+
available: false
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: 'Podman',
|
|
141
|
+
command: 'podman',
|
|
142
|
+
category: 'container',
|
|
143
|
+
description: 'Daemonless container engine',
|
|
144
|
+
available: false
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: 'Containerd',
|
|
148
|
+
command: 'ctr',
|
|
149
|
+
category: 'container',
|
|
150
|
+
description: 'Container runtime',
|
|
151
|
+
available: false
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: 'LXC',
|
|
155
|
+
command: 'lxc',
|
|
156
|
+
category: 'container',
|
|
157
|
+
description: 'Linux containers',
|
|
158
|
+
available: false
|
|
159
|
+
},
|
|
160
|
+
// VM Management
|
|
161
|
+
{
|
|
162
|
+
name: 'VirtualBox',
|
|
163
|
+
command: 'vboxmanage',
|
|
164
|
+
category: 'vm',
|
|
165
|
+
description: 'Virtual machine management',
|
|
166
|
+
available: false
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: 'VMware',
|
|
170
|
+
command: 'vmrun',
|
|
171
|
+
category: 'vm',
|
|
172
|
+
description: 'VMware virtualization',
|
|
173
|
+
available: false
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: 'QEMU',
|
|
177
|
+
command: 'qemu-system-x86_64',
|
|
178
|
+
category: 'vm',
|
|
179
|
+
description: 'Machine emulator and virtualizer',
|
|
180
|
+
available: false
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
name: 'KVM',
|
|
184
|
+
command: 'kvm',
|
|
185
|
+
category: 'vm',
|
|
186
|
+
description: 'Kernel-based Virtual Machine',
|
|
187
|
+
available: false
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
name: 'Hyper-V',
|
|
191
|
+
command: 'powershell',
|
|
192
|
+
category: 'vm',
|
|
193
|
+
description: 'Windows virtualization platform',
|
|
194
|
+
available: false
|
|
195
|
+
},
|
|
196
|
+
// Orchestration
|
|
197
|
+
{
|
|
198
|
+
name: 'Kubernetes',
|
|
199
|
+
command: 'kubectl',
|
|
200
|
+
category: 'orchestration',
|
|
201
|
+
description: 'Container orchestration platform',
|
|
202
|
+
available: false
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
name: 'Docker Compose',
|
|
206
|
+
command: 'docker-compose',
|
|
207
|
+
category: 'orchestration',
|
|
208
|
+
description: 'Multi-container Docker applications',
|
|
209
|
+
available: false
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
name: 'Docker Swarm',
|
|
213
|
+
command: 'docker',
|
|
214
|
+
category: 'orchestration',
|
|
215
|
+
description: 'Docker native clustering',
|
|
216
|
+
available: false
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
name: 'Nomad',
|
|
220
|
+
command: 'nomad',
|
|
221
|
+
category: 'orchestration',
|
|
222
|
+
description: 'Workload orchestrator',
|
|
223
|
+
available: false
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
name: 'Mesos',
|
|
227
|
+
command: 'mesos-master',
|
|
228
|
+
category: 'orchestration',
|
|
229
|
+
description: 'Distributed systems kernel',
|
|
230
|
+
available: false
|
|
231
|
+
},
|
|
232
|
+
// Cloud CLI Tools
|
|
233
|
+
{
|
|
234
|
+
name: 'AWS CLI',
|
|
235
|
+
command: 'aws',
|
|
236
|
+
category: 'cloud',
|
|
237
|
+
description: 'Amazon Web Services CLI',
|
|
238
|
+
available: false
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
name: 'Azure CLI',
|
|
242
|
+
command: 'az',
|
|
243
|
+
category: 'cloud',
|
|
244
|
+
description: 'Microsoft Azure CLI',
|
|
245
|
+
available: false
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
name: 'Google Cloud CLI',
|
|
249
|
+
command: 'gcloud',
|
|
250
|
+
category: 'cloud',
|
|
251
|
+
description: 'Google Cloud Platform CLI',
|
|
252
|
+
available: false
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
name: 'DigitalOcean CLI',
|
|
256
|
+
command: 'doctl',
|
|
257
|
+
category: 'cloud',
|
|
258
|
+
description: 'DigitalOcean CLI',
|
|
259
|
+
available: false
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
name: 'Terraform',
|
|
263
|
+
command: 'terraform',
|
|
264
|
+
category: 'cloud',
|
|
265
|
+
description: 'Infrastructure as Code',
|
|
266
|
+
available: false
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
name: 'Ansible',
|
|
270
|
+
command: 'ansible',
|
|
271
|
+
category: 'cloud',
|
|
272
|
+
description: 'Configuration management',
|
|
273
|
+
available: false
|
|
274
|
+
},
|
|
275
|
+
// Other Infrastructure Tools
|
|
276
|
+
{
|
|
277
|
+
name: 'Vagrant',
|
|
278
|
+
command: 'vagrant',
|
|
279
|
+
category: 'other',
|
|
280
|
+
description: 'Development environment management',
|
|
281
|
+
available: false
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
name: 'Packer',
|
|
285
|
+
command: 'packer',
|
|
286
|
+
category: 'other',
|
|
287
|
+
description: 'Machine image creation',
|
|
288
|
+
available: false
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
name: 'Helm',
|
|
292
|
+
command: 'helm',
|
|
293
|
+
category: 'other',
|
|
294
|
+
description: 'Kubernetes package manager',
|
|
295
|
+
available: false
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
name: 'Istio',
|
|
299
|
+
command: 'istioctl',
|
|
300
|
+
category: 'other',
|
|
301
|
+
description: 'Service mesh platform',
|
|
302
|
+
available: false
|
|
303
|
+
}
|
|
304
|
+
];
|
|
305
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalAgentManager.d.ts","sourceRoot":"","sources":["../../src/services/LocalAgentManager.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,kBAAkB,EAGnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,sBAAsB,EAEtB,wBAAwB,EACxB,kBAAkB,EAGnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AASlD,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,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C,sBAAsB;IAU9B;;OAEG;IACH,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI;IA2CpD;;OAEG;YACW,gBAAgB;IAyC9B;;OAEG;YACW,uBAAuB;IAqBrC;;OAEG;YACW,qBAAqB;IAwCnC;;OAEG;IACG,mBAAmB,IAAI,OAAO,CAAC;QACnC,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACnC,CAAC;IAyCF;;OAEG;IACG,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAoBxD;;OAEG;IACG,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBxE;;OAEG;IACG,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA2BxD;;OAEG;IACG,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC;IAqBxC,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC;IAyBxC;;OAEG;IACH,cAAc,IAAI,MAAM;IAIxB;;OAEG;YACW,oBAAoB;IASlC;;OAEG;YACW,sBAAsB;IAYpC;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAuBzB;;OAEG;YACW,kBAAkB;IA+ChC;;OAEG;YACW,gBAAgB;IA+C9B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAI9B;;OAEG;YACW,gBAAgB;IAgG9B;;OAEG;YACW,eAAe;IAgD7B;;OAEG;YACW,sBAAsB;IAkBpC;;OAEG;YACW,kBAAkB;CAkBjC"}
|
|
@@ -1309,9 +1309,7 @@ class LocalAgentManager {
|
|
|
1309
1309
|
const extractPath = path.join(tempDir, 'extracted');
|
|
1310
1310
|
await mkdir(extractPath, { recursive: true });
|
|
1311
1311
|
// Use unzip command (available on most systems)
|
|
1312
|
-
(0, child_process_1.execSync)(`unzip -q "${zipPath}" -d "${extractPath}"`, {
|
|
1313
|
-
stdio: 'pipe'
|
|
1314
|
-
});
|
|
1312
|
+
(0, child_process_1.execSync)(`unzip -q "${zipPath}" -d "${extractPath}"`, {});
|
|
1315
1313
|
// Copy extracted files to agent directory
|
|
1316
1314
|
await this.copyDirectory(extractPath, targetConfigPath);
|
|
1317
1315
|
// Make the agent binary executable
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LaunchdDaemonManager.d.ts","sourceRoot":"","sources":["../../../src/services/daemon/LaunchdDaemonManager.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAM7F,qBAAa,oBAAqB,YAAW,cAAc;IACzD,OAAO,CAAC,WAAW,CAA+B;IAClD,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,OAAO,CAAS;;IAYlB,OAAO,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAqB5C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAStB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IASrB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAOxB,MAAM,IAAI,OAAO,CAAC,YAAY,CAAC;IAiC/B,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,GAAE,MAAY,GAAG,OAAO,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"LaunchdDaemonManager.d.ts","sourceRoot":"","sources":["../../../src/services/daemon/LaunchdDaemonManager.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAM7F,qBAAa,oBAAqB,YAAW,cAAc;IACzD,OAAO,CAAC,WAAW,CAA+B;IAClD,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,OAAO,CAAS;;IAYlB,OAAO,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAqB5C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAStB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IASrB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAOxB,MAAM,IAAI,OAAO,CAAC,YAAY,CAAC;IAiC/B,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,GAAE,MAAY,GAAG,OAAO,CAAC,MAAM,CAAC;IAuG3D,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAUvB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAQxB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAgBhC,WAAW,IAAI,MAAM;IAIrB,OAAO,IAAI,SAAS,GAAG,SAAS,GAAG,iBAAiB,GAAG,QAAQ,GAAG,QAAQ;IAI1E,OAAO,CAAC,iBAAiB;CA8C1B"}
|
|
@@ -150,24 +150,66 @@ class LaunchdDaemonManager {
|
|
|
150
150
|
}
|
|
151
151
|
else {
|
|
152
152
|
try {
|
|
153
|
-
|
|
153
|
+
// Read both log files
|
|
154
|
+
let stdoutLines = [];
|
|
155
|
+
let stderrLines = [];
|
|
154
156
|
try {
|
|
155
157
|
const { stdout: stdoutContent } = await execAsync(`tail -n ${lines} ${stdoutLog}`);
|
|
156
|
-
|
|
158
|
+
stdoutLines = stdoutContent.split('\n').filter(line => line.trim());
|
|
157
159
|
}
|
|
158
160
|
catch (error) {
|
|
159
161
|
// File might not exist yet
|
|
160
|
-
combinedLogs += '==> stdout.log <==\n(no logs yet)\n';
|
|
161
162
|
}
|
|
162
163
|
try {
|
|
163
164
|
const { stdout: stderrContent } = await execAsync(`tail -n ${lines} ${stderrLog}`);
|
|
164
|
-
|
|
165
|
+
stderrLines = stderrContent.split('\n').filter(line => line.trim());
|
|
165
166
|
}
|
|
166
167
|
catch (error) {
|
|
167
168
|
// File might not exist yet
|
|
168
|
-
combinedLogs += '\n==> stderr.log <==\n(no logs yet)\n';
|
|
169
169
|
}
|
|
170
|
-
|
|
170
|
+
const parsedLogs = [];
|
|
171
|
+
// Parse stdout logs
|
|
172
|
+
for (const line of stdoutLines) {
|
|
173
|
+
try {
|
|
174
|
+
const parsed = JSON.parse(line);
|
|
175
|
+
if (parsed.timestamp) {
|
|
176
|
+
parsedLogs.push({ timestamp: parsed.timestamp, line });
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
// Non-JSON or no timestamp, add as-is
|
|
180
|
+
parsedLogs.push({ timestamp: new Date().toISOString(), line });
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
catch {
|
|
184
|
+
// Not JSON, add as-is with current timestamp
|
|
185
|
+
parsedLogs.push({ timestamp: new Date().toISOString(), line });
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
// Parse stderr logs
|
|
189
|
+
for (const line of stderrLines) {
|
|
190
|
+
try {
|
|
191
|
+
const parsed = JSON.parse(line);
|
|
192
|
+
if (parsed.timestamp) {
|
|
193
|
+
parsedLogs.push({ timestamp: parsed.timestamp, line });
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
// Non-JSON or no timestamp, add as-is
|
|
197
|
+
parsedLogs.push({ timestamp: new Date().toISOString(), line });
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
catch {
|
|
201
|
+
// Not JSON, add as-is with current timestamp
|
|
202
|
+
parsedLogs.push({ timestamp: new Date().toISOString(), line });
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
// Sort by timestamp
|
|
206
|
+
parsedLogs.sort((a, b) => {
|
|
207
|
+
return new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime();
|
|
208
|
+
});
|
|
209
|
+
// Take only the last N entries after sorting
|
|
210
|
+
const limitedLogs = parsedLogs.slice(-lines);
|
|
211
|
+
// Return combined sorted logs
|
|
212
|
+
return limitedLogs.map(entry => entry.line).join('\n');
|
|
171
213
|
}
|
|
172
214
|
catch (error) {
|
|
173
215
|
throw new Error(`Failed to read logs: ${error instanceof Error ? error.message : String(error)}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edgible-team/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "CLI tool for Edgible service",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@types/inquirer": "^9.0.7",
|
|
73
|
-
"@types/js-yaml": "^4.0.9",
|
|
74
73
|
"@types/jest": "^29.5.0",
|
|
74
|
+
"@types/js-yaml": "^4.0.9",
|
|
75
75
|
"@types/node": "^20.10.0",
|
|
76
76
|
"@types/ssh2": "^1.11.0",
|
|
77
77
|
"@types/supertest": "^2.0.0",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
OLLAMA_BASE_URL="https://ollama-api.ded8dbdc-54d1-4997-aa8d-cde1ee5cbf39.edgible.com"
|