ccstatusline 2.2.13 → 2.2.15

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.
@@ -1355,7 +1355,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
1355
1355
  exports.useTransition = function() {
1356
1356
  return resolveDispatcher().useTransition();
1357
1357
  };
1358
- exports.version = "19.2.5";
1358
+ exports.version = "19.2.6";
1359
1359
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1360
1360
  })();
1361
1361
  });
@@ -52341,13 +52341,31 @@ var init_Widget = __esm(() => {
52341
52341
  });
52342
52342
 
52343
52343
  // src/types/Settings.ts
52344
- var CURRENT_VERSION = 3, SettingsSchema_v1, SettingsSchema, DEFAULT_SETTINGS;
52344
+ var CURRENT_VERSION = 3, InstallationMetadataSchema, SettingsSchema_v1, SettingsSchema, DEFAULT_SETTINGS;
52345
52345
  var init_Settings = __esm(() => {
52346
52346
  init_zod();
52347
52347
  init_ColorLevel();
52348
52348
  init_FlexMode();
52349
52349
  init_PowerlineConfig();
52350
52350
  init_Widget();
52351
+ InstallationMetadataSchema = exports_external.discriminatedUnion("method", [
52352
+ exports_external.object({
52353
+ method: exports_external.literal("auto-update"),
52354
+ packageManager: exports_external.enum(["npm", "bun"])
52355
+ }),
52356
+ exports_external.object({
52357
+ method: exports_external.literal("pinned"),
52358
+ installedVersion: exports_external.string().optional()
52359
+ }),
52360
+ exports_external.object({
52361
+ method: exports_external.literal("self-managed"),
52362
+ packageManager: exports_external.enum(["npm", "bun", "unknown"]).default("unknown")
52363
+ }),
52364
+ exports_external.object({
52365
+ method: exports_external.literal("unknown"),
52366
+ packageManager: exports_external.enum(["npm", "bun", "unknown"]).default("unknown")
52367
+ })
52368
+ ]);
52351
52369
  SettingsSchema_v1 = exports_external.object({
52352
52370
  lines: exports_external.array(exports_external.array(WidgetItemSchema)).optional(),
52353
52371
  flexMode: FlexModeSchema.optional(),
@@ -52398,7 +52416,8 @@ var init_Settings = __esm(() => {
52398
52416
  updatemessage: exports_external.object({
52399
52417
  message: exports_external.string().nullable().optional(),
52400
52418
  remaining: exports_external.number().nullable().optional()
52401
- }).optional()
52419
+ }).optional(),
52420
+ installation: InstallationMetadataSchema.optional()
52402
52421
  });
52403
52422
  DEFAULT_SETTINGS = SettingsSchema.parse({});
52404
52423
  });
