chatroom-cli 1.61.4 → 1.62.1
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/index.js +82 -1
- package/dist/index.js.map +5 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -82456,6 +82456,54 @@ var init_local_actions = __esm(() => {
|
|
|
82456
82456
|
init_execute_local_action();
|
|
82457
82457
|
});
|
|
82458
82458
|
|
|
82459
|
+
// src/infrastructure/local-actions/pick-folder.ts
|
|
82460
|
+
import { execFileSync } from "node:child_process";
|
|
82461
|
+
function runPicker(command, args2) {
|
|
82462
|
+
try {
|
|
82463
|
+
const path6 = execFileSync(command, args2, { encoding: "utf8", timeout: 300000 }).trim();
|
|
82464
|
+
if (!path6)
|
|
82465
|
+
return { success: false, error: "No folder selected" };
|
|
82466
|
+
return { success: true, path: path6 };
|
|
82467
|
+
} catch (error) {
|
|
82468
|
+
const exitCode = typeof error === "object" && error !== null && "status" in error ? error.status : null;
|
|
82469
|
+
if (exitCode === 1)
|
|
82470
|
+
return { success: false, error: "Cancelled", cancelled: true };
|
|
82471
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
82472
|
+
return { success: false, error: message };
|
|
82473
|
+
}
|
|
82474
|
+
}
|
|
82475
|
+
function pickFolderDialog() {
|
|
82476
|
+
switch (process.platform) {
|
|
82477
|
+
case "darwin":
|
|
82478
|
+
return runPicker("osascript", [
|
|
82479
|
+
"-e",
|
|
82480
|
+
'POSIX path of (choose folder with prompt "Select workspace folder")'
|
|
82481
|
+
]);
|
|
82482
|
+
case "win32":
|
|
82483
|
+
return runPicker("powershell", [
|
|
82484
|
+
"-NoProfile",
|
|
82485
|
+
"-Command",
|
|
82486
|
+
[
|
|
82487
|
+
"Add-Type -AssemblyName System.Windows.Forms",
|
|
82488
|
+
"$dialog = New-Object System.Windows.Forms.FolderBrowserDialog",
|
|
82489
|
+
'$dialog.Description = "Select workspace folder"',
|
|
82490
|
+
"if ($dialog.ShowDialog() -eq [System.Windows.Forms.DialogResult]::OK) {",
|
|
82491
|
+
" Write-Output $dialog.SelectedPath",
|
|
82492
|
+
" exit 0",
|
|
82493
|
+
"}",
|
|
82494
|
+
"exit 1"
|
|
82495
|
+
].join("; ")
|
|
82496
|
+
]);
|
|
82497
|
+
default:
|
|
82498
|
+
return runPicker("zenity", [
|
|
82499
|
+
"--file-selection",
|
|
82500
|
+
"--directory",
|
|
82501
|
+
"--title=Select workspace folder"
|
|
82502
|
+
]);
|
|
82503
|
+
}
|
|
82504
|
+
}
|
|
82505
|
+
var init_pick_folder = () => {};
|
|
82506
|
+
|
|
82459
82507
|
// src/commands/machine/pid.ts
|
|
82460
82508
|
import { createHash as createHash5 } from "node:crypto";
|
|
82461
82509
|
import { existsSync as existsSync6, readFileSync as readFileSync8, writeFileSync as writeFileSync4, unlinkSync as unlinkSync2, mkdirSync as mkdirSync5 } from "node:fs";
|
|
@@ -106426,6 +106474,7 @@ function evictStaleDedupEntries(tracker) {
|
|
|
106426
106474
|
evictStaleEntries(tracker.gitRefreshIds, evictBefore);
|
|
106427
106475
|
evictStaleEntries(tracker.capabilitiesRefreshIds, evictBefore);
|
|
106428
106476
|
evictStaleEntries(tracker.localActionIds, evictBefore);
|
|
106477
|
+
evictStaleEntries(tracker.pickFolderIds, evictBefore);
|
|
106429
106478
|
evictStaleEntries(tracker.commandRunIds, evictBefore);
|
|
106430
106479
|
evictStaleEntries(tracker.commandStopIds, evictBefore);
|
|
106431
106480
|
processManager.evictStalePendingStops();
|
|
@@ -106498,6 +106547,35 @@ function handleLocalActionCommandEffect(event, tracker) {
|
|
|
106498
106547
|
tracker.localActionIds.set(eventId, Date.now());
|
|
106499
106548
|
});
|
|
106500
106549
|
}
|
|
106550
|
+
function handlePickFolderCommandEffect(event, tracker) {
|
|
106551
|
+
return exports_Effect.gen(function* () {
|
|
106552
|
+
const eventId = event._id.toString();
|
|
106553
|
+
if (tracker.pickFolderIds.has(eventId))
|
|
106554
|
+
return;
|
|
106555
|
+
const typedEvent = event;
|
|
106556
|
+
console.log(`[${formatTimestamp()}] \uD83D\uDCC2 Folder picker requested`);
|
|
106557
|
+
const result = yield* exports_Effect.sync(() => pickFolderDialog());
|
|
106558
|
+
const session2 = yield* DaemonSessionService;
|
|
106559
|
+
const status3 = result.success ? "completed" : result.cancelled ? "cancelled" : "failed";
|
|
106560
|
+
yield* exports_Effect.tryPromise({
|
|
106561
|
+
try: () => session2.backend.mutation(api.machines.reportFolderPickerResult, {
|
|
106562
|
+
sessionId: session2.sessionId,
|
|
106563
|
+
requestId: typedEvent.requestId,
|
|
106564
|
+
machineId: session2.machineId,
|
|
106565
|
+
status: status3,
|
|
106566
|
+
selectedPath: result.success ? result.path : undefined,
|
|
106567
|
+
errorMessage: result.success ? undefined : result.error
|
|
106568
|
+
}),
|
|
106569
|
+
catch: (error51) => error51
|
|
106570
|
+
}).pipe(exports_Effect.catchAll((error51) => exports_Effect.sync(() => {
|
|
106571
|
+
console.warn(`[${formatTimestamp()}] ⚠️ Folder picker report failed: ${getErrorMessage(error51)}`);
|
|
106572
|
+
})));
|
|
106573
|
+
if (!result.success && !result.cancelled) {
|
|
106574
|
+
console.warn(`[${formatTimestamp()}] ⚠️ Folder picker failed: ${result.error}`);
|
|
106575
|
+
}
|
|
106576
|
+
tracker.pickFolderIds.set(eventId, Date.now());
|
|
106577
|
+
});
|
|
106578
|
+
}
|
|
106501
106579
|
function handleCommandRunEffect(event, tracker) {
|
|
106502
106580
|
return exports_Effect.gen(function* () {
|
|
106503
106581
|
const eventId = event._id.toString();
|
|
@@ -106568,6 +106646,7 @@ var init_command_loop = __esm(() => {
|
|
|
106568
106646
|
init_on_daemon_shutdown();
|
|
106569
106647
|
init_client2();
|
|
106570
106648
|
init_local_actions();
|
|
106649
|
+
init_pick_folder();
|
|
106571
106650
|
init_convex_error();
|
|
106572
106651
|
init_pid();
|
|
106573
106652
|
init_daemon_services();
|
|
@@ -106592,6 +106671,7 @@ var init_command_loop = __esm(() => {
|
|
|
106592
106671
|
"daemon.ping": handlePingCommandEffect,
|
|
106593
106672
|
"daemon.gitRefresh": handleGitRefreshCommandEffect,
|
|
106594
106673
|
"daemon.localAction": handleLocalActionCommandEffect,
|
|
106674
|
+
"daemon.pickFolder": handlePickFolderCommandEffect,
|
|
106595
106675
|
"command.run": handleCommandRunEffect,
|
|
106596
106676
|
"command.stop": handleCommandStopEffect,
|
|
106597
106677
|
"daemon.refreshCapabilities": handleRefreshCapabilitiesEffect
|
|
@@ -106756,6 +106836,7 @@ Listening for commands...`);
|
|
|
106756
106836
|
gitRefreshIds: new Map,
|
|
106757
106837
|
capabilitiesRefreshIds: new Map,
|
|
106758
106838
|
localActionIds: new Map,
|
|
106839
|
+
pickFolderIds: new Map,
|
|
106759
106840
|
commandRunIds: new Map,
|
|
106760
106841
|
commandStopIds: new Map
|
|
106761
106842
|
};
|
|
@@ -107855,4 +107936,4 @@ program2.hook("preAction", async (_thisCommand, actionCommand) => {
|
|
|
107855
107936
|
});
|
|
107856
107937
|
program2.parse();
|
|
107857
107938
|
|
|
107858
|
-
//# debugId=
|
|
107939
|
+
//# debugId=397B148D091FEB8464756E2164756E21
|