@alneas/eaos-react API
@alneas/eaos-react API
Section titled “@alneas/eaos-react API”Public entrypoints
Section titled “Public entrypoints”| 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 |
[INTERFACE] BrowserAuthConfig
Section titled “[INTERFACE] BrowserAuthConfig”Trusted browser OIDC configuration with explicit authentication and redirect origins.
Imports: @alneas/eaos-react, @alneas/eaos-react/client, @alneas/eaos-react/client/browser-auth.
Signature
Section titled “Signature”interface BrowserAuthConfig { publicUrl: string; provider: string; returnTo?: string; redirectOrigins: string[];}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
See also
Section titled “See also”createKratosBrowserAuth for a complete host integration example.
Public members
Section titled “Public members”publicUrl
Section titled “publicUrl”Credential-free HTTPS Kratos origin without path/query/fragment.
provider
Section titled “provider”Configured OIDC provider identifier containing only letters, digits, underscores or hyphens.
returnTo
Section titled “returnTo”Credential-free HTTPS destination; omitted uses current browser origin root.
redirectOrigins
Section titled “redirectOrigins”Explicit HTTPS origins permitted for the login redirect, in addition to publicUrl.
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[INTERFACE] ClientRoute
Section titled “[INTERFACE] ClientRoute”Host-admitted route metadata and its lazy module loader.
Imports: @alneas/eaos-react, @alneas/eaos-react/client, @alneas/eaos-react/client/client-routes.
Signature
Section titled “Signature”interface ClientRoute<T = unknown> { id: string; pluginId: string; path: string; module: string; load: () => Promise<T>;}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
Type parameters
Section titled “Type parameters”T: Host value shape carried by this contract.
See also
Section titled “See also”loadClientRoute for a complete host integration example.
Public members
Section titled “Public members”Host route identifier used by admission logic.
pluginId
Section titled “pluginId”Plugin owning the route.
Host router path for this contribution.
module
Section titled “module”Declared module metadata; this helper never imports it directly.
Lazy module callback called once after initial authorization; rejection propagates.
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[INTERFACE] CommandAction
Section titled “[INTERFACE] CommandAction”Named host operation and the ordered fields displayed for its command form.
Imports: @alneas/eaos-react/command-workspace.
Signature
Section titled “Signature”interface CommandAction { operation: string; label: string; fields: readonly CommandField[]; note?: string;}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
See also
Section titled “See also”CommandWorkspace for a complete host integration example.
Public members
Section titled “Public members”operation
Section titled “operation”Host operation invoked on form submit.
Action selector, heading and submit text.
fields
Section titled “fields”Ordered command input definitions.
Optional explanatory text above the form.
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[INTERFACE] CommandField
Section titled “[INTERFACE] CommandField”Command input configuration for native form values and optional choice catalogs.
Imports: @alneas/eaos-react/command-workspace.
Signature
Section titled “Signature”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;}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
See also
Section titled “See also”CommandWorkspace for a complete host integration example.
Public members
Section titled “Public members”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.
required
Section titled “required”Controls native required validation; defaults to true except booleans.
Number input lower bound.
Default: 0.
Optional numeric input upper bound.
options
Section titled “options”Explicit value/label choices, taking precedence over collection.
options[].value
Section titled “options[].value”Command option ID sent to the host rather than its presentation label.
options[].label
Section titled “options[].label”Input caption and accessible label.
collection
Section titled “collection”Snapshot array key mapped to selectable record IDs when options are absent.
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[FUNCTION] CommandWorkspace
Section titled “[FUNCTION] CommandWorkspace”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.
Signature
Section titled “Signature”declare function CommandWorkspace({ client, definition, help }: { help?: react.ReactNode; client: WorkspaceClient<any> | null; definition: CommandWorkspaceDefinition;}): react.JSX.Element;Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”react.JSX.Element
A list/form workspace, connection alert when client is missing, and status/error content while requests settle.
Remarks
Section titled “Remarks”Requires React,
Public members
Section titled “Public members”argument1.help
Section titled “argument1.help”Optional help content; undefined uses core help and null hides help.
argument1.client
Section titled “argument1.client”Stable host transport carrying current authentication and authorization.
argument1.definition
Section titled “argument1.definition”Plugin-owned workspace schema, labels and operation declarations.
Example
Section titled “Example”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}/>; }[INTERFACE] CommandWorkspaceDefinition
Section titled “[INTERFACE] CommandWorkspaceDefinition”Plugin-owned collection labels, command definitions and input conversion.
Imports: @alneas/eaos-react/command-workspace.
Signature
Section titled “Signature”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>;}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
See also
Section titled “See also”CommandWorkspace for a complete host integration example.
Public members
Section titled “Public members”Workspace heading.
sections
Section titled “sections”Snapshot collection keys mapped to navigation labels; first key is selected initially.
labels
Section titled “labels”Record property captions used to build visible scalar columns.
actions
Section titled “actions”Selectable host operations and their input definitions.
references
Section titled “references”Foreign-key display definitions naming a snapshot collection and label.
references.collection
Section titled “references.collection”Snapshot collection key used to resolve selectable/reference records.
references.label
Section titled “references.label”Public reference column caption.
prepare
Section titled “prepare”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;}Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[INTERFACE] ComputeWorkerPort
Section titled “[INTERFACE] ComputeWorkerPort”Worker message/lifecycle capabilities required by the compute executor.
Imports: @alneas/eaos-react, @alneas/eaos-react/client, @alneas/eaos-react/client/compute.
Signature
Section titled “Signature”interface ComputeWorkerPort { postMessage(value: unknown): void; addEventListener(type: string, listener: (event: any) => void): void; removeEventListener(type: string, listener: (event: any) => void): void; terminate(): void;}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
See also
Section titled “See also”createWorkerPluginExecutor for a complete host integration example.
Public members
Section titled “Public members”postMessage
Section titled “postMessage”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 } });}addEventListener
Section titled “addEventListener”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); }}removeEventListener
Section titled “removeEventListener”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); }}terminate
Section titled “terminate”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(); }Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[CONSTANT] coreWorkspaceGuide
Section titled “[CONSTANT] coreWorkspaceGuide”Bundled static Japanese guide for the generic workspace controls.
Imports: @alneas/eaos-react/user-guide.
Signature
Section titled “Signature”declare const coreWorkspaceGuide: UserGuideDocument;Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
| — | — | — | No call parameters. |
Returns
Section titled “Returns”Declared constant value.
See also
Section titled “See also”UserGuide for a complete host integration example.
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[FUNCTION] CoreWorkspaceHelp
Section titled “[FUNCTION] CoreWorkspaceHelp”Renders the bundled core workspace guide in a collapsible help panel.
Imports: @alneas/eaos-react/user-guide.
Signature
Section titled “Signature”declare function CoreWorkspaceHelp(): react.JSX.Element;Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
| — | — | — | No call parameters. |
Returns
Section titled “Returns”react.JSX.Element
A UserGuide element using the bundled Japanese workspace guide.
Remarks
Section titled “Remarks”Requires React; no host data is fetched.
Example
Section titled “Example”import * as React from 'react';import { CoreWorkspaceHelp } from '@alneas/eaos-react/user-guide';export function Help() { return <CoreWorkspaceHelp/>; }[FUNCTION] createFileDownloader
Section titled “[FUNCTION] createFileDownloader”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.
Signature
Section titled “Signature”declare function createFileDownloader(options?: { native?: NativeFileSaver; web?: NativeFileSaver; maxBytes?: number;}): (data: Uint8Array | ArrayBuffer | Blob, save: SaveFileOptions) => Promise<SaveFileResult>;Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”(data: Uint8Array \| ArrayBuffer \| Blob, save: SaveFileOptions) => Promise<SaveFileResult>
An async saver accepting bytes/ArrayBuffer/Blob and SaveFileOptions, resolving SaveFileResult even on adapter failure.
Remarks
Section titled “Remarks”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.
Errors and rejections
Section titled “Errors and rejections”Error if maxBytes is not a positive safe integer at construction.
Public members
Section titled “Public members”options.native
Section titled “options.native”Optional native adapter; selected before web and never silently retried in another destination.
options.web
Section titled “options.web”Optional web save adapter, used only when native is absent.
options.maxBytes
Section titled “options.maxBytes”Positive safe byte limit; defaults to 104857600 (100 MiB).
Example
Section titled “Example”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' });}[FUNCTION] createHttpPluginExecutor
Section titled “[FUNCTION] createHttpPluginExecutor”Creates a cookie-authenticated JSON POST transport for plugin operations.
Imports: @alneas/eaos-react, @alneas/eaos-react/client, @alneas/eaos-react/client/plugin-execution.
Signature
Section titled “Signature”declare function createHttpPluginExecutor(options: { endpoint: string; fetch?: typeof fetch; headers?: () => Record<string, string>;}): PluginExecutor;Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”PluginExecutor
An executor resolving parsed JSON, with pluginId/action appended as encoded path segments.
Remarks
Section titled “Remarks”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.
Errors and rejections
Section titled “Errors and rejections”Invalid endpoint throws immediately; returned executor rejects on header/serialization/fetch/JSON errors or non-OK HTTP status.
Public members
Section titled “Public members”options.endpoint
Section titled “options.endpoint”Credential-free HTTPS execution URL without query or fragment.
options.fetch
Section titled “options.fetch”Optional fetch implementation; defaults to global fetch.
options.headers
Section titled “options.headers”Optional callback returning current host session/CSRF headers for each request.
Example
Section titled “Example”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' } });[FUNCTION] createInvokeFileSaver
Section titled “[FUNCTION] createInvokeFileSaver”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.
Signature
Section titled “Signature”declare function createInvokeFileSaver(invoke: (command: string, args: Record<string, unknown>) => Promise<unknown>): NativeFileSaver;Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”NativeFileSaver
A saver normalizing camelCase/snake_case file paths; validation, malformed responses and bridge failures reject.
Remarks
Section titled “Remarks”Does not import Tauri. The host must implement the command and enforce allowed destinations. Desktop flags default to false; contentType is not forwarded.
Example
Section titled “Example”import { createInvokeFileSaver } from '@alneas/eaos-react/client';export function connectNativeSave(invoke: Parameters<typeof createInvokeFileSaver>[0]) { return createInvokeFileSaver(invoke);}[FUNCTION] createInvokePluginExecutor
Section titled “[FUNCTION] createInvokePluginExecutor”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.
Signature
Section titled “Signature”declare function createInvokePluginExecutor(invoke: (command: string, args: Record<string, unknown>) => Promise<unknown>): PluginExecutor;Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”PluginExecutor
An executor resolving the native result unless its signal has been aborted.
Remarks
Section titled “Remarks”Aborting does not interrupt the native command; it discards the eventual response. Native side effects may already have completed.
Errors and rejections
Section titled “Errors and rejections”Returned executor rejects on aborted signals or native bridge rejection.
Example
Section titled “Example”import { createInvokePluginExecutor } from '@alneas/eaos-react/client/plugin-execution';export function connectNative(invoke: Parameters<typeof createInvokePluginExecutor>[0]) { return createInvokePluginExecutor(invoke); }[FUNCTION] createKratosBrowserAuth
Section titled “[FUNCTION] createKratosBrowserAuth”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.
Signature
Section titled “Signature”declare function createKratosBrowserAuth(options: BrowserAuthConfig & { fetch?: typeof fetch; navigate: (url: string) => void;}): { login(): Promise<void>; logout(): Promise<void>;};Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”{ login(): Promise<void>; logout(): Promise<void>; }
login() and logout() actions resolving without a value after requesting navigation; failures reject.
Remarks
Section titled “Remarks”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.
Errors and rejections
Section titled “Errors and rejections”Invalid configuration throws immediately; actions reject on transport/JSON failures, rejected flows or untrusted redirects; navigate errors propagate.
Public members
Section titled “Public members”options.fetch
Section titled “options.fetch”Optional fetch implementation; defaults to global fetch.
options.navigate
Section titled “options.navigate”Host navigation callback receiving a validated absolute redirect URL; no value is returned.
Example
Section titled “Example”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.[FUNCTION] createLiffClient
Section titled “[FUNCTION] createLiffClient”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.
Signature
Section titled “Signature”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;};Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
options |
{ sdk: LiffAdapter; liffId: string; redirectUri: string; } |
Yes | Installed SDK, nonblank LIFF ID and credential-free HTTPS redirectUri. |
Returns
Section titled “Returns”{ 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.
Remarks
Section titled “Remarks”The host supplies
Errors and rejections
Section titled “Errors and rejections”Invalid configuration throws; SDK failures and malformed profiles reject the corresponding action.
Public members
Section titled “Public members”options.sdk
Section titled “options.sdk”Host-installed SDK instance; no provider credentials are returned by the wrapper.
options.liffId
Section titled “options.liffId”Nonblank registered LIFF application identifier.
options.redirectUri
Section titled “options.redirectUri”Credential-free HTTPS URI configured in the host identity provider.
Example
Section titled “Example”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() };}[FUNCTION] createPluginInvoker
Section titled “[FUNCTION] createPluginInvoker”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.
Signature
Section titled “Signature”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>;Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”(request: PluginExecutionRequest, signal?: AbortSignal) => Promise<unknown>
An invoker resolving the selected executor result; operations are cloned when configured.
Remarks
Section titled “Remarks”No failure triggers another placement. Native, worker and server adapters must independently enforce their trust boundaries. Cancellation is delegated after an initial abort check.
Errors and rejections
Section titled “Errors and rejections”Returned invoker rejects invalid identifiers, unconfigured operations, missing executors, cancellation and executor failures.
Public members
Section titled “Public members”options.operations
Section titled “options.operations”Explicit host operation allowlist; unlisted operations are rejected.
options.operations.placement
Section titled “options.operations.placement”Explicit operation location; failures never choose a different location.
options.native
Section titled “options.native”Optional native adapter; selected before web and never silently retried in another destination.
options.server
Section titled “options.server”Optional server executor, responsible for current tenant and operation authorization.
options.wasm
Section titled “options.wasm”Optional trusted WASM worker executor.
options.'browser-ai'
Section titled “options.'browser-ai'”Optional trusted browser AI executor.
Example
Section titled “Example”import { createPluginInvoker, type PluginExecutor } from '@alneas/eaos-react/client/plugin-execution';export function routeReports(server: PluginExecutor) { return createPluginInvoker({ operations: { 'reports:read': { placement: 'server' } }, server });}[FUNCTION] createTenantModuleStore
Section titled “[FUNCTION] createTenantModuleStore”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.
Signature
Section titled “Signature”declare function createTenantModuleStore<T extends TenantContext>(load: (signal: AbortSignal) => Promise<T | null>): TenantModuleStore<T>;Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”TenantModuleStore<T>
A store initially loading with no identity; loader and context-validation failures become snapshot.error.
Type parameters
Section titled “Type parameters”T: Verified tenant context shape, extending the required tenant/user/module fields.
Remarks
Section titled “Remarks”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.
Example
Section titled “Example”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() };}[FUNCTION] createWorkerPluginExecutor
Section titled “[FUNCTION] createWorkerPluginExecutor”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.
Signature
Section titled “Signature”declare function createWorkerPluginExecutor(createWorker: () => ComputeWorkerPort, timeoutMs?: number): { execute: PluginExecutor; close(): void;};Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”{ execute: PluginExecutor; close(): void; }
An execute transport and close() that permanently closes the session and terminates its worker.
Remarks
Section titled “Remarks”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.
Errors and rejections
Section titled “Errors and rejections”Invalid timeout throws immediately; execute rejects closed/aborted sessions, worker failures, timeouts or transfer errors.
Example
Section titled “Example”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(); }}[FUNCTION] createWorkspaceClientBindings
Section titled “[FUNCTION] createWorkspaceClientBindings”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.
Signature
Section titled “Signature”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;};Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”{ 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.
Type parameters
Section titled “Type parameters”TClient: Plugin-facing client type.TData: Snapshot data carried through the shared session.
Remarks
Section titled “Remarks”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.
Example
Section titled “Example”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);[FUNCTION] createWorkspaceReactBindings
Section titled “[FUNCTION] createWorkspaceReactBindings”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.
Signature
Section titled “Signature”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;};Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
options |
WorkspaceSessionOptions |
No | Session reply ordering; defaults to session-wide latest response. |
Returns
Section titled “Returns”{ 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.
Type parameters
Section titled “Type parameters”TData: Snapshot payload shared by the returned context and client.
Remarks
Section titled “Remarks”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.
Example
Section titled “Example”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>; }[FUNCTION] createWorkspaceSession
Section titled “[FUNCTION] createWorkspaceSession”Wraps a workspace transport with session lifetime and tenant/resource response checks.
Imports: @alneas/eaos-react.
Signature
Section titled “Signature”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>>; };};Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”{ 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.
Type parameters
Section titled “Type parameters”TData: Payload shape supplied by the host snapshot transport.
Remarks
Section titled “Remarks”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.
Example
Section titled “Example”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(); }}[FUNCTION] fetchVerifiedComputeAsset
Section titled “[FUNCTION] fetchVerifiedComputeAsset”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.
Signature
Section titled “Signature”declare function fetchVerifiedComputeAsset(asset: { url: string; sha256: string;}, request?: typeof fetch): Promise<ArrayBuffer>;Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Promise<ArrayBuffer>
Verified asset bytes owned by the caller.
Remarks
Section titled “Remarks”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.
Errors and rejections
Section titled “Errors and rejections”Rejects invalid URL/metadata, non-OK response, digest mismatch or fetch/crypto failure.
Public members
Section titled “Public members”asset.url
Section titled “asset.url”Trusted asset URL; HTTPS required except HTTP loopback development.
asset.sha256
Section titled “asset.sha256”Pinned lowercase 64-character hexadecimal SHA-256 digest from a trusted release.
Example
Section titled “Example”import { fetchVerifiedComputeAsset } from '@alneas/eaos-react/client/compute';export function downloadPinnedAsset(asset: { url: string; sha256: string }) { return fetchVerifiedComputeAsset(asset); }[FUNCTION] installComputeWorker
Section titled “[FUNCTION] installComputeWorker”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.
Signature
Section titled “Signature”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;Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”void
Completes without a value after registering the listener.
Remarks
Section titled “Remarks”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.
Public members
Section titled “Public members”scope.addEventListener
Section titled “scope.addEventListener”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.
Errors and rejections
Section titled “Errors and rejections”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.}scope.postMessage
Section titled “scope.postMessage”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.
Errors and rejections
Section titled “Errors and rejections”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 });}Example
Section titled “Example”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); } });}[INTERFACE] LiffAdapter
Section titled “[INTERFACE] LiffAdapter”Structural contract for the host-installed LINE LIFF SDK.
Imports: @alneas/eaos-react, @alneas/eaos-react/client, @alneas/eaos-react/client/liff.
Signature
Section titled “Signature”interface LiffAdapter { init(options: { liffId: string; }): Promise<void>; isLoggedIn(): boolean; login(options: { redirectUri: string; }): void; logout(): void; getProfile(): Promise<LiffProfile>; isInClient?(): boolean;}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
Remarks
Section titled “Remarks”Structural interface accepted by
See also
Section titled “See also”createLiffClient for a complete host integration example.
Public members
Section titled “Public members”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.
Errors and rejections
Section titled “Errors and rejections”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();}init.options.liffId
Section titled “init.options.liffId”Registered LIFF application ID supplied by the host-installed SDK wrapper.
isLoggedIn
Section titled “isLoggedIn”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 });}login.options.redirectUri
Section titled “login.options.redirectUri”Host-approved registered HTTPS return URI used by createLiffClient when requesting login.
logout
Section titled “logout”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(); }getProfile
Section titled “getProfile”Resolve presentation profile data or reject SDK failure.
Returns: The current SDK presentation profile.
Errors and rejections
Section titled “Errors and rejections”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.}isInClient
Section titled “isInClient”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; }Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[INTERFACE] LiffProfile
Section titled “[INTERFACE] LiffProfile”Presentation-only LIFF profile fields without provider credentials.
Imports: @alneas/eaos-react, @alneas/eaos-react/client, @alneas/eaos-react/client/liff.
Signature
Section titled “Signature”interface LiffProfile { userId: string; displayName: string; pictureUrl?: string; statusMessage?: string;}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
See also
Section titled “See also”createLiffClient for a complete host integration example.
Public members
Section titled “Public members”userId
Section titled “userId”Nonblank LINE user ID for presentation only.
displayName
Section titled “displayName”Display name supplied by LIFF.
pictureUrl
Section titled “pictureUrl”Optional profile picture URL passed through as text.
statusMessage
Section titled “statusMessage”Optional presentation status message.
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[FUNCTION] loadBrowserAiCompute
Section titled “[FUNCTION] loadBrowserAiCompute”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.
Signature
Section titled “Signature”declare function loadBrowserAiCompute<TSession>(options: { bytes: ArrayBuffer; createSession: (bytes: ArrayBuffer, providers: readonly string[]) => Promise<TSession>; webgpu: boolean;}): Promise<TSession>;Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Promise<TSession>
The session resolved by createSession; true webgpu supplies [webgpu, wasm], otherwise [wasm].
Type parameters
Section titled “Type parameters”TSession: Host session object, including any host-required disposal interface.
Remarks
Section titled “Remarks”The plugin worker owns tensor types, model preparation and session disposal. This helper does not detect capabilities or implement provider fallback itself.
Errors and rejections
Section titled “Errors and rejections”Rejects when the supplied session factory rejects.
Public members
Section titled “Public members”options.bytes
Section titled “options.bytes”Verified model or WASM binary bytes supplied by the caller.
options.createSession
Section titled “options.createSession”Host AI session factory receiving bytes and ordered provider preferences; rejects preparation failure.
options.webgpu
Section titled “options.webgpu”Whether host capability checks permit WebGPU; false selects WASM only.
Example
Section titled “Example”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 });}[FUNCTION] loadClientRoute
Section titled “[FUNCTION] loadClientRoute”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.
Signature
Section titled “Signature”declare function loadClientRoute<T>(route: ClientRoute<T>, authorize: (route: ClientRoute<T>) => boolean | Promise<boolean>): Promise<T>;Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Promise<T>
The loaded module after both checks succeed.
Type parameters
Section titled “Type parameters”T: Module value returned by the host loader.
Remarks
Section titled “Remarks”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.
Errors and rejections
Section titled “Errors and rejections”Rejects when admission denies access or authorize/load rejects.
Example
Section titled “Example”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);}[FUNCTION] loadGoCompute
Section titled “[FUNCTION] loadGoCompute”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.
Signature
Section titled “Signature”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>>;Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Promise<(action: string, payload: unknown) => Promise<unknown>>
An async action/payload invoker that refuses calls after an observed runtime rejection.
Remarks
Section titled “Remarks”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.
Errors and rejections
Section titled “Errors and rejections”Rejects instantiation/readiness failures; returned invoker rejects stopped runtime or propagated invoke failures.
Public members
Section titled “Public members”options.bytes
Section titled “options.bytes”Verified model or WASM binary bytes supplied by the caller.
options.runtime
Section titled “options.runtime”Official matching Go wasm_exec.js runtime installed by the host.
options.runtime.importObject
Section titled “options.runtime.importObject”WebAssembly imports provided by the matching Go runtime.
options.runtime.run
Section titled “options.runtime.run”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.
Errors and rejections
Section titled “Errors and rejections”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);}options.ready
Section titled “options.ready”Host readiness handshake; must resolve only when the WASM entry points are usable.
options.invoke
Section titled “options.invoke”Host invocation bridge for the installed runtime; rejection propagates.
Example
Section titled “Example”import { loadGoCompute } from '@alneas/eaos-react/client/compute';export async function startGo(options: Parameters<typeof loadGoCompute>[0]) { return loadGoCompute(options); }[FUNCTION] loadRecordReference
Section titled “[FUNCTION] loadRecordReference”Loads complete tenant-scoped reference candidates and recursively resolves labels from authorized catalogs.
Imports: @alneas/eaos-react/record-workspace.
Signature
Section titled “Signature”declare function loadRecordReference(reference: RecordWorkspaceReference, tenantId: string, source: WorkspaceClient<unknown>, signal?: AbortSignal, referenceClient?: RecordWorkspaceProps['referenceClient']): Promise<RecordReferenceCandidate[]>;Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Promise<RecordReferenceCandidate[]>
Candidate records and composed display labels, including all pages or an empty array.
Remarks
Section titled “Remarks”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.
Errors and rejections
Section titled “Errors and rejections”Rejects foreign/malformed responses, missing nested adapters, pagination/depth limits, cancellation or propagated transport failures.
Example
Section titled “Example”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);}[TYPE] NativeFileSaver
Section titled “[TYPE] NativeFileSaver”Host file-saving callback accepting bytes and destination hints.
Imports: @alneas/eaos-react, @alneas/eaos-react/client.
Signature
Section titled “Signature”type NativeFileSaver = (data: Uint8Array, options: SaveFileOptions) => Promise<SaveFileResult>;Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
| — | — | — | No call parameters. |
Returns
Section titled “Returns”Type declaration; no runtime value.
See also
Section titled “See also”createFileDownloader for a complete host integration example.
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[INTERFACE] PluginClientRuntime
Section titled “[INTERFACE] PluginClientRuntime”Live host request and compute capabilities bound to one authenticated session.
Imports: @alneas/eaos-react, @alneas/eaos-react/plugin-runtime.
Signature
Section titled “Signature”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>;}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
See also
Section titled “See also”createWorkspaceReactBindings for a complete host integration example.
Public members
Section titled “Public members”tenantId
Section titled “tenantId”Current verified tenant identifier.
sessionKey
Section titled “sessionKey”Current authenticated session generation; replace on identity changes.
request
Section titled “request”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.
Remarks
Section titled “Remarks”Host resolves CSRF and verified session headers on every request.
Errors and rejections
Section titled “Errors and rejections”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);}compute
Section titled “compute”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.
Errors and rejections
Section titled “Errors and rejections”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);}Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[INTERFACE] PluginExecutionRequest
Section titled “[INTERFACE] PluginExecutionRequest”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.
Signature
Section titled “Signature”interface PluginExecutionRequest { pluginId: string; action: string; payload: unknown;}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
See also
Section titled “See also”createPluginInvoker for a complete host integration example.
Public members
Section titled “Public members”pluginId
Section titled “pluginId”Plugin identifier used to select the operation adapter.
action
Section titled “action”Plugin operation name; validated by the invoker and host.
payload
Section titled “payload”Operation input; host must validate shape and permission before use.
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[TYPE] PluginExecutor
Section titled “[TYPE] PluginExecutor”Async operation transport whose cancellation and authorization are adapter-owned.
Imports: @alneas/eaos-react, @alneas/eaos-react/client, @alneas/eaos-react/client/plugin-execution.
Signature
Section titled “Signature”type PluginExecutor = (request: PluginExecutionRequest, signal?: AbortSignal) => Promise<unknown>;Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
| — | — | — | No call parameters. |
Returns
Section titled “Returns”Type declaration; no runtime value.
See also
Section titled “See also”createPluginInvoker for a complete host integration example.
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[FUNCTION] PluginGate
Section titled “[FUNCTION] PluginGate”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.
Signature
Section titled “Signature”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;Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”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.
Remarks
Section titled “Remarks”Requires TenantModuleProvider; this UI guard never replaces host/server authorization.
Errors and rejections
Section titled “Errors and rejections”Error outside TenantModuleProvider.
Public members
Section titled “Public members”argument1.pluginId
Section titled “argument1.pluginId”Plugin identifier admitted by current host policy.
argument1.children
Section titled “argument1.children”React descendants rendered within this component.
argument1.fallback
Section titled “argument1.fallback”Optional denied-access content; undefined selects the built-in denial behavior.
Example
Section titled “Example”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>; }[FUNCTION] PluginRuntimeProvider
Section titled “[FUNCTION] PluginRuntimeProvider”Provides the current authenticated request and compute adapters to plugin descendants.
Imports: @alneas/eaos-react, @alneas/eaos-react/plugin-runtime.
Signature
Section titled “Signature”declare function PluginRuntimeProvider({ runtime, children }: { runtime: PluginClientRuntime | null; children: ReactNode;}): react.FunctionComponentElement<react.ProviderProps<PluginClientRuntime | null>>;Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
{ runtime, children } |
{ runtime: PluginClientRuntime | null; children: ReactNode; } |
Yes | Current host runtime or null when unavailable, plus descendant children. |
Returns
Section titled “Returns”react.FunctionComponentElement<react.ProviderProps<PluginClientRuntime \| null>>
A runtime context provider rendering children.
Remarks
Section titled “Remarks”Replace runtime/sessionKey when identity changes. Operation hooks abort pending signals on cleanup and reject stale replies; host transports remain responsible for authorization.
Public members
Section titled “Public members”argument1.runtime
Section titled “argument1.runtime”Official matching Go wasm_exec.js runtime installed by the host.
argument1.children
Section titled “argument1.children”React descendants rendered within this component.
Example
Section titled “Example”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>; }[INTERFACE] PluginTenantContext
Section titled “[INTERFACE] PluginTenantContext”Host tenant context augmented with per-plugin presentation admission decisions.
Imports: @alneas/eaos-react, @alneas/eaos-react/plugin-gate.
Signature
Section titled “Signature”interface PluginTenantContext extends TenantContext { pluginAccess: Readonly<Record<string, { allowed: boolean; reason?: string; }>>;}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
Remarks
Section titled “Remarks”Authenticated host snapshot. These decisions control presentation only.
See also
Section titled “See also”createWorkspaceReactBindings for a complete host integration example.
Public members
Section titled “Public members”pluginAccess
Section titled “pluginAccess”Host-admitted plugin decisions; allowed must be true as well as enabledModules membership; optional reason selects denial presentation.
pluginAccess.allowed
Section titled “pluginAccess.allowed”Host admission decision; must be true along with module membership to show plugin content.
pluginAccess.reason
Section titled “pluginAccess.reason”Optional host denial reason used to select unavailable/upgrade UI.
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[FUNCTION] recordFormSchema
Section titled “[FUNCTION] recordFormSchema”Projects a command schema into form fields without mutating the original schema.
Imports: @alneas/eaos-react/record-workspace.
Signature
Section titled “Signature”declare function recordFormSchema(schema: Schema, excluded?: readonly string[]): JSONSchema;Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
schema |
Schema |
Yes | Canonical command schema. |
excluded |
readonly string[] |
No | Field keys removed from properties and required; defaults to none. |
Returns
Section titled “Returns”JSONSchema
A shallow schema copy with retained properties and corresponding required entries.
Remarks
Section titled “Remarks”Derive a presentation schema without changing the server’s command contract.
Example
Section titled “Example”import { recordFormSchema } from '@alneas/eaos-react/record-workspace';const form = recordFormSchema({ type: 'object', properties: { title: { type: 'string' }, revision: { type: 'integer' } }, required: ['title', 'revision'] }, ['revision']);[FUNCTION] recordFormValues
Section titled “[FUNCTION] recordFormValues”Selects schema-declared form values and omits optional blanks incompatible with their field constraints.
Imports: @alneas/eaos-react/record-workspace.
Signature
Section titled “Signature”declare function recordFormValues(schema: Schema, values: Record<string, unknown>): Record<string, unknown>;Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Record<string, unknown>
A new object excluding undeclared/undefined values and invalid optional empty numeric, enum, patterned or minLength fields.
Remarks
Section titled “Remarks”Does not perform full JSON Schema validation. Required blank values remain for server validation.
Errors and rejections
Section titled “Errors and rejections”Invalid regular-expression patterns in schema properties may throw.
Example
Section titled “Example”import { recordFormValues } from '@alneas/eaos-react/record-workspace';const values = recordFormValues({ properties: { title: { type: 'string' }, amount: { type: 'number' } } }, { title: 'Report', amount: '', unknown: true });[INTERFACE] RecordReferenceCandidate
Section titled “[INTERFACE] RecordReferenceCandidate”Tenant-scoped reference record paired with its authorized presentation label.
Imports: @alneas/eaos-react/record-workspace.
Signature
Section titled “Signature”interface RecordReferenceCandidate { record: ScopedUiRecord; label: string;}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
See also
Section titled “See also”RecordWorkspace for a complete host integration example.
Public members
Section titled “Public members”record
Section titled “record”Tenant-validated original candidate record.
Composed authorized catalog display text; does not replace command IDs.
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[FUNCTION] recordReferenceLabel
Section titled “[FUNCTION] recordReferenceLabel”Composes a reference label from nonblank string display fields and optional authorized related labels.
Imports: @alneas/eaos-react/record-workspace.
Signature
Section titled “Signature”declare function recordReferenceLabel(reference: RecordWorkspaceReference, record: ScopedUiRecord, related?: Readonly<Record<string, ReadonlyMap<string, string>>>): string;Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”string
Trimmed string parts joined by /, or record.id when no usable strings exist.
Example
Section titled “Example”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' });[FUNCTION] RecordWorkspace
Section titled “[FUNCTION] RecordWorkspace”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.
Signature
Section titled “Signature”declare function RecordWorkspace({ definition, referenceClient, onRecordChange, onReady, recordOverride, help }: RecordWorkspaceProps & { definition: RecordWorkspaceDefinition;}): react.JSX.Element;Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”react.JSX.Element
The record workspace UI or a connection-required paragraph while no scoped client is available.
Remarks
Section titled “Remarks”Requires React,
Public members
Section titled “Public members”argument1.definition
Section titled “argument1.definition”Plugin-owned workspace schema, labels and operation declarations.
Example
Section titled “Example”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>; }[INTERFACE] RecordWorkspaceCommand
Section titled “[INTERFACE] RecordWorkspaceCommand”Plugin command form schema and selected-record/preview behavior.
Imports: @alneas/eaos-react/record-workspace.
Signature
Section titled “Signature”interface RecordWorkspaceCommand { operation: string; label: string; schema: Schema; record?: boolean; preview?: boolean; initialValues?: Record<string, unknown>;}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
See also
Section titled “See also”RecordWorkspace for a complete host integration example.
Public members
Section titled “Public members”operation
Section titled “operation”Host command operation name.
Button and form heading text.
schema
Section titled “schema”Canonical command input schema used to derive the form.
record
Section titled “record”Require a selected record and include its ID/revision when true; defaults to false.
preview
Section titled “preview”Show command response as a preview instead of treating it as a normal mutation; defaults to false.
initialValues
Section titled “initialValues”Optional plugin-owned form defaults for this command.
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[INTERFACE] RecordWorkspaceDefinition
Section titled “[INTERFACE] RecordWorkspaceDefinition”Plugin-owned record operations, schemas, columns and workflow affordances.
Imports: @alneas/eaos-react/record-workspace.
Signature
Section titled “Signature”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[];}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
See also
Section titled “See also”RecordWorkspace for a complete host integration example.
Public members
Section titled “Public members”Plugin workspace/resource identifier.
Workspace heading.
listKey
Section titled “listKey”Snapshot payload property containing the record list.
operations
Section titled “operations”Host list/get/create/update command names.
operations.list
Section titled “operations.list”Host list operation used for initial loading and pagination.
operations.get
Section titled “operations.get”Host single-record operation used for selection.
operations.create
Section titled “operations.create”Host create operation used by the new-record form.
operations.update
Section titled “operations.update”Host optimistic update operation used by the edit form.
schemas
Section titled “schemas”Canonical command schemas indexed by operation name.
columns
Section titled “columns”Ordered table columns with headers and optional value(record) presentation callbacks.
columns[].accessorKey
Section titled “columns[].accessorKey”Record property key projected by this table column.
columns[].header
Section titled “columns[].header”Public table column heading.
columns[].value
Section titled “columns[].value”Optional presentation callback receiving a scoped record and returning the displayed cell value.
commands
Section titled “commands”Optional plugin workflow/preview forms.
workflowFields
Section titled “workflowFields”Fields excluded from generic edits because plugin commands own them.
Remarks
Section titled “Remarks”Fields changed exclusively through the plugin’s workflow commands.
hiddenDetailFields
Section titled “hiddenDetailFields”Fields omitted from generic detail rendering.
Remarks
Section titled “Remarks”Fields presented by a plugin-owned detail component instead of the generic description list.
canEdit
Section titled “canEdit”Optional UI edit predicate; absence permits the edit affordance, while server permission is always required.
Remarks
Section titled “Remarks”UI affordance only. The server must independently enforce edit permissions and state.
references
Section titled “references”Optional authorized foreign-key catalogs used by forms and display labels.
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[INTERFACE] RecordWorkspaceProps
Section titled “[INTERFACE] RecordWorkspaceProps”Optional plugin help, reference transports and record/ready notifications.
Imports: @alneas/eaos-react/record-workspace.
Signature
Section titled “Signature”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>;}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
See also
Section titled “See also”RecordWorkspace for a complete host integration example.
Public members
Section titled “Public members”Optional help content; undefined uses Core guide and null hides it.
Remarks
Section titled “Remarks”Plugin-supplied guide; defaults to the generic Core guide. null deliberately hides it.
referenceClient
Section titled “referenceClient”Host resolver returning a separately authorized transport per reference catalog.
Remarks
Section titled “Remarks”Authenticated host transport; the plugin declares the allowed reference catalogs.
onRecordChange
Section titled “onRecordChange”Notifies the plugin when the selected record changes or clears.
recordOverride
Section titled “recordOverride”Newer authorized result for the currently selected record; foreign or nonnewer results are not adopted.
Remarks
Section titled “Remarks”Newer authorized response from a plugin-owned operation, for the already selected record only.
onReady
Section titled “onReady”Optional callback after the initial list load; may asynchronously load auxiliary plugin views.
Remarks
Section titled “Remarks”Load plugin-owned auxiliary views after the shared initial list request has completed.
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[FUNCTION] RecordWorkspaceProvider
Section titled “[FUNCTION] RecordWorkspaceProvider”Provides record workspace transports with independent latest-response channels per operation/resource.
Imports: @alneas/eaos-react/record-workspace.
Signature
Section titled “Signature”declare const RecordWorkspaceProvider: ({ tenantId, recordId, sessionKey, client, children }: WorkspaceProviderProps<unknown>) => react.DetailedReactHTMLElement<{ role: "status";}, HTMLElement> | react.FunctionComponentElement<react.ProviderProps<WorkspaceClient<unknown> | null>>;Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
{ tenantId, recordId, sessionKey, client, children } |
WorkspaceProviderProps<unknown> |
Yes | WorkspaceProviderProps for the verified tenant/resource/session and stable host client. |
Returns
Section titled “Returns”react.DetailedReactHTMLElement<{ role: "status"; }, HTMLElement> \| react.FunctionComponentElement<react.ProviderProps<WorkspaceClient<unknown> \| null>>
Children once the scoped session is ready; otherwise loading/unavailable status content.
Remarks
Section titled “Remarks”See createWorkspaceReactBindings. Scope changes/unmount close the UI session; API authorization remains host-owned.
Example
Section titled “Example”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>; }[INTERFACE] RecordWorkspaceReference
Section titled “[INTERFACE] RecordWorkspaceReference”Authorized reference catalog declaration and ordered label projection.
Imports: @alneas/eaos-react/record-workspace.
Signature
Section titled “Signature”interface RecordWorkspaceReference { field: string; title: string; pluginId: string; listOperation: string; listKey: string; displayFields: readonly string[]; references?: readonly RecordWorkspaceReference[];}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
See also
Section titled “See also”RecordWorkspace for a complete host integration example.
Public members
Section titled “Public members”Foreign-key field receiving the selected record ID.
Reference selector label.
pluginId
Section titled “pluginId”Catalog owner and expected response recordId.
listOperation
Section titled “listOperation”Host operation used to read the authorized catalog.
listKey
Section titled “listKey”Response data property containing the candidate array.
displayFields
Section titled “displayFields”Ordered string fields used to form labels; empty labels fall back to record ID.
references
Section titled “references”Optional child catalogs resolving foreign-key display fields; nested loading requires referenceClient.
Remarks
Section titled “Remarks”Related labels, resolved through separately authorized catalogs (for example a room’s property).
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[INTERFACE] SaveFileOptions
Section titled “[INTERFACE] SaveFileOptions”File destination hints accepted by native and browser save adapters.
Imports: @alneas/eaos-react, @alneas/eaos-react/client.
Signature
Section titled “Signature”interface SaveFileOptions { filename: string; contentType?: string; revealInFinder?: boolean; openWithDefaultApp?: boolean;}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
See also
Section titled “See also”createFileDownloader for a complete host integration example.
Public members
Section titled “Public members”filename
Section titled “filename”Single safe filename up to 200 characters; no path separators/reserved desktop names.
contentType
Section titled “contentType”Browser Blob MIME type.
Default: 'application/octet-stream'.
revealInFinder
Section titled “revealInFinder”Request native file-manager reveal; ignored by browser saver.
Default: false.
openWithDefaultApp
Section titled “openWithDefaultApp”Request native opening after save; ignored by browser saver.
Default: false.
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[INTERFACE] SaveFileResult
Section titled “[INTERFACE] SaveFileResult”Save outcome data; success need not prove a browser download was durably written.
Imports: @alneas/eaos-react, @alneas/eaos-react/client.
Signature
Section titled “Signature”interface SaveFileResult { success: boolean; filePath?: string; error?: string;}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
See also
Section titled “See also”createFileDownloader for a complete host integration example.
Public members
Section titled “Public members”success
Section titled “success”Whether the adapter reports success; browser success only confirms initiation.
filePath
Section titled “filePath”Optional host-reported native destination path; absent for browser downloads.
Optional failure message returned as data rather than rejection by createFileDownloader.
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[FUNCTION] saveInBrowser
Section titled “[FUNCTION] saveInBrowser”Starts an anchor download and schedules object URL cleanup.
Imports: @alneas/eaos-react, @alneas/eaos-react/client.
Signature
Section titled “Signature”declare function saveInBrowser(bytes: Uint8Array, options: SaveFileOptions): Promise<SaveFileResult>;Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Promise<SaveFileResult>
Success after clicking the anchor; no path or durable-save confirmation is available.
Remarks
Section titled “Remarks”Requires browser document, Blob and object URL APIs. The anchor is removed immediately and URL revoked after one second.
Errors and rejections
Section titled “Errors and rejections”Rejects for invalid filename, unavailable document or browser API failure.
Example
Section titled “Example”import { saveInBrowser } from '@alneas/eaos-react/client';export const saveText = () => saveInBrowser(new TextEncoder().encode('Hello'), { filename: 'hello.txt', contentType: 'text/plain' });[FUNCTION] scopedUiRecord
Section titled “[FUNCTION] scopedUiRecord”Checks that a UI record belongs to the expected tenant and has a usable ID and positive revision.
Imports: @alneas/eaos-react/record-workspace.
Signature
Section titled “Signature”declare function scopedUiRecord(value: unknown, tenantId: string): ScopedUiRecord;Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
value |
unknown |
Yes | Untrusted record response. |
tenantId |
string |
Yes | Verified tenant ID expected on the record. |
Returns
Section titled “Returns”ScopedUiRecord
The original record object without cloning or validating domain fields.
Errors and rejections
Section titled “Errors and rejections”Error for missing/foreign tenant, empty ID or nonpositive/noninteger revision.
Example
Section titled “Example”import { scopedUiRecord } from '@alneas/eaos-react/record-workspace';const record = scopedUiRecord({ tenantId: 'sample', id: 'one', revision: 1 }, 'sample');[INTERFACE] ScopedUiRecord
Section titled “[INTERFACE] ScopedUiRecord”UI record with verified tenant, nonempty ID and positive optimistic revision.
Imports: @alneas/eaos-react/record-workspace.
Signature
Section titled “Signature”interface ScopedUiRecord { tenantId: string; id: string; revision: number; [key: string]: unknown;}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
See also
Section titled “See also”RecordWorkspace for a complete host integration example.
Public members
Section titled “Public members”tenantId
Section titled “tenantId”Verified tenant owning this record.
Nonempty resource ID.
revision
Section titled “revision”Positive safe integer used for optimistic concurrency.
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[FUNCTION] SnapshotWorkspace
Section titled “[FUNCTION] SnapshotWorkspace”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.
Signature
Section titled “Signature”declare function SnapshotWorkspace({ client, definition, help }: { client: WorkspaceClient<any> | null; definition: SnapshotWorkspaceDefinition; help?: react.ReactNode;}): react.JSX.Element;Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”react.JSX.Element
A list/form workspace, connection alert when client is missing, and status/error content while requests settle.
Remarks
Section titled “Remarks”Requires React,
Public members
Section titled “Public members”argument1.client
Section titled “argument1.client”Stable host transport carrying current authentication and authorization.
argument1.definition
Section titled “argument1.definition”Plugin-owned workspace schema, labels and operation declarations.
argument1.help
Section titled “argument1.help”Optional help content; undefined uses core help and null hides help.
Example
Section titled “Example”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}/>; }[INTERFACE] SnapshotWorkspaceDefinition
Section titled “[INTERFACE] SnapshotWorkspaceDefinition”Plugin-owned list/detail labels, actions and snapshot context conversion.
Imports: @alneas/eaos-react/snapshot-workspace.
Signature
Section titled “Signature”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>;}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
See also
Section titled “See also”SnapshotWorkspace for a complete host integration example.
Public members
Section titled “Public members”Workspace heading.
sections
Section titled “sections”Snapshot collection keys mapped to navigation labels.
labels
Section titled “labels”Scalar record field captions.
actions
Section titled “actions”Host operation forms with ordered key/label/type/required field metadata.
actions[].operation
Section titled “actions[].operation”Host operation identifier.
actions[].label
Section titled “actions[].label”Human-readable field caption.
actions[].fields
Section titled “actions[].fields”Ordered command input definitions.
actions[].fields[].key
Section titled “actions[].fields[].key”Command input property key.
actions[].fields[].label
Section titled “actions[].fields[].label”Human-readable field caption.
actions[].fields[].type
Section titled “actions[].fields[].type”Command field kind; supported special forms include collection selectors and numeric/boolean inputs.
actions[].fields[].required
Section titled “actions[].fields[].required”Whether the generated command input is required; omitted defaults to true.
arrayLabels
Section titled “arrayLabels”Optional captions for array-valued detail fields.
itemLabels
Section titled “itemLabels”Optional captions for nested item fields.
nestedDetails
Section titled “nestedDetails”Optional field keys rendered as nested details.
collectionKey
Section titled “collectionKey”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;}collectionLabel
Section titled “collectionLabel”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;}prepare
Section titled “prepare”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;}context
Section titled “context”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) ?? {};}Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[INTERFACE] TenantContext
Section titled “[INTERFACE] TenantContext”Verified host identity and enabled module IDs used for UI admission.
Imports: @alneas/eaos-react.
Signature
Section titled “Signature”interface TenantContext { tenantId: string; userId: string | null; enabledModules: readonly string[];}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
See also
Section titled “See also”createWorkspaceReactBindings for a complete host integration example.
Public members
Section titled “Public members”tenantId
Section titled “tenantId”Verified nonempty tenant identifier.
userId
Section titled “userId”Authenticated user ID; null represents missing identity and is rejected by the store when a context is loaded.
enabledModules
Section titled “enabledModules”Module IDs admitted by the host; copied and frozen by createTenantModuleStore.
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[FUNCTION] TenantModuleProvider
Section titled “[FUNCTION] TenantModuleProvider”Makes a host-owned tenant module store available to descendant React hooks.
Imports: @alneas/eaos-react.
Signature
Section titled “Signature”declare function TenantModuleProvider<T extends TenantContext>({ store, children }: { store: TenantModuleStore<T>; children: ReactNode;}): react.FunctionComponentElement<react.ProviderProps<TenantModuleStore<TenantContext> | null>>;Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
{ store, children } |
{ store: TenantModuleStore<T>; children: ReactNode; } |
Yes | Store and children; keep store identity stable across renders. |
Returns
Section titled “Returns”react.FunctionComponentElement<react.ProviderProps<TenantModuleStore<TenantContext> \| null>>
A context provider rendering children without initiating a refresh.
Type parameters
Section titled “Type parameters”T: Host tenant context supplied by the store.
Remarks
Section titled “Remarks”Requires React. The host owns refreshing and clearing the store on authentication changes.
Public members
Section titled “Public members”argument1.store
Section titled “argument1.store”Host-owned external tenant store; keep its identity stable across renders.
argument1.children
Section titled “argument1.children”React descendants rendered within this component.
Example
Section titled “Example”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>;}[INTERFACE] TenantModuleStore
Section titled “[INTERFACE] TenantModuleStore”Host-driven subscription and refresh contract for tenant module visibility.
Imports: @alneas/eaos-react.
Signature
Section titled “Signature”interface TenantModuleStore<T extends TenantContext> { subscribe(listener: () => void): () => void; getSnapshot(): TenantSnapshot<T>; refresh(): Promise<void>; clear(): void;}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
Type parameters
Section titled “Type parameters”T: Host value shape carried by this contract.
See also
Section titled “See also”createWorkspaceReactBindings for a complete host integration example.
Public members
Section titled “Public members”subscribe
Section titled “subscribe”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(); }}getSnapshot
Section titled “getSnapshot”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 };}refresh
Section titled “refresh”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.}Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[INTERFACE] TenantSnapshot
Section titled “[INTERFACE] TenantSnapshot”Immutable external-store state with fail-closed identity while loading or after failure.
Imports: @alneas/eaos-react.
Signature
Section titled “Signature”interface TenantSnapshot<T extends TenantContext> { context: T | null; loading: boolean; error: Error | null;}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
Type parameters
Section titled “Type parameters”T: Host value shape carried by this contract.
See also
Section titled “See also”createWorkspaceReactBindings for a complete host integration example.
Public members
Section titled “Public members”context
Section titled “context”Verified identity, or null while loading/unauthenticated/failed.
loading
Section titled “loading”True while the newest context request is pending.
Loader/validation error for the newest request, or null.
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[FUNCTION] titleRecordSchema
Section titled “[FUNCTION] titleRecordSchema”Adds missing plugin field titles recursively through properties and items without replacing explicit titles.
Imports: @alneas/eaos-react/record-workspace.
Signature
Section titled “Signature”declare function titleRecordSchema(schema: any, labels: Readonly<Record<string, string>>): any;Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”any
A recursively copied properties/items tree preserving other schema metadata.
Remarks
Section titled “Remarks”Add plugin-owned labels without mutating the command’s canonical schema.
Example
Section titled “Example”import { titleRecordSchema } from '@alneas/eaos-react/record-workspace';const schema = titleRecordSchema({ type: 'object', properties: { title: { type: 'string' } } }, { title: 'Report title' });[FUNCTION] usePluginAccess
Section titled “[FUNCTION] usePluginAccess”Derives fail-closed plugin visibility from the authenticated module and plugin-access snapshots.
Imports: @alneas/eaos-react, @alneas/eaos-react/plugin-gate.
Signature
Section titled “Signature”declare function usePluginAccess(pluginId: string): { allowed: boolean; loading: boolean; reason: string | undefined;};Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
pluginId |
string |
Yes | Plugin key present in both enabledModules and pluginAccess. |
Returns
Section titled “Returns”{ allowed: boolean; loading: boolean; reason: string \| undefined; }
Allowed/loading flags and optional host denial reason; allowed is false during loading or errors.
Remarks
Section titled “Remarks”Requires TenantModuleProvider and PluginTenantContext from a trusted host loader; does not grant server access.
Errors and rejections
Section titled “Errors and rejections”Error outside TenantModuleProvider.
Example
Section titled “Example”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>; }[FUNCTION] usePluginApi
Section titled “[FUNCTION] usePluginApi”Creates a session-bound request function for one plugin using the nearest host runtime.
Imports: @alneas/eaos-react, @alneas/eaos-react/plugin-runtime.
Signature
Section titled “Signature”declare const usePluginApi: (pluginId: string) => <T = unknown>(operation: string, input?: unknown) => Promise<T>;Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
pluginId |
string |
Yes | Lowercase plugin ID starting with a letter and containing letters, digits or hyphens; maximum 128 characters. |
Returns
Section titled “Returns”<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.
Remarks
Section titled “Remarks”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.
Errors and rejections
Section titled “Errors and rejections”Returned function rejects missing runtime, invalid plugin ID, expired session and propagated host errors.
Example
Section titled “Example”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>; }[FUNCTION] usePluginCompute
Section titled “[FUNCTION] usePluginCompute”Creates a session-bound compute function for one plugin using the nearest host runtime.
Imports: @alneas/eaos-react, @alneas/eaos-react/plugin-runtime.
Signature
Section titled “Signature”declare const usePluginCompute: (pluginId: string) => <T = unknown>(operation: string, input?: unknown) => Promise<T>;Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
pluginId |
string |
Yes | Lowercase plugin ID starting with a letter and containing letters, digits or hyphens; maximum 128 characters. |
Returns
Section titled “Returns”<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.
Remarks
Section titled “Remarks”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.
Errors and rejections
Section titled “Errors and rejections”Returned function rejects missing runtime, invalid plugin ID, expired session and propagated host errors.
Example
Section titled “Example”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>; }[FUNCTION] useRecordWorkspaceClient
Section titled “[FUNCTION] useRecordWorkspaceClient”Reads the scoped transport from the nearest RecordWorkspaceProvider.
Imports: @alneas/eaos-react/record-workspace.
Signature
Section titled “Signature”declare const useRecordWorkspaceClient: () => WorkspaceClient<unknown> | null;Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
| — | — | — | No call parameters. |
Returns
Section titled “Returns”WorkspaceClient<unknown> \| null
The session-guarded client, or null outside a ready provider.
Remarks
Section titled “Remarks”React hook; see RecordWorkspace for provider setup.
Example
Section titled “Example”import { useRecordWorkspaceClient } from '@alneas/eaos-react/record-workspace';export function useRecordReload() { const client = useRecordWorkspaceClient(); return () => client?.load(); }[FUNCTION] UserGuide
Section titled “[FUNCTION] UserGuide”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.
Signature
Section titled “Signature”declare function UserGuide({ document, summary, initiallyOpen }: { document: UserGuideDocument; summary?: string; initiallyOpen?: boolean;}): react.JSX.Element;Parameters
Section titled “Parameters”| 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). |
Returns
Section titled “Returns”react.JSX.Element
A collapsible guide; unsupported link protocols render as plain inline content.
Remarks
Section titled “Remarks”Requires React. Heading levels are shifted down by one, capped at h6. Pass trusted static document data, not tenant-authored executable content.
Errors and rejections
Section titled “Errors and rejections”Error for a document schemaVersion other than 1.
Public members
Section titled “Public members”argument1.document
Section titled “argument1.document”Trusted static structured help document with schemaVersion 1.
argument1.summary
Section titled “argument1.summary”Details trigger caption; defaults to the bundled Japanese help title.
argument1.initiallyOpen
Section titled “argument1.initiallyOpen”Whether the help starts expanded; defaults to false.
Example
Section titled “Example”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"/>; }[TYPE] UserGuideBlock
Section titled “[TYPE] UserGuideBlock”Supported help blocks; tables/lists contain structured child nodes rather than HTML.
Imports: @alneas/eaos-react/user-guide.
Signature
Section titled “Signature”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;};Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
| — | — | — | No call parameters. |
Returns
Section titled “Returns”Type declaration; no runtime value.
See also
Section titled “See also”UserGuide for a complete host integration example.
Public members
Section titled “Public members”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.
children
Section titled “children”Ordered inline nodes rendered recursively.
Discriminator selecting the supported node shape; raw HTML is not a variant.
children
Section titled “children”Ordered inline nodes rendered recursively.
Discriminator selecting the supported node shape; raw HTML is not a variant.
ordered
Section titled “ordered”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.
header
Section titled “header”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.
language
Section titled “language”Optional code-language metadata; the renderer currently uses plain escaped code.
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[INTERFACE] UserGuideDocument
Section titled “[INTERFACE] UserGuideDocument”Version-1 static help document with locale and structured blocks.
Imports: @alneas/eaos-react/user-guide.
Signature
Section titled “Signature”interface UserGuideDocument { schemaVersion: 1; id: string; locale: string; blocks: readonly UserGuideBlock[];}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
See also
Section titled “See also”UserGuide for a complete host integration example.
Public members
Section titled “Public members”schemaVersion
Section titled “schemaVersion”Supported document discriminator; must equal 1.
Static guide identity exposed through data-guide-id.
locale
Section titled “locale”Language tag rendered on the guide element.
blocks
Section titled “blocks”Ordered structured document blocks; no raw executable HTML.
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[TYPE] UserGuideInline
Section titled “[TYPE] UserGuideInline”Supported inline text, code, emphasis and link nodes in static help documents.
Imports: @alneas/eaos-react/user-guide.
Signature
Section titled “Signature”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[];};Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
| — | — | — | No call parameters. |
Returns
Section titled “Returns”Type declaration; no runtime value.
See also
Section titled “See also”UserGuide for a complete host integration example.
Public members
Section titled “Public members”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.
children
Section titled “children”Ordered inline nodes rendered recursively.
Discriminator selecting the supported node shape; raw HTML is not a variant.
children
Section titled “children”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.
children
Section titled “children”Ordered inline nodes rendered recursively.
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[FUNCTION] useTenantModule
Section titled “[FUNCTION] useTenantModule”Subscribes to the nearest tenant store and derives module visibility from its current snapshot.
Imports: @alneas/eaos-react.
Signature
Section titled “Signature”declare function useTenantModule<T extends TenantContext = TenantContext>(): { hasModule: (id: string) => boolean; refetchContext: () => Promise<void>; context: T | null; loading: boolean; error: Error | null;};Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
| — | — | — | No call parameters. |
Returns
Section titled “Returns”{ 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.
Type parameters
Section titled “Type parameters”T: Expected host context; defaults to TenantContext and does not validate extra fields.
Remarks
Section titled “Remarks”Use in a React component under TenantModuleProvider; visibility never grants API permission.
Errors and rejections
Section titled “Errors and rejections”Error when called outside TenantModuleProvider.
Example
Section titled “Example”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;}[FUNCTION] useWorkspaceClientAdapter
Section titled “[FUNCTION] useWorkspaceClientAdapter”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.
Signature
Section titled “Signature”declare function useWorkspaceClientAdapter<T, U>(tenantId: string | null, sessionKey: string | null, client: T, adapt: (tenantId: string, recordId: string, client: T) => WorkspaceClient<U>): WorkspaceClient<U>;Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”WorkspaceClient<U>
The adapted client, recomputed when any dependency changes.
Type parameters
Section titled “Type parameters”T: Raw client shape.U: Adapted snapshot payload.
Remarks
Section titled “Remarks”React hook; adapt must be stable and must fail closed for empty scope. The surrounding workspace provider determines readiness.
Example
Section titled “Example”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);}[FUNCTION] useWorkspaceTask
Section titled “[FUNCTION] useWorkspaceTask”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.
Signature
Section titled “Signature”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>;};Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”{ 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.
Remarks
Section titled “Remarks”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.
Example
Section titled “Example”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(); }) };}[FUNCTION] validateBrowserAuthConfig
Section titled “[FUNCTION] validateBrowserAuthConfig”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.
Signature
Section titled “Signature”declare function validateBrowserAuthConfig(config: BrowserAuthConfig): BrowserAuthConfig;Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
config |
BrowserAuthConfig |
Yes | Authentication origin and provider with optional HTTPS returnTo and explicit origin allowlist. |
Returns
Section titled “Returns”BrowserAuthConfig
A shallow config copy with normalized publicUrl and a copied redirectOrigins array.
Errors and rejections
Section titled “Errors and rejections”Error or URL parsing error for invalid origin, credentials, fragments, provider or redirect origins.
Example
Section titled “Example”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'] });[FUNCTION] validateDownloadFilename
Section titled “[FUNCTION] validateDownloadFilename”Rejects filenames unsafe for a single downloaded file on common desktop filesystems.
Imports: @alneas/eaos-react, @alneas/eaos-react/client.
Signature
Section titled “Signature”declare function validateDownloadFilename(filename: string): void;Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
filename |
string |
Yes | Nonempty filename up to 200 characters, excluding path separators, reserved names, controls and trailing dot/space. |
Returns
Section titled “Returns”void
Completes without a value when the name is accepted.
Errors and rejections
Section titled “Errors and rejections”Error for invalid or reserved filenames.
Example
Section titled “Example”import { validateDownloadFilename } from '@alneas/eaos-react/client';validateDownloadFilename('report.csv');[INTERFACE] WorkspaceClient
Section titled “[INTERFACE] WorkspaceClient”Authenticated host transport for loading and executing workspace operations.
Imports: @alneas/eaos-react.
Signature
Section titled “Signature”interface WorkspaceClient<TData = unknown> { load(): Promise<WorkspaceSnapshot<TData>>; execute(operation: string, input: Record<string, unknown>): Promise<WorkspaceSnapshot<TData>>;}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
Type parameters
Section titled “Type parameters”TData: Host snapshot payload; defaults to unknown.
Remarks
Section titled “Remarks”Host transport for a bounded, optimistic-concurrency workspace.
See also
Section titled “See also”createWorkspaceReactBindings for a complete host integration example.
Public members
Section titled “Public members”Load the current authorized snapshot; resolves a WorkspaceSnapshot or rejects transport/authorization failure.
Returns: The current authorized snapshot.
Errors and rejections
Section titled “Errors and rejections”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
Section titled “execute”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.
Errors and rejections
Section titled “Errors and rejections”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.}Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[FUNCTION] WorkspaceHeader
Section titled “[FUNCTION] WorkspaceHeader”Composes the shared header with help and an optional connected host chat toggle.
Imports: @alneas/eaos-react/workspace-shell, @alneas/eaos-react/workspace-layout.
Signature
Section titled “Signature”declare function WorkspaceHeader({ chat, actions, ...props }: WorkspaceHeaderProps): react.JSX.Element;Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
{ chat, actions, ...props } |
WorkspaceHeaderProps |
Yes | Inherited Header props and optional chat; title defaults to EAOS and actions precede chat/help. |
Returns
Section titled “Returns”react.JSX.Element
A react-tools Header with composed action controls.
Remarks
Section titled “Remarks”Requires React,
Example
Section titled “Example”import * as React from 'react';import { WorkspaceHeader } from '@alneas/eaos-react/workspace-layout';export function Header() { return <WorkspaceHeader title="Workspace"/>; }[INTERFACE] WorkspaceHeaderProps
Section titled “[INTERFACE] WorkspaceHeaderProps”Shared Header properties with an optional live host chat control.
Imports: @alneas/eaos-react/workspace-shell, @alneas/eaos-react/workspace-layout.
Signature
Section titled “Signature”interface WorkspaceHeaderProps extends HeaderProps { chat?: { connected: boolean; open: boolean; onToggle: () => void; controls?: string; };}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
Remarks
Section titled “Remarks”Shared defaults backed by the public react-tools Header.
See also
Section titled “See also”workspaceNavigation for a complete host integration example.
Public members
Section titled “Public members”Optional connected/open state and host onToggle callback; controls is the controlled pane ID for aria-controls. Disconnected chat is hidden.
Remarks
Section titled “Remarks”Host supplies a currently connected, authorized chat pane. Omitted/disconnected chat stays hidden.
chat.connected
Section titled “chat.connected”Whether the host chat transport is currently connected.
chat.open
Section titled “chat.open”Whether the controlled chat pane is currently visible.
chat.onToggle
Section titled “chat.onToggle”Host callback to toggle chat visibility; no value is returned.
chat.controls
Section titled “chat.controls”DOM ID of the controlled chat pane.
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[FUNCTION] WorkspaceHelpButton
Section titled “[FUNCTION] WorkspaceHelpButton”Opens the bundled workspace guide in an accessible dialog.
Imports: @alneas/eaos-react/workspace-shell, @alneas/eaos-react/workspace-layout.
Signature
Section titled “Signature”declare function WorkspaceHelpButton(): react.JSX.Element;Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
| — | — | — | No call parameters. |
Returns
Section titled “Returns”react.JSX.Element
A help icon trigger and scrollable dialog.
Remarks
Section titled “Remarks”Requires React,
Example
Section titled “Example”import * as React from 'react';import { WorkspaceHelpButton } from '@alneas/eaos-react/workspace-layout';export function Help() { return <WorkspaceHelpButton/>; }[FUNCTION] WorkspaceLoginScreen
Section titled “[FUNCTION] WorkspaceLoginScreen”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.
Signature
Section titled “Signature”declare function WorkspaceLoginScreen({ title, description, showEmailLogin, showRegisterLink, onRegisterClick, socialProviders, redirectTo, }: WorkspaceLoginScreenProps): react.JSX.Element;Parameters
Section titled “Parameters”| 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 /. |
Returns
Section titled “Returns”react.JSX.Element
A login page element with optional description and host-selected social providers.
Remarks
Section titled “Remarks”Requires React,
Example
Section titled “Example”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}/>; }[INTERFACE] WorkspaceLoginScreenProps
Section titled “[INTERFACE] WorkspaceLoginScreenProps”Login page presentation and host-selected authentication controls.
Imports: @alneas/eaos-react/workspace-login, @alneas/eaos-react/workspace-shell.
Signature
Section titled “Signature”interface WorkspaceLoginScreenProps { title?: string; description?: ReactNode; showEmailLogin?: boolean; showRegisterLink?: boolean; onRegisterClick?: () => void; socialProviders?: ComponentProps<typeof LoginForm>['socialProviders']; redirectTo?: string;}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
See also
Section titled “See also”WorkspaceLoginScreen for a complete host integration example.
Public members
Section titled “Public members”Page heading.
Default: 'ワークスペースへログイン'.
description
Section titled “description”Optional content above the login form.
showEmailLogin
Section titled “showEmailLogin”Whether react-tools displays email login.
Default: true.
showRegisterLink
Section titled “showRegisterLink”Whether react-tools displays registration navigation.
Default: true.
onRegisterClick
Section titled “onRegisterClick”Optional host callback invoked by the registration control.
socialProviders
Section titled “socialProviders”Host-configured LoginForm social provider controls and callbacks.
redirectTo
Section titled “redirectTo”Post-login destination passed to LoginForm.
Default: '/'.
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[FUNCTION] workspaceNavigation
Section titled “[FUNCTION] workspaceNavigation”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.
Signature
Section titled “Signature”declare function workspaceNavigation(options?: WorkspaceNavigationOptions): SmartSidebarGroup[];Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
options |
WorkspaceNavigationOptions |
No | Role flags, route overrides and filtered contributions; defaults to standard workspace/account links. |
Returns
Section titled “Returns”SmartSidebarGroup[]
New sidebar groups; isTenantAdmin adds users and isPlatformAdmin adds platform management.
Remarks
Section titled “Remarks”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.
Example
Section titled “Example”import { workspaceNavigation } from '@alneas/eaos-react/workspace-layout';const groups = workspaceNavigation({ isTenantAdmin: false, routes: { home: '/workspace' } });[INTERFACE] WorkspaceNavigationOptions
Section titled “[INTERFACE] WorkspaceNavigationOptions”Presentation flags, route overrides and pre-admitted sidebar contributions.
Imports: @alneas/eaos-react/workspace-shell, @alneas/eaos-react/workspace-layout.
Signature
Section titled “Signature”interface WorkspaceNavigationOptions { isPlatformAdmin?: boolean; isTenantAdmin?: boolean; hasTenant?: boolean; routes?: Partial<Record<'home' | 'users' | 'account' | 'platform', string>>; contributions?: SmartSidebarGroup[];}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
See also
Section titled “See also”workspaceNavigation for a complete host integration example.
Public members
Section titled “Public members”isPlatformAdmin
Section titled “isPlatformAdmin”Show platform-management navigation when true; defaults to false.
isTenantAdmin
Section titled “isTenantAdmin”Show tenant user-management navigation when true; defaults to false.
hasTenant
Section titled “hasTenant”Reserved presentation flag; currently does not affect generated navigation.
routes
Section titled “routes”Optional overrides for the home, users, account and platform default paths.
contributions
Section titled “contributions”Host-filtered sidebar groups inserted between workspace and platform groups; never grants access.
Remarks
Section titled “Remarks”Host must filter contributions against current server admission before passing them.
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[FUNCTION] WorkspaceNumberField
Section titled “[FUNCTION] WorkspaceNumberField”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.
Signature
Section titled “Signature”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;Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”react.JSX.Element
A labeled numeric Input; nonfinite values render blank.
Remarks
Section titled “Remarks”Requires React,
Public members
Section titled “Public members”argument1.label
Section titled “argument1.label”Human-readable field caption.
argument1.value
Section titled “argument1.value”Controlled field value; the host must update it in response to onChange.
argument1.onChange
Section titled “argument1.onChange”Receives the parsed user input; update controlled state in this callback.
argument1.min
Section titled “argument1.min”Numeric lower bound; defaults to 0.
argument1.max
Section titled “argument1.max”Numeric upper bound; defaults to 1000000000000.
argument1.step
Section titled “argument1.step”Numeric input increment string; defaults to any.
Example
Section titled “Example”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}/>; }[INTERFACE] WorkspaceProviderProps
Section titled “[INTERFACE] WorkspaceProviderProps”Verified host scope, transport and descendant content for a workspace session.
Imports: @alneas/eaos-react.
Signature
Section titled “Signature”interface WorkspaceProviderProps<TData> { tenantId: string | null; recordId: string | null; sessionKey: string | null; client: WorkspaceClient<TData>; children: ReactNode;}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
Type parameters
Section titled “Type parameters”TData: Host snapshot payload; defaults to unknown.
See also
Section titled “See also”createWorkspaceReactBindings for a complete host integration example.
Public members
Section titled “Public members”tenantId
Section titled “tenantId”Verified tenant ID; null disables the workspace.
recordId
Section titled “recordId”Verified record/resource key; null disables the workspace.
sessionKey
Section titled “sessionKey”Host identity generation key; change on authentication changes; null disables the workspace.
client
Section titled “client”Stable authenticated transport replaced when its host scope changes.
children
Section titled “children”Workspace content rendered only when a session is ready.
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[INTERFACE] WorkspaceSessionOptions
Section titled “[INTERFACE] WorkspaceSessionOptions”Controls which concurrent workspace replies supersede each other.
Imports: @alneas/eaos-react.
Signature
Section titled “Signature”interface WorkspaceSessionOptions { responseScope?: 'session' | 'operation-resource';}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
Remarks
Section titled “Remarks”Adds lifecycle, stale-response and tenant/resource checks around a host client. This is UI session state only; authorization remains server-owned.
See also
Section titled “See also”createWorkspaceReactBindings for a complete host integration example.
Public members
Section titled “Public members”responseScope
Section titled “responseScope”Session-wide latest reply by default; operation-resource keeps independent latest replies per operation and string input.id.
Default: 'session'.
Remarks
Section titled “Remarks”Independent panels may retain replies from different operations/resources. Default: one latest reply for the session.
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[FUNCTION] WorkspaceSidebar
Section titled “[FUNCTION] WorkspaceSidebar”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.
Signature
Section titled “Signature”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;Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”react.JSX.Element
A SmartSidebar; selecting links closes its mobile state before notifying the host.
Remarks
Section titled “Remarks”Requires React,
Public members
Section titled “Public members”argument1.tenantName
Section titled “argument1.tenantName”Optional tenant heading; omitted or empty displays Workspace.
argument1.activePath
Section titled “argument1.activePath”Current host router path used for active navigation styling.
argument1.onNavigate
Section titled “argument1.onNavigate”Host route callback; receives the selected path after mobile sidebar is closed.
argument1.onLogout
Section titled “argument1.onLogout”Optional host logout callback; it must clear verified UI state and perform real logout.
argument1.user
Section titled “argument1.user”Optional Header user presentation data; never used to derive API authority.
argument1.footer
Section titled “argument1.footer”Optional custom footer replacing the default identity/logout controls.
Example
Section titled “Example”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}/>; }[INTERFACE] WorkspaceSnapshot
Section titled “[INTERFACE] WorkspaceSnapshot”Tenant/resource-bound host response carrying a revision and typed payload.
Imports: @alneas/eaos-react.
Signature
Section titled “Signature”interface WorkspaceSnapshot<TData = unknown> { tenantId: string; recordId: string; revision: number; data: TData;}Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Type declaration; no runtime value.
Type parameters
Section titled “Type parameters”TData: Host snapshot payload; defaults to unknown.
Remarks
Section titled “Remarks”A tenant/resource-bound snapshot returned by a host-owned record API.
See also
Section titled “See also”createWorkspaceReactBindings for a complete host integration example.
Public members
Section titled “Public members”tenantId
Section titled “tenantId”Verified tenant owning this response.
recordId
Section titled “recordId”Host resource/session record identifier matched by the session boundary.
revision
Section titled “revision”Host snapshot revision used for optimistic concurrency; semantics belong to the plugin.
Typed host response payload; session wrappers clone it before returning.
Example
Section titled “Example”See the owning declaration and linked feature guide for usage; no standalone example is documented in source.
[FUNCTION] WorkspaceTextField
Section titled “[FUNCTION] WorkspaceTextField”Renders a controlled labeled text input or textarea with native length and required constraints.
Imports: @alneas/eaos-react/workspace-fields.
Signature
Section titled “Signature”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;Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”react.JSX.Element
A label containing Input or Textarea.
Remarks
Section titled “Remarks”Requires React,
Public members
Section titled “Public members”argument1.label
Section titled “argument1.label”Human-readable field caption.
argument1.value
Section titled “argument1.value”Controlled field value; the host must update it in response to onChange.
argument1.onChange
Section titled “argument1.onChange”Receives the parsed user input; update controlled state in this callback.
argument1.multiline
Section titled “argument1.multiline”Render a Textarea when true; defaults to false.
argument1.required
Section titled “argument1.required”Native required constraint; defaults to false for WorkspaceTextField.
argument1.max
Section titled “argument1.max”Maximum text length in characters; defaults to 200.
argument1.type
Section titled “argument1.type”Native text input type; defaults to text.
Example
Section titled “Example”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}/>; }