@semacode/cli 2.0.1 → 2.2.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 (134) hide show
  1. package/LICENSE +39 -39
  2. package/README.md +141 -121
  3. package/dist/agentEntryPoints.js +499 -499
  4. package/dist/comandos.js +2 -0
  5. package/dist/doctorCommand.js +28 -0
  6. package/dist/execucoesExternas.js +19 -5
  7. package/dist/geracaoCore.js +97 -1
  8. package/dist/iaPrompts.d.ts +1 -1
  9. package/dist/iaPrompts.js +307 -307
  10. package/dist/index.d.ts +1 -0
  11. package/dist/index.js +1 -0
  12. package/dist/index.part01.d.ts +1 -1
  13. package/dist/index.part01.js +14 -4
  14. package/dist/index.part02.js +21 -21
  15. package/dist/index.part04.js +96 -96
  16. package/dist/index.part06.js +1 -1
  17. package/dist/index.part07.js +35 -24
  18. package/dist/init/templates.part01.js +393 -393
  19. package/dist/init/templates.part02.js +189 -189
  20. package/dist/initTemplatesBackend.js +73 -73
  21. package/dist/initTemplatesBase.js +81 -81
  22. package/dist/initTemplatesFlutter.js +137 -137
  23. package/dist/initTemplatesRuntime.js +350 -350
  24. package/dist/initTemplatesWeb.js +309 -309
  25. package/dist/nativeToolchains.d.ts +15 -0
  26. package/dist/nativeToolchains.js +132 -0
  27. package/dist/pipelineConteudo/adapters.d.ts +84 -0
  28. package/dist/pipelineConteudo/adapters.js +449 -0
  29. package/dist/pipelineConteudo/canonical.d.ts +18 -0
  30. package/dist/pipelineConteudo/canonical.js +107 -0
  31. package/dist/pipelineConteudo/command.d.ts +3 -0
  32. package/dist/pipelineConteudo/command.js +572 -0
  33. package/dist/pipelineConteudo/index.d.ts +9 -0
  34. package/dist/pipelineConteudo/index.js +12 -0
  35. package/dist/pipelineConteudo/ledger.d.ts +68 -0
  36. package/dist/pipelineConteudo/ledger.js +732 -0
  37. package/dist/pipelineConteudo/planner.d.ts +12 -0
  38. package/dist/pipelineConteudo/planner.js +366 -0
  39. package/dist/pipelineConteudo/projection.d.ts +16 -0
  40. package/dist/pipelineConteudo/projection.js +57 -0
  41. package/dist/pipelineConteudo/state.d.ts +23 -0
  42. package/dist/pipelineConteudo/state.js +615 -0
  43. package/dist/pipelineConteudo/trust.d.ts +17 -0
  44. package/dist/pipelineConteudo/trust.js +750 -0
  45. package/dist/pipelineConteudo/types.d.ts +331 -0
  46. package/dist/pipelineConteudo/types.js +4 -0
  47. package/dist/projetoConfig.js +7 -1
  48. package/dist/projetoResolucao.js +21 -6
  49. package/dist/sync/index.js +35 -35
  50. package/docs/README.md +28 -25
  51. package/docs/ai-onboarding.md +62 -62
  52. package/docs/ai-workflow.md +1 -1
  53. package/docs/auth.md +26 -26
  54. package/docs/cli.md +79 -72
  55. package/docs/commands.md +1 -1
  56. package/docs/database.md +15 -15
  57. package/docs/deploy.md +41 -36
  58. package/docs/documentation.md +39 -39
  59. package/docs/env.md +16 -16
  60. package/docs/frontend.md +41 -41
  61. package/docs/getting-started.md +57 -57
  62. package/docs/i18n.md +15 -15
  63. package/docs/pipeline-conteudo.md +246 -0
  64. package/docs/profiles.md +45 -43
  65. package/docs/repositories.md +43 -43
  66. package/docs/rollback.md +31 -31
  67. package/docs/security.md +32 -32
  68. package/docs/support.md +8 -8
  69. package/docs/syntax.md +1 -1
  70. package/docs/testing.md +35 -28
  71. package/docs/vocabulary.md +29 -29
  72. package/exemplos/agendamento.sema +1 -1
  73. package/exemplos/assinatura.sema +1 -1
  74. package/exemplos/auditoria.sema +1 -1
  75. package/exemplos/autenticacao.sema +1 -1
  76. package/exemplos/author_obra_comum.sema +1 -1
  77. package/exemplos/author_tema_sensivel.sema +1 -1
  78. package/exemplos/automacao.sema +1 -1
  79. package/exemplos/cadastro_usuario.sema +1 -1
  80. package/exemplos/calculadora.sema +1 -1
  81. package/exemplos/crud_simples.sema +1 -1
  82. package/exemplos/estoque.sema +1 -1
  83. package/exemplos/exportacao.sema +1 -1
  84. package/exemplos/fila.sema +1 -1
  85. package/exemplos/integracao_externa.sema +1 -1
  86. package/exemplos/multi_tenant.sema +1 -1
  87. package/exemplos/notificacao.sema +1 -1
  88. package/exemplos/operacao_estrategia.sema +132 -132
  89. package/exemplos/operacao_estrategia_discovery.sema +220 -220
  90. package/exemplos/operacao_estrategia_fluxo.sema +114 -114
  91. package/exemplos/operacao_estrategia_gates.sema +106 -106
  92. package/exemplos/operacao_estrategia_quarentena.sema +133 -133
  93. package/exemplos/operacao_estrategia_rollout.sema +124 -124
  94. package/exemplos/pagamento.sema +1 -1
  95. package/exemplos/pagamento_dominio.sema +1 -1
  96. package/exemplos/pedido.sema +1 -1
  97. package/exemplos/permissao.sema +1 -1
  98. package/exemplos/persistencia_vendor_first.sema +1 -1
  99. package/exemplos/pipeline-conteudo/README.md +44 -0
  100. package/exemplos/pipeline-conteudo/alvos.json +23 -0
  101. package/exemplos/pipeline-conteudo/definicao.json +136 -0
  102. package/exemplos/profile_conversas.sema +165 -165
  103. package/exemplos/profile_game.sema +1 -1
  104. package/exemplos/profile_legal.sema +1 -1
  105. package/exemplos/profile_ops.sema +1 -1
  106. package/exemplos/profile_research.sema +1 -1
  107. package/exemplos/profile_software.sema +1 -1
  108. package/exemplos/profile_workflow_n8n.sema +1 -1
  109. package/exemplos/relatorio.sema +1 -1
  110. package/exemplos/replica_analitica_erp.sema +1 -1
  111. package/exemplos/testes_embutidos.sema +1 -1
  112. package/exemplos/tratamento_erro.sema +1 -1
  113. package/exemplos/upload_arquivo.sema +1 -1
  114. package/exemplos/webhook.sema +1 -1
  115. package/node_modules/@sema/gerador-cpp/dist/index.d.ts +3 -0
  116. package/node_modules/@sema/gerador-cpp/dist/index.js +859 -0
  117. package/node_modules/@sema/gerador-cpp/dist/index.js.map +1 -0
  118. package/node_modules/@sema/gerador-cpp/package.json +7 -0
  119. package/node_modules/@sema/gerador-css/dist/index.part01.js +10 -10
  120. package/node_modules/@sema/gerador-css/dist/index.part02.js +460 -460
  121. package/node_modules/@sema/gerador-dotnet/dist/index.d.ts +3 -0
  122. package/node_modules/@sema/gerador-dotnet/dist/index.js +828 -0
  123. package/node_modules/@sema/gerador-dotnet/dist/index.js.map +1 -0
  124. package/node_modules/@sema/gerador-dotnet/package.json +7 -0
  125. package/node_modules/@sema/gerador-html/dist/index.js +17 -17
  126. package/node_modules/@sema/gerador-lua/dist/index.js +53 -8
  127. package/node_modules/@sema/gerador-lua/dist/index.js.map +1 -1
  128. package/node_modules/@sema/gerador-php/dist/index.js +121 -113
  129. package/node_modules/@sema/gerador-php/dist/index.js.map +1 -1
  130. package/node_modules/@sema/gerador-python/dist/index.part02.js +3 -3
  131. package/node_modules/@sema/gerador-typescript/dist/index.part02.js +11 -11
  132. package/node_modules/@sema/nucleo/dist/diagnosticos/melhorador.js +42 -42
  133. package/node_modules/@sema/padroes/dist/index.d.ts +1 -1
  134. package/package.json +12 -1
