@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.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  exitCodeFor,
4
4
  redactSecrets,
5
5
  runCli
6
- } from "./chunk-5MRY3V2K.js";
6
+ } from "./chunk-B6DISJPC.js";
7
7
 
8
8
  // src/bin.ts
9
9
  runCli().catch((err) => {
@@ -5980,11 +5980,21 @@ Usage:
5980
5980
  odla-ai app owners list [--config odla.config.mjs] [--email <odla-account>] [--json]
5981
5981
  odla-ai app owners add <email> [--email <odla-account>] [--json]
5982
5982
  odla-ai app owners remove <email> [--email <odla-account>] [--json]
5983
- odla-ai pm <goal|task|decision|bug> list [--app <id>] [--status <s>] [--severity <s>] [--column <c>] [--q <text>] [--json]
5984
- 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>]
5983
+ odla-ai pm goal list [--app <id>] [--status <s>] [--q <text>] [--limit <n>] [--offset <n>] [--json]
5984
+ odla-ai pm task list [--app <id>] [--column <c>] [--goal <id>] [--assignee <id>] [--q <text>] [--limit <n>] [--offset <n>] [--json]
5985
+ odla-ai pm decision list [--app <id>] [--status <s>] [--q <text>] [--limit <n>] [--offset <n>] [--json]
5986
+ odla-ai pm bug list [--app <id>] [--status <s>] [--severity <s>] [--goal <id>] [--assignee <id>] [--decision <id>] [--q <text>] [--limit <n>] [--offset <n>] [--json]
5987
+ odla-ai pm goal add --app <id> --title <t> [--status <s>] [--proof <text>] [--target <pct>] [--mutation-id <id>] [--json]
5988
+ 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]
5989
+ odla-ai pm decision add --app <id> --title <t> --body <text> [--status <s>] [--mutation-id <id>] [--json]
5990
+ 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]
5985
5991
  odla-ai pm <goal|task|decision|bug> get <id> [--json]
5986
- odla-ai pm <goal|task|decision|bug> set <id> [--status <s>|--column <c>|--assignee <id>|--no-assignee|--goal <id>|--decision <id>] [--mutation-id <id>]
5987
- odla-ai pm <goal|task|decision|bug> done <id> [--decision <accepted-decision-id>] [--mutation-id <id>]
5992
+ odla-ai pm goal set <id> [--title <t>|--status <s>|--proof <text>|--no-proof|--target <pct>|--no-target] [--mutation-id <id>] [--json]
5993
+ 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]
5994
+ odla-ai pm decision set <id> [--title <t>|--status <s>|--body <text>] [--mutation-id <id>] [--json]
5995
+ 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]
5996
+ odla-ai pm <goal|task|decision> done <id> [--mutation-id <id>]
5997
+ odla-ai pm bug done <id> [--decision <accepted-decision-id>] [--mutation-id <id>]
5988
5998
  odla-ai pm <goal|task|decision|bug> comment <id> --body "..." [--mutation-id <id>]
5989
5999
  odla-ai pm <goal|task|decision|bug> comments <id> [--json]
5990
6000
  odla-ai pm <goal|task|decision|bug> rm <id>
@@ -7274,8 +7284,8 @@ function parseArgv(argv) {
7274
7284
  }
7275
7285
  return { positionals, options };
7276
7286
  }
