@semacode/cli 2.3.1 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +265 -217
- package/dist/agentContextPack.js +14 -10
- package/dist/agentEntryPoints.d.ts +5 -0
- package/dist/agentEntryPoints.js +592 -568
- package/dist/angular-consumer-standalone.js +1 -1
- package/dist/bin.d.ts +6 -0
- package/dist/bin.js +130 -0
- package/dist/cliArgs.js +4 -4
- package/dist/cliControlError.d.ts +12 -0
- package/dist/cliControlError.js +47 -0
- package/dist/cliGrammar.d.ts +11 -0
- package/dist/cliGrammar.js +551 -0
- package/dist/cliHelp.d.ts +13 -0
- package/dist/cliHelp.js +19 -0
- package/dist/cliHelpTexto.d.ts +3 -0
- package/dist/cliHelpTexto.js +168 -0
- package/dist/cliRuntime.d.ts +2 -0
- package/dist/cliRuntime.js +31 -0
- package/dist/comandos.js +9 -22
- package/dist/contexto.js +5 -5
- package/dist/dev/index.d.ts +1 -0
- package/dist/dev/index.js +51 -9
- package/dist/discovery/catalog.js +3 -3
- package/dist/distribuicao/filesystemGlobal.d.ts +63 -0
- package/dist/distribuicao/filesystemGlobal.js +701 -0
- package/dist/distribuicao/index.d.ts +7 -0
- package/dist/distribuicao/index.js +227 -0
- package/dist/distribuicao/launcherGlobal.d.ts +53 -0
- package/dist/distribuicao/launcherGlobal.js +643 -0
- package/dist/distribuicao/launcherWindows.d.ts +28 -0
- package/dist/distribuicao/launcherWindows.js +326 -0
- package/dist/distribuicao/lockContextGlobal.d.ts +10 -0
- package/dist/distribuicao/lockContextGlobal.js +17 -0
- package/dist/distribuicao/lockGlobal.d.ts +6 -0
- package/dist/distribuicao/lockGlobal.js +520 -0
- package/dist/distribuicao/skillGlobal.d.ts +48 -0
- package/dist/distribuicao/skillGlobal.js +652 -0
- package/dist/distribuicao/skillIntentPolicy.d.ts +21 -0
- package/dist/distribuicao/skillIntentPolicy.js +115 -0
- package/dist/distribuicao/tipos.d.ts +50 -0
- package/dist/distribuicao/tipos.js +10 -0
- package/dist/distribuicao/versaoSemantica.d.ts +3 -0
- package/dist/distribuicao/versaoSemantica.js +62 -0
- package/dist/docs.part01.d.ts +4 -1
- package/dist/docs.part01.js +8 -0
- package/dist/docs.part02.js +9 -1
- package/dist/drift.part01.d.ts +33 -25
- package/dist/drift.part01.js +2 -1
- package/dist/drift.part04.d.ts +26 -5
- package/dist/drift.part04.js +123 -19
- package/dist/drift.part05.d.ts +2 -2
- package/dist/drift.part05.js +8 -6
- package/dist/drift.part06.d.ts +2 -2
- package/dist/drift.part06.js +113 -26
- package/dist/drift.part07.d.ts +11 -11
- package/dist/drift.part07.js +261 -265
- package/dist/drift.part08.d.ts +2 -2
- package/dist/drift.part08.js +35 -26
- package/dist/drift.part09.d.ts +2 -2
- package/dist/drift.part09.js +10 -3
- package/dist/drift.part11.js +261 -58
- package/dist/drift.part12.d.ts +1 -1
- package/dist/drift.part12.js +193 -21
- package/dist/drift.part13.d.ts +20 -39
- package/dist/drift.part13.js +601 -647
- package/dist/drift.part14.js +23 -7
- package/dist/driftCacheCas.d.ts +43 -0
- package/dist/driftCacheCas.js +351 -0
- package/dist/driftCacheFilesystem.d.ts +64 -0
- package/dist/driftCacheFilesystem.js +313 -0
- package/dist/driftCacheModes.d.ts +38 -0
- package/dist/driftCacheModes.js +147 -0
- package/dist/driftCacheStore.d.ts +80 -0
- package/dist/driftCacheStore.js +603 -0
- package/dist/driftCatalogo.d.ts +2 -28
- package/dist/driftCatalogo.js +143 -284
- package/dist/driftEscopo.d.ts +1 -3
- package/dist/driftEscopo.js +235 -151
- package/dist/driftEscopoReferencias.d.ts +5 -1
- package/dist/driftEscopoReferencias.js +375 -28
- package/dist/driftOrcamento.d.ts +0 -6
- package/dist/driftOrcamento.js +2 -1
- package/dist/execucoesExternas.js +19 -5
- package/dist/exemplosOficiais.d.ts +2 -1
- package/dist/exemplosOficiais.js +9 -3
- package/dist/geracaoCore.d.ts +1 -0
- package/dist/geracaoCore.js +6 -6
- package/dist/iaPrompts.d.ts +3 -3
- package/dist/iaPrompts.js +312 -313
- package/dist/importador.part01.d.ts +1 -1
- package/dist/importador.part06.d.ts +2 -0
- package/dist/importador.part06.js +87 -1
- package/dist/importador.part09.js +7 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +6 -25
- package/dist/index.part01.d.ts +20 -28
- package/dist/index.part01.js +16 -237
- package/dist/index.part02.js +36 -22
- package/dist/index.part03.d.ts +24 -2
- package/dist/index.part03.js +83 -19
- package/dist/index.part04.d.ts +10 -2
- package/dist/index.part04.js +152 -123
- package/dist/index.part05.js +80 -78
- package/dist/index.part06.js +34 -17
- package/dist/index.part07.d.ts +8 -2
- package/dist/index.part07.js +153 -7
- package/dist/index.part08.d.ts +1 -1
- package/dist/index.part08.js +25 -30
- package/dist/initCommand.d.ts +1 -0
- package/dist/initCommand.js +20 -4
- package/dist/initTemplatesBase.js +6 -4
- package/dist/pipelineConteudo/command.d.ts +1 -0
- package/dist/pipelineConteudo/command.js +9 -2
- package/dist/pipelineConteudo/help.d.ts +2 -0
- package/dist/pipelineConteudo/help.js +33 -0
- package/dist/profileAuthorCommand.js +3 -7
- package/dist/profileCommand.js +3 -7
- package/dist/projetoCarregar.js +35 -17
- package/dist/projetoCatalogo.d.ts +1 -0
- package/dist/projetoCatalogo.js +64 -25
- package/dist/projetoConfig.js +2 -0
- package/dist/projetoLegado.js +18 -0
- package/dist/projetoOrigens.d.ts +2 -0
- package/dist/projetoOrigens.js +65 -9
- package/dist/projetoTipos.d.ts +1 -0
- package/dist/resultadoCli.d.ts +20 -0
- package/dist/resultadoCli.js +57 -0
- package/dist/saidaCli.d.ts +35 -0
- package/dist/saidaCli.js +118 -0
- package/dist/sistemasInterativos/acceptanceEvidence.d.ts +22 -0
- package/dist/sistemasInterativos/acceptanceEvidence.js +345 -0
- package/dist/sistemasInterativos/engineObservation.d.ts +12 -0
- package/dist/sistemasInterativos/engineObservation.js +438 -0
- package/dist/sistemasInterativos/jobOrchestration.d.ts +2 -0
- package/dist/sistemasInterativos/jobOrchestration.js +204 -0
- package/dist/sistemasInterativos/operationPrimitives.d.ts +21 -0
- package/dist/sistemasInterativos/operationPrimitives.js +194 -0
- package/dist/sistemasInterativos/operations.d.ts +4 -39
- package/dist/sistemasInterativos/operations.js +5 -1164
- package/dist/skillCommand.d.ts +5 -0
- package/dist/skillCommand.js +88 -0
- package/dist/tipos.d.ts +1 -1
- package/dist/typescript-http-modelos.d.ts +1 -1
- package/dist/typescript-http-rotas.d.ts +1 -0
- package/dist/typescript-http-rotas.js +93 -0
- package/dist/typescript-http.d.ts +1 -1
- package/dist/typescript-http.js +1 -1
- package/dist/verificacaoCache.d.ts +25 -0
- package/dist/verificacaoCache.js +80 -0
- package/docs/README.md +34 -30
- package/docs/ai-integration.md +25 -12
- package/docs/ai-onboarding.md +37 -18
- package/docs/ai-workflow.md +9 -7
- package/docs/cli.md +125 -7
- package/docs/commands.md +41 -20
- package/docs/deploy.md +21 -8
- package/docs/descoberta-capacidades.md +106 -106
- package/docs/documentation.md +49 -39
- package/docs/drift-cache.md +108 -0
- package/docs/getting-started.md +43 -18
- package/docs/pipeline-conteudo.md +246 -246
- package/docs/profiles.md +54 -54
- package/docs/repositories.md +19 -2
- package/docs/rollback.md +15 -8
- package/docs/security.md +25 -3
- package/docs/sistemas-interativos.md +379 -374
- package/docs/syntax.md +14 -0
- package/docs/testing.md +139 -40
- package/exemplos/express_crud.sema +139 -0
- package/exemplos/fastify_crud.sema +146 -0
- package/exemplos/pipeline-conteudo/README.md +44 -44
- package/exemplos/pipeline-conteudo/alvos.json +23 -23
- package/exemplos/pipeline-conteudo/definicao.json +136 -136
- package/exemplos/profile_simulation.sema +211 -211
- package/exemplos/sistemas-interativos/README.md +100 -100
- package/exemplos/sistemas-interativos/advanced/acceptance-context-evaluate-valid.json +5 -5
- package/exemplos/sistemas-interativos/advanced/acceptance-lock-valid.json +16 -16
- package/exemplos/sistemas-interativos/advanced/asset-provenance-valid.json +32 -32
- package/exemplos/sistemas-interativos/advanced/autonomy-repair-valid.json +93 -93
- package/exemplos/sistemas-interativos/advanced/control-run-definition-valid.json +78 -78
- package/exemplos/sistemas-interativos/advanced/control-run-valid.json +27 -27
- package/exemplos/sistemas-interativos/advanced/distributed-workers-valid.json +79 -79
- package/exemplos/sistemas-interativos/advanced/editor-state-valid.json +42 -42
- package/exemplos/sistemas-interativos/advanced/engine-snapshot-after-valid.json +32 -32
- package/exemplos/sistemas-interativos/advanced/engine-snapshot-before-valid.json +23 -23
- package/exemplos/sistemas-interativos/advanced/job-orchestration-valid.json +39 -39
- package/exemplos/sistemas-interativos/advanced/multimodal-evidence-valid.json +46 -46
- package/exemplos/sistemas-interativos/advanced/multiplayer-authority-valid.json +39 -39
- package/exemplos/sistemas-interativos/advanced/playtest-fuzz-valid.json +37 -37
- package/exemplos/sistemas-interativos/advanced/portability-valid.json +104 -104
- package/exemplos/sistemas-interativos/advanced/temporal-evidence-valid.json +27 -27
- package/exemplos/sistemas-interativos/advanced/temporal-valid.json +118 -118
- package/exemplos/sistemas-interativos/experience-ir-valid.json +459 -459
- package/exemplos/sistemas-interativos/game-2d.json +83 -83
- package/exemplos/sistemas-interativos/game-3d-human.json +81 -81
- package/exemplos/sistemas-interativos/game-pixel-16-bit.json +97 -97
- package/exemplos/sistemas-interativos/game-pixel-8-bit.json +94 -94
- package/exemplos/sistemas-interativos/game-xr-human.json +80 -80
- package/exemplos/sistemas-interativos/hybrid-2-5d.json +108 -108
- package/exemplos/sistemas-interativos/protocol-mutating-rollback-valid.json +75 -75
- package/exemplos/sistemas-interativos/protocol-read-only-valid.json +58 -58
- package/exemplos/sistemas-interativos/simulation-2d-controlled.json +97 -97
- package/exemplos/sistemas-interativos/simulation-3d-calibrated-autonomous.json +141 -141
- package/exemplos/sistemas-interativos/simulation-headless-autonomous-batch.json +112 -112
- package/exemplos/sistemas-interativos/simulation-pixel-16-bit.json +103 -103
- package/exemplos/sistemas-interativos/simulation-text-controlled.json +95 -95
- package/node_modules/@sema/gerador-cpp/package.json +1 -1
- package/node_modules/@sema/gerador-dotnet/package.json +1 -1
- package/node_modules/@sema/gerador-lua/dist/index.js +51 -51
- package/node_modules/@sema/gerador-php/dist/index.js +113 -113
- package/node_modules/@sema/nucleo/dist/ir/conversor.part01.js +37 -38
- package/node_modules/@sema/nucleo/dist/ir/modelos.d.ts +1 -0
- package/node_modules/@sema/nucleo/dist/semantico/analisador.d.ts +1 -0
- package/node_modules/@sema/nucleo/dist/semantico/analisador.js +1 -0
- package/node_modules/@sema/nucleo/dist/semantico/analisador.part01.d.ts +7 -0
- package/node_modules/@sema/nucleo/dist/semantico/analisador.part01.js +33 -10
- package/package.json +9 -4
- package/scripts/postinstall.mjs +148 -0
- package/skills/sema/SKILL.md +199 -0
- package/skills/sema/agents/openai.yaml +4 -0
- package/dist/driftCache.d.ts +0 -49
- package/dist/driftCache.js +0 -311
- package/dist/driftCacheIncremental.d.ts +0 -98
- package/dist/driftCacheIncremental.js +0 -596
- package/dist/driftCatalogoPersistente.d.ts +0 -8
- package/dist/driftCatalogoPersistente.js +0 -77
- package/node_modules/@sema/gerador-cpp/dist/index.js.map +0 -1
- package/node_modules/@sema/gerador-css/dist/index.js.map +0 -1
- package/node_modules/@sema/gerador-css/dist/index.part01.js.map +0 -1
- package/node_modules/@sema/gerador-css/dist/index.part02.js.map +0 -1
- package/node_modules/@sema/gerador-dart/dist/index.js.map +0 -1
- package/node_modules/@sema/gerador-dotnet/dist/index.js.map +0 -1
- package/node_modules/@sema/gerador-html/dist/index.js.map +0 -1
- package/node_modules/@sema/gerador-javascript/dist/index.js.map +0 -1
- package/node_modules/@sema/gerador-lua/dist/index.js.map +0 -1
- package/node_modules/@sema/gerador-php/dist/index.js.map +0 -1
- package/node_modules/@sema/gerador-python/dist/index.js.map +0 -1
- package/node_modules/@sema/gerador-python/dist/index.part01.js.map +0 -1
- package/node_modules/@sema/gerador-python/dist/index.part02.js.map +0 -1
- package/node_modules/@sema/gerador-typescript/dist/index.js.map +0 -1
- package/node_modules/@sema/gerador-typescript/dist/index.part01.js.map +0 -1
- package/node_modules/@sema/gerador-typescript/dist/index.part02.js.map +0 -1
- package/node_modules/@sema/gerador-typescript/dist/index.part03.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/ast/tipos.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/diagnosticos/index.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/diagnosticos/melhorador.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/diagnosticos/snippets.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/formatador/index.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/formatador/index.part01.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/formatador/index.part02.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/index.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/ir/conversor.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/ir/conversor.part01.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/ir/conversor.part02.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/ir/conversor.part03.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/ir/modelos.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/lexer/lexer.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/lexer/tokens.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/parser/parser.declaracoes.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/parser/parser.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/parser/parser.modulo.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/parser/parser.part01.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/parser/parser.part02.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/parser/parser.part03.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/persistencia/contratos.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/semantico/analisador.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/semantico/analisador.part01.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/semantico/analisador.part02.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/semantico/analisador.part03.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/semantico/analisador.part04.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/semantico/analisador.part05.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/semantico/analisador.part06.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/semantico/analisador.part07.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/semantico/analisador.part08.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/semantico/estruturas.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/semantico/estruturas.part01.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/semantico/estruturas.part02.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/semantico/orcamentoSemantico.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/semantico/seguranca.js.map +0 -1
- package/node_modules/@sema/nucleo/dist/util/arquivos.js.map +0 -1
- package/node_modules/@sema/padroes/dist/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,251 +1,299 @@
|
|
|
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
|
-
|
|
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
18
|
```bash
|
|
19
19
|
npm install -g @semacode/cli
|
|
20
|
-
|
|
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
|
|
20
|
+
sema skill status --json
|
|
34
21
|
```
|
|
35
22
|
|
|
23
|
+
The global package installs a stable launcher under `~/.sema/bin` and
|
|
24
|
+
synchronizes the bundled skill to `~/.agents/skills/sema`. If Claude is already
|
|
25
|
+
configured, it also maintains `~/.claude/skills/sema`. Open a new task after an
|
|
26
|
+
install or update because existing tasks do not reload their skill catalog.
|
|
27
|
+
|
|
28
|
+
## First Run
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
sema --version
|
|
32
|
+
sema resumo . --curto --drift none
|
|
33
|
+
```
|
|
34
|
+
|
|
36
35
|
Public Sema is local-only. The CLI runs directly without a Sema login, user
|
|
37
36
|
authorization, product-license check, activation key, token, credits, billing
|
|
38
37
|
service, control panel, or external service credentials. The license governs
|
|
39
38
|
use and redistribution; it is not a runtime activation gate.
|
|
40
39
|
|
|
41
|
-
##
|
|
40
|
+
## Side-Effect-Free Help And JSON Results
|
|
42
41
|
|
|
43
|
-
`
|
|
42
|
+
`--help` and `-h` short-circuit before the operational runtime or handlers are
|
|
43
|
+
imported wherever they appear. Help exits with status `0` without inspecting or mutating the workspace, home,
|
|
44
|
+
user cache, or plugin cache, and without starting subprocesses or network
|
|
45
|
+
calls.
|
|
44
46
|
|
|
45
47
|
```bash
|
|
46
|
-
sema
|
|
48
|
+
sema iniciar --help
|
|
49
|
+
sema dev --help --json
|
|
50
|
+
sema skill sync --help
|
|
47
51
|
```
|
|
48
52
|
|
|
49
|
-
|
|
50
|
-
|
|
53
|
+
When `--json` is present, help and command-control failures emit exactly one
|
|
54
|
+
`sema.cli.control/v1` document on stdout with empty stderr. Its only fields are
|
|
55
|
+
`schemaVersion`, `ok`, `kind`, `code`, `message`, and `exitCode`. Failures are
|
|
56
|
+
redacted and never expose a stack, absolute path, or raw argv.
|
|
57
|
+
|
|
58
|
+
Every syntactically valid command invoked with `--json` in 3.0.0 emits exactly
|
|
59
|
+
one `sema.cli.result/v1` document. Its only fields are `schemaVersion`, `ok`,
|
|
60
|
+
`kind`, `command`, `code`, `message`, `exitCode`, and `payload`. `SUCCESS` uses
|
|
61
|
+
`ok: true`, `CLI_SUCCESS`, `message: null`, and exit code `0`;
|
|
62
|
+
`DOMAIN_ERROR` uses `ok: false`, `CLI_DOMAIN_ERROR`, a safe public message, and
|
|
63
|
+
a positive exit code. `payload` is always present, may contain any JSON value,
|
|
64
|
+
and is the only location for the command-specific result; `data` is not an
|
|
65
|
+
alias.
|
|
66
|
+
|
|
67
|
+
Envelope `ok` classifies the CLI result path and does not replace domain fields
|
|
68
|
+
inside `payload`. Consumers must unwrap the payload before reading values such
|
|
69
|
+
as `sucesso`, `aprovado`, or `bloqueado`. `sema --version` remains plain exact
|
|
70
|
+
SemVer text rather than a JSON envelope.
|
|
71
|
+
|
|
72
|
+
The package separates execution from imports: `bin.sema` points to
|
|
73
|
+
`dist/bin.js`, while `main` and the root export remain `dist/index.js`.
|
|
74
|
+
Unknown commands/subcommands, missing or invalid CLI syntax, and uncaught
|
|
75
|
+
runtime exceptions use the control envelope; structured domain-level failures
|
|
76
|
+
after valid dispatch use `sema.cli.result/v1` with `kind: "DOMAIN_ERROR"`.
|
|
51
77
|
|
|
78
|
+
## Codex Setup
|
|
79
|
+
|
|
80
|
+
`AGENTS.md` is the official Sema entrypoint for Codex:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
sema sync-codex --json
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Codex automatically loads `AGENTS.md` as durable repository guidance. See the
|
|
87
|
+
[Codex `AGENTS.md` documentation](https://learn.chatgpt.com/docs/agent-configuration/agents-md).
|
|
88
|
+
|
|
52
89
|
The CLI is the engine and source of truth; `AGENTS.md` is the automatic
|
|
53
|
-
workspace protocol. The Sema skill
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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:
|
|
90
|
+
workspace protocol. The Sema skill bootstraps a project that does not have Sema
|
|
91
|
+
yet and then delegates to the generated `AGENTS.md`. The npm lifecycle updates
|
|
92
|
+
only Sema-managed launcher and skill roots; it never writes into plugin caches,
|
|
93
|
+
credentials, the workspace, or `CODEX_HOME`.
|
|
103
94
|
|
|
104
|
-
|
|
105
|
-
|
|
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.
|
|
95
|
+
Use `sema skill status --json` for a read-only diagnosis and `sema skill sync
|
|
96
|
+
--json` to repair the launcher and skill after `npm install --ignore-scripts`.
|
|
97
|
+
If a shell still cannot resolve `sema`, invoke the managed launcher directly:
|
|
111
98
|
|
|
112
|
-
|
|
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
|
|
99
|
+
```powershell
|
|
100
|
+
& "$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File "$HOME\.sema\bin\sema-managed.ps1" --version
|
|
120
101
|
```
|
|
121
102
|
|
|
122
|
-
Generated artifacts include `SEMA-GOVERNED` headers and must stay aligned with
|
|
123
|
-
the source contract.
|
|
124
|
-
|
|
125
|
-
## Validation
|
|
126
|
-
|
|
127
103
|
```bash
|
|
128
|
-
sema
|
|
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
|
|
104
|
+
"$HOME/.sema/bin/sema" --version
|
|
134
105
|
```
|
|
135
106
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
##
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
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
|
|
107
|
+
On Windows, PowerShell resolves `sema.ps1` from `PATH`, `cmd.exe` resolves
|
|
108
|
+
`sema.cmd`, and `sema-managed.ps1` is the PATH-independent fallback.
|
|
109
|
+
|
|
110
|
+
## Codex-Native Architecture
|
|
111
|
+
|
|
112
|
+
- `AGENTS.md` is the only official entrypoint. `sync-codex` changes only valid
|
|
113
|
+
Sema-managed blocks and preserves malformed or manual content for review.
|
|
114
|
+
- Agent Context Pack consumers use schema version 7, including the deterministic
|
|
115
|
+
discovery summary and the fields `entrypointCodex`, `codexNativo`, and
|
|
116
|
+
`cliLocalSemAutorizacao`.
|
|
117
|
+
- The bundled Sema skill handles first contact. Its canonical shared copy is
|
|
118
|
+
`~/.agents/skills/sema`; Claude gets a managed mirror only when detected. It
|
|
119
|
+
asks for adoption authorization before implementation and does not duplicate
|
|
120
|
+
governance after handing off to `AGENTS.md`. Installing or updating the
|
|
121
|
+
global CLI authorizes distribution changes only, not workspace adoption.
|
|
122
|
+
|
|
123
|
+
## Local Workflow
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
sema docs-impacto --intencao "describe the change" --arquivo contratos/app.sema --json
|
|
127
|
+
sema inspecionar contratos/app.sema --drift none --json
|
|
128
|
+
sema drift contratos/app.sema --escopo modulo --cache fresh --json
|
|
129
|
+
sema impacto contratos/app.sema --alvo app.modulo --mudanca "describe the change" --json
|
|
130
|
+
sema finalizar-mudanca --intencao "describe the change" --doc-lida README.md --json
|
|
166
131
|
```
|
|
167
132
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
133
|
+
`resumo` and `inspecionar` default to `--drift none`; unobserved score,
|
|
134
|
+
confidence, implementation, and route evidence inside the result `payload`
|
|
135
|
+
stays `null`. Use `--drift cache|fresh` to request analysis. Direct `sema drift`
|
|
136
|
+
accepts `--cache none|cache|fresh` and defaults to `fresh`. Persistent objects are stored in the
|
|
137
|
+
operating system's user-cache directory outside the workspace. They reuse only
|
|
138
|
+
validated extraction data; the final drift decision is always recalculated.
|
|
139
|
+
|
|
140
|
+
If the project has no `.sema` contract, an informational request must remain
|
|
141
|
+
read-only. Before implementing behavior, obtain explicit adoption authorization,
|
|
142
|
+
then inspect the official flow and initialize:
|
|
177
143
|
|
|
178
144
|
```bash
|
|
179
|
-
sema
|
|
180
|
-
sema
|
|
181
|
-
sema
|
|
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";
|
|
145
|
+
sema descobrir explicar flow.project-adoption --json
|
|
146
|
+
sema iniciar --template base
|
|
147
|
+
sema sync-codex --json
|
|
230
148
|
```
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
149
|
+
|
|
150
|
+
Initialization preserves existing files and rejects symlink or junction
|
|
151
|
+
escapes. Use `--force` only when overwriting the template destinations is an
|
|
152
|
+
explicit human decision; the Codex bootstrap skill never adds it.
|
|
153
|
+
|
|
154
|
+
## Code Generation
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
sema compilar contratos/app.sema --alvo typescript --saida .tmp/app-ts --estrutura modulos
|
|
158
|
+
sema compilar contratos/app.sema --alvo python --saida .tmp/app-py --estrutura modulos
|
|
159
|
+
sema compilar contratos/app.sema --alvo php --saida .tmp/app-php --estrutura modulos
|
|
160
|
+
sema compilar contratos/app.sema --alvo dotnet --saida .tmp/app-dotnet --estrutura modulos
|
|
161
|
+
sema compilar contratos/app.sema --alvo cpp --saida .tmp/app-cpp --estrutura modulos
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Generated artifacts include `SEMA-GOVERNED` headers and must stay aligned with
|
|
165
|
+
the source contract.
|
|
166
|
+
|
|
167
|
+
## Validation
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
sema validar contratos/app.sema --json
|
|
171
|
+
sema diagnosticos contratos/app.sema --json
|
|
172
|
+
sema testar contratos/app.sema --alvo typescript --saida .tmp/app-tests
|
|
173
|
+
sema testar contratos/app.sema --alvo dotnet --saida .tmp/app-dotnet-tests
|
|
174
|
+
sema testar contratos/app.sema --alvo cpp --saida .tmp/app-cpp-tests
|
|
175
|
+
sema verificar contratos/app.sema --saida .tmp/app-check --json
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## AI-native Content Pipeline
|
|
179
|
+
|
|
180
|
+
`sema conteudo` validates and plans multi-channel, multi-format content work,
|
|
181
|
+
verifies signed policies and evidence, replays canonical state, and projects
|
|
182
|
+
non-authoritative manifests. Producer agents, specialized AI evaluators,
|
|
183
|
+
creative tools, and delivery adapters run in an external runner; there is no
|
|
184
|
+
native human-review transition.
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
sema conteudo validar exemplos/pipeline-conteudo/definicao.json --json
|
|
188
|
+
sema conteudo planejar exemplos/pipeline-conteudo/definicao.json --alvos-arquivo exemplos/pipeline-conteudo/alvos.json --json
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
See `docs/pipeline-conteudo.md` for the signed trust, quorum, ledger, target,
|
|
192
|
+
adapter, and projection model.
|
|
193
|
+
|
|
194
|
+
## Capability Discovery and Interactive Systems
|
|
195
|
+
|
|
196
|
+
`sema descobrir` exposes one explainable catalog and a deterministic intent
|
|
197
|
+
router. `sema interativo` validates and plans games, simulations, and hybrids
|
|
198
|
+
across independent spatial models, render modes, retro visual profiles, control,
|
|
199
|
+
time, determinism, and fidelity axes without running an engine or silently
|
|
200
|
+
mutating a workspace.
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
sema descobrir catalogo --json
|
|
204
|
+
sema descobrir recomendar --intencao "calibrate a headless autonomous simulation" --json
|
|
205
|
+
sema interativo schema --json
|
|
206
|
+
sema interativo pipelines --json
|
|
207
|
+
sema interativo validar exemplos/sistemas-interativos/simulation-headless-autonomous-batch.json --json
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
The canonical interactive catalog contains 35 unique pipelines and 28 unique
|
|
211
|
+
external adapter descriptors. Its advanced P0/P1/P2 surface covers Experience
|
|
212
|
+
IR, semantic engine snapshots, asset provenance, editor-state descriptions,
|
|
213
|
+
multimodal evidence, resumable jobs, acceptance locks, temporal/shot/physics QA,
|
|
214
|
+
clean-install and hardware constraints, safe autonomous repair, bounded
|
|
215
|
+
playtest/fuzz plans, multiplayer authority, portability with declared losses,
|
|
216
|
+
and distributed worker DAGs.
|
|
217
|
+
|
|
218
|
+
Advanced read-only commands:
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
sema interativo validar-ir <file> --json
|
|
222
|
+
sema interativo indexar-ir <file> --json
|
|
223
|
+
sema interativo consultar-ir <file> --semantic-id <id> --json
|
|
224
|
+
sema interativo chunk-ir <file> --semantic-id <id> [--raso] --json
|
|
225
|
+
sema interativo descrever-ir --json
|
|
226
|
+
|
|
227
|
+
sema interativo validar-engine-snapshot <file> --json
|
|
228
|
+
sema interativo diff-engine-snapshots <before> <after> --json
|
|
229
|
+
sema interativo validar-asset-provenance <file> --json
|
|
230
|
+
sema interativo validar-editor-state <file> --json
|
|
231
|
+
sema interativo planejar-jobs <file> --json
|
|
232
|
+
sema interativo validar-acceptance <file> --json
|
|
233
|
+
sema interativo operar-acceptance <lock> --operation <VALIDATE|EVALUATE|INVALIDATE> --context-file <file> --json
|
|
234
|
+
sema interativo validar-multimodal <file> --json
|
|
235
|
+
|
|
236
|
+
sema interativo validar-temporal <file> --json
|
|
237
|
+
sema interativo validar-evidencia-temporal <contract> --bundle-arquivo <file> --json
|
|
238
|
+
sema interativo validar-autonomia <file> --json
|
|
239
|
+
sema interativo validar-playtest-fuzz <file> --json
|
|
240
|
+
sema interativo validar-multiplayer <file> --json
|
|
241
|
+
sema interativo analisar-portabilidade <file> --json
|
|
242
|
+
sema interativo validar-workers <file> --json
|
|
243
|
+
|
|
244
|
+
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
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
All of these commands are local and read-only. Adapter entries are external
|
|
248
|
+
capability descriptors: the package does not detect, probe, launch, install, or
|
|
249
|
+
control any engine, editor, plug-in, process, verifier, or worker. A
|
|
250
|
+
`STRUCTURALLY_COMPLETE` result is local structural coverage only; it always
|
|
251
|
+
remains `completed: false`, `authoritative: false`, and awaits external
|
|
252
|
+
attestation. The CLI never equates a descriptor, fixture, plan, or supplied JSON
|
|
253
|
+
record with proof that external work occurred.
|
|
254
|
+
|
|
255
|
+
See `docs/descoberta-capacidades.md` and `docs/sistemas-interativos.md` for the
|
|
256
|
+
ranking, adapter protocol, evidence boundary, fidelity, and coverage model.
|
|
257
|
+
|
|
258
|
+
## Programmatic API
|
|
259
|
+
|
|
260
|
+
The package root can be imported without executing the CLI process:
|
|
261
|
+
|
|
262
|
+
```js
|
|
263
|
+
import {
|
|
264
|
+
analisarPlanoPortabilidadeInterativa,
|
|
265
|
+
indexarExperienceIr,
|
|
266
|
+
montarCatalogoCapacidades,
|
|
267
|
+
validarContratoTemporalInterativo,
|
|
268
|
+
validarControlRunInterativo,
|
|
269
|
+
validarDefinicaoSistemaInterativo,
|
|
270
|
+
validarExperienceIr,
|
|
271
|
+
} from "@semacode/cli";
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
Only the package-root exports are public. Internal `dist/*` deep imports remain
|
|
275
|
+
blocked, and importing the package never parses CLI arguments or exits the host
|
|
276
|
+
process. Programmatic validators and planners preserve the same read-only,
|
|
277
|
+
non-authoritative boundary as their CLI equivalents.
|
|
278
|
+
|
|
237
279
|
## Public Boundary
|
|
238
280
|
|
|
239
281
|
The npm package is local-only: its CLI and programmatic API do not depend on a
|
|
240
282
|
hosted Sema service. It must not contain private or sensitive operational
|
|
241
283
|
material.
|
|
242
284
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
##
|
|
250
|
-
|
|
251
|
-
|
|
285
|
+
Contributors must create the tarball through `npm run cli:empacotar-publica`
|
|
286
|
+
from the repository root. Direct `npm pack` in this source package is blocked:
|
|
287
|
+
the official factory uses an isolated per-run stage and is the only supported
|
|
288
|
+
path that bundles runtime packages, examples, documentation, the launcher, and
|
|
289
|
+
the Sema skill.
|
|
290
|
+
|
|
291
|
+
## Commercial Use
|
|
292
|
+
|
|
293
|
+
Sema is public source for local semantic governance, but commercial resale,
|
|
294
|
+
white-label redistribution, or commercial replicas require written permission
|
|
295
|
+
from OtimiTare.
|
|
296
|
+
|
|
297
|
+
## Support
|
|
298
|
+
|
|
299
|
+
Use [suporte@otimitare.online](mailto:suporte@otimitare.online) for support.
|
package/dist/agentContextPack.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// SEMA-GOVERNED: sema.produto.governanca_ia.contexto.agent_pack
|
|
1
|
+
// SEMA-GOVERNED: sema.produto.governanca_ia.contexto.agent_pack, sema.produto.governanca_ia.drift.cache.modos
|
|
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';
|
|
@@ -167,7 +167,7 @@ function criarFailClosedAgentContext() {
|
|
|
167
167
|
return [
|
|
168
168
|
"Se não conseguir chamar Sema, pare e declare bloqueio em vez de editar código ou contrato.",
|
|
169
169
|
"Se não houver contrato aplicável ou vínculo semântico do arquivo, inspecione o arquivo, descubra ou crie o .sema aplicável e vincule antes do código.",
|
|
170
|
-
"Em workspace local, rode sema --version; se
|
|
170
|
+
"Em workspace local, rode sema --version; se o shell não localizar o comando, use $HOME/.sema/bin/sema no macOS/Linux. No Windows, PowerShell usa sema.ps1 no PATH e cmd.exe usa sema.cmd; use & \"$env:SystemRoot\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File \"$HOME\\.sema\\bin\\sema-managed.ps1\" --version como fallback. Só então declare a CLI indisponível.",
|
|
171
171
|
"Se não houver workspace local em disco, pare bloqueado e peça o fluxo apropriado; não invente caminho nem substitua a CLI local por ferramenta paralela.",
|
|
172
172
|
`Se arquivos_codigo.conteudo ou conteudo inline passar de ${LIMITE_CARACTERES_PAYLOAD_INLINE} caracteres, não aumente timeout para forçar: divida por responsabilidade ou use anexo/caminho de servidor autorizado.`,
|
|
173
173
|
"Se for criar ou corrigir .sema, leia `exemplos/`; se a pasta estiver ausente, rode `sema instalar-exemplos --json` antes de escrever sintaxe.",
|
|
@@ -178,7 +178,7 @@ function criarFailClosedAgentContext() {
|
|
|
178
178
|
"Um mesmo arquivo de codigo pode ser governado por varios contratos .sema via vinculos; Sema Codigo deve preservar essa rastreabilidade.",
|
|
179
179
|
"Se score, achados ou decisaoAgente parecerem bons, trate como sinal de triagem e confira evidência concreta no contrato e no código.",
|
|
180
180
|
"Se validar artefato inline com 100/100, ainda preserve cabeçalho SEMA-GOVERNED no arquivo físico sincronizado.",
|
|
181
|
-
"Se `sema drift` retornar sucesso:false, `vinculos_quebrados`, `rotas_divergentes` ou
|
|
181
|
+
"Se o `payload` de `sema drift --cache fresh --json` retornar sucesso:false, `vinculos_quebrados`, `rotas_divergentes` ou `impls_quebrados`, a mudança não pode ser declarada concluída; corrija contrato/código e rode drift fresh de novo.",
|
|
182
182
|
"Se a tarefa tiver site, sistema, app, UI, painel, jogo, CLI/TUI ou terminal, nao conclua sem acabamento moderno, contextual e evidenciado; em UI mobile estreita (ex. 390px), `document.documentElement.scrollWidth <= document.documentElement.clientWidth` precisa ser verdadeiro.",
|
|
183
183
|
"Se texto visivel PT-BR perder acento ou cedilha em termos como descricao, lancamentos, saude ou alimentacao, trate como defeito bloqueante quando houver i18n/idioma declarado.",
|
|
184
184
|
"Se aparecer caminho que não pertence ao workspace local aberto pelo usuário, pare e confirme a fonte antes de agir.",
|
|
@@ -306,12 +306,15 @@ export function criarAgentContextPack(guiaPorCapacidade) {
|
|
|
306
306
|
"Leia AGENTS.md antes de editar código, contrato, docs operacionais, release ou deploy.",
|
|
307
307
|
"Leia docs/commands.md antes de escolher comando Sema, interpretar um gate ou usar --saida de sema compilar.",
|
|
308
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.",
|
|
309
|
-
"Em workspace local, rode sema --version; se falhar,
|
|
310
|
-
"
|
|
309
|
+
"Em workspace local, rode sema --version; se o shell falhar, use $HOME/.sema/bin/sema no macOS/Linux. No Windows, PowerShell usa sema.ps1 no PATH e cmd.exe usa sema.cmd; use & \"$env:SystemRoot\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File \"$HOME\\.sema\\bin\\sema-managed.ps1\" --version como fallback. Só depois peça instalação ou reparo.",
|
|
310
|
+
"`sema resumo` e `sema inspecionar` usam análise `none` por padrão: não executam drift e mantêm score, confiança, implementação e superfícies derivadas como nulos/não avaliados; use `--drift cache|fresh` somente quando precisar dessa evidência.",
|
|
311
|
+
"Quando `resumo` ou `inspecionar` executa drift explicitamente, `payload.analiseDrift.sucesso` deve ser verdadeiro ou falso e uma falha solicitada mantém exit code diferente de zero.",
|
|
312
|
+
"Na CLI 3.0.0, `sema --version` continua texto SemVer exato; com `--json`, help e falhas de controle usam o envelope exato `sema.cli.control/v1`, enquanto todo comando sintaticamente válido usa o envelope exato de oito campos `sema.cli.result/v1`, mantém o resultado do comando em `payload` e não confunde `ok` de transporte com o veredito de domínio dentro desse payload.",
|
|
313
|
+
"Antes de editar, rode `sema inspecionar <contrato.sema> --drift none --json`, `sema drift <contrato.sema> --escopo modulo --cache fresh --json` e `sema impacto <contrato.sema> --alvo <token> --mudanca \"<descricao>\" --json`.",
|
|
311
314
|
"Use exemplos oficiais antes de criar ou corrigir sintaxe .sema.",
|
|
312
315
|
"Use SEMA_INDEX.json para escolher contrato, módulo e arquivos prováveis antes de abrir código cru.",
|
|
313
316
|
"Valide .sema alterado e rode drift antes de concluir.",
|
|
314
|
-
"
|
|
317
|
+
"Conclusão só é válida se o `payload` de `sema drift --cache fresh --json` retornar sucesso:true, sem `vinculos_quebrados`, sem `rotas_divergentes` e sem `impls_quebrados`; hit de cache orienta trabalho, mas não substitui evidência fresh de fechamento.",
|
|
315
318
|
"Quando faltar contrato aplicável ou vínculo semântico do arquivo, inspecione o arquivo, crie/edite o contrato aplicável e vincule antes do código.",
|
|
316
319
|
"Sema não contorna políticas da plataforma; ele governa contrato, escopo, drift, evidência e qualidade.",
|
|
317
320
|
"Responda no idioma do usuário; em PT-BR, use vocabulário Sema canônico e preserve acentos, cedilha, pontuação e símbolos humanos.",
|
|
@@ -334,14 +337,15 @@ export function criarAgentContextPack(guiaPorCapacidade) {
|
|
|
334
337
|
"Não tratar a pasta --saida de sema compilar como entrega final; entrega são os arquivos alvo/vínculos do contrato.",
|
|
335
338
|
"Não sincronizar segredos, .env, node_modules, builds, caches, uploads ou artefatos privados fora do escopo.",
|
|
336
339
|
"Não publicar, deployar ou remover capacidade sem contrato, drift e verificação.",
|
|
337
|
-
"Não assumir repositório público, GitHub Release pública ou fonte externa de workspace; em ambiente local, prove a CLI com sema --version.",
|
|
340
|
+
"Não assumir repositório público, GitHub Release pública ou fonte externa de workspace; em ambiente local, prove a CLI com sema --version ou com o launcher gerenciado absoluto.",
|
|
338
341
|
"Não usar a estética ASCII da DSL nem inglês de produto como desculpa para fugir do vocabulário Sema em PT-BR.",
|
|
339
342
|
"Não remover SEMA-GOVERNED nem substituir drift por comentário dentro do código.",
|
|
340
343
|
"Não copiar o contrato inteiro para comentário de código; mantenha descrição humana curta.",
|
|
341
344
|
"Nao tratar orcamento semantico como sugestao; codigo governado ou contrato .sema grande deve ser dividido antes de concluir.",
|
|
342
345
|
"Nao fatiar codigo ou contrato grande em partes sem responsabilidade real para passar no limite.",
|
|
343
346
|
"Não tratar score 100, regex ou presença de palavra-chave como prova suficiente de governança; pontuação abaixo do piso ou do alvo evolutivo bloqueia conclusão.",
|
|
344
|
-
"Nao dizer que drift passou limpo quando o JSON trouxe sucesso:false, vinculos_quebrados, rotas_divergentes ou
|
|
347
|
+
"Nao dizer que drift passou limpo quando o `payload` do JSON trouxe sucesso:false, vinculos_quebrados, rotas_divergentes ou impls_quebrados.",
|
|
348
|
+
"Não ler campos específicos do comando no topo de `sema.cli.result/v1`, não usar `data` como alias de `payload` e não tratar `ok` como substituto de `payload.sucesso` ou outro veredito de domínio.",
|
|
345
349
|
"Não tratar validação inline como dispensa de cabeçalho SEMA-GOVERNED no arquivo físico.",
|
|
346
350
|
`Não tentar resolver payload inline acima de ${LIMITE_CARACTERES_PAYLOAD_INLINE} caracteres aumentando timeout.`,
|
|
347
351
|
`Nao culpar o limite de ${LIMITE_BLOQUEIO_LINHAS_CODIGO_GOVERNADO} linhas para codigo ou ${LIMITE_BLOQUEIO_LINHAS_CONTRATO_SEMA} linhas para .sema por arquitetura monolitica escolhida pela IA.`,
|
|
@@ -353,14 +357,14 @@ export function criarAgentContextPack(guiaPorCapacidade) {
|
|
|
353
357
|
prioridades: [
|
|
354
358
|
"Menor artefato suficiente primeiro.",
|
|
355
359
|
"Catálogo de discovery antes de escolher por chute entre profile, workflow, pipeline, gerador ou adapter.",
|
|
356
|
-
"Workspace local: sema --version, resumo, docs-impacto, inspecionar, drift e impacto pela CLI;
|
|
360
|
+
"Workspace local: sema --version, resumo, docs-impacto, inspecionar, drift e impacto pela CLI; sem shim, use $HOME/.sema/bin/sema ou, no Windows, sema.ps1 pelo PATH / sema.cmd no cmd.exe / & \"$env:SystemRoot\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File \"$HOME\\.sema\\bin\\sema-managed.ps1\" --version, e só depois peça reparo.",
|
|
357
361
|
"Contrato, índice e AGENTS complementam o contexto Sema; não substituem chamada Sema.",
|
|
358
362
|
"Exemplos oficiais antes de nova sintaxe.",
|
|
359
363
|
"Diagnóstico estruturado antes de opinião livre.",
|
|
360
364
|
"Compatibilidade com políticas da plataforma antes de reformular ou continuar após alerta externo.",
|
|
361
365
|
"Sinal sem evidência vira ritual; evidência concreta antes de concluir aderência.",
|
|
362
366
|
"Retry progressivo em timeout antes de declarar bloqueio.",
|
|
363
|
-
"Fechamento honesto: drift JSON verde antes de dizer concluido; sucesso:false, vinculo quebrado ou rota divergente ainda e bloqueio.",
|
|
367
|
+
"Fechamento honesto: `payload` do drift JSON verde antes de dizer concluido; sucesso:false, vinculo quebrado ou rota divergente ainda e bloqueio.",
|
|
364
368
|
"Separar limite de transporte inline de lentidão real: payload grande demais exige split/transporte correto, não retry infinito.",
|
|
365
369
|
"Orçamento semântico, divisão por responsabilidade e cabeçalho governado antes de gravar ou finalizar código.",
|
|
366
370
|
"Acabamento visual/terminal por capacidade quando houver experiência de uso, com prova de viewport mobile sem overflow horizontal ou smoke check de comando.",
|
|
@@ -16,10 +16,15 @@ export declare function sincronizarEntrypointCodex(baseProjeto: string, agentCon
|
|
|
16
16
|
codexNativo: true;
|
|
17
17
|
cliLocalSemAutorizacao: true;
|
|
18
18
|
skillBootstrapCodexDocumentada: true;
|
|
19
|
+
launcherGlobalFallbackDocumentado: true;
|
|
20
|
+
cliIndisponivelSomenteAposFallback: true;
|
|
21
|
+
skillGlobalDelegaAgentsMd: true;
|
|
19
22
|
idiomaHumanoPreservado: true;
|
|
20
23
|
retryTimeoutProgressivo: true;
|
|
21
24
|
politicaPlataformaExplicita: true;
|
|
22
25
|
politicaSinalVsRitualExplicita: true;
|
|
26
|
+
politicaModosDriftExplicita: true;
|
|
27
|
+
docsComandos: true;
|
|
23
28
|
divisaoPorResponsabilidadeExplicita: true;
|
|
24
29
|
contextoLocalSemEspelho: true;
|
|
25
30
|
destinosEntrypointPrevalidados: true;
|