@semacode/cli 1.5.55 → 2.0.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 +50 -7
- package/dist/agentContext.d.ts +1 -1
- package/dist/agentContext.js +3 -3
- package/dist/agentContextPack.js +33 -92
- package/dist/agentContextTipos.d.ts +6 -9
- package/dist/agentContextTipos.js +5 -4
- package/dist/agentEntryPoints.d.ts +22 -2
- package/dist/agentEntryPoints.js +229 -126
- package/dist/docs.part01.js +1 -1
- package/dist/docs.part02.js +21 -10
- package/dist/doctorCommand.d.ts +4 -4
- package/dist/doctorCommand.js +21 -10
- package/dist/exemplosOficiais.d.ts +10 -0
- package/dist/exemplosOficiais.js +32 -22
- package/dist/fsGovernado.js +8 -6
- package/dist/iaPrompts.d.ts +2 -2
- package/dist/iaPrompts.js +3 -3
- package/dist/index.part01.d.ts +1 -1
- package/dist/index.part01.js +6 -6
- package/dist/index.part02.js +1 -1
- package/dist/index.part03.d.ts +1 -0
- package/dist/index.part03.js +26 -12
- package/dist/index.part04.d.ts +1 -0
- package/dist/index.part04.js +49 -21
- package/dist/index.part05.js +1 -1
- package/dist/index.part06.d.ts +1 -1
- package/dist/index.part06.js +27 -18
- package/dist/index.part07.js +20 -20
- package/dist/index.part08.js +4 -8
- package/dist/initCommand.d.ts +3 -1
- package/dist/initCommand.js +41 -12
- package/dist/initTemplatesBase.js +8 -10
- package/dist/workspaceWrite.d.ts +22 -0
- package/dist/workspaceWrite.js +332 -0
- package/docs/README.md +10 -4
- package/docs/ai-integration.md +31 -12
- package/docs/ai-onboarding.md +43 -14
- package/docs/ai-workflow.md +22 -39
- package/docs/auth.md +13 -3
- package/docs/cli.md +21 -8
- package/docs/commands.md +9 -10
- package/docs/deploy.md +27 -4
- package/docs/documentation.md +2 -2
- package/docs/env.md +3 -1
- package/docs/getting-started.md +27 -3
- package/docs/repositories.md +18 -2
- package/docs/rollback.md +23 -5
- package/docs/security.md +8 -0
- package/docs/syntax.md +8 -9
- package/docs/testing.md +15 -4
- package/docs/vocabulary.md +2 -1
- package/package.json +20 -12
- package/dist/billing/index.d.ts +0 -17
- package/dist/billing/index.js +0 -74
package/docs/cli.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# Sema CLI
|
|
2
2
|
|
|
3
|
-
Sema is
|
|
4
|
-
the user's machine, validates `.sema` contracts, checks drift,
|
|
5
|
-
generates code without
|
|
3
|
+
Sema is a Codex-native local CLI distribution. The public package reads the
|
|
4
|
+
workspace on the user's machine, validates `.sema` contracts, checks drift,
|
|
5
|
+
maps impact, and generates code without login, user authorization, license
|
|
6
|
+
activation, tokens, credits, billing services, a control panel, or external
|
|
7
|
+
service credentials.
|
|
6
8
|
|
|
7
9
|
Support: suporte@otimitare.online
|
|
8
10
|
|
|
@@ -21,14 +23,25 @@ npm run build
|
|
|
21
23
|
node pacotes/cli/dist/index.js --help
|
|
22
24
|
```
|
|
23
25
|
|
|
26
|
+
## Codex Setup
|
|
27
|
+
|
|
28
|
+
`AGENTS.md` is the official Sema entrypoint for Codex. Create or refresh it from
|
|
29
|
+
the local CLI:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
sema sync-codex --json
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Codex automatically loads `AGENTS.md` as repository guidance. Sema is an
|
|
36
|
+
independent product and is not affiliated with or endorsed by OpenAI.
|
|
37
|
+
|
|
24
38
|
## Required Local Flow
|
|
25
39
|
|
|
26
|
-
|
|
40
|
+
Codex and humans should use the same local sequence before changing governed
|
|
27
41
|
code, contracts, workflows, release scripts, or operational docs:
|
|
28
42
|
|
|
29
43
|
```bash
|
|
30
44
|
sema --version
|
|
31
|
-
sema preflight resumo --json
|
|
32
45
|
sema resumo
|
|
33
46
|
sema docs-impacto --intencao "describe the change" --json
|
|
34
47
|
sema inspecionar contratos/example.sema --json
|
|
@@ -36,9 +49,8 @@ sema drift contratos/example.sema --escopo modulo --json
|
|
|
36
49
|
sema impacto contratos/example.sema --alvo sema.example.target --mudanca "describe the change" --json
|
|
37
50
|
```
|
|
38
51
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
keys, or call an external control surface.
|
|
52
|
+
Commands run directly against the local workspace. If `sema --version` fails,
|
|
53
|
+
install or repair the npm package; there is no separate authorization gate.
|
|
42
54
|
|
|
43
55
|
## Core Commands
|
|
44
56
|
|
|
@@ -52,6 +64,7 @@ keys, or call an external control surface.
|
|
|
52
64
|
- `sema compilar`: generate code from contracts.
|
|
53
65
|
- `sema verificar`: run the final local verification bundle.
|
|
54
66
|
- `sema contexto-ia`: build local AI context from a contract.
|
|
67
|
+
- `sema sync-codex`: create or refresh the official `AGENTS.md` entrypoint.
|
|
55
68
|
|
|
56
69
|
## Public Boundary
|
|
57
70
|
|
package/docs/commands.md
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<!-- sema:agent-entrypoint:start -->
|
|
2
2
|
# Sema Command Catalog
|
|
3
3
|
|
|
4
|
-
Use this file when
|
|
4
|
+
Use this file when Codex does not know which command to run. A Sema command is an operational gate; do not replace it with a Markdown report.
|
|
5
5
|
|
|
6
6
|
## Minimum Local Flow
|
|
7
7
|
|
|
8
8
|
```bash
|
|
9
9
|
sema --version
|
|
10
|
-
sema preflight resumo --json
|
|
11
10
|
sema resumo
|
|
12
11
|
sema docs-impacto --intencao "<acao>" --json
|
|
13
12
|
```
|
|
@@ -16,7 +15,7 @@ Then read every required doc returned by `docs-impacto`.
|
|
|
16
15
|
|
|
17
16
|
## Contract and Discovery
|
|
18
17
|
|
|
19
|
-
- `sema iniciar --template <template
|
|
18
|
+
- `sema iniciar --template <template> [--force]`: creates a new Sema project and preserves existing files by default; `--force` is the only explicit overwrite path.
|
|
20
19
|
- `sema validar <arquivo-ou-pasta> --json`: validates `.sema` contracts.
|
|
21
20
|
- `sema diagnosticos <arquivo.sema> --json`: details errors and warnings.
|
|
22
21
|
- `sema formatar <arquivo-ou-pasta>`: formats contracts.
|
|
@@ -49,23 +48,23 @@ Ready UI rule: if the task generates an app, site, dashboard, form, or static HT
|
|
|
49
48
|
|
|
50
49
|
## Canonical Syntax Lists
|
|
51
50
|
|
|
52
|
-
- Origins for `use` and `impl`: `ts/typescript`, `js/javascript`, `py/python`, `dart`, `lua`, `cs/dotnet`, `java`, `go`, `rust`, `cpp
|
|
51
|
+
- Origins for `use` and `impl`: `ts/typescript`, `js/javascript`, `py/python`, `dart`, `lua`, `cs/dotnet`, `java`, `go`, `rust`, `cpp`.
|
|
53
52
|
- Frequent `effects` categories: `persistencia`, `consulta`, `evento`, `auditoria`, `db.write`, `queue.publish`, `fs.write`, `network.egress`, `secret.read`, `shell.exec`.
|
|
54
53
|
- Accepted `audit.motivo` values: `obrigatorio`, `opcional`, `dispensado`.
|
|
55
54
|
|
|
56
55
|
`sema compilar --alvo javascript` is a generation target. `impl { js: ... }` is the live-code origin. Do not swap one for the other.
|
|
57
56
|
|
|
58
|
-
##
|
|
57
|
+
## Codex and Context
|
|
59
58
|
|
|
60
|
-
- `sema ajuda-ia`: short guidance for
|
|
59
|
+
- `sema ajuda-ia`: short guidance for Codex.
|
|
61
60
|
- `sema starter-ia`: operational starter.
|
|
62
61
|
- `sema contexto-ia <arquivo.sema> --saida <dir> --json`: AI context package.
|
|
63
62
|
- `sema prompt-curto <arquivo-ou-pasta> --json`: compact prompt.
|
|
64
|
-
- `sema sync-
|
|
63
|
+
- `sema sync-codex --json`: synchronizes the official Codex entrypoint and local support docs.
|
|
65
64
|
- `sema instalar-exemplos --json`: installs official examples in the workspace.
|
|
66
65
|
- `sema exemplos-prompt-ia`: shows prompt examples, not `.sema` examples.
|
|
67
66
|
|
|
68
|
-
## Profiles
|
|
67
|
+
## Profiles and Author
|
|
69
68
|
|
|
70
69
|
- `sema author iniciar|validar|briefing|revisar-cliches|validar-narrativa|validar-proibicoes`: governs authorial writing.
|
|
71
70
|
- `sema profile validar <software|workflow|ops|game|legal|research|redacao|propostas|conversas> <arquivo> --json`: validates an artifact by profile.
|
|
@@ -81,10 +80,10 @@ Ready UI rule: if the task generates an app, site, dashboard, form, or static HT
|
|
|
81
80
|
- Do not use an external workspace source to inspect a local workspace when `sema --version` works.
|
|
82
81
|
- Do not search the entire disk for `.sema` syntax; use `exemplos/`, `docs/syntax.md`, and this catalog.
|
|
83
82
|
- Do not stop after `sema compilar` if the contract target files still do not exist.
|
|
84
|
-
- Do not replace `sema compilar` with `sema testar` when
|
|
83
|
+
- Do not replace `sema compilar` with `sema testar` when the contract requires generated code.
|
|
85
84
|
- Do not create a Markdown report to pretend a gate ran.
|
|
86
85
|
- Do not say drift passed when `sema drift --json` returned `sucesso:false`, broken link, divergent route, or broken impl.
|
|
87
86
|
- Do not declare a UI responsive without mobile/desktop proof; horizontal scroll at 390px blocks closure.
|
|
88
87
|
|
|
89
|
-
Governed code policy:
|
|
88
|
+
Governed code policy: keep the `SEMA-GOVERNED` marker, split large code by real responsibility, preserve contract links, and never treat a generated output directory as the final delivery.
|
|
90
89
|
<!-- sema:agent-entrypoint:end -->
|
package/docs/deploy.md
CHANGED
|
@@ -1,13 +1,36 @@
|
|
|
1
1
|
# Deployment Boundary
|
|
2
2
|
|
|
3
|
-
The public Sema repository
|
|
3
|
+
The public Sema repository documents two coordinated release surfaces: the
|
|
4
|
+
local npm CLI and the Codex bootstrap skill. The skill remains a separate,
|
|
5
|
+
explicit Codex installation and is never injected by npm lifecycle scripts.
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
Run the complete public gate:
|
|
6
8
|
|
|
7
9
|
```bash
|
|
8
10
|
npm run build
|
|
9
|
-
npm run
|
|
10
|
-
|
|
11
|
+
npm run status:check
|
|
12
|
+
npm run repo:verificar-publico
|
|
13
|
+
npm run plugin:testar-codex
|
|
14
|
+
npm test
|
|
15
|
+
npm run release:verificar-drift
|
|
16
|
+
npm run release:preparar-publica
|
|
17
|
+
npm run release:publicar-npm-dry-run
|
|
11
18
|
```
|
|
12
19
|
|
|
20
|
+
The plugin smoke installs the repo marketplace into an isolated `CODEX_HOME`,
|
|
21
|
+
installs `sema@sema`, compares the cached skill with the versioned source, and
|
|
22
|
+
proves no Sema MCP server was registered. Plugin and CLI versions must match
|
|
23
|
+
before the commit is pushed. The release command itself runs the full test suite
|
|
24
|
+
and project-wide Sema drift gate; these are not optional manual preliminaries.
|
|
25
|
+
|
|
26
|
+
Push the commit containing `.agents/plugins/marketplace.json` and
|
|
27
|
+
`plugins/sema/` before telling users to install from `gerlanss/Sema`. Publish
|
|
28
|
+
the npm package only after the tarball smoke passes. After npm publication, run
|
|
29
|
+
`npm run release:verificar-distribuicao` to verify the registry and live GitHub
|
|
30
|
+
state. That final verifier also requires the remote GitHub HEAD to match the
|
|
31
|
+
local commit, installs `sema@sema` from `gerlanss/Sema` in an isolated
|
|
32
|
+
`CODEX_HOME`, compares the remote skill with the versioned source, and proves
|
|
33
|
+
that the remote plugin registers no Sema MCP. The current contract does not
|
|
34
|
+
permit creating a GitHub Release or release asset.
|
|
35
|
+
|
|
13
36
|
Do not publish private or sensitive operational material in this repository.
|
package/docs/documentation.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Documentation Governance
|
|
2
2
|
|
|
3
|
-
Documentation is part of every governed change.
|
|
3
|
+
Documentation is part of every governed change. Codex must use
|
|
4
4
|
`sema docs-impacto` before editing contracts, code, operational docs, workflows,
|
|
5
5
|
profiles, generated artifacts, or release material.
|
|
6
6
|
|
|
@@ -16,7 +16,7 @@ The result lists:
|
|
|
16
16
|
|
|
17
17
|
- `leituraObrigatoria`: files that must be read before the change;
|
|
18
18
|
- `docsAusentes`: missing docs that block the change;
|
|
19
|
-
- `docsCriadas`: generated draft docs that must be completed by
|
|
19
|
+
- `docsCriadas`: generated draft docs that must be completed by Codex;
|
|
20
20
|
- `bloqueios`: blocking diagnostics.
|
|
21
21
|
|
|
22
22
|
Before closing the change, prove the required docs were read:
|
package/docs/env.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Environment
|
|
2
2
|
|
|
3
|
-
The public Sema CLI
|
|
3
|
+
The public Sema CLI works without private service credentials. No environment
|
|
4
|
+
variable unlocks local execution: there is no login, activation, product
|
|
5
|
+
authorization, license-key, billing, credit, token, or panel gate.
|
|
4
6
|
|
|
5
7
|
Allowed public examples may use placeholders:
|
|
6
8
|
|
package/docs/getting-started.md
CHANGED
|
@@ -4,11 +4,30 @@ Sema is installed and used as a local CLI.
|
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
npm install -g @semacode/cli
|
|
7
|
+
codex plugin marketplace add gerlanss/Sema
|
|
8
|
+
codex plugin add sema@sema
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Open a new Codex task in the target repository so the newly installed `$sema`
|
|
12
|
+
skill is loaded, then ask it to initialize Sema. Existing tasks do not refresh
|
|
13
|
+
their skill catalog. After bootstrap, `AGENTS.md` becomes the automatic protocol
|
|
14
|
+
for subsequent tasks.
|
|
15
|
+
|
|
16
|
+
Then verify the local engine:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
7
19
|
sema --version
|
|
8
|
-
sema
|
|
20
|
+
sema resumo
|
|
9
21
|
```
|
|
10
22
|
|
|
11
|
-
|
|
23
|
+
The CLI is ready when `sema --version` succeeds. No Sema login, user
|
|
24
|
+
authorization, activation key, product-license check, token, credits, billing
|
|
25
|
+
service, or control panel is involved.
|
|
26
|
+
|
|
27
|
+
The Codex skill is required for first contact with a project that does not yet
|
|
28
|
+
have Sema. It only bootstraps the local CLI and generates the repository's
|
|
29
|
+
`AGENTS.md`; that file becomes the automatic workspace protocol afterward.
|
|
30
|
+
Plugin installation is explicit and does not happen from npm lifecycle scripts.
|
|
12
31
|
|
|
13
32
|
## First Project
|
|
14
33
|
|
|
@@ -18,6 +37,10 @@ sema validar contratos/*.sema --json
|
|
|
18
37
|
sema resumo
|
|
19
38
|
```
|
|
20
39
|
|
|
40
|
+
`sema iniciar` preserves existing project files and refuses symlink or junction
|
|
41
|
+
escapes. The bootstrap skill never uses `--force`; explicit overwrite remains a
|
|
42
|
+
human decision.
|
|
43
|
+
|
|
21
44
|
## Existing Project
|
|
22
45
|
|
|
23
46
|
```bash
|
|
@@ -28,6 +51,7 @@ sema drift contratos/example.sema --escopo modulo --json
|
|
|
28
51
|
sema impacto contratos/example.sema --alvo sema.example.target --mudanca "describe the change" --json
|
|
29
52
|
```
|
|
30
53
|
|
|
31
|
-
The public CLI does not require private service credentials
|
|
54
|
+
The public CLI does not require private service credentials or an external
|
|
55
|
+
request before local commands run.
|
|
32
56
|
|
|
33
57
|
Support: suporte@otimitare.online
|
package/docs/repositories.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# Repository Boundary
|
|
2
2
|
|
|
3
|
-
The public Sema repository should contain only the local CLI,
|
|
4
|
-
examples, tests that run locally,
|
|
3
|
+
The public Sema repository should contain only the Codex-native local CLI, the
|
|
4
|
+
first-contact Codex skill, runtime packages, examples, tests that run locally,
|
|
5
|
+
and English documentation.
|
|
5
6
|
|
|
6
7
|
## Public
|
|
7
8
|
|
|
@@ -12,12 +13,27 @@ examples, tests that run locally, and English documentation.
|
|
|
12
13
|
- examples
|
|
13
14
|
- English docs
|
|
14
15
|
- local package scripts
|
|
16
|
+
- `AGENTS.md` as the official Codex entrypoint
|
|
17
|
+
- the official Sema skill as a thin bootstrap before `AGENTS.md` exists
|
|
18
|
+
- the repo marketplace that installs that skill explicitly
|
|
15
19
|
|
|
16
20
|
## Not Public
|
|
17
21
|
|
|
18
22
|
- private or sensitive operational material
|
|
19
23
|
- real credentials, environment files, or secret inventories
|
|
20
24
|
- private project data or generated private artifacts
|
|
25
|
+
- runtime authorization, activation, billing, credit, token, or panel gates
|
|
26
|
+
- product-specific entrypoint files for AI clients other than Codex
|
|
27
|
+
- MCP servers, remote workspace bridges, or duplicated governance inside the
|
|
28
|
+
bootstrap skill
|
|
29
|
+
|
|
30
|
+
The CLI must run directly against the local workspace without login, user
|
|
31
|
+
authorization, a product-license check, activation key, credits, token, billing
|
|
32
|
+
service, or control panel.
|
|
33
|
+
|
|
34
|
+
Sema is an independent product and is not affiliated with or endorsed by
|
|
35
|
+
OpenAI. Codex-native is Sema's official product direction, not an official
|
|
36
|
+
OpenAI program or submission.
|
|
21
37
|
|
|
22
38
|
## Commercial Use
|
|
23
39
|
|
package/docs/rollback.md
CHANGED
|
@@ -1,13 +1,31 @@
|
|
|
1
1
|
# Rollback Boundary
|
|
2
2
|
|
|
3
|
-
Public
|
|
4
|
-
|
|
3
|
+
Public rollback covers both the npm CLI and the separately installed Codex
|
|
4
|
+
bootstrap skill.
|
|
5
5
|
|
|
6
|
-
For
|
|
6
|
+
For a failed pre-publication candidate:
|
|
7
7
|
|
|
8
8
|
1. Keep the previous tarball until the new one passes smoke tests.
|
|
9
|
-
2.
|
|
10
|
-
|
|
9
|
+
2. Revert the plugin source, marketplace manifest, CLI source, and versions to
|
|
10
|
+
the last known-good commit.
|
|
11
|
+
3. Re-run `npm run release:preparar-publica`.
|
|
12
|
+
|
|
13
|
+
If a bad commit was already pushed, revert it with a normal Git revert and push
|
|
14
|
+
the corrective commit. Refresh the marketplace and reinstall the skill:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
codex plugin marketplace upgrade sema
|
|
18
|
+
codex plugin remove sema@sema
|
|
19
|
+
codex plugin add sema@sema
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Open a new Codex task before validating the reinstalled skill. Already-open
|
|
23
|
+
tasks keep the plugin/skill catalog they started with.
|
|
24
|
+
|
|
25
|
+
If a bad npm version was published, do not overwrite it. Publish a corrected
|
|
26
|
+
version and direct users to that version. Verify the final registry/GitHub state
|
|
27
|
+
with `npm run release:verificar-distribuicao`. Do not create a GitHub Release or
|
|
28
|
+
asset as a rollback shortcut while the release contract blocks that surface.
|
|
11
29
|
|
|
12
30
|
Do not publish private or sensitive operational rollback material in this
|
|
13
31
|
repository.
|
package/docs/security.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
The public Sema repository must not contain private or sensitive operational
|
|
4
4
|
material.
|
|
5
5
|
|
|
6
|
+
Local Sema execution does not need a credential, login, activation key, license
|
|
7
|
+
token, billing token, or control-panel session. Do not introduce one as a
|
|
8
|
+
condition for reading or governing a local workspace.
|
|
9
|
+
|
|
10
|
+
The official Codex bootstrap skill contains instructions only. It must not
|
|
11
|
+
bundle an MCP server, app connector, remote workspace bridge, credential flow,
|
|
12
|
+
or a second copy of the repository governance that belongs in `AGENTS.md`.
|
|
13
|
+
|
|
6
14
|
Do not publish:
|
|
7
15
|
|
|
8
16
|
- real credentials or secret material;
|
package/docs/syntax.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!-- sema:agent-entrypoint:start -->
|
|
2
|
-
# Sema Syntax for
|
|
2
|
+
# Sema Syntax for Codex
|
|
3
3
|
|
|
4
4
|
Use this file as a compact reference before creating or fixing `.sema` contracts.
|
|
5
5
|
|
|
@@ -74,7 +74,6 @@ Use these origins before inventing a new one:
|
|
|
74
74
|
- `go`
|
|
75
75
|
- `rust`
|
|
76
76
|
- `cpp`
|
|
77
|
-
- `php`
|
|
78
77
|
|
|
79
78
|
Examples:
|
|
80
79
|
|
|
@@ -105,7 +104,7 @@ impl {
|
|
|
105
104
|
|
|
106
105
|
## JavaScript Is Supported
|
|
107
106
|
|
|
108
|
-
The CLI supports JavaScript
|
|
107
|
+
The CLI supports JavaScript generation:
|
|
109
108
|
|
|
110
109
|
```bash
|
|
111
110
|
sema compilar contratos/orders.sema --alvo javascript --saida ./generated/javascript
|
|
@@ -115,15 +114,15 @@ The project can also generate TypeScript, Python, PHP, Dart, Lua, HTML, and CSS
|
|
|
115
114
|
|
|
116
115
|
## Support Files
|
|
117
116
|
|
|
118
|
-
- `AGENTS.md`:
|
|
119
|
-
- `SEMA_BOOT.md`: first read for
|
|
120
|
-
- `SEMA_SMALL_MODEL.md`:
|
|
121
|
-
- `AGENT_CONTEXT_PACK.json`: structured
|
|
117
|
+
- `AGENTS.md`: official Codex repository rules, loaded automatically.
|
|
118
|
+
- `SEMA_BOOT.md`: first Sema read for Codex.
|
|
119
|
+
- `SEMA_SMALL_MODEL.md`: compact guidance for a small context budget.
|
|
120
|
+
- `AGENT_CONTEXT_PACK.json`: structured Codex context pack.
|
|
122
121
|
- `SEMA_INDEX.json`: project index.
|
|
123
122
|
- `docs/commands.md`: command catalog, gates, and `--saida` rule.
|
|
124
123
|
- `exemplos/`: official DSL examples.
|
|
125
124
|
|
|
126
|
-
If
|
|
125
|
+
If Codex does not know which shape to use, it must open `exemplos/calculadora.sema`, `exemplos/crud_simples.sema`, `exemplos/pagamento.sema`, or `exemplos/tratamento_erro.sema` before inventing syntax.
|
|
127
126
|
|
|
128
|
-
Platform policy:
|
|
127
|
+
Platform policy: Sema governs project contracts, scope, drift, evidence, and quality. It never bypasses platform policies, permissions, security controls, terms, or laws.
|
|
129
128
|
<!-- sema:agent-entrypoint:end -->
|
package/docs/testing.md
CHANGED
|
@@ -6,12 +6,23 @@ Recommended checks:
|
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
npm run build
|
|
9
|
+
npm run status:check
|
|
10
|
+
npm run repo:verificar-publico
|
|
11
|
+
npm run plugin:testar-codex
|
|
9
12
|
node pacotes/cli/dist/index.js --help
|
|
10
|
-
node pacotes/cli/dist/index.js
|
|
13
|
+
node pacotes/cli/dist/index.js --version
|
|
14
|
+
node pacotes/cli/dist/index.js resumo exemplos/calculadora.sema --micro --json
|
|
11
15
|
node pacotes/cli/dist/index.js validar exemplos/calculadora.sema --json
|
|
12
|
-
npm run
|
|
13
|
-
|
|
16
|
+
npm run release:preparar-publica
|
|
17
|
+
npm run release:verificar-drift
|
|
14
18
|
```
|
|
15
19
|
|
|
16
20
|
Do not require private or sensitive operational material for public test
|
|
17
|
-
evidence.
|
|
21
|
+
evidence. The public-package smoke must also reject the removed authorization
|
|
22
|
+
command, legacy gate markers, any stale billing artifact, secrets, and broken
|
|
23
|
+
encoding in every published document. The plugin smoke must validate the repo
|
|
24
|
+
marketplace, manifest version, installed skill copy, and absence of Sema MCP.
|
|
25
|
+
After push and npm publication, `npm run release:verificar-distribuicao` must
|
|
26
|
+
repeat that installation from the remote `gerlanss/Sema` marketplace and prove
|
|
27
|
+
that GitHub HEAD, the installed skill, and npm 2.0.0 all describe the same
|
|
28
|
+
release.
|
package/docs/vocabulary.md
CHANGED
package/package.json
CHANGED
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semacode/cli",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Codex-native local semantic governance CLI for contracts, drift, impact, documentation gates, and code generation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"icon": "logo.png",
|
|
7
7
|
"license": "SEE LICENSE IN LICENSE",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/gerlanss/Sema.git"
|
|
11
|
+
},
|
|
8
12
|
"homepage": "https://otimitare.online",
|
|
9
13
|
"bugs": {
|
|
10
|
-
"url": "https://
|
|
14
|
+
"url": "https://github.com/gerlanss/Sema/issues",
|
|
11
15
|
"email": "suporte@otimitare.online"
|
|
12
16
|
},
|
|
13
17
|
"keywords": [
|
|
14
18
|
"sema",
|
|
15
19
|
"ai",
|
|
20
|
+
"codex",
|
|
21
|
+
"ai-agents",
|
|
22
|
+
"semantic-governance",
|
|
23
|
+
"local-first",
|
|
16
24
|
"contracts",
|
|
17
25
|
"governance",
|
|
18
26
|
"backend",
|
|
@@ -39,16 +47,16 @@
|
|
|
39
47
|
"LICENSE"
|
|
40
48
|
],
|
|
41
49
|
"dependencies": {
|
|
42
|
-
"@sema/nucleo": "1.5.
|
|
43
|
-
"@sema/gerador-dart": "1.5.
|
|
44
|
-
"@sema/gerador-lua": "1.5.
|
|
45
|
-
"@sema/gerador-python": "1.5.
|
|
46
|
-
"@sema/gerador-typescript": "1.5.
|
|
47
|
-
"@sema/gerador-javascript": "1.5.
|
|
48
|
-
"@sema/gerador-html": "1.5.
|
|
49
|
-
"@sema/gerador-css": "1.5.
|
|
50
|
+
"@sema/nucleo": "1.5.53",
|
|
51
|
+
"@sema/gerador-dart": "1.5.53",
|
|
52
|
+
"@sema/gerador-lua": "1.5.53",
|
|
53
|
+
"@sema/gerador-python": "1.5.53",
|
|
54
|
+
"@sema/gerador-typescript": "1.5.53",
|
|
55
|
+
"@sema/gerador-javascript": "1.5.53",
|
|
56
|
+
"@sema/gerador-html": "1.5.53",
|
|
57
|
+
"@sema/gerador-css": "1.5.53",
|
|
50
58
|
"@sema/gerador-php": "1.5.55",
|
|
51
|
-
"@sema/padroes": "1.5.
|
|
59
|
+
"@sema/padroes": "1.5.53",
|
|
52
60
|
"typescript": "^5.8.3"
|
|
53
61
|
},
|
|
54
62
|
"bundledDependencies": [
|
package/dist/billing/index.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export interface PreflightCliOutput {
|
|
2
|
-
comando: "preflight";
|
|
3
|
-
surface: "local_cli";
|
|
4
|
-
autorizado: boolean;
|
|
5
|
-
decisao: "use_cli_local" | "blocked";
|
|
6
|
-
filesystem: "local_available";
|
|
7
|
-
origemCobranca: "local_only";
|
|
8
|
-
operationCode: string;
|
|
9
|
-
toolName: string;
|
|
10
|
-
erro?: string;
|
|
11
|
-
}
|
|
12
|
-
export declare function executarPreflightCli(params: {
|
|
13
|
-
comandoCli: string;
|
|
14
|
-
args?: string[];
|
|
15
|
-
projectId?: string | null;
|
|
16
|
-
}): Promise<PreflightCliOutput>;
|
|
17
|
-
export declare function comandoPreflightCli(args: string[], json: boolean): Promise<number>;
|
package/dist/billing/index.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
// SEMA-GOVERNED: sema.governanca_ia_contexto
|
|
2
|
-
// Descricao: preflight local-only da CLI publica.
|
|
3
|
-
import { obterOpcao, obterPosicionais, possuiFlag } from "../cliArgs.js";
|
|
4
|
-
const OPERATION_CODE_BY_CLI_COMMAND = {
|
|
5
|
-
resumo: "tool.sema_resumo",
|
|
6
|
-
validar: "tool.sema_validar",
|
|
7
|
-
ir: "tool.sema_ir",
|
|
8
|
-
inspecionar: "tool.sema_inspecionar",
|
|
9
|
-
drift: "drift.module",
|
|
10
|
-
impacto: "default.operation",
|
|
11
|
-
verificar: "verify.full",
|
|
12
|
-
};
|
|
13
|
-
function normalizarComandoCli(comandoCli) {
|
|
14
|
-
return comandoCli.trim().replace(/^sema\s+/i, "").split(/\s+/)[0]?.toLowerCase() || "default";
|
|
15
|
-
}
|
|
16
|
-
function resolverOperationCodeCli(comandoCli, args) {
|
|
17
|
-
const explicito = obterOpcao(args, "--operation-code");
|
|
18
|
-
if (explicito)
|
|
19
|
-
return explicito;
|
|
20
|
-
const comando = normalizarComandoCli(comandoCli);
|
|
21
|
-
if (comando === "drift" && obterOpcao(args, "--escopo") === "projeto") {
|
|
22
|
-
return "drift.project";
|
|
23
|
-
}
|
|
24
|
-
return OPERATION_CODE_BY_CLI_COMMAND[comando] ?? "default.operation";
|
|
25
|
-
}
|
|
26
|
-
function resolverToolNameCli(comandoCli) {
|
|
27
|
-
return `sema_cli_${normalizarComandoCli(comandoCli).replace(/[^a-z0-9_]+/g, "_")}`;
|
|
28
|
-
}
|
|
29
|
-
export async function executarPreflightCli(params) {
|
|
30
|
-
const args = params.args ?? [];
|
|
31
|
-
const comandoCli = params.comandoCli || "default";
|
|
32
|
-
const operationCode = resolverOperationCodeCli(comandoCli, args);
|
|
33
|
-
const toolName = resolverToolNameCli(comandoCli);
|
|
34
|
-
void params.projectId;
|
|
35
|
-
return {
|
|
36
|
-
comando: "preflight",
|
|
37
|
-
surface: "local_cli",
|
|
38
|
-
autorizado: true,
|
|
39
|
-
decisao: "use_cli_local",
|
|
40
|
-
filesystem: "local_available",
|
|
41
|
-
origemCobranca: "local_only",
|
|
42
|
-
operationCode,
|
|
43
|
-
toolName,
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
export async function comandoPreflightCli(args, json) {
|
|
47
|
-
if (possuiFlag(args, "--help") || possuiFlag(args, "-h")) {
|
|
48
|
-
console.log([
|
|
49
|
-
"Usage: sema preflight [command] [--operation-code <code>] [--json]",
|
|
50
|
-
"",
|
|
51
|
-
"Checks the local CLI surface. Public Sema is local-only and does not call external services.",
|
|
52
|
-
"If this command returns decisao=use_cli_local, continue with local CLI commands.",
|
|
53
|
-
].join("\n"));
|
|
54
|
-
return 0;
|
|
55
|
-
}
|
|
56
|
-
const posicionais = obterPosicionais(args);
|
|
57
|
-
const comandoCli = obterOpcao(args, "--comando") ?? posicionais[0] ?? "resumo";
|
|
58
|
-
const resultado = await executarPreflightCli({
|
|
59
|
-
comandoCli,
|
|
60
|
-
args,
|
|
61
|
-
projectId: obterOpcao(args, "--project-id") ?? null,
|
|
62
|
-
});
|
|
63
|
-
if (json) {
|
|
64
|
-
console.log(JSON.stringify(resultado, null, 2));
|
|
65
|
-
}
|
|
66
|
-
else if (resultado.autorizado) {
|
|
67
|
-
console.log(`Sema CLI authorized: ${resultado.operationCode}. Decision: ${resultado.decisao}.`);
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
console.error(`Sema CLI blocked: ${resultado.erro}`);
|
|
71
|
-
}
|
|
72
|
-
return resultado.autorizado ? 0 : 1;
|
|
73
|
-
}
|
|
74
|
-
//# sourceMappingURL=index.js.map
|