acp-sdk 0.14.0 → 0.14.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: baf3230fbed41f9fac37c739b21bfe649fb83566b36d22930fb410a5904fa059
4
- data.tar.gz: 4a1ff54c9f5d5af5534d37fcd2b2886a0624a8ee582e00392e0952634c3cda56
3
+ metadata.gz: f63cff05b42332991d19e7f8f81d743a7d93f6e0e8da77ead99b1ee0a59969e6
4
+ data.tar.gz: ea4a2c494ce6fda24d53127c98bb4b5918f7bc5e7107a8c1610216f3691c9312
5
5
  SHA512:
6
- metadata.gz: 4b8547d48ebfdf296f218e1a2c7f1bb9d727bf86b5f02de6b7b2e5230a175d408783dafcde63677c800344bed52003c2ecc58b830a134902daaa600341b9875a
7
- data.tar.gz: b85b63b6ccccfaab69409933376f7d5e691c0e7619227f92861c417f7fd2517b172a271224225ee40eb1f88c9cba3f55e4dd0c1685e8c9a9663bd1432daec0c3
6
+ metadata.gz: 997dfbc53e4e4a06df9977098694d5b0ebc4486b2a887b60a57c3dceb4bacdba1ac1d82409084eca978893ee9f3b9f0e22581dc53badb279bf46fbd1549954e0
7
+ data.tar.gz: 168c98bb2a38a78cb9eb5566ea7029923cfa6d271f55c349e3c0d6bc0775d1a7f1e8dd080ad1100e1f7a4da658d37af9ba68ea8b761a3db68d4dee32d2120280
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.14.1](https://github.com/bottrall/acp-sdk/compare/v0.14.0...v0.14.1) (2026-11-15)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * support Ruby 3.3 ([#189](https://github.com/bottrall/acp-sdk/issues/189)) ([6f868cd](https://github.com/bottrall/acp-sdk/commit/6f868cdc8f1117681e8af746b7b51cd04367a253))
9
+
3
10
  ## [0.14.0](https://github.com/bottrall/acp-sdk/compare/v0.13.0...v0.14.0) (2026-10-24)
4
11
 
5
12
 
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jake Bottrall
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -12,7 +12,7 @@ Every ACP message is a typed Ruby object, and the SDK takes care of the wire for
12
12
 
13
13
  ## Installation
14
14
 
15
- Requires Ruby 3.4 or later.
15
+ Requires Ruby 3.3 or later.
16
16
 
17
17
  ```sh
18
18
  bundle add acp-sdk
@@ -217,4 +217,4 @@ Bug reports and pull requests are welcome on [GitHub](https://github.com/bottral
217
217
 
218
218
  ## License
219
219
 
220
- Released under the [MIT License](LICENSE.txt).
220
+ Released under the [MIT License](LICENSE).
@@ -276,6 +276,6 @@ class ACP::AgentConnection
276
276
  return response unless response.is_a?(ACP::Types::NewSessionResponse) && agent.respond_to?(:session_created)
277
277
 
278
278
  hook = agent #: ACP::AgentConnection::_Agent & ACP::AgentConnection::_SessionCreated
279
- ACP::Transport::Reply.new(response, after: -> { hook.session_created(response) })
279
+ ACP::Transport::Reply.new(result: response, after: -> { hook.session_created(response) })
280
280
  end
281
281
  end
@@ -11,19 +11,27 @@ class ACP::ClientConnection::Inbound
11
11
  # @rbs @extension_notifications: Hash[String, ^(untyped) -> void]
12
12
  # @rbs @capabilities: ACP::Types::ClientCapabilities?
13
13
 
14
+ Route = Data.define(
15
+ :rpc_method, #: String
16
+ :type, #: ACP::Transport::_Parser
17
+ :handler_method, #: Symbol
18
+ :path, #: Array[Symbol]
19
+ :capability #: String
20
+ )
21
+
14
22
  FS_ROUTES = [
15
23
  Route.new(
16
24
  rpc_method: 'fs/read_text_file',
17
25
  type: ACP::Types::ReadTextFileRequest,
18
26
  handler_method: :read_text_file,
19
- path: %i[fs read_text_file],
27
+ path: %i[fs read_text_file].freeze,
20
28
  capability: 'fs.readTextFile'
21
29
  ),
22
30
  Route.new(
23
31
  rpc_method: 'fs/write_text_file',
24
32
  type: ACP::Types::WriteTextFileRequest,
25
33
  handler_method: :write_text_file,
26
- path: %i[fs write_text_file],
34
+ path: %i[fs write_text_file].freeze,
27
35
  capability: 'fs.writeTextFile'
28
36
  )
29
37
  ].freeze #: Array[ACP::ClientConnection::Inbound::Route]
@@ -37,35 +45,35 @@ class ACP::ClientConnection::Inbound
37
45
  rpc_method: 'terminal/create',
38
46
  type: ACP::Types::CreateTerminalRequest,
39
47
  handler_method: :create_terminal,
40
- path: %i[terminal],
48
+ path: %i[terminal].freeze,
41
49
  capability: 'terminal'
42
50
  ),
43
51
  Route.new(
44
52
  rpc_method: 'terminal/output',
45
53
  type: ACP::Types::TerminalOutputRequest,
46
54
  handler_method: :terminal_output,
47
- path: %i[terminal],
55
+ path: %i[terminal].freeze,
48
56
  capability: 'terminal'
49
57
  ),
50
58
  Route.new(
51
59
  rpc_method: 'terminal/wait_for_exit',
52
60
  type: ACP::Types::WaitForTerminalExitRequest,
53
61
  handler_method: :wait_for_terminal_exit,
54
- path: %i[terminal],
62
+ path: %i[terminal].freeze,
55
63
  capability: 'terminal'
56
64
  ),
57
65
  Route.new(
58
66
  rpc_method: 'terminal/kill',
59
67
  type: ACP::Types::KillTerminalRequest,
60
68
  handler_method: :kill_terminal,
61
- path: %i[terminal],
69
+ path: %i[terminal].freeze,
62
70
  capability: 'terminal'
63
71
  ),
64
72
  Route.new(
65
73
  rpc_method: 'terminal/release',
66
74
  type: ACP::Types::ReleaseTerminalRequest,
67
75
  handler_method: :release_terminal,
68
- path: %i[terminal],
76
+ path: %i[terminal].freeze,
69
77
  capability: 'terminal'
70
78
  )
71
79
  ].freeze #: Array[ACP::ClientConnection::Inbound::Route]
@@ -145,8 +145,7 @@ class ACP::ClientConnection
145
145
 
146
146
  # @rbs request: ACP::Types::Unstable::SetProviderRequest
147
147
  # @rbs return: (ACP::Types::Unstable::SetProviderResponse | ACP::RequestError)
148
- # The name is the wire-mandated providers/set, not an attribute writer.
149
- def set_provider(request) # rubocop:disable Naming/AccessorMethodName
148
+ def set_provider(request) # rubocop:disable Naming/AccessorMethodName -- wire-mandated providers/set, not a writer
150
149
  parse(ACP::Types::Unstable::SetProviderResponse, @transport.request('providers/set', request.to_h))
151
150
  end
152
151
 
@@ -169,8 +168,7 @@ class ACP::ClientConnection
169
168
 
170
169
  # @rbs request: ACP::Types::SetSessionModeRequest
171
170
  # @rbs return: ACP::Types::SetSessionModeResponse | ACP::RequestError
172
- # The name is the wire-mandated session/set_mode, not an attribute writer.
173
- def set_session_mode(request) # rubocop:disable Naming/AccessorMethodName
171
+ def set_session_mode(request) # rubocop:disable Naming/AccessorMethodName -- wire-mandated session/set_mode, not a writer
174
172
  parse(ACP::Types::SetSessionModeResponse, @transport.request('session/set_mode', request.to_h))
175
173
  end
176
174
 
@@ -179,8 +177,7 @@ class ACP::ClientConnection
179
177
  #
180
178
  # @rbs request: ACP::Types::SetSessionConfigOptionRequest
181
179
  # @rbs return: ACP::Types::SetSessionConfigOptionResponse | ACP::RequestError
182
- # The name is the wire-mandated session/set_config_option, not an attribute writer.
183
- def set_session_config_option(request) # rubocop:disable Naming/AccessorMethodName
180
+ def set_session_config_option(request) # rubocop:disable Naming/AccessorMethodName -- wire-mandated session/set_config_option, not a writer
184
181
  parse(ACP::Types::SetSessionConfigOptionResponse, @transport.request('session/set_config_option', request.to_h))
185
182
  end
186
183
 
@@ -1,18 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class ACP::Transport::Reply
4
- # @dynamic result
5
- attr_reader :result #: ACP::Transport::_Response
6
-
7
- # @dynamic after
8
- attr_reader :after #: ^() -> void
9
-
10
- # @rbs result: ACP::Transport::_Response
11
- # @rbs after: ^() -> void
12
- # @rbs return: void
13
- def initialize(result, after:)
14
- @result = result
15
- @after = after
16
- freeze
17
- end
3
+ module ACP::Transport
4
+ Reply = Data.define(
5
+ :result, #: ACP::Transport::_Response
6
+ :after #: ^() -> void
7
+ )
18
8
  end
@@ -19,6 +19,11 @@ class ACP::Transport::Stdio
19
19
 
20
20
  CONNECTION_CLOSED = ACP::RequestError::CONNECTION_CLOSED #: ACP::RequestError
21
21
 
22
+ Serving = Data.define(
23
+ :id, #: untyped
24
+ :cancellation #: ACP::Transport::Cancellation
25
+ )
26
+
22
27
  # @rbs input: _Reader
23
28
  # @rbs output: _Writer
24
29
  # @rbs logger: ACP::Transport::_Logger
data/lib/acp/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ACP
4
- VERSION = '0.14.0'
4
+ VERSION = '0.14.1'
5
5
  end
@@ -17,6 +17,25 @@ class ACP::ClientConnection::Inbound
17
17
 
18
18
  @fs: ACP::ClientConnection::_FileSystem?
19
19
 
20
+ class Route < Data
21
+ attr_reader rpc_method(): String
22
+
23
+ attr_reader type(): ACP::Transport::_Parser
24
+
25
+ attr_reader handler_method(): Symbol
26
+
27
+ attr_reader path(): Array[Symbol]
28
+
29
+ attr_reader capability(): String
30
+
31
+ def self.new: (String rpc_method, ACP::Transport::_Parser type, Symbol handler_method, Array[Symbol] path, String capability) -> instance
32
+ | (rpc_method: String, type: ACP::Transport::_Parser, handler_method: Symbol, path: Array[Symbol], capability: String) -> instance
33
+
34
+ def self.members: () -> [ :rpc_method, :type, :handler_method, :path, :capability ]
35
+
36
+ def members: () -> [ :rpc_method, :type, :handler_method, :path, :capability ]
37
+ end
38
+
20
39
  FS_ROUTES: Array[ACP::ClientConnection::Inbound::Route]
21
40
 
22
41
  # The terminal capability is a single bool, so its five routes share one
@@ -82,7 +82,6 @@ class ACP::ClientConnection
82
82
 
83
83
  # @rbs request: ACP::Types::Unstable::SetProviderRequest
84
84
  # @rbs return: (ACP::Types::Unstable::SetProviderResponse | ACP::RequestError)
85
- # The name is the wire-mandated providers/set, not an attribute writer.
86
85
  def set_provider: (ACP::Types::Unstable::SetProviderRequest request) -> (ACP::Types::Unstable::SetProviderResponse | ACP::RequestError)
87
86
 
88
87
  # @rbs request: ACP::Types::Unstable::DisableProviderRequest
@@ -99,7 +98,6 @@ class ACP::ClientConnection
99
98
 
100
99
  # @rbs request: ACP::Types::SetSessionModeRequest
101
100
  # @rbs return: ACP::Types::SetSessionModeResponse | ACP::RequestError
102
- # The name is the wire-mandated session/set_mode, not an attribute writer.
103
101
  def set_session_mode: (ACP::Types::SetSessionModeRequest request) -> (ACP::Types::SetSessionModeResponse | ACP::RequestError)
104
102
 
105
103
  # The reply carries the session's complete option list, so it replaces any
@@ -107,7 +105,6 @@ class ACP::ClientConnection
107
105
  #
108
106
  # @rbs request: ACP::Types::SetSessionConfigOptionRequest
109
107
  # @rbs return: ACP::Types::SetSessionConfigOptionResponse | ACP::RequestError
110
- # The name is the wire-mandated session/set_config_option, not an attribute writer.
111
108
  def set_session_config_option: (ACP::Types::SetSessionConfigOptionRequest request) -> (ACP::Types::SetSessionConfigOptionResponse | ACP::RequestError)
112
109
 
113
110
  # @rbs request: ACP::Types::AuthenticateRequest
@@ -1,14 +1,16 @@
1
1
  # Generated from lib/acp/transport/reply.rb with RBS::Inline
2
2
 
3
- class ACP::Transport::Reply
4
- # @dynamic result
5
- attr_reader result: ACP::Transport::_Response
3
+ module ACP::Transport
4
+ class Reply < Data
5
+ attr_reader result(): ACP::Transport::_Response
6
6
 
7
- # @dynamic after
8
- attr_reader after: ^() -> void
7
+ attr_reader after(): ^() -> void
9
8
 
10
- # @rbs result: ACP::Transport::_Response
11
- # @rbs after: ^() -> void
12
- # @rbs return: void
13
- def initialize: (ACP::Transport::_Response result, after: ^() -> void) -> void
9
+ def self.new: (ACP::Transport::_Response result, ^() -> void after) -> instance
10
+ | (result: ACP::Transport::_Response, after: ^() -> void) -> instance
11
+
12
+ def self.members: () -> [ :result, :after ]
13
+
14
+ def members: () -> [ :result, :after ]
15
+ end
14
16
  end
@@ -25,6 +25,19 @@ class ACP::Transport::Stdio
25
25
 
26
26
  CONNECTION_CLOSED: ACP::RequestError
27
27
 
28
+ class Serving < Data
29
+ attr_reader id(): untyped
30
+
31
+ attr_reader cancellation(): ACP::Transport::Cancellation
32
+
33
+ def self.new: (untyped id, ACP::Transport::Cancellation cancellation) -> instance
34
+ | (id: untyped, cancellation: ACP::Transport::Cancellation) -> instance
35
+
36
+ def self.members: () -> [ :id, :cancellation ]
37
+
38
+ def members: () -> [ :id, :cancellation ]
39
+ end
40
+
28
41
  # @rbs input: _Reader
29
42
  # @rbs output: _Writer
30
43
  # @rbs logger: ACP::Transport::_Logger
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acp-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jake Bottrall
@@ -30,7 +30,7 @@ extensions: []
30
30
  extra_rdoc_files: []
31
31
  files:
32
32
  - CHANGELOG.md
33
- - LICENSE.txt
33
+ - LICENSE
34
34
  - README.md
35
35
  - lib/acp/agent_connection.rb
36
36
  - lib/acp/agent_connection/client.rb
@@ -39,7 +39,6 @@ files:
39
39
  - lib/acp/client_connection.rb
40
40
  - lib/acp/client_connection/elicitations.rb
41
41
  - lib/acp/client_connection/inbound.rb
42
- - lib/acp/client_connection/inbound/route.rb
43
42
  - lib/acp/client_connection/streams.rb
44
43
  - lib/acp/extensions.rb
45
44
  - lib/acp/protocol.rb
@@ -50,7 +49,6 @@ files:
50
49
  - lib/acp/transport/reply.rb
51
50
  - lib/acp/transport/stderr_logger.rb
52
51
  - lib/acp/transport/stdio.rb
53
- - lib/acp/transport/stdio/serving.rb
54
52
  - lib/acp/types.rb
55
53
  - lib/acp/types/agent_auth_capabilities.rb
56
54
  - lib/acp/types/agent_capabilities.rb
@@ -399,7 +397,6 @@ files:
399
397
  - sig/generated/acp/client_connection.rbs
400
398
  - sig/generated/acp/client_connection/elicitations.rbs
401
399
  - sig/generated/acp/client_connection/inbound.rbs
402
- - sig/generated/acp/client_connection/inbound/route.rbs
403
400
  - sig/generated/acp/client_connection/streams.rbs
404
401
  - sig/generated/acp/extensions.rbs
405
402
  - sig/generated/acp/protocol.rbs
@@ -410,7 +407,6 @@ files:
410
407
  - sig/generated/acp/transport/reply.rbs
411
408
  - sig/generated/acp/transport/stderr_logger.rbs
412
409
  - sig/generated/acp/transport/stdio.rbs
413
- - sig/generated/acp/transport/stdio/serving.rbs
414
410
  - sig/generated/acp/types.rbs
415
411
  - sig/generated/acp/types/agent_auth_capabilities.rbs
416
412
  - sig/generated/acp/types/agent_capabilities.rbs
@@ -773,14 +769,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
773
769
  requirements:
774
770
  - - ">="
775
771
  - !ruby/object:Gem::Version
776
- version: '3.4'
772
+ version: '3.3'
777
773
  required_rubygems_version: !ruby/object:Gem::Requirement
778
774
  requirements:
779
775
  - - ">="
780
776
  - !ruby/object:Gem::Version
781
777
  version: '0'
782
778
  requirements: []
783
- rubygems_version: 4.0.16
779
+ rubygems_version: 4.0.20
784
780
  specification_version: 4
785
781
  summary: A Ruby SDK for the Agent Client Protocol.
786
782
  test_files: []
data/LICENSE.txt DELETED
@@ -1,9 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2026 Jake Bottrall
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
-
7
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class ACP::ClientConnection::Inbound::Route
4
- # @dynamic rpc_method
5
- attr_reader :rpc_method #: String
6
- # @dynamic type
7
- attr_reader :type #: ACP::Transport::_Parser
8
- # @dynamic handler_method
9
- attr_reader :handler_method #: Symbol
10
- # @dynamic path
11
- attr_reader :path #: Array[Symbol]
12
- # @dynamic capability
13
- attr_reader :capability #: String
14
-
15
- # @rbs rpc_method: String
16
- # @rbs type: ACP::Transport::_Parser
17
- # @rbs handler_method: Symbol
18
- # @rbs path: Array[Symbol]
19
- # @rbs capability: String
20
- # @rbs return: void
21
- def initialize(rpc_method:, type:, handler_method:, path:, capability:)
22
- @rpc_method = rpc_method
23
- @type = type
24
- @handler_method = handler_method
25
- @path = path.freeze
26
- @capability = capability
27
- freeze
28
- end
29
- end
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class ACP::Transport::Stdio::Serving
4
- # @dynamic id
5
- attr_reader :id #: untyped
6
-
7
- # @dynamic cancellation
8
- attr_reader :cancellation #: ACP::Transport::Cancellation
9
-
10
- # @rbs id: untyped
11
- # @rbs cancellation: ACP::Transport::Cancellation
12
- # @rbs return: void
13
- def initialize(id:, cancellation:)
14
- @id = id
15
- @cancellation = cancellation
16
- freeze
17
- end
18
- end
@@ -1,26 +0,0 @@
1
- # Generated from lib/acp/client_connection/inbound/route.rb with RBS::Inline
2
-
3
- class ACP::ClientConnection::Inbound::Route
4
- # @dynamic rpc_method
5
- attr_reader rpc_method: String
6
-
7
- # @dynamic type
8
- attr_reader type: ACP::Transport::_Parser
9
-
10
- # @dynamic handler_method
11
- attr_reader handler_method: Symbol
12
-
13
- # @dynamic path
14
- attr_reader path: Array[Symbol]
15
-
16
- # @dynamic capability
17
- attr_reader capability: String
18
-
19
- # @rbs rpc_method: String
20
- # @rbs type: ACP::Transport::_Parser
21
- # @rbs handler_method: Symbol
22
- # @rbs path: Array[Symbol]
23
- # @rbs capability: String
24
- # @rbs return: void
25
- def initialize: (rpc_method: String, type: ACP::Transport::_Parser, handler_method: Symbol, path: Array[Symbol], capability: String) -> void
26
- end
@@ -1,14 +0,0 @@
1
- # Generated from lib/acp/transport/stdio/serving.rb with RBS::Inline
2
-
3
- class ACP::Transport::Stdio::Serving
4
- # @dynamic id
5
- attr_reader id: untyped
6
-
7
- # @dynamic cancellation
8
- attr_reader cancellation: ACP::Transport::Cancellation
9
-
10
- # @rbs id: untyped
11
- # @rbs cancellation: ACP::Transport::Cancellation
12
- # @rbs return: void
13
- def initialize: (id: untyped, cancellation: ACP::Transport::Cancellation) -> void
14
- end