@@ -56136,7 +56155,7 @@ function getTerminalWidth() {
56136
56155
  function canDetectTerminalWidth() {
56137
56156
  return probeTerminalWidth() !== null;
56138
56157
  }
56139
- var __dirname = "/Users/sirmalloc/Projects/Personal/ccstatusline/src/utils", PACKAGE_VERSION = "2.2.13";
56158
+ var __dirname = "/Users/sirmalloc/Projects/Personal/ccstatusline/src/utils", PACKAGE_VERSION = "2.2.15";
56140
56159
  var init_terminal = () => {};
56141
56160
 
56142
56161
  // src/utils/renderer.ts
@@ -58896,19 +58915,21 @@ var require_supports_color = __commonJS((exports, module) => {
58896
58915
  var tty2 = __require("tty");
58897
58916
  var hasFlag2 = require_has_flag();
58898
58917
  var { env: env3 } = process;
58899
- var forceColor;
58918
+ var flagForceColor2;
58900
58919
  if (hasFlag2("no-color") || hasFlag2("no-colors") || hasFlag2("color=false") || hasFlag2("color=never")) {
58901
- forceColor = 0;
58920
+ flagForceColor2 = 0;
58902
58921
  } else if (hasFlag2("color") || hasFlag2("colors") || hasFlag2("color=true") || hasFlag2("color=always")) {
58903
- forceColor = 1;
58922
+ flagForceColor2 = 1;
58904
58923
  }
58905
- if ("FORCE_COLOR" in env3) {
58906
- if (env3.FORCE_COLOR === "true") {
58907
- forceColor = 1;
58908
- } else if (env3.FORCE_COLOR === "false") {
58909
- forceColor = 0;
58910
- } else {
58911
- forceColor = env3.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env3.FORCE_COLOR, 10), 3);
58924
+ function envForceColor2() {
58925
+ if ("FORCE_COLOR" in env3) {
58926
+ if (env3.FORCE_COLOR === "true") {
58927
+ return 1;
58928
+ }
58929
+ if (env3.FORCE_COLOR === "false") {
58930
+ return 0;
58931
+ }
58932
+ return env3.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env3.FORCE_COLOR, 10), 3);
58912
58933
  }
58913
58934
  }
58914
58935
  function translateLevel2(level) {
@@ -58922,15 +58943,22 @@ var require_supports_color = __commonJS((exports, module) => {
58922
58943
  has16m: level >= 3
58923
58944
  };
58924
58945
  }
58925
- function supportsColor2(haveStream, streamIsTTY) {
58946
+ function supportsColor2(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
58947
+ const noFlagForceColor = envForceColor2();
58948
+ if (noFlagForceColor !== undefined) {
58949
+ flagForceColor2 = noFlagForceColor;
58950
+ }
58951
+ const forceColor = sniffFlags ? flagForceColor2 : noFlagForceColor;
58926
58952
  if (forceColor === 0) {
58927
58953
  return 0;
58928
58954
  }
58929
- if (hasFlag2("color=16m") || hasFlag2("color=full") || hasFlag2("color=truecolor")) {
58930
- return 3;
58931
- }
58932
- if (hasFlag2("color=256")) {
58933
- return 2;
58955
+ if (sniffFlags) {
58956
+ if (hasFlag2("color=16m") || hasFlag2("color=full") || hasFlag2("color=truecolor")) {
58957
+ return 3;
58958
+ }
58959
+ if (hasFlag2("color=256")) {
58960
+ return 2;
58961
+ }
58934
58962
  }
58935
58963
  if (haveStream && !streamIsTTY && forceColor === undefined) {
58936
58964
  return 0;
@@ -58947,7 +58975,7 @@ var require_supports_color = __commonJS((exports, module) => {
58947
58975
  return 1;
58948
58976
  }
58949
58977
  if ("CI" in env3) {
58950
- if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => (sign in env3)) || env3.CI_NAME === "codeship") {
58978
+ if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE", "DRONE"].some((sign) => (sign in env3)) || env3.CI_NAME === "codeship") {
58951
58979
  return 1;
58952
58980
  }
58953
58981
  return min2;
@@ -58959,7 +58987,7 @@ var require_supports_color = __commonJS((exports, module) => {
58959
58987
  return 3;
58960
58988
  }
58961
58989
  if ("TERM_PROGRAM" in env3) {
58962
- const version2 = parseInt((env3.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
58990
+ const version2 = Number.parseInt((env3.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
58963
58991
  switch (env3.TERM_PROGRAM) {
58964
58992
  case "iTerm.app":
58965
58993
  return version2 >= 3 ? 3 : 2;
@@ -58978,14 +59006,17 @@ var require_supports_color = __commonJS((exports, module) => {
58978
59006
  }
58979
59007
  return min2;
58980
59008
  }
58981
- function getSupportLevel(stream) {
58982
- const level = supportsColor2(stream, stream && stream.isTTY);
59009
+ function getSupportLevel(stream, options = {}) {
59010
+ const level = supportsColor2(stream, {
59011
+ streamIsTTY: stream && stream.isTTY,
59012
+ ...options
59013
+ });
58983
59014
  return translateLevel2(level);
58984
59015
  }
58985
59016
  module.exports = {
58986
59017
  supportsColor: getSupportLevel,
58987
- stdout: translateLevel2(supportsColor2(true, tty2.isatty(1))),
58988
- stderr: translateLevel2(supportsColor2(true, tty2.isatty(2)))
59018
+ stdout: getSupportLevel({ isTTY: tty2.isatty(1) }),
59019
+ stderr: getSupportLevel({ isTTY: tty2.isatty(2) })
58989
59020
  };
58990
59021
  });
58991
59022
 
@@ -67592,6 +67623,23 @@ async function saveSettings(settings) {
67592
67623
  await syncWidgetHooks2(settings);
67593
67624
  } catch {}
67594
67625
  }
67626
+ async function saveInstallationMetadata(metadata) {
67627
+ const paths = getSettingsPaths();
67628
+ if (!metadata && !fs10.existsSync(paths.settingsPath)) {
67629
+ return;
67630
+ }
67631
+ const settings = await loadSettings();
67632
+ const settingsWithVersion = {
67633
+ ...settings,
67634
+ version: CURRENT_VERSION
67635
+ };
67636
+ if (metadata) {
67637
+ settingsWithVersion.installation = metadata;
67638
+ } else {
67639
+ delete settingsWithVersion.installation;
67640
+ }
67641
+ await writeSettingsJson(settingsWithVersion, paths);
67642
+ }
67595
67643
  var readFile3, writeFile, mkdir, DEFAULT_SETTINGS_PATH, settingsPath;
67596
67644
  var init_config = __esm(async () => {
67597
67645
  init_Settings();
@@ -67610,7 +67658,7 @@ import * as fs11 from "fs";
67610
67658
  import * as os9 from "os";
67611
67659
  import * as path8 from "path";
67612
67660
  function isKnownCommand(command) {
67613
- const prefixes = [CCSTATUSLINE_COMMANDS.NPM, CCSTATUSLINE_COMMANDS.BUNX, CCSTATUSLINE_COMMANDS.SELF_MANAGED];
67661
+ const prefixes = [CCSTATUSLINE_COMMANDS.AUTO_NPX, CCSTATUSLINE_COMMANDS.AUTO_BUNX, CCSTATUSLINE_COMMANDS.GLOBAL];
67614
67662
  return prefixes.some((prefix) => command === prefix || command.startsWith(`${prefix} --config `)) || /(?:^|[\s"'\\/])ccstatusline\.ts(?=$|[\s"'])/.test(command);
67615
67663
  }
67616
67664
  function needsQuoting(filePath) {
@@ -67719,15 +67767,35 @@ async function isInstalled() {
67719
67767
  const command = settings.statusLine?.command ?? "";
67720
67768
  return isKnownCommand(command) && (settings.statusLine?.padding === 0 || settings.statusLine?.padding === undefined);
67721
67769
  }
67722
- function isBunxAvailable() {
67770
+ function isExecutableAvailable(executable) {
67723
67771
  try {
67724
- const command = process.platform === "win32" ? "where bunx" : "which bunx";
67772
+ const command = process.platform === "win32" ? `where ${executable}` : `which ${executable}`;
67725
67773
  execSync4(command, { stdio: "ignore" });
67726
67774
  return true;
67727
67775
  } catch {
67728
67776
  return false;
67729
67777
  }
67730
67778
  }
67779
+ function isNpmAvailable() {
67780
+ return isExecutableAvailable("npm");
67781
+ }
67782
+ function isNpxAvailable() {
67783
+ return isExecutableAvailable("npx");
67784
+ }
67785
+ function isBunAvailable() {
67786
+ return isExecutableAvailable("bun");
67787
+ }
67788
+ function isBunxAvailable() {
67789
+ return isExecutableAvailable("bunx");
67790
+ }
67791
+ function getPackageCommandAvailability() {
67792
+ return {
67793
+ npm: isNpmAvailable(),
67794
+ npx: isNpxAvailable(),
67795
+ bun: isBunAvailable(),
67796
+ bunx: isBunxAvailable()
67797
+ };
67798
+ }
67731
67799
  function getClaudeCodeVersion() {
67732
67800
  try {
67733
67801
  const output = execSync4("claude --version", { encoding: "utf-8", stdio: ["pipe", "pipe", "ignore"], timeout: 5000 }).trim();
@@ -67762,6 +67830,59 @@ function buildCommand(baseCommand) {
67762
67830
  }
67763
67831
  return baseCommand;
67764
67832
  }
67833
+ function getBaseCommandForMode(commandMode) {
67834
+ switch (commandMode) {
67835
+ case "auto-npx":
67836
+ return CCSTATUSLINE_COMMANDS.AUTO_NPX;
67837
+ case "auto-bunx":
67838
+ return CCSTATUSLINE_COMMANDS.AUTO_BUNX;
67839
+ case "global":
67840
+ return CCSTATUSLINE_COMMANDS.GLOBAL;
67841
+ }
67842
+ }
67843
+ function buildStatusLineCommand(commandMode) {
67844
+ return buildCommand(getBaseCommandForMode(commandMode));
67845
+ }
67846
+ function matchesCommandBase(command, baseCommand) {
67847
+ return command === baseCommand || command.startsWith(`${baseCommand} --config `);
67848
+ }
67849
+ function isLocalDevelopmentCommand(command) {
67850
+ return /(?:^|[\s"'\\/])ccstatusline\.ts(?=$|[\s"'])/.test(command);
67851
+ }
67852
+ function classifyInstallation(command, metadata) {
67853
+ const statusLineCommand = command ?? "";
67854
+ if (matchesCommandBase(statusLineCommand, CCSTATUSLINE_COMMANDS.AUTO_NPX)) {
67855
+ return {
67856
+ method: "auto-update",
67857
+ packageManager: "npm"
67858
+ };
67859
+ }
67860
+ if (matchesCommandBase(statusLineCommand, CCSTATUSLINE_COMMANDS.AUTO_BUNX)) {
67861
+ return {
67862
+ method: "auto-update",
67863
+ packageManager: "bun"
67864
+ };
67865
+ }
67866
+ if (matchesCommandBase(statusLineCommand, CCSTATUSLINE_COMMANDS.GLOBAL)) {
67867
+ if (metadata?.method === "pinned") {
67868
+ return metadata;
67869
+ }
67870
+ return {
67871
+ method: "self-managed",
67872
+ packageManager: "unknown"
67873
+ };
67874
+ }
67875
+ if (isLocalDevelopmentCommand(statusLineCommand)) {
67876
+ return {
67877
+ method: "self-managed",
67878
+ packageManager: "unknown"
67879
+ };
67880
+ }
67881
+ return {
67882
+ method: "unknown",
67883
+ packageManager: "unknown"
67884
+ };
67885
+ }
67765
67886
  async function loadSavedSettingsForHookSync() {
67766
67887
  const configPath = getConfigPath();
67767
67888
  if (!fs11.existsSync(configPath)) {
@@ -67779,7 +67900,11 @@ async function loadSavedSettingsForHookSync() {
67779
67900
  return null;
67780
67901
  }
67781
67902
  }
67782
- async function installStatusLine(useBunx = false, supportsRefreshInterval = false) {
67903
+ async function installStatusLine({
67904
+ commandMode,
67905
+ supportsRefreshInterval = false,
67906
+ installationMetadata
67907
+ }) {
67783
67908
  let settings;
67784
67909
  const backupPath = await backupClaudeSettings(".orig");
67785
67910
  try {
@@ -67789,17 +67914,19 @@ async function installStatusLine(useBunx = false, supportsRefreshInterval = fals
67789
67914
  console.error(`Warning: Could not read existing Claude settings. A backup exists at ${backupPath ?? fallbackBackupPath}.`);
67790
67915
  settings = {};
67791
67916
  }
67792
- const baseCommand = useBunx ? CCSTATUSLINE_COMMANDS.BUNX : CCSTATUSLINE_COMMANDS.NPM;
67793
67917
  const existingRefreshInterval = settings.statusLine?.refreshInterval;
67794
67918
  settings.statusLine = {
67795
67919
  type: "command",
67796
- command: buildCommand(baseCommand),
67920
+ command: buildStatusLineCommand(commandMode),
67797
67921
  padding: 0
67798
67922
  };
67799
67923
  if (supportsRefreshInterval) {
67800
67924
  settings.statusLine.refreshInterval = existingRefreshInterval ?? 10;
67801
67925
  }
67802
67926
  await saveClaudeSettings(settings);
67927
+ if (installationMetadata !== undefined) {
67928
+ await saveInstallationMetadata(installationMetadata);
67929
+ }
67803
67930
  const savedSettings = await loadSavedSettingsForHookSync();
67804
67931
  if (savedSettings) {
67805
67932
  const { syncWidgetHooks: syncWidgetHooks2 } = await init_hooks().then(() => exports_hooks);
@@ -67818,6 +67945,7 @@ async function uninstallStatusLine() {
67818
67945
  delete settings.statusLine;
67819
67946
  await saveClaudeSettings(settings);
67820
67947
  }
67948
+ await saveInstallationMetadata(undefined);
67821
67949
  try {
67822
67950
  const { removeManagedHooks: removeManagedHooks2 } = await init_hooks().then(() => exports_hooks);
67823
67951
  await removeManagedHooks2();
@@ -67900,7 +68028,7 @@ function getVoiceConfig(cwd2 = process.cwd()) {
67900
68028
  }
67901
68029
  return anyFileExisted ? { enabled: false } : null;
67902
68030
  }
67903
- var readFile4, writeFile2, mkdir2, CCSTATUSLINE_COMMANDS, VoiceConfigSchema;
68031
+ var readFile4, writeFile2, mkdir2, CCSTATUSLINE_COMMANDS, PINNED_INSTALL_COMMANDS, VoiceConfigSchema;
67904
68032
  var init_claude_settings = __esm(async () => {
67905
68033
  init_zod();
67906
68034
  init_Settings();
@@ -67909,10 +68037,17 @@ var init_claude_settings = __esm(async () => {
67909
68037
  writeFile2 = fs11.promises.writeFile;
67910
68038
  mkdir2 = fs11.promises.mkdir;
67911
68039
  CCSTATUSLINE_COMMANDS = {
68040
+ AUTO_NPX: "npx -y ccstatusline@latest",
68041
+ AUTO_BUNX: "bunx -y ccstatusline@latest",
68042
+ GLOBAL: "ccstatusline",
67912
68043
  NPM: "npx -y ccstatusline@latest",
67913
68044
  BUNX: "bunx -y ccstatusline@latest",
67914
68045
  SELF_MANAGED: "ccstatusline"
67915
68046
  };
68047
+ PINNED_INSTALL_COMMANDS = {
68048
+ NPM: (version2) => `npm install -g ccstatusline@${version2}`,
68049
+ BUN: (version2) => `bun add -g ccstatusline@${version2}`
68050
+ };
67916
68051
  VoiceConfigSchema = exports_external.object({ enabled: exports_external.boolean().optional() });
67917
68052
  });
67918
68053
 
@@ -68486,7 +68621,7 @@ var dist_default5 = Gradient;
68486
68621
 
68487
68622
  // src/tui/App.tsx
68488
68623
  await init_claude_settings();
68489
- var import_react50 = __toESM(require_react(), 1);
68624
+ var import_react51 = __toESM(require_react(), 1);
68490
68625
 
68491
68626
  // src/utils/clone-settings.ts
68492
68627
  function cloneSettings(settings) {
@@ -68500,6 +68635,371 @@ function cloneSettings(settings) {
68500
68635
  // src/tui/App.tsx
68501
68636
  await init_config();
68502
68637
 
68638
+ // src/utils/global-command-resolution.ts
68639
+ import { execFileSync as execFileSync5 } from "child_process";
68640
+ import * as path9 from "path";
68641
+
68642
+ // src/utils/package-manager-executable.ts
68643
+ function getPackageManagerExecutable(packageManager, platform2 = process.platform) {
68644
+ return packageManager === "npm" && platform2 === "win32" ? "npm.cmd" : packageManager;
68645
+ }
68646
+
68647
+ // src/utils/global-command-resolution.ts
68648
+ var COMMAND_LOOKUP_TIMEOUT_MS = 5000;
68649
+ function splitCommandOutput(output) {
68650
+ const seen = new Set;
68651
+ const paths = [];
68652
+ for (const line of output.split(/\r?\n/)) {
68653
+ const candidate = line.trim();
68654
+ if (!candidate || seen.has(candidate)) {
68655
+ continue;
68656
+ }
68657
+ seen.add(candidate);
68658
+ paths.push(candidate);
68659
+ }
68660
+ return paths;
68661
+ }
68662
+ function isTransientBunxStatusLinePath(filePath) {
68663
+ const normalized = filePath.replace(/\\/g, "/");
68664
+ return /(?:^|\/)bunx-[^/]*ccstatusline@[^/]+\/node_modules\/\.bin\/ccstatusline(?:\.(?:cmd|ps1))?$/i.test(normalized);
68665
+ }
68666
+ function getPersistentCommandResolutionPaths(paths) {
68667
+ return paths.filter((path10) => !isTransientBunxStatusLinePath(path10));
68668
+ }
68669
+ function getCommandResolutionPaths(command, { platform: platform2 = process.platform } = {}) {
68670
+ try {
68671
+ const output = platform2 === "win32" ? execFileSync5("where", [command], { encoding: "utf-8", timeout: COMMAND_LOOKUP_TIMEOUT_MS }) : execFileSync5("which", ["-a", command], { encoding: "utf-8", timeout: COMMAND_LOOKUP_TIMEOUT_MS });
68672
+ return splitCommandOutput(output);
68673
+ } catch {
68674
+ return [];
68675
+ }
68676
+ }
68677
+ function getNpmGlobalBinDir(platform2) {
68678
+ try {
68679
+ const prefix = execFileSync5(getPackageManagerExecutable("npm", platform2), ["prefix", "-g"], {
68680
+ encoding: "utf-8",
68681
+ timeout: COMMAND_LOOKUP_TIMEOUT_MS
68682
+ }).trim();
68683
+ if (!prefix) {
68684
+ return null;
68685
+ }
68686
+ return platform2 === "win32" || /^[a-z]:[\\/]/i.test(prefix) ? prefix : path9.join(prefix, "bin");
68687
+ } catch {
68688
+ return null;
68689
+ }
68690
+ }
68691
+ function getBunGlobalBinDir() {
68692
+ try {
68693
+ const binDir = execFileSync5("bun", ["pm", "bin", "-g"], {
68694
+ encoding: "utf-8",
68695
+ timeout: COMMAND_LOOKUP_TIMEOUT_MS
68696
+ }).trim();
68697
+ return binDir || null;
68698
+ } catch {
68699
+ return null;
68700
+ }
68701
+ }
68702
+ function getExpectedGlobalBinDir(packageManager, { platform: platform2 = process.platform } = {}) {
68703
+ return packageManager === "npm" ? getNpmGlobalBinDir(platform2) : getBunGlobalBinDir();
68704
+ }
68705
+ function trimTrailingSlashes(value) {
68706
+ if (/^[a-z]:\/$/i.test(value) || value === "/") {
68707
+ return value;
68708
+ }
68709
+ return value.replace(/\/+$/, "");
68710
+ }
68711
+ function normalizePathForComparison(filePath) {
68712
+ const normalized = trimTrailingSlashes(filePath.trim().replace(/\\/g, "/"));
68713
+ return /^[a-z]:\//i.test(normalized) || normalized.startsWith("/mnt/") ? normalized.toLowerCase() : normalized;
68714
+ }
68715
+ function getPathComparisonVariants(filePath) {
68716
+ const normalized = normalizePathForComparison(filePath);
68717
+ const variants = new Set([normalized]);
68718
+ const driveMatch = /^([a-z]):\/(.*)$/i.exec(normalized);
68719
+ if (driveMatch) {
68720
+ variants.add(`/mnt/${driveMatch[1]?.toLowerCase()}/${driveMatch[2] ?? ""}`);
68721
+ }
68722
+ const wslMountMatch = /^\/mnt\/([a-z])\/(.*)$/i.exec(normalized);
68723
+ if (wslMountMatch) {
68724
+ variants.add(`${wslMountMatch[1]?.toLowerCase()}:/${wslMountMatch[2] ?? ""}`);
68725
+ }
68726
+ return Array.from(variants);
68727
+ }
68728
+ function getDirectoryName(filePath) {
68729
+ const normalized = filePath.replace(/\\/g, "/");
68730
+ const lastSlashIndex = normalized.lastIndexOf("/");
68731
+ return lastSlashIndex === -1 ? "" : normalized.slice(0, lastSlashIndex);
68732
+ }
68733
+ function getUniqueResolvedDirs(resolvedPaths) {
68734
+ const seen = new Set;
68735
+ const dirs = [];
68736
+ for (const resolvedPath of resolvedPaths) {
68737
+ const dir = getDirectoryName(resolvedPath);
68738
+ const comparableDir = normalizePathForComparison(dir);
68739
+ if (seen.has(comparableDir)) {
68740
+ continue;
68741
+ }
68742
+ seen.add(comparableDir);
68743
+ dirs.push(dir);
68744
+ }
68745
+ return dirs;
68746
+ }
68747
+ function isPathInsideDir(filePath, dir) {
68748
+ const pathVariants = getPathComparisonVariants(filePath);
68749
+ const dirVariants = getPathComparisonVariants(dir);
68750
+ return pathVariants.some((pathVariant) => dirVariants.some((dirVariant) => {
68751
+ const withSlash = dirVariant.endsWith("/") ? dirVariant : `${dirVariant}/`;
68752
+ return pathVariant === dirVariant || pathVariant.startsWith(withSlash);
68753
+ }));
68754
+ }
68755
+ function formatPathList(paths) {
68756
+ return paths.join(", ");
68757
+ }
68758
+ function getResolutionWarning(packageManager, resolvedPaths, expectedBinDir) {
68759
+ const firstResolvedPath = resolvedPaths[0] ?? null;
68760
+ if (!firstResolvedPath) {
68761
+ return "⚠ ccstatusline is not currently resolvable on PATH. Claude Code runs ccstatusline, so restart your shell or update PATH if it cannot launch.";
68762
+ }
68763
+ const resolvedDirs = getUniqueResolvedDirs(resolvedPaths);
68764
+ if (resolvedDirs.length > 1) {
68765
+ return `⚠ Multiple ccstatusline binaries are on PATH. Claude Code will run the first match: ${firstResolvedPath}.
68766
+ Other matches: ${formatPathList(resolvedPaths.slice(1))}`;
68767
+ }
68768
+ if (expectedBinDir && !isPathInsideDir(firstResolvedPath, expectedBinDir)) {
68769
+ return `⚠ ccstatusline resolves to ${firstResolvedPath}, which is outside the ${packageManager} global bin directory (${expectedBinDir}). Claude Code will run the first PATH match.`;
68770
+ }
68771
+ return null;
68772
+ }
68773
+ function inspectGlobalCommandResolution(packageManager, options = {}) {
68774
+ const resolvedPaths = getPersistentCommandResolutionPaths(getCommandResolutionPaths("ccstatusline", options));
68775
+ const expectedBinDir = getExpectedGlobalBinDir(packageManager, options);
68776
+ return {
68777
+ resolvedPaths,
68778
+ firstResolvedPath: resolvedPaths[0] ?? null,
68779
+ expectedBinDir,
68780
+ warning: getResolutionWarning(packageManager, resolvedPaths, expectedBinDir)
68781
+ };
68782
+ }
68783
+
68784
+ // src/utils/global-package-manager.ts
68785
+ import {
68786
+ execFile,
68787
+ execFileSync as execFileSync6
68788
+ } from "child_process";
68789
+ import * as fs12 from "fs";
68790
+ var GLOBAL_PACKAGE_TIMEOUT_MS = 120000;
68791
+ var VERSION_LOOKUP_TIMEOUT_MS = 5000;
68792
+ var WINDOWS_SHIM_EXTENSIONS = [
68793
+ "",
68794
+ ".cmd",
68795
+ ".ps1"
68796
+ ];
68797
+ function isWindowsStylePath(filePath) {
68798
+ return /^[a-z]:[\\/]/i.test(filePath);
68799
+ }
68800
+ function trimTrailingSeparators(filePath) {
68801
+ return filePath.replace(/[\\/]+$/, "");
68802
+ }
68803
+ function appendPathSegment(dir, segment) {
68804
+ const separator = dir.includes("\\") && !dir.includes("/") ? "\\" : "/";
68805
+ return `${trimTrailingSeparators(dir)}${separator}${segment}`;
68806
+ }
68807
+ function toWindowsPath(filePath) {
68808
+ const match = /^\/mnt\/([a-z])\/(.*)$/i.exec(filePath.replace(/\\/g, "/"));
68809
+ if (!match) {
68810
+ return null;
68811
+ }
68812
+ return `${match[1]?.toUpperCase()}:\\${(match[2] ?? "").replace(/\//g, "\\")}`;
68813
+ }
68814
+ function toWslPath(filePath) {
68815
+ const match = /^([a-z]):[\\/](.*)$/i.exec(filePath);
68816
+ if (!match) {
68817
+ return null;
68818
+ }
68819
+ return `/mnt/${match[1]?.toLowerCase()}/${(match[2] ?? "").replace(/\\/g, "/")}`;
68820
+ }
68821
+ function getFilesystemPathVariants(filePath) {
68822
+ const variants = new Set([filePath]);
68823
+ const windowsPath = toWindowsPath(filePath);
68824
+ const wslPath = toWslPath(filePath);
68825
+ if (windowsPath) {
68826
+ variants.add(windowsPath);
68827
+ }
68828
+ if (wslPath) {
68829
+ variants.add(wslPath);
68830
+ }
68831
+ return Array.from(variants);
68832
+ }
68833
+ function getBinaryPathCandidates(binDir, platform2) {
68834
+ const extensions = platform2 === "win32" || isWindowsStylePath(binDir) ? WINDOWS_SHIM_EXTENSIONS : [""];
68835
+ return extensions.map((extension) => appendPathSegment(binDir, `ccstatusline${extension}`));
68836
+ }
68837
+ function hasBinaryOnDisk(binDir, platform2) {
68838
+ return getBinaryPathCandidates(binDir, platform2).some((candidate) => getFilesystemPathVariants(candidate).some((variant) => fs12.existsSync(variant)));
68839
+ }
68840
+ function hasResolvedBinaryInDir(resolvedPaths, binDir) {
68841
+ return resolvedPaths.some((resolvedPath) => isPathInsideDir(resolvedPath, binDir));
68842
+ }
68843
+ function getDirectoryName2(filePath) {
68844
+ const normalized = filePath.replace(/\\/g, "/");
68845
+ const lastSlashIndex = normalized.lastIndexOf("/");
68846
+ return lastSlashIndex === -1 ? "" : normalized.slice(0, lastSlashIndex);
68847
+ }
68848
+ function getComparablePath(filePath) {
68849
+ return filePath.replace(/\\/g, "/").toLowerCase().replace(/\/+$/, "");
68850
+ }
68851
+ function getUniqueResolvedDirs2(resolvedPaths) {
68852
+ const seen = new Set;
68853
+ const dirs = [];
68854
+ for (const resolvedPath of resolvedPaths) {
68855
+ const dir = getDirectoryName2(resolvedPath);
68856
+ const comparableDir = getComparablePath(dir);
68857
+ if (seen.has(comparableDir)) {
68858
+ continue;
68859
+ }
68860
+ seen.add(comparableDir);
68861
+ dirs.push(dir);
68862
+ }
68863
+ return dirs;
68864
+ }
68865
+ function formatPathList2(paths) {
68866
+ return paths.join(", ");
68867
+ }
68868
+ function readPackageVersion(packageJsonPath) {
68869
+ for (const variant of getFilesystemPathVariants(packageJsonPath)) {
68870
+ try {
68871
+ if (!fs12.existsSync(variant)) {
68872
+ continue;
68873
+ }
68874
+ const packageJson = JSON.parse(fs12.readFileSync(variant, "utf-8"));
68875
+ return typeof packageJson.version === "string" ? packageJson.version : null;
68876
+ } catch {
68877
+ return null;
68878
+ }
68879
+ }
68880
+ return null;
68881
+ }
68882
+ function getNpmGlobalPackageVersion(platform2) {
68883
+ try {
68884
+ const rootDir = execFileSync6(getPackageManagerExecutable("npm", platform2), ["root", "-g"], {
68885
+ encoding: "utf-8",
68886
+ timeout: VERSION_LOOKUP_TIMEOUT_MS
68887
+ }).trim();
68888
+ return rootDir ? readPackageVersion(appendPathSegment(appendPathSegment(rootDir, "ccstatusline"), "package.json")) : null;
68889
+ } catch {
68890
+ return null;
68891
+ }
68892
+ }
68893
+ function getBunInstallRoot(binDir) {
68894
+ const normalized = trimTrailingSeparators(binDir.replace(/\\/g, "/"));
68895
+ const lower = normalized.toLowerCase();
68896
+ return lower.endsWith("/bin") ? normalized.slice(0, -4) : normalized;
68897
+ }
68898
+ function getBunGlobalPackageVersion(binDir) {
68899
+ if (!binDir) {
68900
+ return null;
68901
+ }
68902
+ return readPackageVersion(appendPathSegment(appendPathSegment(appendPathSegment(appendPathSegment(appendPathSegment(getBunInstallRoot(binDir), "install"), "global"), "node_modules"), "ccstatusline"), "package.json"));
68903
+ }
68904
+ function getGlobalPackageVersion(packageManager, binDir, platform2) {
68905
+ if (packageManager === "npm") {
68906
+ return getNpmGlobalPackageVersion(platform2);
68907
+ }
68908
+ if (packageManager === "bun") {
68909
+ return getBunGlobalPackageVersion(binDir);
68910
+ }
68911
+ return null;
68912
+ }
68913
+ function inspectPackageManager(packageManager, available, resolvedPaths, platform2) {
68914
+ const binDir = available ? getExpectedGlobalBinDir(packageManager, { platform: platform2 }) : null;
68915
+ return {
68916
+ packageManager,
68917
+ available,
68918
+ installed: !!binDir && (hasBinaryOnDisk(binDir, platform2) || hasResolvedBinaryInDir(resolvedPaths, binDir)),
68919
+ binDir
68920
+ };
68921
+ }
68922
+ function getManagerBinDir(packageManager, available, platform2) {
68923
+ return available ? getExpectedGlobalBinDir(packageManager, { platform: platform2 }) : null;
68924
+ }
68925
+ function getActivePackageManager(resolvedPath, managerBins) {
68926
+ if (managerBins.bun && isPathInsideDir(resolvedPath, managerBins.bun)) {
68927
+ return {
68928
+ packageManager: "bun",
68929
+ binDir: managerBins.bun
68930
+ };
68931
+ }
68932
+ if (managerBins.npm && isPathInsideDir(resolvedPath, managerBins.npm)) {
68933
+ return {
68934
+ packageManager: "npm",
68935
+ binDir: managerBins.npm
68936
+ };
68937
+ }
68938
+ return {
68939
+ packageManager: "unknown",
68940
+ binDir: null
68941
+ };
68942
+ }
68943
+ function getActiveResolutionWarning(resolvedPaths, active) {
68944
+ if (!active.resolvedPath) {
68945
+ return "⚠ ccstatusline is not currently resolvable on PATH. Claude Code runs ccstatusline, so restart your shell or update PATH if it cannot launch.";
68946
+ }
68947
+ const resolvedDirs = getUniqueResolvedDirs2(resolvedPaths);
68948
+ if (resolvedDirs.length > 1) {
68949
+ return `⚠ Multiple ccstatusline binaries are on PATH. Claude Code will run the first match: ${active.resolvedPath}.
68950
+ Other matches: ${formatPathList2(resolvedPaths.slice(1))}`;
68951
+ }
68952
+ if (active.packageManager === "unknown") {
68953
+ return `⚠ ccstatusline resolves to ${active.resolvedPath}, but it is outside the detected npm and bun global bin directories.`;
68954
+ }
68955
+ return null;
68956
+ }
68957
+ function inspectActiveGlobalCommand({
68958
+ commandAvailability,
68959
+ platform: platform2 = process.platform
68960
+ }) {
68961
+ const resolvedPaths = getPersistentCommandResolutionPaths(getCommandResolutionPaths("ccstatusline", { platform: platform2 }));
68962
+ const resolvedPath = resolvedPaths[0] ?? null;
68963
+ const managerBins = {
68964
+ npm: getManagerBinDir("npm", commandAvailability.npm, platform2),
68965
+ bun: getManagerBinDir("bun", commandAvailability.bun, platform2)
68966
+ };
68967
+ const active = resolvedPath ? getActivePackageManager(resolvedPath, managerBins) : { packageManager: "unknown", binDir: null };
68968
+ return {
68969
+ ...active,
68970
+ resolvedPath,
68971
+ resolvedPaths,
68972
+ version: resolvedPath ? getGlobalPackageVersion(active.packageManager, active.binDir, platform2) : null,
68973
+ warning: getActiveResolutionWarning(resolvedPaths, {
68974
+ packageManager: active.packageManager,
68975
+ resolvedPath
68976
+ })
68977
+ };
68978
+ }
68979
+ function inspectGlobalPackageInstallations({
68980
+ commandAvailability,
68981
+ platform: platform2 = process.platform
68982
+ }) {
68983
+ const resolvedPaths = getPersistentCommandResolutionPaths(getCommandResolutionPaths("ccstatusline", { platform: platform2 }));
68984
+ return [
68985
+ inspectPackageManager("npm", commandAvailability.npm, resolvedPaths, platform2),
68986
+ inspectPackageManager("bun", commandAvailability.bun, resolvedPaths, platform2)
68987
+ ];
68988
+ }
68989
+ function runGlobalPackageUninstall(packageManager, { platform: platform2 = process.platform } = {}) {
68990
+ const executable = getPackageManagerExecutable(packageManager, platform2);
68991
+ const args = packageManager === "npm" ? ["uninstall", "-g", "ccstatusline"] : ["remove", "-g", "ccstatusline"];
68992
+ return new Promise((resolve5, reject2) => {
68993
+ execFile(executable, args, { timeout: GLOBAL_PACKAGE_TIMEOUT_MS }, (error48) => {
68994
+ if (error48) {
68995
+ reject2(error48 instanceof Error ? error48 : new Error("Global uninstall command failed"));
68996
+ return;
68997
+ }
68998
+ resolve5();
68999
+ });
69000
+ });
69001
+ }
69002
+
68503
69003
  // src/utils/open-url.ts
68504
69004
  import { spawnSync } from "child_process";
68505
69005
  import * as os10 from "os";
@@ -68589,9 +69089,9 @@ function openExternalUrl(url2) {
68589
69089
 
68590
69090
  // src/utils/powerline.ts
68591
69091
  import { execSync as execSync5 } from "child_process";
68592
- import * as fs12 from "fs";
69092
+ import * as fs13 from "fs";
68593
69093
  import * as os11 from "os";
68594
- import * as path9 from "path";
69094
+ import * as path10 from "path";
68595
69095
  var fontsInstalledThisSession = false;
68596
69096
  function checkPowerlineFonts() {
68597
69097
  if (process.env.DEBUG_FONT_INSTALL === "1" && !fontsInstalledThisSession) {
@@ -68611,20 +69111,20 @@ function checkPowerlineFonts() {
68611
69111
  let fontPaths = [];
68612
69112
  if (platform4 === "darwin") {
68613
69113
  fontPaths = [
68614
- path9.join(os11.homedir(), "Library", "Fonts"),
69114
+ path10.join(os11.homedir(), "Library", "Fonts"),
68615
69115
  "/Library/Fonts",
68616
69116
  "/System/Library/Fonts"
68617
69117
  ];
68618
69118
  } else if (platform4 === "linux") {
68619
69119
  fontPaths = [
68620
- path9.join(os11.homedir(), ".local", "share", "fonts"),
68621
- path9.join(os11.homedir(), ".fonts"),
69120
+ path10.join(os11.homedir(), ".local", "share", "fonts"),
69121
+ path10.join(os11.homedir(), ".fonts"),
68622
69122
  "/usr/share/fonts",
68623
69123
  "/usr/local/share/fonts"
68624
69124
  ];
68625
69125
  } else if (platform4 === "win32") {
68626
69126
  fontPaths = [
68627
- path9.join(os11.homedir(), "AppData", "Local", "Microsoft", "Windows", "Fonts"),
69127
+ path10.join(os11.homedir(), "AppData", "Local", "Microsoft", "Windows", "Fonts"),
68628
69128
  "C:\\Windows\\Fonts"
68629
69129
  ];
68630
69130
  }
@@ -68640,9 +69140,9 @@ function checkPowerlineFonts() {
68640
69140
  /fira.*code.*nerd/i
68641
69141
  ];
68642
69142
  for (const fontPath of fontPaths) {
68643
- if (fs12.existsSync(fontPath)) {
69143
+ if (fs13.existsSync(fontPath)) {
68644
69144
  try {
68645
- const files = fs12.readdirSync(fontPath);
69145
+ const files = fs13.readdirSync(fontPath);
68646
69146
  for (const file2 of files) {
68647
69147
  for (const pattern of powerlineFontPatterns) {
68648
69148
  if (pattern.test(file2)) {
@@ -68703,33 +69203,33 @@ async function installPowerlineFonts() {
68703
69203
  const platform4 = os11.platform();
68704
69204
  let fontDir;
68705
69205
  if (platform4 === "darwin") {
68706
- fontDir = path9.join(os11.homedir(), "Library", "Fonts");
69206
+ fontDir = path10.join(os11.homedir(), "Library", "Fonts");
68707
69207
  } else if (platform4 === "linux") {
68708
- fontDir = path9.join(os11.homedir(), ".local", "share", "fonts");
69208
+ fontDir = path10.join(os11.homedir(), ".local", "share", "fonts");
68709
69209
  } else if (platform4 === "win32") {
68710
- fontDir = path9.join(os11.homedir(), "AppData", "Local", "Microsoft", "Windows", "Fonts");
69210
+ fontDir = path10.join(os11.homedir(), "AppData", "Local", "Microsoft", "Windows", "Fonts");
68711
69211
  } else {
68712
69212
  return {
68713
69213
  success: false,
68714
69214
  message: "Unsupported platform for font installation"
68715
69215
  };
68716
69216
  }
68717
- if (!fs12.existsSync(fontDir)) {
68718
- fs12.mkdirSync(fontDir, { recursive: true });
69217
+ if (!fs13.existsSync(fontDir)) {
69218
+ fs13.mkdirSync(fontDir, { recursive: true });
68719
69219
  }
68720
- const tempDir = path9.join(os11.tmpdir(), `ccstatusline-powerline-fonts-${Date.now()}`);
69220
+ const tempDir = path10.join(os11.tmpdir(), `ccstatusline-powerline-fonts-${Date.now()}`);
68721
69221
  try {
68722
- if (fs12.existsSync(tempDir)) {
68723
- fs12.rmSync(tempDir, { recursive: true, force: true });
69222
+ if (fs13.existsSync(tempDir)) {
69223
+ fs13.rmSync(tempDir, { recursive: true, force: true });
68724
69224
  }
68725
69225
  execSync5(`git clone --depth=1 https://github.com/powerline/fonts.git "${tempDir}"`, {
68726
69226
  stdio: "pipe",
68727
69227
  encoding: "utf8"
68728
69228
  });
68729
69229
  if (platform4 === "darwin" || platform4 === "linux") {
68730
- const installScript = path9.join(tempDir, "install.sh");
68731
- if (fs12.existsSync(installScript)) {
68732
- fs12.chmodSync(installScript, 493);
69230
+ const installScript = path10.join(tempDir, "install.sh");
69231
+ if (fs13.existsSync(installScript)) {
69232
+ fs13.chmodSync(installScript, 493);
68733
69233
  execSync5(`cd "${tempDir}" && ./install.sh`, {
68734
69234
  stdio: "pipe",
68735
69235
  encoding: "utf8",
@@ -68755,10 +69255,10 @@ async function installPowerlineFonts() {
68755
69255
  }
68756
69256
  } else {
68757
69257
  let findFontFiles = function(dir) {
68758
- const files = fs12.readdirSync(dir);
69258
+ const files = fs13.readdirSync(dir);
68759
69259
  for (const file2 of files) {
68760
- const filePath = path9.join(dir, file2);
68761
- const stat2 = fs12.statSync(filePath);
69260
+ const filePath = path10.join(dir, file2);
69261
+ const stat2 = fs13.statSync(filePath);
68762
69262
  if (stat2.isDirectory() && !file2.startsWith(".")) {
68763
69263
  findFontFiles(filePath);
68764
69264
  } else if (file2.endsWith(".ttf") || file2.endsWith(".otf")) {
@@ -68772,10 +69272,10 @@ async function installPowerlineFonts() {
68772
69272
  findFontFiles(tempDir);
68773
69273
  let installedCount = 0;
68774
69274
  for (const fontFile of fontFiles) {
68775
- const fileName = path9.basename(fontFile);
68776
- const destPath = path9.join(fontDir, fileName);
69275
+ const fileName = path10.basename(fontFile);
69276
+ const destPath = path10.join(fontDir, fileName);
68777
69277
  try {
68778
- fs12.copyFileSync(fontFile, destPath);
69278
+ fs13.copyFileSync(fontFile, destPath);
68779
69279
  installedCount++;
68780
69280
  } catch {}
68781
69281
  }
@@ -68793,9 +69293,9 @@ async function installPowerlineFonts() {
68793
69293
  message: "Platform-specific installation not implemented"
68794
69294
  };
68795
69295
  } finally {
68796
- if (fs12.existsSync(tempDir)) {
69296
+ if (fs13.existsSync(tempDir)) {
68797
69297
  try {
68798
- fs12.rmSync(tempDir, { recursive: true, force: true });
69298
+ fs13.rmSync(tempDir, { recursive: true, force: true });
68799
69299
  } catch {}
68800
69300
  }
68801
69301
  }
@@ -68817,6 +69317,204 @@ async function installPowerlineFonts() {
68817
69317
  // src/tui/App.tsx
68818
69318
  init_terminal();
68819
69319
 
69320
+ // src/utils/update-checker.ts
69321
+ await init_claude_settings();
69322
+ import { execFile as execFile2 } from "child_process";
69323
+ import * as https2 from "https";
69324
+ var NPM_REGISTRY_LATEST_URL = "https://registry.npmjs.org/ccstatusline/latest";
69325
+ var DEFAULT_REGISTRY_TIMEOUT_MS = 5000;
69326
+ var GLOBAL_UPDATE_TIMEOUT_MS = 120000;
69327
+ function parseVersion(version2) {
69328
+ return version2.split(/[.-]/).map((part) => {
69329
+ const parsed = parseInt(part, 10);
69330
+ return Number.isFinite(parsed) ? parsed : 0;
69331
+ });
69332
+ }
69333
+ function compareVersions(left, right) {
69334
+ const leftParts = parseVersion(left);
69335
+ const rightParts = parseVersion(right);
69336
+ const length = Math.max(leftParts.length, rightParts.length);
69337
+ for (let i = 0;i < length; i += 1) {
69338
+ const leftPart = leftParts[i] ?? 0;
69339
+ const rightPart = rightParts[i] ?? 0;
69340
+ if (leftPart > rightPart) {
69341
+ return 1;
69342
+ }
69343
+ if (leftPart < rightPart) {
69344
+ return -1;
69345
+ }
69346
+ }
69347
+ return 0;
69348
+ }
69349
+ function getGlobalUpdateAction(packageManager, latestVersion, commandAvailability) {
69350
+ if (packageManager === "npm") {
69351
+ return {
69352
+ id: "npm-global",
69353
+ packageManager,
69354
+ command: PINNED_INSTALL_COMMANDS.NPM(latestVersion),
69355
+ version: latestVersion,
69356
+ available: commandAvailability.npm
69357
+ };
69358
+ }
69359
+ return {
69360
+ id: "bun-global",
69361
+ packageManager,
69362
+ command: PINNED_INSTALL_COMMANDS.BUN(latestVersion),
69363
+ version: latestVersion,
69364
+ available: commandAvailability.bun
69365
+ };
69366
+ }
69367
+ function getAutoUpdateLaunchCommand(installation) {
69368
+ if (installation.method !== "auto-update") {
69369
+ return;
69370
+ }
69371
+ return installation.packageManager === "bun" ? buildStatusLineCommand("auto-bunx") : buildStatusLineCommand("auto-npx");
69372
+ }
69373
+ function getUpdateActions(installation, latestVersion, commandAvailability) {
69374
+ if (installation.method === "auto-update") {
69375
+ return [];
69376
+ }
69377
+ if (installation.method === "pinned" || installation.method === "self-managed") {
69378
+ if (installation.packageManager === "npm") {
69379
+ return [getGlobalUpdateAction("npm", latestVersion, commandAvailability)];
69380
+ }
69381
+ if (installation.packageManager === "bun") {
69382
+ return [getGlobalUpdateAction("bun", latestVersion, commandAvailability)];
69383
+ }
69384
+ }
69385
+ return [
69386
+ getGlobalUpdateAction("npm", latestVersion, commandAvailability),
69387
+ getGlobalUpdateAction("bun", latestVersion, commandAvailability)
69388
+ ];
69389
+ }
69390
+ function getResolvedInstallation(installedCommand, installationMetadata) {
69391
+ const installation = classifyInstallation(installedCommand, installationMetadata);
69392
+ if (installation.method === "self-managed" && installationMetadata?.method === "self-managed") {
69393
+ return {
69394
+ ...installation,
69395
+ packageManager: installationMetadata.packageManager
69396
+ };
69397
+ }
69398
+ if (installation.method !== "pinned") {
69399
+ return installation;
69400
+ }
69401
+ return {
69402
+ ...installation,
69403
+ packageManager: installationMetadata?.method === "pinned" && "packageManager" in installationMetadata ? installationMetadata.packageManager : "unknown"
69404
+ };
69405
+ }
69406
+ function buildUpdateCheckResult({
69407
+ currentVersion,
69408
+ latestVersion,
69409
+ installedCommand,
69410
+ installationMetadata,
69411
+ commandAvailability
69412
+ }) {
69413
+ const installation = getResolvedInstallation(installedCommand, installationMetadata);
69414
+ if (compareVersions(latestVersion, currentVersion) <= 0) {
69415
+ return {
69416
+ status: "up-to-date",
69417
+ currentVersion,
69418
+ latestVersion,
69419
+ installation
69420
+ };
69421
+ }
69422
+ return {
69423
+ status: "update-available",
69424
+ currentVersion,
69425
+ latestVersion,
69426
+ installation,
69427
+ actions: getUpdateActions(installation, latestVersion, commandAvailability),
69428
+ autoUpdateLaunchCommand: getAutoUpdateLaunchCommand(installation)
69429
+ };
69430
+ }
69431
+ function getErrorMessage(error48) {
69432
+ if (error48 instanceof Error && error48.message) {
69433
+ return error48.message;
69434
+ }
69435
+ return "Unable to query npm registry";
69436
+ }
69437
+ async function checkForUpdates({
69438
+ currentVersion,
69439
+ installedCommand,
69440
+ installationMetadata,
69441
+ commandAvailability,
69442
+ timeoutMs = DEFAULT_REGISTRY_TIMEOUT_MS,
69443
+ latestVersionFetcher = fetchLatestNpmVersion
69444
+ }) {
69445
+ try {
69446
+ const latestVersion = await latestVersionFetcher(timeoutMs);
69447
+ return buildUpdateCheckResult({
69448
+ currentVersion,
69449
+ latestVersion,
69450
+ installedCommand,
69451
+ installationMetadata,
69452
+ commandAvailability
69453
+ });
69454
+ } catch (error48) {
69455
+ return {
69456
+ status: "registry-failure",
69457
+ currentVersion,
69458
+ installation: getResolvedInstallation(installedCommand, installationMetadata),
69459
+ errorMessage: getErrorMessage(error48)
69460
+ };
69461
+ }
69462
+ }
69463
+ function fetchLatestNpmVersion(timeoutMs = DEFAULT_REGISTRY_TIMEOUT_MS) {
69464
+ return new Promise((resolve5, reject2) => {
69465
+ const request3 = https2.request(NPM_REGISTRY_LATEST_URL, {
69466
+ headers: {
69467
+ Accept: "application/json",
69468
+ "User-Agent": "ccstatusline"
69469
+ }
69470
+ }, (response) => {
69471
+ if (!response.statusCode || response.statusCode < 200 || response.statusCode >= 300) {
69472
+ response.resume();
69473
+ reject2(new Error(`npm registry returned HTTP ${response.statusCode ?? "unknown"}`));
69474
+ return;
69475
+ }
69476
+ response.setEncoding("utf8");
69477
+ let body = "";
69478
+ response.on("data", (chunk2) => {
69479
+ body += chunk2;
69480
+ });
69481
+ response.on("end", () => {
69482
+ try {
69483
+ const parsed = JSON.parse(body);
69484
+ if (typeof parsed.version !== "string" || parsed.version.trim() === "") {
69485
+ reject2(new Error("npm registry response did not include a version"));
69486
+ return;
69487
+ }
69488
+ resolve5(parsed.version);
69489
+ } catch (error48) {
69490
+ reject2(error48 instanceof Error ? error48 : new Error(String(error48)));
69491
+ }
69492
+ });
69493
+ });
69494
+ request3.setTimeout(timeoutMs, () => {
69495
+ request3.destroy(new Error(`npm registry request timed out after ${timeoutMs}ms`));
69496
+ });
69497
+ request3.on("error", reject2);
69498
+ request3.end();
69499
+ });
69500
+ }
69501
+ function runGlobalPackageInstall(packageManager, version2, { platform: platform4 = process.platform } = {}) {
69502
+ const executable = getPackageManagerExecutable(packageManager, platform4);
69503
+ const args = packageManager === "npm" ? ["install", "-g", `ccstatusline@${version2}`] : ["add", "-g", `ccstatusline@${version2}`];
69504
+ return new Promise((resolve5, reject2) => {
69505
+ execFile2(executable, args, { timeout: GLOBAL_UPDATE_TIMEOUT_MS }, (error48) => {
69506
+ if (error48) {
69507
+ reject2(error48 instanceof Error ? error48 : new Error("Global update command failed"));
69508
+ return;
69509
+ }
69510
+ resolve5();
69511
+ });
69512
+ });
69513
+ }
69514
+ function runGlobalUpdateAction(action) {
69515
+ return runGlobalPackageInstall(action.packageManager, action.version);
69516
+ }
69517
+
68820
69518
  // src/tui/claude-status.ts
68821
69519
  await init_claude_settings();
68822
69520
  async function loadClaudeStatusLineState() {
@@ -70440,47 +71138,102 @@ await __promiseAll([
70440
71138
  init_build2(),
70441
71139
  init_claude_settings()
70442
71140
  ]);
71141
+ var import_react41 = __toESM(require_react(), 1);
70443
71142
  var jsx_dev_runtime14 = __toESM(require_jsx_dev_runtime(), 1);
71143
+ var AUTO_UPDATE_DESCRIPTION = "Runs `@latest` through npx/bunx. Stays current automatically, with a small startup cost when the package runner checks or resolves the package. Because it follows the latest published package, pinned install is available if you prefer explicit updates.";
71144
+ function getPinnedDescription(currentVersion) {
71145
+ return `Installs \`ccstatusline@${currentVersion}\` globally and Claude Code runs \`ccstatusline\`. Fast per-render and only changes when you update.`;
71146
+ }
71147
+ function getStyleItems(currentVersion) {
71148
+ return [
71149
+ {
71150
+ label: "Auto-update",
71151
+ value: "auto-update",
71152
+ description: AUTO_UPDATE_DESCRIPTION
71153
+ },
71154
+ {
71155
+ label: "Pinned global install",
71156
+ value: "pinned",
71157
+ description: getPinnedDescription(currentVersion)
71158
+ }
71159
+ ];
71160
+ }
71161
+ function getManagerItems(updateStyle, commandAvailability, currentVersion) {
71162
+ if (updateStyle === "auto-update") {
71163
+ return [
71164
+ {
71165
+ label: CCSTATUSLINE_COMMANDS.AUTO_NPX,
71166
+ value: "npm",
71167
+ disabled: !commandAvailability.npx,
71168
+ sublabel: commandAvailability.npx ? undefined : "(npx not installed)"
71169
+ },
71170
+ {
71171
+ label: CCSTATUSLINE_COMMANDS.AUTO_BUNX,
71172
+ value: "bun",
71173
+ disabled: !commandAvailability.bunx,
71174
+ sublabel: commandAvailability.bunx ? undefined : "(bunx not installed)"
71175
+ }
71176
+ ];
71177
+ }
71178
+ return [
71179
+ {
71180
+ label: PINNED_INSTALL_COMMANDS.NPM(currentVersion),
71181
+ value: "npm",
71182
+ disabled: !commandAvailability.npm,
71183
+ sublabel: commandAvailability.npm ? undefined : "(npm not installed)"
71184
+ },
71185
+ {
71186
+ label: PINNED_INSTALL_COMMANDS.BUN(currentVersion),
71187
+ value: "bun",
71188
+ disabled: !commandAvailability.bun,
71189
+ sublabel: commandAvailability.bun ? undefined : "(bun not installed)"
71190
+ }
71191
+ ];
71192
+ }
71193
+ function buildSelection(updateStyle, packageManager, currentVersion) {
71194
+ if (updateStyle === "auto-update") {
71195
+ return {
71196
+ updateStyle,
71197
+ packageManager,
71198
+ commandMode: packageManager === "bun" ? "auto-bunx" : "auto-npx",
71199
+ displayedCommand: packageManager === "bun" ? CCSTATUSLINE_COMMANDS.AUTO_BUNX : CCSTATUSLINE_COMMANDS.AUTO_NPX,
71200
+ metadata: {
71201
+ method: "auto-update",
71202
+ packageManager
71203
+ }
71204
+ };
71205
+ }
71206
+ return {
71207
+ updateStyle,
71208
+ packageManager,
71209
+ commandMode: "global",
71210
+ displayedCommand: packageManager === "bun" ? PINNED_INSTALL_COMMANDS.BUN(currentVersion) : PINNED_INSTALL_COMMANDS.NPM(currentVersion),
71211
+ globalInstallCommand: packageManager === "bun" ? PINNED_INSTALL_COMMANDS.BUN(currentVersion) : PINNED_INSTALL_COMMANDS.NPM(currentVersion),
71212
+ metadata: {
71213
+ method: "pinned",
71214
+ installedVersion: currentVersion
71215
+ }
71216
+ };
71217
+ }
70444
71218
  var InstallMenu = ({
70445
- bunxAvailable,
71219
+ commandAvailability,
71220
+ currentVersion,
70446
71221
  existingStatusLine,
70447
- onSelectNpx,
70448
- onSelectBunx,
71222
+ onSelect,
70449
71223
  onCancel,
70450
- initialSelection = 0
71224
+ initialPackageSelection = 0
70451
71225
  }) => {
71226
+ const [step, setStep] = import_react41.useState("style");
71227
+ const [updateStyle, setUpdateStyle] = import_react41.useState("auto-update");
70452
71228
  use_input_default((_, key) => {
70453
71229
  if (key.escape) {
71230
+ if (step === "manager") {
71231
+ setStep("style");
71232
+ return;
71233
+ }
70454
71234
  onCancel();
70455
71235
  }
70456
71236
  });
70457
- function onSelect(value) {
70458
- switch (value) {
70459
- case "npx":
70460
- onSelectNpx();
70461
- break;
70462
- case "bunx":
70463
- if (bunxAvailable) {
70464
- onSelectBunx();
70465
- }
70466
- break;
70467
- case "back":
70468
- onCancel();
70469
- break;
70470
- }
70471
- }
70472
- const listItems = [
70473
- {
70474
- label: "npx - Node Package Execute",
70475
- value: "npx"
70476
- },
70477
- {
70478
- label: "bunx - Bun Package Execute",
70479
- sublabel: bunxAvailable ? undefined : "(not installed)",
70480
- value: "bunx",
70481
- disabled: !bunxAvailable
70482
- }
70483
- ];
70484
71237
  return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
70485
71238
  flexDirection: "column",
70486
71239
  children: [
@@ -70499,26 +71252,55 @@ var InstallMenu = ({
70499
71252
  ]
70500
71253
  }, undefined, true, undefined, this)
70501
71254
  }, undefined, false, undefined, this),
70502
- /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
70503
- children: /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
70504
- dimColor: true,
70505
- children: "Select package manager to use:"
70506
- }, undefined, false, undefined, this)
70507
- }, undefined, false, undefined, this),
70508
- /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(List, {
70509
- color: "blue",
70510
- marginTop: 1,
70511
- items: listItems,
70512
- onSelect: (line) => {
70513
- if (line === "back") {
70514
- onCancel();
70515
- return;
70516
- }
70517
- onSelect(line);
70518
- },
70519
- initialSelection,
70520
- showBackButton: true
70521
- }, undefined, false, undefined, this),
71255
+ step === "style" && /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(jsx_dev_runtime14.Fragment, {
71256
+ children: [
71257
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
71258
+ children: /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
71259
+ dimColor: true,
71260
+ children: "Select update style:"
71261
+ }, undefined, false, undefined, this)
71262
+ }, undefined, false, undefined, this),
71263
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(List, {
71264
+ color: "blue",
71265
+ marginTop: 1,
71266
+ items: getStyleItems(currentVersion),
71267
+ onSelect: (value) => {
71268
+ if (value === "back") {
71269
+ onCancel();
71270
+ return;
71271
+ }
71272
+ setUpdateStyle(value);
71273
+ setStep("manager");
71274
+ },
71275
+ initialSelection: 0,
71276
+ showBackButton: true
71277
+ }, undefined, false, undefined, this)
71278
+ ]
71279
+ }, undefined, true, undefined, this),
71280
+ step === "manager" && /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(jsx_dev_runtime14.Fragment, {
71281
+ children: [
71282
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
71283
+ children: /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
71284
+ dimColor: true,
71285
+ children: "Select package manager:"
71286
+ }, undefined, false, undefined, this)
71287
+ }, undefined, false, undefined, this),
71288
+ /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(List, {
71289
+ color: "blue",
71290
+ marginTop: 1,
71291
+ items: getManagerItems(updateStyle, commandAvailability, currentVersion),
71292
+ onSelect: (value) => {
71293
+ if (value === "back") {
71294
+ setStep("style");
71295
+ return;
71296
+ }
71297
+ onSelect(buildSelection(updateStyle, value, currentVersion));
71298
+ },
71299
+ initialSelection: initialPackageSelection,
71300
+ showBackButton: true
71301
+ }, undefined, false, undefined, this)
71302
+ ]
71303
+ }, undefined, true, undefined, this),
70522
71304
  /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Box_default, {
70523
71305
  marginTop: 2,
70524
71306
  children: /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
@@ -70534,7 +71316,7 @@ var InstallMenu = ({
70534
71316
  marginTop: 1,
70535
71317
  children: /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
70536
71318
  dimColor: true,
70537
- children: "Press Enter to select, ESC to cancel"
71319
+ children: "Press Enter to select, ESC to go back"
70538
71320
  }, undefined, false, undefined, this)
70539
71321
  }, undefined, false, undefined, this)
70540
71322
  ]
@@ -70547,7 +71329,7 @@ await __promiseAll([
70547
71329
  init_build2(),
70548
71330
  init_widgets2()
70549
71331
  ]);
70550
- var import_react41 = __toESM(require_react(), 1);
71332
+ var import_react42 = __toESM(require_react(), 1);
70551
71333
 
70552
71334
  // src/tui/components/items-editor/input-handlers.ts
70553
71335
  await init_widgets2();
@@ -70889,11 +71671,11 @@ function handleNormalInputMode({
70889
71671
  // src/tui/components/ItemsEditor.tsx
70890
71672
  var jsx_dev_runtime15 = __toESM(require_jsx_dev_runtime(), 1);
70891
71673
  var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
70892
- const [selectedIndex, setSelectedIndex] = import_react41.useState(0);
70893
- const [moveMode, setMoveMode] = import_react41.useState(false);
70894
- const [customEditorWidget, setCustomEditorWidget] = import_react41.useState(null);
70895
- const [widgetPicker, setWidgetPicker] = import_react41.useState(null);
70896
- const [showClearConfirm, setShowClearConfirm] = import_react41.useState(false);
71674
+ const [selectedIndex, setSelectedIndex] = import_react42.useState(0);
71675
+ const [moveMode, setMoveMode] = import_react42.useState(false);
71676
+ const [customEditorWidget, setCustomEditorWidget] = import_react42.useState(null);
71677
+ const [widgetPicker, setWidgetPicker] = import_react42.useState(null);
71678
+ const [showClearConfirm, setShowClearConfirm] = import_react42.useState(false);
70897
71679
  const separatorChars = ["|", "-", ",", " "];
70898
71680
  const widgetCatalog = getWidgetCatalog(settings);
70899
71681
  const widgetCategories = ["All", ...getWidgetCatalogCategories(widgetCatalog)];
@@ -71444,7 +72226,7 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
71444
72226
  // src/tui/components/LineSelector.tsx
71445
72227
  await init_build2();
71446
72228
  var import_pluralize = __toESM(require_pluralize(), 1);
71447
- var import_react42 = __toESM(require_react(), 1);
72229
+ var import_react43 = __toESM(require_react(), 1);
71448
72230
  var jsx_dev_runtime16 = __toESM(require_jsx_dev_runtime(), 1);
71449
72231
  var LineSelector = ({
71450
72232
  lines,
@@ -71457,17 +72239,17 @@ var LineSelector = ({
71457
72239
  settings,
71458
72240
  allowEditing = false
71459
72241
  }) => {
71460
- const [selectedIndex, setSelectedIndex] = import_react42.useState(initialSelection);
71461
- const [showDeleteDialog, setShowDeleteDialog] = import_react42.useState(false);
71462
- const [moveMode, setMoveMode] = import_react42.useState(false);
71463
- const [localLines, setLocalLines] = import_react42.useState(lines);
71464
- import_react42.useEffect(() => {
72242
+ const [selectedIndex, setSelectedIndex] = import_react43.useState(initialSelection);
72243
+ const [showDeleteDialog, setShowDeleteDialog] = import_react43.useState(false);
72244
+ const [moveMode, setMoveMode] = import_react43.useState(false);
72245
+ const [localLines, setLocalLines] = import_react43.useState(lines);
72246
+ import_react43.useEffect(() => {
71465
72247
  setLocalLines(lines);
71466
72248
  }, [lines]);
71467
- import_react42.useEffect(() => {
72249
+ import_react43.useEffect(() => {
71468
72250
  setSelectedIndex(initialSelection);
71469
72251
  }, [initialSelection]);
71470
- const selectedLine = import_react42.useMemo(() => localLines[selectedIndex], [localLines, selectedIndex]);
72252
+ const selectedLine = import_react43.useMemo(() => localLines[selectedIndex], [localLines, selectedIndex]);
71471
72253
  const appendLine = () => {
71472
72254
  const newLines = [...localLines, []];
71473
72255
  setLocalLines(newLines);
@@ -71740,15 +72522,31 @@ var LineSelector = ({
71740
72522
  // src/tui/components/MainMenu.tsx
71741
72523
  await init_build2();
71742
72524
  var jsx_dev_runtime17 = __toESM(require_jsx_dev_runtime(), 1);
71743
- var MainMenu = ({
71744
- onSelect,
71745
- isClaudeInstalled,
71746
- hasChanges,
71747
- initialSelection = 0,
71748
- powerlineFontStatus,
71749
- settings,
71750
- previewIsTruncated
71751
- }) => {
72525
+ function usesManageInstallation(installation) {
72526
+ return installation?.method === "pinned" || installation?.method === "self-managed";
72527
+ }
72528
+ function getInstallationMenuItem(isClaudeInstalled, installation) {
72529
+ if (!isClaudeInstalled) {
72530
+ return {
72531
+ label: "\uD83D\uDCE6 Install to Claude Code",
72532
+ value: "install",
72533
+ description: "Add ccstatusline to your Claude Code settings for automatic status line rendering"
72534
+ };
72535
+ }
72536
+ if (usesManageInstallation(installation)) {
72537
+ return {
72538
+ label: "\uD83E\uDDF0 Manage Installation",
72539
+ value: "manageInstallation",
72540
+ description: "Check pinned global package updates or uninstall ccstatusline"
72541
+ };
72542
+ }
72543
+ return {
72544
+ label: "\uD83D\uDD0C Uninstall from Claude Code",
72545
+ value: "install",
72546
+ description: "Remove ccstatusline from your Claude Code settings"
72547
+ };
72548
+ }
72549
+ function buildMainMenuItems(isClaudeInstalled, hasChanges, installation) {
71752
72550
  const menuItems = [
71753
72551
  {
71754
72552
  label: "\uD83D\uDCDD Edit Lines",
@@ -71776,28 +72574,18 @@ var MainMenu = ({
71776
72574
  value: "globalOverrides",
71777
72575
  description: "Set global padding, separators, and color overrides that apply to all widgets"
71778
72576
  },
72577
+ {
72578
+ label: "\uD83D\uDD27 Configure Status Line",
72579
+ sublabel: isClaudeInstalled ? undefined : "(install first)",
72580
+ disabled: !isClaudeInstalled,
72581
+ value: "configureStatusLine",
72582
+ description: "Configure Claude Code status line settings like refresh interval"
72583
+ },
71779
72584
  "-",
71780
- ...isClaudeInstalled ? [
71781
- {
71782
- label: "\uD83D\uDD27 Configure Status Line",
71783
- value: "configureStatusLine",
71784
- description: "Configure Claude Code status line settings like refresh interval"
71785
- },
71786
- {
71787
- label: "\uD83D\uDD0C Uninstall from Claude Code",
71788
- value: "install",
71789
- description: "Remove ccstatusline from your Claude Code settings"
71790
- }
71791
- ] : [
71792
- {
71793
- label: "\uD83D\uDCE6 Install to Claude Code",
71794
- value: "install",
71795
- description: "Add ccstatusline to your Claude Code settings for automatic status line rendering"
71796
- }
71797
- ]
72585
+ getInstallationMenuItem(isClaudeInstalled, installation)
71798
72586
  ];
71799
72587
  if (hasChanges) {
71800
- menuItems.push({
72588
+ menuItems.push("-", {
71801
72589
  label: "\uD83D\uDCBE Save & Exit",
71802
72590
  value: "save",
71803
72591
  description: "Save all changes and exit the configuration tool"
@@ -71811,7 +72599,7 @@ var MainMenu = ({
71811
72599
  description: "Open the ccstatusline GitHub repository in your browser so you can star the project"
71812
72600
  });
71813
72601
  } else {
71814
- menuItems.push({
72602
+ menuItems.push("-", {
71815
72603
  label: "\uD83D\uDEAA Exit",
71816
72604
  value: "exit",
71817
72605
  description: "Exit the configuration tool"
@@ -71821,6 +72609,38 @@ var MainMenu = ({
71821
72609
  description: "Open the ccstatusline GitHub repository in your browser so you can star the project"
71822
72610
  });
71823
72611
  }
72612
+ return menuItems;
72613
+ }
72614
+ function getMainMenuSelectionIndex(items, option) {
72615
+ let selectionIndex = 0;
72616
+ for (const item of items) {
72617
+ if (item === "-") {
72618
+ continue;
72619
+ }
72620
+ if (item.value === option) {
72621
+ return selectionIndex;
72622
+ }
72623
+ if (!item.disabled) {
72624
+ selectionIndex += 1;
72625
+ }
72626
+ }
72627
+ return 0;
72628
+ }
72629
+ function getMainMenuInstallSelectionIndex(isClaudeInstalled, installation) {
72630
+ const option = isClaudeInstalled && usesManageInstallation(installation) ? "manageInstallation" : "install";
72631
+ return getMainMenuSelectionIndex(buildMainMenuItems(isClaudeInstalled, false, installation), option);
72632
+ }
72633
+ var MainMenu = ({
72634
+ onSelect,
72635
+ isClaudeInstalled,
72636
+ hasChanges,
72637
+ initialSelection = 0,
72638
+ powerlineFontStatus,
72639
+ settings,
72640
+ installation,
72641
+ previewIsTruncated
72642
+ }) => {
72643
+ const menuItems = buildMainMenuItems(isClaudeInstalled, hasChanges, installation);
71824
72644
  const showTruncationWarning = previewIsTruncated && settings?.flexMode === "full-minus-40";
71825
72645
  return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV(Box_default, {
71826
72646
  flexDirection: "column",
@@ -71850,9 +72670,184 @@ var MainMenu = ({
71850
72670
  ]
71851
72671
  }, undefined, true, undefined, this);
71852
72672
  };
72673
+ // src/tui/components/ManageInstallationMenu.tsx
72674
+ await init_build2();
72675
+ var jsx_dev_runtime18 = __toESM(require_jsx_dev_runtime(), 1);
72676
+ function getInstallationLabel(installation) {
72677
+ if (installation.method === "pinned") {
72678
+ const version2 = installation.installedVersion ? ` ${installation.installedVersion}` : "";
72679
+ const manager = installation.packageManager === "unknown" ? "" : ` via ${installation.packageManager}`;
72680
+ return `Pinned global install${manager}${version2}`;
72681
+ }
72682
+ if (installation.method === "self-managed") {
72683
+ return "Self-managed/global install";
72684
+ }
72685
+ if (installation.method === "auto-update") {
72686
+ return `Auto-update via ${installation.packageManager}`;
72687
+ }
72688
+ return "Unknown installation";
72689
+ }
72690
+ function getActiveCommandLabel(activeCommand) {
72691
+ if (!activeCommand?.resolvedPath) {
72692
+ return null;
72693
+ }
72694
+ if (activeCommand.packageManager === "unknown") {
72695
+ return `Active PATH match: ${activeCommand.resolvedPath}`;
72696
+ }
72697
+ const version2 = activeCommand.version ? ` ${activeCommand.version}` : "";
72698
+ return `Active PATH match: ${activeCommand.packageManager} global${version2} (${activeCommand.resolvedPath})`;
72699
+ }
72700
+ function buildManageInstallationItems() {
72701
+ return [
72702
+ {
72703
+ label: "\uD83D\uDD04 Check for Updates",
72704
+ value: "checkUpdates",
72705
+ description: "Check npm for the latest ccstatusline version and update the pinned global package"
72706
+ },
72707
+ {
72708
+ label: "\uD83D\uDD0C Uninstall",
72709
+ value: "uninstall",
72710
+ description: "Remove ccstatusline from Claude Code settings, optionally removing global npm/bun packages"
72711
+ }
72712
+ ];
72713
+ }
72714
+ function formatPackageManagers(packageManagers) {
72715
+ return packageManagers.join(" + ");
72716
+ }
72717
+ function buildUninstallItems(installations) {
72718
+ const removableManagers = installations.filter((installation) => installation.installed && installation.available).map((installation) => installation.packageManager);
72719
+ const items = [
72720
+ {
72721
+ label: "Remove from Claude Code settings only",
72722
+ value: { packageManagers: [] },
72723
+ description: "Leaves any global npm or bun ccstatusline packages installed"
72724
+ }
72725
+ ];
72726
+ for (const packageManager of removableManagers) {
72727
+ items.push({
72728
+ label: `Remove Claude settings and ${packageManager} global package`,
72729
+ value: { packageManagers: [packageManager] },
72730
+ description: `Runs ${packageManager === "npm" ? "npm uninstall -g ccstatusline" : "bun remove -g ccstatusline"} after removing Claude Code settings`
72731
+ });
72732
+ }
72733
+ if (removableManagers.length > 1) {
72734
+ items.push({
72735
+ label: `Remove Claude settings and ${formatPackageManagers(removableManagers)} global packages`,
72736
+ value: { packageManagers: removableManagers },
72737
+ description: "Removes every detected global ccstatusline package after removing Claude Code settings"
72738
+ });
72739
+ }
72740
+ return items;
72741
+ }
72742
+ var ManageInstallationMenu = ({
72743
+ installation,
72744
+ activeCommand,
72745
+ onSelect,
72746
+ onBack
72747
+ }) => {
72748
+ const activeCommandLabel = getActiveCommandLabel(activeCommand);
72749
+ use_input_default((_, key) => {
72750
+ if (key.escape) {
72751
+ onBack();
72752
+ }
72753
+ });
72754
+ return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
72755
+ flexDirection: "column",
72756
+ children: [
72757
+ /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
72758
+ bold: true,
72759
+ children: "Manage Installation"
72760
+ }, undefined, false, undefined, this),
72761
+ /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
72762
+ marginTop: 1,
72763
+ children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
72764
+ children: [
72765
+ "Current:",
72766
+ " ",
72767
+ getInstallationLabel(installation)
72768
+ ]
72769
+ }, undefined, true, undefined, this)
72770
+ }, undefined, false, undefined, this),
72771
+ activeCommandLabel && /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
72772
+ children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
72773
+ dimColor: true,
72774
+ children: activeCommandLabel
72775
+ }, undefined, false, undefined, this)
72776
+ }, undefined, false, undefined, this),
72777
+ activeCommand?.warning && /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
72778
+ marginTop: 1,
72779
+ children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
72780
+ color: "yellow",
72781
+ wrap: "wrap",
72782
+ children: activeCommand.warning
72783
+ }, undefined, false, undefined, this)
72784
+ }, undefined, false, undefined, this),
72785
+ /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(List, {
72786
+ marginTop: 1,
72787
+ items: buildManageInstallationItems(),
72788
+ onSelect: (value) => {
72789
+ if (value === "back") {
72790
+ onBack();
72791
+ return;
72792
+ }
72793
+ onSelect(value);
72794
+ },
72795
+ showBackButton: true
72796
+ }, undefined, false, undefined, this)
72797
+ ]
72798
+ }, undefined, true, undefined, this);
72799
+ };
72800
+ var UninstallMenu = ({
72801
+ installations,
72802
+ onSelect,
72803
+ onBack
72804
+ }) => {
72805
+ const items = buildUninstallItems(installations);
72806
+ const detectedManagers = installations.filter((installation) => installation.installed && installation.available).map((installation) => installation.packageManager);
72807
+ use_input_default((_, key) => {
72808
+ if (key.escape) {
72809
+ onBack();
72810
+ }
72811
+ });
72812
+ return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
72813
+ flexDirection: "column",
72814
+ children: [
72815
+ /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
72816
+ bold: true,
72817
+ children: "Uninstall ccstatusline"
72818
+ }, undefined, false, undefined, this),
72819
+ /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
72820
+ marginTop: 1,
72821
+ children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
72822
+ dimColor: true,
72823
+ children: "Choose what to remove from this machine."
72824
+ }, undefined, false, undefined, this)
72825
+ }, undefined, false, undefined, this),
72826
+ detectedManagers.length === 0 && /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
72827
+ marginTop: 1,
72828
+ children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
72829
+ dimColor: true,
72830
+ children: "No global npm or bun ccstatusline package was detected."
72831
+ }, undefined, false, undefined, this)
72832
+ }, undefined, false, undefined, this),
72833
+ /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(List, {
72834
+ marginTop: 1,
72835
+ items,
72836
+ onSelect: (value) => {
72837
+ if (value === "back") {
72838
+ onBack();
72839
+ return;
72840
+ }
72841
+ onSelect(value);
72842
+ },
72843
+ showBackButton: true
72844
+ }, undefined, false, undefined, this)
72845
+ ]
72846
+ }, undefined, true, undefined, this);
72847
+ };
71853
72848
  // src/tui/components/PowerlineSetup.tsx
71854
72849
  await init_build2();
71855
- var import_react45 = __toESM(require_react(), 1);
72850
+ var import_react46 = __toESM(require_react(), 1);
71856
72851
  import * as os12 from "os";
71857
72852
 
71858
72853
  // src/utils/powerline-settings.ts
@@ -71883,8 +72878,8 @@ function buildEnabledPowerlineSettings(settings, removeManualSeparators) {
71883
72878
  // src/tui/components/PowerlineSeparatorEditor.tsx
71884
72879
  init_input_guards();
71885
72880
  await init_build2();
71886
- var import_react43 = __toESM(require_react(), 1);
71887
- var jsx_dev_runtime18 = __toESM(require_jsx_dev_runtime(), 1);
72881
+ var import_react44 = __toESM(require_react(), 1);
72882
+ var jsx_dev_runtime19 = __toESM(require_jsx_dev_runtime(), 1);
71888
72883
  var PowerlineSeparatorEditor = ({
71889
72884
  settings,
71890
72885
  mode,
@@ -71904,10 +72899,10 @@ var PowerlineSeparatorEditor = ({
71904
72899
  };
71905
72900
  const separators = getItems();
71906
72901
  const invertBgs = mode === "separator" ? powerlineConfig.separatorInvertBackground : [];
71907
- const [selectedIndex, setSelectedIndex] = import_react43.useState(0);
71908
- const [hexInputMode, setHexInputMode] = import_react43.useState(false);
71909
- const [hexInput, setHexInput] = import_react43.useState("");
71910
- const [cursorPos, setCursorPos] = import_react43.useState(0);
72902
+ const [selectedIndex, setSelectedIndex] = import_react44.useState(0);
72903
+ const [hexInputMode, setHexInputMode] = import_react44.useState(false);
72904
+ const [hexInput, setHexInput] = import_react44.useState("");
72905
+ const [cursorPos, setCursorPos] = import_react44.useState(0);
71911
72906
  const getPresets = () => {
71912
72907
  if (mode === "separator") {
71913
72908
  return [
@@ -72099,18 +73094,18 @@ var PowerlineSeparatorEditor = ({
72099
73094
  }
72100
73095
  };
72101
73096
  const canDelete = mode !== "separator" || separators.length > 1;
72102
- return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
73097
+ return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
72103
73098
  flexDirection: "column",
72104
73099
  children: [
72105
- /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
73100
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
72106
73101
  bold: true,
72107
73102
  children: getTitle()
72108
73103
  }, undefined, false, undefined, this),
72109
- hexInputMode ? /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
73104
+ hexInputMode ? /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
72110
73105
  marginTop: 2,
72111
73106
  flexDirection: "column",
72112
73107
  children: [
72113
- /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
73108
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
72114
73109
  children: [
72115
73110
  "Enter hex code (4-6 digits) for",
72116
73111
  " ",
@@ -72119,51 +73114,51 @@ var PowerlineSeparatorEditor = ({
72119
73114
  ":"
72120
73115
  ]
72121
73116
  }, undefined, true, undefined, this),
72122
- /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
73117
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
72123
73118
  children: [
72124
73119
  "U+",
72125
73120
  hexInput.slice(0, cursorPos),
72126
- /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
73121
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
72127
73122
  backgroundColor: "gray",
72128
73123
  color: "black",
72129
73124
  children: hexInput[cursorPos] ?? "_"
72130
73125
  }, undefined, false, undefined, this),
72131
73126
  hexInput.slice(cursorPos + 1),
72132
- hexInput.length < 6 && hexInput.length === cursorPos && /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
73127
+ hexInput.length < 6 && hexInput.length === cursorPos && /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
72133
73128
  dimColor: true,
72134
73129
  children: "_".repeat(6 - hexInput.length - 1)
72135
73130
  }, undefined, false, undefined, this)
72136
73131
  ]
72137
73132
  }, undefined, true, undefined, this),
72138
- /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
73133
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
72139
73134
  dimColor: true,
72140
73135
  children: "Enter 4-6 hex digits (0-9, A-F) for a Unicode code point, then press Enter. ESC to cancel."
72141
73136
  }, undefined, false, undefined, this),
72142
- /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
73137
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
72143
73138
  dimColor: true,
72144
73139
  children: "Examples: E0B0 (powerline), 1F984 (\uD83E\uDD84), 2764 (❤)"
72145
73140
  }, undefined, false, undefined, this)
72146
73141
  ]
72147
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(jsx_dev_runtime18.Fragment, {
73142
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(jsx_dev_runtime19.Fragment, {
72148
73143
  children: [
72149
- /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
72150
- children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
73144
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
73145
+ children: /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
72151
73146
  dimColor: true,
72152
73147
  children: `↑↓ select, ← → cycle, (a)dd, (i)nsert${canDelete ? ", (d)elete" : ""}, (c)lear, (h)ex${mode === "separator" ? ", (t)oggle invert" : ""}, ESC back`
72153
73148
  }, undefined, false, undefined, this)
72154
73149
  }, undefined, false, undefined, this),
72155
- /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
73150
+ /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
72156
73151
  marginTop: 2,
72157
73152
  flexDirection: "column",
72158
- children: separators.length > 0 ? separators.map((sep2, index) => /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Box_default, {
72159
- children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
73153
+ children: separators.length > 0 ? separators.map((sep2, index) => /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
73154
+ children: /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
72160
73155
  color: index === selectedIndex ? "green" : undefined,
72161
73156
  children: [
72162
73157
  index === selectedIndex ? "▶ " : " ",
72163
73158
  `${index + 1}: ${getSeparatorDisplay(sep2, index)}`
72164
73159
  ]
72165
73160
  }, undefined, true, undefined, this)
72166
- }, index, false, undefined, this)) : /* @__PURE__ */ jsx_dev_runtime18.jsxDEV(Text, {
73161
+ }, index, false, undefined, this)) : /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
72167
73162
  dimColor: true,
72168
73163
  children: "(none configured - press 'a' to add)"
72169
73164
  }, undefined, false, undefined, this)
@@ -72178,8 +73173,8 @@ var PowerlineSeparatorEditor = ({
72178
73173
  init_ColorLevel();
72179
73174
  init_colors();
72180
73175
  await init_build2();
72181
- var import_react44 = __toESM(require_react(), 1);
72182
- var jsx_dev_runtime19 = __toESM(require_jsx_dev_runtime(), 1);
73176
+ var import_react45 = __toESM(require_react(), 1);
73177
+ var jsx_dev_runtime20 = __toESM(require_jsx_dev_runtime(), 1);
72183
73178
  function buildPowerlineThemeItems(themes, originalTheme) {
72184
73179
  return themes.map((themeName) => {
72185
73180
  const theme = getPowerlineTheme(themeName);
@@ -72232,20 +73227,20 @@ var PowerlineThemeSelector = ({
72232
73227
  onUpdate,
72233
73228
  onBack
72234
73229
  }) => {
72235
- const themes = import_react44.useMemo(() => getPowerlineThemes(), []);
73230
+ const themes = import_react45.useMemo(() => getPowerlineThemes(), []);
72236
73231
  const currentTheme = settings.powerline.theme ?? "custom";
72237
- const [selectedIndex, setSelectedIndex] = import_react44.useState(Math.max(0, themes.indexOf(currentTheme)));
72238
- const [showCustomizeConfirm, setShowCustomizeConfirm] = import_react44.useState(false);
72239
- const originalThemeRef = import_react44.useRef(currentTheme);
72240
- const originalSettingsRef = import_react44.useRef(settings);
72241
- const latestSettingsRef = import_react44.useRef(settings);
72242
- const latestOnUpdateRef = import_react44.useRef(onUpdate);
72243
- const didHandleInitialSelectionRef = import_react44.useRef(false);
72244
- import_react44.useEffect(() => {
73232
+ const [selectedIndex, setSelectedIndex] = import_react45.useState(Math.max(0, themes.indexOf(currentTheme)));
73233
+ const [showCustomizeConfirm, setShowCustomizeConfirm] = import_react45.useState(false);
73234
+ const originalThemeRef = import_react45.useRef(currentTheme);
73235
+ const originalSettingsRef = import_react45.useRef(settings);
73236
+ const latestSettingsRef = import_react45.useRef(settings);
73237
+ const latestOnUpdateRef = import_react45.useRef(onUpdate);
73238
+ const didHandleInitialSelectionRef = import_react45.useRef(false);
73239
+ import_react45.useEffect(() => {
72245
73240
  latestSettingsRef.current = settings;
72246
73241
  latestOnUpdateRef.current = onUpdate;
72247
73242
  }, [settings, onUpdate]);
72248
- import_react44.useEffect(() => {
73243
+ import_react45.useEffect(() => {
72249
73244
  const themeName = themes[selectedIndex];
72250
73245
  if (!themeName) {
72251
73246
  return;
@@ -72277,41 +73272,41 @@ var PowerlineThemeSelector = ({
72277
73272
  }
72278
73273
  });
72279
73274
  const selectedThemeName = themes[selectedIndex];
72280
- const themeItems = import_react44.useMemo(() => buildPowerlineThemeItems(themes, originalThemeRef.current), [themes]);
73275
+ const themeItems = import_react45.useMemo(() => buildPowerlineThemeItems(themes, originalThemeRef.current), [themes]);
72281
73276
  if (showCustomizeConfirm) {
72282
- return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
73277
+ return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
72283
73278
  flexDirection: "column",
72284
73279
  children: [
72285
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
73280
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
72286
73281
  bold: true,
72287
73282
  color: "yellow",
72288
73283
  children: "⚠ Confirm Customization"
72289
73284
  }, undefined, false, undefined, this),
72290
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
73285
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
72291
73286
  marginTop: 1,
72292
73287
  flexDirection: "column",
72293
73288
  children: [
72294
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
73289
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
72295
73290
  children: "This will copy the current theme colors to your widgets"
72296
73291
  }, undefined, false, undefined, this),
72297
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
73292
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
72298
73293
  children: "and switch to Custom theme mode."
72299
73294
  }, undefined, false, undefined, this),
72300
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
73295
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
72301
73296
  color: "red",
72302
73297
  children: "This will overwrite any existing custom colors!"
72303
73298
  }, undefined, false, undefined, this)
72304
73299
  ]
72305
73300
  }, undefined, true, undefined, this),
72306
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
73301
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
72307
73302
  marginTop: 2,
72308
- children: /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
73303
+ children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
72309
73304
  children: "Continue?"
72310
73305
  }, undefined, false, undefined, this)
72311
73306
  }, undefined, false, undefined, this),
72312
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
73307
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
72313
73308
  marginTop: 1,
72314
- children: /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(ConfirmDialog, {
73309
+ children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(ConfirmDialog, {
72315
73310
  inline: true,
72316
73311
  onConfirm: () => {
72317
73312
  if (selectedThemeName) {
@@ -72331,26 +73326,26 @@ var PowerlineThemeSelector = ({
72331
73326
  ]
72332
73327
  }, undefined, true, undefined, this);
72333
73328
  }
72334
- return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
73329
+ return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
72335
73330
  flexDirection: "column",
72336
73331
  children: [
72337
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
73332
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
72338
73333
  bold: true,
72339
73334
  children: [
72340
73335
  `Powerline Theme Selection | `,
72341
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
73336
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
72342
73337
  dimColor: true,
72343
73338
  children: `Original: ${originalThemeRef.current}`
72344
73339
  }, undefined, false, undefined, this)
72345
73340
  ]
72346
73341
  }, undefined, true, undefined, this),
72347
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
72348
- children: /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
73342
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
73343
+ children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
72349
73344
  dimColor: true,
72350
73345
  children: `↑↓ navigate, Enter apply${selectedThemeName && selectedThemeName !== "custom" ? ", (c)ustomize theme" : ""}, ESC cancel`
72351
73346
  }, undefined, false, undefined, this)
72352
73347
  }, undefined, false, undefined, this),
72353
- /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(List, {
73348
+ /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(List, {
72354
73349
  marginTop: 1,
72355
73350
  items: themeItems,
72356
73351
  onSelect: () => {
@@ -72364,16 +73359,16 @@ var PowerlineThemeSelector = ({
72364
73359
  },
72365
73360
  initialSelection: selectedIndex
72366
73361
  }, undefined, false, undefined, this),
72367
- selectedThemeName && selectedThemeName !== "custom" && /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
73362
+ selectedThemeName && selectedThemeName !== "custom" && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
72368
73363
  marginTop: 1,
72369
- children: /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
73364
+ children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
72370
73365
  dimColor: true,
72371
73366
  children: "Press (c) to customize this theme - copies colors to widgets"
72372
73367
  }, undefined, false, undefined, this)
72373
73368
  }, undefined, false, undefined, this),
72374
- settings.colorLevel === 1 && /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Box_default, {
73369
+ settings.colorLevel === 1 && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
72375
73370
  marginTop: 1,
72376
- children: /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
73371
+ children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
72377
73372
  color: "yellow",
72378
73373
  children: "⚠ 16 color mode themes have a very limited palette, we recommend switching color level in Terminal Options"
72379
73374
  }, undefined, false, undefined, this)
@@ -72383,7 +73378,7 @@ var PowerlineThemeSelector = ({
72383
73378
  };
72384
73379
 
72385
73380
  // src/tui/components/PowerlineSetup.tsx
72386
- var jsx_dev_runtime20 = __toESM(require_jsx_dev_runtime(), 1);
73381
+ var jsx_dev_runtime21 = __toESM(require_jsx_dev_runtime(), 1);
72387
73382
  var POWERLINE_MENU_LABEL_WIDTH = 11;
72388
73383
  function formatPowerlineMenuLabel(label) {
72389
73384
  return label.padEnd(POWERLINE_MENU_LABEL_WIDTH, " ");
@@ -72486,10 +73481,10 @@ var PowerlineSetup = ({
72486
73481
  onClearMessage
72487
73482
  }) => {
72488
73483
  const powerlineConfig = settings.powerline;
72489
- const [screen, setScreen] = import_react45.useState("menu");
72490
- const [selectedMenuItem, setSelectedMenuItem] = import_react45.useState(0);
72491
- const [confirmingEnable, setConfirmingEnable] = import_react45.useState(false);
72492
- const [confirmingFontInstall, setConfirmingFontInstall] = import_react45.useState(false);
73484
+ const [screen, setScreen] = import_react46.useState("menu");
73485
+ const [selectedMenuItem, setSelectedMenuItem] = import_react46.useState(0);
73486
+ const [confirmingEnable, setConfirmingEnable] = import_react46.useState(false);
73487
+ const [confirmingFontInstall, setConfirmingFontInstall] = import_react46.useState(false);
72493
73488
  const hasSeparatorItems = settings.lines.some((line) => line.some((item) => item.type === "separator" || item.type === "flex-separator"));
72494
73489
  use_input_default((input, key) => {
72495
73490
  if (fontInstallMessage || installingFonts) {
@@ -72542,7 +73537,7 @@ var PowerlineSetup = ({
72542
73537
  }
72543
73538
  });
72544
73539
  if (screen === "separator") {
72545
- return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(PowerlineSeparatorEditor, {
73540
+ return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(PowerlineSeparatorEditor, {
72546
73541
  settings,
72547
73542
  mode: "separator",
72548
73543
  onUpdate,
@@ -72552,7 +73547,7 @@ var PowerlineSetup = ({
72552
73547
  }, undefined, false, undefined, this);
72553
73548
  }
72554
73549
  if (screen === "startCap") {
72555
- return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(PowerlineSeparatorEditor, {
73550
+ return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(PowerlineSeparatorEditor, {
72556
73551
  settings,
72557
73552
  mode: "startCap",
72558
73553
  onUpdate,
@@ -72562,7 +73557,7 @@ var PowerlineSetup = ({
72562
73557
  }, undefined, false, undefined, this);
72563
73558
  }
72564
73559
  if (screen === "endCap") {
72565
- return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(PowerlineSeparatorEditor, {
73560
+ return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(PowerlineSeparatorEditor, {
72566
73561
  settings,
72567
73562
  mode: "endCap",
72568
73563
  onUpdate,
@@ -72572,7 +73567,7 @@ var PowerlineSetup = ({
72572
73567
  }, undefined, false, undefined, this);
72573
73568
  }
72574
73569
  if (screen === "themes") {
72575
- return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(PowerlineThemeSelector, {
73570
+ return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(PowerlineThemeSelector, {
72576
73571
  settings,
72577
73572
  onUpdate,
72578
73573
  onBack: () => {
@@ -72580,140 +73575,140 @@ var PowerlineSetup = ({
72580
73575
  }
72581
73576
  }, undefined, false, undefined, this);
72582
73577
  }
72583
- return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
73578
+ return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
72584
73579
  flexDirection: "column",
72585
73580
  children: [
72586
- !confirmingFontInstall && !installingFonts && !fontInstallMessage && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73581
+ !confirmingFontInstall && !installingFonts && !fontInstallMessage && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72587
73582
  bold: true,
72588
73583
  children: "Powerline Setup"
72589
73584
  }, undefined, false, undefined, this),
72590
- confirmingFontInstall ? /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
73585
+ confirmingFontInstall ? /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
72591
73586
  flexDirection: "column",
72592
73587
  children: [
72593
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
73588
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
72594
73589
  marginBottom: 1,
72595
- children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73590
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72596
73591
  color: "cyan",
72597
73592
  bold: true,
72598
73593
  children: "Font Installation"
72599
73594
  }, undefined, false, undefined, this)
72600
73595
  }, undefined, false, undefined, this),
72601
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
73596
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
72602
73597
  marginBottom: 1,
72603
73598
  flexDirection: "column",
72604
73599
  children: [
72605
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73600
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72606
73601
  bold: true,
72607
73602
  children: "What will happen:"
72608
73603
  }, undefined, false, undefined, this),
72609
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73604
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72610
73605
  children: [
72611
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73606
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72612
73607
  dimColor: true,
72613
73608
  children: "• Clone fonts from "
72614
73609
  }, undefined, false, undefined, this),
72615
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73610
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72616
73611
  color: "blue",
72617
73612
  children: "https://github.com/powerline/fonts"
72618
73613
  }, undefined, false, undefined, this)
72619
73614
  ]
72620
73615
  }, undefined, true, undefined, this),
72621
- os12.platform() === "darwin" && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(jsx_dev_runtime20.Fragment, {
73616
+ os12.platform() === "darwin" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(jsx_dev_runtime21.Fragment, {
72622
73617
  children: [
72623
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73618
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72624
73619
  dimColor: true,
72625
73620
  children: "• Run install.sh script which will:"
72626
73621
  }, undefined, false, undefined, this),
72627
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73622
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72628
73623
  dimColor: true,
72629
73624
  children: " - Copy all .ttf/.otf files to ~/Library/Fonts"
72630
73625
  }, undefined, false, undefined, this),
72631
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73626
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72632
73627
  dimColor: true,
72633
73628
  children: " - Register fonts with macOS"
72634
73629
  }, undefined, false, undefined, this)
72635
73630
  ]
72636
73631
  }, undefined, true, undefined, this),
72637
- os12.platform() === "linux" && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(jsx_dev_runtime20.Fragment, {
73632
+ os12.platform() === "linux" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(jsx_dev_runtime21.Fragment, {
72638
73633
  children: [
72639
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73634
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72640
73635
  dimColor: true,
72641
73636
  children: "• Run install.sh script which will:"
72642
73637
  }, undefined, false, undefined, this),
72643
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73638
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72644
73639
  dimColor: true,
72645
73640
  children: " - Copy all .ttf/.otf files to ~/.local/share/fonts"
72646
73641
  }, undefined, false, undefined, this),
72647
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73642
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72648
73643
  dimColor: true,
72649
73644
  children: " - Run fc-cache to update font cache"
72650
73645
  }, undefined, false, undefined, this)
72651
73646
  ]
72652
73647
  }, undefined, true, undefined, this),
72653
- os12.platform() === "win32" && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(jsx_dev_runtime20.Fragment, {
73648
+ os12.platform() === "win32" && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(jsx_dev_runtime21.Fragment, {
72654
73649
  children: [
72655
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73650
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72656
73651
  dimColor: true,
72657
73652
  children: "• Copy Powerline .ttf/.otf files to:"
72658
73653
  }, undefined, false, undefined, this),
72659
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73654
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72660
73655
  dimColor: true,
72661
73656
  children: " AppData\\Local\\Microsoft\\Windows\\Fonts"
72662
73657
  }, undefined, false, undefined, this)
72663
73658
  ]
72664
73659
  }, undefined, true, undefined, this),
72665
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73660
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72666
73661
  dimColor: true,
72667
73662
  children: "• Clean up temporary files"
72668
73663
  }, undefined, false, undefined, this)
72669
73664
  ]
72670
73665
  }, undefined, true, undefined, this),
72671
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
73666
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
72672
73667
  marginBottom: 1,
72673
73668
  children: [
72674
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73669
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72675
73670
  color: "yellow",
72676
73671
  bold: true,
72677
73672
  children: "Requirements: "
72678
73673
  }, undefined, false, undefined, this),
72679
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73674
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72680
73675
  dimColor: true,
72681
73676
  children: "Git installed, Internet connection, Write permissions"
72682
73677
  }, undefined, false, undefined, this)
72683
73678
  ]
72684
73679
  }, undefined, true, undefined, this),
72685
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
73680
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
72686
73681
  marginBottom: 1,
72687
73682
  flexDirection: "column",
72688
73683
  children: [
72689
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73684
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72690
73685
  color: "green",
72691
73686
  bold: true,
72692
73687
  children: "After install:"
72693
73688
  }, undefined, false, undefined, this),
72694
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73689
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72695
73690
  dimColor: true,
72696
73691
  children: "• Restart terminal"
72697
73692
  }, undefined, false, undefined, this),
72698
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73693
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72699
73694
  dimColor: true,
72700
73695
  children: "• Select a Powerline font"
72701
73696
  }, undefined, false, undefined, this),
72702
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73697
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72703
73698
  dimColor: true,
72704
73699
  children: ' (e.g. "Meslo LG S for Powerline")'
72705
73700
  }, undefined, false, undefined, this)
72706
73701
  ]
72707
73702
  }, undefined, true, undefined, this),
72708
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
73703
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
72709
73704
  marginTop: 1,
72710
- children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73705
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72711
73706
  children: "Proceed? "
72712
73707
  }, undefined, false, undefined, this)
72713
73708
  }, undefined, false, undefined, this),
