@intentius/behold 0.17.0 → 0.19.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 (60) hide show
  1. package/AGENTS.md +757 -26
  2. package/LICENSE +190 -0
  3. package/README.md +251 -187
  4. package/THIRD_PARTY.md +75 -0
  5. package/demos.json +80 -9
  6. package/dist/cli.js +5479 -1673
  7. package/example-argo-estate/package-lock.json +6 -6
  8. package/example-carve/app/package-lock.json +3 -3
  9. package/example-choudoufu-estate/.behold.json +8 -0
  10. package/example-choudoufu-estate/README.md +48 -0
  11. package/example-choudoufu-estate/monolith/behaviour.live.json +495 -0
  12. package/example-choudoufu-estate/monolith/carve.json +12 -0
  13. package/example-choudoufu-estate/monolith/main.tf +127 -0
  14. package/example-choudoufu-estate/scripts/choudoufu-down.sh +8 -0
  15. package/example-choudoufu-estate/scripts/choudoufu-up.sh +62 -0
  16. package/example-choudoufu-estate/team-a/behaviour.live.json +179 -0
  17. package/example-choudoufu-estate/team-a/main.tf +58 -0
  18. package/example-choudoufu-estate/team-b/behaviour.live.json +179 -0
  19. package/example-choudoufu-estate/team-b/main.tf +73 -0
  20. package/example-choudoufu-estate/team-c/behaviour.live.json +179 -0
  21. package/example-choudoufu-estate/team-c/main.tf +51 -0
  22. package/example-flux-estate/package-lock.json +6 -6
  23. package/example-k8s/package-lock.json +6 -6
  24. package/example-terraform-estate/README.md +109 -0
  25. package/example-terraform-estate/backends/backend.s3.tf +10 -0
  26. package/example-terraform-estate/envs/dev/README.md +5 -0
  27. package/example-terraform-estate/envs/prod/data.tf +18 -0
  28. package/example-terraform-estate/envs/prod/network.tf +80 -0
  29. package/example-terraform-estate/envs/prod/outputs.tf +13 -0
  30. package/example-terraform-estate/envs/prod/provider.tf +10 -0
  31. package/example-terraform-estate/envs/prod/services.tf +21 -0
  32. package/example-terraform-estate/envs/prod/storage.tf +31 -0
  33. package/example-terraform-estate/envs/prod/variables.tf +17 -0
  34. package/example-terraform-estate/envs/prod/versions.tf +10 -0
  35. package/example-terraform-estate/modules/service/main.tf +58 -0
  36. package/example-terraform-estate/modules/service/outputs.tf +7 -0
  37. package/example-terraform-estate/modules/service/variables.tf +16 -0
  38. package/example-terraform-estate/modules/service/versions.tf +10 -0
  39. package/example-terraform-estate/platform/iam.tf +40 -0
  40. package/example-terraform-estate/platform/kms.tf +16 -0
  41. package/example-terraform-estate/platform/outputs.tf +7 -0
  42. package/example-terraform-estate/platform/variables.tf +10 -0
  43. package/example-terraform-estate/platform/versions.tf +10 -0
  44. package/example-writes/package-lock.json +3 -3
  45. package/licenses/cncf-artwork-LICENSE.md +13 -0
  46. package/licenses/iTerm2-Color-Schemes-LICENSE +31 -0
  47. package/licenses/kubernetes-icons-LICENSE +201 -0
  48. package/package.json +25 -7
  49. package/web/app.js +1309 -41
  50. package/web/behaviour-scale.js +380 -0
  51. package/web/behaviour-scale.test.js +307 -0
  52. package/web/cross-env.js +58 -0
  53. package/web/cross-env.test.js +61 -0
  54. package/web/index.html +62 -2
  55. package/web/pending.js +67 -0
  56. package/web/pending.test.js +62 -0
  57. package/web/read-cost.js +49 -0
  58. package/web/read-cost.test.js +76 -0
  59. package/web/refresh-queue.js +26 -0
  60. package/web/refresh-queue.test.js +54 -0
