acp-sdk 0.10.0 → 0.12.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 (187) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -0
  3. data/README.md +19 -5
  4. data/lib/acp/agent_connection/client.rb +7 -19
  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 +17 -40
  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 +227 -384
  11. data/lib/acp/protocol.rb +33 -0
  12. data/lib/acp/request_error.rb +17 -17
  13. data/lib/acp/transport/cancellation.rb +0 -7
  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/serving.rb +18 -0
  17. data/lib/acp/transport/stdio.rb +67 -59
  18. data/lib/acp/types/audio_content.rb +3 -46
  19. data/lib/acp/types/auth_method_terminal.rb +3 -59
  20. data/lib/acp/types/available_commands_update.rb +3 -32
  21. data/lib/acp/types/boolean_property_schema.rb +3 -41
  22. data/lib/acp/types/check.rb +210 -0
  23. data/lib/acp/types/config_option_update.rb +3 -32
  24. data/lib/acp/types/content.rb +3 -29
  25. data/lib/acp/types/{elicitation_url_mode → create_elicitation_request/mode/form}/scope.rb +1 -1
  26. data/lib/acp/types/create_elicitation_request/mode/form.rb +3 -3
  27. data/lib/acp/types/{elicitation_form_mode → create_elicitation_request/mode/url}/scope.rb +1 -1
  28. data/lib/acp/types/create_elicitation_request/mode/url.rb +3 -3
  29. data/lib/acp/types/current_mode_update.rb +3 -29
  30. data/lib/acp/types/diff.rb +3 -41
  31. data/lib/acp/types/elicitation_accept_action.rb +3 -26
  32. data/lib/acp/types/elicitation_form_mode.rb +3 -33
  33. data/lib/acp/types/elicitation_url_mode.rb +3 -35
  34. data/lib/acp/types/embedded_resource.rb +3 -44
  35. data/lib/acp/types/image_content.rb +3 -58
  36. data/lib/acp/types/integer_property_schema.rb +3 -60
  37. data/lib/acp/types/mcp_server_http.rb +3 -44
  38. data/lib/acp/types/mcp_server_sse.rb +3 -44
  39. data/lib/acp/types/multi_select_property_schema.rb +3 -70
  40. data/lib/acp/types/number_property_schema.rb +3 -60
  41. data/lib/acp/types/parse_error.rb +37 -0
  42. data/lib/acp/types/plan.rb +3 -29
  43. data/lib/acp/types/resource_link.rb +3 -79
  44. data/lib/acp/types/selected_permission_outcome.rb +3 -26
  45. data/lib/acp/types/session_config_boolean.rb +3 -21
  46. data/lib/acp/types/session_config_select.rb +3 -33
  47. data/lib/acp/types/session_info_update.rb +3 -42
  48. data/lib/acp/types/string_multi_select_items.rb +3 -29
  49. data/lib/acp/types/string_property_schema.rb +3 -105
  50. data/lib/acp/types/terminal.rb +3 -29
  51. data/lib/acp/types/text_content.rb +3 -40
  52. data/lib/acp/types/tool_call.rb +3 -115
  53. data/lib/acp/types/unstable/compaction_summary_chunk.rb +3 -35
  54. data/lib/acp/types/unstable/compaction_update.rb +3 -56
  55. data/lib/acp/types/unstable/idle_state_update.rb +3 -40
  56. data/lib/acp/types/unstable/mcp_server_acp.rb +3 -35
  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 +10 -19
  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 +16 -24
  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 +100 -159
  84. data/sig/generated/acp/protocol.rbs +9 -0
  85. data/sig/generated/acp/request_error.rbs +15 -17
  86. data/sig/generated/acp/transport/cancellation.rbs +0 -7
  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/serving.rbs +14 -0
  90. data/sig/generated/acp/transport/stdio.rbs +31 -35
  91. data/sig/generated/acp/types/audio_content.rbs +1 -27
  92. data/sig/generated/acp/types/auth_method_terminal.rbs +1 -35
  93. data/sig/generated/acp/types/available_commands_update.rbs +1 -19
  94. data/sig/generated/acp/types/boolean_property_schema.rbs +1 -27
  95. data/sig/generated/acp/types/check.rbs +115 -0
  96. data/sig/generated/acp/types/config_option_update.rbs +1 -19
  97. data/sig/generated/acp/types/content.rbs +1 -19
  98. data/sig/generated/acp/types/{elicitation_url_mode → create_elicitation_request/mode/form}/scope.rbs +2 -2
  99. data/sig/generated/acp/types/create_elicitation_request/mode/form.rbs +3 -3
  100. data/sig/generated/acp/types/{elicitation_form_mode → create_elicitation_request/mode/url}/scope.rbs +2 -2
  101. data/sig/generated/acp/types/create_elicitation_request/mode/url.rbs +3 -3
  102. data/sig/generated/acp/types/current_mode_update.rbs +1 -19
  103. data/sig/generated/acp/types/diff.rbs +1 -27
  104. data/sig/generated/acp/types/elicitation_accept_action.rbs +1 -15
  105. data/sig/generated/acp/types/elicitation_form_mode.rbs +1 -19
  106. data/sig/generated/acp/types/elicitation_url_mode.rbs +1 -23
  107. data/sig/generated/acp/types/embedded_resource.rbs +1 -23
  108. data/sig/generated/acp/types/image_content.rbs +1 -31
  109. data/sig/generated/acp/types/integer_property_schema.rbs +1 -35
  110. data/sig/generated/acp/types/mcp_server_http.rbs +1 -27
  111. data/sig/generated/acp/types/mcp_server_sse.rbs +1 -27
  112. data/sig/generated/acp/types/multi_select_property_schema.rbs +1 -39
  113. data/sig/generated/acp/types/number_property_schema.rbs +1 -35
  114. data/sig/generated/acp/types/parse_error.rbs +22 -0
  115. data/sig/generated/acp/types/plan.rbs +1 -19
  116. data/sig/generated/acp/types/resource_link.rbs +1 -43
  117. data/sig/generated/acp/types/selected_permission_outcome.rbs +1 -19
  118. data/sig/generated/acp/types/session_config_boolean.rbs +1 -15
  119. data/sig/generated/acp/types/session_config_select.rbs +1 -19
  120. data/sig/generated/acp/types/session_info_update.rbs +1 -23
  121. data/sig/generated/acp/types/string_multi_select_items.rbs +1 -19
  122. data/sig/generated/acp/types/string_property_schema.rbs +1 -51
  123. data/sig/generated/acp/types/terminal.rbs +1 -19
  124. data/sig/generated/acp/types/text_content.rbs +1 -23
  125. data/sig/generated/acp/types/tool_call.rbs +1 -51
  126. data/sig/generated/acp/types/unstable/compaction_summary_chunk.rbs +1 -23
  127. data/sig/generated/acp/types/unstable/compaction_update.rbs +1 -31
  128. data/sig/generated/acp/types/unstable/idle_state_update.rbs +1 -23
  129. data/sig/generated/acp/types/unstable/mcp_server_acp.rbs +1 -23
  130. data/sig/generated/acp/types/unstable/nes_edit_suggestion.rbs +1 -31
  131. data/sig/generated/acp/types/unstable/nes_jump_suggestion.rbs +1 -27
  132. data/sig/generated/acp/types/unstable/nes_rename_suggestion.rbs +1 -31
  133. data/sig/generated/acp/types/unstable/nes_search_and_replace_suggestion.rbs +1 -35
  134. data/sig/generated/acp/types/unstable/notice.rbs +1 -27
  135. data/sig/generated/acp/types/unstable/plan_file.rbs +1 -23
  136. data/sig/generated/acp/types/unstable/plan_items.rbs +1 -23
  137. data/sig/generated/acp/types/unstable/plan_markdown.rbs +1 -23
  138. data/sig/generated/acp/types/unstable/plan_removed.rbs +1 -19
  139. data/sig/generated/acp/types/unstable/plan_update.rbs +1 -19
  140. data/sig/generated/acp/types/unstable/requires_action_state_update.rbs +1 -15
  141. data/sig/generated/acp/types/unstable/running_state_update.rbs +1 -15
  142. data/sig/generated/acp/types/unstable/session_message.rbs +1 -31
  143. data/sig/generated/acp/types/unstable/session_message_chunk.rbs +1 -31
  144. data/sig/generated/acp/types/unstable/subagent_update.rbs +1 -35
  145. data/sig/generated/acp/types/unstable/unknown_state_update.rbs +1 -15
  146. data/sig/generated/acp/types/usage_update.rbs +1 -27
  147. data/sig/generated/acp/types.rbs +6 -143
  148. data/sig/manual/acp/agent_connection.rbs +0 -30
  149. data/sig/manual/acp/client_connection.rbs +7 -2
  150. data/sig/manual/acp/{agent_connection/optional_method/logout.rbs → protocol.rbs} +3 -3
  151. data/sig/manual/acp/transport/stdio.rbs +0 -2
  152. data/sig/manual/acp/transport.rbs +25 -2
  153. metadata +18 -40
  154. data/lib/acp/agent_connection/optional_method/authenticate.rb +0 -21
  155. data/lib/acp/agent_connection/optional_method/close_session.rb +0 -21
  156. data/lib/acp/agent_connection/optional_method/delete_session.rb +0 -21
  157. data/lib/acp/agent_connection/optional_method/disable_provider.rb +0 -23
  158. data/lib/acp/agent_connection/optional_method/fork_session.rb +0 -23
  159. data/lib/acp/agent_connection/optional_method/list_providers.rb +0 -23
  160. data/lib/acp/agent_connection/optional_method/list_sessions.rb +0 -21
  161. data/lib/acp/agent_connection/optional_method/load_session.rb +0 -21
  162. data/lib/acp/agent_connection/optional_method/logout.rb +0 -21
  163. data/lib/acp/agent_connection/optional_method/resume_session.rb +0 -21
  164. data/lib/acp/agent_connection/optional_method/set_provider.rb +0 -23
  165. data/lib/acp/types/content_chunk.rb +0 -40
  166. data/sig/generated/acp/agent_connection/optional_method/authenticate.rbs +0 -13
  167. data/sig/generated/acp/agent_connection/optional_method/close_session.rbs +0 -13
  168. data/sig/generated/acp/agent_connection/optional_method/delete_session.rbs +0 -13
  169. data/sig/generated/acp/agent_connection/optional_method/disable_provider.rbs +0 -13
  170. data/sig/generated/acp/agent_connection/optional_method/fork_session.rbs +0 -13
  171. data/sig/generated/acp/agent_connection/optional_method/list_providers.rbs +0 -13
  172. data/sig/generated/acp/agent_connection/optional_method/list_sessions.rbs +0 -13
  173. data/sig/generated/acp/agent_connection/optional_method/load_session.rbs +0 -13
  174. data/sig/generated/acp/agent_connection/optional_method/logout.rbs +0 -13
  175. data/sig/generated/acp/agent_connection/optional_method/resume_session.rbs +0 -13
  176. data/sig/generated/acp/agent_connection/optional_method/set_provider.rbs +0 -13
  177. data/sig/generated/acp/types/content_chunk.rbs +0 -25
  178. data/sig/manual/acp/agent_connection/optional_method/authenticate.rbs +0 -6
  179. data/sig/manual/acp/agent_connection/optional_method/close_session.rbs +0 -6
  180. data/sig/manual/acp/agent_connection/optional_method/delete_session.rbs +0 -6
  181. data/sig/manual/acp/agent_connection/optional_method/disable_provider.rbs +0 -6
  182. data/sig/manual/acp/agent_connection/optional_method/fork_session.rbs +0 -6
  183. data/sig/manual/acp/agent_connection/optional_method/list_providers.rbs +0 -6
  184. data/sig/manual/acp/agent_connection/optional_method/list_sessions.rbs +0 -6
  185. data/sig/manual/acp/agent_connection/optional_method/load_session.rbs +0 -6
  186. data/sig/manual/acp/agent_connection/optional_method/resume_session.rbs +0 -6
  187. data/sig/manual/acp/agent_connection/optional_method/set_provider.rbs +0 -6
