@episoda/cli 0.2.167 → 0.2.169
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/daemon/daemon-process.js +2335 -2437
- package/dist/daemon/daemon-process.js.map +1 -1
- package/dist/index.js +10 -32
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4532,40 +4532,14 @@ shell.Run cmd, 0, False
|
|
|
4532
4532
|
}
|
|
4533
4533
|
}
|
|
4534
4534
|
|
|
4535
|
-
// src/
|
|
4536
|
-
|
|
4537
|
-
async function promptYesNo(question, defaultValue = true) {
|
|
4538
|
-
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
4539
|
-
return defaultValue;
|
|
4540
|
-
}
|
|
4541
|
-
const rl = readline.createInterface({
|
|
4542
|
-
input: process.stdin,
|
|
4543
|
-
output: process.stdout
|
|
4544
|
-
});
|
|
4545
|
-
const suffix = defaultValue ? " [Y/n] " : " [y/N] ";
|
|
4546
|
-
const answer = await new Promise((resolve5) => {
|
|
4547
|
-
rl.question(`${question}${suffix}`, (response) => resolve5(response));
|
|
4548
|
-
});
|
|
4549
|
-
rl.close();
|
|
4550
|
-
const normalized = answer.trim().toLowerCase();
|
|
4551
|
-
if (!normalized) return defaultValue;
|
|
4552
|
-
return normalized === "y" || normalized === "yes";
|
|
4553
|
-
}
|
|
4554
|
-
|
|
4555
|
-
// src/commands/daemon.ts
|
|
4556
|
-
var CONNECTION_MAX_RETRIES = 3;
|
|
4557
|
-
var FOREGROUND_DAEMON_MONITOR_INTERVAL_MS = 5e3;
|
|
4558
|
-
async function maybeRegisterProtocolHandler() {
|
|
4535
|
+
// src/commands/protocol-registration.ts
|
|
4536
|
+
async function ensureProtocolHandlerRegistered() {
|
|
4559
4537
|
if (process.env.EPISODA_PROTOCOL_INVOKE === "1") {
|
|
4560
4538
|
return;
|
|
4561
4539
|
}
|
|
4562
4540
|
if (isProtocolHandlerRegistered()) {
|
|
4563
4541
|
return;
|
|
4564
4542
|
}
|
|
4565
|
-
const shouldRegister = await promptYesNo("Register episoda:// for one-click reconnects?");
|
|
4566
|
-
if (!shouldRegister) {
|
|
4567
|
-
return;
|
|
4568
|
-
}
|
|
4569
4543
|
const result = registerProtocolHandler();
|
|
4570
4544
|
if (result.success) {
|
|
4571
4545
|
status.success(result.message || "Protocol handler registered.");
|
|
@@ -4573,6 +4547,10 @@ async function maybeRegisterProtocolHandler() {
|
|
|
4573
4547
|
status.warning(`Protocol handler not registered: ${result.error}`);
|
|
4574
4548
|
}
|
|
4575
4549
|
}
|
|
4550
|
+
|
|
4551
|
+
// src/commands/daemon.ts
|
|
4552
|
+
var CONNECTION_MAX_RETRIES = 3;
|
|
4553
|
+
var FOREGROUND_DAEMON_MONITOR_INTERVAL_MS = 5e3;
|
|
4576
4554
|
function findGitRoot(startDir) {
|
|
4577
4555
|
try {
|
|
4578
4556
|
const result = (0, import_child_process5.execSync)("git rev-parse --show-toplevel", {
|
|
@@ -4736,7 +4714,7 @@ async function daemonCommand(options = {}) {
|
|
|
4736
4714
|
} else {
|
|
4737
4715
|
status.success("Connected to Episoda");
|
|
4738
4716
|
}
|
|
4739
|
-
await
|
|
4717
|
+
await ensureProtocolHandlerRegistered();
|
|
4740
4718
|
if (options.foreground) {
|
|
4741
4719
|
status.info("");
|
|
4742
4720
|
if (isCloudMode) {
|
|
@@ -7279,7 +7257,7 @@ function printExports(envVars) {
|
|
|
7279
7257
|
// src/commands/env.ts
|
|
7280
7258
|
var fs14 = __toESM(require("fs"));
|
|
7281
7259
|
var path16 = __toESM(require("path"));
|
|
7282
|
-
var
|
|
7260
|
+
var readline = __toESM(require("readline"));
|
|
7283
7261
|
var import_core17 = __toESM(require_dist());
|
|
7284
7262
|
async function envListCommand(options = {}) {
|
|
7285
7263
|
const config = await (0, import_core17.loadConfig)();
|
|
@@ -7475,7 +7453,7 @@ async function envPullCommand(options = {}) {
|
|
|
7475
7453
|
async function promptForValue(key) {
|
|
7476
7454
|
if (!process.stdin.isTTY) {
|
|
7477
7455
|
return new Promise((resolve5, reject) => {
|
|
7478
|
-
const rl =
|
|
7456
|
+
const rl = readline.createInterface({
|
|
7479
7457
|
input: process.stdin,
|
|
7480
7458
|
output: process.stdout
|
|
7481
7459
|
});
|
|
@@ -7489,7 +7467,7 @@ async function promptForValue(key) {
|
|
|
7489
7467
|
});
|
|
7490
7468
|
}
|
|
7491
7469
|
return new Promise((resolve5, reject) => {
|
|
7492
|
-
const rl =
|
|
7470
|
+
const rl = readline.createInterface({
|
|
7493
7471
|
input: process.stdin,
|
|
7494
7472
|
output: process.stdout
|
|
7495
7473
|
});
|