@odla-ai/cli 0.19.0 → 0.20.0

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/index.cjs CHANGED
@@ -6498,8 +6498,8 @@ Usage:
6498
6498
  odla-ai runbook list [--app <id>] [--all] [--q <text>] [--json]
6499
6499
  odla-ai runbook comment <slug> --body "..." [--app <id>]
6500
6500
  odla-ai runbook get <slug> [--app <id>]
6501
- odla-ai runbook new <slug> --title <t> --file <path|-> [--summary <s>] [--app <id>]
6502
- odla-ai runbook edit <slug> [--file <path|->|--body "..."] [--note <why>] [--app <id>]
6501
+ odla-ai runbook new <slug> --title <t> --file <path|-> [--summary <s>] [--requires <specs>] [--app <id>]
6502
+ odla-ai runbook edit <slug> [--file <path|->|--body "..."] [--note <why>] [--requires <specs>] [--app <id>]
6503
6503
  odla-ai runbook import <dir> [--visibility operator|admin] [--dry-run] [--app <id>]
6504
6504
  odla-ai runbook publish <slug> [--app <id>]
6505
6505
  odla-ai runbook visibility <slug> <operator|admin> [--app <id>]
@@ -7972,17 +7972,19 @@ async function runbookGet(ctx, slug) {
7972
7972
  if (unmet.length) ctx.out.error(describeUnmet(slug, unmet));
7973
7973
  ctx.out.log(runbook.body);
7974
7974
  }
7975
- async function runbookNew(ctx, slug, title, body, summary) {
7975
+ async function runbookNew(ctx, slug, title, body, summary, requires) {
7976
7976
  const created = await call(ctx, "POST", "/runbook", {
7977
7977
  appId: ctx.appId,
7978
- input: { slug, title, body, ...summary ? { summary } : {} }
7978
+ input: { slug, title, body, ...summary ? { summary } : {}, ...requires ? { requires } : {} }
7979
7979
  });
7980
7980
  ctx.out.log(ctx.json ? JSON.stringify(created, null, 2) : `created ${slug} (${created.id})`);
7981
7981
  }
7982
- async function runbookEdit(ctx, slug, body, note) {
7982
+ async function runbookEdit(ctx, slug, body, note, requires) {
7983
7983
  const runbook = await bySlug(ctx, slug);
7984
7984
  const result = await call(ctx, "PATCH", `/runbook/${encodeURIComponent(runbook.id)}`, {
7985
- patch: { body, ...note ? { note } : {} }
7985
+ // An empty --requires clears the declaration; omitting the flag leaves
7986
+ // whatever is there, so an ordinary body edit never drops it.
7987
+ patch: { body, ...note ? { note } : {}, ...requires === void 0 ? {} : { requires: requires || null } }
7986
7988
  });
7987
7989
  if (ctx.json) return ctx.out.log(JSON.stringify(result, null, 2));
7988
7990
  ctx.out.log(`${slug} \u2192 v${result.record?.version ?? runbook.version + 1}`);
@@ -8754,7 +8756,8 @@ var ALLOWED2 = [
8754
8756
  "visibility",
8755
8757
  "dry-run",
8756
8758
  "limit",
8757
- "base"
8759
+ "base",
8760
+ "requires"
8758
8761
  ];
8759
8762
  function requireSlug(slug, action) {
8760
8763
  if (!slug) throw new Error(`"runbook ${action}" needs a slug, e.g. "odla-ai runbook ${action} release"`);
@@ -8875,7 +8878,8 @@ async function runbookCommand(parsed, deps = {}) {
8875
8878
  name,
8876
8879
  stringOpt(parsed.options.title) ?? name,
8877
8880
  readBody(stringOpt(parsed.options.file), stringOpt(parsed.options.body)),
8878
- stringOpt(parsed.options.summary)
8881
+ stringOpt(parsed.options.summary),
8882
+ stringOpt(parsed.options.requires)
8879
8883
  );
8880
8884
  }
8881
8885
  case "edit": {
@@ -8884,7 +8888,13 @@ async function runbookCommand(parsed, deps = {}) {
8884
8888
  const inline = stringOpt(parsed.options.body);
8885
8889
  const body = file === void 0 && inline === void 0 ? await editRunbook(ctx, name) : readBody(file, inline);
8886
8890
  if (body === null) return ctx.out.log(`${name} unchanged; nothing written`);
8887
- return runbookEdit(ctx, name, body, stringOpt(parsed.options.note));
8891
+ return runbookEdit(
8892
+ ctx,
8893
+ name,
8894
+ body,
8895
+ stringOpt(parsed.options.note),
8896
+ parsed.options.requires === void 0 ? void 0 : stringOpt(parsed.options.requires) ?? ""
8897
+ );
8888
8898
  }
8889
8899
  case "import": {
8890
8900
  const dir = parsed.positionals[2];