Skip to content

interaction

@fungi.computer/whistle


@fungi.computer/whistle / interaction

WhistleInteractionStatus = "working" | "prompting" | "failed" | "done" | "cancelled"

Where one interaction is in its life.


WhistlePendingPrompt = Readonly<{ sequence: number; request: WhistlePrompt; }>

The one pending question, with the sequence its answer must name.


WhistleMessageNotice = Extract<WhistleNotice, Readonly<{ type: "info" | "progress" | "success"; }>>

A notice that carries a message line.


WhistleHandoffNotice = Extract<WhistleNotice, Readonly<{ type: "handoff"; }>>

A “continue elsewhere” notice.


WhistleInteractionSnapshot = Readonly<{ title: string; status: WhistleInteractionStatus; message?: WhistleMessageNotice; handoff?: WhistleHandoffNotice; links: readonly WhistleNoticeLink[]; prompt?: WhistlePendingPrompt; failure?: string; }>

Everything a renderer needs to draw one interaction.


WhistleInteractionHost = Readonly<{ snapshot: () => WhistleInteractionSnapshot; subscribe: (listener) => () => void; begin: () => WhistleInteractionSession; answer: (sequence, value) => boolean; cancel: () => void; }>

A renderer-neutral store behind one interaction dialog or panel.

createWhistleInteractionHost(options): WhistleInteractionHost

Own one interaction’s state for any renderer. Prompts and notices are parsed here, at the boundary where command-supplied data becomes UI.

Readonly<{ title: string; onEnd?: (end) => void; }>

WhistleInteractionHost

Re-exports interactionTextLimit