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.
Files changed (174) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +32 -0
  3. data/README.md +20 -8
  4. data/lib/acp/agent_connection/client.rb +31 -13
  5. data/lib/acp/agent_connection/optional_method/spec.rb +42 -0
  6. data/lib/acp/agent_connection/optional_method.rb +36 -0
  7. data/lib/acp/agent_connection.rb +67 -20
  8. data/lib/acp/agent_process.rb +0 -13
  9. data/lib/acp/client_connection/streams.rb +183 -0
  10. data/lib/acp/client_connection.rb +280 -338
  11. data/lib/acp/protocol.rb +33 -0
  12. data/lib/acp/request_error.rb +13 -13
  13. data/lib/acp/transport/cancellation.rb +13 -3
  14. data/lib/acp/transport/reply.rb +0 -2
  15. data/lib/acp/transport/stderr_logger.rb +1 -2
  16. data/lib/acp/transport/stdio.rb +25 -26
  17. data/lib/acp/types/audio_content.rb +3 -46
  18. data/lib/acp/types/auth_method_terminal.rb +3 -59
  19. data/lib/acp/types/available_commands_update.rb +3 -32
  20. data/lib/acp/types/boolean_property_schema.rb +3 -41
  21. data/lib/acp/types/check.rb +210 -0
  22. data/lib/acp/types/config_option_update.rb +3 -32
  23. data/lib/acp/types/content.rb +3 -29
  24. data/lib/acp/types/{elicitation_url_mode → create_elicitation_request/mode/form}/scope.rb +1 -1
  25. data/lib/acp/types/create_elicitation_request/mode/form.rb +3 -3
  26. data/lib/acp/types/{elicitation_form_mode → create_elicitation_request/mode/url}/scope.rb +1 -1
  27. data/lib/acp/types/create_elicitation_request/mode/url.rb +3 -3
  28. data/lib/acp/types/current_mode_update.rb +3 -29
  29. data/lib/acp/types/diff.rb +3 -41
  30. data/lib/acp/types/elicitation_accept_action.rb +3 -26
  31. data/lib/acp/types/elicitation_form_mode.rb +3 -33
  32. data/lib/acp/types/elicitation_url_mode.rb +3 -35
  33. data/lib/acp/types/embedded_resource.rb +3 -44
  34. data/lib/acp/types/image_content.rb +3 -58
  35. data/lib/acp/types/integer_property_schema.rb +3 -60
  36. data/lib/acp/types/mcp_server_http.rb +3 -44
  37. data/lib/acp/types/mcp_server_sse.rb +3 -44
  38. data/lib/acp/types/multi_select_property_schema.rb +3 -70
  39. data/lib/acp/types/number_property_schema.rb +3 -60
  40. data/lib/acp/types/parse_error.rb +37 -0
  41. data/lib/acp/types/plan.rb +3 -29
  42. data/lib/acp/types/resource_link.rb +3 -79
  43. data/lib/acp/types/selected_permission_outcome.rb +3 -26
  44. data/lib/acp/types/session_config_boolean.rb +3 -21
  45. data/lib/acp/types/session_config_select.rb +3 -33
  46. data/lib/acp/types/session_info_update.rb +3 -42
  47. data/lib/acp/types/string_multi_select_items.rb +3 -29
  48. data/lib/acp/types/string_property_schema.rb +3 -105
  49. data/lib/acp/types/terminal.rb +3 -29
  50. data/lib/acp/types/text_content.rb +3 -40
  51. data/lib/acp/types/tool_call.rb +3 -115
  52. data/lib/acp/types/unstable/compaction_summary_chunk.rb +3 -35
  53. data/lib/acp/types/unstable/compaction_update.rb +3 -56
  54. data/lib/acp/types/unstable/idle_state_update.rb +3 -40
  55. data/lib/acp/types/unstable/mcp_server_acp.rb +3 -35
  56. data/lib/acp/types/unstable/message_mcp_response/result.rb +1 -1
  57. data/lib/acp/types/unstable/nes_edit_suggestion.rb +3 -61
  58. data/lib/acp/types/unstable/nes_jump_suggestion.rb +3 -45
  59. data/lib/acp/types/unstable/nes_rename_suggestion.rb +3 -51
  60. data/lib/acp/types/unstable/nes_search_and_replace_suggestion.rb +3 -60
  61. data/lib/acp/types/unstable/notice.rb +3 -41
  62. data/lib/acp/types/unstable/plan_file.rb +3 -35
  63. data/lib/acp/types/unstable/plan_items.rb +3 -38
  64. data/lib/acp/types/unstable/plan_markdown.rb +3 -35
  65. data/lib/acp/types/unstable/plan_removed.rb +3 -26
  66. data/lib/acp/types/unstable/plan_update.rb +3 -33
  67. data/lib/acp/types/unstable/requires_action_state_update.rb +3 -21
  68. data/lib/acp/types/unstable/running_state_update.rb +3 -21
  69. data/lib/acp/types/unstable/session_message.rb +3 -56
  70. data/lib/acp/types/unstable/session_message_chunk.rb +3 -53
  71. data/lib/acp/types/unstable/subagent_update.rb +3 -65
  72. data/lib/acp/types/unstable/unknown_state_update.rb +3 -21
  73. data/lib/acp/types/unstable.rb +20 -20
  74. data/lib/acp/types/usage_update.rb +3 -41
  75. data/lib/acp/types.rb +7 -246
  76. data/lib/acp/version.rb +1 -1
  77. data/sig/generated/acp/agent_connection/client.rbs +25 -15
  78. data/sig/generated/acp/agent_connection/optional_method/spec.rbs +32 -0
  79. data/sig/generated/acp/agent_connection/optional_method.rbs +3 -0
  80. data/sig/generated/acp/agent_connection.rbs +34 -13
  81. data/sig/generated/acp/agent_process.rbs +0 -13
  82. data/sig/generated/acp/client_connection/streams.rbs +94 -0
  83. data/sig/generated/acp/client_connection.rbs +128 -131
  84. data/sig/generated/acp/protocol.rbs +9 -0
  85. data/sig/generated/acp/request_error.rbs +11 -13
  86. data/sig/generated/acp/transport/cancellation.rbs +9 -3
  87. data/sig/generated/acp/transport/reply.rbs +0 -2
  88. data/sig/generated/acp/transport/stderr_logger.rbs +1 -2
  89. data/sig/generated/acp/transport/stdio.rbs +14 -22
  90. data/sig/generated/acp/types/audio_content.rbs +1 -27
  91. data/sig/generated/acp/types/auth_method_terminal.rbs +1 -35
  92. data/sig/generated/acp/types/available_commands_update.rbs +1 -19
  93. data/sig/generated/acp/types/boolean_property_schema.rbs +1 -27
  94. data/sig/generated/acp/types/check.rbs +115 -0
  95. data/sig/generated/acp/types/config_option_update.rbs +1 -19
  96. data/sig/generated/acp/types/content.rbs +1 -19
  97. data/sig/generated/acp/types/{elicitation_url_mode → create_elicitation_request/mode/form}/scope.rbs +2 -2
  98. data/sig/generated/acp/types/create_elicitation_request/mode/form.rbs +3 -3
  99. data/sig/generated/acp/types/{elicitation_form_mode → create_elicitation_request/mode/url}/scope.rbs +2 -2
  100. data/sig/generated/acp/types/create_elicitation_request/mode/url.rbs +3 -3
  101. data/sig/generated/acp/types/current_mode_update.rbs +1 -19
  102. data/sig/generated/acp/types/diff.rbs +1 -27
  103. data/sig/generated/acp/types/elicitation_accept_action.rbs +1 -15
  104. data/sig/generated/acp/types/elicitation_form_mode.rbs +1 -19
  105. data/sig/generated/acp/types/elicitation_url_mode.rbs +1 -23
  106. data/sig/generated/acp/types/embedded_resource.rbs +1 -23
  107. data/sig/generated/acp/types/image_content.rbs +1 -31
  108. data/sig/generated/acp/types/integer_property_schema.rbs +1 -35
  109. data/sig/generated/acp/types/mcp_server_http.rbs +1 -27
  110. data/sig/generated/acp/types/mcp_server_sse.rbs +1 -27
  111. data/sig/generated/acp/types/multi_select_property_schema.rbs +1 -39
  112. data/sig/generated/acp/types/number_property_schema.rbs +1 -35
  113. data/sig/generated/acp/types/parse_error.rbs +22 -0
  114. data/sig/generated/acp/types/plan.rbs +1 -19
  115. data/sig/generated/acp/types/resource_link.rbs +1 -43
  116. data/sig/generated/acp/types/selected_permission_outcome.rbs +1 -19
  117. data/sig/generated/acp/types/session_config_boolean.rbs +1 -15
  118. data/sig/generated/acp/types/session_config_select.rbs +1 -19
  119. data/sig/generated/acp/types/session_info_update.rbs +1 -23
  120. data/sig/generated/acp/types/string_multi_select_items.rbs +1 -19
  121. data/sig/generated/acp/types/string_property_schema.rbs +1 -51
  122. data/sig/generated/acp/types/terminal.rbs +1 -19
  123. data/sig/generated/acp/types/text_content.rbs +1 -23
  124. data/sig/generated/acp/types/tool_call.rbs +1 -51
  125. data/sig/generated/acp/types/unstable/compaction_summary_chunk.rbs +1 -23
  126. data/sig/generated/acp/types/unstable/compaction_update.rbs +1 -31
  127. data/sig/generated/acp/types/unstable/idle_state_update.rbs +1 -23
  128. data/sig/generated/acp/types/unstable/mcp_server_acp.rbs +1 -23
  129. data/sig/generated/acp/types/unstable/nes_edit_suggestion.rbs +1 -31
  130. data/sig/generated/acp/types/unstable/nes_jump_suggestion.rbs +1 -27
  131. data/sig/generated/acp/types/unstable/nes_rename_suggestion.rbs +1 -31
  132. data/sig/generated/acp/types/unstable/nes_search_and_replace_suggestion.rbs +1 -35
  133. data/sig/generated/acp/types/unstable/notice.rbs +1 -27
  134. data/sig/generated/acp/types/unstable/plan_file.rbs +1 -23
  135. data/sig/generated/acp/types/unstable/plan_items.rbs +1 -23
  136. data/sig/generated/acp/types/unstable/plan_markdown.rbs +1 -23
  137. data/sig/generated/acp/types/unstable/plan_removed.rbs +1 -19
  138. data/sig/generated/acp/types/unstable/plan_update.rbs +1 -19
  139. data/sig/generated/acp/types/unstable/requires_action_state_update.rbs +1 -15
  140. data/sig/generated/acp/types/unstable/running_state_update.rbs +1 -15
  141. data/sig/generated/acp/types/unstable/session_message.rbs +1 -31
  142. data/sig/generated/acp/types/unstable/session_message_chunk.rbs +1 -31
  143. data/sig/generated/acp/types/unstable/subagent_update.rbs +1 -35
  144. data/sig/generated/acp/types/unstable/unknown_state_update.rbs +1 -15
  145. data/sig/generated/acp/types/usage_update.rbs +1 -27
  146. data/sig/generated/acp/types.rbs +6 -143
  147. data/sig/manual/acp/agent_connection.rbs +28 -28
  148. data/sig/manual/acp/client_connection.rbs +7 -2
  149. data/sig/manual/acp/{agent_connection/optional_method/logout.rbs → protocol.rbs} +3 -3
  150. data/sig/manual/acp/transport/stdio.rbs +0 -2
  151. data/sig/manual/acp/transport.rbs +25 -2
  152. metadata +17 -29
  153. data/lib/acp/agent_connection/optional_method/authenticate.rb +0 -21
  154. data/lib/acp/agent_connection/optional_method/close_session.rb +0 -21
  155. data/lib/acp/agent_connection/optional_method/delete_session.rb +0 -21
  156. data/lib/acp/agent_connection/optional_method/list_sessions.rb +0 -21
  157. data/lib/acp/agent_connection/optional_method/load_session.rb +0 -21
  158. data/lib/acp/agent_connection/optional_method/logout.rb +0 -21
  159. data/lib/acp/agent_connection/optional_method/resume_session.rb +0 -21
  160. data/lib/acp/types/content_chunk.rb +0 -40
  161. data/sig/generated/acp/agent_connection/optional_method/authenticate.rbs +0 -13
  162. data/sig/generated/acp/agent_connection/optional_method/close_session.rbs +0 -13
  163. data/sig/generated/acp/agent_connection/optional_method/delete_session.rbs +0 -13
  164. data/sig/generated/acp/agent_connection/optional_method/list_sessions.rbs +0 -13
  165. data/sig/generated/acp/agent_connection/optional_method/load_session.rbs +0 -13
  166. data/sig/generated/acp/agent_connection/optional_method/logout.rbs +0 -13
  167. data/sig/generated/acp/agent_connection/optional_method/resume_session.rbs +0 -13
  168. data/sig/generated/acp/types/content_chunk.rbs +0 -25
  169. data/sig/manual/acp/agent_connection/optional_method/authenticate.rbs +0 -6
  170. data/sig/manual/acp/agent_connection/optional_method/close_session.rbs +0 -6
  171. data/sig/manual/acp/agent_connection/optional_method/delete_session.rbs +0 -6
  172. data/sig/manual/acp/agent_connection/optional_method/list_sessions.rbs +0 -6
  173. data/sig/manual/acp/agent_connection/optional_method/load_session.rbs +0 -6
  174. data/sig/manual/acp/agent_connection/optional_method/resume_session.rbs +0 -6
