@odla-ai/cli 0.46.5 → 0.46.7

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
@@ -172,7 +172,7 @@ function absoluteEntryPath(entryPath) {
172
172
 
173
173
  // src/bin.ts
174
174
  var argv = process.argv.slice(2);
175
- requireCurrentCliForProvision(argv).then(() => requireCoherentProvisionRuntime(argv)).then(async () => (await import("./cli-NXZIUCZT.js")).runCli()).catch((err) => {
175
+ requireCurrentCliForProvision(argv).then(() => requireCoherentProvisionRuntime(argv)).then(async () => (await import("./cli-IAA6SOCV.js")).runCli()).catch((err) => {
176
176
  console.error(redactSecrets(`odla-ai: ${err instanceof Error ? err.message : String(err)}`));
177
177
  process.exitCode = exitCodeFor(err);
178
178
  });
@@ -1343,7 +1343,8 @@ function surfacePaths(node = COMMAND_SURFACE, prefix = []) {
1343
1343
 
1344
1344
  // src/admin-spend.ts
1345
1345
  async function call(ctx, method, scope, payload) {
1346
- const url = `${ctx.platformUrl.replace(/\/$/, "")}/registry/platform/spend?scope=${encodeURIComponent(scope)}`;
1346
+ const base = `${ctx.platformUrl.replace(/\/$/, "")}/registry/platform/spend`;
1347
+ const url = scope === "default" ? `${base}/default` : `${base}?scope=${encodeURIComponent(scope)}`;
1347
1348
  const response2 = await ctx.doFetch(url, {
1348
1349
  method,
1349
1350
  headers: {
@@ -1397,7 +1398,7 @@ async function adminSpend(parsed, ctx) {
1397
1398
  if (action2 !== "show" && action2 !== "reset" && action2 !== "set") rejectWord(["admin", "spend"], action2);
1398
1399
  if (!scope) {
1399
1400
  throw new Error(
1400
- `"admin spend ${action2}" needs a scope, e.g. odla-ai admin spend ${action2} app:my-app:<incarnation>`
1401
+ `"admin spend ${action2}" needs a scope, e.g. odla-ai admin spend ${action2} app:my-app:<incarnation> (or "default" for the fleet-wide fallback)`
1401
1402
  );
1402
1403
  }
1403
1404
  if (action2 === "set") return adminSpendSet(ctx, parsed, scope);
@@ -1418,8 +1419,8 @@ async function adminSpendSet(ctx, parsed, scope) {
1418
1419
  ctx.out.log(JSON.stringify(result, null, 2));
1419
1420
  return;
1420
1421
  }
1421
- ctx.out.log(`${result.scope}: ${result.message}`);
1422
- ctx.out.log(` spent today ${money(result.spentUsd)}`);
1422
+ ctx.out.log(`${result.scope ?? scope}: ${result.message}`);
1423
+ if (typeof result.spentUsd === "number") ctx.out.log(` spent today ${money(result.spentUsd)}`);
1423
1424
  if (result.alreadyOverCap) {
1424
1425
  ctx.out.log(" today's spend already exceeds this cap \u2014 the next call will latch it.");
1425
1426
  }
@@ -16210,4 +16211,4 @@ export {
16210
16211
  isTerminalHostedSecurityStatus,
16211
16212
  runCli
16212
16213
  };
16213
- //# sourceMappingURL=chunk-PTOBFRCO.js.map
16214
+ //# sourceMappingURL=chunk-AVUBGTWE.js.map