@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.
Files changed (103) hide show
  1. package/LICENSE +39 -39
  2. package/README.md +125 -121
  3. package/dist/agentEntryPoints.js +499 -499
  4. package/dist/doctorCommand.js +28 -0
  5. package/dist/geracaoCore.js +97 -1
  6. package/dist/iaPrompts.d.ts +1 -1
  7. package/dist/iaPrompts.js +307 -307
  8. package/dist/index.part01.js +4 -3
  9. package/dist/index.part02.js +21 -21
  10. package/dist/index.part04.js +96 -96
  11. package/dist/index.part06.js +1 -1
  12. package/dist/index.part07.js +35 -24
  13. package/dist/init/templates.part01.js +393 -393
  14. package/dist/init/templates.part02.js +189 -189
  15. package/dist/initTemplatesBackend.js +73 -73
  16. package/dist/initTemplatesBase.js +81 -81
  17. package/dist/initTemplatesFlutter.js +137 -137
  18. package/dist/initTemplatesRuntime.js +350 -350
  19. package/dist/initTemplatesWeb.js +309 -309
  20. package/dist/nativeToolchains.d.ts +15 -0
  21. package/dist/nativeToolchains.js +132 -0
  22. package/dist/projetoConfig.js +7 -1
  23. package/dist/projetoResolucao.js +21 -6
  24. package/dist/sync/index.js +35 -35
  25. package/docs/README.md +25 -25
  26. package/docs/ai-onboarding.md +62 -62
  27. package/docs/ai-workflow.md +1 -1
  28. package/docs/auth.md +26 -26
  29. package/docs/cli.md +79 -72
  30. package/docs/commands.md +1 -1
  31. package/docs/database.md +15 -15
  32. package/docs/deploy.md +41 -36
  33. package/docs/documentation.md +39 -39
  34. package/docs/env.md +16 -16
  35. package/docs/frontend.md +41 -41
  36. package/docs/getting-started.md +57 -57
  37. package/docs/i18n.md +15 -15
  38. package/docs/profiles.md +45 -43
  39. package/docs/repositories.md +43 -43
  40. package/docs/rollback.md +31 -31
  41. package/docs/security.md +32 -32
  42. package/docs/support.md +8 -8
  43. package/docs/syntax.md +1 -1
  44. package/docs/testing.md +35 -28
  45. package/docs/vocabulary.md +29 -29
  46. package/exemplos/agendamento.sema +1 -1
  47. package/exemplos/assinatura.sema +1 -1
  48. package/exemplos/auditoria.sema +1 -1
  49. package/exemplos/autenticacao.sema +1 -1
  50. package/exemplos/author_obra_comum.sema +1 -1
  51. package/exemplos/author_tema_sensivel.sema +1 -1
  52. package/exemplos/automacao.sema +1 -1
  53. package/exemplos/cadastro_usuario.sema +1 -1
  54. package/exemplos/calculadora.sema +1 -1
  55. package/exemplos/crud_simples.sema +1 -1
  56. package/exemplos/estoque.sema +1 -1
  57. package/exemplos/exportacao.sema +1 -1
  58. package/exemplos/fila.sema +1 -1
  59. package/exemplos/integracao_externa.sema +1 -1
  60. package/exemplos/multi_tenant.sema +1 -1
  61. package/exemplos/notificacao.sema +1 -1
  62. package/exemplos/operacao_estrategia.sema +132 -132
  63. package/exemplos/operacao_estrategia_discovery.sema +220 -220
  64. package/exemplos/operacao_estrategia_fluxo.sema +114 -114
  65. package/exemplos/operacao_estrategia_gates.sema +106 -106
  66. package/exemplos/operacao_estrategia_quarentena.sema +133 -133
  67. package/exemplos/operacao_estrategia_rollout.sema +124 -124
  68. package/exemplos/pagamento.sema +1 -1
  69. package/exemplos/pagamento_dominio.sema +1 -1
  70. package/exemplos/pedido.sema +1 -1
  71. package/exemplos/permissao.sema +1 -1
  72. package/exemplos/persistencia_vendor_first.sema +1 -1
  73. package/exemplos/profile_conversas.sema +165 -165
  74. package/exemplos/profile_game.sema +1 -1
  75. package/exemplos/profile_legal.sema +1 -1
  76. package/exemplos/profile_ops.sema +1 -1
  77. package/exemplos/profile_research.sema +1 -1
  78. package/exemplos/profile_software.sema +1 -1
  79. package/exemplos/profile_workflow_n8n.sema +1 -1
  80. package/exemplos/relatorio.sema +1 -1
  81. package/exemplos/replica_analitica_erp.sema +1 -1
  82. package/exemplos/testes_embutidos.sema +1 -1
  83. package/exemplos/tratamento_erro.sema +1 -1
  84. package/exemplos/upload_arquivo.sema +1 -1
  85. package/exemplos/webhook.sema +1 -1
  86. package/node_modules/@sema/gerador-cpp/dist/index.d.ts +3 -0
  87. package/node_modules/@sema/gerador-cpp/dist/index.js +859 -0
  88. package/node_modules/@sema/gerador-cpp/dist/index.js.map +1 -0
  89. package/node_modules/@sema/gerador-cpp/package.json +7 -0
  90. package/node_modules/@sema/gerador-css/dist/index.part01.js +10 -10
  91. package/node_modules/@sema/gerador-css/dist/index.part02.js +460 -460
  92. package/node_modules/@sema/gerador-dotnet/dist/index.d.ts +3 -0
  93. package/node_modules/@sema/gerador-dotnet/dist/index.js +828 -0
  94. package/node_modules/@sema/gerador-dotnet/dist/index.js.map +1 -0
  95. package/node_modules/@sema/gerador-dotnet/package.json +7 -0
  96. package/node_modules/@sema/gerador-html/dist/index.js +17 -17
  97. package/node_modules/@sema/gerador-lua/dist/index.js +5 -5
  98. package/node_modules/@sema/gerador-php/dist/index.js +113 -113
  99. package/node_modules/@sema/gerador-python/dist/index.part02.js +3 -3
  100. package/node_modules/@sema/gerador-typescript/dist/index.part02.js +11 -11
  101. package/node_modules/@sema/nucleo/dist/diagnosticos/melhorador.js +42 -42
  102. package/node_modules/@sema/padroes/dist/index.d.ts +1 -1
  103. package/package.json +5 -1