@@ -1,25 +1,3 @@
1
1
  # Generated from lib/acp/types/unstable/plan_items.rb with RBS::Inline
2
2
 
3
- class ACP::Types::Unstable::PlanItems
4
- # @dynamic plan_id
5
- attr_reader plan_id: String
6
-
7
- # @dynamic entries
8
- attr_reader entries: Array[ACP::Types::PlanEntry]
9
-
10
- # @dynamic meta
11
- attr_reader meta: Hash[String, untyped]?
12
-
13
- # @rbs plan_id: String
14
- # @rbs entries: Array[ACP::Types::PlanEntry]
15
- # @rbs meta: Hash[String, untyped]?
16
- # @rbs return: void
17
- def initialize: (plan_id: String, entries: Array[ACP::Types::PlanEntry], ?meta: Hash[String, untyped]?) -> void
18
-
19
- # @rbs hash: Hash[String, untyped]
20
- # @rbs return: ACP::Types::Unstable::PlanItems
21
- def self.from_h: (Hash[String, untyped] hash) -> ACP::Types::Unstable::PlanItems
22
-
23
- # @rbs return: Hash[String, untyped]
24
- def to_h: () -> Hash[String, untyped]
25
- end
3
+ class ACP::Types::Unstable::PlanItems = ACP::Types::Unstable::PlanUpdateContent::Items
@@ -1,25 +1,3 @@
1
1
  # Generated from lib/acp/types/unstable/plan_markdown.rb with RBS::Inline
