@stalfh233/omc-cli 0.6.97 → 0.6.99
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 +62 -7
- package/dist/environment-policy.js +1 -1
- package/dist/lanes/datarule-contract.js +1 -1
- package/dist/lanes/environment.js +17 -19
- package/dist/lanes/perm.js +303 -33
- package/dist/lanes/runtime-data-contract.js +3 -3
- package/dist/lanes/runtime-data.js +33 -2
- package/dist/lanes/workflow-contract.js +1 -1
- package/dist/lanes/workflow.js +84 -10
- package/dist/path-projection.js +1 -1
- package/dist/read-shapes.js +3 -3
- package/dist/read.js +14 -1
- package/dist/rollback.js +33 -2
- package/dist/session.js +79 -38
- package/dist/write.js +49 -1
- package/package.json +3 -3
- package/skills/omc-write-hazards.md +17 -0
package/dist/cli.js
CHANGED
|
@@ -27,7 +27,7 @@ import { CLI_DEFAULT_OUTPUT_BYTES, assertSafeOutputPath, pruneArtifacts } from "
|
|
|
27
27
|
import { sessionAccountForEnvironment } from "./session-account.js";
|
|
28
28
|
import { closeWritableWindow, openWritableWindow, parseWritableTtl, sweepWritableWindowsAtStartup, validateWritableReason, writableWindowStatus, WRITABLE_WINDOW_DEFAULT_TTL_MINUTES, WRITABLE_WINDOW_LOG, WRITABLE_WINDOW_MAX_TTL_MINUTES, WritableWindowInputError } from "./writable-window.js";
|
|
29
29
|
import { artifactPathMissHint, nullProjectionHint, PATH_MISS_HELP_REF, partialPathMissHint, pathMissCopyableHint, pathMissCopyablePaths, pathMissCrossFaceCorrection, pathMissDidYouMean, projectJsonPath, projectJsonPathFanout, projectResultExtract, shapeOf, SHAPE_MAX_DEPTH, unwrapSinglePathProjection } from "./path-projection.js";
|
|
30
|
-
import { basename, join, resolve } from "node:path";
|
|
30
|
+
import { basename, dirname, join, resolve } from "node:path";
|
|
31
31
|
import { existsSync, readFileSync, writeFileSync, chmodSync } from "node:fs";
|
|
32
32
|
import { buildToolRegistry } from "./tools.js";
|
|
33
33
|
import { parseDurationMs } from "./duration.js";
|
|
@@ -1015,6 +1015,30 @@ function resolvedDefaultEnvironment(store) {
|
|
|
1015
1015
|
* template re-read three times is 81 KB of the session.
|
|
1016
1016
|
*/
|
|
1017
1017
|
const ARTIFACT_INLINE_CEILING_BYTES = 8192;
|
|
1018
|
+
/** commands --json 的上下文预算;当前目录约 31.5KiB,留出兼容窗口。 */
|
|
1019
|
+
const COMMANDS_JSON_INLINE_CEILING_BYTES = 32 * 1024;
|
|
1020
|
+
/** 超过这个体积就提醒走更窄的面(不改变返回值)。 */
|
|
1021
|
+
const COMMANDS_JSON_HINT_BYTES = 16 * 1024;
|
|
1022
|
+
/**
|
|
1023
|
+
* issue 2026-11 F3:默认骨架不是限流——同一句话必须同时出现在 `hint` 与顶层
|
|
1024
|
+
* `message`(并列通道同源),否则只看 message 的程序化消费方会误判。
|
|
1025
|
+
*/
|
|
1026
|
+
function artifactOutlineHint(id, bytes, depth) {
|
|
1027
|
+
return `正文 ${Math.round(bytes / 1024)}KB 超过内联上限 ${ARTIFACT_INLINE_CEILING_BYTES}B,默认只回深度 ${depth} 骨架(键/类型/数组长度/示例值),不是输出限流。加深:--depth ≤${SHAPE_MAX_DEPTH};子树骨架:--shape <path>;取键:--keys <a,b>;取路径:--jq '<path>';整包:--full 或 --out <配置根内路径>;只元数据:--meta。`;
|
|
1028
|
+
}
|
|
1029
|
+
function artifactDefaultMetadata(id, bytes, content, depth) {
|
|
1030
|
+
return {
|
|
1031
|
+
status: "ok",
|
|
1032
|
+
artifactId: id,
|
|
1033
|
+
bytes,
|
|
1034
|
+
outline: true,
|
|
1035
|
+
depth,
|
|
1036
|
+
shape: shapeOf(content, depth),
|
|
1037
|
+
hint: artifactOutlineHint(id, bytes, depth),
|
|
1038
|
+
message: artifactOutlineHint(id, bytes, depth),
|
|
1039
|
+
fullCommand: `omc artifact get ${id} --full`,
|
|
1040
|
+
};
|
|
1041
|
+
}
|
|
1018
1042
|
/**
|
|
1019
1043
|
* `artifact get --jq`: one path walk, with `[]` fan-out (same syntax as
|
|
1020
1044
|
* `omc call --jq`). Returns the envelope fields so both the `--summary` and the
|
|
@@ -1162,6 +1186,17 @@ async function cmdArtifactGet(id, transport, options = {}) {
|
|
|
1162
1186
|
// command instead, which is the portable way to reach the body.
|
|
1163
1187
|
if (options.pathOnly)
|
|
1164
1188
|
return emitTransportResult({ status: "ok", artifactId: id, sha256: artifact.sha256, fetch: artifactFetchHint(id) }, transport);
|
|
1189
|
+
// --meta is the stable metadata-only choice. It deliberately never returns
|
|
1190
|
+
// the body, including for small artifacts whose default face is inline.
|
|
1191
|
+
if (options.meta === true) {
|
|
1192
|
+
const depth = options.depth ?? 2;
|
|
1193
|
+
return emitTransportResult({
|
|
1194
|
+
...artifactDefaultMetadata(id, artifact.content.length, content, depth),
|
|
1195
|
+
sha256: artifact.sha256,
|
|
1196
|
+
projectionRule: "投影要写到叶子(数组元素里的字段);取值用 --jq <path> 或 --keys <a,b>",
|
|
1197
|
+
projectionExample: `omc artifact get ${id} --jq '<path>'`,
|
|
1198
|
+
}, transport);
|
|
1199
|
+
}
|
|
1165
1200
|
// r75 调查C:`--shape [path]` 回执形状先验——深度受限骨架(默认 2,--depth 可
|
|
1166
1201
|
// 到 4)。--summary 是预算事实(多大/会不会截断),--shape 是导航图(嵌套骨架
|
|
1167
1202
|
// 到哪层有哪些键);>8KB 默认 outline 与本分支共用同一份 shapeOf(单一真相源,
|
|
@@ -1300,7 +1335,8 @@ async function cmdArtifactGet(id, transport, options = {}) {
|
|
|
1300
1335
|
outline: true,
|
|
1301
1336
|
depth,
|
|
1302
1337
|
shape: shapeOf(content, depth),
|
|
1303
|
-
hint:
|
|
1338
|
+
hint: artifactOutlineHint(id, artifact.content.length, depth),
|
|
1339
|
+
message: artifactOutlineHint(id, artifact.content.length, depth),
|
|
1304
1340
|
projectionRule: "投影要写到叶子(数组元素里的字段);写整棵父节点(如 data.activities)会因总量超限再次被外置",
|
|
1305
1341
|
...(() => {
|
|
1306
1342
|
const rec = content && typeof content === "object" && !Array.isArray(content) ? content : undefined;
|
|
@@ -1311,7 +1347,7 @@ async function cmdArtifactGet(id, transport, options = {}) {
|
|
|
1311
1347
|
fullCommand: `omc artifact get ${id} --full`,
|
|
1312
1348
|
}, transport);
|
|
1313
1349
|
}
|
|
1314
|
-
const result = { status: "ok", artifactId: id, sha256: artifact.sha256, content };
|
|
1350
|
+
const result = { status: "ok", artifactId: id, sha256: artifact.sha256, content, fullCommand: `omc artifact get ${id}`, projectionExample: `omc artifact get ${id} --jq '<path>'` };
|
|
1315
1351
|
if (Buffer.byteLength(JSON.stringify(result), "utf8") > transport.maxOutputBytes) {
|
|
1316
1352
|
// 2026-11-04 r70: `--full` used to fall back to the same bare `fetch`
|
|
1317
1353
|
// pointer it had just been asked to bypass — re-running `--full` re-hits
|
|
@@ -1770,6 +1806,17 @@ function cmdDiscovery(kind, transport, value, options = {}) {
|
|
|
1770
1806
|
}
|
|
1771
1807
|
}
|
|
1772
1808
|
result = inventory;
|
|
1809
|
+
if (options.json === true && options.compact !== true) {
|
|
1810
|
+
const inventoryBytes = Buffer.byteLength(JSON.stringify({ status: "ok", ...inventory }), "utf8");
|
|
1811
|
+
// issue 2026-11 F10:全量目录一行就是 30KB+。超预算外置成 artifact 指针
|
|
1812
|
+
// (--inline 强制内联);尚未超预算但已偏大时给一句指路,别再无声灌上下文。
|
|
1813
|
+
if (options.inline !== true && inventoryBytes > COMMANDS_JSON_INLINE_CEILING_BYTES)
|
|
1814
|
+
return emitTransportResult(boundResult({ status: "ok", ...inventory }, COMMANDS_JSON_INLINE_CEILING_BYTES), transport);
|
|
1815
|
+
// 不往 stdout 加字段:`commands --json` 的字节是 golden 钉死面(新能力必须
|
|
1816
|
+
// opt-in)。指路走 stderr(人类通道),程序化消费者字节不变。
|
|
1817
|
+
if (inventoryBytes > COMMANDS_JSON_HINT_BYTES)
|
|
1818
|
+
console.error(`全量目录 ${Math.round(inventoryBytes / 1024)}KB(单行);找工具用 --compact / --filter / --lane / --kind,确实要全量再加 --inline(当前未超 ${Math.round(COMMANDS_JSON_INLINE_CEILING_BYTES / 1024)}KiB 外置门)`);
|
|
1819
|
+
}
|
|
1773
1820
|
}
|
|
1774
1821
|
else if (kind === "contract") {
|
|
1775
1822
|
if (options.tool !== undefined) {
|
|
@@ -2974,13 +3021,20 @@ async function main() {
|
|
|
2974
3021
|
return;
|
|
2975
3022
|
}
|
|
2976
3023
|
const rows = store.listEnvironments().map((item) => ({ name: item.name, baseUrl: item.profile.baseUrl, applicationCode: item.profile.applicationCode, isDefault: item.profile.isDefault === true, writable: item.profile.writable !== false, credential: store.hasCredential(item.name) ? "ok" : "missing" }));
|
|
3024
|
+
// issue 2026-11 F5:清单来源(配置根 + 项目根)不回显时,同一条命令在不同
|
|
3025
|
+
// cwd 语义不同、且会静默落到机器全局 default——真机会话因此白打错环境。
|
|
3026
|
+
const paths = store.configPaths;
|
|
3027
|
+
const configRoot = dirname(paths.configPath);
|
|
3028
|
+
const projectRoot = dirname(paths.projectEnvPath);
|
|
3029
|
+
const binding = { configRoot, projectRoot, bindingFiles: { ".omc-env": paths.projectEnvPath, ".omc-envs": paths.projectEnvsPath }, note: "环境集合由「项目根」的 .omc-env/.omc-envs + 配置根的 omc.config.json 共同决定;换目录会换集合" };
|
|
2977
3030
|
if (options.json)
|
|
2978
|
-
process.stdout.write(JSON.stringify({ ok: true, environments: rows }, null, 2) + "\n");
|
|
3031
|
+
process.stdout.write(JSON.stringify({ ok: true, configRoot, projectRoot, environments: rows, binding }, null, 2) + "\n");
|
|
2979
3032
|
else if (rows.length === 0)
|
|
2980
|
-
console.error(
|
|
3033
|
+
console.error(`(none configured; run omc setup)\n配置根:${configRoot}\n项目根:${projectRoot}`);
|
|
2981
3034
|
// A5(GitLab #15):credential: missing 的环境列得出、调不通(auth-config)——
|
|
2982
3035
|
// 标注出来,防把"没凭据"误判成"参数写错"。
|
|
2983
3036
|
else {
|
|
3037
|
+
console.error(`配置根:${configRoot} 项目根:${projectRoot}(环境集合由这两处决定,换目录会换集合)`);
|
|
2984
3038
|
for (const row of rows)
|
|
2985
3039
|
console.error(`${row.name}${row.isDefault ? " (default)" : ""} ${row.baseUrl} app=${row.applicationCode}${row.writable ? "" : " [read-only]"}${row.credential === "ok" ? "" : " [credential: missing → omc setup]"}`);
|
|
2986
3040
|
// r55(2026-11-11 Windows 真机联调摩擦):agent 为拿 token 花 7 轮、用户手粘
|
|
@@ -3284,7 +3338,7 @@ async function main() {
|
|
|
3284
3338
|
console.error(`已清理 ${result.removed} 个读回产物,释放 ${formatBytes(result.freedBytes)};保留 ${result.kept} 个(${formatBytes(result.keptBytes)})`);
|
|
3285
3339
|
commandExitCode = CLI_EXIT_CODES.ok;
|
|
3286
3340
|
});
|
|
3287
|
-
artifactCommand.command("get <id>").addOption(new Option("--jq [path]", "路径选择器(非 jq);支持 [] 映射与逗号多路径;裸 --jq 列顶层键").argParser((value, previous = []) => [...previous, value]).default([])).option("--extract <path>", "同 --jq(与 omc call 的 --extract 同名,省一次命名切换)").option("--path-only").option("--shape [path]", "回执形状先验:深度受限骨架(键/类型/数组长度/≤40 字符示例值),一次看全嵌套路径图再 --jq;裸 --shape = 整棵根,--shape <path> = 命中子树(同 --jq 的路径 DSL);与 >8KB 默认 outline 同一实现").option("--depth <n>", "骨架深度 1-4(默认 2;--shape 与 >8KB 默认 outline 消费)").option("--summary").option("--keys [a,b]").option("--full", "整包返回正文(默认:正文超过 8KB 时只回深度 2 骨架 outline,按需 --shape/--jq/--keys 定向取值)").option("--out <path>", "把 artifact 原始正文全量写到配置根内文件(0600;写文件不走 stdout 限额,大对象一次落盘备份;回执只给 {out,bytes,sha256} 不回正文。根内父目录自动创建;配置根外(含系统临时目录)拒绝,拒绝错误里带可用的根内示例路径。stdout 管道提取用两步:--out <根内路径> 后 cat 该文件——`--out -` 会破坏单信封契约,不支持)").option("--max-output-bytes <bytes>").action(async (id, options) => {
|
|
3341
|
+
artifactCommand.command("get <id>").addOption(new Option("--jq [path]", "路径选择器(非 jq);支持 [] 映射与逗号多路径;裸 --jq 列顶层键").argParser((value, previous = []) => [...previous, value]).default([])).option("--extract <path>", "同 --jq(与 omc call 的 --extract 同名,省一次命名切换)").option("--path-only").option("--shape [path]", "回执形状先验:深度受限骨架(键/类型/数组长度/≤40 字符示例值),一次看全嵌套路径图再 --jq;裸 --shape = 整棵根,--shape <path> = 命中子树(同 --jq 的路径 DSL);与 >8KB 默认 outline 同一实现").option("--depth <n>", "骨架深度 1-4(默认 2;--shape 与 >8KB 默认 outline 消费)").option("--summary").option("--keys [a,b]").option("--meta", "只回元数据,不回正文").option("--full", "整包返回正文(默认:正文超过 8KB 时只回深度 2 骨架 outline,按需 --shape/--jq/--keys 定向取值)").option("--out <path>", "把 artifact 原始正文全量写到配置根内文件(0600;写文件不走 stdout 限额,大对象一次落盘备份;回执只给 {out,bytes,sha256} 不回正文。根内父目录自动创建;配置根外(含系统临时目录)拒绝,拒绝错误里带可用的根内示例路径。stdout 管道提取用两步:--out <根内路径> 后 cat 该文件——`--out -` 会破坏单信封契约,不支持)").option("--max-output-bytes <bytes>").action(async (id, options) => {
|
|
3288
3342
|
// A bare `--jq`/`--keys` is a key-inventory request, not a missing argument:
|
|
3289
3343
|
// commander's "argument missing" (invalid-input + retry) is a dead end the
|
|
3290
3344
|
// caller cannot fix without already knowing the flag takes a value (r11
|
|
@@ -3307,6 +3361,7 @@ async function main() {
|
|
|
3307
3361
|
...(shapeValue !== undefined ? { shape: shapeValue } : {}),
|
|
3308
3362
|
...(depthValue !== undefined ? { depth: depthValue } : {}),
|
|
3309
3363
|
summary: options.summary === true || options.keys === true || bareJq,
|
|
3364
|
+
meta: options.meta === true,
|
|
3310
3365
|
pureKeys: (options.keys === true || bareJq) && options.summary !== true, ...(typeof options.keys === "string" ? { keys: options.keys } : {}), full: options.full === true, ...(artifactGetOutPath !== undefined ? { out: artifactGetOutPath } : {})
|
|
3311
3366
|
}));
|
|
3312
3367
|
});
|
|
@@ -3314,7 +3369,7 @@ async function main() {
|
|
|
3314
3369
|
command.command("residue <prefix>").description("跨面前缀残留扫描(model 全租户/folder/custompage;默认 deep 再查命中模型的 rule/datarule/onlinejs)——收尾「删净」一次证明,clean:true 即零残留。清理入口:omc model-purge --code <schemaCode>(按依赖倒序,默认 dry-run)。只读零写入;report 面暂停维护未扫描").option("--env <environment>", "环境名(默认按 cwd 的 .omc-env 解析)").option("--apps <codes>", "all(默认,全租户)或逗号分隔应用码").option("--no-deep", "只扫 model/folder/custompage,不深查命中模型").option("--all-faces", "列出全部应用×面(含 count:0;默认只回非零面+byFace/userResidues 紧凑形)").option("--max-output-bytes <bytes>").addOption(new Option("--jq [path]", "--jq 不是 jq,仅路径选择器(与 call --jq 同 DSL;可逗号多路径;裸 --jq 列顶层键)").argParser((value, previous = []) => [...previous, value]).default([])).action(async (prefix, options) => { commandExitCode = await withTransport(options, request, (transport) => cmdResidue(prefix, { env: options.env, apps: options.apps, ...(options.deep === false ? { noDeep: true } : {}), ...(options.allFaces ? { allFaces: true } : {}), ...(options.jq !== undefined ? { jq: options.jq } : {}) }, transport)); });
|
|
3315
3370
|
command.command("track <schemaCode> <bizObjectId>").description("读取单条业务数据的行级变更留痕(只读;平台来源枚举含 BUSINESS_RULE 时原样回传)").option("--env <environment>").option("--property-code <code>").option("--max-output-bytes <bytes>").action(async (schemaCode, bizObjectId, options) => { commandExitCode = await withTransport(options, request, (transport) => cmdTrack(schemaCode, bizObjectId, { env: options.env, propertyCode: options.propertyCode }, transport)); });
|
|
3316
3371
|
const jqOption = () => new Option("--jq [path]", "--jq 不是 jq,仅路径选择器(与 call --jq 同 DSL;可逗号多路径;裸 --jq 列顶层键)").argParser((value, previous = []) => [...previous, value]).default([]);
|
|
3317
|
-
command.command("commands").description("路由索引(不是目录):工具计数+展开梯子;--kind read 一屏列全部只读工具与必填参数;--json 才是全量目录").option("--json").option("--compact").option("--filter <keyword>").option("--capability <id>").option("--lane <id>").option("--kind <kind>", "按读写维度过滤:read|write|meta(read = 只读工具索引)").option("--read-only", "等价 --kind read(与 --kind 互斥)").option("--limit <n>", "分页:最多 n 行(1..200;给定即关闭宽词分组)").option("--offset <n>", "分页起点(默认 0;未给 --limit 时按 50)").option("--max-output-bytes <bytes>").addOption(jqOption()).action(async (options) => { commandExitCode = await withTransport(options, request, (transport) => cmdDiscovery("commands", transport, undefined, { json: options.json === true, compact: options.compact === true, ...(options.filter ? { filter: options.filter } : {}), ...(options.capability ? { capability: options.capability } : {}), ...(options.lane ? { lane: options.lane } : {}), ...(options.kind !== undefined ? { kind: options.kind } : {}), ...(options.readOnly === true ? { readOnly: true } : {}), ...(options.limit !== undefined ? { limit: options.limit } : {}), ...(options.offset !== undefined ? { offset: options.offset } : {}), ...(options.jq !== undefined ? { jq: options.jq } : {}) })); });
|
|
3372
|
+
command.command("commands").description("路由索引(不是目录):工具计数+展开梯子;--kind read 一屏列全部只读工具与必填参数;--json 才是全量目录").option("--json").option("--compact").option("--inline", "commands --json 超过 32KiB 时仍内联").option("--filter <keyword>").option("--capability <id>").option("--lane <id>").option("--kind <kind>", "按读写维度过滤:read|write|meta(read = 只读工具索引)").option("--read-only", "等价 --kind read(与 --kind 互斥)").option("--limit <n>", "分页:最多 n 行(1..200;给定即关闭宽词分组)").option("--offset <n>", "分页起点(默认 0;未给 --limit 时按 50)").option("--max-output-bytes <bytes>").addOption(jqOption()).action(async (options) => { commandExitCode = await withTransport(options, request, (transport) => cmdDiscovery("commands", transport, undefined, { json: options.json === true, compact: options.compact === true, inline: options.inline === true, ...(options.filter ? { filter: options.filter } : {}), ...(options.capability ? { capability: options.capability } : {}), ...(options.lane ? { lane: options.lane } : {}), ...(options.kind !== undefined ? { kind: options.kind } : {}), ...(options.readOnly === true ? { readOnly: true } : {}), ...(options.limit !== undefined ? { limit: options.limit } : {}), ...(options.offset !== undefined ? { offset: options.offset } : {}), ...(options.jq !== undefined ? { jq: options.jq } : {}) })); });
|
|
3318
3373
|
command.command("describe <tool>").option("--full").option("--cache-ok", "允许 --full 在同会话重复读时短路为 artifact 指针(默认每次回全文)").option("--schema-only").option("--param <name>").option("--example [id]").option("--max-output-bytes <bytes>").addOption(jqOption()).action(async (tool, options) => {
|
|
3319
3374
|
commandExitCode = await withTransport(options, request, (transport) => cmdDiscovery("describe", transport, tool, { full: options.full === true, cacheOk: options.cacheOk === true, schemaOnly: options.schemaOnly === true, ...(options.param ? { param: options.param } : {}), ...(options.example ? { example: options.example } : {}), ...(options.jq !== undefined ? { jq: options.jq } : {}) }));
|
|
3320
3375
|
});
|
|
@@ -37,7 +37,7 @@ export function versionEvidenceOf(input) {
|
|
|
37
37
|
return {
|
|
38
38
|
detectedVersion: detected,
|
|
39
39
|
inAnchorFamily: detected.startsWith(`${input.versionFamily}.`),
|
|
40
|
-
versionSource: "system-config",
|
|
40
|
+
versionSource: input.versionSource ?? "system-config",
|
|
41
41
|
anchorVersion: input.anchorVersion,
|
|
42
42
|
versionFamily: input.versionFamily,
|
|
43
43
|
...(input.versionNotice ? { versionNotice: input.versionNotice } : {}),
|
|
@@ -90,7 +90,7 @@ export const DATARULE_LANE_CONTRACT = Object.freeze({
|
|
|
90
90
|
"**类型3/4/5 条件串协议(平台 create 不校验,坏形状落库即雷,工具按此协议拒绝)**:`{字段code} 操作符 [值]`。操作符取 **bizdatarule 词表**(与字段 options 的表单交互引擎不同——那是符号式):**中文** 等于/不等于/大于/小于/大于等于/小于等于/包含/不包含/包含全部/不包含全部/包含任意一个/不包含任意一个/等于任意一个/属于/不属于/介于/为空/不为空,也接受符号 `==` `!=` `>` `<` `>=` `<=` `Contains` `IsEmpty` 等。为空/不为空**不带值**(`{field} 不为空`);其余带值(JSON 对象或标量)。多条件 ` && `、多组 ` || `。示例 type4:`options:{requiredFormula:\"{amount} 等于 {\\\"valueType\\\":\\\"specifyOption\\\",\\\"value\\\":\\\"A\\\"}\"}`。**字段绑定用 `propertyCodes`(数组)**,工具自动把 `options.propertyCodes` 也补上。",
|
|
91
91
|
"`options` is a JSON object sent to the wire as a JSON string(逐类型必读键见 `options` 参数面)。",
|
|
92
92
|
"类型2(计算/拼接):`options.shortTextStitch`(或 `value`)的值**必须是含 `formula` 的 JSON 对象字符串**,裸串会被工具拒绝(否则引擎返回 null → 误报 305003 死循环);顶层没有 `expression` 键——它只是该嵌套 JSON 内部的字段名(可照抄 `--example field-compute-rule`)。",
|
|
93
|
-
"Missing type or schemaCode is refused before any write.",
|
|
93
|
+
"Missing type or schemaCode is refused before any write. 同字段同类型已存在时零写入拒绝(blocker `datarule-duplicate-property-type`,回执带现有 `id` 与改走 `datarule.update` 的命令)——批量造规则不必先 list 自查。",
|
|
94
94
|
"根因提示:类型2 CALCULATE 在未发布应用上会报假死循环 305003——工具反推后拒 app-not-published;类型 3/4/5 不受影响(误判机制见 `--example field-compute-rule`)。",
|
|
95
95
|
]),
|
|
96
96
|
}),
|
|
@@ -17,6 +17,7 @@ function versionEvidenceFor(ctx, session) {
|
|
|
17
17
|
const notice = detected ? versionFamilyNotice(ctx.manifest, detected) : undefined;
|
|
18
18
|
return versionEvidenceOf({
|
|
19
19
|
detectedVersion: detected,
|
|
20
|
+
versionSource: session.versionEvidenceSource(),
|
|
20
21
|
versionFamily: ctx.manifest.version_family,
|
|
21
22
|
anchorVersion: ctx.manifest.anchor_version,
|
|
22
23
|
...(notice ? { versionNotice: notice } : {}),
|
|
@@ -39,28 +40,25 @@ function versionEvidenceFor(ctx, session) {
|
|
|
39
40
|
*/
|
|
40
41
|
const EXTENSION_SHA_UNAVAILABLE = "平台没有暴露扩展/前端构件 build sha 的端点(8.6.26 与 1.1.25 反编译 + 真机均无);版本判断只能用 productVersion";
|
|
41
42
|
async function platformVersionBlock(session) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
catch {
|
|
56
|
-
// fall through to the system/config face — the license face is 8.6-only
|
|
57
|
-
}
|
|
43
|
+
// F7:license 载荷在登录期已经探测过(session.licenseInfo),这里复用它,不再
|
|
44
|
+
// 为展示面重复打一次 wire;字段口径与 r86 一致(buildTime 只有平台回传才带)。
|
|
45
|
+
const license = session.licenseInfo();
|
|
46
|
+
const licenseVersion = license && typeof license.systemVersion === "string" && license.systemVersion.trim() ? license.systemVersion.trim() : undefined;
|
|
47
|
+
if (licenseVersion !== undefined && license !== undefined)
|
|
48
|
+
return {
|
|
49
|
+
productVersion: licenseVersion,
|
|
50
|
+
...(typeof license.buildTime === "string" && license.buildTime ? { buildTime: license.buildTime } : {}),
|
|
51
|
+
...(license.licenseType !== undefined && license.licenseType !== null ? { licenseType: license.licenseType } : {}),
|
|
52
|
+
...(typeof license.expiration === "string" && license.expiration ? { licenseExpiration: license.expiration } : {}),
|
|
53
|
+
source: "license/info",
|
|
54
|
+
extensionBuildShaUnavailable: EXTENSION_SHA_UNAVAILABLE,
|
|
55
|
+
};
|
|
58
56
|
const raw = session.rawSystemVersion();
|
|
59
57
|
if (raw !== undefined)
|
|
60
58
|
return {
|
|
61
59
|
productVersion: raw,
|
|
62
60
|
source: "public/system-config systemVersion",
|
|
63
|
-
licenseFaceUnavailable: "license/info 不可达(真机 1.1.25:未认证 401
|
|
61
|
+
licenseFaceUnavailable: "license/info 不可达(真机 1.1.25:未认证 401、管理员 404——该产品线不挂载);buildTime 只在平台回传时才有",
|
|
64
62
|
extensionBuildShaUnavailable: EXTENSION_SHA_UNAVAILABLE,
|
|
65
63
|
};
|
|
66
64
|
// 登录缓存沿用(老缓存只存了点号版本、没有原串):用 detectedVersion 兜底——
|
|
@@ -79,10 +77,10 @@ async function platformVersionBlock(session) {
|
|
|
79
77
|
function platformVersionBlockFromSession(session) {
|
|
80
78
|
const cached = session.rawSystemVersion();
|
|
81
79
|
if (cached !== undefined)
|
|
82
|
-
return { productVersion: cached, source: "public/system-config
|
|
80
|
+
return { productVersion: cached, source: session.versionEvidenceSource() ?? "public/system-config", extensionBuildShaUnavailable: EXTENSION_SHA_UNAVAILABLE };
|
|
83
81
|
const detected = session.detectedVersion();
|
|
84
82
|
if (detected !== undefined)
|
|
85
|
-
return { productVersion: detected, source: "token-cache
|
|
83
|
+
return { productVersion: detected, source: session.versionEvidenceSource() ?? "token-cache", extensionBuildShaUnavailable: EXTENSION_SHA_UNAVAILABLE };
|
|
86
84
|
return { versionUnavailable: "缓存命中面零 wire:license/info 未查,登录缓存也没有版本证据(refresh:true 重查)" };
|
|
87
85
|
}
|
|
88
86
|
export function registerEnvironmentLane(tools) {
|