@stalfh233/omc-cli 0.8.28 → 0.8.29
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 +2 -2
- package/dist/intent/capabilities/listview.js +30 -18
- package/dist/intent/compiler.js +1 -1
- package/dist/intent/readback.js +2 -0
- package/dist/lanes/list-view-shapes.js +1 -0
- package/dist/lanes/list-view.js +25 -1
- package/dist/lanes/runtime-data.js +25 -1
- package/dist/lanes/workflow-contract.js +1 -1
- package/dist/lanes/workflow.js +33 -5
- package/dist/read-shapes.js +2 -2
- package/dist/residue.js +11 -3
- package/package.json +3 -3
- package/skills/omc-glossary.md +1 -1
package/dist/cli.js
CHANGED
|
@@ -3817,7 +3817,7 @@ async function main() {
|
|
|
3817
3817
|
commandExitCode = CLI_EXIT_CODES.ok;
|
|
3818
3818
|
});
|
|
3819
3819
|
command.command("doctor").option("--environment <environment>").option("--env <environment>").option("--service <serviceCode>", "可选:体检单个业务集成服务的鉴权参数形状(掩码/占位/全 0 检出,WARN 非致命)").option("--fresh-login", "忽略 token 缓存,做一次完整登录握手(默认复用缓存,登录请求 0 次;回执 loginSource 标明来源)").addOption(new Option("--jq [path]", "--jq 不是 jq,仅路径选择器(与 call --jq 同 DSL;可逗号多路径;裸 --jq 列顶层键),相对回执 result(checks/anchor/unsupportedCapabilities)").argParser((value, previous = []) => [...previous, value]).default([])).option("--explain", "--jq 未命中时给出完整排查载荷(available/correctPath/成因 hint);默认 miss 只回 missedAt/didYouMean/helpRef").action(async (options) => { commandExitCode = await cmdDoctor(new ConfigStore(defaultPaths()), options.environment ?? options.env, options.service, options.freshLogin === true, Array.isArray(options.jq) ? options.jq : [], options.explain === true); });
|
|
3820
|
-
command.command("call <tool>").option("--env <environment>", "环境名;项目白名单按当前 cwd 解析,须在含 .omc-env 的目录内运行").option("--environment <environment>").option("--args <json>").option("--args-file <path>", "从文件读参数 JSON。**必须位于配置根内**(数组批量请改用 --args-list;跨目录/系统临时文件会被拒);免落盘用 `--args -`(stdin)").option("--args-list <json-array>", '同一工具跑 N 次(JSON 数组,每条一个 args 对象,最多 200 条);超过上限请分批,或用 omc script 读文件。逐条执行、默认不中断,最后回 succeeded/failed 汇总。**只回汇总(succeeded/failed + 每行 ok),不内联各条 result**;读批量请用 `omc script -`(逐行带 result)或工具的 schemaCodes/ruleCodes 批参数。适合批量建字段等').option("--preflight", "与 --args-list 一起用:只跑参数校验 + 写前语义闸(零 wire、零写入),一次报全所有形状问题").option("--keys", "与 artifact get 的 --keys 同义(= --extract-keys):列出本次结果 artifact 的顶层键与体积").addOption(new Option("--extract <path>", "在本次结果的 artifact 内取一个路径的值(可重复;省掉一次 artifact get)").argParser((value, previous = []) => [...previous, value]).default([])).addOption(new Option("--jq [path]", "
|
|
3820
|
+
command.command("call <tool>").option("--env <environment>", "环境名;项目白名单按当前 cwd 解析,须在含 .omc-env 的目录内运行").option("--environment <environment>").option("--args <json>").option("--args-file <path>", "从文件读参数 JSON。**必须位于配置根内**(数组批量请改用 --args-list;跨目录/系统临时文件会被拒);免落盘用 `--args -`(stdin)").option("--args-list <json-array>", '同一工具跑 N 次(JSON 数组,每条一个 args 对象,最多 200 条);超过上限请分批,或用 omc script 读文件。逐条执行、默认不中断,最后回 succeeded/failed 汇总。**只回汇总(succeeded/failed + 每行 ok),不内联各条 result**;读批量请用 `omc script -`(逐行带 result)或工具的 schemaCodes/ruleCodes 批参数。适合批量建字段等').option("--preflight", "与 --args-list 一起用:只跑参数校验 + 写前语义闸(零 wire、零写入),一次报全所有形状问题").option("--keys", "与 artifact get 的 --keys 同义(= --extract-keys):列出本次结果 artifact 的顶层键与体积").addOption(new Option("--extract <path>", "在本次结果的 artifact 内取一个路径的值(可重复;省掉一次 artifact get)").argParser((value, previous = []) => [...previous, value]).default([])).addOption(new Option("--jq [path]", "仅路径选择器,不是 jq(不支持 {a,b} 对象构造)——不是 jq 表达式,不支持管道;[] 映射如 items[].fields.planNo;裸 --jq 列顶层键。单路径命中时 result 直接是节点本体。示例:omc call model.list --env e --jq models · omc call rule.list --env e --args '{\"schemaCode\":\"m\"}' --jq rules[].code · omc call workflow.get_published --env e --args '{\"code\":\"f\"}' --jq activities[].bizActions").argParser((value, previous = []) => [...previous, value]).default([])).option("--extract-keys", "列出本次结果 artifact 的顶层键与体积(省掉一次 artifact get --keys)").option("--max-output-bytes <bytes>", "最终 stdout 信封预算;默认 65536(投影/--jq 之后再判);读面 diet(~2048) 独立外置 detailArtifactId,抬高本参数不会把已 diet 的大表重新内联;artifact get 内联上限 8192").option("--request-id <requestId>").option("--reason <text>", "写入原因(审计面,仅写操作):记入本次写 journal 行的 reason;不是工具参数(写 schema 拒未知键),也不参与任何门禁").option("--timeout-ms <milliseconds>").option("--wait <milliseconds>", "仅 `omc call` / `omc intent apply` 支持;写锁冲突时有界排队(0=立刻拒绝)").option("--dry-run").option("--explain", "--jq 未命中时给出完整排查载荷(available 该层全部键、correctPath、nextCommand、成因 hint);默认 miss 只回 missedAt/didYouMean/helpRef(≤300B)").addHelpText("after", `\n${onboardingHelp()}\n`).action(async (tool, options) => {
|
|
3821
3821
|
const rest = [tool, ...(options.env ? ["--env", options.env] : []), ...(options.environment ? ["--environment", options.environment] : []), ...(options.args !== undefined ? ["--args", options.args] : []), ...(options.argsFile !== undefined ? ["--args-file", options.argsFile] : []), ...(options.argsList !== undefined ? ["--args-list", options.argsList] : []), ...(options.preflight ? ["--preflight"] : []), ...(Array.isArray(options.extract) ? options.extract.flatMap((path) => ["--extract", path]) : []), ...(options.jq === true ? ["--jq"] : Array.isArray(options.jq) ? options.jq.flatMap((path) => path === true ? ["--jq"] : ["--jq", path]) : []), ...(options.extractKeys ? ["--extract-keys"] : []),
|
|
3822
3822
|
...(options.keys ? ["--keys"] : []), ...(options.maxOutputBytes !== undefined ? ["--max-output-bytes", options.maxOutputBytes] : []), ...(options.requestId ? ["--request-id", options.requestId] : []), ...(options.reason !== undefined ? ["--reason", options.reason] : []), ...(options.timeoutMs !== undefined ? ["--timeout-ms", options.timeoutMs] : []), ...(options.wait !== undefined ? ["--wait", options.wait] : []), ...(options.dryRun ? ["--dry-run"] : []), ...(options.explain ? ["--explain"] : [])];
|
|
3823
3823
|
commandExitCode = await cmdCall(new ConfigStore(defaultPaths()), rest);
|
|
@@ -4169,7 +4169,7 @@ async function main() {
|
|
|
4169
4169
|
command.command("bench").option("--live-sample").option("--env <environment>").action(async (options) => { commandExitCode = await cmdBench([...(options.liveSample ? ["--live-sample"] : []), ...(options.env ? ["--env", options.env] : [])]); });
|
|
4170
4170
|
command.command("residue <prefix>").description("跨面前缀残留扫描(model 全租户/folder/custompage;默认 deep 再查命中模型的 rule/datarule/onlinejs,**并扫 report 面**(应用树 type=Report,code/name 前缀))——收尾「删净」一次证明;clean/complete 同义(report 已扫)。--no-report 恢复旧的 scanned-faces 口径。清理入口:omc model-purge --code <schemaCode>(按依赖倒序,默认 dry-run)。只读零写入").option("--env <environment>", "环境名(默认按 cwd 的 .omc-env 解析)").option("--apps <codes>", "all(默认,全租户)或逗号分隔应用码").option("--no-deep", "只扫 model/folder/custompage,不深查命中模型").option("--no-report", "不扫 report 面(回退旧口径:complete:false + mandatoryChecks)").option("--all-faces", "列出全部应用×面(含 count:0;默认只回非零面+byFace/userResidues 紧凑形)").option("--max-output-bytes <bytes>").addOption(new Option("--jq [path]", "--jq 不是 jq,仅路径选择器(与 call --jq 同 DSL;可逗号多路径;裸 --jq 列顶层键)").argParser((value, previous = []) => [...previous, value]).default([])).action(async (prefix, options) => { commandExitCode = await withTransport(options, request, (transport) => cmdResidue(prefix, { env: options.env, apps: options.apps, ...(options.deep === false ? { noDeep: true } : {}), ...(options.report === false ? { noReport: true } : {}), ...(options.allFaces ? { allFaces: true } : {}), ...(options.jq !== undefined ? { jq: options.jq } : {}) }, transport)); });
|
|
4171
4171
|
command.command("track <schemaCode> <bizObjectId>").description("读取单条业务数据的行级变更留痕(只读;平台来源枚举含 BUSINESS_RULE 时原样回传)").option("--env <environment>").option("--property-code <code>").option("--max-output-bytes <bytes>").action(async (schemaCode, bizObjectId, options) => { commandExitCode = await withTransport(options, request, (transport) => cmdTrack(schemaCode, bizObjectId, { env: options.env, propertyCode: options.propertyCode }, transport)); });
|
|
4172
|
-
const jqOption = () => new Option("--jq [path]", "
|
|
4172
|
+
const jqOption = () => new Option("--jq [path]", "仅路径选择器,不是 jq(不支持 {a,b} 对象构造)——与 call --jq 同 DSL;可逗号多路径;裸 --jq 列顶层键").argParser((value, previous = []) => [...previous, value]).default([]);
|
|
4173
4173
|
// C6(0.8.4):--jq 的 miss 默认只回结论;排查载荷(available/correctPath/
|
|
4174
4174
|
// 成因 hint)统一由 --explain 开关,call/artifact get/发现面同口径。
|
|
4175
4175
|
const explainOption = () => new Option("--explain", "--jq 未命中时给出完整排查载荷(available 该层全部键、correctPath、nextCommand、成因 hint);默认 miss 只回 missedAt/didYouMean/helpRef");
|
|
@@ -57,9 +57,10 @@ export const listviewCapability = {
|
|
|
57
57
|
if (lvCode !== undefined && !(lvCode.kind === "scalar" && lvCode.value === null) && !isScalarString(lvCode))
|
|
58
58
|
pushError(ctx, "intent-listview-code-invalid", "listview.code 必须是非空字符串或省略(省略即模型默认视图 code=schemaCode)", `${ctx.base}.listview.code`, "value");
|
|
59
59
|
if (lvName !== undefined && !(lvName.kind === "scalar" && lvName.value === null) && !isScalarString(lvName))
|
|
60
|
-
pushError(ctx, "intent-listview-name-invalid", "listview.name
|
|
60
|
+
pushError(ctx, "intent-listview-name-invalid", "listview.name 必须是非空字符串或省略(未声明时:默认视图不碰名(平台默认=模型名);自定义视图 create 用模型名)", `${ctx.base}.listview.name`, "value");
|
|
61
61
|
const resolvedCode = isScalarString(lvCode) ? lvCode.value.trim() : draft.code;
|
|
62
|
-
const
|
|
62
|
+
const nameDeclared = isScalarString(lvName);
|
|
63
|
+
const resolvedName = nameDeclared ? lvName.value : `${draft.name || draft.code}默认视图`;
|
|
63
64
|
if (lvAbsent !== undefined && (lvAbsent.kind !== "scalar" || typeof lvAbsent.value !== "boolean"))
|
|
64
65
|
pushError(ctx, "intent-listview-absent-invalid", "listview.absent 必须是布尔", `${ctx.base}.listview.absent`, "value");
|
|
65
66
|
if (lvAbsent?.kind === "scalar" && lvAbsent.value === true) {
|
|
@@ -73,7 +74,7 @@ export const listviewCapability = {
|
|
|
73
74
|
if (!validFields)
|
|
74
75
|
pushError(ctx, "intent-listview-fieldcodes-invalid", "listview.fieldCodes 必须是非空字符串列表", `${ctx.base}.listview.fieldCodes`, "value");
|
|
75
76
|
if (validFields)
|
|
76
|
-
draft.listview = { code: resolvedCode, name: resolvedName, fieldCodes: lvFields.items.map((item) => item.value.trim()) };
|
|
77
|
+
draft.listview = { code: resolvedCode, name: resolvedName, nameDeclared, fieldCodes: lvFields.items.map((item) => item.value.trim()) };
|
|
77
78
|
},
|
|
78
79
|
async read(session, intent, draft) {
|
|
79
80
|
if (!draft.present || !intent.listview)
|
|
@@ -86,7 +87,7 @@ export const listviewCapability = {
|
|
|
86
87
|
const columns = Array.isArray(view.queryColumns)
|
|
87
88
|
? view.queryColumns.map((column) => String(column.propertyCode ?? "")).filter(Boolean)
|
|
88
89
|
: [];
|
|
89
|
-
draft.listview = { present: true, columns };
|
|
90
|
+
draft.listview = { present: true, columns, ...(typeof view.name === "string" ? { name: view.name } : {}) };
|
|
90
91
|
}
|
|
91
92
|
catch (error) {
|
|
92
93
|
if (error instanceof WireError && error.errcode === 302025)
|
|
@@ -114,22 +115,25 @@ export const listviewCapability = {
|
|
|
114
115
|
const invalidListviewCodes = fieldCodes.filter((code) => !declaredCodes.has(code) && !SYSTEM_FIELD_CODES.has(code));
|
|
115
116
|
if (invalidListviewCodes.length > 0)
|
|
116
117
|
refuse("intent-listview-fieldcodes-unknown", `列表视图 ${listview.code} 声明了模型字段之外的列:${invalidListviewCodes.join("、")}`);
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
//
|
|
120
|
-
//
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
//
|
|
126
|
-
//
|
|
127
|
-
|
|
128
|
-
|
|
118
|
+
// 探针 U F2/F8(0.8.29):同一 plan 新建模型时,**默认视图**(code=schemaCode)
|
|
119
|
+
// 由 model.create 自动生成,不能再 listview.create(会多一个视图);自定义
|
|
120
|
+
// 视图 code 仍需 create(model.create 只建默认视图)。name 通过随后的
|
|
121
|
+
// listview.configure(query/update 可更新 header name)落地。
|
|
122
|
+
const modelIsNew = !baseline.present;
|
|
123
|
+
const isDefaultViewCode = listview.code === intent.code;
|
|
124
|
+
if (!baseline.listview.present && (!modelIsNew || !isDefaultViewCode))
|
|
125
|
+
emit.change("listview.create", { schemaCode: intent.code, name: listview.nameDeclared === true ? listview.name : intent.name, code: listview.code }, resource, "listview-absent");
|
|
126
|
+
// 探针 U F8(0.8.29):平台 query/update 会更新 header name;listview.configure
|
|
127
|
+
// 新增 name 参数即可改名(新建模型的平台默认视图也能改,无需 listview.create)。
|
|
128
|
+
// 只有 YAML 显式声明 name 才纳入(默认 resolvedName 不是用户意图,不能拿它
|
|
129
|
+
// 去改平台默认视图名——M2 复核)。
|
|
130
|
+
if (!baseline.listview.present || fieldCodes.some((code) => !baseline.listview.columns.includes(code)) || baseline.listview.columns.length !== fieldCodes.length || (listview.nameDeclared === true && baseline.listview.name !== listview.name))
|
|
131
|
+
emit.change("listview.configure", { schemaCode: intent.code, code: listview.code, ...(listview.nameDeclared === true ? { name: listview.name } : {}), fieldCodes, replaceColumns: true, hideDefaultSystemFields: true, conditions: [], sorts: [] }, resource, "listview-columns-authoritative");
|
|
129
132
|
},
|
|
130
133
|
decode(baseline, draft) {
|
|
131
134
|
draft.frontend.listviewPresent = baseline.listview.present;
|
|
132
135
|
draft.frontend.listviewColumns = baseline.listview.columns;
|
|
136
|
+
draft.frontend.listviewName = baseline.listview.name ?? null;
|
|
133
137
|
},
|
|
134
138
|
compare(intent, live, emit) {
|
|
135
139
|
const listview = intent.listview;
|
|
@@ -140,9 +144,17 @@ export const listviewCapability = {
|
|
|
140
144
|
emit.difference("listview-present-unexpected", `listview:${listview.code}`, `列表视图 ${listview.code} 声明 absent:true 但仍存在`);
|
|
141
145
|
return;
|
|
142
146
|
}
|
|
143
|
-
if (!live.frontend.listviewPresent)
|
|
147
|
+
if (!live.frontend.listviewPresent) {
|
|
144
148
|
emit.difference("listview-missing", `listview:${listview.code}`, `列表视图 ${listview.code} 不存在`);
|
|
145
|
-
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
if (listview.nameDeclared === true) {
|
|
152
|
+
if (live.frontend.listviewName === undefined || live.frontend.listviewName === null)
|
|
153
|
+
emit.difference("listview-name-unverified", `listview:${listview.code}`, `声明了 listview.name="${listview.name}",但平台读回没有视图名(未投影/未知)——不能报 equivalent;用 listview.get 复核`);
|
|
154
|
+
else if (live.frontend.listviewName !== listview.name)
|
|
155
|
+
emit.difference("listview-name-mismatch", `listview:${listview.code}`, `声明的 listview.name="${listview.name}" 与平台当前名="${live.frontend.listviewName}" 不一致(listview.configure 的 name 未生效?)`);
|
|
156
|
+
}
|
|
157
|
+
if ((listview.fieldCodes ?? []).some((code) => !live.frontend.listviewColumns.includes(code)))
|
|
146
158
|
emit.difference("listview-columns-missing", `listview:${listview.code}`, `列表视图 ${listview.code} 缺少声明列`);
|
|
147
159
|
else {
|
|
148
160
|
// The intent's fieldCodes IS the view; an unexpected SYSTEM column (not
|
package/dist/intent/compiler.js
CHANGED
|
@@ -44,7 +44,7 @@ export function compileIntent(intent, baseline) {
|
|
|
44
44
|
model: model.code,
|
|
45
45
|
publishedFieldCodes: requestedCodes,
|
|
46
46
|
formPublished: wantsForm,
|
|
47
|
-
frontend: { formBoundFieldCodes: wantsForm ? formFieldCodes : [], listviewColumns: model.listview?.fieldCodes ?? [] },
|
|
47
|
+
frontend: { formBoundFieldCodes: wantsForm ? formFieldCodes : [], listviewPresent: false, listviewColumns: model.listview?.fieldCodes ?? [] },
|
|
48
48
|
...(model.rules?.length ? { rules: model.rules.map((rule) => ({ code: rule.code, enabled: rule.enabled })) } : {}),
|
|
49
49
|
...(model.datarules?.some((rule) => rule.absent !== true) ? { datarules: model.datarules.filter((rule) => rule.absent !== true).map((rule) => ({ propertyCode: rule.propertyCode, dataRuleType: rule.dataRuleType })) } : {}),
|
|
50
50
|
...(model.workflow ? { workflow: { code: model.workflow.code, published: model.workflow.publish } } : {}),
|
package/dist/intent/readback.js
CHANGED
|
@@ -31,6 +31,8 @@ const DIFFERENCE_DEFAULTS = {
|
|
|
31
31
|
"form-not-bound": replan("form.draft"),
|
|
32
32
|
"listview-missing": replan("listview.create"),
|
|
33
33
|
"listview-columns-missing": replan("listview.configure"),
|
|
34
|
+
"listview-name-mismatch": replan("listview.configure"),
|
|
35
|
+
"listview-name-unverified": replan("listview.configure"),
|
|
34
36
|
"listview-system-columns-unexpected": escape("listview.configure"),
|
|
35
37
|
"child-field-missing": replan("field.update"),
|
|
36
38
|
"child-field-type-mismatch": escape("field.update"),
|
|
@@ -527,6 +527,7 @@ const LISTVIEW_CONDITION_KEYS = new Set([
|
|
|
527
527
|
* `replaceActions`/`defaultActions` 只是 `actions` 的修饰,单传它们不算改配置。
|
|
528
528
|
*/
|
|
529
529
|
export const LISTVIEW_CONFIGURE_INTENT_KEYS = Object.freeze([
|
|
530
|
+
"name",
|
|
530
531
|
"fieldCodes",
|
|
531
532
|
"hideDefaultSystemFields",
|
|
532
533
|
"sorts",
|
package/dist/lanes/list-view.js
CHANGED
|
@@ -843,6 +843,7 @@ export function registerListViewLane(tools) {
|
|
|
843
843
|
inputSchema: {
|
|
844
844
|
schemaCode: z.string().min(1),
|
|
845
845
|
code: z.string().optional(),
|
|
846
|
+
name: z.string().min(1).optional().describe("视图名;省略=保持原名"),
|
|
846
847
|
fieldCodes: z.array(z.string()).min(1).optional().describe("要展示的字段:可给 propertyCode 或字段显示名(唯一匹配时自动解析,歧义或不存在则拒绝,不静默跳过)。**省略 = 不动列**(只改排序/筛选/动作时可省)。**默认增量**:不传 replaceColumns+hideDefaultSystemFields 会保留平台既有系统列(默认视图 4 个)→ 点名 4 列实际 8 列;要精确列集合两者都传(--dry-run 看 columnBehavior)"),
|
|
847
848
|
hideDefaultSystemFields: z.boolean().optional().describe("是否隐藏平台默认系统列(createdTime/creater/name/sequenceNo 等);平台 update 按提交列集合决定,不能靠 visible:false"),
|
|
848
849
|
replaceColumns: z.boolean().optional().describe("把 fieldCodes 当作列集合的权威全集:未列出的已有列(含系统列)全部移除,最终列 = fieldCodes(按给定顺序)。**必须同时给 fieldCodes**,只传 replaceColumns 会被拒(listview-fieldcodes-required-for-replace)。默认 false 为增量(保留已有列,省略 fieldCodes 时列完全不动)。系统列与业务列一视同仁——想要 createdTime/sequenceNo 就把它写进 fieldCodes"),
|
|
@@ -1027,6 +1028,10 @@ export function registerListViewLane(tools) {
|
|
|
1027
1028
|
// hideDefaultSystemFields:true 才滤掉系统列。
|
|
1028
1029
|
const configuredColumns = filterDefaultSystemColumns(columns, args.hideDefaultSystemFields === true);
|
|
1029
1030
|
const body = { ...model, queryColumns: configuredColumns };
|
|
1031
|
+
// 探针 U F8(0.8.29):query/update 的 header name 可写(ModelManagementFacadeImpl
|
|
1032
|
+
// .updateBizQuery(BizQueryModel) 检测 name 差异后 setName);显式给了才改。
|
|
1033
|
+
if (args.name !== undefined)
|
|
1034
|
+
body.name = args.name;
|
|
1030
1035
|
if (args.presentation !== undefined)
|
|
1031
1036
|
body.queryPresentation = normalizePresentation(args.presentation);
|
|
1032
1037
|
if (args.sorts !== undefined)
|
|
@@ -1198,6 +1203,7 @@ export function registerListViewLane(tools) {
|
|
|
1198
1203
|
}
|
|
1199
1204
|
const after = await wireCall(session, { path: ENDPOINTS.listQueryGet, query: { schemaCode: args.schemaCode, code, clientType: "PC" } });
|
|
1200
1205
|
const afterModel = (after.data ?? {});
|
|
1206
|
+
const storedViewName = typeof afterModel.name === "string" && afterModel.name.length > 0 ? afterModel.name : null;
|
|
1201
1207
|
// r61 a-F14(r60a-F14 真机定性)+ r62a-F5(P0-2):`queryColumns` 列树**不回
|
|
1202
1208
|
// sumType**(投影恒 null),列汇总真值在呈现层 `queryPresentation.columnsJson`
|
|
1203
1209
|
// ——写入面也是它。两面各说各话曾让探针为对账「合计配上了吗」拉全量
|
|
@@ -1216,7 +1222,25 @@ export function registerListViewLane(tools) {
|
|
|
1216
1222
|
const conditions = readArray(afterModel, "queryConditions")
|
|
1217
1223
|
.map(decodeConditionRow)
|
|
1218
1224
|
.sort((a, b) => String(a.propertyCode ?? "").localeCompare(String(b.propertyCode ?? "")));
|
|
1219
|
-
const readback = {
|
|
1225
|
+
const readback = {
|
|
1226
|
+
code,
|
|
1227
|
+
...(storedViewName !== null ? { name: storedViewName } : {}),
|
|
1228
|
+
...(args.name !== undefined && storedViewName !== args.name
|
|
1229
|
+
? {
|
|
1230
|
+
nameMismatch: {
|
|
1231
|
+
kind: "listview-name-mismatch",
|
|
1232
|
+
requested: args.name,
|
|
1233
|
+
stored: storedViewName,
|
|
1234
|
+
message: `请求视图名 "${args.name}",平台读回 "${storedViewName ?? "(未知)"}"——改名未生效或读面未回 name;用 listview.get 复核`,
|
|
1235
|
+
},
|
|
1236
|
+
}
|
|
1237
|
+
: {}),
|
|
1238
|
+
added,
|
|
1239
|
+
updated,
|
|
1240
|
+
columns: afterCols,
|
|
1241
|
+
sorts,
|
|
1242
|
+
conditions,
|
|
1243
|
+
};
|
|
1220
1244
|
// F2(0.8.10 探针 E):平台在建视图时就给默认视图种了 4 个系统列
|
|
1221
1245
|
// name/creater/createdTime/sequenceNo(BizQueryServiceImpl.createDefaultBizQuery
|
|
1222
1246
|
// :209-226),增量 configure(未传 replaceColumns/hideDefaultSystemFields)会
|
|
@@ -3744,6 +3744,30 @@ export function registerRuntimeDataLane(tools) {
|
|
|
3744
3744
|
message: `data.save 的人员字段用了字符串 id:${staffStringSave.map((entry) => `${entry.code}(${entry.got})`).join("、")}——save 面的正确形状是对象数组 [{"id":"<userId>","type":3,"name":"<名>"}](type:3=用户/1=部门;issue#10 实测矩阵:字符串 id 50000、对象数组成功)。读回值 [{id,type,name,…}] 可直接回写。`,
|
|
3745
3745
|
});
|
|
3746
3746
|
}
|
|
3747
|
+
// 探针 U F3(0.8.29):submit:true 在**任何写 wire 之前**判断——模型有已发布
|
|
3748
|
+
// 流程时直提不适用,旧实现先落草稿再回 partial,留下一条需清理的 DRAFT。
|
|
3749
|
+
let submitWorkflowCheck;
|
|
3750
|
+
if (args.submit === true) {
|
|
3751
|
+
submitWorkflowCheck = await resolvePublishedWorkflowCodeForNote(session, args.schemaCode);
|
|
3752
|
+
const wf = submitWorkflowCheck.code;
|
|
3753
|
+
if (wf) {
|
|
3754
|
+
const nextCommand = saveIsUpdate
|
|
3755
|
+
? `omc call workitem.list --args '{"schemaCode":"${args.schemaCode}"}'`
|
|
3756
|
+
: `omc call data.save --env <env> --args '{"schemaCode":"${args.schemaCode}","workflowCode":"${wf}","formData":{...}}'`;
|
|
3757
|
+
throw new ToolRefusalError({
|
|
3758
|
+
status: "refused",
|
|
3759
|
+
blocker: "submit-model-has-workflow",
|
|
3760
|
+
schemaCode: args.schemaCode,
|
|
3761
|
+
workflowCode: wf,
|
|
3762
|
+
written: false,
|
|
3763
|
+
message: `模型有已发布流程 ${wf}:submit:true 不适用(提交会被平台拒绝),已在任何写入前拒绝(零写入,未创建草稿)。` +
|
|
3764
|
+
(saveIsUpdate
|
|
3765
|
+
? "本次是更新既有行:推进该行用 workitem.list 看现有待办 → data.submit 三件套;只想改字段请直接去掉 submit:true 重发(本拒绝没有写入)。"
|
|
3766
|
+
: `要可提交请走两段式:先 data.save {schemaCode, workflowCode:"${wf}", formData:{...}} 建流程草稿(formData 不要带 id),取回 bizObjectId/workItemId/workflowInstanceId 后再 data.submit;只想存草稿请直接去掉 submit:true。`),
|
|
3767
|
+
nextCommand,
|
|
3768
|
+
});
|
|
3769
|
+
}
|
|
3770
|
+
}
|
|
3747
3771
|
if (typeof args.workflowCode === "string" && args.workflowCode.trim()) {
|
|
3748
3772
|
// Portal draft-save shape. The row id travels in data.id (the portal
|
|
3749
3773
|
// form SDK receives a pre-generated id from form/load and echoes it);
|
|
@@ -3884,7 +3908,7 @@ export function registerRuntimeDataLane(tools) {
|
|
|
3884
3908
|
// F2(w112 探针 H):本段只在**未带 workflowCode** 的普通 save 上到达
|
|
3885
3909
|
// (带 workflowCode 的流程草稿在上面的分支已 return)——所以这里至多付
|
|
3886
3910
|
// 一次 workflow/getWorkflow,正常流程草稿保存零额外 wire。
|
|
3887
|
-
const workflowCheck = await resolvePublishedWorkflowCodeForNote(session, args.schemaCode);
|
|
3911
|
+
const workflowCheck = submitWorkflowCheck ?? await resolvePublishedWorkflowCodeForNote(session, args.schemaCode);
|
|
3888
3912
|
const publishedWorkflow = workflowCheck.code;
|
|
3889
3913
|
// 新建:普通草稿没有实例,要可提交只能带 workflowCode 重建。
|
|
3890
3914
|
const workflowDraftHint = publishedWorkflow
|
|
@@ -200,7 +200,7 @@ export const WORKFLOW_LANE_CONTRACT = Object.freeze({
|
|
|
200
200
|
// markdown,首位必须是 workflow.get_draft 的 WORKFLOW_SCOPE)。
|
|
201
201
|
"workflow.list": Object.freeze({
|
|
202
202
|
scope: "application workflow inventory (model-indexed)",
|
|
203
|
-
description: "
|
|
203
|
+
description: "应用内流程清单。平台**没有**流程模板清单端点——本面以模型为索引(workflowCode 通常为 `<模型code>_flow`,以逐模型解析为准):应用树取模型 → 逐模型解析流程(isworkflow→getWorkflow)→ 读 get_published 摘要。可选 `schemaCode` 客户端过滤(不伪造平台过滤;缺失回 workflow-list-model-not-found)。行 `{modelCode,workflowCode,exists,published,ruleBindingCount}`;无流程的模型如实列 exists:false(不是错误),ruleBindingCount 含 flow 级 handler 与节点级事件绑定的规则码总数。上限 50 模型:超出回 partial + omittedModels,点查用 workflow.get_published {schemaCode}。查某条规则被哪些流程绑定用 rule.references kind=rule。",
|
|
204
204
|
}),
|
|
205
205
|
"workflow.create": Object.freeze({
|
|
206
206
|
scope: WORKFLOW_SCOPE,
|
package/dist/lanes/workflow.js
CHANGED
|
@@ -2816,6 +2816,7 @@ export function registerWorkflowLane(tools) {
|
|
|
2816
2816
|
inputSchema: {
|
|
2817
2817
|
environment: environmentArg,
|
|
2818
2818
|
applicationCode: z.string().min(1).optional().describe("应用 code;省略按环境 profile / 租户首应用解析,回执 applicationResolution 回显实际扫了哪个应用"),
|
|
2819
|
+
schemaCode: z.string().min(1).optional().describe("模型 code(客户端过滤)"),
|
|
2819
2820
|
capability: capabilityArg,
|
|
2820
2821
|
},
|
|
2821
2822
|
handler: async (ctx, args, self) => governedRead(ctx, self, args, async (session) => {
|
|
@@ -2871,15 +2872,42 @@ export function registerWorkflowLane(tools) {
|
|
|
2871
2872
|
publishedCount += 1;
|
|
2872
2873
|
workflows.push({ modelCode, workflowCode: face.workflowCode, exists: true, published: face.published, ruleBindingCount: face.ruleBindingCount });
|
|
2873
2874
|
});
|
|
2875
|
+
const schemaFilter = typeof args.schemaCode === "string" && args.schemaCode.trim() ? args.schemaCode.trim() : undefined;
|
|
2876
|
+
let resultWorkflows = workflows;
|
|
2877
|
+
let counts = { withWorkflow, publishedCount, absentCount, readFailures };
|
|
2878
|
+
let filteredModelScanned;
|
|
2879
|
+
if (schemaFilter !== undefined) {
|
|
2880
|
+
const modelCodes = modelRows.map((row) => String(row.code));
|
|
2881
|
+
if (!modelCodes.includes(schemaFilter)) {
|
|
2882
|
+
throw new ToolRefusalError({
|
|
2883
|
+
status: "refused",
|
|
2884
|
+
blocker: "workflow-list-model-not-found",
|
|
2885
|
+
schemaCode: schemaFilter,
|
|
2886
|
+
applicationCode: scope.code,
|
|
2887
|
+
availableModels: modelCodes,
|
|
2888
|
+
message: `应用 ${scope.code} 里没有模型 ${schemaFilter}——客户端过滤不会伪造平台查询;可用模型见 availableModels,或省略 schemaCode 看整应用流程清单`,
|
|
2889
|
+
nextCommand: `omc call workflow.list --args '{"applicationCode":"${scope.code}"}'`,
|
|
2890
|
+
});
|
|
2891
|
+
}
|
|
2892
|
+
resultWorkflows = workflows.filter((row) => row.modelCode === schemaFilter);
|
|
2893
|
+
filteredModelScanned = scanRows.some((row) => String(row.code) === schemaFilter);
|
|
2894
|
+
counts = {
|
|
2895
|
+
withWorkflow: resultWorkflows.filter((row) => row.exists === true).length,
|
|
2896
|
+
publishedCount: resultWorkflows.filter((row) => row.published === true).length,
|
|
2897
|
+
absentCount: resultWorkflows.filter((row) => row.exists === false).length,
|
|
2898
|
+
readFailures: resultWorkflows.filter((row) => row.readFailed === true).length,
|
|
2899
|
+
};
|
|
2900
|
+
}
|
|
2874
2901
|
return {
|
|
2875
2902
|
applicationResolution: { ...applicationResolutionOf(scope), models: totalModels },
|
|
2876
2903
|
modelsCount: totalModels,
|
|
2877
2904
|
scannedModels: scanRows.length,
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2905
|
+
...(schemaFilter !== undefined ? { filteredBy: { schemaCode: schemaFilter }, ...(filteredModelScanned === false ? { filteredModelScanned: false, filteredModelNote: "目标模型超出本次扫描上限(工作流清单只扫前 N 个模型)——用 workflow.get_published 点查该模型" } : {}) } : {}),
|
|
2906
|
+
withWorkflow: counts.withWorkflow,
|
|
2907
|
+
publishedCount: counts.publishedCount,
|
|
2908
|
+
absentCount: counts.absentCount,
|
|
2909
|
+
...(counts.readFailures > 0 ? { readFailures: counts.readFailures } : {}),
|
|
2910
|
+
workflows: resultWorkflows,
|
|
2883
2911
|
wire: {
|
|
2884
2912
|
plan: "1 应用树 + 每模型 isworkflow(无流程即止,1 wire)→ 有流程再 getWorkflow + get_published(共 3 wire)",
|
|
2885
2913
|
concurrency: scan.stats,
|
package/dist/read-shapes.js
CHANGED
|
@@ -154,8 +154,8 @@ const READ_SHAPES = {
|
|
|
154
154
|
// artifact get --shape 先看骨架再 --jq)。published/draft 两面同形,仅 templateType
|
|
155
155
|
// 与 published 键不同。
|
|
156
156
|
"workflow.list": {
|
|
157
|
-
keys: ["applicationResolution", "modelsCount", "scannedModels", "withWorkflow", "publishedCount", "absentCount", "workflows:array<{modelCode,workflowCode,exists,published,ruleBindingCount,readFailed?}>", "wire", "partial?", "omittedModels?", "nextCommand?", "indexNote", "environmentFingerprint"],
|
|
158
|
-
notes: ["无流程的模型 workflowCode:null + exists:false(不是错误);平台无流程清单端点,本面按模型索引(流程-模型一对一惯例,workflowCode 常为 <模型code>_flow)", "ruleBindingCount = flow 级 handler + 节点级事件 + SYSTEM_ACTIVITY 顶层绑定的规则码总数(比 get_published 摘要里的同名键多算节点级)"],
|
|
157
|
+
keys: ["applicationResolution", "modelsCount", "scannedModels", "filteredBy?{schemaCode}", "filteredModelScanned?", "filteredModelNote?", "withWorkflow", "publishedCount", "absentCount", "workflows:array<{modelCode,workflowCode,exists,published,ruleBindingCount,readFailed?}>", "wire", "partial?", "omittedModels?", "nextCommand?", "indexNote", "environmentFingerprint"],
|
|
158
|
+
notes: ["无流程的模型 workflowCode:null + exists:false(不是错误);平台无流程清单端点,本面按模型索引(流程-模型一对一惯例,workflowCode 常为 <模型code>_flow)", "ruleBindingCount = flow 级 handler + 节点级事件 + SYSTEM_ACTIVITY 顶层绑定的规则码总数(比 get_published 摘要里的同名键多算节点级)", "schemaCode 是**客户端过滤**(先按应用扫描再过滤该模型,不伪造平台过滤);模型不在应用内 → workflow-list-model-not-found + availableModels"],
|
|
159
159
|
},
|
|
160
160
|
"workflow.get_published": {
|
|
161
161
|
// A2 locator:模板摘要 activities[].code ↔ 实例/待办 activityCode(Activity.java:26-30
|
package/dist/residue.js
CHANGED
|
@@ -40,7 +40,15 @@ function residueOrigin(row, faceName) {
|
|
|
40
40
|
return row.origin === "system-preset" || row.origin === "user" ? row.origin : undefined;
|
|
41
41
|
}
|
|
42
42
|
function face(faceName, rows, extra = {}) {
|
|
43
|
-
|
|
43
|
+
// 0.8.29 复核:计数必须按**全量行**算,items 只是展示截断(MAX_ITEMS=20)。
|
|
44
|
+
const systemPresetCount = rows.filter((row) => row.origin === "system-preset").length;
|
|
45
|
+
return {
|
|
46
|
+
face: faceName,
|
|
47
|
+
...extra,
|
|
48
|
+
count: rows.length,
|
|
49
|
+
items: rows.slice(0, MAX_ITEMS),
|
|
50
|
+
...(systemPresetCount > 0 ? { systemPresetCount } : {}),
|
|
51
|
+
};
|
|
44
52
|
}
|
|
45
53
|
function codeOf(row) {
|
|
46
54
|
return String(row.code ?? row.schemaCode ?? row.bizSchemaCode ?? "");
|
|
@@ -148,9 +156,9 @@ export async function scanResidues(session, prefix, options = {}) {
|
|
|
148
156
|
for (const model of models)
|
|
149
157
|
faces.push(...await deepFaces(session, model));
|
|
150
158
|
}
|
|
151
|
-
const systemPresetCount = faces.reduce((sum, item) => sum + item.
|
|
152
|
-
const userResidues = faces.reduce((sum, item) => sum + item.items.filter((row) => row.origin !== "system-preset").length, 0);
|
|
159
|
+
const systemPresetCount = faces.reduce((sum, item) => sum + (item.systemPresetCount ?? 0), 0);
|
|
153
160
|
const totalResidues = faces.reduce((sum, item) => sum + item.count, 0);
|
|
161
|
+
const userResidues = totalResidues - systemPresetCount;
|
|
154
162
|
const modelFace = faces.filter((item) => item.face === "model");
|
|
155
163
|
const hasModelResidue = modelFace.some((item) => item.count > 0);
|
|
156
164
|
const hasOtherResidue = faces.some((item) => item.face !== "model" && item.count > 0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stalfh233/omc-cli",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.29",
|
|
4
4
|
"description": "CloudPivot 8.6 configuration capability CLI — governed, fail-closed, coverage-manifest bounded.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"commander": "14.0.3",
|
|
61
|
-
"omc-core": "0.8.
|
|
61
|
+
"omc-core": "0.8.29",
|
|
62
62
|
"proper-lockfile": "4.1.2",
|
|
63
63
|
"write-file-atomic": "6.0.0",
|
|
64
64
|
"zod": "^3.23.8",
|
|
@@ -76,6 +76,6 @@
|
|
|
76
76
|
"directory": "packages/omc-cli"
|
|
77
77
|
},
|
|
78
78
|
"optionalDependencies": {
|
|
79
|
-
"@stalfh233/omc-fake-platform": "0.8.
|
|
79
|
+
"@stalfh233/omc-fake-platform": "0.8.29"
|
|
80
80
|
}
|
|
81
81
|
}
|
package/skills/omc-glossary.md
CHANGED
|
@@ -84,7 +84,7 @@ Terminology for the `omc` configuration CLI. Built on CloudPivot 8.6 (anchor
|
|
|
84
84
|
- **Void envelope** — CloudPivot responses are `{errcode, errmsg, data}`;
|
|
85
85
|
errcode 0 with `data: null` is a success with no payload.
|
|
86
86
|
|
|
87
|
-
## Numeric display format constants (数值格式常量)
|
|
87
|
+
## Numeric display format constants (数值格式常量 · 数字单位 unit)
|
|
88
88
|
|
|
89
89
|
- 小数位词(后缀;裸值族直接用它):`integer`(0) / `tenths`(1) / `percentile`(2) /
|
|
90
90
|
`Millimeter`(3) / `tenThousand`(4) / `hundredThousand`(5) / `millionDecimals`(6) /
|