@odla-ai/cli 0.25.6 → 0.25.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/index.cjs CHANGED
@@ -4006,8 +4006,8 @@ async function materializeGitTree(source, commitSha, options = {}) {
4006
4006
  const maxFiles = options.maxFiles ?? 2e4;
4007
4007
  const maxBytes = options.maxBytes ?? 512 * 1024 * 1024;
4008
4008
  const inventory = (await gitOutput(sourceDir, ["ls-tree", "-rz", commitSha], 16 * 1024 * 1024)).toString("utf8").split("\0").filter(Boolean);
4009
- const entries = inventory.flatMap((record6) => {
4010
- const match = /^(100644|100755) blob ([0-9a-f]{40,64})\t([\s\S]+)$/.exec(record6);
4009
+ const entries = inventory.flatMap((record7) => {
4010
+ const match = /^(100644|100755) blob ([0-9a-f]{40,64})\t([\s\S]+)$/.exec(record7);
4011
4011
  return match && allowedWorkspacePath(match[3]) ? [{ mode: match[1], hash: match[2], path: match[3] }] : [];
4012
4012
  });
4013
4013
  if (entries.length > maxFiles) throw new Error(`workspace exceeds ${maxFiles} files`);
@@ -4255,8 +4255,8 @@ function normalize(value) {
4255
4255
  if (Array.isArray(value)) return value.map(normalize);
4256
4256
  if (value instanceof Uint8Array) return { $bytes: [...value] };
4257
4257
  if (typeof value === "object") {
4258
- const record6 = value;
4259
- return Object.fromEntries(Object.keys(record6).filter((key) => record6[key] !== void 0).sort().map((key) => [key, normalize(record6[key])]));
4258
+ const record7 = value;
4259
+ return Object.fromEntries(Object.keys(record7).filter((key) => record7[key] !== void 0).sort().map((key) => [key, normalize(record7[key])]));
4260
4260
  }
4261
4261
  throw new CamelError("state_conflict", "Canonical JSON rejects unsupported values.");
4262
4262
  }
@@ -7710,8 +7710,8 @@ async function pmAdd(ctx, entity, parsed) {
7710
7710
  emit2(ctx, res, () => ctx.out.log(`created ${entity} ${res.id}`));
7711
7711
  }
7712
7712
  async function pmGet(ctx, entity, id) {
7713
- const { record: record6 } = await pmRequest(ctx, "GET", `/${entity}/${encodeURIComponent(id)}`);
7714
- emit2(ctx, record6, () => printRecord(ctx, entity, record6));
7713
+ const { record: record7 } = await pmRequest(ctx, "GET", `/${entity}/${encodeURIComponent(id)}`);
7714
+ emit2(ctx, record7, () => printRecord(ctx, entity, record7));
7715
7715
  }
7716
7716
  async function pmSet(ctx, entity, id, parsed) {
7717
7717
  const patch2 = collectEntityFields(entity, parsed, true);
@@ -7756,9 +7756,9 @@ async function pmHandoff(ctx, parsed) {
7756
7756
  ]);
7757
7757
  const handoff = {
7758
7758
  appId,
7759
- unmetGoals: goals.filter((record6) => record6.status !== "met"),
7760
- activeTasks: tasks.filter((record6) => record6.column !== "done"),
7761
- openBugs: bugs.filter((record6) => record6.status !== "fixed" && record6.status !== "wontfix")
7759
+ unmetGoals: goals.filter((record7) => record7.status !== "met"),
7760
+ activeTasks: tasks.filter((record7) => record7.column !== "done"),
7761
+ openBugs: bugs.filter((record7) => record7.status !== "fixed" && record7.status !== "wontfix")
7762
7762
  };
7763
7763
  const result = {
7764
7764
  ...handoff,
@@ -7777,10 +7777,10 @@ async function pmHandoff(ctx, parsed) {
7777
7777
  ]) {
7778
7778
  ctx.out.log(`${label}:`);
7779
7779
  if (!records.length) ctx.out.log("- (none)");
7780
- else for (const record6 of records) printRecord(
7780
+ else for (const record7 of records) printRecord(
7781
7781
  ctx,
7782
7782
  label === "unmet goals" ? "goal" : label === "active tasks" ? "task" : "bug",
7783
- record6
7783
+ record7
7784
7784
  );
7785
7785
  }
7786
7786
  });
@@ -7921,6 +7921,21 @@ function statusVerdict(reads) {
7921
7921
  severity: "degraded"
7922
7922
  });
7923
7923
  }
7924
+ const performance = record5(reads.liveSync.body.performance) ? reads.liveSync.body.performance : null;
7925
+ if (performance?.status === "unavailable") {
7926
+ reasons.push({
7927
+ source: "liveSync",
7928
+ code: "subscription_metrics_unavailable",
7929
+ severity: "degraded"
7930
+ });
7931
+ }
7932
+ if (numeric2(performance?.telemetryDropped) > 0) {
7933
+ reasons.push({
7934
+ source: "liveSync",
7935
+ code: "subscription_telemetry_dropped",
7936
+ severity: "degraded"
7937
+ });
7938
+ }
7924
7939
  const canaryStatus = String(reads.canary.body.status ?? "");
