cadenya 0.29.0 → 0.30.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 (51) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +1 -1
  4. data/lib/cadenya/models/objectives/objective_tool_call.rb +1 -0
  5. data/lib/cadenya/models/objectives/objective_tool_call_with_result.rb +1 -0
  6. data/lib/cadenya/models/objectives/set_tool_call_content_request_audio_block.rb +26 -0
  7. data/lib/cadenya/models/objectives/set_tool_call_content_request_content_block.rb +32 -0
  8. data/lib/cadenya/models/objectives/set_tool_call_content_request_image_block.rb +26 -0
  9. data/lib/cadenya/models/objectives/set_tool_call_content_request_text_block.rb +17 -0
  10. data/lib/cadenya/models/objectives/tool_call_list_params.rb +31 -1
  11. data/lib/cadenya/models/objectives/tool_call_set_content_params.rb +51 -0
  12. data/lib/cadenya/models/tool_called.rb +33 -1
  13. data/lib/cadenya/models/tool_set_adapter.rb +18 -1
  14. data/lib/cadenya/models/tool_set_adapter_bare.rb +26 -0
  15. data/lib/cadenya/models/tool_sets/config_bare.rb +14 -0
  16. data/lib/cadenya/models/tool_sets/tool_spec_config.rb +16 -1
  17. data/lib/cadenya/models.rb +2 -0
  18. data/lib/cadenya/resources/objectives/tool_calls.rb +53 -2
  19. data/lib/cadenya/version.rb +1 -1
  20. data/lib/cadenya.rb +7 -0
  21. data/rbi/cadenya/models/objectives/objective_tool_call.rbi +5 -0
  22. data/rbi/cadenya/models/objectives/objective_tool_call_with_result.rbi +5 -0
  23. data/rbi/cadenya/models/objectives/set_tool_call_content_request_audio_block.rbi +40 -0
  24. data/rbi/cadenya/models/objectives/set_tool_call_content_request_content_block.rbi +89 -0
  25. data/rbi/cadenya/models/objectives/set_tool_call_content_request_image_block.rbi +40 -0
  26. data/rbi/cadenya/models/objectives/set_tool_call_content_request_text_block.rbi +28 -0
  27. data/rbi/cadenya/models/objectives/tool_call_list_params.rbi +85 -0
  28. data/rbi/cadenya/models/objectives/tool_call_set_content_params.rbi +80 -0
  29. data/rbi/cadenya/models/tool_called.rbi +55 -2
  30. data/rbi/cadenya/models/tool_set_adapter.rbi +24 -1
  31. data/rbi/cadenya/models/tool_set_adapter_bare.rbi +37 -0
  32. data/rbi/cadenya/models/tool_sets/config_bare.rbi +25 -0
  33. data/rbi/cadenya/models/tool_sets/tool_spec_config.rbi +20 -1
  34. data/rbi/cadenya/models.rbi +2 -0
  35. data/rbi/cadenya/resources/objectives/tool_calls.rbi +37 -0
  36. data/sig/cadenya/models/objectives/objective_tool_call.rbs +2 -0
  37. data/sig/cadenya/models/objectives/objective_tool_call_with_result.rbs +2 -0
  38. data/sig/cadenya/models/objectives/set_tool_call_content_request_audio_block.rbs +18 -0
  39. data/sig/cadenya/models/objectives/set_tool_call_content_request_content_block.rbs +44 -0
  40. data/sig/cadenya/models/objectives/set_tool_call_content_request_image_block.rbs +18 -0
  41. data/sig/cadenya/models/objectives/set_tool_call_content_request_text_block.rbs +15 -0
  42. data/sig/cadenya/models/objectives/tool_call_list_params.rbs +30 -0
  43. data/sig/cadenya/models/objectives/tool_call_set_content_params.rbs +43 -0
  44. data/sig/cadenya/models/tool_called.rbs +33 -3
  45. data/sig/cadenya/models/tool_set_adapter.rbs +7 -0
  46. data/sig/cadenya/models/tool_set_adapter_bare.rbs +15 -0
  47. data/sig/cadenya/models/tool_sets/config_bare.rbs +13 -0
  48. data/sig/cadenya/models/tool_sets/tool_spec_config.rbs +9 -0
  49. data/sig/cadenya/models.rbs +2 -0
  50. data/sig/cadenya/resources/objectives/tool_calls.rbs +9 -0
  51. metadata +23 -2
