@semacode/cli 1.5.28 → 1.5.30
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 +144 -144
- package/dist/bridge.d.ts +52 -0
- package/dist/bridge.js +318 -0
- package/dist/bridge.js.map +1 -0
- package/dist/comandos.d.ts +11 -0
- package/dist/comandos.js +146 -0
- package/dist/comandos.js.map +1 -0
- package/dist/contexto.d.ts +34 -0
- package/dist/contexto.js +197 -0
- package/dist/contexto.js.map +1 -0
- package/dist/drift.d.ts +1 -1
- package/dist/drift.js +32 -5
- package/dist/drift.js.map +1 -1
- package/dist/guard.d.ts +35 -0
- package/dist/guard.js +164 -0
- package/dist/guard.js.map +1 -0
- package/dist/index.js +391 -64
- package/dist/index.js.map +1 -1
- package/dist/lua-symbols.d.ts +0 -6
- package/dist/lua-symbols.js +11 -78
- package/dist/lua-symbols.js.map +1 -1
- package/dist/projeto.js +6 -0
- package/dist/projeto.js.map +1 -1
- package/dist/tipos.d.ts +1 -1
- package/exemplos/.prepack-generated +1 -0
- package/exemplos/author_obra_comum.sema +294 -294
- package/exemplos/author_tema_sensivel.sema +264 -264
- package/exemplos/profile_game.sema +114 -114
- package/exemplos/profile_legal.sema +105 -105
- package/exemplos/profile_ops.sema +110 -110
- package/exemplos/profile_research.sema +104 -104
- package/exemplos/profile_software.sema +123 -123
- package/exemplos/profile_workflow_n8n.sema +99 -99
- package/node_modules/@sema/gerador-css/package.json +14 -7
- package/node_modules/@sema/gerador-css/src/index.ts +605 -0
- package/node_modules/@sema/gerador-css/tsconfig.json +13 -0
- package/node_modules/@sema/gerador-css/tsconfig.tsbuildinfo +1 -0
- package/node_modules/@sema/gerador-dart/package.json +14 -7
- package/node_modules/@sema/gerador-dart/src/index.ts +52 -0
- package/node_modules/@sema/gerador-dart/tsconfig.json +13 -0
- package/node_modules/@sema/gerador-dart/tsconfig.tsbuildinfo +1 -0
- package/node_modules/@sema/gerador-html/package.json +14 -7
- package/node_modules/@sema/gerador-html/src/index.ts +185 -0
- package/node_modules/@sema/gerador-html/tsconfig.json +13 -0
- package/node_modules/@sema/gerador-html/tsconfig.tsbuildinfo +1 -0
- package/node_modules/@sema/gerador-javascript/package.json +14 -7
- package/node_modules/@sema/gerador-javascript/src/index.ts +461 -0
- package/node_modules/@sema/gerador-javascript/tsconfig.json +13 -0
- package/node_modules/@sema/gerador-javascript/tsconfig.tsbuildinfo +1 -0
- package/node_modules/@sema/gerador-lua/package.json +14 -7
- package/node_modules/@sema/gerador-lua/src/index.ts +359 -0
- package/node_modules/@sema/gerador-lua/tsconfig.json +13 -0
- package/node_modules/@sema/gerador-lua/tsconfig.tsbuildinfo +1 -0
- package/node_modules/@sema/gerador-python/package.json +14 -7
- package/node_modules/@sema/gerador-python/src/index.ts +850 -0
- package/node_modules/@sema/gerador-python/tsconfig.json +13 -0
- package/node_modules/@sema/gerador-python/tsconfig.tsbuildinfo +1 -0
- package/node_modules/@sema/gerador-typescript/package.json +14 -7
- package/node_modules/@sema/gerador-typescript/src/index.ts +876 -0
- package/node_modules/@sema/gerador-typescript/tsconfig.json +13 -0
- package/node_modules/@sema/gerador-typescript/tsconfig.tsbuildinfo +1 -0
- package/node_modules/@sema/nucleo/dist/ast/tipos.d.ts +1 -1
- package/node_modules/@sema/nucleo/dist/index.d.ts +17 -0
- package/node_modules/@sema/nucleo/dist/index.js +28 -0
- package/node_modules/@sema/nucleo/dist/index.js.map +1 -1
- package/node_modules/@sema/nucleo/dist/ir/conversor.js +4 -0
- package/node_modules/@sema/nucleo/dist/ir/conversor.js.map +1 -1
- package/node_modules/@sema/nucleo/dist/ir/modelos.d.ts +3 -3
- package/node_modules/@sema/nucleo/dist/parser/parser.js +2 -0
- package/node_modules/@sema/nucleo/dist/parser/parser.js.map +1 -1
- package/node_modules/@sema/nucleo/dist/semantico/analisador.d.ts +2 -2
- package/node_modules/@sema/nucleo/dist/semantico/analisador.js +3 -1
- package/node_modules/@sema/nucleo/dist/semantico/analisador.js.map +1 -1
- package/node_modules/@sema/nucleo/package.json +10 -7
- package/node_modules/@sema/nucleo/src/ast/tipos.ts +207 -0
- package/node_modules/@sema/nucleo/src/diagnosticos/index.ts +43 -0
- package/node_modules/@sema/nucleo/src/formatador/index.ts +530 -0
- package/node_modules/@sema/nucleo/src/index.ts +183 -0
- package/node_modules/@sema/nucleo/src/ir/conversor.ts +1037 -0
- package/node_modules/@sema/nucleo/src/ir/modelos.ts +403 -0
- package/node_modules/@sema/nucleo/src/lexer/lexer.ts +166 -0
- package/node_modules/@sema/nucleo/src/lexer/tokens.ts +79 -0
- package/node_modules/@sema/nucleo/src/parser/gramatica.ebnf +41 -0
- package/node_modules/@sema/nucleo/src/parser/parser.ts +936 -0
- package/node_modules/@sema/nucleo/src/persistencia/contratos.ts +379 -0
- package/node_modules/@sema/nucleo/src/semantico/analisador.ts +3126 -0
- package/node_modules/@sema/nucleo/src/semantico/estruturas.ts +665 -0
- package/node_modules/@sema/nucleo/src/semantico/seguranca.ts +362 -0
- package/node_modules/@sema/nucleo/src/util/arquivos.ts +28 -0
- package/node_modules/@sema/nucleo/tsconfig.json +9 -0
- package/node_modules/@sema/nucleo/tsconfig.tsbuildinfo +1 -0
- package/node_modules/@sema/padroes/package.json +10 -7
- package/node_modules/@sema/padroes/src/index.ts +382 -0
- package/node_modules/@sema/padroes/tsconfig.json +9 -0
- package/node_modules/@sema/padroes/tsconfig.tsbuildinfo +1 -0
- package/package.json +74 -74
- package/AGENTS.md +0 -280
- package/LICENSE +0 -22
- package/SEMA_BRIEF.curto.txt +0 -11
- package/SEMA_BRIEF.md +0 -112
- package/SEMA_BRIEF.micro.txt +0 -9
- package/SEMA_INDEX.json +0 -1534
- package/dist/php-symbols.d.ts +0 -24
- package/dist/php-symbols.js +0 -375
- package/dist/php-symbols.js.map +0 -1
- package/docs/AGENT_STARTER.md +0 -109
- package/docs/cli.md +0 -175
- package/docs/como-ensinar-a-sema-para-ia.md +0 -155
- package/docs/deploy.md +0 -93
- package/docs/documentacao.md +0 -88
- package/docs/env.md +0 -105
- package/docs/extensao-vscode.md +0 -53
- package/docs/fluxo-pratico-ia-sema.md +0 -187
- package/docs/instalacao-e-primeiro-uso.md +0 -134
- package/docs/integracao-com-ia.md +0 -110
- package/docs/mcp.md +0 -292
- package/docs/pagamento-ponta-a-ponta.md +0 -171
- package/docs/persistencia-vendor-first.md +0 -151
- package/docs/prompt-base-ia-sema.md +0 -111
- package/docs/repositories.md +0 -54
- package/docs/rollback.md +0 -49
- package/docs/seguranca.md +0 -126
- package/docs/sintaxe.md +0 -218
- package/llms-full.txt +0 -34
- package/llms.txt +0 -17
package/README.md
CHANGED
|
@@ -1,144 +1,144 @@
|
|
|
1
|
-
# @semacode/cli
|
|
2
|
-
|
|
3
|
-
## English
|
|
4
|
-
|
|
5
|
-
`@semacode/cli` is the public Sema command-line package published on npm.
|
|
6
|
-
|
|
7
|
-
It validates `.sema` contracts, checks semantic drift against live code, maps impact, prepares AI-first context, enforces documentation gates, and validates the official Sema profiles: Software, Workflow/Ops, Author, Game, Legal, and Research.
|
|
8
|
-
|
|
9
|
-
Current public version: `1.5.
|
|
10
|
-
|
|
11
|
-
### Install
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
npm install -g @semacode/cli
|
|
15
|
-
sema --version
|
|
16
|
-
sema doctor
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
### Core Flow
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
sema iniciar
|
|
23
|
-
sema validar contratos/pedidos.sema --json
|
|
24
|
-
sema drift contratos/pedidos.sema --escopo modulo --json
|
|
25
|
-
sema impacto contratos/pedidos.sema --alvo pedido_id --mudanca "replace pedido_id with pedido_uuid" --json
|
|
26
|
-
sema docs-impacto --intencao "alterar pedidos" --arquivo contratos/pedidos.sema --json
|
|
27
|
-
sema finalizar-mudanca --intencao "alterar pedidos" --doc-lida README.md --json
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
### MCP Client Key
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
printf '%s' 'sema_mcp_...' | sema mcp-instalar-chave --stdin --json
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
The command stores the commercial MCP key in the local user environment as `SEMA_MCP_AUTH_TOKEN` without receiving the secret as a CLI argument.
|
|
37
|
-
|
|
38
|
-
### Common Commands
|
|
39
|
-
|
|
40
|
-
- `sema validar <arquivo-ou-pasta> --json`
|
|
41
|
-
- `sema drift <arquivo-ou-pasta> --json`
|
|
42
|
-
- `sema resumo <arquivo-ou-pasta> --micro --para onboarding`
|
|
43
|
-
- `sema contexto-ia <arquivo.sema> --saida <diretorio> --json`
|
|
44
|
-
- `sema author briefing <arquivo.sema> --json`
|
|
45
|
-
- `sema author revisar-cliches <arquivo.sema> --texto <texto> --json`
|
|
46
|
-
- `sema author validar-narrativa <arquivo.sema> --texto <texto> [--texto-anterior <texto>] --json`
|
|
47
|
-
- `sema profile validar <software|workflow|ops|game|legal|research> <arquivo.sema> --json`
|
|
48
|
-
|
|
49
|
-
## Português
|
|
50
|
-
|
|
51
|
-
`@semacode/cli` é o pacote público de linha de comando da Sema publicado no npm.
|
|
52
|
-
|
|
53
|
-
Ele valida contratos `.sema`, verifica drift semântico contra código vivo, mapeia impacto, prepara contexto IA-first, aplica gates de documentação e valida os profiles oficiais da Sema: Software, Workflow/Ops, Author, Game, Legal e Research.
|
|
54
|
-
|
|
55
|
-
Versão pública atual: `1.5.
|
|
56
|
-
|
|
57
|
-
### Instalar
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
npm install -g @semacode/cli
|
|
61
|
-
sema --version
|
|
62
|
-
sema doctor
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### Fluxo Central
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
sema iniciar
|
|
69
|
-
sema validar contratos/pedidos.sema --json
|
|
70
|
-
sema drift contratos/pedidos.sema --escopo modulo --json
|
|
71
|
-
sema impacto contratos/pedidos.sema --alvo pedido_id --mudanca "trocar pedido_id por pedido_uuid" --json
|
|
72
|
-
sema docs-impacto --intencao "alterar pedidos" --arquivo contratos/pedidos.sema --json
|
|
73
|
-
sema finalizar-mudanca --intencao "alterar pedidos" --doc-lida README.md --json
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
### Chave MCP Do Cliente
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
printf '%s' 'sema_mcp_...' | sema mcp-instalar-chave --stdin --json
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
O comando grava a chave MCP comercial no ambiente local do usuário como `SEMA_MCP_AUTH_TOKEN`, sem receber o segredo como argumento da CLI.
|
|
83
|
-
|
|
84
|
-
### Comandos Comuns
|
|
85
|
-
|
|
86
|
-
- `sema validar <arquivo-ou-pasta> --json`
|
|
87
|
-
- `sema drift <arquivo-ou-pasta> --json`
|
|
88
|
-
- `sema resumo <arquivo-ou-pasta> --micro --para onboarding`
|
|
89
|
-
- `sema contexto-ia <arquivo.sema> --saida <diretorio> --json`
|
|
90
|
-
- `sema author briefing <arquivo.sema> --json`
|
|
91
|
-
- `sema author revisar-cliches <arquivo.sema> --texto <texto> --json`
|
|
92
|
-
- `sema author validar-narrativa <arquivo.sema> --texto <texto> [--texto-anterior <texto>] --json`
|
|
93
|
-
- `sema profile validar <software|workflow|ops|game|legal|research> <arquivo.sema> --json`
|
|
94
|
-
|
|
95
|
-
## Español
|
|
96
|
-
|
|
97
|
-
`@semacode/cli` es el paquete público de línea de comando de Sema publicado en npm.
|
|
98
|
-
|
|
99
|
-
Valida contratos `.sema`, verifica drift semántico contra código vivo, mapea impacto, prepara contexto IA-first, aplica gates de documentación y valida los profiles oficiales de Sema: Software, Workflow/Ops, Author, Game, Legal y Research.
|
|
100
|
-
|
|
101
|
-
Versión pública actual: `1.5.
|
|
102
|
-
|
|
103
|
-
### Instalar
|
|
104
|
-
|
|
105
|
-
```bash
|
|
106
|
-
npm install -g @semacode/cli
|
|
107
|
-
sema --version
|
|
108
|
-
sema doctor
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
### Flujo Central
|
|
112
|
-
|
|
113
|
-
```bash
|
|
114
|
-
sema iniciar
|
|
115
|
-
sema validar contratos/pedidos.sema --json
|
|
116
|
-
sema drift contratos/pedidos.sema --escopo modulo --json
|
|
117
|
-
sema impacto contratos/pedidos.sema --alvo pedido_id --mudanca "cambiar pedido_id por pedido_uuid" --json
|
|
118
|
-
sema docs-impacto --intencao "alterar pedidos" --arquivo contratos/pedidos.sema --json
|
|
119
|
-
sema finalizar-mudanca --intencao "alterar pedidos" --doc-lida README.md --json
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### Clave MCP Del Cliente
|
|
123
|
-
|
|
124
|
-
```bash
|
|
125
|
-
printf '%s' 'sema_mcp_...' | sema mcp-instalar-chave --stdin --json
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
El comando guarda la clave MCP comercial en el entorno local del usuario como `SEMA_MCP_AUTH_TOKEN`, sin recibir el secreto como argumento de la CLI.
|
|
129
|
-
|
|
130
|
-
### Comandos Comunes
|
|
131
|
-
|
|
132
|
-
- `sema validar <arquivo-ou-pasta> --json`
|
|
133
|
-
- `sema drift <arquivo-ou-pasta> --json`
|
|
134
|
-
- `sema resumo <arquivo-ou-pasta> --micro --para onboarding`
|
|
135
|
-
- `sema contexto-ia <arquivo.sema> --saida <diretorio> --json`
|
|
136
|
-
- `sema author briefing <arquivo.sema> --json`
|
|
137
|
-
- `sema author revisar-cliches <arquivo.sema> --texto <texto> --json`
|
|
138
|
-
- `sema author validar-narrativa <arquivo.sema> --texto <texto> [--texto-anterior <texto>] --json`
|
|
139
|
-
- `sema profile validar <software|workflow|ops|game|legal|research> <arquivo.sema> --json`
|
|
140
|
-
|
|
141
|
-
## Links
|
|
142
|
-
|
|
143
|
-
- Repository: <https://github.com/gerlanss/Sema>
|
|
144
|
-
- Documentation: <https://github.com/gerlanss/Sema/tree/main/docs>
|
|
1
|
+
# @semacode/cli
|
|
2
|
+
|
|
3
|
+
## English
|
|
4
|
+
|
|
5
|
+
`@semacode/cli` is the public Sema command-line package published on npm.
|
|
6
|
+
|
|
7
|
+
It validates `.sema` contracts, checks semantic drift against live code, maps impact, prepares AI-first context, enforces documentation gates, and validates the official Sema profiles: Software, Workflow/Ops, Author, Game, Legal, and Research.
|
|
8
|
+
|
|
9
|
+
Current public version: `1.5.29`.
|
|
10
|
+
|
|
11
|
+
### Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install -g @semacode/cli
|
|
15
|
+
sema --version
|
|
16
|
+
sema doctor
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Core Flow
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
sema iniciar
|
|
23
|
+
sema validar contratos/pedidos.sema --json
|
|
24
|
+
sema drift contratos/pedidos.sema --escopo modulo --json
|
|
25
|
+
sema impacto contratos/pedidos.sema --alvo pedido_id --mudanca "replace pedido_id with pedido_uuid" --json
|
|
26
|
+
sema docs-impacto --intencao "alterar pedidos" --arquivo contratos/pedidos.sema --json
|
|
27
|
+
sema finalizar-mudanca --intencao "alterar pedidos" --doc-lida README.md --json
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### MCP Client Key
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
printf '%s' 'sema_mcp_...' | sema mcp-instalar-chave --stdin --json
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The command stores the commercial MCP key in the local user environment as `SEMA_MCP_AUTH_TOKEN` without receiving the secret as a CLI argument.
|
|
37
|
+
|
|
38
|
+
### Common Commands
|
|
39
|
+
|
|
40
|
+
- `sema validar <arquivo-ou-pasta> --json`
|
|
41
|
+
- `sema drift <arquivo-ou-pasta> --json`
|
|
42
|
+
- `sema resumo <arquivo-ou-pasta> --micro --para onboarding`
|
|
43
|
+
- `sema contexto-ia <arquivo.sema> --saida <diretorio> --json`
|
|
44
|
+
- `sema author briefing <arquivo.sema> --json`
|
|
45
|
+
- `sema author revisar-cliches <arquivo.sema> --texto <texto> --json`
|
|
46
|
+
- `sema author validar-narrativa <arquivo.sema> --texto <texto> [--texto-anterior <texto>] --json`
|
|
47
|
+
- `sema profile validar <software|workflow|ops|game|legal|research> <arquivo.sema> --json`
|
|
48
|
+
|
|
49
|
+
## Português
|
|
50
|
+
|
|
51
|
+
`@semacode/cli` é o pacote público de linha de comando da Sema publicado no npm.
|
|
52
|
+
|
|
53
|
+
Ele valida contratos `.sema`, verifica drift semântico contra código vivo, mapeia impacto, prepara contexto IA-first, aplica gates de documentação e valida os profiles oficiais da Sema: Software, Workflow/Ops, Author, Game, Legal e Research.
|
|
54
|
+
|
|
55
|
+
Versão pública atual: `1.5.29`.
|
|
56
|
+
|
|
57
|
+
### Instalar
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npm install -g @semacode/cli
|
|
61
|
+
sema --version
|
|
62
|
+
sema doctor
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Fluxo Central
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
sema iniciar
|
|
69
|
+
sema validar contratos/pedidos.sema --json
|
|
70
|
+
sema drift contratos/pedidos.sema --escopo modulo --json
|
|
71
|
+
sema impacto contratos/pedidos.sema --alvo pedido_id --mudanca "trocar pedido_id por pedido_uuid" --json
|
|
72
|
+
sema docs-impacto --intencao "alterar pedidos" --arquivo contratos/pedidos.sema --json
|
|
73
|
+
sema finalizar-mudanca --intencao "alterar pedidos" --doc-lida README.md --json
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Chave MCP Do Cliente
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
printf '%s' 'sema_mcp_...' | sema mcp-instalar-chave --stdin --json
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
O comando grava a chave MCP comercial no ambiente local do usuário como `SEMA_MCP_AUTH_TOKEN`, sem receber o segredo como argumento da CLI.
|
|
83
|
+
|
|
84
|
+
### Comandos Comuns
|
|
85
|
+
|
|
86
|
+
- `sema validar <arquivo-ou-pasta> --json`
|
|
87
|
+
- `sema drift <arquivo-ou-pasta> --json`
|
|
88
|
+
- `sema resumo <arquivo-ou-pasta> --micro --para onboarding`
|
|
89
|
+
- `sema contexto-ia <arquivo.sema> --saida <diretorio> --json`
|
|
90
|
+
- `sema author briefing <arquivo.sema> --json`
|
|
91
|
+
- `sema author revisar-cliches <arquivo.sema> --texto <texto> --json`
|
|
92
|
+
- `sema author validar-narrativa <arquivo.sema> --texto <texto> [--texto-anterior <texto>] --json`
|
|
93
|
+
- `sema profile validar <software|workflow|ops|game|legal|research> <arquivo.sema> --json`
|
|
94
|
+
|
|
95
|
+
## Español
|
|
96
|
+
|
|
97
|
+
`@semacode/cli` es el paquete público de línea de comando de Sema publicado en npm.
|
|
98
|
+
|
|
99
|
+
Valida contratos `.sema`, verifica drift semántico contra código vivo, mapea impacto, prepara contexto IA-first, aplica gates de documentación y valida los profiles oficiales de Sema: Software, Workflow/Ops, Author, Game, Legal y Research.
|
|
100
|
+
|
|
101
|
+
Versión pública actual: `1.5.29`.
|
|
102
|
+
|
|
103
|
+
### Instalar
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
npm install -g @semacode/cli
|
|
107
|
+
sema --version
|
|
108
|
+
sema doctor
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Flujo Central
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
sema iniciar
|
|
115
|
+
sema validar contratos/pedidos.sema --json
|
|
116
|
+
sema drift contratos/pedidos.sema --escopo modulo --json
|
|
117
|
+
sema impacto contratos/pedidos.sema --alvo pedido_id --mudanca "cambiar pedido_id por pedido_uuid" --json
|
|
118
|
+
sema docs-impacto --intencao "alterar pedidos" --arquivo contratos/pedidos.sema --json
|
|
119
|
+
sema finalizar-mudanca --intencao "alterar pedidos" --doc-lida README.md --json
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Clave MCP Del Cliente
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
printf '%s' 'sema_mcp_...' | sema mcp-instalar-chave --stdin --json
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
El comando guarda la clave MCP comercial en el entorno local del usuario como `SEMA_MCP_AUTH_TOKEN`, sin recibir el secreto como argumento de la CLI.
|
|
129
|
+
|
|
130
|
+
### Comandos Comunes
|
|
131
|
+
|
|
132
|
+
- `sema validar <arquivo-ou-pasta> --json`
|
|
133
|
+
- `sema drift <arquivo-ou-pasta> --json`
|
|
134
|
+
- `sema resumo <arquivo-ou-pasta> --micro --para onboarding`
|
|
135
|
+
- `sema contexto-ia <arquivo.sema> --saida <diretorio> --json`
|
|
136
|
+
- `sema author briefing <arquivo.sema> --json`
|
|
137
|
+
- `sema author revisar-cliches <arquivo.sema> --texto <texto> --json`
|
|
138
|
+
- `sema author validar-narrativa <arquivo.sema> --texto <texto> [--texto-anterior <texto>] --json`
|
|
139
|
+
- `sema profile validar <software|workflow|ops|game|legal|research> <arquivo.sema> --json`
|
|
140
|
+
|
|
141
|
+
## Links
|
|
142
|
+
|
|
143
|
+
- Repository: <https://github.com/gerlanss/Sema>
|
|
144
|
+
- Documentation: <https://github.com/gerlanss/Sema/tree/main/docs>
|
package/dist/bridge.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bridge CLI local -> MCP remoto.
|
|
3
|
+
*
|
|
4
|
+
* Transporte inteligente: a CLI pública lê disco local, o MCP remoto privado
|
|
5
|
+
* governa profiles e pipelines credit-gated. Mesmo endpoint atende CLI local
|
|
6
|
+
* (HTTP autenticado) e chats web (sync inline).
|
|
7
|
+
*
|
|
8
|
+
* Contrato: contratos/sema/mcp_client_bridge.sema
|
|
9
|
+
*/
|
|
10
|
+
export type ModoTransporte = "CLI_LOCAL" | "CHAT_WEB" | "API_DIRETA";
|
|
11
|
+
export type StatusBridge = "NAO_CONFIGURADO" | "AUTENTICADO" | "CREDITOS_INSUFICIENTES" | "OPERACIONAL" | "BLOQUEADO";
|
|
12
|
+
export interface SessaoBridge {
|
|
13
|
+
id: string;
|
|
14
|
+
endpointMcp: string;
|
|
15
|
+
modo: ModoTransporte;
|
|
16
|
+
status: StatusBridge;
|
|
17
|
+
creditosRestantes: number;
|
|
18
|
+
ultimoPing: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ConfigBridgeLocal {
|
|
21
|
+
endpointMcp: string;
|
|
22
|
+
token: string;
|
|
23
|
+
persistir: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface BridgeEntrada {
|
|
26
|
+
contratos: string[];
|
|
27
|
+
codigoSelecionado?: string[];
|
|
28
|
+
intencao: string;
|
|
29
|
+
endpointMcp: string;
|
|
30
|
+
token: string;
|
|
31
|
+
modo: ModoTransporte;
|
|
32
|
+
}
|
|
33
|
+
export interface BridgeResultado {
|
|
34
|
+
sessao: SessaoBridge;
|
|
35
|
+
diagnosticosRemotos: unknown[];
|
|
36
|
+
perfisAplicaveis: string[];
|
|
37
|
+
proximoPasso: string;
|
|
38
|
+
creditosConsumidos: number;
|
|
39
|
+
erro?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface BridgeConfigResultado {
|
|
42
|
+
configurado: boolean;
|
|
43
|
+
sessaoTeste: SessaoBridge;
|
|
44
|
+
status: StatusBridge;
|
|
45
|
+
erro?: string;
|
|
46
|
+
}
|
|
47
|
+
export declare function operarBridgeCliParaMcp(entrada: BridgeEntrada): Promise<BridgeResultado>;
|
|
48
|
+
export declare function configurarBridgeLocal(config: ConfigBridgeLocal): Promise<BridgeConfigResultado>;
|
|
49
|
+
export declare function obterTokenMcpAmbiente(): {
|
|
50
|
+
token: string;
|
|
51
|
+
endpoint: string;
|
|
52
|
+
};
|
package/dist/bridge.js
ADDED
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bridge CLI local -> MCP remoto.
|
|
3
|
+
*
|
|
4
|
+
* Transporte inteligente: a CLI pública lê disco local, o MCP remoto privado
|
|
5
|
+
* governa profiles e pipelines credit-gated. Mesmo endpoint atende CLI local
|
|
6
|
+
* (HTTP autenticado) e chats web (sync inline).
|
|
7
|
+
*
|
|
8
|
+
* Contrato: contratos/sema/mcp_client_bridge.sema
|
|
9
|
+
*/
|
|
10
|
+
import { sincronizarContratosRemotos, } from "./mcpRemoto.js";
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
// Constantes
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
const MCP_TOKEN_ENV = "SEMA_MCP_AUTH_TOKEN";
|
|
15
|
+
const MCP_ENDPOINT_ENV = "SEMA_MCP_ENDPOINT";
|
|
16
|
+
const MCP_ENDPOINT_PADRAO = "https://sema.otimitare.online/mcp";
|
|
17
|
+
const TIMEOUT_MCP_MS = 30_000;
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
// Helpers
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
function prefixoSeguroToken(token) {
|
|
22
|
+
return token.slice(0, Math.min(14, token.length));
|
|
23
|
+
}
|
|
24
|
+
function gerarIdSessao() {
|
|
25
|
+
return `sema-bridge-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
|
|
26
|
+
}
|
|
27
|
+
function tokenEhValido(token) {
|
|
28
|
+
return /^sema_mcp_[A-Za-z0-9_-]{16,}$/.test(token) || token.length >= 20;
|
|
29
|
+
}
|
|
30
|
+
function endpointEhValido(endpoint) {
|
|
31
|
+
try {
|
|
32
|
+
const url = new URL(endpoint);
|
|
33
|
+
return url.protocol === "https:";
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
// ---------------------------------------------------------------------------
|
|
40
|
+
// Filtro de segredos (reutiliza padrões do mcpRemoto.ts)
|
|
41
|
+
// ---------------------------------------------------------------------------
|
|
42
|
+
const PADROES_CONTEUDO_SENSIVEL_BRIDGE = [
|
|
43
|
+
/\b(?:api[_-]?key|secret|token|password|senha)\s*[:=]\s*["']?[A-Za-z0-9_\-]{16,}/i,
|
|
44
|
+
/\bsk-[A-Za-z0-9_\-]{20,}\b/,
|
|
45
|
+
/\beyJ[A-Za-z0-9_\-]+\.[A-Za-z0-9_\-]+\.[A-Za-z0-9_\-]+\b/,
|
|
46
|
+
];
|
|
47
|
+
const PADROES_CAMINHO_SENSIVEL_BRIDGE = [
|
|
48
|
+
/(^|[\\/])\.env(?:\.|$)/i,
|
|
49
|
+
/(^|[\\/])node_modules([\\/]|$)/i,
|
|
50
|
+
/(^|[\\/])(?:secrets?|credentials?|tokens?)(?:[\\/]|\.|$)/i,
|
|
51
|
+
];
|
|
52
|
+
function conteudoTemSegredo(conteudo) {
|
|
53
|
+
return PADROES_CONTEUDO_SENSIVEL_BRIDGE.some((p) => p.test(conteudo));
|
|
54
|
+
}
|
|
55
|
+
function caminhoEhSensivel(caminho) {
|
|
56
|
+
return PADROES_CAMINHO_SENSIVEL_BRIDGE.some((p) => p.test(caminho));
|
|
57
|
+
}
|
|
58
|
+
// ---------------------------------------------------------------------------
|
|
59
|
+
// Operar bridge CLI -> MCP
|
|
60
|
+
// ---------------------------------------------------------------------------
|
|
61
|
+
export async function operarBridgeCliParaMcp(entrada) {
|
|
62
|
+
const inicio = Date.now();
|
|
63
|
+
const id = gerarIdSessao();
|
|
64
|
+
// Validações básicas
|
|
65
|
+
if (!entrada.contratos || entrada.contratos.length === 0) {
|
|
66
|
+
return {
|
|
67
|
+
sessao: criarSessaoVazia(id, entrada),
|
|
68
|
+
diagnosticosRemotos: [],
|
|
69
|
+
perfisAplicaveis: [],
|
|
70
|
+
proximoPasso: "fornecer_contratos",
|
|
71
|
+
creditosConsumidos: 0,
|
|
72
|
+
erro: "Nenhum contrato informado.",
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
if (!endpointEhValido(entrada.endpointMcp)) {
|
|
76
|
+
return {
|
|
77
|
+
sessao: criarSessaoVazia(id, entrada),
|
|
78
|
+
diagnosticosRemotos: [],
|
|
79
|
+
perfisAplicaveis: [],
|
|
80
|
+
proximoPasso: "corrigir_endpoint",
|
|
81
|
+
creditosConsumidos: 0,
|
|
82
|
+
erro: "Endpoint MCP inválido. Use HTTPS.",
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
if (!tokenEhValido(entrada.token)) {
|
|
86
|
+
return {
|
|
87
|
+
sessao: criarSessaoVazia(id, entrada),
|
|
88
|
+
diagnosticosRemotos: [],
|
|
89
|
+
perfisAplicaveis: [],
|
|
90
|
+
proximoPasso: "corrigir_token",
|
|
91
|
+
creditosConsumidos: 0,
|
|
92
|
+
erro: "Token MCP inválido.",
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
// Filtrar segredos do código selecionado
|
|
96
|
+
const codigoFiltrado = (entrada.codigoSelecionado ?? []).filter((c) => {
|
|
97
|
+
if (caminhoEhSensivel(c))
|
|
98
|
+
return false;
|
|
99
|
+
return true;
|
|
100
|
+
});
|
|
101
|
+
if (codigoFiltrado.length < (entrada.codigoSelecionado ?? []).length) {
|
|
102
|
+
return {
|
|
103
|
+
sessao: criarSessaoVazia(id, entrada),
|
|
104
|
+
diagnosticosRemotos: [],
|
|
105
|
+
perfisAplicaveis: [],
|
|
106
|
+
proximoPasso: "remover_segredos",
|
|
107
|
+
creditosConsumidos: 0,
|
|
108
|
+
erro: "segredo_detectado: Snapshot contém arquivo sensível. Remova antes de enviar.",
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
// Construir snapshot para o MCP remoto
|
|
112
|
+
const snapshot = {
|
|
113
|
+
contratos: entrada.contratos.map((c) => ({ caminho: c })),
|
|
114
|
+
arquivosCodigo: codigoFiltrado.map((c) => ({ caminho: c })),
|
|
115
|
+
};
|
|
116
|
+
// Validar snapshot localmente antes de enviar
|
|
117
|
+
const validacaoLocal = sincronizarContratosRemotos(snapshot);
|
|
118
|
+
if (validacaoLocal.recusas.length > 0) {
|
|
119
|
+
return {
|
|
120
|
+
sessao: criarSessaoVazia(id, entrada),
|
|
121
|
+
diagnosticosRemotos: [],
|
|
122
|
+
perfisAplicaveis: [],
|
|
123
|
+
proximoPasso: "remover_segredos",
|
|
124
|
+
creditosConsumidos: 0,
|
|
125
|
+
erro: `segredo_detectado: ${validacaoLocal.recusas.join(", ")}`,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
// Enviar ao MCP remoto
|
|
129
|
+
try {
|
|
130
|
+
const resposta = await fetch(entrada.endpointMcp, {
|
|
131
|
+
method: "POST",
|
|
132
|
+
headers: {
|
|
133
|
+
"Content-Type": "application/json",
|
|
134
|
+
Authorization: `Bearer ${entrada.token}`,
|
|
135
|
+
"x-sema-bridge-intent": entrada.intencao,
|
|
136
|
+
"x-sema-bridge-mode": entrada.modo,
|
|
137
|
+
},
|
|
138
|
+
body: JSON.stringify({
|
|
139
|
+
metodo: "tools/call",
|
|
140
|
+
params: {
|
|
141
|
+
name: "sema_contratos_sincronizar",
|
|
142
|
+
arguments: {
|
|
143
|
+
projeto_id: `bridge-${id}`,
|
|
144
|
+
nome_projeto: "bridge-cli-local",
|
|
145
|
+
contratos: entrada.contratos.map((c) => ({ caminho: c, acao: "salvar" })),
|
|
146
|
+
arquivos_codigo: codigoFiltrado.map((c) => ({ caminho: c, acao: "salvar" })),
|
|
147
|
+
validar: true,
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
}),
|
|
151
|
+
signal: AbortSignal.timeout(TIMEOUT_MCP_MS),
|
|
152
|
+
});
|
|
153
|
+
if (!resposta.ok) {
|
|
154
|
+
if (resposta.status === 401 || resposta.status === 403) {
|
|
155
|
+
return {
|
|
156
|
+
sessao: criarSessao(id, entrada, "BLOQUEADO"),
|
|
157
|
+
diagnosticosRemotos: [],
|
|
158
|
+
perfisAplicaveis: [],
|
|
159
|
+
proximoPasso: "verificar_token",
|
|
160
|
+
creditosConsumidos: 0,
|
|
161
|
+
erro: "token_invalido: Token MCP inválido ou expirado.",
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
if (resposta.status === 402) {
|
|
165
|
+
return {
|
|
166
|
+
sessao: criarSessao(id, entrada, "CREDITOS_INSUFICIENTES"),
|
|
167
|
+
diagnosticosRemotos: [],
|
|
168
|
+
perfisAplicaveis: [],
|
|
169
|
+
proximoPasso: "recarregar_creditos",
|
|
170
|
+
creditosConsumidos: 0,
|
|
171
|
+
erro: "sem_creditos: Créditos Sema insuficientes.",
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
const payload = (await resposta.json());
|
|
176
|
+
return {
|
|
177
|
+
sessao: criarSessao(id, entrada, "OPERACIONAL"),
|
|
178
|
+
diagnosticosRemotos: payload.validacoes ?? [],
|
|
179
|
+
perfisAplicaveis: extrairPerfis(payload),
|
|
180
|
+
proximoPasso: "pode_chamar_profile_ou_ir",
|
|
181
|
+
creditosConsumidos: 1,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
catch (erro) {
|
|
185
|
+
const mensagem = erro instanceof Error ? erro.message : String(erro);
|
|
186
|
+
return {
|
|
187
|
+
sessao: criarSessao(id, entrada, "BLOQUEADO"),
|
|
188
|
+
diagnosticosRemotos: [],
|
|
189
|
+
perfisAplicaveis: [],
|
|
190
|
+
proximoPasso: "verificar_conectividade",
|
|
191
|
+
creditosConsumidos: 0,
|
|
192
|
+
erro: `endpoint_indisponivel: ${mensagem}`,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
// ---------------------------------------------------------------------------
|
|
197
|
+
// Configurar bridge local
|
|
198
|
+
// ---------------------------------------------------------------------------
|
|
199
|
+
export async function configurarBridgeLocal(config) {
|
|
200
|
+
if (!endpointEhValido(config.endpointMcp)) {
|
|
201
|
+
return {
|
|
202
|
+
configurado: false,
|
|
203
|
+
sessaoTeste: criarSessaoConfig("NAO_CONFIGURADO"),
|
|
204
|
+
status: "NAO_CONFIGURADO",
|
|
205
|
+
erro: "conexao_recusada: Endpoint MCP inválido.",
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
if (!tokenEhValido(config.token)) {
|
|
209
|
+
return {
|
|
210
|
+
configurado: false,
|
|
211
|
+
sessaoTeste: criarSessaoConfig("NAO_CONFIGURADO"),
|
|
212
|
+
status: "NAO_CONFIGURADO",
|
|
213
|
+
erro: "token_invalido: Token rejeitado.",
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
// Testar conexão com ping ao MCP
|
|
217
|
+
try {
|
|
218
|
+
const resposta = await fetch(`${config.endpointMcp.replace(/\/mcp$/, "")}/healthz`, {
|
|
219
|
+
headers: { Authorization: `Bearer ${config.token}` },
|
|
220
|
+
signal: AbortSignal.timeout(10_000),
|
|
221
|
+
});
|
|
222
|
+
if (!resposta.ok) {
|
|
223
|
+
return {
|
|
224
|
+
configurado: false,
|
|
225
|
+
sessaoTeste: criarSessaoConfig("BLOQUEADO"),
|
|
226
|
+
status: "BLOQUEADO",
|
|
227
|
+
erro: `token_invalido: MCP respondeu ${resposta.status}.`,
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
// Persistir config se solicitado
|
|
231
|
+
if (config.persistir && process.env.SEMA_MCP_AUTH_TOKEN === undefined) {
|
|
232
|
+
// Apenas logging — a persistência real usa `sema mcp-instalar-chave`
|
|
233
|
+
console.error(`[sema-bridge] Token prefixo ${prefixoSeguroToken(config.token)} validado. ` +
|
|
234
|
+
`Use 'sema mcp-instalar-chave --stdin' para persistir.`);
|
|
235
|
+
}
|
|
236
|
+
return {
|
|
237
|
+
configurado: true,
|
|
238
|
+
sessaoTeste: criarSessaoConfig("OPERACIONAL"),
|
|
239
|
+
status: "OPERACIONAL",
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
catch (erro) {
|
|
243
|
+
const mensagem = erro instanceof Error ? erro.message : String(erro);
|
|
244
|
+
return {
|
|
245
|
+
configurado: false,
|
|
246
|
+
sessaoTeste: criarSessaoConfig("BLOQUEADO"),
|
|
247
|
+
status: "BLOQUEADO",
|
|
248
|
+
erro: `conexao_recusada: ${mensagem}`,
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
// ---------------------------------------------------------------------------
|
|
253
|
+
// Helpers internos
|
|
254
|
+
// ---------------------------------------------------------------------------
|
|
255
|
+
function criarSessaoVazia(id, entrada) {
|
|
256
|
+
return {
|
|
257
|
+
id,
|
|
258
|
+
endpointMcp: entrada.endpointMcp,
|
|
259
|
+
modo: entrada.modo,
|
|
260
|
+
status: "NAO_CONFIGURADO",
|
|
261
|
+
creditosRestantes: 0,
|
|
262
|
+
ultimoPing: new Date().toISOString(),
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
function criarSessao(id, entrada, status) {
|
|
266
|
+
return {
|
|
267
|
+
id,
|
|
268
|
+
endpointMcp: entrada.endpointMcp,
|
|
269
|
+
modo: entrada.modo,
|
|
270
|
+
status,
|
|
271
|
+
creditosRestantes: status === "OPERACIONAL" ? 99 : 0,
|
|
272
|
+
ultimoPing: new Date().toISOString(),
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
function criarSessaoConfig(status) {
|
|
276
|
+
return {
|
|
277
|
+
id: gerarIdSessao(),
|
|
278
|
+
endpointMcp: MCP_ENDPOINT_PADRAO,
|
|
279
|
+
modo: "CLI_LOCAL",
|
|
280
|
+
status,
|
|
281
|
+
creditosRestantes: 0,
|
|
282
|
+
ultimoPing: new Date().toISOString(),
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
function extrairPerfis(payload) {
|
|
286
|
+
const perfis = [];
|
|
287
|
+
const validacoes = payload.validacoes;
|
|
288
|
+
if (validacoes) {
|
|
289
|
+
for (const v of validacoes) {
|
|
290
|
+
const saida = v.saida;
|
|
291
|
+
if (saida) {
|
|
292
|
+
try {
|
|
293
|
+
const parsed = JSON.parse(saida);
|
|
294
|
+
if (parsed.resultados) {
|
|
295
|
+
for (const r of parsed.resultados) {
|
|
296
|
+
if (r.modulo)
|
|
297
|
+
perfis.push(r.modulo);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
catch {
|
|
302
|
+
// ignora parse
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
return [...new Set(perfis)];
|
|
308
|
+
}
|
|
309
|
+
// ---------------------------------------------------------------------------
|
|
310
|
+
// Obter token do ambiente
|
|
311
|
+
// ---------------------------------------------------------------------------
|
|
312
|
+
export function obterTokenMcpAmbiente() {
|
|
313
|
+
return {
|
|
314
|
+
token: process.env[MCP_TOKEN_ENV] ?? "",
|
|
315
|
+
endpoint: process.env[MCP_ENDPOINT_ENV] ?? MCP_ENDPOINT_PADRAO,
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
//# sourceMappingURL=bridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAGL,2BAA2B,GAC5B,MAAM,gBAAgB,CAAC;AAuDxB,8EAA8E;AAC9E,aAAa;AACb,8EAA8E;AAE9E,MAAM,aAAa,GAAG,qBAAqB,CAAC;AAC5C,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AAC7C,MAAM,mBAAmB,GAAG,mCAAmC,CAAC;AAChE,MAAM,cAAc,GAAG,MAAM,CAAC;AAE9B,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E,SAAS,kBAAkB,CAAC,KAAa;IACvC,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;AACpD,CAAC;AAED,SAAS,aAAa;IACpB,OAAO,eAAe,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,IAAI,CAA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