acp-sdk 0.9.0 → 0.11.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 +32 -0
- data/README.md +20 -8
- data/lib/acp/agent_connection/client.rb +31 -13
- data/lib/acp/agent_connection/optional_method/spec.rb +42 -0
- data/lib/acp/agent_connection/optional_method.rb +36 -0
- data/lib/acp/agent_connection.rb +67 -20
- data/lib/acp/agent_process.rb +0 -13
- data/lib/acp/client_connection/streams.rb +183 -0
- data/lib/acp/client_connection.rb +280 -338
- data/lib/acp/protocol.rb +33 -0
- data/lib/acp/request_error.rb +13 -13
- data/lib/acp/transport/cancellation.rb +13 -3
- data/lib/acp/transport/reply.rb +0 -2
- data/lib/acp/transport/stderr_logger.rb +1 -2
- data/lib/acp/transport/stdio.rb +25 -26
- data/lib/acp/types/audio_content.rb +3 -46
- data/lib/acp/types/auth_method_terminal.rb +3 -59
- data/lib/acp/types/available_commands_update.rb +3 -32
- data/lib/acp/types/boolean_property_schema.rb +3 -41
- data/lib/acp/types/check.rb +210 -0
- data/lib/acp/types/config_option_update.rb +3 -32
- data/lib/acp/types/content.rb +3 -29
- data/lib/acp/types/{elicitation_url_mode → create_elicitation_request/mode/form}/scope.rb +1 -1
- data/lib/acp/types/create_elicitation_request/mode/form.rb +3 -3
- data/lib/acp/types/{elicitation_form_mode → create_elicitation_request/mode/url}/scope.rb +1 -1
- data/lib/acp/types/create_elicitation_request/mode/url.rb +3 -3
- data/lib/acp/types/current_mode_update.rb +3 -29
- data/lib/acp/types/diff.rb +3 -41
- data/lib/acp/types/elicitation_accept_action.rb +3 -26
- data/lib/acp/types/elicitation_form_mode.rb +3 -33
- data/lib/acp/types/elicitation_url_mode.rb +3 -35
- data/lib/acp/types/embedded_resource.rb +3 -44
- data/lib/acp/types/image_content.rb +3 -58
- data/lib/acp/types/integer_property_schema.rb +3 -60
- data/lib/acp/types/mcp_server_http.rb +3 -44
- data/lib/acp/types/mcp_server_sse.rb +3 -44
- data/lib/acp/types/multi_select_property_schema.rb +3 -70
- data/lib/acp/types/number_property_schema.rb +3 -60
- data/lib/acp/types/parse_error.rb +37 -0
- data/lib/acp/types/plan.rb +3 -29
- data/lib/acp/types/resource_link.rb +3 -79
- data/lib/acp/types/selected_permission_outcome.rb +3 -26
- data/lib/acp/types/session_config_boolean.rb +3 -21
- data/lib/acp/types/session_config_select.rb +3 -33
- data/lib/acp/types/session_info_update.rb +3 -42
- data/lib/acp/types/string_multi_select_items.rb +3 -29
- data/lib/acp/types/string_property_schema.rb +3 -105
- data/lib/acp/types/terminal.rb +3 -29
- data/lib/acp/types/text_content.rb +3 -40
- data/lib/acp/types/tool_call.rb +3 -115
- data/lib/acp/types/unstable/compaction_summary_chunk.rb +3 -35
- data/lib/acp/types/unstable/compaction_update.rb +3 -56
- data/lib/acp/types/unstable/idle_state_update.rb +3 -40
- data/lib/acp/types/unstable/mcp_server_acp.rb +3 -35
- data/lib/acp/types/unstable/message_mcp_response/result.rb +1 -1
- data/lib/acp/types/unstable/nes_edit_suggestion.rb +3 -61
- data/lib/acp/types/unstable/nes_jump_suggestion.rb +3 -45
- data/lib/acp/types/unstable/nes_rename_suggestion.rb +3 -51
- data/lib/acp/types/unstable/nes_search_and_replace_suggestion.rb +3 -60
- data/lib/acp/types/unstable/notice.rb +3 -41
- data/lib/acp/types/unstable/plan_file.rb +3 -35
- data/lib/acp/types/unstable/plan_items.rb +3 -38
- data/lib/acp/types/unstable/plan_markdown.rb +3 -35
- data/lib/acp/types/unstable/plan_removed.rb +3 -26
- data/lib/acp/types/unstable/plan_update.rb +3 -33
- data/lib/acp/types/unstable/requires_action_state_update.rb +3 -21
- data/lib/acp/types/unstable/running_state_update.rb +3 -21
- data/lib/acp/types/unstable/session_message.rb +3 -56
- data/lib/acp/types/unstable/session_message_chunk.rb +3 -53
- data/lib/acp/types/unstable/subagent_update.rb +3 -65
- data/lib/acp/types/unstable/unknown_state_update.rb +3 -21
- data/lib/acp/types/unstable.rb +20 -20
- data/lib/acp/types/usage_update.rb +3 -41
- data/lib/acp/types.rb +7 -246
- data/lib/acp/version.rb +1 -1
- data/sig/generated/acp/agent_connection/client.rbs +25 -15
- data/sig/generated/acp/agent_connection/optional_method/spec.rbs +32 -0
- data/sig/generated/acp/agent_connection/optional_method.rbs +3 -0
- data/sig/generated/acp/agent_connection.rbs +34 -13
- data/sig/generated/acp/agent_process.rbs +0 -13
- data/sig/generated/acp/client_connection/streams.rbs +94 -0
- data/sig/generated/acp/client_connection.rbs +128 -131
- data/sig/generated/acp/protocol.rbs +9 -0
- data/sig/generated/acp/request_error.rbs +11 -13
- data/sig/generated/acp/transport/cancellation.rbs +9 -3
- data/sig/generated/acp/transport/reply.rbs +0 -2
- data/sig/generated/acp/transport/stderr_logger.rbs +1 -2
- data/sig/generated/acp/transport/stdio.rbs +14 -22
- data/sig/generated/acp/types/audio_content.rbs +1 -27
- data/sig/generated/acp/types/auth_method_terminal.rbs +1 -35
- data/sig/generated/acp/types/available_commands_update.rbs +1 -19
- data/sig/generated/acp/types/boolean_property_schema.rbs +1 -27
- data/sig/generated/acp/types/check.rbs +115 -0
- data/sig/generated/acp/types/config_option_update.rbs +1 -19
- data/sig/generated/acp/types/content.rbs +1 -19
- data/sig/generated/acp/types/{elicitation_url_mode → create_elicitation_request/mode/form}/scope.rbs +2 -2
- data/sig/generated/acp/types/create_elicitation_request/mode/form.rbs +3 -3
- data/sig/generated/acp/types/{elicitation_form_mode → create_elicitation_request/mode/url}/scope.rbs +2 -2
- data/sig/generated/acp/types/create_elicitation_request/mode/url.rbs +3 -3
- data/sig/generated/acp/types/current_mode_update.rbs +1 -19
- data/sig/generated/acp/types/diff.rbs +1 -27
- data/sig/generated/acp/types/elicitation_accept_action.rbs +1 -15
- data/sig/generated/acp/types/elicitation_form_mode.rbs +1 -19
- data/sig/generated/acp/types/elicitation_url_mode.rbs +1 -23
- data/sig/generated/acp/types/embedded_resource.rbs +1 -23
- data/sig/generated/acp/types/image_content.rbs +1 -31
- data/sig/generated/acp/types/integer_property_schema.rbs +1 -35
- data/sig/generated/acp/types/mcp_server_http.rbs +1 -27
- data/sig/generated/acp/types/mcp_server_sse.rbs +1 -27
- data/sig/generated/acp/types/multi_select_property_schema.rbs +1 -39
- data/sig/generated/acp/types/number_property_schema.rbs +1 -35
- data/sig/generated/acp/types/parse_error.rbs +22 -0
- data/sig/generated/acp/types/plan.rbs +1 -19
- data/sig/generated/acp/types/resource_link.rbs +1 -43
- data/sig/generated/acp/types/selected_permission_outcome.rbs +1 -19
- data/sig/generated/acp/types/session_config_boolean.rbs +1 -15
- data/sig/generated/acp/types/session_config_select.rbs +1 -19
- data/sig/generated/acp/types/session_info_update.rbs +1 -23
- data/sig/generated/acp/types/string_multi_select_items.rbs +1 -19
- data/sig/generated/acp/types/string_property_schema.rbs +1 -51
- data/sig/generated/acp/types/terminal.rbs +1 -19
- data/sig/generated/acp/types/text_content.rbs +1 -23
- data/sig/generated/acp/types/tool_call.rbs +1 -51
- data/sig/generated/acp/types/unstable/compaction_summary_chunk.rbs +1 -23
- data/sig/generated/acp/types/unstable/compaction_update.rbs +1 -31
- data/sig/generated/acp/types/unstable/idle_state_update.rbs +1 -23
- data/sig/generated/acp/types/unstable/mcp_server_acp.rbs +1 -23
- data/sig/generated/acp/types/unstable/nes_edit_suggestion.rbs +1 -31
- data/sig/generated/acp/types/unstable/nes_jump_suggestion.rbs +1 -27
- data/sig/generated/acp/types/unstable/nes_rename_suggestion.rbs +1 -31
- data/sig/generated/acp/types/unstable/nes_search_and_replace_suggestion.rbs +1 -35
- data/sig/generated/acp/types/unstable/notice.rbs +1 -27
- data/sig/generated/acp/types/unstable/plan_file.rbs +1 -23
- data/sig/generated/acp/types/unstable/plan_items.rbs +1 -23
- data/sig/generated/acp/types/unstable/plan_markdown.rbs +1 -23
- data/sig/generated/acp/types/unstable/plan_removed.rbs +1 -19
- data/sig/generated/acp/types/unstable/plan_update.rbs +1 -19
- data/sig/generated/acp/types/unstable/requires_action_state_update.rbs +1 -15
- data/sig/generated/acp/types/unstable/running_state_update.rbs +1 -15
- data/sig/generated/acp/types/unstable/session_message.rbs +1 -31
- data/sig/generated/acp/types/unstable/session_message_chunk.rbs +1 -31
- data/sig/generated/acp/types/unstable/subagent_update.rbs +1 -35
- data/sig/generated/acp/types/unstable/unknown_state_update.rbs +1 -15
- data/sig/generated/acp/types/usage_update.rbs +1 -27
- data/sig/generated/acp/types.rbs +6 -143
- data/sig/manual/acp/agent_connection.rbs +28 -28
- data/sig/manual/acp/client_connection.rbs +7 -2
- data/sig/manual/acp/{agent_connection/optional_method/logout.rbs → protocol.rbs} +3 -3
- data/sig/manual/acp/transport/stdio.rbs +0 -2
- data/sig/manual/acp/transport.rbs +25 -2
- metadata +17 -29
- data/lib/acp/agent_connection/optional_method/authenticate.rb +0 -21
- data/lib/acp/agent_connection/optional_method/close_session.rb +0 -21
- data/lib/acp/agent_connection/optional_method/delete_session.rb +0 -21
- data/lib/acp/agent_connection/optional_method/list_sessions.rb +0 -21
- data/lib/acp/agent_connection/optional_method/load_session.rb +0 -21
- data/lib/acp/agent_connection/optional_method/logout.rb +0 -21
- data/lib/acp/agent_connection/optional_method/resume_session.rb +0 -21
- data/lib/acp/types/content_chunk.rb +0 -40
- data/sig/generated/acp/agent_connection/optional_method/authenticate.rbs +0 -13
- data/sig/generated/acp/agent_connection/optional_method/close_session.rbs +0 -13
- data/sig/generated/acp/agent_connection/optional_method/delete_session.rbs +0 -13
- data/sig/generated/acp/agent_connection/optional_method/list_sessions.rbs +0 -13
- data/sig/generated/acp/agent_connection/optional_method/load_session.rbs +0 -13
- data/sig/generated/acp/agent_connection/optional_method/logout.rbs +0 -13
- data/sig/generated/acp/agent_connection/optional_method/resume_session.rbs +0 -13
- data/sig/generated/acp/types/content_chunk.rbs +0 -25
- data/sig/manual/acp/agent_connection/optional_method/authenticate.rbs +0 -6
- data/sig/manual/acp/agent_connection/optional_method/close_session.rbs +0 -6
- data/sig/manual/acp/agent_connection/optional_method/delete_session.rbs +0 -6
- data/sig/manual/acp/agent_connection/optional_method/list_sessions.rbs +0 -6
- data/sig/manual/acp/agent_connection/optional_method/load_session.rbs +0 -6
- data/sig/manual/acp/agent_connection/optional_method/resume_session.rbs +0 -6
|
@@ -3,39 +3,7 @@
|
|
|
3
3
|
# Generated by bin/types from schema/schema.unstable.json. Do not edit.
|
|
4
4
|
# Unstable: not part of the ACP spec, may change or disappear at any point.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
attr_reader :plan_id #: String
|
|
6
|
+
# @rbs!
|
|
7
|
+
# class ACP::Types::Unstable::PlanFile = ACP::Types::Unstable::PlanUpdateContent::File
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
attr_reader :uri #: String
|
|
12
|
-
|
|
13
|
-
# @dynamic meta
|
|
14
|
-
attr_reader :meta #: Hash[String, untyped]?
|
|
15
|
-
|
|
16
|
-
# @rbs plan_id: String
|
|
17
|
-
# @rbs uri: String
|
|
18
|
-
# @rbs meta: Hash[String, untyped]?
|
|
19
|
-
# @rbs return: void
|
|
20
|
-
def initialize(plan_id:, uri:, meta: nil)
|
|
21
|
-
@plan_id = plan_id
|
|
22
|
-
@uri = uri
|
|
23
|
-
@meta = meta
|
|
24
|
-
freeze
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
# @rbs hash: Hash[String, untyped]
|
|
28
|
-
# @rbs return: ACP::Types::Unstable::PlanFile
|
|
29
|
-
def self.from_h(hash)
|
|
30
|
-
new(
|
|
31
|
-
plan_id: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'planId'), 'planId'),
|
|
32
|
-
uri: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'uri'), 'uri'),
|
|
33
|
-
meta: hash['_meta']
|
|
34
|
-
)
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
# @rbs return: Hash[String, untyped]
|
|
38
|
-
def to_h
|
|
39
|
-
{ 'planId' => plan_id, 'uri' => uri, '_meta' => meta }.compact
|
|
40
|
-
end
|
|
41
|
-
end
|
|
9
|
+
ACP::Types::Unstable::PlanFile = ACP::Types::Unstable::PlanUpdateContent::File
|
|
@@ -3,42 +3,7 @@
|
|
|
3
3
|
# Generated by bin/types from schema/schema.unstable.json. Do not edit.
|
|
4
4
|
# Unstable: not part of the ACP spec, may change or disappear at any point.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
attr_reader :plan_id #: String
|
|
6
|
+
# @rbs!
|
|
7
|
+
# class ACP::Types::Unstable::PlanItems = ACP::Types::Unstable::PlanUpdateContent::Items
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
attr_reader :entries #: Array[ACP::Types::PlanEntry]
|
|
12
|
-
|
|
13
|
-
# @dynamic meta
|
|
14
|
-
attr_reader :meta #: Hash[String, untyped]?
|
|
15
|
-
|
|
16
|
-
# @rbs plan_id: String
|
|
17
|
-
# @rbs entries: Array[ACP::Types::PlanEntry]
|
|
18
|
-
# @rbs meta: Hash[String, untyped]?
|
|
19
|
-
# @rbs return: void
|
|
20
|
-
def initialize(plan_id:, entries:, meta: nil)
|
|
21
|
-
@plan_id = plan_id
|
|
22
|
-
@entries = entries
|
|
23
|
-
@meta = meta
|
|
24
|
-
freeze
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
# @rbs hash: Hash[String, untyped]
|
|
28
|
-
# @rbs return: ACP::Types::Unstable::PlanItems
|
|
29
|
-
def self.from_h(hash)
|
|
30
|
-
entries = ACP::Types::Check.array(ACP::Types::Check.key(hash, 'entries'), 'entries') do |item, path|
|
|
31
|
-
ACP::Types::Check.object(item, path, ACP::Types::PlanEntry)
|
|
32
|
-
end
|
|
33
|
-
new(
|
|
34
|
-
plan_id: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'planId'), 'planId'),
|
|
35
|
-
entries:,
|
|
36
|
-
meta: hash['_meta']
|
|
37
|
-
)
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
# @rbs return: Hash[String, untyped]
|
|
41
|
-
def to_h
|
|
42
|
-
{ 'planId' => plan_id, 'entries' => entries.map(&:to_h), '_meta' => meta }.compact
|
|
43
|
-
end
|
|
44
|
-
end
|
|
9
|
+
ACP::Types::Unstable::PlanItems = ACP::Types::Unstable::PlanUpdateContent::Items
|
|
@@ -3,39 +3,7 @@
|
|
|
3
3
|
# Generated by bin/types from schema/schema.unstable.json. Do not edit.
|
|
4
4
|
# Unstable: not part of the ACP spec, may change or disappear at any point.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
attr_reader :plan_id #: String
|
|
6
|
+
# @rbs!
|
|
7
|
+
# class ACP::Types::Unstable::PlanMarkdown = ACP::Types::Unstable::PlanUpdateContent::Markdown
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
attr_reader :content #: String
|
|
12
|
-
|
|
13
|
-
# @dynamic meta
|
|
14
|
-
attr_reader :meta #: Hash[String, untyped]?
|
|
15
|
-
|
|
16
|
-
# @rbs plan_id: String
|
|
17
|
-
# @rbs content: String
|
|
18
|
-
# @rbs meta: Hash[String, untyped]?
|
|
19
|
-
# @rbs return: void
|
|
20
|
-
def initialize(plan_id:, content:, meta: nil)
|
|
21
|
-
@plan_id = plan_id
|
|
22
|
-
@content = content
|
|
23
|
-
@meta = meta
|
|
24
|
-
freeze
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
# @rbs hash: Hash[String, untyped]
|
|
28
|
-
# @rbs return: ACP::Types::Unstable::PlanMarkdown
|
|
29
|
-
def self.from_h(hash)
|
|
30
|
-
new(
|
|
31
|
-
plan_id: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'planId'), 'planId'),
|
|
32
|
-
content: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'content'), 'content'),
|
|
33
|
-
meta: hash['_meta']
|
|
34
|
-
)
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
# @rbs return: Hash[String, untyped]
|
|
38
|
-
def to_h
|
|
39
|
-
{ 'planId' => plan_id, 'content' => content, '_meta' => meta }.compact
|
|
40
|
-
end
|
|
41
|
-
end
|
|
9
|
+
ACP::Types::Unstable::PlanMarkdown = ACP::Types::Unstable::PlanUpdateContent::Markdown
|
|
@@ -3,30 +3,7 @@
|
|
|
3
3
|
# Generated by bin/types from schema/schema.unstable.json. Do not edit.
|
|
4
4
|
# Unstable: not part of the ACP spec, may change or disappear at any point.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
attr_reader :plan_id #: String
|
|
6
|
+
# @rbs!
|
|
7
|
+
# class ACP::Types::Unstable::PlanRemoved = ACP::Types::Unstable::SessionUpdate::PlanRemoved
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
attr_reader :meta #: Hash[String, untyped]?
|
|
12
|
-
|
|
13
|
-
# @rbs plan_id: String
|
|
14
|
-
# @rbs meta: Hash[String, untyped]?
|
|
15
|
-
# @rbs return: void
|
|
16
|
-
def initialize(plan_id:, meta: nil)
|
|
17
|
-
@plan_id = plan_id
|
|
18
|
-
@meta = meta
|
|
19
|
-
freeze
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
# @rbs hash: Hash[String, untyped]
|
|
23
|
-
# @rbs return: ACP::Types::Unstable::PlanRemoved
|
|
24
|
-
def self.from_h(hash)
|
|
25
|
-
new(plan_id: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'planId'), 'planId'), meta: hash['_meta'])
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
# @rbs return: Hash[String, untyped]
|
|
29
|
-
def to_h
|
|
30
|
-
{ 'planId' => plan_id, '_meta' => meta }.compact
|
|
31
|
-
end
|
|
32
|
-
end
|
|
9
|
+
ACP::Types::Unstable::PlanRemoved = ACP::Types::Unstable::SessionUpdate::PlanRemoved
|
|
@@ -3,37 +3,7 @@
|
|
|
3
3
|
# Generated by bin/types from schema/schema.unstable.json. Do not edit.
|
|
4
4
|
# Unstable: not part of the ACP spec, may change or disappear at any point.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
attr_reader :plan #: ACP::Types::Unstable::PlanUpdateContent::t
|
|
6
|
+
# @rbs!
|
|
7
|
+
# class ACP::Types::Unstable::PlanUpdate = ACP::Types::Unstable::SessionUpdate::PlanUpdate
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
attr_reader :meta #: Hash[String, untyped]?
|
|
12
|
-
|
|
13
|
-
# @rbs plan: ACP::Types::Unstable::PlanUpdateContent::t
|
|
14
|
-
# @rbs meta: Hash[String, untyped]?
|
|
15
|
-
# @rbs return: void
|
|
16
|
-
def initialize(plan:, meta: nil)
|
|
17
|
-
@plan = plan
|
|
18
|
-
@meta = meta
|
|
19
|
-
freeze
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
# @rbs hash: Hash[String, untyped]
|
|
23
|
-
# @rbs return: ACP::Types::Unstable::PlanUpdate
|
|
24
|
-
def self.from_h(hash)
|
|
25
|
-
new(
|
|
26
|
-
plan: ACP::Types::Check.object(
|
|
27
|
-
ACP::Types::Check.key(hash, 'plan'),
|
|
28
|
-
'plan',
|
|
29
|
-
ACP::Types::Unstable::PlanUpdateContent
|
|
30
|
-
),
|
|
31
|
-
meta: hash['_meta']
|
|
32
|
-
)
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
# @rbs return: Hash[String, untyped]
|
|
36
|
-
def to_h
|
|
37
|
-
{ 'plan' => plan.to_h, '_meta' => meta }.compact
|
|
38
|
-
end
|
|
39
|
-
end
|
|
9
|
+
ACP::Types::Unstable::PlanUpdate = ACP::Types::Unstable::SessionUpdate::PlanUpdate
|
|
@@ -3,25 +3,7 @@
|
|
|
3
3
|
# Generated by bin/types from schema/schema.unstable.json. Do not edit.
|
|
4
4
|
# Unstable: not part of the ACP spec, may change or disappear at any point.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
attr_reader :meta #: Hash[String, untyped]?
|
|
6
|
+
# @rbs!
|
|
7
|
+
# class ACP::Types::Unstable::RequiresActionStateUpdate = ACP::Types::Unstable::StateUpdate::RequiresAction
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
# @rbs return: void
|
|
12
|
-
def initialize(meta: nil)
|
|
13
|
-
@meta = meta
|
|
14
|
-
freeze
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
# @rbs hash: Hash[String, untyped]
|
|
18
|
-
# @rbs return: ACP::Types::Unstable::RequiresActionStateUpdate
|
|
19
|
-
def self.from_h(hash)
|
|
20
|
-
new(meta: hash['_meta'])
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
# @rbs return: Hash[String, untyped]
|
|
24
|
-
def to_h
|
|
25
|
-
{ '_meta' => meta }.compact
|
|
26
|
-
end
|
|
27
|
-
end
|
|
9
|
+
ACP::Types::Unstable::RequiresActionStateUpdate = ACP::Types::Unstable::StateUpdate::RequiresAction
|
|
@@ -3,25 +3,7 @@
|
|
|
3
3
|
# Generated by bin/types from schema/schema.unstable.json. Do not edit.
|
|
4
4
|
# Unstable: not part of the ACP spec, may change or disappear at any point.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
attr_reader :meta #: Hash[String, untyped]?
|
|
6
|
+
# @rbs!
|
|
7
|
+
# class ACP::Types::Unstable::RunningStateUpdate = ACP::Types::Unstable::StateUpdate::Running
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
# @rbs return: void
|
|
12
|
-
def initialize(meta: nil)
|
|
13
|
-
@meta = meta
|
|
14
|
-
freeze
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
# @rbs hash: Hash[String, untyped]
|
|
18
|
-
# @rbs return: ACP::Types::Unstable::RunningStateUpdate
|
|
19
|
-
def self.from_h(hash)
|
|
20
|
-
new(meta: hash['_meta'])
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
# @rbs return: Hash[String, untyped]
|
|
24
|
-
def to_h
|
|
25
|
-
{ '_meta' => meta }.compact
|
|
26
|
-
end
|
|
27
|
-
end
|
|
9
|
+
ACP::Types::Unstable::RunningStateUpdate = ACP::Types::Unstable::StateUpdate::Running
|
|
@@ -3,60 +3,7 @@
|
|
|
3
3
|
# Generated by bin/types from schema/schema.unstable.json. Do not edit.
|
|
4
4
|
# Unstable: not part of the ACP spec, may change or disappear at any point.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
attr_reader :message_id #: String
|
|
6
|
+
# @rbs!
|
|
7
|
+
# class ACP::Types::Unstable::SessionMessage = ACP::Types::Unstable::SessionUpdate::SessionMessage
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
attr_reader :sender_session_id #: String?
|
|
12
|
-
|
|
13
|
-
# @dynamic recipient_session_id
|
|
14
|
-
attr_reader :recipient_session_id #: String?
|
|
15
|
-
|
|
16
|
-
# @dynamic content
|
|
17
|
-
attr_reader :content #: Array[ACP::Types::ContentBlock::t]?
|
|
18
|
-
|
|
19
|
-
# @dynamic meta
|
|
20
|
-
attr_reader :meta #: Hash[String, untyped]?
|
|
21
|
-
|
|
22
|
-
# @rbs message_id: String
|
|
23
|
-
# @rbs sender_session_id: String?
|
|
24
|
-
# @rbs recipient_session_id: String?
|
|
25
|
-
# @rbs content: Array[ACP::Types::ContentBlock::t]?
|
|
26
|
-
# @rbs meta: Hash[String, untyped]?
|
|
27
|
-
# @rbs return: void
|
|
28
|
-
def initialize(message_id:, sender_session_id: nil, recipient_session_id: nil, content: nil, meta: nil)
|
|
29
|
-
@message_id = message_id
|
|
30
|
-
@sender_session_id = sender_session_id
|
|
31
|
-
@recipient_session_id = recipient_session_id
|
|
32
|
-
@content = content
|
|
33
|
-
@meta = meta
|
|
34
|
-
freeze
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
# @rbs hash: Hash[String, untyped]
|
|
38
|
-
# @rbs return: ACP::Types::Unstable::SessionMessage
|
|
39
|
-
def self.from_h(hash)
|
|
40
|
-
content = ACP::Types::Check.array(hash['content'], 'content', allow_nil: true) do |item, path|
|
|
41
|
-
ACP::Types::Check.object(item, path, ACP::Types::ContentBlock)
|
|
42
|
-
end
|
|
43
|
-
new(
|
|
44
|
-
message_id: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'messageId'), 'messageId'),
|
|
45
|
-
sender_session_id: ACP::Types::Check.string(hash['senderSessionId'], 'senderSessionId', allow_nil: true),
|
|
46
|
-
recipient_session_id: ACP::Types::Check.string(hash['recipientSessionId'], 'recipientSessionId', allow_nil: true),
|
|
47
|
-
content:,
|
|
48
|
-
meta: hash['_meta']
|
|
49
|
-
)
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
# @rbs return: Hash[String, untyped]
|
|
53
|
-
def to_h
|
|
54
|
-
{
|
|
55
|
-
'messageId' => message_id,
|
|
56
|
-
'senderSessionId' => sender_session_id,
|
|
57
|
-
'recipientSessionId' => recipient_session_id,
|
|
58
|
-
'content' => content&.map(&:to_h),
|
|
59
|
-
'_meta' => meta
|
|
60
|
-
}.compact
|
|
61
|
-
end
|
|
62
|
-
end
|
|
9
|
+
ACP::Types::Unstable::SessionMessage = ACP::Types::Unstable::SessionUpdate::SessionMessage
|
|
@@ -3,57 +3,7 @@
|
|
|
3
3
|
# Generated by bin/types from schema/schema.unstable.json. Do not edit.
|
|
4
4
|
# Unstable: not part of the ACP spec, may change or disappear at any point.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
attr_reader :message_id #: String
|
|
6
|
+
# @rbs!
|
|
7
|
+
# class ACP::Types::Unstable::SessionMessageChunk = ACP::Types::Unstable::SessionUpdate::SessionMessageChunk
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
attr_reader :sender_session_id #: String?
|
|
12
|
-
|
|
13
|
-
# @dynamic recipient_session_id
|
|
14
|
-
attr_reader :recipient_session_id #: String?
|
|
15
|
-
|
|
16
|
-
# @dynamic content
|
|
17
|
-
attr_reader :content #: ACP::Types::ContentBlock::t
|
|
18
|
-
|
|
19
|
-
# @dynamic meta
|
|
20
|
-
attr_reader :meta #: Hash[String, untyped]?
|
|
21
|
-
|
|
22
|
-
# @rbs message_id: String
|
|
23
|
-
# @rbs sender_session_id: String?
|
|
24
|
-
# @rbs recipient_session_id: String?
|
|
25
|
-
# @rbs content: ACP::Types::ContentBlock::t
|
|
26
|
-
# @rbs meta: Hash[String, untyped]?
|
|
27
|
-
# @rbs return: void
|
|
28
|
-
def initialize(message_id:, content:, sender_session_id: nil, recipient_session_id: nil, meta: nil)
|
|
29
|
-
@message_id = message_id
|
|
30
|
-
@sender_session_id = sender_session_id
|
|
31
|
-
@recipient_session_id = recipient_session_id
|
|
32
|
-
@content = content
|
|
33
|
-
@meta = meta
|
|
34
|
-
freeze
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
# @rbs hash: Hash[String, untyped]
|
|
38
|
-
# @rbs return: ACP::Types::Unstable::SessionMessageChunk
|
|
39
|
-
def self.from_h(hash)
|
|
40
|
-
new(
|
|
41
|
-
message_id: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'messageId'), 'messageId'),
|
|
42
|
-
sender_session_id: ACP::Types::Check.string(hash['senderSessionId'], 'senderSessionId', allow_nil: true),
|
|
43
|
-
recipient_session_id: ACP::Types::Check.string(hash['recipientSessionId'], 'recipientSessionId', allow_nil: true),
|
|
44
|
-
content: ACP::Types::Check.object(ACP::Types::Check.key(hash, 'content'), 'content', ACP::Types::ContentBlock),
|
|
45
|
-
meta: hash['_meta']
|
|
46
|
-
)
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
# @rbs return: Hash[String, untyped]
|
|
50
|
-
def to_h
|
|
51
|
-
{
|
|
52
|
-
'messageId' => message_id,
|
|
53
|
-
'content' => content.to_h,
|
|
54
|
-
'senderSessionId' => sender_session_id,
|
|
55
|
-
'recipientSessionId' => recipient_session_id,
|
|
56
|
-
'_meta' => meta
|
|
57
|
-
}.compact
|
|
58
|
-
end
|
|
59
|
-
end
|
|
9
|
+
ACP::Types::Unstable::SessionMessageChunk = ACP::Types::Unstable::SessionUpdate::SessionMessageChunk
|
|
@@ -3,69 +3,7 @@
|
|
|
3
3
|
# Generated by bin/types from schema/schema.unstable.json. Do not edit.
|
|
4
4
|
# Unstable: not part of the ACP spec, may change or disappear at any point.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
attr_reader :session_id #: String
|
|
6
|
+
# @rbs!
|
|
7
|
+
# class ACP::Types::Unstable::SubagentUpdate = ACP::Types::Unstable::SessionUpdate::SubagentUpdate
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
attr_reader :title #: String?
|
|
12
|
-
|
|
13
|
-
# @dynamic description
|
|
14
|
-
attr_reader :description #: String?
|
|
15
|
-
|
|
16
|
-
# @dynamic capabilities
|
|
17
|
-
attr_reader :capabilities #: ACP::Types::Unstable::SubagentSessionCapabilities?
|
|
18
|
-
|
|
19
|
-
# @dynamic state
|
|
20
|
-
attr_reader :state #: ACP::Types::Unstable::StateUpdate::t?
|
|
21
|
-
|
|
22
|
-
# @dynamic meta
|
|
23
|
-
attr_reader :meta #: Hash[String, untyped]?
|
|
24
|
-
|
|
25
|
-
# @rbs session_id: String
|
|
26
|
-
# @rbs title: String?
|
|
27
|
-
# @rbs description: String?
|
|
28
|
-
# @rbs capabilities: ACP::Types::Unstable::SubagentSessionCapabilities?
|
|
29
|
-
# @rbs state: ACP::Types::Unstable::StateUpdate::t?
|
|
30
|
-
# @rbs meta: Hash[String, untyped]?
|
|
31
|
-
# @rbs return: void
|
|
32
|
-
def initialize(session_id:, title: nil, description: nil, capabilities: nil, state: nil, meta: nil)
|
|
33
|
-
@session_id = session_id
|
|
34
|
-
@title = title
|
|
35
|
-
@description = description
|
|
36
|
-
@capabilities = capabilities
|
|
37
|
-
@state = state
|
|
38
|
-
@meta = meta
|
|
39
|
-
freeze
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
# @rbs hash: Hash[String, untyped]
|
|
43
|
-
# @rbs return: ACP::Types::Unstable::SubagentUpdate
|
|
44
|
-
def self.from_h(hash)
|
|
45
|
-
new(
|
|
46
|
-
session_id: ACP::Types::Check.string(ACP::Types::Check.key(hash, 'sessionId'), 'sessionId'),
|
|
47
|
-
title: ACP::Types::Check.string(hash['title'], 'title', allow_nil: true),
|
|
48
|
-
description: ACP::Types::Check.string(hash['description'], 'description', allow_nil: true),
|
|
49
|
-
capabilities: ACP::Types::Check.object(
|
|
50
|
-
hash['capabilities'],
|
|
51
|
-
'capabilities',
|
|
52
|
-
ACP::Types::Unstable::SubagentSessionCapabilities,
|
|
53
|
-
allow_nil: true
|
|
54
|
-
),
|
|
55
|
-
state: ACP::Types::Check.object(hash['state'], 'state', ACP::Types::Unstable::StateUpdate, allow_nil: true),
|
|
56
|
-
meta: hash['_meta']
|
|
57
|
-
)
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
# @rbs return: Hash[String, untyped]
|
|
61
|
-
def to_h
|
|
62
|
-
{
|
|
63
|
-
'sessionId' => session_id,
|
|
64
|
-
'title' => title,
|
|
65
|
-
'description' => description,
|
|
66
|
-
'capabilities' => capabilities&.to_h,
|
|
67
|
-
'state' => state&.to_h,
|
|
68
|
-
'_meta' => meta
|
|
69
|
-
}.compact
|
|
70
|
-
end
|
|
71
|
-
end
|
|
9
|
+
ACP::Types::Unstable::SubagentUpdate = ACP::Types::Unstable::SessionUpdate::SubagentUpdate
|
|
@@ -3,25 +3,7 @@
|
|
|
3
3
|
# Generated by bin/types from schema/schema.unstable.json. Do not edit.
|
|
4
4
|
# Unstable: not part of the ACP spec, may change or disappear at any point.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
attr_reader :meta #: Hash[String, untyped]?
|
|
6
|
+
# @rbs!
|
|
7
|
+
# class ACP::Types::Unstable::UnknownStateUpdate = ACP::Types::Unstable::StateUpdate::Unknown
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
# @rbs return: void
|
|
12
|
-
def initialize(meta: nil)
|
|
13
|
-
@meta = meta
|
|
14
|
-
freeze
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
# @rbs hash: Hash[String, untyped]
|
|
18
|
-
# @rbs return: ACP::Types::Unstable::UnknownStateUpdate
|
|
19
|
-
def self.from_h(hash)
|
|
20
|
-
new(meta: hash['_meta'])
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
# @rbs return: Hash[String, untyped]
|
|
24
|
-
def to_h
|
|
25
|
-
{ '_meta' => meta }.compact
|
|
26
|
-
end
|
|
27
|
-
end
|
|
9
|
+
ACP::Types::Unstable::UnknownStateUpdate = ACP::Types::Unstable::StateUpdate::Unknown
|
data/lib/acp/types/unstable.rb
CHANGED
|
@@ -19,8 +19,6 @@ require_relative 'unstable/client_session_capabilities'
|
|
|
19
19
|
require_relative 'unstable/close_nes_request'
|
|
20
20
|
require_relative 'unstable/close_nes_response'
|
|
21
21
|
require_relative 'unstable/compaction_status'
|
|
22
|
-
require_relative 'unstable/compaction_summary_chunk'
|
|
23
|
-
require_relative 'unstable/compaction_update'
|
|
24
22
|
require_relative 'unstable/did_change_document_notification'
|
|
25
23
|
require_relative 'unstable/did_close_document_notification'
|
|
26
24
|
require_relative 'unstable/did_focus_document_notification'
|
|
@@ -30,7 +28,6 @@ require_relative 'unstable/disable_provider_request'
|
|
|
30
28
|
require_relative 'unstable/disable_provider_response'
|
|
31
29
|
require_relative 'unstable/fork_session_request'
|
|
32
30
|
require_relative 'unstable/fork_session_response'
|
|
33
|
-
require_relative 'unstable/idle_state_update'
|
|
34
31
|
require_relative 'unstable/initialize_response'
|
|
35
32
|
require_relative 'unstable/list_providers_request'
|
|
36
33
|
require_relative 'unstable/list_providers_response'
|
|
@@ -41,7 +38,6 @@ require_relative 'unstable/mcp_server'
|
|
|
41
38
|
require_relative 'unstable/mcp_server/acp'
|
|
42
39
|
require_relative 'unstable/mcp_server/http'
|
|
43
40
|
require_relative 'unstable/mcp_server/sse'
|
|
44
|
-
require_relative 'unstable/mcp_server_acp'
|
|
45
41
|
require_relative 'unstable/message_mcp_notification'
|
|
46
42
|
require_relative 'unstable/message_mcp_request'
|
|
47
43
|
require_relative 'unstable/message_mcp_response'
|
|
@@ -60,11 +56,9 @@ require_relative 'unstable/nes_document_did_save_capabilities'
|
|
|
60
56
|
require_relative 'unstable/nes_document_event_capabilities'
|
|
61
57
|
require_relative 'unstable/nes_edit_history_capabilities'
|
|
62
58
|
require_relative 'unstable/nes_edit_history_entry'
|
|
63
|
-
require_relative 'unstable/nes_edit_suggestion'
|
|
64
59
|
require_relative 'unstable/nes_event_capabilities'
|
|
65
60
|
require_relative 'unstable/nes_excerpt'
|
|
66
61
|
require_relative 'unstable/nes_jump_capabilities'
|
|
67
|
-
require_relative 'unstable/nes_jump_suggestion'
|
|
68
62
|
require_relative 'unstable/nes_open_file'
|
|
69
63
|
require_relative 'unstable/nes_open_files_capabilities'
|
|
70
64
|
require_relative 'unstable/nes_recent_file'
|
|
@@ -73,10 +67,8 @@ require_relative 'unstable/nes_reject_reason'
|
|
|
73
67
|
require_relative 'unstable/nes_related_snippet'
|
|
74
68
|
require_relative 'unstable/nes_related_snippets_capabilities'
|
|
75
69
|
require_relative 'unstable/nes_rename_capabilities'
|
|
76
|
-
require_relative 'unstable/nes_rename_suggestion'
|
|
77
70
|
require_relative 'unstable/nes_repository'
|
|
78
71
|
require_relative 'unstable/nes_search_and_replace_capabilities'
|
|
79
|
-
require_relative 'unstable/nes_search_and_replace_suggestion'
|
|
80
72
|
require_relative 'unstable/nes_suggest_context'
|
|
81
73
|
require_relative 'unstable/nes_suggestion'
|
|
82
74
|
require_relative 'unstable/nes_suggestion/edit'
|
|
@@ -87,14 +79,8 @@ require_relative 'unstable/nes_text_edit'
|
|
|
87
79
|
require_relative 'unstable/nes_trigger_kind'
|
|
88
80
|
require_relative 'unstable/nes_user_action'
|
|
89
81
|
require_relative 'unstable/nes_user_actions_capabilities'
|
|
90
|
-
require_relative 'unstable/notice'
|
|
91
82
|
require_relative 'unstable/notice_severity'
|
|
92
83
|
require_relative 'unstable/plan_capabilities'
|
|
93
|
-
require_relative 'unstable/plan_file'
|
|
94
|
-
require_relative 'unstable/plan_items'
|
|
95
|
-
require_relative 'unstable/plan_markdown'
|
|
96
|
-
require_relative 'unstable/plan_removed'
|
|
97
|
-
require_relative 'unstable/plan_update'
|
|
98
84
|
require_relative 'unstable/plan_update_content'
|
|
99
85
|
require_relative 'unstable/plan_update_content/file'
|
|
100
86
|
require_relative 'unstable/plan_update_content/items'
|
|
@@ -107,13 +93,9 @@ require_relative 'unstable/provider_info'
|
|
|
107
93
|
require_relative 'unstable/providers_capabilities'
|
|
108
94
|
require_relative 'unstable/range'
|
|
109
95
|
require_relative 'unstable/reject_nes_notification'
|
|
110
|
-
require_relative 'unstable/requires_action_state_update'
|
|
111
|
-
require_relative 'unstable/running_state_update'
|
|
112
96
|
require_relative 'unstable/session_cancel_capabilities'
|
|
113
97
|
require_relative 'unstable/session_capabilities'
|
|
114
98
|
require_relative 'unstable/session_fork_capabilities'
|
|
115
|
-
require_relative 'unstable/session_message'
|
|
116
|
-
require_relative 'unstable/session_message_chunk'
|
|
117
99
|
require_relative 'unstable/session_update'
|
|
118
100
|
require_relative 'unstable/session_update/agent_message_chunk'
|
|
119
101
|
require_relative 'unstable/session_update/agent_thought_chunk'
|
|
@@ -145,11 +127,29 @@ require_relative 'unstable/state_update/running'
|
|
|
145
127
|
require_relative 'unstable/state_update/unknown'
|
|
146
128
|
require_relative 'unstable/subagent_capabilities'
|
|
147
129
|
require_relative 'unstable/subagent_session_capabilities'
|
|
148
|
-
require_relative 'unstable/subagent_update'
|
|
149
130
|
require_relative 'unstable/suggest_nes_request'
|
|
150
131
|
require_relative 'unstable/suggest_nes_response'
|
|
151
132
|
require_relative 'unstable/text_document_content_change_event'
|
|
152
133
|
require_relative 'unstable/text_document_sync_kind'
|
|
153
|
-
require_relative 'unstable/unknown_state_update'
|
|
154
134
|
require_relative 'unstable/usage'
|
|
155
135
|
require_relative 'unstable/workspace_folder'
|
|
136
|
+
require_relative 'unstable/compaction_summary_chunk'
|
|
137
|
+
require_relative 'unstable/compaction_update'
|
|
138
|
+
require_relative 'unstable/idle_state_update'
|
|
139
|
+
require_relative 'unstable/mcp_server_acp'
|
|
140
|
+
require_relative 'unstable/nes_edit_suggestion'
|
|
141
|
+
require_relative 'unstable/nes_jump_suggestion'
|
|
142
|
+
require_relative 'unstable/nes_rename_suggestion'
|
|
143
|
+
require_relative 'unstable/nes_search_and_replace_suggestion'
|
|
144
|
+
require_relative 'unstable/notice'
|
|
145
|
+
require_relative 'unstable/plan_file'
|
|
146
|
+
require_relative 'unstable/plan_items'
|
|
147
|
+
require_relative 'unstable/plan_markdown'
|
|
148
|
+
require_relative 'unstable/plan_removed'
|
|
149
|
+
require_relative 'unstable/plan_update'
|
|
150
|
+
require_relative 'unstable/requires_action_state_update'
|
|
151
|
+
require_relative 'unstable/running_state_update'
|
|
152
|
+
require_relative 'unstable/session_message'
|
|
153
|
+
require_relative 'unstable/session_message_chunk'
|
|
154
|
+
require_relative 'unstable/subagent_update'
|
|
155
|
+
require_relative 'unstable/unknown_state_update'
|
|
@@ -2,45 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Generated by bin/types from schema/schema.json. Do not edit.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
attr_reader :used #: Integer
|
|
5
|
+
# @rbs!
|
|
6
|
+
# class ACP::Types::UsageUpdate = ACP::Types::SessionUpdate::UsageUpdate
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
attr_reader :size #: Integer
|
|
11
|
-
|
|
12
|
-
# @dynamic cost
|
|
13
|
-
attr_reader :cost #: ACP::Types::Cost?
|
|
14
|
-
|
|
15
|
-
# @dynamic meta
|
|
16
|
-
attr_reader :meta #: Hash[String, untyped]?
|
|
17
|
-
|
|
18
|
-
# @rbs used: Integer
|
|
19
|
-
# @rbs size: Integer
|
|
20
|
-
# @rbs cost: ACP::Types::Cost?
|
|
21
|
-
# @rbs meta: Hash[String, untyped]?
|
|
22
|
-
# @rbs return: void
|
|
23
|
-
def initialize(used:, size:, cost: nil, meta: nil)
|
|
24
|
-
@used = used
|
|
25
|
-
@size = size
|
|
26
|
-
@cost = cost
|
|
27
|
-
@meta = meta
|
|
28
|
-
freeze
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
# @rbs hash: Hash[String, untyped]
|
|
32
|
-
# @rbs return: ACP::Types::UsageUpdate
|
|
33
|
-
def self.from_h(hash)
|
|
34
|
-
new(
|
|
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
|
-
meta: hash['_meta']
|
|
39
|
-
)
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
# @rbs return: Hash[String, untyped]
|
|
43
|
-
def to_h
|
|
44
|
-
{ 'used' => used, 'size' => size, 'cost' => cost&.to_h, '_meta' => meta }.compact
|
|
45
|
-
end
|
|
46
|
-
end
|
|
8
|
+
ACP::Types::UsageUpdate = ACP::Types::SessionUpdate::UsageUpdate
|