@tnunamak/dalan 0.6.0 → 0.6.2
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/CHANGELOG.md +17 -0
- package/README.md +4 -0
- package/docs/codex-to-muse.md +25 -19
- package/docs/dalan-upgrade.md +2 -2
- package/docs/local-agent-mcp.md +2 -2
- package/docs/service-setup.md +30 -0
- package/docs/t3-integration.md +1 -1
- package/docs/worker-clients.md +1 -1
- package/package.json +1 -1
- package/scripts/lib/expose-tailscale.mjs +1 -1
- package/src/cli-help.mjs +8 -2
- package/src/server.mjs +36 -2
- package/src/service-auto-update.mjs +61 -0
- package/src/service-update-gate.mjs +20 -0
- package/src/service-update-lock.mjs +22 -0
- package/src/service-update-runtime.mjs +256 -0
- package/src/service-update.mjs +393 -0
- package/src/service.mjs +120 -14
- package/src/try-exposure.mjs +17 -7
package/src/try-exposure.mjs
CHANGED
|
@@ -153,7 +153,8 @@ export function tailscaleProvider({ port: wantedPort = TRIAL_PORT, name = 'tails
|
|
|
153
153
|
const quote = value => "'" + String(value).replaceAll("'", "'\\''") + "'";
|
|
154
154
|
const keys = ['HOME', 'PATH', 'XDG_CONFIG_HOME', 'XDG_DATA_HOME', 'XDG_STATE_HOME', 'XDG_RUNTIME_DIR', 'TMPDIR'];
|
|
155
155
|
const assignments = keys.filter(key => env[key] !== undefined).map(key => `${key}=${quote(env[key])}`);
|
|
156
|
-
|
|
156
|
+
// A rule that someone else replaced is not ours to switch off: offer no port-wide command for it.
|
|
157
|
+
const command = error.code !== 'FUNNEL_RULE_MISMATCH' && cli && path.isAbsolute(cli)
|
|
157
158
|
? `(unset ${keys.join(' ')} && ${[...assignments, quote(cli), ...funnelOffArgs(rule.port).map(quote)].join(' ')})`
|
|
158
159
|
: null;
|
|
159
160
|
return { removed: false, detail: error.message, ...(command ? { command } : {}) };
|
|
@@ -512,6 +513,18 @@ const bundledGozar = () => {
|
|
|
512
513
|
}
|
|
513
514
|
};
|
|
514
515
|
|
|
516
|
+
export function resolveGozarCommand({ env = process.env, which = name => whichOnPath(name, env), resolveBundled = bundledGozar } = {}) {
|
|
517
|
+
const bundled = resolveBundled();
|
|
518
|
+
if (bundled) return { binary: process.execPath, args: [bundled] };
|
|
519
|
+
if (env.GOZAR_BIN) {
|
|
520
|
+
try {
|
|
521
|
+
fs.accessSync(env.GOZAR_BIN, fs.constants.X_OK);
|
|
522
|
+
return { binary: env.GOZAR_BIN, args: [] };
|
|
523
|
+
} catch { /* unavailable */ }
|
|
524
|
+
}
|
|
525
|
+
return { binary: which('gozar'), args: [] };
|
|
526
|
+
}
|
|
527
|
+
|
|
515
528
|
export function gozarProvider({ env = process.env, which = name => whichOnPath(name, env), resolveBundled = bundledGozar, run = execFile, pollMs = 3000, now = Date.now } = {}) {
|
|
516
529
|
let binary = null, bundled = null, commandCwd = null, port = null, sessionId = null;
|
|
517
530
|
let endReason = null;
|
|
@@ -559,12 +572,9 @@ export function gozarProvider({ env = process.env, which = name => whichOnPath(n
|
|
|
559
572
|
name: 'gozar',
|
|
560
573
|
probe() {
|
|
561
574
|
commandCwd = process.cwd();
|
|
562
|
-
|
|
563
|
-
binary =
|
|
564
|
-
|
|
565
|
-
try { fs.accessSync(env.GOZAR_BIN, fs.constants.X_OK); binary = env.GOZAR_BIN; } catch { /* unavailable */ }
|
|
566
|
-
}
|
|
567
|
-
binary ??= which('gozar');
|
|
575
|
+
const resolved = resolveGozarCommand({ env, which, resolveBundled });
|
|
576
|
+
binary = resolved.binary;
|
|
577
|
+
bundled = resolved.args[0] ?? null;
|
|
568
578
|
return binary ? { ok: true } : { ok: false, line: 'Gozar is not installed', fix: 'Install gozar on PATH or set GOZAR_BIN to its executable path.' };
|
|
569
579
|
},
|
|
570
580
|
async start({ gatePort, signal, lifetimeEndsAt }) {
|