@svartz/core
173 exported symbols.
Classes
| 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 ThemeValidationError |
Interfaces
| i Artifact | |
| i AssetRecord | |
| 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 ChangeEvent | |
| i CompilerContributions | Compiler steps and browser imports collected afresh for each pipeline run. |
| 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 EnvReference | Names a server environment variable in place of an inlined secret. |
| i FolderIndexEntry | |
| i GraphTarget | Rich graph node for UI consumers (projection of Index). |
| i HookExecutionResult | |
| i Index | Canonical index artifact produced by `core:index`. Single source of truth for search, backlinks, and graph projections. |
| i IndexEntry | |
| i IndexLink | |
| i NormalizedSvartzPlugin | |
| i PageContext | Per-request facilities handed to a plugin's page renderer. |
| 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 ProcessedFile | A file passing through the plugin pipeline. |
| i ProtectedEnvelope | |
| i ProtectedGroupPayload | Browser session state for independently unlocked password groups. |
| i RawLink | A link extracted from markdown before resolution. Mirrors vault's LinkMatch — kept Effect-free for plugin authors. |
| i ResolvedBuildConfig | |
| i ResolvedConfig | Canonical single-vault build config consumed by the runner and @svartz/vite. |
| i ResolvedDiscoveryConfig | |
| i ResolvedFrontmatterConfig | |
| i ResolvedSiteConfig | |
| i ResolvedThemeConfig | |
| i ResolvedVaultDefaults | |
| i RouteIndex | |
| i RunnerResult | |
| i RuntimeRouteInput | |
| i RuntimeRouteMatch | |
| i SearchDocument | |
| 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 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 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 TagIndexEntry | |
| i TargetConfig | |
| i ThemeArtifactRequirements | Declares which pipeline artifacts the theme needs. `search` and `toc` are derived from the canonical `index` — not independent. |
| i ThemeComponentRegistry | Named component entries the theme provides for the runner/shell. All entries are optional; custom components extend via the index signature. |
| i ThemeLayoutMap | Maps named layout slots to component loaders. Required: `defaultPage` and `notePage`. Custom slots are extensible via the index signature. |
| 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 TocEntry | |
| i VaultNoteView | |
| i VaultView | Published, vault-scoped data for SvelteKit loaders and theme components. |
Types
| t AnalyticsConfig | Public analytics settings shipped to the browser only when selected by a consumer. |
| t ArtifactBag | |
| t CustomDomainRoute | |
| t DateSource | |
| t DevBindings | What `svartz dev` stores in `DEV_BINDINGS`: resolves the bindings, vars and `.dev.vars` of the app's Wrangler config. |
| t Graph | |
| t HookOptions | |
| t LinkResolutionStrategy | |
| t MaybePromise | |
| 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 PluginChangeHook | |
| t PluginChangeHookInput | |
| t PluginError | |
| t PluginFactory | |
| t PluginHook | |
| t PluginHookInput | |
| t RunnerPlugin | |
| 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 StageName | |
| t TailwindThemeConfig | |
| t ThemeComponentLoader | Reference to a Svelte component — sync or lazy. |
| t ThemeError | |
| t ThemeFactory | |
| t ThemeRequiredFeature | |
| 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 createProtectionSalt | Generate a fresh salt once per password group and build. |
| 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 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 decodeRoutePath | Decode a percent-encoded URL pathname once; preserve slashes and return undefined for malformed escapes. |
| f definePlugin | Wrap a plugin factory with runtime validation and hook normalization. The returned factory produces normalized plugins ready for the runner. |
| 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 executeHandleChange | |
| f executeStage | |
| f getCompilerContributions | |
| f isPluginEnabled | |
| 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 mountBrowserScripts | Mount active scripts and return one disposer for the current route. |
| 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 openProtectedPayload | Authenticate before returning bytes. Wrong passwords and altered bytes reject. |
| f resolveProtectedBridgeImports | Substitute only generated bridge specifiers before importing decrypted JS. |
| f resolveThemeRouteToArtifactKey | |
| f runLifecycleHooks | |
| f runStages | |
| f sealProtectedPayload | Seal one group-owned payload. The ID is authenticated, so route swaps fail. |
| 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 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 |
Variables
| 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 CustomDomainRouteSchema | Route = string | ZoneIdRoute | ZoneNameRoute | CustomDomainRoute |
| 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 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 HOOK_PARALLEL_DEFAULTS | |
| v HookInputSchema | |
| v HookObjectSchema | |
| v HookOptionsSchema | |
| v KNOWN_PLUGIN_KEYS | |
| v PAGE_ROUTE_SEGMENT | Path segment under which plugin pages render in the theme shell: `<base><mount>/-/<page>/`. |
| v PluginSchema | |
| v SEARCH_INDEX_OPTIONS | Shared MiniSearch schema for artifact generation and browser search. |
| v SECRET_ENV_NAME_PATTERN | Server-only environment variable names. Client-public `PUBLIC_` and `VITE_` names are refused. |
| 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 STAGE_NAMES | |
| 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 THEME_FEATURE_STAGES | Explicit feature requirements are distinct from rendering capabilities. |
| 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 |