@takodotid/circuit 0.19.0 → 0.21.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.
Files changed (54) hide show
  1. package/README.md +2 -2
  2. package/dist/chunks/index-n4zpd25n.js +936 -0
  3. package/dist/chunks/{index-dczpxzzm.js → index-v8zgr7wm.js} +33 -14
  4. package/dist/chunks/{new-7n8qvtjd.js → new-ny89s7y7.js} +4 -6
  5. package/dist/chunks/server-zapfzhv4.js +244 -0
  6. package/dist/cli/index.js +855 -803
  7. package/dist/index.js +20 -21
  8. package/dist/presets/index.js +20 -21
  9. package/dist/types/adapters/devices/derive.d.ts +2 -0
  10. package/dist/types/core/across.d.ts +4 -0
  11. package/dist/types/core/addr.d.ts +10 -0
  12. package/dist/types/core/addresses.d.ts +46 -0
  13. package/dist/types/core/files.d.ts +6 -0
  14. package/dist/types/core/graph.d.ts +31 -1
  15. package/dist/types/core/schema-docs.d.ts +16 -0
  16. package/package.json +7 -7
  17. package/src/adapters/devices/derive.ts +32 -0
  18. package/src/adapters/devices/raisecom-ros/index.ts +23 -3
  19. package/src/adapters/devices/routeros/index.ts +10 -0
  20. package/src/adapters/devices/vrp/index.ts +10 -1
  21. package/src/cli/graph.ts +1 -15
  22. package/src/cli/index.ts +154 -20
  23. package/src/cli/rename.ts +129 -0
  24. package/src/core/across.ts +322 -0
  25. package/src/core/addr.ts +29 -0
  26. package/src/core/addresses.ts +316 -0
  27. package/src/core/files.ts +32 -0
  28. package/src/core/graph.ts +27 -6
  29. package/src/core/schema-docs.ts +166 -0
  30. package/src/core/validate.ts +2 -52
  31. package/src/studio/data.ts +255 -0
  32. package/src/studio/git.ts +119 -0
  33. package/src/studio/public/app.js +165 -0
  34. package/src/studio/public/compare.js +243 -0
  35. package/src/studio/public/diff.js +97 -0
  36. package/src/studio/public/dom.js +108 -0
  37. package/src/studio/public/evaluate.js +648 -0
  38. package/src/studio/public/export.js +122 -0
  39. package/src/studio/public/favicon.svg +12 -0
  40. package/src/studio/public/graph.js +983 -0
  41. package/src/studio/public/index.html +71 -0
  42. package/src/studio/public/net.js +128 -0
  43. package/src/studio/public/special-gothic-latin-ext.woff2 +0 -0
  44. package/src/studio/public/special-gothic-latin.woff2 +0 -0
  45. package/src/studio/public/special-gothic-license.txt +93 -0
  46. package/src/studio/public/style.css +1334 -0
  47. package/src/studio/public/tables.js +1223 -0
  48. package/src/studio/public/tools.js +578 -0
  49. package/src/studio/server.ts +219 -0
  50. package/templates/project/AGENTS.md +2 -0
  51. package/dist/chunks/index-fq57hya4.js +0 -20
  52. package/dist/chunks/studio-femhydvd.js +0 -764
  53. package/src/cli/studio-page.ts +0 -876
  54. package/src/cli/studio.ts +0 -126
package/dist/index.js CHANGED
@@ -1,13 +1,12 @@
1
1
  import {
2
- contains,
3
- familyOf,
4
- host,
5
- isAddress,
6
- isCidr,
7
- isGlobal,
8
- network
9
- } from "./chunks/index-dczpxzzm.js";
10
- import"./chunks/index-fq57hya4.js";
2
+ familyOf2,
3
+ isAddress2,
4
+ isCidr2,
5
+ network,
6
+ contains2,
7
+ host2,
8
+ isGlobal2
9
+ } from "./chunks/index-v8zgr7wm.js";
11
10
 
