@stalfh233/omc-cli 0.4.65 → 0.4.67
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 +20 -3
- package/package.json +3 -3
- package/skills/omc-business-configuration.md +2 -0
package/dist/cli.js
CHANGED
|
@@ -14,7 +14,7 @@ import { readArgsFile, readStdinArgs, runToolCall, validateAgentPaths } from "./
|
|
|
14
14
|
import { environmentWritable, requiresProductionConfirmation } from "./environment-policy.js";
|
|
15
15
|
import { CLI_EXIT_CODES, classifyResult, envelope, errorEnvelope, requestId } from "./cli-contract.js";
|
|
16
16
|
import { configureOutput, humanSummary, stripOutputFlags, writeEnvelope } from "./cli-output.js";
|
|
17
|
-
import { beginUsage, completeUsage, usageReport } from "./usage-log.js";
|
|
17
|
+
import { beginUsage, completeUsage, recordUsageOutput, usageReport } from "./usage-log.js";
|
|
18
18
|
import { artifactFetchHint, artifactRoot, boundResult, emitInvalid, emitResult, emitTransportResult, outputBudget, readArtifact, withTransport, } from "./command-transport.js";
|
|
19
19
|
import { CLI_DEFAULT_OUTPUT_BYTES, assertSafeOutputPath } from "./artifacts.js";
|
|
20
20
|
import { resolve } from "node:path";
|
|
@@ -499,9 +499,16 @@ async function cmdArtifactGet(id, transport, options = {}) {
|
|
|
499
499
|
? { status: "ok", artifactId: id, sha256: artifact.sha256, path: options.jq, content: null, pathMiss: true, missedAt: projected.at, available: projected.available, hint: `路径未命中段 "${projected.at}"——available 是该层可用的键/范围;方括号下标(a[0])与点式(a.0)等价` }
|
|
500
500
|
: { status: "ok", artifactId: id, sha256: artifact.sha256, path: options.jq, content: projected.value ?? null }, transport);
|
|
501
501
|
}
|
|
502
|
-
|
|
502
|
+
// r6-onboarding 2026-10-21: 47 artifact fetches, 0 used a projection; the 10
|
|
503
|
+
// large ones (up to 55 KB) pulled whole workflow templates just to read one
|
|
504
|
+
// nested key. Nudge once, in the same response, instead of hoping the hint
|
|
505
|
+
// in `fetch` is noticed.
|
|
506
|
+
const unprojected = artifact.content.length > 8192
|
|
507
|
+
? { hint: `artifact ${Math.round(artifact.content.length / 1024)}KB 已整包返回。只要其中一段时用 --jq '<path>'(或 --summary 看形状、--keys 取顶层键),不要把整包带进上下文。` }
|
|
508
|
+
: {};
|
|
509
|
+
const result = { status: "ok", artifactId: id, sha256: artifact.sha256, content, ...unprojected };
|
|
503
510
|
if (Buffer.byteLength(JSON.stringify(result), "utf8") > transport.maxOutputBytes)
|
|
504
|
-
return emitTransportResult({ status: "ok", artifactId: id, sha256: artifact.sha256, bytes: artifact.content.length, fetch: artifactFetchHint(id) }, transport);
|
|
511
|
+
return emitTransportResult({ status: "ok", artifactId: id, sha256: artifact.sha256, bytes: artifact.content.length, ...unprojected, fetch: artifactFetchHint(id) }, transport);
|
|
505
512
|
return emitTransportResult(result, transport);
|
|
506
513
|
}
|
|
507
514
|
catch (error) {
|
|
@@ -1022,6 +1029,16 @@ async function main() {
|
|
|
1022
1029
|
return;
|
|
1023
1030
|
}
|
|
1024
1031
|
commandExitCode = await runScript(lines, { defaultEnv: options.env, continueOnError: options.continue === true });
|
|
1032
|
+
// `script` emits NDJSON (one envelope per line), so the single-envelope
|
|
1033
|
+
// recorder never ran and usage.jsonl left every batch at its initial
|
|
1034
|
+
// "no-envelope" status — a successful 4-call batch looked like 4 failures
|
|
1035
|
+
// (r6-onboarding 2026-10-21: 9/9 batches mislabelled). Record the batch
|
|
1036
|
+
// outcome so cost accounting and failure rates stay truthful.
|
|
1037
|
+
recordUsageOutput({
|
|
1038
|
+
status: commandExitCode === 0 ? "ok" : "refused",
|
|
1039
|
+
...(commandExitCode === 0 ? {} : { error: { code: "script-batch-failed" } }),
|
|
1040
|
+
script: { lines: lines.length },
|
|
1041
|
+
}, 0);
|
|
1025
1042
|
});
|
|
1026
1043
|
const rollbackCommand = command.command("rollback").description("配置回滚(git-revert 语义):list 列写时间线 / plan 预览恢复(diff+后续写覆盖警告)/ apply 执行恢复——恢复走完整写闸门并记 journal(回滚可再回滚)。接入全部配置写面(workflow/规则/数据规则/视图/表单草稿/在线JS/字典/字段/模型/应用/报表);publish 类生命周期推进不可逆(plan 会说明);journal 与 before 快照为本机边界(不跨机器)");
|
|
1027
1044
|
rollbackCommand.command("list").option("--env <environment>").option("--environment <environment>").option("--target <substr>").option("--tool <name>").option("--limit <n>").action(async (options) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stalfh233/omc-cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.67",
|
|
4
4
|
"description": "CloudPivot 8.6 configuration capability CLI — governed, fail-closed, coverage-manifest bounded.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@stalfh233/omc-fake-platform": "0.4.
|
|
53
|
+
"@stalfh233/omc-fake-platform": "0.4.67",
|
|
54
54
|
"commander": "14.0.3",
|
|
55
|
-
"omc-core": "0.4.
|
|
55
|
+
"omc-core": "0.4.67",
|
|
56
56
|
"proper-lockfile": "4.1.2",
|
|
57
57
|
"write-file-atomic": "6.0.0",
|
|
58
58
|
"zod": "^3.23.8",
|
|
@@ -150,6 +150,8 @@ rules:
|
|
|
150
150
|
|
|
151
151
|
- **两条路**:模型+表单+流程一揽子交付走**意图**(`intent` 的 `workflow` 能力,声明式一次 apply);只动流程或想逐步控制走**低层链** `workflow.create → workflow.update(权限/节点)→ workflow.publish`,标准链配方见 `omc describe workflow.update`(含多级审批/participant 三形态/自动回填说明)。流程权限细节见下节。
|
|
152
152
|
- 一个模型只能有一个流程;已有流程的模型直接 `workflow.update`,不要另建。
|
|
153
|
+
- **清理测试数据用批量删除**:`data.delete --args '{"schemaCode":"<code>","bizObjectIds":["id1","id2"]}'` 一次往返删多条(真机 r6:207 次逐条 `data.delete` 占 13.5% 调用)。
|
|
154
|
+
- **取 artifact 先投影**:`artifact get <id> --summary` 看形状 → `--jq '<path>'` 取那一段;只有确实要整份时才裸取(r6:47 次整包拉取 650KB,0 次用投影)。
|
|
153
155
|
- **核验状态用投影,别重复整条读**:`data.load --args '{"schemaCode":..,"bizObjectId":..,"fields":["sequenceStatus","<业务状态字段>"]}'` 只回指定字段(缺失项在 `missingFields`)——r4 实测同一对象被整条读 74 次;大结果先 `artifact get <id> --summary` → `--keys/--jq`,别整包内联进推理。
|
|
154
156
|
- **流程第一个节点必须是 `{Originator}` 填写节点**:平台 `WorkflowTemplateValidateUtility.validateStartActivity` 对「START 后直接接审批」报 401035「发起节点的参与者只能是{Originator}」,publish 回 errcode 0 但一个 ValidateMessage[] 就把模板挡在门外、不落库(真机 2026-10-21)。OMC 0.4.65 起在 `workflow.update`/`publish` 出门前拒绝(`workflow-first-activity-not-originator`)。
|
|
155
157
|
- **跨模型回写的目标行必须已提交(COMPLETED)**:DRAFT 行不参与目标查询,运行 0 行命中且日志只有「查找范围不存在数据」。单跳关联字段可直接作 DYNAMIC 来源(引擎取关联对象 id);点号路径按子表解析,`关联字段.id` / 两跳路径都不支持。
|