helpers
helpers ¶
raw_tool_use ¶
raw_tool_use(
name: str,
input: dict[str, Any] | None = None,
id: str = "tu_x",
**extra: Any,
) -> dict[str, Any]
A raw tool_use content-block dict.
raw_tool_result_block ¶
raw_tool_result_block(
tool_use_id: str = "tu_x",
content: list[Any] | str = "ok",
is_error: bool = False,
) -> dict[str, Any]
A raw tool_result content-block dict.
raw_msg ¶
A raw transcript line wrapping content (a block list or plain text) under message.
raw_text ¶
A raw transcript line carrying a single text block.
raw_assistant ¶
A raw assistant line wrapping the given content blocks (e.g. raw_tool_use(...)).
raw_tool_msg ¶
raw_tool_msg(
name: str,
input: dict[str, Any] | None = None,
id: str = "tu_x",
**extra: Any,
) -> dict[str, Any]
A raw assistant line carrying a single tool_use block (the common single-tool case).
raw_tool_result ¶
raw_tool_result(
tool_use_id: str = "tu_x",
content: list[Any] | str = "ok",
tool_use_result: dict[str, Any] | None = None,
is_error: bool = False,
) -> dict[str, Any]
A raw user line carrying one tool_result block, with optional top-level toolUseResult.
raw_notification ¶
raw_notification(
tool_use_id: str,
task_id: str = "task-1",
status: str = "completed",
**extra: Any,
) -> dict[str, Any]
A raw queue-operation line carrying a <task-notification> for tool_use_id.
async_agent_launch ¶
A two-line async Agent launch: tool_use + tool_result with isAsync toolUseResult.
workflow_launch ¶
A two-line Workflow launch: tool_use + tool_result whose toolUseResult has no isAsync.
make_transcript ¶
Build a Transcript from raw message dicts, given either as varargs or a single list.
waiting_evt ¶
A Bash echo PreToolUse event over the given raw transcript, ready for check_condition.
assistant_msg ¶
An assistant TranscriptMessage whose content is a ToolUseBlock per (name, input) tuple.
text_msg ¶
An assistant TranscriptMessage carrying a single text block.
tool_result_msg ¶
A user TranscriptMessage carrying a single tool_result block.