@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
|
@@ -26,7 +26,6 @@ const OPCOES_COM_VALOR_CONTEUDO = new Set([
|
|
|
26
26
|
"--revocation-digest",
|
|
27
27
|
]);
|
|
28
28
|
const SUBCOMANDOS_CONTEUDO = new Set([
|
|
29
|
-
"ajuda",
|
|
30
29
|
"capabilities",
|
|
31
30
|
"validar",
|
|
32
31
|
"planejar",
|
|
@@ -35,36 +34,6 @@ const SUBCOMANDOS_CONTEUDO = new Set([
|
|
|
35
34
|
"status",
|
|
36
35
|
"projetar",
|
|
37
36
|
]);
|
|
38
|
-
const USOS_PIPELINE_CONTEUDO = [
|
|
39
|
-
"sema conteudo capabilities --json",
|
|
40
|
-
"sema conteudo validar <definition.json> --json",
|
|
41
|
-
"sema conteudo planejar <definition.json> --alvos-arquivo <targets.json> --json",
|
|
42
|
-
"sema conteudo validar-envelope --envelope-arquivo <envelope.json> --confianca-arquivo <trust.json> --trust-root-digest <sha256:...> --revocation-digest <sha256:...> --payload-type <type> --json",
|
|
43
|
-
"sema conteudo registrar <ledger.ndjson> --envelope-arquivo <envelope.json> --politica-arquivo <policy-envelope.json> --confianca-arquivo <trust.json> --trust-root-digest <sha256:...> --revocation-digest <sha256:...> --ledger-id <id> --expected-head <sha256:...> --json",
|
|
44
|
-
"sema conteudo status <definition.json> --politica-arquivo <policy-envelope.json> --confianca-arquivo <trust.json> --trust-root-digest <sha256:...> --revocation-digest <sha256:...> --ledger-arquivo <ledger.ndjson> --expected-head <sha256:...> --json",
|
|
45
|
-
"sema conteudo projetar <definition.json> --politica-arquivo <policy-envelope.json> --confianca-arquivo <trust.json> --trust-root-digest <sha256:...> --revocation-digest <sha256:...> --ledger-arquivo <ledger.ndjson> --expected-head <sha256:...> --saida <manifest.json> --json",
|
|
46
|
-
];
|
|
47
|
-
function ajudaPipelineConteudo() {
|
|
48
|
-
const mensagem = [
|
|
49
|
-
"Sema Content Pipeline — controle AI-native multicanal e multiformato.",
|
|
50
|
-
"",
|
|
51
|
-
"Uso:",
|
|
52
|
-
...USOS_PIPELINE_CONTEUDO.map((uso) => ` ${uso}`),
|
|
53
|
-
"",
|
|
54
|
-
"O runner é externo e avança somente pelos nextActions derivados pelo Sema.",
|
|
55
|
-
"Evidências entram como envelopes assinados; vereditos e transições não são escritos manualmente.",
|
|
56
|
-
"Não existe revisão humana nativa. Chaves privadas permanecem nos processos signatários independentes.",
|
|
57
|
-
].join("\n");
|
|
58
|
-
return {
|
|
59
|
-
sucesso: true,
|
|
60
|
-
comando: "ajuda",
|
|
61
|
-
mensagem,
|
|
62
|
-
usos: USOS_PIPELINE_CONTEUDO,
|
|
63
|
-
nativeHumanReview: false,
|
|
64
|
-
runner: "external",
|
|
65
|
-
canonicalState: "signed_hash_chained_ledger",
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
37
|
const CAUSAS_PUBLICAS_CONTEUDO = [
|
|
69
38
|
"expected_head_divergente",
|
|
70
39
|
"trust_root_digest_divergente",
|
|
@@ -394,15 +363,11 @@ async function registrarEnvelopeLocal(args, ledgerArquivo) {
|
|
|
394
363
|
}
|
|
395
364
|
export async function comandoPipelineConteudo(_posicionaisGlobais, args, emJson) {
|
|
396
365
|
const posicionais = posicionaisConteudo(args);
|
|
397
|
-
const
|
|
398
|
-
const subcomando = solicitouAjuda ? "ajuda" : posicionais[0] ?? "capabilities";
|
|
366
|
+
const subcomando = posicionais[0] ?? "capabilities";
|
|
399
367
|
const comandoPublico = SUBCOMANDOS_CONTEUDO.has(subcomando) ? subcomando : "desconhecido";
|
|
400
368
|
try {
|
|
401
369
|
let payload;
|
|
402
370
|
switch (subcomando) {
|
|
403
|
-
case "ajuda":
|
|
404
|
-
payload = ajudaPipelineConteudo();
|
|
405
|
-
break;
|
|
406
371
|
case "capabilities":
|
|
407
372
|
payload = {
|
|
408
373
|
sucesso: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AchadoProfile, MaturidadeProfile,
|
|
1
|
+
import type { AchadoProfile, MaturidadeProfile, PerfilSemanticoValidavel, PresetProfile } from "./profileAuthorTipos.js";
|
|
2
2
|
export declare function avaliarArtefatoSoftwareProfile(contrato: string, artefato: string, maturidade: MaturidadeProfile, preset: PresetProfile | null): AchadoProfile[];
|
|
3
3
|
export declare function avaliarArtefatoWorkflowProfile(contrato: string, artefato: string, preset: PresetProfile | null): AchadoProfile[];
|
|
4
4
|
export declare function avaliarArtefatoOpsProfile(artefato: string, preset: PresetProfile | null): AchadoProfile[];
|
|
@@ -7,5 +7,6 @@ export declare function avaliarArtefatoResearchProfile(artefato: string, preset:
|
|
|
7
7
|
export declare function avaliarArtefatoRedacaoProfile(artefato: string, preset: PresetProfile | null): AchadoProfile[];
|
|
8
8
|
export declare function avaliarArtefatoPropostasProfile(artefato: string, preset: PresetProfile | null): AchadoProfile[];
|
|
9
9
|
export declare function avaliarArtefatoGameProfile(artefato: string, preset: PresetProfile | null): AchadoProfile[];
|
|
10
|
+
export declare function avaliarArtefatoSimulationProfile(artefato: string, preset: PresetProfile | null): AchadoProfile[];
|
|
10
11
|
export declare function avaliarArtefatoConversasProfile(artefato: string, preset: PresetProfile | null): AchadoProfile[];
|
|
11
|
-
export declare function avaliarArtefatoProfile(profile:
|
|
12
|
+
export declare function avaliarArtefatoProfile(profile: PerfilSemanticoValidavel, contrato: string, artefato: string | null | undefined, maturidade: MaturidadeProfile, preset: PresetProfile | null): AchadoProfile[];
|
|
@@ -281,6 +281,85 @@ export function avaliarArtefatoGameProfile(artefato, preset) {
|
|
|
281
281
|
}
|
|
282
282
|
return achados;
|
|
283
283
|
}
|
|
284
|
+
export function avaliarArtefatoSimulationProfile(artefato, preset) {
|
|
285
|
+
const achados = validarTermosObrigatoriosArtefato(artefato, [
|
|
286
|
+
{ id: "simulation_modelo_artefato", descricao: "artefato declara modelo testavel", regex: /modelo|model/i, sugestao: "declare o modelo testavel do simulador." },
|
|
287
|
+
{ id: "simulation_assumptions_artefato", descricao: "artefato declara assumptions ou premissas", regex: /assumptions?|premissas?/i, sugestao: "declare assumptions ou premissas e seus limites." },
|
|
288
|
+
{ id: "simulation_condicoes_iniciais_artefato", descricao: "artefato declara condicoes iniciais", regex: /condicoes?[_ -]?iniciais|initial[_ -]?conditions?/i, sugestao: "declare o estado e os parametros iniciais do simulador." },
|
|
289
|
+
{ id: "simulation_condicoes_contorno_artefato", descricao: "artefato declara condicoes de contorno", regex: /condicoes?[_ -]?contorno|boundary[_ -]?conditions?/i, sugestao: "declare limites, fronteiras e condicoes de contorno." },
|
|
290
|
+
{ id: "simulation_outputs_unidades_artefato", descricao: "artefato declara outputs observaveis e unidades", regex: /(?:outputs?|saidas?|resultados?)[\s\S]{0,180}(?:unidades?|units?)|(?:unidades?|units?)[\s\S]{0,180}(?:outputs?|saidas?|resultados?)/i, sugestao: "declare outputs observaveis com unidades explicitas." },
|
|
291
|
+
{ id: "simulation_spatial_model_artefato", descricao: "artefato declara modelo espacial", regex: /spatial[_ -]?model|modelo[_ -]?espacial/i, sugestao: "declare NON_SPATIAL, TWO_D, TWO_POINT_FIVE_D ou THREE_D como spatial_model." },
|
|
292
|
+
{ id: "simulation_render_mode_artefato", descricao: "artefato declara modo de renderizacao", regex: /render[_ -]?mode|modo[_ -]?(?:de[_ -]?)?render/i, sugestao: "declare HEADLESS, TEXT, VISUAL ou XR como render_mode." },
|
|
293
|
+
{ id: "simulation_visual_profile_artefato", descricao: "artefato declara visual profile separado", regex: /visual[_ -]?profile|perfil[_ -]?visual/i, sugestao: "declare o visual profile separadamente de spatial_model e render_mode; 8/16-bit pertencem ao visual profile." },
|
|
294
|
+
{ id: "simulation_validation_artefato", descricao: "artefato declara metodo de validacao do modelo", regex: /validation|validacao|validar[_ -]?modelo/i, sugestao: "declare como outputs, invariantes e tolerancias validam o modelo." },
|
|
295
|
+
{ id: "simulation_controle_tempo_artefato", descricao: "artefato declara controle e modelo de tempo", regex: /(?:controle|control(?:[_ -]?modes?)?)[\s\S]{0,180}(?:tempo|time[_ -]?model|fixed[_ -]?step|real[_ -]?time|event[_ -]?driven)|(?:tempo|time[_ -]?model)[\s\S]{0,180}(?:controle|control(?:[_ -]?modes?)?)/i, sugestao: "declare modo de controle e modelo de tempo de forma independente." },
|
|
296
|
+
{ id: "simulation_fidelidade_artefato", descricao: "artefato declara nivel de fidelidade", regex: /fidelity|fidelidade|ARCADE|STYLIZED|SYSTEMIC|REALISTIC|CALIBRATED/i, sugestao: "declare o nivel de fidelidade sem inferi-lo da aparencia visual." },
|
|
297
|
+
{ id: "simulation_incerteza_artefato", descricao: "artefato declara incerteza ou limites do modelo", regex: /incerteza|uncertainty|intervalo[_ -]?confianca|confidence[_ -]?interval/i, severidade: "warning", sugestao: "registre incerteza, limites e validade esperada do modelo." },
|
|
298
|
+
{ id: "simulation_telemetria_replay_artefato", descricao: "artefato declara telemetria, snapshot ou replay", regex: /telemetria|telemetry|metricas?|snapshot|replay|event[_ -]?log|state[_ -]?digest/i, severidade: "warning", sugestao: "adicione evidencia observavel, snapshot e replay quando aplicavel." },
|
|
299
|
+
]);
|
|
300
|
+
const representacaoLegada = /["']?(?:representation|representacao)["']?\s*[:=]/i;
|
|
301
|
+
if (contemArtefatoProfile(artefato, representacaoLegada)) {
|
|
302
|
+
achados.push(criarAchadoArtefatoProfile("simulation_representacao_legada", "campo unico de representacao conflita modelo espacial e renderizacao", false, "critical", trechoRegexProfile(artefato, representacaoLegada), "substitua por spatial_model e render_mode ortogonais.", "THREE_D com HEADLESS deve preservar ambos os eixos."));
|
|
303
|
+
}
|
|
304
|
+
const pixelComoEixo = /["']?(?:spatial[_ -]?model|modelo[_ -]?espacial|render[_ -]?mode|modo[_ -]?(?:de[_ -]?)?render)["']?\s*[:=]\s*["']?(?:PIXEL[_ -]?(?:8|16)[_ -]?BIT|(?:8|16)[_ -]?BIT)/i;
|
|
305
|
+
if (contemArtefatoProfile(artefato, pixelComoEixo)) {
|
|
306
|
+
achados.push(criarAchadoArtefatoProfile("simulation_pixel_como_eixo", "8/16-bit foi usado como eixo espacial ou de render em vez de visual profile", false, "critical", trechoRegexProfile(artefato, pixelComoEixo), "use um spatial_model e render_mode validos e mova PIXEL_8_BIT/PIXEL_16_BIT para visual_profile.", "estetica retro nao define a dimensionalidade nem o modo de execucao do simulador."));
|
|
307
|
+
}
|
|
308
|
+
const headless = avaliarPresencaPositivaArtefato(artefato, /["']?(?:render[_ -]?mode|modo[_ -]?(?:de[_ -]?)?render)["']?\s*[:=]\s*["']?HEADLESS/i).atendido;
|
|
309
|
+
if (headless) {
|
|
310
|
+
achados.push(...validarTermosObrigatoriosArtefato(artefato, [
|
|
311
|
+
{ id: "simulation_headless_visual_none", descricao: "simulacao headless usa visual profile NONE", regex: /["']?(?:visual[_ -]?profile|perfil[_ -]?visual)["']?\s*[:=]\s*["']?NONE/i, sugestao: "defina visual_profile NONE quando render_mode for HEADLESS." },
|
|
312
|
+
]));
|
|
313
|
+
}
|
|
314
|
+
const xr = avaliarPresencaPositivaArtefato(artefato, /["']?(?:render[_ -]?mode|modo[_ -]?(?:de[_ -]?)?render)["']?\s*[:=]\s*["']?XR/i).atendido;
|
|
315
|
+
if (xr) {
|
|
316
|
+
achados.push(...validarTermosObrigatoriosArtefato(artefato, [
|
|
317
|
+
{ id: "simulation_xr_spatial_three_d", descricao: "render XR usa spatial model THREE_D", regex: /["']?(?:spatial[_ -]?model|modelo[_ -]?espacial)["']?\s*[:=]\s*["']?THREE_D/i, sugestao: "defina spatial_model THREE_D quando render_mode for XR." },
|
|
318
|
+
]));
|
|
319
|
+
}
|
|
320
|
+
const exigeCalibracao = preset === "calibration" || avaliarPresencaPositivaArtefato(artefato, /fidelity["'\s:=]+(?:REALISTIC|CALIBRATED)|fidelidade["'\s:=]+(?:realista|calibrada)/i).atendido;
|
|
321
|
+
if (exigeCalibracao) {
|
|
322
|
+
achados.push(...validarTermosObrigatoriosArtefato(artefato, [
|
|
323
|
+
{ id: "simulation_calibration_referencia_artefato", descricao: "calibracao declara referencia ou dataset rastreavel", regex: /referencia|reference|dataset|baseline/i, severidade: "critical", sugestao: "vincule dataset, baseline ou referencia versionada." },
|
|
324
|
+
{ id: "simulation_calibration_metodo_artefato", descricao: "calibracao declara metodo reproduzivel", regex: /(?:calibracao|calibration)[\s\S]{0,140}(?:metodo|method|procedimento|procedure)|(?:metodo|method)[\s\S]{0,140}(?:calibracao|calibration)/i, severidade: "critical", sugestao: "declare metodo e parametros reproduziveis de calibracao." },
|
|
325
|
+
{ id: "simulation_calibration_tolerancia_artefato", descricao: "calibracao declara tolerancia numerica com unidade", regex: /(?:tolerancias?|tolerances?|erro|error)[^\n\r]{0,120}(?:<=|>=|=|:)?\s*\d+(?:[.,]\d+)?\s*(?:%|percent|por cento|ms|s|m|km|kg|g|K|C|Hz|Pa|N)\b/i, severidade: "critical", sugestao: "declare tolerancia numerica, criterio de erro e unidade." },
|
|
326
|
+
{ id: "simulation_calibration_incerteza_telemetria_artefato", descricao: "calibracao declara incerteza e telemetria observavel", regex: /(?:incerteza|uncertainty)[\s\S]{0,180}(?:telemetria|telemetry|metricas?)|(?:telemetria|telemetry)[\s\S]{0,180}(?:incerteza|uncertainty)/i, severidade: "blocking", sugestao: "registre incerteza e telemetria usadas para validar a calibracao." },
|
|
327
|
+
]));
|
|
328
|
+
}
|
|
329
|
+
const exigeDeterminismo = preset === "deterministic" || avaliarPresencaPositivaArtefato(artefato, /["']?(?:determinism|determinismo)["']?\s*[:=]\s*["']?(?:STRICT|SEEDED|DETERMINISTIC)|\bdeterministic\b/i).atendido;
|
|
330
|
+
if (exigeDeterminismo) {
|
|
331
|
+
achados.push(...validarTermosObrigatoriosArtefato(artefato, [
|
|
332
|
+
{ id: "simulation_deterministic_seed_artefato", descricao: "execucao deterministica declara seed", regex: /\bseed\b|semente[_ -]?aleatoria/i, sugestao: "declare a seed de cada execucao." },
|
|
333
|
+
{ id: "simulation_deterministic_step_artefato", descricao: "execucao deterministica declara passo reproduzivel", regex: /fixed[_ -]?step|passo[_ -]?fixo|passo[_ -]?reprodutivel|time[_ -]?step/i, sugestao: "declare fixed step ou passo reproduzivel." },
|
|
334
|
+
{ id: "simulation_deterministic_snapshot_artefato", descricao: "execucao deterministica declara snapshot ou digest de estado", regex: /snapshot|state[_ -]?digest|hash[_ -]?estado|estado[_ -]?hash/i, sugestao: "capture snapshot e digest do estado por etapa relevante." },
|
|
335
|
+
{ id: "simulation_deterministic_replay_artefato", descricao: "execucao deterministica declara replay ou event log", regex: /replay|event[_ -]?log|result[_ -]?digest|log[_ -]?eventos/i, sugestao: "preserve replay/event log e digest do resultado." },
|
|
336
|
+
]));
|
|
337
|
+
}
|
|
338
|
+
if (preset === "scenario") {
|
|
339
|
+
achados.push(...validarTermosObrigatoriosArtefato(artefato, [
|
|
340
|
+
{ id: "simulation_scenario_id_artefato", descricao: "cenario possui identidade estavel", regex: /scenario[_ -]?id|cenario[_ -]?id|id[_ -]?cenario/i, sugestao: "declare scenario_id estavel." },
|
|
341
|
+
{ id: "simulation_scenario_acceptance_artefato", descricao: "cenario possui resultado esperado e aceite", regex: /acceptance|aceitacao|resultado[_ -]?esperado|expected[_ -]?output/i, sugestao: "declare outputs esperados e criterios de aceitacao." },
|
|
342
|
+
]));
|
|
343
|
+
}
|
|
344
|
+
if (preset === "batch") {
|
|
345
|
+
achados.push(...validarTermosObrigatoriosArtefato(artefato, [
|
|
346
|
+
{ id: "simulation_batch_runs_artefato", descricao: "batch declara repeticoes ou ensemble", regex: /batch|lote|ensemble|replications?|repeticoes?/i, sugestao: "declare quantidade de runs ou replications do batch." },
|
|
347
|
+
{ id: "simulation_batch_seed_strategy_artefato", descricao: "batch declara estrategia de seeds", regex: /seed[_ -]?strategy|estrategia[_ -]?(?:de[_ -]?)?seeds?/i, sugestao: "declare estrategia de seeds por run." },
|
|
348
|
+
{ id: "simulation_batch_aggregation_artefato", descricao: "batch declara agregacao de outputs", regex: /aggregation|agregacao|percentil|media|mediana|distribution|distribuicao/i, sugestao: "declare como outputs dos runs serao agregados." },
|
|
349
|
+
{ id: "simulation_batch_budget_stop_artefato", descricao: "batch declara budget e condicao de parada", regex: /(?:resource[_ -]?budget|time[_ -]?budget|orcamento|limite)[\s\S]{0,180}(?:stop[_ -]?condition|criterio[_ -]?parada|max[_ -]?runs)|(?:stop[_ -]?condition|criterio[_ -]?parada)[\s\S]{0,180}(?:budget|orcamento|limite)/i, sugestao: "declare limite de recursos/tempo e condicao de parada do batch." },
|
|
350
|
+
]));
|
|
351
|
+
}
|
|
352
|
+
const exigeSafety = preset === "safety" || avaliarPresencaPositivaArtefato(artefato, /AUTONOMOUS|UNCONTROLLED|autonom[oa]/i).atendido;
|
|
353
|
+
if (exigeSafety) {
|
|
354
|
+
achados.push(...validarTermosObrigatoriosArtefato(artefato, [
|
|
355
|
+
{ id: "simulation_safety_authority_artefato", descricao: "autonomia declara fronteira de autoridade", regex: /authority[_ -]?boundary|fronteira[_ -]?(?:de[_ -]?)?autoridade|escopo[_ -]?autonomia/i, severidade: "critical", sugestao: "delimite o que o controlador autonomo pode observar e alterar." },
|
|
356
|
+
{ id: "simulation_safety_budget_artefato", descricao: "autonomia declara budget de recursos ou tempo", regex: /resource[_ -]?budget|time[_ -]?budget|orcamento[_ -]?(?:de[_ -]?)?recursos|limite[_ -]?(?:de[_ -]?)?(?:tempo|recursos)/i, severidade: "critical", sugestao: "declare limites de tempo, memoria, CPU, iteracoes ou custo." },
|
|
357
|
+
{ id: "simulation_safety_stop_artefato", descricao: "autonomia declara condicao de parada ou kill switch", regex: /stop[_ -]?condition|criterio[_ -]?(?:de[_ -]?)?parada|kill[_ -]?switch|emergency[_ -]?stop/i, severidade: "critical", sugestao: "declare condicao de parada verificavel e mecanismo de interrupcao." },
|
|
358
|
+
{ id: "simulation_safety_failsafe_artefato", descricao: "autonomia declara fail-safe, isolamento ou tomada humana", regex: /fail[_ -]?safe|failsafe|human[_ -]?takeover|tomada[_ -]?humana|isolamento|sandbox/i, severidade: "critical", sugestao: "declare fail-safe, isolamento e quando um humano assume o controle." },
|
|
359
|
+
]));
|
|
360
|
+
}
|
|
361
|
+
return achados;
|
|
362
|
+
}
|
|
284
363
|
export function avaliarArtefatoConversasProfile(artefato, preset) {
|
|
285
364
|
const achados = validarTermosObrigatoriosArtefato(artefato, [
|
|
286
365
|
{ id: "conversas_tom_artefato", descricao: "artefato declara tom/persona da conversa", regex: /tom|persona|voz|formalidade|comercial|persuasiv|serio|consultiv/i, sugestao: "declare o tom, persona e nivel de formalidade usados na resposta." },
|
|
@@ -366,6 +445,8 @@ export function avaliarArtefatoProfile(profile, contrato, artefato, maturidade,
|
|
|
366
445
|
return avaliarArtefatoPropostasProfile(artefato, preset);
|
|
367
446
|
case "game":
|
|
368
447
|
return avaliarArtefatoGameProfile(artefato, preset);
|
|
448
|
+
case "simulation":
|
|
449
|
+
return avaliarArtefatoSimulationProfile(artefato, preset);
|
|
369
450
|
case "conversas":
|
|
370
451
|
return avaliarArtefatoConversasProfile(artefato, preset);
|
|
371
452
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { compilarCodigo } from "@sema/nucleo";
|
|
2
2
|
export type PerfilSemantico = "software" | "workflow" | "ops" | "game" | "legal" | "research" | "redacao" | "propostas" | "conversas";
|
|
3
|
-
export type
|
|
3
|
+
export type PerfilSemanticoValidavel = PerfilSemantico | "simulation";
|
|
4
|
+
export type ProfileGovernanca = PerfilSemanticoValidavel | "author";
|
|
4
5
|
export type SeveridadeProfile = "info" | "warning" | "blocking" | "critical";
|
|
5
6
|
export type MaturidadeProfile = "draft" | "prototype" | "production" | "critical";
|
|
6
7
|
export type DecisaoAgenteProfile = "continuar" | "continuar_com_ressalva" | "parar" | "chamar_humano";
|
|
7
8
|
export type FonteAchadoProfile = "contrato" | "artefato" | "preset";
|
|
8
9
|
export type ConfiancaValidacaoProfile = "alta" | "media" | "parcial" | "baixa";
|
|
9
|
-
export type PresetProfile = "api" | "modulo" | "refactor" | "persistencia" | "security" | "webhook" | "fila" | "n8n" | "cron" | "integracao" | "deploy" | "migration" | "incidente" | "rollback" | "critical" | "lgpd" | "contrato" | "dpa" | "termos_uso" | "privacidade" | "due_diligence" | "compliance" | "rapida" | "tecnica" | "decisoria" | "critica" | "editorial" | "materia" | "blog" | "seo" | "reescrita" | "marketplace" | "freela" | "consultiva" | "diagnostico" | "score90" | "casual" | "arcade" | "rpg" | "economia" | "playtest" | "atendimento" | "vendas" | "suporte" | "qualificacao" | "retencao" | "cobranca";
|
|
10
|
+
export type PresetProfile = "api" | "modulo" | "refactor" | "persistencia" | "security" | "webhook" | "fila" | "n8n" | "cron" | "integracao" | "deploy" | "migration" | "incidente" | "rollback" | "critical" | "lgpd" | "contrato" | "dpa" | "termos_uso" | "privacidade" | "due_diligence" | "compliance" | "rapida" | "tecnica" | "decisoria" | "critica" | "editorial" | "materia" | "blog" | "seo" | "reescrita" | "marketplace" | "freela" | "consultiva" | "diagnostico" | "score90" | "casual" | "arcade" | "rpg" | "economia" | "playtest" | "model" | "scenario" | "calibration" | "deterministic" | "batch" | "safety" | "atendimento" | "vendas" | "suporte" | "qualificacao" | "retencao" | "cobranca";
|
|
10
11
|
export interface RequisitoProfile {
|
|
11
12
|
id: string;
|
|
12
13
|
descricao: string;
|
|
@@ -81,7 +82,7 @@ export interface OpcoesProfileValidar {
|
|
|
81
82
|
export interface ResultadoProfileValidar {
|
|
82
83
|
comando: "profile validar";
|
|
83
84
|
sucesso: boolean;
|
|
84
|
-
profile:
|
|
85
|
+
profile: PerfilSemanticoValidavel;
|
|
85
86
|
arquivo: string;
|
|
86
87
|
modulo: string | null;
|
|
87
88
|
maturidade: MaturidadeProfile;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { CapabilityProfile, MaturidadeProfile,
|
|
2
|
-
export declare const REQUISITOS_PROFILE: Record<
|
|
1
|
+
import type { CapabilityProfile, MaturidadeProfile, PerfilSemanticoValidavel, PresetProfile, ProfileGovernanca, RequisitoProfile } from "./profileAuthorTipos.js";
|
|
2
|
+
export declare const REQUISITOS_PROFILE: Record<PerfilSemanticoValidavel, RequisitoProfile[]>;
|
|
3
3
|
export declare const REQUISITOS_PROFILE_COMUNS: RequisitoProfile[];
|
|
4
|
-
export declare const ALIASES_PROFILE: Record<string,
|
|
5
|
-
export declare function normalizarProfileSemantico(valor: string | undefined):
|
|
4
|
+
export declare const ALIASES_PROFILE: Record<string, PerfilSemanticoValidavel>;
|
|
5
|
+
export declare function normalizarProfileSemantico(valor: string | undefined): PerfilSemanticoValidavel | null;
|
|
6
6
|
export declare function normalizarMaturidadeProfile(valor: string | undefined): MaturidadeProfile;
|
|
7
|
-
export declare const PRESETS_PROFILE: Record<
|
|
7
|
+
export declare const PRESETS_PROFILE: Record<PerfilSemanticoValidavel, PresetProfile[]>;
|
|
8
8
|
export declare const CAPABILITY_MATRIX_GOVERNANCA: Record<ProfileGovernanca, CapabilityProfile>;
|
package/dist/profileCatalogo.js
CHANGED
|
@@ -27,6 +27,14 @@ export const REQUISITOS_PROFILE = {
|
|
|
27
27
|
{ id: "falha_balanceamento", descricao: "modela falha, balanceamento e abuso", termos: [/falha|derrota|erro/i, /balanceamento|abuso|exploit/i], obrigatorio: true },
|
|
28
28
|
{ id: "telemetria_jogo", descricao: "define telemetria ou replay de decisao", termos: [/telemetria|replay|metricas/i], obrigatorio: false },
|
|
29
29
|
],
|
|
30
|
+
simulation: [
|
|
31
|
+
{ id: "modelo_e_assumptions", descricao: "declara modelo testavel e assumptions explicitas", termos: [/modelo|model/i, /assumptions?|premissas?|hipoteses?/i], obrigatorio: true },
|
|
32
|
+
{ id: "condicoes_outputs_unidades", descricao: "declara condicoes iniciais, contorno, outputs e unidades", termos: [/condicoes?_iniciais|initial[_ -]?conditions?/i, /condicoes?_contorno|boundary[_ -]?conditions?/i, /outputs?|saidas?|resultados?/i, /unidades?|units?/i], obrigatorio: true },
|
|
33
|
+
{ id: "spatial_render_visual_separados", descricao: "separa modelo espacial, modo de renderizacao e visual profile", termos: [/spatial[_ -]?model|modelo[_ -]?espacial/i, /render[_ -]?mode|modo[_ -]?(?:de[_ -]?)?render/i, /visual[_ -]?profile|perfil[_ -]?visual/i], obrigatorio: true },
|
|
34
|
+
{ id: "controle_e_tempo", descricao: "declara modo de controle e modelo de tempo", termos: [/controle|control(?:[_ -]?modes?)?/i, /tempo|time[_ -]?model|fixed[_ -]?step|real[_ -]?time|event[_ -]?driven/i], obrigatorio: true },
|
|
35
|
+
{ id: "fidelidade_calibracao_incerteza", descricao: "declara fidelidade, referencia, calibracao, tolerancia e incerteza", termos: [/fidelity|fidelidade/i, /referencia|reference|dataset/i, /calibracao|calibration/i, /tolerancias?|tolerances?/i, /incerteza|uncertainty/i], obrigatorio: true },
|
|
36
|
+
{ id: "telemetria_e_replay_simulacao", descricao: "define telemetria, seed, snapshot ou replay reproduzivel", termos: [/telemetria|telemetry|metricas?/i, /seed|snapshot|replay|event[_ -]?log/i], obrigatorio: false },
|
|
37
|
+
],
|
|
30
38
|
legal: [
|
|
31
39
|
{ id: "jurisdicao_e_escopo", descricao: "declara jurisdicao, escopo e limite de uso", termos: [/jurisdicao/i, /escopo|limite/i], obrigatorio: true },
|
|
32
40
|
{ id: "fontes_normativas", descricao: "exige fontes normativas ou base documental", termos: [/fonte|norma|lei|regulamento/i, /citacao|evidencia|documento/i], obrigatorio: true },
|
|
@@ -89,6 +97,12 @@ export const ALIASES_PROFILE = {
|
|
|
89
97
|
game: "game",
|
|
90
98
|
jogo: "game",
|
|
91
99
|
games: "game",
|
|
100
|
+
simulation: "simulation",
|
|
101
|
+
simulations: "simulation",
|
|
102
|
+
simulacao: "simulation",
|
|
103
|
+
simulacoes: "simulation",
|
|
104
|
+
simulador: "simulation",
|
|
105
|
+
simuladores: "simulation",
|
|
92
106
|
legal: "legal",
|
|
93
107
|
juridico: "legal",
|
|
94
108
|
research: "research",
|
|
@@ -140,6 +154,7 @@ export const PRESETS_PROFILE = {
|
|
|
140
154
|
redacao: ["editorial", "materia", "blog", "seo", "reescrita"],
|
|
141
155
|
propostas: ["marketplace", "freela", "consultiva", "diagnostico", "score90"],
|
|
142
156
|
game: ["casual", "arcade", "rpg", "economia", "playtest"],
|
|
157
|
+
simulation: ["model", "scenario", "calibration", "deterministic", "batch", "safety"],
|
|
143
158
|
conversas: ["atendimento", "vendas", "suporte", "qualificacao", "retencao", "cobranca"],
|
|
144
159
|
};
|
|
145
160
|
export const CAPABILITY_MATRIX_GOVERNANCA = {
|
|
@@ -278,6 +293,21 @@ export const CAPABILITY_MATRIX_GOVERNANCA = {
|
|
|
278
293
|
],
|
|
279
294
|
rulePacksSugeridos: ["playtest", "economy-balance", "progression"],
|
|
280
295
|
},
|
|
296
|
+
simulation: {
|
|
297
|
+
profile: "simulation",
|
|
298
|
+
detectaLiteral: true,
|
|
299
|
+
detectaSemantico: "parcial",
|
|
300
|
+
detectaOrdemExecucao: "parcial",
|
|
301
|
+
detectaDriftReal: "parcial",
|
|
302
|
+
validaArtefatoReal: "parcial",
|
|
303
|
+
interpretaNegacao: true,
|
|
304
|
+
confianca: "media",
|
|
305
|
+
limites: [
|
|
306
|
+
"validacao textual nao executa engine, solver ou runtime externo",
|
|
307
|
+
"aparencia visual nao prova fidelidade sem referencia, calibracao, tolerancia e evidencia observada",
|
|
308
|
+
],
|
|
309
|
+
rulePacksSugeridos: ["simulation-model", "simulation-calibration", "simulation-determinism", "simulation-batch", "simulation-safety"],
|
|
310
|
+
},
|
|
281
311
|
conversas: {
|
|
282
312
|
profile: "conversas",
|
|
283
313
|
detectaLiteral: true,
|
package/dist/profileCommand.d.ts
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
import type { CapabilityProfile, OpcoesProfileValidar,
|
|
1
|
+
import type { CapabilityProfile, OpcoesProfileValidar, PerfilSemanticoValidavel, ProfileGovernanca, ResultadoProfileValidar, RulePackSema } from "./profileAuthorTipos.js";
|
|
2
2
|
export declare function carregarArtefatoProfile(args: string[]): Promise<{
|
|
3
3
|
texto: string | null;
|
|
4
4
|
arquivo: string | null;
|
|
5
5
|
}>;
|
|
6
|
-
export declare function validarProfileSemantico(entrada: string | undefined, profile:
|
|
6
|
+
export declare function validarProfileSemantico(entrada: string | undefined, profile: PerfilSemanticoValidavel, opcoes: OpcoesProfileValidar): Promise<ResultadoProfileValidar>;
|
|
7
7
|
export declare function renderizarProfileValidarTexto(resultado: ResultadoProfileValidar): string;
|
|
8
8
|
export declare function criarPayloadCapabilityMatrix(): {
|
|
9
9
|
comando: string;
|
|
10
10
|
sucesso: boolean;
|
|
11
11
|
profiles: CapabilityProfile[];
|
|
12
|
+
workflowsEspecializados: readonly [{
|
|
13
|
+
readonly id: "workflow.author";
|
|
14
|
+
readonly comando: "sema author <subcomando>";
|
|
15
|
+
readonly resumo: "Workflow narrativo especializado; não é um profile validável.";
|
|
16
|
+
}];
|
|
12
17
|
resumo: {
|
|
13
18
|
profiles: number;
|
|
19
|
+
workflowsEspecializados: 1;
|
|
14
20
|
validaArtefatoReal: ProfileGovernanca[];
|
|
15
21
|
interpretaNegacao: ProfileGovernanca[];
|
|
16
22
|
};
|
package/dist/profileCommand.js
CHANGED
|
@@ -24,7 +24,7 @@ export async function carregarArtefatoProfile(args) {
|
|
|
24
24
|
}
|
|
25
25
|
export async function validarProfileSemantico(entrada, profile, opcoes) {
|
|
26
26
|
if (!entrada) {
|
|
27
|
-
throw new Error("Uso: sema profile validar <software|workflow|ops|game|legal|research|redacao|propostas|conversas> <arquivo-ou-pasta> [--maturidade draft|prototype|production|critical] [--preset <preset>] [--artefato <texto>|--artefato-arquivo <arquivo>] [--json]");
|
|
27
|
+
throw new Error("Uso: sema profile validar <software|workflow|ops|game|simulation|legal|research|redacao|propostas|conversas> <arquivo-ou-pasta> [--maturidade draft|prototype|production|critical] [--preset <preset>] [--artefato <texto>|--artefato-arquivo <arquivo>] [--json]");
|
|
28
28
|
}
|
|
29
29
|
const modulos = await carregarModulos(entrada);
|
|
30
30
|
const escolhido = modulos.find((item) => moduloCombinaComProfile(item.resultado.modulo?.nome, item.caminho, profile)) ?? modulos[0];
|
|
@@ -139,13 +139,21 @@ export function renderizarProfileValidarTexto(resultado) {
|
|
|
139
139
|
return linhas.join("\n");
|
|
140
140
|
}
|
|
141
141
|
export function criarPayloadCapabilityMatrix() {
|
|
142
|
-
const profiles = Object.values(CAPABILITY_MATRIX_GOVERNANCA)
|
|
142
|
+
const profiles = Object.values(CAPABILITY_MATRIX_GOVERNANCA)
|
|
143
|
+
.filter((profile) => profile.profile !== "author");
|
|
144
|
+
const workflowsEspecializados = [{
|
|
145
|
+
id: "workflow.author",
|
|
146
|
+
comando: "sema author <subcomando>",
|
|
147
|
+
resumo: "Workflow narrativo especializado; não é um profile validável.",
|
|
148
|
+
}];
|
|
143
149
|
return {
|
|
144
150
|
comando: "profile capabilities",
|
|
145
151
|
sucesso: true,
|
|
146
152
|
profiles,
|
|
153
|
+
workflowsEspecializados,
|
|
147
154
|
resumo: {
|
|
148
155
|
profiles: profiles.length,
|
|
156
|
+
workflowsEspecializados: workflowsEspecializados.length,
|
|
149
157
|
validaArtefatoReal: profiles.filter((profile) => profile.validaArtefatoReal).map((profile) => profile.profile),
|
|
150
158
|
interpretaNegacao: profiles.filter((profile) => profile.interpretaNegacao).map((profile) => profile.profile),
|
|
151
159
|
},
|
|
@@ -160,6 +168,8 @@ export function renderizarCapabilityMatrixTexto(payload) {
|
|
|
160
168
|
` packs=${profile.rulePacksSugeridos.join(", ")}`,
|
|
161
169
|
` limites=${profile.limites.join(" | ")}`,
|
|
162
170
|
].join("\n")).join("\n"),
|
|
171
|
+
"SPECIALIZED_WORKFLOWS",
|
|
172
|
+
...payload.workflowsEspecializados.map((workflow) => (`- ${workflow.id}: ${workflow.resumo}\n comando=${workflow.comando}`)),
|
|
163
173
|
].join("\n");
|
|
164
174
|
}
|
|
165
175
|
export function criarPayloadRulePacks(profileFiltro = null) {
|
|
@@ -204,9 +214,9 @@ export async function comandoProfile(posicionais, args, emJson) {
|
|
|
204
214
|
"Uso: sema profile <validar|capabilities|rule-packs>",
|
|
205
215
|
"",
|
|
206
216
|
"Comandos:",
|
|
207
|
-
" sema profile validar <software|workflow|ops|game|legal|research|redacao|propostas|conversas> <arquivo-ou-pasta> [--maturidade draft|prototype|production|critical] [--preset <preset>] [--artefato <texto>|--artefato-arquivo <arquivo>] [--json]",
|
|
217
|
+
" sema profile validar <software|workflow|ops|game|simulation|legal|research|redacao|propostas|conversas> <arquivo-ou-pasta> [--maturidade draft|prototype|production|critical] [--preset <preset>] [--artefato <texto>|--artefato-arquivo <arquivo>] [--json]",
|
|
208
218
|
" sema profile capabilities [--json]",
|
|
209
|
-
" sema profile rule-packs [--profile <author|software|workflow|ops|game|legal|research|redacao|propostas|conversas>] [--json]",
|
|
219
|
+
" sema profile rule-packs [--profile <author|software|workflow|ops|game|simulation|legal|research|redacao|propostas|conversas>] [--json]",
|
|
210
220
|
"",
|
|
211
221
|
"O profile e um gate semantico: se requisito obrigatorio faltar, a saida bloqueia.",
|
|
212
222
|
].join("\n"));
|
|
@@ -230,7 +240,7 @@ export async function comandoProfile(posicionais, args, emJson) {
|
|
|
230
240
|
const profile = normalizarProfileSemantico(posicionais[1] ?? obterOpcao(args, "--profile"));
|
|
231
241
|
const entrada = posicionais[2] ?? obterOpcao(args, "--arquivo");
|
|
232
242
|
if (!profile) {
|
|
233
|
-
console.error("Profile invalido. Use software, workflow, ops, game, legal, research, redacao, propostas ou conversas.");
|
|
243
|
+
console.error("Profile invalido. Use software, workflow, ops, game, simulation, legal, research, redacao, propostas ou conversas.");
|
|
234
244
|
return 1;
|
|
235
245
|
}
|
|
236
246
|
const preset = normalizarPresetProfile(profile, obterOpcao(args, "--preset"));
|
package/dist/profileRegras.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { AchadoProfile, ConfiancaValidacaoProfile, DecisaoAgenteProfile, FonteAchadoProfile, MaturidadeProfile,
|
|
2
|
-
export declare function normalizarPresetProfile(profile:
|
|
3
|
-
export declare function moduloCombinaComProfile(modulo: string | null | undefined, caminho: string, profile:
|
|
4
|
-
export declare function severidadeRequisitoProfile(requisito: RequisitoProfile, profile:
|
|
1
|
+
import type { AchadoProfile, ConfiancaValidacaoProfile, DecisaoAgenteProfile, FonteAchadoProfile, MaturidadeProfile, PerfilSemanticoValidavel, PresetProfile, ProfileGovernanca, RequisitoProfile, RulePackSema, RuntimeGateProfile, SeveridadeProfile } from "./profileAuthorTipos.js";
|
|
2
|
+
export declare function normalizarPresetProfile(profile: PerfilSemanticoValidavel, valor: string | undefined): PresetProfile | null;
|
|
3
|
+
export declare function moduloCombinaComProfile(modulo: string | null | undefined, caminho: string, profile: PerfilSemanticoValidavel): boolean;
|
|
4
|
+
export declare function severidadeRequisitoProfile(requisito: RequisitoProfile, profile: PerfilSemanticoValidavel, maturidade: MaturidadeProfile): SeveridadeProfile;
|
|
5
5
|
export declare function riscoAchadoProfile(severidade: SeveridadeProfile, fonte: FonteAchadoProfile): string;
|
|
6
|
-
export declare function avaliarRequisitosProfile(conteudo: string, requisitos: RequisitoProfile[], profile:
|
|
6
|
+
export declare function avaliarRequisitosProfile(conteudo: string, requisitos: RequisitoProfile[], profile: PerfilSemanticoValidavel, maturidade: MaturidadeProfile, fonte?: FonteAchadoProfile): AchadoProfile[];
|
|
7
7
|
export declare function decidirAcaoAgenteProfile(contratoValido: boolean, achados: AchadoProfile[]): DecisaoAgenteProfile;
|
|
8
8
|
export declare function calcularScoreProfile(contratoValido: boolean, achados: AchadoProfile[]): number;
|
|
9
9
|
export declare function penalidadeAchadoProfile(achado: AchadoProfile): number;
|
package/dist/profileRegras.js
CHANGED
|
@@ -46,7 +46,16 @@ export function normalizarPresetProfile(profile, valor) {
|
|
|
46
46
|
retencao_cliente: "retencao",
|
|
47
47
|
cobrar: "cobranca",
|
|
48
48
|
};
|
|
49
|
-
const
|
|
49
|
+
const aliasSimulation = {
|
|
50
|
+
modelo: "model",
|
|
51
|
+
cenario: "scenario",
|
|
52
|
+
calibracao: "calibration",
|
|
53
|
+
deterministico: "deterministic",
|
|
54
|
+
deterministica: "deterministic",
|
|
55
|
+
lote: "batch",
|
|
56
|
+
seguranca: "safety",
|
|
57
|
+
};
|
|
58
|
+
const preset = (profile === "simulation" ? aliasSimulation[chave] : undefined) ?? alias[chave] ?? chave;
|
|
50
59
|
return PRESETS_PROFILE[profile].includes(preset) ? preset : null;
|
|
51
60
|
}
|
|
52
61
|
export function moduloCombinaComProfile(modulo, caminho, profile) {
|
|
@@ -57,6 +66,9 @@ export function moduloCombinaComProfile(modulo, caminho, profile) {
|
|
|
57
66
|
if (profile === "conversas") {
|
|
58
67
|
return /conversas|conversa|atendimento|chatbot|bot/.test(alvo);
|
|
59
68
|
}
|
|
69
|
+
if (profile === "simulation") {
|
|
70
|
+
return /simulation|simulacao|simulador/.test(alvo);
|
|
71
|
+
}
|
|
60
72
|
if (profile === "redacao") {
|
|
61
73
|
return /redacao|redator|materia|editorial|seo/.test(alvo);
|
|
62
74
|
}
|
package/dist/profileRulePacks.js
CHANGED
|
@@ -293,6 +293,56 @@ export const RULE_PACKS_SEMA = [
|
|
|
293
293
|
monetizacao: "cloud",
|
|
294
294
|
status: "planejado",
|
|
295
295
|
},
|
|
296
|
+
{
|
|
297
|
+
id: "simulation-model",
|
|
298
|
+
nome: "Simulation Model Contract",
|
|
299
|
+
categoria: "oss",
|
|
300
|
+
profiles: ["simulation"],
|
|
301
|
+
maturidadeMinima: "draft",
|
|
302
|
+
controles: ["model", "assumptions", "initial_conditions", "boundary_conditions", "outputs", "units"],
|
|
303
|
+
monetizacao: "aberto",
|
|
304
|
+
status: "base",
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
id: "simulation-calibration",
|
|
308
|
+
nome: "Simulation Calibration Evidence",
|
|
309
|
+
categoria: "oss",
|
|
310
|
+
profiles: ["simulation"],
|
|
311
|
+
maturidadeMinima: "prototype",
|
|
312
|
+
controles: ["reference", "calibration", "tolerance", "uncertainty", "telemetry"],
|
|
313
|
+
monetizacao: "aberto",
|
|
314
|
+
status: "base",
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
id: "simulation-determinism",
|
|
318
|
+
nome: "Simulation Determinism And Replay",
|
|
319
|
+
categoria: "oss",
|
|
320
|
+
profiles: ["simulation"],
|
|
321
|
+
maturidadeMinima: "prototype",
|
|
322
|
+
controles: ["seed", "fixed_step", "snapshot", "event_log", "replay", "result_digest"],
|
|
323
|
+
monetizacao: "aberto",
|
|
324
|
+
status: "base",
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
id: "simulation-batch",
|
|
328
|
+
nome: "Simulation Batch Runs",
|
|
329
|
+
categoria: "oss",
|
|
330
|
+
profiles: ["simulation"],
|
|
331
|
+
maturidadeMinima: "prototype",
|
|
332
|
+
controles: ["replications", "seed_strategy", "aggregation", "resource_budget", "stop_condition"],
|
|
333
|
+
monetizacao: "aberto",
|
|
334
|
+
status: "base",
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
id: "simulation-safety",
|
|
338
|
+
nome: "Autonomous Simulation Safety",
|
|
339
|
+
categoria: "oss",
|
|
340
|
+
profiles: ["simulation"],
|
|
341
|
+
maturidadeMinima: "prototype",
|
|
342
|
+
controles: ["authority_boundary", "resource_budget", "stop_condition", "fail_safe", "human_takeover", "isolation"],
|
|
343
|
+
monetizacao: "aberto",
|
|
344
|
+
status: "base",
|
|
345
|
+
},
|
|
296
346
|
];
|
|
297
347
|
export const REQUISITOS_PRESET_PROFILE = {
|
|
298
348
|
security: [
|
|
@@ -382,6 +432,24 @@ export const REQUISITOS_PRESET_PROFILE = {
|
|
|
382
432
|
economia: [
|
|
383
433
|
{ id: "game_economia_balanceada", descricao: "economia declara moeda, fonte, gasto e exploit", termos: [/moeda|economia/i, /fonte/i, /gasto|sink/i, /exploit/i], obrigatorio: true, severidade: "blocking" },
|
|
384
434
|
],
|
|
435
|
+
model: [
|
|
436
|
+
{ id: "simulation_model_core", descricao: "modelo declara assumptions, condicoes, outputs e unidades", termos: [/modelo|model/i, /assumptions?|premissas?/i, /condicoes?_iniciais|initial[_ -]?conditions?/i, /condicoes?_contorno|boundary[_ -]?conditions?/i, /outputs?|saidas?/i, /unidades?|units?/i], obrigatorio: true, severidade: "blocking" },
|
|
437
|
+
],
|
|
438
|
+
scenario: [
|
|
439
|
+
{ id: "simulation_scenario_acceptance", descricao: "cenario declara identidade, condicoes e criterios de aceitacao", termos: [/scenario|cenario/i, /condicoes?_iniciais|initial[_ -]?conditions?/i, /condicoes?_contorno|boundary[_ -]?conditions?/i, /acceptance|aceitacao|resultado_esperado/i], obrigatorio: true, severidade: "blocking" },
|
|
440
|
+
],
|
|
441
|
+
calibration: [
|
|
442
|
+
{ id: "simulation_calibration_evidence", descricao: "calibracao declara referencia, metodo, tolerancia, incerteza e telemetria", termos: [/referencia|reference|dataset/i, /calibracao|calibration/i, /tolerancias?|tolerances?/i, /incerteza|uncertainty/i, /telemetria|telemetry/i], obrigatorio: true, severidade: "critical" },
|
|
443
|
+
],
|
|
444
|
+
deterministic: [
|
|
445
|
+
{ id: "simulation_deterministic_replay", descricao: "determinismo declara seed, passo, snapshot e replay", termos: [/determinism|determinismo|deterministic/i, /seed/i, /fixed[_ -]?step|passo_reprodutivel/i, /snapshot|state[_ -]?digest/i, /replay|event[_ -]?log/i], obrigatorio: true, severidade: "blocking" },
|
|
446
|
+
],
|
|
447
|
+
batch: [
|
|
448
|
+
{ id: "simulation_batch_budget", descricao: "batch declara repeticoes, estrategia de seeds, agregacao, budget e parada", termos: [/batch|lote|ensemble/i, /replications?|repeticoes?|scenarios?/i, /seed[_ -]?strategy|estrategia[_ -]?seed/i, /aggregation|agregacao|metricas?/i, /budget|orcamento|limite/i, /stop[_ -]?condition|criterio[_ -]?parada/i], obrigatorio: true, severidade: "blocking" },
|
|
449
|
+
],
|
|
450
|
+
safety: [
|
|
451
|
+
{ id: "simulation_autonomous_safety", descricao: "autonomia declara fronteira, budget, parada, fail-safe e tomada humana", termos: [/autonomous|uncontrolled|autonom/i, /authority[_ -]?boundary|fronteira[_ -]?autoridade/i, /resource[_ -]?budget|orcamento[_ -]?recursos|limite/i, /stop[_ -]?condition|criterio[_ -]?parada|kill[_ -]?switch/i, /fail[_ -]?safe|human[_ -]?takeover|isolamento/i], obrigatorio: true, severidade: "critical" },
|
|
452
|
+
],
|
|
385
453
|
atendimento: [
|
|
386
454
|
{ id: "conversas_atendimento_estado", descricao: "atendimento declara estado do cliente e proxima acao", termos: [/estado|etapa|sentimento/i, /proxima_acao|proxima acao|encaminhar|resolver/i], obrigatorio: true, severidade: "blocking" },
|
|
387
455
|
],
|
package/dist/projeto.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { ConfiguracaoPersistenciaProjeto, ConfiguracaoProjetoCarregada, ContextoProjetoCarregado, SemaConfigProjeto, } from './projetoTipos.js';
|
|
1
|
+
export type { ConfiguracaoPersistenciaProjeto, ConfiguracaoProjetoCarregada, ContextoProjetoCarregado, EscopoCarregamentoProjeto, ModuloProjetoCarregado, OpcoesCarregarProjeto, SemaConfigProjeto, } from './projetoTipos.js';
|
|
2
2
|
export { carregarConfiguracaoProjeto, localizarConfiguracaoProjeto, normalizarEstruturaSaida, normalizarFrameworkGeracao, } from './projetoConfig.js';
|
|
3
3
|
export { carregarProjeto } from './projetoCarregar.js';
|
|
4
4
|
export { resolverAlvoPadrao, resolverAlvosVerificacao, resolverEstruturaSaidaPadrao, resolverFrameworkPadrao, resolverSaidaPadrao, } from './projetoResolucao.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ContextoProjetoCarregado } from './projetoTipos.js';
|
|
2
|
-
export declare function carregarProjeto(entrada: string | undefined, cwd: string): Promise<ContextoProjetoCarregado>;
|
|
1
|
+
import type { ContextoProjetoCarregado, OpcoesCarregarProjeto } from './projetoTipos.js';
|
|
2
|
+
export declare function carregarProjeto(entrada: string | undefined, cwd: string, opcoes?: OpcoesCarregarProjeto): Promise<ContextoProjetoCarregado>;
|
package/dist/projetoCarregar.js
CHANGED
|
@@ -2,49 +2,72 @@
|
|
|
2
2
|
// Descrição: orquestra leitura de contratos, compila??o e sele??o de m?dulos do projeto.
|
|
3
3
|
import { stat } from 'node:fs/promises';
|
|
4
4
|
import path from 'node:path';
|
|
5
|
-
import { compilarProjeto,
|
|
5
|
+
import { compilarProjeto, listarArquivosSema } from '@sema/nucleo';
|
|
6
|
+
import { carregarFechamentoContratosSema, carregarFontesContratos } from './projetoCatalogo.js';
|
|
6
7
|
import { carregarConfiguracaoProjeto, normalizarModoAdocao } from './projetoConfig.js';
|
|
7
8
|
import { inferirFontesLegado } from './projetoLegado.js';
|
|
8
9
|
import { inferirDiretoriosCodigo, listarArquivosDeOrigens, resolverBaseProjeto, resolverEntradaPadrao, resolverOrigensProjeto, } from './projetoOrigens.js';
|
|
9
|
-
export async function carregarProjeto(entrada, cwd) {
|
|
10
|
+
export async function carregarProjeto(entrada, cwd, opcoes = {}) {
|
|
10
11
|
const entradaBase = entrada ? path.resolve(cwd, entrada) : cwd;
|
|
11
12
|
const configCarregada = await carregarConfiguracaoProjeto(entradaBase);
|
|
12
13
|
const entradaResolvida = entrada ? path.resolve(cwd, entrada) : await resolverEntradaPadrao(cwd, configCarregada);
|
|
13
14
|
const baseProjeto = await resolverBaseProjeto(entradaResolvida, configCarregada);
|
|
14
15
|
const infoEntrada = await stat(entradaResolvida);
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
fontes.push({ caminho: arquivo, codigo });
|
|
16
|
+
const escopo = opcoes.escopo ?? (infoEntrada.isFile() ? "modulo" : "projeto");
|
|
17
|
+
const carregarProjetoCompleto = !infoEntrada.isFile() || escopo === "projeto";
|
|
18
|
+
const origensBase = infoEntrada.isFile()
|
|
19
|
+
? await resolverOrigensProjeto(baseProjeto, baseProjeto, configCarregada)
|
|
20
|
+
: await resolverOrigensProjeto(baseProjeto, entradaResolvida, configCarregada);
|
|
21
|
+
const origensProjeto = [...new Set([
|
|
22
|
+
...origensBase,
|
|
23
|
+
...(infoEntrada.isFile() ? [path.dirname(entradaResolvida)] : []),
|
|
24
|
+
].map((origem) => path.resolve(origem)))]
|
|
25
|
+
.sort((a, b) => a.localeCompare(b, "pt-BR"));
|
|
26
|
+
const arquivosDescobertosSet = new Set(await listarArquivosDeOrigens(origensProjeto));
|
|
27
|
+
if (infoEntrada.isFile()) {
|
|
28
|
+
arquivosDescobertosSet.add(path.resolve(entradaResolvida));
|
|
29
29
|
}
|
|
30
|
+
const arquivosDescobertos = [...arquivosDescobertosSet]
|
|
31
|
+
.sort((a, b) => a.localeCompare(b, "pt-BR"));
|
|
32
|
+
const possuiDiretoriosCodigoExplicitos = Boolean(configCarregada?.config.diretoriosCodigo?.length);
|
|
33
|
+
const possuiFontesLegadoExplicitas = Boolean(configCarregada?.config.fontesLegado?.length);
|
|
34
|
+
const diretoriosCodigo = carregarProjetoCompleto || possuiDiretoriosCodigoExplicitos
|
|
35
|
+
? await inferirDiretoriosCodigo(baseProjeto, configCarregada)
|
|
36
|
+
: [];
|
|
37
|
+
const fontesLegado = carregarProjetoCompleto || possuiFontesLegadoExplicitas
|
|
38
|
+
? await inferirFontesLegado(diretoriosCodigo, baseProjeto, configCarregada)
|
|
39
|
+
: [];
|
|
40
|
+
const modoAdocao = normalizarModoAdocao(configCarregada?.config.modoAdocao);
|
|
41
|
+
const arquivosSelecionados = carregarProjetoCompleto && escopo === "projeto"
|
|
42
|
+
? new Set(arquivosDescobertos.map((arquivo) => path.resolve(arquivo)))
|
|
43
|
+
: infoEntrada.isFile()
|
|
44
|
+
? new Set([path.resolve(entradaResolvida)])
|
|
45
|
+
: new Set((configCarregada && path.resolve(entradaResolvida) === path.resolve(configCarregada.baseDiretorio)
|
|
46
|
+
? arquivosDescobertos
|
|
47
|
+
: await listarArquivosSema(entradaResolvida)).map((arquivo) => path.resolve(arquivo)));
|
|
48
|
+
const fontes = carregarProjetoCompleto
|
|
49
|
+
? await carregarFontesContratos(arquivosDescobertos)
|
|
50
|
+
: (await carregarFechamentoContratosSema([entradaResolvida], arquivosDescobertos)).fontes;
|
|
30
51
|
const resultadoProjeto = compilarProjeto(fontes);
|
|
31
52
|
const resultados = new Map(resultadoProjeto.modulos.map((modulo) => [path.resolve(modulo.caminho), modulo]));
|
|
53
|
+
const modulosCarregados = fontes.map((fonte) => ({
|
|
54
|
+
caminho: fonte.caminho,
|
|
55
|
+
codigo: fonte.codigo,
|
|
56
|
+
resultado: resultados.get(path.resolve(fonte.caminho)),
|
|
57
|
+
}));
|
|
32
58
|
return {
|
|
33
59
|
entradaResolvida,
|
|
34
60
|
baseProjeto,
|
|
35
61
|
configCarregada,
|
|
36
|
-
arquivosProjeto,
|
|
62
|
+
arquivosProjeto: fontes.map((fonte) => fonte.caminho),
|
|
63
|
+
arquivosDescobertos,
|
|
37
64
|
origensProjeto,
|
|
38
65
|
diretoriosCodigo,
|
|
39
66
|
fontesLegado,
|
|
40
67
|
modoAdocao,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
.
|
|
44
|
-
caminho: fonte.caminho,
|
|
45
|
-
codigo: fonte.codigo,
|
|
46
|
-
resultado: resultados.get(path.resolve(fonte.caminho)),
|
|
47
|
-
})),
|
|
68
|
+
modulosCarregados,
|
|
69
|
+
modulosSelecionados: modulosCarregados
|
|
70
|
+
.filter((modulo) => arquivosSelecionados.has(path.resolve(modulo.caminho))),
|
|
48
71
|
};
|
|
49
72
|
}
|
|
50
73
|
//# sourceMappingURL=projetoCarregar.js.map
|