72714
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
73709
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
72715
73710
  marginTop: 1,
72716
- children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(ConfirmDialog, {
73711
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(ConfirmDialog, {
72717
73712
  inline: true,
72718
73713
  onConfirm: () => {
72719
73714
  setConfirmingFontInstall(false);
@@ -72725,36 +73720,36 @@ var PowerlineSetup = ({
72725
73720
  }, undefined, false, undefined, this)
72726
73721
  }, undefined, false, undefined, this)
72727
73722
  ]
72728
- }, undefined, true, undefined, this) : confirmingEnable ? /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
73723
+ }, undefined, true, undefined, this) : confirmingEnable ? /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
72729
73724
  flexDirection: "column",
72730
73725
  marginTop: 1,
72731
73726
  children: [
72732
- hasSeparatorItems && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(jsx_dev_runtime20.Fragment, {
73727
+ hasSeparatorItems && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(jsx_dev_runtime21.Fragment, {
72733
73728
  children: [
72734
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
72735
- children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73729
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
73730
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72736
73731
  color: "yellow",
72737
73732
  children: "⚠ Warning: Enabling Powerline mode will remove all existing separators and flex-separators from your status lines."
72738
73733
  }, undefined, false, undefined, this)
72739
73734
  }, undefined, false, undefined, this),
72740
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
73735
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
72741
73736
  marginBottom: 1,
72742
- children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73737
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72743
73738
  dimColor: true,
72744
73739
  children: "Powerline mode uses its own separator system and is incompatible with manual separators."
72745
73740
  }, undefined, false, undefined, this)