@@ -0,0 +1,331 @@
1
+ export type JsonPrimitivo = string | number | boolean | null;
2
+ export type JsonValor = JsonPrimitivo | JsonObjeto | readonly JsonValor[];
3
+ export interface JsonObjeto {
4
+ readonly [chave: string]: JsonValor;
5
+ }
6
+ export interface MetadataPublicaConteudo {
7
+ readonly [chave: string]: JsonPrimitivo;
8
+ }
9
+ export type VereditoConteudo = "NAO_AVALIADO" | "APROVADO" | "REPROVADO" | "INCONCLUSIVO";
10
+ export type EstadoEvidenciaConteudo = "DECLARADA" | "ACEITA" | "REJEITADA" | "EXPIRADA" | "REVOGADA" | "SUPERADA";
11
+ export type ModoAvaliacaoConteudo = "DETERMINISTICA" | "IA_ESPECIALIZADA" | "HIBRIDA";
12
+ export type CondicaoOperacionalConteudo = "PENDENTE" | "PRONTA" | "EXECUTANDO" | "AGUARDANDO_EVIDENCIA" | "AGUARDANDO_EVENTO_EXTERNO" | "FERRAMENTA_INDISPONIVEL" | "CAPACIDADE_AUSENTE" | "AUTORIZACAO_AUSENTE" | "FALHA_TRANSITORIA" | "FALHA_TERMINAL" | "EXECUCAO_ENCERRADA";
13
+ export type EscopoEtapaConteudo = "GLOBAL" | "POR_ALVO";
14
+ export type ResultadoAvaliacaoConteudo = "APROVADO" | "REPROVADO" | "INCONCLUSIVO";
15
+ export interface PrincipalConteudo {
16
+ readonly principalId: string;
17
+ readonly keyId: string;
18
+ readonly controlDomain: string;
19
+ readonly papeis: readonly string[];
20
+ readonly capabilities: readonly string[];
21
+ readonly scopes: readonly string[];
22
+ readonly publicKeyPem: string;
23
+ }
24
+ /**
25
+ * Raiz publica de confianca. Chaves privadas nunca pertencem a esta configuracao
26
+ * nem ao workspace canonico do pipeline.
27
+ */
28
+ export interface ConfiguracaoConfiancaConteudo {
29
+ readonly trustDomainId: string;
30
+ readonly principals: readonly PrincipalConteudo[];
31
+ readonly revokedKeyIds: readonly string[];
32
+ readonly maxEnvelopeAgeMs?: number;
33
+ readonly maxFutureSkewMs?: number;
34
+ readonly schemaVersionsAceitas?: readonly string[];
35
+ }
36
+ export interface ResultadoValidacaoConfiguracaoConfiancaConteudo {
37
+ readonly valida: boolean;
38
+ readonly trustRootDigest: string;
39
+ readonly revocationDigest: string;
40
+ readonly fingerprints: readonly string[];
41
+ readonly bloqueios: readonly string[];
42
+ }
43
+ export interface EnvelopeAssinavelConteudo<TPayload = JsonValor> {
44
+ readonly schemaVersion: string;
45
+ readonly payloadType: string;
46
+ readonly payload: TPayload;
47
+ readonly principalId: string;
48
+ readonly keyId: string;
49
+ readonly issuedAt: string;
50
+ readonly nonce: string;
51
+ readonly signatureAlgorithm: "Ed25519";
52
+ }
53
+ export interface EnvelopeAssinadoConteudo<TPayload = JsonValor> extends EnvelopeAssinavelConteudo<TPayload> {
54
+ /** Assinatura Ed25519 em base64 do JSON canonico de EnvelopeAssinavelConteudo. */
55
+ readonly signature: string;
56
+ }
57
+ export interface OpcoesVerificacaoEnvelopeConteudo {
58
+ /** Pins fornecidos por uma fronteira externa; nunca podem ser derivados da configuracao recebida. */
59
+ readonly trustRootDigestEsperado: string;
60
+ readonly revocationDigestEsperado: string;
61
+ readonly payloadTypeEsperado: string;
62
+ readonly capabilityRequerida?: string;
63
+ readonly scopeRequerido?: string;
64
+ readonly papelRequerido?: string;
65
+ readonly papeisPermitidos?: readonly string[];
66
+ readonly agora?: string | Date | number;
67
+ readonly maxEnvelopeAgeMs?: number;
68
+ readonly maxFutureSkewMs?: number;
69
+ /** Nonces ja observados. A verificacao e pura e nao altera este conjunto. */
70
+ readonly noncesUsados?: ReadonlySet<string>;
71
+ }
72
+ export interface EnvelopeVerificadoConteudo<TPayload = JsonValor> {
73
+ readonly estado: "ACEITA";
74
+ readonly digest: string;
75
+ readonly principal: PrincipalConteudo;
76
+ readonly envelope: EnvelopeAssinadoConteudo<TPayload>;
77
+ readonly payload: TPayload;
78
+ }
79
+ export interface ResultadoVerificacaoEnvelopeConteudo<TPayload = JsonValor> {
80
+ readonly valido: boolean;
81
+ readonly digest: string;
82
+ readonly principal?: PrincipalConteudo;
83
+ readonly envelopeVerificado?: EnvelopeVerificadoConteudo<TPayload>;
84
+ readonly bloqueios: readonly string[];
85
+ }
86
+ /** Contexto anti-replay que faz parte do payload assinado de todo evento. */
87
+ export interface ContextoAssinadoEventoConteudo {
88
+ readonly runId: string;
89
+ readonly trustDomainId: string;
90
+ readonly trustRootDigest: string;
91
+ readonly ledgerId: string;
92
+ readonly policyDigest: string;
93
+ readonly definitionDigest: string;
94
+ }
95
+ /** Eventos ligados a um alvo/conta carregam tambem o escopo derivado pelo planner. */
96
+ export interface ContextoAutorizadoEventoConteudo extends ContextoAssinadoEventoConteudo {
97
+ readonly authorizationScope: string;
98
+ }
99
+ /** Declaracao do runner/produtor. So vira evidencia depois de um atestado confiavel. */
100
+ export interface AlegacaoEvidenciaConteudo extends ContextoAutorizadoEventoConteudo {
101
+ readonly kind: "EVIDENCE_CLAIMED";
102
+ readonly claimId: string;
103
+ readonly stageId: string;
104
+ readonly targetId?: string;
105
+ readonly artifactDigest: string;
106
+ readonly evidenceType: string;
107
+ readonly producerId: string;
108
+ readonly claimedAt: string;
109
+ readonly data?: JsonObjeto;
110
+ }
111
+ /** Observacao assinada por um verificador/adapter autorizado, nunca pelo recibo em si. */
112
+ export interface AtestadoEvidenciaConteudo extends ContextoAutorizadoEventoConteudo {
113
+ readonly kind: "EVIDENCE_ATTESTED";
114
+ readonly evidenceId: string;
115
+ readonly claimId?: string;
116
+ readonly gateId: string;
117
+ readonly stageId: string;
118
+ readonly targetId?: string;
119
+ readonly artifactDigest: string;
120
+ readonly evidenceType: string;
121
+ readonly producerId: string;
122
+ readonly attesterId: string;
123
+ readonly result: ResultadoAvaliacaoConteudo;
124
+ readonly observedAt: string;
125
+ readonly data?: JsonObjeto;
126
+ }
127
+ export interface ParecerIAConteudo extends ContextoAutorizadoEventoConteudo {
128
+ readonly kind: "AI_ASSESSMENT";
129
+ readonly assessmentId: string;
130
+ readonly gateId: string;
131
+ readonly targetId?: string;
132
+ readonly artifactDigest: string;
133
+ readonly rubricDigest: string;
134
+ readonly evaluatorId: string;
135
+ /** Capability especializada concreta exercida neste parecer. */
136
+ readonly capability: string;
137
+ readonly result: ResultadoAvaliacaoConteudo;
138
+ readonly assessedAt: string;
139
+ readonly rationaleDigest?: string;
140
+ readonly data?: JsonObjeto;
141
+ }
142
+ export interface PoliticaGateConteudo {
143
+ readonly gateId: string;
144
+ readonly stageId: string;
145
+ readonly scope: EscopoEtapaConteudo;
146
+ readonly evaluationMode: ModoAvaliacaoConteudo;
147
+ readonly requiredEvidence: readonly string[];
148
+ readonly evaluatorCapabilities: readonly string[];
149
+ /** Quorum independente exigido para cada tipo de evidencia deterministica. */
150
+ readonly minAttestationsPerEvidence: number;
151
+ readonly minDistinctAttesterControlDomains: number;
152
+ readonly minApprovals: number;
153
+ readonly minDistinctControlDomains: number;
154
+ readonly producerDisjoint: boolean;
155
+ readonly rejectionIsBinding: boolean;
156
+ readonly rubricDigest: string;
157
+ }
158
+ export interface PoliticaConfiancaConteudo {
159
+ readonly policyId: string;
160
+ readonly version: string;
161
+ readonly runId: string;
162
+ readonly trustDomainId: string;
163
+ readonly trustRootDigest: string;
164
+ readonly definitionDigest: string;
165
+ readonly targetSetDigest: string;
166
+ readonly ledgerId: string;
167
+ readonly gates: readonly PoliticaGateConteudo[];
168
+ readonly issuedAt: string;
169
+ readonly expiresAt: string;
170
+ }
171
+ export interface EntradaAvaliacaoGateConteudo {
172
+ /** Politica assinada que vincula o gate base; requisitos adicionais so podem endurece-lo. */
173
+ readonly envelopePolitica: EnvelopeAssinadoConteudo<PoliticaConfiancaConteudo>;
174
+ readonly gate: PoliticaGateConteudo;
175
+ readonly requiredEvidenceAdicional?: readonly string[];
176
+ /** Requisitos adicionais derivados do adapter; so endurecem a policy assinada. */
177
+ readonly attesterCapabilitiesAdicionais?: Readonly<Record<string, string>>;
178
+ readonly artifactDigest: string;
179
+ readonly targetId?: string;
180
+ readonly runId: string;
181
+ readonly trustDomainId: string;
182
+ readonly trustRootDigest: string;
183
+ readonly revocationDigestEsperado: string;
184
+ readonly ledgerId: string;
185
+ readonly policyDigest: string;
186
+ readonly definitionDigest: string;
187
+ readonly authorizationScope: string;
188
+ readonly producerId: string;
189
+ readonly producerLineageIds: readonly string[];
190
+ readonly evidenciasAceitas: readonly EnvelopeVerificadoConteudo<AtestadoEvidenciaConteudo>[];
191
+ readonly pareceresIa: readonly EnvelopeVerificadoConteudo<ParecerIAConteudo>[];
192
+ readonly configuracaoConfianca: ConfiguracaoConfiancaConteudo;
193
+ }
194
+ export interface ResultadoAvaliacaoGateConteudo {
195
+ readonly veredito: VereditoConteudo;
196
+ readonly aprovacoesValidas: number;
197
+ readonly controlDomainsDistintos: number;
198
+ readonly evidenceIds: readonly string[];
199
+ readonly assessmentIds: readonly string[];
200
+ readonly bloqueios: readonly string[];
201
+ }
202
+ export interface RestricaoDeterministicaConteudo {
203
+ readonly constraintId: string;
204
+ readonly kind: string;
205
+ readonly config?: JsonObjeto;
206
+ }
207
+ export interface AdaptadorConteudo {
208
+ readonly adapterId: string;
209
+ readonly version: string;
210
+ readonly capabilities: readonly string[];
211
+ readonly acceptedMediaTypes: readonly string[];
212
+ readonly formatProfiles: readonly string[];
213
+ readonly deterministicConstraints: readonly RestricaoDeterministicaConteudo[];
214
+ readonly requiredMetadata: readonly string[];
215
+ readonly optionalMetadata: readonly string[];
216
+ readonly confirmationPredicates: readonly string[];
217
+ }
218
+ export interface AlvoConteudo {
219
+ readonly targetId: string;
220
+ readonly adapterId: string;
221
+ readonly accountScope: string;
222
+ readonly formatProfileId: string;
223
+ readonly locale: string;
224
+ readonly metadata: MetadataPublicaConteudo;
225
+ }
226
+ export interface EtapaPipelineConteudo {
227
+ readonly stageId: string;
228
+ readonly capability: string;
229
+ readonly scope: EscopoEtapaConteudo;
230
+ readonly adapterPolicy: "NONE" | "CONSTRAINTS" | "CONFIRMATION";
231
+ readonly dependsOn: readonly string[];
232
+ readonly produces: readonly string[];
233
+ readonly gateIds: readonly string[];
234
+ }
235
+ export interface DefinicaoPipelineConteudo {
236
+ readonly schemaVersion: string;
237
+ readonly pipelineId: string;
238
+ readonly version: string;
239
+ readonly stages: readonly EtapaPipelineConteudo[];
240
+ readonly gates: readonly PoliticaGateConteudo[];
241
+ readonly adapters: readonly AdaptadorConteudo[];
242
+ readonly requiredCompletionGates: readonly string[];
243
+ }
244
+ export interface InstanciaEtapaConteudo {
245
+ readonly stageInstanceId: string;
246
+ readonly stageId: string;
247
+ readonly targetId?: string;
248
+ readonly capability: string;
249
+ readonly dependsOn: readonly string[];
250
+ readonly produces: readonly string[];
251
+ readonly gateIds: readonly string[];
252
+ }
253
+ export interface SlotArtefatoConteudo {
254
+ readonly slotId: string;
255
+ readonly stageInstanceId: string;
256
+ readonly artifactType: string;
257
+ readonly targetId?: string;
258
+ }
259
+ export interface InstanciaGateConteudo {
260
+ readonly gateInstanceId: string;
261
+ readonly gateId: string;
262
+ readonly stageInstanceId: string;
263
+ readonly targetId?: string;
264
+ }
265
+ export interface PlanoPipelineConteudo {
266
+ readonly pipelineId: string;
267
+ readonly definitionDigest: string;
268
+ readonly targetIds: readonly string[];
269
+ readonly stageInstances: readonly InstanciaEtapaConteudo[];
270
+ readonly artifactSlots: readonly SlotArtefatoConteudo[];
271
+ readonly gateInstances: readonly InstanciaGateConteudo[];
272
+ readonly nextActions: readonly string[];
273
+ }
274
+ export interface ArtefatoConteudo extends ContextoAutorizadoEventoConteudo {
275
+ readonly kind: "ARTIFACT_REGISTERED";
276
+ readonly artifactId: string;
277
+ readonly stageId: string;
278
+ readonly targetId?: string;
279
+ readonly producerId: string;
280
+ readonly producerLineageIds: readonly string[];
281
+ readonly version: string;
282
+ readonly artifactType: string;
283
+ readonly mediaType: string;
284
+ readonly digest: string;
285
+ readonly lineageDigests: readonly string[];
286
+ }
287
+ export interface InicioExecucaoConteudo extends ContextoAssinadoEventoConteudo {
288
+ readonly kind: "RUN_STARTED";
289
+ readonly targets: readonly AlvoConteudo[];
290
+ readonly startedAt: string;
291
+ }
292
+ export interface CondicaoOperacionalReportadaConteudo extends ContextoAutorizadoEventoConteudo {
293
+ readonly kind: "OPERATIONAL_CONDITION";
294
+ readonly gateId: string;
295
+ readonly targetId?: string;
296
+ readonly condition: CondicaoOperacionalConteudo;
297
+ readonly reason: string;
298
+ readonly reportedAt: string;
299
+ }
300
+ export type EventoPayloadConteudo = InicioExecucaoConteudo | CondicaoOperacionalReportadaConteudo | ArtefatoConteudo | AlegacaoEvidenciaConteudo | AtestadoEvidenciaConteudo | ParecerIAConteudo;
301
+ export interface EventoLedgerConteudo<TPayload = JsonValor> {
302
+ readonly schemaVersion: string;
303
+ readonly ledgerId: string;
304
+ readonly sequence: number;
305
+ readonly eventId: string;
306
+ readonly recordedAt: string;
307
+ readonly previousHash: string;
308
+ readonly envelope: EnvelopeAssinadoConteudo<TPayload>;
309
+ readonly hash: string;
310
+ }
311
+ export interface EstadoGateConteudo {
312
+ readonly gateId: string;
313
+ readonly targetId?: string;
314
+ readonly artifactDigest: string;
315
+ readonly veredito: VereditoConteudo;
316
+ readonly condition: CondicaoOperacionalConteudo;
317
+ readonly evidenceIds: readonly string[];
318
+ readonly assessmentIds: readonly string[];
319
+ readonly blockers: readonly string[];
320
+ }
321
+ export interface ProjecaoPipelineConteudo {
322
+ readonly authoritative: false;
323
+ readonly ledgerId: string;
324
+ readonly ledgerHead: string;
325
+ readonly runId: string;
326
+ readonly generatedAt: string;
327
+ readonly gates: readonly EstadoGateConteudo[];
328
+ readonly targets: readonly AlvoConteudo[];
329
+ readonly artifacts: readonly ArtefatoConteudo[];
330
+ readonly nextActions: readonly string[];
331
+ }
@@ -0,0 +1,4 @@
1
+ // SEMA-GOVERNED: sema.produto.pipeline_conteudo + confianca + ledger + estado + adaptadores
2
+ // Descricao: tipos abertos do pipeline AI-native de conteudo, sem enum de canal, marca ou formato.
3
+ export {};
4
+ //# sourceMappingURL=types.js.map
@@ -52,12 +52,18 @@ export function normalizarFrameworkGeracao(valor) {
52
52
  return "base";
53
53
  }