@@ -1,10 +1,9 @@
1
1
  # Generated from lib/acp/transport/stdio.rb with RBS::Inline
2
2
 
3
- # JSON-RPC 2.0 over newline-delimited JSON on an IO pair. A reader thread
4
- # dispatches inbound messages while outbound requests are pending, and each
5
- # inbound request is served on its own thread, so a handler can make an
6
- # outbound request mid-turn and still see notifications (e.g. session/cancel)
7
- # that arrive meanwhile.
3
+ # A reader thread dispatches inbound messages while outbound requests are
4
+ # pending, and each inbound request is served on its own thread, so a handler
5
+ # can make an outbound request mid-turn and still see notifications (e.g.
6
+ # session/cancel) that arrive meanwhile.
8
7
  class ACP::Transport::Stdio
9
8
  @logger: ACP::Transport::_Logger
10
9
 
@@ -12,7 +11,7 @@ class ACP::Transport::Stdio
12
11
 
13
12
  @next_id: Integer
14
13
 
15
- @serving: Hash[untyped, ACP::Transport::Cancellation]
14
+ @serving: Hash[Thread, ACP::Transport::Stdio::Serving]
16
15
 
17
16
  @pending: Hash[untyped, Thread::Queue]
18
17
 
@@ -32,8 +31,12 @@ class ACP::Transport::Stdio
32
31
  # @rbs return: void