7277
- function assertArgs(parsed, allowedOptions, maxPositionals) {
7278
- const allowed = new Set(allowedOptions);
7287
+ function assertArgs(parsed, allowedOptions2, maxPositionals) {
7288
+ const allowed = new Set(allowedOptions2);
7279
7289
  for (const name of Object.keys(parsed.options)) {
7280
7290
  if (!allowed.has(name)) throw new Error(`unknown option "--${name}"; run "odla-ai help" for supported options`);
7281
7291
  }
@@ -9239,33 +9249,53 @@ var ALIASES = {
9239
9249
  decision: "decision",
9240
9250
  bug: "bug"
9241
9251
  };
9242
- var ALLOWED2 = [
9243
- "config",
9244
- "token",
9245
- "email",
9246
- "json",
9247
- "app",
9248
- "title",
9249
- "status",
9250
- "severity",
9251
- "column",
9252
- "rank",
9253
- "goal",
9254
- "assignee",
9255
- "due",
9256
- "proof",
9257
- "body",
9258
- "target",
9259
- "description",
9260
- "desc",
9261
- "decision",
9262
- "limit",
9263
- "offset",
9264
- "q",
9265
- "mutation-id",
9266
- "platform",
9267
- "context"
9268
- ];
9252
+ var COMMON_OPTIONS = ["config", "token", "email", "json", "platform", "context"];
9253
+ var ACTION_OPTIONS = {
9254
+ list: ["app", "q", "limit", "offset"],
9255
+ add: ["app", "title", "mutation-id"],
9256
+ get: [],
9257
+ set: ["mutation-id"],
9258
+ done: ["mutation-id"],
9259
+ comment: ["body", "mutation-id"],
9260
+ comments: [],
9261
+ rm: []
9262
+ };
9263
+ var ENTITY_OPTIONS = {
9264
+ goal: {
9265
+ list: ["status"],
9266
+ add: ["status", "proof", "target"],
9267
+ set: ["title", "status", "proof", "target"],
9268
+ done: []
9269
+ },
9270
+ task: {
9271
+ list: ["column", "goal", "assignee"],
9272
+ add: ["column", "goal", "assignee", "due", "description", "desc", "body"],
9273
+ set: ["title", "column", "rank", "goal", "assignee", "due", "description", "desc", "body"],
9274
+ done: []
9275
+ },
9276
+ decision: {
9277
+ list: ["status"],
9278
+ add: ["status", "body"],
9279
+ set: ["title", "status", "body"],
9280
+ done: []
9281
+ },
9282
+ bug: {
9283
+ list: ["status", "severity", "goal", "assignee", "decision"],
9284
+ add: ["status", "severity", "goal", "assignee", "decision", "description", "desc", "body"],
9285
+ set: ["title", "status", "severity", "goal", "assignee", "decision", "description", "desc", "body"],
9286
+ done: ["decision"]
9287
+ }
9288
+ };
9289
+ function canonicalAction(action) {
9290
+ if (action === "create") return "add";
9291
+ if (action === "update" || action === "status" || action === "move") return "set";
9292
+ if (action === "delete") return "rm";
9293
+ return action in ACTION_OPTIONS ? action : null;
9294
+ }
9295
+ function allowedOptions(entity, action) {
9296
+ const entityOptions = action === "list" || action === "add" || action === "set" || action === "done" ? ENTITY_OPTIONS[entity][action] : [];
9297
+ return [...COMMON_OPTIONS, ...ACTION_OPTIONS[action], ...entityOptions];
9298
+ }
9269
9299
  function requireId2(id, action) {
9270
9300
  if (!id) throw new Error(`"pm ... ${action}" needs an item id`);
9271
9301
  return id;
@@ -9297,27 +9327,25 @@ async function buildContext2(parsed, deps) {
9297
9327
  async function pmCommand(parsed, deps = {}) {
9298
9328
  const word = parsed.positionals[1] ?? "";
9299
9329
  if (word === "handoff") {
9300
- assertArgs(parsed, ALLOWED2, 2);
9330
+ assertArgs(parsed, [...COMMON_OPTIONS, "app"], 2);
9301
9331
  return pmHandoff(await buildContext2(parsed, deps), parsed);
9302
9332
  }
9303
9333
  const entity = ALIASES[word];
9304
9334
  if (!entity) throw new Error(`unknown pm entity "${word}". Try "odla-ai pm bug list" (goal|task|decision|bug).`);
9305
- const action = parsed.positionals[2] ?? "list";
9306
- assertArgs(parsed, ALLOWED2, 4);
9335
+ const requestedAction = parsed.positionals[2] ?? "list";
9336
+ const action = canonicalAction(requestedAction);
9337
+ if (!action) throw new Error(`unknown pm action "${requestedAction}". Try list|add|get|set|done|comment|comments|rm.`);
9338
+ assertArgs(parsed, allowedOptions(entity, action), 4);
9307
9339
  const ctx = await buildContext2(parsed, deps);
9308
9340
  const id = parsed.positionals[3];
9309
9341
  switch (action) {
9310
9342
  case "list":
9311
9343
  return pmList(ctx, entity, parsed);
9312
9344
  case "add":
9313
- case "create":
9314
9345
  return pmAdd(ctx, entity, parsed);
9315
9346
  case "get":
9316
9347
  return pmGet(ctx, entity, requireId2(id, action));
9317
9348
  case "set":
9318
- case "update":
9319
- case "status":
9320
- case "move":
9321
9349
  return pmSet(ctx, entity, requireId2(id, action), parsed);
9322
9350
  case "done":
9323
9351
  return pmDone(ctx, entity, requireId2(id, action), parsed);
@@ -9326,10 +9354,7 @@ async function pmCommand(parsed, deps = {}) {
9326
9354
  case "comments":
9327
9355
  return pmComments(ctx, entity, requireId2(id, action));
9328
9356
  case "rm":
9329
- case "delete":
9330
9357
  return pmRemove(ctx, entity, requireId2(id, action));
9331
- default:
9332
- throw new Error(`unknown pm action "${action}". Try list|add|get|set|done|comment|comments|rm.`);
9333
9358
  }
9334
9359
  }
9335
9360
 
@@ -9748,7 +9773,7 @@ function recordInvocation(parsed) {
9748
9773
  try {
9749
9774
  const entry = {
9750
9775
  path: invocationPath(parsed.positionals),
9751
- options: Object.keys(parsed.options).sort()
9776
+ options: Object.entries(parsed.options).map(([name, value]) => value === false ? `no-${name}` : name).sort()
9752
9777
  };
9753
9778
  if (!entry.path.length) return;
9754
9779
  appendFileSync(file, `${JSON.stringify(entry)}
@@ -10521,7 +10546,7 @@ async function whoamiCommand(parsed, deps = {}) {
10521
10546
  }
10522
10547
 
10523
10548
  // src/runbook-command.ts
10524
- var ALLOWED3 = [
10549
+ var ALLOWED2 = [
10525
10550
  "config",
10526
10551
  "token",
10527
10552
  "email",
@@ -10609,7 +10634,7 @@ async function buildContext3(parsed, deps, action) {
10609
10634
  }
10610
10635
  async function runbookCommand(parsed, deps = {}) {
10611
10636
  const action = parsed.positionals[1] ?? "list";
10612
- assertArgs(parsed, ALLOWED3, action === "ask" || action === "search" ? 64 : 4);
10637
+ assertArgs(parsed, ALLOWED2, action === "ask" || action === "search" ? 64 : 4);
10613
10638
  const ctx = await buildContext3(parsed, deps, action);
10614
10639
  const slug = parsed.positionals[2];
10615
10640
  switch (action) {
@@ -11326,4 +11351,4 @@ export {
11326
11351
  exitCodeFor,
11327
11352
  runCli
11328
11353
  };
11329
- //# sourceMappingURL=chunk-5MRY3V2K.js.map
11354
+ //# sourceMappingURL=chunk-B6DISJPC.js.map