@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/README.md +2 -1
- package/dist/bin.cjs +51 -25
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +1 -1
- package/dist/{chunk-MWLZO2EZ.js → chunk-5U3EXWCR.js} +52 -26
- package/dist/{chunk-MWLZO2EZ.js.map → chunk-5U3EXWCR.js.map} +1 -1
- package/dist/index.cjs +51 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
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((
|
|
4010
|
-
const match = /^(100644|100755) blob ([0-9a-f]{40,64})\t([\s\S]+)$/.exec(
|
|
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
|
|
4259
|
-
return Object.fromEntries(Object.keys(
|
|
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:
|
|
7714
|
-
emit2(ctx,
|
|
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((
|
|
7760
|
-
activeTasks: tasks.filter((
|
|
7761
|
-
openBugs: bugs.filter((
|
|
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
|
|
7780
|
+
else for (const record7 of records) printRecord(
|
|
7781
7781
|
ctx,
|
|
7782
7782
|
label === "unmet goals" ? "goal" : label === "active tasks" ? "task" : "bug",
|
|
7783
|
-
|
|
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?${
|
|
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:
|
|
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(
|
|
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 +
|
|
8111
|
+
(total, row) => total + numeric3(row.requests),
|
|
8091
8112
|
0
|
|
8092
8113
|
);
|
|
8093
8114
|
const errors = routes.reduce(
|
|
8094
|
-
(total, row) => total +
|
|
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
|
-
|
|
8122
|
+
liveSyncLine(status.liveSync)
|
|
8102
8123
|
);
|
|
8103
|
-
const canaryDurations =
|
|
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 =
|
|
8108
|
-
const collectorStorage =
|
|
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")} ${
|
|
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 =
|
|
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")} ${
|
|
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
|
|
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
|
|
8149
|
+
function numeric3(value) {
|
|
8124
8150
|
return typeof value === "number" && Number.isFinite(value) ? value : 0;
|
|
8125
8151
|
}
|
|
8126
8152
|
function optionalNumeric(value) {
|