33
32
  def initialize: (input: _Reader, output: _Writer, ?logger: ACP::Transport::_Logger) -> void
34
33
 
35
- # Returns the reader thread, which ends at EOF on input after releasing any
36
- # pending outbound requests.
34
+ # Joining the returned thread does not wait for the requests still being
35
+ # served. EOF cancels none of them (only the peer's $/cancel_request does):
36
+ # each handler runs to completion and its reply is still written, to be
37
+ # warned and dropped if the peer is gone. A caller blocked in #request, a
38
+ # handler waiting on its own request included, is released with
39
+ # CONNECTION_CLOSED.
37
40
  #
38
41
  # @rbs requests: Hash[String, _Handler]
39
42
  # @rbs notifications: Hash[String, _NotificationHandler]
@@ -42,8 +45,8 @@ class ACP::Transport::Stdio
42
45
 
43
46
  # @rbs method: String
44
47
  # @rbs params: untyped
45
- # @rbs return: (Hash[String, untyped] | ACP::RequestError)
46
- def request: (String method, ?untyped params) -> (Hash[String, untyped] | ACP::RequestError)
48
+ # @rbs return: untyped
49
+ def request: (String method, ?untyped params) -> untyped
47
50
 
48
51
  # @rbs method: String
49
52
  # @rbs params: untyped
@@ -63,14 +66,18 @@ class ACP::Transport::Stdio
63
66
  # @rbs return: void
64
67
  def cancel_requests: () -> void
65
68
 
66
- # The cancellation of the request the calling thread is serving, or nil off
67
- # a serve thread. A handler observes the peer's $/cancel_request through it
68
- # and can end early with ACP::RequestError.request_cancelled; whatever it
69
- # returns, the transport sends exactly one response.
70
- #
71
69
  # @rbs return: ACP::Transport::Cancellation?
72
70
  def cancellation: () -> ACP::Transport::Cancellation?
73
71
 
72
+ # @rbs return: Array[untyped]
73
+ def serving_ids: () -> Array[untyped]
74
+
75
+ # Joins the requests in flight at the call, not one the reader dispatches
76
+ # meanwhile: join the reader thread first to leave nothing in flight.
77
+ #
78
+ # @rbs return: void
79
+ def drain: () -> void
80
+
74
81
  private
75
82
 
76
83
  # @rbs line: String
@@ -104,18 +111,6 @@ class ACP::Transport::Stdio
104
111
  # @rbs return: void
105
112
  def serve: (_Handler? handler, untyped id, untyped params, String method) -> void
106
113
 
107
- # Registered before the serve thread starts so a cancel racing the request
108
- # cannot be missed, and dropped once the response is on the wire so later
109
- # cancels for the id are ignored.
110
- #
111
- # @rbs id: untyped
112
- # @rbs return: ACP::Transport::Cancellation
113
- def register_serving: (untyped id) -> ACP::Transport::Cancellation
114
-
115
- # @rbs id: untyped
116
- # @rbs return: void
117
- def unregister_serving: (untyped id) -> void
118
-
119
114
  # A notification has no reply to carry a malformed params failure, so one
120
115
  # is warned and dropped rather than answered.
121
116
  #
@@ -142,9 +137,6 @@ class ACP::Transport::Stdio
142
137
  # @rbs return: (_ToH | ACP::RequestError | ACP::Transport::Reply)