2
2
 
3
- class ACP::Types::Unstable::PlanMarkdown
4
- # @dynamic plan_id
5
- attr_reader plan_id: String
6
-
7
- # @dynamic content
8
- attr_reader content: String
9
-
10
- # @dynamic meta
11
- attr_reader meta: Hash[String, untyped]?
12
-
13
- # @rbs plan_id: String
14
- # @rbs content: String
15
- # @rbs meta: Hash[String, untyped]?
16
- # @rbs return: void
17
- def initialize: (plan_id: String, content: String, ?meta: Hash[String, untyped]?) -> void
18
-
19
- # @rbs hash: Hash[String, untyped]
20
- # @rbs return: ACP::Types::Unstable::PlanMarkdown
21
- def self.from_h: (Hash[String, untyped] hash) -> ACP::Types::Unstable::PlanMarkdown
22
-
23
- # @rbs return: Hash[String, untyped]
24
- def to_h: () -> Hash[String, untyped]
25
- end
3
+ class ACP::Types::Unstable::PlanMarkdown = ACP::Types::Unstable::PlanUpdateContent::Markdown
@@ -1,21 +1,3 @@
1
1
  # Generated from lib/acp/types/unstable/plan_removed.rb with RBS::Inline
2
2
 
3
- class ACP::Types::Unstable::PlanRemoved
4
- # @dynamic plan_id
5
- attr_reader plan_id: String
6
-
7
- # @dynamic meta
8
- attr_reader meta: Hash[String, untyped]?
9
-
10
- # @rbs plan_id: String
11
- # @rbs meta: Hash[String, untyped]?
12
- # @rbs return: void
13
- def initialize: (plan_id: String, ?meta: Hash[String, untyped]?) -> void
14
-
15
- # @rbs hash: Hash[String, untyped]
16
- # @rbs return: ACP::Types::Unstable::PlanRemoved
17
- def self.from_h: (Hash[String, untyped] hash) -> ACP::Types::Unstable::PlanRemoved
18
-
19
- # @rbs return: Hash[String, untyped]
20
- def to_h: () -> Hash[String, untyped]
21
- end
3
+ class ACP::Types::Unstable::PlanRemoved = ACP::Types::Unstable::SessionUpdate::PlanRemoved
@@ -1,21 +1,3 @@
1
1
  # Generated from lib/acp/types/unstable/plan_update.rb with RBS::Inline
