codetyper-cli 0.4.4 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -7008,10 +7008,349 @@ var require_cli_width = __commonJS((exports, module) => {
7008
7008
  }
7009
7009
  });
7010
7010
 
7011
+ // node_modules/fast-string-truncated-width/dist/utils.js
7012
+ var getCodePointsLength, isFullWidth = (x) => {
7013
+ return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
7014
+ }, isWideNotCJKTNotEmoji = (x) => {
7015
+ return x === 8987 || x === 9001 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
7016
+ };
7017
+ var init_utils = __esm(() => {
7018
+ getCodePointsLength = (() => {
7019
+ const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
7020
+ return (input) => {
7021
+ let surrogatePairsNr = 0;
7022
+ SURROGATE_PAIR_RE.lastIndex = 0;
7023
+ while (SURROGATE_PAIR_RE.test(input)) {
7024
+ surrogatePairsNr += 1;
7025
+ }
7026
+ return input.length - surrogatePairsNr;
7027
+ };
7028
+ })();
7029
+ });
7030
+
7031
+ // node_modules/fast-string-truncated-width/dist/index.js
7032
+ var ANSI_RE, CONTROL_RE, CJKT_WIDE_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {
7033
+ const LIMIT = truncationOptions.limit ?? Infinity;
7034
+ const ELLIPSIS = truncationOptions.ellipsis ?? "";
7035
+ const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
7036
+ const ANSI_WIDTH = 0;
7037
+ const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
7038
+ const TAB_WIDTH = widthOptions.tabWidth ?? 8;
7039
+ const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
7040
+ const FULL_WIDTH_WIDTH = 2;
7041
+ const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
7042
+ const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
7043
+ const PARSE_BLOCKS = [
7044
+ [LATIN_RE, REGULAR_WIDTH],
7045
+ [ANSI_RE, ANSI_WIDTH],
7046
+ [CONTROL_RE, CONTROL_WIDTH],
7047
+ [TAB_RE, TAB_WIDTH],
7048
+ [EMOJI_RE, EMOJI_WIDTH],
7049
+ [CJKT_WIDE_RE, WIDE_WIDTH]
7050
+ ];
7051
+ let indexPrev = 0;
7052
+ let index = 0;
7053
+ let length = input.length;
7054
+ let lengthExtra = 0;
7055
+ let truncationEnabled = false;
7056
+ let truncationIndex = length;
7057
+ let truncationLimit = Math.max(0, LIMIT - ELLIPSIS_WIDTH);
7058
+ let unmatchedStart = 0;
7059
+ let unmatchedEnd = 0;
7060
+ let width = 0;
7061
+ let widthExtra = 0;
7062
+ outer:
7063
+ while (true) {
7064
+ if (unmatchedEnd > unmatchedStart || index >= length && index > indexPrev) {
7065
+ const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);
7066
+ lengthExtra = 0;
7067
+ for (const char of unmatched.replaceAll(MODIFIER_RE, "")) {
7068
+ const codePoint = char.codePointAt(0) || 0;
7069
+ if (isFullWidth(codePoint)) {
7070
+ widthExtra = FULL_WIDTH_WIDTH;
7071
+ } else if (isWideNotCJKTNotEmoji(codePoint)) {
7072
+ widthExtra = WIDE_WIDTH;
7073
+ } else {
7074
+ widthExtra = REGULAR_WIDTH;
7075
+ }
7076
+ if (width + widthExtra > truncationLimit) {
7077
+ truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
7078
+ }
7079
+ if (width + widthExtra > LIMIT) {
7080
+ truncationEnabled = true;
7081
+ break outer;
7082
+ }
7083
+ lengthExtra += char.length;
7084
+ width += widthExtra;
7085
+ }
7086
+ unmatchedStart = unmatchedEnd = 0;
7087
+ }
7088
+ if (index >= length) {
7089
+ break outer;
7090
+ }
7091
+ for (let i = 0, l = PARSE_BLOCKS.length;i < l; i++) {
7092
+ const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i];
7093
+ BLOCK_RE.lastIndex = index;
7094
+ if (BLOCK_RE.test(input)) {
7095
+ lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
7096
+ widthExtra = lengthExtra * BLOCK_WIDTH;
7097
+ if (width + widthExtra > truncationLimit) {
7098
+ truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
7099
+ }
7100
+ if (width + widthExtra > LIMIT) {
7101
+ truncationEnabled = true;
7102
+ break outer;
7103
+ }
7104
+ width += widthExtra;
7105
+ unmatchedStart = indexPrev;
7106
+ unmatchedEnd = index;
7107
+ index = indexPrev = BLOCK_RE.lastIndex;
7108
+ continue outer;
7109
+ }
7110
+ }
7111
+ index += 1;
7112
+ }
7113
+ return {
7114
+ width: truncationEnabled ? truncationLimit : width,
7115
+ index: truncationEnabled ? truncationIndex : length,
7116
+ truncated: truncationEnabled,
7117
+ ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH
7118
+ };
7119
+ }, dist_default2;
7120
+ var init_dist2 = __esm(() => {
7121
+ init_utils();
7122
+ ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
7123
+ CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
7124
+ CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu;
7125
+ TAB_RE = /\t{1,1000}/y;
7126
+ EMOJI_RE = /[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu;
7127
+ LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
7128
+ MODIFIER_RE = /\p{M}+/gu;
7129
+ NO_TRUNCATION = { limit: Infinity, ellipsis: "" };
7130
+ dist_default2 = getStringTruncatedWidth;
7131
+ });
7132
+
7133
+ // node_modules/fast-string-width/dist/index.js
7134
+ var NO_TRUNCATION2, fastStringWidth = (input, options = {}) => {
7135
+ return dist_default2(input, NO_TRUNCATION2, options).width;
7136
+ }, dist_default3;
7137
+ var init_dist3 = __esm(() => {
7138
+ init_dist2();
7139
+ NO_TRUNCATION2 = {
7140
+ limit: Infinity,
7141
+ ellipsis: "",
7142
+ ellipsisWidth: 0
7143
+ };
7144
+ dist_default3 = fastStringWidth;
7145
+ });
7146
+
7147
+ // node_modules/fast-wrap-ansi/lib/main.js
7148
+ function wrapAnsi2(string, columns, options) {
7149
+ return String(string).normalize().split(CRLF_OR_LF).map((line) => exec2(line, columns, options)).join(`
7150
+ `);
7151
+ }
7152
+ var ESC = "\x1B", CSI = "›", END_CODE2 = 39, ANSI_ESCAPE_BELL2 = "\x07", ANSI_CSI2 = "[", ANSI_OSC2 = "]", ANSI_SGR_TERMINATOR2 = "m", ANSI_ESCAPE_LINK2, GROUP_REGEX, getClosingCode = (openingCode) => {
7153
+ if (openingCode >= 30 && openingCode <= 37)
7154
+ return 39;
7155
+ if (openingCode >= 90 && openingCode <= 97)
7156
+ return 39;
7157
+ if (openingCode >= 40 && openingCode <= 47)
7158
+ return 49;
7159
+ if (openingCode >= 100 && openingCode <= 107)
7160
+ return 49;
7161
+ if (openingCode === 1 || openingCode === 2)
7162
+ return 22;
7163
+ if (openingCode === 3)
7164
+ return 23;
7165
+ if (openingCode === 4)
7166
+ return 24;
7167
+ if (openingCode === 7)
7168
+ return 27;
7169
+ if (openingCode === 8)
7170
+ return 28;
7171
+ if (openingCode === 9)
7172
+ return 29;
7173
+ if (openingCode === 0)
7174
+ return 0;
7175
+ return;
7176
+ }, wrapAnsiCode2 = (code) => `${ESC}${ANSI_CSI2}${code}${ANSI_SGR_TERMINATOR2}`, wrapAnsiHyperlink2 = (url) => `${ESC}${ANSI_ESCAPE_LINK2}${url}${ANSI_ESCAPE_BELL2}`, wrapWord2 = (rows, word, columns) => {
7177
+ const characters = word[Symbol.iterator]();
7178
+ let isInsideEscape = false;
7179
+ let isInsideLinkEscape = false;
7180
+ let lastRow = rows.at(-1);
7181
+ let visible = lastRow === undefined ? 0 : dist_default3(lastRow);
7182
+ let currentCharacter = characters.next();
7183
+ let nextCharacter = characters.next();
7184
+ let rawCharacterIndex = 0;
7185
+ while (!currentCharacter.done) {
7186
+ const character = currentCharacter.value;
7187
+ const characterLength = dist_default3(character);
7188
+ if (visible + characterLength <= columns) {
7189
+ rows[rows.length - 1] += character;
7190
+ } else {
7191
+ rows.push(character);
7192
+ visible = 0;
7193
+ }
7194
+ if (character === ESC || character === CSI) {
7195
+ isInsideEscape = true;
7196
+ isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK2, rawCharacterIndex + 1);
7197
+ }
7198
+ if (isInsideEscape) {
7199
+ if (isInsideLinkEscape) {
7200
+ if (character === ANSI_ESCAPE_BELL2) {
7201
+ isInsideEscape = false;
7202
+ isInsideLinkEscape = false;
7203
+ }
7204
+ } else if (character === ANSI_SGR_TERMINATOR2) {
7205
+ isInsideEscape = false;
7206
+ }
7207
+ } else {
7208
+ visible += characterLength;
7209
+ if (visible === columns && !nextCharacter.done) {
7210
+ rows.push("");
7211
+ visible = 0;
7212
+ }
7213
+ }
7214
+ currentCharacter = nextCharacter;
7215
+ nextCharacter = characters.next();
7216
+ rawCharacterIndex += character.length;
7217
+ }
7218
+ lastRow = rows.at(-1);
7219
+ if (!visible && lastRow !== undefined && lastRow.length && rows.length > 1) {
7220
+ rows[rows.length - 2] += rows.pop();
7221
+ }
7222
+ }, stringVisibleTrimSpacesRight2 = (string) => {
7223
+ const words = string.split(" ");
7224
+ let last = words.length;
7225
+ while (last) {
7226
+ if (dist_default3(words[last - 1])) {
7227
+ break;
7228
+ }
7229
+ last--;
7230
+ }
7231
+ if (last === words.length) {
7232
+ return string;
7233
+ }
7234
+ return words.slice(0, last).join(" ") + words.slice(last).join("");
7235
+ }, exec2 = (string, columns, options = {}) => {
7236
+ if (options.trim !== false && string.trim() === "") {
7237
+ return "";
7238
+ }
7239
+ let returnValue = "";
7240
+ let escapeCode;
7241
+ let escapeUrl;
7242
+ const words = string.split(" ");
7243
+ let rows = [""];
7244
+ let rowLength = 0;
7245
+ for (let index = 0;index < words.length; index++) {
7246
+ const word = words[index];
7247
+ if (options.trim !== false) {
7248
+ const row = rows.at(-1) ?? "";
7249
+ const trimmed = row.trimStart();
7250
+ if (row.length !== trimmed.length) {
7251
+ rows[rows.length - 1] = trimmed;
7252
+ rowLength = dist_default3(trimmed);
7253
+ }
7254
+ }
7255
+ if (index !== 0) {
7256
+ if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
7257
+ rows.push("");
7258
+ rowLength = 0;
7259
+ }
7260
+ if (rowLength || options.trim === false) {
7261
+ rows[rows.length - 1] += " ";
7262
+ rowLength++;
7263
+ }
7264
+ }
7265
+ const wordLength = dist_default3(word);
7266
+ if (options.hard && wordLength > columns) {
7267
+ const remainingColumns = columns - rowLength;
7268
+ const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);
7269
+ const breaksStartingNextLine = Math.floor((wordLength - 1) / columns);
7270
+ if (breaksStartingNextLine < breaksStartingThisLine) {
7271
+ rows.push("");
7272
+ }
7273
+ wrapWord2(rows, word, columns);
7274
+ rowLength = dist_default3(rows.at(-1) ?? "");
7275
+ continue;
7276
+ }
7277
+ if (rowLength + wordLength > columns && rowLength && wordLength) {
7278
+ if (options.wordWrap === false && rowLength < columns) {
7279
+ wrapWord2(rows, word, columns);
7280
+ rowLength = dist_default3(rows.at(-1) ?? "");
7281
+ continue;
7282
+ }
7283
+ rows.push("");
7284
+ rowLength = 0;
7285
+ }
7286
+ if (rowLength + wordLength > columns && options.wordWrap === false) {
7287
+ wrapWord2(rows, word, columns);
7288
+ rowLength = dist_default3(rows.at(-1) ?? "");
7289
+ continue;
7290
+ }
7291
+ rows[rows.length - 1] += word;
7292
+ rowLength += wordLength;
7293
+ }
7294
+ if (options.trim !== false) {
7295
+ rows = rows.map((row) => stringVisibleTrimSpacesRight2(row));
7296
+ }
7297
+ const preString = rows.join(`
7298
+ `);
7299
+ let inSurrogate = false;
7300
+ for (let i = 0;i < preString.length; i++) {
7301
+ const character = preString[i];
7302
+ returnValue += character;
7303
+ if (!inSurrogate) {
7304
+ inSurrogate = character >= "\uD800" && character <= "\uDBFF";
7305
+ if (inSurrogate) {
7306
+ continue;
7307
+ }
7308
+ } else {
7309
+ inSurrogate = false;
7310
+ }
7311
+ if (character === ESC || character === CSI) {
7312
+ GROUP_REGEX.lastIndex = i + 1;
7313
+ const groupsResult = GROUP_REGEX.exec(preString);
7314
+ const groups = groupsResult?.groups;
7315
+ if (groups?.code !== undefined) {
7316
+ const code = Number.parseFloat(groups.code);
7317
+ escapeCode = code === END_CODE2 ? undefined : code;
7318
+ } else if (groups?.uri !== undefined) {
7319
+ escapeUrl = groups.uri.length === 0 ? undefined : groups.uri;
7320
+ }
7321
+ }
7322
+ if (preString[i + 1] === `
7323
+ `) {
7324
+ if (escapeUrl) {
7325
+ returnValue += wrapAnsiHyperlink2("");
7326
+ }
7327
+ const closingCode = escapeCode ? getClosingCode(escapeCode) : undefined;
7328
+ if (escapeCode && closingCode) {
7329
+ returnValue += wrapAnsiCode2(closingCode);
7330
+ }
7331
+ } else if (character === `
7332
+ `) {
7333
+ if (escapeCode && getClosingCode(escapeCode)) {
7334
+ returnValue += wrapAnsiCode2(escapeCode);
7335
+ }
7336
+ if (escapeUrl) {
7337
+ returnValue += wrapAnsiHyperlink2(escapeUrl);
7338
+ }
7339
+ }
7340
+ }
7341
+ return returnValue;
7342
+ }, CRLF_OR_LF;
7343
+ var init_main = __esm(() => {
7344
+ init_dist3();
7345
+ ANSI_ESCAPE_LINK2 = `${ANSI_OSC2}8;;`;
7346
+ GROUP_REGEX = new RegExp(`(?:\\${ANSI_CSI2}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK2}(?<uri>.*)${ANSI_ESCAPE_BELL2})`, "y");
7347
+ CRLF_OR_LF = /\r?\n/;
7348
+ });
7349
+
7011
7350
  // node_modules/@inquirer/core/dist/lib/utils.js
