@semacode/cli 1.3.2 → 1.3.5

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 (155) hide show
  1. package/README.md +2 -2
  2. package/dist/index.js +33 -27
  3. package/package.json +21 -33
  4. package/semacode-cli-1.3.1.tgz +0 -0
  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 +4476 -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 -272
  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 -546
  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 -104
  57. package/docs/sintaxe.md +0 -361
  58. package/exemplos/agendamento.sema +0 -106
  59. package/exemplos/assinatura.sema +0 -136
  60. package/exemplos/auditoria.sema +0 -88
  61. package/exemplos/autenticacao.sema +0 -125
  62. package/exemplos/automacao.sema +0 -107
  63. package/exemplos/cadastro_usuario.sema +0 -54
  64. package/exemplos/calculadora.sema +0 -78
  65. package/exemplos/crud_simples.sema +0 -89
  66. package/exemplos/estoque.sema +0 -126
  67. package/exemplos/exportacao.sema +0 -94
  68. package/exemplos/fila.sema +0 -131
  69. package/exemplos/integracao_externa.sema +0 -94
  70. package/exemplos/multi_tenant.sema +0 -140
  71. package/exemplos/notificacao.sema +0 -98
  72. package/exemplos/operacao_estrategia.sema +0 -402
  73. package/exemplos/pagamento.sema +0 -222
  74. package/exemplos/pagamento_dominio.sema +0 -35
  75. package/exemplos/pedido.sema +0 -119
  76. package/exemplos/permissao.sema +0 -121
  77. package/exemplos/relatorio.sema +0 -93
  78. package/exemplos/testes_embutidos.sema +0 -45
  79. package/exemplos/tratamento_erro.sema +0 -157
  80. package/exemplos/upload_arquivo.sema +0 -93
  81. package/exemplos/webhook.sema +0 -96
  82. package/llms-full.txt +0 -34
  83. package/llms.txt +0 -17
  84. package/node_modules/@sema/gerador-css/dist/index.d.ts +0 -3
  85. package/node_modules/@sema/gerador-css/dist/index.js +0 -592
  86. package/node_modules/@sema/gerador-css/dist/index.js.map +0 -1
  87. package/node_modules/@sema/gerador-css/package.json +0 -7
  88. package/node_modules/@sema/gerador-dart/dist/index.d.ts +0 -3
  89. package/node_modules/@sema/gerador-dart/dist/index.js +0 -44
  90. package/node_modules/@sema/gerador-dart/dist/index.js.map +0 -1
  91. package/node_modules/@sema/gerador-dart/package.json +0 -7
  92. package/node_modules/@sema/gerador-html/dist/index.d.ts +0 -3
  93. package/node_modules/@sema/gerador-html/dist/index.js +0 -163
  94. package/node_modules/@sema/gerador-html/dist/index.js.map +0 -1
  95. package/node_modules/@sema/gerador-html/package.json +0 -7
  96. package/node_modules/@sema/gerador-javascript/dist/index.d.ts +0 -3
  97. package/node_modules/@sema/gerador-javascript/dist/index.js +0 -421
  98. package/node_modules/@sema/gerador-javascript/dist/index.js.map +0 -1
  99. package/node_modules/@sema/gerador-javascript/package.json +0 -7
  100. package/node_modules/@sema/gerador-lua/dist/index.d.ts +0 -3
  101. package/node_modules/@sema/gerador-lua/dist/index.js +0 -328
  102. package/node_modules/@sema/gerador-lua/dist/index.js.map +0 -1
  103. package/node_modules/@sema/gerador-lua/package.json +0 -7
  104. package/node_modules/@sema/gerador-python/dist/index.d.ts +0 -6
  105. package/node_modules/@sema/gerador-python/dist/index.js +0 -628
  106. package/node_modules/@sema/gerador-python/dist/index.js.map +0 -1
  107. package/node_modules/@sema/gerador-python/package.json +0 -7
  108. package/node_modules/@sema/gerador-typescript/dist/index.d.ts +0 -6
  109. package/node_modules/@sema/gerador-typescript/dist/index.js +0 -656
  110. package/node_modules/@sema/gerador-typescript/dist/index.js.map +0 -1
  111. package/node_modules/@sema/gerador-typescript/package.json +0 -7
  112. package/node_modules/@sema/nucleo/dist/ast/tipos.d.ts +0 -122
  113. package/node_modules/@sema/nucleo/dist/ast/tipos.js +0 -2
  114. package/node_modules/@sema/nucleo/dist/ast/tipos.js.map +0 -1
  115. package/node_modules/@sema/nucleo/dist/diagnosticos/index.d.ts +0 -21
  116. package/node_modules/@sema/nucleo/dist/diagnosticos/index.js +0 -12
  117. package/node_modules/@sema/nucleo/dist/diagnosticos/index.js.map +0 -1
  118. package/node_modules/@sema/nucleo/dist/formatador/index.d.ts +0 -9
  119. package/node_modules/@sema/nucleo/dist/formatador/index.js +0 -445
  120. package/node_modules/@sema/nucleo/dist/formatador/index.js.map +0 -1
  121. package/node_modules/@sema/nucleo/dist/index.d.ts +0 -34
  122. package/node_modules/@sema/nucleo/dist/index.js +0 -95
  123. package/node_modules/@sema/nucleo/dist/index.js.map +0 -1
  124. package/node_modules/@sema/nucleo/dist/ir/conversor.d.ts +0 -5
  125. package/node_modules/@sema/nucleo/dist/ir/conversor.js +0 -781
  126. package/node_modules/@sema/nucleo/dist/ir/conversor.js.map +0 -1
  127. package/node_modules/@sema/nucleo/dist/ir/modelos.d.ts +0 -285
  128. package/node_modules/@sema/nucleo/dist/ir/modelos.js +0 -2
  129. package/node_modules/@sema/nucleo/dist/ir/modelos.js.map +0 -1
  130. package/node_modules/@sema/nucleo/dist/lexer/lexer.d.ts +0 -7
  131. package/node_modules/@sema/nucleo/dist/lexer/lexer.js +0 -122
  132. package/node_modules/@sema/nucleo/dist/lexer/lexer.js.map +0 -1
  133. package/node_modules/@sema/nucleo/dist/lexer/tokens.d.ts +0 -8
  134. package/node_modules/@sema/nucleo/dist/lexer/tokens.js +0 -46
  135. package/node_modules/@sema/nucleo/dist/lexer/tokens.js.map +0 -1
  136. package/node_modules/@sema/nucleo/dist/parser/parser.d.ts +0 -9
  137. package/node_modules/@sema/nucleo/dist/parser/parser.js +0 -656
  138. package/node_modules/@sema/nucleo/dist/parser/parser.js.map +0 -1
  139. package/node_modules/@sema/nucleo/dist/semantico/analisador.d.ts +0 -57
  140. package/node_modules/@sema/nucleo/dist/semantico/analisador.js +0 -1497
  141. package/node_modules/@sema/nucleo/dist/semantico/analisador.js.map +0 -1
  142. package/node_modules/@sema/nucleo/dist/semantico/estruturas.d.ts +0 -104
  143. package/node_modules/@sema/nucleo/dist/semantico/estruturas.js +0 -445
  144. package/node_modules/@sema/nucleo/dist/semantico/estruturas.js.map +0 -1
  145. package/node_modules/@sema/nucleo/dist/semantico/seguranca.d.ts +0 -91
  146. package/node_modules/@sema/nucleo/dist/semantico/seguranca.js +0 -258
  147. package/node_modules/@sema/nucleo/dist/semantico/seguranca.js.map +0 -1
  148. package/node_modules/@sema/nucleo/dist/util/arquivos.d.ts +0 -2
  149. package/node_modules/@sema/nucleo/dist/util/arquivos.js +0 -25
  150. package/node_modules/@sema/nucleo/dist/util/arquivos.js.map +0 -1
  151. package/node_modules/@sema/nucleo/package.json +0 -7
  152. package/node_modules/@sema/padroes/dist/index.d.ts +0 -23
  153. package/node_modules/@sema/padroes/dist/index.js +0 -210
  154. package/node_modules/@sema/padroes/dist/index.js.map +0 -1
  155. package/node_modules/@sema/padroes/package.json +0 -7
