index
@fungi.computer/whistle / index
Classes
Section titled “Classes”WhistleActionError
Section titled “WhistleActionError”An owning handler’s explicit failure code and optional structured details.
Extends
Section titled “Extends”Error
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new WhistleActionError(
code,message,details?):WhistleActionError
Parameters
Section titled “Parameters”string
Stable failure identity supplied by the handler owner.
message
Section titled “message”string
details?
Section titled “details?”Optional JSON context safe to return to the caller.
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Error.constructor
Properties
Section titled “Properties”
readonlycode:string
Stable failure identity supplied by the handler owner.
details?
Section titled “details?”
readonlyoptionaldetails?:WhistleJsonValue
Optional JSON context safe to return to the caller.
WhistleClosedError
Section titled “WhistleClosedError”A valid contribution was attempted after the runtime closed.
Extends
Section titled “Extends”Error
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new WhistleClosedError():
WhistleClosedError
Construct the provisional error for a valid post-close contribution.
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Error.constructor
Type Aliases
Section titled “Type Aliases”WhistleCommandProjections
Section titled “WhistleCommandProjections”WhistleCommandProjections =
Readonly<{bindings?:Readonly<{order?:number;values: readonlystring[]; }>;agent?:Readonly<{keybind?:string;order?:number; }>;help?:Readonly<{order?:number; }>;menu?:Readonly<{order?:number; }>;palette?:Readonly<{order?:number; }>;slash?:Readonly<{aliases: readonlystring[];order?:number; }>; }>
The six explicit discoverability choices for one command.
WhistleExecutionOrigin
Section titled “WhistleExecutionOrigin”WhistleExecutionOrigin =
"agent"|"browser"|"keyboard"|"menu"|"palette"|"programmatic"|"slash"|"terminal"
The trusted host origin entering the single execution door.
WhistleJsonValue
Section titled “WhistleJsonValue”WhistleJsonValue =
null|boolean|number|string| readonlyWhistleJsonValue[] |WhistleJsonObject
JSON data used to describe an action at a client boundary.
WhistleJsonObject
Section titled “WhistleJsonObject”WhistleJsonObject =
object
JSON object node used by the recursive action schema document type.
Index Signature
Section titled “Index Signature”[key: string]: WhistleJsonValue
WhistleActionSchema
Section titled “WhistleActionSchema”WhistleActionSchema =
Readonly<WhistleJsonObject>>
JSON Schema document describing action arguments or results.
WhistleActionChoice
Section titled “WhistleActionChoice”WhistleActionChoice =
Readonly<{value:WhistleJsonValue;label:string;description?:string; }>
One choice a client may present for a declarative action.
WhistleActionPresentation
Section titled “WhistleActionPresentation”WhistleActionPresentation =
Readonly<{type:"action"; }> |Readonly<{type:"custom";data:WhistleJsonObject; }> |Readonly<{type:"choice";options: readonlyWhistleActionChoice[]; }> |Readonly<{type:"form";submitLabel?:string; }> |Readonly<{type:"confirmation";message:string;confirmLabel?:string;cancelLabel?:string; }>
Renderer-neutral presentation metadata for one action.
WhistleAction
Section titled “WhistleAction”WhistleAction =
Readonly<{inputSchema?:WhistleActionSchema;outputSchema?:WhistleActionSchema;presentation?:WhistleActionPresentation; }>
Data-only action description carried by a semantic command.
WhistlePromptOption
Section titled “WhistlePromptOption”WhistlePromptOption =
Readonly<{value:string;label:string;description?:string; }>
One option offered by a choice prompt.
WhistlePrompt
Section titled “WhistlePrompt”WhistlePrompt =
Readonly<{type:"choice";message:string;options: readonlyWhistlePromptOption[]; }> |Readonly<{type:"text";message:string;placeholder?:string;secret?:boolean; }> |Readonly<{type:"confirmation";message:string;confirmLabel?:string;cancelLabel?:string; }>
One renderer-neutral question an executing command asks its human caller. Hosts choose the widgets; the vocabulary only names the kind of answer.
WhistlePromptAnswer
Section titled “WhistlePromptAnswer”WhistlePromptAnswer<
Prompt> > =Prompt["type"] extends"confirmation"?boolean:string
The answer type for one prompt kind.
Type Parameters
Section titled “Type Parameters”Prompt
Section titled “Prompt”Prompt extends WhistlePrompt
WhistleNoticeLink
Section titled “WhistleNoticeLink”WhistleNoticeLink =
Readonly<{url:string;label?:string; }>
One labelled link inside a notice.
WhistleNotice
Section titled “WhistleNotice”WhistleNotice =
Readonly<{type:"info";message:string;links?: readonlyWhistleNoticeLink[]; }> |Readonly<{type:"progress";message:string; }> |Readonly<{type:"handoff";url:string;code?:string;message?:string; }> |Readonly<{type:"success";message:string; }>
One renderer-neutral status update from an executing command.
WhistleInteraction
Section titled “WhistleInteraction”WhistleInteraction =
Readonly<{signal:AbortSignal;prompt: <Prompt>>(prompt,options?) =>Promise<WhistlePromptAnswer<Prompt>>>>;notify: (notice) =>void; }>
A human conversation attached to one execution. prompt rejects when the human
cancels; signal aborts when the whole interaction is dismissed.
WhistleInteractionEnd
Section titled “WhistleInteractionEnd”WhistleInteractionEnd =
Readonly<{status:"handled"; }> |Readonly<{status:"cancelled"; }> |Readonly<{status:"failed";message:string; }>
How an execution with an attached interaction ended.
WhistleInteractionSession
Section titled “WhistleInteractionSession”WhistleInteractionSession =
Readonly<{interaction:WhistleInteraction;settle: (end) =>void; }>
One interaction a presenter opened for one execution.
WhistlePresenter
Section titled “WhistlePresenter”WhistlePresenter = (
request) =>WhistleInteractionSession
A mounted client that can render interactions. Whistle opens one session per human execution that has no caller-supplied interaction.
Parameters
Section titled “Parameters”request
Section titled “request”Readonly<{ commandId: string; title: string; retry: () => void;
}>
Returns
Section titled “Returns”WhistleExecutionInput
Section titled “WhistleExecutionInput”WhistleExecutionInput<
Arguments> > =Readonly<{origin:WhistleExecutionOrigin;arguments?:Arguments;signal?:AbortSignal;interaction?:WhistleInteraction; }>
The already-typed input supplied to a command handler.
Type Parameters
Section titled “Type Parameters”Arguments
Section titled “Arguments”Arguments = unknown
WhistleAvailability
Section titled “WhistleAvailability”WhistleAvailability =
Readonly<{status:"available"; }> |Readonly<{status:"unavailable";reason:string; }>
Host-owned semantic availability; domain admission still runs in the handler.
WhistleFailure
Section titled “WhistleFailure”WhistleFailure =
Readonly<{code:string;message:string;details?:WhistleJsonValue; }>
Portable failure data, without stack traces or executable error objects.
WhistleExecutionOutcome
Section titled “WhistleExecutionOutcome”WhistleExecutionOutcome<
Result> > =Extract<WhistleAvailability, {status:"unavailable"; }> |Readonly<{status:"handled";result?:Result; }> |Readonly<{status:"closed"; }> |Readonly<{status:"missing"; }> |Readonly<{status:"invalid"; }> |Readonly<{error:WhistleFailure;status:"failed"; }>
The normalized result of one command execution request.
Type Parameters
Section titled “Type Parameters”Result
Section titled “Result”Result = unknown
WhistleCommand
Section titled “WhistleCommand”WhistleCommand<
Arguments,Result> > =Readonly<{id:string;title:string;category:string;description?:string;projections?:WhistleCommandProjections;action?:WhistleAction;availability?: () =>WhistleAvailability;handler:WhistleCommandHandler<Arguments,Result>>; }>
One semantic command definition.
Type Parameters
Section titled “Type Parameters”Arguments
Section titled “Arguments”Arguments = unknown
Result
Section titled “Result”Result = unknown
WhistleCommandDefinition
Section titled “WhistleCommandDefinition”WhistleCommandDefinition =
Readonly<Pick<WhistleCommand,"action"|"category"|"description"|"id"|"projections"|"title"> > &object>>
Data-only command definition accepted by a transport adapter.
WhistleContribution
Section titled “WhistleContribution”WhistleContribution =
Readonly<{sourceId:string;namespace:string;commands: readonlyWhistleCommand<never>>[]; }>
One contribution of source-owned commands to a namespace.
WhistleProjectionRow
Section titled “WhistleProjectionRow”WhistleProjectionRow =
Readonly<{commandId:string;sourceId:string;title:string;category:string;description?:string;order:number;action?:WhistleAction;availability:WhistleAvailability; }>
Shared immutable metadata carried by each projection row.
WhistleBindingProjection
Section titled “WhistleBindingProjection”WhistleBindingProjection =
WhistleProjectionRow&Readonly<{binding:string; }>
One binding value projected from a command.
WhistlePaletteProjection
Section titled “WhistlePaletteProjection”WhistlePaletteProjection =
WhistleProjectionRow
One palette value projected from a command.
WhistleSlashProjection
Section titled “WhistleSlashProjection”WhistleSlashProjection =
WhistleProjectionRow&Readonly<{alias:string; }>
One slash alias projected from a command.
WhistleHelpProjection
Section titled “WhistleHelpProjection”WhistleHelpProjection =
WhistleProjectionRow
One help value projected from a command.
WhistleMenuProjection
Section titled “WhistleMenuProjection”WhistleMenuProjection =
WhistleProjectionRow
One menu value projected from a command.
WhistleAgentProjection
Section titled “WhistleAgentProjection”WhistleAgentProjection =
Omit<WhistleProjectionRow,"action"> > &Readonly<{action?:Pick<WhistleAction,"inputSchema"|"outputSchema">>;keybind?:string; }>
One agent value projected from a command.
WhistleSnapshot
Section titled “WhistleSnapshot”WhistleSnapshot =
Readonly<{bindings: readonlyWhistleBindingProjection[];palette: readonlyWhistlePaletteProjection[];slash: readonlyWhistleSlashProjection[];help: readonlyWhistleHelpProjection[];menu: readonlyWhistleMenuProjection[];agent: readonlyWhistleAgentProjection[]; }>
The six immutable views of one semantic command graph.
WhistleContributionLease
Section titled “WhistleContributionLease”WhistleContributionLease =
Readonly<{update: (commands) =>void;dispose: () =>void; }>
An idempotent lease for one contribution generation.
WhistleRuntime
Section titled “WhistleRuntime”WhistleRuntime =
Readonly<{contribute: (contribution) =>WhistleContributionLease;close: () =>undefined;execute: (commandId,input) =>Promise<WhistleExecutionOutcome>>;snapshot: () =>WhistleSnapshot;subscribe: (listener) => () =>void;present: (presenter) => () =>void; }>
The provisional Whistle semantic runtime seam.
WhistleKeymapAdapter
Section titled “WhistleKeymapAdapter”WhistleKeymapAdapter =
Readonly<{cleanup: () =>void; }>
Lifecycle operations for a projection into a maintained host keymap.
WhistleKeymapBinding
Section titled “WhistleKeymapBinding”WhistleKeymapBinding =
Readonly<{cmd:string;key:string; }>
One physical key string mapped to a Whistle command identifier.
WhistleKeymapCommand
Section titled “WhistleKeymapCommand”WhistleKeymapCommand =
Readonly<{name:string;run: () =>Promise<boolean>>; }>
Host callback that executes one semantic Whistle command.
WhistleKeymapLayer
Section titled “WhistleKeymapLayer”WhistleKeymapLayer =
Readonly<{bindings: readonlyWhistleKeymapBinding[];commands: readonlyWhistleKeymapCommand[]; }>
Binding and command records accepted by a maintained keymap host.
WhistleKeymapHost
Section titled “WhistleKeymapHost”WhistleKeymapHost =
Readonly<{registerLayer: (layer) => () =>void; }>
Minimal registration surface implemented by a maintained host keymap.
Functions
Section titled “Functions”createWhistle()
Section titled “createWhistle()”createWhistle():
WhistleRuntime
Construct the provisional semantic runtime shell.
Returns
Section titled “Returns”createWhistleKeymapAdapter()
Section titled “createWhistleKeymapAdapter()”createWhistleKeymapAdapter(
keymap,whistle,origin):WhistleKeymapAdapter
Project Whistle bindings into a host-created maintained OpenTUI keymap.
Parameters
Section titled “Parameters”keymap
Section titled “keymap”whistle
Section titled “whistle”Pick<WhistleRuntime, "snapshot" | "subscribe" |
"execute">