2
2
 
3
- class ACP::Types::Unstable::PlanUpdate
4
- # @dynamic plan
5
- attr_reader plan: ACP::Types::Unstable::PlanUpdateContent::t
6
-
7
- # @dynamic meta
8
- attr_reader meta: Hash[String, untyped]?
9
-
10
- # @rbs plan: ACP::Types::Unstable::PlanUpdateContent::t
11
- # @rbs meta: Hash[String, untyped]?
12
- # @rbs return: void
13
- def initialize: (plan: ACP::Types::Unstable::PlanUpdateContent::t, ?meta: Hash[String, untyped]?) -> void
14
-
15
- # @rbs hash: Hash[String, untyped]
16
- # @rbs return: ACP::Types::Unstable::PlanUpdate
17
- def self.from_h: (Hash[String, untyped] hash) -> ACP::Types::Unstable::PlanUpdate
18
-
19
- # @rbs return: Hash[String, untyped]
20
- def to_h: () -> Hash[String, untyped]
21
- end
3
+ class ACP::Types::Unstable::PlanUpdate = ACP::Types::Unstable::SessionUpdate::PlanUpdate
@@ -1,17 +1,3 @@
1
1
  # Generated from lib/acp/types/unstable/requires_action_state_update.rb with RBS::Inline
2
2
 
3
- class ACP::Types::Unstable::RequiresActionStateUpdate
4
- # @dynamic meta
5
- attr_reader meta: Hash[String, untyped]?
6
-
7
- # @rbs meta: Hash[String, untyped]?
8
- # @rbs return: void
9
- def initialize: (?meta: Hash[String, untyped]?) -> void
10
-
11
- # @rbs hash: Hash[String, untyped]
12
- # @rbs return: ACP::Types::Unstable::RequiresActionStateUpdate
13
- def self.from_h: (Hash[String, untyped] hash) -> ACP::Types::Unstable::RequiresActionStateUpdate
14
-
15
- # @rbs return: Hash[String, untyped]
16
- def to_h: () -> Hash[String, untyped]
17
- end
3
+ class ACP::Types::Unstable::RequiresActionStateUpdate = ACP::Types::Unstable::StateUpdate::RequiresAction
@@ -1,17 +1,3 @@
1
1
  # Generated from lib/acp/types/unstable/running_state_update.rb with RBS::Inline
2
2
 
3
- class ACP::Types::Unstable::RunningStateUpdate
4
- # @dynamic meta
5
- attr_reader meta: Hash[String, untyped]?
6
-
7
- # @rbs meta: Hash[String, untyped]?
8
- # @rbs return: void
9
- def initialize: (?meta: Hash[String, untyped]?) -> void
10
-
11
- # @rbs hash: Hash[String, untyped]
12
- # @rbs return: ACP::Types::Unstable::RunningStateUpdate
13
- def self.from_h: (Hash[String, untyped] hash) -> ACP::Types::Unstable::RunningStateUpdate
14
-
15
- # @rbs return: Hash[String, untyped]
16
- def to_h: () -> Hash[String, untyped]
17
- end
3
+ class ACP::Types::Unstable::RunningStateUpdate = ACP::Types::Unstable::StateUpdate::Running
@@ -1,33 +1,3 @@
1
1
  # Generated from lib/acp/types/unstable/session_message.rb with RBS::Inline
2
2
 
3
- class ACP::Types::Unstable::SessionMessage
4
- # @dynamic message_id
5
- attr_reader message_id: String
6
-
7
- # @dynamic sender_session_id
8
- attr_reader sender_session_id: String?
9
-
10
- # @dynamic recipient_session_id
11
- attr_reader recipient_session_id: String?
12
-
13
- # @dynamic content
14
- attr_reader content: Array[ACP::Types::ContentBlock::t]?
15
-
16
- # @dynamic meta
17
- attr_reader meta: Hash[String, untyped]?
18
-
19
- # @rbs message_id: String
20
- # @rbs sender_session_id: String?
21
- # @rbs recipient_session_id: String?
22
- # @rbs content: Array[ACP::Types::ContentBlock::t]?
23
- # @rbs meta: Hash[String, untyped]?
24
- # @rbs return: void
25
- def initialize: (message_id: String, ?sender_session_id: String?, ?recipient_session_id: String?, ?content: Array[ACP::Types::ContentBlock::t]?, ?meta: Hash[String, untyped]?) -> void
26
-
27
- # @rbs hash: Hash[String, untyped]
28
- # @rbs return: ACP::Types::Unstable::SessionMessage
29
- def self.from_h: (Hash[String, untyped] hash) -> ACP::Types::Unstable::SessionMessage
30
-
31
- # @rbs return: Hash[String, untyped]
32
- def to_h: () -> Hash[String, untyped]
33
- end
3
+ class ACP::Types::Unstable::SessionMessage = ACP::Types::Unstable::SessionUpdate::SessionMessage
@@ -1,33 +1,3 @@
1
1
  # Generated from lib/acp/types/unstable/session_message_chunk.rb with RBS::Inline
