claude-threads 1.5.1 → 1.6.0

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
@@ -11835,6 +11835,22 @@ var init_emoji = __esm(() => {
11835
11835
  };
11836
11836
  });
11837
11837
 
11838
+ // src/utils/spawn.ts
11839
+ import { spawn as nodeSpawn, spawnSync as nodeSpawnSync } from "child_process";
11840
+ function addWindowsShell(options2) {
11841
+ if (isWindows && options2.shell === undefined) {
11842
+ return { ...options2, shell: true };
11843
+ }
11844
+ return options2;
11845
+ }
11846
+ function crossSpawn(command, args, options2) {
11847
+ return nodeSpawn(command, args, addWindowsShell(options2 ?? {}));
11848
+ }
11849
+ var isWindows;
11850
+ var init_spawn = __esm(() => {
11851
+ isWindows = process.platform === "win32";
11852
+ });
11853
+
11838
11854
  // src/git/worktree.ts
11839
11855
  var exports_worktree = {};
11840
11856
  __export(exports_worktree, {
@@ -11858,7 +11874,6 @@ __export(exports_worktree, {
11858
11874
  detectWorktreeInfo: () => detectWorktreeInfo,
11859
11875
  createWorktree: () => createWorktree
11860
11876
  });
11861
- import { spawn as spawn2 } from "child_process";
11862
11877
  import { randomUUID } from "crypto";
11863
11878
  import * as path from "path";
11864
11879
  import * as fs from "fs/promises";
@@ -11867,7 +11882,7 @@ async function execGit(args, cwd) {
11867
11882
  const cmd = `git ${args.join(" ")}`;
11868
11883
  log7.debug(`Executing: ${cmd}`);
11869
11884
  return new Promise((resolve3, reject) => {
11870
- const proc = spawn2("git", args, { cwd });
11885
+ const proc = crossSpawn("git", args, { cwd });
11871
11886
  let stdout = "";
11872
11887
  let stderr = "";
11873
11888
  proc.stdout.on("data", (data) => {
@@ -12157,6 +12172,7 @@ async function removeWorktreeMetadata(worktreePath) {
12157
12172
  }
12158
12173
  var log7, WORKTREES_DIR, METADATA_STORE_PATH;
12159
12174
  var init_worktree = __esm(() => {
12175
+ init_spawn();
12160
12176
  init_logger();
12161
12177
  log7 = createLogger("git-wt");
12162
12178
  WORKTREES_DIR = path.join(homedir4(), ".claude-threads", "worktrees");
@@ -14551,7 +14567,7 @@ var require_ini = __commonJS((exports) => {
14551
14567
  }
14552
14568
  });
14553
14569
 
14554
- // node_modules/rc/node_modules/strip-json-comments/index.js
14570
+ // node_modules/strip-json-comments/index.js
14555
14571
  var require_strip_json_comments = __commonJS((exports, module) => {
14556
14572
  var singleComment = 1;
14557
14573
  var multiComment = 2;
@@ -15015,7 +15031,7 @@ var require_minimist = __commonJS((exports, module) => {
15015
15031
  // node_modules/rc/index.js
15016
15032
  var require_rc = __commonJS((exports, module) => {
15017
15033
  var cc = require_utils();
15018
- var join8 = __require("path").join;
15034
+ var join9 = __require("path").join;
15019
15035
  var deepExtend = require_deep_extend();
15020
15036
  var etc = "/etc";
15021
15037
  var win = process.platform === "win32";
@@ -15041,15 +15057,15 @@ var require_rc = __commonJS((exports, module) => {
15041
15057
  }
15042
15058
  if (!win)
15043
15059
  [
15044
- join8(etc, name, "config"),
15045
- join8(etc, name + "rc")
15060
+ join9(etc, name, "config"),
15061
+ join9(etc, name + "rc")
15046
15062
  ].forEach(addConfigFile);
15047
15063
  if (home)
15048
15064
  [
15049
- join8(home, ".config", name, "config"),
15050
- join8(home, ".config", name),
15051
- join8(home, "." + name, "config"),
15052
- join8(home, "." + name + "rc")
15065
+ join9(home, ".config", name, "config"),
15066
+ join9(home, ".config", name),
15067
+ join9(home, "." + name, "config"),
15068
+ join9(home, "." + name + "rc")
15053
15069
  ].forEach(addConfigFile);
15054
15070
  addConfigFile(cc.find("." + name + "rc"));
15055
15071
  if (env3.config)
@@ -16859,10 +16875,10 @@ var require_defaults = __commonJS((exports) => {
16859
16875
  var temp = os4.tmpdir();
16860
16876
  var uidOrPid = process.getuid ? process.getuid() : process.pid;
16861
16877
  var hasUnicode = () => true;
16862
- var isWindows = process.platform === "win32";
16878
+ var isWindows2 = process.platform === "win32";
16863
16879
  var osenv = {
16864
- editor: () => process.env.EDITOR || process.env.VISUAL || (isWindows ? "notepad.exe" : "vi"),
16865
- shell: () => isWindows ? process.env.COMSPEC || "cmd.exe" : process.env.SHELL || "/bin/bash"
16880
+ editor: () => process.env.EDITOR || process.env.VISUAL || (isWindows2 ? "notepad.exe" : "vi"),
16881
+ shell: () => isWindows2 ? process.env.COMSPEC || "cmd.exe" : process.env.SHELL || "/bin/bash"
16866
16882
  };
16867
16883
  var umask = {
16868
16884
  fromString: () => process.umask()
@@ -49850,7 +49866,7 @@ function configExists() {
49850
49866
  // src/onboarding.ts
49851
49867
  var import_prompts = __toESM(require_prompts3(), 1);
49852
49868
  import { existsSync as existsSync3, readFileSync as readFileSync2 } from "fs";
49853
- import { join, dirname as dirname2 } from "path";
49869
+ import { join as join2, dirname as dirname2 } from "path";
49854
49870
  import { spawn } from "child_process";
49855
49871
  import { fileURLToPath } from "url";
49856
49872
 
@@ -49875,7 +49891,13 @@ var red = (s) => `${colors.red}${s}${colors.reset}`;
49875
49891
  var import_semver = __toESM(require_semver2(), 1);
49876
49892
  import { execSync } from "child_process";
49877
49893
  import { existsSync as existsSync2 } from "fs";
49878
- var COMMON_CLAUDE_PATHS = [
49894
+ import { join } from "path";
49895
+ var COMMON_CLAUDE_PATHS = process.platform === "win32" ? [
49896
+ ...process.env.APPDATA ? [join(process.env.APPDATA, "npm", "claude.cmd")] : [],
49897
+ ...process.env.LOCALAPPDATA ? [join(process.env.LOCALAPPDATA, "npm", "claude.cmd")] : [],
49898
+ ...process.env.NVM_SYMLINK ? [join(process.env.NVM_SYMLINK, "claude.cmd")] : [],
49899
+ ...process.env.USERPROFILE ? [join(process.env.USERPROFILE, ".bun", "bin", "claude.cmd")] : []
49900
+ ] : [
49879
49901
  "/usr/local/bin/claude",
49880
49902
  "/opt/homebrew/bin/claude",
49881
49903
  `${process.env.HOME}/.local/bin/claude`,
@@ -49910,12 +49932,14 @@ function tryClaudeVersion(claudePath) {
49910
49932
  }
49911
49933
  function findClaudeInPath() {
49912
49934
  try {
49913
- const result = execSync("which claude", {
49935
+ const findCommand = process.platform === "win32" ? "where claude" : "which claude";
49936
+ const result = execSync(findCommand, {
49914
49937
  encoding: "utf8",
49915
49938
  timeout: 5000,
49916
49939
  stdio: ["pipe", "pipe", "pipe"]
49917
49940
  }).trim();
49918
- return result || null;
49941
+ const firstLine = result.split(/\r?\n/)[0];
49942
+ return firstLine || null;
49919
49943
  } catch {
49920
49944
  return null;
49921
49945
  }
@@ -50029,7 +50053,7 @@ function validateClaudeCli() {
50029
50053
 
50030
50054
  // src/onboarding.ts
50031
50055
  var __dirname2 = dirname2(fileURLToPath(import.meta.url));
50032
- var SLACK_MANIFEST_PATH = join(__dirname2, "..", "docs", "slack-app-manifest.yaml");
50056
+ var SLACK_MANIFEST_PATH = join2(__dirname2, "..", "docs", "slack-app-manifest.yaml");
50033
50057
  var onCancel = () => {
50034
50058
  console.log("");
50035
50059
  console.log(dim(" Setup cancelled."));
@@ -50314,7 +50338,6 @@ async function runOnboarding(reconfigure = false) {
50314
50338
  initial: 0
50315
50339
  }, { onCancel });
50316
50340
  if (platformType === "done") {
50317
- addMore = false;
50318
50341
  break;
50319
50342
  }
50320
50343
  await showPlatformInstructions(platformType);
@@ -50396,8 +50419,7 @@ async function runOnboarding(reconfigure = false) {
50396
50419
  }
50397
50420
  async function runReconfigureFlow(existingConfig) {
50398
50421
  let config = { ...existingConfig, platforms: [...existingConfig.platforms] };
50399
- let keepReconfiguring = true;
50400
- while (keepReconfiguring) {
50422
+ while (true) {
50401
50423
  console.log("");
50402
50424
  console.log(bold(" What would you like to reconfigure?"));
50403
50425
  console.log("");
@@ -50424,7 +50446,6 @@ async function runReconfigureFlow(existingConfig) {
50424
50446
  choices
50425
50447
  }, { onCancel });
50426
50448
  if (action === "done") {
50427
- keepReconfiguring = false;
50428
50449
  break;
50429
50450
  }
50430
50451
  if (action === "global") {
@@ -53298,11 +53319,11 @@ import { EventEmitter as EventEmitter4 } from "events";
53298
53319
  init_logger();
53299
53320
  import { existsSync as existsSync5, mkdirSync as mkdirSync2, readFileSync as readFileSync4, writeFileSync as writeFileSync2, renameSync, chmodSync as chmodSync2 } from "fs";
53300
53321
  import { homedir as homedir2 } from "os";
53301
- import { join as join2 } from "path";
53322
+ import { join as join3 } from "path";
53302
53323
  var log5 = createLogger("persist");
53303
53324
  var STORE_VERSION = 2;
53304
- var DEFAULT_CONFIG_DIR = join2(homedir2(), ".config", "claude-threads");
53305
- var DEFAULT_SESSIONS_FILE = join2(DEFAULT_CONFIG_DIR, "sessions.json");
53325
+ var DEFAULT_CONFIG_DIR = join3(homedir2(), ".config", "claude-threads");
53326
+ var DEFAULT_SESSIONS_FILE = join3(DEFAULT_CONFIG_DIR, "sessions.json");
53306
53327
 
53307
53328
  class SessionStore {
53308
53329
  sessionsFile;
@@ -53312,7 +53333,7 @@ class SessionStore {
53312
53333
  const effectivePath = sessionsPath ?? envPath;
53313
53334
  if (effectivePath) {
53314
53335
  this.sessionsFile = effectivePath;
53315
- this.configDir = join2(effectivePath, "..");
53336
+ this.configDir = join3(effectivePath, "..");
53316
53337
  } else {
53317
53338
  this.sessionsFile = DEFAULT_SESSIONS_FILE;
53318
53339
  this.configDir = DEFAULT_CONFIG_DIR;
@@ -53532,15 +53553,15 @@ init_emoji();
53532
53553
  init_logger();
53533
53554
  import { existsSync as existsSync7 } from "fs";
53534
53555
  import { readdir, rm } from "fs/promises";
53535
- import { join as join5 } from "path";
53556
+ import { join as join6 } from "path";
53536
53557
 
53537
53558
  // src/persistence/thread-logger.ts
53538
53559
  init_logger();
53539
53560
  import { existsSync as existsSync6, mkdirSync as mkdirSync3, appendFileSync, readdirSync, statSync, unlinkSync, rmdirSync, readFileSync as readFileSync5, chmodSync as chmodSync3 } from "fs";
53540
53561
  import { homedir as homedir3 } from "os";
53541
- import { join as join3, dirname as dirname4 } from "path";
53562
+ import { join as join4, dirname as dirname4 } from "path";
53542
53563
  var log6 = createLogger("thread-log");
53543
- var LOGS_BASE_DIR = join3(homedir3(), ".claude-threads", "logs");
53564
+ var LOGS_BASE_DIR = join4(homedir3(), ".claude-threads", "logs");
53544
53565
 
53545
53566
  class ThreadLoggerImpl {
53546
53567
  platformId;
@@ -53560,7 +53581,7 @@ class ThreadLoggerImpl {
53560
53581
  this.enabled = options2?.enabled ?? true;
53561
53582
  this.bufferSize = options2?.bufferSize ?? 10;
53562
53583
  this.flushIntervalMs = options2?.flushIntervalMs ?? 1000;
53563
- this.logPath = join3(LOGS_BASE_DIR, platformId, `${claudeSessionId}.jsonl`);
53584
+ this.logPath = join4(LOGS_BASE_DIR, platformId, `${claudeSessionId}.jsonl`);
53564
53585
  if (this.enabled) {
53565
53586
  const dir = dirname4(this.logPath);
53566
53587
  if (!existsSync6(dir)) {
@@ -53742,7 +53763,7 @@ function cleanupOldLogs(retentionDays = 30) {
53742
53763
  try {
53743
53764
  const platformDirs = readdirSync(LOGS_BASE_DIR);
53744
53765
  for (const platformId of platformDirs) {
53745
- const platformDir = join3(LOGS_BASE_DIR, platformId);
53766
+ const platformDir = join4(LOGS_BASE_DIR, platformId);
53746
53767
  const stat = statSync(platformDir);
53747
53768
  if (!stat.isDirectory())
53748
53769
  continue;
@@ -53750,7 +53771,7 @@ function cleanupOldLogs(retentionDays = 30) {
53750
53771
  for (const file of logFiles) {
53751
53772
  if (!file.endsWith(".jsonl"))
53752
53773
  continue;
53753
- const filePath = join3(platformDir, file);
53774
+ const filePath = join4(platformDir, file);
53754
53775
  try {
53755
53776
  const fileStat = statSync(filePath);
53756
53777
  if (fileStat.mtimeMs < cutoffMs) {
@@ -53779,7 +53800,7 @@ function cleanupOldLogs(retentionDays = 30) {
53779
53800
  return deletedCount;
53780
53801
  }
53781
53802
  function getLogFilePath(platformId, sessionId) {
53782
- return join3(LOGS_BASE_DIR, platformId, `${sessionId}.jsonl`);
53803
+ return join4(LOGS_BASE_DIR, platformId, `${sessionId}.jsonl`);
53783
53804
  }
53784
53805
  function readRecentLogEntries(platformId, sessionId, maxLines = 50) {
53785
53806
  const logPath = getLogFilePath(platformId, sessionId);
@@ -53925,7 +53946,7 @@ class CleanupScheduler {
53925
53946
  for (const entry of entries) {
53926
53947
  if (!entry.isDirectory())
53927
53948
  continue;
53928
- const worktreePath = join5(worktreesDir, entry.name);
53949
+ const worktreePath = join6(worktreesDir, entry.name);
53929
53950
  if (activeWorktrees.has(worktreePath)) {
53930
53951
  log8.debug(`Worktree in use by persisted session, skipping: ${entry.name}`);
53931
53952
  continue;
@@ -54049,14 +54070,14 @@ function getSessionStatus(session) {
54049
54070
  }
54050
54071
 
54051
54072
  // src/claude/cli.ts
54073
+ init_spawn();
54052
54074
  init_logger();
54053
- import { spawn as spawn3 } from "child_process";
54054
54075
  import { EventEmitter as EventEmitter2 } from "events";
54055
54076
  import { resolve as resolve3, dirname as dirname6 } from "path";
54056
54077
  import { fileURLToPath as fileURLToPath3 } from "url";
54057
54078
  import { existsSync as existsSync8, readFileSync as readFileSync6, watchFile, unwatchFile, unlinkSync as unlinkSync2, statSync as statSync2, readdirSync as readdirSync2 } from "fs";
54058
54079
  import { tmpdir } from "os";
54059
- import { join as join6 } from "path";
54080
+ import { join as join7 } from "path";
54060
54081
  var log9 = createLogger("claude");
54061
54082
  function cleanupBrowserBridgeSockets() {
54062
54083
  try {
@@ -54064,7 +54085,7 @@ function cleanupBrowserBridgeSockets() {
54064
54085
  const files = readdirSync2(tempDir);
54065
54086
  for (const file of files) {
54066
54087
  if (file.startsWith("claude-mcp-browser-bridge-")) {
54067
- const filePath = join6(tempDir, file);
54088
+ const filePath = join7(tempDir, file);
54068
54089
  try {
54069
54090
  const stats = statSync2(filePath);
54070
54091
  if (stats.isSocket()) {
@@ -54195,7 +54216,7 @@ class ClaudeCli extends EventEmitter2 {
54195
54216
  args.push("--append-system-prompt", this.options.appendSystemPrompt);
54196
54217
  }
54197
54218
  if (this.options.sessionId) {
54198
- this.statusFilePath = `/tmp/claude-threads-status-${this.options.sessionId}.json`;
54219
+ this.statusFilePath = join7(tmpdir(), `claude-threads-status-${this.options.sessionId}.json`);
54199
54220
  const statusLineWriterPath = this.getStatusLineWriterPath();
54200
54221
  const statusLineSettings = {
54201
54222
  statusLine: {
@@ -54207,7 +54228,7 @@ class ClaudeCli extends EventEmitter2 {
54207
54228
  args.push("--settings", JSON.stringify(statusLineSettings));
54208
54229
  }
54209
54230
  this.log.debug(`Starting: ${claudePath} ${args.slice(0, 5).join(" ")}...`);
54210
- this.process = spawn3(claudePath, args, {
54231
+ this.process = crossSpawn(claudePath, args, {
54211
54232
  cwd: this.options.workingDir,
54212
54233
  env: process.env,
54213
54234
  stdio: ["pipe", "pipe", "pipe"]
@@ -55175,7 +55196,7 @@ import { existsSync as existsSync11 } from "fs";
55175
55196
 
55176
55197
  // src/utils/keep-alive.ts
55177
55198
  init_logger();
55178
- import { spawn as spawn4 } from "child_process";
55199
+ import { spawn as spawn2 } from "child_process";
55179
55200
  var log10 = createLogger("keepalive");
55180
55201
 
55181
55202
  class KeepAliveManager {
@@ -55254,7 +55275,7 @@ class KeepAliveManager {
55254
55275
  }
55255
55276
  startMacOSKeepAlive() {
55256
55277
  try {
55257
- this.keepAliveProcess = spawn4("caffeinate", ["-s", "-i"], {
55278
+ this.keepAliveProcess = spawn2("caffeinate", ["-s", "-i"], {
55258
55279
  stdio: "ignore",
55259
55280
  detached: false
55260
55281
  });
@@ -55275,7 +55296,7 @@ class KeepAliveManager {
55275
55296
  }
55276
55297
  startLinuxKeepAlive() {
55277
55298
  try {
55278
- this.keepAliveProcess = spawn4("systemd-inhibit", [
55299
+ this.keepAliveProcess = spawn2("systemd-inhibit", [
55279
55300
  "--what=sleep:idle:handle-lid-switch",
55280
55301
  "--why=Claude Code session active",
55281
55302
  "--mode=block",
@@ -55304,7 +55325,7 @@ class KeepAliveManager {
55304
55325
  }
55305
55326
  startLinuxKeepAliveFallback() {
55306
55327
  try {
55307
- this.keepAliveProcess = spawn4("bash", [
55328
+ this.keepAliveProcess = spawn2("bash", [
55308
55329
  "-c",
55309
55330
  `while true; do xdg-screensaver reset 2>/dev/null || true; sleep 60; done`
55310
55331
  ], {
@@ -55339,7 +55360,7 @@ class KeepAliveManager {
55339
55360
  # Keep running until killed
55340
55361
  while ($true) { Start-Sleep -Seconds 60 }
55341
55362
  `;
55342
- this.keepAliveProcess = spawn4("powershell", ["-NoProfile", "-Command", script], {
55363
+ this.keepAliveProcess = spawn2("powershell", ["-NoProfile", "-Command", script], {
55343
55364
  stdio: "ignore",
55344
55365
  detached: false,
55345
55366
  windowsHide: true
@@ -55532,8 +55553,8 @@ function updateLastMessage(session, post2) {
55532
55553
  }
55533
55554
 
55534
55555
  // src/claude/quick-query.ts
55556
+ init_spawn();
55535
55557
  init_logger();
55536
- import { spawn as spawn5 } from "child_process";
55537
55558
  var log13 = createLogger("query");
55538
55559
  async function quickQuery(options2) {
55539
55560
  const {
@@ -55555,7 +55576,7 @@ async function quickQuery(options2) {
55555
55576
  let stdout = "";
55556
55577
  let stderr = "";
55557
55578
  let resolved = false;
55558
- const proc = spawn5(claudePath, args, {
55579
+ const proc = crossSpawn(claudePath, args, {
55559
55580
  cwd: workingDir || process.cwd(),
55560
55581
  env: process.env,
55561
55582
  stdio: ["pipe", "pipe", "pipe"]
@@ -56964,9 +56985,9 @@ var chromeToolsFormatter = {
56964
56985
  const coord = input.coordinate;
56965
56986
  const url = input.url || "";
56966
56987
  const text = input.text || "";
56967
- let detail = "";
56968
56988
  switch (tool) {
56969
56989
  case "computer": {
56990
+ let detail;
56970
56991
  switch (action) {
56971
56992
  case "screenshot":
56972
56993
  detail = "screenshot";
@@ -57215,7 +57236,7 @@ var playwrightToolsFormatter = {
57215
57236
  switch (tool) {
57216
57237
  case "browser_navigate": {
57217
57238
  const url = input.url || "";
57218
- let domain = url;
57239
+ let domain;
57219
57240
  try {
57220
57241
  domain = new URL(url).hostname;
57221
57242
  } catch {
@@ -57238,7 +57259,7 @@ var playwrightToolsFormatter = {
57238
57259
  case "browser_wait_for": {
57239
57260
  const time = input.time;
57240
57261
  const selector = input.selector;
57241
- let waitFor = "";
57262
+ let waitFor;
57242
57263
  if (time)
57243
57264
  waitFor = `${time}ms`;
57244
57265
  else if (selector)
@@ -61251,7 +61272,7 @@ async function cleanupOldStickyMessages(platform, botUserId, forceRun = false, e
61251
61272
  import { execSync as execSync2 } from "child_process";
61252
61273
  import { writeFileSync as writeFileSync3, unlinkSync as unlinkSync3 } from "fs";
61253
61274
  import { tmpdir as tmpdir2 } from "os";
61254
- import { join as join7 } from "path";
61275
+ import { join as join8 } from "path";
61255
61276
 
61256
61277
  // node_modules/@redactpii/node/lib/index.mjs
61257
61278
  class Redactor {
@@ -61831,7 +61852,7 @@ async function createGitHubIssue(title, body, workingDir) {
61831
61852
  if (!ghStatus.installed || !ghStatus.authenticated) {
61832
61853
  throw new Error(ghStatus.error);
61833
61854
  }
61834
- const bodyFile = join7(tmpdir2(), `bug-body-${Date.now()}.md`);
61855
+ const bodyFile = join8(tmpdir2(), `bug-body-${Date.now()}.md`);
61835
61856
  try {
61836
61857
  writeFileSync3(bodyFile, body, "utf-8");
61837
61858
  const cmd = `gh issue create --repo "${GITHUB_REPO}" --title "${escapeShell(title)}" --body-file "${bodyFile}"`;
@@ -61897,7 +61918,7 @@ import { existsSync as existsSync10, statSync as statSync3 } from "fs";
61897
61918
 
61898
61919
  // node_modules/update-notifier/update-notifier.js
61899
61920
  import process10 from "node:process";
61900
- import { spawn as spawn6 } from "node:child_process";
61921
+ import { spawn as spawn3 } from "node:child_process";
61901
61922
  import { fileURLToPath as fileURLToPath6 } from "node:url";
61902
61923
  import path9 from "node:path";
61903
61924
  import { format } from "node:util";
@@ -62618,7 +62639,7 @@ class Configstore {
62618
62639
  }
62619
62640
  }
62620
62641
 
62621
- // node_modules/update-notifier/node_modules/chalk/source/vendor/ansi-styles/index.js
62642
+ // node_modules/chalk/source/vendor/ansi-styles/index.js
62622
62643
  var ANSI_BACKGROUND_OFFSET = 10;
62623
62644
  var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
62624
62645
  var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
@@ -62795,7 +62816,7 @@ function assembleStyles() {
62795
62816
  var ansiStyles = assembleStyles();
62796
62817
  var ansi_styles_default = ansiStyles;
62797
62818
 
62798
- // node_modules/update-notifier/node_modules/chalk/source/vendor/supports-color/index.js
62819
+ // node_modules/chalk/source/vendor/supports-color/index.js
62799
62820
  import process6 from "node:process";
62800
62821
  import os3 from "node:os";
62801
62822
  import tty from "node:tty";
@@ -62927,7 +62948,7 @@ var supportsColor = {
62927
62948
  };
62928
62949
  var supports_color_default = supportsColor;
62929
62950
 
62930
- // node_modules/update-notifier/node_modules/chalk/source/utilities.js
62951
+ // node_modules/chalk/source/utilities.js
62931
62952
  function stringReplaceAll(string, substring, replacer) {
62932
62953
  let index = string.indexOf(substring);
62933
62954
  if (index === -1) {
@@ -62960,7 +62981,7 @@ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
62960
62981
  return returnValue;
62961
62982
  }
62962
62983
 
62963
- // node_modules/update-notifier/node_modules/chalk/source/index.js
62984
+ // node_modules/chalk/source/index.js
62964
62985
  var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
62965
62986
  var GENERATOR = Symbol("GENERATOR");
62966
62987
  var STYLER = Symbol("STYLER");
@@ -64045,7 +64066,7 @@ import process8 from "node:process";
64045
64066
  import path6 from "node:path";
64046
64067
  import os4 from "node:os";
64047
64068
  import fs4 from "node:fs";
64048
- var isWindows = process8.platform === "win32";
64069
+ var isWindows2 = process8.platform === "win32";
64049
64070
  var readRc = (filePath) => {
64050
64071
  try {
64051
64072
  return import_ini.default.parse(fs4.readFileSync(filePath, "utf8")).prefix;
@@ -64053,7 +64074,7 @@ var readRc = (filePath) => {
64053
64074
  };
64054
64075
  var getEnvNpmPrefix = () => Object.keys(process8.env).reduce((prefix, name) => /^npm_config_prefix$/i.test(name) ? process8.env[name] : prefix, undefined);
64055
64076
  var getGlobalNpmrc = () => {
64056
- if (isWindows && process8.env.APPDATA) {
64077
+ if (isWindows2 && process8.env.APPDATA) {
64057
64078
  return path6.join(process8.env.APPDATA, "/npm/etc/npmrc");
64058
64079
  }
64059
64080
  if (process8.execPath.includes("/Cellar/node")) {
@@ -64066,7 +64087,7 @@ var getGlobalNpmrc = () => {
64066
64087
  }
64067
64088
  };
64068
64089
  var getDefaultNpmPrefix = () => {
64069
- if (isWindows) {
64090
+ if (isWindows2) {
64070
64091
  const { APPDATA } = process8.env;
64071
64092
  return APPDATA ? path6.join(APPDATA, "npm") : path6.dirname(process8.execPath);
64072
64093
  }
@@ -64092,7 +64113,7 @@ var getNpmPrefix = () => {
64092
64113
  };
64093
64114
  var npmPrefix = path6.resolve(getNpmPrefix());
64094
64115
  var getYarnWindowsDirectory = () => {
64095
- if (isWindows && process8.env.LOCALAPPDATA) {
64116
+ if (isWindows2 && process8.env.LOCALAPPDATA) {
64096
64117
  const dir = path6.join(process8.env.LOCALAPPDATA, "Yarn");
64097
64118
  if (fs4.existsSync(dir)) {
64098
64119
  return dir;
@@ -64121,8 +64142,8 @@ var getYarnPrefix = () => {
64121
64142
  var globalDirectory = {};
64122
64143
  globalDirectory.npm = {};
64123
64144
  globalDirectory.npm.prefix = npmPrefix;
64124
- globalDirectory.npm.packages = path6.join(npmPrefix, isWindows ? "node_modules" : "lib/node_modules");
64125
- globalDirectory.npm.binaries = isWindows ? npmPrefix : path6.join(npmPrefix, "bin");
64145
+ globalDirectory.npm.packages = path6.join(npmPrefix, isWindows2 ? "node_modules" : "lib/node_modules");
64146
+ globalDirectory.npm.binaries = isWindows2 ? npmPrefix : path6.join(npmPrefix, "bin");
64126
64147
  var yarnPrefix = path6.resolve(getYarnPrefix());
64127
64148
  globalDirectory.yarn = {};
64128
64149
  globalDirectory.yarn.prefix = yarnPrefix;
@@ -65215,7 +65236,7 @@ class UpdateNotifier {
65215
65236
  if (Date.now() - this.config.get("lastUpdateCheck") < this.#updateCheckInterval) {
65216
65237
  return;
65217
65238
  }
65218
- spawn6(process10.execPath, [path9.join(__dirname6, "check.js"), JSON.stringify(this.#options)], {
65239
+ spawn3(process10.execPath, [path9.join(__dirname6, "check.js"), JSON.stringify(this.#options)], {
65219
65240
  detached: true,
65220
65241
  stdio: "ignore"
65221
65242
  }).unref();
@@ -67877,14 +67898,14 @@ class SessionMonitor {
67877
67898
  }
67878
67899
  }
67879
67900
  // src/operations/plugin/handler.ts
67880
- import { spawn as spawn7 } from "child_process";
67901
+ init_spawn();
67881
67902
  init_logger();
67882
67903
  var log27 = createLogger("plugin");
67883
67904
  var sessionLog7 = createSessionLog(log27);
67884
67905
  async function runPluginCommand(args, cwd, timeout2 = 60000) {
67885
67906
  return new Promise((resolve6) => {
67886
67907
  const claudePath = process.env.CLAUDE_PATH || "claude";
67887
- const proc = spawn7(claudePath, ["plugin", ...args], {
67908
+ const proc = crossSpawn(claudePath, ["plugin", ...args], {
67888
67909
  cwd,
67889
67910
  timeout: timeout2
67890
67911
  });
@@ -69104,11 +69125,11 @@ var import_react62 = __toESM(require_react(), 1);
69104
69125
 
69105
69126
  // node_modules/ink/build/render.js
69106
69127
  import { Stream } from "node:stream";
69107
- import process21 from "node:process";
69128
+ import process20 from "node:process";
69108
69129
 
69109
69130
  // node_modules/ink/build/ink.js
69110
69131
  var import_react13 = __toESM(require_react(), 1);
69111
- import process20 from "node:process";
69132
+ import process19 from "node:process";
69112
69133
  // node_modules/es-toolkit/dist/function/debounce.mjs
69113
69134
  function debounce(func, debounceMs, { signal, edges } = {}) {
69114
69135
  let pendingThis = undefined;
@@ -69278,7 +69299,7 @@ var isSharedWorker = typeof SharedWorkerGlobalScope !== "undefined" && globalThi
69278
69299
  var isServiceWorker = typeof ServiceWorkerGlobalScope !== "undefined" && globalThis instanceof ServiceWorkerGlobalScope;
69279
69300
  var platform = globalThis.navigator?.userAgentData?.platform;
69280
69301
  var isMacOs = platform === "macOS" || globalThis.navigator?.platform === "MacIntel" || globalThis.navigator?.userAgent?.includes(" Mac ") === true || globalThis.process?.platform === "darwin";
69281
- var isWindows2 = platform === "Windows" || globalThis.navigator?.platform === "Win32" || globalThis.process?.platform === "win32";
69302
+ var isWindows3 = platform === "Windows" || globalThis.navigator?.platform === "Win32" || globalThis.process?.platform === "win32";
69282
69303
  var isLinux = platform === "Linux" || globalThis.navigator?.platform?.startsWith("Linux") === true || globalThis.navigator?.userAgent?.includes(" Linux ") === true || globalThis.process?.platform === "linux";
69283
69304
  var isIos = platform === "iOS" || globalThis.navigator?.platform === "MacIntel" && globalThis.navigator?.maxTouchPoints > 1 || /iPad|iPhone|iPod/.test(globalThis.navigator?.platform);
69284
69305
  var isAndroid = platform === "Android" || globalThis.navigator?.platform === "Android" || globalThis.navigator?.userAgent?.includes(" Android ") === true || globalThis.process?.platform === "android";
@@ -69289,7 +69310,7 @@ var OSC = "\x1B]";
69289
69310
  var BEL = "\x07";
69290
69311
  var SEP = ";";
69291
69312
  var isTerminalApp = !isBrowser && process11.env.TERM_PROGRAM === "Apple_Terminal";
69292
- var isWindows3 = !isBrowser && process11.platform === "win32";
69313
+ var isWindows4 = !isBrowser && process11.platform === "win32";
69293
69314
  var isTmux = !isBrowser && (process11.env.TERM?.startsWith("screen") || process11.env.TERM?.startsWith("tmux") || process11.env.TMUX !== undefined);
69294
69315
  var cwdFunction = isBrowser ? () => {
69295
69316
  throw new Error("`process.cwd()` only works in Node.js, not the browser.");
@@ -69359,7 +69380,7 @@ var scrollDown = ESC + "T";
69359
69380
  var clearScreen = "\x1Bc";
69360
69381
  var clearViewport = `${eraseScreen}${ESC}H`;
69361
69382
  var isOldWindows = () => {
69362
- if (isBrowser || !isWindows3) {
69383
+ if (isBrowser || !isWindows4) {
69363
69384
  return false;
69364
69385
  }
69365
69386
  const parts = os5.release().split(".");
@@ -72130,500 +72151,11 @@ var get_max_width_default = getMaxWidth;
72130
72151
  // node_modules/ink/build/render-border.js
72131
72152
  var import_cli_boxes3 = __toESM(require_cli_boxes(), 1);
72132
72153
 
72133
- // node_modules/ink/node_modules/chalk/source/vendor/ansi-styles/index.js
72134
- var ANSI_BACKGROUND_OFFSET3 = 10;
72135
- var wrapAnsi163 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
72136
- var wrapAnsi2563 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
72137
- var wrapAnsi16m3 = (offset = 0) => (red2, green2, blue) => `\x1B[${38 + offset};2;${red2};${green2};${blue}m`;
72138
- var styles5 = {
72139
- modifier: {
72140
- reset: [0, 0],
72141
- bold: [1, 22],
72142
- dim: [2, 22],
72143
- italic: [3, 23],
72144
- underline: [4, 24],
72145
- overline: [53, 55],
72146
- inverse: [7, 27],
72147
- hidden: [8, 28],
72148
- strikethrough: [9, 29]
72149
- },
72150
- color: {
72151
- black: [30, 39],
72152
- red: [31, 39],
72153
- green: [32, 39],
72154
- yellow: [33, 39],
72155
- blue: [34, 39],
72156
- magenta: [35, 39],
72157
- cyan: [36, 39],
72158
- white: [37, 39],
72159
- blackBright: [90, 39],
72160
- gray: [90, 39],
72161
- grey: [90, 39],
72162
- redBright: [91, 39],
72163
- greenBright: [92, 39],
72164
- yellowBright: [93, 39],
72165
- blueBright: [94, 39],
72166
- magentaBright: [95, 39],
72167
- cyanBright: [96, 39],
72168
- whiteBright: [97, 39]
72169
- },
72170
- bgColor: {
72171
- bgBlack: [40, 49],
72172
- bgRed: [41, 49],
72173
- bgGreen: [42, 49],
72174
- bgYellow: [43, 49],
72175
- bgBlue: [44, 49],
72176
- bgMagenta: [45, 49],
72177
- bgCyan: [46, 49],
72178
- bgWhite: [47, 49],
72179
- bgBlackBright: [100, 49],
72180
- bgGray: [100, 49],
72181
- bgGrey: [100, 49],
72182
- bgRedBright: [101, 49],
72183
- bgGreenBright: [102, 49],
72184
- bgYellowBright: [103, 49],
72185
- bgBlueBright: [104, 49],
72186
- bgMagentaBright: [105, 49],
72187
- bgCyanBright: [106, 49],
72188
- bgWhiteBright: [107, 49]
72189
- }
72190
- };
72191
- var modifierNames3 = Object.keys(styles5.modifier);
72192
- var foregroundColorNames3 = Object.keys(styles5.color);
72193
- var backgroundColorNames3 = Object.keys(styles5.bgColor);
72194
- var colorNames3 = [...foregroundColorNames3, ...backgroundColorNames3];
72195
- function assembleStyles3() {
72196
- const codes = new Map;
72197
- for (const [groupName, group] of Object.entries(styles5)) {
72198
- for (const [styleName, style] of Object.entries(group)) {
72199
- styles5[styleName] = {
72200
- open: `\x1B[${style[0]}m`,
72201
- close: `\x1B[${style[1]}m`
72202
- };
72203
- group[styleName] = styles5[styleName];
72204
- codes.set(style[0], style[1]);
72205
- }
72206
- Object.defineProperty(styles5, groupName, {
72207
- value: group,
72208
- enumerable: false
72209
- });
72210
- }
72211
- Object.defineProperty(styles5, "codes", {
72212
- value: codes,
72213
- enumerable: false
72214
- });
72215
- styles5.color.close = "\x1B[39m";
72216
- styles5.bgColor.close = "\x1B[49m";
72217
- styles5.color.ansi = wrapAnsi163();
72218
- styles5.color.ansi256 = wrapAnsi2563();
72219
- styles5.color.ansi16m = wrapAnsi16m3();
72220
- styles5.bgColor.ansi = wrapAnsi163(ANSI_BACKGROUND_OFFSET3);
72221
- styles5.bgColor.ansi256 = wrapAnsi2563(ANSI_BACKGROUND_OFFSET3);
72222
- styles5.bgColor.ansi16m = wrapAnsi16m3(ANSI_BACKGROUND_OFFSET3);
72223
- Object.defineProperties(styles5, {
72224
- rgbToAnsi256: {
72225
- value(red2, green2, blue) {
72226
- if (red2 === green2 && green2 === blue) {
72227
- if (red2 < 8) {
72228
- return 16;
72229
- }
72230
- if (red2 > 248) {
72231
- return 231;
72232
- }
72233
- return Math.round((red2 - 8) / 247 * 24) + 232;
72234
- }
72235
- return 16 + 36 * Math.round(red2 / 255 * 5) + 6 * Math.round(green2 / 255 * 5) + Math.round(blue / 255 * 5);
72236
- },
72237
- enumerable: false
72238
- },
72239
- hexToRgb: {
72240
- value(hex) {
72241
- const matches2 = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
72242
- if (!matches2) {
72243
- return [0, 0, 0];
72244
- }
72245
- let [colorString] = matches2;
72246
- if (colorString.length === 3) {
72247
- colorString = [...colorString].map((character) => character + character).join("");
72248
- }
72249
- const integer = Number.parseInt(colorString, 16);
72250
- return [
72251
- integer >> 16 & 255,
72252
- integer >> 8 & 255,
72253
- integer & 255
72254
- ];
72255
- },
72256
- enumerable: false
72257
- },
72258
- hexToAnsi256: {
72259
- value: (hex) => styles5.rgbToAnsi256(...styles5.hexToRgb(hex)),
72260
- enumerable: false
72261
- },
72262
- ansi256ToAnsi: {
72263
- value(code) {
72264
- if (code < 8) {
72265
- return 30 + code;
72266
- }
72267
- if (code < 16) {
72268
- return 90 + (code - 8);
72269
- }
72270
- let red2;
72271
- let green2;
72272
- let blue;
72273
- if (code >= 232) {
72274
- red2 = ((code - 232) * 10 + 8) / 255;
72275
- green2 = red2;
72276
- blue = red2;
72277
- } else {
72278
- code -= 16;
72279
- const remainder = code % 36;
72280
- red2 = Math.floor(code / 36) / 5;
72281
- green2 = Math.floor(remainder / 6) / 5;
72282
- blue = remainder % 6 / 5;
72283
- }
72284
- const value = Math.max(red2, green2, blue) * 2;
72285
- if (value === 0) {
72286
- return 30;
72287
- }
72288
- let result2 = 30 + (Math.round(blue) << 2 | Math.round(green2) << 1 | Math.round(red2));
72289
- if (value === 2) {
72290
- result2 += 60;
72291
- }
72292
- return result2;
72293
- },
72294
- enumerable: false
72295
- },
72296
- rgbToAnsi: {
72297
- value: (red2, green2, blue) => styles5.ansi256ToAnsi(styles5.rgbToAnsi256(red2, green2, blue)),
72298
- enumerable: false
72299
- },
72300
- hexToAnsi: {
72301
- value: (hex) => styles5.ansi256ToAnsi(styles5.hexToAnsi256(hex)),
72302
- enumerable: false
72303
- }
72304
- });
72305
- return styles5;
72306
- }
72307
- var ansiStyles3 = assembleStyles3();
72308
- var ansi_styles_default3 = ansiStyles3;
72309
-
72310
- // node_modules/ink/node_modules/chalk/source/vendor/supports-color/index.js
72311
- import process13 from "node:process";
72312
- import os6 from "node:os";
72313
- import tty2 from "node:tty";
72314
- function hasFlag2(flag, argv = globalThis.Deno ? globalThis.Deno.args : process13.argv) {
72315
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
72316
- const position = argv.indexOf(prefix + flag);
72317
- const terminatorPosition = argv.indexOf("--");
72318
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
72319
- }
72320
- var { env: env5 } = process13;
72321
- var flagForceColor2;
72322
- if (hasFlag2("no-color") || hasFlag2("no-colors") || hasFlag2("color=false") || hasFlag2("color=never")) {
72323
- flagForceColor2 = 0;
72324
- } else if (hasFlag2("color") || hasFlag2("colors") || hasFlag2("color=true") || hasFlag2("color=always")) {
72325
- flagForceColor2 = 1;
72326
- }
72327
- function envForceColor2() {
72328
- if ("FORCE_COLOR" in env5) {
72329
- if (env5.FORCE_COLOR === "true") {
72330
- return 1;
72331
- }
72332
- if (env5.FORCE_COLOR === "false") {
72333
- return 0;
72334
- }
72335
- return env5.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env5.FORCE_COLOR, 10), 3);
72336
- }
72337
- }
72338
- function translateLevel2(level) {
72339
- if (level === 0) {
72340
- return false;
72341
- }
72342
- return {
72343
- level,
72344
- hasBasic: true,
72345
- has256: level >= 2,
72346
- has16m: level >= 3
72347
- };
72348
- }
72349
- function _supportsColor2(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
72350
- const noFlagForceColor = envForceColor2();
72351
- if (noFlagForceColor !== undefined) {
72352
- flagForceColor2 = noFlagForceColor;
72353
- }
72354
- const forceColor = sniffFlags ? flagForceColor2 : noFlagForceColor;
72355
- if (forceColor === 0) {
72356
- return 0;
72357
- }
72358
- if (sniffFlags) {
72359
- if (hasFlag2("color=16m") || hasFlag2("color=full") || hasFlag2("color=truecolor")) {
72360
- return 3;
72361
- }
72362
- if (hasFlag2("color=256")) {
72363
- return 2;
72364
- }
72365
- }
72366
- if ("TF_BUILD" in env5 && "AGENT_NAME" in env5) {
72367
- return 1;
72368
- }
72369
- if (haveStream && !streamIsTTY && forceColor === undefined) {
72370
- return 0;
72371
- }
72372
- const min2 = forceColor || 0;
72373
- if (env5.TERM === "dumb") {
72374
- return min2;
72375
- }
72376
- if (process13.platform === "win32") {
72377
- const osRelease = os6.release().split(".");
72378
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
72379
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
72380
- }
72381
- return 1;
72382
- }
72383
- if ("CI" in env5) {
72384
- if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => (key in env5))) {
72385
- return 3;
72386
- }
72387
- if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => (sign in env5)) || env5.CI_NAME === "codeship") {
72388
- return 1;
72389
- }
72390
- return min2;
72391
- }
72392
- if ("TEAMCITY_VERSION" in env5) {
72393
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env5.TEAMCITY_VERSION) ? 1 : 0;
72394
- }
72395
- if (env5.COLORTERM === "truecolor") {
72396
- return 3;
72397
- }
72398
- if (env5.TERM === "xterm-kitty") {
72399
- return 3;
72400
- }
72401
- if (env5.TERM === "xterm-ghostty") {
72402
- return 3;
72403
- }
72404
- if (env5.TERM === "wezterm") {
72405
- return 3;
72406
- }
72407
- if ("TERM_PROGRAM" in env5) {
72408
- const version = Number.parseInt((env5.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
72409
- switch (env5.TERM_PROGRAM) {
72410
- case "iTerm.app": {
72411
- return version >= 3 ? 3 : 2;
72412
- }
72413
- case "Apple_Terminal": {
72414
- return 2;
72415
- }
72416
- }
72417
- }
72418
- if (/-256(color)?$/i.test(env5.TERM)) {
72419
- return 2;
72420
- }
72421
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env5.TERM)) {
72422
- return 1;
72423
- }
72424
- if ("COLORTERM" in env5) {
72425
- return 1;
72426
- }
72427
- return min2;
72428
- }
72429
- function createSupportsColor2(stream, options2 = {}) {
72430
- const level = _supportsColor2(stream, {
72431
- streamIsTTY: stream && stream.isTTY,
72432
- ...options2
72433
- });
72434
- return translateLevel2(level);
72435
- }
72436
- var supportsColor2 = {
72437
- stdout: createSupportsColor2({ isTTY: tty2.isatty(1) }),
72438
- stderr: createSupportsColor2({ isTTY: tty2.isatty(2) })
72439
- };
72440
- var supports_color_default2 = supportsColor2;
72441
-
72442
- // node_modules/ink/node_modules/chalk/source/utilities.js
72443
- function stringReplaceAll2(string, substring, replacer) {
72444
- let index = string.indexOf(substring);
72445
- if (index === -1) {
72446
- return string;
72447
- }
72448
- const substringLength = substring.length;
72449
- let endIndex = 0;
72450
- let returnValue = "";
72451
- do {
72452
- returnValue += string.slice(endIndex, index) + substring + replacer;
72453
- endIndex = index + substringLength;
72454
- index = string.indexOf(substring, endIndex);
72455
- } while (index !== -1);
72456
- returnValue += string.slice(endIndex);
72457
- return returnValue;
72458
- }
72459
- function stringEncaseCRLFWithFirstIndex2(string, prefix, postfix, index) {
72460
- let endIndex = 0;
72461
- let returnValue = "";
72462
- do {
72463
- const gotCR = string[index - 1] === "\r";
72464
- returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? `\r
72465
- ` : `
72466
- `) + postfix;
72467
- endIndex = index + 1;
72468
- index = string.indexOf(`
72469
- `, endIndex);
72470
- } while (index !== -1);
72471
- returnValue += string.slice(endIndex);
72472
- return returnValue;
72473
- }
72474
-
72475
- // node_modules/ink/node_modules/chalk/source/index.js
72476
- var { stdout: stdoutColor2, stderr: stderrColor2 } = supports_color_default2;
72477
- var GENERATOR2 = Symbol("GENERATOR");
72478
- var STYLER2 = Symbol("STYLER");
72479
- var IS_EMPTY2 = Symbol("IS_EMPTY");
72480
- var levelMapping2 = [
72481
- "ansi",
72482
- "ansi",
72483
- "ansi256",
72484
- "ansi16m"
72485
- ];
72486
- var styles6 = Object.create(null);
72487
- var applyOptions2 = (object, options2 = {}) => {
72488
- if (options2.level && !(Number.isInteger(options2.level) && options2.level >= 0 && options2.level <= 3)) {
72489
- throw new Error("The `level` option should be an integer from 0 to 3");
72490
- }
72491
- const colorLevel = stdoutColor2 ? stdoutColor2.level : 0;
72492
- object.level = options2.level === undefined ? colorLevel : options2.level;
72493
- };
72494
- var chalkFactory2 = (options2) => {
72495
- const chalk2 = (...strings) => strings.join(" ");
72496
- applyOptions2(chalk2, options2);
72497
- Object.setPrototypeOf(chalk2, createChalk2.prototype);
72498
- return chalk2;
72499
- };
72500
- function createChalk2(options2) {
72501
- return chalkFactory2(options2);
72502
- }
72503
- Object.setPrototypeOf(createChalk2.prototype, Function.prototype);
72504
- for (const [styleName, style] of Object.entries(ansi_styles_default3)) {
72505
- styles6[styleName] = {
72506
- get() {
72507
- const builder = createBuilder2(this, createStyler2(style.open, style.close, this[STYLER2]), this[IS_EMPTY2]);
72508
- Object.defineProperty(this, styleName, { value: builder });
72509
- return builder;
72510
- }
72511
- };
72512
- }
72513
- styles6.visible = {
72514
- get() {
72515
- const builder = createBuilder2(this, this[STYLER2], true);
72516
- Object.defineProperty(this, "visible", { value: builder });
72517
- return builder;
72518
- }
72519
- };
72520
- var getModelAnsi2 = (model, level, type2, ...arguments_) => {
72521
- if (model === "rgb") {
72522
- if (level === "ansi16m") {
72523
- return ansi_styles_default3[type2].ansi16m(...arguments_);
72524
- }
72525
- if (level === "ansi256") {
72526
- return ansi_styles_default3[type2].ansi256(ansi_styles_default3.rgbToAnsi256(...arguments_));
72527
- }
72528
- return ansi_styles_default3[type2].ansi(ansi_styles_default3.rgbToAnsi(...arguments_));
72529
- }
72530
- if (model === "hex") {
72531
- return getModelAnsi2("rgb", level, type2, ...ansi_styles_default3.hexToRgb(...arguments_));
72532
- }
72533
- return ansi_styles_default3[type2][model](...arguments_);
72534
- };
72535
- var usedModels2 = ["rgb", "hex", "ansi256"];
72536
- for (const model of usedModels2) {
72537
- styles6[model] = {
72538
- get() {
72539
- const { level } = this;
72540
- return function(...arguments_) {
72541
- const styler = createStyler2(getModelAnsi2(model, levelMapping2[level], "color", ...arguments_), ansi_styles_default3.color.close, this[STYLER2]);
72542
- return createBuilder2(this, styler, this[IS_EMPTY2]);
72543
- };
72544
- }
72545
- };
72546
- const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
72547
- styles6[bgModel] = {
72548
- get() {
72549
- const { level } = this;
72550
- return function(...arguments_) {
72551
- const styler = createStyler2(getModelAnsi2(model, levelMapping2[level], "bgColor", ...arguments_), ansi_styles_default3.bgColor.close, this[STYLER2]);
72552
- return createBuilder2(this, styler, this[IS_EMPTY2]);
72553
- };
72554
- }
72555
- };
72556
- }
72557
- var proto2 = Object.defineProperties(() => {}, {
72558
- ...styles6,
72559
- level: {
72560
- enumerable: true,
72561
- get() {
72562
- return this[GENERATOR2].level;
72563
- },
72564
- set(level) {
72565
- this[GENERATOR2].level = level;
72566
- }
72567
- }
72568
- });
72569
- var createStyler2 = (open, close, parent) => {
72570
- let openAll;
72571
- let closeAll;
72572
- if (parent === undefined) {
72573
- openAll = open;
72574
- closeAll = close;
72575
- } else {
72576
- openAll = parent.openAll + open;
72577
- closeAll = close + parent.closeAll;
72578
- }
72579
- return {
72580
- open,
72581
- close,
72582
- openAll,
72583
- closeAll,
72584
- parent
72585
- };
72586
- };
72587
- var createBuilder2 = (self2, _styler, _isEmpty) => {
72588
- const builder = (...arguments_) => applyStyle2(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
72589
- Object.setPrototypeOf(builder, proto2);
72590
- builder[GENERATOR2] = self2;
72591
- builder[STYLER2] = _styler;
72592
- builder[IS_EMPTY2] = _isEmpty;
72593
- return builder;
72594
- };
72595
- var applyStyle2 = (self2, string) => {
72596
- if (self2.level <= 0 || !string) {
72597
- return self2[IS_EMPTY2] ? "" : string;
72598
- }
72599
- let styler = self2[STYLER2];
72600
- if (styler === undefined) {
72601
- return string;
72602
- }
72603
- const { openAll, closeAll } = styler;
72604
- if (string.includes("\x1B")) {
72605
- while (styler !== undefined) {
72606
- string = stringReplaceAll2(string, styler.close, styler.open);
72607
- styler = styler.parent;
72608
- }
72609
- }
72610
- const lfIndex = string.indexOf(`
72611
- `);
72612
- if (lfIndex !== -1) {
72613
- string = stringEncaseCRLFWithFirstIndex2(string, closeAll, openAll, lfIndex);
72614
- }
72615
- return openAll + string + closeAll;
72616
- };
72617
- Object.defineProperties(createChalk2.prototype, styles6);
72618
- var chalk2 = createChalk2();
72619
- var chalkStderr2 = createChalk2({ level: stderrColor2 ? stderrColor2.level : 0 });
72620
- var source_default2 = chalk2;
72621
-
72622
72154
  // node_modules/ink/build/colorize.js
72623
72155
  var rgbRegex = /^rgb\(\s?(\d+),\s?(\d+),\s?(\d+)\s?\)$/;
72624
72156
  var ansiRegex2 = /^ansi256\(\s?(\d+)\s?\)$/;
72625
72157
  var isNamedColor = (color) => {
72626
- return color in source_default2;
72158
+ return color in source_default;
72627
72159
  };
72628
72160
  var colorize = (str2, color, type2) => {
72629
72161
  if (!color) {
@@ -72631,13 +72163,13 @@ var colorize = (str2, color, type2) => {
72631
72163
  }
72632
72164
  if (isNamedColor(color)) {
72633
72165
  if (type2 === "foreground") {
72634
- return source_default2[color](str2);
72166
+ return source_default[color](str2);
72635
72167
  }
72636
72168
  const methodName = `bg${color[0].toUpperCase() + color.slice(1)}`;
72637
- return source_default2[methodName](str2);
72169
+ return source_default[methodName](str2);
72638
72170
  }
72639
72171
  if (color.startsWith("#")) {
72640
- return type2 === "foreground" ? source_default2.hex(color)(str2) : source_default2.bgHex(color)(str2);
72172
+ return type2 === "foreground" ? source_default.hex(color)(str2) : source_default.bgHex(color)(str2);
72641
72173
  }
72642
72174
  if (color.startsWith("ansi256")) {
72643
72175
  const matches2 = ansiRegex2.exec(color);
@@ -72645,7 +72177,7 @@ var colorize = (str2, color, type2) => {
72645
72177
  return str2;
72646
72178
  }
72647
72179
  const value = Number(matches2[1]);
72648
- return type2 === "foreground" ? source_default2.ansi256(value)(str2) : source_default2.bgAnsi256(value)(str2);
72180
+ return type2 === "foreground" ? source_default.ansi256(value)(str2) : source_default.bgAnsi256(value)(str2);
72649
72181
  }
72650
72182
  if (color.startsWith("rgb")) {
72651
72183
  const matches2 = rgbRegex.exec(color);
@@ -72655,7 +72187,7 @@ var colorize = (str2, color, type2) => {
72655
72187
  const firstValue = Number(matches2[1]);
72656
72188
  const secondValue = Number(matches2[2]);
72657
72189
  const thirdValue = Number(matches2[3]);
72658
- return type2 === "foreground" ? source_default2.rgb(firstValue, secondValue, thirdValue)(str2) : source_default2.bgRgb(firstValue, secondValue, thirdValue)(str2);
72190
+ return type2 === "foreground" ? source_default.rgb(firstValue, secondValue, thirdValue)(str2) : source_default.bgRgb(firstValue, secondValue, thirdValue)(str2);
72659
72191
  }
72660
72192
  return str2;
72661
72193
  };
@@ -72682,7 +72214,7 @@ var renderBorder = (x, y, node, output) => {
72682
72214
  const contentWidth = width - (showLeftBorder ? 1 : 0) - (showRightBorder ? 1 : 0);
72683
72215
  let topBorder = showTopBorder ? colorize_default((showLeftBorder ? box.topLeft : "") + box.top.repeat(contentWidth) + (showRightBorder ? box.topRight : ""), topBorderColor, "foreground") : undefined;
72684
72216
  if (showTopBorder && dimTopBorderColor) {
72685
- topBorder = source_default2.dim(topBorder);
72217
+ topBorder = source_default.dim(topBorder);
72686
72218
  }
72687
72219
  let verticalBorderHeight = height;
72688
72220
  if (showTopBorder) {
@@ -72694,16 +72226,16 @@ var renderBorder = (x, y, node, output) => {
72694
72226
  let leftBorder = (colorize_default(box.left, leftBorderColor, "foreground") + `
72695
72227
  `).repeat(verticalBorderHeight);
72696
72228
  if (dimLeftBorderColor) {
72697
- leftBorder = source_default2.dim(leftBorder);
72229
+ leftBorder = source_default.dim(leftBorder);
72698
72230
  }
72699
72231
  let rightBorder = (colorize_default(box.right, rightBorderColor, "foreground") + `
72700
72232
  `).repeat(verticalBorderHeight);
72701
72233
  if (dimRightBorderColor) {
72702
- rightBorder = source_default2.dim(rightBorder);
72234
+ rightBorder = source_default.dim(rightBorder);
72703
72235
  }
72704
72236
  let bottomBorder = showBottomBorder ? colorize_default((showLeftBorder ? box.bottomLeft : "") + box.bottom.repeat(contentWidth) + (showRightBorder ? box.bottomRight : ""), bottomBorderColor, "foreground") : undefined;
72705
72237
  if (showBottomBorder && dimBottomBorderColor) {
72706
- bottomBorder = source_default2.dim(bottomBorder);
72238
+ bottomBorder = source_default.dim(bottomBorder);
72707
72239
  }
72708
72240
  const offsetY = showTopBorder ? 1 : 0;
72709
72241
  if (topBorder) {
@@ -73286,15 +72818,15 @@ var renderer = (node, isScreenReaderEnabled) => {
73286
72818
  var renderer_default = renderer;
73287
72819
 
73288
72820
  // node_modules/cli-cursor/index.js
73289
- import process15 from "node:process";
72821
+ import process14 from "node:process";
73290
72822
 
73291
72823
  // node_modules/restore-cursor/index.js
73292
72824
  var import_onetime = __toESM(require_onetime(), 1);
73293
72825
  var import_signal_exit = __toESM(require_signal_exit(), 1);
73294
- import process14 from "node:process";
72826
+ import process13 from "node:process";
73295
72827
  var restoreCursor = import_onetime.default(() => {
73296
72828
  import_signal_exit.default(() => {
73297
- process14.stderr.write("\x1B[?25h");
72829
+ process13.stderr.write("\x1B[?25h");
73298
72830
  }, { alwaysLast: true });
73299
72831
  });
73300
72832
  var restore_cursor_default = restoreCursor;
@@ -73302,14 +72834,14 @@ var restore_cursor_default = restoreCursor;
73302
72834
  // node_modules/cli-cursor/index.js
73303
72835
  var isHidden = false;
73304
72836
  var cliCursor = {};
73305
- cliCursor.show = (writableStream = process15.stderr) => {
72837
+ cliCursor.show = (writableStream = process14.stderr) => {
73306
72838
  if (!writableStream.isTTY) {
73307
72839
  return;
73308
72840
  }
73309
72841
  isHidden = false;
73310
72842
  writableStream.write("\x1B[?25h");
73311
72843
  };
73312
- cliCursor.hide = (writableStream = process15.stderr) => {
72844
+ cliCursor.hide = (writableStream = process14.stderr) => {
73313
72845
  if (!writableStream.isTTY) {
73314
72846
  return;
73315
72847
  }
@@ -73453,7 +72985,7 @@ var instances_default = instances;
73453
72985
  // node_modules/ink/build/components/App.js
73454
72986
  var import_react12 = __toESM(require_react(), 1);
73455
72987
  import { EventEmitter as EventEmitter6 } from "node:events";
73456
- import process19 from "node:process";
72988
+ import process18 from "node:process";
73457
72989
 
73458
72990
  // node_modules/ink/build/components/AppContext.js
73459
72991
  var import_react2 = __toESM(require_react(), 1);
@@ -73466,9 +72998,9 @@ var AppContext_default = AppContext;
73466
72998
  // node_modules/ink/build/components/StdinContext.js
73467
72999
  var import_react3 = __toESM(require_react(), 1);
73468
73000
  import { EventEmitter as EventEmitter5 } from "node:events";
73469
- import process16 from "node:process";
73001
+ import process15 from "node:process";
73470
73002
  var StdinContext = import_react3.createContext({
73471
- stdin: process16.stdin,
73003
+ stdin: process15.stdin,
73472
73004
  internal_eventEmitter: new EventEmitter5,
73473
73005
  setRawMode() {},
73474
73006
  isRawModeSupported: false,
@@ -73479,9 +73011,9 @@ var StdinContext_default = StdinContext;
73479
73011
 
73480
73012
  // node_modules/ink/build/components/StdoutContext.js
73481
73013
  var import_react4 = __toESM(require_react(), 1);
73482
- import process17 from "node:process";
73014
+ import process16 from "node:process";
73483
73015
  var StdoutContext = import_react4.createContext({
73484
- stdout: process17.stdout,
73016
+ stdout: process16.stdout,
73485
73017
  write() {}
73486
73018
  });
73487
73019
  StdoutContext.displayName = "InternalStdoutContext";
@@ -73489,9 +73021,9 @@ var StdoutContext_default = StdoutContext;
73489
73021
 
73490
73022
  // node_modules/ink/build/components/StderrContext.js
73491
73023
  var import_react5 = __toESM(require_react(), 1);
73492
- import process18 from "node:process";
73024
+ import process17 from "node:process";
73493
73025
  var StderrContext = import_react5.createContext({
73494
- stderr: process18.stderr,
73026
+ stderr: process17.stderr,
73495
73027
  write() {}
73496
73028
  });
73497
73029
  StderrContext.displayName = "InternalStderrContext";
@@ -73604,7 +73136,7 @@ function Text({ color, backgroundColor, dimColor = false, bold: bold2 = false, i
73604
73136
  }
73605
73137
  const transform2 = (children2) => {
73606
73138
  if (dimColor) {
73607
- children2 = source_default2.dim(children2);
73139
+ children2 = source_default.dim(children2);
73608
73140
  }
73609
73141
  if (color) {
73610
73142
  children2 = colorize_default(children2, color, "foreground");
@@ -73614,19 +73146,19 @@ function Text({ color, backgroundColor, dimColor = false, bold: bold2 = false, i
73614
73146
  children2 = colorize_default(children2, effectiveBackgroundColor, "background");
73615
73147
  }
73616
73148
  if (bold2) {
73617
- children2 = source_default2.bold(children2);
73149
+ children2 = source_default.bold(children2);
73618
73150
  }
73619
73151
  if (italic) {
73620
- children2 = source_default2.italic(children2);
73152
+ children2 = source_default.italic(children2);
73621
73153
  }
73622
73154
  if (underline) {
73623
- children2 = source_default2.underline(children2);
73155
+ children2 = source_default.underline(children2);
73624
73156
  }
73625
73157
  if (strikethrough) {
73626
- children2 = source_default2.strikethrough(children2);
73158
+ children2 = source_default.strikethrough(children2);
73627
73159
  }
73628
73160
  if (inverse) {
73629
- children2 = source_default2.inverse(children2);
73161
+ children2 = source_default.inverse(children2);
73630
73162
  }
73631
73163
  return children2;
73632
73164
  };
@@ -73744,7 +73276,7 @@ class App extends import_react12.PureComponent {
73744
73276
  handleSetRawMode = (isEnabled) => {
73745
73277
  const { stdin } = this.props;
73746
73278
  if (!this.isRawModeSupported()) {
73747
- if (stdin === process19.stdin) {
73279
+ if (stdin === process18.stdin) {
73748
73280
  throw new Error(`Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.
73749
73281
  Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`);
73750
73282
  } else {
@@ -73938,7 +73470,7 @@ class Ink {
73938
73470
  this.options = options2;
73939
73471
  this.rootNode = createNode("ink-root");
73940
73472
  this.rootNode.onComputeLayout = this.calculateLayout;
73941
- this.isScreenReaderEnabled = options2.isScreenReaderEnabled ?? process20.env["INK_SCREEN_READER"] === "true";
73473
+ this.isScreenReaderEnabled = options2.isScreenReaderEnabled ?? process19.env["INK_SCREEN_READER"] === "true";
73942
73474
  const unthrottled = options2.debug || this.isScreenReaderEnabled;
73943
73475
  const maxFps = options2.maxFps ?? 30;
73944
73476
  const renderThrottleMs = maxFps > 0 ? Math.max(1, Math.ceil(1000 / maxFps)) : 0;
@@ -73961,7 +73493,7 @@ class Ink {
73961
73493
  this.fullStaticOutput = "";
73962
73494
  this.container = reconciler_default.createContainer(this.rootNode, import_constants15.LegacyRoot, null, false, null, "id", () => {}, () => {}, () => {}, () => {}, null);
73963
73495
  this.unsubscribeExit = import_signal_exit2.default(this.unmount, { alwaysLast: false });
73964
- if (process20.env["DEV"] === "true") {
73496
+ if (process19.env["DEV"] === "true") {
73965
73497
  reconciler_default.injectIntoDevTools({
73966
73498
  bundleType: 0,
73967
73499
  version: "16.13.1",
@@ -74169,9 +73701,9 @@ class Ink {
74169
73701
  // node_modules/ink/build/render.js
74170
73702
  var render = (node, options2) => {
74171
73703
  const inkOptions = {
74172
- stdout: process21.stdout,
74173
- stdin: process21.stdin,
74174
- stderr: process21.stderr,
73704
+ stdout: process20.stdout,
73705
+ stdin: process20.stdin,
73706
+ stderr: process20.stderr,
74175
73707
  debug: false,
74176
73708
  exitOnCtrlC: true,
74177
73709
  patchConsole: true,
@@ -74196,7 +73728,7 @@ var getOptions = (stdout = {}) => {
74196
73728
  if (stdout instanceof Stream) {
74197
73729
  return {
74198
73730
  stdout,
74199
- stdin: process21.stdin
73731
+ stdin: process20.stdin
74200
73732
  };
74201
73733
  }
74202
73734
  return stdout;
@@ -74612,14 +74144,14 @@ var import_react26 = __toESM(require_react(), 1);
74612
74144
  var import_deepmerge = __toESM(require_cjs(), 1);
74613
74145
 
74614
74146
  // node_modules/is-unicode-supported/index.js
74615
- import process22 from "node:process";
74147
+ import process21 from "node:process";
74616
74148
  function isUnicodeSupported() {
74617
- const { env: env6 } = process22;
74618
- const { TERM, TERM_PROGRAM } = env6;
74619
- if (process22.platform !== "win32") {
74149
+ const { env: env5 } = process21;
74150
+ const { TERM, TERM_PROGRAM } = env5;
74151
+ if (process21.platform !== "win32") {
74620
74152
  return TERM !== "linux";
74621
74153
  }
74622
- return Boolean(env6.WT_SESSION) || Boolean(env6.TERMINUS_SUBLIME) || env6.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env6.TERMINAL_EMULATOR === "JetBrains-JediTerm";
74154
+ return Boolean(env5.WT_SESSION) || Boolean(env5.TERMINUS_SUBLIME) || env5.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env5.TERMINAL_EMULATOR === "JetBrains-JediTerm";
74623
74155
  }
74624
74156
 
74625
74157
  // node_modules/figures/index.js
@@ -75217,8 +74749,8 @@ var UnorderedListItemContext = import_react29.createContext({
75217
74749
  // node_modules/@inkjs/ui/build/components/unordered-list/unordered-list-item.js
75218
74750
  function UnorderedListItem({ children }) {
75219
74751
  const { marker } = import_react30.useContext(UnorderedListItemContext);
75220
- const { styles: styles7 } = useComponentTheme("UnorderedList");
75221
- return import_react30.default.createElement(Box_default, { ...styles7.listItem() }, import_react30.default.createElement(Text, { ...styles7.marker() }, marker), import_react30.default.createElement(Box_default, { ...styles7.content() }, children));
74752
+ const { styles: styles5 } = useComponentTheme("UnorderedList");
74753
+ return import_react30.default.createElement(Box_default, { ...styles5.listItem() }, import_react30.default.createElement(Text, { ...styles5.marker() }, marker), import_react30.default.createElement(Box_default, { ...styles5.content() }, children));
75222
74754
  }
75223
74755
 
75224
74756
  // node_modules/@inkjs/ui/build/components/unordered-list/unordered-list-context.js
@@ -75230,7 +74762,7 @@ var UnorderedListContext = import_react31.createContext({
75230
74762
  // node_modules/@inkjs/ui/build/components/unordered-list/unordered-list.js
75231
74763
  function UnorderedList({ children }) {
75232
74764
  const { depth } = import_react32.useContext(UnorderedListContext);
75233
- const { styles: styles7, config } = useComponentTheme("UnorderedList");
74765
+ const { styles: styles5, config } = useComponentTheme("UnorderedList");
75234
74766
  const listContext = import_react32.useMemo(() => ({
75235
74767
  depth: depth + 1
75236
74768
  }), [depth]);
@@ -75248,7 +74780,7 @@ function UnorderedList({ children }) {
75248
74780
  marker: defaultMarker
75249
74781
  };
75250
74782
  }, [config, depth]);
75251
- return import_react32.default.createElement(UnorderedListContext.Provider, { value: listContext }, import_react32.default.createElement(UnorderedListItemContext.Provider, { value: listItemContext }, import_react32.default.createElement(Box_default, { ...styles7.list() }, children)));
74783
+ return import_react32.default.createElement(UnorderedListContext.Provider, { value: listContext }, import_react32.default.createElement(UnorderedListItemContext.Provider, { value: listItemContext }, import_react32.default.createElement(Box_default, { ...styles5.list() }, children)));
75252
74784
  }
75253
74785
  UnorderedList.Item = UnorderedListItem;
75254
74786
  // node_modules/@inkjs/ui/build/components/multi-select/multi-select.js
@@ -76968,8 +76500,8 @@ function useSpinner({ type: type2 = "dots" }) {
76968
76500
  // node_modules/@inkjs/ui/build/components/spinner/spinner.js
76969
76501
  function Spinner({ label, type: type2 }) {
76970
76502
  const { frame } = useSpinner({ type: type2 });
76971
- const { styles: styles7 } = useComponentTheme("Spinner");
76972
- return import_react41.default.createElement(Box_default, { ...styles7.container() }, import_react41.default.createElement(Text, { ...styles7.frame() }, frame), label && import_react41.default.createElement(Text, { ...styles7.label() }, label));
76503
+ const { styles: styles5 } = useComponentTheme("Spinner");
76504
+ return import_react41.default.createElement(Box_default, { ...styles5.container() }, import_react41.default.createElement(Text, { ...styles5.frame() }, frame), label && import_react41.default.createElement(Text, { ...styles5.label() }, label));
76973
76505
  }
76974
76506
  // node_modules/@inkjs/ui/build/components/text-input/text-input.js
76975
76507
  var import_react44 = __toESM(require_react(), 1);
@@ -76979,498 +76511,7 @@ var import_react42 = __toESM(require_react(), 1);
76979
76511
 
76980
76512
  // node_modules/@inkjs/ui/build/components/text-input/use-text-input.js
76981
76513
  var import_react43 = __toESM(require_react(), 1);
76982
-
76983
- // node_modules/@inkjs/ui/node_modules/chalk/source/vendor/ansi-styles/index.js
76984
- var ANSI_BACKGROUND_OFFSET4 = 10;
76985
- var wrapAnsi164 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
76986
- var wrapAnsi2564 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
76987
- var wrapAnsi16m4 = (offset = 0) => (red2, green2, blue) => `\x1B[${38 + offset};2;${red2};${green2};${blue}m`;
76988
- var styles7 = {
76989
- modifier: {
76990
- reset: [0, 0],
76991
- bold: [1, 22],
76992
- dim: [2, 22],
76993
- italic: [3, 23],
76994
- underline: [4, 24],
76995
- overline: [53, 55],
76996
- inverse: [7, 27],
76997
- hidden: [8, 28],
76998
- strikethrough: [9, 29]
76999
- },
77000
- color: {
77001
- black: [30, 39],
77002
- red: [31, 39],
77003
- green: [32, 39],
77004
- yellow: [33, 39],
77005
- blue: [34, 39],
77006
- magenta: [35, 39],
77007
- cyan: [36, 39],
77008
- white: [37, 39],
77009
- blackBright: [90, 39],
77010
- gray: [90, 39],
77011
- grey: [90, 39],
77012
- redBright: [91, 39],
77013
- greenBright: [92, 39],
77014
- yellowBright: [93, 39],
77015
- blueBright: [94, 39],
77016
- magentaBright: [95, 39],
77017
- cyanBright: [96, 39],
77018
- whiteBright: [97, 39]
77019
- },
77020
- bgColor: {
77021
- bgBlack: [40, 49],
77022
- bgRed: [41, 49],
77023
- bgGreen: [42, 49],
77024
- bgYellow: [43, 49],
77025
- bgBlue: [44, 49],
77026
- bgMagenta: [45, 49],
77027
- bgCyan: [46, 49],
77028
- bgWhite: [47, 49],
77029
- bgBlackBright: [100, 49],
77030
- bgGray: [100, 49],
77031
- bgGrey: [100, 49],
77032
- bgRedBright: [101, 49],
77033
- bgGreenBright: [102, 49],
77034
- bgYellowBright: [103, 49],
77035
- bgBlueBright: [104, 49],
77036
- bgMagentaBright: [105, 49],
77037
- bgCyanBright: [106, 49],
77038
- bgWhiteBright: [107, 49]
77039
- }
77040
- };
77041
- var modifierNames4 = Object.keys(styles7.modifier);
77042
- var foregroundColorNames4 = Object.keys(styles7.color);
77043
- var backgroundColorNames4 = Object.keys(styles7.bgColor);
77044
- var colorNames4 = [...foregroundColorNames4, ...backgroundColorNames4];
77045
- function assembleStyles4() {
77046
- const codes = new Map;
77047
- for (const [groupName, group] of Object.entries(styles7)) {
77048
- for (const [styleName, style] of Object.entries(group)) {
77049
- styles7[styleName] = {
77050
- open: `\x1B[${style[0]}m`,
77051
- close: `\x1B[${style[1]}m`
77052
- };
77053
- group[styleName] = styles7[styleName];
77054
- codes.set(style[0], style[1]);
77055
- }
77056
- Object.defineProperty(styles7, groupName, {
77057
- value: group,
77058
- enumerable: false
77059
- });
77060
- }
77061
- Object.defineProperty(styles7, "codes", {
77062
- value: codes,
77063
- enumerable: false
77064
- });
77065
- styles7.color.close = "\x1B[39m";
77066
- styles7.bgColor.close = "\x1B[49m";
77067
- styles7.color.ansi = wrapAnsi164();
77068
- styles7.color.ansi256 = wrapAnsi2564();
77069
- styles7.color.ansi16m = wrapAnsi16m4();
77070
- styles7.bgColor.ansi = wrapAnsi164(ANSI_BACKGROUND_OFFSET4);
77071
- styles7.bgColor.ansi256 = wrapAnsi2564(ANSI_BACKGROUND_OFFSET4);
77072
- styles7.bgColor.ansi16m = wrapAnsi16m4(ANSI_BACKGROUND_OFFSET4);
77073
- Object.defineProperties(styles7, {
77074
- rgbToAnsi256: {
77075
- value(red2, green2, blue) {
77076
- if (red2 === green2 && green2 === blue) {
77077
- if (red2 < 8) {
77078
- return 16;
77079
- }
77080
- if (red2 > 248) {
77081
- return 231;
77082
- }
77083
- return Math.round((red2 - 8) / 247 * 24) + 232;
77084
- }
77085
- return 16 + 36 * Math.round(red2 / 255 * 5) + 6 * Math.round(green2 / 255 * 5) + Math.round(blue / 255 * 5);
77086
- },
77087
- enumerable: false
77088
- },
77089
- hexToRgb: {
77090
- value(hex) {
77091
- const matches2 = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
77092
- if (!matches2) {
77093
- return [0, 0, 0];
77094
- }
77095
- let [colorString] = matches2;
77096
- if (colorString.length === 3) {
77097
- colorString = [...colorString].map((character) => character + character).join("");
77098
- }
77099
- const integer = Number.parseInt(colorString, 16);
77100
- return [
77101
- integer >> 16 & 255,
77102
- integer >> 8 & 255,
77103
- integer & 255
77104
- ];
77105
- },
77106
- enumerable: false
77107
- },
77108
- hexToAnsi256: {
77109
- value: (hex) => styles7.rgbToAnsi256(...styles7.hexToRgb(hex)),
77110
- enumerable: false
77111
- },
77112
- ansi256ToAnsi: {
77113
- value(code) {
77114
- if (code < 8) {
77115
- return 30 + code;
77116
- }
77117
- if (code < 16) {
77118
- return 90 + (code - 8);
77119
- }
77120
- let red2;
77121
- let green2;
77122
- let blue;
77123
- if (code >= 232) {
77124
- red2 = ((code - 232) * 10 + 8) / 255;
77125
- green2 = red2;
77126
- blue = red2;
77127
- } else {
77128
- code -= 16;
77129
- const remainder = code % 36;
77130
- red2 = Math.floor(code / 36) / 5;
77131
- green2 = Math.floor(remainder / 6) / 5;
77132
- blue = remainder % 6 / 5;
77133
- }
77134
- const value = Math.max(red2, green2, blue) * 2;
77135
- if (value === 0) {
77136
- return 30;
77137
- }
77138
- let result2 = 30 + (Math.round(blue) << 2 | Math.round(green2) << 1 | Math.round(red2));
77139
- if (value === 2) {
77140
- result2 += 60;
77141
- }
77142
- return result2;
77143
- },
77144
- enumerable: false
77145
- },
77146
- rgbToAnsi: {
77147
- value: (red2, green2, blue) => styles7.ansi256ToAnsi(styles7.rgbToAnsi256(red2, green2, blue)),
77148
- enumerable: false
77149
- },
77150
- hexToAnsi: {
77151
- value: (hex) => styles7.ansi256ToAnsi(styles7.hexToAnsi256(hex)),
77152
- enumerable: false
77153
- }
77154
- });
77155
- return styles7;
77156
- }
77157
- var ansiStyles4 = assembleStyles4();
77158
- var ansi_styles_default4 = ansiStyles4;
77159
-
77160
- // node_modules/@inkjs/ui/node_modules/chalk/source/vendor/supports-color/index.js
77161
- import process23 from "node:process";
77162
- import os7 from "node:os";
77163
- import tty3 from "node:tty";
77164
- function hasFlag3(flag, argv = globalThis.Deno ? globalThis.Deno.args : process23.argv) {
77165
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
77166
- const position = argv.indexOf(prefix + flag);
77167
- const terminatorPosition = argv.indexOf("--");
77168
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
77169
- }
77170
- var { env: env6 } = process23;
77171
- var flagForceColor3;
77172
- if (hasFlag3("no-color") || hasFlag3("no-colors") || hasFlag3("color=false") || hasFlag3("color=never")) {
77173
- flagForceColor3 = 0;
77174
- } else if (hasFlag3("color") || hasFlag3("colors") || hasFlag3("color=true") || hasFlag3("color=always")) {
77175
- flagForceColor3 = 1;
77176
- }
77177
- function envForceColor3() {
77178
- if ("FORCE_COLOR" in env6) {
77179
- if (env6.FORCE_COLOR === "true") {
77180
- return 1;
77181
- }
77182
- if (env6.FORCE_COLOR === "false") {
77183
- return 0;
77184
- }
77185
- return env6.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env6.FORCE_COLOR, 10), 3);
77186
- }
77187
- }
77188
- function translateLevel3(level) {
77189
- if (level === 0) {
77190
- return false;
77191
- }
77192
- return {
77193
- level,
77194
- hasBasic: true,
77195
- has256: level >= 2,
77196
- has16m: level >= 3
77197
- };
77198
- }
77199
- function _supportsColor3(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
77200
- const noFlagForceColor = envForceColor3();
77201
- if (noFlagForceColor !== undefined) {
77202
- flagForceColor3 = noFlagForceColor;
77203
- }
77204
- const forceColor = sniffFlags ? flagForceColor3 : noFlagForceColor;
77205
- if (forceColor === 0) {
77206
- return 0;
77207
- }
77208
- if (sniffFlags) {
77209
- if (hasFlag3("color=16m") || hasFlag3("color=full") || hasFlag3("color=truecolor")) {
77210
- return 3;
77211
- }
77212
- if (hasFlag3("color=256")) {
77213
- return 2;
77214
- }
77215
- }
77216
- if ("TF_BUILD" in env6 && "AGENT_NAME" in env6) {
77217
- return 1;
77218
- }
77219
- if (haveStream && !streamIsTTY && forceColor === undefined) {
77220
- return 0;
77221
- }
77222
- const min2 = forceColor || 0;
77223
- if (env6.TERM === "dumb") {
77224
- return min2;
77225
- }
77226
- if (process23.platform === "win32") {
77227
- const osRelease = os7.release().split(".");
77228
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
77229
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
77230
- }
77231
- return 1;
77232
- }
77233
- if ("CI" in env6) {
77234
- if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => (key in env6))) {
77235
- return 3;
77236
- }
77237
- if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => (sign in env6)) || env6.CI_NAME === "codeship") {
77238
- return 1;
77239
- }
77240
- return min2;
77241
- }
77242
- if ("TEAMCITY_VERSION" in env6) {
77243
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env6.TEAMCITY_VERSION) ? 1 : 0;
77244
- }
77245
- if (env6.COLORTERM === "truecolor") {
77246
- return 3;
77247
- }
77248
- if (env6.TERM === "xterm-kitty") {
77249
- return 3;
77250
- }
77251
- if (env6.TERM === "xterm-ghostty") {
77252
- return 3;
77253
- }
77254
- if (env6.TERM === "wezterm") {
77255
- return 3;
77256
- }
77257
- if ("TERM_PROGRAM" in env6) {
77258
- const version = Number.parseInt((env6.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
77259
- switch (env6.TERM_PROGRAM) {
77260
- case "iTerm.app": {
77261
- return version >= 3 ? 3 : 2;
77262
- }
77263
- case "Apple_Terminal": {
77264
- return 2;
77265
- }
77266
- }
77267
- }
77268
- if (/-256(color)?$/i.test(env6.TERM)) {
77269
- return 2;
77270
- }
77271
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env6.TERM)) {
77272
- return 1;
77273
- }
77274
- if ("COLORTERM" in env6) {
77275
- return 1;
77276
- }
77277
- return min2;
77278
- }
77279
- function createSupportsColor3(stream, options2 = {}) {
77280
- const level = _supportsColor3(stream, {
77281
- streamIsTTY: stream && stream.isTTY,
77282
- ...options2
77283
- });
77284
- return translateLevel3(level);
77285
- }
77286
- var supportsColor3 = {
77287
- stdout: createSupportsColor3({ isTTY: tty3.isatty(1) }),
77288
- stderr: createSupportsColor3({ isTTY: tty3.isatty(2) })
77289
- };
77290
- var supports_color_default3 = supportsColor3;
77291
-
77292
- // node_modules/@inkjs/ui/node_modules/chalk/source/utilities.js
77293
- function stringReplaceAll3(string, substring, replacer) {
77294
- let index = string.indexOf(substring);
77295
- if (index === -1) {
77296
- return string;
77297
- }
77298
- const substringLength = substring.length;
77299
- let endIndex = 0;
77300
- let returnValue = "";
77301
- do {
77302
- returnValue += string.slice(endIndex, index) + substring + replacer;
77303
- endIndex = index + substringLength;
77304
- index = string.indexOf(substring, endIndex);
77305
- } while (index !== -1);
77306
- returnValue += string.slice(endIndex);
77307
- return returnValue;
77308
- }
77309
- function stringEncaseCRLFWithFirstIndex3(string, prefix, postfix, index) {
77310
- let endIndex = 0;
77311
- let returnValue = "";
77312
- do {
77313
- const gotCR = string[index - 1] === "\r";
77314
- returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? `\r
77315
- ` : `
77316
- `) + postfix;
77317
- endIndex = index + 1;
77318
- index = string.indexOf(`
77319
- `, endIndex);
77320
- } while (index !== -1);
77321
- returnValue += string.slice(endIndex);
77322
- return returnValue;
77323
- }
77324
-
77325
- // node_modules/@inkjs/ui/node_modules/chalk/source/index.js
77326
- var { stdout: stdoutColor3, stderr: stderrColor3 } = supports_color_default3;
77327
- var GENERATOR3 = Symbol("GENERATOR");
77328
- var STYLER3 = Symbol("STYLER");
77329
- var IS_EMPTY3 = Symbol("IS_EMPTY");
77330
- var levelMapping3 = [
77331
- "ansi",
77332
- "ansi",
77333
- "ansi256",
77334
- "ansi16m"
77335
- ];
77336
- var styles8 = Object.create(null);
77337
- var applyOptions3 = (object, options2 = {}) => {
77338
- if (options2.level && !(Number.isInteger(options2.level) && options2.level >= 0 && options2.level <= 3)) {
77339
- throw new Error("The `level` option should be an integer from 0 to 3");
77340
- }
77341
- const colorLevel = stdoutColor3 ? stdoutColor3.level : 0;
77342
- object.level = options2.level === undefined ? colorLevel : options2.level;
77343
- };
77344
- var chalkFactory3 = (options2) => {
77345
- const chalk3 = (...strings) => strings.join(" ");
77346
- applyOptions3(chalk3, options2);
77347
- Object.setPrototypeOf(chalk3, createChalk3.prototype);
77348
- return chalk3;
77349
- };
77350
- function createChalk3(options2) {
77351
- return chalkFactory3(options2);
77352
- }
77353
- Object.setPrototypeOf(createChalk3.prototype, Function.prototype);
77354
- for (const [styleName, style] of Object.entries(ansi_styles_default4)) {
77355
- styles8[styleName] = {
77356
- get() {
77357
- const builder = createBuilder3(this, createStyler3(style.open, style.close, this[STYLER3]), this[IS_EMPTY3]);
77358
- Object.defineProperty(this, styleName, { value: builder });
77359
- return builder;
77360
- }
77361
- };
77362
- }
77363
- styles8.visible = {
77364
- get() {
77365
- const builder = createBuilder3(this, this[STYLER3], true);
77366
- Object.defineProperty(this, "visible", { value: builder });
77367
- return builder;
77368
- }
77369
- };
77370
- var getModelAnsi3 = (model, level, type2, ...arguments_) => {
77371
- if (model === "rgb") {
77372
- if (level === "ansi16m") {
77373
- return ansi_styles_default4[type2].ansi16m(...arguments_);
77374
- }
77375
- if (level === "ansi256") {
77376
- return ansi_styles_default4[type2].ansi256(ansi_styles_default4.rgbToAnsi256(...arguments_));
77377
- }
77378
- return ansi_styles_default4[type2].ansi(ansi_styles_default4.rgbToAnsi(...arguments_));
77379
- }
77380
- if (model === "hex") {
77381
- return getModelAnsi3("rgb", level, type2, ...ansi_styles_default4.hexToRgb(...arguments_));
77382
- }
77383
- return ansi_styles_default4[type2][model](...arguments_);
77384
- };
77385
- var usedModels3 = ["rgb", "hex", "ansi256"];
77386
- for (const model of usedModels3) {
77387
- styles8[model] = {
77388
- get() {
77389
- const { level } = this;
77390
- return function(...arguments_) {
77391
- const styler = createStyler3(getModelAnsi3(model, levelMapping3[level], "color", ...arguments_), ansi_styles_default4.color.close, this[STYLER3]);
77392
- return createBuilder3(this, styler, this[IS_EMPTY3]);
77393
- };
77394
- }
77395
- };
77396
- const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
77397
- styles8[bgModel] = {
77398
- get() {
77399
- const { level } = this;
77400
- return function(...arguments_) {
77401
- const styler = createStyler3(getModelAnsi3(model, levelMapping3[level], "bgColor", ...arguments_), ansi_styles_default4.bgColor.close, this[STYLER3]);
77402
- return createBuilder3(this, styler, this[IS_EMPTY3]);
77403
- };
77404
- }
77405
- };
77406
- }
77407
- var proto3 = Object.defineProperties(() => {}, {
77408
- ...styles8,
77409
- level: {
77410
- enumerable: true,
77411
- get() {
77412
- return this[GENERATOR3].level;
77413
- },
77414
- set(level) {
77415
- this[GENERATOR3].level = level;
77416
- }
77417
- }
77418
- });
77419
- var createStyler3 = (open, close, parent) => {
77420
- let openAll;
77421
- let closeAll;
77422
- if (parent === undefined) {
77423
- openAll = open;
77424
- closeAll = close;
77425
- } else {
77426
- openAll = parent.openAll + open;
77427
- closeAll = close + parent.closeAll;
77428
- }
77429
- return {
77430
- open,
77431
- close,
77432
- openAll,
77433
- closeAll,
77434
- parent
77435
- };
77436
- };
77437
- var createBuilder3 = (self2, _styler, _isEmpty) => {
77438
- const builder = (...arguments_) => applyStyle3(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
77439
- Object.setPrototypeOf(builder, proto3);
77440
- builder[GENERATOR3] = self2;
77441
- builder[STYLER3] = _styler;
77442
- builder[IS_EMPTY3] = _isEmpty;
77443
- return builder;
77444
- };
77445
- var applyStyle3 = (self2, string) => {
77446
- if (self2.level <= 0 || !string) {
77447
- return self2[IS_EMPTY3] ? "" : string;
77448
- }
77449
- let styler = self2[STYLER3];
77450
- if (styler === undefined) {
77451
- return string;
77452
- }
77453
- const { openAll, closeAll } = styler;
77454
- if (string.includes("\x1B")) {
77455
- while (styler !== undefined) {
77456
- string = stringReplaceAll3(string, styler.close, styler.open);
77457
- styler = styler.parent;
77458
- }
77459
- }
77460
- const lfIndex = string.indexOf(`
77461
- `);
77462
- if (lfIndex !== -1) {
77463
- string = stringEncaseCRLFWithFirstIndex3(string, closeAll, openAll, lfIndex);
77464
- }
77465
- return openAll + string + closeAll;
77466
- };
77467
- Object.defineProperties(createChalk3.prototype, styles8);
77468
- var chalk3 = createChalk3();
77469
- var chalkStderr3 = createChalk3({ level: stderrColor3 ? stderrColor3.level : 0 });
77470
- var source_default3 = chalk3;
77471
-
77472
- // node_modules/@inkjs/ui/build/components/text-input/use-text-input.js
77473
- var cursor = source_default3.inverse(" ");
76514
+ var cursor = source_default.inverse(" ");
77474
76515
  // node_modules/@inkjs/ui/build/components/ordered-list/ordered-list.js
77475
76516
  var import_react48 = __toESM(require_react(), 1);
77476
76517
 
@@ -77486,8 +76527,8 @@ var OrderedListItemContext = import_react45.createContext({
77486
76527
  // node_modules/@inkjs/ui/build/components/ordered-list/ordered-list-item.js
77487
76528
  function OrderedListItem({ children }) {
77488
76529
  const { marker } = import_react46.useContext(OrderedListItemContext);
77489
- const { styles: styles9 } = useComponentTheme("OrderedList");
77490
- return import_react46.default.createElement(Box_default, { ...styles9.listItem() }, import_react46.default.createElement(Text, { ...styles9.marker() }, marker), import_react46.default.createElement(Box_default, { ...styles9.content() }, children));
76530
+ const { styles: styles5 } = useComponentTheme("OrderedList");
76531
+ return import_react46.default.createElement(Box_default, { ...styles5.listItem() }, import_react46.default.createElement(Text, { ...styles5.marker() }, marker), import_react46.default.createElement(Box_default, { ...styles5.content() }, children));
77491
76532
  }
77492
76533
 
77493
76534
  // node_modules/@inkjs/ui/build/components/ordered-list/ordered-list-context.js
@@ -77499,7 +76540,7 @@ var OrderedListContext = import_react47.createContext({
77499
76540
  // node_modules/@inkjs/ui/build/components/ordered-list/ordered-list.js
77500
76541
  function OrderedList({ children }) {
77501
76542
  const { marker: parentMarker } = import_react48.useContext(OrderedListContext);
77502
- const { styles: styles9 } = useComponentTheme("OrderedList");
76543
+ const { styles: styles5 } = useComponentTheme("OrderedList");
77503
76544
  let numberOfItems = 0;
77504
76545
  for (const child of import_react48.default.Children.toArray(children)) {
77505
76546
  if (!import_react48.isValidElement(child) || child.type !== OrderedListItem) {
@@ -77508,7 +76549,7 @@ function OrderedList({ children }) {
77508
76549
  numberOfItems++;
77509
76550
  }
77510
76551
  const maxMarkerWidth = String(numberOfItems).length;
77511
- return import_react48.default.createElement(Box_default, { ...styles9.list() }, import_react48.default.Children.map(children, (child, index) => {
76552
+ return import_react48.default.createElement(Box_default, { ...styles5.list() }, import_react48.default.Children.map(children, (child, index) => {
77512
76553
  if (!import_react48.isValidElement(child) || child.type !== OrderedListItem) {
77513
76554
  return child;
77514
76555
  }
@@ -77526,7 +76567,7 @@ var import_react49 = __toESM(require_react(), 1);
77526
76567
 
77527
76568
  // node_modules/@inkjs/ui/build/components/password-input/use-password-input.js
77528
76569
  var import_react50 = __toESM(require_react(), 1);
77529
- var cursor2 = source_default3.inverse(" ");
76570
+ var cursor2 = source_default.inverse(" ");
77530
76571
  // node_modules/@inkjs/ui/build/components/status-message/status-message.js
77531
76572
  var import_react52 = __toESM(require_react(), 1);
77532
76573
  // node_modules/@inkjs/ui/build/components/alert/alert.js
@@ -77539,7 +76580,7 @@ var import_react54 = __toESM(require_react(), 1);
77539
76580
 
77540
76581
  // node_modules/@inkjs/ui/build/components/email-input/use-email-input.js
77541
76582
  var import_react55 = __toESM(require_react(), 1);
77542
- var cursor3 = source_default3.inverse(" ");
76583
+ var cursor3 = source_default.inverse(" ");
77543
76584
  // src/ui/components/Spinner.tsx
77544
76585
  var jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
77545
76586
  function Spinner2({ label, type: type2 = "simpleDots" }) {
@@ -79308,7 +78349,8 @@ class InkProvider {
79308
78349
  }
79309
78350
  async waitUntilExit() {
79310
78351
  if (this.waitUntilExitFn) {
79311
- return this.waitUntilExitFn();
78352
+ await this.waitUntilExitFn();
78353
+ return;
79312
78354
  }
79313
78355
  return this.exitPromise;
79314
78356
  }
@@ -80140,7 +79182,7 @@ class UpdateScheduler extends EventEmitter8 {
80140
79182
 
80141
79183
  // src/auto-update/installer.ts
80142
79184
  init_logger();
80143
- import { spawn as spawn8, spawnSync } from "child_process";
79185
+ import { spawn as spawn4, spawnSync } from "child_process";
80144
79186
  import { existsSync as existsSync13, readFileSync as readFileSync9, writeFileSync as writeFileSync5, mkdirSync as mkdirSync4 } from "fs";
80145
79187
  import { dirname as dirname8, resolve as resolve6 } from "path";
80146
79188
  import { homedir as homedir5 } from "os";
@@ -80283,7 +79325,7 @@ async function installVersion(version) {
80283
79325
  const { cmd, isBun: isBun3 } = pm;
80284
79326
  const args = ["install", "-g", `${PACKAGE_NAME2}@${version}`];
80285
79327
  log31.debug(`Using ${isBun3 ? "bun" : "npm"} for installation`);
80286
- const child = spawn8(cmd, args, {
79328
+ const child = spawn4(cmd, args, {
80287
79329
  stdio: ["ignore", "pipe", "pipe"],
80288
79330
  env: {
80289
79331
  ...process.env,
@@ -80538,11 +79580,12 @@ function wirePlatformEvents(platformId, client, session, ui) {
80538
79580
  }
80539
79581
  program.name("claude-threads").version(VERSION).description("Share Claude Code sessions in Mattermost").option("--url <url>", "Mattermost server URL").option("--token <token>", "Mattermost bot token").option("--channel <id>", "Mattermost channel ID").option("--bot-name <name>", "Bot mention name (default: claude-code)").option("--allowed-users <users>", "Comma-separated allowed usernames").option("--skip-permissions", "Skip interactive permission prompts").option("--no-skip-permissions", "Enable interactive permission prompts (override env)").option("--chrome", "Enable Claude in Chrome integration").option("--no-chrome", "Disable Claude in Chrome integration").option("--worktree-mode <mode>", "Git worktree mode: off, prompt, require (default: prompt)").option("--keep-alive", "Enable system sleep prevention (default: enabled)").option("--no-keep-alive", "Disable system sleep prevention").option("--setup", "Run interactive setup wizard (reconfigure existing settings)").option("--debug", "Enable debug logging").option("--skip-version-check", "Skip Claude CLI version compatibility check").option("--auto-restart", "Enable auto-restart on updates (default when autoUpdate enabled)").option("--no-auto-restart", "Disable auto-restart on updates").option("--headless", "Run without interactive UI (logs to stdout)").parse();
80540
79582
  var opts = program.opts();
79583
+ var forcedInteractive = !!process.env.CLAUDE_THREADS_INTERACTIVE;
79584
+ var isHeadless = opts.headless || !forcedInteractive && (!process.stdout.isTTY || !process.stdin.isTTY);
80541
79585
  function hasRequiredCliArgs(args) {
80542
79586
  return !!(args.url && args.token && args.channel);
80543
79587
  }
80544
79588
  async function main() {
80545
- const isHeadless = opts.headless || !process.stdout.isTTY || !process.stdin.isTTY;
80546
79589
  if (!isHeadless) {
80547
79590
  process.stdout.write("\x1B[2J\x1B[H");
80548
79591
  }
@@ -80553,10 +79596,10 @@ async function main() {
80553
79596
  return true;
80554
79597
  if (await configExists()) {
80555
79598
  try {
80556
- const config2 = loadConfigWithMigration();
80557
- if (!config2)
79599
+ const config = loadConfigWithMigration();
79600
+ if (!config)
80558
79601
  return false;
80559
- return config2.autoUpdate?.enabled !== false;
79602
+ return config.autoUpdate?.enabled !== false;
80560
79603
  } catch {
80561
79604
  return false;
80562
79605
  }
@@ -80564,7 +79607,7 @@ async function main() {
80564
79607
  return false;
80565
79608
  };
80566
79609
  if (await shouldUseAutoRestart()) {
80567
- const { spawn: spawn9 } = await import("child_process");
79610
+ const { spawn: spawn5 } = await import("child_process");
80568
79611
  const { dirname: dirname9, resolve: resolve7 } = await import("path");
80569
79612
  const { fileURLToPath: fileURLToPath7 } = await import("url");
80570
79613
  const __filename2 = fileURLToPath7(import.meta.url);
@@ -80574,14 +79617,34 @@ async function main() {
80574
79617
  console.log("\uD83D\uDD04 Starting with auto-restart enabled...");
80575
79618
  console.log("");
80576
79619
  const binPath = __filename2;
80577
- const child = spawn9(daemonPath, ["--restart-on-error", ...args], {
80578
- stdio: "inherit",
80579
- env: {
80580
- ...process.env,
80581
- CLAUDE_THREADS_BIN: binPath
80582
- }
80583
- });
79620
+ let child;
79621
+ if (process.platform === "win32") {
79622
+ child = spawn5("bash", [daemonPath, "--restart-on-error", ...args], {
79623
+ stdio: "inherit",
79624
+ env: {
79625
+ ...process.env,
79626
+ CLAUDE_THREADS_BIN: binPath,
79627
+ ...process.stdout.isTTY ? { CLAUDE_THREADS_INTERACTIVE: "1" } : {}
79628
+ }
79629
+ });
79630
+ } else {
79631
+ child = spawn5(daemonPath, ["--restart-on-error", ...args], {
79632
+ stdio: "inherit",
79633
+ env: {
79634
+ ...process.env,
79635
+ CLAUDE_THREADS_BIN: binPath,
79636
+ ...process.stdout.isTTY ? { CLAUDE_THREADS_INTERACTIVE: "1" } : {}
79637
+ }
79638
+ });
79639
+ }
80584
79640
  child.on("error", (err) => {
79641
+ if (process.platform === "win32") {
79642
+ console.error(`Failed to start daemon: ${err.message}`);
79643
+ console.error("Auto-restart requires bash (Git for Windows or WSL). Starting without auto-restart...");
79644
+ console.error("");
79645
+ startWithoutDaemon();
79646
+ return;
79647
+ }
80585
79648
  console.error(`Failed to start daemon: ${err.message}`);
80586
79649
  process.exit(1);
80587
79650
  });
@@ -80590,6 +79653,9 @@ async function main() {
80590
79653
  });
80591
79654
  return;
80592
79655
  }
79656
+ await startWithoutDaemon();
79657
+ }
79658
+ async function startWithoutDaemon() {
80593
79659
  checkForUpdates();
80594
79660
  if (opts.debug) {
80595
79661
  process.env.DEBUG = "1";