Skip to content

Interface: ServeClientSurfaceOptions

Defined in: packages/aiui-util/src/web-surface.ts:35

Properties

appType?

optional appType?: "mpa" | "spa"

Defined in: packages/aiui-util/src/web-surface.ts:66

Vite's appType in dev (default "mpa", matching the intent panel). Use "spa" for a single-page client that wants an index.html fallback.


devEntry?

optional devEntry?: string

Defined in: packages/aiui-util/src/web-surface.ts:59

Dev only: the html file served at the base (prefix/), when it isn't index.html (Vite's convention). E.g. pencil's client entry is client.html; a request to /pencil/ is rewritten to /pencil/client.html before Vite. Prod always serves <distDir>/index.html (the built artifact).


distDir?

optional distDir?: string

Defined in: packages/aiui-util/src/web-surface.ts:61

Prod only: the prebuilt static bundle served under prefix. Required in prod.


hmrPath?

optional hmrPath?: string

Defined in: packages/aiui-util/src/web-surface.ts:68

Relative HMR websocket path segment under prefix (default "hmr").


log?

optional log?: (message) => void

Defined in: packages/aiui-util/src/web-surface.ts:72

Diagnostic sink (stderr).

Parameters

message

string

Returns

void


mode

mode: "dev" | "prod"

Defined in: packages/aiui-util/src/web-surface.ts:37

Dev serves from Vite; prod serves the prebuilt static bundle.


notBuiltHint?

optional notBuiltHint?: string

Defined in: packages/aiui-util/src/web-surface.ts:70

Prod: shown (503) when distDir has no index.html — the build command to run.


prefix

prefix: string

Defined in: packages/aiui-util/src/web-surface.ts:39

Base path the client mounts under, no trailing slash (e.g. "/intent").


viteConfigFile?

optional viteConfigFile?: string

Defined in: packages/aiui-util/src/web-surface.ts:52

Dev only: an explicit Vite config file, when the root's auto-resolved config isn't the one to serve with (e.g. pencil's lab/vite.config.ts mounts a whole lab rig; the sidecar wants the client-only build config instead). Omitted → Vite auto-resolves from viteRoot.


viteRoot?

optional viteRoot?: string

Defined in: packages/aiui-util/src/web-surface.ts:45

Dev only: the directory Vite roots at. Its own vite.config is auto-resolved from here (plugins, entry html) unless viteConfigFile overrides. Required in dev.