cadenya 0.29.0 → 0.31.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 (69) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/cadenya/models/agents/agent_variation_spec_constraints.rb +15 -1
  5. data/lib/cadenya/models/agents/webhook_delivery_data.rb +1 -0
  6. data/lib/cadenya/models/agents/webhook_delivery_list_params.rb +1 -0
  7. data/lib/cadenya/models/objective.rb +1 -0
  8. data/lib/cadenya/models/objective_event_data.rb +37 -1
  9. data/lib/cadenya/models/objective_list_params.rb +1 -0
  10. data/lib/cadenya/models/objectives/objective_tool_call.rb +1 -0
  11. data/lib/cadenya/models/objectives/objective_tool_call_with_result.rb +1 -0
  12. data/lib/cadenya/models/objectives/set_tool_call_content_request_audio_block.rb +26 -0
  13. data/lib/cadenya/models/objectives/set_tool_call_content_request_content_block.rb +32 -0
  14. data/lib/cadenya/models/objectives/set_tool_call_content_request_image_block.rb +26 -0
  15. data/lib/cadenya/models/objectives/set_tool_call_content_request_text_block.rb +17 -0
  16. data/lib/cadenya/models/objectives/tool_call_list_params.rb +31 -1
  17. data/lib/cadenya/models/objectives/tool_call_set_content_params.rb +51 -0
  18. data/lib/cadenya/models/tool_called.rb +33 -1
  19. data/lib/cadenya/models/tool_set_adapter.rb +18 -1
  20. data/lib/cadenya/models/tool_set_adapter_bare.rb +26 -0
  21. data/lib/cadenya/models/tool_sets/config_bare.rb +14 -0
  22. data/lib/cadenya/models/tool_sets/tool_spec_config.rb +16 -1
  23. data/lib/cadenya/models.rb +2 -0
  24. data/lib/cadenya/resources/objectives/tool_calls.rb +53 -2
  25. data/lib/cadenya/version.rb +1 -1
  26. data/lib/cadenya.rb +7 -0
  27. data/rbi/cadenya/models/agents/agent_variation_spec_constraints.rbi +25 -4
  28. data/rbi/cadenya/models/agents/webhook_delivery_data.rbi +5 -0
  29. data/rbi/cadenya/models/agents/webhook_delivery_list_params.rbi +5 -0
  30. data/rbi/cadenya/models/objective.rbi +2 -0
  31. data/rbi/cadenya/models/objective_event_data.rbi +59 -0
  32. data/rbi/cadenya/models/objective_list_params.rbi +5 -0
  33. data/rbi/cadenya/models/objectives/objective_tool_call.rbi +5 -0
  34. data/rbi/cadenya/models/objectives/objective_tool_call_with_result.rbi +5 -0
  35. data/rbi/cadenya/models/objectives/set_tool_call_content_request_audio_block.rbi +40 -0
  36. data/rbi/cadenya/models/objectives/set_tool_call_content_request_content_block.rbi +89 -0
  37. data/rbi/cadenya/models/objectives/set_tool_call_content_request_image_block.rbi +40 -0
  38. data/rbi/cadenya/models/objectives/set_tool_call_content_request_text_block.rbi +28 -0
  39. data/rbi/cadenya/models/objectives/tool_call_list_params.rbi +85 -0
  40. data/rbi/cadenya/models/objectives/tool_call_set_content_params.rbi +80 -0
  41. data/rbi/cadenya/models/tool_called.rbi +55 -2
  42. data/rbi/cadenya/models/tool_set_adapter.rbi +24 -1
  43. data/rbi/cadenya/models/tool_set_adapter_bare.rbi +37 -0
  44. data/rbi/cadenya/models/tool_sets/config_bare.rbi +25 -0
  45. data/rbi/cadenya/models/tool_sets/tool_spec_config.rbi +20 -1
  46. data/rbi/cadenya/models.rbi +2 -0
  47. data/rbi/cadenya/resources/objectives/tool_calls.rbi +37 -0
  48. data/sig/cadenya/models/agents/agent_variation_spec_constraints.rbs +15 -2
  49. data/sig/cadenya/models/agents/webhook_delivery_data.rbs +2 -0
  50. data/sig/cadenya/models/agents/webhook_delivery_list_params.rbs +2 -0
  51. data/sig/cadenya/models/objective.rbs +2 -0
  52. data/sig/cadenya/models/objective_event_data.rbs +21 -0
  53. data/sig/cadenya/models/objective_list_params.rbs +2 -0
  54. data/sig/cadenya/models/objectives/objective_tool_call.rbs +2 -0
  55. data/sig/cadenya/models/objectives/objective_tool_call_with_result.rbs +2 -0
  56. data/sig/cadenya/models/objectives/set_tool_call_content_request_audio_block.rbs +18 -0
  57. data/sig/cadenya/models/objectives/set_tool_call_content_request_content_block.rbs +44 -0
  58. data/sig/cadenya/models/objectives/set_tool_call_content_request_image_block.rbs +18 -0
  59. data/sig/cadenya/models/objectives/set_tool_call_content_request_text_block.rbs +15 -0
  60. data/sig/cadenya/models/objectives/tool_call_list_params.rbs +30 -0
  61. data/sig/cadenya/models/objectives/tool_call_set_content_params.rbs +43 -0
  62. data/sig/cadenya/models/tool_called.rbs +33 -3
  63. data/sig/cadenya/models/tool_set_adapter.rbs +7 -0
  64. data/sig/cadenya/models/tool_set_adapter_bare.rbs +15 -0
  65. data/sig/cadenya/models/tool_sets/config_bare.rbs +13 -0
  66. data/sig/cadenya/models/tool_sets/tool_spec_config.rbs +9 -0
  67. data/sig/cadenya/models.rbs +2 -0
  68. data/sig/cadenya/resources/objectives/tool_calls.rbs +9 -0
  69. metadata +23 -2
