@odla-ai/cli 0.35.0 → 0.35.1

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
@@ -174,7 +174,7 @@ function absoluteEntryPath(entryPath) {
174
174
 
175
175
  // src/bin.ts
176
176
  var argv = process.argv.slice(2);
177
- requireCurrentCliForProvision(argv).then(() => requireCoherentProvisionRuntime(argv)).then(async () => (await import("./cli-Z5NSTS75.js")).runCli()).catch((err) => {
177
+ requireCurrentCliForProvision(argv).then(() => requireCoherentProvisionRuntime(argv)).then(async () => (await import("./cli-HS35QLXR.js")).runCli()).catch((err) => {
178
178
  console.error(redactSecrets(`odla-ai: ${err instanceof Error ? err.message : String(err)}`));
179
179
  process.exitCode = exitCodeFor(err);
180
180
  });
@@ -13309,9 +13309,20 @@ async function bySlug(ctx, slug) {
13309
13309
  "GET",
13310
13310
  `/runbook?app=${encodeURIComponent(ctx.appId)}&slug=${encodeURIComponent(slug)}&limit=1`
13311
13311
  );
13312
- const found = page2.records[0];
13313
- if (!found) throw new Error(`no runbook "${slug}" in ${ctx.appId}`);
13314
- return found;
13312
+ const filtered = page2.records.find((record11) => record11.slug === slug);
13313
+ if (filtered) return filtered;
13314
+ const limit = 100;
13315
+ for (let offset = 0; ; offset += limit) {
13316
+ const fallback = await call(
13317
+ ctx,
13318
+ "GET",
13319
+ `/runbook?app=${encodeURIComponent(ctx.appId)}&limit=${limit}&offset=${offset}`
13320
+ );
13321
+ const found = fallback.records.find((record11) => record11.slug === slug);
13322
+ if (found) return found;
13323
+ if (!fallback.records.length || offset + fallback.records.length >= fallback.total) break;
13324
+ }
13325
+ throw new Error(`no runbook "${slug}" in ${ctx.appId}`);
13315
13326
  }
13316
13327
  function readBody(file, inline) {
13317
13328
  if (inline !== void 0) return inline;
@@ -13396,7 +13407,7 @@ async function runbookRevert(ctx, slug, version) {
13396
13407
  ctx,
13397
13408
  "POST",
13398
13409
  `/runbook/${encodeURIComponent(runbook.id)}/revert`,
13399
- { version }
13410
+ { version, expectedVersion: runbook.version }
13400
13411
  );
13401
13412
  if (ctx.json) return ctx.out.log(JSON.stringify(result, null, 2));
13402
13413
  ctx.out.log(`${slug} reverted to v${version}, now v${result.record?.version ?? runbook.version + 1}`);
@@ -15034,4 +15045,4 @@ export {
15034
15045
  isTerminalHostedSecurityStatus,
15035
15046
  runCli
15036
15047
  };
15037
- //# sourceMappingURL=chunk-EG23MPUC.js.map
15048
+ //# sourceMappingURL=chunk-SRL2TN24.js.map