72746
73741
  }, undefined, false, undefined, this)
72747
73742
  ]
72748
73743
  }, undefined, true, undefined, this),
72749
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
73744
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
72750
73745
  marginTop: hasSeparatorItems ? 1 : 0,
72751
- children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73746
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72752
73747
  children: "Do you want to continue? "
72753
73748
  }, undefined, false, undefined, this)
72754
73749
  }, undefined, false, undefined, this),
72755
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
73750
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
72756
73751
  marginTop: 1,
72757
- children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(ConfirmDialog, {
73752
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(ConfirmDialog, {
72758
73753
  inline: true,
72759
73754
  onConfirm: () => {
72760
73755
  onUpdate(buildEnabledPowerlineSettings(settings, true));
@@ -72766,51 +73761,51 @@ var PowerlineSetup = ({
72766
73761
  }, undefined, false, undefined, this)
72767
73762
  }, undefined, false, undefined, this)
72768
73763
  ]
72769
- }, undefined, true, undefined, this) : installingFonts ? /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
72770
- children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73764
+ }, undefined, true, undefined, this) : installingFonts ? /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
73765
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72771
73766
  color: "yellow",
72772
73767
  children: "Installing Powerline fonts... This may take a moment."
72773
73768
  }, undefined, false, undefined, this)
