@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 +71 -46
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +1 -1
- package/dist/{chunk-5MRY3V2K.js → chunk-B6DISJPC.js} +72 -47
- package/dist/chunk-B6DISJPC.js.map +1 -0
- package/dist/index.cjs +71 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-5MRY3V2K.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -975,8 +975,8 @@ function parseArgv(argv) {
|
|
|
975
975
|
}
|
|
976
976
|
return { positionals, options };
|
|
977
977
|
}
|
|
978
|
-
function assertArgs(parsed,
|
|
979
|
-
const allowed = new Set(
|
|
978
|
+
function assertArgs(parsed, allowedOptions2, maxPositionals) {
|
|
979
|
+
const allowed = new Set(allowedOptions2);
|
|
980
980
|
for (const name of Object.keys(parsed.options)) {
|
|
981
981
|
if (!allowed.has(name)) throw new Error(`unknown option "--${name}"; run "odla-ai help" for supported options`);
|
|
982
982
|
}
|
|
@@ -6613,11 +6613,21 @@ Usage:
|
|
|
6613
6613
|
odla-ai app owners list [--config odla.config.mjs] [--email <odla-account>] [--json]
|
|
6614
6614
|
odla-ai app owners add <email> [--email <odla-account>] [--json]
|
|
6615
6615
|
odla-ai app owners remove <email> [--email <odla-account>] [--json]
|
|
6616
|
-
odla-ai pm
|
|
6617
|
-
odla-ai pm
|
|
6616
|
+
odla-ai pm goal list [--app <id>] [--status <s>] [--q <text>] [--limit <n>] [--offset <n>] [--json]
|
|
6617
|
+
odla-ai pm task list [--app <id>] [--column <c>] [--goal <id>] [--assignee <id>] [--q <text>] [--limit <n>] [--offset <n>] [--json]
|
|
6618
|
+
odla-ai pm decision list [--app <id>] [--status <s>] [--q <text>] [--limit <n>] [--offset <n>] [--json]
|
|
6619
|
+
odla-ai pm bug list [--app <id>] [--status <s>] [--severity <s>] [--goal <id>] [--assignee <id>] [--decision <id>] [--q <text>] [--limit <n>] [--offset <n>] [--json]
|
|
6620
|
+
odla-ai pm goal add --app <id> --title <t> [--status <s>] [--proof <text>] [--target <pct>] [--mutation-id <id>] [--json]
|
|
6621
|
+
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]
|
|
6622
|
+
odla-ai pm decision add --app <id> --title <t> --body <text> [--status <s>] [--mutation-id <id>] [--json]
|
|
6623
|
+
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]
|
|
6618
6624
|
odla-ai pm <goal|task|decision|bug> get <id> [--json]
|
|
6619
|
-
odla-ai pm
|
|
6620
|
-
odla-ai pm
|
|
6625
|
+
odla-ai pm goal set <id> [--title <t>|--status <s>|--proof <text>|--no-proof|--target <pct>|--no-target] [--mutation-id <id>] [--json]
|
|
6626
|
+
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]
|
|
6627
|
+
odla-ai pm decision set <id> [--title <t>|--status <s>|--body <text>] [--mutation-id <id>] [--json]
|
|
6628
|
+
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]
|
|
6629
|
+
odla-ai pm <goal|task|decision> done <id> [--mutation-id <id>]
|
|
6630
|
+
odla-ai pm bug done <id> [--decision <accepted-decision-id>] [--mutation-id <id>]
|
|
6621
6631
|
odla-ai pm <goal|task|decision|bug> comment <id> --body "..." [--mutation-id <id>]
|
|
6622
6632
|
odla-ai pm <goal|task|decision|bug> comments <id> [--json]
|
|
6623
6633
|
odla-ai pm <goal|task|decision|bug> rm <id>
|
|
@@ -8499,33 +8509,53 @@ var ALIASES = {
|
|
|
8499
8509
|
decision: "decision",
|
|
8500
8510
|
bug: "bug"
|
|
8501
8511
|
};
|
|
8502
|
-
var
|
|
8503
|
-
|
|
8504
|
-
"
|
|
8505
|
-
"
|
|
8506
|
-
|
|
8507
|
-
"
|
|
8508
|
-
"
|
|
8509
|
-
"
|
|
8510
|
-
|
|
8511
|
-
|
|
8512
|
-
|
|
8513
|
-
|
|
8514
|
-
|
|
8515
|
-
|
|
8516
|
-
|
|
8517
|
-
|
|
8518
|
-
|
|
8519
|
-
|
|
8520
|
-
|
|
8521
|
-
|
|
8522
|
-
|
|
8523
|
-
|
|
8524
|
-
|
|
8525
|
-
|
|
8526
|
-
|
|
8527
|
-
|
|
8528
|
-
]
|
|
8512
|
+
var COMMON_OPTIONS = ["config", "token", "email", "json", "platform", "context"];
|
|
8513
|
+
var ACTION_OPTIONS = {
|
|
8514
|
+
list: ["app", "q", "limit", "offset"],
|
|
8515
|
+
add: ["app", "title", "mutation-id"],
|
|
8516
|
+
get: [],
|
|
8517
|
+
set: ["mutation-id"],
|
|
8518
|
+
done: ["mutation-id"],
|
|
8519
|
+
comment: ["body", "mutation-id"],
|
|
8520
|
+
comments: [],
|
|
8521
|
+
rm: []
|
|
8522
|
+
};
|
|
8523
|
+
var ENTITY_OPTIONS = {
|
|
8524
|
+
goal: {
|
|
8525
|
+
list: ["status"],
|
|
8526
|
+
add: ["status", "proof", "target"],
|
|
8527
|
+
set: ["title", "status", "proof", "target"],
|
|
8528
|
+
done: []
|
|
8529
|
+
},
|
|
8530
|
+
task: {
|
|
8531
|
+
list: ["column", "goal", "assignee"],
|
|
8532
|
+
add: ["column", "goal", "assignee", "due", "description", "desc", "body"],
|
|
8533
|
+
set: ["title", "column", "rank", "goal", "assignee", "due", "description", "desc", "body"],
|
|
8534
|
+
done: []
|
|
8535
|
+
},
|
|
8536
|
+
decision: {
|
|
8537
|
+
list: ["status"],
|
|
8538
|
+
add: ["status", "body"],
|
|
8539
|
+
set: ["title", "status", "body"],
|
|
8540
|
+
done: []
|
|
8541
|
+
},
|
|
8542
|
+
bug: {
|
|
8543
|
+
list: ["status", "severity", "goal", "assignee", "decision"],
|
|
8544
|
+
add: ["status", "severity", "goal", "assignee", "decision", "description", "desc", "body"],
|
|
8545
|
+
set: ["title", "status", "severity", "goal", "assignee", "decision", "description", "desc", "body"],
|
|
8546
|
+
done: ["decision"]
|
|
8547
|
+
}
|
|
8548
|
+
};
|
|
8549
|
+
function canonicalAction(action) {
|
|
8550
|
+
if (action === "create") return "add";
|
|
8551
|
+
if (action === "update" || action === "status" || action === "move") return "set";
|
|
8552
|
+
if (action === "delete") return "rm";
|
|
8553
|
+
return action in ACTION_OPTIONS ? action : null;
|
|
8554
|
+
}
|
|
8555
|
+
function allowedOptions(entity, action) {
|
|
8556
|
+
const entityOptions = action === "list" || action === "add" || action === "set" || action === "done" ? ENTITY_OPTIONS[entity][action] : [];
|
|
8557
|
+
return [...COMMON_OPTIONS, ...ACTION_OPTIONS[action], ...entityOptions];
|
|
8558
|
+
}
|
|
8529
8559
|
function requireId2(id, action) {
|
|
8530
8560
|
if (!id) throw new Error(`"pm ... ${action}" needs an item id`);
|
|
8531
8561
|
return id;
|
|
@@ -8557,27 +8587,25 @@ async function buildContext2(parsed, deps) {
|
|
|
8557
8587
|
async function pmCommand(parsed, deps = {}) {
|
|
8558
8588
|
const word = parsed.positionals[1] ?? "";
|
|
8559
8589
|
if (word === "handoff") {
|
|
8560
|
-
assertArgs(parsed,
|
|
8590
|
+
assertArgs(parsed, [...COMMON_OPTIONS, "app"], 2);
|
|
8561
8591
|
return pmHandoff(await buildContext2(parsed, deps), parsed);
|
|
8562
8592
|
}
|
|
8563
8593
|
const entity = ALIASES[word];
|
|
8564
8594
|
if (!entity) throw new Error(`unknown pm entity "${word}". Try "odla-ai pm bug list" (goal|task|decision|bug).`);
|
|
8565
|
-
const
|
|
8566
|
-
|
|
8595
|
+
const requestedAction = parsed.positionals[2] ?? "list";
|
|
8596
|
+
const action = canonicalAction(requestedAction);
|
|
8597
|
+
if (!action) throw new Error(`unknown pm action "${requestedAction}". Try list|add|get|set|done|comment|comments|rm.`);
|
|
8598
|
+
assertArgs(parsed, allowedOptions(entity, action), 4);
|
|
8567
8599
|
const ctx = await buildContext2(parsed, deps);
|
|
8568
8600
|
const id = parsed.positionals[3];
|
|
8569
8601
|
switch (action) {
|
|
8570
8602
|
case "list":
|
|
8571
8603
|
return pmList(ctx, entity, parsed);
|
|
8572
8604
|
case "add":
|
|
8573
|
-
case "create":
|
|
8574
8605
|
return pmAdd(ctx, entity, parsed);
|
|
8575
8606
|
case "get":
|
|
8576
8607
|
return pmGet(ctx, entity, requireId2(id, action));
|
|
8577
8608
|
case "set":
|
|
8578
|
-
case "update":
|
|
8579
|
-
case "status":
|
|
8580
|
-
case "move":
|
|
8581
8609
|
return pmSet(ctx, entity, requireId2(id, action), parsed);
|
|
8582
8610
|
case "done":
|
|
8583
8611
|
return pmDone(ctx, entity, requireId2(id, action), parsed);
|
|
@@ -8586,10 +8614,7 @@ async function pmCommand(parsed, deps = {}) {
|
|
|
8586
8614
|
case "comments":
|
|
8587
8615
|
return pmComments(ctx, entity, requireId2(id, action));
|
|
8588
8616
|
case "rm":
|
|
8589
|
-
case "delete":
|
|
8590
8617
|
return pmRemove(ctx, entity, requireId2(id, action));
|
|
8591
|
-
default:
|
|
8592
|
-
throw new Error(`unknown pm action "${action}". Try list|add|get|set|done|comment|comments|rm.`);
|
|
8593
8618
|
}
|
|
8594
8619
|
}
|
|
8595
8620
|
|
|
@@ -9560,7 +9585,7 @@ function recordInvocation(parsed) {
|
|
|
9560
9585
|
try {
|
|
9561
9586
|
const entry = {
|
|
9562
9587
|
path: invocationPath(parsed.positionals),
|
|
9563
|
-
options: Object.
|
|
9588
|
+
options: Object.entries(parsed.options).map(([name, value]) => value === false ? `no-${name}` : name).sort()
|
|
9564
9589
|
};
|
|
9565
9590
|
if (!entry.path.length) return;
|
|
9566
9591
|
(0, import_node_fs15.appendFileSync)(file, `${JSON.stringify(entry)}
|
|
@@ -10333,7 +10358,7 @@ async function whoamiCommand(parsed, deps = {}) {
|
|
|
10333
10358
|
}
|
|
10334
10359
|
|
|
10335
10360
|
// src/runbook-command.ts
|
|
10336
|
-
var
|
|
10361
|
+
var ALLOWED2 = [
|
|
10337
10362
|
"config",
|
|
10338
10363
|
"token",
|
|
10339
10364
|
"email",
|
|
@@ -10421,7 +10446,7 @@ async function buildContext3(parsed, deps, action) {
|
|
|
10421
10446
|
}
|
|
10422
10447
|
async function runbookCommand(parsed, deps = {}) {
|
|
10423
10448
|
const action = parsed.positionals[1] ?? "list";
|
|
10424
|
-
assertArgs(parsed,
|
|
10449
|
+
assertArgs(parsed, ALLOWED2, action === "ask" || action === "search" ? 64 : 4);
|
|
10425
10450
|
const ctx = await buildContext3(parsed, deps, action);
|
|
10426
10451
|
const slug = parsed.positionals[2];
|
|
10427
10452
|
switch (action) {
|