143
138
  def invoke: (_Handler handler, untyped params) -> (_ToH | ACP::RequestError | ACP::Transport::Reply)
144
139
 
145
- # The success arm is whatever the handler returned, which the transport only
146
- # knows serializes with to_h; RequestError picks the error arm of the reply.
147
- #
148
140
  # @rbs id: untyped
149
141
  # @rbs outcome: (_ToH | ACP::RequestError)
150
142
  # @rbs return: void
@@ -155,15 +147,19 @@ class ACP::Transport::Stdio
155
147
  def register: (Thread::Queue queue) -> Integer?
156
148
 
157
149
  # @rbs id: untyped
158
- # @rbs result: (Hash[String, untyped] | ACP::RequestError)
159
- # @rbs return: void
160
- def settle: (untyped id, Hash[String, untyped] | ACP::RequestError result) -> void
150
+ # @rbs result: untyped
151
+ # @rbs return: Thread::Queue?
152
+ def settle: (untyped id, untyped result) -> Thread::Queue?
161
153
 
154
+ # Leaves @serving alone on purpose: embedders rely on in-flight handlers
155
+ # running to completion after the input ends.
156
+ #
162
157
  # @rbs return: void
163
158
  def close: () -> void
164
159
 
165
- # A closed peer must not kill the thread writing the reply: the reader has
166
- # to keep draining input so pending requests still settle at EOF.
160
+ # A closed peer (EPIPE) or an output the embedder already closed (IOError)
161
+ # must not kill the thread writing the reply: the reader has to keep
162
+ # draining input so pending requests still settle at EOF.
167
163
  #
168
164
  # @rbs message: Hash[String, untyped]
169
165
  # @rbs return: void
@@ -1,29 +1,3 @@
1
1
  # Generated from lib/acp/types/audio_content.rb with RBS::Inline
2
2
 
3
- class ACP::Types::AudioContent
4
- # @dynamic annotations
5
- attr_reader annotations: ACP::Types::Annotations?
6
-
7
- # @dynamic data
8
- attr_reader data: String
9
-
10
- # @dynamic mime_type
11
- attr_reader mime_type: String
12
-
13
- # @dynamic meta
14
- attr_reader meta: Hash[String, untyped]?
15
-
16
- # @rbs annotations: ACP::Types::Annotations?
17
- # @rbs data: String
18
- # @rbs mime_type: String
19
- # @rbs meta: Hash[String, untyped]?
20
- # @rbs return: void
21
- def initialize: (data: String, mime_type: String, ?annotations: ACP::Types::Annotations?, ?meta: Hash[String, untyped]?) -> void
22
-
23
- # @rbs hash: Hash[String, untyped]
24
- # @rbs return: ACP::Types::AudioContent
25
- def self.from_h: (Hash[String, untyped] hash) -> ACP::Types::AudioContent
26
-
27
- # @rbs return: Hash[String, untyped]
28
- def to_h: () -> Hash[String, untyped]
29
- end
3
+ class ACP::Types::AudioContent = ACP::Types::ContentBlock::Audio
@@ -1,37 +1,3 @@
1
1
  # Generated from lib/acp/types/auth_method_terminal.rb with RBS::Inline
2
2
 
3
- class ACP::Types::AuthMethodTerminal
4
- # @dynamic id
5
- attr_reader id: String
6
-
7
- # @dynamic name
8
- attr_reader name: String
9
-
10
- # @dynamic description
11
- attr_reader description: String?
12
-
13
- # @dynamic args
14
- attr_reader args: Array[String]?
15
-
16
- # @dynamic env
17
- attr_reader env: Hash[String, String]?
18
-
19
- # @dynamic meta
20
- attr_reader meta: Hash[String, untyped]?
21
-
22
- # @rbs id: String
23
- # @rbs name: String
24
- # @rbs description: String?
25
- # @rbs args: Array[String]?
26
- # @rbs env: Hash[String, String]?
27
- # @rbs meta: Hash[String, untyped]?
28
- # @rbs return: void
29
- def initialize: (id: String, name: String, ?description: String?, ?args: Array[String]?, ?env: Hash[String, String]?, ?meta: Hash[String, untyped]?) -> void
30
-
31
- # @rbs hash: Hash[String, untyped]
32
- # @rbs return: ACP::Types::AuthMethodTerminal
33
- def self.from_h: (Hash[String, untyped] hash) -> ACP::Types::AuthMethodTerminal
34
-
35
- # @rbs return: Hash[String, untyped]
36
- def to_h: () -> Hash[String, untyped]
37
- end
3
+ class ACP::Types::AuthMethodTerminal = ACP::Types::AuthMethod::Terminal
@@ -1,21 +1,3 @@
1
1
  # Generated from lib/acp/types/available_commands_update.rb with RBS::Inline
2
2
 
3
- class ACP::Types::AvailableCommandsUpdate
4
- # @dynamic available_commands
5
- attr_reader available_commands: Array[ACP::Types::AvailableCommand]
6
-
7
- # @dynamic meta
8
- attr_reader meta: Hash[String, untyped]?
9
-
10
- # @rbs available_commands: Array[ACP::Types::AvailableCommand]
11
- # @rbs meta: Hash[String, untyped]?
12
- # @rbs return: void
13
- def initialize: (available_commands: Array[ACP::Types::AvailableCommand], ?meta: Hash[String, untyped]?) -> void
14
-
15
- # @rbs hash: Hash[String, untyped]
16
- # @rbs return: ACP::Types::AvailableCommandsUpdate
17
- def self.from_h: (Hash[String, untyped] hash) -> ACP::Types::AvailableCommandsUpdate
18
-
19
- # @rbs return: Hash[String, untyped]
20
- def to_h: () -> Hash[String, untyped]
21
- end
3
+ class ACP::Types::AvailableCommandsUpdate = ACP::Types::SessionUpdate::AvailableCommandsUpdate
@@ -1,29 +1,3 @@
1
1
  # Generated from lib/acp/types/boolean_property_schema.rb with RBS::Inline
