@shoalrun/cli 0.1.0-alpha.19 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/CODE-REFERENCES.md +137 -0
  3. package/README.md +19 -6
  4. package/adapters/python/requirements.txt +1 -0
  5. package/adapters/python/shoalrun_reference.py +234 -0
  6. package/agent-docs/.well-known/shoalrun/navigation/project-updates-50f26fe22670.txt +7 -3
  7. package/agent-docs/SNAPSHOT.json +5 -5
  8. package/agent-docs/about.md +3 -3
  9. package/agent-docs/api-docs/code-reference-settings.md +160 -0
  10. package/agent-docs/api-docs/code-reference-settings.sections/catalog-settings.md +50 -0
  11. package/agent-docs/api-docs/code-reference-settings.sections/complete-reference-page.md +46 -0
  12. package/agent-docs/api-docs/code-reference-settings.sections/converter-snapshot.md +58 -0
  13. package/agent-docs/api-docs/code-reference-settings.sections/descriptions-type-links-and-source-links.md +40 -0
  14. package/agent-docs/api-docs/code-reference-settings.sections/html-markdown-and-agents.md +38 -0
  15. package/agent-docs/api-docs/code-reference-settings.sections/metadata-and-selection.md +38 -0
  16. package/agent-docs/api-docs/code-reference-settings.sections/publication-sources.md +54 -0
  17. package/agent-docs/api-docs/code-reference-settings.sections/python-adapter-limits.md +38 -0
  18. package/agent-docs/api-docs/code-reference-settings.sections/related-reading.md +32 -0
  19. package/agent-docs/api-docs/code-reference-settings.sections/symbol-fields.md +56 -0
  20. package/agent-docs/api-docs/code-references.md +143 -0
  21. package/agent-docs/author/agent-overview.md +2 -2
  22. package/agent-docs/author/components/code-blocks.md +46 -1
  23. package/agent-docs/author/frontmatter-reference.md +1 -0
  24. package/agent-docs/author/frontmatter-reference.sections/categorize-connect-and-present-the-page.md +1 -0
  25. package/agent-docs/author/workspace.md +2 -2
  26. package/agent-docs/author/writing-style.md +9 -3
  27. package/agent-docs/author/writing-style.sections/adapt-this-example.md +1 -1
  28. package/agent-docs/author/writing-style.sections/choose-components-by-reader-need.md +2 -2
  29. package/agent-docs/author/writing-style.sections/evidence-and-uncertainty.md +1 -1
  30. package/agent-docs/author/writing-style.sections/example-audience-and-scope.md +1 -1
  31. package/agent-docs/author/writing-style.sections/feature-availability.md +1 -1
  32. package/agent-docs/author/writing-style.sections/ingredients-recipes-and-cookbooks.md +1 -1
  33. package/agent-docs/author/writing-style.sections/page-purpose-and-structure.md +2 -2
  34. package/agent-docs/author/writing-style.sections/procedures-and-examples.md +1 -1
  35. package/agent-docs/author/writing-style.sections/related-reading.md +1 -1
  36. package/agent-docs/author/writing-style.sections/release-notes.md +30 -0
  37. package/agent-docs/author/writing-style.sections/review-a-draft.md +1 -1
  38. package/agent-docs/author/writing-style.sections/reviewed-writing-examples.md +1 -1
  39. package/agent-docs/author/writing-style.sections/voice-and-explanations.md +1 -1
  40. package/agent-docs/changelog/2026-10-16-navigation-layouts.md +1 -1
  41. package/agent-docs/changelog/code-api-references.md +44 -0
  42. package/agent-docs/changelog/pdf-custom-languages.md +48 -0
  43. package/agent-docs/changelog.md +17 -1
  44. package/agent-docs/cli.md +11 -1
  45. package/agent-docs/cli.sections/audit-a-project-and-api-sources.md +1 -1
  46. package/agent-docs/cli.sections/author-pages.md +1 -1
  47. package/agent-docs/cli.sections/build-and-serve.md +1 -1
  48. package/agent-docs/cli.sections/inspect-config-and-operations.md +1 -1
  49. package/agent-docs/cli.sections/npm-scripts-in-this-repository.md +1 -1
  50. package/agent-docs/cli.sections/related-reading.md +1 -1
  51. package/agent-docs/cli.sections/search-and-chat.md +1 -1
  52. package/agent-docs/cli.sections/start-a-project.md +1 -1
  53. package/agent-docs/cli.sections/validate-code-reference-snapshots.md +41 -0
  54. package/agent-docs/cli.sections/working-tree-authoring-tools.md +1 -1
  55. package/agent-docs/config/apis.md +5 -1
  56. package/agent-docs/config/examples.md +3 -3
  57. package/agent-docs/config/examples.sections/feature-showcase.md +3 -3
  58. package/agent-docs/config/examples.sections/minimal-site.md +2 -2
  59. package/agent-docs/config/examples.sections/multilingual-help-center.md +2 -2
  60. package/agent-docs/config/examples.sections/parcel-api-documentation.md +2 -2
  61. package/agent-docs/config/examples.sections/related-reading.md +2 -2
  62. package/agent-docs/config/examples.sections/shared-company-preset.md +2 -2
  63. package/agent-docs/config/outputs.md +33 -12
  64. package/agent-docs/config/outputs.sections/exports.md +3 -3
  65. package/agent-docs/config/outputs.sections/metadata.md +3 -3
  66. package/agent-docs/config/outputs.sections/pdf-output.md +51 -0
  67. package/agent-docs/config/outputs.sections/related-reading.md +3 -3
  68. package/agent-docs/config.md +2 -2
  69. package/agent-docs/configuration.md +2 -2
  70. package/agent-docs/configuration.sections/build-several-sites-from-shared-content.md +1 -1
  71. package/agent-docs/configuration.sections/change-inherited-lists-deliberately.md +1 -1
  72. package/agent-docs/configuration.sections/extract-a-section-with-include.md +1 -1
  73. package/agent-docs/configuration.sections/inspect-and-validate-changes.md +1 -1
  74. package/agent-docs/configuration.sections/related-reading.md +1 -1
  75. package/agent-docs/configuration.sections/separate-config-inheritance-from-page-metadata.md +1 -1
  76. package/agent-docs/configuration.sections/share-defaults-through-extends.md +1 -1
  77. package/agent-docs/configuration.sections/start-with-one-working-file.md +2 -2
  78. package/agent-docs/configuration.sections/understand-the-three-stages.md +1 -1
  79. package/agent-docs/configuration.sections/understand-where-paths-point.md +1 -1
  80. package/agent-docs/contribute/agent-skills.md +3 -1
  81. package/agent-docs/documents.json +1009 -356
  82. package/agent-docs/features.md +6 -2
  83. package/agent-docs/index.md +2 -2
  84. package/agent-docs/provenance.json +6 -6
  85. package/agent-docs/publish/api-references.md +3 -1
  86. package/agent-docs/publish/api-references.sections/author-the-reference-page.md +3 -1
  87. package/agent-docs/publish/api-references.sections/build-and-verify-the-output.md +3 -1
  88. package/agent-docs/publish/api-references.sections/inspect-the-machine-readable-contract.md +3 -1
  89. package/agent-docs/publish/api-references.sections/next-steps.md +3 -1
  90. package/agent-docs/publish/api-references.sections/preview-a-small-api-reference.md +3 -1
  91. package/agent-docs/publish/api-references.sections/put-the-spec-in-your-project.md +3 -1
  92. package/agent-docs/publish/api-references.sections/register-the-operation.md +3 -1
  93. package/agent-docs/publish/api-references.sections/related-reading.md +3 -1
  94. package/agent-docs/publish/api-references.sections/review-imported-content-before-publishing.md +3 -1
  95. package/agent-docs/publish/api-references.sections/what-readers-get.md +3 -1
  96. package/agent-docs/publish/content-export.md +2 -0
  97. package/agent-docs/publish/content-export.sections/assets-downloads-and-notices.md +2 -0
  98. package/agent-docs/publish/content-export.sections/check-the-result.md +2 -0
  99. package/agent-docs/publish/content-export.sections/inspect-the-manifest.md +2 -0
  100. package/agent-docs/publish/content-export.sections/prerequisites.md +2 -0
  101. package/agent-docs/publish/content-export.sections/related-reading.md +2 -0
  102. package/agent-docs/publish/content-export.sections/review-exported-api-material.md +2 -0
  103. package/agent-docs/publish/content-export.sections/try-the-help-drawer-example.md +2 -0
  104. package/agent-docs/publish/content-export.sections/what-the-representations-retain.md +2 -0
  105. package/agent-docs/publish/pdf.md +184 -0
  106. package/agent-docs/publish/pdf.sections/apply-print-styling.md +65 -0
  107. package/agent-docs/publish/pdf.sections/check-the-result.md +33 -0
  108. package/agent-docs/publish/pdf.sections/export-a-page-or-publication.md +61 -0
  109. package/agent-docs/publish/pdf.sections/html-markdown-and-agents.md +31 -0
  110. package/agent-docs/publish/pdf.sections/offer-browser-page-printing.md +49 -0
  111. package/agent-docs/publish/pdf.sections/offer-direct-downloads-through-a-node-server.md +46 -0
  112. package/agent-docs/publish/pdf.sections/prerequisites.md +37 -0
  113. package/agent-docs/publish/pdf.sections/publish-an-optional-manual-download.md +39 -0
  114. package/agent-docs/publish.md +2 -0
  115. package/agent-docs/reference/agent-skills.md +7 -3
  116. package/agent-docs/search-index.json +1 -1
  117. package/agent-docs/start.md +4 -4
  118. package/agent-docs/start.sections/add-the-page-to-navigation.md +2 -2
  119. package/agent-docs/start.sections/build-and-check-both-outputs.md +2 -2
  120. package/agent-docs/start.sections/build-this-site.md +2 -2
  121. package/agent-docs/start.sections/check-writing-style.md +2 -2
  122. package/agent-docs/start.sections/create-a-page.md +2 -2
  123. package/agent-docs/start.sections/make-it-yours.md +2 -2
  124. package/agent-docs/start.sections/migrating-from-github-packages.md +2 -2
  125. package/agent-docs/start.sections/prerequisites.md +2 -2
  126. package/agent-docs/start.sections/related-reading.md +2 -2
  127. package/agent-docs/start.sections/start-your-own-project.md +4 -4
  128. package/agent-docs/status.md +9 -5
  129. package/agent-docs/styling/themes.md +7 -3
  130. package/agent-docs/what-is-shoalrun.md +2 -2
  131. package/assets/copy-markdown.js +1 -1
  132. package/assets/print-view.js +165 -0
  133. package/assets/print.js +63 -0
  134. package/dist/artifact-bundle.d.ts +2 -0
  135. package/dist/artifact-bundle.js +13 -3
  136. package/dist/authoring-snapshot.js +1 -1
  137. package/dist/browser-print-assets.d.ts +9 -0
  138. package/dist/browser-print-assets.js +45 -0
  139. package/dist/cli-discovery.d.ts +1 -1
  140. package/dist/cli-discovery.js +1 -0
  141. package/dist/cli.js +7 -0
  142. package/dist/code-reference-model.d.ts +85 -0
  143. package/dist/code-reference-model.js +73 -0
  144. package/dist/code-references.d.ts +23 -0
  145. package/dist/code-references.js +371 -0
  146. package/dist/compiler-config.d.ts +1 -0
  147. package/dist/compiler.d.ts +4 -2
  148. package/dist/compiler.js +33 -7
  149. package/dist/config.js +1 -1
  150. package/dist/content-export-command.d.ts +77 -1
  151. package/dist/content-export-command.js +5 -2
  152. package/dist/content-export-config.d.ts +4 -1
  153. package/dist/content-export-config.js +10 -5
  154. package/dist/content-export-render.d.ts +9 -3
  155. package/dist/content-export-render.js +11 -7
  156. package/dist/content-export.d.ts +126 -0
  157. package/dist/content-export.js +267 -124
  158. package/dist/content-source.d.ts +2 -0
  159. package/dist/content-workspace.d.ts +1 -0
  160. package/dist/content-workspace.js +2 -0
  161. package/dist/fonts.d.ts +9 -0
  162. package/dist/fonts.js +58 -3
  163. package/dist/frontmatter.js +5 -2
  164. package/dist/highlight-languages.d.ts +9 -0
  165. package/dist/highlight-languages.js +52 -0
  166. package/dist/highlight.d.ts +4 -1
  167. package/dist/highlight.js +20 -5
  168. package/dist/output-commit.d.ts +1 -1
  169. package/dist/output-commit.js +4 -2
  170. package/dist/page-materialization.js +3 -2
  171. package/dist/page-renderer.d.ts +1 -0
  172. package/dist/page-renderer.js +8 -1
  173. package/dist/pdf-button.d.ts +22 -0
  174. package/dist/pdf-button.js +55 -0
  175. package/dist/pdf-config.d.ts +28 -0
  176. package/dist/pdf-config.js +43 -0
  177. package/dist/pdf-http.d.ts +36 -0
  178. package/dist/pdf-http.js +132 -0
  179. package/dist/pdf-project.d.ts +6 -0
  180. package/dist/pdf-project.js +31 -0
  181. package/dist/pdf-renderer.d.ts +45 -0
  182. package/dist/pdf-renderer.js +208 -0
  183. package/dist/pdf-site.d.ts +37 -0
  184. package/dist/pdf-site.js +65 -0
  185. package/dist/pdf-stylesheet.d.ts +1 -0
  186. package/dist/pdf-stylesheet.js +57 -0
  187. package/dist/publication-render.d.ts +2 -1
  188. package/dist/publication-render.js +2 -2
  189. package/dist/representation-tree.js +5 -1
  190. package/dist/server.d.ts +2 -0
  191. package/dist/server.js +35 -8
  192. package/dist/vercel.js +6 -0
  193. package/examples/code-references/content/start.md +53 -0
  194. package/examples/code-references/docs.config.yaml +262 -0
  195. package/examples/code-references/python/orchard/__init__.py +11 -0
  196. package/examples/code-references/python/orchard/client.py +212 -0
  197. package/examples/code-references/python/orchard/errors.py +31 -0
  198. package/examples/code-references/python/orchard/models.py +69 -0
  199. package/examples/code-references/python/orchard/pagination.py +39 -0
  200. package/examples/code-references/reference.json +1244 -0
  201. package/examples/custom-language/README.md +32 -0
  202. package/examples/custom-language/content/start.mdx +28 -0
  203. package/examples/custom-language/docs.config.yaml +18 -0
  204. package/examples/custom-language/grammars/custompy.tmLanguage.json +7 -0
  205. package/examples/pdf/README.md +27 -0
  206. package/examples/pdf/content/operations.mdx +26 -0
  207. package/examples/pdf/content/start.mdx +28 -0
  208. package/examples/pdf/docs.config.yaml +29 -0
  209. package/examples/pdf/print.css +9 -0
  210. package/package.json +11 -2
  211. package/schemas/code-reference.schema.json +306 -0
  212. package/skills/shoalrun-author/SKILL.md +6 -0
  213. package/skills/shoalrun-author/references/code-api-references.md +15 -0
  214. package/skills/shoalrun-author/references/pdf-export.md +15 -0
  215. package/skills/shoalrun-brand/SKILL.md +2 -0
  216. package/skills/shoalrun-pdf/SKILL.md +49 -0
  217. package/skills/shoalrun-pdf/assets/print.css +49 -0
  218. package/skills/shoalrun-pdf/references/print-design.md +75 -0
  219. package/styles/site.css +64 -3