72774
- }, undefined, false, undefined, this) : fontInstallMessage ? /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
73769
+ }, undefined, false, undefined, this) : fontInstallMessage ? /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
72775
73770
  flexDirection: "column",
72776
73771
  children: [
72777
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73772
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72778
73773
  color: fontInstallMessage.includes("success") ? "green" : "red",
72779
73774
  children: fontInstallMessage
72780
73775
  }, undefined, false, undefined, this),
72781
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
73776
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
72782
73777
  marginTop: 1,
72783
- children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73778
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72784
73779
  dimColor: true,
72785
73780
  children: "Press any key to continue..."
72786
73781
  }, undefined, false, undefined, this)
72787
73782
  }, undefined, false, undefined, this)
72788
73783
  ]
72789
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(jsx_dev_runtime20.Fragment, {
73784
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(jsx_dev_runtime21.Fragment, {
72790
73785
  children: [
72791
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
73786
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
72792
73787
  flexDirection: "column",
72793
- children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73788
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72794
73789
  children: [
72795
73790
  " Font Status: ",
72796
- powerlineFontStatus.installed ? /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(jsx_dev_runtime20.Fragment, {
73791
+ powerlineFontStatus.installed ? /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(jsx_dev_runtime21.Fragment, {
72797
73792
  children: [
72798
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73793
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72799
73794
  color: "green",
72800
73795
  children: "✓ Installed"
72801
73796
  }, undefined, false, undefined, this),
72802
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73797
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72803
73798
  dimColor: true,
72804
73799
  children: " - Ensure fonts are active in your terminal"
72805
73800
  }, undefined, false, undefined, this)
72806
73801
  ]
72807
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(jsx_dev_runtime20.Fragment, {
73802
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(jsx_dev_runtime21.Fragment, {
72808
73803
  children: [
72809
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73804
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72810
73805
  color: "yellow",
72811
73806
  children: "✗ Not Installed"
72812
73807
  }, undefined, false, undefined, this),
72813
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73808
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72814
73809
  dimColor: true,
72815
73810
  children: " - Press (i) to install Powerline fonts"
72816
73811
  }, undefined, false, undefined, this)
@@ -72819,62 +73814,62 @@ var PowerlineSetup = ({
72819
73814
  ]
72820
73815
  }, undefined, true, undefined, this)
72821
73816
  }, undefined, false, undefined, this),
72822
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
73817
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
72823
73818
  children: [
72824
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73819
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72825
73820
  children: " Powerline Mode: "
72826
73821
  }, undefined, false, undefined, this),
72827
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73822
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72828
73823
  color: powerlineConfig.enabled ? "green" : "red",
72829
73824
  children: powerlineConfig.enabled ? "✓ Enabled " : "✗ Disabled "
72830
73825
  }, undefined, false, undefined, this),
72831
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73826
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72832
73827
  dimColor: true,
72833
73828
  children: " - Press (t) to toggle"
72834
73829
  }, undefined, false, undefined, this)
72835
73830
  ]
72836
73831
  }, undefined, true, undefined, this),
72837
- powerlineConfig.enabled && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(jsx_dev_runtime20.Fragment, {
73832
+ powerlineConfig.enabled && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(jsx_dev_runtime21.Fragment, {
72838
73833
  children: [
72839
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
73834
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
72840
73835
  children: [
72841
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73836
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72842
73837
  children: " Align Widgets: "
72843
73838
  }, undefined, false, undefined, this),
72844
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73839
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72845
73840
  color: powerlineConfig.autoAlign ? "green" : "red",
72846
73841
  children: powerlineConfig.autoAlign ? "✓ Enabled " : "✗ Disabled "
72847
73842
  }, undefined, false, undefined, this),
72848
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73843
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72849
73844
  dimColor: true,
72850
73845
  children: " - Press (a) to toggle"
72851
73846
  }, undefined, false, undefined, this)
72852
73847
  ]
72853
73848
  }, undefined, true, undefined, this),
72854
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
73849
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
72855
73850
  children: [
72856
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73851
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72857
73852
  children: " Continue Theme: "
72858
73853
  }, undefined, false, undefined, this),
72859
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73854
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72860
73855
  color: powerlineConfig.continueThemeAcrossLines ? "green" : "red",
72861
73856
  children: powerlineConfig.continueThemeAcrossLines ? "✓ Enabled " : "✗ Disabled "
72862
73857
  }, undefined, false, undefined, this),
72863
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73858
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72864
73859
  dimColor: true,
72865
73860
  children: " - Press (c) to toggle"
72866
73861
  }, undefined, false, undefined, this)
72867
73862
  ]
72868
73863
  }, undefined, true, undefined, this),
72869
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
73864
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
72870
73865
  flexDirection: "column",
72871
73866
  marginTop: 1,
72872
73867
  children: [
72873
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73868
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72874
73869
  dimColor: true,
72875
73870
  children: "When enabled, global overrides are disabled and powerline separators are used"
72876
73871
  }, undefined, false, undefined, this),
72877
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73872
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72878
73873
  dimColor: true,
72879
73874
  children: "Continue Theme keeps the Powerline color sequence running across lines"
72880
73875
  }, undefined, false, undefined, this)
@@ -72882,14 +73877,14 @@ var PowerlineSetup = ({
72882
73877
  }, undefined, true, undefined, this)
72883
73878
  ]
72884
73879
  }, undefined, true, undefined, this),
72885
- !powerlineConfig.enabled && /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Box_default, {
73880
+ !powerlineConfig.enabled && /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
72886
73881
  marginTop: 1,
72887
- children: /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(Text, {
73882
+ children: /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
72888
73883
  dimColor: true,
72889
73884
  children: "Enable Powerline mode to configure separators, caps, and themes."
72890
73885
  }, undefined, false, undefined, this)
72891
73886
  }, undefined, false, undefined, this),
