@justmpm/ai-tool 0.7.8 → 0.7.10

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.
@@ -1942,6 +1942,10 @@ function detectFileAreas(filePath, config) {
1942
1942
  const normalizedPath = filePath.replace(/\\/g, "/");
1943
1943
  const matches = [];
1944
1944
  const autoDetect = config.settings?.autoDetect !== false;
1945
+ if (filePath.includes("useAuth.ts")) {
1946
+ console.error(`[DEBUG] autoDetect for ${filePath}:`, autoDetect);
1947
+ console.error(`[DEBUG] config.settings:`, JSON.stringify(config.settings));
1948
+ }
1945
1949
  for (const [areaId, areaConfig] of Object.entries(config.areas)) {
1946
1950
  if (matchesAreaConfig(normalizedPath, areaConfig)) {
1947
1951
  matches.push({ area: areaId, priority: 200, source: "config" });
@@ -4615,6 +4619,9 @@ Ou edite manualmente o arquivo existente.
4615
4619
  }
4616
4620
  };
4617
4621
  writeConfig(cwd, newConfig);
4622
+ const unmappedCount = allFiles.filter(
4623
+ (f) => detectFileAreas(f, newConfig).length === 0
4624
+ ).length;
4618
4625
  const sortedAreas = [...areaCounts.entries()].sort((a, b) => b[1].size - a[1].size);
4619
4626
  let out = `
4620
4627
  \u2705 Arquivo criado: .analyze/areas.config.json
@@ -4636,9 +4643,6 @@ Ou edite manualmente o arquivo existente.
4636
4643
  out += ` ... e mais ${sortedAreas.length - 15}
4637
4644
  `;
4638
4645
  }
4639
- const unmappedCount = allFiles.filter(
4640
- (f) => detectFileAreas(f, currentConfig).length === 0
4641
- ).length;
4642
4646
  if (unmappedCount > 0) {
4643
4647
  out += `
4644
4648
  \u26A0\uFE0F ${unmappedCount} arquivos sem \xE1rea definida
@@ -4655,13 +4659,46 @@ Ou edite manualmente o arquivo existente.
4655
4659
  }
4656
4660
  }
4657
4661
  out += `
4658
- \u{1F4A1} Edite o arquivo para:
4659
- - Renomear \xE1reas (campo "name")
4660
- - Adicionar descri\xE7\xF5es (campo "description")
4661
- - Ajustar padr\xF5es (campo "patterns")
4662
- - Adicionar/remover \xE1reas
4663
- - Definir descri\xE7\xF5es espec\xEDficas de arquivos (campo "descriptions")
4664
- `;
4662
+ \u{1F4A1} Boas pr\xE1ticas:
4663
+ - Ideal: 5-15 \xE1reas (muitas \xE1reas \xE9 dif\xEDcil de navegar)
4664
+ - Use patterns para pastas, keywords para arquivos espalhados
4665
+ - Se uma \xE1rea tem <3 arquivos, considere mesclar com outra
4666
+ - Se tem >50 arquivos, considere dividir em sub-\xE1reas
4667
+
4668
+ \u{1F4DD} Como customizar:
4669
+ 1. Renomear \xE1reas: altere o campo "name"
4670
+ 2. Ajustar padr\xF5es: edite "patterns" (glob) ou "keywords"
4671
+ 3. Adicionar descri\xE7\xF5es: campo "description" explica o dom\xEDnio
4672
+ 4. Descri\xE7\xF5es de arquivos: use "descriptions" para documentos espec\xEDficos
4673
+
4674
+ \u{1F4A1} Exemplo de customiza\xE7\xE3o:
4675
+
4676
+ Antes (nome gen\xE9rico detectado):
4677
+ "user-profile": { "name": "User Profile", ... }
4678
+
4679
+ Depois (renomeado para dom\xEDnio de neg\xF3cio):
4680
+ "meu-perfil": { "name": "Meu Perfil", "description": "Edi\xE7\xE3o de perfil do usu\xE1rio" }
4681
+
4682
+ \u2699\uFE0F Quando usar autoDetect: false
4683
+ - Quando quer controle total das \xE1reas
4684
+ - Quando a detec\xE7\xE3o autom\xE1tica est\xE1 muito imprecisa
4685
+ - Quando o projeto tem dom\xEDnios muito espec\xEDficos
4686
+
4687
+ \u{1F4A1} Casos especiais:
4688
+ - Arquivos compartilhados: adicione a m\xFAltiplas \xE1reas
4689
+ - Utils globais: crie \xE1rea 'shared' ou use 'ignore'
4690
+ - Monorepo: use 'patterns' com caminhos relativos \xE0 raiz
4691
+
4692
+ \u{1F527} Manuten\xE7\xE3o:
4693
+ - Atualize o config ao criar/mover arquivos
4694
+ - Use 'ai-tool areas' para verificar arquivos sem \xE1rea
4695
+ - Use 'ai-tool area <nome>' para ver o que foi detectado
4696
+
4697
+ \u{1F4CB} Pr\xF3ximos passos:
4698
+ \u2192 Execute 'ai-tool areas' para ver o resultado
4699
+ \u2192 Use 'ai-tool area <nome>' para validar uma \xE1rea espec\xEDfica
4700
+ \u2192 Execute 'ai-tool map' para ver o resumo atualizado
4701
+ `;
4665
4702
  return out.trim();
4666
4703
  } catch (error) {
4667
4704
  const message = error instanceof Error ? error.message : String(error);
@@ -4733,7 +4770,9 @@ function getAllCodeFiles5(dir, files = [], baseDir = dir) {
4733
4770
  const ext = extname6(entry).toLowerCase();
4734
4771
  if (CODE_EXTENSIONS6.has(ext)) {
4735
4772
  const relativePath = fullPath.slice(baseDir.length + 1).replace(/\\/g, "/");
4736
- files.push(relativePath);
4773
+ if (relativePath && !relativePath.startsWith("..")) {
4774
+ files.push(relativePath);
4775
+ }
4737
4776
  }
4738
4777
  }
4739
4778
  } catch {
package/dist/cli.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  impact,
14
14
  map,
15
15
  suggest
16
- } from "./chunk-DUFJBSFC.js";
16
+ } from "./chunk-MWM2INVY.js";
17
17
 
18
18
  // src/cli.ts
19
19
  import { resolve } from "path";
@@ -108,7 +108,7 @@ async function main() {
108
108
  }
109
109
  }
110
110
  if (flags.mcp) {
111
- const { startMcpServer } = await import("./server-TQLA6OF6.js");
111
+ const { startMcpServer } = await import("./server-IBNLXRUS.js");
112
112
  await startMcpServer();
113
113
  return;
114
114
  }
package/dist/index.js CHANGED
@@ -47,7 +47,7 @@ import {
47
47
  setFileDescription,
48
48
  suggest,
49
49
  writeConfig
50
- } from "./chunk-DUFJBSFC.js";
50
+ } from "./chunk-MWM2INVY.js";
51
51
  export {
52
52
  AREA_DESCRIPTIONS,
53
53
  AREA_NAMES,
@@ -11,7 +11,7 @@ import {
11
11
  impact,
12
12
  map,
13
13
  suggest
14
- } from "./chunk-DUFJBSFC.js";
14
+ } from "./chunk-MWM2INVY.js";
15
15
 
16
16
  // src/mcp/server.ts
17
17
  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": "0.7.8",
3
+ "version": "0.7.10",
4
4
  "description": "Ferramenta de análise de dependências e impacto para projetos TypeScript/JavaScript. Usa Skott + Knip internamente.",
5
5
  "keywords": [
6
6
  "dependency-analysis",