@odla-ai/cli 0.25.11 → 0.25.12

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/index.cjs CHANGED
@@ -2448,7 +2448,7 @@ var CAPABILITIES = {
2448
2448
  "compose declared app-capability schema/rules, create guarded seeds when absent, and configure platform AI, auth, and deployment links",
2449
2449
  "apply Google Calendar booking config, then drive state-bound consent, status, discovery, and disconnect flows (bookings run live through the platform proxy)",
2450
2450
  "validate integration contracts offline and smoke-test a provisioned db environment plus anonymous capability routes",
2451
- "read one versioned o11y status envelope spanning application RED, current live-sync freshness/load, the protected commit-to-visible canary, collector ingest/scheduler trust, provider-owned runtime metrics, and a bounded machine verdict",
2451
+ "read one versioned o11y status envelope spanning application RED, exact Worker versions observed in traffic, current live-sync freshness/load, the protected commit-to-visible canary, collector ingest/scheduler trust, provider-owned runtime metrics, and a bounded machine verdict",
2452
2452
  "inspect durable agent wakeups as a versioned JSON envelope and explicitly requeue one dead-lettered job with a scoped environment credential",
2453
2453
  "run app-attributed hosted security discovery and independent validation without provider keys",
2454
2454
  "connect/revoke source-read-only GitHub sources and drive commit-pinned hosted security jobs without PATs or provider keys",
@@ -2470,7 +2470,7 @@ var CAPABILITIES = {
2470
2470
  "approve GitHub App repository access separately from redacted-snippet disclosure"
2471
2471
  ],
2472
2472
  studio: [
2473
- "view application telemetry, reconciled live-sync load/freshness, commit-to-visible canary health, provider-owned Worker runtime metrics, and environment state",
2473
+ "view application telemetry grouped by exact Worker version, reconciled live-sync load/freshness, commit-to-visible canary health, provider-owned Worker runtime metrics, and environment state",
2474
2474
  "let signed-in users inventory/revoke their own agent grants and admins audit/global-revoke them",
2475
2475
  "review calendar connection, granted read scope, selected calendars, and sync health without exposing provider tokens",
2476
2476
  "perform manual credential recovery \u2014 for the primary owner or any co-owner \u2014 when the CLI's local shown-once copy is unavailable",
@@ -8283,6 +8283,71 @@ function sourceHttp(reasons, source, read3, prefix = "") {
8283
8283
  });
8284
8284
  }
8285
8285
 
