@semacode/cli 2.0.1 → 2.1.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.
- package/LICENSE +39 -39
- package/README.md +125 -121
- package/dist/agentEntryPoints.js +499 -499
- package/dist/doctorCommand.js +28 -0
- package/dist/geracaoCore.js +97 -1
- package/dist/iaPrompts.d.ts +1 -1
- package/dist/iaPrompts.js +307 -307
- package/dist/index.part01.js +4 -3
- package/dist/index.part02.js +21 -21
- package/dist/index.part04.js +96 -96
- package/dist/index.part06.js +1 -1
- package/dist/index.part07.js +35 -24
- package/dist/init/templates.part01.js +393 -393
- package/dist/init/templates.part02.js +189 -189
- package/dist/initTemplatesBackend.js +73 -73
- package/dist/initTemplatesBase.js +81 -81
- package/dist/initTemplatesFlutter.js +137 -137
- package/dist/initTemplatesRuntime.js +350 -350
- package/dist/initTemplatesWeb.js +309 -309
- package/dist/nativeToolchains.d.ts +15 -0
- package/dist/nativeToolchains.js +132 -0
- package/dist/projetoConfig.js +7 -1
- package/dist/projetoResolucao.js +21 -6
- package/dist/sync/index.js +35 -35
- package/docs/README.md +25 -25
- package/docs/ai-onboarding.md +62 -62
- package/docs/ai-workflow.md +1 -1
- package/docs/auth.md +26 -26
- package/docs/cli.md +79 -72
- package/docs/commands.md +1 -1
- package/docs/database.md +15 -15
- package/docs/deploy.md +41 -36
- package/docs/documentation.md +39 -39
- package/docs/env.md +16 -16
- package/docs/frontend.md +41 -41
- package/docs/getting-started.md +57 -57
- package/docs/i18n.md +15 -15
- package/docs/profiles.md +45 -43
- package/docs/repositories.md +43 -43
- package/docs/rollback.md +31 -31
- package/docs/security.md +32 -32
- package/docs/support.md +8 -8
- package/docs/syntax.md +1 -1
- package/docs/testing.md +35 -28
- package/docs/vocabulary.md +29 -29
- package/exemplos/agendamento.sema +1 -1
- package/exemplos/assinatura.sema +1 -1
- package/exemplos/auditoria.sema +1 -1
- package/exemplos/autenticacao.sema +1 -1
- package/exemplos/author_obra_comum.sema +1 -1
- package/exemplos/author_tema_sensivel.sema +1 -1
- package/exemplos/automacao.sema +1 -1
- package/exemplos/cadastro_usuario.sema +1 -1
- package/exemplos/calculadora.sema +1 -1
- package/exemplos/crud_simples.sema +1 -1
- package/exemplos/estoque.sema +1 -1
- package/exemplos/exportacao.sema +1 -1
- package/exemplos/fila.sema +1 -1
- package/exemplos/integracao_externa.sema +1 -1
- package/exemplos/multi_tenant.sema +1 -1
- package/exemplos/notificacao.sema +1 -1
- package/exemplos/operacao_estrategia.sema +132 -132
- package/exemplos/operacao_estrategia_discovery.sema +220 -220
- package/exemplos/operacao_estrategia_fluxo.sema +114 -114
- package/exemplos/operacao_estrategia_gates.sema +106 -106
- package/exemplos/operacao_estrategia_quarentena.sema +133 -133
- package/exemplos/operacao_estrategia_rollout.sema +124 -124
- package/exemplos/pagamento.sema +1 -1
- package/exemplos/pagamento_dominio.sema +1 -1
- package/exemplos/pedido.sema +1 -1
- package/exemplos/permissao.sema +1 -1
- package/exemplos/persistencia_vendor_first.sema +1 -1
- package/exemplos/profile_conversas.sema +165 -165
- package/exemplos/profile_game.sema +1 -1
- package/exemplos/profile_legal.sema +1 -1
- package/exemplos/profile_ops.sema +1 -1
- package/exemplos/profile_research.sema +1 -1
- package/exemplos/profile_software.sema +1 -1
- package/exemplos/profile_workflow_n8n.sema +1 -1
- package/exemplos/relatorio.sema +1 -1
- package/exemplos/replica_analitica_erp.sema +1 -1
- package/exemplos/testes_embutidos.sema +1 -1
- package/exemplos/tratamento_erro.sema +1 -1
- package/exemplos/upload_arquivo.sema +1 -1
- package/exemplos/webhook.sema +1 -1
- package/node_modules/@sema/gerador-cpp/dist/index.d.ts +3 -0
- package/node_modules/@sema/gerador-cpp/dist/index.js +859 -0
- package/node_modules/@sema/gerador-cpp/dist/index.js.map +1 -0
- package/node_modules/@sema/gerador-cpp/package.json +7 -0
- package/node_modules/@sema/gerador-css/dist/index.part01.js +10 -10
- package/node_modules/@sema/gerador-css/dist/index.part02.js +460 -460
- package/node_modules/@sema/gerador-dotnet/dist/index.d.ts +3 -0
- package/node_modules/@sema/gerador-dotnet/dist/index.js +828 -0
- package/node_modules/@sema/gerador-dotnet/dist/index.js.map +1 -0
- package/node_modules/@sema/gerador-dotnet/package.json +7 -0
- package/node_modules/@sema/gerador-html/dist/index.js +17 -17
- package/node_modules/@sema/gerador-lua/dist/index.js +5 -5
- package/node_modules/@sema/gerador-php/dist/index.js +113 -113
- package/node_modules/@sema/gerador-python/dist/index.part02.js +3 -3
- package/node_modules/@sema/gerador-typescript/dist/index.part02.js +11 -11
- package/node_modules/@sema/nucleo/dist/diagnosticos/melhorador.js +42 -42
- package/node_modules/@sema/padroes/dist/index.d.ts +1 -1
- package/package.json +5 -1
|
@@ -8,126 +8,126 @@ export function arquivosInitTemplatesRuntime(template, arquivosBase) {
|
|
|
8
8
|
arquivos = [
|
|
9
9
|
{
|
|
10
10
|
caminhoRelativo: "sema.config.json",
|
|
11
|
-
conteudo: `{
|
|
12
|
-
"origens": ["./contratos"],
|
|
13
|
-
"saida": "./generated",
|
|
14
|
-
"alvos": ["typescript"],
|
|
15
|
-
"alvoPadrao": "typescript",
|
|
16
|
-
"estruturaSaida": "modulos",
|
|
17
|
-
"framework": "base",
|
|
18
|
-
"modoEstrito": true,
|
|
19
|
-
"diretoriosCodigo": ["./src"],
|
|
20
|
-
"fontesLegado": ["firebase", "typescript"],
|
|
21
|
-
"diretoriosSaidaPorAlvo": {
|
|
22
|
-
"typescript": "./generated/typescript"
|
|
23
|
-
},
|
|
24
|
-
"convencoesGeracaoPorProjeto": "base"
|
|
25
|
-
}
|
|
11
|
+
conteudo: `{
|
|
12
|
+
"origens": ["./contratos"],
|
|
13
|
+
"saida": "./generated",
|
|
14
|
+
"alvos": ["typescript"],
|
|
15
|
+
"alvoPadrao": "typescript",
|
|
16
|
+
"estruturaSaida": "modulos",
|
|
17
|
+
"framework": "base",
|
|
18
|
+
"modoEstrito": true,
|
|
19
|
+
"diretoriosCodigo": ["./src"],
|
|
20
|
+
"fontesLegado": ["firebase", "typescript"],
|
|
21
|
+
"diretoriosSaidaPorAlvo": {
|
|
22
|
+
"typescript": "./generated/typescript"
|
|
23
|
+
},
|
|
24
|
+
"convencoesGeracaoPorProjeto": "base"
|
|
25
|
+
}
|
|
26
26
|
`,
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
caminhoRelativo: "contratos/worker_runtime.sema",
|
|
30
|
-
conteudo: `module worker.runtime {
|
|
31
|
-
task publicar_payload_health {
|
|
32
|
-
output {
|
|
33
|
-
status: Texto
|
|
34
|
-
timestamp: Texto
|
|
35
|
-
}
|
|
36
|
-
effects {
|
|
37
|
-
evento payload_health criticidade = alta
|
|
38
|
-
}
|
|
39
|
-
impl {
|
|
40
|
-
ts: src.sema_contract_bridge.semaWorkerHealthPayload
|
|
41
|
-
}
|
|
42
|
-
guarantees {
|
|
43
|
-
status existe
|
|
44
|
-
timestamp existe
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
task inventariar_colecoes {
|
|
49
|
-
output {
|
|
50
|
-
collections: Json
|
|
51
|
-
}
|
|
52
|
-
effects {
|
|
53
|
-
consulta runtime criticidade = baixa
|
|
54
|
-
}
|
|
55
|
-
impl {
|
|
56
|
-
ts: src.sema_contract_bridge.semaCollectionNames
|
|
57
|
-
}
|
|
58
|
-
guarantees {
|
|
59
|
-
collections existe
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
route get_health_worker {
|
|
64
|
-
metodo: GET
|
|
65
|
-
caminho: /health
|
|
66
|
-
task: publicar_payload_health
|
|
67
|
-
}
|
|
68
|
-
}
|
|
30
|
+
conteudo: `module worker.runtime {
|
|
31
|
+
task publicar_payload_health {
|
|
32
|
+
output {
|
|
33
|
+
status: Texto
|
|
34
|
+
timestamp: Texto
|
|
35
|
+
}
|
|
36
|
+
effects {
|
|
37
|
+
evento payload_health criticidade = alta
|
|
38
|
+
}
|
|
39
|
+
impl {
|
|
40
|
+
ts: src.sema_contract_bridge.semaWorkerHealthPayload
|
|
41
|
+
}
|
|
42
|
+
guarantees {
|
|
43
|
+
status existe
|
|
44
|
+
timestamp existe
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
task inventariar_colecoes {
|
|
49
|
+
output {
|
|
50
|
+
collections: Json
|
|
51
|
+
}
|
|
52
|
+
effects {
|
|
53
|
+
consulta runtime criticidade = baixa
|
|
54
|
+
}
|
|
55
|
+
impl {
|
|
56
|
+
ts: src.sema_contract_bridge.semaCollectionNames
|
|
57
|
+
}
|
|
58
|
+
guarantees {
|
|
59
|
+
collections existe
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
route get_health_worker {
|
|
64
|
+
metodo: GET
|
|
65
|
+
caminho: /health
|
|
66
|
+
task: publicar_payload_health
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
69
|
`,
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
caminhoRelativo: "src/config/collections.ts",
|
|
73
|
-
conteudo: `export const COLLECTIONS = {
|
|
74
|
-
worker_status: "worker_status",
|
|
75
|
-
audit_log: "audit_log",
|
|
76
|
-
} as const;
|
|
73
|
+
conteudo: `export const COLLECTIONS = {
|
|
74
|
+
worker_status: "worker_status",
|
|
75
|
+
audit_log: "audit_log",
|
|
76
|
+
} as const;
|
|
77
77
|
`,
|
|
78
78
|
},
|
|
79
79
|
{
|
|
80
80
|
caminhoRelativo: "src/services/health-check.ts",
|
|
81
|
-
conteudo: `import http from "node:http";
|
|
82
|
-
|
|
83
|
-
export type HealthStatus = {
|
|
84
|
-
status: "healthy" | "degraded" | "unhealthy" | "initializing";
|
|
85
|
-
timestamp: string;
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
export type HealthProvider = () => HealthStatus;
|
|
89
|
-
|
|
90
|
-
export function startHealthCheckServer(port: number, provider: HealthProvider) {
|
|
91
|
-
const server = http.createServer((req, res) => {
|
|
92
|
-
if (req.url === "/health" && req.method === "GET") {
|
|
93
|
-
res.writeHead(200, { "Content-Type": "application/json" });
|
|
94
|
-
res.end(JSON.stringify(provider()));
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
res.writeHead(404);
|
|
98
|
-
res.end();
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
server.listen(port);
|
|
102
|
-
return server;
|
|
103
|
-
}
|
|
81
|
+
conteudo: `import http from "node:http";
|
|
82
|
+
|
|
83
|
+
export type HealthStatus = {
|
|
84
|
+
status: "healthy" | "degraded" | "unhealthy" | "initializing";
|
|
85
|
+
timestamp: string;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export type HealthProvider = () => HealthStatus;
|
|
89
|
+
|
|
90
|
+
export function startHealthCheckServer(port: number, provider: HealthProvider) {
|
|
91
|
+
const server = http.createServer((req, res) => {
|
|
92
|
+
if (req.url === "/health" && req.method === "GET") {
|
|
93
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
94
|
+
res.end(JSON.stringify(provider()));
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
res.writeHead(404);
|
|
98
|
+
res.end();
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
server.listen(port);
|
|
102
|
+
return server;
|
|
103
|
+
}
|
|
104
104
|
`,
|
|
105
105
|
},
|
|
106
106
|
{
|
|
107
107
|
caminhoRelativo: "src/sema_contract_bridge.ts",
|
|
108
|
-
conteudo: `import { COLLECTIONS } from "./config/collections";
|
|
109
|
-
import { startHealthCheckServer, type HealthProvider, type HealthStatus } from "./services/health-check";
|
|
110
|
-
|
|
111
|
-
export function semaStartWorkerHealthServer(port: number, provider: HealthProvider) {
|
|
112
|
-
return startHealthCheckServer(port, provider);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export function semaWorkerHealthPayload(payload: HealthStatus): HealthStatus {
|
|
116
|
-
return payload;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export function semaCollectionNames() {
|
|
120
|
-
return COLLECTIONS;
|
|
121
|
-
}
|
|
108
|
+
conteudo: `import { COLLECTIONS } from "./config/collections";
|
|
109
|
+
import { startHealthCheckServer, type HealthProvider, type HealthStatus } from "./services/health-check";
|
|
110
|
+
|
|
111
|
+
export function semaStartWorkerHealthServer(port: number, provider: HealthProvider) {
|
|
112
|
+
return startHealthCheckServer(port, provider);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export function semaWorkerHealthPayload(payload: HealthStatus): HealthStatus {
|
|
116
|
+
return payload;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export function semaCollectionNames() {
|
|
120
|
+
return COLLECTIONS;
|
|
121
|
+
}
|
|
122
122
|
`,
|
|
123
123
|
},
|
|
124
124
|
{
|
|
125
125
|
caminhoRelativo: "README.md",
|
|
126
|
-
conteudo: `# Starter Node Firebase Worker + Sema
|
|
127
|
-
|
|
128
|
-
- Contratos em \`contratos/\`
|
|
129
|
-
- Worker e bridges em \`src/\`
|
|
130
|
-
- \`drift\` valida impl, endpoint de health e recursos Firestore declarados
|
|
126
|
+
conteudo: `# Starter Node Firebase Worker + Sema
|
|
127
|
+
|
|
128
|
+
- Contratos em \`contratos/\`
|
|
129
|
+
- Worker e bridges em \`src/\`
|
|
130
|
+
- \`drift\` valida impl, endpoint de health e recursos Firestore declarados
|
|
131
131
|
`,
|
|
132
132
|
},
|
|
133
133
|
];
|
|
@@ -136,71 +136,71 @@ export function arquivosInitTemplatesRuntime(template, arquivosBase) {
|
|
|
136
136
|
arquivos = [
|
|
137
137
|
{
|
|
138
138
|
caminhoRelativo: "sema.config.json",
|
|
139
|
-
conteudo: `{
|
|
140
|
-
"origens": ["./contratos"],
|
|
141
|
-
"saida": "./generated",
|
|
142
|
-
"alvos": ["typescript"],
|
|
143
|
-
"alvoPadrao": "typescript",
|
|
144
|
-
"estruturaSaida": "modulos",
|
|
145
|
-
"framework": "base",
|
|
146
|
-
"modoEstrito": true,
|
|
147
|
-
"diretoriosCodigo": ["./src"],
|
|
148
|
-
"fontesLegado": ["dotnet"],
|
|
149
|
-
"diretoriosSaidaPorAlvo": {
|
|
150
|
-
"typescript": "./generated/typescript"
|
|
151
|
-
},
|
|
152
|
-
"convencoesGeracaoPorProjeto": "base"
|
|
153
|
-
}
|
|
139
|
+
conteudo: `{
|
|
140
|
+
"origens": ["./contratos"],
|
|
141
|
+
"saida": "./generated",
|
|
142
|
+
"alvos": ["typescript"],
|
|
143
|
+
"alvoPadrao": "typescript",
|
|
144
|
+
"estruturaSaida": "modulos",
|
|
145
|
+
"framework": "base",
|
|
146
|
+
"modoEstrito": true,
|
|
147
|
+
"diretoriosCodigo": ["./src"],
|
|
148
|
+
"fontesLegado": ["dotnet"],
|
|
149
|
+
"diretoriosSaidaPorAlvo": {
|
|
150
|
+
"typescript": "./generated/typescript"
|
|
151
|
+
},
|
|
152
|
+
"convencoesGeracaoPorProjeto": "base"
|
|
153
|
+
}
|
|
154
154
|
`,
|
|
155
155
|
},
|
|
156
156
|
{
|
|
157
157
|
caminhoRelativo: "contratos/health.sema",
|
|
158
|
-
conteudo: `module app.health {
|
|
159
|
-
task get_health {
|
|
160
|
-
output {
|
|
161
|
-
status: Texto
|
|
162
|
-
runtime: Texto
|
|
163
|
-
}
|
|
164
|
-
impl {
|
|
165
|
-
cs: src.Controllers.HealthController.Get
|
|
166
|
-
}
|
|
167
|
-
guarantees {
|
|
168
|
-
status existe
|
|
169
|
-
runtime existe
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
route get_health_publico {
|
|
174
|
-
metodo: GET
|
|
175
|
-
caminho: /api/health
|
|
176
|
-
task: get_health
|
|
177
|
-
}
|
|
178
|
-
}
|
|
158
|
+
conteudo: `module app.health {
|
|
159
|
+
task get_health {
|
|
160
|
+
output {
|
|
161
|
+
status: Texto
|
|
162
|
+
runtime: Texto
|
|
163
|
+
}
|
|
164
|
+
impl {
|
|
165
|
+
cs: src.Controllers.HealthController.Get
|
|
166
|
+
}
|
|
167
|
+
guarantees {
|
|
168
|
+
status existe
|
|
169
|
+
runtime existe
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
route get_health_publico {
|
|
174
|
+
metodo: GET
|
|
175
|
+
caminho: /api/health
|
|
176
|
+
task: get_health
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
179
|
`,
|
|
180
180
|
},
|
|
181
181
|
{
|
|
182
182
|
caminhoRelativo: "src/Controllers/HealthController.cs",
|
|
183
|
-
conteudo: `using Microsoft.AspNetCore.Mvc;
|
|
184
|
-
|
|
185
|
-
[ApiController]
|
|
186
|
-
[Route("api/health")]
|
|
187
|
-
public class HealthController : ControllerBase
|
|
188
|
-
{
|
|
189
|
-
[HttpGet]
|
|
190
|
-
public object Get()
|
|
191
|
-
{
|
|
192
|
-
return new { status = "ok", runtime = "aspnet" };
|
|
193
|
-
}
|
|
194
|
-
}
|
|
183
|
+
conteudo: `using Microsoft.AspNetCore.Mvc;
|
|
184
|
+
|
|
185
|
+
[ApiController]
|
|
186
|
+
[Route("api/health")]
|
|
187
|
+
public class HealthController : ControllerBase
|
|
188
|
+
{
|
|
189
|
+
[HttpGet]
|
|
190
|
+
public object Get()
|
|
191
|
+
{
|
|
192
|
+
return new { status = "ok", runtime = "aspnet" };
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
195
|
`,
|
|
196
196
|
},
|
|
197
197
|
{
|
|
198
198
|
caminhoRelativo: "README.md",
|
|
199
|
-
conteudo: `# Starter ASP.NET Core API + Sema
|
|
200
|
-
|
|
201
|
-
- Contratos em \`contratos/\`
|
|
202
|
-
- Controllers/Minimal API em \`src/\`
|
|
203
|
-
- \`drift\` valida impl e rota publica
|
|
199
|
+
conteudo: `# Starter ASP.NET Core API + Sema
|
|
200
|
+
|
|
201
|
+
- Contratos em \`contratos/\`
|
|
202
|
+
- Controllers/Minimal API em \`src/\`
|
|
203
|
+
- \`drift\` valida impl e rota publica
|
|
204
204
|
`,
|
|
205
205
|
},
|
|
206
206
|
];
|
|
@@ -209,74 +209,74 @@ export function arquivosInitTemplatesRuntime(template, arquivosBase) {
|
|
|
209
209
|
arquivos = [
|
|
210
210
|
{
|
|
211
211
|
caminhoRelativo: "sema.config.json",
|
|
212
|
-
conteudo: `{
|
|
213
|
-
"origens": ["./contratos"],
|
|
214
|
-
"saida": "./generated",
|
|
215
|
-
"alvos": ["typescript"],
|
|
216
|
-
"alvoPadrao": "typescript",
|
|
217
|
-
"estruturaSaida": "modulos",
|
|
218
|
-
"framework": "base",
|
|
219
|
-
"modoEstrito": true,
|
|
220
|
-
"diretoriosCodigo": ["./src"],
|
|
221
|
-
"fontesLegado": ["java"],
|
|
222
|
-
"diretoriosSaidaPorAlvo": {
|
|
223
|
-
"typescript": "./generated/typescript"
|
|
224
|
-
},
|
|
225
|
-
"convencoesGeracaoPorProjeto": "base"
|
|
226
|
-
}
|
|
212
|
+
conteudo: `{
|
|
213
|
+
"origens": ["./contratos"],
|
|
214
|
+
"saida": "./generated",
|
|
215
|
+
"alvos": ["typescript"],
|
|
216
|
+
"alvoPadrao": "typescript",
|
|
217
|
+
"estruturaSaida": "modulos",
|
|
218
|
+
"framework": "base",
|
|
219
|
+
"modoEstrito": true,
|
|
220
|
+
"diretoriosCodigo": ["./src"],
|
|
221
|
+
"fontesLegado": ["java"],
|
|
222
|
+
"diretoriosSaidaPorAlvo": {
|
|
223
|
+
"typescript": "./generated/typescript"
|
|
224
|
+
},
|
|
225
|
+
"convencoesGeracaoPorProjeto": "base"
|
|
226
|
+
}
|
|
227
227
|
`,
|
|
228
228
|
},
|
|
229
229
|
{
|
|
230
230
|
caminhoRelativo: "contratos/health.sema",
|
|
231
|
-
conteudo: `module app.health {
|
|
232
|
-
task get_health {
|
|
233
|
-
output {
|
|
234
|
-
status: Texto
|
|
235
|
-
runtime: Texto
|
|
236
|
-
}
|
|
237
|
-
impl {
|
|
238
|
-
java: src.main.java.com.acme.health.HealthController.health
|
|
239
|
-
}
|
|
240
|
-
guarantees {
|
|
241
|
-
status existe
|
|
242
|
-
runtime existe
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
route get_health_publico {
|
|
247
|
-
metodo: GET
|
|
248
|
-
caminho: /api/health
|
|
249
|
-
task: get_health
|
|
250
|
-
}
|
|
251
|
-
}
|
|
231
|
+
conteudo: `module app.health {
|
|
232
|
+
task get_health {
|
|
233
|
+
output {
|
|
234
|
+
status: Texto
|
|
235
|
+
runtime: Texto
|
|
236
|
+
}
|
|
237
|
+
impl {
|
|
238
|
+
java: src.main.java.com.acme.health.HealthController.health
|
|
239
|
+
}
|
|
240
|
+
guarantees {
|
|
241
|
+
status existe
|
|
242
|
+
runtime existe
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
route get_health_publico {
|
|
247
|
+
metodo: GET
|
|
248
|
+
caminho: /api/health
|
|
249
|
+
task: get_health
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
252
|
`,
|
|
253
253
|
},
|
|
254
254
|
{
|
|
255
255
|
caminhoRelativo: "src/main/java/com/acme/health/HealthController.java",
|
|
256
|
-
conteudo: `package com.acme.health;
|
|
257
|
-
|
|
258
|
-
import java.util.Map;
|
|
259
|
-
import org.springframework.web.bind.annotation.GetMapping;
|
|
260
|
-
import org.springframework.web.bind.annotation.RequestMapping;
|
|
261
|
-
import org.springframework.web.bind.annotation.RestController;
|
|
262
|
-
|
|
263
|
-
@RestController
|
|
264
|
-
@RequestMapping("/api/health")
|
|
265
|
-
public class HealthController {
|
|
266
|
-
@GetMapping
|
|
267
|
-
public Map<String, String> health() {
|
|
268
|
-
return Map.of("status", "ok", "runtime", "spring");
|
|
269
|
-
}
|
|
270
|
-
}
|
|
256
|
+
conteudo: `package com.acme.health;
|
|
257
|
+
|
|
258
|
+
import java.util.Map;
|
|
259
|
+
import org.springframework.web.bind.annotation.GetMapping;
|
|
260
|
+
import org.springframework.web.bind.annotation.RequestMapping;
|
|
261
|
+
import org.springframework.web.bind.annotation.RestController;
|
|
262
|
+
|
|
263
|
+
@RestController
|
|
264
|
+
@RequestMapping("/api/health")
|
|
265
|
+
public class HealthController {
|
|
266
|
+
@GetMapping
|
|
267
|
+
public Map<String, String> health() {
|
|
268
|
+
return Map.of("status", "ok", "runtime", "spring");
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
271
|
`,
|
|
272
272
|
},
|
|
273
273
|
{
|
|
274
274
|
caminhoRelativo: "README.md",
|
|
275
|
-
conteudo: `# Starter Spring Boot API + Sema
|
|
276
|
-
|
|
277
|
-
- Contratos em \`contratos/\`
|
|
278
|
-
- Controllers REST em \`src/main/java/\`
|
|
279
|
-
- \`drift\` valida impl e rota publica
|
|
275
|
+
conteudo: `# Starter Spring Boot API + Sema
|
|
276
|
+
|
|
277
|
+
- Contratos em \`contratos/\`
|
|
278
|
+
- Controllers REST em \`src/main/java/\`
|
|
279
|
+
- \`drift\` valida impl e rota publica
|
|
280
280
|
`,
|
|
281
281
|
},
|
|
282
282
|
];
|
|
@@ -285,68 +285,68 @@ export function arquivosInitTemplatesRuntime(template, arquivosBase) {
|
|
|
285
285
|
arquivos = [
|
|
286
286
|
{
|
|
287
287
|
caminhoRelativo: "sema.config.json",
|
|
288
|
-
conteudo: `{
|
|
289
|
-
"origens": ["./contratos"],
|
|
290
|
-
"saida": "./generated",
|
|
291
|
-
"alvos": ["typescript"],
|
|
292
|
-
"alvoPadrao": "typescript",
|
|
293
|
-
"estruturaSaida": "modulos",
|
|
294
|
-
"framework": "base",
|
|
295
|
-
"modoEstrito": true,
|
|
296
|
-
"diretoriosCodigo": ["./internal"],
|
|
297
|
-
"fontesLegado": ["go"],
|
|
298
|
-
"diretoriosSaidaPorAlvo": {
|
|
299
|
-
"typescript": "./generated/typescript"
|
|
300
|
-
},
|
|
301
|
-
"convencoesGeracaoPorProjeto": "base"
|
|
302
|
-
}
|
|
288
|
+
conteudo: `{
|
|
289
|
+
"origens": ["./contratos"],
|
|
290
|
+
"saida": "./generated",
|
|
291
|
+
"alvos": ["typescript"],
|
|
292
|
+
"alvoPadrao": "typescript",
|
|
293
|
+
"estruturaSaida": "modulos",
|
|
294
|
+
"framework": "base",
|
|
295
|
+
"modoEstrito": true,
|
|
296
|
+
"diretoriosCodigo": ["./internal"],
|
|
297
|
+
"fontesLegado": ["go"],
|
|
298
|
+
"diretoriosSaidaPorAlvo": {
|
|
299
|
+
"typescript": "./generated/typescript"
|
|
300
|
+
},
|
|
301
|
+
"convencoesGeracaoPorProjeto": "base"
|
|
302
|
+
}
|
|
303
303
|
`,
|
|
304
304
|
},
|
|
305
305
|
{
|
|
306
306
|
caminhoRelativo: "contratos/health.sema",
|
|
307
|
-
conteudo: `module app.health {
|
|
308
|
-
task get_health {
|
|
309
|
-
output {
|
|
310
|
-
resultado: Json
|
|
311
|
-
}
|
|
312
|
-
impl {
|
|
313
|
-
go: internal.health.getHealth
|
|
314
|
-
}
|
|
315
|
-
guarantees {
|
|
316
|
-
resultado existe
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
route get_health_publico {
|
|
321
|
-
metodo: GET
|
|
322
|
-
caminho: /health
|
|
323
|
-
task: get_health
|
|
324
|
-
}
|
|
325
|
-
}
|
|
307
|
+
conteudo: `module app.health {
|
|
308
|
+
task get_health {
|
|
309
|
+
output {
|
|
310
|
+
resultado: Json
|
|
311
|
+
}
|
|
312
|
+
impl {
|
|
313
|
+
go: internal.health.getHealth
|
|
314
|
+
}
|
|
315
|
+
guarantees {
|
|
316
|
+
resultado existe
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
route get_health_publico {
|
|
321
|
+
metodo: GET
|
|
322
|
+
caminho: /health
|
|
323
|
+
task: get_health
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
326
|
`,
|
|
327
327
|
},
|
|
328
328
|
{
|
|
329
329
|
caminhoRelativo: "internal/health.go",
|
|
330
|
-
conteudo: `package internal
|
|
331
|
-
|
|
332
|
-
import "github.com/gin-gonic/gin"
|
|
333
|
-
|
|
334
|
-
func registerRoutes(router *gin.Engine) {
|
|
335
|
-
router.GET("/health", getHealth)
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
func getHealth(ctx *gin.Context) {
|
|
339
|
-
ctx.JSON(200, gin.H{"status": "ok", "runtime": "go"})
|
|
340
|
-
}
|
|
330
|
+
conteudo: `package internal
|
|
331
|
+
|
|
332
|
+
import "github.com/gin-gonic/gin"
|
|
333
|
+
|
|
334
|
+
func registerRoutes(router *gin.Engine) {
|
|
335
|
+
router.GET("/health", getHealth)
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
func getHealth(ctx *gin.Context) {
|
|
339
|
+
ctx.JSON(200, gin.H{"status": "ok", "runtime": "go"})
|
|
340
|
+
}
|
|
341
341
|
`,
|
|
342
342
|
},
|
|
343
343
|
{
|
|
344
344
|
caminhoRelativo: "README.md",
|
|
345
|
-
conteudo: `# Starter Go HTTP API + Sema
|
|
346
|
-
|
|
347
|
-
- Contratos em \`contratos/\`
|
|
348
|
-
- Handlers em \`internal/\`
|
|
349
|
-
- \`drift\` valida impl e rota publica
|
|
345
|
+
conteudo: `# Starter Go HTTP API + Sema
|
|
346
|
+
|
|
347
|
+
- Contratos em \`contratos/\`
|
|
348
|
+
- Handlers em \`internal/\`
|
|
349
|
+
- \`drift\` valida impl e rota publica
|
|
350
350
|
`,
|
|
351
351
|
},
|
|
352
352
|
];
|
|
@@ -355,71 +355,71 @@ export function arquivosInitTemplatesRuntime(template, arquivosBase) {
|
|
|
355
355
|
arquivos = [
|
|
356
356
|
{
|
|
357
357
|
caminhoRelativo: "sema.config.json",
|
|
358
|
-
conteudo: `{
|
|
359
|
-
"origens": ["./contratos"],
|
|
360
|
-
"saida": "./generated",
|
|
361
|
-
"alvos": ["typescript"],
|
|
362
|
-
"alvoPadrao": "typescript",
|
|
363
|
-
"estruturaSaida": "modulos",
|
|
364
|
-
"framework": "base",
|
|
365
|
-
"modoEstrito": true,
|
|
366
|
-
"diretoriosCodigo": ["./src"],
|
|
367
|
-
"fontesLegado": ["rust"],
|
|
368
|
-
"diretoriosSaidaPorAlvo": {
|
|
369
|
-
"typescript": "./generated/typescript"
|
|
370
|
-
},
|
|
371
|
-
"convencoesGeracaoPorProjeto": "base"
|
|
372
|
-
}
|
|
358
|
+
conteudo: `{
|
|
359
|
+
"origens": ["./contratos"],
|
|
360
|
+
"saida": "./generated",
|
|
361
|
+
"alvos": ["typescript"],
|
|
362
|
+
"alvoPadrao": "typescript",
|
|
363
|
+
"estruturaSaida": "modulos",
|
|
364
|
+
"framework": "base",
|
|
365
|
+
"modoEstrito": true,
|
|
366
|
+
"diretoriosCodigo": ["./src"],
|
|
367
|
+
"fontesLegado": ["rust"],
|
|
368
|
+
"diretoriosSaidaPorAlvo": {
|
|
369
|
+
"typescript": "./generated/typescript"
|
|
370
|
+
},
|
|
371
|
+
"convencoesGeracaoPorProjeto": "base"
|
|
372
|
+
}
|
|
373
373
|
`,
|
|
374
374
|
},
|
|
375
375
|
{
|
|
376
376
|
caminhoRelativo: "contratos/health.sema",
|
|
377
|
-
conteudo: `module app.health {
|
|
378
|
-
task get_health {
|
|
379
|
-
output {
|
|
380
|
-
resultado: Json
|
|
381
|
-
}
|
|
382
|
-
impl {
|
|
383
|
-
rust: src.handlers.health
|
|
384
|
-
}
|
|
385
|
-
guarantees {
|
|
386
|
-
resultado existe
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
route get_health_publico {
|
|
391
|
-
metodo: GET
|
|
392
|
-
caminho: /health
|
|
393
|
-
task: get_health
|
|
394
|
-
}
|
|
395
|
-
}
|
|
377
|
+
conteudo: `module app.health {
|
|
378
|
+
task get_health {
|
|
379
|
+
output {
|
|
380
|
+
resultado: Json
|
|
381
|
+
}
|
|
382
|
+
impl {
|
|
383
|
+
rust: src.handlers.health
|
|
384
|
+
}
|
|
385
|
+
guarantees {
|
|
386
|
+
resultado existe
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
route get_health_publico {
|
|
391
|
+
metodo: GET
|
|
392
|
+
caminho: /health
|
|
393
|
+
task: get_health
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
396
|
`,
|
|
397
397
|
},
|
|
398
398
|
{
|
|
399
399
|
caminhoRelativo: "src/main.rs",
|
|
400
|
-
conteudo: `use axum::{routing::get, Router};
|
|
401
|
-
|
|
402
|
-
mod handlers;
|
|
403
|
-
|
|
404
|
-
fn app() -> Router {
|
|
405
|
-
Router::new().route("/health", get(handlers::health))
|
|
406
|
-
}
|
|
400
|
+
conteudo: `use axum::{routing::get, Router};
|
|
401
|
+
|
|
402
|
+
mod handlers;
|
|
403
|
+
|
|
404
|
+
fn app() -> Router {
|
|
405
|
+
Router::new().route("/health", get(handlers::health))
|
|
406
|
+
}
|
|
407
407
|
`,
|
|
408
408
|
},
|
|
409
409
|
{
|
|
410
410
|
caminhoRelativo: "src/handlers.rs",
|
|
411
|
-
conteudo: `pub async fn health() -> &'static str {
|
|
412
|
-
"ok"
|
|
413
|
-
}
|
|
411
|
+
conteudo: `pub async fn health() -> &'static str {
|
|
412
|
+
"ok"
|
|
413
|
+
}
|
|
414
414
|
`,
|
|
415
415
|
},
|
|
416
416
|
{
|
|
417
417
|
caminhoRelativo: "README.md",
|
|
418
|
-
conteudo: `# Starter Rust Axum API + Sema
|
|
419
|
-
|
|
420
|
-
- Contratos em \`contratos/\`
|
|
421
|
-
- Handlers em \`src/\`
|
|
422
|
-
- \`drift\` valida impl e rota publica
|
|
418
|
+
conteudo: `# Starter Rust Axum API + Sema
|
|
419
|
+
|
|
420
|
+
- Contratos em \`contratos/\`
|
|
421
|
+
- Handlers em \`src/\`
|
|
422
|
+
- \`drift\` valida impl e rota publica
|
|
423
423
|
`,
|
|
424
424
|
},
|
|
425
425
|
];
|
|
@@ -428,60 +428,60 @@ export function arquivosInitTemplatesRuntime(template, arquivosBase) {
|
|
|
428
428
|
arquivos = [
|
|
429
429
|
{
|
|
430
430
|
caminhoRelativo: "sema.config.json",
|
|
431
|
-
conteudo: `{
|
|
432
|
-
"origens": ["./contratos"],
|
|
433
|
-
"saida": "./generated",
|
|
434
|
-
"alvos": ["typescript"],
|
|
435
|
-
"alvoPadrao": "typescript",
|
|
436
|
-
"estruturaSaida": "modulos",
|
|
437
|
-
"framework": "base",
|
|
438
|
-
"modoEstrito": true,
|
|
439
|
-
"diretoriosCodigo": ["./src"],
|
|
440
|
-
"fontesLegado": ["cpp"],
|
|
441
|
-
"diretoriosSaidaPorAlvo": {
|
|
442
|
-
"typescript": "./generated/typescript"
|
|
443
|
-
},
|
|
444
|
-
"convencoesGeracaoPorProjeto": "base"
|
|
445
|
-
}
|
|
431
|
+
conteudo: `{
|
|
432
|
+
"origens": ["./contratos"],
|
|
433
|
+
"saida": "./generated",
|
|
434
|
+
"alvos": ["typescript"],
|
|
435
|
+
"alvoPadrao": "typescript",
|
|
436
|
+
"estruturaSaida": "modulos",
|
|
437
|
+
"framework": "base",
|
|
438
|
+
"modoEstrito": true,
|
|
439
|
+
"diretoriosCodigo": ["./src"],
|
|
440
|
+
"fontesLegado": ["cpp"],
|
|
441
|
+
"diretoriosSaidaPorAlvo": {
|
|
442
|
+
"typescript": "./generated/typescript"
|
|
443
|
+
},
|
|
444
|
+
"convencoesGeracaoPorProjeto": "base"
|
|
445
|
+
}
|
|
446
446
|
`,
|
|
447
447
|
},
|
|
448
448
|
{
|
|
449
449
|
caminhoRelativo: "contratos/runtime_bridge.sema",
|
|
450
|
-
conteudo: `module app.runtime_bridge {
|
|
451
|
-
task processar_snapshot {
|
|
452
|
-
input {
|
|
453
|
-
payload: Json required
|
|
454
|
-
}
|
|
455
|
-
output {
|
|
456
|
-
resultado: Json
|
|
457
|
-
}
|
|
458
|
-
impl {
|
|
459
|
-
cpp: src.runtime.RuntimeBridge.processSnapshot
|
|
460
|
-
}
|
|
461
|
-
guarantees {
|
|
462
|
-
resultado existe
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
}
|
|
450
|
+
conteudo: `module app.runtime_bridge {
|
|
451
|
+
task processar_snapshot {
|
|
452
|
+
input {
|
|
453
|
+
payload: Json required
|
|
454
|
+
}
|
|
455
|
+
output {
|
|
456
|
+
resultado: Json
|
|
457
|
+
}
|
|
458
|
+
impl {
|
|
459
|
+
cpp: src.runtime.RuntimeBridge.processSnapshot
|
|
460
|
+
}
|
|
461
|
+
guarantees {
|
|
462
|
+
resultado existe
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
466
|
`,
|
|
467
467
|
},
|
|
468
468
|
{
|
|
469
469
|
caminhoRelativo: "src/runtime.cpp",
|
|
470
|
-
conteudo: `class RuntimeBridge {
|
|
471
|
-
public:
|
|
472
|
-
int processSnapshot(int payload) {
|
|
473
|
-
return payload;
|
|
474
|
-
}
|
|
475
|
-
};
|
|
470
|
+
conteudo: `class RuntimeBridge {
|
|
471
|
+
public:
|
|
472
|
+
int processSnapshot(int payload) {
|
|
473
|
+
return payload;
|
|
474
|
+
}
|
|
475
|
+
};
|
|
476
476
|
`,
|
|
477
477
|
},
|
|
478
478
|
{
|
|
479
479
|
caminhoRelativo: "README.md",
|
|
480
|
-
conteudo: `# Starter C++ Service Bridge + Sema
|
|
481
|
-
|
|
482
|
-
- Contratos em \`contratos/\`
|
|
483
|
-
- Symbols e bridges em \`src/\`
|
|
484
|
-
- \`drift\` valida impl de simbolos, sem prometer rota HTTP
|
|
480
|
+
conteudo: `# Starter C++ Service Bridge + Sema
|
|
481
|
+
|
|
482
|
+
- Contratos em \`contratos/\`
|
|
483
|
+
- Symbols e bridges em \`src/\`
|
|
484
|
+
- \`drift\` valida impl de simbolos, sem prometer rota HTTP
|
|
485
485
|
`,
|
|
486
486
|
},
|
|
487
487
|
];
|