コンテンツにスキップ

@alneas/eaos-react API

Import Contract
@alneas/eaos-react/client/browser-auth Typed public export
@alneas/eaos-react/client/client-routes Typed public export
@alneas/eaos-react/client Typed public export
@alneas/eaos-react/client/liff Typed public export
@alneas/eaos-react/client/plugin-execution Typed public export
@alneas/eaos-react/client/compute Typed public export
@alneas/eaos-react/command-workspace Typed public export
@alneas/eaos-react Typed public export
@alneas/eaos-react/record-workspace Typed public export
@alneas/eaos-react/user-guide Typed public export
@alneas/eaos-react/workspace-layout Typed public export
@alneas/eaos-react/workspace-login Typed public export
@alneas/eaos-react/workspace-shell Typed public export
@alneas/eaos-react/snapshot-workspace Typed public export
@alneas/eaos-react/workspace-fields Typed public export
@alneas/eaos-react/plugin-gate Typed public export
@alneas/eaos-react/plugin-runtime Typed public export
@alneas/eaos-react/workspace-guide.json Packaged JSON contract/data asset; resolve this exported path with the host loader
@alneas/eaos-react/docs/user-guides/workspace.md Packaged Markdown guide asset; resolve this exported path with the host loader

Trusted browser OIDC configuration with explicit authentication and redirect origins.

Imports: @alneas/eaos-react, @alneas/eaos-react/client, @alneas/eaos-react/client/browser-auth.

interface BrowserAuthConfig {
publicUrl: string;
provider: string;
returnTo?: string;
redirectOrigins: string[];
}
Name Type Required Description
publicUrl string Yes Credential-free HTTPS Kratos origin without path/query/fragment.
provider string Yes Configured OIDC provider identifier containing only letters, digits, underscores or hyphens.
returnTo string No Credential-free HTTPS destination; omitted uses current browser origin root.
redirectOrigins string[] Yes Explicit HTTPS origins permitted for the login redirect, in addition to publicUrl.

Type declaration; no runtime value.

createKratosBrowserAuth for a complete host integration example.

Credential-free HTTPS Kratos origin without path/query/fragment.

Configured OIDC provider identifier containing only letters, digits, underscores or hyphens.

Credential-free HTTPS destination; omitted uses current browser origin root.

Explicit HTTPS origins permitted for the login redirect, in addition to publicUrl.

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Host-admitted route metadata and its lazy module loader.

Imports: @alneas/eaos-react, @alneas/eaos-react/client, @alneas/eaos-react/client/client-routes.

interface ClientRoute<T = unknown> {
id: string;
pluginId: string;
path: string;
module: string;
load: () => Promise<T>;
}
Name Type Required Description
id string Yes Host route identifier used by admission logic.
pluginId string Yes Plugin owning the route.
path string Yes Host router path for this contribution.
module string Yes Declared module metadata; this helper never imports it directly.
load () => Promise<T> Yes Lazy module callback called once after initial authorization; rejection propagates.

Type declaration; no runtime value.

  • T: Host value shape carried by this contract.

loadClientRoute for a complete host integration example.

Host route identifier used by admission logic.

Plugin owning the route.

Host router path for this contribution.

Declared module metadata; this helper never imports it directly.

Lazy module callback called once after initial authorization; rejection propagates.

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Named host operation and the ordered fields displayed for its command form.

Imports: @alneas/eaos-react/command-workspace.

interface CommandAction {
operation: string;
label: string;
fields: readonly CommandField[];
note?: string;
}
Name Type Required Description
operation string Yes Host operation invoked on form submit.
label string Yes Action selector, heading and submit text.
fields readonly CommandField[] Yes Ordered command input definitions.
note string No Optional explanatory text above the form.

Type declaration; no runtime value.

CommandWorkspace for a complete host integration example.

Host operation invoked on form submit.

Action selector, heading and submit text.

Ordered command input definitions.

Optional explanatory text above the form.

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Command input configuration for native form values and optional choice catalogs.

Imports: @alneas/eaos-react/command-workspace.

interface CommandField {
key: string;
label: string;
type: 'text' | 'number' | 'date' | 'boolean' | 'textarea' | 'password';
required?: boolean;
min?: number;
max?: number;
options?: readonly {
value: string;
label: string;
}[];
collection?: string;
}
Name Type Required Description
key string Yes Input property name sent to the host operation.
label string Yes Input caption and accessible label.
type 'text' | 'number' | 'date' | 'boolean' | 'textarea' | 'password' Yes Native input kind; number values become Number and booleans use checkbox presence.
required boolean No Controls native required validation; defaults to true except booleans.
min number No Number input lower bound.
max number No Optional numeric input upper bound.
options readonly { value: string; label: string; }[] No Explicit value/label choices, taking precedence over collection.
collection string No Snapshot array key mapped to selectable record IDs when options are absent.

Type declaration; no runtime value.

CommandWorkspace for a complete host integration example.

Input property name sent to the host operation.

Input caption and accessible label.

Native input kind; number values become Number and booleans use checkbox presence.

Controls native required validation; defaults to true except booleans.

Number input lower bound.

Default: 0.

Optional numeric input upper bound.

Explicit value/label choices, taking precedence over collection.

Command option ID sent to the host rather than its presentation label.

Input caption and accessible label.

Snapshot array key mapped to selectable record IDs when options are absent.

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Renders snapshot collections and host-declared operation forms with a single pending command.

Domain definitions and transport remain host/plugin owned. Reuse authenticated SDK snapshots and UI primitives.

Imports: @alneas/eaos-react/command-workspace.

declare function CommandWorkspace({ client, definition, help }: {
help?: react.ReactNode;
client: WorkspaceClient<any> | null;
definition: CommandWorkspaceDefinition;
}): react.JSX.Element;
Name Type Required Description
{ client, definition, help } { help?: react.ReactNode; client: WorkspaceClient<any> | null; definition: CommandWorkspaceDefinition; } Yes Authenticated client or null, plugin-owned definition and optional help; undefined help uses core guide and null hides it.

react.JSX.Element

A list/form workspace, connection alert when client is missing, and status/error content while requests settle.

Requires React,

Optional help content; undefined uses core help and null hides help.

Stable host transport carrying current authentication and authorization.

Plugin-owned workspace schema, labels and operation declarations.

import * as React from 'react';
import { CommandWorkspace, type CommandWorkspaceDefinition } from '@alneas/eaos-react/command-workspace';
import type { WorkspaceClient } from '@alneas/eaos-react';
export function Page({client, definition}: {client: WorkspaceClient<unknown>; definition: CommandWorkspaceDefinition}) { return <CommandWorkspace client={client} definition={definition}/>; }

Plugin-owned collection labels, command definitions and input conversion.

Imports: @alneas/eaos-react/command-workspace.

interface CommandWorkspaceDefinition {
title: string;
sections: Readonly<Record<string, string>>;
labels: Readonly<Record<string, string>>;
actions: readonly CommandAction[];
references?: Readonly<Record<string, {
collection: string;
label: string;
}>>;
prepare?(operation: string, input: Record<string, unknown>): Record<string, unknown>;
}
Name Type Required Description
title string Yes Workspace heading.
sections Readonly<Record<string, string>> Yes Snapshot collection keys mapped to navigation labels; first key is selected initially.
labels Readonly<Record<string, string>> Yes Record property captions used to build visible scalar columns.
actions readonly CommandAction[] Yes Selectable host operations and their input definitions.
references Readonly<Record<string, { collection: string; label: string; }>> No Foreign-key display definitions naming a snapshot collection and label.
prepare Record<string, unknown> No Optional synchronous input conversion before revision is added; errors enter the command failure state.

Type declaration; no runtime value.

CommandWorkspace for a complete host integration example.

Workspace heading.

Snapshot collection keys mapped to navigation labels; first key is selected initially.

Record property captions used to build visible scalar columns.

Selectable host operations and their input definitions.

Foreign-key display definitions naming a snapshot collection and label.

Snapshot collection key used to resolve selectable/reference records.

Public reference column caption.

Optional synchronous input conversion before revision is added; errors enter the command failure state.

Parameters:

  • operation: Host operation identifier.
  • input: Operation input validated and authorized by the host.

Returns: Completes without a value after the requested side effect.

Example:

import type { CommandWorkspaceDefinition } from '@alneas/eaos-react/command-workspace';
export function commandInput(definition: CommandWorkspaceDefinition, operation: string, input: Record<string, unknown>) {
return definition.prepare?.(operation, input) ?? input;
}

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Worker message/lifecycle capabilities required by the compute executor.

Imports: @alneas/eaos-react, @alneas/eaos-react/client, @alneas/eaos-react/client/compute.

interface ComputeWorkerPort {
postMessage(value: unknown): void;
addEventListener(type: string, listener: (event: any) => void): void;
removeEventListener(type: string, listener: (event: any) => void): void;
terminate(): void;
}
Name Type Required Description
postMessage void Yes Transfer an execution envelope or result; structured-clone failures may throw.
addEventListener void Yes Register a message/error listener for the worker lifetime.
removeEventListener void Yes Remove the same listener during executor cleanup.
terminate void Yes Stop the worker; executor calls this on close, cancellation, timeout or failure.

Type declaration; no runtime value.

createWorkerPluginExecutor for a complete host integration example.

Transfer an execution envelope or result; structured-clone failures may throw.

Parameters:

  • value: Structured-cloneable message envelope.

Returns: Completes without a value after the requested side effect.

Example:

import type { ComputeWorkerPort } from '@alneas/eaos-react/client/compute';
export function postCompute(worker: ComputeWorkerPort, id: number, pluginId: string, action: string, payload: unknown) {
worker.postMessage({ id, request: { pluginId, action, payload } });
}

Register a message/error listener for the worker lifetime.

Parameters:

  • type: Message/error event name.
  • listener: Synchronous snapshot listener called on each published state.

Returns: Completes without a value after the requested side effect.

Example:

import type { ComputeWorkerPort } from '@alneas/eaos-react/client/compute';
export async function listenWhile(worker: ComputeWorkerPort, work: () => Promise<void>, received: (value: unknown) => void) {
const listener = (event: { data: unknown }) => received(event.data);
worker.addEventListener('message', listener);
try { await work(); } finally { worker.removeEventListener('message', listener); }
}

Remove the same listener during executor cleanup.

Parameters:

  • type: Message/error event name.
  • listener: Synchronous snapshot listener called on each published state.

Returns: Completes without a value after the requested side effect.

Example:

import type { ComputeWorkerPort } from '@alneas/eaos-react/client/compute';
export async function observeWorker(worker: ComputeWorkerPort, work: () => Promise<void>, received: (value: unknown) => void) {
const listener = (event: { data: unknown }) => received(event.data);
worker.addEventListener('message', listener);
try { await work(); } finally { worker.removeEventListener('message', listener); }
}

Stop the worker; executor calls this on close, cancellation, timeout or failure.

Returns: Completes without a value after the requested side effect.

Example:

import type { ComputeWorkerPort } from '@alneas/eaos-react/client/compute';
export function disposeOwnedWorker(worker: ComputeWorkerPort) { worker.terminate(); }

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Bundled static Japanese guide for the generic workspace controls.

Imports: @alneas/eaos-react/user-guide.

declare const coreWorkspaceGuide: UserGuideDocument;
Name Type Required Description
— — — No call parameters.

Declared constant value.

UserGuide for a complete host integration example.

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Renders the bundled core workspace guide in a collapsible help panel.

Imports: @alneas/eaos-react/user-guide.

declare function CoreWorkspaceHelp(): react.JSX.Element;
Name Type Required Description
— — — No call parameters.

react.JSX.Element

A UserGuide element using the bundled Japanese workspace guide.

Requires React; no host data is fetched.

import * as React from 'react';
import { CoreWorkspaceHelp } from '@alneas/eaos-react/user-guide';
export function Help() { return <CoreWorkspaceHelp/>; }

Chooses one file-saving destination and converts validation or adapter errors into failure data.

The host supplies the native adapter; a failed native save never silently changes destination.

Imports: @alneas/eaos-react, @alneas/eaos-react/client.

declare function createFileDownloader(options?: {
native?: NativeFileSaver;
web?: NativeFileSaver;
maxBytes?: number;
}): (data: Uint8Array | ArrayBuffer | Blob, save: SaveFileOptions) => Promise<SaveFileResult>;
Name Type Required Description
options { native?: NativeFileSaver; web?: NativeFileSaver; maxBytes?: number; } No Optional native/web adapters and positive maxBytes limit, defaulting to 104857600 bytes; native takes precedence.

(data: Uint8Array \| ArrayBuffer \| Blob, save: SaveFileOptions) => Promise<SaveFileResult>

An async saver accepting bytes/ArrayBuffer/Blob and SaveFileOptions, resolving SaveFileResult even on adapter failure.

No fallback follows native failure. Browser success means the download was initiated, not durably written. Blob conversion allocates memory; native/web adapters own persistence and prompts.

Error if maxBytes is not a positive safe integer at construction.

Optional native adapter; selected before web and never silently retried in another destination.

Optional web save adapter, used only when native is absent.

Positive safe byte limit; defaults to 104857600 (100 MiB).

import { createFileDownloader } from '@alneas/eaos-react/client';
const download = createFileDownloader();
export async function saveReport() {
return download(new TextEncoder().encode('name\nSample\n'), { filename: 'report.csv', contentType: 'text/csv' });
}

Creates a cookie-authenticated JSON POST transport for plugin operations.

Imports: @alneas/eaos-react, @alneas/eaos-react/client, @alneas/eaos-react/client/plugin-execution.

declare function createHttpPluginExecutor(options: {
endpoint: string;
fetch?: typeof fetch;
headers?: () => Record<string, string>;
}): PluginExecutor;
Name Type Required Description
options { endpoint: string; fetch?: typeof fetch; headers?: () => Record<string, string>; } Yes HTTPS endpoint without credentials/query/fragment; optional fetch and per-request headers callback.