2
2
 
3
- class ACP::Types::BooleanPropertySchema
4
- # @dynamic title
5
- attr_reader title: String?
6
-
7
- # @dynamic description
8
- attr_reader description: String?
9
-
10
- # @dynamic default
11
- attr_reader default: bool?
12
-
13
- # @dynamic meta
14
- attr_reader meta: Hash[String, untyped]?
15
-
16
- # @rbs title: String?
17
- # @rbs description: String?
18
- # @rbs default: bool?
19
- # @rbs meta: Hash[String, untyped]?
20
- # @rbs return: void
21
- def initialize: (?title: String?, ?description: String?, ?default: bool?, ?meta: Hash[String, untyped]?) -> void
22
-
23
- # @rbs hash: Hash[String, untyped]
24
- # @rbs return: ACP::Types::BooleanPropertySchema
25
- def self.from_h: (Hash[String, untyped] hash) -> ACP::Types::BooleanPropertySchema
26
-
27
- # @rbs return: Hash[String, untyped]
28
- def to_h: () -> Hash[String, untyped]
29
- end
3
+ class ACP::Types::BooleanPropertySchema = ACP::Types::ElicitationPropertySchema::BooleanPropertySchema
@@ -0,0 +1,115 @@
1
+ # Generated from lib/acp/types/check.rb with RBS::Inline
2
+
3
+ module ACP::Types::Check
4
+ # @rbs hash: Hash[String, untyped]
5
+ # @rbs key: String
6
+ # @rbs return: untyped
7
+ def self.key: (Hash[String, untyped] hash, String key) -> untyped
8
+
9
+ # @rbs value: untyped
10
+ # @rbs path: String | Array[String | Integer]
11
+ # @rbs allow_nil: bool
12
+ # @rbs allow_unset: bool
13
+ # @rbs return: untyped
14
+ def self.string: (untyped value, String | Array[String | Integer] path, ?allow_nil: bool, ?allow_unset: bool) -> untyped
15
+
16
+ # @rbs value: untyped
17
+ # @rbs path: String | Array[String | Integer]
18
+ # @rbs allow_nil: bool
19
+ # @rbs allow_unset: bool
20
+ # @rbs return: untyped
21
+ def self.boolean: (untyped value, String | Array[String | Integer] path, ?allow_nil: bool, ?allow_unset: bool) -> untyped
22
+
23
+ # @rbs value: untyped
24
+ # @rbs path: String | Array[String | Integer]
25
+ # @rbs min: Integer?
26
+ # @rbs max: Integer?
27
+ # @rbs allow_nil: bool
28
+ # @rbs allow_unset: bool
29
+ # @rbs return: untyped
30
+ def self.integer: (untyped value, String | Array[String | Integer] path, ?min: Integer?, ?max: Integer?, ?allow_nil: bool, ?allow_unset: bool) -> untyped
31
+
32
+ # @rbs value: untyped
33
+ # @rbs path: String | Array[String | Integer]
34
+ # @rbs min: Integer?
35
+ # @rbs max: Integer?
36
+ # @rbs allow_nil: bool
37
+ # @rbs allow_unset: bool
38
+ # @rbs return: untyped
39
+ def self.number: (untyped value, String | Array[String | Integer] path, ?min: Integer?, ?max: Integer?, ?allow_nil: bool, ?allow_unset: bool) -> untyped
40
+
41
+ # @rbs value: untyped
42
+ # @rbs path: String | Array[String | Integer]
43
+ # @rbs values: Array[untyped]
44
+ # @rbs allow_nil: bool
45
+ # @rbs allow_unset: bool
46
+ # @rbs return: untyped
47
+ def self.enum: (untyped value, String | Array[String | Integer] path, Array[untyped] values, ?allow_nil: bool, ?allow_unset: bool) -> untyped
48
+
49
+ # @rbs value: untyped
50
+ # @rbs path: String | Array[String | Integer]
51
+ # @rbs classes: Array[untyped]
52
+ # @rbs allow_nil: bool
53
+ # @rbs allow_unset: bool
54
+ # @rbs ?&items: (untyped, Array[String | Integer]) -> void
55
+ # @rbs return: untyped
56
+ def self.one_of: (untyped value, String | Array[String | Integer] path, Array[untyped] classes, ?allow_nil: bool, ?allow_unset: bool) ?{ (?) -> untyped } -> untyped
57
+
58
+ # @rbs value: untyped
59
+ # @rbs path: String | Array[String | Integer]
60
+ # @rbs allow_nil: bool
61
+ # @rbs allow_unset: bool
62
+ # @rbs &check: (untyped, Array[String | Integer]) -> void
63
+ # @rbs return: untyped
64
+ def self.hash: (untyped value, String | Array[String | Integer] path, ?allow_nil: bool, ?allow_unset: bool) { (untyped, Array[String | Integer]) -> void } -> untyped
65
+
66
+ # @rbs value: untyped
67
+ # @rbs path: String | Array[String | Integer]
68
+ # @rbs allow_nil: bool
69
+ # @rbs allow_unset: bool
70
+ # @rbs &check: (untyped, Array[String | Integer]) -> void
71
+ # @rbs return: untyped
72
+ def self.array: (untyped value, String | Array[String | Integer] path, ?allow_nil: bool, ?allow_unset: bool) { (untyped, Array[String | Integer]) -> void } -> untyped
73
+
74
+ # @rbs value: untyped
75
+ # @rbs path: String | Array[String | Integer]
76
+ # @rbs klass: untyped
77
+ # @rbs allow_nil: bool
78
+ # @rbs allow_unset: bool
79
+ # @rbs return: untyped
80
+ def self.object: (untyped value, String | Array[String | Integer] path, untyped klass, ?allow_nil: bool, ?allow_unset: bool) -> untyped
81
+
82
+ # @rbs value: untyped
83
+ # @rbs path: String | Array[String | Integer]
84
+ # @rbs klass: untyped
85
+ # @rbs allow_nil: bool
86
+ # @rbs allow_unset: bool
87
+ # @rbs return: untyped
88
+ def self.objects: (untyped value, String | Array[String | Integer] path, untyped klass, ?allow_nil: bool, ?allow_unset: bool) -> untyped
89
+
90
+ # @rbs value: untyped
91
+ # @rbs allow_nil: bool
92
+ # @rbs allow_unset: bool
93
+ # @rbs return: bool
94
+ def self.skipped?: (untyped value, bool allow_nil, bool allow_unset) -> bool
95
+
96
+ # @rbs path: String | Array[String | Integer]
97
+ # @rbs return: Array[String | Integer]
98
+ def self.segments: (String | Array[String | Integer] path) -> Array[String | Integer]
99
+
100
+ # @rbs value: untyped
101
+ # @rbs return: String
102
+ def self.describe: (untyped value) -> String
103
+
104
+ # @rbs value: Numeric
105
+ # @rbs min: Integer?
106
+ # @rbs max: Integer?
107
+ # @rbs return: bool
108
+ def self.within?: (Numeric value, Integer? min, Integer? max) -> bool
109
+
110
+ # @rbs name: String
111
+ # @rbs min: Integer?
112
+ # @rbs max: Integer?
113
+ # @rbs return: String
114
+ def self.bounded: (String name, Integer? min, Integer? max) -> String
115
+ end
@@ -1,21 +1,3 @@
1
1
  # Generated from lib/acp/types/config_option_update.rb with RBS::Inline