@@ -0,0 +1,32 @@
1
+ # Custom language highlighting
2
+
3
+ Register a local TextMate JSON grammar under
4
+ `outputs.html.highlighting.languages`, then use its `id` or an `aliases` entry
5
+ as a fenced-code language. This example adds two illustrative keywords to
6
+ Python's existing syntax-color rules.
7
+
8
+ From this directory, with the CLI installed in your project:
9
+
10
+ ```sh
11
+ npx --no-install shoalrun build docs.config.yaml site-dist
12
+ npx --no-install shoalrun serve site-dist --port 8770
13
+ ```
14
+
15
+ From the framework repository root:
16
+
17
+ ```sh
18
+ node framework/dist/cli.js build framework/examples/custom-language/docs.config.yaml /tmp/shoalrun-custom-language
19
+ node framework/dist/cli.js serve /tmp/shoalrun-custom-language --port 8770
20
+ ```
21
+
22
+ Grammar paths resolve from the configuration file that declares them. The
23
+ compiler tracks those files as build dependencies; edit the grammar and rebuild,
24
+ or use `dev` for watched editing. Malformed or missing grammars fail the build
25
+ and preserve existing output. IDs and aliases can't replace bundled languages;
26
+ each grammar needs a distinct `scopeName`.
27
+
28
+ The resulting HTML contains syntax colors without loading the grammar in the
29
+ browser. Markdown keeps the original code and fence label. The grammar doesn't
30
+ validate programs or add autocomplete, filename-based language inference, or
31
+ editor integration. Replace this illustrative grammar with your language's
32
+ grammar and retain its applicable license notices.
@@ -0,0 +1,28 @@
1
+ ---
2
+ id: guide.custom-language
3
+ title: Highlight a custom language
4
+ summary: Register a local TextMate grammar and use its language ID or alias in fenced examples.
5
+ type: guide
6
+ slug: /
7
+ channel: production
8
+ version: current
9
+ language: en
10
+ access: { policy: public }
11
+ ---
12
+
13
+ This illustrative Python-like language adds `publish` and `unless`. The grammar
14
+ recognizes these keywords before falling back to the bundled Python grammar.
15
+
16
+ ```custompy title="Language ID"
17
+ def welcome(name):
18
+ unless name is None:
19
+ publish "Hello, " + name
20
+ ```
21
+
22
+ The alias selects the same grammar:
23
+
24
+ ```cpy title="Language alias"
25
+ publish "The same syntax colors, with a shorter fence label."
26
+ ```
27
+
28
+ This example only defines syntax colors. It doesn't implement an executable language.
@@ -0,0 +1,18 @@
1
+ schemaVersion: 1
2
+ site:
3
+ title: Custom language example
4
+ contentDir: ./content
5
+ publications:
6
+ defaults: { channel: production, version: current, language: en }
7
+ channels: { production: {} }
8
+ versions: { current: {} }
9
+ enabled: [{ channel: production, version: current, language: en }]
10
+ outputs:
11
+ html:
12
+ shareImages: false
13
+ highlighting:
14
+ provider: shiki
15
+ languages:
16
+ - id: custompy
17
+ grammar: ./grammars/custompy.tmLanguage.json
18
+ aliases: [cpy]
@@ -0,0 +1,7 @@
1
+ {
2
+ "scopeName": "source.custompy",
3
+ "patterns": [
4
+ { "name": "keyword.control.custompy", "match": "\\b(?:publish|unless)\\b" },
5
+ { "include": "source.python" }
6
+ ]
7
+ }
@@ -0,0 +1,27 @@
1
+ # Styled PDF export
2
+
3
+ This project demonstrates browser page printing and optional CLI PDF exports. All configuration values and thresholds are examples.
4
+
5
+ Build and preview the static site without a browser dependency:
6
+
7
+ ```sh
8
+ shoalrun build docs.config.yaml site-dist
9
+ shoalrun serve site-dist --port 8892
10
+ ```
11
+
12
+ Open `/start` and choose **Print PDF**. The browser fills a separate print view using the shared PDF theme and opens its print dialog. Site builds add shared scripts, styling, settings, and configured print assets; they generate no page PDFs or extra print documents. This works on static hosting, including Vercel. Allow the print view to open if the browser blocks it. Without JavaScript, use the browser's own Print command.
13
+
14
+ For a downloadable full manual, explicitly run the CLI export with an installed browser:
15
+
16
+ ```sh
17
+ export SHOALRUN_PDF_BROWSER="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
18
+ shoalrun export docs.config.yaml --format pdf --out pdf/manual
19
+ ```
20
+
21
+ Use the correct Chrome/Chromium executable path for your operating system. No browser is downloaded automatically. The command writes `pdf/manual/publication.pdf`. Publish that file and a deliberate download link only when wanted; it isn't added to the site automatically. Copy it into the static deployment after the site build, which replaces its output directory. Add `--document guide.start` to generate a single-page PDF explicitly.
22
+
23
+ Change `print.css` for manual and browser print-view colors, typography, and page breaks. Set `outputs.pdf.fonts` to local licensed font files and reference their registered families in CSS. Use `outputs.pdf.logo` for a local cover image. Print CSS can't import files or load URLs; fonts and logo are registered explicitly. Optional `outputs.html.pdf.style` selects a named export target's PDF styling without changing page selection. Headers and footers accept `{title}`, `{page}`, and `{pages}`; browser views use CSS page-margin support. Use `site.customCss` with `@media print` for the ordinary browser Print fallback, which doesn't open a branded view.
24
+
25
+ Inspect the actual PDF for spacing, math, long content, links, and bookmarks. The manual's table of contents is linked without printed page numbers. Chromium bookmark/tagging support is experimental; the output isn't certified PDF/UA. The `pdf` export manifest is separate from content REST representations.
26
+
27
+ Explicit `outputs.html.pdf.mode: endpoint` supports direct page PDF downloads through a Node host with Chromium. It isn't for static hosting. Keep `pdf-runtime.json` and `__shoalrun/pdf-data` behind that server; don't expose them through a generic static host.
@@ -0,0 +1,26 @@
1
+ ---
2
+ id: guide.operations
3
+ title: Run daily operations
4
+ summary: Review workspace activity and record an outcome.
5
+ slug: /operations
6
+ ---
7
+
8
+ Start each review by checking the [workspace setup](doc:guide.start). Record the review date and result with your operating notes.
9
+
10
+ ## Review activity
11
+
12
+ Use these example thresholds to decide whether activity needs investigation:
13
+
14
+ | Signal | Expected value | Follow-up |
15
+ | --- | --- | --- |
16
+ | Queued work | Below 100 items | Check worker capacity. |
17
+ | Oldest item | Below 10 minutes | Inspect the processing log. |
18
+ | Failed items | Zero | Review the reported failure. |
19
+
20
+ For a completed-work count of 90 out of 100, the completion ratio is:
21
+
22
+ <Math display expression="r = \frac{90}{100} = 0.9" />
23
+
24
+ ## Record the outcome
25
+
26
+ Save a brief report with the observed counts and any follow-up action. Link to [the review section](#review-activity) so the next operator can repeat the checks.
@@ -0,0 +1,28 @@
1
+ ---
2
+ id: guide.start
3
+ title: Start your workspace
4
+ summary: Configure a workspace and confirm its status.
5
+ slug: /start
6
+ ---
7
+
8
+ Create a workspace before running daily operations. Keep its configuration in your project so another operator can reproduce the setup.
9
+
10
+ ## Configure the workspace
11
+
12
+ Save the following example configuration:
13
+
14
+ ```yaml
15
+ workspace:
16
+ name: training
17
+ retentionDays: 30
18
+ ```
19
+
20
+ ## Verify the result
21
+
22
+ Confirm that the workspace name is `training` and that retention is 30 days. Continue with [daily operations](doc:guide.operations).
23
+
24
+ <Collapsible title="Configuration checklist">
25
+
26
+ Record the workspace owner, retention period, and expected data source before adding live data.
27
+
28
+ </Collapsible>
@@ -0,0 +1,29 @@
1
+ schemaVersion: 1
2
+ site:
3
+ title: Operations documentation
4
+ origin: https://docs.example.com
5
+ frontmatter:
6
+ defaults:
7
+ type: guide
8
+ channel: production
9
+ version: current
10
+ access: { policy: public }
11
+ publications:
12
+ defaults: { channel: production, version: current, language: en }
13
+ channels: { production: {} }
14
+ versions: { current: {} }
15
+ enabled: [{ channel: production, version: current }]
16
+ navigation:
17
+ - { id: start, doc: guide.start }
18
+ - { id: operations, doc: guide.operations }
19
+ outputs:
20
+ pdf:
21
+ stylesheet: ./print.css
22
+ size: A4
23
+ footer: "{title} | {page} / {pages}"
24
+ subtitle: Setup and daily operations
25
+ html:
26
+ pdf:
27
+ mode: print
28
+ label: Print PDF
29
+ placement: after
@@ -0,0 +1,9 @@
1
+ :root {
2
+ --pdf-accent: #28584b;
3
+ --pdf-text: #172722;
4
+ --pdf-muted: #53665e;
5
+ --pdf-font: Arial, sans-serif;
6
+ }
7
+ .pdf-cover { border-top: 6pt solid var(--pdf-accent); }
8
+ .pdf-cover h1 { max-width: 15ch; }
9
+ th { background: #e5eee9; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shoalrun/cli",
3
- "version": "0.1.0-alpha.19",
3
+ "version": "1.0.0",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org",
6
6
  "access": "public"
@@ -11,11 +11,13 @@
11
11
  "license": "Apache-2.0",
12
12
  "type": "module",
13
13
  "exports": {
14
+ "./references": "./dist/code-reference-model.js",
14
15
  "./content": "./dist/content-delivery.js",
15
16
  "./authoring": "./dist/authoring-api.js",
16
17
  "./*": "./*",
17
18
  "./components": "./dist/components.js",
18
- "./content/server": "./dist/content-rest-server.js"
19
+ "./content/server": "./dist/content-rest-server.js",
20
+ "./pdf/server": "./dist/pdf-http.js"
19
21
  },
20
22
  "files": [
21
23
  "dist",
@@ -26,6 +28,7 @@
26
28
  "templates",
27
29
  "examples",
28
30
  "!examples/**/public/**",
31
+ "!examples/**/site-dist/**",
29
32
  "!examples/**/node_modules/**",
30
33
  "example-configs",
31
34
  "!example-configs/**/.shoalrun/**",
@@ -33,7 +36,12 @@
33
36
  "skills",
34
37
  "README.md",
35
38
  "AUTHORING.md",
39
+ "CODE-REFERENCES.md",
36
40
  "DEPLOYMENT-PROFILES.md",
41
+ "schemas/code-reference.schema.json",
42
+ "adapters/python",
43
+ "!**/__pycache__/**",
44
+ "!adapters/python/test_*.py",
37
45
  "schemas/content-export.schema.json",
38
46
  "schemas/content-rest.openapi.json",
39
47
  "CHANGELOG.md",
@@ -70,6 +78,7 @@
70
78
  "lucide": "1.47.0",
71
79
  "parse5": "8.0.1",
72
80
  "pele": "1.6.0",
81
+ "puppeteer-core": "25.16.0",
73
82
  "rehype-stringify": "10.0.1",
74
83
  "remark-gfm": "4.0.1",
75
84
  "remark-mdx": "3.1.1",
@@ -0,0 +1,306 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "schemaVersion": {
6
+ "type": "number",
7
+ "const": 1
8
+ },
9
+ "kind": {
10
+ "type": "string",
11
+ "const": "shoalrun-code-reference"
12
+ },
13
+ "programmingLanguage": {
14
+ "type": "string",
15
+ "pattern": "^[a-z][a-z0-9_-]{0,63}$"
16
+ },
17
+ "producer": {
18
+ "type": "object",
19
+ "properties": {
20
+ "name": {
21
+ "type": "string",
22
+ "minLength": 1,
23
+ "maxLength": 100
24
+ },
25
+ "version": {
26
+ "type": "string",
27
+ "minLength": 1,
28
+ "maxLength": 100
29
+ },
30
+ "extractorVersion": {
31
+ "type": "string",
32
+ "maxLength": 100
33
+ }
34
+ },
35
+ "required": [
36
+ "name",
37
+ "version"
38
+ ],
39
+ "additionalProperties": false
40
+ },
41
+ "sourceDigest": {
42
+ "type": "string",
43
+ "pattern": "^[a-f0-9]{64}$"
44
+ },
45
+ "symbols": {
46
+ "minItems": 1,
47
+ "maxItems": 10000,
48
+ "type": "array",
49
+ "items": {
50
+ "type": "object",
51
+ "properties": {
52
+ "id": {
53
+ "type": "string",
54
+ "minLength": 1,
55
+ "maxLength": 512,
56
+ "pattern": "^[^\\s\\x00-\\x1f]+$"
57
+ },
58
+ "name": {
59
+ "type": "string",
60
+ "minLength": 1,
61
+ "maxLength": 512
62
+ },
63
+ "kind": {
64
+ "type": "string",
65
+ "enum": [
66
+ "module",
67
+ "namespace",
68
+ "class",
69
+ "interface",
70
+ "enum",
71
+ "type",
72
+ "function",
73
+ "method",
74
+ "constructor",
75
+ "property",
76
+ "attribute",
77
+ "constant"
78
+ ]
79
+ },
80
+ "parent": {
81
+ "type": "string",
82
+ "minLength": 1,
83
+ "maxLength": 512,
84
+ "pattern": "^[^\\s\\x00-\\x1f]+$"
85
+ },
86
+ "visibility": {
87
+ "default": "public",
88
+ "type": "string",
89
+ "enum": [
90
+ "public",
91
+ "private"
92
+ ]
93
+ },
94
+ "summary": {
95
+ "type": "string",
96
+ "maxLength": 1000
97
+ },
98
+ "description": {
99
+ "type": "string",
100
+ "maxLength": 100000
101
+ },
102
+ "annotation": {
103
+ "type": "string",
104
+ "maxLength": 100000
105
+ },
106
+ "default": {
107
+ "type": "string",
108
+ "maxLength": 100000
109
+ },
110
+ "required": {
111
+ "type": "boolean"
112
+ },
113
+ "bases": {
114
+ "maxItems": 100,
115
+ "type": "array",
116
+ "items": {
117
+ "type": "string",
118
+ "maxLength": 100000
119
+ }
120
+ },
121
+ "constructorSignature": {
122
+ "type": "string",
123
+ "maxLength": 100000
124
+ },
125
+ "typeReferences": {
126
+ "type": "object",
127
+ "propertyNames": {
128
+ "type": "string",
129
+ "minLength": 1,
130
+ "maxLength": 512
131
+ },
132
+ "additionalProperties": {
133
+ "type": "string",
134
+ "minLength": 1,
135
+ "maxLength": 512,
136
+ "pattern": "^[^\\s\\x00-\\x1f]+$"
137
+ }
138
+ },
139
+ "signatures": {
140
+ "maxItems": 100,
141
+ "type": "array",
142
+ "items": {
143
+ "type": "string",
144
+ "maxLength": 100000
145
+ }
146
+ },
147
+ "parameters": {
148
+ "maxItems": 1000,
149
+ "type": "array",
150
+ "items": {
151
+ "type": "object",
152
+ "properties": {
153
+ "name": {
154
+ "type": "string",
155
+ "minLength": 1,
156
+ "maxLength": 512
157
+ },
158
+ "type": {
159
+ "type": "string",
160
+ "maxLength": 100000
161
+ },
162
+ "description": {
163
+ "type": "string",
164
+ "maxLength": 100000
165
+ },
166
+ "default": {
167
+ "type": "string",
168
+ "maxLength": 100000
169
+ }
170
+ },
171
+ "required": [
172
+ "name"
173
+ ],
174
+ "additionalProperties": false
175
+ }
176
+ },
177
+ "returns": {
178
+ "type": "object",
179
+ "properties": {
180
+ "type": {
181
+ "type": "string",
182
+ "maxLength": 100000
183
+ },
184
+ "description": {
185
+ "type": "string",
186
+ "maxLength": 100000
187
+ }
188
+ },
189
+ "additionalProperties": false
190
+ },
191
+ "yields": {
192
+ "type": "object",
193
+ "properties": {
194
+ "type": {
195
+ "type": "string",
196
+ "maxLength": 100000
197
+ },
198
+ "description": {
199
+ "type": "string",
200
+ "maxLength": 100000
201
+ }
202
+ },
203
+ "additionalProperties": false
204
+ },
205
+ "raises": {
206
+ "maxItems": 1000,
207
+ "type": "array",
208
+ "items": {
209
+ "type": "object",
210
+ "properties": {
211
+ "name": {
212
+ "type": "string",
213
+ "minLength": 1,
214
+ "maxLength": 512
215
+ },
216
+ "type": {
217
+ "type": "string",
218
+ "maxLength": 100000
219
+ },
220
+ "description": {
221
+ "type": "string",
222
+ "maxLength": 100000
223
+ },
224
+ "default": {
225
+ "type": "string",
226
+ "maxLength": 100000
227
+ }
228
+ },
229
+ "required": [
230
+ "name"
231
+ ],
232
+ "additionalProperties": false
233
+ }
234
+ },
235
+ "examples": {
236
+ "maxItems": 100,
237
+ "type": "array",
238
+ "items": {
239
+ "type": "object",
240
+ "properties": {
241
+ "title": {
242
+ "type": "string",
243
+ "maxLength": 512
244
+ },
245
+ "code": {
246
+ "type": "string",
247
+ "maxLength": 100000
248
+ }
249
+ },
250
+ "required": [
251
+ "code"
252
+ ],
253
+ "additionalProperties": false
254
+ }
255
+ },
256
+ "seeAlso": {
257
+ "maxItems": 1000,
258
+ "type": "array",
259
+ "items": {
260
+ "type": "string",
261
+ "minLength": 1,
262
+ "maxLength": 512,
263
+ "pattern": "^[^\\s\\x00-\\x1f]+$"
264
+ }
265
+ },
266
+ "source": {
267
+ "type": "object",
268
+ "properties": {
269
+ "path": {
270
+ "type": "string",
271
+ "minLength": 1,
272
+ "maxLength": 1000,
273
+ "pattern": "^(?!\\/)(?!.*(?:^|\\/)\\.{1,2}(?:\\/|$))[^/\\\\\\x00:]+(?:\\/[^/\\\\\\x00:]+)*$"
274
+ },
275
+ "line": {
276
+ "type": "integer",
277
+ "exclusiveMinimum": 0,
278
+ "maximum": 9007199254740991
279
+ }
280
+ },
281
+ "required": [
282
+ "path"
283
+ ],
284
+ "additionalProperties": false
285
+ }
286
+ },
287
+ "required": [
288
+ "id",
289
+ "name",
290
+ "kind",
291
+ "visibility"
292
+ ],
293
+ "additionalProperties": false
294
+ }
295
+ }
296
+ },
297
+ "required": [
298
+ "schemaVersion",
299
+ "kind",
300
+ "programmingLanguage",
301
+ "producer",
302
+ "symbols"
303
+ ],
304
+ "additionalProperties": false,
305
+ "title": "Shoalrun Code API reference snapshot"
306
+ }
@@ -21,6 +21,10 @@ When reading a published site through Markdown, follow topic-index links when pr
21
21
 
22
22
  Read `reference.authoring-workspace` for tool contracts and `guide.authoring-workspace` for the working-tree procedure. Before unfamiliar syntax, check the relevant component attributes, configuration structure, or asset-handling contract instead of assuming another tool’s conventions. For MDX components, read their canonical reference; `<Step>` belongs inside `<Steps>` for an ordinary titled procedure, while your harness's task plan is separate. Read implementation/specification evidence with your harness's permitted tools; record the sources for changed claims. Bundled guidance does not establish a consumer project's facts.
23
23
 
24
+ ## Code API references
25
+
26
+ For source-code library or SDK references, read [references/code-api-references.md](references/code-api-references.md). Keep these separate from OpenAPI endpoint references. Extract explicitly, validate the snapshot, preserve publication and feature scope, and choose symbol, class, module, or optional complete-page presentation deliberately.
27
+
24
28
  ## Products and availability
25
29
 
26
30
  For independently versioned products, cross-product reuse, product-scoped delivery, or feature availability labels, read [references/publications.md](references/publications.md). Preserve product/channel/version/language identity, distinguish publication membership from feature grants, and check installed-version support before using new fields. Availability labels describe support; they don't filter the published content.
@@ -31,6 +35,8 @@ For SKU-selected or white-label documentation, read [references/customer-edition
31
35
 
32
36
  ## Record scope and edit
33
37
 
38
+ For PDF export or page print/download actions, read [references/pdf-export.md](references/pdf-export.md). Keep PDF selection distinct from reader-view controls. Use browser printing on static sites, optional CLI manual downloads, and explicit Node-hosted generation when needed.
39
+
34
40
  Before editing, capture the current state with `docs baseline --out <new-baseline> --config <config>`. Put baselines inside the project's excluded `.shoalrun` directory or outside the project. This includes earlier dirty/untracked files rather than comparing with Git HEAD. Retain the corresponding before-content/task diff with your harness; a baseline stores digests, not earlier text. For an existing rendering failure, reproduce its located finding before repairing it.
35
41
 
36
42
  Edit ordinary source files and required companions. Choose a page type and reviewed example for the reader's goal. Preserve stable IDs, routes, original `date` and access policy; set `updated` to the actual edit date. For a new page, use `shoalrun scaffold <template> -n <target> --config <config>` and resolve its prompts. Keep it draft until reviewed; snapshot validation renders affected drafts without changing their publication metadata. API materialization and recipe tasks have focused references/skills when needed.
@@ -0,0 +1,15 @@
1
+ # Code API reference authoring
2
+
3
+ Read `guide.code-api-references` and `reference.code-api-references` from the installed package's bundled docs when present. Check installed-version support; the feature starts in 1.0.0. A source checkout also provides `CODE-REFERENCES.md` and a runnable `examples/code-references` project.
4
+
5
+ Use `codeReferences` for a language library or SDK, and `apis` for OpenAPI HTTP endpoints. A converter writes the versioned snapshot; normal builds never invoke it. The optional Python adapter requires an explicitly prepared Python 3.11+ environment with its pinned requirements. Keep extraction roots narrow and don't enable runtime inspection or external discovery to make an unsupported package appear to work. Other languages can provide their own converter; don't claim a bundled Kotlin extractor.
6
+
7
+ Run `shoalrun references check FILE`, inspect the snapshot's public symbols and prose, then configure the catalog. Snapshot descriptions are inert Markdown; MDX, project directives, relative links, and images aren't supported. Preserve exact symbol IDs and use explicit document IDs/slugs when public identities must survive a rename. Keep snapshots in the project and regenerate them after source changes.
8
+
9
+ Choose `layout: symbols`, `classes`, or `modules` by reading needs. All retain individual symbol URLs. Add `singlePage` only when a complete reference is useful; configure its ID, slug, title, summary, and optional metadata, then link that ID in navigation. Group class or module pages in navigation instead of listing every symbol when a shorter menu is wanted.
10
+
11
+ Preserve product/channel/version/language source bindings. Catalog and symbol metadata classify their content; a parent's feature requirements aren't inherited by children. Strict source classification also applies to the complete page. Pass the same profile through validation, build, and export. Check that private, restricted, or audience-excluded symbols don't reappear inside grouped or complete pages.
12
+
13
+ Type links use explicit converter targets and remain within eligible catalog/publication scope. Keep unknown types unlinked. Required fields are distinct from nullable fields; show defaults as unevaluated expressions. Configure repository source links only with a real HTTPS base directory and intended release/commit; never invent a repository location.
14
+
15
+ Review class/module and complete pages in HTML and Markdown. Check inline symbol links, retained individual URLs, narrow-screen table scrolling and keyboard focus, and content-export/PDF selection by ID where relevant. Reading references doesn't require JavaScript; Copy controls do. Extraction doesn't prove runtime behavior or execute examples.
@@ -0,0 +1,15 @@
1
+ # PDF export
2
+
3
+ For print design, brand styling, and visual verification, read the [PDF skill](../../shoalrun-pdf/SKILL.md). Its print reference and stylesheet starter accompany the instructions; keep the complete skill folder when installing it.
4
+
5
+ Check the installed CLI's `export --help` and supported output settings before configuring PDFs. Use `export --format pdf --document ID --out DIRECTORY` for one page; omit the document selector for a complete publication. Select exact product/channel/version/language coordinates when more than one publication is enabled. Pass the same customer profile as the site. PDF selection uses the target's contentFilter, otherwise the site's filter; ordinary HTML/Markdown application exports retain their independent filter behavior.
6
+
7
+ Set shared print settings under outputs.pdf and per-target overrides under exports.<target>.pdf. Local stylesheet/font/logo paths resolve relative to their declaring configuration. Register licensed local fonts explicitly; custom CSS cannot import files or load URLs. Body CSS doesn't style Chromium's separate header/footer templates. Their escaped text supports {title}, {page}, and {pages}. The TOC is linked without printed page numbers. Bookmarks/tagging need actual PDF inspection; don't infer accessibility certification.
8
+
9
+ The page action is disabled by default. An enabled outputs.html.pdf mapping defaults to mode:print for static sites: the browser creates a separate branded view and opens its print dialog, with no generated page PDFs or extra print documents. Configure its label, placement before/after Markdown actions, include/exclude IDs, and optional named style target. Shared outputs.pdf styling and assets serve all print views; only a target's PDF settings apply, never its content selection. Page frontmatter pdf:false suppresses the action. Native browser printing remains a fallback using website print CSS. Keep full-manual CLI export and its published download optional.
10
+
11
+ Explicit mode:endpoint prepares private inputs for on-demand generation through a Node host with Chromium. Optional style names an export target's pdf mapping; only its styling applies, never its page/publication/filter selection. Vercel supports browser printing and rejects endpoint mode. Never publish pdf-runtime.json or __shoalrun/pdf-data through a generic static server. A custom handler must use the same authentication boundary as the site. Audience/profile selection isn't visitor authorization.
12
+
13
+ Generation requires an installed Chrome/Chromium executable through SHOALRUN_PDF_BROWSER or outputs.pdf.executablePath. It runs offline with JavaScript disabled and the browser sandbox retained. Missing assets, remote images, missing browser, or rendering failures must be reported; don't substitute a print dialog for a promised PDF download. Preserve existing exports on failure.
14
+
15
+ Verify a page and full publication, their selection/order, excluded content, links, fonts, bookmarks, page breaks, long code/tables, and static component fallbacks. Inspect rendered PDF pages as well as extracted text. Keep PDF manifests separate from content REST representation manifests. Enabling an action doesn't authorize deploying internal/customer PDFs publicly.
@@ -45,6 +45,8 @@ Check every requested color mode. Normal text needs at least 4.5:1 contrast; lar
45
45
 
46
46
  ## Validate and preview
47
47
 
48
+ For branded PDF output, read the [PDF skill](../shoalrun-pdf/SKILL.md). Configure print styling separately from website styling, retain the intended publication/profile selection, and inspect actual rendered PDF pages. A passing HTML build doesn't verify PDF appearance.
49
+
48
50
  Validate against the baseline with `shoalrun docs validate --baseline .shoalrun/brand-before.json --config docs.config.yaml`, including the selected profile when applicable. Read the report's findings and coverage. Reuse its captured output with `shoalrun docs preview REPORT --port 0`, or follow the project's required build workflow and serve that output. Rebuild when styles, configuration, or assets change.
49
51
 
50
52
  Inspect a landing page and a representative article at desktop and mobile widths. Check font and image loading, overflow, keyboard navigation, dropdown destinations, and search interactions. Confirm HTML navigation and Markdown twins retain the documentation's meaning. A successful build doesn't establish visual correctness; state any browser checks that couldn't run.