acp-sdk 0.2.0 → 0.3.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.
@@ -1,4 +1,10 @@
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
+ interface _ToH
5
+ def to_h: () -> Hash[String, untyped]
6
+ end
7
+
2
8
  interface _Reader
3
9
  def each_line: () { (String) -> void } -> untyped
4
10
  end
@@ -9,7 +15,7 @@ class ACP::Transport::Stdio
9
15
  end
10
16
 
11
17
  interface _Handler
12
- def call: (untyped params) -> (ACP::Transport::Result | ACP::Transport::Reply)
18
+ def call: (untyped params) -> (_ToH | ACP::RequestError | ACP::Transport::Reply)
13
19
  end
14
20
 
15
21
  interface _NotificationHandler
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.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jake Bottrall
@@ -41,12 +41,12 @@ files:
41
41
  - lib/acp/agent_connection/optional_method/list_sessions.rb
42
42
  - lib/acp/agent_connection/optional_method/load_session.rb
43
43
  - lib/acp/agent_connection/optional_method/resume_session.rb
44
+ - lib/acp/agent_process.rb
44
45
  - lib/acp/client_connection.rb
46
+ - lib/acp/request_error.rb
45
47
  - lib/acp/sdk.rb
46
48
  - lib/acp/transport.rb
47
49
  - lib/acp/transport/reply.rb
48
- - lib/acp/transport/response_error.rb
49
- - lib/acp/transport/result.rb
50
50
  - lib/acp/transport/stdio.rb
51
51
  - lib/acp/types.rb
52
52
  - lib/acp/types/agent_auth_capabilities.rb
@@ -254,12 +254,12 @@ files:
254
254
  - sig/generated/acp/agent_connection/optional_method/list_sessions.rbs
255
255
  - sig/generated/acp/agent_connection/optional_method/load_session.rbs
256
256
  - sig/generated/acp/agent_connection/optional_method/resume_session.rbs
257
+ - sig/generated/acp/agent_process.rbs
257
258
  - sig/generated/acp/client_connection.rbs
259
+ - sig/generated/acp/request_error.rbs
258
260
  - sig/generated/acp/sdk.rbs
259
261
  - sig/generated/acp/transport.rbs
260
262
  - sig/generated/acp/transport/reply.rbs
261
- - sig/generated/acp/transport/response_error.rbs
262
- - sig/generated/acp/transport/result.rbs
263
263
  - sig/generated/acp/transport/stdio.rbs
264
264
  - sig/generated/acp/types.rbs
265
265
  - sig/generated/acp/types/agent_auth_capabilities.rbs
@@ -465,6 +465,7 @@ files:
465
465
  - sig/manual/acp/agent_connection/optional_method/list_sessions.rbs
466
466
  - sig/manual/acp/agent_connection/optional_method/load_session.rbs
467
467
  - sig/manual/acp/agent_connection/optional_method/resume_session.rbs
468
+ - sig/manual/acp/agent_process.rbs
468
469
  - sig/manual/acp/client_connection.rbs
469
470
  - sig/manual/acp/transport/stdio.rbs
470
471
  homepage: https://github.com/bottrall/acp-sdk
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class ACP::Transport::ResponseError
4
- # @dynamic code
5
- attr_reader :code #: Integer
6
-
7
- # @dynamic message
8
- attr_reader :message #: String
9
-
10
- # @dynamic data
11
- attr_reader :data #: untyped
12
-
13
- # @rbs code: Integer
14
- # @rbs message: String
15
- # @rbs data: untyped
16
- # @rbs return: void
17
- def initialize(code:, message:, data: nil)
18
- @code = code
19
- @message = message
20
- @data = data
21
- freeze
22
- end
23
-
24
- # @rbs return: Hash[String, untyped]
25
- def to_h
26
- { 'code' => code, 'message' => message, 'data' => data }.compact
27
- end
28
- end
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class ACP::Transport::Result
4
- # @dynamic value
5
- attr_reader :value #: untyped
6
-
7
- # @dynamic error
8
- attr_reader :error #: ACP::Transport::ResponseError?
9
-
10
- # @rbs value: untyped
11
- # @rbs return: ACP::Transport::Result
12
- def self.ok(value)
13
- new(value:, error: nil)
14
- end
15
-
16
- # @rbs error: ACP::Transport::ResponseError
17
- # @rbs return: ACP::Transport::Result
18
- def self.error(error)
19
- new(value: nil, error:)
20
- end
21
-
22
- # @rbs value: untyped
23
- # @rbs error: ACP::Transport::ResponseError?
24
- # @rbs return: void
25
- def initialize(value:, error:)
26
- @value = value
27
- @error = error
28
- freeze
29
- end
30
-
31
- # @rbs return: bool
32
- def ok?
33
- error.nil?
34
- end
35
- end
@@ -1,21 +0,0 @@
1
- # Generated from lib/acp/transport/response_error.rb with RBS::Inline
2
-
3
- class ACP::Transport::ResponseError
4
- # @dynamic code
5
- attr_reader code: Integer
6
-
7
- # @dynamic message
8
- attr_reader message: String
9
-
10
- # @dynamic data
11
- attr_reader data: untyped
12
-
13
- # @rbs code: Integer
14
- # @rbs message: String
15
- # @rbs data: untyped
16
- # @rbs return: void
17
- def initialize: (code: Integer, message: String, ?data: untyped) -> void
18
-
19
- # @rbs return: Hash[String, untyped]
20
- def to_h: () -> Hash[String, untyped]
21
- end
@@ -1,25 +0,0 @@
1
- # Generated from lib/acp/transport/result.rb with RBS::Inline
2
-
3
- class ACP::Transport::Result
4
- # @dynamic value
5
- attr_reader value: untyped
6
-
7
- # @dynamic error
8
- attr_reader error: ACP::Transport::ResponseError?
9
-
10
- # @rbs value: untyped
11
- # @rbs return: ACP::Transport::Result
12
- def self.ok: (untyped value) -> ACP::Transport::Result
13
-
14
- # @rbs error: ACP::Transport::ResponseError
15
- # @rbs return: ACP::Transport::Result
16
- def self.error: (ACP::Transport::ResponseError error) -> ACP::Transport::Result
17
-
18
- # @rbs value: untyped
19
- # @rbs error: ACP::Transport::ResponseError?
20
- # @rbs return: void
21
- def initialize: (value: untyped, error: ACP::Transport::ResponseError?) -> void
22
-
23
- # @rbs return: bool
24
- def ok?: () -> bool
25
- end