@@ -0,0 +1,89 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Models
5
+ module Objectives
6
+ class SetToolCallContentRequestContentBlock < Cadenya::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Cadenya::Objectives::SetToolCallContentRequestContentBlock,
11
+ Cadenya::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ sig do
16
+ returns(
17
+ T.nilable(Cadenya::Objectives::SetToolCallContentRequestAudioBlock)
18
+ )
19
+ end
20
+ attr_reader :audio
21
+
22
+ sig do
23
+ params(
24
+ audio:
25
+ Cadenya::Objectives::SetToolCallContentRequestAudioBlock::OrHash
26
+ ).void
27
+ end
28
+ attr_writer :audio
29
+
30
+ sig do
31
+ returns(
32
+ T.nilable(Cadenya::Objectives::SetToolCallContentRequestImageBlock)
33
+ )
34
+ end
35
+ attr_reader :image
36
+
37
+ sig do
38
+ params(
39
+ image:
40
+ Cadenya::Objectives::SetToolCallContentRequestImageBlock::OrHash
41
+ ).void
42
+ end
43
+ attr_writer :image
44
+
45
+ sig do
46
+ returns(
47
+ T.nilable(Cadenya::Objectives::SetToolCallContentRequestTextBlock)
48
+ )
49
+ end
50
+ attr_reader :text
51
+
52
+ sig do
53
+ params(
54
+ text:
55
+ Cadenya::Objectives::SetToolCallContentRequestTextBlock::OrHash
56
+ ).void
57
+ end
58
+ attr_writer :text
59
+
60
+ # ContentBlock is a single block of tool call content supplied on input. Exactly
61
+ # one of the variants is set.
62
+ sig do
63
+ params(
64
+ audio:
65
+ Cadenya::Objectives::SetToolCallContentRequestAudioBlock::OrHash,
66
+ image:
67
+ Cadenya::Objectives::SetToolCallContentRequestImageBlock::OrHash,
68
+ text:
69
+ Cadenya::Objectives::SetToolCallContentRequestTextBlock::OrHash
70
+ ).returns(T.attached_class)
71
+ end
72
+ def self.new(audio: nil, image: nil, text: nil)
73
+ end
74
+
75
+ sig do
76
+ override.returns(
77
+ {
78
+ audio: Cadenya::Objectives::SetToolCallContentRequestAudioBlock,
79
+ image: Cadenya::Objectives::SetToolCallContentRequestImageBlock,
80
+ text: Cadenya::Objectives::SetToolCallContentRequestTextBlock
81
+ }
82
+ )
83
+ end
84
+ def to_hash
85
+ end
86
+ end
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,40 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Models
5
+ module Objectives
6
+ class SetToolCallContentRequestImageBlock < Cadenya::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Cadenya::Objectives::SetToolCallContentRequestImageBlock,
11
+ Cadenya::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ # Base64-encoded image bytes.
16
+ sig { returns(String) }
17
+ attr_accessor :data
18
+
19
+ # IANA media type of the image, e.g. image/png.
20
+ sig { returns(String) }
21
+ attr_accessor :mime_type
22
+
23
+ sig do
24
+ params(data: String, mime_type: String).returns(T.attached_class)
25
+ end
26
+ def self.new(
27
+ # Base64-encoded image bytes.
28
+ data:,
29
+ # IANA media type of the image, e.g. image/png.
30
+ mime_type:
31
+ )
32
+ end
33
+
34
+ sig { override.returns({ data: String, mime_type: String }) }
35
+ def to_hash
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,28 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Models
5
+ module Objectives
6
+ class SetToolCallContentRequestTextBlock < Cadenya::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Cadenya::Objectives::SetToolCallContentRequestTextBlock,
11
+ Cadenya::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ sig { returns(String) }
16
+ attr_accessor :text
17
+
18
+ sig { params(text: String).returns(T.attached_class) }
19
+ def self.new(text:)
20
+ end
21
+
22
+ sig { override.returns({ text: String }) }
23
+ def to_hash
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -28,6 +28,26 @@ module Cadenya
28
28
  sig { params(cursor: String).void }
29
29
  attr_writer :cursor
30
30
 
