@stalfh233/omc-cli 0.7.0 → 0.8.1
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/coverage/m1-coverage-manifest-v1.json +88 -2
- package/dist/bootstrap.js +49 -0
- package/dist/call.js +23 -8
- package/dist/capability-overview.js +16 -4
- package/dist/cli.js +36 -16
- package/dist/contract-resources.js +2 -0
- package/dist/coverage-registry.js +4 -0
- package/dist/coverage.js +16 -2
- package/dist/endpoints.js +65 -0
- package/dist/environment-policy.js +15 -1
- package/dist/field-change.js +9 -2
- package/dist/field-families.js +27 -6
- package/dist/governed-execution.js +18 -12
- package/dist/human-summary.js +8 -0
- package/dist/intent/capabilities/field.js +6 -0
- package/dist/lanes/environment.js +3 -0
- package/dist/lanes/field-contract.js +117 -6
- package/dist/lanes/file-contract.js +69 -0
- package/dist/lanes/file-coverage.js +16 -0
- package/dist/lanes/file.js +257 -0
- package/dist/lanes/lane-ids.js +1 -0
- package/dist/lanes/list-view-contract.js +3 -3
- package/dist/lanes/list-view-shapes.js +56 -0
- package/dist/lanes/list-view.js +40 -5
- package/dist/lanes/meta.js +5 -4
- package/dist/lanes/model.js +8 -4
- package/dist/lanes/org-query-contract.js +62 -0
- package/dist/lanes/org-query-coverage.js +27 -0
- package/dist/lanes/org-query.js +610 -0
- package/dist/lanes/organization.js +44 -11
- package/dist/lanes/runtime-data.js +228 -59
- package/dist/lanes/workflow-contract.js +110 -1
- package/dist/lanes/workflow-coverage.js +13 -0
- package/dist/lanes/workflow.js +710 -13
- package/dist/omc-core-lazy.js +37 -1
- package/dist/package.js +3 -1
- package/dist/read-shapes.js +3 -3
- package/dist/recipes/runtime-data.js +8 -6
- package/dist/refusal-guidance.js +2 -1
- package/dist/rule-support.js +15 -17
- package/dist/session-manager.js +9 -3
- package/dist/session.js +70 -11
- package/dist/token-cache.js +5 -0
- package/dist/tool-types.js +15 -1
- package/dist/tools.js +18 -0
- package/dist/version-family-gaps.js +8 -1
- package/dist/version-partition.js +633 -0
- package/dist/wire.js +8 -2
- package/dist/write.js +11 -2
- package/package.json +3 -3
- package/skills/omc-capabilities.md +9 -2
- package/skills/omc-refusals.md +18 -0
- package/skills/omc-write-hazards.md +8 -0
|
@@ -453,6 +453,42 @@
|
|
|
453
453
|
"workflow participant resolution"
|
|
454
454
|
]
|
|
455
455
|
},
|
|
456
|
+
{
|
|
457
|
+
"capability": "organization lightweight queries (search/visible/tree/users)",
|
|
458
|
+
"status": "executable",
|
|
459
|
+
"scope": "Read-only organization directory faces on the session controller API (the openapi v3 twins require an OAuth2 client id the CLI does not have): POST /api/api/organization/user/searchDepartments {wd} -> DepartmentModel[] (name contains, unpaged), GET /api/api/organization/department/search_dept_detail?deptId= -> data.scopeModel (selection visibility scope; 8.6 stores deptVisibleScope/staffVisibleScope as JSON strings, 2.1.5 adds specialStaffVisibleRules), GET /api/api/organization/department/tree?deptIds= -> direct children only (roots when empty), POST /api/api/organization/user/searchCondiction {userName,deptIds,roleIds,userIds,page,size} -> pageable ignored server-side (UserService.listUsersByIdsAndName drops the Pageable; empty conditions short-circuit to empty). Used to resolve a name / department / mobile into platform-known unit and user ids before building a participant, owner or department scope; pagination is enforced by the CLI (local slicing) so a large tenant never inlines an unbounded list.",
|
|
460
|
+
"version_family": "8.6",
|
|
461
|
+
"anchor_version": "8.6.26",
|
|
462
|
+
"evidence": [
|
|
463
|
+
{
|
|
464
|
+
"path": "packages/omc-cli/src/lanes/org-query.ts",
|
|
465
|
+
"anchor": "org.searchUnits / org.department.search / org.visibleDepartments / org.departmentTree / org.users"
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
"path": "packages/omc-cli/src/lanes/org-query-contract.ts",
|
|
469
|
+
"anchor": "session endpoints; openapi v3 rejected (OpenapiPermissionAspect clientId gate)"
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
"path": "packages/omc-cli/test/org-query.test.ts",
|
|
473
|
+
"anchor": "fake-harness coverage: paging boundaries, error passthrough, mobile fallback"
|
|
474
|
+
}
|
|
475
|
+
],
|
|
476
|
+
"lane": "W7-S29-greenfield",
|
|
477
|
+
"tools": [
|
|
478
|
+
"org.searchUnits",
|
|
479
|
+
"org.department.search",
|
|
480
|
+
"org.visibleDepartments",
|
|
481
|
+
"org.departmentTree",
|
|
482
|
+
"org.users"
|
|
483
|
+
],
|
|
484
|
+
"scopes": [
|
|
485
|
+
"org directory read: search users and departments by name",
|
|
486
|
+
"org directory read: search departments by name (paged)",
|
|
487
|
+
"org directory read: department selection visibility scope",
|
|
488
|
+
"org directory read: direct child departments of a parent",
|
|
489
|
+
"org directory read: in-service user paging (simple/detailed projection)"
|
|
490
|
+
]
|
|
491
|
+
},
|
|
456
492
|
{
|
|
457
493
|
"capability": "W7 S29 residual workflow OQs",
|
|
458
494
|
"status": "partial",
|
|
@@ -1573,12 +1609,28 @@
|
|
|
1573
1609
|
"tools": [
|
|
1574
1610
|
"workflow.transfer",
|
|
1575
1611
|
"workflow.activate",
|
|
1576
|
-
"workflow.finish"
|
|
1612
|
+
"workflow.finish",
|
|
1613
|
+
"workflow.reject",
|
|
1614
|
+
"workflow.forward",
|
|
1615
|
+
"workflow.adjust",
|
|
1616
|
+
"workflow.assist",
|
|
1617
|
+
"workflow.circulate",
|
|
1618
|
+
"workflow.revoke",
|
|
1619
|
+
"workflow.abort",
|
|
1620
|
+
"workflow.rejectActivities"
|
|
1577
1621
|
],
|
|
1578
1622
|
"scopes": [
|
|
1579
1623
|
"runtime workflow admin adjust participant",
|
|
1580
1624
|
"runtime workflow admin activate activity",
|
|
1581
|
-
"runtime workflow admin finish instance"
|
|
1625
|
+
"runtime workflow admin finish instance",
|
|
1626
|
+
"runtime workflow approval action reject",
|
|
1627
|
+
"runtime workflow approval action forward",
|
|
1628
|
+
"runtime workflow approval action add-sign",
|
|
1629
|
+
"runtime workflow approval action assist",
|
|
1630
|
+
"runtime workflow approval action circulate",
|
|
1631
|
+
"runtime workflow approval action revoke",
|
|
1632
|
+
"runtime workflow approval action abort instance",
|
|
1633
|
+
"runtime workflow approval action reject-target lookup"
|
|
1582
1634
|
],
|
|
1583
1635
|
"revision_note": "r64(2026-11-14)新增:用户需求的流程运维三件套,真机全链实证(workflow_operation approval 对象形状 / adjust_workItem=加签面 / finish=正常完结语义)。定位=测试提速:运维过的实例不能用于真实流程/权限验证。"
|
|
1584
1636
|
},
|
|
@@ -1609,6 +1661,40 @@
|
|
|
1609
1661
|
"scopes": [
|
|
1610
1662
|
"draft published face semantic diff (workflow|form)"
|
|
1611
1663
|
]
|
|
1664
|
+
},
|
|
1665
|
+
{
|
|
1666
|
+
"capability": "Runtime file transfer (multipart upload refId ↔ local path download)",
|
|
1667
|
+
"status": "executable",
|
|
1668
|
+
"scope": "Upload a local file through the platform multipart `upload_file` face (plain-string refId) and download it back by refId into a local path (attachment channel or the raw storage-key channel used by upload_file), returning path/size/sha256 without inlining binary bytes. Writable gate + confirmProduction apply to upload; download is a read. RefId is potentially one-shot (consuming delete=true flows remove the refId→filename cache).",
|
|
1669
|
+
"version_family": "8.6",
|
|
1670
|
+
"anchor_version": "8.6.26",
|
|
1671
|
+
"evidence": [
|
|
1672
|
+
{
|
|
1673
|
+
"path": "cp-sources/backend/decompiled-full/launcher-8.6.26/.../QueryRuntimeController.java",
|
|
1674
|
+
"anchor": "2415-2428,2868-2890"
|
|
1675
|
+
},
|
|
1676
|
+
{
|
|
1677
|
+
"path": "cp-sources/backend/decompiled-full/launcher-8.6.26/.../FileServerController.java",
|
|
1678
|
+
"anchor": "78-113"
|
|
1679
|
+
},
|
|
1680
|
+
{
|
|
1681
|
+
"path": "packages/omc-cli/src/lanes/file.ts",
|
|
1682
|
+
"anchor": "file.upload/file.download registration"
|
|
1683
|
+
},
|
|
1684
|
+
{
|
|
1685
|
+
"path": "packages/omc-cli/test/file-transfer.test.ts",
|
|
1686
|
+
"anchor": "file transfer upload/download/one-shot/governance"
|
|
1687
|
+
}
|
|
1688
|
+
],
|
|
1689
|
+
"lane": "file-transfer",
|
|
1690
|
+
"tools": [
|
|
1691
|
+
"file.upload",
|
|
1692
|
+
"file.download"
|
|
1693
|
+
],
|
|
1694
|
+
"scopes": [
|
|
1695
|
+
"file upload (multipart → refId)",
|
|
1696
|
+
"file download (refId → local path)"
|
|
1697
|
+
]
|
|
1612
1698
|
}
|
|
1613
1699
|
]
|
|
1614
1700
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* O1: Node 模块编译缓存(V8 compile cache)。
|
|
3
|
+
*
|
|
4
|
+
* 这是 CLI **执行的第一段用户代码**(`cli.ts` 的第一条 import),只允许依赖
|
|
5
|
+
* `node:` 内置模块——绝不能拉起 `omc-core` / `node:sqlite`(T04 的 stderr
|
|
6
|
+
* 过滤器依赖 omc-core 保持动态 import)。调用点必须在任何会动态装载的大图
|
|
7
|
+
* (尤其 `import("omc-core")`)之前生效:Node 只缓存 **enable 之后**装载的模块。
|
|
8
|
+
*
|
|
9
|
+
* 行为约定(缺一不可):
|
|
10
|
+
* - Node < 22.1(没有 `enableCompileCache`)静默跳过;
|
|
11
|
+
* - 缓存目录不可写 / API 抛错静默跳过;
|
|
12
|
+
* - 目录可用 `OMC_COMPILE_CACHE` 覆盖;缺省与 `config-store.defaultPaths()` 对齐
|
|
13
|
+
* (`OMC_CONFIG_HOME` 或 `~/.config/omc` 下的 `compile-cache`)。
|
|
14
|
+
*
|
|
15
|
+
* 注意:本模块**不能** import `config-store.js`(那会把整张配置图拉进静态图,
|
|
16
|
+
* 也会让本文件不再是「只依赖 node:」)。下面的 root 解析是与
|
|
17
|
+
* `config-store.ts:140-148` 人工对齐的最小内联实现,改那里时记得同步这里。
|
|
18
|
+
*/
|
|
19
|
+
import module from "node:module";
|
|
20
|
+
import { homedir } from "node:os";
|
|
21
|
+
import { join, resolve } from "node:path";
|
|
22
|
+
/** 缓存目录:`OMC_COMPILE_CACHE` 优先;否则 `<configRoot>/compile-cache`。 */
|
|
23
|
+
export function compileCacheDir(env = process.env) {
|
|
24
|
+
const override = env.OMC_COMPILE_CACHE?.trim();
|
|
25
|
+
if (override)
|
|
26
|
+
return resolve(override);
|
|
27
|
+
const configRoot = env.OMC_CONFIG_HOME?.trim()
|
|
28
|
+
? resolve(env.OMC_CONFIG_HOME)
|
|
29
|
+
: join(homedir(), ".config", "omc");
|
|
30
|
+
return join(configRoot, "compile-cache");
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* 尽力启用编译缓存。返回是否真正调用了宿主 API(测试用);任何失败都吞掉
|
|
34
|
+
* ——缓存是优化,永远不能成为 CLI 的启动依赖。
|
|
35
|
+
*/
|
|
36
|
+
export function enableCompileCache(dir = compileCacheDir(), host = module) {
|
|
37
|
+
try {
|
|
38
|
+
if (typeof host.enableCompileCache !== "function")
|
|
39
|
+
return false;
|
|
40
|
+
host.enableCompileCache(dir);
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
// import 即生效:这是本模块存在的唯一理由。
|
|
48
|
+
enableCompileCache();
|
|
49
|
+
//# sourceMappingURL=bootstrap.js.map
|
package/dist/call.js
CHANGED
|
@@ -100,13 +100,21 @@ export function toolsByTextIntent(query, registry, limit = 2) {
|
|
|
100
100
|
.slice(0, limit)
|
|
101
101
|
.map((entry) => entry.name);
|
|
102
102
|
}
|
|
103
|
+
/*
|
|
104
|
+
* O4(0.8.1 决策变更):版本证据按缓存窗口复用;写路径**不再**强制重探。
|
|
105
|
+
* 0.8.0 起版本证据不是写门(只影响诊断提示),而一次强制重探要给每笔写
|
|
106
|
+
* 多付 2 个 HTTP(license/info + system/config),缓存命中路径还会重新登录、
|
|
107
|
+
* 覆盖预置 JWT(journal actor 变成 token-not-jwt)。CLI 是一进程一次调用,
|
|
108
|
+
* 为 15 分钟陈旧付这个代价不划算。运维可用 `OMC_VERSION_RECHECK_MS=0`
|
|
109
|
+
* 让窗口恒失效(每进程必探),见 session.ts 的 versionRecheckMs。
|
|
110
|
+
*/
|
|
103
111
|
export async function runToolCall(toolName, options = {}) {
|
|
104
112
|
const print = options.print ?? ((line) => console.log(line));
|
|
105
113
|
const baseContext = options.context ?? makeToolContext({ sessions: new SessionManager(new ConfigStore(defaultPaths())) });
|
|
106
114
|
// R88 #3: the write reason arrives beside the args, never inside them — the
|
|
107
115
|
// per-call context carries it to whichever governed write journals.
|
|
108
116
|
const context = options.reason === undefined ? baseContext : { ...baseContext, writeAudit: { reason: options.reason } };
|
|
109
|
-
const registry = buildToolRegistry();
|
|
117
|
+
const registry = options.registry ?? buildToolRegistry();
|
|
110
118
|
const tool = registry.find((definition) => definition.name === toolName);
|
|
111
119
|
if (!tool) {
|
|
112
120
|
// Round 4: return the closest candidates, not the whole inventory. A live
|
|
@@ -157,14 +165,21 @@ export async function runToolCall(toolName, options = {}) {
|
|
|
157
165
|
args.requestId = options.requestId;
|
|
158
166
|
if (options.dryRun)
|
|
159
167
|
args.dryRun = true;
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
168
|
+
if (options.parsedInput !== true) {
|
|
169
|
+
try {
|
|
170
|
+
args = parseToolInput(tool, args);
|
|
171
|
+
}
|
|
172
|
+
catch (error) {
|
|
173
|
+
const result = attachRefusalRecovery(error instanceof ToolInputError ? error.payload : { status: "error", message: error instanceof Error ? error.message : String(error) }, toolName, registry);
|
|
174
|
+
print(redact(result, []));
|
|
175
|
+
return { exitCode: CALL_EXIT_CODES.invalidInput, result };
|
|
176
|
+
}
|
|
167
177
|
}
|
|
178
|
+
// O4(0.8.1 决策变更):版本证据按缓存窗口复用;写路径不再强制重探
|
|
179
|
+
// (窗口逻辑见 session.ts probeVersionEvidence / OMC_VERSION_RECHECK_MS)。
|
|
180
|
+
// 这里曾对每个环境的首次写做一次强制探针,代价是每笔写 +2 个 HTTP,并且
|
|
181
|
+
// 缓存命中路径会重新登录、把预置 JWT 覆盖成平台新签 token(journal actor
|
|
182
|
+
// 随之失去 token-claim)。0.8.0 起版本不是写门,诊断面拿缓存证据就够。
|
|
168
183
|
const invoke = async () => {
|
|
169
184
|
try {
|
|
170
185
|
return (await tool.handler(context, args, tool));
|
|
@@ -141,11 +141,11 @@ const SURFACES = [
|
|
|
141
141
|
id: "workflow",
|
|
142
142
|
title: "流程模板 + 组织与权限",
|
|
143
143
|
lane: LANES.workflow,
|
|
144
|
-
description: "流程模板生命周期:workflow.list(应用内流程清单)、get_draft/get_published、create、update、publish、bindRule/unbindRule(绑定与解绑)、delete、workitem.list;**症状排查先 config.diff**(草稿↔发布双面差异:活动/连线/三类绑定,domain 另支持 form
|
|
145
|
-
operations: ["diff", "list", "create", "update", "publish", "bindRule", "unbindRule", "delete"],
|
|
144
|
+
description: "流程模板生命周期:workflow.list(应用内流程清单)、get_draft/get_published、create、update、publish、bindRule/unbindRule(绑定与解绑)、delete、workitem.list;**症状排查先 config.diff**(草稿↔发布双面差异:活动/连线/三类绑定,domain 另支持 form 表单布局双面)。**审批动作**(平台内置 MCP 同源面):workflow.reject(驳回)/forward(转办)/adjust(加签)/assist(协办)/circulate(传阅)/revoke(撤回)/abort(作废)+ 只读 workflow.rejectActivities(可驳回节点)。**含组织/部门/角色/权限范围(org.* 工具)**:部门树、角色组/角色、用户搜索、成员与管理范围(userScope)——流程参与人/可见性的候选来源。",
|
|
145
|
+
operations: ["diff", "list", "create", "update", "publish", "bindRule", "unbindRule", "delete", "reject", "forward", "adjust", "assist", "circulate", "revoke", "abort"],
|
|
146
146
|
requires: ["model"],
|
|
147
|
-
intent: { level: "partial", note: "声明式支持 workflow.create/update/publish 与 bindRules(事件处理器规则绑定,merge/ensure-present);runtime workitem
|
|
148
|
-
notes: "greenfield 首版;publish/bindRule 不得在 ValidateMessage[] 拒绝时报告成功。组织读写(org.*)挂在本能力下,别名 org/organization/organisation。r64 起含**流程运维三件套**(workflow.transfer
|
|
147
|
+
intent: { level: "partial", note: "声明式支持 workflow.create/update/publish 与 bindRules(事件处理器规则绑定,merge/ensure-present);runtime workitem(提交/审批/驳回/转办等审批动作)仍走 escape hatch。" },
|
|
148
|
+
notes: "greenfield 首版;publish/bindRule 不得在 ValidateMessage[] 拒绝时报告成功。组织读写(org.*)挂在本能力下,别名 org/organization/organisation。r64 起含**流程运维三件套**(workflow.transfer 替换节点参与者 / workflow.activate 跳转节点 / workflow.finish 手动结束·end 规则照常触发)——测试提速定位:运维过的实例权限语义已变,不能用于真实流程/权限验证。t17 起含 **OpenAPI v2 审批动作七件套**(reject/forward/adjust/assist/circulate/revoke/abort):走 `/api/openapi/v2/runtime/workflow/*`(单层 /api,userId 头认人),平台对失败也回 errcode 0 + data:false(工具按 data 判成败);forward 只认第一个接收人,rejectActivities 只回实例走过的节点。",
|
|
149
149
|
},
|
|
150
150
|
{
|
|
151
151
|
id: "onlinejs",
|
|
@@ -195,6 +195,14 @@ const SURFACES = [
|
|
|
195
195
|
requires: ["field"],
|
|
196
196
|
intent: { level: "none", note: "未覆盖;用 omc call data.*。" },
|
|
197
197
|
},
|
|
198
|
+
{
|
|
199
|
+
id: "file",
|
|
200
|
+
title: "文件传输",
|
|
201
|
+
lane: LANES.file,
|
|
202
|
+
description: "本地文件上传取平台 refId;按 refId 下载到本地路径(表单附件通道或 upload_file 临时对象通道),回执 path/size/sha256。",
|
|
203
|
+
operations: ["upload", "download"],
|
|
204
|
+
intent: { level: "none", note: "运行期工具,未进 intent 声明式面;用 omc call file.*。" },
|
|
205
|
+
},
|
|
198
206
|
];
|
|
199
207
|
const COVERAGE_RANK = { executable: 4, partial: 3, "static-only": 2, blocked: 1, unsupported: 0 };
|
|
200
208
|
const CAPABILITY_ALIASES = Object.freeze({
|
|
@@ -218,6 +226,7 @@ const CAPABILITY_ALIASES = Object.freeze({
|
|
|
218
226
|
bizservice: ["bizservices", "B2-registration"],
|
|
219
227
|
report: ["reports", "R1-report"],
|
|
220
228
|
data: ["runtime-data", "M2-runtime-data"],
|
|
229
|
+
file: ["file-transfer", "files", "文件传输"],
|
|
221
230
|
});
|
|
222
231
|
/**
|
|
223
232
|
* r59 Step 1 — scenario phrases for `commands --filter` ONLY.
|
|
@@ -251,6 +260,7 @@ export const CAPABILITY_SCENARIOS = Object.freeze({
|
|
|
251
260
|
"连数据库取数", "配SQL数据源", "把数据推送到别的系统", "同步到另一个系统", "同步到别的系统",
|
|
252
261
|
"回调", "外部系统回调我们"],
|
|
253
262
|
data: ["造数据", "录数据"],
|
|
263
|
+
file: ["上传文件", "下载文件", "文件传输", "把文件传上去", "取回附件"],
|
|
254
264
|
});
|
|
255
265
|
/**
|
|
256
266
|
* Requirement cues per capability (round 3): the Chinese phrases a requirement
|
|
@@ -318,6 +328,7 @@ export const CAPABILITY_CUES = Object.freeze({
|
|
|
318
328
|
// 此前只命中 listview 的「列表」→ 路由给视图配置面(用户想查数据却拿到视图读写工具)。
|
|
319
329
|
// 复合词(不裸配「列表/数据」)避免抢「列表视图/视图列」;评分按 cue 长度,长词胜出。
|
|
320
330
|
data: ["运行数据", "提交数据", "保存记录", "查记录", "造数据", "测试数据", "测试单据", "造单据", "造单", "录数据", "填数据", "模拟数据", "业务数据", "造几条", "造两张", "造几张", "验数据", "批量导入", "批量写入", "批量删除", "导入数据", "列表数据", "数据列表", "查数据", "数据查询", "拉数据", "拉一份数据", "看看数据", "查一下数据", "数据明细", "取数据", "数据的列表", "数据列表页", "数据记录"],
|
|
331
|
+
file: ["上传文件", "文件上传", "下载文件", "文件下载", "附件下载", "文件传输", "refId"],
|
|
321
332
|
// r18 (2026-10-26): "造数据 / 造测试单据 / 录数据" is the RUN-DATA capability, but
|
|
322
333
|
// the goal usually also says 子表/明细 (field cues) — without these compound
|
|
323
334
|
// cues the router sent the probe to `field` in read mode (write:false), so it
|
|
@@ -411,6 +422,7 @@ const CAPABILITY_TOPICS = Object.freeze({
|
|
|
411
422
|
bizservice: ["omc-business-configuration", "omc-write-hazards"],
|
|
412
423
|
report: ["omc-business-configuration", "omc-write-hazards"],
|
|
413
424
|
data: ["omc-business-configuration", "omc-refusals"],
|
|
425
|
+
file: ["omc-write-hazards", "omc-refusals"],
|
|
414
426
|
});
|
|
415
427
|
/** Strongest coverage status across the lane's manifest items. */
|
|
416
428
|
function coverageOf(manifest, lane) {
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
//
|
|
2
|
+
// O1:编译缓存必须尽量早——它只依赖 node:,放在 SQLite 过滤器之前也不影响 T04
|
|
3
|
+
// (两者都不拉起 omc-core;过滤器仍先于所有会 link node:sqlite 的模块执行)。
|
|
4
|
+
import "./bootstrap.js";
|
|
5
|
+
// T04:SQLite 警告过滤器必须保持第一梯队 import(先于任何拉起 omc-core/node:sqlite 的模块)。
|
|
3
6
|
import "./sqlite-warning-filter.js";
|
|
4
7
|
import { argvValue } from "./args.js";
|
|
5
8
|
import { spawn, spawnSync } from "node:child_process";
|
|
@@ -175,10 +178,9 @@ async function cmdSetup(store, args) {
|
|
|
175
178
|
// 时退化为全量 dump。对齐安装器对 codegraph 的首建行为——setup 成功后顺手
|
|
176
179
|
// 拉一次 graph 索引(失败静默跳过,不阻塞 setup;下次 graph 命令会兜底)。
|
|
177
180
|
try {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
const session = new
|
|
181
|
-
await session.login();
|
|
181
|
+
// O7: go through SessionManager so the graph warm-up reuses the
|
|
182
|
+
// cross-process token cache instead of forcing another login handshake.
|
|
183
|
+
const session = await new SessionManager(store).session(name);
|
|
182
184
|
const { publishGraphPull } = await import("./graph.js");
|
|
183
185
|
const pulled = await publishGraphPull(session);
|
|
184
186
|
console.error(`graph 索引已预热:${pulled.rules.length} 规则 / ${pulled.edges.length} 边(omc graph search/references 可用;环境变更后 omc graph pull 刷新)`);
|
|
@@ -188,12 +190,16 @@ async function cmdSetup(store, args) {
|
|
|
188
190
|
}
|
|
189
191
|
return 0;
|
|
190
192
|
}
|
|
191
|
-
async function cmdDoctor(store, environment, serviceCode) {
|
|
193
|
+
async function cmdDoctor(store, environment, serviceCode, freshLogin = false) {
|
|
192
194
|
const manifest = loadCoverageManifest();
|
|
193
195
|
const steps = [];
|
|
194
196
|
let ok = true;
|
|
195
|
-
//
|
|
196
|
-
//
|
|
197
|
+
// O7: where the session token came from; carried in the structured envelope
|
|
198
|
+
// so "doctor passed without a handshake" is visible, never implied.
|
|
199
|
+
let loginSource;
|
|
200
|
+
// 版本族缺口(§三.3-9):没有版本证据时也要照实说「无证据 → 按兼容模式放行、
|
|
201
|
+
// 平台是最终门」(2026-11-24 口径;不再是 fail closed),所以用 undefined
|
|
202
|
+
// 而不是拼一个默认值。
|
|
197
203
|
let detectedVersion;
|
|
198
204
|
// r45 Windows 实测:PowerShell 管道按 GBK(936) 解码 CLI 的 UTF-8 输出 → 全屏乱码,
|
|
199
205
|
// 且用户常误判为「OMC 输出坏了」。doctor 是入口体检,顺手检测活动代码页。
|
|
@@ -232,10 +238,13 @@ async function cmdDoctor(store, environment, serviceCode) {
|
|
|
232
238
|
steps.push(`租户 ok 多租户 engineCode=${resolved.profile.engineCode}(随每笔请求发 x-lowcode-enginecode)`);
|
|
233
239
|
const credential = store.readCredential(resolved.name);
|
|
234
240
|
steps.push(`凭据 ok 模式=${store.credentialsMode()} 账号=${credential.username}`);
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
241
|
+
// O7: default to the cross-process token cache (login handshake 0×); the
|
|
242
|
+
// doctor still performs a real platform read below (apppackage/list), so
|
|
243
|
+
// "reachable" is proven every time. `--fresh-login` opts back into the
|
|
244
|
+
// full six-round-trip handshake.
|
|
245
|
+
const session = await new SessionManager(store).session(resolved.name, freshLogin ? { freshLogin: true } : {});
|
|
246
|
+
loginSource = session.loginSource();
|
|
247
|
+
steps.push(`登录 ok 企业=${session.enterpriseId()} 管理员=${session.administrator()}(${loginSource})`);
|
|
239
248
|
// A deployment whose system/config `client` blob is absent/unreadable still
|
|
240
249
|
// logs in (client_secret is optional on 8.x). Say so as a WARN: it used to
|
|
241
250
|
// abort the login and report env-unreachable on a perfectly usable box.
|
|
@@ -244,7 +253,7 @@ async function cmdDoctor(store, environment, serviceCode) {
|
|
|
244
253
|
const version = session.detectedVersion();
|
|
245
254
|
detectedVersion = version;
|
|
246
255
|
if (!version) {
|
|
247
|
-
steps.push(`版本 WARN
|
|
256
|
+
steps.push(`版本 WARN 无版本证据;写入按兼容模式放行(versionEvidence=absent),平台是最终门`);
|
|
248
257
|
}
|
|
249
258
|
else {
|
|
250
259
|
const notice = versionFamilyNotice(manifest, version);
|
|
@@ -355,6 +364,7 @@ async function cmdDoctor(store, environment, serviceCode) {
|
|
|
355
364
|
// (r26b:stderr 给了 agent 也读不到结构化字段,而锚点是每会话都要用的指引)。
|
|
356
365
|
writeEnvelope(envelope(ok ? "ok" : "failed", {
|
|
357
366
|
checks: steps.map(parseDoctorStep),
|
|
367
|
+
...(loginSource !== undefined ? { loginSource } : {}),
|
|
358
368
|
anchor: doctorAnchor(),
|
|
359
369
|
unsupportedCapabilities: unsupportedCapabilities(manifest, detectedVersion),
|
|
360
370
|
}, requestId()));
|
|
@@ -835,6 +845,10 @@ async function cmdCall(store, args) {
|
|
|
835
845
|
try {
|
|
836
846
|
({ result } = await runToolCall(toolName, {
|
|
837
847
|
args: parsedArgs,
|
|
848
|
+
// O2: this registry already validated the args above; do not rebuild or
|
|
849
|
+
// re-parse the same input inside runToolCall.
|
|
850
|
+
registry,
|
|
851
|
+
parsedInput: true,
|
|
838
852
|
...(environment ? { environment } : {}),
|
|
839
853
|
...(requestValue !== undefined ? { requestId: requestValue } : {}),
|
|
840
854
|
...(writeReason !== undefined ? { reason: writeReason } : {}),
|
|
@@ -1017,8 +1031,14 @@ function resolvedDefaultEnvironment(store) {
|
|
|
1017
1031
|
* template re-read three times is 81 KB of the session.
|
|
1018
1032
|
*/
|
|
1019
1033
|
const ARTIFACT_INLINE_CEILING_BYTES = 8192;
|
|
1020
|
-
/**
|
|
1021
|
-
|
|
1034
|
+
/**
|
|
1035
|
+
* commands --json 的上下文预算。2026-11-24(审批动作 / MCP 对齐批):32KiB →
|
|
1036
|
+
* 40KiB——裸目录已到 32.8KB(workflow 审批动作七件套 + 可驳回节点查询 8 行),
|
|
1037
|
+
* 越过旧 32KiB 门会让 `commands --json` 外置成 artifact 指针(artifactId 随机,
|
|
1038
|
+
* golden master 当场漂移),而目录本身仍应内联可读。文本门与本体门同批抬到
|
|
1039
|
+
* 40,000/340,000(见 test/context-cost-budgets.test.ts)。
|
|
1040
|
+
*/
|
|
1041
|
+
const COMMANDS_JSON_INLINE_CEILING_BYTES = 40 * 1024;
|
|
1022
1042
|
/** 超过这个体积就提醒走更窄的面(不改变返回值)。 */
|
|
1023
1043
|
const COMMANDS_JSON_HINT_BYTES = 16 * 1024;
|
|
1024
1044
|
/**
|
|
@@ -3196,7 +3216,7 @@ async function main() {
|
|
|
3196
3216
|
}
|
|
3197
3217
|
commandExitCode = CLI_EXIT_CODES.ok;
|
|
3198
3218
|
});
|
|
3199
|
-
command.command("doctor").option("--environment <environment>").option("--env <environment>").option("--service <serviceCode>", "可选:体检单个业务集成服务的鉴权参数形状(掩码/占位/全 0 检出,WARN 非致命)").action(async (options) => { commandExitCode = await cmdDoctor(new ConfigStore(defaultPaths()), options.environment ?? options.env, options.service); });
|
|
3219
|
+
command.command("doctor").option("--environment <environment>").option("--env <environment>").option("--service <serviceCode>", "可选:体检单个业务集成服务的鉴权参数形状(掩码/占位/全 0 检出,WARN 非致命)").option("--fresh-login", "忽略 token 缓存,做一次完整登录握手(默认复用缓存,登录请求 0 次;回执 loginSource 标明来源)").action(async (options) => { commandExitCode = await cmdDoctor(new ConfigStore(defaultPaths()), options.environment ?? options.env, options.service, options.freshLogin === true); });
|
|
3200
3220
|
command.command("call <tool>").option("--env <environment>", "环境名;项目白名单按当前 cwd 解析,须在含 .omc-env 的目录内运行").option("--environment <environment>").option("--args <json>").option("--args-file <path>", "从文件读参数 JSON。**必须位于配置根内**(数组批量请改用 --args-list;跨目录/系统临时文件会被拒);免落盘用 `--args -`(stdin)").option("--args-list <json-array>", '同一工具跑 N 次(JSON 数组,每条一个 args 对象,最多 200 条);超过上限请分批,或用 omc script 读文件。逐条执行、默认不中断,最后回 succeeded/failed 汇总。适合批量建字段等').option("--preflight", "与 --args-list 一起用:只跑参数校验 + 写前语义闸(零 wire、零写入),一次报全所有形状问题").option("--keys", "与 artifact get 的 --keys 同义(= --extract-keys):列出本次结果 artifact 的顶层键与体积").addOption(new Option("--extract <path>", "在本次结果的 artifact 内取一个路径的值(可重复;省掉一次 artifact get)").argParser((value, previous = []) => [...previous, value]).default([])).addOption(new Option("--jq [path]", "路径选择器(非 jq)——不是 jq 表达式,不支持管道;[] 映射如 items[].fields.planNo;裸 --jq 列顶层键。单路径命中时 result 直接是节点本体。示例:omc call model.list --env e --jq models · omc call rule.list --env e --args '{\"schemaCode\":\"m\"}' --jq rules[].code · omc call workflow.get_published --env e --args '{\"code\":\"f\"}' --jq activities[].bizActions").argParser((value, previous = []) => [...previous, value]).default([])).option("--extract-keys", "列出本次结果 artifact 的顶层键与体积(省掉一次 artifact get --keys)").option("--max-output-bytes <bytes>", "最终 stdout 信封预算;默认 65536(投影/--jq 之后再判);读面 diet(~2048) 独立外置 detailArtifactId,抬高本参数不会把已 diet 的大表重新内联;artifact get 内联上限 8192").option("--request-id <requestId>").option("--reason <text>", "写入原因(审计面,仅写操作):记入本次写 journal 行的 reason;不是工具参数(写 schema 拒未知键),也不参与任何门禁").option("--timeout-ms <milliseconds>").option("--wait <milliseconds>", "仅 `omc call` / `omc intent apply` 支持;写锁冲突时有界排队(0=立刻拒绝)").option("--dry-run").addHelpText("after", `\n${onboardingHelp()}\n`).action(async (tool, options) => {
|
|
3201
3221
|
const rest = [tool, ...(options.env ? ["--env", options.env] : []), ...(options.environment ? ["--environment", options.environment] : []), ...(options.args !== undefined ? ["--args", options.args] : []), ...(options.argsFile !== undefined ? ["--args-file", options.argsFile] : []), ...(options.argsList !== undefined ? ["--args-list", options.argsList] : []), ...(options.preflight ? ["--preflight"] : []), ...(Array.isArray(options.extract) ? options.extract.flatMap((path) => ["--extract", path]) : []), ...(options.jq === true ? ["--jq"] : Array.isArray(options.jq) ? options.jq.flatMap((path) => path === true ? ["--jq"] : ["--jq", path]) : []), ...(options.extractKeys ? ["--extract-keys"] : []),
|
|
3202
3222
|
...(options.keys ? ["--keys"] : []), ...(options.maxOutputBytes !== undefined ? ["--max-output-bytes", options.maxOutputBytes] : []), ...(options.requestId ? ["--request-id", options.requestId] : []), ...(options.reason !== undefined ? ["--reason", options.reason] : []), ...(options.timeoutMs !== undefined ? ["--timeout-ms", options.timeoutMs] : []), ...(options.wait !== undefined ? ["--wait", options.wait] : []), ...(options.dryRun ? ["--dry-run"] : [])];
|
|
@@ -17,6 +17,7 @@ import { RULE_LIFECYCLE_LANE_CONTRACT } from "./lanes/rule-lifecycle-contract.js
|
|
|
17
17
|
import { REPORT_LANE_CONTRACT } from "./lanes/report-contract.js";
|
|
18
18
|
import { RUNTIME_DATA_LANE_CONTRACT } from "./lanes/runtime-data-contract.js";
|
|
19
19
|
import { WORKFLOW_LANE_CONTRACT } from "./lanes/workflow-contract.js";
|
|
20
|
+
import { FILE_LANE_CONTRACT } from "./lanes/file-contract.js";
|
|
20
21
|
export const LANE_CONTRACTS = Object.freeze([
|
|
21
22
|
APP_LANE_CONTRACT,
|
|
22
23
|
B2_LANE_CONTRACT,
|
|
@@ -37,6 +38,7 @@ export const LANE_CONTRACTS = Object.freeze([
|
|
|
37
38
|
REPORT_LANE_CONTRACT,
|
|
38
39
|
RUNTIME_DATA_LANE_CONTRACT,
|
|
39
40
|
WORKFLOW_LANE_CONTRACT,
|
|
41
|
+
FILE_LANE_CONTRACT,
|
|
40
42
|
]);
|
|
41
43
|
export function contractMarkdown(contract) {
|
|
42
44
|
const tools = Object.entries(contract.tools).map(([name, tool]) => `- ${name} — ${tool.scope}\n ${tool.description}`).join("\n");
|
|
@@ -14,8 +14,10 @@ import { PROGRAMMING_COVERAGE } from "./lanes/programming-coverage.js";
|
|
|
14
14
|
import { RULE_LIFECYCLE_COVERAGE } from "./lanes/rule-lifecycle-coverage.js";
|
|
15
15
|
import { RUNTIME_DATA_COVERAGE } from "./lanes/runtime-data-coverage.js";
|
|
16
16
|
import { WORKFLOW_COVERAGE } from "./lanes/workflow-coverage.js";
|
|
17
|
+
import { ORG_QUERY_COVERAGE } from "./lanes/org-query-coverage.js";
|
|
17
18
|
import { REPORT_COVERAGE } from "./lanes/report-coverage.js";
|
|
18
19
|
import { PERM_COVERAGE } from "./lanes/perm-coverage.js";
|
|
20
|
+
import { FILE_COVERAGE } from "./lanes/file-coverage.js";
|
|
19
21
|
/**
|
|
20
22
|
* Every lane's structured capability declaration, gathered in one frozen
|
|
21
23
|
* registry. This is the source the runtime coverage gate consults, and the
|
|
@@ -34,12 +36,14 @@ const DECLARATIONS = Object.freeze([
|
|
|
34
36
|
...RULE_LIFECYCLE_COVERAGE,
|
|
35
37
|
...RUNTIME_DATA_COVERAGE,
|
|
36
38
|
...WORKFLOW_COVERAGE,
|
|
39
|
+
...ORG_QUERY_COVERAGE,
|
|
37
40
|
...ONLINE_JS_COVERAGE,
|
|
38
41
|
...PROGRAMMING_COVERAGE,
|
|
39
42
|
...B2_COVERAGE,
|
|
40
43
|
...LIST_VIEW_COVERAGE,
|
|
41
44
|
...REPORT_COVERAGE,
|
|
42
45
|
...PERM_COVERAGE,
|
|
46
|
+
...FILE_COVERAGE,
|
|
43
47
|
]);
|
|
44
48
|
export function laneCoverageDeclarations() {
|
|
45
49
|
return DECLARATIONS;
|
package/dist/coverage.js
CHANGED
|
@@ -118,8 +118,9 @@ function citationFor(item, requestedScope) {
|
|
|
118
118
|
* outside the anchored family is ACCEPTED and this returns the notice to surface
|
|
119
119
|
* (omc is built on 8.6; other products/versions run in compatibility mode and
|
|
120
120
|
* some faces may not apply). Returns undefined when the version is inside the
|
|
121
|
-
* family
|
|
122
|
-
*
|
|
121
|
+
* family. Missing evidence is NOT a refusal any more (see
|
|
122
|
+
* `versionEvidenceAbsentNotice`): callers still need a notice for that case,
|
|
123
|
+
* so they call the other function instead of relying on this one's undefined.
|
|
123
124
|
*/
|
|
124
125
|
export function versionFamilyNotice(manifest, detectedVersion) {
|
|
125
126
|
if (detectedVersion.startsWith(manifest.version_family + "."))
|
|
@@ -128,4 +129,17 @@ export function versionFamilyNotice(manifest, detectedVersion) {
|
|
|
128
129
|
`(锚点 ${manifest.anchor_version})。OMC 基于 8.6 构建,非 8.6 环境按兼容支持,部分能力面可能不适用。` +
|
|
129
130
|
`取证口径:以本环境真机实测为准,8.6 文档与反编译结论仅作参考。`);
|
|
130
131
|
}
|
|
132
|
+
/**
|
|
133
|
+
* 无版本证据时的兼容提示(2026-11-24 产品口径)。
|
|
134
|
+
*
|
|
135
|
+
* 版本串探测不到**不再关闭写面**:它挡的从来不是「版本不同」,而是「没有任何
|
|
136
|
+
* 证据」;多版本兼容优先,平台才是最终门。放行的同时必须把这个事实显式带到
|
|
137
|
+
* 回执上(`versionEvidence:"absent"` + 本提示),否则调用方会把它当「已验证
|
|
138
|
+
* 8.6 语义」而误判形状差异。
|
|
139
|
+
*/
|
|
140
|
+
export function versionEvidenceAbsentNotice(manifest) {
|
|
141
|
+
return (`未探测到平台版本(versionEvidence=absent):按兼容模式放行,平台是最终门——` +
|
|
142
|
+
`写入若不被本环境接受,平台错误照实回传。OMC 基于 ${manifest.version_family} 构建(锚点 ${manifest.anchor_version}),` +
|
|
143
|
+
`未取证的版本差异不在此预判;需要版本证据时跑 omc doctor / discover_environment(必要时 refresh 刷登录缓存)。`);
|
|
144
|
+
}
|
|
131
145
|
//# sourceMappingURL=coverage.js.map
|
package/dist/endpoints.js
CHANGED
|
@@ -315,6 +315,71 @@ export const ENDPOINTS = {
|
|
|
315
315
|
// end 规则照常触发);abort_instance 才是终止(规则不一定跑)。
|
|
316
316
|
workflowOperation: "/api/api/runtime/workflow/workflow_operation",
|
|
317
317
|
workflowFinishInstance: "/api/api/runtime/workflow/finish_instance_by_post",
|
|
318
|
+
/**
|
|
319
|
+
* The OpenAPI v2 审批动作 face — **可选通道**(`channel:"openapi"`),默认通道
|
|
320
|
+
* 是上面的会话面。OpenApiWorkflowController,
|
|
321
|
+
* `@RequestMapping("/openapi/v2/runtime/workflow")` — 8.6.26 :133 /
|
|
322
|
+
* AI-Platform 2.1.5 :129, verbatim identical. 这 8 个动作在 OpenAPI v2 面都有
|
|
323
|
+
* (reject_workitem/forward_workitem/adjust_workitem/assist_workitem/
|
|
324
|
+
* circulate_workitem/revoke_workitem/list_reject_activities/abort_instance),
|
|
325
|
+
* 但 `/openapi/**` 在 launcher 的 ResourceConfig 里是
|
|
326
|
+
* `hasAuthority("openapi")`,只有开放接口客户端(base_security_client
|
|
327
|
+
* .authorities=openapi,如种子客户端 xclient / client_credentials)满足;
|
|
328
|
+
* 门户登录 token 只有 AUTH_SYSTEM_MANAGE,USER ⇒ 401。
|
|
329
|
+
*
|
|
330
|
+
* PREFIX: the deployment's servlet context-path is `/api`
|
|
331
|
+
* (cp-sources/raw/v87/.../launcher/application-prod.yml:4 `context-path: /api`),
|
|
332
|
+
* so a controller mapping of `/openapi/...` lands on `/api/openapi/...`
|
|
333
|
+
* (SINGLE layer) — unlike the engine controllers whose own mapping already
|
|
334
|
+
* starts with `/api` (`/api/runtime/workflow` → `/api/api/runtime/workflow`).
|
|
335
|
+
* Actions carry the caller's id in the `userId` HEADER (8.6.26
|
|
336
|
+
* `@RequestHeader String userId`), which `wireCall` supplies.
|
|
337
|
+
*/
|
|
338
|
+
openApiWorkflowReject: "/api/openapi/v2/runtime/workflow/reject_workitem",
|
|
339
|
+
openApiWorkflowForward: "/api/openapi/v2/runtime/workflow/forward_workitem",
|
|
340
|
+
openApiWorkflowAdjust: "/api/openapi/v2/runtime/workflow/adjust_workitem",
|
|
341
|
+
openApiWorkflowAssist: "/api/openapi/v2/runtime/workflow/assist_workitem",
|
|
342
|
+
openApiWorkflowCirculate: "/api/openapi/v2/runtime/workflow/circulate_workitem",
|
|
343
|
+
openApiWorkflowRevoke: "/api/openapi/v2/runtime/workflow/revoke_workitem",
|
|
344
|
+
openApiWorkflowRejectActivities: "/api/openapi/v2/runtime/workflow/list_reject_activities",
|
|
345
|
+
openApiWorkflowAbort: "/api/openapi/v2/runtime/workflow/abort_instance",
|
|
346
|
+
/**
|
|
347
|
+
* 审批动作的**默认(会话)通道** — WorkflowInstanceController
|
|
348
|
+
* (`@RequestMapping("/api/runtime/workflow")`, 8.6.26 :341 / 2.1.5 :252)
|
|
349
|
+
* + 部署 context-path `/api` ⇒ 双层 `/api/api/runtime/workflow/*`。
|
|
350
|
+
*
|
|
351
|
+
* 门户 UI 自己就走这一族(登录 token 的 authorities = AUTH_SYSTEM_MANAGE,USER,
|
|
352
|
+
* user-8.6.34 UserDetailsServiceImpl.java:104),所以**会话 token 直接可用**;
|
|
353
|
+
* OpenAPI v2 面(下面的 openApiWorkflow*)要求 OAuth 客户端带 `openapi`
|
|
354
|
+
* authority(launcher ResourceConfig:`/openapi/** → hasAuthority("openapi")`),
|
|
355
|
+
* 用户 token 没有 → AccessDeniedHandlerImpl 回 HTTP 401
|
|
356
|
+
* (真机 2026-11-24:`{"errcode":401,"errmsg":"权限不够,请联系管理员"}`)。
|
|
357
|
+
*
|
|
358
|
+
* 端点形状(两版逐字一致):
|
|
359
|
+
* - POST /reject_workItem WorkItemRejectVO(rejectToActivityCode+workItemId 必填)
|
|
360
|
+
* - POST /forward_workItem WorkItemSendToVO(workflowInstanceId 必填:WorkflowAspect.addUserFavoriteAspect)
|
|
361
|
+
* - POST /adjust_workItem_participators 加签(countersign,原审批人待办保留)
|
|
362
|
+
* - POST /assist_workItem / circulate_workItem 协办 / 传阅
|
|
363
|
+
* - GET /revoke_workitem query workflowInstanceId+activityCode(+workItemId)
|
|
364
|
+
* - GET /abort_instance query workflowInstanceId(+workItemId&version)
|
|
365
|
+
* - GET /list_reject_activities query workflowInstanceId+activityCode
|
|
366
|
+
*/
|
|
367
|
+
workflowReject: "/api/api/runtime/workflow/reject_workItem",
|
|
368
|
+
workflowForward: "/api/api/runtime/workflow/forward_workItem",
|
|
369
|
+
workflowAdjustWorkItemParticipators: "/api/api/runtime/workflow/adjust_workItem_participators",
|
|
370
|
+
workflowAssist: "/api/api/runtime/workflow/assist_workItem",
|
|
371
|
+
workflowCirculate: "/api/api/runtime/workflow/circulate_workItem",
|
|
372
|
+
workflowRevoke: "/api/api/runtime/workflow/revoke_workitem",
|
|
373
|
+
workflowListRejectActivities: "/api/api/runtime/workflow/list_reject_activities",
|
|
374
|
+
/**
|
|
375
|
+
* 作废实例(`/api/runtime/workflow/abort_instance`,GET,
|
|
376
|
+
* params workflowInstanceId/workItemId?/version? — WorkflowInstanceController
|
|
377
|
+
* :867 in 8.6.26 / :639 in 2.1.5; same handleCancelWorkflowInstance target as
|
|
378
|
+
* the OpenAPI face). 会话通道的默认形态;POST `/abort_instance_by_post`
|
|
379
|
+
* (:886 / :651)接受 comment/resources,门户表单详情的「作废」用它。
|
|
380
|
+
*/
|
|
381
|
+
workflowAbortInstance: "/api/api/runtime/workflow/abort_instance",
|
|
382
|
+
workflowAbortInstanceByPost: "/api/api/runtime/workflow/abort_instance_by_post",
|
|
318
383
|
workflowListFinishedWorkItems: "/api/api/runtime/workflow/list_finished_workitems",
|
|
319
384
|
workflowGetInstanceBaseInfo: "/api/api/runtime/workflow/get_instance_baseinfo",
|
|
320
385
|
organizationRoleList: "/api/api/organization/role/list",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { partitionVersion } from "./version-partition.js";
|
|
1
2
|
/** The environment's write permission: the single machine-side write gate. */
|
|
2
3
|
export function environmentWritable(profile) {
|
|
3
4
|
return profile.writable === true;
|
|
@@ -23,6 +24,10 @@ export function environmentNotice(profile) {
|
|
|
23
24
|
? "当前是测试环境;已允许写入,仅应使用测试数据。"
|
|
24
25
|
: "当前是测试环境;当前设置为只读,写入会被拒绝。";
|
|
25
26
|
}
|
|
27
|
+
function partitionEvidence(version) {
|
|
28
|
+
const partition = partitionVersion(version);
|
|
29
|
+
return { family: partition.family, confidence: partition.confidence, matched: partition.matched };
|
|
30
|
+
}
|
|
26
31
|
export function versionEvidenceOf(input) {
|
|
27
32
|
const detected = input.detectedVersion;
|
|
28
33
|
if (detected === undefined || detected.length === 0) {
|
|
@@ -32,14 +37,23 @@ export function versionEvidenceOf(input) {
|
|
|
32
37
|
versionSource: null,
|
|
33
38
|
anchorVersion: input.anchorVersion,
|
|
34
39
|
versionFamily: input.versionFamily,
|
|
40
|
+
partition: partitionEvidence(undefined),
|
|
35
41
|
};
|
|
36
42
|
}
|
|
43
|
+
const partition = partitionVersion(detected);
|
|
37
44
|
return {
|
|
38
45
|
detectedVersion: detected,
|
|
39
|
-
|
|
46
|
+
// manifest 的锚点族是权威;今天就是 8.6。分区命中 anchor 或命中 manifest
|
|
47
|
+
// 前缀都算锚点族(后者保留给未来 manifest 改锚点的情形)。
|
|
48
|
+
inAnchorFamily: partition.family === "anchor-8.6" || detected.startsWith(`${input.versionFamily}.`),
|
|
40
49
|
versionSource: input.versionSource ?? "system-config",
|
|
41
50
|
anchorVersion: input.anchorVersion,
|
|
42
51
|
versionFamily: input.versionFamily,
|
|
52
|
+
partition: {
|
|
53
|
+
family: partition.family,
|
|
54
|
+
confidence: partition.confidence,
|
|
55
|
+
matched: partition.matched,
|
|
56
|
+
},
|
|
43
57
|
...(input.versionNotice ? { versionNotice: input.versionNotice } : {}),
|
|
44
58
|
};
|
|
45
59
|
}
|
package/dist/field-change.js
CHANGED
|
@@ -73,7 +73,12 @@ export function prepareFieldChange(input) {
|
|
|
73
73
|
});
|
|
74
74
|
assertRelationTargetPresent(propertyType, raw, input.relativeCode, input.code);
|
|
75
75
|
// Gates run here so every entry point (direct, orchestrator, intent) shares them.
|
|
76
|
-
|
|
76
|
+
// DATE format whitelist is family-specific: the lane passes the session's
|
|
77
|
+
// detected version; no evidence keeps the 8.6 19-item set (fail closed).
|
|
78
|
+
assertFieldOptionsAllowed(propertyType, raw, input.schemaCode, {
|
|
79
|
+
...(input.targetVersion ? { targetVersion: input.targetVersion } : {}),
|
|
80
|
+
...(input.deferDateFormatFamily ? { deferDateFormatFamily: true } : {}),
|
|
81
|
+
});
|
|
77
82
|
assertNumericalScale(propertyType, raw);
|
|
78
83
|
assertFormConditions(raw);
|
|
79
84
|
const options = ensureRelationDisplayFieldOptions(propertyType, raw);
|
|
@@ -228,7 +233,9 @@ export function prepareFieldUpdate(input) {
|
|
|
228
233
|
// backfill schemaCode from relativeCode (top-level or already stored) so
|
|
229
234
|
// field.publish cannot later 300010 on this field.
|
|
230
235
|
assertRelationTargetPresent(recordType, nextOptions, input.relativeCode ?? (typeof input.base.relativeCode === "string" ? input.base.relativeCode : undefined), input.code);
|
|
231
|
-
assertFieldOptionsAllowed(recordType, nextOptions, input.schemaCode
|
|
236
|
+
assertFieldOptionsAllowed(recordType, nextOptions, input.schemaCode, {
|
|
237
|
+
...(input.targetVersion ? { targetVersion: input.targetVersion } : {}),
|
|
238
|
+
});
|
|
232
239
|
if (effectiveOptions !== undefined || input.choices !== undefined)
|
|
233
240
|
assertNumericalScale(recordType, nextOptions);
|
|
234
241
|
if (effectiveOptions !== undefined)
|