@justmpm/ai-tool 0.5.0 → 0.5.2
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.
- package/README.md +40 -0
- package/dist/{chunk-IIUNJRGG.js → chunk-QPC6XJKI.js} +94 -137
- package/dist/cli.js +6 -6
- package/dist/index.d.ts +18 -5
- package/dist/index.js +1 -1
- package/dist/{server-FG4LYSEG.js → server-BD4ZIFRC.js} +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -155,6 +155,46 @@ Cria `.analyze/areas.config.json` com:
|
|
|
155
155
|
- Patterns glob para cada area
|
|
156
156
|
- Keywords de deteccao
|
|
157
157
|
- Descricoes manuais de arquivos
|
|
158
|
+
- Padroes de ignore global
|
|
159
|
+
|
|
160
|
+
### Configuracao de Areas
|
|
161
|
+
|
|
162
|
+
O arquivo `.analyze/areas.config.json` suporta:
|
|
163
|
+
|
|
164
|
+
```json
|
|
165
|
+
{
|
|
166
|
+
"$schema": "./areas.schema.json",
|
|
167
|
+
"version": "1.0.0",
|
|
168
|
+
"ignore": [
|
|
169
|
+
"docs/brainstorming/**",
|
|
170
|
+
"functions/lib/**",
|
|
171
|
+
"**/*.test.ts"
|
|
172
|
+
],
|
|
173
|
+
"areas": {
|
|
174
|
+
"auth": {
|
|
175
|
+
"name": "Autenticacao",
|
|
176
|
+
"description": "Sistema de login e sessao",
|
|
177
|
+
"patterns": ["**/auth/**", "**/login/**"],
|
|
178
|
+
"keywords": ["auth", "login", "session"]
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
"descriptions": {
|
|
182
|
+
"src/hooks/useAuth.ts": "Hook principal de autenticacao"
|
|
183
|
+
},
|
|
184
|
+
"settings": {
|
|
185
|
+
"autoDetect": true,
|
|
186
|
+
"inferDescriptions": true
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
| Campo | Descricao |
|
|
192
|
+
|-------|-----------|
|
|
193
|
+
| `ignore` | Padroes glob para ignorar arquivos/pastas globalmente |
|
|
194
|
+
| `areas` | Definicao manual de areas com patterns e keywords |
|
|
195
|
+
| `descriptions` | Descricoes manuais para arquivos especificos |
|
|
196
|
+
| `settings.autoDetect` | Se `false`, usa apenas areas definidas manualmente |
|
|
197
|
+
| `settings.inferDescriptions` | Infere descricoes automaticamente baseado no nome |
|
|
158
198
|
|
|
159
199
|
## Servidor MCP
|
|
160
200
|
|
|
@@ -760,7 +760,7 @@ function formatAreasText(result) {
|
|
|
760
760
|
`;
|
|
761
761
|
out += `\u{1F4A1} Use 'ai-tool area <nome>' para ver detalhes de uma \xE1rea
|
|
762
762
|
`;
|
|
763
|
-
out += ` Exemplo: ai-tool area
|
|
763
|
+
out += ` Exemplo: ai-tool area auth
|
|
764
764
|
`;
|
|
765
765
|
return out;
|
|
766
766
|
}
|
|
@@ -1079,6 +1079,7 @@ var CONFIG_FILE = "areas.config.json";
|
|
|
1079
1079
|
var DEFAULT_CONFIG = {
|
|
1080
1080
|
$schema: "./areas.schema.json",
|
|
1081
1081
|
version: "1.0.0",
|
|
1082
|
+
ignore: [],
|
|
1082
1083
|
areas: {},
|
|
1083
1084
|
descriptions: {},
|
|
1084
1085
|
settings: {
|
|
@@ -1150,24 +1151,20 @@ import { minimatch } from "minimatch";
|
|
|
1150
1151
|
// src/areas/patterns.ts
|
|
1151
1152
|
var FOLDER_PATTERNS = [
|
|
1152
1153
|
// ============================================================================
|
|
1153
|
-
// NEXT.JS APP ROUTER - Rotas
|
|
1154
|
+
// NEXT.JS APP ROUTER - Rotas genéricas (alta prioridade)
|
|
1154
1155
|
// ============================================================================
|
|
1155
|
-
{ pattern: /app\/.*\/meus-pets\//, area: "meus-pets", priority: 100 },
|
|
1156
|
-
{ pattern: /app\/.*\/pets\//, area: "meus-pets", priority: 100 },
|
|
1157
|
-
{ pattern: /app\/.*\/consultas\//, area: "consultas-ia", priority: 100 },
|
|
1158
1156
|
{ pattern: /app\/.*\/dashboard\//, area: "dashboard", priority: 100 },
|
|
1159
1157
|
{ pattern: /app\/.*\/admin\//, area: "admin", priority: 100 },
|
|
1160
|
-
{ pattern: /app\/.*\/assinatura\//, area: "stripe", priority: 100 },
|
|
1161
|
-
{ pattern: /app\/.*\/guias\//, area: "training", priority: 100 },
|
|
1162
|
-
{ pattern: /app\/.*\/treino\//, area: "training", priority: 100 },
|
|
1163
1158
|
{ pattern: /app\/.*\/login\//, area: "auth", priority: 100 },
|
|
1164
1159
|
{ pattern: /app\/.*\/cadastro\//, area: "auth", priority: 100 },
|
|
1160
|
+
{ pattern: /app\/.*\/signup\//, area: "auth", priority: 100 },
|
|
1161
|
+
{ pattern: /app\/.*\/register\//, area: "auth", priority: 100 },
|
|
1165
1162
|
{ pattern: /app\/.*\/auth\//, area: "auth", priority: 100 },
|
|
1166
1163
|
{ pattern: /app\/.*\/perfil\//, area: "profile", priority: 100 },
|
|
1164
|
+
{ pattern: /app\/.*\/profile\//, area: "profile", priority: 100 },
|
|
1167
1165
|
{ pattern: /app\/.*\/configuracoes\//, area: "settings", priority: 100 },
|
|
1168
1166
|
{ pattern: /app\/.*\/settings\//, area: "settings", priority: 100 },
|
|
1169
1167
|
{ pattern: /app\/.*\/onboarding/, area: "onboarding", priority: 100 },
|
|
1170
|
-
{ pattern: /app\/.*\/beta\//, area: "beta", priority: 100 },
|
|
1171
1168
|
{ pattern: /app\/.*\/precos\//, area: "pricing", priority: 100 },
|
|
1172
1169
|
{ pattern: /app\/.*\/pricing\//, area: "pricing", priority: 100 },
|
|
1173
1170
|
{ pattern: /app\/.*\/checkout\//, area: "checkout", priority: 100 },
|
|
@@ -1185,7 +1182,6 @@ var FOLDER_PATTERNS = [
|
|
|
1185
1182
|
{ pattern: /app\/.*\/faq\//, area: "faq", priority: 100 },
|
|
1186
1183
|
{ pattern: /app\/.*\/help\//, area: "help", priority: 100 },
|
|
1187
1184
|
{ pattern: /app\/.*\/support\//, area: "support", priority: 100 },
|
|
1188
|
-
{ pattern: /app\/.*\/feedback\//, area: "feedback", priority: 100 },
|
|
1189
1185
|
// ============================================================================
|
|
1190
1186
|
// VITE / CRA - src/pages/ ou src/views/ (alta prioridade)
|
|
1191
1187
|
// ============================================================================
|
|
@@ -1238,30 +1234,22 @@ var FOLDER_PATTERNS = [
|
|
|
1238
1234
|
// COMPONENTS - Por subpasta (alta prioridade)
|
|
1239
1235
|
// Funciona em qualquer framework (com ou sem src/)
|
|
1240
1236
|
// ============================================================================
|
|
1241
|
-
{ pattern: /components\/pets\//, area: "meus-pets", priority: 90 },
|
|
1242
|
-
{ pattern: /components\/pet\//, area: "meus-pets", priority: 90 },
|
|
1243
|
-
{ pattern: /components\/consultation\//, area: "consultas-ia", priority: 90 },
|
|
1244
1237
|
{ pattern: /components\/chat\//, area: "chat", priority: 90 },
|
|
1245
|
-
{ pattern: /components\/training\//, area: "training", priority: 90 },
|
|
1246
|
-
{ pattern: /components\/health\//, area: "health-tracking", priority: 90 },
|
|
1247
1238
|
{ pattern: /components\/auth\//, area: "auth", priority: 90 },
|
|
1248
1239
|
{ pattern: /components\/admin\//, area: "admin", priority: 90 },
|
|
1249
1240
|
{ pattern: /components\/landing\//, area: "landing", priority: 90 },
|
|
1250
1241
|
{ pattern: /components\/marketing\//, area: "landing", priority: 90 },
|
|
1251
1242
|
{ pattern: /components\/dashboard\//, area: "dashboard", priority: 90 },
|
|
1252
|
-
{ pattern: /components\/subscription\//, area: "
|
|
1253
|
-
{ pattern: /components\/stripe\//, area: "
|
|
1254
|
-
{ pattern: /components\/payment\//, area: "
|
|
1243
|
+
{ pattern: /components\/subscription\//, area: "billing", priority: 90 },
|
|
1244
|
+
{ pattern: /components\/stripe\//, area: "billing", priority: 90 },
|
|
1245
|
+
{ pattern: /components\/payment\//, area: "billing", priority: 90 },
|
|
1255
1246
|
{ pattern: /components\/checkout\//, area: "checkout", priority: 90 },
|
|
1256
1247
|
{ pattern: /components\/cart\//, area: "cart", priority: 90 },
|
|
1257
1248
|
{ pattern: /components\/notification\//, area: "notifications", priority: 90 },
|
|
1258
|
-
{ pattern: /components\/pdf\//, area: "pdf", priority: 90 },
|
|
1259
1249
|
{ pattern: /components\/seo\//, area: "seo", priority: 90 },
|
|
1260
1250
|
{ pattern: /components\/blog\//, area: "blog", priority: 90 },
|
|
1261
1251
|
{ pattern: /components\/docs\//, area: "docs", priority: 90 },
|
|
1262
1252
|
{ pattern: /components\/legal\//, area: "legal", priority: 90 },
|
|
1263
|
-
{ pattern: /components\/feedback\//, area: "feedback", priority: 90 },
|
|
1264
|
-
{ pattern: /components\/beta\//, area: "beta", priority: 90 },
|
|
1265
1253
|
{ pattern: /components\/onboarding\//, area: "onboarding", priority: 90 },
|
|
1266
1254
|
{ pattern: /components\/settings\//, area: "settings", priority: 90 },
|
|
1267
1255
|
{ pattern: /components\/profile\//, area: "profile", priority: 90 },
|
|
@@ -1281,8 +1269,8 @@ var FOLDER_PATTERNS = [
|
|
|
1281
1269
|
{ pattern: /components\/core\//, area: "shared-ui", priority: 30 },
|
|
1282
1270
|
{ pattern: /components\/primitives\//, area: "shared-ui", priority: 30 },
|
|
1283
1271
|
{ pattern: /components\/providers\//, area: "core", priority: 40 },
|
|
1284
|
-
{ pattern: /components\/layout\//, area: "
|
|
1285
|
-
{ pattern: /components\/layouts\//, area: "
|
|
1272
|
+
{ pattern: /components\/layout\//, area: "layout", priority: 40 },
|
|
1273
|
+
{ pattern: /components\/layouts\//, area: "layout", priority: 40 },
|
|
1286
1274
|
// ============================================================================
|
|
1287
1275
|
// FEATURES (padrão comum em projetos maiores)
|
|
1288
1276
|
// ============================================================================
|
|
@@ -1308,41 +1296,21 @@ var FOLDER_PATTERNS = [
|
|
|
1308
1296
|
// ============================================================================
|
|
1309
1297
|
// LIB - Módulos específicos
|
|
1310
1298
|
// ============================================================================
|
|
1311
|
-
{ pattern: /lib\/firebase
|
|
1312
|
-
{ pattern: /lib\/
|
|
1313
|
-
{ pattern: /lib\/firebase\/firestore\//, area: "firebase-firestore", priority: 85 },
|
|
1314
|
-
{ pattern: /lib\/firebase\/prompts\//, area: "firebase-ai", priority: 85 },
|
|
1315
|
-
{ pattern: /lib\/firebase\/analytics\//, area: "analytics", priority: 85 },
|
|
1316
|
-
{ pattern: /lib\/firebase\//, area: "firebase-core", priority: 80 },
|
|
1317
|
-
{ pattern: /lib\/stripe\//, area: "stripe", priority: 80 },
|
|
1299
|
+
{ pattern: /lib\/firebase\//, area: "firebase", priority: 80 },
|
|
1300
|
+
{ pattern: /lib\/stripe\//, area: "billing", priority: 80 },
|
|
1318
1301
|
{ pattern: /lib\/i18n\//, area: "i18n", priority: 80 },
|
|
1302
|
+
{ pattern: /lib\/analytics\//, area: "analytics", priority: 80 },
|
|
1319
1303
|
// ============================================================================
|
|
1320
|
-
// HOOKS - Por nome
|
|
1304
|
+
// HOOKS - Por nome genérico
|
|
1321
1305
|
// ============================================================================
|
|
1322
|
-
{ pattern: /hooks\/.*[Pp]et/, area: "meus-pets", priority: 70 },
|
|
1323
1306
|
{ pattern: /hooks\/.*[Aa]uth/, area: "auth", priority: 70 },
|
|
1324
|
-
{ pattern: /hooks\/.*[Ss]ubscription/, area: "
|
|
1307
|
+
{ pattern: /hooks\/.*[Ss]ubscription/, area: "billing", priority: 70 },
|
|
1325
1308
|
{ pattern: /hooks\/.*[Nn]otification/, area: "notifications", priority: 70 },
|
|
1326
|
-
{ pattern: /hooks\/.*[Hh]ealth/, area: "health-tracking", priority: 70 },
|
|
1327
|
-
{ pattern: /hooks\/.*[Tt]raining/, area: "training", priority: 70 },
|
|
1328
1309
|
// ============================================================================
|
|
1329
|
-
// STORE - Por nome
|
|
1310
|
+
// STORE - Por nome genérico
|
|
1330
1311
|
// ============================================================================
|
|
1331
|
-
{ pattern: /store\/.*[Pp]et/, area: "meus-pets", priority: 70 },
|
|
1332
1312
|
{ pattern: /store\/.*[Aa]uth/, area: "auth", priority: 70 },
|
|
1333
|
-
{ pattern: /store\/.*[Uu]ser/, area: "
|
|
1334
|
-
// ============================================================================
|
|
1335
|
-
// SCHEMAS - Por nome
|
|
1336
|
-
// ============================================================================
|
|
1337
|
-
{ pattern: /schemas\/.*[Pp]et/, area: "meus-pets", priority: 70 },
|
|
1338
|
-
{ pattern: /schemas\/.*[Aa]uth/, area: "auth", priority: 70 },
|
|
1339
|
-
// ============================================================================
|
|
1340
|
-
// TYPES - Por nome
|
|
1341
|
-
// ============================================================================
|
|
1342
|
-
{ pattern: /types\/.*[Pp]et/, area: "meus-pets", priority: 70 },
|
|
1343
|
-
{ pattern: /types\/.*[Aa]uth/, area: "auth", priority: 70 },
|
|
1344
|
-
{ pattern: /types\/.*[Ss]tripe/, area: "stripe", priority: 70 },
|
|
1345
|
-
{ pattern: /types\/.*[Ss]ubscription/, area: "stripe", priority: 70 },
|
|
1313
|
+
{ pattern: /store\/.*[Uu]ser/, area: "user", priority: 70 },
|
|
1346
1314
|
// ============================================================================
|
|
1347
1315
|
// CLOUD FUNCTIONS
|
|
1348
1316
|
// ============================================================================
|
|
@@ -1352,83 +1320,61 @@ var FOLDER_PATTERNS = [
|
|
|
1352
1320
|
// ============================================================================
|
|
1353
1321
|
{ pattern: /messages\//, area: "i18n", priority: 60 },
|
|
1354
1322
|
{ pattern: /i18n\//, area: "i18n", priority: 60 },
|
|
1323
|
+
{ pattern: /locales\//, area: "i18n", priority: 60 },
|
|
1355
1324
|
{ pattern: /public\//, area: "assets", priority: 50 },
|
|
1356
1325
|
{ pattern: /scripts\//, area: "scripts", priority: 50 }
|
|
1357
1326
|
];
|
|
1358
1327
|
var KEYWORD_PATTERNS = [
|
|
1359
|
-
//
|
|
1360
|
-
{ keyword: /[
|
|
1361
|
-
|
|
1362
|
-
{ keyword: /[Dd]eworm/, area: "meus-pets", priority: 60 },
|
|
1363
|
-
{ keyword: /[Mm]edication/, area: "meus-pets", priority: 60 },
|
|
1364
|
-
{ keyword: /[Ss]urgery/, area: "meus-pets", priority: 60 },
|
|
1365
|
-
{ keyword: /[Vv]eterinary/, area: "meus-pets", priority: 60 },
|
|
1366
|
-
// Consultas IA
|
|
1367
|
-
{ keyword: /[Cc]onsultation/, area: "consultas-ia", priority: 60 },
|
|
1368
|
-
{ keyword: /[Cc]hat/, area: "consultas-ia", priority: 50 },
|
|
1369
|
-
{ keyword: /[Gg]emini/, area: "firebase-ai", priority: 60 },
|
|
1370
|
-
// Health
|
|
1371
|
-
{ keyword: /[Hh]ealth[Tt]racking/, area: "health-tracking", priority: 65 },
|
|
1372
|
-
{ keyword: /[Hh]ome[Cc]are/, area: "health-tracking", priority: 65 },
|
|
1373
|
-
// Training
|
|
1374
|
-
{ keyword: /[Tt]raining/, area: "training", priority: 60 },
|
|
1375
|
-
{ keyword: /[Gg]uide/, area: "training", priority: 55 },
|
|
1376
|
-
{ keyword: /[Aa]destramento/, area: "training", priority: 60 },
|
|
1377
|
-
// Auth
|
|
1378
|
-
{ keyword: /[Aa]uth/, area: "auth", priority: 60 },
|
|
1328
|
+
// Auth (genérico)
|
|
1329
|
+
{ keyword: /[Aa]uth(?!or)/, area: "auth", priority: 60 },
|
|
1330
|
+
// auth mas não author
|
|
1379
1331
|
{ keyword: /[Ll]ogin/, area: "auth", priority: 60 },
|
|
1380
1332
|
{ keyword: /[Rr]egister/, area: "auth", priority: 60 },
|
|
1381
1333
|
{ keyword: /[Ss]ignup/, area: "auth", priority: 60 },
|
|
1382
1334
|
{ keyword: /[Ss]ignin/, area: "auth", priority: 60 },
|
|
1383
|
-
|
|
1384
|
-
{ keyword: /[
|
|
1385
|
-
|
|
1386
|
-
{ keyword: /[
|
|
1387
|
-
{ keyword: /[
|
|
1388
|
-
{ keyword: /[Pp]
|
|
1335
|
+
{ keyword: /[Ss]ignout/, area: "auth", priority: 60 },
|
|
1336
|
+
{ keyword: /[Ll]ogout/, area: "auth", priority: 60 },
|
|
1337
|
+
// Billing/Payments (genérico)
|
|
1338
|
+
{ keyword: /[Ss]tripe/, area: "billing", priority: 65 },
|
|
1339
|
+
{ keyword: /[Ss]ubscription/, area: "billing", priority: 60 },
|
|
1340
|
+
{ keyword: /[Pp]ayment/, area: "billing", priority: 60 },
|
|
1341
|
+
{ keyword: /[Bb]illing/, area: "billing", priority: 65 },
|
|
1342
|
+
{ keyword: /[Ii]nvoice/, area: "billing", priority: 60 },
|
|
1343
|
+
// Checkout (genérico)
|
|
1344
|
+
{ keyword: /[Cc]heckout/, area: "checkout", priority: 60 },
|
|
1345
|
+
// Pricing (genérico)
|
|
1389
1346
|
{ keyword: /[Pp]ricing/, area: "pricing", priority: 60 },
|
|
1390
|
-
// Notifications
|
|
1347
|
+
// Notifications (genérico)
|
|
1391
1348
|
{ keyword: /[Nn]otification/, area: "notifications", priority: 60 },
|
|
1392
1349
|
{ keyword: /[Ff][Cc][Mm]/, area: "notifications", priority: 65 },
|
|
1393
|
-
|
|
1394
|
-
// i18n
|
|
1350
|
+
// i18n (genérico)
|
|
1395
1351
|
{ keyword: /[Ii]18n/, area: "i18n", priority: 60 },
|
|
1396
1352
|
{ keyword: /[Ll]ocale/, area: "i18n", priority: 55 },
|
|
1397
1353
|
{ keyword: /[Tt]ranslat/, area: "i18n", priority: 55 },
|
|
1398
|
-
// SEO
|
|
1354
|
+
// SEO (genérico)
|
|
1399
1355
|
{ keyword: /[Ss][Ee][Oo]/, area: "seo", priority: 60 },
|
|
1400
1356
|
{ keyword: /[Ss]itemap/, area: "seo", priority: 60 },
|
|
1401
|
-
|
|
1402
|
-
// Analytics
|
|
1357
|
+
// Analytics (genérico)
|
|
1403
1358
|
{ keyword: /[Aa]nalytics/, area: "analytics", priority: 60 },
|
|
1404
|
-
|
|
1405
|
-
{ keyword: /[
|
|
1406
|
-
//
|
|
1407
|
-
{ keyword: /[Aa]dmin/, area: "admin", priority: 60 },
|
|
1408
|
-
// PWA
|
|
1359
|
+
// Admin (genérico)
|
|
1360
|
+
{ keyword: /[Aa]dmin/, area: "admin", priority: 55 },
|
|
1361
|
+
// PWA (genérico)
|
|
1409
1362
|
{ keyword: /[Pp][Ww][Aa]/, area: "pwa", priority: 60 },
|
|
1410
1363
|
{ keyword: /[Ss]ervice[Ww]orker/, area: "pwa", priority: 60 },
|
|
1411
1364
|
{ keyword: /[Mm]anifest/, area: "pwa", priority: 55 },
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
{ keyword: /[
|
|
1415
|
-
{ keyword: /[Rr]eport/, area: "pdf", priority: 50 }
|
|
1365
|
+
// PDF (genérico)
|
|
1366
|
+
{ keyword: /[Pp]df[Ee]xport/, area: "export", priority: 60 },
|
|
1367
|
+
{ keyword: /[Dd]ocx[Ee]xport/, area: "export", priority: 60 }
|
|
1416
1368
|
];
|
|
1417
1369
|
var AREA_NAMES = {
|
|
1418
|
-
// Áreas específicas de domínio
|
|
1419
|
-
"meus-pets": "Meus Pets",
|
|
1420
|
-
"consultas-ia": "Consultas IA",
|
|
1421
|
-
"health-tracking": "Health Tracking",
|
|
1422
|
-
training: "Adestramento",
|
|
1423
1370
|
// Autenticação e usuário
|
|
1424
1371
|
auth: "Autentica\xE7\xE3o",
|
|
1425
1372
|
user: "Usu\xE1rio",
|
|
1426
1373
|
profile: "Perfil",
|
|
1427
1374
|
settings: "Configura\xE7\xF5es",
|
|
1428
1375
|
onboarding: "Onboarding",
|
|
1429
|
-
// E-commerce
|
|
1430
|
-
|
|
1431
|
-
payments: "Pagamentos",
|
|
1376
|
+
// E-commerce / Billing
|
|
1377
|
+
billing: "Pagamentos",
|
|
1432
1378
|
checkout: "Checkout",
|
|
1433
1379
|
cart: "Carrinho",
|
|
1434
1380
|
shop: "Loja",
|
|
@@ -1444,9 +1390,7 @@ var AREA_NAMES = {
|
|
|
1444
1390
|
faq: "FAQ",
|
|
1445
1391
|
contact: "Contato",
|
|
1446
1392
|
// Firebase
|
|
1447
|
-
|
|
1448
|
-
"firebase-ai": "Firebase AI",
|
|
1449
|
-
"firebase-firestore": "Firestore",
|
|
1393
|
+
firebase: "Firebase",
|
|
1450
1394
|
// Conteúdo
|
|
1451
1395
|
blog: "Blog",
|
|
1452
1396
|
docs: "Documenta\xE7\xE3o",
|
|
@@ -1456,16 +1400,16 @@ var AREA_NAMES = {
|
|
|
1456
1400
|
landing: "Landing Pages",
|
|
1457
1401
|
seo: "SEO",
|
|
1458
1402
|
analytics: "Analytics",
|
|
1459
|
-
beta: "Programa Beta",
|
|
1460
1403
|
// Admin e Dashboard
|
|
1461
1404
|
admin: "Admin",
|
|
1462
1405
|
dashboard: "Dashboard",
|
|
1463
1406
|
// Técnico
|
|
1464
1407
|
i18n: "Internacionaliza\xE7\xE3o",
|
|
1465
1408
|
pwa: "PWA",
|
|
1466
|
-
|
|
1409
|
+
export: "Exporta\xE7\xE3o",
|
|
1467
1410
|
core: "Core",
|
|
1468
|
-
|
|
1411
|
+
layout: "Layout",
|
|
1412
|
+
"shared-ui": "UI Compartilhada",
|
|
1469
1413
|
"cloud-functions": "Cloud Functions",
|
|
1470
1414
|
assets: "Assets",
|
|
1471
1415
|
scripts: "Scripts",
|
|
@@ -1477,77 +1421,85 @@ var AREA_NAMES = {
|
|
|
1477
1421
|
app: "Aplica\xE7\xE3o"
|
|
1478
1422
|
};
|
|
1479
1423
|
var AREA_DESCRIPTIONS = {
|
|
1480
|
-
// Áreas específicas de domínio
|
|
1481
|
-
"meus-pets": "Gerenciamento completo de pets do usu\xE1rio",
|
|
1482
|
-
"consultas-ia": "Chat com IA para consultas veterin\xE1rias",
|
|
1483
|
-
"health-tracking": "Acompanhamento de sa\xFAde e sintomas",
|
|
1484
|
-
training: "Sistema de adestramento com guias e progresso",
|
|
1485
1424
|
// Autenticação e usuário
|
|
1486
1425
|
auth: "Autentica\xE7\xE3o e gerenciamento de sess\xE3o",
|
|
1487
1426
|
user: "Gerenciamento de dados do usu\xE1rio",
|
|
1488
1427
|
profile: "Perfil do usu\xE1rio",
|
|
1489
1428
|
settings: "Configura\xE7\xF5es do usu\xE1rio",
|
|
1490
1429
|
onboarding: "Fluxo de onboarding de novos usu\xE1rios",
|
|
1491
|
-
// E-commerce
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
checkout: "Fluxo de checkout e finaliza\xE7\xE3o de compra",
|
|
1430
|
+
// E-commerce / Billing
|
|
1431
|
+
billing: "Sistema de pagamentos e assinaturas",
|
|
1432
|
+
checkout: "Fluxo de checkout e finaliza\xE7\xE3o",
|
|
1495
1433
|
cart: "Carrinho de compras",
|
|
1496
|
-
shop: "Loja e cat\xE1logo
|
|
1434
|
+
shop: "Loja e cat\xE1logo",
|
|
1497
1435
|
products: "Gerenciamento de produtos",
|
|
1498
1436
|
orders: "Gerenciamento de pedidos",
|
|
1499
1437
|
pricing: "P\xE1gina de pre\xE7os e planos",
|
|
1500
1438
|
// Comunicação
|
|
1501
|
-
notifications: "Sistema de notifica\xE7\xF5es
|
|
1439
|
+
notifications: "Sistema de notifica\xE7\xF5es",
|
|
1502
1440
|
chat: "Sistema de chat e mensagens",
|
|
1503
|
-
feedback: "Coleta de feedback
|
|
1441
|
+
feedback: "Coleta de feedback",
|
|
1504
1442
|
support: "Suporte ao cliente",
|
|
1505
1443
|
help: "Central de ajuda",
|
|
1506
1444
|
faq: "Perguntas frequentes",
|
|
1507
1445
|
contact: "P\xE1gina de contato",
|
|
1508
1446
|
// Firebase
|
|
1509
|
-
|
|
1510
|
-
"firebase-ai": "Integra\xE7\xE3o com Firebase AI (Gemini)",
|
|
1511
|
-
"firebase-firestore": "Opera\xE7\xF5es CRUD no Firestore",
|
|
1447
|
+
firebase: "Configura\xE7\xE3o e servi\xE7os Firebase",
|
|
1512
1448
|
// Conteúdo
|
|
1513
1449
|
blog: "Blog e artigos",
|
|
1514
1450
|
docs: "Documenta\xE7\xE3o e guias",
|
|
1515
1451
|
legal: "Termos de uso, privacidade e pol\xEDticas",
|
|
1516
|
-
about: "P\xE1gina sobre
|
|
1452
|
+
about: "P\xE1gina sobre",
|
|
1517
1453
|
// Marketing e SEO
|
|
1518
1454
|
landing: "Landing pages e marketing",
|
|
1519
1455
|
seo: "SEO, meta tags e sitemaps",
|
|
1520
|
-
analytics: "Analytics e tracking
|
|
1521
|
-
beta: "Programa de beta testers",
|
|
1456
|
+
analytics: "Analytics e tracking",
|
|
1522
1457
|
// Admin e Dashboard
|
|
1523
1458
|
admin: "Painel administrativo",
|
|
1524
1459
|
dashboard: "Dashboard do usu\xE1rio",
|
|
1525
1460
|
// Técnico
|
|
1526
1461
|
i18n: "Internacionaliza\xE7\xE3o e tradu\xE7\xF5es",
|
|
1527
|
-
pwa: "Progressive Web App
|
|
1528
|
-
|
|
1529
|
-
core: "Providers e
|
|
1462
|
+
pwa: "Progressive Web App",
|
|
1463
|
+
export: "Exporta\xE7\xE3o de documentos",
|
|
1464
|
+
core: "Providers e configura\xE7\xE3o principal",
|
|
1465
|
+
layout: "Layout e navega\xE7\xE3o",
|
|
1530
1466
|
"shared-ui": "Componentes de UI compartilhados",
|
|
1531
1467
|
"cloud-functions": "Cloud Functions (serverless)",
|
|
1532
|
-
assets: "Assets p\xFAblicos
|
|
1468
|
+
assets: "Assets p\xFAblicos",
|
|
1533
1469
|
scripts: "Scripts de automa\xE7\xE3o",
|
|
1534
1470
|
// UI patterns
|
|
1535
|
-
forms: "Componentes de formul\xE1rio
|
|
1536
|
-
tables: "Componentes de tabela
|
|
1537
|
-
modals: "Modais e dialogs
|
|
1471
|
+
forms: "Componentes de formul\xE1rio",
|
|
1472
|
+
tables: "Componentes de tabela",
|
|
1473
|
+
modals: "Modais e dialogs",
|
|
1538
1474
|
// Genéricos
|
|
1539
1475
|
app: "\xC1rea principal da aplica\xE7\xE3o"
|
|
1540
1476
|
};
|
|
1541
1477
|
|
|
1542
1478
|
// src/areas/detector.ts
|
|
1479
|
+
function isFileIgnored(filePath, config) {
|
|
1480
|
+
const ignorePatterns = config.ignore || [];
|
|
1481
|
+
if (ignorePatterns.length === 0) return false;
|
|
1482
|
+
const normalizedPath = filePath.replace(/\\/g, "/");
|
|
1483
|
+
for (const pattern of ignorePatterns) {
|
|
1484
|
+
if (minimatch(normalizedPath, pattern, { dot: true })) {
|
|
1485
|
+
return true;
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
return false;
|
|
1489
|
+
}
|
|
1543
1490
|
function detectFileAreas(filePath, config) {
|
|
1544
1491
|
const normalizedPath = filePath.replace(/\\/g, "/");
|
|
1545
1492
|
const matches = [];
|
|
1493
|
+
const autoDetect = config.settings?.autoDetect !== false;
|
|
1546
1494
|
for (const [areaId, areaConfig] of Object.entries(config.areas)) {
|
|
1547
1495
|
if (matchesAreaConfig(normalizedPath, areaConfig)) {
|
|
1548
1496
|
matches.push({ area: areaId, priority: 200, source: "config" });
|
|
1549
1497
|
}
|
|
1550
1498
|
}
|
|
1499
|
+
if (!autoDetect) {
|
|
1500
|
+
const unique2 = [...new Set(matches.map((m) => m.area))];
|
|
1501
|
+
return unique2;
|
|
1502
|
+
}
|
|
1551
1503
|
for (const { pattern, area: area2, priority } of FOLDER_PATTERNS) {
|
|
1552
1504
|
if (pattern.test(normalizedPath)) {
|
|
1553
1505
|
if (!matches.some((m) => m.area === area2 && m.source === "config")) {
|
|
@@ -1782,6 +1734,9 @@ function detectAreasInfo(cwd, filePaths) {
|
|
|
1782
1734
|
const areaSet = /* @__PURE__ */ new Set();
|
|
1783
1735
|
let unmappedCount = 0;
|
|
1784
1736
|
for (const filePath of filePaths) {
|
|
1737
|
+
if (isFileIgnored(filePath, config)) {
|
|
1738
|
+
continue;
|
|
1739
|
+
}
|
|
1785
1740
|
const areas2 = detectFileAreas(filePath, config);
|
|
1786
1741
|
if (areas2.length === 0) {
|
|
1787
1742
|
unmappedCount++;
|
|
@@ -2864,9 +2819,10 @@ async function areas(options = {}) {
|
|
|
2864
2819
|
try {
|
|
2865
2820
|
const config = readConfig(cwd);
|
|
2866
2821
|
const allFiles = getAllCodeFiles2(cwd);
|
|
2822
|
+
const filteredFiles = allFiles.filter((filePath) => !isFileIgnored(filePath, config));
|
|
2867
2823
|
const areaMap = /* @__PURE__ */ new Map();
|
|
2868
2824
|
const unmapped = [];
|
|
2869
|
-
for (const filePath of
|
|
2825
|
+
for (const filePath of filteredFiles) {
|
|
2870
2826
|
const category = detectCategory(filePath);
|
|
2871
2827
|
const areas2 = detectFileAreas(filePath, config);
|
|
2872
2828
|
let description = getFileDescription(cwd, filePath);
|
|
@@ -2914,7 +2870,7 @@ async function areas(options = {}) {
|
|
|
2914
2870
|
unmapped,
|
|
2915
2871
|
summary: {
|
|
2916
2872
|
totalAreas: detectedAreas.length,
|
|
2917
|
-
totalFiles:
|
|
2873
|
+
totalFiles: filteredFiles.length,
|
|
2918
2874
|
unmappedCount: unmapped.length
|
|
2919
2875
|
}
|
|
2920
2876
|
};
|
|
@@ -2976,14 +2932,15 @@ async function area(target, options = {}) {
|
|
|
2976
2932
|
const filterType = options.type;
|
|
2977
2933
|
const full = options.full ?? false;
|
|
2978
2934
|
if (!target) {
|
|
2979
|
-
throw new Error("Nome da \xE1rea \xE9 obrigat\xF3rio. Exemplo: ai-tool area
|
|
2935
|
+
throw new Error("Nome da \xE1rea \xE9 obrigat\xF3rio. Exemplo: ai-tool area auth");
|
|
2980
2936
|
}
|
|
2981
2937
|
try {
|
|
2982
2938
|
const config = readConfig(cwd);
|
|
2983
2939
|
const allFiles = getAllCodeFiles3(cwd);
|
|
2940
|
+
const filteredFiles = allFiles.filter((filePath) => !isFileIgnored(filePath, config));
|
|
2984
2941
|
const areaFiles = [];
|
|
2985
2942
|
const targetLower = target.toLowerCase();
|
|
2986
|
-
for (const filePath of
|
|
2943
|
+
for (const filePath of filteredFiles) {
|
|
2987
2944
|
const fileAreas = detectFileAreas(filePath, config);
|
|
2988
2945
|
const belongsToArea = fileAreas.some(
|
|
2989
2946
|
(a) => a.toLowerCase() === targetLower || a.toLowerCase().includes(targetLower)
|
|
@@ -3005,7 +2962,7 @@ async function area(target, options = {}) {
|
|
|
3005
2962
|
}
|
|
3006
2963
|
}
|
|
3007
2964
|
if (areaFiles.length === 0) {
|
|
3008
|
-
const availableAreas = getAvailableAreas(
|
|
2965
|
+
const availableAreas = getAvailableAreas(filteredFiles, config);
|
|
3009
2966
|
return formatAreaNotFound(target, availableAreas);
|
|
3010
2967
|
}
|
|
3011
2968
|
const byCategory = {};
|
|
@@ -3020,7 +2977,7 @@ async function area(target, options = {}) {
|
|
|
3020
2977
|
for (const cat of Object.keys(byCategory)) {
|
|
3021
2978
|
byCategory[cat].sort((a, b) => a.path.localeCompare(b.path));
|
|
3022
2979
|
}
|
|
3023
|
-
const realAreaId = findRealAreaId(target,
|
|
2980
|
+
const realAreaId = findRealAreaId(target, filteredFiles, config);
|
|
3024
2981
|
const detectedArea = {
|
|
3025
2982
|
id: realAreaId || target,
|
|
3026
2983
|
name: getAreaName(realAreaId || target, config),
|
|
@@ -3095,7 +3052,7 @@ function formatAreaNotFound(target, availableAreas) {
|
|
|
3095
3052
|
}
|
|
3096
3053
|
out += `\u{1F4A1} Dicas:
|
|
3097
3054
|
`;
|
|
3098
|
-
out += ` - Use o ID exato da \xE1rea (ex: ai-tool area
|
|
3055
|
+
out += ` - Use o ID exato da \xE1rea (ex: ai-tool area auth)
|
|
3099
3056
|
`;
|
|
3100
3057
|
out += ` - Use 'ai-tool areas' para listar todas as \xE1reas
|
|
3101
3058
|
`;
|
package/dist/cli.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
impact,
|
|
11
11
|
map,
|
|
12
12
|
suggest
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-QPC6XJKI.js";
|
|
14
14
|
|
|
15
15
|
// src/cli.ts
|
|
16
16
|
var HELP = `
|
|
@@ -62,9 +62,9 @@ EXEMPLOS:
|
|
|
62
62
|
ai-tool context Button
|
|
63
63
|
ai-tool areas
|
|
64
64
|
ai-tool areas init
|
|
65
|
-
ai-tool area
|
|
66
|
-
ai-tool area
|
|
67
|
-
ai-tool area
|
|
65
|
+
ai-tool area auth
|
|
66
|
+
ai-tool area auth --type=hook
|
|
67
|
+
ai-tool area dashboard --full
|
|
68
68
|
ai-tool --mcp
|
|
69
69
|
|
|
70
70
|
SOBRE:
|
|
@@ -87,7 +87,7 @@ async function main() {
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
if (flags.mcp) {
|
|
90
|
-
const { startMcpServer } = await import("./server-
|
|
90
|
+
const { startMcpServer } = await import("./server-BD4ZIFRC.js");
|
|
91
91
|
await startMcpServer();
|
|
92
92
|
return;
|
|
93
93
|
}
|
|
@@ -159,7 +159,7 @@ async function main() {
|
|
|
159
159
|
case "area":
|
|
160
160
|
if (!target) {
|
|
161
161
|
console.error("\u274C Erro: nome da \xE1rea \xE9 obrigat\xF3rio para o comando area");
|
|
162
|
-
console.error(" Exemplo: ai-tool area
|
|
162
|
+
console.error(" Exemplo: ai-tool area auth");
|
|
163
163
|
console.error(" Use 'ai-tool areas' para listar \xE1reas dispon\xEDveis");
|
|
164
164
|
process.exit(1);
|
|
165
165
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -169,6 +169,7 @@ interface AreaConfig {
|
|
|
169
169
|
interface AreasConfigFile {
|
|
170
170
|
$schema?: string;
|
|
171
171
|
version: string;
|
|
172
|
+
ignore?: string[];
|
|
172
173
|
areas: Record<string, AreaConfig>;
|
|
173
174
|
descriptions?: Record<string, string>;
|
|
174
175
|
settings?: {
|
|
@@ -418,13 +419,17 @@ declare function getFileDescription(cwd: string, filePath: string): string | und
|
|
|
418
419
|
*
|
|
419
420
|
* Detecta automaticamente a área de cada arquivo baseado em:
|
|
420
421
|
* 1. Configuração manual (areas.config.json)
|
|
421
|
-
* 2. Padrões de pasta
|
|
422
|
-
* 3. Keywords no nome
|
|
422
|
+
* 2. Padrões de pasta (se autoDetect estiver habilitado)
|
|
423
|
+
* 3. Keywords no nome (se autoDetect estiver habilitado)
|
|
423
424
|
*/
|
|
424
425
|
|
|
425
426
|
/**
|
|
426
427
|
* Detecta a(s) área(s) de um arquivo
|
|
427
428
|
* Retorna array porque um arquivo pode pertencer a múltiplas áreas
|
|
429
|
+
*
|
|
430
|
+
* Respeita settings.autoDetect:
|
|
431
|
+
* - true (default): usa config + padrões automáticos
|
|
432
|
+
* - false: usa APENAS a configuração manual
|
|
428
433
|
*/
|
|
429
434
|
declare function detectFileAreas(filePath: string, config: AreasConfigFile): string[];
|
|
430
435
|
/**
|
|
@@ -443,10 +448,13 @@ declare function inferFileDescription(filePath: string, category: FileCategory):
|
|
|
443
448
|
/**
|
|
444
449
|
* Padrões de detecção automática de áreas
|
|
445
450
|
*
|
|
446
|
-
* Define regras para detectar áreas baseado em:
|
|
451
|
+
* Define regras GENÉRICAS para detectar áreas baseado em:
|
|
447
452
|
* - Padrões de pasta (glob)
|
|
448
453
|
* - Keywords no nome do arquivo
|
|
449
454
|
*
|
|
455
|
+
* IMPORTANTE: Estes padrões são usados apenas quando autoDetect: true
|
|
456
|
+
* Para projetos específicos, use areas.config.json com autoDetect: false
|
|
457
|
+
*
|
|
450
458
|
* Suporta múltiplos frameworks:
|
|
451
459
|
* - Next.js (App Router e Pages Router)
|
|
452
460
|
* - Vite (React, Vue)
|
|
@@ -459,6 +467,9 @@ declare function inferFileDescription(filePath: string, category: FileCategory):
|
|
|
459
467
|
/**
|
|
460
468
|
* Padrões de pasta → área
|
|
461
469
|
* Ordem importa: mais específico primeiro
|
|
470
|
+
*
|
|
471
|
+
* NOTA: Apenas padrões genéricos que funcionam em qualquer projeto
|
|
472
|
+
* Evitar padrões específicos de domínio (ex: pets, veterinary, etc)
|
|
462
473
|
*/
|
|
463
474
|
declare const FOLDER_PATTERNS: Array<{
|
|
464
475
|
pattern: RegExp;
|
|
@@ -467,6 +478,8 @@ declare const FOLDER_PATTERNS: Array<{
|
|
|
467
478
|
}>;
|
|
468
479
|
/**
|
|
469
480
|
* Keywords no nome do arquivo → área
|
|
481
|
+
*
|
|
482
|
+
* NOTA: Apenas keywords genéricas que não são específicas de domínio
|
|
470
483
|
*/
|
|
471
484
|
declare const KEYWORD_PATTERNS: Array<{
|
|
472
485
|
keyword: RegExp;
|
|
@@ -474,11 +487,11 @@ declare const KEYWORD_PATTERNS: Array<{
|
|
|
474
487
|
priority: number;
|
|
475
488
|
}>;
|
|
476
489
|
/**
|
|
477
|
-
* Nomes amigáveis das áreas
|
|
490
|
+
* Nomes amigáveis das áreas (genéricos)
|
|
478
491
|
*/
|
|
479
492
|
declare const AREA_NAMES: Record<string, string>;
|
|
480
493
|
/**
|
|
481
|
-
* Descrições padrão das áreas
|
|
494
|
+
* Descrições padrão das áreas (genéricas)
|
|
482
495
|
*/
|
|
483
496
|
declare const AREA_DESCRIPTIONS: Record<string, string>;
|
|
484
497
|
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
impact,
|
|
9
9
|
map,
|
|
10
10
|
suggest
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-QPC6XJKI.js";
|
|
12
12
|
|
|
13
13
|
// src/mcp/server.ts
|
|
14
14
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
@@ -263,7 +263,7 @@ server.registerTool(
|
|
|
263
263
|
description: `Mostra arquivos de uma area especifica, agrupados por categoria.
|
|
264
264
|
Parametros: target (nome da area), type (filtrar categoria), full (todos arquivos).`,
|
|
265
265
|
inputSchema: {
|
|
266
|
-
target: z.string().min(1).describe("Nome da area:
|
|
266
|
+
target: z.string().min(1).describe("Nome da area: auth, dashboard, billing, etc"),
|
|
267
267
|
type: z.enum([
|
|
268
268
|
"page",
|
|
269
269
|
"layout",
|
package/package.json
CHANGED