@neat.is/core 0.10.6 → 0.10.7-dev.20261011
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-MW2XYLCS.js → chunk-6K22WGO7.js} +49 -1
- package/dist/{chunk-MW2XYLCS.js.map → chunk-6K22WGO7.js.map} +1 -1
- package/dist/chunk-AEMLUMHC.js +42 -0
- package/dist/chunk-AEMLUMHC.js.map +1 -0
- package/dist/{chunk-OKM4N7GH.js → chunk-S5S2FYCQ.js} +26 -5
- package/dist/chunk-S5S2FYCQ.js.map +1 -0
- package/dist/cli.cjs +137 -10
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.d.cts +3 -2
- package/dist/cli.d.ts +3 -2
- package/dist/cli.js +53 -12
- package/dist/cli.js.map +1 -1
- package/dist/incidents-render.cjs +66 -0
- package/dist/incidents-render.cjs.map +1 -0
- package/dist/incidents-render.d.cts +5 -0
- package/dist/incidents-render.d.ts +5 -0
- package/dist/incidents-render.js +8 -0
- package/dist/incidents-render.js.map +1 -0
- package/dist/index.cjs +72 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/neatd.cjs +78 -6
- package/dist/neatd.cjs.map +1 -1
- package/dist/neatd.js +8 -5
- package/dist/neatd.js.map +1 -1
- package/dist/server.cjs +48 -0
- package/dist/server.cjs.map +1 -1
- package/dist/server.js +1 -1
- package/package.json +7 -2
- package/dist/chunk-OKM4N7GH.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
routeSpanToProject,
|
|
3
3
|
startDaemon
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-S5S2FYCQ.js";
|
|
5
5
|
import {
|
|
6
6
|
buildApi,
|
|
7
7
|
checkCompatibility,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
startStalenessLoop,
|
|
26
26
|
stitchTrace,
|
|
27
27
|
thresholdForEdgeType
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-6K22WGO7.js";
|
|
29
29
|
import {
|
|
30
30
|
ProjectNameCollisionError,
|
|
31
31
|
addProject,
|
package/dist/neatd.cjs
CHANGED
|
@@ -18149,6 +18149,36 @@ var import_types62 = require("@neat.is/types");
|
|
|
18149
18149
|
var CODE_FILEPATH_ATTR2 = "code.filepath";
|
|
18150
18150
|
var CODE_LINENO_ATTR2 = "code.lineno";
|
|
18151
18151
|
var BLAST_NEAREST_LIMIT = 5;
|
|
18152
|
+
function deployContextOf(ev) {
|
|
18153
|
+
const a = ev.attributes;
|
|
18154
|
+
if (!a) return void 0;
|
|
18155
|
+
const str = (k) => typeof a[k] === "string" ? a[k] : void 0;
|
|
18156
|
+
const int = (k) => typeof a[k] === "number" && Number.isFinite(a[k]) ? Math.trunc(a[k]) : void 0;
|
|
18157
|
+
const strs = (k) => {
|
|
18158
|
+
const v = a[k];
|
|
18159
|
+
return Array.isArray(v) && v.every((x) => typeof x === "string") && v.length > 0 ? v : void 0;
|
|
18160
|
+
};
|
|
18161
|
+
const ctx = {};
|
|
18162
|
+
const fault = str("k8s.fault");
|
|
18163
|
+
if (fault) ctx.fault = fault;
|
|
18164
|
+
const waiting = str("k8s.waitingReason");
|
|
18165
|
+
if (waiting) ctx.waitingReason = waiting;
|
|
18166
|
+
const image = str("k8s.image");
|
|
18167
|
+
if (image) ctx.image = image;
|
|
18168
|
+
const restarts = int("k8s.restartCount");
|
|
18169
|
+
if (restarts !== void 0) ctx.restartCount = restarts;
|
|
18170
|
+
const termReason = str("k8s.terminatedReason");
|
|
18171
|
+
if (termReason) ctx.terminatedReason = termReason;
|
|
18172
|
+
const exitCode = int("k8s.exitCode");
|
|
18173
|
+
if (exitCode !== void 0) ctx.exitCode = exitCode;
|
|
18174
|
+
const env = strs("k8s.containerEnv");
|
|
18175
|
+
if (env) ctx.containerEnv = env;
|
|
18176
|
+
const args = strs("k8s.containerArgs");
|
|
18177
|
+
if (args) ctx.containerArgs = args;
|
|
18178
|
+
const log = str("k8s.processLog");
|
|
18179
|
+
if (log) ctx.processLog = log;
|
|
18180
|
+
return Object.keys(ctx).length > 0 ? ctx : void 0;
|
|
18181
|
+
}
|
|
18152
18182
|
function grainOf2(graph, nodeId) {
|
|
18153
18183
|
if (graph.hasNode(nodeId)) {
|
|
18154
18184
|
const t = graph.getNodeAttributes(nodeId).type;
|
|
@@ -18201,6 +18231,11 @@ function promoteCauseLocus(graph, causeNode, incidents) {
|
|
|
18201
18231
|
return locusFromNode(graph, causeNode);
|
|
18202
18232
|
}
|
|
18203
18233
|
function divergenceSummary(d) {
|
|
18234
|
+
if (d.type === "observed-symbol-mismatch" || d.source === d.target) {
|
|
18235
|
+
const symbol = "symbol" in d && d.symbol ? d.symbol : d.source;
|
|
18236
|
+
const at = "location" in d && d.location ? ` at ${d.location}` : "";
|
|
18237
|
+
return `${symbol}${at}`;
|
|
18238
|
+
}
|
|
18204
18239
|
const column = "column" in d && d.column ? `.${d.column}` : "";
|
|
18205
18240
|
const label = "table" in d && d.table ? `${d.table}${column}` : `${d.source} \u2192 ${d.target}`;
|
|
18206
18241
|
return label;
|
|
@@ -18291,6 +18326,10 @@ function buildIncidentCard(graph, errorEvent, incidents, policies) {
|
|
|
18291
18326
|
...nearest.length > 0 ? { blastRadius: { totalAffected: blast.totalAffected, nearest } } : {},
|
|
18292
18327
|
...policyCards.length > 0 ? { policies: policyCards } : {},
|
|
18293
18328
|
...divergences.length > 0 ? { divergence: divergences } : {},
|
|
18329
|
+
...(() => {
|
|
18330
|
+
const dc = deployContextOf(errorEvent);
|
|
18331
|
+
return dc ? { deployContext: dc } : {};
|
|
18332
|
+
})(),
|
|
18294
18333
|
headline: renderHeadline(graph, errorEvent, locus, rootCause?.node ?? null)
|
|
18295
18334
|
};
|
|
18296
18335
|
card.grade = gradeIncidentCard(card);
|
|
@@ -18645,6 +18684,15 @@ var TYPE_NOUNS = [
|
|
|
18645
18684
|
];
|
|
18646
18685
|
var EMBED_MIN_SCORE = 0.35;
|
|
18647
18686
|
async function resolveEntities(graph, question, searchIndex, maxNodes) {
|
|
18687
|
+
const verbatim = [];
|
|
18688
|
+
for (const word of question.split(/\s+/)) {
|
|
18689
|
+
const id = word.replace(/^["'`(<]+|["'`)>?!.,;]+$/g, "");
|
|
18690
|
+
if (!id || !graph.hasNode(id) || verbatim.some((m) => m.nodeId === id)) continue;
|
|
18691
|
+
const node = graph.getNodeAttributes(id);
|
|
18692
|
+
if (node.type === import_types63.NodeType.FrontierNode) continue;
|
|
18693
|
+
verbatim.push({ nodeId: id, label: nodeName(node), via: "id", score: 1 });
|
|
18694
|
+
}
|
|
18695
|
+
if (verbatim.length > 0) return { matched: verbatim.slice(0, maxNodes) };
|
|
18648
18696
|
const qTokens = queryTokens(question);
|
|
18649
18697
|
const normalized = question.toLowerCase();
|
|
18650
18698
|
const best = /* @__PURE__ */ new Map();
|
|
@@ -25292,7 +25340,7 @@ function credentialRecord(provider, cred) {
|
|
|
25292
25340
|
return { token: cred.accessToken };
|
|
25293
25341
|
}
|
|
25294
25342
|
}
|
|
25295
|
-
function hostedOptions(provider, summary, serviceName, firebaseServiceMap) {
|
|
25343
|
+
function hostedOptions(provider, summary, serviceName, firebaseServiceMap, serviceMaps = {}) {
|
|
25296
25344
|
switch (provider) {
|
|
25297
25345
|
case "supabase": {
|
|
25298
25346
|
const ref = summary.projectRef;
|
|
@@ -25311,9 +25359,12 @@ function hostedOptions(provider, summary, serviceName, firebaseServiceMap) {
|
|
|
25311
25359
|
case "firebase": {
|
|
25312
25360
|
return { inferServices: true, excludeCloudRun: true, ...firebaseServiceMap ?? {} };
|
|
25313
25361
|
}
|
|
25362
|
+
// Same no-setup rule as Firebase: infer the owning service from the graph; an unknown one stays coarse.
|
|
25363
|
+
// NEAT_CLOUD_RUN_SERVICE_MAP / NEAT_GCP_LB_BACKEND_SERVICE_MAP are optional overrides whose entries win.
|
|
25314
25364
|
case "cloud-run":
|
|
25365
|
+
return { inferServices: true, ...serviceMaps.cloudRun ? { serviceMap: serviceMaps.cloudRun } : {} };
|
|
25315
25366
|
case "gcp-lb":
|
|
25316
|
-
return { inferServices: true };
|
|
25367
|
+
return { inferServices: true, ...serviceMaps.gcpLb ? { backendServiceMap: serviceMaps.gcpLb } : {} };
|
|
25317
25368
|
default:
|
|
25318
25369
|
return null;
|
|
25319
25370
|
}
|
|
@@ -25338,6 +25389,19 @@ function parseFirebaseServiceMap(raw) {
|
|
|
25338
25389
|
return void 0;
|
|
25339
25390
|
}
|
|
25340
25391
|
}
|
|
25392
|
+
function parseServiceNameMap(raw) {
|
|
25393
|
+
if (!raw) return void 0;
|
|
25394
|
+
try {
|
|
25395
|
+
const parsed = JSON.parse(raw);
|
|
25396
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return void 0;
|
|
25397
|
+
const entries = Object.entries(parsed);
|
|
25398
|
+
if (entries.length === 0) return void 0;
|
|
25399
|
+
if (entries.some(([, v]) => typeof v !== "string" || v.length === 0)) return void 0;
|
|
25400
|
+
return Object.fromEntries(entries);
|
|
25401
|
+
} catch {
|
|
25402
|
+
return void 0;
|
|
25403
|
+
}
|
|
25404
|
+
}
|
|
25341
25405
|
function pushHandlesPath(projectDir) {
|
|
25342
25406
|
return (0, import_node_path79.join)(projectDir, "neat-out", "connectors-hosted.json");
|
|
25343
25407
|
}
|
|
@@ -25459,7 +25523,10 @@ function startConnectionLoops(c, input, startLoop) {
|
|
|
25459
25523
|
onSkip?.(name, "no project selected yet \u2014 not pullable");
|
|
25460
25524
|
continue;
|
|
25461
25525
|
}
|
|
25462
|
-
const options = hostedOptions(name, c, project, input.firebaseServiceMap
|
|
25526
|
+
const options = hostedOptions(name, c, project, input.firebaseServiceMap, {
|
|
25527
|
+
...input.cloudRunServiceMap ? { cloudRun: input.cloudRunServiceMap } : {},
|
|
25528
|
+
...input.gcpLbBackendServiceMap ? { gcpLb: input.gcpLbBackendServiceMap } : {}
|
|
25529
|
+
});
|
|
25463
25530
|
if (!options) {
|
|
25464
25531
|
onSkip?.(name, "no hosted option mapping for this provider");
|
|
25465
25532
|
continue;
|
|
@@ -25569,6 +25636,8 @@ async function maybeStartHostedConnectors(input) {
|
|
|
25569
25636
|
projectDir: input.projectDir,
|
|
25570
25637
|
project: input.project,
|
|
25571
25638
|
...parseFirebaseServiceMap(env.NEAT_FIREBASE_SERVICE_MAP) ? { firebaseServiceMap: parseFirebaseServiceMap(env.NEAT_FIREBASE_SERVICE_MAP) } : {},
|
|
25639
|
+
...parseServiceNameMap(env.NEAT_CLOUD_RUN_SERVICE_MAP) ? { cloudRunServiceMap: parseServiceNameMap(env.NEAT_CLOUD_RUN_SERVICE_MAP) } : {},
|
|
25640
|
+
...parseServiceNameMap(env.NEAT_GCP_LB_BACKEND_SERVICE_MAP) ? { gcpLbBackendServiceMap: parseServiceNameMap(env.NEAT_GCP_LB_BACKEND_SERVICE_MAP) } : {},
|
|
25572
25641
|
...input.errorsPath ? { errorsPath: input.errorsPath } : {},
|
|
25573
25642
|
...input.onSkip ? { onSkip: input.onSkip } : {},
|
|
25574
25643
|
...input.intervalMs !== void 0 ? { intervalMs: input.intervalMs } : {}
|
|
@@ -27250,10 +27319,10 @@ async function pickInternalPort() {
|
|
|
27250
27319
|
});
|
|
27251
27320
|
}
|
|
27252
27321
|
async function spawnWebUI(restPort, opts = {}) {
|
|
27253
|
-
const root = projectRoot();
|
|
27322
|
+
const root = opts.projectRoot ? import_node_path83.default.resolve(opts.projectRoot) : projectRoot();
|
|
27254
27323
|
const fromDaemon = await readDaemonPorts(root);
|
|
27255
27324
|
const { webPort: port, apiUrl } = resolveWebPorts({
|
|
27256
|
-
daemonWeb: fromDaemon.web,
|
|
27325
|
+
daemonWeb: fromDaemon.web ?? asValidPort(opts.webPort),
|
|
27257
27326
|
daemonRest: fromDaemon.rest,
|
|
27258
27327
|
webPortEnv: process.env.NEAT_WEB_PORT,
|
|
27259
27328
|
apiUrlEnv: process.env.NEAT_API_URL,
|
|
@@ -27534,7 +27603,10 @@ async function cmdStart() {
|
|
|
27534
27603
|
let web = null;
|
|
27535
27604
|
if (!skipWeb) {
|
|
27536
27605
|
try {
|
|
27537
|
-
web = await spawnWebUI(
|
|
27606
|
+
web = await spawnWebUI(
|
|
27607
|
+
restPortFromEnv(),
|
|
27608
|
+
projectPath ? { projectRoot: projectPath, webPort: handle.daemonRecord?.ports.web } : {}
|
|
27609
|
+
);
|
|
27538
27610
|
} catch (err) {
|
|
27539
27611
|
console.error(err.message);
|
|
27540
27612
|
await handle.stop().catch(() => {
|