@semacode/cli 2.2.0 → 2.3.1

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 (252) hide show
  1. package/LICENSE +39 -39
  2. package/README.md +251 -141
  3. package/dist/agentContext.d.ts +1 -1
  4. package/dist/agentContextPack.js +6 -1
  5. package/dist/agentContextTipos.d.ts +4 -2
  6. package/dist/agentContextTipos.js +7 -0
  7. package/dist/agentEntryPoints.js +551 -499
  8. package/dist/angular-consumer-standalone.d.ts +3 -1
  9. package/dist/angular-consumer-standalone.js +12 -8
  10. package/dist/comandos.js +4 -0
  11. package/dist/discovery/catalog.d.ts +11 -0
  12. package/dist/discovery/catalog.js +521 -0
  13. package/dist/discovery/command.d.ts +11 -0
  14. package/dist/discovery/command.js +226 -0
  15. package/dist/discovery/index.d.ts +5 -0
  16. package/dist/discovery/index.js +8 -0
  17. package/dist/discovery/ranker.d.ts +3 -0
  18. package/dist/discovery/ranker.js +310 -0
  19. package/dist/discovery/redaction.d.ts +2 -0
  20. package/dist/discovery/redaction.js +21 -0
  21. package/dist/discovery/render.d.ts +2 -0
  22. package/dist/discovery/render.js +100 -0
  23. package/dist/discovery/types.d.ts +119 -0
  24. package/dist/discovery/types.js +13 -0
  25. package/dist/drift.part01.d.ts +32 -2
  26. package/dist/drift.part01.js +2 -0
  27. package/dist/drift.part04.d.ts +3 -2
  28. package/dist/drift.part04.js +6 -3
  29. package/dist/drift.part05.d.ts +2 -1
  30. package/dist/drift.part05.js +4 -3
  31. package/dist/drift.part06.d.ts +2 -1
  32. package/dist/drift.part06.js +9 -5
  33. package/dist/drift.part07.d.ts +11 -10
  34. package/dist/drift.part07.js +40 -30
  35. package/dist/drift.part08.d.ts +2 -1
  36. package/dist/drift.part08.js +4 -3
  37. package/dist/drift.part11.js +71 -6
  38. package/dist/drift.part12.js +14 -1
  39. package/dist/drift.part13.d.ts +42 -7
  40. package/dist/drift.part13.js +660 -36
  41. package/dist/driftCache.d.ts +49 -0
  42. package/dist/driftCache.js +311 -0
  43. package/dist/driftCacheIncremental.d.ts +98 -0
  44. package/dist/driftCacheIncremental.js +596 -0
  45. package/dist/driftCatalogo.d.ts +91 -0
  46. package/dist/driftCatalogo.js +657 -0
  47. package/dist/driftCatalogoPersistente.d.ts +8 -0
  48. package/dist/driftCatalogoPersistente.js +77 -0
  49. package/dist/driftEscopo.d.ts +23 -0
  50. package/dist/driftEscopo.js +563 -0
  51. package/dist/driftEscopoReferencias.d.ts +4 -0
  52. package/dist/driftEscopoReferencias.js +265 -0
  53. package/dist/driftOrcamento.d.ts +12 -0
  54. package/dist/driftOrcamento.js +19 -3
  55. package/dist/execucoesExternas.js +5 -19
  56. package/dist/exemplosOficiais.js +29 -8
  57. package/dist/iaPrompts.d.ts +1 -1
  58. package/dist/iaPrompts.js +310 -307
  59. package/dist/index.d.ts +2 -0
  60. package/dist/index.js +23 -5
  61. package/dist/index.part01.d.ts +17 -2
  62. package/dist/index.part01.js +119 -8
  63. package/dist/index.part02.js +21 -21
  64. package/dist/index.part03.d.ts +2 -2
  65. package/dist/index.part03.js +14 -3
  66. package/dist/index.part04.d.ts +2 -2
  67. package/dist/index.part04.js +113 -101
  68. package/dist/index.part05.d.ts +1 -1
  69. package/dist/index.part05.js +99 -22
  70. package/dist/index.part06.js +6 -2
  71. package/dist/index.part07.js +24 -24
  72. package/dist/index.part08.js +1 -1
  73. package/dist/init/templates.part01.js +393 -393
  74. package/dist/init/templates.part02.js +189 -189
  75. package/dist/initTemplatesBackend.js +73 -73
  76. package/dist/initTemplatesBase.js +81 -80
  77. package/dist/initTemplatesFlutter.js +137 -137
  78. package/dist/initTemplatesRuntime.js +350 -350
  79. package/dist/initTemplatesWeb.js +309 -309
  80. package/dist/pipelineConteudo/command.js +1 -36
  81. package/dist/profileArtefatoValidadores.d.ts +3 -2
  82. package/dist/profileArtefatoValidadores.js +81 -0
  83. package/dist/profileAuthorTipos.d.ts +4 -3
  84. package/dist/profileCatalogo.d.ts +5 -5
  85. package/dist/profileCatalogo.js +30 -0
  86. package/dist/profileCommand.d.ts +8 -2
  87. package/dist/profileCommand.js +15 -5
  88. package/dist/profileRegras.d.ts +5 -5
  89. package/dist/profileRegras.js +13 -1
  90. package/dist/profileRulePacks.js +68 -0
  91. package/dist/projeto.d.ts +1 -1
  92. package/dist/projetoCarregar.d.ts +2 -2
  93. package/dist/projetoCarregar.js +47 -24
  94. package/dist/projetoCatalogo.d.ts +7 -0
  95. package/dist/projetoCatalogo.js +125 -0
  96. package/dist/projetoTipos.d.ts +14 -5
  97. package/dist/sistemasInterativos/adapterProtocol.d.ts +3 -0
  98. package/dist/sistemasInterativos/adapterProtocol.js +240 -0
  99. package/dist/sistemasInterativos/advancedCatalog.d.ts +5 -0
  100. package/dist/sistemasInterativos/advancedCatalog.js +442 -0
  101. package/dist/sistemasInterativos/autonomy.d.ts +230 -0
  102. package/dist/sistemasInterativos/autonomy.js +753 -0
  103. package/dist/sistemasInterativos/canonical.d.ts +3 -0
  104. package/dist/sistemasInterativos/canonical.js +43 -0
  105. package/dist/sistemasInterativos/catalog.d.ts +116 -0
  106. package/dist/sistemasInterativos/catalog.js +543 -0
  107. package/dist/sistemasInterativos/command.d.ts +7 -0
  108. package/dist/sistemasInterativos/command.js +311 -0
  109. package/dist/sistemasInterativos/controlRun.d.ts +56 -0
  110. package/dist/sistemasInterativos/controlRun.js +391 -0
  111. package/dist/sistemasInterativos/evidence.d.ts +5 -0
  112. package/dist/sistemasInterativos/evidence.js +306 -0
  113. package/dist/sistemasInterativos/experienceIr.d.ts +12 -0
  114. package/dist/sistemasInterativos/experienceIr.js +895 -0
  115. package/dist/sistemasInterativos/experienceIrSemantics.d.ts +30 -0
  116. package/dist/sistemasInterativos/experienceIrSemantics.js +368 -0
  117. package/dist/sistemasInterativos/experienceIrTypes.d.ts +370 -0
  118. package/dist/sistemasInterativos/experienceIrTypes.js +5 -0
  119. package/dist/sistemasInterativos/extensionCommand.d.ts +391 -0
  120. package/dist/sistemasInterativos/extensionCommand.js +383 -0
  121. package/dist/sistemasInterativos/index.d.ts +19 -0
  122. package/dist/sistemasInterativos/index.js +22 -0
  123. package/dist/sistemasInterativos/operations.d.ts +40 -0
  124. package/dist/sistemasInterativos/operations.js +1167 -0
  125. package/dist/sistemasInterativos/operationsTypes.d.ts +297 -0
  126. package/dist/sistemasInterativos/operationsTypes.js +11 -0
  127. package/dist/sistemasInterativos/planner.d.ts +2 -0
  128. package/dist/sistemasInterativos/planner.js +159 -0
  129. package/dist/sistemasInterativos/portability.d.ts +164 -0
  130. package/dist/sistemasInterativos/portability.js +539 -0
  131. package/dist/sistemasInterativos/render.d.ts +3 -0
  132. package/dist/sistemasInterativos/render.js +179 -0
  133. package/dist/sistemasInterativos/temporal.d.ts +183 -0
  134. package/dist/sistemasInterativos/temporal.js +543 -0
  135. package/dist/sistemasInterativos/types.d.ts +215 -0
  136. package/dist/sistemasInterativos/types.js +4 -0
  137. package/dist/sistemasInterativos/validator.d.ts +2 -0
  138. package/dist/sistemasInterativos/validator.js +305 -0
  139. package/dist/sync/index.js +35 -35
  140. package/docs/README.md +34 -28
  141. package/docs/ai-onboarding.md +62 -62
  142. package/docs/ai-workflow.md +9 -4
  143. package/docs/auth.md +26 -26
  144. package/docs/cli.md +79 -79
  145. package/docs/commands.md +47 -2
  146. package/docs/database.md +15 -15
  147. package/docs/deploy.md +41 -41
  148. package/docs/descoberta-capacidades.md +106 -0
  149. package/docs/documentation.md +39 -39
  150. package/docs/env.md +16 -16
  151. package/docs/frontend.md +41 -41
  152. package/docs/getting-started.md +57 -57
  153. package/docs/i18n.md +15 -15
  154. package/docs/pipeline-conteudo.md +246 -246
  155. package/docs/profiles.md +54 -45
  156. package/docs/repositories.md +43 -43
  157. package/docs/rollback.md +31 -31
  158. package/docs/security.md +32 -32
  159. package/docs/sistemas-interativos.md +376 -0
  160. package/docs/support.md +8 -8
  161. package/docs/testing.md +51 -35
  162. package/docs/vocabulary.md +29 -29
  163. package/exemplos/agendamento.sema +1 -1
  164. package/exemplos/assinatura.sema +1 -1
  165. package/exemplos/auditoria.sema +1 -1
  166. package/exemplos/autenticacao.sema +1 -1
  167. package/exemplos/author_obra_comum.sema +1 -1
  168. package/exemplos/author_tema_sensivel.sema +1 -1
  169. package/exemplos/automacao.sema +1 -1
  170. package/exemplos/cadastro_usuario.sema +1 -1
  171. package/exemplos/calculadora.sema +1 -1
  172. package/exemplos/crud_simples.sema +1 -1
  173. package/exemplos/estoque.sema +1 -1
  174. package/exemplos/exportacao.sema +1 -1
  175. package/exemplos/fila.sema +1 -1
  176. package/exemplos/integracao_externa.sema +1 -1
  177. package/exemplos/multi_tenant.sema +1 -1
  178. package/exemplos/notificacao.sema +1 -1
  179. package/exemplos/operacao_estrategia.sema +132 -132
  180. package/exemplos/operacao_estrategia_discovery.sema +220 -220
  181. package/exemplos/operacao_estrategia_fluxo.sema +114 -114
  182. package/exemplos/operacao_estrategia_gates.sema +106 -106
  183. package/exemplos/operacao_estrategia_quarentena.sema +133 -133
  184. package/exemplos/operacao_estrategia_rollout.sema +124 -124
  185. package/exemplos/pagamento.sema +1 -1
  186. package/exemplos/pagamento_dominio.sema +1 -1
  187. package/exemplos/pedido.sema +1 -1
  188. package/exemplos/permissao.sema +1 -1
  189. package/exemplos/persistencia_vendor_first.sema +1 -1
  190. package/exemplos/pipeline-conteudo/README.md +44 -44
  191. package/exemplos/pipeline-conteudo/alvos.json +23 -23
  192. package/exemplos/pipeline-conteudo/definicao.json +136 -136
  193. package/exemplos/profile_conversas.sema +165 -165
  194. package/exemplos/profile_game.sema +1 -1
  195. package/exemplos/profile_legal.sema +1 -1
  196. package/exemplos/profile_ops.sema +1 -1
  197. package/exemplos/profile_research.sema +1 -1
  198. package/exemplos/profile_simulation.sema +211 -0
  199. package/exemplos/profile_software.sema +1 -1
  200. package/exemplos/profile_workflow_n8n.sema +1 -1
  201. package/exemplos/relatorio.sema +1 -1
  202. package/exemplos/replica_analitica_erp.sema +1 -1
  203. package/exemplos/sistemas-interativos/README.md +100 -0
  204. package/exemplos/sistemas-interativos/advanced/acceptance-context-evaluate-valid.json +5 -0
  205. package/exemplos/sistemas-interativos/advanced/acceptance-lock-valid.json +16 -0
  206. package/exemplos/sistemas-interativos/advanced/asset-provenance-valid.json +32 -0
  207. package/exemplos/sistemas-interativos/advanced/autonomy-repair-valid.json +93 -0
  208. package/exemplos/sistemas-interativos/advanced/control-run-definition-valid.json +78 -0
  209. package/exemplos/sistemas-interativos/advanced/control-run-valid.json +27 -0
  210. package/exemplos/sistemas-interativos/advanced/distributed-workers-valid.json +79 -0
  211. package/exemplos/sistemas-interativos/advanced/editor-state-valid.json +42 -0
  212. package/exemplos/sistemas-interativos/advanced/engine-snapshot-after-valid.json +32 -0
  213. package/exemplos/sistemas-interativos/advanced/engine-snapshot-before-valid.json +23 -0
  214. package/exemplos/sistemas-interativos/advanced/job-orchestration-valid.json +39 -0
  215. package/exemplos/sistemas-interativos/advanced/multimodal-evidence-valid.json +46 -0
  216. package/exemplos/sistemas-interativos/advanced/multiplayer-authority-valid.json +39 -0
  217. package/exemplos/sistemas-interativos/advanced/playtest-fuzz-valid.json +37 -0
  218. package/exemplos/sistemas-interativos/advanced/portability-valid.json +104 -0
  219. package/exemplos/sistemas-interativos/advanced/temporal-evidence-valid.json +27 -0
  220. package/exemplos/sistemas-interativos/advanced/temporal-valid.json +118 -0
  221. package/exemplos/sistemas-interativos/experience-ir-valid.json +459 -0
  222. package/exemplos/sistemas-interativos/game-2d.json +83 -0
  223. package/exemplos/sistemas-interativos/game-3d-human.json +81 -0
  224. package/exemplos/sistemas-interativos/game-pixel-16-bit.json +97 -0
  225. package/exemplos/sistemas-interativos/game-pixel-8-bit.json +94 -0
  226. package/exemplos/sistemas-interativos/game-xr-human.json +80 -0
  227. package/exemplos/sistemas-interativos/hybrid-2-5d.json +108 -0
  228. package/exemplos/sistemas-interativos/protocol-mutating-rollback-valid.json +75 -0
  229. package/exemplos/sistemas-interativos/protocol-read-only-valid.json +58 -0
  230. package/exemplos/sistemas-interativos/simulation-2d-controlled.json +97 -0
  231. package/exemplos/sistemas-interativos/simulation-3d-calibrated-autonomous.json +141 -0
  232. package/exemplos/sistemas-interativos/simulation-headless-autonomous-batch.json +112 -0
  233. package/exemplos/sistemas-interativos/simulation-pixel-16-bit.json +103 -0
  234. package/exemplos/sistemas-interativos/simulation-text-controlled.json +95 -0
  235. package/exemplos/testes_embutidos.sema +1 -1
  236. package/exemplos/tratamento_erro.sema +1 -1
  237. package/exemplos/upload_arquivo.sema +1 -1
  238. package/exemplos/webhook.sema +1 -1
  239. package/node_modules/@sema/gerador-cpp/dist/index.js +176 -176
  240. package/node_modules/@sema/gerador-cpp/package.json +1 -1
  241. package/node_modules/@sema/gerador-css/dist/index.part01.js +10 -10
  242. package/node_modules/@sema/gerador-css/dist/index.part02.js +460 -460
  243. package/node_modules/@sema/gerador-dotnet/dist/index.js +169 -169
  244. package/node_modules/@sema/gerador-dotnet/package.json +1 -1
  245. package/node_modules/@sema/gerador-html/dist/index.js +17 -17
  246. package/node_modules/@sema/gerador-lua/dist/index.js +76 -47
  247. package/node_modules/@sema/gerador-lua/dist/index.js.map +1 -1
  248. package/node_modules/@sema/gerador-php/dist/index.js +113 -113
  249. package/node_modules/@sema/gerador-python/dist/index.part02.js +3 -3
  250. package/node_modules/@sema/gerador-typescript/dist/index.part02.js +11 -11
  251. package/node_modules/@sema/nucleo/dist/diagnosticos/melhorador.js +42 -42
  252. package/package.json +3 -3
