@edgible-team/cli 1.2.4 → 1.2.6
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/agent/agent-handlers.d.ts +45 -0
- package/dist/commands/agent/agent-handlers.d.ts.map +1 -0
- package/dist/commands/agent/agent-handlers.js +1159 -0
- package/dist/commands/agent.d.ts.map +1 -1
- package/dist/commands/agent.js +13 -1137
- package/dist/commands/ai.d.ts.map +1 -1
- package/dist/commands/ai.js +43 -41
- package/dist/config/app-config.d.ts +1 -1
- package/dist/config/app-config.js +2 -2
- package/dist/services/LocalAgentManager.d.ts.map +1 -1
- package/dist/services/LocalAgentManager.js +4 -2
- package/dist/services/auth/AuthService.js +8 -7
- package/dist/services/daemon/DaemonManagerFactory.d.ts +2 -0
- package/dist/services/daemon/DaemonManagerFactory.d.ts.map +1 -1
- package/dist/services/daemon/DaemonManagerFactory.js +14 -6
- package/dist/services/edgible.js +7 -7
- package/dist/utils/PlatformDetector.d.ts +2 -0
- package/dist/utils/PlatformDetector.d.ts.map +1 -1
- package/dist/utils/PlatformDetector.js +5 -34
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../../src/commands/ai.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../../src/commands/ai.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoCpC,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAioBtD"}
|
package/dist/commands/ai.js
CHANGED
|
@@ -51,6 +51,7 @@ const SystemCapabilityDetector_1 = require("../detection/SystemCapabilityDetecto
|
|
|
51
51
|
const DaemonManagerFactory_1 = require("../services/daemon/DaemonManagerFactory");
|
|
52
52
|
const config_validator_1 = require("./utils/config-validator");
|
|
53
53
|
const compose_constants_1 = require("../generated/compose-constants");
|
|
54
|
+
const sudo_checker_1 = require("../utils/sudo-checker");
|
|
54
55
|
function setupAiCommands(program) {
|
|
55
56
|
const aiCommand = program
|
|
56
57
|
.command('ai')
|
|
@@ -70,6 +71,10 @@ function setupAiCommands(program) {
|
|
|
70
71
|
.option('--webui-deployment <type>', 'WebUI deployment: local or remote')
|
|
71
72
|
.option('--no-interactive', 'Run in non-interactive mode')
|
|
72
73
|
.action((0, command_wrapper_1.wrapCommand)(async (options) => {
|
|
74
|
+
if (!(0, sudo_checker_1.checkSudoPermissions)()) {
|
|
75
|
+
console.log(chalk_1.default.redBright("Please run this command with administrator priviledges (i.e. sudo)"));
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
73
78
|
const container = (0, container_1.getContainer)();
|
|
74
79
|
const logger = container.get(types_1.TYPES.Logger);
|
|
75
80
|
logger.info('Setting up Ollama AI service', { model: options.model, autoInstall: options.autoInstall });
|
|
@@ -294,7 +299,6 @@ function setupAiCommands(program) {
|
|
|
294
299
|
.description('Stop AI services and optionally remove platform applications')
|
|
295
300
|
.option('--stop-ollama', 'Also stop the Ollama service')
|
|
296
301
|
.option('--remove-volumes', 'Remove data volumes (deletes all data)')
|
|
297
|
-
.option('--remove-apps', 'Remove platform applications (Ollama API, Open WebUI)')
|
|
298
302
|
.action((0, command_wrapper_1.wrapCommand)(async (options) => {
|
|
299
303
|
const container = (0, container_1.getContainer)();
|
|
300
304
|
const logger = container.get(types_1.TYPES.Logger);
|
|
@@ -325,42 +329,40 @@ function setupAiCommands(program) {
|
|
|
325
329
|
}
|
|
326
330
|
}
|
|
327
331
|
// Optionally remove platform applications
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
console.log(chalk_1.default.green(' ✓ Removed ollama-api'));
|
|
344
|
-
}
|
|
345
|
-
if (webUIApp) {
|
|
346
|
-
console.log(chalk_1.default.yellow(` Removing open-webui (${webUIApp.id})...`));
|
|
347
|
-
await applicationService.deleteApplication(webUIApp.id);
|
|
348
|
-
console.log(chalk_1.default.green(' ✓ Removed open-webui'));
|
|
349
|
-
}
|
|
350
|
-
if (!ollamaApp && !webUIApp) {
|
|
351
|
-
console.log(chalk_1.default.gray(' No AI applications found\n'));
|
|
352
|
-
}
|
|
353
|
-
else {
|
|
354
|
-
console.log(chalk_1.default.green('\n✓ Platform applications removed\n'));
|
|
355
|
-
}
|
|
332
|
+
console.log(chalk_1.default.yellow('\nRemoving platform applications...\n'));
|
|
333
|
+
try {
|
|
334
|
+
(0, config_validator_1.validateConfig)(configRepository, {
|
|
335
|
+
requireAuth: true,
|
|
336
|
+
requireOrganization: true,
|
|
337
|
+
});
|
|
338
|
+
const applicationService = container.get(types_1.TYPES.ApplicationService);
|
|
339
|
+
const applications = await applicationService.getApplications();
|
|
340
|
+
// Find AI-related applications
|
|
341
|
+
const ollamaApp = applications.find(app => app.name === 'ollama-api');
|
|
342
|
+
const webUIApp = applications.find(app => app.name === 'open-webui');
|
|
343
|
+
if (ollamaApp) {
|
|
344
|
+
console.log(chalk_1.default.yellow(` Removing ollama-api (${ollamaApp.id})...`));
|
|
345
|
+
await applicationService.deleteApplication(ollamaApp.id);
|
|
346
|
+
console.log(chalk_1.default.green(' ✓ Removed ollama-api'));
|
|
356
347
|
}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
348
|
+
if (webUIApp) {
|
|
349
|
+
console.log(chalk_1.default.yellow(` Removing open-webui (${webUIApp.id})...`));
|
|
350
|
+
await applicationService.deleteApplication(webUIApp.id);
|
|
351
|
+
console.log(chalk_1.default.green(' ✓ Removed open-webui'));
|
|
352
|
+
}
|
|
353
|
+
if (!ollamaApp && !webUIApp) {
|
|
354
|
+
console.log(chalk_1.default.gray(' No AI applications found\n'));
|
|
355
|
+
}
|
|
356
|
+
else {
|
|
357
|
+
console.log(chalk_1.default.green('\n✓ Platform applications removed\n'));
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
catch (error) {
|
|
361
|
+
if (error instanceof Error && error.message.includes('auth')) {
|
|
362
|
+
console.log(chalk_1.default.yellow(' ⚠ Not logged in - skipping platform application removal\n'));
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
console.log(chalk_1.default.red(` ✗ Error removing applications: ${error instanceof Error ? error.message : 'Unknown error'}\n`));
|
|
364
366
|
}
|
|
365
367
|
}
|
|
366
368
|
console.log(chalk_1.default.green('✅ Teardown complete!\n'));
|
|
@@ -390,15 +392,15 @@ function setupAiCommands(program) {
|
|
|
390
392
|
console.log(chalk_1.default.green(' ✓ Running'));
|
|
391
393
|
// Check what address it's listening on
|
|
392
394
|
try {
|
|
393
|
-
const output = (0, child_process_1.execSync)('ss -tlnp 2>/dev/null | grep
|
|
395
|
+
const output = (0, child_process_1.execSync)('ss -tlnp 2>/dev/null | grep 11435 || netstat -tlnp 2>/dev/null | grep 11435', {
|
|
394
396
|
encoding: 'utf8',
|
|
395
397
|
timeout: 2000
|
|
396
398
|
});
|
|
397
|
-
if (output.includes('0.0.0.0:
|
|
398
|
-
console.log(chalk_1.default.gray(' Listening on: 0.0.0.0:
|
|
399
|
+
if (output.includes('0.0.0.0:11435') || output.includes('*:11435')) {
|
|
400
|
+
console.log(chalk_1.default.gray(' Listening on: 0.0.0.0:11435 (accessible from network)'));
|
|
399
401
|
}
|
|
400
|
-
else if (output.includes('127.0.0.1:
|
|
401
|
-
console.log(chalk_1.default.yellow(' Listening on: 127.0.0.1:
|
|
402
|
+
else if (output.includes('127.0.0.1:11435')) {
|
|
403
|
+
console.log(chalk_1.default.yellow(' Listening on: 127.0.0.1:11435 (localhost only)'));
|
|
402
404
|
}
|
|
403
405
|
}
|
|
404
406
|
catch {
|
|
@@ -21,7 +21,7 @@ export interface AppConfig {
|
|
|
21
21
|
* Users can set these via shell/system environment variables.
|
|
22
22
|
*
|
|
23
23
|
* Available environment variables:
|
|
24
|
-
* - LOG_LEVEL: Set log level (default: '
|
|
24
|
+
* - LOG_LEVEL: Set log level (default: 'WARN')
|
|
25
25
|
* Note: API_BASE_URL is now hardcoded based on stage (STAGE or SST_STAGE env var)
|
|
26
26
|
* - NO_COLOR: Disable colored output (set to '1' or 'true')
|
|
27
27
|
* - PLAIN_OUTPUT: Enable plain text output (set to '1' or 'true')
|
|
@@ -23,7 +23,7 @@ const DEFAULT_INSTANCE_TYPE = 't3.micro';
|
|
|
23
23
|
* Users can set these via shell/system environment variables.
|
|
24
24
|
*
|
|
25
25
|
* Available environment variables:
|
|
26
|
-
* - LOG_LEVEL: Set log level (default: '
|
|
26
|
+
* - LOG_LEVEL: Set log level (default: 'WARN')
|
|
27
27
|
* Note: API_BASE_URL is now hardcoded based on stage (STAGE or SST_STAGE env var)
|
|
28
28
|
* - NO_COLOR: Disable colored output (set to '1' or 'true')
|
|
29
29
|
* - PLAIN_OUTPUT: Enable plain text output (set to '1' or 'true')
|
|
@@ -32,7 +32,7 @@ const DEFAULT_INSTANCE_TYPE = 't3.micro';
|
|
|
32
32
|
*/
|
|
33
33
|
function loadConfig() {
|
|
34
34
|
const apiBaseUrl = (0, urls_1.getApiBaseUrl)();
|
|
35
|
-
const logLevel = process.env.LOG_LEVEL || '
|
|
35
|
+
const logLevel = process.env.LOG_LEVEL || 'WARN';
|
|
36
36
|
const colorEnabled = process.env.NO_COLOR !== '1' && process.env.NO_COLOR !== 'true';
|
|
37
37
|
const plain = process.env.PLAIN_OUTPUT === '1' || process.env.PLAIN_OUTPUT === 'true';
|
|
38
38
|
const defaultRegion = process.env.DEFAULT_REGION || DEFAULT_REGION;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalAgentManager.d.ts","sourceRoot":"","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,OAAO,CAAC,sBAAsB;IAI9B;;OAEG;YACW,gBAAgB;IAgG9B;;OAEG;YACW,eAAe;IAgD7B;;OAEG;YACW,sBAAsB;IAkBpC;;OAEG;YACW,kBAAkB;CAkBjC"}
|
|
@@ -1207,7 +1207,7 @@ class LocalAgentManager {
|
|
|
1207
1207
|
const { execSync } = require('child_process');
|
|
1208
1208
|
// Use rsync for efficient directory copying (cross-platform)
|
|
1209
1209
|
try {
|
|
1210
|
-
execSync(`rsync -
|
|
1210
|
+
execSync(`rsync -a --exclude=node_modules/.cache --exclude=.git "${src}/" "${dest}/"`, { stdio: 'ignore' });
|
|
1211
1211
|
}
|
|
1212
1212
|
catch (error) {
|
|
1213
1213
|
// Fallback to manual copying if rsync is not available
|
|
@@ -1309,7 +1309,9 @@ 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}"`, {
|
|
1312
|
+
(0, child_process_1.execSync)(`unzip -q "${zipPath}" -d "${extractPath}"`, {
|
|
1313
|
+
stdio: 'ignore',
|
|
1314
|
+
});
|
|
1313
1315
|
// Copy extracted files to agent directory
|
|
1314
1316
|
await this.copyDirectory(extractPath, targetConfigPath);
|
|
1315
1317
|
// Make the agent binary executable
|
|
@@ -26,13 +26,14 @@ class AuthServiceImpl {
|
|
|
26
26
|
if (config.refreshToken) {
|
|
27
27
|
this.apiClient.setRefreshToken(config.refreshToken);
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
//
|
|
30
|
+
// this.logger.debug('Token restoration', {
|
|
31
|
+
// hasAccessToken: !!config.accessToken,
|
|
32
|
+
// hasIdToken: !!config.idToken,
|
|
33
|
+
// hasRefreshToken: !!config.refreshToken,
|
|
34
|
+
// organizationId: config.organizationId,
|
|
35
|
+
// deviceId: config.deviceId,
|
|
36
|
+
// });
|
|
36
37
|
}
|
|
37
38
|
async attemptAutoRelogin() {
|
|
38
39
|
const config = this.configRepository.getConfig();
|
|
@@ -3,10 +3,12 @@ export type DaemonType = 'systemd' | 'launchd' | 'windows-service' | 'docker' |
|
|
|
3
3
|
export declare class DaemonManagerFactory {
|
|
4
4
|
/**
|
|
5
5
|
* Create a daemon manager instance based on the type
|
|
6
|
+
* Only native daemon installations are supported (systemd, launchd, windows-service)
|
|
6
7
|
*/
|
|
7
8
|
static create(type: DaemonType): IDaemonManager;
|
|
8
9
|
/**
|
|
9
10
|
* Get daemon manager from stored config type
|
|
11
|
+
* Only native daemon types are supported
|
|
10
12
|
*/
|
|
11
13
|
static fromConfig(installationType?: string): IDaemonManager | null;
|
|
12
14
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DaemonManagerFactory.d.ts","sourceRoot":"","sources":["../../../src/services/daemon/DaemonManagerFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAQjE,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,iBAAiB,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEzF,qBAAa,oBAAoB;IAC/B
|
|
1
|
+
{"version":3,"file":"DaemonManagerFactory.d.ts","sourceRoot":"","sources":["../../../src/services/daemon/DaemonManagerFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAQjE,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,iBAAiB,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEzF,qBAAa,oBAAoB;IAC/B;;;OAGG;IACH,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,cAAc;IAiC/C;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI;IAwBnE;;OAEG;WACU,cAAc,IAAI,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;CAS9D"}
|
|
@@ -4,15 +4,18 @@ exports.DaemonManagerFactory = void 0;
|
|
|
4
4
|
const SystemdDaemonManager_1 = require("./SystemdDaemonManager");
|
|
5
5
|
const LaunchdDaemonManager_1 = require("./LaunchdDaemonManager");
|
|
6
6
|
const WindowsServiceDaemonManager_1 = require("./WindowsServiceDaemonManager");
|
|
7
|
-
const DockerDaemonManager_1 = require("./DockerDaemonManager");
|
|
8
|
-
const PodmanDaemonManager_1 = require("./PodmanDaemonManager");
|
|
9
7
|
const PlatformDetector_1 = require("../../utils/PlatformDetector");
|
|
10
8
|
class DaemonManagerFactory {
|
|
11
9
|
/**
|
|
12
10
|
* Create a daemon manager instance based on the type
|
|
11
|
+
* Only native daemon installations are supported (systemd, launchd, windows-service)
|
|
13
12
|
*/
|
|
14
13
|
static create(type) {
|
|
15
14
|
const platform = PlatformDetector_1.PlatformDetector.getPlatform();
|
|
15
|
+
// Block Docker and Podman installations
|
|
16
|
+
if (type === 'docker' || type === 'podman') {
|
|
17
|
+
throw new Error(`${type} installations are no longer supported. Please use native daemon installations (systemd, launchd, or windows-service).`);
|
|
18
|
+
}
|
|
16
19
|
switch (type) {
|
|
17
20
|
case 'systemd':
|
|
18
21
|
if (platform !== 'linux') {
|
|
@@ -29,16 +32,13 @@ class DaemonManagerFactory {
|
|
|
29
32
|
throw new Error('Windows Service is only available on Windows');
|
|
30
33
|
}
|
|
31
34
|
return new WindowsServiceDaemonManager_1.WindowsServiceDaemonManager();
|
|
32
|
-
case 'docker':
|
|
33
|
-
return new DockerDaemonManager_1.DockerDaemonManager();
|
|
34
|
-
case 'podman':
|
|
35
|
-
return new PodmanDaemonManager_1.PodmanDaemonManager();
|
|
36
35
|
default:
|
|
37
36
|
throw new Error(`Unknown daemon type: ${type}`);
|
|
38
37
|
}
|
|
39
38
|
}
|
|
40
39
|
/**
|
|
41
40
|
* Get daemon manager from stored config type
|
|
41
|
+
* Only native daemon types are supported
|
|
42
42
|
*/
|
|
43
43
|
static fromConfig(installationType) {
|
|
44
44
|
if (!installationType) {
|
|
@@ -48,6 +48,14 @@ class DaemonManagerFactory {
|
|
|
48
48
|
if (!validTypes.includes(installationType)) {
|
|
49
49
|
throw new Error(`Invalid installation type in config: ${installationType}`);
|
|
50
50
|
}
|
|
51
|
+
// Provide helpful error for legacy Docker/Podman installations
|
|
52
|
+
if (installationType === 'docker' || installationType === 'podman') {
|
|
53
|
+
throw new Error(`${installationType} installations are no longer supported.\n` +
|
|
54
|
+
`Please uninstall the current agent and reinstall using a native daemon:\n` +
|
|
55
|
+
` - Linux: systemd\n` +
|
|
56
|
+
` - macOS: launchd\n` +
|
|
57
|
+
` - Windows: windows-service`);
|
|
58
|
+
}
|
|
51
59
|
return this.create(installationType);
|
|
52
60
|
}
|
|
53
61
|
/**
|
package/dist/services/edgible.js
CHANGED
|
@@ -73,13 +73,13 @@ class EdgibleService {
|
|
|
73
73
|
this.apiClient.setRefreshToken(config.refreshToken);
|
|
74
74
|
}
|
|
75
75
|
// Log token restoration status for debugging
|
|
76
|
-
console.log('[EdgibleService] Token restoration:', {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
});
|
|
76
|
+
// console.log('[EdgibleService] Token restoration:', {
|
|
77
|
+
// hasAccessToken: !!config.accessToken,
|
|
78
|
+
// hasIdToken: !!config.idToken,
|
|
79
|
+
// hasRefreshToken: !!config.refreshToken,
|
|
80
|
+
// organizationId: config.organizationId,
|
|
81
|
+
// deviceId: config.deviceId
|
|
82
|
+
// });
|
|
83
83
|
}
|
|
84
84
|
async attemptAutoRelogin() {
|
|
85
85
|
const config = this.configManager.getConfig();
|
|
@@ -46,10 +46,12 @@ export declare class PlatformDetector {
|
|
|
46
46
|
static getNodePath(): Promise<string>;
|
|
47
47
|
/**
|
|
48
48
|
* Get all available installation options for the current platform
|
|
49
|
+
* Note: Only daemon-based installations are supported (systemd, launchd, windows-service)
|
|
49
50
|
*/
|
|
50
51
|
static getAvailableOptions(): Promise<InstallOption[]>;
|
|
51
52
|
/**
|
|
52
53
|
* Get the recommended installation type for the current platform
|
|
54
|
+
* Only native daemon installations are recommended
|
|
53
55
|
*/
|
|
54
56
|
static getRecommendedType(): Promise<InstallationType | null>;
|
|
55
57
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformDetector.d.ts","sourceRoot":"","sources":["../../src/utils/PlatformDetector.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AACpD,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,SAAS,GAAG,iBAAiB,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE/F,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,gBAAgB,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,qBAAa,gBAAgB;IAC3B;;OAEG;IACH,MAAM,CAAC,WAAW,IAAI,QAAQ;IAO9B;;OAEG;WACU,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAiBvC;;OAEG;WACU,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAa3C;;OAEG;WACU,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAW3C;;OAEG;WACU,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;IAW1C;;OAEG;WACU,SAAS,IAAI,OAAO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CAAC;IA2D5D;;;OAGG;WACU,kBAAkB,IAAI,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IA0BnE;;OAEG;IACH,MAAM,CAAC,yBAAyB,IAAI,MAAM;CAS3C"}
|
|
@@ -154,14 +154,13 @@ class PlatformDetector {
|
|
|
154
154
|
}
|
|
155
155
|
/**
|
|
156
156
|
* Get all available installation options for the current platform
|
|
157
|
+
* Note: Only daemon-based installations are supported (systemd, launchd, windows-service)
|
|
157
158
|
*/
|
|
158
159
|
static async getAvailableOptions() {
|
|
159
160
|
const platform = this.getPlatform();
|
|
160
161
|
const isRoot = await this.isRoot();
|
|
161
162
|
const hasSystemd = await this.hasSystemd();
|
|
162
163
|
const hasLaunchd = await this.hasLaunchd();
|
|
163
|
-
const hasDocker = await this.hasDocker();
|
|
164
|
-
const hasPodman = await this.hasPodman();
|
|
165
164
|
const options = [];
|
|
166
165
|
// Linux: systemd option
|
|
167
166
|
if (platform === 'linux') {
|
|
@@ -205,34 +204,13 @@ class PlatformDetector {
|
|
|
205
204
|
requiresRoot: true
|
|
206
205
|
});
|
|
207
206
|
}
|
|
208
|
-
// Docker
|
|
209
|
-
|
|
210
|
-
type: 'docker',
|
|
211
|
-
name: 'Docker Container',
|
|
212
|
-
description: 'Run as a Docker container with systemd/launchd wrapper',
|
|
213
|
-
requires: ['Docker', platform !== 'win32' ? 'root privileges' : 'Docker Desktop'],
|
|
214
|
-
pros: ['Isolated environment', 'Easy updates', 'Cross-platform', 'Reproducible'],
|
|
215
|
-
cons: ['Requires Docker daemon', 'Slight performance overhead', 'Needs privileged mode'],
|
|
216
|
-
bestFor: 'Containerized infrastructure, development, CI/CD',
|
|
217
|
-
available: hasDocker && (platform === 'win32' || isRoot),
|
|
218
|
-
requiresRoot: platform !== 'win32'
|
|
219
|
-
});
|
|
220
|
-
// Podman option (all platforms)
|
|
221
|
-
options.push({
|
|
222
|
-
type: 'podman',
|
|
223
|
-
name: 'Podman Container (Rootless)',
|
|
224
|
-
description: 'Run as a rootless Podman container',
|
|
225
|
-
requires: ['Podman'],
|
|
226
|
-
pros: ['Rootless operation', 'Container isolation', 'Docker-compatible', 'No daemon required'],
|
|
227
|
-
cons: ['Requires Podman', 'Some network limitations in rootless mode'],
|
|
228
|
-
bestFor: 'User-space deployments, restricted environments, development',
|
|
229
|
-
available: hasPodman,
|
|
230
|
-
requiresRoot: false
|
|
231
|
-
});
|
|
207
|
+
// Note: Docker and Podman options are no longer supported
|
|
208
|
+
// Only native daemon installations (systemd, launchd, windows-service) are available
|
|
232
209
|
return options;
|
|
233
210
|
}
|
|
234
211
|
/**
|
|
235
212
|
* Get the recommended installation type for the current platform
|
|
213
|
+
* Only native daemon installations are recommended
|
|
236
214
|
*/
|
|
237
215
|
static async getRecommendedType() {
|
|
238
216
|
const options = await this.getAvailableOptions();
|
|
@@ -240,7 +218,7 @@ class PlatformDetector {
|
|
|
240
218
|
if (available.length === 0) {
|
|
241
219
|
return null;
|
|
242
220
|
}
|
|
243
|
-
//
|
|
221
|
+
// Only native daemon options are supported
|
|
244
222
|
const platform = this.getPlatform();
|
|
245
223
|
if (platform === 'linux' && available.find(opt => opt.type === 'systemd')) {
|
|
246
224
|
return 'systemd';
|
|
@@ -251,13 +229,6 @@ class PlatformDetector {
|
|
|
251
229
|
if (platform === 'win32' && available.find(opt => opt.type === 'windows-service')) {
|
|
252
230
|
return 'windows-service';
|
|
253
231
|
}
|
|
254
|
-
// Fall back to containers
|
|
255
|
-
if (available.find(opt => opt.type === 'docker')) {
|
|
256
|
-
return 'docker';
|
|
257
|
-
}
|
|
258
|
-
if (available.find(opt => opt.type === 'podman')) {
|
|
259
|
-
return 'podman';
|
|
260
|
-
}
|
|
261
232
|
return null;
|
|
262
233
|
}
|
|
263
234
|
/**
|