PluginExecutor

An executor resolving parsed JSON, with pluginId/action appended as encoded path segments.

Host must enforce session, CSRF, tenant and operation permissions. Requests use include credentials, no-store and redirect:error; caller signal is forwarded. There are no retries or fallback destinations.

Invalid endpoint throws immediately; returned executor rejects on header/serialization/fetch/JSON errors or non-OK HTTP status.

Credential-free HTTPS execution URL without query or fragment.

Optional fetch implementation; defaults to global fetch.

Optional callback returning current host session/CSRF headers for each request.

import { createHttpPluginExecutor } from '@alneas/eaos-react/client/plugin-execution';
const execute = createHttpPluginExecutor({ endpoint: 'https://app.example.com/api/execute' });
export const readReport = () => execute({ pluginId: 'reports', action: 'read', payload: { id: 'sample' } });

Adapts a host native save_file_native command to the file-saving contract.

Optional adapter for a host-owned save_file_native command. It does not import Tauri.

Imports: @alneas/eaos-react, @alneas/eaos-react/client.

declare function createInvokeFileSaver(invoke: (command: string, args: Record<string, unknown>) => Promise<unknown>): NativeFileSaver;
Name Type Required Description
invoke (command: string, args: Record<string, unknown>) => Promise<unknown> Yes Installed native bridge; receives command and base64 data, filename and desktop flags, and must return a success boolean.

NativeFileSaver

A saver normalizing camelCase/snake_case file paths; validation, malformed responses and bridge failures reject.

Does not import Tauri. The host must implement the command and enforce allowed destinations. Desktop flags default to false; contentType is not forwarded.

import { createInvokeFileSaver } from '@alneas/eaos-react/client';
export function connectNativeSave(invoke: Parameters<typeof createInvokeFileSaver>[0]) {
return createInvokeFileSaver(invoke);
}

Adapts a native execute_plugin command with abort checks before and after invocation.

The native command must independently resolve identity and enforce operation permissions.

Imports: @alneas/eaos-react, @alneas/eaos-react/client, @alneas/eaos-react/client/plugin-execution.

declare function createInvokePluginExecutor(invoke: (command: string, args: Record<string, unknown>) => Promise<unknown>): PluginExecutor;
Name Type Required Description
invoke (command: string, args: Record<string, unknown>) => Promise<unknown> Yes Installed native bridge that independently resolves identity and checks operation permissions.

PluginExecutor

An executor resolving the native result unless its signal has been aborted.

Aborting does not interrupt the native command; it discards the eventual response. Native side effects may already have completed.

Returned executor rejects on aborted signals or native bridge rejection.

import { createInvokePluginExecutor } from '@alneas/eaos-react/client/plugin-execution';
export function connectNative(invoke: Parameters<typeof createInvokePluginExecutor>[0]) { return createInvokePluginExecutor(invoke); }

Creates cookie-based Kratos OIDC login/logout actions with CSRF flow validation and redirect allowlists.

Browser OIDC uses Kratos cookies, CSRF and provider callbacks. No native API/token impersonation.

Imports: @alneas/eaos-react, @alneas/eaos-react/client, @alneas/eaos-react/client/browser-auth.

declare function createKratosBrowserAuth(options: BrowserAuthConfig & {
fetch?: typeof fetch;
navigate: (url: string) => void;
}): {
login(): Promise<void>;
logout(): Promise<void>;
};
Name Type Required Description
options BrowserAuthConfig & { fetch?: typeof fetch; navigate: (url: string) => void; } Yes BrowserAuthConfig plus host navigate callback and optional fetch; returnTo defaults to the current browser origin root.

{ login(): Promise<void>; logout(): Promise<void>; }

login() and logout() actions resolving without a value after requesting navigation; failures reject.

Requires browser window when returnTo is omitted. Requests include cookies, disable caching/redirect following and time out after 15 seconds. Host must configure Kratos cookies/CORS and allowed identity-provider origins. Neither action confirms destination completion.

Invalid configuration throws immediately; actions reject on transport/JSON failures, rejected flows or untrusted redirects; navigate errors propagate.

Optional fetch implementation; defaults to global fetch.

Host navigation callback receiving a validated absolute redirect URL; no value is returned.

import { createKratosBrowserAuth } from '@alneas/eaos-react/client/browser-auth';
export const auth = createKratosBrowserAuth({ publicUrl: 'https://auth.example.com', provider: 'oidc', returnTo: 'https://app.example.com/', redirectOrigins: ['https://identity.example.com'], navigate: url => window.location.assign(url) });
// Call auth.login() or auth.logout() from a user action after configuring the host auth service.

Wraps a host-installed LIFF SDK with single-flight initialization and stale-profile suppression.

Imports: @alneas/eaos-react, @alneas/eaos-react/client, @alneas/eaos-react/client/liff.

declare function createLiffClient(options: {
sdk: LiffAdapter;
liffId: string;
redirectUri: string;
}): {
initialize: () => Promise<void>;
isInitialized: () => boolean;
isInClient: () => boolean;
getProfile(): Promise<LiffProfile | null>;
login(): Promise<void>;
logout(): Promise<void>;
invalidate: () => void;
};
Name Type Required Description
options { sdk: LiffAdapter; liffId: string; redirectUri: string; } Yes Installed SDK, nonblank LIFF ID and credential-free HTTPS redirectUri.

{ initialize: () => Promise<void>; isInitialized: () => boolean; isInClient: () => boolean; getProfile(): Promise<LiffProfile \| null>; login(): Promise<void>; logout(): Promise<void>; invalidate: () => void; }

initialize/isInitialized/isInClient/getProfile/login/logout/invalidate methods; getProfile returns null after logout or invalidation.

The host supplies

Invalid configuration throws; SDK failures and malformed profiles reject the corresponding action.

Host-installed SDK instance; no provider credentials are returned by the wrapper.

Nonblank registered LIFF application identifier.

Credential-free HTTPS URI configured in the host identity provider.

import { createLiffClient, type LiffAdapter } from '@alneas/eaos-react/client/liff';
export async function connectLiff(sdk: LiffAdapter, liffId: string, redirectUri: string) {
const client = createLiffClient({ sdk, liffId, redirectUri });
await client.initialize();
return { client, disconnect: () => client.invalidate() };
}

Routes an explicitly configured plugin operation to its host-selected execution placement.

The host explicitly selects placement. A native failure never uploads data to a remote fallback.

Imports: @alneas/eaos-react, @alneas/eaos-react/client, @alneas/eaos-react/client/plugin-execution.

declare function createPluginInvoker(options: {
operations: Record<string, {
placement: 'wasm' | 'browser-ai' | 'native' | 'server';
}>;
native?: PluginExecutor;
server?: PluginExecutor;
wasm?: PluginExecutor;
'browser-ai'?: PluginExecutor;
}): (request: PluginExecutionRequest, signal?: AbortSignal) => Promise<unknown>;
Name Type Required Description
options { operations: Record<string, { placement: 'wasm' | 'browser-ai' | 'native' | 'server'; }>; native?: PluginExecutor; server?: PluginExecutor; wasm?: PluginExecutor; 'browser-ai'?: PluginExecutor; } Yes Operation allowlist keyed pluginId:action and executors for wasm/browser-ai/native/server placements.

(request: PluginExecutionRequest, signal?: AbortSignal) => Promise<unknown>

An invoker resolving the selected executor result; operations are cloned when configured.

No failure triggers another placement. Native, worker and server adapters must independently enforce their trust boundaries. Cancellation is delegated after an initial abort check.

Returned invoker rejects invalid identifiers, unconfigured operations, missing executors, cancellation and executor failures.

Explicit host operation allowlist; unlisted operations are rejected.

Explicit operation location; failures never choose a different location.

Optional native adapter; selected before web and never silently retried in another destination.

Optional server executor, responsible for current tenant and operation authorization.

Optional trusted WASM worker executor.

Optional trusted browser AI executor.

import { createPluginInvoker, type PluginExecutor } from '@alneas/eaos-react/client/plugin-execution';
export function routeReports(server: PluginExecutor) {
return createPluginInvoker({ operations: { 'reports:read': { placement: 'server' } }, server });
}

Creates an external store that discards obsolete tenant replies and removes module access while identity is loading.

Host supplies auth transport/events. Missing identity, fetch failure and stale responses never grant modules.

Imports: @alneas/eaos-react.

declare function createTenantModuleStore<T extends TenantContext>(load: (signal: AbortSignal) => Promise<T | null>): TenantModuleStore<T>;
Name Type Required Description
load (signal: AbortSignal) => Promise<T | null> Yes Host loader of verified identity and enabled module IDs; receives an abort signal when refreshed or cleared.

TenantModuleStore<T>

A store initially loading with no identity; loader and context-validation failures become snapshot.error.

  • T: Verified tenant context shape, extending the required tenant/user/module fields.

Call refresh initially and on host auth events; call clear immediately on logout. A refresh aborts the previous request. This store controls UI presentation; server authorization remains mandatory.

import { createTenantModuleStore, type TenantContext } from '@alneas/eaos-react';
export async function connectIdentity(load: (signal: AbortSignal) => Promise<TenantContext | null>) {
const store = createTenantModuleStore(load);
await store.refresh();
return { store, disconnect: () => store.clear() };
}

Manages a lazy worker and rejects all pending computations when any call aborts, times out or crashes.

One worker per authenticated client scope. Cancellation terminates computation and pending calls.

Imports: @alneas/eaos-react, @alneas/eaos-react/client, @alneas/eaos-react/client/compute.

declare function createWorkerPluginExecutor(createWorker: () => ComputeWorkerPort, timeoutMs?: number): {
execute: PluginExecutor;
close(): void;
};
Name Type Required Description
createWorker () => ComputeWorkerPort Yes Factory for a trusted worker implementing the compute message protocol.
timeoutMs number No Positive safe integer timeout per call in milliseconds; defaults to 60000.

{ execute: PluginExecutor; close(): void; }

An execute transport and close() that permanently closes the session and terminates its worker.

Use one executor per authenticated scope and close on logout/unmount. A failure terminates the shared worker and all pending calls; later calls can create a fresh worker unless closed. Payloads/results must be structured-cloneable.

Invalid timeout throws immediately; execute rejects closed/aborted sessions, worker failures, timeouts or transfer errors.

import { createWorkerPluginExecutor } from '@alneas/eaos-react/client/compute';
export async function compute(workerUrl: URL) {
const executor = createWorkerPluginExecutor(() => new Worker(workerUrl, { type: 'module' }));
try { return await executor.execute({ pluginId: 'reports', action: 'sum', payload: [1, 2] }); }
finally { executor.close(); }
}

Bridges a typed plugin client through an isolated workspace session boundary.

Adapt a plugin’s typed client through the shared authenticated snapshot/session boundary.

Imports: @alneas/eaos-react.

declare function createWorkspaceClientBindings<TClient, TData>(adapt: (tenantId: string, recordId: string, client: TClient) => WorkspaceClient<TData>, unwrap: (client: WorkspaceClient<TData>) => TClient): {
Provider: ({ tenantId, sessionKey, client, children }: {
tenantId: string | null;
sessionKey: string | null;
client: TClient;
children: ReactNode;
}) => react.FunctionComponentElement<WorkspaceProviderProps<TData>>;
useClient: () => TClient | null;
};
Name Type Required Description
adapt (tenantId: string, recordId: string, client: TClient) => WorkspaceClient<TData> Yes Converts a typed client and verified scope to a workspace transport.
unwrap (client: WorkspaceClient<TData>) => TClient Yes Converts the guarded transport back to the typed plugin facade.

{ Provider: ({ tenantId, sessionKey, client, children }: { tenantId: string \| null; sessionKey: string \| null; client: TClient; children: ReactNode; }) => react.FunctionComponentElement<WorkspaceProviderProps<TData>>; useClient: () => TClient \| null; }

A Provider requiring tenantId/sessionKey/client/children and a useClient hook returning null outside its ready provider.

  • TClient: Plugin-facing client type.
  • TData: Snapshot data carried through the shared session.

Keep adapters and raw client stable. The provider uses sessionKey as recordId and closes old sessions on scope change; host transports retain authorization and persistence responsibility.

import { createWorkspaceClientBindings, type WorkspaceClient } from '@alneas/eaos-react';
const adapt = (_tenant: string, _record: string, client: WorkspaceClient<unknown>) => client;
export const { Provider, useClient } = createWorkspaceClientBindings(adapt, client => client);

Creates an isolated workspace context with a provider that expires sessions on scope changes.

Creates typed React bindings for a workspace client without owning auth or data access. Each call creates an isolated context, so unrelated plugin workspaces cannot cross-talk.

Imports: @alneas/eaos-react.

declare function createWorkspaceReactBindings<TData>(options?: WorkspaceSessionOptions): {
WorkspaceProvider: ({ tenantId, recordId, sessionKey, client, children }: WorkspaceProviderProps<TData>) => react.DetailedReactHTMLElement<{
role: "status";
}, HTMLElement> | react.FunctionComponentElement<react.ProviderProps<WorkspaceClient<TData> | null>>;
useClient: () => WorkspaceClient<TData> | null;
};
Name Type Required Description
options WorkspaceSessionOptions No Session reply ordering; defaults to session-wide latest response.

{ WorkspaceProvider: ({ tenantId, recordId, sessionKey, client, children }: WorkspaceProviderProps<TData>) => react.DetailedReactHTMLElement<{ role: "status"; }, HTMLElement> \| react.FunctionComponentElement<react.ProviderProps<WorkspaceClient<TData> \| null>>; useClient: () => WorkspaceClient<TData> \| null; }

WorkspaceProvider and useClient; the hook returns null outside a ready provider.

  • TData: Snapshot payload shared by the returned context and client.

