@odla-ai/cli 0.27.10 → 0.27.11

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
@@ -3,7 +3,7 @@ import {
3
3
  exitCodeFor,
4
4
  redactSecrets,
5
5
  runCli
6
- } from "./chunk-OGZELVS5.js";
6
+ } from "./chunk-Y7WFLSTN.js";
7
7
 
8
8
  // src/bin.ts
9
9
  runCli().catch((err) => {
@@ -1546,7 +1546,7 @@ async function calendarCalendars(options) {
1546
1546
  return calendars;
1547
1547
  }
1548
1548
  async function calendarConnect(options) {
1549
- const { cfg, ctx, out } = await lifecycleContext(options);
1549
+ const { cfg, ctx, out } = await lifecycleContext(options, ["app.manage"]);
1550
1550
  productionConsent(ctx.env, options.yes, "connect calendar");
1551
1551
  const page2 = calendarBookingPageUrl(cfg, ctx.env);
1552
1552
  const applied = page2 === void 0 ? await readCalendarStatus(ctx) : await applyCalendarSettings(ctx, page2);
@@ -1572,7 +1572,7 @@ async function ensureCalendarConnected(ctx, options) {
1572
1572
  const connectOptions = connectionOptions(options, out);
1573
1573
  return await continueConnectedCalendar(ctx, current, connectOptions) ?? connectWithContext(ctx, connectOptions);
1574
1574
  }
1575
- async function lifecycleContext(options) {
1575
+ async function lifecycleContext(options, optionalProjectCapabilities = []) {
1576
1576
  const cfg = await loadProjectConfig(options.configPath);
1577
1577
  if (!cfg.services.includes("calendar")) throw new Error("calendar service is not enabled in config services");
1578
1578
  const env = options.env ?? (cfg.envs.includes("dev") ? "dev" : cfg.envs[0]);
@@ -1590,7 +1590,8 @@ async function lifecycleContext(options) {
1590
1590
  openApprovalUrl: options.openConsentUrl
1591
1591
  },
1592
1592
  doFetch,
1593
- out
1593
+ out,
1594
+ { optionalProjectCapabilities }
1594
1595
  );
1595
1596
  return { cfg, ctx: { platform: cfg.platformUrl, appId: cfg.app.id, env, token, fetch: doFetch }, out };
1596
1597
  }
@@ -1800,11 +1801,17 @@ async function assertTenantAdminAccess(doFetch, cfg, env, token) {
1800
1801
  if (res.ok || res.status === 404) return;
1801
1802
  if (res.status === 403) {
1802
1803
  const detail = await safeText4(res);
1803
- if (errorCode(detail) === "human_session_required") {
1804
+ const code = errorCode(detail);
1805
+ if (code === "human_session_required") {
1804
1806
  throw new Error(
1805
1807
  `${env}: odla-db rejected the provision credential before checking ownership for "${cfg.app.id}" (tenant ${tenantId}): human_session_required. Retrying or changing app owners will not help; the deployed odla-db must accept owner-approved app.manage credentials on provisioning routes`
1806
1808
  );
1807
1809
  }
1810
+ if (code === "provision_approval_required") {
1811
+ throw new Error(
1812
+ `${env}: the agent credential does not carry the owner-reviewed app.manage grant required to provision "${cfg.app.id}" (tenant ${tenantId}). The human owner id on the token is accountability, not agent authority. Discard the cached or supplied token and run this command with the current CLI to approve one fresh exact-project provisioning handshake`
1813
+ );
1814
+ }
1808
1815
  throw new Error(
1809
1816
  `${env}: this credential lacks live app.manage authority for "${cfg.app.id}" (tenant ${tenantId}) \u2014 nothing was minted or written; re-run provision with a fresh owner-approved provision handshake. If the human account is not an owner, an existing owner must add it in signed-in Studio; an agent token cannot repair ownership`
1810
1817
  );
@@ -3319,7 +3326,9 @@ async function secretsSet(options) {
3319
3326
  throw new Error('"$"-prefixed vault names are platform-reserved; for the Clerk secret key use "odla-ai secrets set-clerk-key"');
3320
3327
  }
3321
3328
  const { cfg, tenantId, value: value2, doFetch, out } = await resolveVaultWrite(options);
3322
- const token = await getDeveloperToken(cfg, options, doFetch, out);
3329
+ const token = await getDeveloperToken(cfg, options, doFetch, out, {
3330
+ optionalProjectCapabilities: ["app.manage"]
3331
+ });
3323
3332
  try {
3324
3333
  await putSecret({ endpoint: cfg.dbEndpoint, token, fetch: doFetch }, tenantId, name, value2);
3325
3334
  } catch (err) {
@@ -13213,4 +13222,4 @@ export {
13213
13222
  exitCodeFor,
13214
13223
  runCli
13215
13224
  };
13216
- //# sourceMappingURL=chunk-OGZELVS5.js.map
13225
+ //# sourceMappingURL=chunk-Y7WFLSTN.js.map