31
+ # Filter by tool call execution status. Useful for reverse-harness polling of bare
32
+ # tool calls waiting for externally supplied content
33
+ # (TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT).
34
+ sig do
35
+ returns(
36
+ T.nilable(
37
+ Cadenya::Objectives::ToolCallListParams::ExecutionStatus::OrSymbol
38
+ )
39
+ )
40
+ end
41
+ attr_reader :execution_status
42
+
43
+ sig do
44
+ params(
45
+ execution_status:
46
+ Cadenya::Objectives::ToolCallListParams::ExecutionStatus::OrSymbol
47
+ ).void
48
+ end
49
+ attr_writer :execution_status
50
+
31
51
  # When set to true you may use more of your alloted API rate-limit
32
52
  sig { returns(T.nilable(T::Boolean)) }
33
53
  attr_reader :include_info
@@ -62,6 +82,8 @@ module Cadenya
62
82
  workspace_id: String,
63
83
  objective_id: String,
64
84
  cursor: String,
85
+ execution_status:
86
+ Cadenya::Objectives::ToolCallListParams::ExecutionStatus::OrSymbol,
65
87
  include_info: T::Boolean,
66
88
  limit: Integer,
67
89
  status: Cadenya::Objectives::ToolCallListParams::Status::OrSymbol,
@@ -73,6 +95,10 @@ module Cadenya
73
95
  objective_id:,
74
96
  # Pagination cursor from previous response
75
97
  cursor: nil,
98
+ # Filter by tool call execution status. Useful for reverse-harness polling of bare
99
+ # tool calls waiting for externally supplied content
100
+ # (TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT).
101
+ execution_status: nil,
76
102
  # When set to true you may use more of your alloted API rate-limit
77
103
  include_info: nil,
78
104
  # Maximum number of results to return
@@ -89,6 +115,8 @@ module Cadenya
89
115
  workspace_id: String,
90
116
  objective_id: String,
91
117
  cursor: String,
118
+ execution_status:
119
+ Cadenya::Objectives::ToolCallListParams::ExecutionStatus::OrSymbol,
92
120
  include_info: T::Boolean,
93
121
  limit: Integer,
94
122
  status: Cadenya::Objectives::ToolCallListParams::Status::OrSymbol,
@@ -99,6 +127,63 @@ module Cadenya
99
127
  def to_hash
100
128
  end
101
129
 
130
+ # Filter by tool call execution status. Useful for reverse-harness polling of bare
131
+ # tool calls waiting for externally supplied content
132
+ # (TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT).
133
+ module ExecutionStatus
134
+ extend Cadenya::Internal::Type::Enum
135
+
136
+ TaggedSymbol =
137
+ T.type_alias do
138
+ T.all(
139
+ Symbol,
140
+ Cadenya::Objectives::ToolCallListParams::ExecutionStatus
141
+ )
142
+ end
143
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
144
+
145
+ TOOL_CALL_EXECUTION_STATUS_UNSPECIFIED =
146
+ T.let(
147
+ :TOOL_CALL_EXECUTION_STATUS_UNSPECIFIED,
148
+ Cadenya::Objectives::ToolCallListParams::ExecutionStatus::TaggedSymbol
149
+ )
150
+ TOOL_CALL_EXECUTION_STATUS_PENDING =
151
+ T.let(
152
+ :TOOL_CALL_EXECUTION_STATUS_PENDING,
153
+ Cadenya::Objectives::ToolCallListParams::ExecutionStatus::TaggedSymbol
154
+ )
155
+ TOOL_CALL_EXECUTION_STATUS_RUNNING =
156
+ T.let(
157
+ :TOOL_CALL_EXECUTION_STATUS_RUNNING,
158
+ Cadenya::Objectives::ToolCallListParams::ExecutionStatus::TaggedSymbol
159
+ )
160
+ TOOL_CALL_EXECUTION_STATUS_COMPLETED =
161
+ T.let(
162
+ :TOOL_CALL_EXECUTION_STATUS_COMPLETED,
163
+ Cadenya::Objectives::ToolCallListParams::ExecutionStatus::TaggedSymbol
164
+ )
165
+ TOOL_CALL_EXECUTION_STATUS_ERRORED =
166
+ T.let(
167
+ :TOOL_CALL_EXECUTION_STATUS_ERRORED,
168
+ Cadenya::Objectives::ToolCallListParams::ExecutionStatus::TaggedSymbol
169
+ )
170
+ TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT =
171
+ T.let(
172
+ :TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT,
173
+ Cadenya::Objectives::ToolCallListParams::ExecutionStatus::TaggedSymbol
174
+ )
175
+
176
+ sig do
177
+ override.returns(
178
+ T::Array[
179
+ Cadenya::Objectives::ToolCallListParams::ExecutionStatus::TaggedSymbol
180
+ ]
181
+ )
182
+ end
183
+ def self.values
184
+ end
185
+ end
186
+
102
187
  # Filter by tool call status