The provider needs nonempty tenantId, recordId and sessionKey, shows status content until ready, and closes its session on cleanup. It performs no server authentication. See WorkspaceProviderProps.

import * as React from 'react';
import { createWorkspaceReactBindings, type WorkspaceProviderProps } from '@alneas/eaos-react';
const { WorkspaceProvider, useClient } = createWorkspaceReactBindings<unknown>();
export function HostWorkspace(props: WorkspaceProviderProps<unknown>) { return <WorkspaceProvider {...props}/>; }
export function ConnectionState() { return <p>{useClient() ? 'Connected' : 'Unavailable'}</p>; }

Wraps a workspace transport with session lifetime and tenant/resource response checks.

Imports: @alneas/eaos-react.

declare function createWorkspaceSession<TData>(tenantId: string, recordId: string, source: WorkspaceClient<TData>, options?: WorkspaceSessionOptions): {
close: () => void;
client: {
load: () => Promise<WorkspaceSnapshot<TData>>;
execute: (operation: string, input: Record<string, unknown>) => Promise<WorkspaceSnapshot<TData>>;
};
};
Name Type Required Description
tenantId string Yes Verified tenant ID expected on every response.
recordId string Yes Resource/session record ID expected on every response.
source WorkspaceClient<TData> Yes Host transport responsible for current authentication and authorization.
options WorkspaceSessionOptions No Response ordering scope; defaults to one latest reply for the entire session.

{ close: () => void; client: { load: () => Promise<WorkspaceSnapshot<TData>>; execute: (operation: string, input: Record<string, unknown>) => Promise<WorkspaceSnapshot<TData>>; }; }

A guarded client plus close(), which invalidates pending responses without cancelling the underlying transport.

  • TData: Payload shape supplied by the host snapshot transport.

Session operations propagate transport errors and reject after close, when superseded, or for foreign tenant/record responses. Returned snapshots are cloned; server side effects can already have committed when a response is rejected.

import { createWorkspaceSession, type WorkspaceClient } from '@alneas/eaos-react';
export async function readWorkspace(tenantId: string, recordId: string, client: WorkspaceClient<unknown>) {
const session = createWorkspaceSession(tenantId, recordId, client);
try { return await session.client.load(); }
finally { session.close(); }
}

Downloads a compute asset and checks its bytes against a caller-pinned SHA-256 digest.

Imports: @alneas/eaos-react, @alneas/eaos-react/client, @alneas/eaos-react/client/compute.

declare function fetchVerifiedComputeAsset(asset: {
url: string;
sha256: string;
}, request?: typeof fetch): Promise<ArrayBuffer>;
Name Type Required Description
asset { url: string; sha256: string; } Yes HTTPS URL (HTTP allowed only for loopback) and lowercase 64-character hexadecimal digest.
request typeof fetch No Fetch implementation; defaults to global fetch.

Promise<ArrayBuffer>

Verified asset bytes owned by the caller.

Requires Web Crypto. Fetch omits credentials, rejects redirects and disables cache; no size limit or timeout is imposed. Pin the digest from a trusted release manifest.

Rejects invalid URL/metadata, non-OK response, digest mismatch or fetch/crypto failure.

Trusted asset URL; HTTPS required except HTTP loopback development.

Pinned lowercase 64-character hexadecimal SHA-256 digest from a trusted release.

import { fetchVerifiedComputeAsset } from '@alneas/eaos-react/client/compute';
export function downloadPinnedAsset(asset: { url: string; sha256: string }) { return fetchVerifiedComputeAsset(asset); }

Installs a worker message handler that runs only host-registered pluginId:action operations.

Worker-side allowlist. Host code supplies the actual WASM/ONNX handler, never a module URL from the payload.

Imports: @alneas/eaos-react, @alneas/eaos-react/client, @alneas/eaos-react/client/compute.

declare function installComputeWorker(scope: {
addEventListener(type: string, listener: (event: any) => void): void;
postMessage(value: unknown): void;
}, operations: Readonly<Record<string, (payload: unknown) => unknown | Promise<unknown>>>): void;
Name Type Required Description
scope { addEventListener(type: string, listener: (event: any) => void): void; postMessage(value: unknown): void; } Yes Worker-like message target and response sender.
operations Readonly<Record<string, (payload: unknown) => unknown | Promise<unknown>>> Yes Trusted allowlist of handlers; each receives request.payload and may return a Promise.

void

Completes without a value after registering the listener.

Install once for a worker lifetime; no uninstall handle is returned. Errors are converted to generic failed response messages. Payload validation and access constraints belong to the registered handler; payload module URLs are never loaded.

Register the worker message handler for this worker lifetime; no disposer is returned.

Parameters:

  • type: Worker event type; installComputeWorker registers message.
  • listener: Handler receiving the host event envelope; it remains registered for this worker lifetime.

Returns: Completes without a value after the host registers the handler; no disposer is exposed by this structural scope.

Host listener-registration failures propagate synchronously.

Example:

import { installComputeWorker } from '@alneas/eaos-react/client/compute';
export function registerMessages(scope: Parameters<typeof installComputeWorker>[0], received: (payload: unknown) => void) {
scope.addEventListener('message', event => received(event.data));
// The owning host terminates this worker to end its listener lifetime.
}

Send a structured-cloneable result envelope back to the client.

Parameters:

  • value: Structured-cloneable result/error envelope returned to the client worker executor.

Returns: Completes without a value after the message is posted; no client acknowledgement is implied.

Host transfer or serialization errors propagate synchronously.

Example:

import { installComputeWorker } from '@alneas/eaos-react/client/compute';
export function replyWithResult(scope: Parameters<typeof installComputeWorker>[0], id: number, result: unknown) {
scope.postMessage({ id, ok: true, result });
}
import { installComputeWorker } from '@alneas/eaos-react/client/compute';
export function install(scope: Parameters<typeof installComputeWorker>[0]) {
installComputeWorker(scope, { 'reports:sum': payload => {
if (!Array.isArray(payload) || payload.some(v => typeof v !== 'number' || !Number.isFinite(v))) throw Error('Invalid values');
return payload.reduce((sum, value) => sum + value, 0);
} });
}

Structural contract for the host-installed LINE LIFF SDK.

Imports: @alneas/eaos-react, @alneas/eaos-react/client, @alneas/eaos-react/client/liff.

interface LiffAdapter {
init(options: {
liffId: string;
}): Promise<void>;
isLoggedIn(): boolean;
login(options: {
redirectUri: string;
}): void;
logout(): void;
getProfile(): Promise<LiffProfile>;
isInClient?(): boolean;
}
Name Type Required Description
init Promise<void> Yes Initialize the installed SDK for the given liffId; rejects SDK setup failure.
isLoggedIn boolean Yes Synchronously report the SDK login state.
login void Yes Request provider login using the configured HTTPS redirectUri; no value is returned.
logout void Yes Clear SDK login state; no value is returned.
getProfile Promise<LiffProfile> Yes Resolve presentation profile data or reject SDK failure.
isInClient boolean No Optional SDK capability reporting whether running within LINE; absence is treated as false.

Type declaration; no runtime value.

Structural interface accepted by

createLiffClient for a complete host integration example.

Initialize the installed SDK for the given liffId; rejects SDK setup failure.

Parameters:

  • options: SDK initialization or redirect options supplied by the host wrapper.

Returns: Resolves without a value after SDK initialization.

Propagates host adapter or SDK failures; async methods reject their Promise.

Example:

import type { LiffAdapter } from '@alneas/eaos-react/client/liff';
export async function initializeInstalledLiff(sdk: LiffAdapter, liffId: string) {
await sdk.init({ liffId });
return sdk.isLoggedIn();
}

Registered LIFF application ID supplied by the host-installed SDK wrapper.

Synchronously report the SDK login state.

Returns: Whether the installed SDK has a current login.

Example:

import type { LiffAdapter } from '@alneas/eaos-react/client/liff';
export function loginState(initializedSdk: LiffAdapter) { return initializedSdk.isLoggedIn(); }

Request provider login using the configured HTTPS redirectUri; no value is returned.

Parameters:

  • options: SDK initialization or redirect options supplied by the host wrapper.

Returns: Completes without a value after the requested side effect.

Example:

import type { LiffAdapter } from '@alneas/eaos-react/client/liff';
export function requestLogin(initializedSdk: LiffAdapter, registeredHttpsRedirectUri: string) {
if (!initializedSdk.isLoggedIn()) initializedSdk.login({ redirectUri: registeredHttpsRedirectUri });
}

Host-approved registered HTTPS return URI used by createLiffClient when requesting login.

Clear SDK login state; no value is returned.

Returns: Completes without a value after the requested side effect.

Example:

import type { LiffAdapter } from '@alneas/eaos-react/client/liff';
export function signOut(initializedSdk: LiffAdapter) { initializedSdk.logout(); }

Resolve presentation profile data or reject SDK failure.

Returns: The current SDK presentation profile.

Propagates host adapter or SDK failures; async methods reject their Promise.

Example:

import type { LiffAdapter } from '@alneas/eaos-react/client/liff';
export async function readProfile(initializedSdk: LiffAdapter) {
if (!initializedSdk.isLoggedIn()) return null;
return initializedSdk.getProfile(); // Presentation data, never authentication proof.
}

Optional SDK capability reporting whether running within LINE; absence is treated as false.

Returns: Whether running inside LINE.

Example:

import type { LiffAdapter } from '@alneas/eaos-react/client/liff';
export function isInsideLine(initializedSdk: LiffAdapter) { return initializedSdk.isInClient?.() === true; }

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Presentation-only LIFF profile fields without provider credentials.

Imports: @alneas/eaos-react, @alneas/eaos-react/client, @alneas/eaos-react/client/liff.

interface LiffProfile {
userId: string;
displayName: string;
pictureUrl?: string;
statusMessage?: string;
}
Name Type Required Description
userId string Yes Nonblank LINE user ID for presentation only.
displayName string Yes Display name supplied by LIFF.
pictureUrl string No Optional profile picture URL passed through as text.
statusMessage string No Optional presentation status message.

Type declaration; no runtime value.

createLiffClient for a complete host integration example.

Nonblank LINE user ID for presentation only.

Display name supplied by LIFF.

Optional profile picture URL passed through as text.

Optional presentation status message.

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Creates a host AI session with ordered WebGPU/WASM execution-provider preferences.

Thin ONNX adapter; model preparation/tensor types remain in the plugin’s Worker.

Imports: @alneas/eaos-react, @alneas/eaos-react/client, @alneas/eaos-react/client/compute.

declare function loadBrowserAiCompute<TSession>(options: {
bytes: ArrayBuffer;
createSession: (bytes: ArrayBuffer, providers: readonly string[]) => Promise<TSession>;
webgpu: boolean;
}): Promise<TSession>;
Name Type Required Description
options { bytes: ArrayBuffer; createSession: (bytes: ArrayBuffer, providers: readonly string[]) => Promise<TSession>; webgpu: boolean; } Yes Verified model bytes, host session factory and webgpu capability flag.

Promise<TSession>

The session resolved by createSession; true webgpu supplies [webgpu, wasm], otherwise [wasm].

  • TSession: Host session object, including any host-required disposal interface.

The plugin worker owns tensor types, model preparation and session disposal. This helper does not detect capabilities or implement provider fallback itself.

Rejects when the supplied session factory rejects.

Verified model or WASM binary bytes supplied by the caller.

Host AI session factory receiving bytes and ordered provider preferences; rejects preparation failure.

Whether host capability checks permit WebGPU; false selects WASM only.

import { loadBrowserAiCompute } from '@alneas/eaos-react/client/compute';
export function startModel<T>(bytes: ArrayBuffer, createSession: (bytes: ArrayBuffer, providers: readonly string[]) => Promise<T>) {
return loadBrowserAiCompute({ bytes, createSession, webgpu: false });
}

Loads a route only when host admission succeeds both before and after its module resolves.

Admission helper, not a replacement for API authorization or reactive host UI guards.

Imports: @alneas/eaos-react, @alneas/eaos-react/client, @alneas/eaos-react/client/client-routes.

declare function loadClientRoute<T>(route: ClientRoute<T>, authorize: (route: ClientRoute<T>) => boolean | Promise<boolean>): Promise<T>;
Name Type Required Description
route ClientRoute<T> Yes Declared client route and lazy loader.
authorize (route: ClientRoute<T>) => boolean | Promise<boolean> Yes Live admission predicate called before and after loading; must return true to expose the module.

Promise<T>

The loaded module after both checks succeed.

  • T: Module value returned by the host loader.

A loader can already have evaluated module side effects when the second check denies access. This helper does not enforce API authorization or reactively revoke rendered UI.

Rejects when admission denies access or authorize/load rejects.

import { loadClientRoute, type ClientRoute } from '@alneas/eaos-react/client/client-routes';
export async function admit<T>(route: ClientRoute<T>, authorize: (route: ClientRoute<T>) => Promise<boolean>) {
return loadClientRoute(route, authorize);
}

Instantiates Go WASM with a matching host runtime and waits for the host readiness handshake.

Official wasm_exec.js runtime is supplied by the host from the matching Go toolchain.

Imports: @alneas/eaos-react, @alneas/eaos-react/client, @alneas/eaos-react/client/compute.

declare function loadGoCompute(options: {
bytes: ArrayBuffer;
runtime: {
importObject: WebAssembly.Imports;
run(instance: WebAssembly.Instance): Promise<void>;
};
ready: () => Promise<void>;
invoke: (action: string, payload: unknown) => Promise<unknown>;
}): Promise<(action: string, payload: unknown) => Promise<unknown>>;
Name Type Required Description
options { bytes: ArrayBuffer; runtime: { importObject: WebAssembly.Imports; run(instance: WebAssembly.Instance): Promise<void>; }; ready: () => Promise<void>; invoke: (action: string, payload: unknown) => Promise<unknown>; } Yes Verified WASM bytes, matching wasm_exec.js runtime, readiness callback and operation invoker.

