@stalfh233/omc-cli 0.5.6 → 0.5.8
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/LICENSE +21 -21
- package/README.md +359 -359
- package/coverage/m1-coverage-manifest-v1.json +1414 -1414
- package/dist/approval-flow.js +0 -0
- package/dist/args.js +0 -0
- package/dist/artifacts.js +0 -0
- package/dist/batch-call.js +0 -0
- package/dist/bench/call-face-eval.js +0 -0
- package/dist/bench/context-attribution.js +0 -0
- package/dist/bench/discovery-cost-eval.js +0 -0
- package/dist/bench/driver.js +0 -0
- package/dist/bench/evals.js +0 -0
- package/dist/bench/instrument.js +0 -0
- package/dist/bench/intent-face-eval.js +40 -40
- package/dist/bench/run.js +0 -0
- package/dist/bench/scenario.js +0 -0
- package/dist/bench/types.js +0 -0
- package/dist/bi-wire.js +0 -0
- package/dist/bizservice-config.js +0 -0
- package/dist/call.js +0 -0
- package/dist/capability-absences.js +0 -0
- package/dist/capability-overview.js +0 -0
- package/dist/capability-shape.js +0 -0
- package/dist/cli-contract.js +0 -0
- package/dist/cli-output.js +0 -0
- package/dist/cli.js +31 -1
- package/dist/closest-match.js +0 -0
- package/dist/code-rules.js +0 -0
- package/dist/command-transport.js +0 -0
- package/dist/compound-writes.js +0 -0
- package/dist/compute.js +0 -0
- package/dist/config-store.js +0 -0
- package/dist/context.js +0 -0
- package/dist/contract-consistency.js +0 -0
- package/dist/contract-resources.js +0 -0
- package/dist/coverage-consistency.js +0 -0
- package/dist/coverage-registry.js +0 -0
- package/dist/coverage.js +0 -0
- package/dist/data-list-filter.js +0 -0
- package/dist/describe-cache.js +0 -0
- package/dist/discovery.js +0 -0
- package/dist/endpoints.js +0 -0
- package/dist/environment-policy.js +0 -0
- package/dist/execution-metadata.js +0 -0
- package/dist/field-add.js +314 -0
- package/dist/field-change.js +0 -0
- package/dist/field-families.js +0 -0
- package/dist/form-default.js +0 -0
- package/dist/form-layout.js +0 -0
- package/dist/form-support.js +9 -0
- package/dist/formula-lint.js +0 -0
- package/dist/goal-routes.js +28 -16
- package/dist/governed-execution.js +0 -0
- package/dist/graph.js +50 -33
- package/dist/human-summary.js +1 -1
- package/dist/identity.js +0 -0
- package/dist/intent/baseline.js +0 -0
- package/dist/intent/capabilities/bizservice.js +0 -0
- package/dist/intent/capabilities/businessrule.js +0 -0
- package/dist/intent/capabilities/datarule.js +0 -0
- package/dist/intent/capabilities/field.js +0 -0
- package/dist/intent/capabilities/form.js +0 -0
- package/dist/intent/capabilities/index.js +0 -0
- package/dist/intent/capabilities/listview.js +0 -0
- package/dist/intent/capabilities/model.js +0 -0
- package/dist/intent/capabilities/onlinejs.js +0 -0
- package/dist/intent/capabilities/report.js +0 -0
- package/dist/intent/capabilities/workflow.js +0 -0
- package/dist/intent/capability.js +0 -0
- package/dist/intent/cli.js +0 -0
- package/dist/intent/compare.js +0 -0
- package/dist/intent/compiler.js +0 -0
- package/dist/intent/dsl.js +0 -0
- package/dist/intent/plan-apply.js +0 -0
- package/dist/intent/plan-file.js +0 -0
- package/dist/intent/readback.js +0 -0
- package/dist/intent/schema.js +0 -0
- package/dist/intent/validation.js +0 -0
- package/dist/intent/yaml.js +0 -0
- package/dist/journal.js +0 -0
- package/dist/json-column.js +0 -0
- package/dist/lanes/app-contract.js +0 -0
- package/dist/lanes/app-coverage.js +0 -0
- package/dist/lanes/app.js +0 -0
- package/dist/lanes/apply-changes.js +0 -0
- package/dist/lanes/b2-registration-contract.js +0 -0
- package/dist/lanes/b2-registration-coverage.js +0 -0
- package/dist/lanes/b2-registration.js +0 -0
- package/dist/lanes/businessrule-contract.js +0 -0
- package/dist/lanes/businessrule-coverage.js +0 -0
- package/dist/lanes/businessrule.js +11 -3
- package/dist/lanes/contract-support.js +0 -0
- package/dist/lanes/coverage-declaration.js +0 -0
- package/dist/lanes/custom-page.js +0 -0
- package/dist/lanes/datarule-contract.js +0 -0
- package/dist/lanes/datarule-coverage.js +0 -0
- package/dist/lanes/datarule-protocol.js +0 -0
- package/dist/lanes/datarule.js +6 -0
- package/dist/lanes/dictionary-contract.js +0 -0
- package/dist/lanes/dictionary-coverage.js +0 -0
- package/dist/lanes/dictionary.js +0 -0
- package/dist/lanes/environment-contract.js +0 -0
- package/dist/lanes/environment-coverage.js +0 -0
- package/dist/lanes/environment.js +0 -0
- package/dist/lanes/field-contract.js +0 -0
- package/dist/lanes/field-coverage.js +0 -0
- package/dist/lanes/field.js +0 -0
- package/dist/lanes/folder-contract.js +0 -0
- package/dist/lanes/folder-coverage.js +0 -0
- package/dist/lanes/folder.js +0 -0
- package/dist/lanes/form-contract.js +0 -0
- package/dist/lanes/form-coverage.js +0 -0
- package/dist/lanes/form.js +0 -0
- package/dist/lanes/lane-ids.js +0 -0
- package/dist/lanes/list-view-contract.js +0 -0
- package/dist/lanes/list-view-coverage.js +0 -0
- package/dist/lanes/list-view-shapes.js +0 -0
- package/dist/lanes/list-view.js +6 -0
- package/dist/lanes/meta-contract.js +0 -0
- package/dist/lanes/meta.js +0 -0
- package/dist/lanes/model-contract.js +0 -0
- package/dist/lanes/model-coverage.js +0 -0
- package/dist/lanes/model.js +0 -0
- package/dist/lanes/online-js-contract.js +0 -0
- package/dist/lanes/online-js-coverage.js +0 -0
- package/dist/lanes/online-js.js +0 -0
- package/dist/lanes/org-tree.js +0 -0
- package/dist/lanes/organization-coverage.js +27 -0
- package/dist/lanes/organization.js +10 -1
- package/dist/lanes/report-contract.js +0 -0
- package/dist/lanes/report-coverage.js +0 -0
- package/dist/lanes/report.js +0 -0
- package/dist/lanes/rule-graph.js +0 -0
- package/dist/lanes/rule-lifecycle-contract.js +0 -0
- package/dist/lanes/rule-lifecycle-coverage.js +0 -0
- package/dist/lanes/rule-lifecycle.js +0 -0
- package/dist/lanes/runtime-data-contract.js +0 -0
- package/dist/lanes/runtime-data-coverage.js +0 -0
- package/dist/lanes/runtime-data.js +24 -0
- package/dist/lanes/workflow-contract.js +0 -0
- package/dist/lanes/workflow-coverage.js +0 -0
- package/dist/lanes/workflow.js +7 -2
- package/dist/mcp-graph.js +0 -0
- package/dist/model-purge.js +0 -0
- package/dist/model-record.js +0 -0
- package/dist/model-scaffold.js +0 -0
- package/dist/omc-core-lazy.js +0 -0
- package/dist/online-js-layout.js +0 -0
- package/dist/online-js-source.js +28 -28
- package/dist/package-tool.js +0 -0
- package/dist/package.js +0 -0
- package/dist/path-projection.js +19 -1
- package/dist/plan.js +0 -0
- package/dist/read.js +0 -0
- package/dist/recipes/b2-registration.js +0 -0
- package/dist/recipes/businessrule.js +0 -0
- package/dist/recipes/datarule.js +0 -0
- package/dist/recipes/dictionary.js +0 -0
- package/dist/recipes/field.js +0 -0
- package/dist/recipes/form.js +0 -0
- package/dist/recipes/list-view.js +0 -0
- package/dist/recipes/model.js +0 -0
- package/dist/recipes/online-js.js +0 -0
- package/dist/recipes/runtime-data.js +0 -0
- package/dist/recipes/shared.js +0 -0
- package/dist/recipes/workflow.js +0 -0
- package/dist/redact.js +0 -0
- package/dist/refusal-guidance.js +0 -0
- package/dist/rollback-spec.js +0 -0
- package/dist/rollback.js +0 -0
- package/dist/rule-support.js +0 -0
- package/dist/rule-when.js +4 -3
- package/dist/runtime-support.js +0 -0
- package/dist/script.js +0 -0
- package/dist/service-doctor.js +0 -0
- package/dist/session-manager.js +0 -0
- package/dist/session.js +0 -0
- package/dist/skills.js +0 -0
- package/dist/sqlite-warning-filter.js +0 -0
- package/dist/support.js +0 -0
- package/dist/token-cache.js +0 -0
- package/dist/tool-types.js +0 -0
- package/dist/tools.js +0 -0
- package/dist/usage-log.js +0 -0
- package/dist/wire.js +0 -0
- package/dist/workflow-support.js +0 -0
- package/dist/write-lease.js +0 -0
- package/dist/write-lock.js +0 -0
- package/dist/write.js +0 -0
- package/dist/zip.js +0 -0
- package/docs/images/omc-nixi/README.md +41 -41
- package/docs/omc-introduction.md +851 -851
- package/docs/tool-surface-map.md +42 -42
- package/package.json +3 -3
- package/skills/omc-acceptance-criteria.md +50 -50
- package/skills/omc-business-configuration.md +336 -335
- package/skills/omc-capabilities.md +214 -214
- package/skills/omc-capability-scouting.md +55 -55
- package/skills/omc-config-draft-review.md +175 -175
- package/skills/omc-five-piece-flow.md +35 -35
- package/skills/omc-glossary.md +86 -86
- package/skills/omc-refusals.md +129 -129
- package/skills/omc-requirement-analysis.md +161 -161
- package/skills/omc-requirement-vocabulary.md +61 -61
- package/skills/omc-start-here.md +107 -106
- package/skills/omc-tool-selection.md +119 -119
- package/skills/omc-write-hazards.md +222 -200
- package/dist/approval-token.js +0 -102
- package/dist/bench/fake-http-server.js +0 -65
- package/dist/fake/app.js +0 -45
- package/dist/fake/b2-registration.js +0 -594
- package/dist/fake/businessrule.js +0 -242
- package/dist/fake/datarule.js +0 -72
- package/dist/fake/dictionary.js +0 -108
- package/dist/fake/environment.js +0 -30
- package/dist/fake/field.js +0 -167
- package/dist/fake/form.js +0 -101
- package/dist/fake/index.js +0 -121
- package/dist/fake/list-view.js +0 -289
- package/dist/fake/model.js +0 -136
- package/dist/fake/online-js.js +0 -18
- package/dist/fake/report.js +0 -253
- package/dist/fake/routes.js +0 -47
- package/dist/fake/rule-lifecycle.js +0 -37
- package/dist/fake/runtime-data.js +0 -367
- package/dist/fake/state.js +0 -67
- package/dist/fake/workflow.js +0 -364
- package/dist/server.js +0 -92
|
@@ -1,119 +1,119 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: omc-tool-selection
|
|
3
|
-
description: Choose the right OMC CLI tool for a goal. Use when unsure whether a task needs a high-level orchestration or a low-level atom.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Which Tool When (何时用哪个工具)
|
|
7
|
-
|
|
8
|
-
## Discovery 成本档位(按量级选,别一上来就点大档)
|
|
9
|
-
|
|
10
|
-
实测:一条重难业务里,agent 对**发现面**的重复读占了任务上下文的大头。先走小档,缺形状再逐级放大。
|
|
11
|
-
(round14 已把各面瘦身,下表为当前实测。)
|
|
12
|
-
|
|
13
|
-
| Face | ~size | 用途 |
|
|
14
|
-
| --- | ---: | --- |
|
|
15
|
-
| `omc next "<goal>"` | 2–5 KB | 目标→路线(首选) |
|
|
16
|
-
| `omc commands --json --compact --lane <lane>` | ~1 KB | 单能力工具行(最省的枚举面) |
|
|
17
|
-
| `omc describe <tool>` / `--example <id>` | 1.5–2.5 KB | 单工具形状 |
|
|
18
|
-
| `omc commands` | ~8 KB | 有界索引(name/lane/kind) |
|
|
19
|
-
| `omc commands --json --compact` | ~13 KB | 全量紧凑行 |
|
|
20
|
-
| `omc capabilities` | ~6 KB | 14 能力总览;`next` 已给路线时可省 |
|
|
21
|
-
| `omc commands --json` | ~20 KB | 全量目录(回退面,尽量避免) |
|
|
22
|
-
| `omc describe <tool> --full` | 7–19 KB | 仅当 schema 需要;不再重发 recipes(用 `--example` 取可运行参数) |
|
|
23
|
-
|
|
24
|
-
裸 `omc commands` 只是索引;**全量目录必须显式 `--json`**。同一 face 不要反复读。
|
|
25
|
-
|
|
26
|
-
## Minimal-path cheat sheet(最小路径速查)
|
|
27
|
-
|
|
28
|
-
一条需求先问"它属于哪一类",直接走对应的最小调用,别一上来铺工具:
|
|
29
|
-
|
|
30
|
-
| 你要做的事 | 一次调用(最小路径) |
|
|
31
|
-
| --- | --- |
|
|
32
|
-
| 读全**一个模型**的配置(字段/表单/列表/规则/数据规则/流程摘要) | `omc call model.inspect --args '{"schemaCode":"<m>"}'`(`all:true` 含系统字段) |
|
|
33
|
-
| **列模型** | `omc call model.list --args '{"filter":"<词>"}'` |
|
|
34
|
-
| 读**某条业务规则**的图 | `omc call rule.get --args '{"schemaCode":"<m>","ruleCode":"Create"}'`(不必先 list 取 id) |
|
|
35
|
-
| 读某模型的**流程**(只知模型码) | `omc call workflow.get_draft --args '{"schemaCode":"<m>"}'` |
|
|
36
|
-
| **改规则一个节点/分支阈值** | `omc call rule.node.update --args '{"schemaCode":"<m>","ruleCode":"Create","nodeCode":"Branch_1","patch":{...}}'`(patch 后自动 save;带 `"publish":true` 则保存+发布一调完成,生效仍需 `rule.enable`) |
|
|
37
|
-
| 从零**建一个流程**并发布 | `omc call configure_workflow --args '{"schemaCode":"<m>","name":"…","code":"<wf>","template":{...}}'` |
|
|
38
|
-
| **建模型+字段+表单+列表** | `omc call configure_model --args '{"name":"…","code":"<m>","fields":[...],"publishForm":true,"listview":{"fieldCodes":[...]}}'` |
|
|
39
|
-
| publish 流程前**只读预检** | `omc call workflow.validate --args '{"schemaCode":"<m>"}'` |
|
|
40
|
-
| **批量停用**某模型规则 | `omc call rule.disableMany --args '{"schemaCode":"<m>"}'`(默认含预置行;`customOnly:true` 只停自定义) |
|
|
41
|
-
| 字段清单(去噪) | `omc call field.list --args '{"schemaCode":"<m>","published":true}'`(默认业务字段,`all:true` 取全) |
|
|
42
|
-
|
|
43
|
-
**业务键优先**:`rule.get`/`datarule.update`/`datarule.delete`/`workflow.get_*` 接受业务键
|
|
44
|
-
(schemaCode+ruleCode / schemaCode+propertyCode / schemaCode),免去先 list 取 id。
|
|
45
|
-
|
|
46
|
-
**先看 `omc next` 的 `mode`**:`read` 只给读工具;`whole-package` 给 intent 声明式指引;
|
|
47
|
-
`build`/`modify` 给写工具;`scout`(能不能/怎么写)先探边界。
|
|
48
|
-
|
|
49
|
-
**纯读不必先发现**:已知读哪一面就直接 `omc call <读工具>`(上表),省掉 `next`/`discover_environment`;只有选不出工具时才用 `next`。发现仪式(`next`/`capabilities`/`discover_environment`)是写前与选不出工具时的路径。
|
|
50
|
-
|
|
51
|
-
## High layer — orchestrated CLI calls
|
|
52
|
-
|
|
53
|
-
| Goal | Tool |
|
|
54
|
-
| --- | --- |
|
|
55
|
-
| Inspect environment health | `get_status` |
|
|
56
|
-
| Full first look | `discover_environment` |
|
|
57
|
-
| New model to usable state (model → field → field.publish → form.draft → form.publish) | `configure_model`(+ `listview` 参数到列表) |
|
|
58
|
-
| Bind fields into the default form and publish | `configure_form` |
|
|
59
|
-
| Business rule saved and enabled | `configure_rule` |
|
|
60
|
-
| New workflow: create → update → publish (+ bind rules) | `configure_workflow` |
|
|
61
|
-
| Health chain (config → credential → login → version family → fingerprint) | `doctor` |
|
|
62
|
-
| Configure in-session with the human | `setup.start` → `setup.commit` |
|
|
63
|
-
|
|
64
|
-
## Low layer — atoms for fine control
|
|
65
|
-
|
|
66
|
-
Reads: `environment.fingerprint`, `field.list`, `form.get`, `rule.list`,
|
|
67
|
-
`data.list`, `data.load`, `service.list`, `service.get`, `app.list`, `coverage.manifest`,
|
|
68
|
-
`workflow.get_draft`, `workflow.get_published`.
|
|
69
|
-
|
|
70
|
-
Writes:
|
|
71
|
-
|
|
72
|
-
- Model: `model.create`, `model.delete`
|
|
73
|
-
- Applications: `app.create`, `app.delete` (deleting cascades its models)
|
|
74
|
-
- Fields: `field.create`, `field.update`, `field.publish`, `field.delete`
|
|
75
|
-
- Forms: `form.draft`, `form.publish`
|
|
76
|
-
- Rules: `rule.save`, `rule.enable`, `rule.disable`, `rule.delete`
|
|
77
|
-
- Workflow templates: `workflow.create`, `workflow.update`, `workflow.publish`, `workflow.bindRule`, `workflow.delete`
|
|
78
|
-
- Online JS: 本 CLI 只**发布/回读**(`onlinejs.compose`,平台模板保真);脚本**编写**不在 CLI 范围——遵循当前项目自带的在线 JS 编写规范(若有),否则向用户/设计者索取已定稿 `source`。后端的在线开发(Java 源码)用二开扩展包,也不在本 CLI 范围
|
|
79
|
-
- M2 data: `data.save`, `data.submit`, `data.delete`
|
|
80
|
-
- B2 services: `service.register`, `service.delete`
|
|
81
|
-
- List views: `listview.create`, `listview.configure`, `listview.delete`
|
|
82
|
-
|
|
83
|
-
## Decision rules
|
|
84
|
-
|
|
85
|
-
1. Default to the high layer; drop to atoms only to compose what the orchestration doesn't cover.
|
|
86
|
-
2. Preview any write with `dryRun:true`; it returns the plan and executes nothing.
|
|
87
|
-
3. `writable:false` refuses before any wire. A production write additionally requires `confirmProduction:true`.
|
|
88
|
-
4. Out-of-coverage desire (permissions, cross-model child linkage, OCR, app publish)? The refusal cites the manifest entry — that is the answer. Check `coverage.manifest`. Note: nested child tables are not a coverage gap — the platform itself only supports one level of child table.
|
|
89
|
-
5. If any call returns `uncertain`, stop writing and re-run discovery before the next write.
|
|
90
|
-
|
|
91
|
-
## Key-name table (同一对象在不同工具里的键名)
|
|
92
|
-
|
|
93
|
-
The same object is addressed under different keys. A wrong key is dropped silently
|
|
94
|
-
by the Tool-input gate and then reported only as `X: Required` — it never says
|
|
95
|
-
"the field you sent was ignored". Check here first.
|
|
96
|
-
|
|
97
|
-
| Object | Tools | Key |
|
|
98
|
-
| --- | --- | --- |
|
|
99
|
-
| Model | `model.*`, `field.*`, `form.*`, `datarule.*`, `rule.*` | `schemaCode` |
|
|
100
|
-
| Workflow template | `workflow.get_draft`, `workflow.get_published`, `workflow.bindRule` | `workflowCode`(或 `schemaCode`,工具内部解析) |
|
|
101
|
-
| Workflow template | `workflow.create`, `workflow.update`, `workflow.publish`, `workflow.delete` | `code`(+ `schemaCode`) |
|
|
102
|
-
| Default form | `form.get`, `form.draft`, `form.publish`, `configure_form` | `schemaCode`(必填)+ `sheetCode`(可选,默认=schemaCode) |
|
|
103
|
-
| Field | `field.create`, `field.update`, `field.delete` | `code` |
|
|
104
|
-
|
|
105
|
-
**业务键优先(identity seam)**:多个只读/改写工具现在接受业务键,免去先 list 取 id:
|
|
106
|
-
|
|
107
|
-
- `rule.get` 接受 `schemaCode + ruleCode`(返回**当前生效行**,不用先 `rule.list` 拿 id)。
|
|
108
|
-
- `datarule.update` / `datarule.delete` 接受 `schemaCode + propertyCode(+dataRuleType)`(同一字段多条规则时必须带 `dataRuleType` 去歧义)。
|
|
109
|
-
- `workflow.get_draft` / `workflow.get_published` 接受 `schemaCode`(不是每个模型都有流程;没有则 `exists:false`)。
|
|
110
|
-
|
|
111
|
-
**按工具别名(同一对象换个键名也收)**:`workflow.create/update/publish/delete` 的 `code`
|
|
112
|
-
也接受 `workflowCode`;`field.create/update/delete` 的 `code` 也接受 `propertyCode`。
|
|
113
|
-
别名只在规范键缺失时补入,不会覆盖;它**按工具声明**(不是全局),因为同一个 `code`
|
|
114
|
-
在不同工具里可能指不同对象。
|
|
115
|
-
|
|
116
|
-
精确 `id` 仍然可用,旧调用不受影响。`workflowCode` 与 `code` 指同一流程:读/绑定工具用
|
|
117
|
-
`workflowCode`,写工具用 `code`(写工具现已同时接受 `workflowCode`);读工具现在也可直接给 `schemaCode`。
|
|
118
|
-
|
|
119
|
-
Fixture discipline: one-shot `omc_mcp_*` fixtures, cleaned up in reverse order, zero residue.
|
|
1
|
+
---
|
|
2
|
+
name: omc-tool-selection
|
|
3
|
+
description: Choose the right OMC CLI tool for a goal. Use when unsure whether a task needs a high-level orchestration or a low-level atom.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Which Tool When (何时用哪个工具)
|
|
7
|
+
|
|
8
|
+
## Discovery 成本档位(按量级选,别一上来就点大档)
|
|
9
|
+
|
|
10
|
+
实测:一条重难业务里,agent 对**发现面**的重复读占了任务上下文的大头。先走小档,缺形状再逐级放大。
|
|
11
|
+
(round14 已把各面瘦身,下表为当前实测。)
|
|
12
|
+
|
|
13
|
+
| Face | ~size | 用途 |
|
|
14
|
+
| --- | ---: | --- |
|
|
15
|
+
| `omc next "<goal>"` | 2–5 KB | 目标→路线(首选) |
|
|
16
|
+
| `omc commands --json --compact --lane <lane>` | ~1 KB | 单能力工具行(最省的枚举面) |
|
|
17
|
+
| `omc describe <tool>` / `--example <id>` | 1.5–2.5 KB | 单工具形状 |
|
|
18
|
+
| `omc commands` | ~8 KB | 有界索引(name/lane/kind) |
|
|
19
|
+
| `omc commands --json --compact` | ~13 KB | 全量紧凑行 |
|
|
20
|
+
| `omc capabilities` | ~6 KB | 14 能力总览;`next` 已给路线时可省 |
|
|
21
|
+
| `omc commands --json` | ~20 KB | 全量目录(回退面,尽量避免) |
|
|
22
|
+
| `omc describe <tool> --full` | 7–19 KB | 仅当 schema 需要;不再重发 recipes(用 `--example` 取可运行参数) |
|
|
23
|
+
|
|
24
|
+
裸 `omc commands` 只是索引;**全量目录必须显式 `--json`**。同一 face 不要反复读。
|
|
25
|
+
|
|
26
|
+
## Minimal-path cheat sheet(最小路径速查)
|
|
27
|
+
|
|
28
|
+
一条需求先问"它属于哪一类",直接走对应的最小调用,别一上来铺工具:
|
|
29
|
+
|
|
30
|
+
| 你要做的事 | 一次调用(最小路径) |
|
|
31
|
+
| --- | --- |
|
|
32
|
+
| 读全**一个模型**的配置(字段/表单/列表/规则/数据规则/流程摘要) | `omc call model.inspect --args '{"schemaCode":"<m>"}'`(`all:true` 含系统字段) |
|
|
33
|
+
| **列模型** | `omc call model.list --args '{"filter":"<词>"}'` |
|
|
34
|
+
| 读**某条业务规则**的图 | `omc call rule.get --args '{"schemaCode":"<m>","ruleCode":"Create"}'`(不必先 list 取 id) |
|
|
35
|
+
| 读某模型的**流程**(只知模型码) | `omc call workflow.get_draft --args '{"schemaCode":"<m>"}'` |
|
|
36
|
+
| **改规则一个节点/分支阈值** | `omc call rule.node.update --args '{"schemaCode":"<m>","ruleCode":"Create","nodeCode":"Branch_1","patch":{...}}'`(patch 后自动 save;带 `"publish":true` 则保存+发布一调完成,生效仍需 `rule.enable`) |
|
|
37
|
+
| 从零**建一个流程**并发布 | `omc call configure_workflow --args '{"schemaCode":"<m>","name":"…","code":"<wf>","template":{...}}'` |
|
|
38
|
+
| **建模型+字段+表单+列表** | `omc call configure_model --args '{"name":"…","code":"<m>","fields":[...],"publishForm":true,"listview":{"fieldCodes":[...]}}'` |
|
|
39
|
+
| publish 流程前**只读预检** | `omc call workflow.validate --args '{"schemaCode":"<m>"}'` |
|
|
40
|
+
| **批量停用**某模型规则 | `omc call rule.disableMany --args '{"schemaCode":"<m>"}'`(默认含预置行;`customOnly:true` 只停自定义) |
|
|
41
|
+
| 字段清单(去噪) | `omc call field.list --args '{"schemaCode":"<m>","published":true}'`(默认业务字段,`all:true` 取全) |
|
|
42
|
+
|
|
43
|
+
**业务键优先**:`rule.get`/`datarule.update`/`datarule.delete`/`workflow.get_*` 接受业务键
|
|
44
|
+
(schemaCode+ruleCode / schemaCode+propertyCode / schemaCode),免去先 list 取 id。
|
|
45
|
+
|
|
46
|
+
**先看 `omc next` 的 `mode`**:`read` 只给读工具;`whole-package` 给 intent 声明式指引;
|
|
47
|
+
`build`/`modify` 给写工具;`scout`(能不能/怎么写)先探边界。
|
|
48
|
+
|
|
49
|
+
**纯读不必先发现**:已知读哪一面就直接 `omc call <读工具>`(上表),省掉 `next`/`discover_environment`;只有选不出工具时才用 `next`。发现仪式(`next`/`capabilities`/`discover_environment`)是写前与选不出工具时的路径。
|
|
50
|
+
|
|
51
|
+
## High layer — orchestrated CLI calls
|
|
52
|
+
|
|
53
|
+
| Goal | Tool |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| Inspect environment health | `get_status` |
|
|
56
|
+
| Full first look | `discover_environment` |
|
|
57
|
+
| New model to usable state (model → field → field.publish → form.draft → form.publish) | `configure_model`(+ `listview` 参数到列表) |
|
|
58
|
+
| Bind fields into the default form and publish | `configure_form` |
|
|
59
|
+
| Business rule saved and enabled | `configure_rule` |
|
|
60
|
+
| New workflow: create → update → publish (+ bind rules) | `configure_workflow` |
|
|
61
|
+
| Health chain (config → credential → login → version family → fingerprint) | `doctor` |
|
|
62
|
+
| Configure in-session with the human | `setup.start` → `setup.commit` |
|
|
63
|
+
|
|
64
|
+
## Low layer — atoms for fine control
|
|
65
|
+
|
|
66
|
+
Reads: `environment.fingerprint`, `field.list`, `form.get`, `rule.list`,
|
|
67
|
+
`data.list`, `data.load`, `service.list`, `service.get`, `app.list`, `coverage.manifest`,
|
|
68
|
+
`workflow.get_draft`, `workflow.get_published`.
|
|
69
|
+
|
|
70
|
+
Writes:
|
|
71
|
+
|
|
72
|
+
- Model: `model.create`, `model.delete`
|
|
73
|
+
- Applications: `app.create`, `app.delete` (deleting cascades its models)
|
|
74
|
+
- Fields: `field.create`, `field.update`, `field.publish`, `field.delete`
|
|
75
|
+
- Forms: `form.draft`, `form.publish`
|
|
76
|
+
- Rules: `rule.save`, `rule.enable`, `rule.disable`, `rule.delete`
|
|
77
|
+
- Workflow templates: `workflow.create`, `workflow.update`, `workflow.publish`, `workflow.bindRule`, `workflow.delete`
|
|
78
|
+
- Online JS: 本 CLI 只**发布/回读**(`onlinejs.compose`,平台模板保真);脚本**编写**不在 CLI 范围——遵循当前项目自带的在线 JS 编写规范(若有),否则向用户/设计者索取已定稿 `source`。后端的在线开发(Java 源码)用二开扩展包,也不在本 CLI 范围
|
|
79
|
+
- M2 data: `data.save`, `data.submit`, `data.delete`
|
|
80
|
+
- B2 services: `service.register`, `service.delete`
|
|
81
|
+
- List views: `listview.create`, `listview.configure`, `listview.delete`
|
|
82
|
+
|
|
83
|
+
## Decision rules
|
|
84
|
+
|
|
85
|
+
1. Default to the high layer; drop to atoms only to compose what the orchestration doesn't cover.
|
|
86
|
+
2. Preview any write with `dryRun:true`; it returns the plan and executes nothing.
|
|
87
|
+
3. `writable:false` refuses before any wire. A production write additionally requires `confirmProduction:true`.
|
|
88
|
+
4. Out-of-coverage desire (permissions, cross-model child linkage, OCR, app publish)? The refusal cites the manifest entry — that is the answer. Check `coverage.manifest`. Note: nested child tables are not a coverage gap — the platform itself only supports one level of child table.
|
|
89
|
+
5. If any call returns `uncertain`, stop writing and re-run discovery before the next write.
|
|
90
|
+
|
|
91
|
+
## Key-name table (同一对象在不同工具里的键名)
|
|
92
|
+
|
|
93
|
+
The same object is addressed under different keys. A wrong key is dropped silently
|
|
94
|
+
by the Tool-input gate and then reported only as `X: Required` — it never says
|
|
95
|
+
"the field you sent was ignored". Check here first.
|
|
96
|
+
|
|
97
|
+
| Object | Tools | Key |
|
|
98
|
+
| --- | --- | --- |
|
|
99
|
+
| Model | `model.*`, `field.*`, `form.*`, `datarule.*`, `rule.*` | `schemaCode` |
|
|
100
|
+
| Workflow template | `workflow.get_draft`, `workflow.get_published`, `workflow.bindRule` | `workflowCode`(或 `schemaCode`,工具内部解析) |
|
|
101
|
+
| Workflow template | `workflow.create`, `workflow.update`, `workflow.publish`, `workflow.delete` | `code`(+ `schemaCode`) |
|
|
102
|
+
| Default form | `form.get`, `form.draft`, `form.publish`, `configure_form` | `schemaCode`(必填)+ `sheetCode`(可选,默认=schemaCode) |
|
|
103
|
+
| Field | `field.create`, `field.update`, `field.delete` | `code` |
|
|
104
|
+
|
|
105
|
+
**业务键优先(identity seam)**:多个只读/改写工具现在接受业务键,免去先 list 取 id:
|
|
106
|
+
|
|
107
|
+
- `rule.get` 接受 `schemaCode + ruleCode`(返回**当前生效行**,不用先 `rule.list` 拿 id)。
|
|
108
|
+
- `datarule.update` / `datarule.delete` 接受 `schemaCode + propertyCode(+dataRuleType)`(同一字段多条规则时必须带 `dataRuleType` 去歧义)。
|
|
109
|
+
- `workflow.get_draft` / `workflow.get_published` 接受 `schemaCode`(不是每个模型都有流程;没有则 `exists:false`)。
|
|
110
|
+
|
|
111
|
+
**按工具别名(同一对象换个键名也收)**:`workflow.create/update/publish/delete` 的 `code`
|
|
112
|
+
也接受 `workflowCode`;`field.create/update/delete` 的 `code` 也接受 `propertyCode`。
|
|
113
|
+
别名只在规范键缺失时补入,不会覆盖;它**按工具声明**(不是全局),因为同一个 `code`
|
|
114
|
+
在不同工具里可能指不同对象。
|
|
115
|
+
|
|
116
|
+
精确 `id` 仍然可用,旧调用不受影响。`workflowCode` 与 `code` 指同一流程:读/绑定工具用
|
|
117
|
+
`workflowCode`,写工具用 `code`(写工具现已同时接受 `workflowCode`);读工具现在也可直接给 `schemaCode`。
|
|
118
|
+
|
|
119
|
+
Fixture discipline: one-shot `omc_mcp_*` fixtures, cleaned up in reverse order, zero residue.
|