@brunosouzas/stackledger 0.0.0-stage → 0.5.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 (323) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +261 -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 +64 -0
  103. package/dist/map/layout.js +228 -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 +137 -0
  110. package/dist/map/neighbourhood.js.map +1 -0
  111. package/dist/map/parallel.d.ts +35 -0
  112. package/dist/map/parallel.js +261 -0
  113. package/dist/map/parallel.js.map +1 -0
  114. package/dist/map/pieces.d.ts +12 -0
  115. package/dist/map/pieces.js +15 -0
  116. package/dist/map/pieces.js.map +1 -0
  117. package/dist/map/relations.d.ts +39 -0
  118. package/dist/map/relations.js +122 -0
  119. package/dist/map/relations.js.map +1 -0
  120. package/dist/map/route.d.ts +25 -0
  121. package/dist/map/route.js +165 -0
  122. package/dist/map/route.js.map +1 -0
  123. package/dist/map/strip.d.ts +29 -0
  124. package/dist/map/strip.js +120 -0
  125. package/dist/map/strip.js.map +1 -0
  126. package/dist/map/suggest.d.ts +21 -0
  127. package/dist/map/suggest.js +97 -0
  128. package/dist/map/suggest.js.map +1 -0
  129. package/dist/map/svg.d.ts +29 -0
  130. package/dist/map/svg.js +203 -0
  131. package/dist/map/svg.js.map +1 -0
  132. package/dist/map/themes.d.ts +64 -0
  133. package/dist/map/themes.js +94 -0
  134. package/dist/map/themes.js.map +1 -0
  135. package/dist/map/xml.d.ts +6 -0
  136. package/dist/map/xml.js +57 -0
  137. package/dist/map/xml.js.map +1 -0
  138. package/dist/map/zones.d.ts +19 -0
  139. package/dist/map/zones.js +46 -0
  140. package/dist/map/zones.js.map +1 -0
  141. package/dist/mcp.d.ts +2 -0
  142. package/dist/mcp.js +145 -0
  143. package/dist/mcp.js.map +1 -0
  144. package/dist/money.d.ts +32 -0
  145. package/dist/money.js +91 -0
  146. package/dist/money.js.map +1 -0
  147. package/dist/report-command.d.ts +3 -0
  148. package/dist/report-command.js +85 -0
  149. package/dist/report-command.js.map +1 -0
  150. package/dist/report-formats.d.ts +11 -0
  151. package/dist/report-formats.js +157 -0
  152. package/dist/report-formats.js.map +1 -0
  153. package/dist/reports.d.ts +105 -0
  154. package/dist/reports.js +247 -0
  155. package/dist/reports.js.map +1 -0
  156. package/dist/scaffold.d.ts +30 -0
  157. package/dist/scaffold.js +140 -0
  158. package/dist/scaffold.js.map +1 -0
  159. package/dist/schema.d.ts +345 -0
  160. package/dist/schema.js +120 -0
  161. package/dist/schema.js.map +1 -0
  162. package/dist/secrets.d.ts +7 -0
  163. package/dist/secrets.js +68 -0
  164. package/dist/secrets.js.map +1 -0
  165. package/dist/site/build.d.ts +22 -0
  166. package/dist/site/build.js +198 -0
  167. package/dist/site/build.js.map +1 -0
  168. package/dist/site/command.d.ts +2 -0
  169. package/dist/site/command.js +221 -0
  170. package/dist/site/command.js.map +1 -0
  171. package/dist/site/data.d.ts +225 -0
  172. package/dist/site/data.js +243 -0
  173. package/dist/site/data.js.map +1 -0
  174. package/dist/site/fs-ops.d.ts +35 -0
  175. package/dist/site/fs-ops.js +26 -0
  176. package/dist/site/fs-ops.js.map +1 -0
  177. package/dist/site/owners.d.ts +5 -0
  178. package/dist/site/owners.js +50 -0
  179. package/dist/site/owners.js.map +1 -0
  180. package/dist/site/paths.d.ts +34 -0
  181. package/dist/site/paths.js +48 -0
  182. package/dist/site/paths.js.map +1 -0
  183. package/dist/site/policy.d.ts +17 -0
  184. package/dist/site/policy.js +26 -0
  185. package/dist/site/policy.js.map +1 -0
  186. package/dist/site/publish.d.ts +14 -0
  187. package/dist/site/publish.js +90 -0
  188. package/dist/site/publish.js.map +1 -0
  189. package/dist/site/relative.d.ts +14 -0
  190. package/dist/site/relative.js +265 -0
  191. package/dist/site/relative.js.map +1 -0
  192. package/dist/site/skills-build.d.ts +22 -0
  193. package/dist/site/skills-build.js +126 -0
  194. package/dist/site/skills-build.js.map +1 -0
  195. package/dist/site/skills-data.d.ts +89 -0
  196. package/dist/site/skills-data.js +94 -0
  197. package/dist/site/skills-data.js.map +1 -0
  198. package/dist/site/staging.d.ts +19 -0
  199. package/dist/site/staging.js +76 -0
  200. package/dist/site/staging.js.map +1 -0
  201. package/dist/site/ui-icons.d.ts +4 -0
  202. package/dist/site/ui-icons.js +19 -0
  203. package/dist/site/ui-icons.js.map +1 -0
  204. package/dist/skills/command.d.ts +8 -0
  205. package/dist/skills/command.js +64 -0
  206. package/dist/skills/command.js.map +1 -0
  207. package/dist/skills/frontmatter.d.ts +37 -0
  208. package/dist/skills/frontmatter.js +219 -0
  209. package/dist/skills/frontmatter.js.map +1 -0
  210. package/dist/skills/graph.d.ts +39 -0
  211. package/dist/skills/graph.js +100 -0
  212. package/dist/skills/graph.js.map +1 -0
  213. package/dist/skills/ignore.d.ts +34 -0
  214. package/dist/skills/ignore.js +138 -0
  215. package/dist/skills/ignore.js.map +1 -0
  216. package/dist/skills/lines.d.ts +53 -0
  217. package/dist/skills/lines.js +221 -0
  218. package/dist/skills/lines.js.map +1 -0
  219. package/dist/skills/map-command.d.ts +28 -0
  220. package/dist/skills/map-command.js +533 -0
  221. package/dist/skills/map-command.js.map +1 -0
  222. package/dist/skills/mermaid.d.ts +29 -0
  223. package/dist/skills/mermaid.js +261 -0
  224. package/dist/skills/mermaid.js.map +1 -0
  225. package/dist/skills/metro.d.ts +8 -0
  226. package/dist/skills/metro.js +93 -0
  227. package/dist/skills/metro.js.map +1 -0
  228. package/dist/skills/read.d.ts +17 -0
  229. package/dist/skills/read.js +54 -0
  230. package/dist/skills/read.js.map +1 -0
  231. package/dist/skills/rules.d.ts +28 -0
  232. package/dist/skills/rules.js +57 -0
  233. package/dist/skills/rules.js.map +1 -0
  234. package/dist/skills/source.d.ts +66 -0
  235. package/dist/skills/source.js +281 -0
  236. package/dist/skills/source.js.map +1 -0
  237. package/dist/skills/walk.d.ts +64 -0
  238. package/dist/skills/walk.js +281 -0
  239. package/dist/skills/walk.js.map +1 -0
  240. package/dist/source.d.ts +40 -0
  241. package/dist/source.js +199 -0
  242. package/dist/source.js.map +1 -0
  243. package/dist/stdout.d.ts +2 -0
  244. package/dist/stdout.js +24 -0
  245. package/dist/stdout.js.map +1 -0
  246. package/dist/validate.d.ts +45 -0
  247. package/dist/validate.js +321 -0
  248. package/dist/validate.js.map +1 -0
  249. package/dist/views.d.ts +25 -0
  250. package/dist/views.js +58 -0
  251. package/dist/views.js.map +1 -0
  252. package/examples/catalogue-repository/.github/workflows/stackledger.yml +122 -0
  253. package/examples/catalogue-repository/README.md +96 -0
  254. package/examples/catalogue-repository/catalog/catalog-info.yaml +12 -0
  255. package/examples/hosting/Caddyfile +69 -0
  256. package/examples/northwind/catalog-info.yaml +680 -0
  257. package/examples/northwind/stackledger.yaml +16 -0
  258. package/examples/northwind-machine/snapshot.json +309 -0
  259. package/examples/northwind-skills/agents/builder.md +10 -0
  260. package/examples/northwind-skills/agents/reviewer.md +10 -0
  261. package/examples/northwind-skills/designer/SKILL.md +8 -0
  262. package/examples/northwind-skills/editor/SKILL.md +8 -0
  263. package/examples/northwind-skills/engineering/SKILL.md +12 -0
  264. package/examples/northwind-skills/linter/SKILL.md +8 -0
  265. package/examples/northwind-skills/linter/rules.md +5 -0
  266. package/examples/northwind-skills/publishing/SKILL.md +12 -0
  267. package/examples/northwind-skills/publishing/rules.md +5 -0
  268. package/examples/northwind-skills/spec-writer/SKILL.md +8 -0
  269. package/examples/northwind-skills/stackledger-skills.yaml +51 -0
  270. package/examples/northwind-skills/tester/SKILL.md +10 -0
  271. package/examples/northwind-skills/writer/SKILL.md +8 -0
  272. package/examples/northwind-skills/writer/rules.md +6 -0
  273. package/npm-shrinkwrap.json +5016 -0
  274. package/package.json +52 -4
  275. package/site/LICENSE-astroplate +21 -0
  276. package/site/README.md +18 -0
  277. package/site/package.json +6 -0
  278. package/site/public/brand-mark-dark.svg +7 -0
  279. package/site/public/favicon.svg +6 -0
  280. package/site/public/home-banner.svg +93 -0
  281. package/site/public/link-icons/email-dark.svg +7 -0
  282. package/site/public/link-icons/email-light.svg +6 -0
  283. package/site/public/link-icons/github-dark.svg +8 -0
  284. package/site/public/link-icons/github-light.svg +7 -0
  285. package/site/public/link-icons/linkedin-dark.svg +8 -0
  286. package/site/public/link-icons/linkedin-light.svg +7 -0
  287. package/site/public/link-icons/website-dark.svg +8 -0
  288. package/site/public/link-icons/website-light.svg +7 -0
  289. package/site/src/components/Footer.astro +25 -0
  290. package/site/src/components/Header.astro +35 -0
  291. package/site/src/components/Impact.astro +55 -0
  292. package/site/src/components/LinkOrText.astro +12 -0
  293. package/site/src/components/SkillItem.astro +141 -0
  294. package/site/src/components/SubNav.astro +40 -0
  295. package/site/src/components/ThemeSwitch.astro +13 -0
  296. package/site/src/components/Themed.astro +15 -0
  297. package/site/src/layouts/Base.astro +52 -0
  298. package/site/src/lib/site.ts +25 -0
  299. package/site/src/pages/[reports].astro +222 -0
  300. package/site/src/pages/agents/[file].astro +14 -0
  301. package/site/src/pages/index.astro +72 -0
  302. package/site/src/pages/journeys/[name].astro +50 -0
  303. package/site/src/pages/journeys/index.astro +37 -0
  304. package/site/src/pages/licences/[name].astro +56 -0
  305. package/site/src/pages/map/index.astro +78 -0
  306. package/site/src/pages/playbooks/[file].astro +14 -0
  307. package/site/src/pages/rules/[...rules].astro +61 -0
  308. package/site/src/pages/skill-map/[...map].astro +101 -0
  309. package/site/src/pages/skills/[...list].astro +75 -0
  310. package/site/src/pages/skills/[file].astro +14 -0
  311. package/site/src/pages/software/[name].astro +155 -0
  312. package/site/src/pages/software/index.astro +71 -0
  313. package/site/src/scripts/diagram.ts +8 -0
  314. package/site/src/scripts/links.ts +31 -0
  315. package/site/src/scripts/map.ts +133 -0
  316. package/site/src/scripts/software.ts +32 -0
  317. package/site/src/scripts/theme.ts +52 -0
  318. package/site/src/styles/base.css +481 -0
  319. package/site/src/styles/fonts.css +60 -0
  320. package/site/src/styles/override.css +1 -0
  321. package/site/src/styles/pages.css +315 -0
  322. package/site/src/styles/tokens.css +87 -0
  323. package/skills/stackledger/SKILL.md +155 -0
