@stalfh233/omc-cli 0.8.8 → 0.8.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/dist/approval-flow.js +32 -5
- package/dist/call.js +17 -1
- package/dist/cli.js +7 -5
- package/dist/data-list-filter.js +22 -4
- package/dist/goal-routes.js +95 -9
- package/dist/human-summary.js +61 -7
- package/dist/lanes/field-contract.js +2 -2
- package/dist/lanes/field.js +47 -2
- package/dist/lanes/list-view-shapes.js +22 -0
- package/dist/lanes/list-view.js +62 -3
- package/dist/lanes/model-references.js +22 -6
- package/dist/lanes/model.js +6 -3
- package/dist/lanes/runtime-data-contract.js +1 -1
- package/dist/lanes/runtime-data.js +191 -26
- package/dist/model-purge.js +147 -25
- package/dist/read.js +12 -1
- package/dist/recipes/field.js +15 -9
- package/dist/recipes/online-js.js +2 -2
- package/dist/reserved.js +48 -0
- package/package.json +3 -3
- package/skills/omc-backend-online-coding.md +3 -0
- package/skills/omc-playbook.md +2 -2
package/dist/approval-flow.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* 本命令把线性审批链压成一条命令:
|
|
7
7
|
*
|
|
8
8
|
* omc approval-flow --schema s --steps "采购经理@role:crm_mgr,总监@role:crm_dir" \
|
|
9
|
-
* [--originator-node] [--reject-to-start] [--apply]
|
|
9
|
+
* [--originator-node] [--originator-name <显示名>] [--reject-to-start] [--apply]
|
|
10
10
|
*
|
|
11
11
|
* 步骤 DSL:`名称@role:<角色code>`(FindUserByRole 按发起人部门找人)或
|
|
12
12
|
* `名称@user:<用户id>`(参与者对象)。编译为 recipe 验证形状(workflow-approval-
|
|
@@ -22,6 +22,8 @@ import { writeEnvelope } from "./cli-output.js";
|
|
|
22
22
|
import { argvValue } from "./args.js";
|
|
23
23
|
import { ConfigStore, defaultPaths } from "./config-store.js";
|
|
24
24
|
import { sessionAccountForEnvironment } from "./session-account.js";
|
|
25
|
+
/** 填写节点默认显示名(与平台自动草稿一致)。 */
|
|
26
|
+
export const DEFAULT_ORIGINATOR_NAME = "填写申请单";
|
|
25
27
|
/**
|
|
26
28
|
* r31c F20: participant object arrays only accept `{code,corpId,id,name,type}`.
|
|
27
29
|
* Intuitive keys (`participantType`/`roleId`/`participantName`) are silently
|
|
@@ -121,6 +123,15 @@ function participantNotes(steps, environment) {
|
|
|
121
123
|
}
|
|
122
124
|
return notes;
|
|
123
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* F11(0.8.9 探针 D):`--originator-name` 是显示名,不是语义。平台对既有
|
|
128
|
+
* Activity2(workflow.create 自动草稿的发起节点)把 activityName/i18nMessage
|
|
129
|
+
* 钉在首建值「填写申请单」,可写载体是 name_i18n(设计器改名也是这么发的,
|
|
130
|
+
* live 2026-10-17 抓包;见 `lanes/workflow.ts` reconcileCallerActivityCodes
|
|
131
|
+
* :1575-1593 与 effectiveActivityName :2601-2610)。apply 后读回以
|
|
132
|
+
* renamedInPlace.displayName / workflowSummary.activities[].name 为准。
|
|
133
|
+
*/
|
|
134
|
+
const ORIGINATOR_NAME_NOTE = "显示名落在 name_i18n(zh/zh_TW/en);既有发起节点的 activityName 保留平台首建值「填写申请单」,apply 后读回以 update.renamedInPlace.displayName 或 workflow.get_published 的 workflowSummary.activities[].name 为准。语义仍是发起节点(participant={Originator})。";
|
|
124
135
|
/** 编译完整模板(recipe 验证形状)。 */
|
|
125
136
|
export function composeApprovalTemplate(options) {
|
|
126
137
|
if (options.steps.length === 0)
|
|
@@ -130,7 +141,8 @@ export function composeApprovalTemplate(options) {
|
|
|
130
141
|
];
|
|
131
142
|
let n = 2;
|
|
132
143
|
if (options.originatorNode) {
|
|
133
|
-
|
|
144
|
+
const originatorName = options.originatorName?.trim() || DEFAULT_ORIGINATOR_NAME;
|
|
145
|
+
activities.push({ activityCode: `Activity${n}`, activityType: "PARTICIPANT", activityName: originatorName, i18nMessage: originatorName, participant: "{Originator}" });
|
|
134
146
|
n += 1;
|
|
135
147
|
}
|
|
136
148
|
for (const raw of options.steps) {
|
|
@@ -165,12 +177,15 @@ export async function cmdApprovalFlow(args) {
|
|
|
165
177
|
const environment = flag("--env") ?? flag("--environment");
|
|
166
178
|
const apply = args.includes("--apply");
|
|
167
179
|
const originatorNode = !args.includes("--no-originator-node");
|
|
180
|
+
const rawOriginatorName = flag("--originator-name");
|
|
181
|
+
const originatorName = rawOriginatorName?.trim();
|
|
168
182
|
const rejectToStart = !args.includes("--no-reject-to-start");
|
|
169
183
|
// r31c F5:本拼装器只做线性审批。条件分支必须退回 workflow.update;行级数据
|
|
170
184
|
// 可见范围当前工具面不支持——别把「申请人只看自己」误当成 permissions。
|
|
171
185
|
const usage = [
|
|
172
|
-
'用法:omc approval-flow --schema <模型> --steps "节点名@role:<角色code>" [--steps ...多级] [--no-originator-node] [--no-reject-to-start] [--apply]',
|
|
186
|
+
'用法:omc approval-flow --schema <模型> --steps "节点名@role:<角色code>" [--steps ...多级] [--no-originator-node] [--originator-name <填写节点显示名>] [--no-reject-to-start] [--apply]',
|
|
173
187
|
"步骤也可用 名称@user:<用户id> 绑定具体审批人。默认 dry-run(编译模板预览);--apply 建/改流程+字段权限+发布。",
|
|
188
|
+
`--originator-name 只改发起/填写节点的**显示名**(默认「${DEFAULT_ORIGINATOR_NAME}」,与平台自动草稿一致);participant 仍是 {Originator}、类型仍是 PARTICIPANT,语义不变。既有 Activity2 的 activityName 平台钉在首建值,显示名写 name_i18n——读回看 workflowSummary.activities[].name / renamedInPlace.displayName。`,
|
|
174
189
|
"user 参与者的 corpId 是 CLI 生成的本地占位(平台按 id 解析用户,id 命中时 corpId 不参与);dry-run 的 participantNotes 会逐条说明,无需手改 corpId。",
|
|
175
190
|
"⚠️ 本工具只做线性流程(START→填写→N 级审批→END),没有 --condition。",
|
|
176
191
|
"条件分支请用:omc describe workflow.update --example workflow-conditional-branch",
|
|
@@ -183,13 +198,17 @@ export async function cmdApprovalFlow(args) {
|
|
|
183
198
|
};
|
|
184
199
|
if (!schema)
|
|
185
200
|
return invalid("--schema 必填");
|
|
201
|
+
if (rawOriginatorName !== undefined && originatorName === undefined)
|
|
202
|
+
return invalid("--originator-name 不能为空(省略该参数则保持默认「填写申请单」)");
|
|
203
|
+
if (originatorName !== undefined && !originatorNode)
|
|
204
|
+
return invalid("--originator-name 只作用于发起/填写节点,但同传了 --no-originator-node;去掉其中一个");
|
|
186
205
|
// Explicit refuse of a flag we do not implement, so callers do not assume silent ignore.
|
|
187
206
|
if (args.includes("--condition") || args.includes("--branch") || args.some((arg) => arg.startsWith("--condition=") || arg.startsWith("--branch="))) {
|
|
188
207
|
return invalid("本工具不支持 --condition/--branch(只做线性审批)。条件分流请:omc describe workflow.update --example workflow-conditional-branch");
|
|
189
208
|
}
|
|
190
209
|
let compiled;
|
|
191
210
|
try {
|
|
192
|
-
compiled = composeApprovalTemplate({ schema, steps, originatorNode, rejectToStart, environment, apply });
|
|
211
|
+
compiled = composeApprovalTemplate({ schema, steps, originatorNode, originatorName, rejectToStart, environment, apply });
|
|
193
212
|
}
|
|
194
213
|
catch (error) {
|
|
195
214
|
return invalid(error instanceof Error ? error.message : String(error));
|
|
@@ -201,8 +220,12 @@ export async function cmdApprovalFlow(args) {
|
|
|
201
220
|
if (!apply) {
|
|
202
221
|
const compiledParticipantNotes = participantNotes(steps, environment);
|
|
203
222
|
writeEnvelope(envelope("ok", {
|
|
223
|
+
// 等同于 `omc call` 契约:结果顶层必须有 status。预览未写环境 → dry-run
|
|
224
|
+
// (与 model-scaffold/field-add 的预览口径一致),信封仍是 ok/exit 0。
|
|
225
|
+
status: "dry-run",
|
|
204
226
|
schemaCode: schema,
|
|
205
227
|
...compiled,
|
|
228
|
+
...(originatorName !== undefined ? { originatorName, originatorNameNote: ORIGINATOR_NAME_NOTE } : {}),
|
|
206
229
|
dryRun: true,
|
|
207
230
|
crossAccountApproval,
|
|
208
231
|
...(compiledParticipantNotes.length > 0 ? { participantNotes: compiledParticipantNotes } : {}),
|
|
@@ -266,7 +289,11 @@ export async function cmdApprovalFlow(args) {
|
|
|
266
289
|
// 4) publish
|
|
267
290
|
const publishOutcome = await runToolCall("workflow.publish", { args: { schemaCode: schema, code: compiled.workflowCode, ...(environment ? { environment } : {}) }, requestId: request, environment, print: () => undefined });
|
|
268
291
|
const classified = classifyResult(publishOutcome.result);
|
|
269
|
-
|
|
292
|
+
// 与 `omc call` 一致:结果顶层带生产者 status(成功 ok / 被拒 refused / 部分
|
|
293
|
+
// partial…),publish 的原始回执继续留在 publish 下。ok 与 status 因此不会
|
|
294
|
+
// 出现「ok:false + status:ok」。
|
|
295
|
+
const publishStatus = String(publishOutcome.result?.status ?? "ok");
|
|
296
|
+
writeEnvelope(envelope(classified.status, { status: publishStatus, schemaCode: schema, workflowCode: compiled.workflowCode, steps: steps.length, ...(originatorName !== undefined ? { originatorName, originatorNameNote: ORIGINATOR_NAME_NOTE } : {}), crossAccountApproval, ...preexistingSection, publish: publishOutcome.result }, request, classified.error));
|
|
270
297
|
if (publishOutcome.exitCode === 0)
|
|
271
298
|
process.stderr.write("[omc] 前台生效验证清单:1) 造一条数据提交走流程;2) 每级审批人在门户有待办(角色用 FindUserByRole 需审批人挂在发起人同部门,否则 PENDING 不来);3) 审批节点字段只读(不可改单);4) 驳回退发起人核对;5) 设计器打开流程确认节点链显示正常。边界:非发起人身份的审批无法在单会话 CLI 内推进(单 token);跨账号请另建环境或把参与人设为 {Originator}。\n");
|
|
272
299
|
return publishOutcome.exitCode;
|
package/dist/call.js
CHANGED
|
@@ -275,11 +275,27 @@ function humanResultLine(result) {
|
|
|
275
275
|
if (typeof result.summary === "string" && result.summary.trim().length > 0)
|
|
276
276
|
return result.summary;
|
|
277
277
|
if (status === "ok" || status === "dry-run")
|
|
278
|
-
return
|
|
278
|
+
return readDiagnosticLine(result);
|
|
279
279
|
if (result?.blocker === undefined && status !== "error" && status !== "uncertain")
|
|
280
280
|
return null;
|
|
281
281
|
return redact(result, []);
|
|
282
282
|
}
|
|
283
|
+
/**
|
|
284
|
+
* 读面回执的「人话诊断」:这些诊断键本身要进 JSON(机器可判定),但不该再复制
|
|
285
|
+
* 一份 `summary` 把 2048B 的 compact 门顶穿(0.8.9 w63:25 行 data.list 的
|
|
286
|
+
* columnsOutsideView 曾因此把 items 外置)。人类摘要行在这里按同一份键合成:
|
|
287
|
+
* - F5(w63):columnsOutsideView → columns 只能从视图列里选,被丢的 code 点名;
|
|
288
|
+
* - F10(w63):dateReadbackNote(DATE 读回固定秒级)。
|
|
289
|
+
* 没有诊断键 → null(裸成功读仍不打印,与 2026-09-25 的契约一致)。
|
|
290
|
+
*/
|
|
291
|
+
function readDiagnosticLine(result) {
|
|
292
|
+
const notes = [];
|
|
293
|
+
if (Array.isArray(result.columnsOutsideView) && result.columnsOutsideView.length > 0)
|
|
294
|
+
notes.push(`columns 只能从视图列里选:${result.columnsOutsideView.map(String).join("、")} 不在视图列里,不会返回值(扩列用 data.load 或把列加进视图)`);
|
|
295
|
+
if (typeof result.dateReadbackNote === "string" && result.dateReadbackNote.length > 0)
|
|
296
|
+
notes.push(result.dateReadbackNote);
|
|
297
|
+
return notes.length > 0 ? notes.join(";") : null;
|
|
298
|
+
}
|
|
283
299
|
export function validateAgentPaths(args) {
|
|
284
300
|
const root = resolve(process.env.OMC_CONFIG_HOME ?? process.cwd());
|
|
285
301
|
const visit = (value, key) => {
|
package/dist/cli.js
CHANGED
|
@@ -73,7 +73,7 @@ import { WireError, wireCall } from "./wire.js";
|
|
|
73
73
|
import { describeWireFailure } from "./wire-failure.js";
|
|
74
74
|
import { DEFAULT_PULL_CONCURRENCY, GraphIndexAmbiguousError, GraphIndexError, GraphIndexUnreadableError, GraphPullLockHeldError, GraphPullTimeoutError, DEFAULT_GRAPH_PULL_TIMEOUT_MS, MAX_GRAPH_PULL_TIMEOUT_MS, MAX_PULL_CONCURRENCY, graphDbPath, graphRoot, impactGraph, listGraphIndexes, publishGraphPull, queryGraphReferences, queryGraphReferencesBatch, queryGraphEdges, readGraphStatus, searchGraphRules, } from "./graph.js";
|
|
75
75
|
import { cmdResidue } from "./residue.js";
|
|
76
|
-
import { reservedCodeReport } from "./reserved.js";
|
|
76
|
+
import { reservedCodeLookup, reservedCodeReport } from "./reserved.js";
|
|
77
77
|
import { cmdTrack } from "./track.js";
|
|
78
78
|
import { ENDPOINTS } from "./endpoints.js";
|
|
79
79
|
import { makeToolContext } from "./context.js";
|
|
@@ -3606,8 +3606,8 @@ async function main() {
|
|
|
3606
3606
|
const rest = ["rule-when", ...(options.schema ? ["--schema", options.schema] : []), ...(options.schemaCode ? ["--schema-code", options.schemaCode] : []), ...(options.on ? ["--on", options.on] : []), ...(Array.isArray(options.when) ? options.when.flatMap((w) => ["--when", w]) : []), ...(Array.isArray(options.then) ? options.then.flatMap((a) => ["--then", a]) : []), ...(options.name ? ["--name", options.name] : []), ...(options.env ? ["--env", options.env] : []), ...(options.environment ? ["--environment", options.environment] : []), ...(options.apply ? ["--apply"] : [])];
|
|
3607
3607
|
commandExitCode = await cmdRuleWhen(rest);
|
|
3608
3608
|
});
|
|
3609
|
-
command.command("approval-flow").option("--schema <schemaCode>").option("--schema-code <schemaCode>").addOption(new Option("--steps <step>", "审批步骤,可重复;`节点名@role:<角色code>` 或 `节点名@user:<userId>`(user 参与者的 corpId 是 CLI 本地占位,平台按 id 解析用户,无需手改)").argParser(collectValues).default([])).option("--env <environment>").option("--environment <environment>").option("--apply").option("--no-originator-node").option("--no-reject-to-start").addHelpText("after", "\n审批流拼装器:--steps 名称@role:<角色code> 或 节点名@user:<userId>(多级给多个)。编译为验证模板(START→填写→审批链→END,审批节点字段只读),--apply 建流+权限+发布。\n`@user:` 适合单账号/角色无成员环境;参与者对象的 corpId 由 CLI 写成本地占位 \"other\",平台先按 id 解析用户、id 命中时 corpId 不参与(8.6.26 ParticipleServiceImplCompanion.java:171-174),dry-run 的 participantNotes 会逐条说明,无需替换。role 参与者按 OU 解析,先 `org.role.users` 复核。\n边界:非发起人身份的审批无法在单会话 CLI 内推进(单 token);若要验跨账号审批,用第二账号另建环境,或把参与人设为 {Originator}。\n").action(async (options) => {
|
|
3610
|
-
const rest = ["approval-flow", ...(options.schema ? ["--schema", options.schema] : []), ...(options.schemaCode ? ["--schema-code", options.schemaCode] : []), ...(Array.isArray(options.steps) ? options.steps.flatMap((s) => ["--steps", s]) : []), ...(options.env ? ["--env", options.env] : []), ...(options.environment ? ["--environment", options.environment] : []), ...(options.apply ? ["--apply"] : []), ...(options.originatorNode === false ? ["--no-originator-node"] : []), ...(options.rejectToStart === false ? ["--no-reject-to-start"] : [])];
|
|
3609
|
+
command.command("approval-flow").option("--schema <schemaCode>").option("--schema-code <schemaCode>").addOption(new Option("--steps <step>", "审批步骤,可重复;`节点名@role:<角色code>` 或 `节点名@user:<userId>`(user 参与者的 corpId 是 CLI 本地占位,平台按 id 解析用户,无需手改)").argParser(collectValues).default([])).option("--env <environment>").option("--environment <environment>").option("--apply").option("--no-originator-node").option("--originator-name <displayName>", "发起/填写节点的显示名(默认「填写申请单」)。只改显示名,participant 仍是 {Originator},语义仍是发起节点;既有节点的 activityName 保留平台首建值,显示名落在 name_i18n").option("--no-reject-to-start").addHelpText("after", "\n审批流拼装器:--steps 名称@role:<角色code> 或 节点名@user:<userId>(多级给多个)。编译为验证模板(START→填写→审批链→END,审批节点字段只读),--apply 建流+权限+发布。\n发起/填写节点默认显示名「填写申请单」(平台自动草稿同名);`--originator-name <名>` 只改显示名(任务书按「发起 → 审批」写时用它对齐),语义仍是发起节点(participant={Originator})。平台把既有 Activity2 的 activityName 钉在首建值,显示名写入 name_i18n——读回看 workflow.get_published 的 workflowSummary.activities[].name(或 update.renamedInPlace.displayName)。\n`@user:` 适合单账号/角色无成员环境;参与者对象的 corpId 由 CLI 写成本地占位 \"other\",平台先按 id 解析用户、id 命中时 corpId 不参与(8.6.26 ParticipleServiceImplCompanion.java:171-174),dry-run 的 participantNotes 会逐条说明,无需替换。role 参与者按 OU 解析,先 `org.role.users` 复核。\n边界:非发起人身份的审批无法在单会话 CLI 内推进(单 token);若要验跨账号审批,用第二账号另建环境,或把参与人设为 {Originator}。\n").action(async (options) => {
|
|
3610
|
+
const rest = ["approval-flow", ...(options.schema ? ["--schema", options.schema] : []), ...(options.schemaCode ? ["--schema-code", options.schemaCode] : []), ...(Array.isArray(options.steps) ? options.steps.flatMap((s) => ["--steps", s]) : []), ...(options.env ? ["--env", options.env] : []), ...(options.environment ? ["--environment", options.environment] : []), ...(options.apply ? ["--apply"] : []), ...(options.originatorNode === false ? ["--no-originator-node"] : []), ...(options.originatorName ? ["--originator-name", options.originatorName] : []), ...(options.rejectToStart === false ? ["--no-reject-to-start"] : [])];
|
|
3611
3611
|
commandExitCode = await cmdApprovalFlow(rest);
|
|
3612
3612
|
});
|
|
3613
3613
|
command
|
|
@@ -3615,15 +3615,17 @@ async function main() {
|
|
|
3615
3615
|
.option("--code <schemaCode>", "模型 code")
|
|
3616
3616
|
.option("--schema <schemaCode>")
|
|
3617
3617
|
.option("--purge-instances", "连流程实例一起删(workflow.delete 遇到实例会 402508)")
|
|
3618
|
+
.option("--unbind-references", "先按 deletionSteps 拆入站引用(field.delete 引用列 + field.publish 所属模型)再删模型;破坏性:被删列数据不可恢复")
|
|
3618
3619
|
.option("--env <environment>")
|
|
3619
3620
|
.option("--environment <environment>")
|
|
3620
3621
|
.option("--apply")
|
|
3621
|
-
.addHelpText("after", "\n一条命令按依赖倒序清掉一个模型:列表视图 → 业务规则 → 计算规则 → 流程实例 → 流程 → 模型(字段/表单随模型级联,并级联删除流程模板 <code>_wf 及其发起权限绑定)。默认 dry-run。\n业务数据:--purge-instances 删流程实例;普通业务行(无流程)不会自动带走——先 data.delete 清(sweep-all-readback 配方),再 purge,否则留孤儿数据。\n")
|
|
3622
|
+
.addHelpText("after", "\n一条命令按依赖倒序清掉一个模型:列表视图 → 业务规则 → 计算规则 → 流程实例 → 流程 → 模型(字段/表单随模型级联,并级联删除流程模板 <code>_wf 及其发起权限绑定)。默认 dry-run。\n入站引用(被其它模型关联字段引用,或子表关联列指向自身):默认 blocked/partial 并给 deletionSteps;加 --unbind-references --apply 让本命令先拆引用(破坏性:会删除引用列/子表关联列,列数据不可恢复),任一步失败即停且不删模型。\n业务数据:--purge-instances 删流程实例;普通业务行(无流程)不会自动带走——先 data.delete 清(sweep-all-readback 配方),再 purge,否则留孤儿数据。\n")
|
|
3622
3623
|
.action(async (options) => {
|
|
3623
3624
|
const rest = ["model-purge",
|
|
3624
3625
|
...(options.code ? ["--code", options.code] : []),
|
|
3625
3626
|
...(options.schema ? ["--schema", options.schema] : []),
|
|
3626
3627
|
...(options.purgeInstances ? ["--purge-instances"] : []),
|
|
3628
|
+
...(options.unbindReferences ? ["--unbind-references"] : []),
|
|
3627
3629
|
...(options.env ? ["--env", options.env] : []),
|
|
3628
3630
|
...(options.environment ? ["--environment", options.environment] : []),
|
|
3629
3631
|
...(options.apply ? ["--apply"] : [])];
|
|
@@ -3931,7 +3933,7 @@ async function main() {
|
|
|
3931
3933
|
// F1(0.8.7 探针 B):保留字清单不可发现——报错只给 code_reserved 分类,help 只有
|
|
3932
3934
|
// SQL 关键字。本命令是 src/code-rules.ts 同一张表的只读投影(零环境接触),
|
|
3933
3935
|
// 不新增第二套校验逻辑,也不声称是平台全量清单。
|
|
3934
|
-
command.command("reserved").description("本地 code 保留字清单(系统默认属性/扩展默认属性/平台内部/子表专用 + SQL 关键字);建模型或字段前查,平台 301014/10033
|
|
3936
|
+
command.command("reserved [codes...]").description("本地 code 保留字清单(系统默认属性/扩展默认属性/平台内部/子表专用 + SQL 关键字);建模型或字段前查,平台 301014/10033 仍是最终门;可带候选 code 只查命中(omc reserved owner status)").option("--json", "兼容别名:输出本就是 JSON 信封").option("--max-output-bytes <bytes>").addHelpText("after", "\n清单来自本地 dry-lint 同一张表(src/code-rules.ts),与 field.create / model.create / configure_model 的 code_reserved 判定同源;不是平台全量保留字清单——平台最终门仍是属性冲突 301014、SQL 关键字 10033。\n带候选 code 时只回这些 code 的判定:checked 逐条 {code,reserved,group?,matched?},hits 是其中 reserved:true 的子集,total=hits 条数;命中不是错误,退出码仍 0(不要用退出码判断命中)。\n").action(async (codes, options) => { const candidates = codes ?? []; commandExitCode = await withTransport(options, request, (transport) => emitTransportResult(candidates.length > 0 ? reservedCodeLookup(candidates) : reservedCodeReport(), transport)); });
|
|
3935
3937
|
// `--env` is accepted but ignored: `next` is a zero-environment-contact route
|
|
3936
3938
|
// solver, and a caller who reflexively passes `--env` should not be refused
|
|
3937
3939
|
// (round 15 dogfood: `next "<goal>" --env local` → unknown option, one round).
|
package/dist/data-list-filter.js
CHANGED
|
@@ -65,16 +65,34 @@ function translateGroup(group, depth) {
|
|
|
65
65
|
function badNested() {
|
|
66
66
|
throw new FilterDslError("filter-depth-exceeded", "nested groups inside filterGroup are not supported by the runtime condition format");
|
|
67
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* F4(w63,2026-11-26 真机):listview 条件面写的是枚举名 `Eq`(`NotIn`/`IsNull`…),
|
|
70
|
+
* 调用方把它照抄进 data.list 的 `filter.op` 会被当成未知 op 拒绝
|
|
71
|
+
* (`filter.op:"Eq"` → invalid-filter-DSL)。同一套运算符只是大小写不同,不应
|
|
72
|
+
* 让调用方为两个面的拼写差异付一次重试:先精确命中,再小写命中,再无大小写
|
|
73
|
+
* 扫描 SIMPLE_OP_MAP;未知 op 仍拒绝。
|
|
74
|
+
*/
|
|
75
|
+
function resolveSimpleOp(raw) {
|
|
76
|
+
if (typeof raw !== "string")
|
|
77
|
+
return undefined;
|
|
78
|
+
if (raw in SIMPLE_OP_MAP)
|
|
79
|
+
return raw;
|
|
80
|
+
const lower = raw.toLowerCase();
|
|
81
|
+
if (lower in SIMPLE_OP_MAP)
|
|
82
|
+
return lower;
|
|
83
|
+
return Object.keys(SIMPLE_OP_MAP).find((key) => key.toLowerCase() === lower);
|
|
84
|
+
}
|
|
68
85
|
function translateClause(clause) {
|
|
69
|
-
|
|
70
|
-
|
|
86
|
+
const op = clause && typeof clause === "object" ? resolveSimpleOp(clause.op) : undefined;
|
|
87
|
+
if (op === undefined)
|
|
88
|
+
throw new FilterDslError("invalid-op", `unsupported filter op '${String(clause?.op)}'(accepted: ${Object.keys(SIMPLE_OP_MAP).join("/")};op 大小写不敏感,Eq/EQ→eq)`);
|
|
71
89
|
const field = String(clause.field ?? "").trim();
|
|
72
90
|
if (!field)
|
|
73
91
|
throw new FilterDslError("missing-field", "filter field is required");
|
|
74
92
|
return {
|
|
75
93
|
propertyCode: field,
|
|
76
|
-
propertyValue: encodeValue(
|
|
77
|
-
queryFilterType: SIMPLE_OP_MAP[
|
|
94
|
+
propertyValue: encodeValue(op, clause.value),
|
|
95
|
+
queryFilterType: SIMPLE_OP_MAP[op],
|
|
78
96
|
};
|
|
79
97
|
}
|
|
80
98
|
function encodeValue(op, value) {
|
package/dist/goal-routes.js
CHANGED
|
@@ -41,18 +41,48 @@ function looksWholePackage(goal, capabilityCount) {
|
|
|
41
41
|
function looksGreenfield(goal) {
|
|
42
42
|
return GREENFIELD_CUES.some((cue) => goal.includes(cue));
|
|
43
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* 0.8.9 F1(探针 D):整包需求的**并列面**判据。
|
|
46
|
+
*
|
|
47
|
+
* 之前整包只认 WHOLE_APP_CUES(应用/系统/从零…),于是一个没写「应用/系统」的
|
|
48
|
+
* 交付句——「建设备档案与设备维修工单两个模型(主子表),含表单两列布局、列表视图
|
|
49
|
+
* 筛选排序、金额大于0数据规则、审批流程并跑通实例」——被配方别名分支
|
|
50
|
+
* (`bestAliasRecipe`,在能力打分之前就 return,见下方 alias 分支)用一句
|
|
51
|
+
* 「两列布局」抢成 form.draft 单配方,其余 5 个能力面全丢。
|
|
52
|
+
*
|
|
53
|
+
* 判据(可解释、可测试,不认具体句子):同一句里命中 **≥3 个配置能力面**,且出现
|
|
54
|
+
* 并列词(+ / 并且 / 并 / 含 / 以及 / 同时 / 跑通)→ 这是整包交付,不是单配方。
|
|
55
|
+
* - 单面句「给表单加两列布局」面数 1 → 仍走 two-column-layout 配方;
|
|
56
|
+
* - 双面句「建模型 + 造数据」面数 2 → 仍走能力阶梯(不误判整包)。
|
|
57
|
+
* 面来自 CAPABILITY_CUES 打分(≥2 分才算点名),与能力路由同一真相源。
|
|
58
|
+
*/
|
|
59
|
+
const MULTI_FACE_SIGNAL_CAPABILITIES = [
|
|
60
|
+
"model", "field", "form", "listview", "datarule", "businessrule", "workflow", "onlinejs", "data",
|
|
61
|
+
];
|
|
62
|
+
/** 并列词自身的复合词(「合并/并行/并发」里的「并」不是并列)。 */
|
|
63
|
+
const PARALLEL_COMPOUNDS = /合并|并行|并发|并签|并不|并存|兼并|吞并|交并/g;
|
|
64
|
+
function hasParallelMarker(goal) {
|
|
65
|
+
const scoped = goal.replace(PARALLEL_COMPOUNDS, "");
|
|
66
|
+
return /[++]|并且|以及|同时|还要|含|跑通|并/.test(scoped);
|
|
67
|
+
}
|
|
68
|
+
function buildFaceIds(capabilityIds) {
|
|
69
|
+
return capabilityIds.filter((id) => MULTI_FACE_SIGNAL_CAPABILITIES.includes(id));
|
|
70
|
+
}
|
|
71
|
+
function looksMultiFacePackage(goal, capabilityIds) {
|
|
72
|
+
return buildFaceIds(capabilityIds).length >= 3 && hasParallelMarker(goal);
|
|
73
|
+
}
|
|
44
74
|
/**
|
|
45
75
|
* r31c F1: multi-face asks must NOT be stolen by the first matching composer.
|
|
46
76
|
* Conservative: only when ≥2 capability faces score AND the ask is whole-package
|
|
47
|
-
* shaped (WHOLE_APP cue or ≥
|
|
48
|
-
* single-point answers.
|
|
77
|
+
* shaped (WHOLE_APP cue, ≥4 faces, or ≥3 faces joined by a parallel marker).
|
|
78
|
+
* Single-face composer goals (G1/G2/G5) stay single-point answers.
|
|
49
79
|
*/
|
|
50
80
|
function shouldPreferMultiFace(mode, goal, scoredCapabilityIds) {
|
|
51
81
|
if (mode !== "build" && mode !== "modify")
|
|
52
82
|
return false;
|
|
53
83
|
if (scoredCapabilityIds.length < 2)
|
|
54
84
|
return false;
|
|
55
|
-
return looksWholePackage(goal, scoredCapabilityIds.length);
|
|
85
|
+
return looksWholePackage(goal, scoredCapabilityIds.length) || looksMultiFacePackage(goal, scoredCapabilityIds);
|
|
56
86
|
}
|
|
57
87
|
/** Short why-line for a capability step in a multi-face ladder (r31c F1). */
|
|
58
88
|
function capabilityWhy(capabilityId, goal) {
|
|
@@ -77,6 +107,8 @@ function capabilityWhy(capabilityId, goal) {
|
|
|
77
107
|
return "审批流程";
|
|
78
108
|
case "onlinejs":
|
|
79
109
|
return "在线 JS";
|
|
110
|
+
case "data":
|
|
111
|
+
return "运行数据 / 造数 / 跑通实例";
|
|
80
112
|
default:
|
|
81
113
|
return capabilityId;
|
|
82
114
|
}
|
|
@@ -646,14 +678,55 @@ function matchComposer(goal, mode) {
|
|
|
646
678
|
function isWholePackageWrite(mode, goal, capabilityCount) {
|
|
647
679
|
return (mode === "build" || mode === "modify") && looksWholePackage(goal, capabilityCount);
|
|
648
680
|
}
|
|
681
|
+
/** 运行实例/造数需求:intent 不覆盖运行数据(data intent.level=none),整包阶梯末尾补一步。 */
|
|
682
|
+
const RUNTIME_DATA_ASK = /(跑通|跑.{0,2}实例|实例|造.{0,4}(数据|单据|订单)|测试数据|测试单据|录入?数据|提交数据)/;
|
|
683
|
+
/**
|
|
684
|
+
* 0.8.9 F1(探针 D):整包阶梯的每一步要**可执行**,否则 agent 又得绕回
|
|
685
|
+
* `capabilities → commands --capability → describe`(探针实测 10 次发现调用 / 40KB)。
|
|
686
|
+
*
|
|
687
|
+
* 命令不在这里另写一份骨架:优先用既有**单命令门**(composer 注册表,与 next 的
|
|
688
|
+
* composer 路由同一真相源),其次该能力的配方(bestRecipe / defaultRecipeFor),
|
|
689
|
+
* 最后才降级到 lane 清单。改命令只改注册表,不在本文件重抄。
|
|
690
|
+
*/
|
|
691
|
+
const CAPABILITY_COMPOSER_STEP = Object.freeze({
|
|
692
|
+
model: "model-scaffold",
|
|
693
|
+
workflow: "approval-flow",
|
|
694
|
+
});
|
|
695
|
+
function faceCommand(registry, capabilityId, lane, goal, composeDoors) {
|
|
696
|
+
const composerId = composeDoors ? CAPABILITY_COMPOSER_STEP[capabilityId] : undefined;
|
|
697
|
+
const composer = composerId === undefined ? undefined : COMPOSER_ROUTES.find((entry) => entry.id === composerId);
|
|
698
|
+
if (composer)
|
|
699
|
+
return composer.command;
|
|
700
|
+
if (capabilityId === "data") {
|
|
701
|
+
// 跑通审批实例是两段式:data.save 带 workflowCode 暂存 → data.submit 推进待办
|
|
702
|
+
//(见 runtime-data 契约);纯造数用 plain-data-submit。
|
|
703
|
+
return /审批|流程|实例|待办/.test(goal)
|
|
704
|
+
? "omc describe data.save --example workflow-backed-data-save"
|
|
705
|
+
: "omc describe data.submit --example plain-data-submit";
|
|
706
|
+
}
|
|
707
|
+
// 子表/明细在字段面只有 field.create 的 minimal-child-table 是建表形状;
|
|
708
|
+
// bestRecipe 的 bigram 重叠在这个整包长句里会挑到无关的表单条件必填配方。
|
|
709
|
+
if (capabilityId === "field" && /子表|明细|主子表/.test(goal)) {
|
|
710
|
+
return "omc describe field.create --example minimal-child-table";
|
|
711
|
+
}
|
|
712
|
+
const recipe = bestRecipe(registry, capabilityId, lane, goal) ?? defaultRecipeFor(registry, capabilityId, lane);
|
|
713
|
+
if (recipe)
|
|
714
|
+
return `omc describe ${recipe.tool} --example ${recipe.recipe}`;
|
|
715
|
+
return `omc commands --json --compact --lane ${lane}`;
|
|
716
|
+
}
|
|
649
717
|
function wholePackageRoute(registry, goal, index, hitCapabilities) {
|
|
650
718
|
const routeById = new Map(index.routes.map((route) => [route.id, route]));
|
|
719
|
+
const greenfield = looksGreenfield(goal);
|
|
720
|
+
// 「跑通实例 / 造数」是运行数据面:它不在 WHOLE_PACKAGE_CAPABILITIES(intent 不覆盖),
|
|
721
|
+
// 但整包交付几乎总带这一步,必须出现在阶梯里(否则 agent 照 ladder 跑完配置不知道造数)。
|
|
722
|
+
const runtimeDataFace = RUNTIME_DATA_ASK.test(goal) && !(hitCapabilities ?? []).includes("data");
|
|
651
723
|
// r31c F1: prefer the faces the ask actually named; fall back to the full
|
|
652
724
|
// package set when the ask only said "做应用" without naming faces.
|
|
653
725
|
const seed = hitCapabilities !== undefined && hitCapabilities.length >= 2
|
|
654
726
|
? [...new Set([...hitCapabilities, "model", "field"])]
|
|
655
727
|
: [...WHOLE_PACKAGE_CAPABILITIES];
|
|
656
|
-
const ordered = orderedCapabilities(seed, index).filter((id) => routeById.has(id));
|
|
728
|
+
const ordered = orderedCapabilities(runtimeDataFace ? [...seed, "data"] : seed, index).filter((id) => routeById.has(id));
|
|
729
|
+
const composeDoors = greenfield || !MODIFY_CUES.some((cue) => goal.includes(cue));
|
|
657
730
|
// Round 16b (dogfood R1): the supplement used to repeat every capability's
|
|
658
731
|
// full tool map (model.create/delete/…, field.create/…), ~60% of a 2.8KB
|
|
659
732
|
// response the caller never used — intent already covers these. Keep it a
|
|
@@ -663,13 +736,18 @@ function wholePackageRoute(registry, goal, index, hitCapabilities) {
|
|
|
663
736
|
// whole-package has ONE primary path (intent) and `route.ladder` is the
|
|
664
737
|
// atomic execution ladder, which for whole-package is deliberately absent
|
|
665
738
|
// (bench40: two co-equal paths made agents wander). So the face list rides
|
|
666
|
-
// `route.
|
|
739
|
+
// `route.atomicSupplement.ladder`: same information, no second execution path.
|
|
740
|
+
// 0.8.9 F1: each face now also carries ONE runnable `command` (same pointer size,
|
|
741
|
+
// still no `tools`), so the ladder is executable without a discovery round-trip.
|
|
667
742
|
const faces = ordered.map((id, indexInFaces) => ({
|
|
668
743
|
step: indexInFaces + 1,
|
|
669
744
|
capability: id,
|
|
670
745
|
why: capabilityWhy(id, goal),
|
|
746
|
+
command: faceCommand(registry, id, routeById.get(id).lane, goal, composeDoors),
|
|
671
747
|
}));
|
|
672
|
-
|
|
748
|
+
// 运行数据是 intent 的**已知**未覆盖面(coverageNote 明说),不能因此把整包的
|
|
749
|
+
// 主路径翻成 atomic-only——它本就归 atomicSupplement 管。
|
|
750
|
+
const intentCovered = ordered.every((id) => id === "data" || (index.nodeById.get(id)?.intent.level ?? "none") !== "none");
|
|
673
751
|
const atomicLadder = ordered.map((id) => {
|
|
674
752
|
const capability = routeById.get(id);
|
|
675
753
|
const recipe = bestRecipe(registry, id, capability.lane, goal) ?? defaultRecipeFor(registry, id, capability.lane);
|
|
@@ -682,7 +760,6 @@ function wholePackageRoute(registry, goal, index, hitCapabilities) {
|
|
|
682
760
|
: { firstCommand: `omc commands --json --compact --lane ${capability.lane}` }),
|
|
683
761
|
};
|
|
684
762
|
});
|
|
685
|
-
const greenfield = looksGreenfield(goal);
|
|
686
763
|
return {
|
|
687
764
|
status: "ok",
|
|
688
765
|
goal,
|
|
@@ -1194,7 +1271,14 @@ function goalRouteInner(registry, goal) {
|
|
|
1194
1271
|
// WHOLE_APP_CUES 而不用「≥4 能力面」:单配方措辞(「配一条 Create 规则:
|
|
1195
1272
|
// 调服务按客户名查信用回写」)天然扫过 模型/规则/服务 多个能力面,按面数拦
|
|
1196
1273
|
// 会把真别名路由也拦掉(bizservice-recipes 别名测试实证)。
|
|
1197
|
-
|
|
1274
|
+
//
|
|
1275
|
+
// 0.8.9 F1(探针 D):显式整包措辞不是唯一形态。「建设备档案与设备维修工单两个
|
|
1276
|
+
// 模型(主子表),含表单两列布局、列表视图筛选排序、金额大于0数据规则、审批流程
|
|
1277
|
+
// 并跑通实例」不含 应用/系统/从零,却被别名「两列布局」压成一个 form.draft 配方。
|
|
1278
|
+
// 因此别名分支再加一条与 WHOLE_APP_CUES 同级的前置门:**≥3 个能力面 + 并列词**
|
|
1279
|
+
// (判据见 looksMultiFacePackage)时让位给下面的多面阶梯。单面句面数 1,照旧走配方。
|
|
1280
|
+
const multiFacePackageAsk = !readish && looksMultiFacePackage(goal, earlyScoredIds);
|
|
1281
|
+
if (!readish && !multiFacePackageAsk && !WHOLE_APP_CUES.some((cue) => goal.includes(cue))) {
|
|
1198
1282
|
const aliasHit = bestAliasRecipe(registry, goal);
|
|
1199
1283
|
// r62b-F1(真机复现,P0-1 第三层防御):「合同里金额大于50万的单据有几条」
|
|
1200
1284
|
// 被配方别名「金额大于」抢到 workflow 写配方——纯读问句拿到写工具,照做
|
|
@@ -1422,7 +1506,9 @@ function goalRouteInner(registry, goal) {
|
|
|
1422
1506
|
const firstRecipeId = ladder.find((step) => step.recipe) && (ladder.find((step) => step.recipe).recipe.id);
|
|
1423
1507
|
// When intent is the primary path, the atomic ladder is only a POINTER to the
|
|
1424
1508
|
// capabilities (dogfood R1: repeating every tool map was ~60% unused bytes).
|
|
1425
|
-
|
|
1509
|
+
// 0.8.9 F1:指针里的 firstCommand 以前只看 `step.firstCommand`,命中配方时
|
|
1510
|
+
// 仍给 `commands --lane`(正是探针被绕回发现面的那条路)。有配方就用配方命令。
|
|
1511
|
+
const atomicSupplement = { note: "intent 已覆盖这些能力的创建;原子工具只用于 intent 未覆盖面:", ladder: ladder.map((step) => ({ capability: step.capability, lane: step.lane, firstCommand: step.recipe?.command ?? step.firstCommand ?? `omc commands --json --compact --lane ${step.lane}` })) };
|
|
1426
1512
|
return {
|
|
1427
1513
|
status: "ok",
|
|
1428
1514
|
goal,
|
package/dist/human-summary.js
CHANGED
|
@@ -89,6 +89,11 @@ function nodeCountOf(nodeGraph) {
|
|
|
89
89
|
function noChange(outcome) {
|
|
90
90
|
return typeof outcome?.performed?.skipped === "string";
|
|
91
91
|
}
|
|
92
|
+
/** 回执层的一条人话注释(当前用于 data.save 的 nameOverwrittenNote)。 */
|
|
93
|
+
function readbackNoteClause(outcome, key) {
|
|
94
|
+
const note = outcome?.readback?.[key];
|
|
95
|
+
return typeof note === "string" && note.length > 0 ? `;${note}` : "";
|
|
96
|
+
}
|
|
92
97
|
/**
|
|
93
98
|
* The one human phrase for a write. `phase:"plan"` prefixes 即将 (approval
|
|
94
99
|
* card), `phase:"done"` prefixes 已 (result). Skipped no-op writes surface as
|
|
@@ -186,7 +191,22 @@ function phraseOf(tool, args, outcome) {
|
|
|
186
191
|
// → 未知才是 ?。plan 阶段没有回执,落到 schemaCode。
|
|
187
192
|
const readbackFormName = typeof outcome?.readback?.formName === "string" && outcome.readback.formName.length > 0 ? outcome.readback.formName : undefined;
|
|
188
193
|
const shownForm = stringArg(args, "sheetCode") ?? readbackFormName ?? (schemaCode !== undefined ? String(schemaCode) : "?");
|
|
189
|
-
|
|
194
|
+
// F12(0.8.9 探针 D):只传 childColumns 是**增量**绑定子表列,草稿保留
|
|
195
|
+
// 其它控件——旧摘要在这条路上仍写「(绑定全部已发布字段)」,让人以为
|
|
196
|
+
// 要重建整个表单。同一个 args 也是 plan.actions 的来源,所以摘要与动作
|
|
197
|
+
// 同源;有 fieldCodes 或 rebuild 时保持原口径。
|
|
198
|
+
const childColumns = Array.isArray(args.childColumns)
|
|
199
|
+
? args.childColumns.flatMap((entry) => {
|
|
200
|
+
const parent = typeof entry?.parent === "string" ? entry.parent : undefined;
|
|
201
|
+
const fields = Array.isArray(entry?.fieldCodes) ? entry.fieldCodes.map(String) : [];
|
|
202
|
+
return parent !== undefined && fields.length > 0 ? [`${parent}.${fields.join("、")}`] : [];
|
|
203
|
+
})
|
|
204
|
+
: [];
|
|
205
|
+
const hasFieldCodes = Array.isArray(codes) && codes.length > 0;
|
|
206
|
+
if (childColumns.length > 0 && !hasFieldCodes && args.rebuild !== true) {
|
|
207
|
+
return `配置并发布表单 ${shownForm}(模型 ${schemaCode ?? "?"}),增量绑定子表列 ${childColumns.join(";")}(不动其它控件)`;
|
|
208
|
+
}
|
|
209
|
+
return `配置并发布表单 ${shownForm}(模型 ${schemaCode ?? "?"})${hasFieldCodes ? `,绑定字段 ${codes.map(String).join("、")}` : "(绑定全部已发布字段)"}`;
|
|
190
210
|
}
|
|
191
211
|
case "configure_rule":
|
|
192
212
|
return `保存并启用业务规则 ${stringArg(args, "name") ?? ""}(${stringArg(args, "ruleCode") ?? "?"},模型 ${schemaCode ?? "?"})`;
|
|
@@ -253,17 +273,19 @@ function phraseOf(tool, args, outcome) {
|
|
|
253
273
|
// submit 被静默吞掉。summary 必须看 outcome:被拒就说被拒。
|
|
254
274
|
{
|
|
255
275
|
const submitRefused = outcome?.readback?.submitRefused;
|
|
276
|
+
// F8(w63):平台按模型「数据标题」覆盖显式传入的 name,摘要行必须抬头。
|
|
277
|
+
const nameNote = readbackNoteClause(outcome, "nameOverwrittenNote");
|
|
256
278
|
if (args.submit === true && submitRefused !== undefined) {
|
|
257
|
-
return `保存数据(模型 ${schemaCode ?? "?"})——submit:true 被拒(${submitRefused.blocker ?? "?"}):模型有已发布流程,行保持草稿 DRAFT;三段式指引进 readback.submitRefused`;
|
|
279
|
+
return `保存数据(模型 ${schemaCode ?? "?"})——submit:true 被拒(${submitRefused.blocker ?? "?"}):模型有已发布流程,行保持草稿 DRAFT;三段式指引进 readback.submitRefused${nameNote}`;
|
|
258
280
|
}
|
|
259
281
|
// r68 链2-D1(真机实证):带 workflowCode 存的是**流程草稿**,但通用草稿文案教
|
|
260
282
|
// 「加 submit:true」——流程模型会被拒;正确下一步是 data.submit 三件套。
|
|
261
283
|
if (stringArg(args, "workflowCode")) {
|
|
262
|
-
return `保存流程草稿(模型 ${schemaCode ?? "?"},流程 ${stringArg(args, "workflowCode")})——行 DRAFT;下一步:从回执 performed 取 bizObjectId/workItemId/workflowInstanceId,调 data.submit 三件套提交起始待办(配方 workflow-backed-data-submit
|
|
284
|
+
return `保存流程草稿(模型 ${schemaCode ?? "?"},流程 ${stringArg(args, "workflowCode")})——行 DRAFT;下一步:从回执 performed 取 bizObjectId/workItemId/workflowInstanceId,调 data.submit 三件套提交起始待办(配方 workflow-backed-data-submit)${nameNote}`;
|
|
263
285
|
}
|
|
264
286
|
return args.submit === true
|
|
265
|
-
? `保存并直提数据(模型 ${schemaCode ?? "?"})——一调完成态:DRAFT→COMPLETED,Create
|
|
266
|
-
: `保存数据(模型 ${schemaCode ?? "?"})——草稿 DRAFT;要一调完成态加 **data.save 自己的** submit:true(data.submit 无此参数,两段式改调 data.submit
|
|
287
|
+
? `保存并直提数据(模型 ${schemaCode ?? "?"})——一调完成态:DRAFT→COMPLETED,Create 规则已派发(无流程模型;流程模型会拒绝并指路两段式)${nameNote}`
|
|
288
|
+
: `保存数据(模型 ${schemaCode ?? "?"})——草稿 DRAFT;要一调完成态加 **data.save 自己的** submit:true(data.submit 无此参数,两段式改调 data.submit)${nameNote}`;
|
|
267
289
|
}
|
|
268
290
|
case "data.update":
|
|
269
291
|
return `更新数据 ${stringArg(args, "bizObjectId") ?? "?"}(${schemaCode ?? "?"})`;
|
|
@@ -272,7 +294,10 @@ function phraseOf(tool, args, outcome) {
|
|
|
272
294
|
// 停滞(readback.flowWarning 有真相)——summary 全绿会掩盖。有警告必须抬头。
|
|
273
295
|
const flowWarning = outcome?.readback?.flowWarning;
|
|
274
296
|
const warnTag = flowWarning ? `——⚠ ${flowWarning.code === "flow-instance-exception" ? "实例异常停滞(见 readback.flowWarning)" : "流程未续走(见 readback.flowWarning)"}` : "";
|
|
275
|
-
|
|
297
|
+
// F4(w71,0.8.10):显式传 name 但被平台「数据标题」覆盖时,摘要行与
|
|
298
|
+
// data.save 同口径抬头(JSON 字段 readback.nameOverwrittenNote)。
|
|
299
|
+
const nameNote = readbackNoteClause(outcome, "nameOverwrittenNote");
|
|
300
|
+
return `提交数据(模型 ${schemaCode ?? "?"}${stringArg(args, "workItemId") ? ",审批待办" : ""})${warnTag}${nameNote}`;
|
|
276
301
|
}
|
|
277
302
|
case "data.delete": {
|
|
278
303
|
const ids = Array.isArray(args.bizObjectIds) ? args.bizObjectIds.map(String) : [];
|
|
@@ -292,7 +317,36 @@ function phraseOf(tool, args, outcome) {
|
|
|
292
317
|
const conditionRuntimeLine = Array.isArray(args.conditions) && args.conditions.length > 0
|
|
293
318
|
? ";视图固定条件只在门户运行面生效,REST `data.list --queryCode` 不应用——要在 API 侧过滤请显式传 `filter`"
|
|
294
319
|
: "";
|
|
295
|
-
|
|
320
|
+
// F14(0.8.9 探针 D)/ F8(0.8.10 探针 E):清空 actions 后回执仍列平台注入的
|
|
321
|
+
// 6 条默认动作,人读摘要要说清「清的是流程/自定义动作,剩下的是平台默认动作」,
|
|
322
|
+
// 否则会被读成 replaceActions 没生效。只要 replaceActions:true 且传了 actions
|
|
323
|
+
// (含空数组)就说;差集为空时明说「本次没有移除非默认动作」。
|
|
324
|
+
const readbackRemoved = Array.isArray(outcome?.readback?.removedActionCodes)
|
|
325
|
+
? (outcome.readback.removedActionCodes.map(String))
|
|
326
|
+
: [];
|
|
327
|
+
const readbackHasPlatformDefaults = Array.isArray(outcome?.readback?.platformDefaultActions);
|
|
328
|
+
const readbackPlatformDefaults = readbackHasPlatformDefaults
|
|
329
|
+
? (outcome.readback.platformDefaultActions.map(String))
|
|
330
|
+
: [];
|
|
331
|
+
// plan 阶段没有回读,不能断言「本次没有移除」或「回读里没有默认动作」——只说教学句。
|
|
332
|
+
const actionsRemovedClause = readbackRemoved.length > 0 ? `(移除 ${readbackRemoved.join("、")})` : readbackHasPlatformDefaults ? "(本次没有移除非默认动作)" : "";
|
|
333
|
+
const actionsDefaultsClause = !readbackHasPlatformDefaults
|
|
334
|
+
? "剩余为平台默认动作(query/get 注入)"
|
|
335
|
+
: readbackPlatformDefaults.length > 0
|
|
336
|
+
? `剩余为平台默认动作(${readbackPlatformDefaults.join("、")},query/get 注入)`
|
|
337
|
+
: "回读里没有平台注入的默认动作(剩余动作均来自本次提交或平台保留)";
|
|
338
|
+
const actionsClearedLine = args.replaceActions === true && Array.isArray(args.actions)
|
|
339
|
+
? `;流程/自定义动作已清空${actionsRemovedClause};${actionsDefaultsClause},不是 replaceActions 未生效`
|
|
340
|
+
: "";
|
|
341
|
+
// F2(0.8.10 探针 E):增量 configure 保留了平台默认系统列,摘要行必须说出来,
|
|
342
|
+
// 否则人只看到列名里多了 createdTime 等,不知道是平台既有列而非 fieldCodes 写错。
|
|
343
|
+
const systemColumnsAdded = Array.isArray(outcome?.readback?.systemColumnsAdded)
|
|
344
|
+
? (outcome.readback.systemColumnsAdded.map(String))
|
|
345
|
+
: [];
|
|
346
|
+
const systemColumnsLine = systemColumnsAdded.length > 0
|
|
347
|
+
? `;平台额外保留系统列 ${systemColumnsAdded.join("、")}(未传 replaceColumns/hideDefaultSystemFields);要精确列集合请加 replaceColumns:true + hideDefaultSystemFields:true`
|
|
348
|
+
: "";
|
|
349
|
+
return `配置列表视图 ${stringArg(args, "code") ?? schemaCode ?? "?"}(模型 ${schemaCode ?? "?"}):列 ${codes || "(未变)"}${sections.length > 0 ? `;同时配置 ${sections.join("、")}` : ""}${systemColumnsLine}${actionsClearedLine}${conditionRuntimeLine}`;
|
|
296
350
|
}
|
|
297
351
|
case "listview.delete":
|
|
298
352
|
return `删除列表视图 ${stringArg(args, "code") ?? "?"}(${schemaCode ?? "?"})`;
|
|
@@ -311,7 +311,7 @@ export const FIELD_LANE_CONTRACT = Object.freeze({
|
|
|
311
311
|
}),
|
|
312
312
|
"field.get": Object.freeze({
|
|
313
313
|
scope: "create publish readback",
|
|
314
|
-
description: "单字段读(= field.list + code 选择器,含 options/subSchema)。",
|
|
314
|
+
description: "单字段读(= field.list + code 选择器,含 options/subSchema;子表原始 subSchema 传 full:true,与 field.list.full 同义)。字段行 options 含 mappings 时回执带 mappingRuntimeNote(REST 写不跑映射,配置正确性看 options.mappings)。",
|
|
315
315
|
}),
|
|
316
316
|
"field.create": Object.freeze({
|
|
317
317
|
scope: "create publish readback",
|
|
@@ -341,7 +341,7 @@ export const FIELD_LANE_CONTRACT = Object.freeze({
|
|
|
341
341
|
}),
|
|
342
342
|
"field.publish": Object.freeze({
|
|
343
343
|
scope: "create publish readback",
|
|
344
|
-
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
|
|
344
|
+
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。",
|
|
345
345
|
}),
|
|
346
346
|
"field.delete": Object.freeze({
|
|
347
347
|
scope: "create publish readback",
|