Ask Answer Wire Protocol Constants (shared/ask-answer.ts)

imcodes · shared/ask-answer.ts · typescript · MIT
realtime, infra, lang:typescript, tag:protocol, tag:constants

Defines wire protocol constants and reliability contracts for interactive user question responses. Use it in daemon-client communication bridges for reliable command acknowledgments.

// Source: https://github.com/im4codes/imcodes | License: MIT | Copyright 2026 IM.codes
// Provided via justclaw.it.com; keep this notice with the code.
// Wire contract for answering an interactive AskUserQuestion card
// (`ask.answer`), shared by the daemon, the server bridge and the web.
//
// Legacy browsers send `{ type, sessionName, answer }` fire-and-forget. A
// browser that sees ASK_ANSWER_ACK_CAPABILITY_V1 in the daemon hello adds
// `commandId` (+ `toolUseId`), and the daemon then answers with a reliable
// `command.ack` describing the outcome, so a lost / refused answer is never
// presented to the user as delivered.

export const ASK_ANSWER_COMMAND = 'ask.answer' as const;

/** Daemon advertises it acks `ask.answer` commands that carry a `commandId`. */
export const ASK_ANSWER

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key