@neat.is/core 0.9.20-dev.20260922 → 0.9.21-dev.20260923
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/{chunk-KIV7OB2K.js → chunk-NFJ4W5T6.js} +168 -7
- package/dist/chunk-NFJ4W5T6.js.map +1 -0
- package/dist/{chunk-F7I3G4KC.js → chunk-SK2FEJKB.js} +39 -2
- package/dist/chunk-SK2FEJKB.js.map +1 -0
- package/dist/cli.cjs +260 -14
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +89 -8
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +200 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +2 -2
- package/dist/neatd.cjs +200 -6
- package/dist/neatd.cjs.map +1 -1
- package/dist/neatd.js +2 -2
- package/dist/server.cjs +155 -7
- package/dist/server.cjs.map +1 -1
- package/dist/server.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-F7I3G4KC.js.map +0 -1
- package/dist/chunk-KIV7OB2K.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
resolveNeatVersion,
|
|
9
9
|
startK8sSubstratePolling,
|
|
10
10
|
writeDaemonRecord
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-SK2FEJKB.js";
|
|
12
12
|
import {
|
|
13
13
|
buildSearchIndex
|
|
14
14
|
} from "./chunk-BC53SCT7.js";
|
|
@@ -77,7 +77,7 @@ import {
|
|
|
77
77
|
startStalenessLoop,
|
|
78
78
|
upsertConnectorEntry,
|
|
79
79
|
validateConnectorEntry
|
|
80
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-NFJ4W5T6.js";
|
|
81
81
|
import {
|
|
82
82
|
startOtelGrpcReceiver
|
|
83
83
|
} from "./chunk-ERE47MCR.js";
|
|
@@ -271,7 +271,7 @@ ${NEAT_OUT_LINE}
|
|
|
271
271
|
}
|
|
272
272
|
|
|
273
273
|
// src/summary.ts
|
|
274
|
-
import { NodeType, Provenance as Provenance2 } from "@neat.is/types";
|
|
274
|
+
import { EdgeType, NodeType, Provenance as Provenance2 } from "@neat.is/types";
|
|
275
275
|
function renderOtelEnvBlock() {
|
|
276
276
|
return [
|
|
277
277
|
"for prod OTel routing, set these in your deploy platform's env:",
|
|
@@ -300,6 +300,77 @@ function formatDivergence(d) {
|
|
|
300
300
|
const conf = d.confidence.toFixed(2);
|
|
301
301
|
return ` [${conf}] ${d.type} ${d.source} \u2192 ${d.target} \u2014 ${d.reason}`;
|
|
302
302
|
}
|
|
303
|
+
var JS_TS_LANGUAGES = /* @__PURE__ */ new Set(["javascript", "typescript"]);
|
|
304
|
+
var COVERAGE_COLUMNS = [
|
|
305
|
+
{ key: "symbols", label: "symbols" },
|
|
306
|
+
{ key: "routes", label: "routes" },
|
|
307
|
+
{ key: "data", label: "data" },
|
|
308
|
+
{ key: "crossServiceCalls", label: "cross-service calls" }
|
|
309
|
+
];
|
|
310
|
+
function isTableInfra(kind) {
|
|
311
|
+
return kind !== void 0 && /(table|collection)$/.test(kind);
|
|
312
|
+
}
|
|
313
|
+
function computeLanguageCoverage(nodes, edges) {
|
|
314
|
+
const serviceLang = /* @__PURE__ */ new Map();
|
|
315
|
+
const fileService = /* @__PURE__ */ new Map();
|
|
316
|
+
const nodeById = /* @__PURE__ */ new Map();
|
|
317
|
+
for (const n of nodes) {
|
|
318
|
+
nodeById.set(n.id, n);
|
|
319
|
+
if (n.type === NodeType.ServiceNode) serviceLang.set(n.name, n.language);
|
|
320
|
+
else if (n.type === NodeType.FileNode) fileService.set(n.id, n.service);
|
|
321
|
+
}
|
|
322
|
+
const cov = /* @__PURE__ */ new Map();
|
|
323
|
+
const ensure = (lang) => {
|
|
324
|
+
let c = cov.get(lang);
|
|
325
|
+
if (!c) {
|
|
326
|
+
c = { symbols: false, routes: false, data: false, crossServiceCalls: false };
|
|
327
|
+
cov.set(lang, c);
|
|
328
|
+
}
|
|
329
|
+
return c;
|
|
330
|
+
};
|
|
331
|
+
for (const lang of serviceLang.values()) ensure(lang);
|
|
332
|
+
for (const n of nodes) {
|
|
333
|
+
if (n.type === NodeType.SymbolNode) {
|
|
334
|
+
if (n.discoveredVia === "otel") continue;
|
|
335
|
+
const lang = serviceLang.get(n.service);
|
|
336
|
+
if (lang) ensure(lang).symbols = true;
|
|
337
|
+
} else if (n.type === NodeType.RouteNode) {
|
|
338
|
+
if (n.discoveredVia === "otel") continue;
|
|
339
|
+
const lang = serviceLang.get(n.service);
|
|
340
|
+
if (lang) ensure(lang).routes = true;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
for (const e of edges) {
|
|
344
|
+
if (e.type !== EdgeType.CALLS || e.provenance !== Provenance2.EXTRACTED) continue;
|
|
345
|
+
const svc = fileService.get(e.source);
|
|
346
|
+
const lang = svc ? serviceLang.get(svc) : void 0;
|
|
347
|
+
if (!lang) continue;
|
|
348
|
+
const target = nodeById.get(e.target);
|
|
349
|
+
if (!target) continue;
|
|
350
|
+
if (target.type === NodeType.RouteNode) ensure(lang).crossServiceCalls = true;
|
|
351
|
+
else if (target.type === NodeType.InfraNode && isTableInfra(target.kind)) ensure(lang).data = true;
|
|
352
|
+
}
|
|
353
|
+
return cov;
|
|
354
|
+
}
|
|
355
|
+
function renderLanguageCoverage(nodes, edges) {
|
|
356
|
+
const cov = computeLanguageCoverage(nodes, edges);
|
|
357
|
+
const langs = [...cov.keys()];
|
|
358
|
+
if (!langs.some((l) => !JS_TS_LANGUAGES.has(l))) return [];
|
|
359
|
+
const glyph = (on) => on ? ok(sym.ok) : dim("\u2014");
|
|
360
|
+
const header = ["", ...COVERAGE_COLUMNS.map((c) => c.label)];
|
|
361
|
+
const rows = [header];
|
|
362
|
+
for (const lang of [...langs].sort()) {
|
|
363
|
+
const c = cov.get(lang);
|
|
364
|
+
rows.push([lang, ...COVERAGE_COLUMNS.map((col) => glyph(c[col.key]))]);
|
|
365
|
+
}
|
|
366
|
+
const lines = ["static coverage by language (this scan):"];
|
|
367
|
+
for (const row of table(rows)) lines.push(` ${row}`);
|
|
368
|
+
lines.push(
|
|
369
|
+
` ${sym.arrow} cross-service call recognition is JS/TS-only today (#1158); non-JS/TS callers rely on OBSERVED for cross-service topology.`
|
|
370
|
+
);
|
|
371
|
+
lines.push("");
|
|
372
|
+
return lines;
|
|
373
|
+
}
|
|
303
374
|
function renderValueForwardSummary(input) {
|
|
304
375
|
const { graph, divergences, verbose } = input;
|
|
305
376
|
const nodes = [];
|
|
@@ -333,6 +404,7 @@ function renderValueForwardSummary(input) {
|
|
|
333
404
|
lines.push(" \u2192 run your services with the generated otel-init to populate OBSERVED edges.");
|
|
334
405
|
lines.push("");
|
|
335
406
|
}
|
|
407
|
+
for (const line of renderLanguageCoverage(nodes, edges)) lines.push(line);
|
|
336
408
|
lines.push(renderOtelEnvBlock());
|
|
337
409
|
lines.push("");
|
|
338
410
|
if (verbose) {
|
|
@@ -7532,12 +7604,12 @@ async function runEditorCommand(clientId, args, projectDir = process.cwd()) {
|
|
|
7532
7604
|
}
|
|
7533
7605
|
|
|
7534
7606
|
// src/monitor.ts
|
|
7535
|
-
import { EdgeType, parseEdgeId, Provenance as Provenance4 } from "@neat.is/types";
|
|
7607
|
+
import { EdgeType as EdgeType2, parseEdgeId, Provenance as Provenance4 } from "@neat.is/types";
|
|
7536
7608
|
var OBSERVED_DEP_EDGE_TYPES = /* @__PURE__ */ new Set([
|
|
7537
|
-
|
|
7538
|
-
|
|
7539
|
-
|
|
7540
|
-
|
|
7609
|
+
EdgeType2.CALLS,
|
|
7610
|
+
EdgeType2.CONNECTS_TO,
|
|
7611
|
+
EdgeType2.PUBLISHES_TO,
|
|
7612
|
+
EdgeType2.CONSUMES_FROM
|
|
7541
7613
|
]);
|
|
7542
7614
|
function divergenceKey(d) {
|
|
7543
7615
|
const column = "column" in d && d.column ? d.column : "";
|
|
@@ -7595,6 +7667,15 @@ function formatDivergenceLine2(d) {
|
|
|
7595
7667
|
const at = d.location ? ` at ${d.location}` : "";
|
|
7596
7668
|
return `\u26A0 divergence [observed-failing] ${d.source}${at} declares a call observed failing (${d.failureKind})`;
|
|
7597
7669
|
}
|
|
7670
|
+
case "deploy-mismatch":
|
|
7671
|
+
if (d.kind === "image") {
|
|
7672
|
+
return `\u26A0 divergence [deploy-mismatch] ${d.source} declares image ${d.declaredImage ?? "unknown"}, running ${d.observedImage ?? "unknown"}`;
|
|
7673
|
+
}
|
|
7674
|
+
return `\u26A0 divergence [deploy-mismatch] ${d.source} declares ${d.declaredReplicas ?? "unknown"} replicas, ${d.observedReplicas ?? "unknown"} ready`;
|
|
7675
|
+
default: {
|
|
7676
|
+
const other = d;
|
|
7677
|
+
return `\u26A0 divergence [${other.type}] ${other.source} \u2192 ${other.target}`;
|
|
7678
|
+
}
|
|
7598
7679
|
}
|
|
7599
7680
|
}
|
|
7600
7681
|
function formatStaleLine(edgeId) {
|