Skip to content

v0.13.0

Choose a tag to compare

@smm-h smm-h released this 13 Jul 16:51
· 294 commits to main since this release

Control-protocol extensions for interactive clients: interrupt, live model and permission-mode switching, context usage, user dialogs, enriched permission prompts, and renderer observability.

Context

These additions power alternative frontends that drive the claude CLI directly. AskUserQuestion is answered by feeding the choice back through a permission updatedInput, so interactive tools resolve without a separate answer channel. A correlation registry tracks pending control requests with restart-safe hard failures, so a dropped or restarted session surfaces an explicit error rather than a silently unresolved future.

Breaking

  • Breaking. Renamed --no-color flag to --color (default: true) across all commands. Use --no-color to disable color output.

Features

  • New feature. Added __version__ attribute to the claudestream package.
  • Control-request wire structs. New ControlRequest message struct and a ControlResponse.error field expose the CLI control protocol for interrupt, model, and mode requests.
  • Control-request correlation. Sessions can issue correlated control requests with pending-future tracking, turn-loop and between-turns response resolution, timeouts, and restart/close safety.
  • Interactive session controls. interrupt(), set_permission_mode(), set_model(), and get_context_usage() are now available on both AsyncSession and SyncSession, and SessionConfig.permission_mode sets the initial permission mode via --permission-mode.
  • Dialog and enriched-permission responses. New DialogCompleted and DialogCancelled messages answer user dialogs, AllowPermission accepts updated_permissions to apply permission-rule updates on allow, and InitializeRequest can declare supported_dialog_kinds.
  • Tool-permission prompts now decode correctly. The current Claude CLI sends permission prompts as can_use_tool; these now surface as PermissionRequest (with new fields like permission_suggestions, display_name, and requires_user_interaction) instead of being missed. A new UserDialogRequest event carries CLI-driven user dialogs.
  • User-dialog handling on sessions. respond_dialog() and respond_dialog_cancelled() answer dialog requests, respond_allow() accepts updated_permissions, and SessionConfig.supported_dialog_kinds declares which dialogs the consumer can render (forcing the initialize handshake). Available on both AsyncSession and SyncSession.
  • Renderer observability. ToolResult now carries tool_name (correlated from the matching ToolUse), and Result exposes per-model model_usage from the CLI's modelUsage payload.
  • Permission interception. New SessionConfig.intercept_permissions routes permission prompts and interactive tools like AskUserQuestion to the consumer as PermissionRequest events.
  • Tool error signal. ToolResult and ToolResultBlock now expose is_error, so consumers can distinguish failed tool executions from successful ones.

Fixes

  • Fix. ToolSchema fields description, input_schema, and server are now optional, supporting name-only tool entries.