@@ -43,9 +43,12 @@ module Cadenya
43
43
  )
44
44
  end
45
45
 
46
+ # Some parameter documentations has been truncated, see
47
+ # {Cadenya::Models::Objectives::ToolCallListParams} for more details.
48
+ #
46
49
  # Lists all tool calls for an objective
47
50
  #
48
- # @overload list(objective_id, workspace_id:, cursor: nil, include_info: nil, limit: nil, status: nil, request_options: {})
51
+ # @overload list(objective_id, workspace_id:, cursor: nil, execution_status: nil, include_info: nil, limit: nil, status: nil, request_options: {})
49
52
  #
50
53
  # @param objective_id [String] Path param: The objective ID to return tool calls for
51
54
  #
@@ -53,6 +56,8 @@ module Cadenya
53
56
  #
54
57
  # @param cursor [String] Query param: Pagination cursor from previous response
55
58
  #
59
+ # @param execution_status [Symbol, Cadenya::Models::Objectives::ToolCallListParams::ExecutionStatus] Query param: Filter by tool call execution status. Useful for reverse-harness
60
+ #
56
61
  # @param include_info [Boolean] Query param: When set to true you may use more of your alloted API rate-limit
57
62
  #
58
63
  # @param limit [Integer] Query param: Maximum number of results to return
@@ -74,7 +79,7 @@ module Cadenya
74
79
  @client.request(
75
80
  method: :get,
76
81
  path: ["v1/workspaces/%1$s/objectives/%2$s/tool_calls", workspace_id, objective_id],
77
- query: query.transform_keys(include_info: "includeInfo"),
82
+ query: query.transform_keys(execution_status: "executionStatus", include_info: "includeInfo"),
78
83
  page: Cadenya::Internal::CursorPagination,
79
84
  model: Cadenya::Objectives::ObjectiveToolCall,
80
85
  options: options
@@ -166,6 +171,52 @@ module Cadenya
166
171
  )
167
172
  end
168
173
 
