bpmax-cli 0.2.1-beta.3 → 0.2.1-beta.4

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/README.md CHANGED
@@ -364,7 +364,7 @@ bpmax-cli config readback dataset-field --id 5926 --format json
364
364
  bpmax-cli config flow-app context --workspace <workspace> --flow <flow_type_or_name> --evidence-out .codex/tmp/target-context.csv --format json
365
365
  ```
366
366
 
367
- `flow-app create` dry-run responses include `required_confirm`; automation should copy that exact value instead of reconstructing confirmation text. Typed create/submit responses expose stable `id`, `key`, and `readback_hint` fields for collectors.
367
+ `flow-app create` dry-run responses include `required_confirm`; automation should copy that exact value instead of reconstructing confirmation text. Direct typed create/submit responses expose stable top-level `id`, `key`, and `readback_hint` fields for collectors.
368
368
 
369
369
  Dataset relation fields and lifecycle actions are typed:
370
370
 
@@ -381,6 +381,8 @@ bpmax-cli config batch submit --manifest .codex/tmp/config-batch.json --continue
381
381
  bpmax-cli config batch readback --manifest .codex/tmp/config-readback-batch.json --continue-on-error --format json
382
382
  ```
383
383
 
384
+ Batch row `response_out` files are envelopes: read `ok`, `domain`, `id`, and `action` at the top level, and read typed command fields from `response.id`, `response.key`, and `response.readback_hint`. If a row stops at dry-run, copy `response.required_confirm` into the manifest row's `confirm` before retrying.
385
+
384
386
  ## BPMAX AI implementation taskbooks
385
387
 
386
388
  `bpmax-cli taskbook` manages local AI implementation taskbooks before configuration work is dispatched:
