@stalfh233/omc-cli 0.6.53 → 0.6.55
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 +64 -2
- package/dist/capability-overview.js +4 -4
- package/dist/endpoints.js +41 -0
- package/dist/field-change.js +27 -3
- package/dist/field-families.js +130 -13
- package/dist/lanes/app-contract.js +32 -0
- package/dist/lanes/app-coverage.js +5 -0
- package/dist/lanes/app.js +396 -1
- package/dist/lanes/datarule.js +1 -1
- package/dist/lanes/dictionary.js +2 -2
- package/dist/lanes/field-contract.js +31 -2
- package/dist/lanes/field.js +9 -3
- package/dist/lanes/form.js +1 -1
- package/dist/lanes/list-view.js +23 -3
- package/dist/lanes/model.js +1 -1
- package/dist/lanes/report.js +2 -2
- package/dist/lanes/runtime-data.js +3 -3
- package/dist/lanes/workflow-contract.js +17 -0
- package/dist/lanes/workflow-coverage.js +16 -0
- package/dist/lanes/workflow.js +203 -2
- package/dist/recipes/field.js +33 -3
- package/dist/tool-search.js +7 -4
- package/dist/wire.js +57 -0
- package/package.json +3 -3
- package/skills/omc-capabilities.md +6 -5
package/dist/lanes/app.js
CHANGED
|
@@ -1,15 +1,253 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
import { chmodSync, existsSync, lstatSync, mkdirSync, realpathSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { basename, dirname, join, resolve } from "node:path";
|
|
2
5
|
import { ENDPOINTS } from "../endpoints.js";
|
|
3
6
|
import { capabilityArg, environmentArg } from "../args.js";
|
|
4
7
|
import { governedRead } from "../read.js";
|
|
5
8
|
import { writeTool } from "../write.js";
|
|
6
9
|
import { defineTool, ToolRefusalError } from "../tool-types.js";
|
|
7
|
-
import { wireCall, wireRows, WireError } from "../wire.js";
|
|
10
|
+
import { wireCall, wireDownloadPackageStream, wireRows, WireError } from "../wire.js";
|
|
11
|
+
import { isWithinRoot } from "../artifacts.js";
|
|
12
|
+
import { readZipEntries } from "../zip.js";
|
|
8
13
|
import { resolveApplicationScope } from "../support.js";
|
|
9
14
|
import { APP_LANE_CONTRACT } from "./app-contract.js";
|
|
10
15
|
import { readAppTree } from "./folder.js";
|
|
11
16
|
const APP_LANE = APP_LANE_CONTRACT.lane;
|
|
12
17
|
const APP_TOOLS = APP_LANE_CONTRACT.tools;
|
|
18
|
+
/**
|
|
19
|
+
* r64b export support. The platform has exactly two package faces (decompiled
|
|
20
|
+
* AppImportExportController / LifeCycleImportExportController, live-proven on
|
|
21
|
+
* AI-Platform-v1.1.25):
|
|
22
|
+
*
|
|
23
|
+
* - single app: POST /app/apppackage/export {appCode, references} → ZIP with
|
|
24
|
+
* `<appCode>-<uuid>/manifest.json` + meta/{dm,form,view,workflow,report} +
|
|
25
|
+
* dependencies/platform/*.
|
|
26
|
+
* - whole environment: POST /lifeCycle/apppackage/lifeCycleExport → metadata.zip
|
|
27
|
+
* with metadata/app/applist/<appCode>/… for EVERY app, appgroup.json, ALL
|
|
28
|
+
* biz services + datasources, and the root manifest.
|
|
29
|
+
*
|
|
30
|
+
* Both are synchronous (live 1–3 s for 0.2–0.7 MB packages) and both answer
|
|
31
|
+
* business refusals as HTTP 200 JSON envelopes, which the wire helper classifies
|
|
32
|
+
* before anything is written.
|
|
33
|
+
*/
|
|
34
|
+
const REFERENCE_KEYS = [
|
|
35
|
+
"relativeDictionary",
|
|
36
|
+
"relativeRole",
|
|
37
|
+
"relativeBizService",
|
|
38
|
+
"relativeAdvanceDataSource",
|
|
39
|
+
"relativeReportAdvanceDataSource",
|
|
40
|
+
];
|
|
41
|
+
const PACKAGE_MAGIC_LOCAL_HEADER = 0x04034b50;
|
|
42
|
+
function configRootForExport() {
|
|
43
|
+
return resolve(process.env.OMC_CONFIG_HOME ?? process.cwd());
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Resolve the on-disk target for one package. `out` is a path inside the
|
|
47
|
+
* configuration root (same containment rule as --args-file / intent plans):
|
|
48
|
+
* a `*.zip` path is the file itself, anything else is a directory the file is
|
|
49
|
+
* written into. Omitting `out` keeps the CLI's artifact convention.
|
|
50
|
+
*/
|
|
51
|
+
function resolveExportTarget(input) {
|
|
52
|
+
if (input.out === undefined)
|
|
53
|
+
return join(input.artifactsDir, input.defaultFileName);
|
|
54
|
+
const root = configRootForExport();
|
|
55
|
+
const candidate = resolve(root, input.out);
|
|
56
|
+
if (!isWithinRoot(root, candidate))
|
|
57
|
+
throw new ToolRefusalError({
|
|
58
|
+
status: "refused",
|
|
59
|
+
blocker: "app-export-out-outside-root",
|
|
60
|
+
out: input.out,
|
|
61
|
+
message: `out 必须位于配置根内(配置根 ${root});本次解析为 ${candidate}。省略 out 落到会话 artifacts,或用配置根内相对路径(如 .omc/backups/)。`,
|
|
62
|
+
});
|
|
63
|
+
const asDirectory = input.out.endsWith("/") || input.out.endsWith("\\") || (existsSync(candidate) && lstatSync(candidate).isDirectory());
|
|
64
|
+
const target = asDirectory ? join(candidate, input.directoryFileName) : candidate;
|
|
65
|
+
// Lexical containment is not enough: a symlinked ancestor could still point
|
|
66
|
+
// outside the root, so re-check the REAL path of the nearest existing
|
|
67
|
+
// directory before writing. (The CLI's own artifacts dir is exempt: it is a
|
|
68
|
+
// trusted default, not a caller-supplied path.)
|
|
69
|
+
let ancestor = dirname(target);
|
|
70
|
+
while (!existsSync(ancestor)) {
|
|
71
|
+
const parent = dirname(ancestor);
|
|
72
|
+
if (parent === ancestor)
|
|
73
|
+
break;
|
|
74
|
+
ancestor = parent;
|
|
75
|
+
}
|
|
76
|
+
if (existsSync(ancestor) && existsSync(root)) {
|
|
77
|
+
const realRoot = realpathSync(root);
|
|
78
|
+
const realAncestor = realpathSync(ancestor);
|
|
79
|
+
if (realAncestor !== realRoot && !isWithinRoot(realRoot, realAncestor))
|
|
80
|
+
throw new ToolRefusalError({
|
|
81
|
+
status: "refused",
|
|
82
|
+
blocker: "app-export-out-outside-root",
|
|
83
|
+
out: input.out,
|
|
84
|
+
outPath: target,
|
|
85
|
+
message: `out 的上级目录解析后落在配置根之外(符号链接逃逸):${ancestor} → ${realAncestor};拒绝写入。`,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
return target;
|
|
89
|
+
}
|
|
90
|
+
function writeExportPackage(target, content, label) {
|
|
91
|
+
try {
|
|
92
|
+
mkdirSync(dirname(target), { recursive: true });
|
|
93
|
+
if (existsSync(target) && lstatSync(target).isSymbolicLink())
|
|
94
|
+
throw new ToolRefusalError({
|
|
95
|
+
status: "refused",
|
|
96
|
+
blocker: "app-export-out-symbolic-link",
|
|
97
|
+
outPath: target,
|
|
98
|
+
message: `导出目标 ${target} 是符号链接;拒绝写入(备份产物不得落到链接目标)`,
|
|
99
|
+
});
|
|
100
|
+
writeFileSync(target, content, { mode: 0o600 });
|
|
101
|
+
chmodSync(target, 0o600);
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
if (error instanceof ToolRefusalError)
|
|
105
|
+
throw error;
|
|
106
|
+
throw new ToolRefusalError({
|
|
107
|
+
status: "refused",
|
|
108
|
+
blocker: "app-export-write-failed",
|
|
109
|
+
outPath: target,
|
|
110
|
+
message: `${label}写入失败:${error.message}`,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/** Read the ZIP once; a 200 body that is not a non-empty ZIP is never reported as success. */
|
|
115
|
+
function readExportPackage(bytes, endpoint) {
|
|
116
|
+
if (bytes.length < 4 || bytes.readUInt32LE(0) !== PACKAGE_MAGIC_LOCAL_HEADER)
|
|
117
|
+
throw new ToolRefusalError({
|
|
118
|
+
status: "refused",
|
|
119
|
+
blocker: "app-export-package-invalid",
|
|
120
|
+
endpoint,
|
|
121
|
+
bytes: bytes.length,
|
|
122
|
+
message: `平台返回 ${bytes.length}B 但不是一个 ZIP(缺少 PK\\x03\\x04 头);拒绝把非包响应当成功。检查读写权限或稍后重试。`,
|
|
123
|
+
});
|
|
124
|
+
try {
|
|
125
|
+
const entries = readZipEntries(bytes);
|
|
126
|
+
if (entries.size === 0)
|
|
127
|
+
throw new ToolRefusalError({
|
|
128
|
+
status: "refused",
|
|
129
|
+
blocker: "app-export-package-invalid",
|
|
130
|
+
endpoint,
|
|
131
|
+
bytes: bytes.length,
|
|
132
|
+
message: "平台返回的 ZIP 是空包(0 条目);拒绝当成功。",
|
|
133
|
+
});
|
|
134
|
+
return { entries, entryCount: entries.size };
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
if (error instanceof ToolRefusalError)
|
|
138
|
+
throw error;
|
|
139
|
+
throw new ToolRefusalError({
|
|
140
|
+
status: "refused",
|
|
141
|
+
blocker: "app-export-package-invalid",
|
|
142
|
+
endpoint,
|
|
143
|
+
bytes: bytes.length,
|
|
144
|
+
message: `平台返回的 ZIP 无法解析:${error.message}`,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
function parseJsonBuffer(buffer) {
|
|
149
|
+
if (buffer === undefined)
|
|
150
|
+
return undefined;
|
|
151
|
+
try {
|
|
152
|
+
return JSON.parse(buffer.toString("utf8"));
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
return undefined;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
function jsonEntry(entries, name) {
|
|
159
|
+
const parsed = parseJsonBuffer(entries.get(name));
|
|
160
|
+
return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : undefined;
|
|
161
|
+
}
|
|
162
|
+
function arrayLength(value) {
|
|
163
|
+
return Array.isArray(value) ? value.length : 0;
|
|
164
|
+
}
|
|
165
|
+
function nameLength(value) {
|
|
166
|
+
return typeof value === "string" && value !== "" ? value : null;
|
|
167
|
+
}
|
|
168
|
+
/** First path segment of the package (the staging dir the controller zipped). */
|
|
169
|
+
function packageRootOf(entries) {
|
|
170
|
+
for (const name of entries.keys()) {
|
|
171
|
+
const slash = name.indexOf("/");
|
|
172
|
+
if (slash > 0)
|
|
173
|
+
return name.slice(0, slash);
|
|
174
|
+
}
|
|
175
|
+
return "";
|
|
176
|
+
}
|
|
177
|
+
function appPackageAssets(entries, root) {
|
|
178
|
+
const manifest = jsonEntry(entries, `${root}/manifest.json`);
|
|
179
|
+
const depends = (area) => jsonEntry(entries, `${root}/dependencies/platform/${area}/${area}.json`);
|
|
180
|
+
const dictionary = depends("dictionary");
|
|
181
|
+
const role = depends("role");
|
|
182
|
+
const bizMethod = depends("bizMethod");
|
|
183
|
+
const datasource = depends("datasource");
|
|
184
|
+
const methodsMap = bizMethod?.methodsMap;
|
|
185
|
+
const bizMethodCount = methodsMap && typeof methodsMap === "object"
|
|
186
|
+
? Object.values(methodsMap).reduce((sum, methods) => sum + arrayLength(methods), 0)
|
|
187
|
+
: 0;
|
|
188
|
+
const dataSourceCount = arrayLength(datasource?.relativeAdvanceDataSource) + arrayLength(datasource?.relativeReportAdvanceDataSource);
|
|
189
|
+
return {
|
|
190
|
+
appCode: nameLength(manifest?.code),
|
|
191
|
+
appName: nameLength(manifest?.name),
|
|
192
|
+
bizModels: arrayLength(manifest?.bizModels),
|
|
193
|
+
modelGroups: arrayLength(manifest?.modelGroups),
|
|
194
|
+
reportModels: arrayLength(manifest?.reportModels),
|
|
195
|
+
customPages: arrayLength(manifest?.customPages),
|
|
196
|
+
appPages: arrayLength(manifest?.appPages),
|
|
197
|
+
dependencies: {
|
|
198
|
+
dictionaries: arrayLength(dictionary?.dictionaries),
|
|
199
|
+
roles: arrayLength(role?.roles),
|
|
200
|
+
bizServices: arrayLength(bizMethod?.services),
|
|
201
|
+
bizMethods: bizMethodCount,
|
|
202
|
+
dataSources: dataSourceCount,
|
|
203
|
+
},
|
|
204
|
+
packageVersion: nameLength(manifest?.systemVersion) ?? nameLength(entries.get(`${root}/version.md`)?.toString("utf8").trim()),
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
function environmentPackageAssets(entries) {
|
|
208
|
+
const applicationCodes = [...entries.keys()]
|
|
209
|
+
.map((name) => /^metadata\/app\/applist\/([^/]+)\//.exec(name)?.[1])
|
|
210
|
+
.filter((code) => typeof code === "string" && code !== "");
|
|
211
|
+
const uniqueCodes = [...new Set(applicationCodes)].sort();
|
|
212
|
+
const manifest = jsonEntry(entries, "metadata/manifest.json");
|
|
213
|
+
const version = manifest?.version;
|
|
214
|
+
const appGroups = parseJsonBuffer(entries.get("metadata/app/appgroup.json"));
|
|
215
|
+
const bizManifest = jsonEntry(entries, "metadata/bizservice/manifest.json");
|
|
216
|
+
const methodsMap = bizManifest?.methodsMap;
|
|
217
|
+
const bizMethodCount = methodsMap && typeof methodsMap === "object"
|
|
218
|
+
? Object.values(methodsMap).reduce((sum, methods) => sum + arrayLength(methods), 0)
|
|
219
|
+
: 0;
|
|
220
|
+
const dataSources = jsonEntry(entries, "metadata/bizservice/bizdatasource.json");
|
|
221
|
+
const areaOf = (name) => {
|
|
222
|
+
if (name.startsWith("metadata/app/applist/"))
|
|
223
|
+
return "appPackages";
|
|
224
|
+
if (name.startsWith("metadata/app/"))
|
|
225
|
+
return "appGroups";
|
|
226
|
+
if (name.startsWith("metadata/bizservice/"))
|
|
227
|
+
return "bizServices";
|
|
228
|
+
return "manifest";
|
|
229
|
+
};
|
|
230
|
+
const byArea = {};
|
|
231
|
+
for (const [name, content] of entries) {
|
|
232
|
+
const area = areaOf(name);
|
|
233
|
+
const bucket = (byArea[area] ??= { files: 0, bytes: 0 });
|
|
234
|
+
bucket.files += 1;
|
|
235
|
+
bucket.bytes += content.length;
|
|
236
|
+
}
|
|
237
|
+
return {
|
|
238
|
+
applicationCount: uniqueCodes.length,
|
|
239
|
+
applicationCodes: uniqueCodes,
|
|
240
|
+
appGroups: arrayLength(appGroups),
|
|
241
|
+
bizServices: arrayLength(bizManifest?.services),
|
|
242
|
+
bizMethods: bizMethodCount,
|
|
243
|
+
dataSources: arrayLength(dataSources?.relativeAdvanceDataSource) + arrayLength(dataSources?.relativeReportAdvanceDataSource),
|
|
244
|
+
packageVersion: nameLength(version?.cloudpivot) ?? nameLength(manifest?.systemVersion),
|
|
245
|
+
byArea,
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
function sha256Of(content) {
|
|
249
|
+
return createHash("sha256").update(content).digest("hex");
|
|
250
|
+
}
|
|
13
251
|
export async function resolveValidatedApplicationScope(session, requested) {
|
|
14
252
|
const scope = await resolveApplicationScope(session, requested);
|
|
15
253
|
const availableApps = wireRows((await wireCall(session, { path: ENDPOINTS.applicationList, query: {} })).data)
|
|
@@ -316,5 +554,162 @@ export function registerAppLane(tools) {
|
|
|
316
554
|
},
|
|
317
555
|
rollback: appRollbackSpec("app.delete"),
|
|
318
556
|
});
|
|
557
|
+
tools.push(defineTool({
|
|
558
|
+
name: "app.export",
|
|
559
|
+
search: {
|
|
560
|
+
intents: [
|
|
561
|
+
"导出应用",
|
|
562
|
+
"导出应用包",
|
|
563
|
+
"备份应用配置",
|
|
564
|
+
"备份整个环境",
|
|
565
|
+
"整体导出配置",
|
|
566
|
+
"环境配置备份",
|
|
567
|
+
"迁移打包",
|
|
568
|
+
"下载应用包",
|
|
569
|
+
],
|
|
570
|
+
},
|
|
571
|
+
layer: "low",
|
|
572
|
+
kind: "read",
|
|
573
|
+
lane: APP_LANE,
|
|
574
|
+
scope: APP_TOOLS["app.export"].scope,
|
|
575
|
+
description: APP_TOOLS["app.export"].description,
|
|
576
|
+
inputSchema: {
|
|
577
|
+
environment: environmentArg,
|
|
578
|
+
applicationCode: z
|
|
579
|
+
.string()
|
|
580
|
+
.min(1)
|
|
581
|
+
.optional()
|
|
582
|
+
.describe("要导出的应用编码(app.list 的 code)。省略 = 导出整个环境(全部应用包 + 应用分组 + 业务集成服务 + 数据源)"),
|
|
583
|
+
includeDependencies: z
|
|
584
|
+
.boolean()
|
|
585
|
+
.optional()
|
|
586
|
+
.describe("仅单应用有效:true 时先读 apppackage/dependencies,把引用的字典/角色/业务集成/数据源一并打进包;环境包平台固定空引用,故环境范围传 true 会被拒"),
|
|
587
|
+
out: z
|
|
588
|
+
.string()
|
|
589
|
+
.min(1)
|
|
590
|
+
.optional()
|
|
591
|
+
.describe("配置根内落盘路径:以 .zip 结尾视为文件;其它视为目录(写入 <应用码>-app-package.zip / environment-lifecycle.zip)。省略落到会话 artifacts"),
|
|
592
|
+
capability: capabilityArg,
|
|
593
|
+
},
|
|
594
|
+
handler: async (ctx, args, self) => governedRead(ctx, self, args, async (session) => {
|
|
595
|
+
const applications = wireRows((await wireCall(session, { path: ENDPOINTS.applicationList, query: {} })).data).map((row) => ({
|
|
596
|
+
code: String(row.appCode ?? row.code ?? ""),
|
|
597
|
+
name: String(row.appName ?? row.name ?? row.appCode ?? row.code ?? ""),
|
|
598
|
+
})).filter((row) => row.code !== "");
|
|
599
|
+
const requested = args.applicationCode;
|
|
600
|
+
if (requested === undefined && args.includeDependencies === true)
|
|
601
|
+
throw new ToolRefusalError({
|
|
602
|
+
status: "refused",
|
|
603
|
+
blocker: "app-export-option-unsupported",
|
|
604
|
+
option: "includeDependencies",
|
|
605
|
+
message: "环境级生命周期包(lifeCycleExport)固定使用空 references,平台不接受依赖选择——includeDependencies 只对单应用生效。" +
|
|
606
|
+
"需要把某应用的字典/角色/业务集成一起迁走时,改用 applicationCode + includeDependencies:true 单独导出该应用。",
|
|
607
|
+
});
|
|
608
|
+
let scope;
|
|
609
|
+
let selected;
|
|
610
|
+
let references;
|
|
611
|
+
let bytes;
|
|
612
|
+
if (requested !== undefined) {
|
|
613
|
+
selected = applications.find((row) => row.code === requested);
|
|
614
|
+
if (!selected) {
|
|
615
|
+
const available = applications.map((row) => row.code);
|
|
616
|
+
throw new ToolRefusalError({
|
|
617
|
+
status: "refused",
|
|
618
|
+
blocker: "app-export-app-not-found",
|
|
619
|
+
applicationCode: requested,
|
|
620
|
+
availableApplications: available.slice(0, 40),
|
|
621
|
+
message: `应用「${requested}」不在租户应用清单里(平台会回 600005 应用不存在!)。可用:${available.slice(0, 12).join("、")}${available.length > 12 ? " 等" : ""};零导出调用。`,
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
scope = "application";
|
|
625
|
+
references = {};
|
|
626
|
+
if (args.includeDependencies === true) {
|
|
627
|
+
const dependencyData = (await wireCall(session, {
|
|
628
|
+
path: ENDPOINTS.appPackageDependencies,
|
|
629
|
+
query: { appCode: selected.code },
|
|
630
|
+
})).data;
|
|
631
|
+
for (const key of REFERENCE_KEYS) {
|
|
632
|
+
const value = dependencyData?.[key];
|
|
633
|
+
if (Array.isArray(value) && value.length > 0)
|
|
634
|
+
references[key] = value;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
bytes = await wireDownloadPackageStream(session, {
|
|
638
|
+
path: ENDPOINTS.appPackageExport,
|
|
639
|
+
body: { appCode: selected.code, references },
|
|
640
|
+
});
|
|
641
|
+
}
|
|
642
|
+
else {
|
|
643
|
+
if (applications.length === 0)
|
|
644
|
+
throw new ToolRefusalError({
|
|
645
|
+
status: "refused",
|
|
646
|
+
blocker: "app-export-no-applications",
|
|
647
|
+
message: "租户没有可导出的应用(apppackage/list 为空);环境包无从导出。先用 app.create 或核对环境。",
|
|
648
|
+
});
|
|
649
|
+
scope = "environment";
|
|
650
|
+
// All VO fields are optional (probe: empty body exports the same
|
|
651
|
+
// metadata.zip); fixed body keeps the request deterministic.
|
|
652
|
+
bytes = await wireDownloadPackageStream(session, {
|
|
653
|
+
path: ENDPOINTS.environmentLifeCycleExport,
|
|
654
|
+
body: {},
|
|
655
|
+
});
|
|
656
|
+
}
|
|
657
|
+
const endpoint = scope === "application" ? ENDPOINTS.appPackageExport : ENDPOINTS.environmentLifeCycleExport;
|
|
658
|
+
const pkg = readExportPackage(bytes, endpoint);
|
|
659
|
+
const sha256 = sha256Of(bytes);
|
|
660
|
+
const root = packageRootOf(pkg.entries);
|
|
661
|
+
const assets = scope === "application" ? appPackageAssets(pkg.entries, root) : environmentPackageAssets(pkg.entries);
|
|
662
|
+
const defaultFileName = scope === "application" ? `${selected.code}-app-package-${sha256.slice(0, 8)}.zip` : `environment-lifecycle-${sha256.slice(0, 8)}.zip`;
|
|
663
|
+
const directoryFileName = scope === "application" ? `${selected.code}-app-package.zip` : "environment-lifecycle.zip";
|
|
664
|
+
const outPath = resolveExportTarget({ artifactsDir: ctx.artifactsDir, out: args.out, defaultFileName, directoryFileName });
|
|
665
|
+
writeExportPackage(outPath, bytes, "应用包导出");
|
|
666
|
+
const referenceCounts = references === undefined
|
|
667
|
+
? undefined
|
|
668
|
+
: Object.fromEntries(Object.entries(references).map(([key, value]) => [key, arrayLength(value)]));
|
|
669
|
+
return {
|
|
670
|
+
scope,
|
|
671
|
+
endpoint,
|
|
672
|
+
...(selected !== undefined
|
|
673
|
+
? { application: { code: selected.code, name: selected.name } }
|
|
674
|
+
: { environment: { applicationCount: applications.length, applicationCodes: applications.map((row) => row.code) } }),
|
|
675
|
+
...(referenceCounts !== undefined ? { includeDependencies: args.includeDependencies === true, references: referenceCounts } : {}),
|
|
676
|
+
outPath,
|
|
677
|
+
// CLI stdout sanitises local paths (ticket 103: the machine envelope
|
|
678
|
+
// must not leak host layout), so the basename is the stable handle an
|
|
679
|
+
// agent can combine with its cwd / the `out` it passed.
|
|
680
|
+
outFileName: basename(outPath),
|
|
681
|
+
bytes: bytes.length,
|
|
682
|
+
sha256,
|
|
683
|
+
entryCount: pkg.entryCount,
|
|
684
|
+
...(scope === "application"
|
|
685
|
+
? { entries: [...pkg.entries].map(([name, content]) => ({ name, bytes: content.length })) }
|
|
686
|
+
: { byArea: assets.byArea }),
|
|
687
|
+
assets,
|
|
688
|
+
notIncluded: scope === "application"
|
|
689
|
+
? [
|
|
690
|
+
"未在 references 中选中的依赖(字典/角色/业务集成/数据源)——includeDependencies:true 才随包",
|
|
691
|
+
"运行数据(业务数据行)与环境级设置(组织/用户/许可证)",
|
|
692
|
+
]
|
|
693
|
+
: [
|
|
694
|
+
"环境级数据字典/组织/角色/用户:环境包对每个应用固定使用空 references,只带被引用依赖之外的零依赖包",
|
|
695
|
+
"环境设置、许可证、登录配置与运行数据(业务数据行)",
|
|
696
|
+
],
|
|
697
|
+
source: "platform app-package / lifecycle export (同步返回 ZIP;产物已落盘并校验字节数与 sha256)",
|
|
698
|
+
};
|
|
699
|
+
}, {
|
|
700
|
+
target: "app.export",
|
|
701
|
+
compact: (result) => {
|
|
702
|
+
const entries = Array.isArray(result.entries) ? result.entries : [];
|
|
703
|
+
if (entries.length <= 15)
|
|
704
|
+
return result;
|
|
705
|
+
return {
|
|
706
|
+
...result,
|
|
707
|
+
entries: entries.slice(0, 15),
|
|
708
|
+
entriesOmitted: entries.length - 15,
|
|
709
|
+
entriesHint: "entries 只内联前 15 条;完整条目名与大小在 detailArtifactId(omc artifact get <id> --jq entries)",
|
|
710
|
+
};
|
|
711
|
+
},
|
|
712
|
+
}),
|
|
713
|
+
}));
|
|
319
714
|
}
|
|
320
715
|
//# sourceMappingURL=app.js.map
|
package/dist/lanes/datarule.js
CHANGED
|
@@ -874,7 +874,7 @@ export function registerDataRuleLane(tools) {
|
|
|
874
874
|
writeTool({
|
|
875
875
|
tools,
|
|
876
876
|
name: "datarule.create",
|
|
877
|
-
search: { intents: ["字段级校验", "给字段加校验", "给金额字段加校验", "校验规则", "提交校验", "字段校验", "金额校验", "必填才能提交", "必须填", "不填不让提交"] },
|
|
877
|
+
search: { intents: ["字段级校验", "给字段加校验", "给金额字段加校验", "校验规则", "提交校验", "字段校验", "金额校验", "必填才能提交", "必须填", "不填不让提交", "必须附件", "不然就提交不了"] },
|
|
878
878
|
lane: DATARULE_LANE,
|
|
879
879
|
scope: DATARULE_TOOLS["datarule.create"].scope,
|
|
880
880
|
description: DATARULE_TOOLS["datarule.create"].description,
|
package/dist/lanes/dictionary.js
CHANGED
|
@@ -309,7 +309,7 @@ export function registerDictionaryLane(tools) {
|
|
|
309
309
|
writeTool({
|
|
310
310
|
tools,
|
|
311
311
|
name: "dictionary.save",
|
|
312
|
-
search: { intents: ["建数据字典", "新建字典", "保存字典"] },
|
|
312
|
+
search: { intents: ["建数据字典", "新建字典", "保存字典", "说法统一", "统一叫法", "统一一下"] },
|
|
313
313
|
lane: LANE,
|
|
314
314
|
scope: TOOLS["dictionary.save"].scope,
|
|
315
315
|
description: TOOLS["dictionary.save"].description,
|
|
@@ -370,7 +370,7 @@ export function registerDictionaryLane(tools) {
|
|
|
370
370
|
writeTool({
|
|
371
371
|
tools,
|
|
372
372
|
name: "dictionary.status",
|
|
373
|
-
search: { intents: ["停用字典记录", "启用字典记录", "字典记录停用", "停用字典", "启用字典"] },
|
|
373
|
+
search: { intents: ["停用字典记录", "启用字典记录", "字典记录停用", "停用字典", "启用字典", "选错", "老选错", "撤掉的部门"] },
|
|
374
374
|
lane: LANE,
|
|
375
375
|
scope: TOOLS["dictionary.status"].scope,
|
|
376
376
|
description: TOOLS["dictionary.status"].description,
|
|
@@ -99,6 +99,30 @@ export const FIELD_RELEVANCE_WIRE = Object.freeze({
|
|
|
99
99
|
options: '{"relevanceField":"<local WORK_SHEET field code>","referenceField":"<referenced field code>","referenceFieldPropertyType":<int>}',
|
|
100
100
|
semantics: "references another field through a local WORK_SHEET field; NOT a model relation (no schemaCode/mappings)",
|
|
101
101
|
});
|
|
102
|
+
/**
|
|
103
|
+
* NUMERICAL(2) display-format family — the designer's 47-option enum, captured
|
|
104
|
+
* live from the real designer on 2026-11-14 (r64b, Playwright: 数据模型 →
|
|
105
|
+
* 数据项 Edit → DataItem Attributes → Default Format, and the form control's
|
|
106
|
+
* Control Attributes → Display Format; both selects render the same 47 items).
|
|
107
|
+
*
|
|
108
|
+
* Every entry's INTERNAL value (read from the live Option components) is
|
|
109
|
+
* `<family><decimals-word>`; the field row stores it VERBATIM as
|
|
110
|
+
* `options.format` and the portal form reads it literally. The designer's own
|
|
111
|
+
* bizproperty/update body proves the storage shape:
|
|
112
|
+
* `options={"dictionaryData":"","virtualField":false,"scale":2,"format":"ratio.percentile"}`.
|
|
113
|
+
*
|
|
114
|
+
* Value semantics (portal-verified, same round): the stored value is a RATIO.
|
|
115
|
+
* 0.5 rendered as 50.00%, 50 rendered as 5000.00% — never store 50 for 50%.
|
|
116
|
+
*/
|
|
117
|
+
export const FIELD_NUMERICAL_FORMAT_WIRE = Object.freeze({
|
|
118
|
+
decimalsWords: "0=integer(2000) · 1=tenths(2,000.0) · 2=percentile(2,000.00) · 3=Millimeter · 4=tenThousand · 5=hundredThousand · 6=millionDecimals · 7=tenMillionDecimals · 8=billionDecimals",
|
|
119
|
+
families: "no prefix=plain number · ratio.<word>=percentage (ratio=20%, ratio.tenths=20.0%, ratio.percentile=20.00%, …) · RMB.<word>=¥ · dollar.<word>=$ · euro.<word>=€ · HK.<word>=HK$ · none=raw value (no grouping, no forced decimals)",
|
|
120
|
+
valueSemantics: "options.format holds the platform constant verbatim (e.g. \"ratio.percentile\"); the value stays a ratio — 0.5 renders 50.00%, 50 renders 5000.00%. scale is the storage decimal count and should match the format's decimals word (scale 2 ↔ percentile / ratio.percentile).",
|
|
121
|
+
runtimePrecedence: "portal form resolves: FIELD ROW bizproperty.options.format (if the key is present) > form control bizsheet attributesJson[<code>].options.format > raw decimal. Live proof: control=integer + field=ratio.percentile rendered 987654.00%; field=absent + control=RMB.percentile rendered ¥9,876.54; field=\"percent\" (non-canonical) rendered the RAW 0.5 even though the control asked percent.",
|
|
122
|
+
normalization: "CLI accepts the canonical constants plus semantic aliases (percent/percentage/ratio, currency/rmb/¥, dollar/$, euro/€, hk/hkd/hk$) and rewrites aliases to the canonical constant before the wire (percent+scale:2 → ratio.percentile). Unknown words are passed through unchanged (the platform persists them, the portal then shows raw) — use the canonical values.",
|
|
123
|
+
listView: "list views carry a SEPARATE enum `displayFormat` on the column (percent 4/5/6/13/14, currency ¥ 7/15/16/31..34, dollar 8); listview.configure derives it from the field (scale + this format family). List-face rendering of percent was NOT exercised this round (no portal page permission on the probe app) — verify the list column after configuring.",
|
|
124
|
+
designerFaces: "数据模型 数据项 Edit → DataItem Attributes → Default Format writes bizproperty.options (field row). 表单设计 选中数值控件 → Model Attributes → Default Format writes bizsheet attributesJson[<code>].options (form control), and publishes format1=format. Control Attributes → Display Format is the synced mirror (disabled while 「Synchronize Default Format」/syncFormate=true).",
|
|
125
|
+
});
|
|
102
126
|
/** Control-code classification for the 8.6.26 family (FIELD_CONTROL_CODES source of truth). */
|
|
103
127
|
export const FIELD_CONTROL_CODE_STATUS = Object.freeze({
|
|
104
128
|
known: Object.keys(FIELD_CONTROL_CODES).filter((code) => FIELD_CONTROL_CODES[Number(code)].status === "known").join(","),
|
|
@@ -127,6 +151,7 @@ export const FIELD_LANE_CONTRACT = Object.freeze({
|
|
|
127
151
|
formulaConfig: FIELD_FORMULA_WIRE.innerConfig,
|
|
128
152
|
formulaRuntimeVerification: FIELD_FORMULA_WIRE.runtimeVerification,
|
|
129
153
|
relevanceDataOptions: FIELD_RELEVANCE_WIRE.options,
|
|
154
|
+
numericalFormat: JSON.stringify(FIELD_NUMERICAL_FORMAT_WIRE, null, 2),
|
|
130
155
|
publishScope: "model",
|
|
131
156
|
controlEmissionPolicy: "ticket 101: controls PHONE(24)/PHOTO(10) are blocked for creation (no BizPropertyType maps to them — BizPropertyType.java:27-54); Tab(500) is a layout container (DataModelInitUtils.java:61-75 recurses panels, never a field); CreatedDeptId(102) is a system-field projection (DefaultPropertyType.java:18-21 → DEPARTMENT_SELECTOR 60, BizMainSystemPropertyRegistry.java:88-101); the scaffold SKIPS any field type without a control mapping — unknown/blocked control types are never auto-created (fail-closed)",
|
|
132
157
|
fieldRowDefaultPolicy: "ticket 108 determination (live 8.6.26 write+read 2026-09-15 + fwb 8.6.39 readback): the 2026-09-14 key unions are MULTI-FIELD UNIONS of designer rows, not per-field required keys — the platform accepts-and-persists minimal rows, so the minimal default + caller passthrough is the INTENTIONAL boundary. Selection families 12/13/14/15 MUST-FIXED to omit dictionaryData (designer rows carry none; live proves the platform merely accepts the extra key — omc_mcp_t108dd readback carried it only because we sent it). Families 0/1/2/9/11/17 keep the designer-carried {dictionaryData:\"\"}; DATE(3) keeps required format (BizObjectFacadeImpl.java:2949); ATTACHMENT(6) stays intentionally empty (system rows often have no options)",
|
|
@@ -141,6 +166,7 @@ export const FIELD_LANE_CONTRACT = Object.freeze({
|
|
|
141
166
|
formulaConfig: Object.freeze([behaviorBinding("test/field-families.test.ts#field.create FORMULA persists formulaConfig + persistent", assertFieldContract)]),
|
|
142
167
|
formulaRuntimeVerification: Object.freeze([behaviorBinding("test/field-families.test.ts#field.create FORMULA ACCEPTS aggregation written as an EXPRESSION (form 计算控件 subtable SUM; UI+runtime-verified 2026-10-07)", assertFieldContract)]),
|
|
143
168
|
relevanceDataOptions: Object.freeze([behaviorBinding("test/field-families.test.ts#field.create RELEVANCE_DATA persists the referenceField options", assertFieldContract)]),
|
|
169
|
+
numericalFormat: Object.freeze([behaviorBinding("test/r64b-numeric-format.test.ts#numeric format: field.create canonicalises the alias before the wire (percent → ratio.percentile)", assertFieldContract)]),
|
|
144
170
|
publishScope: Object.freeze([behaviorBinding("test/field-publish-batch.test.ts#field.publish batch: a single call publishes every draft field", assertFieldContract)]),
|
|
145
171
|
controlEmissionPolicy: Object.freeze([behaviorBinding("test/ticket-101-control-coverage.test.ts#controls 24 (PHONE) and 10 (PHOTO) are declared blocked", assertFieldContract)]),
|
|
146
172
|
fieldRowDefaultPolicy: Object.freeze([behaviorBinding("test/ticket-108-field-row-defaults.test.ts#intentional minimal defaults are pinned per the determination table", assertFieldContract)]),
|
|
@@ -172,7 +198,7 @@ export const FIELD_LANE_CONTRACT = Object.freeze({
|
|
|
172
198
|
"For single/multi-select pass `choices` (e.g. [\"A\",\"B\",\"C\"]) or `options.optionsSet` with optionsType custom/dictionary/businessModel; dictionary uses checkedDictionary/checkedDictionaryCode, businessModel uses schemaCode/sheetDataItem.",
|
|
173
199
|
"For a relation pass `relativeCode` and `options` (schemaCode/displayField/...). `searchFormula` and `conditions` are JSON strings for the relation data restriction/query conditions.",
|
|
174
200
|
"For a relation display field the tool writes the field-row top-level `relativePropertyCode` = options.displayField (the runtime reads THAT key, not options.displayField — QueryRuntimeController.java:1214-1226) and defaults options.displayFieldType:0 + displayFieldFormat:\"\".",
|
|
175
|
-
"For FORMULA pass `options.formulaConfig` (nested JSON string) + `options.persistent:true`; for RELEVANCE_DATA pass `options.relevanceField` + `options.referenceField` + `options.referenceFieldPropertyType`. 数值字段的小数位写 `options.scale`;顶层 `precision` 不被读取,若误传请改为 `precision→options.scale
|
|
201
|
+
"For FORMULA pass `options.formulaConfig` (nested JSON string) + `options.persistent:true`; for RELEVANCE_DATA pass `options.relevanceField` + `options.referenceField` + `options.referenceFieldPropertyType`. 数值字段的小数位写 `options.scale`;顶层 `precision` 不被读取,若误传请改为 `precision→options.scale(数值小数位)`。数值显示格式写 `options.format`(`ratio.percentile`=20.00%、`RMB.percentile`=¥2,000.00、`percentile`=2,000.00;**百分比存比值** 0.5→50.00%;别名 percent/currency 归一;全表见 contract 的 numericalFormat)。",
|
|
176
202
|
"org 选人族(STAFF_SELECTOR 等 5/50/51/60/61)字段行 options 自动写成实例观测的发布安全形状(yst/fwb 发布面 2656 行:null 或 {defaultValue, mappings, virtualField[, noRepeat]};单选 defaultValue \"\",多选 [])。deptVisible/multi 是**表单控件面**判别键(disposeUpdateType/updateSelectionType 读 control.options,票 69 已由表单脚手架写入控件面),不出现在字段行。",
|
|
177
203
|
]),
|
|
178
204
|
}),
|
|
@@ -183,6 +209,7 @@ export const FIELD_LANE_CONTRACT = Object.freeze({
|
|
|
183
209
|
"字典-backed 可用 `syncDictionary:true` 重填 useDictionariesData;readback 带 face:\"draft\"。",
|
|
184
210
|
"Use it to add relation `mappings` (source/target carry-through) or change field options. **关联填充映射的事实源是字段行 `options.mappings`**(真机 2026-10-14 中冶实证:改表单控件属性里的 mappings 会被平台按字段重算覆盖、回读不生效)。改映射的正确链:`field.update` 按完整 options 提交(只改 mappings,其余键 queryCode/displayField/schemaCode/conditions… 原值保留)→ `field.publish` → 已发布表单重派生一次:`form.draft`(**rebuild:false**,保留现有布局与已挂在线JS)重存 → `form.publish` → 回读核对。**不要用 field.update 的 cascadeRepublish 刷已带自定义布局/在线JS 的表单**——它会 rebuild 脚手架,可能动到现有自定义布局(rebuild:false 手动链才安全)。",
|
|
185
211
|
"A relation's display field is the field-row top-level `relativePropertyCode` (options.displayField is mirrored but not what the runtime reads); the tool rewrites it when you pass a new displayField.",
|
|
212
|
+
"数值显示格式可改:`options.format`(白名单)用平台常量 `ratio.percentile`=20.00%、`RMB.percentile`=¥2,000.00、`integer/percentile`=普通数字,别名 percent/currency 会归一。字段行 format 优先于表单控件,改完 `field.publish` 即生效(真机 r64b 无需重建表单)。",
|
|
186
213
|
"表单条件(`options.requiredFormula`(必填)/`readonlyCondition`(只读)/`displayFormula`(显示))会**自动配对**一条 `bizdatarule` type3/4/5 行:门户**运行时**读字段 options,表单设计器**设计态** Set/Unset 读 `bizdatarule/list`——只写 options 会让设计器显示 Unset。readback.formConditionSync 报 created/updated/deleted/skipped;清空条件传空串(如 requiredFormula:\"\")会同时删规则行;字段未发布时只写 options 并在 skipped 说明原因。",
|
|
187
214
|
"Re-publish with field.publish for the change to take effect — or pass `cascadeRepublish:true` for the one-call chain: field.update → field.publish → form.draft(rebuild) → form.publish(force). The cascade re-scaffolds the default form from the published fields (non-structural control options are preserved); there is no cross-endpoint transaction, so a mid-chain failure is reported honestly as partial (status:partial) with steps/failedStep/envelope (the completed prefix stays).",
|
|
188
215
|
"form.publish(rebuild:true) is the same form-side refresh without re-touching the field: it discards the existing draft, re-scaffolds from the published face, and force-promotes.",
|
|
@@ -207,6 +234,8 @@ export function assertFieldContract() {
|
|
|
207
234
|
throw new Error("field contract must carry the FORMULA formulaConfig wire facts");
|
|
208
235
|
if (!String(FIELD_LANE_CONTRACT.wire.relevanceDataOptions).includes("relevanceField"))
|
|
209
236
|
throw new Error("field contract must carry the RELEVANCE_DATA referenceField wire facts");
|
|
237
|
+
if (!String(FIELD_LANE_CONTRACT.wire.numericalFormat).includes("ratio.percentile") || !String(FIELD_LANE_CONTRACT.wire.numericalFormat).includes("0.5 renders 50.00%"))
|
|
238
|
+
throw new Error("field contract must carry the NUMERICAL display-format enum and the ratio value semantics");
|
|
210
239
|
if (!String(FIELD_LANE_CONTRACT.wire.controlEmissionPolicy).includes("BizPropertyType.java:27-54"))
|
|
211
240
|
throw new Error("field contract must carry the ticket-101 control-emission policy with its enum evidence");
|
|
212
241
|
if (!String(FIELD_LANE_CONTRACT.wire.fieldRowDefaultPolicy).includes("MUST-FIXED"))
|
|
@@ -217,7 +246,7 @@ export function assertFieldContract() {
|
|
|
217
246
|
throw new Error("field contract must carry the blocked families");
|
|
218
247
|
if (FIELD_LANE_CONTRACT.wire.publishScope !== "model")
|
|
219
248
|
throw new Error("field contract pins the publish scope to model");
|
|
220
|
-
assertDescriptionCarries(FIELD_LANE_CONTRACT, "field.create", ["bizproperty/create", "OCR/ELECTRONIC_SIGN", "`choices`", "options.optionsSet", "`relativeCode`", "searchFormula", "`options.formulaConfig`", "`options.relevanceField`", "precision→options.scale", "code_reserved", "WORK_SHEET"]);
|
|
249
|
+
assertDescriptionCarries(FIELD_LANE_CONTRACT, "field.create", ["bizproperty/create", "OCR/ELECTRONIC_SIGN", "`choices`", "options.optionsSet", "`relativeCode`", "searchFormula", "`options.formulaConfig`", "`options.relevanceField`", "precision→options.scale", "code_reserved", "WORK_SHEET", "options.format", "百分比存比值", "numericalFormat"]);
|
|
221
250
|
assertDescriptionCarries(FIELD_LANE_CONTRACT, "field.update", ["bizproperty/update", "`options`", "field.publish", "cascadeRepublish", "form.draft(rebuild)", "form.publish(force)", "published fields", "non-structural", "partial"]);
|
|
222
251
|
assertDescriptionCarries(FIELD_LANE_CONTRACT, "field.publish", ["bizproperty/publish", "published", "Model-scoped", "publishedCodes", "unpublishedRequested", "nonexistentCodes", "stillDraftCodes"]);
|
|
223
252
|
assertDescriptionCarries(FIELD_LANE_CONTRACT, "field.delete", ["bizproperty/force_delete", "absence"]);
|
package/dist/lanes/field.js
CHANGED
|
@@ -324,7 +324,7 @@ async function assertNoChildSchemaAggregation(session, schemaCode, propertyType,
|
|
|
324
324
|
export function registerFieldLane(tools) {
|
|
325
325
|
tools.push(defineTool({
|
|
326
326
|
name: "field.list",
|
|
327
|
-
search: { intents: ["看字段", "查字段", "字段清单", "模型有哪些字段", "字段列表"] },
|
|
327
|
+
search: { intents: ["看字段", "查字段", "字段清单", "模型有哪些字段", "字段列表", "跳号"] },
|
|
328
328
|
layer: "low",
|
|
329
329
|
kind: "read",
|
|
330
330
|
lane: FIELD_LANE,
|
|
@@ -527,7 +527,7 @@ export function registerFieldLane(tools) {
|
|
|
527
527
|
writeTool({
|
|
528
528
|
tools,
|
|
529
529
|
name: "field.create",
|
|
530
|
-
search: { intents: ["加字段", "新增字段", "添加字段", "加一个字段", "单据号字段", "序列号字段", "编号规则字段"] },
|
|
530
|
+
search: { intents: ["加字段", "新增字段", "添加字段", "加一个字段", "单据号字段", "序列号字段", "编号规则字段", "百分比字段", "占比字段", "百分号显示"] },
|
|
531
531
|
lane: FIELD_LANE,
|
|
532
532
|
scope: FIELD_TOOLS["field.create"].scope,
|
|
533
533
|
description: FIELD_TOOLS["field.create"].description,
|
|
@@ -639,7 +639,7 @@ export function registerFieldLane(tools) {
|
|
|
639
639
|
writeTool({
|
|
640
640
|
tools,
|
|
641
641
|
name: "field.update",
|
|
642
|
-
search: { intents: ["改字段", "改字段配置", "字段改名", "字段设只读", "字段设必填", "字段改精度"] },
|
|
642
|
+
search: { intents: ["改字段", "改字段配置", "字段改名", "字段设只读", "字段设必填", "字段改精度", "小数位", "小数点", "小数点太多", "自动带出", "带出", "手动填"] },
|
|
643
643
|
lane: FIELD_LANE,
|
|
644
644
|
scope: FIELD_TOOLS["field.update"].scope,
|
|
645
645
|
description: FIELD_TOOLS["field.update"].description,
|
|
@@ -1255,6 +1255,11 @@ async function runFieldUpdate(session, args) {
|
|
|
1255
1255
|
"dictionaryData", "optionsSet", "mappings", "schemaCode", "queryCode", "displayField", "displayFieldType", "displayFieldFormat",
|
|
1256
1256
|
"relativePropertyMatchCode", "relativePropertyCode", "linkMode", "showStyle", "searchFormula", "conditions",
|
|
1257
1257
|
"requiredFormula", "readonlyCondition", "displayFormula", "readonlyFormula", "scale",
|
|
1258
|
+
// r64b (live 2026-11-14): the numeric DISPLAY FORMAT. The designer writes it
|
|
1259
|
+
// to this very row (数据项 Edit → Default Format → bizproperty/update
|
|
1260
|
+
// options.format="ratio.percentile"), and the portal form reads it with
|
|
1261
|
+
// priority over the form control's own format. Canonicalised before the wire.
|
|
1262
|
+
"format",
|
|
1258
1263
|
]);
|
|
1259
1264
|
const changedOptionKeys = requestedChanges.filter((field) => field.startsWith("options.")).map((field) => field.slice("options.".length));
|
|
1260
1265
|
const immutableOptionKeys = changedOptionKeys.filter((key) => !mutableOptionKeys.has(key));
|
|
@@ -1365,6 +1370,7 @@ async function runFieldUpdate(session, args) {
|
|
|
1365
1370
|
face: "draft",
|
|
1366
1371
|
impact,
|
|
1367
1372
|
fieldPresent: after !== undefined,
|
|
1373
|
+
...(prepared.formatNormalized !== undefined ? { formatNormalized: prepared.formatNormalized } : {}),
|
|
1368
1374
|
...(after?.name !== undefined || prepared.name !== undefined || record.name !== undefined || record.propertyName !== undefined
|
|
1369
1375
|
? { name: after?.name ?? prepared.name ?? record.name ?? record.propertyName }
|
|
1370
1376
|
: {}),
|
package/dist/lanes/form.js
CHANGED
|
@@ -80,7 +80,7 @@ function smallLayoutSummary(draftCodes, publishedCodes, sheet) {
|
|
|
80
80
|
export function registerFormLane(tools) {
|
|
81
81
|
tools.push(defineTool({
|
|
82
82
|
name: "form.get",
|
|
83
|
-
search: { intents: ["看表单", "查表单", "表单有哪些控件", "表单发布状态", "读表单"] },
|
|
83
|
+
search: { intents: ["看表单", "查表单", "表单有哪些控件", "表单发布状态", "读表单", "打开是空", "打开空白", "打印", "是空的"] },
|
|
84
84
|
layer: "low",
|
|
85
85
|
kind: "read",
|
|
86
86
|
lane: FORM_LANE,
|