- Name
cache- Kind
- parameter
- Type
GridRowProjectionCache<T>- Requirement
- required
Headless core
The framework-neutral contract shared by every connector, vanilla mount and adapter. Component-specific core APIs live on their matching component page.
@grassroot/ui-headless-core
Root utilities
Layers and overlays
activateAssistantModalLayer
functiondeclare function activateAssistantModalLayer(service: AssistantModalService, scope: PartScope, document: Document, options?: Pick<AssistantModalConnectOptions, "modal" | "dissmissOnInteractOutside" | "dismissOnInteractOutside">): () => void;serviceAssistantModalServicescopePartScopedocumentDocumentoptionsPick<AssistantModalConnectOptions, "modal" | "dissmissOnInteractOutside" | "dismissOnInteractOutside">return() => void- Name
service- Kind
- parameter
- Type
AssistantModalService- Requirement
- required
- Name
scope- Kind
- parameter
- Type
PartScope- Requirement
- required
- Name
document- Kind
- parameter
- Type
Document- Requirement
- required
- Name
options- Kind
- parameter
- Type
Pick<AssistantModalConnectOptions, "modal" | "dissmissOnInteractOutside" | "dismissOnInteractOutside">- Requirement
- optional
- Name
return- Kind
- return value
- Type
() => void- Requirement
- n/a
activateOverlayLayer
functionShared overlay activation seam. Component connectors retain their public activation names and machine-specific containment, while this module owns the layer-handle lifecycle and makes the layer stack the only implementation.
declare function activateOverlayLayer(options: LayerOptions): LayerHandle;optionsLayerOptionsreturnLayerHandle- Name
options- Kind
- parameter
- Type
LayerOptions- Requirement
- required
- Name
return- Kind
- return value
- Type
LayerHandle- Requirement
- n/a
LayerHandle
interfaceinterface LayerHandle { /** Idempotent. Pops this layer wherever it sits in the stack; never * touches focus or scroll beyond releasing this layer's own scroll * lock (if any) — those are the other managers' jobs. */ release(): void;}release() => void- Name
release- Kind
- method
- Type
() => void- Requirement
- required
- Description
- Idempotent. Pops this layer wherever it sits in the stack; never touches focus or scroll beyond releasing this layer's own scroll lock (if any) — those are the other managers' jobs.
LayerOptions
interfaceinterface LayerOptions { /** Dismissal intent — forward to the machine; never mutate state here. */ readonly onDismiss: (reason: "escape" | "outside-click") => void; /** The layer's containment set: pointerdown inside any of these elements * is NOT an outside click. Re-evaluated per event (portals/mounting). */ readonly getElements: () => readonly Element[]; /** Document owning the listeners; from the part scope's root — never a * bare global lookup (shadow-root/iframe safety). */ readonly document: Document; /** Modal layers also lock scroll while topmost (see lockScroll). */ readonly modal?: boolean;}documentDocumentgetElements() => readonly Element[]modalbooleanonDismiss(reason: "escape" | "outside-click") => void- Name
document- Kind
- property
- Type
Document- Requirement
- required
- Description
- Document owning the listeners; from the part scope's root — never a bare global lookup (shadow-root/iframe safety).
- Name
getElements- Kind
- property
- Type
() => readonly Element[]- Requirement
- required
- Description
- The layer's containment set: pointerdown inside any of these elements is NOT an outside click. Re-evaluated per event (portals/mounting).
- Name
modal- Kind
- property
- Type
boolean- Requirement
- optional
- Description
- Modal layers also lock scroll while topmost (see lockScroll).
- Name
onDismiss- Kind
- property
- Type
(reason: "escape" | "outside-click") => void- Requirement
- required
- Description
- Dismissal intent — forward to the machine; never mutate state here.
lockScroll
functiondeclare function lockScroll(document: Document): ScrollLockHandle;documentDocumentreturnScrollLockHandle- Name
document- Kind
- parameter
- Type
Document- Requirement
- required
- Name
return- Kind
- return value
- Type
ScrollLockHandle- Requirement
- n/a
pushLayer
functiondeclare function pushLayer(options: LayerOptions): LayerHandle;optionsLayerOptionsreturnLayerHandle- Name
options- Kind
- parameter
- Type
LayerOptions- Requirement
- required
- Name
return- Kind
- return value
- Type
LayerHandle- Requirement
- n/a
ScrollLockHandle
interfaceReference-counted scroll lock, per `Document`. Frozen contract: `layers.spec.md`. DOM access is entirely duck-typed against the `document` passed in (including its `defaultView` for `innerWidth` — never a bare global `window` lookup).
interface ScrollLockHandle { /** Idempotent per handle. */ release(): void;}release() => void- Name
release- Kind
- method
- Type
() => void- Requirement
- required
- Description
- Idempotent per handle.
Announcements and messages
AnnouncerMessages
type`AnnouncerMessages` maps a semantic ANNOUNCE key to a formatter function. No default table is provided here — consumers (e.g. the Select connector's locale layer) own their own wording.
type AnnouncerMessages = Record<string, (params: { readonly [key: string]: string | number | null;}) => string>;assistantMessageAnatomy
valueexport declare const assistantMessageAnatomy: { readonly scope: "assistant-message"; readonly parts: readonly ["root", "parts", "grouped-parts", "part", "generative-ui", "attachments", "attachment", "error", "quote"];};partsreadonly ["root", "parts", "grouped-parts", "part", "generative-ui", "attachments", "attachment", "error", "quote"]scope"assistant-message"- Name
parts- Kind
- property
- Type
readonly ["root", "parts", "grouped-parts", "part", "generative-ui", "attachments", "attachment", "error", "quote"]- Requirement
- required
- Name
scope- Kind
- property
- Type
"assistant-message"- Requirement
- required
AssistantMessageApi
interfaceinterface AssistantMessageApi { rootProps(): PartProps; partsProps(): PartProps; groupedPartsProps(): PartProps; partProps(index: number): PartProps; errorProps(): PartProps; quoteProps(): PartProps; readonly isHovering: boolean;}errorProps() => PartPropsgroupedPartsProps() => PartPropsisHoveringbooleanpartProps(index: number) => PartPropspartsProps() => PartPropsquoteProps() => PartPropsrootProps() => PartProps- Name
errorProps- Kind
- method
- Type
() => PartProps- Requirement
- required
- Name
groupedPartsProps- Kind
- method
- Type
() => PartProps- Requirement
- required
- Name
isHovering- Kind
- property
- Type
boolean- Requirement
- required
- Name
partProps- Kind
- method
- Type
(index: number) => PartProps- Requirement
- required
- Name
partsProps- Kind
- method
- Type
() => PartProps- Requirement
- required
- Name
quoteProps- Kind
- method
- Type
() => PartProps- Requirement
- required
- Name
rootProps- Kind
- method
- Type
() => PartProps- Requirement
- required
AssistantMessageConnectOptions
interfaceinterface AssistantMessageConnectOptions { readonly messageId: string; readonly role?: "user" | "assistant" | "system"; readonly getIsHovering?: () => boolean; readonly onHoverChange?: (isHovering: boolean) => void;}getIsHovering() => booleanmessageIdstringonHoverChange(isHovering: boolean) => voidrole"user" | "assistant" | "system"- Name
getIsHovering- Kind
- property
- Type
() => boolean- Requirement
- optional
- Name
messageId- Kind
- property
- Type
string- Requirement
- required
- Name
onHoverChange- Kind
- property
- Type
(isHovering: boolean) => void- Requirement
- optional
- Name
role- Kind
- property
- Type
"user" | "assistant" | "system"- Requirement
- optional
AssistantMessagePart
typetype AssistantMessagePart = (typeof assistantMessageAnatomy.parts)[number];export declare const assistantMessagePartAnatomy: { readonly scope: "assistant-message-part"; readonly parts: readonly ["root", "text", "image", "in-progress"];};partsreadonly ["root", "text", "image", "in-progress"]scope"assistant-message-part"- Name
parts- Kind
- property
- Type
readonly ["root", "text", "image", "in-progress"]- Requirement
- required
- Name
scope- Kind
- property
- Type
"assistant-message-part"- Requirement
- required
AssistantMessagePartApi
interfaceinterface AssistantMessagePartApi { rootProps(): PartProps; textProps(): PartProps; imageProps(): PartProps; inProgressProps(): PartProps; readonly status: string | undefined;}imageProps() => PartPropsinProgressProps() => PartPropsrootProps() => PartPropsstatusstring | undefinedtextProps() => PartProps- Name
imageProps- Kind
- method
- Type
() => PartProps- Requirement
- required
- Name
inProgressProps- Kind
- method
- Type
() => PartProps- Requirement
- required
- Name
rootProps- Kind
- method
- Type
() => PartProps- Requirement
- required
- Name
status- Kind
- property
- Type
string | undefined- Requirement
- required
- Name
textProps- Kind
- method
- Type
() => PartProps- Requirement
- required
AssistantMessagePartConnectOptions
interfaceinterface AssistantMessagePartConnectOptions { readonly index: number; readonly part: AssistantMessagePartValue;}indexnumberpartAssistantMessagePartValue- Name
index- Kind
- property
- Type
number- Requirement
- required
- Name
part- Kind
- property
- Type
AssistantMessagePartValue- Requirement
- required
type AssistantMessagePartGroup<TPart extends AssistantMessagePartLike = AssistantMessagePartLike> = { readonly key: string; readonly type: string; readonly parts: readonly TPart[]; readonly standalone?: boolean;};keystringpartsreadonly TPart[]standalonebooleantypestring- Name
key- Kind
- property
- Type
string- Requirement
- required
- Name
parts- Kind
- property
- Type
readonly TPart[]- Requirement
- required
- Name
standalone- Kind
- property
- Type
boolean- Requirement
- optional
- Name
type- Kind
- property
- Type
string- Requirement
- required
type AssistantMessagePartLike = { readonly type: string; readonly [key: string]: unknown;};typestring- Name
type- Kind
- property
- Type
string- Requirement
- required
type AssistantMessagePartPart = (typeof assistantMessagePartAnatomy.parts)[number];type AssistantMessagePartValue = { readonly type: string; readonly status?: { readonly type: string; }; readonly [key: string]: unknown;};status{
readonly type: string;
}typestring- Name
status- Kind
- property
- Type
{ readonly type: string; }- Requirement
- optional
- Name
type- Kind
- property
- Type
string- Requirement
- required
connectAssistantMessage
functiondeclare function connectAssistantMessage(_client: unknown, scope: PartScope, options: AssistantMessageConnectOptions): AssistantMessageApi;_clientunknownscopePartScopeoptionsAssistantMessageConnectOptionsreturnAssistantMessageApi- Name
_client- Kind
- parameter
- Type
unknown- Requirement
- required
- Name
scope- Kind
- parameter
- Type
PartScope- Requirement
- required
- Name
options- Kind
- parameter
- Type
AssistantMessageConnectOptions- Requirement
- required
- Name
return- Kind
- return value
- Type
AssistantMessageApi- Requirement
- n/a
connectAssistantMessagePart
functiondeclare function connectAssistantMessagePart(scope: PartScope, options: AssistantMessagePartConnectOptions): AssistantMessagePartApi;scopePartScopeoptionsAssistantMessagePartConnectOptionsreturnAssistantMessagePartApi- Name
scope- Kind
- parameter
- Type
PartScope- Requirement
- required
- Name
options- Kind
- parameter
- Type
AssistantMessagePartConnectOptions- Requirement
- required
- Name
return- Kind
- return value
- Type
AssistantMessagePartApi- Requirement
- n/a
createLiveRegionAnnouncer
functiondeclare function createLiveRegionAnnouncer(options: LiveRegionAnnouncerOptions): LiveRegionAnnouncer;optionsLiveRegionAnnouncerOptionsreturnLiveRegionAnnouncer- Name
options- Kind
- parameter
- Type
LiveRegionAnnouncerOptions- Requirement
- required
- Name
return- Kind
- return value
- Type
LiveRegionAnnouncer- Requirement
- n/a
ExportableMessage
interfaceinterface ExportableMessage { readonly [key: string]: unknown; readonly role?: string; readonly content?: readonly ExportableMessagePart[];}contentreadonly ExportableMessagePart[]rolestring- Name
content- Kind
- property
- Type
readonly ExportableMessagePart[]- Requirement
- optional
- Name
role- Kind
- property
- Type
string- Requirement
- optional
ExportableMessagePart
interfaceinterface ExportableMessagePart { readonly id?: string; readonly type?: string; readonly sourceType?: string; readonly toolCallId?: string; readonly text?: string; readonly title?: string; readonly url?: string; readonly filename?: string; readonly image?: string; readonly data?: unknown; readonly name?: string; readonly toolName?: string; readonly args?: unknown; readonly result?: unknown; readonly isError?: boolean; readonly argsText?: string;}argsunknownargsTextstringdataunknownfilenamestringidstringimagestringisErrorbooleannamestringresultunknownsourceTypestringtextstringtitlestringtoolCallIdstringtoolNamestring- Name
args- Kind
- property
- Type
unknown- Requirement
- optional
- Name
argsText- Kind
- property
- Type
string- Requirement
- optional
- Name
data- Kind
- property
- Type
unknown- Requirement
- optional
- Name
filename- Kind
- property
- Type
string- Requirement
- optional
- Name
id- Kind
- property
- Type
string- Requirement
- optional
- Name
image- Kind
- property
- Type
string- Requirement
- optional
- Name
isError- Kind
- property
- Type
boolean- Requirement
- optional
- Name
name- Kind
- property
- Type
string- Requirement
- optional
- Name
result- Kind
- property
- Type
unknown- Requirement
- optional
- Name
sourceType- Kind
- property
- Type
string- Requirement
- optional
- Name
text- Kind
- property
- Type
string- Requirement
- optional
- Name
title- Kind
- property
- Type
string- Requirement
- optional
- Name
toolCallId- Kind
- property
- Type
string- Requirement
- optional
- Name
toolName- Kind
- property
- Type
string- Requirement
- optional
- Name
type- Kind
- property
- Type
string- Requirement
- optional
- Name
url- Kind
- property
- Type
string- Requirement
- optional
exportMessageMarkdown
functiondeclare function exportMessageMarkdown(message: ExportableMessage): string;messageExportableMessagereturnstring- Name
message- Kind
- parameter
- Type
ExportableMessage- Requirement
- required
- Name
return- Kind
- return value
- Type
string- Requirement
- n/a
formatFromMessages
functionAdapts a message table into a `format` function; unknown keys fall back to the key itself.
declare function formatFromMessages(messages: AnnouncerMessages): (key: string, params: { readonly [key: string]: string | number | null;}) => string;messagesAnnouncerMessagesreturn(key: string, params: {
readonly [key: string]: string | number | null;
}) => string- Name
messages- Kind
- parameter
- Type
AnnouncerMessages- Requirement
- required
- Name
return- Kind
- return value
- Type
(key: string, params: { readonly [key: string]: string | number | null; }) => string- Requirement
- n/a
groupMessageParts
functiondeclare function groupMessageParts<TPart extends AssistantMessagePartLike>(parts: readonly TPart[], options?: GroupMessagePartsOptions): readonly AssistantMessagePartGroup<TPart>[];partsreadonly TPart[]optionsGroupMessagePartsOptionsreturnreadonly AssistantMessagePartGroup<TPart>[]- Name
parts- Kind
- parameter
- Type
readonly TPart[]- Requirement
- required
- Name
options- Kind
- parameter
- Type
GroupMessagePartsOptions- Requirement
- optional
- Name
return- Kind
- return value
- Type
readonly AssistantMessagePartGroup<TPart>[]- Requirement
- n/a
GroupMessagePartsOptions
interfaceinterface GroupMessagePartsOptions { readonly groupBy?: (part: AssistantMessagePartLike) => string | null; readonly groupPartByType?: boolean;}groupBy(part: AssistantMessagePartLike) => string | nullgroupPartByTypeboolean- Name
groupBy- Kind
- property
- Type
(part: AssistantMessagePartLike) => string | null- Requirement
- optional
- Name
groupPartByType- Kind
- property
- Type
boolean- Requirement
- optional
LiveRegionAnnouncer
interfaceinterface LiveRegionAnnouncer { announce(key: string, params: { readonly [key: string]: string | number | null; }, politeness: Politeness): void; destroy(): void;}announce(key: string, params: { readonly [key: string]: string | number | null; }, politeness: Politeness) => voiddestroy() => void- Name
announce- Kind
- method
- Type
(key: string, params: { readonly [key: string]: string | number | null; }, politeness: Politeness) => void- Requirement
- required
- Name
destroy- Kind
- method
- Type
() => void- Requirement
- required
LiveRegionAnnouncerOptions
interfaceinterface LiveRegionAnnouncerOptions { readonly root: () => AnnouncerRoot | null; readonly format: (key: string, params: { readonly [key: string]: string | number | null; }) => string;}format(key: string, params: {
readonly [key: string]: string | number | null;
}) => stringroot() => AnnouncerRoot | null- Name
format- Kind
- property
- Type
(key: string, params: { readonly [key: string]: string | number | null; }) => string- Requirement
- required
- Name
root- Kind
- property
- Type
() => AnnouncerRoot | null- Requirement
- required
export declare const markdownDiagnosticMessages: Readonly<Record<MarkdownDiagnosticCode, string>>;McpAppFrameMessage
typetype McpAppFrameMessage = { readonly jsonrpc: "2.0"; readonly id?: string | number; readonly method?: string; readonly params?: unknown; readonly result?: unknown; readonly error?: { readonly code: number; readonly message: string; readonly data?: unknown; };};error{
readonly code: number;
readonly message: string;
readonly data?: unknown;
}idstring | numberjsonrpc"2.0"methodstringparamsunknownresultunknown- Name
error- Kind
- property
- Type
{ readonly code: number; readonly message: string; readonly data?: unknown; }- Requirement
- optional
- Name
id- Kind
- property
- Type
string | number- Requirement
- optional
- Name
jsonrpc- Kind
- property
- Type
"2.0"- Requirement
- required
- Name
method- Kind
- property
- Type
string- Requirement
- optional
- Name
params- Kind
- property
- Type
unknown- Requirement
- optional
- Name
result- Kind
- property
- Type
unknown- Requirement
- optional
MessageParams
typetype MessageParams = { readonly [key: string]: string | number | null;};MessageTable
typetype MessageTable = AnnouncerMessages;resolveMessage
functionResolve a component message key, allowing consumers to override one entry.
declare function resolveMessage(defaults: MessageTable, overrides: Partial<MessageTable> | undefined, key: string, params?: MessageParams): string;defaultsMessageTableoverridesPartial<MessageTable> | undefinedkeystringparamsMessageParamsreturnstring- Name
defaults- Kind
- parameter
- Type
MessageTable- Requirement
- required
- Name
overrides- Kind
- parameter
- Type
Partial<MessageTable> | undefined- Requirement
- required
- Name
key- Kind
- parameter
- Type
string- Requirement
- required
- Name
params- Kind
- parameter
- Type
MessageParams- Requirement
- optional
- Name
return- Kind
- return value
- Type
string- Requirement
- n/a
Parts and prop bags
AssistantComposerScopeLike
interfaceinterface AssistantComposerScopeLike { getState(): AssistantComposerStateLike; subscribe?(listener: () => void): () => void; setText?(text: string): unknown; send?(options?: { readonly steer?: boolean; }): unknown; cancel?(): unknown; setQuote?(quote?: unknown): unknown; removeAttachment?(id: string): unknown; endEdit?(): unknown;}cancel(() => unknown) | undefinedendEdit(() => unknown) | undefinedgetState() => AssistantComposerStateLikeremoveAttachment((id: string) => unknown) | undefinedsend((options?: { readonly steer?: boolean; }) => unknown) | undefinedsetQuote((quote?: unknown) => unknown) | undefinedsetText((text: string) => unknown) | undefinedsubscribe((listener: () => void) => () => void) | undefined- Name
cancel- Kind
- method
- Type
(() => unknown) | undefined- Requirement
- optional
- Name
endEdit- Kind
- method
- Type
(() => unknown) | undefined- Requirement
- optional
- Name
getState- Kind
- method
- Type
() => AssistantComposerStateLike- Requirement
- required
- Name
removeAttachment- Kind
- method
- Type
((id: string) => unknown) | undefined- Requirement
- optional
- Name
send- Kind
- method
- Type
((options?: { readonly steer?: boolean; }) => unknown) | undefined- Requirement
- optional
- Name
setQuote- Kind
- method
- Type
((quote?: unknown) => unknown) | undefined- Requirement
- optional
- Name
setText- Kind
- method
- Type
((text: string) => unknown) | undefined- Requirement
- optional
- Name
subscribe- Kind
- method
- Type
((listener: () => void) => () => void) | undefined- Requirement
- optional
AssistantComposerStateLike
interfaceinterface AssistantComposerStateLike { readonly value?: string; readonly text?: string; readonly mode?: "new" | "edit"; readonly isEmpty?: boolean; readonly isEditing?: boolean; readonly canSend?: boolean; readonly canCancel?: boolean; readonly isSendDisabled?: boolean; readonly quote?: unknown; readonly attachments?: readonly AssistantComposerAttachmentLike[]; readonly dictation?: { readonly transcript?: string; readonly isActive?: boolean; readonly inputDisabled?: boolean; }; readonly queue?: { readonly items?: readonly unknown[]; }; readonly context?: { readonly text?: string; readonly mode?: "new" | "edit"; readonly isSendDisabled?: boolean; readonly quote?: unknown; };}attachmentsreadonly AssistantComposerAttachmentLike[]canCancelbooleancanSendbooleancontext{
readonly text?: string;
readonly mode?: "new" | "edit";
readonly isSendDisabled?: boolean;
readonly quote?: unknown;
}dictation{
readonly transcript?: string;
readonly isActive?: boolean;
readonly inputDisabled?: boolean;
}isEditingbooleanisEmptybooleanisSendDisabledbooleanmode"new" | "edit"queue{
readonly items?: readonly unknown[];
}quoteunknowntextstringvaluestring- Name
attachments- Kind
- property
- Type
readonly AssistantComposerAttachmentLike[]- Requirement
- optional
- Name
canCancel- Kind
- property
- Type
boolean- Requirement
- optional
- Name
canSend- Kind
- property
- Type
boolean- Requirement
- optional
- Name
context- Kind
- property
- Type
{ readonly text?: string; readonly mode?: "new" | "edit"; readonly isSendDisabled?: boolean; readonly quote?: unknown; }- Requirement
- optional
- Name
dictation- Kind
- property
- Type
{ readonly transcript?: string; readonly isActive?: boolean; readonly inputDisabled?: boolean; }- Requirement
- optional
- Name
isEditing- Kind
- property
- Type
boolean- Requirement
- optional
- Name
isEmpty- Kind
- property
- Type
boolean- Requirement
- optional
- Name
isSendDisabled- Kind
- property
- Type
boolean- Requirement
- optional
- Name
mode- Kind
- property
- Type
"new" | "edit"- Requirement
- optional
- Name
queue- Kind
- property
- Type
{ readonly items?: readonly unknown[]; }- Requirement
- optional
- Name
quote- Kind
- property
- Type
unknown- Requirement
- optional
- Name
text- Kind
- property
- Type
string- Requirement
- optional
- Name
value- Kind
- property
- Type
string- Requirement
- optional
type AssistantMcpAddFormState = { readonly status: AssistantMcpAddFormStatus; readonly values: Readonly<Record<string, unknown>>; readonly error?: unknown;};errorunknownstatusAssistantMcpAddFormStatusvaluesReadonly<Record<string, unknown>>- Name
error- Kind
- property
- Type
unknown- Requirement
- optional
- Name
status- Kind
- property
- Type
AssistantMcpAddFormStatus- Requirement
- required
- Name
values- Kind
- property
- Type
Readonly<Record<string, unknown>>- Requirement
- required
type AssistantMcpConnectionState = "disconnected" | "connecting" | "connected" | "error";type AssistantMcpElicitationState = { readonly status: AssistantMcpElicitationStatus; readonly request: unknown; readonly response?: unknown;};requestunknownresponseunknownstatusAssistantMcpElicitationStatus- Name
request- Kind
- property
- Type
unknown- Requirement
- required
- Name
response- Kind
- property
- Type
unknown- Requirement
- optional
- Name
status- Kind
- property
- Type
AssistantMcpElicitationStatus- Requirement
- required
type AssistantMcpManagerState = { readonly servers: readonly AssistantMcpServerState[]; readonly isHydrated: boolean;};isHydratedbooleanserversreadonly AssistantMcpServerState[]- Name
isHydrated- Kind
- property
- Type
boolean- Requirement
- required
- Name
servers- Kind
- property
- Type
readonly AssistantMcpServerState[]- Requirement
- required
type AssistantMcpServerState = { readonly serverId: string; readonly name?: string; readonly connectionState: AssistantMcpConnectionState; readonly tools: readonly string[]; readonly error?: unknown;};connectionStateAssistantMcpConnectionStateerrorunknownnamestringserverIdstringtoolsreadonly string[]- Name
connectionState- Kind
- property
- Type
AssistantMcpConnectionState- Requirement
- required
- Name
error- Kind
- property
- Type
unknown- Requirement
- optional
- Name
name- Kind
- property
- Type
string- Requirement
- optional
- Name
serverId- Kind
- property
- Type
string- Requirement
- required
- Name
tools- Kind
- property
- Type
readonly string[]- Requirement
- required
ClassifiedPartProps
interfaceinterface ClassifiedPartProps { readonly attrs: PartProps; readonly events: Readonly<Record<string, unknown>>; readonly ref: unknown;}attrsPartPropseventsReadonly<Record<string, unknown>>refunknown- Name
attrs- Kind
- property
- Type
PartProps- Requirement
- required
- Name
events- Kind
- property
- Type
Readonly<Record<string, unknown>>- Requirement
- required
- Name
ref- Kind
- property
- Type
unknown- Requirement
- required
classifyPartProps
functionSplits framework-neutral connector props into attrs, events, and ref.
declare function classifyPartProps(props: PartProps): ClassifiedPartProps;propsPartPropsreturnClassifiedPartProps- Name
props- Kind
- parameter
- Type
PartProps- Requirement
- required
- Name
return- Kind
- return value
- Type
ClassifiedPartProps- Requirement
- n/a
ClipboardState
interfaceinterface ClipboardState { readonly copied: boolean; readonly text?: string;}copiedbooleantextstring- Name
copied- Kind
- property
- Type
boolean- Requirement
- required
- Name
text- Kind
- property
- Type
string- Requirement
- optional
createPartScope
functiondeclare function createPartScope(options: { seed: string; root?: () => Document | ShadowRoot | HTMLElement | null;}): PartScope;options{
seed: string;
root?: () => Document | ShadowRoot | HTMLElement | null;
}returnPartScope- Name
options- Kind
- parameter
- Type
{ seed: string; root?: () => Document | ShadowRoot | HTMLElement | null; }- Requirement
- required
- Name
return- Kind
- return value
- Type
PartScope- Requirement
- n/a
createScopeSeed
functiondeclare function createScopeSeed(counterRef?: { current: number;}): string;counterRef{
current: number;
}returnstring- Name
counterRef- Kind
- parameter
- Type
{ current: number; }- Requirement
- optional
- Name
return- Kind
- return value
- Type
string- Requirement
- n/a
dataState
functionShared boolean-to-data-state vocabulary used by headless connectors.
declare function dataState<TOpen extends string = "open", TClosed extends string = "closed">(value: boolean, open?: TOpen, closed?: TClosed): TOpen | TClosed;valuebooleanopenTOpenclosedTClosedreturnTOpen | TClosed- Name
value- Kind
- parameter
- Type
boolean- Requirement
- required
- Name
open- Kind
- parameter
- Type
TOpen- Requirement
- optional
- Name
closed- Kind
- parameter
- Type
TClosed- Requirement
- optional
- Name
return- Kind
- return value
- Type
TOpen | TClosed- Requirement
- n/a
DragControllerState
interfaceinterface DragControllerState { readonly phase: DragPhase; readonly dragging: boolean; readonly origin: { readonly x: number; readonly y: number; } | null; readonly point: { readonly x: number; readonly y: number; } | null;}draggingbooleanorigin{
readonly x: number;
readonly y: number;
} | nullphaseDragPhasepoint{
readonly x: number;
readonly y: number;
} | null- Name
dragging- Kind
- property
- Type
boolean- Requirement
- required
- Name
origin- Kind
- property
- Type
{ readonly x: number; readonly y: number; } | null- Requirement
- required
- Name
phase- Kind
- property
- Type
DragPhase- Requirement
- required
- Name
point- Kind
- property
- Type
{ readonly x: number; readonly y: number; } | null- Requirement
- required
IncrementalState
interfaceinterface IncrementalState { readonly source: string; readonly blocks: readonly BlockNode[]; readonly openBlockStart: number;}blocksreadonly BlockNode[]openBlockStartnumbersourcestring- Name
blocks- Kind
- property
- Type
readonly BlockNode[]- Requirement
- required
- Name
openBlockStart- Kind
- property
- Type
number- Requirement
- required
- Name
source- Kind
- property
- Type
string- Requirement
- required
mergeProps
valueexport declare const mergeProps: MergeProps;internalPartPropsconsumerPartPropsoptions{
onProtectedOverride?: (key: string) => void;
}returnPartProps- Name
internal- Kind
- parameter
- Type
PartProps- Requirement
- required
- Name
consumer- Kind
- parameter
- Type
PartProps- Requirement
- required
- Name
options- Kind
- parameter
- Type
{ onProtectedOverride?: (key: string) => void; }- Requirement
- optional
- Name
return- Kind
- return value
- Type
PartProps- Requirement
- n/a
MergeProps
typeThe locked mergeProps rule (platform plan, verbatim): consumer handlers run first; `preventDefault()` suppresses the internal handler; refs are composed; class/style values are merged; machine-owned IDs and ARIA references cannot be silently overwritten. Signature: internal (machine-owned) props first, consumer overrides second. Returns one merged bag. `id`, `aria-*` relationship attributes (`aria-labelledby`, `aria-describedby`, `aria-controls`, `aria-activedescendant`) from the internal bag win over consumer values; a consumer attempt to override them is reported via the optional `onProtectedOverride` hook (development aid) and ignored.
type MergeProps = (internal: PartProps, consumer: PartProps, options?: { onProtectedOverride?: (key: string) => void;}) => PartProps;PartProps
interfaceFramework-neutral prop bag. Event handlers are `on`-prefixed functions; `ref` is a composition-ready callback; everything else is a plain attribute/property value.
interface PartProps { readonly [key: string]: unknown;}PartScope
interfaceCore platform contracts for `@grassroot/ui-headless-core` — frozen by the orchestrator before implementation (phase 3). Implementations must satisfy these shapes exactly; changing this file is a contract change and stops dependent work. The platform plan's explicit part scope. No global getElementById lookups.
interface PartScope { /** Stable, SSR-safe id for a part (optionally keyed, e.g. items). */ id(part: string, key?: string): string; /** Ref callback that registers/unregisters the part's element. */ register(part: string, key?: string): (node: Element | null) => void; /** Scoped lookup — never a document-wide query. */ get(part: string, key?: string): Element | null; /** * Subscribe to registration changes. The returned cleanup is idempotent; * registration callbacks invoke listeners only after the scoped registry * has actually changed. */ subscribe(listener: () => void): () => void; /** The root the scope is mounted under (document, shadow root or element). */ root(): Document | ShadowRoot | HTMLElement | null;}get(part: string, key?: string) => Element | nullid(part: string, key?: string) => stringregister(part: string, key?: string) => (node: Element | null) => voidroot() => Document | ShadowRoot | HTMLElement | nullsubscribe(listener: () => void) => () => void- Name
get- Kind
- method
- Type
(part: string, key?: string) => Element | null- Requirement
- required
- Description
- Scoped lookup — never a document-wide query.
- Name
id- Kind
- method
- Type
(part: string, key?: string) => string- Requirement
- required
- Description
- Stable, SSR-safe id for a part (optionally keyed, e.g. items).
- Name
register- Kind
- method
- Type
(part: string, key?: string) => (node: Element | null) => void- Requirement
- required
- Description
- Ref callback that registers/unregisters the part's element.
- Name
root- Kind
- method
- Type
() => Document | ShadowRoot | HTMLElement | null- Requirement
- required
- Description
- The root the scope is mounted under (document, shadow root or element).
- Name
subscribe- Kind
- method
- Type
(listener: () => void) => () => void- Requirement
- required
- Description
- Subscribe to registration changes. The returned cleanup is idempotent; registration callbacks invoke listeners only after the scoped registry has actually changed.
SelectionObserverState
interfaceinterface SelectionObserverState { readonly visible: boolean; readonly selection: SelectionObserverSelection | null;}selectionSelectionObserverSelection | nullvisibleboolean- Name
selection- Kind
- property
- Type
SelectionObserverSelection | null- Requirement
- required
- Name
visible- Kind
- property
- Type
boolean- Requirement
- required
ThreadViewportState
typetype ThreadViewportState = { readonly following: boolean; readonly atBottom: boolean; readonly suspended: boolean;};atBottombooleanfollowingbooleansuspendedboolean- Name
atBottom- Kind
- property
- Type
boolean- Requirement
- required
- Name
following- Kind
- property
- Type
boolean- Requirement
- required
- Name
suspended- Kind
- property
- Type
boolean- Requirement
- required
TriggerPopoverState
interfaceinterface TriggerPopoverState { readonly open: boolean; readonly query: string; readonly category: string | undefined; readonly items: readonly TriggerPopoverItem[]; readonly activeIndex: number;}activeIndexnumbercategorystring | undefineditemsreadonly TriggerPopoverItem[]openbooleanquerystring- Name
activeIndex- Kind
- property
- Type
number- Requirement
- required
- Name
category- Kind
- property
- Type
string | undefined- Requirement
- required
- Name
items- Kind
- property
- Type
readonly TriggerPopoverItem[]- Requirement
- required
- Name
open- Kind
- property
- Type
boolean- Requirement
- required
- Name
query- Kind
- property
- Type
string- Requirement
- required
Command runners
CommandRunner
typeResolves UI command intents through a mounted part scope. Unresolvable commands (unmounted part, SSR) are silent no-ops — machines never learn about the DOM. Announcements are delegated to the provided announcer.
type CommandRunner = (command: UiCommand, scope: PartScope, options?: { announce?: (key: string, params: { readonly [key: string]: string | number | null; }, politeness: "polite" | "assertive") => void;}) => void;createGridRemoteRunCommand
functionThe one shared promise boundary for every Grid mount.
declare function createGridRemoteRunCommand<T>(options: GridRemoteRunCommandOptions<T>): RunCommand<GridCommand, GridEvent>;optionsGridRemoteRunCommandOptions<T>returnRunCommand<GridCommand, GridEvent>- Name
options- Kind
- parameter
- Type
GridRemoteRunCommandOptions<T>- Requirement
- required
- Name
return- Kind
- return value
- Type
RunCommand<GridCommand, GridEvent>- Requirement
- n/a
type GridRemoteRunCommandOptions<T> = { readonly dataSource: GridDataSource<T>; readonly sidecar: GridRemoteRows<T>; readonly scheduler?: Scheduler; readonly next?: RunCommand<GridCommand, GridEvent>; readonly onDiagnostic?: (diagnostic: DiagnosticObject) => void;};dataSourceGridDataSource<T>nextRunCommand<GridCommand, GridEvent>onDiagnostic(diagnostic: DiagnosticObject) => voidschedulerSchedulersidecarGridRemoteRows<T>- Name
dataSource- Kind
- property
- Type
GridDataSource<T>- Requirement
- required
- Name
next- Kind
- property
- Type
RunCommand<GridCommand, GridEvent>- Requirement
- optional
- Name
onDiagnostic- Kind
- property
- Type
(diagnostic: DiagnosticObject) => void- Requirement
- optional
- Name
scheduler- Kind
- property
- Type
Scheduler- Requirement
- optional
- Name
sidecar- Kind
- property
- Type
GridRemoteRows<T>- Requirement
- required
runAssistantModalCommand
functiondeclare function runAssistantModalCommand(command: PopoverCommand, options?: { readonly onOpenChange?: (detail: { open: boolean; reason: PopoverChangeReason; }) => void;}): void;commandPopoverCommandoptions{
readonly onOpenChange?: (detail: {
open: boolean;
reason: PopoverChangeReason;
}) => void;
}returnvoid- Name
command- Kind
- parameter
- Type
PopoverCommand- Requirement
- required
- Name
options- Kind
- parameter
- Type
{ readonly onOpenChange?: (detail: { open: boolean; reason: PopoverChangeReason; }) => void; }- Requirement
- optional
- Name
return- Kind
- return value
- Type
void- Requirement
- n/a
runGridCommand
functiondeclare function runGridCommand<T>(command: GridCommand, options: GridConnectOptions<T>, _service: GridService<T>): void;commandGridCommandoptionsGridConnectOptions<T>_serviceGridService<T>returnvoid- Name
command- Kind
- parameter
- Type
GridCommand- Requirement
- required
- Name
options- Kind
- parameter
- Type
GridConnectOptions<T>- Requirement
- required
- Name
_service- Kind
- parameter
- Type
GridService<T>- Requirement
- required
- Name
return- Kind
- return value
- Type
void- Requirement
- n/a
runUiCommand
valueexport declare const runUiCommand: CommandRunner;commandUiCommandscopePartScopeoptions{
announce?: (key: string, params: {
readonly [key: string]: string | number | null;
}, politeness: "polite" | "assertive") => void;
}returnvoid- Name
command- Kind
- parameter
- Type
UiCommand- Requirement
- required
- Name
scope- Kind
- parameter
- Type
PartScope- Requirement
- required
- Name
options- Kind
- parameter
- Type
{ announce?: (key: string, params: { readonly [key: string]: string | number | null; }, politeness: "polite" | "assertive") => void; }- Requirement
- optional
- Name
return- Kind
- return value
- Type
void- Requirement
- n/a
UiCommand
typeUI command intents resolved by the headless command runner (Select set).
type UiCommand = { readonly type: "FOCUS_PART"; readonly part: string;} | { readonly type: "FOCUS_ITEM"; readonly key: string;} | { readonly type: "SCROLL_ITEM_INTO_VIEW"; readonly key: string;} | { readonly type: "ANNOUNCE"; readonly key: string; readonly params: { readonly [key: string]: string | number | null; }; readonly politeness: "polite" | "assertive";};Keyboard and focus
FocusTrapHandle
interfaceinterface FocusTrapHandle { /** Idempotent. Removes the container's keydown listener and the * document's focusin reclaim listener, and restores focus per the * `returnFocus` rule. */ release(): void;}release() => void- Name
release- Kind
- method
- Type
() => void- Requirement
- required
- Description
- Idempotent. Removes the container's keydown listener and the document's focusin reclaim listener, and restores focus per the `returnFocus` rule.
FocusTrapOptions
interfaceinterface FocusTrapOptions { /** Element to focus on trap; default first tabbable, else the container * itself (given tabindex="-1" if it has none). */ readonly initialFocus?: () => HTMLElement | null; /** Element to restore on release; default the element focused at trap * time. Restored only if the candidate still has a callable `focus` * function (not merely `isConnected`). Returning `null` explicitly opts * OUT of restoration entirely; only an absent option (or a `undefined` * return) falls back to the previously-focused element. */ readonly returnFocus?: () => HTMLElement | null;}initialFocus() => HTMLElement | nullreturnFocus() => HTMLElement | null- Name
initialFocus- Kind
- property
- Type
() => HTMLElement | null- Requirement
- optional
- Description
- Element to focus on trap; default first tabbable, else the container itself (given tabindex="-1" if it has none).
- Name
returnFocus- Kind
- property
- Type
() => HTMLElement | null- Requirement
- optional
- Description
- Element to restore on release; default the element focused at trap time. Restored only if the candidate still has a callable `focus` function (not merely `isConnected`). Returning `null` explicitly opts OUT of restoration entirely; only an absent option (or a `undefined` return) falls back to the previously-focused element.
gridKeyboardEvent
functiondeclare function gridKeyboardEvent(event: GridKeyboardEventLike, position: GridKeyboardPosition, rowCount: number, columnCount: number): GridKeyboardResult | null;eventGridKeyboardEventLikepositionGridKeyboardPositionrowCountnumbercolumnCountnumberreturnGridKeyboardResult | null- Name
event- Kind
- parameter
- Type
GridKeyboardEventLike- Requirement
- required
- Name
position- Kind
- parameter
- Type
GridKeyboardPosition- Requirement
- required
- Name
rowCount- Kind
- parameter
- Type
number- Requirement
- required
- Name
columnCount- Kind
- parameter
- Type
number- Requirement
- required
- Name
return- Kind
- return value
- Type
GridKeyboardResult | null- Requirement
- n/a
type GridKeyboardEventLike = { readonly key?: string; readonly ctrlKey?: boolean; readonly metaKey?: boolean; readonly shiftKey?: boolean; preventDefault?: () => void;};ctrlKeybooleankeystringmetaKeybooleanpreventDefault() => voidshiftKeyboolean- Name
ctrlKey- Kind
- property
- Type
boolean- Requirement
- optional
- Name
key- Kind
- property
- Type
string- Requirement
- optional
- Name
metaKey- Kind
- property
- Type
boolean- Requirement
- optional
- Name
preventDefault- Kind
- property
- Type
() => void- Requirement
- optional
- Name
shiftKey- Kind
- property
- Type
boolean- Requirement
- optional
GridKeyboardPosition
typetype GridKeyboardPosition = { readonly rowIndex: number; readonly columnIndex: number;};columnIndexnumberrowIndexnumber- Name
columnIndex- Kind
- property
- Type
number- Requirement
- required
- Name
rowIndex- Kind
- property
- Type
number- Requirement
- required
GridKeyboardResult
typetype GridKeyboardResult = { readonly direction: GridFocusDirection; readonly extend?: boolean;};directionGridFocusDirectionextendboolean- Name
direction- Kind
- property
- Type
GridFocusDirection- Requirement
- required
- Name
extend- Kind
- property
- Type
boolean- Requirement
- optional
isFocusEscaped
functiondeclare function isFocusEscaped(container: MinimalContainerLike, active: unknown): boolean;containerMinimalContainerLikeactiveunknownreturnboolean- Name
container- Kind
- parameter
- Type
MinimalContainerLike- Requirement
- required
- Name
active- Kind
- parameter
- Type
unknown- Requirement
- required
- Name
return- Kind
- return value
- Type
boolean- Requirement
- n/a
isKeyboardEventLike
functiondeclare function isKeyboardEventLike(value: unknown): value is KeyboardEventLike;valueunknownreturnvalue is KeyboardEventLike- Name
value- Kind
- parameter
- Type
unknown- Requirement
- required
- Name
return- Kind
- return value
- Type
value is KeyboardEventLike- Requirement
- n/a
isPartEventKey
functiondeclare function isPartEventKey(key: string): boolean;keystringreturnboolean- Name
key- Kind
- parameter
- Type
string- Requirement
- required
- Name
return- Kind
- return value
- Type
boolean- Requirement
- n/a
isTypeaheadKey
functiondeclare function isTypeaheadKey(event: KeyboardEventLike): boolean;eventKeyboardEventLikereturnboolean- Name
event- Kind
- parameter
- Type
KeyboardEventLike- Requirement
- required
- Name
return- Kind
- return value
- Type
boolean- Requirement
- n/a
KeyboardEventLike
interfaceMinimal event surface shared by connector keyboard handlers.
interface KeyboardEventLike { readonly key: string; readonly ctrlKey?: boolean; readonly metaKey?: boolean; readonly altKey?: boolean; readonly shiftKey?: boolean; readonly isComposing?: boolean; readonly keyCode?: number; readonly defaultPrevented?: boolean; readonly target?: unknown; readonly currentTarget?: unknown; preventDefault(): void;}altKeybooleanctrlKeybooleancurrentTargetunknowndefaultPreventedbooleanisComposingbooleankeystringkeyCodenumbermetaKeybooleanpreventDefault() => voidshiftKeybooleantargetunknown- Name
altKey- Kind
- property
- Type
boolean- Requirement
- optional
- Name
ctrlKey- Kind
- property
- Type
boolean- Requirement
- optional
- Name
currentTarget- Kind
- property
- Type
unknown- Requirement
- optional
- Name
defaultPrevented- Kind
- property
- Type
boolean- Requirement
- optional
- Name
isComposing- Kind
- property
- Type
boolean- Requirement
- optional
- Name
key- Kind
- property
- Type
string- Requirement
- required
- Name
keyCode- Kind
- property
- Type
number- Requirement
- optional
- Name
metaKey- Kind
- property
- Type
boolean- Requirement
- optional
- Name
preventDefault- Kind
- method
- Type
() => void- Requirement
- required
- Name
shiftKey- Kind
- property
- Type
boolean- Requirement
- optional
- Name
target- Kind
- property
- Type
unknown- Requirement
- optional
KeydownAction
typetype KeydownAction = "next" | "previous" | "first" | "last" | "select" | "typeahead";KeydownTable
typetype KeydownTable = Readonly<Record<string, KeydownAction>>;PART_EVENT_KEY_RE
valueexport declare const PART_EVENT_KEY_RE: RegExp;resolveFocusReturnTarget
functionRestores focus only when the candidate still has a callable `focus` function — `isConnected` alone is insufficient (a candidate might be a plain stand-in with no live DOM presence at all).
declare function resolveFocusReturnTarget(candidate: unknown): MinimalTabbableLike | null;candidateunknownreturnMinimalTabbableLike | null- Name
candidate- Kind
- parameter
- Type
unknown- Requirement
- required
- Name
return- Kind
- return value
- Type
MinimalTabbableLike | null- Requirement
- n/a
resolveGridKeyboardTarget
functiondeclare function resolveGridKeyboardTarget(result: GridKeyboardResult, position: GridKeyboardPosition, rowCount: number, columnCount: number): GridKeyboardPosition;resultGridKeyboardResultpositionGridKeyboardPositionrowCountnumbercolumnCountnumberreturnGridKeyboardPosition- Name
result- Kind
- parameter
- Type
GridKeyboardResult- Requirement
- required
- Name
position- Kind
- parameter
- Type
GridKeyboardPosition- Requirement
- required
- Name
rowCount- Kind
- parameter
- Type
number- Requirement
- required
- Name
columnCount- Kind
- parameter
- Type
number- Requirement
- required
- Name
return- Kind
- return value
- Type
GridKeyboardPosition- Requirement
- n/a
resolveInitialFocusTarget
functiondeclare function resolveInitialFocusTarget(container: MinimalContainerLike): MinimalTabbableLike;containerMinimalContainerLikereturnMinimalTabbableLike- Name
container- Kind
- parameter
- Type
MinimalContainerLike- Requirement
- required
- Name
return- Kind
- return value
- Type
MinimalTabbableLike- Requirement
- n/a
resolveKeydownTable
functiondeclare function resolveKeydownTable(event: KeyboardEventLike, table: KeydownTable, allowTypeahead?: boolean): KeydownAction | null;eventKeyboardEventLiketableKeydownTableallowTypeaheadbooleanreturnKeydownAction | null- Name
event- Kind
- parameter
- Type
KeyboardEventLike- Requirement
- required
- Name
table- Kind
- parameter
- Type
KeydownTable- Requirement
- required
- Name
allowTypeahead- Kind
- parameter
- Type
boolean- Requirement
- optional
- Name
return- Kind
- return value
- Type
KeydownAction | null- Requirement
- n/a
resolveRovingKey
functiondeclare function resolveRovingKey(key: string, options: RovingKeyOptions): RovingIntent | null;keystringoptionsRovingKeyOptionsreturnRovingIntent | null- Name
key- Kind
- parameter
- Type
string- Requirement
- required
- Name
options- Kind
- parameter
- Type
RovingKeyOptions- Requirement
- required
- Name
return- Kind
- return value
- Type
RovingIntent | null- Requirement
- n/a
RovingIntent
typeRoving-focus manager (Tranche 1 capability gate, tabs.spec.md "Keyboard"). The manager is deliberately two existing pieces plus one pure resolver — not a stateful class: - this resolver maps a physical key to a LOGICAL focus intent, honoring orientation and RTL (the machine only ever sees logical direction); - the machine owns the focused position and emits `FOCUS_ITEM`; - the command runner resolves `FOCUS_ITEM` through the part scope. The unbound axis returns null (spec: vertical tablists do not handle Left/Right, horizontal ones do not handle Up/Down).
type RovingIntent = "next" | "previous" | "first" | "last";RovingKeyOptions
interfaceinterface RovingKeyOptions { readonly orientation: "horizontal" | "vertical"; readonly dir?: "ltr" | "rtl";}dir"ltr" | "rtl"orientation"horizontal" | "vertical"- Name
dir- Kind
- property
- Type
"ltr" | "rtl"- Requirement
- optional
- Name
orientation- Kind
- property
- Type
"horizontal" | "vertical"- Requirement
- required
trapFocus
functiondeclare function trapFocus(container: HTMLElement, options?: FocusTrapOptions): FocusTrapHandle;containerHTMLElementoptionsFocusTrapOptionsreturnFocusTrapHandle- Name
container- Kind
- parameter
- Type
HTMLElement- Requirement
- required
- Name
options- Kind
- parameter
- Type
FocusTrapOptions- Requirement
- optional
- Name
return- Kind
- return value
- Type
FocusTrapHandle- Requirement
- n/a