@odla-ai/cli 0.10.1 → 0.11.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/README.md CHANGED
@@ -29,8 +29,8 @@ For a project you keep working in, install it as a dev dependency so the
29
29
  shorter `npx odla-ai` form works and the version is pinned by your lockfile:
30
30
 
31
31
  ```bash
32
- npm view @odla-ai/cli@0.10.1 version
33
- npm i -D --save-exact @odla-ai/cli@0.10.1
32
+ npm view @odla-ai/cli@0.10.2 version
33
+ npm i -D --save-exact @odla-ai/cli@0.10.2
34
34
  ```
35
35
 
36
36
  ## Prerequisites
@@ -215,7 +215,7 @@ mutation-id control. Public health remains aggregate rather than per calendar.
215
215
 
216
216
  The bundled build/migration skills add a passive pre-ship gate with
217
217
  `@odla-ai/security`: after the exact-version availability check, run
218
- `npm i -D --save-exact @odla-ai/security@0.2.2`, then
218
+ `npm i -D --save-exact @odla-ai/security@0.3.1`, then
219
219
  `npx odla-security scan . --profile odla --out .odla/security/pre-ship --fail-on high --fail-on-candidates critical`.
220
220
  The passive scan remains a separate binary: it makes no model calls and does
221
221
  not execute target code. After explicit redacted-source approval,
@@ -240,7 +240,7 @@ carries a bounded `Retry-After` only when the upstream supplied one. The CLI
240
240
  does not echo arbitrary response text or silently change the admin-selected
241
241
  model.
242
242
  Before installing the exact release, require
243
- `npm view @odla-ai/security@0.2.2 version` to succeed before installation. An
243
+ `npm view @odla-ai/security@0.3.1 version` to succeed before installation. An
244
244
  exact-version `E404` means the release is unavailable, not that the security
245
245
  preflight passed, and does not prove the package name is absent. odla's own
246
246
  engineering environment uses an equivalent internal gate; customer projects
package/REQUIREMENTS.md CHANGED
@@ -97,4 +97,6 @@ Agnacl, but none should mention or special-case Agnacl.
97
97
  - Every command must produce machine-readable enough output for an LLM to decide
98
98
  the next action from stdout alone.
99
99
  - Failures should name the exact config key or external capability missing.
100
- - The package must ship `llms.txt` so agents can use it without reading source.
100
+ - The package must ship its offline skills and README so agents have the
101
+ operational contract without reading private source; exported TypeScript
102
+ declarations/JSDoc remain the version-matched programmatic reference.
package/dist/bin.cjs CHANGED
@@ -1084,6 +1084,28 @@ function unique(values) {
1084
1084
  return [...new Set(values.filter(Boolean))];
1085
1085
  }
1086
1086
 
1087
+ // src/calendar-errors.ts
1088
+ var PLATFORM_NOT_READY_CODES = /* @__PURE__ */ new Set([
1089
+ "calendar_google_oauth_not_configured",
1090
+ "calendar_token_vault_not_configured",
1091
+ "calendar_db_ingress_not_configured"
1092
+ ]);
1093
+ var CalendarRequestError = class extends Error {
1094
+ /** HTTP status returned by the registry. */
1095
+ status;
1096
+ /** Machine-readable `error.code` from the response body, when present. */
1097
+ code;
1098
+ constructor(message, status, code) {
1099
+ super(message);
1100
+ this.name = "CalendarRequestError";
1101
+ this.status = status;
1102
+ if (code !== void 0) this.code = code;
1103
+ }
1104
+ };
1105
+ function isCalendarPlatformNotReady(error) {
1106
+ return error instanceof CalendarRequestError && error.code !== void 0 && PLATFORM_NOT_READY_CODES.has(error.code);
1107
+ }
1108
+
1087
1109
  // src/redact.ts
1088
1110
  var REPLACEMENTS = [
1089
1111
  [/odla_(sk|dev)_[A-Za-z0-9._-]+/g, "odla_$1_[redacted]"],
@@ -1249,7 +1271,8 @@ async function calendarJson(ctx, suffix, init) {
1249
1271
  if (!response.ok) {
1250
1272
  const code = textField(body.error?.code, 128);
1251
1273
  const message = textField(body.error?.message, 500);
1252
- throw new Error(redactSecrets(`calendar request failed (${response.status})${code ? ` ${code}` : ""}${message ? `: ${message}` : ""}`));
1274
+ const detail = `${code ? ` ${code}` : ""}${message ? `: ${message}` : ""}`;
1275
+ throw new CalendarRequestError(redactSecrets(`calendar request failed (${response.status})${detail}`), response.status, code);
1253
1276
  }
1254
1277
  return body;
1255
1278
  }
@@ -2300,17 +2323,6 @@ async function provision(options) {
2300
2323
  if (cfg.services.includes("calendar")) {
2301
2324
  const calendarCtx = { platform: cfg.platformUrl, appId: cfg.app.id, env, token, fetch: doFetch };
2302
2325
  await applyCalendarBookingPage(calendarCtx, calendarBookingPageUrl(cfg, env), out);
2303
- await ensureCalendarConnected(
2304
- calendarCtx,
2305
- {
2306
- open: options.open,
2307
- interactive: options.interactive,
2308
- openConsentUrl: options.openApprovalUrl,
2309
- wait: options.calendarPollWait,
2310
- pollTimeoutMs: options.calendarPollTimeoutMs,
2311
- stdout: out
2312
- }
2313
- );
2314
2326
  }
2315
2327
  }
2316
2328
  for (const env of cfg.envs) {
@@ -2374,6 +2386,26 @@ ${env}: credentials are already saved; retry "odla-ai secrets push --env ${env}$
2374
2386
  writeDevVars(devVarsTarget, credentials, env, o11yDevVars(cfg));
2375
2387
  out.log(`dev vars: wrote ${displayPath(devVarsTarget, cfg.rootDir)} for ${env}`);
2376
2388
  }
2389
+ if (cfg.services.includes("calendar")) {
2390
+ for (const env of cfg.envs) {
2391
+ try {
2392
+ await ensureCalendarConnected(
2393
+ { platform: cfg.platformUrl, appId: cfg.app.id, env, token, fetch: doFetch },
2394
+ {
2395
+ open: options.open,
2396
+ interactive: options.interactive,
2397
+ openConsentUrl: options.openApprovalUrl,
2398
+ wait: options.calendarPollWait,
2399
+ pollTimeoutMs: options.calendarPollTimeoutMs,
2400
+ stdout: out
2401
+ }
2402
+ );
2403
+ } catch (error) {
2404
+ if (!isCalendarPlatformNotReady(error)) throw error;
2405
+ out.log(`${env}: calendar consent skipped (${error.code}); resume with "odla-ai calendar connect --env ${env}" once the platform is configured`);
2406
+ }
2407
+ }
2408
+ }
2377
2409
  }
2378
2410
  function serviceRank(service) {
2379
2411
  if (service === "db") return 0;