bitfab-cli 0.2.17 → 0.2.19
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 +14 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7308,11 +7308,21 @@ import crypto3 from "crypto";
|
|
|
7308
7308
|
import fs6 from "fs";
|
|
7309
7309
|
import os6 from "os";
|
|
7310
7310
|
import path5 from "path";
|
|
7311
|
-
|
|
7312
|
-
|
|
7311
|
+
|
|
7312
|
+
// ../bitfab-plugin-lib/dist/getAgentSessionId.js
|
|
7313
|
+
function getAgentSessionId() {
|
|
7314
|
+
return process.env.CLAUDE_CODE_SESSION_ID ?? process.env.CODEX_THREAD_ID ?? null;
|
|
7315
|
+
}
|
|
7316
|
+
|
|
7317
|
+
// ../bitfab-plugin-lib/dist/activeStudioSession.js
|
|
7318
|
+
function shortHash(input) {
|
|
7319
|
+
return crypto3.createHash("sha256").update(input).digest("hex").slice(0, 16);
|
|
7320
|
+
}
|
|
7321
|
+
function sessionScope() {
|
|
7322
|
+
return shortHash(getAgentSessionId() ?? process.cwd());
|
|
7313
7323
|
}
|
|
7314
7324
|
function filePath() {
|
|
7315
|
-
return path5.join(os6.homedir(), ".config", "bitfab", `active-studio-session.${
|
|
7325
|
+
return path5.join(os6.homedir(), ".config", "bitfab", `active-studio-session.${sessionScope()}.json`);
|
|
7316
7326
|
}
|
|
7317
7327
|
function writeActiveStudioSession(session) {
|
|
7318
7328
|
const target = filePath();
|
|
@@ -7925,7 +7935,7 @@ async function openStudioTo(path14, opts) {
|
|
|
7925
7935
|
if (opts.forceNew) {
|
|
7926
7936
|
clearActiveStudioSession();
|
|
7927
7937
|
}
|
|
7928
|
-
const existing = opts.forceNew ? null : readActiveStudioSession();
|
|
7938
|
+
const existing = opts.forceNew || opts.sessionId ? null : readActiveStudioSession();
|
|
7929
7939
|
if (existing) {
|
|
7930
7940
|
const client = {
|
|
7931
7941
|
serviceUrl: existing.serviceUrl,
|