@stalfh233/omc-cli 0.4.33 → 0.4.35

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.
@@ -426,7 +426,10 @@ const plainSubmit = Object.freeze({
426
426
  tool: "data.submit",
427
427
  args: { environment, schemaCode: model, formData: { name: "正式记录" } },
428
428
  preconditions: ["模型无已发布流程(有流程走 workflow-backed-data-submit)", "模型+表单已发布"],
429
- conditionalRequirements: ["**不带 bizObjectId 即新建并提交**(工具内部建稿+直提,一次调用 COMPLETED);已有草稿要直提时才带 data.save 读回的 bizObjectId;不要手造 id"],
429
+ conditionalRequirements: [
430
+ "**不带 bizObjectId 即新建并提交**(工具内部建稿+直提,一次调用 COMPLETED);已有草稿要直提时才带 data.save 读回的 bizObjectId;不要手造 id",
431
+ "**目标模型已发布流程时行为不同(r36 实证)**:无 workItemId 的 data.submit = 一调新建并**启动流程**(PROCESSING,读回返回首审批待办 workItemId)——合法路径非错误;要『先草稿后提交/中途改稿』用两段式 data.save(草稿读回三元身份)→ data.submit(workItemId)",
432
+ ],
430
433
  priorToolReferences: [],
431
434
  dryRun: { supported: true, command: `omc call data.submit --env ${environment} --dry-run --args '<recipe.args>'`, notes: "dry-run 验证参数关系,不推进状态" },
432
435
  expectedReadback: { performed: { errcode: 0 }, readback: { sequenceStatus: "COMPLETED" } },
@@ -1039,7 +1042,7 @@ const dataListFilter = Object.freeze({
1039
1042
  args: { environment, schemaCode: model, filter: { op: "eq", field: "status", value: "OPEN" }, size: 20 },
1040
1043
  preconditions: ["schemaCode 的字段已 field.publish(filter 叶子的 propertyType 从发布面读)"],
1041
1044
  conditionalRequirements: [
1042
- "filter 是**一个**子句 `{op, field, value?}`;op ∈ eq/neq/gt/lt/gte/lte/like/notlike/in/notin/between/notbetween/isnull/isnotnull。",
1045
+ "filter 是**一个**子句 `{op, field, value?}`;op ∈ eq/neq/gt/lt/gte/lte/like/notlike/in/notin/between/notbetween/isnull/isnotnull(camelCase 别名 equals/notEquals/contains/isNull/isNotNull 等价——r36 体检发现别名合法但只列规范名会被误判『静默接受坏 op』)。",
1043
1046
  "多条件 `filters:[…]`(AND);分组 `filterGroup:{op:'and'|'or',clauses:[…]}`;系统/外部字段用 rawCondition。",
1044
1047
  ],
1045
1048
  priorToolReferences: [
@@ -1071,6 +1074,33 @@ const dataDeleteSweep = Object.freeze({
1071
1074
  refusalRecovery: [{ code: "wire-business", action: "模型须已创建且有已发布字段;运行面 50000 时先 model.inspect modelPresent 判存在" }],
1072
1075
  requiresEnvironmentDerivedIds: false,
1073
1076
  });
1077
+ const onlinejsHighlightScript = Object.freeze({
1078
+ id: "field-value-driven-style",
1079
+ title: "按字段值驱动另一控件样式(生命周期外壳 + valueChange 订阅)",
1080
+ status: "offline-valid",
1081
+ tool: "onlinejs.compose",
1082
+ args: {
1083
+ environment,
1084
+ schemaCode: model,
1085
+ sheetCode: "<默认表单 code == 模型 code>",
1086
+ mode: "replace",
1087
+ source: "(function(form){ var amt = form.getControl('amountCode'); var party = form.getControl('targetCode'); function refresh(v){ party.options.style = Number(v) > 100000 ? 'color: red;' : ''; } form.on('onRendered', function(){ refresh(amt.getValue()); amt.valueChange.subscribe(function(change){ refresh(change.value); }); }); })",
1088
+ },
1089
+ preconditions: [
1090
+ "控件编码先 model.inspect/field.list 确认(示例 amountCode/targetCode 换成真实字段 code)",
1091
+ "完整 `(function(form){…})` 生命周期外壳必须 mode:'replace'(merge 模式收外壳会被拒并指路 replace——r38 实证)",
1092
+ ],
1093
+ conditionalRequirements: [
1094
+ "事件模型:`form.on('onRendered', …)` 初始化 + `<控件>.valueChange.subscribe(function(change){ change.value })` 监听;改样式用 `control.options.style`",
1095
+ "**脚本含引号/较长时不要塞 --args 内联**——写 JSON 参数文件走 `--args-file <path>`(shell 引号拆参 r38 实证)",
1096
+ "深入教学面:`.claude/skills/form-online-js/references/`(lifecycle-api/control-api)",
1097
+ ],
1098
+ priorToolReferences: [{ tool: "form.get", args: { environment, schemaCode: model }, purpose: "确认表单已发布与控件编码" }],
1099
+ dryRun: { supported: true, command: `omc call onlinejs.compose --env ${environment} --dry-run --args-file compose.json`, notes: "dry-run 校验外壳/合并模式,不写平台" },
1100
+ expectedReadback: { readback: { deliveryState: "DELIVERED", published: true, scriptElementPresent: true, htmlRenderCompat: { draft: { ok: true }, published: { ok: true } } } },
1101
+ refusalRecovery: [{ code: "merge-mode-requires-shell", action: "完整外壳改 mode:'replace'(六元素模板保留,仅整体替换 customScript)" }],
1102
+ requiresEnvironmentDerivedIds: false,
1103
+ });
1074
1104
  const dictionaryKeyValue = Object.freeze({
1075
1105
  id: "dictionary-key-value",
1076
1106
  title: "建一个键值字典并用其 id 作字段下拉来源",
@@ -1122,6 +1152,7 @@ export const EXECUTION_METADATA = Object.freeze({
1122
1152
  "data.submit": Object.freeze({ recipes: [plainSubmit, workflowSubmit], relatedTools: ["data.save", "workitem.list", "data.load"] }),
1123
1153
  "service.register": Object.freeze({ recipes: [restfulQueryService], relatedTools: ["service.category.list", "service.adapter_config", "service.get", "method.get"] }),
1124
1154
  "method.update": Object.freeze({ recipes: [bizserviceSelfCallCorp], relatedTools: ["method.get", "method.create", "service.get"] }),
1155
+ "onlinejs.compose": Object.freeze({ recipes: [onlinejsHighlightScript], relatedTools: ["form.get", "form.draft", "form.publish"] }),
1125
1156
  "listview.configure": Object.freeze({ recipes: [listViewConfigure], relatedTools: ["listview.list", "listview.get", "field.list", "field.publish"] }),
1126
1157
  "data.list": Object.freeze({ recipes: [dataListFilter], relatedTools: ["data.load", "data.delete", "listview.configure", "field.list"] }),
1127
1158
  "data.delete": Object.freeze({ recipes: [dataDeleteSweep], relatedTools: ["data.list", "data.load", "data.submit"] }),
@@ -319,7 +319,9 @@ export function registerReportLane(tools) {
319
319
  };
320
320
  });
321
321
  writeTool(tools, "report.create", LANE, TOOLS["report.create"].scope, TOOLS["report.create"].description, {
322
- code: z.string().min(1),
322
+ // r33: the platform refuses report codes longer than 28 chars (errcode
323
+ // 10005) — enforce offline so the shape never costs a wire round trip.
324
+ code: z.string().min(1).max(28).describe("报表 code;平台上限 28 字符(10005 实证 r33)——超长在提交前直接被拒"),
323
325
  name: z.string().min(1).max(60),
324
326
  appCode: z.string().min(1),
325
327
  parentId: z.string().min(1),
@@ -341,7 +341,7 @@ export function registerRuntimeDataLane(tools) {
341
341
  // `Expected object, received array`). An array is the caller's AND-list,
342
342
  // so accept it and treat it as `filters` rather than costing a retry
343
343
  // (dogfood R1 round17).
344
- filter: z.union([z.record(z.string(), z.unknown()), z.array(z.record(z.string(), z.unknown()))]).optional().describe('one clause { op, field, value? } (or an array of clauses = AND); op is one of eq, neq, gt, lt, gte, lte, like, notlike, in, notin, between, notbetween, isnull, isnotnull'),
344
+ filter: z.union([z.record(z.string(), z.unknown()), z.array(z.record(z.string(), z.unknown()))]).optional().describe('one clause { op, field, value? } (or an array of clauses = AND); op is one of eq, neq, gt, lt, gte, lte, like, notlike, in, notin, between, notbetween, isnull, isnotnull(camelCase 别名 equally valid: equals/notEquals/contains/isNull/isNotNull)'),
345
345
  filters: z.array(z.record(z.string(), z.unknown())).optional().describe("clauses combined with AND; a malformed clause is refused with blocker invalid-filter-DSL"),
346
346
  filterGroup: z.record(z.string(), z.unknown()).optional().describe('nested group { op:"and"|"or", clauses:[clause|group] }'),
347
347
  rawCondition: z.unknown().optional(),
@@ -1657,7 +1657,10 @@ export function registerWorkflowLane(tools) {
1657
1657
  .describe("exact-match client-side filter on the returned items' instanceId (the server filterWorkflowInstanceId field is a NOT-equal exclusion, so it is not used)"),
1658
1658
  workflowCode: z.string().optional(),
1659
1659
  schemaCode: z.string().optional(),
1660
- page: z.number().int().min(0).optional(),
1660
+ // r35: an agent sent page:1 expecting the first page and read
1661
+ // `total:1 / count:0` as a contradiction — the page index is ZERO-based
1662
+ // (like data.list). Say so at the parameter itself.
1663
+ page: z.number().int().min(0).optional().describe("页号,0 基(与 data.list 一致);默认 0"),
1661
1664
  size: z
1662
1665
  .number()
1663
1666
  .int()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stalfh233/omc-cli",
3
- "version": "0.4.33",
3
+ "version": "0.4.35",
4
4
  "description": "CloudPivot 8.6 configuration capability CLI — governed, fail-closed, coverage-manifest bounded.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -51,7 +51,7 @@
51
51
  },
52
52
  "dependencies": {
53
53
  "commander": "14.0.3",
54
- "omc-core": "0.4.33",
54
+ "omc-core": "0.4.35",
55
55
  "proper-lockfile": "4.1.2",
56
56
  "write-file-atomic": "6.0.0",
57
57
  "zod": "^3.23.8",