package/LICENSE CHANGED
@@ -1,39 +1,39 @@
1
- Sema Public Non-Commercial License
2
- Version 1.0
3
-
4
- Copyright (c) 2026 Sema
5
-
6
- Official support: suporte@otimitare.online
7
-
8
- Permission is granted, free of charge, to use, copy, study, modify, and
9
- distribute this software and its documentation for personal, educational,
10
- research, internal business, and non-commercial purposes, subject to the terms
11
- below.
12
-
13
- You may:
14
-
15
- 1. Use Sema locally as a CLI in your own projects.
16
- 2. Study and modify the source code.
17
- 3. Share unmodified or modified copies for non-commercial purposes.
18
- 4. Publish patches, examples, documentation, and integrations that do not sell
19
- Sema itself as a product or commercial replacement.
20
-
21
- You may not, without prior written permission from OtimiTare:
22
-
23
- 1. Sell Sema, a modified Sema, or a substantially similar rebranded copy.
24
- 2. Offer Sema, a modified Sema, or a substantially similar implementation as a
25
- commercial replica or paid replacement.
26
- 3. Bundle Sema into a paid product in a way that makes Sema itself a material
27
- commercial feature.
28
- 4. Use Sema's name, marks, documentation, or public repository to imply
29
- endorsement by Sema or OtimiTare.
30
- 5. Remove this license or the copyright notice from distributed copies.
31
-
32
- Commercial licensing, resale permission, or commercial replica permission
33
- requires written approval. Contact suporte@otimitare.online.
34
-
35
- This software is provided "as is", without warranty of any kind, express or
36
- implied, including but not limited to warranties of merchantability, fitness for
37
- a particular purpose, and non-infringement. In no event shall the authors or
38
- copyright holders be liable for any claim, damages, or other liability arising
39
- from the software or its use.
1
+ Sema Public Non-Commercial License
2
+ Version 1.0
3
+
4
+ Copyright (c) 2026 Sema
5
+
6
+ Official support: suporte@otimitare.online
7
+
8
+ Permission is granted, free of charge, to use, copy, study, modify, and
9
+ distribute this software and its documentation for personal, educational,
10
+ research, internal business, and non-commercial purposes, subject to the terms
11
+ below.
12
+
13
+ You may:
14
+
15
+ 1. Use Sema locally as a CLI in your own projects.
16
+ 2. Study and modify the source code.
17
+ 3. Share unmodified or modified copies for non-commercial purposes.
18
+ 4. Publish patches, examples, documentation, and integrations that do not sell
19
+ Sema itself as a product or commercial replacement.
20
+
21
+ You may not, without prior written permission from OtimiTare:
22
+
23
+ 1. Sell Sema, a modified Sema, or a substantially similar rebranded copy.
24
+ 2. Offer Sema, a modified Sema, or a substantially similar implementation as a
25
+ commercial replica or paid replacement.
26
+ 3. Bundle Sema into a paid product in a way that makes Sema itself a material
27
+ commercial feature.
28
+ 4. Use Sema's name, marks, documentation, or public repository to imply
29
+ endorsement by Sema or OtimiTare.
30
+ 5. Remove this license or the copyright notice from distributed copies.
31
+
32
+ Commercial licensing, resale permission, or commercial replica permission
33
+ requires written approval. Contact suporte@otimitare.online.
34
+
35
+ This software is provided "as is", without warranty of any kind, express or
36
+ implied, including but not limited to warranties of merchantability, fitness for
37
+ a particular purpose, and non-infringement. In no event shall the authors or
38
+ copyright holders be liable for any claim, damages, or other liability arising
39
+ from the software or its use.
package/README.md CHANGED
@@ -1,141 +1,251 @@
1
- # @semacode/cli
2
-
3
- `@semacode/cli` is the public Codex-native local CLI for Sema semantic
4
- governance.
5
-
6
- It validates `.sema` contracts, checks semantic drift, maps impact, enforces
7
- documentation gates, generates starter code, and prepares contract-first
8
- context for Codex inside a local project folder.
9
-
10
- Sema is an independent product and is not affiliated with or endorsed by
11
- OpenAI. Codex-native describes Sema's official product direction, not an
12
- official OpenAI program, integration, or submission.
13
-
14
- Official support: [suporte@otimitare.online](mailto:suporte@otimitare.online)
15
-
16
- ## Install
17
-
18
- ```bash
19
- npm install -g @semacode/cli
20
- codex plugin marketplace add gerlanss/Sema
21
- codex plugin add sema@sema
22
- ```
23
-
24
- Open a new Codex task in the target repository after installing the plugin.
25
- Existing tasks do not reload their plugin/skill catalog. Invoke `$sema` in the
26
- new task; after it creates and reads `AGENTS.md`, later tasks load that workspace
27
- protocol automatically.
28
-
29
- ## First Run
30
-
31
- ```bash
32
- sema --version
33
- sema resumo . --curto
34
- ```
35
-
36
- Public Sema is local-only. The CLI runs directly without a Sema login, user
37
- authorization, product-license check, activation key, token, credits, billing
38
- service, control panel, or external service credentials. The license governs
39
- use and redistribution; it is not a runtime activation gate.
40
-
41
- ## Codex Setup
42
-
43
- `AGENTS.md` is the official Sema entrypoint for Codex:
44
-
45
- ```bash
46
- sema sync-codex --json
47
- ```
48
-
49
- Codex automatically loads `AGENTS.md` as durable repository guidance. See the
50
- [Codex `AGENTS.md` documentation](https://learn.chatgpt.com/docs/agent-configuration/agents-md).
51
-
52
- The CLI is the engine and source of truth; `AGENTS.md` is the automatic
53
- workspace protocol. The Sema skill is required for Codex to bootstrap a project
54
- that does not have Sema yet. After initialization, the skill delegates to the
55
- generated `AGENTS.md`. Installing this npm package never writes into
56
- `CODEX_HOME`; skill installation remains an explicit Codex command.
57
-
58
- ## Codex-Native Architecture
59
-
60
- - `AGENTS.md` is the only official entrypoint. `sync-codex` changes only valid
61
- Sema-managed blocks and preserves malformed or manual content for review.
62
- - Agent Context Pack consumers use schema version 6 and the fields
63
- `entrypointCodex`, `codexNativo`, and `cliLocalSemAutorizacao`.
64
- - The Sema Codex skill is required for first contact. It initializes the
65
- workspace and generates `AGENTS.md`; it does not duplicate the governed
66
- workflow after that handoff.
67
-
68
- ## Local Workflow
69
-
70
- ```bash
71
- sema docs-impacto --intencao "describe the change" --arquivo contratos/app.sema --json
72
- sema inspecionar contratos/app.sema --json
73
- sema drift contratos/app.sema --escopo modulo --json
74
- sema impacto contratos/app.sema --alvo app.modulo --mudanca "describe the change" --json
75
- sema finalizar-mudanca --intencao "describe the change" --doc-lida README.md --json
76
- ```
77
-
78
- If the project has no `.sema` contract, create one before implementing behavior:
79
-
80
- ```bash
81
- sema iniciar --template base
82
- ```
83
-
84
- Initialization preserves existing files and rejects symlink or junction
85
- escapes. Use `--force` only when overwriting the template destinations is an
86
- explicit human decision; the Codex bootstrap skill never adds it.
87
-
88
- ## Code Generation
89
-
90
- ```bash
91
- sema compilar contratos/app.sema --alvo typescript --saida .tmp/app-ts --estrutura modulos
92
- sema compilar contratos/app.sema --alvo python --saida .tmp/app-py --estrutura modulos
93
- sema compilar contratos/app.sema --alvo php --saida .tmp/app-php --estrutura modulos
94
- sema compilar contratos/app.sema --alvo dotnet --saida .tmp/app-dotnet --estrutura modulos
95
- sema compilar contratos/app.sema --alvo cpp --saida .tmp/app-cpp --estrutura modulos
96
- ```
97
-
98
- Generated artifacts include `SEMA-GOVERNED` headers and must stay aligned with
99
- the source contract.
100
-
101
- ## Validation
102
-
103
- ```bash
104
- sema validar contratos/app.sema --json
105
- sema diagnosticos contratos/app.sema --json
106
- sema testar contratos/app.sema --alvo typescript --saida .tmp/app-tests
107
- sema testar contratos/app.sema --alvo dotnet --saida .tmp/app-dotnet-tests
108
- sema testar contratos/app.sema --alvo cpp --saida .tmp/app-cpp-tests
109
- sema verificar contratos/app.sema --saida .tmp/app-check --json
110
- ```
111
-
112
- ## AI-native Content Pipeline
113
-
114
- `sema conteudo` validates and plans multi-channel, multi-format content work,
115
- verifies signed policies and evidence, replays canonical state, and projects
116
- non-authoritative manifests. Producer agents, specialized AI evaluators,
117
- creative tools, and delivery adapters run in an external runner; there is no
118
- native human-review transition.
119
-
120
- ```bash
121
- sema conteudo validar exemplos/pipeline-conteudo/definicao.json --json
122
- sema conteudo planejar exemplos/pipeline-conteudo/definicao.json --alvos-arquivo exemplos/pipeline-conteudo/alvos.json --json
123
- ```
124
-
125
- See `docs/pipeline-conteudo.md` for the signed trust, quorum, ledger, target,
126
- adapter, and projection model.
127
-
128
- ## Public Boundary
129
-
130
- The npm package is for local CLI usage only. It must not contain private or
131
- sensitive operational material.
132
-
133
- ## Commercial Use
134
-
135
- Sema is public source for local semantic governance, but commercial resale,
136
- white-label redistribution, or commercial replicas require written permission
137
- from OtimiTare.
138
-
139
- ## Support
140
-
141
- Use [suporte@otimitare.online](mailto:suporte@otimitare.online) for support.
1
+ # @semacode/cli
2
+
3
+ `@semacode/cli` is the public Codex-native local CLI for Sema semantic
4
+ governance.
5
+
6
+ It validates `.sema` contracts, checks semantic drift, maps impact, enforces
7
+ documentation gates, generates starter code, and prepares contract-first
8
+ context for Codex inside a local project folder.
9
+
10
+ Sema is an independent product and is not affiliated with or endorsed by
11
+ OpenAI. Codex-native describes Sema's official product direction, not an
12
+ official OpenAI program, integration, or submission.
13
+
14
+ Official support: [suporte@otimitare.online](mailto:suporte@otimitare.online)
15
+
16
+ ## Install
17
+
18
+ ```bash
19
+ npm install -g @semacode/cli
20
+ codex plugin marketplace add gerlanss/Sema
21
+ codex plugin add sema@sema
22
+ ```
23
+
24
+ Open a new Codex task in the target repository after installing the plugin.
25
+ Existing tasks do not reload their plugin/skill catalog. Invoke `$sema` in the
26
+ new task; after it creates and reads `AGENTS.md`, later tasks load that workspace
27
+ protocol automatically.
28
+
29
+ ## First Run
30
+
31
+ ```bash
32
+ sema --version
33
+ sema resumo . --curto
34
+ ```
35
+
36
+ Public Sema is local-only. The CLI runs directly without a Sema login, user
37
+ authorization, product-license check, activation key, token, credits, billing
38
+ service, control panel, or external service credentials. The license governs
39
+ use and redistribution; it is not a runtime activation gate.
40
+
41
+ ## Codex Setup
42
+
43
+ `AGENTS.md` is the official Sema entrypoint for Codex:
44
+
45
+ ```bash
46
+ sema sync-codex --json
47
+ ```
48
+
49
+ Codex automatically loads `AGENTS.md` as durable repository guidance. See the
50
+ [Codex `AGENTS.md` documentation](https://learn.chatgpt.com/docs/agent-configuration/agents-md).
51
+
52
+ The CLI is the engine and source of truth; `AGENTS.md` is the automatic
53
+ workspace protocol. The Sema skill is required for Codex to bootstrap a project
54
+ that does not have Sema yet. After initialization, the skill delegates to the
55
+ generated `AGENTS.md`. Installing this npm package never writes into
56
+ `CODEX_HOME`; skill installation remains an explicit Codex command.
57
+
58
+ ## Codex-Native Architecture
59
+
60
+ - `AGENTS.md` is the only official entrypoint. `sync-codex` changes only valid
61
+ Sema-managed blocks and preserves malformed or manual content for review.
62
+ - Agent Context Pack consumers use schema version 7, including the deterministic
63
+ discovery summary and the fields `entrypointCodex`, `codexNativo`, and
64
+ `cliLocalSemAutorizacao`.
65
+ - The Sema Codex skill is required for first contact. It initializes the
66
+ workspace and generates `AGENTS.md`; it does not duplicate the governed
67
+ workflow after that handoff.
68
+
69
+ ## Local Workflow
70
+
71
+ ```bash
72
+ sema docs-impacto --intencao "describe the change" --arquivo contratos/app.sema --json
73
+ sema inspecionar contratos/app.sema --json
74
+ sema drift contratos/app.sema --escopo modulo --json
75
+ sema impacto contratos/app.sema --alvo app.modulo --mudanca "describe the change" --json
76
+ sema finalizar-mudanca --intencao "describe the change" --doc-lida README.md --json
77
+ ```
78
+
79
+ ## Focused Drift and Incremental Cache
80
+
81
+ `sema inspecionar contratos/app.sema` and `sema resumo contratos/app.sema --micro`
82
+ are light, contract-only discovery by default (`--drift none`). Use
83
+ `--com-drift`, `--drift cache`, or `--drift fresh` explicitly when live-code
84
+ evidence is needed. A `none` result leaves the drift score absent and never
85
+ claims that implementation, routes, or links were verified.
86
+
87
+ ```bash
88
+ sema inspecionar contratos/app.sema --com-drift --json
89
+ sema resumo contratos/app.sema --micro --drift cache --json
90
+ sema drift contratos/app.sema --escopo modulo --cache auto --json
91
+ ```
92
+
93
+ A file target loads only the selected contract and its transitive `use`
94
+ closure. Narrow drift plans physical files before cataloging, shares one
95
+ catalog/content snapshot across indexers, and stores validated incremental
96
+ entries under `.tmp/sema-cache`. Inspect `escopo_aplicado.catalogo`,
97
+ `escopo_aplicado.cache.incremental`, and `escopo_aplicado.cache.fasesMs` for
98
+ the actual work performed. Use `--escopo projeto` for an intentional global
99
+ walk and `--cache refresh|off` to force recalculation or disable persistent
100
+ cache I/O.
101
+
102
+ If the project has no `.sema` contract, create one before implementing behavior:
103
+
104
+ ```bash
105
+ sema iniciar --template base
106
+ ```
107
+
108
+ Initialization preserves existing files and rejects symlink or junction
109
+ escapes. Use `--force` only when overwriting the template destinations is an
110
+ explicit human decision; the Codex bootstrap skill never adds it.
111
+
112
+ ## Code Generation
113
+
114
+ ```bash
115
+ sema compilar contratos/app.sema --alvo typescript --saida .tmp/app-ts --estrutura modulos
116
+ sema compilar contratos/app.sema --alvo python --saida .tmp/app-py --estrutura modulos
117
+ sema compilar contratos/app.sema --alvo php --saida .tmp/app-php --estrutura modulos
118
+ sema compilar contratos/app.sema --alvo dotnet --saida .tmp/app-dotnet --estrutura modulos
119
+ sema compilar contratos/app.sema --alvo cpp --saida .tmp/app-cpp --estrutura modulos
120
+ ```
121
+
122
+ Generated artifacts include `SEMA-GOVERNED` headers and must stay aligned with
123
+ the source contract.
124
+
125
+ ## Validation
126
+
127
+ ```bash
128
+ sema validar contratos/app.sema --json
129
+ sema diagnosticos contratos/app.sema --json
130
+ sema testar contratos/app.sema --alvo typescript --saida .tmp/app-tests
131
+ sema testar contratos/app.sema --alvo dotnet --saida .tmp/app-dotnet-tests
132
+ sema testar contratos/app.sema --alvo cpp --saida .tmp/app-cpp-tests
133
+ sema verificar contratos/app.sema --saida .tmp/app-check --json
134
+ ```
135
+
136
+ ## AI-native Content Pipeline
137
+
138
+ `sema conteudo` validates and plans multi-channel, multi-format content work,
139
+ verifies signed policies and evidence, replays canonical state, and projects
140
+ non-authoritative manifests. Producer agents, specialized AI evaluators,
141
+ creative tools, and delivery adapters run in an external runner; there is no
142
+ native human-review transition.
143
+
144
+ ```bash
145
+ sema conteudo validar exemplos/pipeline-conteudo/definicao.json --json
146
+ sema conteudo planejar exemplos/pipeline-conteudo/definicao.json --alvos-arquivo exemplos/pipeline-conteudo/alvos.json --json
147
+ ```
148
+
149
+ See `docs/pipeline-conteudo.md` for the signed trust, quorum, ledger, target,
150
+ adapter, and projection model.
151
+
152
+ ## Capability Discovery and Interactive Systems
153
+
154
+ `sema descobrir` exposes one explainable catalog and a deterministic intent
155
+ router. `sema interativo` validates and plans games, simulations, and hybrids
156
+ across independent spatial models, render modes, retro visual profiles, control,
157
+ time, determinism, and fidelity axes without running an engine or silently
158
+ mutating a workspace.
159
+
160
+ ```bash
161
+ sema descobrir catalogo --json
162
+ sema descobrir recomendar --intencao "calibrate a headless autonomous simulation" --json
163
+ sema interativo schema --json
164
+ sema interativo pipelines --json
165
+ sema interativo validar exemplos/sistemas-interativos/simulation-headless-autonomous-batch.json --json
166
+ ```
167
+
168
+ The canonical interactive catalog contains 35 unique pipelines and 28 unique
169
+ external adapter descriptors. Its advanced P0/P1/P2 surface covers Experience
170
+ IR, semantic engine snapshots, asset provenance, editor-state descriptions,
171
+ multimodal evidence, resumable jobs, acceptance locks, temporal/shot/physics QA,
172
+ clean-install and hardware constraints, safe autonomous repair, bounded
173
+ playtest/fuzz plans, multiplayer authority, portability with declared losses,
174
+ and distributed worker DAGs.
175
+
176
+ Advanced read-only commands:
177
+
178
+ ```bash
179
+ sema interativo validar-ir <file> --json
180
+ sema interativo indexar-ir <file> --json
181
+ sema interativo consultar-ir <file> --semantic-id <id> --json
182
+ sema interativo chunk-ir <file> --semantic-id <id> [--raso] --json
183
+ sema interativo descrever-ir --json
184
+
185
+ sema interativo validar-engine-snapshot <file> --json
186
+ sema interativo diff-engine-snapshots <before> <after> --json
187
+ sema interativo validar-asset-provenance <file> --json
188
+ sema interativo validar-editor-state <file> --json
189
+ sema interativo planejar-jobs <file> --json
190
+ sema interativo validar-acceptance <file> --json
191
+ sema interativo operar-acceptance <lock> --operation <VALIDATE|EVALUATE|INVALIDATE> --context-file <file> --json
192
+ sema interativo validar-multimodal <file> --json
193
+
194
+ sema interativo validar-temporal <file> --json
195
+ sema interativo validar-evidencia-temporal <contract> --bundle-arquivo <file> --json
196
+ sema interativo validar-autonomia <file> --json
197
+ sema interativo validar-playtest-fuzz <file> --json
198
+ sema interativo validar-multiplayer <file> --json
199
+ sema interativo analisar-portabilidade <file> --json
200
+ sema interativo validar-workers <file> --json
201
+
202
+ sema interativo validar-control-run <control-run.json> --definition-arquivo <definition.json> --plano-arquivo <plan.json> --contrato-arquivo <validation-contract.json> --entrada-arquivo <input.json> [--entrada-auxiliar-arquivo <supporting-input.json>] --evidencia-arquivo <evidence.json> --resultado-arquivo <result.json> --json
203
+ ```
204
+
205
+ All of these commands are local and read-only. Adapter entries are external
206
+ capability descriptors: the package does not detect, probe, launch, install, or
207
+ control any engine, editor, plug-in, process, verifier, or worker. A
208
+ `STRUCTURALLY_COMPLETE` result is local structural coverage only; it always
209
+ remains `completed: false`, `authoritative: false`, and awaits external
210
+ attestation. The CLI never equates a descriptor, fixture, plan, or supplied JSON
211
+ record with proof that external work occurred.
212
+
213
+ See `docs/descoberta-capacidades.md` and `docs/sistemas-interativos.md` for the
214
+ ranking, adapter protocol, evidence boundary, fidelity, and coverage model.
215
+
216
+ ## Programmatic API
217
+
218
+ The package root can be imported without executing the CLI process:
219
+
220
+ ```js
221
+ import {
222
+ analisarPlanoPortabilidadeInterativa,
223
+ indexarExperienceIr,
224
+ montarCatalogoCapacidades,
225
+ validarContratoTemporalInterativo,
226
+ validarControlRunInterativo,
227
+ validarDefinicaoSistemaInterativo,
228
+ validarExperienceIr,
229
+ } from "@semacode/cli";
230
+ ```
231
+
232
+ Only the package-root exports are public. Internal `dist/*` deep imports remain
233
+ blocked, and importing the package never parses CLI arguments or exits the host
234
+ process. Programmatic validators and planners preserve the same read-only,
235
+ non-authoritative boundary as their CLI equivalents.
236
+
237
+ ## Public Boundary
238
+
239
+ The npm package is local-only: its CLI and programmatic API do not depend on a
240
+ hosted Sema service. It must not contain private or sensitive operational
241
+ material.
242
+
243
+ ## Commercial Use
244
+
245
+ Sema is public source for local semantic governance, but commercial resale,
246
+ white-label redistribution, or commercial replicas require written permission
247
+ from OtimiTare.
248
+
249
+ ## Support
250
+
251
+ Use [suporte@otimitare.online](mailto:suporte@otimitare.online) for support.
@@ -13,7 +13,7 @@ export declare function criarEntradaCanonicaProjeto(guiaPorCapacidade: GuiaCapac
13
13
  pequena: import("./agentContextTipos.js").CapacidadeIa;
14
14
  grande: import("./agentContextTipos.js").CapacidadeIa;
15
15
  };
16
- docsSuporte: ("docs/ai-integration.md" | "docs/ai-workflow.md" | "docs/ai-onboarding.md" | "docs/syntax.md" | "docs/cli.md" | "docs/commands.md" | "docs/profiles.md" | "docs/testing.md" | "docs/documentation.md" | "docs/deploy.md" | "docs/env.md" | "docs/rollback.md")[];
16
+ docsSuporte: ("docs/ai-integration.md" | "docs/ai-workflow.md" | "docs/ai-onboarding.md" | "docs/syntax.md" | "docs/cli.md" | "docs/commands.md" | "docs/descoberta-capacidades.md" | "docs/profiles.md" | "docs/sistemas-interativos.md" | "docs/testing.md" | "docs/documentation.md" | "docs/deploy.md" | "docs/env.md" | "docs/rollback.md")[];
17
17
  agentContextPack: import("./agentContextTipos.js").AgentContextPack;
18
18
  guiaPorCapacidade: GuiaCapacidadeIaMap;
19
19
  };
@@ -2,6 +2,7 @@
2
2
  // Descrição: monta o Agent Context Pack e políticas que agentes fracos, médios e fortes consomem antes do código.
3
3
  import { LIMITE_AVISO_LINHAS_CODIGO_GOVERNADO, LIMITE_AVISO_LINHAS_CONTRATO_SEMA, LIMITE_BLOQUEIO_LINHAS_CODIGO_GOVERNADO, LIMITE_BLOQUEIO_LINHAS_CONTRATO_SEMA, } from './driftOrcamento.js';
4
4
  import { ALIASES_CAPACIDADE_IA, ARQUIVO_AGENT_CONTEXT_PACK, ARQUIVO_DOC_AGENTES_CAPACIDADE, ARQUIVO_ENTRYPOINT_CODEX, ARQUIVO_SEMA_BOOT, ARQUIVO_SEMA_SMALL_MODEL, EXEMPLOS_OFICIAIS_AGENT_CONTEXT, } from './agentContextTipos.js';
5
+ import { criarResumoDescobertaAgentContext } from "./discovery/index.js";
5
6
  export const LIMITE_CARACTERES_PAYLOAD_INLINE = 262144;
6
7
  export function criarGuiaCapacidadeIa() {
7
8
  const fraca = {
@@ -287,7 +288,7 @@ export function criarAgentContextPack(guiaPorCapacidade) {
287
288
  ];
288
289
  return {
289
290
  nome: "Agent Context Pack",
290
- versao: 6,
291
+ versao: 7,
291
292
  objetivo: "Dar a agentes IA uma entrada curta, estruturada e auditável antes de abrir código cru ou inventar contexto.",
292
293
  ordemLeitura: [
293
294
  ARQUIVO_SEMA_BOOT,
@@ -304,6 +305,7 @@ export function criarAgentContextPack(guiaPorCapacidade) {
304
305
  "Leia SEMA_BOOT.md antes de qualquer outro artefato de IA.",
305
306
  "Leia AGENTS.md antes de editar código, contrato, docs operacionais, release ou deploy.",
306
307
  "Leia docs/commands.md antes de escolher comando Sema, interpretar um gate ou usar --saida de sema compilar.",
308
+ "Quando a intenção não deixar claro qual profile, workflow, pipeline, gerador ou adapter usar, rode `sema descobrir recomendar --intencao \"<objetivo>\" --json`; a recomendação informa, mas nunca se autoexecuta.",
307
309
  "Em workspace local, rode sema --version; se falhar, pare e peça a instalação da CLI. Com a CLI disponível, use diretamente sema resumo, docs-impacto, inspecionar, drift e impacto sobre a pasta local.",
308
310
  "Antes de editar, rode `sema inspecionar <contrato.sema> --json`, `sema drift <contrato.sema> --escopo modulo --json` e `sema impacto <contrato.sema> --alvo <token> --mudanca \"<descricao>\" --json`.",
309
311
  "Use exemplos oficiais antes de criar ou corrigir sintaxe .sema.",
@@ -326,6 +328,7 @@ export function criarAgentContextPack(guiaPorCapacidade) {
326
328
  ],
327
329
  proibicoes: [
328
330
  "Não inventar sintaxe Sema fora da gramática e dos exemplos oficiais.",
331
+ "Não adivinhar nem executar automaticamente uma capacidade quando discovery reportar no-match, ambiguidade ou inputs ausentes.",
329
332
  "Não tratar README, texto livre ou código como fonte superior ao contrato.",
330
333
  "Não substituir os gates da CLI Sema por README.md, busca local, inferência pelo nome do projeto ou bom senso.",
331
334
  "Não tratar a pasta --saida de sema compilar como entrega final; entrega são os arquivos alvo/vínculos do contrato.",
@@ -349,6 +352,7 @@ export function criarAgentContextPack(guiaPorCapacidade) {
349
352
  ],
350
353
  prioridades: [
351
354
  "Menor artefato suficiente primeiro.",
355
+ "Catálogo de discovery antes de escolher por chute entre profile, workflow, pipeline, gerador ou adapter.",
352
356
  "Workspace local: sema --version, resumo, docs-impacto, inspecionar, drift e impacto pela CLI; se sema não existir, pare e peça a instalação da CLI.",
353
357
  "Contrato, índice e AGENTS complementam o contexto Sema; não substituem chamada Sema.",
354
358
  "Exemplos oficiais antes de nova sintaxe.",
@@ -363,6 +367,7 @@ export function criarAgentContextPack(guiaPorCapacidade) {
363
367
  "Se risco ou escopo estiver ambíguo, parar e pedir contrato/contexto.",
364
368
  ],
365
369
  fontes,
370
+ descoberta: criarResumoDescobertaAgentContext(),
366
371
  exemplosOficiais: [...EXEMPLOS_OFICIAIS_AGENT_CONTEXT],
367
372
  textoBrutoSobDemanda: Object.fromEntries(fontes.map((fonte) => [fonte.caminho, fonte.incluirTextoBrutoQuando])),
368
373
  guiaPorCapacidade: {
@@ -1,3 +1,4 @@
1
+ import type { ResumoDescobertaAgentContext } from "./discovery/types.js";
1
2
  export type CapacidadeIa = "fraca" | "media" | "forte";
2
3
  export type CapacidadeIaLegada = "pequena" | "grande";
3
4
  export type ChaveGuiaCapacidadeIa = CapacidadeIa | CapacidadeIaLegada;
@@ -65,6 +66,7 @@ export interface AgentContextPack {
65
66
  proibicoes: string[];
66
67
  prioridades: string[];
67
68
  fontes: FonteAgentContextPack[];
69
+ descoberta: ResumoDescobertaAgentContext;
68
70
  exemplosOficiais: string[];
69
71
  textoBrutoSobDemanda: Record<string, string>;
70
72
  guiaPorCapacidade: Record<ChaveGuiaCapacidadeIa, string[]>;
@@ -89,5 +91,5 @@ export declare const CAPACIDADES_IA_OPERACIONAIS: readonly ["fraca", "media", "f
89
91
  export declare const ALIASES_CAPACIDADE_IA: Record<CapacidadeIaLegada, CapacidadeIa>;
90
92
  export declare const MARCADOR_SEMA_AGENT_ENTRYPOINT_INICIO = "<!-- sema:agent-entrypoint:start -->";
91
93
  export declare const MARCADOR_SEMA_AGENT_ENTRYPOINT_FIM = "<!-- sema:agent-entrypoint:end -->";
92
- export declare const DOCUMENTOS_SUPORTE_IA: readonly ["docs/ai-integration.md", "docs/ai-workflow.md", "docs/ai-onboarding.md", "docs/syntax.md", "docs/cli.md", "docs/commands.md", "docs/profiles.md", "docs/testing.md", "docs/documentation.md", "docs/deploy.md", "docs/env.md", "docs/rollback.md"];
93
- export declare const EXEMPLOS_OFICIAIS_AGENT_CONTEXT: readonly ["exemplos/calculadora.sema", "exemplos/pagamento.sema", "exemplos/profile_software.sema", "exemplos/profile_workflow_n8n.sema", "exemplos/profile_ops.sema", "exemplos/profile_game.sema", "exemplos/profile_legal.sema", "exemplos/profile_research.sema", "exemplos/author_obra_comum.sema"];
94
+ export declare const DOCUMENTOS_SUPORTE_IA: readonly ["docs/ai-integration.md", "docs/ai-workflow.md", "docs/ai-onboarding.md", "docs/syntax.md", "docs/cli.md", "docs/commands.md", "docs/descoberta-capacidades.md", "docs/profiles.md", "docs/sistemas-interativos.md", "docs/testing.md", "docs/documentation.md", "docs/deploy.md", "docs/env.md", "docs/rollback.md"];
95
+ export declare const EXEMPLOS_OFICIAIS_AGENT_CONTEXT: readonly ["exemplos/calculadora.sema", "exemplos/pagamento.sema", "exemplos/profile_software.sema", "exemplos/profile_workflow_n8n.sema", "exemplos/profile_ops.sema", "exemplos/profile_game.sema", "exemplos/profile_simulation.sema", "exemplos/sistemas-interativos/game-pixel-16-bit.json", "exemplos/sistemas-interativos/simulation-headless-autonomous-batch.json", "exemplos/sistemas-interativos/simulation-3d-calibrated-autonomous.json", "exemplos/sistemas-interativos/protocol-read-only-valid.json", "exemplos/profile_legal.sema", "exemplos/profile_research.sema", "exemplos/author_obra_comum.sema"];
@@ -30,7 +30,9 @@ export const DOCUMENTOS_SUPORTE_IA = [
30
30
  "docs/syntax.md",
31
31
  "docs/cli.md",
32
32
  "docs/commands.md",
33
+ "docs/descoberta-capacidades.md",
33
34
  "docs/profiles.md",
35
+ "docs/sistemas-interativos.md",
34
36
  "docs/testing.md",
35
37
  "docs/documentation.md",
36
38
  "docs/deploy.md",
@@ -44,6 +46,11 @@ export const EXEMPLOS_OFICIAIS_AGENT_CONTEXT = [
44
46
  "exemplos/profile_workflow_n8n.sema",
45
47
  "exemplos/profile_ops.sema",
46
48
  "exemplos/profile_game.sema",
49
+ "exemplos/profile_simulation.sema",
50
+ "exemplos/sistemas-interativos/game-pixel-16-bit.json",
51
+ "exemplos/sistemas-interativos/simulation-headless-autonomous-batch.json",
52
+ "exemplos/sistemas-interativos/simulation-3d-calibrated-autonomous.json",
53
+ "exemplos/sistemas-interativos/protocol-read-only-valid.json",
47
54
  "exemplos/profile_legal.sema",
48
55
  "exemplos/profile_research.sema",
49
56
  "exemplos/author_obra_comum.sema",