@semacode/cli 1.2.12 → 1.3.0

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.
Files changed (128) hide show
  1. package/README.md +2 -2
  2. package/dist/index.js +76 -25
  3. package/dist/projeto.js +4 -1
  4. package/package.json +17 -34
  5. package/src/cpp-symbols.ts +82 -0
  6. package/src/dotnet-http.ts +355 -0
  7. package/src/drift.ts +2455 -0
  8. package/src/go-http.ts +118 -0
  9. package/src/importador.ts +3448 -0
  10. package/src/index.ts +4470 -0
  11. package/src/java-http.ts +247 -0
  12. package/src/projeto.ts +810 -0
  13. package/src/python-http.ts +258 -0
  14. package/src/rust-http.ts +125 -0
  15. package/src/tipos.ts +22 -0
  16. package/src/typescript-http.ts +1076 -0
  17. package/tsconfig.json +20 -0
  18. package/AGENTS.md +0 -50
  19. package/LICENSE +0 -22
  20. package/SEMA_BRIEF.curto.txt +0 -9
  21. package/SEMA_BRIEF.md +0 -49
  22. package/SEMA_BRIEF.micro.txt +0 -7
  23. package/SEMA_INDEX.json +0 -501
  24. package/dist/cpp-symbols.d.ts +0 -10
  25. package/dist/cpp-symbols.js.map +0 -1
  26. package/dist/dotnet-http.d.ts +0 -23
  27. package/dist/dotnet-http.js.map +0 -1
  28. package/dist/drift.d.ts +0 -118
  29. package/dist/drift.js.map +0 -1
  30. package/dist/go-http.d.ts +0 -23
  31. package/dist/go-http.js.map +0 -1
  32. package/dist/importador.d.ts +0 -29
  33. package/dist/importador.js.map +0 -1
  34. package/dist/index.d.ts +0 -2
  35. package/dist/index.js.map +0 -1
  36. package/dist/java-http.d.ts +0 -23
  37. package/dist/java-http.js.map +0 -1
  38. package/dist/lua-symbols.d.ts +0 -8
  39. package/dist/lua-symbols.js.map +0 -1
  40. package/dist/projeto.d.ts +0 -48
  41. package/dist/projeto.js.map +0 -1
  42. package/dist/python-http.d.ts +0 -23
  43. package/dist/python-http.js.map +0 -1
  44. package/dist/rust-http.d.ts +0 -23
  45. package/dist/rust-http.js.map +0 -1
  46. package/dist/tipos.d.ts +0 -3
  47. package/dist/tipos.js.map +0 -1
  48. package/dist/typescript-http.d.ts +0 -35
  49. package/dist/typescript-http.js.map +0 -1
  50. package/docs/AGENT_STARTER.md +0 -102
  51. package/docs/como-ensinar-a-sema-para-ia.md +0 -149
  52. package/docs/fluxo-pratico-ia-sema.md +0 -177
  53. package/docs/instalacao-e-primeiro-uso.md +0 -196
  54. package/docs/integracao-com-ia.md +0 -228
  55. package/docs/pagamento-ponta-a-ponta.md +0 -155
  56. package/docs/prompt-base-ia-sema.md +0 -101
  57. package/docs/sintaxe.md +0 -361
  58. package/exemplos/automacao.sema +0 -107
  59. package/exemplos/cadastro_usuario.sema +0 -54
  60. package/exemplos/calculadora.sema +0 -78
  61. package/exemplos/crud_simples.sema +0 -89
  62. package/exemplos/operacao_estrategia.sema +0 -402
  63. package/exemplos/pagamento.sema +0 -222
  64. package/exemplos/pagamento_dominio.sema +0 -35
  65. package/exemplos/testes_embutidos.sema +0 -45
  66. package/exemplos/tratamento_erro.sema +0 -157
  67. package/llms-full.txt +0 -34
  68. package/llms.txt +0 -17
  69. package/node_modules/@sema/gerador-dart/dist/index.d.ts +0 -3
  70. package/node_modules/@sema/gerador-dart/dist/index.js +0 -44
  71. package/node_modules/@sema/gerador-dart/dist/index.js.map +0 -1
  72. package/node_modules/@sema/gerador-dart/package.json +0 -7
  73. package/node_modules/@sema/gerador-lua/dist/index.d.ts +0 -3
  74. package/node_modules/@sema/gerador-lua/dist/index.js +0 -328
  75. package/node_modules/@sema/gerador-lua/dist/index.js.map +0 -1
  76. package/node_modules/@sema/gerador-lua/package.json +0 -7
  77. package/node_modules/@sema/gerador-python/dist/index.d.ts +0 -6
  78. package/node_modules/@sema/gerador-python/dist/index.js +0 -628
  79. package/node_modules/@sema/gerador-python/dist/index.js.map +0 -1
  80. package/node_modules/@sema/gerador-python/package.json +0 -7
  81. package/node_modules/@sema/gerador-typescript/dist/index.d.ts +0 -6
  82. package/node_modules/@sema/gerador-typescript/dist/index.js +0 -656
  83. package/node_modules/@sema/gerador-typescript/dist/index.js.map +0 -1
  84. package/node_modules/@sema/gerador-typescript/package.json +0 -7
  85. package/node_modules/@sema/nucleo/dist/ast/tipos.d.ts +0 -122
  86. package/node_modules/@sema/nucleo/dist/ast/tipos.js +0 -2
  87. package/node_modules/@sema/nucleo/dist/ast/tipos.js.map +0 -1
  88. package/node_modules/@sema/nucleo/dist/diagnosticos/index.d.ts +0 -21
  89. package/node_modules/@sema/nucleo/dist/diagnosticos/index.js +0 -12
  90. package/node_modules/@sema/nucleo/dist/diagnosticos/index.js.map +0 -1
  91. package/node_modules/@sema/nucleo/dist/formatador/index.d.ts +0 -9
  92. package/node_modules/@sema/nucleo/dist/formatador/index.js +0 -445
  93. package/node_modules/@sema/nucleo/dist/formatador/index.js.map +0 -1
  94. package/node_modules/@sema/nucleo/dist/index.d.ts +0 -34
  95. package/node_modules/@sema/nucleo/dist/index.js +0 -95
  96. package/node_modules/@sema/nucleo/dist/index.js.map +0 -1
  97. package/node_modules/@sema/nucleo/dist/ir/conversor.d.ts +0 -5
  98. package/node_modules/@sema/nucleo/dist/ir/conversor.js +0 -781
  99. package/node_modules/@sema/nucleo/dist/ir/conversor.js.map +0 -1
  100. package/node_modules/@sema/nucleo/dist/ir/modelos.d.ts +0 -285
  101. package/node_modules/@sema/nucleo/dist/ir/modelos.js +0 -2
  102. package/node_modules/@sema/nucleo/dist/ir/modelos.js.map +0 -1
  103. package/node_modules/@sema/nucleo/dist/lexer/lexer.d.ts +0 -7
  104. package/node_modules/@sema/nucleo/dist/lexer/lexer.js +0 -122
  105. package/node_modules/@sema/nucleo/dist/lexer/lexer.js.map +0 -1
  106. package/node_modules/@sema/nucleo/dist/lexer/tokens.d.ts +0 -8
  107. package/node_modules/@sema/nucleo/dist/lexer/tokens.js +0 -46
  108. package/node_modules/@sema/nucleo/dist/lexer/tokens.js.map +0 -1
  109. package/node_modules/@sema/nucleo/dist/parser/parser.d.ts +0 -9
  110. package/node_modules/@sema/nucleo/dist/parser/parser.js +0 -656
  111. package/node_modules/@sema/nucleo/dist/parser/parser.js.map +0 -1
  112. package/node_modules/@sema/nucleo/dist/semantico/analisador.d.ts +0 -57
  113. package/node_modules/@sema/nucleo/dist/semantico/analisador.js +0 -1497
  114. package/node_modules/@sema/nucleo/dist/semantico/analisador.js.map +0 -1
  115. package/node_modules/@sema/nucleo/dist/semantico/estruturas.d.ts +0 -104
  116. package/node_modules/@sema/nucleo/dist/semantico/estruturas.js +0 -445
  117. package/node_modules/@sema/nucleo/dist/semantico/estruturas.js.map +0 -1
  118. package/node_modules/@sema/nucleo/dist/semantico/seguranca.d.ts +0 -91
  119. package/node_modules/@sema/nucleo/dist/semantico/seguranca.js +0 -258
  120. package/node_modules/@sema/nucleo/dist/semantico/seguranca.js.map +0 -1
  121. package/node_modules/@sema/nucleo/dist/util/arquivos.d.ts +0 -2
  122. package/node_modules/@sema/nucleo/dist/util/arquivos.js +0 -25
  123. package/node_modules/@sema/nucleo/dist/util/arquivos.js.map +0 -1
  124. package/node_modules/@sema/nucleo/package.json +0 -7
  125. package/node_modules/@sema/padroes/dist/index.d.ts +0 -21
  126. package/node_modules/@sema/padroes/dist/index.js +0 -159
  127. package/node_modules/@sema/padroes/dist/index.js.map +0 -1
  128. package/node_modules/@sema/padroes/package.json +0 -7
