repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by bugabinga

feat(the-system): improve book navigation

ce9c47b063146806d45f20b0027afa085740d198

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (10)

+604 / −101 text lines

Diff layout

CHANGELOG.md

Modified

+11 / −3 text lines

1515- Fix `/system view` and `/system book` HTML output so rendered pages include document bodies and open in the browser
1616- Fix rich System doc rendering so heading anchors are document-scoped and iframe embeds use browser-loadable file URLs
1717- Fix `/system book` Mermaid diagrams so they load from local file output in browsers
18- Fix `/system book` layout so the On this page sidebar no longer overlaps content, the dossier uses full width, header elements align, empty diagnostics are hidden, law navigation avoids duplicate labels, project metadata is used for titles and favicons, and graph labels no longer overflow boxes
19- Improve `/system book` with a responsive dossier reader, collapsible navigation, attached search results with highlights, diagnostic links, reference graph, Nugu colors, and print CSS
18- Fix `/system book` layout so the On this page sidebar and referenced-by panels no longer overlap content, referenced-by panels are collapsible at the end of pages, the dossier uses full width, header elements align, empty diagnostics are hidden, law navigation avoids duplicate labels, project metadata is used for titles and favicons, and graph labels no longer overflow boxes
19- Fix `/system book` mobile layout so navigation drawers start collapsed, headings and topbar scale responsively, and the reference graph uses a constrained initial viewport
20- Fix `/system book` at limited desktop widths so the right utilities rail is hidden instead of covering graph controls
21- Fix `/system book` document links so they navigate within the book instead of jumping to separate file pages
22- Fix `/system book` layout so clicking document links no longer causes horizontal scroll or layout corruption
23- Improve `/system book` with a responsive dossier reader, fixed header and left navigation with utilities merged in instead of a separate right box, collapsible navigation, attached search results with highlights, diagnostic links, reference graph, Nugu colors, and print CSS
24- Improve The System book reference graph with all linked docs, pan/zoom controls, touch gestures, clickable node links, text fallback, and Dagre primary-edge layered layout to reduce crossing and clutter
25- Fix The System book reference graph so pan/zoom handling no longer breaks node links
26- Remove redundant helper text from The System book reference graph header
2027- Update The System lifecycle design around one `/system` command with subcommands for init, doctor, view, book, research, spec, spec-verify, phase, plan, issue, and exec
2128- Update The System lifecycle stages: the small path is `spec -> exec`; the larger path is `research -> spec -> spec-verify -> phase -> plan -> exec`; optional stages never auto-chain
2229- Update The System lifecycle IDs to schema v3 token IDs and rename roadmap terminology to phase terminology
2330- Update The System lifecycle design so phase and plan status is `draft` or `done`; `done` means human-approved, immutable, and exec-eligible, while supersession happens by creating a new artifact with prose references
2431- Require interactive approval before changing a phase or plan from `draft` to `done`
25- Update The System lifecycle metadata: specs have `id`, `type`, `title`, and optional `research`; phases have `spec` plus `status: draft|done`; plans have `spec`, optional `phase`, and `status: draft|done`; issues have `specs` and `status: open|done`; `spec-verify` creates no canonical document
32- Update The System lifecycle metadata: specs have `id`, `type`, `title`, and optional `research`; phases have `spec`, `status: draft|done`, and optional `depends_on`; plans have `spec`, optional `phase`, `status: draft|done`, and optional `depends_on`; issues have `specs` and `status: open|done`; `spec-verify` creates no canonical document
33- Add The System dependency validation and rendering for phase and plan `depends_on`, including same-spec checks, dangling-reference and cycle diagnostics, reference graph edges, and dependency-aware book ordering
2634- Update The System rich-Markdown design to use phases instead of roadmaps in the lifecycle model
2735- Remove The System exported skills and top-level prompt templates; `/system` subcommands use internal prompt includes for document and Markdown knowledge
2836- Remove unused The System renderer dependencies

extensions/the-system/__e2e__/renderer.spec.ts

Modified

+138 / −1 text lines