@@ -0,0 +1,15 @@
1
+ export type TipoToolchainCpp = "gcc" | "clang" | "msvc" | "msvc-devcmd";
2
+ export interface ToolchainCpp {
3
+ tipo: TipoToolchainCpp;
4
+ comando: string;
5
+ rotulo: string;
6
+ scriptAmbiente?: string;
7
+ }
8
+ export interface ResultadoComandoNativo {
9
+ codigoSaida: number;
10
+ saidaPadrao: string;
11
+ saidaErro: string;
12
+ }
13
+ export declare function resolverToolchainCpp(): ToolchainCpp | undefined;
14
+ export declare function compilarCpp(toolchain: ToolchainCpp, fontes: string[], diretorioIncludes: string, executavel: string, silencioso?: boolean): ResultadoComandoNativo;
15
+ export declare function executarBinarioNativo(executavel: string, silencioso?: boolean): ResultadoComandoNativo;
@@ -0,0 +1,132 @@
1
+ // SEMA-GOVERNED
2
+ // Módulo: sema.produto.geradores_nativos
3
+ // Contrato: contratos/sema/geradores_nativos.sema
4
+ // Descrição: detecta e executa toolchains C++ locais sem baixar dependências.
5
+ import { existsSync } from "node:fs";
6
+ import path from "node:path";
7
+ import { spawnSync } from "node:child_process";
8
+ const TIMEOUT_DETECCAO_MS = 5_000;
9
+ const TIMEOUT_COMPILACAO_MS = 120_000;
10
+ function textoSaida(valor) {
11
+ return typeof valor === "string" ? valor : valor?.toString("utf8") ?? "";
12
+ }
13
+ function resultadoComando(resultado, erroPadrao) {
14
+ return {
15
+ codigoSaida: resultado.status ?? 1,
16
+ saidaPadrao: textoSaida(resultado.stdout),
17
+ saidaErro: textoSaida(resultado.stderr) || resultado.error?.message || erroPadrao,
18
+ };
19
+ }
20
+ function comandoResponde(comando, argumentos) {
21
+ const resultado = spawnSync(comando, argumentos, {
22
+ stdio: "ignore",
23
+ timeout: TIMEOUT_DETECCAO_MS,
24
+ windowsHide: true,
25
+ });
26
+ return !resultado.error && resultado.signal === null && (resultado.status ?? 1) === 0;
27
+ }
28
+ function localizarVsDevCmd() {
29
+ if (process.platform !== "win32") {
30
+ return undefined;
31
+ }
32
+ const programFilesX86 = process.env["ProgramFiles(x86)"];
33
+ if (!programFilesX86) {
34
+ return undefined;
35
+ }
36
+ const vswhere = path.join(programFilesX86, "Microsoft Visual Studio", "Installer", "vswhere.exe");
37
+ if (!existsSync(vswhere)) {
38
+ return undefined;
39
+ }
40
+ const resultado = spawnSync(vswhere, [
41
+ "-latest",
42
+ "-products",
43
+ "*",
44
+ "-requires",
45
+ "Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
46
+ "-property",
47
+ "installationPath",
48
+ ], {
49
+ encoding: "utf8",
50
+ timeout: TIMEOUT_DETECCAO_MS,
51
+ windowsHide: true,
52
+ });
53
+ const instalacao = textoSaida(resultado.stdout).trim().split(/\r?\n/).at(-1);
54
+ if (!instalacao) {
55
+ return undefined;
56
+ }
57
+ const script = path.join(instalacao, "Common7", "Tools", "VsDevCmd.bat");
58
+ return existsSync(script) ? script : undefined;
59
+ }
60
+ export function resolverToolchainCpp() {
61
+ const candidatos = [
62
+ { comando: "c++", tipo: "gcc", rotulo: "c++" },
63
+ { comando: "g++", tipo: "gcc", rotulo: "g++" },
64
+ { comando: "clang++", tipo: "clang", rotulo: "clang++" },
65
+ ];
66
+ for (const candidato of candidatos) {
67
+ if (comandoResponde(candidato.comando, ["--version"])) {
68
+ return candidato;
69
+ }
70
+ }
71
+ if (process.platform === "win32" && comandoResponde("cl", ["/nologo", "/?"])) {
72
+ return { tipo: "msvc", comando: "cl", rotulo: "MSVC cl" };
73
+ }
74
+ const scriptAmbiente = localizarVsDevCmd();
75
+ if (scriptAmbiente) {
76
+ return {
77
+ tipo: "msvc-devcmd",
78
+ comando: process.env.ComSpec ?? "cmd.exe",
79
+ rotulo: "MSVC via VsDevCmd",
80
+ scriptAmbiente,
81
+ };
82
+ }
83
+ return undefined;
84
+ }
85
+ function citarCmd(valor) {
86
+ return `"${valor.replace(/"/g, '""')}"`;
87
+ }
88
+ export function compilarCpp(toolchain, fontes, diretorioIncludes, executavel, silencioso = false) {
89
+ const cwd = path.dirname(executavel);
90
+ const stdio = silencioso ? "pipe" : "inherit";
91
+ if (toolchain.tipo === "msvc-devcmd") {
92
+ const comando = [
93
+ `call ${citarCmd(toolchain.scriptAmbiente)}`,
94
+ "-no_logo -arch=x64 -host_arch=x64 >nul",
95
+ "&& cl /nologo /std:c++20 /EHsc",
96
+ fontes.map(citarCmd).join(" "),
97
+ `/I${citarCmd(diretorioIncludes)}`,
98
+ `/Fe:${citarCmd(executavel)}`,
99
+ ].join(" ");
100
+ const resultado = spawnSync(toolchain.comando, ["/d", "/s", "/c", comando], {
101
+ cwd,
102
+ stdio,
103
+ encoding: silencioso ? "utf8" : undefined,
104
+ timeout: TIMEOUT_COMPILACAO_MS,
105
+ windowsHide: true,
106
+ windowsVerbatimArguments: true,
107
+ });
108
+ return resultadoComando(resultado, "Falha ao executar o MSVC via VsDevCmd.");
109
+ }
110
+ const argumentos = toolchain.tipo === "msvc"
111
+ ? ["/nologo", "/std:c++20", "/EHsc", ...fontes, `/I${diretorioIncludes}`, `/Fe:${executavel}`]
112
+ : ["-std=c++20", "-Wall", "-Wextra", ...fontes, `-I${diretorioIncludes}`, "-o", executavel];
113
+ const resultado = spawnSync(toolchain.comando, argumentos, {
114
+ cwd,
115
+ stdio,
116
+ encoding: silencioso ? "utf8" : undefined,
117
+ timeout: TIMEOUT_COMPILACAO_MS,
118
+ windowsHide: true,
119
+ });
120
+ return resultadoComando(resultado, `Falha ao executar ${toolchain.rotulo}.`);
121
+ }
122
+ export function executarBinarioNativo(executavel, silencioso = false) {
123
+ const resultado = spawnSync(executavel, [], {
124
+ cwd: path.dirname(executavel),
125
+ stdio: silencioso ? "pipe" : "inherit",
126
+ encoding: silencioso ? "utf8" : undefined,
127
+ timeout: TIMEOUT_COMPILACAO_MS,
128
+ windowsHide: true,
129
+ });
130
+ return resultadoComando(resultado, "Falha ao executar os testes C++ compilados.");
131
+ }
132
+ //# sourceMappingURL=nativeToolchains.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,25 @@
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
+ - [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,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
 
package/docs/auth.md CHANGED
@@ -1,26 +1,26 @@
1
- # Local Runtime Boundary
2
-
3
- The public Sema CLI executes directly against the local workspace. It does not
4
- require a Sema login, user authentication, product authorization, license
5
- activation, install key, token, credits, billing service, control panel, or an
6
- external request.
7
-
8
- Use local commands:
9
-
10
- ```bash
11
- sema --version
12
- sema resumo
13
- sema validar contratos/example.sema --json
14
- ```
15
-
16
- The repository license governs use and redistribution. It is not checked as a
17
- runtime activation mechanism.
18
-
19
- An `authz` block inside a `.sema` contract describes authorization in the
20
- application being governed. It does not authenticate a person before the Sema
21
- CLI can run.
22
-
23
- Do not put private or sensitive operational material in this repository.
24
-
25
- Application-specific authentication belongs in the application repository that
26
- owns it.
1
+ # Local Runtime Boundary
2
+
3
+ The public Sema CLI executes directly against the local workspace. It does not
4
+ require a Sema login, user authentication, product authorization, license
5
+ activation, install key, token, credits, billing service, control panel, or an
6
+ external request.
7
+
8
+ Use local commands:
9
+
10
+ ```bash
11
+ sema --version
12
+ sema resumo
13
+ sema validar contratos/example.sema --json
14
+ ```
15
+
16
+ The repository license governs use and redistribution. It is not checked as a
17
+ runtime activation mechanism.
18
+
19
+ An `authz` block inside a `.sema` contract describes authorization in the
20
+ application being governed. It does not authenticate a person before the Sema
21
+ CLI can run.
22
+
23
+ Do not put private or sensitive operational material in this repository.
24
+
25
+ Application-specific authentication belongs in the application repository that
26
+ owns it.