@semacode/cli 2.3.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 (177) hide show
  1. package/LICENSE +39 -39
  2. package/README.md +251 -228
  3. package/dist/agentEntryPoints.js +551 -550
  4. package/dist/angular-consumer-standalone.d.ts +3 -1
  5. package/dist/angular-consumer-standalone.js +12 -8
  6. package/dist/drift.part01.d.ts +32 -2
  7. package/dist/drift.part01.js +2 -0
  8. package/dist/drift.part04.d.ts +3 -2
  9. package/dist/drift.part04.js +6 -3
  10. package/dist/drift.part05.d.ts +2 -1
  11. package/dist/drift.part05.js +4 -3
  12. package/dist/drift.part06.d.ts +2 -1
  13. package/dist/drift.part06.js +9 -5
  14. package/dist/drift.part07.d.ts +11 -10
  15. package/dist/drift.part07.js +40 -30
  16. package/dist/drift.part08.d.ts +2 -1
  17. package/dist/drift.part08.js +4 -3
  18. package/dist/drift.part11.js +71 -6
  19. package/dist/drift.part12.js +14 -1
  20. package/dist/drift.part13.d.ts +42 -7
  21. package/dist/drift.part13.js +660 -36
  22. package/dist/driftCache.d.ts +49 -0
  23. package/dist/driftCache.js +311 -0
  24. package/dist/driftCacheIncremental.d.ts +98 -0
  25. package/dist/driftCacheIncremental.js +596 -0
  26. package/dist/driftCatalogo.d.ts +91 -0
  27. package/dist/driftCatalogo.js +657 -0
  28. package/dist/driftCatalogoPersistente.d.ts +8 -0
  29. package/dist/driftCatalogoPersistente.js +77 -0
  30. package/dist/driftEscopo.d.ts +23 -0
  31. package/dist/driftEscopo.js +563 -0
  32. package/dist/driftEscopoReferencias.d.ts +4 -0
  33. package/dist/driftEscopoReferencias.js +265 -0
  34. package/dist/driftOrcamento.d.ts +12 -0
  35. package/dist/driftOrcamento.js +19 -3
  36. package/dist/execucoesExternas.js +5 -19
  37. package/dist/iaPrompts.js +310 -310
  38. package/dist/index.part01.d.ts +16 -1
  39. package/dist/index.part01.js +80 -4
  40. package/dist/index.part02.js +21 -21
  41. package/dist/index.part03.d.ts +2 -2
  42. package/dist/index.part03.js +14 -3
  43. package/dist/index.part04.d.ts +2 -2
  44. package/dist/index.part04.js +113 -101
  45. package/dist/index.part05.d.ts +1 -1
  46. package/dist/index.part05.js +99 -22
  47. package/dist/index.part06.js +3 -2
  48. package/dist/index.part07.js +24 -24
  49. package/dist/index.part08.js +1 -1
  50. package/dist/init/templates.part01.js +393 -393
  51. package/dist/init/templates.part02.js +189 -189
  52. package/dist/initTemplatesBackend.js +73 -73
  53. package/dist/initTemplatesBase.js +81 -81
  54. package/dist/initTemplatesFlutter.js +137 -137
  55. package/dist/initTemplatesRuntime.js +350 -350
  56. package/dist/initTemplatesWeb.js +309 -309
  57. package/dist/pipelineConteudo/command.js +1 -36
  58. package/dist/projeto.d.ts +1 -1
  59. package/dist/projetoCarregar.d.ts +2 -2
  60. package/dist/projetoCarregar.js +47 -24
  61. package/dist/projetoCatalogo.d.ts +7 -0
  62. package/dist/projetoCatalogo.js +125 -0
  63. package/dist/projetoTipos.d.ts +14 -5
  64. package/dist/sync/index.js +35 -35
  65. package/docs/README.md +34 -34
  66. package/docs/ai-integration.md +1 -7
  67. package/docs/ai-onboarding.md +62 -62
  68. package/docs/ai-workflow.md +4 -0
  69. package/docs/auth.md +26 -26
  70. package/docs/cli.md +79 -79
  71. package/docs/commands.md +16 -13
  72. package/docs/database.md +15 -15
  73. package/docs/deploy.md +41 -41
  74. package/docs/descoberta-capacidades.md +106 -106
  75. package/docs/documentation.md +37 -46
  76. package/docs/env.md +16 -16
  77. package/docs/frontend.md +41 -41
  78. package/docs/getting-started.md +57 -57
  79. package/docs/i18n.md +15 -15
  80. package/docs/pipeline-conteudo.md +246 -246
  81. package/docs/profiles.md +54 -54
  82. package/docs/repositories.md +43 -43
  83. package/docs/rollback.md +31 -31
  84. package/docs/security.md +32 -32
  85. package/docs/sistemas-interativos.md +373 -378
  86. package/docs/support.md +8 -8
  87. package/docs/testing.md +51 -44
  88. package/docs/vocabulary.md +29 -29
  89. package/exemplos/agendamento.sema +1 -1
  90. package/exemplos/assinatura.sema +1 -1
  91. package/exemplos/auditoria.sema +1 -1
  92. package/exemplos/autenticacao.sema +1 -1
  93. package/exemplos/author_obra_comum.sema +1 -1
  94. package/exemplos/author_tema_sensivel.sema +1 -1
  95. package/exemplos/automacao.sema +1 -1
  96. package/exemplos/cadastro_usuario.sema +1 -1
  97. package/exemplos/calculadora.sema +1 -1
  98. package/exemplos/crud_simples.sema +1 -1
  99. package/exemplos/estoque.sema +1 -1
  100. package/exemplos/exportacao.sema +1 -1
  101. package/exemplos/fila.sema +1 -1
  102. package/exemplos/integracao_externa.sema +1 -1
  103. package/exemplos/multi_tenant.sema +1 -1
  104. package/exemplos/notificacao.sema +1 -1
  105. package/exemplos/operacao_estrategia.sema +132 -132
  106. package/exemplos/operacao_estrategia_discovery.sema +220 -220
  107. package/exemplos/operacao_estrategia_fluxo.sema +114 -114
  108. package/exemplos/operacao_estrategia_gates.sema +106 -106
  109. package/exemplos/operacao_estrategia_quarentena.sema +133 -133
  110. package/exemplos/operacao_estrategia_rollout.sema +124 -124
  111. package/exemplos/pagamento.sema +1 -1
  112. package/exemplos/pagamento_dominio.sema +1 -1
  113. package/exemplos/pedido.sema +1 -1
  114. package/exemplos/permissao.sema +1 -1
  115. package/exemplos/persistencia_vendor_first.sema +1 -1
  116. package/exemplos/pipeline-conteudo/README.md +44 -44
  117. package/exemplos/pipeline-conteudo/alvos.json +23 -23
  118. package/exemplos/pipeline-conteudo/definicao.json +136 -136
  119. package/exemplos/profile_conversas.sema +165 -165
  120. package/exemplos/profile_game.sema +1 -1
  121. package/exemplos/profile_legal.sema +1 -1
  122. package/exemplos/profile_ops.sema +1 -1
  123. package/exemplos/profile_research.sema +1 -1
  124. package/exemplos/profile_simulation.sema +211 -211
  125. package/exemplos/profile_software.sema +1 -1
  126. package/exemplos/profile_workflow_n8n.sema +1 -1
  127. package/exemplos/relatorio.sema +1 -1
  128. package/exemplos/replica_analitica_erp.sema +1 -1
  129. package/exemplos/sistemas-interativos/README.md +100 -100
  130. package/exemplos/sistemas-interativos/advanced/acceptance-context-evaluate-valid.json +5 -5
  131. package/exemplos/sistemas-interativos/advanced/acceptance-lock-valid.json +16 -16
  132. package/exemplos/sistemas-interativos/advanced/asset-provenance-valid.json +32 -32
  133. package/exemplos/sistemas-interativos/advanced/autonomy-repair-valid.json +93 -93
  134. package/exemplos/sistemas-interativos/advanced/control-run-definition-valid.json +78 -78
  135. package/exemplos/sistemas-interativos/advanced/control-run-valid.json +27 -27
  136. package/exemplos/sistemas-interativos/advanced/distributed-workers-valid.json +79 -79
  137. package/exemplos/sistemas-interativos/advanced/editor-state-valid.json +42 -42
  138. package/exemplos/sistemas-interativos/advanced/engine-snapshot-after-valid.json +32 -32
  139. package/exemplos/sistemas-interativos/advanced/engine-snapshot-before-valid.json +23 -23
  140. package/exemplos/sistemas-interativos/advanced/job-orchestration-valid.json +39 -39
  141. package/exemplos/sistemas-interativos/advanced/multimodal-evidence-valid.json +46 -46
  142. package/exemplos/sistemas-interativos/advanced/multiplayer-authority-valid.json +39 -39
  143. package/exemplos/sistemas-interativos/advanced/playtest-fuzz-valid.json +37 -37
  144. package/exemplos/sistemas-interativos/advanced/portability-valid.json +104 -104
  145. package/exemplos/sistemas-interativos/advanced/temporal-evidence-valid.json +27 -27
  146. package/exemplos/sistemas-interativos/advanced/temporal-valid.json +118 -118
  147. package/exemplos/sistemas-interativos/experience-ir-valid.json +459 -459
  148. package/exemplos/sistemas-interativos/game-2d.json +83 -83
  149. package/exemplos/sistemas-interativos/game-3d-human.json +81 -81
  150. package/exemplos/sistemas-interativos/game-pixel-16-bit.json +97 -97
  151. package/exemplos/sistemas-interativos/game-pixel-8-bit.json +94 -94
  152. package/exemplos/sistemas-interativos/game-xr-human.json +80 -80
  153. package/exemplos/sistemas-interativos/hybrid-2-5d.json +108 -108
  154. package/exemplos/sistemas-interativos/protocol-mutating-rollback-valid.json +75 -75
  155. package/exemplos/sistemas-interativos/protocol-read-only-valid.json +58 -58
  156. package/exemplos/sistemas-interativos/simulation-2d-controlled.json +97 -97
  157. package/exemplos/sistemas-interativos/simulation-3d-calibrated-autonomous.json +141 -141
  158. package/exemplos/sistemas-interativos/simulation-headless-autonomous-batch.json +112 -112
  159. package/exemplos/sistemas-interativos/simulation-pixel-16-bit.json +103 -103
  160. package/exemplos/sistemas-interativos/simulation-text-controlled.json +95 -95
  161. package/exemplos/testes_embutidos.sema +1 -1
  162. package/exemplos/tratamento_erro.sema +1 -1
  163. package/exemplos/upload_arquivo.sema +1 -1
  164. package/exemplos/webhook.sema +1 -1
  165. package/node_modules/@sema/gerador-cpp/dist/index.js +176 -176
  166. package/node_modules/@sema/gerador-cpp/package.json +1 -1
  167. package/node_modules/@sema/gerador-css/dist/index.part01.js +10 -10
  168. package/node_modules/@sema/gerador-css/dist/index.part02.js +460 -460
  169. package/node_modules/@sema/gerador-dotnet/dist/index.js +169 -169
  170. package/node_modules/@sema/gerador-dotnet/package.json +1 -1
  171. package/node_modules/@sema/gerador-html/dist/index.js +17 -17
  172. package/node_modules/@sema/gerador-lua/dist/index.js +51 -51
  173. package/node_modules/@sema/gerador-php/dist/index.js +113 -113
  174. package/node_modules/@sema/gerador-python/dist/index.part02.js +3 -3
  175. package/node_modules/@sema/gerador-typescript/dist/index.part02.js +11 -11
  176. package/node_modules/@sema/nucleo/dist/diagnosticos/melhorador.js +42 -42
  177. 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,228 +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 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
