deepcode-ai 1.2.20 → 1.2.22

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.20".length > 0 ? "1.2.20" : "0.0.0-dev";
11512
+ var VERSION = "1.2.22".length > 0 ? "1.2.22" : "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
  ] }),
@@ -29356,7 +29355,7 @@ var exportCommand = {
29356
29355
  })
29357
29356
  })),
29358
29357
  action: async (context, args) => {
29359
- const fmt2 = args?.trim() ?? "markdown";
29358
+ const fmt2 = args?.trim() || "markdown";
29360
29359
  if (!EXPORT_FORMATS.includes(fmt2)) {
29361
29360
  return {
29362
29361
  type: "message",
@@ -30266,7 +30265,7 @@ var ProviderDialog = ({
30266
30265
  children: [
30267
30266
  /* @__PURE__ */ jsxs49(Box45, { marginBottom: 1, gap: 1, children: [
30268
30267
  /* @__PURE__ */ jsx55(Text53, { bold: true, color: theme.text.accent, children: "Providers" }),
30269
- phase !== "providers" && /* @__PURE__ */ jsxs49(Fragment12, { children: [
30268
+ phase !== "providers" && /* @__PURE__ */ jsxs49(Fragment11, { children: [
30270
30269
  /* @__PURE__ */ jsx55(Text53, { color: theme.text.secondary, children: "\u203A" }),
30271
30270
  /* @__PURE__ */ jsx55(Text53, { bold: true, color: theme.text.primary, children: selectedProvider })
30272
30271
  ] }),
@@ -30295,7 +30294,7 @@ var ProviderDialog = ({
30295
30294
  }
30296
30295
  }
30297
30296
  ),
30298
- phase === "actions" && /* @__PURE__ */ jsxs49(Fragment12, { children: [
30297
+ phase === "actions" && /* @__PURE__ */ jsxs49(Fragment11, { children: [
30299
30298
  /* @__PURE__ */ jsxs49(Box45, { marginBottom: 1, gap: 1, children: [
30300
30299
  /* @__PURE__ */ jsx55(Text53, { color: theme.ui.comment, children: "session" }),
30301
30300
  /* @__PURE__ */ jsx55(Text53, { color: selectedProvider === currentProvider ? theme.text.accent : theme.text.secondary, children: selectedProvider === currentProvider ? "active" : `still using ${currentProvider}` })
@@ -30828,12 +30827,19 @@ var ModelDialog = ({
30828
30827
  }),
30829
30828
  canScrollDown && /* @__PURE__ */ jsx58(Text56, { color: theme.ui.comment, dimColor: true, children: " \u2193" })
30830
30829
  ] }),
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
- ] }) }),
30830
+ loadState === "ready" && /* @__PURE__ */ jsxs52(Box48, { marginTop: 1, justifyContent: "space-between", children: [
30831
+ /* @__PURE__ */ jsxs52(Text56, { color: theme.ui.comment, dimColor: true, children: [
30832
+ selectableCount,
30833
+ " model",
30834
+ selectableCount !== 1 ? "s" : "",
30835
+ search ? ` \xB7 "${search}"` : ""
30836
+ ] }),
30837
+ selectableCount > MAX_VISIBLE && /* @__PURE__ */ jsxs52(Text56, { color: theme.ui.comment, dimColor: true, children: [
30838
+ clampedIndex + 1,
30839
+ "/",
30840
+ selectableCount
30841
+ ] })
30842
+ ] }),
30837
30843
  /* @__PURE__ */ jsx58(
30838
30844
  Box48,
30839
30845
  {
@@ -31082,12 +31088,19 @@ var SessionsDialog = ({ cwd, onSelect, onClose }) => {
31082
31088
  ] }, session.id);
31083
31089
  }),
31084
31090
  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
- ] }) })
31091
+ /* @__PURE__ */ jsxs54(Box50, { marginTop: 1, justifyContent: "space-between", children: [
31092
+ /* @__PURE__ */ jsxs54(Text58, { color: theme.ui.comment, dimColor: true, children: [
31093
+ sessions.length,
31094
+ " session",
31095
+ sessions.length !== 1 ? "s" : "",
31096
+ search ? ` \xB7 "${search}"` : ""
31097
+ ] }),
31098
+ sessions.length > MAX_VISIBLE2 && /* @__PURE__ */ jsxs54(Text58, { color: theme.ui.comment, dimColor: true, children: [
31099
+ clampedIndex + 1,
31100
+ "/",
31101
+ sessions.length
31102
+ ] })
31103
+ ] })
31091
31104
  ] }),
31092
31105
  /* @__PURE__ */ jsx60(
31093
31106
  Box50,
@@ -33242,17 +33255,24 @@ function formatAuthSummary(config) {
33242
33255
  const enterprise = config.enterpriseUrl?.trim() ? `enterprise=${config.enterpriseUrl}` : "enterprise=github.com";
33243
33256
  return `github token=${tokenState}, ${oauthState}, ${enterprise}`;
33244
33257
  }
33245
- var APPROVAL_PREVIEW_MAX_LINES = 6;
33258
+ var APPROVAL_PREVIEW_MAX_LINES = 4;
33246
33259
  var ApprovalPrompt = ({ request }) => {
33247
33260
  if (!request) return null;
33248
33261
  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);
33262
+ const hasDiff = !!(request.diff?.before && request.diff?.after);
33263
+ let beforeLines = [];
33264
+ let afterLines = [];
33265
+ let singleLines = [];
33266
+ let truncated = false;
33267
+ if (hasDiff) {
33268
+ beforeLines = request.diff.before.split("\n").slice(0, APPROVAL_PREVIEW_MAX_LINES);
33269
+ afterLines = request.diff.after.split("\n").slice(0, APPROVAL_PREVIEW_MAX_LINES);
33270
+ truncated = request.diff.before.split("\n").length > APPROVAL_PREVIEW_MAX_LINES || request.diff.after.split("\n").length > APPROVAL_PREVIEW_MAX_LINES;
33271
+ } else {
33272
+ const raw = request.diff?.after ?? request.preview?.content ?? "";
33273
+ singleLines = raw.split("\n").slice(0, APPROVAL_PREVIEW_MAX_LINES);
33274
+ truncated = raw.split("\n").length > APPROVAL_PREVIEW_MAX_LINES;
33254
33275
  }
33255
- const previewTruncated = (request.diff?.after ?? request.preview?.content ?? "").split("\n").length > APPROVAL_PREVIEW_MAX_LINES;
33256
33276
  return /* @__PURE__ */ jsxs56(
33257
33277
  Box52,
33258
33278
  {
@@ -33274,9 +33294,22 @@ var ApprovalPrompt = ({ request }) => {
33274
33294
  request.preview.command,
33275
33295
  request.preview.args?.length ? ` ${request.preview.args.join(" ")}` : ""
33276
33296
  ] }),
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" })
33297
+ hasDiff && /* @__PURE__ */ jsxs56(Box52, { flexDirection: "column", marginTop: 1, children: [
33298
+ /* @__PURE__ */ jsx62(Text60, { color: theme.status.error, dimColor: true, children: "\u2500\u2500 antes" }),
33299
+ beforeLines.map((line, i) => /* @__PURE__ */ jsxs56(Text60, { color: theme.status.error, dimColor: true, wrap: "truncate", children: [
33300
+ "\u2212 ",
33301
+ line
33302
+ ] }, `b${i}`)),
33303
+ /* @__PURE__ */ jsx62(Text60, { color: theme.status.success, dimColor: true, children: "\u2500\u2500 depois" }),
33304
+ afterLines.map((line, i) => /* @__PURE__ */ jsxs56(Text60, { color: theme.status.success, dimColor: true, wrap: "truncate", children: [
33305
+ "+ ",
33306
+ line
33307
+ ] }, `a${i}`)),
33308
+ truncated && /* @__PURE__ */ jsx62(Text60, { color: theme.ui.comment, dimColor: true, children: "\u2026" })
33309
+ ] }),
33310
+ !hasDiff && singleLines.length > 0 && /* @__PURE__ */ jsxs56(Box52, { flexDirection: "column", marginTop: 1, children: [
33311
+ singleLines.map((line, i) => /* @__PURE__ */ jsx62(Text60, { color: theme.ui.comment, dimColor: true, wrap: "truncate", children: line }, i)),
33312
+ truncated && /* @__PURE__ */ jsx62(Text60, { color: theme.ui.comment, dimColor: true, children: "\u2026" })
33280
33313
  ] }),
33281
33314
  /* @__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
33315
  ]