174
+ # Some parameter documentations has been truncated, see
175
+ # {Cadenya::Models::Objectives::ToolCallSetContentParams} for more details.
176
+ #
177
+ # For bare tool calls (tool sets with no execution adapter), sets the content an
178
+ # external API consumer supplies for the call — used for human-in-the-loop tools
179
+ # and reverse harnesses that execute tools locally and report results back.
180
+ #
181
+ # @overload set_content(tool_call_id, workspace_id:, objective_id:, content:, request_options: {})
182
+ #
183
+ # @param tool_call_id [String] Path param: The ID of the tool call to set content for
184
+ #
185
+ # @param workspace_id [String] Path param
186
+ #
187
+ # @param objective_id [String] Path param: The ID of the objective. Supports "external_id:" prefix for external
188
+ #
189
+ # @param content [Array<Cadenya::Models::Objectives::SetToolCallContentRequestContentBlock>] Body param: The content to set on the tool call. Mirrors
190
+ #
191
+ # @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}, nil]
192
+ #
193
+ # @return [Cadenya::Models::Objectives::ObjectiveToolCall]
194
+ #
195
+ # @see Cadenya::Models::Objectives::ToolCallSetContentParams
196
+ def set_content(tool_call_id, params)
197
+ parsed, options = Cadenya::Objectives::ToolCallSetContentParams.dump_request(params)
198
+ workspace_id =
199
+ parsed.delete(:workspace_id) do
200
+ raise ArgumentError.new("missing required path argument #{_1}")
201
+ end
202
+ objective_id =
203
+ parsed.delete(:objective_id) do
204
+ raise ArgumentError.new("missing required path argument #{_1}")
205
+ end
206
+ @client.request(
207
+ method: :post,
208
+ path: [
209
+ "v1/workspaces/%1$s/objectives/%2$s/tool_calls/%3$s:setContent",
210
+ workspace_id,
211
+ objective_id,
212
+ tool_call_id
213
+ ],
214
+ body: parsed,
215
+ model: Cadenya::Objectives::ObjectiveToolCall,
216
+ options: options
217
+ )
218
+ end
219
+
169
220
  # @api private
170
221
  #
171
222
  # @param client [Cadenya::Client]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cadenya
4
- VERSION = "0.29.0"
4
+ VERSION = "0.31.0"
5
5
  end
data/lib/cadenya.rb CHANGED
@@ -213,12 +213,17 @@ require_relative "cadenya/models/objectives/objective_tool_call_result_image_blo
213
213
  require_relative "cadenya/models/objectives/objective_tool_call_result_text_block"
214
214
  require_relative "cadenya/models/objectives/objective_tool_call_with_result"
215
215
  require_relative "cadenya/models/objectives/resolved_secret"
216
+ require_relative "cadenya/models/objectives/set_tool_call_content_request_audio_block"
217
+ require_relative "cadenya/models/objectives/set_tool_call_content_request_content_block"
218
+ require_relative "cadenya/models/objectives/set_tool_call_content_request_image_block"
219
+ require_relative "cadenya/models/objectives/set_tool_call_content_request_text_block"
216
220
  require_relative "cadenya/models/objectives/task_list_params"
217
221
  require_relative "cadenya/models/objectives/task_retrieve_params"
218
222
  require_relative "cadenya/models/objectives/tool_call_approve_params"
219
223
  require_relative "cadenya/models/objectives/tool_call_deny_params"
220
224
  require_relative "cadenya/models/objectives/tool_call_list_params"
221
225
  require_relative "cadenya/models/objectives/tool_call_retrieve_params"
226
+ require_relative "cadenya/models/objectives/tool_call_set_content_params"
222
227
  require_relative "cadenya/models/objectives/tool_list_params"
223
228
  require_relative "cadenya/models/objective_secret"
224
229
  require_relative "cadenya/models/objective_stream_events_params"
@@ -247,6 +252,7 @@ require_relative "cadenya/models/tool_filter"
247
252
  require_relative "cadenya/models/tool_result"
248
253
  require_relative "cadenya/models/tool_set"
