@bluelibs/runner-dev 5.1.0 → 6.0.0
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/AI.md +80 -6
- package/README.md +216 -22
- package/dist/cli/generators/scaffold/templates/package.json.d.ts +2 -2
- package/dist/cli/generators/scaffold/templates/package.json.js +2 -2
- package/dist/cli/generators/scaffold.js +1 -135
- package/dist/cli/generators/scaffold.js.map +1 -1
- package/dist/cli/generators/templates.js +2 -1
- package/dist/cli/generators/templates.js.map +1 -1
- package/dist/generated/resolvers-types.d.ts +545 -112
- package/dist/index.d.ts +39 -39
- package/dist/resources/cli.config.resource.d.ts +1 -1
- package/dist/resources/cli.config.resource.js +2 -2
- package/dist/resources/cli.config.resource.js.map +1 -1
- package/dist/resources/coverage.resource.d.ts +2 -2
- package/dist/resources/coverage.resource.js +3 -3
- package/dist/resources/coverage.resource.js.map +1 -1
- package/dist/resources/dev.resource.d.ts +1 -1
- package/dist/resources/dev.resource.js +2 -2
- package/dist/resources/dev.resource.js.map +1 -1
- package/dist/resources/docs.generator.resource.d.ts +4 -3
- package/dist/resources/docs.generator.resource.js +2 -2
- package/dist/resources/docs.generator.resource.js.map +1 -1
- package/dist/resources/graphql-accumulator.resource.d.ts +2 -2
- package/dist/resources/graphql-accumulator.resource.js +7 -3
- package/dist/resources/graphql-accumulator.resource.js.map +1 -1
- package/dist/resources/graphql.cli.resource.d.ts +1 -1
- package/dist/resources/graphql.cli.resource.js +2 -2
- package/dist/resources/graphql.cli.resource.js.map +1 -1
- package/dist/resources/graphql.query.cli.task.d.ts +14 -16
- package/dist/resources/graphql.query.cli.task.js +3 -3
- package/dist/resources/graphql.query.cli.task.js.map +1 -1
- package/dist/resources/graphql.query.task.d.ts +18 -18
- package/dist/resources/graphql.query.task.js +4 -4
- package/dist/resources/graphql.query.task.js.map +1 -1
- package/dist/resources/http.tag.d.ts +1 -1
- package/dist/resources/http.tag.js +2 -2
- package/dist/resources/http.tag.js.map +1 -1
- package/dist/resources/introspector.cli.resource.d.ts +2 -2
- package/dist/resources/introspector.cli.resource.js +37 -3
- package/dist/resources/introspector.cli.resource.js.map +1 -1
- package/dist/resources/introspector.resource.d.ts +3 -2
- package/dist/resources/introspector.resource.js +6 -6
- package/dist/resources/introspector.resource.js.map +1 -1
- package/dist/resources/live.resource.d.ts +7 -6
- package/dist/resources/live.resource.js +64 -25
- package/dist/resources/live.resource.js.map +1 -1
- package/dist/resources/models/Introspector.d.ts +59 -15
- package/dist/resources/models/Introspector.js +467 -137
- package/dist/resources/models/Introspector.js.map +1 -1
- package/dist/resources/models/durable.runtime.d.ts +1 -1
- package/dist/resources/models/durable.runtime.js +53 -2
- package/dist/resources/models/durable.runtime.js.map +1 -1
- package/dist/resources/models/durable.tools.d.ts +1 -1
- package/dist/resources/models/durable.tools.js +6 -3
- package/dist/resources/models/durable.tools.js.map +1 -1
- package/dist/resources/models/initializeFromStore.js +126 -19
- package/dist/resources/models/initializeFromStore.js.map +1 -1
- package/dist/resources/models/initializeFromStore.utils.d.ts +12 -7
- package/dist/resources/models/initializeFromStore.utils.js +319 -23
- package/dist/resources/models/initializeFromStore.utils.js.map +1 -1
- package/dist/resources/models/introspector.tools.js +18 -6
- package/dist/resources/models/introspector.tools.js.map +1 -1
- package/dist/resources/routeHandlers/createLiveStreamHandler.d.ts +16 -0
- package/dist/resources/routeHandlers/createLiveStreamHandler.js +127 -0
- package/dist/resources/routeHandlers/createLiveStreamHandler.js.map +1 -0
- package/dist/resources/routeHandlers/getDocsData.d.ts +4 -0
- package/dist/resources/routeHandlers/getDocsData.js +28 -0
- package/dist/resources/routeHandlers/getDocsData.js.map +1 -1
- package/dist/resources/routeHandlers/registerHttpRoutes.hook.d.ts +26 -23
- package/dist/resources/routeHandlers/registerHttpRoutes.hook.js +10 -9
- package/dist/resources/routeHandlers/registerHttpRoutes.hook.js.map +1 -1
- package/dist/resources/routeHandlers/requestCorrelation.d.ts +11 -0
- package/dist/resources/routeHandlers/requestCorrelation.js +29 -0
- package/dist/resources/routeHandlers/requestCorrelation.js.map +1 -0
- package/dist/resources/server.resource.d.ts +20 -20
- package/dist/resources/server.resource.js +17 -5
- package/dist/resources/server.resource.js.map +1 -1
- package/dist/resources/swap.cli.resource.d.ts +4 -4
- package/dist/resources/swap.cli.resource.js +2 -2
- package/dist/resources/swap.cli.resource.js.map +1 -1
- package/dist/resources/swap.resource.d.ts +7 -6
- package/dist/resources/swap.resource.js +188 -38
- package/dist/resources/swap.resource.js.map +1 -1
- package/dist/resources/swap.tools.d.ts +3 -2
- package/dist/resources/swap.tools.js +27 -27
- package/dist/resources/swap.tools.js.map +1 -1
- package/dist/resources/telemetry.resource.d.ts +1 -1
- package/dist/resources/telemetry.resource.js +46 -43
- package/dist/resources/telemetry.resource.js.map +1 -1
- package/dist/runner-compat.d.ts +85 -0
- package/dist/runner-compat.js +178 -0
- package/dist/runner-compat.js.map +1 -0
- package/dist/runner-node-compat.d.ts +2 -0
- package/dist/runner-node-compat.js +28 -0
- package/dist/runner-node-compat.js.map +1 -0
- package/dist/schema/index.js +8 -8
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/model.d.ts +100 -20
- package/dist/schema/model.js.map +1 -1
- package/dist/schema/query.js +25 -1
- package/dist/schema/query.js.map +1 -1
- package/dist/schema/types/AllType.js +13 -2
- package/dist/schema/types/AllType.js.map +1 -1
- package/dist/schema/types/BaseElementCommon.js +10 -0
- package/dist/schema/types/BaseElementCommon.js.map +1 -1
- package/dist/schema/types/ErrorType.js +1 -1
- package/dist/schema/types/ErrorType.js.map +1 -1
- package/dist/schema/types/EventType.js +19 -2
- package/dist/schema/types/EventType.js.map +1 -1
- package/dist/schema/types/InterceptorOwnersType.d.ts +2 -0
- package/dist/schema/types/InterceptorOwnersType.js +63 -0
- package/dist/schema/types/InterceptorOwnersType.js.map +1 -0
- package/dist/schema/types/LaneSummaryTypes.d.ts +3 -0
- package/dist/schema/types/LaneSummaryTypes.js +19 -0
- package/dist/schema/types/LaneSummaryTypes.js.map +1 -0
- package/dist/schema/types/LiveType.js +81 -76
- package/dist/schema/types/LiveType.js.map +1 -1
- package/dist/schema/types/ResourceType.js +101 -15
- package/dist/schema/types/ResourceType.js.map +1 -1
- package/dist/schema/types/RunOptionsType.d.ts +2 -0
- package/dist/schema/types/RunOptionsType.js +107 -0
- package/dist/schema/types/RunOptionsType.js.map +1 -0
- package/dist/schema/types/TagType.js +35 -4
- package/dist/schema/types/TagType.js.map +1 -1
- package/dist/schema/types/TaskType.js +20 -0
- package/dist/schema/types/TaskType.js.map +1 -1
- package/dist/schema/types/index.d.ts +4 -2
- package/dist/schema/types/index.js +10 -7
- package/dist/schema/types/index.js.map +1 -1
- package/dist/schema/types/middleware/common.d.ts +3 -2
- package/dist/schema/types/middleware/common.js +19 -13
- package/dist/schema/types/middleware/common.js.map +1 -1
- package/dist/ui/.vite/manifest.json +2 -2
- package/dist/ui/assets/docs-Btkv97Ls.js +302 -0
- package/dist/ui/assets/docs-Btkv97Ls.js.map +1 -0
- package/dist/ui/assets/docs-CipvKUxZ.css +1 -0
- package/dist/utils/healthCollectors.d.ts +37 -0
- package/dist/utils/healthCollectors.js +147 -0
- package/dist/utils/healthCollectors.js.map +1 -0
- package/dist/utils/lane-resources.d.ts +55 -0
- package/dist/utils/lane-resources.js +143 -0
- package/dist/utils/lane-resources.js.map +1 -0
- package/dist/utils/zod.js +36 -3
- package/dist/utils/zod.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -6
- package/readmes/runner-AI.md +740 -0
- package/readmes/runner-durable-workflows.md +2247 -0
- package/readmes/runner-full-guide.md +5869 -0
- package/readmes/runner-remote-lanes.md +909 -0
- package/dist/ui/assets/docs-B_-zFz4-.css +0 -1
- package/dist/ui/assets/docs-Be-GHfZi.js +0 -353
- package/dist/ui/assets/docs-Be-GHfZi.js.map +0 -1
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.gcTotalDurationMs = exports.gcTotalCollections = void 0;
|
|
27
|
+
exports.getEventLoopMeanNs = getEventLoopMeanNs;
|
|
28
|
+
exports.resetEventLoopHistogram = resetEventLoopHistogram;
|
|
29
|
+
exports.getGcWindow = getGcWindow;
|
|
30
|
+
exports.getCpuEluUtilization = getCpuEluUtilization;
|
|
31
|
+
exports.getHealthSnapshot = getHealthSnapshot;
|
|
32
|
+
exports.latestTimestamp = latestTimestamp;
|
|
33
|
+
/**
|
|
34
|
+
* Shared system health collectors used by both the GraphQL live resolvers
|
|
35
|
+
* and the SSE stream handler. Centralises event‐loop delay, GC tracking,
|
|
36
|
+
* and CPU ELU measurement so only one set of observers exists per process.
|
|
37
|
+
*/
|
|
38
|
+
const os = __importStar(require("node:os"));
|
|
39
|
+
const node_perf_hooks_1 = require("node:perf_hooks");
|
|
40
|
+
// ---------------------------------------------------------------------------
|
|
41
|
+
// Event‐loop delay histogram
|
|
42
|
+
// ---------------------------------------------------------------------------
|
|
43
|
+
let histogram;
|
|
44
|
+
try {
|
|
45
|
+
histogram = (0, node_perf_hooks_1.monitorEventLoopDelay)({ resolution: 10 });
|
|
46
|
+
histogram.enable();
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
// Unsupported runtime (e.g. older Node or non‐Node)
|
|
50
|
+
}
|
|
51
|
+
/** Mean event‐loop delay in nanoseconds. */
|
|
52
|
+
function getEventLoopMeanNs() {
|
|
53
|
+
return histogram?.mean ?? 0;
|
|
54
|
+
}
|
|
55
|
+
/** Reset the event‐loop delay histogram (for the optional `reset` arg). */
|
|
56
|
+
function resetEventLoopHistogram() {
|
|
57
|
+
try {
|
|
58
|
+
histogram?.reset();
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
// ignore
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// ---------------------------------------------------------------------------
|
|
65
|
+
// GC tracking — both lifetime totals and a windowed ring buffer
|
|
66
|
+
// ---------------------------------------------------------------------------
|
|
67
|
+
/** Total GC collections observed since process start. */
|
|
68
|
+
exports.gcTotalCollections = 0;
|
|
69
|
+
/** Total GC pause duration (ms) since process start. */
|
|
70
|
+
exports.gcTotalDurationMs = 0;
|
|
71
|
+
const gcEvents = [];
|
|
72
|
+
const GC_EVENTS_MAX = 10_000;
|
|
73
|
+
function pushGcEvent(duration) {
|
|
74
|
+
gcEvents.push({ ts: Date.now(), duration });
|
|
75
|
+
if (gcEvents.length > GC_EVENTS_MAX) {
|
|
76
|
+
gcEvents.splice(0, Math.floor(GC_EVENTS_MAX * 0.1));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
try {
|
|
80
|
+
const obs = new node_perf_hooks_1.PerformanceObserver((list) => {
|
|
81
|
+
for (const entry of list.getEntries()) {
|
|
82
|
+
exports.gcTotalCollections += 1;
|
|
83
|
+
exports.gcTotalDurationMs += entry.duration;
|
|
84
|
+
pushGcEvent(entry.duration);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
obs.observe({ entryTypes: ["gc"], buffered: true });
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
// noop — GC observation not available
|
|
91
|
+
}
|
|
92
|
+
/** Return GC stats within a sliding time window. */
|
|
93
|
+
function getGcWindow(windowMs) {
|
|
94
|
+
const since = Date.now() - windowMs;
|
|
95
|
+
let collections = 0;
|
|
96
|
+
let duration = 0;
|
|
97
|
+
for (let i = gcEvents.length - 1; i >= 0; i--) {
|
|
98
|
+
if (gcEvents[i].ts < since)
|
|
99
|
+
break;
|
|
100
|
+
collections += 1;
|
|
101
|
+
duration += gcEvents[i].duration;
|
|
102
|
+
}
|
|
103
|
+
return { collections, duration };
|
|
104
|
+
}
|
|
105
|
+
// ---------------------------------------------------------------------------
|
|
106
|
+
// CPU utilisation via Event Loop Utilisation (ELU)
|
|
107
|
+
// ---------------------------------------------------------------------------
|
|
108
|
+
let prevElu;
|
|
109
|
+
function getCpuEluUtilization() {
|
|
110
|
+
try {
|
|
111
|
+
const current = prevElu
|
|
112
|
+
? node_perf_hooks_1.performance.eventLoopUtilization(prevElu)
|
|
113
|
+
: node_perf_hooks_1.performance.eventLoopUtilization();
|
|
114
|
+
prevElu = current;
|
|
115
|
+
return Number.isFinite(current.utilization) ? current.utilization : 0;
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
return 0;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function getHealthSnapshot(gcWindowMs = 30_000) {
|
|
122
|
+
const m = process.memoryUsage();
|
|
123
|
+
const meanNs = getEventLoopMeanNs();
|
|
124
|
+
const gc = getGcWindow(gcWindowMs);
|
|
125
|
+
return {
|
|
126
|
+
memory: { heapUsed: m.heapUsed, heapTotal: m.heapTotal, rss: m.rss },
|
|
127
|
+
cpu: { usage: getCpuEluUtilization(), loadAverage: os.loadavg()[0] ?? 0 },
|
|
128
|
+
eventLoop: { lag: Number.isFinite(meanNs) ? meanNs / 1e6 : 0 },
|
|
129
|
+
gc,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
// ---------------------------------------------------------------------------
|
|
133
|
+
// Timestamp helpers
|
|
134
|
+
// ---------------------------------------------------------------------------
|
|
135
|
+
/** Extract the latest `timestampMs` from one or more arrays of timestamped entries. */
|
|
136
|
+
function latestTimestamp(...arrays) {
|
|
137
|
+
let max;
|
|
138
|
+
for (const arr of arrays) {
|
|
139
|
+
for (const entry of arr) {
|
|
140
|
+
if (max === undefined || entry.timestampMs > max) {
|
|
141
|
+
max = entry.timestampMs;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return max;
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=healthCollectors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"healthCollectors.js","sourceRoot":"","sources":["../../src/utils/healthCollectors.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,gDAEC;AAGD,0DAMC;AAmCD,kCAaC;AAQD,oDAUC;AAaD,8CAWC;AAOD,0CAYC;AAnJD;;;;GAIG;AACH,4CAA8B;AAC9B,qDAMyB;AAEzB,8EAA8E;AAC9E,6BAA6B;AAC7B,8EAA8E;AAE9E,IAAI,SAAwC,CAAC;AAC7C,IAAI,CAAC;IACH,SAAS,GAAG,IAAA,uCAAqB,EAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC;IACtD,SAAS,CAAC,MAAM,EAAE,CAAC;AACrB,CAAC;AAAC,MAAM,CAAC;IACP,oDAAoD;AACtD,CAAC;AAED,4CAA4C;AAC5C,SAAgB,kBAAkB;IAChC,OAAO,S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;QACL,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE;QACpE,GAAG,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAAE,WAAW,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE;QACzE,SAAS,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;QAC9D,EAAE;KACH,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E,uFAAuF;AACvF,SAAgB,eAAe,CAC7B,GAAG,MAAwC;IAE3C,IAAI,GAAuB,CAAC;IAC5B,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,KAAK,MAAM,KAAK,IAAI,GAAG,EAAE,CAAC;YACxB,IAAI,GAAG,KAAK,SAAS,IAAI,KAAK,CAAC,WAAW,GAAG,GAAG,EAAE,CAAC;gBACjD,GAAG,GAAG,KAAK,CAAC,WAAW,CAAC;YAC1B,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export declare const EVENT_LANE_TAG_ID = "runner.tags.eventLane";
|
|
2
|
+
export declare const RPC_LANE_TAG_ID = "runner.tags.rpcLane";
|
|
3
|
+
export declare const EVENT_LANES_RESOURCE_ID = "runner.node.eventLanes";
|
|
4
|
+
export declare const EVENT_LANES_RESOURCE_TAG_ID = "runner.tags.eventLanes";
|
|
5
|
+
export declare const RPC_LANES_RESOURCE_ID = "platform.node.resources.rpcLanes";
|
|
6
|
+
export declare const RPC_LANES_RESOURCE_TAG_ID = "runner.tags.rpcLanes";
|
|
7
|
+
type TagIds = string[] | null | undefined;
|
|
8
|
+
export type LaneResourceLike = {
|
|
9
|
+
id: string;
|
|
10
|
+
tags?: TagIds;
|
|
11
|
+
};
|
|
12
|
+
export type RpcLaneLike = {
|
|
13
|
+
id?: unknown;
|
|
14
|
+
} | string;
|
|
15
|
+
export type RpcCommunicatorLike = {
|
|
16
|
+
id?: unknown;
|
|
17
|
+
} | string;
|
|
18
|
+
export type RpcLanesResourceConfigShape = {
|
|
19
|
+
mode?: string;
|
|
20
|
+
profile?: string;
|
|
21
|
+
communicator?: RpcCommunicatorLike;
|
|
22
|
+
communicators?: RpcCommunicatorLike[];
|
|
23
|
+
topology?: {
|
|
24
|
+
bindings?: Array<{
|
|
25
|
+
lane?: RpcLaneLike;
|
|
26
|
+
communicator?: RpcCommunicatorLike;
|
|
27
|
+
communicatorId?: string;
|
|
28
|
+
}>;
|
|
29
|
+
profiles?: Record<string, {
|
|
30
|
+
serve?: RpcLaneLike[];
|
|
31
|
+
communicator?: RpcCommunicatorLike;
|
|
32
|
+
communicatorId?: string;
|
|
33
|
+
}>;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export type RpcLaneBindingSummary = {
|
|
37
|
+
laneId: string;
|
|
38
|
+
communicatorId: string | null;
|
|
39
|
+
};
|
|
40
|
+
export type RpcLaneProfileSummary = {
|
|
41
|
+
profileId: string;
|
|
42
|
+
serveLaneIds: string[];
|
|
43
|
+
communicatorId: string | null;
|
|
44
|
+
};
|
|
45
|
+
export declare function isEventLanesResource(resource: LaneResourceLike): boolean;
|
|
46
|
+
export declare function isRpcLanesResource(resource: LaneResourceLike): boolean;
|
|
47
|
+
export declare function parseRpcLanesResourceConfig(resourceConfig: string | null | undefined): RpcLanesResourceConfigShape | null;
|
|
48
|
+
export declare function extractLaneId(laneLike: unknown): string | null;
|
|
49
|
+
export declare function extractCommunicatorId(communicatorLike: unknown): string | null;
|
|
50
|
+
export declare function collectRpcLaneIds(config: RpcLanesResourceConfigShape | null | undefined): Set<string>;
|
|
51
|
+
export declare function collectRpcLaneIdsFromResourceConfig(resourceConfig: string | null | undefined): Set<string>;
|
|
52
|
+
export declare function getRpcLaneBindings(config: RpcLanesResourceConfigShape | null | undefined): RpcLaneBindingSummary[];
|
|
53
|
+
export declare function getRpcLaneProfiles(config: RpcLanesResourceConfigShape | null | undefined): RpcLaneProfileSummary[];
|
|
54
|
+
export declare function collectRpcCommunicatorIds(config: RpcLanesResourceConfigShape | null | undefined, bindings?: RpcLaneBindingSummary[], profiles?: RpcLaneProfileSummary[]): string[];
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RPC_LANES_RESOURCE_TAG_ID = exports.RPC_LANES_RESOURCE_ID = exports.EVENT_LANES_RESOURCE_TAG_ID = exports.EVENT_LANES_RESOURCE_ID = exports.RPC_LANE_TAG_ID = exports.EVENT_LANE_TAG_ID = void 0;
|
|
4
|
+
exports.isEventLanesResource = isEventLanesResource;
|
|
5
|
+
exports.isRpcLanesResource = isRpcLanesResource;
|
|
6
|
+
exports.parseRpcLanesResourceConfig = parseRpcLanesResourceConfig;
|
|
7
|
+
exports.extractLaneId = extractLaneId;
|
|
8
|
+
exports.extractCommunicatorId = extractCommunicatorId;
|
|
9
|
+
exports.collectRpcLaneIds = collectRpcLaneIds;
|
|
10
|
+
exports.collectRpcLaneIdsFromResourceConfig = collectRpcLaneIdsFromResourceConfig;
|
|
11
|
+
exports.getRpcLaneBindings = getRpcLaneBindings;
|
|
12
|
+
exports.getRpcLaneProfiles = getRpcLaneProfiles;
|
|
13
|
+
exports.collectRpcCommunicatorIds = collectRpcCommunicatorIds;
|
|
14
|
+
exports.EVENT_LANE_TAG_ID = "runner.tags.eventLane";
|
|
15
|
+
exports.RPC_LANE_TAG_ID = "runner.tags.rpcLane";
|
|
16
|
+
exports.EVENT_LANES_RESOURCE_ID = "runner.node.eventLanes";
|
|
17
|
+
exports.EVENT_LANES_RESOURCE_TAG_ID = "runner.tags.eventLanes";
|
|
18
|
+
exports.RPC_LANES_RESOURCE_ID = "platform.node.resources.rpcLanes";
|
|
19
|
+
exports.RPC_LANES_RESOURCE_TAG_ID = "runner.tags.rpcLanes";
|
|
20
|
+
function hasTag(tags, tagId) {
|
|
21
|
+
if (!Array.isArray(tags))
|
|
22
|
+
return false;
|
|
23
|
+
return tags.some((candidate) => candidate === tagId);
|
|
24
|
+
}
|
|
25
|
+
function isEventLanesResource(resource) {
|
|
26
|
+
return (resource.id === exports.EVENT_LANES_RESOURCE_ID ||
|
|
27
|
+
hasTag(resource.tags, exports.EVENT_LANES_RESOURCE_TAG_ID));
|
|
28
|
+
}
|
|
29
|
+
function isRpcLanesResource(resource) {
|
|
30
|
+
return (resource.id === exports.RPC_LANES_RESOURCE_ID ||
|
|
31
|
+
hasTag(resource.tags, exports.RPC_LANES_RESOURCE_TAG_ID));
|
|
32
|
+
}
|
|
33
|
+
function parseRpcLanesResourceConfig(resourceConfig) {
|
|
34
|
+
if (!resourceConfig)
|
|
35
|
+
return null;
|
|
36
|
+
try {
|
|
37
|
+
return JSON.parse(resourceConfig);
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function extractLaneId(laneLike) {
|
|
44
|
+
if (typeof laneLike === "string") {
|
|
45
|
+
const laneId = laneLike.trim();
|
|
46
|
+
return laneId.length > 0 ? laneId : null;
|
|
47
|
+
}
|
|
48
|
+
if (!laneLike || typeof laneLike !== "object")
|
|
49
|
+
return null;
|
|
50
|
+
const candidateId = laneLike.id;
|
|
51
|
+
if (typeof candidateId !== "string")
|
|
52
|
+
return null;
|
|
53
|
+
const laneId = candidateId.trim();
|
|
54
|
+
return laneId.length > 0 ? laneId : null;
|
|
55
|
+
}
|
|
56
|
+
function extractCommunicatorId(communicatorLike) {
|
|
57
|
+
if (typeof communicatorLike === "string") {
|
|
58
|
+
const communicatorId = communicatorLike.trim();
|
|
59
|
+
return communicatorId.length > 0 ? communicatorId : null;
|
|
60
|
+
}
|
|
61
|
+
if (!communicatorLike || typeof communicatorLike !== "object")
|
|
62
|
+
return null;
|
|
63
|
+
const candidateId = communicatorLike.id;
|
|
64
|
+
if (typeof candidateId !== "string")
|
|
65
|
+
return null;
|
|
66
|
+
const communicatorId = candidateId.trim();
|
|
67
|
+
return communicatorId.length > 0 ? communicatorId : null;
|
|
68
|
+
}
|
|
69
|
+
function collectRpcLaneIds(config) {
|
|
70
|
+
const laneIds = new Set();
|
|
71
|
+
if (!config)
|
|
72
|
+
return laneIds;
|
|
73
|
+
const bindings = config.topology?.bindings;
|
|
74
|
+
if (Array.isArray(bindings)) {
|
|
75
|
+
for (const binding of bindings) {
|
|
76
|
+
const laneId = extractLaneId(binding?.lane);
|
|
77
|
+
if (laneId)
|
|
78
|
+
laneIds.add(laneId);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const profiles = config.topology?.profiles;
|
|
82
|
+
if (profiles && typeof profiles === "object") {
|
|
83
|
+
for (const profile of Object.values(profiles)) {
|
|
84
|
+
const servedLanes = profile?.serve;
|
|
85
|
+
if (!Array.isArray(servedLanes))
|
|
86
|
+
continue;
|
|
87
|
+
for (const servedLane of servedLanes) {
|
|
88
|
+
const laneId = extractLaneId(servedLane);
|
|
89
|
+
if (laneId)
|
|
90
|
+
laneIds.add(laneId);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return laneIds;
|
|
95
|
+
}
|
|
96
|
+
function collectRpcLaneIdsFromResourceConfig(resourceConfig) {
|
|
97
|
+
const config = parseRpcLanesResourceConfig(resourceConfig);
|
|
98
|
+
return collectRpcLaneIds(config);
|
|
99
|
+
}
|
|
100
|
+
function getRpcLaneBindings(config) {
|
|
101
|
+
const bindings = config?.topology?.bindings;
|
|
102
|
+
if (!Array.isArray(bindings))
|
|
103
|
+
return [];
|
|
104
|
+
return bindings.map((binding) => ({
|
|
105
|
+
laneId: extractLaneId(binding?.lane) ?? "unknown",
|
|
106
|
+
communicatorId: binding?.communicatorId ?? extractCommunicatorId(binding?.communicator),
|
|
107
|
+
}));
|
|
108
|
+
}
|
|
109
|
+
function getRpcLaneProfiles(config) {
|
|
110
|
+
const rawProfiles = config?.topology?.profiles;
|
|
111
|
+
if (!rawProfiles || typeof rawProfiles !== "object")
|
|
112
|
+
return [];
|
|
113
|
+
return Object.entries(rawProfiles).map(([profileId, profile]) => ({
|
|
114
|
+
profileId,
|
|
115
|
+
serveLaneIds: Array.isArray(profile?.serve)
|
|
116
|
+
? profile.serve.map((lane) => extractLaneId(lane) ?? "unknown")
|
|
117
|
+
: [],
|
|
118
|
+
communicatorId: profile?.communicatorId ?? extractCommunicatorId(profile?.communicator),
|
|
119
|
+
}));
|
|
120
|
+
}
|
|
121
|
+
function collectRpcCommunicatorIds(config, bindings = getRpcLaneBindings(config), profiles = getRpcLaneProfiles(config)) {
|
|
122
|
+
const communicatorIds = new Set();
|
|
123
|
+
const topLevelCommunicator = extractCommunicatorId(config?.communicator);
|
|
124
|
+
if (topLevelCommunicator)
|
|
125
|
+
communicatorIds.add(topLevelCommunicator);
|
|
126
|
+
if (Array.isArray(config?.communicators)) {
|
|
127
|
+
for (const communicator of config.communicators) {
|
|
128
|
+
const communicatorId = extractCommunicatorId(communicator);
|
|
129
|
+
if (communicatorId)
|
|
130
|
+
communicatorIds.add(communicatorId);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
for (const binding of bindings) {
|
|
134
|
+
if (binding.communicatorId)
|
|
135
|
+
communicatorIds.add(binding.communicatorId);
|
|
136
|
+
}
|
|
137
|
+
for (const profile of profiles) {
|
|
138
|
+
if (profile.communicatorId)
|
|
139
|
+
communicatorIds.add(profile.communicatorId);
|
|
140
|
+
}
|
|
141
|
+
return Array.from(communicatorIds);
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=lane-resources.js.map
|
|
@@ -0,0 +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AM,oBAAoB,GAAG,qBAAqB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACzE,IAAI,oBAAoB;QAAE,eAAe,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAEpE,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,aAAa,CAAC,EAAE,CAAC;QACzC,KAAK,MAAM,YAAY,IAAI,MAAM,CAAC,aAAa,EAAE,CAAC;YAChD,MAAM,cAAc,GAAG,qBAAqB,CAAC,YAAY,CAAC,CAAC;YAC3D,IAAI,cAAc;gBAAE,eAAe,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;IAED,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,IAAI,OAAO,CAAC,cAAc;YAAE,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IAC1E,CAAC;IAED,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,IAAI,OAAO,CAAC,cAAc;YAAE,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IAC1E,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AACrC,CAAC"}
|
package/dist/utils/zod.js
CHANGED
|
@@ -17,6 +17,32 @@ function isZodSchema(value) {
|
|
|
17
17
|
function isZ4(schema) {
|
|
18
18
|
return "transformAsync" in schema;
|
|
19
19
|
}
|
|
20
|
+
function hasToJSONSchema(value) {
|
|
21
|
+
return (typeof value === "object" &&
|
|
22
|
+
value !== null &&
|
|
23
|
+
typeof value.toJSONSchema === "function");
|
|
24
|
+
}
|
|
25
|
+
function isPromiseLike(value) {
|
|
26
|
+
return (typeof value === "object" &&
|
|
27
|
+
value !== null &&
|
|
28
|
+
typeof value.then === "function");
|
|
29
|
+
}
|
|
30
|
+
function stringifyJsonSchema(value) {
|
|
31
|
+
const stringified = JSON.stringify(value, null, 2);
|
|
32
|
+
return typeof stringified === "string" ? stringified : null;
|
|
33
|
+
}
|
|
34
|
+
function formatSchemaFromToJSONSchema(schema) {
|
|
35
|
+
try {
|
|
36
|
+
const jsonSchema = schema.toJSONSchema();
|
|
37
|
+
if (isPromiseLike(jsonSchema)) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
return stringifyJsonSchema(jsonSchema);
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
20
46
|
function formatZodSchemaNicely(schema) {
|
|
21
47
|
try {
|
|
22
48
|
const jsonSchema = isZ4(schema)
|
|
@@ -31,12 +57,19 @@ function formatZodSchemaNicely(schema) {
|
|
|
31
57
|
}
|
|
32
58
|
function formatSchemaIfZod(value) {
|
|
33
59
|
try {
|
|
60
|
+
if (hasToJSONSchema(value)) {
|
|
61
|
+
const formatted = formatSchemaFromToJSONSchema(value);
|
|
62
|
+
if (formatted) {
|
|
63
|
+
return formatted;
|
|
64
|
+
}
|
|
65
|
+
// Had toJSONSchema but it failed/returned async — use generic fallback
|
|
66
|
+
return '{ "type": "object" }';
|
|
67
|
+
}
|
|
34
68
|
if (isZodSchema(value)) {
|
|
35
69
|
return formatZodSchemaNicely(value);
|
|
36
70
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
71
|
+
// Not a recognized schema format — return null instead of a misleading fallback
|
|
72
|
+
return null;
|
|
40
73
|
}
|
|
41
74
|
catch {
|
|
42
75
|
// ignore
|
package/dist/utils/zod.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zod.js","sourceRoot":"","sources":["../../src/utils/zod.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"zod.js","sourceRoot":"","sources":["../../src/utils/zod.ts"],"names":[],"mappings":";;AAWA,kCAOC;AA2CD,sDAWC;AAED,8CAqBC;AAED,kEAMC;AAtGD,+BAAiC;AACjC,2DAAqD;AAC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AAI,CAAC,MAAM,CAAC;YAC7B,CAAC,CAAC,MAAE,CAAC,YAAY,CAAC,MAAa,CAAC;YAChC,CAAC,CAAC,IAAA,oCAAe,EAAC,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;QAEhD,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC7C,CAAC;IAAC,MAAM,CAAC;QACP,6BAA6B;QAC7B,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC;AACH,CAAC;AAED,SAAgB,iBAAiB,CAAC,KAAc;IAC9C,IAAI,CAAC;QACH,IAAI,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;YAC3B,MAAM,SAAS,GAAG,4BAA4B,CAAC,KAAK,CAAC,CAAC;YACtD,IAAI,SAAS,EAAE,CAAC;gBACd,OAAO,SAAS,CAAC;YACnB,CAAC;YACD,uEAAuE;YACvE,OAAO,sBAAsB,CAAC;QAChC,CAAC;QAED,IAAI,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;YACvB,OAAO,qBAAqB,CAAC,KAAK,CAAC,CAAC;QACtC,CAAC;QAED,gFAAgF;QAChF,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,SAAS;IACX,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAEM,KAAK,UAAU,2BAA2B,CAC/C,gBAA2C;IAE3C,IAAI,CAAC,gBAAgB;QAAE,OAAO,IAAI,CAAC;IAEnC,OAAO,IAAA,kDAAwB,EAAC,gBAAgB,CAAC,CAAC;AACpD,CAAC"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const v = "
|
|
1
|
+
declare const v = "6.0.0";
|
|
2
2
|
export default v;
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bluelibs/runner-dev",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "BlueLibs Runner DevTools",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"clean": "rm -rf dist",
|
|
14
14
|
"cli": "ts-node --project config/ts/tsconfig.json src/cli.ts",
|
|
15
15
|
"start": "node dist/main.js",
|
|
16
|
-
"dev": "
|
|
16
|
+
"dev": "ts-node-dev --project config/ts/tsconfig.json --respawn --transpile-only --watch src --watch scripts src/main.ts",
|
|
17
17
|
"build:ui": "cd src/ui && vite build",
|
|
18
18
|
"dev:ui": "cd src/ui && vite",
|
|
19
19
|
"preview:ui": "cd src/ui && vite preview --port 5173",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"demo:ping": "ENDPOINT=http://localhost:31337/graphql node dist/cli.js ping",
|
|
39
39
|
"demo:query": "ENDPOINT=http://localhost:31337/graphql node dist/cli.js query 'query { tasks { id } }' --format pretty",
|
|
40
40
|
"demo:overview": "ENDPOINT=http://localhost:31337/graphql node dist/cli.js overview --details 5",
|
|
41
|
-
"
|
|
41
|
+
"sync:docs": "ts-node --project config/ts/tsconfig.json scripts/sync-docs.ts"
|
|
42
42
|
},
|
|
43
43
|
"bin": {
|
|
44
44
|
"runner-dev": "dist/cli.js"
|
|
@@ -104,6 +104,7 @@
|
|
|
104
104
|
"@adobe/jsonschema2md": "^8.0.5",
|
|
105
105
|
"@apollo/server": "^5.0.0",
|
|
106
106
|
"@as-integrations/express5": "^1.1.2",
|
|
107
|
+
"@bluelibs/runner": "^6.0.0",
|
|
107
108
|
"@bluelibs/smart": "^2.2.1",
|
|
108
109
|
"@modelcontextprotocol/sdk": "^1.17.2",
|
|
109
110
|
"@types/prismjs": "^1.26.5",
|
|
@@ -117,9 +118,6 @@
|
|
|
117
118
|
"zod": "3.25.76",
|
|
118
119
|
"zod-to-json-schema": "^3.24.6"
|
|
119
120
|
},
|
|
120
|
-
"peerDependencies": {
|
|
121
|
-
"@bluelibs/runner": "^5.3.0"
|
|
122
|
-
},
|
|
123
121
|
"overrides": {
|
|
124
122
|
"react": "18.3.1",
|
|
125
123
|
"react-dom": "18.3.1",
|