Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/docs/api/appkit/Interface.EndpointConfig.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Interface: EndpointConfig

## Properties

### env

```ts
env: string;
```

Environment variable holding the endpoint name.

***

### servedModel?

```ts
optional servedModel: string;
```

Target a specific served model (bypasses traffic routing).
27 changes: 27 additions & 0 deletions docs/docs/api/appkit/Interface.ServingEndpointEntry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Interface: ServingEndpointEntry

Shape of a single registry entry.

## Properties

### chunk

```ts
chunk: unknown;
```

***

### request

```ts
request: Record<string, unknown>;
```

***

### response

```ts
response: unknown;
```
5 changes: 5 additions & 0 deletions docs/docs/api/appkit/Interface.ServingEndpointRegistry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Interface: ServingEndpointRegistry

Registry interface for serving endpoint type generation.
Empty by default — augmented by the Vite type generator's `.d.ts` output via module augmentation.
When populated, provides autocomplete for alias names and typed request/response/chunk per endpoint.
19 changes: 19 additions & 0 deletions docs/docs/api/appkit/TypeAlias.ServingFactory.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Type Alias: ServingFactory

```ts
type ServingFactory = keyof ServingEndpointRegistry extends never ? (alias?: string) => ServingEndpointMethods : <K>(alias: K) => ServingEndpointMethods<ServingEndpointRegistry[K]["request"], ServingEndpointRegistry[K]["response"], ServingEndpointRegistry[K]["chunk"]>;
```

Factory function returned by `AppKit.serving`.

This is a conditional type that adapts based on whether `ServingEndpointRegistry`
has been populated via module augmentation (generated by `appKitServingTypesPlugin()`):

- **Registry empty (default):** `(alias?: string) => ServingEndpointMethods` —
accepts any alias string with untyped request/response/chunk.
- **Registry populated:** `<K>(alias: K) => ServingEndpointMethods<...>` —
restricts `alias` to known endpoint keys and infers typed request/response/chunk
from the registry entry.

Run `appKitServingTypesPlugin()` in your Vite config to generate the registry
augmentation and enable full type safety.
4 changes: 4 additions & 0 deletions docs/docs/api/appkit/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ plugin architecture, and React integration.
| [BasePluginConfig](Interface.BasePluginConfig.md) | Base configuration interface for AppKit plugins |
| [CacheConfig](Interface.CacheConfig.md) | Configuration for the CacheInterceptor. Controls TTL, size limits, storage backend, and probabilistic cleanup. |
| [DatabaseCredential](Interface.DatabaseCredential.md) | Database credentials with OAuth token for Postgres connection |
| [EndpointConfig](Interface.EndpointConfig.md) | - |
| [GenerateDatabaseCredentialRequest](Interface.GenerateDatabaseCredentialRequest.md) | Request parameters for generating database OAuth credentials |
| [ITelemetry](Interface.ITelemetry.md) | Plugin-facing interface for OpenTelemetry instrumentation. Provides a thin abstraction over OpenTelemetry APIs for plugins. |
| [LakebasePoolConfig](Interface.LakebasePoolConfig.md) | Configuration for creating a Lakebase connection pool |
Expand All @@ -42,6 +43,8 @@ plugin architecture, and React integration.
| [ResourceEntry](Interface.ResourceEntry.md) | Internal representation of a resource in the registry. Extends ResourceRequirement with resolution state and plugin ownership. |
| [ResourceFieldEntry](Interface.ResourceFieldEntry.md) | Defines a single field for a resource. Each field has its own environment variable and optional description. Single-value types use one key (e.g. id); multi-value types (database, secret) use multiple (e.g. instance_name, database_name or scope, key). |
| [ResourceRequirement](Interface.ResourceRequirement.md) | Declares a resource requirement for a plugin. Can be defined statically in a manifest or dynamically via getResourceRequirements(). Narrows the generated base: type → ResourceType enum, permission → ResourcePermission union. |
| [ServingEndpointEntry](Interface.ServingEndpointEntry.md) | Shape of a single registry entry. |
| [ServingEndpointRegistry](Interface.ServingEndpointRegistry.md) | Registry interface for serving endpoint type generation. Empty by default — augmented by the Vite type generator's `.d.ts` output via module augmentation. When populated, provides autocomplete for alias names and typed request/response/chunk per endpoint. |
| [StreamExecutionSettings](Interface.StreamExecutionSettings.md) | Execution settings for streaming endpoints. Extends PluginExecutionSettings with SSE stream configuration. |
| [TelemetryConfig](Interface.TelemetryConfig.md) | OpenTelemetry configuration for AppKit applications |
| [ValidationResult](Interface.ValidationResult.md) | Result of validating all registered resources against the environment. |
Expand All @@ -54,6 +57,7 @@ plugin architecture, and React integration.
| [IAppRouter](TypeAlias.IAppRouter.md) | Express router type for plugin route registration |
| [PluginData](TypeAlias.PluginData.md) | Tuple of plugin class, config, and name. Created by `toPlugin()` and passed to `createApp()`. |
| [ResourcePermission](TypeAlias.ResourcePermission.md) | Union of all possible permission levels across all resource types. |
| [ServingFactory](TypeAlias.ServingFactory.md) | Factory function returned by `AppKit.serving`. |
| [ToPlugin](TypeAlias.ToPlugin.md) | Factory function type returned by `toPlugin()`. Accepts optional config and returns a PluginData tuple. |