249
254
  require_relative "cadenya/models/tool_set_adapter"
255
+ require_relative "cadenya/models/tool_set_adapter_bare"
250
256
  require_relative "cadenya/models/tool_set_adapter_http"
251
257
  require_relative "cadenya/models/tool_set_adapter_mcp"
252
258
  require_relative "cadenya/models/tool_set_adapter_openapi"
@@ -261,6 +267,7 @@ require_relative "cadenya/models/tool_set_info"
261
267
  require_relative "cadenya/models/tool_set_list_events_params"
262
268
  require_relative "cadenya/models/tool_set_list_params"
263
269
  require_relative "cadenya/models/tool_set_retrieve_params"
270
+ require_relative "cadenya/models/tool_sets/config_bare"
264
271
  require_relative "cadenya/models/tool_sets/config_http"
265
272
  require_relative "cadenya/models/tool_sets/config_mcp"
266
273
  require_relative "cadenya/models/tool_sets/config_openapi"
@@ -14,6 +14,16 @@ module Cadenya
14
14
  )
15
15
  end
16
16
 
17
+ # How long an objective may sit with no activity (no user messages, no LLM calls)
18
+ # before it is finalized as timed out. Between 1 minute and 24 hours. When not
19
+ # set, objectives are still swept at the system-wide 24 hour maximum — every
20
+ # objective eventually reaches a terminal state.
21
+ sig { returns(T.nilable(Integer)) }
22
+ attr_reader :inactivity_timeout
23
+
24
+ sig { params(inactivity_timeout: Integer).void }
25
+ attr_writer :inactivity_timeout
26
+
17
27
  # The maximum number of sub-objectives that can be created. 0 means no limit.
18
28
  sig { returns(T.nilable(Integer)) }
19
29
  attr_reader :max_sub_objectives
@@ -29,11 +39,18 @@ module Cadenya
29
39
  attr_writer :max_tool_calls
30
40
 
31
41
  sig do
32
- params(max_sub_objectives: Integer, max_tool_calls: Integer).returns(
33
- T.attached_class
34
- )
42
+ params(
43
+ inactivity_timeout: Integer,
44
+ max_sub_objectives: Integer,
45
+ max_tool_calls: Integer
46
+ ).returns(T.attached_class)
35
47
  end
36
48
  def self.new(
49
+ # How long an objective may sit with no activity (no user messages, no LLM calls)
50
+ # before it is finalized as timed out. Between 1 minute and 24 hours. When not
51
+ # set, objectives are still swept at the system-wide 24 hour maximum — every
52
+ # objective eventually reaches a terminal state.
53
+ inactivity_timeout: nil,
37
54
  # The maximum number of sub-objectives that can be created. 0 means no limit.
38
55
  max_sub_objectives: nil,
39
56
  # The maximum number of tool calls that can be made. 0 means no limit.
@@ -43,7 +60,11 @@ module Cadenya
43
60
 
44
61
  sig do
45
62
  override.returns(
46
- { max_sub_objectives: Integer, max_tool_calls: Integer }
63
+ {
64
+ inactivity_timeout: Integer,
65
+ max_sub_objectives: Integer,
66
+ max_tool_calls: Integer
67
+ }
47
68
  )
48
69
  end
49
70
  def to_hash
@@ -233,6 +233,11 @@ module Cadenya
233
233
  :OBJECTIVE_EVENT_TYPE_NOTICE,
234
234
  Cadenya::Agents::WebhookDeliveryData::EventType::TaggedSymbol
235
235
  )
236
+ OBJECTIVE_EVENT_TYPE_TIMED_OUT =
237
+ T.let(
238
+ :OBJECTIVE_EVENT_TYPE_TIMED_OUT,
239
+ Cadenya::Agents::WebhookDeliveryData::EventType::TaggedSymbol
240
+ )
236
241
 
237
242
  sig do
