claude-yes 1.24.1 → 1.24.2

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 CHANGED
@@ -4826,7 +4826,7 @@ function fromWritable(i) {
4826
4826
  });
4827
4827
  }
4828
4828
 
4829
- // index.ts
4829
+ // ts/index.ts
4830
4830
  import { mkdir as mkdir2, writeFile as writeFile2 } from "fs/promises";
4831
4831
  import path3 from "path";
4832
4832
 
@@ -5234,7 +5234,7 @@ class TerminalTextRender {
5234
5234
  }
5235
5235
  }
5236
5236
 
5237
- // idleWaiter.ts
5237
+ // ts/idleWaiter.ts
5238
5238
  class IdleWaiter {
5239
5239
  lastActivityTime = Date.now();
5240
5240
  checkInterval = 100;
@@ -5251,7 +5251,7 @@ class IdleWaiter {
5251
5251
  }
5252
5252
  }
5253
5253
 
5254
- // ReadyManager.ts
5254
+ // ts/ReadyManager.ts
5255
5255
  class ReadyManager {
5256
5256
  isReady = false;
5257
5257
  readyQueue = [];
@@ -5271,12 +5271,12 @@ class ReadyManager {
5271
5271
  }
5272
5272
  }
5273
5273
 
5274
- // removeControlCharacters.ts
5274
+ // ts/removeControlCharacters.ts
5275
5275
  function removeControlCharacters(str) {
5276
5276
  return str.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, "");
5277
5277
  }
5278
5278
 
5279
- // runningLock.ts
5279
+ // ts/runningLock.ts
5280
5280
  import { execSync } from "child_process";
5281
5281
  import { existsSync } from "fs";
5282
5282
  import { mkdir, readFile, rename, writeFile } from "fs/promises";
@@ -5400,10 +5400,47 @@ async function removeTask(pid) {
5400
5400
  }
5401
5401
  async function waitForUnlock(blockingTasks, currentTask) {
5402
5402
  const blockingTask = blockingTasks[0];
5403
+ if (!blockingTask)
5404
+ return;
5403
5405
  console.log(`⏳ Queueing for unlock of: ${blockingTask.task}`);
5406
+ console.log(` Press 'b' to bypass queue, 'k' to kill previous instance`);
5404
5407
  await addTask({ ...currentTask, status: "queued" });
5408
+ const stdin = process.stdin;
5409
+ const wasRaw = stdin.isRaw;
5410
+ stdin.setRawMode?.(true);
5411
+ stdin.resume();
5412
+ let bypassed = false;
5413
+ let killed = false;
5414
+ const keyHandler = (key) => {
5415
+ const char = key.toString();
5416
+ if (char === "b" || char === "B") {
5417
+ console.log(`
5418
+ ⚡ Bypassing queue...`);
5419
+ bypassed = true;
5420
+ } else if (char === "k" || char === "K") {
5421
+ console.log(`
5422
+ \uD83D\uDD2A Killing previous instance...`);
5423
+ killed = true;
5424
+ }
5425
+ };
5426
+ stdin.on("data", keyHandler);
5405
5427
  let dots = 0;
5406
5428
  while (true) {
5429
+ if (bypassed) {
5430
+ await updateTaskStatus(currentTask.pid, "running");
5431
+ console.log("✓ Queue bypassed, starting task...");
5432
+ break;
5433
+ }
5434
+ if (killed && blockingTask) {
5435
+ try {
5436
+ process.kill(blockingTask.pid, "SIGTERM");
5437
+ console.log(`✓ Killed process ${blockingTask.pid}`);
5438
+ await sleep2(1000);
5439
+ } catch (err) {
5440
+ console.log(`⚠️ Could not kill process ${blockingTask.pid}: ${err}`);
5441
+ }
5442
+ killed = false;
5443
+ }
5407
5444
  await sleep2(POLL_INTERVAL);
5408
5445
  const lockCheck = await checkLock(currentTask.cwd, currentTask.task);
5409
5446
  if (!lockCheck.isLocked) {
@@ -5415,6 +5452,10 @@ async function waitForUnlock(blockingTasks, currentTask) {
5415
5452
  dots = (dots + 1) % 4;
5416
5453
  process.stdout.write(`\r⏳ Queueing${".".repeat(dots)}${" ".repeat(3 - dots)}`);
5417
5454
  }
5455
+ stdin.off("data", keyHandler);
5456
+ stdin.setRawMode?.(wasRaw);
5457
+ if (!wasRaw)
5458
+ stdin.pause();
5418
5459
  }
5419
5460
  async function acquireLock(cwd, prompt = "no prompt provided") {
5420
5461
  const resolvedCwd = resolveRealPath(cwd);
@@ -5446,7 +5487,7 @@ function shouldUseLock(cwd) {
5446
5487
  return true;
5447
5488
  }
5448
5489
 
5449
- // index.ts
5490
+ // ts/index.ts
5450
5491
  var CLI_CONFIGURES = {
5451
5492
  grok: {
5452
5493
  install: "npm install -g @vibe-kit/grok-cli",
@@ -5500,7 +5541,6 @@ async function claudeYes({
5500
5541
  cli = "claude",
5501
5542
  cliArgs = [],
5502
5543
  prompt,
5503
- continueOnCrash,
5504
5544
  cwd,
5505
5545
  env,
5506
5546
  exitOnIdle,
@@ -5570,19 +5610,6 @@ async function claudeYes({
5570
5610
  stdinReady.unready();
5571
5611
  const agentCrashed = exitCode2 !== 0;
5572
5612
  const continueArg = continueArgs[cli];
5573
- if (agentCrashed && continueOnCrash && continueArg) {
5574
- if (!continueArg) {
5575
- return console.warn(`continueOnCrash is only supported for ${Object.keys(continueArgs).join(", ")} currently, not ${cli}`);
5576
- }
5577
- if (isFatal) {
5578
- return pendingExitCode.resolve(pendingExitCodeValue = exitCode2);
5579
- }
5580
- console.log(`${cli} crashed, restarting...`);
5581
- shell = pty.spawn(cli, continueArg, getPtyOptions());
5582
- shell.onData(onData);
5583
- shell.onExit(onExit);
5584
- return;
5585
- }
5586
5613
  return pendingExitCode.resolve(pendingExitCodeValue = exitCode2);
5587
5614
  });
5588
5615
  process.stdout.on("resize", () => {
@@ -5671,7 +5698,6 @@ async function claudeYes({
5671
5698
  await sendEnter();
5672
5699
  }
5673
5700
  async function exitAgent() {
5674
- continueOnCrash = false;
5675
5701
  await sendMessage("/exit");
5676
5702
  let exited = false;
5677
5703
  await Promise.race([
@@ -5706,5 +5732,5 @@ export {
5706
5732
  CLI_CONFIGURES
5707
5733
  };
5708
5734
 
5709
- //# debugId=C257F9AC903EC67664756E2164756E21
5735
+ //# debugId=71BB292CF34E8BBE64756E2164756E21
5710
5736
  //# sourceMappingURL=index.js.map