@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
@@ -0,0 +1,101 @@
1
+ ---
2
+ // Skills map page (skills-site, Skills map page): the skills metro map in both themes, with the
3
+ // software map page's zoom, pan, line highlight and, when zones are drawn, the zone filter. The frame
4
+ // is marked data-zone-mode="list" because playbook zones overlap (scripts/map.ts). The lines and their
5
+ // stops follow the map as links: the map's text alternative.
6
+ import Base from '../../layouts/Base.astro';
7
+ import Themed from '../../components/Themed.astro';
8
+ import { href, rootFor, site } from '../../lib/site';
9
+
10
+ export function getStaticPaths() {
11
+ return site.skills ? [{ params: { map: undefined }, props: { skills: site.skills } }] : [];
12
+ }
13
+
14
+ const { skills } = Astro.props;
15
+ const root = rootFor(Astro.url.pathname);
16
+ const { lines, zones, symbols } = skills.map;
17
+ ---
18
+
19
+ <Base title="Skill map" current="skill-map">
20
+ <section class="container section">
21
+ <h1>Skill map</h1>
22
+ {
23
+ skills.map.empty ? (
24
+ <p class="lead">No skill lines yet. Add a Line to <code>stackledger-skills.yaml</code> at the top of a skills folder to draw one.</p>
25
+ ) : (
26
+ <p class="lead">Each line is a way of working through the skills; each station opens its page.</p>
27
+ )
28
+ }
29
+ <div class="map-tools" data-map-tools hidden>
30
+ <div class="map-zoom" role="group" aria-label="Zoom">
31
+ <button type="button" class="btn" data-zoom="in" aria-label="Zoom in">+</button>
32
+ <button type="button" class="btn" data-zoom="out" aria-label="Zoom out">−</button>
33
+ <button type="button" class="btn" data-zoom="reset">Reset</button>
34
+ </div>
35
+ {
36
+ zones.length > 0 && (
37
+ <label class="field map-zone">
38
+ Playbook
39
+ <select data-zone-filter>
40
+ <option value="">All playbooks</option>
41
+ {zones.map((zone: { name: string; title: string }) => <option value={zone.name}>{zone.title}</option>)}
42
+ </select>
43
+ </label>
44
+ )
45
+ }
46
+ </div>
47
+ <div class="map-frame" data-map data-zone-mode="list">
48
+ <Themed light={skills.map.light} dark={skills.map.dark} class="map-canvas" />
49
+ </div>
50
+ {
51
+ lines.length > 0 && (
52
+ <div class="map-lines" data-map-lines>
53
+ <h2 class="visually-hidden">Skill lines</h2>
54
+ <ul class="line-chips">
55
+ {lines.map((line: { ref: string; title: string; badgeSvg: string }) => (
56
+ <li>
57
+ <button type="button" class="btn" data-line={line.ref} aria-pressed="false">
58
+ <span class="badge" set:html={line.badgeSvg} />
59
+ {line.title}
60
+ </button>
61
+ </li>
62
+ ))}
63
+ </ul>
64
+ </div>
65
+ )
66
+ }
67
+ <h2 class="visually-hidden">Symbols</h2>
68
+ <ul class="map-symbols">
69
+ {
70
+ symbols.map((symbol: { light: string; dark: string; label: string }) => (
71
+ <li>
72
+ <div class="map-symbol" aria-hidden="true">
73
+ <Themed light={symbol.light} dark={symbol.dark} class="symbol" />
74
+ </div>
75
+ {symbol.label}
76
+ </li>
77
+ ))
78
+ }
79
+ </ul>
80
+ {
81
+ lines.length > 0 && (
82
+ <section aria-labelledby="stops">
83
+ <h2 id="stops">Lines and their stops</h2>
84
+ {lines.map((line: { title: string; stops: { href: string; name: string; kind: string }[] }) => (
85
+ <>
86
+ <h3>{line.title}</h3>
87
+ <ol class="plain-list">
88
+ {line.stops.map((stop) => (
89
+ <li><a href={href(root, stop.href)}>{stop.name}</a> <span class="muted">({stop.kind})</span></li>
90
+ ))}
91
+ </ol>
92
+ </>
93
+ ))}
94
+ </section>
95
+ )
96
+ }
97
+ </section>
98
+ <script>
99
+ import '../../scripts/map.ts';
100
+ </script>
101
+ </Base>
@@ -0,0 +1,75 @@
1
+ ---
2
+ // Skills list (skills-site, Skills list): counts and one table of every skill, playbook and agent,
3
+ // sorted by name then kind. The route is a rest parameter so it gives /skills/ only when the build
4
+ // has a skill set; search and the kind filter reuse the software list's script on this table.
5
+ import Base from '../../layouts/Base.astro';
6
+ import { href, rootFor, site } from '../../lib/site';
7
+
8
+ export function getStaticPaths() {
9
+ return site.skills ? [{ params: { list: undefined }, props: { skills: site.skills } }] : [];
10
+ }
11
+
12
+ const { skills } = Astro.props;
13
+ const root = rootFor(Astro.url.pathname);
14
+ const plural = (count: number, word: string) => `${count} ${count === 1 ? word : `${word}s`}`;
15
+ ---
16
+
17
+ <Base title="Skills" current="skills">
18
+ <section class="container section">
19
+ <h1>Skills</h1>
20
+ <p class="lead">
21
+ {plural(skills.counts.skills, 'skill')}, {plural(skills.counts.playbooks, 'playbook')}, {plural(skills.counts.agents, 'agent')} and
22
+ {plural(skills.counts.rules, 'rule')}, as an agent would load them.
23
+ </p>
24
+ {
25
+ skills.rows.length === 0 ? (
26
+ <p>No skills: no skill folder or agent file passed its checks. Run <code>stackledger skills validate</code> on the skills folders.</p>
27
+ ) : (
28
+ <>
29
+ <div class="list-tools" data-list-tools hidden>
30
+ <label class="field list-search">
31
+ Search
32
+ <input type="search" data-search autocomplete="off" placeholder="Name, description…" />
33
+ </label>
34
+ <label class="field">
35
+ Kind
36
+ <select data-filter="kind">
37
+ <option value="">All</option>
38
+ <option value="skill">skill</option>
39
+ <option value="playbook">playbook</option>
40
+ <option value="agent">agent</option>
41
+ </select>
42
+ </label>
43
+ </div>
44
+ <p class="muted" data-count aria-live="polite" />
45
+ <div class="table-wrap">
46
+ <table data-software>
47
+ <thead>
48
+ <tr>
49
+ <th scope="col">Name</th>
50
+ <th scope="col">Kind</th>
51
+ <th scope="col">Description</th>
52
+ <th scope="col">Rules</th>
53
+ </tr>
54
+ </thead>
55
+ <tbody>
56
+ {skills.rows.map((row: { href: string; name: string; kind: string; description: string; rules: number }) => (
57
+ <tr>
58
+ <td data-column="name"><a href={href(root, row.href)}>{row.name}</a></td>
59
+ <td data-column="kind">{row.kind}</td>
60
+ <td data-column="description">{row.description}</td>
61
+ <td data-column="rules">{row.rules}</td>
62
+ </tr>
63
+ ))}
64
+ </tbody>
65
+ </table>
66
+ </div>
67
+ <p class="no-match" data-no-match hidden>No item matches.</p>
68
+ </>
69
+ )
70
+ }
71
+ </section>
72
+ <script>
73
+ import '../../scripts/software.ts';
74
+ </script>
75
+ </Base>
@@ -0,0 +1,14 @@
1
+ ---
2
+ // Skill pages (skills-site): one per skill of the skill set, at its page file name; none without a skill set.
3
+ import SkillItem from '../../components/SkillItem.astro';
4
+ import { site } from '../../lib/site';
5
+
6
+ export function getStaticPaths() {
7
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
8
+ return (site.skills?.items ?? []).filter((page: any) => page.kind === 'skill').map((page: any) => ({ params: { file: page.file }, props: { page } }));
9
+ }
10
+
11
+ const { page } = Astro.props;
12
+ ---
13
+
14
+ <SkillItem page={page} />
@@ -0,0 +1,155 @@
1
+ ---
2
+ // Component page (catalogue-site, Component page): fields of the view, licences, journeys,
3
+ // neighbourhood diagram with its text alternative, impact of removal and unresolved references.
4
+ import Base from '../../layouts/Base.astro';
5
+ import Impact from '../../components/Impact.astro';
6
+ import LinkOrText from '../../components/LinkOrText.astro';
7
+ import Themed from '../../components/Themed.astro';
8
+ import { href, rootFor, site } from '../../lib/site';
9
+
10
+ export function getStaticPaths() {
11
+ return site.components.map((page) => ({ params: { name: page.slug }, props: { page } }));
12
+ }
13
+
14
+ const { page } = Astro.props;
15
+ const root = rootFor(Astro.url.pathname);
16
+ const near = page.neighbourhood;
17
+ ---
18
+
19
+ <Base title={page.title} current="software" exact={false}>
20
+ <article class="container section">
21
+ <p class="kicker">Component</p>
22
+ <h1>{page.title}</h1>
23
+ {page.description && <p class="lead">{page.description}</p>}
24
+ <div class="item-grid">
25
+ <section class="card" aria-labelledby="details">
26
+ <h2 id="details" class="card-title">Details</h2>
27
+ <dl class="fields">
28
+ <dt>Name</dt>
29
+ <dd><code>{page.name}</code></dd>
30
+ <dt>Type</dt>
31
+ <dd>{page.type}</dd>
32
+ <dt>Lifecycle</dt>
33
+ <dd>{page.lifecycle}</dd>
34
+ <dt>Owner</dt>
35
+ <dd>{page.owner}</dd>
36
+ <dt>Zone</dt>
37
+ <dd>{page.zone ?? 'None'}</dd>
38
+ <dt>Tags</dt>
39
+ <dd>
40
+ {
41
+ page.tags.length ? (
42
+ <ul class="tags">
43
+ {page.tags.map((tag) => <li>{tag}</li>)}
44
+ </ul>
45
+ ) : (
46
+ 'None'
47
+ )
48
+ }
49
+ </dd>
50
+ </dl>
51
+ </section>
52
+ <section class="card" aria-labelledby="journeys">
53
+ <h2 id="journeys" class="card-title">Journeys</h2>
54
+ {
55
+ page.journeys.length === 0 ? (
56
+ <p>No journey stops here.</p>
57
+ ) : (
58
+ <ul class="plain-list">
59
+ {page.journeys.map((line) => (
60
+ <li>
61
+ <LinkOrText root={root} item={line} />
62
+ {!line.href && <span class="muted"> (not drawn)</span>}
63
+ </li>
64
+ ))}
65
+ </ul>
66
+ )
67
+ }
68
+ </section>
69
+ </div>
70
+
71
+ <section aria-labelledby="licences">
72
+ <h2 id="licences">Licences</h2>
73
+ {
74
+ page.licences.length === 0 ? (
75
+ <p>No licence.</p>
76
+ ) : (
77
+ <div class="licence-cards">
78
+ {page.licences.map((licence) => (
79
+ <div class="card">
80
+ <h3 class="card-title"><a href={href(root, licence.href!)}>{licence.title}</a></h3>
81
+ {licence.fields.length > 0 && (
82
+ <dl class="fields">
83
+ {licence.fields.map((field) => (
84
+ <>
85
+ <dt>{field.label}</dt>
86
+ <dd>{field.value}</dd>
87
+ </>
88
+ ))}
89
+ </dl>
90
+ )}
91
+ </div>
92
+ ))}
93
+ </div>
94
+ )
95
+ }
96
+ </section>
97
+
98
+ <section aria-labelledby="neighbourhood">
99
+ <h2 id="neighbourhood">Neighbourhood</h2>
100
+ <div data-diagram>
101
+ <Themed light={near.light} dark={near.dark} class="diagram diagram-wide" />
102
+ </div>
103
+ <div class="columns">
104
+ <div>
105
+ <h3>Depends on</h3>
106
+ {
107
+ near.dependencies.length === 0 ? (
108
+ <p>Nothing.</p>
109
+ ) : (
110
+ <ul class="plain-list" data-dependencies>
111
+ {near.dependencies.map((item) => (
112
+ <li><LinkOrText root={root} item={item} /></li>
113
+ ))}
114
+ </ul>
115
+ )
116
+ }
117
+ </div>
118
+ <div>
119
+ <h3>Used by</h3>
120
+ {
121
+ near.dependants.length === 0 ? (
122
+ <p>Nothing.</p>
123
+ ) : (
124
+ <ul class="plain-list" data-dependants>
125
+ {near.dependants.map((item) => (
126
+ <li><LinkOrText root={root} item={item} /></li>
127
+ ))}
128
+ </ul>
129
+ )
130
+ }
131
+ </div>
132
+ </div>
133
+ </section>
134
+
135
+ <Impact root={root} impact={page.impact} />
136
+
137
+ <section aria-labelledby="unresolved">
138
+ <h2 id="unresolved">References that match nothing</h2>
139
+ {
140
+ page.unresolved.length === 0 ? (
141
+ <p>None.</p>
142
+ ) : (
143
+ <ul class="plain-list">
144
+ {page.unresolved.map((value) => (
145
+ <li><code>{value}</code></li>
146
+ ))}
147
+ </ul>
148
+ )
149
+ }
150
+ </section>
151
+ </article>
152
+ <script>
153
+ import '../../scripts/diagram.ts';
154
+ </script>
155
+ </Base>
@@ -0,0 +1,71 @@
1
+ ---
2
+ // Software list (catalogue-site, Software list): every served component and licence, sorted by
3
+ // reference. Search and filters work on the table rows themselves; without JavaScript the full table shows.
4
+ import Base from '../../layouts/Base.astro';
5
+ import { href, rootFor, site } from '../../lib/site';
6
+
7
+ const root = rootFor(Astro.url.pathname);
8
+ const filters = [
9
+ { key: 'kind', label: 'Kind', options: site.filters.kind },
10
+ { key: 'zone', label: 'Zone', options: site.filters.zone },
11
+ { key: 'state', label: 'Lifecycle or status', options: site.filters.state },
12
+ { key: 'owner', label: 'Owner', options: site.filters.owner },
13
+ ];
14
+ ---
15
+
16
+ <Base title="Software" current="software">
17
+ <section class="container section">
18
+ <h1>Software</h1>
19
+ <p class="lead">{site.rows.length} items: components and the licences they use.</p>
20
+ <div class="list-tools" data-list-tools hidden>
21
+ <label class="field list-search">
22
+ Search
23
+ <input type="search" data-search autocomplete="off" placeholder="Name, type, owner…" />
24
+ </label>
25
+ {
26
+ filters.map((filter) => (
27
+ <label class="field">
28
+ {filter.label}
29
+ <select data-filter={filter.key}>
30
+ <option value="">All</option>
31
+ {filter.options.map((option) => <option value={option}>{option}</option>)}
32
+ </select>
33
+ </label>
34
+ ))
35
+ }
36
+ </div>
37
+ <p class="muted" data-count aria-live="polite"></p>
38
+ <div class="table-wrap">
39
+ <table data-software>
40
+ <thead>
41
+ <tr>
42
+ <th scope="col">Name</th>
43
+ <th scope="col">Kind</th>
44
+ <th scope="col">Type</th>
45
+ <th scope="col">Lifecycle or status</th>
46
+ <th scope="col">Owner</th>
47
+ <th scope="col">Zone</th>
48
+ </tr>
49
+ </thead>
50
+ <tbody>
51
+ {
52
+ site.rows.map((row) => (
53
+ <tr>
54
+ <td data-column="title"><a href={href(root, row.href)}>{row.title}</a></td>
55
+ <td data-column="kind">{row.kind}</td>
56
+ <td data-column="type">{row.type}</td>
57
+ <td data-column="state">{row.state}</td>
58
+ <td data-column="owner">{row.owner}</td>
59
+ <td data-column="zone">{row.zone}</td>
60
+ </tr>
61
+ ))
62
+ }
63
+ </tbody>
64
+ </table>
65
+ </div>
66
+ <p class="no-match" data-no-match hidden>No item matches.</p>
67
+ </section>
68
+ <script>
69
+ import '../../scripts/software.ts';
70
+ </script>
71
+ </Base>
@@ -0,0 +1,8 @@
1
+ // Component and journey pages: every box or stop of the diagram that carries data-ref opens its
2
+ // page when clicked, or focused and Enter is pressed (catalogue-site, Neighbourhood diagram).
3
+ import { makeLink, pageOf } from './links.ts';
4
+
5
+ for (const element of document.querySelectorAll<SVGElement>('[data-diagram] svg [data-ref]')) {
6
+ const url = pageOf(element.getAttribute('data-ref') ?? '');
7
+ if (url) makeLink(element, url);
8
+ }
@@ -0,0 +1,31 @@
1
+ // Shared by the map and diagram scripts: turn SVG groups with data-ref into keyboard-usable links.
2
+ // Pages are at root + 'software/<name>/', 'licences/<name>/' and 'journeys/<name>/', and the Skills
3
+ // pages at 'skills/<file>/', 'playbooks/<file>/' and 'agents/<file>/' (the ref already holds the
4
+ // page file name, lowercase ASCII, so nothing is encoded here); the root
5
+ // ('../' per folder level) comes from the body's data-root, written by the layout.
6
+
7
+ const ROOT = document.body.dataset.root ?? '';
8
+
9
+ /** The page of a catalogue reference; only components, licences and lines carry data-ref links. */
10
+ export function pageOf(ref: string): string | undefined {
11
+ const [kind, name] = ref.split(':');
12
+ if (!name) return undefined;
13
+ const folder = kind === 'component' ? 'software' : kind === 'resource' ? 'licences' : kind === 'line' ? 'journeys' : undefined;
14
+ if (folder) return `${ROOT}${folder}/${name.toLowerCase()}/`;
15
+ const skills = kind === 'skill' ? 'skills' : kind === 'playbook' ? 'playbooks' : kind === 'agent' ? 'agents' : undefined;
16
+ return skills && /^[a-z0-9_-]+$/.test(name) ? `${ROOT}${skills}/${name}/` : undefined;
17
+ }
18
+
19
+ /** Make an SVG group focusable as a link: click, or Enter while focused, opens `url`. */
20
+ export function makeLink(element: SVGElement, url: string, allowClick: () => boolean = () => true): void {
21
+ const title = element.querySelector('title')?.textContent ?? '';
22
+ element.setAttribute('tabindex', '0');
23
+ element.setAttribute('role', 'link');
24
+ if (title) element.setAttribute('aria-label', title);
25
+ element.addEventListener('click', () => {
26
+ if (allowClick()) window.location.assign(url);
27
+ });
28
+ element.addEventListener('keydown', (event) => {
29
+ if ((event as KeyboardEvent).key === 'Enter') window.location.assign(url);
30
+ });
31
+ }
@@ -0,0 +1,133 @@
1
+ // Map page (catalogue-site, Map page and Map interaction): zoom and pan by changing the SVG viewBox,
2
+ // line highlight and zone filter by toggling a class on elements with data-line and data-zone (from
3
+ // the map engine), and stations as links. Both themed copies of the map change together.
4
+ // The skills map page (skills-site, Skills map page) marks its frame with data-zone-mode="list": a
5
+ // station's data-zone is then a space-separated list of playbook page names, since zones overlap; the
6
+ // software map compares the whole value, because a software zone name may hold spaces.
7
+ import { makeLink, pageOf } from './links.ts';
8
+
9
+ const frame = document.querySelector<HTMLElement>('[data-map]');
10
+ const svgs = [...document.querySelectorAll<SVGSVGElement>('[data-map] svg')];
11
+ const DIMMED = 'is-dimmed';
12
+ const ZOOM_STEP = 1.25;
13
+ const DRAG_THRESHOLD = 4;
14
+
15
+ interface Box { x: number; y: number; w: number; h: number }
16
+
17
+ const initial: Box | undefined = (() => {
18
+ const values = svgs[0]?.getAttribute('viewBox')?.split(' ').map(Number);
19
+ return values?.length === 4 ? { x: values[0]!, y: values[1]!, w: values[2]!, h: values[3]! } : undefined;
20
+ })();
21
+ let view: Box | undefined = initial && { ...initial };
22
+
23
+ function setView(next: Box): void {
24
+ view = next;
25
+ for (const svg of svgs) svg.setAttribute('viewBox', `${next.x} ${next.y} ${next.w} ${next.h}`);
26
+ }
27
+
28
+ function zoom(factor: number): void {
29
+ if (!view || !initial) return;
30
+ const w = Math.min(initial.w * 2, Math.max(initial.w / 8, view.w / factor));
31
+ const h = w * (initial.h / initial.w);
32
+ setView({ x: view.x + (view.w - w) / 2, y: view.y + (view.h - h) / 2, w, h });
33
+ }
34
+
35
+ // Drag to pan; a drag longer than a few pixels does not count as a click on a station.
36
+ let dragged = false;
37
+ let start: { x: number; y: number; view: Box } | undefined;
38
+ frame?.addEventListener('pointerdown', (event) => {
39
+ if (!view || event.button !== 0) return;
40
+ start = { x: event.clientX, y: event.clientY, view: { ...view } };
41
+ dragged = false;
42
+ });
43
+ frame?.addEventListener('pointermove', (event) => {
44
+ if (!start) return;
45
+ const dx = event.clientX - start.x;
46
+ const dy = event.clientY - start.y;
47
+ if (!dragged && Math.hypot(dx, dy) < DRAG_THRESHOLD) return;
48
+ if (!dragged) frame.setPointerCapture(event.pointerId);
49
+ dragged = true;
50
+ const svg = svgs.find((item) => item.getBoundingClientRect().width > 0);
51
+ const scale = svg ? start.view.w / svg.getBoundingClientRect().width : 1;
52
+ setView({ ...start.view, x: start.view.x - dx * scale, y: start.view.y - dy * scale });
53
+ });
54
+ const endDrag = () => {
55
+ start = undefined;
56
+ };
57
+ frame?.addEventListener('pointerup', endDrag);
58
+ frame?.addEventListener('pointercancel', endDrag);
59
+
60
+ for (const button of document.querySelectorAll<HTMLButtonElement>('[data-zoom]')) {
61
+ button.addEventListener('click', () => {
62
+ const action = button.dataset.zoom;
63
+ if (action === 'in') zoom(ZOOM_STEP);
64
+ else if (action === 'out') zoom(1 / ZOOM_STEP);
65
+ else if (initial) setView({ ...initial });
66
+ });
67
+ }
68
+
69
+ // Highlight and zone filter: one at a time; choosing the same line again restores the map.
70
+ const lineButtons = [...document.querySelectorAll<HTMLButtonElement>('[data-map-lines] [data-line]')];
71
+ const zoneSelect = document.querySelector<HTMLSelectElement>('[data-zone-filter]');
72
+ const marked = svgs.flatMap((svg) => [...svg.querySelectorAll<SVGElement>('[data-line]')]);
73
+ const STATION = /^(component|skill|playbook|agent):/;
74
+ const isStationLike = (element: Element) => element.tagName.toLowerCase() === 'text' || STATION.test(element.getAttribute('data-ref') ?? '');
75
+ const listMode = frame?.dataset.zoneMode === 'list';
76
+ const inZoneOf = (element: Element, zone: string) => {
77
+ const value = element.getAttribute('data-zone') ?? '';
78
+ return listMode ? value.split(' ').includes(zone) : value === zone;
79
+ };
80
+ const linesOf = (element: Element) => (element.getAttribute('data-line') ?? '').split(' ').filter(Boolean);
81
+ let highlighted: string | undefined;
82
+
83
+ function clearDimming(): void {
84
+ for (const element of marked) element.classList.remove(DIMMED);
85
+ }
86
+
87
+ function highlight(line: string | undefined): void {
88
+ highlighted = line;
89
+ clearDimming();
90
+ if (zoneSelect) zoneSelect.value = '';
91
+ for (const button of lineButtons) button.setAttribute('aria-pressed', String(button.dataset.line === line));
92
+ if (!line) return;
93
+ for (const element of marked) if (!linesOf(element).includes(line)) element.classList.add(DIMMED);
94
+ }
95
+
96
+ function filterZone(zone: string): void {
97
+ highlight(undefined);
98
+ if (zoneSelect) zoneSelect.value = zone;
99
+ if (!zone) return;
100
+ const inZone = marked.filter((element) => isStationLike(element) && inZoneOf(element, zone));
101
+ const zoneLines = new Set(inZone.flatMap(linesOf));
102
+ for (const element of marked) {
103
+ const keep = isStationLike(element) ? inZoneOf(element, zone) : linesOf(element).some((line) => zoneLines.has(line));
104
+ if (!keep) element.classList.add(DIMMED);
105
+ }
106
+ }
107
+
108
+ for (const button of lineButtons) {
109
+ button.addEventListener('click', () => highlight(highlighted === button.dataset.line ? undefined : button.dataset.line));
110
+ }
111
+ zoneSelect?.addEventListener('change', () => filterZone(zoneSelect.value));
112
+
113
+ // Strokes, badges and legend entries choose their line; stations open their page.
114
+ for (const element of marked) {
115
+ if (isStationLike(element)) continue;
116
+ const [line] = linesOf(element);
117
+ element.classList.add('is-choosable');
118
+ element.addEventListener('click', () => {
119
+ if (!dragged && line) highlight(highlighted === line ? undefined : line);
120
+ });
121
+ }
122
+ for (const svg of svgs) {
123
+ for (const station of [...svg.querySelectorAll<SVGElement>('[data-ref]')].filter((element) => STATION.test(element.getAttribute('data-ref') ?? ''))) {
124
+ const url = pageOf(station.getAttribute('data-ref') ?? '');
125
+ if (url) makeLink(station, url, () => !dragged);
126
+ }
127
+ }
128
+
129
+ for (const selector of ['[data-map-tools]', '[data-map-lines]']) {
130
+ const element = document.querySelector<HTMLElement>(selector);
131
+ if (element) element.hidden = false;
132
+ }
133
+ frame?.classList.add('is-interactive');
@@ -0,0 +1,32 @@
1
+ // Software list: search and filters hide rows of the table itself (catalogue-site, Software list).
2
+ // Search ignores case and looks only at the shown cells; each filter must equal its cell's text.
3
+ const table = document.querySelector<HTMLTableElement>('[data-software]');
4
+ const tools = document.querySelector<HTMLElement>('[data-list-tools]');
5
+ const search = document.querySelector<HTMLInputElement>('[data-search]');
6
+ const filters = [...document.querySelectorAll<HTMLSelectElement>('[data-filter]')];
7
+ const count = document.querySelector<HTMLElement>('[data-count]');
8
+ const noMatch = document.querySelector<HTMLElement>('[data-no-match]');
9
+
10
+ function cellText(row: HTMLTableRowElement, column: string): string {
11
+ return row.querySelector(`[data-column="${column}"]`)?.textContent?.trim() ?? '';
12
+ }
13
+
14
+ function apply(): void {
15
+ if (!table) return;
16
+ const query = (search?.value ?? '').trim().toLowerCase();
17
+ const rows = [...table.tBodies[0]!.rows];
18
+ let shown = 0;
19
+ for (const row of rows) {
20
+ const matchesQuery = !query || [...row.cells].some((cell) => (cell.textContent ?? '').toLowerCase().includes(query));
21
+ const matchesFilters = filters.every((filter) => !filter.value || cellText(row, filter.dataset.filter ?? '') === filter.value);
22
+ row.hidden = !(matchesQuery && matchesFilters);
23
+ if (!row.hidden) shown++;
24
+ }
25
+ if (noMatch) noMatch.hidden = shown > 0;
26
+ if (count) count.textContent = shown === rows.length ? '' : `${shown} of ${rows.length} items shown.`;
27
+ }
28
+
29
+ if (tools) tools.hidden = false;
30
+ search?.addEventListener('input', apply);
31
+ for (const filter of filters) filter.addEventListener('change', apply);
32
+ apply();