@semacode/cli 1.5.25 → 1.5.27
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 +3 -3
- package/SEMA_BRIEF.curto.txt +6 -6
- package/SEMA_BRIEF.md +24 -31
- package/SEMA_BRIEF.micro.txt +5 -5
- package/SEMA_INDEX.json +154 -349
- package/dist/index.js +564 -13
- package/dist/index.js.map +1 -1
- package/docs/cli.md +4 -4
- package/docs/env.md +3 -3
- package/docs/instalacao-e-primeiro-uso.md +5 -5
- package/docs/persistencia-vendor-first.md +1 -1
- package/docs/repositories.md +54 -0
- package/docs/rollback.md +1 -1
- package/docs/seguranca.md +126 -0
- package/node_modules/@sema/gerador-css/package.json +1 -1
- package/node_modules/@sema/gerador-dart/package.json +1 -1
- package/node_modules/@sema/gerador-html/package.json +1 -1
- package/node_modules/@sema/gerador-javascript/package.json +1 -1
- package/node_modules/@sema/gerador-lua/package.json +1 -1
- package/node_modules/@sema/gerador-python/package.json +1 -1
- package/node_modules/@sema/gerador-typescript/package.json +1 -1
- package/node_modules/@sema/nucleo/package.json +1 -1
- package/node_modules/@sema/padroes/package.json +1 -1
- package/package.json +10 -10
- package/dist/controleComercialSupabase.d.ts +0 -326
- package/dist/controleComercialSupabase.js +0 -310
- package/dist/controleComercialSupabase.js.map +0 -1
- package/docs/deploy.md +0 -258
package/docs/deploy.md
DELETED
|
@@ -1,258 +0,0 @@
|
|
|
1
|
-
# Deploy
|
|
2
|
-
|
|
3
|
-
<!-- sema:i18n -->
|
|
4
|
-
> EN: English first.
|
|
5
|
-
> PT: Português depois, com acentos preservados.
|
|
6
|
-
> ES: Español al final.
|
|
7
|
-
|
|
8
|
-
## EN
|
|
9
|
-
|
|
10
|
-
This runbook covers two different deploy surfaces for Sema:
|
|
11
|
-
|
|
12
|
-
- Sema public website and private MCP server at `https://sema.otimitare.online`.
|
|
13
|
-
- Public package releases for CLI/VSIX/NPM/GitHub.
|
|
14
|
-
|
|
15
|
-
The production website/MCP target is the **Sema VPS**, not the OtimiTare application VPS.
|
|
16
|
-
|
|
17
|
-
### Sema Production VPS
|
|
18
|
-
|
|
19
|
-
Operational facts:
|
|
20
|
-
|
|
21
|
-
- Domain: `sema.otimitare.online`
|
|
22
|
-
- Current public DNS target: resolve the domain before deploy, do not trust an old IP.
|
|
23
|
-
- SSH user: use the operational server user configured outside this repository.
|
|
24
|
-
- SSH identity: resolve it from local SSH config or a secret manager outside this repository.
|
|
25
|
-
- Static site root: `/srv/sema/site`
|
|
26
|
-
- Caddy config in this repo: `deploy/caddy/sema-site.Caddyfile`
|
|
27
|
-
- MCP service: `sema-mcp.service`
|
|
28
|
-
- MCP upstream: `127.0.0.1:3010`
|
|
29
|
-
|
|
30
|
-
Do not use the stale `otimitare` SSH alias for Sema deploy. It points to an old host/key pair and is not the source of truth.
|
|
31
|
-
|
|
32
|
-
Never commit private key content, private-key filenames, local key paths, IPs that are not already public DNS, or secret inventory details.
|
|
33
|
-
|
|
34
|
-
### Website Deploy
|
|
35
|
-
|
|
36
|
-
Before publishing:
|
|
37
|
-
|
|
38
|
-
```powershell
|
|
39
|
-
node pacotes\cli\dist\index.js validar contratos\sema\site_publico.sema --json
|
|
40
|
-
node pacotes\cli\dist\index.js drift contratos\sema\site_publico.sema --escopo modulo --json
|
|
41
|
-
npm run build
|
|
42
|
-
npm run format:check
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
Confirm the target:
|
|
46
|
-
|
|
47
|
-
```powershell
|
|
48
|
-
Resolve-DnsName sema.otimitare.online
|
|
49
|
-
ssh sema-vps "hostname; systemctl is-active sema-mcp.service; ls -ld /srv/sema/site"
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
Create a remote backup and publish static files:
|
|
53
|
-
|
|
54
|
-
```powershell
|
|
55
|
-
$stamp = Get-Date -Format "yyyyMMdd-HHmmss"
|
|
56
|
-
ssh sema-vps "mkdir -p /srv/sema/backups/site-$stamp && cp -a /srv/sema/site/. /srv/sema/backups/site-$stamp/"
|
|
57
|
-
scp -r site\sema\* sema-vps:/srv/sema/site/
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Validate after deploy:
|
|
61
|
-
|
|
62
|
-
```powershell
|
|
63
|
-
curl.exe -k -fsS https://sema.otimitare.online/healthz
|
|
64
|
-
curl.exe -k -fsS https://sema.otimitare.online/painel.html
|
|
65
|
-
curl.exe -k -fsS -D - https://sema.otimitare.online/mcp -o NUL
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
Expected result:
|
|
69
|
-
|
|
70
|
-
- `/healthz` returns healthy.
|
|
71
|
-
- `/painel.html` serves the current static panel.
|
|
72
|
-
- `/mcp` without token does not expose data; it should return an auth challenge or unauthorized response.
|
|
73
|
-
|
|
74
|
-
### Public Package Release
|
|
75
|
-
|
|
76
|
-
Before publishing a CLI or VSIX release:
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
npm run build
|
|
80
|
-
npm run format:check
|
|
81
|
-
npm run status:check
|
|
82
|
-
node --import tsx --test --test-name-pattern "docs operacionais|ajuda de ia" testes/integracao/cli-json-e-editor.test.ts
|
|
83
|
-
sema validar contratos/sema/governanca_ia.sema --json
|
|
84
|
-
sema drift contratos/sema/governanca_ia.sema --escopo modulo --json
|
|
85
|
-
npm run release:verificar-versao
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
Then:
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
npm run release:preparar-publica
|
|
92
|
-
npm run release:publicar-npm
|
|
93
|
-
npm view @semacode/cli version
|
|
94
|
-
npm install -g @semacode/cli@<versao>
|
|
95
|
-
sema --version
|
|
96
|
-
npm run release:verificar-publica
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
Stop if NPM already has the version, `gh auth status` fails, `npm whoami` fails, Sema validation fails, or release verification finds a mismatch.
|
|
100
|
-
|
|
101
|
-
## PT
|
|
102
|
-
|
|
103
|
-
Este runbook cobre duas superfícies diferentes de deploy da Sema:
|
|
104
|
-
|
|
105
|
-
- site público e servidor MCP privado em `https://sema.otimitare.online`;
|
|
106
|
-
- releases públicos de CLI/VSIX/NPM/GitHub.
|
|
107
|
-
|
|
108
|
-
O alvo de produção do site/MCP é a **VPS da Sema**, não a VPS da aplicação OtimiTare.
|
|
109
|
-
|
|
110
|
-
### VPS de Produção da Sema
|
|
111
|
-
|
|
112
|
-
Fatos operacionais:
|
|
113
|
-
|
|
114
|
-
- Domínio: `sema.otimitare.online`
|
|
115
|
-
- DNS público atual: resolva o domínio antes do deploy; não confie em IP antigo.
|
|
116
|
-
- Usuário SSH: use o usuário operacional do servidor configurado fora deste repositório.
|
|
117
|
-
- Identidade SSH: resolva pelo SSH config local ou secret manager fora deste repositório.
|
|
118
|
-
- Raiz do site estático: `/srv/sema/site`
|
|
119
|
-
- Configuração Caddy neste repositório: `deploy/caddy/sema-site.Caddyfile`
|
|
120
|
-
- Serviço MCP: `sema-mcp.service`
|
|
121
|
-
- Upstream MCP: `127.0.0.1:3010`
|
|
122
|
-
|
|
123
|
-
Não use o alias SSH antigo `otimitare` para deploy da Sema. Ele aponta para host/chave antigos e não é fonte da verdade.
|
|
124
|
-
|
|
125
|
-
Nunca commite conteúdo de chave privada, nomes de arquivos de chave privada, caminhos locais de chave, IPs que não sejam DNS público ou detalhes do inventário de segredos.
|
|
126
|
-
|
|
127
|
-
### Deploy do Site
|
|
128
|
-
|
|
129
|
-
Antes de publicar:
|
|
130
|
-
|
|
131
|
-
```powershell
|
|
132
|
-
node pacotes\cli\dist\index.js validar contratos\sema\site_publico.sema --json
|
|
133
|
-
node pacotes\cli\dist\index.js drift contratos\sema\site_publico.sema --escopo modulo --json
|
|
134
|
-
npm run build
|
|
135
|
-
npm run format:check
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
Confirme o alvo:
|
|
139
|
-
|
|
140
|
-
```powershell
|
|
141
|
-
Resolve-DnsName sema.otimitare.online
|
|
142
|
-
ssh sema-vps "hostname; systemctl is-active sema-mcp.service; ls -ld /srv/sema/site"
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
Crie backup remoto e publique os arquivos estáticos:
|
|
146
|
-
|
|
147
|
-
```powershell
|
|
148
|
-
$stamp = Get-Date -Format "yyyyMMdd-HHmmss"
|
|
149
|
-
ssh sema-vps "mkdir -p /srv/sema/backups/site-$stamp && cp -a /srv/sema/site/. /srv/sema/backups/site-$stamp/"
|
|
150
|
-
scp -r site\sema\* sema-vps:/srv/sema/site/
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
Valide depois do deploy:
|
|
154
|
-
|
|
155
|
-
```powershell
|
|
156
|
-
curl.exe -k -fsS https://sema.otimitare.online/healthz
|
|
157
|
-
curl.exe -k -fsS https://sema.otimitare.online/painel.html
|
|
158
|
-
curl.exe -k -fsS -D - https://sema.otimitare.online/mcp -o NUL
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
Resultado esperado:
|
|
162
|
-
|
|
163
|
-
- `/healthz` responde saudável.
|
|
164
|
-
- `/painel.html` serve o painel estático atual.
|
|
165
|
-
- `/mcp` sem token não expõe dados; deve devolver desafio de autenticação ou não autorizado.
|
|
166
|
-
|
|
167
|
-
### Release Público
|
|
168
|
-
|
|
169
|
-
Antes de publicar CLI ou VSIX:
|
|
170
|
-
|
|
171
|
-
```bash
|
|
172
|
-
npm run build
|
|
173
|
-
npm run format:check
|
|
174
|
-
npm run status:check
|
|
175
|
-
node --import tsx --test --test-name-pattern "docs operacionais|ajuda de ia" testes/integracao/cli-json-e-editor.test.ts
|
|
176
|
-
sema validar contratos/sema/governanca_ia.sema --json
|
|
177
|
-
sema drift contratos/sema/governanca_ia.sema --escopo modulo --json
|
|
178
|
-
npm run release:verificar-versao
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
Depois:
|
|
182
|
-
|
|
183
|
-
```bash
|
|
184
|
-
npm run release:preparar-publica
|
|
185
|
-
npm run release:publicar-npm
|
|
186
|
-
npm view @semacode/cli version
|
|
187
|
-
npm install -g @semacode/cli@<versao>
|
|
188
|
-
sema --version
|
|
189
|
-
npm run release:verificar-publica
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
Pare se a versão já existir no NPM, `gh auth status` falhar, `npm whoami` falhar, a validação Sema falhar ou a verificação de release encontrar desalinhamento.
|
|
193
|
-
|
|
194
|
-
## ES
|
|
195
|
-
|
|
196
|
-
Este runbook cubre dos superficies distintas de despliegue de Sema:
|
|
197
|
-
|
|
198
|
-
- sitio público y servidor MCP privado en `https://sema.otimitare.online`;
|
|
199
|
-
- releases públicos de CLI/VSIX/NPM/GitHub.
|
|
200
|
-
|
|
201
|
-
El destino de producción del sitio/MCP es la **VPS de Sema**, no la VPS de la aplicación OtimiTare.
|
|
202
|
-
|
|
203
|
-
### VPS de Producción de Sema
|
|
204
|
-
|
|
205
|
-
Datos operativos:
|
|
206
|
-
|
|
207
|
-
- Dominio: `sema.otimitare.online`
|
|
208
|
-
- DNS público actual: resuelve el dominio antes del despliegue; no confíes en una IP antigua.
|
|
209
|
-
- Usuario SSH: usa el usuario operativo del servidor configurado fuera de este repositorio.
|
|
210
|
-
- Identidad SSH: resuélvela desde el SSH config local o secret manager fuera de este repositorio.
|
|
211
|
-
- Raíz del sitio estático: `/srv/sema/site`
|
|
212
|
-
- Configuración Caddy en este repositorio: `deploy/caddy/sema-site.Caddyfile`
|
|
213
|
-
- Servicio MCP: `sema-mcp.service`
|
|
214
|
-
- Upstream MCP: `127.0.0.1:3010`
|
|
215
|
-
|
|
216
|
-
No uses el alias SSH antiguo `otimitare` para desplegar Sema. Apunta a un host/par de llaves antiguo y no es la fuente de verdad.
|
|
217
|
-
|
|
218
|
-
Nunca hagas commit del contenido de la llave privada, nombres de archivos de llave privada, rutas locales de llaves, IPs que no sean DNS público o detalles del inventario de secretos.
|
|
219
|
-
|
|
220
|
-
### Despliegue del Sitio
|
|
221
|
-
|
|
222
|
-
Antes de publicar:
|
|
223
|
-
|
|
224
|
-
```powershell
|
|
225
|
-
node pacotes\cli\dist\index.js validar contratos\sema\site_publico.sema --json
|
|
226
|
-
node pacotes\cli\dist\index.js drift contratos\sema\site_publico.sema --escopo modulo --json
|
|
227
|
-
npm run build
|
|
228
|
-
npm run format:check
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
Confirma el destino:
|
|
232
|
-
|
|
233
|
-
```powershell
|
|
234
|
-
Resolve-DnsName sema.otimitare.online
|
|
235
|
-
ssh sema-vps "hostname; systemctl is-active sema-mcp.service; ls -ld /srv/sema/site"
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
Crea backup remoto y publica los archivos estáticos:
|
|
239
|
-
|
|
240
|
-
```powershell
|
|
241
|
-
$stamp = Get-Date -Format "yyyyMMdd-HHmmss"
|
|
242
|
-
ssh sema-vps "mkdir -p /srv/sema/backups/site-$stamp && cp -a /srv/sema/site/. /srv/sema/backups/site-$stamp/"
|
|
243
|
-
scp -r site\sema\* sema-vps:/srv/sema/site/
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
Valida después del despliegue:
|
|
247
|
-
|
|
248
|
-
```powershell
|
|
249
|
-
curl.exe -k -fsS https://sema.otimitare.online/healthz
|
|
250
|
-
curl.exe -k -fsS https://sema.otimitare.online/painel.html
|
|
251
|
-
curl.exe -k -fsS -D - https://sema.otimitare.online/mcp -o NUL
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
Resultado esperado:
|
|
255
|
-
|
|
256
|
-
- `/healthz` responde saludable.
|
|
257
|
-
- `/painel.html` sirve el panel estático actual.
|
|
258
|
-
- `/mcp` sin token no expone datos; debe devolver desafío de autenticación o no autorizado.
|