7012
7351
  function breakLines(content, width) {
7013
7352
  return content.split(`
7014
- `).flatMap((line) => wrapAnsi(line, width, { trim: false, hard: true }).split(`
7353
+ `).flatMap((line) => wrapAnsi2(line, width, { trim: false, hard: true }).split(`
7015
7354
  `).map((str) => str.trimEnd())).join(`
7016
7355
  `);
7017
7356
  }
@@ -7019,8 +7358,8 @@ function readlineWidth() {
7019
7358
  return import_cli_width.default({ defaultWidth: 80, output: readline().output });
7020
7359
  }
7021
7360
  var import_cli_width;
7022
- var init_utils = __esm(() => {
7023
- init_wrap_ansi();
7361
+ var init_utils2 = __esm(() => {
7362
+ init_main();
7024
7363
  init_hook_engine();
7025
7364
  import_cli_width = __toESM(require_cli_width(), 1);
7026
7365
  });
@@ -7093,7 +7432,7 @@ function usePagination({ items, active, renderItem, pageSize, loop = true }) {
7093
7432
  }
7094
7433
  var init_use_pagination = __esm(() => {
7095
7434
  init_use_ref();
7096
- init_utils();
7435
+ init_utils2();
7097
7436
  });
7098
7437
 
7099
7438
  // node_modules/mute-stream/lib/index.js
@@ -7217,17 +7556,17 @@ var require_lib = __commonJS((exports, module) => {
7217
7556
  });
7218
7557
 
7219
7558
  // node_modules/@inquirer/ansi/dist/index.js
7220
- var ESC = "\x1B[", cursorLeft, cursorHide, cursorShow, cursorUp = (rows = 1) => rows > 0 ? `${ESC}${rows}A` : "", cursorDown = (rows = 1) => rows > 0 ? `${ESC}${rows}B` : "", cursorTo = (x, y) => {
7559
+ var ESC2 = "\x1B[", cursorLeft, cursorHide, cursorShow, cursorUp = (rows = 1) => rows > 0 ? `${ESC2}${rows}A` : "", cursorDown = (rows = 1) => rows > 0 ? `${ESC2}${rows}B` : "", cursorTo = (x, y) => {
7221
7560
  if (typeof y === "number" && !Number.isNaN(y)) {
7222
- return `${ESC}${y + 1};${x + 1}H`;
7561
+ return `${ESC2}${y + 1};${x + 1}H`;
7223
7562
  }
7224
- return `${ESC}${x + 1}G`;
7563
+ return `${ESC2}${x + 1}G`;
7225
7564
  }, eraseLine, eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + eraseLine + cursorLeft : "";
7226
- var init_dist2 = __esm(() => {
7227
- cursorLeft = ESC + "G";
7228
- cursorHide = ESC + "?25l";
7229
- cursorShow = ESC + "?25h";
7230
- eraseLine = ESC + "2K";
7565
+ var init_dist4 = __esm(() => {
7566
+ cursorLeft = ESC2 + "G";
7567
+ cursorHide = ESC2 + "?25l";
7568
+ cursorShow = ESC2 + "?25h";
7569
+ eraseLine = ESC2 + "2K";
7231
7570
  });
7232
7571
 
7233
7572
  // node_modules/@inquirer/core/dist/lib/screen-manager.js
@@ -7295,8 +7634,8 @@ var height = (content) => content.split(`
7295
7634
  `).length, lastLine = (content) => content.split(`
7296
7635
  `).pop() ?? "";
7297
7636
  var init_screen_manager = __esm(() => {
7298
- init_utils();
7299
- init_dist2();
7637
+ init_utils2();
7638
+ init_dist4();
7300
7639
  });
7301
7640
 
7302
7641
  // node_modules/@inquirer/core/dist/lib/promise-polyfill.js
@@ -7433,7 +7772,7 @@ var init_Separator = __esm(() => {
7433
7772
  });
7434
7773
 
7435
7774
  // node_modules/@inquirer/core/dist/index.js
7436
- var init_dist3 = __esm(() => {
7775
+ var init_dist5 = __esm(() => {
7437
7776
  init_use_prefix();
7438
7777
  init_use_state();
7439
7778
  init_use_effect();
@@ -7492,12 +7831,12 @@ function normalizeChoices(choices) {
7492
7831
  return normalizedChoice;
7493
7832
  });
7494
7833
  }
7495
- var checkboxTheme, dist_default2;
7496
- var init_dist4 = __esm(() => {
7497
- init_dist3();
7498
- init_dist2();
7834
+ var checkboxTheme, dist_default4;
7835
+ var init_dist6 = __esm(() => {
7836
+ init_dist5();
7837
+ init_dist4();
7499
7838
  init_dist();
7500
- init_dist3();
7839
+ init_dist5();
7501
7840
  checkboxTheme = {
7502
7841
  icon: {
7503
7842
  checked: styleText3("green", dist_default.circleFilled),
@@ -7512,7 +7851,7 @@ var init_dist4 = __esm(() => {
7512
7851
  },
7513
7852
  keybindings: []
7514
7853
  };
7515
- dist_default2 = createPrompt((config, done) => {
7854
+ dist_default4 = createPrompt((config, done) => {
7516
7855
  const { pageSize = 7, loop = true, required, validate = () => true } = config;
7517
7856
  const shortcuts = { all: "a", invert: "i", ...config.shortcuts };
7518
7857
  const theme = makeTheme(checkboxTheme, config.theme);
@@ -17137,7 +17476,7 @@ class ExternalEditor {
17137
17476
  }
17138
17477
  }
17139
17478
  var import_chardet, import_iconv_lite;
17140
- var init_dist5 = __esm(() => {
17479
+ var init_dist7 = __esm(() => {
17141
17480
  init_CreateFileError();
17142
17481
  init_LaunchEditorError();
17143
17482
  init_ReadFileError();
@@ -17147,14 +17486,14 @@ var init_dist5 = __esm(() => {
17147
17486
  });
17148
17487
 
17149
17488
  // node_modules/@inquirer/editor/dist/index.js
17150
- var editorTheme, dist_default3;
17151
- var init_dist6 = __esm(() => {
17489
+ var editorTheme, dist_default5;
17490
+ var init_dist8 = __esm(() => {
17491
+ init_dist7();
17152
17492
  init_dist5();
17153
- init_dist3();
17154
17493
  editorTheme = {
17155
17494
  validationFailureMode: "keep"
17156
17495
  };
17157
- dist_default3 = createPrompt((config, done) => {
17496
+ dist_default5 = createPrompt((config, done) => {
17158
17497
  const { waitForUserInput = true, file: { postfix = config.postfix ?? ".txt", ...fileProps } = {}, validate = () => true } = config;
17159
17498
  const theme = makeTheme(editorTheme, config.theme);
17160
17499
  const [status, setStatus] = useState("idle");
@@ -17232,10 +17571,10 @@ function getBooleanValue(value, defaultValue) {
17232
17571
  function boolToString(value) {
17233
17572
  return value ? "Yes" : "No";
17234
17573
  }
17235
- var dist_default4;
17236
- var init_dist7 = __esm(() => {
17237
- init_dist3();
17238
- dist_default4 = createPrompt((config, done) => {
17574
+ var dist_default6;
17575
+ var init_dist9 = __esm(() => {
17576
+ init_dist5();
17577
+ dist_default6 = createPrompt((config, done) => {
17239
17578
  const { transformer = boolToString } = config;
17240
17579
  const [status, setStatus] = useState("idle");
17241
17580
  const [value, setValue] = useState("");
@@ -17271,17 +17610,17 @@ var init_dist7 = __esm(() => {
17271
17610
  });
17272
17611
 
17273
17612
  // node_modules/@inquirer/input/dist/index.js
17274
- var inputTheme, dist_default5;
17275
- var init_dist8 = __esm(() => {
17276
- init_dist3();
17613
+ var inputTheme, dist_default7;
17614
+ var init_dist10 = __esm(() => {
17615
+ init_dist5();
17277
17616
  inputTheme = {
17278
17617
  validationFailureMode: "keep"
17279
17618
  };
17280
- dist_default5 = createPrompt((config, done) => {
17619
+ dist_default7 = createPrompt((config, done) => {
17281
17620
  const { prefill = "tab" } = config;
17282
17621
  const theme = makeTheme(inputTheme, config.theme);
17283
17622
  const [status, setStatus] = useState("idle");
17284
- const [defaultValue = "", setDefaultValue] = useState(config.default);
17623
+ const [defaultValue, setDefaultValue] = useState(String(config.default ?? ""));
17285
17624
  const [errorMsg, setError] = useState();
17286
17625
  const [value, setValue] = useState("");
17287
17626
  const prefix = usePrefix({ status, theme });
@@ -17320,9 +17659,9 @@ var init_dist8 = __esm(() => {
17320
17659
  setStatus("idle");
17321
17660
  }
17322
17661
  } else if (isBackspaceKey(key) && !value) {
17323
- setDefaultValue(undefined);
17662
+ setDefaultValue("");
17324
17663
  } else if (isTabKey(key) && !value) {
17325
- setDefaultValue(undefined);
17664
+ setDefaultValue("");
17326
17665
  rl.clearLine(0);
17327
17666
  rl.write(defaultValue);
17328
17667
  setValue(defaultValue);
@@ -17376,10 +17715,10 @@ function validateNumber(value, { min, max, step }) {
17376
17715
  }
17377
17716
  return true;
17378
17717
  }
17379
- var dist_default6;
17380
- var init_dist9 = __esm(() => {
17381
- init_dist3();
17382
- dist_default6 = createPrompt((config, done) => {
17718
+ var dist_default8;
17719
+ var init_dist11 = __esm(() => {
17720
+ init_dist5();
17721
+ dist_default8 = createPrompt((config, done) => {
17383
17722
  const { validate = () => true, min = -Infinity, max = Infinity, step = 1, required = false } = config;
17384
17723
  const theme = makeTheme(config.theme);
17385
17724
  const [status, setStatus] = useState("idle");
@@ -17460,15 +17799,15 @@ function normalizeChoices2(choices) {
17460
17799
  };
17461
17800
  });
17462
17801
  }
17463
- var helpChoice, dist_default7;
17464
- var init_dist10 = __esm(() => {
17465
- init_dist3();
17802
+ var helpChoice, dist_default9;
17803
+ var init_dist12 = __esm(() => {
17804
+ init_dist5();
17466
17805
  helpChoice = {
17467
17806
  key: "h",
17468
17807
  name: "Help, list all options",
17469
17808
  value: undefined
17470
17809
  };
17471
- dist_default7 = createPrompt((config, done) => {
17810
+ dist_default9 = createPrompt((config, done) => {
17472
17811
  const { default: defaultKey = "h" } = config;
17473
17812
  const choices = useMemo(() => normalizeChoices2(config.choices), [config.choices]);
17474
17813
  const [status, setStatus] = useState("idle");
@@ -17586,16 +17925,16 @@ function getSelectedChoice(input, choices) {
17586
17925
  }
17587
17926
  return selectedChoice ? [selectedChoice, choices.indexOf(selectedChoice)] : [undefined, undefined];
17588
17927
  }
17589
- var numberRegex, rawlistTheme, dist_default8;
17590
- var init_dist11 = __esm(() => {
17591
- init_dist3();
17928
+ var numberRegex, rawlistTheme, dist_default10;
17929
+ var init_dist13 = __esm(() => {
17930
+ init_dist5();
17592
17931
  numberRegex = /\d+/;
17593
17932
  rawlistTheme = {
17594
17933
  style: {
17595
17934
  description: (text) => styleText5("cyan", text)
17596
17935
  }
17597
17936
  };
17598
- dist_default8 = createPrompt((config, done) => {
17937
+ dist_default10 = createPrompt((config, done) => {
17599
17938
  const { loop = true } = config;
17600
17939
  const choices = useMemo(() => normalizeChoices3(config.choices), [config.choices]);
17601
17940
  const [status, setStatus] = useState("idle");
@@ -17678,11 +18017,11 @@ var init_dist11 = __esm(() => {
17678
18017
  });
17679
18018
 
17680
18019
  // node_modules/@inquirer/password/dist/index.js
17681
- var dist_default9;
17682
- var init_dist12 = __esm(() => {
17683
- init_dist3();
17684
- init_dist2();
17685
- dist_default9 = createPrompt((config, done) => {
18020
+ var dist_default11;
18021
+ var init_dist14 = __esm(() => {
18022
+ init_dist5();
18023
+ init_dist4();
18024
+ dist_default11 = createPrompt((config, done) => {
17686
18025
  const { validate = () => true } = config;
17687
18026
  const theme = makeTheme(config.theme);
17688
18027
  const [status, setStatus] = useState("idle");
@@ -17761,9 +18100,9 @@ function normalizeChoices4(choices) {
17761
18100
  return normalizedChoice;
17762
18101
  });
17763
18102
  }
17764
- var searchTheme, dist_default10;
17765
- var init_dist13 = __esm(() => {
17766
- init_dist3();
18103
+ var searchTheme, dist_default12;
18104
+ var init_dist15 = __esm(() => {
18105
+ init_dist5();
17767
18106
  init_dist();
17768
18107
  searchTheme = {
17769
18108
  icon: { cursor: dist_default.pointer },
@@ -17774,7 +18113,7 @@ var init_dist13 = __esm(() => {
17774
18113
  keysHelpTip: (keys) => keys.map(([key, action]) => `${styleText6("bold", key)} ${styleText6("dim", action)}`).join(styleText6("dim", " • "))
17775
18114
  }
17776
18115
  };
17777
- dist_default10 = createPrompt((config, done) => {
18116
+ dist_default12 = createPrompt((config, done) => {
17778
18117
  const { pageSize = 7, validate = () => true } = config;
17779
18118
  const theme = makeTheme(searchTheme, config.theme);
17780
18119
  const [status, setStatus] = useState("loading");
@@ -17938,10 +18277,10 @@ function normalizeChoices5(choices) {
17938
18277
  return normalizedChoice;
17939
18278
  });
17940
18279
  }
17941
- var selectTheme, dist_default11;
17942
- var init_dist14 = __esm(() => {
17943
- init_dist3();
17944
- init_dist2();
18280
+ var selectTheme, dist_default13;
18281
+ var init_dist16 = __esm(() => {
18282
+ init_dist5();
18283
+ init_dist4();
17945
18284
  init_dist();
17946
18285
  selectTheme = {
17947
18286
  icon: { cursor: dist_default.pointer },
@@ -17953,7 +18292,7 @@ var init_dist14 = __esm(() => {
17953
18292
  indexMode: "hidden",
17954
18293
  keybindings: []
17955
18294
  };
17956
- dist_default11 = createPrompt((config, done) => {
18295
+ dist_default13 = createPrompt((config, done) => {
17957
18296
  const { loop = true, pageSize = 7 } = config;
17958
18297
  const theme = makeTheme(selectTheme, config.theme);
17959
18298
  const { keybindings } = theme;
@@ -18071,10 +18410,8 @@ var init_dist14 = __esm(() => {
18071
18410
  });
18072
18411
 
18073
18412
  // node_modules/@inquirer/prompts/dist/index.js
18074
- var init_dist15 = __esm(() => {
18075
- init_dist4();
18413
+ var init_dist17 = __esm(() => {
18076
18414
  init_dist6();
18077
- init_dist7();
18078
18415
  init_dist8();
18079
18416
  init_dist9();
18080
18417
  init_dist10();
@@ -18082,6 +18419,8 @@ var init_dist15 = __esm(() => {
18082
18419
  init_dist12();
18083
18420
  init_dist13();
18084
18421
  init_dist14();
18422
+ init_dist15();
18423
+ init_dist16();
18085
18424
  });
18086
18425
 
18087
18426
  // node_modules/rxjs/dist/cjs/internal/util/isFunction.js
@@ -27310,8 +27649,8 @@ class PromptsRunner {
27310
27649
  }
27311
27650
  var import_rxjs, import_run_async, import_mute_stream2, _, TTYError;
27312
27651
  var init_prompt = __esm(() => {
27313
- init_dist3();
27314
- init_dist2();
27652
+ init_dist5();
27653
+ init_dist4();
27315
27654
  import_rxjs = __toESM(require_cjs(), 1);
27316
27655
  import_run_async = __toESM(require_run_async(), 1);
27317
27656
  import_mute_stream2 = __toESM(require_lib(), 1);
@@ -27344,7 +27683,7 @@ var init_prompt = __esm(() => {
27344
27683
  // node_modules/inquirer/dist/index.js
27345
27684
  var exports_dist = {};
27346
27685
  __export(exports_dist, {
27347
- default: () => dist_default12,
27686
+ default: () => dist_default14,
27348
27687
  createPromptModule: () => createPromptModule
27349
27688
  });
27350
27689
  function createPromptModule(opt) {
@@ -27369,21 +27708,21 @@ function registerPrompt(name, newPrompt) {
27369
27708
  function restoreDefaultPrompts() {
27370
27709
  prompt.restoreDefaultPrompts();
27371
27710
  }
27372
- var builtInPrompts, prompt, inquirer, dist_default12;
27373
- var init_dist16 = __esm(() => {
27374
- init_dist15();
27711
+ var builtInPrompts, prompt, inquirer, dist_default14;
27712
+ var init_dist18 = __esm(() => {
27713
+ init_dist17();
27375
27714
  init_prompt();
27376
27715
  builtInPrompts = {
27377
- input: dist_default5,
27378
- select: dist_default11,
27379
- number: dist_default6,
27380
- confirm: dist_default4,
27381
- rawlist: dist_default8,
27382
- expand: dist_default7,
27383
- checkbox: dist_default2,
27384
- password: dist_default9,
27385
- editor: dist_default3,
27386
- search: dist_default10
27716
+ input: dist_default7,
27717
+ select: dist_default13,
27718
+ number: dist_default8,
27719
+ confirm: dist_default6,
27720
+ rawlist: dist_default10,
27721
+ expand: dist_default9,
27722
+ checkbox: dist_default4,
27723
+ password: dist_default11,
27724
+ editor: dist_default5,
27725
+ search: dist_default12
27387
27726
  };
27388
27727
  prompt = createPromptModule();
27389
27728
  inquirer = {
@@ -27396,41 +27735,31 @@ var init_dist16 = __esm(() => {
27396
27735
  restoreDefaultPrompts,
27397
27736
  Separator
27398
27737
  };
27399
- dist_default12 = inquirer;
27738
+ dist_default14 = inquirer;
27400
27739
  });
27401
27740
 
27402
27741
  // src/utils/core/terminal.ts
27403
27742
  import { writeSync } from "fs";
27404
- var spinner = null, exitHandlersRegistered = false, emergencyTerminalCleanup = () => {
27743
+ var spinner = null, exitHandlersRegistered = false, globalExitMessage, setGlobalExitMessage = (message) => {
27744
+ globalExitMessage = message;
27745
+ }, emergencyTerminalCleanup = () => {
27405
27746
  try {
27406
27747
  writeSync(1, TERMINAL_RESET);
27748
+ if (globalExitMessage) {
27749
+ writeSync(1, globalExitMessage + `
27750
+ `);
27751
+ }
27407
27752
  } catch {}
27408
27753
  }, registerExitHandlers = () => {
27409
27754
  if (exitHandlersRegistered)
27410
27755
  return;
27411
27756
  exitHandlersRegistered = true;
27412
27757
  process.on("exit", emergencyTerminalCleanup);
27413
- process.on("beforeExit", emergencyTerminalCleanup);
27414
- process.on("SIGINT", () => {
27415
- emergencyTerminalCleanup();
27416
- process.exit(130);
27417
- });
27418
- process.on("SIGTERM", () => {
27419
- emergencyTerminalCleanup();
27420
- process.exit(143);
27421
- });
27422
- process.on("SIGHUP", () => {
27423
- emergencyTerminalCleanup();
27424
- process.exit(128);
27425
- });
27426
- process.on("uncaughtException", () => {
27427
- emergencyTerminalCleanup();
27428
- process.exit(1);
27429
- });
27430
- process.on("unhandledRejection", () => {
27431
- emergencyTerminalCleanup();
27432
- process.exit(1);
27433
- });
27758
+ process.on("SIGINT", () => process.exit(130));
27759
+ process.on("SIGTERM", () => process.exit(143));
27760
+ process.on("SIGHUP", () => process.exit(128));
27761
+ process.on("uncaughtException", () => process.exit(1));
27762
+ process.on("unhandledRejection", () => process.exit(1));
27434
27763
  }, successMessage = (message) => {
27435
27764
  console.log(source_default.green("✓") + " " + message);
27436
27765
  }, errorMessage = (message) => {
@@ -27471,14 +27800,8 @@ var spinner = null, exitHandlersRegistered = false, emergencyTerminalCleanup = (
27471
27800
  console.log(JSON.stringify(data, null, 2));
27472
27801
  }, filePath = (path2) => source_default.cyan(path2), enterFullscreen = () => {
27473
27802
  process.stdout.write(TERMINAL_SEQUENCES.ENTER_ALTERNATE_SCREEN + TERMINAL_SEQUENCES.CLEAR_SCREEN + TERMINAL_SEQUENCES.CURSOR_HOME);
27474
- }, exitFullscreen = () => {
27475
- try {
27476
- writeSync(1, TERMINAL_RESET);
27477
- } catch {}
27478
- }, clearScreen = () => {
27479
- process.stdout.write(TERMINAL_SEQUENCES.CLEAR_SCREEN + TERMINAL_SEQUENCES.CLEAR_SCROLLBACK + TERMINAL_SEQUENCES.CURSOR_HOME);
27480
27803
  }, askConfirm = async (message) => {
27481
- const inquirer2 = (await Promise.resolve().then(() => (init_dist16(), exports_dist))).default;
27804
+ const inquirer2 = (await Promise.resolve().then(() => (init_dist18(), exports_dist))).default;
27482
27805
  const answer = await inquirer2.prompt([
27483
27806
  {
27484
27807
  type: "confirm",
@@ -29940,7 +30263,7 @@ var _serialize = (data, escapeColonStrings = true) => {
29940
30263
  }
29941
30264
  return value;
29942
30265
  });
29943
- var init_dist17 = () => {};
30266
+ var init_dist19 = () => {};
29944
30267
 
29945
30268
  // node_modules/cacheable-request/node_modules/keyv/dist/index.js
29946
30269
  var EventManager = class {
@@ -30011,8 +30334,8 @@ var EventManager = class {
30011
30334
  this._maxListeners = n2;
30012
30335
  }
30013
30336
  }, event_manager_default, HooksManager, hooks_manager_default, StatsManager, stats_manager_default, iterableAdapters, Keyv;
30014
- var init_dist18 = __esm(() => {
30015
- init_dist17();
30337
+ var init_dist20 = __esm(() => {
30338
+ init_dist19();
30016
30339
  event_manager_default = EventManager;
30017
30340
  HooksManager = class extends event_manager_default {
30018
30341
  _hookHandlers;
@@ -31319,10 +31642,10 @@ var import_http_cache_semantics, entries, cloneResponse = (response) => {
31319
31642
  path: u2.pathname + u2.search,
31320
31643
  href: u2.href
31321
31644
  };
31322
- }, dist_default13;
31323
- var init_dist19 = __esm(() => {
31645
+ }, dist_default15;
31646
+ var init_dist21 = __esm(() => {
31324
31647
  init_source2();
31325
- init_dist18();
31648
+ init_dist20();
31326
31649
  init_mimic_response();
31327
31650
  init_normalize_url();
31328
31651
  init_responselike();
@@ -31330,7 +31653,7 @@ var init_dist19 = __esm(() => {
31330
31653
  import_http_cache_semantics = __toESM(require_http_cache_semantics(), 1);
31331
31654
  init_types();
31332
31655
  entries = Object.entries;
31333
- dist_default13 = CacheableRequest;
31656
+ dist_default15 = CacheableRequest;
31334
31657
  });
31335
31658
 
31336
31659
  // node_modules/decompress-response/index.js
@@ -35604,7 +35927,7 @@ import http2, { ServerResponse } from "node:http";
35604
35927
  var supportsBrotli, supportsZstd2, methodsWithoutBody, cacheableStore, redirectCodes, errorsProcessedByHooks, proxiedRequestEvents, noop3 = () => {}, Request;
35605
35928
  var init_core = __esm(() => {
35606
35929
  init_byte_counter();
35607
- init_dist19();
35930
+ init_dist21();
35608
35931
  init_decompress_response();
35609
35932
  init_distribution();
35610
35933
  init_lib();
@@ -36355,7 +36678,7 @@ var init_core = __esm(() => {
36355
36678
  if (cacheableStore.has(cache)) {
36356
36679
  return;
36357
36680
  }
36358
- const cacheableRequest = new dist_default13((requestOptions, handler) => {
36681
+ const cacheableRequest = new dist_default15((requestOptions, handler) => {
36359
36682
  const wrappedHandler = handler ? (response) => {
36360
36683
  const { beforeCacheHooks, gotRequest } = requestOptions;
36361
36684
  if (!beforeCacheHooks || beforeCacheHooks.length === 0) {
@@ -37409,7 +37732,7 @@ var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms)), isConnect
37409
37732
  }
37410
37733
  return COPILOT_INITIAL_RETRY_DELAY * Math.pow(2, attempt);
37411
37734
  };
37412
- var init_utils2 = __esm(() => {
37735
+ var init_utils3 = __esm(() => {
37413
37736
  init_copilot();
37414
37737
  QUOTA_EXCEEDED_PATTERNS = [
37415
37738
  /quota/i,
@@ -38275,14 +38598,14 @@ class LinearScrollAccel {
38275
38598
  reset() {}
38276
38599
  }
38277
38600
  function isCompleteSequence(data) {
38278
- if (!data.startsWith(ESC2)) {
38601
+ if (!data.startsWith(ESC3)) {
38279
38602
  return "not-escape";
38280
38603
  }
38281
38604
  if (data.length === 1) {
38282
38605
  return "incomplete";
38283
38606
  }
38284
38607
  const afterEsc = data.slice(1);
38285
- if (afterEsc.startsWith(ESC2)) {
38608
+ if (afterEsc.startsWith(ESC3)) {
38286
38609
  return isCompleteSequence(afterEsc);
38287
38610
  }
38288
38611
  if (afterEsc.startsWith("[")) {
@@ -38309,7 +38632,7 @@ function isCompleteSequence(data) {
38309
38632
  return "complete";
38310
38633
  }
38311
38634
  function isCompleteCsiSequence(data) {
38312
- if (!data.startsWith(ESC2 + "[")) {
38635
+ if (!data.startsWith(ESC3 + "[")) {
38313
38636
  return "complete";
38314
38637
  }
38315
38638
  if (data.length < 3) {
@@ -38337,28 +38660,28 @@ function isCompleteCsiSequence(data) {
38337
38660
  return "incomplete";
38338
38661
  }
38339
38662
  function isCompleteOscSequence(data) {
38340
- if (!data.startsWith(ESC2 + "]")) {
38663
+ if (!data.startsWith(ESC3 + "]")) {
38341
38664
  return "complete";
38342
38665
  }
38343
- if (data.endsWith(ESC2 + "\\") || data.endsWith("\x07")) {
38666
+ if (data.endsWith(ESC3 + "\\") || data.endsWith("\x07")) {
38344
38667
  return "complete";
38345
38668
  }
38346
38669
  return "incomplete";
38347
38670
  }
38348
38671
  function isCompleteDcsSequence(data) {
38349
- if (!data.startsWith(ESC2 + "P")) {
38672
+ if (!data.startsWith(ESC3 + "P")) {
38350
38673
  return "complete";
38351
38674
  }
38352
- if (data.endsWith(ESC2 + "\\")) {
38675
+ if (data.endsWith(ESC3 + "\\")) {
38353
38676
  return "complete";
38354
38677
  }
38355
38678
  return "incomplete";
38356
38679
  }
38357
38680
  function isCompleteApcSequence(data) {
38358
- if (!data.startsWith(ESC2 + "_")) {
38681
+ if (!data.startsWith(ESC3 + "_")) {
38359
38682
  return "complete";
38360
38683
  }
38361
- if (data.endsWith(ESC2 + "\\")) {
38684
+ if (data.endsWith(ESC3 + "\\")) {
38362
38685
  return "complete";
38363
38686
  }
38364
38687
  return "incomplete";
@@ -38371,7 +38694,7 @@ function extractCompleteSequences(buffer) {
38371
38694
  let pos = 0;
38372
38695
  while (pos < buffer.length) {
38373
38696
  const remaining = buffer.slice(pos);
38374
- if (remaining.startsWith(ESC2)) {
38697
+ if (remaining.startsWith(ESC3)) {
38375
38698
  let seqEnd = 1;
38376
38699
  while (seqEnd <= remaining.length) {
38377
38700
  const candidate = remaining.slice(0, seqEnd);
@@ -38381,7 +38704,7 @@ function extractCompleteSequences(buffer) {
38381
38704
  pos += seqEnd;
38382
38705
  break;
38383
38706
  } else if (status === "incomplete") {
38384
- if (candidate === ESC2 + ESC2) {
38707
+ if (candidate === ESC3 + ESC3) {
38385
38708
  const nextChar = remaining[seqEnd];
38386
38709
  if (seqEnd < remaining.length && !isNestedEscapeSequenceStart(nextChar)) {
38387
38710
  sequences.push(candidate);
@@ -44159,7 +44482,7 @@ var __defProp2, __export2 = (target, all2) => {
44159
44482
  key.code = "[3~";
44160
44483
  }
44161
44484
  return key;
44162
- }, KeyHandler, InternalKeyHandler, CSS_COLOR_NAMES, block_default, shade_default, slick_default, tiny_default, huge_default, grid_default, pallet_default, fonts, parsedFonts, TextAttributes, DebugOverlayCorner, ATTRIBUTE_BASE_MASK2 = 255, LINK_ID_SHIFT = 8, LINK_ID_PAYLOAD_MASK = 16777215, BrandedStyledText, StyledText, fg = (color) => (input) => applyStyle2(input, { fg: color }), ESC2 = "\x1B", BRACKETED_PASTE_START = "\x1B[200~", BRACKETED_PASTE_END = "\x1B[201~", StdinBuffer, MouseParser, singletonCacheSymbol, envRegistry, envStore, env2, TIMERS_MAP, _cachedParsers, DEFAULT_PARSERS, isUrl = (path5) => path5.startsWith("http://") || path5.startsWith("https://"), TreeSitterClient, DataPathsManager, OSC4_RESPONSE, OSC_SPECIAL_RESPONSE, pointerSize, typeSizes, primitiveKeys, typeAlignments, typeGetters, pointerPacker, pointerUnpacker, encoder, decoder, rgbaPackTransform = (rgba) => rgba ? ptr3(rgba.buffer) : null, rgbaUnpackTransform = (ptr42) => ptr42 ? RGBA.fromArray(new Float32Array(toArrayBuffer3(ptr42))) : undefined, StyledChunkStruct, HighlightStruct, LogicalCursorStruct, VisualCursorStruct, UnicodeMethodEnum, TerminalCapabilitiesStruct, EncodedCharStruct, LineInfoStruct, MeasureResultStruct, CursorStateStruct, module, targetLibPath, globalTraceSymbols = null, globalFFILogWriter = null, exitHandlerRegistered = false, LogLevel2, opentuiLibPath, opentuiLib, BrandedRenderable, LayoutEvents, RenderableEvents, BaseRenderable, yogaConfig, Renderable, RootRenderable, BrandedVNode, Capture, CapturedWritableStream, defaultKeyAliases, capture, TerminalConsoleCache, terminalConsoleCache, ConsolePosition, defaultConsoleKeybindings, DEFAULT_CONSOLE_OPTIONS, INDENT_WIDTH = 2, TerminalConsole, ANSI, KITTY_FLAG_DISAMBIGUATE = 1, KITTY_FLAG_EVENT_TYPES = 2, KITTY_FLAG_ALTERNATE_KEYS = 4, KITTY_FLAG_ALL_KEYS_AS_ESCAPES = 8, KITTY_FLAG_REPORT_TEXT = 16, MouseButton, rendererTracker, CliRenderEvents, RendererControlState, CliRenderer;
44485
+ }, KeyHandler, InternalKeyHandler, CSS_COLOR_NAMES, block_default, shade_default, slick_default, tiny_default, huge_default, grid_default, pallet_default, fonts, parsedFonts, TextAttributes, DebugOverlayCorner, ATTRIBUTE_BASE_MASK2 = 255, LINK_ID_SHIFT = 8, LINK_ID_PAYLOAD_MASK = 16777215, BrandedStyledText, StyledText, fg = (color) => (input) => applyStyle2(input, { fg: color }), ESC3 = "\x1B", BRACKETED_PASTE_START = "\x1B[200~", BRACKETED_PASTE_END = "\x1B[201~", StdinBuffer, MouseParser, singletonCacheSymbol, envRegistry, envStore, env2, TIMERS_MAP, _cachedParsers, DEFAULT_PARSERS, isUrl = (path5) => path5.startsWith("http://") || path5.startsWith("https://"), TreeSitterClient, DataPathsManager, OSC4_RESPONSE, OSC_SPECIAL_RESPONSE, pointerSize, typeSizes, primitiveKeys, typeAlignments, typeGetters, pointerPacker, pointerUnpacker, encoder, decoder, rgbaPackTransform = (rgba) => rgba ? ptr3(rgba.buffer) : null, rgbaUnpackTransform = (ptr42) => ptr42 ? RGBA.fromArray(new Float32Array(toArrayBuffer3(ptr42))) : undefined, StyledChunkStruct, HighlightStruct, LogicalCursorStruct, VisualCursorStruct, UnicodeMethodEnum, TerminalCapabilitiesStruct, EncodedCharStruct, LineInfoStruct, MeasureResultStruct, CursorStateStruct, module, targetLibPath, globalTraceSymbols = null, globalFFILogWriter = null, exitHandlerRegistered = false, LogLevel2, opentuiLibPath, opentuiLib, BrandedRenderable, LayoutEvents, RenderableEvents, BaseRenderable, yogaConfig, Renderable, RootRenderable, BrandedVNode, Capture, CapturedWritableStream, defaultKeyAliases, capture, TerminalConsoleCache, terminalConsoleCache, ConsolePosition, defaultConsoleKeybindings, DEFAULT_CONSOLE_OPTIONS, INDENT_WIDTH = 2, TerminalConsole, ANSI, KITTY_FLAG_DISAMBIGUATE = 1, KITTY_FLAG_EVENT_TYPES = 2, KITTY_FLAG_ALTERNATE_KEYS = 4, KITTY_FLAG_ALL_KEYS_AS_ESCAPES = 8, KITTY_FLAG_REPORT_TEXT = 16, MouseButton, rendererTracker, CliRenderEvents, RendererControlState, CliRenderer;
44163
44486
  var init_index_zrvzvh6r = __esm(async () => {
44164
44487
  init_highlights();
44165
44488
  init_tree_sitter_javascript();
@@ -65981,6 +66304,84 @@ var stripMarkdown = (text) => {
65981
66304
  return result;
65982
66305
  };
65983
66306
 
66307
+ // src/providers/copilot/usage.ts
66308
+ var COPILOT_USER_URL = "https://api.github.com/copilot_internal/user", getCopilotUsage = async () => {
66309
+ const oauthToken = await getOAuthToken();
66310
+ if (!oauthToken) {
66311
+ return null;
66312
+ }
66313
+ try {
66314
+ const response2 = await source_default2.get(COPILOT_USER_URL, {
66315
+ headers: {
66316
+ Authorization: `token ${oauthToken}`,
66317
+ Accept: "application/json",
66318
+ "User-Agent": "CodeTyper-CLI/1.0"
66319
+ }
66320
+ }).json();
66321
+ return response2;
66322
+ } catch {
66323
+ return null;
66324
+ }
66325
+ };
66326
+ var init_usage = __esm(() => {
66327
+ init_source4();
66328
+ init_token();
66329
+ });
66330
+
66331
+ // src/services/copilot/usage-refresh-manager.ts
66332
+ class UsageRefreshManager {
66333
+ static instance = null;
66334
+ intervalId = null;
66335
+ lastManualRefreshTime = 0;
66336
+ appStore = null;
66337
+ constructor() {}
66338
+ static getInstance() {
66339
+ if (!UsageRefreshManager.instance) {
66340
+ UsageRefreshManager.instance = new UsageRefreshManager;
66341
+ }
66342
+ return UsageRefreshManager.instance;
66343
+ }
66344
+ start(appStore) {
66345
+ this.appStore = appStore;
66346
+ this.stop();
66347
+ if (appStore.provider() !== "copilot") {
66348
+ return;
66349
+ }
66350
+ this.intervalId = setInterval(() => {
66351
+ if (this.appStore && this.appStore.provider() === "copilot") {
66352
+ this.appStore.fetchCopilotUsage();
66353
+ } else {
66354
+ this.stop();
66355
+ }
66356
+ }, REFRESH_INTERVAL_MS);
66357
+ }
66358
+ stop() {
66359
+ if (this.intervalId) {
66360
+ clearInterval(this.intervalId);
66361
+ this.intervalId = null;
66362
+ }
66363
+ }
66364
+ manualRefresh() {
66365
+ const now = Date.now();
66366
+ if (now - this.lastManualRefreshTime < DEBOUNCE_MS) {
66367
+ return;
66368
+ }
66369
+ this.lastManualRefreshTime = now;
66370
+ if (this.appStore) {
66371
+ this.appStore.fetchCopilotUsage();
66372
+ }
66373
+ }
66374
+ isRunning() {
66375
+ return this.intervalId !== null;
66376
+ }
66377
+ getAppStore() {
66378
+ return this.appStore;
66379
+ }
66380
+ }
66381
+ var REFRESH_INTERVAL_MS = 60000, DEBOUNCE_MS = 2000, getUsageRefreshManager = () => {
66382
+ return UsageRefreshManager.getInstance();
66383
+ };
66384
+
65984
66385
  // src/tui-solid/context/app.tsx
65985
66386
  var logIdCounter = 0, generateLogId = () => `log-${++logIdCounter}-${Date.now()}`, createInitialSessionStats = () => ({
65986
66387
  startTime: Date.now(),
@@ -65988,7 +66389,10 @@ var logIdCounter = 0, generateLogId = () => `log-${++logIdCounter}-${Date.now()}
65988
66389
  outputTokens: 0,
65989
66390
  thinkingStartTime: null,
65990
66391
  lastThinkingDuration: 0,
65991
- contextMaxTokens: 128000
66392
+ contextMaxTokens: 128000,
66393
+ apiTimeSpent: 0,
66394
+ apiCallStartTime: null,
66395
+ modelUsage: []
65992
66396
  }), createInitialStreamingState = () => ({
65993
66397
  logId: null,
65994
66398
  content: "",
@@ -66007,6 +66411,8 @@ var logIdCounter = 0, generateLogId = () => `log-${++logIdCounter}-${Date.now()}
66007
66411
  var init_app = __esm(async () => {
66008
66412
  init_server();
66009
66413
  init_server2();
66414
+ init_usage();
66415
+ init_copilot();
66010
66416
  await init_helper();
66011
66417
  ({
66012
66418
  provider: AppStoreProvider,
@@ -66035,6 +66441,7 @@ var init_app = __esm(async () => {
66035
66441
  availableModels: [],
66036
66442
  sessionStats: createInitialSessionStats(),
66037
66443
  todosVisible: true,
66444
+ activityVisible: true,
66038
66445
  debugLogVisible: false,
66039
66446
  interruptPending: false,
66040
66447
  exitPending: false,
@@ -66051,7 +66458,10 @@ var init_app = __esm(async () => {
66051
66458
  knowledgeCount: 0,
66052
66459
  memoryCount: 0,
66053
66460
  showBanner: true
66054
- }
66461
+ },
66462
+ copilotUsage: null,
66463
+ copilotUsageLoading: false,
66464
+ copilotUsageLastFetch: null
66055
66465
  });
66056
66466
  let inputInsertFn = null;
66057
66467
  const setInputInsertFn = (fn) => {
@@ -66082,6 +66492,7 @@ var init_app = __esm(async () => {
66082
66492
  const availableModels = () => store.availableModels;
66083
66493
  const sessionStats = () => store.sessionStats;
66084
66494
  const todosVisible = () => store.todosVisible;
66495
+ const activityVisible = () => store.activityVisible;
66085
66496
  const debugLogVisible = () => store.debugLogVisible;
66086
66497
  const interruptPending = () => store.interruptPending;
66087
66498
  const exitPending = () => store.exitPending;
@@ -66095,6 +66506,9 @@ var init_app = __esm(async () => {
66095
66506
  const mcpServers = () => store.mcpServers;
66096
66507
  const modifiedFiles = () => store.modifiedFiles;
66097
66508
  const brain = () => store.brain;
66509
+ const copilotUsage = () => store.copilotUsage;
66510
+ const copilotUsageLoading = () => store.copilotUsageLoading;
66511
+ const copilotUsageLastFetch = () => store.copilotUsageLastFetch;
66098
66512
  const setMode = (newMode) => {
66099
66513
  setStore("mode", newMode);
66100
66514
  };
@@ -66184,6 +66598,9 @@ var init_app = __esm(async () => {
66184
66598
  setStore("provider", newProvider);
66185
66599
  setStore("model", newModel);
66186
66600
  });
66601
+ if (newProvider === COPILOT_DISPLAY_NAME) {
66602
+ fetchCopilotUsage();
66603
+ }
66187
66604
  };
66188
66605
  const setVersion = (newVersion) => {
66189
66606
  setStore("version", newVersion);
@@ -66277,6 +66694,33 @@ var init_app = __esm(async () => {
66277
66694
  showBanner: false
66278
66695
  });
66279
66696
  };
66697
+ const setCopilotUsage = (usage) => {
66698
+ batch(() => {
66699
+ setStore("copilotUsage", usage);
66700
+ setStore("copilotUsageLastFetch", Date.now());
66701
+ });
66702
+ };
66703
+ const setCopilotUsageLoading = (loading) => {
66704
+ setStore("copilotUsageLoading", loading);
66705
+ };
66706
+ const fetchCopilotUsage = async () => {
66707
+ if (store.provider !== COPILOT_DISPLAY_NAME) {
66708
+ return;
66709
+ }
66710
+ const now = Date.now();
66711
+ if (store.copilotUsageLastFetch && now - store.copilotUsageLastFetch < 5000) {
66712
+ return;
66713
+ }
66714
+ setCopilotUsageLoading(true);
66715
+ try {
66716
+ const usage = await getCopilotUsage();
66717
+ setCopilotUsage(usage);
66718
+ } catch (error2) {
66719
+ console.error("[fetchCopilotUsage] Failed to fetch Copilot usage:", error2);
66720
+ } finally {
66721
+ setCopilotUsageLoading(false);
66722
+ }
66723
+ };
66280
66724
  const setMcpServers = (servers) => {
66281
66725
  setStore("mcpServers", servers);
66282
66726
  };
@@ -66354,6 +66798,40 @@ var init_app = __esm(async () => {
66354
66798
  outputTokens: store.sessionStats.outputTokens + output
66355
66799
  });
66356
66800
  };
66801
+ const startApiCall = () => {
66802
+ setStore("sessionStats", {
66803
+ ...store.sessionStats,
66804
+ apiCallStartTime: Date.now()
66805
+ });
66806
+ };
66807
+ const stopApiCall = () => {
66808
+ const elapsed = store.sessionStats.apiCallStartTime ? Date.now() - store.sessionStats.apiCallStartTime : 0;
66809
+ setStore("sessionStats", {
66810
+ ...store.sessionStats,
66811
+ apiTimeSpent: store.sessionStats.apiTimeSpent + elapsed,
66812
+ apiCallStartTime: null
66813
+ });
66814
+ };
66815
+ const addTokensWithModel = (modelId, input, output, cached) => {
66816
+ setStore(produce((s) => {
66817
+ const existing = s.sessionStats.modelUsage.find((m2) => m2.modelId === modelId);
66818
+ if (existing) {
66819
+ existing.inputTokens += input;
66820
+ existing.outputTokens += output;
66821
+ if (cached)
66822
+ existing.cachedTokens = (existing.cachedTokens ?? 0) + cached;
66823
+ } else {
66824
+ s.sessionStats.modelUsage.push({
66825
+ modelId,
66826
+ inputTokens: input,
66827
+ outputTokens: output,
66828
+ cachedTokens: cached
66829
+ });
66830
+ }
66831
+ s.sessionStats.inputTokens += input;
66832
+ s.sessionStats.outputTokens += output;
66833
+ }));
66834
+ };
66357
66835
  const resetSessionStats = () => {
66358
66836
  setStore("sessionStats", createInitialSessionStats());
66359
66837
  };
@@ -66366,6 +66844,9 @@ var init_app = __esm(async () => {
66366
66844
  const toggleTodos = () => {
66367
66845
  setStore("todosVisible", !store.todosVisible);
66368
66846
  };
66847
+ const toggleActivity = () => {
66848
+ setStore("activityVisible", !store.activityVisible);
66849
+ };
66369
66850
  const toggleDebugLog = () => {
66370
66851
  setStore("debugLogVisible", !store.debugLogVisible);
66371
66852
  };
@@ -66437,6 +66918,10 @@ var init_app = __esm(async () => {
66437
66918
  });
66438
66919
  }
66439
66920
  });
66921
+ if (store.provider === "copilot") {
66922
+ const refreshManager = getUsageRefreshManager();
66923
+ refreshManager.manualRefresh();
66924
+ }
66440
66925
  };
66441
66926
  const cancelStreaming = () => {
66442
66927
  if (!store.streamingLog.logId) {
@@ -66515,6 +67000,7 @@ var init_app = __esm(async () => {
66515
67000
  availableModels,
66516
67001
  sessionStats,
66517
67002
  todosVisible,
67003
+ activityVisible,
66518
67004
  debugLogVisible,
66519
67005
  interruptPending,
66520
67006
  exitPending,
@@ -66528,6 +67014,9 @@ var init_app = __esm(async () => {
66528
67014
  mcpServers,
66529
67015
  modifiedFiles,
66530
67016
  brain,
67017
+ copilotUsage,
67018
+ copilotUsageLoading,
67019
+ copilotUsageLastFetch,
66531
67020
  setMode,
66532
67021
  setScreenMode,
66533
67022
  setInteractionMode,
@@ -66565,6 +67054,9 @@ var init_app = __esm(async () => {
66565
67054
  setBrainCounts,
66566
67055
  setBrainShowBanner,
66567
67056
  dismissBrainBanner,
67057
+ setCopilotUsage,
67058
+ setCopilotUsageLoading,
67059
+ fetchCopilotUsage,
66568
67060
  setMcpServers,
66569
67061
  addMcpServer,
66570
67062
  updateMcpServerStatus,
@@ -66577,9 +67069,13 @@ var init_app = __esm(async () => {
66577
67069
  startThinking,
66578
67070
  stopThinking,
66579
67071
  addTokens,
67072
+ startApiCall,
67073
+ stopApiCall,
67074
+ addTokensWithModel,
66580
67075
  resetSessionStats,
66581
67076
  setContextMaxTokens,
66582
67077
  toggleTodos,
67078
+ toggleActivity,
66583
67079
  toggleDebugLog,
66584
67080
  setInterruptPending,
66585
67081
  setExitPending,
@@ -66626,13 +67122,17 @@ var init_app = __esm(async () => {
66626
67122
  suggestions: createInitialSuggestionState(),
66627
67123
  mcpServers: [],
66628
67124
  pastedImages: [],
67125
+ modifiedFiles: [],
66629
67126
  brain: {
66630
67127
  status: "disconnected",
66631
67128
  user: null,
66632
67129
  knowledgeCount: 0,
66633
67130
  memoryCount: 0,
66634
67131
  showBanner: true
66635
- }
67132
+ },
67133
+ copilotUsage: null,
67134
+ copilotUsageLoading: false,
67135
+ copilotUsageLastFetch: null
66636
67136
  };
66637
67137
  appStore = {
66638
67138
  getState: () => {
@@ -66658,6 +67158,7 @@ var init_app = __esm(async () => {
66658
67158
  sessionStats: storeRef.sessionStats(),
66659
67159
  cascadeEnabled: storeRef.cascadeEnabled(),
66660
67160
  todosVisible: storeRef.todosVisible(),
67161
+ activityVisible: storeRef.activityVisible(),
66661
67162
  debugLogVisible: storeRef.debugLogVisible(),
66662
67163
  interruptPending: storeRef.interruptPending(),
66663
67164
  exitPending: storeRef.exitPending(),
@@ -66666,7 +67167,11 @@ var init_app = __esm(async () => {
66666
67167
  suggestions: storeRef.suggestions(),
66667
67168
  mcpServers: storeRef.mcpServers(),
66668
67169
  pastedImages: storeRef.pastedImages(),
66669
- brain: storeRef.brain()
67170
+ modifiedFiles: storeRef.modifiedFiles(),
67171
+ brain: storeRef.brain(),
67172
+ copilotUsage: storeRef.copilotUsage(),
67173
+ copilotUsageLoading: storeRef.copilotUsageLoading(),
67174
+ copilotUsageLastFetch: storeRef.copilotUsageLastFetch()
66670
67175
  };
66671
67176
  },
66672
67177
  addLog: (entry) => {
@@ -66774,6 +67279,21 @@ var init_app = __esm(async () => {
66774
67279
  return;
66775
67280
  storeRef.addTokens(input, output);
66776
67281
  },
67282
+ startApiCall: () => {
67283
+ if (!storeRef)
67284
+ return;
67285
+ storeRef.startApiCall();
67286
+ },
67287
+ stopApiCall: () => {
67288
+ if (!storeRef)
67289
+ return;
67290
+ storeRef.stopApiCall();
67291
+ },
67292
+ addTokensWithModel: (modelId, input, output, cached) => {
67293
+ if (!storeRef)
67294
+ return;
67295
+ storeRef.addTokensWithModel(modelId, input, output, cached);
67296
+ },
66777
67297
  resetSessionStats: () => {
66778
67298
  if (!storeRef)
66779
67299
  return;
@@ -66789,6 +67309,11 @@ var init_app = __esm(async () => {
66789
67309
  return;
66790
67310
  storeRef.toggleTodos();
66791
67311
  },
67312
+ toggleActivity: () => {
67313
+ if (!storeRef)
67314
+ return;
67315
+ storeRef.toggleActivity();
67316
+ },
66792
67317
  toggleDebugLog: () => {
66793
67318
  if (!storeRef)
66794
67319
  return;
@@ -67360,7 +67885,7 @@ var init_chat = __esm(async () => {
67360
67885
  init_copilot();
67361
67886
  init_token();
67362
67887
  init_models();
67363
- init_utils2();
67888
+ init_utils3();
67364
67889
  await init_debug_log_panel();
67365
67890
  });
67366
67891
 
@@ -67478,7 +68003,7 @@ var initiateDeviceFlow = async () => {
67478
68003
  var init_auth = __esm(() => {
67479
68004
  init_source4();
67480
68005
  init_copilot();
67481
- init_utils2();
68006
+ init_utils3();
67482
68007
  });
67483
68008
 
67484
68009
  // src/providers/copilot.ts
@@ -90579,7 +91104,7 @@ var init_grep = __esm(() => {
90579
91104
  };
90580
91105
  });
90581
91106
  // src/tools/grep/execute.ts
90582
- import { exec as exec2 } from "child_process";
91107
+ import { exec as exec3 } from "child_process";
90583
91108
  import { promisify as promisify4 } from "util";
90584
91109
  var import_fast_glob4, execAsync, executeRipgrep = async (pattern, directory = ".") => {
90585
91110
  try {
@@ -90609,7 +91134,7 @@ var import_fast_glob4, execAsync, executeRipgrep = async (pattern, directory = "
90609
91134
  var init_execute6 = __esm(() => {
90610
91135
  init_grep();
90611
91136
  import_fast_glob4 = __toESM(require_out4(), 1);
90612
- execAsync = promisify4(exec2);
91137
+ execAsync = promisify4(exec3);
90613
91138
  });
90614
91139
 
90615
91140
  // src/tools/grep/definition.ts
@@ -93784,14 +94309,7 @@ var init_plan_service = __esm(() => {
93784
94309
  "system",
93785
94310
  "integration"
93786
94311
  ],
93787
- moderate: [
93788
- "feature",
93789
- "component",
93790
- "service",
93791
- "api",
93792
- "endpoint",
93793
- "module"
93794
- ]
94312
+ moderate: ["feature", "component", "service", "api", "endpoint", "module"]
93795
94313
  };
93796
94314
  RISK_ICONS = {
93797
94315
  high: "!",
@@ -95258,7 +95776,7 @@ var init_semantic_search = __esm(() => {
95258
95776
  var version_default2;
95259
95777
  var init_version2 = __esm(() => {
95260
95778
  version_default2 = {
95261
- version: "0.4.4"
95779
+ version: "0.4.6"
95262
95780
  };
95263
95781
  });
95264
95782
 
@@ -95271,7 +95789,7 @@ __export(exports_upgrade, {
95271
95789
  displayUpgradeHelp: () => displayUpgradeHelp,
95272
95790
  checkForUpdates: () => checkForUpdates
95273
95791
  });
95274
- import { exec as exec5 } from "child_process";
95792
+ import { exec as exec6 } from "child_process";
95275
95793
  import { promisify as promisify7 } from "util";
95276
95794
  var execAsync4, REPO_URL = "git@github.com:CarGDev/codetyper.cli.git", REPO_API_URL = "https://api.github.com/repos/CarGDev/codetyper.cli", parseVersion = (version3) => {
95277
95795
  const cleaned = version3.replace(/^v/, "");
@@ -95450,7 +95968,7 @@ CodeTyper Upgrade
95450
95968
  var init_upgrade = __esm(() => {
95451
95969
  init_source();
95452
95970
  init_version2();
95453
- execAsync4 = promisify7(exec5);
95971
+ execAsync4 = promisify7(exec6);
95454
95972
  });
95455
95973
 
95456
95974
  // src/commands/mcp.ts
@@ -97598,31 +98116,7 @@ var listSessions2 = async () => {
97598
98116
  init_source();
97599
98117
  init_usage_store();
97600
98118
  init_credentials();
97601
-
97602
- // src/providers/copilot/usage.ts
97603
- init_source4();
97604
- init_token();
97605
- var COPILOT_USER_URL = "https://api.github.com/copilot_internal/user";
97606
- var getCopilotUsage = async () => {
97607
- const oauthToken = await getOAuthToken();
97608
- if (!oauthToken) {
97609
- return null;
97610
- }
97611
- try {
97612
- const response2 = await source_default2.get(COPILOT_USER_URL, {
97613
- headers: {
97614
- Authorization: `token ${oauthToken}`,
97615
- Accept: "application/json",
97616
- "User-Agent": "CodeTyper-CLI/1.0"
97617
- }
97618
- }).json();
97619
- return response2;
97620
- } catch {
97621
- return null;
97622
- }
97623
- };
97624
-
97625
- // src/commands/components/chat/usage/show-usage.ts
98119
+ init_usage();
97626
98120
  await init_registry();
97627
98121
 
97628
98122
  // src/utils/menu/progress-bar.ts
@@ -105477,7 +105971,7 @@ var DEFAULT_KEYBINDS = {
105477
105971
  help_menu: "<leader>h",
105478
105972
  clipboard_copy: "ctrl+y",
105479
105973
  sidebar_toggle: "<leader>b",
105480
- activity_toggle: "<leader>s"
105974
+ activity_toggle: "ctrl+o"
105481
105975
  };
105482
105976
 
105483
105977
  // src/services/keybind-resolver.ts
@@ -107015,9 +107509,9 @@ var extractIssueNumbers = (message) => {
107015
107509
  return Array.from(numbers).sort((a2, b2) => a2 - b2);
107016
107510
  };
107017
107511
  // src/services/github-issue/repo.ts
107018
- import { exec as exec3 } from "child_process";
107512
+ import { exec as exec4 } from "child_process";
107019
107513
  import { promisify as promisify5 } from "util";
107020
- var execAsync2 = promisify5(exec3);
107514
+ var execAsync2 = promisify5(exec4);
107021
107515
  var isGitHubRepo = async () => {
107022
107516
  try {
107023
107517
  const { stdout } = await execAsync2(GH_CLI_COMMANDS.GET_REMOTE_URL);
@@ -107027,9 +107521,9 @@ var isGitHubRepo = async () => {
107027
107521
  }
107028
107522
  };
107029
107523
  // src/services/github-issue/fetch.ts
107030
- import { exec as exec4 } from "child_process";
107524
+ import { exec as exec5 } from "child_process";
107031
107525
  import { promisify as promisify6 } from "util";
107032
- var execAsync3 = promisify6(exec4);
107526
+ var execAsync3 = promisify6(exec5);
107033
107527
  var parseIssueResponse = (data) => ({
107034
107528
  number: data.number,
107035
107529
  title: data.title,
@@ -110056,7 +110550,7 @@ var saveCredentials = async (credentials) => {
110056
110550
  await init_copilot2();
110057
110551
 
110058
110552
  // src/providers/login/copilot-login.ts
110059
- init_dist16();
110553
+ init_dist18();
110060
110554
  init_source();
110061
110555
  await __promiseAll([
110062
110556
  init_registry(),
@@ -110088,7 +110582,7 @@ var checkExistingAuth = async (name) => {
110088
110582
  return null;
110089
110583
  }
110090
110584
  console.log(source_default.green(LOGIN_MESSAGES.COPILOT_ALREADY_CONFIGURED));
110091
- const { reconfigure } = await dist_default12.prompt([
110585
+ const { reconfigure } = await dist_default14.prompt([
110092
110586
  {
110093
110587
  type: "confirm",
110094
110588
  name: "reconfigure",
@@ -110145,12 +110639,12 @@ var loginCopilot = async (name) => {
110145
110639
  };
110146
110640
 
110147
110641
  // src/providers/login/ollama-login.ts
110148
- init_dist16();
110642
+ init_dist18();
110149
110643
  init_source();
110150
110644
  init_providers();
110151
110645
  await init_registry();
110152
110646
  var promptForHost = async () => {
110153
- const { host } = await dist_default12.prompt([
110647
+ const { host } = await dist_default14.prompt([
110154
110648
  {
110155
110649
  type: "input",
110156
110650
  name: "host",
@@ -110382,7 +110876,33 @@ var showWhoami = async (state4, callbacks) => {
110382
110876
  // src/services/chat-tui/usage.ts
110383
110877
  init_usage_store();
110384
110878
  init_credentials();
110879
+ init_usage();
110385
110880
  init_ui();
110881
+
110882
+ // src/constants/quota-colors.ts
110883
+ function getQuotaStatus(percentRemaining) {
110884
+ if (percentRemaining >= 100) {
110885
+ return { status: "healthy", color: "success" };
110886
+ }
110887
+ if (percentRemaining <= 5) {
110888
+ return { status: "critical", color: "error" };
110889
+ }
110890
+ if (percentRemaining <= 40) {
110891
+ return { status: "warning", color: "warning" };
110892
+ }
110893
+ return { status: "healthy", color: "success" };
110894
+ }
110895
+ function calculatePercentRemaining(remaining, entitlement, unlimited) {
110896
+ if (unlimited) {
110897
+ return 100;
110898
+ }
110899
+ if (entitlement === 0) {
110900
+ return 0;
110901
+ }
110902
+ return Math.max(0, Math.min(100, remaining / entitlement * 100));
110903
+ }
110904
+
110905
+ // src/services/chat-tui/usage.ts
110386
110906
  var formatNumber2 = (num) => {
110387
110907
  return num.toLocaleString();
110388
110908
  };
@@ -110398,11 +110918,16 @@ var formatDuration2 = (ms) => {
110398
110918
  }
110399
110919
  return `${seconds}s`;
110400
110920
  };
110401
- var renderBar = (percent) => {
110921
+ var renderBar = (percent, color) => {
110402
110922
  const clampedPercent = Math.max(0, Math.min(100, percent));
110403
110923
  const filledWidth = Math.round(clampedPercent / 100 * PROGRESS_BAR.WIDTH);
110404
110924
  const emptyWidth = PROGRESS_BAR.WIDTH - filledWidth;
110405
- return PROGRESS_BAR.FILLED_CHAR.repeat(filledWidth) + PROGRESS_BAR.EMPTY_CHAR.repeat(emptyWidth);
110925
+ const filled = PROGRESS_BAR.FILLED_CHAR.repeat(filledWidth);
110926
+ const empty = PROGRESS_BAR.EMPTY_CHAR.repeat(emptyWidth);
110927
+ if (color) {
110928
+ return `${color}${filled}\x1B[2m${empty}\x1B[0m`;
110929
+ }
110930
+ return filled + empty;
110406
110931
  };
110407
110932
  var formatQuotaBar = (name, quota, resetInfo) => {
110408
110933
  const lines = [];
@@ -110413,13 +110938,22 @@ var formatQuotaBar = (name, quota, resetInfo) => {
110413
110938
  }
110414
110939
  if (quota.unlimited) {
110415
110940
  lines.push(name);
110416
- lines.push(PROGRESS_BAR.FILLED_CHAR.repeat(PROGRESS_BAR.WIDTH) + " Unlimited");
110941
+ const greenColor = "\x1B[32m";
110942
+ lines.push(`${greenColor}${PROGRESS_BAR.FILLED_CHAR.repeat(PROGRESS_BAR.WIDTH)}\x1B[0m Unlimited`);
110417
110943
  return lines;
110418
110944
  }
110419
110945
  const used = quota.entitlement - quota.remaining;
110420
110946
  const percentUsed = quota.entitlement > 0 ? used / quota.entitlement * 100 : 0;
110947
+ const percentRemaining = calculatePercentRemaining(quota.remaining, quota.entitlement, quota.unlimited);
110948
+ const statusInfo = getQuotaStatus(percentRemaining);
110949
+ let ansiColor = "\x1B[32m";
110950
+ if (statusInfo.color === "warning") {
110951
+ ansiColor = "\x1B[33m";
110952
+ } else if (statusInfo.color === "error") {
110953
+ ansiColor = "\x1B[31m";
110954
+ }
110421
110955
  lines.push(name);
110422
- lines.push(`${renderBar(percentUsed)} ${percentUsed.toFixed(0)}% used`);
110956
+ lines.push(`${renderBar(percentUsed, ansiColor)} ${percentUsed.toFixed(0)}% used`);
110423
110957
  if (resetInfo) {
110424
110958
  lines.push(resetInfo);
110425
110959
  }
@@ -110745,54 +111279,6 @@ var getFiles = (dir, cwd, maxDepth = FILE_PICKER_DEFAULTS.MAX_DEPTH, currentDept
110745
111279
  }
110746
111280
  };
110747
111281
 
110748
- // src/tui-solid/app.tsx
110749
- init_terminal();
110750
-
110751
- // src/services/exit-message.ts
110752
- import { EOL } from "os";
110753
-
110754
- // src/constants/exit-message.ts
110755
- var EXIT_LOGO = [
110756
- "█▀▀█",
110757
- "█ █",
110758
- "▀▀▀▀"
110759
- ];
110760
- var EXIT_STYLES = {
110761
- RESET: "\x1B[0m",
110762
- DIM: "\x1B[90m",
110763
- HIGHLIGHT: "\x1B[96m",
110764
- BOLD: "\x1B[1m",
110765
- LOGO_COLOR: "\x1B[36m"
110766
- };
110767
- var EXIT_DESCRIPTION_MAX_WIDTH = 50;
110768
- var EXIT_LINE_PADDING = " ";
110769
- var EXIT_LOGO_GAP = " ";
110770
- var EXIT_TRUNCATION_MARKER = "…";
110771
-
110772
- // src/services/exit-message.ts
110773
- var truncateText = (text, maxWidth) => {
110774
- if (text.length <= maxWidth)
110775
- return text;
110776
- return text.slice(0, maxWidth - 1) + EXIT_TRUNCATION_MARKER;
110777
- };
110778
- var formatExitMessage = (sessionId, sessionTitle) => {
110779
- if (!sessionId)
110780
- return "";
110781
- const { RESET, DIM, HIGHLIGHT, LOGO_COLOR } = EXIT_STYLES;
110782
- const pad = EXIT_LINE_PADDING;
110783
- const gap = EXIT_LOGO_GAP;
110784
- const description = sessionTitle ? truncateText(sessionTitle, EXIT_DESCRIPTION_MAX_WIDTH) : "";
110785
- const resumeCommand = `codetyper --resume ${sessionId}`;
110786
- const lines = [
110787
- "",
110788
- `${pad}${LOGO_COLOR}${EXIT_LOGO[0]}${RESET}${gap}${HIGHLIGHT}${description}${RESET}`,
110789
- `${pad}${LOGO_COLOR}${EXIT_LOGO[1]}${RESET}${gap}${DIM}${resumeCommand}${RESET}`,
110790
- `${pad}${LOGO_COLOR}${EXIT_LOGO[2]}${RESET}`,
110791
- ""
110792
- ];
110793
- return lines.join(EOL);
110794
- };
110795
-
110796
111282
  // src/constants/clipboard.ts
110797
111283
  var OSC52_SEQUENCE_PREFIX = "\x1B]52;c;";
110798
111284
  var OSC52_SEQUENCE_SUFFIX = "\x07";
@@ -110948,20 +111434,36 @@ init_version2();
110948
111434
 
110949
111435
  // src/tui-solid/context/exit.tsx
110950
111436
  init_server();
110951
- await init_helper();
111437
+ init_terminal2();
111438
+ await __promiseAll([
111439
+ init_solid(),
111440
+ init_helper()
111441
+ ]);
110952
111442
  var {
110953
111443
  provider: ExitProvider,
110954
111444
  use: useExit
110955
111445
  } = createSimpleContext({
110956
111446
  name: "Exit",
110957
111447
  init: (props) => {
111448
+ const renderer = useRenderer();
110958
111449
  const [exitCode, setExitCode] = createSignal(0);
110959
111450
  const [isExiting, setIsExiting] = createSignal(false);
110960
111451
  const [exitRequested, setExitRequested] = createSignal(false);
110961
- const exit = (code = 0) => {
111452
+ const exit = async (code = 0) => {
110962
111453
  setExitCode(code);
110963
111454
  setIsExiting(true);
110964
- props.onExit?.();
111455
+ try {
111456
+ renderer.setTerminalTitle("");
111457
+ } catch {}
111458
+ renderer.destroy();
111459
+ await props.onExit?.();
111460
+ process.exit(code);
111461
+ };
111462
+ const setExitMessage = (message) => {
111463
+ setGlobalExitMessage(message);
111464
+ };
111465
+ const getExitMessage = () => {
111466
+ return;
110965
111467
  };
110966
111468
  const requestExit = () => {
110967
111469
  setExitRequested(true);
@@ -110980,15 +111482,109 @@ var {
110980
111482
  });
110981
111483
  return {
110982
111484
  exit,
110983
- exitCode,
111485
+ getExitCode: exitCode,
110984
111486
  isExiting,
111487
+ exitRequested,
110985
111488
  requestExit,
110986
111489
  cancelExit,
110987
- confirmExit
111490
+ confirmExit,
111491
+ setExitMessage,
111492
+ getExitMessage
110988
111493
  };
110989
111494
  }
110990
111495
  });
110991
111496
 
111497
+ // src/utils/core/session-stats.ts
111498
+ function formatDuration3(ms) {
111499
+ if (ms < 1000)
111500
+ return `${(ms / 1000).toFixed(3)}s`;
111501
+ const seconds = Math.floor(ms / 1000 % 60);
111502
+ const minutes = Math.floor(ms / (1000 * 60) % 60);
111503
+ const hours = Math.floor(ms / (1000 * 60 * 60));
111504
+ const fractionalSeconds = (ms % 1000 / 1000).toFixed(3).slice(1);
111505
+ if (hours > 0) {
111506
+ return `${hours}h ${minutes}m ${seconds}${fractionalSeconds}s`;
111507
+ }
111508
+ if (minutes > 0) {
111509
+ return `${minutes}m ${seconds}${fractionalSeconds}s`;
111510
+ }
111511
+ return `${seconds}${fractionalSeconds}s`;
111512
+ }
111513
+ function formatTokens(tokens) {
111514
+ if (tokens >= 1e6) {
111515
+ return `${(tokens / 1e6).toFixed(1)}m`;
111516
+ }
111517
+ if (tokens >= 1000) {
111518
+ return `${(tokens / 1000).toFixed(1)}k`;
111519
+ }
111520
+ return tokens.toString();
111521
+ }
111522
+ function calculateCodeChanges(files) {
111523
+ return files.reduce((acc, file2) => ({
111524
+ additions: acc.additions + file2.additions,
111525
+ deletions: acc.deletions + file2.deletions
111526
+ }), { additions: 0, deletions: 0 });
111527
+ }
111528
+ function formatModelUsage(usage) {
111529
+ const parts = [];
111530
+ if (usage.inputTokens > 0) {
111531
+ parts.push(`${formatTokens(usage.inputTokens)} in`);
111532
+ }
111533
+ if (usage.outputTokens > 0) {
111534
+ parts.push(`${formatTokens(usage.outputTokens)} out`);
111535
+ }
111536
+ if (usage.cachedTokens && usage.cachedTokens > 0) {
111537
+ parts.push(`${formatTokens(usage.cachedTokens)} cached`);
111538
+ }
111539
+ return parts.join(", ") || "0 tokens";
111540
+ }
111541
+ function generateSessionSummary(input) {
111542
+ const { sessionId, sessionStats, modifiedFiles, modelName } = input;
111543
+ const { additions, deletions } = calculateCodeChanges(modifiedFiles);
111544
+ const totalSessionTime = Date.now() - sessionStats.startTime;
111545
+ const lines = [
111546
+ "",
111547
+ " ██████╗ ██████╗ ██████╗ ███████╗████████╗██╗ ██╗██████╗ ███████╗██████╗ ",
111548
+ " ██╔════╝██╔═══██╗██╔══██╗██╔════╝╚══██╔══╝╚██╗ ██╔╝██╔══██╗██╔════╝██╔══██╗",
111549
+ " ██║ ██║ ██║██║ ██║█████╗ ██║ ╚████╔╝ ██████╔╝█████╗ ██████╔╝",
111550
+ " ██║ ██║ ██║██║ ██║██╔══╝ ██║ ╚██╔╝ ██╔═══╝ ██╔══╝ ██╔══██╗",
111551
+ " ╚██████╗╚██████╔╝██████╔╝███████╗ ██║ ██║ ██║ ███████╗██║ ██║",
111552
+ " ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝",
111553
+ "",
111554
+ "═══════════════════════════════════════════════════════════════",
111555
+ "",
111556
+ ` Total usage est: 0 Premium requests`,
111557
+ ` API time spent: ${formatDuration3(sessionStats.apiTimeSpent)}`,
111558
+ ` Total session time: ${formatDuration3(totalSessionTime)}`,
111559
+ ` Total code changes: +${additions} -${deletions}`,
111560
+ ""
111561
+ ];
111562
+ if (sessionStats.modelUsage.length > 0) {
111563
+ lines.push(" Breakdown by AI model:");
111564
+ for (const usage of sessionStats.modelUsage) {
111565
+ const displayModel = usage.modelId.length > 20 ? usage.modelId.slice(0, 17) + "..." : usage.modelId;
111566
+ const padding = " ".repeat(Math.max(1, 24 - displayModel.length));
111567
+ const usageStr = formatModelUsage(usage);
111568
+ lines.push(` ${displayModel}${padding}${usageStr} (Est. 0 Premium requests)`);
111569
+ }
111570
+ lines.push("");
111571
+ } else if (modelName) {
111572
+ const displayModel = modelName.length > 20 ? modelName.slice(0, 17) + "..." : modelName;
111573
+ const padding = " ".repeat(Math.max(1, 24 - displayModel.length));
111574
+ const totalIn = sessionStats.inputTokens;
111575
+ const totalOut = sessionStats.outputTokens;
111576
+ lines.push(" Breakdown by AI model:");
111577
+ lines.push(` ${displayModel}${padding}${formatTokens(totalIn)} in, ${formatTokens(totalOut)} out (Est. 0 Premium requests)`);
111578
+ lines.push("");
111579
+ }
111580
+ lines.push(` Resume this session with copilot --resume=${sessionId}`);
111581
+ lines.push("");
111582
+ lines.push("═══════════════════════════════════════════════════════════════");
111583
+ lines.push("");
111584
+ return lines.join(`
111585
+ `);
111586
+ }
111587
+
110992
111588
  // src/tui-solid/context/route.tsx
110993
111589
  init_server2();
110994
111590
  await init_helper();
@@ -114597,7 +115193,7 @@ await __promiseAll([
114597
115193
  init_app(),
114598
115194
  init_theme2()
114599
115195
  ]);
114600
- var formatDuration3 = (ms) => {
115196
+ var formatDuration4 = (ms) => {
114601
115197
  const totalSeconds = Math.floor(ms / TIME_UNITS.SECOND);
114602
115198
  const hours = Math.floor(totalSeconds / 3600);
114603
115199
  const minutes = Math.floor(totalSeconds % 3600 / 60);
@@ -114610,7 +115206,7 @@ var formatDuration3 = (ms) => {
114610
115206
  }
114611
115207
  return `${seconds}s`;
114612
115208
  };
114613
- var formatTokens = (count) => {
115209
+ var formatTokens2 = (count) => {
114614
115210
  if (count >= TOKEN_DISPLAY.K_THRESHOLD) {
114615
115211
  return `${(count / TOKEN_DISPLAY.K_THRESHOLD).toFixed(TOKEN_DISPLAY.DECIMALS)}k`;
114616
115212
  }
@@ -114713,9 +115309,9 @@ function StatusBar() {
114713
115309
  if (isProcessing()) {
114714
115310
  result.push(app.interruptPending() ? STATUS_HINTS.INTERRUPT_CONFIRM : STATUS_HINTS.INTERRUPT);
114715
115311
  }
114716
- result.push(formatDuration3(elapsed()));
115312
+ result.push(formatDuration4(elapsed()));
114717
115313
  if (totalTokens() > 0) {
114718
- result.push(`↓ ${formatTokens(totalTokens())} tokens`);
115314
+ result.push(`↓ ${formatTokens2(totalTokens())} tokens`);
114719
115315
  }
114720
115316
  const stats = app.sessionStats();
114721
115317
  if (stats.thinkingStartTime !== null) {
@@ -117427,6 +118023,264 @@ await __promiseAll([
117427
118023
  init_theme2(),
117428
118024
  init_app()
117429
118025
  ]);
118026
+
118027
+ // src/tui-solid/components/panels/copilot-usage.tsx
118028
+ init_server();
118029
+ init_ui();
118030
+ await __promiseAll([
118031
+ init_solid(),
118032
+ init_solid(),
118033
+ init_solid(),
118034
+ init_solid(),
118035
+ init_solid(),
118036
+ init_solid(),
118037
+ init_solid(),
118038
+ init_solid(),
118039
+ init_core2(),
118040
+ init_theme2(),
118041
+ init_app()
118042
+ ]);
118043
+ init_copilot();
118044
+ var QUOTA_BAR_WIDTH = 30;
118045
+ var formatResetDate = (dateStr) => {
118046
+ try {
118047
+ const date5 = new Date(dateStr);
118048
+ const month = date5.toLocaleString("en-US", {
118049
+ month: "short"
118050
+ });
118051
+ const day = date5.getDate();
118052
+ return `${month} ${day}`;
118053
+ } catch {
118054
+ return dateStr;
118055
+ }
118056
+ };
118057
+ var renderProgressBar2 = (percent, color) => {
118058
+ const clampedPercent = Math.max(0, Math.min(100, percent));
118059
+ const filledWidth = Math.round(clampedPercent / 100 * QUOTA_BAR_WIDTH);
118060
+ const emptyWidth = QUOTA_BAR_WIDTH - filledWidth;
118061
+ return [(() => {
118062
+ var _el$ = createElement("text");
118063
+ setProp(_el$, "fg", color);
118064
+ insert(_el$, () => PROGRESS_BAR.FILLED_CHAR.repeat(filledWidth));
118065
+ return _el$;
118066
+ })(), (() => {
118067
+ var _el$2 = createElement("text");
118068
+ setProp(_el$2, "fg", color);
118069
+ insert(_el$2, () => PROGRESS_BAR.EMPTY_CHAR.repeat(emptyWidth));
118070
+ effect((_$p) => setProp(_el$2, "attributes", TextAttributes.DIM, _$p));
118071
+ return _el$2;
118072
+ })()];
118073
+ };
118074
+ function CopilotQuotaBar(props) {
118075
+ const theme = useTheme();
118076
+ const quotaInfo = createMemo(() => {
118077
+ if (!props.quota) {
118078
+ return {
118079
+ percentRemaining: 0,
118080
+ percentUsed: 0,
118081
+ status: getQuotaStatus(0),
118082
+ unlimited: false,
118083
+ remaining: 0,
118084
+ total: 0
118085
+ };
118086
+ }
118087
+ if (props.quota.unlimited) {
118088
+ return {
118089
+ percentRemaining: 100,
118090
+ percentUsed: 0,
118091
+ status: getQuotaStatus(100),
118092
+ unlimited: true,
118093
+ remaining: 0,
118094
+ total: 0
118095
+ };
118096
+ }
118097
+ const percentRemaining = calculatePercentRemaining(props.quota.remaining, props.quota.entitlement, props.quota.unlimited);
118098
+ const percentUsed = 100 - percentRemaining;
118099
+ return {
118100
+ percentRemaining,
118101
+ percentUsed,
118102
+ status: getQuotaStatus(percentRemaining),
118103
+ unlimited: false,
118104
+ remaining: props.quota.remaining,
118105
+ total: props.quota.entitlement
118106
+ };
118107
+ });
118108
+ const barColor = createMemo(() => {
118109
+ const status = quotaInfo().status.color;
118110
+ if (status === "error")
118111
+ return theme.colors.error;
118112
+ if (status === "warning")
118113
+ return theme.colors.warning;
118114
+ return theme.colors.success;
118115
+ });
118116
+ return (() => {
118117
+ var _el$3 = createElement("box"), _el$4 = createElement("text"), _el$5 = createElement("box"), _el$6 = createElement("box");
118118
+ insertNode(_el$3, _el$4);
118119
+ insertNode(_el$3, _el$5);
118120
+ insertNode(_el$3, _el$6);
118121
+ setProp(_el$3, "flexDirection", "column");
118122
+ setProp(_el$3, "marginBottom", 1);
118123
+ insert(_el$4, () => props.label);
118124
+ setProp(_el$5, "flexDirection", "row");
118125
+ setProp(_el$5, "marginTop", 0);
118126
+ insert(_el$5, createComponent2(Show, {
118127
+ get when() {
118128
+ return !quotaInfo().unlimited;
118129
+ },
118130
+ get fallback() {
118131
+ return (() => {
118132
+ var _el$9 = createElement("text");
118133
+ insert(_el$9, () => PROGRESS_BAR.FILLED_CHAR.repeat(QUOTA_BAR_WIDTH));
118134
+ effect((_$p) => setProp(_el$9, "fg", theme.colors.success, _$p));
118135
+ return _el$9;
118136
+ })();
118137
+ },
118138
+ get children() {
118139
+ return renderProgressBar2(quotaInfo().percentUsed, barColor());
118140
+ }
118141
+ }));
118142
+ setProp(_el$6, "flexDirection", "row");
118143
+ setProp(_el$6, "marginTop", 0);
118144
+ insert(_el$6, createComponent2(Show, {
118145
+ get when() {
118146
+ return quotaInfo().unlimited;
118147
+ },
118148
+ get fallback() {
118149
+ return [(() => {
118150
+ var _el$0 = createElement("text"), _el$1 = createTextNode(`% left`);
118151
+ insertNode(_el$0, _el$1);
118152
+ insert(_el$0, () => Math.round(quotaInfo().percentRemaining), _el$1);
118153
+ effect((_$p) => setProp(_el$0, "fg", barColor(), _$p));
118154
+ return _el$0;
118155
+ })(), createComponent2(Show, {
118156
+ get when() {
118157
+ return props.showPercentage;
118158
+ },
118159
+ get children() {
118160
+ var _el$10 = createElement("text"), _el$11 = createTextNode(` (`), _el$13 = createTextNode(`/`), _el$14 = createTextNode(`)`);
118161
+ insertNode(_el$10, _el$11);
118162
+ insertNode(_el$10, _el$13);
118163
+ insertNode(_el$10, _el$14);
118164
+ insert(_el$10, () => quotaInfo().remaining, _el$13);
118165
+ insert(_el$10, () => quotaInfo().total, _el$14);
118166
+ effect((_$p) => setProp(_el$10, "fg", theme.colors.textDim, _$p));
118167
+ return _el$10;
118168
+ }
118169
+ })];
118170
+ },
118171
+ get children() {
118172
+ var _el$7 = createElement("text");
118173
+ insertNode(_el$7, createTextNode(`Unlimited`));
118174
+ effect((_$p) => setProp(_el$7, "fg", theme.colors.success, _$p));
118175
+ return _el$7;
118176
+ }
118177
+ }));
118178
+ effect((_$p) => setProp(_el$4, "fg", theme.colors.textDim, _$p));
118179
+ return _el$3;
118180
+ })();
118181
+ }
118182
+ function CopilotUsageSection() {
118183
+ const theme = useTheme();
118184
+ const app = useAppStore();
118185
+ const usage = createMemo(() => app.copilotUsage());
118186
+ const loading = createMemo(() => app.copilotUsageLoading());
118187
+ const resetDate = createMemo(() => {
118188
+ const u3 = usage();
118189
+ return u3 ? formatResetDate(u3.quota_reset_date) : "";
118190
+ });
118191
+ return createComponent2(Show, {
118192
+ get when() {
118193
+ return app.provider() === COPILOT_DISPLAY_NAME;
118194
+ },
118195
+ get children() {
118196
+ return [(() => {
118197
+ var _el$15 = createElement("box"), _el$16 = createElement("box"), _el$17 = createElement("text");
118198
+ insertNode(_el$15, _el$16);
118199
+ setProp(_el$15, "flexDirection", "column");
118200
+ setProp(_el$15, "marginBottom", 1);
118201
+ insertNode(_el$16, _el$17);
118202
+ setProp(_el$16, "flexDirection", "row");
118203
+ setProp(_el$16, "justifyContent", "space-between");
118204
+ insertNode(_el$17, createTextNode(`Copilot Usage`));
118205
+ insert(_el$16, createComponent2(Show, {
118206
+ get when() {
118207
+ return loading();
118208
+ },
118209
+ get children() {
118210
+ var _el$19 = createElement("text");
118211
+ insertNode(_el$19, createTextNode(`...`));
118212
+ effect((_$p) => setProp(_el$19, "fg", theme.colors.textDim, _$p));
118213
+ return _el$19;
118214
+ }
118215
+ }), null);
118216
+ insert(_el$15, createComponent2(Show, {
118217
+ get when() {
118218
+ return memo2(() => !!!loading())() && usage();
118219
+ },
118220
+ get fallback() {
118221
+ return (() => {
118222
+ var _el$28 = createElement("box"), _el$29 = createElement("text");
118223
+ insertNode(_el$28, _el$29);
118224
+ setProp(_el$28, "marginTop", 1);
118225
+ insert(_el$29, () => loading() ? "Loading quota..." : "Unable to fetch quota");
118226
+ effect((_$p) => setProp(_el$29, "fg", theme.colors.textDim, _$p));
118227
+ return _el$28;
118228
+ })();
118229
+ },
118230
+ get children() {
118231
+ var _el$21 = createElement("box"), _el$22 = createElement("box"), _el$23 = createElement("text"), _el$24 = createTextNode(`Resets `);
118232
+ insertNode(_el$21, _el$22);
118233
+ setProp(_el$21, "flexDirection", "column");
118234
+ setProp(_el$21, "marginTop", 1);
118235
+ insert(_el$21, createComponent2(CopilotQuotaBar, {
118236
+ label: "Premium Requests",
118237
+ get quota() {
118238
+ return usage()?.quota_snapshots.premium_interactions;
118239
+ }
118240
+ }), _el$22);
118241
+ insert(_el$21, createComponent2(CopilotQuotaBar, {
118242
+ label: "Chat",
118243
+ get quota() {
118244
+ return usage()?.quota_snapshots.chat;
118245
+ }
118246
+ }), _el$22);
118247
+ insert(_el$21, createComponent2(CopilotQuotaBar, {
118248
+ label: "Completions",
118249
+ get quota() {
118250
+ return usage()?.quota_snapshots.completions;
118251
+ }
118252
+ }), _el$22);
118253
+ insertNode(_el$22, _el$23);
118254
+ setProp(_el$22, "marginTop", 0);
118255
+ insertNode(_el$23, _el$24);
118256
+ insert(_el$23, resetDate, null);
118257
+ effect((_$p) => setProp(_el$23, "fg", theme.colors.textDim, _$p));
118258
+ return _el$21;
118259
+ }
118260
+ }), null);
118261
+ effect((_p$) => {
118262
+ var _v$ = theme.colors.text, _v$2 = TextAttributes.BOLD;
118263
+ _v$ !== _p$.e && (_p$.e = setProp(_el$17, "fg", _v$, _p$.e));
118264
+ _v$2 !== _p$.t && (_p$.t = setProp(_el$17, "attributes", _v$2, _p$.t));
118265
+ return _p$;
118266
+ }, {
118267
+ e: undefined,
118268
+ t: undefined
118269
+ });
118270
+ return _el$15;
118271
+ })(), (() => {
118272
+ var _el$25 = createElement("box"), _el$26 = createElement("text");
118273
+ insertNode(_el$25, _el$26);
118274
+ setProp(_el$25, "marginBottom", 1);
118275
+ insertNode(_el$26, createTextNode(`──────────────────────────────────`));
118276
+ effect((_$p) => setProp(_el$26, "fg", theme.colors.border, _$p));
118277
+ return _el$25;
118278
+ })()];
118279
+ }
118280
+ });
118281
+ }
118282
+
118283
+ // src/tui-solid/components/panels/activity-panel.tsx
117430
118284
  var getFileName = (filePath2) => {
117431
118285
  const parts = filePath2.split("/");
117432
118286
  return parts[parts.length - 1] ?? filePath2;
@@ -117490,6 +118344,7 @@ function ActivityPanel() {
117490
118344
  setProp(_el$, "paddingRight", 1);
117491
118345
  setProp(_el$, "paddingTop", 1);
117492
118346
  setProp(_el$, "flexShrink", 0);
118347
+ insert(_el$, createComponent2(CopilotUsageSection, {}), _el$2);
117493
118348
  insertNode(_el$2, _el$3);
117494
118349
  insertNode(_el$2, _el$5);
117495
118350
  insertNode(_el$2, _el$10);
@@ -118352,7 +119207,14 @@ function Session(props) {
118352
119207
  setProp(_el$3, "flexDirection", "column");
118353
119208
  setProp(_el$3, "flexGrow", 1);
118354
119209
  insert(_el$3, createComponent2(LogPanel, {}));
118355
- insert(_el$2, createComponent2(ActivityPanel, {}), null);
119210
+ insert(_el$2, createComponent2(Show, {
119211
+ get when() {
119212
+ return app.activityVisible();
119213
+ },
119214
+ get children() {
119215
+ return createComponent2(ActivityPanel, {});
119216
+ }
119217
+ }), null);
118356
119218
  insert(_el$2, createComponent2(Show, {
118357
119219
  get when() {
118358
119220
  return memo2(() => !!app.todosVisible())() && props.plan;
@@ -118702,6 +119564,7 @@ function Session(props) {
118702
119564
  }
118703
119565
 
118704
119566
  // src/tui-solid/app.tsx
119567
+ init_copilot();
118705
119568
  function ErrorFallback(props) {
118706
119569
  const theme = useTheme();
118707
119570
  return (() => {
@@ -118745,6 +119608,17 @@ function AppContent(props) {
118745
119608
  renderer.disableStdoutInterception();
118746
119609
  const [fileList, setFileList] = createSignal([]);
118747
119610
  setAppStoreRef(app);
119611
+ createEffect(() => {
119612
+ const state4 = appStore.getState();
119613
+ const summary = generateSessionSummary({
119614
+ sessionId: state4.sessionId ?? "unknown",
119615
+ sessionStats: state4.sessionStats,
119616
+ modifiedFiles: state4.modifiedFiles,
119617
+ modelName: state4.model,
119618
+ providerName: state4.provider
119619
+ });
119620
+ exit.setExitMessage(summary);
119621
+ });
118748
119622
  const copySelectionToClipboard = async () => {
118749
119623
  const text = renderer.getSelection()?.getSelectedText();
118750
119624
  if (text && text.length > 0) {
@@ -118790,6 +119664,18 @@ function AppContent(props) {
118790
119664
  await props.onSubmit(props.initialPrompt);
118791
119665
  }, 100);
118792
119666
  }
119667
+ createEffect(() => {
119668
+ const refreshManager = getUsageRefreshManager();
119669
+ const currentProvider = app.provider();
119670
+ if (currentProvider === COPILOT_DISPLAY_NAME) {
119671
+ refreshManager.start(app);
119672
+ } else {
119673
+ refreshManager.stop();
119674
+ }
119675
+ onCleanup(() => {
119676
+ refreshManager.stop();
119677
+ });
119678
+ });
118793
119679
  useKeyboard((evt) => {
118794
119680
  if (matchesAction(evt, "clipboard_copy")) {
118795
119681
  copySelectionToClipboard();
@@ -118866,6 +119752,11 @@ function AppContent(props) {
118866
119752
  evt.preventDefault();
118867
119753
  return;
118868
119754
  }
119755
+ if (matchesAction(evt, "activity_toggle")) {
119756
+ app.toggleActivity();
119757
+ evt.preventDefault();
119758
+ return;
119759
+ }
118869
119760
  if (matchesAction(evt, "command_menu") && app.mode() === "idle" && !app.inputBuffer()) {
118870
119761
  app.openCommandMenu();
118871
119762
  evt.preventDefault();
@@ -119123,20 +120014,7 @@ function App(props) {
119123
120014
  }
119124
120015
  function tui(options2) {
119125
120016
  return new Promise((resolve4) => {
119126
- const {
119127
- writeSync: writeSync2
119128
- } = __require("fs");
119129
120017
  const handleExit = (output) => {
119130
- try {
119131
- writeSync2(1, TERMINAL_RESET);
119132
- const state4 = appStore.getState();
119133
- const firstUserLog = state4?.logs?.find((log2) => log2.type === "user");
119134
- const sessionTitle = firstUserLog?.content;
119135
- const exitMsg = formatExitMessage(output.sessionId, sessionTitle);
119136
- if (exitMsg) {
119137
- writeSync2(1, exitMsg);
119138
- }
119139
- } catch {}
119140
120018
  resolve4(output);
119141
120019
  };
119142
120020
  render(() => createComponent2(App, mergeProps3(options2, {
@@ -119620,9 +120498,6 @@ var projectSetupService = {
119620
120498
  // src/commands/components/execute/index.ts
119621
120499
  var createHandleExit = () => () => {
119622
120500
  cleanupPermissionHandler();
119623
- exitFullscreen();
119624
- clearScreen();
119625
- console.log("Goodbye!");
119626
120501
  process.exit(0);
119627
120502
  };
119628
120503
  var createHandleModelSelect = (ctx) => async (model) => {
@@ -120394,4 +121269,4 @@ ${plan.steps.map((s) => `${s.id}. ${s.description}`).join(`
120394
121269
  });
120395
121270
  program2.parse(process.argv);
120396
121271
 
120397
- //# debugId=8FA2E32387E1AD9964756E2164756E21
121272
+ //# debugId=A334B0496383E8C764756E2164756E21