2
2
 
3
- class ACP::Types::Unstable::SessionMessageChunk
4
- # @dynamic message_id
5
- attr_reader message_id: String
6
-
7
- # @dynamic sender_session_id
8
- attr_reader sender_session_id: String?
9
-
10
- # @dynamic recipient_session_id
11
- attr_reader recipient_session_id: String?
12
-
13
- # @dynamic content
14
- attr_reader content: ACP::Types::ContentBlock::t
15
-
16
- # @dynamic meta
17
- attr_reader meta: Hash[String, untyped]?
18
-
19
- # @rbs message_id: String
20
- # @rbs sender_session_id: String?
21
- # @rbs recipient_session_id: String?
22
- # @rbs content: ACP::Types::ContentBlock::t
23
- # @rbs meta: Hash[String, untyped]?
24
- # @rbs return: void
25
- def initialize: (message_id: String, content: ACP::Types::ContentBlock::t, ?sender_session_id: String?, ?recipient_session_id: String?, ?meta: Hash[String, untyped]?) -> void
26
-
27
- # @rbs hash: Hash[String, untyped]
28
- # @rbs return: ACP::Types::Unstable::SessionMessageChunk
29
- def self.from_h: (Hash[String, untyped] hash) -> ACP::Types::Unstable::SessionMessageChunk
30
-
31
- # @rbs return: Hash[String, untyped]
32
- def to_h: () -> Hash[String, untyped]
33
- end
3
+ class ACP::Types::Unstable::SessionMessageChunk = ACP::Types::Unstable::SessionUpdate::SessionMessageChunk
@@ -1,37 +1,3 @@
1
1
  # Generated from lib/acp/types/unstable/subagent_update.rb with RBS::Inline
2
2
 
3
- class ACP::Types::Unstable::SubagentUpdate
4
- # @dynamic session_id
5
- attr_reader session_id: String
6
-
7
- # @dynamic title
8
- attr_reader title: String?
9
-
10
- # @dynamic description
11
- attr_reader description: String?
12
-
13
- # @dynamic capabilities
14
- attr_reader capabilities: ACP::Types::Unstable::SubagentSessionCapabilities?
15
-
16
- # @dynamic state
17
- attr_reader state: ACP::Types::Unstable::StateUpdate::t?
18
-
19
- # @dynamic meta
20
- attr_reader meta: Hash[String, untyped]?
21
-
22
- # @rbs session_id: String
23
- # @rbs title: String?
24
- # @rbs description: String?
25
- # @rbs capabilities: ACP::Types::Unstable::SubagentSessionCapabilities?
26
- # @rbs state: ACP::Types::Unstable::StateUpdate::t?
27
- # @rbs meta: Hash[String, untyped]?
28
- # @rbs return: void
29
- def initialize: (session_id: String, ?title: String?, ?description: String?, ?capabilities: ACP::Types::Unstable::SubagentSessionCapabilities?, ?state: ACP::Types::Unstable::StateUpdate::t?, ?meta: Hash[String, untyped]?) -> void
30
-
31
- # @rbs hash: Hash[String, untyped]
32
- # @rbs return: ACP::Types::Unstable::SubagentUpdate
33
- def self.from_h: (Hash[String, untyped] hash) -> ACP::Types::Unstable::SubagentUpdate
34
-
35
- # @rbs return: Hash[String, untyped]
36
- def to_h: () -> Hash[String, untyped]
37
- end
3
+ class ACP::Types::Unstable::SubagentUpdate = ACP::Types::Unstable::SessionUpdate::SubagentUpdate
@@ -1,17 +1,3 @@
1
1
  # Generated from lib/acp/types/unstable/unknown_state_update.rb with RBS::Inline
2
2
 
3
- class ACP::Types::Unstable::UnknownStateUpdate
4
- # @dynamic meta
5
- attr_reader meta: Hash[String, untyped]?
6
-
7
- # @rbs meta: Hash[String, untyped]?
8
- # @rbs return: void
9
- def initialize: (?meta: Hash[String, untyped]?) -> void
10
-
11
- # @rbs hash: Hash[String, untyped]
12
- # @rbs return: ACP::Types::Unstable::UnknownStateUpdate
13
- def self.from_h: (Hash[String, untyped] hash) -> ACP::Types::Unstable::UnknownStateUpdate
14
-
15
- # @rbs return: Hash[String, untyped]
16
- def to_h: () -> Hash[String, untyped]
17
- end
3
+ class ACP::Types::Unstable::UnknownStateUpdate = ACP::Types::Unstable::StateUpdate::Unknown
@@ -1,29 +1,3 @@
1
1
  # Generated from lib/acp/types/usage_update.rb with RBS::Inline
2
2
 
