@stalfh233/omc-cli 0.8.21 → 0.8.22

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/dist/cli.js CHANGED
@@ -3159,7 +3159,7 @@ function shellQuote(value) {
3159
3159
  for (const requested of requestedSections) {
3160
3160
  const sliced = readSkillSection(topic, requested);
3161
3161
  if (sliced?.section)
3162
- found.push({ section: sliced.heading ?? requested, ...(sliced.heading !== requested ? { requested } : {}), ...(sliced.matchType === "partial" ? { matchType: "partial" } : {}), content: sliced.section, chars: sliced.section.length, bytes: Buffer.byteLength(sliced.section, "utf8") });
3162
+ found.push({ section: sliced.heading ?? requested, ...(sliced.heading !== requested ? { requested } : {}), ...(sliced.matchType === "partial" ? { matchType: "partial" } : {}), ...(sliced.sectionHint !== undefined ? { sectionHint: sliced.sectionHint } : {}), content: sliced.section, chars: sliced.section.length, bytes: Buffer.byteLength(sliced.section, "utf8") });
3163
3163
  else
3164
3164
  missing.push(requested);
3165
3165
  }
@@ -3196,6 +3196,7 @@ function shellQuote(value) {
3196
3196
  section: sliced.heading ?? singleSection,
3197
3197
  ...(sliced.heading !== singleSection || sliced.matchType === "partial" ? { requested: singleSection } : {}),
3198
3198
  ...(sliced.matchType === "partial" ? { matchType: "partial" } : {}),
3199
+ ...(sliced.sectionHint !== undefined ? { sectionHint: sliced.sectionHint } : {}),
3199
3200
  chars: sliced.section.length,
3200
3201
  bytes: Buffer.byteLength(sliced.section, "utf8"),
3201
3202
  complete: true,
package/dist/coverage.js CHANGED
@@ -125,10 +125,9 @@ function citationFor(item, requestedScope) {
125
125
  export function versionFamilyNotice(manifest, detectedVersion) {
126
126
  if (detectedVersion.startsWith(manifest.version_family + "."))
127
127
  return undefined;
128
- return (`兼容模式:检测到 CloudPivot ${detectedVersion},不在 OMC 锚定的 ${manifest.version_family} 族` +
129
- `(锚点 ${manifest.anchor_version})。OMC 基于 8.6 构建,非 8.6 环境按兼容支持,部分能力面可能不适用。` +
130
- `取证口径:以本环境真机实测为准,8.6 文档与反编译结论仅作参考。` +
131
- `族差异清单见 docs/platform-contracts/2.1-delta.md(逐条带 file:line;未登记的条目按实测,不臆断同形或不同形)。`);
128
+ // 探针 P F9(0.8.22):每次回执约 400B 的固定噪声压到一句;细节留在族差异文档。
129
+ return (`兼容模式:检测到 CloudPivot ${detectedVersion}(不在锚定的 ${manifest.version_family} 族,锚点 ${manifest.anchor_version});` +
130
+ `按兼容支持放行,以本环境真机实测为准,族差异见 docs/platform-contracts/2.1-delta.md。`);
132
131
  }
133
132
  /**
134
133
  * 无版本证据时的兼容提示(2026-11-24 产品口径)。
@@ -1030,11 +1030,16 @@ export function registerFieldLane(tools) {
1030
1030
  String(args.propertyType) === "RADIO" ||
1031
1031
  String(args.propertyType) === "CHECKBOX" ||
1032
1032
  String(args.propertyType) === "SELECTION";
1033
+ const createdRow = rows.find((row) => (row.code ?? row.propertyCode) === args.code);
1034
+ const createdOptions = createdRow?.options !== undefined && createdRow.options !== null ? parseFieldOptionsForReadback(createdRow.options) : undefined;
1033
1035
  return {
1034
1036
  performed: { errcode: performed.errcode },
1035
1037
  readback: {
1036
1038
  face: "draft",
1037
- draftFieldPresent: rows.some((row) => (row.code ?? row.propertyCode) === args.code),
1039
+ draftFieldPresent: createdRow !== undefined,
1040
+ // 探针 P F5(0.8.22):写回执回显**生效值**(scale/format/mappings 等只在
1041
+ // options 里的语义),省掉一次 field.get 才能核对单位/精度/映射方向。
1042
+ ...(createdOptions !== undefined ? { options: createdOptions } : {}),
1038
1043
  ...(prepared.normalized ? { normalized: prepared.normalized } : {}),
1039
1044
  ...(textLike
1040
1045
  ? {
@@ -56,7 +56,7 @@ export function dataSubmitDescription() {
56
56
  /** Runtime business-object data keyed by field code. */
57
57
  export const runtimeFormDataArg = z
58
58
  .record(z.string(), z.unknown())
59
- .describe('business-object data keyed by field code, e.g. { name:"...", omc_x_amount:123, omc_x_rel:"<target objectId>" }. Relation value SHAPE depends on the field type (live 2026-09-24): a SINGLE relation (WORK_SHEET, propertyType 9) takes the target object id string or an object { id, name? } — an ARRAY here makes runtime/form/save answer 50000; a MULTI relation (propertyType 11) takes an array. STAFF/ORG fields (propertyType 50/51/60/61) take an array of selection objects `[{ id, type, name }]` where `type` is MANDATORY (BizField.parseFromClient casts `type` to Integer and calls intValue(); omitting it answers 50000) — `type` is the UnitType index: USER=3, DEPARTMENT=1. When unsure, prefer "id" or { id }. Field `mappings` are applied by the form RUNTIME when a user picks a value — a server-side data.save does NOT copy source→target, so API callers must set the mapped fields themselves.');
59
+ .describe('business-object data keyed by field code, e.g. { name:"...", omc_x_amount:123, omc_x_rel:"<target objectId>" }. Relation value SHAPE depends on the field type (live 2026-09-24): a SINGLE relation (WORK_SHEET, propertyType 9) takes the target object id string or an object { id, name? } — an ARRAY here makes runtime/form/save answer 50000; a MULTI relation (propertyType 11) is written as a semicolon-joined string "id1;id2" (the array is the readback shape). STAFF/ORG fields (propertyType 50/51/60/61) take an array of selection objects `[{ id, type, name }]` where `type` is MANDATORY (BizField.parseFromClient casts `type` to Integer and calls intValue(); omitting it answers 50000) — `type` is the UnitType index: USER=3, DEPARTMENT=1. When unsure, prefer "id" or { id }. 子表字段(CHILD_TABLE)用字段 code 直接作键:`"<子表字段code>": [{<子列code>:value}]`(不是固定 items;行内关联/人员形状与顶层字段写侧一致)。 Field `mappings` are applied by the form RUNTIME when a user picks a value — a server-side data.save does NOT copy source→target, so API callers must set the mapped fields themselves.');
60
60
  export const RUNTIME_DATA_LANE_CONTRACT = Object.freeze({
61
61
  lane: LANES.runtimeData,
62
62
  family: CONTRACT_FAMILY,
@@ -2627,6 +2627,17 @@ export function registerRuntimeDataLane(tools) {
2627
2627
  ...(projectionMissAll.length > 0 ? { projectionMiss: projectionMissAll } : {}),
2628
2628
  ...(columnsNotProjected.length > 0 ? { columnsNotProjected } : {}),
2629
2629
  ...(columnsOutsideView.length > 0 ? { columnsOutsideView, columnsNarrowingOnly: true, columnsNote: DATA_LIST_COLUMNS_NARROWING_NOTE } : {}),
2630
+ // 探针 P F7(0.8.22):请求列全在视图外时 items[].fields 必然为空——不是
2631
+ // 数据丢失。给一句结论 + 单条真值的可复制命令。
2632
+ ...(itemsFinal.length > 0 && fields !== undefined && fields.length > 0 && viewEvidence?.viewColumnCodes !== undefined
2633
+ && fields.every((code) => columnsOutsideView.includes(code))
2634
+ ? {
2635
+ projectionEmptyNote: "本次 --fields 的列都没有出现在结果行(不在视图列或未被投影):items[].fields 为空是投影结果,不是数据丢失。单条真值用 data.load(见下方 nextCommand);列表要看这些列请核对视图列配置。",
2636
+ ...(typeof itemsFinal[0]?.id === "string"
2637
+ ? { projectionEmptyNextCommand: `omc call data.load --env <env> --args '${JSON.stringify({ schemaCode: args.schemaCode, bizObjectId: itemsFinal[0].id })}'` }
2638
+ : {}),
2639
+ }
2640
+ : {}),
2630
2641
  ...(dateReadbackNote !== undefined ? { dateReadbackNote } : {}),
2631
2642
  items: itemsFinal,
2632
2643
  };
@@ -2847,6 +2858,16 @@ export function registerRuntimeDataLane(tools) {
2847
2858
  ...(projectionMissPaged.length > 0 ? { projectionMiss: projectionMissPaged } : {}),
2848
2859
  ...(columnsNotProjected.length > 0 ? { columnsNotProjected } : {}),
2849
2860
  ...(columnsOutsideView.length > 0 ? { columnsOutsideView, columnsNarrowingOnly: true, columnsNote: DATA_LIST_COLUMNS_NARROWING_NOTE } : {}),
2861
+ // 探针 P F7(0.8.22):请求列全在视图外时 items[].fields 必然为空——不是数据丢失。
2862
+ ...(itemsFinal.length > 0 && fields !== undefined && fields.length > 0 && viewEvidence?.viewColumnCodes !== undefined
2863
+ && fields.every((code) => columnsOutsideView.includes(code))
2864
+ ? {
2865
+ projectionEmptyNote: "本次 --fields 的列都没有出现在结果行(不在视图列或未被投影):items[].fields 为空是投影结果,不是数据丢失。单条真值用 data.load(见下方 nextCommand);列表要看这些列请核对视图列配置。",
2866
+ ...(typeof itemsFinal[0]?.id === "string"
2867
+ ? { projectionEmptyNextCommand: `omc call data.load --env <env> --args '${JSON.stringify({ schemaCode: args.schemaCode, bizObjectId: itemsFinal[0].id })}'` }
2868
+ : {}),
2869
+ }
2870
+ : {}),
2850
2871
  ...(dateReadbackNote !== undefined ? { dateReadbackNote } : {}),
2851
2872
  totalPages,
2852
2873
  itemsCount: items.length,
@@ -3638,7 +3659,7 @@ export function registerRuntimeDataLane(tools) {
3638
3659
  // 券商 issue 1.3(cpdocs 2026-10-27):更新既有记录的主键契约——平台
3639
3660
  // BizObjectModel.getId() 只读 bizObject.data.id;顶层 bizObject.bizObjectId
3640
3661
  // 被保存逻辑忽略,errcode:0 但 objectId 是新 id(静默新建孤儿行)。
3641
- 'business-object data keyed by field code(关联/人员形状同默认描述)。**单选关联 WORK_SHEET 9=id 串或 `{id}`;MULT_WORK_SHEET 11/人员/组织 50/51 才数组;人员/组织元素 `{id,type,name}`,type 必填**。引擎拥有键(sequenceStatus 等)会被剥离——读改写的 sequenceStatus 不会把行钉回旧状态。新建时子表行缺 sortKey 会按数组下标补 1..n(平台读回按 sortKey ASC;更新既有记录请显式带 sortKey)。mappings 仅门户回填;子表快照字段为空会回 mappingSnapshotGap 点名行/字段;字典-backed 不校验取值(不存在/已停用码也会落库,要拦请配数据规则)。**`name` 是平台数据标题(模型可配置 summary,常见如 创建人+模型名+时间),传入会被覆盖;业务标识用自建字段**。既有记录更新:主键必须放 formData.id(顶层 bizObject.bizObjectId 被平台忽略会静默新建孤儿行——直调 REST 同理,cpdocs issue §1.3);id 无对应行会被拒(save-update-target-absent),新建请省略 id。'),
3662
+ 'business-object data keyed by field code(关联/人员形状同默认描述)。**单选关联 WORK_SHEET 9=id 串或 `{id}`;MULT_WORK_SHEET 11 写侧是分号串 `"id1;id2"`(数组是读回形状);人员/组织 50/51 写侧数组,元素 `{id,type,name}`,type 必填**;**子表用「子表字段 code」直接作键:`"<子表字段code>": [{<子列code>: value}]`(不是固定 items;行内关联/人员形状与顶层字段写侧一致,见 omc-write-hazards)**。引擎拥有键(sequenceStatus 等)会被剥离——读改写的 sequenceStatus 不会把行钉回旧状态。新建时子表行缺 sortKey 会按数组下标补 1..n(平台读回按 sortKey ASC;更新既有记录请显式带 sortKey)。mappings 仅门户回填;子表快照字段为空会回 mappingSnapshotGap 点名行/字段;字典-backed 不校验取值(不存在/已停用码也会落库,要拦请配数据规则)。**`name` 是平台数据标题(模型可配置 summary,常见如 创建人+模型名+时间),传入会被覆盖;业务标识用自建字段**。既有记录更新:主键必须放 formData.id(顶层 bizObject.bizObjectId 被平台忽略会静默新建孤儿行——直调 REST 同理,cpdocs issue §1.3);id 无对应行会被拒(save-update-target-absent),新建请省略 id。'),
3642
3663
  workflowCode: z.string().optional().describe("portal draft-save shape: create the row AND a DRAFT workflow instance + start workItem (finishStart=FALSE); submit later via data.submit with the returned workItemId. formData must NOT carry an id — in-place workflow start has no REST surface in 8.6.26。发起语义阶梯:本参数=发起停在第一节点(行/实例双 DRAFT,首办待办=发起人);到第一个审批节点用 data.submit 三件套;无流程模型用 submit:true 一调完成态;代他人发起(可选发起人)唯一路径=业务规则 CREATE+startWorkflow(完成态发起,不留草稿待办)"),
3643
3664
  submit: z.boolean().optional().describe("true=保存后立即直提(无流程模型 DRAFT→COMPLETED,触发 Create 规则);与 workflowCode 互斥。**按业务约定正式数据优先直接 data.submit(无 id=新建并提交一调完成)——本参数是便捷别名,save 的定位是草稿/暂存**"),
3644
3665
  allowStaffOnSubmit: z.boolean().optional().describe("submit:true 时显式允许携带人员字段(issue#10:人员字段提交面两种形状都可能 50000,可靠链路是 save 落库后提交时省略;个别平台构建接受提交面携带,自担风险)"),
package/dist/skills.js CHANGED
@@ -303,7 +303,26 @@ export function readSkillSection(name, requested) {
303
303
  if (start < 0)
304
304
  return { document, section: "", headings };
305
305
  const startEntry = scanned.find((entry) => entry.index === start);
306
- return { document, section: sliceSectionText(lines, startEntry.index, startEntry.level), headings, heading: startEntry.heading, matchType };
306
+ // 探针 P F1(0.8.22):数字按**标题序号**匹配,不是文档第 N 篇。文档常有未编号的
307
+ // 前置节(omc-start-here 的「最小路径」),`--section 1` 会落到「1. Task → …」。
308
+ // 行为不变(序号语义有既有用户),但回执点明位置与第一篇,省一次重试。
309
+ // 复核:position 只数 level-2 篇(H1/H3 不算),并**不**生成带引号的复制命令
310
+ // (标题里可能有 `"`,截断前缀会拼出坏命令)。
311
+ const level2 = scanned.filter((entry) => entry.level === 2);
312
+ const position = level2.findIndex((entry) => entry.index === start) + 1;
313
+ const firstSection = level2[0] ?? scanned[0];
314
+ const ordinalMismatch = requestedOrdinal !== undefined && position > 0 && position !== Number(requestedOrdinal);
315
+ const sectionHint = ordinalMismatch && firstSection !== undefined
316
+ ? `--section 数字按**标题序号**匹配(本次命中文档第 ${position} 篇「${startEntry.heading}」),不是文档第 ${requestedOrdinal} 篇「${firstSection.heading}」;想按位置读请用标题前缀:--section '<该篇标题或前缀>'。`
317
+ : undefined;
318
+ return {
319
+ document,
320
+ section: sliceSectionText(lines, startEntry.index, startEntry.level),
321
+ headings,
322
+ heading: startEntry.heading,
323
+ matchType,
324
+ ...(sectionHint !== undefined ? { sectionHint } : {}),
325
+ };
307
326
  }
308
327
  /**
309
328
  * The "shape" of a topic: every heading with the bytes it would cost to read.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stalfh233/omc-cli",
3
- "version": "0.8.21",
3
+ "version": "0.8.22",
4
4
  "description": "CloudPivot 8.6 configuration capability CLI — governed, fail-closed, coverage-manifest bounded.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -58,7 +58,7 @@
58
58
  },
59
59
  "dependencies": {
60
60
  "commander": "14.0.3",
61
- "omc-core": "0.8.21",
61
+ "omc-core": "0.8.22",
62
62
  "proper-lockfile": "4.1.2",
63
63
  "write-file-atomic": "6.0.0",
64
64
  "zod": "^3.23.8",
@@ -76,6 +76,6 @@
76
76
  "directory": "packages/omc-cli"
77
77
  },
78
78
  "optionalDependencies": {
79
- "@stalfh233/omc-fake-platform": "0.8.21"
79
+ "@stalfh233/omc-fake-platform": "0.8.22"
80
80
  }
81
81
  }