@stalfh233/omc-cli 0.6.78 → 0.6.80

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.
@@ -155,6 +155,10 @@ export const FIELD_LANE_CONTRACT = Object.freeze({
155
155
  publishScope: "model",
156
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)",
157
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)",
158
+ orgSelectorFieldRowOptions: "org-selector families STAFF_SELECTOR / STAFF_MULTI_SELECTOR / DEPARTMENT_SELECTOR / DEPARTMENT_MULTI_SELECTOR (5/50/51/60/61): the field-row options are a publish-safe shape observed on the yst/fwb publish face (2656 rows) — null or {defaultValue, mappings, virtualField[, noRepeat]}; single-select defaultValue \"\" and multi-select []; deptVisible/multi are FORM-CONTROL discriminator keys (read from control.options via disposeUpdateType/updateSelectionType) and never appear on the field row",
159
+ relationMappingsSource: "the field row's options.mappings is the source of truth for relation carry-through; editing a form control's mappings is recomputed from the field and does not survive readback (live 2026-10-14 中冶). Update chain: field.update with the full options (change only mappings, keep queryCode/displayField/schemaCode/conditions… as-is) → field.publish → form.draft rebuild:false (keeps the existing layout and any online JS) → form.publish → readback. Do NOT use cascadeRepublish on a form that already carries a custom layout or online JS — it re-scaffolds the default form",
160
+ propertyEmptyReadback: "propertyEmpty overrides the data-model not-null declaration; false reopens a field the platform previously created wrongly (required/readonly belong to the form and workflow nodes). bizproperty/list rows do NOT carry propertyEmpty, so readback.propertyEmpty appears only when the draft face returns it — the CLI never fabricates it; readback.committed lists what actually went on the wire",
161
+ listFace: "field.list default face inlines code/name/type(+typeName)/conditions signal/shapeWarning only; the whole choices package is not inlined (a selection field measured ~500B/row) — verify options/subSchema with the code/fields selectors or full:true",
158
162
  }),
