acp-sdk 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/README.md +141 -69
- data/lib/acp/agent_connection/client.rb +2 -3
- data/lib/acp/agent_connection/optional_route.rb +45 -0
- data/lib/acp/agent_connection.rb +120 -76
- data/lib/acp/agent_process.rb +4 -4
- data/lib/acp/client_connection/elicitations.rb +44 -0
- data/lib/acp/client_connection/inbound/route.rb +29 -0
- data/lib/acp/client_connection/inbound.rb +232 -0
- data/lib/acp/client_connection/streams.rb +20 -52
- data/lib/acp/client_connection.rb +34 -309
- data/lib/acp/extensions.rb +6 -0
- data/lib/acp/protocol.rb +14 -4
- data/lib/acp/transport/reply.rb +2 -2
- data/lib/acp/transport/stdio.rb +2 -2
- data/lib/acp/types/parse_error.rb +1 -1
- data/lib/acp/types.rb +13 -0
- data/lib/acp/version.rb +1 -1
- data/sig/generated/acp/agent_connection/optional_route.rbs +35 -0
- data/sig/generated/acp/agent_connection.rbs +5 -21
- data/sig/generated/acp/client_connection/elicitations.rbs +29 -0
- data/sig/generated/acp/client_connection/inbound/route.rbs +26 -0
- data/sig/generated/acp/client_connection/inbound.rbs +90 -0
- data/sig/generated/acp/client_connection/streams.rbs +7 -28
- data/sig/generated/acp/client_connection.rbs +12 -136
- data/sig/generated/acp/extensions.rbs +4 -0
- data/sig/generated/acp/protocol.rbs +8 -0
- data/sig/generated/acp/transport/reply.rbs +3 -3
- data/sig/generated/acp/transport/stdio.rbs +4 -4
- data/sig/generated/acp/types.rbs +9 -0
- data/sig/manual/acp/agent_connection.rbs +5 -57
- data/sig/manual/acp/client_connection.rbs +27 -0
- data/sig/manual/acp/transport/stdio.rbs +1 -5
- metadata +9 -5
- data/lib/acp/agent_connection/optional_method/spec.rb +0 -42
- data/lib/acp/agent_connection/optional_method.rb +0 -40
- data/sig/generated/acp/agent_connection/optional_method/spec.rbs +0 -32
- data/sig/generated/acp/agent_connection/optional_method.rbs +0 -7
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
class ACP::Transport::Stdio
|
|
2
|
-
interface _ToH
|
|
3
|
-
def to_h: () -> Hash[String, untyped]
|
|
4
|
-
end
|
|
5
|
-
|
|
6
2
|
interface _Reader
|
|
7
3
|
def each_line: () { (String) -> void } -> untyped
|
|
8
4
|
end
|
|
@@ -13,7 +9,7 @@ class ACP::Transport::Stdio
|
|
|
13
9
|
end
|
|
14
10
|
|
|
15
11
|
interface _Handler
|
|
16
|
-
def call: (untyped params) -> (
|
|
12
|
+
def call: (untyped params) -> (ACP::Transport::_Response | ACP::RequestError | ACP::Transport::Reply)
|
|
17
13
|
end
|
|
18
14
|
|
|
19
15
|
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.
|
|
4
|
+
version: 0.14.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jake Bottrall
|
|
@@ -34,10 +34,12 @@ files:
|
|
|
34
34
|
- README.md
|
|
35
35
|
- lib/acp/agent_connection.rb
|
|
36
36
|
- lib/acp/agent_connection/client.rb
|
|
37
|
-
- lib/acp/agent_connection/
|
|
38
|
-
- lib/acp/agent_connection/optional_method/spec.rb
|
|
37
|
+
- lib/acp/agent_connection/optional_route.rb
|
|
39
38
|
- lib/acp/agent_process.rb
|
|
40
39
|
- lib/acp/client_connection.rb
|
|
40
|
+
- lib/acp/client_connection/elicitations.rb
|
|
41
|
+
- lib/acp/client_connection/inbound.rb
|
|
42
|
+
- lib/acp/client_connection/inbound/route.rb
|
|
41
43
|
- lib/acp/client_connection/streams.rb
|
|
42
44
|
- lib/acp/extensions.rb
|
|
43
45
|
- lib/acp/protocol.rb
|
|
@@ -392,10 +394,12 @@ files:
|
|
|
392
394
|
- lib/acp/version.rb
|
|
393
395
|
- sig/generated/acp/agent_connection.rbs
|
|
394
396
|
- sig/generated/acp/agent_connection/client.rbs
|
|
395
|
-
- sig/generated/acp/agent_connection/
|
|
396
|
-
- sig/generated/acp/agent_connection/optional_method/spec.rbs
|
|
397
|
+
- sig/generated/acp/agent_connection/optional_route.rbs
|
|
397
398
|
- sig/generated/acp/agent_process.rbs
|
|
398
399
|
- sig/generated/acp/client_connection.rbs
|
|
400
|
+
- sig/generated/acp/client_connection/elicitations.rbs
|
|
401
|
+
- sig/generated/acp/client_connection/inbound.rbs
|
|
402
|
+
- sig/generated/acp/client_connection/inbound/route.rbs
|
|
399
403
|
- sig/generated/acp/client_connection/streams.rbs
|
|
400
404
|
- sig/generated/acp/extensions.rbs
|
|
401
405
|
- sig/generated/acp/protocol.rbs
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
class ACP::AgentConnection::OptionalMethod::Spec
|
|
4
|
-
# @dynamic rpc_method
|
|
5
|
-
attr_reader :rpc_method #: String
|
|
6
|
-
# @dynamic agent_method
|
|
7
|
-
attr_reader :agent_method #: Symbol
|
|
8
|
-
# @dynamic path
|
|
9
|
-
attr_reader :path #: Array[Symbol]
|
|
10
|
-
|
|
11
|
-
# @rbs rpc_method: String
|
|
12
|
-
# @rbs agent_method: Symbol
|
|
13
|
-
# @rbs path: Array[Symbol]
|
|
14
|
-
# @rbs return: void
|
|
15
|
-
def initialize(rpc_method:, agent_method:, path:)
|
|
16
|
-
@rpc_method = rpc_method
|
|
17
|
-
@agent_method = agent_method
|
|
18
|
-
@path = path.freeze
|
|
19
|
-
freeze
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
# Readers missing along the chain count as unadvertised, so the stable
|
|
23
|
-
# capabilities answer false for the unstable-only paths (fork, providers).
|
|
24
|
-
#
|
|
25
|
-
# @rbs initialize_response: ACP::Types::InitializeResponse
|
|
26
|
-
# @rbs return: bool
|
|
27
|
-
def advertised?(initialize_response)
|
|
28
|
-
# reduce's U pins to the InitializeResponse argument, but the chain walks
|
|
29
|
-
# through unrelated capability types.
|
|
30
|
-
value = path.reduce(initialize_response) { |node, name| follow(node, name) } #: untyped
|
|
31
|
-
value ? true : false
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
private
|
|
35
|
-
|
|
36
|
-
# @rbs node: untyped
|
|
37
|
-
# @rbs name: Symbol
|
|
38
|
-
# @rbs return: untyped
|
|
39
|
-
def follow(node, name)
|
|
40
|
-
node.respond_to?(name) ? node.public_send(name) : nil
|
|
41
|
-
end
|
|
42
|
-
end
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module ACP::AgentConnection::OptionalMethod
|
|
4
|
-
SPECS = [
|
|
5
|
-
Spec.new(rpc_method: 'authenticate', agent_method: :authenticate, path: %i[auth_methods any?]),
|
|
6
|
-
Spec.new(rpc_method: 'session/load', agent_method: :load_session, path: %i[agent_capabilities load_session]),
|
|
7
|
-
Spec.new(
|
|
8
|
-
rpc_method: 'session/list',
|
|
9
|
-
agent_method: :list_sessions,
|
|
10
|
-
path: %i[agent_capabilities session_capabilities list]
|
|
11
|
-
),
|
|
12
|
-
Spec.new(
|
|
13
|
-
rpc_method: 'session/resume',
|
|
14
|
-
agent_method: :resume_session,
|
|
15
|
-
path: %i[agent_capabilities session_capabilities resume]
|
|
16
|
-
),
|
|
17
|
-
Spec.new(
|
|
18
|
-
rpc_method: 'session/close',
|
|
19
|
-
agent_method: :close_session,
|
|
20
|
-
path: %i[agent_capabilities session_capabilities close]
|
|
21
|
-
),
|
|
22
|
-
Spec.new(
|
|
23
|
-
rpc_method: 'session/delete',
|
|
24
|
-
agent_method: :delete_session,
|
|
25
|
-
path: %i[agent_capabilities session_capabilities delete]
|
|
26
|
-
),
|
|
27
|
-
Spec.new(rpc_method: 'logout', agent_method: :logout, path: %i[agent_capabilities auth logout])
|
|
28
|
-
].freeze #: Array[Spec]
|
|
29
|
-
|
|
30
|
-
UNSTABLE_SPECS = [
|
|
31
|
-
Spec.new(
|
|
32
|
-
rpc_method: 'session/fork',
|
|
33
|
-
agent_method: :fork_session,
|
|
34
|
-
path: %i[agent_capabilities session_capabilities fork]
|
|
35
|
-
),
|
|
36
|
-
Spec.new(rpc_method: 'providers/list', agent_method: :list_providers, path: %i[agent_capabilities providers]),
|
|
37
|
-
Spec.new(rpc_method: 'providers/set', agent_method: :set_provider, path: %i[agent_capabilities providers]),
|
|
38
|
-
Spec.new(rpc_method: 'providers/disable', agent_method: :disable_provider, path: %i[agent_capabilities providers])
|
|
39
|
-
].freeze #: Array[Spec]
|
|
40
|
-
end
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# Generated from lib/acp/agent_connection/optional_method/spec.rb with RBS::Inline
|
|
2
|
-
|
|
3
|
-
class ACP::AgentConnection::OptionalMethod::Spec
|
|
4
|
-
# @dynamic rpc_method
|
|
5
|
-
attr_reader rpc_method: String
|
|
6
|
-
|
|
7
|
-
# @dynamic agent_method
|
|
8
|
-
attr_reader agent_method: Symbol
|
|
9
|
-
|
|
10
|
-
# @dynamic path
|
|
11
|
-
attr_reader path: Array[Symbol]
|
|
12
|
-
|
|
13
|
-
# @rbs rpc_method: String
|
|
14
|
-
# @rbs agent_method: Symbol
|
|
15
|
-
# @rbs path: Array[Symbol]
|
|
16
|
-
# @rbs return: void
|
|
17
|
-
def initialize: (rpc_method: String, agent_method: Symbol, path: Array[Symbol]) -> void
|
|
18
|
-
|
|
19
|
-
# Readers missing along the chain count as unadvertised, so the stable
|
|
20
|
-
# capabilities answer false for the unstable-only paths (fork, providers).
|
|
21
|
-
#
|
|
22
|
-
# @rbs initialize_response: ACP::Types::InitializeResponse
|
|
23
|
-
# @rbs return: bool
|
|
24
|
-
def advertised?: (ACP::Types::InitializeResponse initialize_response) -> bool
|
|
25
|
-
|
|
26
|
-
private
|
|
27
|
-
|
|
28
|
-
# @rbs node: untyped
|
|
29
|
-
# @rbs name: Symbol
|
|
30
|
-
# @rbs return: untyped
|
|
31
|
-
def follow: (untyped node, Symbol name) -> untyped
|
|
32
|
-
end
|