package/THIRD_PARTY.md ADDED
@@ -0,0 +1,75 @@
1
+ # Third-party bundled data
2
+
3
+ ## Color themes (`web/themes.js`)
4
+
5
+ The full corpus of color schemes vendored in [`web/themes.js`](./web/themes.js) is generated
6
+ from **[iTerm2-Color-Schemes](https://github.com/mbadolato/iTerm2-Color-Schemes)** (MIT) — the
7
+ collection bundled by the [Ghostty](https://ghostty.org) terminal — at a pinned commit (see the
8
+ header of `web/themes.js` for the exact revision and source URL).
9
+
10
+ The bundled license is retained verbatim at
11
+ [`licenses/iTerm2-Color-Schemes-LICENSE`](./licenses/iTerm2-Color-Schemes-LICENSE).
12
+
13
+ Individual theme families — **Catppuccin, Dracula, Nord, Gruvbox, Tokyo Night, Solarized,
14
+ Rosé Pine**, and many others — are the work of their respective authors and carry their own
15
+ licenses; iTerm2-Color-Schemes aggregates them with attribution. Nothing here is modified: the
16
+ palettes are used as published.
17
+
18
+ ## Kubernetes resource icons (`web/icons/k8s/`)
19
+
20
+ The 30 SVGs in [`web/icons/k8s/`](./web/icons/k8s) are the unlabeled resource set from
21
+ **[kubernetes/community](https://github.com/kubernetes/community)**, taken from
22
+ `icons/svg/resources/unlabeled/` at pinned revision
23
+ [`920f1d89`](https://github.com/kubernetes/community/tree/920f1d89cb3d0a7ff0591ef9223864c552f9e589/icons/svg/resources/unlabeled).
24
+ The set is dual-licensed **Apache-2.0 OR CC-BY-4.0**; behold uses it under **Apache-2.0**.
25
+ The bundled license is retained verbatim at
26
+ [`licenses/kubernetes-icons-LICENSE`](./licenses/kubernetes-icons-LICENSE).
27
+
28
+ The Kubernetes logo and name are trademarks of The Linux Foundation, used here only to
29
+ identify Kubernetes resources. behold is not affiliated with, sponsored by, or endorsed by
30
+ the Kubernetes project or The Linux Foundation.
31
+
32
+ What is modified: lightly minified, otherwise as published. The XML prolog, comments and
33
+ Inkscape editor state (`<metadata>`, `<sodipodi:namedview>`) are dropped, inter-tag whitespace
34
+ is collapsed, and `id`/`class` names are namespaced per file so several icon bodies inlined
35
+ into one document cannot collide. No geometry is touched; every path is byte-identical to
36
+ upstream. [`scripts/vendor-icons.mjs`](./scripts/vendor-icons.mjs) re-fetches the corpus at
37
+ the pinned revision, and `--check` asserts the working tree still matches it.
38
+
39
+ At render time one further step happens to the copy in memory, never to the file on disk:
40
+ [`src/icon-packs.ts`](./src/icon-packs.ts) splices each body into the graph SVG without its
41
+ root `<svg>`, so the remaining `inkscape:`/`sodipodi:` attributes — which that root declared
42
+ the namespaces for — are dropped and `xlink:href` becomes the plain SVG 2 `href`. Editor
43
+ state only; nothing that paints.
44
+
45
+ ## Flux, Argo and Helm project marks (`web/icons/cncf/`)
46
+
47
+ The three marks in [`web/icons/cncf/`](./web/icons/cncf) are the color icon variants from
48
+ **[cncf/artwork](https://github.com/cncf/artwork)** at pinned revision
49
+ [`bad6b7fd`](https://github.com/cncf/artwork/tree/bad6b7fd04344be33d79b4ad60d9ea83321d690c),
50
+ taken from `projects/flux/icon/color/`, `projects/argo/icon/color/` and
51
+ `projects/helm/icon/color/`.
52
+
53
+ cncf/artwork makes its artwork available under the **Linux Foundation trademark usage
54
+ guidelines**, retained verbatim at
55
+ [`licenses/cncf-artwork-LICENSE.md`](./licenses/cncf-artwork-LICENSE.md). behold's use is
56
+ nominative: each mark appears only on the graph node for a resource of that project, to say
57
+ which project the resource belongs to. Flux, Argo and Helm are trademarks of The Linux
58
+ Foundation, and their appearance here implies no affiliation with, sponsorship by, or
59
+ endorsement from those projects, the CNCF, or The Linux Foundation.
60
+
61
+ What is modified: the same light minification and per-file namespacing as the Kubernetes set,
62
+ described above. No geometry, no color and no proportion is altered, which is what the usage
63
+ guidelines require.
64
+
65
+ At render time the Helm mark alone is given a background, never the file on disk (#246). The
66
+ `icon/color` variants are drawn for a light ground, and the Helm one is the only mark in the
67
+ set that is line art on transparent rather than a filled badge — so at the 22px card slot it
68
+ would read against whatever the graph card happens to be, which on a dark theme is near-black.
69
+ [`src/icon-packs.ts`](./src/icon-packs.ts) therefore paints an opaque white square behind it
70
+ and scales the mark uniformly to sit inside, with clear space on all four sides. The mark's
71
+ geometry, its color and its proportions are untouched; it is placed on the ground it was
72
+ drawn for.
73
+
74
+ See [`CREDITS.md`](./CREDITS.md) for prior-art acknowledgements, including the theme engine this
75
+ one is adopted from.
package/demos.json CHANGED
@@ -5,26 +5,49 @@
5
5
  "description": "One S3 bucket + policy on a local Floci emulator — blue to green in five minutes. The default.",
6
6
  "source": "bundled",
7
7
  "dir": "example-writes",
8
- "requires": ["docker"],
9
- "serve": { "local": true, "env": "prod" }
8
+ "requires": [
9
+ "docker"
10
+ ],
11
+ "serve": {
12
+ "local": true,
13
+ "env": "prod"
14
+ }
10
15
  },
11
16
  {
12
17
  "name": "k8s",
13
18
  "description": "An nginx Deployment + Service on a throwaway k3d cluster — runtime children (Pods), field ownership, honest unobserved. Cluster persists across runs; scripts/local/local-down.sh removes it.",
14
19
  "source": "bundled",
15
20
  "dir": "example-k8s",
16
- "requires": ["docker", "k3d", "kubectl"],
21
+ "requires": [
22
+ "docker",
23
+ "k3d",
24
+ "kubectl"
25
+ ],
17
26
  "setup": "bash scripts/local/local-up.sh",
18
- "serve": { "local": true, "env": "local" }
27
+ "serve": {
28
+ "local": true,
29
+ "env": "local"
30
+ }
19
31
  },
20
32
  {
21
33
  "name": "flux-estate",
22
34
  "description": "A GitOps estate: a Flux control plane (GitRepository + Kustomizations) plus two app projects, served as one composed estate — cross-stack sourceRef edges, estate-wide drift, and the namespace join that reads app-b where the control plane's targetNamespace puts it. k3d + Flux, no cloud. scripts/estate-down.sh removes the cluster.",
23
35
  "source": "bundled",
24
36
  "dir": "example-flux-estate",
25
- "requires": ["docker", "k3d", "kubectl"],
37
+ "requires": [
38
+ "docker",
39
+ "k3d",
40
+ "kubectl"
41
+ ],
26
42
  "setup": "bash scripts/estate-up.sh",
27
- "serve": { "env": "local", "dirs": ["control-plane", "app-a", "app-b"] }
43
+ "serve": {
44
+ "env": "local",
45
+ "dirs": [
46
+ "control-plane",
47
+ "app-a",
48
+ "app-b"
49
+ ]
50
+ }
28
51
  },
29
52
  {
30
53
  "name": "argo-estate",
@@ -32,7 +55,21 @@
32
55
  "source": "bundled",
33
56
  "dir": "example-argo-estate",
34
57
  "requires": [],
35
- "serve": { "dirs": ["control-plane", "app-a", "app-b"] }
58
+ "serve": {
59
+ "dirs": [
60
+ "control-plane",
61
+ "app-a",
62
+ "app-b"
63
+ ]
64
+ }
65
+ },
66
+ {
67
+ "name": "terraform-estate",
68
+ "description": "A multi-root Terraform estate, declared only: two roots applied separately (envs/prod and platform) plus the shared module both are built on — 37 cards boxed by root, module calls expanded into their own contents, and the two look-alike versions.tf files told apart. Shows what behold does NOT infer as clearly as what it draws: platform declares the KMS key and prod reads it back by alias, and no edge is drawn between them, because both ends carry the same unresolved interpolation (#381). Needs chant's terraform lexicon beside behold, which behold does not install: npm install --no-save @intentius/chant-lexicon-terraform @cdktf/hcl2json (the refusal names the exact line). No cloud, no Docker, no terraform binary.",
69
+ "source": "bundled",
70
+ "dir": "example-terraform-estate",
71
+ "requires": [],
72
+ "serve": {}
36
73
  },
37
74
  {
38
75
  "name": "carve",
@@ -50,14 +87,48 @@
50
87
  }
51
88
  }
52
89
  },
90
+ {
91
+ "name": "choudoufu-estate",
92
+ "description": "A tag-owned estate: four choudoufu estates (an OpenTofu fork whose ownership is two AWS tags) served composed — the terralith applied to a scratch floci, three team estates whose declared resources are the monolith's (every card `owned by` it, dashed to its card), a cross-estate data-source edge, and a move plan whose `live-mv` lines you run by hand while behold previews with -dry-run and reads the receipt. A card's colour is ownership, not \"nothing changed\": attribute drift is a separate plan read, opt-in through ⌘K → \"Re-check live with plan\". Docker + choudoufu (0.16.0+, or a build from main) on PATH; provider download on first init. scripts/choudoufu-down.sh removes the container.",
93
+ "source": "bundled",
94
+ "dir": "example-choudoufu-estate",
95
+ "requires": [
96
+ "docker",
97
+ "choudoufu"
98
+ ],
99
+ "setup": "bash scripts/choudoufu-up.sh",
100
+ "serve": {
101
+ "env": "live",
102
+ "dirs": [
103
+ "monolith",
104
+ "team-a",
105
+ "team-b",
106
+ "team-c"
107
+ ],
108
+ "spawnEnv": {
109
+ "AWS_ENDPOINT_URL": "http://127.0.0.1:4650",
110
+ "AWS_ACCESS_KEY_ID": "test",
111
+ "AWS_SECRET_ACCESS_KEY": "test",
112
+ "AWS_REGION": "us-east-1"
113
+ }
114
+ }
115
+ },
53
116
  {
54
117
  "name": "fountain",
55
118
  "description": "The mature estate: self-hosted fountain (a real app) on a throwaway k3d cluster — tiers (try the ha tier picker), seams, drift, runtime Pods. Clones INTENTIUS/fountain-ops; ~5 minutes, mostly image pulls. `just down` in the clone removes the cluster.",
56
119
  "source": "git",
57
120
  "repo": "https://github.com/INTENTIUS/fountain-ops",
58
- "requires": ["docker", "k3d", "kubectl", "jq", "just"],
121
+ "requires": [
122
+ "docker",
123
+ "k3d",
124
+ "kubectl",
125
+ "jq",
126
+ "just"
127
+ ],
59
128
  "setup": "just up",
60
- "serve": { "env": "local" }
129
+ "serve": {
130
+ "env": "local"
131
+ }
61
132
  }
62
133
  ]
63
134
  }