2
2
 
3
- class ACP::Types::ConfigOptionUpdate
4
- # @dynamic config_options
5
- attr_reader config_options: Array[ACP::Types::SessionConfigOption]
6
-
7
- # @dynamic meta
8
- attr_reader meta: Hash[String, untyped]?
9
-
10
- # @rbs config_options: Array[ACP::Types::SessionConfigOption]
11
- # @rbs meta: Hash[String, untyped]?
12
- # @rbs return: void
13
- def initialize: (config_options: Array[ACP::Types::SessionConfigOption], ?meta: Hash[String, untyped]?) -> void
14
-
15
- # @rbs hash: Hash[String, untyped]
16
- # @rbs return: ACP::Types::ConfigOptionUpdate
17
- def self.from_h: (Hash[String, untyped] hash) -> ACP::Types::ConfigOptionUpdate
18
-
19
- # @rbs return: Hash[String, untyped]
20
- def to_h: () -> Hash[String, untyped]
21
- end
3
+ class ACP::Types::ConfigOptionUpdate = ACP::Types::SessionUpdate::ConfigOptionUpdate
@@ -1,21 +1,3 @@
1
1
  # Generated from lib/acp/types/content.rb with RBS::Inline
2
2
 
3
- class ACP::Types::Content
4
- # @dynamic content
5
- attr_reader content: ACP::Types::ContentBlock::t
6
-
7
- # @dynamic meta
8
- attr_reader meta: Hash[String, untyped]?
9
-
10
- # @rbs content: ACP::Types::ContentBlock::t
11
- # @rbs meta: Hash[String, untyped]?
12
- # @rbs return: void
13
- def initialize: (content: ACP::Types::ContentBlock::t, ?meta: Hash[String, untyped]?) -> void
14
-
15
- # @rbs hash: Hash[String, untyped]
16
- # @rbs return: ACP::Types::Content
17
- def self.from_h: (Hash[String, untyped] hash) -> ACP::Types::Content
18
-
19
- # @rbs return: Hash[String, untyped]
20
- def to_h: () -> Hash[String, untyped]
21
- end
3
+ class ACP::Types::Content = ACP::Types::ToolCallContent::Content
@@ -1,6 +1,6 @@
1
- # Generated from lib/acp/types/elicitation_url_mode/scope.rb with RBS::Inline
1
+ # Generated from lib/acp/types/create_elicitation_request/mode/form/scope.rb with RBS::Inline
2
2
 
3
- module ACP::Types::ElicitationUrlMode::Scope
3
+ module ACP::Types::CreateElicitationRequest::Mode::Form::Scope
4
4
  type t = ACP::Types::ElicitationSessionScope | ACP::Types::ElicitationRequestScope | Hash[String, untyped]
5
5
 
6
6
  # @rbs hash: Hash[String, untyped]
@@ -5,12 +5,12 @@ class ACP::Types::CreateElicitationRequest::Mode::Form
5
5
  attr_reader requested_schema: ACP::Types::ElicitationSchema
6
6
 
7
7
  # @dynamic scope
8
- attr_reader scope: ACP::Types::ElicitationFormMode::Scope::t
8
+ attr_reader scope: ACP::Types::CreateElicitationRequest::Mode::Form::Scope::t
9
9
 
10
10
  # @rbs requested_schema: ACP::Types::ElicitationSchema
11
- # @rbs scope: ACP::Types::ElicitationFormMode::Scope::t
11
+ # @rbs scope: ACP::Types::CreateElicitationRequest::Mode::Form::Scope::t
12
12
  # @rbs return: void