3
- class ACP::Types::UsageUpdate
4
- # @dynamic used
5
- attr_reader used: Integer
6
-
7
- # @dynamic size
8
- attr_reader size: Integer
9
-
10
- # @dynamic cost
11
- attr_reader cost: ACP::Types::Cost?
12
-
13
- # @dynamic meta
14
- attr_reader meta: Hash[String, untyped]?
15
-
16
- # @rbs used: Integer
17
- # @rbs size: Integer
18
- # @rbs cost: ACP::Types::Cost?
19
- # @rbs meta: Hash[String, untyped]?
20
- # @rbs return: void
21
- def initialize: (used: Integer, size: Integer, ?cost: ACP::Types::Cost?, ?meta: Hash[String, untyped]?) -> void
22
-
23
- # @rbs hash: Hash[String, untyped]
24
- # @rbs return: ACP::Types::UsageUpdate
25
- def self.from_h: (Hash[String, untyped] hash) -> ACP::Types::UsageUpdate
26
-
27
- # @rbs return: Hash[String, untyped]
28
- def to_h: () -> Hash[String, untyped]
29
- end
3
+ class ACP::Types::UsageUpdate = ACP::Types::SessionUpdate::UsageUpdate
@@ -1,147 +1,10 @@
1
1
  # Generated from lib/acp/types.rb with RBS::Inline
2
2
 
3
3
  module ACP::Types
4
- # Raised by the generated from_h when a param does not match its schema
5
- # type; the connection boundaries rescue it into an invalid-params reply
6
- # that names the failing path.
7
- class ParseError < StandardError
8
- @segments: Array[String | Integer]
9
-
10
- @detail: String
11
-
12
- # @rbs segments: Array[String | Integer]
13
- # @rbs detail: String
14
- # @rbs return: void
15
- def initialize: (Array[String | Integer] segments, String detail) -> void
16
-
17
- # @dynamic segments
18
- attr_reader segments: Array[String | Integer]
19
-
20
- # @rbs return: String
21
- def path: () -> String
22
-
23
- # Prepends a container's segments so nested failures report an absolute path.
24
- #
25
- # @rbs *segments: (String | Integer)
26
- # @rbs return: ACP::Types::ParseError
27
- def prefix: (*String | Integer segments) -> ACP::Types::ParseError
28
- end
29
-
30
- # The guards the generated from_h methods call. Each takes the fetched value
31
- # and the path to it, and raises ParseError naming that path when the value
32
- # does not match the schema type. Nested from_h failures come back with the
33
- # field path prepended, so the reported path is absolute.
34
- module Check
35
- # @rbs hash: Hash[String, untyped]
36
- # @rbs key: String
37
- # @rbs return: untyped
38
- def self.key: (Hash[String, untyped] hash, String key) -> untyped
39
-
40
- # @rbs value: untyped
41
- # @rbs path: String | Array[String | Integer]
42
- # @rbs allow_nil: bool
43
- # @rbs allow_unset: bool
44
- # @rbs return: untyped
45
- def self.string: (untyped value, String | Array[String | Integer] path, ?allow_nil: bool, ?allow_unset: bool) -> untyped
46
-
47
- # @rbs value: untyped
48
- # @rbs path: String | Array[String | Integer]
49
- # @rbs allow_nil: bool
50
- # @rbs allow_unset: bool
51
- # @rbs return: untyped
52
- def self.boolean: (untyped value, String | Array[String | Integer] path, ?allow_nil: bool, ?allow_unset: bool) -> untyped
53
-
54
- # @rbs value: untyped
55
- # @rbs path: String | Array[String | Integer]
56
- # @rbs min: Integer?
57
- # @rbs max: Integer?
58
- # @rbs allow_nil: bool
59
- # @rbs allow_unset: bool
60
- # @rbs return: untyped
61
- def self.integer: (untyped value, String | Array[String | Integer] path, ?min: Integer?, ?max: Integer?, ?allow_nil: bool, ?allow_unset: bool) -> untyped
62
-
63
- # @rbs value: untyped
64
- # @rbs path: String | Array[String | Integer]
65
- # @rbs min: Integer?
66
- # @rbs max: Integer?
67
- # @rbs allow_nil: bool
68
- # @rbs allow_unset: bool
69
- # @rbs return: untyped
70
- def self.number: (untyped value, String | Array[String | Integer] path, ?min: Integer?, ?max: Integer?, ?allow_nil: bool, ?allow_unset: bool) -> untyped
71
-
72
- # @rbs value: untyped
73
- # @rbs path: String | Array[String | Integer]
74
- # @rbs values: Array[untyped]
75
- # @rbs allow_nil: bool
76
- # @rbs allow_unset: bool
77
- # @rbs return: untyped
78
- def self.enum: (untyped value, String | Array[String | Integer] path, Array[untyped] values, ?allow_nil: bool, ?allow_unset: bool) -> untyped
79
-
80
- # @rbs value: untyped
81
- # @rbs path: String | Array[String | Integer]
82
- # @rbs classes: Array[untyped]
83
- # @rbs allow_nil: bool
84
- # @rbs allow_unset: bool
85
- # @rbs ?&items: (untyped, Array[String | Integer]) -> void
86
- # @rbs return: untyped
87
- def self.one_of: (untyped value, String | Array[String | Integer] path, Array[untyped] classes, ?allow_nil: bool, ?allow_unset: bool) ?{ (?) -> untyped } -> untyped
88
-
89
- # @rbs value: untyped
90
- # @rbs path: String | Array[String | Integer]
91
- # @rbs allow_nil: bool
92
- # @rbs allow_unset: bool
93
- # @rbs &check: (untyped, Array[String | Integer]) -> void
94
- # @rbs return: untyped
95
- def self.hash: (untyped value, String | Array[String | Integer] path, ?allow_nil: bool, ?allow_unset: bool) { (untyped, Array[String | Integer]) -> void } -> untyped
96
-
97
- # @rbs value: untyped
98
- # @rbs path: String | Array[String | Integer]
99
- # @rbs allow_nil: bool
100
- # @rbs allow_unset: bool
101
- # @rbs &check: (untyped, Array[String | Integer]) -> void
102
- # @rbs return: untyped
103
- def self.array: (untyped value, String | Array[String | Integer] path, ?allow_nil: bool, ?allow_unset: bool) { (untyped, Array[String | Integer]) -> void } -> untyped
104
-
105
- # @rbs value: untyped
106
- # @rbs path: String | Array[String | Integer]
107
- # @rbs klass: untyped
108
- # @rbs allow_nil: bool
109
- # @rbs allow_unset: bool
110
- # @rbs return: untyped
111
- def self.object: (untyped value, String | Array[String | Integer] path, untyped klass, ?allow_nil: bool, ?allow_unset: bool) -> untyped
112
-
113
- # @rbs value: untyped
114
- # @rbs path: String | Array[String | Integer]
115
- # @rbs klass: untyped
116
- # @rbs allow_nil: bool
117
- # @rbs allow_unset: bool
118
- # @rbs return: untyped
119
- def self.objects: (untyped value, String | Array[String | Integer] path, untyped klass, ?allow_nil: bool, ?allow_unset: bool) -> untyped
120
-
121
- # @rbs value: untyped
122
- # @rbs allow_nil: bool
123
- # @rbs allow_unset: bool
124
- # @rbs return: bool
125
- def self.skipped?: (untyped value, bool allow_nil, bool allow_unset) -> bool
126
-
127
- # @rbs path: String | Array[String | Integer]
128
- # @rbs return: Array[String | Integer]
129
- def self.segments: (String | Array[String | Integer] path) -> Array[String | Integer]
130
-
131
- # @rbs value: untyped
132
- # @rbs return: String
133
- def self.describe: (untyped value) -> String
134
-
135
- # @rbs value: Numeric
136
- # @rbs min: Integer?
137
- # @rbs max: Integer?
138
- # @rbs return: bool
139
- def self.within?: (Numeric value, Integer? min, Integer? max) -> bool
140
-
141
- # @rbs name: String
142
- # @rbs min: Integer?
143
- # @rbs max: Integer?
144
- # @rbs return: String
145
- def self.bounded: (String name, Integer? min, Integer? max) -> String
146
- end
4
+ # Lives on ACP::Types rather than ACP::Types::Unstable because the callers
5
+ # run in the stable-only load, where even naming the inner module would raise
6
+ # NameError.
7
+ #
8
+ # @rbs return: bool
9
+ def self.unstable_enabled?: () -> bool
147
10
  end
