@just-every/manager 0.1.5 → 0.1.8
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/README.md +3 -0
- package/bin/justevery-manager.js +3 -4
- package/lib/installer.js +15 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,6 +17,9 @@ justevery-manager
|
|
|
17
17
|
Use `--download-only` to cache the installer without launching it, and
|
|
18
18
|
`--print-path` to print the cached path.
|
|
19
19
|
|
|
20
|
+
On headless Linux, the wrapper will download and run the headless daemon
|
|
21
|
+
(`Every.Manager_*_linux_amd64_headless`) when available.
|
|
22
|
+
|
|
20
23
|
## Environment
|
|
21
24
|
|
|
22
25
|
- `JE_AGENT_VERSION` – override the agent version.
|
package/bin/justevery-manager.js
CHANGED
|
@@ -6,11 +6,10 @@ const args = process.argv.slice(2);
|
|
|
6
6
|
const wantsHelp = args.includes('--help') || args.includes('-h');
|
|
7
7
|
const skipLaunchEnv = process.env.JE_AGENT_SKIP_LAUNCH === '1' || process.env.JE_MANAGER_SKIP_LAUNCH === '1';
|
|
8
8
|
const sessionType = (process.env.XDG_SESSION_TYPE || '').toLowerCase();
|
|
9
|
-
const isSsh = Boolean(process.env.SSH_CONNECTION || process.env.SSH_TTY || process.env.SSH_CLIENT);
|
|
10
9
|
const hasDisplay = Boolean(process.env.DISPLAY || process.env.WAYLAND_DISPLAY);
|
|
11
|
-
const hasGuiSession = Boolean(sessionType) && sessionType !== 'tty';
|
|
12
|
-
const isHeadlessLinux = osPlatform() === 'linux' &&
|
|
13
|
-
const downloadOnly = args.includes('--download-only') || args.includes('--no-open') || skipLaunchEnv
|
|
10
|
+
const hasGuiSession = hasDisplay || (Boolean(sessionType) && sessionType !== 'tty');
|
|
11
|
+
const isHeadlessLinux = osPlatform() === 'linux' && !hasGuiSession;
|
|
12
|
+
const downloadOnly = args.includes('--download-only') || args.includes('--no-open') || skipLaunchEnv;
|
|
14
13
|
const printPath = args.includes('--print-path');
|
|
15
14
|
|
|
16
15
|
if (wantsHelp) {
|
package/lib/installer.js
CHANGED
|
@@ -164,6 +164,16 @@ function buildCandidateFiles(version) {
|
|
|
164
164
|
return [extra];
|
|
165
165
|
}
|
|
166
166
|
const files = new Set();
|
|
167
|
+
const prefersHeadless = platform === 'linux' && shouldSkipLaunch();
|
|
168
|
+
if (prefersHeadless) {
|
|
169
|
+
for (const prefix of FILE_PREFIXES) {
|
|
170
|
+
if (prefix !== 'Every.Manager') continue;
|
|
171
|
+
for (const arch of archCandidates) {
|
|
172
|
+
files.add(`${prefix}_${version}_linux_${arch}_headless`);
|
|
173
|
+
files.add(`${prefix}_${version}_${arch}_headless`);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
167
177
|
if (platform === 'win32') {
|
|
168
178
|
for (const prefix of FILE_PREFIXES) {
|
|
169
179
|
for (const arch of archCandidates) {
|
|
@@ -310,7 +320,6 @@ async function downloadInstaller(baseUrl, fileName, dest) {
|
|
|
310
320
|
|
|
311
321
|
function ensureExecutable(path) {
|
|
312
322
|
if (osPlatform() !== 'linux') return;
|
|
313
|
-
if (!path.endsWith('.AppImage')) return;
|
|
314
323
|
try {
|
|
315
324
|
chmodSync(path, 0o755);
|
|
316
325
|
} catch {}
|
|
@@ -323,9 +332,8 @@ function shouldSkipLaunch() {
|
|
|
323
332
|
if (osPlatform() !== 'linux') return false;
|
|
324
333
|
const hasDisplay = Boolean(process.env.DISPLAY || process.env.WAYLAND_DISPLAY);
|
|
325
334
|
const sessionType = (process.env.XDG_SESSION_TYPE || '').toLowerCase();
|
|
326
|
-
const hasGuiSession = Boolean(sessionType) && sessionType !== 'tty';
|
|
327
|
-
|
|
328
|
-
return !hasDisplay || !hasGuiSession || isSsh;
|
|
335
|
+
const hasGuiSession = hasDisplay || (Boolean(sessionType) && sessionType !== 'tty');
|
|
336
|
+
return !hasGuiSession;
|
|
329
337
|
}
|
|
330
338
|
|
|
331
339
|
export async function resolveAgentVersion() {
|
|
@@ -378,6 +386,9 @@ export async function ensureInstaller({ allowDownload = true } = {}) {
|
|
|
378
386
|
|
|
379
387
|
export function launchInstaller(installerPath) {
|
|
380
388
|
const platform = osPlatform();
|
|
389
|
+
if (platform === 'linux' && installerPath.includes('_headless')) {
|
|
390
|
+
return runCommand(installerPath, []);
|
|
391
|
+
}
|
|
381
392
|
if (shouldSkipLaunch()) {
|
|
382
393
|
console.log('Every Manager installer downloaded. Launch skipped in this environment.');
|
|
383
394
|
console.log(`Installer path: ${installerPath}`);
|