@semacode/cli 1.4.0 → 1.5.1
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/AGENTS.md +2 -2
- package/README.md +1 -1
- package/dist/drift.d.ts +99 -3
- package/dist/drift.js +1672 -548
- package/dist/drift.js.map +1 -1
- package/dist/index.js +326 -26
- package/dist/index.js.map +1 -1
- package/docs/cli.md +1 -1
- package/docs/instalacao-e-primeiro-uso.md +7 -6
- package/docs/integracao-com-ia.md +6 -0
- package/docs/persistencia-vendor-first.md +1 -1
- 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 +11 -10
package/AGENTS.md
CHANGED
|
@@ -18,8 +18,8 @@ Pense como IA, nao como humano. Voce nao esta "programando" — esta consumindo
|
|
|
18
18
|
|
|
19
19
|
## MCP
|
|
20
20
|
|
|
21
|
-
O servidor MCP do Sema roda localmente via: npx -y @semacode/mcp
|
|
22
|
-
Use as ferramentas: sema_resumo, sema_validar, sema_drift, sema_inspecionar, sema_ir, sema_verificar, sema_contexto_ia, sema_prompt_ia.
|
|
21
|
+
O servidor MCP do Sema roda localmente via: npx -y @semacode/mcp
|
|
22
|
+
Use as ferramentas: sema_resumo, sema_validar, sema_drift, sema_impacto, sema_renomear_semantico, sema_inspecionar, sema_ir, sema_verificar, sema_contexto_ia, sema_prompt_ia.
|
|
23
23
|
|
|
24
24
|
## Contratos e exemplos
|
|
25
25
|
|
package/README.md
CHANGED
|
@@ -58,7 +58,7 @@ sema drift ./contratos-importados --json
|
|
|
58
58
|
|
|
59
59
|
## Persistencia vendor-first
|
|
60
60
|
|
|
61
|
-
A CLI 1.
|
|
61
|
+
A CLI 1.5.1 entende blocos `database` e recursos de persistencia no IR, no formatador, no semantico, na importacao, no drift, no impact map e na renomeacao semantica assistida. O objetivo nao e esconder diferencas entre bancos, e sim capturar essas diferencas no contrato.
|
|
62
62
|
|
|
63
63
|
Cobertura publica:
|
|
64
64
|
|
package/dist/drift.d.ts
CHANGED
|
@@ -11,6 +11,12 @@ interface RegistroConsumerBridgeDrift {
|
|
|
11
11
|
arquivo: string;
|
|
12
12
|
simbolo: string;
|
|
13
13
|
}
|
|
14
|
+
export type EscopoDriftReal = "arquivo" | "modulo" | "projeto";
|
|
15
|
+
export interface OpcoesDriftLegado {
|
|
16
|
+
escopo?: EscopoDriftReal;
|
|
17
|
+
ignorarWorktrees?: boolean;
|
|
18
|
+
ignorarConsumidoresLaterais?: boolean;
|
|
19
|
+
}
|
|
14
20
|
export interface DiagnosticoDrift {
|
|
15
21
|
tipo: "impl_quebrado" | "task_sem_impl" | "rota_divergente" | "recurso_divergente" | "vinculo_quebrado" | "seguranca_frouxa";
|
|
16
22
|
modulo: string;
|
|
@@ -36,8 +42,16 @@ interface RegistroRotaDivergente {
|
|
|
36
42
|
caminho?: string;
|
|
37
43
|
motivo: string;
|
|
38
44
|
}
|
|
39
|
-
type OrigemRecursoDrift = "firebase" | EngineBanco;
|
|
40
|
-
type TipoRecursoDrift = "colecao" | TipoRecursoPersistencia;
|
|
45
|
+
type OrigemRecursoDrift = "firebase" | EngineBanco | "arquivo";
|
|
46
|
+
type TipoRecursoDrift = "colecao" | TipoRecursoPersistencia | "arquivo_local";
|
|
47
|
+
type CategoriaPersistenciaDrift = "relacional" | "documental" | "chave_valor" | "local_arquivo" | "desconhecida";
|
|
48
|
+
interface RecursoResolvido {
|
|
49
|
+
origem: OrigemRecursoDrift;
|
|
50
|
+
nome: string;
|
|
51
|
+
arquivo: string;
|
|
52
|
+
simbolo?: string;
|
|
53
|
+
tipo: TipoRecursoDrift;
|
|
54
|
+
}
|
|
41
55
|
interface RegistroRecursoDrift {
|
|
42
56
|
modulo: string;
|
|
43
57
|
task: string;
|
|
@@ -48,6 +62,19 @@ interface RegistroRecursoDrift {
|
|
|
48
62
|
tipo: TipoRecursoDrift;
|
|
49
63
|
status: "resolvido" | "divergente";
|
|
50
64
|
}
|
|
65
|
+
interface RegistroColunaPersistenciaDrift {
|
|
66
|
+
origem: OrigemRecursoDrift;
|
|
67
|
+
categoriaPersistencia: CategoriaPersistenciaDrift;
|
|
68
|
+
recurso: string;
|
|
69
|
+
coluna: string;
|
|
70
|
+
arquivo: string;
|
|
71
|
+
}
|
|
72
|
+
interface RegistroRepositorioPersistenciaDrift {
|
|
73
|
+
origem: OrigemRecursoDrift;
|
|
74
|
+
categoriaPersistencia: CategoriaPersistenciaDrift;
|
|
75
|
+
recurso: string;
|
|
76
|
+
arquivo: string;
|
|
77
|
+
}
|
|
51
78
|
interface SimboloCandidatoDrift {
|
|
52
79
|
origem: "ts" | "py" | "dart" | "cs" | "java" | "go" | "rust" | "cpp";
|
|
53
80
|
caminho: string;
|
|
@@ -84,9 +111,70 @@ interface RegistroVinculoDrift {
|
|
|
84
111
|
status: "resolvido" | "parcial" | "nao_encontrado";
|
|
85
112
|
confianca: NivelConfiancaSemantica;
|
|
86
113
|
}
|
|
114
|
+
export interface RegistroPersistenciaRealDrift {
|
|
115
|
+
modulo: string;
|
|
116
|
+
task: string;
|
|
117
|
+
alvo: string;
|
|
118
|
+
engine: OrigemRecursoDrift | "desconhecido";
|
|
119
|
+
categoriaPersistencia: CategoriaPersistenciaDrift;
|
|
120
|
+
tipo: TipoRecursoDrift;
|
|
121
|
+
status: "materializado" | "parcial" | "divergente";
|
|
122
|
+
arquivos: string[];
|
|
123
|
+
colunas: string[];
|
|
124
|
+
repositorios: string[];
|
|
125
|
+
compatibilidade: "nativo" | "adaptado" | "parcial" | "invalido" | "desconhecida";
|
|
126
|
+
motivoCompatibilidade?: string;
|
|
127
|
+
}
|
|
128
|
+
export interface ConfiguracaoEscopoDriftAplicada {
|
|
129
|
+
escopo: EscopoDriftReal;
|
|
130
|
+
ignorarWorktrees: boolean;
|
|
131
|
+
ignorarConsumidoresLaterais: boolean;
|
|
132
|
+
termosEscopo: string[];
|
|
133
|
+
}
|
|
134
|
+
export interface RegistroImpactoSemanticoArquivo {
|
|
135
|
+
arquivo: string;
|
|
136
|
+
tipo: "contrato" | "persistencia" | "repositorio" | "rota" | "worker" | "ui" | "teste" | "codigo";
|
|
137
|
+
prioridade: "alta" | "media" | "baixa";
|
|
138
|
+
linhas: number[];
|
|
139
|
+
motivos: string[];
|
|
140
|
+
}
|
|
141
|
+
export interface ResultadoImpactoSemantico {
|
|
142
|
+
comando: "impacto";
|
|
143
|
+
sucesso: boolean;
|
|
144
|
+
escopo: EscopoDriftReal;
|
|
145
|
+
alvoSemantico: string;
|
|
146
|
+
mudancaProposta: string;
|
|
147
|
+
contratosAfetados: string[];
|
|
148
|
+
tasksAfetadas: string[];
|
|
149
|
+
routesAfetadas: string[];
|
|
150
|
+
superficiesAfetadas: string[];
|
|
151
|
+
persistenciaAfetada: string[];
|
|
152
|
+
arquivos: RegistroImpactoSemanticoArquivo[];
|
|
153
|
+
ordemOperacional: string[];
|
|
154
|
+
validacoes: string[];
|
|
155
|
+
}
|
|
156
|
+
export interface SugestaoRenomeacaoSemantica {
|
|
157
|
+
arquivo: string;
|
|
158
|
+
linha: number;
|
|
159
|
+
atual: string;
|
|
160
|
+
sugerido: string;
|
|
161
|
+
contexto: string;
|
|
162
|
+
}
|
|
163
|
+
export interface ResultadoRenomeacaoSemantica {
|
|
164
|
+
comando: "renomear-semantico";
|
|
165
|
+
sucesso: boolean;
|
|
166
|
+
escopo: EscopoDriftReal;
|
|
167
|
+
de: string;
|
|
168
|
+
para: string;
|
|
169
|
+
arquivos: RegistroImpactoSemanticoArquivo[];
|
|
170
|
+
sugestoes: SugestaoRenomeacaoSemantica[];
|
|
171
|
+
ordemOperacional: string[];
|
|
172
|
+
validacoes: string[];
|
|
173
|
+
}
|
|
87
174
|
export interface ResultadoDrift {
|
|
88
175
|
comando: "drift";
|
|
89
176
|
sucesso: boolean;
|
|
177
|
+
escopo_aplicado: ConfiguracaoEscopoDriftAplicada;
|
|
90
178
|
consumerFramework: ConsumerFramework | null;
|
|
91
179
|
appRoutes: string[];
|
|
92
180
|
consumerSurfaces: RegistroConsumerSurfaceDrift[];
|
|
@@ -105,6 +193,7 @@ export interface ResultadoDrift {
|
|
|
105
193
|
rotas_divergentes: RegistroRotaDivergente[];
|
|
106
194
|
recursos_validos: RegistroRecursoDrift[];
|
|
107
195
|
recursos_divergentes: RegistroRecursoDrift[];
|
|
196
|
+
persistencia_real: RegistroPersistenciaRealDrift[];
|
|
108
197
|
resumo_operacional: {
|
|
109
198
|
scoreMedio: number;
|
|
110
199
|
confiancaGeral: NivelConfiancaSemantica;
|
|
@@ -116,5 +205,12 @@ export interface ResultadoDrift {
|
|
|
116
205
|
};
|
|
117
206
|
diagnosticos: DiagnosticoDrift[];
|
|
118
207
|
}
|
|
119
|
-
|
|
208
|
+
declare function indexarPersistenciaDetalhada(diretorios: string[]): Promise<{
|
|
209
|
+
colunas: RegistroColunaPersistenciaDrift[];
|
|
210
|
+
repositorios: RegistroRepositorioPersistenciaDrift[];
|
|
211
|
+
}>;
|
|
212
|
+
export declare function analisarPersistenciaReal(contexto: ContextoProjetoCarregado, mapaRecursos?: Map<string, RecursoResolvido[]>, detalhesPersistencia?: Awaited<ReturnType<typeof indexarPersistenciaDetalhada>>, opcoes?: OpcoesDriftLegado): Promise<RegistroPersistenciaRealDrift[]>;
|
|
213
|
+
export declare function analisarDriftLegado(contexto: ContextoProjetoCarregado, opcoes?: OpcoesDriftLegado): Promise<ResultadoDrift>;
|
|
214
|
+
export declare function gerarMapaImpactoSemantico(contexto: ContextoProjetoCarregado, alvoSemantico: string, mudancaProposta: string, opcoes?: OpcoesDriftLegado): Promise<ResultadoImpactoSemantico>;
|
|
215
|
+
export declare function assistirRenomeacaoSemantica(contexto: ContextoProjetoCarregado, nomeAtual: string, nomeNovo: string, opcoes?: OpcoesDriftLegado): Promise<ResultadoRenomeacaoSemantica>;
|
|
120
216
|
export {};
|