@takodotid/circuit 0.25.0 → 0.26.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/README.md +7 -7
- package/dist/chunks/{index-wm9ypkjq.js → index-22sbskdx.js} +13 -5
- package/dist/chunks/{server-n2q4tzy4.js → server-1ftkqkx5.js} +1 -1
- package/dist/cli/index.js +2990 -264
- package/dist/types/adapters/devices/catalog.d.ts +14 -0
- package/dist/types/adapters/devices/fortios/firewall.d.ts +21 -0
- package/dist/types/adapters/devices/fortios/index.d.ts +55 -0
- package/dist/types/adapters/devices/fortios/models.d.ts +14 -0
- package/dist/types/adapters/devices/fortios/names.d.ts +32 -0
- package/dist/types/adapters/devices/fortios/plan.d.ts +26 -0
- package/dist/types/adapters/devices/fortios/render.d.ts +36 -0
- package/dist/types/adapters/devices/fortios/routing.d.ts +32 -0
- package/dist/types/adapters/devices/fortios/tree.d.ts +33 -0
- package/dist/types/schema/common.d.ts +1 -1
- package/dist/types/schema/device.d.ts +1 -1
- package/dist/types/schema/firewall.d.ts +3 -3
- package/dist/types/schema/interfaces.d.ts +13 -13
- package/dist/types/schema/policy.d.ts +3 -3
- package/dist/types/schema/routing.d.ts +7 -7
- package/dist/types/schema/system.d.ts +7 -7
- package/package.json +5 -2
- package/src/adapters/devices/catalog.ts +2 -1
- package/src/adapters/devices/fortios/TRAPS.md +40 -0
- package/src/adapters/devices/fortios/firewall.ts +352 -0
- package/src/adapters/devices/fortios/index.ts +800 -0
- package/src/adapters/devices/fortios/models.ts +7 -0
- package/src/adapters/devices/fortios/names.ts +78 -0
- package/src/adapters/devices/fortios/plan.ts +840 -0
- package/src/adapters/devices/fortios/render.ts +734 -0
- package/src/adapters/devices/fortios/routing.ts +444 -0
- package/src/adapters/devices/fortios/tree.ts +121 -0
- package/src/adapters/devices/index.ts +2 -1
- package/src/adapters/devices/junos/TRAPS.md +2 -2
- package/src/adapters/devices/raisecom-ros/TRAPS.md +2 -2
- package/src/adapters/devices/routeros/TRAPS.md +5 -5
- package/src/adapters/devices/vrp/TRAPS.md +4 -4
- package/src/schema/common.ts +1 -1
- package/src/schema/device.ts +1 -1
- package/src/schema/firewall.ts +3 -3
- package/src/schema/interfaces.ts +13 -13
- package/src/schema/policy.ts +3 -3
- package/src/schema/routing.ts +7 -7
- package/src/schema/system.ts +7 -7
package/README.md
CHANGED
|
@@ -10,14 +10,14 @@ Documentation: [circuit.tako.id](https://circuit.tako.id)
|
|
|
10
10
|
## What it does
|
|
11
11
|
|
|
12
12
|
- **One file per device.** VLANs, ports, addresses, routing, firewall, users and services, written in TypeScript. Your editor checks every name you refer to as you type.
|
|
13
|
-
- **The same words for every vendor.** MikroTik RouterOS 7, Huawei VRP, Raisecom ROS
|
|
14
|
-
- **The file is the whole truth.** A port, user or service the file does not mention is removed or turned off, so nothing set by hand
|
|
15
|
-
- **See every change first.** `diff` shows it offline, `apply` plans it against the live device, and nothing is sent without `--confirm`. On RouterOS and
|
|
13
|
+
- **The same words for every vendor.** MikroTik RouterOS 7, Huawei VRP, Raisecom ROS, Juniper Junos and Fortinet FortiOS each get their own commands. What a device cannot do is an error before anything is sent.
|
|
14
|
+
- **The file is the whole truth.** A port, user or service the file does not mention is removed or turned off, so nothing set by hand stays behind.
|
|
15
|
+
- **See every change first.** `diff` shows it offline, `apply` plans it against the live device, and nothing is sent without `--confirm`. On RouterOS, Junos and FortiOS, a change undoes itself if Circuit cannot log in again afterwards.
|
|
16
16
|
- **History in git.** Each device's last snapshot is kept in `.circuit/state/`, so the repository's history is the network's history.
|
|
17
17
|
- **Rules of your own.** Checks run on every change, and presets give ready-made filters, BGP policies and checks.
|
|
18
18
|
- **Secrets stay out of the repository.** They come from `.env` or 1Password, and never appear in a plan or a snapshot.
|
|
19
|
-
- **See the network.** Circuit Studio, started with `circuit studio`, draws the cables, VLANs, addresses, BGP sessions, OSPF neighbors and tunnels in your browser, and marks what is broken or differs from the device. Its tables list everything each device
|
|
20
|
-
- **Keeps the rest
|
|
19
|
+
- **See the network.** Circuit Studio, started with `circuit studio`, draws the cables, VLANs, addresses, BGP sessions, OSPF neighbors and tunnels in your browser, and marks what is broken or differs from the device. Its tables list everything each device has, for anyone who does not read TypeScript, and it can run on a server for the whole team. `circuit graph` prints the drawing as Mermaid, DOT or JSON.
|
|
20
|
+
- **Keeps the rest up to date.** Prefix lists fetched from a registry, your PeeringDB record, devices in LibreNMS, targets for Prometheus, WireGuard client configs, and your BGP communities for a looking glass.
|
|
21
21
|
- **Safe with AI agents.** Every project gets an `AGENTS.md` that tells an agent what it may run, and the last step stays yours.
|
|
22
22
|
|
|
23
23
|
<picture>
|
|
@@ -27,7 +27,7 @@ Documentation: [circuit.tako.id](https://circuit.tako.id)
|
|
|
27
27
|
|
|
28
28
|
## Circuit Academy
|
|
29
29
|
|
|
30
|
-
New to networking? [Circuit Academy](https://circuit.tako.id/academy/) teaches it from the very start, in lessons you try in the browser rather than only read: packets, addresses, switches and routers first, then VLANs, DHCP, NAT and firewalls written down in Circuit,
|
|
30
|
+
New to networking? [Circuit Academy](https://circuit.tako.id/academy/) teaches it from the very start, in lessons you try in the browser rather than only read: packets, addresses, switches and routers first, then VLANs, DHCP, NAT and firewalls written down in Circuit, BGP and an edge router of your own, and on to running a provider network. A certification is coming.
|
|
31
31
|
|
|
32
32
|
<picture>
|
|
33
33
|
<source media="(prefers-color-scheme: dark)" srcset="docs/public/screenshots/academy-dark.png">
|
|
@@ -44,7 +44,7 @@ npx @takodotid/circuit new # or: pnpm dlx @takodotid/circuit new, bunx @t
|
|
|
44
44
|
|
|
45
45
|
It asks which kind of network you have, creates a project with example devices, and installs Circuit. [Getting started](https://circuit.tako.id/guide/getting-started) walks through the first run.
|
|
46
46
|
|
|
47
|
-
Circuit supports MikroTik RouterOS 7, Huawei VRP, Raisecom ROS and
|
|
47
|
+
Circuit supports MikroTik RouterOS 7, Huawei VRP, Raisecom ROS, Juniper Junos and Fortinet FortiOS. Releases are on the [releases page](https://github.com/takodotid/circuit/releases), on npm and on GitHub Packages.
|
|
48
48
|
|
|
49
49
|
## Working on Circuit
|
|
50
50
|
|
|
@@ -12,8 +12,16 @@ import {
|
|
|
12
12
|
host2
|
|
13
13
|
} from "./index-v8zgr7wm.js";
|
|
14
14
|
|
|
15
|
-
// src/adapters/devices/
|
|
15
|
+
// src/adapters/devices/fortios/models.ts
|
|
16
16
|
var models = {
|
|
17
|
+
"FG-3700D": {
|
|
18
|
+
ports: { "40g": 4, "10g": 28, "1g": 2 },
|
|
19
|
+
spelling: { "40g": "port{n}", "10g": "port{n+4}", "1g": "mgmt{n}" }
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// src/adapters/devices/junos/models.ts
|
|
24
|
+
var models2 = {
|
|
17
25
|
"QFX5100-48S-6Q": {
|
|
18
26
|
ports: { "40g": 6, "10g": 48, "1g": 2 },
|
|
19
27
|
spelling: { "40g": "et-0/0/{n+47}", "10g": "xe-0/0/{n-1}", "1g": "em{n-1}" }
|
|
@@ -21,7 +29,7 @@ var models = {
|
|
|
21
29
|
};
|
|
22
30
|
|
|
23
31
|
// src/adapters/devices/raisecom-ros/models.ts
|
|
24
|
-
var
|
|
32
|
+
var models3 = {
|
|
25
33
|
"RAX721-C-6C48": {
|
|
26
34
|
ports: { "100g": 6, "25g": 24, "10g": 24 },
|
|
27
35
|
spelling: { "100g": "hundredgige 1/1/{n}", "25g": "twenty-fivegige 1/2/{n}", "10g": "tengigabitethernet 1/3/{n}" }
|
|
@@ -29,7 +37,7 @@ var models2 = {
|
|
|
29
37
|
};
|
|
30
38
|
|
|
31
39
|
// src/adapters/devices/routeros/models.ts
|
|
32
|
-
var
|
|
40
|
+
var models4 = {
|
|
33
41
|
"CCR2216-1G-12XS-2XQ": {
|
|
34
42
|
ports: { "100g": 2, "25g": 12, "1g": 1 },
|
|
35
43
|
spelling: { "100g": "qsfp28-{n}-1", "25g": "sfp28-{n}", "1g": "ether{n}" }
|
|
@@ -37,12 +45,12 @@ var models3 = {
|
|
|
37
45
|
};
|
|
38
46
|
|
|
39
47
|
// src/adapters/devices/vrp/models.ts
|
|
40
|
-
var
|
|
48
|
+
var models5 = {
|
|
41
49
|
"CE6855-48S6Q-HI": { ports: { "10g": 48, "40g": 6 }, spelling: { "10g": "10GE1/0/{n}", "40g": "40GE1/0/{n}" } }
|
|
42
50
|
};
|
|
43
51
|
|
|
44
52
|
// src/adapters/devices/catalog.ts
|
|
45
|
-
var catalog = { routeros:
|
|
53
|
+
var catalog = { routeros: models4, vrp: models5, "raisecom-ros": models3, junos: models2, fortios: models };
|
|
46
54
|
function portsOf(platform, model) {
|
|
47
55
|
const spec = catalog[platform]?.[model];
|
|
48
56
|
if (!spec)
|