@stalfh233/omc-cli 0.6.52 → 0.6.54
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/coverage/m1-coverage-manifest-v1.json +38 -3
- package/dist/bi-wire.js +25 -0
- package/dist/capability-overview.js +9 -9
- package/dist/cli.js +1 -1
- package/dist/data-list-filter.js +8 -1
- package/dist/endpoints.js +9 -0
- package/dist/lanes/datarule.js +1 -1
- package/dist/lanes/dictionary.js +2 -2
- package/dist/lanes/field.js +2 -2
- package/dist/lanes/form.js +5 -1
- package/dist/lanes/list-view.js +1 -1
- package/dist/lanes/model.js +9 -1
- package/dist/lanes/organization.js +1 -1
- package/dist/lanes/perm.js +1 -1
- package/dist/lanes/report.js +182 -22
- package/dist/lanes/runtime-data-contract.js +1 -0
- package/dist/lanes/runtime-data.js +25 -14
- package/dist/lanes/workflow-contract.js +17 -0
- package/dist/lanes/workflow-coverage.js +16 -0
- package/dist/lanes/workflow.js +203 -2
- package/dist/refusal-guidance.js +20 -2
- package/dist/tool-search.js +8 -5
- package/dist/wire.js +6 -0
- package/package.json +3 -3
- package/skills/omc-capabilities.md +2 -2
|
@@ -1342,7 +1342,7 @@
|
|
|
1342
1342
|
},
|
|
1343
1343
|
{
|
|
1344
1344
|
"capability": "R1 report page and BI chart lifecycle",
|
|
1345
|
-
"status": "
|
|
1345
|
+
"status": "executable",
|
|
1346
1346
|
"scope": "Report page create/update/delete on the platform channel; BI dashboard config reads, chart data queries, datasource list/link, and chart/global/attributes writes on the /dashboard/v1 channel.",
|
|
1347
1347
|
"excluded_or_unsupported_reason": "Custom SQL dataset authoring, report export (blob+polling), i18n packs, and exact BI mobile-option semantics were not exercised; BI corpId is deployment-specific (default \"a\", override per call).",
|
|
1348
1348
|
"version_family": "8.6",
|
|
@@ -1379,7 +1379,8 @@
|
|
|
1379
1379
|
],
|
|
1380
1380
|
"scopes": [
|
|
1381
1381
|
"report tree read page metadata BI config chart data create update delete configure"
|
|
1382
|
-
]
|
|
1382
|
+
],
|
|
1383
|
+
"revision_note": "r63(2026-11-14):partial→executable——reporter 服务启动后设计链真机端到端全通(create/tree/get/datasource.link/configure,沙盒 r63_report1 回执);chartdata 取数一跳是版本族边界(reporter 6.2↔主应用 8.6),教学信封已分叉说明。"
|
|
1383
1384
|
},
|
|
1384
1385
|
{
|
|
1385
1386
|
"capability": "App-tree folders (目录/分组): read flattened tree, create, rename/move, non-recursive delete",
|
|
@@ -1507,6 +1508,40 @@
|
|
|
1507
1508
|
"scopes": [
|
|
1508
1509
|
"rule execution log search (trigger-time desc, row match client-side)"
|
|
1509
1510
|
]
|
|
1511
|
+
},
|
|
1512
|
+
{
|
|
1513
|
+
"capability": "r64 runtime workflow admin operations (transfer/activate/finish)",
|
|
1514
|
+
"status": "executable",
|
|
1515
|
+
"scope": "Admin workflow-ops trio for test acceleration: ADJUST_PARTICIPANT (reassign current approver), ACTIVATE_ACTIVITY (jump to a chosen node), finish_instance_by_post (manual finish; end-handler rules still fire). Live-proven r64 2026-11-14 (sandbox r64ops_wfo).",
|
|
1516
|
+
"excluded_or_unsupported_reason": "Live-proven 2026-09-11: startWorkflow -> workitem.list discovered workItemId 970fe802baba463d97c1d97f3695bb3a + bizObjectId c607b77af4ab4293a1f6ce314ec9327c -> approval submit -> list count 0 and record COMPLETED. Evidence in .scratch/omc-app-management/issues/06-workitem-list-capability.md. r4-training 2026-10-20: a stalled instance (data.submit -> PROCESSING, no next todo) exposed nothing; list_workflow_instance_activity (WorkflowMaintenanceAssembler.listActivateActivity) now backs workflow.instanceActivity with per-activity status/participants so \"where did it stop\" is a read, not a MySQL+container-log dig.",
|
|
1517
|
+
"version_family": "8.6",
|
|
1518
|
+
"anchor_version": "8.6.26",
|
|
1519
|
+
"evidence": [
|
|
1520
|
+
{
|
|
1521
|
+
"path": "packages/omc-cli/src/lanes/workflow.ts",
|
|
1522
|
+
"anchor": "workitem.list"
|
|
1523
|
+
},
|
|
1524
|
+
{
|
|
1525
|
+
"path": ".scratch/omc-app-management/issues/06-workitem-list-capability.md",
|
|
1526
|
+
"anchor": "静态取证"
|
|
1527
|
+
},
|
|
1528
|
+
{
|
|
1529
|
+
"path": "packages/omc-cli/src/workflow-support.ts",
|
|
1530
|
+
"anchor": "listInstanceActivities"
|
|
1531
|
+
}
|
|
1532
|
+
],
|
|
1533
|
+
"lane": "W7-S29-greenfield",
|
|
1534
|
+
"tools": [
|
|
1535
|
+
"workflow.transfer",
|
|
1536
|
+
"workflow.activate",
|
|
1537
|
+
"workflow.finish"
|
|
1538
|
+
],
|
|
1539
|
+
"scopes": [
|
|
1540
|
+
"runtime workflow admin adjust participant",
|
|
1541
|
+
"runtime workflow admin activate activity",
|
|
1542
|
+
"runtime workflow admin finish instance"
|
|
1543
|
+
],
|
|
1544
|
+
"revision_note": "r64(2026-11-14)新增:用户需求的流程运维三件套,真机全链实证(workflow_operation approval 对象形状 / adjust_workItem=加签面 / finish=正常完结语义)。定位=测试提速:运维过的实例不能用于真实流程/权限验证。"
|
|
1510
1545
|
}
|
|
1511
1546
|
]
|
|
1512
|
-
}
|
|
1547
|
+
}
|
package/dist/bi-wire.js
CHANGED
|
@@ -36,6 +36,31 @@ export async function biCall(session, call) {
|
|
|
36
36
|
throw new WireError("malformed-envelope", `BI ${call.path} returned no data field`);
|
|
37
37
|
return record.data;
|
|
38
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* r63-F5(真机钉死):BI 端点存在版本族——reporter 6.2.0.45 的 datalogic 只有
|
|
41
|
+
* `/chartdata` 与 `/v2/chartdata`,`/v3/chartdata` 是新版 reporter 的路径
|
|
42
|
+
* (旧 CLI 单路径 404 直接 uncertain 冻结)。仅 HTTP 404(端点缺席)下探
|
|
43
|
+
* 下一个候选;其它错误原样抛(不吞真错误)。全部 404 重抛最后一个。
|
|
44
|
+
*/
|
|
45
|
+
export async function biCallWith404Fallback(session, calls, onFallback) {
|
|
46
|
+
let lastError;
|
|
47
|
+
for (let index = 0; index < calls.length; index++) {
|
|
48
|
+
const call = calls[index];
|
|
49
|
+
try {
|
|
50
|
+
return await biCall(session, call);
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
const endpointAbsent = error instanceof WireError && error.kind === "http-status" && error.diagnostic?.httpStatus === 404;
|
|
54
|
+
if (!endpointAbsent)
|
|
55
|
+
throw error;
|
|
56
|
+
lastError = error;
|
|
57
|
+
const next = calls[index + 1];
|
|
58
|
+
if (next && onFallback)
|
|
59
|
+
onFallback(call, next);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
throw lastError;
|
|
63
|
+
}
|
|
39
64
|
/** Default BI corp id observed on the aozhe tenant; overridable per call. */
|
|
40
65
|
export const DEFAULT_BI_CORP_ID = "a";
|
|
41
66
|
//# sourceMappingURL=bi-wire.js.map
|
|
@@ -142,7 +142,7 @@ const SURFACES = [
|
|
|
142
142
|
operations: ["create", "update", "publish", "bindRule", "delete"],
|
|
143
143
|
requires: ["model"],
|
|
144
144
|
intent: { level: "partial", note: "声明式支持 workflow.create/update/publish 与 bindRules(事件处理器规则绑定,merge/ensure-present);runtime workitem(提交/审批)仍走 escape hatch。" },
|
|
145
|
-
notes: "greenfield 首版;publish/bindRule 不得在 ValidateMessage[] 拒绝时报告成功。组织读写(org.*)挂在本能力下,别名 org/organization/organisation。",
|
|
145
|
+
notes: "greenfield 首版;publish/bindRule 不得在 ValidateMessage[] 拒绝时报告成功。组织读写(org.*)挂在本能力下,别名 org/organization/organisation。r64 起含**流程运维三件套**(workflow.transfer 换审批人 / workflow.activate 跳转节点 / workflow.finish 手动结束·end 规则照常触发)——测试提速定位:运维过的实例权限语义已变,不能用于真实流程/权限验证。",
|
|
146
146
|
},
|
|
147
147
|
{
|
|
148
148
|
id: "onlinejs",
|
|
@@ -181,7 +181,7 @@ const SURFACES = [
|
|
|
181
181
|
description: "报表页 + BI 图表:报表树/元数据读取、报表页建改删、BI dashboard 配置、图表增改删、图表数据查询、数据集读取/关联。",
|
|
182
182
|
operations: ["tree", "get", "chartdata", "datasource", "create", "update", "delete", "configure"],
|
|
183
183
|
intent: { level: "partial", note: "顶层 reports[] 声明式 create/update + dashboard configure(global/attributes/charts diff,removeUnlistedCharts 删未声明图表);delete 走 omc call report.delete,datasource.link/chartdata 走 omc call。" },
|
|
184
|
-
notes: "coverage=
|
|
184
|
+
notes: "coverage=verified(r63 真机端到端:create/tree/get/datasource.link/configure 全通,沙盒 r63_report1 回执)。已知边界:chartdata 取数一跳在 reporter↔主应用版本族不匹配时断(conn.string.empty,教学信封会说清)。link 的真键是模型行(nodeType:1)的 objectId——datasource.list 带 parentObjectId 下钻取;应用/分组级 id 会静默绑 0 个。BI body 必带 config:{token,reportCode,appCode};外层 corpId 默认 \"a\"。chartdata 的 data/position 是 JSON 字符串字段(工具层已自动序列化)。",
|
|
185
185
|
},
|
|
186
186
|
{
|
|
187
187
|
id: "data",
|
|
@@ -360,16 +360,16 @@ export const BOUNDARY_CUES = Object.freeze({
|
|
|
360
360
|
* honestly instead of routing to workflow.permissions (who may originate).
|
|
361
361
|
*/
|
|
362
362
|
/**
|
|
363
|
-
*
|
|
364
|
-
*
|
|
365
|
-
*
|
|
366
|
-
*
|
|
367
|
-
*
|
|
363
|
+
* r63(2026-11-14 更新,推翻 r19 p14 的「暂不优先支持」):报表服务已启动
|
|
364
|
+
* (cloud8_reporter,6061),**设计链真机验证全通**——create/tree/get/
|
|
365
|
+
* datasource.link/configure(探针 r63_report1 端到端,TRIAGE 回执)。唯一
|
|
366
|
+
* 断点:chartdata 的取数一跳(reporter 6.2.0.45 ↔ 主应用 8.6 connstring
|
|
367
|
+
* 握手版本族断裂)。boundary 收窄到取数类目标;一般报表目标正常路由。
|
|
368
368
|
*/
|
|
369
369
|
"report-bi": {
|
|
370
370
|
status: "blocked",
|
|
371
|
-
cues: ["
|
|
372
|
-
note: "
|
|
371
|
+
cues: ["图表数据", "取数", "图表查询", "chartdata"],
|
|
372
|
+
note: "取数一跳是环境边界(r63 实证:reporter 6.2.0.45 ↔ 主应用 8.6 版本族不匹配,connstring 握手拿不到连接串)——换参数/重试无用。报表设计链全部可用(report.create/tree/get/datasource.link/configure 均真机验证);图表配置核对用 report.get 的 bi.charts",
|
|
373
373
|
},
|
|
374
374
|
});
|
|
375
375
|
/** The first boundary category whose cue appears in the goal, if any. */
|
package/dist/cli.js
CHANGED
|
@@ -2867,7 +2867,7 @@ async function main() {
|
|
|
2867
2867
|
command.command("capability <id>").option("--executable").option("--max-output-bytes <bytes>").addOption(jqOption()).action(async (id, options) => {
|
|
2868
2868
|
commandExitCode = await withTransport(options, request, (transport) => cmdCapability(id, transport, options.executable === true, options.jq));
|
|
2869
2869
|
});
|
|
2870
|
-
const intentCommand = command.command("intent");
|
|
2870
|
+
const intentCommand = command.command("intent").description("声明式意图面(Spec 107):intent.yaml → validate → plan → apply → readback。**intent/plan 文件必须位于配置根内**(与 --args-file 同规则:配置根外的文件一律拒绝,防携带凭据被收进会话产物;根外内容请先拷入或经 stdin)").addHelpText("after", "\n意图文件(validate/plan/readback 的 <file>)与 plan 产物(--plan-out)都解析到配置根内——配置根外一律 invalid-input(与 call --args-file 同规则)。\n");
|
|
2871
2871
|
intentCommand.command("schema").option("--example [id]").action((options) => { commandExitCode = cmdIntentSchema({ request, maxOutputBytes: CLI_DEFAULT_OUTPUT_BYTES }, typeof options.example === "string" ? options.example : undefined, options.example !== undefined); });
|
|
2872
2872
|
intentCommand.command("validate <file>").option("--show-intent").action((file, options) => { commandExitCode = cmdIntentValidate(file, { request, maxOutputBytes: CLI_DEFAULT_OUTPUT_BYTES }, options.showIntent === true); });
|
|
2873
2873
|
intentCommand.command("plan <file>").option("--env <environment>").option("--plan-out <file>").option("--summary", "只回变更清单(tool+reason+资源键,去 args/基线)——复核用;apply 仍需完整 plan").option("--max-output-bytes <bytes>").action(async (file, options) => {
|
package/dist/data-list-filter.js
CHANGED
|
@@ -94,6 +94,13 @@ function encodeValue(op, value) {
|
|
|
94
94
|
* without it the query fails with errcode 10009 类型转换异常. The value must
|
|
95
95
|
* come from field metadata — never guessed (cpdocs filter-condition contract).
|
|
96
96
|
*/
|
|
97
|
+
/**
|
|
98
|
+
* r63(b-F12):系统字段的 propertyType 是**平台固定知识**(不是猜测)——
|
|
99
|
+
* sequenceStatus 是 0(string 枚举 DRAFT/PROCESSING/COMPLETED)。发布元数据
|
|
100
|
+
* 面不总包含它(fake 无字段模型/某些版本族),includeDrafts 的注入要跨环境
|
|
101
|
+
* 稳定,就在元数据 resolve 之前先查这张表。
|
|
102
|
+
*/
|
|
103
|
+
const SYSTEM_FIELD_PROPERTY_TYPES = Object.freeze({ sequenceStatus: 0 });
|
|
97
104
|
export function injectPropertyTypes(condition, resolve) {
|
|
98
105
|
const missing = new Set();
|
|
99
106
|
const walk = (node) => {
|
|
@@ -101,7 +108,7 @@ export function injectPropertyTypes(condition, resolve) {
|
|
|
101
108
|
return node.map(walk);
|
|
102
109
|
const leaf = node;
|
|
103
110
|
const code = String(leaf?.propertyCode ?? "");
|
|
104
|
-
const type = resolve(code);
|
|
111
|
+
const type = SYSTEM_FIELD_PROPERTY_TYPES[code] ?? resolve(code);
|
|
105
112
|
if (type === undefined) {
|
|
106
113
|
missing.add(code);
|
|
107
114
|
return leaf;
|
package/dist/endpoints.js
CHANGED
|
@@ -221,6 +221,15 @@ export const ENDPOINTS = {
|
|
|
221
221
|
workflowDeleteInstance: "/api/api/runtime/workflow/delete_instance",
|
|
222
222
|
workflowGetBizObjectByWfInstanceId: "/api/api/runtime/workflow/getBizObjectByWfInstanceId",
|
|
223
223
|
workflowListInstanceActivity: "/api/api/runtime/workflow/list_workflow_instance_activity",
|
|
224
|
+
// r64(流程运维三件套,真机实证):管理面统一操作端点是 workflow_operation
|
|
225
|
+
// (operationType:ADJUST_PARTICIPANT 换审批人 / ACTIVATE_ACTIVITY 运维跳转节点
|
|
226
|
+
// / MODIFY_OWNER / PAUSE_INSTANCE / RESUME_INSTANCE;approval 是对象
|
|
227
|
+
// {activityCode,commonSet,deleted,resources,content},传字符串 10009)。
|
|
228
|
+
// 注意 adjust_workItem_participators 是**加签**面(402512「不允许加签给自己」),
|
|
229
|
+
// 不是换人。finish_instance_by_post 是发起人「手动结束」(正常完结语义,
|
|
230
|
+
// end 规则照常触发);abort_instance 才是终止(规则不一定跑)。
|
|
231
|
+
workflowOperation: "/api/api/runtime/workflow/workflow_operation",
|
|
232
|
+
workflowFinishInstance: "/api/api/runtime/workflow/finish_instance_by_post",
|
|
224
233
|
workflowListFinishedWorkItems: "/api/api/runtime/workflow/list_finished_workitems",
|
|
225
234
|
workflowGetInstanceBaseInfo: "/api/api/runtime/workflow/get_instance_baseinfo",
|
|
226
235
|
organizationRoleList: "/api/api/organization/role/list",
|
package/dist/lanes/datarule.js
CHANGED
|
@@ -874,7 +874,7 @@ export function registerDataRuleLane(tools) {
|
|
|
874
874
|
writeTool({
|
|
875
875
|
tools,
|
|
876
876
|
name: "datarule.create",
|
|
877
|
-
search: { intents: ["字段级校验", "给字段加校验", "给金额字段加校验", "校验规则", "提交校验", "字段校验", "金额校验", "必填才能提交", "必须填", "不填不让提交"] },
|
|
877
|
+
search: { intents: ["字段级校验", "给字段加校验", "给金额字段加校验", "校验规则", "提交校验", "字段校验", "金额校验", "必填才能提交", "必须填", "不填不让提交", "必须附件", "不然就提交不了"] },
|
|
878
878
|
lane: DATARULE_LANE,
|
|
879
879
|
scope: DATARULE_TOOLS["datarule.create"].scope,
|
|
880
880
|
description: DATARULE_TOOLS["datarule.create"].description,
|
package/dist/lanes/dictionary.js
CHANGED
|
@@ -309,7 +309,7 @@ export function registerDictionaryLane(tools) {
|
|
|
309
309
|
writeTool({
|
|
310
310
|
tools,
|
|
311
311
|
name: "dictionary.save",
|
|
312
|
-
search: { intents: ["建数据字典", "新建字典", "保存字典"] },
|
|
312
|
+
search: { intents: ["建数据字典", "新建字典", "保存字典", "说法统一", "统一叫法", "统一一下"] },
|
|
313
313
|
lane: LANE,
|
|
314
314
|
scope: TOOLS["dictionary.save"].scope,
|
|
315
315
|
description: TOOLS["dictionary.save"].description,
|
|
@@ -370,7 +370,7 @@ export function registerDictionaryLane(tools) {
|
|
|
370
370
|
writeTool({
|
|
371
371
|
tools,
|
|
372
372
|
name: "dictionary.status",
|
|
373
|
-
search: { intents: ["停用字典记录", "启用字典记录", "字典记录停用", "停用字典", "启用字典"] },
|
|
373
|
+
search: { intents: ["停用字典记录", "启用字典记录", "字典记录停用", "停用字典", "启用字典", "选错", "老选错", "撤掉的部门"] },
|
|
374
374
|
lane: LANE,
|
|
375
375
|
scope: TOOLS["dictionary.status"].scope,
|
|
376
376
|
description: TOOLS["dictionary.status"].description,
|
package/dist/lanes/field.js
CHANGED
|
@@ -324,7 +324,7 @@ async function assertNoChildSchemaAggregation(session, schemaCode, propertyType,
|
|
|
324
324
|
export function registerFieldLane(tools) {
|
|
325
325
|
tools.push(defineTool({
|
|
326
326
|
name: "field.list",
|
|
327
|
-
search: { intents: ["看字段", "查字段", "字段清单", "模型有哪些字段", "字段列表"] },
|
|
327
|
+
search: { intents: ["看字段", "查字段", "字段清单", "模型有哪些字段", "字段列表", "跳号"] },
|
|
328
328
|
layer: "low",
|
|
329
329
|
kind: "read",
|
|
330
330
|
lane: FIELD_LANE,
|
|
@@ -639,7 +639,7 @@ export function registerFieldLane(tools) {
|
|
|
639
639
|
writeTool({
|
|
640
640
|
tools,
|
|
641
641
|
name: "field.update",
|
|
642
|
-
search: { intents: ["改字段", "改字段配置", "字段改名", "字段设只读", "字段设必填", "字段改精度"] },
|
|
642
|
+
search: { intents: ["改字段", "改字段配置", "字段改名", "字段设只读", "字段设必填", "字段改精度", "小数位", "小数点", "小数点太多", "自动带出", "带出", "手动填"] },
|
|
643
643
|
lane: FIELD_LANE,
|
|
644
644
|
scope: FIELD_TOOLS["field.update"].scope,
|
|
645
645
|
description: FIELD_TOOLS["field.update"].description,
|
package/dist/lanes/form.js
CHANGED
|
@@ -80,7 +80,7 @@ function smallLayoutSummary(draftCodes, publishedCodes, sheet) {
|
|
|
80
80
|
export function registerFormLane(tools) {
|
|
81
81
|
tools.push(defineTool({
|
|
82
82
|
name: "form.get",
|
|
83
|
-
search: { intents: ["看表单", "查表单", "表单有哪些控件", "表单发布状态", "读表单"] },
|
|
83
|
+
search: { intents: ["看表单", "查表单", "表单有哪些控件", "表单发布状态", "读表单", "打开是空", "打开空白", "打印", "是空的"] },
|
|
84
84
|
layer: "low",
|
|
85
85
|
kind: "read",
|
|
86
86
|
lane: FORM_LANE,
|
|
@@ -455,6 +455,10 @@ export function registerFormLane(tools) {
|
|
|
455
455
|
return {
|
|
456
456
|
steps: results,
|
|
457
457
|
readback: {
|
|
458
|
+
// r63(a-F6):表单名此前恒 `?`(回执不带,探针只能从别处猜)——sheetGet
|
|
459
|
+
// 的 name 就是表单名,直接回读。
|
|
460
|
+
formName: typeof pub.name === "string" ? pub.name : null,
|
|
461
|
+
sheetCode,
|
|
458
462
|
formPublished: pub.published === true,
|
|
459
463
|
publishedHtmlJsonPresent: typeof pub.publishedHtmlJson === "string",
|
|
460
464
|
publishedControlCodes,
|
package/dist/lanes/list-view.js
CHANGED
|
@@ -570,7 +570,7 @@ export function registerListViewLane(tools) {
|
|
|
570
570
|
writeTool({
|
|
571
571
|
tools,
|
|
572
572
|
name: "listview.configure",
|
|
573
|
-
search: { intents: ["配置列表列", "配列表", "列表列"] },
|
|
573
|
+
search: { intents: ["配置列表列", "配列表", "列表列", "只显示", "不显示哪些列", "合计数", "列合计", "底部合计", "排个序", "排序", "放前面", "就留"] },
|
|
574
574
|
lane: LIST_VIEW_LANE,
|
|
575
575
|
scope: LIST_VIEW_TOOLS["listview.configure"].scope,
|
|
576
576
|
description: LIST_VIEW_TOOLS["listview.configure"].description,
|
package/dist/lanes/model.js
CHANGED
|
@@ -530,7 +530,7 @@ export function registerModelLane(tools) {
|
|
|
530
530
|
writeTool({
|
|
531
531
|
tools,
|
|
532
532
|
name: "model.create",
|
|
533
|
-
search: { intents: ["新建模型", "建模型", "创建模型", "建模"] },
|
|
533
|
+
search: { intents: ["新建模型", "建模型", "创建模型", "建模", "做个新表", "做个表", "建个表"] },
|
|
534
534
|
lane: MODEL_LANE,
|
|
535
535
|
scope: MODEL_TOOLS["model.create"].scope,
|
|
536
536
|
description: MODEL_TOOLS["model.create"].description,
|
|
@@ -892,11 +892,19 @@ export function registerModelLane(tools) {
|
|
|
892
892
|
absent = (await readRecord()) === null;
|
|
893
893
|
}
|
|
894
894
|
const treeNodePending = (await treeRows()).some((row) => row.type === "BizModel" && row.code === args.schemaCode);
|
|
895
|
+
// r63(a-F9):absent:true 与 treeNodePending:true 曾并排出现——「记录没了但
|
|
896
|
+
// 树上还在」是不是没删干净?给一句显式清零判据,别让探针自己猜组合语义。
|
|
897
|
+
const cleanVerdict = absent && !treeNodePending
|
|
898
|
+
? "已删干净(判据:bizmodels 记录 absent=true 且应用树无该 BizModel 节点)"
|
|
899
|
+
: absent && treeNodePending
|
|
900
|
+
? "记录已删、树节点残留——级联仍在拆或残留需 model-purge;等 60s 复核 model.delete(幂等)"
|
|
901
|
+
: "尚未删净:记录还在(级联进行中),等 60s 后重跑 model.delete 复核";
|
|
895
902
|
return {
|
|
896
903
|
performed: { errcode: performed.errcode, deletedId: targetId, applicationCode },
|
|
897
904
|
readback: {
|
|
898
905
|
absent,
|
|
899
906
|
treeNodePending,
|
|
907
|
+
cleanVerdict,
|
|
900
908
|
...(liveWorkflows.length > 0
|
|
901
909
|
? {
|
|
902
910
|
workflowWarning: {
|
|
@@ -670,7 +670,7 @@ export function registerOrganizationLane(tools) {
|
|
|
670
670
|
writeTool({
|
|
671
671
|
tools,
|
|
672
672
|
name: "org.department.update",
|
|
673
|
-
search: { intents: ["改部门", "重命名部门", "调整部门信息", "换部门主管"] },
|
|
673
|
+
search: { intents: ["改部门", "重命名部门", "调整部门信息", "换部门主管", "部门停用", "停用部门"] },
|
|
674
674
|
lane: LANE,
|
|
675
675
|
scope: SCOPES.deptUpdate,
|
|
676
676
|
description: "改部门(`POST organization/department/modefied`)。先 get_dept_info 读现状再合并提交,只传要改的字段(名称/上级/主管/排序/备注/启用)。",
|
package/dist/lanes/perm.js
CHANGED
|
@@ -289,7 +289,7 @@ export function registerPermLane(tools) {
|
|
|
289
289
|
return { userId: args.userId, appCode: args.appCode, adminBypass, ...(adminBypass ? { adminNotice: "管理员会话恒通过,不代表普通用户;本回执是管理员旁路标记。" } : {}), app: { visible: bool(first(data, "visible", "appVisible")), administrator: bool(first(data, "administrator", "isAdministrator")), allVisible: bool(first(data, "allVisible")) }, models: authSummary(data).models, fields: args.schemaCode ? authSummary(data).fields : [], rowLevel: authSummary(data).rowLevel, layers: { configResolvable: true, runtimeSessionRequired: "真实 load/write 判定受对象权限/业务调用/临时流程授权影响——本工具拒绝单值 allow/deny;验证走目标用户会话或 data.load 双读" } };
|
|
290
290
|
}) }));
|
|
291
291
|
writeTool({ tools, name: "perm.assign", lane: PERM_LANE, scope: PERM_TOOLS["perm.assign"].scope, description: PERM_TOOLS["perm.assign"].description, search: { intents: ["把部门加到权限组", "授权权限组", "给权限组加成员"] }, inputSchema: { appCode: z.string().min(1), groupId: z.string().min(1), units: z.array(z.object({ type: z.enum(["DEPT", "ROLE", "USER"]), id: z.string().min(1), name: z.string().optional() })).min(1), mode: z.enum(["assign", "revoke"]) }, execute: async (session, args) => { const unitType = { DEPT: 1, ROLE: 2, USER: 3 }[args.units[0].type]; const units = args.units.map((u) => ({ unitId: u.id, unitType: { DEPT: 1, ROLE: 2, USER: 3 }[u.type], name: u.name ?? "", corpId: session.enterpriseId(), appCode: args.appCode, groupId: args.groupId })); const body = args.mode === "assign" ? { permissionGroupUnits: units, permGroupInfos: [{ appCode: args.appCode, permGroupId: args.groupId }] } : { permGroupIds: [args.groupId], unitIds: args.units.map((u) => u.id), permissionGroupUnits: units, permGroupInfos: [{ appCode: args.appCode, permGroupId: args.groupId }] }; const before = (await wireCall(session, { path: ENDPOINTS.permissionGroup, method: "GET", query: { id: args.groupId, appCode: args.appCode } })).data; const performed = await wireCall(session, { path: args.mode === "assign" ? ENDPOINTS.permissionAssign : ENDPOINTS.permissionRevoke, method: "POST", body }); const after = (await wireCall(session, { path: ENDPOINTS.permissionGroup, method: "GET", query: { id: args.groupId, appCode: args.appCode } })).data; const listAfter = (await wireCall(session, { path: ENDPOINTS.permissionGroupUnits, method: "POST", body: { ...units[0], unitType, appCode: args.appCode, corpId: session.enterpriseId() } })).data; return { performed: { errcode: performed.errcode, mode: args.mode }, readback: { groups: permissionGroupRows(listAfter).map(groupView), source: "post-write listPermissionGroups readback (not write echo)", diff: { before: projectMembers(before), after: projectMembers(after) } } }; } });
|
|
292
|
-
writeTool({ tools, name: "perm.auth", lane: PERM_LANE, scope: PERM_TOOLS["perm.auth"].scope, description: PERM_TOOLS["perm.auth"].description, search: { intents: ["配模型权限", "设行级权限", "配数据权限", "只能看自己的", "别让他看到", "只能看到自己提的"] }, inputSchema: { appCode: z.string().min(1), groupId: z.string().min(1), grants: z.array(z.object({ schemaCode: z.string().min(1), visible: z.object({ pc: z.boolean(), mobile: z.boolean() }).optional(), rowLevel: z.object({ type: z.number().int().min(1).max(6).describe("1=全部可见,2=本部门,3=仅自己,4=自定义(须 conditions),5=角色管理范围,6=均不可见"), conditions: z.array(z.array(z.unknown())).optional() }).optional(), properties: z.array(z.object({ propertyCode: z.string().optional(), schemaCode: z.string().optional().describe("可省略,继承 grants.schemaCode"), visible: z.boolean().optional(), writeAble: z.boolean().optional(), decryptAble: z.boolean().optional() })).optional(), actions: z.object({ view: z.array(z.string()).optional(), form: z.array(z.string()).optional() }).optional() })).min(1), mode: z.enum(["merge"]).default("merge") }, preflight: (args) => validateGrants(args.grants), execute: async (session, args) => { const group = (await wireCall(session, { path: ENDPOINTS.permissionGroup, method: "GET", query: { id: args.groupId, appCode: args.appCode } })).data; const existing = permissionRecords(group); const mergedRecords = []; const beforeRecords = []; for (const grant of args.grants) {
|
|
292
|
+
writeTool({ tools, name: "perm.auth", lane: PERM_LANE, scope: PERM_TOOLS["perm.auth"].scope, description: PERM_TOOLS["perm.auth"].description, search: { intents: ["配模型权限", "设行级权限", "配数据权限", "只能看自己的", "别让他看到", "只能看到自己提的", "只能查看自己", "不能看别人的"] }, inputSchema: { appCode: z.string().min(1), groupId: z.string().min(1), grants: z.array(z.object({ schemaCode: z.string().min(1), visible: z.object({ pc: z.boolean(), mobile: z.boolean() }).optional(), rowLevel: z.object({ type: z.number().int().min(1).max(6).describe("1=全部可见,2=本部门,3=仅自己,4=自定义(须 conditions),5=角色管理范围,6=均不可见"), conditions: z.array(z.array(z.unknown())).optional() }).optional(), properties: z.array(z.object({ propertyCode: z.string().optional(), schemaCode: z.string().optional().describe("可省略,继承 grants.schemaCode"), visible: z.boolean().optional(), writeAble: z.boolean().optional(), decryptAble: z.boolean().optional() })).optional(), actions: z.object({ view: z.array(z.string()).optional(), form: z.array(z.string()).optional() }).optional() })).min(1), mode: z.enum(["merge"]).default("merge") }, preflight: (args) => validateGrants(args.grants), execute: async (session, args) => { const group = (await wireCall(session, { path: ENDPOINTS.permissionGroup, method: "GET", query: { id: args.groupId, appCode: args.appCode } })).data; const existing = permissionRecords(group); const mergedRecords = []; const beforeRecords = []; for (const grant of args.grants) {
|
|
293
293
|
const prior = existing.find((record) => String(first(record, "schemaCode", "functionCode") ?? "") === grant.schemaCode);
|
|
294
294
|
if (!prior)
|
|
295
295
|
throw new ToolRefusalError({ status: "refused", blocker: "permission-target-model-unknown", message: `权限组中不存在模型 ${grant.schemaCode};候选:${existing.map((record) => String(first(record, "schemaCode", "functionCode") ?? "")).filter(Boolean).join(", ")}` });
|
package/dist/lanes/report.js
CHANGED
|
@@ -4,8 +4,9 @@ import { capabilityArg, environmentArg } from "../args.js";
|
|
|
4
4
|
import { governedRead } from "../read.js";
|
|
5
5
|
import { writeTool } from "../write.js";
|
|
6
6
|
import { defineTool, ToolRefusalError } from "../tool-types.js";
|
|
7
|
-
import { wireCall, WireError } from "../wire.js";
|
|
8
|
-
import {
|
|
7
|
+
import { wireCall, wireRows, WireError } from "../wire.js";
|
|
8
|
+
import { mapBounded } from "../support.js";
|
|
9
|
+
import { biCall, biCallWith404Fallback, DEFAULT_BI_CORP_ID } from "../bi-wire.js";
|
|
9
10
|
import { REPORT_LANE_CONTRACT } from "./report-contract.js";
|
|
10
11
|
import { readAppTree } from "./folder.js";
|
|
11
12
|
const LANE = REPORT_LANE_CONTRACT.lane;
|
|
@@ -80,6 +81,32 @@ function parseJsonText(value) {
|
|
|
80
81
|
function isMissingDashboard(error) {
|
|
81
82
|
return error instanceof WireError && /dashboard\.not\.exist|The dashboard does not exist/i.test(error.message);
|
|
82
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* r63-F1(真机钉死):`queryReportChartTree` 只回**已配图表**的报表——本环境
|
|
86
|
+
* 无图报表/孤儿节点都不在(两参数变体恒 `[]`,而应用树里有 3+1 个 Report 节点)。
|
|
87
|
+
* 应用报表清单的权威源 = 应用树(apppackage/trees)的 `type=Report` 节点;
|
|
88
|
+
* chartTree 降级为补充维度(配了图的报表数)。孤儿报表(parentId 非法被平台
|
|
89
|
+
* 原样存储)在两棵树都不可见——create/update 的 parentId 门才是防线。
|
|
90
|
+
*/
|
|
91
|
+
function assertParentIsFolder(session, appCode, parentId) {
|
|
92
|
+
return (async () => {
|
|
93
|
+
const rows = await readAppTree(session, appCode);
|
|
94
|
+
const folders = rows.filter((row) => String(row.type ?? "") === "Folder");
|
|
95
|
+
if (folders.some((row) => String(row.id ?? "") === parentId))
|
|
96
|
+
return;
|
|
97
|
+
const candidates = folders.slice(0, 8).map((row) => ({ id: row.id, name: row.name, path: row.path }));
|
|
98
|
+
throw new ToolRefusalError({
|
|
99
|
+
status: "refused",
|
|
100
|
+
blocker: "report-parent-not-folder",
|
|
101
|
+
appCode,
|
|
102
|
+
parentId,
|
|
103
|
+
folderCandidates: candidates,
|
|
104
|
+
nextCommand: `omc call folder.tree --args '{"applicationCode":"${appCode}","foldersOnly":true}'`,
|
|
105
|
+
message: `parentId="${parentId}" 不是应用 ${appCode} 树里 type=Folder 的目录 id——平台会把非法值**原样存储**(h_app_function.parentId="test" 实证),` +
|
|
106
|
+
"报表变孤儿:应用树/报表树/门户都看不到,report.get 仍能按 code 命中(更具迷惑性)。用 folderCandidates 或 folder.tree 拿真实目录 id。",
|
|
107
|
+
});
|
|
108
|
+
})();
|
|
109
|
+
}
|
|
83
110
|
/** Recursively collect report functions from a report tree (queryReportChartTree[*]). */
|
|
84
111
|
function collectReports(node, out) {
|
|
85
112
|
if (Array.isArray(node)) {
|
|
@@ -271,14 +298,57 @@ export function registerReportLane(tools) {
|
|
|
271
298
|
lane: LANE,
|
|
272
299
|
scope: TOOLS["report.tree"].scope,
|
|
273
300
|
description: TOOLS["report.tree"].description,
|
|
274
|
-
inputSchema: { environment: environmentArg, capability: capabilityArg, appCode: z.string().optional() },
|
|
301
|
+
inputSchema: { environment: environmentArg, capability: capabilityArg, appCode: z.string().optional().describe("应用 code;省略遍历全部应用") },
|
|
275
302
|
handler: async (ctx, args, self) => governedRead(ctx, self, args, async (session) => {
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
303
|
+
// r63-F1:主源 = 应用树 type=Report 节点(无图也可见);chartTree 只回
|
|
304
|
+
// 配了图的报表,降级为补充计数。孤儿节点(parentId 非法)两边都不可见。
|
|
305
|
+
const appCodes = args.appCode
|
|
306
|
+
? [args.appCode]
|
|
307
|
+
: wireRows((await wireCall(session, { path: ENDPOINTS.applicationList, query: {} })).data)
|
|
308
|
+
.map((row) => String(row.appCode ?? row.code ?? ""))
|
|
309
|
+
.filter((code) => code !== "");
|
|
310
|
+
const perApp = await mapBounded(appCodes, 4, async (appCode) => {
|
|
311
|
+
const rows = await readAppTree(session, appCode);
|
|
312
|
+
return rows
|
|
313
|
+
.filter((row) => String(row.type ?? "") === "Report")
|
|
314
|
+
.map((row) => ({
|
|
315
|
+
appCode,
|
|
316
|
+
code: row.code,
|
|
317
|
+
name: row.name,
|
|
318
|
+
treeNodeId: row.id,
|
|
319
|
+
parentId: row.parentId,
|
|
320
|
+
path: row.path,
|
|
321
|
+
}));
|
|
322
|
+
});
|
|
323
|
+
const reports = perApp.flat();
|
|
324
|
+
const chartsByCode = new Map();
|
|
325
|
+
try {
|
|
326
|
+
const data = args.appCode
|
|
327
|
+
? (await wireCall(session, { path: ENDPOINTS.reportTreeByApp, query: { appCode: args.appCode } })).data
|
|
328
|
+
: (await wireCall(session, { path: ENDPOINTS.reportTreeAll, method: "POST", body: {} })).data;
|
|
329
|
+
const charted = [];
|
|
330
|
+
collectReports(data, charted);
|
|
331
|
+
for (const entry of charted) {
|
|
332
|
+
const code = String(entry.code ?? "");
|
|
333
|
+
if (code)
|
|
334
|
+
chartsByCode.set(code, entry.charts ?? []);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
catch {
|
|
338
|
+
// chartTree 是补充维度:BI 服务不可用时树面仍要可用。
|
|
339
|
+
}
|
|
340
|
+
for (const report of reports) {
|
|
341
|
+
const charts = chartsByCode.get(String(report.code ?? ""));
|
|
342
|
+
if (charts)
|
|
343
|
+
report.charts = charts;
|
|
344
|
+
}
|
|
345
|
+
return {
|
|
346
|
+
appCode: args.appCode ?? null,
|
|
347
|
+
reportCount: reports.length,
|
|
348
|
+
reports,
|
|
349
|
+
chartTreeCount: chartsByCode.size,
|
|
350
|
+
note: "权威源 = 应用树 type=Report 节点(无图报表也列出);chartTreeCount 是 queryReportChartTree 口径(只回已配图表的报表)。树里看不到但 report.get 命中的报表是孤儿(parentId 非法被平台原样存储)——create/update 已按 folder id 门禁。",
|
|
351
|
+
};
|
|
282
352
|
}),
|
|
283
353
|
}));
|
|
284
354
|
tools.push(defineTool({
|
|
@@ -289,11 +359,40 @@ export function registerReportLane(tools) {
|
|
|
289
359
|
lane: LANE,
|
|
290
360
|
scope: TOOLS["report.get"].scope,
|
|
291
361
|
description: TOOLS["report.get"].description,
|
|
292
|
-
inputSchema: { environment: environmentArg, capability: capabilityArg, code: z.string().min(1), corpId: z.string().optional(), full: z.boolean().default(false) },
|
|
362
|
+
inputSchema: { environment: environmentArg, capability: capabilityArg, code: z.string().min(1), appCode: z.string().optional().describe("校验归属应用;不符则拒"), corpId: z.string().optional(), full: z.boolean().default(false) },
|
|
293
363
|
handler: async (ctx, args, self) => governedRead(ctx, self, args, async (session) => {
|
|
294
364
|
const page = (await wireCall(session, { path: ENDPOINTS.reportGet, query: { code: args.code } })).data;
|
|
365
|
+
// r63-F2:族内口径对齐——datasource.*/chartdata 要求 reportCode+appCode,
|
|
366
|
+
// get 此前把 appCode 拒之门外(tool-has-no-app-scope)。改为接受并**校验**:
|
|
367
|
+
// 不符即拒,同名 code 跨应用的混淆在 get 面就暴露。
|
|
368
|
+
if (args.appCode !== undefined && page.appCode !== undefined && String(page.appCode) !== args.appCode) {
|
|
369
|
+
throw new ToolRefusalError({
|
|
370
|
+
status: "refused",
|
|
371
|
+
blocker: "report-app-code-mismatch",
|
|
372
|
+
code: args.code,
|
|
373
|
+
appCode: args.appCode,
|
|
374
|
+
pageAppCode: String(page.appCode),
|
|
375
|
+
message: `报表 ${args.code} 属于应用 ${String(page.appCode)},不是 ${args.appCode}——code 跨应用可能同名,请核对后用页行的 appCode 调 BI 族工具`,
|
|
376
|
+
});
|
|
377
|
+
}
|
|
295
378
|
const objectId = String(page.id ?? page.reportObjectId ?? "");
|
|
296
|
-
|
|
379
|
+
// r63-F1:parent 权威源 = 应用树节点。report/get 不回 parentId,其
|
|
380
|
+
// folderList 末项在孤儿场景指向无关目录(真机实证:孤儿报表的 folderList
|
|
381
|
+
// 末端是「固定资产管理」,而 DB 里 parentId="test")——不再用那个回退。
|
|
382
|
+
const treeNode = objectId && page.appCode ? await resolveReportTreeNode(session, String(page.appCode), String(page.code ?? args.code)) : null;
|
|
383
|
+
const view = reportPageView(page, treeNode?.parentId ?? undefined);
|
|
384
|
+
if (treeNode === null) {
|
|
385
|
+
view.parentId = null;
|
|
386
|
+
view.parentIdSource = "unresolved";
|
|
387
|
+
view.treeVisibility = "not-listed";
|
|
388
|
+
view.orphanNote = "应用树里找不到该报表节点(type=Report)——大概率是孤儿:parentId 非法被平台原样存储(h_app_function.parentId 指向不存在的目录)。report.update 传合法目录 id 可救回。";
|
|
389
|
+
}
|
|
390
|
+
else {
|
|
391
|
+
view.parentIdSource = "app-tree";
|
|
392
|
+
if (treeNode.path)
|
|
393
|
+
view.path = treeNode.path;
|
|
394
|
+
}
|
|
395
|
+
const auth = authOf(args.corpId, String(page.code ?? args.code), String(args.appCode ?? page.appCode ?? ""));
|
|
297
396
|
const bi = objectId ? await readBiConfig(session, auth, objectId) : { present: false, charts: [], title: undefined, global: undefined, attributes: undefined };
|
|
298
397
|
const biView = {
|
|
299
398
|
present: bi.present,
|
|
@@ -305,7 +404,7 @@ export function registerReportLane(tools) {
|
|
|
305
404
|
attributesPresent: bi.attributes !== undefined && JSON.stringify(bi.attributes) !== "{}",
|
|
306
405
|
};
|
|
307
406
|
return {
|
|
308
|
-
report:
|
|
407
|
+
report: view,
|
|
309
408
|
bi: biView,
|
|
310
409
|
global: bi.global,
|
|
311
410
|
attributes: bi.attributes,
|
|
@@ -316,7 +415,7 @@ export function registerReportLane(tools) {
|
|
|
316
415
|
}));
|
|
317
416
|
tools.push(defineTool({
|
|
318
417
|
name: "report.chartdata",
|
|
319
|
-
search: { intents: ["查报表数据", "报表数据", "图表数据"] },
|
|
418
|
+
search: { intents: ["查报表数据", "报表数据", "图表数据", "趋势图"] },
|
|
320
419
|
layer: "low",
|
|
321
420
|
kind: "read",
|
|
322
421
|
lane: LANE,
|
|
@@ -335,12 +434,17 @@ export function registerReportLane(tools) {
|
|
|
335
434
|
handler: async (ctx, args, self) => governedRead(ctx, self, args, async (session) => {
|
|
336
435
|
const raw = args.chart;
|
|
337
436
|
const chart = chartParamModel(raw);
|
|
338
|
-
|
|
339
|
-
|
|
437
|
+
// r63-F5:datalogic/chartdata 有版本族(v3 → v2 → v1),404 下探。
|
|
438
|
+
const base = {
|
|
340
439
|
query: { lang: args.lang },
|
|
341
440
|
body: { chart, dataSourceId: args.dataSourceId ?? raw.dataSourceId, corpId: args.corpId ?? DEFAULT_BI_CORP_ID },
|
|
342
441
|
auth: authOf(args.corpId, args.reportCode, args.appCode),
|
|
343
|
-
}
|
|
442
|
+
};
|
|
443
|
+
const data = await biCallWith404Fallback(session, [
|
|
444
|
+
{ path: ENDPOINTS.biChartData, ...base },
|
|
445
|
+
{ path: "/dashboard/v1/datalogic/v2/chartdata", ...base },
|
|
446
|
+
{ path: "/dashboard/v1/datalogic/chartdata", ...base },
|
|
447
|
+
]);
|
|
344
448
|
return { data };
|
|
345
449
|
}),
|
|
346
450
|
}));
|
|
@@ -358,11 +462,17 @@ export function registerReportLane(tools) {
|
|
|
358
462
|
kind: z.enum(["model", "advanced", "all"]).default("all"),
|
|
359
463
|
reportCode: z.string().min(1),
|
|
360
464
|
appCode: z.string().min(1),
|
|
465
|
+
parentObjectId: z.string().optional().describe("父节点 objectId;传则回其下模型级(nodeType:1)"),
|
|
361
466
|
corpId: z.string().optional(),
|
|
362
467
|
},
|
|
363
468
|
handler: async (ctx, args, self) => governedRead(ctx, self, args, async (session) => {
|
|
364
469
|
const auth = authOf(args.corpId, args.reportCode, args.appCode);
|
|
365
|
-
|
|
470
|
+
// r63-F3(真机钉死):datasourcelist 是层级树——顶层只回应用包
|
|
471
|
+
// (nodeType:0)+系统数据源(nodeType:200);模型级(nodeType:1)要用
|
|
472
|
+
// parentObjectIds 下钻取。link 的真键是模型行的 **objectId**(其
|
|
473
|
+
// dataSourceId 恒 null);应用/分组行不能直接 link(平台静默绑 0 个)。
|
|
474
|
+
const drillBody = args.parentObjectId !== undefined ? { parentObjectIds: [args.parentObjectId] } : {};
|
|
475
|
+
const fetchOne = (path) => biCall(session, { path, body: drillBody, query: { lang: "cn" }, auth }).then((data) => (Array.isArray(data) ? data : []));
|
|
366
476
|
const model = args.kind === "advanced" ? [] : await fetchOne(ENDPOINTS.biDatasourceModelList);
|
|
367
477
|
const advanced = args.kind === "model" ? [] : await fetchOne(ENDPOINTS.biDatasourceAdvancedList);
|
|
368
478
|
const seen = new Set();
|
|
@@ -373,7 +483,18 @@ export function registerReportLane(tools) {
|
|
|
373
483
|
seen.add(id);
|
|
374
484
|
return true;
|
|
375
485
|
});
|
|
376
|
-
|
|
486
|
+
const modelCount = merged.filter((row) => Number(row.nodeType) === 1).length;
|
|
487
|
+
return {
|
|
488
|
+
kind: args.kind,
|
|
489
|
+
parentObjectId: args.parentObjectId ?? null,
|
|
490
|
+
count: merged.length,
|
|
491
|
+
modelCount,
|
|
492
|
+
datasources: merged,
|
|
493
|
+
note: "link 只认**模型行**(nodeType:1)的 objectId(当 dataSourceId 用;模型行的 dataSourceId 字段恒 null)。顶层(不传 parentObjectId)没有模型行——先下钻:应用 id 从 folder.tree 取(应用包节点 id),或用本面 nodeType:0 行的 objectId。nodeType:0=应用/分组容器,200=系统数据源。",
|
|
494
|
+
...(modelCount === 0 && args.parentObjectId === undefined
|
|
495
|
+
? { nextCommand: `omc call report.datasource.list --args '{"reportCode":"${args.reportCode}","appCode":"${args.appCode}","parentObjectId":"<分组或应用 id>"}'` }
|
|
496
|
+
: {}),
|
|
497
|
+
};
|
|
377
498
|
}),
|
|
378
499
|
}));
|
|
379
500
|
writeTool({
|
|
@@ -403,8 +524,10 @@ export function registerReportLane(tools) {
|
|
|
403
524
|
throw new ToolRefusalError({
|
|
404
525
|
status: "refused",
|
|
405
526
|
blocker: "report-datasource-link-not-synced",
|
|
406
|
-
message:
|
|
527
|
+
message: `平台返回成功但未绑定任何数据集(linkedCount:0)。r63 真机钉死两种根因:①传的是应用/分组级 id(nodeType:0)——它只能当 parentObjectId 下钻,不能 link;②该模型确实未同步进 BI。` +
|
|
528
|
+
`先 report.datasource.list 带 parentObjectId 下钻拿**模型行(nodeType:1)的 objectId** 当 dataSourceId 重试;模型行也绑不上才是真未同步。`,
|
|
407
529
|
dataSourceIds: infos.map((info) => info.dataSourceId),
|
|
530
|
+
nextCommand: `omc call report.datasource.list --args '{"reportCode":"${args.reportCode}","appCode":"${args.appCode}","parentObjectId":"<应用/分组 id>"}'`,
|
|
408
531
|
});
|
|
409
532
|
return {
|
|
410
533
|
performed: { errcode: 0, linked: infos.map((info) => info.dataSourceId) },
|
|
@@ -415,7 +538,7 @@ export function registerReportLane(tools) {
|
|
|
415
538
|
writeTool({
|
|
416
539
|
tools,
|
|
417
540
|
name: "report.create",
|
|
418
|
-
search: { intents: ["建报表", "新建报表", "创建报表", "建图表"] },
|
|
541
|
+
search: { intents: ["建报表", "新建报表", "创建报表", "建图表", "一份报表"] },
|
|
419
542
|
lane: LANE,
|
|
420
543
|
scope: TOOLS["report.create"].scope,
|
|
421
544
|
description: TOOLS["report.create"].description,
|
|
@@ -437,6 +560,9 @@ export function registerReportLane(tools) {
|
|
|
437
560
|
},
|
|
438
561
|
execute: async (session, args) => {
|
|
439
562
|
const code = requireCode(args.code);
|
|
563
|
+
// r63-F1:parentId 门在写前(平台原样存储非法值 → 孤儿报表,两棵树都
|
|
564
|
+
// 不可见)。dry-run 走 dryRunPayload 同门。
|
|
565
|
+
await assertParentIsFolder(session, args.appCode, args.parentId);
|
|
440
566
|
const created = (await wireCall(session, {
|
|
441
567
|
path: ENDPOINTS.reportCreate,
|
|
442
568
|
method: "POST",
|
|
@@ -514,6 +640,11 @@ export function registerReportLane(tools) {
|
|
|
514
640
|
};
|
|
515
641
|
},
|
|
516
642
|
preflight: (args) => requireCode(args.code),
|
|
643
|
+
// r63-F1:dry-run 与真写同门(r29c F1b 原则)——parentId 非法在预览就拒。
|
|
644
|
+
dryRunPayload: async (session, args) => {
|
|
645
|
+
await assertParentIsFolder(session, args.appCode, args.parentId);
|
|
646
|
+
return { summary: `即将创建报表页 ${args.code}(appCode=${args.appCode},parentId=${args.parentId})并初始化 BI 配置` };
|
|
647
|
+
},
|
|
517
648
|
rollback: reportRollbackSpec("report.create"),
|
|
518
649
|
});
|
|
519
650
|
writeTool({
|
|
@@ -536,6 +667,9 @@ export function registerReportLane(tools) {
|
|
|
536
667
|
const page = (await wireCall(session, { path: ENDPOINTS.reportGet, query: { code: args.code } })).data;
|
|
537
668
|
if (!page || !page.id)
|
|
538
669
|
throw new ToolRefusalError({ status: "refused", blocker: "report-not-found", message: `报表页 ${args.code} 不存在` });
|
|
670
|
+
// r63-F1:显式改挂时 parentId 必须是 Folder 目录 id(与 create 同门)。
|
|
671
|
+
if (args.parentId !== undefined)
|
|
672
|
+
await assertParentIsFolder(session, String(page.appCode ?? ""), args.parentId);
|
|
539
673
|
const name = args.name ?? String(page.name ?? "");
|
|
540
674
|
const performed = await wireCall(session, {
|
|
541
675
|
path: ENDPOINTS.reportUpdate,
|
|
@@ -553,7 +687,18 @@ export function registerReportLane(tools) {
|
|
|
553
687
|
},
|
|
554
688
|
});
|
|
555
689
|
const after = (await wireCall(session, { path: ENDPOINTS.reportGet, query: { code: args.code } })).data;
|
|
556
|
-
|
|
690
|
+
// r63-F1:读回 parent 走应用树权威源(folderList 回退在孤儿场景误导)。
|
|
691
|
+
const afterNode = after.appCode ? await resolveReportTreeNode(session, String(after.appCode), String(after.code ?? args.code)) : null;
|
|
692
|
+
const afterView = reportPageView(after, afterNode?.parentId ?? undefined);
|
|
693
|
+
if (afterNode === null) {
|
|
694
|
+
afterView.parentId = null;
|
|
695
|
+
afterView.treeVisibility = "not-listed";
|
|
696
|
+
afterView.orphanNote = "应用树仍看不到该报表节点——parentId 可能依旧非法(以 folder.tree 为准重挂)。";
|
|
697
|
+
}
|
|
698
|
+
else if (afterNode.path) {
|
|
699
|
+
afterView.path = afterNode.path;
|
|
700
|
+
}
|
|
701
|
+
return { performed: { errcode: performed.errcode }, readback: { present: Boolean(after && after.code), report: afterView } };
|
|
557
702
|
},
|
|
558
703
|
rollback: reportRollbackSpec("report.update"),
|
|
559
704
|
});
|
|
@@ -658,6 +803,21 @@ export function registerReportLane(tools) {
|
|
|
658
803
|
const toAdd = [];
|
|
659
804
|
const toUpdate = [];
|
|
660
805
|
const kept = new Set();
|
|
806
|
+
// r63-F4(真机钉死):addChart 的 data/position/relations 是 **JSON 字符串**
|
|
807
|
+
// 字段(Java String 反序列化),传对象直接 JSON parse error。工具层统一
|
|
808
|
+
// 序列化——调用方两种写法(对象或字符串)都收。
|
|
809
|
+
const wireChart = (chart) => {
|
|
810
|
+
const out = { ...chart };
|
|
811
|
+
for (const key of ["data", "position", "relations", "styles", "mobileOptions", "customSort", "jumpingRules", "formulas", "conditionFormats"]) {
|
|
812
|
+
const value = out[key];
|
|
813
|
+
if (value !== undefined && value !== null && typeof value !== "string")
|
|
814
|
+
out[key] = JSON.stringify(value);
|
|
815
|
+
}
|
|
816
|
+
// r63-F4 续:i_chart.corpId NOT NULL——漏盖章直接 SQL 异常(真机钉死)。
|
|
817
|
+
if (out.corpId === undefined)
|
|
818
|
+
out.corpId = auth.corpId;
|
|
819
|
+
return out;
|
|
820
|
+
};
|
|
661
821
|
for (const chart of declared) {
|
|
662
822
|
const uuid = chart.uuid;
|
|
663
823
|
if (typeof uuid !== "string" || !uuid)
|
|
@@ -665,7 +825,7 @@ export function registerReportLane(tools) {
|
|
|
665
825
|
kept.add(uuid);
|
|
666
826
|
// The BI write face scopes charts by their parent report objectId; stamp
|
|
667
827
|
// it so callers (and the intent compiler) need not know it.
|
|
668
|
-
const stamped = { ...chart, objectId };
|
|
828
|
+
const stamped = { ...wireChart(chart), objectId };
|
|
669
829
|
(existing.has(uuid) ? toUpdate : toAdd).push(stamped);
|
|
670
830
|
}
|
|
671
831
|
const toRemove = args.removeUnlistedCharts ? [...existing.keys()].filter((uuid) => !kept.has(uuid)) : [];
|
|
@@ -44,6 +44,7 @@ export function dataSubmitDescription() {
|
|
|
44
44
|
`仅无 workflowCode/workItemId/workflowInstanceId 且无 bizObjectId 时保留 save→submit 便捷链(新建记录);只要存在 workItemId 或 workflowInstanceId 就 fail-closed 拒绝(blocker submit-biz-object-id-required),零 runtime/form/submit wire。`,
|
|
45
45
|
`formType 自动判定:无任何 workflowCode/workItemId/workflowInstanceId 时**先按模型自动判定**——GET workflow/isworkflow?schemaCode=true 则用 workflow/getWorkflow 解析已发布流程码并**发起流程**(formType="${wire.formTypeWorkflow}",自动先 GET getReplayToken 注入 replayToken,否则 ${wire.replayTokenErrcode} 频繁重复提交);模型无流程 → "${wire.formTypeNoWorkflow}"(无流程提交,走 live 已证链 ${wire.submitChain};单发新建对象会 ${wire.typeCastErrcode},bizObject 勿带字符串 status)或 workItemId+workflowInstanceId(审批待办,agree **顶层**通过/驳回(approval 对象里放 agree 会被静默忽略并按通过处理),**必须带 bizObjectId 指向在途单据**,否则引擎 NPE ${wire.approvalNpeErrcode})→ "${wire.formTypeWorkflow}"。即「无流程直接提交、有流程发起流程」,不再把有流程模型的新建数据落成游离 sheet 行。`,
|
|
46
46
|
"根因提示(环境相关,ticket 78 观测):**某些环境**里模型所在应用未发布时运行时提交稳定 50000,工具会反推并拒 app-not-published。该根因非普遍规律(见 data.save 的同条提示与 docs/issues/omc-cli-findings-2026-09-19.md B17)——遇 50000 先只读核对再判断。",
|
|
47
|
+
"readback.requiredFace:published=已发布表单(权威)/draft=仅草稿/unavailable=读不到(requiredFields:[]≠无必填;真值 form.get --controls)。",
|
|
47
48
|
"Pass `sheetCode` explicitly when the model has multiple sheets; otherwise the default-form sheetCode is resolved from bizsheet/get.",
|
|
48
49
|
`计算字段:${wire.formulaFieldNote}`,
|
|
49
50
|
]);
|
|
@@ -1065,7 +1065,7 @@ async function diagnoseDbException(session, schemaCode, error) {
|
|
|
1065
1065
|
export function registerRuntimeDataLane(tools) {
|
|
1066
1066
|
tools.push(defineTool({
|
|
1067
1067
|
name: "data.list",
|
|
1068
|
-
search: { intents: ["查业务数据", "查询数据", "查数据", "查记录", "查单据", "统计数据", "汇总数据", "分组统计", "数条数", "总条数", "导出数据", "多少条", "有几条"] },
|
|
1068
|
+
search: { intents: ["查业务数据", "查询数据", "查数据", "查记录", "查单据", "统计数据", "汇总数据", "分组统计", "数条数", "总条数", "导出数据", "多少条", "有几条", "统计", "导出", "查合同列表", "查单据列表", "名单", "拉个名单"] },
|
|
1069
1069
|
layer: "low",
|
|
1070
1070
|
kind: "read",
|
|
1071
1071
|
lane: RUNTIME_LANE,
|
|
@@ -1093,6 +1093,11 @@ export function registerRuntimeDataLane(tools) {
|
|
|
1093
1093
|
fields: z.array(z.string().min(1)).optional().describe("列投影别名(=displayFields;与 data.load/data.save/data.update 的 fields 同语义)"),
|
|
1094
1094
|
orders: z.array(z.object({ field: z.string().min(1), dir: z.enum(["ASC", "DESC"]) })).optional().describe("运行面 query/list 不支持服务端排序;排序请用 listview.configure 的 sorts(视图级)或在本地对 items 排序"),
|
|
1095
1095
|
mobile: z.boolean().optional(),
|
|
1096
|
+
// r63(b-F12):draftPolicy 此前只能从结果反推——探针无法控制也无法预知
|
|
1097
|
+
// 草稿口径。显式开关:false 注入 sequenceStatus≠DRAFT(真机验证可过滤,
|
|
1098
|
+
// 17→11);true/省略不注入(带条件时平台自己排除草稿,无法强制包含,
|
|
1099
|
+
// 回执 draftPolicy 如实标注)。
|
|
1100
|
+
includeDrafts: z.boolean().optional().describe("false=注入 sequenceStatus≠DRAFT 排除草稿;省略=平台默认(带条件时平台自己排除,无法强制包含);口径看回执 filter.draftPolicy"),
|
|
1096
1101
|
showTotal: z.boolean().default(true),
|
|
1097
1102
|
page: z.number().int().min(0).default(0).describe("页码,从 0 开始(不是每页条数);每页条数用 size"),
|
|
1098
1103
|
size: z.number().int().min(1).max(200).default(10).describe("每页条数,默认 10、上限 200;页码用 page(从 0 开始)"),
|
|
@@ -1127,10 +1132,14 @@ export function registerRuntimeDataLane(tools) {
|
|
|
1127
1132
|
// An array `filter` is the caller's AND-list; fold it into `filters`.
|
|
1128
1133
|
const asFilters = args.filters ?? (Array.isArray(args.filter) ? args.filter : undefined);
|
|
1129
1134
|
const asFilter = Array.isArray(args.filter) ? undefined : args.filter;
|
|
1135
|
+
// r63(b-F12):includeDrafts:false 显式排除草稿——注入 sequenceStatus≠DRAFT
|
|
1136
|
+
// 并入既有条件(AND)。真机验证 sequenceStatus 可作过滤字段(17→11)。
|
|
1137
|
+
const draftExclusion = args.includeDrafts === false ? [{ op: "neq", field: "sequenceStatus", value: "DRAFT" }] : [];
|
|
1138
|
+
const mergedFilters = [...(asFilters ?? []), ...draftExclusion];
|
|
1130
1139
|
condition = toQueryCondition({
|
|
1131
1140
|
rawCondition: args.rawCondition,
|
|
1132
|
-
...(asFilter !== undefined ? { filter: asFilter } : {}),
|
|
1133
|
-
...(
|
|
1141
|
+
...(asFilter !== undefined || (asFilters !== undefined && asFilters.length > 0) || draftExclusion.length > 0 ? { filter: asFilter } : {}),
|
|
1142
|
+
...(mergedFilters.length > 0 ? { filters: mergedFilters } : {}),
|
|
1134
1143
|
...(args.filterGroup !== undefined ? { filterGroup: args.filterGroup } : {}),
|
|
1135
1144
|
});
|
|
1136
1145
|
fromDsl = condition !== undefined && args.rawCondition === undefined;
|
|
@@ -1523,15 +1532,17 @@ export function registerRuntimeDataLane(tools) {
|
|
|
1523
1532
|
// 统一一个枚举键 `draftPolicy`(included | excluded | unspecified),
|
|
1524
1533
|
// 不再用两个不同键名表达同一件事(那要调用方写两套分支)。
|
|
1525
1534
|
...(() => {
|
|
1526
|
-
const policy =
|
|
1527
|
-
? {
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
:
|
|
1535
|
+
const policy = args.includeDrafts === false
|
|
1536
|
+
? { draftPolicy: "excluded-by-request", hint: "includeDrafts:false——已注入 sequenceStatus≠DRAFT,total/items 只计非草稿行" }
|
|
1537
|
+
: draftRows > 0
|
|
1538
|
+
? {
|
|
1539
|
+
draftPolicy: "included",
|
|
1540
|
+
draftRows,
|
|
1541
|
+
hint: `本次结果含 ${draftRows} 条 DRAFT 行(total 也计入)——**不要**把 total 当"已提交数据量",判定状态读 data.load 的 sequenceStatus`,
|
|
1542
|
+
}
|
|
1543
|
+
: condition !== undefined
|
|
1544
|
+
? { draftPolicy: "excluded", hint: "本次结果无 DRAFT 行;判定状态仍以 data.load 的 sequenceStatus 为准" }
|
|
1545
|
+
: { draftPolicy: "unspecified", hint: "本次结果无 DRAFT 行,但本面是否过滤草稿不能据此断定;判定状态读 data.load 的 sequenceStatus" };
|
|
1535
1546
|
return { filter: policy };
|
|
1536
1547
|
})(),
|
|
1537
1548
|
...(choiceFilterFields.length > 0 && Number(total ?? 0) === 0 ? { filterValueHint: choiceFilterValueHint(choiceFilterFields) } : {}),
|
|
@@ -1860,7 +1871,7 @@ export function registerRuntimeDataLane(tools) {
|
|
|
1860
1871
|
writeTool({
|
|
1861
1872
|
tools,
|
|
1862
1873
|
name: "data.update",
|
|
1863
|
-
search: { intents: ["改一条记录", "编辑单据", "更新业务数据", "改数据", "录错了改回来", "修正数据"] },
|
|
1874
|
+
search: { intents: ["改一条记录", "编辑单据", "更新业务数据", "改数据", "录错了改回来", "修正数据", "改成", "改为", "录错了", "改回来"] },
|
|
1864
1875
|
lane: RUNTIME_LANE,
|
|
1865
1876
|
scope: RUNTIME_TOOLS["data.update"].scope,
|
|
1866
1877
|
description: RUNTIME_TOOLS["data.update"].description,
|
|
@@ -2072,7 +2083,7 @@ export function registerRuntimeDataLane(tools) {
|
|
|
2072
2083
|
writeTool({
|
|
2073
2084
|
tools,
|
|
2074
2085
|
name: "data.submit",
|
|
2075
|
-
search: { intents: ["造测试数据", "造数据", "录数据", "造单据", "提交数据"] },
|
|
2086
|
+
search: { intents: ["造测试数据", "造数据", "录数据", "造单据", "提交数据", "撤回", "提错了", "手滑"] },
|
|
2076
2087
|
lane: RUNTIME_LANE,
|
|
2077
2088
|
scope: RUNTIME_TOOLS["data.submit"].scope,
|
|
2078
2089
|
description: RUNTIME_TOOLS["data.submit"].description,
|
|
@@ -217,6 +217,19 @@ export const WORKFLOW_LANE_CONTRACT = Object.freeze({
|
|
|
217
217
|
scope: "runtime workflow instance node-state diagnosis",
|
|
218
218
|
description: "按实例查全部节点状态(`activities[].status` 数字枚举:`1=当前激活/持有待办`、`0=已完成或尚未到达`,别与实例级 `instanceStatus:\"PROCESSING\"` 混用——后者只表示流程仍在运行)。返回每个节点 `{activityCode,activityName,activityType,status,participantCount,participants:[{name,id}],sheetTrigger?}`(`GET /api/api/runtime/workflow/list_workflow_instance_activity`,WorkflowMaintenanceAssembler.listActivateActivity)。用于「data.submit 回 PROCESSING 但没有下一待办」的自诊断:例子 `omc call workflow.instanceActivity --args '{\"workflowInstanceId\":\"<id>\"}'`。当没有任何节点 status=1 时,readback 的 diagnosis.code=no-active-activity 并列出排查顺序(参与人为空的审批节点 → 参与人写法 → 容器日志 GetParticipantInfo error)。审批推进正常时该工具不需要——data.submit 的 readback.nextSubmit 已给出下一级参数。",
|
|
219
219
|
}),
|
|
220
|
+
// r64 流程运维三件套(测试提速定位,真机实证形状)。
|
|
221
|
+
"workflow.transfer": Object.freeze({
|
|
222
|
+
scope: "runtime workflow admin adjust participant",
|
|
223
|
+
description: "流程运维·换当前审批人(`POST /api/api/runtime/workflow/workflow_operation`,operationType=ADJUST_PARTICIPANT;approval 是对象 {activityCode,commonSet,deleted,resources,content}——传字符串 10009;adjust_workItem_participators 是加签面 402512 不是换人)。测试提速工具:换过审批人的实例权限语义已变,不能用于真实流程/权限验证;正常审批链走 data.submit。参与者收 userId 或姓名(user/search 精确解析)。",
|
|
224
|
+
}),
|
|
225
|
+
"workflow.activate": Object.freeze({
|
|
226
|
+
scope: "runtime workflow admin activate activity",
|
|
227
|
+
description: "流程运维·跳转到指定节点(workflow_operation operationType=ACTIVATE_ACTIVITY:激活目标节点并取消当前待办,可带 participants 指定新节点审批人)。测试提速工具:跳过节点的实例不能用于真实流程/权限验证——正常审批走 data.submit。目标节点须在实例活动清单里(status:0 的未到达节点也能跳)。",
|
|
228
|
+
}),
|
|
229
|
+
"workflow.finish": Object.freeze({
|
|
230
|
+
scope: "runtime workflow admin finish instance",
|
|
231
|
+
description: "流程运维·手动结束流程(`POST /api/api/runtime/workflow/finish_instance_by_post`,正常完结语义):实例到 COMPLETED,workflow.bindRules 的 end handler 规则照常触发(与 abort_instance 终止的本质区别——终止不保证跑规则;验证用 rule.log)。测试提速工具:手动结束的实例不能用于真实流程推进/权限验证。",
|
|
232
|
+
}),
|
|
220
233
|
}),
|
|
221
234
|
});
|
|
222
235
|
export function assertWorkflowContract() {
|
|
@@ -262,6 +275,10 @@ export function assertWorkflowContract() {
|
|
|
262
275
|
assertDescriptionCarries(WORKFLOW_LANE_CONTRACT, "configure_workflow", ["workflow.create", "workflow.update", "workflow.publish", "workflow.bindRule", "bindRules"]);
|
|
263
276
|
assertDescriptionCarries(WORKFLOW_LANE_CONTRACT, "workitem.list", ["search_workitems", "workItemId", "workflowInstanceId", "bizObjectId", "getBizObjectByWfInstanceId", "filterWorkflowInstanceId"]);
|
|
264
277
|
assertDescriptionCarries(WORKFLOW_LANE_CONTRACT, "workflow.instanceActivity", ["list_workflow_instance_activity", "status", "participants", "no-active-activity"]);
|
|
278
|
+
// r64:运维三件套的端点/语义钉子(含「测试提速」定位)。
|
|
279
|
+
assertDescriptionCarries(WORKFLOW_LANE_CONTRACT, "workflow.transfer", ["workflow_operation", "ADJUST_PARTICIPANT", "data.submit"]);
|
|
280
|
+
assertDescriptionCarries(WORKFLOW_LANE_CONTRACT, "workflow.activate", ["ACTIVATE_ACTIVITY", "data.submit"]);
|
|
281
|
+
assertDescriptionCarries(WORKFLOW_LANE_CONTRACT, "workflow.finish", ["finish_instance_by_post", "end handler", "abort"]);
|
|
265
282
|
if (!workflowTemplateArg.description?.includes("routes"))
|
|
266
283
|
throw new Error("workflow template arg must document the routes->rules mapping");
|
|
267
284
|
if (workflowTemplateArg.description?.includes('\\"templateType\\":\\"BusinessProcess\\"') || workflowTemplateArg.description?.includes('"templateType":"BusinessProcess"'))
|
|
@@ -55,6 +55,22 @@ export const WORKFLOW_COVERAGE = declareLaneCoverage(WORKFLOW_LANE_CONTRACT.lane
|
|
|
55
55
|
],
|
|
56
56
|
tools: [claim("workitem.list", T["workitem.list"].scope), claim("workflow.instanceActivity", T["workflow.instanceActivity"].scope)],
|
|
57
57
|
},
|
|
58
|
+
{
|
|
59
|
+
// r64 流程运维三件套(用户需求 2026-11-14;测试提速定位)。端点形状真机
|
|
60
|
+
// 实证:workflow_operation approval 必须是对象(字符串 10009)、
|
|
61
|
+
// adjust_workItem_participators 是加签面(402512)、finish_instance_by_post
|
|
62
|
+
// 正常完结语义(end 规则照常触发)。回执档案见 r64 TASK-RESULT。
|
|
63
|
+
capability: "r64 runtime workflow admin operations (transfer/activate/finish)",
|
|
64
|
+
evidence: [
|
|
65
|
+
"packages/omc-cli/src/lanes/workflow.ts",
|
|
66
|
+
"r64 2026-11-14 (8.6 真机): ADJUST_PARTICIPANT 换审批人(A2 付文彬→赵财务 回执)、ACTIVATE_ACTIVITY 跳转 A2→A3、finish_instance_by_post COMPLETED——全链沙盒 r64ops_wfo 实证",
|
|
67
|
+
],
|
|
68
|
+
tools: [
|
|
69
|
+
claim("workflow.transfer", T["workflow.transfer"].scope),
|
|
70
|
+
claim("workflow.activate", T["workflow.activate"].scope),
|
|
71
|
+
claim("workflow.finish", T["workflow.finish"].scope),
|
|
72
|
+
],
|
|
73
|
+
},
|
|
58
74
|
{
|
|
59
75
|
capability: "workflow participant resolution (org roles/departments)",
|
|
60
76
|
evidence: [
|
package/dist/lanes/workflow.js
CHANGED
|
@@ -2617,7 +2617,7 @@ export function registerWorkflowLane(tools) {
|
|
|
2617
2617
|
writeTool({
|
|
2618
2618
|
tools,
|
|
2619
2619
|
name: "workflow.update",
|
|
2620
|
-
search: { intents: ["更新流程", "修改流程", "改流程", "加审批节点"] },
|
|
2620
|
+
search: { intents: ["更新流程", "修改流程", "改流程", "加审批节点", "退回给", "退回到", "签一下", "自己批"] },
|
|
2621
2621
|
lane: WORKFLOW_LANE,
|
|
2622
2622
|
scope: WORKFLOW_TOOLS["workflow.update"].scope,
|
|
2623
2623
|
description: WORKFLOW_TOOLS["workflow.update"].description,
|
|
@@ -3272,7 +3272,7 @@ export function registerWorkflowLane(tools) {
|
|
|
3272
3272
|
});
|
|
3273
3273
|
tools.push(defineTool({
|
|
3274
3274
|
name: "workitem.list",
|
|
3275
|
-
search: { intents: ["查我的待办", "我的待办", "待办列表", "查待办"] },
|
|
3275
|
+
search: { intents: ["查我的待办", "我的待办", "待办列表", "查待办", "等审批"] },
|
|
3276
3276
|
layer: "low",
|
|
3277
3277
|
kind: "read",
|
|
3278
3278
|
lane: WORKFLOW_LANE,
|
|
@@ -4075,6 +4075,207 @@ export function registerWorkflowLane(tools) {
|
|
|
4075
4075
|
}, { compact: userSearchCompact });
|
|
4076
4076
|
},
|
|
4077
4077
|
}));
|
|
4078
|
+
// ──────────────────────────────────────────────────────────────────────────
|
|
4079
|
+
// r64 流程运维三件套(用户需求 2026-11-14:「流程运维把当前审批人换成我自己 /
|
|
4080
|
+
// 手动结束流程触发规则 / 运维到指定节点」)。**定位:测试提速工具**——快速
|
|
4081
|
+
// 造/推测试数据用;真实流程与权限验证必须走 data.submit 正常链(换过审批人/
|
|
4082
|
+
// 跳过节点的实例,权限语义已变)。端点形状全部真机实证(详见 r64 TASK-RESULT)。
|
|
4083
|
+
// ──────────────────────────────────────────────────────────────────────────
|
|
4084
|
+
/** 把 participants(userId 或姓名,混收)解析成 userId 列表;姓名走 user/search。 */
|
|
4085
|
+
const resolveOpsParticipants = async (session, participants) => {
|
|
4086
|
+
const ids = [];
|
|
4087
|
+
const resolved = [];
|
|
4088
|
+
const unresolved = [];
|
|
4089
|
+
for (const entry of participants) {
|
|
4090
|
+
if (/^[0-9a-f]{16,}$/i.test(entry)) {
|
|
4091
|
+
ids.push(entry);
|
|
4092
|
+
resolved.push({ name: entry, id: entry });
|
|
4093
|
+
continue;
|
|
4094
|
+
}
|
|
4095
|
+
const data = (await wireCall(session, { path: ENDPOINTS.organizationUserSearch, method: "POST", body: { wd: entry, page: 0, size: 5 } })).data;
|
|
4096
|
+
const rows = Array.isArray(data?.content) ? data.content : [];
|
|
4097
|
+
const exact = rows.find((row) => String(row.name ?? "") === entry) ?? rows[0];
|
|
4098
|
+
if (exact && typeof exact.id === "string") {
|
|
4099
|
+
ids.push(exact.id);
|
|
4100
|
+
resolved.push({ name: String(exact.name ?? entry), id: exact.id });
|
|
4101
|
+
}
|
|
4102
|
+
else {
|
|
4103
|
+
unresolved.push(entry);
|
|
4104
|
+
}
|
|
4105
|
+
}
|
|
4106
|
+
return { ids, resolved, unresolved };
|
|
4107
|
+
};
|
|
4108
|
+
const opsApproval = (activityCode, comment) => ({
|
|
4109
|
+
activityCode,
|
|
4110
|
+
commonSet: false,
|
|
4111
|
+
deleted: false,
|
|
4112
|
+
resources: [],
|
|
4113
|
+
content: comment ?? null,
|
|
4114
|
+
});
|
|
4115
|
+
const activeActivitiesOf = async (session, instanceId) => {
|
|
4116
|
+
const rows = await listInstanceActivities(session, instanceId);
|
|
4117
|
+
return rows
|
|
4118
|
+
.filter((row) => Number(row.status) === 1)
|
|
4119
|
+
.map((row) => ({
|
|
4120
|
+
activityCode: wireString(row.activityCode),
|
|
4121
|
+
activityName: wireString(row.activityName),
|
|
4122
|
+
participants: (Array.isArray(row.participantors) ? row.participantors : []).map((person) => ({ id: wireString(person.id), name: wireString(person.name) })),
|
|
4123
|
+
}));
|
|
4124
|
+
};
|
|
4125
|
+
writeTool({
|
|
4126
|
+
tools,
|
|
4127
|
+
name: "workflow.transfer",
|
|
4128
|
+
search: { intents: ["换审批人", "转办", "改审批人", "调整审批人", "审批人换成"] },
|
|
4129
|
+
lane: WORKFLOW_LANE,
|
|
4130
|
+
scope: "runtime workflow admin adjust participant",
|
|
4131
|
+
description: "流程运维·换当前审批人(`POST /api/api/runtime/workflow/workflow_operation`,operationType=ADJUST_PARTICIPANT;真机实证 approval 是**对象** {activityCode,commonSet,deleted,resources,content},传字符串 10009;adjust_workItem_participators 是加签面不是换人)。**测试提速工具**:换过审批人的实例权限语义已变,不能用于真实流程/权限验证——正常审批链走 data.submit。实例必须在途且有激活节点;默认取第一个激活节点,也可显式 activityCode。",
|
|
4132
|
+
inputSchema: {
|
|
4133
|
+
workflowInstanceId: z.string().min(1).describe("流程实例 id(data.submit 读回 / workflow.instanceActivity)"),
|
|
4134
|
+
participants: z.array(z.string().min(1)).min(1).describe("目标审批人:userId 或姓名(混收;姓名按 organization/user/search 精确匹配解析)"),
|
|
4135
|
+
activityCode: z.string().optional().describe("目标节点 code;省略=当前第一个激活节点"),
|
|
4136
|
+
comment: z.string().optional().describe("运维意见(进审批记录)"),
|
|
4137
|
+
},
|
|
4138
|
+
execute: async (session, args) => {
|
|
4139
|
+
const base = await getInstanceBaseInfo(session, args.workflowInstanceId);
|
|
4140
|
+
if (base === null)
|
|
4141
|
+
throw new ToolRefusalError({ status: "refused", blocker: "workflow-instance-not-found", workflowInstanceId: args.workflowInstanceId, message: `流程实例 ${args.workflowInstanceId} 不存在(get_instance_baseinfo 空)——实例 id 来自 data.submit 读回的 workflowInstanceId` });
|
|
4142
|
+
const status = wireString(base.status);
|
|
4143
|
+
if (status === "COMPLETED")
|
|
4144
|
+
throw new ToolRefusalError({ status: "refused", blocker: "workflow-instance-completed", workflowInstanceId: args.workflowInstanceId, message: `实例已 COMPLETED,没有可换的审批人` });
|
|
4145
|
+
const active = await activeActivitiesOf(session, args.workflowInstanceId);
|
|
4146
|
+
if (active.length === 0)
|
|
4147
|
+
throw new ToolRefusalError({ status: "refused", blocker: "workflow-no-active-activity", workflowInstanceId: args.workflowInstanceId, message: "实例没有任何激活节点(参与者解析失败/引擎异常),无审批人可换——先 workflow.instanceActivity 诊断" });
|
|
4148
|
+
const target = args.activityCode !== undefined ? active.find((row) => row.activityCode === args.activityCode) : active[0];
|
|
4149
|
+
if (target === undefined)
|
|
4150
|
+
throw new ToolRefusalError({ status: "refused", blocker: "workflow-activity-not-active", activityCode: args.activityCode, activeActivities: active.map((row) => row.activityCode), message: `节点 ${args.activityCode} 不是当前激活节点;激活中的是 ${active.map((row) => row.activityCode).join("、")}` });
|
|
4151
|
+
const { ids, resolved, unresolved } = await resolveOpsParticipants(session, args.participants);
|
|
4152
|
+
if (unresolved.length > 0 || ids.length === 0)
|
|
4153
|
+
throw new ToolRefusalError({ status: "refused", blocker: "workflow-participant-unresolved", unresolved, message: `participants 里 ${unresolved.join("、")} 在 organization/user/search 解析不到(精确姓名优先);直接传 userId 可跳过解析` });
|
|
4154
|
+
const currentIds = new Set(target.participants.map((person) => person.id));
|
|
4155
|
+
if (ids.every((id) => currentIds.has(id)))
|
|
4156
|
+
throw new ToolRefusalError({ status: "refused", blocker: "workflow-transfer-noop", message: `目标审批人与当前完全相同(${[...currentIds].join("、")})——换成同一批人是 no-op,平台可能拒绝;要真实换人请给不同的用户` });
|
|
4157
|
+
const performed = await wireCall(session, {
|
|
4158
|
+
path: ENDPOINTS.workflowOperation,
|
|
4159
|
+
method: "POST",
|
|
4160
|
+
body: {
|
|
4161
|
+
workflowInstanceId: args.workflowInstanceId,
|
|
4162
|
+
activityCode: target.activityCode,
|
|
4163
|
+
approval: opsApproval(target.activityCode, args.comment),
|
|
4164
|
+
batchOperation: false,
|
|
4165
|
+
operationType: "ADJUST_PARTICIPANT",
|
|
4166
|
+
participantors: ids,
|
|
4167
|
+
},
|
|
4168
|
+
});
|
|
4169
|
+
const after = await activeActivitiesOf(session, args.workflowInstanceId);
|
|
4170
|
+
return {
|
|
4171
|
+
performed: { errcode: performed.errcode, operationType: "ADJUST_PARTICIPANT", activityCode: target.activityCode, participantors: ids },
|
|
4172
|
+
readback: {
|
|
4173
|
+
activeActivities: after,
|
|
4174
|
+
transferred: after.some((row) => row.activityCode === target.activityCode && row.participants.some((person) => ids.includes(person.id ?? ""))),
|
|
4175
|
+
boundaryNote: "测试提速工具:换过审批人的实例权限语义已变,勿用于真实流程/权限验证;正常审批链走 data.submit(workItemId)。",
|
|
4176
|
+
},
|
|
4177
|
+
};
|
|
4178
|
+
},
|
|
4179
|
+
});
|
|
4180
|
+
writeTool({
|
|
4181
|
+
tools,
|
|
4182
|
+
name: "workflow.activate",
|
|
4183
|
+
search: { intents: ["跳转节点", "运维到节点", "指定节点", "调整节点", "流程跳转"] },
|
|
4184
|
+
lane: WORKFLOW_LANE,
|
|
4185
|
+
scope: "runtime workflow admin activate activity",
|
|
4186
|
+
description: "流程运维·跳转到指定节点(`POST /api/api/runtime/workflow/workflow_operation`,operationType=ACTIVATE_ACTIVITY:激活目标节点并取消当前待办,可带 participantors 指定新节点审批人)。**测试提速工具**——跳过节点的实例不能用于真实流程/权限验证;正常审批走 data.submit。目标节点必须在实例的活动清单里(workflow.instanceActivity 可查全部节点,status:0 的未到达节点也能跳)。",
|
|
4187
|
+
inputSchema: {
|
|
4188
|
+
workflowInstanceId: z.string().min(1).describe("流程实例 id"),
|
|
4189
|
+
activityCode: z.string().min(1).describe("目标节点 code(如回到 A2 或直跳 A3;全部节点用 workflow.instanceActivity 查)"),
|
|
4190
|
+
participants: z.array(z.string().min(1)).optional().describe("新节点的审批人(userId 或姓名);省略则用节点模板自身的参与者解析"),
|
|
4191
|
+
comment: z.string().optional().describe("运维意见"),
|
|
4192
|
+
},
|
|
4193
|
+
execute: async (session, args) => {
|
|
4194
|
+
const base = await getInstanceBaseInfo(session, args.workflowInstanceId);
|
|
4195
|
+
if (base === null)
|
|
4196
|
+
throw new ToolRefusalError({ status: "refused", blocker: "workflow-instance-not-found", workflowInstanceId: args.workflowInstanceId, message: `流程实例 ${args.workflowInstanceId} 不存在` });
|
|
4197
|
+
const status = wireString(base.status);
|
|
4198
|
+
if (status === "COMPLETED")
|
|
4199
|
+
throw new ToolRefusalError({ status: "refused", blocker: "workflow-instance-completed", workflowInstanceId: args.workflowInstanceId, message: `实例已 COMPLETED,不能跳转节点` });
|
|
4200
|
+
const rows = await listInstanceActivities(session, args.workflowInstanceId);
|
|
4201
|
+
const known = rows.map((row) => wireString(row.activityCode));
|
|
4202
|
+
if (!known.includes(args.activityCode))
|
|
4203
|
+
throw new ToolRefusalError({ status: "refused", blocker: "workflow-activity-unknown", activityCode: args.activityCode, knownActivities: known, message: `节点 ${args.activityCode} 不在实例活动清单里;清单:${known.join("、")}` });
|
|
4204
|
+
const activeBefore = rows.filter((row) => Number(row.status) === 1).map((row) => wireString(row.activityCode));
|
|
4205
|
+
let participantIds;
|
|
4206
|
+
if (args.participants !== undefined) {
|
|
4207
|
+
const { ids, unresolved } = await resolveOpsParticipants(session, args.participants);
|
|
4208
|
+
if (unresolved.length > 0)
|
|
4209
|
+
throw new ToolRefusalError({ status: "refused", blocker: "workflow-participant-unresolved", unresolved, message: `participants 里 ${unresolved.join("、")} 解析不到(精确姓名优先);直接传 userId 可跳过解析` });
|
|
4210
|
+
participantIds = ids;
|
|
4211
|
+
}
|
|
4212
|
+
const activeRow = rows.find((row) => Number(row.status) === 1);
|
|
4213
|
+
const performed = await wireCall(session, {
|
|
4214
|
+
path: ENDPOINTS.workflowOperation,
|
|
4215
|
+
method: "POST",
|
|
4216
|
+
body: {
|
|
4217
|
+
workflowInstanceId: args.workflowInstanceId,
|
|
4218
|
+
activityCode: args.activityCode,
|
|
4219
|
+
approval: opsApproval(wireString(activeRow?.activityCode) ?? args.activityCode, args.comment),
|
|
4220
|
+
batchOperation: false,
|
|
4221
|
+
operationType: "ACTIVATE_ACTIVITY",
|
|
4222
|
+
...(participantIds !== undefined ? { participantors: participantIds } : {}),
|
|
4223
|
+
},
|
|
4224
|
+
});
|
|
4225
|
+
const after = await activeActivitiesOf(session, args.workflowInstanceId);
|
|
4226
|
+
return {
|
|
4227
|
+
performed: { errcode: performed.errcode, operationType: "ACTIVATE_ACTIVITY", activityCode: args.activityCode, activatedFrom: activeBefore },
|
|
4228
|
+
readback: {
|
|
4229
|
+
activeActivities: after,
|
|
4230
|
+
activated: after.some((row) => row.activityCode === args.activityCode),
|
|
4231
|
+
boundaryNote: "测试提速工具:跳过节点的实例不能用于真实流程/权限验证。",
|
|
4232
|
+
},
|
|
4233
|
+
};
|
|
4234
|
+
},
|
|
4235
|
+
});
|
|
4236
|
+
writeTool({
|
|
4237
|
+
tools,
|
|
4238
|
+
name: "workflow.finish",
|
|
4239
|
+
search: { intents: ["结束流程", "手动结束", "流程结束", "直接完结"] },
|
|
4240
|
+
lane: WORKFLOW_LANE,
|
|
4241
|
+
scope: "runtime workflow admin finish instance",
|
|
4242
|
+
description: "流程运维·手动结束流程(`POST /api/api/runtime/workflow/finish_instance_by_post`,发起人「结束流程」语义):实例直接到 COMPLETED,**workflow.bindRules 的 end handler 规则照常触发**(这是 finish 与 abort_instance 终止的本质区别——终止不保证跑规则;验证规则跑了没有用 rule.log 查)。**测试提速工具**:手动结束的实例不能用于真实流程推进/权限验证;正常审批走 data.submit。",
|
|
4243
|
+
inputSchema: {
|
|
4244
|
+
workflowInstanceId: z.string().min(1).describe("流程实例 id"),
|
|
4245
|
+
comment: z.string().optional().describe("结束意见(进审批记录)"),
|
|
4246
|
+
},
|
|
4247
|
+
execute: async (session, args) => {
|
|
4248
|
+
const base = await getInstanceBaseInfo(session, args.workflowInstanceId);
|
|
4249
|
+
if (base === null)
|
|
4250
|
+
throw new ToolRefusalError({ status: "refused", blocker: "workflow-instance-not-found", workflowInstanceId: args.workflowInstanceId, message: `流程实例 ${args.workflowInstanceId} 不存在` });
|
|
4251
|
+
const status = wireString(base.status);
|
|
4252
|
+
if (status === "COMPLETED")
|
|
4253
|
+
throw new ToolRefusalError({ status: "refused", blocker: "workflow-instance-completed", workflowInstanceId: args.workflowInstanceId, message: "实例已 COMPLETED,无需结束(幂等拒绝;如需重开走 workflow.activate 回指定节点)" });
|
|
4254
|
+
const activeBefore = await activeActivitiesOf(session, args.workflowInstanceId);
|
|
4255
|
+
const performed = await wireCall(session, {
|
|
4256
|
+
path: ENDPOINTS.workflowFinishInstance,
|
|
4257
|
+
method: "POST",
|
|
4258
|
+
body: { workflowInstanceId: args.workflowInstanceId, comment: args.comment ?? null, resources: [] },
|
|
4259
|
+
});
|
|
4260
|
+
const afterBase = await getInstanceBaseInfo(session, args.workflowInstanceId);
|
|
4261
|
+
const afterStatus = wireString(afterBase?.status);
|
|
4262
|
+
const afterActive = await activeActivitiesOf(session, args.workflowInstanceId);
|
|
4263
|
+
// r64 真机:finish 受理后 baseinfo 投影可能停在 TOPPING_OFF(收尾态)而
|
|
4264
|
+
// DB 终态已是 COMPLETED——两态都算「结束已受理」,别当成失败重试。
|
|
4265
|
+
const finished = afterStatus === "COMPLETED" || afterStatus === "TOPPING_OFF";
|
|
4266
|
+
return {
|
|
4267
|
+
performed: { errcode: performed.errcode, finishedActivities: activeBefore.map((row) => row.activityCode) },
|
|
4268
|
+
readback: {
|
|
4269
|
+
instanceStatus: afterStatus,
|
|
4270
|
+
finished,
|
|
4271
|
+
...(afterStatus === "TOPPING_OFF" ? { toppingOffNote: "TOPPING_OFF=收尾态(真机实证:DB 终态此时已是 COMPLETED,baseinfo 投影滞后)——end 规则在收尾时触发,勿当失败重试" } : {}),
|
|
4272
|
+
activeActivities: afterActive,
|
|
4273
|
+
endRulesNote: "finish=正常完结语义:workflow.bindRules 绑在 end handler 的业务规则照常触发(查 rule.log / rulelog 面);abort 终止不保证跑规则——本工具不走 abort。",
|
|
4274
|
+
boundaryNote: "测试提速工具:手动结束的实例不能用于真实流程推进/权限验证。",
|
|
4275
|
+
},
|
|
4276
|
+
};
|
|
4277
|
+
},
|
|
4278
|
+
});
|
|
4078
4279
|
}
|
|
4079
4280
|
/** Flatten a role-group/role row into the participant-construction fields. */
|
|
4080
4281
|
/**
|
package/dist/refusal-guidance.js
CHANGED
|
@@ -170,6 +170,20 @@ function dashboardBoundaryGuidance() {
|
|
|
170
170
|
fixFirst: "报表能力暂不优先支持(维护者裁决,先隐藏):不要重试同一子面。平台层仍可用:report.tree / report.update / report.get 存在性判定;确需 BI 详情/数据源/图表/配置时,先启动本机报表服务再深进",
|
|
171
171
|
};
|
|
172
172
|
}
|
|
173
|
+
/**
|
|
174
|
+
* r63(真机钉死):报表服务**已启动**时 BI 仍可能业务性失败——reporter 与主应用
|
|
175
|
+
* 版本族不匹配(本环境 reporter 6.2.0.45 ↔ 主应用 8.6):数据查询的连接串握手
|
|
176
|
+
* (executebefore/connstring,SM4 解密链)拿不到,回 conn.string.empty /
|
|
177
|
+
* server.error。这与「服务未启动」是两个边界:设计链(建页/挂树/数据源 link/
|
|
178
|
+
* 配图/读回)全部可用,只有 chartdata 的取数一跳断。教清楚,别让探针误判成
|
|
179
|
+
* 自己的参数错或无限重试。
|
|
180
|
+
*/
|
|
181
|
+
function dashboardVersionFamilyGuidance() {
|
|
182
|
+
return {
|
|
183
|
+
whatWentWrong: "报表服务已连通,但取数一跳失败——reporter 与主应用版本族不匹配(r63 实证:reporter 6.2.0.45 ↔ 主应用 8.6,connstring 握手 SM4 解密链断裂,conn.string.empty)",
|
|
184
|
+
fixFirst: "这是环境边界,不是参数错:换参数/重试无用。设计链全部可用(report.create/tree/get/datasource.link/configure 均真机验证过)——配置已落库,取数要等 reporter 版本对齐主应用(升级 reporter 镜像)。核对配置用 report.get 的 bi.charts",
|
|
185
|
+
};
|
|
186
|
+
}
|
|
173
187
|
function mentionsDashboardChannel(payload) {
|
|
174
188
|
return JSON.stringify({ m: payload.message, d: payload.detail, r: payload.reason }).includes("/dashboard/v1/");
|
|
175
189
|
}
|
|
@@ -197,8 +211,12 @@ export function refusalRecovery(blocker, payload, options = {}) {
|
|
|
197
211
|
return payload.recovery;
|
|
198
212
|
// r19 p14: the report BI boundary is matched from the wire path in the
|
|
199
213
|
// message/detail, so both refused and frozen (uncertain) envelopes teach it.
|
|
200
|
-
if (mentionsDashboardChannel(payload))
|
|
201
|
-
|
|
214
|
+
if (mentionsDashboardChannel(payload)) {
|
|
215
|
+
// r63:业务性失败(服务已连通)与 transport 失败(服务未启动)分叉教学。
|
|
216
|
+
const text = JSON.stringify({ m: payload.message, d: payload.detail });
|
|
217
|
+
const businessFailure = /conn\.string\.empty|server\.error|illegal\.field|rejected:/.test(text);
|
|
218
|
+
return businessFailure ? dashboardVersionFamilyGuidance() : dashboardBoundaryGuidance();
|
|
219
|
+
}
|
|
202
220
|
// r29b F7: blockerAliases 让旧名也能命中新引导。
|
|
203
221
|
const aliasBlockers = Array.isArray(payload.blockerAliases)
|
|
204
222
|
? payload.blockerAliases.filter((entry) => typeof entry === "string")
|
package/dist/tool-search.js
CHANGED
|
@@ -140,8 +140,8 @@ const READ_LEADING_VERBS = Object.freeze(["读", "看", "查", "列出", "列",
|
|
|
140
140
|
* service.dbconnpool.*。刻意**不收**裸「数据」(太宽,靠能力标题/摘要兜底)。
|
|
141
141
|
*/
|
|
142
142
|
const OBJECT_LEXICON = Object.freeze({
|
|
143
|
-
model: ["模型", "业务模型"],
|
|
144
|
-
field: ["字段"],
|
|
143
|
+
model: ["模型", "业务模型", "登记表", "申请单", "申请表", "台账", "单表"],
|
|
144
|
+
field: ["字段", "栏"],
|
|
145
145
|
form: ["表单"],
|
|
146
146
|
listview: ["列表视图", "列表", "视图", "查询列"],
|
|
147
147
|
datarule: ["字段级规则", "数据规则", "校验规则", "控件规则", "字段校验", "字段级校验"],
|
|
@@ -154,8 +154,8 @@ const OBJECT_LEXICON = Object.freeze({
|
|
|
154
154
|
department: ["部门"],
|
|
155
155
|
user: ["用户", "员工", "账号", "成员"],
|
|
156
156
|
dictionary: ["数据字典", "字典", "选项"],
|
|
157
|
-
report: ["报表", "图表", "看板"],
|
|
158
|
-
data: ["业务数据", "运行数据", "记录", "单据"],
|
|
157
|
+
report: ["报表", "图表", "看板", "趋势图"],
|
|
158
|
+
data: ["业务数据", "运行数据", "记录", "单据", "单子", "单号"],
|
|
159
159
|
service: ["集成服务", "业务服务", "服务"],
|
|
160
160
|
method: ["接口方法", "接口", "方法"],
|
|
161
161
|
category: ["所属目录", "分类", "类别"],
|
|
@@ -445,7 +445,10 @@ export function scoreTools(registry, query) {
|
|
|
445
445
|
&& others.some(([, word]) => posText.indexOf(word, aliasEnd + 1) >= 0));
|
|
446
446
|
if (yields)
|
|
447
447
|
break;
|
|
448
|
-
|
|
448
|
+
// 词表三批(原话档):同分裁决曾退化成名字序——「小数点太多位…改成两位」
|
|
449
|
+
// 里 field.update(小数点)与 data.update(改成)同为 55+18。M1-2a 同哲学:
|
|
450
|
+
// 更长的命中短语是更特指的证据,按别名长度给有界加成(≤6)。
|
|
451
|
+
signals.push({ key: "toolAlias", weight: SEARCH_WEIGHTS.toolAlias + Math.min(alias.length, 6), via: `别名「${alias}」` });
|
|
449
452
|
aliasHit = true;
|
|
450
453
|
break;
|
|
451
454
|
}
|
package/dist/wire.js
CHANGED
|
@@ -175,6 +175,12 @@ function invalidateReadCache(session, call) {
|
|
|
175
175
|
else if (nonCachingDesignWrites.has(path)) {
|
|
176
176
|
// Rule/query writes never mutate the cached faces — nothing to drop.
|
|
177
177
|
}
|
|
178
|
+
else if (path === ENDPOINTS.reportCreate || path === ENDPOINTS.reportUpdate || path === ENDPOINTS.reportDelete) {
|
|
179
|
+
// r63-F1:报表页镜像进应用树(h_app_function 的 Report 节点)——
|
|
180
|
+
// create/update/delete 改树,但路径在 /api/api/report/ 下不落上面的
|
|
181
|
+
// fail-safe 分支。不失效的话 create 后 60s 内 folder/report 树全是旧的。
|
|
182
|
+
dropAll([ENDPOINTS.applicationTree]);
|
|
183
|
+
}
|
|
178
184
|
else if (path.startsWith("/api/api/app/")) {
|
|
179
185
|
// Unknown design-surface write — fail safe, drop everything cached.
|
|
180
186
|
state.entries.clear();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stalfh233/omc-cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.54",
|
|
4
4
|
"description": "CloudPivot 8.6 configuration capability CLI — governed, fail-closed, coverage-manifest bounded.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"commander": "14.0.3",
|
|
59
|
-
"omc-core": "0.6.
|
|
59
|
+
"omc-core": "0.6.54",
|
|
60
60
|
"proper-lockfile": "4.1.2",
|
|
61
61
|
"write-file-atomic": "6.0.0",
|
|
62
62
|
"zod": "^3.23.8",
|
|
@@ -74,6 +74,6 @@
|
|
|
74
74
|
"directory": "packages/omc-cli"
|
|
75
75
|
},
|
|
76
76
|
"optionalDependencies": {
|
|
77
|
-
"@stalfh233/omc-fake-platform": "0.6.
|
|
77
|
+
"@stalfh233/omc-fake-platform": "0.6.54"
|
|
78
78
|
}
|
|
79
79
|
}
|
|
@@ -166,8 +166,8 @@ only the section for the capability you need —
|
|
|
166
166
|
|
|
167
167
|
## 流程模板 `workflow`
|
|
168
168
|
|
|
169
|
-
- **能做哪些事**:流程模板 get_draft/get_published、create、update、publish、bindRule(事件处理器规则绑定)、delete、workitem.list、workflow.instanceActivity
|
|
170
|
-
- **工具**:`workflow.get_draft`、`workflow.setButtons`(节点「表单操作」按钮勾选)、`workflow.get_published`、`workflow.validate`、`workflow.create`、`workflow.update`、`workflow.publish`、`workflow.bindRule`、`workflow.delete`、`workflow.permissions`、`workflow.addPermission`、`workflow.removePermission`(发起权限:发布流程不会自动建这一行,缺它一律 40009)、`configure_workflow`、`workitem.list`、`workflow.instanceActivity`、`org.role.list`、`org.department.list`、`org.user.search`、`org.role.users`、`org.role.userScope`、`org.roleGroup.create`、`org.role.create`、`org.role.update`、`org.role.addUsers`、`org.role.removeUsers`、`org.role.setUserScope`、`org.department.create`、`org.department.update`、`org.department.delete`、`org.department.users`、`org.user.create`、`org.user.update`、`org.user.delete`、`org.user.info`、`org.user.departments`、`org.role.delete`、`org.roleGroup.delete`、`org.user.transferDepartment`
|
|
169
|
+
- **能做哪些事**:流程模板 get_draft/get_published、create、update、publish、bindRule(事件处理器规则绑定)、delete、workitem.list、workflow.instanceActivity(实例节点状态诊断);参与人用组织对象。**流程运维三件套**(r64,测试提速定位):workflow.transfer 换审批人 / workflow.activate 跳转节点 / workflow.finish 手动结束(end 规则照常触发)——运维过的实例不能用于真实流程/权限验证。
|
|
170
|
+
- **工具**:`workflow.get_draft`、`workflow.setButtons`(节点「表单操作」按钮勾选)、`workflow.get_published`、`workflow.validate`、`workflow.create`、`workflow.update`、`workflow.publish`、`workflow.bindRule`、`workflow.delete`、`workflow.permissions`、`workflow.addPermission`、`workflow.removePermission`(发起权限:发布流程不会自动建这一行,缺它一律 40009)、`configure_workflow`、`workitem.list`、`workflow.instanceActivity`、`workflow.transfer`、`workflow.activate`、`workflow.finish`、`org.role.list`、`org.department.list`、`org.user.search`、`org.role.users`、`org.role.userScope`、`org.roleGroup.create`、`org.role.create`、`org.role.update`、`org.role.addUsers`、`org.role.removeUsers`、`org.role.setUserScope`、`org.department.create`、`org.department.update`、`org.department.delete`、`org.department.users`、`org.user.create`、`org.user.update`、`org.user.delete`、`org.user.info`、`org.user.departments`、`org.role.delete`、`org.roleGroup.delete`、`org.user.transferDepartment`
|
|
171
171
|
- **recipe**:`omc describe workflow.bindRule --example workflow-handler-binding`;条件两级/一级:`omc describe workflow.update --example workflow-conditional-two-level-approval`
|
|
172
172
|
- **边界 / 陷阱**:greenfield 首版;`publish`/`bindRule` 不得在 `ValidateMessage[]` 拒绝时报告成功。运行时 workitem(提交/审批)走 `data.submit`;想知道实例停在哪/是否错派,用 `workflow.instanceActivity`(无 status=1=真停,参与人全是发起人=解析为空退回)。**发起权限**(`workflow.permissions` / `addPermission`)只有部门/角色/用户三种白名单,**没有「全员」选项**——缺权限行时非管理员通常不能发起(40009),想放开只能授一个够宽的部门/角色,不是「不建行=全员」。**行级数据权限 / 可见范围 / 申请人只看自己的单据不在工具覆盖内**(没有按登录人动态过滤的读面/写面);`org.role.setUserScope` 是角色成员的部门管理范围,不是单据行级可见范围。
|
|
173
173
|
|