Module: AgentClientProtocol::Schema::SessionUpdate

Defined in:
lib/agent_client_protocol/schema/types.rb

Constant Summary collapse

USER_MESSAGE_CHUNK =
"user_message_chunk".freeze
AGENT_MESSAGE_CHUNK =
"agent_message_chunk".freeze
AGENT_THOUGHT_CHUNK =
"agent_thought_chunk".freeze
TOOL_CALL =
"tool_call".freeze
TOOL_CALL_UPDATE =
"tool_call_update".freeze
PLAN =
"plan".freeze
AVAILABLE_COMMANDS_UPDATE =
"available_commands_update".freeze
CURRENT_MODE_UPDATE =
"current_mode_update".freeze
CONFIG_OPTION_UPDATE =
"config_option_update".freeze

Class Method Summary collapse

Class Method Details

.parse(hash) ⇒ Object



139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/agent_client_protocol/schema/types.rb', line 139

def self.parse(hash)
  return nil if hash.nil?
  disc = hash["sessionUpdate"]
  case disc
  when "user_message_chunk"
    obj = ContentChunk.from_hash(hash)
    obj
  when "agent_message_chunk"
    obj = ContentChunk.from_hash(hash)
    obj
  when "agent_thought_chunk"
    obj = ContentChunk.from_hash(hash)
    obj
  when "tool_call"
    obj = ToolCall.from_hash(hash)
    obj
  when "tool_call_update"
    obj = ToolCallUpdate.from_hash(hash)
    obj
  when "plan"
    obj = Plan.from_hash(hash)
    obj
  when "available_commands_update"
    obj = AvailableCommandsUpdate.from_hash(hash)
    obj
  when "current_mode_update"
    obj = CurrentModeUpdate.from_hash(hash)
    obj
  when "config_option_update"
    obj = ConfigOptionUpdate.from_hash(hash)
    obj
  else
    hash
  end
end