@stalfh233/omc-cli 0.8.16 → 0.8.18
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/call.js +25 -2
- package/dist/cli.js +25 -5
- package/dist/discovery.js +2 -0
- package/dist/field-add.js +1 -1
- package/dist/form-support.js +55 -7
- package/dist/goal-plan.js +23 -2
- package/dist/goal-routes.js +94 -18
- package/dist/human-summary.js +20 -2
- package/dist/lanes/datarule.js +3 -0
- package/dist/lanes/field-contract.js +10 -1
- package/dist/lanes/field.js +98 -21
- package/dist/lanes/form-contract.js +1 -1
- package/dist/lanes/form.js +13 -5
- package/dist/lanes/list-view.js +113 -4
- package/dist/lanes/runtime-data-contract.js +2 -1
- package/dist/lanes/runtime-data.js +244 -25
- package/dist/model-purge.js +23 -3
- package/dist/model-scaffold.js +11 -3
- package/dist/path-projection.js +151 -4
- package/dist/recipes/datarule.js +39 -1
- package/dist/recipes/list-view.js +38 -1
- package/dist/residue.js +22 -7
- package/dist/search-index.js +2 -0
- package/dist/wire.js +11 -1
- package/dist/write.js +2 -1
- package/package.json +3 -3
- package/skills/omc-capabilities.md +1 -1
- package/skills/omc-start-here.md +1 -1
package/dist/call.js
CHANGED
|
@@ -272,8 +272,12 @@ function humanResultLine(result) {
|
|
|
272
272
|
// 于是这一行又被印出来(round16 的「dry-run 不打印人话」断言失败)。
|
|
273
273
|
if (status === "dry-run")
|
|
274
274
|
return null;
|
|
275
|
-
if (typeof result.summary === "string" && result.summary.trim().length > 0)
|
|
276
|
-
|
|
275
|
+
if (typeof result.summary === "string" && result.summary.trim().length > 0) {
|
|
276
|
+
// F4(w153):写面 summary 已存在时,mappingSnapshotGap 的同一句仍要进
|
|
277
|
+
// 人类行——探针只读 stderr 的首屏,不能让它埋在 JSON 里。
|
|
278
|
+
const gapNote = mappingSnapshotGapNote(result);
|
|
279
|
+
return gapNote !== undefined ? `${result.summary};${gapNote}` : result.summary;
|
|
280
|
+
}
|
|
277
281
|
if (status === "ok" || status === "dry-run")
|
|
278
282
|
return readDiagnosticLine(result);
|
|
279
283
|
if (result?.blocker === undefined && status !== "error" && status !== "uncertain")
|
|
@@ -295,10 +299,29 @@ function readDiagnosticLine(result) {
|
|
|
295
299
|
const unprojectedNote = unprojectedSummaryNote(result);
|
|
296
300
|
if (unprojectedNote !== undefined)
|
|
297
301
|
notes.push(unprojectedNote);
|
|
302
|
+
// F3(w153):业务键整个缺席(不是 null)时 unprojectedSummaryNote 无计数可给,
|
|
303
|
+
// 人类行改用 projectionWarning 的同一句 hint。
|
|
304
|
+
const projectionWarning = result.projectionWarning;
|
|
305
|
+
if (unprojectedNote === undefined && projectionWarning !== undefined && typeof projectionWarning.hint === "string" && projectionWarning.hint.length > 0)
|
|
306
|
+
notes.push(projectionWarning.hint);
|
|
298
307
|
if (typeof result.dateReadbackNote === "string" && result.dateReadbackNote.length > 0)
|
|
299
308
|
notes.push(result.dateReadbackNote);
|
|
309
|
+
const mappingGapNote = mappingSnapshotGapNote(result);
|
|
310
|
+
if (mappingGapNote !== undefined)
|
|
311
|
+
notes.push(mappingGapNote);
|
|
300
312
|
return notes.length > 0 ? notes.join(";") : null;
|
|
301
313
|
}
|
|
314
|
+
/**
|
|
315
|
+
* F4(w153):写面「映射配了但快照空」的人话行——JSON 里 mappingSnapshotGap
|
|
316
|
+
* 同一份证据,stderr 让调用方在写回执的第一屏就看到具体行/字段。
|
|
317
|
+
*/
|
|
318
|
+
function mappingSnapshotGapNote(result) {
|
|
319
|
+
// 写面回执的读回诊断嵌在 readback 下(data.save/data.submit 的 execute 返回
|
|
320
|
+
// {performed,readback}),读面则可能平铺——两形都认。
|
|
321
|
+
const nested = result.readback !== null && typeof result.readback === "object" ? result.readback : undefined;
|
|
322
|
+
const gap = (result.mappingSnapshotGap ?? nested?.mappingSnapshotGap);
|
|
323
|
+
return gap !== undefined && typeof gap.hint === "string" && gap.hint.length > 0 ? gap.hint : undefined;
|
|
324
|
+
}
|
|
302
325
|
/**
|
|
303
326
|
* F5(w112 探针 H,P2):`items[].fields` 缺键像「值丢了」。行级
|
|
304
327
|
* `items[].unprojected` 是权威点名,但 compact 外置 items 后行内证据不在信封里,
|
package/dist/cli.js
CHANGED
|
@@ -571,8 +571,28 @@ async function cmdCall(store, args) {
|
|
|
571
571
|
const emit = (status, result, exitCode, extra) => {
|
|
572
572
|
if (status === "uncertain" && result !== null && typeof result === "object" && !Array.isArray(result) && result.nextAction === undefined)
|
|
573
573
|
result = { ...result, nextAction: "read back the requestId before retrying; retry only after the outcome is established" };
|
|
574
|
-
|
|
575
|
-
|
|
574
|
+
// F7(0.8.17 真机 P1):`result` 可能是 --jq 单路径解包后的**叶子**(null /
|
|
575
|
+
// 标量 / 数组),不是工具结果。此处再 classifyResult 会走 `.status`:
|
|
576
|
+
// discover_environment 缓存命中 `models:null` 时 `--jq models` 直接 internal
|
|
577
|
+
// (Cannot read properties of null);标量叶子则把 refused 翻成 ok:true。
|
|
578
|
+
// 结论以**投影前**的分类为准——单路径解包时由调用方放进 extra.error。
|
|
579
|
+
const carriedError = extra !== undefined && Object.prototype.hasOwnProperty.call(extra, "error")
|
|
580
|
+
? extra.error
|
|
581
|
+
: undefined;
|
|
582
|
+
const classifiedError = carriedError !== undefined
|
|
583
|
+
? carriedError
|
|
584
|
+
: result !== null && typeof result === "object" && !Array.isArray(result)
|
|
585
|
+
? classifyResult(result).error
|
|
586
|
+
: null;
|
|
587
|
+
// 回归(0.8.17 复核):字符串叶子仍必须受 stdout 预算约束——否则 `--jq` 取
|
|
588
|
+
// 一个 >64KiB 的字符串会整段内联,破「大读回不内联」。number/boolean/null
|
|
589
|
+
// 有界,原样返回。
|
|
590
|
+
const bounded = result !== null && typeof result === "object"
|
|
591
|
+
? boundResult(result, maxOutputBytes)
|
|
592
|
+
: typeof result === "string"
|
|
593
|
+
? boundResult(result, maxOutputBytes)
|
|
594
|
+
: result;
|
|
595
|
+
const envelopeValue = envelope(status, bounded, request, classifiedError);
|
|
576
596
|
// issue 2026-11-18 §05:单路径 --jq 解包后,`result` 是目标节点本体(可能是
|
|
577
597
|
// 数组/标量,装不进结果对象),路径来源等元信息放信封旁的 `resultMeta`。
|
|
578
598
|
// issue 07:sessionAccount 恒在 resultMeta(瘦身影封保留 resultMeta)。
|
|
@@ -3795,7 +3815,7 @@ async function main() {
|
|
|
3795
3815
|
.option("--env <environment>")
|
|
3796
3816
|
.option("--environment <environment>")
|
|
3797
3817
|
.option("--apply")
|
|
3798
|
-
.addHelpText("after", "\n一条命令按依赖倒序清掉一个模型:列表视图 → 业务规则 → 计算规则 → 流程实例 → 流程 → 模型(字段/表单随模型级联,并级联删除流程模板 <code>_wf 及其发起权限绑定)。默认 dry-run。\n
|
|
3818
|
+
.addHelpText("after", "\n一条命令按依赖倒序清掉一个模型:列表视图 → 业务规则 → 计算规则 → 流程实例 → 流程 → 模型(字段/表单随模型级联,并级联删除流程模板 <code>_wf 及其发起权限绑定)。默认 dry-run。\n入站引用:dry-run 预置 unbindSteps(一条完整计划,零写入);跨模型引用(被其它模型关联字段引用)另回 blocker:\"model-referenced-by\" + wouldRequireFlags,纯自引用(本模型子表关联列指向自身)只回 warnings:[{code:\"self-reference-auto-unbind\"}],因为 --apply 会自动拆;--apply 未带 --unbind-references 时回 blocked/partial 并给 deletionSteps;加 --unbind-references --apply 让本命令先拆引用(破坏性:会删除引用列/子表关联列,列数据不可恢复),任一步失败即停且不删模型。\n业务数据:--purge-instances 删流程实例;普通业务行(无流程)不会自动带走——先 data.delete 清(sweep-all-readback 配方),再 purge,否则留孤儿数据。\n")
|
|
3799
3819
|
.action(async (options) => {
|
|
3800
3820
|
const rest = ["model-purge",
|
|
3801
3821
|
...(options.code ? ["--code", options.code] : []),
|
|
@@ -3913,7 +3933,7 @@ async function main() {
|
|
|
3913
3933
|
.option("--name <name>", "模型名")
|
|
3914
3934
|
.option("--fields <json>", "JSON 数组,每条是一个 field.create 参数;子表加 subFields")
|
|
3915
3935
|
.option("--fields-json <json>")
|
|
3916
|
-
.option("--fields-file <path>", "
|
|
3936
|
+
.option("--fields-file <path>", "从文件读字段 JSON 数组。**必须位于配置根内**(根 = `$OMC_CONFIG_HOME` 或当前工作目录;根外一律拒绝);免落盘用 `--fields -`(stdin);与 --fields 互斥")
|
|
3917
3937
|
.option("--folder <folderId>", "建在哪个应用目录(省略=默认目录)")
|
|
3918
3938
|
.option("--app <applicationCode>")
|
|
3919
3939
|
.option("--env <environment>")
|
|
@@ -3960,7 +3980,7 @@ async function main() {
|
|
|
3960
3980
|
.option("--code <schemaCode>")
|
|
3961
3981
|
.option("--fields <json>", "JSON 数组,每条是一个 field.create 参数(choices/字典 options 原样透传)")
|
|
3962
3982
|
.option("--fields-json <json>")
|
|
3963
|
-
.option("--fields-file <path>", "
|
|
3983
|
+
.option("--fields-file <path>", "从文件读字段 JSON 数组。**必须位于配置根内**(根 = `$OMC_CONFIG_HOME` 或当前工作目录;根外一律拒绝);免落盘用 `--fields -`(stdin);与 --fields 互斥")
|
|
3964
3984
|
.option("--env <environment>")
|
|
3965
3985
|
.option("--environment <environment>")
|
|
3966
3986
|
.option("--no-form", "跳过表单重建")
|
package/dist/discovery.js
CHANGED
|
@@ -826,6 +826,7 @@ export function describeParam(registry, name, param) {
|
|
|
826
826
|
const nested = nestedParamHits(tool, param);
|
|
827
827
|
if (nested.length > 0) {
|
|
828
828
|
const first = nested[0];
|
|
829
|
+
const hint = tool.nestedParamHints?.[param];
|
|
829
830
|
return {
|
|
830
831
|
name: tool.name,
|
|
831
832
|
param,
|
|
@@ -833,6 +834,7 @@ export function describeParam(registry, name, param) {
|
|
|
833
834
|
path: first.path,
|
|
834
835
|
nestedIn: `${first.recipeId} 的 ${first.container}`,
|
|
835
836
|
...(nested.length > 1 ? { nestedAlso: nested.slice(1).map((hit) => `${hit.recipeId} 的 ${hit.container}`) } : {}),
|
|
837
|
+
...(hint !== undefined ? { description: hint } : {}),
|
|
836
838
|
message: `"${param}" 是嵌套参数(${first.path}),顶层参数见 available;形状看 omc describe ${tool.name} --example ${first.recipeId}`,
|
|
837
839
|
available: Object.keys(schema.properties ?? {}),
|
|
838
840
|
};
|
package/dist/field-add.js
CHANGED
|
@@ -168,7 +168,7 @@ export async function cmdFieldAdd(args, contextForTest) {
|
|
|
168
168
|
" --no-form 跳过表单重建;--no-list 跳过列表加列(默认两者都做)。",
|
|
169
169
|
" --conditions '<JSON 数组>' 列表固定过滤条件(listview.configure 契约;**整体替换**既有固定条件——要保留旧的须一并带上;不传则不动);需 --list(默认开)。",
|
|
170
170
|
" --demo-rows '<JSON 数组>' 演示数据行(每项一份 formData,逐行 data.submit);非幂等——重复执行会重复插行。",
|
|
171
|
-
" --fields-file 从配置根内文件读 JSON
|
|
171
|
+
" --fields-file 从配置根内文件读 JSON 数组(根 = $OMC_CONFIG_HOME 或当前工作目录,根外拒绝;免落盘用 --fields - 读 stdin);--fields - 从 stdin 读 JSON 数组。",
|
|
172
172
|
].join("\n");
|
|
173
173
|
const invalid = (message) => {
|
|
174
174
|
writeEnvelope(envelope("error", {}, request, { code: "invalid-input", message: `${message}\n${usage}`, retryable: false }));
|
package/dist/form-support.js
CHANGED
|
@@ -1393,19 +1393,34 @@ export async function lintFormPublishReadOnly(session, args) {
|
|
|
1393
1393
|
// 提拔是逐字复制草稿 → 发布面,所以「发布面缺子表列」=「草稿面缺子表列」,
|
|
1394
1394
|
// 预览用草稿面算同一份清单(真写用发布后的回读面复核)。
|
|
1395
1395
|
const childColumnGaps = await childColumnsMissingFromForm(session, { schemaCode: args.schemaCode, attributesJson: sheet.draftAttributesJson });
|
|
1396
|
+
const willBindChildColumns = args.bindNewChildColumns === true && (childColumnGaps?.length ?? 0) > 0;
|
|
1396
1397
|
const draftEqualsPublished = sheet.draftViewJson === sheet.publishedViewJson &&
|
|
1397
1398
|
sheet.draftAttributesJson === sheet.publishedAttributesJson &&
|
|
1398
1399
|
(sheet.draftHtmlJson === undefined || sheet.draftHtmlJson === sheet.publishedHtmlJson);
|
|
1400
|
+
const alreadyPublished = sheet.published === true && draftEqualsPublished && !willBindChildColumns;
|
|
1399
1401
|
return {
|
|
1400
|
-
wouldChange: !(sheet.published === true && draftEqualsPublished && args.force !== true),
|
|
1402
|
+
wouldChange: willBindChildColumns || !(sheet.published === true && draftEqualsPublished && args.force !== true),
|
|
1401
1403
|
sheetPresent: true,
|
|
1402
1404
|
draftPresent: true,
|
|
1403
1405
|
draftControlCount: controlCount(sheet.draftAttributesJson),
|
|
1404
1406
|
publishedControlCount: publishedControls,
|
|
1405
1407
|
draftEqualsPublished,
|
|
1406
|
-
alreadyPublished
|
|
1408
|
+
alreadyPublished,
|
|
1409
|
+
...(args.bindNewChildColumns === true
|
|
1410
|
+
? {
|
|
1411
|
+
bindNewChildColumns: true,
|
|
1412
|
+
bindChildColumnsPlanned: childColumnGaps ?? [],
|
|
1413
|
+
bindChildColumnsNote: childColumnGaps === undefined
|
|
1414
|
+
? "无法核对(field.list 读失败),真写也不会绑列——先重试或修好读面"
|
|
1415
|
+
: willBindChildColumns
|
|
1416
|
+
? "真写会先增量绑定这些子表列再发布"
|
|
1417
|
+
: "没有待绑定的子表列",
|
|
1418
|
+
}
|
|
1419
|
+
: {}),
|
|
1407
1420
|
...childColumnsGapReadback(childColumnGaps, args.schemaCode, sheetCode),
|
|
1408
|
-
note:
|
|
1421
|
+
note: willBindChildColumns
|
|
1422
|
+
? "降级门与真写同一函数;bindNewChildColumns 会先增量绑定这些子表列,因此真写不会短路(会改发布面)"
|
|
1423
|
+
: "降级门与真写同一函数;alreadyPublished:true 时真写会短路(不改发布面)",
|
|
1409
1424
|
};
|
|
1410
1425
|
}
|
|
1411
1426
|
/** A3 (issue 2026-11-25): the non-layout args that make a no-layout write an explicit, bounded intent. */
|
|
@@ -2505,6 +2520,12 @@ export async function executeFormPublishWrite(session, args) {
|
|
|
2505
2520
|
await executeFormDraftWrite(session, { schemaCode: args.schemaCode, sheetCode: args.sheetCode });
|
|
2506
2521
|
pre = await readFormOrNull(session, args.schemaCode, args.sheetCode);
|
|
2507
2522
|
}
|
|
2523
|
+
// F5(探针 K,0.8.17):两次写回执各给一条 childColumnsNotInForm 同义警告 +
|
|
2524
|
+
// 同一条 configure_form 命令。bindNewChildColumns:true 把「绑定 + 发布」收成
|
|
2525
|
+
// 一次调用(增量改草稿,不动其它控件/布局);默认 false 仍只告警。
|
|
2526
|
+
//
|
|
2527
|
+
// P2(复核驳回):绑定是**写**,必须排在 HTML/降级门之后——拒绝 = 零写入。
|
|
2528
|
+
// 所以先只读算缺列(决定是否会短路),过完门再真正写草稿。
|
|
2508
2529
|
if (!pre)
|
|
2509
2530
|
throw new WireError("business", `form ${args.sheetCode} not found`, 302024);
|
|
2510
2531
|
if (pre.draftHtmlJson !== "[]")
|
|
@@ -2524,7 +2545,11 @@ export async function executeFormPublishWrite(session, args) {
|
|
|
2524
2545
|
const draftEqualsPublished = typeof pre.draftViewJson === "string" && pre.draftViewJson === pre.publishedViewJson &&
|
|
2525
2546
|
typeof pre.draftAttributesJson === "string" && pre.draftAttributesJson === pre.publishedAttributesJson &&
|
|
2526
2547
|
(pre.draftHtmlJson === undefined || pre.draftHtmlJson === pre.publishedHtmlJson);
|
|
2527
|
-
|
|
2548
|
+
const pendingChildColumns = args.bindNewChildColumns === true
|
|
2549
|
+
? await childColumnsMissingFromForm(session, { schemaCode: args.schemaCode, attributesJson: pre.draftAttributesJson })
|
|
2550
|
+
: undefined;
|
|
2551
|
+
const willBindChildColumns = (pendingChildColumns?.length ?? 0) > 0;
|
|
2552
|
+
if (pre.published === true && draftEqualsPublished && !forcePromote && !willBindChildColumns) {
|
|
2528
2553
|
// 短路也是回执:已发布 ≠ 页面可见。历史 layout 覆盖掉的子表列要在这里点名,
|
|
2529
2554
|
// 否则重跑 form.publish 会得到「published:true」的假确认。
|
|
2530
2555
|
const publishedGaps = await childColumnsMissingFromForm(session, { schemaCode: args.schemaCode, attributesJson: pre.publishedAttributesJson });
|
|
@@ -2533,29 +2558,42 @@ export async function executeFormPublishWrite(session, args) {
|
|
|
2533
2558
|
readback: {
|
|
2534
2559
|
published: true,
|
|
2535
2560
|
draftMatchesPublished: true,
|
|
2561
|
+
...(args.bindNewChildColumns === true
|
|
2562
|
+
? { bindChildColumnsNote: pendingChildColumns === undefined ? "无法核对(field.list 读失败),未执行绑定" : "没有待绑定的子表列" }
|
|
2563
|
+
: {}),
|
|
2536
2564
|
...childColumnsGapReadback(publishedGaps, args.schemaCode, args.sheetCode),
|
|
2537
2565
|
},
|
|
2538
2566
|
};
|
|
2539
2567
|
}
|
|
2540
2568
|
if (!hasDraft(pre))
|
|
2541
2569
|
throw new WireError("business", "form publish requires a saved draft (draftViewJson/draftAttributesJson)", 302020);
|
|
2542
|
-
if (pre.draftHtmlJson !== "[]")
|
|
2543
|
-
assertHtmlRender(pre.draftHtmlJson, { schemaCode: args.schemaCode, sheetCode: args.sheetCode, face: "draftHtmlJson" });
|
|
2544
2570
|
// Ticket 74 — degrade guard: refuse to promote a draft that carries FEWER
|
|
2545
2571
|
// controls than the already-published face. The platform designer's Save
|
|
2546
2572
|
// clears the draft faces to "[]"/"{}" (non-lossless); promoting that empty
|
|
2547
2573
|
// draft is exactly how the 13-control loss happened. Escape: allowDegrade:true.
|
|
2574
|
+
// 必须在 bind 之前:否则「绑定写草稿 → 降级门拒绝」留下半截写入。
|
|
2548
2575
|
assertPublishNotDegrading(pre.draftAttributesJson, pre.publishedAttributesJson, { schemaCode: args.schemaCode, sheetCode: args.sheetCode, ...(args.allowDegrade !== undefined ? { allowDegrade: args.allowDegrade } : {}) });
|
|
2549
2576
|
// Buttons ride `options.customButtonJson`; the platform converts them into
|
|
2550
2577
|
// h_biz_button(triggerType=FORM) rows during THIS publish call
|
|
2551
2578
|
// (ModelManagementFacadeImpl.publishBizForm:1022). Passing them here is the
|
|
2552
2579
|
// only way to create form buttons without the designer.
|
|
2580
|
+
//
|
|
2581
|
+
// 按钮语法/语义校验(validateFormButtons / 互斥 / 未知 buttonScripts)是纯本地
|
|
2582
|
+
// 拒绝,且不依赖 childColumns 绑定结果——必须在**绑定写之前**跑完:否则
|
|
2583
|
+
// `bindNewChildColumns + 非法 buttons` 会先写草稿再拒(拒绝 ≠ 零写入)。
|
|
2553
2584
|
const mergedOptions = mergeFormOptionsWithButtons(pre.options, { buttons: args.buttons, customButtonJson: args.customButtonJson, buttonsMode: args.buttonsMode, removeButtonCodes: args.removeButtonCodes, buttonScripts: args.buttonScripts }, "form.publish");
|
|
2554
2585
|
// 2.1.5 设计器发布时恒清空 options.dataItemTypeChangeList(edit-property.ts:199-203)。
|
|
2555
2586
|
// 清空必须作用在**最终** options 上:按钮合并优先(mergedOptions 是字符串),
|
|
2556
2587
|
// 没有按钮增量时才回落到 pre.options;键不存在则原样透传,不新增。
|
|
2557
2588
|
const pendingCleared = clearPendingTypeChangeList(mergedOptions ?? pre.options);
|
|
2558
2589
|
const finalOptions = mergedOptions !== undefined ? pendingCleared ?? mergedOptions : pendingCleared;
|
|
2590
|
+
const boundChildColumns = willBindChildColumns ? pendingChildColumns : [];
|
|
2591
|
+
if (boundChildColumns.length > 0) {
|
|
2592
|
+
await executeFormDraftWrite(session, { schemaCode: args.schemaCode, sheetCode: args.sheetCode, childColumns: boundChildColumns });
|
|
2593
|
+
pre = await readFormOrNull(session, args.schemaCode, args.sheetCode);
|
|
2594
|
+
if (!pre)
|
|
2595
|
+
throw new WireError("business", `form ${args.sheetCode} not found after childColumns bind`, 302024);
|
|
2596
|
+
}
|
|
2559
2597
|
const payload = {
|
|
2560
2598
|
...pre,
|
|
2561
2599
|
...(finalOptions !== undefined ? { options: finalOptions } : {}),
|
|
@@ -2585,10 +2623,20 @@ export async function executeFormPublishWrite(session, args) {
|
|
|
2585
2623
|
// 而没绑进表单时,这里逐条点名(读不到字段面则不诊断)。
|
|
2586
2624
|
const childColumnGaps = await childColumnsMissingFromForm(session, { schemaCode: args.schemaCode, attributesJson: sheet.publishedAttributesJson });
|
|
2587
2625
|
return {
|
|
2588
|
-
performed: {
|
|
2626
|
+
performed: {
|
|
2627
|
+
errcode: performed.errcode,
|
|
2628
|
+
...(boundChildColumns.length > 0
|
|
2629
|
+
? { steps: [{ step: "form.draft", childColumns: boundChildColumns }, { step: "form.publish", errcode: performed.errcode }] }
|
|
2630
|
+
: {}),
|
|
2631
|
+
},
|
|
2589
2632
|
readback: {
|
|
2590
2633
|
published: sheet.published === true,
|
|
2591
2634
|
publishedHtmlJsonPresent: typeof sheet.publishedHtmlJson === "string",
|
|
2635
|
+
...(boundChildColumns.length > 0
|
|
2636
|
+
? { boundChildColumns, boundChildColumnsNote: "发布前已把这些子表列增量绑进草稿(只追加列,不动其它控件/布局),因此本次发布面不再缺列" }
|
|
2637
|
+
: args.bindNewChildColumns === true
|
|
2638
|
+
? { bindChildColumnsNote: pendingChildColumns === undefined ? "无法核对(field.list 读失败),未执行绑定" : "没有待绑定的子表列" }
|
|
2639
|
+
: {}),
|
|
2592
2640
|
...childColumnsGapReadback(childColumnGaps, args.schemaCode, args.sheetCode),
|
|
2593
2641
|
...(formButtons !== null
|
|
2594
2642
|
? {
|
package/dist/goal-plan.js
CHANGED
|
@@ -774,10 +774,20 @@ async function planGoalInner(registry, goal, options = {}) {
|
|
|
774
774
|
}
|
|
775
775
|
const lane = typeof route.route.lane === "string" ? route.route.lane : undefined;
|
|
776
776
|
const capability = typeof route.route.capability === "string" ? route.route.capability : undefined;
|
|
777
|
+
// F9(0.8.17 复核):`omc next` 已把「4/7 面要原子补齐」判成 primary=hybrid
|
|
778
|
+
// (goal-routes 的 needsHybridRoute)。plan 不能再只发纯 intent 叙事——否则
|
|
779
|
+
// agent 照 plan 跑完 validate/plan/apply,仍会在布局/排序/运行面上撞墙。
|
|
780
|
+
const hybrid = route.route.primary === "hybrid";
|
|
777
781
|
const intentPrimary = route.route.primary === "intent" || route.mode === "whole-package";
|
|
778
782
|
// Level 5: the ask is a whole configuration package. The declarative intent
|
|
779
783
|
// compiler owns that; an atomic call chain would be strictly worse.
|
|
780
784
|
if (intentPrimary) {
|
|
785
|
+
const coverage = route.route.intentCoverage;
|
|
786
|
+
const needsCall = hybrid ? (coverage?.needsCall ?? []) : [];
|
|
787
|
+
const routeFirstCommands = Array.isArray(route.route.firstCommands)
|
|
788
|
+
? route.route.firstCommands.filter((command) => typeof command === "string")
|
|
789
|
+
: [];
|
|
790
|
+
const intentLifecycle = ["omc intent schema", "omc intent validate <file>", "omc intent plan <file> --env <env>"];
|
|
781
791
|
return {
|
|
782
792
|
...base,
|
|
783
793
|
ready: false,
|
|
@@ -785,9 +795,20 @@ async function planGoalInner(registry, goal, options = {}) {
|
|
|
785
795
|
...(route.match !== undefined ? { match: route.match } : {}),
|
|
786
796
|
...(capability !== undefined ? { capability } : {}),
|
|
787
797
|
...(lane !== undefined ? { lane } : {}),
|
|
788
|
-
blockers: [{
|
|
798
|
+
blockers: [{
|
|
799
|
+
type: "declarative-face",
|
|
800
|
+
...(hybrid ? { hybrid: true, needsCall } : {}),
|
|
801
|
+
reason: hybrid
|
|
802
|
+
? `整包需求主要由 intent 编译器承接(模型/字段/规则/流程模板),但本任务 ${needsCall.length} 面 intent 不覆盖(${needsCall.map((entry) => entry.id).join("、") || "见 intentCoverage"}):intent validate/plan/apply 之后按 needsCall 的命令用原子面补齐`
|
|
803
|
+
: "整包需求由 intent 编译器承接(模型/字段/规则/流程按依赖排序、可 readback 对账)",
|
|
804
|
+
why: hybrid
|
|
805
|
+
? "只给 intent 命令会让调用方在布局/排序/运行面撞墙;混合起手见 next(intent 键位 + model-scaffold + needsCall)"
|
|
806
|
+
: "原子 call 链无法保证顺序与幂等",
|
|
807
|
+
}],
|
|
789
808
|
planHash: planHash({ goal, environment, level: 5 }),
|
|
790
|
-
next:
|
|
809
|
+
next: hybrid
|
|
810
|
+
? [...intentLifecycle, ...routeFirstCommands.filter((command) => !intentLifecycle.includes(command))]
|
|
811
|
+
: intentLifecycle,
|
|
791
812
|
};
|
|
792
813
|
}
|
|
793
814
|
const match = route.match;
|
package/dist/goal-routes.js
CHANGED
|
@@ -569,7 +569,7 @@ const WHOLE_PACKAGE_CAPABILITIES = ["model", "field", "form", "listview", "datar
|
|
|
569
569
|
* 声明式路径)。
|
|
570
570
|
*/
|
|
571
571
|
const INTENT_COVERAGE = Object.freeze({
|
|
572
|
-
note: "intent 覆盖面(与 `omc intent schema` 同源):covered 由 validate/plan/apply 声明式生成;needsCall
|
|
572
|
+
note: "intent 覆盖面(与 `omc intent schema` 同源):covered 由 validate/plan/apply 声明式生成;needsCall 是本次需求里 intent 不声明(或运行语义/精确 patch 不在声明面)的部分,apply 后用 command 走原子面补齐。",
|
|
573
573
|
covered: [
|
|
574
574
|
"模型 model(含 absent 删除)",
|
|
575
575
|
"标量字段与子表标量列(CHILD_TABLE subFields)",
|
|
@@ -586,24 +586,77 @@ const INTENT_COVERAGE = Object.freeze({
|
|
|
586
586
|
id: "child-map-fill",
|
|
587
587
|
what: "子表取主表字段:WORK_SHEET 关联列 + options.mappings(intent 子列可声明 relativeCode/options;映射回填只在门户表单执行、REST 不回填,精确改映射与读回以 child-map-fill 配方为准)",
|
|
588
588
|
command: "omc describe field.create --example child-map-fill",
|
|
589
|
+
cues: ["子表", "明细", "主子表", "映射", "mapping", "关联字段"],
|
|
589
590
|
},
|
|
590
591
|
{
|
|
591
592
|
id: "form-two-column-layout",
|
|
592
593
|
what: "表单两列布局(intent 的 form 只有 publish/fieldCodes,不含行分组/控件 span)",
|
|
593
594
|
command: "omc describe form.draft --example two-column-layout",
|
|
595
|
+
cues: ["两列", "布局"],
|
|
594
596
|
},
|
|
595
597
|
{
|
|
596
598
|
id: "listview-sorts-conditions",
|
|
597
599
|
what: "列表视图业务排序/筛选条件(intent 的 listview 只声明列,排序/条件/按钮 apply 后用 listview.configure 补)",
|
|
598
600
|
command: "omc describe listview.configure --param sorts",
|
|
601
|
+
cues: ["排序", "筛选", "过滤", "查询条件"],
|
|
599
602
|
},
|
|
600
603
|
{
|
|
601
604
|
id: "workflow-runtime",
|
|
602
605
|
what: "审批运行操作:提交/审批/待办/流转(intent 的 workflow 只到模板+发布+绑规则,运行实例走 data.save/data.submit/workitem.list)",
|
|
603
606
|
command: "omc describe data.submit --example workflow-backed-data-submit",
|
|
607
|
+
// F9 收紧(0.8.17 复核):裸「审批」「提交」会误伤字段名与模板面——
|
|
608
|
+
// 「提交人/提交时间/提交日期」是字段,不是运行动作;
|
|
609
|
+
// 「审批流程/审批流/审批节点/审批模板」是 intent 覆盖的模板面。
|
|
610
|
+
// 运行面只认动作/对象:提交(非字段后缀)、审批(非模板后缀)、待办、流转、跑通、实例。
|
|
611
|
+
cues: [
|
|
612
|
+
"re:提交(?!人|时间|日期|者|方|单位|部门|按钮|字段|记录|说明|备注|项)",
|
|
613
|
+
"re:审批(?!流程|流|模板|节点|权限|规则|人|时间|日期)",
|
|
614
|
+
"待办",
|
|
615
|
+
"流转",
|
|
616
|
+
"跑通",
|
|
617
|
+
"实例",
|
|
618
|
+
],
|
|
604
619
|
},
|
|
605
620
|
],
|
|
606
621
|
});
|
|
622
|
+
/**
|
|
623
|
+
* F9(0.8.17,探针 K):needsCall 必须按「这次需求点名了哪几面」来算,不能整份
|
|
624
|
+
* 静态清单全贴上。探针原句 4 个未覆盖面(子表映射/两列布局/排序筛选/流程运行)
|
|
625
|
+
* 全部命中,route 却仍回 `primary:"intent"` + `confident:true`——等于宣称声明式
|
|
626
|
+
* 一条路走完,agent 照做后在 4 个面上撞墙。现在:
|
|
627
|
+
* - needsCall 只列本句真实点名的面;
|
|
628
|
+
* - 命中 ≥3 面,或面数 ≥4 且占比 ≥1/2 → `primary:"hybrid"`,并给混合起手命令。
|
|
629
|
+
* 单面句(「给表单加两列布局」「配好列表视图」)与 2/3 面的小任务仍不降级,
|
|
630
|
+
* 仍是 intent 主推(「报销单带提交人和提交时间,明细子表,两列布局」不得翻 hybrid)。
|
|
631
|
+
*/
|
|
632
|
+
export function intentNeedsCallFor(goal) {
|
|
633
|
+
return INTENT_COVERAGE.needsCall
|
|
634
|
+
.filter((entry) => entry.cues.some((cue) => cueMatches(goal, cue)))
|
|
635
|
+
.map(({ id, what, command }) => ({ id, what, command }));
|
|
636
|
+
}
|
|
637
|
+
/** `re:`-prefixed cues are regexes (negative lookaheads keep field names out); others are literals. */
|
|
638
|
+
function cueMatches(goal, cue) {
|
|
639
|
+
return cue.startsWith("re:") ? new RegExp(cue.slice(3)).test(goal) : goal.includes(cue);
|
|
640
|
+
}
|
|
641
|
+
export function intentCoverageFor(goal) {
|
|
642
|
+
return { note: INTENT_COVERAGE.note, covered: INTENT_COVERAGE.covered, needsCall: intentNeedsCallFor(goal) };
|
|
643
|
+
}
|
|
644
|
+
/** Hybrid trigger: ≥3 atomic-fill faces, or ≥half of ≥4 named faces. */
|
|
645
|
+
function needsHybridRoute(needsCallCount, faceCount) {
|
|
646
|
+
return needsCallCount >= 3 || (faceCount >= 4 && needsCallCount / faceCount >= 0.5);
|
|
647
|
+
}
|
|
648
|
+
function hybridRouteNote(needsCall, faceCount) {
|
|
649
|
+
return (`本任务 ${needsCall.length}/${faceCount} 面需原子工具补齐(${needsCall.map((entry) => entry.id).join("、")}):` +
|
|
650
|
+
"intent 只声明可覆盖面(模型/字段/规则/流程模板);先按 intent schema 写 YAML,apply 后按 intentCoverage.needsCall 的命令逐面补;" +
|
|
651
|
+
"模型/字段也可先用 model-scaffold 一步建(见 firstCommands / atomicSupplement)。");
|
|
652
|
+
}
|
|
653
|
+
/** Hybrid first moves: intent shape + the model-scaffold door + the first two atomic faces. */
|
|
654
|
+
function hybridFirstCommands(needsCall) {
|
|
655
|
+
// 命令骨架不在此另写一份:model-scaffold 的单命令门来自 composer 注册表
|
|
656
|
+
// (与 next 的 composer 路由同一真相源),改模板只改注册表。
|
|
657
|
+
const scaffold = COMPOSER_ROUTES.find((entry) => entry.id === "model-scaffold")?.command ?? "omc model-scaffold --help";
|
|
658
|
+
return ["omc intent schema", scaffold, ...needsCall.slice(0, 2).map((entry) => entry.command)];
|
|
659
|
+
}
|
|
607
660
|
const COMPOSER_ROUTES = Object.freeze([
|
|
608
661
|
{
|
|
609
662
|
id: "model-purge",
|
|
@@ -800,6 +853,10 @@ function wholePackageRoute(registry, goal, index, hitCapabilities) {
|
|
|
800
853
|
// 运行数据是 intent 的**已知**未覆盖面(coverageNote 明说),不能因此把整包的
|
|
801
854
|
// 主路径翻成 atomic-only——它本就归 atomicSupplement 管。
|
|
802
855
|
const intentCovered = ordered.every((id) => id === "data" || (index.nodeById.get(id)?.intent.level ?? "none") !== "none");
|
|
856
|
+
// F9(0.8.17,探针 K):按本句点名的面算 needsCall;4/7 面要原子补齐时不再
|
|
857
|
+
// 宣称 intent 单主路径,降为 hybrid 并给混合起手。
|
|
858
|
+
const coverageNeedsCall = intentNeedsCallFor(goal);
|
|
859
|
+
const hybrid = intentCovered && needsHybridRoute(coverageNeedsCall.length, faces.length);
|
|
803
860
|
const atomicLadder = ordered.map((id) => {
|
|
804
861
|
const capability = routeById.get(id);
|
|
805
862
|
const recipe = bestRecipe(registry, id, capability.lane, goal) ?? defaultRecipeFor(registry, id, capability.lane);
|
|
@@ -819,7 +876,8 @@ function wholePackageRoute(registry, goal, index, hitCapabilities) {
|
|
|
819
876
|
mode: "whole-package",
|
|
820
877
|
match: { kind: "whole-package", ref: ordered.join("→"), capabilities: ordered },
|
|
821
878
|
route: {
|
|
822
|
-
primary: intentCovered ? "intent" : "atomic",
|
|
879
|
+
primary: intentCovered ? (hybrid ? "hybrid" : "intent") : "atomic",
|
|
880
|
+
...(intentCovered && hybrid ? { note: hybridRouteNote(coverageNeedsCall, faces.length) } : {}),
|
|
823
881
|
...(intentCovered ? {} : {
|
|
824
882
|
note: "命中能力中有 intent.level=none 的面,声明式 intent 不覆盖全部需求,走原子工具阶梯;intent 仅作可用能力补充提示",
|
|
825
883
|
ladder: atomicLadder,
|
|
@@ -828,7 +886,8 @@ function wholePackageRoute(registry, goal, index, hitCapabilities) {
|
|
|
828
886
|
// F5(0.8.11):主推 intent 时先交代「能/不能覆盖什么」,别让 agent 写完
|
|
829
887
|
// YAML 才发现半边需求要回落 omc call。atomic 主路径(intent.level=none)
|
|
830
888
|
// 不加——它没有推荐 intent,说明覆盖面只会误导。
|
|
831
|
-
|
|
889
|
+
// F9(0.8.17,探针 K):needsCall 只列本句点名的面(intentCoverageFor)。
|
|
890
|
+
...(intentCovered ? { intentCoverage: intentCoverageFor(goal) } : {}),
|
|
832
891
|
atomicSupplement: {
|
|
833
892
|
note: intentCovered
|
|
834
893
|
? "intent 已覆盖下列能力的创建;原子工具只用于 intent 未覆盖面(删除/生命周期/运行数据/精确 patch)——逐项见 intentCoverage.needsCall"
|
|
@@ -843,30 +902,38 @@ function wholePackageRoute(registry, goal, index, hitCapabilities) {
|
|
|
843
902
|
// the probe executed it 0 times in 184 calls; it rides its own field now.
|
|
844
903
|
readiness: DISCOVERY_AUTHORITY.readiness,
|
|
845
904
|
firstCommands: intentCovered
|
|
846
|
-
?
|
|
905
|
+
? hybrid
|
|
906
|
+
? hybridFirstCommands(coverageNeedsCall)
|
|
907
|
+
: ["omc intent schema", "omc help omc-playbook --section 采购申请"]
|
|
847
908
|
: atomicLadder.flatMap((step) => "firstCommand" in step ? [step.firstCommand] : step.recipe ? [step.recipe.command] : []).slice(0, 3),
|
|
848
909
|
write: true,
|
|
849
910
|
},
|
|
850
911
|
write: true,
|
|
851
912
|
intent: intentGuidance(),
|
|
852
|
-
firstAnswer: intentCovered &&
|
|
913
|
+
firstAnswer: intentCovered && hybrid
|
|
853
914
|
? {
|
|
854
915
|
state: "ready",
|
|
855
916
|
action: "omc intent schema",
|
|
856
|
-
why:
|
|
917
|
+
why: `整包但有 ${coverageNeedsCall.length}/${faces.length} 面 intent 不覆盖:先用 intent 声明模型/字段/规则/流程模板(可覆盖面),模型/字段可直接用 model-scaffold 一步建;apply 后按 intentCoverage.needsCall 的命令补齐布局/排序/运行面`,
|
|
857
918
|
}
|
|
858
|
-
: intentCovered
|
|
919
|
+
: intentCovered && greenfield
|
|
859
920
|
? {
|
|
860
921
|
state: "ready",
|
|
861
922
|
action: "omc intent schema",
|
|
862
|
-
why: "
|
|
923
|
+
why: "从零整包:模型还不存在——先看 intent 键位/示例,再按 starter 写 YAML(validate → plan → apply);不要先问已有 schemaCode",
|
|
863
924
|
}
|
|
864
|
-
:
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
925
|
+
: intentCovered
|
|
926
|
+
? {
|
|
927
|
+
state: "ready",
|
|
928
|
+
action: "omc intent schema",
|
|
929
|
+
why: "整包需求走声明式意图:先看 intent YAML 的键位与可运行示例,再按 starter 写文件(validate → plan → apply)",
|
|
930
|
+
}
|
|
931
|
+
: {
|
|
932
|
+
state: "needs-input",
|
|
933
|
+
action: atomicLadder.find((step) => "firstCommand" in step)?.firstCommand,
|
|
934
|
+
question: "第一步要操作哪个对象?给我 schemaCode(或模型业务名,我列清单核对)",
|
|
935
|
+
why: "命中能力包含 intent 未覆盖面,不能把整包需求主推到声明式 intent;先按原子工具阶梯执行",
|
|
936
|
+
},
|
|
870
937
|
};
|
|
871
938
|
}
|
|
872
939
|
/** A configuration read-back ask that names no capability ("给我一份现状说明"). */
|
|
@@ -1565,6 +1632,9 @@ function goalRouteInner(registry, goal) {
|
|
|
1565
1632
|
// 0.8.9 F1:指针里的 firstCommand 以前只看 `step.firstCommand`,命中配方时
|
|
1566
1633
|
// 仍给 `commands --lane`(正是探针被绕回发现面的那条路)。有配方就用配方命令。
|
|
1567
1634
|
const atomicSupplement = { note: "intent 已覆盖这些能力的创建;原子工具只用于 intent 未覆盖面:", ladder: ladder.map((step) => ({ capability: step.capability, lane: step.lane, firstCommand: step.recipe?.command ?? step.firstCommand ?? `omc commands --json --compact --lane ${step.lane}` })) };
|
|
1635
|
+
// F9(0.8.17,探针 K):整包阶梯同样按本句点名的未覆盖面判 hybrid。
|
|
1636
|
+
const coverageNeedsCall = intentNeedsCallFor(goal);
|
|
1637
|
+
const hybrid = whole && intentCoveredOf(ordered) && needsHybridRoute(coverageNeedsCall.length, ordered.length);
|
|
1568
1638
|
return {
|
|
1569
1639
|
status: "ok",
|
|
1570
1640
|
goal,
|
|
@@ -1573,7 +1643,9 @@ function goalRouteInner(registry, goal) {
|
|
|
1573
1643
|
match: { kind: readish ? "read-ladder" : "ladder", ref: `${routeOrder.join("→")}${routeOrder.includes("businessrule") && /累加|联动|审计|规则触发|自动累加|自动回写/.test(goal) ? "(规则面不在本阶梯)" : ""}`, capabilities: routeOrder },
|
|
1574
1644
|
route: {
|
|
1575
1645
|
...(whole ? (intentCoveredOf(ordered)
|
|
1576
|
-
?
|
|
1646
|
+
? hybrid
|
|
1647
|
+
? { primary: "hybrid", note: hybridRouteNote(coverageNeedsCall, ordered.length), intentCoverage: intentCoverageFor(goal), atomicSupplement }
|
|
1648
|
+
: { primary: "intent", intentCoverage: intentCoverageFor(goal), atomicSupplement }
|
|
1577
1649
|
: { primary: "atomic", note: "命中能力中有 intent.level=none 的面,声明式 intent 不覆盖全部需求,走原子工具阶梯", ladder }) : { ladder }),
|
|
1578
1650
|
// r28e F2(真机复现 2026-11-05):`next "建表单布局、在线JS、表单按钮"`
|
|
1579
1651
|
// 命中的是 model→form→listview→businessrule→onlinejs 的整包 ladder,
|
|
@@ -1601,7 +1673,9 @@ function goalRouteInner(registry, goal) {
|
|
|
1601
1673
|
// `omc intent schema`。此前这里只挑 ladder 里**任意一条**配方贴上来;
|
|
1602
1674
|
// 当只有 businessrule 有配方时,表单/视图目标会收到 rule.save 的样例,
|
|
1603
1675
|
// 与首答自相矛盾(且必然跑题)。整包就统一给 intent。
|
|
1604
|
-
|
|
1676
|
+
// F9(0.8.17,探针 K):hybrid 起手 = intent 键位 + model-scaffold 门 +
|
|
1677
|
+
// 前两个未覆盖面的原子命令(不再只给 intent schema 让你一条路走到黑)。
|
|
1678
|
+
...(whole ? (hybrid ? hybridFirstCommands(coverageNeedsCall) : ["omc intent schema"]) : recipeCommands),
|
|
1605
1679
|
// r13 #3: `capability workflow --executable` is 23 KB and still did not
|
|
1606
1680
|
// answer "how do I submit an approval" — the answer is a data.submit
|
|
1607
1681
|
// recipe, which lives in a DIFFERENT capability. When the goal is about
|
|
@@ -1615,7 +1689,9 @@ function goalRouteInner(registry, goal) {
|
|
|
1615
1689
|
},
|
|
1616
1690
|
write,
|
|
1617
1691
|
...(whole
|
|
1618
|
-
?
|
|
1692
|
+
? hybrid
|
|
1693
|
+
? { intent: intentGuidance(), firstAnswer: { state: "ready", action: "omc intent schema", why: `整包但有 ${coverageNeedsCall.length}/${ordered.length} 面 intent 不覆盖:先用 intent 声明可覆盖面(模型/字段/规则/流程模板),模型/字段也可用 model-scaffold 一步建;apply 后按 intentCoverage.needsCall 逐面补布局/排序/运行` } }
|
|
1694
|
+
: { intent: intentGuidance(), firstAnswer: { state: "ready", action: "omc intent schema", why: "整包需求走声明式意图:先看 intent 的键位与示例,再按 starter 写文件" } }
|
|
1619
1695
|
: readish
|
|
1620
1696
|
// A read ask about the model inventory itself is answered BY the
|
|
1621
1697
|
// inventory call; any other read needs the target object code first.
|
|
@@ -1671,7 +1747,7 @@ function goalRouteInner(registry, goal) {
|
|
|
1671
1747
|
capability: capabilityId,
|
|
1672
1748
|
lane: route.lane,
|
|
1673
1749
|
...(whole ? (intentCoveredOf([capabilityId])
|
|
1674
|
-
? { primary: "intent", intentCoverage:
|
|
1750
|
+
? { primary: "intent", intentCoverage: intentCoverageFor(goal) }
|
|
1675
1751
|
: { primary: "atomic", note: "该能力无声明式面(intent.level=none),走原子工具" }) : {}),
|
|
1676
1752
|
...(readish ? { readTools: readToolsInLane(registry, route.lane) } : { tools: route.tools }),
|
|
1677
1753
|
// r66 ②(c-F4):有依赖顺序的能力(report)显式给 order,修掉 tools 键序
|
package/dist/human-summary.js
CHANGED
|
@@ -391,7 +391,9 @@ function phraseOf(tool, args, outcome) {
|
|
|
391
391
|
case "listview.create":
|
|
392
392
|
return `创建列表视图 ${stringArg(args, "name") ?? ""}(${stringArg(args, "code") ?? schemaCode ?? "?"},模型 ${schemaCode ?? "?"})`;
|
|
393
393
|
case "listview.configure": {
|
|
394
|
-
|
|
394
|
+
// F2(0.8.17 探针 K 复核):同一请求列去重后再展示,`d1,d1` 只列一次。
|
|
395
|
+
const requestedCodes = Array.isArray(args.fieldCodes) ? [...new Set(args.fieldCodes.map(String))] : [];
|
|
396
|
+
const codes = requestedCodes.join("、");
|
|
395
397
|
const sections = ["sorts", "conditions", "actions", "buttons", "presentation", "options", "presentationType", "gantt", "queryLayer", "multiTableHeaderConfig"].filter((key) => args[key] !== undefined);
|
|
396
398
|
// F9(w44,2026-11-26 真机):视图固定条件只在门户运行面生效,REST 的
|
|
397
399
|
// data.list --queryCode 不应用。此前只有 JSON 回执尾部的
|
|
@@ -427,8 +429,24 @@ function phraseOf(tool, args, outcome) {
|
|
|
427
429
|
const systemColumnsAdded = Array.isArray(outcome?.readback?.systemColumnsAdded)
|
|
428
430
|
? (outcome.readback.systemColumnsAdded.map(String))
|
|
429
431
|
: [];
|
|
432
|
+
// F2(0.8.17 探针 K):真机 4 列请求回读 8 列(4 业务 + 4 平台系统列),
|
|
433
|
+
// 旧摘要只写「列 repairNo、device、amount、status」再追加系统列,人读起来
|
|
434
|
+
// 仍像 4 列。这里把实际列数点明:总列 = 业务列 + 平台系统列。
|
|
435
|
+
const readbackColumnCount = Array.isArray(outcome?.readback?.columns)
|
|
436
|
+
? outcome.readback.columns.length
|
|
437
|
+
: undefined;
|
|
438
|
+
const requestedColumnCount = requestedCodes.length;
|
|
439
|
+
const businessColumnCount = readbackColumnCount !== undefined ? Math.max(0, readbackColumnCount - systemColumnsAdded.length) : requestedColumnCount;
|
|
440
|
+
const totalColumnCount = readbackColumnCount ?? businessColumnCount + systemColumnsAdded.length;
|
|
441
|
+
// 只有「回读里的非系统列」恰好等于本次请求列时才敢写「业务 N 列:请求列」;
|
|
442
|
+
// 增量配置会保留既有业务列(a1,a2 后再配 b1,b2,b3),此时收益句若沿用
|
|
443
|
+
// business 计数会建议「要精确 5 列」——照做就丢 a1/a2。指引必须用本次请求
|
|
444
|
+
// 列数(replaceColumns+fieldCodes 的真实结果),并如实标「本次请求 N 列」。
|
|
445
|
+
const requestedColumnClause = businessColumnCount === requestedColumnCount && codes
|
|
446
|
+
? `业务 ${businessColumnCount} 列:${codes}`
|
|
447
|
+
: `本次请求 ${requestedColumnCount} 列${codes ? `:${codes}` : ""}`;
|
|
430
448
|
const systemColumnsLine = systemColumnsAdded.length > 0
|
|
431
|
-
?
|
|
449
|
+
? `;当前实际 ${totalColumnCount} 列(${requestedColumnClause} + 平台系统 ${systemColumnsAdded.length} 列):平台额外保留系统列 ${systemColumnsAdded.join("、")}(未传 replaceColumns/hideDefaultSystemFields);要精确 ${requestedColumnCount} 列请加 replaceColumns:true + hideDefaultSystemFields:true`
|
|
432
450
|
: "";
|
|
433
451
|
return `配置列表视图 ${stringArg(args, "code") ?? schemaCode ?? "?"}(模型 ${schemaCode ?? "?"}):列 ${codes || "(未变)"}${sections.length > 0 ? `;同时配置 ${sections.join("、")}` : ""}${systemColumnsLine}${actionsClearedLine}${conditionRuntimeLine}`;
|
|
434
452
|
}
|
package/dist/lanes/datarule.js
CHANGED
|
@@ -980,6 +980,9 @@ export function registerDataRuleLane(tools) {
|
|
|
980
980
|
tools,
|
|
981
981
|
name: "datarule.create",
|
|
982
982
|
search: { intents: ["字段级校验", "给字段加校验", "给金额字段加校验", "校验规则", "提交校验", "字段校验", "金额校验", "必填才能提交", "必须填", "不填不让提交", "必须附件", "不然就提交不了"] },
|
|
983
|
+
nestedParamHints: {
|
|
984
|
+
conditions: 'checkType:2 提交校验的条件串:`{字段} 操作符 右值`。常量右值用 `{"valueType":"custom","value":0}`(JSON 值对象;平台也接受裸字面量,如 `{qty} 大于 100`;例 `{amount} 大于 {"valueType":"custom","value":0}`);跨字段右值才用 `{"valueType":"currentModel","value":"<字段code>"}`。完整最小例见 --example submit-field-vs-constant',
|
|
985
|
+
},
|
|
983
986
|
lane: DATARULE_LANE,
|
|
984
987
|
scope: DATARULE_TOOLS["datarule.create"].scope,
|
|
985
988
|
description: DATARULE_TOOLS["datarule.create"].description,
|