Promise<(action: string, payload: unknown) => Promise<unknown>>

An async action/payload invoker that refuses calls after an observed runtime rejection.

The host must install matching Go runtime imports, implement readiness, and manage lifetime; this helper provides no stop handle. A readiness callback that never settles leaves loading pending.

Rejects instantiation/readiness failures; returned invoker rejects stopped runtime or propagated invoke failures.

Verified model or WASM binary bytes supplied by the caller.

Official matching Go wasm_exec.js runtime installed by the host.

WebAssembly imports provided by the matching Go runtime.

Start the Go instance; rejection is recorded and causes subsequent invocations to fail.

Parameters:

  • instance: Go WebAssembly instance instantiated with this matching runtime importObject.

Returns: Resolves without a value when the Go program finishes; an active program can keep this Promise pending.

Rejects host runtime/trap failures; loadGoCompute records rejection and rejects subsequent invocations.

Example:

import { loadGoCompute } from '@alneas/eaos-react/client/compute';
export async function runInstalledGo(runtime: Parameters<typeof loadGoCompute>[0]['runtime'], instance: WebAssembly.Instance) {
await runtime.run(instance);
}

Host readiness handshake; must resolve only when the WASM entry points are usable.

Host invocation bridge for the installed runtime; rejection propagates.

import { loadGoCompute } from '@alneas/eaos-react/client/compute';
export async function startGo(options: Parameters<typeof loadGoCompute>[0]) { return loadGoCompute(options); }

Loads complete tenant-scoped reference candidates and recursively resolves labels from authorized catalogs.

Imports: @alneas/eaos-react/record-workspace.

declare function loadRecordReference(reference: RecordWorkspaceReference, tenantId: string, source: WorkspaceClient<unknown>, signal?: AbortSignal, referenceClient?: RecordWorkspaceProps['referenceClient']): Promise<RecordReferenceCandidate[]>;
Name Type Required Description
reference RecordWorkspaceReference Yes Catalog operation, list key and display fields.
tenantId string Yes Verified tenant ID for all returned records.
source WorkspaceClient<unknown> Yes Authorized catalog transport; recordId must equal reference.pluginId.
signal AbortSignal No Optional cancellation signal invalidating the session.
referenceClient RecordWorkspaceProps['referenceClient'] No Required for nested catalogs; returns independently authorized transports.

Promise<RecordReferenceCandidate[]>

Candidate records and composed display labels, including all pages or an empty array.

At most 100 pages of 100 records per catalog and four nested reference levels are accepted. Sessions close after loading; pending transport requests are not cancelled. Duplicate IDs/cursors and uncertain truncation fail instead of returning incomplete choices.

Rejects foreign/malformed responses, missing nested adapters, pagination/depth limits, cancellation or propagated transport failures.

import { loadRecordReference, type RecordWorkspaceReference } from '@alneas/eaos-react/record-workspace';
import type { WorkspaceClient } from '@alneas/eaos-react';
export function loadChoices(tenantId: string, source: WorkspaceClient<unknown>) {
const reference: RecordWorkspaceReference = { field: 'reportId', title: 'Report', pluginId: 'reports', listOperation: 'list', listKey: 'reports', displayFields: ['title'] };
return loadRecordReference(reference, tenantId, source);
}

Host file-saving callback accepting bytes and destination hints.

Imports: @alneas/eaos-react, @alneas/eaos-react/client.

type NativeFileSaver = (data: Uint8Array, options: SaveFileOptions) => Promise<SaveFileResult>;
Name Type Required Description
— — — No call parameters.

Type declaration; no runtime value.

createFileDownloader for a complete host integration example.

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Live host request and compute capabilities bound to one authenticated session.

Imports: @alneas/eaos-react, @alneas/eaos-react/plugin-runtime.

interface PluginClientRuntime {
tenantId: string;
sessionKey: string;
request(pluginId: string, path: string, input: unknown, signal: AbortSignal): Promise<unknown>;
compute(pluginId: string, action: string, input: unknown, signal: AbortSignal): Promise<unknown>;
}
Name Type Required Description
tenantId string Yes Current verified tenant identifier.
sessionKey string Yes Current authenticated session generation; replace on identity changes.
request Promise<unknown> Yes Perform an authenticated plugin API operation; resolve response data or reject host failures; honor the signal when possible.
compute Promise<unknown> Yes Perform a host-selected compute action; resolve result data or reject; authorization and cancellation are host-owned.

Type declaration; no runtime value.

createWorkspaceReactBindings for a complete host integration example.

Current verified tenant identifier.

Current authenticated session generation; replace on identity changes.

Perform an authenticated plugin API operation; resolve response data or reject host failures; honor the signal when possible.

Parameters:

  • pluginId: Plugin identifier whose current permission must be checked.
  • path: Host API operation/path.
  • input: Operation input validated and authorized by the host.
  • signal: Cancellation signal; honor it where possible and do not expose stale results.

Returns: The host API result.

Host resolves CSRF and verified session headers on every request.

Propagates host adapter or SDK failures; async methods reject their Promise.

Example:

import type { PluginClientRuntime } from '@alneas/eaos-react/plugin-runtime';
export function requestPlugin(runtime: PluginClientRuntime, pluginId: string, path: string, input: unknown, signal: AbortSignal) {
return runtime.request(pluginId, path, input, signal);
}

Perform a host-selected compute action; resolve result data or reject; authorization and cancellation are host-owned.

Parameters:

  • pluginId: Plugin identifier whose current permission must be checked.
  • action: Requested plugin action to authorize against current state.
  • input: Operation input validated and authorized by the host.
  • signal: Cancellation signal; honor it where possible and do not expose stale results.

Returns: The host compute result.

Propagates host adapter or SDK failures; async methods reject their Promise.

Example:

import type { PluginClientRuntime } from '@alneas/eaos-react/plugin-runtime';
export function computePlugin(runtime: PluginClientRuntime, pluginId: string, action: string, input: unknown, signal: AbortSignal) {
return runtime.compute(pluginId, action, input, signal);
}

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Plugin operation identifier and untrusted payload passed to an execution adapter.

Imports: @alneas/eaos-react, @alneas/eaos-react/client, @alneas/eaos-react/client/plugin-execution.

interface PluginExecutionRequest {
pluginId: string;
action: string;
payload: unknown;
}
Name Type Required Description
pluginId string Yes Plugin identifier used to select the operation adapter.
action string Yes Plugin operation name; validated by the invoker and host.
payload unknown Yes Operation input; host must validate shape and permission before use.

Type declaration; no runtime value.

createPluginInvoker for a complete host integration example.

Plugin identifier used to select the operation adapter.

Plugin operation name; validated by the invoker and host.

Operation input; host must validate shape and permission before use.

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Async operation transport whose cancellation and authorization are adapter-owned.

Imports: @alneas/eaos-react, @alneas/eaos-react/client, @alneas/eaos-react/client/plugin-execution.

type PluginExecutor = (request: PluginExecutionRequest, signal?: AbortSignal) => Promise<unknown>;
Name Type Required Description
— — — No call parameters.

Type declaration; no runtime value.

createPluginInvoker for a complete host integration example.

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Renders plugin children only when the current tenant snapshot permits the plugin.

Missing/stale identity fails closed through the existing tenant module store.

Imports: @alneas/eaos-react, @alneas/eaos-react/plugin-gate.

declare function PluginGate({ pluginId, children, fallback }: {
pluginId: string;
children: ReactNode;
fallback?: ReactNode;
}): react.ReactElement<{
'data-plugin': string;
}, string | react.JSXElementConstructor<any>> | react.DetailedReactHTMLElement<{
role: "status";
}, HTMLElement> | react.DetailedReactHTMLElement<react.HTMLAttributes<HTMLElement>, HTMLElement> | null;
Name Type Required Description
{ pluginId, children, fallback } { pluginId: string; children: ReactNode; fallback?: ReactNode; } Yes pluginId identifies the plugin; children are authorized presentation; optional fallback replaces a denied state.

react.ReactElement<{ 'data-plugin': string; }, string \| react.JSXElementConstructor<any>> \| react.DetailedReactHTMLElement<{ role: "status"; }, HTMLElement> \| react.DetailedReactHTMLElement<react.HTMLAttributes<HTMLElement>, HTMLElement> \| null

A plugin-marked div, loading paragraph, fallback div, upgrade message, or null for tenant-locked/unspecified denial.

Requires TenantModuleProvider; this UI guard never replaces host/server authorization.

Error outside TenantModuleProvider.

Plugin identifier admitted by current host policy.

React descendants rendered within this component.

Optional denied-access content; undefined selects the built-in denial behavior.

import * as React from 'react';
import { PluginGate } from '@alneas/eaos-react/plugin-gate';
export function ApprovalEntry() { return <PluginGate pluginId="approval"><a href="/plugins/approval/workspace">Approvals</a></PluginGate>; }

Provides the current authenticated request and compute adapters to plugin descendants.

Imports: @alneas/eaos-react, @alneas/eaos-react/plugin-runtime.

declare function PluginRuntimeProvider({ runtime, children }: {
runtime: PluginClientRuntime | null;
children: ReactNode;
}): react.FunctionComponentElement<react.ProviderProps<PluginClientRuntime | null>>;
Name Type Required Description
{ runtime, children } { runtime: PluginClientRuntime | null; children: ReactNode; } Yes Current host runtime or null when unavailable, plus descendant children.

react.FunctionComponentElement<react.ProviderProps<PluginClientRuntime \| null>>

A runtime context provider rendering children.

Replace runtime/sessionKey when identity changes. Operation hooks abort pending signals on cleanup and reject stale replies; host transports remain responsible for authorization.

Official matching Go wasm_exec.js runtime installed by the host.

React descendants rendered within this component.

import * as React from 'react';
import { PluginRuntimeProvider, type PluginClientRuntime } from '@alneas/eaos-react/plugin-runtime';
export function RuntimeRoot({runtime, children}: {runtime: PluginClientRuntime | null; children: React.ReactNode}) { return <PluginRuntimeProvider runtime={runtime}>{children}</PluginRuntimeProvider>; }

Host tenant context augmented with per-plugin presentation admission decisions.

Imports: @alneas/eaos-react, @alneas/eaos-react/plugin-gate.

interface PluginTenantContext extends TenantContext {
pluginAccess: Readonly<Record<string, {
allowed: boolean;
reason?: string;
}>>;
}
Name Type Required Description
pluginAccess Readonly<Record<string, { allowed: boolean; reason?: string; }>> Yes Host-admitted plugin decisions; allowed must be true as well as enabledModules membership; optional reason selects denial presentation.

Type declaration; no runtime value.

Authenticated host snapshot. These decisions control presentation only.

createWorkspaceReactBindings for a complete host integration example.

Host-admitted plugin decisions; allowed must be true as well as enabledModules membership; optional reason selects denial presentation.

Host admission decision; must be true along with module membership to show plugin content.

Optional host denial reason used to select unavailable/upgrade UI.

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Projects a command schema into form fields without mutating the original schema.

Imports: @alneas/eaos-react/record-workspace.

declare function recordFormSchema(schema: Schema, excluded?: readonly string[]): JSONSchema;
Name Type Required Description
schema Schema Yes Canonical command schema.
excluded readonly string[] No Field keys removed from properties and required; defaults to none.

JSONSchema

A shallow schema copy with retained properties and corresponding required entries.

Derive a presentation schema without changing the server’s command contract.

import { recordFormSchema } from '@alneas/eaos-react/record-workspace';
const form = recordFormSchema({ type: 'object', properties: { title: { type: 'string' }, revision: { type: 'integer' } }, required: ['title', 'revision'] }, ['revision']);

Selects schema-declared form values and omits optional blanks incompatible with their field constraints.

Imports: @alneas/eaos-react/record-workspace.

declare function recordFormValues(schema: Schema, values: Record<string, unknown>): Record<string, unknown>;
Name Type Required Description
schema Schema Yes Form schema whose properties define accepted keys.
values Record<string, unknown> Yes Typed form values; values are not coerced.

Record<string, unknown>

A new object excluding undeclared/undefined values and invalid optional empty numeric, enum, patterned or minLength fields.

Does not perform full JSON Schema validation. Required blank values remain for server validation.

Invalid regular-expression patterns in schema properties may throw.

import { recordFormValues } from '@alneas/eaos-react/record-workspace';
const values = recordFormValues({ properties: { title: { type: 'string' }, amount: { type: 'number' } } }, { title: 'Report', amount: '', unknown: true });

Tenant-scoped reference record paired with its authorized presentation label.

Imports: @alneas/eaos-react/record-workspace.

interface RecordReferenceCandidate {
record: ScopedUiRecord;
label: string;
}
Name Type Required Description
record ScopedUiRecord Yes Tenant-validated original candidate record.
label string Yes Composed authorized catalog display text; does not replace command IDs.

Type declaration; no runtime value.

RecordWorkspace for a complete host integration example.

Tenant-validated original candidate record.

Composed authorized catalog display text; does not replace command IDs.

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Composes a reference label from nonblank string display fields and optional authorized related labels.

Imports: @alneas/eaos-react/record-workspace.

declare function recordReferenceLabel(reference: RecordWorkspaceReference, record: ScopedUiRecord, related?: Readonly<Record<string, ReadonlyMap<string, string>>>): string;
Name Type Required Description
reference RecordWorkspaceReference Yes Ordered displayFields used to label the record.
record ScopedUiRecord Yes Tenant-scoped candidate; scope must already be checked.
related Readonly<Record<string, ReadonlyMap<string, string>>> No Optional field-to-ID/label maps; defaults to no substitutions.

string

Trimmed string parts joined by /, or record.id when no usable strings exist.

