@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,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">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,71 @@
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
+ </div>
20
+ </section>
21
+ <section class="section">
22
+ <div class="container">
23
+ <div class="item-grid home-cards">
24
+ <article class="card">
25
+ <h2 class="card-title">Software</h2>
26
+ <p>
27
+ {plural(site.components.length, 'component')}, {plural(site.licences.length, 'licence')} and{' '}
28
+ {plural(site.journeys.length, 'journey')}.
29
+ </p>
30
+ <ul class="home-links">
31
+ <li><a href={href(root, 'map/')}>Map</a></li>
32
+ <li><a href={href(root, 'software/')}>List</a></li>
33
+ <li><a href={href(root, 'journeys/')}>Journeys</a></li>
34
+ {'report' in site && <li><a href={href(root, 'reports/')}>Reports</a></li>}
35
+ </ul>
36
+ </article>
37
+ {
38
+ skills && (
39
+ <article class="card">
40
+ <h2 class="card-title">Skills</h2>
41
+ <p>
42
+ {plural(skills.counts.skills, 'skill')}, {plural(skills.counts.playbooks, 'playbook')}, {plural(skills.counts.agents, 'agent')} and{' '}
43
+ {plural(skills.counts.rules, 'rule')}.
44
+ </p>
45
+ <ul class="home-links">
46
+ <li><a href={href(root, 'skills/')}>List</a></li>
47
+ <li><a href={href(root, 'skill-map/')}>Map</a></li>
48
+ <li><a href={href(root, 'rules/')}>Rules</a></li>
49
+ </ul>
50
+ </article>
51
+ )
52
+ }
53
+ </div>
54
+ {
55
+ site.home.links.length > 0 && (
56
+ <>
57
+ <h2>Links</h2>
58
+ <ul class="home-external">
59
+ {site.home.links.map((link: { title: string; url: string; description?: string }) => (
60
+ <li>
61
+ <a href={link.url} rel="noopener noreferrer">{link.title}</a>
62
+ {link.description && <span class="muted"> · {link.description}</span>}
63
+ </li>
64
+ ))}
65
+ </ul>
66
+ </>
67
+ )
68
+ }
69
+ </div>
70
+ </section>
71
+ </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">+</button>
26
+ <button type="button" class="btn" data-zoom="out" aria-label="Zoom out">−</button>
27
+ <button type="button" class="btn" data-zoom="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>
@@ -0,0 +1,14 @@
1
+ ---
2
+ // Playbook pages (skills-site): one per playbook 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 === 'playbook').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,61 @@
1
+ ---
2
+ // Rules index (skills-site, Rules index): every rule of the set, sorted by ID then the item that
3
+ // defines it, each row linking that item's page. Search reuses the software list's script.
4
+ import Base from '../../layouts/Base.astro';
5
+ import { href, rootFor, site } from '../../lib/site';
6
+
7
+ export function getStaticPaths() {
8
+ return site.skills ? [{ params: { rules: undefined }, props: { skills: site.skills } }] : [];
9
+ }
10
+
11
+ const { skills } = Astro.props;
12
+ const root = rootFor(Astro.url.pathname);
13
+ ---
14
+
15
+ <Base title="Rules" current="rules">
16
+ <section class="container section">
17
+ <h1>Rules</h1>
18
+ {
19
+ skills.rules.length === 0 ? (
20
+ <p class="lead">No rules: no skill or playbook of the set has a <code>rules.md</code> with rules.</p>
21
+ ) : (
22
+ <>
23
+ <p class="lead">{skills.rules.length} rules from the skills' and playbooks' <code>rules.md</code> files.</p>
24
+ <div class="list-tools" data-list-tools hidden>
25
+ <label class="field list-search">
26
+ Search
27
+ <input type="search" data-search autocomplete="off" placeholder="ID, text, group…" />
28
+ </label>
29
+ </div>
30
+ <p class="muted" data-count aria-live="polite" />
31
+ <div class="table-wrap">
32
+ <table data-software>
33
+ <thead>
34
+ <tr>
35
+ <th scope="col">ID</th>
36
+ <th scope="col">Rule</th>
37
+ <th scope="col">Group</th>
38
+ <th scope="col">Defined by</th>
39
+ </tr>
40
+ </thead>
41
+ <tbody>
42
+ {skills.rules.map((rule: { id: string; text: string; group: string; owner: { href: string; name: string; kind: string } }) => (
43
+ <tr>
44
+ <td data-column="id"><code>{rule.id}</code></td>
45
+ <td data-column="text">{rule.text}</td>
46
+ <td data-column="group">{rule.group}</td>
47
+ <td data-column="owner"><a href={href(root, rule.owner.href)}>{rule.owner.name}</a> <span class="muted">({rule.owner.kind})</span></td>
48
+ </tr>
49
+ ))}
50
+ </tbody>
51
+ </table>
52
+ </div>
53
+ <p class="no-match" data-no-match hidden>No rule matches.</p>
54
+ </>
55
+ )
56
+ }
57
+ </section>
58
+ <script>
59
+ import '../../scripts/software.ts';
60
+ </script>
61
+ </Base>