@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
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// SEMA-GOVERNED: sema.produto.descoberta_capacidades
|
|
2
|
+
// Descrição: saída humana agrupada, contextual e explícita sobre ausência de execução.
|
|
3
|
+
const KIND_LABELS = {
|
|
4
|
+
GOVERNANCE_FLOW: "Fluxos de governança",
|
|
5
|
+
PROFILE_GATE: "Gates por profile",
|
|
6
|
+
SPECIALIZED_WORKFLOW: "Workflows especializados",
|
|
7
|
+
ORCHESTRATION_PIPELINE: "Pipelines de orquestração",
|
|
8
|
+
CAPABILITY_TOKEN: "Capabilities declarativas",
|
|
9
|
+
GENERATOR: "Geradores",
|
|
10
|
+
ADAPTER: "Adapters externos",
|
|
11
|
+
};
|
|
12
|
+
const FRONTEIRA = "Nenhuma ação foi executada; o workspace e serviços externos não foram tocados.";
|
|
13
|
+
function linhaComando(entry) {
|
|
14
|
+
const command = entry.commandTemplates[0]?.command;
|
|
15
|
+
return command ? ` Comando explícito: ${command}` : " Comando explícito: não disponível";
|
|
16
|
+
}
|
|
17
|
+
function renderizarCatalogo(payload) {
|
|
18
|
+
const linhas = [
|
|
19
|
+
"DESCOBERTA SEMA",
|
|
20
|
+
`CATÁLOGO · ${payload.entries.length} capacidade(s)`,
|
|
21
|
+
FRONTEIRA,
|
|
22
|
+
];
|
|
23
|
+
if (payload.entries.length === 0) {
|
|
24
|
+
linhas.push("", "Nenhuma capacidade corresponde aos filtros informados.");
|
|
25
|
+
return linhas.join("\n");
|
|
26
|
+
}
|
|
27
|
+
for (const kind of Object.keys(KIND_LABELS)) {
|
|
28
|
+
const entries = payload.entries.filter((entry) => entry.kind === kind);
|
|
29
|
+
if (entries.length === 0)
|
|
30
|
+
continue;
|
|
31
|
+
linhas.push("", `${KIND_LABELS[kind]} (${entries.length})`);
|
|
32
|
+
for (const entry of entries) {
|
|
33
|
+
linhas.push(`- ${entry.label} · ${entry.id}`, ` ${entry.summary}`, ` Use quando: ${entry.useWhen[0] ?? "consulte a descrição detalhada"}`, linhaComando(entry));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return linhas.join("\n");
|
|
37
|
+
}
|
|
38
|
+
function renderizarRanking(payload) {
|
|
39
|
+
const linhas = [
|
|
40
|
+
"DESCOBERTA SEMA",
|
|
41
|
+
`INTENÇÃO · ${payload.intent}`,
|
|
42
|
+
FRONTEIRA,
|
|
43
|
+
];
|
|
44
|
+
if (payload.noMatch) {
|
|
45
|
+
linhas.push("", "Sem correspondência segura (o melhor score ficou abaixo de 60/100).");
|
|
46
|
+
}
|
|
47
|
+
else if (payload.ambiguity.detected) {
|
|
48
|
+
linhas.push("", `Ambiguidade detectada entre ${payload.ambiguity.candidates.join(" e ")}.`, "Nenhum comando único foi sugerido; refine a intenção ou escolha uma capacidade explicitamente.");
|
|
49
|
+
}
|
|
50
|
+
if (payload.recommendations.length === 0) {
|
|
51
|
+
linhas.push("", "Nenhuma candidata recebeu sinais positivos.");
|
|
52
|
+
return linhas.join("\n");
|
|
53
|
+
}
|
|
54
|
+
linhas.push("");
|
|
55
|
+
for (const recommendation of payload.recommendations) {
|
|
56
|
+
linhas.push(`${recommendation.rank}. ${recommendation.label} · ${recommendation.id} — ${recommendation.score}/100`, ` Motivos: ${recommendation.reasons.join("; ")}`, ` Sinais: ${recommendation.matchedSignals.join(", ") || "nenhum"}`);
|
|
57
|
+
if (recommendation.missingInputs.length > 0) {
|
|
58
|
+
linhas.push(` Entradas ainda necessárias: ${recommendation.missingInputs.join(", ")}`);
|
|
59
|
+
}
|
|
60
|
+
if (recommendation.suggestedCommandTemplate) {
|
|
61
|
+
linhas.push(` Comando explícito: ${recommendation.suggestedCommandTemplate}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return linhas.join("\n");
|
|
65
|
+
}
|
|
66
|
+
function renderizarExplicacao(payload) {
|
|
67
|
+
const entry = payload.entry;
|
|
68
|
+
const linhas = [
|
|
69
|
+
"DESCOBERTA SEMA",
|
|
70
|
+
`${entry.label} · ${entry.id}`,
|
|
71
|
+
`${KIND_LABELS[entry.kind]} · ${entry.domains.join(", ")}`,
|
|
72
|
+
FRONTEIRA,
|
|
73
|
+
"",
|
|
74
|
+
entry.summary,
|
|
75
|
+
"",
|
|
76
|
+
"Use quando:",
|
|
77
|
+
...entry.useWhen.map((item) => `- ${item}`),
|
|
78
|
+
"",
|
|
79
|
+
"Evite quando:",
|
|
80
|
+
...entry.avoidWhen.map((item) => `- ${item}`),
|
|
81
|
+
"",
|
|
82
|
+
"Comandos explícitos:",
|
|
83
|
+
...entry.commandTemplates.map((item) => (`- ${item.command} [${item.effectClass}; muta workspace: ${item.mutatesWorkspace ? "sim" : "não"}; runtime externo: ${item.executesExternalRuntime ? "sim" : "não"}]`)),
|
|
84
|
+
];
|
|
85
|
+
return linhas.join("\n");
|
|
86
|
+
}
|
|
87
|
+
export function renderizarResultadoDescoberta(payload) {
|
|
88
|
+
if (payload.mode === "catalog")
|
|
89
|
+
return renderizarCatalogo(payload);
|
|
90
|
+
if (payload.mode === "ranking")
|
|
91
|
+
return renderizarRanking(payload);
|
|
92
|
+
if (payload.mode === "explain")
|
|
93
|
+
return renderizarExplicacao(payload);
|
|
94
|
+
return [
|
|
95
|
+
"DESCOBERTA SEMA · ERRO",
|
|
96
|
+
payload.error.message,
|
|
97
|
+
FRONTEIRA,
|
|
98
|
+
].join("\n");
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=render.js.map
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
export declare const DISCOVERY_SCHEMA_VERSION: "sema.discovery/v1";
|
|
2
|
+
export declare const DISCOVERY_KINDS: readonly ["GOVERNANCE_FLOW", "PROFILE_GATE", "SPECIALIZED_WORKFLOW", "ORCHESTRATION_PIPELINE", "CAPABILITY_TOKEN", "GENERATOR", "ADAPTER"];
|
|
3
|
+
export type DiscoveryKind = (typeof DISCOVERY_KINDS)[number];
|
|
4
|
+
export type DiscoveryEffectClass = "READ_ONLY_DISCOVERY" | "READ_ONLY_VALIDATION" | "DECLARATIVE_PLANNING" | "WORKSPACE_BOOTSTRAP" | "WORKSPACE_GENERATION" | "WORKSPACE_VERIFICATION";
|
|
5
|
+
export interface DiscoveryCommandTemplate {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly command: string;
|
|
8
|
+
readonly effectClass: DiscoveryEffectClass;
|
|
9
|
+
readonly mutatesWorkspace: boolean;
|
|
10
|
+
readonly executesExternalRuntime: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface DiscoveryEntry {
|
|
13
|
+
readonly id: string;
|
|
14
|
+
readonly kind: DiscoveryKind;
|
|
15
|
+
readonly domains: readonly string[];
|
|
16
|
+
readonly label: string;
|
|
17
|
+
readonly summary: string;
|
|
18
|
+
readonly useWhen: readonly string[];
|
|
19
|
+
readonly avoidWhen: readonly string[];
|
|
20
|
+
readonly intentSignals: readonly string[];
|
|
21
|
+
readonly negativeSignals: readonly string[];
|
|
22
|
+
readonly requiredInputs: readonly string[];
|
|
23
|
+
readonly commandTemplates: readonly DiscoveryCommandTemplate[];
|
|
24
|
+
readonly related: readonly string[];
|
|
25
|
+
readonly source: string;
|
|
26
|
+
readonly extensible: boolean;
|
|
27
|
+
readonly aliases?: readonly string[];
|
|
28
|
+
}
|
|
29
|
+
export interface DiscoveryExecutionBoundary {
|
|
30
|
+
readonly executed: false;
|
|
31
|
+
readonly workspaceMutated: false;
|
|
32
|
+
readonly externalCalls: false;
|
|
33
|
+
readonly requiresExplicitRun: true;
|
|
34
|
+
}
|
|
35
|
+
export interface DiscoveryCatalogFilters {
|
|
36
|
+
readonly kind?: DiscoveryKind | string | null;
|
|
37
|
+
readonly id?: string | null;
|
|
38
|
+
readonly domain?: string | null;
|
|
39
|
+
}
|
|
40
|
+
export interface DiscoveryCatalogPayload extends DiscoveryExecutionBoundary {
|
|
41
|
+
readonly schemaVersion: typeof DISCOVERY_SCHEMA_VERSION;
|
|
42
|
+
readonly command: "descobrir catalogo" | "descobrir pipeline listar";
|
|
43
|
+
readonly success: true;
|
|
44
|
+
readonly mode: "catalog";
|
|
45
|
+
readonly filters: {
|
|
46
|
+
readonly kind: DiscoveryKind | null;
|
|
47
|
+
readonly id: string | null;
|
|
48
|
+
readonly domain: string | null;
|
|
49
|
+
};
|
|
50
|
+
readonly entries: readonly DiscoveryEntry[];
|
|
51
|
+
}
|
|
52
|
+
export interface DiscoveryRecommendation {
|
|
53
|
+
readonly rank: number;
|
|
54
|
+
readonly id: string;
|
|
55
|
+
readonly kind: DiscoveryKind;
|
|
56
|
+
readonly label: string;
|
|
57
|
+
readonly score: number;
|
|
58
|
+
readonly matchedSignals: readonly string[];
|
|
59
|
+
readonly reasons: readonly string[];
|
|
60
|
+
readonly missingInputs: readonly string[];
|
|
61
|
+
readonly suggestedCommandTemplate: string | null;
|
|
62
|
+
}
|
|
63
|
+
export interface DiscoveryAmbiguity {
|
|
64
|
+
readonly detected: boolean;
|
|
65
|
+
readonly delta: number | null;
|
|
66
|
+
readonly candidates: readonly string[];
|
|
67
|
+
}
|
|
68
|
+
export interface DiscoveryRecommendationPayload extends DiscoveryExecutionBoundary {
|
|
69
|
+
readonly schemaVersion: typeof DISCOVERY_SCHEMA_VERSION;
|
|
70
|
+
readonly command: "descobrir recomendar";
|
|
71
|
+
readonly success: true;
|
|
72
|
+
readonly mode: "ranking";
|
|
73
|
+
readonly intent: string;
|
|
74
|
+
readonly recommendations: readonly DiscoveryRecommendation[];
|
|
75
|
+
readonly ambiguity: DiscoveryAmbiguity;
|
|
76
|
+
readonly noMatch: boolean;
|
|
77
|
+
}
|
|
78
|
+
export interface DiscoveryExplainPayload extends DiscoveryExecutionBoundary {
|
|
79
|
+
readonly schemaVersion: typeof DISCOVERY_SCHEMA_VERSION;
|
|
80
|
+
readonly command: "descobrir explicar" | "descobrir pipeline descrever";
|
|
81
|
+
readonly success: true;
|
|
82
|
+
readonly mode: "explain";
|
|
83
|
+
readonly entry: DiscoveryEntry;
|
|
84
|
+
}
|
|
85
|
+
export interface DiscoveryErrorPayload extends DiscoveryExecutionBoundary {
|
|
86
|
+
readonly schemaVersion: typeof DISCOVERY_SCHEMA_VERSION;
|
|
87
|
+
readonly command: "descobrir";
|
|
88
|
+
readonly success: false;
|
|
89
|
+
readonly mode: "error";
|
|
90
|
+
readonly error: {
|
|
91
|
+
readonly code: string;
|
|
92
|
+
readonly message: string;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
export type DiscoveryPayload = DiscoveryCatalogPayload | DiscoveryRecommendationPayload | DiscoveryExplainPayload | DiscoveryErrorPayload;
|
|
96
|
+
export interface DiscoveryCommandResult {
|
|
97
|
+
readonly exitCode: 0 | 2;
|
|
98
|
+
readonly payload: DiscoveryPayload;
|
|
99
|
+
readonly text: string;
|
|
100
|
+
readonly outputFormat: "json" | "text";
|
|
101
|
+
readonly executed: false;
|
|
102
|
+
}
|
|
103
|
+
export interface ResumoDescobertaAgentContext {
|
|
104
|
+
readonly schemaVersion: typeof DISCOVERY_SCHEMA_VERSION;
|
|
105
|
+
readonly command: "sema descobrir catalogo --json";
|
|
106
|
+
readonly kinds: readonly DiscoveryKind[];
|
|
107
|
+
readonly pipelinesPrincipais: readonly {
|
|
108
|
+
readonly id: string;
|
|
109
|
+
readonly label: string;
|
|
110
|
+
readonly command: string;
|
|
111
|
+
}[];
|
|
112
|
+
readonly commands: {
|
|
113
|
+
readonly catalogo: "sema descobrir catalogo --json";
|
|
114
|
+
readonly recomendar: "sema descobrir recomendar --intencao <texto> --json";
|
|
115
|
+
readonly explicar: "sema descobrir explicar <id> --json";
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/** @deprecated Prefira o nome canônico em PT-BR. */
|
|
119
|
+
export type DiscoveryAgentContextSummary = ResumoDescobertaAgentContext;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// SEMA-GOVERNED: sema.produto.descoberta_capacidades
|
|
2
|
+
// Descrição: tipos públicos e fronteira sem efeitos da descoberta de capacidades.
|
|
3
|
+
export const DISCOVERY_SCHEMA_VERSION = "sema.discovery/v1";
|
|
4
|
+
export const DISCOVERY_KINDS = [
|
|
5
|
+
"GOVERNANCE_FLOW",
|
|
6
|
+
"PROFILE_GATE",
|
|
7
|
+
"SPECIALIZED_WORKFLOW",
|
|
8
|
+
"ORCHESTRATION_PIPELINE",
|
|
9
|
+
"CAPABILITY_TOKEN",
|
|
10
|
+
"GENERATOR",
|
|
11
|
+
"ADAPTER",
|
|
12
|
+
];
|
|
13
|
+
//# sourceMappingURL=types.js.map
|
package/dist/drift.part01.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { EngineBanco, NivelConfiancaSemantica, NivelRiscoSemantico, TipoRecursoPersistencia } from "@sema/nucleo";
|
|
2
2
|
import type { ContextoProjetoCarregado } from "./projeto.js";
|
|
3
|
+
import type { PoliticaCacheDrift } from "./driftCache.js";
|
|
4
|
+
import type { MetricasCacheIncrementalDrift } from "./driftCacheIncremental.js";
|
|
5
|
+
import type { MetricasCatalogoDrift, ObservadorOperacaoDrift } from "./driftCatalogo.js";
|
|
3
6
|
export type OrigemCodigoDrift = "ts" | "js" | "py" | "dart" | "lua" | "cs" | "java" | "go" | "rust" | "cpp" | "php";
|
|
4
7
|
export type OrigemSimboloDrift = OrigemCodigoDrift | "sql";
|
|
5
8
|
export interface SimboloResolvido {
|
|
@@ -31,9 +34,11 @@ export interface OpcoesDriftLegado {
|
|
|
31
34
|
escopo?: EscopoDriftReal;
|
|
32
35
|
ignorarWorktrees?: boolean;
|
|
33
36
|
ignorarConsumidoresLaterais?: boolean;
|
|
37
|
+
cache?: PoliticaCacheDrift;
|
|
38
|
+
observador?: ObservadorOperacaoDrift;
|
|
34
39
|
}
|
|
35
40
|
export interface DiagnosticoDrift {
|
|
36
|
-
tipo: "impl_quebrado" | "task_sem_impl" | "rota_divergente" | "recurso_divergente" | "vinculo_quebrado" | "seguranca_frouxa" | "pontuacao_semantica_insuficiente" | "contrato_monolitico" | "codigo_monolitico" | "codigo_governado_sem_cabecalho";
|
|
41
|
+
tipo: "impl_quebrado" | "task_sem_impl" | "rota_divergente" | "recurso_divergente" | "vinculo_quebrado" | "seguranca_frouxa" | "pontuacao_semantica_insuficiente" | "contrato_monolitico" | "codigo_monolitico" | "codigo_governado_sem_cabecalho" | "escopo_estreito_sem_vinculos";
|
|
37
42
|
modulo: string;
|
|
38
43
|
task?: string;
|
|
39
44
|
route?: string;
|
|
@@ -159,6 +164,28 @@ export interface ConfiguracaoEscopoDriftAplicada {
|
|
|
159
164
|
ignorarWorktrees: boolean;
|
|
160
165
|
ignorarConsumidoresLaterais: boolean;
|
|
161
166
|
termosEscopo: string[];
|
|
167
|
+
estrategia?: "arquivos_vinculados" | "projeto";
|
|
168
|
+
cobertura?: "completa" | "parcial";
|
|
169
|
+
arquivosPlanejados?: string[];
|
|
170
|
+
arquivosDeclarados?: string[];
|
|
171
|
+
arquivosInferidos?: string[];
|
|
172
|
+
arquivosAusentes?: string[];
|
|
173
|
+
bloqueios?: string[];
|
|
174
|
+
cache?: {
|
|
175
|
+
politica: PoliticaCacheDrift;
|
|
176
|
+
origem: "cache" | "calculado" | "nao_aplicavel";
|
|
177
|
+
chave?: string;
|
|
178
|
+
incremental?: MetricasCacheIncrementalDrift;
|
|
179
|
+
fasesMs?: {
|
|
180
|
+
planejamento: number;
|
|
181
|
+
catalogacao: number;
|
|
182
|
+
dependencias: number;
|
|
183
|
+
assinaturas: number;
|
|
184
|
+
indexacao: number;
|
|
185
|
+
total: number;
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
catalogo?: MetricasCatalogoDrift;
|
|
162
189
|
}
|
|
163
190
|
export interface RegistroImpactoSemanticoArquivo {
|
|
164
191
|
arquivo: string;
|
|
@@ -251,7 +278,10 @@ export declare function obterDiretoriosIgnoradosAtivos(): Set<string>;
|
|
|
251
278
|
export declare function definirDiretoriosIgnoradosAtivos(diretorios: Set<string>): void;
|
|
252
279
|
export declare function normalizarFragmentoArquivo(valor: string): string;
|
|
253
280
|
export declare function normalizarEscopoDrift(valor?: string): EscopoDriftReal;
|
|
254
|
-
export
|
|
281
|
+
export type OpcoesDriftLegadoResolvidas = Required<Omit<OpcoesDriftLegado, "observador">> & {
|
|
282
|
+
observador?: ObservadorOperacaoDrift;
|
|
283
|
+
};
|
|
284
|
+
export declare function resolverOpcoesDrift(opcoes?: OpcoesDriftLegado): OpcoesDriftLegadoResolvidas;
|
|
255
285
|
export declare function resolverDiretoriosIgnoradosAtivos(opcoes?: OpcoesDriftLegado): Set<string>;
|
|
256
286
|
export declare function quebrarTermosEscopo(valor: string): string[];
|
|
257
287
|
export declare function quebrarTermosModuloEscopo(nomeModulo: string): string[];
|
package/dist/drift.part01.js
CHANGED
|
@@ -91,6 +91,8 @@ export function resolverOpcoesDrift(opcoes) {
|
|
|
91
91
|
escopo: normalizarEscopoDrift(opcoes?.escopo),
|
|
92
92
|
ignorarWorktrees: opcoes?.ignorarWorktrees !== false,
|
|
93
93
|
ignorarConsumidoresLaterais: opcoes?.ignorarConsumidoresLaterais !== false,
|
|
94
|
+
cache: opcoes?.cache === "refresh" || opcoes?.cache === "off" ? opcoes.cache : "auto",
|
|
95
|
+
observador: opcoes?.observador,
|
|
94
96
|
};
|
|
95
97
|
}
|
|
96
98
|
export function resolverDiretoriosIgnoradosAtivos(opcoes) {
|
package/dist/drift.part04.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import ts from "typescript";
|
|
|
2
2
|
import type { IrModulo, IrSuperficie, IrTask, IrVinculo, NivelConfiancaSemantica, NivelRiscoSemantico } from "@sema/nucleo";
|
|
3
3
|
import { ResultadoDrift, SimboloResolvido } from "./drift.part01.js";
|
|
4
4
|
import { type PoliticaPontuacaoSemantica } from "./driftScore.js";
|
|
5
|
+
import type { CatalogoDrift } from "./driftCatalogo.js";
|
|
5
6
|
export declare function resolverArquivoOuSimboloAncora(vinculos: IrVinculo[], simbolos: SimboloResolvido[], mapaImpl: Map<string, SimboloResolvido>, arquivos: string[]): {
|
|
6
7
|
arquivo?: string;
|
|
7
8
|
simbolo?: string;
|
|
@@ -37,9 +38,9 @@ export declare function lerDecorator(node: ts.Node, nomes: string[]): {
|
|
|
37
38
|
argumentos: ts.NodeArray<ts.Expression>;
|
|
38
39
|
} | undefined;
|
|
39
40
|
export declare function juntarCaminhoHttp(base: string | undefined, sufixo: string | undefined): string;
|
|
40
|
-
export declare function listarArquivosRecursivos(diretorio: string, extensoes: string[]): Promise<string[]>;
|
|
41
|
+
export declare function listarArquivosRecursivos(diretorio: string, extensoes: string[], catalogo?: CatalogoDrift): Promise<string[]>;
|
|
41
42
|
export declare const EXTENSOES_ARQUIVOS_RASTREAVEIS_DRIFT: string[];
|
|
42
|
-
export declare function indexarArquivosRastreaveis(diretorios: string[]): Promise<string[]>;
|
|
43
|
+
export declare function indexarArquivosRastreaveis(diretorios: string[], catalogo?: CatalogoDrift): Promise<string[]>;
|
|
43
44
|
export declare function caminhosSimbolicos(baseDiretorio: string, arquivo: string): string[];
|
|
44
45
|
export declare function registrarSimboloTypeScript(simbolos: Map<string, SimboloResolvido>, basesSimbolicas: string[], arquivo: string, nome: string, nomeClasse?: string, origem?: "ts" | "js"): void;
|
|
45
46
|
export declare function desembrulharExpressaoTypeScript(expr: ts.Expression): ts.Expression;
|
package/dist/drift.part04.js
CHANGED
|
@@ -258,7 +258,10 @@ export function juntarCaminhoHttp(base, sufixo) {
|
|
|
258
258
|
const caminho = `/${partes.join("/")}`.replace(/\/+/g, "/");
|
|
259
259
|
return caminho === "//" ? "/" : caminho;
|
|
260
260
|
}
|
|
261
|
-
export async function listarArquivosRecursivos(diretorio, extensoes) {
|
|
261
|
+
export async function listarArquivosRecursivos(diretorio, extensoes, catalogo) {
|
|
262
|
+
if (catalogo) {
|
|
263
|
+
return catalogo.listarPorRaiz(diretorio, extensoes);
|
|
264
|
+
}
|
|
262
265
|
let entradas;
|
|
263
266
|
try {
|
|
264
267
|
entradas = await readdir(diretorio, { withFileTypes: true, encoding: "utf8" });
|
|
@@ -291,10 +294,10 @@ export const EXTENSOES_ARQUIVOS_RASTREAVEIS_DRIFT = [
|
|
|
291
294
|
".yml", ".yaml", ".toml", ".xml", ".html", ".htm", ".css",
|
|
292
295
|
".Caddyfile", ".caddyfile",
|
|
293
296
|
];
|
|
294
|
-
export async function indexarArquivosRastreaveis(diretorios) {
|
|
297
|
+
export async function indexarArquivosRastreaveis(diretorios, catalogo) {
|
|
295
298
|
const arquivos = new Set();
|
|
296
299
|
for (const diretorio of diretorios) {
|
|
297
|
-
for (const arquivo of await listarArquivosRecursivos(diretorio, EXTENSOES_ARQUIVOS_RASTREAVEIS_DRIFT)) {
|
|
300
|
+
for (const arquivo of await listarArquivosRecursivos(diretorio, EXTENSOES_ARQUIVOS_RASTREAVEIS_DRIFT, catalogo)) {
|
|
298
301
|
arquivos.add(arquivo);
|
|
299
302
|
}
|
|
300
303
|
}
|
package/dist/drift.part05.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
2
|
import { RegistroConsumerSurfaceDrift, SimboloResolvido } from "./drift.part01.js";
|
|
3
|
+
import type { CatalogoDrift } from "./driftCatalogo.js";
|
|
3
4
|
export declare function registrarMetodoTypeScriptProtoOuObjeto(simbolos: Map<string, SimboloResolvido>, basesSimbolicas: string[], arquivo: string, nomeMetodo: string, nomeClasse?: string, origem?: "ts" | "js"): void;
|
|
4
5
|
export declare function registrarMetodosObjectAssignTypeScript(simbolos: Map<string, SimboloResolvido>, basesSimbolicas: string[], arquivo: string, objeto: ts.ObjectLiteralExpression, sourceFile: ts.SourceFile, nomeClasse?: string, origem?: "ts" | "js"): void;
|
|
5
6
|
export declare function registrarAtribuicaoPrototypeTypeScript(simbolos: Map<string, SimboloResolvido>, basesSimbolicas: string[], arquivo: string, sourceFile: ts.SourceFile, esquerda: ts.Expression, direita: ts.Expression, origem?: "ts" | "js"): void;
|
|
@@ -43,5 +44,5 @@ export declare function extrairRotasReactViteConsumer(relacaoArquivo: string, co
|
|
|
43
44
|
export declare function normalizarRotaDeclaradaFlutter(caminhoCru: string): string;
|
|
44
45
|
export declare function extrairRotasFlutterConsumer(relacaoArquivo: string, codigo: string): RotaFlutterConsumerDrift[];
|
|
45
46
|
export declare function extrairRotasAngularConsumerDiretas(relacaoArquivo: string, codigo: string, prefixo?: string): RotaAngularConsumerDrift[];
|
|
46
|
-
export declare function extrairRotasAngularConsumer(diretorioBase: string, relacaoArquivo: string, prefixo?: string, visitados?: Set<string
|
|
47
|
+
export declare function extrairRotasAngularConsumer(diretorioBase: string, relacaoArquivo: string, prefixo?: string, visitados?: Set<string>, catalogo?: CatalogoDrift): Promise<RotaAngularConsumerDrift[]>;
|
|
47
48
|
export declare function simboloEhBridgeConsumer(caminho: string, arquivo: string): boolean;
|
package/dist/drift.part05.js
CHANGED
|
@@ -318,7 +318,7 @@ export function extrairRotasAngularConsumerDiretas(relacaoArquivo, codigo, prefi
|
|
|
318
318
|
}
|
|
319
319
|
return rotas;
|
|
320
320
|
}
|
|
321
|
-
export async function extrairRotasAngularConsumer(diretorioBase, relacaoArquivo, prefixo = "/", visitados = new Set()) {
|
|
321
|
+
export async function extrairRotasAngularConsumer(diretorioBase, relacaoArquivo, prefixo = "/", visitados = new Set(), catalogo) {
|
|
322
322
|
const relacaoNormalizada = normalizarRelacaoConsumer(relacaoArquivo);
|
|
323
323
|
if (visitados.has(relacaoNormalizada)) {
|
|
324
324
|
return [];
|
|
@@ -326,7 +326,8 @@ export async function extrairRotasAngularConsumer(diretorioBase, relacaoArquivo,
|
|
|
326
326
|
visitados.add(relacaoNormalizada);
|
|
327
327
|
let codigo = "";
|
|
328
328
|
try {
|
|
329
|
-
|
|
329
|
+
const arquivo = path.join(diretorioBase, relacaoNormalizada);
|
|
330
|
+
codigo = catalogo ? await catalogo.lerTexto(arquivo) : await readFile(arquivo, "utf8");
|
|
330
331
|
}
|
|
331
332
|
catch {
|
|
332
333
|
return [];
|
|
@@ -337,7 +338,7 @@ export async function extrairRotasAngularConsumer(diretorioBase, relacaoArquivo,
|
|
|
337
338
|
if (!rota.arquivoRotasFilhas) {
|
|
338
339
|
continue;
|
|
339
340
|
}
|
|
340
|
-
filhas.push(...await extrairRotasAngularConsumer(diretorioBase, rota.arquivoRotasFilhas, rota.rota, visitados));
|
|
341
|
+
filhas.push(...await extrairRotasAngularConsumer(diretorioBase, rota.arquivoRotasFilhas, rota.rota, visitados, catalogo));
|
|
341
342
|
}
|
|
342
343
|
return [...rotas, ...filhas];
|
|
343
344
|
}
|
package/dist/drift.part06.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { FonteLegado } from "./tipos.js";
|
|
2
2
|
import { ConsumerFramework, RecursoResolvido, RegistroConsumerBridgeDrift, RegistroConsumerSurfaceDrift, RotaResolvida, SimboloResolvido } from "./drift.part01.js";
|
|
3
|
+
import type { CatalogoDrift } from "./driftCatalogo.js";
|
|
3
4
|
export declare function inferirConsumerFrameworkPrincipal(fontesLegado: FonteLegado[], consumerSurfaces: RegistroConsumerSurfaceDrift[], consumerBridges: RegistroConsumerBridgeDrift[]): ConsumerFramework | null;
|
|
4
5
|
export declare function extrairColecoesFirebase(arquivo: string, codigo: string): RecursoResolvido[];
|
|
5
|
-
export declare function indexarTypeScript(diretorios: string[]): Promise<{
|
|
6
|
+
export declare function indexarTypeScript(diretorios: string[], catalogo?: CatalogoDrift): Promise<{
|
|
6
7
|
simbolos: SimboloResolvido[];
|
|
7
8
|
rotas: RotaResolvida[];
|
|
8
9
|
recursos: RecursoResolvido[];
|
package/dist/drift.part06.js
CHANGED
|
@@ -126,13 +126,15 @@ function aplicarReexportacoesTypeScript(simbolos, reexportacoes) {
|
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
export async function indexarTypeScript(diretorios) {
|
|
129
|
+
export async function indexarTypeScript(diretorios, catalogo) {
|
|
130
|
+
catalogo?.emitir("extractor.run");
|
|
130
131
|
const simbolos = new Map();
|
|
131
132
|
const rotas = [];
|
|
132
133
|
const recursos = new Map();
|
|
133
134
|
const consumerSurfaces = new Map();
|
|
135
|
+
const sourceFiles = new Map();
|
|
134
136
|
for (const diretorio of diretorios) {
|
|
135
|
-
const arquivos = (await listarArquivosRecursivos(diretorio, [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs"]))
|
|
137
|
+
const arquivos = (await listarArquivosRecursivos(diretorio, [".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs"], catalogo))
|
|
136
138
|
.filter((arquivo) => !arquivo.endsWith(".d.ts")
|
|
137
139
|
&& !arquivo.endsWith(".spec.ts")
|
|
138
140
|
&& !arquivo.endsWith(".test.ts"));
|
|
@@ -144,7 +146,7 @@ export async function indexarTypeScript(diretorios) {
|
|
|
144
146
|
let encontrouSuperficieAngularPorRotas = false;
|
|
145
147
|
const reexportacoes = [];
|
|
146
148
|
for (const arquivo of arquivos) {
|
|
147
|
-
const codigo = await readFile(arquivo, "utf8");
|
|
149
|
+
const codigo = catalogo ? await catalogo.lerTexto(arquivo) : await readFile(arquivo, "utf8");
|
|
148
150
|
const origemArquivo = /\.(?:js|jsx|mjs|cjs)$/i.test(arquivo) ? "js" : "ts";
|
|
149
151
|
const scriptKind = arquivo.endsWith(".tsx")
|
|
150
152
|
? ts.ScriptKind.TSX
|
|
@@ -153,7 +155,9 @@ export async function indexarTypeScript(diretorios) {
|
|
|
153
155
|
: origemArquivo === "js"
|
|
154
156
|
? ts.ScriptKind.JS
|
|
155
157
|
: ts.ScriptKind.TS;
|
|
158
|
+
catalogo?.emitir("ast.create", arquivo);
|
|
156
159
|
const sourceFile = ts.createSourceFile(arquivo, codigo, ts.ScriptTarget.Latest, true, scriptKind);
|
|
160
|
+
sourceFiles.set(path.resolve(arquivo), sourceFile);
|
|
157
161
|
const basesSimbolicas = caminhosSimbolicos(diretorio, arquivo);
|
|
158
162
|
const relacao = path.relative(diretorio, arquivo);
|
|
159
163
|
for (const recurso of extrairRecursosPersistenciaCodigoVivo(arquivo, codigo)) {
|
|
@@ -228,7 +232,7 @@ export async function indexarTypeScript(diretorios) {
|
|
|
228
232
|
}
|
|
229
233
|
if (arquivoEhRotasAngularConsumer(relacao) && (!usarApenasRotasAngularRaiz || arquivosRotasAngularRaiz.has(path.resolve(arquivo)))) {
|
|
230
234
|
encontrouSuperficieAngularPorRotas = true;
|
|
231
|
-
for (const rotaAngular of await extrairRotasAngularConsumer(diretorio, relacao)) {
|
|
235
|
+
for (const rotaAngular of await extrairRotasAngularConsumer(diretorio, relacao, "/", new Set(), catalogo)) {
|
|
232
236
|
const arquivoRotasAngular = path.join(diretorio, rotaAngular.arquivoRotas);
|
|
233
237
|
consumerSurfaces.set(`${rotaAngular.rota}:${arquivoRotasAngular}:routes`, {
|
|
234
238
|
rota: rotaAngular.rota,
|
|
@@ -328,7 +332,7 @@ export async function indexarTypeScript(diretorios) {
|
|
|
328
332
|
}
|
|
329
333
|
}
|
|
330
334
|
if (!encontrouSuperficieAngularPorRotas) {
|
|
331
|
-
for (const superficie of await coletarSuperficiesAngularStandaloneConsumer(diretorio, arquivos)) {
|
|
335
|
+
for (const superficie of await coletarSuperficiesAngularStandaloneConsumer(diretorio, arquivos, catalogo ? (arquivo) => catalogo.lerTexto(arquivo) : undefined, sourceFiles)) {
|
|
332
336
|
const arquivoSuperficie = path.join(diretorio, superficie.arquivo);
|
|
333
337
|
consumerSurfaces.set(`${superficie.rota}:${arquivoSuperficie}:${superficie.tipoArquivo}`, {
|
|
334
338
|
rota: superficie.rota,
|
package/dist/drift.part07.d.ts
CHANGED
|
@@ -1,51 +1,52 @@
|
|
|
1
1
|
import type { EngineBanco } from "@sema/nucleo";
|
|
2
2
|
import { OrigemRecursoDrift, RecursoResolvido, RegistroColunaPersistenciaDrift, RegistroConsumerSurfaceDrift, RotaResolvida, SimboloResolvido } from "./drift.part01.js";
|
|
3
|
-
|
|
3
|
+
import type { CatalogoDrift } from "./driftCatalogo.js";
|
|
4
|
+
export declare function indexarPython(diretorios: string[], catalogo?: CatalogoDrift): Promise<{
|
|
4
5
|
simbolos: SimboloResolvido[];
|
|
5
6
|
rotas: RotaResolvida[];
|
|
6
7
|
recursos: RecursoResolvido[];
|
|
7
8
|
}>;
|
|
8
|
-
export declare function indexarDart(diretorios: string[]): Promise<{
|
|
9
|
+
export declare function indexarDart(diretorios: string[], catalogo?: CatalogoDrift): Promise<{
|
|
9
10
|
simbolos: SimboloResolvido[];
|
|
10
11
|
rotas: RotaResolvida[];
|
|
11
12
|
recursos: RecursoResolvido[];
|
|
12
13
|
consumerSurfaces: RegistroConsumerSurfaceDrift[];
|
|
13
14
|
}>;
|
|
14
15
|
export declare function registrarSimboloGenerico(simbolos: Map<string, SimboloResolvido>, origem: SimboloResolvido["origem"], basesSimbolicas: string[], arquivo: string, simbolo: string): void;
|
|
15
|
-
export declare function indexarDotnet(diretorios: string[]): Promise<{
|
|
16
|
+
export declare function indexarDotnet(diretorios: string[], catalogo?: CatalogoDrift): Promise<{
|
|
16
17
|
simbolos: SimboloResolvido[];
|
|
17
18
|
rotas: RotaResolvida[];
|
|
18
19
|
recursos: RecursoResolvido[];
|
|
19
20
|
}>;
|
|
20
|
-
export declare function indexarJava(diretorios: string[]): Promise<{
|
|
21
|
+
export declare function indexarJava(diretorios: string[], catalogo?: CatalogoDrift): Promise<{
|
|
21
22
|
simbolos: SimboloResolvido[];
|
|
22
23
|
rotas: RotaResolvida[];
|
|
23
24
|
recursos: RecursoResolvido[];
|
|
24
25
|
}>;
|
|
25
|
-
export declare function indexarGo(diretorios: string[]): Promise<{
|
|
26
|
+
export declare function indexarGo(diretorios: string[], catalogo?: CatalogoDrift): Promise<{
|
|
26
27
|
simbolos: SimboloResolvido[];
|
|
27
28
|
rotas: RotaResolvida[];
|
|
28
29
|
recursos: RecursoResolvido[];
|
|
29
30
|
}>;
|
|
30
|
-
export declare function indexarRust(diretorios: string[]): Promise<{
|
|
31
|
+
export declare function indexarRust(diretorios: string[], catalogo?: CatalogoDrift): Promise<{
|
|
31
32
|
simbolos: SimboloResolvido[];
|
|
32
33
|
rotas: RotaResolvida[];
|
|
33
34
|
recursos: RecursoResolvido[];
|
|
34
35
|
}>;
|
|
35
|
-
export declare function indexarCpp(diretorios: string[]): Promise<{
|
|
36
|
+
export declare function indexarCpp(diretorios: string[], catalogo?: CatalogoDrift): Promise<{
|
|
36
37
|
simbolos: SimboloResolvido[];
|
|
37
38
|
recursos: RecursoResolvido[];
|
|
38
39
|
}>;
|
|
39
|
-
export declare function indexarPhp(diretorios: string[]): Promise<{
|
|
40
|
+
export declare function indexarPhp(diretorios: string[], catalogo?: CatalogoDrift): Promise<{
|
|
40
41
|
simbolos: SimboloResolvido[];
|
|
41
42
|
rotas: RotaResolvida[];
|
|
42
43
|
recursos: RecursoResolvido[];
|
|
43
44
|
}>;
|
|
44
|
-
export declare function indexarLua(diretorios: string[]): Promise<{
|
|
45
|
+
export declare function indexarLua(diretorios: string[], catalogo?: CatalogoDrift): Promise<{
|
|
45
46
|
simbolos: SimboloResolvido[];
|
|
46
47
|
recursos: RecursoResolvido[];
|
|
47
48
|
}>;
|
|
48
|
-
export declare function indexarPersistenciaDeclarativa(diretorios: string[]): Promise<{
|
|
49
|
+
export declare function indexarPersistenciaDeclarativa(diretorios: string[], catalogo?: CatalogoDrift): Promise<{
|
|
49
50
|
recursos: RecursoResolvido[];
|
|
50
51
|
simbolos: SimboloResolvido[];
|
|
51
52
|
}>;
|