@justmpm/ai-tool 1.0.3 → 1.0.5

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.
@@ -13,7 +13,7 @@ import {
13
13
  parseCommandOptions,
14
14
  readConfig,
15
15
  updateCacheMeta
16
- } from "./chunk-36CYBYVT.js";
16
+ } from "./chunk-VG3ZBPEH.js";
17
17
 
18
18
  // src/commands/describe.ts
19
19
  var STOPWORDS = /* @__PURE__ */ new Set([
@@ -181,6 +181,10 @@ var COMMAND_MAP = {
181
181
  cli: "ai-tool areas init",
182
182
  mcp: "analyze__aitool_areas_init"
183
183
  },
184
+ areas_missing: {
185
+ cli: "ai-tool areas --missing",
186
+ mcp: "analyze__aitool_list_areas { missing: true }"
187
+ },
184
188
  find: {
185
189
  cli: "ai-tool find <termo>",
186
190
  mcp: "analyze__aitool_find { query: '<termo>' }"
@@ -471,7 +475,9 @@ function formatMapSummary(result, areasInfo, ctx = "cli") {
471
475
  if (areasInfo && areasInfo.unmappedCount > 0) {
472
476
  out += `\u26A0\uFE0F ${areasInfo.unmappedCount} arquivo(s) sem area definida
473
477
  `;
474
- out += ` \u2192 ${hint("areas_init", ctx)} para configurar
478
+ out += ` \u2192 ${hint("areas_missing", ctx)} para ver quais arquivos estao sem area
479
+ `;
480
+ out += ` \u2192 ${hint("areas_init", ctx)} para criar/editar areas.config
475
481
 
476
482
  `;
477
483
  }
@@ -1149,6 +1155,45 @@ function formatAreasText(result, ctx = "cli") {
1149
1155
  out += nextSteps("areas", ctx);
1150
1156
  return out;
1151
1157
  }
1158
+ function formatAreasMissingText(result, ctx = "cli") {
1159
+ let out = "";
1160
+ out += `## \u26A0\uFE0F ARQUIVOS SEM \xC1REA (${result.unmapped.length})
1161
+
1162
+ `;
1163
+ if (result.unmapped.length === 0) {
1164
+ out += `\u2705 Todos os arquivos est\xE3o associados a uma \xE1rea!
1165
+ `;
1166
+ out += nextSteps("areas", ctx);
1167
+ return out;
1168
+ }
1169
+ const byFolder = /* @__PURE__ */ new Map();
1170
+ for (const file of result.unmapped) {
1171
+ const folder = file.path.split("/").slice(0, -1).join("/") || ".";
1172
+ if (!byFolder.has(folder)) {
1173
+ byFolder.set(folder, []);
1174
+ }
1175
+ byFolder.get(folder).push(file);
1176
+ }
1177
+ const sortedFolders = [...byFolder.entries()].sort((a, b) => b[1].length - a[1].length);
1178
+ for (const [folder, files] of sortedFolders) {
1179
+ const folderDisplay = folder === "." ? "(raiz)" : `${folder}/`;
1180
+ out += `\u{1F4C1} ${folderDisplay} (${files.length})
1181
+ `;
1182
+ for (const file of files) {
1183
+ const fileIcon = categoryIcons[file.category];
1184
+ const fileName = file.path.split("/").pop() || file.path;
1185
+ out += ` ${fileIcon} ${fileName}
1186
+ `;
1187
+ }
1188
+ out += `
1189
+ `;
1190
+ }
1191
+ out += `\u{1F4A1} Adicione padr\xF5es em .analyze/areas.config.json
1192
+ `;
1193
+ out += ` ou execute ${hint("areas_init", ctx)} para gerar configura\xE7\xE3o
1194
+ `;
1195
+ return out;
1196
+ }
1152
1197
  function formatAreaDetailText(result, options = {}, ctx = "cli") {
1153
1198
  const { full = false, filterType } = options;
1154
1199
  const { area: area2, byCategory } = result;
@@ -4339,6 +4384,32 @@ async function areas(options = {}) {
4339
4384
  const config = readConfig(cwd);
4340
4385
  const allFiles = getAllCodeFiles3(cwd);
4341
4386
  const filteredFiles = allFiles.filter((filePath) => !isFileIgnored(filePath, config));
4387
+ if (options.missing) {
4388
+ const unmapped2 = [];
4389
+ for (const filePath of filteredFiles) {
4390
+ const areas2 = detectFileAreas(filePath, config);
4391
+ if (areas2.length === 0) {
4392
+ const category = detectCategory(filePath);
4393
+ unmapped2.push({ path: filePath, category });
4394
+ }
4395
+ }
4396
+ const result2 = {
4397
+ version: "1.0.0",
4398
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
4399
+ cwd,
4400
+ areas: [],
4401
+ unmapped: unmapped2,
4402
+ summary: {
4403
+ totalAreas: 0,
4404
+ totalFiles: filteredFiles.length,
4405
+ unmappedCount: unmapped2.length
4406
+ }
4407
+ };
4408
+ if (format === "json") {
4409
+ return JSON.stringify(result2, null, 2);
4410
+ }
4411
+ return formatAreasMissingText(result2, ctx);
4412
+ }
4342
4413
  const areaMap = /* @__PURE__ */ new Map();
4343
4414
  const unmapped = [];
4344
4415
  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-M32V3QZD.js";
4
+ } from "./chunk-PJDTFEHK.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-36CYBYVT.js";
19
+ } from "./chunk-VG3ZBPEH.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-XRNZYROB.js");
118
+ const { startMcpServer } = await import("./server-T4MWFGJ5.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
@@ -232,6 +232,7 @@ interface AreaDetailResult {
232
232
  interface AreasOptions extends CommandOptions {
233
233
  full?: boolean;
234
234
  type?: FileCategory;
235
+ missing?: boolean;
235
236
  }
236
237
  interface AreaOptions extends CommandOptions {
237
238
  full?: boolean;
package/dist/index.js CHANGED
@@ -46,7 +46,7 @@ import {
46
46
  setFileDescription,
47
47
  suggest,
48
48
  writeConfig
49
- } from "./chunk-36CYBYVT.js";
49
+ } from "./chunk-VG3ZBPEH.js";
50
50
  export {
51
51
  VERSION,
52
52
  area,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  describe
3
- } from "./chunk-M32V3QZD.js";
3
+ } from "./chunk-PJDTFEHK.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-36CYBYVT.js";
18
+ } from "./chunk-VG3ZBPEH.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
- target: z.string().min(1).describe("Arquivo para extrair contexto: caminho completo, parcial ou nome"),
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",
3
+ "version": "1.0.5",
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",