12
11
  // src/core/define.ts
13
12
  var secret = (name) => ({ secret: name });
@@ -19,7 +18,7 @@ var secretFile = (path) => {
19
18
  function defineDevice(device) {
20
19
  return device;
21
20
  }
22
- var defineNetwork = (network2) => network2;
21
+ var defineNetwork = (network) => network;
23
22
  // src/core/merge.ts
24
23
  function merge(...records) {
25
24
  const result = {};
@@ -33,16 +32,16 @@ function merge(...records) {
33
32
  return result;
34
33
  }
35
34
  export {
36
- secretFile,
37
- secret,
38
- network as prefixOf,
39
- merge,
40
- isGlobal,
41
- isCidr,
42
- isAddress,
43
- host,
44
- familyOf,
45
- defineNetwork,
35
+ contains2 as contains,
46
36
  defineDevice,
47
- contains
37
+ defineNetwork,
38
+ familyOf2 as familyOf,
39
+ host2 as host,
40
+ isAddress2 as isAddress,
41
+ isCidr2 as isCidr,
42
+ isGlobal2 as isGlobal,
43
+ merge,
44
+ network as prefixOf,
45
+ secret,
46
+ secretFile
48
47
  };
@@ -1,7 +1,6 @@
1
1
  import {
2
- contains
3
- } from "../chunks/index-dczpxzzm.js";
4
- import"../chunks/index-fq57hya4.js";
2
+ contains2
3
+ } from "../chunks/index-v8zgr7wm.js";
5
4
 
6
5
  // src/presets/index.ts
7
6
  var MARTIANS = ["127.0.0.0/8", "169.254.0.0/16", "0.0.0.0/8"];
@@ -39,7 +38,7 @@ function antiAmplification(destinations, options = {}) {
39
38
  { min: port + 1, max: 1023 }
40
39
  ];
41
40
  return destinations.flatMap((dst) => [
42
- ...(options.keep_fragments ?? []).filter((prefix) => contains(dst, prefix)).map((prefix) => ({
41
+ ...(options.keep_fragments ?? []).filter((prefix) => contains2(dst, prefix)).map((prefix) => ({
43
42
  description: `UDP fragments to ${prefix} kept`,
44
43
  match: { protocol: "udp", dst: prefix, src_port: 0 },
45
44
  action: "accept"
@@ -174,10 +173,10 @@ var tunnelsOutsideOffered = (devices) => {
174
173
  continue;
175
174
  const subnets = (iface.addresses ?? []).map((entry) => typeof entry === "string" ? entry : entry.address);
176
175
  for (const neighbor of neighborPolicies(device)) {
177
- if (!subnets.some((subnet) => contains(subnet, neighbor.address)))
176
+ if (!subnets.some((subnet) => contains2(subnet, neighbor.address)))
178
177
  continue;
179
178
  for (const prefix of offered(device, neighbor.export)) {
180
- if (contains(prefix, iface.local)) {
179
+ if (contains2(prefix, iface.local)) {
181
180
  findings.push({
182
181
  level: "error",
183
182
  device: device.name,
@@ -346,7 +345,7 @@ function internetExchange(exchange, members) {
346
345
  ]) {
347
346
  if (!address)
348
347
  continue;
349
- if (!lan || !contains(lan, address))
348
+ if (!lan || !contains2(lan, address))
350
349
  error(`${address} of ${member.name} is outside the peering LAN`);
351
350
  const holder = taken.get(address);
352
351
  if (holder)
@@ -367,19 +366,19 @@ function internetExchange(exchange, members) {
367
366
  return { ports, check };
368
367
  }
369
368
  export {
370
- vlansOf,
371
- tunnelsOutsideOffered,
372
- trustBoundary,
373
- offered,
374
- neighborPolicies,
375
- internetExchange,
376
- exportsEndInReject,
377
- communityScheme,
378
- bgpSanity,
379
- badTcpFlags,
380
- antiSpoofing,
381
- antiAmplification,
382
- PRIVATE_RANGES,
369
+ AMPLIFIERS,
383
370
  MARTIANS,
384
- AMPLIFIERS
371
+ PRIVATE_RANGES,
372
+ antiAmplification,
373
+ antiSpoofing,
374
+ badTcpFlags,
375
+ bgpSanity,
376
+ communityScheme,
377
+ exportsEndInReject,
378
+ internetExchange,
379
+ neighborPolicies,
380
+ offered,
381
+ trustBoundary,
382
+ tunnelsOutsideOffered,
383
+ vlansOf
385
384
  };
@@ -3,3 +3,5 @@ import type { Device } from "../../schema";
3
3
  export declare function lagIds(device: Device): Map<string, number>;
4
4
  /** The IPv4 networks of a port's or an interface's addresses. */
5
5
  export declare function ipv4Networks(device: Device, iface: string): string[];
6
+ /** Fields neither switch platform, VRP nor Raisecom ROS, expresses: a service's own sources or port, a user's description or keys, the IP stack's host settings, a point-to-point address, and offload per interface. */
7
+ export declare function switchUnsupported(device: Device): string[];
@@ -0,0 +1,4 @@
1
+ import type { Device } from "../schema";
2
+ import type { Finding } from "./define";
3
+ /** Every rule across devices. */
4
+ export declare function checkAcross(devices: readonly Device[]): Finding[];
@@ -14,6 +14,16 @@ export declare function isCidr(text: string): boolean;
14
14
  export declare function network(cidr: string): string;
15
15
  /** Is the address or prefix `inner` inside `outer`? */
16
16
  export declare function contains(outer: string, inner: string): boolean;
17
+ /** A number back to the address it stands for. */
18
+ export declare const formatAddress: (value: bigint, family: Family) => string;
19
+ /** The first and last address of a prefix, as numbers. */
20
+ export declare function rangeOf(cidr: string): {
21
+ first: bigint;
22
+ last: bigint;
23
+ family: Family;
24
+ };
25
+ /** The fewest prefixes that cover every address from `first` to `last` and nothing else. */
26
+ export declare function prefixesBetween(first: bigint, last: bigint, family: Family): string[];
17
27
  /** `/25` to `255.255.255.128`. */
18
28
  export declare const netmask: (length: number) => string;
19
29
  /** `/24` to `0.0.0.255`, the inverted mask some ACLs take. */
@@ -0,0 +1,46 @@
1
+ import type { Device } from "../schema";
2
+ /** One address or range in a segment, and what holds it. */
3
+ export type Use = {
4
+ /** An address, or `first-last` for a range. */
5
+ address: string;
6
+ what: string;
7
+ };
8
+ /** A prefix our devices have addresses in. */
9
+ export type Segment = {
10
+ prefix: string;
11
+ uses: Use[];
12
+ /** How many addresses no one uses, as a number written out, since an IPv6 count does not fit a JavaScript number. */
13
+ free: string;
14
+ /** The lowest free address, when there is one. */
15
+ next?: string;
16
+ };
17
+ /** A prefix in use without being a segment: a loopback's address, or a block routed elsewhere. */
18
+ export type Block = {
19
+ prefix: string;
20
+ what: string;
21
+ };
22
+ /** Space the network owns: a prefix it originates in BGP, or one asked for. Everything in use inside it, and what is free. */
23
+ export type Space = {
24
+ prefix: string;
25
+ /** Why it is listed, such as `originated by edge-01`. */
26
+ owner: string;
27
+ segments: Segment[];
28
+ blocks: Block[];
29
+ /** The fewest prefixes that cover what nothing uses. */
30
+ free: string[];
31
+ };
32
+ export type AddressReport = {
33
+ spaces: Space[];
34
+ /** What is in use outside every space. Left out when a prefix is asked for. */
35
+ elsewhere: {
36
+ segments: Segment[];
37
+ blocks: Block[];
38
+ };
39
+ };
40
+ /** Every address in use, by segment, under the space the network owns. With `within`, only what falls inside that prefix, as the one space. */
41
+ export declare function addressesOf(devices: readonly Device[], within?: string): AddressReport;
42
+ /** Free prefixes of one length inside the free space, up to `limit`, and how many there are in all. */
43
+ export declare function freeOfLength(free: readonly string[], length: number, limit: number): {
44
+ prefixes: string[];
45
+ total: bigint;
46
+ };
@@ -0,0 +1,6 @@
1
+ /** Every TypeScript file of the project, relative to its root, in name order. */
2
+ export declare function projectSources(root: string, directory?: string): string[];
3
+ /** Whether a file's text declares the device: it calls defineDevice and gives it the name, written out whole. */
4
+ export declare function declaresDevice(text: string, name: string): boolean;
5
+ /** The project files that declare the device, relative to the root. */
6
+ export declare function deviceFiles(root: string, name: string, sources?: string[]): string[];
@@ -1,4 +1,5 @@
1
- import type { Device } from "../schema";
1
+ import type { Device, Routed } from "../schema";
2
+ import type { Finding } from "./define";
2
3
  /** One view of the network. Every edge belongs to one. */
3
4
  export type Layer = "l1" | "l2" | "l3" | "bgp" | "ospf" | "tunnels";
4
5
  export declare const LAYERS: readonly Layer[];
@@ -37,7 +38,36 @@ export type Graph = {
37
38
  nodes: GraphNode[];
38
39
  edges: GraphEdge[];
39
40
  };
41
+ /** How a device compares with its last snapshot, found offline as `diff` finds it. */
42
+ export type Drift = {
43
+ status: "matches" | "differs" | "no snapshot" | "cannot plan";
44
+ /** The plan `diff` would show, when it differs. */
45
+ lines: string[];
46
+ };
47
+ /** The graph with what `validate` found and how each device drawn compares with its snapshot. */
48
+ export type Annotated = Graph & {
49
+ findings: Finding[];
50
+ /** By device name. */
51
+ drift: Record<string, Drift>;
52
+ };
53
+ /** An address one of the devices holds on a port or interface. */
54
+ export type Holder = {
55
+ device: Device;
56
+ /** The port or interface. */
57
+ name: string;
58
+ /** With its length. */
59
+ address: string;
60
+ /** The far end of a point-to-point address. */
61
+ peer?: string;
62
+ vrrp: NonNullable<Routed<string>["vrrp"]>;
63
+ };
40
64
  export declare const deviceId: (name: string) => string;
65
+ /** An address as a key, so two spellings of one address compare equal. Undefined when it is not an address. */
66
+ export declare function keyOf(address: string | undefined): string | undefined;
67
+ /** Ports, then interfaces, that can hold an address. */
68
+ export declare function routedOf(device: Device): [string, Routed<string>][];
69
+ /** Every valid address the devices hold. An invalid one is left for `validate` to report. */
70
+ export declare function holdersOf(devices: readonly Device[]): Holder[];
41
71
  /** The network as a graph. It reads the config only, never a device, and works on a config that does not validate. */
42
72
  export declare function graphOf(devices: readonly Device[]): Graph;
43
73
  /** Only the edges on these layers, and among those only the ones that touch these devices when any are named. Every device named stays. */
@@ -0,0 +1,16 @@
1
+ /** The schema files in reading order, with the title each gets. */
2
+ export declare const SCHEMA_FILES: readonly [readonly ["device.ts", "Device"], readonly ["interfaces.ts", "Ports and interfaces"], readonly ["routing.ts", "Routing"], readonly ["policy.ts", "Route policies"], readonly ["firewall.ts", "Firewall and ACLs"], readonly ["system.ts", "System and management"], readonly ["common.ts", "Common values"]];
3
+ export type Field = {
4
+ path: string;
5
+ type: string;
6
+ description: string;
7
+ };
8
+ export type TypeDoc = {
9
+ name: string;
10
+ description: string;
11
+ definition?: string;
12
+ includes?: string[];
13
+ fields: Field[];
14
+ };
15
+ /** Every type in each schema file, in the order given. Every file is read first, so a type is known to take parameters wherever it is used. */
16
+ export declare function schemaTypes(sources: readonly string[]): TypeDoc[][];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takodotid/circuit",
3
- "version": "0.19.0",
3
+ "version": "0.21.0",
4
4
  "description": "Declarative, vendor-neutral network configuration: describe each device in TypeScript, and Circuit makes the device match. Alpha.",
5
5
  "keywords": [
6
6
  "network",
@@ -86,14 +86,14 @@
86
86
  "ssh2": "^1.17.0"
87
87
  },
88
88
  "devDependencies": {
89
- "@commitlint/cli": "^19.5.0",
90
- "@commitlint/config-conventional": "^19.5.0",
89
+ "@commitlint/cli": "^19.8.1",
90
+ "@commitlint/config-conventional": "^19.8.1",
91
91
  "@types/bun": "^1.4.2",
92
- "@types/node": "^24",
93
- "husky": "^9.1.6",
94
- "prettier": "^3.9.9",
92
+ "@types/node": "^24.19.2",
93
+ "husky": "^9.1.7",
94
+ "prettier": "^3.9.10",
95
95
  "typescript": "^7.0.2",
96
96
  "vitepress": "^1.6.4"
97
97
  },
98
- "packageManager": "bun@1.3.5"
98
+ "packageManager": "bun@1.4.3"
99
99
  }
@@ -25,3 +25,35 @@ export function ipv4Networks(device: Device, iface: string): string[] {
25
25
 
26
26
  return addresses.filter((address) => familyOf(address) === "ipv4").map((address) => network(address));
27
27
  }
28
+
29
+ /** Services the switch platforms run. Each takes its sources from `management.allow`, on the protocol's own port. */
30
+ const SWITCH_SERVICES = ["ssh", "telnet", "snmp"] as const;
31
+
32
+ /** Fields neither switch platform, VRP nor Raisecom ROS, expresses: a service's own sources or port, a user's description or keys, the IP stack's host settings, a point-to-point address, and offload per interface. */
33
+ export function switchUnsupported(device: Device): string[] {
34
+ const found: string[] = [];
35
+
36
+ for (const service of SWITCH_SERVICES) {
37
+ const settings = device.management?.[service];
38
+ if (settings?.allow) found.push(`management.${service}.allow, every service takes management.allow`);
39
+ if (settings?.port) found.push(`management.${service}.port`);
40
+ }
41
+
42
+ for (const [name, user] of Object.entries(device.users ?? {})) {
43
+ if (user.description) found.push(`users.${name}.description`);
44
+ if (user.ssh_keys?.length) found.push(`users.${name}.ssh_keys`);
45
+ }
46
+
47
+ if (device.system?.ip) found.push("system.ip");
48
+
49
+ for (const [name, port] of Object.entries(device.ports ?? {})) {
50
+ if (port?.hardware_offload !== undefined) found.push(`ports.${name}.hardware_offload`);
51
+ }
52
+
53
+ for (const [name, iface] of Object.entries(device.interfaces ?? {})) {
54
+ if (iface.addresses?.some((entry) => typeof entry !== "string")) found.push(`interfaces.${name}.addresses with a peer`);
55
+ if (iface.hardware_offload !== undefined) found.push(`interfaces.${name}.hardware_offload`);
56
+ }
57
+
58
+ return found;
59
+ }
@@ -9,7 +9,7 @@ import { offset } from "../../../core/time";
9
9
  import type { Device, Port, SnmpUser, Switched, Vrrp } from "../../../schema";
10
10
  import { connect, readUntil, send, shell } from "../../../transport/ssh";
11
11
  import { portsOf, spell } from "../catalog";
12
- import { ipv4Networks, lagIds } from "../derive";
12
+ import { ipv4Networks, lagIds, switchUnsupported } from "../derive";
13
13
  import { compare, type Dialect, entries, type Group, scrub, steps, vlanListChange } from "../lines";
14
14
  import type { DeviceAdapter, Plan, Step } from "../types";
15
15
 
@@ -387,7 +387,14 @@ export function unsupported(device: Device): string[] {
387
387
  continue;
388
388
  }
389
389
 
390
- if (iface.vrf) found.push(`interfaces.${name}.vrf`);
390
+ for (const field of ["vrf", "description", "mtu", "ipv6_ra"] as const) {
391
+ if (iface[field] !== undefined) found.push(`interfaces.${name}.${field}`);
392
+ }
393
+
394
+ for (const entry of iface.addresses ?? []) {
395
+ const address = typeof entry === "string" ? entry : entry.address;
396
+ if (familyOf(address) === "ipv6") found.push(`interfaces.${name}.addresses ${address}, only IPv4 here`);
397
+ }
391
398
 
392
399
  for (const group of iface.vrrp ?? []) {
393
400
  if (familyOf(group.address) === "ipv6") found.push(`interfaces.${name}.vrrp for IPv6`);
@@ -412,7 +419,15 @@ export function unsupported(device: Device): string[] {
412
419
  }
413
420
 
414
421
  for (const route of routing?.static ?? []) {
415
- if (!route.via || route.vrf) found.push(`routing.static ${route.prefix}, only an IPv4 next hop in the default table`);
422
+ if (!route.via || route.vrf || familyOf(route.prefix) === "ipv6") {
423
+ found.push(`routing.static ${route.prefix}, only an IPv4 next hop in the default table`);
424
+ }
425
+
426
+ if (route.description || route.distance) found.push(`routing.static ${route.prefix} description and distance`);
427
+ }
428
+
429
+ for (const [name, vlan] of Object.entries(device.vlans ?? {})) {
430
+ if (vlan.description) found.push(`vlans.${name}.description`);
416
431
  }
417
432
 
418
433
  const UNSUPPORTED_SECTIONS = [
@@ -443,6 +458,9 @@ export function unsupported(device: Device): string[] {
443
458
  found.push(`management.snmp.users.${name}.auth ${user.auth}, the platform authenticates with SHA1 or MD5`);
444
459
  }
445
460
 
461
+ if (management.snmp?.contact || management.snmp?.location) found.push("management.snmp.contact and location");
462
+ if (management.ssh?.weak_crypto) found.push("management.ssh.weak_crypto");
463
+
446
464
  if (device.lldp && device.lldp !== true) found.push("lldp.interfaces, LLDP is per device");
447
465
  if (device.stp?.mode && device.stp.mode !== "mstp") found.push("stp.mode other than mstp");
448
466
 
@@ -456,6 +474,8 @@ export function unsupported(device: Device): string[] {
456
474
  found.push("system.dns, logging, release_channel, banner and ntp.serve");
457
475
  }
458
476
 
477
+ found.push(...switchUnsupported(device));
478
+
459
479
  return found;
460
480
  }
461
481
 
@@ -99,6 +99,14 @@ export function unsupported(device: Device): string[] {
99
99
  }
100
100
  }
101
101
 
102
+ for (const [name, iface] of Object.entries(device.interfaces ?? {})) {
103
+ if (iface.type !== "lag") continue;
104
+
105
+ for (const field of ["storm_control", "stp"] as const) {
106
+ if (iface[field] !== undefined) found.push(`interfaces.${name}.${field}, on a LAG`);
107
+ }
108
+ }
109
+
102
110
  const bgp = device.routing?.bgp;
103
111
 
104
112
  for (const [name, neighbor] of Object.entries(bgp?.neighbors ?? {})) {
@@ -113,6 +121,8 @@ export function unsupported(device: Device): string[] {
113
121
  if (management?.console) found.push("management.console, the console uses the device's users");
114
122
  if (management?.privilege_password) found.push("management.privilege_password, the platform has no privileged mode");
115
123
 
124
+ if (management?.snmp?.port) found.push("management.snmp.port");
125
+
116
126
  if (management?.ssh?.auth_timeout || management?.ssh?.auth_retries) {
117
127
  found.push("management.ssh.auth_timeout and auth_retries");
118
128
  }
@@ -9,7 +9,7 @@ import { offset } from "../../../core/time";
9
9
  import type { Device, Interface, Port, Vrrp } from "../../../schema";
10
10
  import { connect, readUntil, send, shell } from "../../../transport/ssh";
11
11
  import { portsOf, spell } from "../catalog";
12
- import { ipv4Networks, lagIds } from "../derive";
12
+ import { ipv4Networks, lagIds, switchUnsupported } from "../derive";
13
13
  import { compare, type Dialect, scrub, steps, vlanListChange } from "../lines";
14
14
  import type { DeviceAdapter, Plan } from "../types";
15
15
 
@@ -608,9 +608,14 @@ export function unsupported(device: Device): string[] {
608
608
  for (const [name, iface] of Object.entries(device.interfaces ?? {})) {
609
609
  if (iface.type !== "vlan" && iface.type !== "lag") found.push(`interfaces.${name}, a ${iface.type}`);
610
610
  if (iface.type === "lag" && iface.addresses?.length) found.push(`interfaces.${name}.addresses, LAGs are switched`);
611
+ if (iface.mtu !== undefined) found.push(`interfaces.${name}.mtu`);
611
612
  for (const group of iface.vrrp ?? []) if (familyOf(group.address) === "ipv6") found.push(`interfaces.${name}.vrrp for IPv6`);
612
613
  }
613
614
 
615
+ for (const [name, vrf] of Object.entries(device.vrfs ?? {})) {
616
+ if (vrf.description) found.push(`vrfs.${name}.description`);
617
+ }
618
+
614
619
  const routing = device.routing;
615
620
  if (routing?.bgp) found.push("routing.bgp");
616
621
  if (routing?.rpki) found.push("routing.rpki");
@@ -644,6 +649,10 @@ export function unsupported(device: Device): string[] {
644
649
  found.push("system.dns, logging, release_channel and banner");
645
650
  }
646
651
 
652
+ if (system.transceiver_monitoring !== undefined) found.push("system.transceiver_monitoring");
653
+
654
+ found.push(...switchUnsupported(device));
655
+
647
656
  const flow = device.flow_export;
648
657
  if (flow && flow.protocol !== "sflow") found.push(`flow_export.protocol ${flow.protocol}, the platform exports sFlow`);
649
658
  const sampling = flow?.protocol === "sflow" ? flow.sampling : undefined;
package/src/cli/graph.ts CHANGED
@@ -1,20 +1,6 @@
1
1
  // What `circuit graph` prints: the graph of the network with what `validate` found and how each device compares with its last snapshot, as Mermaid, DOT or JSON.
2
2
 
3
- import type { Finding } from "../core/define";
4
- import { deviceId, type Graph, type GraphNode } from "../core/graph";
5
-
6
- /** How a device compares with its last snapshot, found offline as `diff` finds it. */
7
- export type Drift = {
8
- status: "matches" | "differs" | "no snapshot" | "cannot plan";
9
- /** The plan `diff` would show, when it differs. */
10
- lines: string[];
11
- };
12
-
13
- export type Annotated = Graph & {
14
- findings: Finding[];
15
- /** By device name. */
16
- drift: Record<string, Drift>;
17
- };
3
+ import { type Annotated, deviceId, type GraphNode } from "../core/graph";
18
4
 
19
5
  /** `error` when validate found an error on the device, `warning` for a warning or a difference from its snapshot. */
20
6
  export function markOf(graph: Annotated, node: GraphNode): "error" | "warning" | undefined {