@@ -36,6 +36,22 @@ class ACP::AgentConnection
36
36
  def logout: (ACP::Types::LogoutRequest) -> (ACP::Types::LogoutResponse | ACP::RequestError)
37
37
  end
38
38
 
39
+ interface _ForkSession
40
+ def fork_session: (ACP::Types::Unstable::ForkSessionRequest) -> (ACP::Types::Unstable::ForkSessionResponse | ACP::RequestError)
41
+ end
42
+
43
+ interface _ListProviders
44
+ def list_providers: (ACP::Types::Unstable::ListProvidersRequest) -> (ACP::Types::Unstable::ListProvidersResponse | ACP::RequestError)
45
+ end
46
+
47
+ interface _SetProvider
48
+ def set_provider: (ACP::Types::Unstable::SetProviderRequest) -> (ACP::Types::Unstable::SetProviderResponse | ACP::RequestError)
49
+ end
50
+
51
+ interface _DisableProvider
52
+ def disable_provider: (ACP::Types::Unstable::DisableProviderRequest) -> (ACP::Types::Unstable::DisableProviderResponse | ACP::RequestError)
53
+ end
54
+
39
55
  interface _ChangeSessionMode
40
56
  def change_session_mode: (ACP::Types::SetSessionModeRequest) -> (ACP::Types::SetSessionModeResponse | ACP::RequestError)
41
57
  end
@@ -53,25 +69,30 @@ class ACP::AgentConnection
53
69
  include _CloseSession
54
70
  include _DeleteSession
55
71
  include _Logout
72
+ include _ForkSession
73
+ include _ListProviders
74
+ include _SetProvider
75
+ include _DisableProvider
56
76
  include _ChangeSessionMode
57
77
  include _ChangeSessionConfigOption
58
78
  end
59
79
 
60
- interface _OptionalMethod
61
- def rpc_method: () -> String
62
- def agent_method: () -> Symbol
63
- def advertised?: (ACP::Types::InitializeResponse) -> bool
64
- end
65
-
66
80
  interface _SessionCreated
67
81
  def session_created: (ACP::Types::NewSessionResponse) -> void
68
82
  end
69
83
 
84
+ interface _McpMessageNotification
85
+ # Runs on the transport's reader thread, so it must return quickly.
86
+ def mcp_message_notification: (ACP::Types::Unstable::MessageMcpNotification notification) -> void
87
+ end
88
+
70
89
  # What an agent sees of ACP::AgentConnection::Client, so tests can pass a fake.
