@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.
- package/README.md +2 -1
- package/dist/approval-flow.js +5 -3
- package/dist/bizservice-config.js +26 -10
- package/dist/call.js +47 -0
- package/dist/capability-overview.js +47 -24
- package/dist/cli-contract.js +73 -26
- package/dist/cli-output.js +41 -2
- package/dist/cli-stdout.js +74 -0
- package/dist/cli.js +135 -52
- package/dist/command-transport.js +8 -1
- package/dist/config-store.js +17 -2
- package/dist/discovery.js +62 -3
- package/dist/field-families.js +35 -6
- package/dist/goal-routes.js +118 -11
- package/dist/human-summary.js +11 -0
- package/dist/lanes/app-contract.js +12 -5
- package/dist/lanes/app.js +221 -134
- package/dist/lanes/apply-changes.js +2 -1
- package/dist/lanes/b2-registration-contract.js +3 -3
- package/dist/lanes/b2-registration.js +890 -693
- package/dist/lanes/businessrule.js +75 -51
- package/dist/lanes/custom-page.js +166 -115
- package/dist/lanes/datarule-contract.js +2 -2
- package/dist/lanes/datarule.js +238 -154
- package/dist/lanes/dictionary.js +253 -110
- package/dist/lanes/environment.js +57 -9
- package/dist/lanes/field.js +160 -107
- package/dist/lanes/folder-contract.js +7 -3
- package/dist/lanes/folder.js +249 -118
- package/dist/lanes/form-contract.js +1 -1
- package/dist/lanes/form.js +188 -64
- package/dist/lanes/list-view.js +405 -369
- package/dist/lanes/meta.js +31 -6
- package/dist/lanes/model-contract.js +1 -1
- package/dist/lanes/model.js +610 -512
- package/dist/lanes/online-js-contract.js +1 -1
- package/dist/lanes/online-js.js +160 -146
- package/dist/lanes/organization.js +905 -640
- package/dist/lanes/programming.js +274 -136
- package/dist/lanes/report-contract.js +2 -2
- package/dist/lanes/report.js +354 -198
- package/dist/lanes/rule-lifecycle.js +294 -140
- package/dist/lanes/runtime-data-contract.js +4 -4
- package/dist/lanes/runtime-data.js +869 -745
- package/dist/lanes/workflow-contract.js +3 -3
- package/dist/lanes/workflow.js +732 -605
- package/dist/model-scaffold.js +26 -5
- package/dist/path-projection.js +196 -14
- package/dist/plan.js +25 -0
- package/dist/programming-workflow.js +55 -3
- package/dist/read-shapes.js +146 -0
- package/dist/read.js +40 -9
- package/dist/recipes/businessrule.js +74 -24
- package/dist/recipes/dictionary.js +7 -4
- package/dist/recipes/form.js +46 -0
- package/dist/recipes/runtime-data.js +3 -2
- package/dist/refusal-guidance.js +29 -5
- package/dist/rule-support.js +14 -1
- package/dist/rule-when.js +2 -2
- package/dist/tool-types.js +9 -3
- package/dist/version-family-gaps.js +101 -0
- package/dist/write.js +2 -1
- package/package.json +6 -4
- package/skills/omc-glossary.md +13 -0
- package/skills/omc-refusals.md +13 -5
- package/skills/omc-tool-selection.md +2 -1
- package/skills/omc-write-hazards.md +5 -2
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/** 与版本无关的平台永久缺席面(与 `capability-absences.ts` 同源的事实,此处只投影)。 */
|
|
2
|
+
const PLATFORM_ABSENCES = [
|
|
3
|
+
{
|
|
4
|
+
id: "data.query",
|
|
5
|
+
kind: "platform-absent",
|
|
6
|
+
fallback: "已注册只读方法用 method.test(DATA_SQL + SELECT-only);统计用 data.list 分片;表结构/模板用 service.table_sql",
|
|
7
|
+
evidence: "8.6.26 只有 BizServiceMethodController.service_test 与 getDataTableSql(返回模板),无接收任意 SQL 的 runtime 端点;见 capability-absences.ts",
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
id: "dictionary.delete",
|
|
11
|
+
kind: "platform-absent",
|
|
12
|
+
fallback: "dictionary.status 停用字典与记录(平台没有删除操作)",
|
|
13
|
+
evidence: "DataDictionaryController 只有 saveDictionary / updateDictionaryStatus / deleteDictionaryClass(Batch);见 capability-absences.ts",
|
|
14
|
+
},
|
|
15
|
+
];
|
|
16
|
+
/** 按版本族登记、且 OMC 已有 404 下探/双面上报的端点差异。 */
|
|
17
|
+
const FAMILY_GAPS = [
|
|
18
|
+
{
|
|
19
|
+
id: "bizmodels.get_all",
|
|
20
|
+
kind: "endpoint-absent-on-family",
|
|
21
|
+
families: ["8.0", "8.1"],
|
|
22
|
+
fallback: "OMC 自动 404 下探 bizmodels/list_schema(readModelRecord),无需调用方处理",
|
|
23
|
+
evidence: "field report 2026-10-30(8.1.108 上海电建)该路径回 HTTP 404;model-record.ts 已双面读取",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: "runtime businessrule list_by_schemacode",
|
|
27
|
+
kind: "endpoint-absent-on-family",
|
|
28
|
+
families: ["8.1"],
|
|
29
|
+
fallback: "OMC 自动 404 下探 app 面 businessrule/list_by_schemacode,并在 result.endpointFamily 标注命中面",
|
|
30
|
+
evidence: "2026-11-03 issue A1;lanes/businessrule.ts 的 wireCallWith404Fallback",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
// r27 真机(2026-11-05,1.1.25):BI 模块未部署,`/dashboard/v1/report/*` 全部
|
|
34
|
+
// 502。探针为此在**三个面**各收一次税:report.create 回 present:true 但
|
|
35
|
+
// report.tree 读回 0(读回矛盾)、report.delete 卡死导致应用删不掉(清理死结)、
|
|
36
|
+
// folder.delete 指引错方向(使用摩擦),合计 9 轮。这条必须进 doctor,
|
|
37
|
+
// 否则每个新 agent 都要重新踩一遍。
|
|
38
|
+
id: "report / BI (/dashboard/v1/report/*)",
|
|
39
|
+
kind: "endpoint-absent-on-family",
|
|
40
|
+
families: ["1.0", "1.1"],
|
|
41
|
+
fallback: "报表页在平台侧可建(report.tree/report.get 走平台面),但 BI 初始化/详情/删除会 502:改用 listview 汇总列或 data.list 统计替代;report.delete 已降级为「BI 摘除失败仍执行平台侧删除」",
|
|
42
|
+
evidence: "r27 真机 2026-11-05(1.1.25):report.create → biInit:failed;report.tree → reportCount:0;report.delete → /dashboard/v1/report/removeReport HTTP 502",
|
|
43
|
+
},
|
|
44
|
+
];
|
|
45
|
+
/** r28k F9 — 固定文案,doctor / get_status 共用,避免两义。 */
|
|
46
|
+
export const KNOWN_GAPS_CLAIM_MEANING = "只列已知缺口;未列 ≠ 已验证可用——跨版本面一律先 scouting / 看 coverage.manifest";
|
|
47
|
+
function familyOf(version) {
|
|
48
|
+
const parts = version.split(".");
|
|
49
|
+
return parts.length >= 2 ? `${parts[0]}.${parts[1]}` : version;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* 给定检测到的版本,返回**当前环境适用**的已知缺口。
|
|
53
|
+
* `version` 为 undefined(无版本证据)时返回全部家族条目——保守方向:
|
|
54
|
+
* 调用方宁可多看到一条,也不要漏掉一个会 404 的端点。
|
|
55
|
+
*/
|
|
56
|
+
export function unsupportedCapabilities(manifest, version) {
|
|
57
|
+
const family = version === undefined ? undefined : familyOf(version);
|
|
58
|
+
const applicable = FAMILY_GAPS.filter((gap) => family === undefined || gap.families === undefined || gap.families.includes(family));
|
|
59
|
+
return {
|
|
60
|
+
completeness: "known-gaps-only",
|
|
61
|
+
coverageClaim: "known-gaps-only",
|
|
62
|
+
coverageClaimMeaning: KNOWN_GAPS_CLAIM_MEANING,
|
|
63
|
+
detectedVersion: version ?? null,
|
|
64
|
+
inAnchorFamily: version === undefined ? null : version.startsWith(`${manifest.version_family}.`),
|
|
65
|
+
// 锚点族内部无缺口时也别回空数组造成"没有限制"的错觉——platform-absent 永远在。
|
|
66
|
+
capabilities: [...applicable, ...PLATFORM_ABSENCES],
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* r28i F1: non-TTY doctor used to say only「1 项 WARN/FAIL」and bury the
|
|
71
|
+
* capability names in stdout JSON. Build one human line that names version +
|
|
72
|
+
* unavailable capability short ids so agents do not have to grep the envelope.
|
|
73
|
+
*/
|
|
74
|
+
export function formatDoctorHumanSummary(input) {
|
|
75
|
+
const head = `doctor:${input.ok ? "通过" : "失败"}${input.warnCount > 0 ? `(${input.warnCount} 项 WARN/FAIL)` : ""}`;
|
|
76
|
+
const caps = input.unsupported?.capabilities ?? [];
|
|
77
|
+
if (input.warnCount <= 0 && caps.length === 0) {
|
|
78
|
+
return `${head}——逐项明细与冷启动指引在 stdout 的 result`;
|
|
79
|
+
}
|
|
80
|
+
const versionBit = typeof input.detectedVersion === "string" && input.detectedVersion.length > 0
|
|
81
|
+
? `版本 ${input.detectedVersion}`
|
|
82
|
+
: input.unsupported?.detectedVersion
|
|
83
|
+
? `版本 ${input.unsupported.detectedVersion}`
|
|
84
|
+
: undefined;
|
|
85
|
+
const shortIds = caps.slice(0, 6).map((cap) => shortCapabilityId(cap.id));
|
|
86
|
+
const unavailable = shortIds.length > 0
|
|
87
|
+
? `不可用:${shortIds.join("、")}${caps.length > shortIds.length ? ` 等${caps.length}项` : ""}`
|
|
88
|
+
: undefined;
|
|
89
|
+
const detail = [versionBit, unavailable].filter(Boolean).join(";");
|
|
90
|
+
return detail.length > 0
|
|
91
|
+
? `${head}——${detail}(详见 result.unsupportedCapabilities)`
|
|
92
|
+
: `${head}——逐项明细、冷启动指引与 unsupportedCapabilities 都在 stdout 的 result(stderr 不重复)`;
|
|
93
|
+
}
|
|
94
|
+
function shortCapabilityId(id) {
|
|
95
|
+
if (id.startsWith("report / BI"))
|
|
96
|
+
return "report/BI";
|
|
97
|
+
if (id === "runtime businessrule list_by_schemacode")
|
|
98
|
+
return "businessrule.list(runtime)";
|
|
99
|
+
return id;
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=version-family-gaps.js.map
|
package/dist/write.js
CHANGED
|
@@ -225,7 +225,8 @@ function findCompleted(root, requestId, tool, environment, requestFingerprint) {
|
|
|
225
225
|
return undefined;
|
|
226
226
|
}
|
|
227
227
|
/** Low-level write registration factory: shared by every lane adapter. */
|
|
228
|
-
export function writeTool(
|
|
228
|
+
export function writeTool(definition) {
|
|
229
|
+
const { tools, name, lane, scope, description, inputSchema, execute, preflight, dryRunPayload, rollback, readOnlyEscape } = definition;
|
|
229
230
|
const rawExecute = execute;
|
|
230
231
|
const semanticGate = (args) => {
|
|
231
232
|
if (name === "field.create")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stalfh233/omc-cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.10",
|
|
4
4
|
"description": "CloudPivot 8.6 configuration capability CLI — governed, fail-closed, coverage-manifest bounded.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -43,7 +43,9 @@
|
|
|
43
43
|
"payload:report": "tsx scripts/payload-report.ts",
|
|
44
44
|
"prepublishOnly": "npm run build",
|
|
45
45
|
"build:fast": "tsc --project tsconfig.build.json --incremental",
|
|
46
|
-
"typecheck:fast": "tsc --noEmit --incremental --tsBuildInfoFile .typecheck.tsbuildinfo"
|
|
46
|
+
"typecheck:fast": "tsc --noEmit --incremental --tsBuildInfoFile .typecheck.tsbuildinfo",
|
|
47
|
+
"test:changed": "node scripts/run-tests-changed.mjs",
|
|
48
|
+
"test:changed:since": "node scripts/run-tests-changed.mjs --since"
|
|
47
49
|
},
|
|
48
50
|
"engines": {
|
|
49
51
|
"node": ">=20"
|
|
@@ -52,9 +54,9 @@
|
|
|
52
54
|
"access": "public"
|
|
53
55
|
},
|
|
54
56
|
"dependencies": {
|
|
55
|
-
"@stalfh233/omc-fake-platform": "0.6.
|
|
57
|
+
"@stalfh233/omc-fake-platform": "0.6.10",
|
|
56
58
|
"commander": "14.0.3",
|
|
57
|
-
"omc-core": "0.6.
|
|
59
|
+
"omc-core": "0.6.9",
|
|
58
60
|
"proper-lockfile": "4.1.2",
|
|
59
61
|
"write-file-atomic": "6.0.0",
|
|
60
62
|
"zod": "^3.23.8",
|
package/skills/omc-glossary.md
CHANGED
|
@@ -91,3 +91,16 @@ Terminology for the `omc` configuration CLI. Built on CloudPivot 8.6 (anchor
|
|
|
91
91
|
(outage/timeout). Never treated as success; re-discover before retrying.
|
|
92
92
|
- `dry-run` — a validated plan is returned with zero environment writes; rerun without dry-run to execute when the environment permits it.
|
|
93
93
|
- `production-confirmation-required` — a writable production environment refused a write because the call omitted `confirmProduction:true`.
|
|
94
|
+
|
|
95
|
+
## Output language (文案语言规则)
|
|
96
|
+
|
|
97
|
+
一条规则,三个落点(HANDOFF §三.3-8):
|
|
98
|
+
|
|
99
|
+
| 层 | 语言 | 例 |
|
|
100
|
+
|---|---|---|
|
|
101
|
+
| 机器字段 / 键 / code / blocker / status | **英文**(永不翻译) | `blocker`, `pathMiss`, `errcode`, `closest` |
|
|
102
|
+
| 人读句子(`message` / `hint` / `recovery` / stderr 行) | **中文** | 「写面工具不接受未知键(会被静默丢弃)」 |
|
|
103
|
+
| `issues[].message`、`steps[]` 等并列通道 | **与主 message 同源**(同语言、同指引) | 主 message 指向 `form.publish`,issues 也必须指向它 |
|
|
104
|
+
|
|
105
|
+
第 3 行是硬要求:程序消费回执时常取 `issues[]` 而不是顶层 `message`,两条通道不同源
|
|
106
|
+
等于修了一半(r25 B4 实证)。新增错误时把「一句话 + 一个下一步」同时写进两处。
|
package/skills/omc-refusals.md
CHANGED
|
@@ -107,11 +107,10 @@ approved draft, and decide with the human. A second write may duplicate.
|
|
|
107
107
|
2. Only after the outcome is established, decide whether to retry.
|
|
108
108
|
3. Never blind-retry — that risks a second write.
|
|
109
109
|
|
|
110
|
-
`write-lock-held` — another write holds the environment lock
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
exits. This guards concurrency, not approval.
|
|
110
|
+
`write-lock-held` — another write holds the environment lock (`owner`/`recovery`
|
|
111
|
+
included). Retry with `--wait <ms>` on `omc call` / `omc intent apply`: queueing is
|
|
112
|
+
in-process (no extra round trip) and auto-recovers when the holder exits. Guards
|
|
113
|
+
concurrency, not approval.
|
|
115
114
|
|
|
116
115
|
## 8. Runtime / gateway errors (not tool refusals, same discipline)
|
|
117
116
|
|
|
@@ -127,3 +126,12 @@ exits. This guards concurrency, not approval.
|
|
|
127
126
|
- `tool-input-invalid` — schema violation (exit 10); fix the arguments.
|
|
128
127
|
- `dictionary-target-required`, `intent-plan-invalid` — a required selector or
|
|
129
128
|
shape is missing; see `describe <tool>`.
|
|
129
|
+
|
|
130
|
+
## 10. 投影路径(--jq / --extract)
|
|
131
|
+
|
|
132
|
+
收**路径选择器**,不是 jq 表达式(错误回执的 `hint` 与本节同源)。
|
|
133
|
+
|
|
134
|
+
- `a.b` 点式 · `a[0]` 下标(=`a.0`) · `a[0:6]` 切片 · `items[].fields.x` 逐条映射 · `rules[code=Create]` 按键选择(首个命中)
|
|
135
|
+
- 多列:`--jq "a.b,c.d"` 或重复 `--jq`(结果在 `projections[]`);**不支持** `|` 与对象构造
|
|
136
|
+
- miss 回 `pathMiss`+`missedAt`+`available`(`--extract` 另置 `unanswered`):未命中≠空值
|
|
137
|
+
- `mapped`=命中数,`nullEntries`=其中 null 数;相等时看同次 `data.list` 的 `projectionHint` 或 `data.load`
|
|
@@ -17,7 +17,8 @@ description: Choose the right OMC CLI tool for a goal. Use when unsure whether a
|
|
|
17
17
|
| `omc describe <tool>` / `--example <id>` | 1.5–2.5 KB | 单工具形状 |
|
|
18
18
|
| `omc commands` | ~8 KB | 有界索引(name/lane/kind) |
|
|
19
19
|
| `omc commands --json --compact` | ~13 KB | 全量紧凑行 |
|
|
20
|
-
| `omc capabilities` | ~
|
|
20
|
+
| `omc capabilities --compact` | ~2.5 KB | 能力索引(id/lane/intent/coverage/toolCount,**无工具名**) |
|
|
21
|
+
| `omc capabilities` | ~8 KB | 能力总览(含 aliases/tools/依赖顺序);`next` 已给路线时可省 |
|
|
21
22
|
| `omc commands --json` | ~20 KB | 全量目录(回退面,尽量避免) |
|
|
22
23
|
| `omc describe <tool> --full` | 7–19 KB | 仅当 schema 需要;不再重发 recipes(用 `--example` 取可运行参数) |
|
|
23
24
|
|
|
@@ -21,7 +21,7 @@ omc help omc-write-hazards
|
|
|
21
21
|
- `form.draft rebuild:true` 会重建布局,但会保留已存在的非结构性控件 options;Sheet201 columns 以最新 subSchema 为准。
|
|
22
22
|
- 空布局 `[]`/`{}` 默认拒绝;只有显式 `allowEmptyLayout:true` 才能清空。
|
|
23
23
|
- **列数由 viewJson 行分组决定,不是 span**(2026-10-27 r24 真机实证):`viewJson` 是行的数组,一行内 N 个 code 即 N 列;`span` 只是 24 栅格下的控件宽度。只把字段 `span` 改 8 而不动行分组 → 控件变窄但每行仍两个,不是三列。改列数必须同时改行分组(三列=每行 3 个 code,字段 span=8)→ `form.publish` → `form.get` 回读 viewJson 核对。系统字段行与业务字段行分开调整。
|
|
24
|
-
-
|
|
24
|
+
- **下拉/单选/复选的选项在表单控件有独立副本**(8.6/1.1.25):数据项 `options.optionsSet.custom` 之外,表单控件 `options.options.custom`/`optionsSet.custom` 各一份(× draft/published)——只改字段不重存表单,门户不变。链:`field.update`→`field.publish`→`form.draft`(rebuild)→`form.publish`;验收读表单面。
|
|
25
25
|
- **模型不支持跨应用迁移**(1.1.25 真机实证:`folder-other-application` 拒绝):模型建错应用时走「新应用重建 + 关联引用改指 + 旧模型删除」,不存在物理迁移命令。
|
|
26
26
|
- **流程编排器是线性的,无并行会签**(1.1.25 实证):多部门会签只能建成顺序节点链;需求里的「并行会签」按顺序节点落地并在交付说明里披露。
|
|
27
27
|
- **BIZ_ACTION 服务出参只认响应 JSON 根级平铺键**(p7/r26 双实证):嵌套在信封里(如 `{data:{level}}`)静默映射不上、目标字段全空——先把这类判断列进方案:接口形态要在「平铺 vs 信封」间做选择时,需要回写本平台的出参一律平铺。外部系统本身回信封的,扩展整形转发或放弃出参回写。
|
|
@@ -56,7 +56,6 @@ omc help omc-write-hazards
|
|
|
56
56
|
- **`rule.run`/自定义规则不回写出参**(r26 实证 2 轮):出参合并只发生在预置 Update 规则的执行上下文;`rule.run` 手动触发与自定义规则不把服务出参写回本模型——出参落表要走「BIZ_ACTION 节点 outputMappings + 数据事件触发」,验收用 data.load 看字段而非 rule.run 回执。
|
|
57
57
|
- **出参回写三前提(r28b 8 组实验定案,单点总纲)**:① 响应 JSON 根级平铺出参键 ② 预置 Create/Update 规则上下文 ③ data.submit/data.update 触发(data.save 不触发)。三者缺一出参恒 null 且节点日志仍 successful——外部接口回信封的(`{code,message,data:[...]}`),先落平铺整形端点(平台扩展)再配 outputMappings,不要反复换规则形状试。
|
|
58
58
|
- **布尔出参映射到文本字段 → ClassCastException 50000**(r28b):LOGICAL 出参映射 SHORT_TEXT 即炸——布尔只映射 LOGICAL 字段,落文本先在扩展侧转字符串。
|
|
59
|
-
- **审批 formData 带子表数组=追加行(r28b)**:审批链路要改子表行用 data.update 单独写,别塞进 formData(回执只回主表)。
|
|
60
59
|
- **workItemId 不在 instanceActivity 里**(r28b 实证):流程实例活动查询不返回 workItemId;办理待办要的 workItemId 从 `search_workitems?state=PENDING` 的 `content[].id` 取。
|
|
61
60
|
- **模型创建/删除非原子有半态(r28b)**:create 撞错可能半落库——重试前 model.list 核对;删除后可留僵尸行(appFunction not exist 元凶)。
|
|
62
61
|
- **流程事件处理器吞异常**:`start`/`end`/`cancel`/`activate` 中的 BIZ_ACTION 抛异常时,`InstanceContext#processingBusiness` 只记 `processingBusiness error.` 并返回失败结果,**流程继续**。事件处理器不能做"提交前拦截"。
|
|
@@ -179,6 +178,10 @@ omc call field.publish --env local --args '{"schemaCode":"expense"}'
|
|
|
179
178
|
**只传主表字段**;确需追加行时显式 `allowChildRowAppend:true`(0.4.63 起默认拒绝,blocker `submit-approval-child-rows`)。
|
|
180
179
|
收尾时前后各读一次子表行数确认未变。
|
|
181
180
|
|
|
181
|
+
## 收尾核对(无 `omc baseline` 命令)
|
|
182
|
+
|
|
183
|
+
对照开场 `count` 读 `model.list` → `rule.list {onlyCustom:true}` → `datarule.list`(后两者期望 `modelPresent:false`)。**勿**对已删/从未存在的 schemaCode 再 `rule.list`——会补建 7 条不可删预置规则。
|
|
184
|
+
|
|
182
185
|
## 往有规则模型写入的反向副作用(r30 真机 2026-10-31)
|
|
183
186
|
|
|
184
187
|
影响评估不能只问"我的变更会不会破坏既有规则",还要问反方向:**目标模型的既有规则会不会在我写入之后执行并覆盖我写的字段**。
|