deepcode-ai 1.2.21 → 1.2.23

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
@@ -9788,7 +9788,7 @@ import { jsx as jsx28, jsxs as jsxs22 } from "react/jsx-runtime";
9788
9788
  import { Box as Box24, Text as Text27 } from "ink";
9789
9789
  import { Fragment as Fragment7, jsx as jsx29, jsxs as jsxs23 } from "react/jsx-runtime";
9790
9790
  import { Box as Box25, Text as Text28 } from "ink";
9791
- import { Fragment as Fragment8, jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
9791
+ import { jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
9792
9792
  import React23 from "react";
9793
9793
  import { Box as Box26, Text as Text29 } from "ink";
9794
9794
  import { useEffect as useEffect14, useState as useState12 } from "react";
@@ -9835,10 +9835,10 @@ import { useCallback as useCallback16 } from "react";
9835
9835
  import { Box as Box34, Text as Text37 } from "ink";
9836
9836
  import chalk2 from "chalk";
9837
9837
  import { jsx as jsx40, jsxs as jsxs33 } from "react/jsx-runtime";
9838
- import { Fragment as Fragment9, jsx as jsx41, jsxs as jsxs34 } from "react/jsx-runtime";
9838
+ import { Fragment as Fragment8, jsx as jsx41, jsxs as jsxs34 } from "react/jsx-runtime";
9839
9839
  import { Box as Box36, Text as Text44 } from "ink";
9840
9840
  import { Text as Text39 } from "ink";
9841
- import { Fragment as Fragment10, jsx as jsx42, jsxs as jsxs35 } from "react/jsx-runtime";
9841
+ import { Fragment as Fragment9, jsx as jsx42, jsxs as jsxs35 } from "react/jsx-runtime";
9842
9842
  import { Text as Text40 } from "ink";
9843
9843
  import { jsx as jsx43, jsxs as jsxs36 } from "react/jsx-runtime";
9844
9844
  import { Text as Text41 } from "ink";
@@ -9872,7 +9872,7 @@ import { execFile as execFile22 } from "child_process";
9872
9872
  import fs7 from "fs";
9873
9873
  import fsPromises from "fs/promises";
9874
9874
  import path142 from "path";
9875
- import { Fragment as Fragment11, jsx as jsx51, jsxs as jsxs45 } from "react/jsx-runtime";
9875
+ import { Fragment as Fragment10, jsx as jsx51, jsxs as jsxs45 } from "react/jsx-runtime";
9876
9876
  import { memo, useMemo as useMemo12 } from "react";
9877
9877
  import { Box as Box42, Text as Text50 } from "ink";
9878
9878
  import { jsx as jsx52, jsxs as jsxs46 } from "react/jsx-runtime";
@@ -9895,7 +9895,7 @@ import { Box as Box44, Text as Text52 } from "ink";
9895
9895
  import { jsx as jsx54, jsxs as jsxs48 } from "react/jsx-runtime";
9896
9896
  import { useCallback as useCallback22, useMemo as useMemo14, useState as useState28 } from "react";
9897
9897
  import { Box as Box45, Text as Text53, useInput as useInput3 } from "ink";
9898
- import { Fragment as Fragment12, jsx as jsx55, jsxs as jsxs49 } from "react/jsx-runtime";
9898
+ import { Fragment as Fragment11, jsx as jsx55, jsxs as jsxs49 } from "react/jsx-runtime";
9899
9899
  import { useCallback as useCallback23, useState as useState29 } from "react";
9900
9900
  import { Box as Box46, Text as Text54 } from "ink";
9901
9901
  import { jsx as jsx56, jsxs as jsxs50 } from "react/jsx-runtime";
@@ -11509,7 +11509,7 @@ function parseVersion(version) {
11509
11509
  if (!match) return null;
11510
11510
  return [Number(match[1]), Number(match[2]), Number(match[3])];
11511
11511
  }
11512
- var VERSION = "1.2.21".length > 0 ? "1.2.21" : "0.0.0-dev";
11512
+ var VERSION = "1.2.23".length > 0 ? "1.2.23" : "0.0.0-dev";
11513
11513
  async function updateCommand() {
11514
11514
  writeStdoutLine(`Current version: ${VERSION}`);
11515
11515
  const update = await checkForUpdate(VERSION, { force: true });
@@ -24347,45 +24347,44 @@ function groupByCategory(checks) {
24347
24347
  var DoctorReport = ({ checks, summary }) => {
24348
24348
  const groups = groupByCategory(checks);
24349
24349
  const hasIssues = summary.fail > 0 || summary.warn > 0;
24350
+ const actionable = checks.filter(
24351
+ (c) => (c.status === "fail" || c.status === "warn") && c.detail
24352
+ );
24350
24353
  return /* @__PURE__ */ jsxs24(Box25, { flexDirection: "column", marginLeft: 2, children: [
24351
24354
  /* @__PURE__ */ jsx30(Text28, { color: theme.text.secondary, bold: true, children: "DeepCode Doctor" }),
24352
24355
  Array.from(groups.entries()).map(([category, items]) => /* @__PURE__ */ jsxs24(Box25, { flexDirection: "column", marginTop: 1, children: [
24353
- /* @__PURE__ */ jsx30(Text28, { color: theme.text.secondary, dimColor: true, children: category }),
24354
- items.map((check2) => /* @__PURE__ */ jsxs24(Box25, { flexDirection: "column", children: [
24355
- /* @__PURE__ */ jsxs24(Box25, { flexDirection: "row", children: [
24356
- /* @__PURE__ */ jsx30(Box25, { width: 2, children: /* @__PURE__ */ jsx30(Text28, { color: STATUS_COLORS[check2.status], children: STATUS_ICONS2[check2.status] }) }),
24357
- /* @__PURE__ */ jsxs24(Text28, { children: [
24358
- check2.name,
24359
- ": ",
24360
- /* @__PURE__ */ jsx30(Text28, { color: STATUS_COLORS[check2.status], children: check2.message })
24361
- ] })
24362
- ] }),
24363
- check2.detail && /* @__PURE__ */ jsx30(Box25, { marginLeft: 2, children: /* @__PURE__ */ jsx30(Text28, { color: theme.text.secondary, dimColor: true, children: check2.detail }) })
24356
+ /* @__PURE__ */ jsx30(Text28, { color: theme.text.accent, bold: true, children: category }),
24357
+ items.map((check2) => /* @__PURE__ */ jsxs24(Box25, { flexDirection: "row", gap: 1, children: [
24358
+ /* @__PURE__ */ jsx30(Text28, { color: STATUS_COLORS[check2.status], children: STATUS_ICONS2[check2.status] }),
24359
+ /* @__PURE__ */ jsx30(Text28, { color: check2.status === "pass" ? theme.text.secondary : theme.text.primary, children: check2.name }),
24360
+ /* @__PURE__ */ jsx30(Text28, { color: STATUS_COLORS[check2.status], dimColor: check2.status === "pass", children: check2.message })
24364
24361
  ] }, check2.name))
24365
24362
  ] }, category)),
24366
- /* @__PURE__ */ jsxs24(Box25, { marginTop: 1, flexDirection: "row", children: [
24363
+ actionable.length > 0 && /* @__PURE__ */ jsxs24(Box25, { flexDirection: "column", marginTop: 1, children: [
24364
+ /* @__PURE__ */ jsx30(Text28, { color: theme.text.secondary, dimColor: true, children: "Recomenda\xE7\xF5es" }),
24365
+ actionable.map((check2) => /* @__PURE__ */ jsxs24(Box25, { flexDirection: "row", gap: 1, marginLeft: 1, children: [
24366
+ /* @__PURE__ */ jsx30(Text28, { color: STATUS_COLORS[check2.status], children: "\u2192" }),
24367
+ /* @__PURE__ */ jsxs24(Text28, { color: theme.text.secondary, dimColor: true, wrap: "wrap", children: [
24368
+ check2.name,
24369
+ ": ",
24370
+ check2.detail
24371
+ ] })
24372
+ ] }, check2.name))
24373
+ ] }),
24374
+ /* @__PURE__ */ jsxs24(Box25, { marginTop: 1, flexDirection: "row", gap: 2, children: [
24367
24375
  /* @__PURE__ */ jsxs24(Text28, { color: theme.status.success, children: [
24368
24376
  "\u2713 ",
24369
- summary.pass,
24370
- " pass"
24377
+ summary.pass
24371
24378
  ] }),
24372
- summary.warn > 0 && /* @__PURE__ */ jsxs24(Fragment8, { children: [
24373
- /* @__PURE__ */ jsx30(Text28, { children: " " }),
24374
- /* @__PURE__ */ jsxs24(Text28, { color: theme.status.warning, children: [
24375
- "\u26A0 ",
24376
- summary.warn,
24377
- " warn"
24378
- ] })
24379
+ summary.warn > 0 && /* @__PURE__ */ jsxs24(Text28, { color: theme.status.warning, children: [
24380
+ "\u26A0 ",
24381
+ summary.warn
24379
24382
  ] }),
24380
- summary.fail > 0 && /* @__PURE__ */ jsxs24(Fragment8, { children: [
24381
- /* @__PURE__ */ jsx30(Text28, { children: " " }),
24382
- /* @__PURE__ */ jsxs24(Text28, { color: theme.status.error, children: [
24383
- "\u2717 ",
24384
- summary.fail,
24385
- " fail"
24386
- ] })
24383
+ summary.fail > 0 && /* @__PURE__ */ jsxs24(Text28, { color: theme.status.error, children: [
24384
+ "\u2717 ",
24385
+ summary.fail
24387
24386
  ] }),
24388
- !hasIssues && /* @__PURE__ */ jsx30(Text28, { color: theme.text.secondary, children: " \u2014 all checks passed" })
24387
+ !hasIssues && /* @__PURE__ */ jsx30(Text28, { color: theme.text.secondary, dimColor: true, children: "tudo ok" })
24389
24388
  ] })
24390
24389
  ] });
24391
24390
  };
@@ -28186,7 +28185,7 @@ ${currentText}`);
28186
28185
  ]
28187
28186
  }
28188
28187
  );
28189
- return /* @__PURE__ */ jsxs34(Fragment9, { children: [
28188
+ return /* @__PURE__ */ jsxs34(Fragment8, { children: [
28190
28189
  attachments.length > 0 && /* @__PURE__ */ jsxs34(Box35, { marginLeft: 2, marginBottom: 0, children: [
28191
28190
  /* @__PURE__ */ jsx41(Text38, { color: theme.text.secondary, children: t("Attachments: ") }),
28192
28191
  attachments.map((att, idx) => /* @__PURE__ */ jsxs34(
@@ -28253,7 +28252,7 @@ var ContextUsageDisplay = ({
28253
28252
  const isOverLimit = percentage > 1;
28254
28253
  const label = terminalWidth < 100 ? t("% used") : t("% context used");
28255
28254
  if (isOverLimit) {
28256
- return /* @__PURE__ */ jsx42(Fragment10, { children: /* @__PURE__ */ jsxs35(Text39, { color: theme.status.error, children: [
28255
+ return /* @__PURE__ */ jsx42(Fragment9, { children: /* @__PURE__ */ jsxs35(Text39, { color: theme.status.error, children: [
28257
28256
  percentageUsed,
28258
28257
  label
28259
28258
  ] }) });
@@ -28752,7 +28751,7 @@ var AppHeader = ({
28752
28751
  /* @__PURE__ */ jsxs45(Box41, { flexDirection: "row", flexWrap: "nowrap", width: terminalWidth - 4, children: [
28753
28752
  /* @__PURE__ */ jsx51(Text49, { bold: true, color: theme.text.accent, children: "DeepCode" }),
28754
28753
  /* @__PURE__ */ jsx51(Text49, { color: theme.text.secondary, children: ` v${version}` }),
28755
- providerLabel && /* @__PURE__ */ jsxs45(Fragment11, { children: [
28754
+ providerLabel && /* @__PURE__ */ jsxs45(Fragment10, { children: [
28756
28755
  /* @__PURE__ */ jsx51(Text49, { color: theme.text.secondary, children: " " }),
28757
28756
  /* @__PURE__ */ jsx51(Text49, { color: theme.text.primary, children: providerLabel })
28758
28757
  ] }),
@@ -29852,11 +29851,15 @@ var renameCommand = {
29852
29851
  content: t("Usage: /rename <session name>")
29853
29852
  };
29854
29853
  }
29855
- session.setName(name);
29854
+ if (context.ui.renameSession) {
29855
+ context.ui.renameSession(name);
29856
+ } else {
29857
+ session.setName(name);
29858
+ }
29856
29859
  return {
29857
29860
  type: "message",
29858
29861
  messageType: "info",
29859
- content: `Session renamed to "${name}".`
29862
+ content: `Sess\xE3o renomeada para "${name}".`
29860
29863
  };
29861
29864
  }
29862
29865
  };
@@ -30022,7 +30025,7 @@ var ThemeDialog = ({ onSelect, onClose, onPreview }) => {
30022
30025
  isFocused: true
30023
30026
  }
30024
30027
  ),
30025
- /* @__PURE__ */ jsx54(Text52, { color: theme.text.secondary, children: "\u2191\u2193 navigate \xB7 Enter apply \xB7 Esc cancel" })
30028
+ /* @__PURE__ */ jsx54(Text52, { color: theme.text.secondary, children: "\u2191\u2193 navegar \xB7 Enter aplicar \xB7 Esc cancelar" })
30026
30029
  ]
30027
30030
  }
30028
30031
  );
@@ -30266,7 +30269,7 @@ var ProviderDialog = ({
30266
30269
  children: [
30267
30270
  /* @__PURE__ */ jsxs49(Box45, { marginBottom: 1, gap: 1, children: [
30268
30271
  /* @__PURE__ */ jsx55(Text53, { bold: true, color: theme.text.accent, children: "Providers" }),
30269
- phase !== "providers" && /* @__PURE__ */ jsxs49(Fragment12, { children: [
30272
+ phase !== "providers" && /* @__PURE__ */ jsxs49(Fragment11, { children: [
30270
30273
  /* @__PURE__ */ jsx55(Text53, { color: theme.text.secondary, children: "\u203A" }),
30271
30274
  /* @__PURE__ */ jsx55(Text53, { bold: true, color: theme.text.primary, children: selectedProvider })
30272
30275
  ] }),
@@ -30295,7 +30298,7 @@ var ProviderDialog = ({
30295
30298
  }
30296
30299
  }
30297
30300
  ),
30298
- phase === "actions" && /* @__PURE__ */ jsxs49(Fragment12, { children: [
30301
+ phase === "actions" && /* @__PURE__ */ jsxs49(Fragment11, { children: [
30299
30302
  /* @__PURE__ */ jsxs49(Box45, { marginBottom: 1, gap: 1, children: [
30300
30303
  /* @__PURE__ */ jsx55(Text53, { color: theme.ui.comment, children: "session" }),
30301
30304
  /* @__PURE__ */ jsx55(Text53, { color: selectedProvider === currentProvider ? theme.text.accent : theme.text.secondary, children: selectedProvider === currentProvider ? "active" : `still using ${currentProvider}` })
@@ -30436,7 +30439,7 @@ var PermissionsDialog = ({
30436
30439
  marginLeft: 2,
30437
30440
  marginRight: 2,
30438
30441
  children: [
30439
- /* @__PURE__ */ jsx56(Text54, { bold: true, color: theme.text.accent, children: "Permission policy" }),
30442
+ /* @__PURE__ */ jsx56(Text54, { bold: true, color: theme.text.accent, children: "Permiss\xF5es" }),
30440
30443
  PERMISSION_KEYS.map((key, i) => {
30441
30444
  const focused = focusIndex === i;
30442
30445
  const mode = modes[key];
@@ -30448,13 +30451,13 @@ var PermissionsDialog = ({
30448
30451
  }),
30449
30452
  /* @__PURE__ */ jsx56(Box46, { marginTop: 1, flexDirection: "column", children: ACTIONS3.map((action, i) => {
30450
30453
  const focused = focusIndex === PERMISSION_KEYS.length + i;
30451
- const label = action === "save" ? dirty ? "Save changes" : "Save changes (no edits)" : "Cancel";
30454
+ const label = action === "save" ? dirty ? "Salvar" : "Salvar (sem edi\xE7\xF5es)" : "Cancelar";
30452
30455
  return /* @__PURE__ */ jsxs50(Box46, { flexDirection: "row", gap: 1, children: [
30453
30456
  /* @__PURE__ */ jsx56(Text54, { color: focused ? theme.text.accent : theme.text.secondary, children: focused ? "\u203A" : " " }),
30454
30457
  /* @__PURE__ */ jsx56(Text54, { color: focused ? theme.text.primary : theme.text.secondary, bold: focused, children: label })
30455
30458
  ] }, action);
30456
30459
  }) }),
30457
- /* @__PURE__ */ jsx56(Text54, { color: theme.text.secondary, dimColor: true, children: "\u2191\u2193 navigate \xB7 Enter cycles allow/ask/deny or selects action \xB7 Esc cancel" })
30460
+ /* @__PURE__ */ jsx56(Text54, { color: theme.text.secondary, dimColor: true, children: "\u2191\u2193 navegar \xB7 Enter cicla allow/ask/deny ou confirma \xB7 Esc cancelar" })
30458
30461
  ]
30459
30462
  }
30460
30463
  );
@@ -30632,7 +30635,7 @@ function buildRows(models, currentId, search) {
30632
30635
  if (!search && currentId) {
30633
30636
  const recent = filtered.find((m) => m.id === currentId);
30634
30637
  if (recent) {
30635
- rows.push({ kind: "header", label: "Recent" });
30638
+ rows.push({ kind: "header", label: "Recente" });
30636
30639
  rows.push({ kind: "item", model: recent, selIndex: selIndex++ });
30637
30640
  }
30638
30641
  }
@@ -30751,8 +30754,8 @@ var ModelDialog = ({
30751
30754
  children: [
30752
30755
  /* @__PURE__ */ jsxs52(Box48, { justifyContent: "space-between", marginBottom: 1, children: [
30753
30756
  /* @__PURE__ */ jsxs52(Box48, { gap: 1, children: [
30754
- /* @__PURE__ */ jsx58(Text56, { bold: true, color: theme.text.primary, children: "Select model" }),
30755
- /* @__PURE__ */ jsx58(Text56, { color: theme.text.secondary, children: "for" }),
30757
+ /* @__PURE__ */ jsx58(Text56, { bold: true, color: theme.text.primary, children: "Selecionar modelo" }),
30758
+ /* @__PURE__ */ jsx58(Text56, { color: theme.text.secondary, children: "para" }),
30756
30759
  /* @__PURE__ */ jsx58(Text56, { color: theme.text.accent, children: currentProvider })
30757
30760
  ] }),
30758
30761
  /* @__PURE__ */ jsx58(Text56, { color: theme.ui.comment, dimColor: true, children: "esc" })
@@ -30776,13 +30779,13 @@ var ModelDialog = ({
30776
30779
  ]
30777
30780
  }
30778
30781
  ),
30779
- loadState === "loading" && /* @__PURE__ */ jsx58(Box48, { marginY: 1, children: /* @__PURE__ */ jsx58(Text56, { color: theme.text.secondary, children: "Loading models\u2026" }) }),
30782
+ loadState === "loading" && /* @__PURE__ */ jsx58(Box48, { marginY: 1, children: /* @__PURE__ */ jsx58(Text56, { color: theme.text.secondary, children: "Carregando modelos\u2026" }) }),
30780
30783
  loadState === "error" && /* @__PURE__ */ jsxs52(Box48, { flexDirection: "column", marginY: 1, children: [
30781
- /* @__PURE__ */ jsx58(Text56, { color: theme.status.error, children: "\u2717 Could not load models" }),
30784
+ /* @__PURE__ */ jsx58(Text56, { color: theme.status.error, children: "\u2717 N\xE3o foi poss\xEDvel carregar modelos" }),
30782
30785
  /* @__PURE__ */ jsx58(Text56, { color: theme.ui.comment, dimColor: true, children: errorMsg })
30783
30786
  ] }),
30784
30787
  loadState === "ready" && selectableCount === 0 && /* @__PURE__ */ jsx58(Box48, { marginY: 1, children: /* @__PURE__ */ jsxs52(Text56, { color: theme.ui.comment, dimColor: true, children: [
30785
- 'No models match "',
30788
+ 'Nenhum modelo para "',
30786
30789
  search,
30787
30790
  '"'
30788
30791
  ] }) }),
@@ -30828,12 +30831,19 @@ var ModelDialog = ({
30828
30831
  }),
30829
30832
  canScrollDown && /* @__PURE__ */ jsx58(Text56, { color: theme.ui.comment, dimColor: true, children: " \u2193" })
30830
30833
  ] }),
30831
- loadState === "ready" && /* @__PURE__ */ jsx58(Box48, { marginTop: 1, children: /* @__PURE__ */ jsxs52(Text56, { color: theme.ui.comment, dimColor: true, children: [
30832
- selectableCount,
30833
- " model",
30834
- selectableCount !== 1 ? "s" : "",
30835
- search ? ` \xB7 "${search}"` : ""
30836
- ] }) }),
30834
+ loadState === "ready" && /* @__PURE__ */ jsxs52(Box48, { marginTop: 1, justifyContent: "space-between", children: [
30835
+ /* @__PURE__ */ jsxs52(Text56, { color: theme.ui.comment, dimColor: true, children: [
30836
+ selectableCount,
30837
+ " model",
30838
+ selectableCount !== 1 ? "s" : "",
30839
+ search ? ` \xB7 "${search}"` : ""
30840
+ ] }),
30841
+ selectableCount > MAX_VISIBLE && /* @__PURE__ */ jsxs52(Text56, { color: theme.ui.comment, dimColor: true, children: [
30842
+ clampedIndex + 1,
30843
+ "/",
30844
+ selectableCount
30845
+ ] })
30846
+ ] }),
30837
30847
  /* @__PURE__ */ jsx58(
30838
30848
  Box48,
30839
30849
  {
@@ -30844,7 +30854,7 @@ var ModelDialog = ({
30844
30854
  borderLeft: false,
30845
30855
  borderRight: false,
30846
30856
  borderColor: theme.ui.comment,
30847
- children: /* @__PURE__ */ jsx58(Text56, { color: theme.ui.comment, dimColor: true, children: "\u2191\u2193 navigate type to search Enter use for session Esc close" })
30857
+ children: /* @__PURE__ */ jsx58(Text56, { color: theme.ui.comment, dimColor: true, children: "\u2191\u2193 navegar digitar para buscar Enter usar Esc fechar" })
30848
30858
  }
30849
30859
  )
30850
30860
  ]
@@ -31022,7 +31032,7 @@ var SessionsDialog = ({ cwd, onSelect, onClose }) => {
31022
31032
  minWidth: 60,
31023
31033
  children: [
31024
31034
  /* @__PURE__ */ jsxs54(Box50, { justifyContent: "space-between", marginBottom: 1, children: [
31025
- /* @__PURE__ */ jsx60(Text58, { bold: true, color: theme.text.primary, children: "Resume session" }),
31035
+ /* @__PURE__ */ jsx60(Text58, { bold: true, color: theme.text.primary, children: "Retomar sess\xE3o" }),
31026
31036
  /* @__PURE__ */ jsx60(Text58, { color: theme.ui.comment, dimColor: true, children: "esc" })
31027
31037
  ] }),
31028
31038
  /* @__PURE__ */ jsxs54(
@@ -31044,9 +31054,9 @@ var SessionsDialog = ({ cwd, onSelect, onClose }) => {
31044
31054
  ]
31045
31055
  }
31046
31056
  ),
31047
- loadState === "loading" && /* @__PURE__ */ jsx60(Box50, { marginY: 1, children: /* @__PURE__ */ jsx60(Text58, { color: theme.text.secondary, children: "Loading sessions\u2026" }) }),
31048
- loadState === "error" && /* @__PURE__ */ jsx60(Box50, { marginY: 1, children: /* @__PURE__ */ jsx60(Text58, { color: theme.status.error, children: "\u2717 Could not load sessions" }) }),
31049
- loadState === "ready" && sessions.length === 0 && /* @__PURE__ */ jsx60(Box50, { marginY: 1, children: /* @__PURE__ */ jsx60(Text58, { color: theme.ui.comment, dimColor: true, children: search ? `No sessions match "${search}"` : "No sessions found in .deepcode/sessions/" }) }),
31057
+ loadState === "loading" && /* @__PURE__ */ jsx60(Box50, { marginY: 1, children: /* @__PURE__ */ jsx60(Text58, { color: theme.text.secondary, children: "Carregando sess\xF5es\u2026" }) }),
31058
+ loadState === "error" && /* @__PURE__ */ jsx60(Box50, { marginY: 1, children: /* @__PURE__ */ jsx60(Text58, { color: theme.status.error, children: "\u2717 N\xE3o foi poss\xEDvel carregar sess\xF5es" }) }),
31059
+ loadState === "ready" && sessions.length === 0 && /* @__PURE__ */ jsx60(Box50, { marginY: 1, children: /* @__PURE__ */ jsx60(Text58, { color: theme.ui.comment, dimColor: true, children: search ? `Nenhuma sess\xE3o para "${search}"` : "Nenhuma sess\xE3o em .deepcode/sessions/" }) }),
31050
31060
  loadState === "ready" && sessions.length > 0 && /* @__PURE__ */ jsxs54(Box50, { flexDirection: "column", children: [
31051
31061
  canScrollUp && /* @__PURE__ */ jsx60(Text58, { color: theme.ui.comment, dimColor: true, children: " \u2191" }),
31052
31062
  visibleSessions.map((session, visIdx) => {
@@ -31082,12 +31092,19 @@ var SessionsDialog = ({ cwd, onSelect, onClose }) => {
31082
31092
  ] }, session.id);
31083
31093
  }),
31084
31094
  canScrollDown && /* @__PURE__ */ jsx60(Text58, { color: theme.ui.comment, dimColor: true, children: " \u2193" }),
31085
- /* @__PURE__ */ jsx60(Box50, { marginTop: 1, children: /* @__PURE__ */ jsxs54(Text58, { color: theme.ui.comment, dimColor: true, children: [
31086
- sessions.length,
31087
- " session",
31088
- sessions.length !== 1 ? "s" : "",
31089
- search ? ` \xB7 "${search}"` : ""
31090
- ] }) })
31095
+ /* @__PURE__ */ jsxs54(Box50, { marginTop: 1, justifyContent: "space-between", children: [
31096
+ /* @__PURE__ */ jsxs54(Text58, { color: theme.ui.comment, dimColor: true, children: [
31097
+ sessions.length,
31098
+ " session",
31099
+ sessions.length !== 1 ? "s" : "",
31100
+ search ? ` \xB7 "${search}"` : ""
31101
+ ] }),
31102
+ sessions.length > MAX_VISIBLE2 && /* @__PURE__ */ jsxs54(Text58, { color: theme.ui.comment, dimColor: true, children: [
31103
+ clampedIndex + 1,
31104
+ "/",
31105
+ sessions.length
31106
+ ] })
31107
+ ] })
31091
31108
  ] }),
31092
31109
  /* @__PURE__ */ jsx60(
31093
31110
  Box50,
@@ -31099,7 +31116,7 @@ var SessionsDialog = ({ cwd, onSelect, onClose }) => {
31099
31116
  borderLeft: false,
31100
31117
  borderRight: false,
31101
31118
  borderColor: theme.ui.comment,
31102
- children: /* @__PURE__ */ jsx60(Text58, { color: theme.ui.comment, dimColor: true, children: "\u2191\u2193 navigate type to search Enter resume Esc close" })
31119
+ children: /* @__PURE__ */ jsx60(Text58, { color: theme.ui.comment, dimColor: true, children: "\u2191\u2193 navegar digitar para buscar Enter retomar Esc fechar" })
31103
31120
  }
31104
31121
  )
31105
31122
  ]
@@ -31738,13 +31755,17 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
31738
31755
  sessionStartedAt: sessionStartedAtRef.current
31739
31756
  }),
31740
31757
  setPermissions: (modes) => setPermissionModes((prev) => ({ ...prev, ...modes })),
31741
- newSession: handleNewSession
31758
+ newSession: handleNewSession,
31759
+ renameSession: (name) => {
31760
+ setSessionName(name);
31761
+ setSessionDisplayName(name.trim());
31762
+ }
31742
31763
  },
31743
31764
  session: {
31744
31765
  sessionShellAllowlist: sessionShellAllowlistRef.current
31745
31766
  }
31746
31767
  }),
31747
- [agentMode, configAdapter, cwd, handleCompact, handleNewSession, handleUndo, historyManager, lastOutputTokenCount, lastPromptTokenCount, mcpConnected, mcpTotal, pendingItem, sessionCommandServices, setPermissionModes]
31768
+ [agentMode, configAdapter, cwd, handleCompact, handleNewSession, handleUndo, historyManager, lastOutputTokenCount, lastPromptTokenCount, mcpConnected, mcpTotal, pendingItem, sessionCommandServices, setPermissionModes, setSessionDisplayName, setSessionName]
31748
31769
  );
31749
31770
  useEffect31(() => {
31750
31771
  messageQueueRef.current = messageQueue;
@@ -33005,7 +33026,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId, startupWarn
33005
33026
  ),
33006
33027
  /* @__PURE__ */ jsx62(ShowMoreLines, { constrainHeight })
33007
33028
  ] }),
33008
- approvalQueue.length > 0 && /* @__PURE__ */ jsx62(Box52, { marginLeft: 2, marginRight: 2, marginTop: 1, children: /* @__PURE__ */ jsx62(ApprovalPrompt, { request: approvalQueue[0] }) }),
33029
+ approvalQueue.length > 0 && /* @__PURE__ */ jsx62(Box52, { marginLeft: 2, marginRight: 2, marginTop: 1, children: /* @__PURE__ */ jsx62(ApprovalPrompt, { request: approvalQueue[0], queueLength: approvalQueue.length }) }),
33009
33030
  dialogModel && /* @__PURE__ */ jsx62(CommandDialog, { title: dialogModel.title, lines: dialogModel.lines }),
33010
33031
  activeDialog === "provider" && /* @__PURE__ */ jsx62(
33011
33032
  ProviderDialog,
@@ -33242,17 +33263,24 @@ function formatAuthSummary(config) {
33242
33263
  const enterprise = config.enterpriseUrl?.trim() ? `enterprise=${config.enterpriseUrl}` : "enterprise=github.com";
33243
33264
  return `github token=${tokenState}, ${oauthState}, ${enterprise}`;
33244
33265
  }
33245
- var APPROVAL_PREVIEW_MAX_LINES = 6;
33246
- var ApprovalPrompt = ({ request }) => {
33266
+ var APPROVAL_PREVIEW_MAX_LINES = 4;
33267
+ var ApprovalPrompt = ({ request, queueLength = 1 }) => {
33247
33268
  if (!request) return null;
33248
33269
  const operationLabel = formatApprovalOperationLabel(request);
33249
- let previewLines = [];
33250
- if (request.diff?.after) {
33251
- previewLines = request.diff.after.split("\n").slice(0, APPROVAL_PREVIEW_MAX_LINES);
33252
- } else if (request.preview?.content) {
33253
- previewLines = request.preview.content.split("\n").slice(0, APPROVAL_PREVIEW_MAX_LINES);
33270
+ const hasDiff = !!(request.diff?.before && request.diff?.after);
33271
+ let beforeLines = [];
33272
+ let afterLines = [];
33273
+ let singleLines = [];
33274
+ let truncated = false;
33275
+ if (hasDiff) {
33276
+ beforeLines = request.diff.before.split("\n").slice(0, APPROVAL_PREVIEW_MAX_LINES);
33277
+ afterLines = request.diff.after.split("\n").slice(0, APPROVAL_PREVIEW_MAX_LINES);
33278
+ truncated = request.diff.before.split("\n").length > APPROVAL_PREVIEW_MAX_LINES || request.diff.after.split("\n").length > APPROVAL_PREVIEW_MAX_LINES;
33279
+ } else {
33280
+ const raw = request.diff?.after ?? request.preview?.content ?? "";
33281
+ singleLines = raw.split("\n").slice(0, APPROVAL_PREVIEW_MAX_LINES);
33282
+ truncated = raw.split("\n").length > APPROVAL_PREVIEW_MAX_LINES;
33254
33283
  }
33255
- const previewTruncated = (request.diff?.after ?? request.preview?.content ?? "").split("\n").length > APPROVAL_PREVIEW_MAX_LINES;
33256
33284
  return /* @__PURE__ */ jsxs56(
33257
33285
  Box52,
33258
33286
  {
@@ -33266,7 +33294,8 @@ var ApprovalPrompt = ({ request }) => {
33266
33294
  children: [
33267
33295
  /* @__PURE__ */ jsxs56(Text60, { bold: true, color: theme.status.warning, children: [
33268
33296
  "\u26A0 ",
33269
- operationLabel
33297
+ operationLabel,
33298
+ queueLength > 1 && /* @__PURE__ */ jsx62(Text60, { color: theme.text.secondary, children: ` (1 de ${queueLength})` })
33270
33299
  ] }),
33271
33300
  request.path && /* @__PURE__ */ jsx62(Text60, { color: theme.text.secondary, children: request.path }),
33272
33301
  request.preview?.command && /* @__PURE__ */ jsxs56(Text60, { color: theme.text.primary, children: [
@@ -33274,9 +33303,22 @@ var ApprovalPrompt = ({ request }) => {
33274
33303
  request.preview.command,
33275
33304
  request.preview.args?.length ? ` ${request.preview.args.join(" ")}` : ""
33276
33305
  ] }),
33277
- previewLines.length > 0 && /* @__PURE__ */ jsxs56(Box52, { flexDirection: "column", marginTop: 1, children: [
33278
- previewLines.map((line, i) => /* @__PURE__ */ jsx62(Text60, { color: theme.ui.comment, dimColor: true, wrap: "truncate", children: line }, i)),
33279
- previewTruncated && /* @__PURE__ */ jsx62(Text60, { color: theme.ui.comment, dimColor: true, children: "\u2026" })
33306
+ hasDiff && /* @__PURE__ */ jsxs56(Box52, { flexDirection: "column", marginTop: 1, children: [
33307
+ /* @__PURE__ */ jsx62(Text60, { color: theme.status.error, dimColor: true, children: "\u2500\u2500 antes" }),
33308
+ beforeLines.map((line, i) => /* @__PURE__ */ jsxs56(Text60, { color: theme.status.error, dimColor: true, wrap: "truncate", children: [
33309
+ "\u2212 ",
33310
+ line
33311
+ ] }, `b${i}`)),
33312
+ /* @__PURE__ */ jsx62(Text60, { color: theme.status.success, dimColor: true, children: "\u2500\u2500 depois" }),
33313
+ afterLines.map((line, i) => /* @__PURE__ */ jsxs56(Text60, { color: theme.status.success, dimColor: true, wrap: "truncate", children: [
33314
+ "+ ",
33315
+ line
33316
+ ] }, `a${i}`)),
33317
+ truncated && /* @__PURE__ */ jsx62(Text60, { color: theme.ui.comment, dimColor: true, children: "\u2026" })
33318
+ ] }),
33319
+ !hasDiff && singleLines.length > 0 && /* @__PURE__ */ jsxs56(Box52, { flexDirection: "column", marginTop: 1, children: [
33320
+ singleLines.map((line, i) => /* @__PURE__ */ jsx62(Text60, { color: theme.ui.comment, dimColor: true, wrap: "truncate", children: line }, i)),
33321
+ truncated && /* @__PURE__ */ jsx62(Text60, { color: theme.ui.comment, dimColor: true, children: "\u2026" })
33280
33322
  ] }),
33281
33323
  /* @__PURE__ */ jsx62(Box52, { marginTop: 1, children: /* @__PURE__ */ jsx62(Text60, { color: theme.text.secondary, dimColor: true, children: "[\u21B5/y] uma vez [s] sess\xE3o [a] sempre [n/Esc] negar" }) })
33282
33324
  ]
@@ -33285,16 +33327,16 @@ var ApprovalPrompt = ({ request }) => {
33285
33327
  };
33286
33328
  function formatApprovalOperationLabel(request) {
33287
33329
  const labels = {
33288
- write_file: "write file",
33289
- edit_file: "edit file",
33290
- read_file: "read file",
33291
- bash: "run shell command",
33292
- shell: "run shell command",
33293
- git: "run git command",
33294
- fetch_web: "fetch URL",
33295
- search_text: "search files",
33296
- list_dir: "list directory",
33297
- analyze_code: "analyze code"
33330
+ write_file: "escrever arquivo",
33331
+ edit_file: "editar arquivo",
33332
+ read_file: "ler arquivo",
33333
+ bash: "executar comando shell",
33334
+ shell: "executar comando shell",
33335
+ git: "executar comando git",
33336
+ fetch_web: "acessar URL",
33337
+ search_text: "buscar em arquivos",
33338
+ list_dir: "listar diret\xF3rio",
33339
+ analyze_code: "analisar c\xF3digo"
33298
33340
  };
33299
33341
  return labels[request.operation] ?? request.operation.replace(/_/g, " ");
33300
33342
  }