@justmpm/ai-tool 0.7.3 → 0.7.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.
|
@@ -3503,6 +3503,10 @@ function indexProject(cwd) {
|
|
|
3503
3503
|
const init = varDecl.getInitializer();
|
|
3504
3504
|
if (!init) continue;
|
|
3505
3505
|
const initKind = init.getKind();
|
|
3506
|
+
const initKindName = init.getKindName();
|
|
3507
|
+
if (DEBUG_FUNCTIONS && filePath.includes("functions/src/")) {
|
|
3508
|
+
debugFunctions(`[kind] ${name}: ${initKindName} (kind=${initKind})`);
|
|
3509
|
+
}
|
|
3506
3510
|
if (initKind === SyntaxKind2.ArrowFunction || initKind === SyntaxKind2.FunctionExpression) {
|
|
3507
3511
|
const funcLike = init.asKind(SyntaxKind2.ArrowFunction) || init.asKind(SyntaxKind2.FunctionExpression);
|
|
3508
3512
|
if (!funcLike) continue;
|
|
@@ -3528,15 +3532,14 @@ function indexProject(cwd) {
|
|
|
3528
3532
|
exports.push(name);
|
|
3529
3533
|
}
|
|
3530
3534
|
} else if (initKind === SyntaxKind2.CallExpression) {
|
|
3531
|
-
const triggerName = extractFirebaseTriggerName(init);
|
|
3532
|
-
if (filePath.includes("functions/src/")) {
|
|
3535
|
+
const triggerName = extractFirebaseTriggerName(init, filePath, name);
|
|
3536
|
+
if (DEBUG_FUNCTIONS && filePath.includes("functions/src/")) {
|
|
3533
3537
|
const initText = init.getText().slice(0, 80).replace(/\s+/g, " ");
|
|
3534
3538
|
debugFunctions(`Analisando: ${filePath}:${varDecl.getStartLineNumber()} - ${name} = ${initText}...`);
|
|
3535
3539
|
if (triggerName) {
|
|
3536
|
-
debugFunctions(` \u2713 Trigger detectado: ${triggerName}`);
|
|
3540
|
+
debugFunctions(` \u2713\u2713\u2713 Trigger FINAL detectado: ${triggerName}`);
|
|
3537
3541
|
} else {
|
|
3538
|
-
|
|
3539
|
-
debugFunctions(` \u2717 N\xE3o \xE9 trigger. Texto: ${allText}...`);
|
|
3542
|
+
debugFunctions(` \u2717\u2717\u2717 Nenhum trigger detectado para: ${name}`);
|
|
3540
3543
|
}
|
|
3541
3544
|
}
|
|
3542
3545
|
if (triggerName && FIREBASE_V2_TRIGGERS.has(triggerName)) {
|
|
@@ -3733,11 +3736,22 @@ function inferSymbolKind(name, context2) {
|
|
|
3733
3736
|
}
|
|
3734
3737
|
return context2 === "function" ? "function" : "const";
|
|
3735
3738
|
}
|
|
3736
|
-
function extractFirebaseTriggerName(init) {
|
|
3737
|
-
const text = init.getText();
|
|
3739
|
+
function extractFirebaseTriggerName(init, filePath, varName) {
|
|
3740
|
+
const text = init.getText().trim();
|
|
3741
|
+
const shouldDebug = DEBUG_FUNCTIONS && filePath && filePath.includes("functions/src/");
|
|
3742
|
+
if (shouldDebug && varName) {
|
|
3743
|
+
debugFunctions(` [regex] Analisando texto: "${text.slice(0, 60)}..."`);
|
|
3744
|
+
}
|
|
3738
3745
|
for (const trigger of FIREBASE_V2_TRIGGERS) {
|
|
3739
|
-
const pattern = new RegExp(`(?:^|\\.|\\s)${trigger}(?:<[
|
|
3746
|
+
const pattern = new RegExp(`(?:^|\\.|\\s|\\()${trigger}(?:<[\\s\\S]*?>)?\\s*\\(`);
|
|
3747
|
+
if (shouldDebug && varName) {
|
|
3748
|
+
const testResult = pattern.test(text);
|
|
3749
|
+
debugFunctions(` [regex] Testando ${trigger}: ${testResult ? "\u2713 MATCH" : "\u2717 no match"}`);
|
|
3750
|
+
}
|
|
3740
3751
|
if (pattern.test(text)) {
|
|
3752
|
+
if (shouldDebug && varName) {
|
|
3753
|
+
debugFunctions(` [regex] \u2713\u2713\u2713 TRIGGER ENCONTRADO: ${trigger}`);
|
|
3754
|
+
}
|
|
3741
3755
|
return trigger;
|
|
3742
3756
|
}
|
|
3743
3757
|
}
|
package/dist/cli.js
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
impact,
|
|
14
14
|
map,
|
|
15
15
|
suggest
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-JUKU4SGB.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-
|
|
111
|
+
const { startMcpServer } = await import("./server-52VHXRUA.js");
|
|
112
112
|
await startMcpServer();
|
|
113
113
|
return;
|
|
114
114
|
}
|
package/dist/index.js
CHANGED
package/package.json
CHANGED