page/mount
Import
Section titled “Import”import * as api from "@fungi.computer/oyster/page";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| class | OysterAgentBrowserHost | One page-wide selected Session, using only its reporting App’s admitted view. |
| type alias | OysterAppOpenRouting | Role and App opens, routed by the embedding shell; the App never names a surface. |
| type alias | OysterAppConfig | The host-admitted App configuration served by Oyster. |
| type alias | OysterAppConnectionOptions | One isolated App connection, with the slots this host admitted for it. |
| constant | appSandbox | The sandbox every installed App frame runs in, shell-mounted or not. |
| constant | oysterAppConfigSchema | Current server-admitted configuration for one installed App page. |
| function | readOysterPageConfig() | Read the server-admitted configuration this page was served with. |
| function | applyOysterPageTheme() | Apply this host’s shared page styles and the person’s color theme. |
| function | oysterShellHandles() | The home installation’s own storage and methods, for the trusted shell the host composes into this document. They reach the same admitted routes an isolated App would, without a frame between the shell and its host. |
| function | mountOysterPage() | Mount one installed App’s own page: its sandboxed frame and nothing else. Desktop chrome (menus, palette, status) belongs to the trusted shell. |
| function | connectOysterApp() | Connect a child or home App using the same admitted Oyster slot handles. |
| function | oysterAppCapabilities() | Resolve only the slots admitted for this installation by its current host. |
| function | oysterStorageHandle() | The existing Agar storage wire, scoped to an admitted installation and owner. |
OysterAgentBrowserHostclass
Section titled “OysterAgentBrowserHost”One page-wide selected Session, using only its reporting App’s admitted view.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new OysterAgentBrowserHost(signal): OysterAgentBrowserHost;End the selected connection with the page’s own lifetime.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
signal |
AbortSignal |
Returns
Section titled “Returns”Methods
Section titled “Methods”release()
Section titled “release()”release(frame): void;A departing or deselecting mount cannot close a different active mount.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
frame |
HTMLIFrameElement |
Returns
Section titled “Returns”void
dispose()
Section titled “dispose()”dispose(): void;Release the page’s current selection; later reports cannot reconnect it.
Returns
Section titled “Returns”void
report()
Section titled “report()”report( frame, selection, capabilities, whistle): Promise<void>;Bind the reporting mount’s current command view to its explicitly selected Session.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
frame |
HTMLIFrameElement |
selection |
| Readonly<{ agentId: string; sessionId: string; }> | null |
capabilities |
CapabilityDirectory |
whistle |
Pick<WhistleRuntime, "snapshot" | "execute"> |
Returns
Section titled “Returns”Promise<void>
OysterAppOpenRoutingtype alias
Section titled “OysterAppOpenRouting”type OysterAppOpenRouting = Readonly<{ open: Promise<void>; role: Promise<{ displayName: z.ZodNullable<z.ZodString>; } | null>;}>;Role and App opens, routed by the embedding shell; the App never names a surface.
OysterAppConfigtype alias
Section titled “OysterAppConfig”type OysterAppConfig = typeof oysterAppConfigSchema.Type;The host-admitted App configuration served by Oyster.
OysterAppConnectionOptionstype alias
Section titled “OysterAppConnectionOptions”type OysterAppConnectionOptions = Readonly<{ config: OysterAppConfig; agentBrowser: OysterAgentBrowserHost; agentCommands: Pick<WhistleRuntime, "snapshot" | "execute">; computerTarget?: string; frame: HTMLIFrameElement; signal: AbortSignal; handlers: AppHostHandlers; appOpen?: OysterAppOpenRouting; openRequest?: AppHostLaunch["context"]["value"]["openRequest"]; surfaceId?: string; reservedChords: readonly AppHostReservedChord[]; theme: string;}>;One isolated App connection, with the slots this host admitted for it.
appSandboxconstant
Section titled “appSandbox”const appSandbox: "allow-scripts allow-modals allow-popups allow-forms" = "allow-scripts allow-modals allow-popups allow-forms";The sandbox every installed App frame runs in, shell-mounted or not.
oysterAppConfigSchemaconstant
Section titled “oysterAppConfigSchema”const oysterAppConfigSchema: Struct<{ workbench: Boolean; shellModuleUrl: NullOr<String>; storage: Boolean; appsOpen: Boolean; computerId: NullOr<String>; authorityVersion: Int; commands: $Array<Codec<Readonly<{ id: string; title: string; category: string; description?: string; sigil?: string; projections?: Readonly<{ bindings?: ... & ...; agent?: ... & ...; help?: Readonly<...>; menu?: Readonly<...>; palette?: Readonly<...>; slash?: ... & ...; }>; }>, Readonly<{ id: string; title: string; category: string; description?: string; sigil?: string; projections?: Readonly<{ bindings?: ... & ...; agent?: ... & ...; help?: Readonly<...>; menu?: Readonly<...>; palette?: Readonly<...>; slash?: ... & ...; }>; }>, never, never>>; icon: NullOr<String>; roles: $Array<String>; installationId: String; appId: String; releaseId: String; uiUrl: String; backendUrl: String; methodsUrl: String; capabilities: $Array<Struct<{ id: String; version: Number; base: String; methods: $Record<String, Union<readonly [Struct<{ kind: Literal<...>; method: Literals<...>; path: String; }>, Struct<{ kind: Literals<...>; method: Literals<...>; path: String; }>]>>; }>>;}>;Current server-admitted configuration for one installed App page.
readOysterPageConfig()function
Section titled “readOysterPageConfig()”function readOysterPageConfig(): object;Read the server-admitted configuration this page was served with.
Returns
Section titled “Returns”| Name | Type | Default value | Description |
|---|---|---|---|
workbench |
boolean |
Schema.Boolean |
- |
shellModuleUrl |
string | null |
- | The home shell Release’s own module, imported top-level; null if it ships none. |
storage |
boolean |
Schema.Boolean |
- |
appsOpen |
boolean |
Schema.Boolean |
The Release declares apps.open; only an embedding shell can serve it. |
computerId |
string | null |
- | - |
authorityVersion |
number |
Schema.Int |
- |
commands |
readonly Readonly<{ id: string; title: string; category: string; description?: string; sigil?: string; projections?: Readonly<{ bindings?: Readonly<{ order?: …; }> & Readonly<{ values: …; }>; agent?: Readonly<{ order?: …; }> & Readonly<{ keybind?: …; }>; help?: Readonly<{ order?: … | …; }>; menu?: Readonly<{ order?: … | …; }>; palette?: Readonly<{ order?: … | …; }>; slash?: Readonly<{ order?: …; }> & Readonly<{ aliases: …; }>; }>; }>[] |
- | - |
icon |
string | null |
- | - |
roles |
readonly string[] |
- | - |
installationId |
string |
Schema.String |
- |
appId |
string |
Schema.String |
- |
releaseId |
string |
Schema.String |
- |
uiUrl |
string |
Schema.String |
- |
backendUrl |
string |
Schema.String |
- |
methodsUrl |
string |
Schema.String |
- |
capabilities |
readonly object[] |
- | - |
applyOysterPageTheme()function
Section titled “applyOysterPageTheme()”function applyOysterPageTheme(): "mocha" | "latte";Apply this host’s shared page styles and the person’s color theme.
Returns
Section titled “Returns”"mocha" | "latte"
oysterShellHandles()function
Section titled “oysterShellHandles()”function oysterShellHandles(config): object;The home installation’s own storage and methods, for the trusted shell the host composes into this document. They reach the same admitted routes an isolated App would, without a frame between the shell and its host.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
config |
{ workbench: boolean; shellModuleUrl: string | null; storage: boolean; appsOpen: boolean; computerId: string | null; authorityVersion: number; commands: readonly Readonly<{ id: string; title: string; category: string; description?: string; sigil?: string; projections?: Readonly<{ bindings?: Readonly<{ order?: …; }> & Readonly<{ values: …; }>; agent?: Readonly<{ order?: …; }> & Readonly<{ keybind?: …; }>; help?: Readonly<{ order?: … | …; }>; menu?: Readonly<{ order?: … | …; }>; palette?: Readonly<{ order?: … | …; }>; slash?: Readonly<{ order?: …; }> & Readonly<{ aliases: …; }>; }>; }>[]; icon: string | null; roles: readonly string[]; installationId: string; appId: string; releaseId: string; uiUrl: string; backendUrl: string; methodsUrl: string; capabilities: readonly object[]; } |
- |
config.workbench |
boolean |
- |
config.shellModuleUrl |
string | null |
The home shell Release’s own module, imported top-level; null if it ships none. |
config.storage |
boolean |
- |
config.appsOpen |
boolean |
The Release declares apps.open; only an embedding shell can serve it. |
config.computerId |
string | null |
- |
config.authorityVersion |
number |
- |
config.commands |
readonly Readonly<{ id: string; title: string; category: string; description?: string; sigil?: string; projections?: Readonly<{ bindings?: Readonly<{ order?: …; }> & Readonly<{ values: …; }>; agent?: Readonly<{ order?: …; }> & Readonly<{ keybind?: …; }>; help?: Readonly<{ order?: … | …; }>; menu?: Readonly<{ order?: … | …; }>; palette?: Readonly<{ order?: … | …; }>; slash?: Readonly<{ order?: …; }> & Readonly<{ aliases: …; }>; }>; }>[] |
- |
config.icon |
string | null |
- |
config.roles |
readonly string[] |
- |
config.installationId |
string |
- |
config.appId |
string |
- |
config.releaseId |
string |
- |
config.uiUrl |
string |
- |
config.backendUrl |
string |
- |
config.methodsUrl |
string |
- |
config.capabilities |
readonly object[] |
- |
Returns
Section titled “Returns”object
| Name | Type | Description |
|---|---|---|
storage |
| Readonly<{ read: Promise<{ value: Json; source: "member" | "team" | "none"; team: | { value: Json; revision: number; } | null; member: | { value: Json; revision: number; } | null; canWriteTeam: boolean; }>; write: Promise<{ revision: number; }>; reset: Promise<{ revision: number; }>; watch: Promise<AppStorageWatch>; }> | null |
- |
methods |
object |
- |
call() |
(method, input) => Promise<WhistleJsonValue> |
Call the named method with JSON-encoded input; resolves with its JSON result. |
mountOysterPage()function
Section titled “mountOysterPage()”function mountOysterPage(): Promise<AppHost>;Mount one installed App’s own page: its sandboxed frame and nothing else. Desktop chrome (menus, palette, status) belongs to the trusted shell.
Returns
Section titled “Returns”Promise<AppHost>
connectOysterApp()function
Section titled “connectOysterApp()”function connectOysterApp(options): Promise<AppHost>;Connect a child or home App using the same admitted Oyster slot handles.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
OysterAppConnectionOptions |
Returns
Section titled “Returns”Promise<AppHost>
oysterAppCapabilities()function
Section titled “oysterAppCapabilities()”function oysterAppCapabilities(options): Promise<readonly object[]>;Resolve only the slots admitted for this installation by its current host.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
Pick<OysterAppConnectionOptions, "config" | "signal" | "appOpen" | "computerTarget"> |
Returns
Section titled “Returns”Promise<readonly object[]>
oysterStorageHandle()function
Section titled “oysterStorageHandle()”function oysterStorageHandle(installationId): AppStorageWire;The existing Agar storage wire, scoped to an admitted installation and owner.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
installationId |
string |
Returns
Section titled “Returns”AppStorageWire