@justmpm/ai-tool 0.7.7 → 0.7.8

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.
@@ -1395,6 +1395,7 @@ function calculateFilesHash(cwd) {
1395
1395
  function getCacheDir(cwd) {
1396
1396
  return join2(cwd, CACHE_DIR);
1397
1397
  }
1398
+ var MIN_SCHEMA_VERSION = "2.0.0";
1398
1399
  function isCacheValid(cwd) {
1399
1400
  const cacheDir = getCacheDir(cwd);
1400
1401
  const metaPath = join2(cacheDir, META_FILE);
@@ -1403,6 +1404,9 @@ function isCacheValid(cwd) {
1403
1404
  }
1404
1405
  try {
1405
1406
  const meta = JSON.parse(readFileSync2(metaPath, "utf-8"));
1407
+ if (!meta.schemaVersion || meta.schemaVersion < MIN_SCHEMA_VERSION) {
1408
+ return false;
1409
+ }
1406
1410
  const currentHash = calculateFilesHash(cwd);
1407
1411
  return meta.filesHash === currentHash;
1408
1412
  } catch {
@@ -1431,6 +1435,7 @@ function writeCache(cwd, file, data) {
1431
1435
  function updateCacheMeta(cwd) {
1432
1436
  const meta = {
1433
1437
  version: "1.0.0",
1438
+ schemaVersion: "2.0.0",
1434
1439
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1435
1440
  lastCheck: (/* @__PURE__ */ new Date()).toISOString(),
1436
1441
  filesHash: calculateFilesHash(cwd)
@@ -4772,41 +4777,10 @@ async function functions(options = {}) {
4772
4777
  }
4773
4778
  }
4774
4779
  const functionFiles = Object.values(index.files).filter((f) => f.path.includes("functions/src/"));
4775
- if (process.env.DEBUG_FUNCTIONS === "true" || process.env.DEBUG_ANALYZE === "true") {
4776
- console.error(`
4777
- [functions:debug] \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550`);
4778
- console.error(`[functions:debug] ESTAT\xCDSTICAS DE INDEXA\xC7\xC3O`);
4779
- console.error(`[functions:debug] \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550`);
4780
- console.error(`[functions:debug] Total de arquivos indexados: ${Object.keys(index.files).length}`);
4781
- console.error(`[functions:debug] Arquivos em functions/src/: ${functionFiles.length}`);
4782
- if (functionFiles.length === 0) {
4783
- console.error(`[functions:debug] \u26A0\uFE0F NENHUM arquivo em functions/src/ encontrado!`);
4784
- console.error(`[functions:debug] Listando todos os arquivos indexados:`);
4785
- Object.keys(index.files).slice(0, 20).forEach((f) => {
4786
- console.error(`[functions:debug] - ${f}`);
4787
- });
4788
- }
4789
- functionFiles.forEach((f) => {
4790
- console.error(`
4791
- [functions:debug] \u{1F4C4} ${f.path}`);
4792
- console.error(`[functions:debug] Categoria: ${f.category}`);
4793
- console.error(`[functions:debug] S\xEDmbolos: ${f.symbols.length}`);
4794
- f.symbols.forEach((s) => {
4795
- console.error(`[functions:debug] - ${s.name} [${s.kind}]${s.isExported ? " \u2713" : " \u2717"} (linha ${s.line})`);
4796
- });
4797
- console.error(`[functions:debug] Exports: ${f.exports.join(", ") || "(nenhum)"}`);
4798
- });
4799
- console.error(`[functions:debug] \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
4800
- `);
4801
- }
4802
4780
  const funcs = [];
4803
- let totalSymbolsInFunctions = 0;
4804
- let triggerSymbolsFound = 0;
4805
4781
  for (const fileData of functionFiles) {
4806
- totalSymbolsInFunctions += fileData.symbols.length;
4807
4782
  for (const symbol of fileData.symbols) {
4808
4783
  if (symbol.kind === "trigger") {
4809
- triggerSymbolsFound++;
4810
4784
  funcs.push({
4811
4785
  name: symbol.name,
4812
4786
  file: symbol.file,
@@ -4819,18 +4793,6 @@ async function functions(options = {}) {
4819
4793
  }
4820
4794
  }
4821
4795
  }
4822
- if (funcs.length === 0 && (process.env.DEBUG_FUNCTIONS === "true" || process.env.DEBUG_ANALYZE === "true")) {
4823
- console.error(`[functions:debug] Total de arquivos indexados: ${Object.keys(index.files).length}`);
4824
- console.error(`[functions:debug] Arquivos em functions/src/: ${functionFiles.length}`);
4825
- console.error(`[functions:debug] Total de s\xEDmbolos em functions/src/: ${totalSymbolsInFunctions}`);
4826
- console.error(`[functions:debug] S\xEDmbolos do tipo 'trigger': ${triggerSymbolsFound}`);
4827
- functionFiles.forEach((f) => {
4828
- console.error(`[functions:debug] ${f.path}: ${f.symbols.length} s\xEDmbolos`);
4829
- f.symbols.forEach((s) => {
4830
- console.error(`[functions:debug] - ${s.name} (${s.kind})${s.isExported ? " [exported]" : ""}`);
4831
- });
4832
- });
4833
- }
4834
4796
  const filtered = filterTrigger ? funcs.filter(
4835
4797
  (f) => f.triggerType.toLowerCase().includes(filterTrigger.toLowerCase())
4836
4798
  ) : funcs;
@@ -4907,9 +4869,9 @@ function formatFunctionsText(result) {
4907
4869
  `;
4908
4870
  out += ` 3. Os triggers n\xE3o usam padr\xF5es v2 (onCall, onDocumentCreated, etc)
4909
4871
  `;
4910
- out += ` 4. O cache est\xE1 desatualizado \u2192 tente: ai-tool functions --no-cache
4872
+ out += ` 4. O cache est\xE1 desatualizado (ex: atualizou o ai-tool recentemente)
4911
4873
  `;
4912
- out += ` 5. Para debug: DEBUG_ANALYZE=true ai-tool functions
4874
+ out += ` \u2192 Tente: ai-tool functions --no-cache
4913
4875
 
4914
4876
  `;
4915
4877
  out += ` Padr\xF5es suportados:
package/dist/cli.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  impact,
14
14
  map,
15
15
  suggest
16
- } from "./chunk-KAP6AXYR.js";
16
+ } from "./chunk-DUFJBSFC.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-URBWKWHH.js");
111
+ const { startMcpServer } = await import("./server-TQLA6OF6.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-KAP6AXYR.js";
50
+ } from "./chunk-DUFJBSFC.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-KAP6AXYR.js";
14
+ } from "./chunk-DUFJBSFC.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.7",
3
+ "version": "0.7.8",
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",