theclawbay 0.3.81 → 0.3.83
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/commands/logout.js +14 -0
- package/dist/commands/setup.js +14 -0
- package/dist/lib/device-session-auth.js +11 -3
- package/package.json +1 -1
package/dist/commands/logout.js
CHANGED
|
@@ -865,6 +865,8 @@ function powerShellProfilePaths() {
|
|
|
865
865
|
}
|
|
866
866
|
if (!isWslInteropRuntime())
|
|
867
867
|
return [];
|
|
868
|
+
if (!shouldManageWindowsHostProfilesFromWsl())
|
|
869
|
+
return [];
|
|
868
870
|
addDocumentsProfiles(resolveWindowsDocumentsDirForHost());
|
|
869
871
|
addDocumentsProfiles(resolveWindowsPathForHost(node_path_1.default.join(resolveWindowsHomeDirForHost() ?? "", "Documents")));
|
|
870
872
|
return [...candidates];
|
|
@@ -872,6 +874,18 @@ function powerShellProfilePaths() {
|
|
|
872
874
|
function isWslInteropRuntime() {
|
|
873
875
|
return node_os_1.default.platform() === "linux" && Boolean(process.env.WSL_DISTRO_NAME || process.env.WSL_INTEROP);
|
|
874
876
|
}
|
|
877
|
+
function shouldManageWindowsHostProfilesFromWsl() {
|
|
878
|
+
const mode = (process.env.THECLAWBAY_WINDOWS_PROFILE_MODE ?? "").trim().toLowerCase();
|
|
879
|
+
if (mode === "always")
|
|
880
|
+
return true;
|
|
881
|
+
if (mode === "never")
|
|
882
|
+
return false;
|
|
883
|
+
const home = process.env.HOME?.trim() ?? "";
|
|
884
|
+
const user = process.env.USER?.trim() ?? "";
|
|
885
|
+
if (!home || !user)
|
|
886
|
+
return true;
|
|
887
|
+
return home === node_path_1.default.posix.join("/home", user);
|
|
888
|
+
}
|
|
875
889
|
function readWindowsCommandStdout(command) {
|
|
876
890
|
const shell = node_os_1.default.platform() === "win32" ? "powershell.exe" : isWslInteropRuntime() ? "powershell.exe" : null;
|
|
877
891
|
if (!shell)
|
package/dist/commands/setup.js
CHANGED
|
@@ -2569,6 +2569,8 @@ function powerShellProfilePaths() {
|
|
|
2569
2569
|
}
|
|
2570
2570
|
if (!isWslInteropRuntime())
|
|
2571
2571
|
return [];
|
|
2572
|
+
if (!shouldManageWindowsHostProfilesFromWsl())
|
|
2573
|
+
return [];
|
|
2572
2574
|
addDocumentsProfiles(resolveWindowsDocumentsDirForHost());
|
|
2573
2575
|
addDocumentsProfiles(resolveWindowsPathForHost(node_path_1.default.join(resolveWindowsHomeDirForHost() ?? "", "Documents")));
|
|
2574
2576
|
return [...candidates];
|
|
@@ -2576,6 +2578,18 @@ function powerShellProfilePaths() {
|
|
|
2576
2578
|
function isWslInteropRuntime() {
|
|
2577
2579
|
return node_os_1.default.platform() === "linux" && Boolean(process.env.WSL_DISTRO_NAME || process.env.WSL_INTEROP);
|
|
2578
2580
|
}
|
|
2581
|
+
function shouldManageWindowsHostProfilesFromWsl() {
|
|
2582
|
+
const mode = (process.env.THECLAWBAY_WINDOWS_PROFILE_MODE ?? "").trim().toLowerCase();
|
|
2583
|
+
if (mode === "always")
|
|
2584
|
+
return true;
|
|
2585
|
+
if (mode === "never")
|
|
2586
|
+
return false;
|
|
2587
|
+
const home = process.env.HOME?.trim() ?? "";
|
|
2588
|
+
const user = process.env.USER?.trim() ?? "";
|
|
2589
|
+
if (!home || !user)
|
|
2590
|
+
return true;
|
|
2591
|
+
return home === node_path_1.default.posix.join("/home", user);
|
|
2592
|
+
}
|
|
2579
2593
|
function readWindowsCommandStdout(command) {
|
|
2580
2594
|
const shell = node_os_1.default.platform() === "win32" ? "powershell.exe" : isWslInteropRuntime() ? "powershell.exe" : null;
|
|
2581
2595
|
if (!shell)
|
|
@@ -14,6 +14,13 @@ const paths_1 = require("./config/paths");
|
|
|
14
14
|
const BROWSER_SETUP_TIMEOUT_MS = 15 * 60000;
|
|
15
15
|
const BROWSER_SETUP_POLL_INTERVAL_MS = 2000;
|
|
16
16
|
const INSTALL_ID_PATH = node_path_1.default.join(paths_1.theclawbayConfigDir, "install-id");
|
|
17
|
+
const DEFAULT_SETUP_SITE_URL = "https://theclawbay.com";
|
|
18
|
+
function setupSiteBaseUrl() {
|
|
19
|
+
const override = process.env.THECLAWBAY_SETUP_SITE_URL?.trim();
|
|
20
|
+
if (override)
|
|
21
|
+
return override;
|
|
22
|
+
return DEFAULT_SETUP_SITE_URL;
|
|
23
|
+
}
|
|
17
24
|
function preferredBrowserCallbackPort() {
|
|
18
25
|
const parsed = Number(process.env.THECLAWBAY_CALLBACK_PORT?.trim() || "");
|
|
19
26
|
if (Number.isFinite(parsed) && parsed > 0 && parsed < 65536) {
|
|
@@ -155,7 +162,7 @@ async function createLocalCallbackServer(expectedState) {
|
|
|
155
162
|
};
|
|
156
163
|
}
|
|
157
164
|
async function exchangeBrowserSetupSession(params) {
|
|
158
|
-
const exchangeResponse = await fetch(`${params.
|
|
165
|
+
const exchangeResponse = await fetch(`${params.setupSiteUrl}/api/setup/device-session/exchange`, {
|
|
159
166
|
method: "POST",
|
|
160
167
|
headers: { "Content-Type": "application/json" },
|
|
161
168
|
body: JSON.stringify({
|
|
@@ -268,7 +275,8 @@ async function createBrowserLinkedDeviceSession(params) {
|
|
|
268
275
|
let exchangeInFlight = null;
|
|
269
276
|
try {
|
|
270
277
|
const installId = await getOrCreateInstallId();
|
|
271
|
-
const
|
|
278
|
+
const setupSiteUrl = setupSiteBaseUrl();
|
|
279
|
+
const startResponse = await fetch(`${setupSiteUrl}/api/setup/device-session/start`, {
|
|
272
280
|
method: "POST",
|
|
273
281
|
headers: { "Content-Type": "application/json" },
|
|
274
282
|
body: JSON.stringify({
|
|
@@ -296,7 +304,7 @@ async function createBrowserLinkedDeviceSession(params) {
|
|
|
296
304
|
if (exchangeInFlight)
|
|
297
305
|
return exchangeInFlight;
|
|
298
306
|
const promise = exchangeBrowserSetupSession({
|
|
299
|
-
|
|
307
|
+
setupSiteUrl,
|
|
300
308
|
sessionId: setupSessionId,
|
|
301
309
|
state,
|
|
302
310
|
code,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "theclawbay",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.83",
|
|
4
4
|
"description": "CLI for connecting Codex, Hermes Agent, Gemini-compatible apps, Continue, Cline, GSD, OpenClaw, OpenCode, Kilo, Roo Code, Aider, experimental Trae, and experimental Zo to The Claw Bay.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|