wire
Type Aliases
Section titled “Type Aliases”ReadonlySchemaValue
Section titled “ReadonlySchemaValue”ReadonlySchemaValue<
T> > =Textends infer Item[] ? readonlyReadonlySchemaValue<Item>>[] :Textendsobject?{ readonly [Key in keyof T]: ReadonlySchemaValue<T[Key]> }:T
Preserve readonly domain collections while deriving contracts from schemas.
Type Parameters
Section titled “Type Parameters”T
WhistleJsonValue
Section titled “WhistleJsonValue”WhistleJsonValue =
ReadonlySchemaValue<z.output<typeofWhistleJsonValueSchema>>>>
JSON values accepted at Whistle transport boundaries.
WhistleJsonObject
Section titled “WhistleJsonObject”WhistleJsonObject =
ReadonlySchemaValue<z.output<typeofWhistleJsonObjectSchema>>>>
A JSON object accepted at Whistle transport boundaries.
WhistleFailure
Section titled “WhistleFailure”WhistleFailure =
ReadonlySchemaValue<z.output<typeofWhistleFailureSchema>>>>
Portable failure data that crosses Whistle transports.
WhistleActionSchema
Section titled “WhistleActionSchema”WhistleActionSchema =
ReadonlySchemaValue<z.output<typeofWhistleActionSchemaSchema>>>>
JSON Schema document used as an action input or output contract.
WhistleAvailability
Section titled “WhistleAvailability”WhistleAvailability =
ReadonlySchemaValue<z.output<typeofWhistleAvailabilitySchema>>>>
Host-owned availability fact carried in agent snapshots.
WhistleActionPresentation
Section titled “WhistleActionPresentation”WhistleActionPresentation =
ReadonlySchemaValue<z.output<typeofWhistleActionPresentationSchema>>>>
Renderer-neutral presentation data attached to an action.
WhistleAction
Section titled “WhistleAction”WhistleAction =
ReadonlySchemaValue<z.output<typeofWhistleActionDataSchema>>>>
Serializable action data accepted by Whistle.
WhistleSlashArguments
Section titled “WhistleSlashArguments”WhistleSlashArguments =
ReadonlySchemaValue<z.output<typeofWhistleSlashArgumentsSchema>>>>
Slash command parsing metadata accepted from transport owners.
WhistleSlashWord
Section titled “WhistleSlashWord”WhistleSlashWord =
ReadonlySchemaValue<NonNullable<z.output<typeofWhistleSlashArgumentsSchema>>["words"]>[number]>
A fixed word and its action arguments within a slash command.
WhistleCommandProjections
Section titled “WhistleCommandProjections”WhistleCommandProjections =
ReadonlySchemaValue<z.output<typeofWhistleCommandProjectionsSchema>>>>
Projection membership selected by a semantic command owner.
WhistleCommandDefinition
Section titled “WhistleCommandDefinition”WhistleCommandDefinition =
ReadonlySchemaValue<z.output<typeofWhistleCommandDefinitionSchema>>>>
Data-only command definition accepted at adapter boundaries.
WhistleAgentProjectionData
Section titled “WhistleAgentProjectionData”WhistleAgentProjectionData =
z.output<typeofWhistleAgentProjectionSchema>>
Decoded agent projection data as received across the wire.
WhistlePrompt
Section titled “WhistlePrompt”WhistlePrompt =
ReadonlySchemaValue<z.output<typeofWhistlePromptSchema>>>>
A renderer-neutral interaction prompt.
WhistlePromptOption
Section titled “WhistlePromptOption”WhistlePromptOption =
NonNullable<Extract<WhistlePrompt, {type:"choice"; }>["options"][number]>
One selectable value in a parsed interaction prompt.
WhistleNotice
Section titled “WhistleNotice”WhistleNotice =
ReadonlySchemaValue<z.output<typeofWhistleNoticeSchema>>>>
A renderer-neutral interaction notice.
WhistleNoticeLink
Section titled “WhistleNoticeLink”WhistleNoticeLink =
ReadonlySchemaValue<NonNullable<Extract<z.output<typeofWhistleNoticeSchema>>, {type:"info"; }>["links"]>[number]>
One link included in a parsed informational notice.
WhistlePromptAnswers
Section titled “WhistlePromptAnswers”WhistlePromptAnswers =
object
Answer types owned by the closed prompt vocabulary.
Properties
Section titled “Properties”confirmation
Section titled “confirmation”confirmation:
boolean
text:
string
choice
Section titled “choice”choice:
string
WhistlePromptOf
Section titled “WhistlePromptOf”WhistlePromptOf<
Kind> > ={ [K in Kind]: Extract<WhistlePrompt, { type: K }> & { type: K } }[Kind]
A prompt and its discriminator remain correlated through generic dispatch.
Type Parameters
Section titled “Type Parameters”Kind extends WhistlePrompt["type"]
Variables
Section titled “Variables”WhistleAvailabilitySchema
Section titled “WhistleAvailabilitySchema”
constWhistleAvailabilitySchema:ZodDiscriminatedUnion<[ZodObject<{status:ZodLiteral<"available">>; },$strict>>,ZodObject<{status:ZodLiteral<"unavailable">>;reason:ZodString; },$strict>>],"status">>
Host-owned availability carried by every discovered agent row.
WhistleJsonValueSchema
Section titled “WhistleJsonValueSchema”
constWhistleJsonValueSchema:ZodJSONSchema=json
The JSON value grammar shared by Whistle transports and App adapters.
WhistleJsonObjectSchema
Section titled “WhistleJsonObjectSchema”
constWhistleJsonObjectSchema:ZodRecord<ZodString,ZodJSONSchema>>
One JSON object, used for action schemas and custom presentation data.
parseJsonValue
Section titled “parseJsonValue”
constparseJsonValue: typeofWhistleJsonValueSchema.parse
Parse copied JSON data at an untrusted transport boundary.
parseJsonObject
Section titled “parseJsonObject”
constparseJsonObject: typeofWhistleJsonObjectSchema.parse
Parse a copied JSON object at an untrusted transport boundary.
WhistleFailureSchema
Section titled “WhistleFailureSchema”
constWhistleFailureSchema:ZodObject<{code:ZodString;message:ZodString;details:ZodOptional<ZodJSONSchema>>; },$strict>>
General portable failure data for adapters that cross a transport.
parseFailure
Section titled “parseFailure”
constparseFailure: typeofWhistleFailureSchema.parse
Parse failure data without carrying an Error or stack across the wire.
WhistleActionSchemaSchema
Section titled “WhistleActionSchemaSchema”
constWhistleActionSchemaSchema:ZodRecord<ZodString,ZodJSONSchema> > =WhistleJsonObjectSchema
The JSON object shape used by Whistle action schemas.
WhistleActionPresentationSchema
Section titled “WhistleActionPresentationSchema”
constWhistleActionPresentationSchema:ZodUnion<readonly [ZodObject<{type:ZodLiteral<"action">>; },$strict>>,ZodObject<{type:ZodLiteral<"custom">>;data:ZodRecord<ZodString,ZodJSONSchema>>; },$strict>>,ZodObject<{type:ZodLiteral<"choice">>;options:ZodArray<ZodObject<{value:ZodJSONSchema;label:ZodString;description:ZodOptional<ZodString>>; },$strip>>>>; },$strict>>,ZodObject<{type:ZodLiteral<"form">>;submitLabel:ZodOptional<ZodString>>; },$strict>>,ZodObject<{type:ZodLiteral<"confirmation">>;message:ZodString;confirmLabel:ZodOptional<ZodString>>;cancelLabel:ZodOptional<ZodString>>; },$strict>>]>
Validate renderer-neutral presentation data attached to an action.
WhistleActionDataSchema
Section titled “WhistleActionDataSchema”
constWhistleActionDataSchema:ZodObject<{inputSchema:ZodOptional<ZodRecord<ZodString,ZodJSONSchema>>>>;outputSchema:ZodOptional<ZodRecord<ZodString,ZodJSONSchema>>>>;presentation:ZodOptional<ZodUnion<readonly [ZodObject<{type:ZodLiteral<"action">>; },$strict>>,ZodObject<{type:ZodLiteral<"custom">>;data:ZodRecord<ZodString,ZodJSONSchema>>; },$strict>>,ZodObject<{type:ZodLiteral<"choice">>;options:ZodArray<ZodObject<{value:ZodJSONSchema;label:ZodString;description:ZodOptional<…>; },$strip>>>>; },$strict>>,ZodObject<{type:ZodLiteral<"form">>;submitLabel:ZodOptional<ZodString>>; },$strict>>,ZodObject<{type:ZodLiteral<"confirmation">>;message:ZodString;confirmLabel:ZodOptional<ZodString>>;cancelLabel:ZodOptional<ZodString>>; },$strict>>]>>; },$strict>>
Validate the serializable action contract carried by a command.
WhistleSlashArgumentsSchema
Section titled “WhistleSlashArgumentsSchema”
constWhistleSlashArgumentsSchema:ZodObject<{hint:ZodPipe<ZodString,ZodString>>;words:ZodOptional<ZodArray<ZodObject<{word:ZodString;description:ZodOptional<ZodPipe<ZodString,ZodString>>>>;arguments:ZodRecord<ZodString,ZodJSONSchema>>; },$strict>>>>>>;text:ZodOptional<ZodObject<{field:ZodPipe<ZodString,ZodString>>;arguments:ZodRecord<ZodString,ZodJSONSchema>>;requestIdField:ZodOptional<ZodPipe<ZodString,ZodString>>>>; },$strict>>>>; },$strict>>
Validate aliases and argument mapping metadata for slash commands.
WhistleCommandProjectionsSchema
Section titled “WhistleCommandProjectionsSchema”
constWhistleCommandProjectionsSchema:ZodObject<{bindings:ZodOptional<ZodObject<{order:ZodOptional<ZodNumber>>;values:ZodArray<ZodString>>; },$strict>>>>;agent:ZodOptional<ZodObject<{keybind:ZodOptional<ZodString>>;order:ZodOptional<ZodNumber>>; },$strict>>>>;help:ZodOptional<ZodObject<{order:ZodOptional<ZodNumber>>; },$strict>>>>;menu:ZodOptional<ZodObject<{order:ZodOptional<ZodNumber>>; },$strict>>>>;palette:ZodOptional<ZodObject<{order:ZodOptional<ZodNumber>>; },$strict>>>>;slash:ZodOptional<ZodObject<{aliases:ZodArray<ZodString>>;order:ZodOptional<ZodNumber>>;arguments:ZodOptional<ZodObject<{hint:ZodPipe<ZodString,ZodString>>;words:ZodOptional<ZodArray<ZodObject<…, …>>>;text:ZodOptional<ZodObject<{field: …;arguments: …;requestIdField: …; },$strict>>>>; },$strict>>>>; },$strict>>>>; },$strict>>
Validate explicit membership and ordering across Whistle surfaces.
WhistleCommandDefinitionSchema
Section titled “WhistleCommandDefinitionSchema”
constWhistleCommandDefinitionSchema:ZodObject<{id:ZodString;title:ZodString;category:ZodString;description:ZodOptional<ZodString>>;projections:ZodOptional<ZodObject<{bindings:ZodOptional<ZodObject<{order:ZodOptional<ZodNumber>>;values:ZodArray<ZodString>>; },$strict>>>>;agent:ZodOptional<ZodObject<{keybind:ZodOptional<ZodString>>;order:ZodOptional<ZodNumber>>; },$strict>>>>;help:ZodOptional<ZodObject<{order:ZodOptional<ZodNumber>>; },$strict>>>>;menu:ZodOptional<ZodObject<{order:ZodOptional<ZodNumber>>; },$strict>>>>;palette:ZodOptional<ZodObject<{order:ZodOptional<ZodNumber>>; },$strict>>>>;slash:ZodOptional<ZodObject<{aliases:ZodArray<ZodString>>;order:ZodOptional<ZodNumber>>;arguments:ZodOptional<ZodObject<{hint: …;words: …;text: …; },$strict>>>>; },$strict>>>>; },$strict>>>>;action:ZodOptional<ZodObject<{inputSchema:ZodOptional<ZodRecord<ZodString,ZodJSONSchema>>>>;outputSchema:ZodOptional<ZodRecord<ZodString,ZodJSONSchema>>>>;presentation:ZodOptional<ZodUnion<readonly [ZodObject<{type:ZodLiteral<…>; },$strict>>,ZodObject<{type:ZodLiteral<…>;data:ZodRecord<…, …>; },$strict>>,ZodObject<{type:ZodLiteral<…>;options:ZodArray<…>; },$strict>>,ZodObject<{type:ZodLiteral<…>;submitLabel:ZodOptional<…>; },$strict>>,ZodObject<{type:ZodLiteral<…>;message:ZodString;confirmLabel:ZodOptional<…>;cancelLabel:ZodOptional<…>; },$strict>>]>>; },$strict>>>>;availability:ZodOptional<ZodDiscriminatedUnion<[ZodObject<{status:ZodLiteral<"available">>; },$strict>>,ZodObject<{status:ZodLiteral<"unavailable">>;reason:ZodString; },$strict>>],"status">>>>; },$strict>>
Validate data-only command definitions supplied by an adapter.
parseAction
Section titled “parseAction”
constparseAction: typeofWhistleActionDataSchema.parse
Parse action metadata once before an adapter constructs a Whistle command.
parseProjections
Section titled “parseProjections”
constparseProjections: typeofWhistleCommandProjectionsSchema.parse
Parse the Whistle-owned projection metadata supplied by an App.
parseAvailability
Section titled “parseAvailability”
constparseAvailability: typeofavailabilitySchema.parse
Parse an availability fact while preserving its reason.
parseCommandDefinition
Section titled “parseCommandDefinition”
constparseCommandDefinition: typeofWhistleCommandDefinitionSchema.parse
Parse one data-only command definition before an adapter creates a command.
WhistleAgentProjectionSchema
Section titled “WhistleAgentProjectionSchema”
constWhistleAgentProjectionSchema:ZodObject<{commandId:ZodString;sourceId:ZodString;title:ZodString;category:ZodString;description:ZodOptional<ZodString>>;order:ZodNumber;availability:ZodDiscriminatedUnion<[ZodObject<{status:ZodLiteral<"available">>; },$strict>>,ZodObject<{status:ZodLiteral<"unavailable">>;reason:ZodString; },$strict>>],"status">>;action:ZodOptional<ZodObject<{inputSchema:ZodOptional<ZodRecord<ZodString,ZodJSONSchema>>>>;outputSchema:ZodOptional<ZodRecord<ZodString,ZodJSONSchema>>>>; },$strict>>>>;keybind:ZodOptional<ZodString>>; },$strict>>
One neutral agent row emitted by Whistle’s snapshot.agent projection.
WhistleAgentProjectionsSchema
Section titled “WhistleAgentProjectionsSchema”
constWhistleAgentProjectionsSchema:ZodArray<ZodObject<{commandId:ZodString;sourceId:ZodString;title:ZodString;category:ZodString;description:ZodOptional<ZodString>>;order:ZodNumber;availability:ZodDiscriminatedUnion<[ZodObject<{status:ZodLiteral<"available">>; },$strict>>,ZodObject<{status:ZodLiteral<"unavailable">>;reason:ZodString; },$strict>>],"status">>;action:ZodOptional<ZodObject<{inputSchema:ZodOptional<ZodRecord<ZodString,ZodJSONSchema>>>>;outputSchema:ZodOptional<ZodRecord<ZodString,ZodJSONSchema>>>>; },$strict>>>>;keybind:ZodOptional<ZodString>>; },$strict>>>>
A neutral Whistle agent projection collection.
constparse: typeofWhistleAgentProjectionsSchema.parse
Decode an untrusted agent projection collection at the wire boundary.
interactionTextLimit
Section titled “interactionTextLimit”
constinteractionTextLimit:8192=8192
Longest prompt answer or message an interaction carries.
WhistlePromptSchema
Section titled “WhistlePromptSchema”
constWhistlePromptSchema:ZodDiscriminatedUnion<[ZodObject<{type:ZodLiteral<"choice">>;message:ZodPipe<ZodString,ZodString>>;collapsedGroup:ZodOptional<ZodPipe<ZodString,ZodString>>>>;options:ZodArray<ZodObject<{value:ZodPipe<ZodString,ZodString>>;label:ZodPipe<ZodString,ZodString>>;description:ZodOptional<ZodPipe<ZodString,ZodString>>>>;group:ZodOptional<ZodPipe<ZodString,ZodString>>>>; },$strict>>>>; },$strict>>,ZodObject<{type:ZodLiteral<"text">>;message:ZodPipe<ZodString,ZodString>>;placeholder:ZodOptional<ZodPipe<ZodString,ZodString>>>>;secret:ZodOptional<ZodBoolean>>; },$strict>>,ZodObject<{type:ZodLiteral<"confirmation">>;message:ZodPipe<ZodString,ZodString>>;confirmLabel:ZodOptional<ZodPipe<ZodString,ZodString>>>>;cancelLabel:ZodOptional<ZodPipe<ZodString,ZodString>>>>; },$strict>>],"type">>
Validate renderer-neutral interaction prompts received from a host.
WhistleNoticeSchema
Section titled “WhistleNoticeSchema”
constWhistleNoticeSchema:ZodDiscriminatedUnion<[ZodObject<{type:ZodLiteral<"info">>;message:ZodPipe<ZodString,ZodString>>;links:ZodOptional<ZodArray<ZodObject<{url:ZodURL;label:ZodOptional<ZodPipe<ZodString,ZodString>>>>; },$strict>>>>>>; },$strict>>,ZodObject<{type:ZodLiteral<"progress">>;message:ZodPipe<ZodString,ZodString>>; },$strict>>,ZodObject<{type:ZodLiteral<"handoff">>;url:ZodURL;code:ZodOptional<ZodPipe<ZodString,ZodString>>>>;message:ZodOptional<ZodPipe<ZodString,ZodString>>>>; },$strict>>,ZodObject<{type:ZodLiteral<"success">>;message:ZodPipe<ZodString,ZodString>>; },$strict>>],"type">>
Validate interaction notices received from a host.
parsePrompt
Section titled “parsePrompt”
constparsePrompt: typeofWhistlePromptSchema.parse
Parse one interaction prompt at the boundary where a client renders it.
parseNotice
Section titled “parseNotice”
constparseNotice: typeofWhistleNoticeSchema.parse
Parse one interaction notice at the boundary where a client renders it.
Functions
Section titled “Functions”createPromptAnswerParser()
Section titled “createPromptAnswerParser()”createPromptAnswerParser<
Kind>>(prompt): (value) =>WhistlePromptAnswers[Kind]
Capture a prompt’s parsed answer contract before handing it to a renderer.
Type Parameters
Section titled “Type Parameters”Kind extends "text" | "choice" | "confirmation"
Parameters
Section titled “Parameters”prompt
Section titled “prompt”WhistlePromptOf<Kind>
Returns
Section titled “Returns”(value) => WhistlePromptAnswers[Kind]
parsePromptAnswer()
Section titled “parsePromptAnswer()”parsePromptAnswer<
Kind>>(prompt,value):WhistlePromptAnswers[Kind]
Parse the answer a human gave to one prompt before the command sees it.
Type Parameters
Section titled “Type Parameters”Kind extends "text" | "choice" | "confirmation"
Parameters
Section titled “Parameters”prompt
Section titled “prompt”WhistlePromptOf<Kind>
string | boolean
Returns
Section titled “Returns”WhistlePromptAnswers[Kind]
createPromptAnswerDecoder()
Section titled “createPromptAnswerDecoder()”createPromptAnswerDecoder<
Kind>>(prompt): (value) =>Readonly<{kind:"accepted";value:WhistlePromptAnswers[Kind]; }> |Readonly<{kind:"invalid";cause:ZodError; }>
Capture a typed answer decoder; invalid input stays an explicit outcome.
Type Parameters
Section titled “Type Parameters”Kind extends "text" | "choice" | "confirmation"
Parameters
Section titled “Parameters”prompt
Section titled “prompt”WhistlePromptOf<Kind>
Returns
Section titled “Returns”(value) => Readonly<{ kind: "accepted"; value:
WhistlePromptAnswers[Kind]; }> |
Readonly<{ kind: "invalid"; cause: ZodError; }>
decodePromptAnswer()
Section titled “decodePromptAnswer()”decodePromptAnswer<
Kind>>(prompt,value):Readonly<{kind:"invalid";cause:ZodError; }> |Readonly<{kind:"accepted";value:WhistlePromptAnswers[Kind]; }>
Decode a human answer without throwing so renderers can handle invalid input.
Type Parameters
Section titled “Type Parameters”Kind extends "text" | "choice" | "confirmation"
Parameters
Section titled “Parameters”prompt
Section titled “prompt”WhistlePromptOf<Kind>
string | boolean
Returns
Section titled “Returns”Readonly<{ kind: "invalid"; cause: ZodError; }> | Readonly<{
kind: "accepted"; value:
WhistlePromptAnswers[Kind]; }>