@stalfh233/omc-cli 0.4.65 → 0.4.66

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.
Files changed (2) hide show
  1. package/dist/cli.js +11 -1
  2. package/package.json +3 -3
package/dist/cli.js CHANGED
@@ -14,7 +14,7 @@ import { readArgsFile, readStdinArgs, runToolCall, validateAgentPaths } from "./
14
14
  import { environmentWritable, requiresProductionConfirmation } from "./environment-policy.js";
15
15
  import { CLI_EXIT_CODES, classifyResult, envelope, errorEnvelope, requestId } from "./cli-contract.js";
16
16
  import { configureOutput, humanSummary, stripOutputFlags, writeEnvelope } from "./cli-output.js";
17
- import { beginUsage, completeUsage, usageReport } from "./usage-log.js";
17
+ import { beginUsage, completeUsage, recordUsageOutput, usageReport } from "./usage-log.js";
18
18
  import { artifactFetchHint, artifactRoot, boundResult, emitInvalid, emitResult, emitTransportResult, outputBudget, readArtifact, withTransport, } from "./command-transport.js";
19
19
  import { CLI_DEFAULT_OUTPUT_BYTES, assertSafeOutputPath } from "./artifacts.js";
20
20
  import { resolve } from "node:path";
@@ -1022,6 +1022,16 @@ async function main() {
1022
1022
  return;
1023
1023
  }
1024
1024
  commandExitCode = await runScript(lines, { defaultEnv: options.env, continueOnError: options.continue === true });
1025
+ // `script` emits NDJSON (one envelope per line), so the single-envelope
1026
+ // recorder never ran and usage.jsonl left every batch at its initial
1027
+ // "no-envelope" status — a successful 4-call batch looked like 4 failures
1028
+ // (r6-onboarding 2026-10-21: 9/9 batches mislabelled). Record the batch
1029
+ // outcome so cost accounting and failure rates stay truthful.
1030
+ recordUsageOutput({
1031
+ status: commandExitCode === 0 ? "ok" : "refused",
1032
+ ...(commandExitCode === 0 ? {} : { error: { code: "script-batch-failed" } }),
1033
+ script: { lines: lines.length },
1034
+ }, 0);
1025
1035
  });
1026
1036
  const rollbackCommand = command.command("rollback").description("配置回滚(git-revert 语义):list 列写时间线 / plan 预览恢复(diff+后续写覆盖警告)/ apply 执行恢复——恢复走完整写闸门并记 journal(回滚可再回滚)。接入全部配置写面(workflow/规则/数据规则/视图/表单草稿/在线JS/字典/字段/模型/应用/报表);publish 类生命周期推进不可逆(plan 会说明);journal 与 before 快照为本机边界(不跨机器)");
1027
1037
  rollbackCommand.command("list").option("--env <environment>").option("--environment <environment>").option("--target <substr>").option("--tool <name>").option("--limit <n>").action(async (options) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stalfh233/omc-cli",
3
- "version": "0.4.65",
3
+ "version": "0.4.66",
4
4
  "description": "CloudPivot 8.6 configuration capability CLI — governed, fail-closed, coverage-manifest bounded.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -50,9 +50,9 @@
50
50
  "access": "public"
51
51
  },
52
52
  "dependencies": {
53
- "@stalfh233/omc-fake-platform": "0.4.65",
53
+ "@stalfh233/omc-fake-platform": "0.4.66",
54
54
  "commander": "14.0.3",
55
- "omc-core": "0.4.65",
55
+ "omc-core": "0.4.66",
56
56
  "proper-lockfile": "4.1.2",
57
57
  "write-file-atomic": "6.0.0",
58
58
  "zod": "^3.23.8",