bitfab-cli 0.2.122 → 0.2.124

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.
Files changed (2) hide show
  1. package/dist/index.js +42 -35
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -4910,7 +4910,7 @@ var require_compile = __commonJS({
4910
4910
  const schOrFunc = root.refs[ref];
4911
4911
  if (schOrFunc)
4912
4912
  return schOrFunc;
4913
- let _sch = resolve.call(this, root, ref);
4913
+ let _sch = resolve2.call(this, root, ref);
4914
4914
  if (_sch === void 0) {
4915
4915
  const schema = (_a2 = root.localRefs) === null || _a2 === void 0 ? void 0 : _a2[ref];
4916
4916
  const { schemaId } = this.opts;
@@ -4937,7 +4937,7 @@ var require_compile = __commonJS({
4937
4937
  function sameSchemaEnv(s1, s2) {
4938
4938
  return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
4939
4939
  }
4940
- function resolve(root, ref) {
4940
+ function resolve2(root, ref) {
4941
4941
  let sch;
4942
4942
  while (typeof (sch = this.refs[ref]) == "string")
4943
4943
  ref = sch;
@@ -5512,7 +5512,7 @@ var require_fast_uri = __commonJS({
5512
5512
  }
5513
5513
  return uri;
5514
5514
  }
5515
- function resolve(baseURI, relativeURI, options) {
5515
+ function resolve2(baseURI, relativeURI, options) {
5516
5516
  const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
5517
5517
  const resolved = resolveComponent(parse3(baseURI, schemelessOptions), parse3(relativeURI, schemelessOptions), schemelessOptions, true);
5518
5518
  schemelessOptions.skipEscape = true;
@@ -5739,7 +5739,7 @@ var require_fast_uri = __commonJS({
5739
5739
  var fastUri = {
5740
5740
  SCHEMES,
5741
5741
  normalize,
5742
- resolve,
5742
+ resolve: resolve2,
5743
5743
  resolveComponent,
5744
5744
  equal,
5745
5745
  serialize: serialize2,
@@ -8869,14 +8869,14 @@ async function pollAgentSessionEvents(opts) {
8869
8869
  opts.onError(err instanceof Error ? err : new Error(String(err)));
8870
8870
  }
8871
8871
  }
8872
- await new Promise((resolve) => {
8872
+ await new Promise((resolve2) => {
8873
8873
  const onAbort = () => {
8874
8874
  clearTimeout(timer);
8875
- resolve();
8875
+ resolve2();
8876
8876
  };
8877
8877
  const timer = setTimeout(() => {
8878
8878
  opts.abortSignal.removeEventListener("abort", onAbort);
8879
- resolve();
8879
+ resolve2();
8880
8880
  }, interval);
8881
8881
  opts.abortSignal.addEventListener("abort", onAbort, { once: true });
8882
8882
  });
@@ -8938,9 +8938,9 @@ var PING_PONG_TIMEOUT_MS = 5e3;
8938
8938
  function awaitNavigateAck(client, path19, ackTimeoutMs, startCursor) {
8939
8939
  const abortController = new AbortController();
8940
8940
  let timer = null;
8941
- const result = new Promise((resolve) => {
8941
+ const result = new Promise((resolve2) => {
8942
8942
  timer = setTimeout(() => {
8943
- resolve({ acked: false, reason: "timeout" });
8943
+ resolve2({ acked: false, reason: "timeout" });
8944
8944
  abortController.abort();
8945
8945
  }, ackTimeoutMs);
8946
8946
  const pathOnly = path19.split("?")[0];
@@ -8960,7 +8960,7 @@ function awaitNavigateAck(client, path19, ackTimeoutMs, startCursor) {
8960
8960
  if (timer) {
8961
8961
  clearTimeout(timer);
8962
8962
  }
8963
- resolve({ acked: true });
8963
+ resolve2({ acked: true });
8964
8964
  abortController.abort();
8965
8965
  return;
8966
8966
  }
@@ -8968,7 +8968,7 @@ function awaitNavigateAck(client, path19, ackTimeoutMs, startCursor) {
8968
8968
  if (timer) {
8969
8969
  clearTimeout(timer);
8970
8970
  }
8971
- resolve({
8971
+ resolve2({
8972
8972
  acked: false,
8973
8973
  reason: "blocked",
8974
8974
  blockedReason: event.data.reason
@@ -8980,7 +8980,7 @@ function awaitNavigateAck(client, path19, ackTimeoutMs, startCursor) {
8980
8980
  if (timer) {
8981
8981
  clearTimeout(timer);
8982
8982
  }
8983
- resolve({ acked: false, reason: "window-closed" });
8983
+ resolve2({ acked: false, reason: "window-closed" });
8984
8984
  abortController.abort();
8985
8985
  }
8986
8986
  },
@@ -8993,18 +8993,18 @@ function awaitNavigateAck(client, path19, ackTimeoutMs, startCursor) {
8993
8993
  if (timer) {
8994
8994
  clearTimeout(timer);
8995
8995
  }
8996
- resolve({ acked: false, reason: "timeout" });
8996
+ resolve2({ acked: false, reason: "timeout" });
8997
8997
  });
8998
8998
  });
8999
8999
  return result;
9000
9000
  }
9001
9001
  function awaitPong(client, pingTs) {
9002
- return new Promise((resolve) => {
9002
+ return new Promise((resolve2) => {
9003
9003
  const abortController = new AbortController();
9004
9004
  let received = false;
9005
9005
  const timer = setTimeout(() => {
9006
9006
  abortController.abort();
9007
- resolve(false);
9007
+ resolve2(false);
9008
9008
  }, PING_PONG_TIMEOUT_MS);
9009
9009
  pollAgentSessionEvents({
9010
9010
  serviceUrl: client.serviceUrl,
@@ -9016,7 +9016,7 @@ function awaitPong(client, pingTs) {
9016
9016
  received = true;
9017
9017
  clearTimeout(timer);
9018
9018
  abortController.abort();
9019
- resolve(true);
9019
+ resolve2(true);
9020
9020
  }
9021
9021
  },
9022
9022
  onError: () => {
@@ -9024,7 +9024,7 @@ function awaitPong(client, pingTs) {
9024
9024
  }).catch(() => {
9025
9025
  if (!received) {
9026
9026
  clearTimeout(timer);
9027
- resolve(false);
9027
+ resolve2(false);
9028
9028
  }
9029
9029
  });
9030
9030
  });
@@ -9986,10 +9986,10 @@ function readPid(pidPath) {
9986
9986
  }
9987
9987
  }
9988
9988
  async function pingSocket(socketPath) {
9989
- return new Promise((resolve) => {
9989
+ return new Promise((resolve2) => {
9990
9990
  const timeout = setTimeout(() => {
9991
9991
  socket.destroy();
9992
- resolve({ alive: false, build: null });
9992
+ resolve2({ alive: false, build: null });
9993
9993
  }, PING_TIMEOUT_MS);
9994
9994
  const socket = net.createConnection(socketPath, () => {
9995
9995
  socket.write('{"cmd":"ping"}\n');
@@ -10002,15 +10002,15 @@ async function pingSocket(socketPath) {
10002
10002
  socket.destroy();
10003
10003
  try {
10004
10004
  const msg = JSON.parse(buffer.split("\n")[0]);
10005
- resolve({ alive: msg.ok === true, build: msg.build ?? null });
10005
+ resolve2({ alive: msg.ok === true, build: msg.build ?? null });
10006
10006
  } catch {
10007
- resolve({ alive: false, build: null });
10007
+ resolve2({ alive: false, build: null });
10008
10008
  }
10009
10009
  }
10010
10010
  });
10011
10011
  socket.on("error", () => {
10012
10012
  clearTimeout(timeout);
10013
- resolve({ alive: false, build: null });
10013
+ resolve2({ alive: false, build: null });
10014
10014
  });
10015
10015
  });
10016
10016
  }
@@ -10211,10 +10211,10 @@ var DaemonClient = class {
10211
10211
  }
10212
10212
  async connect() {
10213
10213
  await ensureDaemon(this.socketPath);
10214
- return new Promise((resolve, reject) => {
10214
+ return new Promise((resolve2, reject) => {
10215
10215
  const socket = net2.createConnection(this.socketPath, () => {
10216
10216
  this.socket = socket;
10217
- resolve();
10217
+ resolve2();
10218
10218
  });
10219
10219
  socket.on("data", (chunk2) => {
10220
10220
  this.buffer += chunk2.toString();
@@ -10261,8 +10261,8 @@ var DaemonClient = class {
10261
10261
  if (!this.socket) {
10262
10262
  return Promise.reject(new Error("not connected"));
10263
10263
  }
10264
- return new Promise((resolve, reject) => {
10265
- this.responseQueue.push(resolve);
10264
+ return new Promise((resolve2, reject) => {
10265
+ this.responseQueue.push(resolve2);
10266
10266
  try {
10267
10267
  this.socket.write(serialize(cmd));
10268
10268
  } catch (err) {
@@ -10400,9 +10400,9 @@ function readStudioEventLogTail(key, fromLine = 1) {
10400
10400
  function tailStudioEvents(key, onLine, opts) {
10401
10401
  const pollMs = opts.pollMs ?? 200;
10402
10402
  let cursor = opts.fromLine ?? 1;
10403
- return new Promise((resolve) => {
10403
+ return new Promise((resolve2) => {
10404
10404
  if (opts.abortSignal.aborted) {
10405
- resolve();
10405
+ resolve2();
10406
10406
  return;
10407
10407
  }
10408
10408
  const tick = () => {
@@ -10422,7 +10422,7 @@ function tailStudioEvents(key, onLine, opts) {
10422
10422
  }, pollMs);
10423
10423
  opts.abortSignal.addEventListener("abort", () => {
10424
10424
  clearInterval(timer);
10425
- resolve();
10425
+ resolve2();
10426
10426
  }, { once: true });
10427
10427
  tick();
10428
10428
  });
@@ -10622,8 +10622,8 @@ var DaemonChannel = class _DaemonChannel {
10622
10622
  });
10623
10623
  }
10624
10624
  subscribe(_sessionId, onEvent, onError) {
10625
- const done = new Promise((resolve) => {
10626
- this.doneResolve = resolve;
10625
+ const done = new Promise((resolve2) => {
10626
+ this.doneResolve = resolve2;
10627
10627
  });
10628
10628
  this.client.onEvent((push) => {
10629
10629
  const event = {
@@ -11081,7 +11081,7 @@ async function openStudioTo(path19, opts = {}) {
11081
11081
  const sessionId2 = openResult.sessionId;
11082
11082
  const signInUrl = `${serviceUrl}${buildSignInPath(sessionId2)}`;
11083
11083
  opts.onLoginRequired?.(sessionId2, signInUrl);
11084
- const loginApiKey = await new Promise((resolve, reject) => {
11084
+ const loginApiKey = await new Promise((resolve2, reject) => {
11085
11085
  const timer = setTimeout(() => {
11086
11086
  sub.abort();
11087
11087
  reject(new Error("Login polling aborted"));
@@ -11095,7 +11095,7 @@ async function openStudioTo(path19, opts = {}) {
11095
11095
  if (event.type === "studio:authenticated" && typeof event.data?.token === "string") {
11096
11096
  cleanup();
11097
11097
  sub.abort();
11098
- resolve(event.data.token);
11098
+ resolve2(event.data.token);
11099
11099
  }
11100
11100
  }, (err) => {
11101
11101
  cleanup();
@@ -25010,6 +25010,13 @@ import { writeFileSync } from "fs";
25010
25010
  import { tmpdir } from "os";
25011
25011
  import { join } from "path";
25012
25012
 
25013
+ // ../bitfab-plugin-lib/dist/commands/replayProgress.js
25014
+ import { spawn as spawn4 } from "child_process";
25015
+ import { createWriteStream, existsSync, mkdirSync, readFileSync as readFileSync2, rmSync, writeFileSync as writeFileSync2 } from "fs";
25016
+ import { dirname, resolve } from "path";
25017
+ import { createInterface } from "readline";
25018
+ var HEARTBEAT_MS = Number(process.env.BITFAB_REPLAY_HEARTBEAT_MS) || 12e3;
25019
+
25013
25020
  // ../bitfab-plugin-lib/dist/activePreviewSession.js
25014
25021
  import fs13 from "fs";
25015
25022
  import os12 from "os";
@@ -30678,7 +30685,7 @@ function escapeRegex2(s) {
30678
30685
  }
30679
30686
 
30680
30687
  // src/cursor.ts
30681
- import { spawn as spawn4, spawnSync as spawnSync3 } from "child_process";
30688
+ import { spawn as spawn5, spawnSync as spawnSync3 } from "child_process";
30682
30689
  import os17 from "os";
30683
30690
  import * as p3 from "@clack/prompts";
30684
30691
  var REPO3 = "Project-White-Rabbit/bitfab-cursor-plugin";
@@ -30702,7 +30709,7 @@ function runCursorInstall() {
30702
30709
  "Finish setup in Cursor"
30703
30710
  );
30704
30711
  p3.log.info("Opening Cursor...");
30705
- const child = spawn4("cursor", ["."], {
30712
+ const child = spawn5("cursor", ["."], {
30706
30713
  stdio: "ignore",
30707
30714
  detached: true,
30708
30715
  windowsHide: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bitfab-cli",
3
- "version": "0.2.122",
3
+ "version": "0.2.124",
4
4
  "description": "Install and configure the Bitfab plugin in Claude Code, Codex, or Cursor.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",