@semacode/cli 2.1.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +107 -4
- 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 +70 -19
- package/dist/comandos.js +6 -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/execucoesExternas.js +19 -5
- package/dist/exemplosOficiais.js +29 -8
- package/dist/iaPrompts.d.ts +1 -1
- package/dist/iaPrompts.js +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +24 -5
- package/dist/index.part01.d.ts +1 -1
- package/dist/index.part01.js +47 -3
- package/dist/index.part06.js +3 -0
- package/dist/initTemplatesBase.js +3 -2
- package/dist/pipelineConteudo/adapters.d.ts +84 -0
- package/dist/pipelineConteudo/adapters.js +449 -0
- package/dist/pipelineConteudo/canonical.d.ts +18 -0
- package/dist/pipelineConteudo/canonical.js +107 -0
- package/dist/pipelineConteudo/command.d.ts +3 -0
- package/dist/pipelineConteudo/command.js +572 -0
- package/dist/pipelineConteudo/index.d.ts +9 -0
- package/dist/pipelineConteudo/index.js +12 -0
- package/dist/pipelineConteudo/ledger.d.ts +68 -0
- package/dist/pipelineConteudo/ledger.js +732 -0
- package/dist/pipelineConteudo/planner.d.ts +12 -0
- package/dist/pipelineConteudo/planner.js +366 -0
- package/dist/pipelineConteudo/projection.d.ts +16 -0
- package/dist/pipelineConteudo/projection.js +57 -0
- package/dist/pipelineConteudo/state.d.ts +23 -0
- package/dist/pipelineConteudo/state.js +615 -0
- package/dist/pipelineConteudo/trust.d.ts +17 -0
- package/dist/pipelineConteudo/trust.js +750 -0
- package/dist/pipelineConteudo/types.d.ts +331 -0
- package/dist/pipelineConteudo/types.js +4 -0
- 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/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/docs/README.md +9 -0
- package/docs/ai-integration.md +7 -1
- package/docs/ai-workflow.md +5 -4
- package/docs/commands.md +43 -1
- package/docs/descoberta-capacidades.md +106 -0
- package/docs/documentation.md +11 -2
- package/docs/pipeline-conteudo.md +246 -0
- package/docs/profiles.md +11 -2
- package/docs/sistemas-interativos.md +381 -0
- package/docs/testing.md +11 -2
- package/exemplos/pipeline-conteudo/README.md +44 -0
- package/exemplos/pipeline-conteudo/alvos.json +23 -0
- package/exemplos/pipeline-conteudo/definicao.json +136 -0
- package/exemplos/profile_simulation.sema +211 -0
- 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/node_modules/@sema/gerador-lua/dist/index.js +78 -4
- package/node_modules/@sema/gerador-lua/dist/index.js.map +1 -1
- package/node_modules/@sema/gerador-php/dist/index.js +8 -0
- package/node_modules/@sema/gerador-php/dist/index.js.map +1 -1
- package/package.json +8 -1
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// SEMA-GOVERNED: sema.produto.descoberta_capacidades
|
|
2
|
+
// Descrição: saída humana agrupada, contextual e explícita sobre ausência de execução.
|
|
3
|
+
const KIND_LABELS = {
|
|
4
|
+
GOVERNANCE_FLOW: "Fluxos de governança",
|
|
5
|
+
PROFILE_GATE: "Gates por profile",
|
|
6
|
+
SPECIALIZED_WORKFLOW: "Workflows especializados",
|
|
7
|
+
ORCHESTRATION_PIPELINE: "Pipelines de orquestração",
|
|
8
|
+
CAPABILITY_TOKEN: "Capabilities declarativas",
|
|
9
|
+
GENERATOR: "Geradores",
|
|
10
|
+
ADAPTER: "Adapters externos",
|
|
11
|
+
};
|
|
12
|
+
const FRONTEIRA = "Nenhuma ação foi executada; o workspace e serviços externos não foram tocados.";
|
|
13
|
+
function linhaComando(entry) {
|
|
14
|
+
const command = entry.commandTemplates[0]?.command;
|
|
15
|
+
return command ? ` Comando explícito: ${command}` : " Comando explícito: não disponível";
|
|
16
|
+
}
|
|
17
|
+
function renderizarCatalogo(payload) {
|
|
18
|
+
const linhas = [
|
|
19
|
+
"DESCOBERTA SEMA",
|
|
20
|
+
`CATÁLOGO · ${payload.entries.length} capacidade(s)`,
|
|
21
|
+
FRONTEIRA,
|
|
22
|
+
];
|
|
23
|
+
if (payload.entries.length === 0) {
|
|
24
|
+
linhas.push("", "Nenhuma capacidade corresponde aos filtros informados.");
|
|
25
|
+
return linhas.join("\n");
|
|
26
|
+
}
|
|
27
|
+
for (const kind of Object.keys(KIND_LABELS)) {
|
|
28
|
+
const entries = payload.entries.filter((entry) => entry.kind === kind);
|
|
29
|
+
if (entries.length === 0)
|
|
30
|
+
continue;
|
|
31
|
+
linhas.push("", `${KIND_LABELS[kind]} (${entries.length})`);
|
|
32
|
+
for (const entry of entries) {
|
|
33
|
+
linhas.push(`- ${entry.label} · ${entry.id}`, ` ${entry.summary}`, ` Use quando: ${entry.useWhen[0] ?? "consulte a descrição detalhada"}`, linhaComando(entry));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return linhas.join("\n");
|
|
37
|
+
}
|
|
38
|
+
function renderizarRanking(payload) {
|
|
39
|
+
const linhas = [
|
|
40
|
+
"DESCOBERTA SEMA",
|
|
41
|
+
`INTENÇÃO · ${payload.intent}`,
|
|
42
|
+
FRONTEIRA,
|
|
43
|
+
];
|
|
44
|
+
if (payload.noMatch) {
|
|
45
|
+
linhas.push("", "Sem correspondência segura (o melhor score ficou abaixo de 60/100).");
|
|
46
|
+
}
|
|
47
|
+
else if (payload.ambiguity.detected) {
|
|
48
|
+
linhas.push("", `Ambiguidade detectada entre ${payload.ambiguity.candidates.join(" e ")}.`, "Nenhum comando único foi sugerido; refine a intenção ou escolha uma capacidade explicitamente.");
|
|
49
|
+
}
|
|
50
|
+
if (payload.recommendations.length === 0) {
|
|
51
|
+
linhas.push("", "Nenhuma candidata recebeu sinais positivos.");
|
|
52
|
+
return linhas.join("\n");
|
|
53
|
+
}
|
|
54
|
+
linhas.push("");
|
|
55
|
+
for (const recommendation of payload.recommendations) {
|
|
56
|
+
linhas.push(`${recommendation.rank}. ${recommendation.label} · ${recommendation.id} — ${recommendation.score}/100`, ` Motivos: ${recommendation.reasons.join("; ")}`, ` Sinais: ${recommendation.matchedSignals.join(", ") || "nenhum"}`);
|
|
57
|
+
if (recommendation.missingInputs.length > 0) {
|
|
58
|
+
linhas.push(` Entradas ainda necessárias: ${recommendation.missingInputs.join(", ")}`);
|
|
59
|
+
}
|
|
60
|
+
if (recommendation.suggestedCommandTemplate) {
|
|
61
|
+
linhas.push(` Comando explícito: ${recommendation.suggestedCommandTemplate}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return linhas.join("\n");
|
|
65
|
+
}
|
|
66
|
+
function renderizarExplicacao(payload) {
|
|
67
|
+
const entry = payload.entry;
|
|
68
|
+
const linhas = [
|
|
69
|
+
"DESCOBERTA SEMA",
|
|
70
|
+
`${entry.label} · ${entry.id}`,
|
|
71
|
+
`${KIND_LABELS[entry.kind]} · ${entry.domains.join(", ")}`,
|
|
72
|
+
FRONTEIRA,
|
|
73
|
+
"",
|
|
74
|
+
entry.summary,
|
|
75
|
+
"",
|
|
76
|
+
"Use quando:",
|
|
77
|
+
...entry.useWhen.map((item) => `- ${item}`),
|
|
78
|
+
"",
|
|
79
|
+
"Evite quando:",
|
|
80
|
+
...entry.avoidWhen.map((item) => `- ${item}`),
|
|
81
|
+
"",
|
|
82
|
+
"Comandos explícitos:",
|
|
83
|
+
...entry.commandTemplates.map((item) => (`- ${item.command} [${item.effectClass}; muta workspace: ${item.mutatesWorkspace ? "sim" : "não"}; runtime externo: ${item.executesExternalRuntime ? "sim" : "não"}]`)),
|
|
84
|
+
];
|
|
85
|
+
return linhas.join("\n");
|
|
86
|
+
}
|
|
87
|
+
export function renderizarResultadoDescoberta(payload) {
|
|
88
|
+
if (payload.mode === "catalog")
|
|
89
|
+
return renderizarCatalogo(payload);
|
|
90
|
+
if (payload.mode === "ranking")
|
|
91
|
+
return renderizarRanking(payload);
|
|
92
|
+
if (payload.mode === "explain")
|
|
93
|
+
return renderizarExplicacao(payload);
|
|
94
|
+
return [
|
|
95
|
+
"DESCOBERTA SEMA · ERRO",
|
|
96
|
+
payload.error.message,
|
|
97
|
+
FRONTEIRA,
|
|
98
|
+
].join("\n");
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=render.js.map
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
export declare const DISCOVERY_SCHEMA_VERSION: "sema.discovery/v1";
|
|
2
|
+
export declare const DISCOVERY_KINDS: readonly ["GOVERNANCE_FLOW", "PROFILE_GATE", "SPECIALIZED_WORKFLOW", "ORCHESTRATION_PIPELINE", "CAPABILITY_TOKEN", "GENERATOR", "ADAPTER"];
|
|
3
|
+
export type DiscoveryKind = (typeof DISCOVERY_KINDS)[number];
|
|
4
|
+
export type DiscoveryEffectClass = "READ_ONLY_DISCOVERY" | "READ_ONLY_VALIDATION" | "DECLARATIVE_PLANNING" | "WORKSPACE_BOOTSTRAP" | "WORKSPACE_GENERATION" | "WORKSPACE_VERIFICATION";
|
|
5
|
+
export interface DiscoveryCommandTemplate {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly command: string;
|
|
8
|
+
readonly effectClass: DiscoveryEffectClass;
|
|
9
|
+
readonly mutatesWorkspace: boolean;
|
|
10
|
+
readonly executesExternalRuntime: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface DiscoveryEntry {
|
|
13
|
+
readonly id: string;
|
|
14
|
+
readonly kind: DiscoveryKind;
|
|
15
|
+
readonly domains: readonly string[];
|
|
16
|
+
readonly label: string;
|
|
17
|
+
readonly summary: string;
|
|
18
|
+
readonly useWhen: readonly string[];
|
|
19
|
+
readonly avoidWhen: readonly string[];
|
|
20
|
+
readonly intentSignals: readonly string[];
|
|
21
|
+
readonly negativeSignals: readonly string[];
|
|
22
|
+
readonly requiredInputs: readonly string[];
|
|
23
|
+
readonly commandTemplates: readonly DiscoveryCommandTemplate[];
|
|
24
|
+
readonly related: readonly string[];
|
|
25
|
+
readonly source: string;
|
|
26
|
+
readonly extensible: boolean;
|
|
27
|
+
readonly aliases?: readonly string[];
|
|
28
|
+
}
|
|
29
|
+
export interface DiscoveryExecutionBoundary {
|
|
30
|
+
readonly executed: false;
|
|
31
|
+
readonly workspaceMutated: false;
|
|
32
|
+
readonly externalCalls: false;
|
|
33
|
+
readonly requiresExplicitRun: true;
|
|
34
|
+
}
|
|
35
|
+
export interface DiscoveryCatalogFilters {
|
|
36
|
+
readonly kind?: DiscoveryKind | string | null;
|
|
37
|
+
readonly id?: string | null;
|
|
38
|
+
readonly domain?: string | null;
|
|
39
|
+
}
|
|
40
|
+
export interface DiscoveryCatalogPayload extends DiscoveryExecutionBoundary {
|
|
41
|
+
readonly schemaVersion: typeof DISCOVERY_SCHEMA_VERSION;
|
|
42
|
+
readonly command: "descobrir catalogo" | "descobrir pipeline listar";
|
|
43
|
+
readonly success: true;
|
|
44
|
+
readonly mode: "catalog";
|
|
45
|
+
readonly filters: {
|
|
46
|
+
readonly kind: DiscoveryKind | null;
|
|
47
|
+
readonly id: string | null;
|
|
48
|
+
readonly domain: string | null;
|
|
49
|
+
};
|
|
50
|
+
readonly entries: readonly DiscoveryEntry[];
|
|
51
|
+
}
|
|
52
|
+
export interface DiscoveryRecommendation {
|
|
53
|
+
readonly rank: number;
|
|
54
|
+
readonly id: string;
|
|
55
|
+
readonly kind: DiscoveryKind;
|
|
56
|
+
readonly label: string;
|
|
57
|
+
readonly score: number;
|
|
58
|
+
readonly matchedSignals: readonly string[];
|
|
59
|
+
readonly reasons: readonly string[];
|
|
60
|
+
readonly missingInputs: readonly string[];
|
|
61
|
+
readonly suggestedCommandTemplate: string | null;
|
|
62
|
+
}
|
|
63
|
+
export interface DiscoveryAmbiguity {
|
|
64
|
+
readonly detected: boolean;
|
|
65
|
+
readonly delta: number | null;
|
|
66
|
+
readonly candidates: readonly string[];
|
|
67
|
+
}
|
|
68
|
+
export interface DiscoveryRecommendationPayload extends DiscoveryExecutionBoundary {
|
|
69
|
+
readonly schemaVersion: typeof DISCOVERY_SCHEMA_VERSION;
|
|
70
|
+
readonly command: "descobrir recomendar";
|
|
71
|
+
readonly success: true;
|
|
72
|
+
readonly mode: "ranking";
|
|
73
|
+
readonly intent: string;
|
|
74
|
+
readonly recommendations: readonly DiscoveryRecommendation[];
|
|
75
|
+
readonly ambiguity: DiscoveryAmbiguity;
|
|
76
|
+
readonly noMatch: boolean;
|
|
77
|
+
}
|
|
78
|
+
export interface DiscoveryExplainPayload extends DiscoveryExecutionBoundary {
|
|
79
|
+
readonly schemaVersion: typeof DISCOVERY_SCHEMA_VERSION;
|
|
80
|
+
readonly command: "descobrir explicar" | "descobrir pipeline descrever";
|
|
81
|
+
readonly success: true;
|
|
82
|
+
readonly mode: "explain";
|
|
83
|
+
readonly entry: DiscoveryEntry;
|
|
84
|
+
}
|
|
85
|
+
export interface DiscoveryErrorPayload extends DiscoveryExecutionBoundary {
|
|
86
|
+
readonly schemaVersion: typeof DISCOVERY_SCHEMA_VERSION;
|
|
87
|
+
readonly command: "descobrir";
|
|
88
|
+
readonly success: false;
|
|
89
|
+
readonly mode: "error";
|
|
90
|
+
readonly error: {
|
|
91
|
+
readonly code: string;
|
|
92
|
+
readonly message: string;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
export type DiscoveryPayload = DiscoveryCatalogPayload | DiscoveryRecommendationPayload | DiscoveryExplainPayload | DiscoveryErrorPayload;
|
|
96
|
+
export interface DiscoveryCommandResult {
|
|
97
|
+
readonly exitCode: 0 | 2;
|
|
98
|
+
readonly payload: DiscoveryPayload;
|
|
99
|
+
readonly text: string;
|
|
100
|
+
readonly outputFormat: "json" | "text";
|
|
101
|
+
readonly executed: false;
|
|
102
|
+
}
|
|
103
|
+
export interface ResumoDescobertaAgentContext {
|
|
104
|
+
readonly schemaVersion: typeof DISCOVERY_SCHEMA_VERSION;
|
|
105
|
+
readonly command: "sema descobrir catalogo --json";
|
|
106
|
+
readonly kinds: readonly DiscoveryKind[];
|
|
107
|
+
readonly pipelinesPrincipais: readonly {
|
|
108
|
+
readonly id: string;
|
|
109
|
+
readonly label: string;
|
|
110
|
+
readonly command: string;
|
|
111
|
+
}[];
|
|
112
|
+
readonly commands: {
|
|
113
|
+
readonly catalogo: "sema descobrir catalogo --json";
|
|
114
|
+
readonly recomendar: "sema descobrir recomendar --intencao <texto> --json";
|
|
115
|
+
readonly explicar: "sema descobrir explicar <id> --json";
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/** @deprecated Prefira o nome canônico em PT-BR. */
|
|
119
|
+
export type DiscoveryAgentContextSummary = ResumoDescobertaAgentContext;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// SEMA-GOVERNED: sema.produto.descoberta_capacidades
|
|
2
|
+
// Descrição: tipos públicos e fronteira sem efeitos da descoberta de capacidades.
|
|
3
|
+
export const DISCOVERY_SCHEMA_VERSION = "sema.discovery/v1";
|
|
4
|
+
export const DISCOVERY_KINDS = [
|
|
5
|
+
"GOVERNANCE_FLOW",
|
|
6
|
+
"PROFILE_GATE",
|
|
7
|
+
"SPECIALIZED_WORKFLOW",
|
|
8
|
+
"ORCHESTRATION_PIPELINE",
|
|
9
|
+
"CAPABILITY_TOKEN",
|
|
10
|
+
"GENERATOR",
|
|
11
|
+
"ADAPTER",
|
|
12
|
+
];
|
|
13
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
// SEMA-GOVERNED
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// Descri??o: detec??o de comandos externos usados por doctor, testes gerados e runners opcionais.
|
|
1
|
+
// SEMA-GOVERNED: sema.produto.cli_toolchain_local
|
|
2
|
+
// Contrato: contratos/sema/cli_toolchain_local.sema
|
|
3
|
+
// Descrição: detecção de comandos externos usados por doctor, testes gerados e runners opcionais.
|
|
5
4
|
import { spawnSync } from "node:child_process";
|
|
6
5
|
import { createRequire } from "node:module";
|
|
7
6
|
const requireRuntimeCli = createRequire(import.meta.url);
|
|
@@ -16,14 +15,29 @@ function resolverImportadorNodeOpcional(especificador) {
|
|
|
16
15
|
export const TSX_IMPORTADOR_CLI = resolverImportadorNodeOpcional("tsx");
|
|
17
16
|
export const TSX_EXECUTOR_CLI = resolverImportadorNodeOpcional("tsx/cli");
|
|
18
17
|
const TIMEOUT_CHECAGEM_COMANDO_MS = 5_000;
|
|
18
|
+
const disponibilidadeComandosNoProcesso = new Map();
|
|
19
19
|
export function comandoDisponivel(comando, argumentos = ["--version"]) {
|
|
20
|
+
const chaveSondagem = JSON.stringify({
|
|
21
|
+
comando,
|
|
22
|
+
argumentos,
|
|
23
|
+
cwd: process.cwd(),
|
|
24
|
+
path: process.env.PATH ?? "",
|
|
25
|
+
pathExt: process.env.PATHEXT ?? "",
|
|
26
|
+
comSpec: process.env.COMSPEC ?? "",
|
|
27
|
+
});
|
|
28
|
+
const resultadoMemorizado = disponibilidadeComandosNoProcesso.get(chaveSondagem);
|
|
29
|
+
if (resultadoMemorizado !== undefined) {
|
|
30
|
+
return resultadoMemorizado;
|
|
31
|
+
}
|
|
20
32
|
const execucao = spawnSync(comando, argumentos, {
|
|
21
33
|
stdio: "ignore",
|
|
22
34
|
shell: process.platform === "win32",
|
|
23
35
|
timeout: TIMEOUT_CHECAGEM_COMANDO_MS,
|
|
24
36
|
windowsHide: true,
|
|
25
37
|
});
|
|
26
|
-
|
|
38
|
+
const disponivel = !execucao.error && execucao.signal === null && (execucao.status ?? 1) === 0;
|
|
39
|
+
disponibilidadeComandosNoProcesso.set(chaveSondagem, disponivel);
|
|
40
|
+
return disponivel;
|
|
27
41
|
}
|
|
28
42
|
export function resolverExecucaoPython() {
|
|
29
43
|
if (comandoDisponivel("python")) {
|
package/dist/exemplosOficiais.js
CHANGED
|
@@ -6,6 +6,32 @@ import { fileURLToPath } from "node:url";
|
|
|
6
6
|
import { caminhoEhDiretorio } from "./fsGovernado.js";
|
|
7
7
|
import { escreverArquivoWorkspaceSeguro, validarDestinosEscritaWorkspace, } from "./workspaceWrite.js";
|
|
8
8
|
const DIRETORIO_CLI_ATUAL = path.dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const EXTENSOES_EXEMPLOS_OFICIAIS = new Set([".sema", ".json", ".md"]);
|
|
10
|
+
async function listarArquivosExemplosOficiais(origem, diretorioAtual = origem) {
|
|
11
|
+
const arquivos = [];
|
|
12
|
+
const entradas = await readdir(diretorioAtual, { withFileTypes: true });
|
|
13
|
+
for (const entrada of entradas) {
|
|
14
|
+
const origemArquivo = path.join(diretorioAtual, entrada.name);
|
|
15
|
+
const relativoOrigem = path.relative(origem, origemArquivo);
|
|
16
|
+
if (entrada.isSymbolicLink()) {
|
|
17
|
+
throw new Error(`Exemplo oficial nao pode atravessar symlink ou junction: ${relativoOrigem}`);
|
|
18
|
+
}
|
|
19
|
+
if (entrada.isDirectory()) {
|
|
20
|
+
arquivos.push(...await listarArquivosExemplosOficiais(origem, origemArquivo));
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
if (!entrada.isFile() ||
|
|
24
|
+
!EXTENSOES_EXEMPLOS_OFICIAIS.has(path.extname(entrada.name).toLowerCase())) {
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
arquivos.push({
|
|
28
|
+
nome: relativoOrigem,
|
|
29
|
+
origemArquivo,
|
|
30
|
+
caminhoRelativo: path.join("exemplos", relativoOrigem),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return arquivos;
|
|
34
|
+
}
|
|
9
35
|
export async function localizarDiretorioExemplosOficiais() {
|
|
10
36
|
const candidatos = [
|
|
11
37
|
path.resolve(DIRETORIO_CLI_ATUAL, "..", "exemplos"),
|
|
@@ -23,16 +49,11 @@ export async function planejarExemplosOficiais() {
|
|
|
23
49
|
if (!origem) {
|
|
24
50
|
return { origem: undefined, arquivos: [] };
|
|
25
51
|
}
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
.sort((a, b) => a.name.localeCompare(b.name, "pt-BR"));
|
|
52
|
+
const arquivos = await listarArquivosExemplosOficiais(origem);
|
|
53
|
+
arquivos.sort((a, b) => a.caminhoRelativo.localeCompare(b.caminhoRelativo, "pt-BR"));
|
|
29
54
|
return {
|
|
30
55
|
origem,
|
|
31
|
-
arquivos
|
|
32
|
-
nome: entrada.name,
|
|
33
|
-
origemArquivo: path.join(origem, entrada.name),
|
|
34
|
-
caminhoRelativo: path.join("exemplos", entrada.name),
|
|
35
|
-
})),
|
|
56
|
+
arquivos,
|
|
36
57
|
};
|
|
37
58
|
}
|
|
38
59
|
export async function materializarExemplosOficiais(baseProjeto = process.cwd(), preservarExistentes = true) {
|
package/dist/iaPrompts.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ export declare const PROMPT_BASE_IA = "Voce esta trabalhando com Sema, um contra
|
|
|
3
3
|
export declare const PROMPT_IA_UI = "Atue como Engenheiro de Software Senior e UX/UI Designer de elite.\n\nQuero que voce trabalhe com Sema como fonte de verdade semantica do sistema e com React + TypeScript como camada de interface.\n\nEntregue obrigatoriamente duas partes integradas:\n1. os arquivos `.sema` do dominio\n2. a proposta ou implementacao da interface em React + TypeScript\n\nRegras:\n- nao entregue apenas HTML solto em arquivo unico\n- nao trate a Sema como enfeite conceitual\n- a interface deve nascer do contrato semantico definido em Sema\n- use os exemplos oficiais da Sema como referencia de estilo e semantica\n- nao invente sintaxe fora da gramatica suportada\n\nA Sema deve modelar, quando fizer sentido:\n- `module`\n- `use`\n- `entity`\n- `enum`\n- `state`\n- `task`\n- `flow`\n- `route`\n- `effects`\n- `error`\n- `guarantees`\n- `tests`\n- `docs`\n\nA interface deve refletir visualmente:\n- `state` como status e progresso observavel\n- `flow` como etapas ou orquestracao visivel\n- `error` como falhas tratadas com clareza\n- `effects` como operacoes relevantes para usuario ou operacao\n- `guarantees` como confianca, confirmacao ou consistencia final\n\nEstruture a entrega assim:\n1. visao do produto\n2. dominio modelado em Sema\n3. arquitetura de pastas em React + TypeScript\n4. componentes principais\n5. estrategia visual\n6. codigo principal da interface\n7. explicacao curta de como a UI conversa com a semantica da Sema\n\nSe a tarefa envolver app visual, a Sema governa o significado e o React renderiza a experiencia. Nao atropele essa separacao.\n";
|
|
4
4
|
export declare const PROMPT_IA_REACT = "Crie uma solucao com Sema + React + TypeScript.\n\nRegras principais:\n- a Sema deve ser a fonte de verdade semantica do dominio\n- React + TypeScript deve ser a camada de interface e experiencia\n- nao entregue HTML unico solto\n- nao trate a Sema como enfeite\n\nEntregue obrigatoriamente:\n1. arquivos `.sema` do dominio\n2. arquitetura de pastas do frontend\n3. componentes React principais\n4. contratos e tipos derivados da semantica\n5. interface elegante e implementavel\n\nA modelagem Sema deve cobrir, quando fizer sentido:\n- `entity`\n- `enum`\n- `state`\n- `task`\n- `flow`\n- `route`\n- `effects`\n- `error`\n- `guarantees`\n- `tests`\n\nA interface React deve tornar visiveis:\n- estado atual e transicoes relevantes\n- fluxo operacional\n- erros publicos\n- efeitos operacionais importantes\n- garantias ou confirmacoes finais\n\nEstruture a entrega assim:\n1. visao do produto\n2. arquivos `.sema`\n3. arquitetura React + TypeScript\n4. componentes e telas\n5. codigo principal\n6. explicacao de como a UI deriva da semantica da Sema\n\nSe houver duvida, siga os exemplos oficiais e mantenha a separacao:\n- Sema governa o significado\n- React governa a apresentacao\n";
|
|
5
5
|
export declare const PROMPT_IA_SEMA_PRIMEIRO = "Quero que voce trabalhe no modo \"Sema primeiro\".\n\nRegra principal:\n- modele primeiro o dominio em arquivos `.sema`\n- se a intencao mudar, crie, edite ou remova o contrato antes de qualquer acao operacional\n- so depois proponha ou gere codigo de aplicacao derivado disso\n\nFluxo obrigatorio:\n1. entender o dominio pedido\n2. modelar o contrato em Sema\n3. validar coerencia entre `task`, `route`, `state`, `flow`, `error`, `effects` e `guarantees`\n4. so depois gerar TypeScript, Python, React ou outra camada de implementacao\n\nNao entregue apenas codigo de interface ou codigo imperativo direto sem antes entregar a camada semantica.\n\nA modelagem em Sema deve:\n- preservar a intencao do dominio\n- explicitar entradas, saidas, erros, efeitos e garantias\n- usar apenas blocos e sintaxe oficiais\n- incluir testes embutidos quando fizer sentido\n\nSe houver interface grafica:\n- entregue a modelagem Sema primeiro\n- depois explique como a interface deve refletir a semantica\n- se gerar UI, use React + TypeScript em vez de HTML unico solto\n\nSe houver backend:\n- entregue a modelagem Sema primeiro\n- depois gere a borda publica e a implementacao derivada\n\nNao pule a etapa semantica. A camada `.sema` e a ancora principal da solucao.\n";
|
|
6
|
-
export declare const EXEMPLOS_PROMPT_IA = "Exemplos de prompt oficial para trabalhar com Sema\n\n1. Sema primeiro\n\nCrie uma solucao seguindo a estrategia \"Sema primeiro\".\nEntregue primeiro os arquivos `.sema` do dominio e so depois a implementacao derivada.\nNao entregue apenas codigo imperativo.\nUse Sema como fonte de verdade para contratos, estados, erros, efeitos e garantias.\n\n2. Sema + React + TypeScript\n\nCrie um projeto com Sema + React + TypeScript.\nEntregue:\n- os arquivos `.sema` do dominio\n- a arquitetura de pastas do frontend\n- componentes React que reflitam `state`, `flow`, `error`, `effects` e `guarantees`\n- uma interface elegante e implementavel\n- nao entregue HTML solto em arquivo unico\n\n3. Revisar ou corrigir um modulo Sema\n\nRevise e corrija um modulo `.sema`.\nAntes de editar:\n- leia os exemplos oficiais parecidos\n- consulte AST e IR\nDepois de editar:\n- rode `sema formatar`\n- rode `sema validar --json`\n- use `diagnosticos --json` se houver falha\n- feche com `sema verificar`\n\n4. Caso de UI sem perder a semantica\n\nQuero uma interface premium para este dominio, mas a solucao deve continuar ancorada em Sema.\nModele primeiro o dominio em `.sema`.\nDepois proponha uma interface em React + TypeScript que torne visiveis:\n- estado\n- fluxo\n- erros\n- efeitos\n- garantias\nNao transforme isso em um `index.html` solto.\n\nComandos uteis da CLI para esse fluxo:\n- `sema starter-ia`\n- `sema ajuda-ia`\n- `sema resumo <arquivo-ou-pasta>`\n- `sema prompt-curto <arquivo-ou-pasta>`\n- `sema prompt-ia`\n- `sema prompt-ia-ui`\n- `sema prompt-ia-react`\n- `sema prompt-ia-sema-primeiro`\n- `sema contexto-ia <arquivo.sema>`\n";
|
|
6
|
+
export declare const EXEMPLOS_PROMPT_IA = "Exemplos de prompt oficial para trabalhar com Sema\n\n1. Sema primeiro\n\nCrie uma solucao seguindo a estrategia \"Sema primeiro\".\nEntregue primeiro os arquivos `.sema` do dominio e so depois a implementacao derivada.\nNao entregue apenas codigo imperativo.\nUse Sema como fonte de verdade para contratos, estados, erros, efeitos e garantias.\n\n2. Sema + React + TypeScript\n\nCrie um projeto com Sema + React + TypeScript.\nEntregue:\n- os arquivos `.sema` do dominio\n- a arquitetura de pastas do frontend\n- componentes React que reflitam `state`, `flow`, `error`, `effects` e `guarantees`\n- uma interface elegante e implementavel\n- nao entregue HTML solto em arquivo unico\n\n3. Revisar ou corrigir um modulo Sema\n\nRevise e corrija um modulo `.sema`.\nAntes de editar:\n- leia os exemplos oficiais parecidos\n- consulte AST e IR\nDepois de editar:\n- rode `sema formatar`\n- rode `sema validar --json`\n- use `diagnosticos --json` se houver falha\n- feche com `sema verificar`\n\n4. Caso de UI sem perder a semantica\n\nQuero uma interface premium para este dominio, mas a solucao deve continuar ancorada em Sema.\nModele primeiro o dominio em `.sema`.\nDepois proponha uma interface em React + TypeScript que torne visiveis:\n- estado\n- fluxo\n- erros\n- efeitos\n- garantias\nNao transforme isso em um `index.html` solto.\n\nComandos uteis da CLI para esse fluxo:\n- `sema starter-ia`\n- `sema ajuda-ia`\n- `sema descobrir catalogo --json`\n- `sema descobrir recomendar --intencao \"<objetivo>\" --json`\n- `sema interativo pipelines --json`\n- `sema resumo <arquivo-ou-pasta>`\n- `sema prompt-curto <arquivo-ou-pasta>`\n- `sema prompt-ia`\n- `sema prompt-ia-ui`\n- `sema prompt-ia-react`\n- `sema prompt-ia-sema-primeiro`\n- `sema contexto-ia <arquivo.sema>`\n";
|
package/dist/iaPrompts.js
CHANGED
|
@@ -307,6 +307,9 @@ Nao transforme isso em um \`index.html\` solto.
|
|
|
307
307
|
Comandos uteis da CLI para esse fluxo:
|
|
308
308
|
- \`sema starter-ia\`
|
|
309
309
|
- \`sema ajuda-ia\`
|
|
310
|
+
- \`sema descobrir catalogo --json\`
|
|
311
|
+
- \`sema descobrir recomendar --intencao "<objetivo>" --json\`
|
|
312
|
+
- \`sema interativo pipelines --json\`
|
|
310
313
|
- \`sema resumo <arquivo-ou-pasta>\`
|
|
311
314
|
- \`sema prompt-curto <arquivo-ou-pasta>\`
|
|
312
315
|
- \`sema prompt-ia\`
|
package/dist/index.d.ts
CHANGED
|
@@ -5,3 +5,6 @@ export { iniciarProfileAuthor, comandoAuthor, criarAuthorBriefing, revisarCliche
|
|
|
5
5
|
export { validarProfileSemantico } from "./profileCommand.js";
|
|
6
6
|
export { materializarExemplosOficiais } from "./exemplosOficiais.js";
|
|
7
7
|
export { expandirIntencaoSemanticaProfile, sugerirStarterPresetProfile, validarPipelineProfiles, exigirQaCriativoQuandoPublicavel, catalogoDropdownOnboarding } from "./profileOrquestracao.js";
|
|
8
|
+
export * from "./pipelineConteudo/index.js";
|
|
9
|
+
export * from "./sistemasInterativos/index.js";
|
|
10
|
+
export * from "./discovery/index.js";
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// SEMA-GOVERNED: sema.governanca_ia_contexto
|
|
3
3
|
// Descricao: CLI particionada; consulte contratos/sema/governanca_ia_contexto.sema antes de editar.
|
|
4
|
+
import { realpathSync } from "node:fs";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
4
7
|
import { principal } from "./index.part08.js";
|
|
5
8
|
export * from "./index.part01.js";
|
|
6
9
|
export * from "./index.part08.js";
|
|
@@ -8,9 +11,25 @@ export { iniciarProfileAuthor, comandoAuthor, criarAuthorBriefing, revisarCliche
|
|
|
8
11
|
export { validarProfileSemantico } from "./profileCommand.js";
|
|
9
12
|
export { materializarExemplosOficiais } from "./exemplosOficiais.js";
|
|
10
13
|
export { expandirIntencaoSemanticaProfile, sugerirStarterPresetProfile, validarPipelineProfiles, exigirQaCriativoQuandoPublicavel, catalogoDropdownOnboarding } from "./profileOrquestracao.js";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
export * from "./pipelineConteudo/index.js";
|
|
15
|
+
export * from "./sistemasInterativos/index.js";
|
|
16
|
+
export * from "./discovery/index.js";
|
|
17
|
+
function moduloExecutadoDiretamente() {
|
|
18
|
+
if (!process.argv[1]) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
try {
|
|
22
|
+
return realpathSync(process.argv[1]) === realpathSync(fileURLToPath(import.meta.url));
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return path.resolve(process.argv[1]) === path.resolve(fileURLToPath(import.meta.url));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (moduloExecutadoDiretamente()) {
|
|
29
|
+
principal().catch((erro) => {
|
|
30
|
+
console.error("Falha ao executar a CLI da Sema.");
|
|
31
|
+
console.error(erro instanceof Error ? erro.stack ?? erro.message : erro);
|
|
32
|
+
process.exit(1);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
16
35
|
//# sourceMappingURL=index.js.map
|
package/dist/index.part01.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { compilarCodigo, type IrModulo } from "@sema/nucleo";
|
|
|
2
2
|
import { analisarDriftLegado, type OpcoesDriftLegado } from "./drift.js";
|
|
3
3
|
import { type GuiaCapacidadeIaMap } from './agentContextTipos.js';
|
|
4
4
|
import { criarBriefingAgente, resumirDriftPorModulo } from "./index.part03.js";
|
|
5
|
-
export type Comando = "iniciar" | "init" | "dev" | "sync" | "author" | "profile" | "validar" | "ast" | "ir" | "compilar" | "gerar" | "testar" | "diagnosticos" | "verificar" | "inspecionar" | "drift" | "impacto" | "renomear-semantico" | "importar" | "doctor" | "formatar" | "ajuda-ia" | "starter-ia" | "sync-codex" | "instalar-exemplos" | "rule-packs" | "docs-impacto" | "finalizar-mudanca" | "resumo" | "prompt-curto" | "prompt-ia" | "prompt-ia-ui" | "prompt-ia-react" | "prompt-ia-sema-primeiro" | "exemplos-prompt-ia" | "contexto-ia";
|
|
5
|
+
export type Comando = "iniciar" | "init" | "dev" | "sync" | "author" | "profile" | "conteudo" | "interativo" | "descobrir" | "pipeline" | "capabilities" | "validar" | "ast" | "ir" | "compilar" | "gerar" | "testar" | "diagnosticos" | "verificar" | "inspecionar" | "drift" | "impacto" | "renomear-semantico" | "importar" | "doctor" | "formatar" | "ajuda-ia" | "starter-ia" | "sync-codex" | "instalar-exemplos" | "rule-packs" | "docs-impacto" | "finalizar-mudanca" | "resumo" | "prompt-curto" | "prompt-ia" | "prompt-ia-ui" | "prompt-ia-react" | "prompt-ia-sema-primeiro" | "exemplos-prompt-ia" | "contexto-ia";
|
|
6
6
|
export interface ResultadoFormatacaoArquivo {
|
|
7
7
|
caminho: string;
|
|
8
8
|
alterado: boolean;
|
package/dist/index.part01.js
CHANGED
|
@@ -60,13 +60,47 @@ export function ajuda() {
|
|
|
60
60
|
"sema profile validar workflow contratos/sema/workflow_ops.sema --maturidade production --preset webhook --artefato-arquivo workflow.md --json",
|
|
61
61
|
"sema profile validar ops contratos/sema/workflow_ops.sema --maturidade critical --preset deploy --artefato-arquivo runbook.md --json",
|
|
62
62
|
"sema profile validar game contratos/sema/game.sema --maturidade prototype --preset playtest --artefato-arquivo playtest.md --json",
|
|
63
|
+
"sema profile validar simulation contratos/sema/simulation.sema --maturidade production --preset calibration --artefato-arquivo calibration.md --json",
|
|
63
64
|
"sema profile validar redacao contratos/sema/redator.sema --maturidade production --preset seo --artefato-arquivo materia.md --json",
|
|
64
65
|
"sema profile validar propostas contratos/sema/propostas_comerciais.sema --maturidade production --preset score90 --artefato-arquivo proposta.md --json",
|
|
65
66
|
"sema profile validar conversas contratos/sema/conversas.sema --maturidade production --preset vendas --artefato-arquivo conversa.md --json",
|
|
66
67
|
"sema profile capabilities --json",
|
|
67
68
|
"sema rule-packs --profile legal --json",
|
|
68
69
|
"",
|
|
69
|
-
"[5]
|
|
70
|
+
"[5] Descobrir a capacidade ou pipeline certo",
|
|
71
|
+
"sema descobrir catalogo --json",
|
|
72
|
+
"sema descobrir recomendar --intencao \"validar simulador 3D autonomo calibrado\" --json",
|
|
73
|
+
"sema descobrir explicar simulation.calibrate --json",
|
|
74
|
+
"sema pipeline listar --json",
|
|
75
|
+
"sema capabilities --json",
|
|
76
|
+
"",
|
|
77
|
+
"[6] Modelar jogos e simulações em qualquer combinação espacial, visual e de render",
|
|
78
|
+
"sema interativo capabilities --json",
|
|
79
|
+
"sema interativo schema --json",
|
|
80
|
+
"sema interativo pipelines --json",
|
|
81
|
+
"sema interativo adapters --spatial-model THREE_D --render-mode VISUAL --json",
|
|
82
|
+
"sema interativo validar <definition.json> --json",
|
|
83
|
+
"sema interativo planejar <definition.json> --json",
|
|
84
|
+
"sema interativo validar-evidencias <definition.json> [--plano-arquivo <plan.json>] --bundle-arquivo <bundle.json> --json",
|
|
85
|
+
"sema interativo validar-protocolo <adapter-run.json> --json",
|
|
86
|
+
"sema interativo validar-ir <experience-ir.json> --json",
|
|
87
|
+
"sema interativo consultar-ir <experience-ir.json> --semantic-id <id> --json",
|
|
88
|
+
"sema interativo validar-engine-snapshot <snapshot.json> --json",
|
|
89
|
+
"sema interativo validar-temporal <temporal.json> --json",
|
|
90
|
+
"sema interativo validar-autonomia <cycle.json> --json",
|
|
91
|
+
"sema interativo validar-playtest-fuzz <plan.json> --json",
|
|
92
|
+
"sema interativo validar-multiplayer <model.json> --json",
|
|
93
|
+
"sema interativo analisar-portabilidade <plan.json> --json",
|
|
94
|
+
"sema interativo validar-workers <plan.json> --json",
|
|
95
|
+
"",
|
|
96
|
+
"[7] Orquestrar criação de conteúdo por IA",
|
|
97
|
+
"sema conteudo capabilities --json",
|
|
98
|
+
"sema conteudo validar <definition.json> --json",
|
|
99
|
+
"sema conteudo planejar <definition.json> --alvos-arquivo <targets.json> --json",
|
|
100
|
+
"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",
|
|
101
|
+
"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",
|
|
102
|
+
"",
|
|
103
|
+
"[8] Adotar Sema em projeto que ainda não usa",
|
|
70
104
|
"sema importar <fonte> <diretorio> --saida <diretorio> --json",
|
|
71
105
|
"sema formatar <arquivo-ou-pasta>",
|
|
72
106
|
"sema validar <arquivo-ou-pasta> --json",
|
|
@@ -81,6 +115,9 @@ export function ajuda() {
|
|
|
81
115
|
"",
|
|
82
116
|
renderizarSecaoAscii("Comandos principais", [
|
|
83
117
|
"descoberta: sema inspecionar [arquivo-ou-pasta] [--json]",
|
|
118
|
+
"catálogo: sema descobrir <catalogo|recomendar|explicar> [id] [--intencao <objetivo>] [--json]",
|
|
119
|
+
"pipelines: sema pipeline <listar|descrever> [id] [--json]",
|
|
120
|
+
"todas as capacidades: sema capabilities [--json]",
|
|
84
121
|
"auditoria: sema drift <arquivo-ou-pasta> [--escopo <arquivo|modulo|projeto>] [--incluir-worktrees] [--incluir-consumidores-laterais] [--json]",
|
|
85
122
|
"impacto: sema impacto <arquivo-ou-pasta> --alvo <token> [--mudanca <descricao>] [--escopo <arquivo|modulo|projeto>] [--json]",
|
|
86
123
|
"renomeação: sema renomear-semantico <arquivo-ou-pasta> --de <nome-atual> --para <nome-novo> [--escopo <arquivo|modulo|projeto>] [--json]",
|
|
@@ -93,9 +130,11 @@ export function ajuda() {
|
|
|
93
130
|
"verificação final: sema verificar <arquivo-ou-pasta> [--saida <diretorio-base>] [--json]",
|
|
94
131
|
"formatação: sema formatar <arquivo-ou-pasta> [--check] [--json]",
|
|
95
132
|
"author: sema author <iniciar|validar|briefing|revisar-cliches|validar-narrativa|validar-proibicoes> [arquivo] [--tema-sensivel] [--preset conto|romance|roteiro|lore|campanha] [--saida <arquivo>] [--texto <texto>] [--json]",
|
|
96
|
-
"profile: 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]",
|
|
133
|
+
"profile: 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]",
|
|
97
134
|
"capabilities: sema profile capabilities [--json]",
|
|
98
|
-
"
|
|
135
|
+
"conteúdo: sema conteudo <capabilities|validar|planejar|validar-envelope|registrar|status|projetar> [--trust-root-digest <sha256:...>] [--revocation-digest <sha256:...>] [--expected-head <sha256:...>] [opções] [--json]",
|
|
136
|
+
"interativo: sema interativo <capabilities|schema|pipelines|adapters|validar|planejar|validar-evidencias|status|validar-protocolo|extensões-P0-P2> [opções] [--json]",
|
|
137
|
+
"rule packs: sema rule-packs [--profile <author|software|workflow|ops|game|simulation|legal|research|redacao|propostas|conversas>] [--json]",
|
|
99
138
|
]),
|
|
100
139
|
"",
|
|
101
140
|
renderizarSecaoAscii("Ajuda IA-first", [
|
|
@@ -119,6 +158,11 @@ export function ajuda() {
|
|
|
119
158
|
"sema author validar-proibicoes <arquivo.sema> [--texto <texto>|--texto-arquivo <arquivo>] [--json]",
|
|
120
159
|
"sema profile validar <profile> <arquivo.sema> [--maturidade draft|prototype|production|critical] [--preset <preset>] [--artefato <texto>|--artefato-arquivo <arquivo>] [--json]",
|
|
121
160
|
"sema profile capabilities [--json]",
|
|
161
|
+
"sema descobrir <catalogo|recomendar|explicar> [id] [--intencao <objetivo>] [--json]",
|
|
162
|
+
"sema pipeline <listar|descrever> [id] [--json]",
|
|
163
|
+
"sema capabilities [--json]",
|
|
164
|
+
"sema interativo <capabilities|schema|pipelines|adapters|validar|planejar|validar-evidencias|status|validar-protocolo|extensões-P0-P2> [opções] [--json]",
|
|
165
|
+
"sema conteudo <capabilities|validar|planejar|validar-envelope|registrar|status|projetar> [--trust-root-digest <sha256:...>] [--revocation-digest <sha256:...>] [--expected-head <sha256:...>] [opções] [--json]",
|
|
122
166
|
"sema rule-packs [--profile <profile>] [--json]",
|
|
123
167
|
]),
|
|
124
168
|
"",
|
package/dist/index.part06.js
CHANGED
|
@@ -203,6 +203,9 @@ export async function comandoAjudaIa() {
|
|
|
203
203
|
console.log("");
|
|
204
204
|
console.log(renderizarSecaoAscii("Fluxo recomendado", [
|
|
205
205
|
"Use `sema starter-ia` para um texto curto de onboarding.",
|
|
206
|
+
"Use `sema descobrir recomendar --intencao <objetivo> --json` quando ainda não souber qual profile, workflow, pipeline, gerador ou adaptador usar.",
|
|
207
|
+
"Use `sema descobrir catalogo --json` ou `sema capabilities --json` para expor o mapa completo de capacidades à IA.",
|
|
208
|
+
"Use `sema interativo pipelines --json` para jogos, simulações e híbridos 3D, 2D, retro, texto, XR ou headless.",
|
|
206
209
|
"Use `sema sync-codex` para regenerar o contexto governado do Codex na raiz.",
|
|
207
210
|
"Use `sema instalar-exemplos` para materializar `exemplos/` oficiais sem sobrescrever arquivos locais.",
|
|
208
211
|
"Use `sema resumo <arquivo> --micro --para onboarding --json` para IA fraca; o resumo vem no stdout.",
|
|
@@ -77,14 +77,15 @@ Antes de alterar codigo, contrato ou documentacao:
|
|
|
77
77
|
3. rode \`sema resumo\`;
|
|
78
78
|
4. rode \`sema docs-impacto --intencao "<acao>" --json\`;
|
|
79
79
|
5. leia \`docs/commands.md\` antes de escolher comando ou interpretar \`--saida\`;
|
|
80
|
-
6. use \`
|
|
80
|
+
6. use \`sema descobrir recomendar --intencao "<objetivo>" --json\` quando não souber qual capacidade ou pipeline aplicar;
|
|
81
|
+
7. use \`exemplos/\` e \`docs/syntax.md\` antes de criar ou corrigir \`.sema\`.
|
|
81
82
|
|
|
82
83
|
## Estrutura criada
|
|
83
84
|
|
|
84
85
|
- \`contratos/\`: contratos semanticamente governados.
|
|
85
86
|
- \`AGENTS.md\`: entrypoint oficial do Codex.
|
|
86
87
|
- \`exemplos/\`: exemplos oficiais da DSL Sema.
|
|
87
|
-
- \`docs/commands.md\`: catalogo de comandos, gates e regra de \`--saida\`.
|
|
88
|
+
- \`docs/commands.md\`: catalogo de comandos, pipelines, gates e regra de \`--saida\`.
|
|
88
89
|
- \`docs/syntax.md\`: referencia curta para escrever \`.sema\`.
|
|
89
90
|
- \`docs/ai-workflow.md\`: fluxo minimo para agentes.
|
|
90
91
|
- \`SEMA_BOOT.md\`, \`SEMA_SMALL_MODEL.md\`, \`AGENT_CONTEXT_PACK.json\` e \`SEMA_INDEX.json\`: contexto IA-first.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { AdaptadorConteudo, AlvoConteudo, ArtefatoConteudo, MetadataPublicaConteudo, RestricaoDeterministicaConteudo } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Vocabulário inicial para definições usuais. O validador aceita qualquer
|
|
4
|
+
* capability opaca não vazia; esta lista não é uma whitelist.
|
|
5
|
+
*/
|
|
6
|
+
export declare const CAPABILITIES_CONTEUDO_PADRAO: readonly ["content.topic.plan", "content.research.collect", "content.master.compose", "content.target.adapt", "content.qa.deterministic", "content.qa.semantic", "content.target.deliver", "content.target.confirm"];
|
|
7
|
+
export declare const CONSTRAINTS_DETERMINISTICAS_SUPORTADAS: readonly ["artifact.bytes.min", "artifact.bytes.max", "media.duration.min", "media.duration.max", "text.length.min", "text.length.max"];
|
|
8
|
+
export interface ObservacoesDeterministicasArtefatoConteudo {
|
|
9
|
+
/** Media type observado por sniffing/verificador independente. */
|
|
10
|
+
readonly observedMediaType?: string;
|
|
11
|
+
/** Tamanho materializado do artefato, em bytes. */
|
|
12
|
+
readonly artifactBytes?: number;
|
|
13
|
+
/** Duração observada da mídia, em segundos. */
|
|
14
|
+
readonly mediaDuration?: number;
|
|
15
|
+
/** Comprimento textual observado, em pontos de código Unicode. */
|
|
16
|
+
readonly textLength?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface ResultadoConstraintDeterministicaConteudo {
|
|
19
|
+
readonly constraintId: string;
|
|
20
|
+
readonly kind: string;
|
|
21
|
+
readonly observed: number | null;
|
|
22
|
+
readonly limit: number | null;
|
|
23
|
+
readonly passed: boolean;
|
|
24
|
+
readonly bloqueios: readonly string[];
|
|
25
|
+
}
|
|
26
|
+
export interface ResultadoAvaliacaoConstraintsConteudo {
|
|
27
|
+
readonly valido: boolean;
|
|
28
|
+
readonly artifactDigest: string;
|
|
29
|
+
readonly constraintsDigest: string;
|
|
30
|
+
readonly resultsDigest: string;
|
|
31
|
+
readonly resultados: readonly ResultadoConstraintDeterministicaConteudo[];
|
|
32
|
+
readonly bloqueios: readonly string[];
|
|
33
|
+
}
|
|
34
|
+
export interface ResultadoValidacaoAdaptadorConteudo {
|
|
35
|
+
readonly valido: boolean;
|
|
36
|
+
readonly bloqueios: readonly string[];
|
|
37
|
+
}
|
|
38
|
+
export interface PlanoAdaptacaoConteudo {
|
|
39
|
+
readonly targetId: string;
|
|
40
|
+
readonly adapterId: string;
|
|
41
|
+
readonly adapterVersion: string;
|
|
42
|
+
readonly accountScope: string;
|
|
43
|
+
readonly isolationKey: string;
|
|
44
|
+
readonly formatProfileId: string;
|
|
45
|
+
readonly locale: string;
|
|
46
|
+
readonly capabilities: readonly string[];
|
|
47
|
+
readonly acceptedMediaTypes: readonly string[];
|
|
48
|
+
readonly deterministicConstraints: readonly RestricaoDeterministicaConteudo[];
|
|
49
|
+
readonly requiredMetadata: readonly string[];
|
|
50
|
+
readonly optionalMetadata: readonly string[];
|
|
51
|
+
readonly confirmationPredicates: readonly string[];
|
|
52
|
+
readonly metadata: MetadataPublicaConteudo;
|
|
53
|
+
readonly masterArtifacts: readonly unknown[];
|
|
54
|
+
}
|
|
55
|
+
export interface BloqueioAlvoConteudo {
|
|
56
|
+
readonly targetId: string;
|
|
57
|
+
readonly codigo: string;
|
|
58
|
+
}
|
|
59
|
+
export interface ResultadoPlanejamentoAlvosConteudo {
|
|
60
|
+
readonly planosAdaptacao: readonly PlanoAdaptacaoConteudo[];
|
|
61
|
+
readonly bloqueiosPorAlvo: readonly BloqueioAlvoConteudo[];
|
|
62
|
+
}
|
|
63
|
+
export declare function validarReferenciaAccountScopeConteudo(valor: unknown): readonly string[];
|
|
64
|
+
/** Metadata de target e publica no plano/ledger/projecao; segredos sao sempre externos. */
|
|
65
|
+
export declare function validarMetadataPublicaConteudo(valor: unknown): readonly string[];
|
|
66
|
+
/**
|
|
67
|
+
* Escopo exato e injetivo para autorização target-bound. Alterar execução,
|
|
68
|
+
* target ou conta sempre altera o escopo.
|
|
69
|
+
*/
|
|
70
|
+
export declare function escopoAutorizacaoAlvo(runId: string, alvo: AlvoConteudo): string;
|
|
71
|
+
export declare function escopoAutorizacaoGlobal(runId: string): string;
|
|
72
|
+
/**
|
|
73
|
+
* Avalia somente medições fornecidas. Não lê arquivos, não chama ferramentas e
|
|
74
|
+
* nunca trata um kind desconhecido como aprovação implícita.
|
|
75
|
+
*/
|
|
76
|
+
export declare function avaliarConstraintsDeterministicasConteudo(artefato: ArtefatoConteudo, constraints: readonly RestricaoDeterministicaConteudo[], observacoes?: ObservacoesDeterministicasArtefatoConteudo): ResultadoAvaliacaoConstraintsConteudo;
|
|
77
|
+
/** Valida somente propriedades declarativas; nenhuma capability é executada. */
|
|
78
|
+
export declare function validarAdaptadorConteudo(adapter: AdaptadorConteudo): ResultadoValidacaoAdaptadorConteudo;
|
|
79
|
+
/**
|
|
80
|
+
* Materializa um plano isolado por targetId/accountScope. Os planos carregam
|
|
81
|
+
* instruções e referências; credenciais e chamadas de ferramenta ficam no
|
|
82
|
+
* runner externo.
|
|
83
|
+
*/
|
|
84
|
+
export declare function planejarAlvosConteudo(alvos: readonly AlvoConteudo[], adapters: readonly AdaptadorConteudo[], artefatosMestre: readonly unknown[]): ResultadoPlanejamentoAlvosConteudo;
|