@brunosouzas/stackledger 0.0.0-stage → 0.4.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.
Files changed (307) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +260 -2
  3. package/dist/cli.d.ts +2 -0
  4. package/dist/cli.js +97 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/control.d.ts +2 -0
  7. package/dist/control.js +22 -0
  8. package/dist/control.js.map +1 -0
  9. package/dist/discover-command.d.ts +7 -0
  10. package/dist/discover-command.js +60 -0
  11. package/dist/discover-command.js.map +1 -0
  12. package/dist/discovery/annotations.d.ts +24 -0
  13. package/dist/discovery/annotations.js +37 -0
  14. package/dist/discovery/annotations.js.map +1 -0
  15. package/dist/discovery/host.d.ts +47 -0
  16. package/dist/discovery/host.js +56 -0
  17. package/dist/discovery/host.js.map +1 -0
  18. package/dist/discovery/index.d.ts +15 -0
  19. package/dist/discovery/index.js +30 -0
  20. package/dist/discovery/index.js.map +1 -0
  21. package/dist/discovery/machine.d.ts +14 -0
  22. package/dist/discovery/machine.js +17 -0
  23. package/dist/discovery/machine.js.map +1 -0
  24. package/dist/discovery/run.d.ts +39 -0
  25. package/dist/discovery/run.js +130 -0
  26. package/dist/discovery/run.js.map +1 -0
  27. package/dist/discovery/snapshot.d.ts +60 -0
  28. package/dist/discovery/snapshot.js +161 -0
  29. package/dist/discovery/snapshot.js.map +1 -0
  30. package/dist/discovery/sources/apps.d.ts +3 -0
  31. package/dist/discovery/sources/apps.js +136 -0
  32. package/dist/discovery/sources/apps.js.map +1 -0
  33. package/dist/discovery/sources/brew.d.ts +15 -0
  34. package/dist/discovery/sources/brew.js +69 -0
  35. package/dist/discovery/sources/brew.js.map +1 -0
  36. package/dist/discovery/sources/common.d.ts +39 -0
  37. package/dist/discovery/sources/common.js +70 -0
  38. package/dist/discovery/sources/common.js.map +1 -0
  39. package/dist/discovery/sources/index.d.ts +8 -0
  40. package/dist/discovery/sources/index.js +12 -0
  41. package/dist/discovery/sources/index.js.map +1 -0
  42. package/dist/discovery/sources/launchd.d.ts +3 -0
  43. package/dist/discovery/sources/launchd.js +65 -0
  44. package/dist/discovery/sources/launchd.js.map +1 -0
  45. package/dist/discovery/sources/mas.d.ts +9 -0
  46. package/dist/discovery/sources/mas.js +25 -0
  47. package/dist/discovery/sources/mas.js.map +1 -0
  48. package/dist/discovery/sources/mise.d.ts +5 -0
  49. package/dist/discovery/sources/mise.js +64 -0
  50. package/dist/discovery/sources/mise.js.map +1 -0
  51. package/dist/discovery/sources/npm.d.ts +12 -0
  52. package/dist/discovery/sources/npm.js +34 -0
  53. package/dist/discovery/sources/npm.js.map +1 -0
  54. package/dist/discovery/sources/pipx.d.ts +4 -0
  55. package/dist/discovery/sources/pipx.js +82 -0
  56. package/dist/discovery/sources/pipx.js.map +1 -0
  57. package/dist/discovery/types.d.ts +73 -0
  58. package/dist/discovery/types.js +10 -0
  59. package/dist/discovery/types.js.map +1 -0
  60. package/dist/discovery/write.d.ts +50 -0
  61. package/dist/discovery/write.js +196 -0
  62. package/dist/discovery/write.js.map +1 -0
  63. package/dist/drift-command.d.ts +62 -0
  64. package/dist/drift-command.js +375 -0
  65. package/dist/drift-command.js.map +1 -0
  66. package/dist/drift-formats.d.ts +3 -0
  67. package/dist/drift-formats.js +54 -0
  68. package/dist/drift-formats.js.map +1 -0
  69. package/dist/drift.d.ts +95 -0
  70. package/dist/drift.js +206 -0
  71. package/dist/drift.js.map +1 -0
  72. package/dist/errors.d.ts +15 -0
  73. package/dist/errors.js +26 -0
  74. package/dist/errors.js.map +1 -0
  75. package/dist/graph.d.ts +103 -0
  76. package/dist/graph.js +181 -0
  77. package/dist/graph.js.map +1 -0
  78. package/dist/ics.d.ts +18 -0
  79. package/dist/ics.js +103 -0
  80. package/dist/ics.js.map +1 -0
  81. package/dist/identity.d.ts +18 -0
  82. package/dist/identity.js +36 -0
  83. package/dist/identity.js.map +1 -0
  84. package/dist/index.d.ts +14 -0
  85. package/dist/index.js +9 -0
  86. package/dist/index.js.map +1 -0
  87. package/dist/map/badges.d.ts +20 -0
  88. package/dist/map/badges.js +95 -0
  89. package/dist/map/badges.js.map +1 -0
  90. package/dist/map/command.d.ts +8 -0
  91. package/dist/map/command.js +86 -0
  92. package/dist/map/command.js.map +1 -0
  93. package/dist/map/heap.d.ts +15 -0
  94. package/dist/map/heap.js +57 -0
  95. package/dist/map/heap.js.map +1 -0
  96. package/dist/map/ink.d.ts +11 -0
  97. package/dist/map/ink.js +10 -0
  98. package/dist/map/ink.js.map +1 -0
  99. package/dist/map/labels.d.ts +43 -0
  100. package/dist/map/labels.js +172 -0
  101. package/dist/map/labels.js.map +1 -0
  102. package/dist/map/layout.d.ts +59 -0
  103. package/dist/map/layout.js +197 -0
  104. package/dist/map/layout.js.map +1 -0
  105. package/dist/map/model.d.ts +46 -0
  106. package/dist/map/model.js +84 -0
  107. package/dist/map/model.js.map +1 -0
  108. package/dist/map/neighbourhood.d.ts +18 -0
  109. package/dist/map/neighbourhood.js +138 -0
  110. package/dist/map/neighbourhood.js.map +1 -0
  111. package/dist/map/parallel.d.ts +21 -0
  112. package/dist/map/parallel.js +174 -0
  113. package/dist/map/parallel.js.map +1 -0
  114. package/dist/map/relations.d.ts +39 -0
  115. package/dist/map/relations.js +127 -0
  116. package/dist/map/relations.js.map +1 -0
  117. package/dist/map/route.d.ts +25 -0
  118. package/dist/map/route.js +165 -0
  119. package/dist/map/route.js.map +1 -0
  120. package/dist/map/strip.d.ts +29 -0
  121. package/dist/map/strip.js +122 -0
  122. package/dist/map/strip.js.map +1 -0
  123. package/dist/map/suggest.d.ts +21 -0
  124. package/dist/map/suggest.js +97 -0
  125. package/dist/map/suggest.js.map +1 -0
  126. package/dist/map/svg.d.ts +22 -0
  127. package/dist/map/svg.js +232 -0
  128. package/dist/map/svg.js.map +1 -0
  129. package/dist/map/themes.d.ts +61 -0
  130. package/dist/map/themes.js +78 -0
  131. package/dist/map/themes.js.map +1 -0
  132. package/dist/map/xml.d.ts +8 -0
  133. package/dist/map/xml.js +68 -0
  134. package/dist/map/xml.js.map +1 -0
  135. package/dist/map/zones.d.ts +19 -0
  136. package/dist/map/zones.js +46 -0
  137. package/dist/map/zones.js.map +1 -0
  138. package/dist/mcp.d.ts +2 -0
  139. package/dist/mcp.js +145 -0
  140. package/dist/mcp.js.map +1 -0
  141. package/dist/money.d.ts +32 -0
  142. package/dist/money.js +91 -0
  143. package/dist/money.js.map +1 -0
  144. package/dist/report-command.d.ts +3 -0
  145. package/dist/report-command.js +85 -0
  146. package/dist/report-command.js.map +1 -0
  147. package/dist/report-formats.d.ts +11 -0
  148. package/dist/report-formats.js +157 -0
  149. package/dist/report-formats.js.map +1 -0
  150. package/dist/reports.d.ts +105 -0
  151. package/dist/reports.js +247 -0
  152. package/dist/reports.js.map +1 -0
  153. package/dist/scaffold.d.ts +30 -0
  154. package/dist/scaffold.js +140 -0
  155. package/dist/scaffold.js.map +1 -0
  156. package/dist/schema.d.ts +330 -0
  157. package/dist/schema.js +116 -0
  158. package/dist/schema.js.map +1 -0
  159. package/dist/secrets.d.ts +7 -0
  160. package/dist/secrets.js +68 -0
  161. package/dist/secrets.js.map +1 -0
  162. package/dist/site/build.d.ts +22 -0
  163. package/dist/site/build.js +196 -0
  164. package/dist/site/build.js.map +1 -0
  165. package/dist/site/command.d.ts +2 -0
  166. package/dist/site/command.js +221 -0
  167. package/dist/site/command.js.map +1 -0
  168. package/dist/site/data.d.ts +205 -0
  169. package/dist/site/data.js +241 -0
  170. package/dist/site/data.js.map +1 -0
  171. package/dist/site/fs-ops.d.ts +35 -0
  172. package/dist/site/fs-ops.js +26 -0
  173. package/dist/site/fs-ops.js.map +1 -0
  174. package/dist/site/owners.d.ts +5 -0
  175. package/dist/site/owners.js +50 -0
  176. package/dist/site/owners.js.map +1 -0
  177. package/dist/site/paths.d.ts +34 -0
  178. package/dist/site/paths.js +48 -0
  179. package/dist/site/paths.js.map +1 -0
  180. package/dist/site/policy.d.ts +17 -0
  181. package/dist/site/policy.js +26 -0
  182. package/dist/site/policy.js.map +1 -0
  183. package/dist/site/publish.d.ts +14 -0
  184. package/dist/site/publish.js +90 -0
  185. package/dist/site/publish.js.map +1 -0
  186. package/dist/site/relative.d.ts +14 -0
  187. package/dist/site/relative.js +265 -0
  188. package/dist/site/relative.js.map +1 -0
  189. package/dist/site/skills-build.d.ts +22 -0
  190. package/dist/site/skills-build.js +126 -0
  191. package/dist/site/skills-build.js.map +1 -0
  192. package/dist/site/skills-data.d.ts +89 -0
  193. package/dist/site/skills-data.js +94 -0
  194. package/dist/site/skills-data.js.map +1 -0
  195. package/dist/site/staging.d.ts +19 -0
  196. package/dist/site/staging.js +76 -0
  197. package/dist/site/staging.js.map +1 -0
  198. package/dist/skills/command.d.ts +8 -0
  199. package/dist/skills/command.js +64 -0
  200. package/dist/skills/command.js.map +1 -0
  201. package/dist/skills/frontmatter.d.ts +37 -0
  202. package/dist/skills/frontmatter.js +219 -0
  203. package/dist/skills/frontmatter.js.map +1 -0
  204. package/dist/skills/graph.d.ts +39 -0
  205. package/dist/skills/graph.js +100 -0
  206. package/dist/skills/graph.js.map +1 -0
  207. package/dist/skills/ignore.d.ts +34 -0
  208. package/dist/skills/ignore.js +138 -0
  209. package/dist/skills/ignore.js.map +1 -0
  210. package/dist/skills/lines.d.ts +53 -0
  211. package/dist/skills/lines.js +221 -0
  212. package/dist/skills/lines.js.map +1 -0
  213. package/dist/skills/map-command.d.ts +28 -0
  214. package/dist/skills/map-command.js +533 -0
  215. package/dist/skills/map-command.js.map +1 -0
  216. package/dist/skills/mermaid.d.ts +29 -0
  217. package/dist/skills/mermaid.js +261 -0
  218. package/dist/skills/mermaid.js.map +1 -0
  219. package/dist/skills/metro.d.ts +8 -0
  220. package/dist/skills/metro.js +93 -0
  221. package/dist/skills/metro.js.map +1 -0
  222. package/dist/skills/read.d.ts +17 -0
  223. package/dist/skills/read.js +54 -0
  224. package/dist/skills/read.js.map +1 -0
  225. package/dist/skills/rules.d.ts +28 -0
  226. package/dist/skills/rules.js +57 -0
  227. package/dist/skills/rules.js.map +1 -0
  228. package/dist/skills/source.d.ts +66 -0
  229. package/dist/skills/source.js +281 -0
  230. package/dist/skills/source.js.map +1 -0
  231. package/dist/skills/walk.d.ts +64 -0
  232. package/dist/skills/walk.js +281 -0
  233. package/dist/skills/walk.js.map +1 -0
  234. package/dist/source.d.ts +40 -0
  235. package/dist/source.js +199 -0
  236. package/dist/source.js.map +1 -0
  237. package/dist/stdout.d.ts +2 -0
  238. package/dist/stdout.js +24 -0
  239. package/dist/stdout.js.map +1 -0
  240. package/dist/validate.d.ts +45 -0
  241. package/dist/validate.js +321 -0
  242. package/dist/validate.js.map +1 -0
  243. package/dist/views.d.ts +25 -0
  244. package/dist/views.js +58 -0
  245. package/dist/views.js.map +1 -0
  246. package/examples/catalogue-repository/.github/workflows/stackledger.yml +122 -0
  247. package/examples/catalogue-repository/README.md +96 -0
  248. package/examples/catalogue-repository/catalog/catalog-info.yaml +12 -0
  249. package/examples/hosting/Caddyfile +69 -0
  250. package/examples/northwind/catalog-info.yaml +680 -0
  251. package/examples/northwind/stackledger.yaml +16 -0
  252. package/examples/northwind-machine/snapshot.json +309 -0
  253. package/examples/northwind-skills/agents/builder.md +10 -0
  254. package/examples/northwind-skills/agents/reviewer.md +10 -0
  255. package/examples/northwind-skills/designer/SKILL.md +8 -0
  256. package/examples/northwind-skills/editor/SKILL.md +8 -0
  257. package/examples/northwind-skills/engineering/SKILL.md +12 -0
  258. package/examples/northwind-skills/linter/SKILL.md +8 -0
  259. package/examples/northwind-skills/linter/rules.md +5 -0
  260. package/examples/northwind-skills/publishing/SKILL.md +12 -0
  261. package/examples/northwind-skills/publishing/rules.md +5 -0
  262. package/examples/northwind-skills/spec-writer/SKILL.md +8 -0
  263. package/examples/northwind-skills/stackledger-skills.yaml +51 -0
  264. package/examples/northwind-skills/tester/SKILL.md +10 -0
  265. package/examples/northwind-skills/writer/SKILL.md +8 -0
  266. package/examples/northwind-skills/writer/rules.md +6 -0
  267. package/npm-shrinkwrap.json +4995 -0
  268. package/package.json +51 -4
  269. package/site/LICENSE-astroplate +21 -0
  270. package/site/README.md +18 -0
  271. package/site/package.json +6 -0
  272. package/site/public/favicon.svg +1 -0
  273. package/site/src/components/Footer.astro +25 -0
  274. package/site/src/components/Header.astro +35 -0
  275. package/site/src/components/Impact.astro +55 -0
  276. package/site/src/components/LinkOrText.astro +12 -0
  277. package/site/src/components/SkillItem.astro +141 -0
  278. package/site/src/components/SubNav.astro +40 -0
  279. package/site/src/components/ThemeSwitch.astro +16 -0
  280. package/site/src/components/Themed.astro +14 -0
  281. package/site/src/layouts/Base.astro +52 -0
  282. package/site/src/lib/site.ts +25 -0
  283. package/site/src/pages/[reports].astro +222 -0
  284. package/site/src/pages/agents/[file].astro +14 -0
  285. package/site/src/pages/index.astro +71 -0
  286. package/site/src/pages/journeys/[name].astro +50 -0
  287. package/site/src/pages/journeys/index.astro +37 -0
  288. package/site/src/pages/licences/[name].astro +56 -0
  289. package/site/src/pages/map/index.astro +78 -0
  290. package/site/src/pages/playbooks/[file].astro +14 -0
  291. package/site/src/pages/rules/[...rules].astro +61 -0
  292. package/site/src/pages/skill-map/[...map].astro +101 -0
  293. package/site/src/pages/skills/[...list].astro +75 -0
  294. package/site/src/pages/skills/[file].astro +14 -0
  295. package/site/src/pages/software/[name].astro +155 -0
  296. package/site/src/pages/software/index.astro +71 -0
  297. package/site/src/scripts/diagram.ts +8 -0
  298. package/site/src/scripts/links.ts +31 -0
  299. package/site/src/scripts/map.ts +133 -0
  300. package/site/src/scripts/software.ts +32 -0
  301. package/site/src/scripts/theme.ts +52 -0
  302. package/site/src/styles/base.css +470 -0
  303. package/site/src/styles/fonts.css +60 -0
  304. package/site/src/styles/override.css +1 -0
  305. package/site/src/styles/pages.css +299 -0
  306. package/site/src/styles/tokens.css +71 -0
  307. package/skills/stackledger/SKILL.md +155 -0
