pageship 0.1.0 → 0.2.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 (43) hide show
  1. package/README.md +18 -107
  2. package/dist/cli.mjs +1886 -505
  3. package/dist/skills/LICENSE +21 -0
  4. package/dist/skills/pageship/SKILL.md +150 -0
  5. package/dist/skills/pageship/references/download.md +9 -0
  6. package/dist/skills/pageship/references/list-and-history.md +15 -0
  7. package/dist/skills/pageship/references/restore.md +9 -0
  8. package/dist/skills/pageship/references/visibility.md +12 -0
  9. package/dist/skills/pageship-chart/SKILL.md +110 -0
  10. package/dist/skills/pageship-code-block/SKILL.md +113 -0
  11. package/dist/skills/pageship-code-block/references/highlight-lock.json +542 -0
  12. package/dist/skills/pageship-code-block/references/highlight.mjs +138 -0
  13. package/dist/skills/pageship-decision-record/SKILL.md +43 -0
  14. package/dist/skills/pageship-diagram/SKILL.md +92 -0
  15. package/dist/skills/pageship-diagram/references/check-diagram.js +301 -0
  16. package/dist/skills/pageship-diagram/references/computed-layout.md +49 -0
  17. package/dist/skills/pageship-diagram/references/layout.mjs +310 -0
  18. package/dist/skills/pageship-diagram/references/mermaid.md +89 -0
  19. package/dist/skills/pageship-diagram/references/svg.md +205 -0
  20. package/dist/skills/pageship-docs/NOTICES.md +35 -0
  21. package/dist/skills/pageship-docs/SKILL.md +67 -0
  22. package/dist/skills/pageship-docs/references/ask.md +18 -0
  23. package/dist/skills/pageship-docs/references/check.md +39 -0
  24. package/dist/skills/pageship-docs/references/content.md +29 -0
  25. package/dist/skills/pageship-docs/references/design.md +60 -0
  26. package/dist/skills/pageship-docs/references/file.md +52 -0
  27. package/dist/skills/pageship-docs/references/plain-default.md +331 -0
  28. package/dist/skills/pageship-explainer/SKILL.md +92 -0
  29. package/dist/skills/pageship-interaction/SKILL.md +115 -0
  30. package/dist/skills/pageship-interaction/references/pointer.md +271 -0
  31. package/dist/skills/pageship-interaction/references/step-through.md +146 -0
  32. package/dist/skills/pageship-key-figures/SKILL.md +127 -0
  33. package/dist/skills/pageship-media/SKILL.md +122 -0
  34. package/dist/skills/pageship-motion/SKILL.md +58 -0
  35. package/dist/skills/pageship-plan/SKILL.md +55 -0
  36. package/dist/skills/pageship-report/SKILL.md +29 -0
  37. package/dist/skills/pageship-review-report/SKILL.md +90 -0
  38. package/dist/skills/pageship-slide-deck/SKILL.md +53 -0
  39. package/dist/skills/pageship-slide-deck/references/engine.md +362 -0
  40. package/dist/skills/pageship-spec/SKILL.md +58 -0
  41. package/dist/skills/pageship-table/SKILL.md +243 -0
  42. package/dist/skills/pageship-table/references/sort-and-filter.md +235 -0
  43. package/package.json +1 -1
