kimiflare 0.54.0 → 0.54.1

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
@@ -456,28 +456,34 @@ function isCloudQuotaExhaustedError(err) {
456
456
  function humanizeCloudflareError(err) {
457
457
  const { code, httpStatus, message: message2 } = err;
458
458
  if (code === 3040) {
459
- return "Cloudflare Workers AI is at capacity. Retrying automatically\u2026";
459
+ return "Cloudflare Workers AI is at capacity (code: 3040). Please wait a moment and try again.";
460
460
  }
461
461
  if (httpStatus === 429) {
462
- return "Rate limit hit. Please wait a moment and try again.";
462
+ const codeStr = code !== void 0 ? ` (code: ${code})` : "";
463
+ return `Rate limit hit${codeStr}. Please wait a moment and try again.`;
463
464
  }
464
465
  if (httpStatus === 403 || code === 1e4) {
465
- return "Authentication failed. Check that your Cloudflare API token has the 'Workers AI' permission.\nGet a new token: https://dash.cloudflare.com/profile/api-tokens";
466
+ const codeStr = code !== void 0 ? ` (code: ${code})` : "";
467
+ return `Authentication failed${codeStr}. Check that your Cloudflare API token has the 'Workers AI' permission.
468
+ Get a new token: https://dash.cloudflare.com/profile/api-tokens`;
466
469
  }
467
470
  if (httpStatus === 401) {
468
- return "Authentication required. Please check your API token or run `kimiflare auth cloud` if using cloud mode.";
471
+ const codeStr = code !== void 0 ? ` (code: ${code})` : "";
472
+ return `Authentication required${codeStr}. Please check your API token or run \`kimiflare auth cloud\` if using cloud mode.`;
469
473
  }
470
474
  if (httpStatus === 400) {
475
+ const codeStr = code !== void 0 ? ` (code: ${code})` : "";
471
476
  if (message2.includes("invalid escaped character")) {
472
- return "API rejected request (invalid JSON in conversation history). Run /clear to reset if it persists.";
477
+ return `API rejected request${codeStr} (invalid JSON in conversation history). Run /clear to reset if it persists.`;
473
478
  }
474
479
  if (message2.includes("Invalid model ID")) {
475
480
  return message2;
476
481
  }
477
- return "Bad request. The conversation may be too long or contain invalid characters. Run /compact or /clear.";
482
+ return `Bad request${codeStr}. The conversation may be too long or contain invalid characters. Run /compact or /clear.`;
478
483
  }
479
484
  if (httpStatus && httpStatus >= 500) {
480
- return "Cloudflare servers are experiencing issues. Retrying automatically\u2026";
485
+ const codeStr = code !== void 0 ? ` (code: ${code})` : "";
486
+ return `Cloudflare servers are experiencing issues${codeStr}. Please wait a moment and try again.`;
481
487
  }
482
488
  return message2.replace(/\{[\s\S]*?\}/g, "(see logs for details)");
483
489
  }
@@ -589,6 +595,7 @@ function cleanErrorMessage(msg) {
589
595
  function isRetryable(err, attempt) {
590
596
  if (attempt >= MAX_ATTEMPTS - 1) return false;
591
597
  if (err.code !== void 0 && RETRYABLE_CODES.has(err.code)) return true;
598
+ if (err.httpStatus === 429) return true;
592
599
  if (err.httpStatus !== void 0 && err.httpStatus >= 500 && err.httpStatus < 600) return true;
593
600
  if (err.message.includes("Internal server error")) return true;
594
601
  return false;
@@ -653,7 +660,10 @@ async function* runKimi(opts2) {
653
660
  const msg = cleanErrorMessage(rawMsg);
654
661
  const apiErr = new KimiApiError(`kimiflare: ${msg}`, err?.code, res.status);
655
662
  if (isRetryable(apiErr, attempt)) {
656
- const delay = 500 * 2 ** attempt + Math.random() * 250;
663
+ const isRateLimit = apiErr.httpStatus === 429;
664
+ const baseDelay = isRateLimit ? 2e3 : 500;
665
+ const delay = baseDelay * 2 ** attempt + Math.random() * 250;
666
+ logger.warn("runKimi:retrying", { requestId, attempt, code: apiErr.code, httpStatus: apiErr.httpStatus, delay });
657
667
  await sleep(delay, opts2.signal);
658
668
  continue;
659
669
  }
@@ -10571,11 +10581,35 @@ var init_cloud_quota_message = __esm({
10571
10581
  }
10572
10582
  });
10573
10583
 
10584
+ // src/ui/api-error-message.tsx
10585
+ import { Box as Box5, Text as Text5 } from "ink";
10586
+ import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
10587
+ function ApiErrorMessage({ httpStatus, code, message: message2 }) {
10588
+ const theme = useTheme();
10589
+ const parts = [];
10590
+ if (httpStatus !== void 0) parts.push(`HTTP ${httpStatus}`);
10591
+ if (code !== void 0) parts.push(`code: ${code}`);
10592
+ const meta = parts.join(" \xB7 ");
10593
+ return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", borderStyle: "round", borderColor: theme.error, paddingX: 1, marginY: 1, children: [
10594
+ /* @__PURE__ */ jsxs5(Text5, { bold: true, color: theme.error, children: [
10595
+ "\u26A0 ",
10596
+ message2
10597
+ ] }),
10598
+ meta && /* @__PURE__ */ jsx6(Text5, { color: theme.muted?.color ?? theme.info.color, dimColor: theme.muted?.dim ?? true, children: meta })
10599
+ ] });
10600
+ }
10601
+ var init_api_error_message = __esm({
10602
+ "src/ui/api-error-message.tsx"() {
10603
+ "use strict";
10604
+ init_theme_context();
10605
+ }
10606
+ });
10607
+
10574
10608
  // src/ui/chat.tsx
10575
10609
  import React4 from "react";
10576
- import { Box as Box5, Text as Text5 } from "ink";
10610
+ import { Box as Box6, Text as Text6 } from "ink";
10577
10611
  import Spinner2 from "ink-spinner";
10578
- import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
10612
+ import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
10579
10613
  function toolSignature(name, args) {
10580
10614
  return `${name}:${args}`;
10581
10615
  }