## Variables
Expand Down
20 changes: 20 additions & 0 deletions docs/docs/api/appkit/typedoc-sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ const typedocSidebar: SidebarsConfig = {
id: "api/appkit/Interface.DatabaseCredential",
label: "DatabaseCredential"
},
{
type: "doc",
id: "api/appkit/Interface.EndpointConfig",
label: "EndpointConfig"
},
{
type: "doc",
id: "api/appkit/Interface.GenerateDatabaseCredentialRequest",
Expand Down Expand Up @@ -142,6 +147,16 @@ const typedocSidebar: SidebarsConfig = {
id: "api/appkit/Interface.ResourceRequirement",
label: "ResourceRequirement"
},
{
type: "doc",
id: "api/appkit/Interface.ServingEndpointEntry",
label: "ServingEndpointEntry"
},
{
type: "doc",
id: "api/appkit/Interface.ServingEndpointRegistry",
label: "ServingEndpointRegistry"
},
{
type: "doc",
id: "api/appkit/Interface.StreamExecutionSettings",
Expand Down Expand Up @@ -183,6 +198,11 @@ const typedocSidebar: SidebarsConfig = {
id: "api/appkit/TypeAlias.ResourcePermission",
label: "ResourcePermission"
},
{
type: "doc",
id: "api/appkit/TypeAlias.ServingFactory",
label: "ServingFactory"
},
{
type: "doc",
id: "api/appkit/TypeAlias.ToPlugin",
Expand Down
28 changes: 25 additions & 3 deletions docs/static/appkit-ui/styles.gen.css
Original file line number Diff line number Diff line change
Expand Up @@ -831,9 +831,6 @@
.max-w-\[calc\(100\%-2rem\)\] {
max-width: calc(100% - 2rem);
}
.max-w-full {
max-width: 100%;
}
.max-w-max {
max-width: max-content;
}
Expand Down Expand Up @@ -4514,6 +4511,11 @@
width: calc(var(--spacing) * 5);
}
}
.\[\&_\[data-slot\=scroll-area-viewport\]\>div\]\:\!block {
& [data-slot=scroll-area-viewport]>div {
display: block !important;
}
}
.\[\&_a\]\:underline {
& a {
text-decoration-line: underline;
Expand Down Expand Up @@ -4637,11 +4639,26 @@
color: var(--muted-foreground);
}
}
.\[\&_table\]\:block {
& table {
display: block;
}
}
.\[\&_table\]\:max-w-full {
& table {
max-width: 100%;
}
}
.\[\&_table\]\:border-collapse {
& table {
border-collapse: collapse;
}
}
.\[\&_table\]\:overflow-x-auto {
& table {
overflow-x: auto;
}
}
.\[\&_table\]\:text-xs {
& table {
font-size: var(--text-xs);
Expand Down Expand Up @@ -4851,6 +4868,11 @@
width: 100%;
}
}
.\[\&\>\*\]\:min-w-0 {
&>* {
min-width: calc(var(--spacing) * 0);
}
}
.\[\&\>\*\]\:focus-visible\:relative {
&>* {
&:focus-visible {
Expand Down
Loading
Loading