Skip to content

bolt/host-api

bolt/host-api

Import from @norbital-ai/bolt/host-api

@norbital-ai/bolt/host-api: this release's HostApi (@norbital-ai/host-api), the one value a host takes from a release it runs on its own module graph.

host-api

HOST_API const

const HOST_API: HostApi

This release's HostApi implementation, the one value a host imports from a release.

Members

NameTypeDescription
guest_execution'source'

Hosts admit only runtimes that evaluate tenant source without restoring native snapshots.

versionnumber

The HOST_API the release speaks.

contractstring

The artifact contract this release implements.

cookies{ readonly session: string; readonly preview: string; }
cookie_site(secure: boolean) => string

The session cookie's site attributes.

verify(release: Release, options: Signal) => Promise<void>

Refuses an artifact this release did not build or whose files do not match their digests.

describe(release: Release, options: Signal) => Promise<ReleaseFacts>

What the release says about itself, decoded by its own Bolt (ReleaseFacts).

frame_policy(release: Release, path: string, options: Signal) => Promise<string>

The client page's content security policy for path: frame-ancestors and img-src.

needs_guest(request: Request) => Promise<boolean>

Whether a request may run a guest body, so the host admits only these under its compute envelope.

schema{ /** The schema state the release plans from (what a successor's plan is diffed against). */ slice(release: Release, options: Signal): Promise<SchemaSlice>; /** The destructive steps planning `release` over `applied` (another release's `slice`) would take. */ destructive(applied: SchemaSlice, release: Release, options: Signal): Promise<readonly string[]>; /** * An author's migrations set on top …
activate(ports: HostPorts, options: Signal) => Promise<ActiveWorkspace>

Applies the artifact's verified migration files (checksummed, one transaction each under the bolt:schema advisory lock, ledger and receipt committed with the file) and activates the release. Refuses a bundle whose recorded needs name a facility left off, live schema drift from the verified lock (even when every applied checksum matches), and a database with no migration ledger: an existing schema is never adopted.

branch(ports: BranchPorts, options: Signal) => Promise<WorkspaceBranch>
links(host: LinkHost, options: Signal) => Promise<WorkspaceLinks>

Source: packages/bolt/src/protocol/host-api.ts:890