72892
- /* @__PURE__ */ jsx_dev_runtime20.jsxDEV(List, {
73887
+ /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(List, {
72893
73888
  marginTop: 1,
72894
73889
  items: buildPowerlineSetupMenuItems(powerlineConfig),
72895
73890
  onSelect: (value) => {
@@ -72913,8 +73908,8 @@ var PowerlineSetup = ({
72913
73908
  // src/tui/components/RefreshIntervalMenu.tsx
72914
73909
  init_input_guards();
72915
73910
  await init_build2();
72916
- var import_react46 = __toESM(require_react(), 1);
72917
- var jsx_dev_runtime21 = __toESM(require_jsx_dev_runtime(), 1);
73911
+ var import_react47 = __toESM(require_react(), 1);
73912
+ var jsx_dev_runtime22 = __toESM(require_jsx_dev_runtime(), 1);
72918
73913
  function getRefreshInputValue(interval) {
72919
73914
  return interval === null ? "" : String(interval);
72920
73915
  }
@@ -72960,9 +73955,9 @@ var RefreshIntervalMenu = ({
72960
73955
  onUpdate,
72961
73956
  onBack
72962
73957
  }) => {
72963
- const [editingRefreshInterval, setEditingRefreshInterval] = import_react46.useState(false);
72964
- const [refreshInput, setRefreshInput] = import_react46.useState(() => getRefreshInputValue(currentInterval));
72965
- const [validationError, setValidationError] = import_react46.useState(null);
73958
+ const [editingRefreshInterval, setEditingRefreshInterval] = import_react47.useState(false);
73959
+ const [refreshInput, setRefreshInput] = import_react47.useState(() => getRefreshInputValue(currentInterval));
73960
+ const [validationError, setValidationError] = import_react47.useState(null);
72966
73961
  use_input_default((input, key) => {
72967
73962
  if (editingRefreshInterval) {
72968
73963
  if (key.return) {
@@ -73001,22 +73996,22 @@ var RefreshIntervalMenu = ({
73001
73996
  onBack();
73002
73997
  }
73003
73998
  });
73004
- return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
73999
+ return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
73005
74000
  flexDirection: "column",
73006
74001
  children: [
73007
- /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
74002
+ /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
73008
74003
  bold: true,
73009
74004
  children: "Configure Status Line"
73010
74005
  }, undefined, false, undefined, this),
73011
- /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
74006
+ /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
73012
74007
  color: "white",
73013
74008
  children: "Configure Claude Code status line settings"
73014
74009
  }, undefined, false, undefined, this),
73015
- editingRefreshInterval ? /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Box_default, {
74010
+ editingRefreshInterval ? /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
73016
74011
  marginTop: 1,
73017
74012
  flexDirection: "column",
73018
74013
  children: [
73019
- /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
74014
+ /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
73020
74015
  children: [
73021
74016
  "Enter refresh interval in seconds (1-60):",
73022
74017
  " ",
@@ -73024,15 +74019,15 @@ var RefreshIntervalMenu = ({
73024
74019
  refreshInput.length > 0 ? "s" : ""
73025
74020
  ]
73026
74021
  }, undefined, true, undefined, this),
73027
- validationError ? /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
74022
+ validationError ? /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
73028
74023
  color: "red",
73029
74024
  children: validationError
73030
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(Text, {
74025
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
73031
74026
  dimColor: true,
73032
74027
  children: "Press Enter to confirm, ESC to cancel. Leave empty to remove."
73033
74028
  }, undefined, false, undefined, this)
73034
74029
  ]
73035
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime21.jsxDEV(List, {
74030
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(List, {
73036
74031
  marginTop: 1,
73037
74032
  items: buildConfigureStatusLineItems(currentInterval, supportsRefreshInterval),
73038
74033
  onSelect: (value) => {
@@ -73052,7 +74047,7 @@ var RefreshIntervalMenu = ({
73052
74047
  init_source();
73053
74048
  init_ansi();
73054
74049
  await init_build2();
73055
- var import_react47 = __toESM(require_react(), 1);
74050
+ var import_react48 = __toESM(require_react(), 1);
73056
74051
 
73057
74052
  // src/utils/powerline-theme-index.ts
73058
74053
  function countPowerlineThemeSlots(entries) {
@@ -73086,7 +74081,7 @@ function advanceGlobalSeparatorIndex(currentIndex, widgets) {
73086
74081
  }
73087
74082
 
73088
74083
  // src/tui/components/StatusLinePreview.tsx
73089
- var jsx_dev_runtime22 = __toESM(require_jsx_dev_runtime(), 1);
74084
+ var jsx_dev_runtime23 = __toESM(require_jsx_dev_runtime(), 1);
73090
74085
  var renderSingleLine = (widgets, terminalWidth, settings, lineIndex, globalSeparatorIndex, globalPowerlineThemeIndex, preRenderedWidgets, preCalculatedMaxWidths) => {
73091
74086
  const context = {
73092
74087
  terminalWidth,
@@ -73105,7 +74100,7 @@ function preparePreviewLineForTerminal(line, terminalWidth) {
73105
74100
  return truncateStyledText(printableLine, availableWidth, { ellipsis: true });
73106
74101
  }
73107
74102
  var StatusLinePreview = ({ lines, terminalWidth, settings, onTruncationChange }) => {
73108
- const { renderedLines, anyTruncated } = import_react47.default.useMemo(() => {
74103
+ const { renderedLines, anyTruncated } = import_react48.default.useMemo(() => {
73109
74104
  if (!settings)
73110
74105
  return { renderedLines: [], anyTruncated: false };
73111
74106
  const preRenderedLines = preRenderAllWidgets(lines, settings, { terminalWidth, isPreview: true, minimalist: settings.minimalistMode });
@@ -73131,29 +74126,29 @@ var StatusLinePreview = ({ lines, terminalWidth, settings, onTruncationChange })
73131
74126
  }
73132
74127
  return { renderedLines: result2, anyTruncated: truncated };
73133
74128
  }, [lines, terminalWidth, settings]);
73134
- import_react47.default.useEffect(() => {
74129
+ import_react48.default.useEffect(() => {
73135
74130
  onTruncationChange?.(anyTruncated);
73136
74131
  }, [anyTruncated, onTruncationChange]);
73137
- return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
74132
+ return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
73138
74133
  flexDirection: "column",
73139
74134
  children: [
73140
- /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Box_default, {
74135
+ /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
73141
74136
  borderStyle: "round",
73142
74137
  borderColor: "gray",
73143
74138
  borderDimColor: true,
73144
74139
  width: "100%",
73145
74140
  paddingLeft: 1,
73146
- children: /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
74141
+ children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
73147
74142
  children: [
73148
74143
  ">",
73149
- /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
74144
+ /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
73150
74145
  dimColor: true,
73151
74146
  children: " Preview (ctrl+s to save configuration at any time)"
73152
74147
  }, undefined, false, undefined, this)
73153
74148
  ]
73154
74149
  }, undefined, true, undefined, this)
73155
74150
  }, undefined, false, undefined, this),
73156
- renderedLines.map((line, index) => /* @__PURE__ */ jsx_dev_runtime22.jsxDEV(Text, {
74151
+ renderedLines.map((line, index) => /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
73157
74152
  wrap: "truncate",
73158
74153
  children: [
73159
74154
  PREVIEW_LINE_INDENT,
@@ -73167,7 +74162,7 @@ var StatusLinePreview = ({ lines, terminalWidth, settings, onTruncationChange })
73167
74162
  // src/tui/components/TerminalOptionsMenu.tsx
73168
74163
  init_source();
73169
74164
  await init_build2();
73170
- var import_react48 = __toESM(require_react(), 1);
74165
+ var import_react49 = __toESM(require_react(), 1);
73171
74166
 
73172
74167
  // src/utils/color-sanitize.ts
73173
74168
  await init_widgets2();
@@ -73222,7 +74217,7 @@ function sanitizeLinesForColorLevel(lines, nextLevel) {
73222
74217
  }
73223
74218
 
73224
74219
  // src/tui/components/TerminalOptionsMenu.tsx
73225
- var jsx_dev_runtime23 = __toESM(require_jsx_dev_runtime(), 1);
74220
+ var jsx_dev_runtime24 = __toESM(require_jsx_dev_runtime(), 1);
73226
74221
  function getNextColorLevel(level) {
73227
74222
  return (level + 1) % 4;
73228
74223
  }
@@ -73256,8 +74251,8 @@ var TerminalOptionsMenu = ({
73256
74251
  onUpdate,
73257
74252
  onBack
73258
74253
  }) => {
73259
- const [showColorWarning, setShowColorWarning] = import_react48.useState(false);
73260
- const [pendingColorLevel, setPendingColorLevel] = import_react48.useState(null);
74254
+ const [showColorWarning, setShowColorWarning] = import_react49.useState(false);
74255
+ const [pendingColorLevel, setPendingColorLevel] = import_react49.useState(null);
73261
74256
  const handleSelect = (value) => {
73262
74257
  if (value === "back") {
73263
74258
  onBack();
@@ -73305,27 +74300,27 @@ var TerminalOptionsMenu = ({
73305
74300
  onBack();
73306
74301
  }
73307
74302
  });
73308
- return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
74303
+ return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
73309
74304
  flexDirection: "column",
73310
74305
  children: [
73311
- /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
74306
+ /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
73312
74307
  bold: true,
73313
74308
  children: "Terminal Options"
73314
74309
  }, undefined, false, undefined, this),
73315
- showColorWarning ? /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
74310
+ showColorWarning ? /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
73316
74311
  flexDirection: "column",
73317
74312
  marginTop: 1,
73318
74313
  children: [
73319
- /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
74314
+ /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
73320
74315
  color: "yellow",
73321
74316
  children: "⚠ Warning: Custom colors detected!"
73322
74317
  }, undefined, false, undefined, this),
73323
- /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
74318
+ /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
73324
74319
  children: "Switching color modes will reset custom ansi256 or hex colors to defaults."
73325
74320
  }, undefined, false, undefined, this),
73326
- /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Box_default, {
74321
+ /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
73327
74322
  marginTop: 1,
73328
- children: /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(ConfirmDialog, {
74323
+ children: /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(ConfirmDialog, {
73329
74324
  message: "Continue?",
73330
74325
  onConfirm: handleColorConfirm,
73331
74326
  onCancel: handleColorCancel,
@@ -73333,13 +74328,13 @@ var TerminalOptionsMenu = ({
73333
74328
  }, undefined, false, undefined, this)
73334
74329
  }, undefined, false, undefined, this)
73335
74330
  ]
73336
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(jsx_dev_runtime23.Fragment, {
74331
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(jsx_dev_runtime24.Fragment, {
73337
74332
  children: [
73338
- /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(Text, {
74333
+ /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
73339
74334
  color: "white",
73340
74335
  children: "Configure terminal-specific settings for optimal display"
73341
74336
  }, undefined, false, undefined, this),
73342
- /* @__PURE__ */ jsx_dev_runtime23.jsxDEV(List, {
74337
+ /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(List, {
73343
74338
  marginTop: 1,
73344
74339
  items: buildTerminalOptionsItems(settings.colorLevel),
73345
74340
  onSelect: handleSelect,
@@ -73368,8 +74363,8 @@ var getColorLevelLabel = (level) => {
73368
74363
  // src/tui/components/TerminalWidthMenu.tsx
73369
74364
  init_input_guards();
73370
74365
  await init_build2();
73371
- var import_react49 = __toESM(require_react(), 1);
73372
- var jsx_dev_runtime24 = __toESM(require_jsx_dev_runtime(), 1);
74366
+ var import_react50 = __toESM(require_react(), 1);
74367
+ var jsx_dev_runtime25 = __toESM(require_jsx_dev_runtime(), 1);
73373
74368
  var TERMINAL_WIDTH_OPTIONS = ["full", "full-minus-40", "full-until-compact"];
73374
74369
  function getTerminalWidthSelectionIndex(selectedOption) {
73375
74370
  const selectedIndex = TERMINAL_WIDTH_OPTIONS.indexOf(selectedOption);
@@ -73416,11 +74411,11 @@ var TerminalWidthMenu = ({
73416
74411
  onUpdate,
73417
74412
  onBack
73418
74413
  }) => {
73419
- const [selectedOption, setSelectedOption] = import_react49.useState(settings.flexMode);
73420
- const [compactThreshold, setCompactThreshold] = import_react49.useState(settings.compactThreshold);
73421
- const [editingThreshold, setEditingThreshold] = import_react49.useState(false);
73422
- const [thresholdInput, setThresholdInput] = import_react49.useState(String(settings.compactThreshold));
73423
- const [validationError, setValidationError] = import_react49.useState(null);
74414
+ const [selectedOption, setSelectedOption] = import_react50.useState(settings.flexMode);
74415
+ const [compactThreshold, setCompactThreshold] = import_react50.useState(settings.compactThreshold);
74416
+ const [editingThreshold, setEditingThreshold] = import_react50.useState(false);
74417
+ const [thresholdInput, setThresholdInput] = import_react50.useState(String(settings.compactThreshold));
74418
+ const [validationError, setValidationError] = import_react50.useState(null);
73424
74419
  use_input_default((input, key) => {
73425
74420
  if (editingThreshold) {
73426
74421
  if (key.return) {
@@ -73459,27 +74454,27 @@ var TerminalWidthMenu = ({
73459
74454
  onBack();
73460
74455
  }
73461
74456
  });
73462
- return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
74457
+ return /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Box_default, {
73463
74458
  flexDirection: "column",
73464
74459
  children: [
73465
- /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
74460
+ /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text, {
73466
74461
  bold: true,
73467
74462
  children: "Terminal Width"
73468
74463
  }, undefined, false, undefined, this),
73469
- /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
74464
+ /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text, {
73470
74465
  color: "white",
73471
74466
  children: "These settings affect where long lines are truncated, and where right-alignment occurs when using flex separators"
73472
74467
  }, undefined, false, undefined, this),
73473
- /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
74468
+ /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text, {
73474
74469
  dimColor: true,
73475
74470
  wrap: "wrap",
73476
74471
  children: "Claude code does not currently provide an available width variable for the statusline and features like IDE integration, auto-compaction notices, etc all cause the statusline to wrap if we do not truncate it"
73477
74472
  }, undefined, false, undefined, this),
73478
- editingThreshold ? /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Box_default, {
74473
+ editingThreshold ? /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Box_default, {
73479
74474
  marginTop: 1,
73480
74475
  flexDirection: "column",
73481
74476
  children: [
73482
- /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
74477
+ /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text, {
73483
74478
  children: [
73484
74479
  "Enter compact threshold (1-99):",
73485
74480
  " ",
@@ -73487,15 +74482,15 @@ var TerminalWidthMenu = ({
73487
74482
  "%"
73488
74483
  ]
73489
74484
  }, undefined, true, undefined, this),
73490
- validationError ? /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
74485
+ validationError ? /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text, {
73491
74486
  color: "red",
73492
74487
  children: validationError
73493
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Text, {
74488
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text, {
73494
74489
  dimColor: true,
73495
74490
  children: "Press Enter to confirm, ESC to cancel"
73496
74491
  }, undefined, false, undefined, this)
73497
74492
  ]
73498
- }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(List, {
74493
+ }, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(List, {
73499
74494
  marginTop: 1,
73500
74495
  items: buildTerminalWidthItems(selectedOption, compactThreshold),
73501
74496
  initialSelection: getTerminalWidthSelectionIndex(selectedOption),
@@ -73520,50 +74515,487 @@ var TerminalWidthMenu = ({
73520
74515
  ]
73521
74516
  }, undefined, true, undefined, this);
73522
74517
  };
74518
+ // src/tui/components/UpdateCheckerMenu.tsx
74519
+ await init_build2();
74520
+ var jsx_dev_runtime26 = __toESM(require_jsx_dev_runtime(), 1);
74521
+ function getInstallationLabel2(result2) {
74522
+ const { installation } = result2;
74523
+ if (installation.method === "auto-update") {
74524
+ return `Auto-update via ${installation.packageManager}`;
74525
+ }
74526
+ if (installation.method === "pinned") {
74527
+ const version2 = installation.installedVersion ? ` ${installation.installedVersion}` : "";
74528
+ const manager = installation.packageManager === "unknown" ? "" : ` via ${installation.packageManager}`;
74529
+ return `Pinned global install${manager}${version2}`;
74530
+ }
74531
+ if (installation.method === "self-managed") {
74532
+ return "Self-managed/global install";
74533
+ }
74534
+ return "Unknown or not installed";
74535
+ }
74536
+ function getActionLabel(action) {
74537
+ return `Run ${action.command}`;
74538
+ }
74539
+ function getActionSublabel(action) {
74540
+ if (action.available) {
74541
+ return;
74542
+ }
74543
+ return action.packageManager === "npm" ? "(npm not installed)" : "(bun not installed)";
74544
+ }
74545
+ function getActionItems(actions) {
74546
+ return [
74547
+ ...actions.map((action) => ({
74548
+ label: getActionLabel(action),
74549
+ value: action,
74550
+ disabled: !action.available,
74551
+ sublabel: getActionSublabel(action)
74552
+ })),
74553
+ {
74554
+ label: "Check again",
74555
+ value: "refresh"
74556
+ }
74557
+ ];
74558
+ }
74559
+ var UpdateCheckerMenu = ({
74560
+ state,
74561
+ onBack,
74562
+ onRefresh,
74563
+ onRunAction
74564
+ }) => {
74565
+ use_input_default((_, key) => {
74566
+ if (key.escape) {
74567
+ onBack();
74568
+ }
74569
+ });
74570
+ if (state.status === "checking") {
74571
+ return /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
74572
+ flexDirection: "column",
74573
+ children: [
74574
+ /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
74575
+ bold: true,
74576
+ children: "Check for Updates"
74577
+ }, undefined, false, undefined, this),
74578
+ /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
74579
+ marginTop: 1,
74580
+ children: /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
74581
+ dimColor: true,
74582
+ children: "Checking npm registry..."
74583
+ }, undefined, false, undefined, this)
74584
+ }, undefined, false, undefined, this)
74585
+ ]
74586
+ }, undefined, true, undefined, this);
74587
+ }
74588
+ return /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
74589
+ flexDirection: "column",
74590
+ children: [
74591
+ /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
74592
+ bold: true,
74593
+ children: "Check for Updates"
74594
+ }, undefined, false, undefined, this),
74595
+ /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
74596
+ marginTop: 1,
74597
+ flexDirection: "column",
74598
+ children: [
74599
+ /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
74600
+ children: [
74601
+ "Current:",
74602
+ " ",
74603
+ state.currentVersion
74604
+ ]
74605
+ }, undefined, true, undefined, this),
74606
+ state.status !== "registry-failure" && /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
74607
+ children: [
74608
+ "Latest:",
74609
+ " ",
74610
+ state.latestVersion
74611
+ ]
74612
+ }, undefined, true, undefined, this),
74613
+ /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
74614
+ children: [
74615
+ "Install:",
74616
+ " ",
74617
+ getInstallationLabel2(state)
74618
+ ]
74619
+ }, undefined, true, undefined, this)
74620
+ ]
74621
+ }, undefined, true, undefined, this),
74622
+ state.status === "registry-failure" && /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(jsx_dev_runtime26.Fragment, {
74623
+ children: [
74624
+ /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
74625
+ marginTop: 1,
74626
+ children: /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
74627
+ color: "red",
74628
+ children: [
74629
+ "Registry check failed:",
74630
+ " ",
74631
+ state.errorMessage
74632
+ ]
74633
+ }, undefined, true, undefined, this)
74634
+ }, undefined, false, undefined, this),
74635
+ /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(List, {
74636
+ marginTop: 1,
74637
+ items: [{ label: "Check again", value: "refresh" }],
74638
+ onSelect: (value) => {
74639
+ if (value === "back") {
74640
+ onBack();
74641
+ return;
74642
+ }
74643
+ onRefresh();
74644
+ },
74645
+ showBackButton: true
74646
+ }, undefined, false, undefined, this)
74647
+ ]
74648
+ }, undefined, true, undefined, this),
74649
+ state.status === "up-to-date" && /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(jsx_dev_runtime26.Fragment, {
74650
+ children: [
74651
+ /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
74652
+ marginTop: 1,
74653
+ children: /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
74654
+ color: "green",
74655
+ children: "ccstatusline is up to date."
74656
+ }, undefined, false, undefined, this)
74657
+ }, undefined, false, undefined, this),
74658
+ /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(List, {
74659
+ marginTop: 1,
74660
+ items: [{ label: "Check again", value: "refresh" }],
74661
+ onSelect: (value) => {
74662
+ if (value === "back") {
74663
+ onBack();
74664
+ return;
74665
+ }
74666
+ onRefresh();
74667
+ },
74668
+ showBackButton: true
74669
+ }, undefined, false, undefined, this)
74670
+ ]
74671
+ }, undefined, true, undefined, this),
74672
+ state.status === "update-available" && /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(jsx_dev_runtime26.Fragment, {
74673
+ children: [
74674
+ /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
74675
+ marginTop: 1,
74676
+ children: /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
74677
+ color: "yellow",
74678
+ children: "An update is available."
74679
+ }, undefined, false, undefined, this)
74680
+ }, undefined, false, undefined, this),
74681
+ state.installation.method === "auto-update" && /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Box_default, {
74682
+ marginTop: 1,
74683
+ flexDirection: "column",
74684
+ children: [
74685
+ /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
74686
+ children: "No manual hook change is needed. Claude Code already runs @latest."
74687
+ }, undefined, false, undefined, this),
74688
+ /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
74689
+ children: "The next @latest invocation will resolve the latest package."
74690
+ }, undefined, false, undefined, this),
74691
+ /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(Text, {
74692
+ children: [
74693
+ "Launch command for a fresh TUI:",
74694
+ " ",
74695
+ state.autoUpdateLaunchCommand
74696
+ ]
74697
+ }, undefined, true, undefined, this)
74698
+ ]
74699
+ }, undefined, true, undefined, this),
74700
+ state.actions.length > 0 && /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(List, {
74701
+ marginTop: 1,
74702
+ items: getActionItems(state.actions),
74703
+ onSelect: (value) => {
74704
+ if (value === "back") {
74705
+ onBack();
74706
+ return;
74707
+ }
74708
+ if (value === "refresh") {
74709
+ onRefresh();
74710
+ return;
74711
+ }
74712
+ onRunAction(value);
74713
+ },
74714
+ showBackButton: true
74715
+ }, undefined, false, undefined, this),
74716
+ state.actions.length === 0 && /* @__PURE__ */ jsx_dev_runtime26.jsxDEV(List, {
74717
+ marginTop: 1,
74718
+ items: [{ label: "Check again", value: "refresh" }],
74719
+ onSelect: (value) => {
74720
+ if (value === "back") {
74721
+ onBack();
74722
+ return;
74723
+ }
74724
+ onRefresh();
74725
+ },
74726
+ showBackButton: true
74727
+ }, undefined, false, undefined, this)
74728
+ ]
74729
+ }, undefined, true, undefined, this)
74730
+ ]
74731
+ }, undefined, true, undefined, this);
74732
+ };
73523
74733
  // src/tui/App.tsx
73524
- var jsx_dev_runtime25 = __toESM(require_jsx_dev_runtime(), 1);
74734
+ var jsx_dev_runtime27 = __toESM(require_jsx_dev_runtime(), 1);
73525
74735
  var GITHUB_REPO_URL = "https://github.com/sirmalloc/ccstatusline";
74736
+ var NOTICE_ITEMS = [
74737
+ {
74738
+ label: "Continue",
74739
+ value: "continue"
74740
+ }
74741
+ ];
74742
+ var FlowNotice = ({
74743
+ title,
74744
+ message,
74745
+ color,
74746
+ onContinue
74747
+ }) => {
74748
+ use_input_default((_, key) => {
74749
+ if (key.escape) {
74750
+ onContinue();
74751
+ }
74752
+ });
74753
+ return /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Box_default, {
74754
+ flexDirection: "column",
74755
+ children: [
74756
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
74757
+ bold: true,
74758
+ children: title
74759
+ }, undefined, false, undefined, this),
74760
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Box_default, {
74761
+ marginTop: 1,
74762
+ children: /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
74763
+ color,
74764
+ wrap: "wrap",
74765
+ children: message
74766
+ }, undefined, false, undefined, this)
74767
+ }, undefined, false, undefined, this),
74768
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(List, {
74769
+ marginTop: 1,
74770
+ items: NOTICE_ITEMS,
74771
+ onSelect: () => {
74772
+ onContinue();
74773
+ },
74774
+ color: "cyan"
74775
+ }, undefined, false, undefined, this)
74776
+ ]
74777
+ }, undefined, true, undefined, this);
74778
+ };
74779
+ function getPinnedMismatchItems(mismatch, canRunPackageManager) {
74780
+ const items = [];
74781
+ if (mismatch.canUpdateToRunningVersion) {
74782
+ items.push({
74783
+ label: `Update ${mismatch.packageManager} global install to v${mismatch.runningVersion}`,
74784
+ value: "update",
74785
+ disabled: !canRunPackageManager,
74786
+ sublabel: canRunPackageManager ? undefined : `(${mismatch.packageManager} not installed)`,
74787
+ description: `Runs ${mismatch.packageManager === "npm" ? `npm install -g ccstatusline@${mismatch.runningVersion}` : `bun add -g ccstatusline@${mismatch.runningVersion}`}`
74788
+ });
74789
+ }
74790
+ items.push({
74791
+ label: "Exit",
74792
+ value: "exit",
74793
+ description: `Relaunch manually with ${mismatch.relaunchCommand}`
74794
+ });
74795
+ return items;
74796
+ }
74797
+ var PinnedVersionMismatchScreen = ({
74798
+ mismatch,
74799
+ canRunPackageManager,
74800
+ onUpdate,
74801
+ onExit
74802
+ }) => {
74803
+ use_input_default((_, key) => {
74804
+ if (key.escape) {
74805
+ onExit();
74806
+ }
74807
+ });
74808
+ return /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Box_default, {
74809
+ flexDirection: "column",
74810
+ children: [
74811
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
74812
+ bold: true,
74813
+ children: "Pinned Install Version Mismatch"
74814
+ }, undefined, false, undefined, this),
74815
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Box_default, {
74816
+ marginTop: 1,
74817
+ flexDirection: "column",
74818
+ children: [
74819
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
74820
+ color: "yellow",
74821
+ children: [
74822
+ "Claude Code is pinned to ccstatusline v",
74823
+ mismatch.installedVersion,
74824
+ ", but this TUI is v",
74825
+ mismatch.runningVersion,
74826
+ "."
74827
+ ]
74828
+ }, undefined, true, undefined, this),
74829
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
74830
+ dimColor: true,
74831
+ wrap: "wrap",
74832
+ children: "To avoid writing config that the pinned runtime may not support, update the pinned global install or exit and relaunch the pinned version."
74833
+ }, undefined, false, undefined, this)
74834
+ ]
74835
+ }, undefined, true, undefined, this),
74836
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Box_default, {
74837
+ marginTop: 1,
74838
+ flexDirection: "column",
74839
+ children: /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
74840
+ children: [
74841
+ "Current pinned version:",
74842
+ " ",
74843
+ mismatch.relaunchCommand
74844
+ ]
74845
+ }, undefined, true, undefined, this)
74846
+ }, undefined, false, undefined, this),
74847
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(List, {
74848
+ marginTop: 1,
74849
+ items: getPinnedMismatchItems(mismatch, canRunPackageManager),
74850
+ onSelect: (value) => {
74851
+ if (value === "back") {
74852
+ return;
74853
+ }
74854
+ if (value === "update") {
74855
+ onUpdate();
74856
+ return;
74857
+ }
74858
+ onExit();
74859
+ },
74860
+ color: "cyan"
74861
+ }, undefined, false, undefined, this)
74862
+ ]
74863
+ }, undefined, true, undefined, this);
74864
+ };
74865
+ function getGlobalUninstallCommand(packageManager) {
74866
+ return packageManager === "npm" ? "npm uninstall -g ccstatusline" : "bun remove -g ccstatusline";
74867
+ }
74868
+ function buildUninstallConfirmMessage(selection) {
74869
+ if (selection.packageManagers.length === 0) {
74870
+ return `This will remove ccstatusline from ${getClaudeSettingsPath()}. Continue?`;
74871
+ }
74872
+ const commands = selection.packageManagers.map((packageManager) => getGlobalUninstallCommand(packageManager)).join(`
74873
+ `);
74874
+ return `This will remove ccstatusline from ${getClaudeSettingsPath()} and run:
74875
+
74876
+ ${commands}
74877
+
74878
+ Continue?`;
74879
+ }
74880
+ function clearInstallationMetadata(settings) {
74881
+ if (!settings) {
74882
+ return settings;
74883
+ }
74884
+ const { installation, ...next } = settings;
74885
+ return next;
74886
+ }
74887
+ function getCurrentInstallation(isClaudeInstalled, existingStatusLine, settings) {
74888
+ return isClaudeInstalled && !existingStatusLine && settings.installation ? settings.installation : classifyInstallation(existingStatusLine, settings.installation);
74889
+ }
74890
+ function trimTrailingSeparators2(filePath) {
74891
+ return filePath.replace(/[\\/]+$/, "");
74892
+ }
74893
+ function joinCommandPath(dir, command) {
74894
+ const separator = dir.includes("\\") && !dir.includes("/") ? "\\" : "/";
74895
+ return `${trimTrailingSeparators2(dir)}${separator}${command}`;
74896
+ }
74897
+ function getCommandFileName(globalBinDir, platform5) {
74898
+ if (platform5 === "win32" || /^[a-z]:[\\/]/i.test(globalBinDir)) {
74899
+ return "ccstatusline.cmd";
74900
+ }
74901
+ return "ccstatusline";
74902
+ }
74903
+ function getPinnedGlobalRelaunchCommand(packageManager) {
74904
+ const resolution = inspectGlobalCommandResolution(packageManager);
74905
+ if (resolution.firstResolvedPath && (!resolution.expectedBinDir || isPathInsideDir(resolution.firstResolvedPath, resolution.expectedBinDir))) {
74906
+ return resolution.firstResolvedPath;
74907
+ }
74908
+ if (resolution.expectedBinDir) {
74909
+ return joinCommandPath(resolution.expectedBinDir, getCommandFileName(resolution.expectedBinDir, process.platform));
74910
+ }
74911
+ return "ccstatusline";
74912
+ }
74913
+ function getPinnedVersionMismatch(installation, runningVersion, relaunchCommand) {
74914
+ if (installation.method !== "pinned" || !installation.installedVersion || installation.packageManager === "unknown" || !runningVersion || installation.installedVersion === runningVersion) {
74915
+ return null;
74916
+ }
74917
+ return {
74918
+ packageManager: installation.packageManager,
74919
+ installedVersion: installation.installedVersion,
74920
+ runningVersion,
74921
+ relaunchCommand,
74922
+ canUpdateToRunningVersion: compareVersions(runningVersion, installation.installedVersion) > 0
74923
+ };
74924
+ }
74925
+ function getPathInferredInstallation(installation, activeCommand) {
74926
+ if (installation.method === "pinned") {
74927
+ return {
74928
+ ...installation,
74929
+ packageManager: activeCommand?.packageManager ?? "unknown",
74930
+ installedVersion: activeCommand?.version ?? installation.installedVersion
74931
+ };
74932
+ }
74933
+ if (activeCommand && activeCommand.packageManager !== "unknown" && installation.method === "self-managed") {
74934
+ return {
74935
+ ...installation,
74936
+ packageManager: activeCommand.packageManager
74937
+ };
74938
+ }
74939
+ return installation;
74940
+ }
73526
74941
  function getConfirmCancelScreen(confirmDialog) {
73527
74942
  return confirmDialog?.cancelScreen ?? "main";
73528
74943
  }
