@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,383 @@
|
|
|
1
|
+
// SEMA-GOVERNED: sema.produto.sistemas_interativos.extensoes_cli
|
|
2
|
+
// Descricao: superficie CLI read-only para IR, operacao, tempo, autonomia e portabilidade.
|
|
3
|
+
import { readFile } from "node:fs/promises";
|
|
4
|
+
import { SCHEMA_AUTONOMIA, SCHEMA_AUTORIDADE_MULTIPLAYER, SCHEMA_PLAYTEST_FUZZ, validarCicloReparoAutonomo, validarModeloAutoridadeMultiplayer, validarPlanoPlaytestFuzz, } from "./autonomy.js";
|
|
5
|
+
import { EXPERIENCE_IR_CHUNK_SCHEMA_VERSION, EXPERIENCE_IR_INDEX_SCHEMA_VERSION, EXPERIENCE_IR_SCHEMA_VERSION, EXPERIENCE_IR_SERIALIZATION_SCHEMA_VERSION, consultarIndiceExperienceIr, criarChunkExperienceIr, descreverSerializacaoExperienceIr, indexarExperienceIr, validarExperienceIr, } from "./experienceIr.js";
|
|
6
|
+
import { ACCEPTANCE_LOCK_SCHEMA_V1, ASSET_PROVENANCE_SCHEMA_V1, EDITOR_STATE_SCHEMA_V1, ENGINE_DIFF_SCHEMA_V1, ENGINE_SNAPSHOT_SCHEMA_V1, JOB_ORCHESTRATION_SCHEMA_V1, MULTIMODAL_EVIDENCE_SCHEMA_V1, OPERATION_RESULT_SCHEMA_V1, derivarDiffSnapshotsEngine, operarAcceptanceLock, planejarOrquestracaoJobs, validarAcceptanceLock, validarEstadoEditor, validarEvidenciaMultimodal, validarProvenienciaAsset, validarSnapshotEngine, } from "./operations.js";
|
|
7
|
+
import { SCHEMA_PORTABILIDADE, SCHEMA_WORKERS_DISTRIBUIDOS, analisarPlanoPortabilidadeInterativa, validarPlanoWorkersDistribuidos, } from "./portability.js";
|
|
8
|
+
import { SCHEMA_CONTRATO_TEMPORAL, SCHEMA_EVIDENCIA_TEMPORAL, validarBundleVerificacaoTemporal, validarContratoTemporalInterativo, } from "./temporal.js";
|
|
9
|
+
export const INTERACTIVE_CLI_EXTENSION_SCHEMA_VERSION = "sema.interactive.cli-extensions/v1";
|
|
10
|
+
const EXPERIENCE_IR_VALIDATION_RESULT_SCHEMA_VERSION = "sema.experience-ir.validation-result/v1";
|
|
11
|
+
const EXPERIENCE_IR_INDEX_ENTRY_SCHEMA_VERSION = "sema.experience-ir.index-entry/v1";
|
|
12
|
+
const TEMPORAL_VALIDATION_RESULT_SCHEMA_VERSION = "sema.interactive.temporal-validation-result/v1";
|
|
13
|
+
const TEMPORAL_EVIDENCE_VALIDATION_RESULT_SCHEMA_VERSION = "sema.interactive.temporal-evidence-validation-result/v1";
|
|
14
|
+
const AUTONOMY_VALIDATION_RESULT_SCHEMA_VERSION = "sema.interactive.autonomy-validation-result/v1";
|
|
15
|
+
const PLAYTEST_FUZZ_VALIDATION_RESULT_SCHEMA_VERSION = "sema.interactive.playtest-fuzz-validation-result/v1";
|
|
16
|
+
const MULTIPLAYER_VALIDATION_RESULT_SCHEMA_VERSION = "sema.interactive.multiplayer-validation-result/v1";
|
|
17
|
+
const PORTABILITY_ANALYSIS_RESULT_SCHEMA_VERSION = "sema.interactive.portability-analysis-result/v1";
|
|
18
|
+
const DISTRIBUTED_WORKERS_VALIDATION_RESULT_SCHEMA_VERSION = "sema.interactive.distributed-workers-validation-result/v1";
|
|
19
|
+
export const SUBCOMANDOS_EXTENSAO_INTERATIVA = Object.freeze([
|
|
20
|
+
"validar-ir",
|
|
21
|
+
"indexar-ir",
|
|
22
|
+
"consultar-ir",
|
|
23
|
+
"chunk-ir",
|
|
24
|
+
"descrever-ir",
|
|
25
|
+
"validar-engine-snapshot",
|
|
26
|
+
"diff-engine-snapshots",
|
|
27
|
+
"validar-asset-provenance",
|
|
28
|
+
"validar-editor-state",
|
|
29
|
+
"planejar-jobs",
|
|
30
|
+
"validar-acceptance",
|
|
31
|
+
"operar-acceptance",
|
|
32
|
+
"validar-multimodal",
|
|
33
|
+
"validar-temporal",
|
|
34
|
+
"validar-evidencia-temporal",
|
|
35
|
+
"validar-autonomia",
|
|
36
|
+
"validar-playtest-fuzz",
|
|
37
|
+
"validar-multiplayer",
|
|
38
|
+
"analisar-portabilidade",
|
|
39
|
+
"validar-workers",
|
|
40
|
+
]);
|
|
41
|
+
const COMANDOS_SCHEMA = Object.freeze({
|
|
42
|
+
"validar-ir": { positionals: ["irFile"], purpose: "validate content-addressed Experience IR" },
|
|
43
|
+
"indexar-ir": { positionals: ["irFile"], purpose: "derive an in-memory semantic index" },
|
|
44
|
+
"consultar-ir": { positionals: ["irFile"], options: ["--semantic-id"], purpose: "query one semantic ID" },
|
|
45
|
+
"chunk-ir": { positionals: ["irFile"], options: ["--semantic-id", "--raso"], purpose: "derive a bounded IR chunk" },
|
|
46
|
+
"descrever-ir": { positionals: [], purpose: "describe native JSON and external CBOR support" },
|
|
47
|
+
"validar-engine-snapshot": { positionals: ["snapshotFile"], purpose: "validate a declared read-only engine snapshot" },
|
|
48
|
+
"diff-engine-snapshots": { positionals: ["beforeFile", "afterFile"], purpose: "derive a deterministic snapshot diff" },
|
|
49
|
+
"validar-asset-provenance": { positionals: ["provenanceFile"], purpose: "validate opaque asset provenance" },
|
|
50
|
+
"validar-editor-state": { positionals: ["editorStateFile"], purpose: "validate a declared editor state" },
|
|
51
|
+
"planejar-jobs": { positionals: ["jobsFile"], purpose: "plan jobs, locks, budgets and recovery" },
|
|
52
|
+
"validar-acceptance": { positionals: ["lockFile"], purpose: "validate an acceptance lock" },
|
|
53
|
+
"operar-acceptance": { positionals: ["lockFile"], options: ["--operation", "--context-file"], purpose: "validate, evaluate or invalidate an acceptance lock" },
|
|
54
|
+
"validar-multimodal": { positionals: ["evidenceFile"], purpose: "validate multimodal evidence descriptors" },
|
|
55
|
+
"validar-temporal": { positionals: ["contractFile"], purpose: "validate 4D, camera, physics, QA, build and hardware contracts" },
|
|
56
|
+
"validar-evidencia-temporal": { positionals: ["contractFile"], options: ["--bundle-arquivo", "--evidencias-arquivo"], purpose: "validate temporal evidence against its contract" },
|
|
57
|
+
"validar-autonomia": { positionals: ["cycleFile"], purpose: "validate diagnose-propose-simulate-prove cycles" },
|
|
58
|
+
"validar-playtest-fuzz": { positionals: ["planFile"], purpose: "validate bounded bot, fuzz and save/load plans" },
|
|
59
|
+
"validar-multiplayer": { positionals: ["modelFile"], purpose: "validate authority, replication and conflicts" },
|
|
60
|
+
"analisar-portabilidade": { positionals: ["planFile"], purpose: "analyze explicit losses, fallbacks and migration gates" },
|
|
61
|
+
"validar-workers": { positionals: ["planFile"], purpose: "validate distributed workers, leases and dependencies" },
|
|
62
|
+
});
|
|
63
|
+
const VINCULOS_SCHEMA_COMANDO = Object.freeze({
|
|
64
|
+
"validar-ir": { inputSchemaKeys: ["experienceIr"], outputSchemaKeys: ["experienceIrValidationResult"], officialFixturePaths: ["exemplos/sistemas-interativos/experience-ir-valid.json"] },
|
|
65
|
+
"indexar-ir": { inputSchemaKeys: ["experienceIr"], outputSchemaKeys: ["experienceIrIndex"], officialFixturePaths: ["exemplos/sistemas-interativos/experience-ir-valid.json"] },
|
|
66
|
+
"consultar-ir": { inputSchemaKeys: ["experienceIr"], outputSchemaKeys: ["experienceIrIndexEntry"], officialFixturePaths: ["exemplos/sistemas-interativos/experience-ir-valid.json"] },
|
|
67
|
+
"chunk-ir": { inputSchemaKeys: ["experienceIr"], outputSchemaKeys: ["experienceIrChunk"], officialFixturePaths: ["exemplos/sistemas-interativos/experience-ir-valid.json"] },
|
|
68
|
+
"descrever-ir": { inputSchemaKeys: [], outputSchemaKeys: ["experienceIrSerialization"], officialFixturePaths: [] },
|
|
69
|
+
"validar-engine-snapshot": { inputSchemaKeys: ["engineSnapshot"], outputSchemaKeys: ["operationResult"], officialFixturePaths: ["exemplos/sistemas-interativos/advanced/engine-snapshot-before-valid.json"] },
|
|
70
|
+
"diff-engine-snapshots": { inputSchemaKeys: ["engineSnapshot", "engineSnapshot"], outputSchemaKeys: ["operationResult", "engineDiff"], officialFixturePaths: ["exemplos/sistemas-interativos/advanced/engine-snapshot-before-valid.json", "exemplos/sistemas-interativos/advanced/engine-snapshot-after-valid.json"] },
|
|
71
|
+
"validar-asset-provenance": { inputSchemaKeys: ["assetProvenance"], outputSchemaKeys: ["operationResult"], officialFixturePaths: ["exemplos/sistemas-interativos/advanced/asset-provenance-valid.json"] },
|
|
72
|
+
"validar-editor-state": { inputSchemaKeys: ["editorState"], outputSchemaKeys: ["operationResult"], officialFixturePaths: ["exemplos/sistemas-interativos/advanced/editor-state-valid.json"] },
|
|
73
|
+
"planejar-jobs": { inputSchemaKeys: ["jobOrchestration"], outputSchemaKeys: ["operationResult", "jobOrchestrationPlan"], officialFixturePaths: ["exemplos/sistemas-interativos/advanced/job-orchestration-valid.json"] },
|
|
74
|
+
"validar-acceptance": { inputSchemaKeys: ["acceptanceLock"], outputSchemaKeys: ["operationResult"], officialFixturePaths: ["exemplos/sistemas-interativos/advanced/acceptance-lock-valid.json"] },
|
|
75
|
+
"operar-acceptance": { inputSchemaKeys: ["acceptanceLock"], outputSchemaKeys: ["operationResult"], officialFixturePaths: ["exemplos/sistemas-interativos/advanced/acceptance-lock-valid.json", "exemplos/sistemas-interativos/advanced/acceptance-context-evaluate-valid.json"], contextRequiredTopLevelFields: ["artifactDigest", "sceneId", "timeRange"] },
|
|
76
|
+
"validar-multimodal": { inputSchemaKeys: ["multimodalEvidence"], outputSchemaKeys: ["operationResult"], officialFixturePaths: ["exemplos/sistemas-interativos/advanced/multimodal-evidence-valid.json"] },
|
|
77
|
+
"validar-temporal": { inputSchemaKeys: ["temporalContract"], outputSchemaKeys: ["temporalValidationResult"], officialFixturePaths: ["exemplos/sistemas-interativos/advanced/temporal-valid.json"] },
|
|
78
|
+
"validar-evidencia-temporal": { inputSchemaKeys: ["temporalContract", "temporalEvidence"], outputSchemaKeys: ["temporalEvidenceValidationResult"], officialFixturePaths: ["exemplos/sistemas-interativos/advanced/temporal-valid.json", "exemplos/sistemas-interativos/advanced/temporal-evidence-valid.json"] },
|
|
79
|
+
"validar-autonomia": { inputSchemaKeys: ["autonomy"], outputSchemaKeys: ["autonomyValidationResult"], officialFixturePaths: ["exemplos/sistemas-interativos/advanced/autonomy-repair-valid.json"] },
|
|
80
|
+
"validar-playtest-fuzz": { inputSchemaKeys: ["playtestFuzz"], outputSchemaKeys: ["playtestFuzzValidationResult"], officialFixturePaths: ["exemplos/sistemas-interativos/advanced/playtest-fuzz-valid.json"] },
|
|
81
|
+
"validar-multiplayer": { inputSchemaKeys: ["multiplayerAuthority"], outputSchemaKeys: ["multiplayerValidationResult"], officialFixturePaths: ["exemplos/sistemas-interativos/advanced/multiplayer-authority-valid.json"] },
|
|
82
|
+
"analisar-portabilidade": { inputSchemaKeys: ["portability"], outputSchemaKeys: ["portabilityAnalysisResult"], officialFixturePaths: ["exemplos/sistemas-interativos/advanced/portability-valid.json"] },
|
|
83
|
+
"validar-workers": { inputSchemaKeys: ["distributedWorkers"], outputSchemaKeys: ["distributedWorkersValidationResult"], officialFixturePaths: ["exemplos/sistemas-interativos/advanced/distributed-workers-valid.json"] },
|
|
84
|
+
});
|
|
85
|
+
const OUTPUT_TARGETS_SCHEMA = Object.freeze({
|
|
86
|
+
"validar-ir": { experienceIrValidationResult: ["resultado"] },
|
|
87
|
+
"indexar-ir": { experienceIrIndex: ["resultado", "indice"] },
|
|
88
|
+
"consultar-ir": { experienceIrIndexEntry: ["resultado", "entry"] },
|
|
89
|
+
"chunk-ir": { experienceIrChunk: ["resultado", "chunk"] },
|
|
90
|
+
"descrever-ir": { experienceIrSerialization: ["resultado", "descriptor"] },
|
|
91
|
+
"validar-engine-snapshot": { operationResult: ["resultado"] },
|
|
92
|
+
"diff-engine-snapshots": { operationResult: ["resultado"], engineDiff: ["resultado", "value"] },
|
|
93
|
+
"validar-asset-provenance": { operationResult: ["resultado"] },
|
|
94
|
+
"validar-editor-state": { operationResult: ["resultado"] },
|
|
95
|
+
"planejar-jobs": { operationResult: ["resultado"], jobOrchestrationPlan: ["resultado", "value"] },
|
|
96
|
+
"validar-acceptance": { operationResult: ["resultado"] },
|
|
97
|
+
"operar-acceptance": { operationResult: ["resultado"] },
|
|
98
|
+
"validar-multimodal": { operationResult: ["resultado"] },
|
|
99
|
+
"validar-temporal": { temporalValidationResult: ["resultado"] },
|
|
100
|
+
"validar-evidencia-temporal": { temporalEvidenceValidationResult: ["resultado"] },
|
|
101
|
+
"validar-autonomia": { autonomyValidationResult: ["resultado"] },
|
|
102
|
+
"validar-playtest-fuzz": { playtestFuzzValidationResult: ["resultado"] },
|
|
103
|
+
"validar-multiplayer": { multiplayerValidationResult: ["resultado"] },
|
|
104
|
+
"analisar-portabilidade": { portabilityAnalysisResult: ["resultado"] },
|
|
105
|
+
"validar-workers": { distributedWorkersValidationResult: ["resultado"] },
|
|
106
|
+
});
|
|
107
|
+
function shape(schemaVersion, requiredTopLevelFields, officialFixturePaths = []) {
|
|
108
|
+
return Object.freeze({ type: "object", schemaVersion, requiredTopLevelFields, officialFixturePaths });
|
|
109
|
+
}
|
|
110
|
+
const DATA_SCHEMA_SHAPES = Object.freeze({
|
|
111
|
+
experienceIr: shape(EXPERIENCE_IR_SCHEMA_VERSION, ["schemaVersion", "revision", "coordinateSystem", "serialization", "project", "worlds", "scenes", "entities", "components", "transforms", "cameras", "lights", "materials", "textures", "audio", "physics", "constraints", "animations", "vfx", "timelines", "inputs", "saves", "networks", "builds"], ["exemplos/sistemas-interativos/experience-ir-valid.json"]),
|
|
112
|
+
experienceIrValidationResult: shape(EXPERIENCE_IR_VALIDATION_RESULT_SCHEMA_VERSION, ["sucesso", "valido", "documentDigest", "issues", "executed", "workspaceMutated", "authoritative"]),
|
|
113
|
+
experienceIrIndex: shape(EXPERIENCE_IR_INDEX_SCHEMA_VERSION, ["schemaVersion", "documentDigest", "entries", "partitions", "authoritative"]),
|
|
114
|
+
experienceIrIndexEntry: shape(EXPERIENCE_IR_INDEX_ENTRY_SCHEMA_VERSION, ["semanticId", "kind", "semanticRoles", "path", "contentDigest", "references"]),
|
|
115
|
+
experienceIrChunk: shape(EXPERIENCE_IR_CHUNK_SCHEMA_VERSION, ["schemaVersion", "chunkDigest", "documentDigest", "requestedSemanticIdDigests", "entries", "externalReferences", "authoritative"]),
|
|
116
|
+
experienceIrSerialization: shape(EXPERIENCE_IR_SERIALIZATION_SCHEMA_VERSION, ["schemaVersion", "json", "cbor", "semanticRoles"]),
|
|
117
|
+
operationResult: shape(OPERATION_RESULT_SCHEMA_V1, ["schemaVersion", "valid", "issues", "value", "digest", "executed", "workspaceMutated", "engineProbed", "editorInspected", "processesInspected", "resourcesReserved", "authoritative"]),
|
|
118
|
+
engineSnapshot: shape(ENGINE_SNAPSHOT_SCHEMA_V1, ["schemaVersion", "snapshotId", "projectId", "sceneId", "adapter", "semanticObjects", "artifactDigest", "readOnly", "authoritative"], ["exemplos/sistemas-interativos/advanced/engine-snapshot-before-valid.json"]),
|
|
119
|
+
engineDiff: shape(ENGINE_DIFF_SCHEMA_V1, ["schemaVersion", "beforeSnapshotDigest", "afterSnapshotDigest", "bindingDigest", "artifactDigestChanged", "changes", "diffDigest", "readOnly", "authoritative"]),
|
|
120
|
+
assetProvenance: shape(ASSET_PROVENANCE_SCHEMA_V1, ["schemaVersion", "assetId", "sourceUriRef", "sourceUriRedacted", "license", "sourceHash", "contentHash", "transforms", "derivatives", "authoritative"], ["exemplos/sistemas-interativos/advanced/asset-provenance-valid.json"]),
|
|
121
|
+
editorState: shape(EDITOR_STATE_SCHEMA_V1, ["schemaVersion", "editorSessionId", "adapter", "scene", "selection", "mode", "unsavedChanges", "shaderJobs", "importJobs", "plugins", "modals", "processes", "observedAt", "readOnly", "authoritative"], ["exemplos/sistemas-interativos/advanced/editor-state-valid.json"]),
|
|
122
|
+
jobOrchestration: shape(JOB_ORCHESTRATION_SCHEMA_V1, ["schemaVersion", "queueId", "capacity", "lockCapacity", "jobs"], ["exemplos/sistemas-interativos/advanced/job-orchestration-valid.json"]),
|
|
123
|
+
jobOrchestrationPlan: shape(JOB_ORCHESTRATION_SCHEMA_V1, ["schemaVersion", "queueId", "queue", "requestDigest", "externalRunnerRequired", "resourcesReserved", "authoritative", "planDigest"]),
|
|
124
|
+
acceptanceLock: shape(ACCEPTANCE_LOCK_SCHEMA_V1, ["schemaVersion", "lockId", "artifactDigest", "sceneId", "timeRange", "approver", "decision", "status", "createdAt", "authoritative"], ["exemplos/sistemas-interativos/advanced/acceptance-lock-valid.json"]),
|
|
125
|
+
multimodalEvidence: shape(MULTIMODAL_EVIDENCE_SCHEMA_V1, ["schemaVersion", "evidenceId", "runId", "claimId", "definitionDigest", "planDigest", "contractDigest", "claimBindingDigest", "artifactDigest", "sceneId", "timeRange", "requiredModalities", "channels", "producer", "verifier", "decision", "observedAt", "authoritative"], ["exemplos/sistemas-interativos/advanced/multimodal-evidence-valid.json"]),
|
|
126
|
+
temporalContract: shape(SCHEMA_CONTRATO_TEMPORAL, ["schemaVersion", "contractId", "systemId", "experienceIrDigest", "coordinateSystem", "phases", "tracks", "invariants", "shots", "physics", "temporalQa", "buildAcceptance", "hardwareTargets"], ["exemplos/sistemas-interativos/advanced/temporal-valid.json"]),
|
|
127
|
+
temporalEvidence: shape(SCHEMA_EVIDENCIA_TEMPORAL, ["schemaVersion", "runId", "contractDigest", "producerId", "producerVersion", "producerConfigurationDigest", "verifierId", "verifierVersion", "verifierConfigurationDigest", "independentOfProducer", "observations"], ["exemplos/sistemas-interativos/advanced/temporal-evidence-valid.json"]),
|
|
128
|
+
temporalValidationResult: shape(TEMPORAL_VALIDATION_RESULT_SCHEMA_VERSION, ["valido", "contractDigest", "requiredCheckIds", "bloqueios", "executed", "authoritative"]),
|
|
129
|
+
temporalEvidenceValidationResult: shape(TEMPORAL_EVIDENCE_VALIDATION_RESULT_SCHEMA_VERSION, ["valido", "contractDigest", "bundleDigest", "checksAceitos", "checksAusentes", "checksFalhos", "diagnostics", "nextActions", "bloqueios", "completed", "localCoverageComplete", "awaitingExternalAttestation", "completionScope", "authoritative", "executed", "resultDigest"]),
|
|
130
|
+
autonomy: shape(SCHEMA_AUTONOMIA, ["schemaVersion", "runId", "cycleIndex", "previousCycleDigest", "triggeredStopCriteria", "systemId", "definitionDigest", "policy", "diagnostics", "resourceLocks", "acceptanceLocks", "acceptanceLocksDigest", "acceptanceClaims", "proposals", "simulations", "proofs", "recoveryToken"], ["exemplos/sistemas-interativos/advanced/autonomy-repair-valid.json"]),
|
|
131
|
+
autonomyValidationResult: shape(AUTONOMY_VALIDATION_RESULT_SCHEMA_VERSION, ["valido", "cycleDigest", "eligibleSafePatches", "blockedPatches", "diagnostics", "nextActions", "completed", "authoritative", "executed", "bloqueios"]),
|
|
132
|
+
playtestFuzz: shape(SCHEMA_PLAYTEST_FUZZ, ["schemaVersion", "planId", "systemId", "definitionDigest", "inputActions", "bots", "stateCheckpoints", "saveLoadCases", "fuzzBounds", "stopCriteria", "evidenceRequirements"], ["exemplos/sistemas-interativos/advanced/playtest-fuzz-valid.json"]),
|
|
133
|
+
playtestFuzzValidationResult: shape(PLAYTEST_FUZZ_VALIDATION_RESULT_SCHEMA_VERSION, ["valido", "planDigest", "scenarioIds", "nextActions", "authoritative", "executed", "bloqueios"]),
|
|
134
|
+
multiplayerAuthority: shape(SCHEMA_AUTORIDADE_MULTIPLAYER, ["schemaVersion", "modelId", "systemId", "topology", "authorities", "replicatedState", "conflicts", "reconnect", "securityInvariants", "evidenceRequirements"], ["exemplos/sistemas-interativos/advanced/multiplayer-authority-valid.json"]),
|
|
135
|
+
multiplayerValidationResult: shape(MULTIPLAYER_VALIDATION_RESULT_SCHEMA_VERSION, ["valido", "modelDigest", "authorityGaps", "nextActions", "authoritative", "executed", "bloqueios"]),
|
|
136
|
+
portability: shape(SCHEMA_PORTABILIDADE, ["schemaVersion", "planId", "systemId", "experienceIrDigest", "source", "sourceManifest", "targets", "migrations", "acceptance"], ["exemplos/sistemas-interativos/advanced/portability-valid.json"]),
|
|
137
|
+
portabilityAnalysisResult: shape(PORTABILITY_ANALYSIS_RESULT_SCHEMA_VERSION, ["valido", "planDigest", "targetReports", "declaredLosses", "migrationGaps", "nextActions", "converted", "authoritative", "executed", "bloqueios"]),
|
|
138
|
+
distributedWorkers: shape(SCHEMA_WORKERS_DISTRIBUIDOS, ["schemaVersion", "planId", "systemId", "inputDigest", "workers", "jobs", "leases", "evidenceRequirements"], ["exemplos/sistemas-interativos/advanced/distributed-workers-valid.json"]),
|
|
139
|
+
distributedWorkersValidationResult: shape(DISTRIBUTED_WORKERS_VALIDATION_RESULT_SCHEMA_VERSION, ["valido", "planDigest", "topologicalOrder", "assignments", "capabilityGaps", "lockConflicts", "nextActions", "completed", "authoritative", "executed", "bloqueios"]),
|
|
140
|
+
});
|
|
141
|
+
const COMANDOS_SCHEMA_ACIONAVEL = Object.freeze(Object.fromEntries(SUBCOMANDOS_EXTENSAO_INTERATIVA.map((comando) => [comando, {
|
|
142
|
+
...COMANDOS_SCHEMA[comando],
|
|
143
|
+
...VINCULOS_SCHEMA_COMANDO[comando],
|
|
144
|
+
outputTargets: OUTPUT_TARGETS_SCHEMA[comando],
|
|
145
|
+
}])));
|
|
146
|
+
export const SCHEMA_EXTENSOES_CLI_INTERATIVAS = Object.freeze({
|
|
147
|
+
schemaVersion: INTERACTIVE_CLI_EXTENSION_SCHEMA_VERSION,
|
|
148
|
+
readOnly: true,
|
|
149
|
+
executed: false,
|
|
150
|
+
workspaceMutated: false,
|
|
151
|
+
authoritative: false,
|
|
152
|
+
externalExecutionRequired: true,
|
|
153
|
+
commands: COMANDOS_SCHEMA_ACIONAVEL,
|
|
154
|
+
dataSchemas: Object.freeze({
|
|
155
|
+
experienceIr: EXPERIENCE_IR_SCHEMA_VERSION,
|
|
156
|
+
experienceIrValidationResult: EXPERIENCE_IR_VALIDATION_RESULT_SCHEMA_VERSION,
|
|
157
|
+
experienceIrIndex: EXPERIENCE_IR_INDEX_SCHEMA_VERSION,
|
|
158
|
+
experienceIrIndexEntry: EXPERIENCE_IR_INDEX_ENTRY_SCHEMA_VERSION,
|
|
159
|
+
experienceIrChunk: EXPERIENCE_IR_CHUNK_SCHEMA_VERSION,
|
|
160
|
+
experienceIrSerialization: EXPERIENCE_IR_SERIALIZATION_SCHEMA_VERSION,
|
|
161
|
+
operationResult: OPERATION_RESULT_SCHEMA_V1,
|
|
162
|
+
engineSnapshot: ENGINE_SNAPSHOT_SCHEMA_V1,
|
|
163
|
+
engineDiff: ENGINE_DIFF_SCHEMA_V1,
|
|
164
|
+
assetProvenance: ASSET_PROVENANCE_SCHEMA_V1,
|
|
165
|
+
editorState: EDITOR_STATE_SCHEMA_V1,
|
|
166
|
+
jobOrchestration: JOB_ORCHESTRATION_SCHEMA_V1,
|
|
167
|
+
jobOrchestrationPlan: JOB_ORCHESTRATION_SCHEMA_V1,
|
|
168
|
+
acceptanceLock: ACCEPTANCE_LOCK_SCHEMA_V1,
|
|
169
|
+
multimodalEvidence: MULTIMODAL_EVIDENCE_SCHEMA_V1,
|
|
170
|
+
temporalContract: SCHEMA_CONTRATO_TEMPORAL,
|
|
171
|
+
temporalEvidence: SCHEMA_EVIDENCIA_TEMPORAL,
|
|
172
|
+
temporalValidationResult: TEMPORAL_VALIDATION_RESULT_SCHEMA_VERSION,
|
|
173
|
+
temporalEvidenceValidationResult: TEMPORAL_EVIDENCE_VALIDATION_RESULT_SCHEMA_VERSION,
|
|
174
|
+
autonomy: SCHEMA_AUTONOMIA,
|
|
175
|
+
autonomyValidationResult: AUTONOMY_VALIDATION_RESULT_SCHEMA_VERSION,
|
|
176
|
+
playtestFuzz: SCHEMA_PLAYTEST_FUZZ,
|
|
177
|
+
playtestFuzzValidationResult: PLAYTEST_FUZZ_VALIDATION_RESULT_SCHEMA_VERSION,
|
|
178
|
+
multiplayerAuthority: SCHEMA_AUTORIDADE_MULTIPLAYER,
|
|
179
|
+
multiplayerValidationResult: MULTIPLAYER_VALIDATION_RESULT_SCHEMA_VERSION,
|
|
180
|
+
portability: SCHEMA_PORTABILIDADE,
|
|
181
|
+
portabilityAnalysisResult: PORTABILITY_ANALYSIS_RESULT_SCHEMA_VERSION,
|
|
182
|
+
distributedWorkers: SCHEMA_WORKERS_DISTRIBUIDOS,
|
|
183
|
+
distributedWorkersValidationResult: DISTRIBUTED_WORKERS_VALIDATION_RESULT_SCHEMA_VERSION,
|
|
184
|
+
}),
|
|
185
|
+
dataSchemaShapes: DATA_SCHEMA_SHAPES,
|
|
186
|
+
});
|
|
187
|
+
const ESPECIFICACOES = Object.freeze({
|
|
188
|
+
"validar-ir": { posicionais: 1 },
|
|
189
|
+
"indexar-ir": { posicionais: 1 },
|
|
190
|
+
"consultar-ir": { posicionais: 1, opcoes: { "--semantic-id": "semanticId" }, obrigatorias: ["semanticId"] },
|
|
191
|
+
"chunk-ir": { posicionais: 1, opcoes: { "--semantic-id": "semanticId" }, flags: ["--raso"], obrigatorias: ["semanticId"] },
|
|
192
|
+
"descrever-ir": { posicionais: 0 },
|
|
193
|
+
"validar-engine-snapshot": { posicionais: 1 },
|
|
194
|
+
"diff-engine-snapshots": { posicionais: 2 },
|
|
195
|
+
"validar-asset-provenance": { posicionais: 1 },
|
|
196
|
+
"validar-editor-state": { posicionais: 1 },
|
|
197
|
+
"planejar-jobs": { posicionais: 1 },
|
|
198
|
+
"validar-acceptance": { posicionais: 1 },
|
|
199
|
+
"operar-acceptance": {
|
|
200
|
+
posicionais: 1,
|
|
201
|
+
opcoes: { "--operation": "operation", "--context-file": "contextFile" },
|
|
202
|
+
obrigatorias: ["operation", "contextFile"],
|
|
203
|
+
},
|
|
204
|
+
"validar-multimodal": { posicionais: 1 },
|
|
205
|
+
"validar-temporal": { posicionais: 1 },
|
|
206
|
+
"validar-evidencia-temporal": {
|
|
207
|
+
posicionais: 1,
|
|
208
|
+
opcoes: { "--bundle-arquivo": "bundleFile", "--evidencias-arquivo": "bundleFile" },
|
|
209
|
+
obrigatorias: ["bundleFile"],
|
|
210
|
+
},
|
|
211
|
+
"validar-autonomia": { posicionais: 1 },
|
|
212
|
+
"validar-playtest-fuzz": { posicionais: 1 },
|
|
213
|
+
"validar-multiplayer": { posicionais: 1 },
|
|
214
|
+
"analisar-portabilidade": { posicionais: 1 },
|
|
215
|
+
"validar-workers": { posicionais: 1 },
|
|
216
|
+
});
|
|
217
|
+
const SUBCOMANDOS = new Set(SUBCOMANDOS_EXTENSAO_INTERATIVA);
|
|
218
|
+
const OPERACOES_ACCEPTANCE = new Set(["VALIDATE", "EVALUATE", "INVALIDATE"]);
|
|
219
|
+
function basePayload(comando, sucesso) {
|
|
220
|
+
return {
|
|
221
|
+
sucesso,
|
|
222
|
+
comando,
|
|
223
|
+
readOnly: true,
|
|
224
|
+
executed: false,
|
|
225
|
+
workspaceMutated: false,
|
|
226
|
+
authoritative: false,
|
|
227
|
+
externalExecutionRequired: true,
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
function resposta(comando, sucesso, valor) {
|
|
231
|
+
return {
|
|
232
|
+
exitCode: sucesso ? 0 : 1,
|
|
233
|
+
payload: { ...valor, ...basePayload(comando, sucesso) },
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
function erro(comando, errorCode) {
|
|
237
|
+
return resposta(comando, false, { errorCode });
|
|
238
|
+
}
|
|
239
|
+
function parsear(args) {
|
|
240
|
+
const nome = args[0]?.toLowerCase().replace(/_/g, "-");
|
|
241
|
+
if (!nome || !SUBCOMANDOS.has(nome))
|
|
242
|
+
return null;
|
|
243
|
+
const subcomando = nome;
|
|
244
|
+
const especificacao = ESPECIFICACOES[subcomando];
|
|
245
|
+
const posicionais = [];
|
|
246
|
+
const opcoes = {};
|
|
247
|
+
const flags = new Set();
|
|
248
|
+
for (let indice = 1; indice < args.length; indice += 1) {
|
|
249
|
+
const token = args[indice];
|
|
250
|
+
if (!token.startsWith("--")) {
|
|
251
|
+
posicionais.push(token);
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
if (token === "--json") {
|
|
255
|
+
if (flags.has(token))
|
|
256
|
+
return erro(subcomando, "INTERATIVO_ARGUMENTOS_INVALIDOS");
|
|
257
|
+
flags.add(token);
|
|
258
|
+
continue;
|
|
259
|
+
}
|
|
260
|
+
if (especificacao.flags?.includes(token)) {
|
|
261
|
+
if (flags.has(token))
|
|
262
|
+
return erro(subcomando, "INTERATIVO_ARGUMENTOS_INVALIDOS");
|
|
263
|
+
flags.add(token);
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
const chave = especificacao.opcoes?.[token];
|
|
267
|
+
if (!chave || opcoes[chave] !== undefined)
|
|
268
|
+
return erro(subcomando, "INTERATIVO_ARGUMENTOS_INVALIDOS");
|
|
269
|
+
const valor = args[indice + 1];
|
|
270
|
+
if (valor === undefined || valor.startsWith("--"))
|
|
271
|
+
return erro(subcomando, "INTERATIVO_ARGUMENTOS_INVALIDOS");
|
|
272
|
+
opcoes[chave] = valor;
|
|
273
|
+
indice += 1;
|
|
274
|
+
}
|
|
275
|
+
if (posicionais.length !== especificacao.posicionais
|
|
276
|
+
|| especificacao.obrigatorias?.some((chave) => opcoes[chave] === undefined)) {
|
|
277
|
+
return erro(subcomando, "INTERATIVO_ARGUMENTOS_INVALIDOS");
|
|
278
|
+
}
|
|
279
|
+
if (subcomando === "operar-acceptance" && !OPERACOES_ACCEPTANCE.has(opcoes.operation)) {
|
|
280
|
+
return erro(subcomando, "INTERATIVO_FILTRO_INVALIDO");
|
|
281
|
+
}
|
|
282
|
+
return { subcomando, posicionais, opcoes, flags };
|
|
283
|
+
}
|
|
284
|
+
async function lerJson(arquivo) {
|
|
285
|
+
return JSON.parse(await readFile(arquivo, "utf8"));
|
|
286
|
+
}
|
|
287
|
+
export async function executarExtensaoCliInterativa(args) {
|
|
288
|
+
const parse = parsear(args);
|
|
289
|
+
if (parse === null || "exitCode" in parse)
|
|
290
|
+
return parse;
|
|
291
|
+
const { subcomando, posicionais, opcoes, flags } = parse;
|
|
292
|
+
try {
|
|
293
|
+
if (subcomando === "descrever-ir") {
|
|
294
|
+
const resultado = descreverSerializacaoExperienceIr();
|
|
295
|
+
return resposta(subcomando, resultado.sucesso, { resultado });
|
|
296
|
+
}
|
|
297
|
+
if (subcomando === "diff-engine-snapshots") {
|
|
298
|
+
const [antes, depois] = await Promise.all([lerJson(posicionais[0]), lerJson(posicionais[1])]);
|
|
299
|
+
const resultado = derivarDiffSnapshotsEngine(antes, depois);
|
|
300
|
+
return resposta(subcomando, resultado.valid, { resultado });
|
|
301
|
+
}
|
|
302
|
+
if (subcomando === "operar-acceptance") {
|
|
303
|
+
const [lock, contexto] = await Promise.all([lerJson(posicionais[0]), lerJson(opcoes.contextFile)]);
|
|
304
|
+
const resultado = operarAcceptanceLock(opcoes.operation, lock, contexto);
|
|
305
|
+
return resposta(subcomando, resultado.valid, { resultado });
|
|
306
|
+
}
|
|
307
|
+
if (subcomando === "validar-evidencia-temporal") {
|
|
308
|
+
const [contrato, bundle] = await Promise.all([lerJson(posicionais[0]), lerJson(opcoes.bundleFile)]);
|
|
309
|
+
const resultado = validarBundleVerificacaoTemporal(contrato, bundle);
|
|
310
|
+
return resposta(subcomando, resultado.valido, { resultado });
|
|
311
|
+
}
|
|
312
|
+
const entrada = await lerJson(posicionais[0]);
|
|
313
|
+
if (subcomando === "validar-ir") {
|
|
314
|
+
const resultado = validarExperienceIr(entrada);
|
|
315
|
+
return resposta(subcomando, resultado.valido, { resultado });
|
|
316
|
+
}
|
|
317
|
+
if (subcomando === "indexar-ir") {
|
|
318
|
+
const resultado = indexarExperienceIr(entrada);
|
|
319
|
+
return resposta(subcomando, resultado.sucesso, { resultado });
|
|
320
|
+
}
|
|
321
|
+
if (subcomando === "consultar-ir" || subcomando === "chunk-ir") {
|
|
322
|
+
const indice = indexarExperienceIr(entrada);
|
|
323
|
+
if (!indice.sucesso || indice.indice === null)
|
|
324
|
+
return resposta(subcomando, false, { resultado: indice });
|
|
325
|
+
if (subcomando === "consultar-ir") {
|
|
326
|
+
const resultado = consultarIndiceExperienceIr(indice.indice, opcoes.semanticId);
|
|
327
|
+
return resposta(subcomando, resultado.sucesso, { resultado });
|
|
328
|
+
}
|
|
329
|
+
const resultado = criarChunkExperienceIr(entrada, [opcoes.semanticId], !flags.has("--raso"));
|
|
330
|
+
return resposta(subcomando, resultado.sucesso, { resultado });
|
|
331
|
+
}
|
|
332
|
+
if (subcomando === "validar-engine-snapshot") {
|
|
333
|
+
const resultado = validarSnapshotEngine(entrada);
|
|
334
|
+
return resposta(subcomando, resultado.valid, { resultado });
|
|
335
|
+
}
|
|
336
|
+
if (subcomando === "validar-asset-provenance") {
|
|
337
|
+
const resultado = validarProvenienciaAsset(entrada);
|
|
338
|
+
return resposta(subcomando, resultado.valid, { resultado });
|
|
339
|
+
}
|
|
340
|
+
if (subcomando === "validar-editor-state") {
|
|
341
|
+
const resultado = validarEstadoEditor(entrada);
|
|
342
|
+
return resposta(subcomando, resultado.valid, { resultado });
|
|
343
|
+
}
|
|
344
|
+
if (subcomando === "planejar-jobs") {
|
|
345
|
+
const resultado = planejarOrquestracaoJobs(entrada);
|
|
346
|
+
return resposta(subcomando, resultado.valid, { resultado });
|
|
347
|
+
}
|
|
348
|
+
if (subcomando === "validar-acceptance") {
|
|
349
|
+
const resultado = validarAcceptanceLock(entrada);
|
|
350
|
+
return resposta(subcomando, resultado.valid, { resultado });
|
|
351
|
+
}
|
|
352
|
+
if (subcomando === "validar-multimodal") {
|
|
353
|
+
const resultado = validarEvidenciaMultimodal(entrada);
|
|
354
|
+
return resposta(subcomando, resultado.valid, { resultado });
|
|
355
|
+
}
|
|
356
|
+
if (subcomando === "validar-temporal") {
|
|
357
|
+
const resultado = validarContratoTemporalInterativo(entrada);
|
|
358
|
+
return resposta(subcomando, resultado.valido, { resultado });
|
|
359
|
+
}
|
|
360
|
+
if (subcomando === "validar-autonomia") {
|
|
361
|
+
const resultado = validarCicloReparoAutonomo(entrada);
|
|
362
|
+
return resposta(subcomando, resultado.valido, { resultado });
|
|
363
|
+
}
|
|
364
|
+
if (subcomando === "validar-playtest-fuzz") {
|
|
365
|
+
const resultado = validarPlanoPlaytestFuzz(entrada);
|
|
366
|
+
return resposta(subcomando, resultado.valido, { resultado });
|
|
367
|
+
}
|
|
368
|
+
if (subcomando === "validar-multiplayer") {
|
|
369
|
+
const resultado = validarModeloAutoridadeMultiplayer(entrada);
|
|
370
|
+
return resposta(subcomando, resultado.valido, { resultado });
|
|
371
|
+
}
|
|
372
|
+
if (subcomando === "analisar-portabilidade") {
|
|
373
|
+
const resultado = analisarPlanoPortabilidadeInterativa(entrada);
|
|
374
|
+
return resposta(subcomando, resultado.valido, { resultado });
|
|
375
|
+
}
|
|
376
|
+
const resultado = validarPlanoWorkersDistribuidos(entrada);
|
|
377
|
+
return resposta(subcomando, resultado.valido, { resultado });
|
|
378
|
+
}
|
|
379
|
+
catch {
|
|
380
|
+
return erro(subcomando, "INTERATIVO_ENTRADA_INVALIDA");
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
//# sourceMappingURL=extensionCommand.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * from "./types.js";
|
|
2
|
+
export * from "./canonical.js";
|
|
3
|
+
export * from "./catalog.js";
|
|
4
|
+
export * from "./validator.js";
|
|
5
|
+
export * from "./planner.js";
|
|
6
|
+
export * from "./adapterProtocol.js";
|
|
7
|
+
export * from "./evidence.js";
|
|
8
|
+
export * from "./render.js";
|
|
9
|
+
export * from "./command.js";
|
|
10
|
+
export * from "./advancedCatalog.js";
|
|
11
|
+
export * from "./experienceIrTypes.js";
|
|
12
|
+
export * from "./experienceIr.js";
|
|
13
|
+
export * from "./temporal.js";
|
|
14
|
+
export * from "./autonomy.js";
|
|
15
|
+
export * from "./portability.js";
|
|
16
|
+
export * from "./operationsTypes.js";
|
|
17
|
+
export * from "./operations.js";
|
|
18
|
+
export * from "./extensionCommand.js";
|
|
19
|
+
export * from "./controlRun.js";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// SEMA-GOVERNED: sema.produto.sistemas_interativos
|
|
2
|
+
// Descricao: superficie publica do modulo declarativo de sistemas interativos.
|
|
3
|
+
export * from "./types.js";
|
|
4
|
+
export * from "./canonical.js";
|
|
5
|
+
export * from "./catalog.js";
|
|
6
|
+
export * from "./validator.js";
|
|
7
|
+
export * from "./planner.js";
|
|
8
|
+
export * from "./adapterProtocol.js";
|
|
9
|
+
export * from "./evidence.js";
|
|
10
|
+
export * from "./render.js";
|
|
11
|
+
export * from "./command.js";
|
|
12
|
+
export * from "./advancedCatalog.js";
|
|
13
|
+
export * from "./experienceIrTypes.js";
|
|
14
|
+
export * from "./experienceIr.js";
|
|
15
|
+
export * from "./temporal.js";
|
|
16
|
+
export * from "./autonomy.js";
|
|
17
|
+
export * from "./portability.js";
|
|
18
|
+
export * from "./operationsTypes.js";
|
|
19
|
+
export * from "./operations.js";
|
|
20
|
+
export * from "./extensionCommand.js";
|
|
21
|
+
export * from "./controlRun.js";
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type AcceptanceLockV1, type AcceptanceOperationValue, type AcceptanceTimeRange, type AssetProvenanceV1, type EditorStateV1, type EngineSnapshotDiffV1, type JobOrchestrationPlanV1, type MultimodalChannelType, type MultimodalEvidenceDescriptorV1, type OpaqueSha256, type OperationResult, type Sha256, type ValidatedEngineSnapshot } from "./operationsTypes.js";
|
|
2
|
+
export * from "./operationsTypes.js";
|
|
3
|
+
export declare function digestJsonOperacional(value: unknown): Sha256;
|
|
4
|
+
export declare function criarReferenciaFonteOpaca(sourceUri: unknown): OperationResult<{
|
|
5
|
+
readonly sourceUriRef: OpaqueSha256;
|
|
6
|
+
readonly sourceUriRedacted: true;
|
|
7
|
+
}>;
|
|
8
|
+
export declare function validarSnapshotEngine(input: unknown): OperationResult<ValidatedEngineSnapshot>;
|
|
9
|
+
export declare function derivarDiffSnapshotsEngine(beforeInput: unknown, afterInput: unknown): OperationResult<EngineSnapshotDiffV1>;
|
|
10
|
+
export declare function validarProvenienciaAsset(input: unknown): OperationResult<{
|
|
11
|
+
readonly provenance: AssetProvenanceV1;
|
|
12
|
+
readonly provenanceDigest: Sha256;
|
|
13
|
+
}>;
|
|
14
|
+
export declare function validarEstadoEditor(input: unknown): OperationResult<{
|
|
15
|
+
readonly state: EditorStateV1;
|
|
16
|
+
readonly editorStateDigest: Sha256;
|
|
17
|
+
readonly externallyObserved: false;
|
|
18
|
+
}>;
|
|
19
|
+
export declare function planejarOrquestracaoJobs(input: unknown): OperationResult<JobOrchestrationPlanV1>;
|
|
20
|
+
export declare function validarAcceptanceLock(input: unknown): OperationResult<{
|
|
21
|
+
readonly lock: AcceptanceLockV1;
|
|
22
|
+
readonly lockDigest: Sha256;
|
|
23
|
+
}>;
|
|
24
|
+
export declare function operarAcceptanceLock(operation: unknown, lockInput: unknown, contextInput: unknown): OperationResult<AcceptanceOperationValue>;
|
|
25
|
+
export declare function digestVinculoClaimMultimodal(input: {
|
|
26
|
+
readonly claimId: string;
|
|
27
|
+
readonly runId: string;
|
|
28
|
+
readonly definitionDigest: Sha256;
|
|
29
|
+
readonly planDigest: Sha256;
|
|
30
|
+
readonly contractDigest: Sha256;
|
|
31
|
+
readonly artifactDigest: Sha256;
|
|
32
|
+
readonly sceneId: string;
|
|
33
|
+
readonly timeRange: AcceptanceTimeRange;
|
|
34
|
+
readonly requiredModalities: readonly MultimodalChannelType[];
|
|
35
|
+
}): Sha256;
|
|
36
|
+
export declare function validarEvidenciaMultimodal(input: unknown): OperationResult<{
|
|
37
|
+
readonly descriptor: MultimodalEvidenceDescriptorV1;
|
|
38
|
+
readonly descriptorDigest: Sha256;
|
|
39
|
+
readonly localDescriptorOnly: true;
|
|
40
|
+
}>;
|