@neat.is/types 0.4.26-dev.20260703 → 0.4.26
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 +93 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +966 -86
- package/dist/index.d.ts +966 -86
- package/dist/index.js +86 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -54,6 +54,7 @@ __export(index_exports, {
|
|
|
54
54
|
GraphNodeResponseSchema: () => GraphNodeResponseSchema,
|
|
55
55
|
GraphNodeSchema: () => GraphNodeSchema,
|
|
56
56
|
GraphQLOperationNodeSchema: () => GraphQLOperationNodeSchema,
|
|
57
|
+
GrpcMethodNodeSchema: () => GrpcMethodNodeSchema,
|
|
57
58
|
HealthResponseSchema: () => HealthResponseSchema,
|
|
58
59
|
HostMismatchDivergenceSchema: () => HostMismatchDivergenceSchema,
|
|
59
60
|
HypotheticalActionSchema: () => HypotheticalActionSchema,
|
|
@@ -95,6 +96,7 @@ __export(index_exports, {
|
|
|
95
96
|
TransitiveDependenciesResultSchema: () => TransitiveDependenciesResultSchema,
|
|
96
97
|
TransitiveDependencySchema: () => TransitiveDependencySchema,
|
|
97
98
|
VersionMismatchDivergenceSchema: () => VersionMismatchDivergenceSchema,
|
|
99
|
+
WebSocketChannelNodeSchema: () => WebSocketChannelNodeSchema,
|
|
98
100
|
confidenceForExtracted: () => confidenceForExtracted,
|
|
99
101
|
confidenceForObservedSignal: () => confidenceForObservedSignal,
|
|
100
102
|
configId: () => configId,
|
|
@@ -104,6 +106,7 @@ __export(index_exports, {
|
|
|
104
106
|
fileId: () => fileId,
|
|
105
107
|
frontierId: () => frontierId,
|
|
106
108
|
graphqlOperationId: () => graphqlOperationId,
|
|
109
|
+
grpcMethodId: () => grpcMethodId,
|
|
107
110
|
inferredEdgeId: () => inferredEdgeId,
|
|
108
111
|
infraId: () => infraId,
|
|
109
112
|
localDatabaseId: () => localDatabaseId,
|
|
@@ -114,12 +117,15 @@ __export(index_exports, {
|
|
|
114
117
|
parseFileId: () => parseFileId,
|
|
115
118
|
parseFrontierId: () => parseFrontierId,
|
|
116
119
|
parseGraphqlOperationId: () => parseGraphqlOperationId,
|
|
120
|
+
parseGrpcMethodId: () => parseGrpcMethodId,
|
|
117
121
|
parseInfraId: () => parseInfraId,
|
|
118
122
|
parseRouteId: () => parseRouteId,
|
|
119
123
|
parseServiceId: () => parseServiceId,
|
|
124
|
+
parseWebsocketChannelId: () => parseWebsocketChannelId,
|
|
120
125
|
passesExtractedFloor: () => passesExtractedFloor,
|
|
121
126
|
routeId: () => routeId,
|
|
122
|
-
serviceId: () => serviceId
|
|
127
|
+
serviceId: () => serviceId,
|
|
128
|
+
websocketChannelId: () => websocketChannelId
|
|
123
129
|
});
|
|
124
130
|
module.exports = __toCommonJS(index_exports);
|
|
125
131
|
|
|
@@ -173,7 +179,31 @@ var NodeType = {
|
|
|
173
179
|
// operation-level topology from the execution span's `graphql.operation.*`
|
|
174
180
|
// semconv. Minted observed-first from OTel; a future static GraphQL extractor
|
|
175
181
|
// fuses onto the same id. See docs/contracts/otel-ingest.md.
|
|
176
|
-
GraphQLOperationNode: "GraphQLOperationNode"
|
|
182
|
+
GraphQLOperationNode: "GraphQLOperationNode",
|
|
183
|
+
// A single gRPC method — one `rpc` in a `.proto` service — at
|
|
184
|
+
// (rpcService, rpcMethod) granularity (ADR-123). gRPC used to engage only at
|
|
185
|
+
// service grain: every method collapsed onto one service→service edge, so the
|
|
186
|
+
// per-method topology was invisible and one-sided. This node recovers the
|
|
187
|
+
// method-level shape from both sides: the OBSERVED execution span's
|
|
188
|
+
// `rpc.service` / `rpc.method` semconv and the static `.proto` service/method
|
|
189
|
+
// definitions. It keys on the fully-qualified `rpc.service` — the wire
|
|
190
|
+
// contract both sides carry verbatim — so a declared method and an observed
|
|
191
|
+
// one fuse onto the same node into a two-sided divergence. See
|
|
192
|
+
// docs/contracts/otel-ingest.md and docs/contracts/static-extraction.md.
|
|
193
|
+
GrpcMethodNode: "GrpcMethodNode",
|
|
194
|
+
// A live WebSocket channel — the path/channel a client connects to — at
|
|
195
|
+
// (service, channel) granularity (ADR-125). A WebSocket app used to produce no
|
|
196
|
+
// OBSERVED topology at all: only message-handler errors surfaced, as incidents,
|
|
197
|
+
// and the channels themselves stayed invisible. This node recovers the
|
|
198
|
+
// channel-level topology from the HTTP upgrade span that opens the connection —
|
|
199
|
+
// a SERVER `GET` carrying the WebSocket path. It is minted OBSERVED-only: a
|
|
200
|
+
// WebSocket channel is known from observation, never from static extraction, so
|
|
201
|
+
// there is no declared twin to fuse with. The edge onto it reuses the existing
|
|
202
|
+
// `CONNECTS_TO` (`service ──CONNECTS_TO──▶ ws-channel`) as an observed-liveness
|
|
203
|
+
// edge that carries `lastObserved` and decays OBSERVED → STALE on CONNECTS_TO's
|
|
204
|
+
// own staleness threshold when the channel goes quiet. See
|
|
205
|
+
// docs/contracts/otel-ingest.md.
|
|
206
|
+
WebSocketChannelNode: "WebSocketChannelNode"
|
|
177
207
|
};
|
|
178
208
|
var NodeTypeSchema = import_zod.z.enum([
|
|
179
209
|
NodeType.ServiceNode,
|
|
@@ -183,7 +213,9 @@ var NodeTypeSchema = import_zod.z.enum([
|
|
|
183
213
|
NodeType.FrontierNode,
|
|
184
214
|
NodeType.FileNode,
|
|
185
215
|
NodeType.RouteNode,
|
|
186
|
-
NodeType.GraphQLOperationNode
|
|
216
|
+
NodeType.GraphQLOperationNode,
|
|
217
|
+
NodeType.GrpcMethodNode,
|
|
218
|
+
NodeType.WebSocketChannelNode
|
|
187
219
|
]);
|
|
188
220
|
|
|
189
221
|
// src/nodes.ts
|
|
@@ -336,6 +368,26 @@ var GraphQLOperationNodeSchema = import_zod2.z.object({
|
|
|
336
368
|
line: import_zod2.z.number().int().nonnegative().optional(),
|
|
337
369
|
discoveredVia: DiscoveredViaSchema.optional()
|
|
338
370
|
});
|
|
371
|
+
var GrpcMethodNodeSchema = import_zod2.z.object({
|
|
372
|
+
id: import_zod2.z.string(),
|
|
373
|
+
type: import_zod2.z.literal(NodeType.GrpcMethodNode),
|
|
374
|
+
name: import_zod2.z.string(),
|
|
375
|
+
rpcService: import_zod2.z.string(),
|
|
376
|
+
rpcMethod: import_zod2.z.string(),
|
|
377
|
+
path: import_zod2.z.string().optional(),
|
|
378
|
+
line: import_zod2.z.number().int().nonnegative().optional(),
|
|
379
|
+
discoveredVia: DiscoveredViaSchema.optional()
|
|
380
|
+
});
|
|
381
|
+
var WebSocketChannelNodeSchema = import_zod2.z.object({
|
|
382
|
+
id: import_zod2.z.string(),
|
|
383
|
+
type: import_zod2.z.literal(NodeType.WebSocketChannelNode),
|
|
384
|
+
name: import_zod2.z.string(),
|
|
385
|
+
service: import_zod2.z.string(),
|
|
386
|
+
channel: import_zod2.z.string(),
|
|
387
|
+
path: import_zod2.z.string().optional(),
|
|
388
|
+
line: import_zod2.z.number().int().nonnegative().optional(),
|
|
389
|
+
discoveredVia: DiscoveredViaSchema.optional()
|
|
390
|
+
});
|
|
339
391
|
var GraphNodeSchema = import_zod2.z.discriminatedUnion("type", [
|
|
340
392
|
ServiceNodeSchema,
|
|
341
393
|
DatabaseNodeSchema,
|
|
@@ -344,7 +396,9 @@ var GraphNodeSchema = import_zod2.z.discriminatedUnion("type", [
|
|
|
344
396
|
FrontierNodeSchema,
|
|
345
397
|
FileNodeSchema,
|
|
346
398
|
RouteNodeSchema,
|
|
347
|
-
GraphQLOperationNodeSchema
|
|
399
|
+
GraphQLOperationNodeSchema,
|
|
400
|
+
GrpcMethodNodeSchema,
|
|
401
|
+
WebSocketChannelNodeSchema
|
|
348
402
|
]);
|
|
349
403
|
|
|
350
404
|
// src/edges.ts
|
|
@@ -518,6 +572,8 @@ var FRONTIER_PREFIX = "frontier:";
|
|
|
518
572
|
var FILE_PREFIX = "file:";
|
|
519
573
|
var ROUTE_PREFIX = "route:";
|
|
520
574
|
var GRAPHQL_OP_PREFIX = "graphql:";
|
|
575
|
+
var GRPC_METHOD_PREFIX = "grpc:";
|
|
576
|
+
var WEBSOCKET_CHANNEL_PREFIX = "ws:";
|
|
521
577
|
var ENV_UNKNOWN = "unknown";
|
|
522
578
|
function serviceId(name, env) {
|
|
523
579
|
if (env === void 0 || env === ENV_UNKNOWN) return `${SERVICE_PREFIX}${name}`;
|
|
@@ -611,6 +667,32 @@ function parseGraphqlOperationId(id) {
|
|
|
611
667
|
}
|
|
612
668
|
return { service, operationType, operationName };
|
|
613
669
|
}
|
|
670
|
+
function grpcMethodId(rpcService, rpcMethod) {
|
|
671
|
+
return `${GRPC_METHOD_PREFIX}${rpcService}/${rpcMethod}`;
|
|
672
|
+
}
|
|
673
|
+
function parseGrpcMethodId(id) {
|
|
674
|
+
if (!id.startsWith(GRPC_METHOD_PREFIX)) return null;
|
|
675
|
+
const rest = id.slice(GRPC_METHOD_PREFIX.length);
|
|
676
|
+
const slash = rest.indexOf("/");
|
|
677
|
+
if (slash === -1) return null;
|
|
678
|
+
const rpcService = rest.slice(0, slash);
|
|
679
|
+
const rpcMethod = rest.slice(slash + 1);
|
|
680
|
+
if (rpcService.length === 0 || rpcMethod.length === 0) return null;
|
|
681
|
+
return { rpcService, rpcMethod };
|
|
682
|
+
}
|
|
683
|
+
function websocketChannelId(service, channel) {
|
|
684
|
+
return `${WEBSOCKET_CHANNEL_PREFIX}${service}:${channel}`;
|
|
685
|
+
}
|
|
686
|
+
function parseWebsocketChannelId(id) {
|
|
687
|
+
if (!id.startsWith(WEBSOCKET_CHANNEL_PREFIX)) return null;
|
|
688
|
+
const rest = id.slice(WEBSOCKET_CHANNEL_PREFIX.length);
|
|
689
|
+
const colon = rest.indexOf(":");
|
|
690
|
+
if (colon === -1) return null;
|
|
691
|
+
const service = rest.slice(0, colon);
|
|
692
|
+
const channel = rest.slice(colon + 1);
|
|
693
|
+
if (service.length === 0 || channel.length === 0) return null;
|
|
694
|
+
return { service, channel };
|
|
695
|
+
}
|
|
614
696
|
var EDGE_ARROW = "->";
|
|
615
697
|
function extractedEdgeId(source, target, type) {
|
|
616
698
|
return `${type}:${source}${EDGE_ARROW}${target}`;
|
|
@@ -1080,6 +1162,7 @@ function passesExtractedFloor(confidence) {
|
|
|
1080
1162
|
GraphNodeResponseSchema,
|
|
1081
1163
|
GraphNodeSchema,
|
|
1082
1164
|
GraphQLOperationNodeSchema,
|
|
1165
|
+
GrpcMethodNodeSchema,
|
|
1083
1166
|
HealthResponseSchema,
|
|
1084
1167
|
HostMismatchDivergenceSchema,
|
|
1085
1168
|
HypotheticalActionSchema,
|
|
@@ -1121,6 +1204,7 @@ function passesExtractedFloor(confidence) {
|
|
|
1121
1204
|
TransitiveDependenciesResultSchema,
|
|
1122
1205
|
TransitiveDependencySchema,
|
|
1123
1206
|
VersionMismatchDivergenceSchema,
|
|
1207
|
+
WebSocketChannelNodeSchema,
|
|
1124
1208
|
confidenceForExtracted,
|
|
1125
1209
|
confidenceForObservedSignal,
|
|
1126
1210
|
configId,
|
|
@@ -1130,6 +1214,7 @@ function passesExtractedFloor(confidence) {
|
|
|
1130
1214
|
fileId,
|
|
1131
1215
|
frontierId,
|
|
1132
1216
|
graphqlOperationId,
|
|
1217
|
+
grpcMethodId,
|
|
1133
1218
|
inferredEdgeId,
|
|
1134
1219
|
infraId,
|
|
1135
1220
|
localDatabaseId,
|
|
@@ -1140,11 +1225,14 @@ function passesExtractedFloor(confidence) {
|
|
|
1140
1225
|
parseFileId,
|
|
1141
1226
|
parseFrontierId,
|
|
1142
1227
|
parseGraphqlOperationId,
|
|
1228
|
+
parseGrpcMethodId,
|
|
1143
1229
|
parseInfraId,
|
|
1144
1230
|
parseRouteId,
|
|
1145
1231
|
parseServiceId,
|
|
1232
|
+
parseWebsocketChannelId,
|
|
1146
1233
|
passesExtractedFloor,
|
|
1147
1234
|
routeId,
|
|
1148
|
-
serviceId
|
|
1235
|
+
serviceId,
|
|
1236
|
+
websocketChannelId
|
|
1149
1237
|
});
|
|
1150
1238
|
//# sourceMappingURL=index.cjs.map
|