agar
Import
Section titled “Import”import * as api from "@fungi.computer/agar";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| type alias | FungiAuthor | Who a Session line came from, as the admitting host authenticated them. |
| type alias | FungiDelegationReply | A delegated Agent’s reply as the admitting host authenticated it. |
| type alias | FungiMessageMeta | The metadata the host attaches to every prompt and operator line it admits. |
| type alias | MessageMetaValue | Any JSON value, as Shiitake returns a message’s metadata. |
| type alias | AuthorMeta | The metadata the host attaches for one authenticated author, as JSON. |
| type alias | AppAgent | An Agent record as decoded from the host: its id, display name, and which session operations this App is permitted to perform on it. |
| type alias | AppAgentCreateInput | Input for creating a new Agent: its name, a caller-chosen request id for idempotency, whether to provision a new Computer for it, and the avatar it wears (omitted, it wears its seeded avatar). |
| type alias | AppAgentTransportHandle | Live object-capability shape received from Cap’n Web. |
| type alias | AppAgentListHandle | Capability handle for listing the Agents in a directory. |
| type alias | AppAgentCreateHandle | Capability handle for creating a new Agent in a directory. |
| type alias | AppAgentDirectoryHandle | Live capability handle for listing and creating Agents in a Team or local-project directory, and opening transports to them. |
| type alias | AppAgentRenameInput | Input for renaming an existing Agent: its id and the owner’s chosen replacement display name. |
| type alias | AppAgentRenameHandle | Capability handle for renaming an Agent the owner already created. |
| type alias | AppAgentAvatarInput | Input for changing an existing Agent’s avatar. |
| type alias | AppAgentAvatarHandle | Capability handle for changing an Agent’s avatar. |
| type alias | AppAgentToolPolicyStatus | Whether an Agent’s App tools are still pending the owner’s approval. |
| type alias | AppAgentToolPolicyResult | The outcome of an owner’s direct App-tool approval. |
| type alias | AppAgentToolPolicyHandle | Capability handle for reading and approving an Agent’s App-tool policy. |
| type alias | AppAgentTransport | A Fetch-based transport to one Agent’s session endpoint, scoped to this App and safe to hand to an HTTP client adapter. |
| type alias | CapabilityContract | A capability owner’s frozen, typed descriptor. Descriptor identity is not authority. |
| type alias | CapabilityDirectory | The App’s read-only view of its currently admitted capabilities. |
| type alias | CapabilityRegistry | Local capabilities admitted through their owner’s typed contract. |
| type alias | AppCommand | Semantic command metadata supplied by an App and owned by Whistle. |
| type alias | AppCommandHandler | One invocation’s semantic input; host correlation IDs are private. |
| type alias | AppCommandInvocation | One command invocation’s semantic input, passed to its handler. |
| type alias | AppCommands | Registers a command with the authenticated host for this page session. The promise resolves only after the host accepts the registration. |
| type alias | ConnectAppOptions | Options for connecting this iframe page to its authenticated host. |
| type alias | AppConnectMessage | The host’s handshake message that hands the App its RPC MessagePort. |
| type alias | AppReadyMessage | The App iframe’s handshake message announcing it is ready to connect. |
| type alias | AppContext | The host-published state surrounding a connected App: its Computer selection, focus, visibility, and any pending open request. |
| type alias | AppOpenRequest | One host-issued action an App must act on when it opens or reconfigures: start
composing given text, or navigate to the given params. Each carries a
requestId so the App can tell a repeated open from a fresh one. |
| type alias | AppIdentity | The App’s own identity, as admitted by its host. |
| type alias | AppLifecycle | The connection state of this App’s session with its host. |
| type alias | FocusState | Whether the App’s own surface is being edited and which surface, if any, the host considers focused. |
| type alias | MediaGenerationInput | The Media owner decides Team, Installation, Release, Grant and Computer authority before issuing this handle. The App contributes only generation settings and selected destination/references. The IDs in those selections are not authority: the host revalidates every one against its current admitted Computer scope when it accepts a generation. |
| type alias | MediaOutputFormat | The encodings a completed generation can be saved as. |
| type alias | MediaGenerationResult | Metadata for one completed generation: the saved destination, pixel dimensions, format, model used, and its cost. |
| type alias | MediaGenerationFailure | The host’s typed reason a generation failed: code, message, retry truth and, when known, the stage that failed. |
| type alias | MediaGenerationOutcome | Transport-safe result from the host-owned generation attempt. |
| type alias | MediaGenerationHandle | Live object-capability shape supplied by the host. |
| type alias | MediaGenerationAttemptHandle | Host-supplied object-capability for one attempt, before Agar wraps it into the typed MediaGenerationAttempt. |
| type alias | MediaGenerationAttempt | One generation attempt: a stable reference plus the ability to run (or retry) generation against it until disposed. |
| type alias | MediaGenerationSession | The validated, App-facing handle returned by openMediaGeneration: the Computer’s model catalog plus the ability to start or resume attempts. |
| type alias | MediaGenerationReference | An opaque replay identity for one attempt; it identifies a request, not an authorization to use it. |
| type alias | MediaModel | One generation model as the host describes it: identity, tier, input limits and supported output formats. The host owns the catalog. |
| type alias | MediaGenerationSelection | An App’s generation settings: model, prompt, size and optional steps, duration and Computer-relative reference paths. |
| type alias | Pending | The shared polling result, owned by the App contract. |
| type alias | AppRoot | The App’s live connection to its host: its admitted capabilities, commands,
context, theme, UI door and window, all torn down together by dispose.
Returned by connectApp and passed to mountApp. |
| type alias | Disposer | Releases a subscription or other held resource. Call once; further calls are a no-op. |
| type alias | ReadonlyStore | A retained SDK-owned snapshot. |
| type alias | HostUi | Deliberately narrow shell affordances; domain work belongs to capabilities. |
| type alias | AppStatusIcon | The marks a host can draw before a status button’s label. |
| type alias | AppStatusTone | A readout’s live state, shown as a small light before its text. |
| type alias | AppStatusOption | One choice in a status menu, such as a folder or a port. |
| type alias | AppStatusItem | One item an App declares for its window’s status bar, as data: a readout, a button, a toggle, or a menu of choices. Using one delivers an AppStatusAction back to the App. |
| type alias | AppStatusAction | The person used a status item; optionId names a chosen menu option. anchor
is where the item sits along the App’s surface, in CSS pixels from its inline
start, so App UI it opens can sit above it. |
| type alias | AppStatusActionHandler | Handles one status action; true when the App acted on it. |
| type alias | AgentSessionSelection | Exact Agent conversation selected by an App for the authenticated shell. |
| type alias | FileNavigationInput | A presentation-neutral request to open an already admitted Computer file. |
| type alias | ToastInput | A transient notification an App asks its host to show. |
| type alias | AgentAccessOperation | Agent rights an App may ask its host to grant through consent. |
| type alias | ComputerAccessOperation | Computer rights an App may ask its host to grant through consent. |
| type alias | AppPermissionRequest | The rights an App asks for; the host bounds them by its declared ceiling. |
| type alias | AppPermissionOutcome | granted: the host saved a grant covering the request. declined: the user
said not now. customize: the host opened its full permission settings. |
| type alias | AppBrowserAction | Data only; browser authority and the gesture check belong to the host. |
| type alias | AppBrowserActionRefusal | A browser action can be refused without disconnecting the App. |
| type alias | AppBrowserActionOutcome | Saved means a browser download was initiated, not a confirmed disk write. |
| type alias | BeforeAppClose | Consulted before the person closes the App’s window; return (or resolve) true
to allow the close. |
| type alias | AppCrumb | One place in the App’s path; siblings makes it a switcher. |
| type alias | AppHeaderCommand | A command the App offers in its window header; the App owns its effect. |
| type alias | AppHeaderStatus | A quiet fact about the view, shown as muted text with a status bead. |
| type alias | AppNavigationActivation | The person used a crumb (or a switcher’s sibling) or a header command. |
| type alias | AppNavigationActivationHandler | Handles one activation; true when the App acted on it. |
| type alias | AppNavigationState | What the App’s own router can do right now. The App owns its history; the host only offers a Back affordance and relays the person’s request. |
| type alias | AppBackHandler | Go back one step in the App’s own history; true when it moved. |
| type alias | HostNavigation | The App’s half of the host navigation contract. |
| type alias | AppWindow | App-owned presentation policy consulted before a user closes its window. |
| type alias | ResultRow | One shared result row; navigation and previews stay host-authorized. |
| constant | FungiAuthorSchema | Who a Session line came from, as the admitting host authenticated them. |
| constant | FungiDelegationReplySchema | A delegated Agent’s reply as the admitting host authenticated it against the
mail it sent. commandId is the replying Session’s accepted command, the same
id as the sender’s agents.send receipt. |
| constant | FungiMessageMetaSchema | The metadata the host attaches to every prompt and operator line it admits. Shiitake stores it opaquely; the host writes it and Apps read it. |
| constant | appAgentAvatarSchema | An Agent’s avatar: Sprite’s Avatar v1 envelope. Apps check its shape; the host owns the character-catalog refinement when it stores one. |
| constant | appAgentSchema | Validates the wire shape of an Agent record: its id, display name, avatar, and
which session operations (read, send, manage) this App may perform on it. Every
Agent has an avatar: the one its owner chose, else Sprite’s
seededAvatar(agentId). Conversations carry none of their own. |
| constant | appAgentCreateInputSchema | Validates Agent creation input: a name, a caller-chosen request id, an optional Computer provisioning choice and an optional chosen avatar. |
| constant | agentList | Capability to list the Agents visible to this App in read-only form. |
| constant | agentManage | Capability to create new Agents and open transports to them. |
| constant | appAgentRenameInputSchema | Validates Agent rename input: the target Agent and its new display name. |
| constant | agentRename | Owner-only capability to rename an existing Agent; not every host grants it. |
| constant | appAgentAvatarInputSchema | Validates avatar input: the target Agent and the avatar it now wears. |
| constant | agentAvatar | Owner-only capability to change an existing Agent’s avatar; not every host grants it. |
| constant | appAgentToolPolicyStatusSchema | One Agent’s App-tool policy, as the owner-only policy capability reports it. |
| constant | appAgentToolPolicyResultSchema | The outcome of an owner’s direct App-tool approval. |
| constant | agentToolPolicy | Owner-only capability to read and approve an Agent’s App-tool policy. |
| constant | agentSessionRead | Capability for read-only Agent sessions: open a transport to an existing Agent, or read the member’s inbox feed. |
| constant | agentSessionWrite | Capability for read-write Agent sessions: open a transport to an existing Agent and send to it, including the member’s inbox feed. |
| constant | approvals | Member-bound approval view. Authentication and current rights belong to the host. |
| constant | APP_PROTOCOL_VERSION | The iframe handshake version both App and host must speak. |
| constant | APP_READY_TYPE | Message type the App iframe posts to announce it is ready to connect. |
| constant | APP_CONNECT_TYPE | Message type the host posts to hand the App its RPC MessagePort. |
| constant | appDeliveryPendingSchema | Effect projection of the error owner’s declaration-safe pending refusal. |
| constant | parseAppStatusItems | Both edges: one window’s status items, bounded and copied. |
| constant | parseAppStatusAction | App edge: the status item the person used, as the host relays it. |
| constant | mediaGenerationReferenceSchema | A replay identity, never an authorization capability. |
| constant | mediaModelSchema | Validates one model row of the host’s Media catalog. |
| constant | mediaGenerationSelectionSchema | Validates the shape of an App’s generation settings. Model-specific limits (sizes, steps, durations, reference counts) and defaults are the host’s: it checks the selection against its catalog when it accepts a generation. |
| constant | mediaGenerationFailureSchema | Validates the typed failure a host reports for a generation attempt. |
| constant | mediaGeneration | Capability contract for generating Media (images or video). Apps declare it to request access; openMediaGeneration uses it to obtain the host’s handle. |
| constant | pendingSchema | An opted-in App method is still working; poll again after this bounded delay. |
| constant | APP_STATUS_ITEMS_MAX | The most readouts one App window’s status bar shows. |
| constant | APP_STATUS_TEXT_MAX | The longest readout a window’s status bar shows. |
| constant | APP_STATUS_OPTIONS_MAX | The most choices one status menu offers. |
| constant | APP_BROWSER_SAVE_MAX_BYTES | Maximum file size sent through the user-initiated host browser door. |
| constant | APP_BROWSER_COPY_MAX_BYTES | Maximum UTF-8 text size sent to the host clipboard. |
| constant | APP_NAVIGATION_CONTRACT_VERSION | Version of the navigation contract an App publishes. The host rejects any other version, so a future shape can never be misread as this one. |
| constant | APP_NAVIGATION_TITLE_MAX | The longest page title a host shows beside the App’s own name. |
| constant | APP_NAVIGATION_CRUMBS_MAX | The most crumbs one navigation report may carry. |
| constant | APP_NAVIGATION_SIBLINGS_MAX | The most siblings one switcher crumb may offer. |
| constant | APP_NAVIGATION_PRIMARY_MAX | The most primary header commands one report may carry. |
| constant | APP_NAVIGATION_STATUS_MAX | The most header status facts one report may carry. |
| constant | APP_NAVIGATION_MENU_MAX | The most ⋯ menu commands one report may carry. |
| constant | APP_NAVIGATION_LABEL_MAX | The longest crumb or command label a host shows. |
| constant | inertHostNavigation | Navigation for a root with no host chrome, such as a workbench fixture: it accepts every report and never asks the App to go back. |
| constant | resultRowSchemaV1 | A finished App call as a person reads it: a shared row plus an optional thumbnail. |
| function | messageAuthor() | The author a message’s metadata names; none for anything else. |
| function | messageDelegationReply() | The authenticated delegation reply a message’s metadata carries; none for any other line, including text that merely looks like a reply. |
| function | authorMeta() | The metadata the host attaches for one authenticated author. |
| function | renameAppAgent() | Rename an Agent through the host-granted owner-only capability. |
| function | setAppAgentAvatar() | Change an Agent’s avatar through the host-granted owner-only capability. |
| function | listAppAgents() | List the Agents in the host-granted Team or local-project scope. |
| function | createAppAgent() | Create an Agent through the Team directory selected by the host. |
| function | openAppAgent() | Adapt one live object capability to Fetch without exposing the parent’s authenticated URL or credentials to the isolated App. |
| function | defineCapability() | Define a capability with the owner’s decoder for its live RPC interface. |
| function | createCapabilityRegistry() | Register typed local implementations without reopening their erased types. |
| function | registerCatalog() | Register one App’s Whistle catalog with its host. An App defines each command once, contributes the same catalog to its own composer runtime for slash commands, and registers it here so the shell projects it into the palette, menus, keys and the agent view. Availability is read once at registration; register again to publish a change. |
| function | connectApp() | Connects this iframe page to its authenticated host. |
| function | openMediaGeneration() | Discover the exact retained model catalog surfaced by the owner. |
| function | pending() | Return Pending with a polling delay between one and sixty seconds. |
| function | statusText() | Make person- or Computer-supplied text fit one status item: drop unsafe characters, collapse whitespace and shorten with an ellipsis. |
| function | statusActionAllowed() | Whether an action names something the App declares now: an enabled item, and for a menu exactly one enabled option. Every hop that delivers an action applies this rule against its own latest copy of the items. |
| function | navigationActivationAllowed() | Whether an activation names something the App published now: a crumb (and its sibling), or an enabled command. Every hop applies this rule against its own latest copy of the report, so a stale shell cannot reach the App. |
FungiAuthortype alias
Section titled “FungiAuthor”type FungiAuthor = z.infer<typeof FungiAuthorSchema>;Who a Session line came from, as the admitting host authenticated them.
FungiDelegationReplytype alias
Section titled “FungiDelegationReply”type FungiDelegationReply = z.infer<typeof FungiDelegationReplySchema>;A delegated Agent’s reply as the admitting host authenticated it.
FungiMessageMetatype alias
Section titled “FungiMessageMeta”type FungiMessageMeta = z.infer<typeof FungiMessageMetaSchema>;The metadata the host attaches to every prompt and operator line it admits.
MessageMetaValuetype alias
Section titled “MessageMetaValue”type MessageMetaValue = | string | number | boolean | null | readonly MessageMetaValue[] | Readonly<{ [key: string]: MessageMetaValue; }>;Any JSON value, as Shiitake returns a message’s metadata.
AuthorMetatype alias
Section titled “AuthorMeta”type AuthorMeta = Readonly<{ author: Readonly<{ [K in keyof FungiAuthor]: Exclude<FungiAuthor[K], undefined>; }>;}>;The metadata the host attaches for one authenticated author, as JSON.
AppAgenttype alias
Section titled “AppAgent”type AppAgent = Schema.Schema.Type<typeof appAgentSchema>;An Agent record as decoded from the host: its id, display name, and which session operations this App is permitted to perform on it.
AppAgentCreateInputtype alias
Section titled “AppAgentCreateInput”type AppAgentCreateInput = Readonly< Schema.Schema.Type<typeof appAgentCreateInputSchema>>;Input for creating a new Agent: its name, a caller-chosen request id for idempotency, whether to provision a new Computer for it, and the avatar it wears (omitted, it wears its seeded avatar).
AppAgentTransportHandletype alias
Section titled “AppAgentTransportHandle”type AppAgentTransportHandle = object;Live object-capability shape received from Cap’n Web.
Methods
Section titled “Methods”fetch()
Section titled “fetch()”fetch(request): Promise<Response>;Send one request to the Agent’s session endpoint.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
request |
Request |
Returns
Section titled “Returns”Promise<Response>
close()
Section titled “close()”close(): Promise<void>;Release the underlying object capability.
Returns
Section titled “Returns”Promise<void>
[dispose]()
Section titled “[dispose]()”dispose: void;Synchronously release local resources, for using disposal.
Returns
Section titled “Returns”void
AppAgentListHandletype alias
Section titled “AppAgentListHandle”type AppAgentListHandle = object;Capability handle for listing the Agents in a directory.
Methods
Section titled “Methods”list()
Section titled “list()”list(): Promise<readonly object[]>;List the Agents visible to this App in the directory.
Returns
Section titled “Returns”Promise<readonly object[]>
AppAgentCreateHandletype alias
Section titled “AppAgentCreateHandle”type AppAgentCreateHandle = object;Capability handle for creating a new Agent in a directory.
Methods
Section titled “Methods”create()
Section titled “create()”create(input): Promise<{ agentId: string; name: string; avatar: { v: z.ZodLiteral<1>; character: z.ZodEnum<{ mushroom: "mushroom"; cat: "cat"; burger: "burger"; }>; appearance: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>; expression: z.ZodString; renderStyle: z.ZodEnum<{ plain: "plain"; pencil: "pencil"; manga: "manga"; riso: "riso"; halftone: "halftone"; blueprint: "blueprint"; crt: "crt"; watercolor: "watercolor"; }>; }; sessionOperations: readonly ("agent.manage" | "agent.read" | "agent.send")[];}>;Create a new Agent with the given name and request id.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
AppAgentCreateInput |
Returns
Section titled “Returns”Promise<{ agentId: string; name: string; avatar: { v:
z.ZodLiteral<1>; character: z.ZodEnum<{ mushroom: "mushroom";
cat: "cat"; burger: "burger"; }>; appearance:
z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString,
z.ZodNumber, z.ZodBoolean]>>; expression: z.ZodString; renderStyle:
z.ZodEnum<{ plain: "plain"; pencil: "pencil"; manga: "manga";
riso: "riso"; halftone: "halftone"; blueprint: "blueprint"; crt:
"crt"; watercolor: "watercolor"; }>; }; sessionOperations: readonly
("agent.manage" | "agent.read" | "agent.send")[]; }>
AppAgentDirectoryHandletype alias
Section titled “AppAgentDirectoryHandle”type AppAgentDirectoryHandle = AppAgentListHandle & AppAgentCreateHandle & object;Live capability handle for listing and creating Agents in a Team or local-project directory, and opening transports to them.
Type Declaration
Section titled “Type Declaration”| Name | Type | Description |
|---|---|---|
open() |
(input) => Promise<AppAgentTransportHandle> |
Open a transport to the Agent identified by agentId. |
openInbox() |
() => Promise<AppAgentTransportHandle> |
The member’s inbox feed, limited to Agents this App may read. |
AppAgentRenameInputtype alias
Section titled “AppAgentRenameInput”type AppAgentRenameInput = Readonly< Schema.Schema.Type<typeof appAgentRenameInputSchema>>;Input for renaming an existing Agent: its id and the owner’s chosen replacement display name.
AppAgentRenameHandletype alias
Section titled “AppAgentRenameHandle”type AppAgentRenameHandle = object;Capability handle for renaming an Agent the owner already created.
Methods
Section titled “Methods”rename()
Section titled “rename()”rename(input): Promise<{ agentId: string; name: string; avatar: { v: z.ZodLiteral<1>; character: z.ZodEnum<{ mushroom: "mushroom"; cat: "cat"; burger: "burger"; }>; appearance: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>; expression: z.ZodString; renderStyle: z.ZodEnum<{ plain: "plain"; pencil: "pencil"; manga: "manga"; riso: "riso"; halftone: "halftone"; blueprint: "blueprint"; crt: "crt"; watercolor: "watercolor"; }>; }; sessionOperations: readonly ("agent.manage" | "agent.read" | "agent.send")[];}>;Rename an existing Agent and return its updated record.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
AppAgentRenameInput |
Returns
Section titled “Returns”Promise<{ agentId: string; name: string; avatar: { v:
z.ZodLiteral<1>; character: z.ZodEnum<{ mushroom: "mushroom";
cat: "cat"; burger: "burger"; }>; appearance:
z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString,
z.ZodNumber, z.ZodBoolean]>>; expression: z.ZodString; renderStyle:
z.ZodEnum<{ plain: "plain"; pencil: "pencil"; manga: "manga";
riso: "riso"; halftone: "halftone"; blueprint: "blueprint"; crt:
"crt"; watercolor: "watercolor"; }>; }; sessionOperations: readonly
("agent.manage" | "agent.read" | "agent.send")[]; }>
AppAgentAvatarInputtype alias
Section titled “AppAgentAvatarInput”type AppAgentAvatarInput = Readonly< Schema.Schema.Type<typeof appAgentAvatarInputSchema>>;Input for changing an existing Agent’s avatar.
AppAgentAvatarHandletype alias
Section titled “AppAgentAvatarHandle”type AppAgentAvatarHandle = object;Capability handle for changing an Agent’s avatar.
Methods
Section titled “Methods”setAvatar()
Section titled “setAvatar()”setAvatar(input): Promise<{ agentId: string; name: string; avatar: { v: z.ZodLiteral<1>; character: z.ZodEnum<{ mushroom: "mushroom"; cat: "cat"; burger: "burger"; }>; appearance: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>; expression: z.ZodString; renderStyle: z.ZodEnum<{ plain: "plain"; pencil: "pencil"; manga: "manga"; riso: "riso"; halftone: "halftone"; blueprint: "blueprint"; crt: "crt"; watercolor: "watercolor"; }>; }; sessionOperations: readonly ("agent.manage" | "agent.read" | "agent.send")[];}>;Set an existing Agent’s avatar and return its updated record.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
AppAgentAvatarInput |
Returns
Section titled “Returns”Promise<{ agentId: string; name: string; avatar: { v:
z.ZodLiteral<1>; character: z.ZodEnum<{ mushroom: "mushroom";
cat: "cat"; burger: "burger"; }>; appearance:
z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString,
z.ZodNumber, z.ZodBoolean]>>; expression: z.ZodString; renderStyle:
z.ZodEnum<{ plain: "plain"; pencil: "pencil"; manga: "manga";
riso: "riso"; halftone: "halftone"; blueprint: "blueprint"; crt:
"crt"; watercolor: "watercolor"; }>; }; sessionOperations: readonly
("agent.manage" | "agent.read" | "agent.send")[]; }>
AppAgentToolPolicyStatustype alias
Section titled “AppAgentToolPolicyStatus”type AppAgentToolPolicyStatus = z.infer<typeof appAgentToolPolicyStatusSchema>;Whether an Agent’s App tools are still pending the owner’s approval.
AppAgentToolPolicyResulttype alias
Section titled “AppAgentToolPolicyResult”type AppAgentToolPolicyResult = z.infer<typeof appAgentToolPolicyResultSchema>;The outcome of an owner’s direct App-tool approval.
AppAgentToolPolicyHandletype alias
Section titled “AppAgentToolPolicyHandle”type AppAgentToolPolicyHandle = object;Capability handle for reading and approving an Agent’s App-tool policy.
Methods
Section titled “Methods”status()
Section titled “status()”status(input): Promise< | { status: "pending"; revision: string;} | { status: "approved"; revision: string;}| null>;This Agent’s current policy status, or null for no such Agent.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
{ agentId: string; } |
input.agentId |
string |
Returns
Section titled “Returns”Promise< | { status: "pending"; revision: string; } | {
status: "approved"; revision: string; } | null>
approve()
Section titled “approve()”approve(input): Promise< | { status: "pending"; revision: string;} | { status: "approved"; revision: string;} | { error: string;}>;Approve (or re-request) this Agent’s App tools under a CAS revision.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
{ agentId: string; level: "read" | "write"; expectedRevision: string | null; } |
input.agentId |
string |
input.level |
"read" | "write" |
input.expectedRevision |
string | null |
Returns
Section titled “Returns”Promise< | { status: "pending"; revision: string; } | {
status: "approved"; revision: string; } | { error: string; }>
AppAgentTransporttype alias
Section titled “AppAgentTransport”type AppAgentTransport = Readonly<{ baseUrl: string; fetch: typeof globalThis.fetch; close: () => Promise<void>;}>;A Fetch-based transport to one Agent’s session endpoint, scoped to this App and safe to hand to an HTTP client adapter.
CapabilityContracttype alias
Section titled “CapabilityContract”type CapabilityContract<T> = object;A capability owner’s frozen, typed descriptor. Descriptor identity is not authority.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Properties
Section titled “Properties”readonly id: string;version
Section titled “version”readonly version: number;schema
Section titled “schema”readonly schema: z.ZodType<T>;CapabilityDirectorytype alias
Section titled “CapabilityDirectory”type CapabilityDirectory = object;The App’s read-only view of its currently admitted capabilities.
Properties
Section titled “Properties”version
Section titled “version”readonly version: number;Changes after a successful grant replacement or disconnection.
Methods
Section titled “Methods”subscribe()
Section titled “subscribe()”subscribe(listener): Disposer;Read the current directory after a change. Does not emit on subscribe.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
listener |
() => void |
Returns
Section titled “Returns”has(contract): boolean;Whether an implementation for this contract is currently admitted.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
contract |
CapabilityContract<unknown> |
Returns
Section titled “Returns”boolean
require()
Section titled “require()”require<T>(contract): T;The admitted implementation for this contract, or throw a CAPABILITY_DENIED
AppError when none is granted.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
contract |
CapabilityContract<T> |
Returns
Section titled “Returns”T
CapabilityRegistrytype alias
Section titled “CapabilityRegistry”type CapabilityRegistry = CapabilityDirectory & object;Local capabilities admitted through their owner’s typed contract.
Type Declaration
Section titled “Type Declaration”| Name | Type | Description |
|---|---|---|
provide() |
<T>(contract, implementation) => void |
Admit an implementation for this contract, replacing any previous one and bumping version so subscribers can react. |
AppCommandtype alias
Section titled “AppCommand”type AppCommand = WhistleCommandDefinition;Semantic command metadata supplied by an App and owned by Whistle.
AppCommandHandlertype alias
Section titled “AppCommandHandler”type AppCommandHandler = ( invocation,) => Promise<WhistleJsonValue | undefined> | WhistleJsonValue | undefined;One invocation’s semantic input; host correlation IDs are private.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
invocation |
AppCommandInvocation |
Returns
Section titled “Returns”| Promise<WhistleJsonValue | undefined> | WhistleJsonValue |
undefined
AppCommandInvocationtype alias
Section titled “AppCommandInvocation”type AppCommandInvocation = object;One command invocation’s semantic input, passed to its handler.
Properties
Section titled “Properties”arguments?
Section titled “arguments?”readonly optional arguments?: WhistleJsonValue;origin
Section titled “origin”readonly origin: WhistleExecutionOrigin;signal
Section titled “signal”readonly signal: AbortSignal;AppCommandstype alias
Section titled “AppCommands”type AppCommands = object;Registers a command with the authenticated host for this page session. The promise resolves only after the host accepts the registration.
Methods
Section titled “Methods”register()
Section titled “register()”register(command, handler): Promise<Disposer>;Register one command and its handler with the host; resolves once the host accepts it. Call the returned Disposer to unregister.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
command |
{ id: z.ZodLazy<z.ZodString>; title: z.ZodLazy<z.ZodString>; category: z.ZodLazy<z.ZodString>; description?: z.ZodOptional<z.ZodLazy<z.ZodString>>; projections?: z.ZodOptional<z.ZodLazy<z.ZodObject<{ bindings: z.ZodOptional<z.ZodObject<{ order: z.ZodOptional<z.ZodLazy<…>>; values: z.ZodArray<z.ZodLazy<…>>; }, z.core.$strict>>; agent: z.ZodOptional<z.ZodObject<{ keybind: z.ZodOptional<z.ZodLazy<…>>; order: z.ZodOptional<z.ZodLazy<…>>; }, z.core.$strict>>; help: z.ZodOptional<z.ZodLazy<z.ZodObject<{ order: z.ZodOptional<…>; }, z.core.$strict>>>; menu: z.ZodOptional<z.ZodLazy<z.ZodObject<{ order: z.ZodOptional<…>; }, z.core.$strict>>>; palette: z.ZodOptional<z.ZodLazy<z.ZodObject<{ order: z.ZodOptional<…>; }, z.core.$strict>>>; slash: z.ZodOptional<z.ZodObject<{ aliases: z.ZodArray<z.ZodLazy<…>>; consumesDraft: z.ZodOptional<z.ZodBoolean>; order: z.ZodOptional<z.ZodLazy<…>>; arguments: z.ZodOptional<z.ZodLazy<…>>; }, z.core.$strict>>; }, z.core.$strict>>>; action?: z.ZodOptional<z.ZodLazy<z.ZodObject<{ inputSchema: z.ZodOptional<z.ZodLazy<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>>; outputSchema: z.ZodOptional<z.ZodLazy<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>>; presentation: z.ZodOptional<z.ZodLazy<z.ZodUnion<readonly […, …, …, …, …]>>>; }, z.core.$strict>>>; availability?: z.ZodOptional<z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{ status: z.ZodLiteral<"available">; }, z.core.$strict>, z.ZodObject<{ status: z.ZodLiteral<"unavailable">; reason: z.ZodString; }, z.core.$strict>], "status">>>; } |
command.id |
z.ZodLazy<z.ZodString> |
command.title |
z.ZodLazy<z.ZodString> |
command.category |
z.ZodLazy<z.ZodString> |
command.description? |
z.ZodOptional<z.ZodLazy<z.ZodString>> |
command.projections? |
z.ZodOptional<z.ZodLazy<z.ZodObject<{ bindings: z.ZodOptional<z.ZodObject<{ order: z.ZodOptional<z.ZodLazy<…>>; values: z.ZodArray<z.ZodLazy<…>>; }, z.core.$strict>>; agent: z.ZodOptional<z.ZodObject<{ keybind: z.ZodOptional<z.ZodLazy<…>>; order: z.ZodOptional<z.ZodLazy<…>>; }, z.core.$strict>>; help: z.ZodOptional<z.ZodLazy<z.ZodObject<{ order: z.ZodOptional<…>; }, z.core.$strict>>>; menu: z.ZodOptional<z.ZodLazy<z.ZodObject<{ order: z.ZodOptional<…>; }, z.core.$strict>>>; palette: z.ZodOptional<z.ZodLazy<z.ZodObject<{ order: z.ZodOptional<…>; }, z.core.$strict>>>; slash: z.ZodOptional<z.ZodObject<{ aliases: z.ZodArray<z.ZodLazy<…>>; consumesDraft: z.ZodOptional<z.ZodBoolean>; order: z.ZodOptional<z.ZodLazy<…>>; arguments: z.ZodOptional<z.ZodLazy<…>>; }, z.core.$strict>>; }, z.core.$strict>>> |
command.action? |
z.ZodOptional<z.ZodLazy<z.ZodObject<{ inputSchema: z.ZodOptional<z.ZodLazy<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>>; outputSchema: z.ZodOptional<z.ZodLazy<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>>; presentation: z.ZodOptional<z.ZodLazy<z.ZodUnion<readonly […, …, …, …, …]>>>; }, z.core.$strict>>> |
command.availability? |
z.ZodOptional<z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{ status: z.ZodLiteral<"available">; }, z.core.$strict>, z.ZodObject<{ status: z.ZodLiteral<"unavailable">; reason: z.ZodString; }, z.core.$strict>], "status">>> |
handler |
AppCommandHandler |
Returns
Section titled “Returns”Promise<Disposer>
ConnectAppOptionstype alias
Section titled “ConnectAppOptions”type ConnectAppOptions = object;Options for connecting this iframe page to its authenticated host.
Properties
Section titled “Properties”readonly host: "parent";The parent is the host. Serve the App with CSP frame-ancestors pinned to its
allowed host so an unrelated site cannot become its parent.
signal?
Section titled “signal?”readonly optional signal?: AbortSignal;Cancels a pending connection attempt.
AppConnectMessagetype alias
Section titled “AppConnectMessage”type AppConnectMessage = object;The host’s handshake message that hands the App its RPC MessagePort.
Properties
Section titled “Properties”readonly epoch: string;protocolVersion
Section titled “protocolVersion”readonly protocolVersion: typeof APP_PROTOCOL_VERSION;readonly type: typeof APP_CONNECT_TYPE;AppReadyMessagetype alias
Section titled “AppReadyMessage”type AppReadyMessage = object;The App iframe’s handshake message announcing it is ready to connect.
Properties
Section titled “Properties”protocolVersion
Section titled “protocolVersion”readonly protocolVersion: typeof APP_PROTOCOL_VERSION;readonly type: typeof APP_READY_TYPE;AppContexttype alias
Section titled “AppContext”type AppContext = object;The host-published state surrounding a connected App: its Computer selection, focus, visibility, and any pending open request.
Properties
Section titled “Properties”computerId
Section titled “computerId”readonly computerId: string | null;Host-selected Computer backing this App’s admitted resource capabilities.
teamHasComputers?
Section titled “teamHasComputers?”readonly optional teamHasComputers?: boolean | null;Whether the Team has Computers, when this host owns its Team directory.
computerAccessGranted?
Section titled “computerAccessGranted?”readonly optional computerAccessGranted?: boolean;Whether this App has execute access across the Team, when known.
readonly focus: FocusState;openRequest
Section titled “openRequest”readonly openRequest: AppOpenRequest | null;One host-issued App open action, present only on the launch/reconfigure.
visibility
Section titled “visibility”readonly visibility: "hidden" | "visible";AppOpenRequesttype alias
Section titled “AppOpenRequest”type AppOpenRequest = | Readonly<{ kind: "compose"; requestId: string; text: string; }> | Readonly<{ kind: "navigate"; requestId: string; params: readonly Readonly<{ key: string; value: string; }>[]; }>;One host-issued action an App must act on when it opens or reconfigures: start
composing given text, or navigate to the given params. Each carries a
requestId so the App can tell a repeated open from a fresh one.
AppIdentitytype alias
Section titled “AppIdentity”type AppIdentity = object;The App’s own identity, as admitted by its host.
Properties
Section titled “Properties”readonly appId: string;releaseId
Section titled “releaseId”readonly releaseId: string;surfaceId
Section titled “surfaceId”readonly surfaceId: string;AppLifecycletype alias
Section titled “AppLifecycle”type AppLifecycle = | "connected" | "connecting" | "disconnected" | "disposed" | "disposing" | "suspended";The connection state of this App’s session with its host.
FocusStatetype alias
Section titled “FocusState”type FocusState = object;Whether the App’s own surface is being edited and which surface, if any, the host considers focused.
Properties
Section titled “Properties”editing
Section titled “editing”readonly editing: boolean;surface
Section titled “surface”readonly surface: null | string;MediaGenerationInputtype alias
Section titled “MediaGenerationInput”type MediaGenerationInput = Readonly<{ destination: Readonly<{ path: string; }>; settings: MediaGenerationSelection;}>;The Media owner decides Team, Installation, Release, Grant and Computer authority before issuing this handle. The App contributes only generation settings and selected destination/references. The IDs in those selections are not authority: the host revalidates every one against its current admitted Computer scope when it accepts a generation.
The owner intentionally returns completed metadata. Operation state, provider identifiers and billing records remain owner facts. The exposed request reference identifies a replay; it grants no authority.
MediaOutputFormattype alias
Section titled “MediaOutputFormat”type MediaOutputFormat = "png" | "jpeg" | "gif" | "webp" | "mp4";The encodings a completed generation can be saved as.
MediaGenerationResulttype alias
Section titled “MediaGenerationResult”type MediaGenerationResult = Readonly<{ bytes: number; costMilliunits: number; destination: Readonly<{ computerId: string; path: string; }>; format: MediaOutputFormat; height: number; model: string; width: number;}>;Metadata for one completed generation: the saved destination, pixel dimensions, format, model used, and its cost.
MediaGenerationFailuretype alias
Section titled “MediaGenerationFailure”type MediaGenerationFailure = Schema.Schema.Type< typeof mediaGenerationFailureSchema>;The host’s typed reason a generation failed: code, message, retry truth and, when known, the stage that failed.
MediaGenerationOutcometype alias
Section titled “MediaGenerationOutcome”type MediaGenerationOutcome = | Readonly<{ kind: "succeeded"; result: MediaGenerationResult; }> | Readonly<{ kind: "failed"; failure: MediaGenerationFailure; }>;Transport-safe result from the host-owned generation attempt.
MediaGenerationHandletype alias
Section titled “MediaGenerationHandle”type MediaGenerationHandle = object;Live object-capability shape supplied by the host.
Methods
Section titled “Methods”describe()
Section titled “describe()”describe(): Promise<Partial<Disposable> & object>;Fetch the Computer scope, available models, and whether generation is currently allowed.
Returns
Section titled “Returns”Promise<Partial<Disposable> & object>
createAttempt()
Section titled “createAttempt()”createAttempt(): Promise<MediaGenerationAttemptHandle>;Begin a new generation attempt on the host and return its handle.
Returns
Section titled “Returns”Promise<MediaGenerationAttemptHandle>
restoreAttempt()
Section titled “restoreAttempt()”restoreAttempt(reference): Promise<MediaGenerationAttemptHandle>;Resume a previously started attempt identified by its reference.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
reference |
{ requestId: string; computerId: string; } |
reference.requestId |
string |
reference.computerId |
string |
Returns
Section titled “Returns”Promise<MediaGenerationAttemptHandle>
cancelAttempt()
Section titled “cancelAttempt()”cancelAttempt(reference): Promise<void>;Tell the host to stop an in-flight or pending attempt.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
reference |
{ requestId: string; computerId: string; } |
reference.requestId |
string |
reference.computerId |
string |
Returns
Section titled “Returns”Promise<void>
MediaGenerationAttemptHandletype alias
Section titled “MediaGenerationAttemptHandle”type MediaGenerationAttemptHandle = Partial<Disposable> & object;Host-supplied object-capability for one attempt, before Agar wraps it into the typed MediaGenerationAttempt.
Type Declaration
Section titled “Type Declaration”| Name | Type | Description |
|---|---|---|
reference() |
() => Promise<object & Partial<Disposable>> |
Fetch this attempt’s replay reference from the host. |
generate() |
(input) => Promise<MediaGenerationOutcome & Partial<Disposable>> |
Ask the host to run generation for this attempt with the given input. |
MediaGenerationAttempttype alias
Section titled “MediaGenerationAttempt”type MediaGenerationAttempt = Disposable & object;One generation attempt: a stable reference plus the ability to run (or retry) generation against it until disposed.
Type Declaration
Section titled “Type Declaration”| Name | Type | Description |
|---|---|---|
reference |
MediaGenerationReference |
- |
generate() |
(input, options?) => Promise<Readonly<{ bytes: number; costMilliunits: number; destination: Readonly<{ computerId: string; path: string; }>; format: MediaOutputFormat; height: number; model: string; width: number; }>> |
Run generation for this attempt and return the saved result, or throw MediaGenerationError on failure; an abort signal cancels it. |
MediaGenerationSessiontype alias
Section titled “MediaGenerationSession”type MediaGenerationSession = Readonly<{ computerId: string; canGenerate: boolean; models: readonly MediaModel[]; createAttempt: Promise<MediaGenerationAttempt>; restoreAttempt: Promise<MediaGenerationAttempt>;}>;The validated, App-facing handle returned by openMediaGeneration: the Computer’s model catalog plus the ability to start or resume attempts.
MediaGenerationReferencetype alias
Section titled “MediaGenerationReference”type MediaGenerationReference = Schema.Schema.Type< typeof mediaGenerationReferenceSchema>;An opaque replay identity for one attempt; it identifies a request, not an authorization to use it.
MediaModeltype alias
Section titled “MediaModel”type MediaModel = Schema.Schema.Type<typeof mediaModelSchema>;One generation model as the host describes it: identity, tier, input limits and supported output formats. The host owns the catalog.
MediaGenerationSelectiontype alias
Section titled “MediaGenerationSelection”type MediaGenerationSelection = Schema.Schema.Type< typeof mediaGenerationSelectionSchema>;An App’s generation settings: model, prompt, size and optional steps, duration and Computer-relative reference paths.
Pendingtype alias
Section titled “Pending”type Pending = Readonly<z.output<typeof pendingSchema>>;The shared polling result, owned by the App contract.
AppRoottype alias
Section titled “AppRoot”type AppRoot = object;The App’s live connection to its host: its admitted capabilities, commands,
context, theme, UI door and window, all torn down together by dispose.
Returned by connectApp and passed to mountApp.
Properties
Section titled “Properties”capabilities
Section titled “capabilities”readonly capabilities: CapabilityDirectory;commands
Section titled “commands”readonly commands: AppCommands;context
Section titled “context”readonly context: ReadonlyStore<AppContext>;identity
Section titled “identity”readonly identity: Readonly<AppIdentity>;lifecycle
Section titled “lifecycle”readonly lifecycle: ReadonlyStore<AppLifecycle>;readonly theme: ReadonlyStore<string>;readonly ui: HostUi;window
Section titled “window”readonly window: AppWindow;Methods
Section titled “Methods”dispose()
Section titled “dispose()”dispose(): void;End this App’s connection to its host and release everything it owns.
Returns
Section titled “Returns”void
Disposertype alias
Section titled “Disposer”type Disposer = () => void;Releases a subscription or other held resource. Call once; further calls are a no-op.
Returns
Section titled “Returns”void
ReadonlyStoretype alias
Section titled “ReadonlyStore”type ReadonlyStore<T> = object;A retained SDK-owned snapshot.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Methods
Section titled “Methods”get(): T;The current value; always available, even before any subscription.
Returns
Section titled “Returns”T
subscribe()
Section titled “subscribe()”subscribe(listener): Disposer;Call listener on every change until the returned Disposer runs. Does not emit
the current value immediately on subscribe.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
listener |
(value) => void |
Returns
Section titled “Returns”HostUitype alias
Section titled “HostUi”type HostUi = object;Deliberately narrow shell affordances; domain work belongs to capabilities.
Methods
Section titled “Methods”requestComputerChoice()
Section titled “requestComputerChoice()”requestComputerChoice(): Promise<void>;Open the host-owned Computer picker; selection arrives through App context.
Returns
Section titled “Returns”Promise<void>
requestBrowserAction()
Section titled “requestBrowserAction()”requestBrowserAction(input): Promise<AppBrowserActionOutcome>;Request a host browser action from a fresh user click in this App.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
AppBrowserAction |
Returns
Section titled “Returns”Promise<AppBrowserActionOutcome>
requestAppPermissions()
Section titled “requestAppPermissions()”requestAppPermissions(input): Promise<AppPermissionOutcome>;Ask the trusted host for App rights. The host, never the App, renders the consent and writes any grant; an empty request opens App permissions.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
AppPermissionRequest |
Returns
Section titled “Returns”Promise<AppPermissionOutcome>
openNavigation()
Section titled “openNavigation()”openNavigation(input): Promise<void>;Ask the host to open an already admitted Computer file.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
FileNavigationInput |
Returns
Section titled “Returns”Promise<void>
reportStatus()
Section titled “reportStatus()”reportStatus(items): Promise<void>;Declare this window’s status bar items, such as “2 documents” or a Ports button. The host renders them beside the Computer it owns; the newest report wins and an empty list clears them.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
items |
readonly AppStatusItem[] |
Returns
Section titled “Returns”Promise<void>
onStatusAction()
Section titled “onStatusAction()”onStatusAction(handler): () => void;Hear the person use one of this window’s declared status items. One owner at a time; the host never renders App UI in its chrome.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
handler |
AppStatusActionHandler |
Returns
Section titled “Returns”() => void
openTeamBilling()
Section titled “openTeamBilling()”openTeamBilling(): Promise<void>;Leave the App for the host’s Billing page for this Team.
Returns
Section titled “Returns”Promise<void>
openDesktopSettings()
Section titled “openDesktopSettings()”openDesktopSettings(): Promise<void>;Suggest this App’s desktop Gills while focused with browser activation. The host shows a notice; the member must choose Review to open Settings. The App receives no layout or placement authority.
Returns
Section titled “Returns”Promise<void>
reportAgentSessionSelection()
Section titled “reportAgentSessionSelection()”reportAgentSessionSelection(selection): Promise<void>;Tell the host which Agent conversation this App currently has selected, or null when none is selected.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
selection |
| Readonly<{ agentId: string; sessionId: string; }> | null |
Returns
Section titled “Returns”Promise<void>
showToast()
Section titled “showToast()”showToast(input): Promise<void>;Ask the host to show a transient toast notification.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
ToastInput |
Returns
Section titled “Returns”Promise<void>
AppStatusIcontype alias
Section titled “AppStatusIcon”type AppStatusIcon = "folder" | "ports" | "processes" | "access";The marks a host can draw before a status button’s label.
AppStatusTonetype alias
Section titled “AppStatusTone”type AppStatusTone = "neutral" | "success" | "warning" | "error";A readout’s live state, shown as a small light before its text.
AppStatusOptiontype alias
Section titled “AppStatusOption”type AppStatusOption = Readonly<{ id: string; text: string; checked?: boolean; disabled?: boolean;}>;One choice in a status menu, such as a folder or a port.
AppStatusItemtype alias
Section titled “AppStatusItem”type AppStatusItem = | Readonly<{ id: string; text: string; end?: boolean; kind: "text"; tone?: AppStatusTone; }> | Readonly<{ id: string; text: string; end?: boolean; kind: "button"; icon?: AppStatusIcon; count?: number; tone?: AppStatusTone; busy?: boolean; title?: string; disabled?: boolean; opens?: "dialog"; expanded?: boolean; }> | Readonly<{ id: string; text: string; end?: boolean; kind: "toggle"; pressed: boolean; }> | Readonly<{ id: string; text: string; end?: boolean; kind: "menu"; count?: number; title?: string; options: readonly AppStatusOption[]; }>;One item an App declares for its window’s status bar, as data: a readout, a button, a toggle, or a menu of choices. Using one delivers an AppStatusAction back to the App.
AppStatusActiontype alias
Section titled “AppStatusAction”type AppStatusAction = Readonly<{ itemId: string; optionId?: string; anchor?: Readonly<{ start: number; width: number; }>;}>;The person used a status item; optionId names a chosen menu option. anchor
is where the item sits along the App’s surface, in CSS pixels from its inline
start, so App UI it opens can sit above it.
AppStatusActionHandlertype alias
Section titled “AppStatusActionHandler”type AppStatusActionHandler = (action) => boolean | Promise<boolean>;Handles one status action; true when the App acted on it.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
action |
AppStatusAction |
Returns
Section titled “Returns”boolean | Promise<boolean>
AgentSessionSelectiontype alias
Section titled “AgentSessionSelection”type AgentSessionSelection = Readonly<{ agentId: string; sessionId: string;}>;Exact Agent conversation selected by an App for the authenticated shell.
FileNavigationInputtype alias
Section titled “FileNavigationInput”type FileNavigationInput = object;A presentation-neutral request to open an already admitted Computer file.
Properties
Section titled “Properties”computerId
Section titled “computerId”readonly computerId: string;readonly path: string;ToastInputtype alias
Section titled “ToastInput”type ToastInput = object;A transient notification an App asks its host to show.
Properties
Section titled “Properties”message
Section titled “message”readonly message: string;readonly optional tone?: "error" | "info" | "success" | "warning";AgentAccessOperationtype alias
Section titled “AgentAccessOperation”type AgentAccessOperation = "agent.list" | "agent.manage" | "agent.read" | "agent.send";Agent rights an App may ask its host to grant through consent.
ComputerAccessOperationtype alias
Section titled “ComputerAccessOperation”type ComputerAccessOperation = | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute";Computer rights an App may ask its host to grant through consent.
AppPermissionRequesttype alias
Section titled “AppPermissionRequest”type AppPermissionRequest = Readonly<{ agents?: readonly AgentAccessOperation[]; computers?: readonly ComputerAccessOperation[];}>;The rights an App asks for; the host bounds them by its declared ceiling.
AppPermissionOutcometype alias
Section titled “AppPermissionOutcome”type AppPermissionOutcome = "granted" | "declined" | "customize";granted: the host saved a grant covering the request. declined: the user
said not now. customize: the host opened its full permission settings.
AppBrowserActiontype alias
Section titled “AppBrowserAction”type AppBrowserAction = | Readonly<{ kind: "saveFile"; name: string; mime: string; bytes: Uint8Array; }> | Readonly<{ kind: "copyText"; text: string; }>;Data only; browser authority and the gesture check belong to the host.
AppBrowserActionRefusaltype alias
Section titled “AppBrowserActionRefusal”type AppBrowserActionRefusal = Readonly<{ kind: "refused"; reason: | "no-user-gesture" | "too-large" | "invalid-request" | "unavailable" | "denied" | "busy";}>;A browser action can be refused without disconnecting the App.
AppBrowserActionOutcometype alias
Section titled “AppBrowserActionOutcome”type AppBrowserActionOutcome = | Readonly<{ kind: "saved"; }> | Readonly<{ kind: "copied"; }> | AppBrowserActionRefusal;Saved means a browser download was initiated, not a confirmed disk write.
BeforeAppClosetype alias
Section titled “BeforeAppClose”type BeforeAppClose = () => boolean | Promise<boolean>;Consulted before the person closes the App’s window; return (or resolve) true
to allow the close.
Returns
Section titled “Returns”boolean | Promise<boolean>
AppCrumbtype alias
Section titled “AppCrumb”type AppCrumb = Readonly<{ id: string; label: string; siblings?: readonly Readonly<{ id: string; label: string; }>[];}>;One place in the App’s path; siblings makes it a switcher.
AppHeaderCommandtype alias
Section titled “AppHeaderCommand”type AppHeaderCommand = Readonly<{ id: string; label: string; icon?: "play"; variant?: "primary" | "outline" | "ghost"; tone?: "destructive"; disabled?: boolean;}>;A command the App offers in its window header; the App owns its effect.
AppHeaderStatustype alias
Section titled “AppHeaderStatus”type AppHeaderStatus = Readonly<{ id: string; label: string; presentation?: "bead"; tone?: "neutral" | "info" | "warning" | "success" | "error";}>;A quiet fact about the view, shown as muted text with a status bead.
AppNavigationActivationtype alias
Section titled “AppNavigationActivation”type AppNavigationActivation = | Readonly<{ kind: "crumb"; crumbId: string; siblingId?: string; }> | Readonly<{ kind: "action"; actionId: string; }>;The person used a crumb (or a switcher’s sibling) or a header command.
AppNavigationActivationHandlertype alias
Section titled “AppNavigationActivationHandler”type AppNavigationActivationHandler = ( activation,) => boolean | Promise<boolean>;Handles one activation; true when the App acted on it.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
activation |
AppNavigationActivation |
Returns
Section titled “Returns”boolean | Promise<boolean>
AppNavigationStatetype alias
Section titled “AppNavigationState”type AppNavigationState = Readonly<{ canGoBack: boolean; title?: string; crumbs?: readonly AppCrumb[]; primary?: readonly AppHeaderCommand[]; menu?: readonly AppHeaderCommand[]; status?: readonly AppHeaderStatus[];}>;What the App’s own router can do right now. The App owns its history; the host only offers a Back affordance and relays the person’s request.
AppBackHandlertype alias
Section titled “AppBackHandler”type AppBackHandler = () => boolean | Promise<boolean>;Go back one step in the App’s own history; true when it moved.
Returns
Section titled “Returns”boolean | Promise<boolean>
HostNavigationtype alias
Section titled “HostNavigation”type HostNavigation = Readonly<{ publish: Promise<void>; onBack: Disposer; onActivate: Disposer;}>;The App’s half of the host navigation contract.
AppWindowtype alias
Section titled “AppWindow”type AppWindow = Readonly<{ onBeforeClose: Disposer; navigation: HostNavigation;}>;App-owned presentation policy consulted before a user closes its window.
ResultRowtype alias
Section titled “ResultRow”type ResultRow = Schema.Schema.Type<typeof resultRowSchemaV1>;One shared result row; navigation and previews stay host-authorized.
FungiAuthorSchemaconstant
Section titled “FungiAuthorSchema”const FungiAuthorSchema: ZodLazy< ZodObject< { id: ZodString; name: ZodString; kind: ZodOptional<ZodLiteral<"agent">>; }, $strict >>;Who a Session line came from, as the admitting host authenticated them.
FungiDelegationReplySchemaconstant
Section titled “FungiDelegationReplySchema”const FungiDelegationReplySchema: ZodLazy< ZodObject< { agentId: ZodLazy<ZodString>; sessionId: ZodLazy<ZodString>; commandId: ZodLazy<ZodString>; outcome: ZodEnum<{ completed: "completed"; failed: "failed"; interrupted: "interrupted"; cancelled: "cancelled"; outcome_unknown: "outcome_unknown"; }>; diagnostic: ZodOptional<ZodString>; waitingOnYou: ZodOptional< ZodArray< ZodObject< { itemId: ZodLazy<ZodString>; kind: ZodString; summary: ZodString; }, $strict > > >; }, $strict >>;A delegated Agent’s reply as the admitting host authenticated it against the
mail it sent. commandId is the replying Session’s accepted command, the same
id as the sender’s agents.send receipt.
FungiMessageMetaSchemaconstant
Section titled “FungiMessageMetaSchema”const FungiMessageMetaSchema: ZodObject<{ author: ZodOptional<ZodLazy<ZodObject<{ id: ZodString; name: ZodString; kind: ZodOptional<ZodLiteral<"agent">>; }, $strict>>>; sourceRequestId: ZodOptional<ZodLazy<ZodString>>; delegation: ZodOptional<ZodObject<{ ancestors: ZodArray<ZodLazy<ZodString>>; maxDepth: ZodNumber; steer: ZodOptional<ZodLiteral<true>>; reply: ZodOptional<ZodLazy<ZodObject<{ agentId: ZodLazy<ZodString>; sessionId: ZodLazy<ZodString>; commandId: ZodLazy<ZodString>; outcome: ZodEnum<{ completed: ...; failed: ...; interrupted: ...; cancelled: ...; outcome_unknown: ...; }>; diagnostic: ZodOptional<ZodString>; waitingOnYou: ZodOptional<ZodArray<...>>; }, $strict>>>; }, $strict>>;}, $strict>;The metadata the host attaches to every prompt and operator line it admits. Shiitake stores it opaquely; the host writes it and Apps read it.
appAgentAvatarSchemaconstant
Section titled “appAgentAvatarSchema”const appAgentAvatarSchema: declare< { v: 1; character: "mushroom" | "cat" | "burger"; appearance: z.ZodRecord< z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]> >; expression: string; renderStyle: | "plain" | "pencil" | "manga" | "riso" | "halftone" | "blueprint" | "crt" | "watercolor"; }, { v: 1; character: "mushroom" | "cat" | "burger"; appearance: z.ZodRecord< z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]> >; expression: string; renderStyle: | "plain" | "pencil" | "manga" | "riso" | "halftone" | "blueprint" | "crt" | "watercolor"; }>;An Agent’s avatar: Sprite’s Avatar v1 envelope. Apps check its shape; the host owns the character-catalog refinement when it stores one.
appAgentSchemaconstant
Section titled “appAgentSchema”const appAgentSchema: Struct<{ agentId: String; name: String; avatar: declare< { v: 1; character: "mushroom" | "cat" | "burger"; appearance: z.ZodRecord< z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]> >; expression: string; renderStyle: | "plain" | "pencil" | "manga" | "riso" | "halftone" | "blueprint" | "crt" | "watercolor"; }, { v: 1; character: "mushroom" | "cat" | "burger"; appearance: z.ZodRecord< z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]> >; expression: string; renderStyle: | "plain" | "pencil" | "manga" | "riso" | "halftone" | "blueprint" | "crt" | "watercolor"; } >; sessionOperations: $Array< Literals<readonly ["agent.read", "agent.send", "agent.manage"]> >;}>;Validates the wire shape of an Agent record: its id, display name, avatar, and
which session operations (read, send, manage) this App may perform on it. Every
Agent has an avatar: the one its owner chose, else Sprite’s
seededAvatar(agentId). Conversations carry none of their own.
appAgentCreateInputSchemaconstant
Section titled “appAgentCreateInputSchema”const appAgentCreateInputSchema: Struct<{ name: String; requestId: String; computer: optionalKey<Literals<readonly ["new", "none"]>>; avatar: optionalKey< declare< { v: 1; character: "mushroom" | "cat" | "burger"; appearance: z.ZodRecord< z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]> >; expression: string; renderStyle: | "plain" | "pencil" | "manga" | "riso" | "halftone" | "blueprint" | "crt" | "watercolor"; }, { v: 1; character: "mushroom" | "cat" | "burger"; appearance: z.ZodRecord< z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]> >; expression: string; renderStyle: | "plain" | "pencil" | "manga" | "riso" | "halftone" | "blueprint" | "crt" | "watercolor"; } > >;}>;Validates Agent creation input: a name, a caller-chosen request id, an optional Computer provisioning choice and an optional chosen avatar.
agentListconstant
Section titled “agentList”const agentList: CapabilityContract<AppAgentListHandle>;Capability to list the Agents visible to this App in read-only form.
agentManageconstant
Section titled “agentManage”const agentManage: CapabilityContract< Pick<AppAgentDirectoryHandle, "create" | "open">>;Capability to create new Agents and open transports to them.
appAgentRenameInputSchemaconstant
Section titled “appAgentRenameInputSchema”const appAgentRenameInputSchema: Struct<{ agentId: String; name: String;}>;Validates Agent rename input: the target Agent and its new display name.
agentRenameconstant
Section titled “agentRename”const agentRename: CapabilityContract<AppAgentRenameHandle>;Owner-only capability to rename an existing Agent; not every host grants it.
appAgentAvatarInputSchemaconstant
Section titled “appAgentAvatarInputSchema”const appAgentAvatarInputSchema: Struct<{ agentId: String; avatar: declare< { v: 1; character: "mushroom" | "cat" | "burger"; appearance: z.ZodRecord< z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]> >; expression: string; renderStyle: | "plain" | "pencil" | "manga" | "riso" | "halftone" | "blueprint" | "crt" | "watercolor"; }, { v: 1; character: "mushroom" | "cat" | "burger"; appearance: z.ZodRecord< z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]> >; expression: string; renderStyle: | "plain" | "pencil" | "manga" | "riso" | "halftone" | "blueprint" | "crt" | "watercolor"; } >;}>;Validates avatar input: the target Agent and the avatar it now wears.
agentAvatarconstant
Section titled “agentAvatar”const agentAvatar: CapabilityContract<AppAgentAvatarHandle>;Owner-only capability to change an existing Agent’s avatar; not every host grants it.
appAgentToolPolicyStatusSchemaconstant
Section titled “appAgentToolPolicyStatusSchema”const appAgentToolPolicyStatusSchema: ZodLazy< ZodUnion< readonly [ ZodObject< { status: ZodLiteral<"pending">; revision: ZodString; }, $strip >, ZodObject< { status: ZodLiteral<"approved">; revision: ZodString; }, $strip >, ] >>;One Agent’s App-tool policy, as the owner-only policy capability reports it.
appAgentToolPolicyResultSchemaconstant
Section titled “appAgentToolPolicyResultSchema”const appAgentToolPolicyResultSchema: ZodLazy< ZodUnion< readonly [ ZodLazy< ZodUnion< readonly [ ZodObject< { status: ZodLiteral<"pending">; revision: ZodString; }, $strip >, ZodObject< { status: ZodLiteral<"approved">; revision: ZodString; }, $strip >, ] > >, ZodObject< { error: ZodString; }, $strip >, ] >>;The outcome of an owner’s direct App-tool approval.
agentToolPolicyconstant
Section titled “agentToolPolicy”const agentToolPolicy: CapabilityContract<AppAgentToolPolicyHandle>;Owner-only capability to read and approve an Agent’s App-tool policy.
agentSessionReadconstant
Section titled “agentSessionRead”const agentSessionRead: CapabilityContract< Pick<AppAgentDirectoryHandle, "open" | "openInbox">>;Capability for read-only Agent sessions: open a transport to an existing Agent, or read the member’s inbox feed.
agentSessionWriteconstant
Section titled “agentSessionWrite”const agentSessionWrite: CapabilityContract< Pick<AppAgentDirectoryHandle, "open" | "openInbox">>;Capability for read-write Agent sessions: open a transport to an existing Agent and send to it, including the member’s inbox feed.
approvalsconstant
Section titled “approvals”const approvals: CapabilityContract<Approvals>;Member-bound approval view. Authentication and current rights belong to the host.
APP_PROTOCOL_VERSIONconstant
Section titled “APP_PROTOCOL_VERSION”const APP_PROTOCOL_VERSION: 2;The iframe handshake version both App and host must speak.
APP_READY_TYPEconstant
Section titled “APP_READY_TYPE”const APP_READY_TYPE: "fungi.app.ready";Message type the App iframe posts to announce it is ready to connect.
APP_CONNECT_TYPEconstant
Section titled “APP_CONNECT_TYPE”const APP_CONNECT_TYPE: "fungi.app.connect";Message type the host posts to hand the App its RPC MessagePort.
appDeliveryPendingSchemaconstant
Section titled “appDeliveryPendingSchema”const appDeliveryPendingSchema: Struct<{ code: Literals<readonly ["DELIVERY_PENDING"]>;}>;Effect projection of the error owner’s declaration-safe pending refusal.
parseAppStatusItemsconstant
Section titled “parseAppStatusItems”const parseAppStatusItems: (...a) => readonly AppStatusItem[];Both edges: one window’s status items, bounded and copied.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…a |
[unknown, ParseOptions] |
Returns
Section titled “Returns”readonly AppStatusItem[]
parseAppStatusActionconstant
Section titled “parseAppStatusAction”const parseAppStatusAction: (...a) => C;App edge: the status item the person used, as the host relays it.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
…a |
[unknown, ParseOptions] |
Returns
Section titled “Returns”C
mediaGenerationReferenceSchemaconstant
Section titled “mediaGenerationReferenceSchema”const mediaGenerationReferenceSchema: Struct<{ requestId: String; computerId: String;}>;A replay identity, never an authorization capability.
mediaModelSchemaconstant
Section titled “mediaModelSchema”const mediaModelSchema: Struct<{ id: String; input: Struct<{ defaultHeight: Number; defaultSteps: NullOr<Number>; defaultWidth: Number; dimensions: Literals<readonly ["none", "own"]>; maxDimension: NullOr<Number>; maxDimensionDocumented: Boolean; maxReferences: Number; maxSteps: NullOr<Number>; referenceField: NullOr<String>; steps: Literals<readonly ["steps", "num_steps", "fixed"]>; transport: Literals<readonly ["json", "multipart"]>; }>; kind: Literals<readonly ["image", "video"]>; label: String; maxPromptLength: Number; tier: Literals<readonly ["draft", "balanced", "premium", "max"]>; outputFormats: $Array<Literals<readonly ["png", "jpeg", "webp"]>>; sizes: NullOr<$Array<String>>; video: NullOr< Struct<{ minSeconds: Number; maxSeconds: Number; defaultSeconds: Number; durations: $Array<Number>; provider: Literals<readonly ["seedance", "veo", "minimax"]>; formats: $Array< Struct<{ resolution: Literals< readonly ["480p", "720p", "768p", "1080p", "4k"] >; aspectRatio: Literals< readonly ["16:9", "4:3", "1:1", "3:4", "9:16", "21:9", "9:21"] >; width: Number; height: Number; }> >; defaultResolution: Literals< readonly ["480p", "720p", "768p", "1080p", "4k"] >; defaultAspectRatio: Literals< readonly ["16:9", "4:3", "1:1", "3:4", "9:16", "21:9", "9:21"] >; supportsAudio: Boolean; defaultGenerateAudio: NullOr<Boolean>; referenceRoles: $Array< Literals<readonly ["first-frame", "last-frame", "reference"]> >; maxReferenceImages: Number; referenceResolutions: $Array< Literals<readonly ["480p", "720p", "768p", "1080p", "4k"]> >; prices: $Array< Struct<{ resolution: Literals< readonly ["480p", "720p", "768p", "1080p", "4k"] >; silentMilliunitsPerSecond: Number; audioMilliunitsPerSecond: Number; }> >; }> >;}>;Validates one model row of the host’s Media catalog.
mediaGenerationSelectionSchemaconstant
Section titled “mediaGenerationSelectionSchema”const mediaGenerationSelectionSchema: Struct<{ model: String; prompt: String; width: Number; height: Number; steps: optional<Number>; durationSeconds: optional<Number>; resolution: optional< Literals<readonly ["480p", "720p", "768p", "1080p", "4k"]> >; aspectRatio: optional< Literals<readonly ["16:9", "4:3", "1:1", "3:4", "9:16", "21:9", "9:21"]> >; generateAudio: optional<Boolean>; references: optional< $Array< Struct<{ path: String; role: optional< Literals<readonly ["first-frame", "last-frame", "reference"]> >; }> > >;}>;Validates the shape of an App’s generation settings. Model-specific limits (sizes, steps, durations, reference counts) and defaults are the host’s: it checks the selection against its catalog when it accepts a generation.
mediaGenerationFailureSchemaconstant
Section titled “mediaGenerationFailureSchema”const mediaGenerationFailureSchema: Struct<{ message: String; stage: optional< Literals< readonly [ "admission", "generation-authorization", "settings", "estimate", "billing", "operation", "provider", "normalization", "artifact", "destination-authorization", "destination-write", ] > >; provider: optional< Union< readonly [ Struct<{ category: Literals< readonly [ "InferenceUpstreamError", "AiInternalError", "TypeError", "AbortError", "TimeoutError", "Error", ] >; code: NullOr<Int>; }>, Struct<{ category: Literal<"result_download">; status: Int; }>, ] > >; code: Literals< readonly [ "CANCELLED", "CAPABILITY_DENIED", "CAPABILITY_REVOKED", "DISCONNECTED", "HOST_FAILURE", "IDENTITY", "INSUFFICIENT_CREDIT", "INVALID_ARGUMENT", "PROTOCOL", "SAFETY_FILTER_REFUSED", "TIMEOUT", ] >; retryable: Boolean;}>;Validates the typed failure a host reports for a generation attempt.
mediaGenerationconstant
Section titled “mediaGeneration”const mediaGeneration: CapabilityContract<MediaGenerationHandle>;Capability contract for generating Media (images or video). Apps declare it to request access; openMediaGeneration uses it to obtain the host’s handle.
pendingSchemaconstant
Section titled “pendingSchema”const pendingSchema: ZodObject< { kind: ZodLiteral<"pending">; retryAfterMs: ZodNumber; }, $strict>;An opted-in App method is still working; poll again after this bounded delay.
APP_STATUS_ITEMS_MAXconstant
Section titled “APP_STATUS_ITEMS_MAX”const APP_STATUS_ITEMS_MAX: 6 = 6;The most readouts one App window’s status bar shows.
APP_STATUS_TEXT_MAXconstant
Section titled “APP_STATUS_TEXT_MAX”const APP_STATUS_TEXT_MAX: 80 = 80;The longest readout a window’s status bar shows.
APP_STATUS_OPTIONS_MAXconstant
Section titled “APP_STATUS_OPTIONS_MAX”const APP_STATUS_OPTIONS_MAX: 16 = 16;The most choices one status menu offers.
APP_BROWSER_SAVE_MAX_BYTESconstant
Section titled “APP_BROWSER_SAVE_MAX_BYTES”const APP_BROWSER_SAVE_MAX_BYTES: number;Maximum file size sent through the user-initiated host browser door.
APP_BROWSER_COPY_MAX_BYTESconstant
Section titled “APP_BROWSER_COPY_MAX_BYTES”const APP_BROWSER_COPY_MAX_BYTES: number;Maximum UTF-8 text size sent to the host clipboard.
APP_NAVIGATION_CONTRACT_VERSIONconstant
Section titled “APP_NAVIGATION_CONTRACT_VERSION”const APP_NAVIGATION_CONTRACT_VERSION: 1;Version of the navigation contract an App publishes. The host rejects any other version, so a future shape can never be misread as this one.
APP_NAVIGATION_TITLE_MAXconstant
Section titled “APP_NAVIGATION_TITLE_MAX”const APP_NAVIGATION_TITLE_MAX: 80 = 80;The longest page title a host shows beside the App’s own name.
APP_NAVIGATION_CRUMBS_MAXconstant
Section titled “APP_NAVIGATION_CRUMBS_MAX”const APP_NAVIGATION_CRUMBS_MAX: 8 = 8;The most crumbs one navigation report may carry.
APP_NAVIGATION_SIBLINGS_MAXconstant
Section titled “APP_NAVIGATION_SIBLINGS_MAX”const APP_NAVIGATION_SIBLINGS_MAX: 16 = 16;The most siblings one switcher crumb may offer.
APP_NAVIGATION_PRIMARY_MAXconstant
Section titled “APP_NAVIGATION_PRIMARY_MAX”const APP_NAVIGATION_PRIMARY_MAX: 3 = 3;The most primary header commands one report may carry.
APP_NAVIGATION_STATUS_MAXconstant
Section titled “APP_NAVIGATION_STATUS_MAX”const APP_NAVIGATION_STATUS_MAX: 4 = 4;The most header status facts one report may carry.
APP_NAVIGATION_MENU_MAXconstant
Section titled “APP_NAVIGATION_MENU_MAX”const APP_NAVIGATION_MENU_MAX: 12 = 12;The most ⋯ menu commands one report may carry.
APP_NAVIGATION_LABEL_MAXconstant
Section titled “APP_NAVIGATION_LABEL_MAX”const APP_NAVIGATION_LABEL_MAX: 80 = 80;The longest crumb or command label a host shows.
inertHostNavigationconstant
Section titled “inertHostNavigation”const inertHostNavigation: HostNavigation;Navigation for a root with no host chrome, such as a workbench fixture: it accepts every report and never asks the App to go back.
resultRowSchemaV1constant
Section titled “resultRowSchemaV1”const resultRowSchemaV1: Schema.Struct<{ media: Schema.optional< Schema.Struct<{ path: Schema.String; format: Schema.Literals<readonly ["fungi:image", "fungi:video"]>; }> >; id: Schema.String; title: Schema.String; detail: Schema.optional<Schema.String>; tone: Schema.optional< Schema.Literals< readonly ["attention", "running", "error", "settled", "muted"] > >; status: Schema.optional< Schema.Struct<{ label: Schema.String; tone: Schema.Literals< readonly [ "neutral", "primary", "secondary", "accent", "success", "info", "warning", "error", ] >; }> >; open: Schema.optional< Schema.Struct<{ params: Schema.$Array< Schema.Struct<{ key: Schema.String; value: Schema.String; }> >; }> >;}>;A finished App call as a person reads it: a shared row plus an optional thumbnail.
messageAuthor()function
Section titled “messageAuthor()”function messageAuthor(meta): | { id: string; name: string; kind?: "agent"; } | undefined;The author a message’s metadata names; none for anything else.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
meta |
MessageMetaValue | undefined |
Returns
Section titled “Returns”Type Literal
Section titled “Type Literal”{ id: string; name: string; kind?: "agent";}| Name | Type | Description |
|---|---|---|
id |
string |
- |
name |
string |
- |
kind? |
"agent" |
Present only when the author is another Agent the host admitted a delegated send or reply from; a line’s text never sets it. Human and host/system authors carry no kind. |
undefined
messageDelegationReply()function
Section titled “messageDelegationReply()”function messageDelegationReply(meta): | { agentId: string; sessionId: string; commandId: string; outcome: | "completed" | "failed" | "interrupted" | "cancelled" | "outcome_unknown"; diagnostic?: string; waitingOnYou?: object[]; } | undefined;The authenticated delegation reply a message’s metadata carries; none for any other line, including text that merely looks like a reply.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
meta |
MessageMetaValue | undefined |
Returns
Section titled “Returns”Type Literal
Section titled “Type Literal”{ agentId: string; sessionId: string; commandId: string; outcome: "completed" | "failed" | "interrupted" | "cancelled" | "outcome_unknown"; diagnostic?: string; waitingOnYou?: object[];}| Name | Type | Default value | Description |
|---|---|---|---|
agentId |
string |
identifier |
- |
sessionId |
string |
identifier |
- |
commandId |
string |
identifier |
- |
outcome |
"completed" | "failed" | "interrupted" | "cancelled" | "outcome_unknown" |
- | The exact settlement outcome; failures are never collapsed. |
diagnostic? |
string |
- | Bounded, single-line terminal diagnostic for work that did not complete. |
waitingOnYou? |
object[] |
- | Open items of the replying Session that now wait on the recipient. |
undefined
authorMeta()function
Section titled “authorMeta()”function authorMeta(author): AuthorMeta;The metadata the host attaches for one authenticated author.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
author |
{ id: string; name: string; kind?: "agent"; } |
- |
author.id |
string |
- |
author.name |
string |
- |
author.kind? |
"agent" |
Present only when the author is another Agent the host admitted a delegated send or reply from; a line’s text never sets it. Human and host/system authors carry no kind. |
Returns
Section titled “Returns”renameAppAgent()function
Section titled “renameAppAgent()”function renameAppAgent( capabilities, input,): Promise<{ agentId: string; name: string; avatar: { v: 1; character: "mushroom" | "cat" | "burger"; appearance: z.ZodRecord< z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]> >; expression: string; renderStyle: | "plain" | "pencil" | "manga" | "riso" | "halftone" | "blueprint" | "crt" | "watercolor"; }; sessionOperations: readonly ("agent.manage" | "agent.read" | "agent.send")[];}>;Rename an Agent through the host-granted owner-only capability.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
capabilities |
CapabilityDirectory |
input |
AppAgentRenameInput |
Returns
Section titled “Returns”Promise<{ agentId: string; name: string; avatar: { v: 1;
character: "mushroom" | "cat" | "burger"; appearance:
z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString,
z.ZodNumber, z.ZodBoolean]>>; expression: string; renderStyle: |
"plain" | "pencil" | "manga" | "riso" | "halftone" |
"blueprint" | "crt" | "watercolor"; }; sessionOperations: readonly
("agent.manage" | "agent.read" | "agent.send")[]; }>
setAppAgentAvatar()function
Section titled “setAppAgentAvatar()”function setAppAgentAvatar( capabilities, input,): Promise<{ agentId: string; name: string; avatar: { v: 1; character: "mushroom" | "cat" | "burger"; appearance: z.ZodRecord< z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]> >; expression: string; renderStyle: | "plain" | "pencil" | "manga" | "riso" | "halftone" | "blueprint" | "crt" | "watercolor"; }; sessionOperations: readonly ("agent.manage" | "agent.read" | "agent.send")[];}>;Change an Agent’s avatar through the host-granted owner-only capability.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
capabilities |
CapabilityDirectory |
input |
AppAgentAvatarInput |
Returns
Section titled “Returns”Promise<{ agentId: string; name: string; avatar: { v: 1;
character: "mushroom" | "cat" | "burger"; appearance:
z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString,
z.ZodNumber, z.ZodBoolean]>>; expression: string; renderStyle: |
"plain" | "pencil" | "manga" | "riso" | "halftone" |
"blueprint" | "crt" | "watercolor"; }; sessionOperations: readonly
("agent.manage" | "agent.read" | "agent.send")[]; }>
listAppAgents()function
Section titled “listAppAgents()”function listAppAgents(capabilities): Promise<readonly object[]>;List the Agents in the host-granted Team or local-project scope.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
capabilities |
CapabilityDirectory |
Returns
Section titled “Returns”Promise<readonly object[]>
createAppAgent()function
Section titled “createAppAgent()”function createAppAgent( capabilities, input,): Promise<{ agentId: string; name: string; avatar: { v: 1; character: "mushroom" | "cat" | "burger"; appearance: z.ZodRecord< z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]> >; expression: string; renderStyle: | "plain" | "pencil" | "manga" | "riso" | "halftone" | "blueprint" | "crt" | "watercolor"; }; sessionOperations: readonly ("agent.manage" | "agent.read" | "agent.send")[];}>;Create an Agent through the Team directory selected by the host.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
capabilities |
CapabilityDirectory |
input |
AppAgentCreateInput |
Returns
Section titled “Returns”Promise<{ agentId: string; name: string; avatar: { v: 1;
character: "mushroom" | "cat" | "burger"; appearance:
z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString,
z.ZodNumber, z.ZodBoolean]>>; expression: string; renderStyle: |
"plain" | "pencil" | "manga" | "riso" | "halftone" |
"blueprint" | "crt" | "watercolor"; }; sessionOperations: readonly
("agent.manage" | "agent.read" | "agent.send")[]; }>
openAppAgent()function
Section titled “openAppAgent()”function openAppAgent( capabilities, input,): Promise< Readonly<{ baseUrl: string; fetch: { (input, init?): Promise<Response>; (input, init?): Promise<Response>; }; close: () => Promise<void>; }>>;Adapt one live object capability to Fetch without exposing the parent’s authenticated URL or credentials to the isolated App.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
capabilities |
CapabilityDirectory |
input |
{ agentId: string; } |
input.agentId |
string |
Returns
Section titled “Returns”Promise<Readonly<{ baseUrl: string; fetch: { (input, init?):
Promise<Response>; (input, init?): Promise<Response>; };
close: () => Promise<void>; }>>
defineCapability()function
Section titled “defineCapability()”function defineCapability<T>(id, version, schema): CapabilityContract<T>;Define a capability with the owner’s decoder for its live RPC interface.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
id |
string |
version |
number |
schema |
ZodType<T> |
Returns
Section titled “Returns”createCapabilityRegistry()function
Section titled “createCapabilityRegistry()”function createCapabilityRegistry(): CapabilityRegistry;Register typed local implementations without reopening their erased types.
Returns
Section titled “Returns”registerCatalog()function
Section titled “registerCatalog()”function registerCatalog(commands, catalog): Disposer;Register one App’s Whistle catalog with its host. An App defines each command once, contributes the same catalog to its own composer runtime for slash commands, and registers it here so the shell projects it into the palette, menus, keys and the agent view. Availability is read once at registration; register again to publish a change.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
commands |
AppCommands |
The App’s host command door, app.commands. |
catalog |
readonly Readonly<{ id: string; title: string; category: string; description?: string; projections?: { bindings?: { order?: number; values: readonly string[]; }; agent?: { keybind?: string; order?: number; }; help?: { order?: number; }; menu?: { order?: number; }; palette?: { order?: number; }; slash?: { aliases: readonly string[]; consumesDraft?: boolean; order?: number; arguments?: { hint: string; words?: readonly …[]; text?: { field: …; arguments: …; requestIdField?: …; }; }; }; }; action?: { inputSchema?: { [key: string]: | string | number | boolean | readonly string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | … 4 more … | null)[] | { …; } | null)[] | { …; } | null)[] | { …; } | …[] | { [key: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | … 4 more … | null)[] | { …; } | null)[] | { …; } | null)[] | { …; } | …; } | null; }; outputSchema?: { [key: string]: | string | number | boolean | readonly string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | … 4 more … | null)[] | { …; } | null)[] | { …; } | null)[] | { …; } | …[] | { [key: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | … 4 more … | null)[] | { …; } | null)[] | { …; } | null)[] | { …; } | …; } | null; }; presentation?: | { type: "action"; } | { type: "custom"; data: { [key: string]: | string | number | boolean | readonly string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | … 4 more … | null)[] | { …; } | null)[] | { …; } | null)[] | { …; } | …[] | { [key: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | … 4 more … | null)[] | { …; } | null)[] | { …; } | null)[] | { …; } | …; } | null; }; } | { type: "choice"; options: readonly object[]; } | { type: "form"; submitLabel?: string; } | { type: "confirmation"; message: string; confirmLabel?: string; cancelLabel?: string; }; }; availability?: () => WhistleAvailability; handler: (input) => unknown; }>[] |
The App’s Whistle commands, handlers included. |
Returns
Section titled “Returns”Release every registration made by this call.
connectApp()function
Section titled “connectApp()”function connectApp(options): Promise<AppRoot>;Connects this iframe page to its authenticated host.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
ConnectAppOptions |
Returns
Section titled “Returns”Promise<AppRoot>
openMediaGeneration()function
Section titled “openMediaGeneration()”function openMediaGeneration(capabilities): Promise< Readonly<{ computerId: string; canGenerate: boolean; models: readonly object[]; createAttempt: Promise<MediaGenerationAttempt>; restoreAttempt: Promise<MediaGenerationAttempt>; }>>;Discover the exact retained model catalog surfaced by the owner.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
capabilities |
CapabilityDirectory |
Returns
Section titled “Returns”Promise<Readonly<{ computerId: string; canGenerate: boolean;
models: readonly object[]; createAttempt:
Promise<MediaGenerationAttempt>;
restoreAttempt:
Promise<MediaGenerationAttempt>; }>>
pending()function
Section titled “pending()”function pending(retryAfterMs): Pending;Return Pending with a polling delay between one and sixty seconds.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
retryAfterMs |
number |
Returns
Section titled “Returns”statusText()function
Section titled “statusText()”function statusText(value, max?): string;Make person- or Computer-supplied text fit one status item: drop unsafe characters, collapse whitespace and shorten with an ellipsis.
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
value |
string |
undefined |
max |
number |
APP_STATUS_TEXT_MAX |
Returns
Section titled “Returns”string
statusActionAllowed()function
Section titled “statusActionAllowed()”function statusActionAllowed(items, action): boolean;Whether an action names something the App declares now: an enabled item, and for a menu exactly one enabled option. Every hop that delivers an action applies this rule against its own latest copy of the items.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
items |
readonly AppStatusItem[] |
action |
AppStatusAction |
Returns
Section titled “Returns”boolean
navigationActivationAllowed()function
Section titled “navigationActivationAllowed()”function navigationActivationAllowed(state, activation): boolean;Whether an activation names something the App published now: a crumb (and its sibling), or an enabled command. Every hop applies this rule against its own latest copy of the report, so a stale shell cannot reach the App.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
state |
AppNavigationState |
activation |
AppNavigationActivation |
Returns
Section titled “Returns”boolean
References
Section titled “References”AppError
Section titled “AppError”Re-exports AppError
AppDeliveryPending
Section titled “AppDeliveryPending”Re-exports AppDeliveryPending
AppErrorCode
Section titled “AppErrorCode”Re-exports AppErrorCode
AppErrorOptions
Section titled “AppErrorOptions”Re-exports AppErrorOptions
appStorage
Section titled “appStorage”Re-exports appStorage
AppStorageError
Section titled “AppStorageError”Re-exports AppStorageError
AppStorage
Section titled “AppStorage”Re-exports AppStorage
AppStorageWatch
Section titled “AppStorageWatch”Re-exports AppStorageWatch
AppStorageWrite
Section titled “AppStorageWrite”Re-exports AppStorageWrite
AppStorageReset
Section titled “AppStorageReset”Re-exports AppStorageReset
ResolvedAppStorage
Section titled “ResolvedAppStorage”Re-exports ResolvedAppStorage