@justmpm/ai-tool 1.0.3 → 1.0.4
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.
|
@@ -1149,6 +1149,45 @@ function formatAreasText(result, ctx = "cli") {
|
|
|
1149
1149
|
out += nextSteps("areas", ctx);
|
|
1150
1150
|
return out;
|
|
1151
1151
|
}
|
|
1152
|
+
function formatAreasMissingText(result, ctx = "cli") {
|
|
1153
|
+
let out = "";
|
|
1154
|
+
out += `## \u26A0\uFE0F ARQUIVOS SEM \xC1REA (${result.unmapped.length})
|
|
1155
|
+
|
|
1156
|
+
`;
|
|
1157
|
+
if (result.unmapped.length === 0) {
|
|
1158
|
+
out += `\u2705 Todos os arquivos est\xE3o associados a uma \xE1rea!
|
|
1159
|
+
`;
|
|
1160
|
+
out += nextSteps("areas", ctx);
|
|
1161
|
+
return out;
|
|
1162
|
+
}
|
|
1163
|
+
const byFolder = /* @__PURE__ */ new Map();
|
|
1164
|
+
for (const file of result.unmapped) {
|
|
1165
|
+
const folder = file.path.split("/").slice(0, -1).join("/") || ".";
|
|
1166
|
+
if (!byFolder.has(folder)) {
|
|
1167
|
+
byFolder.set(folder, []);
|
|
1168
|
+
}
|
|
1169
|
+
byFolder.get(folder).push(file);
|
|
1170
|
+
}
|
|
1171
|
+
const sortedFolders = [...byFolder.entries()].sort((a, b) => b[1].length - a[1].length);
|
|
1172
|
+
for (const [folder, files] of sortedFolders) {
|
|
1173
|
+
const folderDisplay = folder === "." ? "(raiz)" : `${folder}/`;
|
|
1174
|
+
out += `\u{1F4C1} ${folderDisplay} (${files.length})
|
|
1175
|
+
`;
|
|
1176
|
+
for (const file of files) {
|
|
1177
|
+
const fileIcon = categoryIcons[file.category];
|
|
1178
|
+
const fileName = file.path.split("/").pop() || file.path;
|
|
1179
|
+
out += ` ${fileIcon} ${fileName}
|
|
1180
|
+
`;
|
|
1181
|
+
}
|
|
1182
|
+
out += `
|
|
1183
|
+
`;
|
|
1184
|
+
}
|
|
1185
|
+
out += `\u{1F4A1} Adicione padr\xF5es em .analyze/areas.config.json
|
|
1186
|
+
`;
|
|
1187
|
+
out += ` ou execute ${hint("areas_init", ctx)} para gerar configura\xE7\xE3o
|
|
1188
|
+
`;
|
|
1189
|
+
return out;
|
|
1190
|
+
}
|
|
1152
1191
|
function formatAreaDetailText(result, options = {}, ctx = "cli") {
|
|
1153
1192
|
const { full = false, filterType } = options;
|
|
1154
1193
|
const { area: area2, byCategory } = result;
|
|
@@ -4339,6 +4378,32 @@ async function areas(options = {}) {
|
|
|
4339
4378
|
const config = readConfig(cwd);
|
|
4340
4379
|
const allFiles = getAllCodeFiles3(cwd);
|
|
4341
4380
|
const filteredFiles = allFiles.filter((filePath) => !isFileIgnored(filePath, config));
|
|
4381
|
+
if (options.missing) {
|
|
4382
|
+
const unmapped2 = [];
|
|
4383
|
+
for (const filePath of filteredFiles) {
|
|
4384
|
+
const areas2 = detectFileAreas(filePath, config);
|
|
4385
|
+
if (areas2.length === 0) {
|
|
4386
|
+
const category = detectCategory(filePath);
|
|
4387
|
+
unmapped2.push({ path: filePath, category });
|
|
4388
|
+
}
|
|
4389
|
+
}
|
|
4390
|
+
const result2 = {
|
|
4391
|
+
version: "1.0.0",
|
|
4392
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4393
|
+
cwd,
|
|
4394
|
+
areas: [],
|
|
4395
|
+
unmapped: unmapped2,
|
|
4396
|
+
summary: {
|
|
4397
|
+
totalAreas: 0,
|
|
4398
|
+
totalFiles: filteredFiles.length,
|
|
4399
|
+
unmappedCount: unmapped2.length
|
|
4400
|
+
}
|
|
4401
|
+
};
|
|
4402
|
+
if (format === "json") {
|
|
4403
|
+
return JSON.stringify(result2, null, 2);
|
|
4404
|
+
}
|
|
4405
|
+
return formatAreasMissingText(result2, ctx);
|
|
4406
|
+
}
|
|
4342
4407
|
const areaMap = /* @__PURE__ */ new Map();
|
|
4343
4408
|
const unmapped = [];
|
|
4344
4409
|
for (const filePath of filteredFiles) {
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
describe
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NI3IRPT4.js";
|
|
5
5
|
import {
|
|
6
6
|
VERSION,
|
|
7
7
|
area,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
impact,
|
|
17
17
|
map,
|
|
18
18
|
suggest
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-RODPJDYQ.js";
|
|
20
20
|
|
|
21
21
|
// src/cli.ts
|
|
22
22
|
import { resolve } from "path";
|
|
@@ -37,6 +37,7 @@ COMANDOS:
|
|
|
37
37
|
|
|
38
38
|
AREAS:
|
|
39
39
|
areas Lista todas as areas/dominios do projeto
|
|
40
|
+
areas --missing Mostra apenas arquivos sem area definida (lista completa)
|
|
40
41
|
areas init Gera arquivo de configuracao .analyze/areas.config.json
|
|
41
42
|
areas init --force Sobrescreve configuracao existente
|
|
42
43
|
area <nome> Mostra arquivos de uma area especifica
|
|
@@ -65,6 +66,7 @@ OPCOES:
|
|
|
65
66
|
--type=<categoria> Filtra por categoria (area) ou tipo de simbolo (find)
|
|
66
67
|
--full Lista completa (map: lista arquivos, area: todos arquivos)
|
|
67
68
|
--area=<nome> Filtra por area (find, context)
|
|
69
|
+
--missing Mostra apenas arquivos sem area (areas)
|
|
68
70
|
--def Apenas definicoes (find)
|
|
69
71
|
--refs Apenas referencias (find)
|
|
70
72
|
--help, -h Mostra esta ajuda
|
|
@@ -113,7 +115,7 @@ async function main() {
|
|
|
113
115
|
}
|
|
114
116
|
}
|
|
115
117
|
if (flags.mcp) {
|
|
116
|
-
const { startMcpServer } = await import("./server-
|
|
118
|
+
const { startMcpServer } = await import("./server-RP4IQ5FW.js");
|
|
117
119
|
await startMcpServer();
|
|
118
120
|
return;
|
|
119
121
|
}
|
|
@@ -202,7 +204,7 @@ async function main() {
|
|
|
202
204
|
if (target === "init") {
|
|
203
205
|
result = await areasInit({ cwd, force: !!flags.force });
|
|
204
206
|
} else {
|
|
205
|
-
result = await areas({ format, cwd });
|
|
207
|
+
result = await areas({ format, cwd, missing: !!flags.missing });
|
|
206
208
|
}
|
|
207
209
|
break;
|
|
208
210
|
case "area":
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
describe
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NI3IRPT4.js";
|
|
4
4
|
import {
|
|
5
5
|
VERSION,
|
|
6
6
|
area,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
map,
|
|
16
16
|
recoveryHint,
|
|
17
17
|
suggest
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-RODPJDYQ.js";
|
|
19
19
|
|
|
20
20
|
// src/mcp/server.ts
|
|
21
21
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
@@ -208,8 +208,9 @@ NAO use para: entender uma area/feature inteira (use area_context, que consolida
|
|
|
208
208
|
|
|
209
209
|
Apos entender o contexto, use find para localizar onde cada export e usado no projeto.`,
|
|
210
210
|
inputSchema: {
|
|
211
|
-
|
|
212
|
-
cwd: z.string().optional().describe("Diretorio do projeto a analisar")
|
|
211
|
+
format: z.enum(["text", "json"]).default("text").describe("Formato de saida: text (legivel) ou json (estruturado)"),
|
|
212
|
+
cwd: z.string().optional().describe("Diretorio do projeto a analisar"),
|
|
213
|
+
missing: z.boolean().default(false).describe("Mostrar apenas arquivos sem area definida")
|
|
213
214
|
},
|
|
214
215
|
annotations: {
|
|
215
216
|
title: "Extract File Context",
|
|
@@ -266,7 +267,8 @@ NAO use para: buscar uma area pelo nome/descricao (use describe) ou ver os arqui
|
|
|
266
267
|
const result = await areas({
|
|
267
268
|
format: params.format,
|
|
268
269
|
cwd: params.cwd,
|
|
269
|
-
ctx: "mcp"
|
|
270
|
+
ctx: "mcp",
|
|
271
|
+
missing: params.missing
|
|
270
272
|
});
|
|
271
273
|
return { content: [{ type: "text", text: result }] };
|
|
272
274
|
} catch (error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justmpm/ai-tool",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
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",
|