@odla-ai/cli 0.25.17 → 0.25.18

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/bin.cjs CHANGED
@@ -915,8 +915,8 @@ function parseArgv(argv) {
915
915
  }
916
916
  return { positionals, options };
917
917
  }
918
- function assertArgs(parsed, allowedOptions, maxPositionals) {
919
- const allowed = new Set(allowedOptions);
918
+ function assertArgs(parsed, allowedOptions2, maxPositionals) {
919
+ const allowed = new Set(allowedOptions2);
920
920
  for (const name of Object.keys(parsed.options)) {
921
921
  if (!allowed.has(name)) throw new Error(`unknown option "--${name}"; run "odla-ai help" for supported options`);
922
922
  }
@@ -6553,11 +6553,21 @@ Usage:
6553
6553
  odla-ai app owners list [--config odla.config.mjs] [--email <odla-account>] [--json]
6554
6554
  odla-ai app owners add <email> [--email <odla-account>] [--json]
6555
6555
  odla-ai app owners remove <email> [--email <odla-account>] [--json]
6556
- odla-ai pm <goal|task|decision|bug> list [--app <id>] [--status <s>] [--severity <s>] [--column <c>] [--q <text>] [--json]
6557
- odla-ai pm <goal|task|decision|bug> add --app <id> --title <t> [--severity high|--column doing|--goal <id>|--description <text>|--body <text>|--proof <text>] [--mutation-id <id>]
6556
+ odla-ai pm goal list [--app <id>] [--status <s>] [--q <text>] [--limit <n>] [--offset <n>] [--json]
6557
+ odla-ai pm task list [--app <id>] [--column <c>] [--goal <id>] [--assignee <id>] [--q <text>] [--limit <n>] [--offset <n>] [--json]
6558
+ odla-ai pm decision list [--app <id>] [--status <s>] [--q <text>] [--limit <n>] [--offset <n>] [--json]
6559
+ odla-ai pm bug list [--app <id>] [--status <s>] [--severity <s>] [--goal <id>] [--assignee <id>] [--decision <id>] [--q <text>] [--limit <n>] [--offset <n>] [--json]
6560
+ odla-ai pm goal add --app <id> --title <t> [--status <s>] [--proof <text>] [--target <pct>] [--mutation-id <id>] [--json]
6561
+ odla-ai pm task add --app <id> --title <t> [--column <c>] [--goal <id>] [--assignee <id>] [--description <text>|--body <text>] [--due <epoch-ms>] [--mutation-id <id>] [--json]
6562
+ odla-ai pm decision add --app <id> --title <t> --body <text> [--status <s>] [--mutation-id <id>] [--json]
6563
+ odla-ai pm bug add --app <id> --title <t> (--description <text>|--body <text>) [--status <s>] [--severity <s>] [--goal <id>] [--assignee <id>] [--decision <id>] [--mutation-id <id>] [--json]
6558
6564
  odla-ai pm <goal|task|decision|bug> get <id> [--json]
6559
- odla-ai pm <goal|task|decision|bug> set <id> [--status <s>|--column <c>|--assignee <id>|--no-assignee|--goal <id>|--decision <id>] [--mutation-id <id>]
6560
- odla-ai pm <goal|task|decision|bug> done <id> [--decision <accepted-decision-id>] [--mutation-id <id>]
6565
+ odla-ai pm goal set <id> [--title <t>|--status <s>|--proof <text>|--no-proof|--target <pct>|--no-target] [--mutation-id <id>] [--json]
6566
+ odla-ai pm task set <id> [--title <t>|--column <c>|--rank <n>|--goal <id>|--no-goal|--assignee <id>|--no-assignee|--description <text>|--body <text>|--due <epoch-ms>|--no-due] [--mutation-id <id>] [--json]
6567
+ odla-ai pm decision set <id> [--title <t>|--status <s>|--body <text>] [--mutation-id <id>] [--json]
6568
+ odla-ai pm bug set <id> [--title <t>|--status <s>|--severity <s>|--goal <id>|--no-goal|--assignee <id>|--no-assignee|--decision <id>|--no-decision|--description <text>|--body <text>] [--mutation-id <id>] [--json]
6569
+ odla-ai pm <goal|task|decision> done <id> [--mutation-id <id>]
6570
+ odla-ai pm bug done <id> [--decision <accepted-decision-id>] [--mutation-id <id>]
6561
6571
  odla-ai pm <goal|task|decision|bug> comment <id> --body "..." [--mutation-id <id>]
6562
6572
  odla-ai pm <goal|task|decision|bug> comments <id> [--json]
6563
6573
  odla-ai pm <goal|task|decision|bug> rm <id>
@@ -8439,33 +8449,53 @@ var ALIASES = {
8439
8449
  decision: "decision",
8440
8450
  bug: "bug"
8441
8451
  };
8442
- var ALLOWED2 = [
8443
- "config",
8444
- "token",
8445
- "email",
8446
- "json",
8447
- "app",
8448
- "title",
8449
- "status",
8450
- "severity",
8451
- "column",
8452
- "rank",
8453
- "goal",
8454
- "assignee",
8455
- "due",
8456
- "proof",
8457
- "body",
8458
- "target",
8459
- "description",
8460
- "desc",
8461
- "decision",
8462
- "limit",
8463
- "offset",
8464
- "q",
8465
- "mutation-id",
8466
- "platform",
8467
- "context"
8468
- ];
8452
+ var COMMON_OPTIONS = ["config", "token", "email", "json", "platform", "context"];
8453
+ var ACTION_OPTIONS = {
8454
+ list: ["app", "q", "limit", "offset"],
8455
+ add: ["app", "title", "mutation-id"],
8456
+ get: [],
8457
+ set: ["mutation-id"],
8458
+ done: ["mutation-id"],
8459
+ comment: ["body", "mutation-id"],
8460
+ comments: [],
8461
+ rm: []
8462
+ };
8463
+ var ENTITY_OPTIONS = {
8464
+ goal: {
8465
+ list: ["status"],
8466
+ add: ["status", "proof", "target"],
8467
+ set: ["title", "status", "proof", "target"],
8468
+ done: []
8469
+ },
8470
+ task: {
8471
+ list: ["column", "goal", "assignee"],
8472
+ add: ["column", "goal", "assignee", "due", "description", "desc", "body"],
8473
+ set: ["title", "column", "rank", "goal", "assignee", "due", "description", "desc", "body"],
8474
+ done: []
8475
+ },
8476
+ decision: {
8477
+ list: ["status"],
8478
+ add: ["status", "body"],
8479
+ set: ["title", "status", "body"],
8480
+ done: []
8481
+ },
8482
+ bug: {
8483
+ list: ["status", "severity", "goal", "assignee", "decision"],
8484
+ add: ["status", "severity", "goal", "assignee", "decision", "description", "desc", "body"],
8485
+ set: ["title", "status", "severity", "goal", "assignee", "decision", "description", "desc", "body"],
8486
+ done: ["decision"]
8487
+ }
8488
+ };
8489
+ function canonicalAction(action) {
8490
+ if (action === "create") return "add";
8491
+ if (action === "update" || action === "status" || action === "move") return "set";
8492
+ if (action === "delete") return "rm";
8493
+ return action in ACTION_OPTIONS ? action : null;
8494
+ }
8495
+ function allowedOptions(entity, action) {
8496
+ const entityOptions = action === "list" || action === "add" || action === "set" || action === "done" ? ENTITY_OPTIONS[entity][action] : [];
8497
+ return [...COMMON_OPTIONS, ...ACTION_OPTIONS[action], ...entityOptions];
8498
+ }
8469
8499
  function requireId2(id, action) {
8470
8500
  if (!id) throw new Error(`"pm ... ${action}" needs an item id`);
8471
8501
  return id;
@@ -8497,27 +8527,25 @@ async function buildContext2(parsed, deps) {
8497
8527
  async function pmCommand(parsed, deps = {}) {
8498
8528
  const word = parsed.positionals[1] ?? "";
8499
8529
  if (word === "handoff") {
8500
- assertArgs(parsed, ALLOWED2, 2);
8530
+ assertArgs(parsed, [...COMMON_OPTIONS, "app"], 2);
8501
8531
  return pmHandoff(await buildContext2(parsed, deps), parsed);
8502
8532
  }
8503
8533
  const entity = ALIASES[word];
8504
8534
  if (!entity) throw new Error(`unknown pm entity "${word}". Try "odla-ai pm bug list" (goal|task|decision|bug).`);
8505
- const action = parsed.positionals[2] ?? "list";
8506
- assertArgs(parsed, ALLOWED2, 4);
8535
+ const requestedAction = parsed.positionals[2] ?? "list";
8536
+ const action = canonicalAction(requestedAction);
8537
+ if (!action) throw new Error(`unknown pm action "${requestedAction}". Try list|add|get|set|done|comment|comments|rm.`);
8538
+ assertArgs(parsed, allowedOptions(entity, action), 4);
8507
8539
  const ctx = await buildContext2(parsed, deps);
8508
8540
  const id = parsed.positionals[3];
8509
8541
  switch (action) {
8510
8542
  case "list":
8511
8543
  return pmList(ctx, entity, parsed);
8512
8544
  case "add":
8513
- case "create":
8514
8545
  return pmAdd(ctx, entity, parsed);
8515
8546
  case "get":
8516
8547
  return pmGet(ctx, entity, requireId2(id, action));
8517
8548
  case "set":
8518
- case "update":
8519
- case "status":
8520
- case "move":
8521
8549
  return pmSet(ctx, entity, requireId2(id, action), parsed);
8522
8550
  case "done":
8523
8551
  return pmDone(ctx, entity, requireId2(id, action), parsed);
@@ -8526,10 +8554,7 @@ async function pmCommand(parsed, deps = {}) {
8526
8554
  case "comments":
8527
8555
  return pmComments(ctx, entity, requireId2(id, action));
8528
8556
  case "rm":
8529
- case "delete":
8530
8557
  return pmRemove(ctx, entity, requireId2(id, action));
8531
- default:
8532
- throw new Error(`unknown pm action "${action}". Try list|add|get|set|done|comment|comments|rm.`);
8533
8558
  }
8534
8559
  }
8535
8560
 
@@ -9491,7 +9516,7 @@ function recordInvocation(parsed) {
9491
9516
  try {
9492
9517
  const entry = {
9493
9518
  path: invocationPath(parsed.positionals),
9494
- options: Object.keys(parsed.options).sort()
9519
+ options: Object.entries(parsed.options).map(([name, value]) => value === false ? `no-${name}` : name).sort()
9495
9520
  };
9496
9521
  if (!entry.path.length) return;
9497
9522
  (0, import_node_fs15.appendFileSync)(file, `${JSON.stringify(entry)}
@@ -10264,7 +10289,7 @@ async function whoamiCommand(parsed, deps = {}) {
10264
10289
  }
10265
10290
 
10266
10291
  // src/runbook-command.ts
10267
- var ALLOWED3 = [
10292
+ var ALLOWED2 = [
10268
10293
  "config",
10269
10294
  "token",
10270
10295
  "email",
@@ -10352,7 +10377,7 @@ async function buildContext3(parsed, deps, action) {
10352
10377
  }
10353
10378
  async function runbookCommand(parsed, deps = {}) {
10354
10379
  const action = parsed.positionals[1] ?? "list";
10355
- assertArgs(parsed, ALLOWED3, action === "ask" || action === "search" ? 64 : 4);
10380
+ assertArgs(parsed, ALLOWED2, action === "ask" || action === "search" ? 64 : 4);
10356
10381
  const ctx = await buildContext3(parsed, deps, action);
10357
10382
  const slug = parsed.positionals[2];
10358
10383
  switch (action) {