host-api
host-api
Import from @norbital-ai/host-api
@norbital-ai/host-api: the contract between a host and a Bolt release. A host (Colony, bolt-server, a third party's) depends on this package, never on Bolt's engine; a release's Bolt depends on it and answers it. It owns every type that crosses: the HostApi a release answers (host.ts), the facilities and ports a host supplies (facilities.ts, ai.ts, browser.ts, guest.ts, media.ts, integrations.ts, db.ts, logs.ts, audit.ts), the authority a host reads (authority.ts), what a host adds to the agent (tools.ts) and Studio's port (studio.ts), with the failures they share (errors.ts), the Port helpers that call them and the SQL wire both database adapters and the engine share (wire.ts). It also holds the adapters every host binds the same way: System 1 (system-1.ts), Norbital Convert (convert.ts), the deadline timer (deadline-timer.ts) and the recovery storage contract's reads of a branch without its release (storage.ts). Versioning: the protocol version is HOST_API_VERSION, one integer bumped on any change either side could misread. The package version follows the oss release line for publication; what a host checks is the HOST_API number a release reports (HostApiCore.version), which must equal its own (supports). Bolt package versions are independent. Node-only parts (signed host operations and the Node port implementations) are @norbital-ai/host-api/node; everything here also runs inside a cell.
audit
AUDIT_ACTOR_KINDS const
const AUDIT_ACTOR_KINDS: readonly ["member", "envoy", "visitor", "api_key", "system"] The existing native actor families, projected without credentials or session data.
Source: packages/host-api/src/audit.ts:23
AUDIT_CATEGORIES const
const AUDIT_CATEGORIES: readonly ["write", "approval", "identity", "automation", "integration"] Native event families offered by the administrator's audit filters.
Source: packages/host-api/src/audit.ts:5
AUDIT_STATUSES const
const AUDIT_STATUSES: readonly ["prepared", "committed", "pending_approval", "refused", "conflict", "failed", "unknown"] An event's observed lifecycle; prepared and unknown never claim a committed database change.
Source: packages/host-api/src/audit.ts:13
host
ActiveWorkspace type
type ActiveWorkspace = {
/**
* The release's routes for this generation, the request as the workspace sees it (no host prefix): the shell host
* (`/__bolt/session/*`, `/__bolt/shell*`, the PWA manifest), files, the data protocol and `/hooks/<path>` automation
* webhooks; `null` when none is the release's. Event streams end when the generation closes.
*/
handle(request: Request, options: {
readonly address: string;
}): Promise<Response | null>;
/**
* Protected public-page loading and HTML rendering share one read-only guest invocation. A host routes public
* documents here before static client serving, passing the original request and keeping the returned cookies,
* status, cache and content-security headers; serving `index.html` for a public route bypasses rendering.
*/
render(request: Request, options: Signal & {
readonly address: string;
}): Promise<Response | null>;
/** One deadline wake: every due run of the environment, then `deadlines.settle`. */
wake(options: Signal): Promise<void>;
/** Signal work due during an existing wake without entering another compute envelope. */
pulse(options: Signal): Promise<boolean>;
/** Every cron the manifest declares; the host's clock computes their slots. */
crons(): Promise<readonly CronEntry[]>;
/** Runs cron `id` for `slot` (an ISO minute), once per `(id, slot)`; `ran: false` for a repeat or a run that wrote nothing. */
fi… A release activated for one workspace: the routes it serves, its renders, crons and lifecycle as the host drives them.
Members
| Name | Type | Description |
|---|---|---|
handle | (request: Request, options: { readonly address: string; }) => Promise<Response | null> | The release's routes for this generation, the request as the workspace sees it (no host prefix): the shell host ( |
render | (request: Request, options: Signal & { readonly address: string; }) => Promise<Response | null> | Protected public-page loading and HTML rendering share one read-only guest invocation. A host routes public documents here before static client serving, passing the original request and keeping the returned cookies, status, cache and content-security headers; serving |
wake | (options: Signal) => Promise<void> | One deadline wake: every due run of the environment, then |
pulse | (options: Signal) => Promise<boolean> | Signal work due during an existing wake without entering another compute envelope. |
crons | () => Promise<readonly CronEntry[]> | Every cron the manifest declares; the host's clock computes their slots. |
fire | (id: string, slot: string, options: Signal) => Promise<CronFired> | Runs cron |
park | (options: Signal & { readonly automations_ms: number; }) => Promise<void> | A planned close: ordinary pages and requests go on; no new job or automation call starts. Active automations get |
close | () => Promise<void> | Interrupts every guest invocation and in-flight crossing of this generation; the host then ends its pool. |
notify | (note: { readonly conversation: string; readonly text: string; readonly id: string; }, options: Signal) => Promise<boolean> | The host's word to an agent conversation (the end of work it carried on for a turn, such as a host tool's job): one queued system note that wakes the conversation. |
task | (task: TaskStart, options: Signal) => Promise<string> | Starts a system agent on |
identity | { /** The caller's authority from the request's session, or `null`. */ authority(request: Request, options: Signal): Promise<Authority | null>; /** `session.mint` for an active member; `null` for none. `agent`: minted for the agent's browser (`Authority.agent`). */ mint(user: string, options: Signal & { readonly agent?: AgentMark; }): Promise<MintedSession | null>; } |
Source: packages/host-api/src/host.ts:294
authority
Actor const
const Actor: Schema.Union<readonly [Schema.Struct<{ readonly kind: Schema.Literal<"member">; readonly id: Schema.String; readonly email: Schema.NullOr<Schema.String>; readonly phone: Schema.NullOr<Schema.String>; readonly external: Schema.Boolean; readonly admin: Schema.Boolean; }>, Schema.Struct<{ readonly kind: Schema.Literal<"envoy">; readonly envoy: Schema.String; }>, Schema.Struct<{ readonly kind: Schema.Literal<"visitor">; readonly app: Schema.String; readonly visitor: Schema.String; }>, Schema.Struct<{ readonly kind: Schema.Literal<"api_key">; readonly key: Schema.String; }>, Schema.Struct<{ readon… The person or work a call is for: a member, an envoy's turn, a visitor, an API key or the system identity's run.
Source: packages/host-api/src/authority.ts:14
AgentMark const
const AgentMark: Schema.Struct<{ readonly conversation: Schema.String; }> The agent's mark: requests made with a session minted for the agent's browser act for the member in conversation.
Source: packages/host-api/src/authority.ts:31
host
AgentPorts type
type AgentPorts = {
/** The person's current working source (the default for source tools); none where they author nothing. */
readonly draft?: (a: Authority) => Promise<WorkspacePort | undefined>;
/** ripgrep over this author's working tree (`workspace_grep`). */
readonly search?: (a: Authority, request: SearchRequest) => Promise<SearchAnswer | undefined>;
/**
* Host tools (Workspace Studio authoring, browser, personal skills): a fixed list, or the actor's catalogue per turn.
* `subject` is what the tools work for: an agent conversation, or an automation run's inference.
*/
readonly host_tools?: readonly HostTool[] | ((a: Authority, subject: ToolSubject) => Promise<readonly HostTool[]>);
/** A system agent's task ended (`ActiveWorkspace.task`, `ctx.ai.sys_2.task`): told once, whatever ended it. */
readonly task_ended?: (end: TaskEnd) => Promise<void>;
/** An administrator turned the host's own tasks on (`ActiveWorkspace.task` was refused until now): it may start what waits. */
readonly tasks_enabled?: () => Promise<void>;
/** Host skills merged into `skill` on in-app staff turns: the platform authoring skill, the person's own skills. */
readonly skills?: (a: Authority) => Promise<{
readonly [name: string]: HostSkill;
}>;
/** Reject pending host tool approvals from the previous turn; return only IDs actually rejected. */
readonly on_turn_start?: (conversation: string) => Promise<readonly strin… The agent's host parts; the release's own source (workspace_grep) and attachments are the release's.
Members
| Name | Type | Description |
|---|---|---|
draft? | (a: Authority) => Promise<WorkspacePort | undefined> | The person's current working source (the default for source tools); none where they author nothing. |
search? | (a: Authority, request: SearchRequest) => Promise<SearchAnswer | undefined> | ripgrep over this author's working tree ( |
host_tools? | readonly HostTool[] | ((a: Authority, subject: ToolSubject) => Promise<readonly HostTool[]>) | Host tools (Workspace Studio authoring, browser, personal skills): a fixed list, or the actor's catalogue per turn. |
task_ended? | (end: TaskEnd) => Promise<void> | A system agent's task ended ( |
tasks_enabled? | () => Promise<void> | An administrator turned the host's own tasks on ( |
skills? | (a: Authority) => Promise<{ readonly [name: string]: HostSkill; }> | Host skills merged into |
on_turn_start? | (conversation: string) => Promise<readonly string[]> | Reject pending host tool approvals from the previous turn; return only IDs actually rejected. |
events? | (since: string) => Promise<readonly WorkspaceNote[]> | Workspace events after |
Source: packages/host-api/src/host.ts:158
ai
AiAssistantContent const
const AiAssistantContent: Schema.Struct<{ readonly text: Schema.optionalKey<Schema.String>; readonly reasoning: Schema.optionalKey<Schema.String>; readonly toolCalls: Schema.optionalKey<Schema.$Array<Schema.Struct<{ readonly id: Schema.String; readonly name: Schema.String; readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>; readonly invalid: Schema.optionalKey<Schema.String>; }>>>; }> Assistant text, preserved reasoning and tool calls passed to the provider.
Source: packages/host-api/src/ai.ts:14
AiCatalogSchema const
const AiCatalogSchema: Schema.Struct<{ readonly models: Schema.$Array<Schema.Struct<{ readonly id: Schema.String; readonly label: Schema.String; readonly provider: Schema.optionalKey<Schema.String>; readonly context: Schema.optionalKey<Schema.Number>; readonly price: Schema.optionalKey<Schema.Struct<{ readonly input: Schema.Number; readonly output: Schema.Number; readonly cached: Schema.optionalKey<Schema.Number>; }>>; }>>; readonly default: Schema.String; }> A provider's listing: its models and the one it uses unless told otherwise.
Source: packages/host-api/src/ai.ts:242
AiEvent type
type AiEvent = {
readonly _tag: 'Delta';
readonly text: string;
} | {
readonly _tag: 'Progress';
readonly reasoning: string | undefined;
} | {
readonly _tag: 'Response';
readonly response: AiResponse;
}; One sys_2 call as it streams: text as it arrives, progress that is not text (a tool call's arguments, reasoning), then the response.
Source: packages/host-api/src/ai.ts:284
AiMessage type
type AiMessage = {
role: 'user' | 'assistant' | 'tool';
content: Json;
}; One transcript message the AI port sends the model: who said it and its content.
Members
| Name | Type | Description |
|---|---|---|
role | 'user' | 'assistant' | 'tool' | |
content | Json |
Source: packages/host-api/src/ai.ts:184
AiModel type
type AiModel = typeof AiModelSchema.Type; One model a provider lists (AiModelSchema): its id, label, vendor, window and price.
Members
| Name | Type | Description |
|---|---|---|
label | Schema.String | |
id | Schema.String | |
context? | Schema.optionalKey<Schema.Number> | |
provider? | Schema.optionalKey<Schema.String> | |
price? | Schema.optionalKey<Schema.Struct<{ readonly input: Schema.Number; readonly output: Schema.Number; readonly cached: Schema.optionalKey<Schema.Number>; }>> |
Source: packages/host-api/src/ai.ts:238
AiModelSchema const
const AiModelSchema: Schema.Struct<{ readonly id: Schema.String; readonly label: Schema.String; readonly provider: Schema.optionalKey<Schema.String>; readonly context: Schema.optionalKey<Schema.Number>; readonly price: Schema.optionalKey<Schema.Struct<{ readonly input: Schema.Number; readonly output: Schema.Number; readonly cached: Schema.optionalKey<Schema.Number>; }>>; }> One model a provider lists (the panel shows label, grouped by provider); context is its window in tokens, price USD per million tokens (input, output, cached input): what a call costs when the endpoint reports no charge.
Source: packages/host-api/src/ai.ts:224
AiPort interface
interface AiPort {
sys_1: System1Port;
sys_2: {
/** The model classes the host maps (`default fast strong`). */
models: readonly string[];
/**
* Every model the provider can reach that the agent can run on (images in, tools), as the provider lists them, and
* the id a new conversation starts on; cached as the host likes, answering even offline. `infer` takes any of their
* ids as `model`, beside the classes.
*/
catalog(): Promise<{
models: readonly AiModel[];
default: string;
}>;
/**
* `onDelta` streams text as it arrives; on the wall the agent keeps it as a cut step. `onProgress`: the stream
* produced something that is not text (a tool call's arguments, or `reasoning` as it arrives).
*/
infer(request: AiRequest, signal: AbortSignal, onDelta?: (text: string) => void, onProgress?: (reasoning?: string) => void): Promise<AiResponse>;
};
embed?: EmbeddingsPort['embed'];
} The AI facility: sys_1 (fast structured decisions over text, JSON, and resolved inline PNG/JPEG images) and sys_2 (the multimodal LLM) are both required when the port is bound; embed (multimodal) is present when the host maps an embedding model. The host verifies at activation that every sys_2 and embed model takes images; nothing here branches on modality.
Members
| Name | Type | Description |
|---|---|---|
sys_1 | System1Port | |
sys_2 | { /** The model classes the host maps (`default fast strong`). */ models: readonly string[]; /** * Every model the provider can reach that the agent can run on (images in, tools), as the provider lists them, and * the id a new conversation starts on; cached as the host likes, answering even offline. `infer` takes any of their * ids as `model`, beside the classes. */ catalog(): Promise<{ models: r… | |
embed? | EmbeddingsPort['embed'] |
Source: packages/host-api/src/ai.ts:259
AiPortResponseSchema const
const AiPortResponseSchema: Schema.Struct<{ readonly content: Schema.Codec<Schema.Json, Schema.Json, never, never>; readonly tool_calls: Schema.$Array<Schema.Struct<{ readonly id: Schema.String; readonly name: Schema.String; readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>; readonly invalid: Schema.optionalKey<Schema.String>; }>>; readonly finish: Schema.Literals<readonly ["stop", "tool", "cut"]>; readonly continuation: Schema.optionalKey<Schema.String>; readonly reasoning: Schema.optionalKey<Schema.String>; readonly usage: Schema.Struct<{ readonly input: Schema.Number; readonly output: Schema.Number… The host's system-2 answer; transcript storage keeps its native toolCalls projection behind the adapter.
Source: packages/host-api/src/ai.ts:33
AiPrice type
type AiPrice = NonNullable<AiModel['price']>; A model's listed price in USD per million tokens: input, output and cached input.
Members
| Name | Type | Description |
|---|---|---|
input | Schema.Number | |
output | Schema.Number | |
cached? | Schema.optionalKey<Schema.Number> |
Source: packages/host-api/src/ai.ts:240
AiRequest type
type AiRequest = {
model: string;
/** Host usage attribution; omitted for utility inference, set by the conversation engine for chat work. */
purpose?: 'chat';
system?: string;
messages: readonly AiMessage[];
tools?: readonly {
name: string;
description: string;
input: Json;
}[];
output?: Json;
/** Images and documents for the model to see; `call` is the tool call that opened one, which it follows. */
files?: readonly {
mime: string;
bytes: Uint8Array;
call?: string;
}[];
continuation?: string;
/** Reasoning effort hint for fast/structured utility calls; omitted uses the provider default. */
reasoning_effort?: 'low' | 'medium' | 'high';
}; One model call the engine hands the AI port: model, system prompt, messages, tools, optional output schema and files.
Members
| Name | Type | Description |
|---|---|---|
model | string | |
purpose? | 'chat' | Host usage attribution; omitted for utility inference, set by the conversation engine for chat work. |
system? | string | |
messages | readonly AiMessage[] | |
tools? | readonly { name: string; description: string; input: Json; }[] | |
output? | Json | |
files? | readonly { mime: string; bytes: Uint8Array; call?: string; }[] | Images and documents for the model to see; |
continuation? | string | |
reasoning_effort? | 'low' | 'medium' | 'high' | Reasoning effort hint for fast/structured utility calls; omitted uses the provider default. |
Source: packages/host-api/src/ai.ts:186
AiResponse type
type AiResponse = typeof AiPortResponseSchema.Type; The host's system-2 answer (AiPortResponseSchema): content, tool calls, how it finished and its usage.
Members
| Name | Type | Description |
|---|---|---|
content | Schema.Codec<Schema.Json, Schema.Json, never, never> | |
tool_calls | Schema.$Array<Schema.Struct<{ readonly id: Schema.String; readonly name: Schema.String; readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>; readonly invalid: Schema.optionalKey<Schema.String>; }>> | |
finish | Schema.Literals<readonly ["stop", "tool", "cut"]> | |
usage | Schema.Struct<{ readonly input: Schema.Number; readonly output: Schema.Number; readonly cost: Schema.optionalKey<Schema.Number>; readonly call: Schema.optionalKey<Schema.String>; readonly provider: Schema.optionalKey<Schema.String>; readonly cached: Schema.optionalKey<Schema.Number>; readonly reasoning: Schema.optionalKey<Schema.Number>; readonly prompt: Schema.optionalKey<Schema.Struct<{ readonl… | Tokens and the call's charge in USD under the provider's call id: a host's provider reports both |
continuation? | Schema.optionalKey<Schema.String> | |
reasoning? | Schema.optionalKey<Schema.String> |
Source: packages/host-api/src/ai.ts:55
AiToolCallSchema const
const AiToolCallSchema: Schema.Struct<{ readonly id: Schema.String; readonly name: Schema.String; readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>; readonly invalid: Schema.optionalKey<Schema.String>; }> Fields every AI provider receives; engine transcript metadata is not part of this contract.
Source: packages/host-api/src/ai.ts:7
AiToolResult const
const AiToolResult: Schema.Struct<{ readonly id: Schema.String; readonly name: Schema.String; readonly result: Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>; }> A tool call result passed back to the provider.
Source: packages/host-api/src/ai.ts:20
membrane
Answer const
const Answer: Schema.UndefinedOr<Schema.Tuple<readonly [Schema.Literals<readonly ["ok", "fail"]>, Schema.Unknown]>> A call's answer when its function answered at once; none means a resolve or reject message follows.
Source: packages/host-api/src/membrane.ts:33
answers
ArtifactHeader const
const ArtifactHeader: Schema.Struct<{ readonly contract: Schema.String; readonly host_api: Schema.Number; readonly handle: Schema.String; readonly name: Schema.String; readonly schema: Schema.String; readonly client: Schema.optionalKey<Schema.Struct<{ readonly immutable: Schema.optionalKey<Schema.$Array<Schema.String>>; readonly public_routes: Schema.optionalKey<Schema.$Array<Schema.String>>; readonly has_embeds: Schema.optionalKey<Schema.Boolean>; }>>; readonly hash: Schema.String; }> The header of a release's artifact.json a host reads before any cell runs; the release's verify checks the rest.
Source: packages/host-api/src/answers.ts:7
ports
ArtifactPort interface
interface ArtifactPort {
read(path: string, signal: AbortSignal): Promise<Uint8Array>;
list(dir: string, signal: AbortSignal): Promise<readonly string[]>;
stat(path: string, signal: AbortSignal): Promise<ArtifactStat | null>;
} The release's files, read-only. Paths are posix and relative to the release directory (artifact.json, client/index.html), with no ., empty, \ or NUL segment; .. only as ../seed/<pack>/…, the build's seed packs beside the release (.norbital/bundle + .norbital/seed/<pack>), or ../docs/<file>, the API reference of the Bolt release it pins (build/docs/<file>, for the agent's docs tool). The host refuses any other path and resolves symlinks itself, so a path never leaves those roots. stat answers null for nothing there; list answers every file (never a directory) under dir, recursively, relative to dir, sorted.
Members
| Name | Type | Description |
|---|---|---|
read | (path: string, signal: AbortSignal) => Promise<Uint8Array> | |
list | (dir: string, signal: AbortSignal) => Promise<readonly string[]> | |
stat | (path: string, signal: AbortSignal) => Promise<ArtifactStat | null> |
Source: packages/host-api/src/ports.ts:17
ArtifactStat type
type ArtifactStat = {
readonly kind: 'file' | 'directory';
readonly size: number;
}; A release path's kind and byte size.
Members
| Name | Type | Description |
|---|---|---|
kind | 'file' | 'directory' | |
size | number |
Source: packages/host-api/src/ports.ts:8
integrations
Attachment type
type Attachment = {
readonly id?: string;
readonly name: string;
readonly mime: string;
readonly bytes: number;
}; A file a message carries: id names the stored file; none when the row could not store its bytes (too large, never received).
Members
| Name | Type | Description |
|---|---|---|
id? | string | |
name | string | |
mime | string | |
bytes | number |
Source: packages/host-api/src/integrations.ts:633
audit
AuditActor const
const AuditActor: Schema.Struct<{ readonly kind: Schema.Literals<readonly ["member", "envoy", "visitor", "api_key", "system"]>; readonly id: Schema.NullOr<Schema.NonEmptyString>; readonly label: Schema.NullOr<Schema.String>; }> A stable actor identity and its optional display label at the time of the event.
Source: packages/host-api/src/audit.ts:26
AuditEvent const
const AuditEvent: Schema.Struct<{ readonly id: Schema.NonEmptyString; readonly operation_id: Schema.NonEmptyString; readonly at: Schema.String; readonly category: Schema.Literals<readonly ["write", "approval", "identity", "automation", "integration"]>; readonly action: Schema.NonEmptyString; readonly status: Schema.Literals<readonly ["prepared", "committed", "pending_approval", "refused", "conflict", "failed", "unknown"]>; readonly actor: Schema.Struct<{ readonly kind: Schema.Literals<readonly ["member", "envoy", "visitor", "api_key", "system"]>; readonly id: Schema.NullOr<Schema.NonEmptyString>; readonly labe… An immutable native event; committed or held states require database acknowledgement before append.
Source: packages/host-api/src/audit.ts:56
AuditPage const
const AuditPage: Schema.Struct<{ readonly rows: Schema.$Array<Schema.Struct<{ readonly id: Schema.NonEmptyString; readonly operation_id: Schema.NonEmptyString; readonly at: Schema.String; readonly category: Schema.Literals<readonly ["write", "approval", "identity", "automation", "integration"]>; readonly action: Schema.NonEmptyString; readonly status: Schema.Literals<readonly ["prepared", "committed", "pending_approval", "refused", "conflict", "failed", "unknown"]>; readonly actor: Schema.Struct<{ readonly kind: Schema.Literals<readonly ["member", "envoy", "visitor", "api_key", "system"]>; readonly id: Schema… A bounded page in stable occurrence-time and event-id order, with no exact-count scan.
Source: packages/host-api/src/audit.ts:102
AuditPendingPage const
const AuditPendingPage: Schema.Struct<{ readonly rows: Schema.$Array<Schema.Struct<{ readonly id: Schema.NonEmptyString; readonly operation_id: Schema.NonEmptyString; readonly at: Schema.String; readonly category: Schema.Literals<readonly ["write", "approval", "identity", "automation", "integration"]>; readonly action: Schema.NonEmptyString; readonly actor: Schema.Struct<{ readonly kind: Schema.Literals<readonly ["member", "envoy", "visitor", "api_key", "system"]>; readonly id: Schema.NullOr<Schema.NonEmptyString>; readonly label: Schema.NullOr<Schema.String>; }>; readonly subject: Schema.NullOr<Schema.Struct<{ read… Full prepared records without their operation's terminal marker, in stable oldest-first cursor order.
Source: packages/host-api/src/audit.ts:116
AuditPendingQuery const
const AuditPendingQuery: Schema.Struct<{ readonly after: Schema.optionalKey<Schema.NonEmptyString>; readonly limit: Schema.optionalKey<Schema.Int>; }> Host-only reconciliation pages proceed oldest first, without letting one unresolved operation block later ones.
Source: packages/host-api/src/audit.ts:109
AuditPort interface
interface AuditPort {
/** Buffered facilities acknowledge before disk flush; a host crash can lose accepted records. Disabled hosts refuse audited writes. */
readonly mode: 'durable' | 'buffered' | 'disabled';
/** Append with the host's declared persistence guarantee; identical ids deduplicate, changed content conflicts. */
append(events: readonly AuditEvent[], signal: AbortSignal): Promise<void>;
/** Search includes the full stored payload; list answers contain summaries only. */
query(query: AuditQuery, signal: AbortSignal): Promise<AuditPage>;
/** One full event from this facility's environment, or null when that id is absent. */
detail(id: string, signal: AbortSignal): Promise<AuditRecord | null>;
/** Prepared operations without `${operation_id}:terminal`; this facility is not exposed to page or tenant code. */
pending(query: AuditPendingQuery, signal: AbortSignal): Promise<AuditPendingPage>;
} The environment-bound host facility; callers cannot supply tenant or environment scope.
A separate store from the control and tenant databases (bolt_history stays in the tenant for restore and
rollback). Records expire 30 days after recorded_at; permanent tenant deletion purges them earlier, while a tenant
erase sanitizes history but leaves appended payloads until expiry. Workspace code has no append facility. The
stores share no atomic commit: an audited write's prepared intent is acknowledged before the tenant lease, and
recovery reconciles unresolved intents from the tenant's receipt and retained revisions.
Members
| Name | Type | Description |
|---|---|---|
mode | 'durable' | 'buffered' | 'disabled' | Buffered facilities acknowledge before disk flush; a host crash can lose accepted records. Disabled hosts refuse audited writes. |
append | (events: readonly AuditEvent[], signal: AbortSignal) => Promise<void> | Append with the host's declared persistence guarantee; identical ids deduplicate, changed content conflicts. |
query | (query: AuditQuery, signal: AbortSignal) => Promise<AuditPage> | Search includes the full stored payload; list answers contain summaries only. |
detail | (id: string, signal: AbortSignal) => Promise<AuditRecord | null> | One full event from this facility's environment, or null when that id is absent. |
pending | (query: AuditPendingQuery, signal: AbortSignal) => Promise<AuditPendingPage> | Prepared operations without |
Source: packages/host-api/src/audit.ts:131
AuditPreparedRecord const
const AuditPreparedRecord: Schema.Struct<{ readonly id: Schema.NonEmptyString; readonly operation_id: Schema.NonEmptyString; readonly at: Schema.String; readonly category: Schema.Literals<readonly ["write", "approval", "identity", "automation", "integration"]>; readonly action: Schema.NonEmptyString; readonly actor: Schema.Struct<{ readonly kind: Schema.Literals<readonly ["member", "envoy", "visitor", "api_key", "system"]>; readonly id: Schema.NullOr<Schema.NonEmptyString>; readonly label: Schema.NullOr<Schema.String>; }>; readonly subject: Schema.NullOr<Schema.Struct<{ readonly model: Schema.NonEmptyString; readonly i… A durable preparation awaiting a confirmed terminal event; its full payload is host-only reconciliation input.
Source: packages/host-api/src/audit.ts:71
AuditQuery const
const AuditQuery: Schema.Struct<{ readonly after: Schema.optionalKey<Schema.NonEmptyString>; readonly order: Schema.optionalKey<Schema.Literals<readonly ["newest", "oldest"]>>; readonly since: Schema.optionalKey<Schema.String>; readonly until: Schema.optionalKey<Schema.String>; readonly text: Schema.optionalKey<Schema.String>; readonly actor_kind: Schema.optionalKey<Schema.Literals<readonly ["member", "envoy", "visitor", "api_key", "system"]>>; readonly actor_id: Schema.optionalKey<Schema.String>; readonly category: Schema.optionalKey<Schema.Literals<readonly ["write", "approval", "identity", "automation", "in… Typed server filters; after is an opaque cursor bound to these filters and the requested time order.
Source: packages/host-api/src/audit.ts:82
AuditRecord const
const AuditRecord: Schema.Struct<{ readonly id: Schema.NonEmptyString; readonly operation_id: Schema.NonEmptyString; readonly at: Schema.String; readonly category: Schema.Literals<readonly ["write", "approval", "identity", "automation", "integration"]>; readonly action: Schema.NonEmptyString; readonly status: Schema.Literals<readonly ["prepared", "committed", "pending_approval", "refused", "conflict", "failed", "unknown"]>; readonly actor: Schema.Struct<{ readonly kind: Schema.Literals<readonly ["member", "envoy", "visitor", "api_key", "system"]>; readonly id: Schema.NullOr<Schema.NonEmptyString>; readonly labe… The full event returned only when its administrator opens the detail.
Source: packages/host-api/src/audit.ts:67
AuditSummary const
const AuditSummary: Schema.Struct<{ readonly id: Schema.NonEmptyString; readonly operation_id: Schema.NonEmptyString; readonly at: Schema.String; readonly category: Schema.Literals<readonly ["write", "approval", "identity", "automation", "integration"]>; readonly action: Schema.NonEmptyString; readonly status: Schema.Literals<readonly ["prepared", "committed", "pending_approval", "refused", "conflict", "failed", "unknown"]>; readonly actor: Schema.Struct<{ readonly kind: Schema.Literals<readonly ["member", "envoy", "visitor", "api_key", "system"]>; readonly id: Schema.NullOr<Schema.NonEmptyString>; readonly labe… One list row, without its potentially large payload.
Source: packages/host-api/src/audit.ts:64
authority
Authority const
const Authority: Schema.Struct<{ readonly actor: Schema.Union<readonly [Schema.Struct<{ readonly kind: Schema.Literal<"member">; readonly id: Schema.String; readonly email: Schema.NullOr<Schema.String>; readonly phone: Schema.NullOr<Schema.String>; readonly external: Schema.Boolean; readonly admin: Schema.Boolean; }>, Schema.Struct<{ readonly kind: Schema.Literal<"envoy">; readonly envoy: Schema.String; }>, Schema.Struct<{ readonly kind: Schema.Literal<"visitor">; readonly app: Schema.String; readonly visitor: Schema.String; }>, Schema.Struct<{ readonly kind: Schema.Literal<"api_key">; readonly key: Schema.St… A caller's authority as a host reads it.
Source: packages/host-api/src/authority.ts:35
browser
BROWSER_RUN_PROFILE const
const BROWSER_RUN_PROFILE: "\u0001run:" An automation run's browser profile: this prefix and the run id. The host discards it when the run's session ends.
Source: packages/host-api/src/browser.ts:8
facilities
Blob type
type Blob = {
key: string;
bytes: number;
sha256: string;
mime: string;
}; A stored blob; the sys_file row is the release's.
Members
| Name | Type | Description |
|---|---|---|
key | string | |
bytes | number | |
sha256 | string | |
mime | string |
Source: packages/host-api/src/facilities.ts:52
host
BranchPorts type
type BranchPorts = {
readonly release: Release;
readonly database: HostTenantDb;
/** The environment's durable host store; founder bootstrap, which mutates identity, refuses without it. */
readonly audit?: AuditPort;
/** As `LinkHost.keys`: credential restore seals through it, and refuses without it. */
readonly keys?: KeysPort;
}; A branch the host works on outside any serving generation: the lifecycle prepares one (provision, reset, probe, restore), and an operator changes a live one's integration instances. No guest code runs.
Members
| Name | Type | Description |
|---|---|---|
release | Release | |
database | HostTenantDb | |
audit? | AuditPort | The environment's durable host store; founder bootstrap, which mutates identity, refuses without it. |
keys? | KeysPort | As |
Source: packages/host-api/src/host.ts:226
browser
BrowserCaller type
type BrowserCaller = {
readonly actor: Actor;
readonly conversation: string;
readonly agent?: AgentMark;
}; Who a workspace page is opened for: the person, the conversation, and the agent's mark when it has one.
Members
| Name | Type | Description |
|---|---|---|
actor | Actor | |
conversation | string | |
agent? | AgentMark |
Source: packages/host-api/src/browser.ts:50
BrowserPort interface
interface BrowserPort {
/** Open the profile's isolated tab. A failed open is an error, and close must release any partial resources. */
open(profile: string, signal: AbortSignal): Promise<void>;
navigate(profile: string, to: BrowserTarget, find: string | undefined, signal: AbortSignal, viewport?: BrowserViewport): Promise<BrowserSnapshot>;
/**
* Open a page of the workspace as the person, signed in by the host's hand-off: the internal half of `browser`.
* A host that cannot sign its browser in omits it, and the agent is not offered workspace pages.
*/
open_workspace?(profile: string, target: BrowserWorkspaceTarget, caller: BrowserCaller, signal: AbortSignal): Promise<BrowserSnapshot>;
/** Close this profile's tab and release its page resources; its sealed sign-ins stay for the next open. */
close(profile: string, signal: AbortSignal): Promise<void>;
snapshot(profile: string, options: {
find?: string;
from?: number;
}, signal: AbortSignal): Promise<BrowserSnapshot>;
act(profile: string, steps: readonly BrowserStep[], signal: AbortSignal): Promise<BrowserSnapshot>;
evaluate(profile: string, expression: string, signal: AbortSignal): Promise<Json>;
screenshot(profile: string, signal: AbortSignal): Promise<Uint8Array>;
/**
* A media file at `url` fetched in the profile's session (its sign-ins) and stored as `FilesPort.download` stores one:
* classified by its first bytes, streamed into t… The browsing facility the built-in browser_* tools drive. Each profile is one browser of its own, its sign-ins and site data kept between calls: a person's id, or the release's run profile prefix + <run id>:<inference id> for one inference of a run. Pages answer as text with a ref on every control; a PDF answers its extracted text, page by page.
Members
| Name | Type | Description |
|---|---|---|
open | (profile: string, signal: AbortSignal) => Promise<void> | Open the profile's isolated tab. A failed open is an error, and close must release any partial resources. |
navigate | (profile: string, to: BrowserTarget, find: string | undefined, signal: AbortSignal, viewport?: BrowserViewport) => Promise<BrowserSnapshot> | |
open_workspace? | ((profile: string, target: BrowserWorkspaceTarget, caller: BrowserCaller, signal: AbortSignal) => Promise<BrowserSnapshot>) | undefined | Open a page of the workspace as the person, signed in by the host's hand-off: the internal half of |
close | (profile: string, signal: AbortSignal) => Promise<void> | Close this profile's tab and release its page resources; its sealed sign-ins stay for the next open. |
snapshot | (profile: string, options: { find?: string; from?: number; }, signal: AbortSignal) => Promise<BrowserSnapshot> | |
act | (profile: string, steps: readonly BrowserStep[], signal: AbortSignal) => Promise<BrowserSnapshot> | |
evaluate | (profile: string, expression: string, signal: AbortSignal) => Promise<Json> | |
screenshot | (profile: string, signal: AbortSignal) => Promise<Uint8Array> | |
download | (profile: string, url: string, signal: AbortSignal) => Promise<Downloaded> | A media file at |
Source: packages/host-api/src/browser.ts:60
BrowserSnapshot type
type BrowserSnapshot = typeof BrowserSnapshotSchema.Type; The readable page and its control refs (BrowserSnapshotSchema).
Members
| Name | Type | Description |
|---|---|---|
url | Schema.String | |
title | Schema.NullOr<Schema.String> | |
text | Schema.String |
Source: packages/host-api/src/browser.ts:19
BrowserSnapshotSchema const
const BrowserSnapshotSchema: Schema.StructWithRest<Schema.Struct<{ readonly url: Schema.String; readonly title: Schema.NullOr<Schema.String>; readonly text: Schema.String; }>, readonly [Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]> The readable page and its control refs, with host-provided page metadata retained.
Source: packages/host-api/src/browser.ts:14
BrowserStep type
type BrowserStep = typeof BrowserStepSchema.Type; One action on a ref from the current snapshot (BrowserStepSchema).
Source: packages/host-api/src/browser.ts:32
BrowserStepSchema const
const BrowserStepSchema: Schema.Union<readonly [Schema.Struct<{ readonly click: Schema.String; }>, Schema.Struct<{ readonly type: Schema.Struct<{ readonly ref: Schema.String; readonly text: Schema.String; readonly submit: Schema.optionalKey<Schema.Boolean>; }>; }>, Schema.Struct<{ readonly select: Schema.Struct<{ readonly ref: Schema.String; readonly value: Schema.String; }>; }>, Schema.Struct<{ readonly press: Schema.String; }>, Schema.Struct<{ readonly hover: Schema.String; }>, Schema.Struct<{ readonly scroll: Schema.Struct<{ readonly ref: Schema.optionalKey<Schema.String>; readonly y: Schema.optionalKey<Schema.Fin… One action on a ref from the current snapshot.
Source: packages/host-api/src/browser.ts:22
BrowserTarget type
type BrowserTarget = {
readonly url: string;
} | {
readonly go: 'back' | 'forward' | 'reload';
}; Where the agent's browser goes: a page, or back, forward or a reload of the one open.
Source: packages/host-api/src/browser.ts:35
BrowserViewport type
type BrowserViewport = {
width: number;
height: number;
device_scale_factor?: number;
}; The page's own CSS size and pixel density: what the person's browser would lay out at.
Members
| Name | Type | Description |
|---|---|---|
width | number | |
height | number | |
device_scale_factor? | number |
Source: packages/host-api/src/browser.ts:38
BrowserWorkspaceTarget type
type BrowserWorkspaceTarget = {
readonly environment: string;
readonly path?: string;
readonly device?: 'desktop' | 'tablet' | 'phone';
}; A workspace page the agent's browser opens: live, or a preview environment by its name.
Members
| Name | Type | Description |
|---|---|---|
environment | string | |
path? | string | |
device? | 'desktop' | 'tablet' | 'phone' |
Source: packages/host-api/src/browser.ts:44
facilities
BundleRequest type
type BundleRequest = {
/** sha256 hex of the sorted `<path>\0<sha256 hex of its bytes>` lines, `\n`-joined. */
readonly digest: string;
readonly entry: string;
readonly files: readonly (readonly [path: string, bytes: Uint8Array])[];
}; A file run's tree (a skill's folder): its digest, the entry's path in it, and every file by its path in the tree.
Members
| Name | Type | Description |
|---|---|---|
digest | string | sha256 hex of the sorted |
entry | string | |
files | readonly (readonly [path: string, bytes: Uint8Array])[] |
Source: packages/host-api/src/facilities.ts:312
Bundled type
type Bundled = {
readonly code: string;
readonly map: string;
} | {
readonly errors: readonly string[];
}; One ES module that imports nothing, with its source map (sources are tree paths), or the errors that stopped it, each file:line:column: message and the line. The module's default export is { run(input) }, which calls globalThis[Symbol.for('norbital.node')].run(input, load) with load evaluating the entry; each Node built-in a run provides (fs, fs/promises, path, buffer, process, util) is …builtin(name), and a require that does not resolve throws when called, naming the requirer.
Source: packages/host-api/src/facilities.ts:325
BundlerPort interface
interface BundlerPort {
bundle(request: BundleRequest, signal: AbortSignal): Promise<Bundled>;
} The confined bundler ("Running a file"): the host resolves the entry's imports inside the tree by Node's rules and bundles them in a confined process that serves one tenant, caching by (digest, entry, bundler version).
Members
| Name | Type | Description |
|---|---|---|
bundle | (request: BundleRequest, signal: AbortSignal) => Promise<Bundled> |
Source: packages/host-api/src/facilities.ts:331
membrane
CELL_ABI_VERSION const
const CELL_ABI_VERSION: 1 The kernel refuses a cell whose number differs from its own.
Source: packages/host-api/src/membrane.ts:20
facilities
CONVERT_MIME const
const CONVERT_MIME: Record<"pdf" | "docx" | "pptx" | "odt" | "epub" | "html", string> Each conversion target's media type.
Source: packages/host-api/src/facilities.ts:76
CONVERT_TARGETS const
const CONVERT_TARGETS: readonly ["pdf", "docx", "pptx", "odt", "epub", "html"] Every conversion target, in the order hosts report them.
Source: packages/host-api/src/facilities.ts:72
integrations
CalendarEvent type
type CalendarEvent = {
readonly id: string;
readonly summary: string | null;
readonly description: string | null;
readonly location: string | null;
readonly url: string | null;
readonly status: 'confirmed' | 'tentative' | 'cancelled';
readonly start: CalendarTime;
readonly end: CalendarTime;
/** Original provider event, including attendees, recurrence and identifiers needed by authored business rules. */
readonly source: Json;
}; One event a calendar driver pushes to a sync's read (items); the read's partition is its calendar (a sync's partitions names the text-many configuration field listing them, one cursor each). A changed calendar wakes its partition; lost history (retained: false) starts a fresh snapshot. All-day events keep their dates, timed events their instants and source zones.
Members
| Name | Type | Description |
|---|---|---|
id | string | |
summary | string | null | |
description | string | null | |
location | string | null | |
url | string | null | |
status | 'confirmed' | 'tentative' | 'cancelled' | |
start | CalendarTime | |
end | CalendarTime | |
source | Json | Original provider event, including attendees, recurrence and identifiers needed by authored business rules. |
Source: packages/host-api/src/integrations.ts:649
host
CarriedMigration const
const CarriedMigration: Schema.Struct<{ readonly path: Schema.String; readonly target: Schema.String; readonly text: Schema.optionalKey<Schema.String>; readonly merge: Schema.optionalKey<Schema.Struct<{ readonly base: Schema.String; readonly ours: Schema.String; readonly theirs: Schema.String; }>>; readonly clashes: Schema.$Array<Schema.String>; readonly snapshot: Schema.String; readonly lock: Schema.String; readonly at: Schema.Number; }> One of the author's migrations set on top of live: path the author's, target its place after live's. Its file is text, or, where the author edited what the generator wrote, the host's three-way merge of merge.theirs (the author's file) from merge.base (what the generator wrote them) onto merge.ours (what it writes on live). clashes say, in plain words, why it must stop for the author. snapshot and lock are the migrations/ files after it, and at the line's commit that brought it.
Source: packages/host-api/src/host.ts:492
cell
CellEnd type
type CellEnd = {
/** HOST_API in its wire form; `cookie_site` is its two answers, `[insecure, secure]`. */
readonly api: unknown;
/** One membrane message from the kernel. */
readonly receive: (message: unknown) => Answer;
/** A timer the kernel fired. */
readonly fire: (timer: number) => void;
}; What open answers: the marshalled HOST_API, and the cell's two entries.
Members
| Name | Type | Description |
|---|---|---|
api | unknown | HOST_API in its wire form; |
receive | (message: unknown) => Answer | One membrane message from the kernel. |
fire | (timer: number) => void | A timer the kernel fired. |
Source: packages/host-api/src/cell.ts:17
facilities
Challenge interface
interface Challenge {
readonly site_key: string;
verify(token: string, ip: string, signal: AbortSignal): Promise<boolean>;
} Turnstile-style bot protection: the public site key the widget renders, and the server-side check.
Members
| Name | Type | Description |
|---|---|---|
site_key | string | |
verify | (token: string, ip: string, signal: AbortSignal) => Promise<boolean> |
Source: packages/host-api/src/facilities.ts:236
conformance
Check type
type Check = {
readonly name: string;
readonly run: () => Promise<void>;
}; One conformance check: its name, and the Promise that rejects with why the release fails it.
Members
| Name | Type | Description |
|---|---|---|
name | string | |
run | () => Promise<void> |
Source: packages/host-api/src/conformance.ts:18
diagnostic
CheckDiagnostic type
type CheckDiagnostic = {
-readonly [K in keyof typeof Diagnostic.Type]: (typeof Diagnostic.Type)[K];
}; An author error as Studio shows it (Diagnostic), mutable for the checker that fills it.
Source: packages/host-api/src/diagnostic.ts:13
client
ClientPage type
type ClientPage = {
readonly file: string;
readonly document: boolean;
readonly headers: {
readonly [name: string]: string;
};
}; What a host answers at a path of a workspace's pages: the file to send and its headers.
Members
| Name | Type | Description |
|---|---|---|
file | string | |
document | boolean | |
headers | { readonly [name: string]: string; } |
Source: packages/host-api/src/client.ts:34
facilities
ConvertPort interface
interface ConvertPort {
readonly targets: readonly ConvertTarget[];
convert(source: ConvertSource, to: ConvertTarget, options: PreviewPdfOptions & {
reference?: Uint8Array;
}, signal: AbortSignal): Promise<Uint8Array>;
/** Renders in memory without retaining source or result in a job or file store. */
preview_pdf?(source: ConvertSource, options: PreviewPdfOptions, signal: AbortSignal): Promise<Uint8Array>;
ingest?(file: {
sha256: string;
name: string;
mime: string;
/** Bytes the caller holds, or else `key`: a stored file the host reads, so nothing large crosses into a cell. */
bytes?: Uint8Array | ReadableStream<Uint8Array>;
key?: string;
/** Whose it is: a burst of one tenant's files waits behind that tenant's own. */
lane?: string;
}, options: IngestOptions, signal: AbortSignal): Promise<Ingested | {
readonly unsupported: string;
}>;
} The document converter behind ctx.convert.document (optional; absent → unavailable). targets is what this host serves, checked at start against workspace.convert.to. reference is the bytes of a styling document (docx, pptx, odt). ingest reads one file to Ingested for the agent's read_file and ctx.convert.ingest, or answers unsupported (the format has no parser: CAD); absent, neither ingests. A video container is heard from its audio track; a converter without a transcription model rejects audio as unavailable.
Members
| Name | Type | Description |
|---|---|---|
targets | readonly ConvertTarget[] | |
convert | (source: ConvertSource, to: ConvertTarget, options: PreviewPdfOptions & { reference?: Uint8Array; }, signal: AbortSignal) => Promise<Uint8Array> | |
preview_pdf? | ((source: ConvertSource, options: PreviewPdfOptions, signal: AbortSignal) => Promise<Uint8Array>) | undefined | Renders in memory without retaining source or result in a job or file store. |
ingest? | ((file: { sha256: string; name: string; mime: string; bytes?: Uint8Array | ReadableStream<Uint8Array>; key?: string; lane?: string; }, options: IngestOptions, signal: AbortSignal) => Promise<Ingested | { readonly unsupported: string; }>) | undefined |
Source: packages/host-api/src/facilities.ts:120
ConvertSource type
type ConvertSource = {
readonly markdown: string;
} | {
readonly html: string;
} | {
readonly layout_html: string;
}; The source of a conversion: Markdown (pandoc's dialect, with pipe tables and front matter) or an HTML document. HTML is read for its structure (headings, tables, images, emphasis); its CSS does not carry into the output, and a PDF is typeset by Typst.
Source: packages/host-api/src/facilities.ts:95
ConvertTarget type
type ConvertTarget = (typeof CONVERT_TARGETS)[number]; A document format the converter can produce.
Source: packages/host-api/src/facilities.ts:74
host
CronEntry type
type CronEntry = {
readonly id: string;
readonly cron: string;
readonly zone: string;
}; One cron the manifest declares: an automation's (id its name) or a remote sync's periodic read.
Members
| Name | Type | Description |
|---|---|---|
id | string | |
cron | string | |
zone | string |
Source: packages/host-api/src/host.ts:287
CronFired type
type CronFired = {
readonly ran: boolean;
readonly until?: string;
}; ran: false: a repeat of (id, slot), a run that only read and wrote nothing, or a resting cron. until: the cron rests, and while the workspace is not in use the host need not fire it before this instant.
Members
| Name | Type | Description |
|---|---|---|
ran | boolean | |
until? | string |
Source: packages/host-api/src/host.ts:292
integrations
DATABASE_MAX_BYTES const
const DATABASE_MAX_BYTES: number Most JSON bytes a database result may carry (the crossing limit); more fails overflow.
Source: packages/host-api/src/integrations.ts:626
DATABASE_MAX_ROWS const
const DATABASE_MAX_ROWS: 1000 Default most rows a database result may carry; more fails overflow, never a truncation.
Source: packages/host-api/src/integrations.ts:624
system-1
DECISION_CALL_MS const
const DECISION_CALL_MS: 3000 System 1's wall: one decision call, at most 3 s (DECISION_LIMITS.call_ms).
Source: packages/host-api/src/system-1.ts:86
ai
DECISION_LIMITS const
const DECISION_LIMITS: { readonly call_ms: 3000; readonly max_images: 16; readonly max_image_bytes: number; readonly max_choices: 255; readonly min_score_levels: 1; readonly max_score_levels: 10; readonly openai_max_questions: 400; readonly openai_min_options: 2; } Authoritative bounds for one System 1 (sys_1) decision call: wall timeout, inline image budget, question/option cardinalities, and provider-specific caps.
Members
| Name | Type | Description |
|---|---|---|
call_ms | 3000 | Maximum wall time for one |
max_images | 16 | Maximum number of inline PNG/JPEG images allowed inside |
max_image_bytes | number | Maximum combined decoded byte size of inline images inside |
max_choices | 255 | Maximum choices per |
min_score_levels | 1 | Minimum criterion levels for a |
max_score_levels | 10 | Maximum criterion levels for a |
openai_max_questions | 400 | Maximum questions per call on the OpenAI |
openai_min_options | 2 | Minimum choices/levels per question on the OpenAI |
Source: packages/host-api/src/ai.ts:61
media
DOWNLOAD const
const DOWNLOAD: { readonly maxBytes: number; readonly idleMs: 20000; readonly redirects: 5; readonly headBytes: 4096; } download's limits: the body cap, the stall that ends it, the redirect hops followed, and the head its type is read from.
Members
| Name | Type | Description |
|---|---|---|
maxBytes | number | |
idleMs | 20000 | |
redirects | 5 | |
headBytes | 4096 |
Source: packages/host-api/src/media.ts:107
integrations
DatabaseDriver interface
interface DatabaseDriver {
query(credential: Json, request: DatabaseRequest, signal: AbortSignal): Promise<DatabaseResult>;
} A host's database driver (a request-only link's implementation); it must not expose its connection in answers or errors.
Members
| Name | Type | Description |
|---|---|---|
query | (credential: Json, request: DatabaseRequest, signal: AbortSignal) => Promise<DatabaseResult> |
Source: packages/host-api/src/integrations.ts:628
DatabaseRequest const
const DatabaseRequest: Schema.Union<readonly [Schema.Struct<{ readonly max_rows: Schema.optionalKey<Schema.Int>; readonly transaction: Schema.optionalKey<Schema.Literal<"serializable">>; readonly op: Schema.Literal<"values">; readonly values: Schema.$Record<Schema.NonEmptyString, Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean, Schema.Null]>>; }>, Schema.Struct<{ readonly max_rows: Schema.optionalKey<Schema.Int>; readonly transaction: Schema.optionalKey<Schema.Literal<"serializable">>; readonly op: Schema.Literal<"read">; readonly table: Schema.Struct<{ readonly schema: Schema.NonEmptyString; re… Schema of one structured database program a guest sends through a database link (today the SQL Server shape): values, read, call, CDC metadata and pages, and insert_once. The workspace names qualified tables, projected columns, filters, decimal/date formats and its delete policy; the host compiles the native SQL. CDC pages reconcile current rows and tombstones from an inclusive LSN/sequence/operation/key cursor. insert_once takes an immutable key and fingerprint, a five-second native lock and one serializable header/child/procedure batch, and answers an exact receipt; call names a procedure with typed arguments over native RPC. Cancellation, row and byte bounds, TLS identity and network admission apply to every program.
Example
yield* ctx.request(erp, { op: 'read', table: { schema: 'accounting', name: 'products' }, columns: ['code', 'name'],
where: { active: true }, max_rows: 100 }); Source: packages/host-api/src/integrations.ts:616
DatabaseResult const
const DatabaseResult: Schema.Struct<{ readonly rows: Schema.$Array<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>; }> Schema of a database link's answer: its rows as JSON column maps.
Source: packages/host-api/src/integrations.ts:619
db
DbBatch type
type DbBatch = {
readonly statements: readonly Sql[];
readonly lock?: Lock;
/** Native dry-run: execute and answer the statements, then roll back all of their effects. */
readonly rollback?: true;
}; Complete database work, prepared before a connection is acquired; no application callback runs inside it.
Members
| Name | Type | Description |
|---|---|---|
statements | readonly Sql[] | |
lock? | Lock | |
rollback? | true | Native dry-run: execute and answer the statements, then roll back all of their effects. |
Source: packages/host-api/src/db.ts:21
errors
DbError class
class DbError extends DbError_base {
static make(...args: [sqlstate: string, message: string, constraint?: string, column?: string]): DbError;
/** The Schema class's own form (`new DbError(props)`), which the static side keeps. */
static make(...args: [props: DbErrorProps, options?: Schema.MakeOptions]): DbError;
} What a Postgres adapter fails with: the SQLSTATE and constraint the write compiler maps to a refusal.
Members
| Name | Type | Description |
|---|---|---|
message | string | |
sqlstate | Schema.String | |
outcome_unknown? | Schema.optionalKey<Schema.Literal<true>> | |
constraint? | Schema.optional<Schema.String> | |
column? | Schema.optional<Schema.String> |
Source: packages/host-api/src/errors.ts:51
deadline-timer
DeadlineCompletion type
type DeadlineCompletion = {
readonly callbackAtEpochMs: number | null | undefined;
readonly mergeAnnouncements: boolean;
}; What a wake answers: its next deadline in epoch milliseconds (none when absent), and whether a deadline announced during the wake still counts, the earlier one winning.
Members
| Name | Type | Description |
|---|---|---|
callbackAtEpochMs | number | null | undefined | |
mergeAnnouncements | boolean |
Source: packages/host-api/src/deadline-timer.ts:12
DeadlineEntry type
type DeadlineEntry<Subject> = {
readonly key: string;
readonly subject: Subject;
readonly at: number;
}; One armed deadline: its key, the subject it wakes and its instant in epoch milliseconds.
Members
| Name | Type | Description |
|---|---|---|
key | string | |
subject | Subject | |
at | number |
Source: packages/host-api/src/deadline-timer.ts:6
DeadlineTimer const
const DeadlineTimer: { make: <Subject, R = never>(callbacks: { readonly wake: (entry: DeadlineEntry<Subject>) => Effect.Effect<DeadlineCompletion, never, R>; readonly pulse: (entry: DeadlineEntry<Subject>) => Effect.Effect<boolean, never, R>; }) => Effect.Effect<DeadlineTimer<Subject>, never, Scope.Scope | R>; } One clock timer; a due announcement during a wake signals its owner instead of starting another wake.
Members
| Name | Type | Description |
|---|---|---|
make | <Subject, R = never>(callbacks: { readonly wake: (entry: DeadlineEntry<Subject>) => Effect.Effect<DeadlineCompletion, never, R>; /** False hands the notification back to the next wake, without spinning while the current one closes. */ readonly pulse: (entry: DeadlineEntry<Subject>) => Effect.Effect<boolean, never, R>; }) => Effect.Effect<DeadlineTimer<Subject>, never, Scope.Scope | R> |
Source: packages/host-api/src/deadline-timer.ts:16
facilities
DeadlinesPort interface
interface DeadlinesPort {
announce(scope: string, notLaterThan: string): Promise<void>;
settle(scope: string, nextDue: string | null): Promise<void>;
teardown(scope: string): Promise<void>;
} One next-due instant per scope, held in host memory; no polling.
Members
| Name | Type | Description |
|---|---|---|
announce | (scope: string, notLaterThan: string) => Promise<void> | |
settle | (scope: string, nextDue: string | null) => Promise<void> | |
teardown | (scope: string) => Promise<void> |
Source: packages/host-api/src/facilities.ts:243
ai
DecisionAnswer type
type DecisionAnswer = typeof DecisionAnswerSchema.Type; One System 1 answer to a question: a noul probability, a choice or a score, each with its probabilities.
Source: packages/host-api/src/ai.ts:160
DecisionAnswerSchema const
const DecisionAnswerSchema: Schema.Union<readonly [Schema.Struct<{ readonly type: Schema.Literal<"noul">; readonly noul: Schema.Finite; }>, Schema.Struct<{ readonly type: Schema.Literal<"choice">; readonly choice: Schema.String; readonly confidence: Schema.Finite; readonly probabilities: Schema.$Record<Schema.String, Schema.Finite>; }>, Schema.Struct<{ readonly type: Schema.Literal<"score">; readonly score: Schema.Finite; readonly level: Schema.Int; readonly confidence: Schema.Finite; readonly probabilities: Schema.$Record<Schema.String, Schema.Finite>; readonly legend: Schema.$Record<Schema.String, Schema.Union<readonl… Schema of one System 1 answer: noul probability in [0, 1], choice with winning key and normalized distribution, or score with expected value, 0-based winning level index (mapped to the criterion value at the guest boundary), distribution, and legend.
Source: packages/host-api/src/ai.ts:142
DecisionEntrySchema const
const DecisionEntrySchema: Schema.Union<readonly [Schema.String, Schema.Null, Schema.$Array<Schema.Codec<Schema.Json, Schema.Json, never, never>>, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]> Structured entry in a System 1 question or criterion: string, null, JSON array, or JSON object.
Source: packages/host-api/src/ai.ts:82
DecisionQuestionSchema const
const DecisionQuestionSchema: Schema.Union<readonly [Schema.Struct<{ readonly type: Schema.Literal<"noul">; readonly instructions: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null, Schema.$Array<Schema.Codec<Schema.Json, Schema.Json, never, never>>, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>>; readonly criteria: Schema.optionalKey<Schema.NullOr<Schema.Struct<{ readonly true: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null, Schema.$Array<Schema.Codec<Schema.Json, Schema.Json, never, never>>, Schema.$Record<Schema.String, Schema.Codec<Schema… One typed System 1 question: noul (binary probability), choice (categorical), or score (1–10 ordinal levels).
Source: packages/host-api/src/ai.ts:95
DecisionRequest type
type DecisionRequest = typeof DecisionRequestSchema.Type; One System 1 call (DecisionRequestSchema): the state it reads and its questions by key.
Members
| Name | Type | Description |
|---|---|---|
state | Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Codec<Schema.Json, Schema.Json, never, never>>, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]> | |
questions | Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Struct<{ readonly type: Schema.Literal<"noul">; readonly instructions: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null, Schema.$Array<Schema.Codec<Schema.Json, Schema.Json, never, never>>, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>>; readonly criteria: Schema.optionalKey<Sch… |
Source: packages/host-api/src/ai.ts:136
DecisionRequestSchema const
const DecisionRequestSchema: Schema.Struct<{ readonly state: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Codec<Schema.Json, Schema.Json, never, never>>, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>; readonly questions: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Struct<{ readonly type: Schema.Literal<"noul">; readonly instructions: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Null, Schema.$Array<Schema.Codec<Schema.Json, Schema.Json, never, never>>, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>… One System 1 decision request: shared state (JSON/text plus resolved inline PNG/JPEG images) and a non-empty map of independent questions. Intended for fixed-set classification, triage, routing, predicates, and ordinal scoring — never free-form or recursive AST generation (use sys_2.infer for that).
Source: packages/host-api/src/ai.ts:129
DecisionResult const
const DecisionResult: Schema.Struct<{ readonly answers: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Struct<{ readonly type: Schema.Literal<"noul">; readonly noul: Schema.Finite; }>, Schema.Struct<{ readonly type: Schema.Literal<"choice">; readonly choice: Schema.String; readonly confidence: Schema.Finite; readonly probabilities: Schema.$Record<Schema.String, Schema.Finite>; }>, Schema.Struct<{ readonly type: Schema.Literal<"score">; readonly score: Schema.Finite; readonly level: Schema.Int; readonly confidence: Schema.Finite; readonly probabilities: Schema.$Record<Schema.String, Schema.Finite>; rea… Schema of a System 1 answer set: one answer per question key, with the provider, model, cost and token usage.
Source: packages/host-api/src/ai.ts:162
DecisionStateSchema const
const DecisionStateSchema: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Codec<Schema.Json, Schema.Json, never, never>>, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]> Non-null shared evidence state for one System 1 decision call (text, JSON, and resolved inline PNG/JPEG images).
Source: packages/host-api/src/ai.ts:89
system-1
DecisionsApiConfig type
type DecisionsApiConfig = {
/** Jev/OpenRouter by default; OpenAI native `/v1/decisions` uses its own wire format. */
format?: DecisionsApiFormat;
url: string;
model: string;
api_key: string;
timeout_ms?: number | undefined;
}; Configuration for decisions_system_1: endpoint URL, wire format, default model, bearer key, and optional timeout wall.
Members
| Name | Type | Description |
|---|---|---|
format? | DecisionsApiFormat | Jev/OpenRouter by default; OpenAI native |
url | string | |
model | string | |
api_key | string | |
timeout_ms? | number | undefined |
Source: packages/host-api/src/system-1.ts:235
DecisionsApiFormat type
type DecisionsApiFormat = 'jev' | 'openai'; Wire format spoken by an HTTP Decisions API endpoint (jev native wire or OpenAI /v1/decisions).
Source: packages/host-api/src/system-1.ts:233
integrations
DeliveryReport type
type DeliveryReport = {
kind: (typeof REPORTED_KINDS)[number];
at: string;
provider: string;
code?: string;
reason?: string;
permanent?: boolean;
presumed?: boolean;
approximate?: boolean;
/** Bounded to 4 KB by the release. */
raw?: Json;
}; What a provider reports about one message it sent, keyed by the provider_id its send returned.
Members
| Name | Type | Description |
|---|---|---|
kind | (typeof REPORTED_KINDS)[number] | |
at | string | |
provider | string | |
code? | string | |
reason? | string | |
permanent? | boolean | |
presumed? | boolean | |
approximate? | boolean | |
raw? | Json | Bounded to 4 KB by the release. |
Source: packages/host-api/src/integrations.ts:265
diagnostic
Diagnostic const
const Diagnostic: Schema.Struct<{ readonly code: Schema.String; readonly path: Schema.String; readonly line: Schema.optionalKey<Schema.Number>; readonly message: Schema.String; readonly help: Schema.optionalKey<Schema.String>; }> An author error; line (1-based) when the checker names one.
Source: packages/host-api/src/diagnostic.ts:5
convert
DocumentConverter type
type DocumentConverter = {
readonly targets: readonly ConvertTarget[];
readonly convert: (source: ConvertSource, to: ConvertTarget, options: PreviewPdfOptions & {
reference?: Uint8Array;
}) => Effect.Effect<Uint8Array, PortFailure>;
readonly previewPdf: (source: ConvertSource, options: PreviewPdfOptions) => Effect.Effect<Uint8Array, PortFailure>;
}; A converter as Effects: what a host adapts to its ConvertPort (convert, preview_pdf).
Members
| Name | Type | Description |
|---|---|---|
targets | readonly ConvertTarget[] | |
convert | (source: ConvertSource, to: ConvertTarget, options: PreviewPdfOptions & { reference?: Uint8Array; }) => Effect.Effect<Uint8Array, PortFailure> | |
previewPdf | (source: ConvertSource, options: PreviewPdfOptions) => Effect.Effect<Uint8Array, PortFailure> |
Source: packages/host-api/src/convert.ts:17
facilities
Downloaded type
type Downloaded = Blob & {
name: string;
}; A media file the host fetched for a tool: classified by its bytes, stored, never run.
Members
| Name | Type | Description |
|---|---|---|
key | string | |
bytes | number | |
sha256 | string | |
mime | string | |
name | string |
Source: packages/host-api/src/facilities.ts:54
integrations
DriverEvent type
type DriverEvent = {
kind: 'messages';
messages: readonly Json[];
history?: true;
bins?: readonly Uint8Array[];
}
/** Await registration before sending when the provider chooses its message id before I/O. */
| ({
kind: 'outbound_ref';
} & OutboundReference) | {
kind: 'delivery';
provider_id: string;
report: DeliveryReport;
} | {
kind: 'clear';
thread: string;
before: string;
}
/** The sender is typing (`typing: true`) in `thread`: a held burst waits for the rest, up to its cap. */
| {
kind: 'presence';
thread: string;
typing: boolean;
} | {
kind: 'invalidate';
sync: string;
partition: string;
}; What an instance's link hands the engine (integrations.receive): inbound conversation messages (each attachment { name, mime, bytes, bin? }, its bytes in bins at bin; history is a backfill nobody waits on), a provider's report on a message it sent (provider_id is what its send answered), a chat the account cleared or deleted (clear: every message of thread sent at or before before is tombstoned), or a pushing driver's changed sync partition (sync: '<model>.<sync>').
Source: packages/host-api/src/integrations.ts:286
DriverOpen type
type DriverOpen = {
instance: string;
/** The instance's integration definition, including its request and credential fields. */
definition: IntegrationDefinition;
/** Model read syncs using this instance's definition; `name` is `'<model>.sync.<sync>'`. */
readonly syncs: readonly {
readonly name: string;
/** The configuration field whose values partition this sync, otherwise one default partition. */
readonly partitions?: string;
}[];
/** A personal instance (an owner's own account): it syncs and never sends a message; a command may write back to it. */
personal: boolean;
configuration: Json;
/** Frozen source import boundary; absent or null retains all history. */
import_start?: ImportStart | null;
/** This instance's own inbound URL, shown to the operator and registered with the provider where it can. */
webhook_url: string;
/**
* The host's one OAuth redirect URI (`<public URL>/hooks/oauth/callback`), the same for every instance: register it
* with the OAuth app once. Its callback reaches this link's `webhook` by the `state` it carries, minted by `state()`.
*/
redirect_url: string;
/**
* A fresh, unguessable OAuth `state` that routes its callback back to this instance; the link still checks it is its
* own. Asynchronous, as every call into the engine: the engine may be in another isolate.
*/
state(): Promise<string>;
/** Aborted when the link clos… What the links manager hands a provider to open one instance's link. Credentials stay host-side, under the opener's epoch.
Members
| Name | Type | Description |
|---|---|---|
instance | string | |
definition | IntegrationDefinition | The instance's integration definition, including its request and credential fields. |
syncs | readonly { readonly name: string; /** The configuration field whose values partition this sync, otherwise one default partition. */ readonly partitions?: string; }[] | Model read syncs using this instance's definition; |
personal | boolean | A personal instance (an owner's own account): it syncs and never sends a message; a command may write back to it. |
configuration | Json | |
import_start? | ImportStart | null | Frozen source import boundary; absent or null retains all history. |
webhook_url | string | This instance's own inbound URL, shown to the operator and registered with the provider where it can. |
redirect_url | string | The host's one OAuth redirect URI ( |
state | () => Promise<string> | A fresh, unguessable OAuth |
signal | AbortSignal | Aborted when the link closes or is replaced. |
fetch | typeof fetch | The fetch to reach the provider with (tests pass a fake). |
tcp | TcpPort | Raw TCP/TLS to the provider's servers (IMAP, SMTP), under the host's egress policy. |
oauth_client | (vendor?: OAuthVendor) => Promise<OAuthClient | undefined> | The OAuth client to grant with for |
credentials | { load(): Promise<ReadonlyMap<string, Json>>; write(changes: ReadonlyMap<string, Json | null>): Promise<void>; } | The instance's credentials as they were when the link opened ( |
emit | (e: DriverEvent) => Promise<void> | Into the engine: resolves after it committed; a rejection means "do not acknowledge", so the provider redelivers. |
status | (s: LinkStatus) => Promise<void> | The link moved; a durable state (connected, unpaired, error) lands on the instance row when it changed. |
pairing | (p: Pairing | null) => void | An ephemeral QR or code (or |
Source: packages/host-api/src/integrations.ts:474
DriverPage type
type DriverPage = {
items: readonly Json[];
cursor: Json;
more: boolean;
snapshot?: 'begin' | 'end';
retained?: false;
health?: {
state: 'ready' | 'attention';
code?: string;
message?: string;
};
}; A pushing driver's page of a sync partition: its items (the sync read's items), and the page facts a read page carries.
Members
| Name | Type | Description |
|---|---|---|
items | readonly Json[] | |
cursor | Json | |
more | boolean | |
snapshot? | 'begin' | 'end' | |
retained? | false | |
health? | { state: 'ready' | 'attention'; code?: string; message?: string; } |
Source: packages/host-api/src/integrations.ts:308
ai
EmbedInput type
type EmbedInput = string | {
readonly $file: {
readonly name: string;
readonly mime: string;
readonly sha256: string;
readonly bytes: Uint8Array;
};
} | {
readonly $stored: {
readonly key: string;
readonly name: string;
readonly mime: string;
readonly sha256: string;
readonly bytes: number;
};
}; Bytes supplied by a host, or a stored file the provider reads outside the cell.
Source: packages/host-api/src/ai.ts:201
EmbeddingsPort interface
interface EmbeddingsPort {
/** `dimensions`: the vector length the caller stores (a model that truncates, Matryoshka-style, answers at it). */
embed(inputs: readonly EmbedInput[], model: string, signal: AbortSignal, dimensions?: number): Promise<readonly (readonly number[])[]>;
} Embeds text and files into vectors, one per input, with the model the caller names.
Members
| Name | Type | Description |
|---|---|---|
embed | (inputs: readonly EmbedInput[], model: string, signal: AbortSignal, dimensions?: number) => Promise<readonly (readonly number[])[]> |
|
Source: packages/host-api/src/ai.ts:244
errors
FACILITY_KINDS const
const FACILITY_KINDS: readonly ["upstream", "timeout", "rate_limited", "invalid", "too_large", "unsupported"] A facility failure's kinds: too_large and invalid pass a provider's own limit refusal through.
Source: packages/host-api/src/errors.ts:6
first-party
FIRST_PARTY_BUNFIG const
const FIRST_PARTY_BUNFIG: string The bunfig.toml of every bun consumer of the set: template repositories, templates, the realm and Colony's fixtures.
Source: packages/host-api/src/first-party.ts:18
FIRST_PARTY_PACKAGES const
const FIRST_PARTY_PACKAGES: readonly ["@norbital-ai/app-shell", "@norbital-ai/bolt", "@norbital-ai/bolt-cli", "@norbital-ai/bolt-server", "@norbital-ai/host-api", "@norbital-ai/providers", "@norbital-ai/store", "@norbital-ai/ui"] Every published @norbital-ai/* package.
Source: packages/host-api/src/first-party.ts:6
facilities
Facilities type
type Facilities = {
readonly storage: {
/** Tenant rows (run status and chat history included): the engine's SQL over the host's driver. */
readonly database: HostTenantDb;
/** Uploads and blobs. */
readonly files: FilesPort;
};
readonly logs: {
/** Runtime events; the host may drop entries under load. */
readonly runtime: LogPort;
/** The durable audit stream, outside the tenant database, surviving a tenant restore. */
readonly audit: AuditPort;
};
readonly transactional: {
/** Emailed codes and invitations: `send('email', message, signal)`. Mandatory for every host. */
readonly mail: TransportPort;
/** Texted invitations: `send('sms', message, signal)`. */
readonly sms: Optional<TransportPort>;
/** Sends and checks a mobile number's sign-in code. */
readonly phone: Optional<PhoneVerifier>;
/** Web and native push for inbox notices, over the environment's database (a gone subscription is deleted there). */
readonly push: Optional<(database: HostTenantDb) => TransportPort>;
/** Bot protection for public sign-up; with none, the host refuses strangers (except a local host). */
readonly challenge: Optional<Challenge>;
/** `true` on a local host: every sign-in code is `123456`; a deployed host's are random. */
readonly fixed_codes: boolean;
};
readonly intelligence: {
/** Fast structure… Everything a host supplies to run a bundle.
Without a host file, Colony supplies them all (tethered, the default). A workspace's norbital.host.ts, or the file
bolt dev --host=<file> names, serves it untethered (bolt dev, bolt-server): its default export is this record
(satisfies Facilities), and an optional serving export adds the parts served around it ({@link Serving}). The
host file never enters the release's source. Every key is required: off is the only way to leave an optional
member out, and mail has none. Activation refuses a bundle whose recorded needs name a member left off, naming
each one. The guest runner is no facility: each host owns its own (HostPorts.guests).
Members
| Name | Type | Description |
|---|---|---|
storage | { /** Tenant rows (run status and chat history included): the engine's SQL over the host's driver. */ readonly database: HostTenantDb; /** Uploads and blobs. */ readonly files: FilesPort; } | |
logs | { /** Runtime events; the host may drop entries under load. */ readonly runtime: LogPort; /** The durable audit stream, outside the tenant database, surviving a tenant restore. */ readonly audit: AuditPort; } | |
transactional | { /** Emailed codes and invitations: `send('email', message, signal)`. Mandatory for every host. */ readonly mail: TransportPort; /** Texted invitations: `send('sms', message, signal)`. */ readonly sms: Optional<TransportPort>; /** Sends and checks a mobile number's sign-in code. */ readonly phone: Optional<PhoneVerifier>; /** Web and native push for inbox notices, over the environment's database… | |
intelligence | { /** Fast structured decisions (`ctx.ai.sys_1.decide`, triage). */ readonly system1: Optional<AiPort['sys_1']>; /** The LLM (`ctx.ai.sys_2.infer`, agents). */ readonly system2: Optional<AiPort['sys_2']>; /** Multimodal embeddings (`ctx.ai.embed`). */ readonly embed: Optional<EmbeddingsPort>; } | |
ports | { /** The public URL under which the host routes `/hooks/integration/<instance>` and OAuth callbacks into the release. */ readonly webhooks: Optional<{ readonly public_url: string; }>; /** HTTP for APIs and OAuth, TCP/TLS for IMAP and SMTP, under the host's egress policy. */ readonly outbound: Optional<{ readonly http: HttpPort; readonly tcp: TcpPort; }>; } | |
keys | KeysPort | The tenant's secrets key, held by the host ( |
Source: packages/host-api/src/facilities.ts:378
errors
FacilityFailure class
class FacilityFailure extends FacilityFailure_base {
/** Refuses invalid facility input without changing the shared tagged error identity. */
static invalid(message: string): FacilityFailure;
} A failed facility call: its kind, message, HTTP status and optional provider retry delay.
Members
| Name | Type | Description |
|---|---|---|
kind | Schema.Literals<readonly ["upstream", "timeout", "rate_limited", "invalid", "too_large", "unsupported"]> | |
message | string | |
status? | Schema.optional<Schema.Number> | |
retry_after_ms? | Schema.optional<Schema.Finite> | The provider's minimum delay before another attempt. |
Source: packages/host-api/src/errors.ts:15
host
Feedback type
type Feedback = {
readonly text: string;
/** Stored file references of what they attached, as an agent message carries them. */
readonly files: readonly Json[];
readonly route: string;
}; What a person sent from the shell's Feedback dialog: their words, the files they attached and the page they were on.
Members
| Name | Type | Description |
|---|---|---|
text | string | |
files | readonly Json[] | Stored file references of what they attached, as an agent message carries them. |
route | string |
Source: packages/host-api/src/host.ts:129
errors
Fenced class
class Fenced extends Fenced_base {
} Another link opened the instance since this one did (its epoch moved); terminal for the fenced link.
Members
| Name | Type | Description |
|---|---|---|
instance | Schema.String | |
message | string |
Source: packages/host-api/src/errors.ts:68
facilities
FilesPort interface
interface FilesPort {
put(bytes: Uint8Array, meta: {
name: string;
mime: string;
}, signal: AbortSignal): Promise<Blob>;
/** At most `max` bytes; more is `invalid`, never a truncation. */
get(key: string, max: number, signal: AbortSignal): Promise<Uint8Array>;
url(key: string, expiresInS: number, signal: AbortSignal): Promise<string>;
remove(key: string, signal: AbortSignal): Promise<void>;
/**
* Fetches a public http(s) URL under the host's egress policy (every redirect hop re-checked, at most 5) and stores
* its body if its first bytes are media (image, audio, video, PDF); anything else is refused, never stored. The host
* streams it (at most 100 MiB, 20 s without bytes ends it) and names it from the response or the URL.
*/
download(url: string, signal: AbortSignal): Promise<Downloaded>;
} The host's blob store behind ctx.files and the sys_file rows: put, bounded get, signed URL, remove and media download.
Members
| Name | Type | Description |
|---|---|---|
put | (bytes: Uint8Array, meta: { name: string; mime: string; }, signal: AbortSignal) => Promise<Blob> | |
get | (key: string, max: number, signal: AbortSignal) => Promise<Uint8Array> | At most |
url | (key: string, expiresInS: number, signal: AbortSignal) => Promise<string> | |
remove | (key: string, signal: AbortSignal) => Promise<void> | |
download | (url: string, signal: AbortSignal) => Promise<Downloaded> | Fetches a public http(s) URL under the host's egress policy (every redirect hop re-checked, at most 5) and stores its body if its first bytes are media (image, audio, video, PDF); anything else is refused, never stored. The host streams it (at most 100 MiB, 20 s without bytes ends it) and names it from the response or the URL. |
Source: packages/host-api/src/facilities.ts:56
answers
FounderAnswer const
const FounderAnswer: Schema.Union<readonly [Schema.TaggedStruct<"Founded", { readonly user: Schema.String; }>, Schema.TaggedStruct<"FounderRefused", { readonly code: Schema.String; readonly message: Schema.String; }>]> founder.bootstrap: the first administrator, or the identity refusal (forbidden: one exists already).
Source: packages/host-api/src/answers.ts:54
facilities
GeoHit type
type GeoHit = {
readonly point: Point;
readonly label: string;
readonly address: string;
}; A geocoding result: the point, a short label and the full address.
Members
| Name | Type | Description |
|---|---|---|
point | Point | |
label | string | |
address | string |
Source: packages/host-api/src/facilities.ts:164
GeocoderPort interface
interface GeocoderPort {
search(query: string, signal: AbortSignal): Promise<readonly GeoHit[]>;
reverse(point: Point, signal: AbortSignal): Promise<GeoHit | null>;
} Finds places by text and names the place at a point.
Members
| Name | Type | Description |
|---|---|---|
search | (query: string, signal: AbortSignal) => Promise<readonly GeoHit[]> | |
reverse | (point: Point, signal: AbortSignal) => Promise<GeoHit | null> |
Source: packages/host-api/src/facilities.ts:166
guest
GuestAnswers type
type GuestAnswers = {
readonly ids: readonly number[];
readonly texts: readonly string[];
readonly bins: readonly (readonly Uint8Array[])[];
}; One batch's answers (give): call ids, one JSON text per call, and each call's bytes.
Members
| Name | Type | Description |
|---|---|---|
ids | readonly number[] | |
texts | readonly string[] | |
bins | readonly (readonly Uint8Array[])[] |
Source: packages/host-api/src/guest.ts:57
GuestCall type
type GuestCall = readonly [member: string, args: string, site: string, id: number]; One queued ctx call: member, JSON arguments, call site (stack frame) and call id.
Source: packages/host-api/src/guest.ts:55
GuestFinal type
type GuestFinal = typeof GuestFinalSchema.Type; A guest invocation's end state as the prelude reports it (GuestFinalSchema).
Source: packages/host-api/src/guest.ts:14
GuestFinalSchema const
const GuestFinalSchema: Schema.Union<readonly [Schema.Tuple<readonly [Schema.Literal<"ok">, Schema.String]>, Schema.Tuple<readonly [Schema.Literal<"refused">, Schema.String, Schema.NullOr<Schema.String>, Schema.NullOr<Schema.Int>, Schema.String]>, Schema.Tuple<readonly [Schema.Literal<"missing">, Schema.String]>, Schema.Tuple<readonly [Schema.Literal<"error">, Schema.String, Schema.String, Schema.String]>, Schema.Tuple<readonly [Schema.Literal<"error">, Schema.String, Schema.String, Schema.String, Schema.String]>]> Values produced by the tenant-controlled prelude, decoded before the host or engine consumes them.
Source: packages/host-api/src/guest.ts:6
GuestIsolatesPort interface
interface GuestIsolatesPort {
open(program: GuestProgram, options: GuestSessionOptions, signal: AbortSignal): Promise<string>;
start(session: string, start: GuestStart, signal: AbortSignal): Promise<GuestTurn>;
take(session: string, signal: AbortSignal): Promise<GuestTurn>;
give(session: string, answers: GuestAnswers, signal: AbortSignal): Promise<GuestTurn>;
close(session: string): Promise<void>;
} Guest isolates, made and metered by the host. open evaluates prelude as an evalClosure body with the hooks $0 say (lines buffered for the turn), $1 random (from seed), $2 digest (crypto.subtle.digest's host half) and $3 asset (program.assets by sha256), then program.source as one module bound to __boltGuest; it answers an opaque session id. start and give run their prelude hook and then take(), take only take() (after a turn whose timer ran): each call is one native slice, under a CPU slot the host takes for it. A session past its unit's CPU budget or its memory ends and rejects with an encoded HostFailure of code cpu_budget or memory; an aborted call ends its session. close disposes it (idempotent).
Members
| Name | Type | Description |
|---|---|---|
open | (program: GuestProgram, options: GuestSessionOptions, signal: AbortSignal) => Promise<string> | |
start | (session: string, start: GuestStart, signal: AbortSignal) => Promise<GuestTurn> | |
take | (session: string, signal: AbortSignal) => Promise<GuestTurn> | |
give | (session: string, answers: GuestAnswers, signal: AbortSignal) => Promise<GuestTurn> | |
close | (session: string) => Promise<void> |
Source: packages/host-api/src/guest.ts:71
GuestProgram type
type GuestProgram = {
source: string;
source_map?: string;
assets?: Readonly<Record<string, Uint8Array>>;
}; A compiled guest bundle the runner loads: its JavaScript source, optional source map and embedded assets.
Members
| Name | Type | Description |
|---|---|---|
source | string | |
source_map? | string | |
assets? | Readonly<Record<string, Uint8Array>> |
Source: packages/host-api/src/guest.ts:32
GuestSessionOptions type
type GuestSessionOptions = {
readonly prelude: string;
/** `$1` draws SHA-256 blocks of it (`random_stream`), so a replay with the same seed draws the same values. */
readonly seed: string;
readonly memory_mib: number;
/** A program run once (a `run_js` script): no spare isolates are prepared for it. */
readonly once?: true;
}; A guest session's options: the prelude it evaluates first (the release's PRELUDE), its entropy and its heap.
Members
| Name | Type | Description |
|---|---|---|
prelude | string | |
seed | string |
|
memory_mib | number | |
once? | true | A program run once (a |
Source: packages/host-api/src/guest.ts:38
GuestStart type
type GuestStart = {
readonly kind: string;
readonly path: readonly string[];
readonly input: string;
readonly ctx: string;
readonly invocation: string;
}; The prelude's start(kind, path, inputJson, ctxJson, invocationId), by name; kind is the release's invocation kind.
Members
| Name | Type | Description |
|---|---|---|
kind | string | |
path | readonly string[] | |
input | string | |
ctx | string | |
invocation | string |
Source: packages/host-api/src/guest.ts:47
GuestTaken const
const GuestTaken: Schema.Tuple<readonly [Schema.NullOr<Schema.Union<readonly [Schema.Tuple<readonly [Schema.Literal<"ok">, Schema.String]>, Schema.Tuple<readonly [Schema.Literal<"refused">, Schema.String, Schema.NullOr<Schema.String>, Schema.NullOr<Schema.Int>, Schema.String]>, Schema.Tuple<readonly [Schema.Literal<"missing">, Schema.String]>, Schema.Tuple<readonly [Schema.Literal<"error">, Schema.String, Schema.String, Schema.String]>, Schema.Tuple<readonly [Schema.Literal<"error">, Schema.String, Schema.String, Schema.String, Schema.String]>]>>, Schema.$Array<Schema.Tuple<readonly [Schema.String, Schema.Stri… The prelude's take(): end state, the calls crossing now, each call's bytes ($bin), and whether a timer ran instead.
Source: packages/host-api/src/guest.ts:16
GuestTurn type
type GuestTurn = typeof GuestTurnSchema.Type; One guest turn (GuestTurnSchema).
Members
| Name | Type | Description |
|---|---|---|
taken | Schema.Tuple<readonly [Schema.NullOr<Schema.Union<readonly [Schema.Tuple<readonly [Schema.Literal<"ok">, Schema.String]>, Schema.Tuple<readonly [Schema.Literal<"refused">, Schema.String, Schema.NullOr<Schema.String>, Schema.NullOr<Schema.Int>, Schema.String]>, Schema.Tuple<readonly [Schema.Literal<"missing">, Schema.String]>, Schema.Tuple<readonly [Schema.Literal<"error">, Schema.String, Schema.S… | |
lines | Schema.$Array<Schema.Tuple<readonly [Schema.String, Schema.String]>> | |
dropped | Schema.Number |
Source: packages/host-api/src/guest.ts:30
GuestTurnSchema const
const GuestTurnSchema: Schema.Struct<{ readonly taken: Schema.Tuple<readonly [Schema.NullOr<Schema.Union<readonly [Schema.Tuple<readonly [Schema.Literal<"ok">, Schema.String]>, Schema.Tuple<readonly [Schema.Literal<"refused">, Schema.String, Schema.NullOr<Schema.String>, Schema.NullOr<Schema.Int>, Schema.String]>, Schema.Tuple<readonly [Schema.Literal<"missing">, Schema.String]>, Schema.Tuple<readonly [Schema.Literal<"error">, Schema.String, Schema.String, Schema.String]>, Schema.Tuple<readonly [Schema.Literal<"error">, Schema.String, Schema.String, Schema.String, Schema.String]>]>>, Schema.$Array<Schema.Tuple<read… Schema of one guest turn: what the prelude's take() answered, the log lines it wrote and how many it dropped.
Source: packages/host-api/src/guest.ts:24
version
HOST_API_VERSION const
const HOST_API_VERSION: 1 The HOST_API this package describes.
Source: packages/host-api/src/version.ts:5
facilities
HOST_LIMITS const
const HOST_LIMITS: { readonly guestCpuMs: 3000; readonly guestMemoryMiB: 256; readonly argsBytes: number; readonly storedFileBytes: number; readonly crossingBytes: number; readonly callMs: { readonly database: 20000; readonly ai: 20000; readonly tool: 20000; readonly http: 20000; readonly web: 20000; readonly image: 20000; readonly other: 20000; readonly ingest: 600000; readonly attachment: 20000; readonly render: 60000; }; } The walls a host enforces for a release: a unit's guest CPU and heap, the request bodies it reads and each I/O call's wall.
Members
| Name | Type | Description |
|---|---|---|
guestCpuMs | 3000 | One unit's guest CPU: Colony's meter budget, so the kit and dev refuse what a deployed host refuses. |
guestMemoryMiB | 256 | |
argsBytes | number | One call's arguments. |
storedFileBytes | number | One stored file. |
crossingBytes | number | One crossing's answer. 8 MiB fits a large jurisdiction's payroll admission while staying far below a cell's heap. |
callMs | { readonly database: 20000; readonly ai: 20000; readonly tool: 20000; readonly http: 20000; readonly web: 20000; readonly image: 20000; readonly other: 20000; /** One Convert job (`ctx.convert.ingest`): a long recording's transcription takes minutes. */ readonly ingest: 600000; readonly attachment: 20000; /** One record printed by the host's browser (`ctx.convert.record`): the page loads, its rea… | Per I/O response, never per invocation. Streaming model responses reset their idle deadline on progress; a multi-step inference keeps its separate whole-call ceiling. |
Source: packages/host-api/src/facilities.ts:20
host
HostApi type
type HostApi = HostApiCore & {
/** Whether a request may run a guest body, so the host admits only these under its compute envelope. */
needs_guest(request: Request): Promise<boolean>;
readonly 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 of live's, with this release's generator: a merged migration stays byte for
* byte, the author's are renumbered after it and written again from live's schema. Rejects when nothing can be
* written (an unreadable snapshot, a rename of something live dropped).
*/
carry(input: MigrationCarry, options: Signal): Promise<readonly CarriedMigration[]>;
};
/**
* 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… The versioned boundary a host drives one release through: Promise + AbortSignal calls with Schema JSON answers, so hosts and releases on different module graphs interoperate.
Members
| Name | Type | Description |
|---|---|---|
guest_execution | 'source' | Hosts admit only runtimes that evaluate tenant source without restoring native snapshots. |
version | number | The HOST_API the release speaks. |
contract | string | 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 ( |
frame_policy | (release: Release, path: string, options: Signal) => Promise<string> | The client page's content security policy for |
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 |
branch | (ports: BranchPorts, options: Signal) => Promise<WorkspaceBranch> | |
links | (host: LinkHost, options: Signal) => Promise<WorkspaceLinks> |
Source: packages/host-api/src/host.ts:509
ports
HostApiCore type
type HostApiCore = {
/** Hosts admit only runtimes that evaluate tenant source without restoring native snapshots. */
readonly guest_execution: 'source';
/** The HOST_API the release speaks. */
readonly version: number;
/** The artifact contract this release implements. */
readonly contract: string;
readonly cookies: {
readonly session: string;
readonly preview: string;
};
/** The session cookie's site attributes. */
cookie_site(secure: boolean): string;
/** Refuses an artifact this release did not build or whose files do not match their digests. */
verify(release: Release, options: Signal): Promise<void>;
/** What the release says about itself, decoded by its own Bolt (`ReleaseFacts`). */
describe(release: Release, options: Signal): Promise<ReleaseFacts>;
/** The client page's content security policy for `path`: `frame-ancestors` and `img-src`. */
frame_policy(release: Release, path: string, options: Signal): Promise<string>;
}; What every release answers, whatever its Bolt: the version and contract a host admits it by, its cookies, and the static calls over a release. A release's full HostApi extends it.
Members
| Name | Type | Description |
|---|---|---|
guest_execution | 'source' | Hosts admit only runtimes that evaluate tenant source without restoring native snapshots. |
version | number | The HOST_API the release speaks. |
contract | string | 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 ( |
frame_policy | (release: Release, path: string, options: Signal) => Promise<string> | The client page's content security policy for |
Source: packages/host-api/src/ports.ts:33
failure
HostApiFailure const
const HostApiFailure: Schema.Union<readonly [Schema.TaggedStruct<"HostFailure", { readonly code: Schema.String; readonly phase: Schema.String; readonly message: Schema.String; }>, Schema.TaggedStruct<"HostDefect", { readonly message: Schema.String; }>]> What a Host API call rejects with: an engine answer (HostFailure) or a retryable host defect (HostDefect).
Source: packages/host-api/src/failure.ts:18
host
HostCredentials type
type HostCredentials = {
open(instance: string): Promise<{
epoch: string;
row: InstanceRow;
values: ReadonlyMap<string, Json>;
}>;
read(instance: string): Promise<{
epoch: string | null;
row: InstanceRow;
values: ReadonlyMap<string, Json>;
}>;
write(instance: string, epoch: string | null, changes: ReadonlyMap<string, Json | null>, rotate?: boolean): Promise<string | null>;
}; An environment's sealed integration credentials, under each instance's epoch; a failure is encoded.
Members
| Name | Type | Description |
|---|---|---|
open | (instance: string) => Promise<{ epoch: string; row: InstanceRow; values: ReadonlyMap<string, Json>; }> | |
read | (instance: string) => Promise<{ epoch: string | null; row: InstanceRow; values: ReadonlyMap<string, Json>; }> | |
write | (instance: string, epoch: string | null, changes: ReadonlyMap<string, Json | null>, rotate?: boolean) => Promise<string | null> |
Source: packages/host-api/src/host.ts:243
failure
HostDefect const
const HostDefect: Schema.TaggedStruct<"HostDefect", { readonly message: Schema.String; }> Anything else: the database went away, a host port threw. The host may retry it elsewhere; an engine answer stands.
Source: packages/host-api/src/failure.ts:15
HostFailure const
const HostFailure: Schema.TaggedStruct<"HostFailure", { readonly code: Schema.String; readonly phase: Schema.String; readonly message: Schema.String; }> An engine answer: a BoltError the release raised. code and phase stay strings on the wire, since two releases' sets may differ.
Source: packages/host-api/src/failure.ts:8
host
HostPorts type
type HostPorts = {
readonly facilities: Facilities;
/** This environment's epoch (a fork's rows are never sent). */
readonly epoch?: string;
/** `<tenant>/<environment>`: the deadlines scope and the log key. */
readonly scope: string;
readonly release: Release;
/** The workspace's public URL with its path prefix (`https://host/acme`), no trailing slash. */
readonly public_url: string;
/** The host's own guest runner: isolates it makes, meters and ends for guest code (bodies, page loaders, `run_js`). */
readonly guests: GuestIsolatesPort;
readonly deadlines: DeadlinesPort;
readonly images: ImagesPort;
/** The confined bundler for the agent's file runs; `off`, `run_js` runs inline code only. */
readonly bundler: BundlerPort | Off;
readonly convert: ConvertPort | Off;
/** The host's headless browser printing a record's print route (`ctx.convert.record`); `off`, that call is unavailable. */
readonly render: RenderPort | Off;
readonly geocoder: GeocoderPort | Off;
readonly web: WebReadPort | Off;
readonly browser: BrowserPort | Off;
readonly mcp: McpPort | Off;
/** The environment's live integration links. */
readonly links: LinksPort | Off;
readonly shell: ShellPorts;
readonly agent: AgentPorts;
/** The kernel's meter: as each run of a wake starts, the run begins the next unit, with a CPU budget of its own. */
readonly units?: {
next(): Promise<void>;
};
/*… One serving generation of an environment: the host's facilities and what it serves around them. Every member is required; one the host may leave out takes off.
Members
| Name | Type | Description |
|---|---|---|
facilities | Facilities | |
epoch? | string | This environment's epoch (a fork's rows are never sent). |
scope | string |
|
release | Release | |
public_url | string | The workspace's public URL with its path prefix ( |
guests | GuestIsolatesPort | The host's own guest runner: isolates it makes, meters and ends for guest code (bodies, page loaders, |
deadlines | DeadlinesPort | |
images | ImagesPort | |
bundler | BundlerPort | Off | The confined bundler for the agent's file runs; |
convert | ConvertPort | Off | |
render | RenderPort | Off | The host's headless browser printing a record's print route ( |
geocoder | GeocoderPort | Off | |
web | WebReadPort | Off | |
browser | BrowserPort | Off | |
mcp | McpPort | Off | |
links | LinksPort | Off | The environment's live integration links. |
shell | ShellPorts | |
agent | AgentPorts | |
units? | { next(): Promise<void>; } | The kernel's meter: as each run of a wake starts, the run begins the next unit, with a CPU budget of its own. |
overran? | string | Why the previous generation ended, when the kernel stopped it past a unit's CPU budget: the runs it left |
Source: packages/host-api/src/host.ts:188
tools
HostSkill type
type HostSkill = {
readonly text: string;
readonly digest: string;
readonly files: readonly string[];
read(path: string): Promise<Uint8Array>;
}; A host skill (the platform authoring skill, a person's own): its text, digest, its tree's listing and each file's bytes by path.
Members
| Name | Type | Description |
|---|---|---|
text | string | |
digest | string | |
files | readonly string[] | |
read | (path: string) => Promise<Uint8Array> |
Source: packages/host-api/src/tools.ts:120
db
HostTenantDb type
type HostTenantDb = {
read(statements: readonly Sql[], signal?: AbortSignal): Promise<readonly Rows[]>;
write(statement: Sql, lock?: Lock, signal?: AbortSignal): Promise<Rows>;
transaction(batch: DbBatch, signal?: AbortSignal): Promise<readonly Rows[]>;
}; The tenant database as a release reaches it: RawDb as Promise calls, a failure an encoded DbError.
Members
| Name | Type | Description |
|---|---|---|
read | (statements: readonly Sql[], signal?: AbortSignal) => Promise<readonly Rows[]> | |
write | (statement: Sql, lock?: Lock, signal?: AbortSignal) => Promise<Rows> | |
transaction | (batch: DbBatch, signal?: AbortSignal) => Promise<readonly Rows[]> |
Source: packages/host-api/src/db.ts:37
tools
HostTool type
type HostTool = {
/**
* Its provider-visible name and identity: 1 to 64 of `A-Z a-z 0-9 _ -`, held by no native tool and no other host,
* browser or MCP tool. A name that is not is offered by no list (the release logs why); it never replaces another.
*/
name: string;
description: string;
input: Json;
/** Declared once here; the release does not infer behavior from the operation's name. */
readonly behavior: ToolBehavior;
/** How a call reads in the panel; without it the panel names the tool and its `query`, `url`, `name`, `id` or `text`. */
view?(input: Json): ToolView;
read_only?: boolean;
source?: true;
/** Offered to every staff member in the app, whatever their policies name. */
everyone?: true;
studio?: StudioRole;
/** A call's wall when it is past the usual host call's. */
wall_ms?: number;
/**
* The host carries the call on past its generation and reports its end itself (`ActiveWorkspace.notify` with the
* call's `job` as `id`): a generation closing under it writes no line for it, and holds no record of it.
*/
reports_end?: true;
/** The call's `files: [{ id }]` are read for it, as `run_js`'s are. */
files?: true;
/** Whether this call waits for the person's confirmation card (it sends, submits or saves); an envoy is refused it. */
confirm?(input: Json): boolean;
call(input: Json, ctx: HostToolContext, signal: AbortSignal): Promise<Json>;
}; A host capability (capabilities.tools): offered to staff members in the app only; read_only ones also while planning. An administrator holds every one, another member those their policies grant, and every staff member a read-only source tool (it reads the workspace's own source, never a secret or a host file).
Members
| Name | Type | Description |
|---|---|---|
name | string | Its provider-visible name and identity: 1 to 64 of |
description | string | |
input | Json | |
behavior | ToolBehavior | Declared once here; the release does not infer behavior from the operation's name. |
view? | ((input: Json) => ToolView) | undefined | How a call reads in the panel; without it the panel names the tool and its |
read_only? | boolean | |
source? | true | |
everyone? | true | Offered to every staff member in the app, whatever their policies name. |
studio? | StudioRole | |
wall_ms? | number | A call's wall when it is past the usual host call's. |
reports_end? | true | The host carries the call on past its generation and reports its end itself ( |
files? | true | The call's |
confirm? | ((input: Json) => boolean) | undefined | Whether this call waits for the person's confirmation card (it sends, submits or saves); an envoy is refused it. |
call | (input: Json, ctx: HostToolContext, signal: AbortSignal) => Promise<Json> |
Source: packages/host-api/src/tools.ts:88
HostToolContext type
type HostToolContext = {
actor: Actor;
conversation: string;
/** The agent's mark when this turn runs as one: a browser page opened for it is the agent's. */
agent?: AgentMark;
turn: string;
call_id: string;
/** The agent's job id for this call (its `[job <id> …]` lines); absent outside a turn (an automation's inference). */
job?: string;
/** The person's latest message, when the turn has one (a search host ranks by it). */
question?: string;
/** An image the model sees on its next step (a screenshot). */
attach(file: {
mime: string;
bytes: Uint8Array;
}): void;
/** A file the host stored (a download), recorded as the person's and offered on the step; the model sees only its reference. */
keep?(file: Downloaded): void;
/** The conversation files the call named in `files`, by name, for a `files` tool. */
files?: readonly (readonly [name: string, bytes: Uint8Array])[];
/**
* One request through the actor's active connection of `integration` (their own, else the workspace's when its
* definition lends it (`http.lend`) or the actor is an administrator): `path` under
* its definition's base URL, refused outside its `allow`, signed host-side and fetched under the public-network policy
* (redirects followed, a cross-origin hop unsigned; the body at most `max_bytes`). `undefined` when nothing is
* connected. The tool never holds the credential.
*/
request?(integr… What a host tool learns of its call: the person (a Studio draft is theirs), the conversation (its attachments), the key.
Members
| Name | Type | Description |
|---|---|---|
actor | Actor | |
conversation | string | |
agent? | AgentMark | The agent's mark when this turn runs as one: a browser page opened for it is the agent's. |
turn | string | |
call_id | string | |
job? | string | The agent's job id for this call (its |
question? | string | The person's latest message, when the turn has one (a search host ranks by it). |
attach | (file: { mime: string; bytes: Uint8Array; }) => void | An image the model sees on its next step (a screenshot). |
keep? | ((file: Downloaded) => void) | undefined | A file the host stored (a download), recorded as the person's and offered on the step; the model sees only its reference. |
files? | readonly (readonly [name: string, bytes: Uint8Array])[] | The conversation files the call named in |
request? | ((integration: string, request: { readonly method: string; readonly path: string; readonly max_bytes: number; }, signal: AbortSignal) => Promise<HttpResponse | undefined>) | undefined | One request through the actor's active connection of |
Source: packages/host-api/src/tools.ts:53
storage
HostUser const
const HostUser: Schema.Struct<{ readonly id: Schema.String; readonly name: Schema.String; readonly email: Schema.NullOr<Schema.String>; readonly phone: Schema.NullOr<Schema.String>; readonly active: Schema.Boolean; }> A sys_user row as a host reads it from a branch database, without entering the release.
Source: packages/host-api/src/storage.ts:21
facilities
HttpFetchOptions type
type HttpFetchOptions = {
readonly redirects: number;
readonly max_bytes: number;
}; redirects: hops followed (each re-checked); max_bytes: the decoded body's ceiling (more fails too_large).
Members
| Name | Type | Description |
|---|---|---|
redirects | number | |
max_bytes | number |
Source: packages/host-api/src/facilities.ts:265
port
HttpOptions type
type HttpOptions = {
http_client?: HttpClient.HttpClient;
fetch?: typeof fetch;
}; The caller's HTTP client, else fetch (the caller's fetch when given).
Members
| Name | Type | Description |
|---|---|---|
http_client? | HttpClient.HttpClient | |
fetch? | typeof fetch |
Source: packages/host-api/src/port.ts:103
facilities
HttpPort interface
interface HttpPort {
fetch(request: HttpRequest, options: HttpFetchOptions, signal: AbortSignal): Promise<HttpResponse>;
} Outbound HTTP under the public-network policy: HTTPS on 443 without credentials, DNS resolved once and the checked address pinned, private and reserved networks refused, every redirect hop re-checked (a cross-origin hop keeps only accept; a 301-303 of a write becomes a GET), transport headers (host, connection, content-length, transfer-encoding, upgrade, te, trailer, accept-encoding, proxy-*) refused, gzip decoded. A refusal rejects as a facility failure invalid; the wall is the caller's (Port.call).
Members
| Name | Type | Description |
|---|---|---|
fetch | (request: HttpRequest, options: HttpFetchOptions, signal: AbortSignal) => Promise<HttpResponse> |
Source: packages/host-api/src/facilities.ts:279
HttpRequest type
type HttpRequest = {
readonly method: string;
readonly url: string;
readonly headers: readonly (readonly [name: string, value: string])[];
readonly body?: Uint8Array;
}; An outbound request: absolute URL, headers in order, body bytes (none for GET).
Members
| Name | Type | Description |
|---|---|---|
method | string | |
url | string | |
headers | readonly (readonly [name: string, value: string])[] | |
body? | Uint8Array |
Source: packages/host-api/src/facilities.ts:258
HttpResponse type
type HttpResponse = {
readonly status: number;
readonly headers: readonly (readonly [name: string, value: string])[];
readonly body: Uint8Array;
}; The final response: status, lowercase headers, the whole decoded body (empty for 204, 205, 304 and a redirect).
Members
| Name | Type | Description |
|---|---|---|
status | number | |
headers | readonly (readonly [name: string, value: string])[] | |
body | Uint8Array |
Source: packages/host-api/src/facilities.ts:267
media
ImageCrop type
type ImageCrop = {
left: number;
top: number;
right: number;
bottom: number;
/** Enlarge a small region until its longer edge reaches this many pixels, at most 4×. */
min_edge?: number;
}; A rectangle in the oriented image, with coordinates from zero to one.
Members
| Name | Type | Description |
|---|---|---|
left | number | |
top | number | |
right | number | |
bottom | number | |
min_edge? | number | Enlarge a small region until its longer edge reaches this many pixels, at most 4×. |
Source: packages/host-api/src/media.ts:70
ImageMetadata type
type ImageMetadata = typeof ImageMetadataSchema.Type; What ctx.files.image reads from a JPEG, PNG or HEIC: format, size, the PDQ perceptual hash and EXIF.
Members
| Name | Type | Description |
|---|---|---|
format | Schema.Literals<readonly ["jpeg", "png", "heic"]> | |
width | Schema.Number | |
height | Schema.Number | |
pdq | Schema.String | |
exif | Schema.Struct<{ readonly taken_at: Schema.optionalKey<Schema.String>; readonly gps: Schema.optionalKey<Schema.Struct<{ readonly lat: Schema.Number; readonly lng: Schema.Number; }>>; readonly software: Schema.optionalKey<Schema.String>; readonly make: Schema.optionalKey<Schema.String>; readonly model: Schema.optionalKey<Schema.String>; }> |
Source: packages/host-api/src/media.ts:64
ImageMetadataSchema const
const ImageMetadataSchema: Schema.Struct<{ readonly format: Schema.Literals<readonly ["jpeg", "png", "heic"]>; readonly width: Schema.Number; readonly height: Schema.Number; readonly pdq: Schema.String; readonly exif: Schema.Struct<{ readonly taken_at: Schema.optionalKey<Schema.String>; readonly gps: Schema.optionalKey<Schema.Struct<{ readonly lat: Schema.Number; readonly lng: Schema.Number; }>>; readonly software: Schema.optionalKey<Schema.String>; readonly make: Schema.optionalKey<Schema.String>; readonly model: Schema.optionalKey<Schema.String>; }>; }> Schema of what ctx.files.image reads from a JPEG, PNG or HEIC: format, size, the PDQ perceptual hash and EXIF.
Source: packages/host-api/src/media.ts:14
ImagePreview type
type ImagePreview = {
readonly bytes: Uint8Array;
readonly mime: string;
readonly derived: boolean;
}; A preview at most maxEdge on its long side, EXIF-oriented; derived: false is the original (an APNG, a HEIC sequence).
Members
| Name | Type | Description |
|---|---|---|
bytes | Uint8Array | |
mime | string | |
derived | boolean |
Source: packages/host-api/src/media.ts:79
ImagePreviewMime type
type ImagePreviewMime = typeof ImagePreviewMimeSchema.Type; Source media the image preview decoder accepts (ImagePreviewMimeSchema).
Source: packages/host-api/src/media.ts:68
ImagePreviewMimeSchema const
const ImagePreviewMimeSchema: Schema.Literals<readonly ["image/jpeg", "image/png", "image/heic", "image/heif"]> Source media the image preview decoder accepts. Other media are delivered unchanged.
Source: packages/host-api/src/media.ts:6
ImagePreviewSize type
type ImagePreviewSize = 64 | 512 | 1024; The edge lengths, in pixels, an image preview is made at.
Source: packages/host-api/src/media.ts:66
ImagesPort interface
interface ImagesPort {
facts(bytes: Uint8Array, signal: AbortSignal): Promise<ImageMetadata>;
jpeg(bytes: Uint8Array, maxEdge: number, signal: AbortSignal): Promise<Uint8Array>;
/** Lossless PNG of the selected oriented pixels, at most 5 MiB; the source stays unchanged. */
crop(bytes: Uint8Array, box: ImageCrop, signal: AbortSignal): Promise<Uint8Array>;
preview(bytes: Uint8Array, mime: ImagePreviewMime, maxEdge: ImagePreviewSize, signal: AbortSignal): Promise<ImagePreview>;
} Image decoding off the engine (JPEG, PNG, HEIC; rasters at most 16 million pixels, input at most HOST_LIMITS.storedFileBytes): facts, a JPEG at most maxEdge on its long side, and a preview at most 5 MiB.
Members
| Name | Type | Description |
|---|---|---|
facts | (bytes: Uint8Array, signal: AbortSignal) => Promise<ImageMetadata> | |
jpeg | (bytes: Uint8Array, maxEdge: number, signal: AbortSignal) => Promise<Uint8Array> | |
crop | (bytes: Uint8Array, box: ImageCrop, signal: AbortSignal) => Promise<Uint8Array> | Lossless PNG of the selected oriented pixels, at most 5 MiB; the source stays unchanged. |
preview | (bytes: Uint8Array, mime: ImagePreviewMime, maxEdge: ImagePreviewSize, signal: AbortSignal) => Promise<ImagePreview> |
Source: packages/host-api/src/media.ts:88
integrations
ImportStart const
const ImportStart: Schema.Union<readonly [Schema.Struct<{ readonly kind: Schema.Literal<"all">; }>, Schema.Struct<{ readonly kind: Schema.Literal<"since">; readonly at: Schema.String; readonly zone: Schema.String; readonly origin: Schema.Literals<readonly ["now", "date"]>; }>, Schema.Struct<{ readonly kind: Schema.Literal<"native">; readonly selected_at: Schema.String; readonly provider: Schema.String; readonly values: Schema.$Record<Schema.String, Schema.String>; }>]> A persisted source boundary. A missing boundary retains the instance's previous all-history behavior.
Source: packages/host-api/src/integrations.ts:95
ImportStartCapability const
const ImportStartCapability: Schema.Union<readonly [Schema.Struct<{ readonly kind: Schema.Literal<"timestamp">; readonly precision: Schema.optionalKey<Schema.Literal<"second">>; }>, Schema.Struct<{ readonly kind: Schema.Literal<"native">; readonly fields: Schema.$Array<Schema.Struct<{ readonly name: Schema.String; readonly label: Schema.Union<readonly [Schema.String, Schema.Struct<{ readonly en: Schema.String; readonly zh: Schema.optionalKey<Schema.middlewareDecoding<Schema.String, never>>; }>]>; readonly secret: Schema.optionalKey<Schema.middlewareDecoding<Schema.Boolean, never>>; readonly hint: Schema.optionalKey<Schem… Where a provider can start an import from: a timestamp (optionally to the second) or its own native fields.
Source: packages/host-api/src/integrations.ts:124
ImportStartInput const
const ImportStartInput: Schema.Union<readonly [Schema.Struct<{ readonly kind: Schema.Literal<"all">; }>, Schema.Struct<{ readonly kind: Schema.Literal<"now">; readonly zone: Schema.String; }>, Schema.Struct<{ readonly kind: Schema.Literal<"since">; readonly date: Schema.String; readonly zone: Schema.String; }>, Schema.Struct<{ readonly kind: Schema.Literal<"native">; readonly provider: Schema.String; readonly values: Schema.$Record<Schema.String, Schema.String>; }>]> The host freezes From now and resolves a selected civil day's midnight in its chosen IANA zone.
Source: packages/host-api/src/integrations.ts:112
facilities
IngestOptions type
type IngestOptions = {
pictures?: boolean;
page?: number;
password?: string;
/** A path inside an archive (zip, tar, tar.gz; on into one inside it): that file read as its own type; a folder lists its files. */
entry?: string;
diarize?: boolean;
language?: string;
speakers?: number;
prompt?: string;
}; How an ingest reads: pictures: false reads a PDF's text alone, page one PDF page as a picture, password opens a locked PDF or Office file for this read; for audio, diarize tells speakers apart (default true), language a BCP 47 hint, speakers how many there are when known, prompt context such as names and vocabulary.
Members
| Name | Type | Description |
|---|---|---|
pictures? | boolean | |
page? | number | |
password? | string | |
entry? | string | A path inside an archive (zip, tar, tar.gz; on into one inside it): that file read as its own type; a folder lists its files. |
diarize? | boolean | |
language? | string | |
speakers? | number | |
prompt? | string |
Source: packages/host-api/src/facilities.ts:102
media
Ingested type
type Ingested = typeof IngestedSchema.Type; Norbital Convert's ingest: parsing only, never OCR; a host may add a scanned page's transcript under its image in a data-read section. A document (pdf, office, html, text, images, audio) is sanitised HTML, one block element per line (audio: one <section data-speaker data-start data-end> per segment); data (a spreadsheet, CSV or JSON) is its cells as { sheets }, or a JSON file's own value. images are referenced by name.
Source: packages/host-api/src/media.ts:62
IngestedSchema const
const IngestedSchema: Schema.Union<readonly [Schema.Struct<{ readonly images: Schema.$Array<Schema.Struct<{ readonly name: Schema.String; readonly mime: Schema.String; readonly bytes: Schema.Uint8Array; }>>; readonly meta: Schema.Struct<{ readonly usage: Schema.optionalKey<Schema.Struct<{ readonly calls: Schema.$Array<Schema.String>; readonly model: Schema.String; readonly input: Schema.Number; readonly output: Schema.Number; readonly cost: Schema.Number; }>>; readonly stats: Schema.Struct<{ readonly pages: Schema.NullOr<Schema.Number>; readonly bytes: Schema.Number; readonly cpuMs: Schema.Number; readonly wallMs:… Schema of Norbital Convert's ingest answer, its images as bytes.
Source: packages/host-api/src/media.ts:56
integrations
InstanceAdmin const
const InstanceAdmin: Schema.Struct<{ readonly instance: Schema.String; readonly active: Schema.Boolean; readonly envoy: Schema.NullOr<Schema.String>; readonly state: Schema.NullOr<Schema.Literals<readonly ["unpaired", "connecting", "pairing", "connected", "reconnecting", "error"]>>; readonly stored: Schema.Boolean; readonly revision: Schema.Int; }> One instance as a host's operator observes it (WorkspaceBranch.integrations): never its account, pairing or values.
Source: packages/host-api/src/integrations.ts:221
host
InstanceRow type
type InstanceRow = {
readonly integration: string;
readonly owner: string | null;
readonly active: boolean;
readonly configuration: Json;
readonly import_start: Json | null;
}; An integration instance's row, as its sealed credentials open with it.
Members
| Name | Type | Description |
|---|---|---|
integration | string | |
owner | string | null | |
active | boolean | |
configuration | Json | |
import_start | Json | null |
Source: packages/host-api/src/host.ts:235
integrations
InstanceState const
const InstanceState: Schema.Literals<readonly ["unpaired", "connecting", "pairing", "connected", "reconnecting", "error"]> Where an instance's link is. pairing is the provider asking for something; reconnecting is a retry after a drop and is progress, not failure; error is the only terminal one and names its own recovery in error.
Source: packages/host-api/src/integrations.ts:36
InstanceStatus const
const InstanceStatus: Schema.Struct<{ readonly state: Schema.Literals<readonly ["unpaired", "connecting", "pairing", "connected", "reconnecting", "error"]>; readonly account: Schema.optionalKey<Schema.middlewareDecoding<Schema.NullOr<Schema.String>, never>>; readonly detail: Schema.optionalKey<Schema.middlewareDecoding<Schema.String, never>>; readonly error: Schema.optionalKey<Schema.middlewareDecoding<Schema.String, never>>; readonly code: Schema.optionalKey<Schema.middlewareDecoding<Schema.String, never>>; readonly last_disconnect: Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>; readonl… One instance as the shell shows it (GET/stream of /__bolt/integrations/<instance>): its link's status and the host's choices. A malformed member is dropped; a malformed state, instance or driver refuses the whole answer.
Source: packages/host-api/src/integrations.ts:196
IntegrationDefinition const
const IntegrationDefinition: Schema.Struct<{ readonly description: Schema.String; readonly driver: Schema.Union<readonly [Schema.String, Schema.Struct<{ readonly name: Schema.String; }>]>; readonly configuration: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{ readonly label: Schema.optionalKey<Schema.String>; readonly optional: Schema.optionalKey<Schema.Boolean>; }>>>; readonly credential: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{ readonly label: Schema.optionalKey<Schema.String>; readonly optional: Schema.optionalKey<Schema.Boolean>; }>>>; readonly oauth: Schema.optionalKey<Schem… An integration definition as a provider reads it: its driver, its OAuth client's secret names and scopes, an http definition's base URL and auth, and its field declarations.
Source: packages/host-api/src/integrations.ts:374
cell
Kernel type
type Kernel = {
/** A membrane message to the kernel; a call's answer when the kernel answered it at once. */
readonly send: (message: Message) => Answer;
/** Arms timer `id`: in `ms` the kernel enters `fire(id)`, billed to the unit that armed it. */
readonly timer: (id: number, ms: number) => void;
readonly clear: (id: number) => void;
/** Fresh random bytes from the host's CSPRNG. */
readonly random: (bytes: number) => Uint8Array<ArrayBuffer>;
readonly log: (level: string, line: string) => void;
}; The kernel's system calls, each a synchronous host function (log is fire and forget).
Members
| Name | Type | Description |
|---|---|---|
send | (message: Message) => Answer | A membrane message to the kernel; a call's answer when the kernel answered it at once. |
timer | (id: number, ms: number) => void | Arms timer |
clear | (id: number) => void | |
random | (bytes: number) => Uint8Array<ArrayBuffer> | Fresh random bytes from the host's CSPRNG. |
log | (level: string, line: string) => void |
Source: packages/host-api/src/cell.ts:6
facilities
KeysPort interface
interface KeysPort {
seal(plain: Uint8Array, aad: Uint8Array, signal: AbortSignal): Promise<Uint8Array>;
open(sealed: Uint8Array, aad: Uint8Array, signal: AbortSignal): Promise<Uint8Array | null>;
} The tenant's secrets key, held by the host: AES-256-GCM envelopes (iv ‖ tag ‖ ciphertext) bound to aad (bolt\0<owner>\0<name>), so a copied envelope never opens under another owner or name. open answers null for an envelope that does not open under this key and aad.
Members
| Name | Type | Description |
|---|---|---|
seal | (plain: Uint8Array, aad: Uint8Array, signal: AbortSignal) => Promise<Uint8Array> | |
open | (sealed: Uint8Array, aad: Uint8Array, signal: AbortSignal) => Promise<Uint8Array | null> |
Source: packages/host-api/src/facilities.ts:253
integrations
Link type
type Link = {
close(): Promise<void>;
} & Partial<{
/** The operator's setup input (`SetupDescription`); rejects with the refusal the shell shows verbatim. */
pair(input: Json): Promise<void>;
/** Forgets this host at the provider; the manager destroys the credentials. */
unpair(): Promise<void>;
/** The provider's own test (send, then read it back); absent → the release sends a short message to the test target. */
test(input: Json): Promise<void>;
/**
* Sends one queued conversation message; answers the `provider_id` its delivery reports will name. A provider that
* picks the id before contacting the recipient (SMTP) first awaits `emit({ kind: 'outbound_ref', … })`, so a reply
* finds the queued conversation before this resolves. Throw `SendRefused` for a refusal; any other failure after
* handoff leaves the message `uncertain`.
*/
send(message: Schema.Json, signal: AbortSignal, attachments?: readonly OutboundAttachment[]): Promise<SendReceipt>;
/** The chat shows this account typing to `to` (`on`), or stops showing it. */
typing(to: string, signal: AbortSignal, on: boolean): Promise<void>;
/** A request driver's op (an http `{ method, path, … }` answering `{ status, body }`, a database request its rows), or a pushing driver's `call` through this link. */
request(op: Json, signal: AbortSignal): Promise<Json>;
/** A pushing driver's sync page from `cursor` (its `invalidate` event names the sync … One instance's live link: whichever of these its driver supports.
Members
| Name | Type | Description |
|---|---|---|
close | () => Promise<void> | |
pair? | ((input: Json) => Promise<void>) | undefined | The operator's setup input ( |
unpair? | (() => Promise<void>) | undefined | Forgets this host at the provider; the manager destroys the credentials. |
test? | ((input: Json) => Promise<void>) | undefined | The provider's own test (send, then read it back); absent → the release sends a short message to the test target. |
send? | ((message: Schema.Json, signal: AbortSignal, attachments?: readonly OutboundAttachment[]) => Promise<SendReceipt>) | undefined | Sends one queued conversation message; answers the |
typing? | ((to: string, signal: AbortSignal, on: boolean) => Promise<void>) | undefined | The chat shows this account typing to |
request? | ((op: Json, signal: AbortSignal) => Promise<Json>) | undefined | A request driver's op (an http |
read? | ((sync: string, partition: string, cursor: Json | null, signal: AbortSignal) => Promise<DriverPage>) | undefined | A pushing driver's sync page from |
reconcile? | ((thread: string, since: string, signal: AbortSignal) => Promise<ReconcilePage>) | undefined | The platform's current view of |
discover? | (() => Promise<readonly { id: string; label: string; }[]>) | undefined | The resources a configuration may name (calendars), for the operator to pick. |
renew? | (() => Promise<string | null>) | undefined | Renews what the provider expires (a calendar watch); the next instant to renew at, or |
webhook? | ((request: Request) => Promise<Response>) | undefined | Inbound HTTP on |
Source: packages/host-api/src/integrations.ts:530
host
LinkHost type
type LinkHost = {
readonly release: Release;
readonly database: HostTenantDb;
/** As `Facilities.keys`: the sealed credentials open through it. */
readonly keys: KeysPort;
/** As `HostPorts.public_url`: every webhook URL and the OAuth callback are under it. */
readonly public_url: string;
readonly providers: readonly Provider[];
/** The host's OAuth clients (Google), signing in every definition that names none of its own. */
readonly oauth?: Partial<Record<OAuthVendor, OAuthClient>>;
/** Runs `work` on the scope's current generation, outside compute admission (a link's ingest). */
enter<T>(work: (workspace: ActiveWorkspace) => Promise<T>): Promise<T>;
/** As `enter`, admitted under the compute envelope (a guest body: a custom conversation's webhook, a test send). */
admit<T>(work: (workspace: ActiveWorkspace) => Promise<T>): Promise<T>;
/** Wraps the sealed credentials the links write through, so credential I/O can survive a retirement. */
credentials?(sealed: HostCredentials): HostCredentials;
/** The providers' network: a cell has no `fetch` of its own. */
readonly fetch: typeof fetch;
/** The providers' TCP/TLS (IMAP, SMTP), as `Facilities.ports.outbound.tcp`. */
readonly tcp: TcpPort;
log?(line: string): void;
}; An environment's integration links: they outlive idle generations and re-enter the current one.
Members
| Name | Type | Description |
|---|---|---|
release | Release | |
database | HostTenantDb | |
keys | KeysPort | As |
public_url | string | As |
providers | readonly Provider[] | |
oauth? | Partial<Record<OAuthVendor, OAuthClient>> | The host's OAuth clients (Google), signing in every definition that names none of its own. |
enter | <T>(work: (workspace: ActiveWorkspace) => Promise<T>) => Promise<T> | Runs |
admit | <T>(work: (workspace: ActiveWorkspace) => Promise<T>) => Promise<T> | As |
credentials? | ((sealed: HostCredentials) => HostCredentials) | undefined | Wraps the sealed credentials the links write through, so credential I/O can survive a retirement. |
fetch | typeof fetch | The providers' network: a cell has no |
tcp | TcpPort | The providers' TCP/TLS (IMAP, SMTP), as |
log? | ((line: string) => void) | undefined |
Source: packages/host-api/src/host.ts:262
integrations
LinkStatus const
const LinkStatus: Schema.Struct<{ state: Schema.Literals<readonly ["unpaired", "connecting", "pairing", "connected", "reconnecting", "error"]>; account: Schema.optionalKey<Schema.middlewareDecoding<Schema.NullOr<Schema.String>, never>>; detail: Schema.optionalKey<Schema.middlewareDecoding<Schema.String, never>>; error: Schema.optionalKey<Schema.middlewareDecoding<Schema.String, never>>; code: Schema.optionalKey<Schema.middlewareDecoding<Schema.String, never>>; last_disconnect: Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>; about: Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Js… What a link reports of itself (DriverOpen.status): where it is, as whom, and the facts the connected view shows.
Source: packages/host-api/src/integrations.ts:190
LinksPort interface
interface LinksPort {
send?(instance: string, message: Schema.Json, signal: AbortSignal, attachments?: readonly OutboundAttachment[]): Promise<SendReceipt>;
typing?(instance: string, to: string, signal: AbortSignal, on: boolean): Promise<void>;
request?(instance: string, op: Json, signal: AbortSignal): Promise<Json>;
read?(instance: string, sync: string, partition: string, cursor: Json | null, signal: AbortSignal): Promise<DriverPage>;
/**
* A committed change of what an instance's session link opened with — its `configuration` or its pause — or its
* deletion: the link closes, and opens again from the row as it is then when it is active and paired (a calendar
* watches what it names now; a resumed instance reconnects).
*/
changed?(instance: string): void;
} The host's live side of integration instances, by instance id: a conversation driver sends (and shows typing), a request driver (http, sqlserver) answers request with the instance's credential host-side, a pushing driver reads a sync partition's page. A throw is a facility failure; SendRefused refuses a send (permanent or retried). An http request answers { status, body }, a database one the DatabaseResult.
Members
| Name | Type | Description |
|---|---|---|
send? | ((instance: string, message: Schema.Json, signal: AbortSignal, attachments?: readonly OutboundAttachment[]) => Promise<SendReceipt>) | undefined | |
typing? | ((instance: string, to: string, signal: AbortSignal, on: boolean) => Promise<void>) | undefined | |
request? | ((instance: string, op: Json, signal: AbortSignal) => Promise<Json>) | undefined | |
read? | ((instance: string, sync: string, partition: string, cursor: Json | null, signal: AbortSignal) => Promise<DriverPage>) | undefined | |
changed? | ((instance: string) => void) | undefined | A committed change of what an instance's session link opened with — its |
Source: packages/host-api/src/integrations.ts:335
LocalText const
const LocalText: Schema.Union<readonly [Schema.String, Schema.Struct<{ readonly en: Schema.String; readonly zh: Schema.optionalKey<Schema.middlewareDecoding<Schema.String, never>>; }>]> Operator-facing text a provider supplies: English, and each framework locale it is written in (the shell picks by locale).
Source: packages/host-api/src/integrations.ts:46
db
Lock type
type Lock = {
tables?: readonly string[];
mode?: 'SHARE ROW EXCLUSIVE';
advisory?: readonly string[];
}; Taken before the statement, in sorted order; advisory keys are hashed by the adapter (pg_advisory_xact_lock).
Members
| Name | Type | Description |
|---|---|---|
tables? | readonly string[] | |
mode? | 'SHARE ROW EXCLUSIVE' | |
advisory? | readonly string[] |
Source: packages/host-api/src/db.ts:15
logs
LogEvent type
type LogEvent = {
readonly at: string;
readonly severity: LogLevel;
readonly event: string;
readonly invocation: string;
readonly run: string | null;
readonly conversation: string | null;
readonly turn: string | null;
readonly attributes: {
readonly [key: string]: Json;
};
}; One runtime event as it happens: the host writes it to its log pipe, never to the workspace's database.
Members
| Name | Type | Description |
|---|---|---|
at | string | |
severity | LogLevel | |
event | string | |
invocation | string | |
run | string | null | |
conversation | string | null | |
turn | string | null | |
attributes | { readonly [key: string]: Json; } |
Source: packages/host-api/src/logs.ts:8
LogLevel type
type LogLevel = 'info' | 'warn' | 'error'; A runtime event's severity.
Source: packages/host-api/src/logs.ts:6
LogPort interface
interface LogPort {
write(event: LogEvent): void;
query(query: LogQuery, signal: AbortSignal): Promise<readonly LogRow[]>;
} The workspace's log facility, held by the host: each event written as it happens, and pages queried back newest first. The host owns identity, time, caps and scope: an event names no tenant, and a query reads only this workspace's log.
Members
| Name | Type | Description |
|---|---|---|
write | (event: LogEvent) => void | |
query | (query: LogQuery, signal: AbortSignal) => Promise<readonly LogRow[]> |
Source: packages/host-api/src/logs.ts:49
LogQuery type
type LogQuery = {
/** rows older than this id */
readonly before?: string;
/** rows newer than this id (the tail) */
readonly after?: string;
/** exactly this severity */
readonly level?: LogLevel;
/** this severity or worse */
readonly min?: LogLevel;
/** the event name or its attributes */
readonly text?: string;
readonly conversation?: string;
readonly run?: string;
/** events naming this automation */
readonly automation?: string;
/** instants bounding `at`: `since` inclusive, `until` exclusive */
readonly since?: string;
readonly until?: string;
/** rows per page, 1 to 200 (default 200) */
readonly limit?: number;
}; A filter over the tenant's stored log events; every given condition must hold.
Members
| Name | Type | Description |
|---|---|---|
before? | string | rows older than this id |
after? | string | rows newer than this id (the tail) |
level? | LogLevel | exactly this severity |
min? | LogLevel | this severity or worse |
text? | string | the event name or its attributes |
conversation? | string | |
run? | string | |
automation? | string | events naming this automation |
since? | string | instants bounding |
until? | string | |
limit? | number | rows per page, 1 to 200 (default 200) |
Source: packages/host-api/src/logs.ts:24
LogRow type
type LogRow = Omit<LogEvent, 'attributes'> & {
readonly id: string;
readonly attributes: Json;
}; A stored event as the host's log store answers it; id is the store's own cursor.
Members
| Name | Type | Description |
|---|---|---|
run | string | null | |
conversation | string | null | |
at | string | |
invocation | string | |
turn | string | null | |
severity | LogLevel | |
event | string | |
id | string | |
attributes | Json |
Source: packages/host-api/src/logs.ts:19
studio
MERGE_SUMMARY const
const MERGE_SUMMARY: 500 Room for a whole change set in a sentence or two.
Source: packages/host-api/src/studio.ts:243
client
MIME const
const MIME: { readonly [ext: string]: string; } The content type of each file kind a client build and a workspace's assets carry; anything else is application/octet-stream.
Source: packages/host-api/src/client.ts:10
facilities
McpPort interface
interface McpPort {
connect(server: McpServer, signal: AbortSignal): Promise<string>;
tools(session: string, signal: AbortSignal): Promise<readonly McpToolInfo[]>;
call(session: string, tool: string, input: Json, signal: AbortSignal): Promise<Json>;
close(session: string): Promise<void>;
} MCP over streamable HTTP on the current protocol revision: connect answers an opaque session id, call answers { content, structured?, isError? }; close ends the session (idempotent).
Members
| Name | Type | Description |
|---|---|---|
connect | (server: McpServer, signal: AbortSignal) => Promise<string> | |
tools | (session: string, signal: AbortSignal) => Promise<readonly McpToolInfo[]> | |
call | (session: string, tool: string, input: Json, signal: AbortSignal) => Promise<Json> | |
close | (session: string) => Promise<void> |
Source: packages/host-api/src/facilities.ts:358
McpServer type
type McpServer = {
readonly url: string;
readonly headers: {
readonly [name: string]: string;
};
readonly auth?: {
readonly bearer: string;
} | {
readonly client: {
readonly id: string;
readonly secret: string;
readonly scopes?: readonly string[];
};
};
}; An MCP server as the release resolved it from the workspace's secrets: URL, headers, and its authorization.
Members
| Name | Type | Description |
|---|---|---|
url | string | |
headers | { readonly [name: string]: string; } | |
auth? | { readonly bearer: string; } | { readonly client: { readonly id: string; readonly secret: string; readonly scopes?: readonly string[]; }; } |
Source: packages/host-api/src/facilities.ts:335
McpToolInfo type
type McpToolInfo = {
readonly name: string;
readonly description: string;
readonly input_schema: Json;
}; One tool an MCP server lists: its name, description and input JSON Schema.
Members
| Name | Type | Description |
|---|---|---|
name | string | |
description | string | |
input_schema | Json |
Source: packages/host-api/src/facilities.ts:349
membrane
Membrane type
type Membrane = {
/** A value in its wire form; what it hands over is this side's until the other side releases it. */
readonly encode: (value: unknown) => unknown;
/** A wire value with mirrors for what the other side handed over. */
readonly decode: (value: unknown) => unknown;
/** One message from the other side; a call answers at once when its function did. */
readonly receive: (message: unknown) => Answer;
/** The other side is gone: pending calls reject with `failure`, incoming streams error, nothing is handed over. */
readonly close: (failure: unknown) => void;
}; One side of the membrane: what it sends, receives and hands over.
Members
| Name | Type | Description |
|---|---|---|
encode | (value: unknown) => unknown | A value in its wire form; what it hands over is this side's until the other side releases it. |
decode | (value: unknown) => unknown | A wire value with mirrors for what the other side handed over. |
receive | (message: unknown) => Answer | One message from the other side; a call answers at once when its function did. |
close | (failure: unknown) => void | The other side is gone: pending calls reject with |
Source: packages/host-api/src/membrane.ts:109
Message const
const Message: Schema.Union<readonly [Schema.Tuple<readonly [Schema.Literal<"call">, Schema.Number, Schema.$Array<Schema.Unknown>, Schema.Number]>, Schema.Tuple<readonly [Schema.Literals<readonly ["resolve", "reject", "abort", "error"]>, Schema.Number, Schema.Unknown]>, Schema.Tuple<readonly [Schema.Literal<"write">, Schema.Number, Schema.Uint8Array]>, Schema.Tuple<readonly [Schema.Literals<readonly ["pull", "end"]>, Schema.Number]>, Schema.Tuple<readonly [Schema.Literal<"release">, Schema.$Array<Schema.Number>]>]> Every message between the two sides; each one the kernel sends into a cell is one entry.
Source: packages/host-api/src/membrane.ts:24
host
MigrationCarry const
const MigrationCarry: Schema.Struct<{ readonly base: Schema.$Record<Schema.String, Schema.String>; readonly live: Schema.$Record<Schema.String, Schema.String>; readonly line: Schema.$Array<Schema.$Record<Schema.String, Schema.String>>; }> schema.carry's input, each side a tree's migrations/: base where an author's line left live, live live's now, and line each of the line's commits, oldest first.
Source: packages/host-api/src/host.ts:479
migration-impact
MigrationImpact const
const MigrationImpact: Schema.Struct<{ readonly duration_ms: Schema.Number; readonly steps: Schema.$Array<Schema.Struct<{ readonly id: Schema.String; readonly hazard: Schema.String; readonly rows: Schema.Number; readonly summary: Schema.String; }>>; }> What applying pending migrations did where it ran: each step's impact and the whole migrate's duration (live's expected downtime).
Source: packages/host-api/src/migration-impact.ts:14
MigrationStepImpact const
const MigrationStepImpact: Schema.Struct<{ readonly id: Schema.String; readonly hazard: Schema.String; readonly rows: Schema.Number; readonly summary: Schema.String; }> rows: written (INSERT/UPDATE/DELETE), held by what a destructive step drops, filled by a backfill, or checked.
Source: packages/host-api/src/migration-impact.ts:6
answers
MintedSession const
const MintedSession: Schema.Struct<{ readonly token: Schema.String; readonly user: Schema.String; readonly expires_at: Schema.String; }> session.mint (the apex handoff): the host sets cookies.session to token until expires_at.
Source: packages/host-api/src/answers.ts:47
integrations
OAUTH_CALLBACK const
const OAUTH_CALLBACK: "/hooks/oauth/callback" The host path an OAuth provider redirects back to after a link's consent.
Source: packages/host-api/src/integrations.ts:360
OAuthClient type
type OAuthClient = {
readonly id: string;
readonly secret: string;
}; A host's OAuth client: its id and secret.
Members
| Name | Type | Description |
|---|---|---|
id | string | |
secret | string |
Source: packages/host-api/src/integrations.ts:364
OAuthVendor type
type OAuthVendor = 'google'; An OAuth provider a host holds a client for.
Source: packages/host-api/src/integrations.ts:362
off
Off type
type Off = typeof off; The type of off.
Members
| Name | Type | Description |
|---|---|---|
_tag | 'Off' |
Source: packages/host-api/src/off.ts:6
ai
OpenAiChat type
type OpenAiChat = (request: AiRequest) => Stream.Stream<AiEvent, PortFailure>; A chat model call (sys_2.infer over an OpenAI-compatible endpoint): a cancellable stream whose last event carries the response.
Source: packages/host-api/src/ai.ts:289
integrations
OutboundAttachment type
type OutboundAttachment = {
readonly id: string;
readonly name: string;
readonly mime: string;
readonly bytes: Uint8Array;
url(expiresInS: number): Promise<string>;
}; One of message.attachments (stored FileRefs, in order) as the release hands it to send: the bytes read through the host's files port, all of a message's together at most the release's attachment cap. url is a signed link a provider that fetches media itself may pass on (Twilio's MediaUrl); it throws where the host serves no file links.
Members
| Name | Type | Description |
|---|---|---|
id | string | |
name | string | |
mime | string | |
bytes | Uint8Array | |
url | (expiresInS: number) => Promise<string> |
Source: packages/host-api/src/integrations.ts:300
OutboundReference const
const OutboundReference: Schema.Struct<{ readonly message: Schema.NonEmptyString; readonly provider_id: Schema.NonEmptyString; }> A provider-chosen id persisted before I/O; registration alone is no delivery acknowledgement. Registration refuses another account's message, a paused or personal account, a changed id or another environment epoch.
Source: packages/host-api/src/integrations.ts:239
facilities
PAPER_SIZES const
const PAPER_SIZES: readonly ["A4", "A3", "Letter"] The paper sizes a rendered document may take.
Source: packages/host-api/src/facilities.ts:85
host
PackCapture type
type PackCapture = {
readonly model: string;
readonly rows: readonly {
readonly [field: string]: Json;
}[];
readonly assets: readonly SeedAsset[];
readonly next: PackCursor | null;
}; One page of a capture: rows of one model as a pack holds them, the assets their files name, and the next page.
Members
| Name | Type | Description |
|---|---|---|
model | string | |
rows | readonly { readonly [field: string]: Json; }[] | |
assets | readonly SeedAsset[] | |
next | PackCursor | null |
Source: packages/host-api/src/host.ts:359
PackCursor const
const PackCursor: Schema.Struct<{ readonly model: Schema.String; readonly after: Schema.NullOr<Schema.String>; }> Where a capture's next page starts: a model and the last id read of it (null: its first row).
Source: packages/host-api/src/host.ts:356
PackLoad type
type PackLoad = {
step(options: Signal): Promise<PackStep>;
}; A pack load in bounded steps ("Limits and liveness"): the host enters step once per unit of work until it answers other than more. Each step commits on its own, so a failed load leaves the steps before it: load into a branch the host drops on failure.
Members
| Name | Type | Description |
|---|---|---|
step | (options: Signal) => Promise<PackStep> |
Source: packages/host-api/src/host.ts:373
PackStep const
const PackStep: Schema.Literals<readonly ["more", "loaded", "hadRows"]> One pack-load step's answer: more to enter again, loaded, or hadRows (the branch had rows; nothing changed).
Source: packages/host-api/src/host.ts:366
PageView type
type PageView = {
readonly route: string;
readonly dwell_ms: number;
}; One page a person had open: its route pattern (no record id, no query) and how long it stayed open.
Members
| Name | Type | Description |
|---|---|---|
route | string | |
dwell_ms | number |
Source: packages/host-api/src/host.ts:153
integrations
Pairing const
const Pairing: Schema.Struct<{ readonly kind: Schema.Literals<readonly ["qr", "code", "credential", "form", "oauth"]>; readonly value: Schema.withDecodingDefaultKey<Schema.middlewareDecoding<Schema.NullOr<Schema.String>, never>, never>; readonly expires_at: Schema.optionalKey<Schema.middlewareDecoding<Schema.String, never>>; readonly label: Schema.optionalKey<Schema.middlewareDecoding<Schema.String, never>>; readonly fields: Schema.optionalKey<Schema.Codec<readonly { readonly name: string; readonly label: string | { readonly en: string; readonly zh?: string; }; readonly secret?: boolean; readonly hint?: str… What the provider wants from the operator, when it wants something. value is the payload to draw (a QR, a code).
Source: packages/host-api/src/integrations.ts:152
facilities
PaperSize type
type PaperSize = (typeof PAPER_SIZES)[number]; One of PAPER_SIZES.
Source: packages/host-api/src/facilities.ts:87
studio
PhaseState type
type PhaseState = 'running' | 'done' | 'failed'; Where an authoring phase stands.
Source: packages/host-api/src/studio.ts:392
facilities
PhoneVerifier type
type PhoneVerifier = {
via: readonly ('sms' | 'whatsapp')[];
start(to: string, via: 'sms' | 'whatsapp', signal: AbortSignal): Promise<void>;
check(to: string, code: string, signal: AbortSignal): Promise<boolean>;
}; Sends and checks its own six-digit codes to a mobile number, by each of via. check is false for a wrong, expired or used code; a throw is a failure to ask.
Members
| Name | Type | Description |
|---|---|---|
via | readonly ('sms' | 'whatsapp')[] | |
start | (to: string, via: "sms" | "whatsapp", signal: AbortSignal) => Promise<void> | |
check | (to: string, code: string, signal: AbortSignal) => Promise<boolean> |
Source: packages/host-api/src/facilities.ts:200
Point type
type Point = {
readonly lat: number;
readonly lng: number;
}; A point on Earth: latitude and longitude in degrees.
Members
| Name | Type | Description |
|---|---|---|
lat | number | |
lng | number |
Source: packages/host-api/src/facilities.ts:162
port
Port const
const Port: { call: (facility: string, wallMs: number, message?: string) => <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E | FacilityFailure, R>; fromPromise: <A, RD>(f: (signal: AbortSignal) => PromiseLike<unknown>, decode: Schema.Decoder<A, RD>, facility?: string) => Effect.Effect<A, PortFailure, RD>; attempt: <A>(facility: string, f: (signal: AbortSignal) => PromiseLike<A>) => Effect.Effect<A, PortFailure>; failure: typeof failureOf; unavailable: (facility: string, reason?: string) => Effect.Effect<never, Unavailable>; } Helpers that run host port calls under a wall and turn a port's throw or bad answer into a typed PortFailure.
Members
| Name | Type | Description |
|---|---|---|
call | (facility: string, wallMs: number, message?: string) => <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E | FacilityFailure, R> | Bounds one port call by its wall: past |
fromPromise | <A, RD>(f: (signal: AbortSignal) => PromiseLike<unknown>, decode: Schema.Decoder<A, RD>, facility?: string) => Effect.Effect<A, PortFailure, RD> | A Promise port call: interruption aborts |
attempt | <A>(facility: string, f: (signal: AbortSignal) => PromiseLike<A>) => Effect.Effect<A, PortFailure> | A typed host Promise ABI call: |
failure | typeof failureOf | A port's throw as its failure, for a caller with its own catch (a driver's |
unavailable | (facility: string, reason?: string) => Effect.Effect<never, Unavailable> | The failure of a port the host does not provide. |
Source: packages/host-api/src/port.ts:46
errors
PortFailure type
type PortFailure = FacilityFailure | Unavailable; What a port call fails with: the facility's own failure, or the host providing none.
Source: packages/host-api/src/errors.ts:37
studio
PreviewControl type
type PreviewControl = {
holder: 'norbius' | 'person';
conversation?: string;
at?: string;
}; Who is driving a change's preview: Norbius (with its conversation) or the person.
Members
| Name | Type | Description |
|---|---|---|
holder | 'norbius' | 'person' | |
conversation? | string | |
at? | string |
Source: packages/host-api/src/studio.ts:181
facilities
PreviewPdfOptions type
type PreviewPdfOptions = {
page?: PaperSize;
landscape?: boolean;
}; A PDF's paper and orientation.
Members
| Name | Type | Description |
|---|---|---|
page? | PaperSize | |
landscape? | boolean |
Source: packages/host-api/src/facilities.ts:89
integrations
Provider type
type Provider = ProviderChoice & {
/** The driver's name: one of the release's kinds, or a driver a definition declares (`whatsapp`, `slack`, …). */
driver: string;
/** Required for a native boundary: validates and normalizes only this provider's declared fields. */
validate_import_start?(values: Readonly<Record<string, string>>): Promise<Readonly<Record<string, string>>>;
/** It imports a personal account (history and own sent messages) without sending. */
personal?: boolean;
/** It signs in with this vendor's OAuth client (`DriverOpen.oauth_client`); offered only where one is configured. */
oauth?: OAuthVendor;
/** The provider can send a test message once connected (`POST …/test`). */
test?: TestSend;
/**
* `send` is idempotent by `message.id`: a repeat reaches the customer once, so a send that timed out is sent again.
* Otherwise such a message stays `uncertain`, since the first send may have arrived.
*/
idempotent_sends?: boolean;
/** Provider-owned registration text for a personal or a workspace instance of `definition`; credentials and pairing keep the same runtime. */
describe?(options: {
readonly personal: boolean;
readonly definition: IntegrationDefinition;
}): Pick<ProviderChoice, 'label' | 'setup'>;
open(ctx: DriverOpen): Promise<Link>;
}; A provider (@norbital-ai/providers, or a host's own), registered by the host for one driver by name. A release never names one. It runs in the host, outside the guest wall, with sealed credentials, raw network and direct emit, which is why a workspace cannot supply one. The contract stays Promise + AbortSignal + JSON; the engine adapts it once, aborting the signal on interruption and decoding every answer. A provider acknowledges an inbound delivery only after emit resolves, so a refused store is redelivered.
Members
| Name | Type | Description |
|---|---|---|
label | Schema.Union<readonly [Schema.String, Schema.Struct<{ readonly en: Schema.String; readonly zh: Schema.optionalKey<Schema.middlewareDecoding<Schema.String, never>>; }>]> | |
id | Schema.String | |
setup | Schema.Struct<{ readonly kind: Schema.Literals<readonly ["form", "qr", "code", "oauth", "none"]>; readonly steps: Schema.withDecodingDefaultKey<Schema.Codec<readonly { readonly text: string | { readonly en: string; readonly zh?: string; }; readonly href?: string; readonly copy?: "redirect_url" | "webhook_url"; }[], unknown, never, never>, never>; readonly fields: Schema.optionalKey<Schema.Codec<r… | |
description? | Schema.optionalKey<Schema.middlewareDecoding<Schema.Union<readonly [Schema.String, Schema.Struct<{ readonly en: Schema.String; readonly zh: Schema.optionalKey<Schema.middlewareDecoding<Schema.String, never>>; }>]>, never>> | Concise catalogue description, localized by the authored surface. |
icon? | Schema.optionalKey<Schema.middlewareDecoding<Schema.String, never>> | Iconify provider mark, with a generic plug fallback when absent. |
name? | Schema.optionalKey<Schema.middlewareDecoding<Schema.Union<readonly [Schema.String, Schema.Struct<{ readonly en: Schema.String; readonly zh: Schema.optionalKey<Schema.middlewareDecoding<Schema.String, never>>; }>]>, never>> | Short catalogue name; the full registration label remains in |
import_start? | Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{ readonly kind: Schema.Literal<"timestamp">; readonly precision: Schema.optionalKey<Schema.Literal<"second">>; }>, Schema.Struct<{ readonly kind: Schema.Literal<"native">; readonly fields: Schema.$Array<Schema.Struct<{ readonly name: Schema.String; readonly label: Schema.Union<readonly [Schema.String, Schema.Struct<{ readonly en: Schema.Str… | |
available? | Schema.optionalKey<Schema.middlewareDecoding<Schema.Boolean, never>> |
|
driver | string | The driver's name: one of the release's kinds, or a driver a definition declares ( |
validate_import_start? | ((values: Readonly<Record<string, string>>) => Promise<Readonly<Record<string, string>>>) | undefined | Required for a native boundary: validates and normalizes only this provider's declared fields. |
personal? | boolean | It imports a personal account (history and own sent messages) without sending. |
oauth? | OAuthVendor | It signs in with this vendor's OAuth client ( |
test? | TestSend | The provider can send a test message once connected ( |
idempotent_sends? | boolean |
|
describe? | ((options: { readonly personal: boolean; readonly definition: IntegrationDefinition; }) => Pick<ProviderChoice, "label" | "setup">) | undefined | Provider-owned registration text for a personal or a workspace instance of |
open | (ctx: DriverOpen) => Promise<Link> |
Source: packages/host-api/src/integrations.ts:578
ProviderChoice const
const ProviderChoice: Schema.Struct<{ readonly id: Schema.String; readonly label: Schema.Union<readonly [Schema.String, Schema.Struct<{ readonly en: Schema.String; readonly zh: Schema.optionalKey<Schema.middlewareDecoding<Schema.String, never>>; }>]>; readonly setup: Schema.Struct<{ readonly kind: Schema.Literals<readonly ["form", "qr", "code", "oauth", "none"]>; readonly steps: Schema.withDecodingDefaultKey<Schema.Codec<readonly { readonly text: string | { readonly en: string; readonly zh?: string; }; readonly href?: string; readonly copy?: "redirect_url" | "webhook_url"; }[], unknown, never, never>, never>; read… A provider as the shell offers it: a driver with several (WhatsApp) asks which, by label, first.
Source: packages/host-api/src/integrations.ts:133
tools
REFERENCE const
const REFERENCE: { readonly mime: "application/vnd.norbital.reference+json"; readonly treeBytes: number; } A repository reference ("Agents' files"): the host's reference tool keeps this index as the person's output file, named <repository>@<commit>, and a file run reads its tree from it. Each text file is a blob by its content address. A run reads the whole tree, so a reference over treeBytes runs no file.
Members
| Name | Type | Description |
|---|---|---|
mime | 'application/vnd.norbital.reference+json' | |
treeBytes | number |
Source: packages/host-api/src/tools.ts:182
integrations
REPORTED_KINDS const
const REPORTED_KINDS: readonly ["sent", "deferred", "delivered", "read", "opened", "bounced", "failed", "complained"] What a provider may report about a message it sent; replies and auto-replies arrive as inbound messages instead.
Source: packages/host-api/src/integrations.ts:254
db
RawDb type
type RawDb = {
/** Read statements share one snapshot and answer in order; rows are relayed as JSON. */
readonly read: (statements: readonly Sql[]) => Effect.Effect<readonly Rows[], DbError>;
/** An act's one write statement, with fixed deadlines and native locks before execution. */
readonly write: (statement: Sql, lock?: Lock) => Effect.Effect<Rows, DbError>;
/** Complete SQL statements atomically; answers are decoded only after commit or native dry-run rollback. */
readonly transaction: (batch: DbBatch) => Effect.Effect<readonly Rows[], DbError>;
}; What a host's database adapter implements, as Effects failing with the driver's DbError.
Members
| Name | Type | Description |
|---|---|---|
read | (statements: readonly Sql[]) => Effect.Effect<readonly Rows[], DbError> | Read statements share one snapshot and answer in order; rows are relayed as JSON. |
write | (statement: Sql, lock?: Lock) => Effect.Effect<Rows, DbError> | An act's one write statement, with fixed deadlines and native locks before execution. |
transaction | (batch: DbBatch) => Effect.Effect<readonly Rows[], DbError> | Complete SQL statements atomically; answers are decoded only after commit or native dry-run rollback. |
Source: packages/host-api/src/db.ts:28
integrations
ReconcilePage type
type ReconcilePage = {
messages: readonly Json[];
complete: boolean;
since?: string;
bins?: readonly Uint8Array[];
}; The platform's current view of one thread since an instant (Link.reconcile). messages is what a messages event would carry, with bins for its bytes: what others wrote, and a personal account's own messages marked outbound. complete says it holds every message of the window, so what it lacks was deleted; a partial page repairs what it shows and deletes nothing. since narrows the window: the instant the platform's history really reaches back to, when that is later than the instant asked for.
Members
| Name | Type | Description |
|---|---|---|
messages | readonly Json[] | |
complete | boolean | |
since? | string | |
bins? | readonly Uint8Array[] |
Source: packages/host-api/src/integrations.ts:323
tools
ReferenceIndex const
const ReferenceIndex: Schema.Struct<{ readonly repository: Schema.String; readonly commit: Schema.NullOr<Schema.String>; readonly digest: Schema.String; readonly files: Schema.$Array<Schema.Struct<{ readonly path: Schema.String; readonly key: Schema.String; readonly bytes: Schema.Number; }>>; }> Schema of a repository reference file: repository, commit, tree digest and each file's path, blob key and size.
Source: packages/host-api/src/tools.ts:187
ports
Release type
type Release = {
/** The host's release id (the artifact digest it records): authorities are compiled per release. */
readonly id: string;
/** The release's files (`artifact.json`, `client/…`) and its seed packs (`../seed/<pack>/…`), read-only. */
readonly artifact: ArtifactPort;
}; A built workspace: bolt build's release, with source, format and digests verified by this release.
Members
| Name | Type | Description |
|---|---|---|
id | string | The host's release id (the artifact digest it records): authorities are compiled per release. |
artifact | ArtifactPort | The release's files ( |
Source: packages/host-api/src/ports.ts:23
answers
ReleaseFacts const
const ReleaseFacts: Schema.Struct<{ readonly zone: Schema.String; readonly skills: Schema.$Array<Schema.String>; readonly pages: Schema.$Array<Schema.String>; readonly secrets: Schema.Boolean; readonly issues: Schema.$Array<Schema.String>; readonly studio: Schema.Struct<{ readonly workspace: Schema.Struct<{ readonly secrets: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>; }>; readonly models: Schema.$Record<Schema.String, Schema.Unknown>; readonly apps: Schema.$Record<Schema.String, Schema.Struct<{ readonly shell: Schema.optionalKey<Schema.String>; readonly pages: Schema.$Record<Schema.String,… describe: what a release says about itself, decoded by its own Bolt from its manifest.
Source: packages/host-api/src/answers.ts:31
facilities
RenderPort interface
interface RenderPort {
pdf(page: {
path: string;
authorization: string;
}, signal: AbortSignal): Promise<Uint8Array>;
} The host's headless browser printing one workspace page to PDF (ctx.convert.record). path is under the workspace's public URL (/?record=<model>/<id>&print); every request the page makes carries the header authorization: <authorization> (a render grant, valid only while this call runs). The host loads the page with print media, waits until <html data-bolt-print="ready"> (or "failed", a refusal: answer it as an error), and answers page.pdf() with its CSS page size and backgrounds.
Members
| Name | Type | Description |
|---|---|---|
pdf | (page: { path: string; authorization: string; }, signal: AbortSignal) => Promise<Uint8Array> |
Source: packages/host-api/src/facilities.ts:156
db
Rows type
type Rows = {
readonly rows: readonly {
readonly [column: string]: Json;
}[];
readonly affected: number;
}; A statement's result: its rows as JSON column maps and the number of rows it affected.
Members
| Name | Type | Description |
|---|---|---|
rows | readonly { readonly [column: string]: Json; }[] | |
affected | number |
Source: packages/host-api/src/db.ts:10
port
Run type
type Run = <A, E>(effect: Effect.Effect<A, E>, options?: {
readonly signal?: AbortSignal | undefined;
}) => Promise<A>; A host's runner (FiberSet.makeRuntimePromise): runs an Effect to a Promise, interrupted when signal aborts.
Source: packages/host-api/src/port.ts:97
authority
RunBy const
const RunBy: Schema.Union<readonly [Schema.Struct<{ readonly automation: Schema.String; }>, Schema.Struct<{ readonly platform: Schema.String; }>, Schema.Struct<{ readonly sync: Schema.String; readonly instance: Schema.String; }>]> What a system run is: an automation's, the platform's own work (agent: a system agent's task), or a sync's.
Source: packages/host-api/src/authority.ts:6
facilities
SIGN_IN_CODE_MS const
const SIGN_IN_CODE_MS: number How long a sign-in code stays valid.
Source: packages/host-api/src/facilities.ts:206
tools
SKILL_BYTES const
const SKILL_BYTES: number Most bytes one skill's folder may hold (10 MiB).
Source: packages/host-api/src/tools.ts:174
SKILL_FILE const
const SKILL_FILE: "SKILL.md" The skill's text in its tree (in a workspace's source, the folder's +skill.md).
Source: packages/host-api/src/tools.ts:176
studio
STUDIO_PHASES const
const STUDIO_PHASES: readonly ["diagnose", "copy", "preview", "merge"] An authoring phase: diagnose (the build's checks) → copy (the preview's data) → preview → merge.
Source: packages/host-api/src/studio.ts:388
tools
STUDIO_ROLES const
const STUDIO_ROLES: readonly ["preview", "view", "logs", "merge", "rollback"] What a host tool is to the shell's Studio surfaces, declared so a release never keys behaviour on a host's tool names: - preview: its result's preview is a preview it built; the agent may show that origin (page { preview }). - view: a look at a rendered page; the images it attaches are shown to the person too, and its result's url is a preview the panel may show. - logs: its result is { records: StudioLogLine[] }, listed in full on the step. - merge / rollback: a confirmed switch-over; its input is { summary, commit }, its card says what changes. A Studio result's caption facts (environment, release, commit, message, branch, url, viewport, capturedAt) are read at its top level.
Source: packages/host-api/src/tools.ts:18
studio
STUDIO_TABS const
const STUDIO_TABS: readonly ["workbench", "changes", "versions"] Studio's tabs, each a stable deep link /studio/<tab>; /studio is the workbench.
Source: packages/host-api/src/studio.ts:450
host
SchemaSlice const
const SchemaSlice: Schema.Codec<Schema.Json, Schema.Json, never, never> A release's schema state, opaque to the host: it stores one and hands it back to schema.destructive.
Source: packages/host-api/src/host.ts:471
tools
SearchAnswer type
type SearchAnswer = {
readonly hits: readonly {
readonly path: string;
readonly line: number;
readonly text: string;
}[];
readonly truncated: boolean;
readonly counts?: {
readonly lines: number;
readonly files: number;
};
} | {
readonly error: string;
}; A workspace_grep answer: its hits in path order and whether the limit cut them, or why it failed.
Source: packages/host-api/src/tools.ts:140
SearchRequest type
type SearchRequest = {
readonly pattern: string;
readonly path?: string;
readonly include?: string;
/** Only the files holding a match, one hit each. */
readonly files?: boolean;
readonly literal?: boolean;
readonly case_sensitive?: boolean;
/** Count all matching lines and files without returning excerpts. */
readonly count?: boolean;
readonly limit?: number;
}; A workspace_grep as the host's ripgrep answers it, its hits in path order.
Members
| Name | Type | Description |
|---|---|---|
pattern | string | |
path? | string | |
include? | string | |
files? | boolean | Only the files holding a match, one hit each. |
literal? | boolean | |
case_sensitive? | boolean | |
count? | boolean | Count all matching lines and files without returning excerpts. |
limit? | number |
Source: packages/host-api/src/tools.ts:127
host
SeedAsset type
type SeedAsset = {
readonly path: string;
readonly sha256: string;
readonly bytes: number;
readonly content_type: string;
}; A seed asset a restore reads: its path in the pack, digest, size and media type.
Members
| Name | Type | Description |
|---|---|---|
path | string | |
sha256 | string | |
bytes | number | |
content_type | string |
Source: packages/host-api/src/host.ts:349
integrations
SendReceipt const
const SendReceipt: Schema.Struct<{ readonly provider_id: Schema.NonEmptyString; readonly presume_after_ms: Schema.optional<Schema.Number>; }> A send's acknowledgement, decoded once where the provider crosses into the engine: the provider_id delivery events name, and optionally how long a quiet window lasts before the message is presumed delivered.
Source: packages/host-api/src/integrations.ts:248
errors
SendRefused class
class SendRefused extends Error {
readonly name = "SendRefused";
readonly code: string | undefined;
readonly permanent: boolean;
constructor(message: string, code?: string, permanent?: boolean);
} A provider's refusal of a send, thrown from LinksPort.send: permanent (SMTP 5xx, an API 4xx) fails the message at once; otherwise bolt retries it with backoff and records deferred (SMTP 4xx). Recognised by name, so a copy of this class in another bundle still counts.
Members
| Name | Type | Description |
|---|---|---|
name | "SendRefused" | |
code | string | undefined | |
permanent | boolean |
Source: packages/host-api/src/errors.ts:77
host
SentFeedback const
const SentFeedback: Schema.Struct<{ readonly id: Schema.String; readonly text: Schema.String; readonly at: Schema.String; readonly status: Schema.Literals<readonly ["received", "working", "done", "closed", "platform"]>; readonly reply: Schema.NullOr<Schema.Struct<{ readonly by: Schema.Literals<readonly ["assistant", "administrator"]>; readonly text: Schema.String; readonly at: Schema.String; }>>; }> Something a person sent before, as its sender sees it: their words, where it stands and the last word on it.
Source: packages/host-api/src/host.ts:136
facilities
Serving type
type Serving = {
/** The integration drivers the workspace's links open (`to_drivers` from `@norbital-ai/providers/abi`). */
readonly providers?: readonly Provider[];
readonly oauth?: Partial<Record<OAuthVendor, OAuthClient>>;
/** Norbital Convert: documents for `ctx.convert.document`, and `ingest` for the agent and `ctx.convert.ingest`. */
readonly convert?: ConvertPort;
/** A headless browser printing a record's print route to PDF (`ctx.convert.record`). */
readonly render?: RenderPort;
/** Capabilities the host supplies to agent turns and `ctx.ai.sys_2.infer` (`web_search`); a policy still has to name each. */
readonly host_tools?: AgentPorts['host_tools'];
readonly geocoder?: GeocoderPort;
readonly web?: WebReadPort;
readonly browser?: BrowserPort;
readonly shell?: Pick<ShellPorts, 'environment' | 'push'>;
close?(): Promise<void>;
}; What a host file (norbital.host.ts) may export as serving beside its default Facilities: the parts an untethered host serves around them. Each one absent is off; close ends what the file opened when its host stops.
Members
| Name | Type | Description |
|---|---|---|
providers? | readonly Provider[] | The integration drivers the workspace's links open ( |
oauth? | Partial<Record<OAuthVendor, OAuthClient>> | |
convert? | ConvertPort | Norbital Convert: documents for |
render? | RenderPort | A headless browser printing a record's print route to PDF ( |
host_tools? | AgentPorts['host_tools'] | Capabilities the host supplies to agent turns and |
geocoder? | GeocoderPort | |
web? | WebReadPort | |
browser? | BrowserPort | |
shell? | Pick<ShellPorts, 'environment' | 'push'> | |
close? | (() => Promise<void>) | undefined |
Source: packages/host-api/src/facilities.ts:426
integrations
SetupDescription const
const SetupDescription: Schema.Struct<{ readonly kind: Schema.Literals<readonly ["form", "qr", "code", "oauth", "none"]>; readonly steps: Schema.withDecodingDefaultKey<Schema.Codec<readonly { readonly text: string | { readonly en: string; readonly zh?: string; }; readonly href?: string; readonly copy?: "redirect_url" | "webhook_url"; }[], unknown, never, never>, never>; readonly fields: Schema.optionalKey<Schema.Codec<readonly { readonly name: string; readonly label: string | { readonly en: string; readonly zh?: string; }; readonly secret?: boolean; readonly hint?: string | { readonly en: string; readonly zh?: strin… How a provider is set up, as data the shell renders with no provider-named component. kind is what pair takes: form sends fields; qr/code sends the optional fields and then shows what pairing publishes; oauth sends nothing and publishes a sign-in; none needs nothing. A qr, code or oauth setup starts on Connect. webhook: the operator pastes about.webhook_url into the provider.
Source: packages/host-api/src/integrations.ts:78
SetupField const
const SetupField: Schema.Struct<{ readonly name: Schema.String; readonly label: Schema.Union<readonly [Schema.String, Schema.Struct<{ readonly en: Schema.String; readonly zh: Schema.optionalKey<Schema.middlewareDecoding<Schema.String, never>>; }>]>; readonly secret: Schema.optionalKey<Schema.middlewareDecoding<Schema.Boolean, never>>; readonly hint: Schema.optionalKey<Schema.middlewareDecoding<Schema.Union<readonly [Schema.String, Schema.Struct<{ readonly en: Schema.String; readonly zh: Schema.optionalKey<Schema.middlewareDecoding<Schema.String, never>>; }>]>, never>>; readonly optional: Schema.optionalKey<Sch… One input a provider's setup collects. secret is drawn masked and never echoed back in about.
Source: packages/host-api/src/integrations.ts:52
SetupStep const
const SetupStep: Schema.Struct<{ readonly text: Schema.Union<readonly [Schema.String, Schema.Struct<{ readonly en: Schema.String; readonly zh: Schema.optionalKey<Schema.middlewareDecoding<Schema.String, never>>; }>]>; readonly href: Schema.optionalKey<Schema.middlewareDecoding<Schema.String, never>>; readonly copy: Schema.optionalKey<Schema.middlewareDecoding<Schema.Literals<readonly ["webhook_url", "redirect_url"]>, never>>; }> One instruction, in order. href is where to do it (the provider's console); copy a value to paste there: the instance's webhook_url, or redirect_url (the host's one OAuth callback, to register with an OAuth app once).
Source: packages/host-api/src/integrations.ts:66
host
ShellNotice type
type ShellNotice = {
text: string;
tone?: 'info' | 'warning';
href?: string;
action?: string;
}; A host banner above every page; href is its one action.
Members
| Name | Type | Description |
|---|---|---|
text | string | |
tone? | 'info' | 'warning' | |
href? | string | |
action? | string |
Source: packages/host-api/src/host.ts:48
ShellPorts type
type ShellPorts = {
/** Read on every request: the host may rename or rebrand the workspace while it serves. */
readonly workspace: () => {
readonly name: string;
readonly handle: string;
readonly icons?: readonly {
readonly src: string;
readonly sizes: string;
readonly type: string;
}[];
};
readonly push?: {
readonly public_key: string;
};
readonly studio?: StudioPort;
/** The agent panel is offered. */
readonly ai?: boolean;
/** The environment badge's name (`production` shows none). */
readonly environment?: string;
readonly notice?: (auth: Authority) => Promise<ShellNotice | null>;
readonly organization?: {
write(auth: Authority, branding: {
logo: string | null;
}): Promise<void>;
};
/** The host's apex origin (sign-in hand-off, the workspace switcher). */
readonly apex?: string;
/** Set when this shell serves a preview environment: the live workspace's address (the preview banner's link). */
readonly live?: string;
/**
* Where an administrator repairs this workspace when it will not open (the host's recovery Studio). A host with no
* recovery of its own (a self-hosted server) sets none; the failure card then offers only a retry.
*/
readonly recovery?: string;
/**
* Where an administrator sees this workspace's usage, cost, payment card and invoices (the host's billing pa… The shell's host parts; studio and organization.write may reject with an encoded HostFailure.
Members
| Name | Type | Description |
|---|---|---|
workspace | () => { readonly name: string; readonly handle: string; readonly icons?: readonly { readonly src: string; readonly sizes: string; readonly type: string; }[]; } | Read on every request: the host may rename or rebrand the workspace while it serves. |
push? | { readonly public_key: string; } | |
studio? | StudioPort | |
ai? | boolean | The agent panel is offered. |
environment? | string | The environment badge's name ( |
notice? | (auth: Authority) => Promise<ShellNotice | null> | |
organization? | { write(auth: Authority, branding: { logo: string | null; }): Promise<void>; } | |
apex? | string | The host's apex origin (sign-in hand-off, the workspace switcher). |
live? | string | Set when this shell serves a preview environment: the live workspace's address (the preview banner's link). |
recovery? | string | Where an administrator repairs this workspace when it will not open (the host's recovery Studio). A host with no recovery of its own (a self-hosted server) sets none; the failure card then offers only a retry. |
billing? | string | Where an administrator sees this workspace's usage, cost, payment card and invoices (the host's billing page); Settings links it. A host that bills nothing sets none. |
workspaces? | (auth: Authority) => Promise<readonly WorkspaceLink[]> | |
feedback? | { readonly send: (auth: Authority, feedback: Feedback) => Promise<void>; readonly sent: (auth: Authority) => Promise<readonly SentFeedback[]>; } | The shell's Feedback dialog: |
usage? | (auth: Authority, views: readonly PageView[]) => Promise<void> | Page views as the shell saw them, in order; a host that keeps no usage sets none and the shell sends nothing. |
Source: packages/host-api/src/host.ts:57
ports
Signal type
type Signal = {
readonly signal: AbortSignal;
}; The abort signal every call takes.
Members
| Name | Type | Description |
|---|---|---|
signal | AbortSignal |
Source: packages/host-api/src/ports.ts:6
tools
SkillSchema const
const SkillSchema: Schema.Struct<{ readonly text: Schema.String; readonly digest: Schema.String; readonly files: Schema.$Array<Schema.String>; }> A skill ("Running a file"): a folder of SKILL.md, its scripts and the pure-JavaScript packages it vendors, at most SKILL_BYTES. Its SKILL.md text, the digest of its tree (sha256 hex of the sorted <path>\0<sha256 hex> lines, \n-joined) and its file paths, sorted; the bytes are the artifact's skills/<name>/.
Source: packages/host-api/src/tools.ts:168
db
Sql type
type Sql = {
readonly text: string;
readonly params: readonly Json[];
}; One statement with positional parameters ($1…); values are JSON (numeric, timestamps and dates as strings).
Members
| Name | Type | Description |
|---|---|---|
text | string | |
params | readonly Json[] |
Source: packages/host-api/src/db.ts:8
studio
StudioApproval type
type StudioApproval = {
id: string;
op: StudioOp;
requestor: string;
conversation: string;
at: string;
head?: string;
destructive?: readonly string[];
}; A live-changing op (a merge, a rollback) the agent asked for, held for its requestor: it runs as them once they approve it. head: the change's head it was asked on (a moved one refuses the approval); destructive: the schema steps approving a merge accepts.
Members
| Name | Type | Description |
|---|---|---|
id | string | |
op | StudioOp | |
requestor | string | |
conversation | string | |
at | string | |
head? | string | |
destructive? | readonly string[] |
Source: packages/host-api/src/studio.ts:378
StudioBuild type
type StudioBuild = {
commit: string;
at: string;
status: 'built' | 'failed';
message: string;
deployed: boolean;
live: boolean;
lines: number;
diagnostics: number;
}; A build of a commit, newest first: deployed once a Version ran it, live while live serves it.
Members
| Name | Type | Description |
|---|---|---|
commit | string | |
at | string | |
status | 'built' | 'failed' | |
message | string | |
deployed | boolean | |
live | boolean | |
lines | number | |
diagnostics | number |
Source: packages/host-api/src/studio.ts:109
StudioChangeSet type
type StudioChangeSet = {
id: string;
title: string;
state: 'open' | 'merged';
opened_by: string;
contributors: readonly string[];
branch: string;
base: string;
head: string;
/** What it holds beyond live: each commit's message, oldest first. */
commits: readonly string[];
/** The same commits with their ids; a merged one keeps them. */
history?: readonly {
commit: string;
message: string;
}[];
/** What a merge changed, against `base`. */
files?: readonly {
path: string;
change: 'added' | 'modified' | 'deleted';
}[];
behind: number;
preview: StudioPreview | null;
merge?: {
/** `queued` waits its turn: `at` is when it asked, and order among the queued is by `at`. */
state: 'scheduled' | 'queued' | 'running' | 'failed';
at: string;
head: string;
error?: string;
run_at?: string;
};
log: readonly StudioLogLine[];
created_at: string;
updated_at: string;
/** Its head's last build's diagnosis. */
diagnostics?: readonly StudioDiagnostic[];
}; A Change: a named set of edits on branch, from live, with its own preview. base is where it left live (the diff's other side) and behind how many live commits it lacks (a merge takes them in). merge is a merge running in the background, or the reason the last one failed; a clean merge moves live and records a Version.
Members
| Name | Type | Description |
|---|---|---|
id | string | |
title | string | |
state | 'open' | 'merged' | |
opened_by | string | |
contributors | readonly string[] | |
branch | string | |
base | string | |
head | string | |
commits | readonly string[] | What it holds beyond live: each commit's message, oldest first. |
history? | readonly { commit: string; message: string; }[] | The same commits with their ids; a merged one keeps them. |
files? | readonly { path: string; change: 'added' | 'modified' | 'deleted'; }[] | What a merge changed, against |
behind | number | |
preview | StudioPreview | null | |
merge? | { /** `queued` waits its turn: `at` is when it asked, and order among the queued is by `at`. */ state: 'scheduled' | 'queued' | 'running' | 'failed'; at: string; head: string; error?: string; run_at?: string; } | |
log | readonly StudioLogLine[] | |
created_at | string | |
updated_at | string | |
diagnostics? | readonly StudioDiagnostic[] | Its head's last build's diagnosis. |
Source: packages/host-api/src/studio.ts:142
StudioDiagnostic type
type StudioDiagnostic = CheckDiagnostic & {
severity?: 'error' | 'warn';
}; One diagnostic of the last build (bolt build --json's errors); severity defaults to error.
Members
| Name | Type | Description |
|---|---|---|
message | Schema.String | |
code | Schema.String | |
path | Schema.String | |
line? | Schema.optionalKey<Schema.Number> | |
help? | Schema.optionalKey<Schema.String> | |
severity? | 'error' | 'warn' |
Source: packages/host-api/src/studio.ts:88
StudioEnvironment type
type StudioEnvironment = {
name: string;
release: string;
url: string | null;
}; A tenant environment the host routes (live, a change's preview, …): release is the artifact it serves, '' when unrouted.
Members
| Name | Type | Description |
|---|---|---|
name | string | |
release | string | |
url | string | null |
Source: packages/host-api/src/studio.ts:120
StudioFile const
const StudioFile: Schema.Union<readonly [Schema.Struct<{ readonly text: Schema.String; readonly truncated: Schema.optionalKey<Schema.Struct<{ readonly limit: Schema.Number; readonly bytes: Schema.Number; }>>; }>, Schema.Struct<{ readonly binary: Schema.Literal<true>; readonly bytes: Schema.Number; }>]> One file of a commit (StudioPort.file): its text, or binary (not UTF-8 text) with its size. A text past the host's one-file bound is cut there, and truncated says so: limit the bound, bytes the whole file (the editor is then read-only, so a save never writes the cut text back).
Source: packages/host-api/src/studio.ts:77
StudioFileChange type
type StudioFileChange = {
path: string;
change: 'added' | 'modified' | 'deleted';
text?: string;
baseline?: string;
}; A changed file and what its diff needs: the head's text (absent: deleted, or not text) and the base's baseline (absent: added, or not text), each cut at the host's one-file text bound.
Members
| Name | Type | Description |
|---|---|---|
path | string | |
change | 'added' | 'modified' | 'deleted' | |
text? | string | |
baseline? | string |
Source: packages/host-api/src/studio.ts:66
StudioFrame const
const StudioFrame: Schema.Decoder<StudioFrame, never> A pushed authoring frame: a build log line, a head moved (someone else saved), a change changed, a phase or task moved.
Source: packages/host-api/src/studio.ts:394
StudioInspectInput const
const StudioInspectInput: Schema.Struct<{ readonly range: Schema.Literals<readonly ["24h", "7d", "30d"]>; readonly view: Schema.optionalKey<Schema.Literals<readonly ["bundle", "telemetry", "logs", "users", "activity", "improvements"]>>; readonly build: Schema.optionalKey<Schema.NullOr<Schema.String>>; readonly run: Schema.optionalKey<Schema.NullOr<Schema.String>>; readonly level: Schema.optionalKey<Schema.NullOr<Schema.Literals<readonly ["info", "warn", "error"]>>>; readonly text: Schema.optionalKey<Schema.NullOr<Schema.String>>; }> The administrator's monitoring scope. No source paths, code or mutation is accepted here.
Source: packages/host-api/src/studio.ts:469
StudioInspection const
const StudioInspection: Schema.Struct<{ readonly can_inspect: Schema.Boolean; readonly as_of: Schema.String; readonly usage: Schema.$Array<Schema.Struct<{ readonly title: Schema.String; readonly unit: Schema.String; readonly lines: Schema.$Array<Schema.Struct<{ readonly label: Schema.String; readonly bound: Schema.Boolean; readonly points: Schema.$Array<Schema.Struct<{ readonly at: Schema.Number; readonly value: Schema.NullOr<Schema.Number>; }>>; }>>; readonly utilization: Schema.NullOr<Schema.Number>; }>>; readonly members: Schema.NullOr<Schema.$Array<Schema.Struct<{ readonly id: Schema.String; readonly name: Schem… Curated host diagnostics shared by the tenant Studio and Realm; never source, manifests or credentials.
Source: packages/host-api/src/studio.ts:573
StudioLogLine type
type StudioLogLine = {
at: string;
level: 'info' | 'warn' | 'error';
message: string;
}; One build log line: when, its level and its text.
Members
| Name | Type | Description |
|---|---|---|
at | string | |
level | 'info' | 'warn' | 'error' | |
message | string |
Source: packages/host-api/src/studio.ts:86
StudioManifest const
const StudioManifest: Schema.Struct<{ readonly workspace: Schema.Struct<{ readonly secrets: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>; }>; readonly models: Schema.$Record<Schema.String, Schema.Unknown>; readonly apps: Schema.$Record<Schema.String, Schema.Struct<{ readonly shell: Schema.optionalKey<Schema.String>; readonly pages: Schema.$Record<Schema.String, Schema.Unknown>; }>>; readonly policies: Schema.$Record<Schema.String, Schema.Unknown>; readonly automations: Schema.$Record<Schema.String, Schema.Unknown>; }> The parts of a build's manifest Studio reads: each declaration by name (its source path follows from it), an app's shell and pages, and the workspace's secrets.
Source: packages/host-api/src/studio.ts:51
StudioMigration type
type StudioMigration = {
state: 'passed' | 'failed';
error?: string;
impact?: MigrationImpact;
checks?: readonly {
sql: string;
before: Json;
after: Json;
}[];
}; The last run of this exact source's migrations on the author's own database: what each step did, or what refused, and each check as it read before and after. Live is never one of these: only a merge migrates live.
Members
| Name | Type | Description |
|---|---|---|
state | 'passed' | 'failed' | |
error? | string | |
impact? | MigrationImpact | |
checks? | readonly { sql: string; before: Json; after: Json; }[] |
Source: packages/host-api/src/studio.ts:190
StudioOp const
const StudioOp: Schema.Union<readonly [Schema.Struct<{ readonly op: Schema.Literal<"save">; readonly expected: Schema.String; readonly message: Schema.optionalKey<Schema.decodeTo<Schema.String, Schema.NonEmptyString, never, never>>; readonly files: Schema.$Record<Schema.String, Schema.NullOr<Schema.String>>; }>, Schema.Struct<{ readonly op: Schema.Literal<"draft">; readonly path: Schema.NonEmptyString; readonly content: Schema.String; }>, Schema.Struct<{ readonly op: Schema.Literal<"draft">; readonly path: Schema.NonEmptyString; readonly old_string: Schema.NonEmptyString; readonly new_string: Schema.String; … change.open works on an existing change (id): a person has one active change at a time, and their first edit starts it, a branch from live and a copy-on-write fork of live's data as its preview. draft writes one path of the viewer's working tree (the whole content, an old_string replacement, a move to another path or a remove) and moves no head; with none open, it opens a change. commit makes the working tree the change's next commit, in any state. save commits edits to the viewer's change over expected (a stale head is refused; with none open, the save opens one named by its message), null deletes a file. preview is the build: it builds the head and serves it, and a merge requires the preview of the head it promotes and an empty working tree; a migration the build generates, and a squash of the change's history into a verified baseline, land in the working tree. change.merge merges a change into live in the background: git's 3-way merge (conflicts land in the change as marked files, live untouched), a build of the merged tree with its checks, then the cutover; accept names the destructive schema steps it may apply (any other refuses it); at schedules it for that instant instead, and change.unschedule drops the schedule. Its cutover is the tenant's only downtime: requests answer maintenance and in-flight work is cancelled until the new release serves. change.rebase replays the viewer's commits on top of live, and a merge needs that: merged migrations stay as they are and the viewer's are set on top, and what stops lands as marked files with conflict_notes. change.revert drops a commit and those after it, source only: data rolls back on live alone. rollback brings a Version back, source and data together, recording the state it leaves as an Undo Version first; a schema change refuses it unless discard_data_since names the instant whose later writes it discards. It is neither the operator's database restore nor a record's restore. approval.decide approves (it runs as the viewer) or rejects one of the viewer's held requests (StudioState.approvals). Every op is decoded at the shell boundary.
Source: packages/host-api/src/studio.ts:278
StudioPhase type
type StudioPhase = (typeof STUDIO_PHASES)[number]; One of STUDIO_PHASES.
Source: packages/host-api/src/studio.ts:390
StudioPort type
type StudioPort = {
state(auth: Authority): Promise<StudioState>;
run(auth: Authority, op: StudioOp): Promise<StudioState>;
/** One file at a commit (`StudioState.commit`, or a change's base); `null`: no such file there. */
file(auth: Authority, commit: string, path: string): Promise<StudioFile | null>;
/** This workspace's frames as they happen, never another's; answers the unsubscribe. Absent → no live stream. */
watch?(auth: Authority, send: (frame: StudioFrame) => void): () => void;
/** Curated operational diagnostics shared with Realm across the current HOST_API contract. */
inspect(auth: Authority, input: StudioInspectInput): Promise<StudioInspection>;
/** Where this host serves Studio's browser bundle, under the workspace; `null`: it has none to serve. */
bundle?(): Promise<string | null>;
}; Called for an administrator; the host decides what each may do, a refusal rejects with an encoded HostFailure.
Members
| Name | Type | Description |
|---|---|---|
state | (auth: Authority) => Promise<StudioState> | |
run | (auth: Authority, op: StudioOp) => Promise<StudioState> | |
file | (auth: Authority, commit: string, path: string) => Promise<StudioFile | null> | One file at a commit ( |
watch? | ((auth: Authority, send: (frame: StudioFrame) => void) => () => void) | undefined | This workspace's frames as they happen, never another's; answers the unsubscribe. Absent → no live stream. |
inspect | (auth: Authority, input: StudioInspectInput) => Promise<StudioInspection> | Curated operational diagnostics shared with Realm across the current HOST_API contract. |
bundle? | (() => Promise<string | null>) | undefined | Where this host serves Studio's browser bundle, under the workspace; |
Source: packages/host-api/src/studio.ts:454
StudioPreview type
type StudioPreview = {
url: string | null;
commit: string;
artifact: string;
stale: boolean;
shelved?: true;
destructive?: readonly string[];
impact?: MigrationImpact;
}; A change's preview: its own copy-on-write fork of live's data, taken when the change was opened, serving the build of commit (stale once the head moved past it, while the newer head builds). url is null while it is shelved: idle for two hours, its fork was deleted; opening the change again re-forks live and reuses the build. destructive: the schema steps merging that build applies (a merge must accept them); impact: what applying its migrations did on the fork (each step's rows, the duration: the merge's expected downtime).
Members
| Name | Type | Description |
|---|---|---|
url | string | null | |
commit | string | |
artifact | string | |
stale | boolean | |
shelved? | true | |
destructive? | readonly string[] | |
impact? | MigrationImpact |
Source: packages/host-api/src/studio.ts:128
StudioRelease type
type StudioRelease = {
commit: string;
at: string;
message: string;
current: boolean;
checkpoint?: string | null;
rollback?: string;
undo?: true;
discards?: string;
replaced?: true;
}; A Version: every merge or rollback live ran, newest first, restorable. rollback deploys one again as a new Version, source and data together. checkpoint: the instant whose data rolling back to it keeps (null: none to roll back to). rollback: the commit this Version rolled back to. undo: the state live was in just before a rollback, so rolling back to it undoes that rollback. discards: its schema differs from live's, so rolling back to it discards the data written after this instant (a fork at its latest point). replaced: its data point belonged to a database a reset has since replaced, so it can no longer be rolled back to (checkpoint is then null).
Members
| Name | Type | Description |
|---|---|---|
commit | string | |
at | string | |
message | string | |
current | boolean | |
checkpoint? | string | null | |
rollback? | string | |
undo? | true | |
discards? | string | |
replaced? | true |
Source: packages/host-api/src/studio.ts:97
tools
StudioRole type
type StudioRole = (typeof STUDIO_ROLES)[number]; One of STUDIO_ROLES.
Source: packages/host-api/src/tools.ts:20
studio
StudioState type
type StudioState = {
commit: string;
/** The commit holding the viewer's uncommitted edits; `files`, `changes` and `conflicts` read it. Absent: none. */
working?: string;
/** The last diagnosis of this exact source; none run, absent. */
diagnosis?: 'passed' | 'failed';
/** The working tree's git tree: what a check and a test run are kept by. Absent on a monitoring read. */
tree?: string;
/** The latest test job for this exact tree; absent when it has not been tested. */
tests?: StudioTestRun;
migration?: StudioMigration;
/** The head commit's description (its message's first line). */
message?: string;
/** The live workspace's IANA timezone. */
zone?: string;
/** Every path of the tree with its size; never its content, so a read stays the same size as a file grows. */
files: {
readonly [path: string]: {
bytes: number;
};
};
changes: readonly StudioFileChange[];
manifest: StudioManifest | null;
log: readonly StudioLogLine[];
/** The viewer's change's preview URL (`null`: no change open, or its preview is shelved). */
preview: string | null;
releases: readonly StudioRelease[];
environments?: readonly StudioEnvironment[];
change?: string;
branch?: string;
preview_of?: StudioPreview;
/** The open change's preview control; absent: nobody claimed it. */
preview_control?: PreviewControl;
base?: string;
behind?: number;
conflicts… A workspace's Studio state as the host reports it: commit, working tree, checks, tests, manifest, log, preview and releases.
Members
| Name | Type | Description |
|---|---|---|
commit | string | |
working? | string | The commit holding the viewer's uncommitted edits; |
diagnosis? | 'passed' | 'failed' | The last diagnosis of this exact source; none run, absent. |
tree? | string | The working tree's git tree: what a check and a test run are kept by. Absent on a monitoring read. |
tests? | StudioTestRun | The latest test job for this exact tree; absent when it has not been tested. |
migration? | StudioMigration | |
message? | string | The head commit's description (its message's first line). |
zone? | string | The live workspace's IANA timezone. |
files | { readonly [path: string]: { bytes: number; }; } | Every path of the tree with its size; never its content, so a read stays the same size as a file grows. |
changes | readonly StudioFileChange[] | |
manifest | StudioManifest | null | |
log | readonly StudioLogLine[] | |
preview | string | null | The viewer's change's preview URL ( |
releases | readonly StudioRelease[] | |
environments? | readonly StudioEnvironment[] | |
change? | string | |
branch? | string | |
preview_of? | StudioPreview | |
preview_control? | PreviewControl | The open change's preview control; absent: nobody claimed it. |
base? | string | |
behind? | number | |
conflicts? | ReadonlyArray<{ path: string; kind: 'content' | 'binary' | 'edit/delete' | 'migration'; }> | |
conflict_notes? | readonly string[] | Why a migration among |
change_sets? | readonly StudioChangeSet[] | |
diagnostics? | readonly StudioDiagnostic[] | The viewer's change's last build's diagnosis (empty: it built clean; absent: not built, or the host reports none). |
builds? | readonly StudioBuild[] | The retained builds, newest first; |
approvals? | readonly StudioApproval[] | The viewer's own held requests: what the agent asked to change on live, awaiting their |
runtime? | { readonly current: string | null; readonly latest: string; } | The workspace's pinned |
Source: packages/host-api/src/studio.ts:197
StudioStreamFailed class
class StudioStreamFailed extends StudioStreamFailed_base {
} Studio's event stream ended: an undecodable event or a dropped connection.
Members
| Name | Type | Description |
|---|---|---|
message | string |
Source: packages/host-api/src/studio.ts:417
StudioTab type
type StudioTab = (typeof STUDIO_TABS)[number]; One of STUDIO_TABS.
Source: packages/host-api/src/studio.ts:452
StudioTestRun const
const StudioTestRun: Schema.Struct<{ readonly id: Schema.String; readonly commit: Schema.String; readonly state: Schema.Literals<readonly ["running", "passed", "failed", "empty"]>; readonly started_at: Schema.String; readonly finished_at: Schema.optionalKey<Schema.String>; readonly summary: Schema.optionalKey<Schema.Struct<{ readonly files: Schema.Int; readonly total: Schema.Int; readonly passed: Schema.Int; readonly failed: Schema.Int; readonly skipped: Schema.Int; readonly duration_ms: Schema.Finite; }>>; readonly files: Schema.$Array<Schema.Struct<{ readonly path: Schema.String; readonly state: Schema.Literals… A fixed test job's parsed results, tied to the exact source it executed.
Source: packages/host-api/src/studio.ts:11
StudioView const
const StudioView: Schema.Decoder<StudioView, never> What the browser gets: the state with the manifest cut to each Manifest chip's entries. sections is null before a build, and also when the build is stale: a declaration whose source file the workbench no longer holds fails the whole projection closed, so the pane never links into files that are gone. StudioView as the browser decodes it from the shell's Studio routes.
Source: packages/host-api/src/studio.ts:753
system-1
System1 type
type System1 = {
readonly ask: (request: DecisionRequest, model?: string) => Effect.Effect<DecisionResult, FacilityFailure | Unavailable>;
readonly maxChoices?: number | undefined;
}; System 1 as an Effect: one bounded decision call, failing as a facility failure or unavailable; a host adapts it to its System1Port. model is a catalogue id the workspace chose; absent, the adapter's own.
Members
| Name | Type | Description |
|---|---|---|
ask | (request: DecisionRequest, model?: string) => Effect.Effect<DecisionResult, FacilityFailure | Unavailable> | |
maxChoices? | number | undefined |
Source: packages/host-api/src/system-1.ts:78
ai
System1Port interface
interface System1Port {
/** `model`: a `catalog` id the workspace's administrator chose; absent, `catalog().default`. */
ask(request: DecisionRequest, signal: AbortSignal, model?: string): Promise<DecisionResult>;
readonly max_choices?: number;
/** The models the provider can decide with, as it lists them, and the one it uses unless told otherwise. */
catalog(): Promise<{
models: readonly AiModel[];
default: string;
}>;
} Host port for System 1 (sys_1): bounded, fail-closed, independent structured decisions over text, JSON, and resolved inline PNG/JPEG images (ctx.ai.sys_1.decide and conversation triage). Never falls back silently.
Members
| Name | Type | Description |
|---|---|---|
ask | (request: DecisionRequest, signal: AbortSignal, model?: string) => Promise<DecisionResult> |
|
max_choices? | number | |
catalog | () => Promise<{ models: readonly AiModel[]; default: string; }> | The models the provider can decide with, as it lists them, and the one it uses unless told otherwise. |
Source: packages/host-api/src/ai.ts:175
host
TaskEnd type
type TaskEnd = {
readonly run: string;
readonly conversation: string;
readonly state: 'completed' | 'question' | 'error' | 'cancelled';
readonly text: string;
}; How a task ended: completed with its last words, question when they ask its starter, error or cancelled.
Members
| Name | Type | Description |
|---|---|---|
run | string | |
conversation | string | |
state | 'completed' | 'question' | 'error' | 'cancelled' | |
text | string |
Source: packages/host-api/src/host.ts:122
TaskStart const
const TaskStart: Schema.Struct<{ readonly run: Schema.String; readonly description: Schema.String; readonly prompt: Schema.String; readonly files: Schema.optionalKey<Schema.$Array<Schema.Codec<Schema.Json, Schema.Json, never, never>>>; }> A system agent's task: an agent conversation no person attends, acting as the system under policies. run names it to its starter (the automation run, or the host's own id for the work).
Source: packages/host-api/src/host.ts:112
facilities
TcpEndpoint type
type TcpEndpoint = {
readonly host: string;
readonly port: number;
readonly tls: boolean;
readonly servername?: string;
}; Where a TCP connection goes; tls opens it as TLS, verified against servername (default host).
Members
| Name | Type | Description |
|---|---|---|
host | string | |
port | number | |
tls | boolean | |
servername? | string |
Source: packages/host-api/src/facilities.ts:287
TcpPort interface
interface TcpPort {
connect(endpoint: TcpEndpoint, signal: AbortSignal): Promise<TcpSocket>;
} Outbound TCP/TLS (IMAP, SMTP) under the host's egress policy: the host resolves and checks the destination (a public host refuses private and reserved networks) and connects. signal bounds the connect; close ends the connection.
Members
| Name | Type | Description |
|---|---|---|
connect | (endpoint: TcpEndpoint, signal: AbortSignal) => Promise<TcpSocket> |
Source: packages/host-api/src/facilities.ts:308
TcpSocket type
type TcpSocket = {
readonly readable: ReadableStream<Uint8Array>;
readonly writable: WritableStream<Uint8Array>;
close(): Promise<void>;
/**
* STARTTLS: TLS over this cleartext connection, verified as the endpoint says. Release both streams' locks first;
* this socket's streams then end and the returned one carries the connection.
*/
start_tls(signal: AbortSignal): Promise<TcpSocket>;
}; One outbound TCP connection as two byte streams.
Members
| Name | Type | Description |
|---|---|---|
readable | ReadableStream<Uint8Array> | |
writable | WritableStream<Uint8Array> | |
close | () => Promise<void> | |
start_tls | (signal: AbortSignal) => Promise<TcpSocket> | STARTTLS: TLS over this cleartext connection, verified as the endpoint says. Release both streams' locks first; this socket's streams then end and the returned one carries the connection. |
Source: packages/host-api/src/facilities.ts:294
integrations
TestSend const
const TestSend: Schema.Struct<{ readonly to: Schema.optionalKey<Schema.Struct<{ readonly name: Schema.String; readonly label: Schema.Union<readonly [Schema.String, Schema.Struct<{ readonly en: Schema.String; readonly zh: Schema.optionalKey<Schema.middlewareDecoding<Schema.String, never>>; }>]>; readonly secret: Schema.optionalKey<Schema.middlewareDecoding<Schema.Boolean, never>>; readonly hint: Schema.optionalKey<Schema.middlewareDecoding<Schema.Union<readonly [Schema.String, Schema.Struct<{ readonly en: Schema.String; readonly zh: Schema.optionalKey<Schema.middlewareDecoding<Schema.String, never>>; }>]>, ne… A connected instance's test send: a short test message, to the handle the operator types in to (absent: to the connected account itself).
Source: packages/host-api/src/integrations.ts:149
tools
ToolBehavior const
const ToolBehavior: Schema.Struct<{ readonly pure: Schema.optionalKey<Schema.Literal<true>>; readonly progress_check: Schema.optionalKey<Schema.Literal<true>>; readonly diagnostics: Schema.optionalKey<Schema.Literal<true>>; readonly data: Schema.optionalKey<Schema.Literal<true>>; readonly page: Schema.optionalKey<Schema.Literal<true>>; readonly downloads: Schema.optionalKey<Schema.Literal<true>>; readonly source_edit: Schema.optionalKey<Schema.Literal<true>>; readonly web_results: Schema.optionalKey<Schema.Literal<true>>; readonly resume: Schema.optionalKey<Schema.Struct<{ readonly argument: Schema.String; reado… Native tool behavior, declared by its owner and carried with its stored step: - source_edit: its input is a source edit, { path, content }, { path, oldString, newString } or { patchText }; the panel shows its diff, which never enters the model's context. - web_results: its result's results are web pages, { url, title?, site?, date?, excerpt? }, listed as links.
Source: packages/host-api/src/tools.ts:27
host
ToolSubject type
type ToolSubject = {
readonly conversation: string;
} | {
readonly run: string;
}; What a host tool list is for: one agent conversation, or one automation run's inference.
Source: packages/host-api/src/host.ts:105
tools
ToolView const
const ToolView: Schema.Struct<{ readonly icon: Schema.String; readonly verb: Schema.String; readonly target: Schema.String; readonly doing: Schema.optionalKey<Schema.String>; }> How one call reads in the panel, in the person's words: its icon (lucide:<name>), what it did (verb) and to what (target, possibly empty), and what it is doing while it runs. The shell translates the words it knows.
Source: packages/host-api/src/tools.ts:45
facilities
TransportPort interface
interface TransportPort {
/** `kind` names what it sends (`email`, `sms`, `inbox` for push); the address is the message's. Any throw is a failed send. */
send(kind: string, message: Json, signal: AbortSignal): Promise<{
provider_id: string;
}>;
} The host's transactional mail and SMS (identity codes, invitations) and web push: a send to an address.
Members
| Name | Type | Description |
|---|---|---|
send | (kind: string, message: Json, signal: AbortSignal) => Promise<{ provider_id: string; }> |
|
Source: packages/host-api/src/facilities.ts:192
errors
Unavailable class
class Unavailable extends Unavailable_base {
readonly message: string;
} An optional facility with no provider bound, or an instance not paired: the facility and why.
Members
| Name | Type | Description |
|---|---|---|
message | string | |
facility | Schema.String | |
reason | Schema.String |
Source: packages/host-api/src/errors.ts:29
storage
UnknownStorage class
class UnknownStorage extends UnknownStorage_base {
} The branch's storage is not the recovery contract's (another layout, or no applied schema).
Members
| Name | Type | Description |
|---|---|---|
message | string |
Source: packages/host-api/src/storage.ts:30
facilities
WebPage type
type WebPage = {
readonly url: string;
readonly title: string | null;
readonly text: string;
readonly content_type?: string;
readonly sha256?: string;
readonly pages?: number;
readonly html?: string;
readonly links?: readonly string[];
}; A read page: its final URL, title and readable text (a PDF's text), and, when the provider reports them, its content type, SHA-256 of the body and a document's page count; with { raw: true } also the markup and its absolute links (a crawl).
Members
| Name | Type | Description |
|---|---|---|
url | string | |
title | string | null | |
text | string | |
content_type? | string | |
sha256? | string | |
pages? | number | |
html? | string | |
links? | readonly string[] |
Source: packages/host-api/src/facilities.ts:174
WebReadPort interface
interface WebReadPort {
/** Refuses private, loopback and link-local addresses. `raw`: also the markup and its links, for a page that is markup. */
read(url: string, signal: AbortSignal, options?: {
raw?: boolean;
}): Promise<WebPage>;
} Reads a public web page as text.
Members
| Name | Type | Description |
|---|---|---|
read | (url: string, signal: AbortSignal, options?: { raw?: boolean; }) => Promise<WebPage> | Refuses private, loopback and link-local addresses. |
Source: packages/host-api/src/facilities.ts:185
host
WorkspaceBranch type
type WorkspaceBranch = {
readonly schema: {
/**
* Engine tables, then the release's schema plan (destructive steps only when accepted). Answers what it
* did: each pending step's rows and the whole duration, measured on this branch.
*/
migrate(options: Signal & {
readonly accept?: true | readonly string[];
}): Promise<MigrationImpact>;
};
readonly packs: {
/** The release's seed pack by name (`base`), its assets into `files` when given, ready to load in steps. */
load(pack: string, options: Signal & {
readonly at: string;
readonly files?: FilesPort;
}): Promise<PackLoad>;
/**
* Rows `bolt seed` sent, held only in memory, decoded here and loaded in steps like a pack; each of
* `assets` is read through `asset` into `files`.
*/
restore(rows: {
readonly [model: string]: readonly {
readonly [field: string]: Json;
}[];
}, options: Signal & {
readonly at: string;
readonly start: readonly string[];
readonly assets: readonly SeedAsset[];
readonly asset: (path: string, options: Signal) => Promise<Uint8Array>;
readonly files: FilesPort;
}): Promise<PackLoad>;
/**
* The branch's teams, members, integration instances and workspace rows as `restore` takes them, a page at a
* time from `… A branch of a workspace database the host prepared: its schema migration, seed pack loads and identity.
Members
| Name | Type | Description |
|---|---|---|
schema | { /** * Engine tables, then the release's schema plan (destructive steps only when accepted). Answers what it * did: each pending step's rows and the whole duration, measured on this branch. */ migrate(options: Signal & { readonly accept?: true | readonly string[]; }): Promise<MigrationImpact>; } | |
packs | { /** The release's seed pack by name (`base`), its assets into `files` when given, ready to load in steps. */ load(pack: string, options: Signal & { readonly at: string; readonly files?: FilesPort; }): Promise<PackLoad>; /** * Rows `bolt seed` sent, held only in memory, decoded here and loaded in steps like a pack; each of * `assets` is read through `asset` into `files`. */ restore(rows: { reado… | |
identity | { founder(address: string, options: Signal & { readonly at: string; }): Promise<FounderAnswer>; capture(options: Signal): Promise<string>; restore(snapshot: string, options: Signal): Promise<void>; } | |
integrations | { /** A restored branch's session instances lose their credentials and read `unpaired`. */ unpair_sessions(options: Signal): Promise<void>; /** One instance as an operator observes it; `not_found` for no such instance. */ status(instance: string, options: Signal): Promise<InstanceAdmin>; /** * Pauses or resumes an instance and deploys or detaches its envoy (an active one, on a workspace conversat… | Integration instances as the host's operator changes them, for a host whose links on this branch are stopped (it reopens them after). Each change bumps the row's |
Source: packages/host-api/src/host.ts:377
WorkspaceLink type
type WorkspaceLink = {
handle: string;
name: string;
href: string;
}; Another workspace the caller belongs to, for the shell's switcher.
Members
| Name | Type | Description |
|---|---|---|
handle | string | |
name | string | |
href | string |
Source: packages/host-api/src/host.ts:55
WorkspaceLinks type
type WorkspaceLinks = {
/** Relayed, not interpreted: hand it to `activate` as `links`; its failures are the release's own. */
readonly port: LinksPort;
/** The sealed credentials the links write through, failures encoded (another owner's `LinkHost.credentials` may retry here). */
readonly credentials: HostCredentials;
/** Reopens every active, paired instance this host's providers serve. */
resume(options: Signal): Promise<void>;
/** How many links are open now: with none, the host may close these links until it needs them again. */
open(): Promise<number>;
/** Closes every link; status streams end. The host then ends its pool. */
close(): Promise<void>;
/** `/hooks/integration/<instance>…` and `/hooks/oauth/callback`, the request as the workspace sees it; `null` otherwise. */
hook(request: Request): Promise<Response | null>;
/**
* `/__bolt/integrations/*` for a caller the current generation signs in (`LinkHost.enter`); `null` for another
* path.
*/
admin(request: Request): Promise<Response | null>;
}; A workspace's integration links: their port, sealed credentials, hooks and the open count the host reads to idle them.
Members
| Name | Type | Description |
|---|---|---|
port | LinksPort | Relayed, not interpreted: hand it to |
credentials | HostCredentials | The sealed credentials the links write through, failures encoded (another owner's |
resume | (options: Signal) => Promise<void> | Reopens every active, paired instance this host's providers serve. |
open | () => Promise<number> | How many links are open now: with none, the host may close these links until it needs them again. |
close | () => Promise<void> | Closes every link; status streams end. The host then ends its pool. |
hook | (request: Request) => Promise<Response | null> |
|
admin | (request: Request) => Promise<Response | null> |
|
Source: packages/host-api/src/host.ts:451
tools
WorkspaceNote type
type WorkspaceNote = {
readonly id: string;
readonly at: string;
readonly title: string;
readonly body?: string | undefined;
}; A workspace event as the host publishes it (a change merged, maintenance scheduled, a payment due): at is ISO.
Members
| Name | Type | Description |
|---|---|---|
id | string | |
at | string | |
title | string | |
body? | string | undefined |
Source: packages/host-api/src/tools.ts:157
WorkspacePort type
type WorkspacePort = {
files(): Promise<readonly string[]>;
read(path: string): Promise<string | null>;
}; A workspace's source files: the released tree, or an author's working tree.
Members
| Name | Type | Description |
|---|---|---|
files | () => Promise<readonly string[]> | |
read | (path: string) => Promise<string | null> |
Source: packages/host-api/src/tools.ts:152
system-1
answer_criteria function
function answer_criteria(request: DecisionRequest): Schema.Struct<{ readonly answers: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Struct<{ readonly type: Schema.Literal<"noul">; readonly noul: Schema.Finite; }>, Schema.Struct<{ readonly type: Schema.Literal<"choice">; readonly choice: Schema.String; readonly confidence: Schema.Finite; readonly probabilities: Schema.$Record<Schema.String, Schema.Finite>; }>, Schema.Struct<{ readonly type: Schema.Literal<"score">; readonly score: Schema.Finite; readonly level: Schema.Int; readonly confidence: Schema.Finite; readonly probabilities: Schema.$Record<Schema.String, Schema.Finite>; readonly legend: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Null, Schema.$Array<Schema.Codec<Schema.Json, Schema.Json, never, never>>, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>]>>; }>]>>; readonly cost_usd: Schema.Finite; readonly provider: Schema.String; readonly model: Schema.optionalKey<Schema.String>; readonly call: Schema.optionalKey<Schema.String>; readonly tokens: Schema.optionalKey<Schema.Struct<{ readonly input: Schema.Number; readonly output: Schema.Number; }>>; }> DecisionResult that answers each question of request within its offered criteria.
Parameters
| Name | Type | Description |
|---|---|---|
request | DecisionRequest |
|
Source: packages/host-api/src/system-1.ts:215
storage
branch_storage function
function branch_storage(db: RawDb): { member: (person: { readonly email: string | null; readonly phone: string | null; }) => Effect.Effect<{ readonly id: string; readonly name: string; readonly email: string | null; readonly phone: string | null; readonly active: boolean; } | null, DbError | UnknownStorage, never>; user: (id: string) => Effect.Effect<{ readonly id: string; readonly name: string; readonly email: string | null; readonly phone: string | null; readonly active: boolean; } | null, DbError | UnknownStorage, never>; members: Effect.Effect<readonly { readonly id: string; readonly name: string; readonly email: string | null; readonly phone: string | null; readonly active: boolean; }[], DbError | UnknownStorage, never>; administered: (email: string) => Effect.Effect<readonly { readonly id: string; readonly name: string; readonly email: string | null; readonly phone: string | null; readonly active: boolean; }[] | null, DbError | UnknownStorage, never>; paired: Effect.Effect<boolean, DbError | UnknownStorage, never>; } The recovery storage contract's reads of one branch database; each is one snapshot and one round trip.
Parameters
| Name | Type | Description |
|---|---|---|
db | RawDb |
|
Source: packages/host-api/src/storage.ts:99
client
client_page function
function client_page(dir: string, path: string): Effect.Effect<ClientPage | undefined, import("effect/PlatformError").PlatformError, FileSystem.FileSystem | Path.Path> path of the pages of the artifact at dir: a file of its client build, else (under /assets/) of its workspace assets, else the document; undefined when the artifact carries no client pages. /assets/* is cached for good; everything else, the document first, revalidates.
Parameters
| Name | Type | Description |
|---|---|---|
dir | string | |
path | string |
Source: packages/host-api/src/client.ts:58
code-mail
code_mail function
function code_mail(code: string, workspace?: string): { subject: string; text: string; html: string; } The one-time code email every Norbital surface sends: workspace sign-in, signup, platform and command-center sign-in, recovery. Tables and inline styles only, so every client renders it. code is the sender's own digits.
Parameters
| Name | Type | Description |
|---|---|---|
code | string | |
workspace? | string |
Source: packages/host-api/src/code-mail.ts:5
conformance
conformance function
function conformance(input: { readonly api: HostApi; readonly release: Release; readonly tampered: Release; readonly branches: { readonly database: () => Promise<{ readonly port: HostTenantDb; readonly raw: RawDb; }>; readonly keys: KeysPort; readonly instance: { readonly integration: string; readonly configuration: Json; }; }; }): readonly Check[] The checks for one release: release as built, and tampered, the same release with one of its files changed after the build (the release must refuse it with an encoded HostFailure). branches.database opens a fresh, empty database on each call, as a release reaches it (port) and through the host's own adapter (raw); keys is a working secrets key; instance names an integration the release defines and a configuration it accepts, for the unowned instance the kit seeds.
Parameters
| Name | Type | Description |
|---|---|---|
input | { readonly api: HostApi; readonly release: Release; readonly tampered: Release; readonly branches: { readonly database: () => Promise<{ readonly port: HostTenantDb; readonly raw: RawDb; }>; readonly keys: KeysPort; readonly instance: { readonly integration: string; readonly configuration: Json; }; }; } |
|
Source: packages/host-api/src/conformance.ts:56
wire
copiedBatch function
function copiedBatch(batch: DbBatch): DbBatch Snapshot a batch before acquiring a connection (copiedSql per statement), refusing one past the batch bounds.
Parameters
| Name | Type | Description |
|---|---|---|
batch | DbBatch |
|
Source: packages/host-api/src/wire.ts:105
copiedSql function
function copiedSql(statement: Sql): Sql Snapshot all caller-owned values before acquiring a connection, including nested parameter getters.
Parameters
| Name | Type | Description |
|---|---|---|
statement | Sql |
|
Source: packages/host-api/src/wire.ts:99
db_error function
function db_error(e: unknown): DbError A driver failure as a DbError: a SQLSTATE when the server gave one, else a connection failure. Call it only on what the driver threw, never on an error the caller's own code raised inside a transaction.
Parameters
| Name | Type | Description |
|---|---|---|
e | unknown |
Source: packages/host-api/src/wire.ts:163
system-1
decision_images function
function decision_images(state: DecisionRequest["state"]): Effect.Effect<{ text: Json; images: readonly { readonly type: "image_url"; readonly image_url: { readonly url: string; }; }[]; }, FacilityFailure, never> A request's inline images, at most 16 and 20 MiB: the state's text naming each image-<n>, and the images.
Parameters
| Name | Type | Description |
|---|---|---|
state | DecisionRequest['state'] |
Source: packages/host-api/src/system-1.ts:35
decisions_system_1 function
function decisions_system_1(config: DecisionsApiConfig, options?: HttpOptions): System1 System 1 over an HTTP decisions API (the native wire or OpenAI's format), bearer-authenticated. Provider refusals and HTTP errors fail as facility failures; the call is bounded by timeout_ms (default 3 s).
Parameters
| Name | Type | Description |
|---|---|---|
config | DecisionsApiConfig |
|
options? | HttpOptions |
Source: packages/host-api/src/system-1.ts:370
convert
document_converter function
function document_converter(config: DocumentConverterConfig): DocumentConverter A converter over a Norbital Convert server: document conversion to every target, plus in-memory PDF previews.
Parameters
| Name | Type | Description |
|---|---|---|
config | DocumentConverterConfig |
|
Source: packages/host-api/src/convert.ts:145
document_ingester function
function document_ingester(config: DocumentConverterConfig): Required<Pick<ConvertPort, "ingest">> ConvertPort.ingest over Norbital Convert's job routes: a host constructs it from Convert's URL and key. A 415 answers { unsupported }, and a converter with no transcription model rejects audio as unavailable. A password travels as the x-ingest-password header, never the URL. The answer's meta.stats is the conversion's compute and audio's meta.usage its model calls, which the host meters once per call id. The host must resolve a stored key to bytes first.
Parameters
| Name | Type | Description |
|---|---|---|
config | DocumentConverterConfig |
|
Source: packages/host-api/src/convert.ts:322
integrations
http_allows function
function http_allows(allow: HttpSpec["allow"], base: string, method: string, url: URL): boolean Whether a definition's allow admits method on url under base: a listed method and a path pattern matching it segment by segment ({name} one non-empty segment, a final ** any rest). No allow admits everything.
Parameters
| Name | Type | Description |
|---|---|---|
allow | HttpSpec['allow'] | |
base | string | |
method | string | |
url | URL |
Source: packages/host-api/src/integrations.ts:434
http_auth function
function http_auth(auth: HttpSpec["auth"], credential: unknown): Record<string, string> | undefined The headers a definition's credential auth (bearer, basic or a named header) adds from an instance's sealed credential fields; undefined when one it names is missing. No auth adds none.
Parameters
| Name | Type | Description |
|---|---|---|
auth | HttpSpec['auth'] | |
credential | unknown |
Source: packages/host-api/src/integrations.ts:453
http_target function
function http_target(base: string, path: string): URL path under base, never outside it: one leading / is the base itself; an absolute or //host path, ../. segments (encoded too), a \\, a query or fragment, or an encoded /, \\ or % in a segment is refused. The query (a page cursor included) goes through searchParams, so pagination stays inside the prefix.
Parameters
| Name | Type | Description |
|---|---|---|
base | string | |
path | string |
Source: packages/host-api/src/integrations.ts:415
media
imageLabel function
function imageLabel(name: string, bytes: Uint8Array): string The words that introduce an image to the model: its pixel size, so a crop's fractions can be worked out.
Parameters
| Name | Type | Description |
|---|---|---|
name | string | |
bytes | Uint8Array |
Source: packages/host-api/src/media.ts:187
migration-impact
impact_lines function
function impact_lines(impact: MigrationImpact, t?: (key: string) => string): readonly string[] What a person reads before merging: every step that touches data (additions that write nothing are left out), the downtime, then what a rollback costs: the schema differs from before, so it returns live's data to this merge.
Parameters
| Name | Type | Description |
|---|---|---|
impact | MigrationImpact |
|
t? | (key: string) => string |
Source: packages/host-api/src/migration-impact.ts:71
impact_text function
function impact_text(step: Pick<MigrationStepImpact, "id" | "hazard" | "rows">, t?: (key: string) => string): string A step in plain words, read from its generated id (drop:column:contracts.bank, check:contracts.nationality).
Parameters
| Name | Type | Description |
|---|---|---|
step | Pick<MigrationStepImpact, 'id' | 'hazard' | 'rows'> |
|
t? | (key: string) => string |
Source: packages/host-api/src/migration-impact.ts:23
media
ingest_answer function
function ingest_answer<B extends Schema.Codec<Uint8Array, unknown>>(bytes: B): Schema.Union<readonly [Schema.Struct<{ readonly images: Schema.$Array<Schema.Struct<{ readonly name: Schema.String; readonly mime: Schema.String; readonly bytes: B; }>>; readonly meta: Schema.Struct<{ readonly usage: Schema.optionalKey<Schema.Struct<{ readonly calls: Schema.$Array<Schema.String>; readonly model: Schema.String; readonly input: Schema.Number; readonly output: Schema.Number; readonly cost: Schema.Number; }>>; readonly stats: Schema.Struct<{ readonly pages: Schema.NullOr<Schema.Number>; readonly bytes: Schema.Number; readonly cpuMs: Schema.Number; readonly wallMs: Schema.Number; }>; }>; readonly kind: Schema.Literal<"document">; readonly html: Schema.String; }>, Schema.Struct<{ readonly images: Schema.$Array<Schema.Struct<{ readonly name: Schema.String; readonly mime: Schema.String; readonly bytes: B; }>>; readonly meta: Schema.Struct<{ readonly usage: Schema.optionalKey<Schema.Struct<{ readonly calls: Schema.$Array<Schema.String>; readonly model: Schema.String; readonly input: Schema.Number; readonly output: Schema.Number; readonly cost: Schema.Number; }>>; readonly stats: Schema.Struct<{ readonly pages: Schema.NullOr<Schema.Number>; readonly bytes: Schema.Number; readonly cpuMs: Schema.Number; readonly wallMs: Schema.Number; }>; }>; readonly kind: Schema.Literal<"data">; readonly json: Schema.Codec<Schema.Json, Schema.Json, never, never>; }>]> What an ingest answers with its image bytes decoded by bytes: Convert's wire (base64) or the port's ABI.
Parameters
| Name | Type | Description |
|---|---|---|
bytes | B |
Source: packages/host-api/src/media.ts:29
off
is_off function
function is_off(value: object): value is Off Whether a facility member is off, by its tag (never by identity, so it holds across module graphs).
Parameters
| Name | Type | Description |
|---|---|---|
value | object |
Source: packages/host-api/src/off.ts:8
facilities
logged_phone function
function logged_phone(log: (line: string) => void, fixed?: boolean): PhoneVerifier A local host's phone verifier: its own code, printed by log as (sign-in code 123456) (bolt dev, a local host, tests). fixed is 123456.
Parameters
| Name | Type | Description |
|---|---|---|
log | (line: string) => void | |
fixed? | boolean |
Source: packages/host-api/src/facilities.ts:218
media
media_type function
function media_type(head: Uint8Array): string | undefined The media type of a body from its first DOWNLOAD.headBytes bytes (all of a shorter body); undefined is not media.
Parameters
| Name | Type | Description |
|---|---|---|
head | Uint8Array |
Source: packages/host-api/src/media.ts:119
membrane
membrane function
function membrane(send: (message: Message) => unknown): Membrane One side of the membrane; send delivers a message to the other side and returns its answer, if it gave one.
Parameters
| Name | Type | Description |
|---|---|---|
send | (message: Message) => unknown |
Source: packages/host-api/src/membrane.ts:139
json-schema
model_schema function
function model_schema(schema: Schema.Constraint, keepEmptyDefinitions?: boolean): Json Closed model-facing schemas share one encoder; decision responses retain their explicit empty definitions.
Parameters
| Name | Type | Description |
|---|---|---|
schema | Schema.Constraint | |
keepEmptyDefinitions? | boolean |
Source: packages/host-api/src/json-schema.ts:45
off
off const
const off: { readonly _tag: "Off"; } The marker a host passes in place of a facility member it does not provide; that member then fails unavailable.
Members
| Name | Type | Description |
|---|---|---|
_tag | 'Off' |
Source: packages/host-api/src/off.ts:4
wire
param function
function param(v: Json): string | null A JSON parameter as Postgres text: objects and arrays as JSON text (the statement casts).
Parameters
| Name | Type | Description |
|---|---|---|
v | Json |
Source: packages/host-api/src/wire.ts:79
parse function
function parse(oid: number, s: string): Json Postgres text → JSON: numbers and booleans as JSON, json as itself, everything else (numeric, date, uuid, ranges) as text.
Parameters
| Name | Type | Description |
|---|---|---|
oid | number | |
s | string |
Source: packages/host-api/src/wire.ts:64
browser
person_browser_profile function
function person_browser_profile(person: string, conversation: string): string A person's browser profile for one conversation: one identity per person, a session (tab) per conversation.
Parameters
| Name | Type | Description |
|---|---|---|
person | string | |
conversation | string |
Source: packages/host-api/src/browser.ts:10
media
pixelSize function
function pixelSize(b: Uint8Array): { width: number; height: number; } | undefined An image's stored pixel size from its header: PNG, JPEG or GIF; undefined for another format. ponytail: header only, so a JPEG's EXIF rotation is not applied; the host's own tiles and crops are already oriented.
Parameters
| Name | Type | Description |
|---|---|---|
b | Uint8Array |
Source: packages/host-api/src/media.ts:170
port
provide_http function
function provide_http(options: HttpOptions): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, HttpClient.HttpClient>> Provides an adapter's HTTP client: options.http_client, else fetch.
Parameters
| Name | Type | Description |
|---|---|---|
options | HttpOptions |
|
Source: packages/host-api/src/port.ts:105
system-1
refusal_of function
function refusal_of(status: number, body: string): FacilityFailure | undefined A provider's HTTP refusal as the facility failure it maps to; undefined is an ordinary failure. Hosts share it.
Parameters
| Name | Type | Description |
|---|---|---|
status | number | |
body | string |
Source: packages/host-api/src/system-1.ts:95
deadline-timer
scope_deadlines function
function scope_deadlines<E, R>(callbacks: { readonly wake: (scope: string) => Effect.Effect<void, E, R>; readonly pulse: (scope: string) => Effect.Effect<boolean, E, R>; }): Effect.Effect<{ announce: (scope: string, at: string) => Effect.Effect<void, never, never>; settle: (scope: string, at: string | null) => Effect.Effect<void, never, never>; teardown: (scope: string) => Effect.Effect<void, never, never>; }, never, R | Scope.Scope> A single-process host's deadlines (bolt-server, bolt dev, a release's own port): each announced scope's earliest deadline wakes it once, a due announcement during its wake pulses it, and a failed wake retries in a minute.
Parameters
| Name | Type | Description |
|---|---|---|
callbacks | { readonly wake: (scope: string) => Effect.Effect<void, E, R>; readonly pulse: (scope: string) => Effect.Effect<boolean, E, R>; } |
|
Source: packages/host-api/src/deadline-timer.ts:182
facilities
six_digits function
function six_digits(): string A uniformly random six-digit sign-in code.
Source: packages/host-api/src/facilities.ts:208
migration-impact
step_name function
function step_name(id: string): string A destructive step's plain name, from its generated id (drop:column:contracts.bank).
Parameters
| Name | Type | Description |
|---|---|---|
id | string |
Source: packages/host-api/src/migration-impact.ts:66
wire
storedInstant function
function storedInstant(value: string): string Canonical UTC text preserves sub-millisecond digits from either database adapter.
Parameters
| Name | Type | Description |
|---|---|---|
value | string |
Source: packages/host-api/src/wire.ts:11
system-1
structured_system_1 function
function structured_system_1(infer: OpenAiChat, configured: string): System1 System 1 over a chat model's structured output: each question becomes a probability object in one JSON-schema answer.
Parameters
| Name | Type | Description |
|---|---|---|
infer | OpenAiChat | |
configured | string |
Source: packages/host-api/src/system-1.ts:481
studio
studio_events function
function studio_events(url: string): Stream.Stream<StudioFrame, StudioStreamFailed, never> Studio's server-sent frames at url (the shell's /__bolt/shell/studio/events under the workspace or a host's endpoint) as a stream; the event source closes with the stream. An undecodable event or a dropped connection fails it with StudioStreamFailed.
Parameters
| Name | Type | Description |
|---|---|---|
url | string |
Source: packages/host-api/src/studio.ts:425
studio_view function
function studio_view({ manifest: m, ...rest }: StudioState): StudioView Projects a StudioState into the browser's StudioView, listing each section's declarations by source path.
Parameters
| Name | Type | Description |
|---|---|---|
__0 | StudioState |
|
Source: packages/host-api/src/studio.ts:758
suggest_message function
function suggest_message(drafts: { readonly [path: string]: unknown; }, files: { readonly [path: string]: unknown; }): string What a save changes, in plain words, from its drafts (null: deleted) over the tree they change.
Parameters
| Name | Type | Description |
|---|---|---|
drafts | { readonly [path: string]: unknown; } | |
files | { readonly [path: string]: unknown; } |
Source: packages/host-api/src/studio.ts:945
version
supports function
function supports(version: number): boolean Hosts and releases must speak this exact protocol.
Parameters
| Name | Type | Description |
|---|---|---|
version | number |
Source: packages/host-api/src/version.ts:8
ai
textOf function
function textOf(content: Json): string Text projection shared by the producer and provider.
Parameters
| Name | Type | Description |
|---|---|---|
content | Json |
Source: packages/host-api/src/ai.ts:26
digest
tree_digest function
function tree_digest(files: Iterable<readonly [path: string, bytes: Uint8Array]>): string sha256 hex of a tree's sorted <path>\0<sha256 hex> lines, \n-joined: a folder's tree_hash, a skill's digest.
Parameters
| Name | Type | Description |
|---|---|---|
files | Iterable<readonly [path: string, bytes: Uint8Array]> |
Source: packages/host-api/src/digest.ts:6
tree_hash function
function tree_hash(dir: string): Effect.Effect<string, import("effect/PlatformError").PlatformError, FileSystem.FileSystem | Path.Path> A tree's digest; *.map files are left out: the bundler writes random names into them, so they are not byte-stable.
Parameters
| Name | Type | Description |
|---|---|---|
dir | string |
Source: packages/host-api/src/digest.ts:13
uuid
uuidv7 function
function uuidv7(nowMs?: number): string A fresh uuidv7 (RFC 9562): 48 bits of Unix milliseconds, version 7, monotonic 12-bit sub-ms counter, variant 10, 62 bits random.
Parameters
| Name | Type | Description |
|---|---|---|
nowMs? | number |
Source: packages/host-api/src/uuid.ts:14
uuidv7_within function
function uuidv7_within(id: string, nowMs: number): boolean A caller-minted id is a uuidv7 whose timestamp is within 24 h of the host clock, either side.
Parameters
| Name | Type | Description |
|---|---|---|
id | string | |
nowMs | number |
Source: packages/host-api/src/uuid.ts:5