acp-sdk 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +2 -1
- data/lib/acp/agent_connection/client.rb +1 -1
- data/lib/acp/agent_connection.rb +3 -1
- data/lib/acp/client_connection.rb +93 -4
- data/lib/acp/request_error.rb +15 -2
- data/lib/acp/types/agent_auth_capabilities.rb +4 -1
- data/lib/acp/types/agent_capabilities.rb +20 -5
- data/lib/acp/types/annotations.rb +6 -3
- data/lib/acp/types/audio_content.rb +8 -3
- data/lib/acp/types/auth_capabilities.rb +1 -1
- data/lib/acp/types/auth_method/terminal.rb +11 -5
- data/lib/acp/types/auth_method_agent.rb +6 -1
- data/lib/acp/types/auth_method_terminal.rb +11 -5
- data/lib/acp/types/authenticate_request.rb +1 -1
- data/lib/acp/types/available_command.rb +3 -3
- data/lib/acp/types/available_commands_update.rb +7 -4
- data/lib/acp/types/blob_resource_contents.rb +6 -1
- data/lib/acp/types/boolean_property_schema.rb +6 -1
- data/lib/acp/types/cancel_notification.rb +4 -1
- data/lib/acp/types/cancel_request_notification.rb +9 -1
- data/lib/acp/types/client_capabilities.rb +15 -5
- data/lib/acp/types/client_session_capabilities.rb +6 -3
- data/lib/acp/types/close_session_request.rb +4 -1
- data/lib/acp/types/complete_elicitation_notification.rb +4 -1
- data/lib/acp/types/config_option_update.rb +7 -4
- data/lib/acp/types/content.rb +4 -1
- data/lib/acp/types/content_block/audio.rb +8 -3
- data/lib/acp/types/content_block/image.rb +9 -4
- data/lib/acp/types/content_block/resource.rb +11 -2
- data/lib/acp/types/content_block/resource_link.rb +12 -7
- data/lib/acp/types/content_block/text.rb +7 -2
- data/lib/acp/types/content_chunk.rb +2 -2
- data/lib/acp/types/cost.rb +5 -1
- data/lib/acp/types/create_elicitation_request/mode/form.rb +5 -1
- data/lib/acp/types/create_elicitation_request/mode/url.rb +2 -2
- data/lib/acp/types/create_elicitation_request.rb +1 -1
- data/lib/acp/types/create_elicitation_response/action/accept.rb +6 -1
- data/lib/acp/types/create_terminal_request.rb +12 -6
- data/lib/acp/types/create_terminal_response.rb +4 -1
- data/lib/acp/types/current_mode_update.rb +4 -1
- data/lib/acp/types/delete_session_request.rb +4 -1
- data/lib/acp/types/diff.rb +6 -1
- data/lib/acp/types/elicitation_accept_action.rb +6 -1
- data/lib/acp/types/elicitation_capabilities.rb +2 -2
- data/lib/acp/types/elicitation_form_mode.rb +5 -1
- data/lib/acp/types/elicitation_property_schema/boolean_property_schema.rb +6 -1
- data/lib/acp/types/elicitation_property_schema/integer_property_schema.rb +5 -5
- data/lib/acp/types/elicitation_property_schema/multi_select_property_schema.rb +9 -6
- data/lib/acp/types/elicitation_property_schema/number_property_schema.rb +5 -5
- data/lib/acp/types/elicitation_property_schema/string_property_schema.rb +15 -9
- data/lib/acp/types/elicitation_request_scope.rb +8 -1
- data/lib/acp/types/elicitation_schema.rb +11 -5
- data/lib/acp/types/elicitation_session_scope.rb +4 -1
- data/lib/acp/types/elicitation_url_mode.rb +2 -2
- data/lib/acp/types/embedded_resource.rb +11 -2
- data/lib/acp/types/enum_option.rb +6 -1
- data/lib/acp/types/env_variable.rb +5 -1
- data/lib/acp/types/file_system_capabilities.rb +5 -1
- data/lib/acp/types/http_header.rb +5 -1
- data/lib/acp/types/image_content.rb +9 -4
- data/lib/acp/types/implementation.rb +6 -1
- data/lib/acp/types/initialize_request.rb +18 -3
- data/lib/acp/types/initialize_response.rb +17 -4
- data/lib/acp/types/integer_property_schema.rb +5 -5
- data/lib/acp/types/kill_terminal_request.rb +5 -1
- data/lib/acp/types/list_sessions_request.rb +5 -1
- data/lib/acp/types/list_sessions_response.rb +5 -2
- data/lib/acp/types/load_session_request.rb +14 -4
- data/lib/acp/types/load_session_response.rb +5 -2
- data/lib/acp/types/mcp_capabilities.rb +5 -1
- data/lib/acp/types/mcp_server/http.rb +6 -3
- data/lib/acp/types/mcp_server/sse.rb +6 -3
- data/lib/acp/types/mcp_server_http.rb +6 -3
- data/lib/acp/types/mcp_server_sse.rb +6 -3
- data/lib/acp/types/mcp_server_stdio.rb +10 -4
- data/lib/acp/types/multi_select_items/string_multi_select_items.rb +4 -1
- data/lib/acp/types/multi_select_property_schema.rb +9 -6
- data/lib/acp/types/new_session_request.rb +13 -3
- data/lib/acp/types/new_session_response.rb +6 -3
- data/lib/acp/types/number_property_schema.rb +5 -5
- data/lib/acp/types/permission_option.rb +10 -1
- data/lib/acp/types/plan.rb +4 -1
- data/lib/acp/types/plan_entry.rb +7 -3
- data/lib/acp/types/prompt_capabilities.rb +6 -1
- data/lib/acp/types/prompt_request.rb +5 -2
- data/lib/acp/types/prompt_response.rb +8 -1
- data/lib/acp/types/read_text_file_request.rb +4 -4
- data/lib/acp/types/read_text_file_response.rb +1 -1
- data/lib/acp/types/release_terminal_request.rb +5 -1
- data/lib/acp/types/request_permission_outcome/selected.rb +1 -1
- data/lib/acp/types/request_permission_request.rb +10 -3
- data/lib/acp/types/request_permission_response.rb +8 -1
- data/lib/acp/types/resource_link.rb +12 -7
- data/lib/acp/types/resume_session_request.rb +14 -4
- data/lib/acp/types/resume_session_response.rb +5 -2
- data/lib/acp/types/selected_permission_outcome.rb +1 -1
- data/lib/acp/types/session_capabilities.rb +20 -7
- data/lib/acp/types/session_config_boolean.rb +1 -1
- data/lib/acp/types/session_config_option/kind/boolean.rb +1 -1
- data/lib/acp/types/session_config_option/kind/select.rb +6 -2
- data/lib/acp/types/session_config_option.rb +3 -3
- data/lib/acp/types/session_config_options_capabilities.rb +6 -1
- data/lib/acp/types/session_config_select.rb +6 -2
- data/lib/acp/types/session_config_select_group.rb +6 -3
- data/lib/acp/types/session_config_select_option.rb +6 -1
- data/lib/acp/types/session_config_select_options.rb +6 -2
- data/lib/acp/types/session_info.rb +12 -5
- data/lib/acp/types/session_info_update.rb +10 -1
- data/lib/acp/types/session_mode.rb +6 -1
- data/lib/acp/types/session_mode_state.rb +8 -2
- data/lib/acp/types/session_notification.rb +2 -2
- data/lib/acp/types/session_update/agent_message_chunk.rb +2 -2
- data/lib/acp/types/session_update/agent_thought_chunk.rb +2 -2
- data/lib/acp/types/session_update/available_commands_update.rb +7 -4
- data/lib/acp/types/session_update/config_option_update.rb +7 -4
- data/lib/acp/types/session_update/current_mode_update.rb +4 -1
- data/lib/acp/types/session_update/plan.rb +4 -1
- data/lib/acp/types/session_update/session_info_update.rb +10 -1
- data/lib/acp/types/session_update/tool_call.rb +23 -7
- data/lib/acp/types/session_update/tool_call_update.rb +23 -7
- data/lib/acp/types/session_update/usage_update.rb +3 -3
- data/lib/acp/types/session_update/user_message_chunk.rb +2 -2
- data/lib/acp/types/set_session_config_option_request/value/boolean.rb +1 -1
- data/lib/acp/types/set_session_config_option_request/value/value_id.rb +1 -1
- data/lib/acp/types/set_session_config_option_request.rb +2 -2
- data/lib/acp/types/set_session_config_option_response.rb +7 -4
- data/lib/acp/types/set_session_mode_request.rb +5 -1
- data/lib/acp/types/string_multi_select_items.rb +4 -1
- data/lib/acp/types/string_property_schema.rb +15 -9
- data/lib/acp/types/terminal.rb +4 -1
- data/lib/acp/types/terminal_exit_status.rb +5 -1
- data/lib/acp/types/terminal_output_request.rb +5 -1
- data/lib/acp/types/terminal_output_response.rb +8 -3
- data/lib/acp/types/text_content.rb +7 -2
- data/lib/acp/types/text_resource_contents.rb +6 -1
- data/lib/acp/types/titled_multi_select_items.rb +4 -1
- data/lib/acp/types/tool_call.rb +23 -7
- data/lib/acp/types/tool_call_content/content.rb +4 -1
- data/lib/acp/types/tool_call_content/diff.rb +6 -1
- data/lib/acp/types/tool_call_content/terminal.rb +4 -1
- data/lib/acp/types/tool_call_location.rb +5 -1
- data/lib/acp/types/tool_call_update.rb +23 -7
- data/lib/acp/types/unstructured_command_input.rb +1 -1
- data/lib/acp/types/usage_update.rb +3 -3
- data/lib/acp/types/wait_for_terminal_exit_request.rb +5 -1
- data/lib/acp/types/wait_for_terminal_exit_response.rb +5 -1
- data/lib/acp/types/write_text_file_request.rb +3 -3
- data/lib/acp/types.rb +247 -0
- data/lib/acp/version.rb +1 -1
- data/sig/generated/acp/client_connection.rbs +39 -1
- data/sig/generated/acp/request_error.rbs +12 -1
- data/sig/generated/acp/types.rbs +143 -0
- metadata +1 -1
|
@@ -21,7 +21,10 @@ class ACP::Types::CompleteElicitationNotification
|
|
|
21
21
|
# @rbs hash: Hash[String, untyped]
|
|
22
22
|
# @rbs return: ACP::Types::CompleteElicitationNotification
|
|
23
23
|
def self.from_h(hash)
|
|
24
|
-
new(
|
|
24
|
+
new(
|
|
25
|
+
elicitation_id: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'elicitationId'), 'elicitationId'),
|
|
26
|
+
meta: hash['_meta']
|
|
27
|
+
)
|
|
25
28
|
end
|
|
26
29
|
|
|
27
30
|
# @rbs return: Hash[String, untyped]
|
|
@@ -21,10 +21,13 @@ class ACP::Types::ConfigOptionUpdate
|
|
|
21
21
|
# @rbs hash: Hash[String, untyped]
|
|
22
22
|
# @rbs return: ACP::Types::ConfigOptionUpdate
|
|
23
23
|
def self.from_h(hash)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
)
|
|
24
|
+
config_options = ACP::Types::Check.array(
|
|
25
|
+
ACP::Types::Check.key(hash, 'configOptions'),
|
|
26
|
+
'configOptions'
|
|
27
|
+
) do |item, path|
|
|
28
|
+
ACP::Types::Check.object(item, path, ACP::Types::SessionConfigOption)
|
|
29
|
+
end
|
|
30
|
+
new(config_options:, meta: hash['_meta'])
|
|
28
31
|
end
|
|
29
32
|
|
|
30
33
|
# @rbs return: Hash[String, untyped]
|
data/lib/acp/types/content.rb
CHANGED
|
@@ -21,7 +21,10 @@ class ACP::Types::Content
|
|
|
21
21
|
# @rbs hash: Hash[String, untyped]
|
|
22
22
|
# @rbs return: ACP::Types::Content
|
|
23
23
|
def self.from_h(hash)
|
|
24
|
-
new(
|
|
24
|
+
new(
|
|
25
|
+
content: ACP::Types::Check.object(ACP::Types::Check.key(hash, 'content'), 'content', ACP::Types::ContentBlock),
|
|
26
|
+
meta: hash['_meta']
|
|
27
|
+
)
|
|
25
28
|
end
|
|
26
29
|
|
|
27
30
|
# @rbs return: Hash[String, untyped]
|
|
@@ -32,9 +32,14 @@ class ACP::Types::ContentBlock::Audio
|
|
|
32
32
|
# @rbs return: ACP::Types::ContentBlock::Audio
|
|
33
33
|
def self.from_h(hash)
|
|
34
34
|
new(
|
|
35
|
-
annotations:
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
annotations: ACP::Types::Check.object(
|
|
36
|
+
hash['annotations'],
|
|
37
|
+
'annotations',
|
|
38
|
+
ACP::Types::Annotations,
|
|
39
|
+
allow_nil: true
|
|
40
|
+
),
|
|
41
|
+
data: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'data'), 'data'),
|
|
42
|
+
mime_type: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'mimeType'), 'mimeType'),
|
|
38
43
|
meta: hash['_meta']
|
|
39
44
|
)
|
|
40
45
|
end
|
|
@@ -37,10 +37,15 @@ class ACP::Types::ContentBlock::Image
|
|
|
37
37
|
# @rbs return: ACP::Types::ContentBlock::Image
|
|
38
38
|
def self.from_h(hash)
|
|
39
39
|
new(
|
|
40
|
-
annotations:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
annotations: ACP::Types::Check.object(
|
|
41
|
+
hash['annotations'],
|
|
42
|
+
'annotations',
|
|
43
|
+
ACP::Types::Annotations,
|
|
44
|
+
allow_nil: true
|
|
45
|
+
),
|
|
46
|
+
data: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'data'), 'data'),
|
|
47
|
+
mime_type: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'mimeType'), 'mimeType'),
|
|
48
|
+
uri: ACP::Types::Check.string(hash['uri'], 'uri', allow_nil: true),
|
|
44
49
|
meta: hash['_meta']
|
|
45
50
|
)
|
|
46
51
|
end
|
|
@@ -27,8 +27,17 @@ class ACP::Types::ContentBlock::Resource
|
|
|
27
27
|
# @rbs return: ACP::Types::ContentBlock::Resource
|
|
28
28
|
def self.from_h(hash)
|
|
29
29
|
new(
|
|
30
|
-
annotations:
|
|
31
|
-
|
|
30
|
+
annotations: ACP::Types::Check.object(
|
|
31
|
+
hash['annotations'],
|
|
32
|
+
'annotations',
|
|
33
|
+
ACP::Types::Annotations,
|
|
34
|
+
allow_nil: true
|
|
35
|
+
),
|
|
36
|
+
resource: ACP::Types::Check.object(
|
|
37
|
+
ACP::Types::Check.key(hash, 'resource'),
|
|
38
|
+
'resource',
|
|
39
|
+
ACP::Types::EmbeddedResourceResource
|
|
40
|
+
),
|
|
32
41
|
meta: hash['_meta']
|
|
33
42
|
)
|
|
34
43
|
end
|
|
@@ -52,13 +52,18 @@ class ACP::Types::ContentBlock::ResourceLink
|
|
|
52
52
|
# @rbs return: ACP::Types::ContentBlock::ResourceLink
|
|
53
53
|
def self.from_h(hash)
|
|
54
54
|
new(
|
|
55
|
-
annotations:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
annotations: ACP::Types::Check.object(
|
|
56
|
+
hash['annotations'],
|
|
57
|
+
'annotations',
|
|
58
|
+
ACP::Types::Annotations,
|
|
59
|
+
allow_nil: true
|
|
60
|
+
),
|
|
61
|
+
description: ACP::Types::Check.string(hash['description'], 'description', allow_nil: true),
|
|
62
|
+
mime_type: ACP::Types::Check.string(hash['mimeType'], 'mimeType', allow_nil: true),
|
|
63
|
+
name: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'name'), 'name'),
|
|
64
|
+
size: ACP::Types::Check.integer(hash['size'], 'size', allow_nil: true),
|
|
65
|
+
title: ACP::Types::Check.string(hash['title'], 'title', allow_nil: true),
|
|
66
|
+
uri: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'uri'), 'uri'),
|
|
62
67
|
meta: hash['_meta']
|
|
63
68
|
)
|
|
64
69
|
end
|
|
@@ -27,8 +27,13 @@ class ACP::Types::ContentBlock::Text
|
|
|
27
27
|
# @rbs return: ACP::Types::ContentBlock::Text
|
|
28
28
|
def self.from_h(hash)
|
|
29
29
|
new(
|
|
30
|
-
annotations:
|
|
31
|
-
|
|
30
|
+
annotations: ACP::Types::Check.object(
|
|
31
|
+
hash['annotations'],
|
|
32
|
+
'annotations',
|
|
33
|
+
ACP::Types::Annotations,
|
|
34
|
+
allow_nil: true
|
|
35
|
+
),
|
|
36
|
+
text: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'text'), 'text'),
|
|
32
37
|
meta: hash['_meta']
|
|
33
38
|
)
|
|
34
39
|
end
|
|
@@ -27,8 +27,8 @@ class ACP::Types::ContentChunk
|
|
|
27
27
|
# @rbs return: ACP::Types::ContentChunk
|
|
28
28
|
def self.from_h(hash)
|
|
29
29
|
new(
|
|
30
|
-
content: ACP::Types::
|
|
31
|
-
message_id: hash['messageId'],
|
|
30
|
+
content: ACP::Types::Check.object(ACP::Types::Check.key(hash, 'content'), 'content', ACP::Types::ContentBlock),
|
|
31
|
+
message_id: ACP::Types::Check.string(hash['messageId'], 'messageId', allow_nil: true),
|
|
32
32
|
meta: hash['_meta']
|
|
33
33
|
)
|
|
34
34
|
end
|
data/lib/acp/types/cost.rb
CHANGED
|
@@ -26,7 +26,11 @@ class ACP::Types::Cost
|
|
|
26
26
|
# @rbs hash: Hash[String, untyped]
|
|
27
27
|
# @rbs return: ACP::Types::Cost
|
|
28
28
|
def self.from_h(hash)
|
|
29
|
-
new(
|
|
29
|
+
new(
|
|
30
|
+
amount: ACP::Types::Check.number(ACP::Types::Check.key(hash, 'amount'), 'amount'),
|
|
31
|
+
currency: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'currency'), 'currency'),
|
|
32
|
+
meta: hash['_meta']
|
|
33
|
+
)
|
|
30
34
|
end
|
|
31
35
|
|
|
32
36
|
# @rbs return: Hash[String, untyped]
|
|
@@ -22,7 +22,11 @@ class ACP::Types::CreateElicitationRequest::Mode::Form
|
|
|
22
22
|
# @rbs return: ACP::Types::CreateElicitationRequest::Mode::Form
|
|
23
23
|
def self.from_h(hash)
|
|
24
24
|
new(
|
|
25
|
-
requested_schema: ACP::Types::
|
|
25
|
+
requested_schema: ACP::Types::Check.object(
|
|
26
|
+
ACP::Types::Check.key(hash, 'requestedSchema'),
|
|
27
|
+
'requestedSchema',
|
|
28
|
+
ACP::Types::ElicitationSchema
|
|
29
|
+
),
|
|
26
30
|
scope: ACP::Types::ElicitationFormMode::Scope.from_h(hash)
|
|
27
31
|
)
|
|
28
32
|
end
|
|
@@ -27,8 +27,8 @@ class ACP::Types::CreateElicitationRequest::Mode::Url
|
|
|
27
27
|
# @rbs return: ACP::Types::CreateElicitationRequest::Mode::Url
|
|
28
28
|
def self.from_h(hash)
|
|
29
29
|
new(
|
|
30
|
-
elicitation_id:
|
|
31
|
-
url:
|
|
30
|
+
elicitation_id: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'elicitationId'), 'elicitationId'),
|
|
31
|
+
url: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'url'), 'url'),
|
|
32
32
|
scope: ACP::Types::ElicitationUrlMode::Scope.from_h(hash)
|
|
33
33
|
)
|
|
34
34
|
end
|
|
@@ -27,7 +27,7 @@ class ACP::Types::CreateElicitationRequest
|
|
|
27
27
|
# @rbs return: ACP::Types::CreateElicitationRequest
|
|
28
28
|
def self.from_h(hash)
|
|
29
29
|
new(
|
|
30
|
-
message:
|
|
30
|
+
message: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'message'), 'message'),
|
|
31
31
|
meta: hash['_meta'],
|
|
32
32
|
mode: ACP::Types::CreateElicitationRequest::Mode.from_h(hash)
|
|
33
33
|
)
|
|
@@ -16,7 +16,12 @@ class ACP::Types::CreateElicitationResponse::Action::Accept
|
|
|
16
16
|
# @rbs hash: Hash[String, untyped]
|
|
17
17
|
# @rbs return: ACP::Types::CreateElicitationResponse::Action::Accept
|
|
18
18
|
def self.from_h(hash)
|
|
19
|
-
|
|
19
|
+
content = ACP::Types::Check.hash(hash['content'], 'content', allow_nil: true) do |value, path|
|
|
20
|
+
ACP::Types::Check.one_of(value, path, [String, Integer, Numeric, TrueClass, FalseClass, Array]) do |item, path|
|
|
21
|
+
ACP::Types::Check.string(item, path)
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
new(content:)
|
|
20
25
|
end
|
|
21
26
|
|
|
22
27
|
# @rbs return: Hash[String, untyped]
|
|
@@ -46,13 +46,19 @@ class ACP::Types::CreateTerminalRequest
|
|
|
46
46
|
# @rbs hash: Hash[String, untyped]
|
|
47
47
|
# @rbs return: ACP::Types::CreateTerminalRequest
|
|
48
48
|
def self.from_h(hash)
|
|
49
|
+
args = ACP::Types::Check.array(hash['args'], 'args', allow_nil: true) do |item, path|
|
|
50
|
+
ACP::Types::Check.string(item, path)
|
|
51
|
+
end
|
|
52
|
+
env = ACP::Types::Check.array(hash['env'], 'env', allow_nil: true) do |item, path|
|
|
53
|
+
ACP::Types::Check.object(item, path, ACP::Types::EnvVariable)
|
|
54
|
+
end
|
|
49
55
|
new(
|
|
50
|
-
session_id:
|
|
51
|
-
command:
|
|
52
|
-
args
|
|
53
|
-
env
|
|
54
|
-
cwd: hash['cwd'],
|
|
55
|
-
output_byte_limit: hash['outputByteLimit'],
|
|
56
|
+
session_id: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'sessionId'), 'sessionId'),
|
|
57
|
+
command: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'command'), 'command'),
|
|
58
|
+
args:,
|
|
59
|
+
env:,
|
|
60
|
+
cwd: ACP::Types::Check.string(hash['cwd'], 'cwd', allow_nil: true),
|
|
61
|
+
output_byte_limit: ACP::Types::Check.integer(hash['outputByteLimit'], 'outputByteLimit', min: 0, allow_nil: true),
|
|
56
62
|
meta: hash['_meta']
|
|
57
63
|
)
|
|
58
64
|
end
|
|
@@ -21,7 +21,10 @@ class ACP::Types::CreateTerminalResponse
|
|
|
21
21
|
# @rbs hash: Hash[String, untyped]
|
|
22
22
|
# @rbs return: ACP::Types::CreateTerminalResponse
|
|
23
23
|
def self.from_h(hash)
|
|
24
|
-
new(
|
|
24
|
+
new(
|
|
25
|
+
terminal_id: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'terminalId'), 'terminalId'),
|
|
26
|
+
meta: hash['_meta']
|
|
27
|
+
)
|
|
25
28
|
end
|
|
26
29
|
|
|
27
30
|
# @rbs return: Hash[String, untyped]
|
|
@@ -21,7 +21,10 @@ class ACP::Types::CurrentModeUpdate
|
|
|
21
21
|
# @rbs hash: Hash[String, untyped]
|
|
22
22
|
# @rbs return: ACP::Types::CurrentModeUpdate
|
|
23
23
|
def self.from_h(hash)
|
|
24
|
-
new(
|
|
24
|
+
new(
|
|
25
|
+
current_mode_id: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'currentModeId'), 'currentModeId'),
|
|
26
|
+
meta: hash['_meta']
|
|
27
|
+
)
|
|
25
28
|
end
|
|
26
29
|
|
|
27
30
|
# @rbs return: Hash[String, untyped]
|
|
@@ -21,7 +21,10 @@ class ACP::Types::DeleteSessionRequest
|
|
|
21
21
|
# @rbs hash: Hash[String, untyped]
|
|
22
22
|
# @rbs return: ACP::Types::DeleteSessionRequest
|
|
23
23
|
def self.from_h(hash)
|
|
24
|
-
new(
|
|
24
|
+
new(
|
|
25
|
+
session_id: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'sessionId'), 'sessionId'),
|
|
26
|
+
meta: hash['_meta']
|
|
27
|
+
)
|
|
25
28
|
end
|
|
26
29
|
|
|
27
30
|
# @rbs return: Hash[String, untyped]
|
data/lib/acp/types/diff.rb
CHANGED
|
@@ -31,7 +31,12 @@ class ACP::Types::Diff
|
|
|
31
31
|
# @rbs hash: Hash[String, untyped]
|
|
32
32
|
# @rbs return: ACP::Types::Diff
|
|
33
33
|
def self.from_h(hash)
|
|
34
|
-
new(
|
|
34
|
+
new(
|
|
35
|
+
path: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'path'), 'path'),
|
|
36
|
+
old_text: ACP::Types::Check.string(hash['oldText'], 'oldText', allow_nil: true),
|
|
37
|
+
new_text: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'newText'), 'newText'),
|
|
38
|
+
meta: hash['_meta']
|
|
39
|
+
)
|
|
35
40
|
end
|
|
36
41
|
|
|
37
42
|
# @rbs return: Hash[String, untyped]
|
|
@@ -16,7 +16,12 @@ class ACP::Types::ElicitationAcceptAction
|
|
|
16
16
|
# @rbs hash: Hash[String, untyped]
|
|
17
17
|
# @rbs return: ACP::Types::ElicitationAcceptAction
|
|
18
18
|
def self.from_h(hash)
|
|
19
|
-
|
|
19
|
+
content = ACP::Types::Check.hash(hash['content'], 'content', allow_nil: true) do |value, path|
|
|
20
|
+
ACP::Types::Check.one_of(value, path, [String, Integer, Numeric, TrueClass, FalseClass, Array]) do |item, path|
|
|
21
|
+
ACP::Types::Check.string(item, path)
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
new(content:)
|
|
20
25
|
end
|
|
21
26
|
|
|
22
27
|
# @rbs return: Hash[String, untyped]
|
|
@@ -27,8 +27,8 @@ class ACP::Types::ElicitationCapabilities
|
|
|
27
27
|
# @rbs return: ACP::Types::ElicitationCapabilities
|
|
28
28
|
def self.from_h(hash)
|
|
29
29
|
new(
|
|
30
|
-
form: hash['form']
|
|
31
|
-
url: hash['url']
|
|
30
|
+
form: ACP::Types::Check.object(hash['form'], 'form', ACP::Types::ElicitationFormCapabilities, allow_nil: true),
|
|
31
|
+
url: ACP::Types::Check.object(hash['url'], 'url', ACP::Types::ElicitationUrlCapabilities, allow_nil: true),
|
|
32
32
|
meta: hash['_meta']
|
|
33
33
|
)
|
|
34
34
|
end
|
|
@@ -22,7 +22,11 @@ class ACP::Types::ElicitationFormMode
|
|
|
22
22
|
# @rbs return: ACP::Types::ElicitationFormMode
|
|
23
23
|
def self.from_h(hash)
|
|
24
24
|
new(
|
|
25
|
-
requested_schema: ACP::Types::
|
|
25
|
+
requested_schema: ACP::Types::Check.object(
|
|
26
|
+
ACP::Types::Check.key(hash, 'requestedSchema'),
|
|
27
|
+
'requestedSchema',
|
|
28
|
+
ACP::Types::ElicitationSchema
|
|
29
|
+
),
|
|
26
30
|
scope: ACP::Types::ElicitationFormMode::Scope.from_h(hash)
|
|
27
31
|
)
|
|
28
32
|
end
|
|
@@ -31,7 +31,12 @@ class ACP::Types::ElicitationPropertySchema::BooleanPropertySchema
|
|
|
31
31
|
# @rbs hash: Hash[String, untyped]
|
|
32
32
|
# @rbs return: ACP::Types::ElicitationPropertySchema::BooleanPropertySchema
|
|
33
33
|
def self.from_h(hash)
|
|
34
|
-
new(
|
|
34
|
+
new(
|
|
35
|
+
title: ACP::Types::Check.string(hash['title'], 'title', allow_nil: true),
|
|
36
|
+
description: ACP::Types::Check.string(hash['description'], 'description', allow_nil: true),
|
|
37
|
+
default: ACP::Types::Check.boolean(hash['default'], 'default', allow_nil: true),
|
|
38
|
+
meta: hash['_meta']
|
|
39
|
+
)
|
|
35
40
|
end
|
|
36
41
|
|
|
37
42
|
# @rbs return: Hash[String, untyped]
|
|
@@ -42,11 +42,11 @@ class ACP::Types::ElicitationPropertySchema::IntegerPropertySchema
|
|
|
42
42
|
# @rbs return: ACP::Types::ElicitationPropertySchema::IntegerPropertySchema
|
|
43
43
|
def self.from_h(hash)
|
|
44
44
|
new(
|
|
45
|
-
title: hash['title'],
|
|
46
|
-
description: hash['description'],
|
|
47
|
-
minimum: hash['minimum'],
|
|
48
|
-
maximum: hash['maximum'],
|
|
49
|
-
default: hash['default'],
|
|
45
|
+
title: ACP::Types::Check.string(hash['title'], 'title', allow_nil: true),
|
|
46
|
+
description: ACP::Types::Check.string(hash['description'], 'description', allow_nil: true),
|
|
47
|
+
minimum: ACP::Types::Check.integer(hash['minimum'], 'minimum', allow_nil: true),
|
|
48
|
+
maximum: ACP::Types::Check.integer(hash['maximum'], 'maximum', allow_nil: true),
|
|
49
|
+
default: ACP::Types::Check.integer(hash['default'], 'default', allow_nil: true),
|
|
50
50
|
meta: hash['_meta']
|
|
51
51
|
)
|
|
52
52
|
end
|
|
@@ -46,13 +46,16 @@ class ACP::Types::ElicitationPropertySchema::MultiSelectPropertySchema
|
|
|
46
46
|
# @rbs hash: Hash[String, untyped]
|
|
47
47
|
# @rbs return: ACP::Types::ElicitationPropertySchema::MultiSelectPropertySchema
|
|
48
48
|
def self.from_h(hash)
|
|
49
|
+
default = ACP::Types::Check.array(hash['default'], 'default', allow_nil: true) do |item, path|
|
|
50
|
+
ACP::Types::Check.string(item, path)
|
|
51
|
+
end
|
|
49
52
|
new(
|
|
50
|
-
title: hash['title'],
|
|
51
|
-
description: hash['description'],
|
|
52
|
-
min_items: hash['minItems'],
|
|
53
|
-
max_items: hash['maxItems'],
|
|
54
|
-
items: ACP::Types::
|
|
55
|
-
default
|
|
53
|
+
title: ACP::Types::Check.string(hash['title'], 'title', allow_nil: true),
|
|
54
|
+
description: ACP::Types::Check.string(hash['description'], 'description', allow_nil: true),
|
|
55
|
+
min_items: ACP::Types::Check.integer(hash['minItems'], 'minItems', min: 0, allow_nil: true),
|
|
56
|
+
max_items: ACP::Types::Check.integer(hash['maxItems'], 'maxItems', min: 0, allow_nil: true),
|
|
57
|
+
items: ACP::Types::Check.object(ACP::Types::Check.key(hash, 'items'), 'items', ACP::Types::MultiSelectItems),
|
|
58
|
+
default:,
|
|
56
59
|
meta: hash['_meta']
|
|
57
60
|
)
|
|
58
61
|
end
|
|
@@ -42,11 +42,11 @@ class ACP::Types::ElicitationPropertySchema::NumberPropertySchema
|
|
|
42
42
|
# @rbs return: ACP::Types::ElicitationPropertySchema::NumberPropertySchema
|
|
43
43
|
def self.from_h(hash)
|
|
44
44
|
new(
|
|
45
|
-
title: hash['title'],
|
|
46
|
-
description: hash['description'],
|
|
47
|
-
minimum: hash['minimum'],
|
|
48
|
-
maximum: hash['maximum'],
|
|
49
|
-
default: hash['default'],
|
|
45
|
+
title: ACP::Types::Check.string(hash['title'], 'title', allow_nil: true),
|
|
46
|
+
description: ACP::Types::Check.string(hash['description'], 'description', allow_nil: true),
|
|
47
|
+
minimum: ACP::Types::Check.number(hash['minimum'], 'minimum', allow_nil: true),
|
|
48
|
+
maximum: ACP::Types::Check.number(hash['maximum'], 'maximum', allow_nil: true),
|
|
49
|
+
default: ACP::Types::Check.number(hash['default'], 'default', allow_nil: true),
|
|
50
50
|
meta: hash['_meta']
|
|
51
51
|
)
|
|
52
52
|
end
|
|
@@ -72,16 +72,22 @@ class ACP::Types::ElicitationPropertySchema::StringPropertySchema
|
|
|
72
72
|
# @rbs hash: Hash[String, untyped]
|
|
73
73
|
# @rbs return: ACP::Types::ElicitationPropertySchema::StringPropertySchema
|
|
74
74
|
def self.from_h(hash)
|
|
75
|
+
enum = ACP::Types::Check.array(hash['enum'], 'enum', allow_nil: true) do |item, path|
|
|
76
|
+
ACP::Types::Check.string(item, path)
|
|
77
|
+
end
|
|
78
|
+
one_of = ACP::Types::Check.array(hash['oneOf'], 'oneOf', allow_nil: true) do |item, path|
|
|
79
|
+
ACP::Types::Check.object(item, path, ACP::Types::EnumOption)
|
|
80
|
+
end
|
|
75
81
|
new(
|
|
76
|
-
title: hash['title'],
|
|
77
|
-
description: hash['description'],
|
|
78
|
-
min_length: hash['minLength'],
|
|
79
|
-
max_length: hash['maxLength'],
|
|
80
|
-
pattern: hash['pattern'],
|
|
81
|
-
format: hash['format'],
|
|
82
|
-
default: hash['default'],
|
|
83
|
-
enum
|
|
84
|
-
one_of
|
|
82
|
+
title: ACP::Types::Check.string(hash['title'], 'title', allow_nil: true),
|
|
83
|
+
description: ACP::Types::Check.string(hash['description'], 'description', allow_nil: true),
|
|
84
|
+
min_length: ACP::Types::Check.integer(hash['minLength'], 'minLength', min: 0, allow_nil: true),
|
|
85
|
+
max_length: ACP::Types::Check.integer(hash['maxLength'], 'maxLength', min: 0, allow_nil: true),
|
|
86
|
+
pattern: ACP::Types::Check.string(hash['pattern'], 'pattern', allow_nil: true),
|
|
87
|
+
format: ACP::Types::Check.enum(hash['format'], 'format', %w[email uri date date-time], allow_nil: true),
|
|
88
|
+
default: ACP::Types::Check.string(hash['default'], 'default', allow_nil: true),
|
|
89
|
+
enum:,
|
|
90
|
+
one_of:,
|
|
85
91
|
meta: hash['_meta']
|
|
86
92
|
)
|
|
87
93
|
end
|
|
@@ -16,7 +16,14 @@ class ACP::Types::ElicitationRequestScope
|
|
|
16
16
|
# @rbs hash: Hash[String, untyped]
|
|
17
17
|
# @rbs return: ACP::Types::ElicitationRequestScope
|
|
18
18
|
def self.from_h(hash)
|
|
19
|
-
new(
|
|
19
|
+
new(
|
|
20
|
+
request_id: ACP::Types::Check.one_of(
|
|
21
|
+
ACP::Types::Check.key(hash, 'requestId'),
|
|
22
|
+
'requestId',
|
|
23
|
+
[Integer, String],
|
|
24
|
+
allow_nil: true
|
|
25
|
+
)
|
|
26
|
+
)
|
|
20
27
|
end
|
|
21
28
|
|
|
22
29
|
# @rbs return: Hash[String, untyped]
|
|
@@ -41,12 +41,18 @@ class ACP::Types::ElicitationSchema
|
|
|
41
41
|
# @rbs hash: Hash[String, untyped]
|
|
42
42
|
# @rbs return: ACP::Types::ElicitationSchema
|
|
43
43
|
def self.from_h(hash)
|
|
44
|
+
properties = ACP::Types::Check.hash(hash['properties'], 'properties', allow_nil: true) do |value, path|
|
|
45
|
+
ACP::Types::Check.object(value, path, ACP::Types::ElicitationPropertySchema)
|
|
46
|
+
end
|
|
47
|
+
required = ACP::Types::Check.array(hash['required'], 'required', allow_nil: true) do |item, path|
|
|
48
|
+
ACP::Types::Check.string(item, path)
|
|
49
|
+
end
|
|
44
50
|
new(
|
|
45
|
-
type: hash['type'],
|
|
46
|
-
title: hash['title'],
|
|
47
|
-
properties
|
|
48
|
-
required
|
|
49
|
-
description: hash['description'],
|
|
51
|
+
type: ACP::Types::Check.enum(hash['type'], 'type', ['object'], allow_nil: true),
|
|
52
|
+
title: ACP::Types::Check.string(hash['title'], 'title', allow_nil: true),
|
|
53
|
+
properties:,
|
|
54
|
+
required:,
|
|
55
|
+
description: ACP::Types::Check.string(hash['description'], 'description', allow_nil: true),
|
|
50
56
|
meta: hash['_meta']
|
|
51
57
|
)
|
|
52
58
|
end
|
|
@@ -21,7 +21,10 @@ class ACP::Types::ElicitationSessionScope
|
|
|
21
21
|
# @rbs hash: Hash[String, untyped]
|
|
22
22
|
# @rbs return: ACP::Types::ElicitationSessionScope
|
|
23
23
|
def self.from_h(hash)
|
|
24
|
-
new(
|
|
24
|
+
new(
|
|
25
|
+
session_id: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'sessionId'), 'sessionId'),
|
|
26
|
+
tool_call_id: ACP::Types::Check.string(hash['toolCallId'], 'toolCallId', allow_nil: true)
|
|
27
|
+
)
|
|
25
28
|
end
|
|
26
29
|
|
|
27
30
|
# @rbs return: Hash[String, untyped]
|
|
@@ -27,8 +27,8 @@ class ACP::Types::ElicitationUrlMode
|
|
|
27
27
|
# @rbs return: ACP::Types::ElicitationUrlMode
|
|
28
28
|
def self.from_h(hash)
|
|
29
29
|
new(
|
|
30
|
-
elicitation_id:
|
|
31
|
-
url:
|
|
30
|
+
elicitation_id: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'elicitationId'), 'elicitationId'),
|
|
31
|
+
url: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'url'), 'url'),
|
|
32
32
|
scope: ACP::Types::ElicitationUrlMode::Scope.from_h(hash)
|
|
33
33
|
)
|
|
34
34
|
end
|
|
@@ -27,8 +27,17 @@ class ACP::Types::EmbeddedResource
|
|
|
27
27
|
# @rbs return: ACP::Types::EmbeddedResource
|
|
28
28
|
def self.from_h(hash)
|
|
29
29
|
new(
|
|
30
|
-
annotations:
|
|
31
|
-
|
|
30
|
+
annotations: ACP::Types::Check.object(
|
|
31
|
+
hash['annotations'],
|
|
32
|
+
'annotations',
|
|
33
|
+
ACP::Types::Annotations,
|
|
34
|
+
allow_nil: true
|
|
35
|
+
),
|
|
36
|
+
resource: ACP::Types::Check.object(
|
|
37
|
+
ACP::Types::Check.key(hash, 'resource'),
|
|
38
|
+
'resource',
|
|
39
|
+
ACP::Types::EmbeddedResourceResource
|
|
40
|
+
),
|
|
32
41
|
meta: hash['_meta']
|
|
33
42
|
)
|
|
34
43
|
end
|
|
@@ -31,7 +31,12 @@ class ACP::Types::EnumOption
|
|
|
31
31
|
# @rbs hash: Hash[String, untyped]
|
|
32
32
|
# @rbs return: ACP::Types::EnumOption
|
|
33
33
|
def self.from_h(hash)
|
|
34
|
-
new(
|
|
34
|
+
new(
|
|
35
|
+
const: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'const'), 'const'),
|
|
36
|
+
title: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'title'), 'title'),
|
|
37
|
+
description: ACP::Types::Check.string(hash['description'], 'description', allow_nil: true),
|
|
38
|
+
meta: hash['_meta']
|
|
39
|
+
)
|
|
35
40
|
end
|
|
36
41
|
|
|
37
42
|
# @rbs return: Hash[String, untyped]
|
|
@@ -26,7 +26,11 @@ class ACP::Types::EnvVariable
|
|
|
26
26
|
# @rbs hash: Hash[String, untyped]
|
|
27
27
|
# @rbs return: ACP::Types::EnvVariable
|
|
28
28
|
def self.from_h(hash)
|
|
29
|
-
new(
|
|
29
|
+
new(
|
|
30
|
+
name: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'name'), 'name'),
|
|
31
|
+
value: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'value'), 'value'),
|
|
32
|
+
meta: hash['_meta']
|
|
33
|
+
)
|
|
30
34
|
end
|
|
31
35
|
|
|
32
36
|
# @rbs return: Hash[String, untyped]
|
|
@@ -26,7 +26,11 @@ class ACP::Types::FileSystemCapabilities
|
|
|
26
26
|
# @rbs hash: Hash[String, untyped]
|
|
27
27
|
# @rbs return: ACP::Types::FileSystemCapabilities
|
|
28
28
|
def self.from_h(hash)
|
|
29
|
-
new(
|
|
29
|
+
new(
|
|
30
|
+
read_text_file: ACP::Types::Check.boolean(hash['readTextFile'], 'readTextFile', allow_nil: true),
|
|
31
|
+
write_text_file: ACP::Types::Check.boolean(hash['writeTextFile'], 'writeTextFile', allow_nil: true),
|
|
32
|
+
meta: hash['_meta']
|
|
33
|
+
)
|
|
30
34
|
end
|
|
31
35
|
|
|
32
36
|
# @rbs return: Hash[String, untyped]
|
|
@@ -26,7 +26,11 @@ class ACP::Types::HttpHeader
|
|
|
26
26
|
# @rbs hash: Hash[String, untyped]
|
|
27
27
|
# @rbs return: ACP::Types::HttpHeader
|
|
28
28
|
def self.from_h(hash)
|
|
29
|
-
new(
|
|
29
|
+
new(
|
|
30
|
+
name: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'name'), 'name'),
|
|
31
|
+
value: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'value'), 'value'),
|
|
32
|
+
meta: hash['_meta']
|
|
33
|
+
)
|
|
30
34
|
end
|
|
31
35
|
|
|
32
36
|
# @rbs return: Hash[String, untyped]
|
|
@@ -37,10 +37,15 @@ class ACP::Types::ImageContent
|
|
|
37
37
|
# @rbs return: ACP::Types::ImageContent
|
|
38
38
|
def self.from_h(hash)
|
|
39
39
|
new(
|
|
40
|
-
annotations:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
annotations: ACP::Types::Check.object(
|
|
41
|
+
hash['annotations'],
|
|
42
|
+
'annotations',
|
|
43
|
+
ACP::Types::Annotations,
|
|
44
|
+
allow_nil: true
|
|
45
|
+
),
|
|
46
|
+
data: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'data'), 'data'),
|
|
47
|
+
mime_type: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'mimeType'), 'mimeType'),
|
|
48
|
+
uri: ACP::Types::Check.string(hash['uri'], 'uri', allow_nil: true),
|
|
44
49
|
meta: hash['_meta']
|
|
45
50
|
)
|
|
46
51
|
end
|