103
188
  module Status
104
189
  extend Cadenya::Internal::Type::Enum
@@ -0,0 +1,80 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Models
5
+ module Objectives
6
+ class ToolCallSetContentParams < Cadenya::Internal::Type::BaseModel
7
+ extend Cadenya::Internal::Type::RequestParameters::Converter
8
+ include Cadenya::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Cadenya::Objectives::ToolCallSetContentParams,
14
+ Cadenya::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :workspace_id
20
+
21
+ sig { returns(String) }
22
+ attr_accessor :objective_id
23
+
24
+ sig { returns(String) }
25
+ attr_accessor :tool_call_id
26
+
27
+ # The content to set on the tool call. Mirrors
28
+ # ObjectiveToolCallResult.ContentBlock but writable: media blocks carry raw data
29
+ # on input where the result-side carries a signed url on output.
30
+ sig do
31
+ returns(
32
+ T::Array[Cadenya::Objectives::SetToolCallContentRequestContentBlock]
33
+ )
34
+ end
35
+ attr_accessor :content
36
+
37
+ sig do
38
+ params(
39
+ workspace_id: String,
40
+ objective_id: String,
41
+ tool_call_id: String,
42
+ content:
43
+ T::Array[
44
+ Cadenya::Objectives::SetToolCallContentRequestContentBlock::OrHash
45
+ ],
46
+ request_options: Cadenya::RequestOptions::OrHash
47
+ ).returns(T.attached_class)
48
+ end
49
+ def self.new(
50
+ workspace_id:,
51
+ objective_id:,
52
+ tool_call_id:,
53
+ # The content to set on the tool call. Mirrors
54
+ # ObjectiveToolCallResult.ContentBlock but writable: media blocks carry raw data
55
+ # on input where the result-side carries a signed url on output.
56
+ content:,
57
+ request_options: {}
58
+ )
59
+ end
60
+
61
+ sig do
62
+ override.returns(
63
+ {
64
+ workspace_id: String,
65
+ objective_id: String,
66
+ tool_call_id: String,
67
+ content:
68
+ T::Array[
69
+ Cadenya::Objectives::SetToolCallContentRequestContentBlock
70
+ ],
71
+ request_options: Cadenya::RequestOptions
72
+ }
73
+ )
74
+ end
75
+ def to_hash
76
+ end
77
+ end
78
+ end
79
+ end
80
+ end
@@ -6,6 +6,32 @@ module Cadenya
6
6
  OrHash =
7
7
  T.type_alias { T.any(Cadenya::ToolCalled, Cadenya::Internal::AnyHash) }
8
8
 
9
+ # The arguments passed to the tool.
10
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
11
+ attr_reader :arguments
12
+
13
+ sig { params(arguments: T::Hash[Symbol, T.anything]).void }
14
+ attr_writer :arguments
15
+
16
+ # Config defines the adapter to use for the tool. This is used to determine how
17
+ # the tool is called. For example, if the tool is an HTTP tool, the adapter will
18
+ # be Http. If the tool is an inline tool, the adapter will be Inline.
19
+ sig { returns(T.nilable(Cadenya::ToolSets::ToolSpecConfig)) }
20
+ attr_reader :config
21
+
22
+ sig { params(config: Cadenya::ToolSets::ToolSpecConfig::OrHash).void }
23
+ attr_writer :config
24
+
25
+ # CallableTool is a union that represents a tool that can be called by an agent.
26
+ # In Cadenya, a tool that is used within an agent objective might be a
27
+ # user-defined tool (IE: MCP, HTTP), another Agent (useful to separate context),
28
+ # or a Cadenya Tool (one Cadenya provides).
29
+ sig { returns(T.nilable(Cadenya::CallableTool)) }
30
+ attr_reader :tool
31
+
32
+ sig { params(tool: Cadenya::CallableTool::OrHash).void }
33
+ attr_writer :tool
34
+
9
35
  # The ID of the objective tool call record that was executed.