54
54
  export function normalizarAlvo(valor) {
55
- if (valor === "typescript" || valor === "python" || valor === "dart" || valor === "lua" || valor === "javascript" || valor === "html" || valor === "css" || valor === "php") {
55
+ if (valor === "typescript" || valor === "python" || valor === "dart" || valor === "lua" || valor === "javascript" || valor === "html" || valor === "css" || valor === "php" || valor === "dotnet" || valor === "cpp") {
56
56
  return valor;
57
57
  }
58
58
  if (valor === "js") {
59
59
  return "javascript";
60
60
  }
61
+ if (valor === "cs" || valor === "csharp") {
62
+ return "dotnet";
63
+ }
64
+ if (valor === "c++" || valor === "cxx" || valor === "cc") {
65
+ return "cpp";
66
+ }
61
67
  return undefined;
62
68
  }
63
69
  export function normalizarFonteLegado(valor) {
@@ -2,11 +2,24 @@
2
2
  // Descrição: resolve alvo, framework, estrutura e diret?rios de sa?da para gera??o/verifica??o.
3
3
  import path from 'node:path';
4
4
  import { normalizarAlvo, normalizarEstruturaSaida, normalizarFrameworkGeracao } from './projetoConfig.js';
5
+ function normalizarAlvoObrigatorio(valor, origem) {
6
+ const normalizado = normalizarAlvo(valor);
7
+ if (!normalizado) {
8
+ throw new Error(`Alvo de geração inválido em ${origem}: ${valor}`);
9
+ }
10
+ return normalizado;
11
+ }
5
12
  export function resolverAlvoPadrao(alvoExplicito, configCarregada) {
6
- return normalizarAlvo(alvoExplicito)
7
- ?? configCarregada?.config.alvoPadrao
8
- ?? configCarregada?.config.alvos?.[0]
9
- ?? "typescript";
13
+ if (alvoExplicito !== undefined) {
14
+ return normalizarAlvoObrigatorio(alvoExplicito, "--alvo");
15
+ }
16
+ if (configCarregada?.config.alvoPadrao !== undefined) {
17
+ return normalizarAlvoObrigatorio(configCarregada.config.alvoPadrao, `alvoPadrao de ${configCarregada.caminho}`);
18
+ }
19
+ const primeiroAlvo = configCarregada?.config.alvos?.[0];
20
+ return primeiroAlvo !== undefined
21
+ ? normalizarAlvoObrigatorio(primeiroAlvo, `alvos[0] de ${configCarregada.caminho}`)
22
+ : "typescript";
10
23
  }
11
24
  export function resolverFrameworkPadrao(frameworkExplicito, configCarregada) {
12
25
  return normalizarFrameworkGeracao(frameworkExplicito ?? configCarregada?.config.framework);
@@ -35,8 +48,10 @@ export function resolverSaidaPadrao(saidaExplicita, alvo, configCarregada) {
35
48
  return path.resolve("./saida");
36
49
  }
37
50
  export function resolverAlvosVerificacao(configCarregada) {
38
- const alvos = configCarregada?.config.alvos?.length
39
- ? configCarregada.config.alvos
51
+ const configurados = configCarregada?.config.alvos;
52
+ const origemConfig = configCarregada?.caminho ?? "sema.config.json";
53
+ const alvos = configurados?.length
54
+ ? configurados.map((alvo, indice) => normalizarAlvoObrigatorio(alvo, `alvos[${indice}] de ${origemConfig}`))
40
55
  : ["typescript", "python"];
41
56
  return [...new Set(alvos)];
42
57
  }
@@ -46,25 +46,25 @@ export async function gerarSchemaPrisma(pastaContratos, saidaSchema, datasourceP
46
46
  for (const contrato of contratos) {
47
47
  const nomeModel = path.basename(contrato, '.sema').replace(/\./g, '_');
48
48
  // Schema simplificado - em producao, fazer parsing real do contrato
49
- models += `\nmodel ${nomeModel.charAt(0).toUpperCase() + nomeModel.slice(1)} {
50
- id String @id @default(uuid())
51
- criadoEm DateTime @default(now())
52
- // Gerado a partir de: ${contrato}
53
- // TODO: Adicionar campos do contrato Sema
49
+ models += `\nmodel ${nomeModel.charAt(0).toUpperCase() + nomeModel.slice(1)} {
50
+ id String @id @default(uuid())
51
+ criadoEm DateTime @default(now())
52
+ // Gerado a partir de: ${contrato}
53
+ // TODO: Adicionar campos do contrato Sema
54
54
  }\n`;
55
55
  modelCount++;
56
56
  }
57
- const schema = `// Gerado automaticamente pelo Sema
58
- // Fonte: ${pastaContratos}
59
-
60
- generator client {
61
- provider = "prisma-client-js"
62
- }
63
-
64
- datasource db {
65
- provider = "${datasourceProvider}"
66
- url = env("SEMA_PRISMA_URL")
67
- }
57
+ const schema = `// Gerado automaticamente pelo Sema
58
+ // Fonte: ${pastaContratos}
59
+
60
+ generator client {
61
+ provider = "prisma-client-js"
62
+ }
63
+
64
+ datasource db {
65
+ provider = "${datasourceProvider}"
66
+ url = env("SEMA_PRISMA_URL")
67
+ }
68
68
  ${models}`;
69
69
  // Salvar
70
70
  fs.writeFileSync(saidaSchema, schema, 'utf-8');
@@ -90,25 +90,25 @@ export async function importarSchemaPrisma(caminhoSchema, pastaSaida, nomeModulo
90
90
  const nomeContrato = `${nomeModel.toLowerCase()}.sema`;
91
91
  const caminhoContrato = path.join(pastaSaida, nomeContrato);
92
92
  // Gerar contrato basico
93
- const conteudo = `module ${nomeModulo}.${nomeModel.toLowerCase()} {
94
- entity ${nomeModel} {
95
- fields {
96
- id: Id
97
- // TODO: Mapear campos do schema Prisma
98
- }
99
- }
100
-
101
- task criar_${nomeModel.toLowerCase()} {
102
- input {
103
- // TODO: Definir inputs
104
- }
105
- output {
106
- ${nomeModel.toLowerCase()}: ${nomeModel}
107
- }
108
- effects {
109
- persistencia ${nomeModel}
110
- }
111
- }
93
+ const conteudo = `module ${nomeModulo}.${nomeModel.toLowerCase()} {
94
+ entity ${nomeModel} {
95
+ fields {
96
+ id: Id
97
+ // TODO: Mapear campos do schema Prisma
98
+ }
99
+ }
100
+
101
+ task criar_${nomeModel.toLowerCase()} {
102
+ input {
103
+ // TODO: Definir inputs
104
+ }
105
+ output {
106
+ ${nomeModel.toLowerCase()}: ${nomeModel}
107
+ }
108
+ effects {
109
+ persistencia ${nomeModel}
110
+ }
111
+ }
112
112
  }`;
113
113
  fs.writeFileSync(caminhoContrato, conteudo, 'utf-8');
114
114
  contratos.push(caminhoContrato);
package/docs/README.md CHANGED
@@ -1,25 +1,28 @@
1
- # Sema Documentation
2
-
3
- These docs describe the public Codex-native local CLI distribution of Sema.
4
-
5
- Sema is local-first: Codex runs the CLI inside a project folder, reads `.sema`
6
- contracts, checks drift, maps impact, and closes changes with documentation
7
- evidence. `AGENTS.md` is the official Codex entrypoint. Public docs are written
8
- in English.
9
-
10
- Sema is an independent product and is not affiliated with or endorsed by
11
- OpenAI. Codex-native describes Sema's product direction, not an official OpenAI
12
- program or submission.
13
-
14
- Start here:
15
-
16
- - [CLI](./cli.md)
17
- - [Commands](./commands.md)
18
- - [Syntax](./syntax.md)
19
- - [Profiles](./profiles.md)
20
- - [Documentation Governance](./documentation.md)
21
- - [Repository Boundary](./repositories.md)
22
- - [Security](./security.md)
23
- - [Codex Integration](./ai-integration.md)
24
-
25
- Official support: [suporte@otimitare.online](mailto:suporte@otimitare.online)
1
+ # Sema Documentation
2
+
3
+ These docs describe the public Codex-native local CLI distribution of Sema.
4
+
5
+ Sema is local-first: Codex runs the CLI inside a project folder, reads `.sema`
6
+ contracts, checks drift, maps impact, and closes changes with documentation
7
+ evidence. `AGENTS.md` is the official Codex entrypoint. Public docs are written
8
+ in English.
9
+
10
+ Sema is an independent product and is not affiliated with or endorsed by
11
+ OpenAI. Codex-native describes Sema's product direction, not an official OpenAI
12
+ program or submission.
13
+
14
+ Start here:
15
+
16
+ - [CLI](./cli.md)
17
+ - [Commands](./commands.md)
18
+ - [Syntax](./syntax.md)
19
+ - [Profiles](./profiles.md)
20
+ - [AI-native Content Pipeline](./pipeline-conteudo.md) — signed-policy,
21
+ multi-channel and multi-format orchestration for external AI runners, with
22
+ canonical ledger replay and no native human-review path.
23
+ - [Documentation Governance](./documentation.md)
24
+ - [Repository Boundary](./repositories.md)
25
+ - [Security](./security.md)
26
+ - [Codex Integration](./ai-integration.md)
27
+
28
+ Official support: [suporte@otimitare.online](mailto:suporte@otimitare.online)
@@ -1,62 +1,62 @@
1
- # Codex Onboarding
2
-
3
- The official Sema skill is required for Codex to recognize and initialize Sema
4
- before a project has its own protocol:
5
-
6
- ```bash
7
- codex plugin marketplace add gerlanss/Sema
8
- codex plugin add sema@sema
9
- ```
10
-
11
- Open a new Codex task in the target repository after installation. Codex loads
12
- the plugin/skill catalog at task start, so `$sema` is not added retroactively to
13
- an already-open task. Invoke `$sema` in the new task; it bootstraps the project,
14
- reads the generated `AGENTS.md`, and later tasks load that protocol
15
- automatically.
16
-
17
- `AGENTS.md` is the official Sema entrypoint for Codex. It gives Codex the durable
18
- repository rule that contracts come first and the local CLI is the source of
19
- truth. Once the file exists, the skill delegates to it instead of carrying a
20
- second copy of the governed workflow.
21
-
22
- Create or refresh the entrypoint with:
23
-
24
- ```bash
25
- sema sync-codex --json
26
- ```
27
-
28
- ## Minimal Prompt
29
-
30
- ```text
31
- This workspace is governed by Sema. Before editing code, contracts, docs,
32
- workflows, profiles, or release scripts, run:
33
-
34
- 1. sema --version
35
- 2. sema resumo
36
- 3. sema docs-impacto --intencao "<change>" --json
37
- 4. sema inspecionar on the applicable .sema contract
38
- 5. sema drift before editing existing code
39
- 6. sema impacto before changing behavior
40
- 7. sema finalizar-mudanca before closing
41
-
42
- If the CLI is unavailable, stop and install or repair @semacode/cli. There is
43
- no separate Sema login, license activation, or authorization gate. Do not
44
- replace Sema with manual search or guessed contracts.
45
- ```
46
-
47
- ## What Codex Should Not Do
48
-
49
- - Do not invent `.sema` contracts.
50
- - Do not implement code without an applicable contract.
51
- - Do not ignore severity 4+ warnings.
52
- - Do not publish private or sensitive operational material.
53
- - Do not replace the local CLI when the local workspace is available.
54
-
55
- Other AI clients can invoke the public CLI manually, but Sema does not ship or
56
- manage an official repository entrypoint for them. The supported product path
57
- is Codex plus `AGENTS.md`.
58
-
59
- Sema is an independent product and is not affiliated with or endorsed by
60
- OpenAI.
61
-
62
- Support: suporte@otimitare.online
1
+ # Codex Onboarding
2
+
3
+ The official Sema skill is required for Codex to recognize and initialize Sema
4
+ before a project has its own protocol:
5
+
6
+ ```bash
7
+ codex plugin marketplace add gerlanss/Sema
8
+ codex plugin add sema@sema
9
+ ```
10
+
11
+ Open a new Codex task in the target repository after installation. Codex loads
12
+ the plugin/skill catalog at task start, so `$sema` is not added retroactively to
13
+ an already-open task. Invoke `$sema` in the new task; it bootstraps the project,
14
+ reads the generated `AGENTS.md`, and later tasks load that protocol
15
+ automatically.
16
+
17
+ `AGENTS.md` is the official Sema entrypoint for Codex. It gives Codex the durable
18
+ repository rule that contracts come first and the local CLI is the source of
19
+ truth. Once the file exists, the skill delegates to it instead of carrying a
20
+ second copy of the governed workflow.
21
+
22
+ Create or refresh the entrypoint with:
23
+
24
+ ```bash
25
+ sema sync-codex --json
26
+ ```
27
+
28
+ ## Minimal Prompt
29
+
30
+ ```text
31
+ This workspace is governed by Sema. Before editing code, contracts, docs,
32
+ workflows, profiles, or release scripts, run:
33
+
34
+ 1. sema --version
35
+ 2. sema resumo
36
+ 3. sema docs-impacto --intencao "<change>" --json
37
+ 4. sema inspecionar on the applicable .sema contract
38
+ 5. sema drift before editing existing code
39
+ 6. sema impacto before changing behavior
40
+ 7. sema finalizar-mudanca before closing
41
+
42
+ If the CLI is unavailable, stop and install or repair @semacode/cli. There is
43
+ no separate Sema login, license activation, or authorization gate. Do not
44
+ replace Sema with manual search or guessed contracts.
45
+ ```
46
+
47
+ ## What Codex Should Not Do
48
+
49
+ - Do not invent `.sema` contracts.
50
+ - Do not implement code without an applicable contract.
51
+ - Do not ignore severity 4+ warnings.
52
+ - Do not publish private or sensitive operational material.
53
+ - Do not replace the local CLI when the local workspace is available.
54
+
55
+ Other AI clients can invoke the public CLI manually, but Sema does not ship or
56
+ manage an official repository entrypoint for them. The supported product path
57
+ is Codex plus `AGENTS.md`.
58
+
59
+ Sema is an independent product and is not affiliated with or endorsed by
60
+ OpenAI.
61
+
62
+ Support: suporte@otimitare.online
@@ -34,7 +34,7 @@ If the delivery includes code derived from a contract, run `sema compilar`.
34
34
  sema compilar contratos/orders.sema --alvo javascript --saida ./generated/javascript
35
35
  ```
36
36
 
37
- Replace `javascript` with `typescript`, `python`, `php`, `dart`, `lua`, `html`, or `css` when appropriate.
37
+ Replace `javascript` with `typescript`, `python`, `php`, `dart`, `lua`, `html`, `css`, `dotnet`, or `cpp` when appropriate.
38
38
 
39
39
  ## Fail Closed
40
40