@semacode/cli 2.2.0 → 2.3.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/LICENSE +39 -39
- package/README.md +251 -141
- package/dist/agentContext.d.ts +1 -1
- package/dist/agentContextPack.js +6 -1
- package/dist/agentContextTipos.d.ts +4 -2
- package/dist/agentContextTipos.js +7 -0
- package/dist/agentEntryPoints.js +551 -499
- package/dist/angular-consumer-standalone.d.ts +3 -1
- package/dist/angular-consumer-standalone.js +12 -8
- package/dist/comandos.js +4 -0
- package/dist/discovery/catalog.d.ts +11 -0
- package/dist/discovery/catalog.js +521 -0
- package/dist/discovery/command.d.ts +11 -0
- package/dist/discovery/command.js +226 -0
- package/dist/discovery/index.d.ts +5 -0
- package/dist/discovery/index.js +8 -0
- package/dist/discovery/ranker.d.ts +3 -0
- package/dist/discovery/ranker.js +310 -0
- package/dist/discovery/redaction.d.ts +2 -0
- package/dist/discovery/redaction.js +21 -0
- package/dist/discovery/render.d.ts +2 -0
- package/dist/discovery/render.js +100 -0
- package/dist/discovery/types.d.ts +119 -0
- package/dist/discovery/types.js +13 -0
- package/dist/drift.part01.d.ts +32 -2
- package/dist/drift.part01.js +2 -0
- package/dist/drift.part04.d.ts +3 -2
- package/dist/drift.part04.js +6 -3
- package/dist/drift.part05.d.ts +2 -1
- package/dist/drift.part05.js +4 -3
- package/dist/drift.part06.d.ts +2 -1
- package/dist/drift.part06.js +9 -5
- package/dist/drift.part07.d.ts +11 -10
- package/dist/drift.part07.js +40 -30
- package/dist/drift.part08.d.ts +2 -1
- package/dist/drift.part08.js +4 -3
- package/dist/drift.part11.js +71 -6
- package/dist/drift.part12.js +14 -1
- package/dist/drift.part13.d.ts +42 -7
- package/dist/drift.part13.js +660 -36
- package/dist/driftCache.d.ts +49 -0
- package/dist/driftCache.js +311 -0
- package/dist/driftCacheIncremental.d.ts +98 -0
- package/dist/driftCacheIncremental.js +596 -0
- package/dist/driftCatalogo.d.ts +91 -0
- package/dist/driftCatalogo.js +657 -0
- package/dist/driftCatalogoPersistente.d.ts +8 -0
- package/dist/driftCatalogoPersistente.js +77 -0
- package/dist/driftEscopo.d.ts +23 -0
- package/dist/driftEscopo.js +563 -0
- package/dist/driftEscopoReferencias.d.ts +4 -0
- package/dist/driftEscopoReferencias.js +265 -0
- package/dist/driftOrcamento.d.ts +12 -0
- package/dist/driftOrcamento.js +19 -3
- package/dist/execucoesExternas.js +5 -19
- package/dist/exemplosOficiais.js +29 -8
- package/dist/iaPrompts.d.ts +1 -1
- package/dist/iaPrompts.js +310 -307
- package/dist/index.d.ts +2 -0
- package/dist/index.js +23 -5
- package/dist/index.part01.d.ts +17 -2
- package/dist/index.part01.js +119 -8
- package/dist/index.part02.js +21 -21
- package/dist/index.part03.d.ts +2 -2
- package/dist/index.part03.js +14 -3
- package/dist/index.part04.d.ts +2 -2
- package/dist/index.part04.js +113 -101
- package/dist/index.part05.d.ts +1 -1
- package/dist/index.part05.js +99 -22
- package/dist/index.part06.js +6 -2
- package/dist/index.part07.js +24 -24
- package/dist/index.part08.js +1 -1
- package/dist/init/templates.part01.js +393 -393
- package/dist/init/templates.part02.js +189 -189
- package/dist/initTemplatesBackend.js +73 -73
- package/dist/initTemplatesBase.js +81 -80
- package/dist/initTemplatesFlutter.js +137 -137
- package/dist/initTemplatesRuntime.js +350 -350
- package/dist/initTemplatesWeb.js +309 -309
- package/dist/pipelineConteudo/command.js +1 -36
- package/dist/profileArtefatoValidadores.d.ts +3 -2
- package/dist/profileArtefatoValidadores.js +81 -0
- package/dist/profileAuthorTipos.d.ts +4 -3
- package/dist/profileCatalogo.d.ts +5 -5
- package/dist/profileCatalogo.js +30 -0
- package/dist/profileCommand.d.ts +8 -2
- package/dist/profileCommand.js +15 -5
- package/dist/profileRegras.d.ts +5 -5
- package/dist/profileRegras.js +13 -1
- package/dist/profileRulePacks.js +68 -0
- package/dist/projeto.d.ts +1 -1
- package/dist/projetoCarregar.d.ts +2 -2
- package/dist/projetoCarregar.js +47 -24
- package/dist/projetoCatalogo.d.ts +7 -0
- package/dist/projetoCatalogo.js +125 -0
- package/dist/projetoTipos.d.ts +14 -5
- package/dist/sistemasInterativos/adapterProtocol.d.ts +3 -0
- package/dist/sistemasInterativos/adapterProtocol.js +240 -0
- package/dist/sistemasInterativos/advancedCatalog.d.ts +5 -0
- package/dist/sistemasInterativos/advancedCatalog.js +442 -0
- package/dist/sistemasInterativos/autonomy.d.ts +230 -0
- package/dist/sistemasInterativos/autonomy.js +753 -0
- package/dist/sistemasInterativos/canonical.d.ts +3 -0
- package/dist/sistemasInterativos/canonical.js +43 -0
- package/dist/sistemasInterativos/catalog.d.ts +116 -0
- package/dist/sistemasInterativos/catalog.js +543 -0
- package/dist/sistemasInterativos/command.d.ts +7 -0
- package/dist/sistemasInterativos/command.js +311 -0
- package/dist/sistemasInterativos/controlRun.d.ts +56 -0
- package/dist/sistemasInterativos/controlRun.js +391 -0
- package/dist/sistemasInterativos/evidence.d.ts +5 -0
- package/dist/sistemasInterativos/evidence.js +306 -0
- package/dist/sistemasInterativos/experienceIr.d.ts +12 -0
- package/dist/sistemasInterativos/experienceIr.js +895 -0
- package/dist/sistemasInterativos/experienceIrSemantics.d.ts +30 -0
- package/dist/sistemasInterativos/experienceIrSemantics.js +368 -0
- package/dist/sistemasInterativos/experienceIrTypes.d.ts +370 -0
- package/dist/sistemasInterativos/experienceIrTypes.js +5 -0
- package/dist/sistemasInterativos/extensionCommand.d.ts +391 -0
- package/dist/sistemasInterativos/extensionCommand.js +383 -0
- package/dist/sistemasInterativos/index.d.ts +19 -0
- package/dist/sistemasInterativos/index.js +22 -0
- package/dist/sistemasInterativos/operations.d.ts +40 -0
- package/dist/sistemasInterativos/operations.js +1167 -0
- package/dist/sistemasInterativos/operationsTypes.d.ts +297 -0
- package/dist/sistemasInterativos/operationsTypes.js +11 -0
- package/dist/sistemasInterativos/planner.d.ts +2 -0
- package/dist/sistemasInterativos/planner.js +159 -0
- package/dist/sistemasInterativos/portability.d.ts +164 -0
- package/dist/sistemasInterativos/portability.js +539 -0
- package/dist/sistemasInterativos/render.d.ts +3 -0
- package/dist/sistemasInterativos/render.js +179 -0
- package/dist/sistemasInterativos/temporal.d.ts +183 -0
- package/dist/sistemasInterativos/temporal.js +543 -0
- package/dist/sistemasInterativos/types.d.ts +215 -0
- package/dist/sistemasInterativos/types.js +4 -0
- package/dist/sistemasInterativos/validator.d.ts +2 -0
- package/dist/sistemasInterativos/validator.js +305 -0
- package/dist/sync/index.js +35 -35
- package/docs/README.md +34 -28
- package/docs/ai-onboarding.md +62 -62
- package/docs/ai-workflow.md +9 -4
- package/docs/auth.md +26 -26
- package/docs/cli.md +79 -79
- package/docs/commands.md +47 -2
- package/docs/database.md +15 -15
- package/docs/deploy.md +41 -41
- package/docs/descoberta-capacidades.md +106 -0
- package/docs/documentation.md +39 -39
- package/docs/env.md +16 -16
- package/docs/frontend.md +41 -41
- package/docs/getting-started.md +57 -57
- package/docs/i18n.md +15 -15
- package/docs/pipeline-conteudo.md +246 -246
- package/docs/profiles.md +54 -45
- package/docs/repositories.md +43 -43
- package/docs/rollback.md +31 -31
- package/docs/security.md +32 -32
- package/docs/sistemas-interativos.md +376 -0
- package/docs/support.md +8 -8
- package/docs/testing.md +51 -35
- package/docs/vocabulary.md +29 -29
- 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/pipeline-conteudo/README.md +44 -44
- package/exemplos/pipeline-conteudo/alvos.json +23 -23
- package/exemplos/pipeline-conteudo/definicao.json +136 -136
- 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_simulation.sema +211 -0
- 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/sistemas-interativos/README.md +100 -0
- package/exemplos/sistemas-interativos/advanced/acceptance-context-evaluate-valid.json +5 -0
- package/exemplos/sistemas-interativos/advanced/acceptance-lock-valid.json +16 -0
- package/exemplos/sistemas-interativos/advanced/asset-provenance-valid.json +32 -0
- package/exemplos/sistemas-interativos/advanced/autonomy-repair-valid.json +93 -0
- package/exemplos/sistemas-interativos/advanced/control-run-definition-valid.json +78 -0
- package/exemplos/sistemas-interativos/advanced/control-run-valid.json +27 -0
- package/exemplos/sistemas-interativos/advanced/distributed-workers-valid.json +79 -0
- package/exemplos/sistemas-interativos/advanced/editor-state-valid.json +42 -0
- package/exemplos/sistemas-interativos/advanced/engine-snapshot-after-valid.json +32 -0
- package/exemplos/sistemas-interativos/advanced/engine-snapshot-before-valid.json +23 -0
- package/exemplos/sistemas-interativos/advanced/job-orchestration-valid.json +39 -0
- package/exemplos/sistemas-interativos/advanced/multimodal-evidence-valid.json +46 -0
- package/exemplos/sistemas-interativos/advanced/multiplayer-authority-valid.json +39 -0
- package/exemplos/sistemas-interativos/advanced/playtest-fuzz-valid.json +37 -0
- package/exemplos/sistemas-interativos/advanced/portability-valid.json +104 -0
- package/exemplos/sistemas-interativos/advanced/temporal-evidence-valid.json +27 -0
- package/exemplos/sistemas-interativos/advanced/temporal-valid.json +118 -0
- package/exemplos/sistemas-interativos/experience-ir-valid.json +459 -0
- package/exemplos/sistemas-interativos/game-2d.json +83 -0
- package/exemplos/sistemas-interativos/game-3d-human.json +81 -0
- package/exemplos/sistemas-interativos/game-pixel-16-bit.json +97 -0
- package/exemplos/sistemas-interativos/game-pixel-8-bit.json +94 -0
- package/exemplos/sistemas-interativos/game-xr-human.json +80 -0
- package/exemplos/sistemas-interativos/hybrid-2-5d.json +108 -0
- package/exemplos/sistemas-interativos/protocol-mutating-rollback-valid.json +75 -0
- package/exemplos/sistemas-interativos/protocol-read-only-valid.json +58 -0
- package/exemplos/sistemas-interativos/simulation-2d-controlled.json +97 -0
- package/exemplos/sistemas-interativos/simulation-3d-calibrated-autonomous.json +141 -0
- package/exemplos/sistemas-interativos/simulation-headless-autonomous-batch.json +112 -0
- package/exemplos/sistemas-interativos/simulation-pixel-16-bit.json +103 -0
- package/exemplos/sistemas-interativos/simulation-text-controlled.json +95 -0
- 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-cpp/package.json +1 -1
- package/node_modules/@sema/gerador-css/dist/index.part01.js +10 -10
- package/node_modules/@sema/gerador-css/dist/index.part02.js +460 -460
- package/node_modules/@sema/gerador-dotnet/dist/index.js +169 -169
- package/node_modules/@sema/gerador-dotnet/package.json +1 -1
- package/node_modules/@sema/gerador-html/dist/index.js +17 -17
- package/node_modules/@sema/gerador-lua/dist/index.js +76 -47
- package/node_modules/@sema/gerador-lua/dist/index.js.map +1 -1
- package/node_modules/@sema/gerador-php/dist/index.js +113 -113
- 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 +3 -3
package/dist/drift.part07.js
CHANGED
|
@@ -16,15 +16,16 @@ import { extrairRecursosPersistenciaCodigoVivo, extrairRecursosPrisma, extrairSi
|
|
|
16
16
|
import { registrarRotasPython, registrarSimboloPython } from "./drift.part06.js";
|
|
17
17
|
import { arquivoEhRotasFlutterConsumer, extrairRotasFlutterConsumer, inferirRotaFlutterConsumer } from "./drift.part05.js";
|
|
18
18
|
import { fecharPrefixoRecurso, limparLiteralRecurso, normalizarNomeRecursoDrift } from "./drift.part02.js";
|
|
19
|
-
export async function indexarPython(diretorios) {
|
|
19
|
+
export async function indexarPython(diretorios, catalogo) {
|
|
20
|
+
catalogo?.emitir("extractor.run");
|
|
20
21
|
const simbolos = new Map();
|
|
21
22
|
const rotas = [];
|
|
22
23
|
const recursos = new Map();
|
|
23
24
|
for (const diretorio of diretorios) {
|
|
24
|
-
const arquivos = (await listarArquivosRecursivos(diretorio, [".py"]))
|
|
25
|
+
const arquivos = (await listarArquivosRecursivos(diretorio, [".py"], catalogo))
|
|
25
26
|
.filter((arquivo) => !arquivo.endsWith("__init__.py") && !/tests?[\\/]/i.test(arquivo));
|
|
26
27
|
for (const arquivo of arquivos) {
|
|
27
|
-
const texto = await readFile(arquivo, "utf8");
|
|
28
|
+
const texto = catalogo ? await catalogo.lerTexto(arquivo) : await readFile(arquivo, "utf8");
|
|
28
29
|
const basesSimbolicas = caminhosSimbolicos(diretorio, arquivo);
|
|
29
30
|
const prefixo = texto.match(/APIRouter\s*\(\s*prefix\s*=\s*["']([^"']+)["']/)?.[1];
|
|
30
31
|
for (const recurso of extrairRecursosPersistenciaCodigoVivo(arquivo, texto)) {
|
|
@@ -83,16 +84,17 @@ export async function indexarPython(diretorios) {
|
|
|
83
84
|
}
|
|
84
85
|
return { simbolos: [...simbolos.values()], rotas, recursos: [...recursos.values()] };
|
|
85
86
|
}
|
|
86
|
-
export async function indexarDart(diretorios) {
|
|
87
|
+
export async function indexarDart(diretorios, catalogo) {
|
|
88
|
+
catalogo?.emitir("extractor.run");
|
|
87
89
|
const simbolos = new Map();
|
|
88
90
|
const rotas = [];
|
|
89
91
|
const recursos = new Map();
|
|
90
92
|
const consumerSurfaces = new Map();
|
|
91
93
|
for (const diretorio of diretorios) {
|
|
92
|
-
const arquivos = (await listarArquivosRecursivos(diretorio, [".dart"]))
|
|
94
|
+
const arquivos = (await listarArquivosRecursivos(diretorio, [".dart"], catalogo))
|
|
93
95
|
.filter((arquivo) => !arquivo.endsWith(".g.dart") && !arquivo.endsWith(".freezed.dart"));
|
|
94
96
|
for (const arquivo of arquivos) {
|
|
95
|
-
const texto = await readFile(arquivo, "utf8");
|
|
97
|
+
const texto = catalogo ? await catalogo.lerTexto(arquivo) : await readFile(arquivo, "utf8");
|
|
96
98
|
const basesSimbolicas = caminhosSimbolicos(diretorio, arquivo);
|
|
97
99
|
const relacao = path.relative(diretorio, arquivo);
|
|
98
100
|
for (const recurso of extrairRecursosPersistenciaCodigoVivo(arquivo, texto)) {
|
|
@@ -173,15 +175,16 @@ export function registrarSimboloGenerico(simbolos, origem, basesSimbolicas, arqu
|
|
|
173
175
|
}
|
|
174
176
|
}
|
|
175
177
|
}
|
|
176
|
-
export async function indexarDotnet(diretorios) {
|
|
178
|
+
export async function indexarDotnet(diretorios, catalogo) {
|
|
179
|
+
catalogo?.emitir("extractor.run");
|
|
177
180
|
const simbolos = new Map();
|
|
178
181
|
const rotas = [];
|
|
179
182
|
const recursos = new Map();
|
|
180
183
|
for (const diretorio of diretorios) {
|
|
181
|
-
const arquivos = (await listarArquivosRecursivos(diretorio, [".cs"]))
|
|
184
|
+
const arquivos = (await listarArquivosRecursivos(diretorio, [".cs"], catalogo))
|
|
182
185
|
.filter((arquivo) => !/(^|[\\/])(bin|obj|Test[s]?)([\\/]|$)/i.test(arquivo));
|
|
183
186
|
for (const arquivo of arquivos) {
|
|
184
|
-
const codigo = await readFile(arquivo, "utf8");
|
|
187
|
+
const codigo = catalogo ? await catalogo.lerTexto(arquivo) : await readFile(arquivo, "utf8");
|
|
185
188
|
const basesSimbolicas = caminhosSimbolicos(diretorio, arquivo);
|
|
186
189
|
for (const recurso of extrairRecursosPersistenciaCodigoVivo(arquivo, codigo)) {
|
|
187
190
|
registrarRecursoDrift(recursos, recurso.origem, recurso.tipo, recurso.nome, recurso.arquivo, recurso.simbolo);
|
|
@@ -202,15 +205,16 @@ export async function indexarDotnet(diretorios) {
|
|
|
202
205
|
}
|
|
203
206
|
return { simbolos: [...simbolos.values()], rotas, recursos: [...recursos.values()] };
|
|
204
207
|
}
|
|
205
|
-
export async function indexarJava(diretorios) {
|
|
208
|
+
export async function indexarJava(diretorios, catalogo) {
|
|
209
|
+
catalogo?.emitir("extractor.run");
|
|
206
210
|
const simbolos = new Map();
|
|
207
211
|
const rotas = [];
|
|
208
212
|
const recursos = new Map();
|
|
209
213
|
for (const diretorio of diretorios) {
|
|
210
|
-
const arquivos = (await listarArquivosRecursivos(diretorio, [".java"]))
|
|
214
|
+
const arquivos = (await listarArquivosRecursivos(diretorio, [".java"], catalogo))
|
|
211
215
|
.filter((arquivo) => !/(^|[\\/])(target|build|out|Test[s]?)([\\/]|$)/i.test(arquivo));
|
|
212
216
|
for (const arquivo of arquivos) {
|
|
213
|
-
const codigo = await readFile(arquivo, "utf8");
|
|
217
|
+
const codigo = catalogo ? await catalogo.lerTexto(arquivo) : await readFile(arquivo, "utf8");
|
|
214
218
|
const basesSimbolicas = caminhosSimbolicos(diretorio, arquivo);
|
|
215
219
|
for (const recurso of extrairRecursosPersistenciaCodigoVivo(arquivo, codigo)) {
|
|
216
220
|
registrarRecursoDrift(recursos, recurso.origem, recurso.tipo, recurso.nome, recurso.arquivo, recurso.simbolo);
|
|
@@ -231,14 +235,15 @@ export async function indexarJava(diretorios) {
|
|
|
231
235
|
}
|
|
232
236
|
return { simbolos: [...simbolos.values()], rotas, recursos: [...recursos.values()] };
|
|
233
237
|
}
|
|
234
|
-
export async function indexarGo(diretorios) {
|
|
238
|
+
export async function indexarGo(diretorios, catalogo) {
|
|
239
|
+
catalogo?.emitir("extractor.run");
|
|
235
240
|
const simbolos = new Map();
|
|
236
241
|
const rotas = [];
|
|
237
242
|
const recursos = new Map();
|
|
238
243
|
for (const diretorio of diretorios) {
|
|
239
|
-
const arquivos = await listarArquivosRecursivos(diretorio, [".go"]);
|
|
244
|
+
const arquivos = await listarArquivosRecursivos(diretorio, [".go"], catalogo);
|
|
240
245
|
for (const arquivo of arquivos) {
|
|
241
|
-
const codigo = await readFile(arquivo, "utf8");
|
|
246
|
+
const codigo = catalogo ? await catalogo.lerTexto(arquivo) : await readFile(arquivo, "utf8");
|
|
242
247
|
const basesSimbolicas = caminhosSimbolicos(diretorio, arquivo);
|
|
243
248
|
for (const recurso of extrairRecursosPersistenciaCodigoVivo(arquivo, codigo)) {
|
|
244
249
|
registrarRecursoDrift(recursos, recurso.origem, recurso.tipo, recurso.nome, recurso.arquivo, recurso.simbolo);
|
|
@@ -259,14 +264,15 @@ export async function indexarGo(diretorios) {
|
|
|
259
264
|
}
|
|
260
265
|
return { simbolos: [...simbolos.values()], rotas, recursos: [...recursos.values()] };
|
|
261
266
|
}
|
|
262
|
-
export async function indexarRust(diretorios) {
|
|
267
|
+
export async function indexarRust(diretorios, catalogo) {
|
|
268
|
+
catalogo?.emitir("extractor.run");
|
|
263
269
|
const simbolos = new Map();
|
|
264
270
|
const rotas = [];
|
|
265
271
|
const recursos = new Map();
|
|
266
272
|
for (const diretorio of diretorios) {
|
|
267
|
-
const arquivos = await listarArquivosRecursivos(diretorio, [".rs"]);
|
|
273
|
+
const arquivos = await listarArquivosRecursivos(diretorio, [".rs"], catalogo);
|
|
268
274
|
for (const arquivo of arquivos) {
|
|
269
|
-
const codigo = await readFile(arquivo, "utf8");
|
|
275
|
+
const codigo = catalogo ? await catalogo.lerTexto(arquivo) : await readFile(arquivo, "utf8");
|
|
270
276
|
const basesSimbolicas = caminhosSimbolicos(diretorio, arquivo);
|
|
271
277
|
for (const recurso of extrairRecursosPersistenciaCodigoVivo(arquivo, codigo)) {
|
|
272
278
|
registrarRecursoDrift(recursos, recurso.origem, recurso.tipo, recurso.nome, recurso.arquivo, recurso.simbolo);
|
|
@@ -287,14 +293,15 @@ export async function indexarRust(diretorios) {
|
|
|
287
293
|
}
|
|
288
294
|
return { simbolos: [...simbolos.values()], rotas, recursos: [...recursos.values()] };
|
|
289
295
|
}
|
|
290
|
-
export async function indexarCpp(diretorios) {
|
|
296
|
+
export async function indexarCpp(diretorios, catalogo) {
|
|
297
|
+
catalogo?.emitir("extractor.run");
|
|
291
298
|
const simbolos = new Map();
|
|
292
299
|
const recursos = new Map();
|
|
293
300
|
for (const diretorio of diretorios) {
|
|
294
|
-
const arquivos = (await listarArquivosRecursivos(diretorio, [".cpp", ".cc", ".cxx", ".hpp", ".h"]))
|
|
301
|
+
const arquivos = (await listarArquivosRecursivos(diretorio, [".cpp", ".cc", ".cxx", ".hpp", ".h"], catalogo))
|
|
295
302
|
.filter((arquivo) => !/(^|[\\/])(windows|linux|macos|runner|flutter|ephemeral|build|vendor)([\\/]|$)/i.test(arquivo));
|
|
296
303
|
for (const arquivo of arquivos) {
|
|
297
|
-
const codigo = await readFile(arquivo, "utf8");
|
|
304
|
+
const codigo = catalogo ? await catalogo.lerTexto(arquivo) : await readFile(arquivo, "utf8");
|
|
298
305
|
const basesSimbolicas = caminhosSimbolicos(diretorio, arquivo);
|
|
299
306
|
for (const recurso of extrairRecursosPersistenciaCodigoVivo(arquivo, codigo)) {
|
|
300
307
|
registrarRecursoDrift(recursos, recurso.origem, recurso.tipo, recurso.nome, recurso.arquivo, recurso.simbolo);
|
|
@@ -309,15 +316,16 @@ export async function indexarCpp(diretorios) {
|
|
|
309
316
|
recursos: [...recursos.values()],
|
|
310
317
|
};
|
|
311
318
|
}
|
|
312
|
-
export async function indexarPhp(diretorios) {
|
|
319
|
+
export async function indexarPhp(diretorios, catalogo) {
|
|
320
|
+
catalogo?.emitir("extractor.run");
|
|
313
321
|
const simbolos = new Map();
|
|
314
322
|
const rotas = [];
|
|
315
323
|
const recursos = new Map();
|
|
316
324
|
for (const diretorio of diretorios) {
|
|
317
|
-
const arquivos = (await listarArquivosRecursivos(diretorio, [".php"]))
|
|
325
|
+
const arquivos = (await listarArquivosRecursivos(diretorio, [".php"], catalogo))
|
|
318
326
|
.filter((arquivo) => !/(^|[\\/])(vendor|storage|bootstrap[\\/]cache|cache|tests?)([\\/]|$)/i.test(arquivo));
|
|
319
327
|
for (const arquivo of arquivos) {
|
|
320
|
-
const codigo = await readFile(arquivo, "utf8");
|
|
328
|
+
const codigo = catalogo ? await catalogo.lerTexto(arquivo) : await readFile(arquivo, "utf8");
|
|
321
329
|
const basesSimbolicas = caminhosSimbolicos(diretorio, arquivo);
|
|
322
330
|
for (const recurso of extrairRecursosPersistenciaCodigoVivo(arquivo, codigo)) {
|
|
323
331
|
registrarRecursoDrift(recursos, recurso.origem, recurso.tipo, recurso.nome, recurso.arquivo, recurso.simbolo);
|
|
@@ -350,14 +358,15 @@ export async function indexarPhp(diretorios) {
|
|
|
350
358
|
recursos: [...recursos.values()],
|
|
351
359
|
};
|
|
352
360
|
}
|
|
353
|
-
export async function indexarLua(diretorios) {
|
|
361
|
+
export async function indexarLua(diretorios, catalogo) {
|
|
362
|
+
catalogo?.emitir("extractor.run");
|
|
354
363
|
const simbolos = new Map();
|
|
355
364
|
const recursos = new Map();
|
|
356
365
|
for (const diretorio of diretorios) {
|
|
357
|
-
const arquivos = (await listarArquivosRecursivos(diretorio, [".lua"]))
|
|
366
|
+
const arquivos = (await listarArquivosRecursivos(diretorio, [".lua"], catalogo))
|
|
358
367
|
.filter((arquivo) => !/(^|[\\/])(vendor|build|dist|generated|tests?)([\\/]|$)/i.test(arquivo));
|
|
359
368
|
for (const arquivo of arquivos) {
|
|
360
|
-
const codigo = await readFile(arquivo, "utf8");
|
|
369
|
+
const codigo = catalogo ? await catalogo.lerTexto(arquivo) : await readFile(arquivo, "utf8");
|
|
361
370
|
const basesSimbolicas = caminhosSimbolicos(diretorio, arquivo);
|
|
362
371
|
for (const recurso of extrairRecursosPersistenciaCodigoVivo(arquivo, codigo)) {
|
|
363
372
|
registrarRecursoDrift(recursos, recurso.origem, recurso.tipo, recurso.nome, recurso.arquivo, recurso.simbolo);
|
|
@@ -372,7 +381,8 @@ export async function indexarLua(diretorios) {
|
|
|
372
381
|
recursos: [...recursos.values()],
|
|
373
382
|
};
|
|
374
383
|
}
|
|
375
|
-
export async function indexarPersistenciaDeclarativa(diretorios) {
|
|
384
|
+
export async function indexarPersistenciaDeclarativa(diretorios, catalogo) {
|
|
385
|
+
catalogo?.emitir("extractor.run");
|
|
376
386
|
const recursos = new Map();
|
|
377
387
|
const simbolos = new Map();
|
|
378
388
|
for (const diretorio of diretorios) {
|
|
@@ -380,9 +390,9 @@ export async function indexarPersistenciaDeclarativa(diretorios) {
|
|
|
380
390
|
".sql", ".psql", ".ddl", ".prisma",
|
|
381
391
|
".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs",
|
|
382
392
|
".py", ".dart", ".lua", ".cs", ".java", ".go", ".rs", ".cpp", ".cc", ".cxx", ".hpp", ".h", ".php",
|
|
383
|
-
]);
|
|
393
|
+
], catalogo);
|
|
384
394
|
for (const arquivo of arquivos) {
|
|
385
|
-
const codigo = await readFile(arquivo, "utf8");
|
|
395
|
+
const codigo = catalogo ? await catalogo.lerTexto(arquivo) : await readFile(arquivo, "utf8");
|
|
386
396
|
const extracoes = arquivo.endsWith(".prisma")
|
|
387
397
|
? extrairRecursosPrisma(arquivo, codigo)
|
|
388
398
|
: extrairRecursosPersistenciaCodigoVivo(arquivo, codigo);
|
package/dist/drift.part08.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { IrBancoDados, IrModulo, IrTask } from "@sema/nucleo";
|
|
2
2
|
import { OrigemRecursoDrift, RecursoEsperadoDrift, RecursoResolvido, RegistroColunaPersistenciaDrift, RegistroPersistenciaRealDrift, RegistroRepositorioPersistenciaDrift, SimboloResolvido, TipoRecursoDrift } from "./drift.part01.js";
|
|
3
|
+
import type { CatalogoDrift } from "./driftCatalogo.js";
|
|
3
4
|
export declare function registrarRepositorioPersistenciaDrift(repositorios: Map<string, RegistroRepositorioPersistenciaDrift>, origem: OrigemRecursoDrift, recurso: string, arquivo: string): void;
|
|
4
5
|
export declare function extrairColunasSqlDetalhadas(arquivo: string, codigo: string): RegistroColunaPersistenciaDrift[];
|
|
5
6
|
export declare function extrairColunasPrismaDetalhadas(arquivo: string, codigo: string): RegistroColunaPersistenciaDrift[];
|
|
@@ -7,7 +8,7 @@ export declare function extrairCamposMongoDetalhados(arquivo: string, codigo: st
|
|
|
7
8
|
export declare function extrairCamposRedisDetalhados(arquivo: string, codigo: string): RegistroColunaPersistenciaDrift[];
|
|
8
9
|
export declare function extrairCamposArquivoLocalDetalhados(arquivo: string, codigo: string): RegistroColunaPersistenciaDrift[];
|
|
9
10
|
export declare function registrarRepositoriosPorRecursos(repositorios: Map<string, RegistroRepositorioPersistenciaDrift>, arquivo: string, codigo: string, recursos: RecursoResolvido[]): void;
|
|
10
|
-
export declare function indexarPersistenciaDetalhada(diretorios: string[]): Promise<{
|
|
11
|
+
export declare function indexarPersistenciaDetalhada(diretorios: string[], catalogo?: CatalogoDrift): Promise<{
|
|
11
12
|
colunas: RegistroColunaPersistenciaDrift[];
|
|
12
13
|
repositorios: RegistroRepositorioPersistenciaDrift[];
|
|
13
14
|
}>;
|
package/dist/drift.part08.js
CHANGED
|
@@ -172,7 +172,8 @@ export function registrarRepositoriosPorRecursos(repositorios, arquivo, codigo,
|
|
|
172
172
|
registrarRepositorioPersistenciaDrift(repositorios, recurso.origem, recurso.nome, arquivo);
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
export async function indexarPersistenciaDetalhada(diretorios) {
|
|
175
|
+
export async function indexarPersistenciaDetalhada(diretorios, catalogo) {
|
|
176
|
+
catalogo?.emitir("extractor.run");
|
|
176
177
|
const colunas = new Map();
|
|
177
178
|
const repositorios = new Map();
|
|
178
179
|
for (const diretorio of diretorios) {
|
|
@@ -180,9 +181,9 @@ export async function indexarPersistenciaDetalhada(diretorios) {
|
|
|
180
181
|
".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs",
|
|
181
182
|
".py", ".dart", ".lua", ".cs", ".java", ".go", ".rs", ".cpp", ".cc", ".cxx", ".hpp", ".h", ".php",
|
|
182
183
|
".sql", ".psql", ".ddl", ".prisma",
|
|
183
|
-
]);
|
|
184
|
+
], catalogo);
|
|
184
185
|
for (const arquivo of arquivos) {
|
|
185
|
-
const codigo = await readFile(arquivo, "utf8");
|
|
186
|
+
const codigo = catalogo ? await catalogo.lerTexto(arquivo) : await readFile(arquivo, "utf8");
|
|
186
187
|
const recursos = arquivo.endsWith(".prisma")
|
|
187
188
|
? extrairRecursosPrisma(arquivo, codigo)
|
|
188
189
|
: extrairRecursosPersistenciaCodigoVivo(arquivo, codigo);
|
package/dist/drift.part11.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SEMA-GOVERNED: sema.governanca_ia_contexto
|
|
2
2
|
// Descricao: CLI particionada; consulte contratos/sema/governanca_ia_contexto.sema antes de editar.
|
|
3
3
|
import path from "node:path";
|
|
4
|
-
import { emitirDiagnosticosArquivosOrcamento } from "./driftOrcamento.js";
|
|
4
|
+
import { emitirDiagnosticosArquivosOrcamento, workspaceExigeCabecalhoCodigoGovernado, } from "./driftOrcamento.js";
|
|
5
5
|
import { definirDiretoriosIgnoradosAtivos, obterDiretoriosIgnoradosAtivos, extrairTermosEscopoDrift, resolverDiretoriosIgnoradosAtivos, resolverOpcoesDrift } from "./drift.part01.js";
|
|
6
6
|
import { construirContextoRelevanciaConsumer, filtrarConsumerSurfacesPorEscopo } from "./drift.part02.js";
|
|
7
7
|
import { inferirConsumerFrameworkPrincipal } from "./drift.part06.js";
|
|
@@ -22,7 +22,25 @@ export async function analisarDriftLegado(contexto, opcoes) {
|
|
|
22
22
|
const diretoriosIgnoradosAnteriores = obterDiretoriosIgnoradosAtivos();
|
|
23
23
|
definirDiretoriosIgnoradosAtivos(resolverDiretoriosIgnoradosAtivos(opcoesResolvidas));
|
|
24
24
|
try {
|
|
25
|
-
const
|
|
25
|
+
const indicesPreparados = await prepararIndicesDrift(contexto, configuracaoEscopo, {
|
|
26
|
+
politicaCache: opcoesResolvidas.cache,
|
|
27
|
+
observador: opcoesResolvidas.observador,
|
|
28
|
+
});
|
|
29
|
+
const { arquivosOrcamentoAvaliados, detalhesPersistencia, diagnosticosOrcamento: diagnosticosOrcamentoPrecalculados, indexDart, indexTs, mapaImpl, mapaRecursos, todasRotasIndexadas, todosArquivosConhecidos, todosRecursos, todosSimbolos, planoEscopo, cache: estadoCache, catalogo: metricasCatalogo, } = indicesPreparados;
|
|
30
|
+
const leitorArquivosPlanejados = indicesPreparados.leitorArquivosPlanejados;
|
|
31
|
+
const relativoEscopo = (arquivo) => {
|
|
32
|
+
const relativo = path.relative(contexto.baseProjeto, arquivo).replace(/\\/g, "/");
|
|
33
|
+
return relativo && !relativo.startsWith("../") ? relativo : arquivo.replace(/\\/g, "/");
|
|
34
|
+
};
|
|
35
|
+
configuracaoEscopo.estrategia = planoEscopo.estrategia;
|
|
36
|
+
configuracaoEscopo.cobertura = planoEscopo.cobertura;
|
|
37
|
+
configuracaoEscopo.arquivosPlanejados = planoEscopo.arquivos.map(relativoEscopo);
|
|
38
|
+
configuracaoEscopo.arquivosDeclarados = planoEscopo.arquivosDeclarados.map(relativoEscopo);
|
|
39
|
+
configuracaoEscopo.arquivosInferidos = planoEscopo.arquivosInferidos.map(relativoEscopo);
|
|
40
|
+
configuracaoEscopo.arquivosAusentes = planoEscopo.arquivosAusentes.map(relativoEscopo);
|
|
41
|
+
configuracaoEscopo.bloqueios = [...planoEscopo.bloqueios];
|
|
42
|
+
configuracaoEscopo.cache = estadoCache;
|
|
43
|
+
configuracaoEscopo.catalogo = metricasCatalogo;
|
|
26
44
|
const implsValidos = [];
|
|
27
45
|
const implsQuebrados = [];
|
|
28
46
|
const vinculosValidos = [];
|
|
@@ -31,6 +49,14 @@ export async function analisarDriftLegado(contexto, opcoes) {
|
|
|
31
49
|
const recursosValidos = [];
|
|
32
50
|
const recursosDivergentes = [];
|
|
33
51
|
const diagnosticos = [];
|
|
52
|
+
if (planoEscopo.bloqueios.includes("escopo_estreito_sem_vinculos")) {
|
|
53
|
+
diagnosticos.push({
|
|
54
|
+
tipo: "escopo_estreito_sem_vinculos",
|
|
55
|
+
modulo: contexto.modulosSelecionados[0]?.resultado.ir?.nome ?? "projeto",
|
|
56
|
+
severidade: "erro",
|
|
57
|
+
mensagem: "Escopo arquivo/modulo sem arquivo vinculado ou implementação resolvível. Declare vinculos { arquivo: ... } ou execute explicitamente com --escopo projeto.",
|
|
58
|
+
});
|
|
59
|
+
}
|
|
34
60
|
const tasksResumo = [];
|
|
35
61
|
const taskPorChave = new Map();
|
|
36
62
|
const guardrailsPorTask = new Map();
|
|
@@ -249,13 +275,51 @@ export async function analisarDriftLegado(contexto, opcoes) {
|
|
|
249
275
|
const moduloOrcamento = contexto.modulosSelecionados[0]?.resultado.ir?.nome
|
|
250
276
|
?? contexto.modulosSelecionados[0]?.resultado.modulo?.nome
|
|
251
277
|
?? "projeto";
|
|
252
|
-
const exigeCabecalhoCodigoGovernado = contexto.configCarregada?.config.modoEstrito === true
|
|
253
|
-
|
|
254
|
-
|
|
278
|
+
const exigeCabecalhoCodigoGovernado = await workspaceExigeCabecalhoCodigoGovernado(contexto.baseProjeto, contexto.configCarregada?.config.modoEstrito === true);
|
|
279
|
+
const chaveArquivoOrcamento = (arquivo) => {
|
|
280
|
+
const absoluto = path.resolve(contexto.baseProjeto, arquivo);
|
|
281
|
+
return process.platform === "win32" ? absoluto.toLowerCase() : absoluto;
|
|
282
|
+
};
|
|
283
|
+
const contratosJaCarregados = new Map(contexto.modulosCarregados.map((modulo) => [
|
|
284
|
+
chaveArquivoOrcamento(modulo.caminho),
|
|
285
|
+
modulo.codigo,
|
|
286
|
+
]));
|
|
287
|
+
const arquivosPlanejados = new Set((planoEscopo.estrategia === "projeto"
|
|
288
|
+
? todosArquivosConhecidos
|
|
289
|
+
: planoEscopo.arquivos).map(chaveArquivoOrcamento));
|
|
290
|
+
const arquivosAvaliados = new Set(arquivosOrcamentoAvaliados.map(chaveArquivoOrcamento));
|
|
291
|
+
const arquivosSolicitadosOrcamento = new Set([...arquivosOrcamento].map(chaveArquivoOrcamento));
|
|
292
|
+
const leitorArquivosOrcamento = {
|
|
293
|
+
contem: (arquivo) => {
|
|
294
|
+
const chave = chaveArquivoOrcamento(arquivo);
|
|
295
|
+
if (contratosJaCarregados.has(chave)) {
|
|
296
|
+
return true;
|
|
297
|
+
}
|
|
298
|
+
return arquivosPlanejados.has(chave)
|
|
299
|
+
&& leitorArquivosPlanejados?.contem(arquivo) === true;
|
|
300
|
+
},
|
|
301
|
+
lerTexto: async (arquivo) => {
|
|
302
|
+
const chave = chaveArquivoOrcamento(arquivo);
|
|
303
|
+
const contrato = contratosJaCarregados.get(chave);
|
|
304
|
+
if (contrato !== undefined) {
|
|
305
|
+
return contrato;
|
|
306
|
+
}
|
|
307
|
+
if (!arquivosPlanejados.has(chave) || !leitorArquivosPlanejados?.contem(arquivo)) {
|
|
308
|
+
throw new Error(`Arquivo fora do catalogo planejado do drift: ${arquivo}`);
|
|
309
|
+
}
|
|
310
|
+
return leitorArquivosPlanejados.lerTexto(arquivo);
|
|
311
|
+
},
|
|
312
|
+
};
|
|
313
|
+
const diagnosticosOrcamentoCalculadosAgora = await emitirDiagnosticosArquivosOrcamento({
|
|
255
314
|
baseProjeto: contexto.baseProjeto,
|
|
256
|
-
arquivos: [...arquivosOrcamento],
|
|
315
|
+
arquivos: [...arquivosOrcamento].filter((arquivo) => !arquivosAvaliados.has(chaveArquivoOrcamento(arquivo))),
|
|
257
316
|
exigirCabecalhoCodigoGovernado: exigeCabecalhoCodigoGovernado,
|
|
317
|
+
leitorArquivos: leitorArquivosOrcamento,
|
|
258
318
|
});
|
|
319
|
+
const diagnosticosOrcamento = [
|
|
320
|
+
...diagnosticosOrcamentoPrecalculados.filter((diagnostico) => arquivosSolicitadosOrcamento.has(chaveArquivoOrcamento(diagnostico.arquivo))),
|
|
321
|
+
...diagnosticosOrcamentoCalculadosAgora,
|
|
322
|
+
];
|
|
259
323
|
for (const diagnostico of diagnosticosOrcamento) {
|
|
260
324
|
diagnosticos.push({
|
|
261
325
|
tipo: diagnostico.tipo,
|
|
@@ -274,6 +338,7 @@ export async function analisarDriftLegado(contexto, opcoes) {
|
|
|
274
338
|
&& recursosDivergentes.length === 0
|
|
275
339
|
&& vinculosQuebrados.length === 0
|
|
276
340
|
&& persistenciaReal.every((item) => item.status !== "divergente" && item.compatibilidade !== "invalido")
|
|
341
|
+
&& planoEscopo.bloqueios.length === 0
|
|
277
342
|
&& !possuiBloqueioOrcamento;
|
|
278
343
|
const payloadBase = {
|
|
279
344
|
comando: "drift",
|
package/dist/drift.part12.js
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
import { readFile } from "node:fs/promises";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { listarArquivosRecursivos, paraIdentificadorModulo } from "./drift.part04.js";
|
|
6
|
-
import { definirDiretoriosIgnoradosAtivos, obterDiretoriosIgnoradosAtivos, normalizarFragmentoArquivo, quebrarTermosEscopo, resolverDiretoriosIgnoradosAtivos, resolverOpcoesDrift } from "./drift.part01.js";
|
|
6
|
+
import { definirDiretoriosIgnoradosAtivos, obterDiretoriosIgnoradosAtivos, normalizarFragmentoArquivo, quebrarTermosEscopo, extrairTermosEscopoDrift, resolverDiretoriosIgnoradosAtivos, resolverOpcoesDrift } from "./drift.part01.js";
|
|
7
7
|
import { filtrarCaminhosEscopoReal, resolverDiretoriosCodigoEscopoReal, textoCombinaEscopo } from "./drift.part02.js";
|
|
8
8
|
import { analisarDriftLegado } from "./drift.part11.js";
|
|
9
|
+
import { planejarEscopoDrift } from "./driftEscopo.js";
|
|
9
10
|
export const EXTENSOES_BUSCA_IMPACTO = [
|
|
10
11
|
".sema",
|
|
11
12
|
".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs",
|
|
@@ -100,6 +101,18 @@ export function registrarArquivoImpactado(mapa, arquivo, linhas, motivos) {
|
|
|
100
101
|
export async function listarArquivosImpacto(contexto, opcoes) {
|
|
101
102
|
const opcoesResolvidas = resolverOpcoesDrift(opcoes);
|
|
102
103
|
const arquivos = new Set(filtrarCaminhosEscopoReal(contexto.arquivosProjeto, contexto, opcoesResolvidas));
|
|
104
|
+
if (opcoesResolvidas.escopo !== "projeto") {
|
|
105
|
+
const plano = await planejarEscopoDrift(contexto, {
|
|
106
|
+
escopo: opcoesResolvidas.escopo,
|
|
107
|
+
ignorarWorktrees: opcoesResolvidas.ignorarWorktrees,
|
|
108
|
+
ignorarConsumidoresLaterais: opcoesResolvidas.ignorarConsumidoresLaterais,
|
|
109
|
+
termosEscopo: extrairTermosEscopoDrift(contexto, opcoesResolvidas.escopo),
|
|
110
|
+
});
|
|
111
|
+
for (const arquivo of plano.arquivos) {
|
|
112
|
+
arquivos.add(arquivo);
|
|
113
|
+
}
|
|
114
|
+
return [...arquivos].sort((a, b) => a.localeCompare(b, "pt-BR"));
|
|
115
|
+
}
|
|
103
116
|
for (const diretorio of resolverDiretoriosCodigoEscopoReal(contexto, opcoesResolvidas)) {
|
|
104
117
|
for (const arquivo of await listarArquivosRecursivos(diretorio, EXTENSOES_BUSCA_IMPACTO)) {
|
|
105
118
|
arquivos.add(arquivo);
|
package/dist/drift.part13.d.ts
CHANGED
|
@@ -3,15 +3,50 @@ import type { ConfiguracaoEscopoDriftAplicada, RecursoResolvido, RotaResolvida,
|
|
|
3
3
|
import { indexarTypeScript } from "./drift.part06.js";
|
|
4
4
|
import { indexarDart } from "./drift.part07.js";
|
|
5
5
|
import { indexarPersistenciaDetalhada } from "./drift.part08.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
import { type DiagnosticoOrcamentoArquivo } from "./driftOrcamento.js";
|
|
7
|
+
import { type CatalogoDrift, type MetricasCatalogoDrift, type ObservadorOperacaoDrift } from "./driftCatalogo.js";
|
|
8
|
+
import { type PoliticaCacheDrift } from "./driftCache.js";
|
|
9
|
+
import { type MetricasCacheIncrementalDrift } from "./driftCacheIncremental.js";
|
|
10
|
+
import { type PlanoEscopoDrift } from "./driftEscopo.js";
|
|
11
|
+
type IndiceTypeScriptDrift = Awaited<ReturnType<typeof indexarTypeScript>>;
|
|
12
|
+
type IndiceDartDrift = Awaited<ReturnType<typeof indexarDart>>;
|
|
13
|
+
type DetalhesPersistenciaDrift = Awaited<ReturnType<typeof indexarPersistenciaDetalhada>>;
|
|
14
|
+
interface IndicesDriftSerializaveis {
|
|
15
|
+
arquivosOrcamentoAvaliados: string[];
|
|
16
|
+
detalhesPersistencia: DetalhesPersistenciaDrift;
|
|
17
|
+
diagnosticosOrcamento: DiagnosticoOrcamentoArquivo[];
|
|
18
|
+
indexDart: IndiceDartDrift;
|
|
19
|
+
indexTs: IndiceTypeScriptDrift;
|
|
12
20
|
todasRotasIndexadas: RotaResolvida[];
|
|
13
21
|
todosArquivosConhecidos: string[];
|
|
14
22
|
todosRecursos: RecursoResolvido[];
|
|
15
23
|
todosSimbolos: SimboloResolvido[];
|
|
16
24
|
}
|
|
17
|
-
export
|
|
25
|
+
export interface EstadoCacheIndicesDrift {
|
|
26
|
+
politica: PoliticaCacheDrift;
|
|
27
|
+
origem: "cache" | "calculado" | "nao_aplicavel";
|
|
28
|
+
chave?: string;
|
|
29
|
+
incremental?: MetricasCacheIncrementalDrift;
|
|
30
|
+
fasesMs?: {
|
|
31
|
+
planejamento: number;
|
|
32
|
+
catalogacao: number;
|
|
33
|
+
dependencias: number;
|
|
34
|
+
assinaturas: number;
|
|
35
|
+
indexacao: number;
|
|
36
|
+
total: number;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export interface IndicesDriftPreparados extends IndicesDriftSerializaveis {
|
|
40
|
+
mapaImpl: Map<string, SimboloResolvido>;
|
|
41
|
+
mapaRecursos: Map<string, RecursoResolvido[]>;
|
|
42
|
+
planoEscopo: PlanoEscopoDrift;
|
|
43
|
+
cache: EstadoCacheIndicesDrift;
|
|
44
|
+
catalogo: MetricasCatalogoDrift;
|
|
45
|
+
leitorArquivosPlanejados?: Pick<CatalogoDrift, "contem" | "lerTexto">;
|
|
46
|
+
}
|
|
47
|
+
export interface OpcoesPrepararIndicesDrift {
|
|
48
|
+
politicaCache?: PoliticaCacheDrift;
|
|
49
|
+
observador?: ObservadorOperacaoDrift;
|
|
50
|
+
}
|
|
51
|
+
export declare function prepararIndicesDrift(contexto: ContextoProjetoCarregado, configuracaoEscopo: ConfiguracaoEscopoDriftAplicada, opcoes?: OpcoesPrepararIndicesDrift): Promise<IndicesDriftPreparados>;
|
|
52
|
+
export {};
|