@semacode/cli 3.13.1 → 4.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/dist/cliGrammar.js +17 -5
- package/dist/cliHelpTexto.js +4 -3
- package/dist/contextPack.d.ts +75 -0
- package/dist/contextPack.js +130 -0
- package/dist/driftPack.d.ts +65 -0
- package/dist/driftPack.js +96 -0
- package/dist/entrypointPack.d.ts +47 -0
- package/dist/entrypointPack.js +79 -0
- package/dist/index.part05.js +7 -1
- package/dist/index.part06.js +51 -0
- package/dist/index.part07.d.ts +1 -1
- package/dist/index.part07.js +16 -2
- package/dist/index.part08.js +1 -1
- package/dist/indexPack.d.ts +54 -0
- package/dist/indexPack.js +140 -0
- package/dist/init/templates.part01.js +393 -393
- package/dist/init/templates.part02.js +189 -189
- package/dist/initTemplatesBackend.js +73 -73
- package/dist/initTemplatesFlutter.js +137 -137
- package/dist/initTemplatesRuntime.js +350 -350
- package/dist/initTemplatesWeb.js +309 -309
- package/dist/sync/index.js +35 -35
- package/docs/auth.md +26 -26
- package/docs/database.md +15 -15
- package/docs/env.md +16 -16
- package/docs/frontend.md +41 -41
- package/docs/i18n.md +15 -15
- package/exemplos/agendamento.sema +1 -1
- package/exemplos/assinatura.sema +1 -1
- package/exemplos/auditoria.sema +1 -1
- package/exemplos/autenticacao.sema +1 -1
- package/exemplos/author_obra_comum.sema +1 -1
- package/exemplos/author_tema_sensivel.sema +1 -1
- package/exemplos/automacao.sema +1 -1
- package/exemplos/cadastro_usuario.sema +1 -1
- package/exemplos/calculadora.sema +1 -1
- package/exemplos/crud_simples.sema +1 -1
- package/exemplos/estoque.sema +1 -1
- package/exemplos/exportacao.sema +1 -1
- package/exemplos/fila.sema +1 -1
- package/exemplos/integracao_externa.sema +1 -1
- package/exemplos/multi_tenant.sema +1 -1
- package/exemplos/notificacao.sema +1 -1
- package/exemplos/operacao_estrategia.sema +132 -132
- package/exemplos/operacao_estrategia_discovery.sema +220 -220
- package/exemplos/operacao_estrategia_fluxo.sema +114 -114
- package/exemplos/operacao_estrategia_gates.sema +106 -106
- package/exemplos/operacao_estrategia_quarentena.sema +133 -133
- package/exemplos/operacao_estrategia_rollout.sema +124 -124
- package/exemplos/pagamento.sema +1 -1
- package/exemplos/pagamento_dominio.sema +1 -1
- package/exemplos/pedido.sema +1 -1
- package/exemplos/permissao.sema +1 -1
- package/exemplos/persistencia_vendor_first.sema +1 -1
- package/exemplos/php_crud.sema +170 -170
- package/exemplos/profile_conversas.sema +165 -165
- package/exemplos/profile_game.sema +1 -1
- package/exemplos/profile_legal.sema +1 -1
- package/exemplos/profile_ops.sema +1 -1
- package/exemplos/profile_research.sema +1 -1
- package/exemplos/profile_software.sema +1 -1
- package/exemplos/profile_workflow_n8n.sema +1 -1
- package/exemplos/relatorio.sema +1 -1
- package/exemplos/replica_analitica_erp.sema +1 -1
- package/exemplos/testes_embutidos.sema +1 -1
- package/exemplos/tratamento_erro.sema +1 -1
- package/exemplos/upload_arquivo.sema +1 -1
- package/exemplos/webhook.sema +1 -1
- package/node_modules/@sema/gerador-cpp/dist/index.js +176 -176
- package/node_modules/@sema/gerador-css/dist/index.part01.js +10 -10
- package/node_modules/@sema/gerador-dotnet/dist/index.js +169 -169
- package/node_modules/@sema/gerador-html/dist/index.js +17 -17
- package/node_modules/@sema/gerador-python/dist/index.part02.js +3 -3
- package/node_modules/@sema/gerador-typescript/dist/index.part02.js +11 -11
- package/node_modules/@sema/nucleo/dist/diagnosticos/melhorador.js +42 -42
- package/package.json +1 -1
package/dist/sync/index.js
CHANGED
|
@@ -46,25 +46,25 @@ export async function gerarSchemaPrisma(pastaContratos, saidaSchema, datasourceP
|
|
|
46
46
|
for (const contrato of contratos) {
|
|
47
47
|
const nomeModel = path.basename(contrato, '.sema').replace(/\./g, '_');
|
|
48
48
|
// Schema simplificado - em producao, fazer parsing real do contrato
|
|
49
|
-
models += `\nmodel ${nomeModel.charAt(0).toUpperCase() + nomeModel.slice(1)} {
|
|
50
|
-
id String @id @default(uuid())
|
|
51
|
-
criadoEm DateTime @default(now())
|
|
52
|
-
// Gerado a partir de: ${contrato}
|
|
53
|
-
// TODO: Adicionar campos do contrato Sema
|
|
49
|
+
models += `\nmodel ${nomeModel.charAt(0).toUpperCase() + nomeModel.slice(1)} {
|
|
50
|
+
id String @id @default(uuid())
|
|
51
|
+
criadoEm DateTime @default(now())
|
|
52
|
+
// Gerado a partir de: ${contrato}
|
|
53
|
+
// TODO: Adicionar campos do contrato Sema
|
|
54
54
|
}\n`;
|
|
55
55
|
modelCount++;
|
|
56
56
|
}
|
|
57
|
-
const schema = `// Gerado automaticamente pelo Sema
|
|
58
|
-
// Fonte: ${pastaContratos}
|
|
59
|
-
|
|
60
|
-
generator client {
|
|
61
|
-
provider = "prisma-client-js"
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
datasource db {
|
|
65
|
-
provider = "${datasourceProvider}"
|
|
66
|
-
url = env("SEMA_PRISMA_URL")
|
|
67
|
-
}
|
|
57
|
+
const schema = `// Gerado automaticamente pelo Sema
|
|
58
|
+
// Fonte: ${pastaContratos}
|
|
59
|
+
|
|
60
|
+
generator client {
|
|
61
|
+
provider = "prisma-client-js"
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
datasource db {
|
|
65
|
+
provider = "${datasourceProvider}"
|
|
66
|
+
url = env("SEMA_PRISMA_URL")
|
|
67
|
+
}
|
|
68
68
|
${models}`;
|
|
69
69
|
// Salvar
|
|
70
70
|
fs.writeFileSync(saidaSchema, schema, 'utf-8');
|
|
@@ -90,25 +90,25 @@ export async function importarSchemaPrisma(caminhoSchema, pastaSaida, nomeModulo
|
|
|
90
90
|
const nomeContrato = `${nomeModel.toLowerCase()}.sema`;
|
|
91
91
|
const caminhoContrato = path.join(pastaSaida, nomeContrato);
|
|
92
92
|
// Gerar contrato basico
|
|
93
|
-
const conteudo = `module ${nomeModulo}.${nomeModel.toLowerCase()} {
|
|
94
|
-
entity ${nomeModel} {
|
|
95
|
-
fields {
|
|
96
|
-
id: Id
|
|
97
|
-
// TODO: Mapear campos do schema Prisma
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
task criar_${nomeModel.toLowerCase()} {
|
|
102
|
-
input {
|
|
103
|
-
// TODO: Definir inputs
|
|
104
|
-
}
|
|
105
|
-
output {
|
|
106
|
-
${nomeModel.toLowerCase()}: ${nomeModel}
|
|
107
|
-
}
|
|
108
|
-
effects {
|
|
109
|
-
persistencia ${nomeModel}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
93
|
+
const conteudo = `module ${nomeModulo}.${nomeModel.toLowerCase()} {
|
|
94
|
+
entity ${nomeModel} {
|
|
95
|
+
fields {
|
|
96
|
+
id: Id
|
|
97
|
+
// TODO: Mapear campos do schema Prisma
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
task criar_${nomeModel.toLowerCase()} {
|
|
102
|
+
input {
|
|
103
|
+
// TODO: Definir inputs
|
|
104
|
+
}
|
|
105
|
+
output {
|
|
106
|
+
${nomeModel.toLowerCase()}: ${nomeModel}
|
|
107
|
+
}
|
|
108
|
+
effects {
|
|
109
|
+
persistencia ${nomeModel}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
112
|
}`;
|
|
113
113
|
fs.writeFileSync(caminhoContrato, conteudo, 'utf-8');
|
|
114
114
|
contratos.push(caminhoContrato);
|
package/docs/auth.md
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
# Local Runtime Boundary
|
|
2
|
-
|
|
3
|
-
The public Sema CLI executes directly against the local workspace. It does not
|
|
4
|
-
require a Sema login, user authentication, product authorization, license
|
|
5
|
-
activation, install key, token, credits, billing service, control panel, or an
|
|
6
|
-
external request.
|
|
7
|
-
|
|
8
|
-
Use local commands:
|
|
9
|
-
|
|
10
|
-
```bash
|
|
11
|
-
sema --version
|
|
12
|
-
sema resumo
|
|
13
|
-
sema validar contratos/example.sema --json
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
The repository license governs use and redistribution. It is not checked as a
|
|
17
|
-
runtime activation mechanism.
|
|
18
|
-
|
|
19
|
-
An `authz` block inside a `.sema` contract describes authorization in the
|
|
20
|
-
application being governed. It does not authenticate a person before the Sema
|
|
21
|
-
CLI can run.
|
|
22
|
-
|
|
23
|
-
Do not put private or sensitive operational material in this repository.
|
|
24
|
-
|
|
25
|
-
Application-specific authentication belongs in the application repository that
|
|
26
|
-
owns it.
|
|
1
|
+
# Local Runtime Boundary
|
|
2
|
+
|
|
3
|
+
The public Sema CLI executes directly against the local workspace. It does not
|
|
4
|
+
require a Sema login, user authentication, product authorization, license
|
|
5
|
+
activation, install key, token, credits, billing service, control panel, or an
|
|
6
|
+
external request.
|
|
7
|
+
|
|
8
|
+
Use local commands:
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
sema --version
|
|
12
|
+
sema resumo
|
|
13
|
+
sema validar contratos/example.sema --json
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The repository license governs use and redistribution. It is not checked as a
|
|
17
|
+
runtime activation mechanism.
|
|
18
|
+
|
|
19
|
+
An `authz` block inside a `.sema` contract describes authorization in the
|
|
20
|
+
application being governed. It does not authenticate a person before the Sema
|
|
21
|
+
CLI can run.
|
|
22
|
+
|
|
23
|
+
Do not put private or sensitive operational material in this repository.
|
|
24
|
+
|
|
25
|
+
Application-specific authentication belongs in the application repository that
|
|
26
|
+
owns it.
|
package/docs/database.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
# Database Boundary
|
|
2
|
-
|
|
3
|
-
The public Sema CLI does not require a database.
|
|
4
|
-
|
|
5
|
-
Sema reads contracts and source files from the local workspace. Any database used
|
|
6
|
-
by an application governed by Sema belongs to that application, not to the public
|
|
7
|
-
Sema CLI distribution.
|
|
8
|
-
|
|
9
|
-
## Public Rule
|
|
10
|
-
|
|
11
|
-
Do not ship private database material, real credentials, operational schemas, or
|
|
12
|
-
project-specific data in the public Sema package.
|
|
13
|
-
|
|
14
|
-
Application-specific database docs should live in the application repository
|
|
15
|
-
that owns the database.
|
|
1
|
+
# Database Boundary
|
|
2
|
+
|
|
3
|
+
The public Sema CLI does not require a database.
|
|
4
|
+
|
|
5
|
+
Sema reads contracts and source files from the local workspace. Any database used
|
|
6
|
+
by an application governed by Sema belongs to that application, not to the public
|
|
7
|
+
Sema CLI distribution.
|
|
8
|
+
|
|
9
|
+
## Public Rule
|
|
10
|
+
|
|
11
|
+
Do not ship private database material, real credentials, operational schemas, or
|
|
12
|
+
project-specific data in the public Sema package.
|
|
13
|
+
|
|
14
|
+
Application-specific database docs should live in the application repository
|
|
15
|
+
that owns the database.
|
package/docs/env.md
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
# Environment
|
|
2
|
-
|
|
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.
|
|
6
|
-
|
|
7
|
-
Allowed public examples may use placeholders:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
EXAMPLE_API_KEY=replace-me
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Do not publish private or sensitive operational material in public Sema docs.
|
|
14
|
-
|
|
15
|
-
If an application governed by Sema needs environment variables, document them in
|
|
16
|
-
that application repository.
|
|
1
|
+
# Environment
|
|
2
|
+
|
|
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.
|
|
6
|
+
|
|
7
|
+
Allowed public examples may use placeholders:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
EXAMPLE_API_KEY=replace-me
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Do not publish private or sensitive operational material in public Sema docs.
|
|
14
|
+
|
|
15
|
+
If an application governed by Sema needs environment variables, document them in
|
|
16
|
+
that application repository.
|
package/docs/frontend.md
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
# User Experience Quality
|
|
2
|
-
|
|
3
|
-
When Sema governs a UI, dashboard, app, site, game, or terminal tool, the
|
|
4
|
-
experience must be modern, contextual, and verified. This is a quality gate, not
|
|
5
|
-
decoration.
|
|
6
|
-
|
|
7
|
-
## Before Building
|
|
8
|
-
|
|
9
|
-
Define:
|
|
10
|
-
|
|
11
|
-
- audience and domain
|
|
12
|
-
- primary workflow
|
|
13
|
-
- density and information hierarchy
|
|
14
|
-
- interaction states
|
|
15
|
-
- responsive behavior
|
|
16
|
-
- accessibility basics
|
|
17
|
-
- evidence needed before closing
|
|
18
|
-
|
|
19
|
-
## Browser Evidence
|
|
20
|
-
|
|
21
|
-
For web UI, check desktop and mobile. On a narrow viewport such as 390px, this
|
|
22
|
-
must be true:
|
|
23
|
-
|
|
24
|
-
```js
|
|
25
|
-
document.documentElement.scrollWidth <= document.documentElement.clientWidth
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Fix overlapping text, broken wrapping, hidden controls, and incoherent layout
|
|
29
|
-
before closing the change.
|
|
30
|
-
|
|
31
|
-
## Terminal Evidence
|
|
32
|
-
|
|
33
|
-
For CLI/TUI work, smoke-check:
|
|
34
|
-
|
|
35
|
-
- `--help`
|
|
36
|
-
- success output
|
|
37
|
-
- error output
|
|
38
|
-
- JSON output when supported
|
|
39
|
-
|
|
40
|
-
The public Sema CLI itself must stay local-only and must not depend on private
|
|
41
|
-
or sensitive operational material for these checks.
|
|
1
|
+
# User Experience Quality
|
|
2
|
+
|
|
3
|
+
When Sema governs a UI, dashboard, app, site, game, or terminal tool, the
|
|
4
|
+
experience must be modern, contextual, and verified. This is a quality gate, not
|
|
5
|
+
decoration.
|
|
6
|
+
|
|
7
|
+
## Before Building
|
|
8
|
+
|
|
9
|
+
Define:
|
|
10
|
+
|
|
11
|
+
- audience and domain
|
|
12
|
+
- primary workflow
|
|
13
|
+
- density and information hierarchy
|
|
14
|
+
- interaction states
|
|
15
|
+
- responsive behavior
|
|
16
|
+
- accessibility basics
|
|
17
|
+
- evidence needed before closing
|
|
18
|
+
|
|
19
|
+
## Browser Evidence
|
|
20
|
+
|
|
21
|
+
For web UI, check desktop and mobile. On a narrow viewport such as 390px, this
|
|
22
|
+
must be true:
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
document.documentElement.scrollWidth <= document.documentElement.clientWidth
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Fix overlapping text, broken wrapping, hidden controls, and incoherent layout
|
|
29
|
+
before closing the change.
|
|
30
|
+
|
|
31
|
+
## Terminal Evidence
|
|
32
|
+
|
|
33
|
+
For CLI/TUI work, smoke-check:
|
|
34
|
+
|
|
35
|
+
- `--help`
|
|
36
|
+
- success output
|
|
37
|
+
- error output
|
|
38
|
+
- JSON output when supported
|
|
39
|
+
|
|
40
|
+
The public Sema CLI itself must stay local-only and must not depend on private
|
|
41
|
+
or sensitive operational material for these checks.
|
package/docs/i18n.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
# Language And Identifiers
|
|
2
|
-
|
|
3
|
-
Public Sema documentation is English.
|
|
4
|
-
|
|
5
|
-
Do not translate commands, file paths, package names, endpoint paths, environment
|
|
6
|
-
variable names, code symbols, DSL keywords, or brand names.
|
|
7
|
-
|
|
8
|
-
Examples:
|
|
9
|
-
|
|
10
|
-
- Keep `sema validar`, not an English paraphrase.
|
|
11
|
-
- Keep `.sema`, `task`, `input`, `output`, `rules`, `effects`, and `guarantees`.
|
|
12
|
-
- Keep package names such as `@semacode/cli`.
|
|
13
|
-
|
|
14
|
-
Human-facing prose should be clear English. Contract DSL can keep its own
|
|
15
|
-
keywords and domain identifiers.
|
|
1
|
+
# Language And Identifiers
|
|
2
|
+
|
|
3
|
+
Public Sema documentation is English.
|
|
4
|
+
|
|
5
|
+
Do not translate commands, file paths, package names, endpoint paths, environment
|
|
6
|
+
variable names, code symbols, DSL keywords, or brand names.
|
|
7
|
+
|
|
8
|
+
Examples:
|
|
9
|
+
|
|
10
|
+
- Keep `sema validar`, not an English paraphrase.
|
|
11
|
+
- Keep `.sema`, `task`, `input`, `output`, `rules`, `effects`, and `guarantees`.
|
|
12
|
+
- Keep package names such as `@semacode/cli`.
|
|
13
|
+
|
|
14
|
+
Human-facing prose should be clear English. Contract DSL can keep its own
|
|
15
|
+
keywords and domain identifiers.
|
package/exemplos/assinatura.sema
CHANGED
package/exemplos/auditoria.sema
CHANGED
package/exemplos/automacao.sema
CHANGED
package/exemplos/estoque.sema
CHANGED
package/exemplos/exportacao.sema
CHANGED
package/exemplos/fila.sema
CHANGED