import { recordReferenceLabel } from '@alneas/eaos-react/record-workspace';
const label = recordReferenceLabel({ field: 'reportId', title: 'Report', pluginId: 'reports', listOperation: 'list', listKey: 'reports', displayFields: ['title'] }, { tenantId: 'sample', id: 'one', revision: 1, title: 'Annual report' });

Renders a scoped record list/detail editor and plugin-owned commands using declared schemas.

A host-bound record editor. Domain schemas, commands and labels belong to each plugin.

Imports: @alneas/eaos-react/record-workspace.

declare function RecordWorkspace({ definition, referenceClient, onRecordChange, onReady, recordOverride, help }: RecordWorkspaceProps & {
definition: RecordWorkspaceDefinition;
}): react.JSX.Element;
Name Type Required Description
{ definition, referenceClient, onRecordChange, onReady, recordOverride, help } RecordWorkspaceProps & { definition: RecordWorkspaceDefinition; } Yes RecordWorkspaceProps plus the required RecordWorkspaceDefinition; host supplies admitted references, callbacks and optional help.

react.JSX.Element

The record workspace UI or a connection-required paragraph while no scoped client is available.

Requires React,

Plugin-owned workspace schema, labels and operation declarations.

import * as React from 'react';
import { RecordWorkspace, RecordWorkspaceProvider, type RecordWorkspaceDefinition } from '@alneas/eaos-react/record-workspace';
import type { WorkspaceClient } from '@alneas/eaos-react';
export function Records({tenantId, sessionKey, client, definition}: {tenantId: string; sessionKey: string; client: WorkspaceClient<unknown>; definition: RecordWorkspaceDefinition}) { return <RecordWorkspaceProvider tenantId={tenantId} recordId={definition.id} sessionKey={sessionKey} client={client}><RecordWorkspace definition={definition}/></RecordWorkspaceProvider>; }

Plugin command form schema and selected-record/preview behavior.

Imports: @alneas/eaos-react/record-workspace.

interface RecordWorkspaceCommand {
operation: string;
label: string;
schema: Schema;
record?: boolean;
preview?: boolean;
initialValues?: Record<string, unknown>;
}
Name Type Required Description
operation string Yes Host command operation name.
label string Yes Button and form heading text.
schema Schema Yes Canonical command input schema used to derive the form.
record boolean No Require a selected record and include its ID/revision when true; defaults to false.
preview boolean No Show command response as a preview instead of treating it as a normal mutation; defaults to false.
initialValues Record<string, unknown> No Optional plugin-owned form defaults for this command.

Type declaration; no runtime value.

RecordWorkspace for a complete host integration example.

Host command operation name.

Button and form heading text.

Canonical command input schema used to derive the form.

Require a selected record and include its ID/revision when true; defaults to false.

Show command response as a preview instead of treating it as a normal mutation; defaults to false.

Optional plugin-owned form defaults for this command.

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Plugin-owned record operations, schemas, columns and workflow affordances.

Imports: @alneas/eaos-react/record-workspace.

interface RecordWorkspaceDefinition {
id: string;
title: string;
listKey: string;
operations: {
list: string;
get: string;
create: string;
update: string;
};
schemas: Readonly<Record<string, Schema>>;
columns: readonly {
accessorKey: string;
header: string;
value?: (record: ScopedUiRecord) => unknown;
}[];
commands?: readonly RecordWorkspaceCommand[];
workflowFields?: readonly string[];
hiddenDetailFields?: readonly string[];
canEdit?: (record: ScopedUiRecord) => boolean;
references?: readonly RecordWorkspaceReference[];
}
Name Type Required Description
id string Yes Plugin workspace/resource identifier.
title string Yes Workspace heading.
listKey string Yes Snapshot payload property containing the record list.
operations { list: string; get: string; create: string; update: string; } Yes Host list/get/create/update command names.
schemas Readonly<Record<string, Schema>> Yes Canonical command schemas indexed by operation name.
columns readonly { accessorKey: string; header: string; value?: (record: ScopedUiRecord) => unknown; }[] Yes Ordered table columns with headers and optional value(record) presentation callbacks.
commands readonly RecordWorkspaceCommand[] No Optional plugin workflow/preview forms.
workflowFields readonly string[] No Fields excluded from generic edits because plugin commands own them.
hiddenDetailFields readonly string[] No Fields omitted from generic detail rendering.
canEdit (record: ScopedUiRecord) => boolean No Optional UI edit predicate; absence permits the edit affordance, while server permission is always required.
references readonly RecordWorkspaceReference[] No Optional authorized foreign-key catalogs used by forms and display labels.

Type declaration; no runtime value.

RecordWorkspace for a complete host integration example.

Plugin workspace/resource identifier.

Workspace heading.

Snapshot payload property containing the record list.

Host list/get/create/update command names.

Host list operation used for initial loading and pagination.

Host single-record operation used for selection.

Host create operation used by the new-record form.

Host optimistic update operation used by the edit form.

Canonical command schemas indexed by operation name.

Ordered table columns with headers and optional value(record) presentation callbacks.

Record property key projected by this table column.

Public table column heading.

Optional presentation callback receiving a scoped record and returning the displayed cell value.

Optional plugin workflow/preview forms.

Fields excluded from generic edits because plugin commands own them.

Fields changed exclusively through the plugin’s workflow commands.

Fields omitted from generic detail rendering.

Fields presented by a plugin-owned detail component instead of the generic description list.

Optional UI edit predicate; absence permits the edit affordance, while server permission is always required.

UI affordance only. The server must independently enforce edit permissions and state.

Optional authorized foreign-key catalogs used by forms and display labels.

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Optional plugin help, reference transports and record/ready notifications.

Imports: @alneas/eaos-react/record-workspace.

interface RecordWorkspaceProps {
help?: react.ReactNode;
referenceClient?: (reference: RecordWorkspaceReference) => WorkspaceClient<unknown>;
onRecordChange?: (record: ScopedUiRecord | null) => void;
recordOverride?: ScopedUiRecord | null;
onReady?: (snapshot: WorkspaceSnapshot<unknown>) => void | Promise<void>;
}
Name Type Required Description
help react.ReactNode No Optional help content; undefined uses Core guide and null hides it.
referenceClient (reference: RecordWorkspaceReference) => WorkspaceClient<unknown> No Host resolver returning a separately authorized transport per reference catalog.
onRecordChange (record: ScopedUiRecord | null) => void No Notifies the plugin when the selected record changes or clears.
recordOverride ScopedUiRecord | null No Newer authorized result for the currently selected record; foreign or nonnewer results are not adopted.
onReady (snapshot: WorkspaceSnapshot<unknown>) => void | Promise<void> No Optional callback after the initial list load; may asynchronously load auxiliary plugin views.

Type declaration; no runtime value.

RecordWorkspace for a complete host integration example.

Optional help content; undefined uses Core guide and null hides it.

Plugin-supplied guide; defaults to the generic Core guide. null deliberately hides it.

Host resolver returning a separately authorized transport per reference catalog.

Authenticated host transport; the plugin declares the allowed reference catalogs.

Notifies the plugin when the selected record changes or clears.

Newer authorized result for the currently selected record; foreign or nonnewer results are not adopted.

Newer authorized response from a plugin-owned operation, for the already selected record only.

Optional callback after the initial list load; may asynchronously load auxiliary plugin views.

Load plugin-owned auxiliary views after the shared initial list request has completed.

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Provides record workspace transports with independent latest-response channels per operation/resource.

Imports: @alneas/eaos-react/record-workspace.

declare const RecordWorkspaceProvider: ({ tenantId, recordId, sessionKey, client, children }: WorkspaceProviderProps<unknown>) => react.DetailedReactHTMLElement<{
role: "status";
}, HTMLElement> | react.FunctionComponentElement<react.ProviderProps<WorkspaceClient<unknown> | null>>;
Name Type Required Description
{ tenantId, recordId, sessionKey, client, children } WorkspaceProviderProps<unknown> Yes WorkspaceProviderProps for the verified tenant/resource/session and stable host client.

react.DetailedReactHTMLElement<{ role: "status"; }, HTMLElement> \| react.FunctionComponentElement<react.ProviderProps<WorkspaceClient<unknown> \| null>>

Children once the scoped session is ready; otherwise loading/unavailable status content.

See createWorkspaceReactBindings. Scope changes/unmount close the UI session; API authorization remains host-owned.

import * as React from 'react';
import { RecordWorkspace, RecordWorkspaceProvider, type RecordWorkspaceDefinition } from '@alneas/eaos-react/record-workspace';
import type { WorkspaceClient } from '@alneas/eaos-react';
export function Records({tenantId, sessionKey, client, definition}: {tenantId: string; sessionKey: string; client: WorkspaceClient<unknown>; definition: RecordWorkspaceDefinition}) { return <RecordWorkspaceProvider tenantId={tenantId} recordId={definition.id} sessionKey={sessionKey} client={client}><RecordWorkspace definition={definition}/></RecordWorkspaceProvider>; }

Authorized reference catalog declaration and ordered label projection.

Imports: @alneas/eaos-react/record-workspace.

interface RecordWorkspaceReference {
field: string;
title: string;
pluginId: string;
listOperation: string;
listKey: string;
displayFields: readonly string[];
references?: readonly RecordWorkspaceReference[];
}
Name Type Required Description
field string Yes Foreign-key field receiving the selected record ID.
title string Yes Reference selector label.
pluginId string Yes Catalog owner and expected response recordId.
listOperation string Yes Host operation used to read the authorized catalog.
listKey string Yes Response data property containing the candidate array.
displayFields readonly string[] Yes Ordered string fields used to form labels; empty labels fall back to record ID.
references readonly RecordWorkspaceReference[] No Optional child catalogs resolving foreign-key display fields; nested loading requires referenceClient.

Type declaration; no runtime value.

RecordWorkspace for a complete host integration example.

Foreign-key field receiving the selected record ID.

Reference selector label.

Catalog owner and expected response recordId.

Host operation used to read the authorized catalog.

Response data property containing the candidate array.

Ordered string fields used to form labels; empty labels fall back to record ID.

Optional child catalogs resolving foreign-key display fields; nested loading requires referenceClient.

Related labels, resolved through separately authorized catalogs (for example a room’s property).

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

File destination hints accepted by native and browser save adapters.

Imports: @alneas/eaos-react, @alneas/eaos-react/client.

interface SaveFileOptions {
filename: string;
contentType?: string;
revealInFinder?: boolean;
openWithDefaultApp?: boolean;
}
Name Type Required Description
filename string Yes Single safe filename up to 200 characters; no path separators/reserved desktop names.
contentType string No Browser Blob MIME type.
revealInFinder boolean No Request native file-manager reveal; ignored by browser saver.
openWithDefaultApp boolean No Request native opening after save; ignored by browser saver.

Type declaration; no runtime value.

createFileDownloader for a complete host integration example.

Single safe filename up to 200 characters; no path separators/reserved desktop names.

Browser Blob MIME type.

Default: 'application/octet-stream'.

Request native file-manager reveal; ignored by browser saver.

Default: false.

Request native opening after save; ignored by browser saver.

Default: false.

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Save outcome data; success need not prove a browser download was durably written.

Imports: @alneas/eaos-react, @alneas/eaos-react/client.

interface SaveFileResult {
success: boolean;
filePath?: string;
error?: string;
}
Name Type Required Description
success boolean Yes Whether the adapter reports success; browser success only confirms initiation.
filePath string No Optional host-reported native destination path; absent for browser downloads.
error string No Optional failure message returned as data rather than rejection by createFileDownloader.

Type declaration; no runtime value.

createFileDownloader for a complete host integration example.

Whether the adapter reports success; browser success only confirms initiation.

Optional host-reported native destination path; absent for browser downloads.

Optional failure message returned as data rather than rejection by createFileDownloader.

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Starts an anchor download and schedules object URL cleanup.

Imports: @alneas/eaos-react, @alneas/eaos-react/client.

declare function saveInBrowser(bytes: Uint8Array, options: SaveFileOptions): Promise<SaveFileResult>;
Name Type Required Description
bytes Uint8Array Yes File contents copied into a Blob.
options SaveFileOptions Yes Filename and MIME type; contentType defaults to application/octet-stream; desktop reveal/open flags are ignored.

Promise<SaveFileResult>

Success after clicking the anchor; no path or durable-save confirmation is available.

Requires browser document, Blob and object URL APIs. The anchor is removed immediately and URL revoked after one second.

Rejects for invalid filename, unavailable document or browser API failure.

import { saveInBrowser } from '@alneas/eaos-react/client';
export const saveText = () => saveInBrowser(new TextEncoder().encode('Hello'), { filename: 'hello.txt', contentType: 'text/plain' });

Checks that a UI record belongs to the expected tenant and has a usable ID and positive revision.

Imports: @alneas/eaos-react/record-workspace.

declare function scopedUiRecord(value: unknown, tenantId: string): ScopedUiRecord;
Name Type Required Description
value unknown Yes Untrusted record response.
tenantId string Yes Verified tenant ID expected on the record.

ScopedUiRecord

The original record object without cloning or validating domain fields.

Error for missing/foreign tenant, empty ID or nonpositive/noninteger revision.

import { scopedUiRecord } from '@alneas/eaos-react/record-workspace';
const record = scopedUiRecord({ tenantId: 'sample', id: 'one', revision: 1 }, 'sample');

UI record with verified tenant, nonempty ID and positive optimistic revision.

Imports: @alneas/eaos-react/record-workspace.

interface ScopedUiRecord {
tenantId: string;
id: string;
revision: number;
[key: string]: unknown;
}
Name Type Required Description
tenantId string Yes Verified tenant owning this record.
id string Yes Nonempty resource ID.
revision number Yes Positive safe integer used for optimistic concurrency.

Type declaration; no runtime value.

RecordWorkspace for a complete host integration example.

Verified tenant owning this record.

