@neat.is/core 0.2.10 → 0.3.1

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/cli.js CHANGED
@@ -2,9 +2,6 @@
2
2
  import {
3
3
  buildSearchIndex
4
4
  } from "./chunk-XOOCA5T7.js";
5
- import {
6
- buildApi
7
- } from "./chunk-W7ZYJZC7.js";
8
5
  import {
9
6
  DEFAULT_PROJECT,
10
7
  PolicyViolationsLog,
@@ -18,6 +15,7 @@ import {
18
15
  addServiceAliases,
19
16
  addServiceNodes,
20
17
  attachGraphToEventBus,
18
+ buildApi,
21
19
  discoverServices,
22
20
  emitNeatEvent,
23
21
  ensureCompatLoaded,
@@ -37,12 +35,13 @@ import {
37
35
  setStatus,
38
36
  startPersistLoop,
39
37
  startStalenessLoop
40
- } from "./chunk-JMLZOKCS.js";
38
+ } from "./chunk-FIXKIYNF.js";
41
39
  import {
42
- buildOtelReceiver,
43
40
  startOtelGrpcReceiver
44
- } from "./chunk-QYUB3FQL.js";
45
- import "./chunk-DGUM43GV.js";
41
+ } from "./chunk-G3PDTGOW.js";
42
+ import {
43
+ buildOtelReceiver
44
+ } from "./chunk-4ASCXBZF.js";
46
45
 
47
46
  // src/cli.ts
48
47
  import path4 from "path";
@@ -830,7 +829,7 @@ async function runRootCause(client, input) {
830
829
  const qs = input.errorId ? `?errorId=${encodeURIComponent(input.errorId)}` : "";
831
830
  const path5 = projectPath(
832
831
  input.project,
833
- `/traverse/root-cause/${encodeURIComponent(input.errorNode)}${qs}`
832
+ `/graph/root-cause/${encodeURIComponent(input.errorNode)}${qs}`
834
833
  );
835
834
  try {
836
835
  const result = await client.get(path5);
@@ -861,7 +860,7 @@ async function runBlastRadius(client, input) {
861
860
  const qs = input.depth !== void 0 ? `?depth=${input.depth}` : "";
862
861
  const path5 = projectPath(
863
862
  input.project,
864
- `/traverse/blast-radius/${encodeURIComponent(input.nodeId)}${qs}`
863
+ `/graph/blast-radius/${encodeURIComponent(input.nodeId)}${qs}`
865
864
  );
866
865
  try {
867
866
  const result = await client.get(path5);
@@ -900,7 +899,7 @@ async function runDependencies(client, input) {
900
899
  const depth = input.depth ?? 3;
901
900
  const path5 = projectPath(
902
901
  input.project,
903
- `/graph/node/${encodeURIComponent(input.nodeId)}/dependencies?depth=${depth}`
902
+ `/graph/dependencies/${encodeURIComponent(input.nodeId)}?depth=${depth}`
904
903
  );
905
904
  try {
906
905
  const result = await client.get(path5);
@@ -986,7 +985,8 @@ function formatDuration(ms) {
986
985
  async function runIncidents(client, input) {
987
986
  const path5 = input.nodeId ? projectPath(input.project, `/incidents/${encodeURIComponent(input.nodeId)}`) : projectPath(input.project, "/incidents");
988
987
  try {
989
- const events = await client.get(path5);
988
+ const body = await client.get(path5);
989
+ const events = body.events;
990
990
  if (events.length === 0) {
991
991
  return {
992
992
  summary: input.nodeId ? `No incidents recorded against ${input.nodeId}.` : "No incidents recorded."
@@ -1000,7 +1000,7 @@ async function runIncidents(client, input) {
1000
1000
  }
1001
1001
  const target = input.nodeId ?? "the project";
1002
1002
  return {
1003
- summary: `${target} has ${events.length} recorded incident${events.length === 1 ? "" : "s"}; showing the ${ordered.length} most recent.`,
1003
+ summary: `${target} has ${body.total} recorded incident${body.total === 1 ? "" : "s"}; showing the ${ordered.length} most recent.`,
1004
1004
  block: blockLines.join("\n"),
1005
1005
  provenance: Provenance2.OBSERVED
1006
1006
  };
@@ -1096,9 +1096,10 @@ async function runStaleEdges(client, input) {
1096
1096
  if (input.limit !== void 0) params.set("limit", String(input.limit));
1097
1097
  if (input.edgeType) params.set("edgeType", input.edgeType);
1098
1098
  const qs = params.size > 0 ? `?${params.toString()}` : "";
1099
- const events = await client.get(
1100
- projectPath(input.project, `/incidents/stale${qs}`)
1099
+ const body = await client.get(
1100
+ projectPath(input.project, `/stale-events${qs}`)
1101
1101
  );
1102
+ const events = body.events;
1102
1103
  if (events.length === 0) {
1103
1104
  return {
1104
1105
  summary: input.edgeType ? `No stale ${input.edgeType} edges recorded.` : "No stale-edge transitions recorded yet."
@@ -1132,9 +1133,10 @@ async function runPolicies(client, input) {
1132
1133
  const params = new URLSearchParams();
1133
1134
  if (input.policyId) params.set("policyId", input.policyId);
1134
1135
  const qs = params.size > 0 ? `?${params.toString()}` : "";
1135
- violations = await client.get(
1136
+ const body = await client.get(
1136
1137
  projectPath(input.project, `/policies/violations${qs}`)
1137
1138
  );
1139
+ violations = body.violations;
1138
1140
  allowed = violations.every((v) => v.onViolation !== "block");
1139
1141
  }
1140
1142
  if (input.nodeId) {