@semacode/cli 1.4.0 → 1.5.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/AGENTS.md +2 -2
- package/README.md +1 -1
- package/dist/drift.d.ts +93 -1
- package/dist/drift.js +1376 -546
- package/dist/drift.js.map +1 -1
- package/dist/index.js +106 -9
- 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 +10 -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.0 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;
|
|
@@ -38,6 +44,13 @@ interface RegistroRotaDivergente {
|
|
|
38
44
|
}
|
|
39
45
|
type OrigemRecursoDrift = "firebase" | EngineBanco;
|
|
40
46
|
type TipoRecursoDrift = "colecao" | TipoRecursoPersistencia;
|
|
47
|
+
interface RecursoResolvido {
|
|
48
|
+
origem: OrigemRecursoDrift;
|
|
49
|
+
nome: string;
|
|
50
|
+
arquivo: string;
|
|
51
|
+
simbolo?: string;
|
|
52
|
+
tipo: TipoRecursoDrift;
|
|
53
|
+
}
|
|
41
54
|
interface RegistroRecursoDrift {
|
|
42
55
|
modulo: string;
|
|
43
56
|
task: string;
|
|
@@ -48,6 +61,17 @@ interface RegistroRecursoDrift {
|
|
|
48
61
|
tipo: TipoRecursoDrift;
|
|
49
62
|
status: "resolvido" | "divergente";
|
|
50
63
|
}
|
|
64
|
+
interface RegistroColunaPersistenciaDrift {
|
|
65
|
+
engine: EngineBanco;
|
|
66
|
+
recurso: string;
|
|
67
|
+
coluna: string;
|
|
68
|
+
arquivo: string;
|
|
69
|
+
}
|
|
70
|
+
interface RegistroRepositorioPersistenciaDrift {
|
|
71
|
+
engine: EngineBanco;
|
|
72
|
+
recurso: string;
|
|
73
|
+
arquivo: string;
|
|
74
|
+
}
|
|
51
75
|
interface SimboloCandidatoDrift {
|
|
52
76
|
origem: "ts" | "py" | "dart" | "cs" | "java" | "go" | "rust" | "cpp";
|
|
53
77
|
caminho: string;
|
|
@@ -84,9 +108,69 @@ interface RegistroVinculoDrift {
|
|
|
84
108
|
status: "resolvido" | "parcial" | "nao_encontrado";
|
|
85
109
|
confianca: NivelConfiancaSemantica;
|
|
86
110
|
}
|
|
111
|
+
export interface RegistroPersistenciaRealDrift {
|
|
112
|
+
modulo: string;
|
|
113
|
+
task: string;
|
|
114
|
+
alvo: string;
|
|
115
|
+
engine: OrigemRecursoDrift | "desconhecido";
|
|
116
|
+
tipo: TipoRecursoDrift;
|
|
117
|
+
status: "materializado" | "parcial" | "divergente";
|
|
118
|
+
arquivos: string[];
|
|
119
|
+
colunas: string[];
|
|
120
|
+
repositorios: string[];
|
|
121
|
+
compatibilidade: "nativo" | "adaptado" | "parcial" | "invalido" | "desconhecida";
|
|
122
|
+
motivoCompatibilidade?: string;
|
|
123
|
+
}
|
|
124
|
+
export interface ConfiguracaoEscopoDriftAplicada {
|
|
125
|
+
escopo: EscopoDriftReal;
|
|
126
|
+
ignorarWorktrees: boolean;
|
|
127
|
+
ignorarConsumidoresLaterais: boolean;
|
|
128
|
+
termosEscopo: string[];
|
|
129
|
+
}
|
|
130
|
+
export interface RegistroImpactoSemanticoArquivo {
|
|
131
|
+
arquivo: string;
|
|
132
|
+
tipo: "contrato" | "persistencia" | "repositorio" | "rota" | "worker" | "ui" | "teste" | "codigo";
|
|
133
|
+
prioridade: "alta" | "media" | "baixa";
|
|
134
|
+
linhas: number[];
|
|
135
|
+
motivos: string[];
|
|
136
|
+
}
|
|
137
|
+
export interface ResultadoImpactoSemantico {
|
|
138
|
+
comando: "impacto";
|
|
139
|
+
sucesso: boolean;
|
|
140
|
+
escopo: EscopoDriftReal;
|
|
141
|
+
alvoSemantico: string;
|
|
142
|
+
mudancaProposta: string;
|
|
143
|
+
contratosAfetados: string[];
|
|
144
|
+
tasksAfetadas: string[];
|
|
145
|
+
routesAfetadas: string[];
|
|
146
|
+
superficiesAfetadas: string[];
|
|
147
|
+
persistenciaAfetada: string[];
|
|
148
|
+
arquivos: RegistroImpactoSemanticoArquivo[];
|
|
149
|
+
ordemOperacional: string[];
|
|
150
|
+
validacoes: string[];
|
|
151
|
+
}
|
|
152
|
+
export interface SugestaoRenomeacaoSemantica {
|
|
153
|
+
arquivo: string;
|
|
154
|
+
linha: number;
|
|
155
|
+
atual: string;
|
|
156
|
+
sugerido: string;
|
|
157
|
+
contexto: string;
|
|
158
|
+
}
|
|
159
|
+
export interface ResultadoRenomeacaoSemantica {
|
|
160
|
+
comando: "renomear-semantico";
|
|
161
|
+
sucesso: boolean;
|
|
162
|
+
escopo: EscopoDriftReal;
|
|
163
|
+
de: string;
|
|
164
|
+
para: string;
|
|
165
|
+
arquivos: RegistroImpactoSemanticoArquivo[];
|
|
166
|
+
sugestoes: SugestaoRenomeacaoSemantica[];
|
|
167
|
+
ordemOperacional: string[];
|
|
168
|
+
validacoes: string[];
|
|
169
|
+
}
|
|
87
170
|
export interface ResultadoDrift {
|
|
88
171
|
comando: "drift";
|
|
89
172
|
sucesso: boolean;
|
|
173
|
+
escopo_aplicado: ConfiguracaoEscopoDriftAplicada;
|
|
90
174
|
consumerFramework: ConsumerFramework | null;
|
|
91
175
|
appRoutes: string[];
|
|
92
176
|
consumerSurfaces: RegistroConsumerSurfaceDrift[];
|
|
@@ -105,6 +189,7 @@ export interface ResultadoDrift {
|
|
|
105
189
|
rotas_divergentes: RegistroRotaDivergente[];
|
|
106
190
|
recursos_validos: RegistroRecursoDrift[];
|
|
107
191
|
recursos_divergentes: RegistroRecursoDrift[];
|
|
192
|
+
persistencia_real: RegistroPersistenciaRealDrift[];
|
|
108
193
|
resumo_operacional: {
|
|
109
194
|
scoreMedio: number;
|
|
110
195
|
confiancaGeral: NivelConfiancaSemantica;
|
|
@@ -116,5 +201,12 @@ export interface ResultadoDrift {
|
|
|
116
201
|
};
|
|
117
202
|
diagnosticos: DiagnosticoDrift[];
|
|
118
203
|
}
|
|
119
|
-
|
|
204
|
+
declare function indexarPersistenciaDetalhada(diretorios: string[]): Promise<{
|
|
205
|
+
colunas: RegistroColunaPersistenciaDrift[];
|
|
206
|
+
repositorios: RegistroRepositorioPersistenciaDrift[];
|
|
207
|
+
}>;
|
|
208
|
+
export declare function analisarPersistenciaReal(contexto: ContextoProjetoCarregado, mapaRecursos?: Map<string, RecursoResolvido[]>, detalhesPersistencia?: Awaited<ReturnType<typeof indexarPersistenciaDetalhada>>, opcoes?: OpcoesDriftLegado): Promise<RegistroPersistenciaRealDrift[]>;
|
|
209
|
+
export declare function analisarDriftLegado(contexto: ContextoProjetoCarregado, opcoes?: OpcoesDriftLegado): Promise<ResultadoDrift>;
|
|
210
|
+
export declare function gerarMapaImpactoSemantico(contexto: ContextoProjetoCarregado, alvoSemantico: string, mudancaProposta: string, opcoes?: OpcoesDriftLegado): Promise<ResultadoImpactoSemantico>;
|
|
211
|
+
export declare function assistirRenomeacaoSemantica(contexto: ContextoProjetoCarregado, nomeAtual: string, nomeNovo: string, opcoes?: OpcoesDriftLegado): Promise<ResultadoRenomeacaoSemantica>;
|
|
120
212
|
export {};
|