@@ -0,0 +1,355 @@
1
+ export interface ParametroRotaBackend {
2
+ nome: string;
3
+ tipoSema: "Texto" | "Inteiro" | "Decimal" | "Id";
4
+ }
5
+
6
+ export interface SimboloDotnetExtraido {
7
+ simbolo: string;
8
+ retorno?: string;
9
+ parametros: Array<{ nome: string; tipoTexto?: string; obrigatorio: boolean }>;
10
+ }
11
+
12
+ export interface RotaDotnetExtraida {
13
+ origem: "dotnet";
14
+ metodo: string;
15
+ caminho: string;
16
+ simbolo: string;
17
+ parametros: ParametroRotaBackend[];
18
+ retorno?: string;
19
+ }
20
+
21
+ const METODOS_HTTP = new Set(["GET", "POST", "PUT", "PATCH", "DELETE"]);
22
+
23
+ function normalizarCaminhoBase(caminho?: string): string | undefined {
24
+ if (!caminho) {
25
+ return undefined;
26
+ }
27
+ return caminho.replace(/^\/+|\/+$/g, "");
28
+ }
29
+
30
+ function juntarCaminho(base: string | undefined, sufixo: string | undefined): string {
31
+ const partes = [base, sufixo]
32
+ .map((parte) => normalizarCaminhoBase(parte))
33
+ .filter((parte): parte is string => Boolean(parte));
34
+ return `/${partes.join("/")}`.replace(/\/+/g, "/");
35
+ }
36
+
37
+ function normalizarCaminhoAspNet(caminho: string, classe?: string, metodo?: string): string {
38
+ const controller = (classe ?? "").replace(/Controller$/i, "");
39
+ const action = metodo ?? "";
40
+ return caminho
41
+ .replace(/\[controller\]/gi, controller ? controller.toLowerCase() : "controller")
42
+ .replace(/\[action\]/gi, action ? action.toLowerCase() : "action")
43
+ .replace(/\{([^}:]+):[^}]+\}/g, "{$1}")
44
+ .replace(/\/+/g, "/");
45
+ }
46
+
47
+ function mapearTipoRotaDotnet(tipo?: string): ParametroRotaBackend["tipoSema"] {
48
+ const normalizado = (tipo ?? "").toLowerCase();
49
+ if (/(^|\.)(int|int32|int64|long|short)$/.test(normalizado)) {
50
+ return "Inteiro";
51
+ }
52
+ if (/(^|\.)(float|double|decimal)$/.test(normalizado)) {
53
+ return "Decimal";
54
+ }
55
+ if (/guid|uuid|id$/i.test(normalizado)) {
56
+ return "Id";
57
+ }
58
+ return "Texto";
59
+ }
60
+
61
+ function extrairParametrosRota(caminho: string, assinatura: string): ParametroRotaBackend[] {
62
+ const tiposAssinatura = new Map<string, string>();
63
+ for (const parametroBruto of assinatura.split(",")) {
64
+ const parametro = parametroBruto.trim();
65
+ if (!parametro) {
66
+ continue;
67
+ }
68
+ const semPadrao = parametro.split("=")[0]?.trim() ?? parametro;
69
+ const partes = semPadrao.split(/\s+/).filter(Boolean);
70
+ if (partes.length < 2) {
71
+ continue;
72
+ }
73
+ const nome = partes.at(-1)!;
74
+ const tipo = partes.slice(0, -1).join(" ");
75
+ tiposAssinatura.set(nome, tipo);
76
+ }
77
+
78
+ return [...caminho.matchAll(/\{([^}:]+)(?::[^}]+)?\}/g)].map((match) => {
79
+ const nome = match[1]!;
80
+ return {
81
+ nome,
82
+ tipoSema: mapearTipoRotaDotnet(tiposAssinatura.get(nome)),
83
+ };
84
+ });
85
+ }
86
+
87
+ function extrairTextoAtributo(atributo: string): string | undefined {
88
+ return atributo.match(/"([^"]+)"/)?.[1];
89
+ }
90
+
91
+ function extrairMetodosAtributo(atributo: string): string[] {
92
+ const direto = atributo.match(/\[\s*Http(Get|Post|Put|Patch|Delete)\b/i)?.[1]?.toUpperCase();
93
+ if (direto && METODOS_HTTP.has(direto)) {
94
+ return [direto];
95
+ }
96
+
97
+ const bloco = atributo.match(/\bHttpMethods\.(Get|Post|Put|Patch|Delete)\b/gi)
98
+ ?.map((item) => item.split(".").pop()?.toUpperCase() ?? "")
99
+ .filter((item) => METODOS_HTTP.has(item));
100
+ if (bloco && bloco.length > 0) {
101
+ return [...new Set(bloco)];
102
+ }
103
+
104
+ const requestMapping = atributo.match(/\[\s*AcceptVerbs\(([^)]*)\)\s*\]/i)?.[1];
105
+ if (requestMapping) {
106
+ const encontrados = [...requestMapping.matchAll(/"([A-Za-z]+)"/g)]
107
+ .map((match) => match[1]!.toUpperCase())
108
+ .filter((item) => METODOS_HTTP.has(item));
109
+ if (encontrados.length > 0) {
110
+ return [...new Set(encontrados)];
111
+ }
112
+ }
113
+
114
+ return [];
115
+ }
116
+
117
+ function contarChar(texto: string, alvo: string): number {
118
+ return [...texto].filter((char) => char === alvo).length;
119
+ }
120
+
121
+ function atualizarPilhaClasses<T extends { profundidade: number }>(pilha: T[], profundidade: number): void {
122
+ while (pilha.length > 0 && profundidade < pilha[pilha.length - 1]!.profundidade) {
123
+ pilha.pop();
124
+ }
125
+ }
126
+
127
+ function extrairAtributos(linhas: string[], inicio: number): { atributos: string[]; proximoIndice: number } {
128
+ const atributos: string[] = [];
129
+ let indice = inicio;
130
+
131
+ while (indice < linhas.length) {
132
+ const linha = linhas[indice]!.trim();
133
+ if (!linha.startsWith("[")) {
134
+ break;
135
+ }
136
+ let atual = linha;
137
+ let saldo = contarChar(linha, "[") - contarChar(linha, "]");
138
+ while (saldo > 0 && indice + 1 < linhas.length) {
139
+ indice += 1;
140
+ const complemento = linhas[indice]!.trim();
141
+ atual += ` ${complemento}`;
142
+ saldo += contarChar(complemento, "[") - contarChar(complemento, "]");
143
+ }
144
+ atributos.push(atual);
145
+ indice += 1;
146
+ }
147
+
148
+ return { atributos, proximoIndice: indice };
149
+ }
150
+
151
+ export function extrairSimbolosDotnet(codigo: string): SimboloDotnetExtraido[] {
152
+ const simbolos = new Map<string, SimboloDotnetExtraido>();
153
+ const linhas = codigo.split(/\r?\n/);
154
+ const pilhaClasses: Array<{ nome: string; profundidade: number }> = [];
155
+ let classePendente: { nome: string; profundidade: number } | undefined;
156
+ let profundidade = 0;
157
+
158
+ for (let indice = 0; indice < linhas.length; indice += 1) {
159
+ const linhaOriginal = linhas[indice]!;
160
+ const linha = linhaOriginal.trim();
161
+ if (classePendente && linha.startsWith("{")) {
162
+ pilhaClasses.push(classePendente);
163
+ classePendente = undefined;
164
+ }
165
+ if (!linha || linha.startsWith("//")) {
166
+ profundidade += contarChar(linhaOriginal, "{") - contarChar(linhaOriginal, "}");
167
+ atualizarPilhaClasses(pilhaClasses, profundidade);
168
+ continue;
169
+ }
170
+
171
+ const { atributos, proximoIndice } = extrairAtributos(linhas, indice);
172
+ if (atributos.length > 0) {
173
+ indice = proximoIndice;
174
+ }
175
+
176
+ const linhaEfetiva = (linhas[indice] ?? "").trim();
177
+ const classe = linhaEfetiva.match(/\bclass\s+([A-Za-z_]\w*)/);
178
+ if (classe) {
179
+ const entrada = { nome: classe[1]!, profundidade: profundidade + 1 };
180
+ if (linhaEfetiva.includes("{")) {
181
+ pilhaClasses.push(entrada);
182
+ } else {
183
+ classePendente = entrada;
184
+ }
185
+ profundidade += contarChar(linhaEfetiva, "{") - contarChar(linhaEfetiva, "}");
186
+ atualizarPilhaClasses(pilhaClasses, profundidade);
187
+ continue;
188
+ }
189
+
190
+ const metodo = linhaEfetiva.match(/\b(?:public|internal|protected|private)\s+(?:static\s+|async\s+|virtual\s+|override\s+|sealed\s+|partial\s+)*([A-Za-z0-9_<>,.?[\]\s]+)\s+([A-Za-z_]\w*)\s*\(([^)]*)\)/);
191
+ if (metodo) {
192
+ const classeAtual = pilhaClasses[pilhaClasses.length - 1];
193
+ const simbolo = classeAtual ? `${classeAtual.nome}.${metodo[2]!}` : metodo[2]!;
194
+ simbolos.set(simbolo, {
195
+ simbolo,
196
+ retorno: metodo[1]!.trim(),
197
+ parametros: metodo[3]!.split(",").flatMap((parametroBruto) => {
198
+ const parametro = parametroBruto.trim();
199
+ if (!parametro) {
200
+ return [];
201
+ }
202
+ const semPadrao = parametro.split("=")[0]?.trim() ?? parametro;
203
+ const partes = semPadrao.split(/\s+/).filter(Boolean);
204
+ if (partes.length < 2) {
205
+ return [];
206
+ }
207
+ return [{
208
+ nome: partes.at(-1)!,
209
+ tipoTexto: partes.slice(0, -1).join(" "),
210
+ obrigatorio: !parametro.includes("="),
211
+ }];
212
+ }),
213
+ });
214
+ profundidade += contarChar(linhaEfetiva, "{") - contarChar(linhaEfetiva, "}");
215
+ atualizarPilhaClasses(pilhaClasses, profundidade);
216
+ continue;
217
+ }
218
+
219
+ const funcaoLocal = linhaEfetiva.match(/\b([A-Za-z0-9_<>,.?[\]\s]+)\s+([A-Za-z_]\w*)\s*\(([^)]*)\)\s*=>/);
220
+ if (funcaoLocal && atributos.length === 0 && pilhaClasses.length === 0) {
221
+ const simbolo = funcaoLocal[2]!;
222
+ simbolos.set(simbolo, {
223
+ simbolo,
224
+ retorno: funcaoLocal[1]!.trim(),
225
+ parametros: [],
226
+ });
227
+ }
228
+
229
+ const funcaoTopo = linhaEfetiva.match(/\b(?:static\s+)?([A-Za-z0-9_<>,.?[\]\s]+)\s+([A-Za-z_]\w*)\s*\(([^)]*)\)\s*(?:\{|$)/);
230
+ if (funcaoTopo && atributos.length === 0 && pilhaClasses.length === 0 && !["if", "for", "while", "switch"].includes(funcaoTopo[2]!)) {
231
+ const simbolo = funcaoTopo[2]!;
232
+ if (!simbolos.has(simbolo)) {
233
+ simbolos.set(simbolo, {
234
+ simbolo,
235
+ retorno: funcaoTopo[1]!.trim(),
236
+ parametros: funcaoTopo[3]!.split(",").flatMap((parametroBruto) => {
237
+ const parametro = parametroBruto.trim();
238
+ if (!parametro) {
239
+ return [];
240
+ }
241
+ const semPadrao = parametro.split("=")[0]?.trim() ?? parametro;
242
+ const partes = semPadrao.split(/\s+/).filter(Boolean);
243
+ if (partes.length < 2) {
244
+ return [];
245
+ }
246
+ return [{
247
+ nome: partes.at(-1)!,
248
+ tipoTexto: partes.slice(0, -1).join(" "),
249
+ obrigatorio: !parametro.includes("="),
250
+ }];
251
+ }),
252
+ });
253
+ }
254
+ }
255
+
256
+ profundidade += contarChar(linhaEfetiva, "{") - contarChar(linhaEfetiva, "}");
257
+ atualizarPilhaClasses(pilhaClasses, profundidade);
258
+ }
259
+
260
+ return [...simbolos.values()];
261
+ }
262
+
263
+ export function extrairRotasDotnet(codigo: string): RotaDotnetExtraida[] {
264
+ const rotas = new Map<string, RotaDotnetExtraida>();
265
+ const linhas = codigo.split(/\r?\n/);
266
+ const pilhaClasses: Array<{ nome: string; profundidade: number; rotaBase?: string; apiController: boolean }> = [];
267
+ let classePendente: { nome: string; profundidade: number; rotaBase?: string; apiController: boolean } | undefined;
268
+ let profundidade = 0;
269
+
270
+ for (let indice = 0; indice < linhas.length; indice += 1) {
271
+ const linhaOriginal = linhas[indice]!;
272
+ const linha = linhaOriginal.trim();
273
+ if (classePendente && linha.startsWith("{")) {
274
+ pilhaClasses.push(classePendente);
275
+ classePendente = undefined;
276
+ }
277
+ if (!linha || linha.startsWith("//")) {
278
+ profundidade += contarChar(linhaOriginal, "{") - contarChar(linhaOriginal, "}");
279
+ atualizarPilhaClasses(pilhaClasses, profundidade);
280
+ continue;
281
+ }
282
+
283
+ const { atributos, proximoIndice } = extrairAtributos(linhas, indice);
284
+ if (atributos.length > 0) {
285
+ indice = proximoIndice;
286
+ }
287
+
288
+ const linhaEfetiva = (linhas[indice] ?? "").trim();
289
+ const classe = linhaEfetiva.match(/\bclass\s+([A-Za-z_]\w*)/);
290
+ if (classe) {
291
+ const rotaBase = atributos
292
+ .map((atributo) => extrairTextoAtributo(atributo))
293
+ .find(Boolean);
294
+ const entrada = {
295
+ nome: classe[1]!,
296
+ profundidade: profundidade + 1,
297
+ rotaBase,
298
+ apiController: atributos.some((atributo) => /\[\s*ApiController\s*\]/i.test(atributo)),
299
+ };
300
+ if (linhaEfetiva.includes("{")) {
301
+ pilhaClasses.push(entrada);
302
+ } else {
303
+ classePendente = entrada;
304
+ }
305
+ profundidade += contarChar(linhaEfetiva, "{") - contarChar(linhaEfetiva, "}");
306
+ atualizarPilhaClasses(pilhaClasses, profundidade);
307
+ continue;
308
+ }
309
+
310
+ const classeAtual = pilhaClasses[pilhaClasses.length - 1];
311
+ const metodo = linhaEfetiva.match(/\b(?:public|internal|protected)\s+(?:async\s+|virtual\s+|override\s+|static\s+)*([A-Za-z0-9_<>,.?[\]\s]+)\s+([A-Za-z_]\w*)\s*\(([^)]*)\)/);
312
+ if (metodo && classeAtual) {
313
+ const atributosMetodo = atributos.filter((atributo) => /\[\s*(?:Http|AcceptVerbs)/i.test(atributo));
314
+ for (const atributo of atributosMetodo) {
315
+ const metodos = extrairMetodosAtributo(atributo);
316
+ const rotaMetodo = extrairTextoAtributo(atributo);
317
+ for (const httpMetodo of metodos) {
318
+ const caminho = normalizarCaminhoAspNet(
319
+ juntarCaminho(classeAtual.rotaBase, rotaMetodo),
320
+ classeAtual.nome,
321
+ metodo[2]!,
322
+ );
323
+ const registro: RotaDotnetExtraida = {
324
+ origem: "dotnet",
325
+ metodo: httpMetodo,
326
+ caminho,
327
+ simbolo: `${classeAtual.nome}.${metodo[2]!}`,
328
+ parametros: extrairParametrosRota(caminho, metodo[3] ?? ""),
329
+ retorno: metodo[1]!.trim(),
330
+ };
331
+ rotas.set(`${registro.metodo}:${registro.caminho}:${registro.simbolo}`, registro);
332
+ }
333
+ }
334
+ }
335
+
336
+ for (const match of linhaEfetiva.matchAll(/\b\w+\.Map(Get|Post|Put|Patch|Delete)\(\s*"([^"]+)"\s*,\s*([A-Za-z_][\w.]*)/g)) {
337
+ const httpMetodo = match[1]!.toUpperCase();
338
+ const caminho = normalizarCaminhoAspNet(match[2]!);
339
+ const simbolo = match[3]!;
340
+ const registro: RotaDotnetExtraida = {
341
+ origem: "dotnet",
342
+ metodo: httpMetodo,
343
+ caminho,
344
+ simbolo,
345
+ parametros: extrairParametrosRota(caminho, ""),
346
+ };
347
+ rotas.set(`${registro.metodo}:${registro.caminho}:${registro.simbolo}`, registro);
348
+ }
349
+
350
+ profundidade += contarChar(linhaEfetiva, "{") - contarChar(linhaEfetiva, "}");
351
+ atualizarPilhaClasses(pilhaClasses, profundidade);
352
+ }
353
+
354
+ return [...rotas.values()];
355
+ }