@@ -0,0 +1,542 @@
1
+ {
2
+ "name": "pageship-highlight",
3
+ "lockfileVersion": 3,
4
+ "requires": true,
5
+ "packages": {
6
+ "": {
7
+ "name": "pageship-highlight",
8
+ "dependencies": {
9
+ "@shikijs/core": "4.4.3",
10
+ "@shikijs/engine-javascript": "4.4.3",
11
+ "@shikijs/langs": "4.4.3",
12
+ "@shikijs/themes": "4.4.3"
13
+ }
14
+ },
15
+ "node_modules/@shikijs/core": {
16
+ "version": "4.4.3",
17
+ "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-4.4.3.tgz",
18
+ "integrity": "sha512-QCR4q2ZO/ILJEuwiBMel4wdcTDb1JGwfjKTxPDF6x8ixOaluPrVqIn06C99AcRPhmYlBR56d/Fb+GN58GzExpg==",
19
+ "license": "MIT",
20
+ "dependencies": {
21
+ "@shikijs/primitive": "4.4.3",
22
+ "@shikijs/types": "4.4.3",
23
+ "@shikijs/vscode-textmate": "^10.0.2",
24
+ "@types/hast": "^3.0.5",
25
+ "hast-util-to-html": "^9.0.5"
26
+ },
27
+ "engines": {
28
+ "node": ">=20"
29
+ }
30
+ },
31
+ "node_modules/@shikijs/engine-javascript": {
32
+ "version": "4.4.3",
33
+ "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-4.4.3.tgz",
34
+ "integrity": "sha512-FbOjFJp9VLdo1Wevs10BBtVxiTWwNLqZh5Gkhjgda/ioL15YOgeSl9n+6XMa3qRlPQzfhFNe641SrynFHYG0nQ==",
35
+ "license": "MIT",
36
+ "dependencies": {
37
+ "@shikijs/types": "4.4.3",
38
+ "@shikijs/vscode-textmate": "^10.0.2",
39
+ "oniguruma-to-es": "^4.3.6"
40
+ },
41
+ "engines": {
42
+ "node": ">=20"
43
+ }
44
+ },
45
+ "node_modules/@shikijs/langs": {
46
+ "version": "4.4.3",
47
+ "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-4.4.3.tgz",
48
+ "integrity": "sha512-ePic0yfAJGOF83D5wBHK/00EjK65oahBYxFk5epgq33WRv7X9UuxLEV8PtR0szC0z8dl7INIpIodB99JRFlR+A==",
49
+ "license": "MIT",
50
+ "dependencies": {
51
+ "@shikijs/types": "4.4.3"
52
+ },
53
+ "engines": {
54
+ "node": ">=20"
55
+ }
56
+ },
57
+ "node_modules/@shikijs/primitive": {
58
+ "version": "4.4.3",
59
+ "resolved": "https://registry.npmjs.org/@shikijs/primitive/-/primitive-4.4.3.tgz",
60
+ "integrity": "sha512-m0wBeLDQDeIxRdUmrCPdQqfuUamDwRL5isCfYbguKD6NiaKpVbsv+3J81DyIKgNW5h4WAIIr8T4EkgQrBBxvaQ==",
61
+ "license": "MIT",
62
+ "dependencies": {
63
+ "@shikijs/types": "4.4.3",
64
+ "@shikijs/vscode-textmate": "^10.0.2",
65
+ "@types/hast": "^3.0.5"
66
+ },
67
+ "engines": {
68
+ "node": ">=20"
69
+ }
70
+ },
71
+ "node_modules/@shikijs/themes": {
72
+ "version": "4.4.3",
73
+ "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-4.4.3.tgz",
74
+ "integrity": "sha512-w8UHjeUnIR965KMWJHUPXOc2mNJUnK3vpVLYLvw5IYU2mnTTJ89E24OrJDBNiJDQ0qzb0tc4l7mrIXx5cFeIyw==",
75
+ "license": "MIT",
76
+ "dependencies": {
77
+ "@shikijs/types": "4.4.3"
78
+ },
79
+ "engines": {
80
+ "node": ">=20"
81
+ }
82
+ },
83
+ "node_modules/@shikijs/types": {
84
+ "version": "4.4.3",
85
+ "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-4.4.3.tgz",
86
+ "integrity": "sha512-UEJxmRR++MAGR6hugn0vgVS2W/6lWAts84FFSrnlH9sP0LNol7E5+NQ792pH8liWUhyMyjhTgSUH3k7iD7tc5g==",
87
+ "license": "MIT",
88
+ "dependencies": {
89
+ "@shikijs/vscode-textmate": "^10.0.2",
90
+ "@types/hast": "^3.0.5"
91
+ },
92
+ "engines": {
93
+ "node": ">=20"
94
+ }
95
+ },
96
+ "node_modules/@shikijs/vscode-textmate": {
97
+ "version": "10.0.2",
98
+ "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.0.2.tgz",
99
+ "integrity": "sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==",
100
+ "license": "MIT"
101
+ },
102
+ "node_modules/@types/hast": {
103
+ "version": "3.0.5",
104
+ "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.5.tgz",
105
+ "integrity": "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g==",
106
+ "license": "MIT",
107
+ "dependencies": {
108
+ "@types/unist": "*"
109
+ }
110
+ },
111
+ "node_modules/@types/mdast": {
112
+ "version": "4.0.4",
113
+ "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz",
114
+ "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==",
115
+ "license": "MIT",
116
+ "dependencies": {
117
+ "@types/unist": "*"
118
+ }
119
+ },
120
+ "node_modules/@types/unist": {
121
+ "version": "3.0.3",
122
+ "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz",
123
+ "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==",
124
+ "license": "MIT"
125
+ },
126
+ "node_modules/@ungap/structured-clone": {
127
+ "version": "1.4.0",
128
+ "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.4.0.tgz",
129
+ "integrity": "sha512-1mEZtMKPM09vDmQt5y7YvmN2+DFTP7Tg0EWXdic8/C6VRnpb33e4ghisCIE3WZjsE2N8mf+QV1Zqh7ZFYLWInQ==",
130
+ "license": "ISC"
131
+ },
132
+ "node_modules/ccount": {
133
+ "version": "2.0.1",
134
+ "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz",
135
+ "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==",
136
+ "license": "MIT",
137
+ "funding": {
138
+ "type": "github",
139
+ "url": "https://github.com/sponsors/wooorm"
140
+ }
141
+ },
142
+ "node_modules/character-entities-html4": {
143
+ "version": "2.1.0",
144
+ "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz",
145
+ "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==",
146
+ "license": "MIT",
147
+ "funding": {
148
+ "type": "github",
149
+ "url": "https://github.com/sponsors/wooorm"
150
+ }
151
+ },
152
+ "node_modules/character-entities-legacy": {
153
+ "version": "3.0.0",
154
+ "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz",
155
+ "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==",
156
+ "license": "MIT",
157
+ "funding": {
158
+ "type": "github",
159
+ "url": "https://github.com/sponsors/wooorm"
160
+ }
161
+ },
162
+ "node_modules/comma-separated-tokens": {
163
+ "version": "2.0.3",
164
+ "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz",
165
+ "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==",
166
+ "license": "MIT",
167
+ "funding": {
168
+ "type": "github",
169
+ "url": "https://github.com/sponsors/wooorm"
170
+ }
171
+ },
172
+ "node_modules/dequal": {
173
+ "version": "2.0.3",
174
+ "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
175
+ "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==",
176
+ "license": "MIT",
177
+ "engines": {
178
+ "node": ">=6"
179
+ }
180
+ },
181
+ "node_modules/devlop": {
182
+ "version": "1.1.0",
183
+ "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz",
184
+ "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==",
185
+ "license": "MIT",
186
+ "dependencies": {
187
+ "dequal": "^2.0.0"
188
+ },
189
+ "funding": {
190
+ "type": "github",
191
+ "url": "https://github.com/sponsors/wooorm"
192
+ }
193
+ },
194
+ "node_modules/hast-util-to-html": {
195
+ "version": "9.0.5",
196
+ "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.5.tgz",
197
+ "integrity": "sha512-OguPdidb+fbHQSU4Q4ZiLKnzWo8Wwsf5bZfbvu7//a9oTYoqD/fWpe96NuHkoS9h0ccGOTe0C4NGXdtS0iObOw==",
198
+ "license": "MIT",
199
+ "dependencies": {
200
+ "@types/hast": "^3.0.0",
201
+ "@types/unist": "^3.0.0",
202
+ "ccount": "^2.0.0",
203
+ "comma-separated-tokens": "^2.0.0",
204
+ "hast-util-whitespace": "^3.0.0",
205
+ "html-void-elements": "^3.0.0",
206
+ "mdast-util-to-hast": "^13.0.0",
207
+ "property-information": "^7.0.0",
208
+ "space-separated-tokens": "^2.0.0",
209
+ "stringify-entities": "^4.0.0",
210
+ "zwitch": "^2.0.4"
211
+ },
212
+ "funding": {
213
+ "type": "opencollective",
214
+ "url": "https://opencollective.com/unified"
215
+ }
216
+ },
217
+ "node_modules/hast-util-whitespace": {
218
+ "version": "3.0.0",
219
+ "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz",
220
+ "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==",
221
+ "license": "MIT",
222
+ "dependencies": {
223
+ "@types/hast": "^3.0.0"
224
+ },
225
+ "funding": {
226
+ "type": "opencollective",
227
+ "url": "https://opencollective.com/unified"
228
+ }
229
+ },
230
+ "node_modules/html-void-elements": {
231
+ "version": "3.0.0",
232
+ "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz",
233
+ "integrity": "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==",
234
+ "license": "MIT",
235
+ "funding": {
236
+ "type": "github",
237
+ "url": "https://github.com/sponsors/wooorm"
238
+ }
239
+ },
240
+ "node_modules/mdast-util-to-hast": {
241
+ "version": "13.2.1",
242
+ "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.1.tgz",
243
+ "integrity": "sha512-cctsq2wp5vTsLIcaymblUriiTcZd0CwWtCbLvrOzYCDZoWyMNV8sZ7krj09FSnsiJi3WVsHLM4k6Dq/yaPyCXA==",
244
+ "license": "MIT",
245
+ "dependencies": {
246
+ "@types/hast": "^3.0.0",
247
+ "@types/mdast": "^4.0.0",
248
+ "@ungap/structured-clone": "^1.0.0",
249
+ "devlop": "^1.0.0",
250
+ "micromark-util-sanitize-uri": "^2.0.0",
251
+ "trim-lines": "^3.0.0",
252
+ "unist-util-position": "^5.0.0",
253
+ "unist-util-visit": "^5.0.0",
254
+ "vfile": "^6.0.0"
255
+ },
256
+ "funding": {
257
+ "type": "opencollective",
258
+ "url": "https://opencollective.com/unified"
259
+ }
260
+ },
261
+ "node_modules/micromark-util-character": {
262
+ "version": "2.1.1",
263
+ "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz",
264
+ "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==",
265
+ "funding": [
266
+ {
267
+ "type": "GitHub Sponsors",
268
+ "url": "https://github.com/sponsors/unifiedjs"
269
+ },
270
+ {
271
+ "type": "OpenCollective",
272
+ "url": "https://opencollective.com/unified"
273
+ }
274
+ ],
275
+ "license": "MIT",
276
+ "dependencies": {
277
+ "micromark-util-symbol": "^2.0.0",
278
+ "micromark-util-types": "^2.0.0"
279
+ }
280
+ },
281
+ "node_modules/micromark-util-encode": {
282
+ "version": "2.0.1",
283
+ "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz",
284
+ "integrity": "sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==",
285
+ "funding": [
286
+ {
287
+ "type": "GitHub Sponsors",
288
+ "url": "https://github.com/sponsors/unifiedjs"
289
+ },
290
+ {
291
+ "type": "OpenCollective",
292
+ "url": "https://opencollective.com/unified"
293
+ }
294
+ ],
295
+ "license": "MIT"
296
+ },
297
+ "node_modules/micromark-util-sanitize-uri": {
298
+ "version": "2.0.1",
299
+ "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz",
300
+ "integrity": "sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==",
301
+ "funding": [
302
+ {
303
+ "type": "GitHub Sponsors",
304
+ "url": "https://github.com/sponsors/unifiedjs"
305
+ },
306
+ {
307
+ "type": "OpenCollective",
308
+ "url": "https://opencollective.com/unified"
309
+ }
310
+ ],
311
+ "license": "MIT",
312
+ "dependencies": {
313
+ "micromark-util-character": "^2.0.0",
314
+ "micromark-util-encode": "^2.0.0",
315
+ "micromark-util-symbol": "^2.0.0"
316
+ }
317
+ },
318
+ "node_modules/micromark-util-symbol": {
319
+ "version": "2.0.1",
320
+ "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz",
321
+ "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==",
322
+ "funding": [
323
+ {
324
+ "type": "GitHub Sponsors",
325
+ "url": "https://github.com/sponsors/unifiedjs"
326
+ },
327
+ {
328
+ "type": "OpenCollective",
329
+ "url": "https://opencollective.com/unified"
330
+ }
331
+ ],
332
+ "license": "MIT"
333
+ },
334
+ "node_modules/micromark-util-types": {
335
+ "version": "2.0.2",
336
+ "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.2.tgz",
337
+ "integrity": "sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==",
338
+ "funding": [
339
+ {
340
+ "type": "GitHub Sponsors",
341
+ "url": "https://github.com/sponsors/unifiedjs"
342
+ },
343
+ {
344
+ "type": "OpenCollective",
345
+ "url": "https://opencollective.com/unified"
346
+ }
347
+ ],
348
+ "license": "MIT"
349
+ },
350
+ "node_modules/oniguruma-parser": {
351
+ "version": "0.12.2",
352
+ "resolved": "https://registry.npmjs.org/oniguruma-parser/-/oniguruma-parser-0.12.2.tgz",
353
+ "integrity": "sha512-6HVa5oIrgMC6aA6WF6XyyqbhRPJrKR02L20+2+zpDtO5QAzGHAUGw5TKQvwi5vctNnRHkJYmjAhRVQF2EKdTQw==",
354
+ "license": "MIT"
355
+ },
356
+ "node_modules/oniguruma-to-es": {
357
+ "version": "4.3.6",
358
+ "resolved": "https://registry.npmjs.org/oniguruma-to-es/-/oniguruma-to-es-4.3.6.tgz",
359
+ "integrity": "sha512-csuQ9x3Yr0cEIs/Zgx/OEt9iBw9vqIunAPQkx19R/fiMq2oGVTgcMqO/V3Ybqefr1TBvosI6jU539ksaBULJyA==",
360
+ "license": "MIT",
361
+ "dependencies": {
362
+ "oniguruma-parser": "^0.12.2",
363
+ "regex": "^6.1.0",
364
+ "regex-recursion": "^6.0.2"
365
+ }
366
+ },
367
+ "node_modules/property-information": {
368
+ "version": "7.2.0",
369
+ "resolved": "https://registry.npmjs.org/property-information/-/property-information-7.2.0.tgz",
370
+ "integrity": "sha512-IAtzIB6sUiWaJYrX9smp3V46pBGbBeLFRGdh25kg1334VcBlD8HzhPeNIWQH9zhGmo2itIe25EHt9dQP7G5hmg==",
371
+ "license": "MIT",
372
+ "funding": {
373
+ "type": "github",
374
+ "url": "https://github.com/sponsors/wooorm"
375
+ }
376
+ },
377
+ "node_modules/regex": {
378
+ "version": "6.1.0",
379
+ "resolved": "https://registry.npmjs.org/regex/-/regex-6.1.0.tgz",
380
+ "integrity": "sha512-6VwtthbV4o/7+OaAF9I5L5V3llLEsoPyq9P1JVXkedTP33c7MfCG0/5NOPcSJn0TzXcG9YUrR0gQSWioew3LDg==",
381
+ "license": "MIT",
382
+ "dependencies": {
383
+ "regex-utilities": "^2.3.0"
384
+ }
385
+ },
386
+ "node_modules/regex-recursion": {
387
+ "version": "6.0.2",
388
+ "resolved": "https://registry.npmjs.org/regex-recursion/-/regex-recursion-6.0.2.tgz",
389
+ "integrity": "sha512-0YCaSCq2VRIebiaUviZNs0cBz1kg5kVS2UKUfNIx8YVs1cN3AV7NTctO5FOKBA+UT2BPJIWZauYHPqJODG50cg==",
390
+ "license": "MIT",
391
+ "dependencies": {
392
+ "regex-utilities": "^2.3.0"
393
+ }
394
+ },
395
+ "node_modules/regex-utilities": {
396
+ "version": "2.3.0",
397
+ "resolved": "https://registry.npmjs.org/regex-utilities/-/regex-utilities-2.3.0.tgz",
398
+ "integrity": "sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng==",
399
+ "license": "MIT"
400
+ },
401
+ "node_modules/space-separated-tokens": {
402
+ "version": "2.0.2",
403
+ "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz",
404
+ "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==",
405
+ "license": "MIT",
406
+ "funding": {
407
+ "type": "github",
408
+ "url": "https://github.com/sponsors/wooorm"
409
+ }
410
+ },
411
+ "node_modules/stringify-entities": {
412
+ "version": "4.0.4",
413
+ "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz",
414
+ "integrity": "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==",
415
+ "license": "MIT",
416
+ "dependencies": {
417
+ "character-entities-html4": "^2.0.0",
418
+ "character-entities-legacy": "^3.0.0"
419
+ },
420
+ "funding": {
421
+ "type": "github",
422
+ "url": "https://github.com/sponsors/wooorm"
423
+ }
424
+ },
425
+ "node_modules/trim-lines": {
426
+ "version": "3.0.1",
427
+ "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz",
428
+ "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==",
429
+ "license": "MIT",
430
+ "funding": {
431
+ "type": "github",
432
+ "url": "https://github.com/sponsors/wooorm"
433
+ }
434
+ },
435
+ "node_modules/unist-util-is": {
436
+ "version": "6.0.1",
437
+ "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.1.tgz",
438
+ "integrity": "sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==",
439
+ "license": "MIT",
440
+ "dependencies": {
441
+ "@types/unist": "^3.0.0"
442
+ },
443
+ "funding": {
444
+ "type": "opencollective",
445
+ "url": "https://opencollective.com/unified"
446
+ }
447
+ },
448
+ "node_modules/unist-util-position": {
449
+ "version": "5.0.0",
450
+ "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz",
451
+ "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==",
452
+ "license": "MIT",
453
+ "dependencies": {
454
+ "@types/unist": "^3.0.0"
455
+ },
456
+ "funding": {
457
+ "type": "opencollective",
458
+ "url": "https://opencollective.com/unified"
459
+ }
460
+ },
461
+ "node_modules/unist-util-stringify-position": {
462
+ "version": "4.0.0",
463
+ "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz",
464
+ "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==",
465
+ "license": "MIT",
466
+ "dependencies": {
467
+ "@types/unist": "^3.0.0"
468
+ },
469
+ "funding": {
470
+ "type": "opencollective",
471
+ "url": "https://opencollective.com/unified"
472
+ }
473
+ },
474
+ "node_modules/unist-util-visit": {
475
+ "version": "5.1.0",
476
+ "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.1.0.tgz",
477
+ "integrity": "sha512-m+vIdyeCOpdr/QeQCu2EzxX/ohgS8KbnPDgFni4dQsfSCtpz8UqDyY5GjRru8PDKuYn7Fq19j1CQ+nJSsGKOzg==",
478
+ "license": "MIT",
479
+ "dependencies": {
480
+ "@types/unist": "^3.0.0",
481
+ "unist-util-is": "^6.0.0",
482
+ "unist-util-visit-parents": "^6.0.0"
483
+ },
484
+ "funding": {
485
+ "type": "opencollective",
486
+ "url": "https://opencollective.com/unified"
487
+ }
488
+ },
489
+ "node_modules/unist-util-visit-parents": {
490
+ "version": "6.0.2",
491
+ "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.2.tgz",
492
+ "integrity": "sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ==",
493
+ "license": "MIT",
494
+ "dependencies": {
495
+ "@types/unist": "^3.0.0",
496
+ "unist-util-is": "^6.0.0"
497
+ },
498
+ "funding": {
499
+ "type": "opencollective",
500
+ "url": "https://opencollective.com/unified"
501
+ }
502
+ },
503
+ "node_modules/vfile": {
504
+ "version": "6.0.3",
505
+ "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz",
506
+ "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==",
507
+ "license": "MIT",
508
+ "dependencies": {
509
+ "@types/unist": "^3.0.0",
510
+ "vfile-message": "^4.0.0"
511
+ },
512
+ "funding": {
513
+ "type": "opencollective",
514
+ "url": "https://opencollective.com/unified"
515
+ }
516
+ },
517
+ "node_modules/vfile-message": {
518
+ "version": "4.0.3",
519
+ "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.3.tgz",
520
+ "integrity": "sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw==",
521
+ "license": "MIT",
522
+ "dependencies": {
523
+ "@types/unist": "^3.0.0",
524
+ "unist-util-stringify-position": "^4.0.0"
525
+ },
526
+ "funding": {
527
+ "type": "opencollective",
528
+ "url": "https://opencollective.com/unified"
529
+ }
530
+ },
531
+ "node_modules/zwitch": {
532
+ "version": "2.0.4",
533
+ "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz",
534
+ "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==",
535
+ "license": "MIT",
536
+ "funding": {
537
+ "type": "github",
538
+ "url": "https://github.com/sponsors/wooorm"
539
+ }
540
+ }
541
+ }
542
+ }
@@ -0,0 +1,138 @@
1
+ // Highlights one code block with Shiki and prints its <pre> for the markup in SKILL.md.
2
+ // Usage: node highlight.mjs <language> < excerpt.txt > block.html
3
+ import { spawnSync } from "node:child_process";
4
+ import { copyFileSync, existsSync, mkdirSync, mkdtempSync, readFileSync } from "node:fs";
5
+ import { renameSync, rmSync, writeFileSync } from "node:fs";
6
+ import { createRequire } from "node:module";
7
+ import { tmpdir } from "node:os";
8
+ import { dirname, join, resolve } from "node:path";
9
+ import { pathToFileURL } from "node:url";
10
+
11
+ const shiki = "4.4.3";
12
+ const packages = [
13
+ "@shikijs/core",
14
+ "@shikijs/engine-javascript",
15
+ "@shikijs/langs",
16
+ "@shikijs/themes",
17
+ ];
18
+ const themes = { light: "github-light-default", dark: "github-dark-default" };
19
+ const maxLines = 25;
20
+ // Shiki's names for text it doesn't highlight, such as program output.
21
+ const plain = ["text", "plaintext", "txt", "plain"];
22
+
23
+ const fail = (message) => {
24
+ process.stderr.write(`${message}\n`);
25
+ process.exit(1);
26
+ };
27
+ const fallback =
28
+ "Write the block as plain <pre><code> as SKILL.md says, and say so in the hand-over.";
29
+
30
+ // Shiki comes from PAGESHIP_SHIKI when set, a folder whose node_modules has these packages at
31
+ // this version, or from an install that npm makes once in the temporary folder.
32
+ // highlight-lock.json pins every package by its integrity hash, and npm checks each download.
33
+ const shikiFolder = () => {
34
+ if (process.env.PAGESHIP_SHIKI) return resolve(process.env.PAGESHIP_SHIKI);
35
+ const folder = join(tmpdir(), "pageship-highlight", `shiki-${shiki}`);
36
+ if (existsSync(folder)) return folder;
37
+ mkdirSync(dirname(folder), { recursive: true });
38
+ // Install beside the final folder and rename it into place, so a failed or concurrent
39
+ // install never leaves a half-filled folder behind.
40
+ const staging = mkdtempSync(`${folder}-`);
41
+ const dependencies = Object.fromEntries(packages.map((name) => [name, shiki]));
42
+ writeFileSync(
43
+ join(staging, "package.json"),
44
+ JSON.stringify({ name: "pageship-highlight", private: true, dependencies }),
45
+ );
46
+ copyFileSync(new URL("highlight-lock.json", import.meta.url), join(staging, "package-lock.json"));
47
+ // The cache path goes in the environment, because Windows runs npm through a shell that
48
+ // would split a path with spaces.
49
+ const npm = spawnSync("npm", ["ci", "--ignore-scripts", "--no-audit", "--no-fund"], {
50
+ cwd: staging,
51
+ encoding: "utf8",
52
+ env: { ...process.env, npm_config_cache: join(staging, ".npm") },
53
+ shell: process.platform === "win32",
54
+ });
55
+ rmSync(join(staging, ".npm"), { recursive: true, force: true });
56
+ if (npm.status !== 0) {
57
+ rmSync(staging, { recursive: true, force: true });
58
+ const reason =
59
+ npm.error?.message ??
60
+ npm.stderr.split("\n").find((line) => line.startsWith("npm error")) ??
61
+ `exit code ${npm.status}`;
62
+ fail(`Could not install Shiki ${shiki} with npm (${reason}). ${fallback}`);
63
+ }
64
+ try {
65
+ renameSync(staging, folder);
66
+ } catch {
67
+ // Another run installed it first.
68
+ rmSync(staging, { recursive: true, force: true });
69
+ }
70
+ return folder;
71
+ };
72
+
73
+ // Checks the version of each package and returns the language IDs @shikijs/langs exports, and
74
+ // a loader that names the folder when a file in it fails to load.
75
+ const shikiIn = (folder) => {
76
+ const manifests = packages.map((name) => {
77
+ try {
78
+ return JSON.parse(readFileSync(join(folder, "node_modules", name, "package.json")));
79
+ } catch {
80
+ return {};
81
+ }
82
+ });
83
+ manifests.forEach(({ version }, i) => {
84
+ if (version !== shiki) fail(`${folder} has no Shiki ${shiki} (${packages[i]}). ${fallback}`);
85
+ });
86
+ const languages = Object.keys(manifests[2].exports ?? {}).map((key) => key.slice(2));
87
+ const require = createRequire(join(folder, "package.json"));
88
+ const load = async (specifier) => {
89
+ try {
90
+ return await import(pathToFileURL(require.resolve(specifier)).href);
91
+ } catch (error) {
92
+ const fix = process.env.PAGESHIP_SHIKI ? "" : ` Delete ${folder} to reinstall it.`;
93
+ fail(`Shiki in ${folder} did not load (${error.message.split("\n")[0]}).${fix} ${fallback}`);
94
+ }
95
+ };
96
+ return { languages, load };
97
+ };
98
+
99
+ const language = process.argv[2];
100
+ if (!language) fail("Name the language, such as: node highlight.mjs typescript < excerpt.txt");
101
+ // A bare carriage return starts a new line too, once the page parses it.
102
+ const code = readFileSync(0, "utf8").replace(/(?:\r\n|\r|\n)$/u, "");
103
+ if (!code.trim()) fail("Pass the block's code on standard input.");
104
+ const lines = code.split(/\r\n|\r|\n/u).length;
105
+ if (lines > maxLines) {
106
+ fail(`${lines} lines; a block holds at most ${maxLines}. Cut lines or split the block.`);
107
+ }
108
+
109
+ const { languages, load } = shikiIn(shikiFolder());
110
+ if (!plain.includes(language) && !languages.includes(language)) {
111
+ fail(`Shiki has no language "${language}". Use its ID, such as typescript, or text.`);
112
+ }
113
+ const grammar = plain.includes(language) ? [] : [load(`@shikijs/langs/${language}`)];
114
+ const [{ createHighlighterCore }, { createJavaScriptRegexEngine }] = await Promise.all([
115
+ load("@shikijs/core"),
116
+ load("@shikijs/engine-javascript"),
117
+ ]);
118
+ const highlighter = await createHighlighterCore({
119
+ themes: [load(`@shikijs/themes/${themes.light}`), load(`@shikijs/themes/${themes.dark}`)],
120
+ langs: grammar,
121
+ engine: createJavaScriptRegexEngine({ forgiving: true }),
122
+ });
123
+ // Both themes give a token the same bold, italic or underline, so write it as a plain style.
124
+ const fontStyles = {
125
+ span(node) {
126
+ if (typeof node.properties.style !== "string") return;
127
+ node.properties.style = node.properties.style
128
+ .replaceAll(/--shiki-light-(font-style|font-weight|text-decoration):/gu, "$1:")
129
+ .replaceAll(/;--shiki-dark-(?:font-style|font-weight|text-decoration):[^;]*/gu, "");
130
+ },
131
+ };
132
+ const html = highlighter.codeToHtml(code, {
133
+ lang: language,
134
+ themes,
135
+ defaultColor: "light",
136
+ transformers: [fontStyles],
137
+ });
138
+ process.stdout.write(`${html}\n`);