@stalfh233/omc-cli 0.6.7 → 0.6.10

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.
Files changed (67) hide show
  1. package/README.md +2 -1
  2. package/dist/approval-flow.js +5 -3
  3. package/dist/bizservice-config.js +26 -10
  4. package/dist/call.js +47 -0
  5. package/dist/capability-overview.js +47 -24
  6. package/dist/cli-contract.js +73 -26
  7. package/dist/cli-output.js +41 -2
  8. package/dist/cli-stdout.js +74 -0
  9. package/dist/cli.js +135 -52
  10. package/dist/command-transport.js +8 -1
  11. package/dist/config-store.js +17 -2
  12. package/dist/discovery.js +62 -3
  13. package/dist/field-families.js +35 -6
  14. package/dist/goal-routes.js +118 -11
  15. package/dist/human-summary.js +11 -0
  16. package/dist/lanes/app-contract.js +12 -5
  17. package/dist/lanes/app.js +221 -134
  18. package/dist/lanes/apply-changes.js +2 -1
  19. package/dist/lanes/b2-registration-contract.js +3 -3
  20. package/dist/lanes/b2-registration.js +890 -693
  21. package/dist/lanes/businessrule.js +75 -51
  22. package/dist/lanes/custom-page.js +166 -115
  23. package/dist/lanes/datarule-contract.js +2 -2
  24. package/dist/lanes/datarule.js +238 -154
  25. package/dist/lanes/dictionary.js +253 -110
  26. package/dist/lanes/environment.js +57 -9
  27. package/dist/lanes/field.js +160 -107
  28. package/dist/lanes/folder-contract.js +7 -3
  29. package/dist/lanes/folder.js +249 -118
  30. package/dist/lanes/form-contract.js +1 -1
  31. package/dist/lanes/form.js +188 -64
  32. package/dist/lanes/list-view.js +405 -369
  33. package/dist/lanes/meta.js +31 -6
  34. package/dist/lanes/model-contract.js +1 -1
  35. package/dist/lanes/model.js +610 -512
  36. package/dist/lanes/online-js-contract.js +1 -1
  37. package/dist/lanes/online-js.js +160 -146
  38. package/dist/lanes/organization.js +905 -640
  39. package/dist/lanes/programming.js +274 -136
  40. package/dist/lanes/report-contract.js +2 -2
  41. package/dist/lanes/report.js +354 -198
  42. package/dist/lanes/rule-lifecycle.js +294 -140
  43. package/dist/lanes/runtime-data-contract.js +4 -4
  44. package/dist/lanes/runtime-data.js +869 -745
  45. package/dist/lanes/workflow-contract.js +3 -3
  46. package/dist/lanes/workflow.js +732 -605
  47. package/dist/model-scaffold.js +26 -5
  48. package/dist/path-projection.js +196 -14
  49. package/dist/plan.js +25 -0
  50. package/dist/programming-workflow.js +55 -3
  51. package/dist/read-shapes.js +146 -0
  52. package/dist/read.js +40 -9
  53. package/dist/recipes/businessrule.js +74 -24
  54. package/dist/recipes/dictionary.js +7 -4
  55. package/dist/recipes/form.js +46 -0
  56. package/dist/recipes/runtime-data.js +3 -2
  57. package/dist/refusal-guidance.js +29 -5
  58. package/dist/rule-support.js +14 -1
  59. package/dist/rule-when.js +2 -2
  60. package/dist/tool-types.js +9 -3
  61. package/dist/version-family-gaps.js +101 -0
  62. package/dist/write.js +2 -1
  63. package/package.json +6 -4
  64. package/skills/omc-glossary.md +13 -0
  65. package/skills/omc-refusals.md +13 -5
  66. package/skills/omc-tool-selection.md +2 -1
  67. package/skills/omc-write-hazards.md +5 -2
@@ -3,6 +3,7 @@ import { environmentArg } from "../args.js";
3
3
  import { environmentNotice, environmentWritable, requiresProductionConfirmation } from "../environment-policy.js";
4
4
  import { removedProfileKeys } from "../config-store.js";
5
5
  import { defineTool } from "../tool-types.js";
