@stalfh233/omc-cli 0.6.57 → 0.6.59
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/discovery.js +44 -1
- package/dist/execution-metadata.js +2 -1
- package/dist/goal-routes.js +64 -3
- package/dist/lanes/report.js +12 -3
- package/dist/lanes/rule-lifecycle.js +4 -0
- package/dist/lanes/rulelog.js +3 -1
- package/dist/path-projection.js +9 -2
- package/dist/read-shapes.js +46 -0
- package/dist/recipes/report.js +117 -0
- package/dist/search-index.js +6 -0
- package/package.json +3 -3
- package/skills/omc-business-configuration.md +6 -0
package/dist/discovery.js
CHANGED
|
@@ -544,6 +544,10 @@ export function describeTool(registry, name) {
|
|
|
544
544
|
// High-frequency read faces: declare the RESULT keys so `--jq` does not
|
|
545
545
|
// have to learn them from a pathMiss. Zero bytes when undeclared.
|
|
546
546
|
...(returnsFace(tool.name) ?? {}),
|
|
547
|
+
// r66 ① readbackKeys(c-F2):没有 authored read-shape 的工具也别说「键名无处
|
|
548
|
+
// 可查」——裸 --jq(不带路径)就是键清单(与 artifact get --keys 同语义)。
|
|
549
|
+
// 只在无 returns 声明时出现,避免与 returns.keys 重复。
|
|
550
|
+
...(readShapeFor(tool.name) === undefined ? { returnsHint: "回执键清单:omc call 本工具 --jq(裸,不带路径)= 顶层键一览" } : {}),
|
|
547
551
|
// r32 F1(真机):探针并发发两条 app.create,第二条回 write-lock-held。
|
|
548
552
|
// 撞上之前没有任何发现面说过"写是环境级串行"——describe 的 params 里没有 wait
|
|
549
553
|
// (它是 omc call 的 CLI 开关,不在工具 schema),capability notes 是空的。
|
|
@@ -676,7 +680,30 @@ export function describeExample(registry, name, exampleId) {
|
|
|
676
680
|
refusalRecovery: recipe.refusalRecovery,
|
|
677
681
|
};
|
|
678
682
|
}
|
|
679
|
-
/**
|
|
683
|
+
/** 扫一个工具全部配方的 args 深层键,收集与 param 同名键的完整路径(顶层键不收)。 */
|
|
684
|
+
function nestedParamHits(tool, param) {
|
|
685
|
+
const hits = [];
|
|
686
|
+
for (const recipe of tool.executionMetadata?.recipes ?? []) {
|
|
687
|
+
const walk = (node, prefix) => {
|
|
688
|
+
if (Array.isArray(node)) {
|
|
689
|
+
for (const entry of node)
|
|
690
|
+
walk(entry, `${prefix}[]`);
|
|
691
|
+
return;
|
|
692
|
+
}
|
|
693
|
+
if (node === null || typeof node !== "object")
|
|
694
|
+
return;
|
|
695
|
+
for (const [key, value] of Object.entries(node)) {
|
|
696
|
+
const path = prefix === "" ? key : `${prefix}.${key}`;
|
|
697
|
+
// 顶层键是 schema 的地盘(本函数只在顶层未命中时被调用),只收深层路径。
|
|
698
|
+
if (prefix !== "" && key === param)
|
|
699
|
+
hits.push({ recipeId: recipe.id, path, container: prefix });
|
|
700
|
+
walk(value, path);
|
|
701
|
+
}
|
|
702
|
+
};
|
|
703
|
+
walk((recipe.args ?? {}), "");
|
|
704
|
+
}
|
|
705
|
+
return hits;
|
|
706
|
+
}
|
|
680
707
|
export function describeParam(registry, name, param) {
|
|
681
708
|
const tool = registry.find((entry) => entry.name === name);
|
|
682
709
|
if (!tool)
|
|
@@ -684,6 +711,22 @@ export function describeParam(registry, name, param) {
|
|
|
684
711
|
const schema = jsonSchemaFor(tool.inputSchema);
|
|
685
712
|
const node = schema.properties?.[param];
|
|
686
713
|
if (!node) {
|
|
714
|
+
// r67-01-F4:嵌套键先于"没有参数"——配方 args 深处真有这个键就不是否定,
|
|
715
|
+
// 是指路(path + 所在配方)。多个配方都有时 path 取第一个,其余列 nestedAlso。
|
|
716
|
+
const nested = nestedParamHits(tool, param);
|
|
717
|
+
if (nested.length > 0) {
|
|
718
|
+
const first = nested[0];
|
|
719
|
+
return {
|
|
720
|
+
name: tool.name,
|
|
721
|
+
param,
|
|
722
|
+
found: true,
|
|
723
|
+
path: first.path,
|
|
724
|
+
nestedIn: `${first.recipeId} 的 ${first.container}`,
|
|
725
|
+
...(nested.length > 1 ? { nestedAlso: nested.slice(1).map((hit) => `${hit.recipeId} 的 ${hit.container}`) } : {}),
|
|
726
|
+
message: `"${param}" 是嵌套参数(${first.path}),顶层参数见 available;形状看 omc describe ${tool.name} --example ${first.recipeId}`,
|
|
727
|
+
available: Object.keys(schema.properties ?? {}),
|
|
728
|
+
};
|
|
729
|
+
}
|
|
687
730
|
// r28e 真机(2026-11-05):调用方看到 `status:"ok"` + 一堆键,误以为"参数存在、
|
|
688
731
|
// 只是描述为空"。`found:false` 是机器信号,但人读时需要一句话点明——否则
|
|
689
732
|
// 会照着 `available` 之外的名字继续试。
|
|
@@ -13,7 +13,8 @@ import { B2_METADATA } from "./recipes/b2-registration.js";
|
|
|
13
13
|
import { ONLINEJS_METADATA } from "./recipes/online-js.js";
|
|
14
14
|
import { LISTVIEW_METADATA } from "./recipes/list-view.js";
|
|
15
15
|
import { DICTIONARY_METADATA } from "./recipes/dictionary.js";
|
|
16
|
-
|
|
16
|
+
import { REPORT_METADATA } from "./recipes/report.js";
|
|
17
|
+
const SOURCES = [MODEL_METADATA, FORM_METADATA, FIELD_METADATA, DATARULE_METADATA, BUSINESSRULE_METADATA, WORKFLOW_METADATA, RUNTIME_DATA_METADATA, B2_METADATA, ONLINEJS_METADATA, LISTVIEW_METADATA, DICTIONARY_METADATA, REPORT_METADATA];
|
|
17
18
|
const merged = {};
|
|
18
19
|
for (const source of SOURCES) {
|
|
19
20
|
for (const [tool, metadata] of Object.entries(source)) {
|
package/dist/goal-routes.js
CHANGED
|
@@ -12,8 +12,13 @@ import { listSkills, readSkillSection } from "./skills.js";
|
|
|
12
12
|
*/
|
|
13
13
|
const SCOUT_CUES = ["能不能", "能不能够", "能否", "是否支持", "支持吗", "支持不支持", "可不可以", "有没有办法", "有没有可能", "怎么实现", "如何实现", "怎么写", "怎么配置"];
|
|
14
14
|
const MODIFY_CUES = ["修改", "调整", "更新", "重命名", "改名", "编辑", "删除", "去掉", "移除", "改为", "改成"];
|
|
15
|
-
const READ_CUES = ["查看", "读回", "盘点", "现状", "列出", "有哪些", "有没有", "检查", "审计", "导出", "只读", "看看", "看下", "查一下", "查询一下", "查一查", "梳理", "清点", "给我一份", "哪些", "是什么", "是否", "是否正确", "现有", "已有", "条数", "多少条", "数一下", "有几条", "几条", "有几个", "几个", "几笔", "多少个", "名单", "分布"];
|
|
16
|
-
|
|
15
|
+
const READ_CUES = ["查看", "读回", "盘点", "现状", "列出", "有哪些", "有没有", "检查", "审计", "导出", "只读", "看看", "看下", "查一下", "查询一下", "查一查", "梳理", "清点", "给我一份", "哪些", "是什么", "是否", "是否正确", "现有", "已有", "条数", "多少条", "数一下", "有几条", "几条", "有几个", "几个", "几笔", "多少个", "名单", "分布", "排查", "日志", "执行记录", "触发了吗", "触发失败", "调用记录"];
|
|
16
|
+
// r67a:「排查/日志/执行记录/触发了吗/触发失败/调用记录」——运行面排障问句全是读意图
|
|
17
|
+
// (r67a 真机调查:「规则触发失败了怎么排查」被写阶梯抢走,next 不消费工具级 intents,
|
|
18
|
+
// 只能在 READ_CUES 层修)。裸「查」仍不进(见下条注释的匹配方向)。
|
|
19
|
+
const BUILD_CUES = ["新建", "创建", "搭建", "从零", "从无到有", "做", "建", "加", "实现", "生成", "新增", "保存", "启用", "录入", "添加", "造", "填报", "打卡"];
|
|
20
|
+
// r67a:删裸单字「录」——「录入」已在列,「录」单字会误吃「查看调用记**录**/执行记**录**」这类
|
|
21
|
+
// 读问句(真机调查:「业务方法调用记录在哪看」被 build 抢走)。
|
|
17
22
|
/** Whole-application asks — a single-model atom is the wrong shape for these. */
|
|
18
23
|
const WHOLE_APP_CUES = ["应用", "系统", "整套", "从零", "从无到有", "端到端", "一条龙", "一整套", "业务应用", "平台"];
|
|
19
24
|
/** From-scratch cues — firstAnswer must not point at a schema that does not exist yet. */
|
|
@@ -84,6 +89,32 @@ const AMBIGUOUS_LEADING_READ = ["统计", "汇总"];
|
|
|
84
89
|
* with 统计 but is a compute/写 ask; 「统计这个月提交了多少单据」 is a query.
|
|
85
90
|
*/
|
|
86
91
|
const WRITE_DESTINATION = /(写入|写到|写进|回写|落到|存到|更新到|同步到|填到)/;
|
|
92
|
+
// r67-01-F1/F2(探针复现,0.6.58 沙盒):「查应用列表和目录树」被 whole-package
|
|
93
|
+
// 吃掉——「目录」的「录」当时还是 BUILD_CUE(r67a 已删裸「录」),detectMode 判
|
|
94
|
+
// build 后 WHOLE_APP_CUES 的「应用」顶开整包门,读问句拿到 intent YAML。裸「查」
|
|
95
|
+
// 进不了 READ_CUES(includes-anywhere 会误吃写问句,见 READ_CUES 上方注释),所以
|
|
96
|
+
// 第二层防御放在整包门前做**组合**判定:读动词 × 盘点名词同时出现、且无任何
|
|
97
|
+
// 写词(build/modify cue 之外再否决 建/加/搭/配/删/改 裸单字——「配一条规则…查
|
|
98
|
+
// 信用回写」这类写问句里就有裸「查」,bizservice 别名路由的防回归钉着它)时才
|
|
99
|
+
// 按读问句改判。名词面收窄到盘点类(应用/目录/树/清单/列表/环境)——「模型」
|
|
100
|
+
// 这类写问句高频名词不进,组合词面才足够窄。真写问句(「建一个应用…」)自带
|
|
101
|
+
// 写词,不会被误判(detectMode 词表是第一层,本判定只兜它漏掉的形状,如非
|
|
102
|
+
// 前导的「应用目录树看一下」)。
|
|
103
|
+
const READ_INVENTORY_VERBS = /(查|看|列|盘点|清点|梳理|导出|搜)/;
|
|
104
|
+
const READ_INVENTORY_NOUNS = /(应用|目录|树|清单|列表|环境)/;
|
|
105
|
+
/** 裸单字写词:不在 BUILD/MODIFY cues 里、但出现在写问句中的高频字(含「配」)。 */
|
|
106
|
+
const READ_INVENTORY_WRITE_WORDS = /(建|加|搭|配|删|改|造|写|做)/;
|
|
107
|
+
/** r67-01-F1/F2:whole-package 门前的读盘点判定(词面与理由见上方注释)。 */
|
|
108
|
+
function looksReadInventoryAsk(goal) {
|
|
109
|
+
// 写词一票否决:命中任何 build/modify cue 或裸写字的问句不判读(「查完再加字段」仍走写路)。
|
|
110
|
+
if (READ_INVENTORY_WRITE_WORDS.test(goal))
|
|
111
|
+
return false;
|
|
112
|
+
if (BUILD_CUES.some((cue) => goal.includes(cue)))
|
|
113
|
+
return false;
|
|
114
|
+
if (MODIFY_CUES.some((cue) => goal.includes(cue)))
|
|
115
|
+
return false;
|
|
116
|
+
return READ_INVENTORY_VERBS.test(goal) && READ_INVENTORY_NOUNS.test(goal);
|
|
117
|
+
}
|
|
87
118
|
function detectMode(goal) {
|
|
88
119
|
if (SCOUT_CUES.some((cue) => goal.includes(cue)))
|
|
89
120
|
return "scout";
|
|
@@ -742,7 +773,11 @@ function goalRouteInner(registry, goal) {
|
|
|
742
773
|
const routeById = new Map(index.routes.map((route) => [route.id, route]));
|
|
743
774
|
const registryTools = new Map(registry.map((tool) => [tool.name, tool]));
|
|
744
775
|
const availableTopics = new Set(listSkills().map((topic) => topic.name));
|
|
745
|
-
|
|
776
|
+
// r67-01-F1/F2:读盘点问句不进 whole-package——mode 改判后 isWholePackageWrite/
|
|
777
|
+
// matchComposer/shouldPreferMultiFace 的 build|modify 门自然全部关上,走读路由。
|
|
778
|
+
let mode = detectMode(goal);
|
|
779
|
+
if (mode === "build" && looksReadInventoryAsk(goal))
|
|
780
|
+
mode = "read";
|
|
746
781
|
const readish = mode === "read" || mode === "scout";
|
|
747
782
|
// r60c-F8(真机复现):「按状态分组统计单据条数」被 cue「分组」误路由到 app
|
|
748
783
|
// 写面(app.create/update/delete,write:true)——纯读问句拿到写工具是危险误路由。
|
|
@@ -1181,6 +1216,8 @@ function goalRouteInner(registry, goal) {
|
|
|
1181
1216
|
capability: id,
|
|
1182
1217
|
lane: capability.lane,
|
|
1183
1218
|
tools: stepTools(registry, capability.lane),
|
|
1219
|
+
// r66 ②(c-F4):有依赖顺序的能力(report)在阶梯步骤里也带 order。
|
|
1220
|
+
...(capabilityOrder(id) ?? {}),
|
|
1184
1221
|
// r65 a-F6:多能力阶梯不内联 notes(字节),给一步指针。
|
|
1185
1222
|
notesCommand: `omc capability ${id} --executable`,
|
|
1186
1223
|
...(recipe
|
|
@@ -1313,6 +1350,9 @@ function goalRouteInner(registry, goal) {
|
|
|
1313
1350
|
? { primary: "intent" }
|
|
1314
1351
|
: { primary: "atomic", note: "该能力无声明式面(intent.level=none),走原子工具" }) : {}),
|
|
1315
1352
|
...(readish ? { readTools: readToolsInLane(registry, route.lane) } : { tools: route.tools }),
|
|
1353
|
+
// r66 ②(c-F4):有依赖顺序的能力(report)显式给 order,修掉 tools 键序
|
|
1354
|
+
// (注册序 link<create)对步骤顺序的误导。
|
|
1355
|
+
...(readish ? {} : (capabilityOrder(capabilityId) ?? {})),
|
|
1316
1356
|
// r65 a-F6(探针复现):定位语(workflow 的「测试提速三件套/运维过的实例权限
|
|
1317
1357
|
// 语义已变」)只活在 capability notes 里,next 不带——探针靠 ladder 回包顺带
|
|
1318
1358
|
// 瞥见才知道有这条路。单能力路由把 notes 直接内联(各能力 notes ≤ ~400B)。
|
|
@@ -1338,6 +1378,27 @@ function goalRouteInner(registry, goal) {
|
|
|
1338
1378
|
: { firstAnswer: { state: "needs-input", question: "要操作哪个对象?给我 schemaCode(或模型业务名,我列清单核对)", action: LIST_MODELS_ACTION, why: "未命中配方:需要目标对象 code 才能给出一步可跑的写命令" } }),
|
|
1339
1379
|
};
|
|
1340
1380
|
}
|
|
1381
|
+
/**
|
|
1382
|
+
* r66 ②(c-F4 真机复现):`next` 报表链回执的 `tools` 对象按 lane 注册序排列——
|
|
1383
|
+
* `report.datasource.link` 排在 `report.create` 前,探针照键序先 link 被拒
|
|
1384
|
+
* (dashboard 不存在)。tools map 是注册投影,键序不该被读成语义;有依赖顺序的
|
|
1385
|
+
* 能力在此声明 `order`,路由原样透出。未列的能力不输出(零字节)。
|
|
1386
|
+
*/
|
|
1387
|
+
const CAPABILITY_ORDERS = Object.freeze({
|
|
1388
|
+
report: ["report.create", "report.datasource.link", "report.configure", "report.update", "report.delete"],
|
|
1389
|
+
});
|
|
1390
|
+
/** 取能力的执行序(含 chartdata 取数边界注记),未声明返回 undefined。 */
|
|
1391
|
+
function capabilityOrder(capabilityId) {
|
|
1392
|
+
const order = CAPABILITY_ORDERS[capabilityId];
|
|
1393
|
+
if (order === undefined)
|
|
1394
|
+
return undefined;
|
|
1395
|
+
// chartdata 是取数一跳(环境边界:reporter 版本族须对齐主应用,8.6 环境见
|
|
1396
|
+
// r63 教学信封)——单列注记而不是塞进 order(它不是配置链的一环)。
|
|
1397
|
+
if (capabilityId === "report") {
|
|
1398
|
+
return { order, orderNote: "执行顺序见 order(tools 的键序是注册序,勿按它排步骤);chartdata 是取数一跳:需 reporter 版本族对齐主应用,环境边界,换参数/重试无用" };
|
|
1399
|
+
}
|
|
1400
|
+
return { order };
|
|
1401
|
+
}
|
|
1341
1402
|
/**
|
|
1342
1403
|
* `next` 的对外入口:原有路由结果原样返回,只在「引用/影响面」类提问上追加
|
|
1343
1404
|
* `graphHint`(不改 route、不改 confident、不改 firstAnswer)。理由见
|
package/dist/lanes/report.js
CHANGED
|
@@ -213,7 +213,10 @@ function summarizeChartEntry(entry) {
|
|
|
213
213
|
if (entry !== null && typeof entry === "object") {
|
|
214
214
|
const row = entry;
|
|
215
215
|
const field = row.field ?? row.name ?? row.code ?? row.alias ?? row.caption ?? row.id;
|
|
216
|
-
|
|
216
|
+
// r66 ②:真机报文(reporter 日志 @AfterThrowing args,2026-11-14 01:48)实证聚合键是
|
|
217
|
+
// `agg`(小写):{"field":"name","alias":"合同数","agg":"count"}。枚举来自 reporter
|
|
218
|
+
// AggregateTypeEnum:sum/avg/count/max/min/countDistinct/…(报文小写)。
|
|
219
|
+
const agg = row.agg ?? row.aggregation ?? row.aggFunc ?? row.aggregate ?? row.type;
|
|
217
220
|
return agg !== undefined ? `${String(field)}(${String(agg)})` : String(field);
|
|
218
221
|
}
|
|
219
222
|
return String(entry);
|
|
@@ -222,6 +225,12 @@ function summarizeChartEntry(entry) {
|
|
|
222
225
|
* r65 c-F8(探针复现):readback 只投影 uuid/title/type/dataSourceId/mainTable/position,
|
|
223
226
|
* 「按什么汇总」全在 data 里却不投影——回执只能证「图行存在」不能证「图配对」。
|
|
224
227
|
* 维度/度量做最佳努力摘要;解析不出结构时至少回 dataKeys 让调用方知道下一步取什么。
|
|
228
|
+
*
|
|
229
|
+
* r66 ② 纠偏(真机取证):data 内键是**单数** dimension/metric/filter/sort——r65 写的
|
|
230
|
+
* 复数 dimensions/measures 在真机形状下永远解析不出(fake 当时 dataAbsent 未暴露)。
|
|
231
|
+
* 真机报文:{"dimension":[],"metric":[{"field":"name","alias":"合同数","agg":"count"}],
|
|
232
|
+
* "filter":[],"sort":[],"limit":{"value":10,"showOthers":false},"options":{}}
|
|
233
|
+
* (reporter 日志 2026-11-14 01:48,r63_probe_chart;枚举=AggregateTypeEnum)。
|
|
225
234
|
*/
|
|
226
235
|
function chartDataSummary(raw) {
|
|
227
236
|
const data = parseJsonText(raw);
|
|
@@ -230,9 +239,9 @@ function chartDataSummary(raw) {
|
|
|
230
239
|
if (typeof data !== "object" || Array.isArray(data))
|
|
231
240
|
return { dataPresent: true };
|
|
232
241
|
const out = {};
|
|
233
|
-
for (const key of ["dimensions", "measures", "filters", "rows", "columns"]) {
|
|
242
|
+
for (const key of ["dimension", "metric", "filter", "sort", "dimensions", "measures", "filters", "rows", "columns"]) {
|
|
234
243
|
const value = data[key];
|
|
235
|
-
if (Array.isArray(value) && value.length > 0)
|
|
244
|
+
if (Array.isArray(value) && value.length > 0 && out[key] === undefined)
|
|
236
245
|
out[key] = value.slice(0, 6).map(summarizeChartEntry);
|
|
237
246
|
}
|
|
238
247
|
return Object.keys(out).length > 0 ? out : { dataKeys: Object.keys(data).slice(0, 10) };
|
|
@@ -406,6 +406,10 @@ export function registerRuleLifecycleLane(tools) {
|
|
|
406
406
|
? { dataInUse: true, hint: "302045:数据被占用(有人正在编辑该行 / 行锁未释放),稍后重试" }
|
|
407
407
|
: {}),
|
|
408
408
|
effectHint: "平台只回执行结果信封;返回的 data 是执行前快照(reacquireDataFromDb:false)。规则副作用必须另行读回:data.load {schemaCode, bizObjectId} 或 data.list(data.list 默认不含 DRAFT,草稿行请用 data.load)",
|
|
409
|
+
// r67a:触发成功 ≠ 执行成功——平台信封只有 errcode,真正的成败在规则
|
|
410
|
+
// 执行日志里(status:false 即执行失败)。回执直接给下一步命令,agent
|
|
411
|
+
// 不必再问"去哪看结果"。
|
|
412
|
+
nextCommand: `omc call rulelog.search --args '${JSON.stringify({ schemaCode: args.schemaCode, ruleCode: args.ruleCode, size: 5 })}' --env <env>(触发不等于成功——status:false 是执行失败;traceId 可对平台日志)`,
|
|
409
413
|
// NOT latestPublished: the platform's list projection reports
|
|
410
414
|
// latestPublished:false even for rows it executes fine (live
|
|
411
415
|
// 2026-10-23, documented in rule-support.ts) — a warning here would be
|
package/dist/lanes/rulelog.js
CHANGED
|
@@ -11,7 +11,9 @@ const notes = [codingNote, "日志异步落库约 5 秒,未见不等于未触
|
|
|
11
11
|
export function registerRuleLogLane(tools) {
|
|
12
12
|
tools.push(defineTool({
|
|
13
13
|
name: "rulelog.search", layer: "low", kind: "read", lane: RULELOG_LANE_CONTRACT.lane,
|
|
14
|
-
|
|
14
|
+
// r67a:真机验证(2026-11-15)「规则触发失败了怎么排查」在 commands --filter
|
|
15
|
+
// 全量召回里检不到本工具(只回 rule.get/rule.list 等 9 个)——补触发失败族短语。
|
|
16
|
+
search: { intents: ["规则执行日志", "规则日志", "执行日志", "查规则日志", "触发日志", "规则跑过没有", "规则触发失败", "触发失败", "规则执行失败", "规则没触发"] },
|
|
15
17
|
scope: RULELOG_LANE_CONTRACT.tools["rulelog.search"].scope,
|
|
16
18
|
description: RULELOG_LANE_CONTRACT.tools["rulelog.search"].description,
|
|
17
19
|
inputSchema: {
|
package/dist/path-projection.js
CHANGED
|
@@ -192,13 +192,20 @@ export const JQ_PATH_TOPIC = "omc-refusals";
|
|
|
192
192
|
export const JQ_PATH_SECTION = "10. 投影路径(--jq / --extract)";
|
|
193
193
|
export const JQ_PATH_HELP_POINTER = `语法详解:omc help ${JQ_PATH_TOPIC} --section 10(投影路径)。`;
|
|
194
194
|
/** Shared wording for every projection miss, so every face teaches the same syntax. */
|
|
195
|
-
|
|
195
|
+
// r66 ① readbackKeys(c-F2):R65 探针 3 次投影 miss 全靠 available 救回——键名
|
|
196
|
+
// 无处可查。裸 --jq(不带路径)= 键清单这个姿势一直在(cli.ts extractKeys 分支),
|
|
197
|
+
// 但没有任何一面教过它。miss 正是教学时机:撞过一次的人最听得进「先看全键再投影」。
|
|
198
|
+
// r67-03(触达失败复检):R67 探针 4 次 pathMiss 无一注意这句教学——它此前被夹在
|
|
199
|
+
// 语法长句(JQ_PATH_SYNTAX)之后的中段,读 hint 的人早被 available/语法淹没。
|
|
200
|
+
// 行动句提前到 available 说明之后、JQ_PATH_SYNTAX 之前,并改成「下一步先列键」
|
|
201
|
+
// 的动作式措辞:下一跳排在语法课前面,才会在注意力耗尽前被读到。
|
|
202
|
+
export const PATH_MISS_HINT = `路径未命中(这一层没有该段)。${RESULT_RELATIVE_PATH_NOTE}available 是该层真实存在的键。下一步先列键:--jq 不带路径重跑 = 全部顶层键一览。${JQ_PATH_SYNTAX}${JQ_PATH_RULES}${JQ_PATH_HELP_POINTER}`;
|
|
196
203
|
/**
|
|
197
204
|
* `artifact get` 面:产物内容的投影。区别只在开头——它已经把 miss 落在哪一段
|
|
198
205
|
* (`missedAt`)和可用的键/范围一并返回,所以不必重复「这一层没有该段」。
|
|
199
206
|
*/
|
|
200
207
|
export function artifactPathMissHint(at) {
|
|
201
|
-
return `路径未命中${at !== undefined ? `段 "${at}"` : "(这一层没有该段)"}——available 是该层真实存在的键/范围;方括号下标(a[0])与点式(a.0
|
|
208
|
+
return `路径未命中${at !== undefined ? `段 "${at}"` : "(这一层没有该段)"}——available 是该层真实存在的键/范围;方括号下标(a[0])与点式(a.0)等价;想一次拿全部顶层键:--keys(或裸 --jq)。${JQ_PATH_SYNTAX}${JQ_PATH_RULES}${JQ_PATH_HELP_POINTER}`;
|
|
202
209
|
}
|
|
203
210
|
/** 逗号多路径里只有部分 miss:给出定位方式 + 同一套语法。 */
|
|
204
211
|
export function partialPathMissHint() {
|
package/dist/read-shapes.js
CHANGED
|
@@ -161,6 +161,52 @@ const READ_SHAPES = {
|
|
|
161
161
|
keys: ["roleId", "userId", "count", "scopes:array<{id,deptId,name,type,deptPath,includeChildren,source}>", "actor?", "readback"],
|
|
162
162
|
notes: ["不是枚举档位:scopes 是部门节点列表;roleId 与 roleCode 二者其一;includeChildren 平台不返回(unknown);source:configured;空结果是合法空集"],
|
|
163
163
|
},
|
|
164
|
+
// r66 ① readbackKeys(c-F2):R65 探针 3 次投影 miss(items→applications 类)靠 pathMiss
|
|
165
|
+
// 救回;报表面当时整族零声明。以下 9 条全部从 fake 真实回执采样生成
|
|
166
|
+
// (node --import tsx 采样脚本:create→link→configure→get/chartdata 全链),非手写。
|
|
167
|
+
// 写面条目列 readback 内层键(回执壳 performed/deliveryState/summary/detailFile 等
|
|
168
|
+
// 是所有写工具共同结构,见 --full);returnsFace 只取 notes[0]。
|
|
169
|
+
"report.tree": {
|
|
170
|
+
keys: ["status", "appCode", "reportCount", "reports:array<{code,name,treeNodeId,parentId,path,charts}>", "chartTreeCount", "note"],
|
|
171
|
+
notes: ["列表键是 reports[](不是 items/folders);行内 charts 是图表计数"],
|
|
172
|
+
},
|
|
173
|
+
"report.datasource.list": {
|
|
174
|
+
keys: ["status", "kind", "parentObjectId?", "count", "modelCount", "datasources:array<{dataSourceId,displayName,nodeType,useType,objectId,corpId,linkObjectId?}>", "note", "nextCommand"],
|
|
175
|
+
notes: ["行名是 displayName(不是 name);模型行 nodeType:1 的 objectId 才是 link 用的 id(dataSourceId 恒 null);顶层无模型行时按 nextCommand 传 parentObjectId 下钻"],
|
|
176
|
+
},
|
|
177
|
+
"report.get": {
|
|
178
|
+
keys: ["status", "report:{id,code,name,appCode,parentId,path,...}", "bi:{present,corpId,chartCount,charts,globalPresent,attributesPresent}", "global", "attributes", "charts:array<{uuid,chartCode,chartName,chartType,dimensions,measures}>", "environmentFingerprint"],
|
|
179
|
+
notes: ["入参叫 code(不是 reportCode);bi.charts[].uuid 是 configure/chartdata 的图表标识"],
|
|
180
|
+
},
|
|
181
|
+
"report.chartdata": {
|
|
182
|
+
keys: ["status", "data:{series,total,metricFields}", "environmentFingerprint"],
|
|
183
|
+
notes: ["入参 reportCode + chart:{uuid}(对象非字符串);数据由 reporter 服务出,环境缺 reporter 时回教学信封"],
|
|
184
|
+
},
|
|
185
|
+
"report.create": {
|
|
186
|
+
keys: ["status", "readback:{present,report,biInitialized,treeNodeId,actualParentId,actualPath}", "rollback"],
|
|
187
|
+
notes: ["parentId 必须是目录 treeNodeId(非目录拒并给 folderCandidates);建完要 datasource.link + configure 才有内容"],
|
|
188
|
+
},
|
|
189
|
+
"report.update": {
|
|
190
|
+
keys: ["status", "readback:{present,report}", "rollback"],
|
|
191
|
+
notes: ["入参只认 code(reportCode/appCode 是未知键,会被拒)"],
|
|
192
|
+
},
|
|
193
|
+
"report.configure": {
|
|
194
|
+
keys: ["status", "readback:{chartCount,charts:array<{uuid,title,type,dataSourceId,mainTable,position,dataSummary}>,globalPresent,attributesPresent}", "rollback"],
|
|
195
|
+
notes: ["charts[].uuid 必带(既有图表=更新,新图表自带 uuid),缺 uuid 整批拒;先 datasource.link 否则图表无数据源"],
|
|
196
|
+
},
|
|
197
|
+
"report.datasource.link": {
|
|
198
|
+
keys: ["status", "readback:{linkedCount,models:array<{dataSourceId,displayName,tableName}>}", "rollback"],
|
|
199
|
+
notes: ["dataSourceInfos[].dataSourceId 用模型行 objectId(datasource.list 下钻 nodeType:1 行);应用级 id 会被拒"],
|
|
200
|
+
},
|
|
201
|
+
"report.delete": {
|
|
202
|
+
keys: ["status", "readback:{absent,remainingInTree,biRemoved,platformRemoved}", "rollback"],
|
|
203
|
+
notes: ["三面删除确认(dashboard/bi/platform);remainingInTree:false 才是真删净"],
|
|
204
|
+
},
|
|
205
|
+
// r67a:真机采样(2026-11-15,crm_contract 545 条日志面)
|
|
206
|
+
"rulelog.search": {
|
|
207
|
+
keys: ["status", "index:{page,size,totalElements,totalPages}", "logs:array<{ruleCode,name,triggerType,status,triggerTime,finishTime,ruleVersion,traceId,triggerRows[]}>", "notes", "environmentFingerprint"],
|
|
208
|
+
notes: ["log 行 status:false=执行失败(布尔不是字符串);includeNodes:true 时 logs[].nodes=节点级执行链(type/name/status/errMsg——仅前 3 条,BIZ_ACTION 的 errMsg 直接给根因);traceId 对平台全链路日志"],
|
|
209
|
+
},
|
|
164
210
|
};
|
|
165
211
|
/** Lookup the authored return shape for a tool, if any. */
|
|
166
212
|
export function readShapeFor(toolName) {
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { environment, commonRecovery } from "./shared.js";
|
|
2
|
+
const reportChartSumRecipe = Object.freeze({
|
|
3
|
+
id: "report-chart-sum",
|
|
4
|
+
title: "报表配图:按维度汇总度量(如按供应商汇总金额 SUM / 按状态计数)",
|
|
5
|
+
aliases: ["汇总图", "统计图", "柱状图", "饼图", "分组统计", "按维度汇总", "配图"],
|
|
6
|
+
status: "offline-valid",
|
|
7
|
+
tool: "report.configure",
|
|
8
|
+
args: {
|
|
9
|
+
environment,
|
|
10
|
+
reportCode: "vendor_cost_report",
|
|
11
|
+
appCode: "<appCode>",
|
|
12
|
+
charts: [
|
|
13
|
+
{
|
|
14
|
+
uuid: "chart-vendor-amount-sum",
|
|
15
|
+
title: "各供应商费用金额汇总",
|
|
16
|
+
type: "bar",
|
|
17
|
+
dataSourceId: "<模型行 objectId:report.datasource.list 下钻 nodeType:1 行的 objectId>",
|
|
18
|
+
mainTable: "<= datasource.link 回执的 tableName 原样(无 t_ 前缀,如 ia38g_crm_contract)>",
|
|
19
|
+
position: { x: 0, y: 0, w: 8, h: 6 },
|
|
20
|
+
data: {
|
|
21
|
+
dimension: [{ field: "vendor", alias: "供应商" }],
|
|
22
|
+
metric: [{ field: "amount", alias: "金额合计", agg: "sum" }],
|
|
23
|
+
filter: [],
|
|
24
|
+
sort: [],
|
|
25
|
+
limit: { value: 20, showOthers: false },
|
|
26
|
+
options: {},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
preconditions: [
|
|
32
|
+
"报表页已创建(report.create)且 BI dashboard present(report.get bi.present=true)",
|
|
33
|
+
"数据源已连接(report.datasource.link 用模型行 objectId)",
|
|
34
|
+
],
|
|
35
|
+
conditionalRequirements: [
|
|
36
|
+
"charts[].uuid 必带且自造(如 chart-<业务名>)——既有 uuid=更新,新 uuid=新增,缺 uuid 整批拒",
|
|
37
|
+
"data.dimension=维度(分组键,条目 {field,alias?});data.metric=度量(条目 {field,alias?,agg})——键是**单数** dimension/metric",
|
|
38
|
+
"agg 枚举(reporter AggregateTypeEnum,报文小写):sum/avg/count/max/min/countDistinct/groupConcat",
|
|
39
|
+
"dataSourceId 用**模型行 objectId**(datasource.list 下钻 nodeType:1 行);应用级 id 会被拒",
|
|
40
|
+
// r67 探针 01 实证:mainTable 写 t_ 前缀也能存(平台不校验),但权威口径是无前缀
|
|
41
|
+
// ——datasource.link 回执 tableName 与 BI 前端原生报文(r63 取证)都是 ia38g_crm_contract 形
|
|
42
|
+
"mainTable = datasource.link 回执的 tableName 原样(无 t_ 前缀;真机双证 2026-11-15)",
|
|
43
|
+
"data/position 对象或 JSON 字符串都可(工具层统一序列化)",
|
|
44
|
+
"type 常见:bar(柱)/ card(指标卡)/ pie(饼)/ table(明细)",
|
|
45
|
+
],
|
|
46
|
+
priorToolReferences: [
|
|
47
|
+
{ tool: "report.create", args: { environment, code: "vendor_cost_report", name: "供应商费用", appCode: "<appCode>", parentId: "<目录 treeNodeId>" }, purpose: "建报表页(parentId 必须是应用树 type=Folder 目录 id)" },
|
|
48
|
+
{ tool: "report.datasource.list", args: { environment, reportCode: "vendor_cost_report", appCode: "<appCode>", parentObjectId: "<顶层行的 objectId>" }, purpose: "下钻找 nodeType:1 模型行,取 objectId 当 dataSourceId" },
|
|
49
|
+
{ tool: "report.datasource.link", args: { environment, reportCode: "vendor_cost_report", appCode: "<appCode>", dataSourceInfos: [{ dataSourceId: "<模型行 objectId>", useType: 1 }] }, purpose: "连数据源(不连则图表无数据)" },
|
|
50
|
+
],
|
|
51
|
+
dryRun: { supported: true, command: `omc call report.configure --env ${environment} --dry-run --args '<recipe.args>'`, notes: "dry-run 走 schema/语义/治理预检,不写 BI" },
|
|
52
|
+
expectedReadback: {
|
|
53
|
+
readback: {
|
|
54
|
+
chartCount: 1,
|
|
55
|
+
charts: [{ uuid: "chart-vendor-amount-sum", dataSummary: { dimension: ["vendor(供应商)"], metric: ["amount(sum)"] } }],
|
|
56
|
+
},
|
|
57
|
+
next: ["report.get(读回全量 charts 维度/度量)", "report.chartdata(取数:需 reporter 版本族对齐主应用,环境边界)"],
|
|
58
|
+
},
|
|
59
|
+
refusalRecovery: [
|
|
60
|
+
{ code: "report-chart-uuid-required", action: "每个 charts[] 条目补自造 uuid(chart-<业务名>)" },
|
|
61
|
+
{ code: "report-dashboard-absent", action: "先 report.create 初始化 BI dashboard,再 configure" },
|
|
62
|
+
{ code: "report-datasource-link-not-synced", action: "dataSourceId 用模型行 objectId(datasource.list 下钻 nodeType:1),不是应用级 id" },
|
|
63
|
+
...commonRecovery,
|
|
64
|
+
],
|
|
65
|
+
requiresEnvironmentDerivedIds: true,
|
|
66
|
+
prerequisiteData: { source: "report.datasource.list", fields: ["objectId(模型行)"] },
|
|
67
|
+
});
|
|
68
|
+
const reportBarChartExample = Object.freeze({
|
|
69
|
+
id: "report-bar-chart",
|
|
70
|
+
title: "charts[] 已知键速查(真机报文取证的字段清单)",
|
|
71
|
+
status: "offline-valid",
|
|
72
|
+
tool: "report.configure",
|
|
73
|
+
args: {
|
|
74
|
+
environment,
|
|
75
|
+
reportCode: "<reportCode>",
|
|
76
|
+
appCode: "<appCode>",
|
|
77
|
+
charts: [
|
|
78
|
+
{
|
|
79
|
+
uuid: "<必带,自造>",
|
|
80
|
+
title: "图表标题",
|
|
81
|
+
type: "bar",
|
|
82
|
+
content: " ",
|
|
83
|
+
dataSourceId: "<模型行 objectId>",
|
|
84
|
+
mainTable: "<= datasource.link 回执 tableName(无 t_ 前缀)>",
|
|
85
|
+
position: { x: 0, y: 0, w: 4, h: 4 },
|
|
86
|
+
styles: null,
|
|
87
|
+
useType: 1,
|
|
88
|
+
authorization: null,
|
|
89
|
+
data: { dimension: [], metric: [{ field: "name", alias: "合同数", agg: "count" }], filter: [], sort: [], limit: { value: 10, showOthers: false }, options: {} },
|
|
90
|
+
mobileOptions: null,
|
|
91
|
+
customSort: null,
|
|
92
|
+
deleteStatus: 0,
|
|
93
|
+
jumpingRules: null,
|
|
94
|
+
relations: null,
|
|
95
|
+
parentId: null,
|
|
96
|
+
formulas: null,
|
|
97
|
+
conditionFormats: null,
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
removeUnlistedCharts: false,
|
|
101
|
+
corpId: "<corpId,默认 a>",
|
|
102
|
+
},
|
|
103
|
+
preconditions: ["同 report-chart-sum(先 create + link)"],
|
|
104
|
+
conditionalRequirements: [
|
|
105
|
+
"本例是 BI 前端保存图表的**完整字段清单**(真机 addChart 报文逐字段);常规配图只填 uuid/title/type/dataSourceId/mainTable/data,其余保持默认",
|
|
106
|
+
"data 内键:dimension/metric/filter/sort/limit/options(全单数);limit 是 {value,showOthers} 对象",
|
|
107
|
+
],
|
|
108
|
+
priorToolReferences: [],
|
|
109
|
+
dryRun: { supported: true, command: `omc call report.configure --env ${environment} --dry-run --args '<recipe.args>'`, notes: "dry-run 预检" },
|
|
110
|
+
expectedReadback: { readback: { charts: [{ dataSummary: { metric: ["name(count)"] } }] } },
|
|
111
|
+
refusalRecovery: [...commonRecovery],
|
|
112
|
+
requiresEnvironmentDerivedIds: true,
|
|
113
|
+
});
|
|
114
|
+
export const REPORT_METADATA = Object.freeze({
|
|
115
|
+
"report.configure": Object.freeze({ recipes: [reportChartSumRecipe, reportBarChartExample], relatedTools: ["report.create", "report.datasource.list", "report.datasource.link", "report.get", "report.chartdata"] }),
|
|
116
|
+
});
|
|
117
|
+
//# sourceMappingURL=report.js.map
|
package/dist/search-index.js
CHANGED
|
@@ -31,6 +31,12 @@ const KEY_RULES = Object.freeze({
|
|
|
31
31
|
serviceCode: { cls: "registry", source: "service.list → serviceCode" },
|
|
32
32
|
methodCode: { cls: "registry", source: "method.get / service.get → methodCode" },
|
|
33
33
|
serviceCategoryId: { cls: "registry", source: "service.category.list → id(「全部」空 id 不可用)" },
|
|
34
|
+
// r66 ②:report.configure 两配方(report-chart-sum / report-bar-chart)的参数面
|
|
35
|
+
reportCode: { cls: "registry", source: "report.tree → reports[].code(已存在报表)" },
|
|
36
|
+
appCode: { cls: "registry", source: "discover_environment → applications[].code" },
|
|
37
|
+
charts: { cls: "user", source: "配图清单(维度/度量/聚合)是需求本体", user: "utterance" },
|
|
38
|
+
removeUnlistedCharts: { cls: "auto", source: "步骤开关(默认 false=只增改不删)" },
|
|
39
|
+
corpId: { cls: "auto", source: "BI 租户 id(默认 a;report.get bi.corpId 可核对)" },
|
|
34
40
|
fieldCodes: {
|
|
35
41
|
cls: "user",
|
|
36
42
|
source: "列的候选由 field.list 提供,但「列表要显示哪几列」是业务选择",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stalfh233/omc-cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.59",
|
|
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.59",
|
|
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.59"
|
|
78
78
|
}
|
|
79
79
|
}
|
|
@@ -150,6 +150,12 @@ rules:
|
|
|
150
150
|
- 筛选条件默认显示:`conditions[].visible` 不传也应为 true。
|
|
151
151
|
- 配置默认视图后即可用 `data.list`;否则部分 8.6.26 读面业务列可能为 null,单行用 `data.load` 核对。
|
|
152
152
|
- 读回视图用 `listview.get`(默认回列/排序/条件/动作紧凑清单)与 `listview.list`。
|
|
153
|
+
- **model.create 不自动发布表单页**(r65 真机):模型建好 ≠ 门户有页面——直接打开会回「form is unpublished」。要 `form.publish` + `listview.configure`(默认视图)后门户才有页面可看。
|
|
154
|
+
- **门户页面 URL 模式**(r65 真机取证,验收/取证用):
|
|
155
|
+
- 表单详情页 `/form/detail?schemaCode=<模型code>&objectId=<数据id>`
|
|
156
|
+
- 列表页 `/application/<appCode>/application-list/<schemaCode>`
|
|
157
|
+
- 应用列表 `/app-list/applications`
|
|
158
|
+
- 渲染取证必须打开真实页面看(存储回读 ≠ 门户认,如百分比 `ratio.*` 格式族)。
|
|
153
159
|
|
|
154
160
|
## 流程
|
|
155
161
|
|