@@ -0,0 +1,258 @@
1
+ export interface FuncaoPythonDecorada {
2
+ nome: string;
3
+ parametros: string;
4
+ retorno?: string;
5
+ indentacao: number;
6
+ decorators: string[];
7
+ }
8
+
9
+ export interface ParametroRotaFlask {
10
+ nome: string;
11
+ conversor?: string;
12
+ }
13
+
14
+ export interface RotaFlaskDecorada {
15
+ nomeFuncao: string;
16
+ parametros: string;
17
+ retorno?: string;
18
+ metodo: string;
19
+ caminho: string;
20
+ }
21
+
22
+ function contarParenteses(texto: string): number {
23
+ let saldo = 0;
24
+ let quote: "'" | '"' | undefined;
25
+ let escapando = false;
26
+
27
+ for (const caractere of texto) {
28
+ if (escapando) {
29
+ escapando = false;
30
+ continue;
31
+ }
32
+
33
+ if (caractere === "\\") {
34
+ escapando = true;
35
+ continue;
36
+ }
37
+
38
+ if (quote) {
39
+ if (caractere === quote) {
40
+ quote = undefined;
41
+ }
42
+ continue;
43
+ }
44
+
45
+ if (caractere === "'" || caractere === '"') {
46
+ quote = caractere;
47
+ continue;
48
+ }
49
+
50
+ if (caractere === "(") {
51
+ saldo += 1;
52
+ continue;
53
+ }
54
+
55
+ if (caractere === ")") {
56
+ saldo -= 1;
57
+ }
58
+ }
59
+
60
+ return saldo;
61
+ }
62
+
63
+ export function contarIndentacaoPython(linha: string): number {
64
+ let total = 0;
65
+ for (const caractere of linha) {
66
+ if (caractere === " ") {
67
+ total += 1;
68
+ continue;
69
+ }
70
+ if (caractere === "\t") {
71
+ total += 4;
72
+ continue;
73
+ }
74
+ break;
75
+ }
76
+ return total;
77
+ }
78
+
79
+ function juntarCaminhoHttp(base: string | undefined, sufixo: string | undefined): string {
80
+ const partes = [base ?? "", sufixo ?? ""]
81
+ .map((item) => item.trim())
82
+ .filter(Boolean)
83
+ .map((item) => item.replace(/^\/+|\/+$/g, ""));
84
+
85
+ const caminho = `/${partes.join("/")}`.replace(/\/+/g, "/");
86
+ return caminho === "//" ? "/" : caminho;
87
+ }
88
+
89
+ function detectarBlueprintsFlask(texto: string): Map<string, string | undefined> {
90
+ const blueprints = new Map<string, string | undefined>();
91
+ const linhas = texto.split(/\r?\n/);
92
+ let atual: { nome: string; linhas: string[]; saldo: number } | undefined;
93
+
94
+ const finalizar = () => {
95
+ if (!atual) {
96
+ return;
97
+ }
98
+ const conteudo = atual.linhas.join(" ");
99
+ const prefixo = conteudo.match(/\burl_prefix\s*=\s*["']([^"']+)["']/)?.[1];
100
+ blueprints.set(atual.nome, prefixo);
101
+ atual = undefined;
102
+ };
103
+
104
+ for (const linha of linhas) {
105
+ const trim = linha.trim();
106
+ if (!trim || trim.startsWith("#")) {
107
+ continue;
108
+ }
109
+
110
+ if (atual) {
111
+ atual.linhas.push(trim);
112
+ atual.saldo += contarParenteses(trim);
113
+ if (atual.saldo <= 0) {
114
+ finalizar();
115
+ }
116
+ continue;
117
+ }
118
+
119
+ const inicio = trim.match(/^([A-Za-z_]\w*)\s*=\s*Blueprint\s*\(/);
120
+ if (!inicio) {
121
+ continue;
122
+ }
123
+
124
+ atual = {
125
+ nome: inicio[1]!,
126
+ linhas: [trim],
127
+ saldo: contarParenteses(trim),
128
+ };
129
+
130
+ if (atual.saldo <= 0) {
131
+ finalizar();
132
+ }
133
+ }
134
+
135
+ finalizar();
136
+ return blueprints;
137
+ }
138
+
139
+ export function extrairFuncoesPythonDecoradas(texto: string): FuncaoPythonDecorada[] {
140
+ const funcoes: FuncaoPythonDecorada[] = [];
141
+ const linhas = texto.split(/\r?\n/);
142
+ let decoratorsPendentes: string[] = [];
143
+ let decoratorAtual: { linhas: string[]; saldo: number } | undefined;
144
+
145
+ const finalizarDecorator = () => {
146
+ if (!decoratorAtual) {
147
+ return;
148
+ }
149
+ decoratorsPendentes.push(decoratorAtual.linhas.join(" ").replace(/\s+/g, " ").trim());
150
+ decoratorAtual = undefined;
151
+ };
152
+
153
+ for (const linha of linhas) {
154
+ const trim = linha.trim();
155
+ const indentacao = contarIndentacaoPython(linha);
156
+
157
+ if (decoratorAtual) {
158
+ decoratorAtual.linhas.push(trim);
159
+ decoratorAtual.saldo += contarParenteses(trim);
160
+ if (decoratorAtual.saldo <= 0) {
161
+ finalizarDecorator();
162
+ }
163
+ continue;
164
+ }
165
+
166
+ if (!trim || trim.startsWith("#")) {
167
+ continue;
168
+ }
169
+
170
+ if (trim.startsWith("@")) {
171
+ decoratorAtual = {
172
+ linhas: [trim],
173
+ saldo: contarParenteses(trim),
174
+ };
175
+ if (decoratorAtual.saldo <= 0) {
176
+ finalizarDecorator();
177
+ }
178
+ continue;
179
+ }
180
+
181
+ const definicao = trim.match(/^(?:async\s+def|def)\s+([A-Za-z_]\w*)\s*\((.*)\)(?:\s*->\s*([^:]+))?:\s*(?:#.*)?$/);
182
+ if (definicao) {
183
+ funcoes.push({
184
+ nome: definicao[1]!,
185
+ parametros: definicao[2] ?? "",
186
+ retorno: definicao[3]?.trim(),
187
+ indentacao,
188
+ decorators: decoratorsPendentes,
189
+ });
190
+ decoratorsPendentes = [];
191
+ continue;
192
+ }
193
+
194
+ decoratorsPendentes = [];
195
+ }
196
+
197
+ return funcoes;
198
+ }
199
+
200
+ function extrairMetodosFlask(decorator: string): string[] {
201
+ const blocoMethods = decorator.match(/\bmethods\s*=\s*\[([^\]]*)\]/i)?.[1];
202
+ if (!blocoMethods) {
203
+ return ["GET"];
204
+ }
205
+
206
+ const encontrados = [...blocoMethods.matchAll(/["']([A-Za-z]+)["']/g)]
207
+ .map((match) => match[1]!.toUpperCase())
208
+ .filter((metodo) => ["GET", "POST", "PUT", "PATCH", "DELETE"].includes(metodo));
209
+
210
+ return [...new Set(encontrados)];
211
+ }
212
+
213
+ export function normalizarCaminhoFlask(caminho: string): string {
214
+ return caminho.replace(/<(?:(\w+):)?([A-Za-z_]\w*)>/g, "{$2}");
215
+ }
216
+
217
+ export function extrairParametrosCaminhoFlask(caminho: string): ParametroRotaFlask[] {
218
+ return [...caminho.matchAll(/<(?:(\w+):)?([A-Za-z_]\w*)>/g)].map((match) => ({
219
+ conversor: match[1] ?? undefined,
220
+ nome: match[2]!,
221
+ }));
222
+ }
223
+
224
+ export function extrairRotasFlaskDecoradas(texto: string): RotaFlaskDecorada[] {
225
+ const blueprints = detectarBlueprintsFlask(texto);
226
+ const rotas: RotaFlaskDecorada[] = [];
227
+
228
+ for (const funcao of extrairFuncoesPythonDecoradas(texto)) {
229
+ if (funcao.indentacao > 0) {
230
+ continue;
231
+ }
232
+
233
+ for (const decorator of funcao.decorators) {
234
+ const match = decorator.match(/^@([A-Za-z_]\w*)\.route\(([\s\S]*)\)$/);
235
+ if (!match) {
236
+ continue;
237
+ }
238
+
239
+ const alvo = match[1]!;
240
+ const argumentos = match[2] ?? "";
241
+ const sufixo = argumentos.match(/["']([^"']+)["']/)?.[1];
242
+ const prefixo = alvo === "app" ? undefined : blueprints.get(alvo);
243
+ const metodos = extrairMetodosFlask(decorator);
244
+
245
+ for (const metodo of metodos) {
246
+ rotas.push({
247
+ nomeFuncao: funcao.nome,
248
+ parametros: funcao.parametros,
249
+ retorno: funcao.retorno,
250
+ metodo,
251
+ caminho: normalizarCaminhoFlask(juntarCaminhoHttp(prefixo, sufixo)),
252
+ });
253
+ }
254
+ }
255
+ }
256
+
257
+ return rotas;
258
+ }
@@ -0,0 +1,125 @@
1
+ export interface ParametroRotaRust {
2
+ nome: string;
3
+ tipoSema: "Texto" | "Inteiro" | "Decimal" | "Id";
4
+ }
5
+
6
+ export interface SimboloRustExtraido {
7
+ simbolo: string;
8
+ retorno?: string;
9
+ parametros: Array<{ nome: string; tipoTexto?: string; obrigatorio: boolean }>;
10
+ }
11
+
12
+ export interface RotaRustExtraida {
13
+ origem: "rust";
14
+ metodo: string;
15
+ caminho: string;
16
+ simbolo: string;
17
+ parametros: ParametroRotaRust[];
18
+ retorno?: string;
19
+ }
20
+
21
+ const METODOS_HTTP = new Set(["GET", "POST", "PUT", "PATCH", "DELETE"]);
22
+
23
+ function normalizarCaminhoRust(caminho: string): string {
24
+ return caminho
25
+ .replace(/:([A-Za-z_]\w*)/g, "{$1}")
26
+ .replace(/\/+/g, "/");
27
+ }
28
+
29
+ function mapearTipoRust(tipo?: string): ParametroRotaRust["tipoSema"] {
30
+ const normalizado = (tipo ?? "").toLowerCase();
31
+ if (/^(i8|i16|i32|i64|u8|u16|u32|u64|usize|isize)$/.test(normalizado)) {
32
+ return "Inteiro";
33
+ }
34
+ if (/^(f32|f64|decimal)$/.test(normalizado)) {
35
+ return "Decimal";
36
+ }
37
+ if (/uuid|id$/.test(normalizado)) {
38
+ return "Id";
39
+ }
40
+ return "Texto";
41
+ }
42
+
43
+ function extrairParametrosAssinaturaRust(assinatura: string): Array<{ nome: string; tipoTexto?: string; obrigatorio: boolean }> {
44
+ return assinatura.split(",").map((parametroBruto) => {
45
+ const parametro = parametroBruto.trim();
46
+ if (!parametro || parametro === "&self" || parametro === "self") {
47
+ return undefined;
48
+ }
49
+ const [nome, tipo] = parametro.split(":").map((parte) => parte.trim());
50
+ if (!nome) {
51
+ return undefined;
52
+ }
53
+ return {
54
+ nome: nome.replace(/^mut\s+/, ""),
55
+ tipoTexto: tipo,
56
+ obrigatorio: true,
57
+ };
58
+ }).filter((item): item is NonNullable<typeof item> => Boolean(item));
59
+ }
60
+
61
+ function extrairParametrosRotaRust(caminho: string, assinatura: string): ParametroRotaRust[] {
62
+ const assinaturaMap = new Map<string, string>();
63
+ for (const parametro of extrairParametrosAssinaturaRust(assinatura)) {
64
+ assinaturaMap.set(parametro.nome, parametro.tipoTexto ?? "");
65
+ }
66
+ return [...normalizarCaminhoRust(caminho).matchAll(/\{([^}]+)\}/g)].map((match) => ({
67
+ nome: match[1]!,
68
+ tipoSema: mapearTipoRust(assinaturaMap.get(match[1]!)),
69
+ }));
70
+ }
71
+
72
+ export function extrairSimbolosRust(codigo: string): SimboloRustExtraido[] {
73
+ const simbolos = new Map<string, SimboloRustExtraido>();
74
+ let implAtual: string | undefined;
75
+
76
+ for (const linha of codigo.split(/\r?\n/)) {
77
+ const trim = linha.trim();
78
+ const impl = trim.match(/^impl(?:<[^>]+>)?\s+([A-Za-z_]\w*)/);
79
+ if (impl) {
80
+ implAtual = impl[1]!;
81
+ continue;
82
+ }
83
+ if (trim.startsWith("}")) {
84
+ implAtual = undefined;
85
+ }
86
+
87
+ const funcao = trim.match(/^(?:pub\s+)?(?:async\s+)?fn\s+([A-Za-z_]\w*)\s*\(([^)]*)\)\s*(?:->\s*([^ {]+))?/);
88
+ if (!funcao) {
89
+ continue;
90
+ }
91
+ const simbolo = implAtual ? `${implAtual}.${funcao[1]!}` : funcao[1]!;
92
+ simbolos.set(simbolo, {
93
+ simbolo,
94
+ retorno: funcao[3]?.trim(),
95
+ parametros: extrairParametrosAssinaturaRust(funcao[2] ?? ""),
96
+ });
97
+ }
98
+
99
+ return [...simbolos.values()];
100
+ }
101
+
102
+ export function extrairRotasRust(codigo: string): RotaRustExtraida[] {
103
+ const rotas = new Map<string, RotaRustExtraida>();
104
+
105
+ for (const match of codigo.matchAll(/\.route\(\s*"([^"]+)"\s*,\s*((?:get|post|put|patch|delete)\([A-Za-z_:][A-Za-z0-9_:]*\)(?:\.(?:get|post|put|patch|delete)\([A-Za-z_:][A-Za-z0-9_:]*\))*)\s*\)/g)) {
106
+ const caminho = normalizarCaminhoRust(match[1]!);
107
+ const bloco = match[2]!;
108
+ for (const rota of bloco.matchAll(/\b(get|post|put|patch|delete)\(([A-Za-z_:][A-Za-z0-9_:]*)\)/g)) {
109
+ const metodo = rota[1]!.toUpperCase();
110
+ const simbolo = rota[2]!.replace(/::/g, ".");
111
+ if (!METODOS_HTTP.has(metodo)) {
112
+ continue;
113
+ }
114
+ rotas.set(`${metodo}:${caminho}:${simbolo}`, {
115
+ origem: "rust",
116
+ metodo,
117
+ caminho,
118
+ simbolo,
119
+ parametros: extrairParametrosRotaRust(caminho, ""),
120
+ });
121
+ }
122
+ }
123
+
124
+ return [...rotas.values()];
125
+ }
package/src/tipos.ts ADDED
@@ -0,0 +1,22 @@
1
+ export type EstruturaSaida = "flat" | "modulos" | "backend";
2
+
3
+ export type FonteLegado =
4
+ | "nestjs"
5
+ | "fastapi"
6
+ | "flask"
7
+ | "nextjs"
8
+ | "nextjs-consumer"
9
+ | "react-vite-consumer"
10
+ | "angular-consumer"
11
+ | "flutter-consumer"
12
+ | "firebase"
13
+ | "typescript"
14
+ | "python"
15
+ | "dart"
16
+ | "dotnet"
17
+ | "java"
18
+ | "go"
19
+ | "rust"
20
+ | "cpp";
21
+
22
+ export type ModoAdocao = "incremental";