@r_masseater/intent-book 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.
- package/README.md +3 -2
- package/dist/intent-book.mjs +59 -25
- package/dist/intent-book.mjs.map +1 -1
- package/package.json +1 -1
- package/skills/build-skill-docs-site/SKILL.md +1 -0
package/README.md
CHANGED
|
@@ -21,12 +21,13 @@ Links between those Markdown files become links between pages. Links to any othe
|
|
|
21
21
|
## Use it
|
|
22
22
|
|
|
23
23
|
```text
|
|
24
|
-
intent-book [--out <directory>] [--base <path>] [<package>...]
|
|
24
|
+
intent-book [--out <directory>] [--base <path>] [--no-landing] [<package>...]
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
- `<package>` is the directory of an npm package that has `skills/` and a `package.json`. It defaults to the current directory. Give several to build one site that switches between them.
|
|
27
|
+
- `<package>` is the directory of an npm package that has `skills/` and a `package.json`. It defaults to the current directory. Give several to build one site that switches between them. A directory without `skills/` is skipped when more than one is given, so a glob such as `node_modules/@scope/*` works.
|
|
28
28
|
- `--out` is the directory to write to. It defaults to `book`. It is replaced on every build, and a non-empty directory that this tool did not create is refused.
|
|
29
29
|
- `--base` is the path the site is served under, with a leading and a trailing slash. It defaults to `/`.
|
|
30
|
+
- `--no-landing` leaves out the `index.html` at the root, for a site that is copied into another site. The stylesheet, the script and the search index always go to `_intent-book/`, so they do not collide with the other site's files.
|
|
30
31
|
|
|
31
32
|
The output is static files. Serve it from any static host.
|
|
32
33
|
|
package/dist/intent-book.mjs
CHANGED
|
@@ -14,7 +14,12 @@ import remarkRehype from "remark-rehype";
|
|
|
14
14
|
import { unified } from "unified";
|
|
15
15
|
import { visit } from "unist-util-visit";
|
|
16
16
|
// package.json
|
|
17
|
-
var version = "0.
|
|
17
|
+
var version = "0.2.0";
|
|
18
|
+
// src/features/build-site/model/asset-paths.ts
|
|
19
|
+
const ASSET_DIRECTORY = "_intent-book";
|
|
20
|
+
const STYLE_PATH = `${ASSET_DIRECTORY}/book.css`;
|
|
21
|
+
const SCRIPT_PATH = `${ASSET_DIRECTORY}/book.js`;
|
|
22
|
+
const INDEX_PATH = `${ASSET_DIRECTORY}/search.json`;
|
|
18
23
|
// src/features/build-site/model/assets-script.ts
|
|
19
24
|
const SCRIPT = String.raw`const root = document.documentElement;
|
|
20
25
|
const body = document.body;
|
|
@@ -91,7 +96,7 @@ if (dialog) {
|
|
|
91
96
|
|
|
92
97
|
const load = async () => {
|
|
93
98
|
if (!index) {
|
|
94
|
-
index = await (await fetch(base + "
|
|
99
|
+
index = await (await fetch(base + "${INDEX_PATH}")).json();
|
|
95
100
|
}
|
|
96
101
|
return index;
|
|
97
102
|
};
|
|
@@ -864,14 +869,14 @@ dialog.search::backdrop {
|
|
|
864
869
|
}
|
|
865
870
|
`;
|
|
866
871
|
const ASSET_FILES = [{
|
|
867
|
-
path:
|
|
872
|
+
path: STYLE_PATH,
|
|
868
873
|
content: pipe([
|
|
869
874
|
BASE_STYLES,
|
|
870
875
|
COMPONENT_STYLES,
|
|
871
876
|
PAGE_STYLES
|
|
872
877
|
], Array.join("\n"))
|
|
873
878
|
}, {
|
|
874
|
-
path:
|
|
879
|
+
path: SCRIPT_PATH,
|
|
875
880
|
content: SCRIPT
|
|
876
881
|
}];
|
|
877
882
|
// src/entities/book/model/book.ts
|
|
@@ -925,8 +930,8 @@ const pageRoute = (page) => {
|
|
|
925
930
|
};
|
|
926
931
|
const routeOf = Function.dual(DATA_FIRST_ARITY, (slug, page) => `/${slug}/${pageRoute(page)}`);
|
|
927
932
|
// src/entities/book/model/skill.ts
|
|
928
|
-
const taggedError$
|
|
929
|
-
var SkillFormatError = class extends taggedError$
|
|
933
|
+
const taggedError$4 = Schema.TaggedError;
|
|
934
|
+
var SkillFormatError = class extends taggedError$4()("SkillFormatError", {
|
|
930
935
|
skill: Schema.String,
|
|
931
936
|
reason: Schema.String
|
|
932
937
|
}) {};
|
|
@@ -1199,7 +1204,7 @@ const landingPage = (input) => {
|
|
|
1199
1204
|
h("title", "Skills"),
|
|
1200
1205
|
h("link", {
|
|
1201
1206
|
rel: "stylesheet",
|
|
1202
|
-
href: `${input.base}
|
|
1207
|
+
href: `${input.base}${STYLE_PATH}`
|
|
1203
1208
|
})
|
|
1204
1209
|
];
|
|
1205
1210
|
const body = h("main", [h("article", [h("h1", "Skills"), h("ul", { class: "rows" }, rows)])]);
|
|
@@ -1212,8 +1217,8 @@ const landingPage = (input) => {
|
|
|
1212
1217
|
const SECOND_DEPTH = 2;
|
|
1213
1218
|
const THIRD_DEPTH = 3;
|
|
1214
1219
|
const ONE_NODE = 1;
|
|
1215
|
-
const taggedError$
|
|
1216
|
-
var MarkdownRenderError = class extends taggedError$
|
|
1220
|
+
const taggedError$3 = Schema.TaggedError;
|
|
1221
|
+
var MarkdownRenderError = class extends taggedError$3()("MarkdownRenderError", { reason: Schema.String }) {};
|
|
1217
1222
|
const SEVERITY = /^(?<word>CRITICAL|HIGH|MEDIUM|LOW)\b/u;
|
|
1218
1223
|
const SCHEME = /^(?:[a-z][a-z\d+.-]*:|\/\/|#)/iu;
|
|
1219
1224
|
const SECOND_LEVEL = "h2";
|
|
@@ -1353,7 +1358,6 @@ const SearchEntry = Schema.Struct({
|
|
|
1353
1358
|
});
|
|
1354
1359
|
const SEARCH_TEXT_START = 0;
|
|
1355
1360
|
const SEARCH_TEXT_LIMIT = 6e3;
|
|
1356
|
-
const INDEX_PATH = "assets/search.json";
|
|
1357
1361
|
const encodeEntries = Schema.encodeEffect(Schema.fromJsonString(Schema.Array(SearchEntry)));
|
|
1358
1362
|
const searchText = (input) => String$1.slice(SEARCH_TEXT_START, SEARCH_TEXT_LIMIT)(`${input.lead} ${input.body}`);
|
|
1359
1363
|
const searchIndexFile = (entries) => Effect.map(encodeEntries(entries), (content) => ({
|
|
@@ -1525,10 +1529,10 @@ const headOf = (shell) => [
|
|
|
1525
1529
|
h("title", `${shell.title} · ${shell.book.name}`),
|
|
1526
1530
|
h("link", {
|
|
1527
1531
|
rel: "stylesheet",
|
|
1528
|
-
href: `${shell.base}
|
|
1532
|
+
href: `${shell.base}${STYLE_PATH}`
|
|
1529
1533
|
}),
|
|
1530
1534
|
h("script", {
|
|
1531
|
-
src: `${shell.base}
|
|
1535
|
+
src: `${shell.base}${SCRIPT_PATH}`,
|
|
1532
1536
|
defer: true
|
|
1533
1537
|
})
|
|
1534
1538
|
];
|
|
@@ -1626,6 +1630,13 @@ const renderBook = Effect.fn("renderBook")(function* renderBook(input) {
|
|
|
1626
1630
|
});
|
|
1627
1631
|
// src/features/build-site/model/build-site.ts
|
|
1628
1632
|
const RENDER_CONCURRENCY = 8;
|
|
1633
|
+
const landingFiles = (input) => Boolean.match(input.landing, {
|
|
1634
|
+
onTrue: () => [{
|
|
1635
|
+
path: "index.html",
|
|
1636
|
+
content: landingPage(input)
|
|
1637
|
+
}],
|
|
1638
|
+
onFalse: () => []
|
|
1639
|
+
});
|
|
1629
1640
|
const buildSite = Effect.fn("buildSite")(function* buildSite(input) {
|
|
1630
1641
|
const built = yield* Effect.forEach(input.books, (book) => renderBook({
|
|
1631
1642
|
books: input.books,
|
|
@@ -1636,14 +1647,14 @@ const buildSite = Effect.fn("buildSite")(function* buildSite(input) {
|
|
|
1636
1647
|
const search = yield* searchIndexFile(entries);
|
|
1637
1648
|
return [
|
|
1638
1649
|
...pipe(built, Array.flatMap((part) => part.files)),
|
|
1639
|
-
|
|
1640
|
-
path: "index.html",
|
|
1641
|
-
content: landingPage(input)
|
|
1642
|
-
},
|
|
1650
|
+
...landingFiles(input),
|
|
1643
1651
|
...ASSET_FILES,
|
|
1644
1652
|
search
|
|
1645
1653
|
];
|
|
1646
1654
|
});
|
|
1655
|
+
// src/features/read-book/model/no-skills-error.ts
|
|
1656
|
+
const taggedError$2 = Schema.TaggedError;
|
|
1657
|
+
var NoSkillsError = class extends taggedError$2()("NoSkillsError", { directory: Schema.String }) {};
|
|
1647
1658
|
// src/features/read-book/model/read-book.ts
|
|
1648
1659
|
const taggedError$1 = Schema.TaggedError;
|
|
1649
1660
|
var BookReadError = class extends taggedError$1()("BookReadError", {
|
|
@@ -1673,6 +1684,8 @@ const GIT_PREFIX = /^git\+/u;
|
|
|
1673
1684
|
const GIT_SUFFIX = /\.git$/u;
|
|
1674
1685
|
const SHORTHAND = /^(?:github:)?(?<slug>[\w.-]+\/[\w.-]+)$/u;
|
|
1675
1686
|
const FILE_CONCURRENCY$1 = 16;
|
|
1687
|
+
const READ_CONCURRENCY = 4;
|
|
1688
|
+
const ONE_DIRECTORY = 1;
|
|
1676
1689
|
const githubSlug = (value) => pipe(value, String$1.match(SHORTHAND), Option.flatMapNullishOr((found) => found.groups), Option.flatMap((groups) => Record.get(groups, "slug")));
|
|
1677
1690
|
const repositoryUrl = (value) => pipe(githubSlug(value), Option.match({
|
|
1678
1691
|
onNone: () => pipe(value, String$1.replace(GIT_PREFIX, ""), String$1.replace(GIT_SUFFIX, "")),
|
|
@@ -1731,10 +1744,7 @@ const readSkill = Effect.fn("readSkill")(function* readSkill(input) {
|
|
|
1731
1744
|
const readSkills = Effect.fn("readSkills")(function* readSkills(directory) {
|
|
1732
1745
|
const skillsDirectory = (yield* Path.Path).join(directory, SKILLS_DIRECTORY);
|
|
1733
1746
|
const names = yield* skillNames(skillsDirectory);
|
|
1734
|
-
yield* Effect.filterOrFail(Effect.succeed(names), Array.isReadonlyArrayNonEmpty, () =>
|
|
1735
|
-
directory,
|
|
1736
|
-
reason: `no ${SKILL_FILE} under ${SKILLS_DIRECTORY}/`
|
|
1737
|
-
}));
|
|
1747
|
+
yield* Effect.filterOrFail(Effect.succeed(names), Array.isReadonlyArrayNonEmpty, () => NoSkillsError.make({ directory }));
|
|
1738
1748
|
return yield* Effect.forEach(names, (name) => readSkill({
|
|
1739
1749
|
skillsDirectory,
|
|
1740
1750
|
name,
|
|
@@ -1755,6 +1765,20 @@ const readBook = Effect.fn("readBook")(function* readBook(directory) {
|
|
|
1755
1765
|
skills
|
|
1756
1766
|
};
|
|
1757
1767
|
});
|
|
1768
|
+
const skippable = (directories) => (error) => Boolean.match(Array.isReadonlyArrayNonEmpty(Array.drop(directories, ONE_DIRECTORY)), {
|
|
1769
|
+
onTrue: () => Effect.succeed(Option.none()),
|
|
1770
|
+
onFalse: () => Effect.fail(error)
|
|
1771
|
+
});
|
|
1772
|
+
/** @internal */
|
|
1773
|
+
const readBooks = Effect.fn("readBooks")(function* readBooks(directories) {
|
|
1774
|
+
const results = yield* Effect.forEach(directories, (directory) => readBook(directory).pipe(Effect.asSome, Effect.catchTag("NoSkillsError", skippable(directories))), { concurrency: READ_CONCURRENCY });
|
|
1775
|
+
const books = Array.getSomes(results);
|
|
1776
|
+
yield* Effect.filterOrFail(Effect.succeed(books), Array.isReadonlyArrayNonEmpty, () => NoSkillsError.make({ directory: Array.join(directories, ", ") }));
|
|
1777
|
+
return {
|
|
1778
|
+
books,
|
|
1779
|
+
skipped: pipe(Array.zip(directories, results), Array.filter(([, result]) => Option.isNone(result)), Array.map(([directory]) => directory))
|
|
1780
|
+
};
|
|
1781
|
+
});
|
|
1758
1782
|
// src/features/write-site/model/write-site.ts
|
|
1759
1783
|
const taggedError = Schema.TaggedError;
|
|
1760
1784
|
var SiteWriteError = class extends taggedError()("SiteWriteError", {
|
|
@@ -1799,17 +1823,21 @@ const writeSite = Effect.fn("writeSite")(function* writeSite(directory, files) {
|
|
|
1799
1823
|
});
|
|
1800
1824
|
// bin/intent-book.ts
|
|
1801
1825
|
const CURRENT_DIRECTORY = ".";
|
|
1802
|
-
const READ_CONCURRENCY = 4;
|
|
1803
1826
|
const directoriesOf = (given) => Boolean.match(Array.isReadonlyArrayEmpty(given), {
|
|
1804
1827
|
onTrue: () => [CURRENT_DIRECTORY],
|
|
1805
1828
|
onFalse: () => given
|
|
1806
1829
|
});
|
|
1807
1830
|
const build = Effect.fn("build")(function* build(input) {
|
|
1808
1831
|
const path = yield* Path.Path;
|
|
1809
|
-
const books = yield*
|
|
1832
|
+
const { books, skipped } = yield* readBooks(Array.map(directoriesOf(input.directories), (directory) => path.resolve(directory)));
|
|
1810
1833
|
const files = yield* buildSite({
|
|
1811
1834
|
books,
|
|
1812
|
-
base: input.base
|
|
1835
|
+
base: input.base,
|
|
1836
|
+
landing: input.landing
|
|
1837
|
+
});
|
|
1838
|
+
yield* Boolean.match(Array.isReadonlyArrayNonEmpty(skipped), {
|
|
1839
|
+
onTrue: () => Console.log(`skipped (no skills): ${Array.join(skipped, ", ")}`),
|
|
1840
|
+
onFalse: () => Effect.void
|
|
1813
1841
|
});
|
|
1814
1842
|
yield* writeSite(path.resolve(input.out), files);
|
|
1815
1843
|
yield* Console.log(`${books.length} package(s), ${files.length} files -> ${input.out}`);
|
|
@@ -1817,8 +1845,14 @@ const build = Effect.fn("build")(function* build(input) {
|
|
|
1817
1845
|
const command = Command.make("intent-book", {
|
|
1818
1846
|
directories: Argument.String("package").pipe(Argument.withDescription("Directory of an npm package that ships skills/ (default: .)"), Argument.variadic()),
|
|
1819
1847
|
out: Flag.String("out").pipe(Flag.withDescription("Directory to write the site to"), Flag.withDefault("book")),
|
|
1820
|
-
base: Flag.String("base").pipe(Flag.withDescription("Path the site is served under, with a leading and trailing slash"), Flag.withDefault("/"))
|
|
1821
|
-
|
|
1848
|
+
base: Flag.String("base").pipe(Flag.withDescription("Path the site is served under, with a leading and trailing slash"), Flag.withDefault("/")),
|
|
1849
|
+
noLanding: Flag.Boolean("no-landing").pipe(Flag.withDescription("Do not write index.html at the root, for a site that lives inside another site"))
|
|
1850
|
+
}, (input) => build({
|
|
1851
|
+
directories: input.directories,
|
|
1852
|
+
out: input.out,
|
|
1853
|
+
base: input.base,
|
|
1854
|
+
landing: !input.noLanding
|
|
1855
|
+
}));
|
|
1822
1856
|
runMain("intent-book")(Command.run(command, { version }));
|
|
1823
1857
|
export {};
|
|
1824
1858
|
|
package/dist/intent-book.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intent-book.mjs","names":["Arr","MARKDOWN_SUFFIX","Str","Arr","Fn","Rec","taggedError","Str","Bool","SKILL_FILE","Str","Arr","Rec","Fn","Arr","Str","Fn","Rec","overviewRoute","SINGLE_BOOK","taggedError","textOf","Str","Rec","Arr","MARKDOWN_SUFFIX","Str","Arr","Str","Rec","Arr","Bool","Str","RENDER_CONCURRENCY","Fn","textOf","Arr","Arr","taggedError","FILE_CONCURRENCY","Str","Rec","Arr","Arr","Bool","Bool","Arr","manifest.version"],"sources":["../package.json","../src/features/build-site/model/assets-script.ts","../src/features/build-site/model/assets-styles-1.ts","../src/features/build-site/model/assets-styles-2.ts","../src/features/build-site/model/assets-styles-3.ts","../src/features/build-site/model/assets.ts","../src/entities/book/model/book.ts","../src/entities/book/model/skill.ts","../src/shared/lib/html.ts","../src/features/build-site/model/links.ts","../src/features/build-site/model/pages.ts","../src/shared/lib/render-markdown.ts","../src/features/build-site/model/documents.ts","../src/features/build-site/model/search-index.ts","../src/features/build-site/model/shell.ts","../src/features/build-site/model/render-book.ts","../src/features/build-site/model/build-site.ts","../src/features/read-book/model/read-book.ts","../src/features/write-site/model/write-site.ts","../bin/intent-book.ts"],"sourcesContent":["","export const SCRIPT = String.raw`const root = document.documentElement;\nconst body = document.body;\nconst narrow = window.matchMedia(\"(max-width: 820px)\");\n\nconst remember = (key, value) => {\n try {\n localStorage.setItem(key, value);\n } catch {\n return;\n }\n};\n\nconst recall = (key) => {\n try {\n return localStorage.getItem(key);\n } catch {\n return null;\n }\n};\n\nconst savedTheme = recall(\"intent-book-theme\");\nif (savedTheme) {\n root.dataset.theme = savedTheme;\n}\n\nif (recall(\"intent-book-nav\") === \"closed\" && !narrow.matches) {\n body.dataset.nav = \"closed\";\n}\n\ndocument.querySelector(\"[data-theme-toggle]\")?.addEventListener(\"click\", () => {\n const dark =\n root.dataset.theme === \"dark\" ||\n (root.dataset.theme === undefined && window.matchMedia(\"(prefers-color-scheme: dark)\").matches);\n root.dataset.theme = dark ? \"light\" : \"dark\";\n remember(\"intent-book-theme\", root.dataset.theme);\n});\n\ndocument.querySelector(\"[data-nav-toggle]\")?.addEventListener(\"click\", () => {\n if (narrow.matches) {\n body.dataset.nav = body.dataset.nav === \"open\" ? \"\" : \"open\";\n return;\n }\n body.dataset.nav = body.dataset.nav === \"closed\" ? \"\" : \"closed\";\n remember(\"intent-book-nav\", body.dataset.nav);\n});\n\nconst headings = [...document.querySelectorAll(\".prose :is(h2, h3)[id]\")];\nconst links = new Map(\n [...document.querySelectorAll(\".toc a\")].map((link) => [link.getAttribute(\"href\").slice(1), link]),\n);\nif (headings.length > 0 && links.size > 0) {\n const mark = () => {\n const passed = headings.filter((heading) => heading.getBoundingClientRect().top < 120);\n const current = passed.at(-1) ?? headings[0];\n for (const [id, link] of links) {\n if (id === current.id) {\n link.setAttribute(\"aria-current\", \"true\");\n } else {\n link.removeAttribute(\"aria-current\");\n }\n }\n };\n window.addEventListener(\"scroll\", mark, { passive: true });\n mark();\n}\n\nconst dialog = document.querySelector(\"dialog.search\");\nif (dialog) {\n const input = dialog.querySelector(\"input\");\n const list = dialog.querySelector(\"ul\");\n const base = document.querySelector(\"meta[name='intent-book-base']\").content;\n let index;\n\n const load = async () => {\n if (!index) {\n index = await (await fetch(base + \"assets/search.json\")).json();\n }\n return index;\n };\n\n const show = (entries) => {\n list.replaceChildren(\n ...entries.map((entry) => {\n const item = document.createElement(\"li\");\n const link = document.createElement(\"a\");\n link.href = entry.url;\n link.textContent = entry.title;\n const detail = document.createElement(\"small\");\n detail.textContent = entry.book + \" · \" + entry.name;\n link.append(detail);\n item.append(link);\n return item;\n }),\n );\n if (entries.length === 0) {\n const empty = document.createElement(\"li\");\n empty.className = \"empty\";\n empty.textContent = input.value ? \"No matches\" : \"\";\n list.append(empty);\n }\n };\n\n const search = async () => {\n const words = input.value.toLowerCase().split(/\\s+/u).filter(Boolean);\n const entries = await load();\n if (words.length === 0) {\n show([]);\n return;\n }\n const scored = entries\n .map((entry) => {\n const haystack = entry.text.toLowerCase();\n const title = (entry.title + \" \" + entry.name).toLowerCase();\n if (!words.every((word) => haystack.includes(word))) {\n return undefined;\n }\n return { entry, score: words.filter((word) => title.includes(word)).length };\n })\n .filter(Boolean)\n .sort((left, right) => right.score - left.score);\n show(scored.slice(0, 30).map((match) => match.entry));\n };\n\n const open = () => {\n dialog.showModal();\n input.focus();\n input.select();\n };\n\n document.querySelector(\"[data-search-open]\")?.addEventListener(\"click\", open);\n input.addEventListener(\"input\", search);\n input.addEventListener(\"keydown\", (event) => {\n if (event.key === \"Enter\") {\n list.querySelector(\"a\")?.click();\n }\n });\n dialog.addEventListener(\"click\", (event) => {\n if (event.target === dialog) {\n dialog.close();\n }\n });\n window.addEventListener(\"keydown\", (event) => {\n if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === \"k\") {\n event.preventDefault();\n open();\n }\n });\n}\n`;\n","export const BASE_STYLES = String.raw`:root {\n --bg: #ffffff;\n --bg-soft: #f7f7f5;\n --ink: #1b1d1f;\n --ink-soft: #5c6166;\n --line: #e4e4e0;\n --accent: #0b6b5d;\n --accent-soft: #e3f1ee;\n --critical: #b42318;\n --high: #b54708;\n --code-bg: #f6f6f3;\n --sidebar: 17rem;\n --toc: 14.5rem;\n --measure: 46rem;\n --top: 3.5rem;\n color-scheme: light;\n}\n\n:root[data-theme=\"dark\"] {\n --bg: #15171a;\n --bg-soft: #1b1e22;\n --ink: #e8e9ea;\n --ink-soft: #a0a5ab;\n --line: #2c3036;\n --accent: #4fc3ae;\n --accent-soft: #1d2f2c;\n --critical: #ff8a80;\n --high: #f5b361;\n --code-bg: #1b1e22;\n color-scheme: dark;\n}\n\n@media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) {\n --bg: #15171a;\n --bg-soft: #1b1e22;\n --ink: #e8e9ea;\n --ink-soft: #a0a5ab;\n --line: #2c3036;\n --accent: #4fc3ae;\n --accent-soft: #1d2f2c;\n --critical: #ff8a80;\n --high: #f5b361;\n --code-bg: #1b1e22;\n color-scheme: dark;\n }\n}\n\n* {\n box-sizing: border-box;\n}\n\nhtml {\n scroll-padding-top: calc(var(--top) + 1rem);\n}\n\nbody {\n margin: 0;\n background: var(--bg);\n color: var(--ink);\n font: 16px/1.7 system-ui, -apple-system, \"Segoe UI\", \"Hiragino Sans\", \"Noto Sans JP\", sans-serif;\n -webkit-font-smoothing: antialiased;\n}\n\na {\n color: var(--accent);\n text-underline-offset: 0.18em;\n}\n\nbutton {\n font: inherit;\n color: inherit;\n}\n\n.top {\n position: sticky;\n top: 0;\n z-index: 20;\n display: flex;\n align-items: center;\n gap: 0.75rem;\n height: var(--top);\n padding: 0 1rem;\n background: var(--bg);\n border-bottom: 1px solid var(--line);\n}\n\n.brand {\n font-weight: 650;\n color: var(--ink);\n text-decoration: none;\n}\n\n.brand small {\n margin-left: 0.5rem;\n font-weight: 400;\n color: var(--ink-soft);\n}\n\n.top .grow {\n flex: 1;\n}\n\n.icon-button,\n.search-open {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n min-height: 2.25rem;\n padding: 0 0.75rem;\n border: 1px solid var(--line);\n border-radius: 0.5rem;\n background: var(--bg);\n cursor: pointer;\n}\n\n.icon-button:hover,\n.search-open:hover {\n background: var(--bg-soft);\n}\n\n.search-open {\n min-width: 15rem;\n color: var(--ink-soft);\n justify-content: space-between;\n}\n\n.search-open kbd {\n font: 0.75rem ui-monospace, monospace;\n padding: 0.05rem 0.4rem;\n border: 1px solid var(--line);\n border-radius: 0.3rem;\n}\n\n.shell {\n display: grid;\n grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--toc);\n min-height: calc(100vh - var(--top));\n}\n\nbody[data-nav=\"closed\"] .shell {\n grid-template-columns: 0 minmax(0, 1fr) var(--toc);\n}\n\nbody[data-nav=\"closed\"] .side {\n visibility: hidden;\n padding: 0;\n border: 0;\n}\n\n.side,\n.toc {\n position: sticky;\n top: var(--top);\n align-self: start;\n max-height: calc(100vh - var(--top));\n overflow-y: auto;\n font-size: 0.9rem;\n}\n\n.side {\n padding: 1.25rem 0.75rem 3rem 1rem;\n border-right: 1px solid var(--line);\n}\n\n.side ul,\n.toc ul {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.side a {\n display: block;\n padding: 0.28rem 0.6rem;\n border-radius: 0.4rem;\n color: var(--ink-soft);\n text-decoration: none;\n}\n\n.side a:hover {\n background: var(--bg-soft);\n color: var(--ink);\n}\n\n.side a[aria-current=\"page\"] {\n background: var(--accent-soft);\n color: var(--accent);\n font-weight: 600;\n}\n\n.side details > summary {\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: pointer;\n list-style: none;\n}\n\n.side details > summary > a {\n flex: 1;\n}\n\n.side details > summary::-webkit-details-marker {\n display: none;\n}\n\n.side .group > summary {\n margin-top: 0.9rem;\n padding: 0.25rem 0.6rem;\n color: var(--ink-soft);\n font-size: 0.72rem;\n font-weight: 650;\n letter-spacing: 0.06em;\n text-transform: uppercase;\n}\n\n.side summary::after {\n content: \"\";\n flex: none;\n width: 0.4rem;\n height: 0.4rem;\n margin: 0 0.6rem;\n border-right: 1.5px solid currentColor;\n border-bottom: 1.5px solid currentColor;\n transform: rotate(-45deg);\n transition: transform 0.12s;\n}\n`;\n","export const COMPONENT_STYLES = String.raw`.side details[open] > summary::after {\n transform: rotate(45deg);\n}\n\n.side .children {\n margin-left: 0.9rem;\n border-left: 1px solid var(--line);\n}\n\n.side .book-switch > summary {\n display: flex;\n align-items: center;\n gap: 0.4rem;\n padding: 0.5rem 0.7rem;\n border: 1px solid var(--line);\n border-radius: 0.5rem;\n font-weight: 600;\n}\n\n.side .book-switch ul {\n margin: 0.25rem 0 0.5rem;\n}\n\n.side .book-switch summary strong {\n margin-right: auto;\n overflow-wrap: anywhere;\n}\n\nmain {\n min-width: 0;\n padding: 2rem 2.5rem 5rem;\n}\n\narticle {\n max-width: var(--measure);\n margin: 0 auto;\n}\n\n.crumbs {\n margin: 0 0 0.5rem;\n font-size: 0.85rem;\n color: var(--ink-soft);\n}\n\n.crumbs a {\n color: inherit;\n}\n\nh1 {\n margin: 0 0 0.4rem;\n font-size: 2.25rem;\n line-height: 1.2;\n letter-spacing: -0.01em;\n}\n\n.lead {\n margin: 0 0 1rem;\n font-size: 1rem;\n line-height: 1.65;\n color: var(--ink-soft);\n}\n\n.chips {\n display: flex;\n flex-wrap: wrap;\n gap: 0.5rem;\n margin: 0 0 1.25rem;\n}\n\n.chips span,\n.chips a {\n display: inline-block;\n padding: 0.05rem 0.65rem;\n border: 1px solid var(--line);\n border-radius: 999px;\n font-size: 0.8rem;\n color: var(--ink-soft);\n text-decoration: none;\n}\n\n.chips a:hover {\n background: var(--bg-soft);\n}\n\n.need {\n margin: 0 0 1.75rem;\n padding: 0.75rem 1rem;\n border-left: 3px solid var(--accent);\n background: var(--bg-soft);\n border-radius: 0 0.4rem 0.4rem 0;\n font-size: 0.92rem;\n}\n\n.need strong {\n display: block;\n margin-bottom: 0.15rem;\n}\n\n.need span + span::before {\n content: \"·\";\n margin: 0 0.5rem;\n color: var(--ink-soft);\n}\n\n.prose h2 {\n margin: 2.5rem 0 0.75rem;\n padding-top: 1.5rem;\n border-top: 1px solid var(--line);\n font-size: 1.5rem;\n line-height: 1.3;\n}\n\n.prose h3 {\n margin: 1.75rem 0 0.5rem;\n font-size: 1.15rem;\n}\n\n.prose h3[data-severity] {\n padding-left: 0.75rem;\n border-left: 3px solid var(--line);\n}\n\n.prose h3[data-severity=\"critical\"] {\n border-color: var(--critical);\n}\n\n.prose h3[data-severity=\"high\"] {\n border-color: var(--high);\n}\n\n.prose :is(h2, h3, h4) > a {\n color: inherit;\n text-decoration: none;\n}\n\n.prose p,\n.prose ul,\n.prose ol {\n margin: 0.85rem 0;\n}\n\n.prose code {\n padding: 0.1rem 0.3rem;\n border-radius: 0.3rem;\n background: var(--code-bg);\n font: 0.88em ui-monospace, \"SF Mono\", Menlo, Consolas, monospace;\n}\n\n.prose pre {\n margin: 1.1rem 0;\n padding: 0.9rem 1.1rem;\n overflow-x: auto;\n border: 1px solid var(--line);\n border-radius: 0.5rem;\n background: var(--code-bg);\n font-size: 0.86rem;\n line-height: 1.6;\n}\n\n.prose pre code {\n padding: 0;\n background: none;\n font-size: inherit;\n}\n\n.shiki,\n.shiki span {\n color: var(--shiki-light);\n}\n\n:root[data-theme=\"dark\"] .shiki,\n:root[data-theme=\"dark\"] .shiki span {\n color: var(--shiki-dark);\n}\n\n@media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) .shiki,\n :root:not([data-theme=\"light\"]) .shiki span {\n color: var(--shiki-dark);\n }\n}\n\n.shiki {\n background: transparent !important;\n}\n\n.prose table {\n width: 100%;\n margin: 1.1rem 0;\n border-collapse: collapse;\n font-size: 0.92rem;\n}\n\n.prose th,\n.prose td {\n padding: 0.45rem 0.7rem;\n border: 1px solid var(--line);\n text-align: left;\n}\n\n.prose th {\n background: var(--bg-soft);\n}\n\n.prose blockquote {\n margin: 1rem 0;\n padding: 0.1rem 1rem;\n border-left: 3px solid var(--line);\n color: var(--ink-soft);\n}\n\n.sources {\n margin-top: 3rem;\n padding-top: 1.25rem;\n border-top: 1px solid var(--line);\n font-size: 0.9rem;\n}\n\n.sources h2 {\n margin: 0 0 0.5rem;\n font-size: 0.8rem;\n letter-spacing: 0.06em;\n text-transform: uppercase;\n color: var(--ink-soft);\n}\n\n.sources ul {\n margin: 0;\n padding-left: 1.1rem;\n}\n\n.sources code {\n font: 0.85em ui-monospace, monospace;\n}\n`;\n","export const PAGE_STYLES = String.raw`.pager {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 1rem;\n margin-top: 3rem;\n}\n\n.pager a {\n display: block;\n padding: 0.7rem 1rem;\n border: 1px solid var(--line);\n border-radius: 0.5rem;\n text-decoration: none;\n color: var(--ink);\n}\n\n.pager a:hover {\n border-color: var(--accent);\n}\n\n.pager small {\n display: block;\n color: var(--ink-soft);\n}\n\n.pager .next {\n grid-column: 2;\n text-align: right;\n}\n\n.rows {\n margin: 0.5rem 0 1.5rem;\n padding: 0;\n list-style: none;\n}\n\n.rows a {\n display: grid;\n grid-template-columns: 15rem minmax(0, 1fr);\n gap: 1rem;\n padding: 0.7rem 0;\n border-bottom: 1px solid var(--line);\n color: var(--ink);\n text-decoration: none;\n}\n\n.rows a:hover .name {\n text-decoration: underline;\n}\n\n.rows .name {\n font-weight: 600;\n overflow-wrap: anywhere;\n}\n\n.rows .desc {\n display: -webkit-box;\n overflow: hidden;\n color: var(--ink-soft);\n font-size: 0.92rem;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n}\n\n.overview h2 {\n margin: 2rem 0 0;\n font-size: 0.8rem;\n letter-spacing: 0.06em;\n text-transform: uppercase;\n color: var(--ink-soft);\n}\n\n.toc {\n padding: 2rem 1rem 3rem 0.5rem;\n}\n\n.toc h2 {\n margin: 0 0 0.6rem;\n font-size: 0.72rem;\n letter-spacing: 0.06em;\n text-transform: uppercase;\n color: var(--ink-soft);\n}\n\n.toc ul {\n border-left: 1px solid var(--line);\n}\n\n.toc a {\n display: block;\n padding: 0.18rem 0 0.18rem 0.8rem;\n margin-left: -1px;\n border-left: 2px solid transparent;\n color: var(--ink-soft);\n text-decoration: none;\n}\n\n.toc .depth-3 a {\n padding-left: 1.6rem;\n}\n\n.toc a:hover {\n color: var(--ink);\n}\n\n.toc a[aria-current=\"true\"] {\n border-left-color: var(--accent);\n color: var(--ink);\n font-weight: 600;\n}\n\ndialog.search {\n width: min(36rem, calc(100vw - 2rem));\n margin-top: 10vh;\n padding: 0;\n border: 1px solid var(--line);\n border-radius: 0.75rem;\n background: var(--bg);\n color: var(--ink);\n}\n\ndialog.search::backdrop {\n background: rgb(0 0 0 / 0.35);\n}\n\n.search input {\n width: 100%;\n padding: 0.9rem 1.1rem;\n border: 0;\n border-bottom: 1px solid var(--line);\n background: transparent;\n color: inherit;\n font: inherit;\n outline: none;\n}\n\n.search ul {\n max-height: 55vh;\n margin: 0;\n padding: 0.4rem;\n overflow-y: auto;\n list-style: none;\n}\n\n.search li a {\n display: block;\n padding: 0.55rem 0.7rem;\n border-radius: 0.4rem;\n color: var(--ink);\n text-decoration: none;\n}\n\n.search li a:hover,\n.search li a[data-active] {\n background: var(--accent-soft);\n}\n\n.search li small {\n display: block;\n color: var(--ink-soft);\n}\n\n.search .empty {\n padding: 0.9rem 1.1rem;\n color: var(--ink-soft);\n}\n\n@media (max-width: 1180px) {\n .shell,\n body[data-nav=\"closed\"] .shell {\n grid-template-columns: var(--sidebar) minmax(0, 1fr);\n }\n\n body[data-nav=\"closed\"] .shell {\n grid-template-columns: 0 minmax(0, 1fr);\n }\n\n .toc {\n display: none;\n }\n}\n\n@media (max-width: 820px) {\n .shell,\n body[data-nav=\"closed\"] .shell {\n grid-template-columns: minmax(0, 1fr);\n }\n\n .side {\n position: fixed;\n inset: var(--top) 0 0 0;\n z-index: 15;\n width: min(20rem, 88vw);\n max-height: none;\n background: var(--bg);\n transform: translateX(-100%);\n transition: transform 0.15s;\n }\n\n body[data-nav=\"open\"] .side {\n transform: none;\n }\n\n body[data-nav=\"closed\"] .side {\n visibility: visible;\n padding: 1.25rem 0.75rem 3rem 1rem;\n border-right: 1px solid var(--line);\n }\n\n main {\n padding: 1.5rem 1rem 4rem;\n }\n\n h1 {\n font-size: 1.8rem;\n }\n\n .search-open {\n min-width: 0;\n }\n\n .search-open span {\n display: none;\n }\n\n .rows a {\n grid-template-columns: 1fr;\n gap: 0.1rem;\n }\n}\n`;\n","import { Array as Arr, pipe } from \"effect\";\n\nimport type { SiteFile } from \"#/shared/lib/site-file.ts\";\n\nimport { SCRIPT } from \"./assets-script.ts\";\nimport { BASE_STYLES } from \"./assets-styles-1.ts\";\nimport { COMPONENT_STYLES } from \"./assets-styles-2.ts\";\nimport { PAGE_STYLES } from \"./assets-styles-3.ts\";\n\nconst STYLE_SEPARATOR = \"\\n\";\n\nexport const ASSET_FILES: readonly SiteFile[] = [\n {\n path: \"assets/book.css\",\n content: pipe([BASE_STYLES, COMPONENT_STYLES, PAGE_STYLES], Arr.join(STYLE_SEPARATOR)),\n },\n { path: \"assets/book.js\", content: SCRIPT },\n];\n","import {\n Array as Arr,\n Function as Fn,\n Option,\n Order,\n pipe,\n Record as Rec,\n String as Str,\n} from \"effect\";\n\nimport type { Skill } from \"./skill.ts\";\n\nexport interface Book {\n readonly name: string;\n readonly version: string;\n readonly description: string;\n readonly repository: Option.Option<string>;\n readonly directory: Option.Option<string>;\n readonly homepage: Option.Option<string>;\n readonly skills: readonly Skill[];\n}\n\nexport interface Group {\n readonly type: string;\n readonly skills: readonly Skill[];\n}\n\nexport type Page =\n | { readonly kind: \"overview\" }\n | { readonly kind: \"skill\"; readonly name: string }\n | { readonly kind: \"source\"; readonly name: string }\n | { readonly kind: \"reference\"; readonly name: string; readonly file: string };\n\ntype Skills = Readonly<Record<string, Skill>>;\n\nconst TYPE_ORDER: readonly string[] = [\n \"lifecycle\",\n \"core\",\n \"sub-skill\",\n \"framework\",\n \"composition\",\n \"security\",\n];\n\nconst OTHER = \"other\";\nconst MARKDOWN_SUFFIX = /\\.md$/u;\nconst REQUIRE_SEPARATOR = \"#\";\nconst NO_DEPTH = 0;\nconst ONE_LEVEL = 1;\nconst DATA_FIRST_ARITY = 2;\n\nexport const requiredName = (requirement: string): string =>\n pipe(\n requirement,\n Str.split(REQUIRE_SEPARATOR),\n Arr.last,\n Option.getOrElse(Fn.constant(requirement)),\n );\n\nconst typeIndex = (type: string): number =>\n pipe(\n TYPE_ORDER,\n Arr.findFirstIndex((known) => known === type),\n Option.getOrElse(Fn.constant(TYPE_ORDER.length)),\n );\n\nconst byType: Order.Order<string> = Order.combine(\n Order.mapInput(Order.Number, typeIndex),\n Order.String,\n);\n\nconst requiredSkills =\n (byName: Skills, seen: readonly string[]) =>\n (skill: Skill): readonly Skill[] =>\n pipe(\n skill.requires,\n Arr.flatMap((requirement) => Option.toArray(Rec.get(byName, requiredName(requirement)))),\n Arr.filter((required) => !Arr.contains(seen, required.name)),\n );\n\nconst depth =\n (byName: Skills, seen: readonly string[]) =>\n (skill: Skill): number =>\n pipe(\n skill,\n requiredSkills(byName, seen),\n Arr.map((required) => depth(byName, Arr.append(seen, skill.name))(required) + ONE_LEVEL),\n Arr.prepend(NO_DEPTH),\n Arr.max(Order.Number),\n );\n\nconst orderedByDepth = (skills: readonly Skill[]): readonly Skill[] => {\n const byName = Rec.fromIterableBy(skills, (skill) => skill.name);\n const compareDepth = Order.mapInput(Order.Number, depth(byName, []));\n const compareName = Order.mapInput(Order.String, (skill: Skill) => skill.name);\n return Arr.sort(skills, Order.combine(compareDepth, compareName));\n};\n\nexport const typeOf = (skill: Skill): string => Option.getOrElse(skill.type, Fn.constant(OTHER));\n\nexport const groupSkills = (skills: readonly Skill[]): readonly Group[] => {\n const grouped = Arr.groupBy(skills, typeOf);\n return pipe(\n Rec.toEntries(grouped),\n Arr.map(([type, members]) => ({ type, skills: orderedByDepth(members) })),\n Arr.sortBy(Order.mapInput(byType, (group: Group) => group.type)),\n );\n};\n\nexport const orderedSkills = (groups: readonly Group[]): readonly Skill[] =>\n pipe(\n groups,\n Arr.flatMap((group) => group.skills),\n );\n\nconst requiredNames = (skill: Skill): readonly string[] =>\n pipe(skill.requires, Arr.map(requiredName));\n\nexport const entrySkills = (skills: readonly Skill[]): readonly Skill[] => {\n const required = pipe(skills, Arr.flatMap(requiredNames));\n return pipe(\n skills,\n Arr.filter(\n (skill) => Arr.isReadonlyArrayEmpty(skill.requires) && Arr.contains(required, skill.name),\n ),\n );\n};\n\nconst pageRoute = (page: Page): string => {\n switch (page.kind) {\n case \"overview\": {\n return \"\";\n }\n case \"skill\": {\n return `${page.name}/`;\n }\n case \"source\": {\n return `${page.name}.md`;\n }\n case \"reference\": {\n return `${page.name}/${Str.replace(MARKDOWN_SUFFIX, \"\")(page.file)}/`;\n }\n default: {\n return page satisfies never;\n }\n }\n};\n\nexport const routeOf: {\n (page: Page): (slug: string) => string;\n (slug: string, page: Page): string;\n} = Fn.dual(DATA_FIRST_ARITY, (slug: string, page: Page): string => `/${slug}/${pageRoute(page)}`);\n","import { Effect, Option, pipe, Record, Schema, String as Str } from \"effect\";\nimport { parse } from \"yaml\";\n\nexport interface Reference {\n readonly file: string;\n readonly text: string;\n}\n\nexport interface Skill {\n readonly name: string;\n readonly description: string;\n readonly type: Option.Option<string>;\n readonly framework: Option.Option<string>;\n readonly libraryVersion: Option.Option<string>;\n readonly requires: readonly string[];\n readonly sources: readonly string[];\n readonly text: string;\n readonly body: string;\n readonly references: readonly Reference[];\n}\n\nconst taggedError = Schema.TaggedError;\n\nexport class SkillFormatError extends taggedError<\n SkillFormatError,\n { readonly brand: unique symbol }\n>()(\"SkillFormatError\", { skill: Schema.String, reason: Schema.String }) {}\n\nconst Scalar = Schema.Union([Schema.String, Schema.Finite]);\nconst OptionalText = Schema.String.pipe(Schema.optionalKey);\nconst OptionalScalar = Scalar.pipe(Schema.optionalKey);\nconst OptionalList = Schema.Array(Schema.String).pipe(Schema.optionalKey);\n\nconst Metadata = Schema.Struct({\n type: OptionalText,\n framework: OptionalText,\n library_version: OptionalScalar,\n});\n\nconst Frontmatter = Schema.Struct({\n description: Schema.String,\n type: OptionalText,\n framework: OptionalText,\n library_version: OptionalScalar,\n metadata: Metadata.pipe(Schema.optionalKey),\n requires: OptionalList,\n sources: OptionalList,\n});\n\ntype FrontmatterData = typeof Frontmatter.Type;\n\nconst FRONTMATTER = /^---[ \\t]*\\r?\\n(?<yaml>[\\s\\S]*?)\\r?\\n---[ \\t]*(?:\\r?\\n|$)(?<body>[\\s\\S]*)$/u;\nconst WHITESPACE = /\\s+/gu;\nconst NO_ENTRIES: readonly string[] = [];\n\nconst decodeFrontmatter = Schema.decodeUnknownEffect(Frontmatter);\n\nconst splitFrontmatter = (\n text: string,\n): Option.Option<{ readonly yaml: string; readonly body: string }> =>\n Str.match(FRONTMATTER)(text).pipe(\n Option.flatMap((found) => Option.fromNullishOr(found.groups)),\n Option.flatMap((groups) =>\n Option.all({ yaml: Record.get(groups, \"yaml\"), body: Record.get(groups, \"body\") }),\n ),\n );\n\nconst failed = (skill: string, reason: string): SkillFormatError =>\n SkillFormatError.make({ skill, reason });\n\nconst textOfScalar = (value: Option.Option<string | number>): Option.Option<string> =>\n value.pipe(Option.map((scalar) => globalThis.String(scalar)));\n\nconst metadataOr = <Value>(\n frontmatter: FrontmatterData,\n read: (\n source: Readonly<Pick<FrontmatterData, \"type\" | \"framework\" | \"library_version\">>,\n ) => Value | undefined,\n): Option.Option<Value> =>\n Option.fromNullishOr(frontmatter.metadata).pipe(\n Option.flatMapNullishOr(read),\n Option.orElse(() => Option.fromNullishOr(read(frontmatter))),\n );\n\nexport const parseSkill = Effect.fn(\"parseSkill\")(function* parseSkill(\n input: Readonly<{\n name: string;\n text: string;\n references: readonly { readonly file: string; readonly text: string }[];\n }>,\n) {\n const parts = yield* splitFrontmatter(input.text).pipe(\n Effect.fromOption,\n Effect.mapError(() => failed(input.name, \"SKILL.md has no frontmatter\")),\n );\n const data: unknown = yield* Effect.try({\n try: (): unknown => parse(parts.yaml),\n catch: (cause) => failed(input.name, `frontmatter is not YAML: ${globalThis.String(cause)}`),\n });\n const frontmatter = yield* decodeFrontmatter(data).pipe(\n Effect.mapError((error) => failed(input.name, error.message)),\n );\n const skill: Skill = {\n name: input.name,\n description: pipe(frontmatter.description, Str.replaceAll(WHITESPACE, \" \"), Str.trim),\n type: metadataOr(frontmatter, (source) => source.type),\n framework: metadataOr(frontmatter, (source) => source.framework),\n libraryVersion: textOfScalar(metadataOr(frontmatter, (source) => source.library_version)),\n requires: frontmatter.requires ?? NO_ENTRIES,\n sources: frontmatter.sources ?? NO_ENTRIES,\n text: input.text,\n body: parts.body,\n references: input.references,\n };\n return skill;\n});\n","import { Boolean as Bool, Option, pipe } from \"effect\";\nimport type { Element } from \"hast\";\nimport { toHtml } from \"hast-util-to-html\";\nimport { h } from \"hastscript\";\n\nexport const optional =\n <Value>(build: (value: Value) => Element) =>\n (option: Option.Option<Value>): readonly Element[] =>\n pipe(option, Option.map(build), Option.toArray);\n\nexport const when =\n (condition: boolean) =>\n (build: () => readonly Element[]): readonly Element[] =>\n Bool.match(condition, { onTrue: build, onFalse: () => [] });\n\nexport const charset = (): Element =>\n h(\"meta\", { httpEquiv: \"content-type\", content: \"text/html; charset=utf-8\" });\n\nexport const htmlDocument = (input: {\n readonly head: readonly Element[];\n readonly body: readonly Element[];\n}): string => {\n const page = h(\"html\", { lang: \"en\" }, [h(\"head\", [...input.head]), h(\"body\", [...input.body])]);\n return toHtml({ type: \"root\", children: [{ type: \"doctype\" }, page] });\n};\n","import { Array as Arr, Function as Fn, Option, pipe, Record as Rec, String as Str } from \"effect\";\n\nimport { routeOf } from \"#/entities/book/index.ts\";\nimport type { Book, Skill } from \"#/entities/book/index.ts\";\nimport type { LinkResolver } from \"#/shared/lib/render-markdown.ts\";\n\ntype Target = readonly [string, string];\n\nconst LEADING_SLASH = /^\\//u;\nconst ORIGIN = \"https://intent-book.invalid/\";\nconst SKILLS_ROOT = \"skills/\";\nconst GITHUB = \"https://github.com/\";\nconst SKILL_FILE = \"SKILL.md\";\n\nexport const withBase =\n (base: string) =>\n (route: string): string =>\n `${base}${Str.replace(LEADING_SLASH, \"\")(route)}`;\n\nexport const fileOf = (route: string): string => Str.replace(LEADING_SLASH, \"\")(route);\n\nexport const sourcePath = (skill: Skill): string => `${skill.name}/${SKILL_FILE}`;\n\nexport const referencePath = (input: { readonly skill: Skill; readonly file: string }): string =>\n `${input.skill.name}/${input.file}`;\n\nconst targetsOf =\n (slug: string, base: string) =>\n (skill: Skill): readonly Target[] => {\n const own: Target = [\n sourcePath(skill),\n withBase(base)(routeOf(slug, { kind: \"skill\", name: skill.name })),\n ];\n const referenced = pipe(\n skill.references,\n Arr.map((reference): Target => [\n referencePath({ skill, file: reference.file }),\n withBase(base)(\n routeOf(slug, { kind: \"reference\", name: skill.name, file: reference.file }),\n ),\n ]),\n );\n return Arr.prepend(referenced, own);\n };\n\nconst pageTarget = (targets: Readonly<Record<string, string>>, url: URL): Option.Option<string> =>\n pipe(\n fileOf(url.pathname),\n Option.liftPredicate(Str.startsWith(SKILLS_ROOT)),\n Option.map(Str.slice(SKILLS_ROOT.length)),\n Option.flatMap((file) => Rec.get(targets, file)),\n Option.map((target) => `${target}${url.hash}`),\n );\n\nconst repositoryFile = (book: Book, url: URL): Option.Option<string> =>\n pipe(\n book.repository,\n Option.filter(Str.startsWith(GITHUB)),\n Option.map((repository) => {\n const directory = pipe(\n book.directory,\n Option.map((value) => `/${value}`),\n Option.getOrElse(Fn.constant(\"\")),\n );\n return `${repository}/blob/HEAD${directory}${url.pathname}${url.hash}`;\n }),\n );\n\nconst resolveAgainst =\n (input: { readonly book: Book; readonly targets: Readonly<Record<string, string>> }) =>\n (document: string): LinkResolver =>\n (href) =>\n pipe(\n Option.liftThrowable(() => new URL(href, `${ORIGIN}${SKILLS_ROOT}${document}`))(),\n Option.flatMap((url) =>\n pipe(\n pageTarget(input.targets, url),\n Option.orElse(() => repositoryFile(input.book, url)),\n ),\n ),\n );\n\nexport const linkResolver = (input: {\n readonly slug: string;\n readonly book: Book;\n readonly base: string;\n}): ((document: string) => LinkResolver) => {\n const targets = pipe(\n input.book.skills,\n Arr.flatMap(targetsOf(input.slug, input.base)),\n Rec.fromEntries,\n );\n return resolveAgainst({ book: input.book, targets });\n};\n","import { Array as Arr, Function as Fn, Option, pipe, Record as Rec, String as Str } from \"effect\";\nimport type { Element, ElementContent, Root } from \"hast\";\nimport { h } from \"hastscript\";\n\nimport {\n entrySkills,\n groupSkills,\n orderedSkills,\n requiredName,\n routeOf,\n typeOf,\n} from \"#/entities/book/index.ts\";\nimport type { Book, Skill } from \"#/entities/book/index.ts\";\nimport { charset, htmlDocument, optional, when } from \"#/shared/lib/html.ts\";\n\nimport { withBase } from \"./links.ts\";\n\nexport interface SkillPage {\n readonly base: string;\n readonly book: Book;\n readonly skill: Skill;\n readonly title: string;\n readonly tree: Root;\n}\n\nexport interface BookPage {\n readonly base: string;\n readonly book: Book;\n}\n\nconst SOURCE = /^(?<repository>[^/:\\s]+\\/[^:\\s]+):(?<file>.+)$/u;\nconst FIRST_SENTENCE = /^.*?[.。](?=\\s|$)/u;\nconst BEHIND = 1;\nconst AHEAD = 1;\nconst CRUMB_SEPARATOR = \" › \";\nconst GLOB = \"*\";\n\nconst contentOf = (tree: Root): readonly ElementContent[] =>\n pipe(\n tree.children,\n Arr.filter((node): node is ElementContent => node.type !== \"doctype\"),\n );\n\nconst firstSentence = (description: string): string =>\n pipe(\n description,\n Str.match(FIRST_SENTENCE),\n Option.flatMap(Arr.head),\n Option.getOrElse(Fn.constant(description)),\n );\n\nconst prose = (tree: Root): Element => h(\"div\", { class: \"prose\" }, [...contentOf(tree)]);\n\nconst crumbs = (trail: readonly (Element | string)[]): Element => {\n const parts = pipe(trail, Arr.intersperse(CRUMB_SEPARATOR));\n return h(\"p\", { class: \"crumbs\" }, [...parts]);\n};\n\nconst skillRoute = (base: string, book: Book, skill: Skill): string =>\n withBase(base)(routeOf(book.name, { kind: \"skill\", name: skill.name }));\n\nconst rawRoute = (base: string, book: Book, skill: Skill): string =>\n withBase(base)(routeOf(book.name, { kind: \"source\", name: skill.name }));\n\nconst sourceLocation = (source: string): Option.Option<string> =>\n pipe(\n source,\n Str.match(SOURCE),\n Option.flatMapNullishOr((found) => found.groups),\n Option.flatMap((groups) =>\n Option.all({ repository: Rec.get(groups, \"repository\"), file: Rec.get(groups, \"file\") }),\n ),\n Option.filter(({ file }) => !Str.includes(GLOB)(file)),\n Option.map(({ repository, file }) => `https://github.com/${repository}/blob/HEAD/${file}`),\n );\n\nconst sourceItem = (source: string): Element =>\n pipe(\n sourceLocation(source),\n Option.match({\n onNone: () => h(\"li\", [h(\"code\", source)]),\n onSome: (href) => h(\"li\", [h(\"a\", { href }, [h(\"code\", source)])]),\n }),\n );\n\nconst neighbourLink =\n (page: BookPage, style: { readonly className: string; readonly label: string }) =>\n (skill: Skill): Element =>\n h(\"a\", { class: style.className, href: skillRoute(page.base, page.book, skill) }, [\n h(\"small\", style.label),\n skill.name,\n ]);\n\nconst pager = (base: string, book: Book, skill: Skill): Element => {\n const order = orderedSkills(groupSkills(book.skills));\n const index = pipe(\n order,\n Arr.findFirstIndex((candidate) => candidate.name === skill.name),\n );\n const previous = pipe(\n index,\n Option.flatMap((position) => Arr.get(order, position - BEHIND)),\n optional(neighbourLink({ base, book }, { className: \"prev\", label: \"Previous\" })),\n );\n const next = pipe(\n index,\n Option.flatMap((position) => Arr.get(order, position + AHEAD)),\n optional(neighbourLink({ base, book }, { className: \"next\", label: \"Next\" })),\n );\n return h(\"nav\", { class: \"pager\", ariaLabel: \"Previous and next skill\" }, [...previous, ...next]);\n};\n\nconst requiredLink = (base: string, book: Book, requirement: string): Element =>\n pipe(\n book.skills,\n Arr.findFirst((candidate) => candidate.name === requiredName(requirement)),\n Option.match({\n onNone: () => h(\"code\", requirement),\n onSome: (target) => h(\"a\", { href: skillRoute(base, book, target) }, target.name),\n }),\n );\n\nconst overviewRoute = (base: string, book: Book): string =>\n withBase(base)(routeOf(book.name, { kind: \"overview\" }));\n\nconst bookLink = (base: string, book: Book): Element =>\n h(\"a\", { href: overviewRoute(base, book) }, book.name);\n\nconst skillChips = (base: string, book: Book, skill: Skill): Element => {\n const type = pipe(\n skill.type,\n optional((value) => h(\"span\", value)),\n );\n const version = pipe(\n skill.libraryVersion,\n optional((value) => h(\"span\", `v${value}`)),\n );\n const raw = h(\"a\", { href: rawRoute(base, book, skill) }, \"SKILL.md\");\n return h(\"div\", { class: \"chips\" }, [...type, ...version, raw]);\n};\n\nconst requirementItem =\n (base: string, book: Book) =>\n (requirement: string): Element =>\n h(\"span\", [requiredLink(base, book, requirement)]);\n\nconst readFirst = (base: string, book: Book, skill: Skill): readonly Element[] =>\n when(!Arr.isReadonlyArrayEmpty(skill.requires))(() => {\n const links = pipe(skill.requires, Arr.map(requirementItem(base, book)));\n return [h(\"div\", { class: \"need\" }, [h(\"strong\", \"Read first\"), ...links])];\n });\n\nconst sourceSection = (skill: Skill): readonly Element[] =>\n when(!Arr.isReadonlyArrayEmpty(skill.sources))(() => {\n const items = pipe(skill.sources, Arr.map(sourceItem));\n return [h(\"section\", { class: \"sources\" }, [h(\"h2\", \"Sources\"), h(\"ul\", items)])];\n });\n\nexport const skillMain = (input: SkillPage): readonly Element[] => {\n const { base, book, skill } = input;\n return [\n crumbs([bookLink(base, book), typeOf(skill), skill.name]),\n h(\"h1\", input.title),\n h(\"p\", { class: \"lead\" }, skill.description),\n skillChips(base, book, skill),\n ...readFirst(base, book, skill),\n prose(input.tree),\n ...sourceSection(skill),\n pager(base, book, skill),\n ];\n};\n\nexport const referenceMain = (input: SkillPage): readonly Element[] => {\n const { base, book, skill } = input;\n const parent = h(\"a\", { href: skillRoute(base, book, skill) }, skill.name);\n return [crumbs([bookLink(base, book), parent]), h(\"h1\", input.title), prose(input.tree)];\n};\n\nconst rowLink = (href: string, name: string, description: string): Element =>\n h(\"li\", [\n h(\"a\", { href }, [\n h(\"span\", { class: \"name\" }, name),\n h(\"span\", { class: \"desc\" }, description),\n ]),\n ]);\n\nconst row =\n (base: string, book: Book) =>\n (skill: Skill): Element =>\n rowLink(skillRoute(base, book, skill), skill.name, firstSentence(skill.description));\n\nconst section = (page: BookPage, title: string, skills: readonly Skill[]): readonly Element[] =>\n when(!Arr.isReadonlyArrayEmpty(skills))(() => {\n const rows = pipe(skills, Arr.map(row(page.base, page.book)));\n return [h(\"h2\", title), h(\"ul\", { class: \"rows\" }, rows)];\n });\n\nconst overviewChips = (book: Book): Element => {\n const npm = h(\"a\", { href: `https://www.npmjs.com/package/${book.name}` }, \"npm\");\n const repository = pipe(\n book.repository,\n optional((href) => h(\"a\", { href }, \"repository\")),\n );\n return h(\"div\", { class: \"chips\" }, [\n h(\"span\", `v${book.version}`),\n h(\"span\", `${book.skills.length} skills`),\n npm,\n ...repository,\n ]);\n};\n\nconst overviewSections = (page: BookPage): readonly Element[] => {\n const entries = entrySkills(page.book.skills);\n const entryNames = pipe(\n entries,\n Arr.map((skill) => skill.name),\n );\n const groups = pipe(\n groupSkills(page.book.skills),\n Arr.flatMap((group) => {\n const rest = pipe(\n group.skills,\n Arr.filter((skill) => !Arr.contains(entryNames, skill.name)),\n );\n return section(page, group.type, rest);\n }),\n );\n return [...section(page, \"Start here\", entries), ...groups];\n};\n\nexport const overviewMain = (input: BookPage): readonly Element[] => {\n const { book } = input;\n const lead = when(book.description !== \"\")(() => [h(\"p\", { class: \"lead\" }, book.description)]);\n const sections = h(\"div\", { class: \"overview\" }, [...overviewSections(input)]);\n return [crumbs([book.name]), h(\"h1\", book.name), ...lead, overviewChips(book), sections];\n};\n\nconst landingRow =\n (base: string) =>\n (book: Book): Element =>\n rowLink(overviewRoute(base, book), book.name, book.description);\n\nconst SINGLE_BOOK = 1;\n\nconst redirectTarget = (input: {\n readonly base: string;\n readonly books: readonly Book[];\n}): Option.Option<string> =>\n pipe(\n input.books,\n Option.liftPredicate((books) => books.length === SINGLE_BOOK),\n Option.flatMap(Arr.head),\n Option.map((only) => overviewRoute(input.base, only)),\n );\n\nexport const landingPage = (input: {\n readonly base: string;\n readonly books: readonly Book[];\n}): string => {\n const refresh = pipe(\n redirectTarget(input),\n optional((target) => h(\"meta\", { httpEquiv: \"refresh\", content: `0;url=${target}` })),\n );\n const rows = pipe(input.books, Arr.map(landingRow(input.base)));\n const head = [\n charset(),\n h(\"meta\", { name: \"viewport\", content: \"width=device-width, initial-scale=1\" }),\n ...refresh,\n h(\"title\", \"Skills\"),\n h(\"link\", { rel: \"stylesheet\", href: `${input.base}assets/book.css` }),\n ];\n const body = h(\"main\", [h(\"article\", [h(\"h1\", \"Skills\"), h(\"ul\", { class: \"rows\" }, rows)])]);\n return htmlDocument({ head, body: [body] });\n};\n","import rehypeShiki from \"@shikijs/rehype\";\nimport {\n Array as Arr,\n Effect,\n Option,\n Predicate,\n pipe,\n Record as Rec,\n Schema,\n String as Str,\n} from \"effect\";\nimport type { Element, Root, RootContent } from \"hast\";\nimport { toString as textOf } from \"mdast-util-to-string\";\nimport rehypeSlug from \"rehype-slug\";\nimport remarkGfm from \"remark-gfm\";\nimport remarkParse from \"remark-parse\";\nimport remarkRehype from \"remark-rehype\";\nimport { unified } from \"unified\";\nimport { visit } from \"unist-util-visit\";\n\nconst SECOND_DEPTH = 2;\nconst THIRD_DEPTH = 3;\nconst ONE_NODE = 1;\n\nexport interface Heading {\n readonly depth: typeof SECOND_DEPTH | typeof THIRD_DEPTH;\n readonly id: string;\n readonly text: string;\n}\n\nexport interface RenderedMarkdown {\n readonly tree: Root;\n readonly title: Option.Option<string>;\n readonly headings: readonly Heading[];\n}\n\nexport type LinkResolver = (href: string) => Option.Option<string>;\n\nconst taggedError = Schema.TaggedError;\n\nexport class MarkdownRenderError extends taggedError<\n MarkdownRenderError,\n { readonly brand: unique symbol }\n>()(\"MarkdownRenderError\", { reason: Schema.String }) {}\n\nconst SEVERITY = /^(?<word>CRITICAL|HIGH|MEDIUM|LOW)\\b/u;\nconst SCHEME = /^(?:[a-z][a-z\\d+.-]*:|\\/\\/|#)/iu;\nconst SECOND_LEVEL = \"h2\";\nconst THIRD_LEVEL = \"h3\";\nconst TITLE_LEVEL = \"h1\";\nconst ANCHOR = \"a\";\n\nconst processor = unified()\n .use(remarkParse)\n .use(remarkGfm)\n .use(remarkRehype)\n .use(rehypeSlug)\n .use(rehypeShiki, {\n themes: { light: \"github-light\", dark: \"github-dark\" },\n defaultColor: false,\n fallbackLanguage: \"text\",\n lazy: true,\n langs: [],\n });\n\nconst elementsOf = (tree: Root, tagName: string): readonly Element[] => {\n const found: Element[] = [];\n visit(tree, \"element\", (node: Element) => {\n if (node.tagName === tagName) {\n found.push(node);\n }\n });\n return found;\n};\n\nconst severityOf = (node: Element): Option.Option<string> =>\n pipe(\n textOf(node),\n Str.match(SEVERITY),\n Option.flatMapNullishOr((found) => found.groups),\n Option.flatMap((groups) => Rec.get(groups, \"word\")),\n Option.map(Str.toLowerCase),\n );\n\nconst stringProperty = (node: Element, key: string): Option.Option<string> =>\n pipe(Option.fromNullishOr(node.properties[key]), Option.filter(Predicate.isString));\n\nconst markSeverity = (tree: Root): void => {\n for (const node of elementsOf(tree, THIRD_LEVEL)) {\n for (const severity of Option.toArray(severityOf(node))) {\n node.properties = { ...node.properties, dataSeverity: severity };\n }\n }\n};\n\nconst resolvedHref = (node: Element, resolveLink: LinkResolver): Option.Option<string> =>\n pipe(\n stringProperty(node, \"href\"),\n Option.filter((href) => !SCHEME.test(href)),\n Option.flatMap(resolveLink),\n );\n\nconst rewriteLinks = (tree: Root, resolveLink: LinkResolver): void => {\n for (const node of elementsOf(tree, ANCHOR)) {\n for (const target of Option.toArray(resolvedHref(node, resolveLink))) {\n node.properties = { ...node.properties, href: target };\n }\n }\n};\n\nconst isTitle = (node: RootContent): boolean =>\n node.type === \"element\" && node.tagName === TITLE_LEVEL;\n\nconst takeTitle = (tree: Root): Option.Option<string> =>\n pipe(\n tree.children,\n Arr.findFirstIndex(isTitle),\n Option.map((position) => {\n const [removed] = tree.children.splice(position, ONE_NODE);\n return textOf(removed);\n }),\n );\n\nconst headingOf = (node: Element, depth: Heading[\"depth\"]): Option.Option<Heading> =>\n pipe(\n stringProperty(node, \"id\"),\n Option.map((id) => ({ depth, id, text: textOf(node) })),\n );\n\nconst headingsOf = (tree: Root): readonly Heading[] => {\n const found: Heading[] = [];\n visit(tree, \"element\", (node: Element) => {\n if (node.tagName === SECOND_LEVEL) {\n found.push(...Option.toArray(headingOf(node, SECOND_DEPTH)));\n }\n if (node.tagName === THIRD_LEVEL) {\n found.push(...Option.toArray(headingOf(node, THIRD_DEPTH)));\n }\n });\n return found;\n};\n\nexport const renderMarkdown = Effect.fn(\"renderMarkdown\")(function* renderMarkdown(\n input: Readonly<{ body: string; resolveLink: LinkResolver }>,\n) {\n const tree = yield* Effect.tryPromise({\n try: () => processor.run(processor.parse(input.body), input.body),\n catch: (cause) => MarkdownRenderError.make({ reason: globalThis.String(cause) }),\n });\n const title = takeTitle(tree);\n markSeverity(tree);\n rewriteLinks(tree, input.resolveLink);\n const page: RenderedMarkdown = { tree, title, headings: headingsOf(tree) };\n return page;\n});\n","import { Array as Arr, pipe, String as Str } from \"effect\";\nimport type { Element } from \"hast\";\n\nimport { routeOf } from \"#/entities/book/index.ts\";\nimport type { Book, Skill } from \"#/entities/book/index.ts\";\nimport type { LinkResolver } from \"#/shared/lib/render-markdown.ts\";\nimport type { SiteFile } from \"#/shared/lib/site-file.ts\";\n\nimport { fileOf, referencePath, sourcePath } from \"./links.ts\";\nimport { referenceMain, skillMain } from \"./pages.ts\";\nimport type { SkillPage } from \"./pages.ts\";\nimport type { Current } from \"./shell.ts\";\n\nexport interface BookContext {\n readonly books: readonly Book[];\n readonly book: Book;\n readonly slug: string;\n readonly base: string;\n readonly resolveFrom: (document: string) => LinkResolver;\n}\n\nexport interface Document {\n readonly skill: Skill;\n readonly body: string;\n readonly from: string;\n readonly fallbackTitle: string;\n readonly current: Current;\n readonly route: string;\n readonly main: (input: SkillPage) => readonly Element[];\n readonly raw: SiteFile;\n readonly searchName: string;\n readonly lead: string;\n}\n\ntype Reference = Skill[\"references\"][number];\n\nconst MARKDOWN_SUFFIX = /\\.md$/u;\n\nconst skillDocument = (context: BookContext, skill: Skill): Document => ({\n skill,\n body: skill.body,\n from: sourcePath(skill),\n fallbackTitle: skill.name,\n current: { kind: \"skill\", skill },\n route: routeOf(context.slug, { kind: \"skill\", name: skill.name }),\n main: skillMain,\n raw: {\n path: fileOf(routeOf(context.slug, { kind: \"source\", name: skill.name })),\n content: skill.text,\n },\n searchName: skill.name,\n lead: skill.description,\n});\n\nconst referenceDocument =\n (context: BookContext, skill: Skill) =>\n (reference: Reference): Document => {\n const path = referencePath({ skill, file: reference.file });\n return {\n skill,\n body: reference.text,\n from: path,\n fallbackTitle: Str.replace(MARKDOWN_SUFFIX, \"\")(reference.file),\n current: { kind: \"reference\", skill, file: reference.file },\n route: routeOf(context.slug, { kind: \"reference\", name: skill.name, file: reference.file }),\n main: referenceMain,\n raw: { path: `${context.slug}/${path}`, content: reference.text },\n searchName: path,\n lead: \"\",\n };\n };\n\nexport const documentsOf =\n (context: BookContext) =>\n (skill: Skill): readonly Document[] => {\n const references = pipe(skill.references, Arr.map(referenceDocument(context, skill)));\n return Arr.prepend(references, skillDocument(context, skill));\n };\n","import { Effect, Schema, String as Str } from \"effect\";\n\nimport type { SiteFile } from \"#/shared/lib/site-file.ts\";\n\nconst SearchEntry = Schema.Struct({\n title: Schema.String,\n name: Schema.String,\n book: Schema.String,\n url: Schema.String,\n text: Schema.String,\n});\n\nexport type SearchEntryData = typeof SearchEntry.Type;\n\nconst SEARCH_TEXT_START = 0;\nconst SEARCH_TEXT_LIMIT = 6000;\nconst INDEX_PATH = \"assets/search.json\";\n\nconst encodeEntries = Schema.encodeEffect(Schema.fromJsonString(Schema.Array(SearchEntry)));\n\nexport const searchText = (input: { readonly lead: string; readonly body: string }): string =>\n Str.slice(SEARCH_TEXT_START, SEARCH_TEXT_LIMIT)(`${input.lead} ${input.body}`);\n\nexport const searchIndexFile = (\n entries: readonly SearchEntryData[],\n): Effect.Effect<SiteFile, Schema.SchemaError> =>\n Effect.map(encodeEntries(entries), (content) => ({ path: INDEX_PATH, content }));\n","import { Array as Arr, Boolean as Bool, pipe, Record as Rec, String as Str } from \"effect\";\nimport type { Element } from \"hast\";\nimport { h } from \"hastscript\";\n\nimport { groupSkills, routeOf } from \"#/entities/book/index.ts\";\nimport type { Book, Group, Skill } from \"#/entities/book/index.ts\";\nimport { charset, htmlDocument, when } from \"#/shared/lib/html.ts\";\nimport type { Heading } from \"#/shared/lib/render-markdown.ts\";\n\nimport { withBase } from \"./links.ts\";\n\nexport type Current =\n | { readonly kind: \"overview\" }\n | { readonly kind: \"skill\"; readonly skill: Skill }\n | { readonly kind: \"reference\"; readonly skill: Skill; readonly file: string };\n\nexport interface Shell {\n readonly base: string;\n readonly books: readonly Book[];\n readonly book: Book;\n readonly title: string;\n readonly description: string;\n readonly current: Current;\n readonly main: readonly Element[];\n readonly headings: readonly Heading[];\n}\n\nconst ICON_BARS = [\"M3 6h18\", \"M3 12h18\", \"M3 18h18\"];\nconst ICON_CONTRAST = [\"M12 3a9 9 0 1 0 0 18a9 9 0 0 0 0-18z\", \"M12 3v18\"];\nconst ICON_SIZE = \"18\";\nconst SINGLE_BOOK = 1;\nconst REFERENCES_PREFIX = /^references\\//u;\nconst MARKDOWN_SUFFIX = /\\.md$/u;\n\nconst stroke = (data: string): Element => h(\"path\", Rec.singleton(\"d\", data));\n\nconst icon = (strokes: readonly string[]): Element => {\n const paths = pipe(strokes, Arr.map(stroke));\n return h(\n \"svg\",\n {\n viewBox: \"0 0 24 24\",\n width: ICON_SIZE,\n height: ICON_SIZE,\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: \"2\",\n ariaHidden: \"true\",\n },\n paths,\n );\n};\n\nconst currentMark = (active: boolean): Readonly<Record<string, string>> =>\n Bool.match(active, { onTrue: () => ({ ariaCurrent: \"page\" }), onFalse: () => ({}) });\n\nconst overviewRoute = (shell: Shell, book: Book): string =>\n withBase(shell.base)(routeOf(book.name, { kind: \"overview\" }));\n\nconst isCurrentSkill = (current: Current, skill: Skill): boolean =>\n current.kind !== \"overview\" && current.skill.name === skill.name;\n\nconst isActiveSkill = (current: Current, skill: Skill): boolean =>\n current.kind === \"skill\" && current.skill.name === skill.name;\n\nconst isActiveReference = (current: Current, skill: Skill, file: string): boolean =>\n current.kind === \"reference\" && current.skill.name === skill.name && current.file === file;\n\nconst skillLink = (shell: Shell, skill: Skill): Element => {\n const route = routeOf(shell.book.name, { kind: \"skill\", name: skill.name });\n const mark = currentMark(isActiveSkill(shell.current, skill));\n return h(\"a\", { href: withBase(shell.base)(route), ...mark }, skill.name);\n};\n\nconst referenceLabel = (file: string): string =>\n pipe(file, Str.replace(REFERENCES_PREFIX, \"\"), Str.replace(MARKDOWN_SUFFIX, \"\"));\n\nconst referenceLink = (shell: Shell, skill: Skill, file: string): Element => {\n const route = routeOf(shell.book.name, { kind: \"reference\", name: skill.name, file });\n const mark = currentMark(isActiveReference(shell.current, skill, file));\n return h(\"a\", { href: withBase(shell.base)(route), ...mark }, referenceLabel(file));\n};\n\nconst referenceList = (shell: Shell, skill: Skill): Element => {\n const items = pipe(\n skill.references,\n Arr.map((reference) => h(\"li\", [referenceLink(shell, skill, reference.file)])),\n );\n return h(\"ul\", { class: \"children\" }, items);\n};\n\nconst skillWithReferences = (shell: Shell, skill: Skill): Element => {\n const summary = h(\"summary\", [skillLink(shell, skill)]);\n const open = isCurrentSkill(shell.current, skill);\n return h(\"li\", [h(\"details\", { open }, [summary, referenceList(shell, skill)])]);\n};\n\nconst skillItem = (shell: Shell, skill: Skill): Element =>\n Bool.match(Arr.isReadonlyArrayEmpty(skill.references), {\n onTrue: () => h(\"li\", [skillLink(shell, skill)]),\n onFalse: () => skillWithReferences(shell, skill),\n });\n\nconst bookEntry = (shell: Shell, book: Book): Element =>\n h(\"li\", [h(\"a\", { href: overviewRoute(shell, book) }, book.name)]);\n\nconst bookSwitch = (shell: Shell): readonly Element[] => {\n const entries = pipe(\n shell.books,\n Arr.map((book) => bookEntry(shell, book)),\n );\n const summary = h(\"summary\", [h(\"strong\", shell.book.name)]);\n return when(shell.books.length !== SINGLE_BOOK)(() => [\n h(\"details\", { class: \"book-switch\" }, [summary, h(\"ul\", entries)]),\n ]);\n};\n\nconst overviewItem = (shell: Shell): Element => {\n const mark = currentMark(shell.current.kind === \"overview\");\n return h(\"li\", [h(\"a\", { href: overviewRoute(shell, shell.book), ...mark }, \"Overview\")]);\n};\n\nconst skillGroup = (shell: Shell, group: Group): Element => {\n const items = pipe(\n group.skills,\n Arr.map((skill) => skillItem(shell, skill)),\n );\n return h(\"details\", { class: \"group\", open: true }, [h(\"summary\", group.type), h(\"ul\", items)]);\n};\n\nconst sidebar = (shell: Shell): Element => {\n const groups = pipe(\n groupSkills(shell.book.skills),\n Arr.map((group) => skillGroup(shell, group)),\n );\n return h(\"nav\", { class: \"side\", ariaLabel: \"Skills\" }, [\n ...bookSwitch(shell),\n h(\"ul\", [overviewItem(shell)]),\n ...groups,\n ]);\n};\n\nconst tocEntry = (heading: Heading): Element =>\n h(\"li\", { class: `depth-${heading.depth}` }, [h(\"a\", { href: `#${heading.id}` }, heading.text)]);\n\nconst tocList = (headings: readonly Heading[]): Element => {\n const entries = pipe(headings, Arr.map(tocEntry));\n return h(\"div\", [h(\"h2\", \"On this page\"), h(\"ul\", entries)]);\n};\n\nconst tableOfContents = (headings: readonly Heading[]): Element =>\n h(\"aside\", { class: \"toc\", ariaLabel: \"On this page\" }, [\n Bool.match(Arr.isReadonlyArrayEmpty(headings), {\n onTrue: () => h(\"span\"),\n onFalse: () => tocList(headings),\n }),\n ]);\n\nconst iconButton = (\n label: string,\n marker: Readonly<Record<string, string>>,\n glyph: Element,\n): Element =>\n h(\"button\", { class: \"icon-button\", type: \"button\", ariaLabel: label, ...marker }, [glyph]);\n\nconst topBar = (shell: Shell): Element => {\n const brand = h(\"a\", { class: \"brand\", href: overviewRoute(shell, shell.book) }, [\n shell.book.name,\n h(\"small\", `v${shell.book.version}`),\n ]);\n const search = h(\"button\", { class: \"search-open\", type: \"button\", dataSearchOpen: \"\" }, [\n h(\"span\", \"Search\"),\n h(\"kbd\", \"Ctrl K\"),\n ]);\n return h(\"header\", { class: \"top\" }, [\n iconButton(\"Toggle navigation\", { dataNavToggle: \"\" }, icon(ICON_BARS)),\n brand,\n h(\"span\", { class: \"grow\" }),\n search,\n iconButton(\"Toggle theme\", { dataThemeToggle: \"\" }, icon(ICON_CONTRAST)),\n ]);\n};\n\nconst searchDialog = (): Element => {\n const input = h(\"input\", {\n type: \"search\",\n placeholder: \"Search skills\",\n ariaLabel: \"Search skills\",\n autocomplete: \"off\",\n });\n return h(\"dialog\", { class: \"search\", ariaLabel: \"Search\" }, [input, h(\"ul\")]);\n};\n\nconst headOf = (shell: Shell): readonly Element[] => [\n charset(),\n h(\"meta\", { name: \"viewport\", content: \"width=device-width, initial-scale=1\" }),\n h(\"meta\", { name: \"intent-book-base\", content: shell.base }),\n h(\"meta\", { name: \"description\", content: shell.description }),\n h(\"title\", `${shell.title} · ${shell.book.name}`),\n h(\"link\", { rel: \"stylesheet\", href: `${shell.base}assets/book.css` }),\n h(\"script\", { src: `${shell.base}assets/book.js`, defer: true }),\n];\n\nconst layout = (shell: Shell): Element =>\n h(\"div\", { class: \"shell\" }, [\n sidebar(shell),\n h(\"main\", [h(\"article\", [...shell.main])]),\n tableOfContents(shell.headings),\n ]);\n\nexport const renderShell = (shell: Shell): string =>\n htmlDocument({\n head: headOf(shell),\n body: [topBar(shell), layout(shell), searchDialog()],\n });\n","import { Array as Arr, Effect, Function as Fn, Option, pipe } from \"effect\";\nimport { toString as textOf } from \"mdast-util-to-string\";\n\nimport { routeOf } from \"#/entities/book/index.ts\";\nimport type { Book } from \"#/entities/book/index.ts\";\nimport { renderMarkdown } from \"#/shared/lib/render-markdown.ts\";\nimport type { SiteFile } from \"#/shared/lib/site-file.ts\";\n\nimport { documentsOf } from \"./documents.ts\";\nimport type { BookContext, Document } from \"./documents.ts\";\nimport { fileOf, linkResolver } from \"./links.ts\";\nimport { overviewMain } from \"./pages.ts\";\nimport { searchText } from \"./search-index.ts\";\nimport type { SearchEntryData } from \"./search-index.ts\";\nimport { renderShell } from \"./shell.ts\";\n\nexport interface Built {\n readonly files: readonly SiteFile[];\n readonly entries: readonly SearchEntryData[];\n}\n\nconst INDEX = \"index.html\";\nconst RENDER_CONCURRENCY = 8;\n\nconst indexFile = (route: string): string => `${fileOf(route)}${INDEX}`;\n\nconst renderDocument = Effect.fn(\"renderDocument\")(function* renderDocument(\n context: BookContext,\n document: Document,\n) {\n const rendered = yield* renderMarkdown({\n body: document.body,\n resolveLink: context.resolveFrom(document.from),\n });\n const title = Option.getOrElse(rendered.title, Fn.constant(document.fallbackTitle));\n const main = document.main({\n base: context.base,\n book: context.book,\n skill: document.skill,\n title,\n tree: rendered.tree,\n });\n const html = renderShell({\n base: context.base,\n books: context.books,\n book: context.book,\n title,\n description: document.skill.description,\n current: document.current,\n main,\n headings: rendered.headings,\n });\n const entry: SearchEntryData = {\n title,\n name: document.searchName,\n book: context.book.name,\n url: `${context.base}${fileOf(document.route)}`,\n text: searchText({ lead: document.lead, body: textOf(rendered.tree) }),\n };\n const page: SiteFile = { path: indexFile(document.route), content: html };\n const built: Built = { files: [page, document.raw], entries: [entry] };\n return built;\n});\n\nconst overviewFile = (context: BookContext): SiteFile => ({\n path: indexFile(routeOf(context.slug, { kind: \"overview\" })),\n content: renderShell({\n base: context.base,\n books: context.books,\n book: context.book,\n title: context.book.name,\n description: context.book.description,\n current: { kind: \"overview\" },\n main: overviewMain({ base: context.base, book: context.book }),\n headings: [],\n }),\n});\n\nexport const renderBook = Effect.fn(\"renderBook\")(function* renderBook(input: {\n readonly books: readonly Book[];\n readonly book: Book;\n readonly base: string;\n}) {\n const slug = input.book.name;\n const context: BookContext = {\n ...input,\n slug,\n resolveFrom: linkResolver({ slug, book: input.book, base: input.base }),\n };\n const documents = pipe(input.book.skills, Arr.flatMap(documentsOf(context)));\n const rendered = yield* Effect.forEach(\n documents,\n (document) => renderDocument(context, document),\n { concurrency: RENDER_CONCURRENCY },\n );\n const files = pipe(\n rendered,\n Arr.flatMap((part) => part.files),\n Arr.append(overviewFile(context)),\n );\n const entries = pipe(\n rendered,\n Arr.flatMap((part) => part.entries),\n );\n const built: Built = { files, entries };\n return built;\n});\n","import { Array as Arr, Effect, pipe } from \"effect\";\n\nimport type { Book } from \"#/entities/book/index.ts\";\nimport type { SiteFile } from \"#/shared/lib/site-file.ts\";\n\nimport { ASSET_FILES } from \"./assets.ts\";\nimport { landingPage } from \"./pages.ts\";\nimport { renderBook } from \"./render-book.ts\";\nimport { searchIndexFile } from \"./search-index.ts\";\n\nconst RENDER_CONCURRENCY = 8;\n\nexport const buildSite = Effect.fn(\"buildSite\")(function* buildSite(input: {\n readonly books: readonly Book[];\n readonly base: string;\n}) {\n const built = yield* Effect.forEach(\n input.books,\n (book) => renderBook({ books: input.books, book, base: input.base }),\n { concurrency: RENDER_CONCURRENCY },\n );\n const entries = pipe(\n built,\n Arr.flatMap((part) => part.entries),\n );\n const search = yield* searchIndexFile(entries);\n const books = pipe(\n built,\n Arr.flatMap((part) => part.files),\n );\n const files: readonly SiteFile[] = [\n ...books,\n { path: \"index.html\", content: landingPage(input) },\n ...ASSET_FILES,\n search,\n ];\n return files;\n});\n","import {\n Array as Arr,\n Effect,\n FileSystem,\n Match,\n Option,\n Path,\n Predicate,\n Record as Rec,\n Schema,\n String as Str,\n pipe,\n} from \"effect\";\n\nimport type { Book, Reference, Skill } from \"#/entities/book/index.ts\";\nimport { parseSkill } from \"#/entities/book/index.ts\";\n\nconst taggedError = Schema.TaggedError;\n\nexport class BookReadError extends taggedError<BookReadError, { readonly brand: unique symbol }>()(\n \"BookReadError\",\n {\n directory: Schema.String,\n reason: Schema.String,\n },\n) {}\n\nconst RepositoryObject = Schema.Struct({\n url: Schema.String,\n directory: Schema.optionalKey(Schema.String),\n});\nconst Repository = Schema.Union([Schema.String, RepositoryObject]);\n\nconst PackageJson = Schema.Struct({\n name: Schema.String,\n version: Schema.String,\n description: Schema.optionalKey(Schema.String),\n homepage: Schema.optionalKey(Schema.String),\n repository: Schema.optionalKey(Repository),\n});\n\ntype Manifest = typeof PackageJson.Type;\n\nconst PackageJsonText = Schema.fromJsonString(PackageJson);\nconst decodePackageJson = Schema.decodeUnknownEffect(PackageJsonText);\n\nconst SKILLS_DIRECTORY = \"skills\";\nconst SKILL_FILE = \"SKILL.md\";\nconst MANIFEST_FILE = \"package.json\";\nconst MARKDOWN = \".md\";\nconst ROOT_ENTRY = \".\";\nconst GIT_PREFIX = /^git\\+/u;\nconst GIT_SUFFIX = /\\.git$/u;\nconst SHORTHAND = /^(?:github:)?(?<slug>[\\w.-]+\\/[\\w.-]+)$/u;\nconst FILE_CONCURRENCY = 16;\n\nconst githubSlug = (value: string): Option.Option<string> =>\n pipe(\n value,\n Str.match(SHORTHAND),\n Option.flatMapNullishOr((found) => found.groups),\n Option.flatMap((groups) => Rec.get(groups, \"slug\")),\n );\n\nconst repositoryUrl = (value: string): string =>\n pipe(\n githubSlug(value),\n Option.match({\n onNone: () => pipe(value, Str.replace(GIT_PREFIX, \"\"), Str.replace(GIT_SUFFIX, \"\")),\n onSome: (slug) => `https://github.com/${slug}`,\n }),\n );\n\nconst repositoryText = (repository: NonNullable<Manifest[\"repository\"]>): string =>\n Match.value(repository).pipe(\n Match.when(Predicate.isString, (text) => text),\n Match.orElse((described) => described.url),\n );\n\nconst repositoryDirectory = (\n repository: NonNullable<Manifest[\"repository\"]>,\n): Option.Option<string> =>\n Match.value(repository).pipe(\n Match.when(Predicate.isString, () => Option.none<string>()),\n Match.orElse((described) => Option.fromNullishOr(described.directory)),\n );\n\nconst sortedNames = (names: readonly string[]): readonly string[] =>\n pipe(names, Arr.sortBy(Str.Order));\n\nconst nestedDirectories = (name: string, names: readonly string[]): readonly string[] => {\n const prefix = `${name}/`;\n return pipe(names, Arr.filter(Str.startsWith(prefix)), Arr.map(Str.slice(prefix.length)));\n};\n\nconst isReference =\n (nested: readonly string[]) =>\n (entry: string): boolean =>\n Str.endsWith(MARKDOWN)(entry) &&\n entry !== SKILL_FILE &&\n !pipe(\n nested,\n Arr.some((directory) => Str.startsWith(`${directory}/`)(entry)),\n );\n\nconst readReferences = Effect.fn(\"readReferences\")(function* readReferences(input: {\n readonly skillDirectory: string;\n readonly name: string;\n readonly names: readonly string[];\n}) {\n const fileSystem = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const entries = yield* fileSystem.readDirectory(input.skillDirectory, { recursive: true });\n const nested = nestedDirectories(input.name, input.names);\n const files = pipe(entries, Arr.filter(isReference(nested)), sortedNames);\n return yield* Effect.forEach(\n files,\n (file) =>\n fileSystem\n .readFileString(path.join(input.skillDirectory, file))\n .pipe(Effect.map((text): Reference => ({ file, text }))),\n { concurrency: FILE_CONCURRENCY },\n );\n});\n\nconst readManifest = Effect.fn(\"readManifest\")(function* readManifest(directory: string) {\n const fileSystem = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n return yield* fileSystem.readFileString(path.join(directory, MANIFEST_FILE)).pipe(\n Effect.flatMap(decodePackageJson),\n Effect.mapError((cause) =>\n BookReadError.make({ directory, reason: `${MANIFEST_FILE}: ${cause.message}` }),\n ),\n );\n});\n\nconst skillNames = Effect.fn(\"skillNames\")(function* skillNames(skillsDirectory: string) {\n const fileSystem = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const entries = yield* fileSystem\n .readDirectory(skillsDirectory, { recursive: true })\n .pipe(Effect.orElseSucceed((): readonly string[] => []));\n return pipe(\n entries,\n Arr.filter((entry) => path.basename(entry) === SKILL_FILE),\n Arr.map((entry) => path.dirname(entry)),\n Arr.filter((name) => name !== ROOT_ENTRY),\n sortedNames,\n );\n});\n\nconst readSkill = Effect.fn(\"readSkill\")(function* readSkill(input: {\n readonly skillsDirectory: string;\n readonly name: string;\n readonly names: readonly string[];\n}) {\n const { name, names, skillsDirectory } = input;\n const fileSystem = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const skillDirectory = path.join(skillsDirectory, name);\n const text = yield* fileSystem.readFileString(path.join(skillDirectory, SKILL_FILE));\n const references = yield* readReferences({ skillDirectory, name, names });\n return yield* parseSkill({ name, text, references });\n});\n\nconst readSkills = Effect.fn(\"readSkills\")(function* readSkills(directory: string) {\n const path = yield* Path.Path;\n const skillsDirectory = path.join(directory, SKILLS_DIRECTORY);\n const names = yield* skillNames(skillsDirectory);\n yield* Effect.filterOrFail(Effect.succeed(names), Arr.isReadonlyArrayNonEmpty, () =>\n BookReadError.make({ directory, reason: `no ${SKILL_FILE} under ${SKILLS_DIRECTORY}/` }),\n );\n const skills: readonly Skill[] = yield* Effect.forEach(\n names,\n (name) => readSkill({ skillsDirectory, name, names }),\n { concurrency: FILE_CONCURRENCY },\n );\n return skills;\n});\n\n/** @internal */\nexport const readBook = Effect.fn(\"readBook\")(function* readBook(directory: string) {\n const manifest = yield* readManifest(directory);\n const skills = yield* readSkills(directory);\n const book: Book = {\n name: manifest.name,\n version: manifest.version,\n description: manifest.description ?? \"\",\n repository: pipe(\n Option.fromNullishOr(manifest.repository),\n Option.map(repositoryText),\n Option.map(repositoryUrl),\n ),\n directory: pipe(Option.fromNullishOr(manifest.repository), Option.flatMap(repositoryDirectory)),\n homepage: Option.fromNullishOr(manifest.homepage),\n skills,\n };\n return book;\n});\n","import { Boolean as Bool, Effect, FileSystem, Path, Schema, Array as Arr } from \"effect\";\n\nimport type { SiteFile } from \"#/shared/lib/site-file.ts\";\n\nconst taggedError = Schema.TaggedError;\n\nexport class SiteWriteError extends taggedError<\n SiteWriteError,\n { readonly brand: unique symbol }\n>()(\"SiteWriteError\", {\n directory: Schema.String,\n reason: Schema.String,\n}) {}\n\nconst MARKER = \".intent-book\";\nconst FILE_CONCURRENCY = 16;\n\nconst clearOld = Effect.fn(\"clearOld\")(function* clearOld(directory: string) {\n const fileSystem = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const owned = yield* fileSystem.exists(path.join(directory, MARKER));\n const entries = yield* fileSystem.readDirectory(directory);\n const writable = owned || Arr.isReadonlyArrayEmpty(entries);\n yield* Bool.match(writable, {\n onTrue: () => fileSystem.remove(directory, { recursive: true }),\n onFalse: () =>\n SiteWriteError.make({\n directory,\n reason: `not empty and not created by intent-book (no ${MARKER} file)`,\n }),\n });\n});\n\nconst writeFile = Effect.fn(\"writeFile\")(function* writeFile(directory: string, file: SiteFile) {\n const fileSystem = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const target = path.join(directory, file.path);\n yield* fileSystem.makeDirectory(path.dirname(target), { recursive: true });\n yield* fileSystem.writeFileString(target, file.content);\n});\n\n/** @internal */\nexport const writeSite = Effect.fn(\"writeSite\")(function* writeSite(\n directory: string,\n files: readonly SiteFile[],\n) {\n const fileSystem = yield* FileSystem.FileSystem;\n const present = yield* fileSystem.exists(directory);\n yield* Bool.match(present, {\n onTrue: () => clearOld(directory),\n onFalse: () => Effect.void,\n });\n yield* writeFile(directory, { path: MARKER, content: \"\" });\n yield* Effect.forEach(files, (file) => writeFile(directory, file), {\n concurrency: FILE_CONCURRENCY,\n });\n});\n","import manifest from \"@r_masseater/intent-book/package.json\" with { type: \"json\" };\nimport { runMain } from \"@r_masseater/node-main\";\nimport { Array as Arr, Boolean as Bool, Console, Effect, Path } from \"effect\";\nimport { Argument, Command, Flag } from \"effect/cli\";\n\nimport { buildSite } from \"#/features/build-site/index.ts\";\nimport { readBook } from \"#/features/read-book/index.ts\";\nimport { writeSite } from \"#/features/write-site/index.ts\";\n\nconst CURRENT_DIRECTORY = \".\";\nconst READ_CONCURRENCY = 4;\n\nconst directoriesOf = (given: readonly string[]): readonly string[] =>\n Bool.match(Arr.isReadonlyArrayEmpty(given), {\n onTrue: () => [CURRENT_DIRECTORY],\n onFalse: () => given,\n });\n\nconst build = Effect.fn(\"build\")(function* build(input: {\n readonly directories: readonly string[];\n readonly out: string;\n readonly base: string;\n}) {\n const path = yield* Path.Path;\n const books = yield* Effect.forEach(\n directoriesOf(input.directories),\n (directory) => readBook(path.resolve(directory)),\n { concurrency: READ_CONCURRENCY },\n );\n const files = yield* buildSite({ books, base: input.base });\n yield* writeSite(path.resolve(input.out), files);\n yield* Console.log(`${books.length} package(s), ${files.length} files -> ${input.out}`);\n});\n\nconst command = Command.make(\n \"intent-book\",\n {\n directories: Argument.String(\"package\").pipe(\n Argument.withDescription(\"Directory of an npm package that ships skills/ (default: .)\"),\n Argument.variadic(),\n ),\n out: Flag.String(\"out\").pipe(\n Flag.withDescription(\"Directory to write the site to\"),\n Flag.withDefault(\"book\"),\n ),\n base: Flag.String(\"base\").pipe(\n Flag.withDescription(\"Path the site is served under, with a leading and trailing slash\"),\n Flag.withDefault(\"/\"),\n ),\n },\n build,\n);\n\nrunMain(\"intent-book\")(Command.run(command, { version: manifest.version }));\n"],"mappings":";;;;;;;;;;;;;;;;;;ACAA,MAAa,SAAS,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AEzB,MAAM,iBAAiB,UACrBC,QAAK,MAAMC,MAAI,qBAAqB,KAAK,GAAG;CAC1C,cAAc,CAAC,iBAAiB;CAChC,eAAe;AACjB,CAAC;AAEH,MAAM,QAAQ,OAAO,GAAG,OAAO,CAAC,CAAC,UAAU,MAAM,OAI9C;CACD,MAAM,OAAO,OAAO,KAAK;CACzB,MAAM,QAAQ,OAAO,OAAO,QAC1B,cAAc,MAAM,WAAW,IAC9B,cAAc,SAAS,KAAK,QAAQ,SAAS,CAAC,GAC/C,EAAE,aAAa,iBAAiB,CAClC;CACA,MAAM,QAAQ,OAAO,UAAU;EAAE;EAAO,MAAM,MAAM;CAAK,CAAC;CAC1D,OAAO,UAAU,KAAK,QAAQ,MAAM,GAAG,GAAG,KAAK;CAC/C,OAAO,QAAQ,IAAI,GAAG,MAAM,OAAO,eAAe,MAAM,OAAO,YAAY,MAAM,KAAK;AACxF,CAAC;AAED,MAAM,UAAU,QAAQ,KACtB,eACA;CACE,aAAa,SAAS,OAAO,SAAS,CAAC,CAAC,KACtC,SAAS,gBAAgB,6DAA6D,GACtF,SAAS,SAAS,CACpB;CACA,KAAK,KAAK,OAAO,KAAK,CAAC,CAAC,KACtB,KAAK,gBAAgB,gCAAgC,GACrD,KAAK,YAAY,MAAM,CACzB;CACA,MAAM,KAAK,OAAO,MAAM,CAAC,CAAC,KACxB,KAAK,gBAAgB,kEAAkE,GACvF,KAAK,YAAY,GAAG,CACtB;AACF,GACA,KACF;AAEA,QAAQ,aAAa,CAAC,CAAC,QAAQ,IAAI,SAAS,EAAWC,QAAiB,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"intent-book.mjs","names":["Arr","MARKDOWN_SUFFIX","Str","Arr","Fn","Rec","taggedError","Str","Bool","SKILL_FILE","Str","Arr","Rec","Fn","Arr","Str","Fn","Rec","overviewRoute","SINGLE_BOOK","taggedError","textOf","Str","Rec","Arr","MARKDOWN_SUFFIX","Str","Arr","Str","Rec","Arr","Bool","Str","RENDER_CONCURRENCY","Fn","textOf","Arr","Bool","Arr","taggedError","taggedError","FILE_CONCURRENCY","Str","Rec","Arr","Bool","Arr","Bool","Bool","Arr","manifest.version"],"sources":["../package.json","../src/features/build-site/model/asset-paths.ts","../src/features/build-site/model/assets-script.ts","../src/features/build-site/model/assets-styles-1.ts","../src/features/build-site/model/assets-styles-2.ts","../src/features/build-site/model/assets-styles-3.ts","../src/features/build-site/model/assets.ts","../src/entities/book/model/book.ts","../src/entities/book/model/skill.ts","../src/shared/lib/html.ts","../src/features/build-site/model/links.ts","../src/features/build-site/model/pages.ts","../src/shared/lib/render-markdown.ts","../src/features/build-site/model/documents.ts","../src/features/build-site/model/search-index.ts","../src/features/build-site/model/shell.ts","../src/features/build-site/model/render-book.ts","../src/features/build-site/model/build-site.ts","../src/features/read-book/model/no-skills-error.ts","../src/features/read-book/model/read-book.ts","../src/features/write-site/model/write-site.ts","../bin/intent-book.ts"],"sourcesContent":["","export const ASSET_DIRECTORY = \"_intent-book\";\nexport const STYLE_PATH = `${ASSET_DIRECTORY}/book.css`;\nexport const SCRIPT_PATH = `${ASSET_DIRECTORY}/book.js`;\nexport const INDEX_PATH = `${ASSET_DIRECTORY}/search.json`;\n","import { INDEX_PATH } from \"./asset-paths.ts\";\n\nexport const SCRIPT = String.raw`const root = document.documentElement;\nconst body = document.body;\nconst narrow = window.matchMedia(\"(max-width: 820px)\");\n\nconst remember = (key, value) => {\n try {\n localStorage.setItem(key, value);\n } catch {\n return;\n }\n};\n\nconst recall = (key) => {\n try {\n return localStorage.getItem(key);\n } catch {\n return null;\n }\n};\n\nconst savedTheme = recall(\"intent-book-theme\");\nif (savedTheme) {\n root.dataset.theme = savedTheme;\n}\n\nif (recall(\"intent-book-nav\") === \"closed\" && !narrow.matches) {\n body.dataset.nav = \"closed\";\n}\n\ndocument.querySelector(\"[data-theme-toggle]\")?.addEventListener(\"click\", () => {\n const dark =\n root.dataset.theme === \"dark\" ||\n (root.dataset.theme === undefined && window.matchMedia(\"(prefers-color-scheme: dark)\").matches);\n root.dataset.theme = dark ? \"light\" : \"dark\";\n remember(\"intent-book-theme\", root.dataset.theme);\n});\n\ndocument.querySelector(\"[data-nav-toggle]\")?.addEventListener(\"click\", () => {\n if (narrow.matches) {\n body.dataset.nav = body.dataset.nav === \"open\" ? \"\" : \"open\";\n return;\n }\n body.dataset.nav = body.dataset.nav === \"closed\" ? \"\" : \"closed\";\n remember(\"intent-book-nav\", body.dataset.nav);\n});\n\nconst headings = [...document.querySelectorAll(\".prose :is(h2, h3)[id]\")];\nconst links = new Map(\n [...document.querySelectorAll(\".toc a\")].map((link) => [link.getAttribute(\"href\").slice(1), link]),\n);\nif (headings.length > 0 && links.size > 0) {\n const mark = () => {\n const passed = headings.filter((heading) => heading.getBoundingClientRect().top < 120);\n const current = passed.at(-1) ?? headings[0];\n for (const [id, link] of links) {\n if (id === current.id) {\n link.setAttribute(\"aria-current\", \"true\");\n } else {\n link.removeAttribute(\"aria-current\");\n }\n }\n };\n window.addEventListener(\"scroll\", mark, { passive: true });\n mark();\n}\n\nconst dialog = document.querySelector(\"dialog.search\");\nif (dialog) {\n const input = dialog.querySelector(\"input\");\n const list = dialog.querySelector(\"ul\");\n const base = document.querySelector(\"meta[name='intent-book-base']\").content;\n let index;\n\n const load = async () => {\n if (!index) {\n index = await (await fetch(base + \"${INDEX_PATH}\")).json();\n }\n return index;\n };\n\n const show = (entries) => {\n list.replaceChildren(\n ...entries.map((entry) => {\n const item = document.createElement(\"li\");\n const link = document.createElement(\"a\");\n link.href = entry.url;\n link.textContent = entry.title;\n const detail = document.createElement(\"small\");\n detail.textContent = entry.book + \" · \" + entry.name;\n link.append(detail);\n item.append(link);\n return item;\n }),\n );\n if (entries.length === 0) {\n const empty = document.createElement(\"li\");\n empty.className = \"empty\";\n empty.textContent = input.value ? \"No matches\" : \"\";\n list.append(empty);\n }\n };\n\n const search = async () => {\n const words = input.value.toLowerCase().split(/\\s+/u).filter(Boolean);\n const entries = await load();\n if (words.length === 0) {\n show([]);\n return;\n }\n const scored = entries\n .map((entry) => {\n const haystack = entry.text.toLowerCase();\n const title = (entry.title + \" \" + entry.name).toLowerCase();\n if (!words.every((word) => haystack.includes(word))) {\n return undefined;\n }\n return { entry, score: words.filter((word) => title.includes(word)).length };\n })\n .filter(Boolean)\n .sort((left, right) => right.score - left.score);\n show(scored.slice(0, 30).map((match) => match.entry));\n };\n\n const open = () => {\n dialog.showModal();\n input.focus();\n input.select();\n };\n\n document.querySelector(\"[data-search-open]\")?.addEventListener(\"click\", open);\n input.addEventListener(\"input\", search);\n input.addEventListener(\"keydown\", (event) => {\n if (event.key === \"Enter\") {\n list.querySelector(\"a\")?.click();\n }\n });\n dialog.addEventListener(\"click\", (event) => {\n if (event.target === dialog) {\n dialog.close();\n }\n });\n window.addEventListener(\"keydown\", (event) => {\n if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === \"k\") {\n event.preventDefault();\n open();\n }\n });\n}\n`;\n","export const BASE_STYLES = String.raw`:root {\n --bg: #ffffff;\n --bg-soft: #f7f7f5;\n --ink: #1b1d1f;\n --ink-soft: #5c6166;\n --line: #e4e4e0;\n --accent: #0b6b5d;\n --accent-soft: #e3f1ee;\n --critical: #b42318;\n --high: #b54708;\n --code-bg: #f6f6f3;\n --sidebar: 17rem;\n --toc: 14.5rem;\n --measure: 46rem;\n --top: 3.5rem;\n color-scheme: light;\n}\n\n:root[data-theme=\"dark\"] {\n --bg: #15171a;\n --bg-soft: #1b1e22;\n --ink: #e8e9ea;\n --ink-soft: #a0a5ab;\n --line: #2c3036;\n --accent: #4fc3ae;\n --accent-soft: #1d2f2c;\n --critical: #ff8a80;\n --high: #f5b361;\n --code-bg: #1b1e22;\n color-scheme: dark;\n}\n\n@media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) {\n --bg: #15171a;\n --bg-soft: #1b1e22;\n --ink: #e8e9ea;\n --ink-soft: #a0a5ab;\n --line: #2c3036;\n --accent: #4fc3ae;\n --accent-soft: #1d2f2c;\n --critical: #ff8a80;\n --high: #f5b361;\n --code-bg: #1b1e22;\n color-scheme: dark;\n }\n}\n\n* {\n box-sizing: border-box;\n}\n\nhtml {\n scroll-padding-top: calc(var(--top) + 1rem);\n}\n\nbody {\n margin: 0;\n background: var(--bg);\n color: var(--ink);\n font: 16px/1.7 system-ui, -apple-system, \"Segoe UI\", \"Hiragino Sans\", \"Noto Sans JP\", sans-serif;\n -webkit-font-smoothing: antialiased;\n}\n\na {\n color: var(--accent);\n text-underline-offset: 0.18em;\n}\n\nbutton {\n font: inherit;\n color: inherit;\n}\n\n.top {\n position: sticky;\n top: 0;\n z-index: 20;\n display: flex;\n align-items: center;\n gap: 0.75rem;\n height: var(--top);\n padding: 0 1rem;\n background: var(--bg);\n border-bottom: 1px solid var(--line);\n}\n\n.brand {\n font-weight: 650;\n color: var(--ink);\n text-decoration: none;\n}\n\n.brand small {\n margin-left: 0.5rem;\n font-weight: 400;\n color: var(--ink-soft);\n}\n\n.top .grow {\n flex: 1;\n}\n\n.icon-button,\n.search-open {\n display: inline-flex;\n align-items: center;\n gap: 0.5rem;\n min-height: 2.25rem;\n padding: 0 0.75rem;\n border: 1px solid var(--line);\n border-radius: 0.5rem;\n background: var(--bg);\n cursor: pointer;\n}\n\n.icon-button:hover,\n.search-open:hover {\n background: var(--bg-soft);\n}\n\n.search-open {\n min-width: 15rem;\n color: var(--ink-soft);\n justify-content: space-between;\n}\n\n.search-open kbd {\n font: 0.75rem ui-monospace, monospace;\n padding: 0.05rem 0.4rem;\n border: 1px solid var(--line);\n border-radius: 0.3rem;\n}\n\n.shell {\n display: grid;\n grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--toc);\n min-height: calc(100vh - var(--top));\n}\n\nbody[data-nav=\"closed\"] .shell {\n grid-template-columns: 0 minmax(0, 1fr) var(--toc);\n}\n\nbody[data-nav=\"closed\"] .side {\n visibility: hidden;\n padding: 0;\n border: 0;\n}\n\n.side,\n.toc {\n position: sticky;\n top: var(--top);\n align-self: start;\n max-height: calc(100vh - var(--top));\n overflow-y: auto;\n font-size: 0.9rem;\n}\n\n.side {\n padding: 1.25rem 0.75rem 3rem 1rem;\n border-right: 1px solid var(--line);\n}\n\n.side ul,\n.toc ul {\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.side a {\n display: block;\n padding: 0.28rem 0.6rem;\n border-radius: 0.4rem;\n color: var(--ink-soft);\n text-decoration: none;\n}\n\n.side a:hover {\n background: var(--bg-soft);\n color: var(--ink);\n}\n\n.side a[aria-current=\"page\"] {\n background: var(--accent-soft);\n color: var(--accent);\n font-weight: 600;\n}\n\n.side details > summary {\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: pointer;\n list-style: none;\n}\n\n.side details > summary > a {\n flex: 1;\n}\n\n.side details > summary::-webkit-details-marker {\n display: none;\n}\n\n.side .group > summary {\n margin-top: 0.9rem;\n padding: 0.25rem 0.6rem;\n color: var(--ink-soft);\n font-size: 0.72rem;\n font-weight: 650;\n letter-spacing: 0.06em;\n text-transform: uppercase;\n}\n\n.side summary::after {\n content: \"\";\n flex: none;\n width: 0.4rem;\n height: 0.4rem;\n margin: 0 0.6rem;\n border-right: 1.5px solid currentColor;\n border-bottom: 1.5px solid currentColor;\n transform: rotate(-45deg);\n transition: transform 0.12s;\n}\n`;\n","export const COMPONENT_STYLES = String.raw`.side details[open] > summary::after {\n transform: rotate(45deg);\n}\n\n.side .children {\n margin-left: 0.9rem;\n border-left: 1px solid var(--line);\n}\n\n.side .book-switch > summary {\n display: flex;\n align-items: center;\n gap: 0.4rem;\n padding: 0.5rem 0.7rem;\n border: 1px solid var(--line);\n border-radius: 0.5rem;\n font-weight: 600;\n}\n\n.side .book-switch ul {\n margin: 0.25rem 0 0.5rem;\n}\n\n.side .book-switch summary strong {\n margin-right: auto;\n overflow-wrap: anywhere;\n}\n\nmain {\n min-width: 0;\n padding: 2rem 2.5rem 5rem;\n}\n\narticle {\n max-width: var(--measure);\n margin: 0 auto;\n}\n\n.crumbs {\n margin: 0 0 0.5rem;\n font-size: 0.85rem;\n color: var(--ink-soft);\n}\n\n.crumbs a {\n color: inherit;\n}\n\nh1 {\n margin: 0 0 0.4rem;\n font-size: 2.25rem;\n line-height: 1.2;\n letter-spacing: -0.01em;\n}\n\n.lead {\n margin: 0 0 1rem;\n font-size: 1rem;\n line-height: 1.65;\n color: var(--ink-soft);\n}\n\n.chips {\n display: flex;\n flex-wrap: wrap;\n gap: 0.5rem;\n margin: 0 0 1.25rem;\n}\n\n.chips span,\n.chips a {\n display: inline-block;\n padding: 0.05rem 0.65rem;\n border: 1px solid var(--line);\n border-radius: 999px;\n font-size: 0.8rem;\n color: var(--ink-soft);\n text-decoration: none;\n}\n\n.chips a:hover {\n background: var(--bg-soft);\n}\n\n.need {\n margin: 0 0 1.75rem;\n padding: 0.75rem 1rem;\n border-left: 3px solid var(--accent);\n background: var(--bg-soft);\n border-radius: 0 0.4rem 0.4rem 0;\n font-size: 0.92rem;\n}\n\n.need strong {\n display: block;\n margin-bottom: 0.15rem;\n}\n\n.need span + span::before {\n content: \"·\";\n margin: 0 0.5rem;\n color: var(--ink-soft);\n}\n\n.prose h2 {\n margin: 2.5rem 0 0.75rem;\n padding-top: 1.5rem;\n border-top: 1px solid var(--line);\n font-size: 1.5rem;\n line-height: 1.3;\n}\n\n.prose h3 {\n margin: 1.75rem 0 0.5rem;\n font-size: 1.15rem;\n}\n\n.prose h3[data-severity] {\n padding-left: 0.75rem;\n border-left: 3px solid var(--line);\n}\n\n.prose h3[data-severity=\"critical\"] {\n border-color: var(--critical);\n}\n\n.prose h3[data-severity=\"high\"] {\n border-color: var(--high);\n}\n\n.prose :is(h2, h3, h4) > a {\n color: inherit;\n text-decoration: none;\n}\n\n.prose p,\n.prose ul,\n.prose ol {\n margin: 0.85rem 0;\n}\n\n.prose code {\n padding: 0.1rem 0.3rem;\n border-radius: 0.3rem;\n background: var(--code-bg);\n font: 0.88em ui-monospace, \"SF Mono\", Menlo, Consolas, monospace;\n}\n\n.prose pre {\n margin: 1.1rem 0;\n padding: 0.9rem 1.1rem;\n overflow-x: auto;\n border: 1px solid var(--line);\n border-radius: 0.5rem;\n background: var(--code-bg);\n font-size: 0.86rem;\n line-height: 1.6;\n}\n\n.prose pre code {\n padding: 0;\n background: none;\n font-size: inherit;\n}\n\n.shiki,\n.shiki span {\n color: var(--shiki-light);\n}\n\n:root[data-theme=\"dark\"] .shiki,\n:root[data-theme=\"dark\"] .shiki span {\n color: var(--shiki-dark);\n}\n\n@media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) .shiki,\n :root:not([data-theme=\"light\"]) .shiki span {\n color: var(--shiki-dark);\n }\n}\n\n.shiki {\n background: transparent !important;\n}\n\n.prose table {\n width: 100%;\n margin: 1.1rem 0;\n border-collapse: collapse;\n font-size: 0.92rem;\n}\n\n.prose th,\n.prose td {\n padding: 0.45rem 0.7rem;\n border: 1px solid var(--line);\n text-align: left;\n}\n\n.prose th {\n background: var(--bg-soft);\n}\n\n.prose blockquote {\n margin: 1rem 0;\n padding: 0.1rem 1rem;\n border-left: 3px solid var(--line);\n color: var(--ink-soft);\n}\n\n.sources {\n margin-top: 3rem;\n padding-top: 1.25rem;\n border-top: 1px solid var(--line);\n font-size: 0.9rem;\n}\n\n.sources h2 {\n margin: 0 0 0.5rem;\n font-size: 0.8rem;\n letter-spacing: 0.06em;\n text-transform: uppercase;\n color: var(--ink-soft);\n}\n\n.sources ul {\n margin: 0;\n padding-left: 1.1rem;\n}\n\n.sources code {\n font: 0.85em ui-monospace, monospace;\n}\n`;\n","export const PAGE_STYLES = String.raw`.pager {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 1rem;\n margin-top: 3rem;\n}\n\n.pager a {\n display: block;\n padding: 0.7rem 1rem;\n border: 1px solid var(--line);\n border-radius: 0.5rem;\n text-decoration: none;\n color: var(--ink);\n}\n\n.pager a:hover {\n border-color: var(--accent);\n}\n\n.pager small {\n display: block;\n color: var(--ink-soft);\n}\n\n.pager .next {\n grid-column: 2;\n text-align: right;\n}\n\n.rows {\n margin: 0.5rem 0 1.5rem;\n padding: 0;\n list-style: none;\n}\n\n.rows a {\n display: grid;\n grid-template-columns: 15rem minmax(0, 1fr);\n gap: 1rem;\n padding: 0.7rem 0;\n border-bottom: 1px solid var(--line);\n color: var(--ink);\n text-decoration: none;\n}\n\n.rows a:hover .name {\n text-decoration: underline;\n}\n\n.rows .name {\n font-weight: 600;\n overflow-wrap: anywhere;\n}\n\n.rows .desc {\n display: -webkit-box;\n overflow: hidden;\n color: var(--ink-soft);\n font-size: 0.92rem;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n}\n\n.overview h2 {\n margin: 2rem 0 0;\n font-size: 0.8rem;\n letter-spacing: 0.06em;\n text-transform: uppercase;\n color: var(--ink-soft);\n}\n\n.toc {\n padding: 2rem 1rem 3rem 0.5rem;\n}\n\n.toc h2 {\n margin: 0 0 0.6rem;\n font-size: 0.72rem;\n letter-spacing: 0.06em;\n text-transform: uppercase;\n color: var(--ink-soft);\n}\n\n.toc ul {\n border-left: 1px solid var(--line);\n}\n\n.toc a {\n display: block;\n padding: 0.18rem 0 0.18rem 0.8rem;\n margin-left: -1px;\n border-left: 2px solid transparent;\n color: var(--ink-soft);\n text-decoration: none;\n}\n\n.toc .depth-3 a {\n padding-left: 1.6rem;\n}\n\n.toc a:hover {\n color: var(--ink);\n}\n\n.toc a[aria-current=\"true\"] {\n border-left-color: var(--accent);\n color: var(--ink);\n font-weight: 600;\n}\n\ndialog.search {\n width: min(36rem, calc(100vw - 2rem));\n margin-top: 10vh;\n padding: 0;\n border: 1px solid var(--line);\n border-radius: 0.75rem;\n background: var(--bg);\n color: var(--ink);\n}\n\ndialog.search::backdrop {\n background: rgb(0 0 0 / 0.35);\n}\n\n.search input {\n width: 100%;\n padding: 0.9rem 1.1rem;\n border: 0;\n border-bottom: 1px solid var(--line);\n background: transparent;\n color: inherit;\n font: inherit;\n outline: none;\n}\n\n.search ul {\n max-height: 55vh;\n margin: 0;\n padding: 0.4rem;\n overflow-y: auto;\n list-style: none;\n}\n\n.search li a {\n display: block;\n padding: 0.55rem 0.7rem;\n border-radius: 0.4rem;\n color: var(--ink);\n text-decoration: none;\n}\n\n.search li a:hover,\n.search li a[data-active] {\n background: var(--accent-soft);\n}\n\n.search li small {\n display: block;\n color: var(--ink-soft);\n}\n\n.search .empty {\n padding: 0.9rem 1.1rem;\n color: var(--ink-soft);\n}\n\n@media (max-width: 1180px) {\n .shell,\n body[data-nav=\"closed\"] .shell {\n grid-template-columns: var(--sidebar) minmax(0, 1fr);\n }\n\n body[data-nav=\"closed\"] .shell {\n grid-template-columns: 0 minmax(0, 1fr);\n }\n\n .toc {\n display: none;\n }\n}\n\n@media (max-width: 820px) {\n .shell,\n body[data-nav=\"closed\"] .shell {\n grid-template-columns: minmax(0, 1fr);\n }\n\n .side {\n position: fixed;\n inset: var(--top) 0 0 0;\n z-index: 15;\n width: min(20rem, 88vw);\n max-height: none;\n background: var(--bg);\n transform: translateX(-100%);\n transition: transform 0.15s;\n }\n\n body[data-nav=\"open\"] .side {\n transform: none;\n }\n\n body[data-nav=\"closed\"] .side {\n visibility: visible;\n padding: 1.25rem 0.75rem 3rem 1rem;\n border-right: 1px solid var(--line);\n }\n\n main {\n padding: 1.5rem 1rem 4rem;\n }\n\n h1 {\n font-size: 1.8rem;\n }\n\n .search-open {\n min-width: 0;\n }\n\n .search-open span {\n display: none;\n }\n\n .rows a {\n grid-template-columns: 1fr;\n gap: 0.1rem;\n }\n}\n`;\n","import { Array as Arr, pipe } from \"effect\";\n\nimport type { SiteFile } from \"#/shared/lib/site-file.ts\";\n\nimport { SCRIPT_PATH, STYLE_PATH } from \"./asset-paths.ts\";\nimport { SCRIPT } from \"./assets-script.ts\";\nimport { BASE_STYLES } from \"./assets-styles-1.ts\";\nimport { COMPONENT_STYLES } from \"./assets-styles-2.ts\";\nimport { PAGE_STYLES } from \"./assets-styles-3.ts\";\n\nconst STYLE_SEPARATOR = \"\\n\";\n\nexport const ASSET_FILES: readonly SiteFile[] = [\n {\n path: STYLE_PATH,\n content: pipe([BASE_STYLES, COMPONENT_STYLES, PAGE_STYLES], Arr.join(STYLE_SEPARATOR)),\n },\n { path: SCRIPT_PATH, content: SCRIPT },\n];\n","import {\n Array as Arr,\n Function as Fn,\n Option,\n Order,\n pipe,\n Record as Rec,\n String as Str,\n} from \"effect\";\n\nimport type { Skill } from \"./skill.ts\";\n\nexport interface Book {\n readonly name: string;\n readonly version: string;\n readonly description: string;\n readonly repository: Option.Option<string>;\n readonly directory: Option.Option<string>;\n readonly homepage: Option.Option<string>;\n readonly skills: readonly Skill[];\n}\n\nexport interface Group {\n readonly type: string;\n readonly skills: readonly Skill[];\n}\n\nexport type Page =\n | { readonly kind: \"overview\" }\n | { readonly kind: \"skill\"; readonly name: string }\n | { readonly kind: \"source\"; readonly name: string }\n | { readonly kind: \"reference\"; readonly name: string; readonly file: string };\n\ntype Skills = Readonly<Record<string, Skill>>;\n\nconst TYPE_ORDER: readonly string[] = [\n \"lifecycle\",\n \"core\",\n \"sub-skill\",\n \"framework\",\n \"composition\",\n \"security\",\n];\n\nconst OTHER = \"other\";\nconst MARKDOWN_SUFFIX = /\\.md$/u;\nconst REQUIRE_SEPARATOR = \"#\";\nconst NO_DEPTH = 0;\nconst ONE_LEVEL = 1;\nconst DATA_FIRST_ARITY = 2;\n\nexport const requiredName = (requirement: string): string =>\n pipe(\n requirement,\n Str.split(REQUIRE_SEPARATOR),\n Arr.last,\n Option.getOrElse(Fn.constant(requirement)),\n );\n\nconst typeIndex = (type: string): number =>\n pipe(\n TYPE_ORDER,\n Arr.findFirstIndex((known) => known === type),\n Option.getOrElse(Fn.constant(TYPE_ORDER.length)),\n );\n\nconst byType: Order.Order<string> = Order.combine(\n Order.mapInput(Order.Number, typeIndex),\n Order.String,\n);\n\nconst requiredSkills =\n (byName: Skills, seen: readonly string[]) =>\n (skill: Skill): readonly Skill[] =>\n pipe(\n skill.requires,\n Arr.flatMap((requirement) => Option.toArray(Rec.get(byName, requiredName(requirement)))),\n Arr.filter((required) => !Arr.contains(seen, required.name)),\n );\n\nconst depth =\n (byName: Skills, seen: readonly string[]) =>\n (skill: Skill): number =>\n pipe(\n skill,\n requiredSkills(byName, seen),\n Arr.map((required) => depth(byName, Arr.append(seen, skill.name))(required) + ONE_LEVEL),\n Arr.prepend(NO_DEPTH),\n Arr.max(Order.Number),\n );\n\nconst orderedByDepth = (skills: readonly Skill[]): readonly Skill[] => {\n const byName = Rec.fromIterableBy(skills, (skill) => skill.name);\n const compareDepth = Order.mapInput(Order.Number, depth(byName, []));\n const compareName = Order.mapInput(Order.String, (skill: Skill) => skill.name);\n return Arr.sort(skills, Order.combine(compareDepth, compareName));\n};\n\nexport const typeOf = (skill: Skill): string => Option.getOrElse(skill.type, Fn.constant(OTHER));\n\nexport const groupSkills = (skills: readonly Skill[]): readonly Group[] => {\n const grouped = Arr.groupBy(skills, typeOf);\n return pipe(\n Rec.toEntries(grouped),\n Arr.map(([type, members]) => ({ type, skills: orderedByDepth(members) })),\n Arr.sortBy(Order.mapInput(byType, (group: Group) => group.type)),\n );\n};\n\nexport const orderedSkills = (groups: readonly Group[]): readonly Skill[] =>\n pipe(\n groups,\n Arr.flatMap((group) => group.skills),\n );\n\nconst requiredNames = (skill: Skill): readonly string[] =>\n pipe(skill.requires, Arr.map(requiredName));\n\nexport const entrySkills = (skills: readonly Skill[]): readonly Skill[] => {\n const required = pipe(skills, Arr.flatMap(requiredNames));\n return pipe(\n skills,\n Arr.filter(\n (skill) => Arr.isReadonlyArrayEmpty(skill.requires) && Arr.contains(required, skill.name),\n ),\n );\n};\n\nconst pageRoute = (page: Page): string => {\n switch (page.kind) {\n case \"overview\": {\n return \"\";\n }\n case \"skill\": {\n return `${page.name}/`;\n }\n case \"source\": {\n return `${page.name}.md`;\n }\n case \"reference\": {\n return `${page.name}/${Str.replace(MARKDOWN_SUFFIX, \"\")(page.file)}/`;\n }\n default: {\n return page satisfies never;\n }\n }\n};\n\nexport const routeOf: {\n (page: Page): (slug: string) => string;\n (slug: string, page: Page): string;\n} = Fn.dual(DATA_FIRST_ARITY, (slug: string, page: Page): string => `/${slug}/${pageRoute(page)}`);\n","import { Effect, Option, pipe, Record, Schema, String as Str } from \"effect\";\nimport { parse } from \"yaml\";\n\nexport interface Reference {\n readonly file: string;\n readonly text: string;\n}\n\nexport interface Skill {\n readonly name: string;\n readonly description: string;\n readonly type: Option.Option<string>;\n readonly framework: Option.Option<string>;\n readonly libraryVersion: Option.Option<string>;\n readonly requires: readonly string[];\n readonly sources: readonly string[];\n readonly text: string;\n readonly body: string;\n readonly references: readonly Reference[];\n}\n\nconst taggedError = Schema.TaggedError;\n\nexport class SkillFormatError extends taggedError<\n SkillFormatError,\n { readonly brand: unique symbol }\n>()(\"SkillFormatError\", { skill: Schema.String, reason: Schema.String }) {}\n\nconst Scalar = Schema.Union([Schema.String, Schema.Finite]);\nconst OptionalText = Schema.String.pipe(Schema.optionalKey);\nconst OptionalScalar = Scalar.pipe(Schema.optionalKey);\nconst OptionalList = Schema.Array(Schema.String).pipe(Schema.optionalKey);\n\nconst Metadata = Schema.Struct({\n type: OptionalText,\n framework: OptionalText,\n library_version: OptionalScalar,\n});\n\nconst Frontmatter = Schema.Struct({\n description: Schema.String,\n type: OptionalText,\n framework: OptionalText,\n library_version: OptionalScalar,\n metadata: Metadata.pipe(Schema.optionalKey),\n requires: OptionalList,\n sources: OptionalList,\n});\n\ntype FrontmatterData = typeof Frontmatter.Type;\n\nconst FRONTMATTER = /^---[ \\t]*\\r?\\n(?<yaml>[\\s\\S]*?)\\r?\\n---[ \\t]*(?:\\r?\\n|$)(?<body>[\\s\\S]*)$/u;\nconst WHITESPACE = /\\s+/gu;\nconst NO_ENTRIES: readonly string[] = [];\n\nconst decodeFrontmatter = Schema.decodeUnknownEffect(Frontmatter);\n\nconst splitFrontmatter = (\n text: string,\n): Option.Option<{ readonly yaml: string; readonly body: string }> =>\n Str.match(FRONTMATTER)(text).pipe(\n Option.flatMap((found) => Option.fromNullishOr(found.groups)),\n Option.flatMap((groups) =>\n Option.all({ yaml: Record.get(groups, \"yaml\"), body: Record.get(groups, \"body\") }),\n ),\n );\n\nconst failed = (skill: string, reason: string): SkillFormatError =>\n SkillFormatError.make({ skill, reason });\n\nconst textOfScalar = (value: Option.Option<string | number>): Option.Option<string> =>\n value.pipe(Option.map((scalar) => globalThis.String(scalar)));\n\nconst metadataOr = <Value>(\n frontmatter: FrontmatterData,\n read: (\n source: Readonly<Pick<FrontmatterData, \"type\" | \"framework\" | \"library_version\">>,\n ) => Value | undefined,\n): Option.Option<Value> =>\n Option.fromNullishOr(frontmatter.metadata).pipe(\n Option.flatMapNullishOr(read),\n Option.orElse(() => Option.fromNullishOr(read(frontmatter))),\n );\n\nexport const parseSkill = Effect.fn(\"parseSkill\")(function* parseSkill(\n input: Readonly<{\n name: string;\n text: string;\n references: readonly { readonly file: string; readonly text: string }[];\n }>,\n) {\n const parts = yield* splitFrontmatter(input.text).pipe(\n Effect.fromOption,\n Effect.mapError(() => failed(input.name, \"SKILL.md has no frontmatter\")),\n );\n const data: unknown = yield* Effect.try({\n try: (): unknown => parse(parts.yaml),\n catch: (cause) => failed(input.name, `frontmatter is not YAML: ${globalThis.String(cause)}`),\n });\n const frontmatter = yield* decodeFrontmatter(data).pipe(\n Effect.mapError((error) => failed(input.name, error.message)),\n );\n const skill: Skill = {\n name: input.name,\n description: pipe(frontmatter.description, Str.replaceAll(WHITESPACE, \" \"), Str.trim),\n type: metadataOr(frontmatter, (source) => source.type),\n framework: metadataOr(frontmatter, (source) => source.framework),\n libraryVersion: textOfScalar(metadataOr(frontmatter, (source) => source.library_version)),\n requires: frontmatter.requires ?? NO_ENTRIES,\n sources: frontmatter.sources ?? NO_ENTRIES,\n text: input.text,\n body: parts.body,\n references: input.references,\n };\n return skill;\n});\n","import { Boolean as Bool, Option, pipe } from \"effect\";\nimport type { Element } from \"hast\";\nimport { toHtml } from \"hast-util-to-html\";\nimport { h } from \"hastscript\";\n\nexport const optional =\n <Value>(build: (value: Value) => Element) =>\n (option: Option.Option<Value>): readonly Element[] =>\n pipe(option, Option.map(build), Option.toArray);\n\nexport const when =\n (condition: boolean) =>\n (build: () => readonly Element[]): readonly Element[] =>\n Bool.match(condition, { onTrue: build, onFalse: () => [] });\n\nexport const charset = (): Element =>\n h(\"meta\", { httpEquiv: \"content-type\", content: \"text/html; charset=utf-8\" });\n\nexport const htmlDocument = (input: {\n readonly head: readonly Element[];\n readonly body: readonly Element[];\n}): string => {\n const page = h(\"html\", { lang: \"en\" }, [h(\"head\", [...input.head]), h(\"body\", [...input.body])]);\n return toHtml({ type: \"root\", children: [{ type: \"doctype\" }, page] });\n};\n","import { Array as Arr, Function as Fn, Option, pipe, Record as Rec, String as Str } from \"effect\";\n\nimport { routeOf } from \"#/entities/book/index.ts\";\nimport type { Book, Skill } from \"#/entities/book/index.ts\";\nimport type { LinkResolver } from \"#/shared/lib/render-markdown.ts\";\n\ntype Target = readonly [string, string];\n\nconst LEADING_SLASH = /^\\//u;\nconst ORIGIN = \"https://intent-book.invalid/\";\nconst SKILLS_ROOT = \"skills/\";\nconst GITHUB = \"https://github.com/\";\nconst SKILL_FILE = \"SKILL.md\";\n\nexport const withBase =\n (base: string) =>\n (route: string): string =>\n `${base}${Str.replace(LEADING_SLASH, \"\")(route)}`;\n\nexport const fileOf = (route: string): string => Str.replace(LEADING_SLASH, \"\")(route);\n\nexport const sourcePath = (skill: Skill): string => `${skill.name}/${SKILL_FILE}`;\n\nexport const referencePath = (input: { readonly skill: Skill; readonly file: string }): string =>\n `${input.skill.name}/${input.file}`;\n\nconst targetsOf =\n (slug: string, base: string) =>\n (skill: Skill): readonly Target[] => {\n const own: Target = [\n sourcePath(skill),\n withBase(base)(routeOf(slug, { kind: \"skill\", name: skill.name })),\n ];\n const referenced = pipe(\n skill.references,\n Arr.map((reference): Target => [\n referencePath({ skill, file: reference.file }),\n withBase(base)(\n routeOf(slug, { kind: \"reference\", name: skill.name, file: reference.file }),\n ),\n ]),\n );\n return Arr.prepend(referenced, own);\n };\n\nconst pageTarget = (targets: Readonly<Record<string, string>>, url: URL): Option.Option<string> =>\n pipe(\n fileOf(url.pathname),\n Option.liftPredicate(Str.startsWith(SKILLS_ROOT)),\n Option.map(Str.slice(SKILLS_ROOT.length)),\n Option.flatMap((file) => Rec.get(targets, file)),\n Option.map((target) => `${target}${url.hash}`),\n );\n\nconst repositoryFile = (book: Book, url: URL): Option.Option<string> =>\n pipe(\n book.repository,\n Option.filter(Str.startsWith(GITHUB)),\n Option.map((repository) => {\n const directory = pipe(\n book.directory,\n Option.map((value) => `/${value}`),\n Option.getOrElse(Fn.constant(\"\")),\n );\n return `${repository}/blob/HEAD${directory}${url.pathname}${url.hash}`;\n }),\n );\n\nconst resolveAgainst =\n (input: { readonly book: Book; readonly targets: Readonly<Record<string, string>> }) =>\n (document: string): LinkResolver =>\n (href) =>\n pipe(\n Option.liftThrowable(() => new URL(href, `${ORIGIN}${SKILLS_ROOT}${document}`))(),\n Option.flatMap((url) =>\n pipe(\n pageTarget(input.targets, url),\n Option.orElse(() => repositoryFile(input.book, url)),\n ),\n ),\n );\n\nexport const linkResolver = (input: {\n readonly slug: string;\n readonly book: Book;\n readonly base: string;\n}): ((document: string) => LinkResolver) => {\n const targets = pipe(\n input.book.skills,\n Arr.flatMap(targetsOf(input.slug, input.base)),\n Rec.fromEntries,\n );\n return resolveAgainst({ book: input.book, targets });\n};\n","import { Array as Arr, Function as Fn, Option, pipe, Record as Rec, String as Str } from \"effect\";\nimport type { Element, ElementContent, Root } from \"hast\";\nimport { h } from \"hastscript\";\n\nimport {\n entrySkills,\n groupSkills,\n orderedSkills,\n requiredName,\n routeOf,\n typeOf,\n} from \"#/entities/book/index.ts\";\nimport type { Book, Skill } from \"#/entities/book/index.ts\";\nimport { charset, htmlDocument, optional, when } from \"#/shared/lib/html.ts\";\n\nimport { STYLE_PATH } from \"./asset-paths.ts\";\nimport { withBase } from \"./links.ts\";\n\nexport interface SkillPage {\n readonly base: string;\n readonly book: Book;\n readonly skill: Skill;\n readonly title: string;\n readonly tree: Root;\n}\n\nexport interface BookPage {\n readonly base: string;\n readonly book: Book;\n}\n\nconst SOURCE = /^(?<repository>[^/:\\s]+\\/[^:\\s]+):(?<file>.+)$/u;\nconst FIRST_SENTENCE = /^.*?[.。](?=\\s|$)/u;\nconst BEHIND = 1;\nconst AHEAD = 1;\nconst CRUMB_SEPARATOR = \" › \";\nconst GLOB = \"*\";\n\nconst contentOf = (tree: Root): readonly ElementContent[] =>\n pipe(\n tree.children,\n Arr.filter((node): node is ElementContent => node.type !== \"doctype\"),\n );\n\nconst firstSentence = (description: string): string =>\n pipe(\n description,\n Str.match(FIRST_SENTENCE),\n Option.flatMap(Arr.head),\n Option.getOrElse(Fn.constant(description)),\n );\n\nconst prose = (tree: Root): Element => h(\"div\", { class: \"prose\" }, [...contentOf(tree)]);\n\nconst crumbs = (trail: readonly (Element | string)[]): Element => {\n const parts = pipe(trail, Arr.intersperse(CRUMB_SEPARATOR));\n return h(\"p\", { class: \"crumbs\" }, [...parts]);\n};\n\nconst skillRoute = (base: string, book: Book, skill: Skill): string =>\n withBase(base)(routeOf(book.name, { kind: \"skill\", name: skill.name }));\n\nconst rawRoute = (base: string, book: Book, skill: Skill): string =>\n withBase(base)(routeOf(book.name, { kind: \"source\", name: skill.name }));\n\nconst sourceLocation = (source: string): Option.Option<string> =>\n pipe(\n source,\n Str.match(SOURCE),\n Option.flatMapNullishOr((found) => found.groups),\n Option.flatMap((groups) =>\n Option.all({ repository: Rec.get(groups, \"repository\"), file: Rec.get(groups, \"file\") }),\n ),\n Option.filter(({ file }) => !Str.includes(GLOB)(file)),\n Option.map(({ repository, file }) => `https://github.com/${repository}/blob/HEAD/${file}`),\n );\n\nconst sourceItem = (source: string): Element =>\n pipe(\n sourceLocation(source),\n Option.match({\n onNone: () => h(\"li\", [h(\"code\", source)]),\n onSome: (href) => h(\"li\", [h(\"a\", { href }, [h(\"code\", source)])]),\n }),\n );\n\nconst neighbourLink =\n (page: BookPage, style: { readonly className: string; readonly label: string }) =>\n (skill: Skill): Element =>\n h(\"a\", { class: style.className, href: skillRoute(page.base, page.book, skill) }, [\n h(\"small\", style.label),\n skill.name,\n ]);\n\nconst pager = (base: string, book: Book, skill: Skill): Element => {\n const order = orderedSkills(groupSkills(book.skills));\n const index = pipe(\n order,\n Arr.findFirstIndex((candidate) => candidate.name === skill.name),\n );\n const previous = pipe(\n index,\n Option.flatMap((position) => Arr.get(order, position - BEHIND)),\n optional(neighbourLink({ base, book }, { className: \"prev\", label: \"Previous\" })),\n );\n const next = pipe(\n index,\n Option.flatMap((position) => Arr.get(order, position + AHEAD)),\n optional(neighbourLink({ base, book }, { className: \"next\", label: \"Next\" })),\n );\n return h(\"nav\", { class: \"pager\", ariaLabel: \"Previous and next skill\" }, [...previous, ...next]);\n};\n\nconst requiredLink = (base: string, book: Book, requirement: string): Element =>\n pipe(\n book.skills,\n Arr.findFirst((candidate) => candidate.name === requiredName(requirement)),\n Option.match({\n onNone: () => h(\"code\", requirement),\n onSome: (target) => h(\"a\", { href: skillRoute(base, book, target) }, target.name),\n }),\n );\n\nconst overviewRoute = (base: string, book: Book): string =>\n withBase(base)(routeOf(book.name, { kind: \"overview\" }));\n\nconst bookLink = (base: string, book: Book): Element =>\n h(\"a\", { href: overviewRoute(base, book) }, book.name);\n\nconst skillChips = (base: string, book: Book, skill: Skill): Element => {\n const type = pipe(\n skill.type,\n optional((value) => h(\"span\", value)),\n );\n const version = pipe(\n skill.libraryVersion,\n optional((value) => h(\"span\", `v${value}`)),\n );\n const raw = h(\"a\", { href: rawRoute(base, book, skill) }, \"SKILL.md\");\n return h(\"div\", { class: \"chips\" }, [...type, ...version, raw]);\n};\n\nconst requirementItem =\n (base: string, book: Book) =>\n (requirement: string): Element =>\n h(\"span\", [requiredLink(base, book, requirement)]);\n\nconst readFirst = (base: string, book: Book, skill: Skill): readonly Element[] =>\n when(!Arr.isReadonlyArrayEmpty(skill.requires))(() => {\n const links = pipe(skill.requires, Arr.map(requirementItem(base, book)));\n return [h(\"div\", { class: \"need\" }, [h(\"strong\", \"Read first\"), ...links])];\n });\n\nconst sourceSection = (skill: Skill): readonly Element[] =>\n when(!Arr.isReadonlyArrayEmpty(skill.sources))(() => {\n const items = pipe(skill.sources, Arr.map(sourceItem));\n return [h(\"section\", { class: \"sources\" }, [h(\"h2\", \"Sources\"), h(\"ul\", items)])];\n });\n\nexport const skillMain = (input: SkillPage): readonly Element[] => {\n const { base, book, skill } = input;\n return [\n crumbs([bookLink(base, book), typeOf(skill), skill.name]),\n h(\"h1\", input.title),\n h(\"p\", { class: \"lead\" }, skill.description),\n skillChips(base, book, skill),\n ...readFirst(base, book, skill),\n prose(input.tree),\n ...sourceSection(skill),\n pager(base, book, skill),\n ];\n};\n\nexport const referenceMain = (input: SkillPage): readonly Element[] => {\n const { base, book, skill } = input;\n const parent = h(\"a\", { href: skillRoute(base, book, skill) }, skill.name);\n return [crumbs([bookLink(base, book), parent]), h(\"h1\", input.title), prose(input.tree)];\n};\n\nconst rowLink = (href: string, name: string, description: string): Element =>\n h(\"li\", [\n h(\"a\", { href }, [\n h(\"span\", { class: \"name\" }, name),\n h(\"span\", { class: \"desc\" }, description),\n ]),\n ]);\n\nconst row =\n (base: string, book: Book) =>\n (skill: Skill): Element =>\n rowLink(skillRoute(base, book, skill), skill.name, firstSentence(skill.description));\n\nconst section = (page: BookPage, title: string, skills: readonly Skill[]): readonly Element[] =>\n when(!Arr.isReadonlyArrayEmpty(skills))(() => {\n const rows = pipe(skills, Arr.map(row(page.base, page.book)));\n return [h(\"h2\", title), h(\"ul\", { class: \"rows\" }, rows)];\n });\n\nconst overviewChips = (book: Book): Element => {\n const npm = h(\"a\", { href: `https://www.npmjs.com/package/${book.name}` }, \"npm\");\n const repository = pipe(\n book.repository,\n optional((href) => h(\"a\", { href }, \"repository\")),\n );\n return h(\"div\", { class: \"chips\" }, [\n h(\"span\", `v${book.version}`),\n h(\"span\", `${book.skills.length} skills`),\n npm,\n ...repository,\n ]);\n};\n\nconst overviewSections = (page: BookPage): readonly Element[] => {\n const entries = entrySkills(page.book.skills);\n const entryNames = pipe(\n entries,\n Arr.map((skill) => skill.name),\n );\n const groups = pipe(\n groupSkills(page.book.skills),\n Arr.flatMap((group) => {\n const rest = pipe(\n group.skills,\n Arr.filter((skill) => !Arr.contains(entryNames, skill.name)),\n );\n return section(page, group.type, rest);\n }),\n );\n return [...section(page, \"Start here\", entries), ...groups];\n};\n\nexport const overviewMain = (input: BookPage): readonly Element[] => {\n const { book } = input;\n const lead = when(book.description !== \"\")(() => [h(\"p\", { class: \"lead\" }, book.description)]);\n const sections = h(\"div\", { class: \"overview\" }, [...overviewSections(input)]);\n return [crumbs([book.name]), h(\"h1\", book.name), ...lead, overviewChips(book), sections];\n};\n\nconst landingRow =\n (base: string) =>\n (book: Book): Element =>\n rowLink(overviewRoute(base, book), book.name, book.description);\n\nconst SINGLE_BOOK = 1;\n\nconst redirectTarget = (input: {\n readonly base: string;\n readonly books: readonly Book[];\n}): Option.Option<string> =>\n pipe(\n input.books,\n Option.liftPredicate((books) => books.length === SINGLE_BOOK),\n Option.flatMap(Arr.head),\n Option.map((only) => overviewRoute(input.base, only)),\n );\n\nexport const landingPage = (input: {\n readonly base: string;\n readonly books: readonly Book[];\n}): string => {\n const refresh = pipe(\n redirectTarget(input),\n optional((target) => h(\"meta\", { httpEquiv: \"refresh\", content: `0;url=${target}` })),\n );\n const rows = pipe(input.books, Arr.map(landingRow(input.base)));\n const head = [\n charset(),\n h(\"meta\", { name: \"viewport\", content: \"width=device-width, initial-scale=1\" }),\n ...refresh,\n h(\"title\", \"Skills\"),\n h(\"link\", { rel: \"stylesheet\", href: `${input.base}${STYLE_PATH}` }),\n ];\n const body = h(\"main\", [h(\"article\", [h(\"h1\", \"Skills\"), h(\"ul\", { class: \"rows\" }, rows)])]);\n return htmlDocument({ head, body: [body] });\n};\n","import rehypeShiki from \"@shikijs/rehype\";\nimport {\n Array as Arr,\n Effect,\n Option,\n Predicate,\n pipe,\n Record as Rec,\n Schema,\n String as Str,\n} from \"effect\";\nimport type { Element, Root, RootContent } from \"hast\";\nimport { toString as textOf } from \"mdast-util-to-string\";\nimport rehypeSlug from \"rehype-slug\";\nimport remarkGfm from \"remark-gfm\";\nimport remarkParse from \"remark-parse\";\nimport remarkRehype from \"remark-rehype\";\nimport { unified } from \"unified\";\nimport { visit } from \"unist-util-visit\";\n\nconst SECOND_DEPTH = 2;\nconst THIRD_DEPTH = 3;\nconst ONE_NODE = 1;\n\nexport interface Heading {\n readonly depth: typeof SECOND_DEPTH | typeof THIRD_DEPTH;\n readonly id: string;\n readonly text: string;\n}\n\nexport interface RenderedMarkdown {\n readonly tree: Root;\n readonly title: Option.Option<string>;\n readonly headings: readonly Heading[];\n}\n\nexport type LinkResolver = (href: string) => Option.Option<string>;\n\nconst taggedError = Schema.TaggedError;\n\nexport class MarkdownRenderError extends taggedError<\n MarkdownRenderError,\n { readonly brand: unique symbol }\n>()(\"MarkdownRenderError\", { reason: Schema.String }) {}\n\nconst SEVERITY = /^(?<word>CRITICAL|HIGH|MEDIUM|LOW)\\b/u;\nconst SCHEME = /^(?:[a-z][a-z\\d+.-]*:|\\/\\/|#)/iu;\nconst SECOND_LEVEL = \"h2\";\nconst THIRD_LEVEL = \"h3\";\nconst TITLE_LEVEL = \"h1\";\nconst ANCHOR = \"a\";\n\nconst processor = unified()\n .use(remarkParse)\n .use(remarkGfm)\n .use(remarkRehype)\n .use(rehypeSlug)\n .use(rehypeShiki, {\n themes: { light: \"github-light\", dark: \"github-dark\" },\n defaultColor: false,\n fallbackLanguage: \"text\",\n lazy: true,\n langs: [],\n });\n\nconst elementsOf = (tree: Root, tagName: string): readonly Element[] => {\n const found: Element[] = [];\n visit(tree, \"element\", (node: Element) => {\n if (node.tagName === tagName) {\n found.push(node);\n }\n });\n return found;\n};\n\nconst severityOf = (node: Element): Option.Option<string> =>\n pipe(\n textOf(node),\n Str.match(SEVERITY),\n Option.flatMapNullishOr((found) => found.groups),\n Option.flatMap((groups) => Rec.get(groups, \"word\")),\n Option.map(Str.toLowerCase),\n );\n\nconst stringProperty = (node: Element, key: string): Option.Option<string> =>\n pipe(Option.fromNullishOr(node.properties[key]), Option.filter(Predicate.isString));\n\nconst markSeverity = (tree: Root): void => {\n for (const node of elementsOf(tree, THIRD_LEVEL)) {\n for (const severity of Option.toArray(severityOf(node))) {\n node.properties = { ...node.properties, dataSeverity: severity };\n }\n }\n};\n\nconst resolvedHref = (node: Element, resolveLink: LinkResolver): Option.Option<string> =>\n pipe(\n stringProperty(node, \"href\"),\n Option.filter((href) => !SCHEME.test(href)),\n Option.flatMap(resolveLink),\n );\n\nconst rewriteLinks = (tree: Root, resolveLink: LinkResolver): void => {\n for (const node of elementsOf(tree, ANCHOR)) {\n for (const target of Option.toArray(resolvedHref(node, resolveLink))) {\n node.properties = { ...node.properties, href: target };\n }\n }\n};\n\nconst isTitle = (node: RootContent): boolean =>\n node.type === \"element\" && node.tagName === TITLE_LEVEL;\n\nconst takeTitle = (tree: Root): Option.Option<string> =>\n pipe(\n tree.children,\n Arr.findFirstIndex(isTitle),\n Option.map((position) => {\n const [removed] = tree.children.splice(position, ONE_NODE);\n return textOf(removed);\n }),\n );\n\nconst headingOf = (node: Element, depth: Heading[\"depth\"]): Option.Option<Heading> =>\n pipe(\n stringProperty(node, \"id\"),\n Option.map((id) => ({ depth, id, text: textOf(node) })),\n );\n\nconst headingsOf = (tree: Root): readonly Heading[] => {\n const found: Heading[] = [];\n visit(tree, \"element\", (node: Element) => {\n if (node.tagName === SECOND_LEVEL) {\n found.push(...Option.toArray(headingOf(node, SECOND_DEPTH)));\n }\n if (node.tagName === THIRD_LEVEL) {\n found.push(...Option.toArray(headingOf(node, THIRD_DEPTH)));\n }\n });\n return found;\n};\n\nexport const renderMarkdown = Effect.fn(\"renderMarkdown\")(function* renderMarkdown(\n input: Readonly<{ body: string; resolveLink: LinkResolver }>,\n) {\n const tree = yield* Effect.tryPromise({\n try: () => processor.run(processor.parse(input.body), input.body),\n catch: (cause) => MarkdownRenderError.make({ reason: globalThis.String(cause) }),\n });\n const title = takeTitle(tree);\n markSeverity(tree);\n rewriteLinks(tree, input.resolveLink);\n const page: RenderedMarkdown = { tree, title, headings: headingsOf(tree) };\n return page;\n});\n","import { Array as Arr, pipe, String as Str } from \"effect\";\nimport type { Element } from \"hast\";\n\nimport { routeOf } from \"#/entities/book/index.ts\";\nimport type { Book, Skill } from \"#/entities/book/index.ts\";\nimport type { LinkResolver } from \"#/shared/lib/render-markdown.ts\";\nimport type { SiteFile } from \"#/shared/lib/site-file.ts\";\n\nimport { fileOf, referencePath, sourcePath } from \"./links.ts\";\nimport { referenceMain, skillMain } from \"./pages.ts\";\nimport type { SkillPage } from \"./pages.ts\";\nimport type { Current } from \"./shell.ts\";\n\nexport interface BookContext {\n readonly books: readonly Book[];\n readonly book: Book;\n readonly slug: string;\n readonly base: string;\n readonly resolveFrom: (document: string) => LinkResolver;\n}\n\nexport interface Document {\n readonly skill: Skill;\n readonly body: string;\n readonly from: string;\n readonly fallbackTitle: string;\n readonly current: Current;\n readonly route: string;\n readonly main: (input: SkillPage) => readonly Element[];\n readonly raw: SiteFile;\n readonly searchName: string;\n readonly lead: string;\n}\n\ntype Reference = Skill[\"references\"][number];\n\nconst MARKDOWN_SUFFIX = /\\.md$/u;\n\nconst skillDocument = (context: BookContext, skill: Skill): Document => ({\n skill,\n body: skill.body,\n from: sourcePath(skill),\n fallbackTitle: skill.name,\n current: { kind: \"skill\", skill },\n route: routeOf(context.slug, { kind: \"skill\", name: skill.name }),\n main: skillMain,\n raw: {\n path: fileOf(routeOf(context.slug, { kind: \"source\", name: skill.name })),\n content: skill.text,\n },\n searchName: skill.name,\n lead: skill.description,\n});\n\nconst referenceDocument =\n (context: BookContext, skill: Skill) =>\n (reference: Reference): Document => {\n const path = referencePath({ skill, file: reference.file });\n return {\n skill,\n body: reference.text,\n from: path,\n fallbackTitle: Str.replace(MARKDOWN_SUFFIX, \"\")(reference.file),\n current: { kind: \"reference\", skill, file: reference.file },\n route: routeOf(context.slug, { kind: \"reference\", name: skill.name, file: reference.file }),\n main: referenceMain,\n raw: { path: `${context.slug}/${path}`, content: reference.text },\n searchName: path,\n lead: \"\",\n };\n };\n\nexport const documentsOf =\n (context: BookContext) =>\n (skill: Skill): readonly Document[] => {\n const references = pipe(skill.references, Arr.map(referenceDocument(context, skill)));\n return Arr.prepend(references, skillDocument(context, skill));\n };\n","import { Effect, Schema, String as Str } from \"effect\";\n\nimport type { SiteFile } from \"#/shared/lib/site-file.ts\";\n\nimport { INDEX_PATH } from \"./asset-paths.ts\";\n\nconst SearchEntry = Schema.Struct({\n title: Schema.String,\n name: Schema.String,\n book: Schema.String,\n url: Schema.String,\n text: Schema.String,\n});\n\nexport type SearchEntryData = typeof SearchEntry.Type;\n\nconst SEARCH_TEXT_START = 0;\nconst SEARCH_TEXT_LIMIT = 6000;\n\nconst encodeEntries = Schema.encodeEffect(Schema.fromJsonString(Schema.Array(SearchEntry)));\n\nexport const searchText = (input: { readonly lead: string; readonly body: string }): string =>\n Str.slice(SEARCH_TEXT_START, SEARCH_TEXT_LIMIT)(`${input.lead} ${input.body}`);\n\nexport const searchIndexFile = (\n entries: readonly SearchEntryData[],\n): Effect.Effect<SiteFile, Schema.SchemaError> =>\n Effect.map(encodeEntries(entries), (content) => ({ path: INDEX_PATH, content }));\n","import { Array as Arr, Boolean as Bool, pipe, Record as Rec, String as Str } from \"effect\";\nimport type { Element } from \"hast\";\nimport { h } from \"hastscript\";\n\nimport { groupSkills, routeOf } from \"#/entities/book/index.ts\";\nimport type { Book, Group, Skill } from \"#/entities/book/index.ts\";\nimport { charset, htmlDocument, when } from \"#/shared/lib/html.ts\";\nimport type { Heading } from \"#/shared/lib/render-markdown.ts\";\n\nimport { SCRIPT_PATH, STYLE_PATH } from \"./asset-paths.ts\";\nimport { withBase } from \"./links.ts\";\n\nexport type Current =\n | { readonly kind: \"overview\" }\n | { readonly kind: \"skill\"; readonly skill: Skill }\n | { readonly kind: \"reference\"; readonly skill: Skill; readonly file: string };\n\nexport interface Shell {\n readonly base: string;\n readonly books: readonly Book[];\n readonly book: Book;\n readonly title: string;\n readonly description: string;\n readonly current: Current;\n readonly main: readonly Element[];\n readonly headings: readonly Heading[];\n}\n\nconst ICON_BARS = [\"M3 6h18\", \"M3 12h18\", \"M3 18h18\"];\nconst ICON_CONTRAST = [\"M12 3a9 9 0 1 0 0 18a9 9 0 0 0 0-18z\", \"M12 3v18\"];\nconst ICON_SIZE = \"18\";\nconst SINGLE_BOOK = 1;\nconst REFERENCES_PREFIX = /^references\\//u;\nconst MARKDOWN_SUFFIX = /\\.md$/u;\n\nconst stroke = (data: string): Element => h(\"path\", Rec.singleton(\"d\", data));\n\nconst icon = (strokes: readonly string[]): Element => {\n const paths = pipe(strokes, Arr.map(stroke));\n return h(\n \"svg\",\n {\n viewBox: \"0 0 24 24\",\n width: ICON_SIZE,\n height: ICON_SIZE,\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: \"2\",\n ariaHidden: \"true\",\n },\n paths,\n );\n};\n\nconst currentMark = (active: boolean): Readonly<Record<string, string>> =>\n Bool.match(active, { onTrue: () => ({ ariaCurrent: \"page\" }), onFalse: () => ({}) });\n\nconst overviewRoute = (shell: Shell, book: Book): string =>\n withBase(shell.base)(routeOf(book.name, { kind: \"overview\" }));\n\nconst isCurrentSkill = (current: Current, skill: Skill): boolean =>\n current.kind !== \"overview\" && current.skill.name === skill.name;\n\nconst isActiveSkill = (current: Current, skill: Skill): boolean =>\n current.kind === \"skill\" && current.skill.name === skill.name;\n\nconst isActiveReference = (current: Current, skill: Skill, file: string): boolean =>\n current.kind === \"reference\" && current.skill.name === skill.name && current.file === file;\n\nconst skillLink = (shell: Shell, skill: Skill): Element => {\n const route = routeOf(shell.book.name, { kind: \"skill\", name: skill.name });\n const mark = currentMark(isActiveSkill(shell.current, skill));\n return h(\"a\", { href: withBase(shell.base)(route), ...mark }, skill.name);\n};\n\nconst referenceLabel = (file: string): string =>\n pipe(file, Str.replace(REFERENCES_PREFIX, \"\"), Str.replace(MARKDOWN_SUFFIX, \"\"));\n\nconst referenceLink = (shell: Shell, skill: Skill, file: string): Element => {\n const route = routeOf(shell.book.name, { kind: \"reference\", name: skill.name, file });\n const mark = currentMark(isActiveReference(shell.current, skill, file));\n return h(\"a\", { href: withBase(shell.base)(route), ...mark }, referenceLabel(file));\n};\n\nconst referenceList = (shell: Shell, skill: Skill): Element => {\n const items = pipe(\n skill.references,\n Arr.map((reference) => h(\"li\", [referenceLink(shell, skill, reference.file)])),\n );\n return h(\"ul\", { class: \"children\" }, items);\n};\n\nconst skillWithReferences = (shell: Shell, skill: Skill): Element => {\n const summary = h(\"summary\", [skillLink(shell, skill)]);\n const open = isCurrentSkill(shell.current, skill);\n return h(\"li\", [h(\"details\", { open }, [summary, referenceList(shell, skill)])]);\n};\n\nconst skillItem = (shell: Shell, skill: Skill): Element =>\n Bool.match(Arr.isReadonlyArrayEmpty(skill.references), {\n onTrue: () => h(\"li\", [skillLink(shell, skill)]),\n onFalse: () => skillWithReferences(shell, skill),\n });\n\nconst bookEntry = (shell: Shell, book: Book): Element =>\n h(\"li\", [h(\"a\", { href: overviewRoute(shell, book) }, book.name)]);\n\nconst bookSwitch = (shell: Shell): readonly Element[] => {\n const entries = pipe(\n shell.books,\n Arr.map((book) => bookEntry(shell, book)),\n );\n const summary = h(\"summary\", [h(\"strong\", shell.book.name)]);\n return when(shell.books.length !== SINGLE_BOOK)(() => [\n h(\"details\", { class: \"book-switch\" }, [summary, h(\"ul\", entries)]),\n ]);\n};\n\nconst overviewItem = (shell: Shell): Element => {\n const mark = currentMark(shell.current.kind === \"overview\");\n return h(\"li\", [h(\"a\", { href: overviewRoute(shell, shell.book), ...mark }, \"Overview\")]);\n};\n\nconst skillGroup = (shell: Shell, group: Group): Element => {\n const items = pipe(\n group.skills,\n Arr.map((skill) => skillItem(shell, skill)),\n );\n return h(\"details\", { class: \"group\", open: true }, [h(\"summary\", group.type), h(\"ul\", items)]);\n};\n\nconst sidebar = (shell: Shell): Element => {\n const groups = pipe(\n groupSkills(shell.book.skills),\n Arr.map((group) => skillGroup(shell, group)),\n );\n return h(\"nav\", { class: \"side\", ariaLabel: \"Skills\" }, [\n ...bookSwitch(shell),\n h(\"ul\", [overviewItem(shell)]),\n ...groups,\n ]);\n};\n\nconst tocEntry = (heading: Heading): Element =>\n h(\"li\", { class: `depth-${heading.depth}` }, [h(\"a\", { href: `#${heading.id}` }, heading.text)]);\n\nconst tocList = (headings: readonly Heading[]): Element => {\n const entries = pipe(headings, Arr.map(tocEntry));\n return h(\"div\", [h(\"h2\", \"On this page\"), h(\"ul\", entries)]);\n};\n\nconst tableOfContents = (headings: readonly Heading[]): Element =>\n h(\"aside\", { class: \"toc\", ariaLabel: \"On this page\" }, [\n Bool.match(Arr.isReadonlyArrayEmpty(headings), {\n onTrue: () => h(\"span\"),\n onFalse: () => tocList(headings),\n }),\n ]);\n\nconst iconButton = (\n label: string,\n marker: Readonly<Record<string, string>>,\n glyph: Element,\n): Element =>\n h(\"button\", { class: \"icon-button\", type: \"button\", ariaLabel: label, ...marker }, [glyph]);\n\nconst topBar = (shell: Shell): Element => {\n const brand = h(\"a\", { class: \"brand\", href: overviewRoute(shell, shell.book) }, [\n shell.book.name,\n h(\"small\", `v${shell.book.version}`),\n ]);\n const search = h(\"button\", { class: \"search-open\", type: \"button\", dataSearchOpen: \"\" }, [\n h(\"span\", \"Search\"),\n h(\"kbd\", \"Ctrl K\"),\n ]);\n return h(\"header\", { class: \"top\" }, [\n iconButton(\"Toggle navigation\", { dataNavToggle: \"\" }, icon(ICON_BARS)),\n brand,\n h(\"span\", { class: \"grow\" }),\n search,\n iconButton(\"Toggle theme\", { dataThemeToggle: \"\" }, icon(ICON_CONTRAST)),\n ]);\n};\n\nconst searchDialog = (): Element => {\n const input = h(\"input\", {\n type: \"search\",\n placeholder: \"Search skills\",\n ariaLabel: \"Search skills\",\n autocomplete: \"off\",\n });\n return h(\"dialog\", { class: \"search\", ariaLabel: \"Search\" }, [input, h(\"ul\")]);\n};\n\nconst headOf = (shell: Shell): readonly Element[] => [\n charset(),\n h(\"meta\", { name: \"viewport\", content: \"width=device-width, initial-scale=1\" }),\n h(\"meta\", { name: \"intent-book-base\", content: shell.base }),\n h(\"meta\", { name: \"description\", content: shell.description }),\n h(\"title\", `${shell.title} · ${shell.book.name}`),\n h(\"link\", { rel: \"stylesheet\", href: `${shell.base}${STYLE_PATH}` }),\n h(\"script\", { src: `${shell.base}${SCRIPT_PATH}`, defer: true }),\n];\n\nconst layout = (shell: Shell): Element =>\n h(\"div\", { class: \"shell\" }, [\n sidebar(shell),\n h(\"main\", [h(\"article\", [...shell.main])]),\n tableOfContents(shell.headings),\n ]);\n\nexport const renderShell = (shell: Shell): string =>\n htmlDocument({\n head: headOf(shell),\n body: [topBar(shell), layout(shell), searchDialog()],\n });\n","import { Array as Arr, Effect, Function as Fn, Option, pipe } from \"effect\";\nimport { toString as textOf } from \"mdast-util-to-string\";\n\nimport { routeOf } from \"#/entities/book/index.ts\";\nimport type { Book } from \"#/entities/book/index.ts\";\nimport { renderMarkdown } from \"#/shared/lib/render-markdown.ts\";\nimport type { SiteFile } from \"#/shared/lib/site-file.ts\";\n\nimport { documentsOf } from \"./documents.ts\";\nimport type { BookContext, Document } from \"./documents.ts\";\nimport { fileOf, linkResolver } from \"./links.ts\";\nimport { overviewMain } from \"./pages.ts\";\nimport { searchText } from \"./search-index.ts\";\nimport type { SearchEntryData } from \"./search-index.ts\";\nimport { renderShell } from \"./shell.ts\";\n\nexport interface Built {\n readonly files: readonly SiteFile[];\n readonly entries: readonly SearchEntryData[];\n}\n\nconst INDEX = \"index.html\";\nconst RENDER_CONCURRENCY = 8;\n\nconst indexFile = (route: string): string => `${fileOf(route)}${INDEX}`;\n\nconst renderDocument = Effect.fn(\"renderDocument\")(function* renderDocument(\n context: BookContext,\n document: Document,\n) {\n const rendered = yield* renderMarkdown({\n body: document.body,\n resolveLink: context.resolveFrom(document.from),\n });\n const title = Option.getOrElse(rendered.title, Fn.constant(document.fallbackTitle));\n const main = document.main({\n base: context.base,\n book: context.book,\n skill: document.skill,\n title,\n tree: rendered.tree,\n });\n const html = renderShell({\n base: context.base,\n books: context.books,\n book: context.book,\n title,\n description: document.skill.description,\n current: document.current,\n main,\n headings: rendered.headings,\n });\n const entry: SearchEntryData = {\n title,\n name: document.searchName,\n book: context.book.name,\n url: `${context.base}${fileOf(document.route)}`,\n text: searchText({ lead: document.lead, body: textOf(rendered.tree) }),\n };\n const page: SiteFile = { path: indexFile(document.route), content: html };\n const built: Built = { files: [page, document.raw], entries: [entry] };\n return built;\n});\n\nconst overviewFile = (context: BookContext): SiteFile => ({\n path: indexFile(routeOf(context.slug, { kind: \"overview\" })),\n content: renderShell({\n base: context.base,\n books: context.books,\n book: context.book,\n title: context.book.name,\n description: context.book.description,\n current: { kind: \"overview\" },\n main: overviewMain({ base: context.base, book: context.book }),\n headings: [],\n }),\n});\n\nexport const renderBook = Effect.fn(\"renderBook\")(function* renderBook(input: {\n readonly books: readonly Book[];\n readonly book: Book;\n readonly base: string;\n}) {\n const slug = input.book.name;\n const context: BookContext = {\n ...input,\n slug,\n resolveFrom: linkResolver({ slug, book: input.book, base: input.base }),\n };\n const documents = pipe(input.book.skills, Arr.flatMap(documentsOf(context)));\n const rendered = yield* Effect.forEach(\n documents,\n (document) => renderDocument(context, document),\n { concurrency: RENDER_CONCURRENCY },\n );\n const files = pipe(\n rendered,\n Arr.flatMap((part) => part.files),\n Arr.append(overviewFile(context)),\n );\n const entries = pipe(\n rendered,\n Arr.flatMap((part) => part.entries),\n );\n const built: Built = { files, entries };\n return built;\n});\n","import { Array as Arr, Boolean as Bool, Effect, pipe } from \"effect\";\n\nimport type { Book } from \"#/entities/book/index.ts\";\nimport type { SiteFile } from \"#/shared/lib/site-file.ts\";\n\nimport { ASSET_FILES } from \"./assets.ts\";\nimport { landingPage } from \"./pages.ts\";\nimport { renderBook } from \"./render-book.ts\";\nimport { searchIndexFile } from \"./search-index.ts\";\n\nconst RENDER_CONCURRENCY = 8;\n\nconst landingFiles = (input: {\n readonly books: readonly Book[];\n readonly base: string;\n readonly landing: boolean;\n}): readonly SiteFile[] =>\n Bool.match(input.landing, {\n onTrue: () => [{ path: \"index.html\", content: landingPage(input) }],\n onFalse: () => [],\n });\n\nexport const buildSite = Effect.fn(\"buildSite\")(function* buildSite(input: {\n readonly books: readonly Book[];\n readonly base: string;\n readonly landing: boolean;\n}) {\n const built = yield* Effect.forEach(\n input.books,\n (book) => renderBook({ books: input.books, book, base: input.base }),\n { concurrency: RENDER_CONCURRENCY },\n );\n const entries = pipe(\n built,\n Arr.flatMap((part) => part.entries),\n );\n const search = yield* searchIndexFile(entries);\n const books = pipe(\n built,\n Arr.flatMap((part) => part.files),\n );\n const files: readonly SiteFile[] = [...books, ...landingFiles(input), ...ASSET_FILES, search];\n return files;\n});\n","import { Schema } from \"effect\";\n\nconst taggedError = Schema.TaggedError;\n\nexport class NoSkillsError extends taggedError<NoSkillsError, { readonly brand: unique symbol }>()(\n \"NoSkillsError\",\n { directory: Schema.String },\n) {}\n","import {\n Array as Arr,\n Boolean as Bool,\n Effect,\n FileSystem,\n Match,\n Option,\n Path,\n Predicate,\n Record as Rec,\n Schema,\n String as Str,\n pipe,\n} from \"effect\";\n\nimport type { Book, Reference, Skill } from \"#/entities/book/index.ts\";\nimport { parseSkill } from \"#/entities/book/index.ts\";\n\nimport { NoSkillsError } from \"./no-skills-error.ts\";\n\nconst taggedError = Schema.TaggedError;\n\nexport class BookReadError extends taggedError<BookReadError, { readonly brand: unique symbol }>()(\n \"BookReadError\",\n {\n directory: Schema.String,\n reason: Schema.String,\n },\n) {}\n\nconst RepositoryObject = Schema.Struct({\n url: Schema.String,\n directory: Schema.optionalKey(Schema.String),\n});\nconst Repository = Schema.Union([Schema.String, RepositoryObject]);\n\nconst PackageJson = Schema.Struct({\n name: Schema.String,\n version: Schema.String,\n description: Schema.optionalKey(Schema.String),\n homepage: Schema.optionalKey(Schema.String),\n repository: Schema.optionalKey(Repository),\n});\n\ntype Manifest = typeof PackageJson.Type;\n\nconst PackageJsonText = Schema.fromJsonString(PackageJson);\nconst decodePackageJson = Schema.decodeUnknownEffect(PackageJsonText);\n\nconst SKILLS_DIRECTORY = \"skills\";\nconst SKILL_FILE = \"SKILL.md\";\nconst MANIFEST_FILE = \"package.json\";\nconst MARKDOWN = \".md\";\nconst ROOT_ENTRY = \".\";\nconst GIT_PREFIX = /^git\\+/u;\nconst GIT_SUFFIX = /\\.git$/u;\nconst SHORTHAND = /^(?:github:)?(?<slug>[\\w.-]+\\/[\\w.-]+)$/u;\nconst FILE_CONCURRENCY = 16;\nconst READ_CONCURRENCY = 4;\nconst ONE_DIRECTORY = 1;\n\nconst githubSlug = (value: string): Option.Option<string> =>\n pipe(\n value,\n Str.match(SHORTHAND),\n Option.flatMapNullishOr((found) => found.groups),\n Option.flatMap((groups) => Rec.get(groups, \"slug\")),\n );\n\nconst repositoryUrl = (value: string): string =>\n pipe(\n githubSlug(value),\n Option.match({\n onNone: () => pipe(value, Str.replace(GIT_PREFIX, \"\"), Str.replace(GIT_SUFFIX, \"\")),\n onSome: (slug) => `https://github.com/${slug}`,\n }),\n );\n\nconst repositoryText = (repository: NonNullable<Manifest[\"repository\"]>): string =>\n Match.value(repository).pipe(\n Match.when(Predicate.isString, (text) => text),\n Match.orElse((described) => described.url),\n );\n\nconst repositoryDirectory = (\n repository: NonNullable<Manifest[\"repository\"]>,\n): Option.Option<string> =>\n Match.value(repository).pipe(\n Match.when(Predicate.isString, () => Option.none<string>()),\n Match.orElse((described) => Option.fromNullishOr(described.directory)),\n );\n\nconst sortedNames = (names: readonly string[]): readonly string[] =>\n pipe(names, Arr.sortBy(Str.Order));\n\nconst nestedDirectories = (name: string, names: readonly string[]): readonly string[] => {\n const prefix = `${name}/`;\n return pipe(names, Arr.filter(Str.startsWith(prefix)), Arr.map(Str.slice(prefix.length)));\n};\n\nconst isReference =\n (nested: readonly string[]) =>\n (entry: string): boolean =>\n Str.endsWith(MARKDOWN)(entry) &&\n entry !== SKILL_FILE &&\n !pipe(\n nested,\n Arr.some((directory) => Str.startsWith(`${directory}/`)(entry)),\n );\n\nconst readReferences = Effect.fn(\"readReferences\")(function* readReferences(input: {\n readonly skillDirectory: string;\n readonly name: string;\n readonly names: readonly string[];\n}) {\n const fileSystem = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const entries = yield* fileSystem.readDirectory(input.skillDirectory, { recursive: true });\n const nested = nestedDirectories(input.name, input.names);\n const files = pipe(entries, Arr.filter(isReference(nested)), sortedNames);\n return yield* Effect.forEach(\n files,\n (file) =>\n fileSystem\n .readFileString(path.join(input.skillDirectory, file))\n .pipe(Effect.map((text): Reference => ({ file, text }))),\n { concurrency: FILE_CONCURRENCY },\n );\n});\n\nconst readManifest = Effect.fn(\"readManifest\")(function* readManifest(directory: string) {\n const fileSystem = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n return yield* fileSystem.readFileString(path.join(directory, MANIFEST_FILE)).pipe(\n Effect.flatMap(decodePackageJson),\n Effect.mapError((cause) =>\n BookReadError.make({ directory, reason: `${MANIFEST_FILE}: ${cause.message}` }),\n ),\n );\n});\n\nconst skillNames = Effect.fn(\"skillNames\")(function* skillNames(skillsDirectory: string) {\n const fileSystem = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const entries = yield* fileSystem\n .readDirectory(skillsDirectory, { recursive: true })\n .pipe(Effect.orElseSucceed((): readonly string[] => []));\n return pipe(\n entries,\n Arr.filter((entry) => path.basename(entry) === SKILL_FILE),\n Arr.map((entry) => path.dirname(entry)),\n Arr.filter((name) => name !== ROOT_ENTRY),\n sortedNames,\n );\n});\n\nconst readSkill = Effect.fn(\"readSkill\")(function* readSkill(input: {\n readonly skillsDirectory: string;\n readonly name: string;\n readonly names: readonly string[];\n}) {\n const { name, names, skillsDirectory } = input;\n const fileSystem = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const skillDirectory = path.join(skillsDirectory, name);\n const text = yield* fileSystem.readFileString(path.join(skillDirectory, SKILL_FILE));\n const references = yield* readReferences({ skillDirectory, name, names });\n return yield* parseSkill({ name, text, references });\n});\n\nconst readSkills = Effect.fn(\"readSkills\")(function* readSkills(directory: string) {\n const path = yield* Path.Path;\n const skillsDirectory = path.join(directory, SKILLS_DIRECTORY);\n const names = yield* skillNames(skillsDirectory);\n yield* Effect.filterOrFail(Effect.succeed(names), Arr.isReadonlyArrayNonEmpty, () =>\n NoSkillsError.make({ directory }),\n );\n const skills: readonly Skill[] = yield* Effect.forEach(\n names,\n (name) => readSkill({ skillsDirectory, name, names }),\n { concurrency: FILE_CONCURRENCY },\n );\n return skills;\n});\n\n/** @internal */\nexport const readBook = Effect.fn(\"readBook\")(function* readBook(directory: string) {\n const manifest = yield* readManifest(directory);\n const skills = yield* readSkills(directory);\n const book: Book = {\n name: manifest.name,\n version: manifest.version,\n description: manifest.description ?? \"\",\n repository: pipe(\n Option.fromNullishOr(manifest.repository),\n Option.map(repositoryText),\n Option.map(repositoryUrl),\n ),\n directory: pipe(Option.fromNullishOr(manifest.repository), Option.flatMap(repositoryDirectory)),\n homepage: Option.fromNullishOr(manifest.homepage),\n skills,\n };\n return book;\n});\n\nconst skippable =\n (directories: readonly string[]) =>\n (error: NoSkillsError): Effect.Effect<Option.Option<Book>, NoSkillsError> =>\n Bool.match(Arr.isReadonlyArrayNonEmpty(Arr.drop(directories, ONE_DIRECTORY)), {\n onTrue: () => Effect.succeed(Option.none<Book>()),\n onFalse: () => Effect.fail(error),\n });\n\n/** @internal */\nexport const readBooks = Effect.fn(\"readBooks\")(function* readBooks(\n directories: readonly string[],\n) {\n const results = yield* Effect.forEach(\n directories,\n (directory) =>\n readBook(directory).pipe(\n Effect.asSome,\n Effect.catchTag(\"NoSkillsError\", skippable(directories)),\n ),\n { concurrency: READ_CONCURRENCY },\n );\n const books = Arr.getSomes(results);\n yield* Effect.filterOrFail(Effect.succeed(books), Arr.isReadonlyArrayNonEmpty, () =>\n NoSkillsError.make({ directory: Arr.join(directories, \", \") }),\n );\n const skipped = pipe(\n Arr.zip(directories, results),\n Arr.filter(([, result]) => Option.isNone(result)),\n Arr.map(([directory]) => directory),\n );\n return { books, skipped };\n});\n","import { Boolean as Bool, Effect, FileSystem, Path, Schema, Array as Arr } from \"effect\";\n\nimport type { SiteFile } from \"#/shared/lib/site-file.ts\";\n\nconst taggedError = Schema.TaggedError;\n\nexport class SiteWriteError extends taggedError<\n SiteWriteError,\n { readonly brand: unique symbol }\n>()(\"SiteWriteError\", {\n directory: Schema.String,\n reason: Schema.String,\n}) {}\n\nconst MARKER = \".intent-book\";\nconst FILE_CONCURRENCY = 16;\n\nconst clearOld = Effect.fn(\"clearOld\")(function* clearOld(directory: string) {\n const fileSystem = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const owned = yield* fileSystem.exists(path.join(directory, MARKER));\n const entries = yield* fileSystem.readDirectory(directory);\n const writable = owned || Arr.isReadonlyArrayEmpty(entries);\n yield* Bool.match(writable, {\n onTrue: () => fileSystem.remove(directory, { recursive: true }),\n onFalse: () =>\n SiteWriteError.make({\n directory,\n reason: `not empty and not created by intent-book (no ${MARKER} file)`,\n }),\n });\n});\n\nconst writeFile = Effect.fn(\"writeFile\")(function* writeFile(directory: string, file: SiteFile) {\n const fileSystem = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const target = path.join(directory, file.path);\n yield* fileSystem.makeDirectory(path.dirname(target), { recursive: true });\n yield* fileSystem.writeFileString(target, file.content);\n});\n\n/** @internal */\nexport const writeSite = Effect.fn(\"writeSite\")(function* writeSite(\n directory: string,\n files: readonly SiteFile[],\n) {\n const fileSystem = yield* FileSystem.FileSystem;\n const present = yield* fileSystem.exists(directory);\n yield* Bool.match(present, {\n onTrue: () => clearOld(directory),\n onFalse: () => Effect.void,\n });\n yield* writeFile(directory, { path: MARKER, content: \"\" });\n yield* Effect.forEach(files, (file) => writeFile(directory, file), {\n concurrency: FILE_CONCURRENCY,\n });\n});\n","import manifest from \"@r_masseater/intent-book/package.json\" with { type: \"json\" };\nimport { runMain } from \"@r_masseater/node-main\";\nimport { Array as Arr, Boolean as Bool, Console, Effect, Path } from \"effect\";\nimport { Argument, Command, Flag } from \"effect/cli\";\n\nimport { buildSite } from \"#/features/build-site/index.ts\";\nimport { readBooks } from \"#/features/read-book/index.ts\";\nimport { writeSite } from \"#/features/write-site/index.ts\";\n\nconst CURRENT_DIRECTORY = \".\";\n\nconst directoriesOf = (given: readonly string[]): readonly string[] =>\n Bool.match(Arr.isReadonlyArrayEmpty(given), {\n onTrue: () => [CURRENT_DIRECTORY],\n onFalse: () => given,\n });\n\nconst build = Effect.fn(\"build\")(function* build(input: {\n readonly directories: readonly string[];\n readonly out: string;\n readonly base: string;\n readonly landing: boolean;\n}) {\n const path = yield* Path.Path;\n const { books, skipped } = yield* readBooks(\n Arr.map(directoriesOf(input.directories), (directory) => path.resolve(directory)),\n );\n const files = yield* buildSite({ books, base: input.base, landing: input.landing });\n yield* Bool.match(Arr.isReadonlyArrayNonEmpty(skipped), {\n onTrue: () => Console.log(`skipped (no skills): ${Arr.join(skipped, \", \")}`),\n onFalse: () => Effect.void,\n });\n yield* writeSite(path.resolve(input.out), files);\n yield* Console.log(`${books.length} package(s), ${files.length} files -> ${input.out}`);\n});\n\nconst command = Command.make(\n \"intent-book\",\n {\n directories: Argument.String(\"package\").pipe(\n Argument.withDescription(\"Directory of an npm package that ships skills/ (default: .)\"),\n Argument.variadic(),\n ),\n out: Flag.String(\"out\").pipe(\n Flag.withDescription(\"Directory to write the site to\"),\n Flag.withDefault(\"book\"),\n ),\n base: Flag.String(\"base\").pipe(\n Flag.withDescription(\"Path the site is served under, with a leading and trailing slash\"),\n Flag.withDefault(\"/\"),\n ),\n noLanding: Flag.Boolean(\"no-landing\").pipe(\n Flag.withDescription(\n \"Do not write index.html at the root, for a site that lives inside another site\",\n ),\n ),\n },\n (input) =>\n build({\n directories: input.directories,\n out: input.out,\n base: input.base,\n landing: !input.noLanding,\n }),\n);\n\nrunMain(\"intent-book\")(Command.run(command, { version: manifest.version }));\n"],"mappings":";;;;;;;;;;;;;;;;;;ACAA,MAAa,kBAAkB;AAC/B,MAAa,aAAa,GAAG,gBAAgB;AAC7C,MAAa,cAAc,GAAG,gBAAgB;AAC9C,MAAa,aAAa,GAAG,gBAAgB;;ACD7C,MAAa,SAAS,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CA2EW,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC7EtD,MAAa,cAAc,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACArC,MAAa,mBAAmB,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACA1C,MAAa,cAAc,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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M;CACnB,KAAK,MAAM;CACX,MAAM,MAAM;CACZ,SAAS,CAAC,MAAM;AAClB,CAAC,CACL;AAEA,QAAQ,aAAa,CAAC,CAAC,QAAQ,IAAI,SAAS,EAAWC,QAAiB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@r_masseater/intent-book",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Builds a GitBook-style documentation site for people from the TanStack Intent agent skills (SKILL.md) that an npm package ships, so agent and human documentation share one source.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent-skills",
|
|
@@ -39,6 +39,7 @@ vp dlx @r_masseater/intent-book . --out book --base /docs/
|
|
|
39
39
|
- Write `description` as sentences. The first sentence is the summary on the overview.
|
|
40
40
|
- Put `type` in `metadata`. Pages are grouped and ordered by it: `lifecycle`, `core`, `sub-skill`, `framework`, `composition`, `security`.
|
|
41
41
|
- Link another skill by the relative path to its SKILL.md. The link becomes a page link.
|
|
42
|
+
- Every other Markdown file in the skill directory, such as `references/` or `scripts/`, becomes a page. A link to a file that is not a page points to that file on GitHub when `repository` is a GitHub URL.
|
|
42
43
|
|
|
43
44
|
## Common mistakes
|
|
44
45
|
|