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
|
@@ -26,9 +26,12 @@ class ACP::Types::ResumeSessionResponse
|
|
|
26
26
|
# @rbs hash: Hash[String, untyped]
|
|
27
27
|
# @rbs return: ACP::Types::ResumeSessionResponse
|
|
28
28
|
def self.from_h(hash)
|
|
29
|
+
config_options = ACP::Types::Check.array(hash['configOptions'], 'configOptions', allow_nil: true) do |item, path|
|
|
30
|
+
ACP::Types::Check.object(item, path, ACP::Types::SessionConfigOption)
|
|
31
|
+
end
|
|
29
32
|
new(
|
|
30
|
-
modes: hash['modes']
|
|
31
|
-
config_options
|
|
33
|
+
modes: ACP::Types::Check.object(hash['modes'], 'modes', ACP::Types::SessionModeState, allow_nil: true),
|
|
34
|
+
config_options:,
|
|
32
35
|
meta: hash['_meta']
|
|
33
36
|
)
|
|
34
37
|
end
|
|
@@ -21,7 +21,7 @@ class ACP::Types::SelectedPermissionOutcome
|
|
|
21
21
|
# @rbs hash: Hash[String, untyped]
|
|
22
22
|
# @rbs return: ACP::Types::SelectedPermissionOutcome
|
|
23
23
|
def self.from_h(hash)
|
|
24
|
-
new(option_id:
|
|
24
|
+
new(option_id: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'optionId'), 'optionId'), meta: hash['_meta'])
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
# @rbs return: Hash[String, untyped]
|
|
@@ -42,13 +42,26 @@ class ACP::Types::SessionCapabilities
|
|
|
42
42
|
# @rbs return: ACP::Types::SessionCapabilities
|
|
43
43
|
def self.from_h(hash)
|
|
44
44
|
new(
|
|
45
|
-
list: hash['list']
|
|
46
|
-
delete:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
list: ACP::Types::Check.object(hash['list'], 'list', ACP::Types::SessionListCapabilities, allow_nil: true),
|
|
46
|
+
delete: ACP::Types::Check.object(
|
|
47
|
+
hash['delete'],
|
|
48
|
+
'delete',
|
|
49
|
+
ACP::Types::SessionDeleteCapabilities,
|
|
50
|
+
allow_nil: true
|
|
51
|
+
),
|
|
52
|
+
additional_directories: ACP::Types::Check.object(
|
|
53
|
+
hash['additionalDirectories'],
|
|
54
|
+
'additionalDirectories',
|
|
55
|
+
ACP::Types::SessionAdditionalDirectoriesCapabilities,
|
|
56
|
+
allow_nil: true
|
|
57
|
+
),
|
|
58
|
+
resume: ACP::Types::Check.object(
|
|
59
|
+
hash['resume'],
|
|
60
|
+
'resume',
|
|
61
|
+
ACP::Types::SessionResumeCapabilities,
|
|
62
|
+
allow_nil: true
|
|
63
|
+
),
|
|
64
|
+
close: ACP::Types::Check.object(hash['close'], 'close', ACP::Types::SessionCloseCapabilities, allow_nil: true),
|
|
52
65
|
meta: hash['_meta']
|
|
53
66
|
)
|
|
54
67
|
end
|
|
@@ -16,7 +16,7 @@ class ACP::Types::SessionConfigBoolean
|
|
|
16
16
|
# @rbs hash: Hash[String, untyped]
|
|
17
17
|
# @rbs return: ACP::Types::SessionConfigBoolean
|
|
18
18
|
def self.from_h(hash)
|
|
19
|
-
new(current_value:
|
|
19
|
+
new(current_value: ACP::Types::Check.boolean(ACP::Types::Check.key(hash, 'currentValue'), 'currentValue'))
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
# @rbs return: Hash[String, untyped]
|
|
@@ -16,7 +16,7 @@ class ACP::Types::SessionConfigOption::Kind::Boolean
|
|
|
16
16
|
# @rbs hash: Hash[String, untyped]
|
|
17
17
|
# @rbs return: ACP::Types::SessionConfigOption::Kind::Boolean
|
|
18
18
|
def self.from_h(hash)
|
|
19
|
-
new(current_value:
|
|
19
|
+
new(current_value: ACP::Types::Check.boolean(ACP::Types::Check.key(hash, 'currentValue'), 'currentValue'))
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
# @rbs return: Hash[String, untyped]
|
|
@@ -22,8 +22,12 @@ class ACP::Types::SessionConfigOption::Kind::Select
|
|
|
22
22
|
# @rbs return: ACP::Types::SessionConfigOption::Kind::Select
|
|
23
23
|
def self.from_h(hash)
|
|
24
24
|
new(
|
|
25
|
-
current_value:
|
|
26
|
-
options: ACP::Types::
|
|
25
|
+
current_value: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'currentValue'), 'currentValue'),
|
|
26
|
+
options: ACP::Types::Check.objects(
|
|
27
|
+
ACP::Types::Check.key(hash, 'options'),
|
|
28
|
+
'options',
|
|
29
|
+
ACP::Types::SessionConfigSelectOptions
|
|
30
|
+
)
|
|
27
31
|
)
|
|
28
32
|
end
|
|
29
33
|
|
|
@@ -42,9 +42,9 @@ class ACP::Types::SessionConfigOption
|
|
|
42
42
|
# @rbs return: ACP::Types::SessionConfigOption
|
|
43
43
|
def self.from_h(hash)
|
|
44
44
|
new(
|
|
45
|
-
id:
|
|
46
|
-
name:
|
|
47
|
-
description: hash['description'],
|
|
45
|
+
id: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'id'), 'id'),
|
|
46
|
+
name: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'name'), 'name'),
|
|
47
|
+
description: ACP::Types::Check.string(hash['description'], 'description', allow_nil: true),
|
|
48
48
|
category: hash['category'],
|
|
49
49
|
meta: hash['_meta'],
|
|
50
50
|
kind: ACP::Types::SessionConfigOption::Kind.from_h(hash)
|
|
@@ -22,7 +22,12 @@ class ACP::Types::SessionConfigOptionsCapabilities
|
|
|
22
22
|
# @rbs return: ACP::Types::SessionConfigOptionsCapabilities
|
|
23
23
|
def self.from_h(hash)
|
|
24
24
|
new(
|
|
25
|
-
boolean:
|
|
25
|
+
boolean: ACP::Types::Check.object(
|
|
26
|
+
hash['boolean'],
|
|
27
|
+
'boolean',
|
|
28
|
+
ACP::Types::BooleanConfigOptionCapabilities,
|
|
29
|
+
allow_nil: true
|
|
30
|
+
),
|
|
26
31
|
meta: hash['_meta']
|
|
27
32
|
)
|
|
28
33
|
end
|
|
@@ -22,8 +22,12 @@ class ACP::Types::SessionConfigSelect
|
|
|
22
22
|
# @rbs return: ACP::Types::SessionConfigSelect
|
|
23
23
|
def self.from_h(hash)
|
|
24
24
|
new(
|
|
25
|
-
current_value:
|
|
26
|
-
options: ACP::Types::
|
|
25
|
+
current_value: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'currentValue'), 'currentValue'),
|
|
26
|
+
options: ACP::Types::Check.objects(
|
|
27
|
+
ACP::Types::Check.key(hash, 'options'),
|
|
28
|
+
'options',
|
|
29
|
+
ACP::Types::SessionConfigSelectOptions
|
|
30
|
+
)
|
|
27
31
|
)
|
|
28
32
|
end
|
|
29
33
|
|
|
@@ -31,10 +31,13 @@ class ACP::Types::SessionConfigSelectGroup
|
|
|
31
31
|
# @rbs hash: Hash[String, untyped]
|
|
32
32
|
# @rbs return: ACP::Types::SessionConfigSelectGroup
|
|
33
33
|
def self.from_h(hash)
|
|
34
|
+
options = ACP::Types::Check.array(ACP::Types::Check.key(hash, 'options'), 'options') do |item, path|
|
|
35
|
+
ACP::Types::Check.object(item, path, ACP::Types::SessionConfigSelectOption)
|
|
36
|
+
end
|
|
34
37
|
new(
|
|
35
|
-
group:
|
|
36
|
-
name:
|
|
37
|
-
options
|
|
38
|
+
group: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'group'), 'group'),
|
|
39
|
+
name: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'name'), 'name'),
|
|
40
|
+
options:,
|
|
38
41
|
meta: hash['_meta']
|
|
39
42
|
)
|
|
40
43
|
end
|
|
@@ -31,7 +31,12 @@ class ACP::Types::SessionConfigSelectOption
|
|
|
31
31
|
# @rbs hash: Hash[String, untyped]
|
|
32
32
|
# @rbs return: ACP::Types::SessionConfigSelectOption
|
|
33
33
|
def self.from_h(hash)
|
|
34
|
-
new(
|
|
34
|
+
new(
|
|
35
|
+
value: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'value'), 'value'),
|
|
36
|
+
name: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'name'), 'name'),
|
|
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]
|
|
@@ -12,9 +12,13 @@ module ACP::Types::SessionConfigSelectOptions
|
|
|
12
12
|
# @rbs return: t
|
|
13
13
|
def self.from_a(items)
|
|
14
14
|
if items.all? { |item| item.key?('value') }
|
|
15
|
-
items.map
|
|
15
|
+
items.each_with_index.map do |item, index|
|
|
16
|
+
ACP::Types::Check.object(item, [index], ACP::Types::SessionConfigSelectOption)
|
|
17
|
+
end #: Array[ACP::Types::SessionConfigSelectOption]
|
|
16
18
|
elsif items.all? { |item| item.key?('group') }
|
|
17
|
-
items.map
|
|
19
|
+
items.each_with_index.map do |item, index|
|
|
20
|
+
ACP::Types::Check.object(item, [index], ACP::Types::SessionConfigSelectGroup)
|
|
21
|
+
end #: Array[ACP::Types::SessionConfigSelectGroup]
|
|
18
22
|
else
|
|
19
23
|
items
|
|
20
24
|
end
|
|
@@ -41,12 +41,19 @@ class ACP::Types::SessionInfo
|
|
|
41
41
|
# @rbs hash: Hash[String, untyped]
|
|
42
42
|
# @rbs return: ACP::Types::SessionInfo
|
|
43
43
|
def self.from_h(hash)
|
|
44
|
+
additional_directories = ACP::Types::Check.array(
|
|
45
|
+
hash['additionalDirectories'],
|
|
46
|
+
'additionalDirectories',
|
|
47
|
+
allow_nil: true
|
|
48
|
+
) do |item, path|
|
|
49
|
+
ACP::Types::Check.string(item, path)
|
|
50
|
+
end
|
|
44
51
|
new(
|
|
45
|
-
session_id:
|
|
46
|
-
cwd:
|
|
47
|
-
additional_directories
|
|
48
|
-
title: hash['title'],
|
|
49
|
-
updated_at: hash['updatedAt'],
|
|
52
|
+
session_id: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'sessionId'), 'sessionId'),
|
|
53
|
+
cwd: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'cwd'), 'cwd'),
|
|
54
|
+
additional_directories:,
|
|
55
|
+
title: ACP::Types::Check.string(hash['title'], 'title', allow_nil: true),
|
|
56
|
+
updated_at: ACP::Types::Check.string(hash['updatedAt'], 'updatedAt', allow_nil: true),
|
|
50
57
|
meta: hash['_meta']
|
|
51
58
|
)
|
|
52
59
|
end
|
|
@@ -26,7 +26,16 @@ class ACP::Types::SessionInfoUpdate
|
|
|
26
26
|
# @rbs hash: Hash[String, untyped]
|
|
27
27
|
# @rbs return: ACP::Types::SessionInfoUpdate
|
|
28
28
|
def self.from_h(hash)
|
|
29
|
-
new(
|
|
29
|
+
new(
|
|
30
|
+
title: ACP::Types::Check.string(hash.fetch('title', :unset), 'title', allow_nil: true, allow_unset: true),
|
|
31
|
+
updated_at: ACP::Types::Check.string(
|
|
32
|
+
hash.fetch('updatedAt', :unset),
|
|
33
|
+
'updatedAt',
|
|
34
|
+
allow_nil: true,
|
|
35
|
+
allow_unset: true
|
|
36
|
+
),
|
|
37
|
+
meta: hash['_meta']
|
|
38
|
+
)
|
|
30
39
|
end
|
|
31
40
|
|
|
32
41
|
# @rbs return: Hash[String, untyped]
|
|
@@ -31,7 +31,12 @@ class ACP::Types::SessionMode
|
|
|
31
31
|
# @rbs hash: Hash[String, untyped]
|
|
32
32
|
# @rbs return: ACP::Types::SessionMode
|
|
33
33
|
def self.from_h(hash)
|
|
34
|
-
new(
|
|
34
|
+
new(
|
|
35
|
+
id: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'id'), 'id'),
|
|
36
|
+
name: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'name'), 'name'),
|
|
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,9 +26,15 @@ class ACP::Types::SessionModeState
|
|
|
26
26
|
# @rbs hash: Hash[String, untyped]
|
|
27
27
|
# @rbs return: ACP::Types::SessionModeState
|
|
28
28
|
def self.from_h(hash)
|
|
29
|
+
available_modes = ACP::Types::Check.array(
|
|
30
|
+
ACP::Types::Check.key(hash, 'availableModes'),
|
|
31
|
+
'availableModes'
|
|
32
|
+
) do |item, path|
|
|
33
|
+
ACP::Types::Check.object(item, path, ACP::Types::SessionMode)
|
|
34
|
+
end
|
|
29
35
|
new(
|
|
30
|
-
current_mode_id:
|
|
31
|
-
available_modes
|
|
36
|
+
current_mode_id: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'currentModeId'), 'currentModeId'),
|
|
37
|
+
available_modes:,
|
|
32
38
|
meta: hash['_meta']
|
|
33
39
|
)
|
|
34
40
|
end
|
|
@@ -27,8 +27,8 @@ class ACP::Types::SessionNotification
|
|
|
27
27
|
# @rbs return: ACP::Types::SessionNotification
|
|
28
28
|
def self.from_h(hash)
|
|
29
29
|
new(
|
|
30
|
-
session_id:
|
|
31
|
-
update: ACP::Types::
|
|
30
|
+
session_id: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'sessionId'), 'sessionId'),
|
|
31
|
+
update: ACP::Types::Check.object(ACP::Types::Check.key(hash, 'update'), 'update', ACP::Types::SessionUpdate),
|
|
32
32
|
meta: hash['_meta']
|
|
33
33
|
)
|
|
34
34
|
end
|
|
@@ -27,8 +27,8 @@ class ACP::Types::SessionUpdate::AgentMessageChunk
|
|
|
27
27
|
# @rbs return: ACP::Types::SessionUpdate::AgentMessageChunk
|
|
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
|
|
@@ -27,8 +27,8 @@ class ACP::Types::SessionUpdate::AgentThoughtChunk
|
|
|
27
27
|
# @rbs return: ACP::Types::SessionUpdate::AgentThoughtChunk
|
|
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
|
|
@@ -21,10 +21,13 @@ class ACP::Types::SessionUpdate::AvailableCommandsUpdate
|
|
|
21
21
|
# @rbs hash: Hash[String, untyped]
|
|
22
22
|
# @rbs return: ACP::Types::SessionUpdate::AvailableCommandsUpdate
|
|
23
23
|
def self.from_h(hash)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
)
|
|
24
|
+
available_commands = ACP::Types::Check.array(
|
|
25
|
+
ACP::Types::Check.key(hash, 'availableCommands'),
|
|
26
|
+
'availableCommands'
|
|
27
|
+
) do |item, path|
|
|
28
|
+
ACP::Types::Check.object(item, path, ACP::Types::AvailableCommand)
|
|
29
|
+
end
|
|
30
|
+
new(available_commands:, meta: hash['_meta'])
|
|
28
31
|
end
|
|
29
32
|
|
|
30
33
|
# @rbs return: Hash[String, untyped]
|
|
@@ -21,10 +21,13 @@ class ACP::Types::SessionUpdate::ConfigOptionUpdate
|
|
|
21
21
|
# @rbs hash: Hash[String, untyped]
|
|
22
22
|
# @rbs return: ACP::Types::SessionUpdate::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]
|
|
@@ -21,7 +21,10 @@ class ACP::Types::SessionUpdate::CurrentModeUpdate
|
|
|
21
21
|
# @rbs hash: Hash[String, untyped]
|
|
22
22
|
# @rbs return: ACP::Types::SessionUpdate::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::SessionUpdate::Plan
|
|
|
21
21
|
# @rbs hash: Hash[String, untyped]
|
|
22
22
|
# @rbs return: ACP::Types::SessionUpdate::Plan
|
|
23
23
|
def self.from_h(hash)
|
|
24
|
-
|
|
24
|
+
entries = ACP::Types::Check.array(ACP::Types::Check.key(hash, 'entries'), 'entries') do |item, path|
|
|
25
|
+
ACP::Types::Check.object(item, path, ACP::Types::PlanEntry)
|
|
26
|
+
end
|
|
27
|
+
new(entries:, meta: hash['_meta'])
|
|
25
28
|
end
|
|
26
29
|
|
|
27
30
|
# @rbs return: Hash[String, untyped]
|
|
@@ -26,7 +26,16 @@ class ACP::Types::SessionUpdate::SessionInfoUpdate
|
|
|
26
26
|
# @rbs hash: Hash[String, untyped]
|
|
27
27
|
# @rbs return: ACP::Types::SessionUpdate::SessionInfoUpdate
|
|
28
28
|
def self.from_h(hash)
|
|
29
|
-
new(
|
|
29
|
+
new(
|
|
30
|
+
title: ACP::Types::Check.string(hash.fetch('title', :unset), 'title', allow_nil: true, allow_unset: true),
|
|
31
|
+
updated_at: ACP::Types::Check.string(
|
|
32
|
+
hash.fetch('updatedAt', :unset),
|
|
33
|
+
'updatedAt',
|
|
34
|
+
allow_nil: true,
|
|
35
|
+
allow_unset: true
|
|
36
|
+
),
|
|
37
|
+
meta: hash['_meta']
|
|
38
|
+
)
|
|
30
39
|
end
|
|
31
40
|
|
|
32
41
|
# @rbs return: Hash[String, untyped]
|
|
@@ -72,14 +72,30 @@ class ACP::Types::SessionUpdate::ToolCall
|
|
|
72
72
|
# @rbs hash: Hash[String, untyped]
|
|
73
73
|
# @rbs return: ACP::Types::SessionUpdate::ToolCall
|
|
74
74
|
def self.from_h(hash)
|
|
75
|
+
content = ACP::Types::Check.array(hash['content'], 'content', allow_nil: true) do |item, path|
|
|
76
|
+
ACP::Types::Check.object(item, path, ACP::Types::ToolCallContent)
|
|
77
|
+
end
|
|
78
|
+
locations = ACP::Types::Check.array(hash['locations'], 'locations', allow_nil: true) do |item, path|
|
|
79
|
+
ACP::Types::Check.object(item, path, ACP::Types::ToolCallLocation)
|
|
80
|
+
end
|
|
75
81
|
new(
|
|
76
|
-
tool_call_id:
|
|
77
|
-
title:
|
|
78
|
-
name: hash['name'],
|
|
79
|
-
kind:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
tool_call_id: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'toolCallId'), 'toolCallId'),
|
|
83
|
+
title: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'title'), 'title'),
|
|
84
|
+
name: ACP::Types::Check.string(hash['name'], 'name', allow_nil: true),
|
|
85
|
+
kind: ACP::Types::Check.enum(
|
|
86
|
+
hash['kind'],
|
|
87
|
+
'kind',
|
|
88
|
+
%w[read edit delete move search execute think fetch switch_mode other],
|
|
89
|
+
allow_nil: true
|
|
90
|
+
),
|
|
91
|
+
status: ACP::Types::Check.enum(
|
|
92
|
+
hash['status'],
|
|
93
|
+
'status',
|
|
94
|
+
%w[pending in_progress completed failed],
|
|
95
|
+
allow_nil: true
|
|
96
|
+
),
|
|
97
|
+
content:,
|
|
98
|
+
locations:,
|
|
83
99
|
raw_input: hash['rawInput'],
|
|
84
100
|
raw_output: hash['rawOutput'],
|
|
85
101
|
meta: hash['_meta']
|
|
@@ -72,14 +72,30 @@ class ACP::Types::SessionUpdate::ToolCallUpdate
|
|
|
72
72
|
# @rbs hash: Hash[String, untyped]
|
|
73
73
|
# @rbs return: ACP::Types::SessionUpdate::ToolCallUpdate
|
|
74
74
|
def self.from_h(hash)
|
|
75
|
+
content = ACP::Types::Check.array(hash['content'], 'content', allow_nil: true) do |item, path|
|
|
76
|
+
ACP::Types::Check.object(item, path, ACP::Types::ToolCallContent)
|
|
77
|
+
end
|
|
78
|
+
locations = ACP::Types::Check.array(hash['locations'], 'locations', allow_nil: true) do |item, path|
|
|
79
|
+
ACP::Types::Check.object(item, path, ACP::Types::ToolCallLocation)
|
|
80
|
+
end
|
|
75
81
|
new(
|
|
76
|
-
tool_call_id:
|
|
77
|
-
kind:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
tool_call_id: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'toolCallId'), 'toolCallId'),
|
|
83
|
+
kind: ACP::Types::Check.enum(
|
|
84
|
+
hash['kind'],
|
|
85
|
+
'kind',
|
|
86
|
+
%w[read edit delete move search execute think fetch switch_mode other],
|
|
87
|
+
allow_nil: true
|
|
88
|
+
),
|
|
89
|
+
status: ACP::Types::Check.enum(
|
|
90
|
+
hash['status'],
|
|
91
|
+
'status',
|
|
92
|
+
%w[pending in_progress completed failed],
|
|
93
|
+
allow_nil: true
|
|
94
|
+
),
|
|
95
|
+
title: ACP::Types::Check.string(hash['title'], 'title', allow_nil: true),
|
|
96
|
+
name: ACP::Types::Check.string(hash['name'], 'name', allow_nil: true),
|
|
97
|
+
content:,
|
|
98
|
+
locations:,
|
|
83
99
|
raw_input: hash['rawInput'],
|
|
84
100
|
raw_output: hash['rawOutput'],
|
|
85
101
|
meta: hash['_meta']
|
|
@@ -32,9 +32,9 @@ class ACP::Types::SessionUpdate::UsageUpdate
|
|
|
32
32
|
# @rbs return: ACP::Types::SessionUpdate::UsageUpdate
|
|
33
33
|
def self.from_h(hash)
|
|
34
34
|
new(
|
|
35
|
-
used:
|
|
36
|
-
size:
|
|
37
|
-
cost: hash['cost']
|
|
35
|
+
used: ACP::Types::Check.integer(ACP::Types::Check.key(hash, 'used'), 'used', min: 0),
|
|
36
|
+
size: ACP::Types::Check.integer(ACP::Types::Check.key(hash, 'size'), 'size', min: 0),
|
|
37
|
+
cost: ACP::Types::Check.object(hash['cost'], 'cost', ACP::Types::Cost, allow_nil: true),
|
|
38
38
|
meta: hash['_meta']
|
|
39
39
|
)
|
|
40
40
|
end
|
|
@@ -27,8 +27,8 @@ class ACP::Types::SessionUpdate::UserMessageChunk
|
|
|
27
27
|
# @rbs return: ACP::Types::SessionUpdate::UserMessageChunk
|
|
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
|
|
@@ -16,7 +16,7 @@ class ACP::Types::SetSessionConfigOptionRequest::Value::Boolean
|
|
|
16
16
|
# @rbs hash: Hash[String, untyped]
|
|
17
17
|
# @rbs return: ACP::Types::SetSessionConfigOptionRequest::Value::Boolean
|
|
18
18
|
def self.from_h(hash)
|
|
19
|
-
new(value:
|
|
19
|
+
new(value: ACP::Types::Check.boolean(ACP::Types::Check.key(hash, 'value'), 'value'))
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
# @rbs return: Hash[String, untyped]
|
|
@@ -16,7 +16,7 @@ class ACP::Types::SetSessionConfigOptionRequest::Value::ValueId
|
|
|
16
16
|
# @rbs hash: Hash[String, untyped]
|
|
17
17
|
# @rbs return: ACP::Types::SetSessionConfigOptionRequest::Value::ValueId
|
|
18
18
|
def self.from_h(hash)
|
|
19
|
-
new(value:
|
|
19
|
+
new(value: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'value'), 'value'))
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
# @rbs return: Hash[String, untyped]
|
|
@@ -32,8 +32,8 @@ class ACP::Types::SetSessionConfigOptionRequest
|
|
|
32
32
|
# @rbs return: ACP::Types::SetSessionConfigOptionRequest
|
|
33
33
|
def self.from_h(hash)
|
|
34
34
|
new(
|
|
35
|
-
session_id:
|
|
36
|
-
config_id:
|
|
35
|
+
session_id: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'sessionId'), 'sessionId'),
|
|
36
|
+
config_id: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'configId'), 'configId'),
|
|
37
37
|
meta: hash['_meta'],
|
|
38
38
|
value: ACP::Types::SetSessionConfigOptionRequest::Value.from_h(hash)
|
|
39
39
|
)
|
|
@@ -21,10 +21,13 @@ class ACP::Types::SetSessionConfigOptionResponse
|
|
|
21
21
|
# @rbs hash: Hash[String, untyped]
|
|
22
22
|
# @rbs return: ACP::Types::SetSessionConfigOptionResponse
|
|
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]
|
|
@@ -26,7 +26,11 @@ class ACP::Types::SetSessionModeRequest
|
|
|
26
26
|
# @rbs hash: Hash[String, untyped]
|
|
27
27
|
# @rbs return: ACP::Types::SetSessionModeRequest
|
|
28
28
|
def self.from_h(hash)
|
|
29
|
-
new(
|
|
29
|
+
new(
|
|
30
|
+
session_id: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'sessionId'), 'sessionId'),
|
|
31
|
+
mode_id: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'modeId'), 'modeId'),
|
|
32
|
+
meta: hash['_meta']
|
|
33
|
+
)
|
|
30
34
|
end
|
|
31
35
|
|
|
32
36
|
# @rbs return: Hash[String, untyped]
|
|
@@ -21,7 +21,10 @@ class ACP::Types::StringMultiSelectItems
|
|
|
21
21
|
# @rbs hash: Hash[String, untyped]
|
|
22
22
|
# @rbs return: ACP::Types::StringMultiSelectItems
|
|
23
23
|
def self.from_h(hash)
|
|
24
|
-
|
|
24
|
+
enum = ACP::Types::Check.array(ACP::Types::Check.key(hash, 'enum'), 'enum') do |item, path|
|
|
25
|
+
ACP::Types::Check.string(item, path)
|
|
26
|
+
end
|
|
27
|
+
new(enum:, meta: hash['_meta'])
|
|
25
28
|
end
|
|
26
29
|
|
|
27
30
|
# @rbs return: Hash[String, untyped]
|
|
@@ -72,16 +72,22 @@ class ACP::Types::StringPropertySchema
|
|
|
72
72
|
# @rbs hash: Hash[String, untyped]
|
|
73
73
|
# @rbs return: ACP::Types::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
|
data/lib/acp/types/terminal.rb
CHANGED
|
@@ -21,7 +21,10 @@ class ACP::Types::Terminal
|
|
|
21
21
|
# @rbs hash: Hash[String, untyped]
|
|
22
22
|
# @rbs return: ACP::Types::Terminal
|
|
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]
|