@justmpm/ai-tool 3.18.0 → 3.19.0

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.
@@ -2346,10 +2346,22 @@ function formatDepsSearchText(result, ctx = "cli") {
2346
2346
  out += `
2347
2347
  `;
2348
2348
  }
2349
- const pluralTotal = result.summary.total !== 1 ? "s" : "";
2349
+ const shown = result.matches.length;
2350
+ const total = result.summary.total;
2351
+ const pluralTotal = total !== 1 ? "s" : "";
2350
2352
  const pluralFiles = result.summary.files !== 1 ? "s" : "";
2351
- out += `${result.summary.total} resultado${pluralTotal} em ${result.summary.files} arquivo${pluralFiles}
2353
+ if (shown < total) {
2354
+ out += `${shown} de ${total} resultado${pluralTotal} em ${result.summary.files} arquivo${pluralFiles}
2352
2355
  `;
2356
+ } else {
2357
+ out += `${total} resultado${pluralTotal} em ${result.summary.files} arquivo${pluralFiles}
2358
+ `;
2359
+ }
2360
+ if (total > 50) {
2361
+ out += `
2362
+ Muitos resultados encontrados. Refine a busca com termos mais especificos.
2363
+ `;
2364
+ }
2353
2365
  out += nextSteps("deps_search", ctx);
2354
2366
  return out;
2355
2367
  }
@@ -2687,12 +2699,16 @@ function expandMuiOverrideType(tsType, simplifiedText) {
2687
2699
  const typeMap = typeArgs[0];
2688
2700
  const propsProperty = typeMap.getProperty("props");
2689
2701
  if (propsProperty) {
2690
- const propsType = propsProperty.getType();
2691
- const props = propsType.getProperties();
2692
- if (props.length > 0) {
2693
- const propNames = props.slice(0, 12).map((p) => p.getName());
2694
- const suffix = props.length > 12 ? ", ..." : "";
2695
- return `{ ${propNames.join(", ")}${suffix} }`;
2702
+ const propsDecls = propsProperty.getDeclarations();
2703
+ const propsNode = propsDecls.length > 0 ? propsDecls[0] : void 0;
2704
+ if (propsNode) {
2705
+ const propsType = propsProperty.getTypeAtLocation(propsNode);
2706
+ const props = propsType.getProperties();
2707
+ if (props.length > 0) {
2708
+ const propNames = props.slice(0, 12).map((p) => p.getName());
2709
+ const suffix = props.length > 12 ? ", ..." : "";
2710
+ return `{ ${propNames.join(", ")}${suffix} }`;
2711
+ }
2696
2712
  }
2697
2713
  }
2698
2714
  }
@@ -20,7 +20,7 @@ import {
20
20
  readConfig,
21
21
  recoveryHint,
22
22
  simplifyType
23
- } from "./chunk-DBABYIEY.js";
23
+ } from "./chunk-GBNBYBLN.js";
24
24
 
25
25
  // src/commands/describe.ts
26
26
  var STOPWORDS = /* @__PURE__ */ new Set([
@@ -1233,7 +1233,7 @@ function extractPackageApiImpl(project, typeFiles, packagePath, limit, jsFallbac
1233
1233
  return { functions: [], types: [], constants: [], truncated: { functions: false, types: false, totalFunctions: 0, totalTypes: 0, shown: 0 } };
1234
1234
  }
1235
1235
  const originalFileCount = sourceFiles.length;
1236
- if (!jsFallback) {
1236
+ if (!jsFallback && nodeModulesDir) {
1237
1237
  const reExportedFiles = followReExports(
1238
1238
  project,
1239
1239
  sourceFiles,
@@ -1279,7 +1279,8 @@ function extractPackageApiImpl(project, typeFiles, packagePath, limit, jsFallbac
1279
1279
  }
1280
1280
  for (const fn of functions) {
1281
1281
  if (fn.name.startsWith("_")) continue;
1282
- if (fn.isExported || exportNames.has(fn.name) || jsFallback) {
1282
+ if (isLikelyMinified(fn.name)) continue;
1283
+ if (fn.isExported || exportNames.has(fn.name) || publicApiNames.has(fn.name) || jsFallback) {
1283
1284
  allFunctions.push({
1284
1285
  ...fn,
1285
1286
  sourceFile: relativeSource,
@@ -1289,14 +1290,16 @@ function extractPackageApiImpl(project, typeFiles, packagePath, limit, jsFallbac
1289
1290
  }
1290
1291
  for (const type of types) {
1291
1292
  if (type.name.startsWith("_")) continue;
1292
- if (type.isExported || exportNames.has(type.name) || jsFallback) {
1293
+ if (isLikelyMinified(type.name)) continue;
1294
+ if (type.isExported || exportNames.has(type.name) || publicApiNames.has(type.name) || jsFallback) {
1293
1295
  allTypes.push({ ...type, sourceFile: relativeSource });
1294
1296
  }
1295
1297
  }
1296
1298
  const constants = extractConstants(sourceFile, jsFallback);
1297
1299
  for (const constant of constants) {
1298
1300
  if (constant.name.startsWith("_")) continue;
1299
- if (constant.isExported || exportNames.has(constant.name) || jsFallback) {
1301
+ if (isLikelyMinified(constant.name)) continue;
1302
+ if (constant.isExported || exportNames.has(constant.name) || publicApiNames.has(constant.name) || jsFallback) {
1300
1303
  allConstants.push({ ...constant, sourceFile: relativeSource });
1301
1304
  }
1302
1305
  }
@@ -1344,6 +1347,9 @@ function extractConstants(sourceFile, includeAll = false) {
1344
1347
  }
1345
1348
  return constants;
1346
1349
  }
1350
+ function isLikelyMinified(name) {
1351
+ return name.length === 1;
1352
+ }
1347
1353
  function deduplicateByName(items) {
1348
1354
  const seen = /* @__PURE__ */ new Map();
1349
1355
  for (const item of items) {
@@ -1463,6 +1469,15 @@ async function depsInfo(packageName, options = {}) {
1463
1469
  }
1464
1470
  try {
1465
1471
  const result = readPackageJson(packageName, cwd);
1472
+ if (result.version === "0.0.0" && !packageName.startsWith("@") && packageName.includes("/")) {
1473
+ const basePkg = packageName.slice(0, packageName.indexOf("/"));
1474
+ try {
1475
+ const baseResult = readPackageJson(basePkg, cwd);
1476
+ result.version = baseResult.version;
1477
+ result.info.version = baseResult.version;
1478
+ } catch {
1479
+ }
1480
+ }
1466
1481
  const projectPkgPath = join3(cwd, "package.json");
1467
1482
  if (existsSync3(projectPkgPath)) {
1468
1483
  try {
package/dist/cli.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  depsInfo,
5
5
  depsSearch,
6
6
  describe
7
- } from "./chunk-5HTCZRJR.js";
7
+ } from "./chunk-XA37DX5M.js";
8
8
  import {
9
9
  VERSION,
10
10
  area,
@@ -20,7 +20,7 @@ import {
20
20
  impact,
21
21
  map,
22
22
  suggest
23
- } from "./chunk-DBABYIEY.js";
23
+ } from "./chunk-GBNBYBLN.js";
24
24
 
25
25
  // src/cli.ts
26
26
  import { resolve } from "path";
@@ -131,7 +131,7 @@ async function main() {
131
131
  }
132
132
  }
133
133
  if (flags.mcp) {
134
- const { startMcpServer } = await import("./server-DB7YY6SP.js");
134
+ const { startMcpServer } = await import("./server-O6CBWSYZ.js");
135
135
  await startMcpServer();
136
136
  return;
137
137
  }
package/dist/index.js CHANGED
@@ -47,7 +47,7 @@ import {
47
47
  setFileDescription,
48
48
  suggest,
49
49
  writeConfig
50
- } from "./chunk-DBABYIEY.js";
50
+ } from "./chunk-GBNBYBLN.js";
51
51
  export {
52
52
  VERSION,
53
53
  area,
@@ -3,7 +3,7 @@ import {
3
3
  depsInfo,
4
4
  depsSearch,
5
5
  describe
6
- } from "./chunk-5HTCZRJR.js";
6
+ } from "./chunk-XA37DX5M.js";
7
7
  import {
8
8
  VERSION,
9
9
  area,
@@ -19,7 +19,7 @@ import {
19
19
  map,
20
20
  recoveryHint,
21
21
  suggest
22
- } from "./chunk-DBABYIEY.js";
22
+ } from "./chunk-GBNBYBLN.js";
23
23
 
24
24
  // src/mcp/server.ts
25
25
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justmpm/ai-tool",
3
- "version": "3.18.0",
3
+ "version": "3.19.0",
4
4
  "description": "Ferramenta de análise de dependências e impacto para projetos TypeScript/JavaScript. Usa Skott + Knip internamente. Inclui busca por descrição, integração Git e testes inteligentes.",
5
5
  "keywords": [
6
6
  "dependency-analysis",