10
36
  sig { returns(T.nilable(String)) }
11
37
  attr_reader :tool_call_id
@@ -13,14 +39,41 @@ module Cadenya
13
39
  sig { params(tool_call_id: String).void }
14
40
  attr_writer :tool_call_id
15
41
 
16
- sig { params(tool_call_id: String).returns(T.attached_class) }
42
+ sig do
43
+ params(
44
+ arguments: T::Hash[Symbol, T.anything],
45
+ config: Cadenya::ToolSets::ToolSpecConfig::OrHash,
46
+ tool: Cadenya::CallableTool::OrHash,
47
+ tool_call_id: String
48
+ ).returns(T.attached_class)
49
+ end
17
50
  def self.new(
51
+ # The arguments passed to the tool.
52
+ arguments: nil,
53
+ # Config defines the adapter to use for the tool. This is used to determine how
54
+ # the tool is called. For example, if the tool is an HTTP tool, the adapter will
55
+ # be Http. If the tool is an inline tool, the adapter will be Inline.
56
+ config: nil,
57
+ # CallableTool is a union that represents a tool that can be called by an agent.
58
+ # In Cadenya, a tool that is used within an agent objective might be a
59
+ # user-defined tool (IE: MCP, HTTP), another Agent (useful to separate context),
60
+ # or a Cadenya Tool (one Cadenya provides).
61
+ tool: nil,
18
62
  # The ID of the objective tool call record that was executed.
19
63
  tool_call_id: nil
20
64
  )
21
65
  end
22
66
 
23
- sig { override.returns({ tool_call_id: String }) }
67
+ sig do
68
+ override.returns(
69
+ {
70
+ arguments: T::Hash[Symbol, T.anything],
71
+ config: Cadenya::ToolSets::ToolSpecConfig,
72
+ tool: Cadenya::CallableTool,
73
+ tool_call_id: String
74
+ }
75
+ )
76
+ end
24
77
  def to_hash
25
78
  end
26
79
  end
@@ -8,6 +8,17 @@ module Cadenya
8
8
  T.any(Cadenya::ToolSetAdapter, Cadenya::Internal::AnyHash)
9
9
  end
10
10
 
11
+ # Bare tool sets define tools without an execution adapter. A bare tool call
12
+ # doesn't fire anything: the objective's workflow pauses and waits for an external
13
+ # API consumer to set the tool call's content (e.g. human-in-the-loop tools, or a
14
+ # reverse harness that polls for pending tool calls, executes locally, and reports
15
+ # results back via SetToolCallContent).
16
+ sig { returns(T.nilable(Cadenya::ToolSetAdapterBare)) }
17
+ attr_reader :bare
18
+
19
+ sig { params(bare: Cadenya::ToolSetAdapterBare::OrHash).void }
20
+ attr_writer :bare
21
+
11
22
  sig { returns(T.nilable(Cadenya::ToolSetAdapterHTTP)) }
12
23
  attr_reader :http
13
24
 
@@ -28,17 +39,29 @@ module Cadenya
28
39
 
29
40
  sig do
30
41
  params(
42
+ bare: Cadenya::ToolSetAdapterBare::OrHash,
31
43
  http: Cadenya::ToolSetAdapterHTTP::OrHash,
32
44
  mcp: Cadenya::ToolSetAdapterMcp::OrHash,
33
45
  openapi: Cadenya::ToolSetAdapterOpenAPI::OrHash
34
46
  ).returns(T.attached_class)
35
47
  end
36
- def self.new(http: nil, mcp: nil, openapi: nil)
48
+ def self.new(
49
+ # Bare tool sets define tools without an execution adapter. A bare tool call
50
+ # doesn't fire anything: the objective's workflow pauses and waits for an external
51
+ # API consumer to set the tool call's content (e.g. human-in-the-loop tools, or a
52
+ # reverse harness that polls for pending tool calls, executes locally, and reports
53
+ # results back via SetToolCallContent).
54
+ bare: nil,
55
+ http: nil,
56
+ mcp: nil,
57
+ openapi: nil
58
+ )
37
59
  end
38
60
 
39
61
  sig do