159
163
  wireBindings: Object.freeze({
160
164
  acceptedFamilies: Object.freeze([emitterBinding("lanes/field-contract.FIELD_FAMILY_LIST", assertFieldContract)]),
@@ -170,6 +174,10 @@ export const FIELD_LANE_CONTRACT = Object.freeze({
170
174
  publishScope: Object.freeze([behaviorBinding("test/field-publish-batch.test.ts#field.publish batch: a single call publishes every draft field", assertFieldContract)]),
171
175
  controlEmissionPolicy: Object.freeze([behaviorBinding("test/ticket-101-control-coverage.test.ts#controls 24 (PHONE) and 10 (PHOTO) are declared blocked", assertFieldContract)]),
172
176
  fieldRowDefaultPolicy: Object.freeze([behaviorBinding("test/ticket-108-field-row-defaults.test.ts#intentional minimal defaults are pinned per the determination table", assertFieldContract)]),
177
+ orgSelectorFieldRowOptions: Object.freeze([behaviorBinding("test/ticket-79-staff-selector-publish.test.ts#ticket 79: field.create STAFF_SELECTOR emits the observed publish-safe field-row shape", assertFieldContract)]),
178
+ relationMappingsSource: Object.freeze([behaviorBinding("test/form-scaffold.test.ts#form.draft propagates relation mappings into an existing draft", assertFieldContract)]),
179
+ propertyEmptyReadback: Object.freeze([behaviorBinding("test/field-property-empty-readback.test.ts#field.update reports committed and unverifiable write-only propertyEmpty", assertFieldContract)]),
180
+ listFace: Object.freeze([behaviorBinding("test/field-property-empty-readback.test.ts#field.list --full omits propertyEmpty when the platform row omits it", assertFieldContract)]),
173
181
  }),
174
182
  evidence: Object.freeze([
175
183
  "ticket 01-3 (2026-09-11): a DATE(3) field created without options.format 50000s on the first runtime save",
@@ -183,41 +191,42 @@ export const FIELD_LANE_CONTRACT = Object.freeze({
183
191
  "ticket 24 live (2026-09-12): FORMULA options readback + RELEVANCE_DATA create/publish/form-binding readback",
184
192
  "ticket 61 source (8.6.26): the runtime list face resolves a relation's displayed value from the field ROW's top-level relativePropertyCode, not options.displayField — QueryRuntimeController.java:1214-1226 (getRelativePropertyCode; empty → \"name\" data title); BizPropertyController create/update :851/:987 never auto-fill it, so every relation create/update must carry it",
185
193
  "capability-shape-spec.md: field-row and form-control options are declared once with required keys, defaults, and evidence; LOGICAL/ATTACHMENT/ADDRESS/HYPER_LINK/TIME are completed",
194
+ "ticket 79: DDL-intermediate transient retries (≤3, backoff 2s/5s) on a small-resource environment; after a failure wait ≥30s before retrying and never re-create the field",
186
195
  ]),
187
196
  tools: Object.freeze({
188
197
  "field.list": Object.freeze({
189
198
  scope: "create publish readback",
190
- description: "List draft/published fields of a model. 默认清单面:code/name/type(+typeName)/conditions 信号/shapeWarning——选项族整包 choices 不内联(实测选择字段 ~500B/行);验证 options/subSchema 用 code/fields 选择器或 full:true(readback face of the field family chain)。",
199
+ description: "List draft/published fields of a model. 默认面紧凑(整包 choices 不内联);验证 options/subSchema 用 code/fields 选择器或 full:true。",
191
200
  }),
192
201
  "field.create": Object.freeze({
193
202
  scope: "create publish readback",
194
203
  description: describeTool("Create a draft field on a model (bizproperty/create).", [
195
204
  "Field type must be one of the live-accepted families; nested child tables and OCR/ELECTRONIC_SIGN are out of coverage.",
196
205
  `Reserved/system codes are refused (code_reserved): ${[...RESERVED_CODES].join(", ")} — pick a business code (e.g. owner → taskOwner).`,
197
- "**mapping 类型兼容**(三层口径 r52):①拦截依据=设计器 `filterCondition`:长文本←长文本/短文本(单向);短文本/下拉/单选←同族;复选框/下拉多选←同族;**其余必须同型**。违反→`mapping-type-incompatible`。②设计器只过滤下拉:保存不复核、平台 `checkOptions` 缺 WORK_SHEET、运行期直接 put——绕过设计器可写违规组合。③后果:50000 或**静默损坏**(`→LOGICAL` 恒 false、`NUMERICAL→DATE` 丢 null、文本→人员/关联=悬空 id、多值→单选串进单值列、`→COMMENT/OCR/SIGN/RELEVANCE_DATA` 不落库)。④映射只在关联单选建记录时生效;`data.save/submit` 不跑映射。",
206
+ "**mapping 类型兼容**(三层口径):①拦截依据=设计器 `filterCondition`:长文本←长文本/短文本(单向);短文本/下拉/单选←同族;复选框/下拉多选←同族;**其余必须同型**。违反→`mapping-type-incompatible`。②设计器只过滤下拉:保存不复核、平台 `checkOptions` 缺 WORK_SHEET、运行期直接 put——绕过设计器可写违规组合。③后果:50000 或**静默损坏**(`→LOGICAL` 恒 false、`NUMERICAL→DATE` 丢 null、文本→人员/关联=悬空 id、多值→单选串进单值列、`→COMMENT/OCR/SIGN/RELEVANCE_DATA` 不落库)。④映射只在关联单选建记录时生效;`data.save/submit` 不跑映射。",
198
207
  "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.",
199
208
  "For a relation pass `relativeCode` and `options` (schemaCode/displayField/...). `searchFormula` and `conditions` are JSON strings for the relation data restriction/query conditions.",
200
209
  "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:\"\".",
201
210
  "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)。",
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 已由表单脚手架写入控件面),不出现在字段行。",
211
+ "org 选人族(STAFF_SELECTOR 等 5/50/51/60/61)字段行 options 由工具写成发布安全形状(形状与读面键见 contract field 的 orgSelectorFieldRowOptions)。deptVisible/multi 是**表单控件面**判别键(disposeUpdateType/updateSelectionType 读 control.options,票 69 已由表单脚手架写入控件面),不出现在字段行。",
203
212
  ]),
204
213
  }),
205
214
  "field.update": Object.freeze({
206
215
  scope: "create publish readback",
207
216
  description: describeTool("Update an existing field (bizproperty/update) — merges `options` (and optional `choices`/`relativeCode`) onto the current draft/published record.", [
208
- "**不切换 propertyType**:field.update 传 propertyType 会被静默忽略(errcode 0 但类型不变,r6 实证 2026-10-10)——已发布字段改类型只能 field.delete + field.create 重建(mapping 类型兼容见 field.create 的 mappings 说明)。choices 只对文本单选族(RADIO/DROPDOWN_BOX 等)合法,传给其它类型会被出门校验拒。",
217
+ "**不切换 propertyType**:field.update 传 propertyType 会被静默忽略(errcode 0 但类型不变)——已发布字段改类型只能 field.delete + field.create 重建(mapping 兼容见 field.create)。choices 只对文本单选族(RADIO/DROPDOWN_BOX 等)合法,传给其它类型会被出门校验拒。",
209
218
  "字典-backed 可用 `syncDictionary:true` 重填 useDictionariesData;readback 带 face:\"draft\"。",
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 手动链才安全)。",
219
+ "**关联填充映射的事实源是字段行 `options.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 手动链才安全)。",
211
220
  "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 无需重建表单)。",
221
+ "数值显示格式可改:`options.format`(白名单)用平台常量(全表见 contract 的 numericalFormat),别名 percent/currency 会归一。字段行 format 优先于表单控件,改完 `field.publish` 即生效(无需重建表单)。",
213
222
  "表单条件(`options.requiredFormula`(必填)/`readonlyCondition`(只读)/`displayFormula`(显示))会**自动配对**一条 `bizdatarule` type3/4/5 行:门户**运行时**读字段 options,表单设计器**设计态** Set/Unset 读 `bizdatarule/list`——只写 options 会让设计器显示 Unset。readback.formConditionSync 报 created/updated/deleted/skipped;清空条件传空串(如 requiredFormula:\"\")会同时删规则行;字段未发布时只写 options 并在 skipped 说明原因。",
214
223
  "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).",
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.",
224
+ "form.publish(rebuild:true) 可不重碰字段地做同样的表单侧刷新。",
216
225
  ]),
217
226
  }),
218
227
  "field.publish": Object.freeze({
219
228
  scope: "create publish readback",
220
- description: "Publish the model's draft fields (bizproperty/publish). **Model-scoped**: one call publishes every draft field — never once per field. Optional `code`/`codes` verify published face; readback 回 `publishedCodes`。`codes` 短路须草稿/发布 options 一致,否则真发布。formBinding 可含 dictionaryStale / relation-mappings-empty。瞬态重试(ticket 79):异常小资源下 DDL 中间态自动重试≤3(退避 2s/5s);仍失败等≥30s 再发,勿重复建字段。**部分交付口径**:有请求的 code 不在发布面时 `allRequestedPresent:false` + `verified:false` + `readback.present:false`(共享写门据此把 deliveryState 降为 WRITE_UNVERIFIED)+ `unpublishedRequested`,并区分 `nonexistentCodes`(草稿面都没有——先 field.list 核对)与 `stillDraftCodes`(模型里有、发布后仍不在发布面)——已发布的字段仍然算发布了,但不要只看 ok/DELIVERED。",
229
+ description: "Publish the model's draft fields (bizproperty/publish). **Model-scoped**: one call publishes every draft field — never once per field. Optional `code`/`codes` verify published face; readback 回 `publishedCodes`。`codes` 短路须草稿/发布 options 一致,否则真发布。formBinding 可含 dictionaryStale / relation-mappings-empty。瞬态重试:DDL 中间态自动重试≤3(退避 2s/5s);仍失败等≥30s 再发,勿重复建字段。**部分交付口径**:有请求的 code 不在发布面时 `allRequestedPresent:false` + `verified:false` + `readback.present:false`(共享写门据此把 deliveryState 降为 WRITE_UNVERIFIED)+ `unpublishedRequested`,并区分 `nonexistentCodes`(草稿面都没有——先 field.list 核对)与 `stillDraftCodes`(模型里有、发布后仍不在发布面)——已发布的字段仍然算发布了,但不要只看 ok/DELIVERED。",
221
230
  }),
222
231
  "field.delete": Object.freeze({
223
232
  scope: "create publish readback",
@@ -692,7 +692,7 @@ export function registerFieldLane(tools) {
692
692
  choices: choicesArg,
693
693
  relativeCode: relativeCodeArg,
694
694
  subFields: subFieldArg,
695
- propertyEmpty: z.boolean().optional().describe("覆盖数据模型层的不可为空声明;传 false 可把历史误建的字段改回可为空(必填/只读应在表单与流程节点配置)。readback.committed 列出本次实际提交到线缆的键,readback.propertyEmpty 只在草稿面回读到该值时才出现(r32 真机:bizproperty/list 行不带 propertyEmpty,读不到即不编造,用 committed 确认本次提交)"),
695
+ propertyEmpty: z.boolean().optional().describe("覆盖数据模型层的不可为空声明;传 false 可把历史误建的字段改回可为空。读面不回该键,确认看 readback.committed(见 contract field 的 propertyEmptyReadback)"),
696
696
  syncDictionary: z
697
697
  .boolean()
698
698
  .optional()
@@ -13,7 +13,7 @@ export const FOLDER_WIRE = Object.freeze({
13
13
  delete: "POST /api/api/app/folders/delete?folderId=",
14
14
  }),
15
15
  defaults: "createFolder forces type=Folder, defaults parentId to the app package id (root) and does NOT reject duplicate names; updateFolder refuses parentId===id and only writes parentId when non-empty; deleteFolder refuses a non-empty folder (DIRECTORY_NOT_EMPTY) — delete is NOT recursive",
16
- tree: "apppackage/trees?appCode= returns a NESTED tree (folders carry children[]); reading only the top-level array makes a freshly created child folder look absent — flatten recursively and report path/depth; missing app → applicationExists:false + empty nodes (still ok); default folder marked isDefault via name_i18n.en=defaultGroup; BizModel gets displayPath",
16
+ tree: "apppackage/trees?appCode= returns a NESTED tree (folders carry children[]); reading only the top-level array makes a freshly created child folder look absent — flatten recursively and report path/depth (issue 2026-10-23: a create that answered errcode 0 looked like 'folder not created' when read from the top level); missing app → applicationExists:false + empty nodes (still ok); default folder marked isDefault via name_i18n.en=defaultGroup; BizModel gets displayPath",
17
17
  live: "2026-10-23 customer HAR replay: folders/create answered errcode 0 成功创建目录; after the token was attached apppackage/trees returned the full tree",
18
18
  customPage: "CustomPageController(8.6.26, @RequestMapping \"/api/custom\"): POST /create takes AppFunctionVO and requires parentId + a non-null menuPointType (getMenuPointType().toString() NPEs to 50000 otherwise) and forces type=Page; POST /page/content/update writes draftContent (existDraft=true) and /page/content/publish writes publishedContent (published=true); BOTH first do getAppFunctionByCode(code) and throw BIZ_SCHEMA_NOT_EXIST when the tree node is missing — node first, then body",
19
19
  });
@@ -198,7 +198,7 @@ function folderTools(tools) {
198
198
  kind: "read",
199
199
  lane: LANE,
200
200
  scope: T["folder.tree"].scope,
201
- description: "读取**应用树**(应用**内**目录/分组 + 模型节点;不是应用包本身——应用包用 app.*)。**递归展平**并给出每个节点的 `path`/`depth`(平台 `apppackage/trees?appCode=` 返回嵌套 children,只看顶层会误判“目录没建成”——issue 2026-10-23)。`foldersOnly:true` 只回目录(type=Folder)。目录 id 就是 folder.update/delete 与 model.move/model.create 的 `folderId/parentId`。不存在的应用回 `applicationExists:false` + 空树(仍 ok,不拒——与「存在但空」可区分)。平台自动建的默认分组节点带 `isDefault:true`(判据:name_i18n.en=defaultGroup)。",
201
+ description: "读取**应用树**(应用**内**目录/分组 + 模型节点;不是应用包本身——应用包用 app.*)。**递归展平**并给出每个节点的 `path`/`depth`(平台 `apppackage/trees?appCode=` 返回嵌套 children,只看顶层会误判“目录没建成”)。`foldersOnly:true` 只回目录(type=Folder)。目录 id 就是 folder.update/delete 与 model.move/model.create 的 `folderId/parentId`。不存在的应用回 `applicationExists:false` + 空树(仍 ok,不拒——与「存在但空」可区分)。平台自动建的默认分组节点带 `isDefault:true`(判据:name_i18n.en=defaultGroup)。",
202
202
  inputSchema: {
203
203
  environment: environmentArg,
204
204
  applicationCode: z.string().optional().describe("应用 code;省略用配置默认应用(别名:appCode)"),
@@ -15,14 +15,14 @@ export const FORM_WIRE = Object.freeze({
15
15
  publishAlreadyPublished: "published:true with force!==true skips as already-published",
16
16
  forceRepublish: "onlinejs.compose passes force:true so it can re-promote after a prior publish",
17
17
  emptyLayoutGuard: "ticket 74: the platform designer's Save is NOT lossless — it clears draftViewJson to \"[]\" and draftAttributesJson to \"{}\"; form.draft refuses CALLER-PROVIDED empty layouts (blocker form-empty-layout, zero wire, escape allowEmptyLayout:true) and form.publish refuses to promote a draft with fewer controls than the published face (blocker form-publish-degrade, escape allowDegrade:true); the recovery path is the form version history (/api/api/app/bizsheet/history/list) — fetch the intact version's view/attributes originals and rewrite the draft before publishing",
18
- formButtons: "form toolbar buttons are a three-layer configuration (live 2026-10-23, 1.1.25; shape corrected by GitLab #38 live 8.6.26 2026-11-16): (1) bizsheet.options.customButtonJson — a JSON ARRAY with each entry's actionConfig as an OBJECT (the designer's save shape; a STRINGIFIED array is double encoding the platform stores verbatim and the form page then silently drops every button — the pre-r72 CLI form, now unwrapped+healed on every write and linted via shapeWarning in readbacks) — is the authoring face; ModelManagementFacadeImpl.publishBizForm:1022 turns it into h_biz_button rows with triggerType=FORM, triggerCode=<formCode> at publish; (2) those rows are what ActionPermissionHandler.getByTriggerTypeAndCode(FORM, bizCode) reads; (3) whether a button shows at a node is filtered by the workflow activity's buttonPermission.customBtns[].enabled (the designer 表单操作 checkboxes) plus showPermCode; the execute face is POST /api/api/runtime/form/executeCustomButton {bizButtonModel, bizObjectList:[<full bizObject>], reacquireDataFromDb:true} — NOT the list-button launcher path with ids[]",
18
+ formButtons: "form toolbar buttons are a three-layer configuration (live 2026-10-23, 1.1.25; shape corrected by GitLab #38 live 8.6.26 2026-11-16): (1) bizsheet.options.customButtonJson — a JSON ARRAY with each entry's actionConfig as an OBJECT (the designer's save shape; a STRINGIFIED array is double encoding the platform stores verbatim and the form page then silently drops every button — the pre-r72 CLI form, now unwrapped+healed on every write and linted via shapeWarning in readbacks) — is the authoring face; ModelManagementFacadeImpl.publishBizForm:1022 turns it into h_biz_button rows with triggerType=FORM, triggerCode=<formCode> at publish; (2) those rows are what ActionPermissionHandler.getByTriggerTypeAndCode(FORM, bizCode) reads; (3) whether a button shows at a node is filtered by the workflow activity's buttonPermission.customBtns[].enabled (the designer 表单操作 checkboxes) plus showPermCode; the execute face is POST /api/api/runtime/form/executeCustomButton {bizButtonModel, bizObjectList:[<full bizObject>], reacquireDataFromDb:true} — NOT the list-button launcher path with ids[]; when executeCustomButton answers 10005, retry through the equivalent face rule.run (launcher/domain_service_runtime/<schema>/<rule> + ids[]) — the same bound rule is proven usable there (r28b live), so never loop on executeCustomButton; a newly authored button needs code/name/bindAction/operateType plus triggerCode/triggerType/showPermCode/showPermType + name_i18n (JSON string form) + addviewType (useLocation defaults to FORM; missing keys answer platform 40000)",
19
19
  actionsColumns: "ticket 100: draftActionsJson/publishedActionsJson are REAL bizsheet columns (BizForm.java:95-100 @SerializableField; BizFormModel.java:59-62 serialized by bizsheet/get) — the designer writes draftActionsJson on save and both faces on publish (frontend-dist/admin/js/4280.cfa75764.js offsets 193538/185347); form.get full:true surfaces them; publish promotes draftActionsJson → publishedActionsJson",
20
20
  sheetListFace: "form.list: GET /api/api/app/bizsheet/list?schemaCode= (BizFormController.java:137-152 → ModelManagementFacadeImpl.getBizForms:481-488) answers the BizFormHeaderModel HEADER projection only — code, name, schemaCode, published, formType, sortKey, icon. formType is the INTEGER index (@JsonValue getIndex(), BizFormType.java:45-48): 0 DEFAULT_SHEET / 1 CUSTOMIZE_SHEET / 2 PRINT_TEMPLATE — decoded to the name with formTypeIndex kept (ADR 0002). existDraft/buttonCount/hasCustomScript are NOT on this face, so the default read never fabricates them: detail:true pays 1+N bizsheet/get for the content-derived faces. published is the same platform flag bit (r79-04): publish→draft leaves it false while the content is intact — the flag is reported as-is, content judgement needs detail:true. HTTP 404 means the version family has no /list endpoint: the tool answers sheetListUnavailable:true + the default slot only, never a fabricated list; a 601003 业务模型不存在 refusal is modelPresent:false (zero retries)",
21
21
  });
22
22
  const FORM_GET_DESCRIPTION = '读取默认表单(bizsheet/get)的发布状态与控件清单(紧凑默认)。**发布态以返回的 `published` / `existDraft` 布尔为准**(`published:true`=已发布;`published:false,existDraft:true`=只有草稿,**未发布**)——不要用 `publishedControlCodes` 是否非空来推断(草稿字段会让它非空,误判为已发布)。**每个模型交付前其默认表单必须 `published:true`**:用 `configure_form` 或 `form.draft(rebuild:true)`+`form.publish` 发布,并逐模型 `form.get` 核对。`full:true` 还返回 `options` 与 `customButtonJson`(表单工具栏按钮,数组原样;库里是字符串脏形时附 `customButtonJsonShapeWarning`——线上 #38 前端按钮不渲染)。传 `controls:["code",…]` 只取指定控件的 options(如关联控件的 mappings);传 `full:true` 才返回 draft/published 的完整 view/attributes/html/actions JSON(actions 列为设计器保存/发布的表单级按钮动作)。体积大,仅在需要整体布局时用。';
23
- const FORM_DRAFT_DESCRIPTION = "Save the default-form DRAFT (bizsheet/update). Reads the current sheet, merges the caller's explicit draftViewJson/draftAttributesJson (or preserves the existing draft); when both are absent on a fresh default form, composes the designer-standard scaffold from the model's published fields. A redundant field (relation-mapping carry-through target) always stays bound; with no workflow it is hidden in the design (options.visible=false), with a workflow it stays visible for per-node propertyPermissions. Pass `draftHtmlJson` to thread custom online-script HTML through. Empty-layout guard: explicitly passing \"[]\"/\"{}\" view/attributes is refused (form-empty-layout) — the platform designer's Save is NOT lossless and clears drafts to exactly that shape; escape with allowEmptyLayout:true, and recover cleared drafts from the form version history (/api/api/app/bizsheet/history/list). **读回原样回写**:从 `form.get` 取回的 view/attributes 直接回传时加 `fromReadback:true`——工具会与已存草稿/发布面逐字比对,一致才放行(平台自身布局可能含子表列行/系统行默认宽度),被改动过的面照常按 validation 拒绝。**表单工具栏按钮**:`buttons`(数组)或 `customButtonJson`(原样字符串)写进 `biz_sheet.options.customButtonJson`(**数组+actionConfig 对象**,设计器同形——线上 #38:字符串形=双重编码,前端按钮不渲染,重写即自愈);**要到 form.publish 才生成 h_biz_button(triggerType=FORM)**,且表单页是否显示还取决于流程节点 `buttonPermission.customBtns[].enabled`(设计器「表单操作」勾选)。`useLocation` 用 FORM/ROW/LIST,表单工具栏按钮用 FORM。 **表单控件属性(含关联填充 mappings)从字段行派生**:改关联映射的事实源在字段 options.mappings(field.update → field.publish),直接改这里的控件映射会被平台按字段重算覆盖(真机 2026-10-14 实证);字段发布后如需刷新已发布表单的控件映射,用本工具 rebuild:false 重存(保留现有布局与在线JS)再 form.publish。";
23
+ const FORM_DRAFT_DESCRIPTION = "Save the default-form DRAFT (bizsheet/update). Reads the current sheet, merges the caller's explicit draftViewJson/draftAttributesJson (or preserves the existing draft); when both are absent on a fresh default form, composes the designer-standard scaffold from the model's published fields. A redundant field (relation-mapping carry-through target) always stays bound; with no workflow it is hidden in the design (options.visible=false), with a workflow it stays visible for per-node propertyPermissions. Pass `draftHtmlJson` to thread custom online-script HTML through. Empty-layout guard: explicitly passing \"[]\"/\"{}\" view/attributes is refused (form-empty-layout) — the platform designer's Save is NOT lossless and clears drafts to exactly that shape; escape with allowEmptyLayout:true, and recover cleared drafts from the form version history (/api/api/app/bizsheet/history/list). **读回原样回写**:从 `form.get` 取回的 view/attributes 直接回传时加 `fromReadback:true`——工具会与已存草稿/发布面逐字比对,一致才放行(平台自身布局可能含子表列行/系统行默认宽度),被改动过的面照常按 validation 拒绝。**表单工具栏按钮**:`buttons`(数组)或 `customButtonJson`(原样字符串)写进 `biz_sheet.options.customButtonJson`(**数组+actionConfig 对象**,设计器同形——线上 #38:字符串形=双重编码,前端按钮不渲染,重写即自愈);**要到 form.publish 才生成 h_biz_button(triggerType=FORM)**,且表单页是否显示还取决于流程节点 `buttonPermission.customBtns[].enabled`(设计器「表单操作」勾选)。`useLocation` 用 FORM/ROW/LIST,表单工具栏按钮用 FORM。字段发布后如需刷新已发布表单的控件映射,用本工具 rebuild:false 重存(保留现有布局与在线JS)再 form.publish。";
24
24
  const FORM_PUBLISH_DESCRIPTION = "Publish the default form (bizsheet/publish, proven shape: draft*Json promoted to published*Json verbatim) with published-face readback. **不影响在线 JS**:本工具只提拔布局草稿;改 JS 请用 onlinejs.compose(它自己会连同整张表单一起发布,不必再调本工具)。 Degrade guard: refuses to promote a draft carrying FEWER controls than the published face (form-publish-degrade) — the designer's Save clears drafts non-losslessly; recover via the form version history (/api/api/app/bizsheet/history/list) and rewrite the draft first, or pass allowDegrade:true to force the reduction. rebuild:true is the one-call refresh: discard the existing draft, re-scaffold from the published fields (non-structural control options preserved), then force-promote — use it after a field shape change. **表单工具栏按钮**:传 `buttons`(或 `customButtonJson`)→ 写进 `options.customButtonJson` 并在本次 publish 生成 `h_biz_button(triggerType=FORM, triggerCode=<formCode>)`(平台 `publishBizForm:1022`);`options.customButtonJson` 以**数组**写入(条目 `actionConfig` 为对象,设计器同形——线上 #38:字符串形=双重编码,前端按钮不渲染,回执给 formButtonsShapeWarning);表单页是否显示再由流程节点 `buttonPermission.customBtns[].enabled` 过滤。";
25
- const FORM_RUN_BUTTON_DESCRIPTION = "执行表单工具栏按钮(平台同款面:`POST /api/api/runtime/form/executeCustomButton`,body `{bizButtonModel, bizObjectList:[<完整业务对象>], reacquireDataFromDb:true}`)。**与列表行按钮不同**:列表按钮发 `launcher/domain_service_runtime/<schema>/<rule>` + `ids[]`(用 `rule.run`),表单按钮带**整条记录**,不能互换。按钮来源 `GET /api/api/system/getCustomButtons`(只列 triggerType=FORM 的 h_biz_button)。前提:按钮已由 `form.publish` 的 `buttons`/`customButtonJson` 生成。返回是执行结果信封,规则副作用用 `data.load` 另读;被规则 UPDATE 的目标行须是 COMPLETED(引擎查不到 DRAFT)。`302045` = 数据被占用。**`10005` 执行失败时优先换等价面 `rule.run`(launcher/domain_service_runtime/<schema>/<rule> + ids[])**——同一绑定规则在 rule.run 面已验证可用(r28b 实证),不要在 executeCustomButton 上反复重试。";
25
+ const FORM_RUN_BUTTON_DESCRIPTION = "执行表单工具栏按钮(平台同款面:`POST /api/api/runtime/form/executeCustomButton`,body `{bizButtonModel, bizObjectList:[<完整业务对象>], reacquireDataFromDb:true}`)。**与列表行按钮不同**:列表按钮发 `launcher/domain_service_runtime/<schema>/<rule>` + `ids[]`(用 `rule.run`),表单按钮带**整条记录**,不能互换。按钮来源 `GET /api/api/system/getCustomButtons`(只列 triggerType=FORM 的 h_biz_button)。前提:按钮已由 `form.publish` 的 `buttons`/`customButtonJson` 生成。返回是执行结果信封,规则副作用用 `data.load` 另读;被规则 UPDATE 的目标行须是 COMPLETED(引擎查不到 DRAFT)。`302045` = 数据被占用。**`10005` 换等价面 `rule.run`(见 contract form),勿反复重试。**";
26
26
  const CONFIGURE_FORM_DESCRIPTION = "High-level: bind fields into the default form and publish it (form.draft → form.publish), subject to the write permission gate. Delegates to the proven form.draft scaffold + form.publish paths so the real empty-form layout (and any caller-supplied draftHtmlJson) is persisted and promoted — never bypasses with a shortcut body. `sheetCode` is optional: omitted means the model's default sheet (sheetCode = schemaCode).";
27
27
  const FORM_LIST_DESCRIPTION = "列出模型的多张表单(`/api/api/app/bizsheet/list?schemaCode=`,header-only 投影):每行 `sheetCode`/`name`/`formType`(整数索引解码为名字,另带 formTypeIndex)/`published`。默认只发 1 次 wire;`detail:true` 才逐面 `bizsheet/get`(上限 maxSheets=12,超出回 partial+omittedSheets)补 existDraft/controlCount/buttonCount/publishedActionCount/hasCustomScript/faces。**默认面不伪造这些内容推导键,也不改旗标**:`published` 是平台旗标位(publish→draft 后它为 false 而内容俱在),判「有没有发布面内容」用 detail:true 的 faces。业务模型不存在 → modelPresent:false;该版本族无 /list 端点(HTTP 404)→ sheetListUnavailable:true + 只回默认槽(明确标注是推断,不是清单)。`defaultSheetCode` 由清单推导(formType=DEFAULT_SHEET 且 sheetCode===schemaCode),权威仍是 form.get 的显式 sheetCode。";
28
28
  export const FORM_LANE_CONTRACT = Object.freeze({
@@ -564,7 +564,7 @@ export function registerFormLane(tools) {
564
564
  buttons: z
565
565
  .array(z.record(z.unknown()))
566
566
  .optional()
567
- .describe("表单工具栏按钮(写进 biz_sheet.options.customButtonJson;publish 时才生成 h_biz_button(triggerType=FORM))。每条至少 code/name/bindAction/operateType,useLocation 默认 FORM;新建还需 triggerCode/triggerType/showPermCode/showPermType + name_i18n(JSON 串形)+ addviewType,缺则平台 40000(#38 实证);code 语义化"),
567
+ .describe("表单工具栏按钮(写进 biz_sheet.options.customButtonJson;publish 时才生成 h_biz_button(triggerType=FORM))。每条必填键见 contract form 的 formButtons;code 语义化"),
568
568
  customButtonJson: z.string().optional().describe("buttons 的原样 JSON 数组字符串(与 buttons 互斥;用于把 form.get 读回值直接回写)"),
569
569
  buttonsMode: z.enum(["merge", "replace"]).optional().describe("默认 merge:按 code 增量 upsert(改一个按钮不必重发全表);replace:整表替换"),
570
570
  removeButtonCodes: z.array(z.string().min(1)).optional().describe("要删除的按钮 code(仅 merge 模式)"),
@@ -7,7 +7,7 @@ import { mergeActions, PLATFORM_DEFAULT_LIST_ACTIONS } from "./list-view-shapes.
7
7
  * single source for the handler descriptions and the coverage declarations.
8
8
  */
9
9
  export const LIST_VIEW_WIRE = Object.freeze({
10
- createBody: "query/create body {schemaCode, name, code, type:'LIST', showOnPc:false, published:false} (forced design-time defaults)",
10
+ createBody: "query/create body {schemaCode, name, code, type:'LIST', showOnPc:false, published:false} (forced design-time defaults); code is required by the platform — a missing code is refused with errcode 10005 「编码不能为空」 on a wasted live round trip (r26 live), so the tool fills schemaCode when code is omitted",
11
11
  createReadback: "query/get_header readback",
12
12
  configureDefault: "code omitted means the default view (code=schemaCode)",
13
13
  configureColumns: "query/get then query/update: for each fieldCodes entry, append a missing column as visible, or repair an existing column's name/propertyType/displayFormat/visible in place (never skip an already-present column), then query/get readback; propertyType comes from published field metadata; NUMERICAL displayFormat is derived from the field's 0-based `options.scale` (0=integer,1=1dp,2=2dp,3=3dp…8=8dp) through the platform parseNumber table ({0:1,1:2,2:3,3:11,4:12,23:…, percent 0..:4/5/6/13/14/27..30, currency ¥ 2dp..:7/15/16/31..34} — verified live: scale 2 → displayFormat 3 = 2 decimals) and DATE displayFormat from options.format (1=yyyy-MM-dd,2=datetime,3=minute,4=yyyy-MM); the readback columns array carries {propertyCode,propertyType,displayFormat,visible,sumType} and added/updated name the fieldCodes touched",
@@ -126,7 +126,7 @@ export const LIST_VIEW_LANE_CONTRACT = Object.freeze({
126
126
  }),
127
127
  "listview.configure": Object.freeze({
128
128
  scope: LIST_VIEW_SCOPE,
129
- description: "(**列汇总**:数值列 `sumType` wire 为整数——0=不统计/1=求和/2=平均/3=最小/4=最大/5=计数,写进 presentation.columnsJson 的列对象,8.6.26 反编译 SumType 实证)配置列表视图。**code 语义(与配方 configure-default-list 同口径,r60a-F13 真机对齐 2026-11-13;r73 #6 真机对齐 2026-11-17)**:省略 `code`(或 code=schemaCode)= 配置**默认视图**——默认视图 code = 模型 code,同样可 configure(8.6.41 实测),日常配列就用它,**不要先 listview.create**(会多一个视图);改默认视图影响所有用户`listview.create` 只在确实需要**第二个**视图时使用,此时 listview.configure 带 code 指向它。在既有(默认)列表视图上配置列、排序、查询条件、行/列表按钮、呈现、自定义按钮、视图头扩展选项与视图类型:读回 query,按 `fieldCodes` 追加缺失列或**原地修正**已存在列的 name/propertyType/displayFormat/visible(不再跳过既有列),置为可见;数值列 displayFormat 由字段 0 基 `options.scale` 推导(0=整数,1=1位,2=2位,3=3位…8=8位;实测 scale 2 → displayFormat 3 = 两位小数)、日期列由 `options.format` 推导(1/2/3/4),回显 `columns` 为完整列对象并给出 `added`/`updated`;`sorts`→querySorts(direction ASC/DESC)、`conditions`→queryConditions(**比较符是 `filterType`(QueryFilterType 字符串枚举 Eq/NotEq/…;别名 operator/op;省略时按 propertyType 取平台默认)**、displayType/choiceType/options 字符串解码;写后条件回读等价校验给出 conditionReadback)、`actions`→queryActions(queryActionType QUERY(1)…BATCH_SUBMIT(23)、associationType BIZSHEET(0)/WORKFLOW(1))、`presentation`→queryPresentation(htmlJson/actionsJson/columnsJson/queryViewDataSource/schemaRelations/options 均为 JSON 字符串,合法 JSON 读回解码)、`buttons`→customButtons(写面 customButtonJson JSON 数组字符串;bindAction/useLocation/operateType/showPermType 以枚举名发送;triggerType 强制 QUERY、triggerCode=视图 code、sortKey 按数组位,缺省回传读面 customButtons 有效集;ADD_DATA/FORM 目标绑定走 actionConfig——schemaCodeVal+formListData+configureList,targetCode/targetObjCode 对其无效会被拒;高层参数 targetModel/targetForm/configureList 从读回元数据展开,未解析即 listview-button-target-unresolved 零副作用拒)、`options`→视图头 BizQueryOption(`pagingSetting`{pageSize,showTotal} 分页、`listViewModeSetting`{mode,canSwitch} 列表模式,缺省回传读面有效 options、提供时整体替换,rowColorSetting 无 8.6.26 类证据故对象形态拒绝)与 `presentationType`→QueryPresentationType(LIST/BOARD/CALENDAR/GANTT,缺省回传读面有效值;GANTT 必须同时提供 `gantt`→queryGanttModel 且 startTimePropertyCode/endTimePropertyCode/titlePropertyCode 非空,缺省不触碰既有 gantt)与 `queryLayer`→层级展示(BizQueryLayer[] 数组原样发送)及 `multiTableHeaderConfig`→多级表头(HeaderConfig[] JSON 字符串;缺省回传读面有效值、提供时整体替换)省略时不触碰既有值,提供时整体替换并经出门前 dry-lint;`query/update` 后回读(`query/get` 自动注入的默认动作、平台 sortKey 重排与 schemaRelations 派生需还原)。`code` 省略时用默认视图(=schemaCode)。`queryConditionMap` 为只读派生(query/get 带 formCode 子表条件时才出现),非配置输入。**发布语义**:`query/update` 自动置 publish=TRUE——视图无草稿/发布两态、无需独立发布步骤(与表单/规则的 draft→publish 不同)。**依赖顺序**:视图与表单脚手架都依赖**已发布字段**,规范顺序 model.create → field.create → field.publish(模型级)→ form.draft → form.publish →(需要第二视图时 listview.create)→ listview.configure → rule.save → rule.enable → workflow。",
129
+ description: "配置列表视图(列、排序、查询条件、行/列表按钮、呈现、自定义按钮、视图头扩展选项与视图类型)。**code 语义**:省略 `code`(或 code=schemaCode)= 配置**默认视图**(code = 模型 code,8.6.41 起默认视图同样可 configure),日常配列就用它,**不要先 listview.create**(会多一个视图);改默认视图影响所有用户;仅需第二个视图时才 listview.create(configure 带 code 指向它)。读回 query,按 `fieldCodes` 追加缺失列或**原地修正**已存在列的 name/propertyType/displayFormat/visible(不再跳过既有列),置为可见;数值列 displayFormat 由字段 0 基 `options.scale` 推导(0=整数,1=1位,2=2位,3=3位…8=8位)、日期列由 `options.format` 推导(1/2/3/4),回显 `columns` 为完整列对象并给出 `added`/`updated`;`sorts`→querySorts(direction ASC/DESC)、`conditions`→queryConditions(**比较符是 `filterType`(QueryFilterType 字符串枚举 Eq/NotEq/…;别名 operator/op;省略时按 propertyType 取平台默认)**、displayType/choiceType/options 字符串解码;写后条件回读等价校验给出 conditionReadback)、`actions`→queryActions(queryActionType QUERY(1)…BATCH_SUBMIT(23)、associationType BIZSHEET(0)/WORKFLOW(1))、`presentation`→queryPresentation(htmlJson/actionsJson/columnsJson/queryViewDataSource/schemaRelations/options 均为 JSON 字符串,合法 JSON 读回解码)、`buttons`→customButtons(写面 customButtonJson JSON 数组字符串;bindAction/useLocation/operateType/showPermType 以枚举名发送;triggerType 强制 QUERY、triggerCode=视图 code、sortKey 按数组位,缺省回传读面 customButtons 有效集;ADD_DATA/FORM 目标绑定走 actionConfig——schemaCodeVal+formListData+configureList,targetCode/targetObjCode 对其无效会被拒;高层参数 targetModel/targetForm/configureList 从读回元数据展开,未解析即 listview-button-target-unresolved 零副作用拒)、`options`→视图头 BizQueryOption(`pagingSetting`{pageSize,showTotal} 分页、`listViewModeSetting`{mode,canSwitch} 列表模式,缺省回传读面有效 options、提供时整体替换,rowColorSetting 无 8.6.26 类证据故对象形态拒绝)与 `presentationType`→QueryPresentationType(LIST/BOARD/CALENDAR/GANTT,缺省回传读面有效值;GANTT 必须同时提供 `gantt`→queryGanttModel 且 startTimePropertyCode/endTimePropertyCode/titlePropertyCode 非空,缺省不触碰既有 gantt)与 `queryLayer`→层级展示(BizQueryLayer[] 数组原样发送)及 `multiTableHeaderConfig`→多级表头(HeaderConfig[] JSON 字符串;缺省回传读面有效值、提供时整体替换)省略时不触碰既有值,提供时整体替换并经出门前 dry-lint;`query/update` 后回读。`queryConditionMap` 为只读派生(query/get 带 formCode 子表条件时才出现),非配置输入。**发布语义**:`query/update` 自动置 publish=TRUE——视图无草稿/发布两态、无需独立发布步骤。**依赖顺序**:视图与表单脚手架都依赖**已发布字段**,规范顺序 model.create → field.create → field.publish(模型级)→ form.draft → form.publish →(需要第二视图时 listview.create)→ listview.configure → rule.save → rule.enable → workflow。",
130
130
  }),
131
131
  "listview.delete": Object.freeze({
132
132
  scope: LIST_VIEW_SCOPE,
@@ -612,7 +612,7 @@ export function registerListViewLane(tools) {
612
612
  inputSchema: {
613
613
  schemaCode: z.string().min(1),
614
614
  name: z.string().min(1),
615
- code: z.string().optional().describe("视图 code;省略时**默认取 schemaCode**(与 listview.get / listview.list / rollback 的默认视图口径一致)。平台侧 code 必填,本工具会替你填,不要再依赖不回执的猜测(r26 真机:不传直接被 errcode 10005「编码不能为空」拒绝,白跑一轮线上往返)"),
615
+ code: z.string().optional().describe("视图 code;省略时默认取 schemaCode。平台必填,由本工具代填(案卷见 contract list-view 的 createBody)"),
616
616
  },
617
617
  execute: async (session, args) => {
618
618
  // r26 真机:`code` 在 schema 里可选,但三处读面/rollback 都用
@@ -475,7 +475,7 @@ export function registerOrganizationLane(tools) {
475
475
  search: { intents: ["新建角色组", "建一个角色组", "创建角色分组"] },
476
476
  lane: LANE,
477
477
  scope: SCOPES.groupCreate,
478
- description: "创建角色组(`POST organization/role/add_role_group`)。返回 roleGroupId,角色挂在它下面。**corpId 默认写当前企业**(`session.enterpriseId()`):平台的 `corpId` 只从 body 取,body 缺省时才按 parentId 反查企业设置,查不到就 NPE(被吞成 errcode 0);`corpId=\"other\"` 是平台合法的「非组织分组」语义,只有明确要建非组织分组时才传。**parentId 必填**:空值会 50000;根级组请传 `\"0\"`(真机 1.1.25 实测可建根级,path=组名、不挂在既有组下);挂到既有组下则传该组 id(`org.role.list` 的 groups[].id)。创建回执会再读一次 role/list,补上真实 `code`/`parentId`/`path`(平台 add 瞬间 code 常为 null)。",
478
+ description: "创建角色组(`POST organization/role/add_role_group`)。返回 roleGroupId,角色挂在它下面。**corpId 默认写当前企业**(`session.enterpriseId()`):平台的 `corpId` 只从 body 取,body 缺省时才按 parentId 反查企业设置,查不到就 NPE(被吞成 errcode 0);`corpId=\"other\"` 是平台合法的「非组织分组」语义,只有明确要建非组织分组时才传。**parentId 必填**:空值会 50000;根级组请传 `\"0\"`(path=组名);挂到既有组下则传该组 id(`org.role.list` 的 groups[].id)。创建回执会再读一次 role/list,补上真实 `code`/`parentId`/`path`(平台 add 瞬间 code 常为 null)。",
479
479
  inputSchema: {
480
480
  roleGroupName: z.string().min(1).describe("角色组名称(界面显示的分组名)"),
481
481
  parentId: z.string().min(1).describe("上级角色组 id。**必填**:空值直接 50000 parentIds cannot be empty。根级组传 \"0\";挂到既有组下传该组 id(如「默认」组)。挂到既有组=给该组添子节点(会改既有组的层级语义)"),
@@ -524,7 +524,7 @@ export function registerOrganizationLane(tools) {
524
524
  search: { intents: ["建角色", "新建角色", "创建角色"] },
525
525
  lane: LANE,
526
526
  scope: SCOPES.roleCreate,
527
- description: "创建角色(界面「分组」;`POST organization/role/add_role`)。返回 roleId;code 创建时 null、随后补 SYS<时间戳>,要稳定编码就传 code。**所属角色组推荐用 `roleGroupCode`(如 SYS_1000000)**:`org.role.list` 的紧凑码表只给 `code|name`、不显示组 id,而平台对错的 roleGroupId **静默接受**——存进去的值不是真实组 id 时角色会变成看不见的孤儿(r70 实测:在库里、role/users 查得到,role/list 永不返回、role/get 50000)。工具会把 code 归一成真实 id,并在创建后回读可见性。",
527
+ description: "创建角色(界面「分组」;`POST organization/role/add_role`)。返回 roleId;code 创建时 null、随后补 SYS<时间戳>,要稳定编码就传 code。**所属角色组推荐用 `roleGroupCode`(如 SYS_1000000)**:`org.role.list` 的紧凑码表只给 `code|name`、不显示组 id,而平台对错的 roleGroupId **静默接受**——会变成看不见的孤儿角色。工具会把 code 归一成真实 id,并在创建后回读可见性。",
528
528
  inputSchema: {
529
529
  roleName: z.string().min(1),
530
530
  roleGroupCode: z.string().min(1).optional().describe("所属角色组的 code(org.role.list 的 groups 码表,如 SYS_1000000)或名称。**推荐**;与 roleGroupId 二选一"),
@@ -867,7 +867,7 @@ export function registerOrganizationLane(tools) {
867
867
  search: { intents: ["新建员工", "加一个用户", "创建员工账号", "加人"] },
868
868
  lane: LANE,
869
869
  scope: SCOPES.userCreate,
870
- description: "新建员工账号(`POST organization/user/add`)。必填 name/username/departmentId;工具自动补 `userLabelIds:[]`、`userManagerConfigList:[]`、`roleIds:[]` —— 平台 dealUserLabel 对 null 直接 NPE(50000,真机 1.1.25)。返回 userId(recId);初始密码由平台默认策略生成。",
870
+ description: "新建员工账号(`POST organization/user/add`)。必填 name/username/departmentId;返回 userId(recId);平台不接受的 null 数组由工具补齐,初始密码由平台默认策略生成。",
871
871
  inputSchema: {
872
872
  name: z.string().min(1),
873
873
  username: z.string().min(1).describe("登录账号"),
@@ -923,7 +923,7 @@ export function registerOrganizationLane(tools) {
923
923
  search: { intents: ["改员工信息", "修改用户资料", "更新员工"] },
924
924
  lane: LANE,
925
925
  scope: SCOPES.userUpdate,
926
- description: "改员工(`POST organization/user/modify`)。先 user/info 读现状再合并;工具强制补 `deptIds:[]` 等四个数组——平台 modified 对 null 的 deptIds 直接 NPE(50000,真机 1.1.25)。可改姓名/部门/手机/邮箱/角色/启停。",
926
+ description: "改员工(`POST organization/user/modify`)。先 user/info 读现状再合并;平台不接受的 null 数组由工具补齐。可改姓名/部门/手机/邮箱/角色/启停。",
927
927
  inputSchema: {
928
928
  userId: z.string().min(1),
929
929
  name: z.string().optional(),
@@ -1059,7 +1059,7 @@ export function registerOrganizationLane(tools) {
1059
1059
  search: { intents: ["删除角色", "删掉这个角色"] },
1060
1060
  lane: LANE,
1061
1061
  scope: SCOPES.roleDelete,
1062
- description: "删除角色(`GET organization/role/strike_out_role?ids=`)。平台**拒绝删除仍有成员的角色**(`-1 角色下已经包含用户数据!`,实测 1.1.25):默认先读成员并拒绝;拒绝回执带可直接粘贴的 `org.role.removeUsers` 命令。`force:true` 的语义是**先逐人移出全部成员,再删除角色**(不是强行绕过平台校验)。**可用 roleCode 代替 roleId**(org.role.list 的码表只有 code)。",
1062
+ description: "删除角色(`GET organization/role/strike_out_role?ids=`)。平台**拒绝删除仍有成员的角色**:默认先读成员并拒绝;拒绝回执带可直接粘贴的 `org.role.removeUsers` 命令。`force:true` 的语义是**先逐人移出全部成员,再删除角色**(不是强行绕过平台校验)。**可用 roleCode 代替 roleId**(org.role.list 的码表只有 code)。",
1063
1063
  inputSchema: {
1064
1064
  roleId: z.string().min(1).optional().describe("角色 id(32 位 hex);与 roleCode 二选一"),
1065
1065
  roleCode: z.string().min(1).optional().describe("角色 code(org.role.list 的 roles 码表,如 qc_manager)或名称"),
@@ -1192,7 +1192,7 @@ export function registerOrganizationLane(tools) {
1192
1192
  search: { intents: ["给角色加用户", "角色加成员", "给角色加人"] },
1193
1193
  lane: LANE,
1194
1194
  scope: SCOPES.addUsers,
1195
- description: "加成员并(可选)一次设好管理范围(`add_role_user` + 逐人 `update_ouscope`,一个工具调用)。users[].id 必须是 recId(org.user.search 的 id);传 `scopes` 会应用到本次新增的每个人。**平台的 add_role_user 虽然收 `ouScope` 但会忽略它**(实测 1.1.25,回读仍为空),所以范围必须单独写——工具内部已按顺序完成。加完回读成员与范围。",
1195
+ description: "加成员并(可选)一次设好管理范围(`add_role_user` + 逐人 `update_ouscope`,一个工具调用)。users[].id 必须是 recId(org.user.search 的 id);传 `scopes` 会应用到本次新增的每个人。加完回读成员与范围(`add_role_user` 不写 `ouScope`,范围由工具另写)。",
1196
1196
  inputSchema: {
1197
1197
  roleId: z.string().min(1).optional().describe("角色 id(32 位 hex);与 roleCode 二选一"),
1198
1198
  roleCode: z.string().min(1).optional().describe("角色 code(org.role.list 的 roles 码表)或名称——省掉取 artifact 找 id"),
@@ -1275,7 +1275,7 @@ export function registerOrganizationLane(tools) {
1275
1275
  search: { intents: ["把角色里的用户移掉", "角色移除用户"] },
1276
1276
  lane: LANE,
1277
1277
  scope: SCOPES.removeUsers,
1278
- description: "把成员移出角色(`POST organization/role/strike_out_role_user`)。**平台要求 JSON body `{roleId,userIds:[...]}`**——用 query 或 `ids` 会报 10009 `Required request body is missing`(实测 1.1.25)。只移出角色,不删用户。",
1278
+ description: "把成员移出角色(`POST organization/role/strike_out_role_user`)。工具按平台要求的 JSON body `{roleId,userIds:[...]}` 发送。只移出角色,不删用户。",
1279
1279
  inputSchema: {
1280
1280
  roleId: z.string().min(1).optional().describe("角色 id(32 位 hex);与 roleCode 二选一"),
1281
1281
  roleCode: z.string().min(1).optional().describe("角色 code(org.role.list 的 roles 码表)或名称"),
@@ -11,7 +11,7 @@ import { LANES } from "./lane-ids.js";
11
11
  export const REPORT_WIRE = Object.freeze({
12
12
  surface: "报表是两层:平台通道 /api/api/report/* 维护报表页(app 功能树 type=Report,errcode 信封);BI 通道 /dashboard/v1/* 维护 dashboard 配置与图表(成功 {data},失败 {errorCode,errorMessage,errorType:BIZ},HTTP 仍 200)。BI 的 objectId = report/get 的 data.id(首次保存后 reportObjectId 同值)。",
13
13
  authConfig: "BI 每个请求 body 必须带 config:{token,reportCode,appCode} 与外层 corpId(实测缺 config 的写会返回 {data:true} 但不生效——静默 no-op);token 取会话登录 token,corpId 为该部署 BI corp id(aozhe 实测 \"a\")。平台通道照旧 Authorization + X-LowCode-Corpid。",
14
- reportPage: "report/create body {code,name,name_i18n:'{\"zh\":\"...\"}',parentId:<folder id>,icon,pcAble,mobileAble,appCode}(parentId 必填,否则断言失败);report/update 同形再加 id;report/logical_delete?code=。",
14
+ reportPage: "report/create body {code,name,name_i18n:'{\"zh\":\"...\"}',parentId:<folder id>,icon,pcAble,mobileAble,appCode}(parentId 必填,否则断言失败);report/update 同形再加 id;report/logical_delete?code=。code 上限 28 字符:超长由平台 10005 拒(r33 实证),工具按 max(28) 在提交前本地拒绝。",
15
15
  reportPageSave: "report/v2/reportpage body {report:{objectId,title,attributes:'<json字符串>',global:'<json字符串>'},corpId,config} → {data:'<objectId>'};用于首次创建 BI dashboard(全新报表页在 BI 侧不存在,需先 save 再读写图表)。",
16
16
  chartWrite: "chart/addChart body {charts:[...]}、chart/updateChart body {charts:[...]}、chart/removeCharts body {objectIds:[<chart uuid>...]}、chart/removeChart body {objectId:<uuid>}(均需 corpId+config)。图表字段 uuid/type/position/dataSourceId/mainTable/data 等,position/data/styles 多为 JSON 字符串。",
17
17
  globalAttributes: "report/saveGlobal body {objectId,global}、report/saveAttributes body {attributes,objectId}(均需 corpId+config);global/attributes 自身是 JSON 字符串。",
@@ -592,7 +592,7 @@ export function registerReportLane(tools) {
592
592
  inputSchema: {
593
593
  // r33: the platform refuses report codes longer than 28 chars (errcode
594
594
  // 10005) — enforce offline so the shape never costs a wire round trip.
595
- code: z.string().min(1).max(28).describe("报表 code;平台上限 28 字符(10005 实证 r33)——超长在提交前直接被拒"),
595
+ code: z.string().min(1).max(28).describe("报表 code;平台上限 28 字符,超长提交前即拒(errcode 10005)"),
596
596
  name: z.string().min(1).max(60),
597
597
  appCode: z.string().min(1),
598
598
  parentId: z
@@ -8,7 +8,7 @@ export function dataListDescription() {
8
8
  return `按简化过滤 DSL 查询业务对象(runtime/query/list);DSL 在 CLI 内翻译为平台 queryCondition(${wire.dslShape}),并按发布字段元数据为每个条件注入 propertyType(未知过滤字段将被拒绝,可用 rawCondition 逃生);响应行在 items[],业务字段在 items[].fields.<code>(不是 rows[],也不是 item 顶层——--jq 常用 items[].fields.sku);空模型返回空列表;未配列的自定义字段投影为 null——这是显示面缺列配置、不是数据缺失(data.load 有值),显式选列在结果中全为 null 而发布字段元数据显示其存在时,readback 追加 projectionHint(先用 listview.configure 配置该模型的默认视图列,或用 data.load 读单条权威值)。`;
9
9
  }
10
10
  export function dataAggregateDescription() {
11
- return `临时计数/分组统计(纯读,metric=count)。count:runtime/query/list size:1 读 totalElements(服务端精确,不受 cap 1000 影响;带 filter 2 wire=1 field.list 注入 propertyType+1 list)。groupBy 单列且值域可枚举(field.list options/字典)→ 值域×count(V+3 wire:1 metadata+1 base+V 桶+1 isnull),桶按 count 降序取 topN(默认 10/上限 20),截断给 truncatedBuckets/bucketsTruncatedCount,null 单列 nullBucket。不可枚举(自由文本/高基数)→ 1 列投影 all:true(cap 1000)本地计数,coverage.mode=local-scan+missingCount+capNotice,**永不外推行数**。filter.draftPolicy:groupBy 默认 includeDrafts:false 注入 sequenceStatus≠DRAFT(excluded)统一双口径;count 省略=平台默认(无条件下含草稿 included、带条件排草稿 excluded);显式 false 可强制排除。边界:临时问句用本工具;持久图表/看板用 report.chartdata,视图汇总列用 sumType,写时计算用 datarule type2。`;
11
+ return `临时计数与数值聚合(纯读,metric=count|sum|avg|min|max)。count:runtime/query/list size:1 读 totalElements(服务端精确,不受 cap 1000 影响;带 filter 2 wire=1 field.list 注入 propertyType+1 list)。sum/avg/min/max:field 必填且须已发布 propertyType=2(NUMERICAL),本地折叠——列投影+size:200 翻页至 cap 1000,null 行不进聚合、avg=sum/非 null 行数,nonNullCount=0 时 value:null;rowsScanned>=total 才 complete:true,否则 complete:false+missingCount+capNotice,**绝不外推**。groupBy 单列:count 时值域可枚举(field.list options/字典)→ 值域×count(V+3 wire:1 metadata+1 base+V 桶+1 isnull),桶按 count 降序取 topN(默认 10/上限 20),截断给 truncatedBuckets/bucketsTruncatedCount,null 单列 nullBucket;不可枚举或数值指标 → 本地扫描(coverage.mode=local-scan),数值桶 {key,count,nonNullCount,value} 按 value 降序、并列按 key,null 行进 nullBucket。filter.draftPolicy:count+groupBy 默认 includeDrafts:false 注入 sequenceStatus≠DRAFT(excluded)统一双口径;数值指标不默认排除(如实反映平台返回行);count 省略=平台默认(无条件下含草稿 included、带条件排草稿 excluded);显式 false 可强制排除。边界:临时问句用本工具;持久图表/看板用 report.chartdata,视图汇总列用 sumType,写时计算用 datarule type2。`;
12
12
  }
13
13
  export function dataUpdateDescription() {
14
14
  const wire = RUNTIME_DATA_WIRE;
@@ -146,7 +146,7 @@ function desc(lead) {
146
146
  export function assertRuntimeDataContract() {
147
147
  assertLaneContract(RUNTIME_DATA_LANE_CONTRACT);
148
148
  assertDescriptionCarries(RUNTIME_DATA_LANE_CONTRACT, "data.list", ["queryCondition", "propertyType", "rawCondition", "projectionHint", "listview.configure", "data.load", "items[].fields"]);
149
- assertDescriptionCarries(RUNTIME_DATA_LANE_CONTRACT, "data.aggregate", ["totalElements", "groupBy", "local-scan", "cap 1000", "draftPolicy", "report.chartdata"]);
149
+ assertDescriptionCarries(RUNTIME_DATA_LANE_CONTRACT, "data.aggregate", ["totalElements", "groupBy", "local-scan", "cap 1000", "draftPolicy", "report.chartdata", "sum", "avg", "NUMERICAL", "nonNullCount"]);
150
150
  assertDescriptionCarries(RUNTIME_DATA_LANE_CONTRACT, "data.save", ["bizObjectId", "sheetCode", "bizsheet/get", "workflowCode", "sequenceStatus", "workItem", "propertyType 9", "50000", "mappings", "rowStatus", "DRAFT", "submit:true", "CHILD_TABLE"]);
151
151
  assertDescriptionCarries(RUNTIME_DATA_LANE_CONTRACT, "data.update", ["runtime/form/save", "bizObjectId", "COMPLETED", "304001", "form/load", "rowStatus", "child-rows-upsert"]);
152
152
  assertDescriptionCarries(RUNTIME_DATA_LANE_CONTRACT, "data.delete", ["absence", "sheetCode"]);