@@ -10588,6 +10622,7 @@ var init_chat = __esm({
10588
10622
  init_theme_context();
10589
10623
  init_narrator();
10590
10624
  init_cloud_quota_message();
10625
+ init_api_error_message();
10591
10626
  ChatView = React4.memo(function ChatView2({ events, showReasoning, verbose, intentTier }) {
10592
10627
  const theme = useTheme();
10593
10628
  const toolCounts = /* @__PURE__ */ new Map();
@@ -10601,12 +10636,12 @@ var init_chat = __esm({
10601
10636
  for (const [sig, count] of toolCounts) {
10602
10637
  if (count >= 3) repeatedSigs.add(sig);
10603
10638
  }
10604
- return /* @__PURE__ */ jsx6(Box5, { flexDirection: "column", children: events.map((e, i) => {
10639
+ return /* @__PURE__ */ jsx7(Box6, { flexDirection: "column", children: events.map((e, i) => {
10605
10640
  const prev = events[i - 1];
10606
10641
  const showSeparator = !!(e.kind === "user" && prev && (prev.kind === "assistant" || prev.kind === "tool"));
10607
- return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", children: [
10608
- showSeparator && /* @__PURE__ */ jsx6(Box5, { marginY: 1, children: /* @__PURE__ */ jsx6(Text5, { color: theme.info.color, children: "\u2500".repeat(40) }) }),
10609
- /* @__PURE__ */ jsx6(EventView, { evt: e, showReasoning, verbose, repeatedSigs, intentTier })
10642
+ return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", children: [
10643
+ showSeparator && /* @__PURE__ */ jsx7(Box6, { marginY: 1, children: /* @__PURE__ */ jsx7(Text6, { color: theme.info.color, children: "\u2500".repeat(40) }) }),
10644
+ /* @__PURE__ */ jsx7(EventView, { evt: e, showReasoning, verbose, repeatedSigs, intentTier })
10610
10645
  ] }, e.key);
10611
10646
  }) });
10612
10647
  });
@@ -10621,61 +10656,61 @@ var init_chat = __esm({
10621
10656
  if (evt.kind === "user") {
10622
10657
  if (evt.queued) {
10623
10658
  const mutedColor = theme.muted?.color ?? theme.info.color;
10624
- return /* @__PURE__ */ jsx6(Box5, { flexDirection: "column", children: /* @__PURE__ */ jsxs5(Box5, { children: [
10625
- /* @__PURE__ */ jsxs5(Text5, { italic: true, color: mutedColor, children: [
10659
+ return /* @__PURE__ */ jsx7(Box6, { flexDirection: "column", children: /* @__PURE__ */ jsxs6(Box6, { children: [
10660
+ /* @__PURE__ */ jsxs6(Text6, { italic: true, color: mutedColor, children: [
10626
10661
  "\xB7\xB7\xB7",
10627
10662
  " "
10628
10663
  ] }),
10629
- /* @__PURE__ */ jsx6(Text5, { italic: true, color: mutedColor, children: evt.text }),
10630
- /* @__PURE__ */ jsxs5(Text5, { italic: true, color: mutedColor, children: [
10664
+ /* @__PURE__ */ jsx7(Text6, { italic: true, color: mutedColor, children: evt.text }),
10665
+ /* @__PURE__ */ jsxs6(Text6, { italic: true, color: mutedColor, children: [
10631
10666
  " ",
10632
10667
  "(queued)"
10633
10668
  ] })
10634
10669
  ] }) });
10635
10670
  }
10636
- return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", children: [
10637
- /* @__PURE__ */ jsxs5(Box5, { children: [
10638
- /* @__PURE__ */ jsxs5(Text5, { bold: true, color: theme.user, children: [
10671
+ return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", children: [
10672
+ /* @__PURE__ */ jsxs6(Box6, { children: [
10673
+ /* @__PURE__ */ jsxs6(Text6, { bold: true, color: theme.user, children: [
10639
10674
  "\u203A",
10640
10675
  " "
10641
10676
  ] }),
10642
- /* @__PURE__ */ jsx6(Text5, { bold: true, children: evt.text })
10677
+ /* @__PURE__ */ jsx7(Text6, { bold: true, children: evt.text })
10643
10678
  ] }),
10644
- evt.images && evt.images.length > 0 && /* @__PURE__ */ jsx6(Box5, { paddingLeft: 2, children: /* @__PURE__ */ jsxs5(Text5, { color: theme.info.color, children: [
10679
+ evt.images && evt.images.length > 0 && /* @__PURE__ */ jsx7(Box6, { paddingLeft: 2, children: /* @__PURE__ */ jsxs6(Text6, { color: theme.info.color, children: [
10645
10680
  "\u{1F5BC}\uFE0F ",
10646
10681
  evt.images.join(", ")
10647
10682
  ] }) })
10648
10683
  ] });
10649
10684
  }
10650
10685
  if (evt.kind === "assistant") {
10651
- return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", paddingLeft: 2, children: [
10652
- showReasoning && evt.reasoning ? /* @__PURE__ */ jsx6(Box5, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsxs5(Text5, { color: theme.reasoning.color, children: [
10686
+ return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", paddingLeft: 2, children: [
10687
+ showReasoning && evt.reasoning ? /* @__PURE__ */ jsx7(Box6, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsxs6(Text6, { color: theme.reasoning.color, children: [
10653
10688
  "thinking\u2026",
10654
10689
  " ",
10655
10690
  evt.reasoning.length > 400 ? evt.reasoning.slice(0, 400) + "\u2026" : evt.reasoning
10656
10691
  ] }) }) : null,
10657
- evt.text ? /* @__PURE__ */ jsx6(MD, { text: evt.text }) : null,
10658
- evt.streaming && /* @__PURE__ */ jsx6(Text5, { color: theme.spinner, children: /* @__PURE__ */ jsx6(Spinner2, { type: "dots" }) })
10692
+ evt.text ? /* @__PURE__ */ jsx7(MD, { text: evt.text }) : null,
10693
+ evt.streaming && /* @__PURE__ */ jsx7(Text6, { color: theme.spinner, children: /* @__PURE__ */ jsx7(Spinner2, { type: "dots" }) })
10659
10694
  ] });
10660
10695
  }
10661
10696
  if (evt.kind === "tool") {
10662
10697
  const isRepeated = repeatedSigs?.has(toolSignature(evt.name, evt.args)) ?? false;
10663
- return /* @__PURE__ */ jsx6(ToolView, { evt, verbose, isRepeated, intentTier });
10698
+ return /* @__PURE__ */ jsx7(ToolView, { evt, verbose, isRepeated, intentTier });
10664
10699
  }
10665
10700
  if (evt.kind === "info") {
10666
- return /* @__PURE__ */ jsxs5(Text5, { color: theme.info.color, children: [
10701
+ return /* @__PURE__ */ jsxs6(Text6, { color: theme.info.color, children: [
10667
10702
  "\xB7 ",
10668
10703
  humanizeInfo(evt.text, intentTier)
10669
10704
  ] });
10670
10705
  }
10671
10706
  if (evt.kind === "memory") {
10672
- return /* @__PURE__ */ jsxs5(Text5, { color: theme.info.color, children: [
10707
+ return /* @__PURE__ */ jsxs6(Text6, { color: theme.info.color, children: [
10673
10708
  "\u25C8 ",
10674
10709
  humanizeMemory(evt.text, intentTier)
10675
10710
  ] });
10676
10711
  }
10677
10712
  if (evt.kind === "cloud_quota_exhausted") {
10678
- return /* @__PURE__ */ jsx6(
10713
+ return /* @__PURE__ */ jsx7(
10679
10714
  CloudQuotaMessage,
10680
10715
  {
10681
10716
  used: evt.used,
@@ -10694,9 +10729,19 @@ var init_chat = __esm({
10694
10729
  }
10695
10730
  const metaText = humanizeMeta(metaParts, intentTier ?? evt.intentTier);
10696
10731
  if (!metaText) return null;
10697
- return /* @__PURE__ */ jsx6(Text5, { color: theme.info.color, dimColor: true, children: metaText });
10732
+ return /* @__PURE__ */ jsx7(Text6, { color: theme.info.color, dimColor: true, children: metaText });
10733
+ }
10734
+ if (evt.kind === "api_error") {
10735
+ return /* @__PURE__ */ jsx7(
10736
+ ApiErrorMessage,
10737
+ {
10738
+ httpStatus: evt.httpStatus,
10739
+ code: evt.code,
10740
+ message: evt.message
10741
+ }
10742
+ );
10698
10743
  }
10699
- return /* @__PURE__ */ jsxs5(Text5, { color: theme.error, children: [
10744
+ return /* @__PURE__ */ jsxs6(Text6, { color: theme.error, children: [
10700
10745
  "! ",
10701
10746
  evt.text
10702
10747
  ] });
@@ -10706,9 +10751,9 @@ var init_chat = __esm({
10706
10751
 
10707
10752
  // src/ui/status.tsx
10708
10753
  import { useEffect as useEffect2, useState as useState2 } from "react";
10709
- import { Box as Box6, Text as Text6 } from "ink";
10754
+ import { Box as Box7, Text as Text7 } from "ink";
10710
10755
  import Spinner3 from "ink-spinner";
10711
- import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
10756
+ import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
10712
10757
  function StatusBar({ usage, sessionUsage, thinking, turnStartedAt, mode, contextLimit, gatewayMeta, codeMode, cloudMode, cloudBudget, skillsActive, memoryRecalled, phase, currentTool, lastActivityAt, kimiMdStale, gitBranch, intentTier }) {
10713
10758
  const theme = useTheme();
10714
10759
  const [now2, setNow] = useState2(Date.now());
@@ -10736,32 +10781,32 @@ function StatusBar({ usage, sessionUsage, thinking, turnStartedAt, mode, context
10736
10781
  const idleLabel = idleMs > 3e4 ? ` (idle ${formatElapsed2(Math.floor(idleMs / 1e3))})` : "";
10737
10782
  const thinkingText = metaParts.length > 0 ? `${phaseLabel}${elapsed ? ` \xB7 ${elapsed}` : ""}${idleLabel} \xB7 ${metaParts.join(" \xB7 ")}` : `${phaseLabel}${elapsed ? ` \xB7 ${elapsed}` : ""}${idleLabel}`;
10738
10783
  const readyText = idleParts.length > 0 ? `${idleParts.join(" \xB7 ")} \xB7 ready` : "ready";
10739
- return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", children: [
10740
- /* @__PURE__ */ jsxs6(Box6, { children: [
10741
- /* @__PURE__ */ jsxs6(Text6, { color: modeColor, bold: true, children: [
10784
+ return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
10785
+ /* @__PURE__ */ jsxs7(Box7, { children: [
10786
+ /* @__PURE__ */ jsxs7(Text7, { color: modeColor, bold: true, children: [
10742
10787
  "[",
10743
10788
  mode,
10744
10789
  "]"
10745
10790
  ] }),
10746
- /* @__PURE__ */ jsx7(Text6, { children: " " }),
10747
- thinking ? /* @__PURE__ */ jsxs6(Text6, { color: theme.spinner, children: [
10748
- /* @__PURE__ */ jsx7(Spinner3, { type: "dots2" }),
10791
+ /* @__PURE__ */ jsx8(Text7, { children: " " }),
10792
+ thinking ? /* @__PURE__ */ jsxs7(Text7, { color: theme.spinner, children: [
10793
+ /* @__PURE__ */ jsx8(Spinner3, { type: "dots2" }),
10749
10794
  " ",
10750
10795
  thinkingText
10751
- ] }) : /* @__PURE__ */ jsx7(Text6, { color: theme.info.color, children: readyText })
10796
+ ] }) : /* @__PURE__ */ jsx8(Text7, { color: theme.info.color, children: readyText })
10752
10797
  ] }),
10753
- usage && /* @__PURE__ */ jsxs6(Box6, { children: [
10754
- /* @__PURE__ */ jsx7(Text6, { color: theme.info.color, children: buildRightParts(usage, contextLimit, sessionUsage, gatewayMeta, cloudMode, cloudBudget).join(" \xB7 ") }),
10755
- warn ? /* @__PURE__ */ jsxs6(Text6, { color: theme.warn, bold: true, children: [
10798
+ usage && /* @__PURE__ */ jsxs7(Box7, { children: [
10799
+ /* @__PURE__ */ jsx8(Text7, { color: theme.info.color, children: buildRightParts(usage, contextLimit, sessionUsage, gatewayMeta, cloudMode, cloudBudget).join(" \xB7 ") }),
10800
+ warn ? /* @__PURE__ */ jsxs7(Text7, { color: theme.warn, bold: true, children: [
10756
10801
  " \xB7 ",
10757
10802
  "/compact recommended"
10758
10803
  ] }) : null,
10759
- kimiMdStale ? /* @__PURE__ */ jsxs6(Text6, { color: theme.warn, bold: true, children: [
10804
+ kimiMdStale ? /* @__PURE__ */ jsxs7(Text7, { color: theme.warn, bold: true, children: [
10760
10805
  " \xB7 ",
10761
10806
  "\u26A0 KIMI.md stale \xB7 run /init"
10762
10807
  ] }) : null
10763
10808
  ] }),
10764
- !thinking && /* @__PURE__ */ jsx7(Box6, { children: /* @__PURE__ */ jsx7(Text6, { color: theme.muted?.color ?? theme.info.color, dimColor: theme.muted?.dim, children: "tip: shift+tab cycles mode" }) })
10809
+ !thinking && /* @__PURE__ */ jsx8(Box7, { children: /* @__PURE__ */ jsx8(Text7, { color: theme.muted?.color ?? theme.info.color, dimColor: theme.muted?.dim, children: "tip: shift+tab cycles mode" }) })
10765
10810
  ] });
10766
10811
  }
10767
10812
  function buildRightParts(usage, contextLimit, sessionUsage, gatewayMeta, cloudMode, cloudBudget) {
@@ -11342,8 +11387,8 @@ var init_source = __esm({
11342
11387
 
11343
11388
  // src/ui/text-input.tsx
11344
11389
  import { useState as useState3, useEffect as useEffect3, useRef } from "react";
11345
- import { Text as Text7, useInput } from "ink";
11346
- import { jsx as jsx8 } from "react/jsx-runtime";
11390
+ import { Text as Text8, useInput } from "ink";
11391
+ import { jsx as jsx9 } from "react/jsx-runtime";
11347
11392
  function shouldTreatAsPaste(input) {
11348
11393
  if (input.length >= PASTE_CHAR_THRESHOLD) return true;
11349
11394
  const newlines = (input.match(/\n/g) ?? []).length;
@@ -11564,7 +11609,7 @@ function CustomTextInput({
11564
11609
  } else if (cursorOffset === displayValue.length) {
11565
11610
  renderedValue += source_default.inverse(" ");
11566
11611
  }
11567
- return /* @__PURE__ */ jsx8(Text7, { children: renderedValue });
11612
+ return /* @__PURE__ */ jsx9(Text8, { children: renderedValue });
11568
11613
  }
11569
11614
  function findPasteTokenEndingAt(value, pos, pastes) {
11570
11615
  if (pos <= 0 || value[pos - 1] !== "\u2998") return -1;
@@ -11587,9 +11632,9 @@ var init_text_input = __esm({
11587
11632
 
11588
11633
  // src/ui/permission.tsx
11589
11634
  import { useState as useState4, useCallback } from "react";
11590
- import { Box as Box7, Text as Text8, useInput as useInput2 } from "ink";
11635
+ import { Box as Box8, Text as Text9, useInput as useInput2 } from "ink";
11591
11636
  import { platform as platform2 } from "os";
11592
- import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
11637
+ import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
11593
11638
  function formatSelection(label, shortcut) {
11594
11639
  return `${label} [${MOD_KEY}+${shortcut}]`;
11595
11640
  }
@@ -11677,10 +11722,10 @@ function PermissionModal({ tool, args, onDecide, onFeedback }) {
11677
11722
  { isActive: !feedbackActive }
11678
11723
  );
11679
11724
  if (showHelp) {
11680
- return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", borderStyle: "round", borderColor: theme.permission, paddingX: 1, children: [
11681
- /* @__PURE__ */ jsx9(Text8, { color: theme.permission, bold: true, children: "Permission modal \u2014 keyboard shortcuts" }),
11682
- /* @__PURE__ */ jsx9(Text8, { color: theme.info.color, children: "\u2191 / \u2193 or j / k \u2014 navigate options" }),
11683
- /* @__PURE__ */ jsxs7(Text8, { color: theme.info.color, children: [
11725
+ return /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", borderStyle: "round", borderColor: theme.permission, paddingX: 1, children: [
11726
+ /* @__PURE__ */ jsx10(Text9, { color: theme.permission, bold: true, children: "Permission modal \u2014 keyboard shortcuts" }),
11727
+ /* @__PURE__ */ jsx10(Text9, { color: theme.info.color, children: "\u2191 / \u2193 or j / k \u2014 navigate options" }),
11728
+ /* @__PURE__ */ jsxs8(Text9, { color: theme.info.color, children: [
11684
11729
  MOD_KEY,
11685
11730
  "+1 / ",
11686
11731
  MOD_KEY,
@@ -11688,31 +11733,31 @@ function PermissionModal({ tool, args, onDecide, onFeedback }) {
11688
11733
  MOD_KEY,
11689
11734
  "+3 \u2014 select option directly"
11690
11735
  ] }),
11691
- /* @__PURE__ */ jsx9(Text8, { color: theme.info.color, children: "Enter \u2014 confirm selection" }),
11692
- /* @__PURE__ */ jsx9(Text8, { color: theme.info.color, children: "Esc \u2014 deny and close" }),
11693
- /* @__PURE__ */ jsx9(Text8, { color: theme.info.color, children: "? \u2014 toggle this help" }),
11694
- /* @__PURE__ */ jsx9(Text8, { color: theme.info.color, children: "When feedback input is open:" }),
11695
- /* @__PURE__ */ jsx9(Text8, { color: theme.info.color, children: " Enter \u2014 submit feedback and deny" }),
11696
- /* @__PURE__ */ jsx9(Text8, { color: theme.info.color, children: " Esc \u2014 deny without feedback" }),
11697
- /* @__PURE__ */ jsx9(Box7, { marginTop: 1, children: /* @__PURE__ */ jsx9(Text8, { color: theme.accent, children: "Press any key to close" }) })
11736
+ /* @__PURE__ */ jsx10(Text9, { color: theme.info.color, children: "Enter \u2014 confirm selection" }),
11737
+ /* @__PURE__ */ jsx10(Text9, { color: theme.info.color, children: "Esc \u2014 deny and close" }),
11738
+ /* @__PURE__ */ jsx10(Text9, { color: theme.info.color, children: "? \u2014 toggle this help" }),
11739
+ /* @__PURE__ */ jsx10(Text9, { color: theme.info.color, children: "When feedback input is open:" }),
11740
+ /* @__PURE__ */ jsx10(Text9, { color: theme.info.color, children: " Enter \u2014 submit feedback and deny" }),
11741
+ /* @__PURE__ */ jsx10(Text9, { color: theme.info.color, children: " Esc \u2014 deny without feedback" }),
11742
+ /* @__PURE__ */ jsx10(Box8, { marginTop: 1, children: /* @__PURE__ */ jsx10(Text9, { color: theme.accent, children: "Press any key to close" }) })
11698
11743
  ] });
11699
11744
  }
11700
- return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", borderStyle: "round", borderColor: theme.permission, paddingX: 1, children: [
11701
- /* @__PURE__ */ jsx9(Text8, { color: theme.permission, bold: true, children: "Permission requested" }),
11702
- /* @__PURE__ */ jsxs7(Text8, { children: [
11745
+ return /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", borderStyle: "round", borderColor: theme.permission, paddingX: 1, children: [
11746
+ /* @__PURE__ */ jsx10(Text9, { color: theme.permission, bold: true, children: "Permission requested" }),
11747
+ /* @__PURE__ */ jsxs8(Text9, { children: [
11703
11748
  "tool: ",
11704
- /* @__PURE__ */ jsx9(Text8, { color: theme.tool, children: tool.name })
11749
+ /* @__PURE__ */ jsx10(Text9, { color: theme.tool, children: tool.name })
11705
11750
  ] }),
11706
- render2?.title ? /* @__PURE__ */ jsxs7(Text8, { children: [
11751
+ render2?.title ? /* @__PURE__ */ jsxs8(Text9, { children: [
11707
11752
  "action: ",
11708
11753
  render2.title
11709
11754
  ] }) : null,
11710
- render2?.diff ? /* @__PURE__ */ jsx9(Box7, { marginTop: 1, flexDirection: "column", children: /* @__PURE__ */ jsx9(DiffView, { ...render2.diff }) }) : /* @__PURE__ */ jsxs7(Text8, { color: theme.info.color, children: [
11755
+ render2?.diff ? /* @__PURE__ */ jsx10(Box8, { marginTop: 1, flexDirection: "column", children: /* @__PURE__ */ jsx10(DiffView, { ...render2.diff }) }) : /* @__PURE__ */ jsxs8(Text9, { color: theme.info.color, children: [
11711
11756
  "args: ",
11712
11757
  JSON.stringify(args)
11713
11758
  ] }),
11714
- /* @__PURE__ */ jsx9(Box7, { marginTop: 1, flexDirection: "column", children: OPTIONS.map((opt, i) => /* @__PURE__ */ jsxs7(
11715
- Text8,
11759
+ /* @__PURE__ */ jsx10(Box8, { marginTop: 1, flexDirection: "column", children: OPTIONS.map((opt, i) => /* @__PURE__ */ jsxs8(
11760
+ Text9,
11716
11761
  {
11717
11762
  color: i === selectedIndex ? theme.accent : void 0,
11718
11763
  bold: i === selectedIndex,
@@ -11723,10 +11768,10 @@ function PermissionModal({ tool, args, onDecide, onFeedback }) {
11723
11768
  },
11724
11769
  opt.value
11725
11770
  )) }),
11726
- feedbackActive && /* @__PURE__ */ jsxs7(Box7, { marginTop: 1, flexDirection: "column", children: [
11727
- /* @__PURE__ */ jsx9(Text8, { color: theme.palette.error, children: "Tell me what to do instead" }),
11728
- /* @__PURE__ */ jsx9(Text8, { color: theme.info.color, dimColor: true, children: "Press Esc to deny without feedback" }),
11729
- /* @__PURE__ */ jsx9(
11771
+ feedbackActive && /* @__PURE__ */ jsxs8(Box8, { marginTop: 1, flexDirection: "column", children: [
11772
+ /* @__PURE__ */ jsx10(Text9, { color: theme.palette.error, children: "Tell me what to do instead" }),
11773
+ /* @__PURE__ */ jsx10(Text9, { color: theme.info.color, dimColor: true, children: "Press Esc to deny without feedback" }),
11774
+ /* @__PURE__ */ jsx10(
11730
11775
  CustomTextInput,
11731
11776
  {
11732
11777
  value: feedbackValue,
@@ -11756,27 +11801,27 @@ var init_permission = __esm({
11756
11801
  });
11757
11802
 
11758
11803
  // src/ui/limit-modal.tsx
11759
- import { Box as Box8, Text as Text9 } from "ink";
11804
+ import { Box as Box9, Text as Text10 } from "ink";
11760
11805
  import SelectInput from "ink-select-input";
11761
- import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
11806
+ import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
11762
11807
  function LimitModal({ limit, onDecide }) {
11763
11808
  const theme = useTheme();
11764
11809
  const items = [
11765
11810
  { label: "Continue", value: "continue" },
11766
11811
  { label: "Stop", value: "stop" }
11767
11812
  ];
11768
- return /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", borderStyle: "round", borderColor: theme.error, paddingX: 1, children: [
11769
- /* @__PURE__ */ jsxs8(Text9, { color: theme.error, bold: true, children: [
11813
+ return /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", borderStyle: "round", borderColor: theme.error, paddingX: 1, children: [
11814
+ /* @__PURE__ */ jsxs9(Text10, { color: theme.error, bold: true, children: [
11770
11815
  "Tool-call limit reached (",
11771
11816
  limit,
11772
11817
  ")"
11773
11818
  ] }),
11774
- /* @__PURE__ */ jsxs8(Text9, { dimColor: true, children: [
11819
+ /* @__PURE__ */ jsxs9(Text10, { dimColor: true, children: [
11775
11820
  "This session has made ",
11776
11821
  limit,
11777
11822
  " tool calls. What would you like to do?"
11778
11823
  ] }),
11779
- /* @__PURE__ */ jsx10(Box8, { marginTop: 1, children: /* @__PURE__ */ jsx10(
11824
+ /* @__PURE__ */ jsx11(Box9, { marginTop: 1, children: /* @__PURE__ */ jsx11(
11780
11825
  SelectInput,
11781
11826
  {
11782
11827
  items,
@@ -11863,9 +11908,9 @@ var init_fuzzy = __esm({
11863
11908
 
11864
11909
  // src/ui/resume-picker.tsx
11865
11910
  import { useState as useState5 } from "react";
11866
- import { Box as Box9, Text as Text10, useInput as useInput3 } from "ink";
11911
+ import { Box as Box10, Text as Text11, useInput as useInput3 } from "ink";
11867
11912
  import SelectInput2 from "ink-select-input";
11868
- import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
11913
+ import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
11869
11914
  function ResumePicker({ sessions, onPick }) {
11870
11915
  const theme = useTheme();
11871
11916
  const [page, setPage] = useState5(0);
@@ -11906,10 +11951,10 @@ function ResumePicker({ sessions, onPick }) {
11906
11951
  }
11907
11952
  });
11908
11953
  if (sessions.length === 0) {
11909
- return /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
11910
- /* @__PURE__ */ jsx11(Text10, { color: theme.accent, bold: true, children: "Resume a session" }),
11911
- /* @__PURE__ */ jsx11(Text10, { color: theme.info.color, children: "No saved sessions yet. Press Enter to dismiss." }),
11912
- /* @__PURE__ */ jsx11(Box9, { marginTop: 1, children: /* @__PURE__ */ jsx11(
11954
+ return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
11955
+ /* @__PURE__ */ jsx12(Text11, { color: theme.accent, bold: true, children: "Resume a session" }),
11956
+ /* @__PURE__ */ jsx12(Text11, { color: theme.info.color, children: "No saved sessions yet. Press Enter to dismiss." }),
11957
+ /* @__PURE__ */ jsx12(Box10, { marginTop: 1, children: /* @__PURE__ */ jsx12(
11913
11958
  SelectInput2,
11914
11959
  {
11915
11960
  items: [{ label: "(back)", value: "__cancel__" }],
@@ -11922,9 +11967,9 @@ function ResumePicker({ sessions, onPick }) {
11922
11967
  label: `${formatDate(s.updatedAt)} \xB7 ${s.messageCount} msgs \xB7 ${s.title ?? s.firstPrompt}`,
11923
11968
  value: s.id
11924
11969
  }));
11925
- return /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
11926
- /* @__PURE__ */ jsx11(Text10, { color: theme.accent, bold: true, children: "Resume a session" }),
11927
- /* @__PURE__ */ jsxs9(Text10, { color: theme.info.color, children: [
11970
+ return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
11971
+ /* @__PURE__ */ jsx12(Text11, { color: theme.accent, bold: true, children: "Resume a session" }),
11972
+ /* @__PURE__ */ jsxs10(Text11, { color: theme.info.color, children: [
11928
11973
  query ? `Search: ${query}\u258C` : "Type to search\u2026",
11929
11974
  " \xB7 Page ",
11930
11975
  safePage + 1,
@@ -11934,7 +11979,7 @@ function ResumePicker({ sessions, onPick }) {
11934
11979
  filtered.length,
11935
11980
  " total)"
11936
11981
  ] }),
11937
- /* @__PURE__ */ jsx11(Box9, { marginTop: 1, children: /* @__PURE__ */ jsx11(
11982
+ /* @__PURE__ */ jsx12(Box10, { marginTop: 1, children: /* @__PURE__ */ jsx12(
11938
11983
  SelectInput2,
11939
11984
  {
11940
11985
  items,
@@ -11949,7 +11994,7 @@ function ResumePicker({ sessions, onPick }) {
11949
11994
  }
11950
11995
  }
11951
11996
  ) }),
11952
- /* @__PURE__ */ jsx11(Box9, { marginTop: 1, children: /* @__PURE__ */ jsxs9(Text10, { color: theme.info.color, children: [
11997
+ /* @__PURE__ */ jsx12(Box10, { marginTop: 1, children: /* @__PURE__ */ jsxs10(Text11, { color: theme.info.color, children: [
11953
11998
  safePage > 0 ? "\u2190 prev " : "",
11954
11999
  safePage < totalPages - 1 ? "\u2192 next " : "",
11955
12000
  "q: cancel"
@@ -11981,9 +12026,9 @@ var init_resume_picker = __esm({
11981
12026
 
11982
12027
  // src/ui/checkpoint-picker.tsx
11983
12028
  import { useState as useState6 } from "react";
11984
- import { Box as Box10, Text as Text11, useInput as useInput4 } from "ink";
12029
+ import { Box as Box11, Text as Text12, useInput as useInput4 } from "ink";
11985
12030
  import SelectInput3 from "ink-select-input";
11986
- import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
12031
+ import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
11987
12032
  function CheckpointPicker({ session, checkpoints, onPick }) {
11988
12033
  const theme = useTheme();
11989
12034
  const [selectedIndex, setSelectedIndex] = useState6(0);
@@ -12003,16 +12048,16 @@ function CheckpointPicker({ session, checkpoints, onPick }) {
12003
12048
  value: cp.id
12004
12049
  }))
12005
12050
  ];
12006
- return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
12007
- /* @__PURE__ */ jsx12(Text11, { color: theme.accent, bold: true, children: session.firstPrompt.slice(0, 50) }),
12008
- /* @__PURE__ */ jsxs10(Text11, { color: theme.info.color, children: [
12051
+ return /* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
12052
+ /* @__PURE__ */ jsx13(Text12, { color: theme.accent, bold: true, children: session.firstPrompt.slice(0, 50) }),
12053
+ /* @__PURE__ */ jsxs11(Text12, { color: theme.info.color, children: [
12009
12054
  session.messageCount,
12010
12055
  " turns \xB7 ",
12011
12056
  checkpoints.length,
12012
12057
  " checkpoint",
12013
12058
  checkpoints.length === 1 ? "" : "s"
12014
12059
  ] }),
12015
- /* @__PURE__ */ jsx12(Box10, { marginTop: 1, children: /* @__PURE__ */ jsx12(
12060
+ /* @__PURE__ */ jsx13(Box11, { marginTop: 1, children: /* @__PURE__ */ jsx13(
12016
12061
  SelectInput3,
12017
12062
  {
12018
12063
  items,
@@ -12030,7 +12075,7 @@ function CheckpointPicker({ session, checkpoints, onPick }) {
12030
12075
  }
12031
12076
  }
12032
12077
  ) }),
12033
- /* @__PURE__ */ jsx12(Box10, { marginTop: 1, children: /* @__PURE__ */ jsx12(Text11, { color: theme.info.color, children: "q: cancel / go back" }) })
12078
+ /* @__PURE__ */ jsx13(Box11, { marginTop: 1, children: /* @__PURE__ */ jsx13(Text12, { color: theme.info.color, children: "q: cancel / go back" }) })
12034
12079
  ] });
12035
12080
  }
12036
12081
  function formatDate2(iso) {
@@ -12055,9 +12100,9 @@ var init_checkpoint_picker = __esm({
12055
12100
 
12056
12101
  // src/ui/task-list.tsx
12057
12102
  import { useEffect as useEffect4, useRef as useRef2, useState as useState7 } from "react";
12058
- import { Box as Box11, Text as Text12 } from "ink";
12103
+ import { Box as Box12, Text as Text13 } from "ink";
12059
12104
  import Spinner4 from "ink-spinner";
12060
- import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
12105
+ import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
12061
12106
  function TaskList({ tasks, startedAt, tokensDelta }) {
12062
12107
  const theme = useTheme();
12063
12108
  const [now2, setNow] = useState7(Date.now());
@@ -12095,18 +12140,18 @@ function TaskList({ tasks, startedAt, tokensDelta }) {
12095
12140
  const headerStats = [elapsed, tokensDelta > 0 ? `\u2191 ${formatTokens3(tokensDelta)} tokens` : null].filter(Boolean).join(" \xB7 ");
12096
12141
  const visibleTasks = tasks.slice(0, MAX_VISIBLE);
12097
12142
  const hiddenPending = Math.max(0, tasks.length - visibleTasks.length);
12098
- return /* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", marginBottom: 1, children: [
12099
- /* @__PURE__ */ jsxs11(Box11, { children: [
12100
- /* @__PURE__ */ jsx13(Text12, { color: celebrating ? theme.palette.success : allDone ? "green" : theme.accent, bold: true, children: celebrating ? `\u2728 ${header}` : header }),
12101
- headerStats && /* @__PURE__ */ jsxs11(Text12, { color: theme.info.color, children: [
12143
+ return /* @__PURE__ */ jsxs12(Box12, { flexDirection: "column", marginBottom: 1, children: [
12144
+ /* @__PURE__ */ jsxs12(Box12, { children: [
12145
+ /* @__PURE__ */ jsx14(Text13, { color: celebrating ? theme.palette.success : allDone ? "green" : theme.accent, bold: true, children: celebrating ? `\u2728 ${header}` : header }),
12146
+ headerStats && /* @__PURE__ */ jsxs12(Text13, { color: theme.info.color, children: [
12102
12147
  " ",
12103
12148
  "(",
12104
12149
  headerStats,
12105
12150
  ")"
12106
12151
  ] })
12107
12152
  ] }),
12108
- visibleTasks.map((t) => /* @__PURE__ */ jsx13(TaskRow, { task: t }, t.id)),
12109
- hiddenPending > 0 && /* @__PURE__ */ jsxs11(Text12, { color: theme.info.color, children: [
12153
+ visibleTasks.map((t) => /* @__PURE__ */ jsx14(TaskRow, { task: t }, t.id)),
12154
+ hiddenPending > 0 && /* @__PURE__ */ jsxs12(Text13, { color: theme.info.color, children: [
12110
12155
  " ",
12111
12156
  "\u2026 +",
12112
12157
  hiddenPending,
@@ -12117,21 +12162,21 @@ function TaskList({ tasks, startedAt, tokensDelta }) {
12117
12162
  function TaskRow({ task }) {
12118
12163
  const theme = useTheme();
12119
12164
  if (task.status === "completed") {
12120
- return /* @__PURE__ */ jsxs11(Text12, { color: theme.info.color, children: [
12165
+ return /* @__PURE__ */ jsxs12(Text13, { color: theme.info.color, children: [
12121
12166
  " ",
12122
12167
  "\u2713 ",
12123
- /* @__PURE__ */ jsx13(Text12, { strikethrough: true, children: task.title })
12168
+ /* @__PURE__ */ jsx14(Text13, { strikethrough: true, children: task.title })
12124
12169
  ] });
12125
12170
  }
12126
12171
  if (task.status === "in_progress") {
12127
- return /* @__PURE__ */ jsxs11(Text12, { color: theme.accent, bold: true, children: [
12172
+ return /* @__PURE__ */ jsxs12(Text13, { color: theme.accent, bold: true, children: [
12128
12173
  " ",
12129
- /* @__PURE__ */ jsx13(Spinner4, { type: "line" }),
12174
+ /* @__PURE__ */ jsx14(Spinner4, { type: "line" }),
12130
12175
  " ",
12131
12176
  task.title
12132
12177
  ] });
12133
12178
  }
12134
- return /* @__PURE__ */ jsxs11(Text12, { color: theme.info.color, children: [
12179
+ return /* @__PURE__ */ jsxs12(Text13, { color: theme.info.color, children: [
12135
12180
  " ",
12136
12181
  "\u2610 ",
12137
12182
  task.title
@@ -12159,12 +12204,12 @@ var init_task_list = __esm({
12159
12204
 
12160
12205
  // src/ui/onboarding.tsx
12161
12206
  import { useState as useState8, useEffect as useEffect5, useCallback as useCallback2 } from "react";
12162
- import { Box as Box12, Text as Text13, useInput as useInput5 } from "ink";
12207
+ import { Box as Box13, Text as Text14, useInput as useInput5 } from "ink";
12163
12208
  import SelectInput4 from "ink-select-input";
12164
12209
  import Spinner5 from "ink-spinner";
12165
12210
  import { exec } from "child_process";
12166
12211
  import { promisify as promisify2 } from "util";
12167
- import { Fragment, jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
12212
+ import { Fragment, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
12168
12213
  function openBrowser(url) {
12169
12214
  const platform4 = process.platform;
12170
12215
  const cmd = platform4 === "darwin" ? `open "${url}"` : platform4 === "win32" ? `start "" "${url}"` : `xdg-open "${url}"`;
@@ -12320,24 +12365,24 @@ function Onboarding({ onDone, onCancel }) {
12320
12365
  const byokSteps = ["accountId", "apiToken", "model", "confirm"];
12321
12366
  const stepIndex = step === "mode" ? 1 : step === "cloudAuth" ? 2 : byokSteps.indexOf(step) + 2;
12322
12367
  const totalSteps = mode === "cloud" ? 2 : byokSteps.length + 1;
12323
- return /* @__PURE__ */ jsxs12(Box12, { flexDirection: "column", paddingY: 1, children: [
12324
- /* @__PURE__ */ jsxs12(Box12, { marginBottom: 1, children: [
12325
- /* @__PURE__ */ jsx14(Text13, { bold: true, color: theme.palette.primary, children: "kimiflare" }),
12326
- /* @__PURE__ */ jsxs12(Text13, { color: theme.info.color, children: [
12368
+ return /* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", paddingY: 1, children: [
12369
+ /* @__PURE__ */ jsxs13(Box13, { marginBottom: 1, children: [
12370
+ /* @__PURE__ */ jsx15(Text14, { bold: true, color: theme.palette.primary, children: "kimiflare" }),
12371
+ /* @__PURE__ */ jsxs13(Text14, { color: theme.info.color, children: [
12327
12372
  " ",
12328
12373
  "Terminal coding agent"
12329
12374
  ] })
12330
12375
  ] }),
12331
- /* @__PURE__ */ jsxs12(Text13, { color: theme.info.color, children: [
12376
+ /* @__PURE__ */ jsxs13(Text14, { color: theme.info.color, children: [
12332
12377
  "Step ",
12333
12378
  stepIndex,
12334
12379
  " of ",
12335
12380
  totalSteps
12336
12381
  ] }),
12337
- /* @__PURE__ */ jsxs12(Box12, { marginTop: 1, flexDirection: "column", children: [
12338
- step === "mode" && /* @__PURE__ */ jsxs12(Fragment, { children: [
12339
- /* @__PURE__ */ jsx14(Text13, { children: "How do you want to connect?" }),
12340
- /* @__PURE__ */ jsx14(Box12, { marginTop: 1, children: /* @__PURE__ */ jsx14(
12382
+ /* @__PURE__ */ jsxs13(Box13, { marginTop: 1, flexDirection: "column", children: [
12383
+ step === "mode" && /* @__PURE__ */ jsxs13(Fragment, { children: [
12384
+ /* @__PURE__ */ jsx15(Text14, { children: "How do you want to connect?" }),
12385
+ /* @__PURE__ */ jsx15(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx15(
12341
12386
  SelectInput4,
12342
12387
  {
12343
12388
  items: [
@@ -12348,19 +12393,19 @@ function Onboarding({ onDone, onCancel }) {
12348
12393
  }
12349
12394
  ) })
12350
12395
  ] }),
12351
- step === "cloudAuth" && cloudAuth?.phase === "ready" && /* @__PURE__ */ jsxs12(Fragment, { children: [
12352
- /* @__PURE__ */ jsx14(Text13, { children: "Authenticating with Kimiflare Cloud..." }),
12353
- /* @__PURE__ */ jsxs12(Box12, { marginTop: 1, flexDirection: "column", children: [
12354
- /* @__PURE__ */ jsx14(Text13, { children: "1. Open this URL in your browser:" }),
12355
- /* @__PURE__ */ jsx14(Text13, { color: theme.palette.primary, children: cloudAuth.codes.authUrl })
12396
+ step === "cloudAuth" && cloudAuth?.phase === "ready" && /* @__PURE__ */ jsxs13(Fragment, { children: [
12397
+ /* @__PURE__ */ jsx15(Text14, { children: "Authenticating with Kimiflare Cloud..." }),
12398
+ /* @__PURE__ */ jsxs13(Box13, { marginTop: 1, flexDirection: "column", children: [
12399
+ /* @__PURE__ */ jsx15(Text14, { children: "1. Open this URL in your browser:" }),
12400
+ /* @__PURE__ */ jsx15(Text14, { color: theme.palette.primary, children: cloudAuth.codes.authUrl })
12356
12401
  ] }),
12357
- /* @__PURE__ */ jsxs12(Box12, { marginTop: 1, children: [
12358
- /* @__PURE__ */ jsx14(Text13, { children: "2. " }),
12359
- /* @__PURE__ */ jsx14(Text13, { bold: true, children: "[Press Enter to open browser]" })
12402
+ /* @__PURE__ */ jsxs13(Box13, { marginTop: 1, children: [
12403
+ /* @__PURE__ */ jsx15(Text14, { children: "2. " }),
12404
+ /* @__PURE__ */ jsx15(Text14, { bold: true, children: "[Press Enter to open browser]" })
12360
12405
  ] }),
12361
- /* @__PURE__ */ jsxs12(Box12, { marginTop: 1, children: [
12362
- /* @__PURE__ */ jsx14(Text13, { color: theme.palette.primary, children: "\u203A " }),
12363
- /* @__PURE__ */ jsx14(
12406
+ /* @__PURE__ */ jsxs13(Box13, { marginTop: 1, children: [
12407
+ /* @__PURE__ */ jsx15(Text14, { color: theme.palette.primary, children: "\u203A " }),
12408
+ /* @__PURE__ */ jsx15(
12364
12409
  CustomTextInput,
12365
12410
  {
12366
12411
  value: "",
@@ -12371,28 +12416,28 @@ function Onboarding({ onDone, onCancel }) {
12371
12416
  )
12372
12417
  ] })
12373
12418
  ] }),
12374
- step === "cloudAuth" && cloudAuth?.phase === "polling" && /* @__PURE__ */ jsxs12(Fragment, { children: [
12375
- /* @__PURE__ */ jsxs12(Text13, { children: [
12376
- /* @__PURE__ */ jsx14(Text13, { color: theme.spinner, children: /* @__PURE__ */ jsx14(Spinner5, { type: "dots" }) }),
12419
+ step === "cloudAuth" && cloudAuth?.phase === "polling" && /* @__PURE__ */ jsxs13(Fragment, { children: [
12420
+ /* @__PURE__ */ jsxs13(Text14, { children: [
12421
+ /* @__PURE__ */ jsx15(Text14, { color: theme.spinner, children: /* @__PURE__ */ jsx15(Spinner5, { type: "dots" }) }),
12377
12422
  " ",
12378
12423
  "Waiting for authentication..."
12379
12424
  ] }),
12380
- /* @__PURE__ */ jsxs12(Text13, { color: theme.info.color, children: [
12425
+ /* @__PURE__ */ jsxs13(Text14, { color: theme.info.color, children: [
12381
12426
  "Expires in ",
12382
12427
  formatRemaining(POLL_TIMEOUT_MS - (Date.now() - cloudAuth.startTime))
12383
12428
  ] }),
12384
- /* @__PURE__ */ jsxs12(Text13, { color: theme.info.color, children: [
12429
+ /* @__PURE__ */ jsxs13(Text14, { color: theme.info.color, children: [
12385
12430
  "URL: ",
12386
12431
  cloudAuth.codes.authUrl
12387
12432
  ] })
12388
12433
  ] }),
12389
- step === "cloudAuth" && cloudAuth?.phase === "success" && /* @__PURE__ */ jsxs12(Fragment, { children: [
12390
- /* @__PURE__ */ jsx14(Text13, { color: theme.palette.success, children: "Authenticated!" }),
12391
- /* @__PURE__ */ jsxs12(Box12, { marginTop: 1, flexDirection: "column", children: [
12392
- /* @__PURE__ */ jsxs12(Text13, { children: [
12434
+ step === "cloudAuth" && cloudAuth?.phase === "success" && /* @__PURE__ */ jsxs13(Fragment, { children: [
12435
+ /* @__PURE__ */ jsx15(Text14, { color: theme.palette.success, children: "Authenticated!" }),
12436
+ /* @__PURE__ */ jsxs13(Box13, { marginTop: 1, flexDirection: "column", children: [
12437
+ /* @__PURE__ */ jsxs13(Text14, { children: [
12393
12438
  "Token budget:",
12394
12439
  " ",
12395
- /* @__PURE__ */ jsxs12(Text13, { bold: true, children: [
12440
+ /* @__PURE__ */ jsxs13(Text14, { bold: true, children: [
12396
12441
  cloudAuth.usage.remaining.toLocaleString(),
12397
12442
  " /",
12398
12443
  " ",
@@ -12401,15 +12446,15 @@ function Onboarding({ onDone, onCancel }) {
12401
12446
  " ",
12402
12447
  "remaining"
12403
12448
  ] }),
12404
- /* @__PURE__ */ jsxs12(Text13, { color: theme.info.color, children: [
12449
+ /* @__PURE__ */ jsxs13(Text14, { color: theme.info.color, children: [
12405
12450
  "Grant expires: ",
12406
12451
  cloudAuth.usage.expires_at
12407
12452
  ] })
12408
12453
  ] }),
12409
- /* @__PURE__ */ jsx14(Box12, { marginTop: 1, children: /* @__PURE__ */ jsx14(Text13, { children: "[Press Enter to continue]" }) }),
12410
- /* @__PURE__ */ jsxs12(Box12, { marginTop: 1, children: [
12411
- /* @__PURE__ */ jsx14(Text13, { color: theme.palette.primary, children: "\u203A " }),
12412
- /* @__PURE__ */ jsx14(
12454
+ /* @__PURE__ */ jsx15(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx15(Text14, { children: "[Press Enter to continue]" }) }),
12455
+ /* @__PURE__ */ jsxs13(Box13, { marginTop: 1, children: [
12456
+ /* @__PURE__ */ jsx15(Text14, { color: theme.palette.primary, children: "\u203A " }),
12457
+ /* @__PURE__ */ jsx15(
12413
12458
  CustomTextInput,
12414
12459
  {
12415
12460
  value: "",
@@ -12420,10 +12465,10 @@ function Onboarding({ onDone, onCancel }) {
12420
12465
  )
12421
12466
  ] })
12422
12467
  ] }),
12423
- step === "cloudAuth" && cloudAuth?.phase === "error" && /* @__PURE__ */ jsxs12(Fragment, { children: [
12424
- /* @__PURE__ */ jsx14(Text13, { color: theme.palette.error, children: "Authentication failed" }),
12425
- /* @__PURE__ */ jsx14(Text13, { color: theme.info.color, children: cloudAuth.message }),
12426
- /* @__PURE__ */ jsx14(Box12, { marginTop: 1, children: /* @__PURE__ */ jsx14(
12468
+ step === "cloudAuth" && cloudAuth?.phase === "error" && /* @__PURE__ */ jsxs13(Fragment, { children: [
12469
+ /* @__PURE__ */ jsx15(Text14, { color: theme.palette.error, children: "Authentication failed" }),
12470
+ /* @__PURE__ */ jsx15(Text14, { color: theme.info.color, children: cloudAuth.message }),
12471
+ /* @__PURE__ */ jsx15(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx15(
12427
12472
  SelectInput4,
12428
12473
  {
12429
12474
  items: [
@@ -12439,11 +12484,11 @@ function Onboarding({ onDone, onCancel }) {
12439
12484
  }
12440
12485
  ) })
12441
12486
  ] }),
12442
- step === "accountId" && /* @__PURE__ */ jsxs12(Fragment, { children: [
12443
- /* @__PURE__ */ jsx14(Text13, { children: "Enter your Cloudflare Account ID" }),
12444
- /* @__PURE__ */ jsxs12(Box12, { marginTop: 1, children: [
12445
- /* @__PURE__ */ jsx14(Text13, { color: theme.palette.primary, children: "\u203A " }),
12446
- /* @__PURE__ */ jsx14(
12487
+ step === "accountId" && /* @__PURE__ */ jsxs13(Fragment, { children: [
12488
+ /* @__PURE__ */ jsx15(Text14, { children: "Enter your Cloudflare Account ID" }),
12489
+ /* @__PURE__ */ jsxs13(Box13, { marginTop: 1, children: [
12490
+ /* @__PURE__ */ jsx15(Text14, { color: theme.palette.primary, children: "\u203A " }),
12491
+ /* @__PURE__ */ jsx15(
12447
12492
  CustomTextInput,
12448
12493
  {
12449
12494
  value: accountId,
@@ -12453,12 +12498,12 @@ function Onboarding({ onDone, onCancel }) {
12453
12498
  )
12454
12499
  ] })
12455
12500
  ] }),
12456
- step === "apiToken" && /* @__PURE__ */ jsxs12(Fragment, { children: [
12457
- /* @__PURE__ */ jsx14(Text13, { children: "Enter your Cloudflare API Token" }),
12458
- /* @__PURE__ */ jsx14(Text13, { color: theme.info.color, children: "Create one at https://dash.cloudflare.com/profile/api-tokens" }),
12459
- /* @__PURE__ */ jsxs12(Box12, { marginTop: 1, children: [
12460
- /* @__PURE__ */ jsx14(Text13, { color: theme.palette.primary, children: "\u203A " }),
12461
- /* @__PURE__ */ jsx14(
12501
+ step === "apiToken" && /* @__PURE__ */ jsxs13(Fragment, { children: [
12502
+ /* @__PURE__ */ jsx15(Text14, { children: "Enter your Cloudflare API Token" }),
12503
+ /* @__PURE__ */ jsx15(Text14, { color: theme.info.color, children: "Create one at https://dash.cloudflare.com/profile/api-tokens" }),
12504
+ /* @__PURE__ */ jsxs13(Box13, { marginTop: 1, children: [
12505
+ /* @__PURE__ */ jsx15(Text14, { color: theme.palette.primary, children: "\u203A " }),
12506
+ /* @__PURE__ */ jsx15(
12462
12507
  CustomTextInput,
12463
12508
  {
12464
12509
  value: apiToken,
@@ -12469,15 +12514,15 @@ function Onboarding({ onDone, onCancel }) {
12469
12514
  )
12470
12515
  ] })
12471
12516
  ] }),
12472
- step === "model" && /* @__PURE__ */ jsxs12(Fragment, { children: [
12473
- /* @__PURE__ */ jsx14(Text13, { children: "Model ID (press Enter for default)" }),
12474
- /* @__PURE__ */ jsxs12(Text13, { color: theme.info.color, children: [
12517
+ step === "model" && /* @__PURE__ */ jsxs13(Fragment, { children: [
12518
+ /* @__PURE__ */ jsx15(Text14, { children: "Model ID (press Enter for default)" }),
12519
+ /* @__PURE__ */ jsxs13(Text14, { color: theme.info.color, children: [
12475
12520
  "default: ",
12476
12521
  DEFAULT_MODEL
12477
12522
  ] }),
12478
- /* @__PURE__ */ jsxs12(Box12, { marginTop: 1, children: [
12479
- /* @__PURE__ */ jsx14(Text13, { color: theme.palette.primary, children: "\u203A " }),
12480
- /* @__PURE__ */ jsx14(
12523
+ /* @__PURE__ */ jsxs13(Box13, { marginTop: 1, children: [
12524
+ /* @__PURE__ */ jsx15(Text14, { color: theme.palette.primary, children: "\u203A " }),
12525
+ /* @__PURE__ */ jsx15(
12481
12526
  CustomTextInput,
12482
12527
  {
12483
12528
  value: model,
@@ -12487,10 +12532,10 @@ function Onboarding({ onDone, onCancel }) {
12487
12532
  )
12488
12533
  ] })
12489
12534
  ] }),
12490
- step === "confirm" && /* @__PURE__ */ jsxs12(Fragment, { children: [
12491
- /* @__PURE__ */ jsx14(Text13, { children: "Ready to save configuration" }),
12492
- /* @__PURE__ */ jsxs12(
12493
- Box12,
12535
+ step === "confirm" && /* @__PURE__ */ jsxs13(Fragment, { children: [
12536
+ /* @__PURE__ */ jsx15(Text14, { children: "Ready to save configuration" }),
12537
+ /* @__PURE__ */ jsxs13(
12538
+ Box13,
12494
12539
  {
12495
12540
  flexDirection: "column",
12496
12541
  marginTop: 1,
@@ -12499,25 +12544,25 @@ function Onboarding({ onDone, onCancel }) {
12499
12544
  borderColor: theme.info.color,
12500
12545
  paddingX: 1,
12501
12546
  children: [
12502
- /* @__PURE__ */ jsxs12(Text13, { color: theme.info.color, children: [
12547
+ /* @__PURE__ */ jsxs13(Text14, { color: theme.info.color, children: [
12503
12548
  "Account ID: ",
12504
12549
  accountId
12505
12550
  ] }),
12506
- /* @__PURE__ */ jsxs12(Text13, { color: theme.info.color, children: [
12551
+ /* @__PURE__ */ jsxs13(Text14, { color: theme.info.color, children: [
12507
12552
  "API Token: ",
12508
12553
  "\u2022".repeat(apiToken.length)
12509
12554
  ] }),
12510
- /* @__PURE__ */ jsxs12(Text13, { color: theme.info.color, children: [
12555
+ /* @__PURE__ */ jsxs13(Text14, { color: theme.info.color, children: [
12511
12556
  "Model: ",
12512
12557
  model
12513
12558
  ] })
12514
12559
  ]
12515
12560
  }
12516
12561
  ),
12517
- /* @__PURE__ */ jsx14(Text13, { children: "Press Enter to confirm, or Ctrl+C to cancel" }),
12518
- /* @__PURE__ */ jsxs12(Box12, { marginTop: 1, children: [
12519
- /* @__PURE__ */ jsx14(Text13, { color: theme.palette.primary, children: "\u203A " }),
12520
- /* @__PURE__ */ jsx14(
12562
+ /* @__PURE__ */ jsx15(Text14, { children: "Press Enter to confirm, or Ctrl+C to cancel" }),
12563
+ /* @__PURE__ */ jsxs13(Box13, { marginTop: 1, children: [
12564
+ /* @__PURE__ */ jsx15(Text14, { color: theme.palette.primary, children: "\u203A " }),
12565
+ /* @__PURE__ */ jsx15(
12521
12566
  CustomTextInput,
12522
12567
  {
12523
12568
  value: "",
@@ -12528,7 +12573,7 @@ function Onboarding({ onDone, onCancel }) {
12528
12573
  )
12529
12574
  ] })
12530
12575
  ] }),
12531
- savedPath && /* @__PURE__ */ jsxs12(Text13, { color: theme.palette.success, children: [
12576
+ savedPath && /* @__PURE__ */ jsxs13(Text14, { color: theme.palette.success, children: [
12532
12577
  "Config saved to ",
12533
12578
  savedPath
12534
12579
  ] })
@@ -12586,8 +12631,8 @@ var init_greetings = __esm({
12586
12631
  });
12587
12632
 
12588
12633
  // src/ui/welcome.tsx
12589
- import { Box as Box13, Text as Text14 } from "ink";
12590
- import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
12634
+ import { Box as Box14, Text as Text15 } from "ink";
12635
+ import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
12591
12636
  function Welcome() {
12592
12637
  const theme = useTheme();
12593
12638
  const now2 = /* @__PURE__ */ new Date();
@@ -12595,9 +12640,9 @@ function Welcome() {
12595
12640
  hour: now2.getHours(),
12596
12641
  day: now2.getDay()
12597
12642
  });
12598
- return /* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", marginBottom: 1, children: [
12599
- /* @__PURE__ */ jsx15(Box13, { marginBottom: 1, children: /* @__PURE__ */ jsx15(Text14, { bold: true, color: theme.accent, children: headline }) }),
12600
- /* @__PURE__ */ jsx15(Box13, { flexDirection: "column", children: /* @__PURE__ */ jsx15(Text14, { color: theme.info.color, dimColor: true, children: "Type / for commands" }) })
12643
+ return /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", marginBottom: 1, children: [
12644
+ /* @__PURE__ */ jsx16(Box14, { marginBottom: 1, children: /* @__PURE__ */ jsx16(Text15, { bold: true, color: theme.accent, children: headline }) }),
12645
+ /* @__PURE__ */ jsx16(Box14, { flexDirection: "column", children: /* @__PURE__ */ jsx16(Text15, { color: theme.info.color, dimColor: true, children: "Type / for commands" }) })
12601
12646
  ] });
12602
12647
  }
12603
12648
  var init_welcome = __esm({
@@ -12705,9 +12750,9 @@ var init_worker_client = __esm({
12705
12750
 
12706
12751
  // src/ui/remote-dashboard.tsx
12707
12752
  import { useEffect as useEffect6, useState as useState9 } from "react";
12708
- import { Box as Box14, Text as Text15, useInput as useInput6 } from "ink";
12753
+ import { Box as Box15, Text as Text16, useInput as useInput6 } from "ink";
12709
12754
  import SelectInput5 from "ink-select-input";
12710
- import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
12755
+ import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
12711
12756
  function RemoteDashboard({ onSelect, onCancel }) {
12712
12757
  const theme = useTheme();
12713
12758
  const [sessions, setSessions] = useState9([]);
@@ -12763,30 +12808,30 @@ function RemoteDashboard({ onSelect, onCancel }) {
12763
12808
  value: s.sessionId
12764
12809
  }));
12765
12810
  if (loading) {
12766
- return /* @__PURE__ */ jsx16(Box14, { flexDirection: "column", padding: 1, children: /* @__PURE__ */ jsx16(Text15, { color: theme.accent, children: "Loading remote sessions..." }) });
12811
+ return /* @__PURE__ */ jsx17(Box15, { flexDirection: "column", padding: 1, children: /* @__PURE__ */ jsx17(Text16, { color: theme.accent, children: "Loading remote sessions..." }) });
12767
12812
  }
12768
12813
  if (error) {
12769
- return /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", padding: 1, children: [
12770
- /* @__PURE__ */ jsxs14(Text15, { color: theme.error, children: [
12814
+ return /* @__PURE__ */ jsxs15(Box15, { flexDirection: "column", padding: 1, children: [
12815
+ /* @__PURE__ */ jsxs15(Text16, { color: theme.error, children: [
12771
12816
  "Error: ",
12772
12817
  error
12773
12818
  ] }),
12774
- /* @__PURE__ */ jsx16(Text15, { dimColor: true, children: "Press R to retry, Esc to close" })
12819
+ /* @__PURE__ */ jsx17(Text16, { dimColor: true, children: "Press R to retry, Esc to close" })
12775
12820
  ] });
12776
12821
  }
12777
12822
  if (sessions.length === 0) {
12778
- return /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", padding: 1, children: [
12779
- /* @__PURE__ */ jsx16(Text15, { color: theme.accent, children: "No remote sessions yet." }),
12780
- /* @__PURE__ */ jsx16(Text15, { dimColor: true, children: "Type /remote <prompt> to start one." }),
12781
- /* @__PURE__ */ jsx16(Text15, { dimColor: true, children: "Press Esc to close" })
12823
+ return /* @__PURE__ */ jsxs15(Box15, { flexDirection: "column", padding: 1, children: [
12824
+ /* @__PURE__ */ jsx17(Text16, { color: theme.accent, children: "No remote sessions yet." }),
12825
+ /* @__PURE__ */ jsx17(Text16, { dimColor: true, children: "Type /remote <prompt> to start one." }),
12826
+ /* @__PURE__ */ jsx17(Text16, { dimColor: true, children: "Press Esc to close" })
12782
12827
  ] });
12783
12828
  }
12784
- return /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", padding: 1, children: [
12785
- /* @__PURE__ */ jsxs14(Text15, { bold: true, color: theme.accent, children: [
12829
+ return /* @__PURE__ */ jsxs15(Box15, { flexDirection: "column", padding: 1, children: [
12830
+ /* @__PURE__ */ jsxs15(Text16, { bold: true, color: theme.accent, children: [
12786
12831
  "Recent remote tasks ",
12787
12832
  refreshing ? "(refreshing...)" : ""
12788
12833
  ] }),
12789
- /* @__PURE__ */ jsx16(Box14, { marginTop: 1, children: /* @__PURE__ */ jsx16(
12834
+ /* @__PURE__ */ jsx17(Box15, { marginTop: 1, children: /* @__PURE__ */ jsx17(
12790
12835
  SelectInput5,
12791
12836
  {
12792
12837
  items,
@@ -12796,7 +12841,7 @@ function RemoteDashboard({ onSelect, onCancel }) {
12796
12841
  }
12797
12842
  }
12798
12843
  ) }),
12799
- /* @__PURE__ */ jsx16(Box14, { marginTop: 1, children: /* @__PURE__ */ jsx16(Text15, { dimColor: true, children: "\u2191\u2193 navigate \u2022 Enter select \u2022 R refresh \u2022 Esc close" }) })
12844
+ /* @__PURE__ */ jsx17(Box15, { marginTop: 1, children: /* @__PURE__ */ jsx17(Text16, { dimColor: true, children: "\u2191\u2193 navigate \u2022 Enter select \u2022 R refresh \u2022 Esc close" }) })
12800
12845
  ] });
12801
12846
  }
12802
12847
  function formatSessionLine(s) {
@@ -12849,50 +12894,50 @@ function RemoteSessionDetail({
12849
12894
  }
12850
12895
  }
12851
12896
  const isRunning = session.status === "running" || session.status === "pending";
12852
- return /* @__PURE__ */ jsxs14(Box14, { flexDirection: "column", padding: 1, children: [
12853
- /* @__PURE__ */ jsx16(Text15, { bold: true, color: theme.accent, children: "Remote Session" }),
12854
- /* @__PURE__ */ jsxs14(Box14, { marginTop: 1, flexDirection: "column", children: [
12855
- /* @__PURE__ */ jsxs14(Text15, { children: [
12897
+ return /* @__PURE__ */ jsxs15(Box15, { flexDirection: "column", padding: 1, children: [
12898
+ /* @__PURE__ */ jsx17(Text16, { bold: true, color: theme.accent, children: "Remote Session" }),
12899
+ /* @__PURE__ */ jsxs15(Box15, { marginTop: 1, flexDirection: "column", children: [
12900
+ /* @__PURE__ */ jsxs15(Text16, { children: [
12856
12901
  "ID: ",
12857
12902
  session.sessionId
12858
12903
  ] }),
12859
- /* @__PURE__ */ jsxs14(Text15, { children: [
12904
+ /* @__PURE__ */ jsxs15(Text16, { children: [
12860
12905
  "Repo: ",
12861
12906
  session.repo
12862
12907
  ] }),
12863
- /* @__PURE__ */ jsxs14(Text15, { children: [
12908
+ /* @__PURE__ */ jsxs15(Text16, { children: [
12864
12909
  "Status: ",
12865
12910
  session.status
12866
12911
  ] }),
12867
- /* @__PURE__ */ jsxs14(Text15, { children: [
12912
+ /* @__PURE__ */ jsxs15(Text16, { children: [
12868
12913
  "Prompt: ",
12869
12914
  session.prompt
12870
12915
  ] }),
12871
- session.prUrl && /* @__PURE__ */ jsxs14(Text15, { children: [
12916
+ session.prUrl && /* @__PURE__ */ jsxs15(Text16, { children: [
12872
12917
  "PR: ",
12873
12918
  session.prUrl
12874
12919
  ] }),
12875
- session.errorMessage && /* @__PURE__ */ jsxs14(Text15, { color: theme.error, children: [
12920
+ session.errorMessage && /* @__PURE__ */ jsxs15(Text16, { color: theme.error, children: [
12876
12921
  "Error: ",
12877
12922
  session.errorMessage
12878
12923
  ] }),
12879
- session.tokensUsed !== void 0 && /* @__PURE__ */ jsxs14(Text15, { children: [
12924
+ session.tokensUsed !== void 0 && /* @__PURE__ */ jsxs15(Text16, { children: [
12880
12925
  "Tokens: ",
12881
12926
  formatTokens4(session.tokensUsed),
12882
12927
  session.tokensBudget ? ` / ${formatTokens4(session.tokensBudget)}` : ""
12883
12928
  ] }),
12884
- /* @__PURE__ */ jsxs14(Text15, { children: [
12929
+ /* @__PURE__ */ jsxs15(Text16, { children: [
12885
12930
  "Created: ",
12886
12931
  new Date(session.createdAt).toLocaleString()
12887
12932
  ] }),
12888
- session.finishedAt && /* @__PURE__ */ jsxs14(Text15, { children: [
12933
+ session.finishedAt && /* @__PURE__ */ jsxs15(Text16, { children: [
12889
12934
  "Finished: ",
12890
12935
  new Date(session.finishedAt).toLocaleString()
12891
12936
  ] })
12892
12937
  ] }),
12893
- /* @__PURE__ */ jsxs14(Box14, { marginTop: 1, flexDirection: "row", gap: 2, children: [
12894
- isRunning && onCancel && /* @__PURE__ */ jsx16(Text15, { color: theme.error, children: cancelling ? "Cancelling..." : "[C] Cancel session" }),
12895
- /* @__PURE__ */ jsx16(Text15, { dimColor: true, children: "Esc back" })
12938
+ /* @__PURE__ */ jsxs15(Box15, { marginTop: 1, flexDirection: "row", gap: 2, children: [
12939
+ isRunning && onCancel && /* @__PURE__ */ jsx17(Text16, { color: theme.error, children: cancelling ? "Cancelling..." : "[C] Cancel session" }),
12940
+ /* @__PURE__ */ jsx17(Text16, { dimColor: true, children: "Esc back" })
12896
12941
  ] })
12897
12942
  ] });
12898
12943
  }
@@ -13727,9 +13772,9 @@ var init_save = __esm({
13727
13772
 
13728
13773
  // src/ui/command-wizard.tsx
13729
13774
  import { useState as useState10 } from "react";
13730
- import { Box as Box15, Text as Text16, useInput as useInput7, useWindowSize } from "ink";
13775
+ import { Box as Box16, Text as Text17, useInput as useInput7, useWindowSize } from "ink";
13731
13776
  import SelectInput6 from "ink-select-input";
13732
- import { Fragment as Fragment2, jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
13777
+ import { Fragment as Fragment2, jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
13733
13778
  function CommandWizard({ mode, initial, existingNames, builtinNames, onDone, onSave }) {
13734
13779
  const theme = useTheme();
13735
13780
  const [step, setStep] = useState10("name");
@@ -13853,8 +13898,8 @@ ${template}`;
13853
13898
  const renderStep = () => {
13854
13899
  switch (step) {
13855
13900
  case "name":
13856
- return /* @__PURE__ */ jsxs15(Fragment2, { children: [
13857
- /* @__PURE__ */ jsxs15(Text16, { color: theme.accent, bold: true, children: [
13901
+ return /* @__PURE__ */ jsxs16(Fragment2, { children: [
13902
+ /* @__PURE__ */ jsxs16(Text17, { color: theme.accent, bold: true, children: [
13858
13903
  mode === "create" ? "Create" : "Edit",
13859
13904
  " custom command \u2014 Name (",
13860
13905
  stepIndex,
@@ -13862,8 +13907,8 @@ ${template}`;
13862
13907
  totalSteps,
13863
13908
  ")"
13864
13909
  ] }),
13865
- error && /* @__PURE__ */ jsx17(Text16, { color: theme.error, children: error }),
13866
- /* @__PURE__ */ jsx17(Box15, { marginTop: 1, children: /* @__PURE__ */ jsx17(
13910
+ error && /* @__PURE__ */ jsx18(Text17, { color: theme.error, children: error }),
13911
+ /* @__PURE__ */ jsx18(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx18(
13867
13912
  CustomTextInput,
13868
13913
  {
13869
13914
  value: name,
@@ -13872,11 +13917,11 @@ ${template}`;
13872
13917
  focus: true
13873
13918
  }
13874
13919
  ) }),
13875
- /* @__PURE__ */ jsx17(Text16, { color: theme.info.color, children: "letters, numbers, _ - / only; must start with a letter" })
13920
+ /* @__PURE__ */ jsx18(Text17, { color: theme.info.color, children: "letters, numbers, _ - / only; must start with a letter" })
13876
13921
  ] });
13877
13922
  case "description":
13878
- return /* @__PURE__ */ jsxs15(Fragment2, { children: [
13879
- /* @__PURE__ */ jsxs15(Text16, { color: theme.accent, bold: true, children: [
13923
+ return /* @__PURE__ */ jsxs16(Fragment2, { children: [
13924
+ /* @__PURE__ */ jsxs16(Text17, { color: theme.accent, bold: true, children: [
13880
13925
  mode === "create" ? "Create" : "Edit",
13881
13926
  " custom command \u2014 Description (",
13882
13927
  stepIndex,
@@ -13884,7 +13929,7 @@ ${template}`;
13884
13929
  totalSteps,
13885
13930
  ")"
13886
13931
  ] }),
13887
- /* @__PURE__ */ jsx17(Box15, { marginTop: 1, children: /* @__PURE__ */ jsx17(
13932
+ /* @__PURE__ */ jsx18(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx18(
13888
13933
  CustomTextInput,
13889
13934
  {
13890
13935
  value: description,
@@ -13893,49 +13938,49 @@ ${template}`;
13893
13938
  focus: true
13894
13939
  }
13895
13940
  ) }),
13896
- /* @__PURE__ */ jsx17(Text16, { color: theme.info.color, children: "Press Enter to skip" })
13941
+ /* @__PURE__ */ jsx18(Text17, { color: theme.info.color, children: "Press Enter to skip" })
13897
13942
  ] });
13898
13943
  case "template": {
13899
- const guide = /* @__PURE__ */ jsxs15(Box15, { flexDirection: "column", paddingLeft: 1, children: [
13900
- /* @__PURE__ */ jsx17(Text16, { color: theme.accent, bold: true, children: "What is this?" }),
13901
- /* @__PURE__ */ jsx17(Text16, { color: theme.info.color, children: "A prompt template \u2014 instructions to the AI." }),
13902
- /* @__PURE__ */ jsxs15(Text16, { color: theme.info.color, children: [
13944
+ const guide = /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", paddingLeft: 1, children: [
13945
+ /* @__PURE__ */ jsx18(Text17, { color: theme.accent, bold: true, children: "What is this?" }),
13946
+ /* @__PURE__ */ jsx18(Text17, { color: theme.info.color, children: "A prompt template \u2014 instructions to the AI." }),
13947
+ /* @__PURE__ */ jsxs16(Text17, { color: theme.info.color, children: [
13903
13948
  "When you type /",
13904
13949
  name || "yourcommand",
13905
13950
  " later, this gets sent to the model."
13906
13951
  ] }),
13907
- /* @__PURE__ */ jsxs15(Box15, { marginTop: 1, flexDirection: "column", children: [
13908
- /* @__PURE__ */ jsx17(Text16, { color: theme.accent, bold: true, children: "Variables" }),
13909
- /* @__PURE__ */ jsxs15(Text16, { color: theme.info.color, children: [
13952
+ /* @__PURE__ */ jsxs16(Box16, { marginTop: 1, flexDirection: "column", children: [
13953
+ /* @__PURE__ */ jsx18(Text17, { color: theme.accent, bold: true, children: "Variables" }),
13954
+ /* @__PURE__ */ jsxs16(Text17, { color: theme.info.color, children: [
13910
13955
  " ",
13911
13956
  "$1, $2 ... \u2192 arguments you type"
13912
13957
  ] }),
13913
- /* @__PURE__ */ jsxs15(Text16, { color: theme.info.color, children: [
13958
+ /* @__PURE__ */ jsxs16(Text17, { color: theme.info.color, children: [
13914
13959
  " ",
13915
13960
  "$ARGUMENTS \u2192 everything after the command"
13916
13961
  ] })
13917
13962
  ] }),
13918
- /* @__PURE__ */ jsxs15(Box15, { marginTop: 1, flexDirection: "column", children: [
13919
- /* @__PURE__ */ jsx17(Text16, { color: theme.accent, bold: true, children: "Dynamic inlines" }),
13920
- /* @__PURE__ */ jsxs15(Text16, { color: theme.info.color, children: [
13963
+ /* @__PURE__ */ jsxs16(Box16, { marginTop: 1, flexDirection: "column", children: [
13964
+ /* @__PURE__ */ jsx18(Text17, { color: theme.accent, bold: true, children: "Dynamic inlines" }),
13965
+ /* @__PURE__ */ jsxs16(Text17, { color: theme.info.color, children: [
13921
13966
  " ",
13922
13967
  "!`git diff` \u2192 shell output inlined"
13923
13968
  ] }),
13924
- /* @__PURE__ */ jsxs15(Text16, { color: theme.info.color, children: [
13969
+ /* @__PURE__ */ jsxs16(Text17, { color: theme.info.color, children: [
13925
13970
  " ",
13926
13971
  "@README.md \u2192 file contents inlined"
13927
13972
  ] })
13928
13973
  ] }),
13929
- /* @__PURE__ */ jsxs15(Box15, { marginTop: 1, flexDirection: "column", children: [
13930
- /* @__PURE__ */ jsx17(Text16, { color: theme.accent, bold: true, children: "Example" }),
13931
- /* @__PURE__ */ jsx17(Text16, { color: theme.info.color, children: "Review this PR diff:" }),
13932
- /* @__PURE__ */ jsx17(Text16, { color: theme.info.color, children: "!`git diff main...HEAD`" }),
13933
- /* @__PURE__ */ jsx17(Text16, { color: theme.info.color, children: "Focus on: $1" })
13974
+ /* @__PURE__ */ jsxs16(Box16, { marginTop: 1, flexDirection: "column", children: [
13975
+ /* @__PURE__ */ jsx18(Text17, { color: theme.accent, bold: true, children: "Example" }),
13976
+ /* @__PURE__ */ jsx18(Text17, { color: theme.info.color, children: "Review this PR diff:" }),
13977
+ /* @__PURE__ */ jsx18(Text17, { color: theme.info.color, children: "!`git diff main...HEAD`" }),
13978
+ /* @__PURE__ */ jsx18(Text17, { color: theme.info.color, children: "Focus on: $1" })
13934
13979
  ] })
13935
13980
  ] });
13936
- const inputArea = /* @__PURE__ */ jsxs15(Box15, { flexDirection: "column", flexGrow: 1, children: [
13937
- error && /* @__PURE__ */ jsx17(Text16, { color: theme.error, children: error }),
13938
- /* @__PURE__ */ jsx17(Box15, { marginTop: 1, children: /* @__PURE__ */ jsx17(
13981
+ const inputArea = /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", flexGrow: 1, children: [
13982
+ error && /* @__PURE__ */ jsx18(Text17, { color: theme.error, children: error }),
13983
+ /* @__PURE__ */ jsx18(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx18(
13939
13984
  CustomTextInput,
13940
13985
  {
13941
13986
  value: template,
@@ -13945,13 +13990,13 @@ ${template}`;
13945
13990
  enablePaste: true
13946
13991
  }
13947
13992
  ) }),
13948
- columns < 100 && /* @__PURE__ */ jsxs15(Fragment2, { children: [
13949
- /* @__PURE__ */ jsx17(Text16, { color: theme.info.color, children: "Paste multi-line templates with Ctrl+V." }),
13950
- /* @__PURE__ */ jsx17(Text16, { color: theme.info.color, children: "Variables: $1 $2 ... $ARGUMENTS Shell: !`cmd` File: @path" })
13993
+ columns < 100 && /* @__PURE__ */ jsxs16(Fragment2, { children: [
13994
+ /* @__PURE__ */ jsx18(Text17, { color: theme.info.color, children: "Paste multi-line templates with Ctrl+V." }),
13995
+ /* @__PURE__ */ jsx18(Text17, { color: theme.info.color, children: "Variables: $1 $2 ... $ARGUMENTS Shell: !`cmd` File: @path" })
13951
13996
  ] })
13952
13997
  ] });
13953
- return /* @__PURE__ */ jsxs15(Fragment2, { children: [
13954
- /* @__PURE__ */ jsxs15(Text16, { color: theme.accent, bold: true, children: [
13998
+ return /* @__PURE__ */ jsxs16(Fragment2, { children: [
13999
+ /* @__PURE__ */ jsxs16(Text17, { color: theme.accent, bold: true, children: [
13955
14000
  mode === "create" ? "Create" : "Edit",
13956
14001
  " custom command \u2014 Template (",
13957
14002
  stepIndex,
@@ -13959,10 +14004,10 @@ ${template}`;
13959
14004
  totalSteps,
13960
14005
  ")"
13961
14006
  ] }),
13962
- columns >= 100 ? /* @__PURE__ */ jsxs15(Box15, { flexDirection: "row", marginTop: 1, children: [
13963
- /* @__PURE__ */ jsx17(Box15, { flexDirection: "column", width: "50%", children: inputArea }),
13964
- /* @__PURE__ */ jsx17(Box15, { flexDirection: "column", width: "50%", children: guide })
13965
- ] }) : /* @__PURE__ */ jsx17(Box15, { flexDirection: "column", marginTop: 1, children: inputArea })
14007
+ columns >= 100 ? /* @__PURE__ */ jsxs16(Box16, { flexDirection: "row", marginTop: 1, children: [
14008
+ /* @__PURE__ */ jsx18(Box16, { flexDirection: "column", width: "50%", children: inputArea }),
14009
+ /* @__PURE__ */ jsx18(Box16, { flexDirection: "column", width: "50%", children: guide })
14010
+ ] }) : /* @__PURE__ */ jsx18(Box16, { flexDirection: "column", marginTop: 1, children: inputArea })
13966
14011
  ] });
13967
14012
  }
13968
14013
  case "advanced": {
@@ -13971,8 +14016,8 @@ ${template}`;
13971
14016
  { label: "Skip", value: "skip", key: "skip" },
13972
14017
  { label: "\u2190 Cancel", value: "cancel", key: "cancel" }
13973
14018
  ];
13974
- return /* @__PURE__ */ jsxs15(Fragment2, { children: [
13975
- /* @__PURE__ */ jsxs15(Text16, { color: theme.accent, bold: true, children: [
14019
+ return /* @__PURE__ */ jsxs16(Fragment2, { children: [
14020
+ /* @__PURE__ */ jsxs16(Text17, { color: theme.accent, bold: true, children: [
13976
14021
  mode === "create" ? "Create" : "Edit",
13977
14022
  " custom command \u2014 Options (",
13978
14023
  stepIndex,
@@ -13980,7 +14025,7 @@ ${template}`;
13980
14025
  totalSteps,
13981
14026
  ")"
13982
14027
  ] }),
13983
- /* @__PURE__ */ jsx17(Box15, { marginTop: 1, children: /* @__PURE__ */ jsx17(
14028
+ /* @__PURE__ */ jsx18(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx18(
13984
14029
  SelectInput6,
13985
14030
  {
13986
14031
  items,
@@ -14000,16 +14045,16 @@ ${template}`;
14000
14045
  { label: cmdMode === "auto" ? "auto \xB7 current" : "auto", value: "auto", key: "auto" },
14001
14046
  { label: "\u2190 Back", value: "__back__", key: "__back__" }
14002
14047
  ];
14003
- return /* @__PURE__ */ jsxs15(Fragment2, { children: [
14004
- /* @__PURE__ */ jsxs15(Text16, { color: theme.accent, bold: true, children: [
14048
+ return /* @__PURE__ */ jsxs16(Fragment2, { children: [
14049
+ /* @__PURE__ */ jsxs16(Text17, { color: theme.accent, bold: true, children: [
14005
14050
  "Mode override (",
14006
14051
  stepIndex,
14007
14052
  "/",
14008
14053
  totalSteps,
14009
14054
  ")"
14010
14055
  ] }),
14011
- /* @__PURE__ */ jsx17(Text16, { color: theme.info.color, children: "Saved to file but not yet enforced at runtime" }),
14012
- /* @__PURE__ */ jsx17(Box15, { marginTop: 1, children: /* @__PURE__ */ jsx17(
14056
+ /* @__PURE__ */ jsx18(Text17, { color: theme.info.color, children: "Saved to file but not yet enforced at runtime" }),
14057
+ /* @__PURE__ */ jsx18(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx18(
14013
14058
  SelectInput6,
14014
14059
  {
14015
14060
  items,
@@ -14029,15 +14074,15 @@ ${template}`;
14029
14074
  { label: cmdEffort === "high" ? "high \xB7 current" : "high", value: "high", key: "high" },
14030
14075
  { label: "\u2190 Back", value: "__back__", key: "__back__" }
14031
14076
  ];
14032
- return /* @__PURE__ */ jsxs15(Fragment2, { children: [
14033
- /* @__PURE__ */ jsxs15(Text16, { color: theme.accent, bold: true, children: [
14077
+ return /* @__PURE__ */ jsxs16(Fragment2, { children: [
14078
+ /* @__PURE__ */ jsxs16(Text17, { color: theme.accent, bold: true, children: [
14034
14079
  "Reasoning effort (",
14035
14080
  stepIndex,
14036
14081
  "/",
14037
14082
  totalSteps,
14038
14083
  ")"
14039
14084
  ] }),
14040
- /* @__PURE__ */ jsx17(Box15, { marginTop: 1, children: /* @__PURE__ */ jsx17(
14085
+ /* @__PURE__ */ jsx18(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx18(
14041
14086
  SelectInput6,
14042
14087
  {
14043
14088
  items,
@@ -14050,15 +14095,15 @@ ${template}`;
14050
14095
  ] });
14051
14096
  }
14052
14097
  case "model":
14053
- return /* @__PURE__ */ jsxs15(Fragment2, { children: [
14054
- /* @__PURE__ */ jsxs15(Text16, { color: theme.accent, bold: true, children: [
14098
+ return /* @__PURE__ */ jsxs16(Fragment2, { children: [
14099
+ /* @__PURE__ */ jsxs16(Text17, { color: theme.accent, bold: true, children: [
14055
14100
  "Model override (",
14056
14101
  stepIndex,
14057
14102
  "/",
14058
14103
  totalSteps,
14059
14104
  ")"
14060
14105
  ] }),
14061
- /* @__PURE__ */ jsx17(Box15, { marginTop: 1, children: /* @__PURE__ */ jsx17(
14106
+ /* @__PURE__ */ jsx18(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx18(
14062
14107
  CustomTextInput,
14063
14108
  {
14064
14109
  value: cmdModel ?? "",
@@ -14067,7 +14112,7 @@ ${template}`;
14067
14112
  focus: true
14068
14113
  }
14069
14114
  ) }),
14070
- /* @__PURE__ */ jsx17(Text16, { color: theme.info.color, children: "Press Enter to skip" })
14115
+ /* @__PURE__ */ jsx18(Text17, { color: theme.info.color, children: "Press Enter to skip" })
14071
14116
  ] });
14072
14117
  case "location": {
14073
14118
  const items = [
@@ -14075,15 +14120,15 @@ ${template}`;
14075
14120
  { label: source === "global" ? "Global \xB7 current" : "Global", value: "global", key: "global" },
14076
14121
  { label: "\u2190 Back", value: "__back__", key: "__back__" }
14077
14122
  ];
14078
- return /* @__PURE__ */ jsxs15(Fragment2, { children: [
14079
- /* @__PURE__ */ jsxs15(Text16, { color: theme.accent, bold: true, children: [
14123
+ return /* @__PURE__ */ jsxs16(Fragment2, { children: [
14124
+ /* @__PURE__ */ jsxs16(Text17, { color: theme.accent, bold: true, children: [
14080
14125
  "Save location (",
14081
14126
  stepIndex,
14082
14127
  "/",
14083
14128
  totalSteps,
14084
14129
  ")"
14085
14130
  ] }),
14086
- /* @__PURE__ */ jsx17(Box15, { marginTop: 1, children: /* @__PURE__ */ jsx17(
14131
+ /* @__PURE__ */ jsx18(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx18(
14087
14132
  SelectInput6,
14088
14133
  {
14089
14134
  items,
@@ -14093,7 +14138,7 @@ ${template}`;
14093
14138
  }
14094
14139
  }
14095
14140
  ) }),
14096
- /* @__PURE__ */ jsx17(Text16, { color: theme.info.color, children: "Project: .kimiflare/commands/ Global: ~/.config/kimiflare/commands/" })
14141
+ /* @__PURE__ */ jsx18(Text17, { color: theme.info.color, children: "Project: .kimiflare/commands/ Global: ~/.config/kimiflare/commands/" })
14097
14142
  ] });
14098
14143
  }
14099
14144
  case "confirm": {
@@ -14101,8 +14146,8 @@ ${template}`;
14101
14146
  { label: "Save", value: "save", key: "save" },
14102
14147
  { label: "Cancel", value: "cancel", key: "cancel" }
14103
14148
  ];
14104
- return /* @__PURE__ */ jsxs15(Fragment2, { children: [
14105
- /* @__PURE__ */ jsxs15(Text16, { color: theme.accent, bold: true, children: [
14149
+ return /* @__PURE__ */ jsxs16(Fragment2, { children: [
14150
+ /* @__PURE__ */ jsxs16(Text17, { color: theme.accent, bold: true, children: [
14106
14151
  mode === "create" ? "Create" : "Edit",
14107
14152
  " custom command \u2014 Confirm (",
14108
14153
  stepIndex,
@@ -14110,13 +14155,13 @@ ${template}`;
14110
14155
  totalSteps,
14111
14156
  ")"
14112
14157
  ] }),
14113
- /* @__PURE__ */ jsxs15(Text16, { color: theme.info.color, children: [
14158
+ /* @__PURE__ */ jsxs16(Text17, { color: theme.info.color, children: [
14114
14159
  source === "project" ? ".kimiflare/commands/" : "~/.config/kimiflare/commands/",
14115
14160
  name,
14116
14161
  ".md"
14117
14162
  ] }),
14118
- /* @__PURE__ */ jsx17(Box15, { marginTop: 1, flexDirection: "column", children: previewContent().split("\n").map((line, i) => /* @__PURE__ */ jsx17(Text16, { color: theme.info.color, children: line || " " }, i)) }),
14119
- /* @__PURE__ */ jsx17(Box15, { marginTop: 1, children: /* @__PURE__ */ jsx17(
14163
+ /* @__PURE__ */ jsx18(Box16, { marginTop: 1, flexDirection: "column", children: previewContent().split("\n").map((line, i) => /* @__PURE__ */ jsx18(Text17, { color: theme.info.color, children: line || " " }, i)) }),
14164
+ /* @__PURE__ */ jsx18(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx18(
14120
14165
  SelectInput6,
14121
14166
  {
14122
14167
  items,
@@ -14127,7 +14172,7 @@ ${template}`;
14127
14172
  }
14128
14173
  }
14129
14174
  };
14130
- return /* @__PURE__ */ jsx17(Box15, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: renderStep() });
14175
+ return /* @__PURE__ */ jsx18(Box16, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: renderStep() });
14131
14176
  }
14132
14177
  var NAME_RE;
14133
14178
  var init_command_wizard = __esm({
@@ -14572,9 +14617,9 @@ var init_context_generator = __esm({
14572
14617
  });
14573
14618
 
14574
14619
  // src/ui/command-picker.tsx
14575
- import { Box as Box16, Text as Text17 } from "ink";
14620
+ import { Box as Box17, Text as Text18 } from "ink";
14576
14621
  import SelectInput7 from "ink-select-input";
14577
- import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
14622
+ import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
14578
14623
  function CommandPicker({ commands, title, onPick }) {
14579
14624
  const theme = useTheme();
14580
14625
  const items = commands.map((cmd) => ({
@@ -14583,10 +14628,10 @@ function CommandPicker({ commands, title, onPick }) {
14583
14628
  key: cmd.name
14584
14629
  }));
14585
14630
  items.push({ label: "\u2190 Cancel", value: null, key: "__cancel__" });
14586
- return /* @__PURE__ */ jsxs16(Box16, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
14587
- /* @__PURE__ */ jsx18(Text17, { color: theme.accent, bold: true, children: title }),
14588
- /* @__PURE__ */ jsx18(Text17, { color: theme.info.color, dimColor: false, children: "Arrow keys to navigate, Enter to select." }),
14589
- /* @__PURE__ */ jsx18(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx18(
14631
+ return /* @__PURE__ */ jsxs17(Box17, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
14632
+ /* @__PURE__ */ jsx19(Text18, { color: theme.accent, bold: true, children: title }),
14633
+ /* @__PURE__ */ jsx19(Text18, { color: theme.info.color, dimColor: false, children: "Arrow keys to navigate, Enter to select." }),
14634
+ /* @__PURE__ */ jsx19(Box17, { marginTop: 1, children: /* @__PURE__ */ jsx19(
14590
14635
  SelectInput7,
14591
14636
  {
14592
14637
  items,
@@ -14609,8 +14654,8 @@ var init_command_picker = __esm({
14609
14654
  });
14610
14655
 
14611
14656
  // src/ui/command-list.tsx
14612
- import { Box as Box17, Text as Text18, useInput as useInput8 } from "ink";
14613
- import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
14657
+ import { Box as Box18, Text as Text19, useInput as useInput8 } from "ink";
14658
+ import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
14614
14659
  function CommandList({ commands, onDone }) {
14615
14660
  const theme = useTheme();
14616
14661
  useInput8((_input, key) => {
@@ -14618,55 +14663,55 @@ function CommandList({ commands, onDone }) {
14618
14663
  onDone();
14619
14664
  }
14620
14665
  });
14621
- return /* @__PURE__ */ jsxs17(Box17, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
14622
- /* @__PURE__ */ jsx19(Text18, { color: theme.accent, bold: true, children: "Custom commands" }),
14623
- /* @__PURE__ */ jsx19(Text18, { color: theme.info.color, dimColor: false, children: "Esc to close." }),
14624
- /* @__PURE__ */ jsxs17(Box17, { marginTop: 1, flexDirection: "column", children: [
14625
- commands.length === 0 && /* @__PURE__ */ jsx19(Text18, { color: theme.info.color, children: "No custom commands found." }),
14626
- commands.map((cmd) => /* @__PURE__ */ jsxs17(Box17, { flexDirection: "column", marginBottom: 1, children: [
14627
- /* @__PURE__ */ jsxs17(Text18, { color: theme.accent, bold: true, children: [
14666
+ return /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
14667
+ /* @__PURE__ */ jsx20(Text19, { color: theme.accent, bold: true, children: "Custom commands" }),
14668
+ /* @__PURE__ */ jsx20(Text19, { color: theme.info.color, dimColor: false, children: "Esc to close." }),
14669
+ /* @__PURE__ */ jsxs18(Box18, { marginTop: 1, flexDirection: "column", children: [
14670
+ commands.length === 0 && /* @__PURE__ */ jsx20(Text19, { color: theme.info.color, children: "No custom commands found." }),
14671
+ commands.map((cmd) => /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", marginBottom: 1, children: [
14672
+ /* @__PURE__ */ jsxs18(Text19, { color: theme.accent, bold: true, children: [
14628
14673
  "/",
14629
14674
  cmd.name
14630
14675
  ] }),
14631
- /* @__PURE__ */ jsxs17(Text18, { color: theme.info.color, children: [
14676
+ /* @__PURE__ */ jsxs18(Text19, { color: theme.info.color, children: [
14632
14677
  " ",
14633
14678
  "source: ",
14634
14679
  cmd.source
14635
14680
  ] }),
14636
- /* @__PURE__ */ jsxs17(Text18, { color: theme.info.color, children: [
14681
+ /* @__PURE__ */ jsxs18(Text19, { color: theme.info.color, children: [
14637
14682
  " ",
14638
14683
  "path: ",
14639
14684
  cmd.filepath
14640
14685
  ] }),
14641
- cmd.description && /* @__PURE__ */ jsxs17(Text18, { color: theme.info.color, children: [
14686
+ cmd.description && /* @__PURE__ */ jsxs18(Text19, { color: theme.info.color, children: [
14642
14687
  " ",
14643
14688
  "desc: ",
14644
14689
  cmd.description
14645
14690
  ] }),
14646
- cmd.mode && /* @__PURE__ */ jsxs17(Text18, { color: theme.info.color, children: [
14691
+ cmd.mode && /* @__PURE__ */ jsxs18(Text19, { color: theme.info.color, children: [
14647
14692
  " ",
14648
14693
  "mode: ",
14649
14694
  cmd.mode
14650
14695
  ] }),
14651
- cmd.effort && /* @__PURE__ */ jsxs17(Text18, { color: theme.info.color, children: [
14696
+ cmd.effort && /* @__PURE__ */ jsxs18(Text19, { color: theme.info.color, children: [
14652
14697
  " ",
14653
14698
  "effort: ",
14654
14699
  cmd.effort
14655
14700
  ] }),
14656
- cmd.model && /* @__PURE__ */ jsxs17(Text18, { color: theme.info.color, children: [
14701
+ cmd.model && /* @__PURE__ */ jsxs18(Text19, { color: theme.info.color, children: [
14657
14702
  " ",
14658
14703
  "model: ",
14659
14704
  cmd.model
14660
14705
  ] }),
14661
- /* @__PURE__ */ jsxs17(Text18, { color: theme.info.color, children: [
14706
+ /* @__PURE__ */ jsxs18(Text19, { color: theme.info.color, children: [
14662
14707
  " ",
14663
14708
  "template:"
14664
14709
  ] }),
14665
- cmd.template.split("\n").slice(0, 5).map((line, i) => /* @__PURE__ */ jsxs17(Text18, { color: theme.info.color, children: [
14710
+ cmd.template.split("\n").slice(0, 5).map((line, i) => /* @__PURE__ */ jsxs18(Text19, { color: theme.info.color, children: [
14666
14711
  " ",
14667
14712
  line || " "
14668
14713
  ] }, i)),
14669
- cmd.template.split("\n").length > 5 && /* @__PURE__ */ jsxs17(Text18, { color: theme.info.color, children: [
14714
+ cmd.template.split("\n").length > 5 && /* @__PURE__ */ jsxs18(Text19, { color: theme.info.color, children: [
14670
14715
  " ",
14671
14716
  "..."
14672
14717
  ] })
@@ -14683,10 +14728,10 @@ var init_command_list = __esm({
14683
14728
 
14684
14729
  // src/ui/lsp-wizard.tsx
14685
14730
  import { useState as useState11 } from "react";
14686
- import { Box as Box18, Text as Text19 } from "ink";
14731
+ import { Box as Box19, Text as Text20 } from "ink";
14687
14732
  import SelectInput8 from "ink-select-input";
14688
14733
  import { spawn as spawn3 } from "child_process";
14689
- import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
14734
+ import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
14690
14735
  function LspWizard({ servers, currentScope, hasProjectDir, onDone, onSave }) {
14691
14736
  const theme = useTheme();
14692
14737
  const [page, setPage] = useState11("main");
@@ -14797,10 +14842,10 @@ function LspWizard({ servers, currentScope, hasProjectDir, onDone, onSave }) {
14797
14842
  { label: "(close)", value: "__close__", key: "__close__" }
14798
14843
  ];
14799
14844
  if (page === "main") {
14800
- return /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
14801
- /* @__PURE__ */ jsx20(Text19, { color: theme.accent, bold: true, children: "LSP Servers" }),
14802
- /* @__PURE__ */ jsx20(Text19, { color: theme.info.color, dimColor: false, children: "Arrow keys to navigate, Enter to select." }),
14803
- /* @__PURE__ */ jsx20(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx20(
14845
+ return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
14846
+ /* @__PURE__ */ jsx21(Text20, { color: theme.accent, bold: true, children: "LSP Servers" }),
14847
+ /* @__PURE__ */ jsx21(Text20, { color: theme.info.color, dimColor: false, children: "Arrow keys to navigate, Enter to select." }),
14848
+ /* @__PURE__ */ jsx21(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx21(
14804
14849
  SelectInput8,
14805
14850
  {
14806
14851
  items: mainItems,
@@ -14828,10 +14873,10 @@ function LspWizard({ servers, currentScope, hasProjectDir, onDone, onSave }) {
14828
14873
  }),
14829
14874
  { label: "\u2190 Back", value: "__back__", key: "__back__" }
14830
14875
  ];
14831
- return /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
14832
- /* @__PURE__ */ jsx20(Text19, { color: theme.accent, bold: true, children: "Add LSP Server" }),
14833
- /* @__PURE__ */ jsx20(Text19, { color: theme.info.color, dimColor: false, children: "Select a language server to configure." }),
14834
- /* @__PURE__ */ jsx20(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx20(
14876
+ return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
14877
+ /* @__PURE__ */ jsx21(Text20, { color: theme.accent, bold: true, children: "Add LSP Server" }),
14878
+ /* @__PURE__ */ jsx21(Text20, { color: theme.info.color, dimColor: false, children: "Select a language server to configure." }),
14879
+ /* @__PURE__ */ jsx21(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx21(
14835
14880
  SelectInput8,
14836
14881
  {
14837
14882
  items,
@@ -14859,18 +14904,18 @@ function LspWizard({ servers, currentScope, hasProjectDir, onDone, onSave }) {
14859
14904
  { label: isSuccess ? "Save to config \u2713" : "Save anyway", value: "save", key: "save" },
14860
14905
  { label: "\u2190 Back", value: "__back__", key: "__back__" }
14861
14906
  ];
14862
- return /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
14863
- /* @__PURE__ */ jsxs18(Text19, { color: theme.accent, bold: true, children: [
14907
+ return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
14908
+ /* @__PURE__ */ jsxs19(Text20, { color: theme.accent, bold: true, children: [
14864
14909
  "Install ",
14865
14910
  selectedPreset.name
14866
14911
  ] }),
14867
- /* @__PURE__ */ jsx20(Text19, { color: theme.info.color, dimColor: false, children: selectedPreset.installHint }),
14868
- /* @__PURE__ */ jsxs18(Box18, { marginTop: 1, flexDirection: "column", children: [
14869
- /* @__PURE__ */ jsx20(Text19, { color: theme.info.color, dimColor: false, children: "Command:" }),
14870
- /* @__PURE__ */ jsx20(Text19, { color: theme.accent, children: selectedPreset.installCommand || "(none required)" })
14912
+ /* @__PURE__ */ jsx21(Text20, { color: theme.info.color, dimColor: false, children: selectedPreset.installHint }),
14913
+ /* @__PURE__ */ jsxs19(Box19, { marginTop: 1, flexDirection: "column", children: [
14914
+ /* @__PURE__ */ jsx21(Text20, { color: theme.info.color, dimColor: false, children: "Command:" }),
14915
+ /* @__PURE__ */ jsx21(Text20, { color: theme.accent, children: selectedPreset.installCommand || "(none required)" })
14871
14916
  ] }),
14872
- installState.output && /* @__PURE__ */ jsx20(Box18, { marginTop: 1, flexDirection: "column", children: /* @__PURE__ */ jsx20(Text19, { color: isSuccess ? theme.accent : theme.error, children: installState.output.slice(-500) }) }),
14873
- /* @__PURE__ */ jsx20(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx20(
14917
+ installState.output && /* @__PURE__ */ jsx21(Box19, { marginTop: 1, flexDirection: "column", children: /* @__PURE__ */ jsx21(Text20, { color: isSuccess ? theme.accent : theme.error, children: installState.output.slice(-500) }) }),
14918
+ /* @__PURE__ */ jsx21(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx21(
14874
14919
  SelectInput8,
14875
14920
  {
14876
14921
  items,
@@ -14888,16 +14933,16 @@ function LspWizard({ servers, currentScope, hasProjectDir, onDone, onSave }) {
14888
14933
  }
14889
14934
  }
14890
14935
  ) }),
14891
- isSuccess && /* @__PURE__ */ jsx20(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx20(Text19, { color: theme.accent, children: "Server saved. Run /lsp reload to start it." }) })
14936
+ isSuccess && /* @__PURE__ */ jsx21(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx21(Text20, { color: theme.accent, children: "Server saved. Run /lsp reload to start it." }) })
14892
14937
  ] });
14893
14938
  }
14894
14939
  if (page === "custom-name") {
14895
- return /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
14896
- /* @__PURE__ */ jsx20(Text19, { color: theme.accent, bold: true, children: "Custom LSP Server \u2014 Name" }),
14897
- /* @__PURE__ */ jsx20(Text19, { color: theme.info.color, dimColor: false, children: "Enter a name for this server (e.g., my-server)." }),
14898
- /* @__PURE__ */ jsxs18(Box18, { marginTop: 1, children: [
14899
- /* @__PURE__ */ jsx20(Text19, { color: theme.accent, children: "\u203A " }),
14900
- /* @__PURE__ */ jsx20(
14940
+ return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
14941
+ /* @__PURE__ */ jsx21(Text20, { color: theme.accent, bold: true, children: "Custom LSP Server \u2014 Name" }),
14942
+ /* @__PURE__ */ jsx21(Text20, { color: theme.info.color, dimColor: false, children: "Enter a name for this server (e.g., my-server)." }),
14943
+ /* @__PURE__ */ jsxs19(Box19, { marginTop: 1, children: [
14944
+ /* @__PURE__ */ jsx21(Text20, { color: theme.accent, children: "\u203A " }),
14945
+ /* @__PURE__ */ jsx21(
14901
14946
  CustomTextInput,
14902
14947
  {
14903
14948
  value: customName,
@@ -14911,7 +14956,7 @@ function LspWizard({ servers, currentScope, hasProjectDir, onDone, onSave }) {
14911
14956
  }
14912
14957
  )
14913
14958
  ] }),
14914
- /* @__PURE__ */ jsx20(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx20(
14959
+ /* @__PURE__ */ jsx21(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx21(
14915
14960
  SelectInput8,
14916
14961
  {
14917
14962
  items: [{ label: "\u2190 Back", value: "__back__", key: "__back__" }],
@@ -14921,12 +14966,12 @@ function LspWizard({ servers, currentScope, hasProjectDir, onDone, onSave }) {
14921
14966
  ] });
14922
14967
  }
14923
14968
  if (page === "custom-command") {
14924
- return /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
14925
- /* @__PURE__ */ jsx20(Text19, { color: theme.accent, bold: true, children: "Custom LSP Server \u2014 Command" }),
14926
- /* @__PURE__ */ jsx20(Text19, { color: theme.info.color, dimColor: false, children: "Enter the command to start the server (space-separated)." }),
14927
- /* @__PURE__ */ jsxs18(Box18, { marginTop: 1, children: [
14928
- /* @__PURE__ */ jsx20(Text19, { color: theme.accent, children: "\u203A " }),
14929
- /* @__PURE__ */ jsx20(
14969
+ return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
14970
+ /* @__PURE__ */ jsx21(Text20, { color: theme.accent, bold: true, children: "Custom LSP Server \u2014 Command" }),
14971
+ /* @__PURE__ */ jsx21(Text20, { color: theme.info.color, dimColor: false, children: "Enter the command to start the server (space-separated)." }),
14972
+ /* @__PURE__ */ jsxs19(Box19, { marginTop: 1, children: [
14973
+ /* @__PURE__ */ jsx21(Text20, { color: theme.accent, children: "\u203A " }),
14974
+ /* @__PURE__ */ jsx21(
14930
14975
  CustomTextInput,
14931
14976
  {
14932
14977
  value: customCommand,
@@ -14940,7 +14985,7 @@ function LspWizard({ servers, currentScope, hasProjectDir, onDone, onSave }) {
14940
14985
  }
14941
14986
  )
14942
14987
  ] }),
14943
- /* @__PURE__ */ jsx20(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx20(
14988
+ /* @__PURE__ */ jsx21(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx21(
14944
14989
  SelectInput8,
14945
14990
  {
14946
14991
  items: [{ label: "\u2190 Back", value: "__back__", key: "__back__" }],
@@ -14964,10 +15009,10 @@ function LspWizard({ servers, currentScope, hasProjectDir, onDone, onSave }) {
14964
15009
  },
14965
15010
  { label: "\u2190 Back", value: "__back__", key: "__back__" }
14966
15011
  ];
14967
- return /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
14968
- /* @__PURE__ */ jsx20(Text19, { color: theme.accent, bold: true, children: "Save LSP Config" }),
14969
- /* @__PURE__ */ jsx20(Text19, { color: theme.info.color, dimColor: false, children: "Where should this server configuration be saved?" }),
14970
- /* @__PURE__ */ jsx20(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx20(
15012
+ return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
15013
+ /* @__PURE__ */ jsx21(Text20, { color: theme.accent, bold: true, children: "Save LSP Config" }),
15014
+ /* @__PURE__ */ jsx21(Text20, { color: theme.info.color, dimColor: false, children: "Where should this server configuration be saved?" }),
15015
+ /* @__PURE__ */ jsx21(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx21(
14971
15016
  SelectInput8,
14972
15017
  {
14973
15018
  items,
@@ -14986,10 +15031,10 @@ function LspWizard({ servers, currentScope, hasProjectDir, onDone, onSave }) {
14986
15031
  if (page === "edit") {
14987
15032
  const keys = Object.keys(servers);
14988
15033
  if (keys.length === 0) {
14989
- return /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
14990
- /* @__PURE__ */ jsx20(Text19, { color: theme.accent, bold: true, children: "Edit LSP Server" }),
14991
- /* @__PURE__ */ jsx20(Text19, { color: theme.info.color, children: "No servers configured." }),
14992
- /* @__PURE__ */ jsx20(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx20(
15034
+ return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
15035
+ /* @__PURE__ */ jsx21(Text20, { color: theme.accent, bold: true, children: "Edit LSP Server" }),
15036
+ /* @__PURE__ */ jsx21(Text20, { color: theme.info.color, children: "No servers configured." }),
15037
+ /* @__PURE__ */ jsx21(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx21(
14993
15038
  SelectInput8,
14994
15039
  {
14995
15040
  items: [{ label: "\u2190 Back", value: "__back__", key: "__back__" }],
@@ -15010,10 +15055,10 @@ function LspWizard({ servers, currentScope, hasProjectDir, onDone, onSave }) {
15010
15055
  }),
15011
15056
  { label: "\u2190 Back", value: "__back__", key: "__back__" }
15012
15057
  ];
15013
- return /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
15014
- /* @__PURE__ */ jsx20(Text19, { color: theme.accent, bold: true, children: "Edit LSP Server" }),
15015
- /* @__PURE__ */ jsx20(Text19, { color: theme.info.color, dimColor: false, children: "Select a server to toggle enabled/disabled." }),
15016
- /* @__PURE__ */ jsx20(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx20(
15058
+ return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
15059
+ /* @__PURE__ */ jsx21(Text20, { color: theme.accent, bold: true, children: "Edit LSP Server" }),
15060
+ /* @__PURE__ */ jsx21(Text20, { color: theme.info.color, dimColor: false, children: "Select a server to toggle enabled/disabled." }),
15061
+ /* @__PURE__ */ jsx21(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx21(
15017
15062
  SelectInput8,
15018
15063
  {
15019
15064
  items,
@@ -15031,10 +15076,10 @@ function LspWizard({ servers, currentScope, hasProjectDir, onDone, onSave }) {
15031
15076
  if (page === "delete") {
15032
15077
  const keys = Object.keys(servers);
15033
15078
  if (keys.length === 0) {
15034
- return /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
15035
- /* @__PURE__ */ jsx20(Text19, { color: theme.accent, bold: true, children: "Delete LSP Server" }),
15036
- /* @__PURE__ */ jsx20(Text19, { color: theme.info.color, children: "No servers configured." }),
15037
- /* @__PURE__ */ jsx20(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx20(
15079
+ return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
15080
+ /* @__PURE__ */ jsx21(Text20, { color: theme.accent, bold: true, children: "Delete LSP Server" }),
15081
+ /* @__PURE__ */ jsx21(Text20, { color: theme.info.color, children: "No servers configured." }),
15082
+ /* @__PURE__ */ jsx21(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx21(
15038
15083
  SelectInput8,
15039
15084
  {
15040
15085
  items: [{ label: "\u2190 Back", value: "__back__", key: "__back__" }],
@@ -15051,10 +15096,10 @@ function LspWizard({ servers, currentScope, hasProjectDir, onDone, onSave }) {
15051
15096
  })),
15052
15097
  { label: "\u2190 Back", value: "__back__", key: "__back__" }
15053
15098
  ];
15054
- return /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
15055
- /* @__PURE__ */ jsx20(Text19, { color: theme.accent, bold: true, children: "Delete LSP Server" }),
15056
- /* @__PURE__ */ jsx20(Text19, { color: theme.info.color, dimColor: false, children: "Select a server to remove from config." }),
15057
- /* @__PURE__ */ jsx20(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx20(
15099
+ return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
15100
+ /* @__PURE__ */ jsx21(Text20, { color: theme.accent, bold: true, children: "Delete LSP Server" }),
15101
+ /* @__PURE__ */ jsx21(Text20, { color: theme.info.color, dimColor: false, children: "Select a server to remove from config." }),
15102
+ /* @__PURE__ */ jsx21(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx21(
15058
15103
  SelectInput8,
15059
15104
  {
15060
15105
  items,
@@ -15071,14 +15116,14 @@ function LspWizard({ servers, currentScope, hasProjectDir, onDone, onSave }) {
15071
15116
  }
15072
15117
  if (page === "list") {
15073
15118
  const keys = Object.keys(servers);
15074
- return /* @__PURE__ */ jsxs18(Box18, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
15075
- /* @__PURE__ */ jsx20(Text19, { color: theme.accent, bold: true, children: "Configured LSP Servers" }),
15076
- keys.length === 0 ? /* @__PURE__ */ jsx20(Text19, { color: theme.info.color, children: "No servers configured." }) : /* @__PURE__ */ jsx20(Box18, { marginTop: 1, flexDirection: "column", children: keys.map((k) => {
15119
+ return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
15120
+ /* @__PURE__ */ jsx21(Text20, { color: theme.accent, bold: true, children: "Configured LSP Servers" }),
15121
+ keys.length === 0 ? /* @__PURE__ */ jsx21(Text20, { color: theme.info.color, children: "No servers configured." }) : /* @__PURE__ */ jsx21(Box19, { marginTop: 1, flexDirection: "column", children: keys.map((k) => {
15077
15122
  const s = servers[k];
15078
15123
  const status = s.enabled !== false ? "enabled" : "disabled";
15079
- return /* @__PURE__ */ jsx20(Text19, { color: theme.info.color, children: ` ${k.padEnd(16)} ${status} ${s.command.join(" ")}` }, k);
15124
+ return /* @__PURE__ */ jsx21(Text20, { color: theme.info.color, children: ` ${k.padEnd(16)} ${status} ${s.command.join(" ")}` }, k);
15080
15125
  }) }),
15081
- /* @__PURE__ */ jsx20(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx20(
15126
+ /* @__PURE__ */ jsx21(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx21(
15082
15127
  SelectInput8,
15083
15128
  {
15084
15129
  items: [{ label: "\u2190 Back", value: "__back__", key: "__back__" }],
@@ -15205,9 +15250,9 @@ var init_lsp_wizard = __esm({
15205
15250
  });
15206
15251
 
15207
15252
  // src/ui/theme-picker.tsx
15208
- import { Box as Box19, Text as Text20 } from "ink";
15253
+ import { Box as Box20, Text as Text21 } from "ink";
15209
15254
  import SelectInput9 from "ink-select-input";
15210
- import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
15255
+ import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
15211
15256
  function PaletteSwatches({ palette }) {
15212
15257
  const colors = [
15213
15258
  palette.primary,
@@ -15215,7 +15260,7 @@ function PaletteSwatches({ palette }) {
15215
15260
  palette.success,
15216
15261
  palette.error
15217
15262
  ];
15218
- return /* @__PURE__ */ jsx21(Box19, { children: colors.map((c, i) => /* @__PURE__ */ jsx21(Text20, { color: c, children: "\u2588" }, i)) });
15263
+ return /* @__PURE__ */ jsx22(Box20, { children: colors.map((c, i) => /* @__PURE__ */ jsx22(Text21, { color: c, children: "\u2588" }, i)) });
15219
15264
  }
15220
15265
  function ThemePicker({ themes, onPick }) {
15221
15266
  const current = useTheme();
@@ -15223,9 +15268,9 @@ function ThemePicker({ themes, onPick }) {
15223
15268
  ...themes.map((t) => ({ label: t.label, value: t.name })),
15224
15269
  { label: "< Back", value: "__back__" }
15225
15270
  ];
15226
- return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", borderStyle: "round", borderColor: current.accent, paddingX: 1, children: [
15227
- /* @__PURE__ */ jsx21(Text20, { color: current.accent, bold: true, children: "Pick a theme (restart to apply)" }),
15228
- /* @__PURE__ */ jsx21(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx21(
15271
+ return /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", borderStyle: "round", borderColor: current.accent, paddingX: 1, children: [
15272
+ /* @__PURE__ */ jsx22(Text21, { color: current.accent, bold: true, children: "Pick a theme (restart to apply)" }),
15273
+ /* @__PURE__ */ jsx22(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx22(
15229
15274
  SelectInput9,
15230
15275
  {
15231
15276
  items,
@@ -15240,9 +15285,9 @@ function ThemePicker({ themes, onPick }) {
15240
15285
  itemComponent: ({ label, isSelected }) => {
15241
15286
  const t = themes.find((x) => x.label === label);
15242
15287
  const color = t?.accent ?? current.accent;
15243
- return /* @__PURE__ */ jsxs19(Box19, { children: [
15244
- /* @__PURE__ */ jsx21(Text20, { color, bold: isSelected, dimColor: !isSelected, children: label }),
15245
- t && /* @__PURE__ */ jsx21(Box19, { marginLeft: 1, children: /* @__PURE__ */ jsx21(PaletteSwatches, { palette: t.palette }) })
15288
+ return /* @__PURE__ */ jsxs20(Box20, { children: [
15289
+ /* @__PURE__ */ jsx22(Text21, { color, bold: isSelected, dimColor: !isSelected, children: label }),
15290
+ t && /* @__PURE__ */ jsx22(Box20, { marginLeft: 1, children: /* @__PURE__ */ jsx22(PaletteSwatches, { palette: t.palette }) })
15246
15291
  ] });
15247
15292
  }
15248
15293
  }
@@ -16429,8 +16474,8 @@ var init_lsp_nudge = __esm({
16429
16474
  });
16430
16475
 
16431
16476
  // src/ui/file-picker.tsx
16432
- import { Box as Box20, Text as Text21 } from "ink";
16433
- import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
16477
+ import { Box as Box21, Text as Text22 } from "ink";
16478
+ import { jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
16434
16479
  function FilePicker({ items, selectedIndex, query, recentFiles }) {
16435
16480
  const theme = useTheme();
16436
16481
  let startIndex = 0;
@@ -16442,12 +16487,12 @@ function FilePicker({ items, selectedIndex, query, recentFiles }) {
16442
16487
  const hasMoreBelow = items.length > startIndex + VISIBLE_LIMIT;
16443
16488
  const recentInVisible = visible.filter((item) => recentFiles?.has(item.name)).length;
16444
16489
  const hasRecentSection = recentInVisible > 0;
16445
- return /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
16446
- /* @__PURE__ */ jsx22(Text21, { color: theme.accent, bold: true, children: query ? `Files matching "${query}"` : "Mention a file" }),
16447
- /* @__PURE__ */ jsx22(Text21, { color: theme.info.color, dimColor: true, children: "\u2191\u2193 navigate \xB7 Enter pick \xB7 Esc cancel" }),
16448
- /* @__PURE__ */ jsxs20(Box20, { marginTop: 1, flexDirection: "column", children: [
16449
- visible.length === 0 && /* @__PURE__ */ jsx22(Text21, { color: theme.info.color, children: "No matches" }),
16450
- hasMoreAbove && /* @__PURE__ */ jsxs20(Text21, { color: theme.info.color, dimColor: true, children: [
16490
+ return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
16491
+ /* @__PURE__ */ jsx23(Text22, { color: theme.accent, bold: true, children: query ? `Files matching "${query}"` : "Mention a file" }),
16492
+ /* @__PURE__ */ jsx23(Text22, { color: theme.info.color, dimColor: true, children: "\u2191\u2193 navigate \xB7 Enter pick \xB7 Esc cancel" }),
16493
+ /* @__PURE__ */ jsxs21(Box21, { marginTop: 1, flexDirection: "column", children: [
16494
+ visible.length === 0 && /* @__PURE__ */ jsx23(Text22, { color: theme.info.color, children: "No matches" }),
16495
+ hasMoreAbove && /* @__PURE__ */ jsxs21(Text22, { color: theme.info.color, dimColor: true, children: [
16451
16496
  "\u2026 ",
16452
16497
  startIndex,
16453
16498
  " more above"
@@ -16459,28 +16504,28 @@ function FilePicker({ items, selectedIndex, query, recentFiles }) {
16459
16504
  const label = item.isDirectory ? `${item.name}/` : item.name;
16460
16505
  const isFirstRecent = isRecent && (i === 0 || !recentFiles?.has(visible[i - 1]?.name ?? ""));
16461
16506
  const isFirstNonRecentAfterRecent = !isRecent && (i > 0 && recentFiles?.has(visible[i - 1]?.name ?? ""));
16462
- return /* @__PURE__ */ jsxs20(Box20, { flexDirection: "column", children: [
16463
- hasRecentSection && isFirstRecent && /* @__PURE__ */ jsxs20(Text21, { color: theme.palette.success, bold: true, children: [
16507
+ return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", children: [
16508
+ hasRecentSection && isFirstRecent && /* @__PURE__ */ jsxs21(Text22, { color: theme.palette.success, bold: true, children: [
16464
16509
  " ",
16465
16510
  "Recent"
16466
16511
  ] }),
16467
- hasRecentSection && isFirstNonRecentAfterRecent && /* @__PURE__ */ jsxs20(Text21, { color: theme.info.color, dimColor: true, children: [
16512
+ hasRecentSection && isFirstNonRecentAfterRecent && /* @__PURE__ */ jsxs21(Text22, { color: theme.info.color, dimColor: true, children: [
16468
16513
  " ",
16469
16514
  "All files"
16470
16515
  ] }),
16471
- /* @__PURE__ */ jsxs20(Text21, { color: isSelected ? theme.accent : isRecent ? theme.palette.success : void 0, bold: isSelected || isRecent, children: [
16516
+ /* @__PURE__ */ jsxs21(Text22, { color: isSelected ? theme.accent : isRecent ? theme.palette.success : void 0, bold: isSelected || isRecent, children: [
16472
16517
  isSelected ? "\u203A " : isRecent ? "\u2192 " : " ",
16473
16518
  isRecent ? "\u21BB " : "",
16474
16519
  label
16475
16520
  ] })
16476
16521
  ] }, item.name);
16477
16522
  }),
16478
- hasMoreBelow && /* @__PURE__ */ jsxs20(Text21, { color: theme.info.color, dimColor: true, children: [
16523
+ hasMoreBelow && /* @__PURE__ */ jsxs21(Text22, { color: theme.info.color, dimColor: true, children: [
16479
16524
  "\u2026 ",
16480
16525
  items.length - (startIndex + VISIBLE_LIMIT),
16481
16526
  " more below"
16482
16527
  ] }),
16483
- hasRecentSection && /* @__PURE__ */ jsx22(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx22(Text21, { color: theme.info.color, dimColor: true, children: "\u21BB = recently used" }) })
16528
+ hasRecentSection && /* @__PURE__ */ jsx23(Box21, { marginTop: 1, children: /* @__PURE__ */ jsx23(Text22, { color: theme.info.color, dimColor: true, children: "\u21BB = recently used" }) })
16484
16529
  ] })
16485
16530
  ] });
16486
16531
  }
@@ -16494,8 +16539,8 @@ var init_file_picker = __esm({
16494
16539
  });
16495
16540
 
16496
16541
  // src/ui/slash-picker.tsx
16497
- import { Box as Box21, Text as Text22 } from "ink";
16498
- import { jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
16542
+ import { Box as Box22, Text as Text23 } from "ink";
16543
+ import { jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
16499
16544
  function sourceBadge(source) {
16500
16545
  if (source === "builtin") return "";
16501
16546
  if (source === "project") return "project";
@@ -16515,12 +16560,12 @@ function SlashPicker({ items, selectedIndex, query }) {
16515
16560
  const hasMoreBelow = items.length > startIndex + VISIBLE_LIMIT2;
16516
16561
  const longestLabel = visible.reduce((m, it) => Math.max(m, commandLabel(it).length), 0);
16517
16562
  const nameColWidth = Math.max(NAME_COL_MIN_WIDTH, longestLabel + NAME_DESC_GAP);
16518
- return /* @__PURE__ */ jsxs21(Box21, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
16519
- /* @__PURE__ */ jsx23(Text22, { color: theme.accent, bold: true, children: query ? `Commands matching "/${query}"` : "Slash commands" }),
16520
- /* @__PURE__ */ jsx23(Text22, { color: theme.info.color, children: "Arrow keys to navigate, Enter to select, Esc to cancel." }),
16521
- /* @__PURE__ */ jsxs21(Box21, { marginTop: 1, flexDirection: "column", children: [
16522
- visible.length === 0 && /* @__PURE__ */ jsx23(Text22, { color: theme.info.color, children: "No matches" }),
16523
- hasMoreAbove && /* @__PURE__ */ jsxs21(Text22, { color: theme.info.color, children: [
16563
+ return /* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
16564
+ /* @__PURE__ */ jsx24(Text23, { color: theme.accent, bold: true, children: query ? `Commands matching "/${query}"` : "Slash commands" }),
16565
+ /* @__PURE__ */ jsx24(Text23, { color: theme.info.color, children: "Arrow keys to navigate, Enter to select, Esc to cancel." }),
16566
+ /* @__PURE__ */ jsxs22(Box22, { marginTop: 1, flexDirection: "column", children: [
16567
+ visible.length === 0 && /* @__PURE__ */ jsx24(Text23, { color: theme.info.color, children: "No matches" }),
16568
+ hasMoreAbove && /* @__PURE__ */ jsxs22(Text23, { color: theme.info.color, children: [
16524
16569
  "\u2026 ",
16525
16570
  startIndex,
16526
16571
  " more above"
@@ -16530,16 +16575,16 @@ function SlashPicker({ items, selectedIndex, query }) {
16530
16575
  const isSelected = actualIndex === selectedIndex;
16531
16576
  const nameCol = commandLabel(item).padEnd(nameColWidth);
16532
16577
  const badge = sourceBadge(item.source);
16533
- return /* @__PURE__ */ jsxs21(Text22, { color: isSelected ? theme.accent : void 0, bold: isSelected, children: [
16578
+ return /* @__PURE__ */ jsxs22(Text23, { color: isSelected ? theme.accent : void 0, bold: isSelected, children: [
16534
16579
  isSelected ? "\u203A " : " ",
16535
16580
  nameCol,
16536
- /* @__PURE__ */ jsxs21(Text22, { color: theme.info.color, children: [
16581
+ /* @__PURE__ */ jsxs22(Text23, { color: theme.info.color, children: [
16537
16582
  item.description,
16538
16583
  badge && ` [${badge}]`
16539
16584
  ] })
16540
16585
  ] }, item.name);
16541
16586
  }),
16542
- hasMoreBelow && /* @__PURE__ */ jsxs21(Text22, { color: theme.info.color, children: [
16587
+ hasMoreBelow && /* @__PURE__ */ jsxs22(Text23, { color: theme.info.color, children: [
16543
16588
  "\u2026 ",
16544
16589
  items.length - (startIndex + VISIBLE_LIMIT2),
16545
16590
  " more below"
@@ -16650,7 +16695,7 @@ __export(app_exports, {
16650
16695
  shouldOpenSlashPicker: () => shouldOpenSlashPicker
16651
16696
  });
16652
16697
  import React15, { useState as useState12, useRef as useRef3, useEffect as useEffect7, useCallback as useCallback3 } from "react";
16653
- import { Box as Box22, Text as Text23, useApp, useInput as useInput9, render } from "ink";
16698
+ import { Box as Box23, Text as Text24, useApp, useInput as useInput9, render } from "ink";
16654
16699
  import SelectInput10 from "ink-select-input";
16655
16700
  import { existsSync as existsSync4, statSync as statSync4 } from "fs";
16656
16701
  import { join as join27 } from "path";
@@ -16660,7 +16705,7 @@ import { spawn as spawn4 } from "child_process";
16660
16705
  import { platform as platform3 } from "os";
16661
16706
  import fg4 from "fast-glob";
16662
16707
  import { readFileSync as readFileSync3 } from "fs";
16663
- import { jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
16708
+ import { jsx as jsx25, jsxs as jsxs23 } from "react/jsx-runtime";
16664
16709
  function buildFilePickerIgnoreList(cwd) {
16665
16710
  const hardcoded = [
16666
16711
  // Dependencies
@@ -18284,6 +18329,17 @@ ${wcagWarnings.join("\n")}` }
18284
18329
  ...es,
18285
18330
  { kind: "error", key: mkKey(), text: "The agent got stuck repeating the same actions. Here's what we know so far." }
18286
18331
  ]);
18332
+ } else if (e instanceof KimiApiError && (e.httpStatus === 429 || e.code === 3040 || e.httpStatus !== void 0 && e.httpStatus >= 500)) {
18333
+ setEvents((es) => [
18334
+ ...es,
18335
+ {
18336
+ kind: "api_error",
18337
+ key: mkKey(),
18338
+ httpStatus: e.httpStatus,
18339
+ code: e.code,
18340
+ message: humanizeCloudflareError(e)
18341
+ }
18342
+ ]);
18287
18343
  } else {
18288
18344
  const displayText = e instanceof KimiApiError ? humanizeCloudflareError(e) : `init failed: ${e.message}`;
18289
18345
  setEvents((es) => [
@@ -19842,6 +19898,17 @@ ${lines.join("\n")}` }]);
19842
19898
  ...es,
19843
19899
  { kind: "cloud_quota_exhausted", key: mkKey(), used, limit, expiresAt }
19844
19900
  ]);
19901
+ } else if (e instanceof KimiApiError && (e.httpStatus === 429 || e.code === 3040 || e.httpStatus !== void 0 && e.httpStatus >= 500)) {
19902
+ setEvents((es) => [
19903
+ ...es,
19904
+ {
19905
+ kind: "api_error",
19906
+ key: mkKey(),
19907
+ httpStatus: e.httpStatus,
19908
+ code: e.code,
19909
+ message: humanizeCloudflareError(e)
19910
+ }
19911
+ ]);
19845
19912
  } else {
19846
19913
  const displayText2 = e instanceof KimiApiError ? humanizeCloudflareError(e) : e.message ?? String(e);
19847
19914
  setEvents((es) => [
@@ -19901,7 +19968,7 @@ ${lines.join("\n")}` }]);
19901
19968
  }
19902
19969
  }, [usage]);
19903
19970
  if (!cfg) {
19904
- return /* @__PURE__ */ jsx24(ThemeProvider, { theme, children: /* @__PURE__ */ jsx24(
19971
+ return /* @__PURE__ */ jsx25(ThemeProvider, { theme, children: /* @__PURE__ */ jsx25(
19905
19972
  Onboarding,
19906
19973
  {
19907
19974
  onCancel: () => exit(),
@@ -19933,7 +20000,7 @@ ${lines.join("\n")}` }]);
19933
20000
  ) });
19934
20001
  }
19935
20002
  if (checkpointSession !== null) {
19936
- return /* @__PURE__ */ jsx24(ThemeProvider, { theme, children: /* @__PURE__ */ jsx24(Box22, { flexDirection: "column", children: /* @__PURE__ */ jsx24(
20003
+ return /* @__PURE__ */ jsx25(ThemeProvider, { theme, children: /* @__PURE__ */ jsx25(Box23, { flexDirection: "column", children: /* @__PURE__ */ jsx25(
19937
20004
  CheckpointPicker,
19938
20005
  {
19939
20006
  session: checkpointSession,
@@ -19943,10 +20010,10 @@ ${lines.join("\n")}` }]);
19943
20010
  ) }) });
19944
20011
  }
19945
20012
  if (resumeSessions !== null) {
19946
- return /* @__PURE__ */ jsx24(ThemeProvider, { theme, children: /* @__PURE__ */ jsx24(Box22, { flexDirection: "column", children: /* @__PURE__ */ jsx24(ResumePicker, { sessions: resumeSessions, onPick: handleResumePick }) }) });
20013
+ return /* @__PURE__ */ jsx25(ThemeProvider, { theme, children: /* @__PURE__ */ jsx25(Box23, { flexDirection: "column", children: /* @__PURE__ */ jsx25(ResumePicker, { sessions: resumeSessions, onPick: handleResumePick }) }) });
19947
20014
  }
19948
20015
  if (showRemoteDashboard) {
19949
- return /* @__PURE__ */ jsx24(ThemeProvider, { theme, children: /* @__PURE__ */ jsx24(Box22, { flexDirection: "column", children: selectedRemoteSession ? /* @__PURE__ */ jsx24(
20016
+ return /* @__PURE__ */ jsx25(ThemeProvider, { theme, children: /* @__PURE__ */ jsx25(Box23, { flexDirection: "column", children: selectedRemoteSession ? /* @__PURE__ */ jsx25(
19950
20017
  RemoteSessionDetail,
19951
20018
  {
19952
20019
  session: selectedRemoteSession,
@@ -19969,7 +20036,7 @@ ${lines.join("\n")}` }]);
19969
20036
  setShowRemoteDashboard(false);
19970
20037
  }
19971
20038
  }
19972
- ) : /* @__PURE__ */ jsx24(
20039
+ ) : /* @__PURE__ */ jsx25(
19973
20040
  RemoteDashboard,
19974
20041
  {
19975
20042
  onSelect: (session) => setSelectedRemoteSession(session),
@@ -19978,7 +20045,7 @@ ${lines.join("\n")}` }]);
19978
20045
  ) }) });
19979
20046
  }
19980
20047
  if (showLspWizard) {
19981
- return /* @__PURE__ */ jsx24(ThemeProvider, { theme, children: /* @__PURE__ */ jsx24(Box22, { flexDirection: "column", children: /* @__PURE__ */ jsx24(
20048
+ return /* @__PURE__ */ jsx25(ThemeProvider, { theme, children: /* @__PURE__ */ jsx25(Box23, { flexDirection: "column", children: /* @__PURE__ */ jsx25(
19982
20049
  LspWizard,
19983
20050
  {
19984
20051
  servers: cfg?.lspServers ?? {},
@@ -20015,7 +20082,7 @@ ${lines.join("\n")}` }]);
20015
20082
  ) }) });
20016
20083
  }
20017
20084
  if (commandWizard) {
20018
- return /* @__PURE__ */ jsx24(ThemeProvider, { theme, children: /* @__PURE__ */ jsx24(Box22, { flexDirection: "column", children: /* @__PURE__ */ jsx24(
20085
+ return /* @__PURE__ */ jsx25(ThemeProvider, { theme, children: /* @__PURE__ */ jsx25(Box23, { flexDirection: "column", children: /* @__PURE__ */ jsx25(
20019
20086
  CommandWizard,
20020
20087
  {
20021
20088
  mode: commandWizard.mode,
@@ -20028,7 +20095,7 @@ ${lines.join("\n")}` }]);
20028
20095
  ) }) });
20029
20096
  }
20030
20097
  if (commandPicker) {
20031
- return /* @__PURE__ */ jsx24(ThemeProvider, { theme, children: /* @__PURE__ */ jsx24(Box22, { flexDirection: "column", children: /* @__PURE__ */ jsx24(
20098
+ return /* @__PURE__ */ jsx25(ThemeProvider, { theme, children: /* @__PURE__ */ jsx25(Box23, { flexDirection: "column", children: /* @__PURE__ */ jsx25(
20032
20099
  CommandPicker,
20033
20100
  {
20034
20101
  commands: customCommandsRef.current,
@@ -20046,14 +20113,14 @@ ${lines.join("\n")}` }]);
20046
20113
  ) }) });
20047
20114
  }
20048
20115
  if (commandToDelete) {
20049
- return /* @__PURE__ */ jsx24(ThemeProvider, { theme, children: /* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
20050
- /* @__PURE__ */ jsxs22(Text23, { color: theme.accent, bold: true, children: [
20116
+ return /* @__PURE__ */ jsx25(ThemeProvider, { theme, children: /* @__PURE__ */ jsxs23(Box23, { flexDirection: "column", borderStyle: "round", borderColor: theme.accent, paddingX: 1, children: [
20117
+ /* @__PURE__ */ jsxs23(Text24, { color: theme.accent, bold: true, children: [
20051
20118
  "Delete /",
20052
20119
  commandToDelete.name,
20053
20120
  "?"
20054
20121
  ] }),
20055
- /* @__PURE__ */ jsx24(Text23, { color: theme.info.color, children: commandToDelete.filepath }),
20056
- /* @__PURE__ */ jsx24(Box22, { marginTop: 1, children: /* @__PURE__ */ jsx24(
20122
+ /* @__PURE__ */ jsx25(Text24, { color: theme.info.color, children: commandToDelete.filepath }),
20123
+ /* @__PURE__ */ jsx25(Box23, { marginTop: 1, children: /* @__PURE__ */ jsx25(
20057
20124
  SelectInput10,
20058
20125
  {
20059
20126
  items: [
@@ -20072,7 +20139,7 @@ ${lines.join("\n")}` }]);
20072
20139
  ] }) });
20073
20140
  }
20074
20141
  if (showCommandList) {
20075
- return /* @__PURE__ */ jsx24(ThemeProvider, { theme, children: /* @__PURE__ */ jsx24(Box22, { flexDirection: "column", children: /* @__PURE__ */ jsx24(
20142
+ return /* @__PURE__ */ jsx25(ThemeProvider, { theme, children: /* @__PURE__ */ jsx25(Box23, { flexDirection: "column", children: /* @__PURE__ */ jsx25(
20076
20143
  CommandList,
20077
20144
  {
20078
20145
  commands: customCommandsRef.current,
@@ -20081,12 +20148,12 @@ ${lines.join("\n")}` }]);
20081
20148
  ) }) });
20082
20149
  }
20083
20150
  if (showThemePicker) {
20084
- return /* @__PURE__ */ jsx24(ThemeProvider, { theme, children: /* @__PURE__ */ jsx24(Box22, { flexDirection: "column", children: /* @__PURE__ */ jsx24(ThemePicker, { themes: themeList(), onPick: handleThemePick }) }) });
20151
+ return /* @__PURE__ */ jsx25(ThemeProvider, { theme, children: /* @__PURE__ */ jsx25(Box23, { flexDirection: "column", children: /* @__PURE__ */ jsx25(ThemePicker, { themes: themeList(), onPick: handleThemePick }) }) });
20085
20152
  }
20086
20153
  const hasConversation = events.some((e) => e.kind === "user" || e.kind === "assistant");
20087
- return /* @__PURE__ */ jsx24(ThemeProvider, { theme, children: /* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", children: [
20088
- !hasConversation && events.length === 0 ? /* @__PURE__ */ jsx24(Welcome, {}) : /* @__PURE__ */ jsx24(ChatView, { events, showReasoning, verbose, intentTier: intentTier ?? void 0 }),
20089
- perm ? /* @__PURE__ */ jsx24(
20154
+ return /* @__PURE__ */ jsx25(ThemeProvider, { theme, children: /* @__PURE__ */ jsxs23(Box23, { flexDirection: "column", children: [
20155
+ !hasConversation && events.length === 0 ? /* @__PURE__ */ jsx25(Welcome, {}) : /* @__PURE__ */ jsx25(ChatView, { events, showReasoning, verbose, intentTier: intentTier ?? void 0 }),
20156
+ perm ? /* @__PURE__ */ jsx25(
20090
20157
  PermissionModal,
20091
20158
  {
20092
20159
  tool: perm.tool,
@@ -20100,7 +20167,7 @@ ${lines.join("\n")}` }]);
20100
20167
  submitRef.current(text);
20101
20168
  }
20102
20169
  }
20103
- ) : limitModal ? /* @__PURE__ */ jsx24(
20170
+ ) : limitModal ? /* @__PURE__ */ jsx25(
20104
20171
  LimitModal,
20105
20172
  {
20106
20173
  limit: limitModal.limit,
@@ -20110,8 +20177,8 @@ ${lines.join("\n")}` }]);
20110
20177
  setLimitModal(null);
20111
20178
  }
20112
20179
  }
20113
- ) : /* @__PURE__ */ jsxs22(Box22, { flexDirection: "column", marginTop: 1, children: [
20114
- tasks.length > 0 && /* @__PURE__ */ jsx24(
20180
+ ) : /* @__PURE__ */ jsxs23(Box23, { flexDirection: "column", marginTop: 1, children: [
20181
+ tasks.length > 0 && /* @__PURE__ */ jsx25(
20115
20182
  TaskList,
20116
20183
  {
20117
20184
  tasks,
@@ -20119,11 +20186,11 @@ ${lines.join("\n")}` }]);
20119
20186
  tokensDelta: Math.max(0, (usage?.prompt_tokens ?? 0) - tasksStartTokens)
20120
20187
  }
20121
20188
  ),
20122
- queue.length > 0 && /* @__PURE__ */ jsx24(Box22, { flexDirection: "column", marginBottom: 1, children: queue.map((q, i) => /* @__PURE__ */ jsxs22(Text23, { color: theme.info.color, dimColor: theme.info.dim, children: [
20189
+ queue.length > 0 && /* @__PURE__ */ jsx25(Box23, { flexDirection: "column", marginBottom: 1, children: queue.map((q, i) => /* @__PURE__ */ jsxs23(Text24, { color: theme.info.color, dimColor: theme.info.dim, children: [
20123
20190
  "\u23F3 ",
20124
20191
  q.display
20125
20192
  ] }, `queue_${i}`)) }),
20126
- /* @__PURE__ */ jsx24(
20193
+ /* @__PURE__ */ jsx25(
20127
20194
  StatusBar,
20128
20195
  {
20129
20196
  usage,
@@ -20146,7 +20213,7 @@ ${lines.join("\n")}` }]);
20146
20213
  intentTier: intentTier ?? void 0
20147
20214
  }
20148
20215
  ),
20149
- activePicker?.kind === "file" && /* @__PURE__ */ jsx24(
20216
+ activePicker?.kind === "file" && /* @__PURE__ */ jsx25(
20150
20217
  FilePicker,
20151
20218
  {
20152
20219
  items: filteredFileItems,
@@ -20155,7 +20222,7 @@ ${lines.join("\n")}` }]);
20155
20222
  recentFiles: new Set(recentFilesRef.current.keys())
20156
20223
  }
20157
20224
  ),
20158
- activePicker?.kind === "slash" && /* @__PURE__ */ jsx24(
20225
+ activePicker?.kind === "slash" && /* @__PURE__ */ jsx25(
20159
20226
  SlashPicker,
20160
20227
  {
20161
20228
  items: filteredSlashItems,
@@ -20163,9 +20230,9 @@ ${lines.join("\n")}` }]);
20163
20230
  query: pickerQuery ?? ""
20164
20231
  }
20165
20232
  ),
20166
- /* @__PURE__ */ jsxs22(Box22, { marginTop: 1, children: [
20167
- /* @__PURE__ */ jsx24(Text23, { color: theme.prompt ?? theme.accent, children: "\u203A " }),
20168
- /* @__PURE__ */ jsx24(
20233
+ /* @__PURE__ */ jsxs23(Box23, { marginTop: 1, children: [
20234
+ /* @__PURE__ */ jsx25(Text24, { color: theme.prompt ?? theme.accent, children: "\u203A " }),
20235
+ /* @__PURE__ */ jsx25(
20169
20236
  CustomTextInput,
20170
20237
  {
20171
20238
  value: input,
@@ -20222,7 +20289,7 @@ ${lines.join("\n")}` }]);
20222
20289
  }
20223
20290
  async function renderApp(cfg, updateResult, lspScope = "global", lspProjectPath = null, cloudToken, cloudDeviceId) {
20224
20291
  const instance = render(
20225
- /* @__PURE__ */ jsx24(
20292
+ /* @__PURE__ */ jsx25(
20226
20293
  App,
20227
20294
  {
20228
20295
  initialCfg: cfg,