40
62
  override.returns(
41
63
  {
64
+ bare: Cadenya::ToolSetAdapterBare,
42
65
  http: Cadenya::ToolSetAdapterHTTP,
43
66
  mcp: Cadenya::ToolSetAdapterMcp,
44
67
  openapi: Cadenya::ToolSetAdapterOpenAPI
@@ -0,0 +1,37 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Models
5
+ class ToolSetAdapterBare < Cadenya::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Cadenya::ToolSetAdapterBare, Cadenya::Internal::AnyHash)
9
+ end
10
+
11
+ # How long to wait for content to be set before the tool call errors. If unset,
12
+ # the call waits indefinitely.
13
+ sig { returns(T.nilable(Integer)) }
14
+ attr_reader :content_timeout
15
+
16
+ sig { params(content_timeout: Integer).void }
17
+ attr_writer :content_timeout
18
+
19
+ # Bare tool sets define tools without an execution adapter. A bare tool call
20
+ # doesn't fire anything: the objective's workflow pauses and waits for an external
21
+ # API consumer to set the tool call's content (e.g. human-in-the-loop tools, or a
22
+ # reverse harness that polls for pending tool calls, executes locally, and reports
23
+ # results back via SetToolCallContent).
24
+ sig { params(content_timeout: Integer).returns(T.attached_class) }
25
+ def self.new(
26
+ # How long to wait for content to be set before the tool call errors. If unset,
27
+ # the call waits indefinitely.
28
+ content_timeout: nil
29
+ )
30
+ end
31
+
32
+ sig { override.returns({ content_timeout: Integer }) }
33
+ def to_hash
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,25 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Models
5
+ module ToolSets
6
+ class ConfigBare < Cadenya::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(Cadenya::ToolSets::ConfigBare, Cadenya::Internal::AnyHash)
10
+ end
11
+
12
+ # Marks the tool as bare: it has no execution adapter of its own and relies on the
13
+ # parent tool set being a Bare tool set. Present so a webhook consumer can tell a
14
+ # tool is bare from the tool data alone, without cross-referencing the tool set.
15
+ sig { returns(T.attached_class) }
16
+ def self.new
17
+ end
18
+
19
+ sig { override.returns({}) }
20
+ def to_hash
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -9,6 +9,15 @@ module Cadenya
9
9
  T.any(Cadenya::ToolSets::ToolSpecConfig, Cadenya::Internal::AnyHash)
10
10
  end
11
11
 
12
+ # Marks the tool as bare: it has no execution adapter of its own and relies on the
13
+ # parent tool set being a Bare tool set. Present so a webhook consumer can tell a
14
+ # tool is bare from the tool data alone, without cross-referencing the tool set.
15
+ sig { returns(T.nilable(Cadenya::ToolSets::ConfigBare)) }
16
+ attr_reader :bare
17
+
18
+ sig { params(bare: Cadenya::ToolSets::ConfigBare::OrHash).void }
19
+ attr_writer :bare
20
+
12
21
  sig { returns(T.nilable(Cadenya::ToolSets::ConfigHTTP)) }
13
22
  attr_reader :http
14
23
 
@@ -32,17 +41,27 @@ module Cadenya
32
41
  # be Http. If the tool is an inline tool, the adapter will be Inline.
33
42
  sig do
34
43
  params(
44
+ bare: Cadenya::ToolSets::ConfigBare::OrHash,
35
45
  http: Cadenya::ToolSets::ConfigHTTP::OrHash,
36
46
  mcp: Cadenya::ToolSets::ConfigMcp::OrHash,
37
47
  openapi: Cadenya::ToolSets::ConfigOpenAPI::OrHash
38
48
  ).returns(T.attached_class)
39
49
  end
40
- def self.new(http: nil, mcp: nil, openapi: nil)
50
+ def self.new(
51
+ # Marks the tool as bare: it has no execution adapter of its own and relies on the
52
+ # parent tool set being a Bare tool set. Present so a webhook consumer can tell a
53
+ # tool is bare from the tool data alone, without cross-referencing the tool set.
54
+ bare: nil,
55
+ http: nil,
56
+ mcp: nil,
57
+ openapi: nil
58
+ )
41
59
  end
42
60
 
43
61
  sig do
44
62
  override.returns(
45
63
  {
64
+ bare: Cadenya::ToolSets::ConfigBare,
46
65
  http: Cadenya::ToolSets::ConfigHTTP,
47
66
  mcp: Cadenya::ToolSets::ConfigMcp,
48
67
  openapi: Cadenya::ToolSets::ConfigOpenAPI
@@ -231,6 +231,8 @@ module Cadenya
231
231
 
232
232
  ToolSetAdapter = Cadenya::Models::ToolSetAdapter
233
233
 
234
+ ToolSetAdapterBare = Cadenya::Models::ToolSetAdapterBare
235
+
234
236
  ToolSetAdapterHTTP = Cadenya::Models::ToolSetAdapterHTTP
235
237
 
236
238
  ToolSetAdapterMcp = Cadenya::Models::ToolSetAdapterMcp
@@ -30,6 +30,8 @@ module Cadenya
30
30
  objective_id: String,
31
31
  workspace_id: String,
32
32
  cursor: String,
33
+ execution_status:
34
+ Cadenya::Objectives::ToolCallListParams::ExecutionStatus::OrSymbol,
33
35
  include_info: T::Boolean,
34
36
  limit: Integer,
35
37
  status: Cadenya::Objectives::ToolCallListParams::Status::OrSymbol,
@@ -47,6 +49,10 @@ module Cadenya
47
49
  workspace_id:,
48
50
  # Query param: Pagination cursor from previous response
49
51
  cursor: nil,
52
+ # Query param: Filter by tool call execution status. Useful for reverse-harness
53
+ # polling of bare tool calls waiting for externally supplied content
54
+ # (TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT).
55
+ execution_status: nil,
50
56
  # Query param: When set to true you may use more of your alloted API rate-limit
51
57
  include_info: nil,
52
58
  # Query param: Maximum number of results to return
@@ -104,6 +110,37 @@ module Cadenya
104
110
  )
105
111
  end
106
112
 
113
+ # For bare tool calls (tool sets with no execution adapter), sets the content an
114
+ # external API consumer supplies for the call — used for human-in-the-loop tools
115
+ # and reverse harnesses that execute tools locally and report results back.
116
+ sig do
117
+ params(
118
+ tool_call_id: String,
119
+ workspace_id: String,
120
+ objective_id: String,
121
+ content:
122
+ T::Array[
123
+ Cadenya::Objectives::SetToolCallContentRequestContentBlock::OrHash
124
+ ],
125
+ request_options: Cadenya::RequestOptions::OrHash
126
+ ).returns(Cadenya::Objectives::ObjectiveToolCall)
127
+ end
128
+ def set_content(
129
+ # Path param: The ID of the tool call to set content for
130
+ tool_call_id,
131
+ # Path param
132
+ workspace_id:,
133
+ # Path param: The ID of the objective. Supports "external_id:" prefix for external
134
+ # IDs.
135
+ objective_id:,
136
+ # Body param: The content to set on the tool call. Mirrors
137
+ # ObjectiveToolCallResult.ContentBlock but writable: media blocks carry raw data
138
+ # on input where the result-side carries a signed url on output.
139
+ content:,
140
+ request_options: {}
141
+ )
142
+ end
143
+
107
144
  # @api private
108
145
  sig { params(client: Cadenya::Client).returns(T.attached_class) }
109
146
  def self.new(client:)
@@ -49,6 +49,7 @@ module Cadenya
49
49
  | :TOOL_CALL_EXECUTION_STATUS_RUNNING
50
50
  | :TOOL_CALL_EXECUTION_STATUS_COMPLETED
51
51
  | :TOOL_CALL_EXECUTION_STATUS_ERRORED
52
+ | :TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT
52
53
 
53
54
  module ExecutionStatus
54
55
  extend Cadenya::Internal::Type::Enum
@@ -58,6 +59,7 @@ module Cadenya
58
59
  TOOL_CALL_EXECUTION_STATUS_RUNNING: :TOOL_CALL_EXECUTION_STATUS_RUNNING
59
60
  TOOL_CALL_EXECUTION_STATUS_COMPLETED: :TOOL_CALL_EXECUTION_STATUS_COMPLETED
60
61
  TOOL_CALL_EXECUTION_STATUS_ERRORED: :TOOL_CALL_EXECUTION_STATUS_ERRORED
62
+ TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT: :TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT
61
63
 
62
64
  def self?.values: -> ::Array[Cadenya::Models::Objectives::ObjectiveToolCall::execution_status]
63
65
  end