@@ -0,0 +1,13 @@
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
+ // The sun and moon are the design system's uiIcon, inlined at build time (src/site/ui-icons.ts).
5
+ import { site } from '../lib/site';
6
+ ---
7
+
8
+ <button type="button" class="theme-switch" role="switch" aria-checked="false" aria-label="Dark theme" data-theme-switch hidden>
9
+ <span class="theme-switch-knob" aria-hidden="true">
10
+ <span class="icon-sun" set:html={site.icons.sun} />
11
+ <span class="icon-moon" set:html={site.icons.moon} />
12
+ </span>
13
+ </button>
@@ -0,0 +1,15 @@
1
+ ---
2
+ // One stackledger-rendered SVG per theme; CSS shows the one that matches the page theme.
3
+ // set:html is allowed only here, for line badges and for the interface icons: these SVGs come from
4
+ // src/map/*.ts, which escape every catalogue text themselves, or from src/site/ui-icons.ts, which
5
+ // holds no catalogue text (site-security, Escaped catalogue text).
6
+ interface Props {
7
+ light: string;
8
+ dark: string;
9
+ class?: string;
10
+ }
11
+ const { light, dark, class: className = 'diagram' } = Astro.props;
12
+ ---
13
+
14
+ <div class={`${className} themed-light`} set:html={light} />
15
+ <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';
@@ -0,0 +1,222 @@
1
+ ---
2
+ // Reports page (licence-reports, Reports page): renewals, recurring cost per currency and per
3
+ // group, one-off and planned costs, incomplete licences and the calendar link. The full site only:
4
+ // the route is dynamic so that getStaticPaths can return no page at all when SiteData has no
5
+ // report (the staff site), instead of a page that would have to hide itself. All text and amounts
6
+ // are prepared by src/site/data.ts; the tables are plain HTML, with no script.
7
+ import Base from '../layouts/Base.astro';
8
+ import LinkOrText from '../components/LinkOrText.astro';
9
+ import { href, rootFor, site } from '../lib/site';
10
+
11
+ export function getStaticPaths() {
12
+ return 'report' in site ? [{ params: { reports: 'reports' }, props: { report: site.report } }] : [];
13
+ }
14
+
15
+ const { report } = Astro.props;
16
+ const root = rootFor(Astro.url.pathname);
17
+ const renewalTables = [
18
+ { id: 'renewals', title: 'Renewals', entries: report.renewals, none: `No licence renews from ${report.date} to ${report.to}.` },
19
+ { id: 'overdue', title: 'Overdue', entries: report.overdue, none: `No renewal date is before ${report.date}.` },
20
+ ];
21
+ ---
22
+
23
+ <Base title="Reports" current="reports">
24
+ <article class="container section report">
25
+ <h1>Reports</h1>
26
+ <p class="lead">
27
+ Licence costs and renewals on {report.date}, with renewals up to {report.to} ({report.days} days). Each
28
+ currency has its own totals: amounts are never converted.
29
+ </p>
30
+ <p><a class="btn" href={href(root, report.calendar)} download="renewals.ics"><span class="icon" set:html={site.icons.download} />Download the renewal calendar (renewals.ics)</a></p>
31
+ {
32
+ report.empty ? (
33
+ <p class="lead" data-empty-report>There are no licences.</p>
34
+ ) : (
35
+ <>
36
+ <section aria-labelledby="recurring">
37
+ <h2 id="recurring">Recurring cost</h2>
38
+ <p class="muted">
39
+ Active and to-confirm licences. A cost is the price of one cycle for the whole licence: monthly costs count
40
+ 12 times a year, yearly ones a twelfth a month. Incomplete licences (an unknown cost, currency or cycle) add
41
+ to no amount; — means no complete licence adds to it.
42
+ </p>
43
+ {report.recurring.length === 0 ? (
44
+ <p>No recurring cost.</p>
45
+ ) : (
46
+ <div class="table-wrap">
47
+ <table data-report="recurring">
48
+ <thead>
49
+ <tr><th scope="col">Currency</th><th scope="col" class="amount">Per month</th><th scope="col" class="amount">Per year</th><th scope="col" class="amount">Incomplete</th></tr>
50
+ </thead>
51
+ <tbody>
52
+ {report.recurring.map((row) => (
53
+ <tr><td>{row.currency}</td><td class="amount">{row.monthly}</td><td class="amount">{row.yearly}</td><td class="amount">{row.incomplete}</td></tr>
54
+ ))}
55
+ </tbody>
56
+ </table>
57
+ </div>
58
+ )}
59
+ </section>
60
+
61
+ {renewalTables.map((table) => (
62
+ <section aria-labelledby={table.id}>
63
+ <h2 id={table.id}>{table.title}</h2>
64
+ {table.entries.length === 0 ? (
65
+ <p>{table.none}</p>
66
+ ) : (
67
+ <div class="table-wrap">
68
+ <table data-report={table.id}>
69
+ <thead>
70
+ <tr><th scope="col">Date</th><th scope="col">Licence</th><th scope="col">Vendor</th><th scope="col">Cycle</th><th scope="col" class="amount">Cost</th></tr>
71
+ </thead>
72
+ <tbody>
73
+ {table.entries.map((entry) => (
74
+ <tr><td>{entry.date}</td><td><LinkOrText root={root} item={entry} /></td><td>{entry.vendor}</td><td>{entry.cycle}</td><td class="amount">{entry.cost}</td></tr>
75
+ ))}
76
+ </tbody>
77
+ </table>
78
+ </div>
79
+ )}
80
+ </section>
81
+ ))}
82
+
83
+ <section aria-labelledby="unknown-dates">
84
+ <h2 id="unknown-dates">Unknown renewal dates</h2>
85
+ {report.unknownDates.length === 0 ? (
86
+ <p>Every counted licence has a renewal date.</p>
87
+ ) : (
88
+ <ul class="plain-list">
89
+ {report.unknownDates.map((item) => (
90
+ <li><LinkOrText root={root} item={item} /></li>
91
+ ))}
92
+ </ul>
93
+ )}
94
+ </section>
95
+
96
+ {report.groupings.map((grouping) => (
97
+ <section aria-labelledby={`by-${grouping.key}`}>
98
+ <h2 id={`by-${grouping.key}`}>{grouping.title}</h2>
99
+ {grouping.key === 'zone' && (
100
+ <p class="muted">
101
+ A licence's zone is the zone of the components that use it. A licence used in more than one zone counts
102
+ whole under Several zones; a cost is never split.
103
+ </p>
104
+ )}
105
+ {grouping.groups.length === 0 ? (
106
+ <p>No recurring cost.</p>
107
+ ) : (
108
+ <div class="table-wrap">
109
+ <table data-report={`by-${grouping.key}`}>
110
+ <thead>
111
+ <tr><th scope="col">{grouping.column}</th><th scope="col">Currency</th><th scope="col" class="amount">Per month</th><th scope="col" class="amount">Per year</th><th scope="col" class="amount">Incomplete</th></tr>
112
+ </thead>
113
+ <tbody>
114
+ {grouping.groups.flatMap((group) => group.rows.map((row) => (
115
+ <tr>
116
+ <td>{group.synthetic ? <em>{group.label}</em> : group.label}</td><td>{row.currency}</td><td class="amount">{row.monthly}</td><td class="amount">{row.yearly}</td><td class="amount">{row.incomplete}</td>
117
+ </tr>
118
+ )))}
119
+ </tbody>
120
+ </table>
121
+ </div>
122
+ )}
123
+ </section>
124
+ ))}
125
+
126
+ <section aria-labelledby="one-off">
127
+ <h2 id="one-off">One-off costs</h2>
128
+ <p class="muted">Paid once; not in the recurring totals.</p>
129
+ {report.oneOff.items.length === 0 ? (
130
+ <p>No complete one-off licence.</p>
131
+ ) : (
132
+ <div class="table-wrap">
133
+ <table data-report="one-off">
134
+ <thead>
135
+ <tr><th scope="col">Licence</th><th scope="col" class="amount">Cost</th><th scope="col">Renews on</th></tr>
136
+ </thead>
137
+ <tbody>
138
+ {report.oneOff.items.map((item) => (
139
+ <tr><td><LinkOrText root={root} item={item} /></td><td class="amount">{item.cost}</td><td>{item.renewsOn}</td></tr>
140
+ ))}
141
+ </tbody>
142
+ </table>
143
+ </div>
144
+ )}
145
+ {report.oneOff.totals.length > 0 && (
146
+ <div class="table-wrap">
147
+ <table data-report="one-off-totals">
148
+ <thead>
149
+ <tr><th scope="col">Currency</th><th scope="col" class="amount">Total</th><th scope="col" class="amount">Incomplete</th></tr>
150
+ </thead>
151
+ <tbody>
152
+ {report.oneOff.totals.map((row) => (
153
+ <tr><td>{row.currency}</td><td class="amount">{row.total}</td><td class="amount">{row.incomplete}</td></tr>
154
+ ))}
155
+ </tbody>
156
+ </table>
157
+ </div>
158
+ )}
159
+ </section>
160
+
161
+ <section aria-labelledby="planned">
162
+ <h2 id="planned">Planned purchases</h2>
163
+ <p class="muted">Licences with status to-buy; not in the recurring totals.</p>
164
+ {report.planned.items.length === 0 ? (
165
+ <p>No planned purchase.</p>
166
+ ) : (
167
+ <div class="table-wrap">
168
+ <table data-report="planned">
169
+ <thead>
170
+ <tr><th scope="col">Licence</th><th scope="col">Cycle</th><th scope="col" class="amount">Cost</th><th scope="col" class="amount">Per month</th><th scope="col" class="amount">Per year</th></tr>
171
+ </thead>
172
+ <tbody>
173
+ {report.planned.items.map((item) => (
174
+ <tr><td><LinkOrText root={root} item={item} /></td><td>{item.cycle}</td><td class="amount">{item.cost}</td><td class="amount">{item.monthly}</td><td class="amount">{item.yearly}</td></tr>
175
+ ))}
176
+ </tbody>
177
+ </table>
178
+ </div>
179
+ )}
180
+ {(report.planned.recurring.length > 0 || report.planned.oneOff.length > 0) && (
181
+ <div class="table-wrap">
182
+ <table data-report="planned-totals">
183
+ <thead>
184
+ <tr><th scope="col">Planned</th><th scope="col">Currency</th><th scope="col" class="amount">Per month</th><th scope="col" class="amount">Per year</th><th scope="col" class="amount">One-off</th><th scope="col" class="amount">Incomplete</th></tr>
185
+ </thead>
186
+ <tbody>
187
+ {report.planned.recurring.map((row) => (
188
+ <tr><td>Recurring</td><td>{row.currency}</td><td class="amount">{row.monthly}</td><td class="amount">{row.yearly}</td><td class="amount">—</td><td class="amount">{row.incomplete}</td></tr>
189
+ ))}
190
+ {report.planned.oneOff.map((row) => (
191
+ <tr><td>One-off</td><td>{row.currency}</td><td class="amount">—</td><td class="amount">—</td><td class="amount">{row.total}</td><td class="amount">{row.incomplete}</td></tr>
192
+ ))}
193
+ </tbody>
194
+ </table>
195
+ </div>
196
+ )}
197
+ </section>
198
+
199
+ <section aria-labelledby="incomplete">
200
+ <h2 id="incomplete">Incomplete licences</h2>
201
+ {report.incomplete.length === 0 ? (
202
+ <p>Every licence has a known cost, currency and cycle.</p>
203
+ ) : (
204
+ <div class="table-wrap">
205
+ <table data-report="incomplete">
206
+ <thead>
207
+ <tr><th scope="col">Licence</th><th scope="col">Status</th><th scope="col">Unknown</th></tr>
208
+ </thead>
209
+ <tbody>
210
+ {report.incomplete.map((item) => (
211
+ <tr><td><LinkOrText root={root} item={item} /></td><td>{item.status}</td><td>{item.unknown}</td></tr>
212
+ ))}
213
+ </tbody>
214
+ </table>
215
+ </div>
216
+ )}
217
+ </section>
218
+ </>
219
+ )
220
+ }
221
+ </article>
222
+ </Base>
@@ -0,0 +1,14 @@
1
+ ---
2
+ // Agent pages (skills-site): one per agent 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 === 'agent').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,72 @@
1
+ ---
2
+ // Home page (catalogue-site, Home page, Home page chrome and Home links): a banner with the site title
3
+ // and text, a card per division with the view's counts and links, then the configured links.
4
+ // The links are the only URLs to other sites (site-security, No external requests): validated http(s)
5
+ // URLs from spec.site.home.links, opened in the same tab, with rel="noopener noreferrer".
6
+ import Base from '../layouts/Base.astro';
7
+ import { href, rootFor, site } from '../lib/site';
8
+
9
+ const root = rootFor(Astro.url.pathname);
10
+ const plural = (count: number, word: string) => `${count} ${count === 1 ? word : `${word}s`}`;
11
+ const skills = site.skills;
12
+ ---
13
+
14
+ <Base title={site.title} current="home">
15
+ <section class="home-banner">
16
+ <div class="container">
17
+ <h1>{site.title}</h1>
18
+ <p class="lead">{site.home.text}</p>
19
+ <img class="home-banner-art" src={href(root, 'home-banner.svg')} alt="" width="1200" height="420" />
20
+ </div>
21
+ </section>
22
+ <section class="section">
23
+ <div class="container">
24
+ <div class="item-grid home-cards">
25
+ <article class="card">
26
+ <h2 class="card-title">Software</h2>
27
+ <p>
28
+ {plural(site.components.length, 'component')}, {plural(site.licences.length, 'licence')} and{' '}
29
+ {plural(site.journeys.length, 'journey')}.
30
+ </p>
31
+ <ul class="home-links">
32
+ <li><a href={href(root, 'map/')}>Map</a></li>
33
+ <li><a href={href(root, 'software/')}>List</a></li>
34
+ <li><a href={href(root, 'journeys/')}>Journeys</a></li>
35
+ {'report' in site && <li><a href={href(root, 'reports/')}>Reports</a></li>}
36
+ </ul>
37
+ </article>
38
+ {
39
+ skills && (
40
+ <article class="card">
41
+ <h2 class="card-title">Skills</h2>
42
+ <p>
43
+ {plural(skills.counts.skills, 'skill')}, {plural(skills.counts.playbooks, 'playbook')}, {plural(skills.counts.agents, 'agent')} and{' '}
44
+ {plural(skills.counts.rules, 'rule')}.
45
+ </p>
46
+ <ul class="home-links">
47
+ <li><a href={href(root, 'skills/')}>List</a></li>
48
+ <li><a href={href(root, 'skill-map/')}>Map</a></li>
49
+ <li><a href={href(root, 'rules/')}>Rules</a></li>
50
+ </ul>
51
+ </article>
52
+ )
53
+ }
54
+ </div>
55
+ {
56
+ site.home.links.length > 0 && (
57
+ <>
58
+ <h2>Links</h2>
59
+ <ul class="home-external">
60
+ {site.home.links.map((link: { title: string; url: string; description?: string; icon?: string }) => (
61
+ <li>
62
+ <a href={link.url} rel="noopener noreferrer">{link.icon && <><img class="link-icon themed-light" src={href(root, `link-icons/${link.icon}-light.svg`)} alt="" width="24" height="24" /><img class="link-icon themed-dark" src={href(root, `link-icons/${link.icon}-dark.svg`)} alt="" width="24" height="24" /></>}{link.title}</a>
63
+ {link.description && <span class="muted"> · {link.description}</span>}
64
+ </li>
65
+ ))}
66
+ </ul>
67
+ </>
68
+ )
69
+ }
70
+ </div>
71
+ </section>
72
+ </Base>
@@ -0,0 +1,50 @@
1
+ ---
2
+ // Journey page (catalogue-site, Journey pages): the strip diagram and the same stops and
3
+ // interchanges as a text list of links.
4
+ import Base from '../../layouts/Base.astro';
5
+ import LinkOrText from '../../components/LinkOrText.astro';
6
+ import Themed from '../../components/Themed.astro';
7
+ import { rootFor, site } from '../../lib/site';
8
+
9
+ export function getStaticPaths() {
10
+ return site.journeys.map((page) => ({ params: { name: page.slug }, props: { page } }));
11
+ }
12
+
13
+ const { page } = Astro.props;
14
+ const root = rootFor(Astro.url.pathname);
15
+ ---
16
+
17
+ <Base title={page.title} current="journeys" exact={false}>
18
+ <article class="container section">
19
+ <p class="kicker">Journey</p>
20
+ <h1 class="journey-title"><span class="badge" set:html={page.badgeSvg} />{page.title}</h1>
21
+ <p class="lead">{page.stops} stops, in order.</p>
22
+ <div data-diagram>
23
+ <Themed light={page.strip.light} dark={page.strip.dark} />
24
+ </div>
25
+ <h2>Stops</h2>
26
+ <ol class="stop-list">
27
+ {
28
+ page.stopList.map((stop) => (
29
+ <li>
30
+ <LinkOrText root={root} item={stop} />
31
+ {stop.lines.length > 0 && (
32
+ <span class="muted">
33
+ {' '}· also on{' '}
34
+ {stop.lines.map((line, index) => (
35
+ <>
36
+ {index > 0 && ', '}
37
+ <LinkOrText root={root} item={line} />
38
+ </>
39
+ ))}
40
+ </span>
41
+ )}
42
+ </li>
43
+ ))
44
+ }
45
+ </ol>
46
+ </article>
47
+ <script>
48
+ import '../../scripts/diagram.ts';
49
+ </script>
50
+ </Base>
@@ -0,0 +1,37 @@
1
+ ---
2
+ // Journeys list (catalogue-site, Journey pages): every drawn line in line order with its badge,
3
+ // colour, title and number of stops.
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 lines = site.journeys;
9
+ ---
10
+
11
+ <Base title="Journeys" current="journeys">
12
+ <section class="container section">
13
+ <h1>Journeys</h1>
14
+ {
15
+ lines.length === 0 ? (
16
+ <p class="lead">There are no journeys yet.</p>
17
+ ) : (
18
+ <>
19
+ <p class="lead">{lines.length} journeys, in line order.</p>
20
+ <ul class="journey-list">
21
+ {lines.map((line) => (
22
+ <li class="card journey-card">
23
+ <span class="badge" set:html={line.badgeSvg} />
24
+ <div>
25
+ <h2 class="card-title"><a href={href(root, line.href)}>{line.title}</a></h2>
26
+ <p class="muted">
27
+ {line.stops} stops · colour <code>{line.color}</code>
28
+ </p>
29
+ </div>
30
+ </li>
31
+ ))}
32
+ </ul>
33
+ </>
34
+ )
35
+ }
36
+ </section>
37
+ </Base>
@@ -0,0 +1,56 @@
1
+ ---
2
+ // Licence page (catalogue-site, Licence page): the licence fields of the view, the components
3
+ // that use it and the impact of removing it. The staff view has already dropped hidden fields.
4
+ import Base from '../../layouts/Base.astro';
5
+ import Impact from '../../components/Impact.astro';
6
+ import LinkOrText from '../../components/LinkOrText.astro';
7
+ import { rootFor, site } from '../../lib/site';
8
+
9
+ export function getStaticPaths() {
10
+ return site.licences.map((page) => ({ params: { name: page.slug }, props: { page } }));
11
+ }
12
+
13
+ const { page } = Astro.props;
14
+ const root = rootFor(Astro.url.pathname);
15
+ ---
16
+
17
+ <Base title={page.title} current="software" exact={false}>
18
+ <article class="container section">
19
+ <p class="kicker">Licence</p>
20
+ <h1>{page.title}</h1>
21
+ <div class="item-grid">
22
+ <section class="card" aria-labelledby="details">
23
+ <h2 id="details" class="card-title">Details</h2>
24
+ <dl class="fields">
25
+ <dt>Name</dt>
26
+ <dd><code>{page.name}</code></dd>
27
+ <dt>Owner</dt>
28
+ <dd>{page.owner}</dd>
29
+ {
30
+ page.fields.map((field) => (
31
+ <>
32
+ <dt>{field.label}</dt>
33
+ <dd>{field.value}</dd>
34
+ </>
35
+ ))
36
+ }
37
+ </dl>
38
+ </section>
39
+ <section class="card" aria-labelledby="used-by">
40
+ <h2 id="used-by" class="card-title">Used by</h2>
41
+ {
42
+ page.usedBy.length === 0 ? (
43
+ <p>No component uses this licence.</p>
44
+ ) : (
45
+ <ul class="plain-list">
46
+ {page.usedBy.map((item) => (
47
+ <li><LinkOrText root={root} item={item} /></li>
48
+ ))}
49
+ </ul>
50
+ )
51
+ }
52
+ </section>
53
+ </div>
54
+ <Impact root={root} impact={page.impact} />
55
+ </article>
56
+ </Base>
@@ -0,0 +1,78 @@
1
+ ---
2
+ // Map page (catalogue-site, Map page and Map interaction): the view's map in both themes, zoom,
3
+ // pan, line highlight and zone filter. The map SVG has no title band or legend: the line chips are
4
+ // the legend (buttons that highlight a line) and the symbols are listed under them. Without
5
+ // JavaScript the whole map and both legends are shown; only the zoom and zone tools stay hidden.
6
+ import Base from '../../layouts/Base.astro';
7
+ import Themed from '../../components/Themed.astro';
8
+ import { site } from '../../lib/site';
9
+
10
+ const { lines, zones, symbols } = site.map;
11
+ ---
12
+
13
+ <Base title="Map" current="map">
14
+ <section class="container section">
15
+ <h1>Map</h1>
16
+ {
17
+ lines.length === 0 ? (
18
+ <p class="lead">No journeys yet. Add a Line to the catalogue to draw one.</p>
19
+ ) : (
20
+ <p class="lead">Each line is a journey through the software; each station opens its page.</p>
21
+ )
22
+ }
23
+ <div class="map-tools" data-map-tools hidden>
24
+ <div class="map-zoom" role="group" aria-label="Zoom">
25
+ <button type="button" class="btn" data-zoom="in" aria-label="Zoom in"><span class="icon" set:html={site.icons.zoomIn} /></button>
26
+ <button type="button" class="btn" data-zoom="out" aria-label="Zoom out"><span class="icon" set:html={site.icons.zoomOut} /></button>
27
+ <button type="button" class="btn" data-zoom="reset"><span class="icon" set:html={site.icons.reset} />Reset</button>
28
+ </div>
29
+ {
30
+ zones.length > 0 && (
31
+ <label class="field map-zone">
32
+ Zone
33
+ <select data-zone-filter>
34
+ <option value="">All zones</option>
35
+ {zones.map((zone) => <option value={zone.name}>{zone.title}</option>)}
36
+ </select>
37
+ </label>
38
+ )
39
+ }
40
+ </div>
41
+ <div class="map-frame" data-map>
42
+ <Themed light={site.map.light} dark={site.map.dark} class="map-canvas" />
43
+ </div>
44
+ {
45
+ lines.length > 0 && (
46
+ <div class="map-lines" data-map-lines>
47
+ <h2 class="visually-hidden">Lines (journeys)</h2>
48
+ <ul class="line-chips">
49
+ {lines.map((line) => (
50
+ <li>
51
+ <button type="button" class="btn" data-line={line.ref} aria-pressed="false">
52
+ <span class="badge" set:html={line.badgeSvg} />
53
+ {line.title}
54
+ </button>
55
+ </li>
56
+ ))}
57
+ </ul>
58
+ </div>
59
+ )
60
+ }
61
+ <h2 class="visually-hidden">Symbols</h2>
62
+ <ul class="map-symbols">
63
+ {
64
+ symbols.map((symbol) => (
65
+ <li>
66
+ <div class="map-symbol" aria-hidden="true">
67
+ <Themed light={symbol.light} dark={symbol.dark} class="symbol" />
68
+ </div>
69
+ {symbol.label}
70
+ </li>
71
+ ))
72
+ }
73
+ </ul>
74
+ </section>
75
+ <script>
76
+ import '../../scripts/map.ts';
77
+ </script>
78
+ </Base>