[**@fungi.computer/agar**](README.md) --- [@fungi.computer/agar](modules.md) / index # index ## Type Aliases ### FungiAuthor ```ts type FungiAuthor = z.infer; ``` Who a Session line came from, as the admitting host authenticated them. --- ### FungiDelegationReply ```ts type FungiDelegationReply = z.infer; ``` A delegated Agent's reply as the admitting host authenticated it. --- ### FungiMessageMeta ```ts type FungiMessageMeta = z.infer; ``` The metadata the host attaches to every prompt and operator line it admits. --- ### MessageMetaValue ```ts type MessageMetaValue = | string | number | boolean | null | readonly MessageMetaValue[] | Readonly<{ [key: string]: MessageMetaValue; }>; ``` Any JSON value, as Shiitake returns a message's metadata. --- ### AuthorMeta ```ts type AuthorMeta = Readonly<{ author: Readonly<{ [K in keyof FungiAuthor]: Exclude; }>; }>; ``` The metadata the host attaches for one authenticated author, as JSON. --- ### AgentStopAllResult ```ts type AgentStopAllResult = z.infer; ``` The confirmed outcome of one Stop all. --- ### AppAgent ```ts type AppAgent = Schema.Schema.Type; ``` An Agent record as decoded from the host: its id, display name, and which session operations this App is permitted to perform on it. --- ### AppAgentCreateInput ```ts type AppAgentCreateInput = Readonly< Schema.Schema.Type >; ``` 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). --- ### AppAgentTransportHandle ```ts type AppAgentTransportHandle = object; ``` Live object-capability shape received from Cap'n Web. #### Methods ##### fetch() ```ts fetch(request): Promise; ``` Send one request to the Agent's session endpoint. ###### Parameters | Parameter | Type | | --------- | --------- | | `request` | `Request` | ###### Returns `Promise`\<`Response`\> ##### close() ```ts close(): Promise; ``` Release the underlying object capability. ###### Returns `Promise`\<`void`\> ##### \[dispose\]() ```ts dispose: void; ``` Synchronously release local resources, for `using` disposal. ###### Returns `void` --- ### AppAgentListHandle ```ts type AppAgentListHandle = object; ``` Capability handle for listing the Agents in a directory. #### Methods ##### list() ```ts list(): Promise; ``` List the Agents visible to this App in the directory. ###### Returns `Promise`\ --- ### AppAgentCreateHandle ```ts type AppAgentCreateHandle = object; ``` Capability handle for creating a new Agent in a directory. #### Methods ##### create() ```ts create(input): Promise<{ agentId: string; name: string; avatar: { v: z.ZodLiteral<1>; character: z.ZodEnum<{ mushroom: "mushroom"; cat: "cat"; burger: "burger"; }>; appearance: z.ZodRecord>; 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 | Parameter | Type | | --------- | --------------------------------------------- | | `input` | [`AppAgentCreateInput`](#appagentcreateinput) | ###### 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`\\>; `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"`)[]; \}\> ##### computers() ```ts computers(): Promise; ``` The Team Computers a new Agent may use; null when the host offers no choice. ###### Returns `Promise`\ --- ### AppAgentDirectoryHandle ```ts 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 | Name | Type | Description | | ------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------- | | `open()` | (`input`) => `Promise`\<[`AppAgentTransportHandle`](#appagenttransporthandle)\> | Open a transport to the Agent identified by `agentId`. | | `openInbox()` | () => `Promise`\<[`AppAgentTransportHandle`](#appagenttransporthandle)\> | The member's inbox feed, limited to Agents this App may read. | --- ### AppAgentRenameInput ```ts type AppAgentRenameInput = Readonly< Schema.Schema.Type >; ``` Input for renaming an existing Agent: its id and the owner's chosen replacement display name. --- ### AppAgentRenameHandle ```ts type AppAgentRenameHandle = object; ``` Capability handle for renaming an Agent the owner already created. #### Methods ##### rename() ```ts rename(input): Promise<{ agentId: string; name: string; avatar: { v: z.ZodLiteral<1>; character: z.ZodEnum<{ mushroom: "mushroom"; cat: "cat"; burger: "burger"; }>; appearance: z.ZodRecord>; 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 | Parameter | Type | | --------- | --------------------------------------------- | | `input` | [`AppAgentRenameInput`](#appagentrenameinput) | ###### 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`\\>; `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"`)[]; \}\> --- ### AppAgentStopInput ```ts type AppAgentStopInput = Readonly< Schema.Schema.Type >; ``` Input for Stop all: the Agent to stop along with every Agent it spawned. --- ### AppAgentStopHandle ```ts type AppAgentStopHandle = object; ``` Capability handle for stopping an Agent and the Agents it spawned. #### Methods ##### stopAll() ```ts stopAll(input): Promise<{ rootAgentId: string; agents: ( | { agentId: string; name: string; outcome: "stopped" | "idle"; } | { agentId: string; name: string; outcome: "failed"; reason: string; })[]; discoveryFailures: object[]; notPermitted: number; }>; ``` Stop the Agent and its helpers, helpers first, and report each one. ###### Parameters | Parameter | Type | | --------- | ----------------------------------------- | | `input` | [`AppAgentStopInput`](#appagentstopinput) | ###### Returns `Promise`\<\{ `rootAgentId`: `string`; `agents`: ( \| \{ `agentId`: `string`; `name`: `string`; `outcome`: `"stopped"` \| `"idle"`; \} \| \{ `agentId`: `string`; `name`: `string`; `outcome`: `"failed"`; `reason`: `string`; \})[]; `discoveryFailures`: `object`[]; `notPermitted`: `number`; \}\> --- ### AppAgentAvatarInput ```ts type AppAgentAvatarInput = Readonly< Schema.Schema.Type >; ``` Input for changing an existing Agent's avatar. --- ### AppAgentAvatarHandle ```ts type AppAgentAvatarHandle = object; ``` Capability handle for changing an Agent's avatar. #### Methods ##### setAvatar() ```ts setAvatar(input): Promise<{ agentId: string; name: string; avatar: { v: z.ZodLiteral<1>; character: z.ZodEnum<{ mushroom: "mushroom"; cat: "cat"; burger: "burger"; }>; appearance: z.ZodRecord>; 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 | Parameter | Type | | --------- | --------------------------------------------- | | `input` | [`AppAgentAvatarInput`](#appagentavatarinput) | ###### 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`\\>; `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"`)[]; \}\> --- ### AppAgentInstructions ```ts type AppAgentInstructions = Readonly< Schema.Schema.Type >; ``` One Agent's AGENTS.md. --- ### AppAgentInstructionsSetInput ```ts type AppAgentInstructionsSetInput = Readonly< Schema.Schema.Type >; ``` Input for replacing one Agent's AGENTS.md. --- ### AppAgentInstructionsHandle ```ts type AppAgentInstructionsHandle = object; ``` Capability handle for reading and replacing an Agent's AGENTS.md. #### Methods ##### read() ```ts read(input): Promise>; ``` Read the AGENTS.md on this Agent's Home Computer. ###### Parameters | Parameter | Type | | --------- | ---------------------------------------------------------------------------------------------------------------------------- | | `input` | `Readonly`\<`Schema.Schema.Type`\<_typeof_ [`appAgentInstructionsReadInputSchema`](#appagentinstructionsreadinputschema)\>\> | ###### Returns `Promise`\<`Readonly`\<\{ `agentId`: `string`; `home`: \| \{ `name`: `string`; \} \| `null`; `content`: `string` \| `null`; `bytes`: `number`; `limit`: `number`; \}\>\> ##### set() ```ts set(input): Promise>; ``` Replace it. The Agent reads the file on its next run, after the host's own instructions. ###### Parameters | Parameter | Type | | --------- | --------------------------------------------------------------- | | `input` | [`AppAgentInstructionsSetInput`](#appagentinstructionssetinput) | ###### Returns `Promise`\<`Readonly`\<\{ `agentId`: `string`; `home`: \| \{ `name`: `string`; \} \| `null`; `content`: `string` \| `null`; `bytes`: `number`; `limit`: `number`; \}\>\> --- ### AppAgentToolPolicyStatus ```ts type AppAgentToolPolicyStatus = z.infer; ``` Whether an Agent's App tools are still pending the owner's approval. --- ### AppAgentToolPolicyResult ```ts type AppAgentToolPolicyResult = z.infer; ``` The outcome of an owner's direct App-tool approval. --- ### AppAgentToolPolicyHandle ```ts type AppAgentToolPolicyHandle = object; ``` Capability handle for reading and approving an Agent's App-tool policy. #### Methods ##### status() ```ts 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 | Parameter | Type | | --------------- | -------------------------- | | `input` | \{ `agentId`: `string`; \} | | `input.agentId` | `string` | ###### Returns `Promise`\< \| \{ `status`: `"pending"`; `revision`: `string`; \} \| \{ `status`: `"approved"`; `revision`: `string`; \} \| `null`\> ##### approve() ```ts 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 | Parameter | Type | | ------------------------ | -------------------------------------------------------------------------------------------------- | | `input` | \{ `agentId`: `string`; `level`: `"read"` \| `"write"`; `expectedRevision`: `string` \| `null`; \} | | `input.agentId` | `string` | | `input.level` | `"read"` \| `"write"` | | `input.expectedRevision` | `string` \| `null` | ###### Returns `Promise`\< \| \{ `status`: `"pending"`; `revision`: `string`; \} \| \{ `status`: `"approved"`; `revision`: `string`; \} \| \{ `error`: `string`; \}\> --- ### AppAgentExtension ```ts type AppAgentExtension = z.infer; ``` One hosted extension an Agent has attached, or could attach. --- ### AppAgentExtensions ```ts type AppAgentExtensions = z.infer; ``` An Agent's hosted extensions. --- ### AppAgentExtensionsResult ```ts type AppAgentExtensionsResult = z.infer; ``` The outcome of attaching or detaching a hosted extension. --- ### AppAgentExtensionsHandle ```ts type AppAgentExtensionsHandle = object; ``` Capability handle for the owner's hosted-extension attachments on an Agent. #### Methods ##### list() ```ts list(input): Promise< | { agentId: string; attached: object[]; available: object[]; } | null>; ``` This Agent's extensions, or `null` for no such Agent. ###### Parameters | Parameter | Type | | --------------- | -------------------------- | | `input` | \{ `agentId`: `string`; \} | | `input.agentId` | `string` | ###### Returns `Promise`\< \| \{ `agentId`: `string`; `attached`: `object`[]; `available`: `object`[]; \} \| `null`\> ##### attach() ```ts attach(input): Promise< | { agentId: string; attached: object[]; available: object[]; } | { error: "not_found" | "not_granted" | "not_extension"; }>; ``` Attach an installed extension to this Agent. ###### Parameters | Parameter | Type | | ---------------------- | ------------------------------------------------------ | | `input` | \{ `agentId`: `string`; `installationId`: `string`; \} | | `input.agentId` | `string` | | `input.installationId` | `string` | ###### Returns `Promise`\< \| \{ `agentId`: `string`; `attached`: `object`[]; `available`: `object`[]; \} \| \{ `error`: `"not_found"` \| `"not_granted"` \| `"not_extension"`; \}\> ##### detach() ```ts detach(input): Promise< | { agentId: string; attached: object[]; available: object[]; } | { error: "not_found" | "not_granted" | "not_extension"; }>; ``` Detach it. Detaching only ever removes authority. ###### Parameters | Parameter | Type | | ---------------------- | ------------------------------------------------------ | | `input` | \{ `agentId`: `string`; `installationId`: `string`; \} | | `input.agentId` | `string` | | `input.installationId` | `string` | ###### Returns `Promise`\< \| \{ `agentId`: `string`; `attached`: `object`[]; `available`: `object`[]; \} \| \{ `error`: `"not_found"` \| `"not_granted"` \| `"not_extension"`; \}\> --- ### AppAgentTransport ```ts type AppAgentTransport = Readonly<{ baseUrl: string; fetch: typeof globalThis.fetch; close: () => Promise; }>; ``` A Fetch-based transport to one Agent's session endpoint, scoped to this App and safe to hand to an HTTP client adapter. --- ### CapabilityContract ```ts type CapabilityContract = object; ``` A capability owner's frozen, typed descriptor. Descriptor identity is not authority. #### Type Parameters | Type Parameter | | -------------- | | `T` | #### Properties ##### id ```ts readonly id: string; ``` ##### version ```ts readonly version: number; ``` ##### schema ```ts readonly schema: z.ZodType; ``` --- ### CapabilityDirectory ```ts type CapabilityDirectory = object; ``` The App's read-only view of its currently admitted capabilities. #### Properties ##### version ```ts readonly version: number; ``` Changes after a successful grant replacement or disconnection. #### Methods ##### subscribe() ```ts subscribe(listener): Disposer; ``` Read the current directory after a change. Does not emit on subscribe. ###### Parameters | Parameter | Type | | ---------- | ------------ | | `listener` | () => `void` | ###### Returns [`Disposer`](#disposer) ##### has() ```ts has(contract): boolean; ``` Whether an implementation for this contract is currently admitted. ###### Parameters | Parameter | Type | | ---------- | -------------------------------------------------------- | | `contract` | [`CapabilityContract`](#capabilitycontract)\<`unknown`\> | ###### Returns `boolean` ##### require() ```ts require(contract): T; ``` The admitted implementation for this contract, or throw a `CAPABILITY_DENIED` AppError when none is granted. ###### Type Parameters | Type Parameter | | -------------- | | `T` | ###### Parameters | Parameter | Type | | ---------- | -------------------------------------------------- | | `contract` | [`CapabilityContract`](#capabilitycontract)\<`T`\> | ###### Returns `T` --- ### CapabilityRegistry ```ts type CapabilityRegistry = CapabilityDirectory & object; ``` Local capabilities admitted through their owner's typed contract. #### 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. | --- ### AppCommand ```ts type AppCommand = WhistleCommandDefinition; ``` Semantic command metadata supplied by an App and owned by Whistle. --- ### AppCommandHandler ```ts type AppCommandHandler = ( invocation, ) => Promise | WhistleJsonValue | undefined; ``` One invocation's semantic input; host correlation IDs are private. #### Parameters | Parameter | Type | | ------------ | ----------------------------------------------- | | `invocation` | [`AppCommandInvocation`](#appcommandinvocation) | #### Returns \| `Promise`\<`WhistleJsonValue` \| `undefined`\> \| `WhistleJsonValue` \| `undefined` --- ### AppCommandInvocation ```ts type AppCommandInvocation = object; ``` One command invocation's semantic input, passed to its handler. #### Properties ##### arguments? ```ts readonly optional arguments?: WhistleJsonValue; ``` ##### origin ```ts readonly origin: WhistleExecutionOrigin; ``` ##### signal ```ts readonly signal: AbortSignal; ``` --- ### AppCommands ```ts 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 ##### register() ```ts register(command, handler): Promise; ``` Register one command and its handler with the host; resolves once the host accepts it. Call the returned Disposer to unregister. ###### 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`\\>\>; \}, `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`\\>\>; \}, `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`](#appcommandhandler) | ###### Returns `Promise`\<[`Disposer`](#disposer)\> --- ### ConnectAppOptions ```ts type ConnectAppOptions = object; ``` Options for connecting this iframe page to its authenticated host. #### Properties ##### host ```ts 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? ```ts readonly optional signal?: AbortSignal; ``` Cancels a pending connection attempt. --- ### AppHistorySnapshot ```ts type AppHistorySnapshot = Readonly<{ current: Entry; canGoBack: boolean; canGoForward: boolean; }>; ``` What an App's history can do right now; publish these as `canGoBack` and `canGoForward`. #### Type Parameters | Type Parameter | | -------------- | | `Entry` | --- ### AppHistory ```ts type AppHistory = ReadonlyStore> & object; ``` An App's own history: a back stack and a forward stack around the current entry. The browser's history is not available to an App because its iframe shares the Hub tab, so an App that has no router of its own keeps this. #### Type Declaration | Name | Type | Description | | ----------- | ------------------- | -------------------------------------------------------------------- | | `push()` | (`entry`) => `void` | Go to a new place; whatever Forward could reach is dropped. | | `replace()` | (`entry`) => `void` | Swap the current place without adding a step. | | `back()` | () => `boolean` | Step back; `false` when there is nowhere to go. Fits `onBack`. | | `forward()` | () => `boolean` | Step forward; `false` when there is nowhere to go. Fits `onForward`. | #### Type Parameters | Type Parameter | | -------------- | | `Entry` | --- ### AppProtocolVersion ```ts type AppProtocolVersion = (typeof APP_PROTOCOL_VERSIONS)[number]; ``` A protocol version supported by both the App and host adapters. --- ### AppConnectMessage ```ts type AppConnectMessage = object; ``` The host's handshake message that hands the App its RPC MessagePort. #### Properties ##### epoch ```ts readonly epoch: string; ``` ##### protocolVersion ```ts readonly protocolVersion: AppProtocolVersion; ``` ##### type ```ts readonly type: typeof APP_CONNECT_TYPE; ``` --- ### AppReadyMessage ```ts type AppReadyMessage = | { protocolVersion: typeof APP_PROTOCOL_VERSION; type: typeof APP_READY_TYPE; } | { protocolVersion: 2; type: typeof APP_READY_V2_TYPE; }; ``` The App iframe's handshake message announcing it is ready to connect. --- ### SetupState ```ts type SetupState = "ready" | "missing" | "unknown"; ``` Whether one thing an App needs is available: `unknown` means the host has not checked. --- ### AppSetup ```ts type AppSetup = Readonly<{ models: SetupState; media: SetupState; git: SetupState; terminal: "ready" | "exec-only" | "missing" | "unknown"; terminalReason?: string; }>; ``` The host's up-front answer to "can this App work here?". Absent on hosts that do not publish it; Apps treat absence as `unknown` for every field. --- ### SetupNeed ```ts type SetupNeed = "model" | "media" | "git" | "computer"; ``` What an App can ask its host to help the person set up. --- ### SetupOutcome ```ts type SetupOutcome = "opened" | "unavailable"; ``` Whether the host opened its setup surface for the need. --- ### AppContext ```ts type AppContext = object; ``` The host-published state surrounding a connected App: its Computer selection, focus, visibility, and any pending open request. #### Properties ##### computerId ```ts readonly computerId: string | null; ``` Host-selected Computer backing this App's admitted resource capabilities. ##### computerName? ```ts readonly optional computerName?: string | null; ``` Host-published name of that Computer; null when unavailable. Replaced with the ID on selection changes. Absence does not imply an ID-based name. ##### teamHasComputers? ```ts readonly optional teamHasComputers?: boolean | null; ``` Whether the Team has Computers, when this host owns its Team directory. ##### computerAccessGranted? ```ts readonly optional computerAccessGranted?: boolean; ``` Whether this App has execute access across the Team, when known. ##### setup? ```ts readonly optional setup?: AppSetup; ``` Setup facts the host publishes and updates live; absent on older hosts. ##### permissions? ```ts readonly optional permissions?: AppPermissions; ``` Which declared rights this App holds, so it can offer "Approve access" up front instead of discovering a refusal. Updated after a permission request; absent on hosts that do not publish it (treat as unknown). ##### focus ```ts readonly focus: FocusState; ``` ##### openRequest ```ts readonly openRequest: AppOpenRequest | null; ``` One host-issued App open action, present only on the launch/reconfigure. ##### visibility ```ts readonly visibility: "hidden" | "visible"; ``` --- ### AppOpenRequest ```ts 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. --- ### AppIdentity ```ts type AppIdentity = object; ``` The App's own identity, as admitted by its host. #### Properties ##### appId ```ts readonly appId: string; ``` ##### releaseId ```ts readonly releaseId: string; ``` ##### surfaceId ```ts readonly surfaceId: string; ``` --- ### AppLifecycle ```ts type AppLifecycle = | "connected" | "connecting" | "disconnected" | "disposed" | "disposing" | "suspended"; ``` The connection state of this App's session with its host. --- ### FocusState ```ts type FocusState = object; ``` Whether the App's own surface is being edited and which surface, if any, the host considers focused. #### Properties ##### editing ```ts readonly editing: boolean; ``` ##### surface ```ts readonly surface: null | string; ``` --- ### MediaGenerationInput ```ts 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. --- ### MediaOutputFormat ```ts type MediaOutputFormat = "png" | "jpeg" | "gif" | "webp" | "mp4" | "mp3"; ``` The encodings a completed generation can be saved as. --- ### MediaGenerationResult ```ts 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 (none for audio), format, model used, and its cost. --- ### MediaGenerationQuote ```ts type MediaGenerationQuote = Readonly<{ costMilliunits: number; }>; ``` A host's price for one exact request. --- ### MediaGenerationFailure ```ts 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. --- ### MediaGenerationOutcome ```ts type MediaGenerationOutcome = | Readonly<{ kind: "succeeded"; result: MediaGenerationResult; }> | Readonly<{ kind: "failed"; failure: MediaGenerationFailure; }>; ``` Transport-safe result from the host-owned generation attempt. --- ### MediaGenerationHandle ```ts type MediaGenerationHandle = object; ``` Live object-capability shape supplied by the host. #### Methods ##### describe() ```ts describe(): Promise & object>; ``` Fetch the Computer scope, available models, and whether generation is currently allowed. ###### Returns `Promise`\<`Partial`\<`Disposable`\> & `object`\> ##### quote()? ```ts optional quote(settings): Promise & Readonly<{ costMilliunits: number; }>>; ``` Price one exact request without starting it; hosts that cannot omit it. ###### Parameters | Parameter | Type | Description | | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------- | | `settings` | \{ `model`: `string`; `prompt`: `string`; `width?`: `number`; `height?`: `number`; `voiceId?`: `string`; `steps?`: `number`; `durationSeconds?`: `number`; `targetMegapixels?`: `number`; `resolution?`: `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"`; `aspectRatio?`: `"16:9"` \| `"4:3"` \| `"1:1"` \| `"3:4"` \| `"9:16"` \| `"21:9"` \| `"9:21"`; `generateAudio?`: `boolean`; `references?`: readonly `object`[]; \} | - | | `settings.model` | `string` | - | | `settings.prompt` | `string` | Bounded by the host against the chosen model; speech models take the longest text. | | `settings.width?` | `number` | Picture and video size; audio has none. | | `settings.height?` | `number` | - | | `settings.voiceId?` | `string` | Speech models only: a catalog voice; the model's default when omitted. | | `settings.steps?` | `number` | - | | `settings.durationSeconds?` | `number` | - | | `settings.targetMegapixels?` | `number` | Upscale only: the output size in megapixels, one of the model's offered sizes. | | `settings.resolution?` | `"480p"` \| `"720p"` \| `"768p"` \| `"1080p"` \| `"4k"` | - | | `settings.aspectRatio?` | `"16:9"` \| `"4:3"` \| `"1:1"` \| `"3:4"` \| `"9:16"` \| `"21:9"` \| `"9:21"` | - | | `settings.generateAudio?` | `boolean` | - | | `settings.references?` | readonly `object`[] | - | ###### Returns `Promise`\<`Partial`\<`Disposable`\> & `Readonly`\<\{ `costMilliunits`: `number`; \}\>\> ##### createAttempt() ```ts createAttempt(): Promise; ``` Begin a new generation attempt on the host and return its handle. ###### Returns `Promise`\<[`MediaGenerationAttemptHandle`](#mediagenerationattempthandle)\> ##### restoreAttempt() ```ts restoreAttempt(reference): Promise; ``` Resume a previously started attempt identified by its reference. ###### Parameters | Parameter | Type | | ---------------------- | ---------------------------------------------------- | | `reference` | \{ `requestId`: `string`; `computerId`: `string`; \} | | `reference.requestId` | `string` | | `reference.computerId` | `string` | ###### Returns `Promise`\<[`MediaGenerationAttemptHandle`](#mediagenerationattempthandle)\> ##### cancelAttempt() ```ts cancelAttempt(reference): Promise; ``` Tell the host to stop an in-flight or pending attempt. ###### Parameters | Parameter | Type | | ---------------------- | ---------------------------------------------------- | | `reference` | \{ `requestId`: `string`; `computerId`: `string`; \} | | `reference.requestId` | `string` | | `reference.computerId` | `string` | ###### Returns `Promise`\<`void`\> --- ### MediaGenerationAttemptHandle ```ts type MediaGenerationAttemptHandle = Partial & object; ``` Host-supplied object-capability for one attempt, before Agar wraps it into the typed MediaGenerationAttempt. #### Type Declaration | Name | Type | Description | | ------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- | | `reference()` | () => `Promise`\<`object` & `Partial`\<`Disposable`\>\> | Fetch this attempt's replay reference from the host. | | `generate()` | (`input`) => `Promise`\<[`MediaGenerationOutcome`](#mediagenerationoutcome) & `Partial`\<`Disposable`\>\> | Ask the host to run generation for this attempt with the given input. | --- ### MediaGenerationAttempt ```ts type MediaGenerationAttempt = Disposable & object; ``` One generation attempt: a stable reference plus the ability to run (or retry) generation against it until disposed. #### Type Declaration | Name | Type | Description | | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | | `reference` | [`MediaGenerationReference`](#mediagenerationreference) | - | | `generate()` | (`input`, `options?`) => `Promise`\<`Readonly`\<\{ `bytes`: `number`; `costMilliunits`: `number`; `destination`: `Readonly`\<\{ `computerId`: `string`; `path`: `string`; \}\>; `format`: [`MediaOutputFormat`](#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. | --- ### MediaGenerationSession ```ts type MediaGenerationSession = Readonly<{ computerId: string; canGenerate: boolean; models: readonly MediaModel[]; quote: (settings) => Promise; createAttempt: Promise; restoreAttempt: Promise; }>; ``` The validated, App-facing handle returned by openMediaGeneration: the Computer's model catalog plus the ability to start or resume attempts. --- ### MediaGenerationReference ```ts type MediaGenerationReference = Schema.Schema.Type< typeof mediaGenerationReferenceSchema >; ``` An opaque replay identity for one attempt; it identifies a request, not an authorization to use it. --- ### MediaModel ```ts type MediaModel = Schema.Schema.Type; ``` One generation model as the host describes it: identity, tier, input limits and supported output formats. The host owns the catalog. --- ### MediaGenerationSelection ```ts type MediaGenerationSelection = Schema.Schema.Type< typeof mediaGenerationSelectionSchema >; ``` An App's generation settings: model, prompt, size and optional steps, duration and Computer-relative reference paths. --- ### MediaShareStatus ```ts type MediaShareStatus = z.output; ``` A Print's share state as the host reports it. --- ### MediaShareInput ```ts type MediaShareInput = z.output; ``` What to share and whether to show its prompt. --- ### MediaShareHandle ```ts type MediaShareHandle = Readonly<{ status: Promise< | { shared: false; } | { shared: true; url: string; showPrompt: boolean; } >; share: Promise< | { shared: false; } | { shared: true; url: string; showPrompt: boolean; } >; stop: Promise< | { shared: false; } | { shared: true; url: string; showPrompt: boolean; } >; }>; ``` Host handle behind the `media.share` capability. --- ### Pending ```ts type Pending = Readonly>; ``` The shared polling result, owned by the App contract. --- ### AppRoot ```ts 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 ##### capabilities ```ts readonly capabilities: CapabilityDirectory; ``` ##### commands ```ts readonly commands: AppCommands; ``` ##### context ```ts readonly context: ReadonlyStore; ``` ##### identity ```ts readonly identity: Readonly; ``` ##### lifecycle ```ts readonly lifecycle: ReadonlyStore; ``` ##### theme ```ts readonly theme: ReadonlyStore; ``` ##### ui ```ts readonly ui: HostUi; ``` ##### window ```ts readonly window: AppWindow; ``` #### Methods ##### dispose() ```ts dispose(): void; ``` End this App's connection to its host and release everything it owns. ###### Returns `void` --- ### Disposer ```ts type Disposer = () => void; ``` Releases a subscription or other held resource. Call once; further calls are a no-op. #### Returns `void` --- ### ReadonlyStore ```ts type ReadonlyStore = object; ``` A retained SDK-owned snapshot. #### Type Parameters | Type Parameter | | -------------- | | `T` | #### Methods ##### get() ```ts get(): T; ``` The current value; always available, even before any subscription. ###### Returns `T` ##### subscribe() ```ts subscribe(listener): Disposer; ``` Call `listener` on every change until the returned Disposer runs. Does not emit the current value immediately on subscribe. ###### Parameters | Parameter | Type | | ---------- | ------------------- | | `listener` | (`value`) => `void` | ###### Returns [`Disposer`](#disposer) --- ### HostUi ```ts type HostUi = object; ``` Deliberately narrow shell affordances; domain work belongs to capabilities. #### Methods ##### requestComputerChoice() ```ts requestComputerChoice(): Promise; ``` Open the host-owned Computer picker; selection arrives through App context. ###### Returns `Promise`\<`void`\> ##### requestBrowserAction() ```ts requestBrowserAction(input): Promise; ``` Request a host browser action from a fresh user click in this App. ###### Parameters | Parameter | Type | | --------- | --------------------------------------- | | `input` | [`AppBrowserAction`](#appbrowseraction) | ###### Returns `Promise`\<[`AppBrowserActionOutcome`](#appbrowseractionoutcome)\> ##### requestAppPermissions() ```ts requestAppPermissions(input): Promise; ``` 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 | Parameter | Type | | --------- | ----------------------------------------------- | | `input` | [`AppPermissionRequest`](#apppermissionrequest) | ###### Returns `Promise`\<[`AppPermissionOutcome`](#apppermissionoutcome)\> ##### openNavigation() ```ts openNavigation(input): Promise; ``` Ask the host to open an already admitted Computer file. ###### Parameters | Parameter | Type | | --------- | --------------------------------------------- | | `input` | [`FileNavigationInput`](#filenavigationinput) | ###### Returns `Promise`\<`void`\> ##### reportStatus() ```ts reportStatus(items): Promise; ``` 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 | Parameter | Type | | --------- | -------------------------------------------- | | `items` | readonly [`AppStatusItem`](#appstatusitem)[] | ###### Returns `Promise`\<`void`\> ##### onStatusAction() ```ts 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 | Parameter | Type | | --------- | --------------------------------------------------- | | `handler` | [`AppStatusActionHandler`](#appstatusactionhandler) | ###### Returns () => `void` ##### openSetup() ```ts openSetup(need): Promise; ``` Take the person to the host's exact setup surface for what this App needs, such as a model key. `unavailable` when this host has no such surface; the App then keeps its own plain explanation. Context `setup` updates live once the person finishes. ###### Parameters | Parameter | Type | | --------- | ------------------------- | | `need` | [`SetupNeed`](#setupneed) | ###### Returns `Promise`\<[`SetupOutcome`](#setupoutcome)\> ##### openTeamBilling() ```ts openTeamBilling(): Promise; ``` Leave the App for the host's Billing page for this Team. ###### Returns `Promise`\<`void`\> ##### openDesktopSettings() ```ts openDesktopSettings(): Promise; ``` 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 `Promise`\<`void`\> ##### reportAgentSessionSelection() ```ts reportAgentSessionSelection(selection): Promise; ``` Tell the host which Agent conversation this App currently has selected, or null when none is selected. ###### Parameters | Parameter | Type | | ----------- | ---------------------------------------------------------------------------- | | `selection` | \| `Readonly`\<\{ `agentId`: `string`; `sessionId`: `string`; \}\> \| `null` | ###### Returns `Promise`\<`void`\> ##### showToast() ```ts showToast(input): Promise; ``` Ask the host to show a transient toast notification. ###### Parameters | Parameter | Type | | --------- | --------------------------- | | `input` | [`ToastInput`](#toastinput) | ###### Returns `Promise`\<`void`\> --- ### AppStatusPriority ```ts type AppStatusPriority = "low"; ``` Items that may drop first when the window is too narrow for all of them. --- ### AppStatusIcon ```ts type AppStatusIcon = "folder" | "ports" | "processes" | "access"; ``` The marks a host can draw before a status button's label. --- ### AppStatusTone ```ts type AppStatusTone = "neutral" | "success" | "warning" | "error"; ``` A readout's live state, shown as a small light before its text. --- ### AppStatusOption ```ts type AppStatusOption = Readonly<{ id: string; text: string; checked?: boolean; disabled?: boolean; }>; ``` One choice in a status menu, such as a folder or a port. --- ### AppStatusItem ```ts type AppStatusItem = | Readonly<{ id: string; text: string; end?: boolean; priority?: AppStatusPriority; kind: "text"; tone?: AppStatusTone; }> | Readonly<{ id: string; text: string; end?: boolean; priority?: AppStatusPriority; 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; priority?: AppStatusPriority; kind: "toggle"; pressed: boolean; }> | Readonly<{ id: string; text: string; end?: boolean; priority?: AppStatusPriority; 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](#appstatusaction) back to the App. --- ### AppStatusAction ```ts 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. --- ### AppStatusActionHandler ```ts type AppStatusActionHandler = (action) => boolean | Promise; ``` Handles one status action; `true` when the App acted on it. #### Parameters | Parameter | Type | | --------- | ------------------------------------- | | `action` | [`AppStatusAction`](#appstatusaction) | #### Returns `boolean` \| `Promise`\<`boolean`\> --- ### AgentSessionSelection ```ts type AgentSessionSelection = Readonly<{ agentId: string; sessionId: string; }>; ``` Exact Agent conversation selected by an App for the authenticated shell. --- ### FileNavigationInput ```ts type FileNavigationInput = object; ``` A presentation-neutral request to open an already admitted Computer file. #### Properties ##### computerId ```ts readonly computerId: string; ``` ##### path ```ts readonly path: string; ``` --- ### ToastInput ```ts type ToastInput = object; ``` A transient notification an App asks its host to show. #### Properties ##### message ```ts readonly message: string; ``` ##### tone? ```ts readonly optional tone?: "error" | "info" | "success" | "warning"; ``` --- ### AgentAccessOperation ```ts type AgentAccessOperation = "agent.list" | "agent.manage" | "agent.read" | "agent.send"; ``` Agent rights an App may ask its host to grant through consent. --- ### ComputerAccessOperation ```ts type ComputerAccessOperation = | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute"; ``` Computer rights an App may ask its host to grant through consent. --- ### GitAccessOperation ```ts type GitAccessOperation = "git.repository"; ``` Git rights an App may ask its host to grant through consent. --- ### WorkflowAccessOperation ```ts type WorkflowAccessOperation = "workflow.publish" | "workflow.arm" | "workflow.run"; ``` Workflow rights an App may ask its host to grant through consent. --- ### EventAccessOperation ```ts type EventAccessOperation = "app.events.emit"; ``` Event rights an App may ask its host to grant through consent. --- ### GenerationAccessOperation ```ts type GenerationAccessOperation = "llm.generation" | "media.generation" | "media.share"; ``` Generation rights an App may ask its host to grant through consent. --- ### AppPermissionRequest ```ts type AppPermissionRequest = Readonly<{ agents?: readonly AgentAccessOperation[]; computers?: readonly ComputerAccessOperation[]; git?: readonly GitAccessOperation[]; workflows?: readonly WorkflowAccessOperation[]; events?: readonly EventAccessOperation[]; generation?: readonly GenerationAccessOperation[]; }>; ``` The rights an App asks for; the host bounds them by its declared ceiling. --- ### AppRight ```ts type AppRight = | AgentAccessOperation | ComputerAccessOperation | GitAccessOperation | WorkflowAccessOperation | EventAccessOperation | GenerationAccessOperation; ``` Every right an App can ask for, by the grant catalog's own name. --- ### AppRightState ```ts type AppRightState = "granted" | "missing"; ``` Whether this App holds one right now. `granted`: the owner's grant covers it. `missing`: it is declared but not covered, so a request would ask the person. --- ### AppPermissions ```ts type AppPermissions = Readonly>>; ``` The App's own grants, by right. A right the App does not declare is absent. --- ### AppPermissionOutcome ```ts 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. --- ### AppBrowserAction ```ts 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. --- ### AppBrowserActionRefusal ```ts 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. --- ### AppBrowserActionOutcome ```ts type AppBrowserActionOutcome = | Readonly<{ kind: "saved"; }> | Readonly<{ kind: "copied"; }> | AppBrowserActionRefusal; ``` Saved means a browser download was initiated, not a confirmed disk write. --- ### BeforeAppClose ```ts type BeforeAppClose = () => boolean | Promise; ``` Consulted before the person closes the App's window; return (or resolve) `true` to allow the close. #### Returns `boolean` \| `Promise`\<`boolean`\> --- ### AppCrumb ```ts 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. --- ### AppHeaderCommand ```ts 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. --- ### AppHeaderStatus ```ts 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. --- ### AppNavigationActivation ```ts 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. --- ### AppNavigationActivationHandler ```ts type AppNavigationActivationHandler = ( activation, ) => boolean | Promise; ``` Handles one activation; `true` when the App acted on it. #### Parameters | Parameter | Type | | ------------ | ----------------------------------------------------- | | `activation` | [`AppNavigationActivation`](#appnavigationactivation) | #### Returns `boolean` \| `Promise`\<`boolean`\> --- ### AppNavigationState ```ts type AppNavigationState = Readonly<{ canGoBack: boolean; canGoForward: 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. --- ### AppBackHandler ```ts type AppBackHandler = () => boolean | Promise; ``` Go back one step in the App's own history; `true` when it moved. #### Returns `boolean` \| `Promise`\<`boolean`\> --- ### AppForwardHandler ```ts type AppForwardHandler = () => boolean | Promise; ``` Go forward one step in the App's own history; `true` when it moved. #### Returns `boolean` \| `Promise`\<`boolean`\> --- ### HostNavigation ```ts type HostNavigation = Readonly<{ publish: Promise; onBack: Disposer; onForward: Disposer; onActivate: Disposer; }>; ``` The App's half of the host navigation contract. --- ### AppWindow ```ts type AppWindow = Readonly<{ onBeforeClose: Disposer; navigation: HostNavigation; }>; ``` App-owned presentation policy consulted before a user closes its window. --- ### ResultRow ```ts type ResultRow = Schema.Schema.Type; ``` One shared result row; navigation and previews stay host-authorized. ## Variables ### FungiAuthorSchema ```ts const FungiAuthorSchema: ZodLazy< ZodObject< { id: ZodString; name: ZodString; kind: ZodOptional>; }, $strict > >; ``` Who a Session line came from, as the admitting host authenticated them. --- ### FungiDelegationReplySchema ```ts const FungiDelegationReplySchema: ZodLazy< ZodObject< { agentId: ZodLazy; sessionId: ZodLazy; commandId: ZodLazy; outcome: ZodEnum<{ completed: "completed"; failed: "failed"; interrupted: "interrupted"; cancelled: "cancelled"; outcome_unknown: "outcome_unknown"; }>; diagnostic: ZodOptional; waitingOnYou: ZodOptional< ZodArray< ZodObject< { itemId: ZodLazy; 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. --- ### FungiMessageMetaSchema ```ts const FungiMessageMetaSchema: ZodObject<{ author: ZodOptional>; }, $strict>>>; sourceRequestId: ZodOptional>; delegation: ZodOptional>; maxDepth: ZodNumber; steer: ZodOptional>; goal: ZodOptional]>>; reply: ZodOptional; sessionId: ZodLazy; commandId: ZodLazy; outcome: ZodEnum<{ completed: ...; failed: ...; interrupted: ...; cancelled: ...; outcome_unknown: ...; }>; diagnostic: ZodOptional; waitingOnYou: ZodOptional>; }, $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. --- ### agentStopAllResultSchema ```ts const agentStopAllResultSchema: ZodObject< { rootAgentId: ZodString; agents: ZodArray< ZodDiscriminatedUnion< [ ZodObject< { agentId: ZodString; name: ZodString; outcome: ZodEnum<{ stopped: "stopped"; idle: "idle"; }>; }, $strict >, ZodObject< { agentId: ZodString; name: ZodString; outcome: ZodLiteral<"failed">; reason: ZodString; }, $strict >, ], "outcome" > >; discoveryFailures: ZodArray< ZodObject< { agentId: ZodString; reason: ZodString; }, $strict > >; notPermitted: ZodNumber; }, $strict >; ``` Stop all: what stopping an Agent and the Agents it spawned confirmed, one entry per attempted Agent in the order it was stopped (helpers before the Agent that made them). Local and hosted hosts report the same shape. --- ### appAgentAvatarSchema ```ts const appAgentAvatarSchema: declare< { v: 1; character: "mushroom" | "cat" | "burger"; appearance: z.ZodRecord< z.ZodString, z.ZodUnion >; expression: string; renderStyle: | "plain" | "pencil" | "manga" | "riso" | "halftone" | "blueprint" | "crt" | "watercolor"; }, { v: 1; character: "mushroom" | "cat" | "burger"; appearance: z.ZodRecord< z.ZodString, z.ZodUnion >; 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. --- ### appAgentSchema ```ts const appAgentSchema: Struct<{ agentId: String; name: String; avatar: declare< { v: 1; character: "mushroom" | "cat" | "burger"; appearance: z.ZodRecord< z.ZodString, z.ZodUnion >; expression: string; renderStyle: | "plain" | "pencil" | "manga" | "riso" | "halftone" | "blueprint" | "crt" | "watercolor"; }, { v: 1; character: "mushroom" | "cat" | "burger"; appearance: z.ZodRecord< z.ZodString, z.ZodUnion >; expression: string; renderStyle: | "plain" | "pencil" | "manga" | "riso" | "halftone" | "blueprint" | "crt" | "watercolor"; } >; sessionOperations: $Array< Literals >; }>; ``` 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. --- ### appAgentCreateInputSchema ```ts const appAgentCreateInputSchema: Struct<{ name: String; requestId: String; computer: optionalKey< Union< readonly [ Literals, Struct<{ computerId: String; }>, ] > >; avatar: optionalKey< declare< { v: 1; character: "mushroom" | "cat" | "burger"; appearance: z.ZodRecord< z.ZodString, z.ZodUnion >; expression: string; renderStyle: | "plain" | "pencil" | "manga" | "riso" | "halftone" | "blueprint" | "crt" | "watercolor"; }, { v: 1; character: "mushroom" | "cat" | "burger"; appearance: z.ZodRecord< z.ZodString, z.ZodUnion >; 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. --- ### agentList ```ts const agentList: CapabilityContract; ``` Capability to list the Agents visible to this App in read-only form. --- ### agentManage ```ts const agentManage: CapabilityContract< Pick >; ``` Capability to create new Agents and open transports to them. --- ### appAgentRenameInputSchema ```ts const appAgentRenameInputSchema: Struct<{ agentId: String; name: String; }>; ``` Validates Agent rename input: the target Agent and its new display name. --- ### agentRename ```ts const agentRename: CapabilityContract; ``` Owner-only capability to rename an existing Agent; not every host grants it. --- ### appAgentStopInputSchema ```ts const appAgentStopInputSchema: Struct<{ agentId: String; }>; ``` Validates Stop all input: the Agent whose tree to stop. --- ### agentStop ```ts const agentStop: CapabilityContract; ``` Stop all for an Agent this App may manage: its running turns and queued prompts are cancelled and its schedules paused, and the same for every Agent it spawned. Nothing is deleted. Not every host grants it. --- ### appAgentAvatarInputSchema ```ts const appAgentAvatarInputSchema: Struct<{ agentId: String; avatar: declare< { v: 1; character: "mushroom" | "cat" | "burger"; appearance: z.ZodRecord< z.ZodString, z.ZodUnion >; expression: string; renderStyle: | "plain" | "pencil" | "manga" | "riso" | "halftone" | "blueprint" | "crt" | "watercolor"; }, { v: 1; character: "mushroom" | "cat" | "burger"; appearance: z.ZodRecord< z.ZodString, z.ZodUnion >; expression: string; renderStyle: | "plain" | "pencil" | "manga" | "riso" | "halftone" | "blueprint" | "crt" | "watercolor"; } >; }>; ``` Validates avatar input: the target Agent and the avatar it now wears. --- ### agentAvatar ```ts const agentAvatar: CapabilityContract; ``` Owner-only capability to change an existing Agent's avatar; not every host grants it. --- ### appAgentInstructionsReadInputSchema ```ts const appAgentInstructionsReadInputSchema: Struct<{ agentId: String; }>; ``` Validates a read of one Agent's AGENTS.md. --- ### appAgentInstructionsSetInputSchema ```ts const appAgentInstructionsSetInputSchema: Struct<{ agentId: String; expectedContent: NullOr; content: String; }>; ``` Validates the owner's replacement of one Agent's AGENTS.md. `expectedContent` is the text the owner last read; null creates the file only while it is still absent. A file that changed since then is a CONFLICT, so an edit the Agent made is never overwritten. The host states the size limit. --- ### appAgentInstructionsSchema ```ts const appAgentInstructionsSchema: Struct<{ agentId: String; home: NullOr< Struct<{ name: String; }> >; content: NullOr; bytes: Int; limit: Int; }>; ``` The AGENTS.md on one Agent's Home Computer. `home` is null when the Agent has no Home, and then `content` is null and nothing can be saved. `limit` is the host's byte limit for the file. --- ### agentInstructions ```ts const agentInstructions: CapabilityContract; ``` Owner-only capability over an Agent's AGENTS.md on its Home Computer; not every host grants it. --- ### appAgentToolPolicyStatusSchema ```ts 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. --- ### appAgentToolPolicyResultSchema ```ts 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. --- ### agentToolPolicy ```ts const agentToolPolicy: CapabilityContract; ``` Owner-only capability to read and approve an Agent's App-tool policy. --- ### appAgentExtensionSchema ```ts const appAgentExtensionSchema: ZodLazy< ZodObject< { installationId: ZodString; name: ZodString; }, $strip > >; ``` One installed App that can add its prompt and tools to an Agent's runs. --- ### appAgentExtensionsSchema ```ts const appAgentExtensionsSchema: ZodLazy< ZodObject< { agentId: ZodString; attached: ZodArray< ZodLazy< ZodObject< { installationId: ZodString; name: ZodString; }, $strip > > >; available: ZodArray< ZodLazy< ZodObject< { installationId: ZodString; name: ZodString; }, $strip > > >; }, $strip > >; ``` An Agent's hosted extensions: what is attached now and what the owner could attach. --- ### appAgentExtensionsResultSchema ```ts const appAgentExtensionsResultSchema: ZodLazy< ZodUnion< readonly [ ZodLazy< ZodObject< { agentId: ZodString; attached: ZodArray< ZodLazy< ZodObject< { installationId: ZodString; name: ZodString; }, $strip > > >; available: ZodArray< ZodLazy< ZodObject< { installationId: ZodString; name: ZodString; }, $strip > > >; }, $strip > >, ZodLazy< ZodObject< { error: ZodEnum<{ not_found: "not_found"; not_granted: "not_granted"; not_extension: "not_extension"; }>; }, $strip > >, ] > >; ``` The outcome of attaching or detaching: the Agent's extensions after, or a refusal. --- ### agentExtensions ```ts const agentExtensions: CapabilityContract; ``` Owner-only capability to attach hosted extensions to an Agent, so an installed App can add its prompt and tools to that Agent's runs. Not every host grants it. --- ### agentSessionRead ```ts const agentSessionRead: CapabilityContract< Pick >; ``` Capability for read-only Agent sessions: open a transport to an existing Agent, or read the member's inbox feed. --- ### agentSessionWrite ```ts const agentSessionWrite: CapabilityContract< Pick >; ``` Capability for read-write Agent sessions: open a transport to an existing Agent and send to it, including the member's inbox feed. --- ### approvals ```ts const approvals: CapabilityContract; ``` Member-bound approval view. Authentication and current rights belong to the host. --- ### APP\_PROTOCOL\_VERSION ```ts const APP_PROTOCOL_VERSION: 3; ``` Current App protocol. Version 3 adds computerName to the strict context wire. --- ### APP\_PROTOCOL\_VERSIONS ```ts const APP_PROTOCOL_VERSIONS: readonly [2, 3]; ``` Published Apps and self-hosted Oysters can independently remain on protocol 2. --- ### APP\_READY\_TYPE ```ts const APP_READY_TYPE: "fungi.app.ready.v3"; ``` Old hosts ignore this tag rather than reject a v3 value in their strict v2 message. --- ### APP\_READY\_V2\_TYPE ```ts const APP_READY_V2_TYPE: "fungi.app.ready"; ``` The exact readiness tag understood by published protocol-2 hosts. --- ### APP\_CONNECT\_TYPE ```ts const APP_CONNECT_TYPE: "fungi.app.connect"; ``` Message type the host posts to hand the App its RPC MessagePort. --- ### appDeliveryPendingSchema ```ts const appDeliveryPendingSchema: Struct<{ code: Literals; }>; ``` Effect projection of the error owner's declaration-safe pending refusal. --- ### parseAppStatusItems ```ts const parseAppStatusItems: (...a) => readonly AppStatusItem[]; ``` Both edges: one window's status items, bounded and copied. #### Parameters | Parameter | Type | | --------- | ----------------------------- | | ...`a` | \[`unknown`, `ParseOptions`\] | #### Returns readonly [`AppStatusItem`](#appstatusitem)[] --- ### parseAppStatusAction ```ts const parseAppStatusAction: (...a) => C; ``` App edge: the status item the person used, as the host relays it. #### Parameters | Parameter | Type | | --------- | ----------------------------- | | ...`a` | \[`unknown`, `ParseOptions`\] | #### Returns `C` --- ### mediaGenerationReferenceSchema ```ts const mediaGenerationReferenceSchema: Struct<{ requestId: String; computerId: String; }>; ``` A replay identity, never an authorization capability. --- ### mediaModelSchema ```ts const mediaModelSchema: Struct<{ id: String; input: Struct<{ defaultHeight: Number; defaultSteps: NullOr; defaultWidth: Number; dimensions: Literals; guidance: optionalKey< NullOr< Struct<{ default: Number; max: Number; min: Number; }> > >; maxDimension: NullOr; maxDimensionDocumented: Boolean; maxReferences: Number; maxSteps: NullOr; referenceDimension: NullOr; referenceField: NullOr; referenceFormat: Literals; steps: Literals; transport: Literals; }>; kind: Literals; label: String; maxPromptLength: Number; tier: Literals; outputFormats: $Array>; sizes: NullOr<$Array>; video: NullOr< Struct<{ minSeconds: Number; maxSeconds: Number; defaultSeconds: Number; durations: $Array; provider: Literals; 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; referenceRoles: $Array< Literals >; maxReferenceImages: Number; audioReferences: NullOr< Struct<{ max: Number; totalSeconds: Number; }> >; referenceResolutions: $Array< Literals >; prices: $Array< Struct<{ resolution: Literals< readonly ["480p", "720p", "768p", "1080p", "4k"] >; silentMilliunitsPerSecond: Number; audioMilliunitsPerSecond: Number; }> >; }> >; audio: NullOr< Struct<{ provider: Literal<"elevenlabs">; mode: Literals; voices: $Array< Struct<{ id: String; label: String; }> >; defaultVoiceId: NullOr; seconds: NullOr< Struct<{ min: Number; max: Number; default: Number; }> >; milliunitsPerUnit: Number; }> >; transform: NullOr< Struct<{ operation: Literals; source: Struct<{ formats: $Array>; maxBytes: Number; maxPixels: Number; }>; defaultMegapixels: NullOr; milliunits: NullOr; sizes: $Array< Struct<{ megapixels: Number; milliunits: Number; }> >; }> >; billingUnit: Literals< readonly ["image", "video_second", "audio_second", "audio_character_block"] >; }>; ``` Validates one model row of the host's Media catalog. --- ### mediaGenerationSelectionSchema ```ts const mediaGenerationSelectionSchema: Struct<{ model: String; prompt: String; width: optional; height: optional; voiceId: optional; steps: optional; durationSeconds: optional; targetMegapixels: optional; resolution: optional< Literals >; aspectRatio: optional< Literals >; generateAudio: optional; references: optional< $Array< Struct<{ computerId: optional; path: String; role: optional< Literals >; }> > >; }>; ``` 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. --- ### mediaGenerationFailureSchema ```ts 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; reason: optionalKey< Literals< readonly [ "credits_exhausted", "content_refused", "invalid_input", "rate_limited", "provider_unavailable", "remote_binding_disabled", "timeout", "spending_limit", ] > >; detail: optionalKey; }>, Struct<{ category: Literal<"result_download">; status: Int; }>, Struct<{ category: Literal<"media_service">; failure: Literals< readonly [ "invalid_request", "unauthorized", "unavailable", "rate_limited", "too_large", "unreachable", "invalid_response", ] >; }>, ] > >; code: Literals< readonly [ "CANCELLED", "CAPABILITY_DENIED", "CAPABILITY_REVOKED", "DAILY_LIMIT_REACHED", "DISCONNECTED", "HOST_FAILURE", "IDENTITY", "INSUFFICIENT_CREDIT", "INVALID_ARGUMENT", "MEDIA_PROVIDER_FAILURE", "MEDIA_PROVIDER_FAILURE_UNCHARGED", "PROTOCOL", "SAFETY_FILTER_REFUSED", "SETUP_REQUIRED", "TIMEOUT", ] >; retryable: Boolean; need: optional; }>; ``` Validates the typed failure a host reports for a generation attempt. --- ### mediaGeneration ```ts const mediaGeneration: CapabilityContract; ``` Capability contract for generating Media (images or video). Apps declare it to request access; openMediaGeneration uses it to obtain the host's handle. --- ### mediaShareStatusSchema ```ts const mediaShareStatusSchema: ZodUnion< readonly [ ZodObject< { shared: ZodLiteral; }, $strict >, ZodObject< { shared: ZodLiteral; url: ZodURL; showPrompt: ZodBoolean; }, $strict >, ] >; ``` Whether one generated Print has a public link, and what that link shows. --- ### mediaShareInputSchema ```ts const mediaShareInputSchema: ZodObject< { requestId: ZodString; showPrompt: ZodBoolean; }, $strict >; ``` Turn a public link on for one generated Print. --- ### mediaShare ```ts const mediaShare: CapabilityContract; ``` Capability contract for public links to generated Media. Off by default per output; the host keeps the link, the bytes it serves and who may change it. --- ### pendingSchema ```ts 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\_MAX ```ts const APP_STATUS_ITEMS_MAX: 6 = 6; ``` The most readouts one App window's status bar shows. --- ### APP\_STATUS\_TEXT\_MAX ```ts const APP_STATUS_TEXT_MAX: 80 = 80; ``` The longest readout a window's status bar shows. --- ### APP\_STATUS\_OPTIONS\_MAX ```ts const APP_STATUS_OPTIONS_MAX: 16 = 16; ``` The most choices one status menu offers. --- ### APP\_RIGHTS ```ts const APP_RIGHTS: readonly AppRight[]; ``` Every `AppRight`, for hosts that read grants by catalog name. --- ### APP\_BROWSER\_SAVE\_MAX\_BYTES ```ts const APP_BROWSER_SAVE_MAX_BYTES: number; ``` Maximum file size sent through the user-initiated host browser door. --- ### APP\_BROWSER\_COPY\_MAX\_BYTES ```ts const APP_BROWSER_COPY_MAX_BYTES: number; ``` Maximum UTF-8 text size sent to the host clipboard. --- ### APP\_NAVIGATION\_CONTRACT\_VERSION ```ts const APP_NAVIGATION_CONTRACT_VERSION: 2; ``` 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\_MAX ```ts const APP_NAVIGATION_TITLE_MAX: 80 = 80; ``` The longest page title a host shows beside the App's own name. --- ### APP\_NAVIGATION\_CRUMBS\_MAX ```ts const APP_NAVIGATION_CRUMBS_MAX: 8 = 8; ``` The most crumbs one navigation report may carry. --- ### APP\_NAVIGATION\_SIBLINGS\_MAX ```ts const APP_NAVIGATION_SIBLINGS_MAX: 16 = 16; ``` The most siblings one switcher crumb may offer. --- ### APP\_NAVIGATION\_PRIMARY\_MAX ```ts const APP_NAVIGATION_PRIMARY_MAX: 3 = 3; ``` The most primary header commands one report may carry. --- ### APP\_NAVIGATION\_STATUS\_MAX ```ts const APP_NAVIGATION_STATUS_MAX: 4 = 4; ``` The most header status facts one report may carry. --- ### APP\_NAVIGATION\_MENU\_MAX ```ts const APP_NAVIGATION_MENU_MAX: 12 = 12; ``` The most ⋯ menu commands one report may carry. --- ### APP\_NAVIGATION\_LABEL\_MAX ```ts const APP_NAVIGATION_LABEL_MAX: 80 = 80; ``` The longest crumb or command label a host shows. --- ### inertHostNavigation ```ts 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. --- ### resultRowSchemaV1 ```ts const resultRowSchemaV1: Schema.Struct<{ media: Schema.optional< Schema.Struct<{ path: Schema.String; format: Schema.Literals; }> >; id: Schema.String; title: Schema.String; detail: Schema.optional; 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. ## Functions ### messageAuthor() ```ts function messageAuthor(meta): | { id: string; name: string; kind?: "agent"; } | undefined; ``` The author a message's metadata names; none for anything else. #### Parameters | Parameter | Type | | --------- | ------------------------------------------------------ | | `meta` | [`MessageMetaValue`](#messagemetavalue) \| `undefined` | #### Returns ##### Type Literal ```ts { 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() ```ts 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 | Parameter | Type | | --------- | ------------------------------------------------------ | | `meta` | [`MessageMetaValue`](#messagemetavalue) \| `undefined` | #### Returns ##### Type Literal ```ts { 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() ```ts function authorMeta(author): AuthorMeta; ``` The metadata the host attaches for one authenticated author. #### 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 [`AuthorMeta`](#authormeta) --- ### renameAppAgent() ```ts function renameAppAgent( capabilities, input, ): Promise<{ agentId: string; name: string; avatar: { v: 1; character: "mushroom" | "cat" | "burger"; appearance: z.ZodRecord< z.ZodString, z.ZodUnion >; 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 | Parameter | Type | | -------------- | --------------------------------------------- | | `capabilities` | [`CapabilityDirectory`](#capabilitydirectory) | | `input` | [`AppAgentRenameInput`](#appagentrenameinput) | #### Returns `Promise`\<\{ `agentId`: `string`; `name`: `string`; `avatar`: \{ `v`: `1`; `character`: `"mushroom"` \| `"cat"` \| `"burger"`; `appearance`: `z.ZodRecord`\<`z.ZodString`, `z.ZodUnion`\\>; `expression`: `string`; `renderStyle`: \| `"plain"` \| `"pencil"` \| `"manga"` \| `"riso"` \| `"halftone"` \| `"blueprint"` \| `"crt"` \| `"watercolor"`; \}; `sessionOperations`: readonly (`"agent.manage"` \| `"agent.read"` \| `"agent.send"`)[]; \}\> --- ### stopAppAgentTree() ```ts function stopAppAgentTree( capabilities, input, ): Promise<{ rootAgentId: string; agents: ( | { agentId: string; name: string; outcome: "stopped" | "idle"; } | { agentId: string; name: string; outcome: "failed"; reason: string; } )[]; discoveryFailures: object[]; notPermitted: number; }>; ``` Stop an Agent and the Agents it spawned through the host-granted capability. #### Parameters | Parameter | Type | | -------------- | --------------------------------------------- | | `capabilities` | [`CapabilityDirectory`](#capabilitydirectory) | | `input` | [`AppAgentStopInput`](#appagentstopinput) | #### Returns `Promise`\<\{ `rootAgentId`: `string`; `agents`: ( \| \{ `agentId`: `string`; `name`: `string`; `outcome`: `"stopped"` \| `"idle"`; \} \| \{ `agentId`: `string`; `name`: `string`; `outcome`: `"failed"`; `reason`: `string`; \})[]; `discoveryFailures`: `object`[]; `notPermitted`: `number`; \}\> --- ### agentStopAllSummary() ```ts function agentStopAllSummary(result): Readonly<{ tone: "success" | "warning"; message: string; }>; ``` One notice for a Stop all, never one per helper. Counts name only confirmed stops; then one plain sentence for each Agent that may still be running, carrying its actual cause. #### Parameters | Parameter | Type | Description | | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `result` | \{ `rootAgentId`: `string`; `agents`: ( \| \{ `agentId`: `string`; `name`: `string`; `outcome`: `"stopped"` \| `"idle"`; \} \| \{ `agentId`: `string`; `name`: `string`; `outcome`: `"failed"`; `reason`: `string`; \})[]; `discoveryFailures`: `object`[]; `notPermitted`: `number`; \} | - | | `result.rootAgentId` | `string` | - | | `result.agents` | ( \| \{ `agentId`: `string`; `name`: `string`; `outcome`: `"stopped"` \| `"idle"`; \} \| \{ `agentId`: `string`; `name`: `string`; `outcome`: `"failed"`; `reason`: `string`; \})[] | - | | `result.discoveryFailures` | `object`[] | Agents whose record could not be read, so whether they run is unknown. | | `result.notPermitted` | `number` | Helpers in the tree this caller may not manage. They were not stopped, and are counted rather than named so a narrow caller learns no more of the tree than its size. | #### Returns `Readonly`\<\{ `tone`: `"success"` \| `"warning"`; `message`: `string`; \}\> --- ### setAppAgentAvatar() ```ts function setAppAgentAvatar( capabilities, input, ): Promise<{ agentId: string; name: string; avatar: { v: 1; character: "mushroom" | "cat" | "burger"; appearance: z.ZodRecord< z.ZodString, z.ZodUnion >; 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 | Parameter | Type | | -------------- | --------------------------------------------- | | `capabilities` | [`CapabilityDirectory`](#capabilitydirectory) | | `input` | [`AppAgentAvatarInput`](#appagentavatarinput) | #### Returns `Promise`\<\{ `agentId`: `string`; `name`: `string`; `avatar`: \{ `v`: `1`; `character`: `"mushroom"` \| `"cat"` \| `"burger"`; `appearance`: `z.ZodRecord`\<`z.ZodString`, `z.ZodUnion`\\>; `expression`: `string`; `renderStyle`: \| `"plain"` \| `"pencil"` \| `"manga"` \| `"riso"` \| `"halftone"` \| `"blueprint"` \| `"crt"` \| `"watercolor"`; \}; `sessionOperations`: readonly (`"agent.manage"` \| `"agent.read"` \| `"agent.send"`)[]; \}\> --- ### readAppAgentInstructions() ```ts function readAppAgentInstructions( capabilities, agentId, ): Promise< Readonly<{ agentId: string; home: { name: string; } | null; content: string | null; bytes: number; limit: number; }> >; ``` Read an Agent's AGENTS.md through the owner-only capability. #### Parameters | Parameter | Type | | -------------- | --------------------------------------------- | | `capabilities` | [`CapabilityDirectory`](#capabilitydirectory) | | `agentId` | `string` | #### Returns `Promise`\<`Readonly`\<\{ `agentId`: `string`; `home`: \| \{ `name`: `string`; \} \| `null`; `content`: `string` \| `null`; `bytes`: `number`; `limit`: `number`; \}\>\> --- ### setAppAgentInstructions() ```ts function setAppAgentInstructions( capabilities, input, ): Promise< Readonly<{ agentId: string; home: { name: string; } | null; content: string | null; bytes: number; limit: number; }> >; ``` Replace an Agent's AGENTS.md through the owner-only capability. #### Parameters | Parameter | Type | | -------------- | --------------------------------------------------------------- | | `capabilities` | [`CapabilityDirectory`](#capabilitydirectory) | | `input` | [`AppAgentInstructionsSetInput`](#appagentinstructionssetinput) | #### Returns `Promise`\<`Readonly`\<\{ `agentId`: `string`; `home`: \| \{ `name`: `string`; \} \| `null`; `content`: `string` \| `null`; `bytes`: `number`; `limit`: `number`; \}\>\> --- ### listAppAgents() ```ts function listAppAgents(capabilities): Promise; ``` List the Agents in the host-granted Team or local-project scope. #### Parameters | Parameter | Type | | -------------- | --------------------------------------------- | | `capabilities` | [`CapabilityDirectory`](#capabilitydirectory) | #### Returns `Promise`\ --- ### createAppAgent() ```ts function createAppAgent( capabilities, input, ): Promise<{ agentId: string; name: string; avatar: { v: 1; character: "mushroom" | "cat" | "burger"; appearance: z.ZodRecord< z.ZodString, z.ZodUnion >; 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 | Parameter | Type | | -------------- | --------------------------------------------- | | `capabilities` | [`CapabilityDirectory`](#capabilitydirectory) | | `input` | [`AppAgentCreateInput`](#appagentcreateinput) | #### Returns `Promise`\<\{ `agentId`: `string`; `name`: `string`; `avatar`: \{ `v`: `1`; `character`: `"mushroom"` \| `"cat"` \| `"burger"`; `appearance`: `z.ZodRecord`\<`z.ZodString`, `z.ZodUnion`\\>; `expression`: `string`; `renderStyle`: \| `"plain"` \| `"pencil"` \| `"manga"` \| `"riso"` \| `"halftone"` \| `"blueprint"` \| `"crt"` \| `"watercolor"`; \}; `sessionOperations`: readonly (`"agent.manage"` \| `"agent.read"` \| `"agent.send"`)[]; \}\> --- ### openAppAgent() ```ts function openAppAgent( capabilities, input, ): Promise< Readonly<{ baseUrl: string; fetch: { (input, init?): Promise; (input, init?): Promise; }; close: () => Promise; }> >; ``` Adapt one live object capability to Fetch without exposing the parent's authenticated URL or credentials to the isolated App. #### Parameters | Parameter | Type | | --------------- | --------------------------------------------- | | `capabilities` | [`CapabilityDirectory`](#capabilitydirectory) | | `input` | \{ `agentId`: `string`; \} | | `input.agentId` | `string` | #### Returns `Promise`\<`Readonly`\<\{ `baseUrl`: `string`; `fetch`: \{ (`input`, `init?`): `Promise`\<`Response`\>; (`input`, `init?`): `Promise`\<`Response`\>; \}; `close`: () => `Promise`\<`void`\>; \}\>\> --- ### defineCapability() ```ts function defineCapability(id, version, schema): CapabilityContract; ``` Define a capability with the owner's decoder for its live RPC interface. #### Type Parameters | Type Parameter | | -------------- | | `T` | #### Parameters | Parameter | Type | | --------- | ---------------- | | `id` | `string` | | `version` | `number` | | `schema` | `ZodType`\<`T`\> | #### Returns [`CapabilityContract`](#capabilitycontract)\<`T`\> --- ### createCapabilityRegistry() ```ts function createCapabilityRegistry(): CapabilityRegistry; ``` Register typed local implementations without reopening their erased types. #### Returns [`CapabilityRegistry`](#capabilityregistry) --- ### registerCatalog() ```ts 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 | Parameter | Type | Description | | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- | | `commands` | [`AppCommands`](#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 [`Disposer`](#disposer) Release every registration made by this call. --- ### connectApp() ```ts function connectApp(options): Promise; ``` Connects this iframe page to its authenticated host. #### Parameters | Parameter | Type | | --------- | ----------------------------------------- | | `options` | [`ConnectAppOptions`](#connectappoptions) | #### Returns `Promise`\<[`AppRoot`](#approot)\> --- ### createAppHistory() ```ts function createAppHistory(initial): AppHistory; ``` Start a history at `initial`; entries are held as given, so keep them immutable. #### Type Parameters | Type Parameter | | -------------- | | `Entry` | #### Parameters | Parameter | Type | | --------- | ------- | | `initial` | `Entry` | #### Returns [`AppHistory`](#apphistory)\<`Entry`\> --- ### openMediaGeneration() ```ts function openMediaGeneration(capabilities): Promise< Readonly<{ computerId: string; canGenerate: boolean; models: readonly object[]; quote: (settings) => Promise | null>; createAttempt: Promise; restoreAttempt: Promise; }> >; ``` Discover the exact retained model catalog surfaced by the owner. #### Parameters | Parameter | Type | | -------------- | --------------------------------------------- | | `capabilities` | [`CapabilityDirectory`](#capabilitydirectory) | #### Returns `Promise`\<`Readonly`\<\{ `computerId`: `string`; `canGenerate`: `boolean`; `models`: readonly `object`[]; `quote`: (`settings`) => `Promise`\< \| `Readonly`\<\{ `costMilliunits`: `number`; \}\> \| `null`\>; `createAttempt`: `Promise`\<[`MediaGenerationAttempt`](#mediagenerationattempt)\>; `restoreAttempt`: `Promise`\<[`MediaGenerationAttempt`](#mediagenerationattempt)\>; \}\>\> --- ### pending() ```ts function pending(retryAfterMs): Pending; ``` Return Pending with a polling delay between one and sixty seconds. #### Parameters | Parameter | Type | | -------------- | -------- | | `retryAfterMs` | `number` | #### Returns [`Pending`](#pending) --- ### statusText() ```ts 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 | Parameter | Type | Default value | | --------- | -------- | --------------------- | | `value` | `string` | `undefined` | | `max` | `number` | `APP_STATUS_TEXT_MAX` | #### Returns `string` --- ### statusActionAllowed() ```ts 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 | Parameter | Type | | --------- | -------------------------------------------- | | `items` | readonly [`AppStatusItem`](#appstatusitem)[] | | `action` | [`AppStatusAction`](#appstatusaction) | #### Returns `boolean` --- ### navigationActivationAllowed() ```ts 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 | Parameter | Type | | ------------ | ----------------------------------------------------- | | `state` | [`AppNavigationState`](#appnavigationstate) | | `activation` | [`AppNavigationActivation`](#appnavigationactivation) | #### Returns `boolean` ## References ### AppError Re-exports [AppError](errors.md#apperror) --- ### readAppFailure Re-exports [readAppFailure](errors.md#readappfailure) --- ### AppDeliveryPending Re-exports [AppDeliveryPending](errors.md#appdeliverypending) --- ### AppErrorCode Re-exports [AppErrorCode](errors.md#apperrorcode) --- ### AppErrorOptions Re-exports [AppErrorOptions](errors.md#apperroroptions) --- ### appStorage Re-exports [appStorage](storage.md#appstorage-1) --- ### AppStorageError Re-exports [AppStorageError](storage.md#appstorageerror) --- ### AppStorage Re-exports [AppStorage](storage.md#appstorage) --- ### AppStorageWatch Re-exports [AppStorageWatch](storage.md#appstoragewatch) --- ### AppStorageWrite Re-exports [AppStorageWrite](storage.md#appstoragewrite) --- ### AppStorageReset Re-exports [AppStorageReset](storage.md#appstoragereset) --- ### ResolvedAppStorage Re-exports [ResolvedAppStorage](storage.md#resolvedappstorage)