@stalfh233/omc-cli 0.4.29 → 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/dist/execution-metadata.js +7 -9
- 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));
|
|
@@ -421,22 +421,20 @@ const workflowSave = Object.freeze({
|
|
|
421
421
|
});
|
|
422
422
|
const plainSubmit = Object.freeze({
|
|
423
423
|
id: "plain-data-submit",
|
|
424
|
-
title: "
|
|
425
|
-
status: "
|
|
424
|
+
title: "无流程模型:新建并提交一调完成(COMPLETED,触发 Create 规则)——正式数据的标准路径",
|
|
425
|
+
status: "offline-valid",
|
|
426
426
|
tool: "data.submit",
|
|
427
|
-
args: { environment, schemaCode: model,
|
|
428
|
-
preconditions: ["
|
|
429
|
-
conditionalRequirements: ["
|
|
430
|
-
priorToolReferences: [
|
|
431
|
-
{ tool: "data.save", args: { environment, schemaCode: model, formData: { name: "recipe draft" } }, purpose: "建 DRAFT 草稿并读回 bizObjectId(其 draftRuleHint 会指回本链)" },
|
|
432
|
-
],
|
|
427
|
+
args: { environment, schemaCode: model, formData: { name: "正式记录" } },
|
|
428
|
+
preconditions: ["模型无已发布流程(有流程走 workflow-backed-data-submit)", "模型+表单已发布"],
|
|
429
|
+
conditionalRequirements: ["**不带 bizObjectId 即新建并提交**(工具内部建稿+直提,一次调用 COMPLETED);已有草稿要直提时才带 data.save 读回的 bizObjectId;不要手造 id"],
|
|
430
|
+
priorToolReferences: [],
|
|
433
431
|
dryRun: { supported: true, command: `omc call data.submit --env ${environment} --dry-run --args '<recipe.args>'`, notes: "dry-run 验证参数关系,不推进状态" },
|
|
434
432
|
expectedReadback: { performed: { errcode: 0 }, readback: { sequenceStatus: "COMPLETED" } },
|
|
435
433
|
refusalRecovery: [
|
|
436
434
|
{ code: "submit-biz-object-absent", action: "bizObjectId 在平台无行(304001)——回 data.save 重建草稿后再直提" },
|
|
437
435
|
{ code: "invalid-input", action: "带了 workItemId/workflowInstanceId 时必须同时带 bizObjectId(fail-closed)" },
|
|
438
436
|
],
|
|
439
|
-
notes: "
|
|
437
|
+
notes: "r23 复盘修正:本配方曾教先 save 再 submit 两步——正确路径是无 id 一调(业务约定:正式数据一律 data.submit)。Create/Update 规则只在 COMPLETED 分发(DomainServiceImpl.java:240-248);规则效果以提交读回/data.load 为准。data.save 定位=草稿/暂存",
|
|
440
438
|
requiresEnvironmentDerivedIds: true,
|
|
441
439
|
});
|
|
442
440
|
const workflowSubmit = Object.freeze({
|
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",
|