module
ACP::Protocol
Defined in:
acp/protocol/capabilities.cracp/protocol/client_methods.cr
acp/protocol/content_block.cr
acp/protocol/enums.cr
acp/protocol/tool_call_content.cr
acp/protocol/types.cr
acp/protocol/updates.cr
Class Method Summary
-
.build_error_response(id : RequestId, code : Int32, message : String, data : JSON::Any | Nil = nil) : Hash(String, JSON::Any)
Builds a JSON-RPC 2.0 error response.
-
.build_notification(method : String, params : JSON::Serializable) : Hash(String, JSON::Any)
Builds a JSON-RPC 2.0 notification (no "id" field).
-
.build_request(id : RequestId, method : String, params : JSON::Serializable) : Hash(String, JSON::Any)
Builds a JSON-RPC 2.0 request object as a Hash for serialization.
-
.build_request_raw(id : RequestId, method : String, params : JSON::Any) : Hash(String, JSON::Any)
Builds a JSON-RPC 2.0 request with raw JSON::Any params.
-
.build_response(id : RequestId, result : JSON::Serializable) : Hash(String, JSON::Any)
Builds a JSON-RPC 2.0 success response.
-
.build_response_raw(id : RequestId, result : JSON::Any) : Hash(String, JSON::Any)
Builds a JSON-RPC 2.0 success response with raw JSON::Any result.
-
.classify_message(msg : JSON::Any) : MessageKind
Utility to classify a raw JSON::Any message into its kind.
-
.extract_id(msg : JSON::Any) : RequestId | Nil
Extract the request ID from a raw JSON message.
Class Method Detail
Builds a JSON-RPC 2.0 error response.
Builds a JSON-RPC 2.0 notification (no "id" field).
Builds a JSON-RPC 2.0 request object as a Hash for serialization.
Builds a JSON-RPC 2.0 request with raw JSON::Any params.
Builds a JSON-RPC 2.0 success response.
Builds a JSON-RPC 2.0 success response with raw JSON::Any result.
Utility to classify a raw JSON::Any message into its kind.
Extract the request ID from a raw JSON message. Returns nil if not present. Handles both integer and string IDs.