@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.
- package/CHANGELOG.md +30 -0
- package/CODE-REFERENCES.md +137 -0
- package/README.md +19 -6
- package/adapters/python/requirements.txt +1 -0
- package/adapters/python/shoalrun_reference.py +234 -0
- package/agent-docs/.well-known/shoalrun/navigation/project-updates-50f26fe22670.txt +7 -3
- package/agent-docs/SNAPSHOT.json +5 -5
- package/agent-docs/about.md +3 -3
- package/agent-docs/api-docs/code-reference-settings.md +160 -0
- package/agent-docs/api-docs/code-reference-settings.sections/catalog-settings.md +50 -0
- package/agent-docs/api-docs/code-reference-settings.sections/complete-reference-page.md +46 -0
- package/agent-docs/api-docs/code-reference-settings.sections/converter-snapshot.md +58 -0
- package/agent-docs/api-docs/code-reference-settings.sections/descriptions-type-links-and-source-links.md +40 -0
- package/agent-docs/api-docs/code-reference-settings.sections/html-markdown-and-agents.md +38 -0
- package/agent-docs/api-docs/code-reference-settings.sections/metadata-and-selection.md +38 -0
- package/agent-docs/api-docs/code-reference-settings.sections/publication-sources.md +54 -0
- package/agent-docs/api-docs/code-reference-settings.sections/python-adapter-limits.md +38 -0
- package/agent-docs/api-docs/code-reference-settings.sections/related-reading.md +32 -0
- package/agent-docs/api-docs/code-reference-settings.sections/symbol-fields.md +56 -0
- package/agent-docs/api-docs/code-references.md +143 -0
- package/agent-docs/author/agent-overview.md +2 -2
- package/agent-docs/author/components/code-blocks.md +46 -1
- package/agent-docs/author/frontmatter-reference.md +1 -0
- package/agent-docs/author/frontmatter-reference.sections/categorize-connect-and-present-the-page.md +1 -0
- package/agent-docs/author/workspace.md +2 -2
- package/agent-docs/author/writing-style.md +9 -3
- package/agent-docs/author/writing-style.sections/adapt-this-example.md +1 -1
- package/agent-docs/author/writing-style.sections/choose-components-by-reader-need.md +2 -2
- package/agent-docs/author/writing-style.sections/evidence-and-uncertainty.md +1 -1
- package/agent-docs/author/writing-style.sections/example-audience-and-scope.md +1 -1
- package/agent-docs/author/writing-style.sections/feature-availability.md +1 -1
- package/agent-docs/author/writing-style.sections/ingredients-recipes-and-cookbooks.md +1 -1
- package/agent-docs/author/writing-style.sections/page-purpose-and-structure.md +2 -2
- package/agent-docs/author/writing-style.sections/procedures-and-examples.md +1 -1
- package/agent-docs/author/writing-style.sections/related-reading.md +1 -1
- package/agent-docs/author/writing-style.sections/release-notes.md +30 -0
- package/agent-docs/author/writing-style.sections/review-a-draft.md +1 -1
- package/agent-docs/author/writing-style.sections/reviewed-writing-examples.md +1 -1
- package/agent-docs/author/writing-style.sections/voice-and-explanations.md +1 -1
- package/agent-docs/changelog/2026-10-16-navigation-layouts.md +1 -1
- package/agent-docs/changelog/code-api-references.md +44 -0
- package/agent-docs/changelog/pdf-custom-languages.md +48 -0
- package/agent-docs/changelog.md +17 -1
- package/agent-docs/cli.md +11 -1
- package/agent-docs/cli.sections/audit-a-project-and-api-sources.md +1 -1
- package/agent-docs/cli.sections/author-pages.md +1 -1
- package/agent-docs/cli.sections/build-and-serve.md +1 -1
- package/agent-docs/cli.sections/inspect-config-and-operations.md +1 -1
- package/agent-docs/cli.sections/npm-scripts-in-this-repository.md +1 -1
- package/agent-docs/cli.sections/related-reading.md +1 -1
- package/agent-docs/cli.sections/search-and-chat.md +1 -1
- package/agent-docs/cli.sections/start-a-project.md +1 -1
- package/agent-docs/cli.sections/validate-code-reference-snapshots.md +41 -0
- package/agent-docs/cli.sections/working-tree-authoring-tools.md +1 -1
- package/agent-docs/config/apis.md +5 -1
- package/agent-docs/config/examples.md +3 -3
- package/agent-docs/config/examples.sections/feature-showcase.md +3 -3
- package/agent-docs/config/examples.sections/minimal-site.md +2 -2
- package/agent-docs/config/examples.sections/multilingual-help-center.md +2 -2
- package/agent-docs/config/examples.sections/parcel-api-documentation.md +2 -2
- package/agent-docs/config/examples.sections/related-reading.md +2 -2
- package/agent-docs/config/examples.sections/shared-company-preset.md +2 -2
- package/agent-docs/config/outputs.md +33 -12
- package/agent-docs/config/outputs.sections/exports.md +3 -3
- package/agent-docs/config/outputs.sections/metadata.md +3 -3
- package/agent-docs/config/outputs.sections/pdf-output.md +51 -0
- package/agent-docs/config/outputs.sections/related-reading.md +3 -3
- package/agent-docs/config.md +2 -2
- package/agent-docs/configuration.md +2 -2
- package/agent-docs/configuration.sections/build-several-sites-from-shared-content.md +1 -1
- package/agent-docs/configuration.sections/change-inherited-lists-deliberately.md +1 -1
- package/agent-docs/configuration.sections/extract-a-section-with-include.md +1 -1
- package/agent-docs/configuration.sections/inspect-and-validate-changes.md +1 -1
- package/agent-docs/configuration.sections/related-reading.md +1 -1
- package/agent-docs/configuration.sections/separate-config-inheritance-from-page-metadata.md +1 -1
- package/agent-docs/configuration.sections/share-defaults-through-extends.md +1 -1
- package/agent-docs/configuration.sections/start-with-one-working-file.md +2 -2
- package/agent-docs/configuration.sections/understand-the-three-stages.md +1 -1
- package/agent-docs/configuration.sections/understand-where-paths-point.md +1 -1
- package/agent-docs/contribute/agent-skills.md +3 -1
- package/agent-docs/documents.json +1009 -356
- package/agent-docs/features.md +6 -2
- package/agent-docs/index.md +2 -2
- package/agent-docs/provenance.json +6 -6
- package/agent-docs/publish/api-references.md +3 -1
- package/agent-docs/publish/api-references.sections/author-the-reference-page.md +3 -1
- package/agent-docs/publish/api-references.sections/build-and-verify-the-output.md +3 -1
- package/agent-docs/publish/api-references.sections/inspect-the-machine-readable-contract.md +3 -1
- package/agent-docs/publish/api-references.sections/next-steps.md +3 -1
- package/agent-docs/publish/api-references.sections/preview-a-small-api-reference.md +3 -1
- package/agent-docs/publish/api-references.sections/put-the-spec-in-your-project.md +3 -1
- package/agent-docs/publish/api-references.sections/register-the-operation.md +3 -1
- package/agent-docs/publish/api-references.sections/related-reading.md +3 -1
- package/agent-docs/publish/api-references.sections/review-imported-content-before-publishing.md +3 -1
- package/agent-docs/publish/api-references.sections/what-readers-get.md +3 -1
- package/agent-docs/publish/content-export.md +2 -0
- package/agent-docs/publish/content-export.sections/assets-downloads-and-notices.md +2 -0
- package/agent-docs/publish/content-export.sections/check-the-result.md +2 -0
- package/agent-docs/publish/content-export.sections/inspect-the-manifest.md +2 -0
- package/agent-docs/publish/content-export.sections/prerequisites.md +2 -0
- package/agent-docs/publish/content-export.sections/related-reading.md +2 -0
- package/agent-docs/publish/content-export.sections/review-exported-api-material.md +2 -0
- package/agent-docs/publish/content-export.sections/try-the-help-drawer-example.md +2 -0
- package/agent-docs/publish/content-export.sections/what-the-representations-retain.md +2 -0
- package/agent-docs/publish/pdf.md +184 -0
- package/agent-docs/publish/pdf.sections/apply-print-styling.md +65 -0
- package/agent-docs/publish/pdf.sections/check-the-result.md +33 -0
- package/agent-docs/publish/pdf.sections/export-a-page-or-publication.md +61 -0
- package/agent-docs/publish/pdf.sections/html-markdown-and-agents.md +31 -0
- package/agent-docs/publish/pdf.sections/offer-browser-page-printing.md +49 -0
- package/agent-docs/publish/pdf.sections/offer-direct-downloads-through-a-node-server.md +46 -0
- package/agent-docs/publish/pdf.sections/prerequisites.md +37 -0
- package/agent-docs/publish/pdf.sections/publish-an-optional-manual-download.md +39 -0
- package/agent-docs/publish.md +2 -0
- package/agent-docs/reference/agent-skills.md +7 -3
- package/agent-docs/search-index.json +1 -1
- package/agent-docs/start.md +4 -4
- package/agent-docs/start.sections/add-the-page-to-navigation.md +2 -2
- package/agent-docs/start.sections/build-and-check-both-outputs.md +2 -2
- package/agent-docs/start.sections/build-this-site.md +2 -2
- package/agent-docs/start.sections/check-writing-style.md +2 -2
- package/agent-docs/start.sections/create-a-page.md +2 -2
- package/agent-docs/start.sections/make-it-yours.md +2 -2
- package/agent-docs/start.sections/migrating-from-github-packages.md +2 -2
- package/agent-docs/start.sections/prerequisites.md +2 -2
- package/agent-docs/start.sections/related-reading.md +2 -2
- package/agent-docs/start.sections/start-your-own-project.md +4 -4
- package/agent-docs/status.md +9 -5
- package/agent-docs/styling/themes.md +7 -3
- package/agent-docs/what-is-shoalrun.md +2 -2
- package/assets/copy-markdown.js +1 -1
- package/assets/print-view.js +165 -0
- package/assets/print.js +63 -0
- package/dist/artifact-bundle.d.ts +2 -0
- package/dist/artifact-bundle.js +13 -3
- package/dist/authoring-snapshot.js +1 -1
- package/dist/browser-print-assets.d.ts +9 -0
- package/dist/browser-print-assets.js +45 -0
- package/dist/cli-discovery.d.ts +1 -1
- package/dist/cli-discovery.js +1 -0
- package/dist/cli.js +7 -0
- package/dist/code-reference-model.d.ts +85 -0
- package/dist/code-reference-model.js +73 -0
- package/dist/code-references.d.ts +23 -0
- package/dist/code-references.js +371 -0
- package/dist/compiler-config.d.ts +1 -0
- package/dist/compiler.d.ts +4 -2
- package/dist/compiler.js +33 -7
- package/dist/config.js +1 -1
- package/dist/content-export-command.d.ts +77 -1
- package/dist/content-export-command.js +5 -2
- package/dist/content-export-config.d.ts +4 -1
- package/dist/content-export-config.js +10 -5
- package/dist/content-export-render.d.ts +9 -3
- package/dist/content-export-render.js +11 -7
- package/dist/content-export.d.ts +126 -0
- package/dist/content-export.js +267 -124
- package/dist/content-source.d.ts +2 -0
- package/dist/content-workspace.d.ts +1 -0
- package/dist/content-workspace.js +2 -0
- package/dist/fonts.d.ts +9 -0
- package/dist/fonts.js +58 -3
- package/dist/frontmatter.js +5 -2
- package/dist/highlight-languages.d.ts +9 -0
- package/dist/highlight-languages.js +52 -0
- package/dist/highlight.d.ts +4 -1
- package/dist/highlight.js +20 -5
- package/dist/output-commit.d.ts +1 -1
- package/dist/output-commit.js +4 -2
- package/dist/page-materialization.js +3 -2
- package/dist/page-renderer.d.ts +1 -0
- package/dist/page-renderer.js +8 -1
- package/dist/pdf-button.d.ts +22 -0
- package/dist/pdf-button.js +55 -0
- package/dist/pdf-config.d.ts +28 -0
- package/dist/pdf-config.js +43 -0
- package/dist/pdf-http.d.ts +36 -0
- package/dist/pdf-http.js +132 -0
- package/dist/pdf-project.d.ts +6 -0
- package/dist/pdf-project.js +31 -0
- package/dist/pdf-renderer.d.ts +45 -0
- package/dist/pdf-renderer.js +208 -0
- package/dist/pdf-site.d.ts +37 -0
- package/dist/pdf-site.js +65 -0
- package/dist/pdf-stylesheet.d.ts +1 -0
- package/dist/pdf-stylesheet.js +57 -0
- package/dist/publication-render.d.ts +2 -1
- package/dist/publication-render.js +2 -2
- package/dist/representation-tree.js +5 -1
- package/dist/server.d.ts +2 -0
- package/dist/server.js +35 -8
- package/dist/vercel.js +6 -0
- package/examples/code-references/content/start.md +53 -0
- package/examples/code-references/docs.config.yaml +262 -0
- package/examples/code-references/python/orchard/__init__.py +11 -0
- package/examples/code-references/python/orchard/client.py +212 -0
- package/examples/code-references/python/orchard/errors.py +31 -0
- package/examples/code-references/python/orchard/models.py +69 -0
- package/examples/code-references/python/orchard/pagination.py +39 -0
- package/examples/code-references/reference.json +1244 -0
- package/examples/custom-language/README.md +32 -0
- package/examples/custom-language/content/start.mdx +28 -0
- package/examples/custom-language/docs.config.yaml +18 -0
- package/examples/custom-language/grammars/custompy.tmLanguage.json +7 -0
- package/examples/pdf/README.md +27 -0
- package/examples/pdf/content/operations.mdx +26 -0
- package/examples/pdf/content/start.mdx +28 -0
- package/examples/pdf/docs.config.yaml +29 -0
- package/examples/pdf/print.css +9 -0
- package/package.json +11 -2
- package/schemas/code-reference.schema.json +306 -0
- package/skills/shoalrun-author/SKILL.md +6 -0
- package/skills/shoalrun-author/references/code-api-references.md +15 -0
- package/skills/shoalrun-author/references/pdf-export.md +15 -0
- package/skills/shoalrun-brand/SKILL.md +2 -0
- package/skills/shoalrun-pdf/SKILL.md +49 -0
- package/skills/shoalrun-pdf/assets/print.css +49 -0
- package/skills/shoalrun-pdf/references/print-design.md +75 -0
- package/styles/site.css +64 -3
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"""Typed errors an application can handle without inspecting error messages."""
|
|
2
|
+
|
|
3
|
+
class APIError(Exception):
|
|
4
|
+
"""Base error for unsuccessful API operations.
|
|
5
|
+
|
|
6
|
+
Handle a more specific exception when your application can recover from it.
|
|
7
|
+
Use `request_id` when reporting a failed request to an operator.
|
|
8
|
+
"""
|
|
9
|
+
def __init__(self, message: str, *, request_id: str | None = None):
|
|
10
|
+
super().__init__(message)
|
|
11
|
+
self.request_id = request_id
|
|
12
|
+
|
|
13
|
+
class AuthenticationError(APIError):
|
|
14
|
+
"""The API key is missing, expired, or invalid.
|
|
15
|
+
|
|
16
|
+
Refresh the credential before retrying the request. Repeating the same
|
|
17
|
+
request with the same invalid credential won't resolve this error.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
class NotFoundError(APIError):
|
|
21
|
+
"""The requested record doesn't exist or isn't visible to the API key."""
|
|
22
|
+
|
|
23
|
+
class RateLimitError(APIError):
|
|
24
|
+
"""The service rejected a request because its rate limit was reached.
|
|
25
|
+
|
|
26
|
+
Wait for `retry_after` seconds before retrying. Add jitter when multiple
|
|
27
|
+
workers share the same credentials.
|
|
28
|
+
"""
|
|
29
|
+
def __init__(self, message: str, *, retry_after: float, request_id: str | None = None):
|
|
30
|
+
super().__init__(message, request_id=request_id)
|
|
31
|
+
self.retry_after = retry_after
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"""Typed request and response models for the records API."""
|
|
2
|
+
from dataclasses import dataclass, field
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from enum import Enum
|
|
5
|
+
from typing import TypedDict
|
|
6
|
+
|
|
7
|
+
class RecordStatus(str, Enum):
|
|
8
|
+
"""Processing status reported by a record.
|
|
9
|
+
|
|
10
|
+
A record moves from `pending` to `ready` after processing completes.
|
|
11
|
+
Failed records retain their identifier so an application can retry them.
|
|
12
|
+
"""
|
|
13
|
+
PENDING = "pending"
|
|
14
|
+
"""The record is waiting for processing."""
|
|
15
|
+
READY = "ready"
|
|
16
|
+
"""The record can be read by applications."""
|
|
17
|
+
FAILED = "failed"
|
|
18
|
+
"""Processing failed and needs a retry."""
|
|
19
|
+
|
|
20
|
+
class RecordDict(TypedDict):
|
|
21
|
+
"""Wire representation returned when `Client.fetch(raw=True)` is used."""
|
|
22
|
+
id: str
|
|
23
|
+
"""Stable record identifier."""
|
|
24
|
+
title: str
|
|
25
|
+
"""Human-readable record title."""
|
|
26
|
+
status: str
|
|
27
|
+
"""Processing state encoded as a string."""
|
|
28
|
+
|
|
29
|
+
@dataclass(frozen=True)
|
|
30
|
+
class RecordInput:
|
|
31
|
+
"""Input used to create a record.
|
|
32
|
+
|
|
33
|
+
Provide a title and optional labels. Labels let applications group records
|
|
34
|
+
without encoding business rules into the record identifier.
|
|
35
|
+
"""
|
|
36
|
+
title: str
|
|
37
|
+
"""Title to display to readers."""
|
|
38
|
+
labels: dict[str, str] = field(default_factory=dict)
|
|
39
|
+
"""Application-defined labels, such as `team` or `environment`."""
|
|
40
|
+
|
|
41
|
+
@dataclass(frozen=True)
|
|
42
|
+
class Record:
|
|
43
|
+
"""A record returned by the service.
|
|
44
|
+
|
|
45
|
+
Records are immutable snapshots. Fetch the record again to observe a new
|
|
46
|
+
processing status rather than changing its fields locally.
|
|
47
|
+
"""
|
|
48
|
+
id: str
|
|
49
|
+
"""Stable identifier used in fetch and update operations."""
|
|
50
|
+
title: str
|
|
51
|
+
"""Human-readable title."""
|
|
52
|
+
status: RecordStatus = RecordStatus.READY
|
|
53
|
+
"""Current processing state."""
|
|
54
|
+
labels: dict[str, str] = field(default_factory=dict)
|
|
55
|
+
"""Application-defined key/value labels."""
|
|
56
|
+
created_at: datetime | None = None
|
|
57
|
+
"""Creation time in UTC, if reported by the service."""
|
|
58
|
+
|
|
59
|
+
def to_dict(self) -> RecordDict:
|
|
60
|
+
"""Convert a record to its compact wire representation.
|
|
61
|
+
|
|
62
|
+
Returns:
|
|
63
|
+
A mapping with the identifier, title, and string status.
|
|
64
|
+
|
|
65
|
+
Examples:
|
|
66
|
+
>>> Record("rec_42", "Example").to_dict()
|
|
67
|
+
{'id': 'rec_42', 'title': 'Example', 'status': 'ready'}
|
|
68
|
+
"""
|
|
69
|
+
return {"id": self.id, "title": self.title, "status": self.status.value}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"""Generic containers and cursor helpers for paginated responses."""
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
from typing import Callable, Generic, TypeVar
|
|
4
|
+
|
|
5
|
+
T = TypeVar("T")
|
|
6
|
+
U = TypeVar("U")
|
|
7
|
+
|
|
8
|
+
@dataclass(frozen=True)
|
|
9
|
+
class Page(Generic[T]):
|
|
10
|
+
"""One page of results and the cursor needed to continue reading.
|
|
11
|
+
|
|
12
|
+
Keep the cursor opaque. Pass it back to `Client.list_records` instead of
|
|
13
|
+
decoding it or building a cursor from a record identifier.
|
|
14
|
+
"""
|
|
15
|
+
items: list[T]
|
|
16
|
+
"""Results included in this response."""
|
|
17
|
+
next_cursor: str | None = None
|
|
18
|
+
"""Continuation cursor, or `None` when this is the final page."""
|
|
19
|
+
total: int | None = None
|
|
20
|
+
"""Total result count when the service can provide one."""
|
|
21
|
+
|
|
22
|
+
@property
|
|
23
|
+
def has_more(self) -> bool:
|
|
24
|
+
"""Whether another page is available."""
|
|
25
|
+
return self.next_cursor is not None
|
|
26
|
+
|
|
27
|
+
def map(self, transform: Callable[[T], U]) -> "Page[U]":
|
|
28
|
+
"""Transform every item while preserving pagination metadata.
|
|
29
|
+
|
|
30
|
+
Args:
|
|
31
|
+
transform: Function applied once to each item in this page.
|
|
32
|
+
|
|
33
|
+
Returns:
|
|
34
|
+
A new page containing transformed items and the same cursor.
|
|
35
|
+
|
|
36
|
+
Examples:
|
|
37
|
+
>>> page.map(lambda record: record.title)
|
|
38
|
+
"""
|
|
39
|
+
return Page([transform(item) for item in self.items], self.next_cursor, self.total)
|