Nonempty resource ID.

Positive safe integer used for optimistic concurrency.

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Renders snapshot lists, nested details and host-declared forms while discarding stale UI replies.

Snapshot-oriented list/detail/forms. Business conversions, labels and lock context stay plugin-owned.

Imports: @alneas/eaos-react/snapshot-workspace.

declare function SnapshotWorkspace({ client, definition, help }: {
client: WorkspaceClient<any> | null;
definition: SnapshotWorkspaceDefinition;
help?: react.ReactNode;
}): react.JSX.Element;
Name Type Required Description
{ client, definition, help } { client: WorkspaceClient<any> | null; definition: SnapshotWorkspaceDefinition; help?: react.ReactNode; } Yes Authenticated client or null, plugin-owned definition and optional help; undefined help uses core guide and null hides it.

react.JSX.Element

A list/form workspace, connection alert when client is missing, and status/error content while requests settle.

Requires React,

Stable host transport carrying current authentication and authorization.

Plugin-owned workspace schema, labels and operation declarations.

Optional help content; undefined uses core help and null hides help.

import * as React from 'react';
import { SnapshotWorkspace, type SnapshotWorkspaceDefinition } from '@alneas/eaos-react/snapshot-workspace';
import type { WorkspaceClient } from '@alneas/eaos-react';
export function Page({client, definition}: {client: WorkspaceClient<unknown>; definition: SnapshotWorkspaceDefinition}) { return <SnapshotWorkspace client={client} definition={definition}/>; }

Plugin-owned list/detail labels, actions and snapshot context conversion.

Imports: @alneas/eaos-react/snapshot-workspace.

interface SnapshotWorkspaceDefinition {
title: string;
sections: Readonly<Record<string, string>>;
labels: Readonly<Record<string, string>>;
actions: readonly {
operation: string;
label: string;
fields: readonly {
key: string;
label: string;
type: string;
required?: boolean;
}[];
}[];
arrayLabels?: Readonly<Record<string, string>>;
itemLabels?: Readonly<Record<string, string>>;
nestedDetails?: readonly string[];
collectionKey?(record: any): string;
collectionLabel?(record: any): string;
prepare?(operation: string, input: Record<string, unknown>, state: any): Record<string, unknown>;
context?(operation: string, state: any): Record<string, unknown>;
}
Name Type Required Description
title string Yes Workspace heading.
sections Readonly<Record<string, string>> Yes Snapshot collection keys mapped to navigation labels.
labels Readonly<Record<string, string>> Yes Scalar record field captions.
actions readonly { operation: string; label: string; fields: readonly { key: string; label: string; type: string; required?: boolean; }[]; }[] Yes Host operation forms with ordered key/label/type/required field metadata.
arrayLabels Readonly<Record<string, string>> No Optional captions for array-valued detail fields.
itemLabels Readonly<Record<string, string>> No Optional captions for nested item fields.
nestedDetails readonly string[] No Optional field keys rendered as nested details.
collectionKey string No Optional callback returning the collection key for a record.
collectionLabel string No Optional callback returning the collection display label for a record.
prepare Record<string, unknown> No Optional synchronous conversion of operation input using current snapshot state.
context Record<string, unknown> No Optional callback adding operation-specific lock/scope input; its fields are spread after the snapshot revision.

Type declaration; no runtime value.

SnapshotWorkspace for a complete host integration example.

Workspace heading.

Snapshot collection keys mapped to navigation labels.

Scalar record field captions.

Host operation forms with ordered key/label/type/required field metadata.

Host operation identifier.

Human-readable field caption.

Ordered command input definitions.

Command input property key.

Human-readable field caption.

Command field kind; supported special forms include collection selectors and numeric/boolean inputs.

Whether the generated command input is required; omitted defaults to true.

Optional captions for array-valued detail fields.

Optional captions for nested item fields.

Optional field keys rendered as nested details.

Optional callback returning the collection key for a record.

Parameters:

  • record: Host callback input; see the containing contract for validation and scope requirements.

Returns: Completes without a value after the requested side effect.

Example:

import type { SnapshotWorkspaceDefinition } from '@alneas/eaos-react/snapshot-workspace';
export function optionKey(definition: SnapshotWorkspaceDefinition, record: Record<string, unknown> & { id: string }) {
return definition.collectionKey?.(record) ?? record.id;
}

Optional callback returning the collection display label for a record.

Parameters:

  • record: Host callback input; see the containing contract for validation and scope requirements.

Returns: Completes without a value after the requested side effect.

Example:

import type { SnapshotWorkspaceDefinition } from '@alneas/eaos-react/snapshot-workspace';
export function optionLabel(definition: SnapshotWorkspaceDefinition, record: Record<string, unknown> & { id: string; name?: string }) {
return definition.collectionLabel?.(record) ?? record.name ?? record.id;
}

Optional synchronous conversion of operation input using current snapshot state.

Parameters:

  • operation: Host operation identifier.
  • input: Operation input validated and authorized by the host.
  • state: Host callback input; see the containing contract for validation and scope requirements.

Returns: Completes without a value after the requested side effect.

Example:

import type { SnapshotWorkspaceDefinition } from '@alneas/eaos-react/snapshot-workspace';
export function snapshotInput(definition: SnapshotWorkspaceDefinition, operation: string, input: Record<string, unknown>, state: unknown) {
return definition.prepare?.(operation, input, state) ?? input;
}

Optional callback adding operation-specific lock/scope input; its fields are spread after the snapshot revision.

Parameters:

  • operation: Host operation identifier.
  • state: Host callback input; see the containing contract for validation and scope requirements.

Returns: Completes without a value after the requested side effect.

Example:

import type { SnapshotWorkspaceDefinition } from '@alneas/eaos-react/snapshot-workspace';
export function operationContext(definition: SnapshotWorkspaceDefinition, operation: string, state: unknown) {
return definition.context?.(operation, state) ?? {};
}

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Verified host identity and enabled module IDs used for UI admission.

Imports: @alneas/eaos-react.

interface TenantContext {
tenantId: string;
userId: string | null;
enabledModules: readonly string[];
}
Name Type Required Description
tenantId string Yes Verified nonempty tenant identifier.
userId string | null Yes Authenticated user ID; null represents missing identity and is rejected by the store when a context is loaded.
enabledModules readonly string[] Yes Module IDs admitted by the host; copied and frozen by createTenantModuleStore.

Type declaration; no runtime value.

createWorkspaceReactBindings for a complete host integration example.

Verified nonempty tenant identifier.

Authenticated user ID; null represents missing identity and is rejected by the store when a context is loaded.

Module IDs admitted by the host; copied and frozen by createTenantModuleStore.

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Makes a host-owned tenant module store available to descendant React hooks.

Imports: @alneas/eaos-react.

declare function TenantModuleProvider<T extends TenantContext>({ store, children }: {
store: TenantModuleStore<T>;
children: ReactNode;
}): react.FunctionComponentElement<react.ProviderProps<TenantModuleStore<TenantContext> | null>>;
Name Type Required Description
{ store, children } { store: TenantModuleStore<T>; children: ReactNode; } Yes Store and children; keep store identity stable across renders.

react.FunctionComponentElement<react.ProviderProps<TenantModuleStore<TenantContext> \| null>>

A context provider rendering children without initiating a refresh.

  • T: Host tenant context supplied by the store.

Requires React. The host owns refreshing and clearing the store on authentication changes.

Host-owned external tenant store; keep its identity stable across renders.

React descendants rendered within this component.

import * as React from 'react';
import { TenantModuleProvider, type TenantModuleStore, type TenantContext } from '@alneas/eaos-react';
export function TenantRoot({store, children}: {store: TenantModuleStore<TenantContext>; children: React.ReactNode}) {
return <TenantModuleProvider store={store}>{children}</TenantModuleProvider>;
}

Host-driven subscription and refresh contract for tenant module visibility.

Imports: @alneas/eaos-react.

interface TenantModuleStore<T extends TenantContext> {
subscribe(listener: () => void): () => void;
getSnapshot(): TenantSnapshot<T>;
refresh(): Promise<void>;
clear(): void;
}
Name Type Required Description
subscribe () => void Yes Register a synchronous snapshot-change listener; returns its unsubscribe callback.
getSnapshot TenantSnapshot<T> Yes Return the current stable immutable snapshot.
refresh Promise<void> Yes Abort the previous request, clear identity while loading and publish only the latest result; errors become snapshot.error.
clear void Yes Abort pending loading and publish a nonloading anonymous snapshot; no value is returned.

Type declaration; no runtime value.

  • T: Host value shape carried by this contract.

createWorkspaceReactBindings for a complete host integration example.

Register a synchronous snapshot-change listener; returns its unsubscribe callback.

Parameters:

  • listener: Synchronous snapshot listener called on each published state.

Returns: An unsubscribe callback; call it during cleanup.

Example:

import type { TenantModuleStore, TenantContext, TenantSnapshot } from '@alneas/eaos-react';
export async function observeWhile(store: TenantModuleStore<TenantContext>, work: () => Promise<void>, changed: (snapshot: TenantSnapshot<TenantContext>) => void) {
const unsubscribe = store.subscribe(() => changed(store.getSnapshot()));
try { await work(); } finally { unsubscribe(); }
}

Return the current stable immutable snapshot.

Returns: The current stable snapshot.

Example:

import type { TenantModuleStore, TenantContext } from '@alneas/eaos-react';
export function currentIdentity(store: TenantModuleStore<TenantContext>) {
const snapshot = store.getSnapshot();
return { context: snapshot.context, loading: snapshot.loading, error: snapshot.error };
}

Abort the previous request, clear identity while loading and publish only the latest result; errors become snapshot.error.

Returns: Resolves without a value after publishing the latest context or error.

Example:

import type { TenantModuleStore, TenantContext } from '@alneas/eaos-react';
export async function reloadIdentity(store: TenantModuleStore<TenantContext>) {
await store.refresh();
return store.getSnapshot(); // Inspect error as well as context after completion.
}

Abort pending loading and publish a nonloading anonymous snapshot; no value is returned.

Returns: Completes without a value after clearing identity.

Example:

import type { TenantModuleStore, TenantContext } from '@alneas/eaos-react';
export function onHostIdentityRemoved(store: TenantModuleStore<TenantContext>) {
store.clear(); // Called by the host after logout or identity loss.
}

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Immutable external-store state with fail-closed identity while loading or after failure.

Imports: @alneas/eaos-react.

interface TenantSnapshot<T extends TenantContext> {
context: T | null;
loading: boolean;
error: Error | null;
}
Name Type Required Description
context T | null Yes Verified identity, or null while loading/unauthenticated/failed.
loading boolean Yes True while the newest context request is pending.
error Error | null Yes Loader/validation error for the newest request, or null.

Type declaration; no runtime value.

  • T: Host value shape carried by this contract.

createWorkspaceReactBindings for a complete host integration example.

Verified identity, or null while loading/unauthenticated/failed.

True while the newest context request is pending.

Loader/validation error for the newest request, or null.

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Adds missing plugin field titles recursively through properties and items without replacing explicit titles.

Imports: @alneas/eaos-react/record-workspace.

declare function titleRecordSchema(schema: any, labels: Readonly<Record<string, string>>): any;
Name Type Required Description
schema any Yes JSON-schema-like object to copy.
labels Readonly<Record<string, string>> Yes Field-key to display-title map; absent labels fall back to the field key.

any

A recursively copied properties/items tree preserving other schema metadata.

Add plugin-owned labels without mutating the command’s canonical schema.

import { titleRecordSchema } from '@alneas/eaos-react/record-workspace';
const schema = titleRecordSchema({ type: 'object', properties: { title: { type: 'string' } } }, { title: 'Report title' });

Derives fail-closed plugin visibility from the authenticated module and plugin-access snapshots.

Imports: @alneas/eaos-react, @alneas/eaos-react/plugin-gate.

declare function usePluginAccess(pluginId: string): {
allowed: boolean;
loading: boolean;
reason: string | undefined;
};
Name Type Required Description
pluginId string Yes Plugin key present in both enabledModules and pluginAccess.

{ allowed: boolean; loading: boolean; reason: string \| undefined; }

Allowed/loading flags and optional host denial reason; allowed is false during loading or errors.

Requires TenantModuleProvider and PluginTenantContext from a trusted host loader; does not grant server access.

Error outside TenantModuleProvider.

import * as React from 'react';
import { usePluginAccess } from '@alneas/eaos-react/plugin-gate';
// Render under the host TenantModuleProvider.
export function ApprovalStatus() { const access = usePluginAccess('approval'); return <p>{access.allowed ? 'Available' : 'Unavailable'}</p>; }

Creates a session-bound request function for one plugin using the nearest host runtime.

Imports: @alneas/eaos-react, @alneas/eaos-react/plugin-runtime.

declare const usePluginApi: (pluginId: string) => <T = unknown>(operation: string, input?: unknown) => Promise<T>;
Name Type Required Description
pluginId string Yes Lowercase plugin ID starting with a letter and containing letters, digits or hyphens; maximum 128 characters.

<T = unknown>(operation: string, input?: unknown) => Promise<T>

A generic async (operation, input?) function resolving host data; its type argument is a caller assertion, not runtime validation.

Use within React under PluginRuntimeProvider. Scope changes/unmount abort the shared signal and invalidate replies. Host must honor cancellation where possible; completed side effects are not rolled back.

Returned function rejects missing runtime, invalid plugin ID, expired session and propagated host errors.

import * as React from 'react';
import { usePluginApi } from '@alneas/eaos-react/plugin-runtime';
// Mount below PluginRuntimeProvider supplied by the authenticated host.
export function ReloadButton() { const execute = usePluginApi('reports'); return <button onClick={() => void execute('read', { id: 'sample' }).catch(console.error)}>Read</button>; }

Creates a session-bound compute function for one plugin using the nearest host runtime.

