@audienti/cli 0.1.79 → 0.1.80

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/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ All notable changes to the Audienti CLI are documented here.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.1.80] - 2026-09-28
8
+
9
+ ### Added
10
+
11
+ - Run the motion list and motion health actions from the CLI: `motions bulk-add-tag --tag`, `bulk-remove-tag --tag`, `bulk-update-principal --principal`, `bulk-update-status --status` (prints any motion the lifecycle rules blocked), `retire-strategy --strategy`, `refresh-launch-check`, `refresh-launch-checks`, and `update-premise --premise`.
12
+
7
13
  ## [0.1.79] - 2026-09-28
8
14
 
9
15
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@audienti/cli",
3
- "version": "0.1.79",
3
+ "version": "0.1.80",
4
4
  "description": "Agent-first command-line client for Audienti.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/api-client.js CHANGED
@@ -675,6 +675,59 @@ export class AudientiClient {
675
675
  });
676
676
  }
677
677
 
678
+ bulkAddMotionTag(accountId, body) {
679
+ return this.requestJson(accountPath(accountId, ["motions", "bulk_add_tag"]), {
680
+ method: "POST",
681
+ body
682
+ });
683
+ }
684
+
685
+ bulkRemoveMotionTag(accountId, body) {
686
+ return this.requestJson(accountPath(accountId, ["motions", "bulk_remove_tag"]), {
687
+ method: "POST",
688
+ body
689
+ });
690
+ }
691
+
692
+ bulkUpdateMotionPrincipal(accountId, body) {
693
+ return this.requestJson(accountPath(accountId, ["motions", "bulk_update_principal"]), {
694
+ method: "POST",
695
+ body
696
+ });
697
+ }
698
+
699
+ bulkUpdateMotionStatus(accountId, body) {
700
+ return this.requestJson(accountPath(accountId, ["motions", "bulk_update_status"]), {
701
+ method: "POST",
702
+ body
703
+ });
704
+ }
705
+
706
+ retireMotionStrategy(accountId, motionId, strategyId) {
707
+ return this.requestJson(accountPath(accountId, ["motions", motionId, "strategies", strategyId, "retire"]), {
708
+ method: "POST"
709
+ });
710
+ }
711
+
712
+ refreshMotionLaunchCheck(accountId, motionId) {
713
+ return this.requestJson(accountPath(accountId, ["motions", motionId, "refresh_launch_check"]), {
714
+ method: "POST"
715
+ });
716
+ }
717
+
718
+ refreshMotionLaunchChecks(accountId) {
719
+ return this.requestJson(accountPath(accountId, ["motions", "refresh_launch_checks"]), {
720
+ method: "POST"
721
+ });
722
+ }
723
+
724
+ updateMotionPremise(accountId, motionId, body) {
725
+ return this.requestJson(accountPath(accountId, ["motions", motionId, "update_premise"]), {
726
+ method: "PATCH",
727
+ body
728
+ });
729
+ }
730
+
678
731
  createQuickStart(accountId, body) {
679
732
  return this.requestJson(accountPath(accountId, ["quick_start"]), {
680
733
  method: "POST",
package/src/cli.js CHANGED
@@ -3337,10 +3337,21 @@ async function motionsUpdate(args, context, { accountOverride } = {}) {
3337
3337
 
3338
3338
  const { client, accountId } = await requireAccountContext(context, { accountOverride });
3339
3339
  const motion = await client.updateMotion(accountId, positionals[0], { motion: await motionUpdatePayload(values) });
3340
- if (values.json) return writeJson(context.stdout, motion);
3340
+ const statusBlocked = motion?.status_change?.status === "blocked";
3341
+ if (values.json) {
3342
+ writeJson(context.stdout, motion);
3343
+ return statusBlocked ? 1 : undefined;
3344
+ }
3341
3345
 
3342
3346
  writeLine(context.stdout, `Updated motion ${display(motion?.name)} (${display(motion?.prefix_id)}).`);
3343
3347
  renderMotion(motion, context);
3348
+ if (!statusBlocked) return undefined;
3349
+
3350
+ writeLine(
3351
+ context.stderr,
3352
+ `Status not changed to ${display(motion.status_change.requested_status)}: ${display(motion.status_change.reason)}. Other changes were saved.`
3353
+ );
3354
+ return 1;
3344
3355
  }
3345
3356
 
3346
3357
  async function motionUpdatePayload(values) {
@@ -14332,6 +14343,90 @@ const PARITY_ACTION_COMMANDS = new Map([
14332
14343
  api: "POST /api/v1/accounts/:account_id/reconciliations/:id/ignore.json",
14333
14344
  run: (client, accountId, [key]) => client.reconciliationIgnore(accountId, key),
14334
14345
  done: ([key]) => `Ignored ${key}.`
14346
+ }],
14347
+ // Motion list bulk actions, strategy retirement, launch checks and premise (#2301).
14348
+ ["motions bulk-add-tag", {
14349
+ usage: "audienti motions bulk-add-tag <motn_id> [<motn_id> ...] --tag <tag>",
14350
+ minPositionals: 1,
14351
+ maxPositionals: Infinity,
14352
+ purpose: "Add one tag to several motions, like Add tag on the motion list. Any motion outside the account fails the whole request.",
14353
+ api: "POST /api/v1/accounts/:account_id/motions/bulk_add_tag.json",
14354
+ options: { tag: { type: "string" } },
14355
+ required: ["tag"],
14356
+ run: (client, accountId, ids, values) => client.bulkAddMotionTag(accountId, { motion_ids: ids, tag: values.tag }),
14357
+ done: (_positionals, payload) => `Tagged ${payload?.length ?? 0} motions.`
14358
+ }],
14359
+ ["motions bulk-remove-tag", {
14360
+ usage: "audienti motions bulk-remove-tag <motn_id> [<motn_id> ...] --tag <tag>",
14361
+ minPositionals: 1,
14362
+ maxPositionals: Infinity,
14363
+ purpose: "Remove one tag from several motions, like Remove tag on the motion list.",
14364
+ api: "POST /api/v1/accounts/:account_id/motions/bulk_remove_tag.json",
14365
+ options: { tag: { type: "string" } },
14366
+ required: ["tag"],
14367
+ run: (client, accountId, ids, values) => client.bulkRemoveMotionTag(accountId, { motion_ids: ids, tag: values.tag }),
14368
+ done: (_positionals, payload) => `Removed the tag from ${payload?.length ?? 0} motions.`
14369
+ }],
14370
+ ["motions bulk-update-principal", {
14371
+ usage: "audienti motions bulk-update-principal <motn_id> [<motn_id> ...] --principal <account_user_id>",
14372
+ minPositionals: 1,
14373
+ maxPositionals: Infinity,
14374
+ purpose: "Give several motions the same owner, like Change owner on the motion list. The owner must be a user in this account.",
14375
+ api: "POST /api/v1/accounts/:account_id/motions/bulk_update_principal.json",
14376
+ options: { principal: { type: "string" } },
14377
+ required: ["principal"],
14378
+ run: (client, accountId, ids, values) => client.bulkUpdateMotionPrincipal(accountId, { motion_ids: ids, principal_account_user_id: values.principal }),
14379
+ done: (_positionals, payload) => `Assigned ${payload?.length ?? 0} motions.`
14380
+ }],
14381
+ ["motions bulk-update-status", {
14382
+ usage: "audienti motions bulk-update-status <motn_id> [<motn_id> ...] --status <preparing|active|closing|paused|archived>",
14383
+ minPositionals: 1,
14384
+ maxPositionals: Infinity,
14385
+ purpose: "Change the status of several motions with the same lifecycle rules as the motion list. Motions the rules block keep their status and are listed with the reason.",
14386
+ api: "POST /api/v1/accounts/:account_id/motions/bulk_update_status.json",
14387
+ options: { status: { type: "string" } },
14388
+ required: ["status"],
14389
+ run: (client, accountId, ids, values) => client.bulkUpdateMotionStatus(accountId, { motion_ids: ids, status: values.status }),
14390
+ done: (_positionals, payload) => [
14391
+ `Set ${payload?.applied_count ?? 0} motions to ${display(payload?.status)}; ${payload?.blocked_count ?? 0} blocked.`,
14392
+ ...(payload?.blocked || []).map((row) => ` ${row.motion_id}: ${display(row.reason)}`)
14393
+ ].join("\n")
14394
+ }],
14395
+ ["motions retire-strategy", {
14396
+ usage: "audienti motions retire-strategy <motn_id> --strategy <strategy_id>",
14397
+ purpose: "Retire one strategy of an inbound motion. Retirement is permanent; the slot refills from the backlog on the next planning pass.",
14398
+ api: "POST /api/v1/accounts/:account_id/motions/:id/strategies/:motion_search_scope_id/retire.json",
14399
+ options: { strategy: { type: "string" } },
14400
+ required: ["strategy"],
14401
+ run: (client, accountId, [id], values) => client.retireMotionStrategy(accountId, id, values.strategy),
14402
+ done: (_positionals, payload) => (payload?.already_retired
14403
+ ? `Strategy ${display(payload?.strategy?.id)} is already retired.`
14404
+ : `Retired strategy ${display(payload?.strategy?.id)}.`)
14405
+ }],
14406
+ ["motions refresh-launch-check", {
14407
+ usage: "audienti motions refresh-launch-check <motn_id>",
14408
+ purpose: "Recheck whether one motion can launch discovery, without starting discovery.",
14409
+ api: "POST /api/v1/accounts/:account_id/motions/:id/refresh_launch_check.json",
14410
+ run: (client, accountId, [id]) => client.refreshMotionLaunchCheck(accountId, id),
14411
+ done: (_positionals, payload) => `${display(payload?.name)}: demand ${display(payload?.demand_status)}, producer ${display(payload?.producer_status)}, reason ${display(payload?.reason)}.`
14412
+ }],
14413
+ ["motions refresh-launch-checks", {
14414
+ usage: "audienti motions refresh-launch-checks",
14415
+ minPositionals: 0,
14416
+ maxPositionals: 0,
14417
+ purpose: "Recheck launch readiness for every motion in the account, without starting discovery.",
14418
+ api: "POST /api/v1/accounts/:account_id/motions/refresh_launch_checks.json",
14419
+ run: (client, accountId) => client.refreshMotionLaunchChecks(accountId),
14420
+ done: (_positionals, payload) => `Launch checks refreshed: ${display(payload?.summary)}.`
14421
+ }],
14422
+ ["motions update-premise", {
14423
+ usage: "audienti motions update-premise <motn_id> --premise <text>",
14424
+ purpose: "Save a motion's premise and rebuild its ICP targeting from it, like Update premise in the Operator.",
14425
+ api: "PATCH /api/v1/accounts/:account_id/motions/:id/update_premise.json",
14426
+ options: { premise: { type: "string" } },
14427
+ required: ["premise"],
14428
+ run: (client, accountId, [id], values) => client.updateMotionPremise(accountId, id, { motion: { premise: values.premise } }),
14429
+ done: ([id]) => `Updated the premise for ${id}.`
14335
14430
  }]
14336
14431
  ]);
14337
14432