API reference
746 exported symbols.
Classes
| c CommitsUnavailable | GitHub can't be asked right now: the shared pause holds, this reader's requests are spent, or GitHub failed. |
| c ConfigDecodeFailed | |
| c ConfigImportFailed | |
| c ConfigNotFound | |
| c PluginAggregateError | |
| c PluginHookError | |
| c PluginValidationError | |
| c ProtectedSession | Keep decrypted group data and non-exportable keys only for this page session. |
| c ProtectionAuthenticationError | |
| c ProtectionFormatError | |
| c ReferencePageError | |
| c ThemeSelectionError | |
| c ThemeValidationError | |
| c VaultBuildRootConflict | |
| c VaultBuildRootResolutionFailed | |
| c VaultIdConflict | |
| c VaultIdNotFound | |
| c VaultMountConflict | |
| c VaultPathInvalid | |
| c VaultPluginInvalid | A plugin's `forVault` refused the site, such as an `auth` whose `callbackVault` names no vault with auth. |
Interfaces
| i Account | A person on the site: one account, however many providers they sign in with. |
| i AccountStanding | An account as a page about it shows it: who it is, its user page and its reputation. |
| i Agreement | Someone who agreed with a comment with **+1**. |
| i Anchor | How a passage is found again: its quote, the text around it, and where it last was. |
| i AnnotationsOptions | The `annotations` plugin's options. |
| i AnnotationsServerOptions | What the server module receives: the options with every default filled in. |
| i ApiDocsThemeConfig | The vault's `theme` settings for API docs. |
| i ApiParameter | |
| i ApiResponse | |
| i Artifact | |
| i AssetRecord | |
| i AttachOptions | |
| i AuditEntry | One change, as the log keeps it. |
| i AuditLogPage | |
| i AuditQuery | Which entries `readAuditLog` answers. |
| i AuditRecord | An entry as `readAuditLog` answers it. Every string is as its writer stored it: escape it to show it. |
| i AuthOptions | The `auth` plugin's options. |
| i AuthServerData | What the plugin's build hook records for the server module. |
| i AuthServerOptions | What the server module receives: the options, plus where sign-in runs when another vault runs it. |
| i BlogThemeConfig | The vault's `theme` settings for the blog: minimal's, plus header links. |
| i Breadcrumb | |
| i BrowserOptions | What the browser script receives: where history pages are, and which pages have one. |
| i BrowserOptions | Settings the browser script receives. |
| i BrowserResource | Browser import contributed by an active content plugin. Script modules export `mount(pathname)` and return an optional disposer. |
| i BrowserScriptContext | Where the site is served, for scripts that build URLs, such as a server plugin's `<base>/_svartz/<id>/`. |
| i BrowserScriptLoader | |
| i BrowserScriptModule | Lifecycle contract for a script contributed by a content plugin. |
| i BuildData | What the build tells the server about the vault. |
| i BuildData | What the build records for the server: never sent to the browser. |
| i ChangeEvent | |
| i CitationOptions | |
| i CodeTab | One tab of a `CodePanel`. |
| i CommentsSettings | Giscus settings a theme passes to `Comments`. |
| i Commit | A commit on the content branch. |
| i CommitReader | Reads one request's worth of commits. Make one per request with `commitReader`. |
| i CommitSource | What reading a vault's commits takes: JSON, for the reader's server data. Holds no secret, only where they are. |
| i CompiledNoteVersion | What `compileNoteVersion` answers. |
| i CompilerContributions | Compiler steps and browser imports collected afresh for each pipeline run. |
| i Composition | A composed site's themes: the first styles the site; all of them render pages. |
| i ContentComponentProps | Props passed to a content override after Markdown plugins finish parsing. |
| i ContentView | HTML shown through a page's content components, from `BrowserScriptContext.mountContent`. |
| i DashboardContribution | What a plugin adds to the dashboard: a heading for its panels, and the panels. |
| i DashboardPanel | A tool or settings screen a plugin adds to the site's dashboard, at `/-/dashboard/<plugin id>/<panel id>/`. The dashboard shows it only to viewers who hold `permission` on the vault, and checks that again on every render. |
| i DashboardSection | One plugin's panels, as `ServerContext.dashboard` lists them. |
| i DefaultThemeOverrideHints | Default Tailwind theme override keys for better tab completion / IntelliSense when customizing theme. Schema validation accepts any Tailwind theme keys; this type hints the common ones. Theme packages (e.g. @svartz/theme-minimal) can export their own override type for even better hints. To narrow the `theme` property, add a JSDoc |
| i DestinationResponse | `GET <endpoint>/destination/?folder=<folder>&title=<title>` answers this for a new page. |
| i DocsThemeConfig | The vault's `theme` settings for package docs. `routes.folders: "api"` reads well for module pages. |
| i DocSymbol | The `symbol` frontmatter schema: one exported symbol per note, written by hand or generated from types. Signatures, types, `extends`, `implements`, and defaults may use `[[Name]]` or `[[path/to/Name|Name]]` to link to other symbols. |
| i EditRequest | `POST <endpoint>/edit/` takes this JSON body. |
| i EnvReference | Names a server environment variable in place of an inlined secret. |
| i ErrorResponse | Every failure answers with this JSON body; `message` is written for the reader. |
| i ExplorerItem | How a page lists in the explorer when a theme renders it specially: a fixed-width badge beside a monospace label. |
| i ExplorerNode | |
| i FolderIndexEntry | |
| i FolderLayout | |
| i FolderSection | |
| i FrameProps | A frame lays out the regions; minimal's is three columns. |
| i GraphqlOperation | |
| i GraphTarget | Rich graph node for UI consumers (projection of Index). |
| i HookExecutionResult | |
| i HostDiscoveryVault | Published vault data used by an opt-in host feed or sitemap. |
| i HostFeedOptions | |
| i HostNoteOptions | A note in a host app's vault, which locates its annotations without spelling out the route or key. |
| i HostStyleManifest | Generated runtime entry points and the CSS manifest for one host vault. |
| i Identity | Who is signed in. Nothing else about the account is kept, and provider tokens never outlive the callback. |
| i IdentityGrant | A grant a plugin's config gives an identity, such as a moderator it lists, to move onto that identity's account. |
| i Index | Canonical index artifact produced by `core:index`. Single source of truth for search, backlinks, and graph projections. |
| i IndexEntry | |
| i IndexLink | |
| i Infobox | The `infobox` frontmatter schema. Plugins that generate wiki pages emit this shape. |
| i InfoboxSection | |
| i JsonRpcError | A JSON-RPC error: the server rejected the request, so there is no tool result. |
| i LinkSegment | |
| i LinksResponse | `GET <endpoint>/links/` answers this: the published notes, never password-protected or hidden ones, and the attachments the site publishes. |
| i LinkTarget | A published note a wikilink can name. The Split preview resolves links to it by `slug`, `path` and `aliases`, as the build does, and links them to `href`. |
| i LogoSettings | The site's mark beside its title. `dark` replaces `src` in dark mode; `alt` is empty because the title names the site. |
| i McpDocsThemeConfig | The vault's `theme` settings for MCP docs. |
| i McpTool | An MCP tool page, from `operation` metadata with `protocol: mcp`. |
| i McpToolAnnotations | Behaviour hints a server declares for a tool. They describe the tool; a client can't rely on them for safety, since any server can claim them. |
| i McpToolExample | One `tools/call` example: the arguments, and the result or JSON-RPC error that came back. |
| i McpToolResult | A `tools/call` result. `isError` marks a tool that ran and failed; the call itself succeeded. |
| i MinimalRouteConfig | Route prefix configuration: keys become URL path segments. |
| i MinimalThemeConfig | The vault's `theme` settings for minimal. |
| i ModerationOptions | The `moderation` plugin's options. |
| i ModerationServerOptions | What the server module receives: the options with every default filled in. |
| i MountOptions | What the plugin's browser resource receives from the build. |
| i NewPageRequest | `POST <endpoint>/new/` takes this JSON body. The server derives the file path from `folder` and `title`. |
| i NormalizedSvartzPlugin | |
| i OxHugoOptions | |
| i PageChoice | The theme that renders a page, and the renderer and data when one of its renderers claimed the page. Plain notes in the primary theme have no choice. |
| i PageContext | Per-request facilities handed to a plugin's page renderer. |
| i PageRenderer | Renders one kind of page, chosen from the page's frontmatter: an endpoint from `operation`, a symbol from `symbol`, a wiki article from `infobox`. |
| i PermissionDeclaration | A permission a plugin checks with `can()` from `@svartz/auth/server`. `defaults` are the site-wide grants to the built-in actors (`guest` is everyone, `signed-in` everyone with an account) until a stored grant says otherwise. |
| i PluginContext | |
| i PluginPage | A plugin page's content. The theme shell renders `html` as the page body, under its header and beside its explorer. |
| i PostMeta | Post frontmatter. Everything is optional: |
| i PresentationOptions | |
| i PreviewNote | A published note a preview's links can name. |
| i PreviewOptions | |
| i ProcessedFile | A file passing through the plugin pipeline. |
| i ProtectedEnvelope | |
| i ProtectedGroupPayload | Browser session state for independently unlocked password groups. |
| i ProviderOptions | One provider's OAuth app. The secret is named by environment variable, never inlined. |
| i PublicProfile | A person's public profile, as their handle reaches it. |
| i RateLimitOptions | |
| i RawLink | A link extracted from markdown before resolution. Mirrors vault's LinkMatch — kept Effect-free for plugin authors. |
| i Reaction | One of the site's drawn reactions. |
| i ReadingStop | A stop in reading order: a folder's page, or a note. |
| i ReferenceAuth | How a page authenticates: `auth: bearer`, or `auth: { scheme, description, scopes }`. |
| i ReferenceBadge | A fixed-width kind badge: an HTTP method, a GraphQL kind, `TOOL`, `SCHEMA`. |
| i ReferenceContext | What every renderer component receives besides its page data. |
| i ReferenceExamplesProps | |
| i ReferenceNavItem | How a page lists in the sidebar and on listing pages. |
| i ReferencePageProps | |
| i ReferencePageRenderer | A page renderer that wraps a reference renderer; its shape is theme-minimal's `PageRenderer`. |
| i ReferenceRenderer | Renders one kind of reference page. A page picks its renderer with explicit metadata: `operation.protocol: <id>`, or a `model` block for the `schema` renderer. Pages with neither are guides. |
| i ReferenceRouteConfig | Route prefixes. The pipeline reads the same keys. |
| i ReferenceShell | The part of theme-minimal's shell state reference pages read. |
| i ReferenceShellProps | |
| i ReferenceSource | Where a page's subject is defined: a source file or line. |
| i ReferenceThemeConfig | The vault's `theme` settings every reference theme reads. Renderers read their own keys too. |
| i ReferenceThemeIdentity | Who a reference theme is. |
| i RegionProps | |
| i RendererProps | |
| i ReportedComment | A comment as a report about it shows it to moderators, hidden or not. |
| i ReportRequest | `POST <endpoint>/reports/` takes this JSON body and answers 201 with `{ report: { id } }`. |
| i ResolvedBuildConfig | |
| i ResolvedCallout | |
| i ResolvedConfig | Canonical single-vault build config consumed by the runner and @svartz/vite. |
| i ResolvedConfigSet | Internal multi-vault resolved config set used by config resolution helpers. Defaults are merged into each vault, while build defaults remain available here. |
| i ResolvedDiscoveryConfig | |
| i ResolvedFrontmatterConfig | |
| i ResolvedSiteConfig | |
| i ResolvedThemeConfig | |
| i ResolvedVaultDefaults | |
| i RestOperation | |
| i Restore | One page's content to commit back. |
| i Restorer | Commits for one request. Make one per request with `restorer`. |
| i Reversal | Taking back what an `edit` or `page` event earned, when the content it scored for is undone. |
| i RoamOptions | |
| i RouteHolder | The page holding a route: its slug, which permissions are checked on, and its URL below the deployment base, `null` when hidden. |
| i RouteIndex | |
| i RunnerResult | |
| i RuntimeRouteInput | |
| i RuntimeRouteMatch | |
| i SavedEdits | The edits a vault's site saved among those asked about, each with the id of the account that saved it, or `null`. |
| i SchemaNode | The JSON Schema subset reference pages render. `$ref` names a schema page (`$ref: Pet`); `#/components/schemas/Pet` and `#/$defs/Pet` also name `Pet`. |
| i SchemaProperty | |
| i SearchDocument | |
| i SearchDocument | A published note as the artifact producer stores it for search. |
| i SearchHit | |
| i ServerContext | Per-request facilities handed to a server plugin's handler. |
| i ServerHandleEvent | The parts of SvelteKit's `RequestEvent` the router reads. |
| i ServerHandleRuntime | Runtime inputs SvelteKit supplies to the generated registry. |
| i ServerModule | What a server factory builds when it renders pages or panels: its request handler, its page renderer and its panels. |
| i ServerModuleSpec | A plugin's server module and the JSON options its factory receives. |
| i ServerRegistry | What a build knows about its server plugins; `virtual:svartz/server` exports one per vault. |
| i ServerRoute | One active server plugin in a generated registry. |
| i ServerVaultSettings | Public settings of the vault a server plugin belongs to. |
| i SettingsLink | |
| i ShellState | Everything minimal works out once per page and hands to every region, so a theme that swaps a region keeps minimal's behaviour. |
| i SignInConfig | What the dialog needs from the vault's `auth` config. |
| i SignInProvider | |
| i SiteVaults | Every vault in the config, and the one a `SvartzPlugin.forVault` call resolves the plugin for. |
| i SocialImageMetadata | Public metadata a theme may place on a generated social preview. |
| i SocketMessage | One kind of WebSocket message, by who sends it: the client (`send`) or the server (`receive`). |
| i SourceResponse | `GET <endpoint>/source/?page=<href>` answers this. |
| i Standing | Where an account stands: its score, and the next threshold whose role it doesn't hold, if any. |
| i SubmissionsOptions | |
| i SuspendedAccount | A suspended account, as a list of them shows it. |
| i Suspension | Why an account is suspended, and until when; read by the account itself and by moderators. |
| i SuspensionSubject | An account as a moderator about to act on it sees it. |
| i SvartzPlugin | |
| i SvartzServer | Serves a vault's server plugins: SvelteKit's `handle`, and the `load` of the route that renders plugin pages. |
| i SvartzTheme | |
| i SvartzViteContext | |
| i SvartzVitePluginOptions | |
| i SymbolMember | |
| i SymbolParameter | |
| i TagIndexEntry | |
| i TargetConfig | |
| i TextSegment | |
| i ThemeArtifactRequirements | Declares which pipeline artifacts the theme needs. `search` and `toc` are derived from the canonical `index` — not independent. |
| i ThemeBuildExtension | The Node-safe part of an extension, for the build: no components. |
| i ThemeChrome | Minimal's optional furniture. |
| i ThemeComponentRegistry | Named component entries the theme provides for the runner/shell. All entries are optional; custom components extend via the index signature. |
| i ThemeExtension | What a theme adds to theme-minimal. Everything is optional: minimal itself is the empty extension. In a composition the first extension's frame, regions, list pages, and chrome style the site; every extension's renderers render pages. |
| i ThemeIdentity | Who a composed theme is. Defaults to the first extension's identity. |
| i ThemeLayoutMap | Maps named layout slots to component loaders. Required: `defaultPage` and `notePage`. Custom slots are extensible via the index signature. |
| i ThemePageProps | Props every theme layout and page component receives from the Svartz runtime (`SvartzVaultPage`). Layouts also get `children`; pages also get `contentComponents`. Prefer `vault`: its URLs include the deployment base. |
| i ThemePluginPreset | Plugins the theme ships with. Merged into the pipeline using standard plugin merge semantics: replace by id if existing, append if new. |
| i ThemeRenderCapabilities | Declarative flags indicating what the theme can render. |
| i ThemeRouteDefinition | |
| i ThemeRouteMatch | The route the runtime matched for this page. |
| i ThemeSettings | Settings every first-party theme reads from the vault's `theme` config. |
| i Threshold | A threshold: reaching `score` gives the account `role`. |
| i TocEntry | |
| i TurnstileOptions | The submission guard. Every submission passes a rate limit, keyed by the signed-in identity or else the client's IP, and is refused when it has neither. When sign-in is required, anonymous submissions are refused; otherwise, when Turnstile is configured, they must also carry a token Cloudflare verifies. Runs before any GitHub call. |
| i UiFolderEntry | |
| i UiIndexEntry | |
| i UiTagEntry | |
| i UserPageLocation | Where user pages live: a folder of one vault. Without a `vault`, no page is a user page. |
| i VaultNoteView | |
| i VaultRecords | Where a vault's sync keeps its records: the D1 binding, the repository, and the vault's folder in it. |
| i VaultView | Published, vault-scoped data for SvelteKit loaders and theme components. |
| i WebSocketOperation | A WebSocket endpoint: the upgrade request's parameters and responses, then the messages over the open socket. |
Types
| t AnalyticsConfig | Public analytics settings shipped to the browser only when selected by a consumer. |
| t AnalyticsConfig | |
| t Annotation | A comment or reaction on a passage, as `GET <mount>/_svartz/annotations/?page=` lists it. |
| t ApiOperation | The `operation` frontmatter schema, one endpoint or GraphQL field per note. An OpenAPI or GraphQL SDL plugin emits this shape. |
| t ArtifactBag | |
| t BadgeHue | A signal hue from the design tokens (`--sv-hue-<name>`), or `neutral`. |
| t CalloutType | |
| t ColorMode | |
| t ConfigError | |
| t ContentComponentOverrides | |
| t ContentComponents | |
| t ContentComponentSlot | |
| t ContentSlot | Which content slot (callout, code block, image, link, embed) renders each element of a note's HTML tree, the props that slot's component receives, and the attributes that survive sanitizing. The build compiles notes with it (`compileContent`), and `@svartz/ui` renders a preview in the browser with it, so both treat a tree the same way. |
| t CorePluginId | |
| t Credentials | Exactly one kind of GitHub credentials: a token, or a GitHub App. |
| t CustomDomainRoute | |
| t DateSource | |
| t Destination | Where a save goes for the reader asking: `commit` straight to the branch, so it goes live with the next deploy, or `pull-request`, for review. `null` when they can't save there as they are now, such as a guest who must sign in. |
| t DevBindings | What `svartz dev` stores in `DEV_BINDINGS`: resolves the bindings, vars and `.dev.vars` of the app's Wrangler config. |
| t DiscoveryConfig | |
| t EditResponse | |
| t FileAt | The content at a commit, or why there is none to show. |
| t FrontmatterFields | |
| t Graph | |
| t HistoryOptions | How a vault's history is read. |
| t HookOptions | |
| t LiftResult | What `liftSuspension` did. |
| t LinkKind | |
| t LinkResolutionStrategy | |
| t LinkResolutionStrategy | |
| t ListPageName | The list pages a theme can provide; each receives the usual page props. |
| t MaybePromise | |
| t McpContentBlock | One MCP content block, as the server sends it: `text`, `image`, `audio`, `resource_link`, or `resource`. |
| t Mode | Which saves may commit. `permission` commits for whoever holds `submissions:commits:write` on the page and opens a pull request for the rest; `commit` refuses the rest instead; `pull-request` never commits. |
| t PageRenderer | Renders a GET of one of the plugin's pages; `undefined` answers 404. Pages render on every request and are never prerendered or cached. Forms on them post to the plugin's `/_svartz/<id>/` routes, which redirect back. |
| t PageResult | What a page renderer answers: the page, or a same-site path to send the reader to instead. |
| t PermissionAction | What a permission lets someone do. |
| t PermissionSlug | `namespace:feature:action`, where the namespace is the declaring plugin's id: `annotations:comments:delete`. |
| t PermissionTarget | What a check is about: the whole site (`{}`), a vault, or a page of one, by its slug. |
| t PluginChangeHook | |
| t PluginChangeHookInput | |
| t PluginError | |
| t PluginFactory | |
| t PluginHook | |
| t PluginHookInput | |
| t ProviderId | The sign-in providers `@svartz/auth` supports. Adding one extends `ProviderId`, adds its entry here and its mark in `marks.ts`. |
| t Recipient | Who an entry credits: an account by its id, or the account a provider account (`github:583231`) is linked to. |
| t ReferenceHue | A signal hue from the design tokens (`--sv-hue-<name>`), or `neutral` for kinds that aren't calls. |
| t RegionName | |
| t ReputationEvent | An event that earns points, as a plugin posts it. `ref` names the event, unique within its kind and prefixed with the posting plugin's id (`submissions:…`): posting the same event again changes nothing. |
| t ResolvedConfig | Canonical single-vault resolved build config re-exported from @svartz/core. |
| t ResolvedSvartzConfig | Compatibility alias for code that still refers to the multi-vault bundle. |
| t ResolvedSvartzVirtualModuleId | |
| t ResolvedVaultConfig | Compatibility alias for code that still refers to a resolved vault. |
| t Restored | What `Restorer.restore` did: committed, or why not. `unchanged` when the branch already held the content, `changed` when its file isn't the one the caller read, `protected` when a rule for the branch refuses the commit, `busy` when the branch moved on meanwhile. Only `commit` moved the branch. |
| t RouteClaims | The routes the last build allocated, which a note's frontmatter can claim: JSON, for server data. |
| t RunnerPlugin | |
| t SearchOptions | |
| t ServerHandler | Answers a request under the plugin's prefix. `undefined` answers 404. |
| t ServerModuleFactory | A server module's default export: builds the handler once from the plugin's options and the build data its hooks set in `getCompilerContributions(ctx).serverData` (`undefined` when they set none). A plugin with `pages` answers `{ handle, page }`. |
| t ServerOptions | The plugin's server options, as written into the server bundle. |
| t SignedOutReason | Why `readSignIn` found no account. |
| t SignIn | The signed-in account, or `null` and the reason there is none; for a suspended account, why and until when. |
| t SiteActions | |
| t SiteConfig | |
| t SlideAction | |
| t StageName | |
| t SuspendResult | What `suspend` did: suspended the account, or nothing, because no account has the handle, it's an admin, or it's the actor's. |
| t SvartzConfig | |
| t SvartzDefaults | |
| t SvartzVirtualModuleId | |
| t SymbolKind | |
| t TailwindThemeConfig | |
| t TargetConfig | |
| t TargetKind | |
| t ThemeComponentLoader | Reference to a Svelte component — sync or lazy. |
| t ThemeError | |
| t ThemeFactory | |
| t ThemeImport | What `virtual:svartz/theme` imports: one theme module, or several and the `composeThemes` entry that composes them. |
| t ThemeModule | |
| t ThemeRequiredFeature | |
| t ThemeSources | Local theme ids mapped to their source manifests (`src/lib/index.ts`), so dev loads unbuilt themes. The CLI passes it as JSON in `SVARTZ_THEME_SOURCES`. |
| t ThemeTokens | The vault's `theme.tokens`: any design token by name, with or without the `--sv-` prefix (`accent`, `paper`, `radius-m`, `--sv-font-sans`). Config wins over the theme's own tokens, which win over the Svartz defaults. |
| t ThemeTokenValue | A token value for both colour schemes, or one per scheme. |
| t VaultConfig | |
| t VaultOptions | |
| t VaultThemeConfig | |
| t WranglerAssets | |
| t WranglerBuild | |
| t WranglerConfig | |
| t WranglerConfigFields | |
| t WranglerEnvRecord | |
| t WranglerLimits | |
| t WranglerObservability | |
| t WranglerPlacement | |
| t WranglerRoute | |
| t WranglerTriggers | |
| t ZoneIdRoute | |
| t ZoneNameRoute |
Functions
| f activeContentSlot | The slot that renders `element` inside a tree, where `insideCode` says an ancestor is a code block's figure: the figure's own `<pre>` belongs to it, not to a slot of its own. |
| f allocateRoutesPlugin | Assign final page slugs after publication, before links consume them. |
| f alternateNames | |
| f alternateRoutes | The routes a note's alternate names ask to redirect from, below the vault's mount: `aliases: [Old Name]` asks for `old-name`. `allocateRedirects` grants those still free. |
| f analytics | Contribute one browser tracker only when a vault selects an analytics provider. |
| f annotations | The `annotations` plugin: its routes on the server, and in the browser a script that attaches to every note body a theme marks with `data-svartz-note`, as theme-minimal and every theme extending it do. |
| f assertNoNotesUnderPages | A page name owns `<mount>/-/<name>/` and everything below it, so a published note there would be shadowed at runtime: fail the build naming it. Notes elsewhere under `<mount>/-/` stay notes. `routes` are the vault's published routes, mount path included. |
| f assertRequiredStages | |
| f assertServerPlugins | A server plugin needs a server target (or a host app whose adapter isn't `adapter-static`), a path-segment id, an importable module and JSON options. `hostAdapter` is the host's `kit.adapter.name`. |
| f assetHref | The published URL of an attachment named in a note's frontmatter (`cover: hero.jpg`, `image: portrait.svg`); external URLs pass through. Undefined when the vault didn't publish it. Resolves like the pipeline, which publishes attachments named by top-level `image`, `cover`, and `socialImage`: relative to the note's file, then from the vault root, then by a basename only one attachment has. |
| f attach | Show the annotations stored for `page` beside `content`, the note's body element. Returns `detach`, which removes every marker, card, highlight and list it added. Comments whose passage is no longer in the note are listed after it. |
| f audit | Append `entry` to the audit log. Pass the change itself as `changes`, statements prepared on the same `SVARTZ_DB` binding: they and the entry run as one transaction, so neither lands without the other. For a change kept elsewhere, call this first and make the change only once it resolves. Throws when the site binds no `SVARTZ_DB`, or the write fails. |
| f auditIfChanged | The statement that appends `entry` only when the statement just before it in the batch changed a row, for a change whose own guard may leave it undone. Its results hold the entry's id when it appended one, and nothing otherwise, so the batch's last result says whether the change happened. |
| f auth | The `auth` plugin: sign-in routes on the server and the sign-in dialog in the browser. |
| f authLabel | `Bearer token`, `None`, or the scheme as written. |
| f buildBreadcrumbs | Home, each folder the note sits in, then the note. A folder note ends its own folder's trail instead of repeating it. A slug no folder record places falls back to its own segments. |
| f buildExplorerTree | The vault as a tree: folders first, then notes. Each group sorts by `order` frontmatter, then by a theme's explorer row (`itemOf`), then in natural order by title; a folder takes its folder note's `order`. The home note is left out (the site title links home). A folder links its folder note (`guides/index.md`) when one exists, otherwise its generated folder page. |
| f can | Whether `account` (`null` for a guest) may do `permission` on `target`: the site (`{}`), a vault (`{ vault }`), or a page of one (`{ vault, page }`, by the page's slug). Grants on the page, its folders, its vault and the site apply, the most specific first; see `resolve` in `permissions.ts` for the order. |
| f canEach | `can` for each of `targets`, in order, in the D1 calls one check makes: for a list that asks about many pages at once, such as a queue of comments on different pages. |
| f changedFiles | The vault files each of `commits` (SHAs) changed, as vault paths, for those the mirror of the vault `records` describes holds with their files. In one query; none when the binding is missing. |
| f choosePage | The theme and renderer for a page. The page's own `theme:` wins, then the nearest folder note's (`folderNotes`, nearest first), then whichever renderer detects the page from its frontmatter. A page none of that picks is a plain note in the primary theme, and gets `undefined`. |
| f citations | Resolve bibliography paths from the vault, independent of the host process cwd. |
| f classifyLink | Classify a link in rendered note content. Internal links get previews and the internal style; files, heading anchors, and footnote links stay quiet. |
| f clearPublicAssets | Forget every recorded file. The CLI calls this before each build, so one vault's files never ship in the next's. |
| f commitAttribution | The account a commit is authored as, with its linked GitHub account as co-author, and the App's bot that commits it. |
| f commitReader | Reads commits for one vault. The answer makes a `CommitReader` per request; installation tokens and file contents are kept across requests in this worker. Pass `token` to share one `sourceToken` with a writer. |
| f commitSource | What reading the vault's commits takes, or `undefined` when no submissions plugin keeps its mirror. Call it from `emitArtifacts` with `enforce: "post"`: the vault's folder in the repository is what the submissions plugin's own `emitArtifacts` read from git. |
| f compileNoteVersion | Compiles `markdown`, a version of the published note `note` that sat at `path` in the vault, as the build compiles the note: run `ctx.plugins`' `parseFrontmatter` stage on it alone, then their link, OFM and embed stages on it among the notes and attachments the build publishes, embedding them from the build's own sources, then compile it with the build's compiler steps and any its own content alone needs. The version takes the note's place and route, and links resolve as they do from the note now. |
| f compileProtectedNoteSource | Compile a protected note in memory for the separate encrypted bundle. |
| f composeThemes | A runtime manifest that composes themes on minimal's shell. The first theme styles the site; each page renders with the theme that claims it. |
| f composeThemes | The build manifest for themes composed on minimal: minimal's routes with each theme's build plugins. |
| f compositionOf | The composition a runtime manifest carries; minimal alone for any other manifest. |
| f containsCode | Whether `element`'s descendants are inside a code block, given whether `element` is. |
| f contentProps | The props `slot`'s component gets for `element`, besides its children. |
| f contentSlot | The slot that renders `element`, or `undefined` for plain markup. |
| f count | `1 note`, `3 notes`. |
| f createArtifactsVirtualModuleSource | |
| f createCorePlugins | Create the canonical ordered set of core plugins. Returned array matches the pipeline execution order. |
| f createHostIndexSource | `virtual:svartz/index`: each vault's published index and site metadata, in config order. It imports no page runtime or theme, not even dynamically, so a host that only reads the index never compiles Svartz's page runtime. |
| f createHostRegistrySource | `virtual:svartz/host`: the host eagerly reads route metadata and loads runtime code only for the selected mount. It also exports SvelteKit's `base` and `assets`, which SvelteKit 3's `$app/paths` no longer does. |
| f createHostServerSource | `virtual:svartz/server` in a host app: `svartzHandle` runs every host vault's generated handle in turn, and `svartzPage` asks each vault for the plugin page at a URL. |
| f createProtectionSalt | Generate a fresh salt once per password group and build. |
| f createSearch | Build a query function over the vault's search index. `documents` carries final URLs; the stored index may predate the deployment base, so hrefs come from it. |
| f createServer | Build a vault's `SvartzServer`. Each factory runs once: on its plugin's first request or page, or for an `eager` plugin before the handle answers its first request of any kind. |
| f createServerHandle | The SvelteKit `handle` of `createServer`, for apps that render no plugin pages. |
| f createServerRegistrySource | The vault's server-only module: its active server plugins as a registry; `svartzHandle`, the SvelteKit `handle` that routes `/_svartz/<id>/` to them; and `svartzPage`, which renders their pages under `/-/` for the plugin page route's `load`. `virtual:svartz/server` is this module in the standalone shell; host apps get one that chains every vault's. Its env imports keep it out of client bundles. `serverData` is what each plugin's hooks recorded for its server module this build, keyed by plugin id. |
| f createSvartzViteContext | |
| f createThemeVirtualModuleSource | Generates the `virtual:svartz/theme` module source. |
| f createVaultChangeEvent | |
| f createVaultEntryView | Apply the deployment base to one published entry, including a newly unlocked hidden note. |
| f createVaultView | Compose SvelteKit's deployment base with the index's vault-mounted URLs once. |
| f currentColorMode | The mode the page currently renders in. |
| f decodeRoutePath | Decode a percent-encoded URL pathname once; preserve slashes and return undefined for malformed escapes. |
| f default | Node-safe manifest used by the build pipeline. |
| f default | Node-safe manifest used by the build pipeline. |
| f default | Node-safe manifest used by the build pipeline. |
| f default | Node-safe manifest used by the build pipeline. |
| f default | Node-safe manifest used by the build pipeline. |
| f default | Node-safe manifest used by the build pipeline. |
| f defineConfig | |
| f definePageRenderer | Keeps a renderer's data type flowing from `detect` to its components. |
| f definePlugin | Wrap a plugin factory with runtime validation and hook normalization. The returned factory produces normalized plugins ready for the runner. |
| f defineRenderer | Keeps a renderer's data type flowing from `read` to `nav`, `page`, and `examples`. |
| f defineTheme | Define a theme with runtime validation. Accepts either a static theme object or a factory function. Returns a callable factory that validates the manifest on each invocation. |
| f deriveProtectionKey | Derive a non-exportable session key from a password and the group's public salt. |
| f discoverFiles | core:discover-files — traverse vault directory, read file contents, assign slugs. |
| f emitArtifacts | |
| f emitDiscovery | |
| f emitImages | |
| f exampleFromSchema | A representative value: the schema's example, then its default, its first enum value, then a placeholder by type. |
| f excerpt | About `words` words of `content`, centred on the first matched term. |
| f executeHandleChange | |
| f executeStage | |
| f extractFrontmatter | Markdown parsing utilities — ported from @svartz/vault parse.ts. Kept Effect-free for plugin authors. |
| f fetchPreview | Cloned preview nodes for `href`. IDs get a prefix so previews never collide with the host page's headings; `scrollTarget` finds the linked heading inside them. |
| f filterUnpublished | |
| f findComment | Comment `id` of `vault`, hidden or not, from the annotations stored in the D1 binding named `database`: what the moderation plugin shows beside a report about it. `undefined` when there's no such comment, or no such binding. |
| f findComments | `findComment` for each of `ids` in one query, by id, for a list of reports: ids with no such comment are absent, and so is every id when there's no such binding. |
| f findProfile | The public profile of the account that holds or held `handle`, under its current handle; `undefined` when no account ever held it or the site binds no `SVARTZ_DB`. A result whose `handle` differs from the one asked for means the asked one is old: redirect to the current one. Old handles never pass to another account. |
| f findProfileByIdentity | The public profile of the account provider account `identity` (such as `github:583231`) is linked to, for a plugin that stored who wrote something by their sign-in; `undefined` when no account has it or the site binds no `SVARTZ_DB`. |
| f findProfiles | The public profiles of the accounts with ids `ids`, by id, for plugins that stored an account id, such as a commit's `Svartz-Account` trailer. Ids no account has are absent, and so is every id when the site binds no `SVARTZ_DB`. |
| f findProfilesByHandle | `findProfile` for each of `handles` in one D1 call, by the handle asked for; handles no account ever held are absent, and so is every one when the site binds no `SVARTZ_DB`. |
| f findProfilesByIdentity | `findProfileByIdentity` for each of `identities` in one D1 call, by identity; identities no account has are absent. |
| f findStanding | The account that holds or held `handle`, under its current handle, with its user page and reputation; `undefined` when no account ever held it or the site binds no `SVARTZ_DB`. |
| f findSuspension | The account that holds or held `handle`, for a moderator about to suspend it or lift its suspension; `undefined` when no account ever held it or the site binds no `SVARTZ_DB`. |
| f folderBreadcrumbs | Home, then each folder down to `folder` (a folder page's trail). |
| f folderContents | Every note under a folder, nested ones included, plus its direct subfolders. The folder's own note (`log/index.md`) is its page, not an item. |
| f folderLayout | Where each note's file sits, read from the index's folder records. Slugs can't tell: when two files want one URL, one gets a suffix (`guides/index.md` may publish as `guides-2`), and a root `guides.md` may hold the folder's slug. |
| f folderTheme | The theme that lists a folder's page: the folder note's `theme:`, then its ancestors' (`folderNotes`, nearest first), then the primary theme. |
| f formatDate | Format a note date as `Sep 4, 2026`. Dates are calendar days, so format in UTC. |
| f formatReputation | `score` as the badge shows it: whole points, grouped (`1,234`), and shortened past ten thousand (`12.3K`). |
| f getCompilerContributions | |
| f getGeneratedArtifactsRoot | |
| f getGeneratedHostIndexPath | |
| f getGeneratedHostRegistryPath | |
| f getGeneratedHostServerPath | |
| f getGeneratedHostStylesPath | Use a fixed-length lowercase digest so every valid ID fits a filesystem filename. |
| f getGeneratedIndexModulePath | |
| f getGeneratedPageModulePath | |
| f getGeneratedPagesRoot | |
| f getGeneratedRuntimeArtifactsModulePath | |
| f getGeneratedRuntimeServerModulePath | |
| f getGeneratedRuntimeThemeModulePath | |
| f getGeneratedSearchModulePath | |
| f getPackageVersion | Get the `version` from a package.json. Accepts either: - A module URL (e.g. `import.meta.url`): finds the package.json for that module's package by walking up from the file. - A path to package.json (e.g. `resolve(__dirname, "../package.json")`): reads that file directly. |
| f getThemePresetPlugins | |
| f getVault | |
| f getVaultBuildRoot | |
| f groupAtBreaks | Split nodes into slides at each break. The breaks go, and so do slides with only blank nodes. |
| f hardLineBreaks | Turn prose newlines into `<br>` only when this plugin is configured. |
| f highlight | Split text into matched and plain runs, so results render highlights without HTML. |
| f history | Page history. By default, page history and Recent changes as plugin pages, and a History action on every published Markdown page. With `source: "git"`, prerendered previous versions of the notes that ask for them, on any target. |
| f hostStylesPlugin | Capture CSS from SvelteKit's client build without importing every vault runtime eagerly. |
| f indexContent | core:index — single canonical index artifact producer. |
| f isNote | |
| f isoDate | ISO date for `<time datetime>`. |
| f isPluginEnabled | |
| f isRecord | |
| f isSvelteKit3 | Whether the app in `root` installs SvelteKit 3 or later. Its options can't tell: SvelteKit 2.62 and later also take them in `sveltekit({ … })`. An app without a resolvable SvelteKit counts as SvelteKit 2, whose behaviour Svartz assumed before SvelteKit 3. |
| f isUnsafeElement | Whether `element` is dropped, children and all. |
| f isVaultSubmission | Whether pull request `number` is a submission the site saved for the vault `records` describes: what that vault's `POST close/` accepts. `false` when the binding is missing. The moderation plugin asks before it offers Close. |
| f keepsAttachment | Whether the build may publish the attachment at `path` inside the vault: discovery reads its folder and the exclude patterns let it through. The build publishes it only once a published note references it. |
| f liftSuspension | End the suspension in force on the account that holds or held `handle` now, ahead of its time. `"not-suspended"`, recording nothing, when none is in force, as when it ended or another moderator lifted it first. Throws without `SVARTZ_DB`. |
| f linkedIdentities | Every provider account linked to `account`, the first linked first, each with the profile it last signed in with. Empty when the site binds no `SVARTZ_DB`. `env` is the handler's `context.env`. |
| f listSuspensions | Every suspension in force, the most recent first; `[]` without `SVARTZ_DB`. |
| f listVaults | |
| f loadConfig | |
| f loadConfigEffect | Load, import, and parse a svartz config file. Returns the parsed SvartzConfig and the directory containing the config file. |
| f loadThemeModule | The vault's build manifest. A `theme.base` list composes every listed theme's `extensions` with theme-minimal's `composeThemes`; a theme with a selected source loads unbuilt. |
| f loadVirtualModule | |
| f markdownCopyFor | The emitted Markdown copy of the page at a request `pathname`, if it has one. Map keys are decoded and end in a slash; request paths arrive percent-encoded, and without the slash under `trailingSlash: 'never'`. |
| f matchThemeRoute | |
| f materializeTheme | Load every theme component before server rendering or hydration begins. |
| f mergePlugins | Layered merge of plugin lists. |
| f mergeProtectedIndex | Merge only unlocked, listed group discovery into a browser-local vault index. |
| f migrateGrants | Give each identity's account its grant, once ever: the first call that finds the identity linked to an account stores the grant, unless that account already holds one for the same permission and object, and records that it did. Later calls change nothing, so a grant an admin changed or removed since stays that way. Answers, per grant, whether it is in place: `false` for an identity with no account yet, which a later call can still move once they sign in, and for every grant when the site binds no `SVARTZ_DB`. |
| f mirrorsCommits | Whether one of a vault's `plugins` is a submissions plugin keeping the GitHub mirror. For a plugin's `forVault`. |
| f moderation | The `moderation` plugin: its routes and Reports panel on the server, and the Report action in the browser. |
| f mount | |
| f mount | Browser resource entry, which Svartz calls after every navigation: attach to the note body marked with `data-svartz-note="<slug>"`, keyed by that slug. On a host page that is the `SvartzNoteContent` body the mount is for, so each of several notes gets its own; on a theme page, the document's. A page without one gets nothing. |
| f mount | Browser script entry: remember the vault's config, open the dialog from `data-svartz-sign-in` elements, and link a signed-in reader to their account and the dashboard. The build doesn't know a host app's `paths.base`, so the routes get the deployment base here, from `context`. |
| f mount | Browser script entry: answer `data-svartz-report` buttons, and add **Report** to a note's page actions. The build doesn't know a host app's `paths.base`, so the routes get the deployment base here, from `context`. |
| f mount | Adds Edit to the page actions of every editable note, New page to the site actions of every page, Create your page to the account page of a reader without a user page, and Edit page to a submission in My submissions while it takes follow-up edits. The editor itself loads on first use, or at once when the reader comes back from signing in with a draft for this page. On a submission, it also keeps an unsent reply while its form posts. |
| f mount | Listen for the start key on every page; a navigation closes any open presentation. |
| f mount | Browser resource entry point. No tracker loads without resolved consumer config. |
| f mount | |
| f mountBrowserScripts | Mount active scripts and return one disposer for the current route. |
| f newestFirst | |
| f normalizePathname | |
| f normalizePlugin | Normalize a plugin: validate shape + convert function shorthand hooks to object form. Throws PluginValidationError on invalid plugins. Warnings emitted via console.warn for unknown keys and disabled-with-hooks. |
| f noteDate | The date a list shows for a note: last modified, else published, else created. An unparseable date is skipped, so one bad value can't hide the note's date. |
| f notesTagged | Notes tagged `tag` or a nested tag under it (`tag/…`). |
| f noteStylesheets | Stylesheet URLs for a host note route. Call it in the route's server `load` (`+page.server.ts`): it prepares the vault itself, and `hostStylesheets` is empty in the browser, so serialized server data must carry the SSR list. |
| f openFolderIds | Folder ids to open so `folder` shows in the explorer: it and every folder above it. |
| f openProtectedPayload | Authenticate before returning bytes. Wrong passwords and altered bytes reject. |
| f openSignIn | Open the sign-in dialog. Each provider starts sign-in and comes back to `returnTo`, by default this page. Throws until the `auth` plugin's script has mounted, which happens on every page of a vault that enables it. |
| f oxHugoFlavoredMarkdown | Normalize ox-hugo syntax before the required frontmatter and link parser. |
| f pageAt | The index's route for `path`, which a URL may percent-encode: `/caf%C3%A9/` is `/café/`, `/a%26b/` is `/a&b/`. |
| f pageCrumbs | Breadcrumbs for any page, ending with the page itself (Quartz's `showCurrentPage`). List pages walk through their index route; home and missing pages have none. Themes with other list routes pass their own `titles`. |
| f parseConfig | |
| f parseConfigEffect | Parse (validate) a raw JS object against the config schema, then check that the major version matches the config format this package reads. |
| f parseFrontmatter | core:parse-frontmatter — extract frontmatter and raw links from each file. |
| f parseSearchQuery | `#guides setup` searches notes tagged `guides` for "setup". |
| f pathRoute | The route a note's filename asks for: `people/Ada Lovelace.md` → `people/ada-lovelace`, `Guides/Guides.md` → `guides`. |
| f postReputation | Record `event` in the ledger, weighed with the site's weights, and give its account any role a threshold now grants. Posting an event again, as a repeated webhook delivery or a poll that reads it again would, scores nothing more, and gives any role the first post failed to give. An event whose recipient has no account changes nothing. |
| f presentation | Let readers present any note: `plugins: [presentation()]` in `svartz.config.ts`. The browser script and stylesheet work with every theme. |
| f publicAssetsPlugin | Emit the recorded files in the client build, unless the Svartz plugin there already did. |
| f publishedAttachments | The vault attachments the site publishes, each at `<mount>/<path>`: the files public notes reference, as `core:filter-unpublished` settles them. Attachments only protected notes reference stay in their encrypted payload. |
| f publishesNote | Whether the build publishes a note at `path` inside the vault with `frontmatter`: discovery reads its folder, and the vault's include and exclude patterns let it through and it isn't a draft, unless a publication date publishes it anyway, and it isn't private. A published note may still be password-protected. Page history judges a note's earlier versions with it, at the paths they had then. |
| f readAccount | The account behind `request`, or `null` when nobody is signed in, the session was deleted or expired, the account is suspended, or the site binds no `SVARTZ_DB`. `readSignIn` says which. |
| f readAuditLog | The audit log, newest first, a page at a time, in one query: every plugin's entries, filtered by who made them and what they changed. Throws when the site binds no `SVARTZ_DB`. The log is append-only, so nothing here changes it. |
| f readAuth | |
| f readIdentity | Who sent `request`: the provider account they signed in with, or `null` when nobody is signed in or their account is suspended. `env` is the handler's `context.env`. Without a usable `PRIVATE_SVARTZ_SESSION_SECRET` nobody can be signed in, so this answers `null`; the auth routes report the missing secret with a 503. Plugins that need a person rather than a provider account use `readAccount`. |
| f readingTime | `N min read`, rounded up, at least one minute. |
| f readLinks | A `{ Label: 'url' }` map from user config as ordered links; non-string URLs are dropped. |
| f readMcpTool | An MCP tool from a page's `operation` metadata. Throws with the reason when the metadata isn't a tool. |
| f readModel | A schema page: `model: { name: Pet, schema: {…} }`. |
| f readReferencePage | The page's data as `renderer` reads it from the page's frontmatter. Throws a `ReferencePageError` with the reason when the metadata isn't a valid page; the shell adds the page's path. |
| f readSchema | A frontmatter schema, normalized. `null` never stands alone in a union: a `null` type or alternative marks the schema `nullable`, and a union left with one alternative becomes that alternative. `type: [string, number]` reads as `anyOf` its types. |
| f readSignIn | The account behind `request`, or `null` and why: signed out, no accounts database bound, or the account suspended, with the suspension's reason and end. `env` is the handler's `context.env`. A cookie from before accounts becomes an account and a session on its first read here. |
| f readSources | The page's `source`: a URL, `{ label, href }`, or a list of either. |
| f referenceContext | What a reference renderer's components receive, worked out from the shell: every schema page by name, for `$ref`s. |
| f referenceExtension | A reference theme as a theme-minimal extension: the reference frame and top bar, these renderers, and reference chrome. Guides get minimal's page head and contents; pages a renderer claims get its page and examples. |
| f referenceRenderer | A reference renderer as a theme-minimal page renderer: it claims the pages whose `operation.protocol` (or `model`) names it, renders through `ReferenceBody` and `ReferenceExamples`, and lists with its badge. The same renderer always adapts to the same object, so a renderer two themes share (the schema renderer) stays one claim. |
| f rendererIdOf | The renderer id a page's metadata names, or `undefined` for a guide. An `operation` without a protocol is REST, as in the API theme's first release. |
| f renderHostRss | Render a summary RSS feed for an explicit set of host vaults. |
| f renderHostSitemap | Render a sitemap for selected mounts on the same public host. |
| f renderPreview | The note's HTML, rendered from `markdown` (frontmatter and all) as the site would render its body. A URL naming one of `options.attachments`, by the build's rules, links to where the build publishes it: `<base><mount>/<vault path>`. Any other relative URL resolves from the note's page, as on the site. |
| f renderRevision | `markdown` rendered as the note at `options.path`, ready to put in a page. |
| f reputationBadge | An account's reputation as a badge to follow its name, as `reputationBadgeHtml` renders it on the server. |
| f reputationBadgeHtml | The badge as HTML, to follow an account's name after a space: `<span class="sv-reputation-badge" …>1,234</span>`. A screen reader reads the score whole, and so does its tooltip. |
| f reputationBadgeParts | The badge's parts: what only assistive technology reads, and what everyone sees. A score shown whole reads as "Reputation 1,234"; a shortened one is read in full, "Reputation 12,500", while `12.5K` is shown. |
| f reputationLabel | What the badge says to assistive technology and in its tooltip: the score in full, named. |
| f requestedSlug | The route a note asks for before `allocateRoutes` settles clashes: its frontmatter `slug`, else its filename's. |
| f resolveCallout | Resolve an author-written callout type (`[!faq]`, `[!my-idea]`) to its canonical type, styling, and title. Unknown types render as notes but keep their own title. |
| f resolveConfig | |
| f resolveConfigEffect | |
| f resolveLinks | |
| f resolveProtectedBridgeImports | Substitute only generated bridge specifiers before importing decrypted JS. |
| f resolveRuntimePlugins | Merge runtime plugins in specificity order. `config.plugins` is already the defaults→vault merge from @svartz/config. `hostAdapter` is the host app's `kit.adapter.name` when the vault targets `host`. |
| f resolveThemeExport | |
| f resolveThemeModuleIds | The theme modules a vault lists, in order. |
| f resolveThemePackageRoot | Find a package root from the host app for Vite, CLI, and Tailwind consumers. |
| f resolveThemeRouteToArtifactKey | |
| f resolveThemeRuntimeImport | What `virtual:svartz/theme` imports for this vault. A theme with a selected source imports its `runtime.ts`, or its package id, which Vite aliases to the source. |
| f resolveVirtualModuleId | |
| f restorer | Restores a vault's pages. Only a GitHub App commits as an account, so with a token `commits` is false and every restore throws. `token` shares a `sourceToken` with the vault's commit reader. |
| f reverseReputation | Take back what each `edit` or `page` event `ref` earned its `account`, as one `reversal` entry per event under the same ref, all in one transaction however many there are, then give any role a threshold grants. An event is taken back once: reversing it again changes nothing. An event not posted yet still gets its entry, at 0 points, and scores nothing when it is posted; one that was posted and earned `account` nothing (it scored 0, or credited someone else) gets none. A reversal lowers a score but never takes away a role the account holds. |
| f roamFlavoredMarkdown | Add Roam prose syntax after the normal GFM parser. |
| f routeClaimsOf | The routes the vault's pages hold, hidden and protected ones included, which a page's frontmatter can claim: what `@svartz/plugin-submissions/restore` checks a restored revision against. From `emitArtifacts` with `enforce: "post"`, as `commitSource`; `undefined` without the submissions plugin. |
| f routeHref | |
| f runEffect | |
| f runLifecycleHooks | |
| f runsCode | Whether a browser would run `url` as a script or open it as an HTML document. Before it reads a URL's scheme, a browser drops the tabs and newlines anywhere in it and the spaces and control characters in front of it. |
| f runStages | |
| f safeAttributes | `element`'s HTML attributes without event handlers, `srcdoc`, or script and HTML-document URLs. |
| f savedEdits | Which of `commits` (SHAs) and `pulls` (numbers) the site saved for the vault `records` describes, and the account behind each: whoever made the commit, or opened the pull request with its first save. `null` for a save by someone without an account. In one query; none are saved when the binding is missing. |
| f schemaLabel | How a schema reads in one line: `string (uuid)`, `Pet[]`, `"a" | "b"`, `map of string`. |
| f sealProtectedPayload | Seal one group-owned payload. The ID is authenticated, so route swaps fail. |
| f setColorMode | Pin a mode on <html>, remember it, and tell listeners (comments, graphs). |
| f sharedAttachmentNames | File names of published attachments that another attachment in the vault shares. The build resolves those by path only, so a resolver that sees only `publishedAttachments` needs them to resolve the same; their names are already public, and the other files' paths stay in the build. |
| f slideAction | What a key does. Keys with Ctrl, Cmd, or Alt stay with the browser. |
| f slugToHref | |
| f sortPluginsForStage | Sort normalized plugins for a specific stage by enforce tier. Within each tier, config array order is preserved (stable sort). Only returns plugins that have a hook for the given stage. |
| f sourceLabel | A short label for a source URL. A GitHub or GitLab file link reads as its path and line (`src/mcp/tools.ts:23`); any other URL keeps its host and path. |
| f sourceToken | The token `source`'s credentials authenticate with: the configured one, or the App's installation token, kept. |
| f submissions | Let readers edit any published Markdown note, or add one in a published folder, as a pull request on `repo`. |
| f suspend | Suspend the account that holds or held `handle` until `until`, or for good without it, with `reason`, which the account reads. It replaces any suspension in force. `actor` is the signed-in moderator, from `readAccount`; check their permission first. Refused without writing anything for an admin and for the actor's own account. Throws without `SVARTZ_DB`. |
| f svartz | |
| f svartzSocialImage | The 1200×630 social preview shared by first-party themes. |
| f svartzSyntax | The syntax plugin for a first-party theme's `pluginPreset`. |
| f svelteKitBasePath | SvelteKit's `paths.base` alone, from the same definitions as `svelteKitPaths`. |
| f svelteKitPaths | Read SvelteKit's paths from the definitions it puts in Vite's resolved config, the same in SvelteKit 2 and 3. |
| f tagHrefFor | The URL of a tag's page, including the mount path, for tags the index knows or not. |
| f theme | Vite-bundled runtime manifest. |
| f theme | Vite-bundled runtime manifest. |
| f theme | Vite-bundled runtime manifest. |
| f theme | Vite-bundled runtime manifest. |
| f theme | Vite-bundled runtime manifest. |
| f theme | Vite-bundled runtime manifest. Lazy entries load before SSR and hydration. |
| f themeSettings | Read the vault's `theme` settings. They come from user config, so every field is checked; anything malformed is ignored rather than rendered. |
| f themeSourceAliases | Vite aliases that point each workspace theme at its source, by exact id. A string alias also captures subpaths, so `@svartz/theme-minimal` would rewrite another listed theme's `@svartz/theme-minimal/runtime` import. |
| f themeTokenCss | The CSS for `theme.tokens`, or nothing when there are none. The selector is `html:root` so it outranks the `:root` rules in the Svartz defaults and in every theme. Names and values that could escape the rule are dropped. |
| f titleFromSlugSegment | |
| f topLevelSections | Notes grouped by top-level folder, in first-seen order, without the home note. A folder note (`guides/index.md`) links its section instead of listing in it; a folder with only its note is an empty section. |
| f transformDescription | |
| f transformEmbeds | |
| f transformGfm | Register GFM parsing only while this plugin is active. |
| f transformLatex | Render public math with KaTeX and declare its stylesheet. |
| f transformOfm | |
| f transformSyntax | Add syntax highlighting for public notes with code. |
| f transformToc | core:transform-toc — Table of Contents extraction. |
| f userPageLocation | Where user pages live, such as `{ vault: "notes", folder: "users" }`. |
| f userPageOf | The URL, below the deployment base, of the user page at `handle`; `undefined` while there is none, for a hidden one, and until the vault that holds user pages has started. |
| f validatePluginShape | Validate a plugin against the Effect Schema. On failure, inspects the raw input to throw PluginValidationError with message parity to the legacy manual validation path. |
| f validateTheme | |
| f wasPublic | Whether the build would have published a note with `markdown`'s frontmatter, unprotected: not a draft, not private, in no password group. A revision it would have hidden stays hidden, though the page is public now. Frontmatter the build couldn't read counts as hidden. |
| f wikilinkResolver | The note a wikilink target names from anywhere in the vault, as `core:resolve-links` resolves it, or null. A target that `closest` would settle by the linking note's folder names no note here. |
| f wikilinkSegments | Frontmatter isn't run through the Markdown pipeline, so values like `Home: "[[Vessa]], Lower Wards"` keep raw `[[links]]`. Split such a value into text and linked segments, resolving targets against published notes by title, file name, or slug. Unresolved links become plain text. |
| f withMarkdownNegotiation | Run the shared Svartz handle ahead of the standalone adapters' static-file handlers. |
| f withSvartzHost | Preserve virtual modules and let Svelte compile packaged components in host apps. |
Variables
| v ACCOUNTS_DATABASE_ENV | The D1 binding accounts live in. A fixed name, like `PRIVATE_SVARTZ_SESSION_SECRET`, because every server plugin reads accounts with only `(request, env)` in hand. |
| v ACTIVE_HIGHLIGHT | |
| v ADMIN_ROLE | The role bootstrap admins hold. |
| v ALLOCATE_ROUTES_ID | |
| v ANALYTICS_ID | |
| v AnalyticsConfigSchema | |
| v ANNOTATIONS_PLUGIN_ID | The plugin id, and so the path segment its routes answer under: `<mount>/_svartz/annotations/`. |
| v apiRenderers | REST endpoints, WebSockets, GraphQL operations, and shared schemas. |
| v AUTH_PLUGIN_ID | The plugin id, and so the path segment its routes answer under: `<mount>/_svartz/auth/`. |
| v AuthSummary | |
| v Backlinks | |
| v Badge | |
| v Breadcrumbs | |
| v BreakAfterSlashes | |
| v BuildOptionsSchema | |
| v Callout | |
| v CALLOUT_TYPES | Obsidian's built-in callout types. Each owns an icon and a signal hue. |
| v CodeBlock | |
| v CodePanel | |
| v COLOR_MODE_KEY | localStorage key for the reader's explicit choice. Absent means "follow the OS". |
| v COLOR_MODE_SCRIPT | Inline `<head>` script. Pins the stored mode on <html> before first paint so dark readers never see a light flash. Without a stored mode the OS decides through `color-scheme: light dark`. |
| v COLOR_MODE_SCRIPT_HASH | CSP source for `COLOR_MODE_SCRIPT`. A host with a Content Security Policy adds it to `script-src` so the script can run; `color-mode.test.ts` keeps it in sync. |
| v COLOR_MODE_TAG | `COLOR_MODE_SCRIPT` as a `<script>` element. It lives here rather than in `ColorModeToggle.svelte` because Vite's dependency scanner reads any `<script>` text in a `.svelte` file as the component's script and fails. |
| v ColorModeToggle | |
| v Comments | |
| v CONTRACT_VERSION | Current contract version. Themes must declare a contractVersion and plugins may; `defineTheme` and plugin normalization fail one whose semver major differs from this constant. |
| v CORE_PLUGIN_IDS | @svartz/plugins — core pipeline plugins for the Svartz build system. |
| v CustomDomainRouteSchema | Route = string | ZoneIdRoute | ZoneNameRoute | CustomDomainRoute |
| v default | |
| v default | The `auth` server module: `server: { module, options, pages: ["account", "dashboard", "groups"] }` with `AuthOptions`. |
| v default | The `annotations` server module: `server: { module, options }` with `AnnotationsServerOptions`. |
| v default | |
| v default | The `moderation` server module: `server: { module, options }` with `ModerationServerOptions` and the build's `BuildData`. |
| v default | |
| v DEFAULT_REPORTS_PER_HOUR | Reports each signed-in reader may send per hour unless `limits.reportsPerHour` says otherwise. |
| v DEFAULT_WRITES_PER_HOUR | Writes each signed-in reader may make per hour unless `limits.writesPerHour` says otherwise. |
| v DescText | |
| v DEV_BINDINGS | `globalThis` slot through which `svartz dev` hands server plugins local Cloudflare bindings. The dev server (Node) sets it to a function resolving the bindings; the router (SSR, same process) reads it per request in dev. |
| v DISCOVER_FILES_ID | |
| v DiscoveryConfigSchema | |
| v Embed | |
| v EMIT_ARTIFACTS_ID | |
| v EMIT_DISCOVERY_ID | |
| v EMIT_IMAGES_ID | |
| v EndpointBar | |
| v explorerOpenIds | Persisted set of open folder IDs in the explorer. |
| v extensions | The Node-safe extension the build composes. |
| v extensions | REST, GraphQL, and schema pages on theme-minimal, with the reference frame. Compose them with other themes' extensions. |
| v extensions | The wiki's Node-safe extension. It adds no build plugins of its own. |
| v extensions | The wiki on theme-minimal's shell: its header, rail, article head and foot, article renderer, and list pages. |
| v extensions | The blog's build extension: minimal's build plugins cover it. |
| v extensions | The blog on minimal's shell: a top header instead of the explorer, posts in one reading column with related posts below, and post grids for the list pages. |
| v extensions | The docs theme's build extension: it renders no graph or backlinks. |
| v extensions | |
| v extensions | The Node-safe extension the build composes. |
| v extensions | MCP tool and schema pages on theme-minimal, with the reference frame. Compose them with other themes' extensions. |
| v extensions | Minimal's own extension: the base every theme extends. |
| v extensions | Minimal's own build extension. |
| v FileTrie | |
| v FILTER_UNPUBLISHED_ID | |
| v FnSchema | Effect Schema definitions for SvartzPlugin shape validation. Canonical source of truth for the plugin contract structure. Author-facing types remain plain TS — these schemas are internal. |
| v FrontmatterFieldsSchema | |
| v GiscusConfigSchema | |
| v GITHUB_PAGE_SIZE | Commits per page of GitHub's list, its most. |
| v GraphPanel | |
| v graphqlRenderer | `operation.protocol: graphql`: one query, mutation, or subscription field per page. |
| v HIGHLIGHT | Highlight names, for `::highlight(…)` in a host's own CSS. |
| v HISTORY_ICON | Adds History to the page actions of every page with a history, beside Copy page and Edit; on a user page, the account's contributions below the note; and on `/-/account/`, a link to the reader's contributions. |
| v HOOK_PARALLEL_DEFAULTS | |
| v HookInputSchema | |
| v HookObjectSchema | |
| v HookOptionsSchema | |
| v INDEX_CONTENT_ID | |
| v IndexConfigSchema | What the published index carries beyond its defaults. |
| v KNOWN_PLUGIN_KEYS | |
| v LIFT_ACTION | |
| v Link | |
| v LinkPreviews | |
| v LinkResolutionStrategySchema | |
| v MAX_FILE_BYTES | File content larger than this isn't read; a note the editor accepts is far smaller. |
| v MAX_GITHUB_READS | GitHub requests one reader may make: what the costliest page, a diff of two revisions the mirror doesn't hold, needs. That is the default branch's name, when neither config nor the mirror knows it, then for each revision the check that the branch holds it, the commit, and the page's file at it. |
| v MAX_HISTORY_PAGE | The last page of a file's history readers may page back to, counting from 1: its latest 1,000 changes. Older ones are on GitHub. |
| v MAX_REASON_LENGTH | The longest reason a revert takes, which its commit message carries. |
| v mcpRenderers | MCP tools and shared schemas. |
| v mcpToolRenderer | `operation.protocol: mcp`: one MCP tool per page. |
| v minimalExtension | Minimal itself: the extension every composition falls back to. |
| v MODERATION_PLUGIN_ID | The plugin's id, and so its URL segment: `<base><mount>/_svartz/moderation/`. |
| v NoteHeader | |
| v PAGE_ROUTE_SEGMENT | Path segment under which plugin pages render in the theme shell: `<base><mount>/-/<page>/`. |
| v PageActions | |
| v PARSE_FRONTMATTER_ID | |
| v PasswordGroupsSchema | |
| v PluginEntrySchema | Shallow plugin placeholder; plugin interface/standard TBD. |
| v PluginSchema | |
| v PREVIEW_ATTRIBUTE | Page previews for link hovers and search. A theme marks the part of its page worth previewing with `data-sv-preview`; previews fetch the target URL and clone those nodes. Works for static output and SvelteKit hosts alike. |
| v REASON_MAX_LENGTH | Characters in a report's reason, counted in UTF-16 code units as `maxlength` counts them. |
| v RECENT_PAGE_SIZE | Commits per page of `CommitReader.recent`. |
| v RecentNotes | |
| v ReferenceBody | |
| v referenceChrome | Reference sites keep the page and its examples: no graph, backlinks, dates, or reader mode; a filter above the explorer. |
| v ReferenceExamples | |
| v ReferenceFrame | |
| v ReferenceSection | |
| v ReferenceTopBar | |
| v REPUTATION_BADGE_CLASS | The badge's class: `.sv-reputation-badge`. |
| v RESOLVE_LINKS_ID | |
| v restRenderer | `operation.protocol: rest` (the default): one HTTP endpoint per page. |
| v SCHEMA_RENDERER | The renderer id that handles `model` pages. |
| v schemaRenderer | Renders `model` pages: one shared schema per page, which operations and tools name with `$ref`. Every preset includes it; listing it twice is fine. |
| v SchemaTree | |
| v SEARCH_INDEX_OPTIONS | Shared MiniSearch schema for artifact generation and browser search. |
| v SearchBox | |
| v SearchDialog | |
| v SECRET_ENV_NAME_PATTERN | Server-only environment variable names. Client-public `PUBLIC_` and `VITE_` names are refused. |
| v SemverSchema | |
| v SERVER_PLUGIN_ID_PATTERN | Plugin ids that serve requests, and the page names plugins claim, double as one URL path segment. |
| v SERVER_ROUTE_SEGMENT | Path segment under which every server plugin answers: `<base><mount>/_svartz/<plugin-id>/`. |
| v SiteActions | |
| v SiteConfigSchema | |
| v SiteLogo | |
| v SourceLinks | |
| v STAGE_NAMES | |
| v SUSPEND_ACTION | The audit log's actions for a suspension and for lifting one early. |
| v SVARTZ_MARK_SVG | The Svartz mark: an ink block with a vermilion proof mark. The default favicon. |
| v SvartzConfigSchema | |
| v svartzContentComponents | The shared OFM content slots, ready to spread into a theme's `components`. Pair with `prose.css` on the element that wraps the note body. |
| v SvartzDefaultsSchema | Defaults are vault options at top level (no nested .vault). |
| v SvartzNoteContent | Renders one published note's body inside a host-owned page. The route's universal `load` must have awaited `prepareHostVault(pathname)` first. `stylesheets` comes from `await noteStylesheets(pathname)` in the route's server `load` (`+page.server.ts`); the helper prepares the vault itself, and only serialized server data keeps the SSR links because a universal `load` reruns in the browser where the registry is empty. For a pathname that is not a published note (or a vault that was not prepared) it renders nothing. |
| v SvartzPluginPage | |
| v TableOfContents | |
| v TailwindThemeConfigPropertyRecordSchema | Generic theme property: map of name to value (or nested). All theme keys use this shape; extend per-key when needed (e.g. theme-minimal). |
| v TailwindThemeConfigSchema | |
| v TARGET_KINDS | What a report can be about, and how each is named: a page by its slug, a commit by its full SHA, a submission by its pull request number, an annotation by its id, and an account by its handle. |
| v TargetConfigSchema | |
| v THEME_FEATURE_STAGES | Explicit feature requirements are distinct from rendering capabilities. |
| v TRANSFORM_DESCRIPTION_ID | |
| v TRANSFORM_EMBEDS_ID | |
| v TRANSFORM_GFM_ID | |
| v TRANSFORM_LATEX_ID | |
| v TRANSFORM_OFM_ID | |
| v TRANSFORM_SYNTAX_ID | |
| v TRANSFORM_TOC_ID | |
| v VaultConfigSchema | Vault config: required id, path, target + optional vault options (same shape as defaults; merged with defaults). |
| v VaultOptionsSchema | Shared vault options; defaults and VaultConfig both use this shape. |
| v VaultThemeConfigSchema | Shared keys are checked here. Anything else is the theme's own setting (routes, footer, infobox defaults…) and passes through for the theme to validate. |
| v VERSIONS_FIELD | The frontmatter field a note sets to `true` to publish its previous versions. |
| v VOID_TAGS | |
| v websocketRenderer | `operation.protocol: websocket`: one WebSocket endpoint per page, listed after the path's HTTP methods. |
| v WranglerAssetsSchema | Assets config; main/assets can be auto-populated at build from vault outDir. |
| v WranglerBuildSchema | Custom build (inheritable). |
| v WranglerConfigFieldsSchema | Wrangler config fields shared by root and env.<name>. Covers inheritable and non-inheritable keys from the config; no nested env. A `cloudflare-workers` target is its Worker's Wrangler config, so keys this doesn't list (newer bindings such as `images`) pass through untyped and Wrangler validates them. |
| v WranglerConfigSchema | Full top-level wrangler config. Users can set env (e.g. dev, prod) per vault; each env key holds a partial config (inheritable keys only) merged with the top-level by wrangler. |
| v WranglerEnvRecordSchema | |
| v WranglerLimitsSchema | Limits (inheritable). |
| v WranglerObservabilitySchema | |
| v WranglerPlacementSchema | Placement (inheritable). |
| v WranglerRouteSchema | |
| v WranglerTriggersSchema | Triggers / cron (inheritable). |
| v ZoneIdRouteSchema | |
| v ZoneNameRouteSchema |
- @svartz/theme-api-docs
- @svartz/theme-blog
- @svartz/theme-docs
- @svartz/theme-mcp-docs
- @svartz/theme-minimal
- @svartz/ui
- @svartz/plugins
- @svartz/vite
- @svartz/vite/host
- @svartz/plugins/routes
- @svartz/core
- @svartz/plugin-history/server
- @svartz/plugin-submissions/commits
- @svartz/plugins/preview
- @svartz/auth/server
- @svartz/config
- @svartz/plugin-history
- @svartz/plugin-history/browser
- @svartz/plugin-annotations/browser
- @svartz/auth/badge
- @svartz/auth/browser
- @svartz/plugin-annotations
- @svartz/plugin-annotations/server
- @svartz/plugin-submissions/restore
- @svartz/plugin-moderation
- @svartz/plugin-moderation/server
- @svartz/plugin-submissions
- @svartz/plugin-submissions/server
- @svartz/plugin-moderation/browser
- @svartz/plugin-submissions/render
- @svartz/plugins/content
- @svartz/plugin-submissions/browser
- @svartz/auth
- @svartz/ui/runtime
- @svartz/theme-minimal/runtime
- @svartz/ui/reference/runtime
- @svartz/ui/color-mode
- @svartz/theme-api-docs/runtime
- @svartz/theme-wiki/runtime
- @svartz/theme-wiki
- @svartz/theme-blog/runtime
- @svartz/theme-docs/runtime
- @svartz/theme-mcp-docs/runtime
- @svartz/ui/reference
- @svartz/plugins/browser-presentation
- @svartz/ui/brand
- @svartz/ui/syntax
- @svartz/vite/discovery
- @svartz/plugins/browser-analytics
- @svartz/plugins/browser-mermaid