Imports: @alneas/eaos-react, @alneas/eaos-react/plugin-runtime.

declare const usePluginCompute: (pluginId: string) => <T = unknown>(operation: string, input?: unknown) => Promise<T>;
Name Type Required Description
pluginId string Yes Lowercase plugin ID starting with a letter and containing letters, digits or hyphens; maximum 128 characters.

<T = unknown>(operation: string, input?: unknown) => Promise<T>

A generic async (operation, input?) function resolving host data; its type argument is a caller assertion, not runtime validation.

Use within React under PluginRuntimeProvider. Scope changes/unmount abort the shared signal and invalidate replies. Host must honor cancellation where possible; completed side effects are not rolled back.

Returned function rejects missing runtime, invalid plugin ID, expired session and propagated host errors.

import * as React from 'react';
import { usePluginCompute } from '@alneas/eaos-react/plugin-runtime';
// Mount below PluginRuntimeProvider supplied by the authenticated host.
export function ReloadButton() { const execute = usePluginCompute('reports'); return <button onClick={() => void execute('read', { id: 'sample' }).catch(console.error)}>Read</button>; }

Reads the scoped transport from the nearest RecordWorkspaceProvider.

Imports: @alneas/eaos-react/record-workspace.

declare const useRecordWorkspaceClient: () => WorkspaceClient<unknown> | null;
Name Type Required Description
— — — No call parameters.

WorkspaceClient<unknown> \| null

The session-guarded client, or null outside a ready provider.

React hook; see RecordWorkspace for provider setup.

import { useRecordWorkspaceClient } from '@alneas/eaos-react/record-workspace';
export function useRecordReload() { const client = useRecordWorkspaceClient(); return () => client?.load(); }

Renders structured repository-authored help as native HTML details without executing HTML content.

Static repository-authored document data, never executable HTML or fetched tenant content.

Imports: @alneas/eaos-react/user-guide.

declare function UserGuide({ document, summary, initiallyOpen }: {
document: UserGuideDocument;
summary?: string;
initiallyOpen?: boolean;
}): react.JSX.Element;
Name Type Required Description
{ document, summary, initiallyOpen } { document: UserGuideDocument; summary?: string; initiallyOpen?: boolean; } Yes Version-1 document, optional summary (default Japanese help title) and initiallyOpen flag (default false).

react.JSX.Element

A collapsible guide; unsupported link protocols render as plain inline content.

Requires React. Heading levels are shifted down by one, capped at h6. Pass trusted static document data, not tenant-authored executable content.

Error for a document schemaVersion other than 1.

Trusted static structured help document with schemaVersion 1.

Details trigger caption; defaults to the bundled Japanese help title.

Whether the help starts expanded; defaults to false.

import * as React from 'react';
import { UserGuide, type UserGuideDocument } from '@alneas/eaos-react/user-guide';
const document: UserGuideDocument = { schemaVersion: 1, id: 'sample', locale: 'en', blocks: [{ type: 'paragraph', children: [{ type: 'text', text: 'Select a record to begin.' }] }] };
export function Help() { return <UserGuide document={document} summary="Help"/>; }

Supported help blocks; tables/lists contain structured child nodes rather than HTML.

Imports: @alneas/eaos-react/user-guide.

type UserGuideBlock = {
type: 'heading';
level: 1 | 2 | 3 | 4 | 5 | 6;
children: readonly UserGuideInline[];
} | {
type: 'paragraph';
children: readonly UserGuideInline[];
} | {
type: 'list';
ordered: boolean;
items: readonly (readonly UserGuideBlock[])[];
} | {
type: 'table';
header: readonly (readonly UserGuideInline[])[];
rows: readonly (readonly (readonly UserGuideInline[])[])[];
} | {
type: 'code';
text: string;
language?: string;
};
Name Type Required Description
— — — No call parameters.

Type declaration; no runtime value.

UserGuide for a complete host integration example.

Discriminator selecting the supported node shape; raw HTML is not a variant.

Source heading level from 1 to 6; rendered one level deeper, capped at h6.

Ordered inline nodes rendered recursively.

Discriminator selecting the supported node shape; raw HTML is not a variant.

Ordered inline nodes rendered recursively.

Discriminator selecting the supported node shape; raw HTML is not a variant.

True renders an ordered list; false renders a bullet list.

Ordered list items containing structured block nodes.

Discriminator selecting the supported node shape; raw HTML is not a variant.

Table header cells containing inline node arrays.

Table body rows, each containing cells of inline nodes.

Discriminator selecting the supported node shape; raw HTML is not a variant.

Literal text rendered as escaped content.

Optional code-language metadata; the renderer currently uses plain escaped code.

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Version-1 static help document with locale and structured blocks.

Imports: @alneas/eaos-react/user-guide.

interface UserGuideDocument {
schemaVersion: 1;
id: string;
locale: string;
blocks: readonly UserGuideBlock[];
}
Name Type Required Description
schemaVersion 1 Yes Supported document discriminator; must equal 1.
id string Yes Static guide identity exposed through data-guide-id.
locale string Yes Language tag rendered on the guide element.
blocks readonly UserGuideBlock[] Yes Ordered structured document blocks; no raw executable HTML.

Type declaration; no runtime value.

UserGuide for a complete host integration example.

Supported document discriminator; must equal 1.

Static guide identity exposed through data-guide-id.

Language tag rendered on the guide element.

Ordered structured document blocks; no raw executable HTML.

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Supported inline text, code, emphasis and link nodes in static help documents.

Imports: @alneas/eaos-react/user-guide.

type UserGuideInline = {
type: 'text';
text: string;
} | {
type: 'code';
text: string;
} | {
type: 'strong';
children: readonly UserGuideInline[];
} | {
type: 'emphasis';
children: readonly UserGuideInline[];
} | {
type: 'link';
href: string;
children: readonly UserGuideInline[];
};
Name Type Required Description
— — — No call parameters.

Type declaration; no runtime value.

UserGuide for a complete host integration example.

Discriminator selecting the supported node shape; raw HTML is not a variant.

Literal text rendered as escaped content.

Discriminator selecting the supported node shape; raw HTML is not a variant.

Literal text rendered as escaped content.

Discriminator selecting the supported node shape; raw HTML is not a variant.

Ordered inline nodes rendered recursively.

Discriminator selecting the supported node shape; raw HTML is not a variant.

Ordered inline nodes rendered recursively.

Discriminator selecting the supported node shape; raw HTML is not a variant.

Link target; only HTTP, HTTPS and mailto schemes render as anchors.

Ordered inline nodes rendered recursively.

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Subscribes to the nearest tenant store and derives module visibility from its current snapshot.

Imports: @alneas/eaos-react.

declare function useTenantModule<T extends TenantContext = TenantContext>(): {
hasModule: (id: string) => boolean;
refetchContext: () => Promise<void>;
context: T | null;
loading: boolean;
error: Error | null;
};
Name Type Required Description
— — — No call parameters.

{ hasModule: (id: string) => boolean; refetchContext: () => Promise<void>; context: T \| null; loading: boolean; error: Error \| null; }

The current context/loading/error, a hasModule predicate and the store refresh function.

  • T: Expected host context; defaults to TenantContext and does not validate extra fields.

Use in a React component under TenantModuleProvider; visibility never grants API permission.

Error when called outside TenantModuleProvider.

import * as React from 'react';
import { useTenantModule } from '@alneas/eaos-react';
// Render within TenantModuleProvider connected to the authenticated host store.
export function ApprovalLink() {
const state = useTenantModule();
return state.hasModule('approval') ? <a href="/plugins/approval/workspace">Approvals</a> : null;
}

Memoizes a plugin adapter for the current tenant, session and source client.

Keep a raw client adapter stable while the verified host scope is unchanged.

Imports: @alneas/eaos-react.

declare function useWorkspaceClientAdapter<T, U>(tenantId: string | null, sessionKey: string | null, client: T, adapt: (tenantId: string, recordId: string, client: T) => WorkspaceClient<U>): WorkspaceClient<U>;
Name Type Required Description
tenantId string | null Yes Current verified tenant ID, or null.
sessionKey string | null Yes Current host session/resource key, or null.
client T Yes Stable raw host client.
adapt (tenantId: string, recordId: string, client: T) => WorkspaceClient<U> Yes Converts tenant/resource/client into a workspace client; receives empty IDs when scope is missing.

WorkspaceClient<U>

The adapted client, recomputed when any dependency changes.

  • T: Raw client shape.
  • U: Adapted snapshot payload.

React hook; adapt must be stable and must fail closed for empty scope. The surrounding workspace provider determines readiness.

import { useWorkspaceClientAdapter, type WorkspaceClient } from '@alneas/eaos-react';
export function useHostAdapter<T>(tenantId: string | null, sessionKey: string | null, client: WorkspaceClient<T>) {
return useWorkspaceClientAdapter(tenantId, sessionKey, client, (_tenant, _resource, source) => source);
}

Tracks one pending UI task and suppresses obsolete completion state after client changes.

UI-only single-flight guard. The host still owns authorization and durable execution.

Imports: @alneas/eaos-react.

declare function useWorkspaceTask(client: unknown, onFailure: () => void): {
busy: boolean;
error: string | null;
setBusy: react.Dispatch<react.SetStateAction<boolean>>;
setError: react.Dispatch<react.SetStateAction<string | null>>;
generation: react.RefObject<number>;
pending: react.RefObject<number | null>;
run: (work: (generation: number) => Promise<void>) => Promise<void>;
};
Name Type Required Description
client unknown Yes Active transport identity; falsy values disable run.
onFailure () => void Yes Called after a current task rejects, before storing its error message.

{ busy: boolean; error: string \| null; setBusy: react.Dispatch<react.SetStateAction<boolean>>; setError: react.Dispatch<react.SetStateAction<string \| null>>; generation: react.RefObject<number>; pending: react.RefObject<number \| null>; run: (work: (generation: number) => Promise<void>) => Promise<void>; }

Busy/error state and setters, generation/pending refs and run(work); skipped tasks resolve without running work.

React hook. Tasks are not cancelled on unmount/client change, and a single-flight guard is not server idempotency. work receives the generation to check before applying results.

import { useWorkspaceTask } from '@alneas/eaos-react';
export function useReload(client: object | null, reload: () => Promise<void>, clear: () => void) {
const task = useWorkspaceTask(client, clear);
return { ...task, reload: () => task.run(async () => { await reload(); }) };
}

Validates the HTTPS Kratos origin, provider identifier and trusted redirect origins.

Imports: @alneas/eaos-react, @alneas/eaos-react/client, @alneas/eaos-react/client/browser-auth.

declare function validateBrowserAuthConfig(config: BrowserAuthConfig): BrowserAuthConfig;
Name Type Required Description
config BrowserAuthConfig Yes Authentication origin and provider with optional HTTPS returnTo and explicit origin allowlist.

BrowserAuthConfig

A shallow config copy with normalized publicUrl and a copied redirectOrigins array.

Error or URL parsing error for invalid origin, credentials, fragments, provider or redirect origins.

import { validateBrowserAuthConfig } from '@alneas/eaos-react/client/browser-auth';
const config = validateBrowserAuthConfig({ publicUrl: 'https://auth.example.com', provider: 'oidc', returnTo: 'https://app.example.com/', redirectOrigins: ['https://identity.example.com'] });

Rejects filenames unsafe for a single downloaded file on common desktop filesystems.

Imports: @alneas/eaos-react, @alneas/eaos-react/client.

declare function validateDownloadFilename(filename: string): void;
Name Type Required Description
filename string Yes Nonempty filename up to 200 characters, excluding path separators, reserved names, controls and trailing dot/space.

void

Completes without a value when the name is accepted.

Error for invalid or reserved filenames.

import { validateDownloadFilename } from '@alneas/eaos-react/client';
validateDownloadFilename('report.csv');

Authenticated host transport for loading and executing workspace operations.

Imports: @alneas/eaos-react.

interface WorkspaceClient<TData = unknown> {
load(): Promise<WorkspaceSnapshot<TData>>;
execute(operation: string, input: Record<string, unknown>): Promise<WorkspaceSnapshot<TData>>;
}
Name Type Required Description
load Promise<WorkspaceSnapshot<TData>> Yes Load the current authorized snapshot; resolves a WorkspaceSnapshot or rejects transport/authorization failure.
execute Promise<WorkspaceSnapshot<TData>> Yes Execute a named host operation with typed JSON-like input and return the resulting authorized snapshot; rejects host failures.

Type declaration; no runtime value.

  • TData: Host snapshot payload; defaults to unknown.

Host transport for a bounded, optimistic-concurrency workspace.

createWorkspaceReactBindings for a complete host integration example.

Load the current authorized snapshot; resolves a WorkspaceSnapshot or rejects transport/authorization failure.

Returns: The current authorized snapshot.

Propagates host adapter or SDK failures; async methods reject their Promise.

Example:

import type { WorkspaceClient } from '@alneas/eaos-react';
export async function readWorkspace<T>(client: WorkspaceClient<T>) {
const snapshot = await client.load();
return { tenantId: snapshot.tenantId, revision: snapshot.revision, data: snapshot.data };
}

Execute a named host operation with typed JSON-like input and return the resulting authorized snapshot; rejects host failures.

Parameters:

  • operation: Host operation identifier.
  • input: Operation input validated and authorized by the host.

Returns: The next authorized snapshot.

Propagates host adapter or SDK failures; async methods reject their Promise.

Example:

import type { WorkspaceClient } from '@alneas/eaos-react';
export async function executeWorkspace<T>(client: WorkspaceClient<T>, operation: string, input: Record<string, unknown>) {
return client.execute(operation, input); // Include the operation's required revision and validated fields.
}

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Composes the shared header with help and an optional connected host chat toggle.

Imports: @alneas/eaos-react/workspace-shell, @alneas/eaos-react/workspace-layout.