238
243
  override.returns(
@@ -202,6 +202,11 @@ module Cadenya
202
202
  :OBJECTIVE_EVENT_TYPE_NOTICE,
203
203
  Cadenya::Agents::WebhookDeliveryListParams::EventType::TaggedSymbol
204
204
  )
205
+ OBJECTIVE_EVENT_TYPE_TIMED_OUT =
206
+ T.let(
207
+ :OBJECTIVE_EVENT_TYPE_TIMED_OUT,
208
+ Cadenya::Agents::WebhookDeliveryListParams::EventType::TaggedSymbol
209
+ )
205
210
 
206
211
  sig do
207
212
  override.returns(
@@ -238,6 +238,8 @@ module Cadenya
238
238
  T.let(:STATE_CANCELLED, Cadenya::Objective::State::TaggedSymbol)
239
239
  STATE_FINALIZED =
240
240
  T.let(:STATE_FINALIZED, Cadenya::Objective::State::TaggedSymbol)
241
+ STATE_TIMED_OUT =
242
+ T.let(:STATE_TIMED_OUT, Cadenya::Objective::State::TaggedSymbol)
241
243
 
242
244
  sig do
243
245
  override.returns(T::Array[Cadenya::Objective::State::TaggedSymbol])
@@ -84,6 +84,20 @@ module Cadenya
84
84
  sig { params(sub_agent_updated: Cadenya::SubAgentUpdated::OrHash).void }
85
85
  attr_writer :sub_agent_updated
86
86
 
87
+ # ObjectiveTimedOut is the terminal event written when an objective is finalized
88
+ # by the inactivity sweep because it saw no activity (no user messages, no LLM
89
+ # calls) within its variation's inactivity timeout — or the system-wide 24 hour
90
+ # maximum when no timeout is configured. The objective produces no output. After
91
+ # this event, the objective is super-terminal: no further iterations, compaction,
92
+ # or continuation are permitted.
93
+ sig { returns(T.nilable(Cadenya::ObjectiveEventData::TimedOut)) }
94
+ attr_reader :timed_out
95
+
96
+ sig do
97
+ params(timed_out: Cadenya::ObjectiveEventData::TimedOut::OrHash).void
98
+ end
99
+ attr_writer :timed_out
100
+
87
101
  sig { returns(T.nilable(Cadenya::ToolApprovalRequested)) }
88
102
  attr_reader :tool_approval_requested
89
103
 
@@ -147,6 +161,7 @@ module Cadenya
147
161
  notice: Cadenya::ObjectiveEventData::Notice::OrHash,
148
162
  sub_agent_spawned: Cadenya::SubAgentSpawned::OrHash,
149
163
  sub_agent_updated: Cadenya::SubAgentUpdated::OrHash,
164
+ timed_out: Cadenya::ObjectiveEventData::TimedOut::OrHash,
150
165
  tool_approval_requested: Cadenya::ToolApprovalRequested::OrHash,
151
166
  tool_approved: Cadenya::ToolApproved::OrHash,
152
167
  tool_called: Cadenya::ToolCalled::OrHash,
@@ -181,6 +196,13 @@ module Cadenya
181
196
  notice: nil,
182
197
  sub_agent_spawned: nil,
183
198
  sub_agent_updated: nil,
199
+ # ObjectiveTimedOut is the terminal event written when an objective is finalized
200
+ # by the inactivity sweep because it saw no activity (no user messages, no LLM
201
+ # calls) within its variation's inactivity timeout — or the system-wide 24 hour
202
+ # maximum when no timeout is configured. The objective produces no output. After
203
+ # this event, the objective is super-terminal: no further iterations, compaction,
204
+ # or continuation are permitted.
205
+ timed_out: nil,
184
206
  tool_approval_requested: nil,
185
207
  tool_approved: nil,
186
208
  tool_called: nil,
@@ -204,6 +226,7 @@ module Cadenya
204
226
  notice: Cadenya::ObjectiveEventData::Notice,
205
227
  sub_agent_spawned: Cadenya::SubAgentSpawned,
206
228
  sub_agent_updated: Cadenya::SubAgentUpdated,
229
+ timed_out: Cadenya::ObjectiveEventData::TimedOut,
207
230
  tool_approval_requested: Cadenya::ToolApprovalRequested,
208
231
  tool_approved: Cadenya::ToolApproved,
209
232
  tool_called: Cadenya::ToolCalled,
@@ -396,6 +419,42 @@ module Cadenya
396
419
  end
397
420
  end
398
421
  end
422
+
423
+ class TimedOut < Cadenya::Internal::Type::BaseModel
424
+ OrHash =
425
+ T.type_alias do
426
+ T.any(
427
+ Cadenya::ObjectiveEventData::TimedOut,
428
+ Cadenya::Internal::AnyHash
429
+ )
430
+ end
431
+
432
+ # Human-readable note recorded at timeout time (e.g. "Timed out after 2h of
433
+ # inactivity").
434
+ sig { returns(T.nilable(String)) }
435
+ attr_reader :message
436
+
437
+ sig { params(message: String).void }
438
+ attr_writer :message
439
+
440
+ # ObjectiveTimedOut is the terminal event written when an objective is finalized
441
+ # by the inactivity sweep because it saw no activity (no user messages, no LLM
442
+ # calls) within its variation's inactivity timeout — or the system-wide 24 hour
443
+ # maximum when no timeout is configured. The objective produces no output. After
444
+ # this event, the objective is super-terminal: no further iterations, compaction,
445
+ # or continuation are permitted.
446
+ sig { params(message: String).returns(T.attached_class) }
447
+ def self.new(
448
+ # Human-readable note recorded at timeout time (e.g. "Timed out after 2h of
449
+ # inactivity").
450
+ message: nil
451
+ )
452
+ end
453
+
454
+ sig { override.returns({ message: String }) }
455
+ def to_hash
456
+ end
457
+ end
399
458
  end
400
459
  end
401
460
  end
@@ -179,6 +179,11 @@ module Cadenya
179
179
  :STATE_FINALIZED,
180
180
  Cadenya::ObjectiveListParams::State::TaggedSymbol
181
181
  )
