bitfab-cli 0.2.24 → 0.2.26
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 +12 -17
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7868,8 +7868,7 @@ function recordFocus() {
|
|
|
7868
7868
|
return () => focusApp(frontmost);
|
|
7869
7869
|
}
|
|
7870
7870
|
|
|
7871
|
-
// ../bitfab-plugin-lib/dist/commands/
|
|
7872
|
-
var LOGIN_TIMEOUT_MS = 10 * 60 * 1e3;
|
|
7871
|
+
// ../bitfab-plugin-lib/dist/commands/sessionReady.js
|
|
7873
7872
|
var SESSION_READY_TIMEOUT_MS = 3e4;
|
|
7874
7873
|
var SESSION_READY_POLL_MS = 500;
|
|
7875
7874
|
async function waitForSessionReady(opts) {
|
|
@@ -7903,7 +7902,7 @@ async function waitForSessionReady(opts) {
|
|
|
7903
7902
|
|
|
7904
7903
|
// ../bitfab-plugin-lib/dist/commands/openStudioTo.js
|
|
7905
7904
|
var SESSION_CLOSE_GRACE_PERIOD_MS = 1e4;
|
|
7906
|
-
var
|
|
7905
|
+
var LOGIN_TIMEOUT_MS = 10 * 60 * 1e3;
|
|
7907
7906
|
var StudioNavigationError = class extends Error {
|
|
7908
7907
|
reason;
|
|
7909
7908
|
blockedReason;
|
|
@@ -7922,12 +7921,14 @@ async function openStudioTo(path14, opts) {
|
|
|
7922
7921
|
};
|
|
7923
7922
|
const restoreFocus = recordFocus();
|
|
7924
7923
|
if (!opts.apiKey) {
|
|
7925
|
-
const
|
|
7926
|
-
const
|
|
7924
|
+
const separator = path14.includes("?") ? "&" : "?";
|
|
7925
|
+
const redirectPath = `${path14}${separator}session=${encodeURIComponent(sessionId)}&pluginLogin=true`;
|
|
7926
|
+
const signInPath = `/studio/sign-in?redirect_url=${encodeURIComponent(redirectPath)}`;
|
|
7927
|
+
const signInUrl = `${opts.serviceUrl}${signInPath}&session=${encodeURIComponent(sessionId)}`;
|
|
7927
7928
|
openChromelessWindow(signInUrl);
|
|
7928
7929
|
opts.onLoginRequired?.(sessionId, signInUrl);
|
|
7929
7930
|
const abortController = new AbortController();
|
|
7930
|
-
const timer = setTimeout(() => abortController.abort(),
|
|
7931
|
+
const timer = setTimeout(() => abortController.abort(), LOGIN_TIMEOUT_MS);
|
|
7931
7932
|
const keepalive = setInterval(() => process.stderr.write(""), 3e4);
|
|
7932
7933
|
let apiKey;
|
|
7933
7934
|
try {
|
|
@@ -7956,6 +7957,7 @@ async function openStudioTo(path14, opts) {
|
|
|
7956
7957
|
return {
|
|
7957
7958
|
sessionId,
|
|
7958
7959
|
serviceUrl: opts.serviceUrl,
|
|
7960
|
+
apiKey,
|
|
7959
7961
|
opened: true,
|
|
7960
7962
|
...poller2
|
|
7961
7963
|
};
|
|
@@ -7964,6 +7966,7 @@ async function openStudioTo(path14, opts) {
|
|
|
7964
7966
|
return {
|
|
7965
7967
|
sessionId,
|
|
7966
7968
|
serviceUrl: opts.serviceUrl,
|
|
7969
|
+
apiKey,
|
|
7967
7970
|
opened: true,
|
|
7968
7971
|
abort: noop,
|
|
7969
7972
|
done: Promise.resolve()
|
|
@@ -7987,6 +7990,7 @@ async function openStudioTo(path14, opts) {
|
|
|
7987
7990
|
return {
|
|
7988
7991
|
sessionId: existing.sessionId,
|
|
7989
7992
|
serviceUrl: existing.serviceUrl,
|
|
7993
|
+
apiKey: opts.apiKey,
|
|
7990
7994
|
opened: false,
|
|
7991
7995
|
...poller2
|
|
7992
7996
|
};
|
|
@@ -8008,6 +8012,7 @@ async function openStudioTo(path14, opts) {
|
|
|
8008
8012
|
return {
|
|
8009
8013
|
sessionId: session.sessionId,
|
|
8010
8014
|
serviceUrl: session.serviceUrl,
|
|
8015
|
+
apiKey: opts.apiKey,
|
|
8011
8016
|
opened: true,
|
|
8012
8017
|
...poller
|
|
8013
8018
|
};
|
|
@@ -8093,7 +8098,7 @@ async function runLogin(platform2, pluginVersion, options) {
|
|
|
8093
8098
|
const exitOnComplete = options?.exitOnComplete ?? true;
|
|
8094
8099
|
const config2 = getConfig();
|
|
8095
8100
|
console.log("\nOpening Studio to sign in...");
|
|
8096
|
-
const closePath = `/studio/close?
|
|
8101
|
+
const closePath = `/studio/close?autoClose=true&message=${encodeURIComponent("Login complete")}`;
|
|
8097
8102
|
try {
|
|
8098
8103
|
const result = await openStudioTo(closePath, {
|
|
8099
8104
|
serviceUrl: config2.serviceUrl,
|
|
@@ -8142,11 +8147,7 @@ function runLogout() {
|
|
|
8142
8147
|
console.log("Logged out of Bitfab.");
|
|
8143
8148
|
}
|
|
8144
8149
|
|
|
8145
|
-
// ../bitfab-plugin-lib/dist/commands/openExperiments.js
|
|
8146
|
-
import crypto5 from "crypto";
|
|
8147
|
-
|
|
8148
8150
|
// ../bitfab-plugin-lib/dist/commands/openTracePlan.js
|
|
8149
|
-
import crypto6 from "crypto";
|
|
8150
8151
|
var OPEN_TRACE_PLAN_TIMEOUT_MS = 30 * 60 * 1e3;
|
|
8151
8152
|
|
|
8152
8153
|
// ../bitfab-plugin-lib/dist/commands/persistReplayLabels.js
|
|
@@ -21946,12 +21947,6 @@ var inputFileSchema = external_exports.object({
|
|
|
21946
21947
|
verdicts: external_exports.array(external_exports.unknown()).min(1)
|
|
21947
21948
|
});
|
|
21948
21949
|
|
|
21949
|
-
// ../bitfab-plugin-lib/dist/commands/startDataset.js
|
|
21950
|
-
import crypto7 from "crypto";
|
|
21951
|
-
|
|
21952
|
-
// ../bitfab-plugin-lib/dist/commands/startTemplatePreview.js
|
|
21953
|
-
import crypto8 from "crypto";
|
|
21954
|
-
|
|
21955
21950
|
// ../bitfab-plugin-lib/dist/activePreviewSession.js
|
|
21956
21951
|
import fs8 from "fs";
|
|
21957
21952
|
import os9 from "os";
|