Skip to content
API reference

shell-module

Import
import * as api from "@fungi.computer/nacre/shell-module";
Kind Export Description
class ShellModuleError The picked shell’s module could not be loaded or does not fit the contract.
type alias ShellMountInput What a host hands the shell a Team picked. The host composes that shell into its own top-level document, so it runs with the host’s escalated permissions: the workbench mounts each child App in its sandboxed frame, and storage/methods are the shell installation’s own desktop data.
type alias MountShell Render the shell into root; resolves once it is mounted, with the function that removes it again. The shell loads its own code and styles.
type alias ShellPlatformControls Settings a shell renders for a host that has none of its own, such as a standalone Oyster: the shell draws them into root, and the host hands controls to its workbench so Apps and the dashboard can open them.
type alias RequestShellAppAccess A host’s App-access flow. The host owns admission, current grants and saving; the shell renders the prompt and navigates its own Settings.
type alias MountPlatformControls Render the shell’s own Settings using the embedding host’s access authority.
type alias ShellModule What a host gets from a picked shell Release’s module.
function importShellModule() Import the picked shell Release’s module from the host’s own origin and check that it exports mountShell, and mountPlatformControls when it offers its own Settings. The host never bundles a shell.

The picked shell’s module could not be loaded or does not fit the contract.

  • Error
Signature
new ShellModuleError(message?): ShellModuleError;
Parameter Type
message? string

ShellModuleError

Signature
Error.constructor;
Signature
new ShellModuleError(message?, options?): ShellModuleError;
Parameter Type
message? string
options? ErrorOptions

ShellModuleError

Signature
Error.constructor;
Signature
readonly name: "ShellModuleError" = "ShellModuleError";

Always ShellModuleError.

Signature
Error.name;

ShellMountInputtype alias

Section titled “ShellMountInput”
Signature
type ShellMountInput = Readonly<{
workbench: TeamWorkbenchHostHandle;
storage: AppStorage;
methods: Readonly<{
call: Promise<WhistleJsonValue>;
}>;
}>;

What a host hands the shell a Team picked. The host composes that shell into its own top-level document, so it runs with the host’s escalated permissions: the workbench mounts each child App in its sandboxed frame, and storage/methods are the shell installation’s own desktop data.


MountShelltype alias

Section titled “MountShell”
Signature
type MountShell = (root, input) => Promise<() => void>;

Render the shell into root; resolves once it is mounted, with the function that removes it again. The shell loads its own code and styles.

Parameter Type
root HTMLElement
input ShellMountInput

Promise<() => void>


ShellPlatformControlstype alias

Section titled “ShellPlatformControls”
Signature
type ShellPlatformControls = Readonly<{
controls: WorkbenchHostControls;
suggestDesktopSettings: void;
dispose: void;
}>;

Settings a shell renders for a host that has none of its own, such as a standalone Oyster: the shell draws them into root, and the host hands controls to its workbench so Apps and the dashboard can open them.


RequestShellAppAccesstype alias

Section titled “RequestShellAppAccess”
Signature
type RequestShellAppAccess = (
target,
request,
dialog,
) => Promise<AppPermissionOutcome>;

A host’s App-access flow. The host owns admission, current grants and saving; the shell renders the prompt and navigates its own Settings.

Parameter Type
target Parameters<WorkbenchHostControls["requestAppAccess"]>[0]
request AppPermissionRequest
dialog Readonly<{ ask: Promise<AppPermissionOutcome>; customize: "customize"; }>

Promise<AppPermissionOutcome>


MountPlatformControlstype alias

Section titled “MountPlatformControls”
Signature
type MountPlatformControls = (root, input) => Promise<ShellPlatformControls>;

Render the shell’s own Settings using the embedding host’s access authority.

Parameter Type
root HTMLElement
input Readonly<{ teamId: string; keysWire: Pick<KeyWire<string>, "issue" | "revoke" | "summary">; requestAppAccess: RequestShellAppAccess; }>

Promise<ShellPlatformControls>


ShellModuletype alias

Section titled “ShellModule”
Signature
type ShellModule = Readonly<{
mountShell: MountShell;
mountPlatformControls: MountPlatformControls | null;
}>;

What a host gets from a picked shell Release’s module.

importShellModule()function

Section titled “importShellModule()”
Signature
function importShellModule(
moduleUrl,
hostOrigin,
): Promise<
Readonly<{
mountShell: MountShell;
mountPlatformControls: MountPlatformControls | null;
}>
>;

Import the picked shell Release’s module from the host’s own origin and check that it exports mountShell, and mountPlatformControls when it offers its own Settings. The host never bundles a shell.

Parameter Type
moduleUrl URL
hostOrigin string

Promise<Readonly<{ mountShell: MountShell; mountPlatformControls: MountPlatformControls | null; }>>