@stalfh233/omc-cli 0.4.84 → 0.4.85

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.
@@ -18,6 +18,7 @@
18
18
  * the write lock, the writable gate, the production acknowledgement and every
19
19
  * per-tool preflight apply exactly as they do for a single call.
20
20
  */
21
+ import { refusalText } from "./cli-contract.js";
21
22
  import { runScript } from "./script.js";
22
23
  /** Cap mirrors `omc script`: a runaway list should be a refusal, not a 20-min hang. */
23
24
  export const BATCH_MAX_ENTRIES = 200;
@@ -70,7 +71,7 @@ export async function runBatchCall(options) {
70
71
  index: entry.index,
71
72
  status: String(entry.result.status ?? "failed"),
72
73
  blocker: entry.result.blocker ?? null,
73
- message: typeof entry.result.message === "string" ? entry.result.message : null,
74
+ message: refusalText(entry.result),
74
75
  ...(Array.isArray(entry.result.issues) ? { issues: entry.result.issues } : {}),
75
76
  }));
76
77
  const executed = entries.length;
@@ -117,4 +117,24 @@ export function errorEnvelope(error, code, exitCode, request) {
117
117
  const message = error instanceof Error ? error.message : String(error);
118
118
  return { envelope: envelope("error", {}, request, { code, message, retryable: false }), exitCode };
119
119
  }
120
+ /**
121
+ * The human-readable reason of a refusal. Ordinary refusals carry `message`;
122
+ * capability-gate refusals (`capability-out-of-coverage`) put the real reason in
123
+ * `citation.message` and leave `message` absent — reading only `message` made a
124
+ * batch report `message: null` for the failures that most need explaining
125
+ * (r13 2026-10-24: NUMERICAL without options.scale).
126
+ */
127
+ export function refusalText(result) {
128
+ const direct = typeof result.message === "string" && result.message.length > 0 ? result.message : "";
129
+ if (direct)
130
+ return direct;
131
+ const citation = result.citation && typeof result.citation === "object" ? result.citation : undefined;
132
+ const cited = typeof citation?.message === "string" ? citation.message : "";
133
+ if (cited)
134
+ return cited;
135
+ const reason = typeof citation?.reason === "string" ? citation.reason : "";
136
+ if (reason)
137
+ return reason;
138
+ return String(result.blocker ?? result.status ?? "failed");
139
+ }
120
140
  //# sourceMappingURL=cli-contract.js.map
@@ -18,7 +18,7 @@
18
18
  */
19
19
  import { argvValue } from "./args.js";
20
20
  import { runToolCall } from "./call.js";
21
- import { CLI_EXIT_CODES, classifyResult, envelope, requestId } from "./cli-contract.js";
21
+ import { CLI_EXIT_CODES, classifyResult, envelope, refusalText, requestId } from "./cli-contract.js";
22
22
  import { writeEnvelope } from "./cli-output.js";
23
23
  /** Validate the caller's `--fields` payload (fail before any write). */
24
24
  export function validateScaffoldFields(fields) {
@@ -294,21 +294,6 @@ export async function cmdModelScaffold(args) {
294
294
  writeEnvelope(envelope(classified.status, result, request, classified.error));
295
295
  return status === "partial" ? 1 : 0;
296
296
  }
297
- /**
298
- * A refusal's human text: `message` for ordinary ones, `citation.message` for
299
- * capability-gate refusals (`capability-out-of-coverage` keeps its reason inside
300
- * the citation, so the old `message` read produced an empty failure string).
301
- */
302
- function refusalText(result) {
303
- const direct = typeof result.message === "string" && result.message.length > 0 ? result.message : "";
304
- if (direct)
305
- return direct;
306
- const citation = result.citation && typeof result.citation === "object" ? result.citation : undefined;
307
- const cited = typeof citation?.message === "string" ? citation.message : "";
308
- if (cited)
309
- return cited;
310
- return String(result.blocker ?? "failed");
311
- }
312
297
  function describeScaffoldPlan(options) {
313
298
  const childTables = options.fields.filter((field) => scaffoldChildrenOf(field).length > 0);
314
299
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stalfh233/omc-cli",
3
- "version": "0.4.84",
3
+ "version": "0.4.85",
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.84",
53
+ "@stalfh233/omc-fake-platform": "0.4.85",
54
54
  "commander": "14.0.3",
55
- "omc-core": "0.4.84",
55
+ "omc-core": "0.4.85",
56
56
  "proper-lockfile": "4.1.2",
57
57
  "write-file-atomic": "6.0.0",
58
58
  "zod": "^3.23.8",