package/package.json CHANGED
@@ -1,6 +1,53 @@
1
1
  {
2
2
  "name": "@brunosouzas/stackledger",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.4.1",
4
+ "type": "module",
5
+ "description": "Govern your software stack and licences, drawn as a metro map",
6
+ "keywords": [
7
+ "software-catalogue",
8
+ "licences",
9
+ "backstage",
10
+ "metro-map",
11
+ "static-site",
12
+ "mcp",
13
+ "governance"
14
+ ],
15
+ "homepage": "https://github.com/brunosouzas/stackledger#readme",
16
+ "bugs": {
17
+ "url": "https://github.com/brunosouzas/stackledger/issues"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/brunosouzas/stackledger.git"
22
+ },
23
+ "license": "Apache-2.0",
24
+ "bin": {
25
+ "stackledger": "dist/cli.js"
26
+ },
27
+ "files": [
28
+ "dist",
29
+ "site",
30
+ "skills",
31
+ "examples",
32
+ "npm-shrinkwrap.json"
33
+ ],
34
+ "engines": {
35
+ "node": ">=22.12"
36
+ },
37
+ "scripts": {
38
+ "build": "tsc",
39
+ "test": "vitest run",
40
+ "test:browser": "npm run build && playwright test",
41
+ "test:perf": "vitest run --config vitest.perf.config.ts"
42
+ },
43
+ "dependencies": {
44
+ "@fontsource/heebo": "5.3.0",
45
+ "@fontsource/lato": "5.3.0",
46
+ "@fontsource/signika": "5.3.0",
47
+ "@modelcontextprotocol/sdk": "1.32.1",
48
+ "astro": "7.3.8",
49
+ "ignore": "7.0.13",
50
+ "yaml": "2.9.1",
51
+ "zod": "4.6.7"
52
+ }
53
+ }
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2023 - Present, Zeon Studio
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/site/README.md ADDED
@@ -0,0 +1,18 @@
1
+ # stackledger site
2
+
3
+ The Astro project `stackledger build` uses to make the `full` and `staff` sites. It is shipped in the
4
+ npm package and never built in place: the build copies it into a staging folder inside `--out`, writes
5
+ `src/data/site.json` (the view's SiteData, from `src/site/data.ts`), `src/data/policy.json`,
6
+ `src/styles/override.css`, `src/fonts/` and `.astro/settings.json`, and runs Astro there (see `src/site/build.ts`).
7
+
8
+ Two details keep the build inside `--out` under the Node.js permission model: `"workspaces": []` in
9
+ `package.json` makes Vite stop its search for a workspace root at the working copy instead of reading
10
+ every parent folder, and `.astro/settings.json` answers Astro's preferences so it does not read the
11
+ user's home folder.
12
+
13
+ Rules for the files here (site-security spec): no inline `<script>` or `<style>`, no `style` or
14
+ event-handler attributes, no `is:inline` or `define:vars`, page links through `href()` in
15
+ `src/lib/site.ts`, catalogue text only through `{...}` (escaped by Astro), and `set:html` only for
16
+ SVG drawn by stackledger's renderers.
17
+
18
+ The look follows brunosouzas.com, which is based on the Astroplate theme (MIT, see `LICENSE-astroplate`).
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "stackledger-site",
3
+ "private": true,
4
+ "type": "module",
5
+ "workspaces": []
6
+ }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32"><rect width="32" height="32" rx="7" fill="#000f9f"/><path d="M6 22 L13 15 L26 15" fill="none" stroke="#ffffff" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"/><circle cx="13" cy="15" r="3.5" fill="#000f9f" stroke="#ffffff" stroke-width="2.5"/></svg>
@@ -0,0 +1,25 @@
1
+ ---
2
+ // Footer from brunosouzas.com (Astroplate theme, MIT): brand and links, then the view, the
3
+ // stackledger version and the theme credit. No links to other sites (site-security): only the home
4
+ // page's configured links leave the site.
5
+ import { href, site } from '../lib/site';
6
+
7
+ interface Props {
8
+ root: string;
9
+ }
10
+ const { root } = Astro.props;
11
+ ---
12
+
13
+ <footer class="footer">
14
+ <div class="container footer-main">
15
+ <a class="navbar-brand" href={href(root, '')}>{site.title}</a>
16
+ <ul class="footer-links">
17
+ <li><a href={href(root, 'map/')}>Map</a></li>
18
+ <li><a href={href(root, 'software/')}>Software</a></li>
19
+ <li><a href={href(root, 'journeys/')}>Journeys</a></li>
20
+ </ul>
21
+ </div>
22
+ <div class="footer-bottom">
23
+ <p class="container">{site.view} view · stackledger {site.version} · Look based on the Astroplate theme (MIT)</p>
24
+ </div>
25
+ </footer>
@@ -0,0 +1,35 @@
1
+ ---
2
+ // Sticky header from brunosouzas.com (Astroplate theme, MIT): brand, the divisions, theme switch.
3
+ // The brand opens the home page; the divisions are Software (the map) and, only when the build was given a skill set,
4
+ // Skills (skills-site, Skills pages); each division's pages are in its sub-navigation (SubNav.astro).
5
+ import ThemeSwitch from './ThemeSwitch.astro';
6
+ import { href, site } from '../lib/site';
7
+
8
+ interface Props {
9
+ root: string;
10
+ current?: 'software' | 'skills';
11
+ }
12
+ const { root, current } = Astro.props;
13
+ const links = [
14
+ { key: 'software', title: 'Software', path: 'map/' },
15
+ ...('skills' in site && site.skills ? [{ key: 'skills', title: 'Skills', path: 'skills/' }] : []),
16
+ ];
17
+ ---
18
+
19
+ <header class="header">
20
+ <nav class="navbar container" aria-label="Main">
21
+ <a class="navbar-brand" href={href(root, '')}>{site.title}</a>
22
+ <ul class="navbar-nav">
23
+ {
24
+ links.map((link) => (
25
+ <li>
26
+ <a class="nav-link" href={href(root, link.path)} aria-current={link.key === current ? 'page' : undefined}>
27
+ {link.title}
28
+ </a>
29
+ </li>
30
+ ))
31
+ }
32
+ </ul>
33
+ <ThemeSwitch />
34
+ </nav>
35
+ </header>
@@ -0,0 +1,55 @@
1
+ ---
2
+ // Impact of removing an item, as the MCP impact tool computes it (catalogue-site, Impact of removal).
3
+ import LinkOrText from './LinkOrText.astro';
4
+
5
+ interface Props {
6
+ root: string;
7
+ impact: {
8
+ dependants: { ref: string; title: string; href?: string; depth: number }[];
9
+ lines: { ref: string; title: string; href?: string }[];
10
+ truncated: boolean;
11
+ };
12
+ }
13
+ const { root, impact } = Astro.props;
14
+ ---
15
+
16
+ <section aria-labelledby="impact">
17
+ <h2 id="impact">Impact of removing it</h2>
18
+ {
19
+ impact.dependants.length === 0 ? (
20
+ <p>Nothing depends on this item.</p>
21
+ ) : (
22
+ <div class="table-wrap">
23
+ <table>
24
+ <thead>
25
+ <tr>
26
+ <th scope="col">Depends on it</th>
27
+ <th scope="col">Depth</th>
28
+ </tr>
29
+ </thead>
30
+ <tbody>
31
+ {impact.dependants.map((entry) => (
32
+ <tr>
33
+ <td><LinkOrText root={root} item={entry} /></td>
34
+ <td>{entry.depth}</td>
35
+ </tr>
36
+ ))}
37
+ </tbody>
38
+ </table>
39
+ </div>
40
+ )
41
+ }
42
+ {impact.truncated && <p class="muted">The list stops at 500 items.</p>}
43
+ <h3>Journeys affected</h3>
44
+ {
45
+ impact.lines.length === 0 ? (
46
+ <p>No journey is affected.</p>
47
+ ) : (
48
+ <ul class="plain-list">
49
+ {impact.lines.map((line) => (
50
+ <li><LinkOrText root={root} item={line} /></li>
51
+ ))}
52
+ </ul>
53
+ )
54
+ }
55
+ </section>
@@ -0,0 +1,12 @@
1
+ ---
2
+ // A catalogue item or line as a link when it has a page, as plain text otherwise.
3
+ import { href } from '../lib/site';
4
+
5
+ interface Props {
6
+ root: string;
7
+ item: { title: string; href?: string | undefined };
8
+ }
9
+ const { root, item } = Astro.props;
10
+ ---
11
+
12
+ {item.href ? <a href={href(root, item.href)}>{item.title}</a> : <span>{item.title}</span>}
@@ -0,0 +1,141 @@
1
+ ---
2
+ // One skill, playbook or agent page (skills-site, Skill and playbook pages, Agent pages): kind,
3
+ // description, the relation diagram (or the number of relations over the budget), the declared
4
+ // relations as links (the diagram's text alternative), "Reached through", the skill lines that stop
5
+ // at it, its rules and its source files (paths below the skills folder, never links).
6
+ import Base from '../layouts/Base.astro';
7
+ import Themed from './Themed.astro';
8
+ import { href, rootFor } from '../lib/site';
9
+
10
+ interface Props {
11
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
+ page: any;
13
+ }
14
+ const { page } = Astro.props;
15
+ const root = rootFor(Astro.url.pathname);
16
+ const kinds: Record<string, string> = { skill: 'Skill', playbook: 'Playbook', agent: 'Agent' };
17
+ ---
18
+
19
+ <Base title={page.name} current="skills" exact={false}>
20
+ <article class="container section">
21
+ <p class="kicker"><a href={href(root, 'skills/')}>Skills</a> · {kinds[page.kind]}</p>
22
+ <h1>{page.name}</h1>
23
+ <p class="lead">{page.description}</p>
24
+
25
+ <section aria-labelledby="relations">
26
+ <h2 id="relations">Relations</h2>
27
+ {
28
+ page.diagram ? (
29
+ <div data-diagram>
30
+ <Themed light={page.diagram.light} dark={page.diagram.dark} class="diagram diagram-wide" />
31
+ </div>
32
+ ) : (
33
+ <p>This item has {page.relationCount} relations, too many to draw; the lists below hold every one.</p>
34
+ )
35
+ }
36
+ <div class="columns">
37
+ <div>
38
+ <h3>Brought in by</h3>
39
+ {
40
+ page.broughtInBy.length === 0 ? (
41
+ <p>Nothing brings it in.</p>
42
+ ) : (
43
+ <ul class="plain-list" data-brought-in-by>
44
+ {page.broughtInBy.map((item: { href: string; name: string; relation: string }) => (
45
+ <li><a href={href(root, item.href)}>{item.name}</a> <span class="muted">({item.relation})</span></li>
46
+ ))}
47
+ </ul>
48
+ )
49
+ }
50
+ </div>
51
+ <div>
52
+ <h3>Brings in</h3>
53
+ {
54
+ page.bringsIn.length === 0 ? (
55
+ <p>It brings nothing in.</p>
56
+ ) : (
57
+ <ul class="plain-list" data-brings-in>
58
+ {page.bringsIn.map((item: { href: string; name: string; relation: string }) => (
59
+ <li><a href={href(root, item.href)}>{item.name}</a> <span class="muted">({item.relation})</span></li>
60
+ ))}
61
+ </ul>
62
+ )
63
+ }
64
+ </div>
65
+ </div>
66
+ <h3>Reached through</h3>
67
+ {
68
+ page.reachedThrough.length === 0 ? (
69
+ <p>Nothing else brings it in.</p>
70
+ ) : (
71
+ <ul class="plain-list" data-reached-through>
72
+ {page.reachedThrough.map((item: { href: string; name: string; kind: string }) => (
73
+ <li><a href={href(root, item.href)}>{item.name}</a> <span class="muted">({item.kind})</span></li>
74
+ ))}
75
+ </ul>
76
+ )
77
+ }
78
+ </section>
79
+
80
+ <section aria-labelledby="lines">
81
+ <h2 id="lines">Skill lines</h2>
82
+ {
83
+ page.lines.length === 0 ? (
84
+ <p>No skill line stops here.</p>
85
+ ) : (
86
+ <ul class="line-chips" data-lines>
87
+ {page.lines.map((line: { badgeSvg: string; title: string }) => (
88
+ <li><a class="btn" href={href(root, 'skill-map/')}><span class="badge" set:html={line.badgeSvg} />{line.title}</a></li>
89
+ ))}
90
+ </ul>
91
+ )
92
+ }
93
+ </section>
94
+
95
+ {
96
+ page.kind !== 'agent' && (
97
+ <section aria-labelledby="rules">
98
+ <h2 id="rules">Rules</h2>
99
+ {page.rules.length === 0 ? (
100
+ <p>No rules.</p>
101
+ ) : (
102
+ <div class="table-wrap">
103
+ <table data-rules>
104
+ <thead>
105
+ <tr>
106
+ <th scope="col">ID</th>
107
+ <th scope="col">Group</th>
108
+ <th scope="col">Rule</th>
109
+ <th scope="col">Why</th>
110
+ <th scope="col">Check</th>
111
+ </tr>
112
+ </thead>
113
+ <tbody>
114
+ {page.rules.map((rule: { id: string; group: string; text: string; why: string; check: string }) => (
115
+ <tr>
116
+ <td><code>{rule.id}</code></td>
117
+ <td>{rule.group}</td>
118
+ <td>{rule.text}</td>
119
+ <td>{rule.why}</td>
120
+ <td>{rule.check}</td>
121
+ </tr>
122
+ ))}
123
+ </tbody>
124
+ </table>
125
+ </div>
126
+ )}
127
+ </section>
128
+ )
129
+ }
130
+
131
+ <section aria-labelledby="files">
132
+ <h2 id="files">Source files</h2>
133
+ <ul class="plain-list" data-files>
134
+ {page.files.map((file: string) => <li><code>{file}</code></li>)}
135
+ </ul>
136
+ </section>
137
+ </article>
138
+ <script>
139
+ import '../scripts/diagram.ts';
140
+ </script>
141
+ </Base>
@@ -0,0 +1,40 @@
1
+ ---
2
+ // Sub-navigation of a division (catalogue-site, Layout; skills-site, Skills sub-navigation): the
3
+ // Software division's Map, List, Journeys and (full site) Reports; the Skills division's List, Map
4
+ // and Rules. The page itself is marked with aria-current; an item page marks nothing.
5
+ import { href, site, type Page } from '../lib/site';
6
+
7
+ interface Props {
8
+ root: string;
9
+ current: Page;
10
+ exact: boolean;
11
+ }
12
+ const { root, current, exact } = Astro.props;
13
+ const software = [
14
+ { key: 'map', title: 'Map', path: 'map/' },
15
+ { key: 'software', title: 'List', path: 'software/' },
16
+ { key: 'journeys', title: 'Journeys', path: 'journeys/' },
17
+ ...('report' in site ? [{ key: 'reports', title: 'Reports', path: 'reports/' }] : []),
18
+ ];
19
+ const skills = [
20
+ { key: 'skills', title: 'List', path: 'skills/' },
21
+ { key: 'skill-map', title: 'Map', path: 'skill-map/' },
22
+ { key: 'rules', title: 'Rules', path: 'rules/' },
23
+ ];
24
+ const links = ['skills', 'skill-map', 'rules'].includes(current) ? skills : software;
25
+ const label = links === skills ? 'Skills' : 'Software';
26
+ ---
27
+
28
+ <nav class="sub-nav container" aria-label={label}>
29
+ <ul>
30
+ {
31
+ links.map((link) => (
32
+ <li>
33
+ <a class="sub-link" href={href(root, link.path)} aria-current={exact && link.key === current ? 'page' : undefined}>
34
+ {link.title}
35
+ </a>
36
+ </li>
37
+ ))
38
+ }
39
+ </ul>
40
+ </nav>
@@ -0,0 +1,16 @@
1
+ ---
2
+ // Light/dark switch, after Astroplate's ThemeSwitcher (MIT). Hidden without JavaScript, where the
3
+ // page simply follows prefers-color-scheme; src/scripts/theme.ts shows it and remembers the choice.
4
+ ---
5
+
6
+ <button type="button" class="theme-switch" role="switch" aria-checked="false" aria-label="Dark theme" data-theme-switch hidden>
7
+ <span class="theme-switch-knob" aria-hidden="true">
8
+ <svg class="icon-sun" viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round">
9
+ <circle cx="12" cy="12" r="4.5" fill="#ffffff"></circle>
10
+ <path d="M12 1.5v2.5M12 20v2.5M1.5 12H4M20 12h2.5M4.6 4.6l1.8 1.8M17.6 17.6l1.8 1.8M4.6 19.4l1.8-1.8M17.6 6.4l1.8-1.8"></path>
11
+ </svg>
12
+ <svg class="icon-moon" viewBox="0 0 24 24" width="16" height="16">
13
+ <path fill="#040404" d="M8.2 2.2c1-.4 2 .6 1.6 1.5-1 3-.4 6.4 1.8 8.7a8.4 8.4 0 0 0 8.7 1.8c1-.3 2 .5 1.5 1.5v.1a10.3 10.3 0 0 1-9.4 6.2A10.3 10.3 0 0 1 3.2 6.7c1-2 2.9-3.5 4.9-4.4Z"></path>
14
+ </svg>
15
+ </span>
16
+ </button>
@@ -0,0 +1,14 @@
1
+ ---
2
+ // One stackledger-rendered SVG per theme; CSS shows the one that matches the page theme.
3
+ // set:html is allowed only here and for line badges: these SVGs come from src/map/*.ts, which
4
+ // escape every catalogue text themselves (site-security, Escaped catalogue text).
5
+ interface Props {
6
+ light: string;
7
+ dark: string;
8
+ class?: string;
9
+ }
10
+ const { light, dark, class: className = 'diagram' } = Astro.props;
11
+ ---
12
+
13
+ <div class={`${className} themed-light`} set:html={light} />
14
+ <div class={`${className} themed-dark`} set:html={dark} />
@@ -0,0 +1,52 @@
1
+ ---
2
+ // Shared page shell (catalogue-site, Layout): fixed CSP and noindex metas, header, main, footer.
3
+ // Structure from brunosouzas.com's Layout.astro (Astroplate theme, MIT, see LICENSE-astroplate).
4
+ // No inline code: the theme script is a bundled file, styles are imported files.
5
+ import '../styles/fonts.css';
6
+ import '../styles/tokens.css';
7
+ import '../styles/override.css';
8
+ import '../styles/base.css';
9
+ import '../styles/pages.css';
10
+ import Header from '../components/Header.astro';
11
+ import Footer from '../components/Footer.astro';
12
+ import SubNav from '../components/SubNav.astro';
13
+ import { href, policy, rootFor, site, type Page } from '../lib/site';
14
+
15
+ interface Props {
16
+ title: string;
17
+ /** The page's entry in its division's sub-navigation; `exact` false on an item page, which marks none. */
18
+ current: Page;
19
+ exact?: boolean;
20
+ }
21
+ const { title, current, exact = true } = Astro.props;
22
+ // The home page belongs to no division: no sub-navigation, nothing marked in the header, and its
23
+ // title is the site title alone (catalogue-site, Home page chrome).
24
+ const home = current === 'home';
25
+ const division = home ? undefined : ['skills', 'skill-map', 'rules'].includes(current) ? 'skills' : 'software';
26
+ const root = rootFor(Astro.url.pathname);
27
+ ---
28
+
29
+ <!doctype html>
30
+ <html lang="en">
31
+ <head>
32
+ <meta charset="utf-8" />
33
+ <meta http-equiv="Content-Security-Policy" content={policy} />
34
+ <meta name="robots" content="noindex, nofollow" />
35
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
36
+ <meta name="color-scheme" content="light dark" />
37
+ <title>{home ? site.title : `${title} | ${site.title}`}</title>
38
+ <link rel="icon" type="image/svg+xml" href={href(root, 'favicon.svg')} />
39
+ <script>
40
+ import '../scripts/theme.ts';
41
+ </script>
42
+ </head>
43
+ <body data-root={root}>
44
+ <a class="skip-link" href="#main">Skip to content</a>
45
+ <Header root={root} current={division} />
46
+ {!home && <SubNav root={root} current={current} exact={exact} />}
47
+ <main id="main">
48
+ <slot />
49
+ </main>
50
+ <Footer root={root} />
51
+ </body>
52
+ </html>
@@ -0,0 +1,25 @@
1
+ // The view's SiteData and page-link helpers, shared by every page and component.
2
+ // site.json and policy.json are written into the working copy by src/site/build.ts; the shipped
3
+ // site/ folder has neither, so it is only ever built through stackledger.
4
+ import data from '../data/site.json';
5
+ import policyText from '../data/policy.json';
6
+
7
+ // SiteData of src/site/data.ts; `skills` is there only when the build has a skill set.
8
+ // The working copy is built outside this repository, so the shape is not imported from src/: pages
9
+ // are checked by the build tests (test/integration/site-skills.test.ts), not by a type check.
10
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
11
+ export const site = data as typeof data & { skills?: any };
12
+ export const policy: string = policyText;
13
+
14
+ /** '../' once per folder level of the page, so links work under any path prefix (trailingSlash 'always'). */
15
+ export function rootFor(pathname: string): string {
16
+ return '../'.repeat(pathname.split('/').filter(Boolean).length);
17
+ }
18
+
19
+ /** A link from the page at `root` to a site path such as 'software/editor/' ('' is the home page). */
20
+ export function href(root: string, path: string): string {
21
+ return root + path || './';
22
+ }
23
+
24
+ /** A page's entry in its division's sub-navigation (components/SubNav.astro). */
25
+ export type Page = 'home' | 'map' | 'software' | 'journeys' | 'reports' | 'skills' | 'skill-map' | 'rules';