@stalfh233/omc-cli 0.6.66 → 0.6.68
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 +12 -1
- package/dist/cli-contract.js +11 -0
- package/dist/cli.js +64 -5
- package/dist/goal-routes.js +22 -5
- package/dist/graph.js +231 -28
- package/dist/lanes/businessrule-contract.js +5 -0
- package/dist/lanes/businessrule.js +148 -30
- package/dist/lanes/field.js +33 -2
- package/dist/lanes/list-view-contract.js +2 -2
- package/dist/lanes/list-view.js +72 -10
- package/dist/lanes/rule-graph.js +2 -2
- package/dist/lanes/runtime-data.js +8 -3
- package/dist/mcp-graph.js +56 -27
- package/dist/read-shapes.js +14 -0
- package/dist/rule-support.js +118 -79
- package/dist/tool-types.js +11 -0
- package/dist/write.js +6 -0
- package/package.json +3 -3
- package/skills/omc-start-here.md +1 -1
|
@@ -5,7 +5,7 @@ import { governedRead } from "../read.js";
|
|
|
5
5
|
import { writeTool } from "../write.js";
|
|
6
6
|
import { decodeJsonColumn, JSON_COLUMN_NULL_COALESCE } from "../json-column.js";
|
|
7
7
|
import { applicationResolutionOf, applicationScopeHint, flattenTreeRows, resolveApplicationScope, suggestModelNames } from "../support.js";
|
|
8
|
-
import { executeRuleSaveWrite, ruleNodeGraphArg } from "../rule-support.js";
|
|
8
|
+
import { assertRuleNamePlatformAcceptable, executeRuleSaveWrite, lintRuleGraphForWrite, ruleNodeGraphArg } from "../rule-support.js";
|
|
9
9
|
import { defineTool, ToolInputError, ToolRefusalError } from "../tool-types.js";
|
|
10
10
|
import { resolveRuleRowId } from "../identity.js";
|
|
11
11
|
import { wireCall, wireCallWith404Fallback, wireRows } from "../wire.js";
|
|
@@ -48,6 +48,22 @@ function businessRuleRollbackSpec(toolName) {
|
|
|
48
48
|
*/
|
|
49
49
|
const RULE_NODE_LAYOUT_KEYS = ["x", "y", "width", "height"];
|
|
50
50
|
const RULE_ROUTE_LAYOUT_KEYS = ["points"];
|
|
51
|
+
/**
|
|
52
|
+
* r73 #2(GitLab #40,8.6.41 实测):`rule.get` 读面显式声明「整图原样回存是否
|
|
53
|
+
* 可行」(roundTrip)。平台版本形状有差异——8.6.41 设计器建的 CREATE 节点可能
|
|
54
|
+
* 只有 originatorValueType 没有 originatorValue,把 rule.get 的 nodes/routes 原样
|
|
55
|
+
* 喂 rule.save 会被 rule-graph-create-originator-value 拒。hazard → gap,每个
|
|
56
|
+
* gap 带一句可执行修法(不是泛泛的「请修正」);映射不全时回通用兜底。
|
|
57
|
+
*/
|
|
58
|
+
const RULE_ROUND_TRIP_FIXES = Object.freeze({
|
|
59
|
+
"rule-graph-create-originator-value": 'CREATE 节点补 originatorValue(DYNAMIC=人员字段 code;FIXED=用户对象数组 JSON 串,如 [{"id":"<userId>","name":"<名>"}]),或不要整图回存:用 rule.node.update 只 patch 目标节点',
|
|
60
|
+
"rule-graph-create-originator": "CREATE 节点补 originatorValueType:FIXED(originatorValue=用户对象数组 JSON 串)或 DYNAMIC(originatorValue=人员字段 code)",
|
|
61
|
+
"rule-graph-create-workflow-code": "补 targetWorkflowCode=目标模型的已发布流程 code,或去掉 startWorkflow",
|
|
62
|
+
"rule-graph-child-trigger-condition-type": "补 childTriggerConditionType:ADD/MODIFY/DELETE 之一(子表触发数据范围:新增/修改/删除)",
|
|
63
|
+
"rule-graph-create-mapping-missing": "补 dataActions 字段映射(execFormMapping 只是展示开关不是映射来源),或不要整图回存:用 rule.node.update 只 patch 目标节点",
|
|
64
|
+
});
|
|
65
|
+
const roundTripFixOf = (code) => RULE_ROUND_TRIP_FIXES[code] ?? "按 message 修正该节点后重存;或不要整图回存:用 rule.node.update 只 patch 目标节点";
|
|
66
|
+
const RULE_ROUND_TRIP_HINT = "整图原样回存会被这些 hazard 拒(rule.save);备份/恢复请用 rule.node.update 单节点 patch,或先补 gaps。**平台版本差异**:部分版本的读面不回传 CREATE 节点的 originatorValue(8.6.41 实测),本工具不猜值。";
|
|
51
67
|
function projectRuleGraph(nodes, routes, full) {
|
|
52
68
|
if (full)
|
|
53
69
|
return { nodes, routes };
|
|
@@ -233,12 +249,58 @@ export function registerBusinessRuleLane(tools) {
|
|
|
233
249
|
// "found" 0 models → false zero-hit), so walk the application tree.
|
|
234
250
|
// The implicit scope is echoed: a zero-hit scan over 1-of-N applications
|
|
235
251
|
// must not read as "nothing references this" tenant-wide.
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
252
|
+
//
|
|
253
|
+
// r73 #3(GitLab #40,8.6.41 实测):`resolveApplicationScope` 在部分版本
|
|
254
|
+
// 解析到**空应用树** → scoped=[] → 扫描循环零次 → ok + matches:[]。空
|
|
255
|
+
// matches 会被读成「没有任何引用,可安全删除」。空扫描(scanned.models
|
|
256
|
+
// ===0)必须 fail closed:refused + applicationResolution(调用方要能一眼
|
|
257
|
+
// 看见「我扫了哪个应用」),而不是回一个危险的 ok 空集。
|
|
258
|
+
const treeOf = async (scope) => {
|
|
259
|
+
const tree = wireRows((await wireCall(session, { path: ENDPOINTS.applicationTree, query: { appCode: scope.code } })).data);
|
|
260
|
+
return flattenTreeRows(tree).filter((row) => row.type === "BizModel" && typeof row.code === "string" && row.code !== "");
|
|
261
|
+
};
|
|
262
|
+
const scanMode = args.schemaCodes === undefined ? "application" : "schemaCodes";
|
|
263
|
+
let scope;
|
|
264
|
+
let scoped = [];
|
|
265
|
+
// 应用树模型全集——显式 schemaCodes 的交叉核对用(树读不到 → 无法核对 → 跳过)
|
|
266
|
+
let treeModelCodes;
|
|
267
|
+
if (args.schemaCodes === undefined) {
|
|
268
|
+
scope = await resolveApplicationScope(session, undefined);
|
|
269
|
+
scoped = (await treeOf(scope)).map((row) => String(row.code));
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
scoped = Array.isArray(args.schemaCodes) ? args.schemaCodes : [args.schemaCodes];
|
|
273
|
+
try {
|
|
274
|
+
scope = await resolveApplicationScope(session, undefined);
|
|
275
|
+
treeModelCodes = new Set((await treeOf(scope)).map((row) => String(row.code)));
|
|
276
|
+
}
|
|
277
|
+
catch {
|
|
278
|
+
scope = undefined; // 应用面读失败:交叉核对不可用,按原行为扫描
|
|
279
|
+
}
|
|
280
|
+
if (treeModelCodes !== undefined && treeModelCodes.size > 0 && !scoped.some((code) => treeModelCodes.has(code))) {
|
|
281
|
+
// 显式 schemaCodes 全部不存在(应用树交叉核对)——空集拒绝而不是空 ok。
|
|
282
|
+
throw new ToolRefusalError({
|
|
283
|
+
status: "refused",
|
|
284
|
+
blocker: "references-scan-empty",
|
|
285
|
+
message: `扫描范围为 0 个模型——本次没有扫描任何东西,空 matches 不代表「无引用」;通常是 app scope 解析为空(8.6.41 已知)或 schemaCodes 传了不存在的模型。本次 schemaCodes 传入 ${scoped.length} 个模型,应用 ${scope?.code ?? "?"} 的模型树(${treeModelCodes.size} 个模型)里一个都不存在`,
|
|
286
|
+
applicationResolution: scope !== undefined
|
|
287
|
+
? { ...applicationResolutionOf(scope), mode: scanMode, models: 0, schemaCodesGiven: scoped.length, treeModels: treeModelCodes.size }
|
|
288
|
+
: { code: null, source: "unresolved", mode: scanMode, models: 0, schemaCodesGiven: scoped.length },
|
|
289
|
+
nextCommand: `omc call rule.references --args '{"kind":"${args.kind}","code":"${args.code}","schemaCodes":["<模型code>",...]}'(显式指定扫描范围)`,
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
if (scoped.length === 0) {
|
|
294
|
+
throw new ToolRefusalError({
|
|
295
|
+
status: "refused",
|
|
296
|
+
blocker: "references-scan-empty",
|
|
297
|
+
message: "扫描范围为 0 个模型——本次没有扫描任何东西,空 matches 不代表「无引用」;通常是 app scope 解析为空(8.6.41 已知)或 schemaCodes 传了不存在的模型",
|
|
298
|
+
applicationResolution: scope !== undefined
|
|
299
|
+
? { ...applicationResolutionOf(scope), mode: scanMode, models: 0 }
|
|
300
|
+
: { code: null, source: "unresolved", mode: scanMode, models: 0 },
|
|
301
|
+
nextCommand: `omc call rule.references --args '{"kind":"${args.kind}","code":"${args.code}","schemaCodes":["<模型code>",...]}'(显式指定扫描范围)`,
|
|
302
|
+
});
|
|
303
|
+
}
|
|
242
304
|
const wanted = args.code;
|
|
243
305
|
const matches = [];
|
|
244
306
|
let scannedRules = 0;
|
|
@@ -312,15 +374,20 @@ export function registerBusinessRuleLane(tools) {
|
|
|
312
374
|
notScanned: ["datarule", "form", "workflow.permissions", "workflow.bindings", "onlinejs", "listview"],
|
|
313
375
|
note: "matches:[] 只代表 businessrule 面零命中;datarule/form/流程权限/视图等未扫描(离线 graph references 覆盖更广,见其 coverage),不可据此判定可安全删除",
|
|
314
376
|
},
|
|
315
|
-
|
|
377
|
+
// r73 #3:app-scope 路径回显 applicationResolution(含 mode/models:扫了
|
|
378
|
+
// 哪个应用、共几个模型)。显式 schemaCodes 路径维持原形状(无
|
|
379
|
+
// applicationResolution/hint——显式范围自带出处,provenance 契约不变)。
|
|
380
|
+
...(args.schemaCodes === undefined && scope !== undefined
|
|
381
|
+
? { applicationResolution: { ...applicationResolutionOf(scope), mode: scanMode, models: scoped.length } }
|
|
382
|
+
: {}),
|
|
316
383
|
...(matches.length === 0
|
|
317
384
|
? {
|
|
318
385
|
note: "零命中=" +
|
|
319
386
|
(args.schemaCodes !== undefined
|
|
320
387
|
? `仅扫描了 schemaCodes 收窄的 ${scoped.length} 个模型(${scoped.slice(0, 5).join(", ")}${scoped.length > 5 ? "…" : ""})——引用常发生在**其他**模型上;要全平台结论请去掉 schemaCodes`
|
|
321
388
|
: "全平台没有规则引用它") +
|
|
322
|
-
"。范围:service→methodMapping.serviceCode;model→targetObjectCode/methodMapping.schemaCode;field→dataActions.targetDataItem/映射 bizCode(不含条件叶子与 datarule
|
|
323
|
-
...(scope !== undefined ? { hint: applicationScopeHint(scope, "引用") } : {}),
|
|
389
|
+
"。范围:service→methodMapping.serviceCode;model→targetObjectCode/methodMapping.schemaCode;field→dataActions.targetDataItem/映射 bizCode(不含条件叶子与 datarule——条件叶子已入 graph 索引 rule.condition 边,条件引用先 `omc graph pull` 后 `graph references field`)。本工具是在线单点扫描;要离线毫秒级复询、字段级影响面或两跳爆炸半径,先 `omc graph pull --env <env>` 再 `omc graph references|impact <kind> <code>`",
|
|
390
|
+
...(args.schemaCodes === undefined && scope !== undefined ? { hint: applicationScopeHint(scope, "引用") } : {}),
|
|
324
391
|
}
|
|
325
392
|
: {
|
|
326
393
|
// r31(2026-10-31):影响评估场景 agent 已路由到本工具——在必经之路
|
|
@@ -419,6 +486,7 @@ export function registerBusinessRuleLane(tools) {
|
|
|
419
486
|
// dry-lint,把"已启用但运行时会被静默跳过/UI 独有算子/选项 key 撞车"
|
|
420
487
|
// 等语义隐患以 semanticFindings 暴露——"可读不可验"到此为止。
|
|
421
488
|
let semanticFindings;
|
|
489
|
+
let roundTrip;
|
|
422
490
|
try {
|
|
423
491
|
const { validateRuleNodeGraph } = await import("./rule-graph.js");
|
|
424
492
|
// r45 I5 误报根因:体检重建图只带 nodes/routes,把行级 schedulerSetting
|
|
@@ -437,6 +505,23 @@ export function registerBusinessRuleLane(tools) {
|
|
|
437
505
|
message: finding.message,
|
|
438
506
|
}));
|
|
439
507
|
}
|
|
508
|
+
// r73 #2(GitLab #40,8.6.41 实测):roundTrip = 整图原样回存的显式判定。
|
|
509
|
+
// safe:true 也是显式键(不是缺键)——agent 要能区分「判定过、可回存」与
|
|
510
|
+
// 「没判定」。与 full/keys 选择器无关:它是回执顶层键,与 nodes 并列。
|
|
511
|
+
const hazards = findings.filter((finding) => finding.severity !== "warning");
|
|
512
|
+
roundTrip = hazards.length === 0
|
|
513
|
+
? { safe: true }
|
|
514
|
+
: {
|
|
515
|
+
safe: false,
|
|
516
|
+
gaps: hazards.map((finding) => ({
|
|
517
|
+
code: finding.code,
|
|
518
|
+
...(finding.nodeCode !== undefined ? { nodeCode: finding.nodeCode } : {}),
|
|
519
|
+
...(finding.key !== undefined ? { key: finding.key } : {}),
|
|
520
|
+
message: finding.message,
|
|
521
|
+
fix: roundTripFixOf(finding.code),
|
|
522
|
+
})),
|
|
523
|
+
hint: RULE_ROUND_TRIP_HINT,
|
|
524
|
+
};
|
|
440
525
|
}
|
|
441
526
|
catch {
|
|
442
527
|
// 体检失败不破坏读回本身
|
|
@@ -468,6 +553,8 @@ export function registerBusinessRuleLane(tools) {
|
|
|
468
553
|
schedulerSetting: parse(record.schedulerSetting),
|
|
469
554
|
renderCompat,
|
|
470
555
|
...(semanticFindings ? { semanticFindings } : {}),
|
|
556
|
+
// r73 #2:roundTrip 是显式判定键(safe:true 也在),不是缺键
|
|
557
|
+
...(roundTrip ? { roundTrip } : {}),
|
|
471
558
|
...(staleRow ? { staleRow, effectiveId, staleRowMessage, staleId: true, latestId: effectiveId, note: staleNote } : {}),
|
|
472
559
|
};
|
|
473
560
|
if (args.withRuntime === true) {
|
|
@@ -521,6 +608,9 @@ export function registerBusinessRuleLane(tools) {
|
|
|
521
608
|
? payload.schedulerSetting.dataSourceType
|
|
522
609
|
: undefined,
|
|
523
610
|
...(payload.statusLag ? { statusLag: payload.statusLag, statusNote: payload.statusNote } : {}),
|
|
611
|
+
// r73 #2:summary 面同样带 roundTrip 显式判定(不内联正文也要能回答
|
|
612
|
+
// 「这张图能不能原样回存」)。
|
|
613
|
+
...(roundTrip ? { roundTrip } : {}),
|
|
524
614
|
// #39 摩擦 E:summary 面也要带 stale 提示——持旧 id 的调用方常只看
|
|
525
615
|
// summary,漏掉 stale 会把旧图当成「改了没生效」。
|
|
526
616
|
...(staleRow ? { staleId: true, latestId: effectiveId, note: staleNote } : {}),
|
|
@@ -559,6 +649,33 @@ export function registerBusinessRuleLane(tools) {
|
|
|
559
649
|
// (so every graph gate + readback is identical). Platform constraints honoured:
|
|
560
650
|
// `nodeCode`/`nodeType` are immutable (routes reference nodeCode; the platform
|
|
561
651
|
// cannot retype a node), so the patch may not change them.
|
|
652
|
+
//
|
|
653
|
+
// r73 #1(GitLab #40,8.6.41 实测):execute 与 dryRunPayload 共用同一个
|
|
654
|
+
// 读法/合并法(loadRuleNodePatchGraph)——dry-run 读存量行 → 浅合并 patch →
|
|
655
|
+
// 全图 lint(lintRuleGraphForWrite,与真写同门)。读失败(规则/节点不存在、
|
|
656
|
+
// 不可变键)按 execute 同款 refusal 抛出,绝不静默放行。
|
|
657
|
+
const loadRuleNodePatchGraph = async (session, args) => {
|
|
658
|
+
const id = await resolveRuleRowId(session, args.schemaCode, args.ruleCode);
|
|
659
|
+
if (!id)
|
|
660
|
+
throw new ToolRefusalError({ status: "refused", blocker: "rule-absent", message: `规则 ${args.schemaCode}.${args.ruleCode} 不存在;拒绝 node patch` });
|
|
661
|
+
const record = (await wireCall(session, { path: ENDPOINTS.businessRuleGet, query: { id } })).data;
|
|
662
|
+
if (!record)
|
|
663
|
+
throw new ToolRefusalError({ status: "refused", blocker: "rule-absent", message: `规则 ${args.schemaCode}.${args.ruleCode}(id ${id})读回为空` });
|
|
664
|
+
for (const key of ["nodeCode", "nodeType"])
|
|
665
|
+
if (key in args.patch)
|
|
666
|
+
throw new ToolRefusalError({ status: "refused", blocker: "rule-node-immutable-key", message: `node patch 不允许改 ${key}(平台按 nodeCode 连接路由、节点类型不可变);要改名/改型请整图 rule.save` });
|
|
667
|
+
// node/route are SEPARATE JSON-string columns (see rule.get): `node` is the
|
|
668
|
+
// nodes array, `route` the routes array — not one {nodes,routes} object.
|
|
669
|
+
const nodes = decodeJsonColumn(record.node, JSON_COLUMN_NULL_COALESCE);
|
|
670
|
+
const routes = decodeJsonColumn(record.route, JSON_COLUMN_NULL_COALESCE);
|
|
671
|
+
const nodeList = Array.isArray(nodes) ? nodes : [];
|
|
672
|
+
const target = nodeList.find((node) => node.nodeCode === args.nodeCode);
|
|
673
|
+
if (!target)
|
|
674
|
+
throw new ToolRefusalError({ status: "refused", blocker: "rule-node-absent", message: `现有图中没有 nodeCode=${args.nodeCode};用 rule.get schemaCode+ruleCode 查看 nodeCode` });
|
|
675
|
+
const mergedNode = { ...target, ...args.patch };
|
|
676
|
+
const mergedGraph = { nodes: nodeList.map((node) => (node.nodeCode === args.nodeCode ? mergedNode : node)), ...(Array.isArray(routes) ? { routes } : {}) };
|
|
677
|
+
return { id, record, mergedGraph, ruleName: String(record.name ?? args.ruleCode) };
|
|
678
|
+
};
|
|
562
679
|
writeTool({
|
|
563
680
|
tools,
|
|
564
681
|
name: "rule.node.update",
|
|
@@ -575,26 +692,27 @@ export function registerBusinessRuleLane(tools) {
|
|
|
575
692
|
customTrigger: z.boolean().optional(),
|
|
576
693
|
},
|
|
577
694
|
execute: async (session, args) => {
|
|
578
|
-
const
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
//
|
|
588
|
-
//
|
|
589
|
-
|
|
590
|
-
const
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
695
|
+
const base = await loadRuleNodePatchGraph(session, args);
|
|
696
|
+
return executeRuleSaveWrite(session, { schemaCode: args.schemaCode, ruleCode: args.ruleCode, name: base.ruleName, nodeGraph: base.mergedGraph, ...(args.publish === true ? { publish: true } : {}), ...(args.customTrigger === true ? { customTrigger: true } : {}) });
|
|
697
|
+
},
|
|
698
|
+
// r73 #1(GitLab #40):dry-run 此前走 write.ts 通用 dry-run(只出 plan),不跑
|
|
699
|
+
// 图 lint——非法 patch(如 CREATE 节点 originatorValue 置空)dry-run 过、真写
|
|
700
|
+
// policy-refused。dryRunPayload 与真写共用同一读法与同一 lint:dry-run 回
|
|
701
|
+
// 「能写/不能写」的同一答案,而不是只报 wouldChange。
|
|
702
|
+
dryRunPayload: async (session, args) => {
|
|
703
|
+
const base = await loadRuleNodePatchGraph(session, args);
|
|
704
|
+
// name 校验与真写同源(真写在 executeRuleSaveWrite 里再跑一次同一函数;
|
|
705
|
+
// name 取存量行,预置触发行在函数内部跳过)。
|
|
706
|
+
assertRuleNamePlatformAcceptable(args.ruleCode, base.ruleName);
|
|
707
|
+
const linted = await lintRuleGraphForWrite(session, { schemaCode: args.schemaCode, ruleCode: args.ruleCode, nodeGraph: base.mergedGraph, ...(args.customTrigger === true ? { customTrigger: true } : {}) }, { validationRefusalMessage: "nodeGraph 未过出门前校验(dry lint,与真写同门);按 validation 逐项修正" });
|
|
708
|
+
return {
|
|
709
|
+
nodeCode: args.nodeCode,
|
|
710
|
+
patchedKeys: Object.keys(args.patch),
|
|
711
|
+
// 本次 dry-run 覆盖的是**全图** lint(patch 合并进存量图后整图过门),
|
|
712
|
+
// 不是只验 patch 本身。
|
|
713
|
+
lintScope: "fullGraph",
|
|
714
|
+
validation: linted.blockers,
|
|
715
|
+
};
|
|
598
716
|
},
|
|
599
717
|
rollback: businessRuleRollbackSpec("rule.node.update"),
|
|
600
718
|
});
|
package/dist/lanes/field.js
CHANGED
|
@@ -241,6 +241,24 @@ function isSystemFieldCode(code) {
|
|
|
241
241
|
const value = String(code ?? "");
|
|
242
242
|
return SYSTEM_FIELD_CODES.has(value) || value === "parentId" || value === "sortKey";
|
|
243
243
|
}
|
|
244
|
+
/**
|
|
245
|
+
* 线上 #40 第 8 条(2026-11-17):field.list 只有 code/type/typeName/name,
|
|
246
|
+
* 无法判断字段何时被删除/改名(探针只能用业务数据的时间反推)。
|
|
247
|
+
* 平台读面(bizproperty/list)在不同版本带回的时间列名不一致——
|
|
248
|
+
* 有就逐行透传(createdTime/modifiedTime 等),没有就不塞键(缺键≠null),
|
|
249
|
+
* 由回执 hint 说明本环境下「没有」而不是让 agent 猜。线上 #40 的 8.6.41 实测
|
|
250
|
+
* 不回时间列;1.1.25 真机实测**回 createdTime**(此前是 OMC 投影把键丢了,
|
|
251
|
+
* 不是平台没有)——所以两个方向都必须实现:有则透传、无则说明。
|
|
252
|
+
*/
|
|
253
|
+
const FIELD_TIMESTAMP_KEYS = ["createdTime", "modifiedTime", "createTime", "updateTime", "createdAt", "updatedAt", "gmtCreate", "gmtModified"];
|
|
254
|
+
function pickFieldTimestamps(row) {
|
|
255
|
+
const picked = {};
|
|
256
|
+
for (const key of FIELD_TIMESTAMP_KEYS) {
|
|
257
|
+
if (row[key] !== undefined && row[key] !== null)
|
|
258
|
+
picked[key] = row[key];
|
|
259
|
+
}
|
|
260
|
+
return picked;
|
|
261
|
+
}
|
|
244
262
|
/**
|
|
245
263
|
* r17 (2026-10-25, live + decompiled A/B): a FORMULA field CANNOT aggregate its
|
|
246
264
|
* own model's child table. `BizPropertyManagerImpl.publishFormula` rewrites
|
|
@@ -354,6 +372,8 @@ export function registerFieldLane(tools) {
|
|
|
354
372
|
const system = isSystemFieldCode(fieldCode);
|
|
355
373
|
return {
|
|
356
374
|
code: fieldCode,
|
|
375
|
+
// #40-8:平台带回的字段时间戳逐行透传(键存在才给)。
|
|
376
|
+
...pickFieldTimestamps(row),
|
|
357
377
|
name: row.name,
|
|
358
378
|
// r61 a-F9:行级发布态(双面比对)——true=已出现在发布面;false=仅草稿。
|
|
359
379
|
// 面级 `face` 是查询面选择器,与此行级键不同义。
|
|
@@ -421,6 +441,8 @@ export function registerFieldLane(tools) {
|
|
|
421
441
|
const businessCodes = Array.isArray(subColumns) ? subColumns.filter((column) => column.system !== true).map((column) => column.code) : undefined;
|
|
422
442
|
return {
|
|
423
443
|
code: field.code,
|
|
444
|
+
// #40-8:压缩面同样透传字段时间戳(有才给)。
|
|
445
|
+
...pickFieldTimestamps(field),
|
|
424
446
|
type: field.type,
|
|
425
447
|
...(field.typeName !== undefined ? { typeName: field.typeName } : {}),
|
|
426
448
|
...(field.name !== undefined ? { name: field.name } : {}),
|
|
@@ -453,6 +475,13 @@ export function registerFieldLane(tools) {
|
|
|
453
475
|
// r61 a-F9:行级 `published`(true/false)是双面比对出的**字段发布态**;
|
|
454
476
|
// `face` 只是本次查询的面选择器——两键不同义,别再拿 face 推断发布态。
|
|
455
477
|
publishedNote: "行级 published=该字段是否已出现在发布面(双面比对);face=本次查询面(draft/published),不是字段发布态",
|
|
478
|
+
// 线上 #40 第 8 条:平台列表面不带时间戳时如实说「本环境没有」,
|
|
479
|
+
// 别让 agent 以为「没显示=可再查一层」而反复试错。
|
|
480
|
+
...(mapped.some((field) => FIELD_TIMESTAMP_KEYS.some((key) => Object.prototype.hasOwnProperty.call(field, key)))
|
|
481
|
+
? {}
|
|
482
|
+
: {
|
|
483
|
+
timestampNote: "字段时间戳:本环境 bizproperty/list 未返回 createdTime/modifiedTime——无法回答「字段何时被删除/改名」。需要近似时序用业务数据的 createdTime 分界,或 .omc/journal(写回执带时间)。平台带回时间列时会逐行透传(1.1.25 实测回 createdTime;线上 #40-8 的 8.6.41 实测不回),本提示自动消失",
|
|
484
|
+
}),
|
|
456
485
|
...(selector.length > 0 ? { selected: selector } : {}),
|
|
457
486
|
...(args.all !== true ? { businessOnly: true } : {}),
|
|
458
487
|
fields: projected,
|
|
@@ -511,6 +540,8 @@ export function registerFieldLane(tools) {
|
|
|
511
540
|
});
|
|
512
541
|
return {
|
|
513
542
|
code: field.code,
|
|
543
|
+
// #40-8:压缩面同样透传字段时间戳(有才给)。
|
|
544
|
+
...pickFieldTimestamps(field),
|
|
514
545
|
type: field.type,
|
|
515
546
|
...(field.typeName !== undefined ? { typeName: field.typeName } : {}),
|
|
516
547
|
...(field.name !== undefined ? { name: field.name } : {}),
|
|
@@ -1174,8 +1205,8 @@ async function collectFieldDeleteImpact(session, args, options) {
|
|
|
1174
1205
|
},
|
|
1175
1206
|
...(unknowns.length > 0 ? { unknown: unknowns } : {}),
|
|
1176
1207
|
note: options.full
|
|
1177
|
-
? "完整影响面(规则+表单+视图+在线JS
|
|
1178
|
-
: "摘要影响面(表单+视图+在线JS+行数;规则请看 dry-run
|
|
1208
|
+
? "完整影响面(规则+表单+视图+在线JS+行数)。删除不会自动清理依赖面残留。规则条件叶子本在线扫描不含(rule.conditions)——条件引用面已可离线一次查全:omc graph pull --env <env> 后 omc graph references field <schemaCode>.<code>(rule.condition 边)。"
|
|
1209
|
+
: "摘要影响面(表单+视图+在线JS+行数;规则请看 dry-run)。删除不会自动清理依赖面残留。规则条件叶子引用走离线索引(omc graph pull 后 graph references field,rule.condition 边)。",
|
|
1179
1210
|
};
|
|
1180
1211
|
}
|
|
1181
1212
|
/** The proven field.update write body — shared by the write tool and the cascade path. */
|
|
@@ -122,11 +122,11 @@ export const LIST_VIEW_LANE_CONTRACT = Object.freeze({
|
|
|
122
122
|
}),
|
|
123
123
|
"listview.create": Object.freeze({
|
|
124
124
|
scope: LIST_VIEW_SCOPE,
|
|
125
|
-
description: "创建自定义列表视图(query/create,强制 LIST/showOnPc/unpublished 默认)。本工具只收 schemaCode/name/code——**列配置不在这里**:建完后用 `listview.configure` 的 fieldCodes 配列(不要把 fieldCodes 传给 create
|
|
125
|
+
description: "创建自定义列表视图(query/create,强制 LIST/showOnPc/unpublished 默认)。本工具只收 schemaCode/name/code——**列配置不在这里**:建完后用 `listview.configure` 的 fieldCodes 配列(不要把 fieldCodes 传给 create)。**默认视图可配置**:code=schemaCode 的默认视图同样可 listview.configure,日常配列直接用;仅确需第二个视图时才用本工具。改视图影响用户。readback 见 get_header。",
|
|
126
126
|
}),
|
|
127
127
|
"listview.configure": Object.freeze({
|
|
128
128
|
scope: LIST_VIEW_SCOPE,
|
|
129
|
-
description: "(**列汇总**:数值列 `sumType` wire 为整数——0=不统计/1=求和/2=平均/3=最小/4=最大/5=计数,写进 presentation.columnsJson 的列对象,8.6.26 反编译 SumType 实证)配置列表视图。**code 语义(与配方 configure-default-list 同口径,r60a-F13 真机对齐 2026-11-13)**:省略 `code`(或 code=schemaCode)=
|
|
129
|
+
description: "(**列汇总**:数值列 `sumType` wire 为整数——0=不统计/1=求和/2=平均/3=最小/4=最大/5=计数,写进 presentation.columnsJson 的列对象,8.6.26 反编译 SumType 实证)配置列表视图。**code 语义(与配方 configure-default-list 同口径,r60a-F13 真机对齐 2026-11-13;r73 #6 真机对齐 2026-11-17)**:省略 `code`(或 code=schemaCode)= 配置**默认视图**——默认视图 code = 模型 code,同样可 configure(8.6.41 实测),日常配列就用它,**不要先 listview.create**(会多一个视图);改默认视图影响所有用户`listview.create` 只在确实需要**第二个**视图时使用,此时 listview.configure 带 code 指向它。在既有(默认)列表视图上配置列、排序、查询条件、行/列表按钮、呈现、自定义按钮、视图头扩展选项与视图类型:读回 query,按 `fieldCodes` 追加缺失列或**原地修正**已存在列的 name/propertyType/displayFormat/visible(不再跳过既有列),置为可见;数值列 displayFormat 由字段 0 基 `options.scale` 推导(0=整数,1=1位,2=2位,3=3位…8=8位;实测 scale 2 → displayFormat 3 = 两位小数)、日期列由 `options.format` 推导(1/2/3/4),回显 `columns` 为完整列对象并给出 `added`/`updated`;`sorts`→querySorts(direction ASC/DESC)、`conditions`→queryConditions(**比较符是 `filterType`(QueryFilterType 字符串枚举 Eq/NotEq/…;别名 operator/op;省略时按 propertyType 取平台默认)**、displayType/choiceType/options 字符串解码;写后条件回读等价校验给出 conditionReadback)、`actions`→queryActions(queryActionType QUERY(1)…BATCH_SUBMIT(23)、associationType BIZSHEET(0)/WORKFLOW(1))、`presentation`→queryPresentation(htmlJson/actionsJson/columnsJson/queryViewDataSource/schemaRelations/options 均为 JSON 字符串,合法 JSON 读回解码)、`buttons`→customButtons(写面 customButtonJson JSON 数组字符串;bindAction/useLocation/operateType/showPermType 以枚举名发送;triggerType 强制 QUERY、triggerCode=视图 code、sortKey 按数组位,缺省回传读面 customButtons 有效集;ADD_DATA/FORM 目标绑定走 actionConfig——schemaCodeVal+formListData+configureList,targetCode/targetObjCode 对其无效会被拒;高层参数 targetModel/targetForm/configureList 从读回元数据展开,未解析即 listview-button-target-unresolved 零副作用拒)、`options`→视图头 BizQueryOption(`pagingSetting`{pageSize,showTotal} 分页、`listViewModeSetting`{mode,canSwitch} 列表模式,缺省回传读面有效 options、提供时整体替换,rowColorSetting 无 8.6.26 类证据故对象形态拒绝)与 `presentationType`→QueryPresentationType(LIST/BOARD/CALENDAR/GANTT,缺省回传读面有效值;GANTT 必须同时提供 `gantt`→queryGanttModel 且 startTimePropertyCode/endTimePropertyCode/titlePropertyCode 非空,缺省不触碰既有 gantt)与 `queryLayer`→层级展示(BizQueryLayer[] 数组原样发送)及 `multiTableHeaderConfig`→多级表头(HeaderConfig[] JSON 字符串;缺省回传读面有效值、提供时整体替换)省略时不触碰既有值,提供时整体替换并经出门前 dry-lint;`query/update` 后回读(`query/get` 自动注入的默认动作、平台 sortKey 重排与 schemaRelations 派生需还原)。`code` 省略时用默认视图(=schemaCode)。`queryConditionMap` 为只读派生(query/get 带 formCode 子表条件时才出现),非配置输入。**发布语义**:`query/update` 自动置 publish=TRUE——视图无草稿/发布两态、无需独立发布步骤(与表单/规则的 draft→publish 不同)。**依赖顺序**:视图与表单脚手架都依赖**已发布字段**,规范顺序 model.create → field.create → field.publish(模型级)→ form.draft → form.publish →(需要第二视图时 listview.create)→ listview.configure → rule.save → rule.enable → workflow。",
|
|
130
130
|
}),
|
|
131
131
|
"listview.delete": Object.freeze({
|
|
132
132
|
scope: LIST_VIEW_SCOPE,
|
package/dist/lanes/list-view.js
CHANGED
|
@@ -254,6 +254,51 @@ export function filterDefaultSystemColumns(columns, hideDefaultSystemFields) {
|
|
|
254
254
|
return [...columns];
|
|
255
255
|
return columns.filter((column) => typeof column.propertyCode !== "string" || !SYSTEM_FIELD_CODES.has(column.propertyCode));
|
|
256
256
|
}
|
|
257
|
+
/**
|
|
258
|
+
* r73 #5(GitLab #40 P1,CloudPivot 8.6.41 实测):listview FLOW 按钮读写不对称。
|
|
259
|
+
* 写面 buttons[].targetCode(FLOW 必填)被展开进
|
|
260
|
+
* actionConfig.WorkflowListData[0].workflowCode(见 expandButtonActionConfigs);
|
|
261
|
+
* 读面 button.targetCode 恒为 null,真值只在 actionConfig(可能是 JSON 字符串或
|
|
262
|
+
* 对象;PowerShell ConvertFrom-Json 会把单元素数组展开成单个对象——两种形状都收)。
|
|
263
|
+
* workflowCode 可能 ≠ 模型 code(如 case_delay_apply 的流程 code 是
|
|
264
|
+
* case_delay_apply_flow)。读面统一从这里回填 targetCode 并带来源标注。
|
|
265
|
+
*/
|
|
266
|
+
export const FLOW_TARGET_CODE_SOURCE = "actionConfig.WorkflowListData[0].workflowCode";
|
|
267
|
+
export function flowWorkflowCodeFromActionConfig(rawConfig) {
|
|
268
|
+
let parsed;
|
|
269
|
+
if (typeof rawConfig === "string" && rawConfig.trim() !== "") {
|
|
270
|
+
try {
|
|
271
|
+
const value = JSON.parse(rawConfig);
|
|
272
|
+
if (value !== null && typeof value === "object" && !Array.isArray(value))
|
|
273
|
+
parsed = value;
|
|
274
|
+
}
|
|
275
|
+
catch {
|
|
276
|
+
parsed = undefined;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
else if (rawConfig !== null && typeof rawConfig === "object" && !Array.isArray(rawConfig)) {
|
|
280
|
+
parsed = rawConfig;
|
|
281
|
+
}
|
|
282
|
+
const list = parsed?.WorkflowListData;
|
|
283
|
+
// 数组是 wire 真形;单对象是 PowerShell 展开形(8.6.41 实测)——都取 [0].workflowCode。
|
|
284
|
+
const entries = Array.isArray(list) ? list : list !== null && typeof list === "object" && !Array.isArray(list) ? [list] : [];
|
|
285
|
+
for (const entry of entries) {
|
|
286
|
+
if (entry !== null && typeof entry === "object" && !Array.isArray(entry)) {
|
|
287
|
+
const code = entry.workflowCode;
|
|
288
|
+
if (typeof code === "string" && code.length > 0)
|
|
289
|
+
return code;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return null;
|
|
293
|
+
}
|
|
294
|
+
/** FLOW 回填判定:bindAction=FLOW 且行上的 targetCode 不是非空字符串时,从 actionConfig 反解。 */
|
|
295
|
+
function flowTargetBackfill(button) {
|
|
296
|
+
if (button.bindAction !== "FLOW")
|
|
297
|
+
return null;
|
|
298
|
+
if (typeof button.targetCode === "string" && button.targetCode.length > 0)
|
|
299
|
+
return null;
|
|
300
|
+
return flowWorkflowCodeFromActionConfig(button.actionConfig);
|
|
301
|
+
}
|
|
257
302
|
/**
|
|
258
303
|
* Decode a BizButtonModel row's `actionConfig` (stored as a JSON STRING) and
|
|
259
304
|
* pull out the script source. Everything else is passed through so the caller
|
|
@@ -277,13 +322,16 @@ export function decodeButtonScript(input) {
|
|
|
277
322
|
parsed = rawConfig;
|
|
278
323
|
}
|
|
279
324
|
const script = typeof parsed?.scriptData === "string" ? parsed.scriptData : undefined;
|
|
325
|
+
// r73 #5:FLOW 读面回填——targetCode 恒 null 时从 actionConfig 取真值并标注来源。
|
|
326
|
+
const flowBackfill = flowTargetBackfill(button);
|
|
280
327
|
return {
|
|
281
328
|
code: button.code ?? null,
|
|
282
329
|
name: button.name ?? null,
|
|
283
330
|
useLocation: button.useLocation ?? null,
|
|
284
331
|
bindAction: button.bindAction ?? null,
|
|
285
332
|
operateType: button.operateType ?? null,
|
|
286
|
-
targetCode: button.targetCode ?? null,
|
|
333
|
+
targetCode: (typeof button.targetCode === "string" && button.targetCode.length > 0 ? button.targetCode : flowBackfill) ?? null,
|
|
334
|
+
...(flowBackfill !== null ? { targetCodeSource: FLOW_TARGET_CODE_SOURCE } : {}),
|
|
287
335
|
...(script !== undefined
|
|
288
336
|
? {
|
|
289
337
|
scriptData: script,
|
|
@@ -312,7 +360,7 @@ export function registerListViewLane(tools) {
|
|
|
312
360
|
schemaCode: z.string().min(1),
|
|
313
361
|
code: z.string().optional().describe("视图 code;省略时用默认视图(=schemaCode)"),
|
|
314
362
|
full: z.boolean().optional().describe("返回 query/get 原始报文(大体积);默认返回列/排序/条件/动作/按钮的紧凑清单"),
|
|
315
|
-
buttons: z.boolean().optional().describe("附带按钮明细(code/name/useLocation/bindAction/targetCode + SCRIPT 按钮的 scriptData 原文、actionConfig 解析结果)。按钮脚本存在 h_biz_button.actionConfig.scriptData,不必再翻 artifact"),
|
|
363
|
+
buttons: z.boolean().optional().describe("附带按钮明细(code/name/useLocation/bindAction/targetCode + SCRIPT 按钮的 scriptData 原文、actionConfig 解析结果)。按钮脚本存在 h_biz_button.actionConfig.scriptData,不必再翻 artifact。FLOW:读面 targetCode 回填自 actionConfig.WorkflowListData[0].workflowCode(targetCodeSource;可能≠模型 code)↔ 写面 buttons[].targetCode 必填"),
|
|
316
364
|
buttonCode: z.string().min(1).optional().describe("只返回这一个按钮的脚本(与 buttons 同效但更省输出);不存在时报 button-absent 并列出可用 code"),
|
|
317
365
|
capability: capabilityArg,
|
|
318
366
|
},
|
|
@@ -377,13 +425,21 @@ export function registerListViewLane(tools) {
|
|
|
377
425
|
buttonCodes: readArray(model, "customButtons").map((button) => button.code).filter((value) => typeof value === "string"),
|
|
378
426
|
buttonBindings: readArray(model, "customButtons")
|
|
379
427
|
.filter((button) => typeof button.code === "string")
|
|
380
|
-
.map((button) =>
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
428
|
+
.map((button) => {
|
|
429
|
+
// r73 #5:紧凑面同样回填 FLOW 的 targetCode(写面必填、读面恒 null 的不对称在这里收口)。
|
|
430
|
+
const flowBackfill = flowTargetBackfill(button);
|
|
431
|
+
return {
|
|
432
|
+
code: button.code,
|
|
433
|
+
...(button.bindAction !== undefined ? { bindAction: button.bindAction } : {}),
|
|
434
|
+
...(typeof button.targetCode === "string" && button.targetCode.length > 0
|
|
435
|
+
? { targetCode: button.targetCode }
|
|
436
|
+
: flowBackfill !== null
|
|
437
|
+
? { targetCode: flowBackfill, targetCodeSource: FLOW_TARGET_CODE_SOURCE }
|
|
438
|
+
: {}),
|
|
439
|
+
...(button.targetModel !== undefined ? { targetModel: button.targetModel } : {}),
|
|
440
|
+
...(button.targetForm !== undefined ? { targetForm: button.targetForm } : {}),
|
|
441
|
+
};
|
|
442
|
+
}),
|
|
387
443
|
// Button scripts live in h_biz_button.actionConfig (a JSON STRING)
|
|
388
444
|
// whose `scriptData` holds the source for bindAction=SCRIPT. Surfacing
|
|
389
445
|
// them here removes the "listview.get → artifact → JSON.parse →
|
|
@@ -940,8 +996,14 @@ export function registerListViewLane(tools) {
|
|
|
940
996
|
}
|
|
941
997
|
if (Array.isArray(afterModel.customButtons)) {
|
|
942
998
|
const buttons = readArray(afterModel, "customButtons");
|
|
999
|
+
// r73 #5:configure 读回同样回填 FLOW targetCode(与 listview.get 读面同规则,
|
|
1000
|
+
// 两面对同一配置给同一个答案)。
|
|
943
1001
|
readback.buttons = buttons
|
|
944
|
-
.map(
|
|
1002
|
+
.map((button) => {
|
|
1003
|
+
const decoded = decodeButtonRow(button);
|
|
1004
|
+
const flowBackfill = flowTargetBackfill(button);
|
|
1005
|
+
return flowBackfill !== null ? { ...decoded, targetCode: flowBackfill, targetCodeSource: FLOW_TARGET_CODE_SOURCE } : decoded;
|
|
1006
|
+
})
|
|
945
1007
|
.sort((a, b) => Number(a.sortKey ?? 0) - Number(b.sortKey ?? 0));
|
|
946
1008
|
if (args.buttonScripts !== undefined) {
|
|
947
1009
|
const decoded = buttons.map((button) => decodeButtonScript(button));
|
package/dist/lanes/rule-graph.js
CHANGED
|
@@ -2063,7 +2063,7 @@ export function validateRuleNodeGraph(graph, ruleCode, schemaCode, options = {})
|
|
|
2063
2063
|
if (originatorType !== "FIXED" && originatorType !== "DYNAMIC")
|
|
2064
2064
|
blockers.push({ code: "rule-graph-create-originator", nodeCode, key: "originatorValueType", message: `CREATE 节点 originatorValueType 必须是 FIXED(完整用户对象 JSON 串)/DYNAMIC(字段 code)(当前 "${originatorType}")` });
|
|
2065
2065
|
else if (node.originatorValue === undefined || node.originatorValue === "")
|
|
2066
|
-
blockers.push({ code: "rule-graph-create-originator-value", nodeCode, key: "originatorValue", message: "CREATE 节点缺 originatorValue" });
|
|
2066
|
+
blockers.push({ code: "rule-graph-create-originator-value", nodeCode, key: "originatorValue", message: "CREATE 节点缺 originatorValue。修法:DYNAMIC=人员字段 code(如 creater/发起人字段);FIXED=用户对象数组 JSON 串;若该图来自 rule.get 备份,部分平台版本读面不回传该键(8.6.41 实测)——补值或改用 rule.node.update 只 patch 目标节点" });
|
|
2067
2067
|
if (node.startWorkflow === true && (typeof node.targetWorkflowCode !== "string" || !node.targetWorkflowCode.trim()))
|
|
2068
2068
|
blockers.push({ code: "rule-graph-create-workflow-code", nodeCode, key: "targetWorkflowCode", message: "startWorkflow:true 必须带 targetWorkflowCode" });
|
|
2069
2069
|
// Platform labels (HANDOFF C.2): CREATE.findMainData = 「查找满足条件的主表数据」
|
|
@@ -2242,7 +2242,7 @@ export function validateRuleNodeGraph(graph, ruleCode, schemaCode, options = {})
|
|
|
2242
2242
|
if (node.childTriggerConditionType !== undefined) {
|
|
2243
2243
|
const value = String(node.childTriggerConditionType);
|
|
2244
2244
|
if (!RULE_CHILD_TRIGGER_CONDITION_TYPES.includes(value))
|
|
2245
|
-
blockers.push({ code: "rule-graph-child-trigger-condition-type", nodeCode, key: "childTriggerConditionType", message: `节点 childTriggerConditionType "${value}" 不在 ${RULE_CHILD_TRIGGER_CONDITION_TYPES.join("/")}(子表触发数据范围:新增/修改/删除)` });
|
|
2245
|
+
blockers.push({ code: "rule-graph-child-trigger-condition-type", nodeCode, key: "childTriggerConditionType", message: `节点 childTriggerConditionType "${value}" 不在 ${RULE_CHILD_TRIGGER_CONDITION_TYPES.join("/")}——改用合法值 ADD/MODIFY/DELETE(子表触发数据范围:新增/修改/删除)` });
|
|
2246
2246
|
}
|
|
2247
2247
|
// dataCondition: 输入数据满足条件时触发执行动作(通用执行门)。
|
|
2248
2248
|
if (node.dataCondition !== undefined)
|
|
@@ -1091,7 +1091,9 @@ export function registerRuntimeDataLane(tools) {
|
|
|
1091
1091
|
columns: z.array(z.string().min(1)).optional().describe("列投影别名(=displayFields)"),
|
|
1092
1092
|
// r29b F9: data.load/save/update 都叫 fields;list 面原先只有 displayFields/columns。
|
|
1093
1093
|
fields: z.array(z.string().min(1)).optional().describe("列投影别名(=displayFields;与 data.load/data.save/data.update 的 fields 同语义)"),
|
|
1094
|
-
|
|
1094
|
+
// r73 #4(GitLab #40 P1):只读查询的排序 fallback 首选曾是写操作(listview.configure
|
|
1095
|
+
// 会改线上视图、影响所有用户)。顺序反转——本地排序第一,视图级写操作殿后并注明代价。
|
|
1096
|
+
orders: z.array(z.object({ field: z.string().min(1), dir: z.enum(["ASC", "DESC"]) })).optional().describe("query/list 不支持服务端排序。首选本地排(items[].fields.<字段>;--jq 只投影);listview.configure 的 sorts 是写操作(改线上视图、影响所有用户),仅确需时用"),
|
|
1095
1097
|
mobile: z.boolean().optional(),
|
|
1096
1098
|
// r63(b-F12):draftPolicy 此前只能从结果反推——探针无法控制也无法预知
|
|
1097
1099
|
// 草稿口径。显式开关:false 注入 sequenceStatus≠DRAFT(真机验证可过滤,
|
|
@@ -1123,8 +1125,11 @@ export function registerRuntimeDataLane(tools) {
|
|
|
1123
1125
|
status: "error",
|
|
1124
1126
|
blocker: "invalid-input",
|
|
1125
1127
|
tool: "data.list",
|
|
1126
|
-
|
|
1127
|
-
nextCommand
|
|
1128
|
+
// r73 #4(GitLab #40 P1):旧文案把写操作(listview.configure 改线上视图)放在
|
|
1129
|
+
// 首位、nextCommand 直接指向它——只读查询的 fallback 不该默认引向写。本地排序
|
|
1130
|
+
// 第一(并说清怎么排),视图级写操作放末尾并注明影响所有用户。
|
|
1131
|
+
message: "运行面 query/list 不支持服务端排序。排序请先在本地做:用本工具取回数据(全量 all:true 或逐页翻页),再按 items[].fields.<字段> 在本地排序(--jq 只能投影不能排序,需用客户端脚本/管道排)。只有确实要改**视图级**默认排序时才用 listview.configure 的 sorts(写操作:会改线上视图排序、影响所有用户,谨慎)。",
|
|
1132
|
+
nextCommand: `omc call data.list --env <env> --args '${JSON.stringify({ schemaCode: args.schemaCode, all: true })}'(取回全量后本地排序)`,
|
|
1128
1133
|
});
|
|
1129
1134
|
let condition;
|
|
1130
1135
|
let fromDsl = false;
|