182
+ STATE_TIMED_OUT =
183
+ T.let(
184
+ :STATE_TIMED_OUT,
185
+ Cadenya::ObjectiveListParams::State::TaggedSymbol
186
+ )
182
187
 
183
188
  sig do
184
189
  override.returns(
@@ -129,6 +129,11 @@ module Cadenya
129
129
  :TOOL_CALL_EXECUTION_STATUS_ERRORED,
130
130
  Cadenya::Objectives::ObjectiveToolCall::ExecutionStatus::TaggedSymbol
131
131
  )
132
+ TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT =
133
+ T.let(
134
+ :TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT,
135
+ Cadenya::Objectives::ObjectiveToolCall::ExecutionStatus::TaggedSymbol
136
+ )
132
137
 
133
138
  sig do
134
139
  override.returns(
@@ -171,6 +171,11 @@ module Cadenya
171
171
  :TOOL_CALL_EXECUTION_STATUS_ERRORED,
172
172
  Cadenya::Objectives::ObjectiveToolCallWithResult::ExecutionStatus::TaggedSymbol
173
173
  )
174
+ TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT =
175
+ T.let(
176
+ :TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT,
177
+ Cadenya::Objectives::ObjectiveToolCallWithResult::ExecutionStatus::TaggedSymbol
178
+ )
174
179
 
175
180
  sig do
176
181
  override.returns(
@@ -0,0 +1,40 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Models
5
+ module Objectives
6
+ class SetToolCallContentRequestAudioBlock < Cadenya::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Cadenya::Objectives::SetToolCallContentRequestAudioBlock,
11
+ Cadenya::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ # Base64-encoded audio bytes.
16
+ sig { returns(String) }
17
+ attr_accessor :data
18
+
19
+ # IANA media type of the audio, e.g. audio/wav.
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 audio bytes.
28
+ data:,
29
+ # IANA media type of the audio, e.g. audio/wav.
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,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