6
+ import { unsupportedCapabilities } from "../version-family-gaps.js";
6
7
  import { META_LANE_CONTRACT } from "./meta-contract.js";
7
8
  const META_TOOLS = META_LANE_CONTRACT.tools;
8
9
  export function registerMetaLane(tools) {
@@ -10,11 +11,29 @@ export function registerMetaLane(tools) {
10
11
  name: "coverage.manifest",
11
12
  layer: "meta",
12
13
  kind: "meta",
13
- description: META_TOOLS["coverage.manifest"].description,
14
- inputSchema: { full: z.boolean().optional().describe("返回完整覆盖投影;默认返回紧凑摘要") },
14
+ // r28k F5:manifest 是 lane 粒度,不是 capability id(放首句,避免 summary 截断吞掉)。
15
+ description: `Indexed by lane (not capability id, one lane may have multiple rows) — for "can X be used?" use omc capability <id>. ${META_TOOLS["coverage.manifest"].description}`,
16
+ inputSchema: {
17
+ full: z.boolean().optional().describe("返回完整覆盖投影;默认返回紧凑摘要"),
18
+ // r28k F6(真机 2026-11-05):探针传 `{"capability":"report"}` 想按能力过滤,
19
+ // schema 只有 full,参数被**静默丢弃**,拿到 46 项还以为已过滤——多读 6.3KB。
20
+ // 与其拒绝,不如真的过滤:manifest 行本身就有 capability 字段(免费)。
21
+ capability: z.string().optional().describe("按能力名过滤(大小写不敏感,子串匹配 capability 字段);lane 请用 omc capability <id>"),
22
+ lane: z.string().optional().describe("按 lane 名过滤(子串匹配)"),
23
+ },
15
24
  handler: async (ctx, args) => {
16
25
  const full = args.full === true;
17
- const items = ctx.manifest.items.map((item) => full
26
+ const capabilityFilter = typeof args.capability === "string" && args.capability.trim() !== "" ? args.capability.trim().toLowerCase() : undefined;
27
+ const laneFilter = typeof args.lane === "string" && args.lane.trim() !== "" ? args.lane.trim().toLowerCase() : undefined;
28
+ // r28k F6:过滤后为空要当成**没命中**说出来,别回一个看起来正常的空清单。
29
+ const matched = ctx.manifest.items.filter((item) => (capabilityFilter === undefined || String(item.capability ?? "").toLowerCase().includes(capabilityFilter)) &&
30
+ (laneFilter === undefined || String(item.lane ?? "").toLowerCase().includes(laneFilter)));
31
+ const filterNote = capabilityFilter === undefined && laneFilter === undefined
32
+ ? undefined
33
+ : matched.length === 0
34
+ ? { filtered: { capability: capabilityFilter ?? null, lane: laneFilter ?? null }, matched: 0, hint: `没有 capability/lane 命中「${capabilityFilter ?? laneFilter}」。manifest 的 capability 是**能力描述名**(如 "Report builder"),不是能力 id;按 id 查用 omc capability <id>` }
35
+ : { filtered: { capability: capabilityFilter ?? null, lane: laneFilter ?? null }, matched: matched.length, total: ctx.manifest.items.length };
36
+ const items = matched.map((item) => full
18
37
  ? {
19
38
  lane: item.lane,
20
39
  capability: item.capability,
@@ -36,6 +55,7 @@ export function registerMetaLane(tools) {
36
55
  version_family: ctx.manifest.version_family,
37
56
  anchor_version: ctx.manifest.anchor_version,
38
57
  items,
58
+ ...(filterNote !== undefined ? { filter: filterNote } : {}),
39
59
  },
40
60
  };
41
61
  }
@@ -50,7 +70,8 @@ export function registerMetaLane(tools) {
50
70
  anchor_version: ctx.manifest.anchor_version,
51
71
  counts: { total: items.length, byStatus },
52
72
  items,
53
- hint: "coverage.manifest full:true 取完整投影(含 scope/reason/tools/scopes);lane 能力面用 omc capabilities / omc capability <id>;工具清单用 commands --json --compact",
73
+ ...(filterNote !== undefined ? { filter: filterNote } : {}),
74
+ hint: "manifest 按 lane 索引(同一 lane 可有多行细项,status 不统一),不是 capability id;答「X 能力能不能用」请用 omc capability <id> / omc capabilities。full:true 取完整投影(scope/reason/tools);工具清单用 commands --json --compact",
54
75
  },
55
76
  };
56
77
  },
@@ -59,7 +80,8 @@ export function registerMetaLane(tools) {
59
80
  name: "get_status",
60
81
  layer: "high",
61
82
  kind: "meta",
62
- description: META_TOOLS["get_status"].description,
83
+ // r28k F4:doctor vs get_status 分流(放首句,避免 summary 截断吞掉)。
84
+ description: `分流:覆盖率/环境边界/租约用本工具,逐项中文 checks 与缺口明细用 doctor。 ${META_TOOLS["get_status"].description}`,
63
85
  inputSchema: { environment: environmentArg },
64
86
  handler: async (ctx, args, self) => {
65
87
  const store = ctx.sessions.config();
@@ -103,6 +125,8 @@ export function registerMetaLane(tools) {
103
125
  credentialsMode: store.credentialsMode(),
104
126
  session: sessionState,
105
127
  coverage: { total: ctx.manifest.items.length, byStatus: statusCounts },
128
+ // r28k F9:与 doctor 同形挂一份(含 coverageClaimMeaning),避免只跑 get_status 就看不到缺口语义。
129
+ unsupportedCapabilities: unsupportedCapabilities(ctx.manifest, typeof sessionState.version === "string" ? sessionState.version : undefined),
106
130
  writeLease: { activeHolder: ctx.lease.holder(resolved.name) ?? null },
107
131
  };
108
132
  },
@@ -202,7 +226,8 @@ export function registerMetaLane(tools) {
202
226
  name: "doctor",
203
227
  layer: "meta",
204
228
  kind: "meta",
205
- description: META_TOOLS["doctor"].description,
229
+ // r28k F4:与 get_status 分流(放首句)。
230
+ description: `分流:体检用本工具(逐项中文 checks + unsupportedCapabilities),覆盖率/环境边界/租约用 get_status。 ${META_TOOLS["doctor"].description}`,
206
231
  inputSchema: { environment: environmentArg, serviceCode: z.string().min(1).optional().describe("可选:体检单个业务集成服务的鉴权参数形状(掩码/占位/全 0 检出;非致命 WARN)") },
207
232
  handler: async (ctx, args, self) => {
208
233
  const store = ctx.sessions.config();
@@ -7,7 +7,7 @@ import { LANES } from "./lane-ids.js";
7
7
  */
8
8
  export const MODEL_WIRE = Object.freeze({
9
9
  createBody: "bizmodels/create carries appCode, parentId (folder), modelType, bizSchemaCode, icon, name_i18n, pcAble/mobileAble, options{statisticEnabled:false}",
10
- readback: "exits_bizschema readback via apppackage/trees (type==='BizModel' && code===schemaCode)",
10
+ readback: "exits_bizschema readback via apppackage/trees (type==='BizModel' && code===schemaCode); model.create readback carries {present,schemaCode,folderId,path[,displayPath]} using the same flattenFolders path face as folder.tree",
11
11
  folderResolution: "explicit folderId(树行 id 或目录 code,经 applicationTree 归一为树行 id;未命中 → model-create-folder-unresolved)> first non-BizModel tree node (auto-default-folder);none found → 302001。注意 apppackage/list 的目录键是 code、trees 的键是 id,跨读面传值必须归一",
12
12
  deleteBody: "apppackage/physically_delete body [{id,code,type:'BizModel'}] where id MUST be the app-tree node id (AppFunction id)",
13
13
  deleteIdNamespace: "physically_delete resolves each row id as an AppFunction id (removeBizModel → getAppFunction(id), AppIntegrationFacadeImpl) and answers 601003 业务模型不存在 for a biz-model record id; the two id spaces are NOT interchangeable. model.delete/deleteMany resolve the node across applications (default app first, then applicationList per-app trees) and refuse fail-closed with model-application-unresolved when the record exists but no tree node does — never guessing a record id",