package/dist/bin.js CHANGED
@@ -469,7 +469,7 @@ function pluginAgentCapabilityForRequest(method, normalizedPath) {
469
469
  // package.json
470
470
  var package_default = {
471
471
  name: "bpmax-cli",
472
- version: "0.2.1-beta.3",
472
+ version: "0.2.1-beta.4",
473
473
  description: "CLI for BPMAX environments with multi-profile config and local login callback flow",
474
474
  type: "module",
475
475
  bin: {
@@ -8297,7 +8297,7 @@ async function runDatasetLifecycleAction(config, profile, action, id, confirm3)
8297
8297
  }
8298
8298
  function normalizeConfigBatchItems(manifest) {
8299
8299
  if (Array.isArray(manifest)) {
8300
- return manifest.filter(isRecord3);
8300
+ return manifest.map((raw) => ({ raw, item: isRecord3(raw) ? raw : null }));
8301
8301
  }
8302
8302
  if (!isRecord3(manifest)) {
8303
8303
  throw new Error("config batch manifest must be a JSON object or array.");
@@ -8306,7 +8306,7 @@ function normalizeConfigBatchItems(manifest) {
8306
8306
  if (!Array.isArray(items)) {
8307
8307
  throw new Error("config batch manifest requires operations, items, or rows array.");
8308
8308
  }
8309
- return items.filter(isRecord3);
8309
+ return items.map((raw) => ({ raw, item: isRecord3(raw) ? raw : null }));
8310
8310
  }
8311
8311
  function assertBatchItemDomain(domain) {
8312
8312
  if (typeof domain !== "string" || !Object.prototype.hasOwnProperty.call(CONFIG_DOMAINS, domain)) {
@@ -8326,36 +8326,51 @@ async function runConfigBatchSubmit(config, profile, manifestFile, options = {})
8326
8326
  const items = normalizeConfigBatchItems(manifest);
8327
8327
  const results = [];
8328
8328
  for (let index = 0; index < items.length; index += 1) {
8329
- const item = items[index];
8330
- const domain = assertBatchItemDomain(item.domain);
8331
- const id = typeof item.id === "string" ? item.id : "";
8332
- const payload = typeof item.payload === "string" ? item.payload : "";
8333
- if (!id || !payload) {
8329
+ const batchItem = items[index];
8330
+ const item = batchItem.item;
8331
+ if (!item) {
8334
8332
  const result = {
8335
8333
  ok: false,
8336
8334
  index,
8337
- domain,
8338
- id,
8335
+ domain: null,
8336
+ id: "",
8339
8337
  action: "submit",
8340
- error: "config batch submit item requires id and payload."
8338
+ error: "config batch submit item must be a JSON object."
8341
8339
  };
8342
8340
  results.push(result);
8343
- await writeOptionalBatchResponse(item.response_out, result);
8344
8341
  if (!options.continueOnError) break;
8345
8342
  continue;
8346
8343
  }
8344
+ let domain = null;
8345
+ let id = "";
8347
8346
  try {
8347
+ domain = assertBatchItemDomain(item.domain);
8348
+ id = typeof item.id === "string" ? item.id : "";
8349
+ const payload = typeof item.payload === "string" ? item.payload : "";
8350
+ if (!id || !payload) {
8351
+ throw new Error("config batch submit item requires id and payload.");
8352
+ }
8348
8353
  const response = await submitConfigDomain(config, profile, domain, id, payload, item.confirm);
8349
- const result = {
8354
+ const executed = !isRecord3(response) || response.operation_executed !== false && response.dry_run !== true;
8355
+ const result = executed ? {
8350
8356
  ok: true,
8351
8357
  index,
8352
8358
  domain,
8353
8359
  id,
8354
8360
  action: "submit",
8355
8361
  response
8362
+ } : {
8363
+ ok: false,
8364
+ index,
8365
+ domain,
8366
+ id,
8367
+ action: "submit",
8368
+ error: `config batch submit item did not execute; confirm_required=${String(isRecord3(response) ? response.required_confirm ?? response.expected_confirm ?? "" : "")}`,
8369
+ response
8356
8370
  };
8357
8371
  results.push(result);
8358
- await writeOptionalBatchResponse(item.response_out, response);
8372
+ await writeOptionalBatchResponse(item.response_out, result);
8373
+ if (!result.ok && !options.continueOnError) break;
8359
8374
  } catch (error) {
8360
8375
  const result = {
8361
8376
  ok: false,
@@ -8388,24 +8403,29 @@ async function runConfigBatchReadback(config, profile, manifestFile, options = {
8388
8403
  const items = normalizeConfigBatchItems(manifest);
8389
8404
  const results = [];
8390
8405
  for (let index = 0; index < items.length; index += 1) {
8391
- const item = items[index];
8392
- const domain = assertBatchItemDomain(item.domain);
8393
- const id = typeof item.id === "string" ? item.id : "";
8394
- if (!id) {
8406
+ const batchItem = items[index];
8407
+ const item = batchItem.item;
8408
+ if (!item) {
8395
8409
  const result = {
8396
8410
  ok: false,
8397
8411
  index,
8398
- domain,
8399
- id,
8412
+ domain: null,
8413
+ id: "",
8400
8414
  action: "readback",
8401
- error: "config batch readback item requires id."
8415
+ error: "config batch readback item must be a JSON object."
8402
8416
  };
8403
8417
  results.push(result);
8404
- await writeOptionalBatchResponse(item.response_out, result);
8405
8418
  if (!options.continueOnError) break;
8406
8419
  continue;
8407
8420
  }
8421
+ let domain = null;
8422
+ let id = "";
8408
8423
  try {
8424
+ domain = assertBatchItemDomain(item.domain);
8425
+ id = typeof item.id === "string" ? item.id : "";
8426
+ if (!id) {
8427
+ throw new Error("config batch readback item requires id.");
8428
+ }
8409
8429
  const response = await readbackConfigDomain(config, profile, domain, id);
8410
8430
  const result = {
8411
8431
  ok: true,
@@ -8416,7 +8436,7 @@ async function runConfigBatchReadback(config, profile, manifestFile, options = {
8416
8436
  response
8417
8437
  };
8418
8438
  results.push(result);
8419
- await writeOptionalBatchResponse(item.response_out, response);
8439
+ await writeOptionalBatchResponse(item.response_out, result);
8420
8440
  } catch (error) {
8421
8441
  const result = {
8422
8442
  ok: false,