- If the project has no `.sema` contract, create one before implementing behavior:
80
-
81
- ```bash
82
- sema iniciar --template base
83
- ```
84
-
85
- Initialization preserves existing files and rejects symlink or junction
86
- escapes. Use `--force` only when overwriting the template destinations is an
87
- explicit human decision; the Codex bootstrap skill never adds it.
88
-
89
- ## Code Generation
90
-
91
- ```bash
92
- sema compilar contratos/app.sema --alvo typescript --saida .tmp/app-ts --estrutura modulos
93
- sema compilar contratos/app.sema --alvo python --saida .tmp/app-py --estrutura modulos
94
- sema compilar contratos/app.sema --alvo php --saida .tmp/app-php --estrutura modulos
95
- sema compilar contratos/app.sema --alvo dotnet --saida .tmp/app-dotnet --estrutura modulos
96
- sema compilar contratos/app.sema --alvo cpp --saida .tmp/app-cpp --estrutura modulos
97
- ```
98
-
99
- Generated artifacts include `SEMA-GOVERNED` headers and must stay aligned with
100
- the source contract.
101
-
102
- ## Validation
103
-
104
- ```bash
105
- sema validar contratos/app.sema --json
106
- sema diagnosticos contratos/app.sema --json
107
- sema testar contratos/app.sema --alvo typescript --saida .tmp/app-tests
108
- sema testar contratos/app.sema --alvo dotnet --saida .tmp/app-dotnet-tests
109
- sema testar contratos/app.sema --alvo cpp --saida .tmp/app-cpp-tests
110
- sema verificar contratos/app.sema --saida .tmp/app-check --json
111
- ```
112
-
113
- ## AI-native Content Pipeline
114
-
115
- `sema conteudo` validates and plans multi-channel, multi-format content work,
116
- verifies signed policies and evidence, replays canonical state, and projects
117
- non-authoritative manifests. Producer agents, specialized AI evaluators,
118
- creative tools, and delivery adapters run in an external runner; there is no
119
- native human-review transition.
120
-
121
- ```bash
122
- sema conteudo validar exemplos/pipeline-conteudo/definicao.json --json
123
- sema conteudo planejar exemplos/pipeline-conteudo/definicao.json --alvos-arquivo exemplos/pipeline-conteudo/alvos.json --json
124
- ```
125
-
126
- See `docs/pipeline-conteudo.md` for the signed trust, quorum, ledger, target,
127
- adapter, and projection model.
128
-
129
- ## Capability Discovery and Interactive Systems
130
-
131
- `sema descobrir` exposes one explainable catalog and a deterministic intent
132
- router. `sema interativo` validates and plans games, simulations, and hybrids
133
- across independent spatial models, render modes, retro visual profiles, control,
134
- time, determinism, and fidelity axes without running an engine or silently
135
- mutating a workspace.
136
-
137
- ```bash
138
- sema descobrir catalogo --json
139
- sema descobrir recomendar --intencao "calibrate a headless autonomous simulation" --json
140
- sema interativo schema --json
141
- sema interativo pipelines --json
142
- sema interativo validar exemplos/sistemas-interativos/simulation-headless-autonomous-batch.json --json
143
- ```
144
-
145
- The canonical interactive catalog contains 35 unique pipelines and 28 unique
146
- external adapter descriptors. Its advanced P0/P1/P2 surface covers Experience
147
- IR, semantic engine snapshots, asset provenance, editor-state descriptions,
148
- multimodal evidence, resumable jobs, acceptance locks, temporal/shot/physics QA,
149
- clean-install and hardware constraints, safe autonomous repair, bounded
150
- playtest/fuzz plans, multiplayer authority, portability with declared losses,
151
- and distributed worker DAGs.
152
-
153
- Advanced read-only commands:
154
-
155
- ```bash
156
- sema interativo validar-ir <file> --json
157
- sema interativo indexar-ir <file> --json
158
- sema interativo consultar-ir <file> --semantic-id <id> --json
159
- sema interativo chunk-ir <file> --semantic-id <id> [--raso] --json
160
- sema interativo descrever-ir --json
161
-
162
- sema interativo validar-engine-snapshot <file> --json
163
- sema interativo diff-engine-snapshots <before> <after> --json
164
- sema interativo validar-asset-provenance <file> --json
165
- sema interativo validar-editor-state <file> --json
166
- sema interativo planejar-jobs <file> --json
167
- sema interativo validar-acceptance <file> --json
168
- sema interativo operar-acceptance <lock> --operation <VALIDATE|EVALUATE|INVALIDATE> --context-file <file> --json
169
- sema interativo validar-multimodal <file> --json
170
-
171
- sema interativo validar-temporal <file> --json
172
- sema interativo validar-evidencia-temporal <contract> --bundle-arquivo <file> --json
173
- sema interativo validar-autonomia <file> --json
174
- sema interativo validar-playtest-fuzz <file> --json
175
- sema interativo validar-multiplayer <file> --json
176
- sema interativo analisar-portabilidade <file> --json
177
- sema interativo validar-workers <file> --json
178
-
179
- 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
180
- ```
181
-
182
- All of these commands are local and read-only. Adapter entries are external
183
- capability descriptors: the package does not detect, probe, launch, install, or
184
- control any engine, editor, plug-in, process, verifier, or worker. A
185
- `STRUCTURALLY_COMPLETE` result is local structural coverage only; it always
186
- remains `completed: false`, `authoritative: false`, and awaits external
187
- attestation. The CLI never equates a descriptor, fixture, plan, or supplied JSON
188
- record with proof that external work occurred.
189
-
190
- See `docs/descoberta-capacidades.md` and `docs/sistemas-interativos.md` for the
191
- ranking, adapter protocol, evidence boundary, fidelity, and coverage model.
192
-
193
- ## Programmatic API
194
-
195
- The package root can be imported without executing the CLI process:
196
-
197
- ```js
198
- import {
199
- analisarPlanoPortabilidadeInterativa,
200
- indexarExperienceIr,
201
- montarCatalogoCapacidades,
202
- validarContratoTemporalInterativo,
203
- validarControlRunInterativo,
204
- validarDefinicaoSistemaInterativo,
205
- validarExperienceIr,
206
- } from "@semacode/cli";
207
- ```
208
-
209
- Only the package-root exports are public. Internal `dist/*` deep imports remain
210
- blocked, and importing the package never parses CLI arguments or exits the host
211
- process. Programmatic validators and planners preserve the same read-only,
212
- non-authoritative boundary as their CLI equivalents.
213
-
214
- ## Public Boundary
215
-
216
- The npm package is local-only: its CLI and programmatic API do not depend on a
217
- hosted Sema service. It must not contain private or sensitive operational
218
- material.
219
-
220
- ## Commercial Use
221
-
222
- Sema is public source for local semantic governance, but commercial resale,
223
- white-label redistribution, or commercial replicas require written permission
224
- from OtimiTare.
225
-
226
- ## Support
227
-
228
- 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.