73529
74944
  function clearInstallMenuSelection(menuSelections) {
73530
- if (menuSelections.install === undefined) {
74945
+ if (menuSelections.install === undefined && menuSelections.installPackage === undefined) {
73531
74946
  return menuSelections;
73532
74947
  }
73533
74948
  const next = { ...menuSelections };
73534
74949
  delete next.install;
74950
+ delete next.installPackage;
73535
74951
  return next;
73536
74952
  }
73537
74953
  var App2 = () => {
73538
74954
  const { exit } = use_app_default();
73539
- const [settings, setSettings] = import_react50.useState(null);
73540
- const [originalSettings, setOriginalSettings] = import_react50.useState(null);
73541
- const [hasChanges, setHasChanges] = import_react50.useState(false);
73542
- const [screen, setScreen] = import_react50.useState("main");
73543
- const [selectedLine, setSelectedLine] = import_react50.useState(0);
73544
- const [menuSelections, setMenuSelections] = import_react50.useState({});
73545
- const [confirmDialog, setConfirmDialog] = import_react50.useState(null);
73546
- const [isClaudeInstalled, setIsClaudeInstalled] = import_react50.useState(false);
73547
- const [terminalWidth, setTerminalWidth] = import_react50.useState(process.stdout.columns || 80);
73548
- const [powerlineFontStatus, setPowerlineFontStatus] = import_react50.useState({ installed: false });
73549
- const [installingFonts, setInstallingFonts] = import_react50.useState(false);
73550
- const [fontInstallMessage, setFontInstallMessage] = import_react50.useState(null);
73551
- const [existingStatusLine, setExistingStatusLine] = import_react50.useState(null);
73552
- const [flashMessage, setFlashMessage] = import_react50.useState(null);
73553
- const [previewIsTruncated, setPreviewIsTruncated] = import_react50.useState(false);
73554
- const [currentRefreshInterval, setCurrentRefreshInterval] = import_react50.useState(null);
73555
- const [supportsRefreshInterval] = import_react50.useState(() => isClaudeCodeVersionAtLeast("2.1.97"));
73556
- import_react50.useEffect(() => {
74955
+ const [settings, setSettings] = import_react51.useState(null);
74956
+ const [originalSettings, setOriginalSettings] = import_react51.useState(null);
74957
+ const [hasChanges, setHasChanges] = import_react51.useState(false);
74958
+ const [screen, setScreen] = import_react51.useState("main");
74959
+ const [selectedLine, setSelectedLine] = import_react51.useState(0);
74960
+ const [menuSelections, setMenuSelections] = import_react51.useState({});
74961
+ const [confirmDialog, setConfirmDialog] = import_react51.useState(null);
74962
+ const [isClaudeInstalled, setIsClaudeInstalled] = import_react51.useState(false);
74963
+ const [terminalWidth, setTerminalWidth] = import_react51.useState(process.stdout.columns || 80);
74964
+ const [powerlineFontStatus, setPowerlineFontStatus] = import_react51.useState({ installed: false });
74965
+ const [installingFonts, setInstallingFonts] = import_react51.useState(false);
74966
+ const [fontInstallMessage, setFontInstallMessage] = import_react51.useState(null);
74967
+ const [existingStatusLine, setExistingStatusLine] = import_react51.useState(null);
74968
+ const [flashMessage, setFlashMessage] = import_react51.useState(null);
74969
+ const [previewIsTruncated, setPreviewIsTruncated] = import_react51.useState(false);
74970
+ const [currentRefreshInterval, setCurrentRefreshInterval] = import_react51.useState(null);
74971
+ const [supportsRefreshInterval] = import_react51.useState(() => isClaudeCodeVersionAtLeast("2.1.97"));
74972
+ const [commandAvailability] = import_react51.useState(() => getPackageCommandAvailability());
74973
+ const [updateCheckerState, setUpdateCheckerState] = import_react51.useState({ status: "checking" });
74974
+ const [flowNotice, setFlowNotice] = import_react51.useState(null);
74975
+ const [globalPackageInstallations, setGlobalPackageInstallations] = import_react51.useState([]);
74976
+ const [updatesReturnScreen, setUpdatesReturnScreen] = import_react51.useState("main");
74977
+ const [hasLoadedClaudeStatus, setHasLoadedClaudeStatus] = import_react51.useState(false);
74978
+ const [hasLoadedInstalledState, setHasLoadedInstalledState] = import_react51.useState(false);
74979
+ import_react51.useEffect(() => {
73557
74980
  loadClaudeStatusLineState().then((statusLineState) => {
73558
74981
  setExistingStatusLine(statusLineState.existingStatusLine);
73559
74982
  setCurrentRefreshInterval(statusLineState.refreshInterval);
74983
+ }).catch(() => {
74984
+ setExistingStatusLine(null);
74985
+ setCurrentRefreshInterval(null);
74986
+ }).finally(() => {
74987
+ setHasLoadedClaudeStatus(true);
73560
74988
  });
73561
74989
  loadSettings().then((loadedSettings) => {
73562
74990
  source_default.level = loadedSettings.colorLevel;
73563
74991
  setSettings(loadedSettings);
73564
74992
  setOriginalSettings(cloneSettings(loadedSettings));
73565
74993
  });
73566
- isInstalled().then(setIsClaudeInstalled);
74994
+ isInstalled().then(setIsClaudeInstalled).catch(() => {
74995
+ setIsClaudeInstalled(false);
74996
+ }).finally(() => {
74997
+ setHasLoadedInstalledState(true);
74998
+ });
73567
74999
  const fontStatus = checkPowerlineFonts();
73568
75000
  setPowerlineFontStatus(fontStatus);
73569
75001
  checkPowerlineFontsAsync().then((asyncStatus) => {
@@ -73577,13 +75009,13 @@ var App2 = () => {
73577
75009
  process.stdout.off("resize", handleResize);
73578
75010
  };
73579
75011
  }, []);
73580
- import_react50.useEffect(() => {
75012
+ import_react51.useEffect(() => {
73581
75013
  if (originalSettings) {
73582
75014
  const hasAnyChanges = JSON.stringify(settings) !== JSON.stringify(originalSettings);
73583
75015
  setHasChanges(hasAnyChanges);
73584
75016
  }
73585
75017
  }, [settings, originalSettings]);
73586
- import_react50.useEffect(() => {
75018
+ import_react51.useEffect(() => {
73587
75019
  if (flashMessage) {
73588
75020
  const timer = setTimeout(() => {
73589
75021
  setFlashMessage(null);
@@ -73598,6 +75030,13 @@ var App2 = () => {
73598
75030
  exit();
73599
75031
  }
73600
75032
  if (key.ctrl && input === "s" && settings) {
75033
+ const installation = getCurrentInstallation(isClaudeInstalled, existingStatusLine, settings);
75034
+ const activeCommand = installation.method === "pinned" || installation.method === "self-managed" ? inspectActiveGlobalCommand({ commandAvailability }) : null;
75035
+ const effectiveInstallation2 = getPathInferredInstallation(installation, activeCommand);
75036
+ const mismatch = getPinnedVersionMismatch(effectiveInstallation2, getPackageVersion(), "ccstatusline");
75037
+ if (mismatch) {
75038
+ return;
75039
+ }
73601
75040
  (async () => {
73602
75041
  await saveSettings(settings);
73603
75042
  setOriginalSettings(cloneSettings(settings));
@@ -73609,73 +75048,276 @@ var App2 = () => {
73609
75048
  })();
73610
75049
  }
73611
75050
  });
73612
- const handleInstallSelection = import_react50.useCallback((command, displayName, useBunx) => {
75051
+ const getGlobalResolutionWarning = import_react51.useCallback((packageManager) => inspectGlobalCommandResolution(packageManager).warning, []);
75052
+ const handleInstallSelection = import_react51.useCallback((selection) => {
73613
75053
  getExistingStatusLine().then((existing) => {
73614
75054
  const isAlreadyInstalled = isKnownCommand(existing ?? "");
73615
- let message;
75055
+ const finalCommand = buildStatusLineCommand(selection.commandMode);
75056
+ const hookCommand = `${finalCommand} --hook`;
75057
+ const sideEffects = [
75058
+ `Claude settings path: ${getClaudeSettingsPath()}`,
75059
+ ...selection.globalInstallCommand ? [`Global install command before settings write: ${selection.globalInstallCommand}`] : [],
75060
+ `Final statusLine.command: ${finalCommand}`,
75061
+ `Hook command behavior: hook-enabled widgets run ${hookCommand}`
75062
+ ];
75063
+ let message = sideEffects.join(`
75064
+ `);
73616
75065
  if (existing && !isAlreadyInstalled) {
73617
- message = `This will modify ${getClaudeSettingsPath()}
75066
+ message = `A status line is already configured: "${existing}"
73618
75067
 
73619
- A status line is already configured: "${existing}"
73620
- Replace it with ${command}?`;
75068
+ ${message}
75069
+
75070
+ Replace it?`;
73621
75071
  } else if (isAlreadyInstalled) {
73622
- message = `ccstatusline is already installed in ${getClaudeSettingsPath()}
73623
- Update it with ${command}?`;
75072
+ message = `ccstatusline is already installed.
75073
+
75074
+ ${message}
75075
+
75076
+ Update it?`;
73624
75077
  } else {
73625
- message = `This will modify ${getClaudeSettingsPath()} to add ccstatusline with ${displayName}.
75078
+ message = `${message}
75079
+
73626
75080
  Continue?`;
73627
75081
  }
73628
75082
  setConfirmDialog({
73629
75083
  message,
73630
75084
  cancelScreen: "install",
73631
75085
  action: async () => {
73632
- await installStatusLine(useBunx, supportsRefreshInterval);
73633
- const installedStatusLineState = await loadClaudeStatusLineState();
73634
- setIsClaudeInstalled(true);
73635
- setExistingStatusLine(installedStatusLineState.existingStatusLine ?? command);
73636
- setCurrentRefreshInterval(installedStatusLineState.refreshInterval);
73637
- setScreen("main");
75086
+ try {
75087
+ if (selection.globalInstallCommand) {
75088
+ await runGlobalPackageInstall(selection.packageManager, getPackageVersion());
75089
+ }
75090
+ await installStatusLine({
75091
+ commandMode: selection.commandMode,
75092
+ supportsRefreshInterval,
75093
+ installationMetadata: selection.metadata
75094
+ });
75095
+ const installedStatusLineState = await loadClaudeStatusLineState();
75096
+ setIsClaudeInstalled(true);
75097
+ setExistingStatusLine(installedStatusLineState.existingStatusLine ?? finalCommand);
75098
+ setCurrentRefreshInterval(installedStatusLineState.refreshInterval);
75099
+ setSettings((prev) => prev ? { ...prev, installation: selection.metadata } : prev);
75100
+ setOriginalSettings((prev) => prev ? { ...prev, installation: selection.metadata } : prev);
75101
+ setMenuSelections((prev) => ({
75102
+ ...prev,
75103
+ main: getMainMenuInstallSelectionIndex(true, selection.metadata)
75104
+ }));
75105
+ const resolutionWarning = selection.globalInstallCommand ? getGlobalResolutionWarning(selection.packageManager) : null;
75106
+ if (resolutionWarning) {
75107
+ setFlashMessage(null);
75108
+ setFlowNotice({
75109
+ title: "Install Complete",
75110
+ message: `Installed to Claude Code.
75111
+
75112
+ ${resolutionWarning}`,
75113
+ color: "yellow",
75114
+ continueScreen: "main"
75115
+ });
75116
+ setScreen("flowNotice");
75117
+ } else {
75118
+ setScreen("main");
75119
+ setFlashMessage({
75120
+ text: "✓ Installed to Claude Code",
75121
+ color: "green"
75122
+ });
75123
+ }
75124
+ } catch {
75125
+ setFlashMessage({
75126
+ text: "✗ Install failed",
75127
+ color: "red"
75128
+ });
75129
+ setScreen("install");
75130
+ }
73638
75131
  setConfirmDialog(null);
73639
75132
  }
73640
75133
  });
73641
75134
  setScreen("confirm");
73642
75135
  });
73643
- }, [supportsRefreshInterval]);
73644
- const handleNpxInstall = import_react50.useCallback(() => {
73645
- setMenuSelections((prev) => ({ ...prev, install: 0 }));
73646
- handleInstallSelection(CCSTATUSLINE_COMMANDS.NPM, "npx", false);
73647
- }, [handleInstallSelection]);
73648
- const handleBunxInstall = import_react50.useCallback(() => {
73649
- setMenuSelections((prev) => ({ ...prev, install: 1 }));
73650
- handleInstallSelection(CCSTATUSLINE_COMMANDS.BUNX, "bunx", true);
73651
- }, [handleInstallSelection]);
73652
- const handleInstallMenuCancel = import_react50.useCallback(() => {
75136
+ }, [getGlobalResolutionWarning, supportsRefreshInterval]);
75137
+ const handleInstallMenuCancel = import_react51.useCallback(() => {
73653
75138
  setMenuSelections(clearInstallMenuSelection);
73654
75139
  setScreen("main");
73655
75140
  }, []);
73656
- if (!settings) {
73657
- return /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text, {
75141
+ const handleUpdateCheck = import_react51.useCallback(() => {
75142
+ setUpdateCheckerState({ status: "checking" });
75143
+ const installation = settings ? getCurrentInstallation(isClaudeInstalled, existingStatusLine, settings) : classifyInstallation(existingStatusLine, undefined);
75144
+ const activeCommand = installation.method === "pinned" || installation.method === "self-managed" ? inspectActiveGlobalCommand({ commandAvailability }) : null;
75145
+ const effectiveUpdateInstallation = getPathInferredInstallation(installation, activeCommand);
75146
+ const currentUpdateVersion = effectiveUpdateInstallation.method === "pinned" && effectiveUpdateInstallation.installedVersion ? effectiveUpdateInstallation.installedVersion : getPackageVersion();
75147
+ checkForUpdates({
75148
+ currentVersion: currentUpdateVersion,
75149
+ installedCommand: existingStatusLine,
75150
+ installationMetadata: effectiveUpdateInstallation,
75151
+ commandAvailability
75152
+ }).then(setUpdateCheckerState);
75153
+ }, [commandAvailability, existingStatusLine, isClaudeInstalled, settings]);
75154
+ const handleRunUpdateAction = import_react51.useCallback((action) => {
75155
+ setConfirmDialog({
75156
+ message: `Run global update command?
75157
+
75158
+ ${action.command}
75159
+
75160
+ Claude settings will not be changed.`,
75161
+ cancelScreen: "updates",
75162
+ action: async () => {
75163
+ try {
75164
+ await runGlobalUpdateAction(action);
75165
+ const installation = {
75166
+ method: "pinned",
75167
+ installedVersion: action.version
75168
+ };
75169
+ await saveInstallationMetadata(installation);
75170
+ setSettings((prev) => prev ? { ...prev, installation } : prev);
75171
+ setOriginalSettings((prev) => prev ? { ...prev, installation } : prev);
75172
+ const resolutionWarning = getGlobalResolutionWarning(action.packageManager);
75173
+ if (resolutionWarning) {
75174
+ setFlashMessage(null);
75175
+ setFlowNotice({
75176
+ title: "Update Complete",
75177
+ message: `Global package updated.
75178
+
75179
+ ${resolutionWarning}`,
75180
+ color: "yellow",
75181
+ continueScreen: "updates"
75182
+ });
75183
+ setScreen("flowNotice");
75184
+ } else {
75185
+ setFlashMessage({
75186
+ text: "✓ Global package updated",
75187
+ color: "green"
75188
+ });
75189
+ setScreen("updates");
75190
+ }
75191
+ } catch {
75192
+ setFlashMessage({
75193
+ text: "✗ Global update failed",
75194
+ color: "red"
75195
+ });
75196
+ setScreen("updates");
75197
+ }
75198
+ setConfirmDialog(null);
75199
+ }
75200
+ });
75201
+ setScreen("confirm");
75202
+ }, [getGlobalResolutionWarning]);
75203
+ if (!settings || !hasLoadedClaudeStatus || !hasLoadedInstalledState) {
75204
+ return /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
73658
75205
  children: "Loading settings..."
73659
75206
  }, undefined, false, undefined, this);
73660
75207
  }
73661
- const handleInstallUninstall = () => {
73662
- if (isClaudeInstalled) {
73663
- setConfirmDialog({
73664
- message: `This will remove ccstatusline from ${getClaudeSettingsPath()}. Continue?`,
73665
- action: async () => {
75208
+ const runningVersion = getPackageVersion();
75209
+ const currentInstallation = getCurrentInstallation(isClaudeInstalled, existingStatusLine, settings);
75210
+ const activeGlobalCommand = currentInstallation.method === "pinned" || currentInstallation.method === "self-managed" ? inspectActiveGlobalCommand({ commandAvailability }) : null;
75211
+ const effectiveInstallation = getPathInferredInstallation(currentInstallation, activeGlobalCommand);
75212
+ const pinnedVersionMismatch = effectiveInstallation.method === "pinned" && effectiveInstallation.packageManager !== "unknown" ? getPinnedVersionMismatch(effectiveInstallation, runningVersion, getPinnedGlobalRelaunchCommand(effectiveInstallation.packageManager)) : null;
75213
+ const handlePinnedVersionMismatchUpdate = async (mismatch) => {
75214
+ try {
75215
+ await runGlobalPackageInstall(mismatch.packageManager, mismatch.runningVersion);
75216
+ const installation = {
75217
+ method: "pinned",
75218
+ installedVersion: mismatch.runningVersion
75219
+ };
75220
+ await saveInstallationMetadata(installation);
75221
+ setSettings((prev) => prev ? { ...prev, installation } : prev);
75222
+ setOriginalSettings((prev) => prev ? { ...prev, installation } : prev);
75223
+ const resolutionWarning = getGlobalResolutionWarning(mismatch.packageManager);
75224
+ if (resolutionWarning) {
75225
+ setFlashMessage(null);
75226
+ setFlowNotice({
75227
+ title: "Update Complete",
75228
+ message: `Global package updated.
75229
+
75230
+ ${resolutionWarning}`,
75231
+ color: "yellow",
75232
+ continueScreen: "main"
75233
+ });
75234
+ setScreen("flowNotice");
75235
+ } else {
75236
+ setFlashMessage({
75237
+ text: "✓ Global package updated",
75238
+ color: "green"
75239
+ });
75240
+ setScreen("main");
75241
+ }
75242
+ } catch {
75243
+ setFlashMessage({
75244
+ text: "✗ Global update failed",
75245
+ color: "red"
75246
+ });
75247
+ }
75248
+ };
75249
+ const handleUninstallSelection = (selection, cancelScreen) => {
75250
+ setConfirmDialog({
75251
+ message: buildUninstallConfirmMessage(selection),
75252
+ cancelScreen,
75253
+ action: async () => {
75254
+ let removedClaudeSettings = false;
75255
+ try {
73666
75256
  await uninstallStatusLine();
75257
+ removedClaudeSettings = true;
75258
+ for (const packageManager of selection.packageManagers) {
75259
+ await runGlobalPackageUninstall(packageManager);
75260
+ }
73667
75261
  setIsClaudeInstalled(false);
73668
75262
  setExistingStatusLine(null);
73669
75263
  setCurrentRefreshInterval(null);
75264
+ setSettings(clearInstallationMetadata);
75265
+ setOriginalSettings(clearInstallationMetadata);
75266
+ setMenuSelections((prev) => ({
75267
+ ...prev,
75268
+ main: getMainMenuInstallSelectionIndex(false)
75269
+ }));
75270
+ setFlashMessage({
75271
+ text: selection.packageManagers.length > 0 ? "✓ Uninstalled from Claude Code and removed global package" : "✓ Uninstalled from Claude Code",
75272
+ color: "green"
75273
+ });
73670
75274
  setScreen("main");
73671
- setConfirmDialog(null);
75275
+ } catch {
75276
+ if (removedClaudeSettings) {
75277
+ setIsClaudeInstalled(false);
75278
+ setExistingStatusLine(null);
75279
+ setCurrentRefreshInterval(null);
75280
+ setSettings(clearInstallationMetadata);
75281
+ setOriginalSettings(clearInstallationMetadata);
75282
+ setMenuSelections((prev) => ({
75283
+ ...prev,
75284
+ main: getMainMenuInstallSelectionIndex(false)
75285
+ }));
75286
+ setFlashMessage({
75287
+ text: "✗ Removed Claude settings, but global package removal failed",
75288
+ color: "red"
75289
+ });
75290
+ setScreen("main");
75291
+ } else {
75292
+ setFlashMessage({
75293
+ text: "✗ Uninstall failed",
75294
+ color: "red"
75295
+ });
75296
+ setScreen(cancelScreen);
75297
+ }
73672
75298
  }
73673
- });
73674
- setScreen("confirm");
75299
+ setConfirmDialog(null);
75300
+ }
75301
+ });
75302
+ setScreen("confirm");
75303
+ };
75304
+ const handleInstallUninstall = () => {
75305
+ if (isClaudeInstalled) {
75306
+ handleUninstallSelection({ packageManagers: [] }, "main");
73675
75307
  } else {
73676
75308
  setScreen("install");
73677
75309
  }
73678
75310
  };
75311
+ const handleManageInstallationSelect = (action) => {
75312
+ if (action === "checkUpdates") {
75313
+ setUpdatesReturnScreen("manageInstallation");
75314
+ setScreen("updates");
75315
+ handleUpdateCheck();
75316
+ return;
75317
+ }
75318
+ setGlobalPackageInstallations(inspectGlobalPackageInstallations({ commandAvailability }));
75319
+ setScreen("uninstallOptions");
75320
+ };
73679
75321
  const handleMainMenuSelect = async (value) => {
73680
75322
  switch (value) {
73681
75323
  case "lines":
@@ -73696,6 +75338,14 @@ Continue?`;
73696
75338
  case "install":
73697
75339
  handleInstallUninstall();
73698
75340
  break;
75341
+ case "manageInstallation":
75342
+ setScreen("manageInstallation");
75343
+ break;
75344
+ case "checkUpdates":
75345
+ setUpdatesReturnScreen("main");
75346
+ setScreen("updates");
75347
+ handleUpdateCheck();
75348
+ break;
73699
75349
  case "configureStatusLine":
73700
75350
  setScreen("refreshInterval");
73701
75351
  break;
@@ -73735,6 +75385,42 @@ ${GITHUB_REPO_URL}`,
73735
75385
  break;
73736
75386
  }
73737
75387
  };
75388
+ if (pinnedVersionMismatch) {
75389
+ return /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Box_default, {
75390
+ flexDirection: "column",
75391
+ children: [
75392
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Box_default, {
75393
+ marginBottom: 1,
75394
+ children: [
75395
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
75396
+ bold: true,
75397
+ children: /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(dist_default5, {
75398
+ name: "retro",
75399
+ children: "CCStatusline Configuration"
75400
+ }, undefined, false, undefined, this)
75401
+ }, undefined, false, undefined, this),
75402
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
75403
+ bold: true,
75404
+ children: ` | ${runningVersion && `v${runningVersion}`}`
75405
+ }, undefined, false, undefined, this),
75406
+ flashMessage && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
75407
+ color: flashMessage.color,
75408
+ bold: true,
75409
+ children: ` ${flashMessage.text}`
75410
+ }, undefined, false, undefined, this)
75411
+ ]
75412
+ }, undefined, true, undefined, this),
75413
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(PinnedVersionMismatchScreen, {
75414
+ mismatch: pinnedVersionMismatch,
75415
+ canRunPackageManager: commandAvailability[pinnedVersionMismatch.packageManager],
75416
+ onUpdate: () => {
75417
+ handlePinnedVersionMismatchUpdate(pinnedVersionMismatch);
75418
+ },
75419
+ onExit: exit
75420
+ }, undefined, false, undefined, this)
75421
+ ]
75422
+ }, undefined, true, undefined, this);
75423
+ }
73738
75424
  const updateLine = (lineIndex, widgets) => {
73739
75425
  const newLines = [...settings.lines];
73740
75426
  newLines[lineIndex] = widgets;
@@ -73747,44 +75433,44 @@ ${GITHUB_REPO_URL}`,
73747
75433
  setSelectedLine(lineIndex);
73748
75434
  setScreen("items");
73749
75435
  };
73750
- return /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Box_default, {
75436
+ return /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Box_default, {
73751
75437
  flexDirection: "column",
73752
75438
  children: [
73753
- /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Box_default, {
75439
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Box_default, {
73754
75440
  marginBottom: 1,
73755
75441
  children: [
73756
- /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text, {
75442
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
73757
75443
  bold: true,
73758
- children: /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(dist_default5, {
75444
+ children: /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(dist_default5, {
73759
75445
  name: "retro",
73760
75446
  children: "CCStatusline Configuration"
73761
75447
  }, undefined, false, undefined, this)
73762
75448
  }, undefined, false, undefined, this),
73763
- /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text, {
75449
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
73764
75450
  bold: true,
73765
- children: ` | ${getPackageVersion() && `v${getPackageVersion()}`}`
75451
+ children: ` | ${runningVersion && `v${runningVersion}`}`
73766
75452
  }, undefined, false, undefined, this),
73767
- flashMessage && /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text, {
75453
+ flashMessage && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
73768
75454
  color: flashMessage.color,
73769
75455
  bold: true,
73770
75456
  children: ` ${flashMessage.text}`
73771
75457
  }, undefined, false, undefined, this)
73772
75458
  ]
73773
75459
  }, undefined, true, undefined, this),
73774
- isCustomConfigPath() && /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Text, {
75460
+ isCustomConfigPath() && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Text, {
73775
75461
  dimColor: true,
73776
75462
  children: `Config: ${getConfigPath()}`
73777
75463
  }, undefined, false, undefined, this),
73778
- /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(StatusLinePreview, {
75464
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(StatusLinePreview, {
73779
75465
  lines: settings.lines,
73780
75466
  terminalWidth,
73781
75467
  settings,
73782
75468
  onTruncationChange: setPreviewIsTruncated
73783
75469
  }, undefined, false, undefined, this),
73784
- /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(Box_default, {
75470
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(Box_default, {
73785
75471
  marginTop: 1,
73786
75472
  children: [
73787
- screen === "main" && /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(MainMenu, {
75473
+ screen === "main" && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(MainMenu, {
73788
75474
  onSelect: (value, index) => {
73789
75475
  if (value !== "save" && value !== "exit") {
73790
75476
  setMenuSelections((prev) => ({ ...prev, main: index }));
@@ -73796,9 +75482,10 @@ ${GITHUB_REPO_URL}`,
73796
75482
  initialSelection: menuSelections.main,
73797
75483
  powerlineFontStatus,
73798
75484
  settings,
75485
+ installation: effectiveInstallation,
73799
75486
  previewIsTruncated
73800
75487
  }, undefined, false, undefined, this),
73801
- screen === "lines" && /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(LineSelector, {
75488
+ screen === "lines" && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(LineSelector, {
73802
75489
  lines: settings.lines,
73803
75490
  onSelect: (line) => {
73804
75491
  setMenuSelections((prev) => ({ ...prev, lines: line }));
@@ -73813,7 +75500,7 @@ ${GITHUB_REPO_URL}`,
73813
75500
  title: "Select Line to Edit Items",
73814
75501
  allowEditing: true
73815
75502
  }, undefined, false, undefined, this),
73816
- screen === "items" && /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(ItemsEditor, {
75503
+ screen === "items" && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(ItemsEditor, {
73817
75504
  widgets: settings.lines[selectedLine] ?? [],
73818
75505
  onUpdate: (widgets) => {
73819
75506
  updateLine(selectedLine, widgets);
@@ -73825,7 +75512,7 @@ ${GITHUB_REPO_URL}`,
73825
75512
  lineNumber: selectedLine + 1,
73826
75513
  settings
73827
75514
  }, undefined, false, undefined, this),
73828
- screen === "colorLines" && /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(LineSelector, {
75515
+ screen === "colorLines" && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(LineSelector, {
73829
75516
  lines: settings.lines,
73830
75517
  onLinesUpdate: updateLines,
73831
75518
  onSelect: (line) => {
@@ -73843,7 +75530,7 @@ ${GITHUB_REPO_URL}`,
73843
75530
  settings,
73844
75531
  allowEditing: false
73845
75532
  }, undefined, false, undefined, this),
73846
- screen === "colors" && /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(ColorMenu, {
75533
+ screen === "colors" && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(ColorMenu, {
73847
75534
  widgets: settings.lines[selectedLine] ?? [],
73848
75535
  lineIndex: selectedLine,
73849
75536
  settings,
@@ -73856,7 +75543,7 @@ ${GITHUB_REPO_URL}`,
73856
75543
  setScreen("colorLines");
73857
75544
  }
73858
75545
  }, undefined, false, undefined, this),
73859
- screen === "terminalConfig" && /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(TerminalOptionsMenu, {
75546
+ screen === "terminalConfig" && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(TerminalOptionsMenu, {
73860
75547
  settings,
73861
75548
  onUpdate: (updatedSettings) => {
73862
75549
  setSettings(updatedSettings);
@@ -73870,7 +75557,7 @@ ${GITHUB_REPO_URL}`,
73870
75557
  }
73871
75558
  }
73872
75559
  }, undefined, false, undefined, this),
73873
- screen === "terminalWidth" && /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(TerminalWidthMenu, {
75560
+ screen === "terminalWidth" && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(TerminalWidthMenu, {
73874
75561
  settings,
73875
75562
  onUpdate: (updatedSettings) => {
73876
75563
  setSettings(updatedSettings);
@@ -73879,7 +75566,7 @@ ${GITHUB_REPO_URL}`,
73879
75566
  setScreen("terminalConfig");
73880
75567
  }
73881
75568
  }, undefined, false, undefined, this),
73882
- screen === "globalOverrides" && /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(GlobalOverridesMenu, {
75569
+ screen === "globalOverrides" && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(GlobalOverridesMenu, {
73883
75570
  settings,
73884
75571
  onUpdate: (updatedSettings) => {
73885
75572
  setSettings(updatedSettings);
@@ -73889,7 +75576,7 @@ ${GITHUB_REPO_URL}`,
73889
75576
  setScreen("main");
73890
75577
  }
73891
75578
  }, undefined, false, undefined, this),
73892
- screen === "confirm" && confirmDialog && /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(ConfirmDialog, {
75579
+ screen === "confirm" && confirmDialog && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(ConfirmDialog, {
73893
75580
  message: confirmDialog.message,
73894
75581
  onConfirm: () => void confirmDialog.action(),
73895
75582
  onCancel: () => {
@@ -73897,15 +75584,57 @@ ${GITHUB_REPO_URL}`,
73897
75584
  setConfirmDialog(null);
73898
75585
  }
73899
75586
  }, undefined, false, undefined, this),
73900
- screen === "install" && /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(InstallMenu, {
73901
- bunxAvailable: isBunxAvailable(),
75587
+ screen === "flowNotice" && flowNotice && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(FlowNotice, {
75588
+ ...flowNotice,
75589
+ onContinue: () => {
75590
+ setScreen(flowNotice.continueScreen);
75591
+ setFlowNotice(null);
75592
+ }
75593
+ }, undefined, false, undefined, this),
75594
+ screen === "install" && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(InstallMenu, {
75595
+ commandAvailability,
75596
+ currentVersion: getPackageVersion(),
73902
75597
  existingStatusLine,
73903
- onSelectNpx: handleNpxInstall,
73904
- onSelectBunx: handleBunxInstall,
75598
+ onSelect: (selection) => {
75599
+ setMenuSelections((prev) => ({
75600
+ ...prev,
75601
+ installPackage: selection.packageManager === "bun" ? 1 : 0
75602
+ }));
75603
+ handleInstallSelection(selection);
75604
+ },
73905
75605
  onCancel: handleInstallMenuCancel,
73906
- initialSelection: menuSelections.install
75606
+ initialPackageSelection: menuSelections.installPackage
73907
75607
  }, undefined, false, undefined, this),
73908
- screen === "refreshInterval" && /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(RefreshIntervalMenu, {
75608
+ screen === "manageInstallation" && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(ManageInstallationMenu, {
75609
+ installation: effectiveInstallation,
75610
+ activeCommand: activeGlobalCommand,
75611
+ onSelect: handleManageInstallationSelect,
75612
+ onBack: () => {
75613
+ setMenuSelections((prev) => ({
75614
+ ...prev,
75615
+ main: getMainMenuInstallSelectionIndex(true, effectiveInstallation)
75616
+ }));
75617
+ setScreen("main");
75618
+ }
75619
+ }, undefined, false, undefined, this),
75620
+ screen === "uninstallOptions" && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(UninstallMenu, {
75621
+ installations: globalPackageInstallations,
75622
+ onSelect: (selection) => {
75623
+ handleUninstallSelection(selection, "uninstallOptions");
75624
+ },
75625
+ onBack: () => {
75626
+ setScreen("manageInstallation");
75627
+ }
75628
+ }, undefined, false, undefined, this),
75629
+ screen === "updates" && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(UpdateCheckerMenu, {
75630
+ state: updateCheckerState,
75631
+ onBack: () => {
75632
+ setScreen(updatesReturnScreen);
75633
+ },
75634
+ onRefresh: handleUpdateCheck,
75635
+ onRunAction: handleRunUpdateAction
75636
+ }, undefined, false, undefined, this),
75637
+ screen === "refreshInterval" && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(RefreshIntervalMenu, {
73909
75638
  currentInterval: currentRefreshInterval,
73910
75639
  supportsRefreshInterval,
73911
75640
  onUpdate: (interval) => {
@@ -73929,7 +75658,7 @@ ${GITHUB_REPO_URL}`,
73929
75658
  setScreen("main");
73930
75659
  }
73931
75660
  }, undefined, false, undefined, this),
73932
- screen === "powerline" && /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(PowerlineSetup, {
75661
+ screen === "powerline" && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(PowerlineSetup, {
73933
75662
  settings,
73934
75663
  powerlineFontStatus,
73935
75664
  onUpdate: (updatedSettings) => {
@@ -73963,7 +75692,7 @@ ${GITHUB_REPO_URL}`,
73963
75692
  };
73964
75693
  function runTUI() {
73965
75694
  process.stdout.write("\x1B[2J\x1B[H");
73966
- render_default(/* @__PURE__ */ jsx_dev_runtime25.jsxDEV(App2, {}, undefined, false, undefined, this));
75695
+ render_default(/* @__PURE__ */ jsx_dev_runtime27.jsxDEV(App2, {}, undefined, false, undefined, this));
73967
75696
  }
73968
75697
  // src/types/StatusJSON.ts
73969
75698
  init_zod();
@@ -74047,9 +75776,9 @@ init_colors();
74047
75776
  // src/utils/compaction.ts
74048
75777
  init_zod();
74049
75778
  import * as crypto from "crypto";
74050
- import * as fs13 from "fs";
75779
+ import * as fs14 from "fs";
74051
75780
  import * as os13 from "os";
74052
- import * as path10 from "path";
75781
+ import * as path11 from "path";
74053
75782
  var DEFAULT_DROP_THRESHOLD = 2;
74054
75783
  var FRESH_PREV_CTX_PCT = -1;
74055
75784
  var MAX_CACHE_FILE_BYTES = 4096;
@@ -74094,7 +75823,7 @@ function detectCompaction(currentCtxPct, state, options = DEFAULT_DROP_THRESHOLD
74094
75823
  };
74095
75824
  }
74096
75825
  function getCacheDir2() {
74097
- return path10.join(os13.homedir(), ".cache", "ccstatusline", "compaction");
75826
+ return path11.join(os13.homedir(), ".cache", "ccstatusline", "compaction");
74098
75827
  }
74099
75828
  function sanitizeSessionId(sessionId) {
74100
75829
  const sanitized = sessionId.replace(/[^a-zA-Z0-9_-]/g, "_");
@@ -74104,18 +75833,18 @@ function sanitizeSessionId(sessionId) {
74104
75833
  return sanitized;
74105
75834
  }
74106
75835
  function getStatePath(sessionId) {
74107
- return path10.join(getCacheDir2(), `compaction-${sanitizeSessionId(sessionId)}.json`);
75836
+ return path11.join(getCacheDir2(), `compaction-${sanitizeSessionId(sessionId)}.json`);
74108
75837
  }
74109
75838
  function loadCompactionState(sessionId) {
74110
75839
  const statePath = getStatePath(sessionId);
74111
75840
  let fd = null;
74112
75841
  try {
74113
- fd = fs13.openSync(statePath, fs13.constants.O_RDONLY | fs13.constants.O_NOFOLLOW);
74114
- const stats = fs13.fstatSync(fd);
75842
+ fd = fs14.openSync(statePath, fs14.constants.O_RDONLY | fs14.constants.O_NOFOLLOW);
75843
+ const stats = fs14.fstatSync(fd);
74115
75844
  if (!stats.isFile() || stats.size > MAX_CACHE_FILE_BYTES) {
74116
75845
  return FRESH;
74117
75846
  }
74118
- const raw = JSON.parse(fs13.readFileSync(fd, "utf-8"));
75847
+ const raw = JSON.parse(fs14.readFileSync(fd, "utf-8"));
74119
75848
  const result2 = CompactionStateSchema.safeParse(raw);
74120
75849
  return result2.success ? result2.data : FRESH;
74121
75850
  } catch {
@@ -74123,7 +75852,7 @@ function loadCompactionState(sessionId) {
74123
75852
  } finally {
74124
75853
  if (fd !== null) {
74125
75854
  try {
74126
- fs13.closeSync(fd);
75855
+ fs14.closeSync(fd);
74127
75856
  } catch {}
74128
75857
  }
74129
75858
  }
@@ -74132,19 +75861,19 @@ function saveCompactionState(sessionId, state) {
74132
75861
  let tmpPath = null;
74133
75862
  try {
74134
75863
  const dir = getCacheDir2();
74135
- if (!fs13.existsSync(dir)) {
74136
- fs13.mkdirSync(dir, { recursive: true });
75864
+ if (!fs14.existsSync(dir)) {
75865
+ fs14.mkdirSync(dir, { recursive: true });
74137
75866
  }
74138
75867
  const targetPath = getStatePath(sessionId);
74139
75868
  tmpPath = `${targetPath}.tmp.${process.pid}.${crypto.randomBytes(4).toString("hex")}`;
74140
- fs13.writeFileSync(tmpPath, JSON.stringify(state) + `
75869
+ fs14.writeFileSync(tmpPath, JSON.stringify(state) + `
74141
75870
  `);
74142
- fs13.renameSync(tmpPath, targetPath);
75871
+ fs14.renameSync(tmpPath, targetPath);
74143
75872
  tmpPath = null;
74144
75873
  } catch {
74145
75874
  if (tmpPath !== null) {
74146
75875
  try {
74147
- fs13.unlinkSync(tmpPath);
75876
+ fs14.unlinkSync(tmpPath);
74148
75877
  } catch {}
74149
75878
  }
74150
75879
  }
@@ -74155,27 +75884,27 @@ init_context_percentage();
74155
75884
  await init_config();
74156
75885
 
74157
75886
  // src/utils/hook-handler.ts
74158
- import * as fs15 from "fs";
74159
- import * as path12 from "path";
75887
+ import * as fs16 from "fs";
75888
+ import * as path13 from "path";
74160
75889
 
74161
75890
  // src/utils/skills.ts
74162
- import * as fs14 from "fs";
75891
+ import * as fs15 from "fs";
74163
75892
  import * as os14 from "os";
74164
- import * as path11 from "path";
75893
+ import * as path12 from "path";
74165
75894
  var EMPTY = { totalInvocations: 0, uniqueSkills: [], lastSkill: null };
74166
75895
  function getSkillsDir() {
74167
- return path11.join(os14.homedir(), ".cache", "ccstatusline", "skills");
75896
+ return path12.join(os14.homedir(), ".cache", "ccstatusline", "skills");
74168
75897
  }
74169
75898
  function getSkillsFilePath(sessionId) {
74170
- return path11.join(getSkillsDir(), `skills-${sessionId}.jsonl`);
75899
+ return path12.join(getSkillsDir(), `skills-${sessionId}.jsonl`);
74171
75900
  }
74172
75901
  function getSkillsMetrics(sessionId) {
74173
75902
  const filePath = getSkillsFilePath(sessionId);
74174
- if (!fs14.existsSync(filePath)) {
75903
+ if (!fs15.existsSync(filePath)) {
74175
75904
  return EMPTY;
74176
75905
  }
74177
75906
  try {
74178
- const invocations = fs14.readFileSync(filePath, "utf-8").trim().split(`
75907
+ const invocations = fs15.readFileSync(filePath, "utf-8").trim().split(`
74179
75908
  `).filter((line) => line.trim()).map((line) => {
74180
75909
  try {
74181
75910
  return JSON.parse(line);
@@ -74229,14 +75958,14 @@ function handleHookInput(input) {
74229
75958
  return;
74230
75959
  }
74231
75960
  const filePath = getSkillsFilePath(sessionId);
74232
- fs15.mkdirSync(path12.dirname(filePath), { recursive: true });
75961
+ fs16.mkdirSync(path13.dirname(filePath), { recursive: true });
74233
75962
  const entry = JSON.stringify({
74234
75963
  timestamp: new Date().toISOString(),
74235
75964
  session_id: sessionId,
74236
75965
  skill: skillName,
74237
75966
  source: data.hook_event_name
74238
75967
  });
74239
- fs15.appendFileSync(filePath, entry + `
75968
+ fs16.appendFileSync(filePath, entry + `
74240
75969
  `);
74241
75970
  } catch {}
74242
75971
  }
@@ -74379,8 +76108,8 @@ async function ensureWindowsUtf8CodePage() {
74379
76108
  return;
74380
76109
  }
74381
76110
  try {
74382
- const { execFileSync: execFileSync5 } = await import("child_process");
74383
- execFileSync5("chcp.com", ["65001"], { stdio: "ignore" });
76111
+ const { execFileSync: execFileSync7 } = await import("child_process");
76112
+ execFileSync7("chcp.com", ["65001"], { stdio: "ignore" });
74384
76113
  } catch {}
74385
76114
  }
74386
76115
  async function renderMultipleLines(data) {