overlord-cli 0.2606081356.0 → 0.2606081442.0
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/bin/_cli/runner.mjs +3 -20
- package/package.json +1 -1
package/bin/_cli/runner.mjs
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { execFileSync, spawn } from 'node:child_process';
|
|
4
|
-
import crypto from 'node:crypto';
|
|
5
|
-
import fs from 'node:fs';
|
|
6
4
|
import os from 'node:os';
|
|
7
|
-
|
|
5
|
+
|
|
6
|
+
import { readOrCreateCanonicalDeviceFingerprintSync } from '../../../../lib/overlord/device-identity.mjs';
|
|
8
7
|
|
|
9
8
|
const OVLD_ENTRY = process.argv[1];
|
|
10
|
-
const DEVICE_FILE = path.join(os.homedir(), '.ovld', 'device.json');
|
|
11
9
|
const DEFAULT_TMUX_COMMAND = 'tmux new-session bash {script}';
|
|
12
10
|
|
|
13
11
|
/** @internal Test-only overrides for protocol/launch subprocess calls. */
|
|
@@ -65,22 +63,7 @@ export function readOrCreateDeviceFingerprint(flags) {
|
|
|
65
63
|
typeof flags['device-fingerprint'] === 'string'
|
|
66
64
|
? flags['device-fingerprint'].trim()
|
|
67
65
|
: process.env.OVERLORD_DEVICE_FINGERPRINT?.trim();
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
try {
|
|
71
|
-
const raw = fs.readFileSync(DEVICE_FILE, 'utf8');
|
|
72
|
-
const parsed = JSON.parse(raw);
|
|
73
|
-
if (typeof parsed.deviceFingerprint === 'string' && parsed.deviceFingerprint.trim()) {
|
|
74
|
-
return parsed.deviceFingerprint.trim();
|
|
75
|
-
}
|
|
76
|
-
} catch {
|
|
77
|
-
// Create below.
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const deviceFingerprint = crypto.randomUUID();
|
|
81
|
-
fs.mkdirSync(path.dirname(DEVICE_FILE), { recursive: true });
|
|
82
|
-
fs.writeFileSync(DEVICE_FILE, `${JSON.stringify({ deviceFingerprint }, null, 2)}\n`, 'utf8');
|
|
83
|
-
return deviceFingerprint;
|
|
66
|
+
return readOrCreateCanonicalDeviceFingerprintSync({ explicitFingerprint: explicit });
|
|
84
67
|
}
|
|
85
68
|
|
|
86
69
|
function runOvld(args, env = {}) {
|