5656 page.getByRole("heading", { name: /the-system-render-e2e-.* Dossier/ }),
5757 ).toBeVisible();
5858 await expect(page.getByRole("link", { name: "CORE-SYSTEM" })).toBeVisible();
59 await expect(page.getByText("PX-PHASE-PHASE001").first()).toBeVisible();
59 await expect(page.locator("#PX-PHASE-PHASE001")).toBeVisible();
60 await expect(page.locator(".book-toc")).toHaveCount(0);
61 await expect(page.getByText("On this page")).toHaveCount(0);
62 await expect(page.locator(".book-nav .nav-utils")).toBeVisible();
63 await expect(page.locator(".mobile-nav > details")).not.toHaveAttribute(
64 "open",
65 "",
66 );
67 await expect(page.locator("#PX-SPEC-SPEC0001 .doc-related")).toHaveCount(1);
68 await expect(
69 page.locator("#PX-SPEC-SPEC0001 .doc-related"),
70 ).not.toHaveAttribute("open", "");
71 await expect(
72 page.locator("#PX-SPEC-SPEC0001 article > :last-child"),
73 ).toHaveClass(/doc-related/);
74 await expect(page.locator("#PX-SPEC-SPEC0001 .doc-related")).toContainText(
75 "Delivery",
76 );
77 await expect(page.locator("#PX-SPEC-SPEC0001 .doc-related")).toContainText(
78 "Build",
79 );
80 await expect(page.locator("#PX-SPEC-SPEC0001 .doc-related")).toContainText(
81 "Bug",
82 );
83 await expect(
84 page.locator('a[href^="file:"][href*="PX-"][href$="index.html"]'),
85 ).toHaveCount(0);
86 await expect(
87 page.locator('#PX-SPEC-SPEC0001 .ledger a[href="#PX-RESEARCH-RSCH0001"]'),
88 ).toHaveCount(1);
89 const orderedSections = await page
90 .locator(".book-section")
91 .evaluateAll((sections) => sections.map((section) => section.id));
92 expect(orderedSections.indexOf("PX-SPEC-SPEC0001")).toBeLessThan(
93 orderedSections.indexOf("PX-PHASE-PHASE001"),
94 );
95 expect(orderedSections.indexOf("PX-PHASE-PHASE001")).toBeLessThan(
96 orderedSections.indexOf("PX-PHASE-PHASE002"),
97 );
98 expect(orderedSections.indexOf("PX-PHASE-PHASE002")).toBeLessThan(
99 orderedSections.indexOf("PX-PLAN-PLAN0001"),
100 );
101 expect(orderedSections.indexOf("PX-PLAN-PLAN0001")).toBeLessThan(
102 orderedSections.indexOf("PX-PLAN-PLAN0002"),
103 );
104 expect(orderedSections.indexOf("PX-PLAN-PLAN0002")).toBeLessThan(
105 orderedSections.indexOf("PX-ISSUE-ISSUE001"),
106 );
107 expect(orderedSections.indexOf("PX-ISSUE-ISSUE001")).toBeLessThan(
108 orderedSections.indexOf("PX-RESEARCH-RSCH0001"),
109 );
110 await assertSidebarConnected(page);
111 const graph = page.locator("[data-graph-svg]");
112 await expect(graph).toBeVisible();
113 await expect(graph.locator("a")).toHaveCount(7);
114 const initialViewBox = await graph.getAttribute("viewBox");
115 await graph.hover();
116 await page.mouse.wheel(0, -240);
117 await expect(graph).not.toHaveAttribute("viewBox", initialViewBox ?? "");
118 await page.locator('[data-graph-zoom="reset"]').click();
119 await expect(graph).toHaveAttribute("viewBox", initialViewBox ?? "");
120 await graph.locator('a[href="#PX-PHASE-PHASE001"]').click();
121 await expect(page.locator("#PX-PHASE-PHASE001")).toBeInViewport();
122 await expect(page).toHaveURL(/#PX-PHASE-PHASE001$/);
123 await expect.poll(() => page.evaluate(() => scrollX)).toBe(0);
124 await assertSidebarConnected(page);
125 await page.locator('.book-nav a[href="#PX-SPEC-SPEC0001"]').click();
126 await expect(page.locator("#PX-SPEC-SPEC0001")).toBeInViewport();
127 await expect.poll(() => page.evaluate(() => scrollX)).toBe(0);
128 await page.locator("#PX-SPEC-SPEC0001 .ledger summary").click();
129 await page
130 .locator('#PX-SPEC-SPEC0001 .ledger a[href="#PX-RESEARCH-RSCH0001"]')
131 .click();
132 await expect(page.locator("#PX-RESEARCH-RSCH0001")).toBeInViewport();
133 await expect.poll(() => page.evaluate(() => scrollX)).toBe(0);
134 await page.mouse.wheel(0, 1200);
135 await assertSidebarConnected(page);
136 await page.goto(pathToFileURL(book).href);
137 await page.setViewportSize({ width: 390, height: 844 });
138 await expect(page.locator(".book-nav")).toBeHidden();
139 await expect(page.locator(".mobile-nav")).toBeVisible();
140 await expect(page.locator(".mobile-nav > details")).not.toHaveAttribute(
141 "open",
142 "",
143 );
144 await expect(page.locator(".graph-frame")).toBeVisible();
145 await page.locator('[data-graph-zoom="in"]').click();
146 await expect(graph).not.toHaveAttribute("viewBox", initialViewBox ?? "");
147 await expect.poll(() => page.evaluate(() => scrollX)).toBe(0);
60148 await page.locator("#search").fill("body-only-term");
61149 await expect(page.locator("#results")).toContainText("PX-SPEC-SPEC0001");
62150 await expect(page.locator("#results")).toContainText("body-only-term");
66154 expect(hashTree(path.join(root, ".system"))).toBe(before);
67155});
157async function assertSidebarConnected(page: {
158 evaluate: <T>(fn: () => T) => Promise<T>;
159}) {
160 const layout = await page.evaluate(() => {
161 const top = document.querySelector(".book-top")?.getBoundingClientRect();
162 const nav = document.querySelector(".book-nav")?.getBoundingClientRect();
163 const main = document.querySelector(".book-main")?.getBoundingClientRect();
164 return {
165 scrollX,
166 top: top
167 ? { bottom: top.bottom, left: top.left, right: top.right }
168 : null,
169 nav: nav ? { top: nav.top, left: nav.left, right: nav.right } : null,
170 main: main ? { left: main.left } : null,
171 };
172 });
173 expect(layout.scrollX).toBe(0);
174 expect(layout.top?.left).toBe(0);
175 expect(layout.nav?.top).toBe(layout.top?.bottom);
176 expect(layout.nav?.left).toBeGreaterThanOrEqual(0);
177 expect(layout.nav?.right ?? 0).toBeLessThan(layout.main?.left ?? 0);
178}
69180function ctx(root: string, notices: string[]) {
70181 return {
71182 cwd: root,
84195 write(root, ".system/SYSTEM.md", "# SYSTEM\n");
85196 write(root, ".system/MISSION.md", "# MISSION\n");
86197 write(root, ".system/RULES.md", "# RULES\n");
198 write(
199 root,
200 ".system/research/PX-RESEARCH-RSCH0001-notes/index.md",
201 "---\nid: PX-RESEARCH-RSCH0001\ntype: research\ntitle: Notes\n---\n\n# Notes\n",
202 );
87203 write(
88204 root,
89205 ".system/specs/PX-SPEC-SPEC0001-contract/index.md",
92208 "id: PX-SPEC-SPEC0001",
93209 "type: spec",
94210 "title: Contract",
211 "research: [PX-RESEARCH-RSCH0001]",
95212 "---",
96213 "",
97214 "# Contract",
119236 ".system/phases/PX-PHASE-PHASE001-delivery/index.md",
120237 "---\nid: PX-PHASE-PHASE001\ntype: phase\ntitle: Delivery\nspec: PX-SPEC-SPEC0001\nstatus: draft\n---\n\n# Delivery\n",
121238 );
239 write(
240 root,
241 ".system/phases/PX-PHASE-PHASE002-after-delivery/index.md",
242 "---\nid: PX-PHASE-PHASE002\ntype: phase\ntitle: After Delivery\nspec: PX-SPEC-SPEC0001\nstatus: draft\ndepends_on: [PX-PHASE-PHASE001]\n---\n\n# After Delivery\n",
243 );
244 write(
245 root,
246 ".system/plans/PX-PLAN-PLAN0001-build/index.md",
247 "---\nid: PX-PLAN-PLAN0001\ntype: plan\ntitle: Build\nspec: PX-SPEC-SPEC0001\nphase: PX-PHASE-PHASE002\nstatus: draft\n---\n\n# Build\n",
248 );
249 write(
250 root,
251 ".system/plans/PX-PLAN-PLAN0002-test/index.md",
252 "---\nid: PX-PLAN-PLAN0002\ntype: plan\ntitle: Test\nspec: PX-SPEC-SPEC0001\nphase: PX-PHASE-PHASE002\nstatus: draft\ndepends_on: [PX-PLAN-PLAN0001]\n---\n\n# Test\n",
253 );
254 write(
255 root,
256 ".system/issues/PX-ISSUE-ISSUE001-bug/index.md",
257 "---\nid: PX-ISSUE-ISSUE001\ntype: issue\ntitle: Bug\nspecs: [PX-SPEC-SPEC0001]\nstatus: open\n---\n\n# Bug\n",
258 );
122259 return root;

extensions/the-system/__tests__/documents.test.ts

Modified

+67 / −2 text lines

107107 it("projects known graph fields while preserving unknown frontmatter", () => {
108108 const parsed = parseAuthoredDocument(
109 `---\nid: PX-PLAN-PL4N0001\ntype: plan\ntitle: Delivery\nspec: PX-SPEC-SPEC0001\nphase: PX-PHASE-PH4S0001\nstatus: draft\nreview:\n owner: human\n---\n`,
109 `---\nid: PX-PLAN-PL4N0001\ntype: plan\ntitle: Delivery\nspec: PX-SPEC-SPEC0001\nphase: PX-PHASE-PH4S0001\nstatus: draft\ndepends_on: [PX-PLAN-PL4N0000]\nreview:\n owner: human\n---\n`,
110110 "PX",
111111 );
112112 assert.deepEqual(parsed.metadata, {
116116 spec: "PX-SPEC-SPEC0001",
117117 phase: "PX-PHASE-PH4S0001",
118118 status: "draft",
119 depends_on: ["PX-PLAN-PL4N0000"],
119120 });
120121 assert.deepEqual(
121122 [...parsed.frontmatter.keys()],
122 ["id", "type", "title", "spec", "phase", "status", "review"],
123 [
124 "id",
125 "type",
126 "title",
127 "spec",
128 "phase",
129 "status",
130 "depends_on",
131 "review",
132 ],
123133 );
124134 });
270280 );
271281 });
283 it("validates dependency references and cycles", () => {
284 const indexed = indexBundleDocuments(
285 [
286 source(
287 "specs",
288 "PX-SPEC-SPEC0001",
289 "one",
290 "id: PX-SPEC-SPEC0001\ntype: spec\ntitle: One",
291 ),
292 source(
293 "specs",
294 "PX-SPEC-SPEC0002",
295 "two",
296 "id: PX-SPEC-SPEC0002\ntype: spec\ntitle: Two",
297 ),
298 source(
299 "phases",
300 "PX-PHASE-PHASE001",
301 "one",
302 "id: PX-PHASE-PHASE001\ntype: phase\ntitle: One\nspec: PX-SPEC-SPEC0001\nstatus: draft\ndepends_on: [PX-PHASE-PHASE002]",
303 ),
304 source(
305 "phases",
306 "PX-PHASE-PHASE002",
307 "two",
308 "id: PX-PHASE-PHASE002\ntype: phase\ntitle: Two\nspec: PX-SPEC-SPEC0001\nstatus: draft\ndepends_on: [PX-PHASE-PHASE001]",
309 ),
310 source(
311 "plans",
312 "PX-PLAN-PLAN0001",
313 "one",
314 "id: PX-PLAN-PLAN0001\ntype: plan\ntitle: One\nspec: PX-SPEC-SPEC0001\nstatus: draft\ndepends_on: [PX-PLAN-MISSING1]",
315 ),
316 source(
317 "plans",
318 "PX-PLAN-PLAN0002",
319 "two",
320 "id: PX-PLAN-PLAN0002\ntype: plan\ntitle: Two\nspec: PX-SPEC-SPEC0001\nstatus: draft\ndepends_on: [PX-PLAN-PLAN0003]",
321 ),
322 source(
323 "plans",
324 "PX-PLAN-PLAN0003",
325 "three",
326 "id: PX-PLAN-PLAN0003\ntype: plan\ntitle: Three\nspec: PX-SPEC-SPEC0002\nstatus: draft",
327 ),
328 ],
329 "PX",
330 );
331 assert.deepEqual(indexed.diagnostics.map((item) => item.code).sort(), [
332 "graph.dangling-reference",
333 "graph.dependency-cycle",
334 "graph.forbidden-edge",
335 ]);
336 });
273338 it("candidate validation reports only new candidate findings", () => {
274339 const findings = validateBundleCandidate(
275340 [

extensions/the-system/__tests__/the-system.test.ts

Modified

+43 / −1 text lines

7575 ".system/phases/PX-PHASE-PHASE001-delivery/index.md",
7676 "---\nid: PX-PHASE-PHASE001\ntype: phase\ntitle: Delivery\nspec: PX-SPEC-SPEC0001\nstatus: draft\n---\n\n# Delivery\n",
7777 );
78 write(
79 root,
80 ".system/phases/PX-PHASE-PHASE002-alpha/index.md",
81 "---\nid: PX-PHASE-PHASE002\ntype: phase\ntitle: Alpha\nspec: PX-SPEC-SPEC0001\nstatus: draft\ndepends_on: [PX-PHASE-PHASE001]\n---\n\n# Alpha\n",
82 );
83 write(
84 root,
85 ".system/plans/PX-PLAN-PLAN0001-build/index.md",
86 "---\nid: PX-PLAN-PLAN0001\ntype: plan\ntitle: Build\nspec: PX-SPEC-SPEC0001\nphase: PX-PHASE-PHASE001\nstatus: draft\n---\n\n# Build\n",
87 );
88 write(
89 root,
90 ".system/plans/PX-PLAN-PLAN0002-alpha/index.md",
91 "---\nid: PX-PLAN-PLAN0002\ntype: plan\ntitle: Alpha\nspec: PX-SPEC-SPEC0001\nphase: PX-PHASE-PHASE001\nstatus: draft\ndepends_on: [PX-PLAN-PLAN0001]\n---\n\n# Alpha\n",
92 );
7893};
8095afterEach(() => {
236251 );
237252 assert.match(view, /<summary>Metadata<\/summary>/);
238253 assert.match(view, /nested/);
239 assert.match(view, /On this page/);
254 assert.doesNotMatch(view, /On this page/);
240255 assert.match(view, /class="mermaid"/);
241256 assert.match(view, /mjx-container/);
242257 assert.match(view, /hljs/);
247262 assert.match(docs, /class="book-top"/);
248263 assert.match(docs, /class="book-nav"/);
249264 assert.match(docs, /class="mobile-nav"/);
265 assert.match(docs, /class="nav-utils"/);
266 assert.doesNotMatch(docs, /<aside class="book-toc"/);
250267 assert.match(docs, /id="search"/);
251268 assert.doesNotMatch(docs, /0 diagnostics/);
252269 assert.match(docs, /rel="icon"/);
256273 assert.match(docs, /CORE-SYSTEM/);
257274 assert.match(docs, /Reference graph/);
258275 assert.match(docs, /System reference graph/);
276 assert.match(docs, /href="#PX-SPEC-SPEC0001"/);
277 assert.doesNotMatch(
278 docs,
279 /href="file:[^"]*PX-SPEC-SPEC0001[^"]*index\.html"/,
280 );
281 assert.match(docs, /data-graph-svg/);
282 assert.match(docs, /data-graph-zoom="reset"/);
283 assert.match(docs, /pointerdown/);
284 assert.match(docs, /wheel/);
259285 assert.match(docs, /Backlinks/);
286 assert.match(docs, /Referenced by/);
287 assert.match(docs, /PX-PLAN-PLAN0001/);
288 assert.match(docs, /doc-related/);
260289 assert.match(docs, /#ededed/);
261290 assert.match(docs, /#121212/);
262291 assert.match(docs, /prefers-color-scheme:dark/);
263292 assert.match(docs, /PX-PHASE-PHASE001/);
293 assert.match(docs, /after PX-PHASE-PHASE001/);
294 assert.ok(
295 docs.indexOf('<section id="PX-SPEC-SPEC0001"') <
296 docs.indexOf('<section id="PX-PHASE-PHASE001"'),
297 );
298 assert.ok(
299 docs.indexOf('<section id="PX-PHASE-PHASE001"') <
300 docs.indexOf('<section id="PX-PHASE-PHASE002"'),
301 );
302 assert.ok(
303 docs.indexOf('<section id="PX-PLAN-PLAN0001"') <
304 docs.indexOf('<section id="PX-PLAN-PLAN0002"'),
305 );
264306 assert.match(docs, /spec/);
265307 assert.match(docs, /class="system-article"/);
266308 });

extensions/the-system/documents.ts

Modified

+80 / −2 text lines

103103 title: string;
104104 spec: string;
105105 status: "draft" | "done";
106 depends_on?: readonly string[];
106107}>;
107108export type PlanMetadata = Readonly<{
108109 id: string;
111112 spec: string;
112113 phase?: string;
113114 status: "draft" | "done";
115 depends_on?: readonly string[];
114116}>;
115117export type IssueMetadata = Readonly<{
116118 id: string;
428430 );
429431 return value;
430432 };
433 const dependencies = (expected: "phase" | "plan") => {
434 const values = optionalUniqueStrings(fields, "depends_on");
435 if (!values) return undefined;
436 for (const value of values) {
437 const parsed = parseDocumentId(value, prefix);
438 if (parsed.type !== expected)
439 throw new SystemDocumentError(
440 "metadata.reference-type",
441 `depends_on must reference ${expected}: ${value}`,
442 );
443 }
444 return values;
445 };
431446 switch (type) {
432447 case "research":
433448 return { id, type, title };
436451 if (research) for (const item of research) parseDocumentId(item, prefix);
437452 return research ? { id, type, title, research } : { id, type, title };
438453 }
439 case "phase":
454 case "phase": {
455 const depends_on = dependencies("phase");
440456 return {
441457 id,
442458 type,
447463 ["draft", "done"],
448464 "Phase status must be draft or done",
449465 ),
466 ...(depends_on ? { depends_on } : {}),
450467 };
468 }
451469 case "plan": {
452470 const phase = fields.get("phase");
471 const depends_on = dependencies("plan");
453472 if (phase !== undefined && typeof phase !== "string")
454473 throw new SystemDocumentError(
455474 "metadata.value",
467486 ["draft", "done"],
468487 "Plan status must be draft or done",
469488 ),
489 ...(depends_on ? { depends_on } : {}),
470490 };
471491 }
472492 case "issue":
632652 case "spec":
633653 return (metadata.research ?? []).map((id) => [id, "research"] as const);
634654 case "phase":
635 return [[metadata.spec, "spec"]];
655 return [
656 [metadata.spec, "spec"],
657 ...(metadata.depends_on ?? []).map((id) => [id, "phase"] as const),
658 ];
636659 case "plan":
637660 return [
638661 [metadata.spec, "spec"],
639662 ...(metadata.phase ? ([[metadata.phase, "phase"]] as const) : []),
663 ...(metadata.depends_on ?? []).map((id) => [id, "plan"] as const),
640664 ];
641665 case "issue":
642666 return metadata.specs.map((spec) => [spec, "spec"] as const);
644668 return [];
645669 }
646670};
672const dependencyReferences = (metadata: DocumentMetadata): readonly string[] =>
673 metadata.type === "phase" || metadata.type === "plan"
674 ? (metadata.depends_on ?? [])
675 : [];
647676const diagnosticIdentity = (item: Diagnostic) =>
648677 JSON.stringify([item.path, item.code, item.message]);
753782 ),
754783 );
755784 }
785 if (
786 document.metadata.type === "phase" ||
787 document.metadata.type === "plan"
788 ) {
789 for (const dependencyId of dependencyReferences(document.metadata)) {
790 const dependency = unique.get(dependencyId);
791 if (
792 dependency?.metadata.type === document.metadata.type &&
793 dependency.metadata.spec !== document.metadata.spec
794 )
795 diagnostics.push(
796 diagnostic(
797 "graph.forbidden-edge",
798 document.path,
799 `${dependencyId} belongs to ${dependency.metadata.spec}, not ${document.metadata.spec}`,
800 ),
801 );
802 }
803 }
756804 }
805 const visiting = new Set<string>();
806 const visited = new Set<string>();
807 const visit = (document: BundleDocumentRecord, stack: readonly string[]) => {
808 const id = document.metadata.id;
809 if (visited.has(id)) return;
810 if (visiting.has(id)) {
811 const start = stack.indexOf(id);
812 diagnostics.push(
813 diagnostic(
814 "graph.dependency-cycle",
815 document.path,
816 `Dependency cycle: ${[...stack.slice(start), id].join(" -> ")}`,
817 ),
818 );
819 return;
820 }
821 visiting.add(id);
822 for (const dependencyId of [
823 ...dependencyReferences(document.metadata),
824 ].sort()) {
825 const dependency = unique.get(dependencyId);
826 if (dependency?.metadata.type === document.metadata.type)
827 visit(dependency, [...stack, id]);
828 }
829 visiting.delete(id);
830 visited.add(id);
831 };
832 for (const document of graphEligible)
833 if (document.metadata.type === "phase" || document.metadata.type === "plan")
834 visit(document, []);
757835 return { documents, diagnostics: diagnostics.sort(compareDiagnostics) };

