@warmdrift/kgauto-compiler 2.0.0-alpha.7 → 2.0.0-alpha.70
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 +176 -46
- package/dist/brain-proxy.d.mts +113 -0
- package/dist/brain-proxy.d.ts +113 -0
- package/dist/brain-proxy.js +193 -0
- package/dist/brain-proxy.mjs +6 -0
- package/dist/chunk-4UO4CCSP.mjs +1620 -0
- package/dist/chunk-65ZMX5OT.mjs +169 -0
- package/dist/{chunk-5TI6PNSK.mjs → chunk-BVEXV5KC.mjs} +11 -0
- package/dist/chunk-FR4DNGLW.mjs +203 -0
- package/dist/chunk-NBO4R5PC.mjs +313 -0
- package/dist/chunk-P3TOAEG4.mjs +56 -0
- package/dist/chunk-RO22VFIF.mjs +29 -0
- package/dist/chunk-SBFSYCQG.mjs +719 -0
- package/dist/dialect.d.mts +41 -3
- package/dist/dialect.d.ts +41 -3
- package/dist/dialect.js +14 -2
- package/dist/dialect.mjs +5 -3
- package/dist/glassbox/index.d.mts +59 -0
- package/dist/glassbox/index.d.ts +59 -0
- package/dist/glassbox/index.js +312 -0
- package/dist/glassbox/index.mjs +12 -0
- package/dist/glassbox-routes/format.d.mts +24 -0
- package/dist/glassbox-routes/format.d.ts +24 -0
- package/dist/glassbox-routes/format.js +86 -0
- package/dist/glassbox-routes/format.mjs +18 -0
- package/dist/glassbox-routes/index.d.mts +191 -0
- package/dist/glassbox-routes/index.d.ts +191 -0
- package/dist/glassbox-routes/index.js +2888 -0
- package/dist/glassbox-routes/index.mjs +667 -0
- package/dist/glassbox-routes/react/index.d.mts +74 -0
- package/dist/glassbox-routes/react/index.d.ts +74 -0
- package/dist/glassbox-routes/react/index.js +819 -0
- package/dist/glassbox-routes/react/index.mjs +754 -0
- package/dist/index.d.mts +2739 -17
- package/dist/index.d.ts +2739 -17
- package/dist/index.js +8989 -1659
- package/dist/index.mjs +5078 -367
- package/dist/ir-Bqn1RVdV.d.mts +1583 -0
- package/dist/ir-Bvlkw5ja.d.ts +1583 -0
- package/dist/key-health.d.mts +131 -0
- package/dist/key-health.d.ts +131 -0
- package/dist/key-health.js +228 -0
- package/dist/key-health.mjs +6 -0
- package/dist/profiles.d.mts +292 -2
- package/dist/profiles.d.ts +292 -2
- package/dist/profiles.js +1231 -16
- package/dist/profiles.mjs +9 -1
- package/dist/types-Bon96eyc.d.ts +131 -0
- package/dist/types-CwGhacGT.d.mts +149 -0
- package/dist/types-DIxRZ3Dj.d.ts +149 -0
- package/dist/types-DsEq35WY.d.mts +131 -0
- package/package.json +54 -8
- package/dist/chunk-MBEI5UOM.mjs +0 -409
- package/dist/profiles-B3eNQ2py.d.ts +0 -619
- package/dist/profiles-Py8c7zjJ.d.mts +0 -619
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// src/glassbox-routes/format.ts
|
|
2
|
+
function formatAgo(iso, now = Date.now()) {
|
|
3
|
+
const t = Date.parse(iso);
|
|
4
|
+
if (Number.isNaN(t)) return iso;
|
|
5
|
+
const sec = Math.max(0, Math.floor((now - t) / 1e3));
|
|
6
|
+
if (sec < 60) return `${sec}s ago`;
|
|
7
|
+
if (sec < 3600) return `${Math.floor(sec / 60)}m ago`;
|
|
8
|
+
if (sec < 86400) return `${Math.floor(sec / 3600)}h ago`;
|
|
9
|
+
return `${Math.floor(sec / 86400)}d ago`;
|
|
10
|
+
}
|
|
11
|
+
function shortTraceId(traceId) {
|
|
12
|
+
return traceId.slice(-6);
|
|
13
|
+
}
|
|
14
|
+
function formatCost(usd) {
|
|
15
|
+
if (usd === void 0 || usd === null || Number.isNaN(usd)) return "\u2014";
|
|
16
|
+
if (usd === 0) return "$0.0000";
|
|
17
|
+
if (usd < 0.01) return `$${usd.toFixed(4)}`;
|
|
18
|
+
return `$${usd.toFixed(3)}`;
|
|
19
|
+
}
|
|
20
|
+
function formatMs(ms) {
|
|
21
|
+
if (ms === void 0 || ms === null) return "\u2014";
|
|
22
|
+
if (ms < 1e3) return `${ms}ms`;
|
|
23
|
+
return `${(ms / 1e3).toFixed(1)}s`;
|
|
24
|
+
}
|
|
25
|
+
function formatOrDash(v) {
|
|
26
|
+
if (v === void 0 || v === null) return "\u2014";
|
|
27
|
+
if (typeof v === "number") return v.toLocaleString();
|
|
28
|
+
return v;
|
|
29
|
+
}
|
|
30
|
+
function inputRatioLabel(status) {
|
|
31
|
+
switch (status) {
|
|
32
|
+
case "green":
|
|
33
|
+
return "healthy";
|
|
34
|
+
case "yellow":
|
|
35
|
+
return "borderline";
|
|
36
|
+
case "red":
|
|
37
|
+
return "input-heavy";
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function formatMutation(mutation) {
|
|
41
|
+
const m = /^(.*)-(\d+)-to-(\d+)$/.exec(mutation);
|
|
42
|
+
if (m) {
|
|
43
|
+
return `${m[1]} (${m[2]} \u2192 ${m[3]})`;
|
|
44
|
+
}
|
|
45
|
+
return mutation;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
formatAgo,
|
|
50
|
+
shortTraceId,
|
|
51
|
+
formatCost,
|
|
52
|
+
formatMs,
|
|
53
|
+
formatOrDash,
|
|
54
|
+
inputRatioLabel,
|
|
55
|
+
formatMutation
|
|
56
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
appChannel,
|
|
3
|
+
getPubSub,
|
|
4
|
+
traceChannel
|
|
5
|
+
} from "./chunk-NBO4R5PC.mjs";
|
|
6
|
+
|
|
7
|
+
// src/glassbox/subscribe.ts
|
|
8
|
+
function emptyStream() {
|
|
9
|
+
return new ReadableStream({
|
|
10
|
+
start(controller) {
|
|
11
|
+
controller.close();
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function subscribe(traceId) {
|
|
16
|
+
if (!traceId) return emptyStream();
|
|
17
|
+
return getPubSub().subscribe(traceChannel(traceId));
|
|
18
|
+
}
|
|
19
|
+
function subscribeApp({
|
|
20
|
+
appId
|
|
21
|
+
}) {
|
|
22
|
+
if (!appId) return emptyStream();
|
|
23
|
+
return getPubSub().subscribe(appChannel(appId));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
subscribe,
|
|
28
|
+
subscribeApp
|
|
29
|
+
};
|