Resource
content-writer
Writer for streaming tool execution content.
resource content-writer;F check-write
check-write: func() -> result<u64, stream-error>;Check readiness for writing. Returns the number of bytes that can be written to the current content block without blocking.
F write
write: func(contents: list<u8>) -> result<_, stream-error>;Write contents to the in-progress content block.
F next
next: func(content: content-block) -> result<_, stream-error>;Start a new content block.
F close
close: func(options: option<call-tool-result-options>) -> result<_, stream-error>;Complete the content result stream.
F send-text
send-text: func(id: id, output: output-stream, text: string, options: option<call-tool-result-options>) -> result<_, stream-error>;Send a simple text message as a complete result and close the output stream.
F send-content
send-content: func(id: id, output: output-stream, content: list<content-block>, options: option<call-tool-result-options>) -> result<_, stream-error>;Send a content block list as a complete result and close the output stream.
F send-error
send-error: func(id: id, output: output-stream, reason: string) -> result<_, stream-error>;Send a simple error message as a complete result and close the output stream.
F open
open: func(id: id, output: output-stream, initial: content-block) -> result<content-writer, stream-error>;Start the stream of content blocks.