declare function WorkspaceHeader({ chat, actions, ...props }: WorkspaceHeaderProps): react.JSX.Element;
Name Type Required Description
{ chat, actions, ...props } WorkspaceHeaderProps Yes Inherited Header props and optional chat; title defaults to EAOS and actions precede chat/help.

react.JSX.Element

A react-tools Header with composed action controls.

Requires React,

import * as React from 'react';
import { WorkspaceHeader } from '@alneas/eaos-react/workspace-layout';
export function Header() { return <WorkspaceHeader title="Workspace"/>; }

Shared Header properties with an optional live host chat control.

Imports: @alneas/eaos-react/workspace-shell, @alneas/eaos-react/workspace-layout.

interface WorkspaceHeaderProps extends HeaderProps {
chat?: {
connected: boolean;
open: boolean;
onToggle: () => void;
controls?: string;
};
}
Name Type Required Description
chat { connected: boolean; open: boolean; onToggle: () => void; controls?: string; } No Optional connected/open state and host onToggle callback; controls is the controlled pane ID for aria-controls. Disconnected chat is hidden.

Type declaration; no runtime value.

Shared defaults backed by the public react-tools Header.

workspaceNavigation for a complete host integration example.

Optional connected/open state and host onToggle callback; controls is the controlled pane ID for aria-controls. Disconnected chat is hidden.

Host supplies a currently connected, authorized chat pane. Omitted/disconnected chat stays hidden.

Whether the host chat transport is currently connected.

Whether the controlled chat pane is currently visible.

Host callback to toggle chat visibility; no value is returned.

DOM ID of the controlled chat pane.

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Opens the bundled workspace guide in an accessible dialog.

Imports: @alneas/eaos-react/workspace-shell, @alneas/eaos-react/workspace-layout.

declare function WorkspaceHelpButton(): react.JSX.Element;
Name Type Required Description
— — — No call parameters.

react.JSX.Element

A help icon trigger and scrollable dialog.

Requires React,

import * as React from 'react';
import { WorkspaceHelpButton } from '@alneas/eaos-react/workspace-layout';
export function Help() { return <WorkspaceHelpButton/>; }

Composes workspace help and the react-tools login form in a centered card.

Shared login page composition; the host chooses which authentication methods are enabled.

Imports: @alneas/eaos-react/workspace-login, @alneas/eaos-react/workspace-shell.

declare function WorkspaceLoginScreen({ title, description, showEmailLogin, showRegisterLink, onRegisterClick, socialProviders, redirectTo, }: WorkspaceLoginScreenProps): react.JSX.Element;
Name Type Required Description
{ title, description, showEmailLogin, showRegisterLink, onRegisterClick, socialProviders, redirectTo, } WorkspaceLoginScreenProps Yes WorkspaceLoginScreenProps; title defaults to the Japanese workspace login title, email/register visibility to true and redirectTo to /.

react.JSX.Element

A login page element with optional description and host-selected social providers.

Requires React,

import * as React from 'react';
import { WorkspaceLoginScreen } from '@alneas/eaos-react/workspace-login';
// Mount inside the host authentication setup required by react-tools LoginForm.
export function Login() { return <WorkspaceLoginScreen title="Sign in" showRegisterLink={false}/>; }

Login page presentation and host-selected authentication controls.

Imports: @alneas/eaos-react/workspace-login, @alneas/eaos-react/workspace-shell.

interface WorkspaceLoginScreenProps {
title?: string;
description?: ReactNode;
showEmailLogin?: boolean;
showRegisterLink?: boolean;
onRegisterClick?: () => void;
socialProviders?: ComponentProps<typeof LoginForm>['socialProviders'];
redirectTo?: string;
}
Name Type Required Description
title string No Page heading.
description ReactNode No Optional content above the login form.
showEmailLogin boolean No Whether react-tools displays email login.
showRegisterLink boolean No Whether react-tools displays registration navigation.
onRegisterClick () => void No Optional host callback invoked by the registration control.
socialProviders ComponentProps<typeof LoginForm>['socialProviders'] No Host-configured LoginForm social provider controls and callbacks.
redirectTo string No Post-login destination passed to LoginForm.

Type declaration; no runtime value.

WorkspaceLoginScreen for a complete host integration example.

Page heading.

Default: 'ワークスペースへログイン'.

Optional content above the login form.

Whether react-tools displays email login.

Default: true.

Whether react-tools displays registration navigation.

Default: true.

Optional host callback invoked by the registration control.

Host-configured LoginForm social provider controls and callbacks.

Post-login destination passed to LoginForm.

Default: '/'.

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Builds generic workspace navigation with optional admin entries and admitted host contributions.

Generic navigation only; a visible item never grants server authority.

Imports: @alneas/eaos-react/workspace-shell, @alneas/eaos-react/workspace-layout.

declare function workspaceNavigation(options?: WorkspaceNavigationOptions): SmartSidebarGroup[];
Name Type Required Description
options WorkspaceNavigationOptions No Role flags, route overrides and filtered contributions; defaults to standard workspace/account links.

SmartSidebarGroup[]

New sidebar groups; isTenantAdmin adds users and isPlatformAdmin adds platform management.

hasTenant is currently accepted but does not change output. Contributions must be filtered by live host admission. Defaults: home /, users /settings/users, account /settings/profile, platform /settings/tenants.

import { workspaceNavigation } from '@alneas/eaos-react/workspace-layout';
const groups = workspaceNavigation({ isTenantAdmin: false, routes: { home: '/workspace' } });

Presentation flags, route overrides and pre-admitted sidebar contributions.

Imports: @alneas/eaos-react/workspace-shell, @alneas/eaos-react/workspace-layout.

interface WorkspaceNavigationOptions {
isPlatformAdmin?: boolean;
isTenantAdmin?: boolean;
hasTenant?: boolean;
routes?: Partial<Record<'home' | 'users' | 'account' | 'platform', string>>;
contributions?: SmartSidebarGroup[];
}
Name Type Required Description
isPlatformAdmin boolean No Show platform-management navigation when true; defaults to false.
isTenantAdmin boolean No Show tenant user-management navigation when true; defaults to false.
hasTenant boolean No Reserved presentation flag; currently does not affect generated navigation.
routes Partial<Record<'home' | 'users' | 'account' | 'platform', string>> No Optional overrides for the home, users, account and platform default paths.
contributions SmartSidebarGroup[] No Host-filtered sidebar groups inserted between workspace and platform groups; never grants access.

Type declaration; no runtime value.

workspaceNavigation for a complete host integration example.

Show platform-management navigation when true; defaults to false.

Show tenant user-management navigation when true; defaults to false.

Reserved presentation flag; currently does not affect generated navigation.

Optional overrides for the home, users, account and platform default paths.

Host-filtered sidebar groups inserted between workspace and platform groups; never grants access.

Host must filter contributions against current server admission before passing them.

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Renders a controlled required numeric input while preserving blank values as NaN.

Empty numeric input remains NaN, never an accidental zero amount.

Imports: @alneas/eaos-react/workspace-fields.

declare function WorkspaceNumberField({ label, value, onChange, min, max, step }: {
label: string;
value: number;
onChange: (value: number) => void;
min?: number;
max?: number;
step?: string;
}): react.JSX.Element;
Name Type Required Description
{ label, value, onChange, min, max, step } { label: string; value: number; onChange: (value: number) => void; min?: number; max?: number; step?: string; } Yes label/value/onChange with min=0, max=1000000000000 and step=any; onChange receives a number or NaN when cleared.

react.JSX.Element

A labeled numeric Input; nonfinite values render blank.

Requires React,

Human-readable field caption.

Controlled field value; the host must update it in response to onChange.

Receives the parsed user input; update controlled state in this callback.

Numeric lower bound; defaults to 0.

Numeric upper bound; defaults to 1000000000000.

Numeric input increment string; defaults to any.

import * as React from 'react';
import { WorkspaceNumberField } from '@alneas/eaos-react/workspace-fields';
export function AmountField() { const [value, setValue] = React.useState(NaN); return <WorkspaceNumberField label="Amount" value={value} onChange={setValue}/>; }

Verified host scope, transport and descendant content for a workspace session.

Imports: @alneas/eaos-react.

interface WorkspaceProviderProps<TData> {
tenantId: string | null;
recordId: string | null;
sessionKey: string | null;
client: WorkspaceClient<TData>;
children: ReactNode;
}
Name Type Required Description
tenantId string | null Yes Verified tenant ID; null disables the workspace.
recordId string | null Yes Verified record/resource key; null disables the workspace.
sessionKey string | null Yes Host identity generation key; change on authentication changes; null disables the workspace.
client WorkspaceClient<TData> Yes Stable authenticated transport replaced when its host scope changes.
children ReactNode Yes Workspace content rendered only when a session is ready.

Type declaration; no runtime value.

  • TData: Host snapshot payload; defaults to unknown.

createWorkspaceReactBindings for a complete host integration example.

Verified tenant ID; null disables the workspace.

Verified record/resource key; null disables the workspace.

Host identity generation key; change on authentication changes; null disables the workspace.

Stable authenticated transport replaced when its host scope changes.

Workspace content rendered only when a session is ready.

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Controls which concurrent workspace replies supersede each other.

Imports: @alneas/eaos-react.

interface WorkspaceSessionOptions {
responseScope?: 'session' | 'operation-resource';
}
Name Type Required Description
responseScope 'session' | 'operation-resource' No Session-wide latest reply by default; operation-resource keeps independent latest replies per operation and string input.id.

Type declaration; no runtime value.

Adds lifecycle, stale-response and tenant/resource checks around a host client. This is UI session state only; authorization remains server-owned.

createWorkspaceReactBindings for a complete host integration example.

Session-wide latest reply by default; operation-resource keeps independent latest replies per operation and string input.id.

Default: 'session'.

Independent panels may retain replies from different operations/resources. Default: one latest reply for the session.

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Renders host navigation and identity controls using the shared collapsible sidebar.

Both generated and existing hosts use the same navigation and react-tools sidebar.

Imports: @alneas/eaos-react/workspace-shell, @alneas/eaos-react/workspace-layout.

declare function WorkspaceSidebar({ tenantName, activePath, onNavigate, onLogout, user, footer, ...options }: WorkspaceNavigationOptions & {
tenantName?: string;
activePath?: string;
onNavigate: (path: string) => void;
onLogout?: () => void;
user?: HeaderProps['user'];
footer?: ReactNode;
}): react.JSX.Element;
Name Type Required Description
{ tenantName, activePath, onNavigate, onLogout, user, footer, ...options } WorkspaceNavigationOptions & { tenantName?: string; activePath?: string; onNavigate: (path: string) => void; onLogout?: () => void; user?: HeaderProps['user']; footer?: ReactNode; } Yes Navigation options, optional tenant/user/footer, activePath and host onNavigate/onLogout callbacks.

react.JSX.Element

A SmartSidebar; selecting links closes its mobile state before notifying the host.

Requires React,

Optional tenant heading; omitted or empty displays Workspace.

Current host router path used for active navigation styling.

Host route callback; receives the selected path after mobile sidebar is closed.

Optional host logout callback; it must clear verified UI state and perform real logout.

Optional Header user presentation data; never used to derive API authority.

Optional custom footer replacing the default identity/logout controls.

import * as React from 'react';
import { WorkspaceSidebar } from '@alneas/eaos-react/workspace-layout';
// Render within the host react-tools SidebarProvider.
export function Sidebar({navigate}: {navigate: (path: string) => void}) { return <WorkspaceSidebar onNavigate={navigate}/>; }

Tenant/resource-bound host response carrying a revision and typed payload.

Imports: @alneas/eaos-react.

interface WorkspaceSnapshot<TData = unknown> {
tenantId: string;
recordId: string;
revision: number;
data: TData;
}
Name Type Required Description
tenantId string Yes Verified tenant owning this response.
recordId string Yes Host resource/session record identifier matched by the session boundary.
revision number Yes Host snapshot revision used for optimistic concurrency; semantics belong to the plugin.
data TData Yes Typed host response payload; session wrappers clone it before returning.

Type declaration; no runtime value.

  • TData: Host snapshot payload; defaults to unknown.

A tenant/resource-bound snapshot returned by a host-owned record API.

createWorkspaceReactBindings for a complete host integration example.

Verified tenant owning this response.

Host resource/session record identifier matched by the session boundary.

Host snapshot revision used for optimistic concurrency; semantics belong to the plugin.

Typed host response payload; session wrappers clone it before returning.

See the owning declaration and linked feature guide for usage; no standalone example is documented in source.

Renders a controlled labeled text input or textarea with native length and required constraints.

Imports: @alneas/eaos-react/workspace-fields.

declare function WorkspaceTextField({ label, value, onChange, multiline, required, max, type }: {
label: string;
value: string;
onChange: (value: string) => void;
multiline?: boolean;
required?: boolean;
max?: number;
type?: string;
}): react.JSX.Element;
Name Type Required Description
{ label, value, onChange, multiline, required, max, type } { label: string; value: string; onChange: (value: string) => void; multiline?: boolean; required?: boolean; max?: number; type?: string; } Yes label/value/onChange plus multiline=false, required=false, max=200 characters and type=text; onChange receives the entered string.

react.JSX.Element

A label containing Input or Textarea.

Requires React,

Human-readable field caption.

Controlled field value; the host must update it in response to onChange.

Receives the parsed user input; update controlled state in this callback.

Render a Textarea when true; defaults to false.

Native required constraint; defaults to false for WorkspaceTextField.

Maximum text length in characters; defaults to 200.

Native text input type; defaults to text.

import * as React from 'react';
import { WorkspaceTextField } from '@alneas/eaos-react/workspace-fields';
export function NameField() { const [value, setValue] = React.useState(''); return <WorkspaceTextField label="Name" value={value} onChange={setValue}/>; }