extensions/the-system/init.ts

Modified

+8 / −4 text lines

189189 }
190190 for (const core of inspection.cores) {
191191 if (core.state !== "missing") continue;
192 writeFileSync(target(inspection.root, core.path), CORE_CONTENT[core.path], {
193 encoding: "utf8",
194 flag: "wx",
195 });
192 writeFileSync(
193 target(inspection.root, core.path),
194 CORE_CONTENT[core.path as keyof typeof CORE_CONTENT],
195 {
196 encoding: "utf8",
197 flag: "wx",
198 },
199 );
196200 changed.push(core.path);
197201 }
198202 if (

extensions/the-system/package.json

Modified

+1 / −0 text lines

1212 "tasks"
1313 ],
1414 "dependencies": {
15 "@dagrejs/dagre": "^3.1.1",
1516 "github-slugger": "^2.0.0",
1617 "mermaid": "^11.16.0",
1718 "minisearch": "^7.2.0",

extensions/the-system/system-prompts.ts

Modified

+4 / −4 text lines

1515Required frontmatter:
1616- research: id, type: research, title
1717- spec: id, type: spec, title, optional research: string[]
18- phase: id, type: phase, title, spec, status: draft|done
19- plan: id, type: plan, title, spec, optional phase, status: draft|done
18- phase: id, type: phase, title, spec, status: draft|done, optional depends_on: phase ID[]
19- plan: id, type: plan, title, spec, optional phase, status: draft|done, optional depends_on: plan ID[]
2020- issue: id, type: issue, title, specs: string[], status: open|done
2222Research references no System stage type.
2323Specs may reference research.
24Phases reference one spec.
25Plans reference one spec and may reference one phase for the same spec.
24Phases reference one spec and may depend on earlier phases for the same spec.
25Plans reference one spec, may reference one phase for the same spec, and may depend on earlier plans for the same spec.
2626Issues may reference zero or more specs.
2727Done phases and plans are immutable; create a new artifact instead.
2828Keep prose terse, minimal, and essential.

extensions/the-system/system-renderer.ts

Modified

+236 / −84 text lines

1010import { tmpdir } from "node:os";
1111import path from "node:path";
1212import { fileURLToPath, pathToFileURL } from "node:url";
13import GithubSlugger from "github-slugger";
13import {
14 layout as dagreLayout,
15 type EdgeLabel,
16 Graph,
17 type GraphLabel,
18 type NodeLabel,
19 type Point,
20} from "@dagrejs/dagre";
1421import rehypeAutolinkHeadings from "rehype-autolink-headings";
1522import rehypeHighlight from "rehype-highlight";
1623import rehypeMathjax from "rehype-mathjax";
3037 type BundleDocumentRecord,
3138 type Diagnostic,
3239 type DocumentMetadata,
40 type DocumentType,
3341 parseSystemConfig,
3442} from "./documents.ts";
3543import type { FrontmatterMap, FrontmatterValue } from "./markdown.ts";
6775 children?: readonly MarkdownNode[];
6876}>;
6977type MarkdownRoot = MarkdownNode & Readonly<{ type: "root" }>;
70type MarkdownHeading = MarkdownNode &
71 Readonly<{ type: "heading"; depth: number }>;
7278type MarkdownText = MarkdownNode & Readonly<{ type: "text"; value: string }>;
7480const GROUPS = ["law", "spec", "phase", "plan", "issue", "research"] as const;
81const DOCUMENT_ORDER: readonly DocumentType[] = [
82 "spec",
83 "phase",
84 "plan",
85 "issue",
86 "research",
87];
7689const processor = unified()
7790 .use(remarkParse)
112125 path.join(directory, "index.html"),
113126 htmlPage(
114127 title,
115 bookBody(title, rendered, diagnostics),
128 bookBody(title, rendered, diagnostics, directory),
116129 "book",
117130 "assets/mermaid.min.js",
118131 "assets/minisearch.js",
151164 ...coreDocuments(input.root).map((document) =>
152165 renderCore(document, outputRoot),
153166 ),
154 ...input.documents.map((document) =>
167 ...orderedSystemDocuments(input.documents).map((document) =>
155168 renderDocument(input, document, outputRoot),
156169 ),
157170];
172const orderedSystemDocuments = (
173 documents: readonly RenderDocumentInput[],
174): readonly RenderDocumentInput[] =>
175 DOCUMENT_ORDER.flatMap((type) => {
176 const group = documents.filter(
177 (document) => document.metadata.type === type,
178 );
179 return type === "phase" || type === "plan"
180 ? topoDocuments(group)
181 : group.sort(compareDocuments);
182 });
184const compareDocuments = (
185 left: RenderDocumentInput,
186 right: RenderDocumentInput,
187) =>
188 left.metadata.title.localeCompare(right.metadata.title) ||
189 left.metadata.id.localeCompare(right.metadata.id);
191const topoDocuments = (
192 documents: readonly RenderDocumentInput[],
193): readonly RenderDocumentInput[] => {
194 const sorted = [...documents].sort(compareDocuments);
195 const byId = new Map(
196 sorted.map((document) => [document.metadata.id, document]),
197 );
198 const visiting = new Set<string>();
199 const visited = new Set<string>();
200 const result: RenderDocumentInput[] = [];
201 const visit = (document: RenderDocumentInput) => {
202 const id = document.metadata.id;
203 if (visited.has(id)) return;
204 if (visiting.has(id)) return;
205 visiting.add(id);
206 for (const dependencyId of [...dependencyIds(document.metadata)].sort()) {
207 const dependency = byId.get(dependencyId);
208 if (dependency) visit(dependency);
209 }
210 visiting.delete(id);
211 visited.add(id);
212 result.push(document);
213 };
214 for (const document of sorted) visit(document);
215 return result;
216};
159218const writePages = (
160219 outputRoot: string,
161220 documents: readonly RenderedDocument[],
273332 outputRoot: string;
274333 documents?: readonly RenderDocumentInput[];
275334}): string => {
276 const toc = tocHtml(input.markdown, input.id);
277335 const metadata = input.frontmatter
278336 ? metadataHtml(input.frontmatter, input.documents ?? [], input.outputRoot)
279337 : "";
338 const backlinks = input.documents
339 ? backlinksHtml(input.id, input.documents, input.outputRoot)
340 : "";
280341 const body = prefixHeadingAnchors(
281342 rewriteLocalRefs(
282343 rewriteMockupLinks(
287348 ),
288349 input.id,
289350 );
290 return `<article class="system-article" data-id="${esc(input.id)}"><header class="mast"><p class="eyebrow">${esc(input.type)} · <code>${esc(input.id)}</code></p><h1>${esc(input.title)}</h1><p class="source">${esc(input.sourcePath)}</p>${summaryHtml(input.metadata)}</header>${metadata}${toc}${body}</article>`;
351 return `<article class="system-article" data-id="${esc(input.id)}"><header class="mast"><p class="eyebrow">${esc(input.type)} · <code>${esc(input.id)}</code></p><h1>${esc(input.title)}</h1><p class="source">${esc(input.sourcePath)}</p>${summaryHtml(input.metadata)}</header>${metadata}${body}${backlinks}</article>`;
291352};
293354const summaryHtml = (metadata?: DocumentMetadata): string => {
294355 if (!metadata) return "";
295 const refs = refsFor(metadata);
296 return `<p class="summary">${esc(metadata.type)}${"status" in metadata ? ` · ${esc(metadata.status)}` : ""}${refs.length ? ` · refs ${refs.map(esc).join(", ")}` : ""}</p>`;
356 const dependencies = dependencyIds(metadata);
357 const refs = refsFor(metadata).filter((id) => !dependencies.includes(id));
358 return `<p class="summary">${esc(metadata.type)}${"status" in metadata ? ` · ${esc(metadata.status)}` : ""}${refs.length ? ` · refs ${refs.map(esc).join(", ")}` : ""}${dependencies.length ? ` · after ${dependencies.map(esc).join(", ")}` : ""}</p>`;
359};
361const backlinksHtml = (
362 id: string,
363 documents: readonly RenderDocumentInput[],
364 outputRoot: string,
365): string => {
366 const backlinks = documents
367 .filter(
368 (document) =>
369 document.metadata.id !== id && refsFor(document.metadata).includes(id),
370 )
371 .sort(compareDocuments);
372 if (!backlinks.length) return "";
373 return `<details class="doc-related"><summary>Referenced by</summary>${backlinks
374 .map(
375 (document) =>
376 `<a href="${pathToFileURL(path.join(outputRoot, document.path.replace(/index\.md$/, "index.html"))).href}"><span>${esc(document.metadata.type)}</span>${esc(document.metadata.title)}<code>${esc(document.metadata.id)}</code></a>`,
377 )
378 .join("")}</details>`;
297379};
299381const metadataHtml = (
339421 return `<a href="${pathToFileURL(path.join(outputRoot, target.path.replace(/index\.md$/, "index.html"))).href}">${esc(value)}</a>`;
340422};
342const tocHtml = (markdown: string, prefix: string): string => {
343 const tree = unified()
344 .use(remarkParse)
345 .parse(stripFrontmatter(markdown)) as MarkdownRoot;
346 const slugger = new GithubSlugger();
347 const headings: Array<{ depth: number; text: string; id: string }> = [];
348 visit(tree, "heading", (node: MarkdownHeading) => {
349 const text = headingText(node);
350 if (text)
351 headings.push({
352 depth: node.depth,
353 text,
354 id: `${prefix}-${slugger.slug(text)}`,
355 });
356 });
357 if (!headings.length) return "";
358 return `<details class="toc"><summary>On this page</summary><ol>${headings
359 .map(
360 (item) =>
361 `<li class="depth-${item.depth}"><a href="#${esc(item.id)}">${esc(item.text)}</a></li>`,
362 )
363 .join("")}</ol></details>`;
364};
366const headingText = (node: MarkdownHeading): string => {
367 let value = "";
368 visit(node, "text", (text: MarkdownText) => {
369 value += text.value;
370 });
371 return value.trim();
372};
374424const refsFor = (metadata: DocumentMetadata): readonly string[] => {
375425 switch (metadata.type) {
376426 case "spec":
377427 return metadata.research ?? [];
378428 case "phase":
379 return [metadata.spec];
429 return [metadata.spec, ...dependencyIds(metadata)];
380430 case "plan":
381 return [metadata.spec, ...(metadata.phase ? [metadata.phase] : [])];
431 return [
432 metadata.spec,
433 ...(metadata.phase ? [metadata.phase] : []),
434 ...dependencyIds(metadata),
435 ];
382436 case "issue":
383437 return metadata.specs;
384438 default:
386440 }
387441};
443const dependencyIds = (metadata: DocumentMetadata): readonly string[] =>
444 metadata.type === "phase" || metadata.type === "plan"
445 ? (metadata.depends_on ?? [])
446 : [];
389448const stripFrontmatter = (markdown: string) =>
390449 markdown.replace(/^---\n[\s\S]*?\n---\n?/, "");
471530 title: string,
472531 documents: readonly RenderedDocument[],
473532 diagnostics: readonly Diagnostic[],
533 outputRoot: string,
474534): string => {
475 const nav = bookNav(documents);
476535 const diagnosticNav = diagnostics.length
477536 ? '<a href="#diagnostics">Diagnostics</a>'
478537 : "";
538 const utilities = `<div class="nav-utils"><a href="#book-overview">Top</a><a href="#reference-graph">Reference graph</a>${diagnosticNav}</div>`;
539 const nav = bookNav(documents, utilities);
479540 const diagnosticPanel = diagnostics.length
480541 ? `<section>${diagnosticsHtml(diagnostics, documents)}</section>`
481542 : "";
482543 const diagnosticStat = diagnostics.length
483544 ? `<p class="stats"><span class="bad">${diagnostics.length} diagnostics</span></p>`
484545 : "";
485 return `<header class="book-top" id="book-overview"><a class="brand" href="#book-overview">${esc(title)}</a><label class="book-search"><span>Search</span><span class="search-row"><input id="search" type="search" autocomplete="off"><button type="button" id="search-button">Search</button></span><ol id="results" class="search-results" aria-live="polite"></ol></label>${diagnosticStat}</header><div class="book-shell"><nav class="mobile-nav"><details open><summary>Book navigation</summary>${nav}</details><details><summary>On this page</summary><a href="#book-overview">Overview</a><a href="#reference-graph">Reference graph</a>${diagnosticNav}</details></nav><aside class="book-nav">${nav}</aside><main class="book-main"><section class="book-head"><h1>${esc(title)}</h1><div class="overview-grid"><section>${graphHtml(documents)}</section>${diagnosticPanel}</div></section>${documents
546 return `<header class="book-top" id="book-overview"><a class="brand" href="#book-overview">${esc(title)}</a><label class="book-search"><span>Search</span><span class="search-row"><input id="search" type="search" autocomplete="off"><button type="button" id="search-button">Search</button></span><ol id="results" class="search-results" aria-live="polite"></ol></label>${diagnosticStat}</header><div class="book-shell"><nav class="mobile-nav"><details><summary>Book navigation</summary>${nav}</details></nav><aside class="book-nav">${nav}</aside><main class="book-main"><section class="book-head"><h1>${esc(title)}</h1><div class="overview-grid"><section>${graphHtml(documents)}</section>${diagnosticPanel}</div></section>${documents
486547 .map(
487548 (document) =>
488 `<section id="${esc(document.id)}" class="book-section">${document.article}</section>`,
549 `<section id="${esc(document.id)}" class="book-section">${bookArticle(document.article, documents, outputRoot)}</section>`,
489550 )
490551 .join(
491552 "\n",
492 )}</main><aside class="book-toc"><h2>On this page</h2><a href="#book-overview">Overview</a><a href="#reference-graph">Reference graph</a>${diagnosticNav}</aside></div><script type="application/json" id="search-data">${jsonScript(documents.map(({ id, title, type, text }) => ({ id, title, type, text, href: `#${id}` })))}</script><script>${searchScript()}</script>`;
553 )}</main></div><script type="application/json" id="search-data">${jsonScript(documents.map(({ id, title, type, text }) => ({ id, title, type, text, href: `#${id}` })))}</script><script>${searchScript()}${graphScript()}</script>`;
493554};
495const bookNav = (documents: readonly RenderedDocument[]): string => {
556const bookArticle = (
557 article: string,
558 documents: readonly RenderedDocument[],
559 outputRoot: string,
560): string => {
561 let result = article;
562 for (const document of documents) {
563 const href = pathToFileURL(path.join(outputRoot, document.outputPath)).href;
564 result = result.replaceAll(`href="${href}"`, `href="#${esc(document.id)}"`);
565 }
566 return result;
567};
569const bookNav = (
570 documents: readonly RenderedDocument[],
571 utilities: string,
572): string => {
496573 const byType = new Map(
497574 GROUPS.map((group) => [group, [] as RenderedDocument[]]),
498575 );
499576 for (const document of documents)
500577 byType.get(document.type as (typeof GROUPS)[number])?.push(document);
501 return GROUPS.map((group) => {
578 return `${utilities}${GROUPS.map((group) => {
502579 const items = byType.get(group) ?? [];
503580 if (!items.length) return "";
504581 return `<details ${group === "law" || group === "spec" ? "open" : ""}><summary>${GROUP_LABELS[group]} <span class="count">${items.length}</span></summary>${items
505582 .map((item) => navItem(item))
506583 .join("")}</details>`;
507 }).join("");
584 }).join("")}`;
508585};
510587const navItem = (item: RenderedDocument): string => {
516593 const byId = new Map(documents.map((document) => [document.id, document]));
517594 const linked = documents.filter((document) => {
518595 const backlinks = documents.some((candidate) =>
519 candidate.refs.includes(document.id),
596 graphRefsForNode(candidate).includes(document.id),
520597 );
521 return document.refs.some((id) => byId.has(id)) || backlinks;
598 return graphRefsForNode(document).some((id) => byId.has(id)) || backlinks;
522599 });
523600 if (!linked.length)
524601 return `<section id="reference-graph" class="graph"><h3>Reference graph</h3><p>No references yet.</p></section>`;
525 const nodes = linked.slice(0, 24);
526 const columns = new Map(GROUPS.map((group, index) => [group, index]));
527 const rowByType = new Map<string, number>();
528 const positions = new Map(
529 nodes.map((document) => {
530 const type = document.type as (typeof GROUPS)[number];
531 const row = rowByType.get(type) ?? 0;
532 rowByType.set(type, row + 1);
533 return [
534 document.id,
535 { x: 24 + (columns.get(type) ?? 0) * 180, y: 28 + row * 64 },
536 ] as const;
537 }),
538 );
539 const height = Math.max(180, Math.max(...rowByType.values()) * 64 + 50);
540 const lines = nodes.flatMap((document) => {
541 const from = positions.get(document.id);
542 if (!from) return [];
543 return document.refs.flatMap((id) => {
544 const to = positions.get(id);
545 if (!to) return [];
546 return `<line x1="${from.x + 152}" y1="${from.y + 20}" x2="${to.x}" y2="${to.y + 20}"></line>`;
547 });
548 });
549 const boxes = nodes
602 const layout = layoutGraph(linked);
603 const paths = layout.edges
604 .map((edge) => {
605 if (edge.points.length === 0) return "";
606 const [first, ...rest] = edge.points;
607 return `<path d="M${first.x} ${first.y}${rest.map((point) => ` L${point.x} ${point.y}`).join("")}"></path>`;
608 })
609 .join("");
610 const boxes = layout.nodes
550611 .map((document) => {
551 const position = positions.get(document.id);
612 const position = layout.positions.get(document.id);
552613 if (!position) return "";
553 return `<a href="#${esc(document.id)}"><title>${esc(document.id)} ${esc(document.title)}</title><rect x="${position.x}" y="${position.y}" width="152" height="40" rx="2"></rect><text x="${position.x + 8}" y="${position.y + 24}">${esc(shortLabel(document))}</text></a>`;
614 const size = graphNodeSize(document);
615 return `<a href="#${esc(document.id)}"><title>${esc(document.id)} ${esc(document.title)}</title><rect x="${position.x}" y="${position.y}" width="${size.width}" height="${size.height}" rx="2"></rect><text x="${position.x + 8}" y="${position.y + 18}">${esc(shortLabel(document))}</text><text class="graph-node-type" x="${position.x + 8}" y="${position.y + 34}">${esc(document.type)}</text></a>`;
554616 })
555617 .join("");
556618 const rows = linked.map((document) => {
557619 const backlinks = documents
558 .filter((candidate) => candidate.refs.includes(document.id))
620 .filter((candidate) => graphRefsForNode(candidate).includes(document.id))
559621 .map((candidate) => candidate.id);
560 return `<li><a href="#${esc(document.id)}">${esc(document.id)}</a><br>References: ${document.refs.map((id) => graphLink(id, byId)).join(", ") || "none"}<br>Backlinks: ${backlinks.map((id) => graphLink(id, byId)).join(", ") || "none"}</li>`;
622 const graphRefs = graphRefsForNode(document);
623 return `<li><a href="#${esc(document.id)}">${esc(document.id)}</a><br>References: ${graphRefs.map((id) => graphLink(id, byId)).join(", ") || "none"}<br>Backlinks: ${backlinks.map((id) => graphLink(id, byId)).join(", ") || "none"}</li>`;
561624 });
562 return `<section id="reference-graph" class="graph"><h3>Reference graph</h3><svg viewBox="0 0 1100 ${height}" role="img" aria-label="System reference graph">${lines.join("")}${boxes}</svg><ol class="graph-list">${rows.join("")}</ol></section>`;
625 return `<section id="reference-graph" class="graph"><div class="graph-head"><h3>Reference graph</h3><div class="graph-controls" aria-label="Graph controls"><button type="button" data-graph-zoom="in">+</button><button type="button" data-graph-zoom="out">−</button><button type="button" data-graph-zoom="reset">Reset</button></div></div><div class="graph-frame"><svg data-graph-svg data-world-width="${layout.width}" data-world-height="${layout.height}" viewBox="0 0 ${Math.min(layout.width, 1100)} ${Math.min(layout.height, 520)}" preserveAspectRatio="xMinYMin meet" role="img" aria-label="System reference graph">${paths}${boxes}</svg></div><details class="graph-list"><summary>Text graph</summary><ol>${rows.join("")}</ol></details></section>`;
626};
628const NODE_WIDTH = 168;
629const NODE_HEIGHT = 44;
630const GRAPH_PAD = 36;
631const GRAPH_X_GAP = 112;
632const GRAPH_Y_GAP = 30;
634type GraphLayoutEdge = Readonly<{
635 from: string;
636 to: string;
637 points: readonly Point[];
638}>;
639type GraphPoint = Readonly<{ x: number; y: number }>;
640type GraphLayout = Readonly<{
641 nodes: readonly RenderedDocument[];
642 edges: readonly GraphLayoutEdge[];
643 positions: ReadonlyMap<string, GraphPoint>;
644 width: number;
645 height: number;
646}>;
648const layoutGraph = (nodes: readonly RenderedDocument[]): GraphLayout => {
649 const byId = new Map(nodes.map((node) => [node.id, node]));
650 const graph = new Graph<GraphLabel, NodeLabel, EdgeLabel>();
651 graph.setGraph({
652 rankdir: "LR",
653 acyclicer: "greedy",
654 ranker: "network-simplex",
655 align: "UL",
656 marginx: GRAPH_PAD,
657 marginy: GRAPH_PAD,
658 nodesep: GRAPH_Y_GAP,
659 ranksep: GRAPH_X_GAP,
660 edgesep: 12,
661 });
662 graph.setDefaultEdgeLabel(() => ({}));
663 for (const node of nodes) graph.setNode(node.id, graphNodeSize(node));
664 for (const node of nodes)
665 for (const ref of graphRefsForNode(node))
666 if (byId.has(ref))
667 graph.setEdge(ref, node.id, {
668 weight: nodeDependencyIds(node).includes(ref) ? 3 : 1,
669 });
670 dagreLayout(graph);
671 const positions = new Map<string, GraphPoint>();
672 for (const id of graph.nodes()) {
673 const node = graph.node(id);
674 positions.set(id, {
675 x: (node.x ?? 0) - node.width / 2,
676 y: (node.y ?? 0) - node.height / 2,
677 });
678 }
679 const edges = graph.edges().map((edge) => ({
680 from: edge.v,
681 to: edge.w,
682 points: graph.edge(edge).points ?? [],
683 }));
684 const label = graph.graph();
685 return {
686 nodes,
687 edges,
688 positions,
689 width: Math.max(260, label.width ?? 0),
690 height: Math.max(220, label.height ?? 0),
691 };
692};
694const graphNodeSize = (node: RenderedDocument) => ({
695 width: node.type === "law" ? 130 : NODE_WIDTH,
696 height: NODE_HEIGHT,
697});
699const nodeDependencyIds = (node: RenderedDocument): readonly string[] =>
700 node.type === "phase" || node.type === "plan"
701 ? node.refs.filter((id) => id.includes(`-${node.type.toUpperCase()}-`))
702 : [];
704const graphRefsForNode = (node: RenderedDocument): readonly string[] => {
705 const dependencies = nodeDependencyIds(node);
706 if (dependencies.length) return dependencies;
707 if (node.type === "plan") {
708 const phase = node.refs.find((id) => id.includes("-PHASE-"));
709 return phase ? [phase] : node.refs;
710 }
711 return node.refs;
563712};
565714const shortLabel = (document: RenderedDocument) => {
694843const css = () => String.raw`
695844:root{color-scheme:light dark;--bg:#ededed;--panel:#dbdbdb;--page:#ededed;--text:#121212;--muted:#3b3b3b;--line:#5d5d5d;--accent:#922792;--link:#184e5b;--warn:#6e6c10;--error:#bd172e;--info:#116477;--code:#dbdbdb;--mark:#6e6c10}
696845@media(prefers-color-scheme:dark){:root{--bg:#121212;--panel:#242424;--page:#121212;--text:#ededed;--muted:#8b8b8b;--line:#6f6f6f;--accent:#d86dd8;--link:#7ba1aa;--warn:#f0ee69;--error:#ec6376;--info:#3ec5e3;--code:#242424;--mark:#f0ee69}}
697body[data-mode=book]{overflow-x:hidden}
698*{box-sizing:border-box}html{scroll-behavior:smooth}body{font-family:system-ui,sans-serif;line-height:1.55;margin:0;color:var(--text);background:var(--bg)}body[data-mode=single]{max-width:78rem;margin:2rem auto;padding:0 1rem}a{color:var(--link)}a:focus-visible,button:focus-visible,input:focus-visible,summary:focus-visible{outline:3px solid var(--accent);outline-offset:2px}button,input{font:inherit}button{cursor:pointer}.brand{font:900 12px ui-monospace,monospace;color:var(--accent);letter-spacing:.1em;text-transform:uppercase;text-decoration:none;align-self:end;padding-bottom:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.book-top{position:sticky;top:0;z-index:5;display:grid;grid-template-columns:minmax(180px,220px) minmax(260px,1fr) max-content;gap:14px;align-items:end;background:var(--panel);border-bottom:2px solid var(--line);padding:10px 26px}.book-search{position:relative;display:grid;gap:4px;font:800 11px ui-monospace,monospace;color:var(--muted);text-transform:uppercase}.search-row{display:flex;gap:8px}.search-row input{width:100%;min-width:0;background:var(--bg);color:var(--text);border:2px solid var(--line);padding:8px;text-transform:none}.search-row button{background:var(--accent);color:var(--bg);border:0;padding:8px 12px;font-weight:900}.search-results{position:absolute;left:0;right:0;top:100%;z-index:8;display:grid;gap:6px;margin:6px 0 0;padding:0;list-style:none;background:var(--bg);border:2px solid var(--line);box-shadow:0 10px 24px color-mix(in srgb,var(--text),transparent 86%)}.search-results:empty{display:none}.search-results li{border-left:4px solid var(--accent);padding:7px 9px;background:var(--panel);text-transform:none}.search-results small{color:var(--muted)}mark{background:color-mix(in srgb,var(--mark),transparent 35%);color:var(--text);padding:0 .1em}.stats{display:flex;gap:8px;margin:0 0 10px;justify-content:end;font-variant-numeric:tabular-nums}.stats span{border:1px solid var(--line);background:var(--bg);padding:4px 7px;white-space:nowrap}.stats .bad{border-color:var(--error);color:var(--error)}.stats .ok{border-color:var(--info);color:var(--info)}.book-shell{display:grid;grid-template-columns:220px minmax(0,1fr) 160px;gap:16px;padding:16px 26px;align-items:start}.book-shell>*{min-width:0}.book-nav,.book-toc,.book-head,.system-article,.doc-move,.diagnostics,.graph{background:var(--panel);border:1px solid var(--line)}.book-nav{padding:10px;position:sticky;top:64px;height:calc(100vh - 88px);overflow:auto}.book-nav details{border-bottom:1px solid var(--line);padding:7px 0}.book-nav summary{font:900 11px ui-monospace,monospace;text-transform:uppercase;color:var(--muted);cursor:pointer}.book-nav a{display:block;text-decoration:none;padding:4px 6px 4px 12px;border-left:3px solid transparent;overflow-wrap:anywhere}.book-nav a:hover{border-color:var(--accent);background:color-mix(in srgb,var(--accent),transparent 88%)}.count{float:right;color:var(--muted);font-weight:400}.book-main{display:grid;gap:16px;min-width:0}.book-head{padding:18px;overflow:hidden}.book-head h1{margin:0;font:900 32px/1.05 Georgia,serif}.book-head p{color:var(--muted)}.overview-grid{display:grid;grid-template-columns:1fr;gap:12px}.overview-grid>section,.overview-grid aside{min-width:0}.book-toc{padding:12px;max-height:calc(100vh - 104px);overflow:auto;position:sticky;top:88px;font-size:13px;z-index:1}.book-toc h2{margin-top:0;color:var(--accent);font:800 12px ui-monospace,monospace;text-transform:uppercase}.book-toc a{display:block;color:var(--muted);margin:6px 0;text-decoration:none}.mobile-nav{display:none}.book-section{scroll-margin-top:72px}.system-article{display:block;padding:28px 40px;background:var(--page);margin-block:0;overflow:hidden}.system-article+.diagnostics{margin-top:1rem}.mast h1{font:800 34px/1.1 Georgia,serif;margin:.2rem 0 1rem}.eyebrow,.source,.summary{color:var(--muted)}.eyebrow{font:800 11px ui-monospace,monospace;text-transform:uppercase}.source{overflow-wrap:anywhere}.doc-move{display:flex;justify-content:space-between;gap:1rem;margin:1rem 0;padding:1rem}.ledger,.toc{border:1px solid var(--line);background:var(--panel);padding:.7rem;margin:1rem 0}.toc ol{margin:.5rem 0}.depth-3{margin-left:1rem}.depth-4,.depth-5,.depth-6{margin-left:2rem}code,pre{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}pre{padding:1rem;overflow:auto;background:var(--code);border:1px solid var(--line)}table{border-collapse:collapse;width:100%;margin:.5rem 0;display:block;overflow:auto}th,td{border:1px solid var(--line);padding:.35rem;text-align:left;vertical-align:top}.ledger ol{margin:0}.diagnostics{border-color:var(--warn);padding:1rem}.diagnostics h2{margin-top:0}.diagnostics strong{color:var(--warn)}.diagnostics.ok{border-color:var(--info)}.diagnostics li{margin:.4rem 0}.graph{padding:1rem;overflow:hidden}.graph h3{margin-top:0}.graph svg{display:block;width:100%;height:auto;max-height:520px;border:1px solid var(--line);background:var(--panel)}.graph line{stroke:var(--line);stroke-width:2}.graph a rect{fill:var(--bg);stroke:var(--accent);stroke-width:2}.graph a:hover rect{fill:color-mix(in srgb,var(--accent),transparent 86%)}.graph text{fill:var(--text);font:700 11px ui-monospace,monospace}.graph-list{display:none}.mockup-preview iframe{width:100%;min-height:22rem;border:1px solid var(--line);background:white}.hljs{background:transparent}.math{overflow:auto}@media(max-width:980px){.book-top{grid-template-columns:1fr;position:static}.search-results{position:static}.stats{justify-content:start;flex-wrap:wrap}.book-shell{display:block;padding:10px}.book-nav,.book-toc{display:none}.mobile-nav{display:grid;gap:8px;margin-bottom:10px}.mobile-nav details{background:var(--panel);border:1px solid var(--line);padding:8px}.mobile-nav .book-nav{display:block;position:static;height:auto;border:0;padding:0}.overview-grid{grid-template-columns:1fr}.system-article{padding:20px 18px}.mast h1{font-size:28px}.doc-move{flex-wrap:wrap}}@media(max-width:620px){body{font-size:15px}.book-top{padding:10px}.search-row{display:grid}.search-row button{width:100%}.book-shell{padding:8px}.book-head{padding:14px}.system-article{padding:18px 14px;border-left:0;border-right:0}.stats span{font-size:12px}.graph svg{display:none}.graph-list{display:block}}@media print{.book-top,.book-nav,.book-toc,.book-head,.doc-move,.mobile-nav{display:none}.book-shell{display:block;padding:0}.system-article{border:0;background:white;color:black;max-width:none;padding:0;font:12pt/1.55 Georgia,serif}.mast h1{break-before:page}.diagnostics{break-inside:avoid;border-color:#777;background:#eee}mark{background:#ddd}}
846body[data-mode=book]{overflow-x:hidden;--book-gutter:26px;--book-nav-width:15rem;--book-top-height:76px}
847*{box-sizing:border-box}html{scroll-behavior:smooth;max-width:100%;overflow-x:hidden}body{font-family:system-ui,sans-serif;line-height:1.55;margin:0;color:var(--text);background:var(--bg);max-width:100%;overflow-x:hidden}body[data-mode=single]{max-width:78rem;margin:2rem auto;padding:0 1rem}a{color:var(--link)}a:focus-visible,button:focus-visible,input:focus-visible,summary:focus-visible{outline:3px solid var(--accent);outline-offset:2px}button,input{font:inherit}button{cursor:pointer}.brand{font:900 12px ui-monospace,monospace;color:var(--accent);letter-spacing:.1em;text-transform:uppercase;text-decoration:none;align-self:end;padding-bottom:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.book-top{position:fixed;top:0;left:0;right:0;z-index:5;display:grid;grid-template-columns:var(--book-nav-width) minmax(0,1fr) max-content;gap:16px;align-items:end;height:var(--book-top-height);background:var(--panel);border-bottom:2px solid var(--line);padding:10px var(--book-gutter);overflow:hidden}.book-search{position:relative;display:grid;gap:4px;font:800 11px ui-monospace,monospace;color:var(--muted);text-transform:uppercase}.search-row{display:flex;gap:8px}.search-row input{width:100%;min-width:0;background:var(--bg);color:var(--text);border:2px solid var(--line);padding:8px;text-transform:none}.search-row button{background:var(--accent);color:var(--bg);border:0;padding:8px 12px;font-weight:900}.search-results{position:absolute;left:0;right:0;top:100%;z-index:8;display:grid;gap:6px;margin:6px 0 0;padding:0;list-style:none;background:var(--bg);border:2px solid var(--line);box-shadow:0 10px 24px color-mix(in srgb,var(--text),transparent 86%)}.search-results:empty{display:none}.search-results li{border-left:4px solid var(--accent);padding:7px 9px;background:var(--panel);text-transform:none}.search-results small{color:var(--muted)}mark{background:color-mix(in srgb,var(--mark),transparent 35%);color:var(--text);padding:0 .1em}.stats{display:flex;gap:8px;margin:0 0 10px;justify-content:end;font-variant-numeric:tabular-nums}.stats span{border:1px solid var(--line);background:var(--bg);padding:4px 7px;white-space:nowrap}.stats .bad{border-color:var(--error);color:var(--error)}.stats .ok{border-color:var(--info);color:var(--info)}.book-shell{display:block;width:100%;max-width:100vw;padding:var(--book-top-height) var(--book-gutter) 16px calc(var(--book-gutter) + var(--book-nav-width) + 16px)}.book-shell>*{min-width:0}.book-nav,.book-toc,.book-head,.system-article,.doc-move,.diagnostics,.graph{background:var(--panel);border:1px solid var(--line)}.book-nav{position:fixed;left:var(--book-gutter);top:var(--book-top-height);bottom:0;width:var(--book-nav-width);z-index:4;padding:10px;overflow:auto;border-top:0}.book-nav details{border-bottom:1px solid var(--line);padding:7px 0}.book-nav summary{font:900 11px ui-monospace,monospace;text-transform:uppercase;color:var(--muted);cursor:pointer}.book-nav a{display:block;text-decoration:none;padding:4px 6px 4px 12px;border-left:3px solid transparent;overflow-wrap:anywhere}.nav-utils{border-bottom:1px solid var(--line);margin-bottom:7px;padding-bottom:7px}.nav-utils a{font:800 11px ui-monospace,monospace;text-transform:uppercase;color:var(--muted)}.book-nav a:hover{border-color:var(--accent);background:color-mix(in srgb,var(--accent),transparent 88%)}.count{float:right;color:var(--muted);font-weight:400}.book-main{display:grid;gap:16px;min-width:0;max-width:100%;overflow:hidden}.book-head{padding:18px;overflow:hidden}.book-head h1{margin:0;font:900 clamp(26px,4vw,32px)/1.05 Georgia,serif;overflow-wrap:anywhere}.book-head p{color:var(--muted)}.overview-grid{display:grid;grid-template-columns:1fr;gap:12px}.overview-grid>section,.overview-grid aside{min-width:0}.book-toc{padding:12px;max-height:calc(100vh - 104px);overflow:auto;position:sticky;top:88px;font-size:13px;z-index:1}.book-toc h2{margin-top:0;color:var(--accent);font:800 12px ui-monospace,monospace;text-transform:uppercase}.book-toc a{display:block;color:var(--muted);margin:6px 0;text-decoration:none}.mobile-nav{display:none}.book-section{scroll-margin-top:72px}.system-article{display:block;min-width:0;max-width:100%;padding:28px 40px;background:var(--page);margin-block:0;overflow:hidden}.system-article+.diagnostics{margin-top:1rem}.mast h1{font:800 clamp(24px,4vw,34px)/1.1 Georgia,serif;margin:.2rem 0 1rem;overflow-wrap:anywhere}.eyebrow,.source,.summary{color:var(--muted)}.eyebrow{font:800 11px ui-monospace,monospace;text-transform:uppercase}.source{overflow-wrap:anywhere}.doc-move{display:flex;justify-content:space-between;gap:1rem;margin:1rem 0;padding:1rem}.ledger,.toc{border:1px solid var(--line);background:var(--panel);padding:.7rem;margin:1rem 0}.doc-related{clear:both;margin:1rem 0;padding:.8rem;background:var(--panel);border-left:4px solid var(--accent)}.doc-related summary{color:var(--accent);font:900 12px ui-monospace,monospace;text-transform:uppercase;cursor:pointer}.doc-related a{display:grid;gap:.1rem;padding:.45rem 0;border-top:1px solid var(--line);text-decoration:none}.doc-related span{color:var(--muted);font:800 10px ui-monospace,monospace;text-transform:uppercase}.doc-related code{font-size:11px;color:var(--muted)}.toc ol{margin:.5rem 0}.depth-3{margin-left:1rem}.depth-4,.depth-5,.depth-6{margin-left:2rem}code,pre{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}pre{padding:1rem;overflow:auto;background:var(--code);border:1px solid var(--line)}table{border-collapse:collapse;width:100%;margin:.5rem 0;display:block;overflow:auto}th,td{border:1px solid var(--line);padding:.35rem;text-align:left;vertical-align:top}.ledger ol{margin:0}.diagnostics{border-color:var(--warn);padding:1rem}.diagnostics h2{margin-top:0}.diagnostics strong{color:var(--warn)}.diagnostics.ok{border-color:var(--info)}.diagnostics li{margin:.4rem 0}.graph{padding:1rem;overflow:hidden}.graph-head{display:grid;grid-template-columns:1fr auto;gap:.5rem;align-items:start}.graph h3{margin:0}.graph-head p{margin:.2rem 0 0;color:var(--muted)}.graph-controls{display:flex;gap:.35rem}.graph-controls button{background:var(--bg);color:var(--text);border:1px solid var(--line);padding:.35rem .55rem;font-weight:900}.graph-frame{height:min(62vh,520px);min-height:18rem;border:1px solid var(--line);background:var(--panel);overflow:hidden;touch-action:none;cursor:grab}.graph-frame:active{cursor:grabbing}.graph svg{display:block;width:100%;height:100%;touch-action:none}.graph path{fill:none;stroke:var(--line);stroke-width:1.6;stroke-opacity:.72}.graph a rect{fill:var(--bg);stroke:var(--accent);stroke-width:2}.graph a:hover rect{fill:color-mix(in srgb,var(--accent),transparent 86%)}.graph text{fill:var(--text);font:700 11px ui-monospace,monospace}.graph-node-type{fill:var(--muted);font:800 10px ui-monospace,monospace;text-transform:uppercase}.graph-list{margin-top:.7rem}.graph-list ol{max-height:16rem;overflow:auto}.mockup-preview iframe{width:100%;min-height:22rem;border:1px solid var(--line);background:white}.hljs{background:transparent}.math{overflow:auto}@media(max-width:1200px){.book-toc{display:none}}@media(max-width:980px){.book-top{grid-template-columns:1fr;position:static;height:auto}.search-results{position:static}.stats{justify-content:start;flex-wrap:wrap}.book-shell{display:block;padding:10px}.book-nav,.book-toc{display:none}.mobile-nav{display:grid;gap:8px;margin-bottom:10px}.mobile-nav details{background:var(--panel);border:1px solid var(--line);padding:8px}.mobile-nav a{display:block;margin:.35rem 0;overflow-wrap:anywhere}.mobile-nav .book-nav{display:block;position:static;height:auto;border:0;padding:0}.overview-grid{grid-template-columns:1fr}.system-article{padding:20px 18px}.mast h1{font-size:clamp(24px,8vw,28px)}.doc-move{flex-wrap:wrap}.doc-related{margin:1rem 0}}@media(max-width:620px){body{font-size:15px}.book-top{padding:10px}.brand{white-space:normal}.book-head h1{font-size:clamp(28px,10vw,38px)}.search-row{display:grid}.search-row button{width:100%}.book-shell{padding:8px}.book-head{padding:14px}.system-article{padding:18px 14px;border-left:0;border-right:0}.stats span{font-size:12px}.graph-head{grid-template-columns:1fr}.graph-controls button{flex:1}.graph-frame{height:12rem}.graph-list{display:block}}@media print{.book-top,.book-nav,.book-toc,.book-head,.doc-move,.mobile-nav{display:none}.book-shell{display:block;padding:0}.system-article{border:0;background:white;color:black;max-width:none;padding:0;font:12pt/1.55 Georgia,serif}.mast h1{break-before:page}.diagnostics{break-inside:avoid;border-color:#777;background:#eee}mark{background:#ddd}}
699848`;
701850const jsonScript = (value: unknown) =>
702851 JSON.stringify(value).replaceAll("<", "\\u003c").replaceAll("&", "\\u0026");
853const graphScript = () =>
854 `for(const svg of document.querySelectorAll('[data-graph-svg]')){const world={w:Number(svg.dataset.worldWidth),h:Number(svg.dataset.worldHeight)};let vb=box();if(svg.clientWidth<700)vb={x:0,y:0,w:Math.min(world.w,1100),h:Math.min(world.h,520)};const initial={...vb};set(vb);const pointers=new Map;let drag=null,pinch=null;function box(){const [x,y,w,h]=svg.getAttribute('viewBox').split(/\\s+/).map(Number);return{x,y,w,h}}function set(next){const w=Math.min(Math.max(next.w,180),world.w);const h=Math.min(Math.max(next.h,120),world.h);vb={w,h,x:Math.min(Math.max(next.x,0),Math.max(0,world.w-w)),y:Math.min(Math.max(next.y,0),Math.max(0,world.h-h))};svg.setAttribute('viewBox',[vb.x,vb.y,vb.w,vb.h].join(' '))}function point(e,b=vb){const r=svg.getBoundingClientRect();return{x:b.x+(e.clientX-r.left)/r.width*b.w,y:b.y+(e.clientY-r.top)/r.height*b.h}}function zoomAt(p,f,b=vb){const w=b.w*f,h=b.h*f;set({w,h,x:p.x-(p.x-b.x)*(w/b.w),y:p.y-(p.y-b.y)*(h/b.h)})}function pair(){const a=[...pointers.values()];return[a[0],a[1]]}function distance(){const [a,b]=pair();return Math.hypot(a.clientX-b.clientX,a.clientY-b.clientY)}function center(b=vb){const [a,c]=pair();return point({clientX:(a.clientX+c.clientX)/2,clientY:(a.clientY+c.clientY)/2},b)}svg.addEventListener('wheel',e=>{e.preventDefault();zoomAt(point(e),e.deltaY<0?.85:1.18)},{passive:false});svg.addEventListener('pointerdown',e=>{if(e.target.closest('a'))return;svg.setPointerCapture(e.pointerId);pointers.set(e.pointerId,e);if(pointers.size===1)drag={x:e.clientX,y:e.clientY,v:{...vb}};if(pointers.size===2)pinch={d:distance(),v:{...vb},p:center()}});svg.addEventListener('pointermove',e=>{if(!pointers.has(e.pointerId))return;pointers.set(e.pointerId,e);const r=svg.getBoundingClientRect();if(pointers.size===1&&drag)set({w:drag.v.w,h:drag.v.h,x:drag.v.x-(e.clientX-drag.x)/r.width*drag.v.w,y:drag.v.y-(e.clientY-drag.y)/r.height*drag.v.h});if(pointers.size===2&&pinch)zoomAt(pinch.p,pinch.d/distance(),pinch.v)});function end(e){pointers.delete(e.pointerId);drag=null;pinch=null}svg.addEventListener('pointerup',end);svg.addEventListener('pointercancel',end);svg.closest('.graph').querySelector('.graph-controls').addEventListener('click',e=>{const action=e.target.closest('button')?.dataset.graphZoom;if(action==='in')zoomAt({x:vb.x+vb.w/2,y:vb.y+vb.h/2},.8);if(action==='out')zoomAt({x:vb.x+vb.w/2,y:vb.y+vb.h/2},1.25);if(action==='reset')set(initial)})}`;
704856const searchScript = () =>
705857 `const data=JSON.parse(document.getElementById('search-data').textContent);const index=new MiniSearch({fields:['id','title','type','text'],storeFields:['id','title','type','text','href']});index.addAll(data);const input=document.getElementById('search');const button=document.getElementById('search-button');const out=document.getElementById('results');const terms=()=>input.value.trim().toLowerCase().split(/\\s+/).filter(Boolean);function appendHits(node,text,parts){let i=0;const lower=text.toLowerCase();while(i<text.length){let hit=-1,term='';for(const part of parts){const at=lower.indexOf(part,i);if(at>=0&&(hit<0||at<hit)){hit=at;term=part}}if(hit<0){node.append(document.createTextNode(text.slice(i)));break}node.append(document.createTextNode(text.slice(i,hit)));const mark=document.createElement('mark');mark.dataset.searchHit='';mark.textContent=text.slice(hit,hit+term.length);node.append(mark);i=hit+term.length}}function clearArticleHits(){for(const mark of document.querySelectorAll('mark[data-search-hit]'))mark.replaceWith(document.createTextNode(mark.textContent||''))}function highlightArticle(id,parts){clearArticleHits();const root=document.getElementById(id);if(!root||!parts.length)return;const walker=document.createTreeWalker(root,NodeFilter.SHOW_TEXT,{acceptNode(node){const parent=node.parentElement;if(!parent||['SCRIPT','STYLE','TEXTAREA','INPUT','MARK'].includes(parent.tagName))return NodeFilter.FILTER_REJECT;return parts.some(part=>(node.nodeValue||'').toLowerCase().includes(part))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}});const hits=[];while(hits.length<80){const node=walker.nextNode();if(!node)break;hits.push(node)}for(const node of hits){const span=document.createDocumentFragment();appendHits(span,node.nodeValue||'',parts);node.replaceWith(span)}}function render(){const q=input.value.trim();const parts=terms();out.textContent='';if(!q)return;for(const item of index.search(q,{prefix:true,fuzzy:.2}).slice(0,20)){const li=document.createElement('li');const a=document.createElement('a');const body=item.text||'';const lower=body.toLowerCase();const at=Math.min(...parts.map(part=>{const found=lower.indexOf(part);return found<0?Number.POSITIVE_INFINITY:found}));const start=Number.isFinite(at)?Math.max(0,at-40):0;const context=body.slice(start,Number.isFinite(at)?at+120:120);a.href=item.href;a.textContent=item.id+' '+item.title;const small=document.createElement('small');appendHits(small,context,parts);a.addEventListener('click',()=>{highlightArticle(item.id,parts);out.textContent=''});li.append(a,document.createElement('br'),small);out.append(li)}}input.addEventListener('input',render);button?.addEventListener('click',()=>{render();out.querySelector('a')?.click()});`;

package-lock.json

Modified

+16 / −0 text lines

418418 "name": "@bugabinga/pi-ext-the-system",
419419 "license": "MIT",
420420 "dependencies": {
421 "@dagrejs/dagre": "^3.1.1",
421422 "github-slugger": "^2.0.0",
422423 "mermaid": "^11.16.0",
423424 "minisearch": "^7.2.0",
14691470 "integrity": "sha512-U+HFai5+zmJCkK86QsaJtoITlboZHBqrVketcO2ROv865xfCMSFpELQoz1GkX5GzME8pTa+3kbKrZHQtI0gdbw==",
14701471 "license": "Apache-2.0"
14711472 },
1473 "node_modules/@dagrejs/dagre": {
1474 "version": "3.1.1",
1475 "resolved": "https://registry.npmjs.org/@dagrejs/dagre/-/dagre-3.1.1.tgz",
1476 "integrity": "sha512-zroZB1dFOFiGgv4Xcrn1DckB1o4aOikPqD2NDQPV0WM//CXGcS6xiD0rNkqHmw6FEg4tabt4nxPLwgCWT+Vb2A==",
1477 "license": "MIT",
1478 "dependencies": {
1479 "@dagrejs/graphlib": "4.0.5"
1480 }
1481 },
1482 "node_modules/@dagrejs/graphlib": {
1483 "version": "4.0.5",
1484 "resolved": "https://registry.npmjs.org/@dagrejs/graphlib/-/graphlib-4.0.5.tgz",
1485 "integrity": "sha512-7xrBTqIts3o+PMUZX97wSc+7TUbW+/rULzGNCTP6yooNVDXbzw4Wutg/H/xOutTB/c/k0YqOAavgPh4/Zk9PFA==",
1486 "license": "MIT"
1487 },
14721488 "node_modules/@earendil-works/pi-agent-core": {
14731489 "version": "0.84.1",
14741490 "resolved": "https://registry.npmjs.org/@earendil-works/pi-agent-core/-/pi-agent-core-0.84.1.tgz",