7925
7940
  if (canaryStatus === "failing") {
7926
7941
  reasons.push({
@@ -7968,6 +7983,12 @@ function statusVerdict(reads) {
7968
7983
  reasons
7969
7984
  };
7970
7985
  }
7986
+ function record5(value) {
7987
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
7988
+ }
7989
+ function numeric2(value) {
7990
+ return typeof value === "number" && Number.isFinite(value) ? value : 0;
7991
+ }
7971
7992
  function collectorReason(read3, fallback) {
7972
7993
  const reasons = read3.body.reasons;
7973
7994
  if (!Array.isArray(reasons)) return fallback;
@@ -8025,7 +8046,7 @@ async function o11yCommand(parsed, deps = {}) {
8025
8046
  const [application, liveSync, canary, collector, provider] = await Promise.all([
8026
8047
  read2(`${base}/metrics/red?${query}`, headers, doFetch),
8027
8048
  read2(
8028
- `${base}/live-sync/health?${new URLSearchParams({ env })}`,
8049
+ `${base}/live-sync/health?${query}`,
8029
8050
  headers,
8030
8051
  doFetch
8031
8052
  ),
@@ -8045,7 +8066,7 @@ async function o11yCommand(parsed, deps = {}) {
8045
8066
  provider
8046
8067
  });
8047
8068
  const status = {
8048
- schemaVersion: 3,
8069
+ schemaVersion: 4,
8049
8070
  scope: { appId, env, minutes },
8050
8071
  observedAt: (/* @__PURE__ */ new Date()).toISOString(),
8051
8072
  verdict,
@@ -8085,42 +8106,47 @@ function printStatus2(status, out) {
8085
8106
  out.log(
8086
8107
  `o11y status ${status.scope.appId}/${status.scope.env} (${status.scope.minutes}m)`
8087
8108
  );
8088
- const routes = Array.isArray(status.application.body.routes) ? status.application.body.routes.filter(record5) : [];
8109
+ const routes = Array.isArray(status.application.body.routes) ? status.application.body.routes.filter(record6) : [];
8089
8110
  const requests = routes.reduce(
8090
- (total, row) => total + numeric2(row.requests),
8111
+ (total, row) => total + numeric3(row.requests),
8091
8112
  0
8092
8113
  );
8093
8114
  const errors = routes.reduce(
8094
- (total, row) => total + numeric2(row.errors),
8115
+ (total, row) => total + numeric3(row.errors),
8095
8116
  0
8096
8117
  );
8097
8118
  out.log(
8098
8119
  `application ${status.application.httpStatus} ${requests} requests ${errors} errors`
8099
8120
  );
8100
8121
  out.log(
8101
- `live-sync ${status.liveSync.httpStatus} ${String(status.liveSync.body.status ?? status.liveSync.body.error ?? "unavailable")} ${numeric2(status.liveSync.body.activeConnections)} active`
8122
+ liveSyncLine(status.liveSync)
8102
8123
  );
8103
- const canaryDurations = record5(status.canary.body.durationsMs) ? status.canary.body.durationsMs : {};
8124
+ const canaryDurations = record6(status.canary.body.durationsMs) ? status.canary.body.durationsMs : {};
8104
8125
  out.log(
8105
8126
  `canary ${status.canary.httpStatus} ${String(status.canary.body.status ?? status.canary.body.error ?? "unavailable")} ${optionalNumeric(canaryDurations.publishToVisibleMs)} publish-to-visible`
8106
8127
  );
8107
- const collectorIngest = record5(status.collector.body.ingest) ? status.collector.body.ingest : {};
8108
- const collectorStorage = record5(collectorIngest.storage) ? collectorIngest.storage : {};
8128
+ const collectorIngest = record6(status.collector.body.ingest) ? status.collector.body.ingest : {};
8129
+ const collectorStorage = record6(collectorIngest.storage) ? collectorIngest.storage : {};
8109
8130
  out.log(
8110
- `collector ${status.collector.httpStatus} ${String(status.collector.body.status ?? status.collector.body.error ?? "unavailable")} ${numeric2(collectorStorage.affectedPoints)} affected points`
8131
+ `collector ${status.collector.httpStatus} ${String(status.collector.body.status ?? status.collector.body.error ?? "unavailable")} ${numeric3(collectorStorage.affectedPoints)} affected points`
8111
8132
  );
8112
- const providerMetrics = record5(status.provider.body.metrics) ? status.provider.body.metrics : {};
8133
+ const providerMetrics = record6(status.provider.body.metrics) ? status.provider.body.metrics : {};
8113
8134
  out.log(
8114
- `cloudflare ${status.provider.httpStatus} ${String(status.provider.body.status ?? status.provider.body.error ?? "unavailable")} ${numeric2(providerMetrics.requests)} invocations ${numeric2(providerMetrics.errors)} runtime errors`
8135
+ `cloudflare ${status.provider.httpStatus} ${String(status.provider.body.status ?? status.provider.body.error ?? "unavailable")} ${numeric3(providerMetrics.requests)} invocations ${numeric3(providerMetrics.errors)} runtime errors`
8115
8136
  );
8116
8137
  out.log(
8117
8138
  `verdict ${status.verdict.status} ${status.verdict.reasons.map((reason) => `${reason.source}:${reason.code}`).join(", ") || "all required signals healthy"}`
8118
8139
  );
8119
8140
  }
8120
- function record5(value) {
8141
+ function liveSyncLine(read3) {
8142
+ const performance = record6(read3.body.performance) ? read3.body.performance : {};
8143
+ const commitToSend = record6(performance.commitToSend) ? performance.commitToSend : {};
8144
+ 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`;
8145
+ }
8146
+ function record6(value) {
8121
8147
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
8122
8148
  }
8123
- function numeric2(value) {
8149
+ function numeric3(value) {
8124
8150
  return typeof value === "number" && Number.isFinite(value) ? value : 0;
8125
8151
  }
8126
8152
  function optionalNumeric(value) {