8286
+ // src/o11y-output.ts
8287
+ function printO11yStatus(status, out) {
8288
+ out.log(
8289
+ `o11y status ${status.scope.appId}/${status.scope.env} (${status.scope.minutes}m)`
8290
+ );
8291
+ const routes = Array.isArray(status.application.body.routes) ? status.application.body.routes.filter(record6) : [];
8292
+ const requests = routes.reduce(
8293
+ (total, row) => total + numeric3(row.requests),
8294
+ 0
8295
+ );
8296
+ const errors = routes.reduce(
8297
+ (total, row) => total + numeric3(row.errors),
8298
+ 0
8299
+ );
8300
+ out.log(
8301
+ `application ${status.application.httpStatus} ${requests} requests ${errors} errors`
8302
+ );
8303
+ const versions = Array.isArray(status.applicationVersions.body.rows) ? status.applicationVersions.body.rows.filter(record6) : [];
8304
+ out.log(
8305
+ `application-versions ${status.applicationVersions.httpStatus} ${versions.length ? versions.slice(0, 5).map(
8306
+ (row) => `${String(row.value || "(unattributed)")}:${numeric3(row.requests)}`
8307
+ ).join(", ") : "none observed"}`
8308
+ );
8309
+ out.log(liveSyncLine(status.liveSync));
8310
+ const canaryDurations = record6(status.canary.body.durationsMs) ? status.canary.body.durationsMs : {};
8311
+ out.log(
8312
+ `canary ${status.canary.httpStatus} ${String(status.canary.body.status ?? status.canary.body.error ?? "unavailable")} ${optionalNumeric(canaryDurations.publishToVisibleMs)} publish-to-visible`
8313
+ );
8314
+ const collectorIngest = record6(status.collector.body.ingest) ? status.collector.body.ingest : {};
8315
+ const collectorStorage = record6(collectorIngest.storage) ? collectorIngest.storage : {};
8316
+ out.log(
8317
+ `collector ${status.collector.httpStatus} ${String(status.collector.body.status ?? status.collector.body.error ?? "unavailable")} ${numeric3(collectorStorage.affectedPoints)} affected points`
8318
+ );
8319
+ const providerMetrics = record6(status.provider.body.metrics) ? status.provider.body.metrics : {};
8320
+ out.log(
8321
+ `cloudflare ${status.provider.httpStatus} ${String(status.provider.body.status ?? status.provider.body.error ?? "unavailable")} ${numeric3(providerMetrics.requests)} invocations ${numeric3(providerMetrics.errors)} runtime errors`
8322
+ );
8323
+ const providerPoints = Array.isArray(status.providerHistory.body.points) ? status.providerHistory.body.points.length : 0;
8324
+ const providerFreshness = record6(status.providerHistory.body.freshness) ? status.providerHistory.body.freshness : {};
8325
+ out.log(
8326
+ `cloudflare-history ${status.providerHistory.httpStatus} ${String(status.providerHistory.body.status ?? status.providerHistory.body.error ?? "unavailable")} ${providerPoints} snapshots ${optionalAge(providerFreshness.ageMs)} old`
8327
+ );
8328
+ out.log(
8329
+ `verdict ${status.verdict.status} ${status.verdict.reasons.map((reason) => `${reason.source}:${reason.code}`).join(", ") || "all required signals healthy"}`
8330
+ );
8331
+ }
8332
+ function liveSyncLine(read3) {
8333
+ const performance = record6(read3.body.performance) ? read3.body.performance : {};
8334
+ const commitToSend = record6(performance.commitToSend) ? performance.commitToSend : {};
8335
+ return `live-sync ${read3.httpStatus} ${String(read3.body.status ?? read3.body.error ?? "unavailable")} ${numeric3(read3.body.activeConnections)} active ${optionalNumeric(commitToSend.p95)} commit-to-send p95 ${numeric3(performance.sendFailures)} send failures`;
8336
+ }
8337
+ function record6(value) {
8338
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
8339
+ }
8340
+ function numeric3(value) {
8341
+ return typeof value === "number" && Number.isFinite(value) ? value : 0;
8342
+ }
8343
+ function optionalNumeric(value) {
8344
+ return typeof value === "number" && Number.isFinite(value) ? `${value} ms` : "\u2014";
8345
+ }
8346
+ function optionalAge(value) {
8347
+ if (typeof value !== "number" || !Number.isFinite(value)) return "unknown";
8348
+ return `${Math.max(0, Math.round(value / 1e3))}s`;
8349
+ }
8350
+
8286
8351
  // src/o11y-command.ts
