@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/bin.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  exitCodeFor,
4
4
  runCli
5
- } from "./chunk-QMA5OGKQ.js";
5
+ } from "./chunk-I4XURPUK.js";
6
6
 
7
7
  // src/bin.ts
8
8
  runCli().catch((err) => {
@@ -5946,8 +5946,8 @@ Usage:
5946
5946
  odla-ai runbook list [--app <id>] [--all] [--q <text>] [--json]
5947
5947
  odla-ai runbook comment <slug> --body "..." [--app <id>]
5948
5948
  odla-ai runbook get <slug> [--app <id>]
5949
- odla-ai runbook new <slug> --title <t> --file <path|-> [--summary <s>] [--app <id>]
5950
- odla-ai runbook edit <slug> [--file <path|->|--body "..."] [--note <why>] [--app <id>]
5949
+ odla-ai runbook new <slug> --title <t> --file <path|-> [--summary <s>] [--requires <specs>] [--app <id>]
5950
+ odla-ai runbook edit <slug> [--file <path|->|--body "..."] [--note <why>] [--requires <specs>] [--app <id>]
5951
5951
  odla-ai runbook import <dir> [--visibility operator|admin] [--dry-run] [--app <id>]
5952
5952
  odla-ai runbook publish <slug> [--app <id>]
5953
5953
  odla-ai runbook visibility <slug> <operator|admin> [--app <id>]
@@ -8281,17 +8281,19 @@ async function runbookGet(ctx, slug) {
8281
8281
  if (unmet.length) ctx.out.error(describeUnmet(slug, unmet));
8282
8282
  ctx.out.log(runbook.body);
8283
8283
  }
8284
- async function runbookNew(ctx, slug, title, body, summary) {
8284
+ async function runbookNew(ctx, slug, title, body, summary, requires) {
8285
8285
  const created = await call(ctx, "POST", "/runbook", {
8286
8286
  appId: ctx.appId,
8287
- input: { slug, title, body, ...summary ? { summary } : {} }
8287
+ input: { slug, title, body, ...summary ? { summary } : {}, ...requires ? { requires } : {} }
8288
8288
  });
8289
8289
  ctx.out.log(ctx.json ? JSON.stringify(created, null, 2) : `created ${slug} (${created.id})`);
8290
8290
  }
8291
- async function runbookEdit(ctx, slug, body, note) {
8291
+ async function runbookEdit(ctx, slug, body, note, requires) {
8292
8292
  const runbook = await bySlug(ctx, slug);
8293
8293
  const result = await call(ctx, "PATCH", `/runbook/${encodeURIComponent(runbook.id)}`, {
8294
- patch: { body, ...note ? { note } : {} }
8294
+ // An empty --requires clears the declaration; omitting the flag leaves
8295
+ // whatever is there, so an ordinary body edit never drops it.
8296
+ patch: { body, ...note ? { note } : {}, ...requires === void 0 ? {} : { requires: requires || null } }
8295
8297
  });
8296
8298
  if (ctx.json) return ctx.out.log(JSON.stringify(result, null, 2));
8297
8299
  ctx.out.log(`${slug} \u2192 v${result.record?.version ?? runbook.version + 1}`);
@@ -8945,7 +8947,8 @@ var ALLOWED2 = [
8945
8947
  "visibility",
8946
8948
  "dry-run",
8947
8949
  "limit",
8948
- "base"
8950
+ "base",
8951
+ "requires"
8949
8952
  ];
8950
8953
  function requireSlug(slug, action) {
8951
8954
  if (!slug) throw new Error(`"runbook ${action}" needs a slug, e.g. "odla-ai runbook ${action} release"`);
@@ -9066,7 +9069,8 @@ async function runbookCommand(parsed, deps = {}) {
9066
9069
  name,
9067
9070
  stringOpt(parsed.options.title) ?? name,
9068
9071
  readBody(stringOpt(parsed.options.file), stringOpt(parsed.options.body)),
9069
- stringOpt(parsed.options.summary)
9072
+ stringOpt(parsed.options.summary),
9073
+ stringOpt(parsed.options.requires)
9070
9074
  );
9071
9075
  }
9072
9076
  case "edit": {
@@ -9075,7 +9079,13 @@ async function runbookCommand(parsed, deps = {}) {
9075
9079
  const inline = stringOpt(parsed.options.body);
9076
9080
  const body = file === void 0 && inline === void 0 ? await editRunbook(ctx, name) : readBody(file, inline);
9077
9081
  if (body === null) return ctx.out.log(`${name} unchanged; nothing written`);
9078
- return runbookEdit(ctx, name, body, stringOpt(parsed.options.note));
9082
+ return runbookEdit(
9083
+ ctx,
9084
+ name,
9085
+ body,
9086
+ stringOpt(parsed.options.note),
9087
+ parsed.options.requires === void 0 ? void 0 : stringOpt(parsed.options.requires) ?? ""
9088
+ );
9079
9089
  }
9080
9090
  case "import": {
9081
9091
  const dir = parsed.positionals[2];
@@ -9705,4 +9715,4 @@ export {
9705
9715
  exitCodeFor,
9706
9716
  runCli
9707
9717
  };
9708
- //# sourceMappingURL=chunk-QMA5OGKQ.js.map
9718
+ //# sourceMappingURL=chunk-I4XURPUK.js.map