@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/bin.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  exitCodeFor,
4
4
  redactSecrets,
5
5
  runCli
6
- } from "./chunk-MWLZO2EZ.js";
6
+ } from "./chunk-5U3EXWCR.js";
7
7
 
8
8
  // src/bin.ts
9
9
  runCli().catch((err) => {
@@ -3451,8 +3451,8 @@ async function materializeGitTree(source, commitSha, options = {}) {
3451
3451
  const maxFiles = options.maxFiles ?? 2e4;
3452
3452
  const maxBytes = options.maxBytes ?? 512 * 1024 * 1024;
3453
3453
  const inventory = (await gitOutput(sourceDir, ["ls-tree", "-rz", commitSha], 16 * 1024 * 1024)).toString("utf8").split("\0").filter(Boolean);
3454
- const entries = inventory.flatMap((record6) => {
3455
- const match = /^(100644|100755) blob ([0-9a-f]{40,64})\t([\s\S]+)$/.exec(record6);
3454
+ const entries = inventory.flatMap((record7) => {
3455
+ const match = /^(100644|100755) blob ([0-9a-f]{40,64})\t([\s\S]+)$/.exec(record7);
3456
3456
  return match && allowedWorkspacePath(match[3]) ? [{ mode: match[1], hash: match[2], path: match[3] }] : [];
3457
3457
  });
3458
3458
  if (entries.length > maxFiles) throw new Error(`workspace exceeds ${maxFiles} files`);
@@ -3700,8 +3700,8 @@ function normalize(value) {
3700
3700
  if (Array.isArray(value)) return value.map(normalize);
3701
3701
  if (value instanceof Uint8Array) return { $bytes: [...value] };
3702
3702
  if (typeof value === "object") {
3703
- const record6 = value;
3704
- return Object.fromEntries(Object.keys(record6).filter((key) => record6[key] !== void 0).sort().map((key) => [key, normalize(record6[key])]));
3703
+ const record7 = value;
3704
+ return Object.fromEntries(Object.keys(record7).filter((key) => record7[key] !== void 0).sort().map((key) => [key, normalize(record7[key])]));
3705
3705
  }
3706
3706
  throw new CamelError("state_conflict", "Canonical JSON rejects unsupported values.");
3707
3707
  }
@@ -8448,8 +8448,8 @@ async function pmAdd(ctx, entity, parsed) {
8448
8448
  emit2(ctx, res, () => ctx.out.log(`created ${entity} ${res.id}`));
8449
8449
  }
8450
8450
  async function pmGet(ctx, entity, id) {
8451
- const { record: record6 } = await pmRequest(ctx, "GET", `/${entity}/${encodeURIComponent(id)}`);
8452
- emit2(ctx, record6, () => printRecord(ctx, entity, record6));
8451
+ const { record: record7 } = await pmRequest(ctx, "GET", `/${entity}/${encodeURIComponent(id)}`);
8452
+ emit2(ctx, record7, () => printRecord(ctx, entity, record7));
8453
8453
  }
8454
8454
  async function pmSet(ctx, entity, id, parsed) {
8455
8455
  const patch2 = collectEntityFields(entity, parsed, true);
@@ -8494,9 +8494,9 @@ async function pmHandoff(ctx, parsed) {
8494
8494
  ]);
8495
8495
  const handoff = {
8496
8496
  appId,
8497
- unmetGoals: goals.filter((record6) => record6.status !== "met"),
8498
- activeTasks: tasks.filter((record6) => record6.column !== "done"),
8499
- openBugs: bugs.filter((record6) => record6.status !== "fixed" && record6.status !== "wontfix")
8497
+ unmetGoals: goals.filter((record7) => record7.status !== "met"),
8498
+ activeTasks: tasks.filter((record7) => record7.column !== "done"),
8499
+ openBugs: bugs.filter((record7) => record7.status !== "fixed" && record7.status !== "wontfix")
8500
8500
  };
8501
8501
  const result = {
8502
8502
  ...handoff,
@@ -8515,10 +8515,10 @@ async function pmHandoff(ctx, parsed) {
8515
8515
  ]) {
8516
8516
  ctx.out.log(`${label}:`);
8517
8517
  if (!records.length) ctx.out.log("- (none)");
8518
- else for (const record6 of records) printRecord(
8518
+ else for (const record7 of records) printRecord(
8519
8519
  ctx,
8520
8520
  label === "unmet goals" ? "goal" : label === "active tasks" ? "task" : "bug",
8521
- record6
8521
+ record7
8522
8522
  );
8523
8523
  }
8524
8524
  });
@@ -8659,6 +8659,21 @@ function statusVerdict(reads) {
8659
8659
  severity: "degraded"
8660
8660
  });
8661
8661
  }
8662
+ const performance = record5(reads.liveSync.body.performance) ? reads.liveSync.body.performance : null;
8663
+ if (performance?.status === "unavailable") {
8664
+ reasons.push({
8665
+ source: "liveSync",
8666
+ code: "subscription_metrics_unavailable",
8667
+ severity: "degraded"
8668
+ });
8669
+ }
8670
+ if (numeric2(performance?.telemetryDropped) > 0) {
8671
+ reasons.push({
8672
+ source: "liveSync",
8673
+ code: "subscription_telemetry_dropped",
8674
+ severity: "degraded"
8675
+ });
8676
+ }
8662
8677
  const canaryStatus = String(reads.canary.body.status ?? "");
8663
8678
  if (canaryStatus === "failing") {
8664
8679
  reasons.push({
@@ -8706,6 +8721,12 @@ function statusVerdict(reads) {
8706
8721
  reasons
8707
8722
  };
8708
8723
  }
8724
+ function record5(value) {
8725
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
8726
+ }
8727
+ function numeric2(value) {
8728
+ return typeof value === "number" && Number.isFinite(value) ? value : 0;
8729
+ }
8709
8730
  function collectorReason(read3, fallback) {
8710
8731
  const reasons = read3.body.reasons;
8711
8732
  if (!Array.isArray(reasons)) return fallback;
@@ -8763,7 +8784,7 @@ async function o11yCommand(parsed, deps = {}) {
8763
8784
  const [application, liveSync, canary, collector, provider] = await Promise.all([
8764
8785
  read2(`${base}/metrics/red?${query}`, headers, doFetch),
8765
8786
  read2(
8766
- `${base}/live-sync/health?${new URLSearchParams({ env })}`,
8787
+ `${base}/live-sync/health?${query}`,
8767
8788
  headers,
8768
8789
  doFetch
8769
8790
  ),
@@ -8783,7 +8804,7 @@ async function o11yCommand(parsed, deps = {}) {
8783
8804
  provider
8784
8805
  });
8785
8806
  const status = {
8786
- schemaVersion: 3,
8807
+ schemaVersion: 4,
8787
8808
  scope: { appId, env, minutes },
8788
8809
  observedAt: (/* @__PURE__ */ new Date()).toISOString(),
8789
8810
  verdict,
@@ -8823,42 +8844,47 @@ function printStatus2(status, out) {
8823
8844
  out.log(
8824
8845
  `o11y status ${status.scope.appId}/${status.scope.env} (${status.scope.minutes}m)`
8825
8846
  );
8826
- const routes = Array.isArray(status.application.body.routes) ? status.application.body.routes.filter(record5) : [];
8847
+ const routes = Array.isArray(status.application.body.routes) ? status.application.body.routes.filter(record6) : [];
8827
8848
  const requests = routes.reduce(
8828
- (total, row) => total + numeric2(row.requests),
8849
+ (total, row) => total + numeric3(row.requests),
8829
8850
  0
8830
8851
  );
8831
8852
  const errors = routes.reduce(
8832
- (total, row) => total + numeric2(row.errors),
8853
+ (total, row) => total + numeric3(row.errors),
8833
8854
  0
8834
8855
  );
8835
8856
  out.log(
8836
8857
  `application ${status.application.httpStatus} ${requests} requests ${errors} errors`
8837
8858
  );
8838
8859
  out.log(
8839
- `live-sync ${status.liveSync.httpStatus} ${String(status.liveSync.body.status ?? status.liveSync.body.error ?? "unavailable")} ${numeric2(status.liveSync.body.activeConnections)} active`
8860
+ liveSyncLine(status.liveSync)
8840
8861
  );
8841
- const canaryDurations = record5(status.canary.body.durationsMs) ? status.canary.body.durationsMs : {};
8862
+ const canaryDurations = record6(status.canary.body.durationsMs) ? status.canary.body.durationsMs : {};
8842
8863
  out.log(
8843
8864
  `canary ${status.canary.httpStatus} ${String(status.canary.body.status ?? status.canary.body.error ?? "unavailable")} ${optionalNumeric(canaryDurations.publishToVisibleMs)} publish-to-visible`
8844
8865
  );
8845
- const collectorIngest = record5(status.collector.body.ingest) ? status.collector.body.ingest : {};
8846
- const collectorStorage = record5(collectorIngest.storage) ? collectorIngest.storage : {};
8866
+ const collectorIngest = record6(status.collector.body.ingest) ? status.collector.body.ingest : {};
8867
+ const collectorStorage = record6(collectorIngest.storage) ? collectorIngest.storage : {};
8847
8868
  out.log(
8848
- `collector ${status.collector.httpStatus} ${String(status.collector.body.status ?? status.collector.body.error ?? "unavailable")} ${numeric2(collectorStorage.affectedPoints)} affected points`
8869
+ `collector ${status.collector.httpStatus} ${String(status.collector.body.status ?? status.collector.body.error ?? "unavailable")} ${numeric3(collectorStorage.affectedPoints)} affected points`
8849
8870
  );
8850
- const providerMetrics = record5(status.provider.body.metrics) ? status.provider.body.metrics : {};
8871
+ const providerMetrics = record6(status.provider.body.metrics) ? status.provider.body.metrics : {};
8851
8872
  out.log(
8852
- `cloudflare ${status.provider.httpStatus} ${String(status.provider.body.status ?? status.provider.body.error ?? "unavailable")} ${numeric2(providerMetrics.requests)} invocations ${numeric2(providerMetrics.errors)} runtime errors`
8873
+ `cloudflare ${status.provider.httpStatus} ${String(status.provider.body.status ?? status.provider.body.error ?? "unavailable")} ${numeric3(providerMetrics.requests)} invocations ${numeric3(providerMetrics.errors)} runtime errors`
8853
8874
  );
8854
8875
  out.log(
8855
8876
  `verdict ${status.verdict.status} ${status.verdict.reasons.map((reason) => `${reason.source}:${reason.code}`).join(", ") || "all required signals healthy"}`
8856
8877
  );
8857
8878
  }
8858
- function record5(value) {
8879
+ function liveSyncLine(read3) {
8880
+ const performance = record6(read3.body.performance) ? read3.body.performance : {};
8881
+ const commitToSend = record6(performance.commitToSend) ? performance.commitToSend : {};
8882
+ 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`;
8883
+ }
8884
+ function record6(value) {
8859
8885
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
8860
8886
  }
8861
- function numeric2(value) {
8887
+ function numeric3(value) {
8862
8888
  return typeof value === "number" && Number.isFinite(value) ? value : 0;
8863
8889
  }
8864
8890
  function optionalNumeric(value) {
@@ -10446,4 +10472,4 @@ export {
10446
10472
  exitCodeFor,
10447
10473
  runCli
10448
10474
  };
10449
- //# sourceMappingURL=chunk-MWLZO2EZ.js.map
10475
+ //# sourceMappingURL=chunk-5U3EXWCR.js.map