The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
/* eslint-disable */
// @generated by scripts/generate-chat-wire-types.mjs from
// vendor/tinychannels/crates/tinychannels-bus/schema/web-channel-event.schema.json.
// Do not edit by hand; run `pnpm chat-wire:generate`.
/**
* The tagged, strongly typed web event contract.
*
* Optional fields are omitted to preserve the deployed struct's wire shape.
* The `chat_error` variant intentionally remains able to represent the legacy
* `error_type: "cancelled"` payload during the compatibility window.
*/
export type WebChannelEvent =
| {
citations?: any;
client_id: string;
event: 'chat_done';
full_response?: string | null;
parts?: OutboundContentPart[] | null;
request_id: string;
seq?: number | null;
thread_id: string;
timing?: WebTurnTimingPayload | null;
ts?: number | null;
turn_request_id?: string | null;
usage?: WebTurnUsagePayload | null;
}
| {
client_id: string;
event: 'chat_interim';
full_response?: string | null;
request_id: string;
round?: number | null;
seq?: number | null;
thread_id: string;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
event: 'chat_suggestions';
request_id: string;
seq?: number | null;
suggestions: ChatSuggestion[];
thread_id: string;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
copy_key?: string | null;
copy_params?: any;
error_fallback_available?: boolean | null;
error_provider?: string | null;
error_retry_after_ms?: number | null;
error_retryable?: boolean | null;
error_source?: string | null;
error_type?: string | null;
event: 'chat_error';
guardrail?: WebGuardrailPayload | null;
message?: string | null;
request_id: string;
seq?: number | null;
thread_id: string;
ts?: number | null;
turn_request_id?: string | null;
}
| {
cancel_reason?: string | null;
client_id: string;
event: 'chat_cancelled';
request_id: string;
seq?: number | null;
superseded_by?: string | null;
thread_id: string;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
delta?: string | null;
delta_kind?: string | null;
event: 'text_delta';
request_id: string;
round?: number | null;
seq?: number | null;
thread_id: string;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
delta?: string | null;
delta_kind?: string | null;
event: 'thinking_delta';
request_id: string;
round?: number | null;
seq?: number | null;
thread_id: string;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
delta?: string | null;
delta_kind?: string | null;
event: 'tool_args_delta';
request_id: string;
round?: number | null;
seq?: number | null;
skill_id?: string | null;
thread_id: string;
tool_call_id?: string | null;
tool_name?: string | null;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
event: 'inference_start';
request_id: string;
seq?: number | null;
thread_id: string;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
event: 'inference_heartbeat';
request_id: string;
seq?: number | null;
thread_id: string;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
event: 'iteration_start';
message?: string | null;
request_id: string;
round?: number | null;
seq?: number | null;
thread_id: string;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
event: 'context_compacting';
request_id: string;
round?: number | null;
seq?: number | null;
thread_id: string;
ts?: number | null;
turn_request_id?: string | null;
}
| {
args?: any;
client_id: string;
event: 'tool_call';
request_id: string;
round?: number | null;
seq?: number | null;
skill_id?: string | null;
thread_id: string;
tool_call_id?: string | null;
tool_display_detail?: string | null;
tool_display_label?: string | null;
tool_name?: string | null;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
event: 'tool_progress';
message?: string | null;
request_id: string;
seq?: number | null;
thread_id: string;
tool_call_id?: string | null;
ts?: number | null;
turn_request_id?: string | null;
}
| {
args?: any;
client_id: string;
elapsed_ms?: number | null;
event: 'tool_result';
failure?: any;
output?: string | null;
request_id: string;
round?: number | null;
seq?: number | null;
skill_id?: string | null;
structured?: any;
success?: boolean | null;
thread_id: string;
tool_call_id?: string | null;
tool_display_detail?: string | null;
tool_display_label?: string | null;
tool_name?: string | null;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
event: 'turn_cost';
request_id: string;
round?: number | null;
seq?: number | null;
thread_id: string;
ts?: number | null;
turn_request_id?: string | null;
usage?: WebTurnUsagePayload | null;
}
| {
client_id: string;
event: 'subagent_spawned';
message?: string | null;
request_id: string;
round?: number | null;
seq?: number | null;
skill_id?: string | null;
subagent?: WebSubagentProgressDetail | null;
thread_id: string;
tool_name?: string | null;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
event: 'subagent_completed';
message?: string | null;
request_id: string;
round?: number | null;
seq?: number | null;
skill_id?: string | null;
subagent?: WebSubagentProgressDetail | null;
success?: boolean | null;
thread_id: string;
tool_name?: string | null;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
event: 'subagent_failed';
message?: string | null;
request_id: string;
round?: number | null;
seq?: number | null;
skill_id?: string | null;
subagent?: WebSubagentProgressDetail | null;
success?: boolean | null;
thread_id: string;
tool_name?: string | null;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
event: 'subagent_awaiting_user';
message?: string | null;
request_id: string;
round?: number | null;
seq?: number | null;
skill_id?: string | null;
subagent?: WebSubagentProgressDetail | null;
success?: boolean | null;
thread_id: string;
tool_name?: string | null;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
event: 'subagent_iteration_start';
message?: string | null;
request_id: string;
round?: number | null;
seq?: number | null;
skill_id?: string | null;
subagent?: WebSubagentProgressDetail | null;
thread_id: string;
tool_name?: string | null;
ts?: number | null;
turn_request_id?: string | null;
}
| {
args?: any;
client_id: string;
event: 'subagent_tool_call';
request_id: string;
round?: number | null;
seq?: number | null;
skill_id?: string | null;
subagent?: WebSubagentProgressDetail | null;
thread_id: string;
tool_call_id?: string | null;
tool_display_detail?: string | null;
tool_display_label?: string | null;
tool_name?: string | null;
ts?: number | null;
turn_request_id?: string | null;
}
| {
args?: any;
client_id: string;
elapsed_ms?: number | null;
event: 'subagent_tool_result';
failure?: any;
output?: string | null;
request_id: string;
round?: number | null;
seq?: number | null;
skill_id?: string | null;
structured?: any;
subagent?: WebSubagentProgressDetail | null;
success?: boolean | null;
thread_id: string;
tool_call_id?: string | null;
tool_display_detail?: string | null;
tool_display_label?: string | null;
tool_name?: string | null;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
delta?: string | null;
delta_kind?: string | null;
event: 'subagent_text_delta';
request_id: string;
round?: number | null;
seq?: number | null;
skill_id?: string | null;
subagent?: WebSubagentProgressDetail | null;
thread_id: string;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
delta?: string | null;
delta_kind?: string | null;
event: 'subagent_thinking_delta';
request_id: string;
round?: number | null;
seq?: number | null;
skill_id?: string | null;
subagent?: WebSubagentProgressDetail | null;
thread_id: string;
ts?: number | null;
turn_request_id?: string | null;
}
| {
args?: any;
client_id: string;
detached?: boolean | null;
event: 'approval_request';
expires_at?: string | null;
message?: string | null;
request_id: string;
seq?: number | null;
thread_id: string;
tool_call_id?: string | null;
tool_name?: string | null;
ts?: number | null;
turn_request_id?: string | null;
}
| {
cancel_reason?: string | null;
client_id: string;
event: 'approval_decided';
message?: string | null;
request_id: string;
seq?: number | null;
thread_id: string;
tool_call_id?: string | null;
tool_name?: string | null;
ts?: number | null;
turn_request_id?: string | null;
}
| {
args?: any;
client_id: string;
event: 'plan_review_request';
expires_at?: string | null;
message?: string | null;
request_id: string;
seq?: number | null;
thread_id: string;
tool_call_id?: string | null;
tool_name?: string | null;
ts?: number | null;
turn_request_id?: string | null;
}
| {
cancel_reason?: string | null;
client_id: string;
event: 'plan_review_decided';
message?: string | null;
request_id: string;
seq?: number | null;
thread_id: string;
tool_call_id?: string | null;
tool_name?: string | null;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
event: 'queue_item_queued';
queue_item?: WebQueueItemPayload | null;
request_id: string;
seq?: number | null;
thread_id: string;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
event: 'queue_item_delivered';
queue_item?: WebQueueItemPayload | null;
request_id: string;
seq?: number | null;
thread_id: string;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
event: 'queue_item_removed';
queue_item?: WebQueueItemPayload | null;
request_id: string;
seq?: number | null;
thread_id: string;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
event: 'thread_goal_updated';
goal?: any;
request_id: string;
seq?: number | null;
thread_id: string;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
event: 'thread_goal_cleared';
request_id: string;
seq?: number | null;
thread_id: string;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
event: 'thread_todos_changed';
request_id: string;
seq?: number | null;
thread_id: string;
todos?: any;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
event: 'run_mode_changed';
message?: string | null;
request_id: string;
seq?: number | null;
thread_id: string;
ts?: number | null;
turn_request_id?: string | null;
}
| {
args?: any;
client_id: string;
event: 'artifact_ready';
request_id: string;
seq?: number | null;
thread_id: string;
tool_call_id?: string | null;
ts?: number | null;
turn_request_id?: string | null;
}
| {
args?: any;
client_id: string;
event: 'artifact_failed';
request_id: string;
seq?: number | null;
thread_id: string;
tool_call_id?: string | null;
ts?: number | null;
turn_request_id?: string | null;
}
| {
args?: any;
client_id: string;
event: 'artifact_pending';
request_id: string;
seq?: number | null;
thread_id: string;
tool_call_id?: string | null;
ts?: number | null;
turn_request_id?: string | null;
}
| {
args?: any;
client_id: string;
event: 'memory_activity';
request_id: string;
seq?: number | null;
thread_id: string;
ts?: number | null;
turn_request_id?: string | null;
}
| {
args?: any;
client_id: string;
event: 'external_transfer_pending';
request_id: string;
seq?: number | null;
thread_id: string;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
event: 'proactive_message';
full_response?: string | null;
message?: string | null;
parts?: OutboundContentPart[] | null;
persisted_message_id?: string | null;
request_id: string;
seq?: number | null;
success?: boolean | null;
thread_id: string;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
event: 'voice_speak';
full_response?: string | null;
request_id: string;
seq?: number | null;
success?: boolean | null;
thread_id: string;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
event: 'channel_outbound';
full_response?: string | null;
request_id: string;
seq?: number | null;
structured?: any;
thread_id: string;
ts?: number | null;
turn_request_id?: string | null;
}
| {
channel_event: ChannelEvent;
client_id: string;
event: 'channel_event';
/**
* OpenHuman's persisted row ID for the canonical event's target, when
* the host has an exact durable provider-receipt binding.
*/
openhuman_message_id?: string | null;
request_id: string;
seq?: number | null;
thread_id: string;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
error_source?: string | null;
error_type?: string | null;
event: 'user_error';
request_id: string;
seq?: number | null;
thread_id: string;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
event: 'chat_message';
full_response?: string | null;
message?: string | null;
parts?: OutboundContentPart[] | null;
request_id: string;
seq?: number | null;
thread_id: string;
ts?: number | null;
turn_request_id?: string | null;
}
| {
client_id: string;
event: 'chat_segment';
full_response?: string | null;
message?: string | null;
parts?: OutboundContentPart[] | null;
request_id: string;
segment_index?: number | null;
segment_total?: number | null;
seq?: number | null;
thread_id: string;
ts?: number | null;
turn_request_id?: string | null;
};
/**
* Typed outbound parts accepted by migrated provider adapters.
*/
export type OutboundContentPart =
| {
kind: 'content';
part: ContentPart;
}
| {
kind: 'voice';
voice: OutboundVoice;
};
/**
* Provider-neutral ordered inbound content.
*/
export type ContentPart =
| {
kind: 'text';
/**
* Formatting dialect; formatting remains text, never HTML authority.
*/
markdownDialect?: string | null;
text: string;
}
| {
altText: string | null;
caption: string | null;
kind: 'image';
media: MediaReference;
}
| {
caption: string | null;
durationMs: number | null;
kind: 'video';
media: MediaReference;
thumbnail: MediaReference | null;
}
| {
codec: string | null;
durationMs: number | null;
kind: 'audio';
media: MediaReference;
title: string | null;
transcript: string | null;
}
| {
caption: string | null;
fileName: string | null;
kind: 'file';
media: MediaReference;
}
| {
kind: 'voice_note';
voiceNote: VoiceNote;
}
| {
altText: string | null;
emoji: string | null;
kind: 'sticker';
media: MediaReference;
packId: string | null;
stickerId: string | null;
}
| {
accuracyMeters: number | null;
address: string | null;
kind: 'location';
label: string | null;
latitude: number;
liveUntilUnixMs: number | null;
longitude: number;
}
| {
displayName: string;
emails: ContactMethod[];
kind: 'contact';
organization: string | null;
phoneNumbers: ContactMethod[];
}
| {
kind: 'buttons';
rows: ButtonAction[][];
}
| {
closesAtUnixMs: number | null;
kind: 'poll';
multipleChoice: boolean;
options: string[];
providerPollId: string | null;
question: string;
}
| {
blocks: any;
kind: 'presentation';
}
| {
data: any;
kind: 'native';
provider: string;
};
/**
* Origin of voice transcript enrichment.
*/
export type VoiceTranscriptSource = 'provider' | 'host_stt';
/**
* Whether a voice transcript is still being produced or is final.
*/
export type VoiceTranscriptState = 'pending' | 'complete' | 'unavailable';
/**
* Visual button emphasis; it does not change action authority.
*/
export type ButtonStyle = 'primary' | 'secondary' | 'danger';
/**
* Explicit outbound voice operation. Synthesis is opt-in and keeps its text.
*/
export type OutboundVoice =
| {
codec: string | null;
durationMs: number | null;
kind: 'media';
media: MediaReference;
}
| {
kind: 'synthesize';
text: string;
voice: string | null;
};
/**
* One normalized event emitted by a channel provider.
*/
export type ChannelEvent = {
channel: ChannelRef;
/**
* Full conversation address. Presence events may omit it.
*/
conversation: ConversationRef | null;
/**
* Stable adapter event ID, suitable for host-side deduplication.
*/
eventId: string;
/**
* Provider event ID, retained verbatim when supplied.
*/
sourceEventId: string | null;
/**
* Provider timestamp in Unix milliseconds, when supplied.
*/
sourceTimestamp: number | null;
/**
* Event vocabulary version. This DTO currently represents contract v2.
*/
version: number;
} & ChannelEvent1;
export type ChannelEvent1 =
| {
active: boolean;
actor: SenderRef;
expiresAt: number | null;
type: 'typing';
}
| {
actor: SenderRef | null;
messageId: string;
timestamp: number | null;
type: 'read_receipt';
}
| {
actor: SenderRef | null;
messageId: string;
timestamp: number | null;
type: 'delivered_receipt';
}
| {
actor: SenderRef;
messageId: string;
providerMessageId?: string | null;
reaction: ChannelReaction;
type: 'reaction_added';
}
| {
actor: SenderRef;
messageId: string;
providerMessageId?: string | null;
reaction: ChannelReaction;
type: 'reaction_removed';
}
| {
messageId: string;
providerMessageId?: string | null;
reaction: ChannelReaction;
success: boolean;
type: 'outbound_reaction';
}
| {
messageId: string;
parts: ContentPart[];
providerMessageId?: string | null;
type: 'message_updated';
}
| {
messageId: string;
providerMessageId?: string | null;
type: 'message_deleted';
}
| {
actionId: string;
actor: SenderRef;
providerMessageId: string | null;
queryId: string;
type: 'button_callback';
}
| {
actor: SenderRef;
expiresAt: number | null;
state: string;
type: 'presence';
}
| {
reason: string | null;
state: string;
type: 'lifecycle';
};
/**
* One inbound media reference, preserving provider attachment order.
*/
export interface MediaReference {
codec: string | null;
contentType: string | null;
durationMs: number | null;
fileName: string | null;
height: number | null;
/**
* Provider-neutral media kind.
*/
kind: 'image' | 'video' | 'audio' | 'document' | 'unknown';
localCachePath: string | null;
/**
* Host-owned identifier for media stored outside the provider. It is
* opaque and only meaningful with the full channel, conversation, and
* turn scope used to store it.
*/
opaqueId?: string | null;
path: string | null;
platformMessageId: string | null;
sizeBytes: number | null;
transcribed: boolean;
url: string | null;
width: number | null;
}
/**
* Audio message metadata and optional transcript enrichment.
*/
export interface VoiceNote {
codec: string | null;
durationMs: number | null;
media: MediaReference1;
pushToTalk: boolean;
transcript: VoiceTranscript | null;
waveform: number[] | null;
}
/**
* One inbound media reference, preserving provider attachment order.
*/
export interface MediaReference1 {
codec: string | null;
contentType: string | null;
durationMs: number | null;
fileName: string | null;
height: number | null;
/**
* Provider-neutral media kind.
*/
kind: 'image' | 'video' | 'audio' | 'document' | 'unknown';
localCachePath: string | null;
/**
* Host-owned identifier for media stored outside the provider. It is
* opaque and only meaningful with the full channel, conversation, and
* turn scope used to store it.
*/
opaqueId?: string | null;
path: string | null;
platformMessageId: string | null;
sizeBytes: number | null;
transcribed: boolean;
url: string | null;
width: number | null;
}
/**
* Transcript enrichment attached to a voice note without replacing its audio.
*/
export interface VoiceTranscript {
language: string | null;
source: VoiceTranscriptSource;
state: VoiceTranscriptState;
text: string;
}
/**
* One typed phone number or email address on a contact card.
*/
export interface ContactMethod {
label: string | null;
value: string;
}
/**
* One provider-neutral action button in an ordered content row.
*/
export interface ButtonAction {
disabled: boolean;
id: string;
label: string;
style: ButtonStyle | null;
}
export interface WebTurnTimingPayload {
first_token_ms?: number | null;
first_tool_ms?: number | null;
tokens_per_second?: number | null;
total_ms?: number | null;
}
export interface WebTurnUsagePayload {
cached_input_tokens: number;
context_tokens: number;
context_window: number;
/**
* Cost provenance copied as a wire enum to avoid depending on the harness.
*/
cost_source: 'charged' | 'estimated' | 'unknown';
cost_usd: number | null;
input_tokens: number;
output_tokens: number;
subagents?: WebSubagentUsagePayload[];
}
export interface WebSubagentUsagePayload {
agent_id: string;
cost_usd: number | null;
input_tokens: number;
output_tokens: number;
task_id: string;
}
export interface ChatSuggestion {
label?: string | null;
prompt: string;
}
export interface WebGuardrailPayload {
reasons?: WebGuardrailReason[];
score: number;
verdict: string;
}
export interface WebGuardrailReason {
code: string;
message: string;
}
export interface WebSubagentProgressDetail {
agent_id?: string | null;
cached_input_tokens?: number | null;
changed_files?: string[] | null;
child_iteration?: number | null;
child_max_iterations?: number | null;
cost_usd?: number | null;
dedicated_thread?: boolean | null;
dirty_status?: boolean | null;
display_name?: string | null;
elapsed_ms?: number | null;
input_tokens?: number | null;
iterations?: number | null;
mode?: string | null;
output?: string | null;
output_chars?: number | null;
output_tokens?: number | null;
parent_call_id?: string | null;
prompt_chars?: number | null;
task_id?: string | null;
worker_thread_id?: string | null;
worktree_path?: string | null;
}
export interface WebQueueItemPayload {
id: string;
lane?: string | null;
text_preview?: string | null;
}
/**
* Configured provider/account identity.
*/
export interface ChannelRef {
accountId: string | null;
id: string;
}
/**
* Reference to an inbound or outbound conversation.
*/
export interface ConversationRef {
id: string;
/**
* Provider-neutral conversation kind.
*/
kind: 'dm' | 'group' | 'channel' | 'thread' | 'unknown';
parentId: string | null;
scopeId: string | null;
threadId: string | null;
topicId: string | null;
}
/**
* Reference to the message sender.
*/
export interface SenderRef {
altIds: string[];
id: string;
isBot: boolean;
name: string | null;
roles: string[];
}
/**
* Provider reaction identity, including optional custom emoji identity.
*/
export interface ChannelReaction {
/**
* Provider-specific stable custom-emoji identity.
*/
customEmojiId: string | null;
/**
* Displayable reaction text, such as an emoji.
*/
value: string;
}