@justmpm/ai-tool 3.23.0 → 3.24.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.
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
readConfig,
|
|
21
21
|
recoveryHint,
|
|
22
22
|
simplifyType
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-LKP6Z3JC.js";
|
|
24
24
|
|
|
25
25
|
// src/commands/describe.ts
|
|
26
26
|
var STOPWORDS = /* @__PURE__ */ new Set([
|
|
@@ -1625,25 +1625,29 @@ function isConceptualQuery(query, packageName) {
|
|
|
1625
1625
|
}
|
|
1626
1626
|
|
|
1627
1627
|
// src/commands/deps.ts
|
|
1628
|
+
function normalizeKind(kind) {
|
|
1629
|
+
if (kind === "interface" || kind === "enum") return "type";
|
|
1630
|
+
return kind;
|
|
1631
|
+
}
|
|
1628
1632
|
function normalizePath(p) {
|
|
1629
1633
|
return p.replace(/\\/g, "/");
|
|
1630
1634
|
}
|
|
1631
1635
|
function computeAvailableKinds(extracted, requestedKind) {
|
|
1632
1636
|
const kindCounts = /* @__PURE__ */ new Map();
|
|
1633
1637
|
for (const fn of extracted.functions) {
|
|
1634
|
-
const kind = classifySymbol("function", fn.name, fn.returnType);
|
|
1638
|
+
const kind = normalizeKind(classifySymbol("function", fn.name, fn.returnType));
|
|
1635
1639
|
if (isSemanticKindMatch(kind, requestedKind)) {
|
|
1636
1640
|
kindCounts.set(kind, (kindCounts.get(kind) ?? 0) + 1);
|
|
1637
1641
|
}
|
|
1638
1642
|
}
|
|
1639
1643
|
for (const t of extracted.types) {
|
|
1640
|
-
const kind = classifySymbol("type", t.name);
|
|
1644
|
+
const kind = normalizeKind(classifySymbol("type", t.name));
|
|
1641
1645
|
if (isSemanticKindMatch(kind, requestedKind)) {
|
|
1642
1646
|
kindCounts.set(kind, (kindCounts.get(kind) ?? 0) + 1);
|
|
1643
1647
|
}
|
|
1644
1648
|
}
|
|
1645
1649
|
for (const c of extracted.constants) {
|
|
1646
|
-
const kind = classifySymbol("const", c.name);
|
|
1650
|
+
const kind = normalizeKind(classifySymbol("const", c.name));
|
|
1647
1651
|
if (isSemanticKindMatch(kind, requestedKind)) {
|
|
1648
1652
|
kindCounts.set(kind, (kindCounts.get(kind) ?? 0) + 1);
|
|
1649
1653
|
}
|
|
@@ -340,8 +340,16 @@ function recoveryHint(errorType, ctx, _extra) {
|
|
|
340
340
|
return `
|
|
341
341
|
\u{1F4A1} Nenhuma area configurada neste projeto.
|
|
342
342
|
\u2192 ${hint("areas_init", ctx)} - gerar arquivo de configuracao
|
|
343
|
-
\u2192 Depois edite .analyze/areas.config.json com as areas do projeto
|
|
344
343
|
\u2192 ${hint("map", ctx)} - ver estrutura do projeto sem areas
|
|
344
|
+
|
|
345
|
+
Como configurar o areas.config.json:
|
|
346
|
+
- patterns: glob para pastas (ex: "app/dashboard/**", "hooks/usePets.*")
|
|
347
|
+
- keywords: substring no path, case-insensitive (ex: ["pet", "animal"])
|
|
348
|
+
- exclude: remove falsos positivos de uma area (ex: "components/pets/shared/**")
|
|
349
|
+
- descriptions: contexto manual para arquivos importantes (aparece no suggest, context, changes)
|
|
350
|
+
- settings.inferDescriptions: true para inferir descricoes automaticamente pelo nome do arquivo
|
|
351
|
+
- Um arquivo pode pertencer a multiplas areas
|
|
352
|
+
- Ideal: 5 a 15 areas (muitas = dificil de navegar)
|
|
345
353
|
`;
|
|
346
354
|
case "symbol_not_found":
|
|
347
355
|
return `
|
|
@@ -626,6 +634,8 @@ function formatMapSummary(result, areasInfo, ctx = "cli") {
|
|
|
626
634
|
out += ` \u2192 ${hint("areas_missing", ctx)} para ver quais arquivos estao sem area
|
|
627
635
|
`;
|
|
628
636
|
out += ` \u2192 ${hint("areas_init", ctx)} para criar/editar areas.config
|
|
637
|
+
`;
|
|
638
|
+
out += ` Boas praticas: patterns (glob exato) para pastas, keywords (case-insensitive) para arquivos espalhados, exclude para falsos positivos
|
|
629
639
|
|
|
630
640
|
`;
|
|
631
641
|
}
|
|
@@ -1895,65 +1905,6 @@ AFFECTED AREAS:
|
|
|
1895
1905
|
const semanticFiles = result.files.filter((f) => f.changes.length > 0 && !f.newFile);
|
|
1896
1906
|
const newFiles = result.files.filter((f) => f.newFile);
|
|
1897
1907
|
const otherFiles = result.files.filter((f) => f.changes.length === 0 && !f.newFile);
|
|
1898
|
-
const COMPACT_THRESHOLD = 10;
|
|
1899
|
-
const filesExceedThreshold = semanticFiles.length + newFiles.length > COMPACT_THRESHOLD;
|
|
1900
|
-
if (filesExceedThreshold) {
|
|
1901
|
-
out += `
|
|
1902
|
-
COMPACT MODE: Too many files. Use --file=<path> for details.
|
|
1903
|
-
|
|
1904
|
-
`;
|
|
1905
|
-
const modifiedCompact = result.files.filter((f) => !f.newFile);
|
|
1906
|
-
const renamedCompact = modifiedCompact.filter((f) => f.renamed);
|
|
1907
|
-
const otherModifiedCompact = modifiedCompact.filter((f) => !f.renamed);
|
|
1908
|
-
if (otherModifiedCompact.length > 0) {
|
|
1909
|
-
out += `Modified files:
|
|
1910
|
-
`;
|
|
1911
|
-
for (const file of otherModifiedCompact) {
|
|
1912
|
-
const changeCount = file.changes.length;
|
|
1913
|
-
out += ` ${file.path} (+${file.stats.added} -${file.stats.removed})`;
|
|
1914
|
-
if (changeCount > 0) {
|
|
1915
|
-
out += ` - ${changeCount} changes`;
|
|
1916
|
-
} else {
|
|
1917
|
-
out += ` - (no semantic changes)`;
|
|
1918
|
-
}
|
|
1919
|
-
out += `
|
|
1920
|
-
`;
|
|
1921
|
-
}
|
|
1922
|
-
}
|
|
1923
|
-
if (renamedCompact.length > 0) {
|
|
1924
|
-
out += `
|
|
1925
|
-
Renamed files:
|
|
1926
|
-
`;
|
|
1927
|
-
for (const file of renamedCompact) {
|
|
1928
|
-
out += ` ${file.renamedFrom} -> ${file.path} (+${file.stats.added} -${file.stats.removed})`;
|
|
1929
|
-
const changeCount = file.changes.length;
|
|
1930
|
-
if (changeCount > 0) {
|
|
1931
|
-
out += ` - ${changeCount} changes`;
|
|
1932
|
-
}
|
|
1933
|
-
out += `
|
|
1934
|
-
`;
|
|
1935
|
-
}
|
|
1936
|
-
}
|
|
1937
|
-
if (newFiles.length > 0) {
|
|
1938
|
-
out += `
|
|
1939
|
-
New files (untracked):
|
|
1940
|
-
`;
|
|
1941
|
-
for (const file of newFiles) {
|
|
1942
|
-
const changeCount = file.changes.length;
|
|
1943
|
-
out += ` ${file.path} (+${file.stats.added} new)`;
|
|
1944
|
-
if (changeCount > 0) {
|
|
1945
|
-
out += ` - ${changeCount} symbols`;
|
|
1946
|
-
}
|
|
1947
|
-
out += `
|
|
1948
|
-
`;
|
|
1949
|
-
}
|
|
1950
|
-
}
|
|
1951
|
-
out += `
|
|
1952
|
-
Use: ${hint("changes", ctx)} --file=<arquivo>
|
|
1953
|
-
`;
|
|
1954
|
-
out += nextSteps("changes", ctx);
|
|
1955
|
-
return out;
|
|
1956
|
-
}
|
|
1957
1908
|
for (const file of semanticFiles) {
|
|
1958
1909
|
out += `
|
|
1959
1910
|
--- ${file.path} (+${file.stats.added} -${file.stats.removed}) ---
|
|
@@ -7005,14 +6956,20 @@ Ou edite manualmente o arquivo existente.
|
|
|
7005
6956
|
ai-tool area auth # Ver arquivos de uma \xE1rea
|
|
7006
6957
|
ai-tool map # Ver resumo do projeto
|
|
7007
6958
|
|
|
7008
|
-
\u{1F4A1} Dicas:
|
|
6959
|
+
\u{1F4A1} Dicas:
|
|
7009
6960
|
|
|
7010
|
-
\u2022
|
|
7011
|
-
\u2022
|
|
7012
|
-
\u2022 Um arquivo pode pertencer a m\xFAltiplas \xE1reas
|
|
7013
|
-
\u2022
|
|
6961
|
+
\u2022 patterns: glob para pastas (ex: "app/dashboard/**", "hooks/usePets.*")
|
|
6962
|
+
\u2022 keywords: substring no path inteiro, case-insensitive (ex: ["pet", "animal"])
|
|
6963
|
+
\u2022 Um arquivo pode pertencer a m\xFAltiplas \xE1reas
|
|
6964
|
+
\u2022 exclude: remove falsos positivos de uma \xE1rea (glob patterns)
|
|
6965
|
+
\u2022 descriptions (campo raiz): contexto manual para arquivos importantes
|
|
6966
|
+
Aparece nos comandos suggest, context e changes
|
|
6967
|
+
Ex: "src/hooks/useAuth.ts": "Hook principal de autentica\xE7\xE3o"
|
|
6968
|
+
\u2022 settings.inferDescriptions: true j\xE1 infere descri\xE7\xF5es automaticamente
|
|
6969
|
+
pelo nome do arquivo (ex: useAuth.ts \u2192 "Hook de auth", petService.ts \u2192 "Service de pet")
|
|
6970
|
+
Ativado por padr\xE3o no template gerado
|
|
7014
6971
|
|
|
7015
|
-
\u{1F4D6} Exemplo completo:
|
|
6972
|
+
\u{1F4D6} Exemplo completo:
|
|
7016
6973
|
|
|
7017
6974
|
{
|
|
7018
6975
|
"areas": {
|
package/dist/cli.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
depsInfo,
|
|
5
5
|
depsSearch,
|
|
6
6
|
describe
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ERMF7MJF.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-
|
|
23
|
+
} from "./chunk-LKP6Z3JC.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-
|
|
134
|
+
const { startMcpServer } = await import("./server-T6IW5ZR7.js");
|
|
135
135
|
await startMcpServer();
|
|
136
136
|
return;
|
|
137
137
|
}
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
depsInfo,
|
|
4
4
|
depsSearch,
|
|
5
5
|
describe
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ERMF7MJF.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-
|
|
22
|
+
} from "./chunk-LKP6Z3JC.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.
|
|
3
|
+
"version": "3.24.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",
|