@stalfh233/omc-cli 0.4.30 → 0.4.31
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/dist/cli.js +11 -3
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -791,7 +791,12 @@ function cmdIntentValidate(file, transport, showIntent = false) {
|
|
|
791
791
|
return emitResult({ status: "ok", valid: true, errors: [], digest: intentDigest(read.intent), ...(warnings.length > 0 ? { warnings } : {}), ...(showIntent ? { intent: read.intent } : {}) }, transport);
|
|
792
792
|
}
|
|
793
793
|
/** Round 16b — `omc intent schema [--example <id>]`: the offline DSL discovery face. */
|
|
794
|
-
function cmdIntentSchema(transport, example) {
|
|
794
|
+
function cmdIntentSchema(transport, example, exampleRequested) {
|
|
795
|
+
// r25 finding: `intent schema --example` with NO id was a commander argument
|
|
796
|
+
// error, while `describe <tool> --example` lists available ids — align: no
|
|
797
|
+
// id lists the runnable ids.
|
|
798
|
+
if (example === undefined && exampleRequested === true)
|
|
799
|
+
return emitResult({ status: "ok", found: false, available: intentExampleIds(), next: intentExampleIds()[0] !== undefined ? `omc intent schema --example ${intentExampleIds()[0]}` : undefined }, transport);
|
|
795
800
|
if (example !== undefined) {
|
|
796
801
|
const found = intentExample(example);
|
|
797
802
|
if (!found)
|
|
@@ -1113,7 +1118,10 @@ async function cmdIntentApply(planPath, options, transport) {
|
|
|
1113
1118
|
const toolCounts = new Map();
|
|
1114
1119
|
for (const change of plan.changes)
|
|
1115
1120
|
toolCounts.set(change.tool, (toolCounts.get(change.tool) ?? 0) + 1);
|
|
1116
|
-
|
|
1121
|
+
// r25 finding: this hint taught `intent apply <planId>` — apply only
|
|
1122
|
+
// accepts a plan FILE / JSON / the source YAML (planId is a hash for
|
|
1123
|
+
// reference, not an apply input). Point at the real re-entry.
|
|
1124
|
+
console.error(`intent apply <意图.yaml> --env ${plan.environment} --dry-run:${plan.changes.length} 项变更预览,零环境写入(apply 收文件/YAML,不收 planId)`);
|
|
1117
1125
|
return emit({
|
|
1118
1126
|
status: "dry-run",
|
|
1119
1127
|
wouldChange: plan.changes.length > 0,
|
|
@@ -1445,7 +1453,7 @@ async function main() {
|
|
|
1445
1453
|
commandExitCode = await withTransport(options, request, (transport) => cmdCapability(id, transport, options.executable === true));
|
|
1446
1454
|
});
|
|
1447
1455
|
const intentCommand = command.command("intent");
|
|
1448
|
-
intentCommand.command("schema").option("--example
|
|
1456
|
+
intentCommand.command("schema").option("--example [id]").action((options) => { commandExitCode = cmdIntentSchema({ request, maxOutputBytes: CLI_DEFAULT_OUTPUT_BYTES }, typeof options.example === "string" ? options.example : undefined, options.example !== undefined); });
|
|
1449
1457
|
intentCommand.command("validate <file>").option("--show-intent").action((file, options) => { commandExitCode = cmdIntentValidate(file, { request, maxOutputBytes: CLI_DEFAULT_OUTPUT_BYTES }, options.showIntent === true); });
|
|
1450
1458
|
intentCommand.command("plan <file>").option("--env <environment>").option("--plan-out <file>").option("--max-output-bytes <bytes>").action(async (file, options) => {
|
|
1451
1459
|
commandExitCode = await withTransport(options, request, (transport) => cmdIntentPlan(file, options.env, options.planOut, transport));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stalfh233/omc-cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.31",
|
|
4
4
|
"description": "CloudPivot 8.6 configuration capability CLI — governed, fail-closed, coverage-manifest bounded.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"commander": "14.0.3",
|
|
54
|
-
"omc-core": "0.4.
|
|
54
|
+
"omc-core": "0.4.31",
|
|
55
55
|
"proper-lockfile": "4.1.2",
|
|
56
56
|
"write-file-atomic": "6.0.0",
|
|
57
57
|
"zod": "^3.23.8",
|