@stalfh233/omc-cli 0.6.44 → 0.6.49
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/capability-overview.js +113 -0
- package/dist/cli-stdout.js +3 -0
- package/dist/cli.js +255 -60
- package/dist/command-transport.js +5 -1
- package/dist/discovery.js +193 -75
- package/dist/goal-plan.js +1244 -0
- package/dist/goal-routes.js +78 -3
- package/dist/graph.js +264 -38
- package/dist/lanes/app.js +4 -0
- package/dist/lanes/apply-changes.js +1 -0
- package/dist/lanes/b2-registration.js +24 -0
- package/dist/lanes/businessrule.js +5 -0
- package/dist/lanes/custom-page.js +8 -0
- package/dist/lanes/datarule.js +4 -0
- package/dist/lanes/dictionary.js +13 -0
- package/dist/lanes/environment.js +2 -0
- package/dist/lanes/field.js +14 -0
- package/dist/lanes/folder.js +4 -0
- package/dist/lanes/form.js +5 -0
- package/dist/lanes/list-view.js +5 -0
- package/dist/lanes/meta.js +5 -0
- package/dist/lanes/model.js +9 -0
- package/dist/lanes/online-js.js +2 -0
- package/dist/lanes/organization.js +20 -0
- package/dist/lanes/perm.js +5 -5
- package/dist/lanes/programming.js +6 -0
- package/dist/lanes/report.js +9 -0
- package/dist/lanes/rule-lifecycle.js +6 -0
- package/dist/lanes/rulelog.js +1 -0
- package/dist/lanes/runtime-data.js +6 -0
- package/dist/lanes/workflow.js +18 -0
- package/dist/mcp-graph.js +180 -41
- package/dist/package-tool.js +1 -0
- package/dist/search-index.js +137 -0
- package/dist/tool-search.js +647 -0
- package/dist/tools.js +1 -0
- package/dist/write.js +2 -1
- package/docs/omc-introduction.md +5 -7
- package/package.json +6 -5
- package/skills/omc-business-configuration.md +2 -1
- package/skills/omc-capabilities.md +3 -2
- package/skills/omc-start-here.md +21 -7
- package/skills/omc-tool-selection.md +7 -15
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { toolSearchMeta } from "./tool-search.js";
|
|
2
|
+
/**
|
|
3
|
+
* 单工具的检索面投影:把「名字派生」(对象段/意图类/只读/破坏性)与「作者声明」
|
|
4
|
+
* (`search.intents`)合成 B/C/M3 共用的稳定形状。
|
|
5
|
+
*
|
|
6
|
+
* 这里是**唯一**派生处:`tool-search.ts` 的打分、`commands --filter` 的召回、
|
|
7
|
+
* 校验门的缺口清单都读它,避免三份实现漂移。
|
|
8
|
+
*/
|
|
9
|
+
export function toolSearchFacets(tool) {
|
|
10
|
+
const meta = toolSearchMeta(tool);
|
|
11
|
+
const aliases = tool.search?.intents ?? [];
|
|
12
|
+
const recipeIds = (tool.executionMetadata?.recipes ?? []).map((recipe) => recipe.id);
|
|
13
|
+
return {
|
|
14
|
+
name: tool.name,
|
|
15
|
+
objectPath: meta.objectPath,
|
|
16
|
+
...(meta.action === undefined ? {} : { action: meta.action }),
|
|
17
|
+
tier: meta.tier,
|
|
18
|
+
readOnly: meta.readOnly,
|
|
19
|
+
destructive: meta.destructive,
|
|
20
|
+
aliases: [...aliases],
|
|
21
|
+
recipes: recipeIds,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
const KEY_RULES = Object.freeze({
|
|
25
|
+
environment: { cls: "registry", source: "环境 profile(--env / .omc-env)" },
|
|
26
|
+
schemaCode: { cls: "registry", source: "model.list → models[].schemaCode(名称匹配,可能歧义)" },
|
|
27
|
+
applicationCode: { cls: "registry", source: "discover_environment → applicationCode" },
|
|
28
|
+
workflowCode: { cls: "registry", source: "workflow.get_published → code" },
|
|
29
|
+
sheetCode: { cls: "registry", source: "form.get / model.inspect → 默认表单槽位" },
|
|
30
|
+
propertyCode: { cls: "registry", source: "field.list → fields[].code(名称匹配,可能歧义)" },
|
|
31
|
+
serviceCode: { cls: "registry", source: "service.list → serviceCode" },
|
|
32
|
+
methodCode: { cls: "registry", source: "method.get / service.get → methodCode" },
|
|
33
|
+
serviceCategoryId: { cls: "registry", source: "service.category.list → id(「全部」空 id 不可用)" },
|
|
34
|
+
fieldCodes: {
|
|
35
|
+
cls: "user",
|
|
36
|
+
source: "列的候选由 field.list 提供,但「列表要显示哪几列」是业务选择",
|
|
37
|
+
user: "utterance",
|
|
38
|
+
},
|
|
39
|
+
bizObjectId: { cls: "probe", source: "前序 data.save 回执 performed.bizObjectId" },
|
|
40
|
+
workflowInstanceId: { cls: "probe", source: "前序 data.save 回执 performed.workflowInstanceId" },
|
|
41
|
+
workItemId: { cls: "probe", source: "前序 data.save 回执 performed.workItemId" },
|
|
42
|
+
dictionaryType: { cls: "auto", source: "配方选定的字典形态枚举" },
|
|
43
|
+
adapterCode: { cls: "auto", source: "配方选定的接入适配器(service.adapter_config 可核对)" },
|
|
44
|
+
dataRuleType: { cls: "auto", source: "配方选定的规则机制(1..5),由需求形态决定" },
|
|
45
|
+
publish: { cls: "auto", source: "步骤开关(配方默认发布)" },
|
|
46
|
+
publishForm: { cls: "auto", source: "步骤开关(配方默认发布表单)" },
|
|
47
|
+
replace: { cls: "auto", source: "脚本写入模式(整段替换 vs 增量 merge),由「给的是完整外壳」决定" },
|
|
48
|
+
size: { cls: "auto", source: "分页大小默认值" },
|
|
49
|
+
sortKey: { cls: "auto", source: "规则排序默认值(配方给固定序)" },
|
|
50
|
+
name: { cls: "user", source: "业务命名,需求话语通常直接给出", user: "utterance" },
|
|
51
|
+
code: { cls: "user", source: "新建对象的编码;命名规范需约定,可提议", user: "propose" },
|
|
52
|
+
ruleCode: { cls: "user", source: "规则编码;可由名称派生,可提议", user: "propose" },
|
|
53
|
+
propertyType: { cls: "user", source: "字段类型由需求语义决定(金额→NUMERICAL…)", user: "utterance" },
|
|
54
|
+
options: { cls: "user", source: "字段/规则配置(精度、选项集、条件串、公式…)由需求决定", user: "utterance" },
|
|
55
|
+
checkType: { cls: "user", source: "校验类型由需求决定(正则/长度/跨字段…)", user: "utterance" },
|
|
56
|
+
fields: { cls: "user", source: "字段清单是需求本体", user: "utterance" },
|
|
57
|
+
subFields: { cls: "user", source: "子表列清单是需求本体", user: "utterance" },
|
|
58
|
+
formData: { cls: "user", source: "业务数据载荷是需求本体", user: "utterance" },
|
|
59
|
+
filter: { cls: "user", source: "查询语义(op/字段/值)是需求本体", user: "utterance" },
|
|
60
|
+
records: { cls: "user", source: "字典键值对是需求本体", user: "utterance" },
|
|
61
|
+
source: { cls: "user", source: "在线 JS 源码是需求本体", user: "utterance" },
|
|
62
|
+
template: { cls: "user", source: "流程拓扑(节点/连线/参与人/条件)是需求本体", user: "utterance" },
|
|
63
|
+
nodeGraph: { cls: "user", source: "规则图(节点/动作/条件)是需求本体", user: "utterance" },
|
|
64
|
+
draftViewJson: { cls: "user", source: "表单布局行分组是需求本体", user: "utterance" },
|
|
65
|
+
draftAttributesJson: { cls: "user", source: "控件属性(span/options)是需求本体", user: "utterance" },
|
|
66
|
+
handler: { cls: "user", source: "绑定哪个流程事件(start/cancel/activate/end)由需求决定", user: "utterance" },
|
|
67
|
+
methodName: { cls: "user", source: "方法名属于接口契约", user: "utterance" },
|
|
68
|
+
methodConfig: { cls: "user", source: "HTTP 契约来自外部接口文档", user: "utterance" },
|
|
69
|
+
serviceConfig: { cls: "user", source: "服务级配置(auth/commonlist)来自外部接口文档", user: "utterance" },
|
|
70
|
+
methodInputParameters: { cls: "user", source: "入参面来自外部接口文档", user: "utterance" },
|
|
71
|
+
methodOutputParameters: { cls: "user", source: "出参面来自外部接口文档", user: "utterance" },
|
|
72
|
+
});
|
|
73
|
+
/**
|
|
74
|
+
* 同名参数在不同工具里语义不同。这三条不覆盖就会把「已存在对象的 code」
|
|
75
|
+
* 算成「新建编码」,把可读的标识算成必须问用户。
|
|
76
|
+
*/
|
|
77
|
+
const OVERRIDES = Object.freeze([
|
|
78
|
+
{
|
|
79
|
+
tool: "field.update",
|
|
80
|
+
key: "code",
|
|
81
|
+
rule: { cls: "registry", source: "field.list → fields[].code(要改的那个字段)" },
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
tool: "workflow.update",
|
|
85
|
+
key: "code",
|
|
86
|
+
rule: { cls: "registry", source: "workflow.get_published / get_draft → workflow.code" },
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
tool: "workflow.bindRule",
|
|
90
|
+
key: "ruleCode",
|
|
91
|
+
rule: { cls: "registry", source: "rule.list → 规则 code(null=预置 Create)" },
|
|
92
|
+
},
|
|
93
|
+
]);
|
|
94
|
+
/** 单个参数槽位的填充规则;未登记即 `unknown`(宁可暴露缺口,不要猜)。 */
|
|
95
|
+
export function paramFillRuleFor(tool, recipe, key) {
|
|
96
|
+
const override = OVERRIDES.find((entry) => entry.tool === tool && entry.recipe === recipe && entry.key === key)
|
|
97
|
+
?? OVERRIDES.find((entry) => entry.tool === tool && entry.recipe === undefined && entry.key === key);
|
|
98
|
+
if (override)
|
|
99
|
+
return override.rule;
|
|
100
|
+
return KEY_RULES[key] ?? { cls: "unknown", source: "未分类" };
|
|
101
|
+
}
|
|
102
|
+
const EMPTY_COUNTS = Object.freeze({
|
|
103
|
+
auto: 0,
|
|
104
|
+
registry: 0,
|
|
105
|
+
probe: 0,
|
|
106
|
+
user: 0,
|
|
107
|
+
unknown: 0,
|
|
108
|
+
});
|
|
109
|
+
/** 把一个 recipe 的顶层参数按规则分类(M0-1 脚本与 M3 plan 共用这一份)。 */
|
|
110
|
+
export function recipeFillFacet(tool, recipe, status, args) {
|
|
111
|
+
const slots = Object.entries(args).map(([key, value]) => {
|
|
112
|
+
const rule = paramFillRuleFor(tool, recipe, key);
|
|
113
|
+
return {
|
|
114
|
+
key,
|
|
115
|
+
...rule,
|
|
116
|
+
bytes: Buffer.byteLength(JSON.stringify(value) ?? "", "utf8"),
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
const counts = { ...EMPTY_COUNTS };
|
|
120
|
+
for (const slot of slots)
|
|
121
|
+
counts[slot.cls] += 1;
|
|
122
|
+
const mechanical = counts.auto + counts.registry + counts.probe;
|
|
123
|
+
return {
|
|
124
|
+
tool,
|
|
125
|
+
recipe,
|
|
126
|
+
status,
|
|
127
|
+
argsBytes: Buffer.byteLength(JSON.stringify(args), "utf8"),
|
|
128
|
+
slots,
|
|
129
|
+
counts,
|
|
130
|
+
mechanicalRatio: slots.length === 0 ? 1 : mechanical / slots.length,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
/** 一个工具全部配方的填充面(无配方时为空数组)。 */
|
|
134
|
+
export function toolFillFacets(tool) {
|
|
135
|
+
return (tool.executionMetadata?.recipes ?? []).map((recipe) => recipeFillFacet(tool.name, recipe.id, recipe.status, recipe.args));
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=search-index.js.map
|