8287
8352
  async function o11yCommand(parsed, deps = {}) {
8288
8353
  assertArgs(
@@ -8320,8 +8385,23 @@ async function o11yCommand(parsed, deps = {}) {
8320
8385
  const base = `${cfg.platformUrl}/o11y/${encodeURIComponent(appId)}`;
8321
8386
  const query = new URLSearchParams({ env, minutes: String(minutes) });
8322
8387
  const headers = { authorization: `Bearer ${token}` };
8323
- const [application, liveSync, canary, collector, provider, providerHistory] = await Promise.all([
8388
+ const versionsQuery = new URLSearchParams({
8389
+ env,
8390
+ minutes: String(minutes),
8391
+ dimension: "version",
8392
+ metric: "requests"
8393
+ });
8394
+ const [
8395
+ application,
8396
+ applicationVersions,
8397
+ liveSync,
8398
+ canary,
8399
+ collector,
8400
+ provider,
8401
+ providerHistory
8402
+ ] = await Promise.all([
8324
8403
  read2(`${base}/metrics/red?${query}`, headers, doFetch),
8404
+ read2(`${base}/explore?${versionsQuery}`, headers, doFetch),
8325
8405
  read2(
8326
8406
  `${base}/live-sync/health?${query}`,
8327
8407
  headers,
@@ -8345,11 +8425,12 @@ async function o11yCommand(parsed, deps = {}) {
8345
8425
  providerHistory
8346
8426
  });
8347
8427
  const status = {
8348
- schemaVersion: 5,
8428
+ schemaVersion: 6,
8349
8429
  scope: { appId, env, minutes },
8350
8430
  observedAt: (/* @__PURE__ */ new Date()).toISOString(),
8351
8431
  verdict,
8352
8432
  application,
8433
+ applicationVersions,
8353
8434
  liveSync,
8354
8435
  canary,
8355
8436
  collector,
@@ -8360,7 +8441,7 @@ async function o11yCommand(parsed, deps = {}) {
8360
8441
  out.log(JSON.stringify(status, null, 2));
8361
8442
  return;
8362
8443
  }
8363
- printStatus2(status, out);
8444
+ printO11yStatus(status, out);
8364
8445
  }
8365
8446
  function statusMinutes(value) {
8366
8447
  if (!Number.isSafeInteger(value) || value < 1 || value > 7 * 24 * 60) {
@@ -8382,65 +8463,6 @@ async function read2(url, headers, doFetch) {
8382
8463
  }
8383
8464
  return { httpStatus: response2.status, body };
8384
8465
  }
8385
- function printStatus2(status, out) {
8386
- out.log(
8387
- `o11y status ${status.scope.appId}/${status.scope.env} (${status.scope.minutes}m)`
8388
- );
8389
- const routes = Array.isArray(status.application.body.routes) ? status.application.body.routes.filter(record6) : [];
8390
- const requests = routes.reduce(
8391
- (total, row) => total + numeric3(row.requests),
8392
- 0
8393
- );
8394
- const errors = routes.reduce(
8395
- (total, row) => total + numeric3(row.errors),
8396
- 0
8397
- );
8398
- out.log(
8399
- `application ${status.application.httpStatus} ${requests} requests ${errors} errors`
8400
- );
8401
- out.log(
8402
- liveSyncLine(status.liveSync)
8403
- );
8404
- const canaryDurations = record6(status.canary.body.durationsMs) ? status.canary.body.durationsMs : {};
8405
- out.log(
8406
- `canary ${status.canary.httpStatus} ${String(status.canary.body.status ?? status.canary.body.error ?? "unavailable")} ${optionalNumeric(canaryDurations.publishToVisibleMs)} publish-to-visible`
8407
- );
8408
- const collectorIngest = record6(status.collector.body.ingest) ? status.collector.body.ingest : {};
8409
- const collectorStorage = record6(collectorIngest.storage) ? collectorIngest.storage : {};
8410
- out.log(
8411
- `collector ${status.collector.httpStatus} ${String(status.collector.body.status ?? status.collector.body.error ?? "unavailable")} ${numeric3(collectorStorage.affectedPoints)} affected points`
8412
- );
8413
- const providerMetrics = record6(status.provider.body.metrics) ? status.provider.body.metrics : {};
8414
- out.log(
8415
- `cloudflare ${status.provider.httpStatus} ${String(status.provider.body.status ?? status.provider.body.error ?? "unavailable")} ${numeric3(providerMetrics.requests)} invocations ${numeric3(providerMetrics.errors)} runtime errors`
8416
- );
8417
- const providerPoints = Array.isArray(status.providerHistory.body.points) ? status.providerHistory.body.points.length : 0;
8418
- const providerFreshness = record6(status.providerHistory.body.freshness) ? status.providerHistory.body.freshness : {};
8419
- out.log(
8420
- `cloudflare-history ${status.providerHistory.httpStatus} ${String(status.providerHistory.body.status ?? status.providerHistory.body.error ?? "unavailable")} ${providerPoints} snapshots ${optionalAge(providerFreshness.ageMs)} old`
8421
- );
8422
- out.log(
8423
- `verdict ${status.verdict.status} ${status.verdict.reasons.map((reason) => `${reason.source}:${reason.code}`).join(", ") || "all required signals healthy"}`
8424
- );
8425
- }
8426
- function liveSyncLine(read3) {
8427
- const performance = record6(read3.body.performance) ? read3.body.performance : {};
8428
- const commitToSend = record6(performance.commitToSend) ? performance.commitToSend : {};
8429
- return `live-sync ${read3.httpStatus} ${String(read3.body.status ?? read3.body.error ?? "unavailable")} ${numeric3(read3.body.activeConnections)} active ${optionalNumeric(commitToSend.p95)} commit-to-send p95 ${numeric3(performance.sendFailures)} send failures`;
8430
- }
8431
- function record6(value) {
8432
- return Boolean(value) && typeof value === "object" && !Array.isArray(value);
8433
- }
8434
- function numeric3(value) {
8435
- return typeof value === "number" && Number.isFinite(value) ? value : 0;
8436
- }
8437
- function optionalNumeric(value) {
8438
- return typeof value === "number" && Number.isFinite(value) ? `${value} ms` : "\u2014";
8439
- }
8440
- function optionalAge(value) {
8441
- if (typeof value !== "number" || !Number.isFinite(value)) return "unknown";
8442
- return `${Math.max(0, Math.round(value / 1e3))}s`;
8443
- }
8444
8466
 
8445
8467
  // src/provision.ts
8446
8468
  var import_apps5 = require("@odla-ai/apps");