13
- def initialize: (requested_schema: ACP::Types::ElicitationSchema, scope: ACP::Types::ElicitationFormMode::Scope::t) -> void
13
+ def initialize: (requested_schema: ACP::Types::ElicitationSchema, scope: ACP::Types::CreateElicitationRequest::Mode::Form::Scope::t) -> void
14
14
 
15
15
  # @rbs hash: Hash[String, untyped]
16
16
  # @rbs return: ACP::Types::CreateElicitationRequest::Mode::Form
@@ -1,6 +1,6 @@
1
- # Generated from lib/acp/types/elicitation_form_mode/scope.rb with RBS::Inline
1
+ # Generated from lib/acp/types/create_elicitation_request/mode/url/scope.rb with RBS::Inline
2
2
 
3
- module ACP::Types::ElicitationFormMode::Scope
3
+ module ACP::Types::CreateElicitationRequest::Mode::Url::Scope
4
4
  type t = ACP::Types::ElicitationSessionScope | ACP::Types::ElicitationRequestScope | Hash[String, untyped]
5
5
 
6
6
  # @rbs hash: Hash[String, untyped]
@@ -8,13 +8,13 @@ class ACP::Types::CreateElicitationRequest::Mode::Url
8
8
  attr_reader url: String
9
9
 
10
10
  # @dynamic scope
11
- attr_reader scope: ACP::Types::ElicitationUrlMode::Scope::t
11
+ attr_reader scope: ACP::Types::CreateElicitationRequest::Mode::Url::Scope::t
12
12
 
13
13
  # @rbs elicitation_id: String
14
14
  # @rbs url: String
15
- # @rbs scope: ACP::Types::ElicitationUrlMode::Scope::t
15
+ # @rbs scope: ACP::Types::CreateElicitationRequest::Mode::Url::Scope::t
16
16
  # @rbs return: void
17
- def initialize: (elicitation_id: String, url: String, scope: ACP::Types::ElicitationUrlMode::Scope::t) -> void
17
+ def initialize: (elicitation_id: String, url: String, scope: ACP::Types::CreateElicitationRequest::Mode::Url::Scope::t) -> void
18
18
 
19
19
  # @rbs hash: Hash[String, untyped]
20
20
  # @rbs return: ACP::Types::CreateElicitationRequest::Mode::Url
@@ -1,21 +1,3 @@
1
1
  # Generated from lib/acp/types/current_mode_update.rb with RBS::Inline
2
2
 
3
- class ACP::Types::CurrentModeUpdate
4
- # @dynamic current_mode_id
5
- attr_reader current_mode_id: String
6
-
7
- # @dynamic meta
8
- attr_reader meta: Hash[String, untyped]?
9
-
10
- # @rbs current_mode_id: String
11
- # @rbs meta: Hash[String, untyped]?
12
- # @rbs return: void
13
- def initialize: (current_mode_id: String, ?meta: Hash[String, untyped]?) -> void
14
-
15
- # @rbs hash: Hash[String, untyped]
16
- # @rbs return: ACP::Types::CurrentModeUpdate
17
- def self.from_h: (Hash[String, untyped] hash) -> ACP::Types::CurrentModeUpdate
18
-
19
- # @rbs return: Hash[String, untyped]
20
- def to_h: () -> Hash[String, untyped]
21
- end
3
+ class ACP::Types::CurrentModeUpdate = ACP::Types::SessionUpdate::CurrentModeUpdate
@@ -1,29 +1,3 @@
1
1
  # Generated from lib/acp/types/diff.rb with RBS::Inline
2
2
 
3
- class ACP::Types::Diff
4
- # @dynamic path
5
- attr_reader path: String
6
-
7
- # @dynamic old_text
8
- attr_reader old_text: String?
9
-
10
- # @dynamic new_text
11
- attr_reader new_text: String
12
-
13
- # @dynamic meta
14
- attr_reader meta: Hash[String, untyped]?
15
-
16
- # @rbs path: String
17
- # @rbs old_text: String?
18
- # @rbs new_text: String
19
- # @rbs meta: Hash[String, untyped]?
20
- # @rbs return: void
21
- def initialize: (path: String, new_text: String, ?old_text: String?, ?meta: Hash[String, untyped]?) -> void
22
-
23
- # @rbs hash: Hash[String, untyped]
24
- # @rbs return: ACP::Types::Diff
25
- def self.from_h: (Hash[String, untyped] hash) -> ACP::Types::Diff
26
-
27
- # @rbs return: Hash[String, untyped]
28
- def to_h: () -> Hash[String, untyped]
29
- end
3
+ class ACP::Types::Diff = ACP::Types::ToolCallContent::Diff
@@ -1,17 +1,3 @@
1
1
  # Generated from lib/acp/types/elicitation_accept_action.rb with RBS::Inline
2
2
 
3
- class ACP::Types::ElicitationAcceptAction
4
- # @dynamic content
5
- attr_reader content: Hash[String, String | Integer | Numeric | bool | Array[String]]?
6
-
7
- # @rbs content: (Hash[String, String | Integer | Numeric | bool | Array[String]])?
8
- # @rbs return: void
9
- def initialize: (?content: Hash[String, String | Integer | Numeric | bool | Array[String]]?) -> void
10
-
11
- # @rbs hash: Hash[String, untyped]
12
- # @rbs return: ACP::Types::ElicitationAcceptAction
13
- def self.from_h: (Hash[String, untyped] hash) -> ACP::Types::ElicitationAcceptAction
14
-
15
- # @rbs return: Hash[String, untyped]
16
- def to_h: () -> Hash[String, untyped]
17
- end
3
+ class ACP::Types::ElicitationAcceptAction = ACP::Types::CreateElicitationResponse::Action::Accept
@@ -1,21 +1,3 @@
1
1
  # Generated from lib/acp/types/elicitation_form_mode.rb with RBS::Inline
