@stalfh233/omc-cli 0.6.7 → 0.6.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/approval-flow.js +5 -3
- package/dist/bizservice-config.js +26 -10
- package/dist/call.js +47 -0
- package/dist/capability-overview.js +47 -24
- package/dist/cli-contract.js +73 -26
- package/dist/cli-output.js +41 -2
- package/dist/cli-stdout.js +74 -0
- package/dist/cli.js +135 -52
- package/dist/command-transport.js +8 -1
- package/dist/config-store.js +17 -2
- package/dist/discovery.js +62 -3
- package/dist/field-families.js +35 -6
- package/dist/goal-routes.js +118 -11
- package/dist/human-summary.js +11 -0
- package/dist/lanes/app-contract.js +12 -5
- package/dist/lanes/app.js +221 -134
- package/dist/lanes/apply-changes.js +2 -1
- package/dist/lanes/b2-registration-contract.js +3 -3
- package/dist/lanes/b2-registration.js +890 -693
- package/dist/lanes/businessrule.js +75 -51
- package/dist/lanes/custom-page.js +166 -115
- package/dist/lanes/datarule-contract.js +2 -2
- package/dist/lanes/datarule.js +238 -154
- package/dist/lanes/dictionary.js +253 -110
- package/dist/lanes/environment.js +57 -9
- package/dist/lanes/field.js +160 -107
- package/dist/lanes/folder-contract.js +7 -3
- package/dist/lanes/folder.js +249 -118
- package/dist/lanes/form-contract.js +1 -1
- package/dist/lanes/form.js +188 -64
- package/dist/lanes/list-view.js +405 -369
- package/dist/lanes/meta.js +31 -6
- package/dist/lanes/model-contract.js +1 -1
- package/dist/lanes/model.js +610 -512
- package/dist/lanes/online-js-contract.js +1 -1
- package/dist/lanes/online-js.js +160 -146
- package/dist/lanes/organization.js +905 -640
- package/dist/lanes/programming.js +274 -136
- package/dist/lanes/report-contract.js +2 -2
- package/dist/lanes/report.js +354 -198
- package/dist/lanes/rule-lifecycle.js +294 -140
- package/dist/lanes/runtime-data-contract.js +4 -4
- package/dist/lanes/runtime-data.js +869 -745
- package/dist/lanes/workflow-contract.js +3 -3
- package/dist/lanes/workflow.js +732 -605
- package/dist/model-scaffold.js +26 -5
- package/dist/path-projection.js +196 -14
- package/dist/plan.js +25 -0
- package/dist/programming-workflow.js +55 -3
- package/dist/read-shapes.js +146 -0
- package/dist/read.js +40 -9
- package/dist/recipes/businessrule.js +74 -24
- package/dist/recipes/dictionary.js +7 -4
- package/dist/recipes/form.js +46 -0
- package/dist/recipes/runtime-data.js +3 -2
- package/dist/refusal-guidance.js +29 -5
- package/dist/rule-support.js +14 -1
- package/dist/rule-when.js +2 -2
- package/dist/tool-types.js +9 -3
- package/dist/version-family-gaps.js +101 -0
- package/dist/write.js +2 -1
- package/package.json +6 -4
- package/skills/omc-glossary.md +13 -0
- package/skills/omc-refusals.md +13 -5
- package/skills/omc-tool-selection.md +2 -1
- package/skills/omc-write-hazards.md +5 -2
package/dist/lanes/form.js
CHANGED
|
@@ -24,6 +24,25 @@ function resolveSheetCode(schemaCode, sheetCode) {
|
|
|
24
24
|
return sheetCode ?? schemaCode;
|
|
25
25
|
}
|
|
26
26
|
/** Control codes present in a form attributes JSON face (sorted, stable). */
|
|
27
|
+
/**
|
|
28
|
+
* 布局行分组:`viewJson` 是 `string[][]`(一行 N 个 code = N 列)。解析失败或形状
|
|
29
|
+
* 不是二维数组时返回 undefined(不要把它伪装成空布局)。
|
|
30
|
+
*/
|
|
31
|
+
function parseLayoutRows(face) {
|
|
32
|
+
if (typeof face !== "string")
|
|
33
|
+
return undefined;
|
|
34
|
+
try {
|
|
35
|
+
const parsed = JSON.parse(face);
|
|
36
|
+
if (!Array.isArray(parsed))
|
|
37
|
+
return undefined;
|
|
38
|
+
if (!parsed.every((row) => Array.isArray(row) && row.every((cell) => typeof cell === "string")))
|
|
39
|
+
return undefined;
|
|
40
|
+
return parsed;
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
27
46
|
function parseControlCodes(face) {
|
|
28
47
|
if (typeof face !== "string")
|
|
29
48
|
return [];
|
|
@@ -35,6 +54,29 @@ function parseControlCodes(face) {
|
|
|
35
54
|
return [];
|
|
36
55
|
}
|
|
37
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* `--full` 的小体量布局摘要(控件码 + 行分组)。只在**加起来很小**时才给:
|
|
59
|
+
* 目的本来是"省一次默认面往返",一旦它自己变大就成了新的负担。
|
|
60
|
+
*/
|
|
61
|
+
function smallLayoutSummary(draftCodes, publishedCodes, sheet) {
|
|
62
|
+
const draftRows = parseLayoutRows(sheet.draftViewJson);
|
|
63
|
+
const publishedRows = parseLayoutRows(sheet.publishedViewJson);
|
|
64
|
+
const payload = { draftCodes, publishedCodes, draftRows, publishedRows };
|
|
65
|
+
const bytes = Buffer.byteLength(JSON.stringify(payload), "utf8");
|
|
66
|
+
if (bytes > 2048) {
|
|
67
|
+
return {
|
|
68
|
+
layoutSummaryOmitted: true,
|
|
69
|
+
layoutSummaryBytes: bytes,
|
|
70
|
+
layoutSummaryNote: `控件码/行分组 ${bytes}B 超过内联预算(2048B)未内联——用 artifact 里的 draftViewJson/publishedViewJson 解析,或读默认面的 draftControlCodes/draftRows`,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
draftControlCodes: draftCodes,
|
|
75
|
+
publishedControlCodes: publishedCodes,
|
|
76
|
+
...(draftRows !== undefined ? { draftRows } : {}),
|
|
77
|
+
...(publishedRows !== undefined ? { publishedRows } : {}),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
38
80
|
export function registerFormLane(tools) {
|
|
39
81
|
tools.push(defineTool({
|
|
40
82
|
name: "form.get",
|
|
@@ -60,12 +102,39 @@ export function registerFormLane(tools) {
|
|
|
60
102
|
const sheet = (await wireCall(session, { path: ENDPOINTS.sheetGet, query: { schemaCode: args.schemaCode, sheetCode } })).data;
|
|
61
103
|
if (!sheet)
|
|
62
104
|
return { schemaCode: args.schemaCode, sheetCode, present: false };
|
|
105
|
+
// r28e F8(真机复现 2026-11-05,CloudPivot 1.1.25):publish → form.draft
|
|
106
|
+
// 之后,平台 bizsheet/get 的 `published`/`existDraft` 两个布尔**都回 false**,
|
|
107
|
+
// 而 `draftViewJson`/`publishedViewJson`/`draftAttributesJson`/
|
|
108
|
+
// `publishedAttributesJson` 四份内容都在。只信布尔会让调用方得出
|
|
109
|
+
// 「既没草稿也没发布」的相反结论(探针原话)。
|
|
110
|
+
//
|
|
111
|
+
// 处置:布尔照原样回(契约与既有判据不变),另加**由实际内容推导**的
|
|
112
|
+
// `faces`,并在两者矛盾时给 `flagMismatch` + 一句可读说明——矛盾本身
|
|
113
|
+
// 就是最有用的信息,不要替调用方猜哪边对。
|
|
114
|
+
const draftCodes = parseControlCodes(sheet.draftAttributesJson);
|
|
115
|
+
const publishedCodes = parseControlCodes(sheet.publishedAttributesJson);
|
|
116
|
+
const draftPresent = draftCodes.length > 0 || (typeof sheet.draftViewJson === "string" && sheet.draftViewJson.trim() !== "" && sheet.draftViewJson.trim() !== "[]");
|
|
117
|
+
const publishedPresent = publishedCodes.length > 0 || (typeof sheet.publishedViewJson === "string" && sheet.publishedViewJson.trim() !== "" && sheet.publishedViewJson.trim() !== "[]");
|
|
118
|
+
const platformPublished = sheet.published === true;
|
|
119
|
+
const platformDraft = sheet.existDraft === true;
|
|
120
|
+
const flagMismatch = platformPublished !== publishedPresent || platformDraft !== draftPresent;
|
|
63
121
|
const base = {
|
|
64
122
|
schemaCode: args.schemaCode,
|
|
65
123
|
sheetCode,
|
|
66
124
|
present: true,
|
|
67
|
-
published:
|
|
68
|
-
existDraft:
|
|
125
|
+
published: platformPublished,
|
|
126
|
+
existDraft: platformDraft,
|
|
127
|
+
faces: {
|
|
128
|
+
draft: { present: draftPresent, controlCount: draftCodes.length },
|
|
129
|
+
published: { present: publishedPresent, controlCount: publishedCodes.length },
|
|
130
|
+
inSync: draftPresent && publishedPresent ? sheet.draftViewJson === sheet.publishedViewJson : null,
|
|
131
|
+
},
|
|
132
|
+
...(flagMismatch
|
|
133
|
+
? {
|
|
134
|
+
flagMismatch: true,
|
|
135
|
+
flagNote: "平台布尔与内容不一致:published/existDraft 来自 bizsheet/get 的标记位,faces 由 draft/published 两份布局内容推导。判「现在有几面」以 faces 为准;判「能否被运行时读到」以 published 为准(平台可能未刷新标记)。",
|
|
136
|
+
}
|
|
137
|
+
: {}),
|
|
69
138
|
};
|
|
70
139
|
if (args.full === true)
|
|
71
140
|
return {
|
|
@@ -100,9 +169,14 @@ export function registerFormLane(tools) {
|
|
|
100
169
|
draft: validateHtmlRender(sheet.draftHtmlJson),
|
|
101
170
|
published: validateHtmlRender(sheet.publishedHtmlJson),
|
|
102
171
|
},
|
|
172
|
+
// r28e F13:full 面此前丢掉控件码清单——调用方要么再跑一次默认面,
|
|
173
|
+
// 要么自己 JSON.parse 两段字符串才数得清每行几个控件。
|
|
174
|
+
// 但**只在它们本身不构成负担时**补:900 控件的真实大表单,码表 +
|
|
175
|
+
// 行分组就有 14KB,会把 --full 的"外置省字节"整个抵消(T1 实测)。
|
|
176
|
+
...smallLayoutSummary(draftCodes, publishedCodes, sheet),
|
|
103
177
|
};
|
|
104
|
-
const draftControls =
|
|
105
|
-
const publishedControls =
|
|
178
|
+
const draftControls = draftCodes;
|
|
179
|
+
const publishedControls = publishedCodes;
|
|
106
180
|
// `controls:true` (dogfood R2: the caller sent a boolean and got
|
|
107
181
|
// `controls: Expected array`) means "all controls" — it is the natural
|
|
108
182
|
// shorthand and maps to the full control-code list.
|
|
@@ -141,6 +215,10 @@ export function registerFormLane(tools) {
|
|
|
141
215
|
: {}),
|
|
142
216
|
draftControlCodes: draftControls,
|
|
143
217
|
publishedControlCodes: publishedControls,
|
|
218
|
+
// r28e F4:默认面只有控件码集合(字母序),证明不了「两列 / 末行整宽」。
|
|
219
|
+
// 行分组本身只有几十字节,直接给:`[[a,b],[c]]` = 第一行两列、第二行整宽。
|
|
220
|
+
...(parseLayoutRows(sheet.draftViewJson) !== undefined ? { draftRows: parseLayoutRows(sheet.draftViewJson) } : {}),
|
|
221
|
+
...(parseLayoutRows(sheet.publishedViewJson) !== undefined ? { publishedRows: parseLayoutRows(sheet.publishedViewJson) } : {}),
|
|
144
222
|
...(wanted ? { draftControls: pick(sheet.draftAttributesJson), publishedControls: pick(sheet.publishedAttributesJson) } : {}),
|
|
145
223
|
};
|
|
146
224
|
}, {
|
|
@@ -156,10 +234,15 @@ export function registerFormLane(tools) {
|
|
|
156
234
|
// 正文用 `artifact get <detailArtifactId> --jq draftViewJson` 定向取回。
|
|
157
235
|
compact: (result) => {
|
|
158
236
|
const KEEP = new Set(["draftControls", "publishedControls", "customButtonJson", "options", "formButtons", "formButtonCodes"]);
|
|
237
|
+
// r28e F4 暴露的潜在 bug:handler 已经交过 `*Codes`/`*Count`/`*Omitted`
|
|
238
|
+
// 这类**已压缩**的键,若再走数组分支会被二次加后缀
|
|
239
|
+
// (`publishedControlCodes` → `publishedControlCodesCodes`),字段直接消失。
|
|
240
|
+
// 这些键原样透传。
|
|
241
|
+
const COMPACTED = /(?:Codes|Count|Omitted|Bytes|Note|Rows)$/;
|
|
159
242
|
const out = {};
|
|
160
243
|
const omitted = [];
|
|
161
244
|
for (const [key, value] of Object.entries(result)) {
|
|
162
|
-
if (KEEP.has(key))
|
|
245
|
+
if (KEEP.has(key) || COMPACTED.test(key))
|
|
163
246
|
out[key] = value;
|
|
164
247
|
else if (typeof value === "string" && Buffer.byteLength(value, "utf8") > 4096) {
|
|
165
248
|
out[`${key}Omitted`] = true;
|
|
@@ -170,6 +253,18 @@ export function registerFormLane(tools) {
|
|
|
170
253
|
out[`${key}Codes`] = value.map((entry) => (entry && typeof entry === "object" ? String(entry.code ?? entry.propertyCode ?? "") : String(entry))).filter((entry) => entry.length > 0), out[`${key}Count`] = value.length;
|
|
171
254
|
// 大**对象**也要降载:审查 2026-11-04 指出旧 else 分支把
|
|
172
255
|
// htmlRenderCompat 这类非 KEEP 对象整包内联,抵消了 T1 的省体积目标。
|
|
256
|
+
//
|
|
257
|
+
// r28e F13(真机 2026-11-05):压成 `htmlRenderCompatCount: 2` 之后,
|
|
258
|
+
// 「两个面都通过」和「两个面都炸」是同一个数——这个字段存在的唯一
|
|
259
|
+
// 理由("报 per-face 违规而不是不吭声的 data ok")被降载抹掉了。
|
|
260
|
+
// 渲染兼容是**判定**不是数据:只留 ok 与否 + 有违规时的面名。
|
|
261
|
+
else if (key === "htmlRenderCompat" && value !== null && typeof value === "object") {
|
|
262
|
+
const faces = value;
|
|
263
|
+
const failing = Object.entries(faces).filter(([, face]) => face?.ok !== true).map(([name]) => name);
|
|
264
|
+
out.htmlRenderCompatOk = failing.length === 0;
|
|
265
|
+
if (failing.length > 0)
|
|
266
|
+
out.htmlRenderCompatFailing = failing;
|
|
267
|
+
}
|
|
173
268
|
else if (value !== null && typeof value === "object")
|
|
174
269
|
out[`${key}Count`] = Object.keys(value).length;
|
|
175
270
|
else
|
|
@@ -183,61 +278,82 @@ export function registerFormLane(tools) {
|
|
|
183
278
|
},
|
|
184
279
|
}),
|
|
185
280
|
}));
|
|
186
|
-
writeTool(
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
.optional()
|
|
199
|
-
.
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
281
|
+
writeTool({
|
|
282
|
+
tools,
|
|
283
|
+
name: "form.draft",
|
|
284
|
+
lane: FORM_LANE,
|
|
285
|
+
scope: FORM_TOOLS["form.draft"].scope,
|
|
286
|
+
description: FORM_TOOLS["form.draft"].description,
|
|
287
|
+
inputSchema: {
|
|
288
|
+
schemaCode: z.string().min(1),
|
|
289
|
+
sheetCode: z.string().min(1).optional().describe("表单槽位码;省略时默认 = schemaCode(模型码即默认表单槽位)"),
|
|
290
|
+
draftViewJson: z.string().optional().describe("行分组:JSON 二维字符串数组 `[[\"codeA\",\"codeB\"],[\"codeC\"]]`——**一行几个 code 就是几列**(不是改 span 来改列数);末行只放一个 code 即整宽。每个 code 必须同时出现在 draftAttributesJson 里。现成样例:`omc describe form.draft --example two-column-layout`"),
|
|
291
|
+
draftAttributesJson: z.string().optional().describe("控件表:JSON 对象 `{ \"codeA\": { key:\"codeA\", type: <控件类型号>, options:{ name:\"显示名\", span: 12 } } }`。`span` 是 24 栅格宽度:两列各 span:12、整宽 span:24(必须与 draftViewJson 的行分组一致,否则 layout_coverage_mismatch)。现成样例:`omc describe form.draft --example two-column-layout`"),
|
|
292
|
+
draftHtmlJson: z.string().optional(),
|
|
293
|
+
fieldCodes: z.array(z.string().min(1)).optional().describe("脚手架绑定的已发布字段(按此顺序);由 configure_form/intent 显式传入"),
|
|
294
|
+
rebuild: z.boolean().optional().describe("true 时丢弃现有草稿布局,按已发布字段重新生成(新增字段/子表要用它;默认保留现有草稿)"),
|
|
295
|
+
fromReadback: z.boolean().optional().describe("true = 本次 draftViewJson/draftAttributesJson 来自 form.get 的原样读回(平台自身布局可能含子表列行/系统行超宽);工具会与已存面逐字比对,只有确实一致才放行,被改动过的面照常拒绝"),
|
|
296
|
+
allowEmptyLayout: z.boolean().optional().describe("显式放行空布局(\"[]\"/\"{}\")写入;默认拒绝(form-empty-layout),防设计器 Save 清空后照写丢控件"),
|
|
297
|
+
buttons: z
|
|
298
|
+
.array(z.record(z.unknown()))
|
|
299
|
+
.optional()
|
|
300
|
+
.describe("表单工具栏按钮(写进 biz_sheet.options.customButtonJson;publish 时才生成 h_biz_button(triggerType=FORM))。每条至少 code/name/bindAction/operateType,useLocation 默认 FORM"),
|
|
301
|
+
customButtonJson: z.string().optional().describe("buttons 的原样 JSON 数组字符串(与 buttons 互斥;用于把 form.get 读回值直接回写)"),
|
|
302
|
+
buttonsMode: z.enum(["merge", "replace"]).optional().describe("默认 merge:按 code 增量 upsert(改一个按钮不必重发全表);replace:整表替换"),
|
|
303
|
+
removeButtonCodes: z.array(z.string().min(1)).optional().describe("要删除的按钮 code(仅 merge 模式)"),
|
|
304
|
+
buttonScripts: z.array(z.object({ code: z.string().min(1), script: z.string() })).optional().describe("直接改已有表单按钮的脚本(actionConfig.scriptData),按 code 逐字替换;未知 code 拒绝。不必重发整表"),
|
|
305
|
+
},
|
|
306
|
+
execute: async (session, args) => executeFormDraftWrite(session, { ...args, sheetCode: resolveSheetCode(args.schemaCode, args.sheetCode) }),
|
|
307
|
+
preflight: (args) => {
|
|
308
|
+
// Zero-wire refusal (ticket 74): fires in semanticGate BEFORE the
|
|
309
|
+
// governed pipeline — including the rollback before-capture read.
|
|
310
|
+
refuseEmptyCallerLayout({ ...args, sheetCode: resolveSheetCode(args.schemaCode, args.sheetCode) });
|
|
311
|
+
},
|
|
312
|
+
rollback: {
|
|
313
|
+
target: (args) => `form:${String(args.schemaCode ?? "")}/${String(args.sheetCode ?? args.schemaCode ?? "")}`,
|
|
314
|
+
read: (session, args) => readFormOrNull(session, String(args.schemaCode), resolveSheetCode(String(args.schemaCode), args.sheetCode)),
|
|
315
|
+
inverse: ({ before, args }) => {
|
|
316
|
+
if (before == null)
|
|
317
|
+
return { kind: "irreversible", reason: "表单写入前不存在;平台没有删除表单端点,无法撤销创建" };
|
|
318
|
+
const row = before;
|
|
319
|
+
const restored = { schemaCode: String(args.schemaCode), sheetCode: resolveSheetCode(String(args.schemaCode), args.sheetCode) };
|
|
320
|
+
for (const key of ["draftViewJson", "draftAttributesJson", "draftHtmlJson"])
|
|
321
|
+
if (typeof row[key] === "string")
|
|
322
|
+
restored[key] = row[key];
|
|
323
|
+
return { kind: "calls", calls: [{ tool: "form.draft", args: restored }] };
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
});
|
|
327
|
+
writeTool({
|
|
328
|
+
tools,
|
|
329
|
+
name: "form.publish",
|
|
330
|
+
lane: FORM_LANE,
|
|
331
|
+
scope: FORM_TOOLS["form.publish"].scope,
|
|
332
|
+
description: FORM_TOOLS["form.publish"].description,
|
|
333
|
+
inputSchema: {
|
|
334
|
+
schemaCode: z.string().min(1),
|
|
335
|
+
sheetCode: z.string().min(1).optional().describe("表单槽位码;省略时默认 = schemaCode(模型码即默认表单槽位)"),
|
|
336
|
+
publishRemarks: z.string().optional(),
|
|
337
|
+
// r28e F10(真机 2026-11-05):旧文案说「重写草稿后的再发布需要它」,
|
|
338
|
+
// 实测 form.draft 改布局后直接 form.publish **不带 force 也正常提拔**
|
|
339
|
+
// (errcode 0 / published true)。误导会让人多传一个没必要的护栏。
|
|
340
|
+
force: z.boolean().optional().describe("仅在回执 already-published(同一份草稿重复发布被短路)且你确认要重推时使用;正常流程(改草稿→publish)不需要它"),
|
|
341
|
+
allowDegrade: z.boolean().optional().describe("显式放行降级提拔(草稿控件数 < 已发布面);默认拒绝(form-publish-degrade),防把空/残草稿提拔成发布版"),
|
|
342
|
+
rebuild: z
|
|
343
|
+
.boolean()
|
|
344
|
+
.optional()
|
|
345
|
+
.describe("true 时一步刷新:先丢弃现有草稿、按已发布字段重建脚手架(保留非结构性控件 options),再强制提拔——改字段形状后刷新表单用一个调用;默认只发布现有草稿(无草稿时自动补默认)"),
|
|
346
|
+
buttons: z
|
|
347
|
+
.array(z.record(z.unknown()))
|
|
348
|
+
.optional()
|
|
349
|
+
.describe("表单工具栏按钮:本次发布写进 options.customButtonJson 并生成 h_biz_button(triggerType=FORM)。之后再按流程节点 buttonPermission.customBtns[].enabled 决定哪个节点可见"),
|
|
350
|
+
customButtonJson: z.string().optional().describe("buttons 的原样 JSON 数组字符串(与 buttons 互斥)"),
|
|
351
|
+
buttonsMode: z.enum(["merge", "replace"]).optional().describe("默认 merge:按 code 增量 upsert;replace:整表替换"),
|
|
352
|
+
removeButtonCodes: z.array(z.string().min(1)).optional().describe("要删除的按钮 code(仅 merge 模式)"),
|
|
353
|
+
buttonScripts: z.array(z.object({ code: z.string().min(1), script: z.string() })).optional().describe("直接改已有表单按钮的脚本(actionConfig.scriptData),按 code 逐字替换;未知 code 拒绝。不必重发整表"),
|
|
220
354
|
},
|
|
355
|
+
execute: async (session, args) => executeFormPublishWrite(session, { ...args, sheetCode: resolveSheetCode(args.schemaCode, args.sheetCode) }),
|
|
221
356
|
});
|
|
222
|
-
writeTool(tools, "form.publish", FORM_LANE, FORM_TOOLS["form.publish"].scope, FORM_TOOLS["form.publish"].description, {
|
|
223
|
-
schemaCode: z.string().min(1),
|
|
224
|
-
sheetCode: z.string().min(1).optional().describe("表单槽位码;省略时默认 = schemaCode(模型码即默认表单槽位)"),
|
|
225
|
-
publishRemarks: z.string().optional(),
|
|
226
|
-
force: z.boolean().optional().describe("强制重新提拔(跳过 already-published 短路);重写草稿后的再发布需要它"),
|
|
227
|
-
allowDegrade: z.boolean().optional().describe("显式放行降级提拔(草稿控件数 < 已发布面);默认拒绝(form-publish-degrade),防把空/残草稿提拔成发布版"),
|
|
228
|
-
rebuild: z
|
|
229
|
-
.boolean()
|
|
230
|
-
.optional()
|
|
231
|
-
.describe("true 时一步刷新:先丢弃现有草稿、按已发布字段重建脚手架(保留非结构性控件 options),再强制提拔——改字段形状后刷新表单用一个调用;默认只发布现有草稿(无草稿时自动补默认)"),
|
|
232
|
-
buttons: z
|
|
233
|
-
.array(z.record(z.unknown()))
|
|
234
|
-
.optional()
|
|
235
|
-
.describe("表单工具栏按钮:本次发布写进 options.customButtonJson 并生成 h_biz_button(triggerType=FORM)。之后再按流程节点 buttonPermission.customBtns[].enabled 决定哪个节点可见"),
|
|
236
|
-
customButtonJson: z.string().optional().describe("buttons 的原样 JSON 数组字符串(与 buttons 互斥)"),
|
|
237
|
-
buttonsMode: z.enum(["merge", "replace"]).optional().describe("默认 merge:按 code 增量 upsert;replace:整表替换"),
|
|
238
|
-
removeButtonCodes: z.array(z.string().min(1)).optional().describe("要删除的按钮 code(仅 merge 模式)"),
|
|
239
|
-
buttonScripts: z.array(z.object({ code: z.string().min(1), script: z.string() })).optional().describe("直接改已有表单按钮的脚本(actionConfig.scriptData),按 code 逐字替换;未知 code 拒绝。不必重发整表"),
|
|
240
|
-
}, async (session, args) => executeFormPublishWrite(session, { ...args, sheetCode: resolveSheetCode(args.schemaCode, args.sheetCode) }));
|
|
241
357
|
registerPackageTool(tools, {
|
|
242
358
|
name: "configure_form",
|
|
243
359
|
lane: FORM_LANE,
|
|
@@ -300,11 +416,19 @@ export function registerFormLane(tools) {
|
|
|
300
416
|
},
|
|
301
417
|
summarize: (args, _outcome, phase) => writeSummary("configure_form", args, undefined, phase),
|
|
302
418
|
});
|
|
303
|
-
writeTool(
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
419
|
+
writeTool({
|
|
420
|
+
tools,
|
|
421
|
+
name: "form.runButton",
|
|
422
|
+
lane: FORM_LANE,
|
|
423
|
+
scope: FORM_TOOLS["form.runButton"].scope,
|
|
424
|
+
description: FORM_TOOLS["form.runButton"].description,
|
|
425
|
+
inputSchema: {
|
|
426
|
+
schemaCode: z.string().min(1),
|
|
427
|
+
sheetCode: z.string().min(1).optional().describe("表单槽位码;省略时默认 = schemaCode"),
|
|
428
|
+
buttonCode: z.string().min(1).describe("表单按钮 code(form.get --full 的 customButtonJson / publish 读回的 formButtonCodes)"),
|
|
429
|
+
bizObjectId: z.string().min(1).describe("要执行按钮的业务记录 id(data.load/data.list 的 bizObjectId)"),
|
|
430
|
+
},
|
|
431
|
+
execute: async (session, args) => executeFormRunButtonWrite(session, { schemaCode: args.schemaCode, sheetCode: resolveSheetCode(args.schemaCode, args.sheetCode), buttonCode: args.buttonCode, bizObjectId: args.bizObjectId }),
|
|
432
|
+
});
|
|
309
433
|
}
|
|
310
434
|
//# sourceMappingURL=form.js.map
|