71
90
  interface _Client
72
91
  def update: (String session_id, ACP::Types::SessionUpdate::t update) -> void
73
92
  def available_commands: (String session_id, Array[ACP::Types::AvailableCommand] commands) -> void
74
93
  def request_permission: (ACP::Types::RequestPermissionRequest) -> (ACP::Types::RequestPermissionResponse | ACP::RequestError)
94
+ def cancel_requests: () -> void
95
+ def cancelled?: () -> bool
75
96
  def read_text_file: (ACP::Types::ReadTextFileRequest) -> (ACP::Types::ReadTextFileResponse | ACP::RequestError)
76
97
  def write_text_file: (ACP::Types::WriteTextFileRequest) -> (ACP::Types::WriteTextFileResponse | ACP::RequestError)
77
98
  def create_terminal: (ACP::Types::CreateTerminalRequest) -> (ACP::Types::CreateTerminalResponse | ACP::RequestError)
@@ -81,30 +102,9 @@ class ACP::AgentConnection
81
102
  def release_terminal: (ACP::Types::ReleaseTerminalRequest) -> (ACP::Types::ReleaseTerminalResponse | ACP::RequestError)
82
103
  def create_elicitation: (ACP::Types::CreateElicitationRequest request) -> (ACP::Types::CreateElicitationResponse | ACP::RequestError)
83
104
  def complete_elicitation: (ACP::Types::CompleteElicitationNotification notification) -> void
105
+ def mcp_message: (ACP::Types::Unstable::MessageMcpRequest request) -> (ACP::Types::Unstable::MessageMcpResponse::t | ACP::RequestError)
84
106
  def ext_request: (String method, ?untyped params) -> (Hash[String, untyped] | ACP::RequestError)
85
107
  def ext_notify: (String method, ?untyped params) -> void
86
108
  def capabilities: () -> ACP::Types::ClientCapabilities?
87
109
  end
88
-
89
- interface _Peer
90
- def request: (String method, ?untyped params) -> (Hash[String, untyped] | ACP::RequestError)
91
- def notify: (String method, ?untyped params) -> void
92
- end
93
-
94
- interface _Transport
95
- include _Peer
96
-
97
- def start: (
98
- requests: Hash[String, ACP::Transport::Stdio::_Handler],
99
- notifications: Hash[String, ACP::Transport::Stdio::_NotificationHandler]
100
- ) -> Thread
101
- end
102
-
103
- interface _Parser
104
- def from_h: (Hash[String, untyped]) -> untyped
105
- end
106
-
107
- interface _Response
108
- def to_h: () -> Hash[String, untyped]
109
- end
110
110
  end
@@ -4,10 +4,15 @@ class ACP::ClientConnection
4
4
  def call: (ACP::Types::RequestPermissionRequest) -> (ACP::Types::RequestPermissionResponse | ACP::RequestError)
5
5
  end
6
6
 
7
- # Receives the session/update notifications that arrive outside a
8
- # session_prompt or session_load call for the same session.
9
7
  interface _UpdateHandler
10
8
  # Runs on the transport's reader thread, so it must return quickly.
11
9
  def call: (ACP::Types::SessionNotification) -> void
12
10
  end
13
11
  end
12
+
13
+ class ACP::ClientConnection::Streams
14
+ interface _Sender
15
+ def request: (String method, ?untyped params) -> (Hash[String, untyped] | ACP::RequestError)
16
+ def cancellation: () -> ACP::Transport::Cancellation?
17
+ end
18
+ end
@@ -1,6 +1,6 @@
1
1
  # rbs-inline does not emit `extend self`, so without this reopen the module's
2
2
  # methods aren't visible as singleton methods.
3
3
 
4
- module ACP::AgentConnection::OptionalMethod::Logout
5
- extend ::ACP::AgentConnection::OptionalMethod::Logout
6
- end
4
+ module ACP::Protocol
5
+ extend ::ACP::Protocol
6
+ end
@@ -1,6 +1,4 @@
1
1
  class ACP::Transport::Stdio
2
- # The success arm of a request handler's return: the transport serializes it
3
- # with to_h into the reply's result.
4
2
  interface _ToH
5
3
  def to_h: () -> Hash[String, untyped]
6
4
  end
@@ -1,8 +1,31 @@
1
1
  module ACP::Transport
2
- # Receives the reports the SDK logs for dropped messages and swallowed
3
- # errors; a log message is a single line with no trailing newline.
2
+ # A log message is a single line with no trailing newline.
4
3
  interface _Logger
5
4
  def warn: (String message) -> void
6
5
  def error: (String message) -> void
7
6
  end
7
+
8
+ interface _Peer
9
+ def request: (String method, ?untyped params) -> (Hash[String, untyped] | ACP::RequestError)
10
+ def notify: (String method, ?untyped params) -> void
11
+ def cancellation: () -> ACP::Transport::Cancellation?
12
+ def cancel_requests: () -> void
13
+ end
14
+
15
+ interface _Transport
16
+ include _Peer
17
+
18
+ def start: (
19
+ requests: Hash[String, ACP::Transport::Stdio::_Handler],
20
+ notifications: Hash[String, ACP::Transport::Stdio::_NotificationHandler]
21
+ ) -> Thread
22
+ end
23
+
24
+ interface _Parser
25
+ def from_h: (Hash[String, untyped]) -> untyped
26
+ end
27
+
28
+ interface _Response
29
+ def to_h: () -> Hash[String, untyped]
30
+ end
8
31
  end