2
2
 
3
- class ACP::Types::ElicitationFormMode
4
- # @dynamic requested_schema
5
- attr_reader requested_schema: ACP::Types::ElicitationSchema
6
-
7
- # @dynamic scope
8
- attr_reader scope: ACP::Types::ElicitationFormMode::Scope::t
9
-
10
- # @rbs requested_schema: ACP::Types::ElicitationSchema
11
- # @rbs scope: ACP::Types::ElicitationFormMode::Scope::t
12
- # @rbs return: void
13
- def initialize: (requested_schema: ACP::Types::ElicitationSchema, scope: ACP::Types::ElicitationFormMode::Scope::t) -> void
14
-
15
- # @rbs hash: Hash[String, untyped]
16
- # @rbs return: ACP::Types::ElicitationFormMode
17
- def self.from_h: (Hash[String, untyped] hash) -> ACP::Types::ElicitationFormMode
18
-
19
- # @rbs return: Hash[String, untyped]
20
- def to_h: () -> Hash[String, untyped]
21
- end
3
+ class ACP::Types::ElicitationFormMode = ACP::Types::CreateElicitationRequest::Mode::Form
@@ -1,25 +1,3 @@
1
1
  # Generated from lib/acp/types/elicitation_url_mode.rb with RBS::Inline
2
2
 
3
- class ACP::Types::ElicitationUrlMode
4
- # @dynamic elicitation_id
5
- attr_reader elicitation_id: String
6
-
7
- # @dynamic url
8
- attr_reader url: String
9
-
10
- # @dynamic scope
11
- attr_reader scope: ACP::Types::ElicitationUrlMode::Scope::t
12
-
13
- # @rbs elicitation_id: String
14
- # @rbs url: String
15
- # @rbs scope: ACP::Types::ElicitationUrlMode::Scope::t
16
- # @rbs return: void
17
- def initialize: (elicitation_id: String, url: String, scope: ACP::Types::ElicitationUrlMode::Scope::t) -> void
18
-
19
- # @rbs hash: Hash[String, untyped]
20
- # @rbs return: ACP::Types::ElicitationUrlMode
21
- def self.from_h: (Hash[String, untyped] hash) -> ACP::Types::ElicitationUrlMode
22
-
23
- # @rbs return: Hash[String, untyped]
24
- def to_h: () -> Hash[String, untyped]
25
- end
3
+ class ACP::Types::ElicitationUrlMode = ACP::Types::CreateElicitationRequest::Mode::Url
@@ -1,25 +1,3 @@
1
1
  # Generated from lib/acp/types/embedded_resource.rb with RBS::Inline
2
2
 
3
- class ACP::Types::EmbeddedResource
4
- # @dynamic annotations
5
- attr_reader annotations: ACP::Types::Annotations?
6
-
7
- # @dynamic resource
8
- attr_reader resource: ACP::Types::EmbeddedResourceResource::t
9
-
10
- # @dynamic meta
11
- attr_reader meta: Hash[String, untyped]?
12
-
13
- # @rbs annotations: ACP::Types::Annotations?
14
- # @rbs resource: ACP::Types::EmbeddedResourceResource::t
15
- # @rbs meta: Hash[String, untyped]?
16
- # @rbs return: void
17
- def initialize: (resource: ACP::Types::EmbeddedResourceResource::t, ?annotations: ACP::Types::Annotations?, ?meta: Hash[String, untyped]?) -> void
18
-
19
- # @rbs hash: Hash[String, untyped]
20
- # @rbs return: ACP::Types::EmbeddedResource
21
- def self.from_h: (Hash[String, untyped] hash) -> ACP::Types::EmbeddedResource
22
-
23
- # @rbs return: Hash[String, untyped]
24
- def to_h: () -> Hash[String, untyped]
25
- end
3
+ class ACP::Types::EmbeddedResource = ACP::Types::ContentBlock::Resource
@@ -1,33 +1,3 @@
1
1
  # Generated from lib/acp/types/image_content.rb with RBS::Inline
2
2
 
3
- class ACP::Types::ImageContent
4
- # @dynamic annotations
5
- attr_reader annotations: ACP::Types::Annotations?
6
-
7
- # @dynamic data
8
- attr_reader data: String
9
-
10
- # @dynamic mime_type
11
- attr_reader mime_type: String
12
-
13
- # @dynamic uri
14
- attr_reader uri: String?
15
-
16
- # @dynamic meta
17
- attr_reader meta: Hash[String, untyped]?
18
-
19
- # @rbs annotations: ACP::Types::Annotations?
20
- # @rbs data: String
21
- # @rbs mime_type: String
22
- # @rbs uri: String?
23
- # @rbs meta: Hash[String, untyped]?
24
- # @rbs return: void
25
- def initialize: (data: String, mime_type: String, ?annotations: ACP::Types::Annotations?, ?uri: String?, ?meta: Hash[String, untyped]?) -> void
26
-
27
- # @rbs hash: Hash[String, untyped]
28
- # @rbs return: ACP::Types::ImageContent
29
- def self.from_h: (Hash[String, untyped] hash) -> ACP::Types::ImageContent
30
-
31
- # @rbs return: Hash[String, untyped]
32
- def to_h: () -> Hash[String, untyped]
33
- end
3
+ class ACP::Types::ImageContent = ACP::Types::ContentBlock::Image