cadenya 1.6.0 → 1.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae66411f710ec4a8a1179bb0808b5d2a833e23941002f10e306f0740c13330c2
4
- data.tar.gz: 38707e94f11ebd1852aef385b9a61421aee21071b6fab2c59b9c3606a8f8e4a6
3
+ metadata.gz: f5648f64510c4220cdd7bbe9ad1c9d1f05b49640af22106da25282673c37510d
4
+ data.tar.gz: 288d867f32173e26da0c449830fc32f48eaa8e610ba825439a26dc8c4cc3e60e
5
5
  SHA512:
6
- metadata.gz: 20431f93c5ef100493776c4c36a2b70a0ca01ff14493c419df5f31e637cedaffd2a3b8f2b93144bc3bf3d19186e618b9c3dec4e37d5deb6ff19435dd540a5ba9
7
- data.tar.gz: 2080ef8b4f1c54c33760380a2c9da415a43ce581c2eb48b1164104bcf360ad3067ffd3dce09082edbf69b94723df7206d0854ce63930688a28bb72d6e2d0dfdd
6
+ metadata.gz: b77e5f294970813230c90859e0e0efbd5b6ff056c30b0a56ef56f5f77fe10d6e33038ec7bf780e6b8d8afa719271333a07e16d7ef588ba7df59944524c4d5ed4
7
+ data.tar.gz: 21d63e6814ad922be197ebf9e198f320eadd93f412f0a6c3127e81b7ef0040c8f20a573bacc54cd70dde1a69db69f42361ca4e19c8f9e32190d27a2772c33ffc
data/api.md CHANGED
@@ -136,7 +136,7 @@ client.workspace_admin.remove_member(profile_id, workspace_id: nil) # => nil
136
136
  Retrieves the profile for the credentials accessing the API
137
137
 
138
138
  ```ruby
139
- client.profiles.whoami() # => Cadenya::Types::Profile
139
+ client.profiles.whoami() # => Cadenya::Types::WhoamiResponse
140
140
  ```
141
141
 
142
142
  ## client.workspaces
@@ -481,7 +481,7 @@ client.objectives.list(workspace_id: nil, limit: nil, cursor: nil, agent_id: nil
481
481
  Create a new objective
482
482
 
483
483
  ```ruby
484
- client.objectives.create(agent_id:, system_prompt_data:, workspace_id: nil, variation_id: nil, metadata: nil, first_user_message: nil, secrets: nil, memory_cascade: nil, first_user_message_data: nil, episodic_memory: nil, tenant: nil, subject: nil, pinned_parameters: nil) # => Cadenya::Types::Objective
484
+ client.objectives.create(agent_id:, workspace_id: nil, variation_id: nil, metadata: nil, system_prompt_data: nil, first_user_message: nil, secrets: nil, memory_cascade: nil, first_user_message_data: nil, episodic_memory: nil, tenant: nil, subject: nil, pinned_parameters: nil) # => Cadenya::Types::Objective
485
485
  ```
486
486
  Get an objective by ID
487
487
 
@@ -518,6 +518,16 @@ Submit feedback for an objective
518
518
  ```ruby
519
519
  client.objectives.create_feedback(objective_id, metadata:, data:, workspace_id: nil) # => Cadenya::Types::ObjectiveFeedback
520
520
  ```
521
+ List objective queued actions
522
+
523
+ ```ruby
524
+ client.objectives.list_queued_actions(objective_id, workspace_id: nil, limit: nil, cursor: nil, state: nil) # => Cadenya::Page of Cadenya::Types::ObjectiveQueuedAction
525
+ ```
526
+ Remove a queued action
527
+
528
+ ```ruby
529
+ client.objectives.remove_queued_action(objective_id, queued_action_id:, workspace_id: nil) # => Cadenya::Types::ObjectiveQueuedAction
530
+ ```
521
531
  List objective tool calls
522
532
 
523
533
  ```ruby
@@ -556,12 +566,22 @@ client.objectives.cancel(objective_id, workspace_id: nil, reason: nil) # => Cade
556
566
  Compact an objective
557
567
 
558
568
  ```ruby
559
- client.objectives.compact(objective_id, workspace_id: nil, compaction_config: nil) # => Cadenya::Types::CompactObjectiveResponse
569
+ client.objectives.compact(objective_id, workspace_id: nil, compaction_config: nil) # => Cadenya::Types::ObjectiveQueuedAction
560
570
  ```
561
571
  Continue an objective
562
572
 
563
573
  ```ruby
564
- client.objectives.continue(objective_id, message:, workspace_id: nil, enqueue: nil) # => Cadenya::Types::ObjectiveEvent
574
+ client.objectives.continue(objective_id, message:, workspace_id: nil, enqueue: nil) # => Cadenya::Types::ContinueObjectiveResponse
575
+ ```
576
+ Interrupt an objective
577
+
578
+ ```ruby
579
+ client.objectives.interrupt(objective_id, workspace_id: nil) # => Cadenya::Types::ObjectiveEvent
580
+ ```
581
+ Create an objective and stream its events
582
+
583
+ ```ruby
584
+ client.objectives.create_and_stream(agent_id:, metadata:, workspace_id: nil, variation_id: nil, system_prompt_data: nil, first_user_message: nil, secrets: nil, memory_cascade: nil, first_user_message_data: nil, episodic_memory: nil, tenant: nil, subject: nil, pinned_parameters: nil, last_event_id: nil) # => Cadenya::Stream
565
585
  ```
566
586
 
567
587
  ## client.tool_search
@@ -38,7 +38,7 @@ module Cadenya
38
38
  end
39
39
 
40
40
  # Create a new objective
41
- def create(agent_id:, system_prompt_data:, workspace_id: nil, variation_id: nil, metadata: nil, first_user_message: nil, secrets: nil, memory_cascade: nil, first_user_message_data: nil, episodic_memory: nil, tenant: nil, subject: nil, pinned_parameters: nil, request_options: nil)
41
+ def create(agent_id:, workspace_id: nil, variation_id: nil, metadata: nil, system_prompt_data: nil, first_user_message: nil, secrets: nil, memory_cascade: nil, first_user_message_data: nil, episodic_memory: nil, tenant: nil, subject: nil, pinned_parameters: nil, request_options: nil)
42
42
  workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
43
43
  _path = "/v1/workspaces/#{Util.path_param('workspaceId', workspace_id)}/objectives"
44
44
  _body = {
@@ -155,6 +155,31 @@ module Cadenya
155
155
  Types::ObjectiveFeedback.from_json(_data)
156
156
  end
157
157
 
158
+ # List objective queued actions
159
+ def list_queued_actions(objective_id, workspace_id: nil, limit: nil, cursor: nil, state: nil, request_options: nil)
160
+ workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
161
+ _path = "/v1/workspaces/#{Util.path_param('workspaceId', workspace_id)}/objectives/#{Util.path_param('objectiveId', objective_id)}/queued_actions"
162
+ _query = {
163
+ "limit" => limit,
164
+ "cursor" => cursor,
165
+ "state" => state,
166
+ }
167
+ _data = @core.request(:get, _path, query: _query, request_options: request_options) || {}
168
+ _items = (_data["items"] || []).map { |item| Types::ObjectiveQueuedAction.from_json(item) }
169
+ _next_cursor = (((_data)["pagination"] || {}))["nextCursor"].to_s
170
+ Page.new(_items, _next_cursor) do |_c|
171
+ list_queued_actions(objective_id, workspace_id: workspace_id, limit: limit, cursor: _c, state: state, request_options: request_options)
172
+ end
173
+ end
174
+
175
+ # Remove a queued action
176
+ def remove_queued_action(objective_id, queued_action_id:, workspace_id: nil, request_options: nil)
177
+ workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
178
+ _path = "/v1/workspaces/#{Util.path_param('workspaceId', workspace_id)}/objectives/#{Util.path_param('objectiveId', objective_id)}/queued_actions/#{Util.path_param('queuedActionId', queued_action_id)}:remove"
179
+ _data = @core.request(:post, _path, request_options: request_options)
180
+ Types::ObjectiveQueuedAction.from_json(_data)
181
+ end
182
+
158
183
  # List objective tool calls
159
184
  def list_tool_calls(objective_id, workspace_id: nil, limit: nil, cursor: nil, status: nil, include_info: nil, execution_status: nil, labels: nil, request_options: nil)
160
185
  workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
@@ -248,7 +273,7 @@ module Cadenya
248
273
  "compactionConfig" => compaction_config.nil? ? nil : (->(_v) { Types.encode_AgentVariationSpec_CompactionConfig(_v) }).call(compaction_config),
249
274
  }.reject { |_k, v| v.nil? }
250
275
  _data = @core.request(:post, _path, body: _body, request_options: request_options)
251
- Types::CompactObjectiveResponse.from_json(_data)
276
+ Types::ObjectiveQueuedAction.from_json(_data)
252
277
  end
253
278
 
254
279
  # Continue an objective
@@ -260,8 +285,42 @@ module Cadenya
260
285
  "enqueue" => enqueue,
261
286
  }.reject { |_k, v| v.nil? }
262
287
  _data = @core.request(:post, _path, body: _body, request_options: request_options)
288
+ Types.decode_ContinueObjectiveResponse(_data)
289
+ end
290
+
291
+ # Interrupt an objective
292
+ def interrupt(objective_id, workspace_id: nil, request_options: nil)
293
+ workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
294
+ _path = "/v1/workspaces/#{Util.path_param('workspaceId', workspace_id)}/objectives/#{Util.path_param('objectiveId', objective_id)}:interrupt"
295
+ _data = @core.request(:post, _path, request_options: request_options)
263
296
  Types::ObjectiveEvent.from_json(_data)
264
297
  end
298
+
299
+ # Create an objective and stream its events
300
+ def create_and_stream(agent_id:, metadata:, workspace_id: nil, variation_id: nil, system_prompt_data: nil, first_user_message: nil, secrets: nil, memory_cascade: nil, first_user_message_data: nil, episodic_memory: nil, tenant: nil, subject: nil, pinned_parameters: nil, last_event_id: nil, request_options: nil)
301
+ workspace_id = @core.resolve_default("workspaceId", "CADENYA_WORKSPACE_ID", workspace_id)
302
+ _path = "/v1/workspaces/#{Util.path_param('workspaceId', workspace_id)}/objectives:stream"
303
+ _body = {
304
+ "agentId" => agent_id,
305
+ "variationId" => variation_id,
306
+ "metadata" => metadata.nil? ? nil : (->(_v) { Types.encode_CreateAndStreamObjectiveRequest_Metadata(_v) }).call(metadata),
307
+ "systemPromptData" => system_prompt_data,
308
+ "firstUserMessage" => first_user_message,
309
+ "secrets" => secrets.nil? ? nil : (->(_v) { _v.is_a?(Array) ? _v.map { |_i| (->(_v) { Types.encode_CreateObjectiveRequest_Secret(_v) }).call(_i) } : _v }).call(secrets),
310
+ "memoryCascade" => memory_cascade.nil? ? nil : (->(_v) { _v.is_a?(Array) ? _v.map { |_i| (->(_v) { Types.encode_MemoryReference(_v) }).call(_i) } : _v }).call(memory_cascade),
311
+ "firstUserMessageData" => first_user_message_data,
312
+ "episodicMemory" => episodic_memory.nil? ? nil : (->(_v) { Types.encode_ObjectiveEpisodicConfig(_v) }).call(episodic_memory),
313
+ "tenant" => tenant.nil? ? nil : (->(_v) { Types.encode_TenantAssertion(_v) }).call(tenant),
314
+ "subject" => subject.nil? ? nil : (->(_v) { Types.encode_SubjectAssertion(_v) }).call(subject),
315
+ "pinnedParameters" => pinned_parameters,
316
+ }.reject { |_k, v| v.nil? }
317
+ _headers = last_event_id ? { "Last-Event-ID" => last_event_id } : nil
318
+ _decoder = ->(event) { Types.decode_CreateAndStreamObjectiveResponse(event) }
319
+ _auto_reconnect = !(request_options && request_options[:reconnect] == false)
320
+ Stream.new(_decoder, last_event_id: last_event_id, skip_events: ["ping", "open"], auto_reconnect: _auto_reconnect) do |_cancel, _resume, &on_chunk|
321
+ @core.stream_request(:post, _path, body: _body, headers: (_resume ? { "Last-Event-ID" => _resume } : nil), request_options: request_options, cancel: _cancel, &on_chunk)
322
+ end
323
+ end
265
324
  end
266
325
  end
267
326
  end
@@ -13,7 +13,7 @@ module Cadenya
13
13
  def whoami(request_options: nil)
14
14
  _path = "/v1/whoami"
15
15
  _data = @core.request(:get, _path, request_options: request_options)
16
- Types::Profile.from_json(_data)
16
+ Types::WhoamiResponse.from_json(_data)
17
17
  end
18
18
  end
19
19
  end
data/lib/cadenya/types.rb CHANGED
@@ -1488,26 +1488,6 @@ module Cadenya
1488
1488
  end
1489
1489
  end
1490
1490
 
1491
- class CompactObjectiveResponse
1492
- attr_reader :context_window
1493
-
1494
- def initialize(context_window: nil)
1495
- @context_window = context_window
1496
- end
1497
-
1498
- def self.from_json(data)
1499
- new(
1500
- context_window: data["contextWindow"].nil? ? nil : Types::ObjectiveContextWindowData.from_json(data["contextWindow"]),
1501
- )
1502
- end
1503
-
1504
- def to_h
1505
- {
1506
- context_window: Util.plain(@context_window),
1507
- }.reject { |_k, v| v.nil? }
1508
- end
1509
- end
1510
-
1511
1491
  class CompactionConfig_SummarizationStrategy
1512
1492
  attr_reader :instructions
1513
1493
 
@@ -1747,6 +1727,18 @@ module Cadenya
1747
1727
  end
1748
1728
  end
1749
1729
 
1730
+ def self.decode_ContinueObjectiveResponse(data)
1731
+ return nil if data.nil? || data["type"].to_s.empty?
1732
+ case data["type"]
1733
+ when "event"
1734
+ Types::ContinueObjectiveResponse_Event.from_json(data)
1735
+ when "queuedAction"
1736
+ Types::ContinueObjectiveResponse_QueuedAction.from_json(data)
1737
+ else
1738
+ raise ArgumentError, "ContinueObjectiveResponse: unknown type #{data["type"].inspect}"
1739
+ end
1740
+ end
1741
+
1750
1742
  class CreateAIProviderKeyRequest
1751
1743
  attr_reader :workspace_id, :metadata, :spec
1752
1744
 
@@ -1938,6 +1930,97 @@ module Cadenya
1938
1930
  end
1939
1931
  end
1940
1932
 
1933
+ class CreateAndStreamObjectiveRequest
1934
+ attr_reader :workspace_id, :agent_id, :variation_id, :metadata, :system_prompt_data, :first_user_message, :secrets, :memory_cascade, :first_user_message_data, :episodic_memory, :tenant, :subject, :pinned_parameters
1935
+
1936
+ def initialize(workspace_id: nil, agent_id: nil, variation_id: nil, metadata: nil, system_prompt_data: nil, first_user_message: nil, secrets: nil, memory_cascade: nil, first_user_message_data: nil, episodic_memory: nil, tenant: nil, subject: nil, pinned_parameters: nil)
1937
+ @workspace_id = workspace_id
1938
+ @agent_id = agent_id
1939
+ @variation_id = variation_id
1940
+ @metadata = metadata
1941
+ @system_prompt_data = system_prompt_data
1942
+ @first_user_message = first_user_message
1943
+ @secrets = secrets
1944
+ @memory_cascade = memory_cascade
1945
+ @first_user_message_data = first_user_message_data
1946
+ @episodic_memory = episodic_memory
1947
+ @tenant = tenant
1948
+ @subject = subject
1949
+ @pinned_parameters = pinned_parameters
1950
+ end
1951
+
1952
+ def self.from_json(data)
1953
+ new(
1954
+ workspace_id: data["workspaceId"],
1955
+ agent_id: data["agentId"],
1956
+ variation_id: data["variationId"],
1957
+ metadata: data["metadata"].nil? ? nil : Types::CreateAndStreamObjectiveRequest_Metadata.from_json(data["metadata"]),
1958
+ system_prompt_data: data["systemPromptData"],
1959
+ first_user_message: data["firstUserMessage"],
1960
+ secrets: data["secrets"].nil? ? nil : (data["secrets"]).map { |item| Types::CreateObjectiveRequest_Secret.from_json(item) },
1961
+ memory_cascade: data["memoryCascade"].nil? ? nil : (data["memoryCascade"]).map { |item| Types::MemoryReference.from_json(item) },
1962
+ first_user_message_data: data["firstUserMessageData"],
1963
+ episodic_memory: data["episodicMemory"].nil? ? nil : Types::ObjectiveEpisodicConfig.from_json(data["episodicMemory"]),
1964
+ tenant: data["tenant"].nil? ? nil : Types::TenantAssertion.from_json(data["tenant"]),
1965
+ subject: data["subject"].nil? ? nil : Types::SubjectAssertion.from_json(data["subject"]),
1966
+ pinned_parameters: data["pinnedParameters"],
1967
+ )
1968
+ end
1969
+
1970
+ def to_h
1971
+ {
1972
+ workspace_id: Util.plain(@workspace_id),
1973
+ agent_id: Util.plain(@agent_id),
1974
+ variation_id: Util.plain(@variation_id),
1975
+ metadata: Util.plain(@metadata),
1976
+ system_prompt_data: Util.plain(@system_prompt_data),
1977
+ first_user_message: Util.plain(@first_user_message),
1978
+ secrets: Util.plain(@secrets),
1979
+ memory_cascade: Util.plain(@memory_cascade),
1980
+ first_user_message_data: Util.plain(@first_user_message_data),
1981
+ episodic_memory: Util.plain(@episodic_memory),
1982
+ tenant: Util.plain(@tenant),
1983
+ subject: Util.plain(@subject),
1984
+ pinned_parameters: Util.plain(@pinned_parameters),
1985
+ }.reject { |_k, v| v.nil? }
1986
+ end
1987
+ end
1988
+
1989
+ class CreateAndStreamObjectiveRequest_Metadata
1990
+ attr_reader :labels, :external_id
1991
+
1992
+ def initialize(labels: nil, external_id: nil)
1993
+ @labels = labels
1994
+ @external_id = external_id
1995
+ end
1996
+
1997
+ def self.from_json(data)
1998
+ new(
1999
+ labels: data["labels"],
2000
+ external_id: data["externalId"],
2001
+ )
2002
+ end
2003
+
2004
+ def to_h
2005
+ {
2006
+ labels: Util.plain(@labels),
2007
+ external_id: Util.plain(@external_id),
2008
+ }.reject { |_k, v| v.nil? }
2009
+ end
2010
+ end
2011
+
2012
+ def self.decode_CreateAndStreamObjectiveResponse(data)
2013
+ return nil if data.nil? || data["type"].to_s.empty?
2014
+ case data["type"]
2015
+ when "objective"
2016
+ Types::CreateAndStreamObjectiveResponse_Objective.from_json(data)
2017
+ when "event"
2018
+ Types::CreateAndStreamObjectiveResponse_Event.from_json(data)
2019
+ else
2020
+ raise ArgumentError, "CreateAndStreamObjectiveResponse: unknown type #{data["type"].inspect}"
2021
+ end
2022
+ end
2023
+
1941
2024
  class CreateMemoryEntryRequest
1942
2025
  attr_reader :workspace_id, :memory_layer_id, :metadata, :spec
1943
2026
 
@@ -2729,6 +2812,29 @@ module Cadenya
2729
2812
  end
2730
2813
  end
2731
2814
 
2815
+ class InterruptObjectiveRequest
2816
+ attr_reader :workspace_id, :objective_id
2817
+
2818
+ def initialize(workspace_id: nil, objective_id: nil)
2819
+ @workspace_id = workspace_id
2820
+ @objective_id = objective_id
2821
+ end
2822
+
2823
+ def self.from_json(data)
2824
+ new(
2825
+ workspace_id: data["workspaceId"],
2826
+ objective_id: data["objectiveId"],
2827
+ )
2828
+ end
2829
+
2830
+ def to_h
2831
+ {
2832
+ workspace_id: Util.plain(@workspace_id),
2833
+ objective_id: Util.plain(@objective_id),
2834
+ }.reject { |_k, v| v.nil? }
2835
+ end
2836
+ end
2837
+
2732
2838
  class ListAIProviderKeysResponse
2733
2839
  attr_reader :items, :pagination
2734
2840
 
@@ -3074,6 +3180,29 @@ module Cadenya
3074
3180
  end
3075
3181
  end
3076
3182
 
3183
+ class ListObjectiveQueuedActionsResponse
3184
+ attr_reader :items, :pagination
3185
+
3186
+ def initialize(items: nil, pagination: nil)
3187
+ @items = items
3188
+ @pagination = pagination
3189
+ end
3190
+
3191
+ def self.from_json(data)
3192
+ new(
3193
+ items: data["items"].nil? ? nil : (data["items"]).map { |item| Types::ObjectiveQueuedAction.from_json(item) },
3194
+ pagination: data["pagination"].nil? ? nil : Types::Page.from_json(data["pagination"]),
3195
+ )
3196
+ end
3197
+
3198
+ def to_h
3199
+ {
3200
+ items: Util.plain(@items),
3201
+ pagination: Util.plain(@pagination),
3202
+ }.reject { |_k, v| v.nil? }
3203
+ end
3204
+ end
3205
+
3077
3206
  class ListObjectiveToolCallsResponse
3078
3207
  attr_reader :items, :pagination
3079
3208
 
@@ -3800,17 +3929,19 @@ module Cadenya
3800
3929
  end
3801
3930
 
3802
3931
  class ModelBasePricing
3803
- attr_reader :input_price_per_million_tokens, :output_price_per_million_tokens
3932
+ attr_reader :input_price_per_million_tokens, :output_price_per_million_tokens, :cached_input_price_per_million_tokens
3804
3933
 
3805
- def initialize(input_price_per_million_tokens: nil, output_price_per_million_tokens: nil)
3934
+ def initialize(input_price_per_million_tokens: nil, output_price_per_million_tokens: nil, cached_input_price_per_million_tokens: nil)
3806
3935
  @input_price_per_million_tokens = input_price_per_million_tokens
3807
3936
  @output_price_per_million_tokens = output_price_per_million_tokens
3937
+ @cached_input_price_per_million_tokens = cached_input_price_per_million_tokens
3808
3938
  end
3809
3939
 
3810
3940
  def self.from_json(data)
3811
3941
  new(
3812
3942
  input_price_per_million_tokens: data["inputPricePerMillionTokens"],
3813
3943
  output_price_per_million_tokens: data["outputPricePerMillionTokens"],
3944
+ cached_input_price_per_million_tokens: data["cachedInputPricePerMillionTokens"],
3814
3945
  )
3815
3946
  end
3816
3947
 
@@ -3818,6 +3949,7 @@ module Cadenya
3818
3949
  {
3819
3950
  input_price_per_million_tokens: Util.plain(@input_price_per_million_tokens),
3820
3951
  output_price_per_million_tokens: Util.plain(@output_price_per_million_tokens),
3952
+ cached_input_price_per_million_tokens: Util.plain(@cached_input_price_per_million_tokens),
3821
3953
  }.reject { |_k, v| v.nil? }
3822
3954
  end
3823
3955
  end
@@ -3849,17 +3981,19 @@ module Cadenya
3849
3981
  end
3850
3982
 
3851
3983
  class ModelPricingOverride
3852
- attr_reader :input_price_per_million_tokens, :output_price_per_million_tokens
3984
+ attr_reader :input_price_per_million_tokens, :output_price_per_million_tokens, :cached_input_price_per_million_tokens
3853
3985
 
3854
- def initialize(input_price_per_million_tokens: nil, output_price_per_million_tokens: nil)
3986
+ def initialize(input_price_per_million_tokens: nil, output_price_per_million_tokens: nil, cached_input_price_per_million_tokens: nil)
3855
3987
  @input_price_per_million_tokens = input_price_per_million_tokens
3856
3988
  @output_price_per_million_tokens = output_price_per_million_tokens
3989
+ @cached_input_price_per_million_tokens = cached_input_price_per_million_tokens
3857
3990
  end
3858
3991
 
3859
3992
  def self.from_json(data)
3860
3993
  new(
3861
3994
  input_price_per_million_tokens: data["inputPricePerMillionTokens"],
3862
3995
  output_price_per_million_tokens: data["outputPricePerMillionTokens"],
3996
+ cached_input_price_per_million_tokens: data["cachedInputPricePerMillionTokens"],
3863
3997
  )
3864
3998
  end
3865
3999
 
@@ -3867,20 +4001,22 @@ module Cadenya
3867
4001
  {
3868
4002
  input_price_per_million_tokens: Util.plain(@input_price_per_million_tokens),
3869
4003
  output_price_per_million_tokens: Util.plain(@output_price_per_million_tokens),
4004
+ cached_input_price_per_million_tokens: Util.plain(@cached_input_price_per_million_tokens),
3870
4005
  }.reject { |_k, v| v.nil? }
3871
4006
  end
3872
4007
  end
3873
4008
 
3874
4009
  class ModelSpec
3875
- attr_reader :provider, :family, :max_input_tokens, :max_output_tokens, :input_price_per_million_tokens, :output_price_per_million_tokens, :capabilities, :provider_model_id
4010
+ attr_reader :provider, :family, :max_input_tokens, :max_output_tokens, :input_price_per_million_tokens, :output_price_per_million_tokens, :cached_input_price_per_million_tokens, :capabilities, :provider_model_id
3876
4011
 
3877
- def initialize(provider: nil, family: nil, max_input_tokens: nil, max_output_tokens: nil, input_price_per_million_tokens: nil, output_price_per_million_tokens: nil, capabilities: nil, provider_model_id: nil)
4012
+ def initialize(provider: nil, family: nil, max_input_tokens: nil, max_output_tokens: nil, input_price_per_million_tokens: nil, output_price_per_million_tokens: nil, cached_input_price_per_million_tokens: nil, capabilities: nil, provider_model_id: nil)
3878
4013
  @provider = provider
3879
4014
  @family = family
3880
4015
  @max_input_tokens = max_input_tokens
3881
4016
  @max_output_tokens = max_output_tokens
3882
4017
  @input_price_per_million_tokens = input_price_per_million_tokens
3883
4018
  @output_price_per_million_tokens = output_price_per_million_tokens
4019
+ @cached_input_price_per_million_tokens = cached_input_price_per_million_tokens
3884
4020
  @capabilities = capabilities
3885
4021
  @provider_model_id = provider_model_id
3886
4022
  end
@@ -3893,6 +4029,7 @@ module Cadenya
3893
4029
  max_output_tokens: data["maxOutputTokens"],
3894
4030
  input_price_per_million_tokens: data["inputPricePerMillionTokens"],
3895
4031
  output_price_per_million_tokens: data["outputPricePerMillionTokens"],
4032
+ cached_input_price_per_million_tokens: data["cachedInputPricePerMillionTokens"],
3896
4033
  capabilities: data["capabilities"].nil? ? nil : (data["capabilities"]).map { |item| Types.decode_ModelSpec_Capability(item) },
3897
4034
  provider_model_id: data["providerModelId"],
3898
4035
  )
@@ -3906,6 +4043,7 @@ module Cadenya
3906
4043
  max_output_tokens: Util.plain(@max_output_tokens),
3907
4044
  input_price_per_million_tokens: Util.plain(@input_price_per_million_tokens),
3908
4045
  output_price_per_million_tokens: Util.plain(@output_price_per_million_tokens),
4046
+ cached_input_price_per_million_tokens: Util.plain(@cached_input_price_per_million_tokens),
3909
4047
  capabilities: Util.plain(@capabilities),
3910
4048
  provider_model_id: Util.plain(@provider_model_id),
3911
4049
  }.reject { |_k, v| v.nil? }
@@ -3962,7 +4100,7 @@ module Cadenya
3962
4100
  end
3963
4101
  end
3964
4102
 
3965
- ObjectiveState = ["OBJECTIVE_STATE_UNSPECIFIED", "OBJECTIVE_STATE_PENDING", "OBJECTIVE_STATE_RUNNING", "OBJECTIVE_STATE_WAITING", "OBJECTIVE_STATE_FAILED", "OBJECTIVE_STATE_CANCELLED", "OBJECTIVE_STATE_FINALIZED", "OBJECTIVE_STATE_TIMED_OUT"].freeze
4103
+ ObjectiveState = ["OBJECTIVE_STATE_UNSPECIFIED", "OBJECTIVE_STATE_PENDING", "OBJECTIVE_STATE_RUNNING", "OBJECTIVE_STATE_WAITING", "OBJECTIVE_STATE_FAILED", "OBJECTIVE_STATE_CANCELLED", "OBJECTIVE_STATE_FINALIZED", "OBJECTIVE_STATE_TIMED_OUT", "OBJECTIVE_STATE_INTERRUPTING"].freeze
3966
4104
 
3967
4105
  class Objective
3968
4106
  attr_reader :metadata, :config_snapshot, :state, :state_message, :info, :system_prompt, :first_user_message, :parent_objective_id, :secrets, :system_prompt_data, :memory_cascade, :output, :first_user_message_data, :episodic_memory, :pinned_parameters
@@ -4303,6 +4441,8 @@ module Cadenya
4303
4441
  Types::ObjectiveEventData_StateChanged.from_json(data)
4304
4442
  when "heartbeat"
4305
4443
  Types::ObjectiveEventData_Heartbeat.from_json(data)
4444
+ when "interrupted"
4445
+ Types::ObjectiveEventData_Interrupted.from_json(data)
4306
4446
  else
4307
4447
  raise ArgumentError, "ObjectiveEventData: unknown type #{data["type"].inspect}"
4308
4448
  end
@@ -4495,9 +4635,78 @@ module Cadenya
4495
4635
  end
4496
4636
  end
4497
4637
 
4498
- ObjectiveStateChangedFromState = ["OBJECTIVE_STATE_UNSPECIFIED", "OBJECTIVE_STATE_PENDING", "OBJECTIVE_STATE_RUNNING", "OBJECTIVE_STATE_WAITING", "OBJECTIVE_STATE_FAILED", "OBJECTIVE_STATE_CANCELLED", "OBJECTIVE_STATE_FINALIZED", "OBJECTIVE_STATE_TIMED_OUT"].freeze
4638
+ class ObjectiveInterrupted
4639
+ attr_reader :message
4499
4640
 
4500
- ObjectiveStateChangedToState = ["OBJECTIVE_STATE_UNSPECIFIED", "OBJECTIVE_STATE_PENDING", "OBJECTIVE_STATE_RUNNING", "OBJECTIVE_STATE_WAITING", "OBJECTIVE_STATE_FAILED", "OBJECTIVE_STATE_CANCELLED", "OBJECTIVE_STATE_FINALIZED", "OBJECTIVE_STATE_TIMED_OUT"].freeze
4641
+ def initialize(message: nil)
4642
+ @message = message
4643
+ end
4644
+
4645
+ def self.from_json(data)
4646
+ new(
4647
+ message: data["message"],
4648
+ )
4649
+ end
4650
+
4651
+ def to_h
4652
+ {
4653
+ message: Util.plain(@message),
4654
+ }.reject { |_k, v| v.nil? }
4655
+ end
4656
+ end
4657
+
4658
+ ObjectiveQueuedActionState = ["STATE_UNSPECIFIED", "STATE_QUEUED", "STATE_SENT", "STATE_REMOVED", "STATE_DISCARDED"].freeze
4659
+
4660
+ class ObjectiveQueuedAction
4661
+ attr_reader :metadata, :objective_id, :data, :state, :sent_at, :objective_event_id
4662
+
4663
+ def initialize(metadata: nil, objective_id: nil, data: nil, state: nil, sent_at: nil, objective_event_id: nil)
4664
+ @metadata = metadata
4665
+ @objective_id = objective_id
4666
+ @data = data
4667
+ @state = state
4668
+ @sent_at = sent_at
4669
+ @objective_event_id = objective_event_id
4670
+ end
4671
+
4672
+ def self.from_json(data)
4673
+ new(
4674
+ metadata: data["metadata"].nil? ? nil : Types::OperationMetadata.from_json(data["metadata"]),
4675
+ objective_id: data["objectiveId"],
4676
+ data: data["data"].nil? ? nil : Types.decode_ObjectiveQueuedActionData(data["data"]),
4677
+ state: data["state"],
4678
+ sent_at: data["sentAt"].nil? ? nil : Time.iso8601(data["sentAt"]),
4679
+ objective_event_id: data["objectiveEventId"],
4680
+ )
4681
+ end
4682
+
4683
+ def to_h
4684
+ {
4685
+ metadata: Util.plain(@metadata),
4686
+ objective_id: Util.plain(@objective_id),
4687
+ data: Util.plain(@data),
4688
+ state: Util.plain(@state),
4689
+ sent_at: Util.plain(@sent_at),
4690
+ objective_event_id: Util.plain(@objective_event_id),
4691
+ }.reject { |_k, v| v.nil? }
4692
+ end
4693
+ end
4694
+
4695
+ def self.decode_ObjectiveQueuedActionData(data)
4696
+ return nil if data.nil? || data["type"].to_s.empty?
4697
+ case data["type"]
4698
+ when "userMessage"
4699
+ Types::ObjectiveQueuedActionData_UserMessage.from_json(data)
4700
+ when "compaction"
4701
+ Types::ObjectiveQueuedActionData_Compaction.from_json(data)
4702
+ else
4703
+ raise ArgumentError, "ObjectiveQueuedActionData: unknown type #{data["type"].inspect}"
4704
+ end
4705
+ end
4706
+
4707
+ ObjectiveStateChangedFromState = ["OBJECTIVE_STATE_UNSPECIFIED", "OBJECTIVE_STATE_PENDING", "OBJECTIVE_STATE_RUNNING", "OBJECTIVE_STATE_WAITING", "OBJECTIVE_STATE_FAILED", "OBJECTIVE_STATE_CANCELLED", "OBJECTIVE_STATE_FINALIZED", "OBJECTIVE_STATE_TIMED_OUT", "OBJECTIVE_STATE_INTERRUPTING"].freeze
4708
+
4709
+ ObjectiveStateChangedToState = ["OBJECTIVE_STATE_UNSPECIFIED", "OBJECTIVE_STATE_PENDING", "OBJECTIVE_STATE_RUNNING", "OBJECTIVE_STATE_WAITING", "OBJECTIVE_STATE_FAILED", "OBJECTIVE_STATE_CANCELLED", "OBJECTIVE_STATE_FINALIZED", "OBJECTIVE_STATE_TIMED_OUT", "OBJECTIVE_STATE_INTERRUPTING"].freeze
4501
4710
 
4502
4711
  class ObjectiveStateChanged
4503
4712
  attr_reader :from_state, :to_state, :message
@@ -4570,7 +4779,7 @@ module Cadenya
4570
4779
 
4571
4780
  ObjectiveToolCallStatus = ["TOOL_CALL_STATUS_UNSPECIFIED", "TOOL_CALL_STATUS_AUTO_APPROVED", "TOOL_CALL_STATUS_WAITING_FOR_APPROVAL", "TOOL_CALL_STATUS_APPROVED", "TOOL_CALL_STATUS_DENIED"].freeze
4572
4781
 
4573
- ObjectiveToolCallExecutionStatus = ["TOOL_CALL_EXECUTION_STATUS_UNSPECIFIED", "TOOL_CALL_EXECUTION_STATUS_PENDING", "TOOL_CALL_EXECUTION_STATUS_RUNNING", "TOOL_CALL_EXECUTION_STATUS_COMPLETED", "TOOL_CALL_EXECUTION_STATUS_ERRORED", "TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT"].freeze
4782
+ ObjectiveToolCallExecutionStatus = ["TOOL_CALL_EXECUTION_STATUS_UNSPECIFIED", "TOOL_CALL_EXECUTION_STATUS_PENDING", "TOOL_CALL_EXECUTION_STATUS_RUNNING", "TOOL_CALL_EXECUTION_STATUS_COMPLETED", "TOOL_CALL_EXECUTION_STATUS_ERRORED", "TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT", "TOOL_CALL_EXECUTION_STATUS_INTERRUPTED"].freeze
4574
4783
 
4575
4784
  class ObjectiveToolCall
4576
4785
  attr_reader :metadata, :data, :status, :info, :execution_status
@@ -4782,7 +4991,7 @@ module Cadenya
4782
4991
 
4783
4992
  ObjectiveToolCallWithResultStatus = ["TOOL_CALL_STATUS_UNSPECIFIED", "TOOL_CALL_STATUS_AUTO_APPROVED", "TOOL_CALL_STATUS_WAITING_FOR_APPROVAL", "TOOL_CALL_STATUS_APPROVED", "TOOL_CALL_STATUS_DENIED"].freeze
4784
4993
 
4785
- ObjectiveToolCallWithResultExecutionStatus = ["TOOL_CALL_EXECUTION_STATUS_UNSPECIFIED", "TOOL_CALL_EXECUTION_STATUS_PENDING", "TOOL_CALL_EXECUTION_STATUS_RUNNING", "TOOL_CALL_EXECUTION_STATUS_COMPLETED", "TOOL_CALL_EXECUTION_STATUS_ERRORED", "TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT"].freeze
4994
+ ObjectiveToolCallWithResultExecutionStatus = ["TOOL_CALL_EXECUTION_STATUS_UNSPECIFIED", "TOOL_CALL_EXECUTION_STATUS_PENDING", "TOOL_CALL_EXECUTION_STATUS_RUNNING", "TOOL_CALL_EXECUTION_STATUS_COMPLETED", "TOOL_CALL_EXECUTION_STATUS_ERRORED", "TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT", "TOOL_CALL_EXECUTION_STATUS_INTERRUPTED"].freeze
4786
4995
 
4787
4996
  class ObjectiveToolCallWithResult
4788
4997
  attr_reader :metadata, :data, :status, :info, :execution_status, :result, :resolved_secrets
@@ -5160,6 +5369,46 @@ module Cadenya
5160
5369
  end
5161
5370
  end
5162
5371
 
5372
+ class QueuedCompaction
5373
+ attr_reader :compaction_config
5374
+
5375
+ def initialize(compaction_config: nil)
5376
+ @compaction_config = compaction_config
5377
+ end
5378
+
5379
+ def self.from_json(data)
5380
+ new(
5381
+ compaction_config: data["compactionConfig"].nil? ? nil : Types::AgentVariationSpec_CompactionConfig.from_json(data["compactionConfig"]),
5382
+ )
5383
+ end
5384
+
5385
+ def to_h
5386
+ {
5387
+ compaction_config: Util.plain(@compaction_config),
5388
+ }.reject { |_k, v| v.nil? }
5389
+ end
5390
+ end
5391
+
5392
+ class QueuedUserMessage
5393
+ attr_reader :content
5394
+
5395
+ def initialize(content: nil)
5396
+ @content = content
5397
+ end
5398
+
5399
+ def self.from_json(data)
5400
+ new(
5401
+ content: data["content"],
5402
+ )
5403
+ end
5404
+
5405
+ def to_h
5406
+ {
5407
+ content: Util.plain(@content),
5408
+ }.reject { |_k, v| v.nil? }
5409
+ end
5410
+ end
5411
+
5163
5412
  class Reasoning
5164
5413
  attr_reader :content
5165
5414
 
@@ -5225,6 +5474,32 @@ module Cadenya
5225
5474
  end
5226
5475
  end
5227
5476
 
5477
+ class RemoveObjectiveQueuedActionRequest
5478
+ attr_reader :workspace_id, :objective_id, :queued_action_id
5479
+
5480
+ def initialize(workspace_id: nil, objective_id: nil, queued_action_id: nil)
5481
+ @workspace_id = workspace_id
5482
+ @objective_id = objective_id
5483
+ @queued_action_id = queued_action_id
5484
+ end
5485
+
5486
+ def self.from_json(data)
5487
+ new(
5488
+ workspace_id: data["workspaceId"],
5489
+ objective_id: data["objectiveId"],
5490
+ queued_action_id: data["queuedActionId"],
5491
+ )
5492
+ end
5493
+
5494
+ def to_h
5495
+ {
5496
+ workspace_id: Util.plain(@workspace_id),
5497
+ objective_id: Util.plain(@objective_id),
5498
+ queued_action_id: Util.plain(@queued_action_id),
5499
+ }.reject { |_k, v| v.nil? }
5500
+ end
5501
+ end
5502
+
5228
5503
  ResolvedSecretSource = ["RESOLVED_SECRET_SOURCE_UNSPECIFIED", "RESOLVED_SECRET_SOURCE_WORKSPACE", "RESOLVED_SECRET_SOURCE_TOOLSET", "RESOLVED_SECRET_SOURCE_OBJECTIVE"].freeze
5229
5504
 
5230
5505
  class ResolvedSecret
@@ -6870,12 +7145,13 @@ module Cadenya
6870
7145
  end
6871
7146
 
6872
7147
  class ToolSetSpec
6873
- attr_reader :description, :adapter, :overlays
7148
+ attr_reader :description, :adapter, :overlays, :secrets
6874
7149
 
6875
- def initialize(description: nil, adapter: nil, overlays: nil)
7150
+ def initialize(description: nil, adapter: nil, overlays: nil, secrets: nil)
6876
7151
  @description = description
6877
7152
  @adapter = adapter
6878
7153
  @overlays = overlays
7154
+ @secrets = secrets
6879
7155
  end
6880
7156
 
6881
7157
  def self.from_json(data)
@@ -6883,6 +7159,7 @@ module Cadenya
6883
7159
  description: data["description"],
6884
7160
  adapter: data["adapter"].nil? ? nil : Types.decode_ToolSetAdapter(data["adapter"]),
6885
7161
  overlays: data["overlays"].nil? ? nil : (data["overlays"]).map { |item| Types::ToolOverlay.from_json(item) },
7162
+ secrets: data["secrets"].nil? ? nil : (data["secrets"]).map { |item| Types::ToolSetSpec_Secret.from_json(item) },
6886
7163
  )
6887
7164
  end
6888
7165
 
@@ -6891,6 +7168,30 @@ module Cadenya
6891
7168
  description: Util.plain(@description),
6892
7169
  adapter: Util.plain(@adapter),
6893
7170
  overlays: Util.plain(@overlays),
7171
+ secrets: Util.plain(@secrets),
7172
+ }.reject { |_k, v| v.nil? }
7173
+ end
7174
+ end
7175
+
7176
+ class ToolSetSpec_Secret
7177
+ attr_reader :name, :value
7178
+
7179
+ def initialize(name: nil, value: nil)
7180
+ @name = name
7181
+ @value = value
7182
+ end
7183
+
7184
+ def self.from_json(data)
7185
+ new(
7186
+ name: data["name"],
7187
+ value: data["value"],
7188
+ )
7189
+ end
7190
+
7191
+ def to_h
7192
+ {
7193
+ name: Util.plain(@name),
7194
+ value: Util.plain(@value),
6894
7195
  }.reject { |_k, v| v.nil? }
6895
7196
  end
6896
7197
  end
@@ -7859,7 +8160,7 @@ module Cadenya
7859
8160
 
7860
8161
  WebhookDeliveryDataStatus = ["WEBHOOK_DELIVERY_STATUS_UNSPECIFIED", "WEBHOOK_DELIVERY_STATUS_PENDING", "WEBHOOK_DELIVERY_STATUS_COMPLETED", "WEBHOOK_DELIVERY_STATUS_FAILED", "WEBHOOK_DELIVERY_STATUS_DISABLED"].freeze
7861
8162
 
7862
- WebhookDeliveryDataEventType = ["OBJECTIVE_EVENT_TYPE_UNSPECIFIED", "OBJECTIVE_EVENT_TYPE_USER_MESSAGE", "OBJECTIVE_EVENT_TYPE_TOOL_APPROVAL_REQUESTED", "OBJECTIVE_EVENT_TYPE_TOOL_APPROVED", "OBJECTIVE_EVENT_TYPE_TOOL_DENIED", "OBJECTIVE_EVENT_TYPE_TOOL_CALLED", "OBJECTIVE_EVENT_TYPE_ERROR", "OBJECTIVE_EVENT_TYPE_ASSISTANT_MESSAGE", "OBJECTIVE_EVENT_TYPE_TOOL_RESULT", "OBJECTIVE_EVENT_TYPE_TOOL_ERROR", "OBJECTIVE_EVENT_TYPE_CONTEXT_WINDOW_COMPACTED", "OBJECTIVE_EVENT_TYPE_MEMORY_READ", "OBJECTIVE_EVENT_TYPE_CANCELLED", "OBJECTIVE_EVENT_TYPE_SUB_AGENT_SPAWNED", "OBJECTIVE_EVENT_TYPE_SUB_AGENT_UPDATED", "OBJECTIVE_EVENT_TYPE_FINALIZED", "OBJECTIVE_EVENT_TYPE_NOTICE", "OBJECTIVE_EVENT_TYPE_TIMED_OUT", "OBJECTIVE_EVENT_TYPE_REASONING", "OBJECTIVE_EVENT_TYPE_STATE_CHANGED", "OBJECTIVE_EVENT_TYPE_HEARTBEAT"].freeze
8163
+ WebhookDeliveryDataEventType = ["OBJECTIVE_EVENT_TYPE_UNSPECIFIED", "OBJECTIVE_EVENT_TYPE_USER_MESSAGE", "OBJECTIVE_EVENT_TYPE_TOOL_APPROVAL_REQUESTED", "OBJECTIVE_EVENT_TYPE_TOOL_APPROVED", "OBJECTIVE_EVENT_TYPE_TOOL_DENIED", "OBJECTIVE_EVENT_TYPE_TOOL_CALLED", "OBJECTIVE_EVENT_TYPE_ERROR", "OBJECTIVE_EVENT_TYPE_ASSISTANT_MESSAGE", "OBJECTIVE_EVENT_TYPE_TOOL_RESULT", "OBJECTIVE_EVENT_TYPE_TOOL_ERROR", "OBJECTIVE_EVENT_TYPE_CONTEXT_WINDOW_COMPACTED", "OBJECTIVE_EVENT_TYPE_MEMORY_READ", "OBJECTIVE_EVENT_TYPE_CANCELLED", "OBJECTIVE_EVENT_TYPE_SUB_AGENT_SPAWNED", "OBJECTIVE_EVENT_TYPE_SUB_AGENT_UPDATED", "OBJECTIVE_EVENT_TYPE_FINALIZED", "OBJECTIVE_EVENT_TYPE_NOTICE", "OBJECTIVE_EVENT_TYPE_TIMED_OUT", "OBJECTIVE_EVENT_TYPE_REASONING", "OBJECTIVE_EVENT_TYPE_STATE_CHANGED", "OBJECTIVE_EVENT_TYPE_HEARTBEAT", "OBJECTIVE_EVENT_TYPE_INTERRUPTED"].freeze
7863
8164
 
7864
8165
  class WebhookDeliveryData
7865
8166
  attr_reader :agent_id, :objective_id, :objective_event_id, :webhook_url, :webhook_id, :status, :attempt_count, :last_attempt_at, :http_status_code, :error_message, :latency_ms, :event_type, :response_headers, :response_content_length
@@ -7920,6 +8221,29 @@ module Cadenya
7920
8221
  end
7921
8222
  end
7922
8223
 
8224
+ class WhoamiResponse
8225
+ attr_reader :profile, :default_workspace
8226
+
8227
+ def initialize(profile: nil, default_workspace: nil)
8228
+ @profile = profile
8229
+ @default_workspace = default_workspace
8230
+ end
8231
+
8232
+ def self.from_json(data)
8233
+ new(
8234
+ profile: data["profile"].nil? ? nil : Types::Profile.from_json(data["profile"]),
8235
+ default_workspace: data["defaultWorkspace"].nil? ? nil : Types::AccountResourceMetadata.from_json(data["defaultWorkspace"]),
8236
+ )
8237
+ end
8238
+
8239
+ def to_h
8240
+ {
8241
+ profile: Util.plain(@profile),
8242
+ default_workspace: Util.plain(@default_workspace),
8243
+ }.reject { |_k, v| v.nil? }
8244
+ end
8245
+ end
8246
+
7923
8247
  WidgetState = ["STATE_UNSPECIFIED", "STATE_ACTIVE", "STATE_ARCHIVED"].freeze
7924
8248
 
7925
8249
  class Widget
@@ -9700,6 +10024,29 @@ module Cadenya
9700
10024
  end
9701
10025
  end
9702
10026
 
10027
+ class ObjectiveEventData_Interrupted
10028
+ attr_reader :type, :interrupted
10029
+
10030
+ def initialize(type: nil, interrupted: nil)
10031
+ @type = type
10032
+ @interrupted = interrupted
10033
+ end
10034
+
10035
+ def self.from_json(data)
10036
+ new(
10037
+ type: data["type"],
10038
+ interrupted: data["interrupted"].nil? ? nil : Types::ObjectiveInterrupted.from_json(data["interrupted"]),
10039
+ )
10040
+ end
10041
+
10042
+ def to_h
10043
+ {
10044
+ type: Util.plain(@type),
10045
+ interrupted: Util.plain(@interrupted),
10046
+ }.reject { |_k, v| v.nil? }
10047
+ end
10048
+ end
10049
+
9703
10050
  class CallableTool_Tool
9704
10051
  attr_reader :type, :tool
9705
10052
 
@@ -9850,6 +10197,98 @@ module Cadenya
9850
10197
  end
9851
10198
  end
9852
10199
 
10200
+ class ObjectiveQueuedActionData_UserMessage
10201
+ attr_reader :type, :user_message
10202
+
10203
+ def initialize(type: nil, user_message: nil)
10204
+ @type = type
10205
+ @user_message = user_message
10206
+ end
10207
+
10208
+ def self.from_json(data)
10209
+ new(
10210
+ type: data["type"],
10211
+ user_message: data["userMessage"].nil? ? nil : Types::QueuedUserMessage.from_json(data["userMessage"]),
10212
+ )
10213
+ end
10214
+
10215
+ def to_h
10216
+ {
10217
+ type: Util.plain(@type),
10218
+ user_message: Util.plain(@user_message),
10219
+ }.reject { |_k, v| v.nil? }
10220
+ end
10221
+ end
10222
+
10223
+ class ObjectiveQueuedActionData_Compaction
10224
+ attr_reader :type, :compaction
10225
+
10226
+ def initialize(type: nil, compaction: nil)
10227
+ @type = type
10228
+ @compaction = compaction
10229
+ end
10230
+
10231
+ def self.from_json(data)
10232
+ new(
10233
+ type: data["type"],
10234
+ compaction: data["compaction"].nil? ? nil : Types::QueuedCompaction.from_json(data["compaction"]),
10235
+ )
10236
+ end
10237
+
10238
+ def to_h
10239
+ {
10240
+ type: Util.plain(@type),
10241
+ compaction: Util.plain(@compaction),
10242
+ }.reject { |_k, v| v.nil? }
10243
+ end
10244
+ end
10245
+
10246
+ class ContinueObjectiveResponse_Event
10247
+ attr_reader :type, :event
10248
+
10249
+ def initialize(type: nil, event: nil)
10250
+ @type = type
10251
+ @event = event
10252
+ end
10253
+
10254
+ def self.from_json(data)
10255
+ new(
10256
+ type: data["type"],
10257
+ event: data["event"].nil? ? nil : Types::ObjectiveEvent.from_json(data["event"]),
10258
+ )
10259
+ end
10260
+
10261
+ def to_h
10262
+ {
10263
+ type: Util.plain(@type),
10264
+ event: Util.plain(@event),
10265
+ }.reject { |_k, v| v.nil? }
10266
+ end
10267
+ end
10268
+
10269
+ class ContinueObjectiveResponse_QueuedAction
10270
+ attr_reader :type, :queued_action
10271
+
10272
+ def initialize(type: nil, queued_action: nil)
10273
+ @type = type
10274
+ @queued_action = queued_action
10275
+ end
10276
+
10277
+ def self.from_json(data)
10278
+ new(
10279
+ type: data["type"],
10280
+ queued_action: data["queuedAction"].nil? ? nil : Types::ObjectiveQueuedAction.from_json(data["queuedAction"]),
10281
+ )
10282
+ end
10283
+
10284
+ def to_h
10285
+ {
10286
+ type: Util.plain(@type),
10287
+ queued_action: Util.plain(@queued_action),
10288
+ }.reject { |_k, v| v.nil? }
10289
+ end
10290
+ end
10291
+
9853
10292
  class SetToolCallContentRequest_ContentBlock_Text
9854
10293
  attr_reader :type, :text
9855
10294
 
@@ -10543,6 +10982,52 @@ module Cadenya
10543
10982
  end
10544
10983
  end
10545
10984
 
10985
+ class CreateAndStreamObjectiveResponse_Objective
10986
+ attr_reader :type, :objective
10987
+
10988
+ def initialize(type: nil, objective: nil)
10989
+ @type = type
10990
+ @objective = objective
10991
+ end
10992
+
10993
+ def self.from_json(data)
10994
+ new(
10995
+ type: data["type"],
10996
+ objective: data["objective"].nil? ? nil : Types::Objective.from_json(data["objective"]),
10997
+ )
10998
+ end
10999
+
11000
+ def to_h
11001
+ {
11002
+ type: Util.plain(@type),
11003
+ objective: Util.plain(@objective),
11004
+ }.reject { |_k, v| v.nil? }
11005
+ end
11006
+ end
11007
+
11008
+ class CreateAndStreamObjectiveResponse_Event
11009
+ attr_reader :type, :event
11010
+
11011
+ def initialize(type: nil, event: nil)
11012
+ @type = type
11013
+ @event = event
11014
+ end
11015
+
11016
+ def self.from_json(data)
11017
+ new(
11018
+ type: data["type"],
11019
+ event: data["event"].nil? ? nil : Types::ObjectiveEvent.from_json(data["event"]),
11020
+ )
11021
+ end
11022
+
11023
+ def to_h
11024
+ {
11025
+ type: Util.plain(@type),
11026
+ event: Util.plain(@event),
11027
+ }.reject { |_k, v| v.nil? }
11028
+ end
11029
+ end
11030
+
10546
11031
  WidgetSessionErrorReason = ["TOKEN_EXPIRED", "SESSION_REVOKED", "SESSION_EXPIRED", "SESSION_EXHAUSTED"].freeze
10547
11032
 
10548
11033
  class WidgetSessionErrorInfo
@@ -10582,17 +11067,19 @@ module Cadenya
10582
11067
 
10583
11068
  AgentServiceListAgentFeedbackSentiment = ["FEEDBACK_SENTIMENT_UNSPECIFIED", "FEEDBACK_SENTIMENT_POSITIVE", "FEEDBACK_SENTIMENT_NEGATIVE"].freeze
10584
11069
 
10585
- AgentServiceListAgentWebhookDeliveriesEventType = ["OBJECTIVE_EVENT_TYPE_UNSPECIFIED", "OBJECTIVE_EVENT_TYPE_USER_MESSAGE", "OBJECTIVE_EVENT_TYPE_TOOL_APPROVAL_REQUESTED", "OBJECTIVE_EVENT_TYPE_TOOL_APPROVED", "OBJECTIVE_EVENT_TYPE_TOOL_DENIED", "OBJECTIVE_EVENT_TYPE_TOOL_CALLED", "OBJECTIVE_EVENT_TYPE_ERROR", "OBJECTIVE_EVENT_TYPE_ASSISTANT_MESSAGE", "OBJECTIVE_EVENT_TYPE_TOOL_RESULT", "OBJECTIVE_EVENT_TYPE_TOOL_ERROR", "OBJECTIVE_EVENT_TYPE_CONTEXT_WINDOW_COMPACTED", "OBJECTIVE_EVENT_TYPE_MEMORY_READ", "OBJECTIVE_EVENT_TYPE_CANCELLED", "OBJECTIVE_EVENT_TYPE_SUB_AGENT_SPAWNED", "OBJECTIVE_EVENT_TYPE_SUB_AGENT_UPDATED", "OBJECTIVE_EVENT_TYPE_FINALIZED", "OBJECTIVE_EVENT_TYPE_NOTICE", "OBJECTIVE_EVENT_TYPE_TIMED_OUT", "OBJECTIVE_EVENT_TYPE_REASONING", "OBJECTIVE_EVENT_TYPE_STATE_CHANGED", "OBJECTIVE_EVENT_TYPE_HEARTBEAT"].freeze
11070
+ AgentServiceListAgentWebhookDeliveriesEventType = ["OBJECTIVE_EVENT_TYPE_UNSPECIFIED", "OBJECTIVE_EVENT_TYPE_USER_MESSAGE", "OBJECTIVE_EVENT_TYPE_TOOL_APPROVAL_REQUESTED", "OBJECTIVE_EVENT_TYPE_TOOL_APPROVED", "OBJECTIVE_EVENT_TYPE_TOOL_DENIED", "OBJECTIVE_EVENT_TYPE_TOOL_CALLED", "OBJECTIVE_EVENT_TYPE_ERROR", "OBJECTIVE_EVENT_TYPE_ASSISTANT_MESSAGE", "OBJECTIVE_EVENT_TYPE_TOOL_RESULT", "OBJECTIVE_EVENT_TYPE_TOOL_ERROR", "OBJECTIVE_EVENT_TYPE_CONTEXT_WINDOW_COMPACTED", "OBJECTIVE_EVENT_TYPE_MEMORY_READ", "OBJECTIVE_EVENT_TYPE_CANCELLED", "OBJECTIVE_EVENT_TYPE_SUB_AGENT_SPAWNED", "OBJECTIVE_EVENT_TYPE_SUB_AGENT_UPDATED", "OBJECTIVE_EVENT_TYPE_FINALIZED", "OBJECTIVE_EVENT_TYPE_NOTICE", "OBJECTIVE_EVENT_TYPE_TIMED_OUT", "OBJECTIVE_EVENT_TYPE_REASONING", "OBJECTIVE_EVENT_TYPE_STATE_CHANGED", "OBJECTIVE_EVENT_TYPE_HEARTBEAT", "OBJECTIVE_EVENT_TYPE_INTERRUPTED"].freeze
10586
11071
 
10587
11072
  MemoryServiceListMemoryLayersType = ["MEMORY_LAYER_TYPE_UNSPECIFIED", "MEMORY_LAYER_TYPE_EPISODIC", "MEMORY_LAYER_TYPE_SKILLS"].freeze
10588
11073
 
10589
11074
  ModelServiceListModelsState = ["STATE_UNSPECIFIED", "STATE_ENABLED", "STATE_DISABLED"].freeze
10590
11075
 
10591
- ObjectiveServiceListObjectivesState = ["OBJECTIVE_STATE_UNSPECIFIED", "OBJECTIVE_STATE_PENDING", "OBJECTIVE_STATE_RUNNING", "OBJECTIVE_STATE_WAITING", "OBJECTIVE_STATE_FAILED", "OBJECTIVE_STATE_CANCELLED", "OBJECTIVE_STATE_FINALIZED", "OBJECTIVE_STATE_TIMED_OUT"].freeze
11076
+ ObjectiveServiceListObjectivesState = ["OBJECTIVE_STATE_UNSPECIFIED", "OBJECTIVE_STATE_PENDING", "OBJECTIVE_STATE_RUNNING", "OBJECTIVE_STATE_WAITING", "OBJECTIVE_STATE_FAILED", "OBJECTIVE_STATE_CANCELLED", "OBJECTIVE_STATE_FINALIZED", "OBJECTIVE_STATE_TIMED_OUT", "OBJECTIVE_STATE_INTERRUPTING"].freeze
11077
+
11078
+ ObjectiveServiceListObjectiveQueuedActionsState = ["STATE_UNSPECIFIED", "STATE_QUEUED", "STATE_SENT", "STATE_REMOVED", "STATE_DISCARDED"].freeze
10592
11079
 
10593
11080
  ObjectiveServiceListObjectiveToolCallsStatus = ["TOOL_CALL_STATUS_UNSPECIFIED", "TOOL_CALL_STATUS_AUTO_APPROVED", "TOOL_CALL_STATUS_WAITING_FOR_APPROVAL", "TOOL_CALL_STATUS_APPROVED", "TOOL_CALL_STATUS_DENIED"].freeze
10594
11081
 
10595
- ObjectiveServiceListObjectiveToolCallsExecutionStatus = ["TOOL_CALL_EXECUTION_STATUS_UNSPECIFIED", "TOOL_CALL_EXECUTION_STATUS_PENDING", "TOOL_CALL_EXECUTION_STATUS_RUNNING", "TOOL_CALL_EXECUTION_STATUS_COMPLETED", "TOOL_CALL_EXECUTION_STATUS_ERRORED", "TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT"].freeze
11082
+ ObjectiveServiceListObjectiveToolCallsExecutionStatus = ["TOOL_CALL_EXECUTION_STATUS_UNSPECIFIED", "TOOL_CALL_EXECUTION_STATUS_PENDING", "TOOL_CALL_EXECUTION_STATUS_RUNNING", "TOOL_CALL_EXECUTION_STATUS_COMPLETED", "TOOL_CALL_EXECUTION_STATUS_ERRORED", "TOOL_CALL_EXECUTION_STATUS_WAITING_FOR_CONTENT", "TOOL_CALL_EXECUTION_STATUS_INTERRUPTED"].freeze
10596
11083
 
10597
11084
  ToolServiceListToolSetsState = ["STATE_UNSPECIFIED", "STATE_ACTIVE", "STATE_ARCHIVED"].freeze
10598
11085
 
@@ -10993,6 +11480,16 @@ module Cadenya
10993
11480
  encode_fields(ENCODE_CREATE_AGENT_VARIATION_REQUEST, data, drop: DROP_CREATE_AGENT_VARIATION_REQUEST)
10994
11481
  end
10995
11482
 
11483
+ ENCODE_CREATE_AND_STREAM_OBJECTIVE_REQUEST_METADATA = {
11484
+ "labels" => ["labels", nil],
11485
+ "external_id" => ["externalId", nil],
11486
+ "externalId" => ["externalId", nil],
11487
+ }.freeze
11488
+
11489
+ def self.encode_CreateAndStreamObjectiveRequest_Metadata(data)
11490
+ encode_fields(ENCODE_CREATE_AND_STREAM_OBJECTIVE_REQUEST_METADATA, data)
11491
+ end
11492
+
10996
11493
  ENCODE_CREATE_OBJECTIVE_REQUEST_SECRET = {
10997
11494
  "name" => ["name", nil],
10998
11495
  "value" => ["value", nil],
@@ -11141,6 +11638,8 @@ module Cadenya
11141
11638
  "inputPricePerMillionTokens" => ["inputPricePerMillionTokens", nil],
11142
11639
  "output_price_per_million_tokens" => ["outputPricePerMillionTokens", nil],
11143
11640
  "outputPricePerMillionTokens" => ["outputPricePerMillionTokens", nil],
11641
+ "cached_input_price_per_million_tokens" => ["cachedInputPricePerMillionTokens", nil],
11642
+ "cachedInputPricePerMillionTokens" => ["cachedInputPricePerMillionTokens", nil],
11144
11643
  }.freeze
11145
11644
 
11146
11645
  def self.encode_ModelPricingOverride(data)
@@ -11158,6 +11657,8 @@ module Cadenya
11158
11657
  "inputPricePerMillionTokens" => ["inputPricePerMillionTokens", nil],
11159
11658
  "output_price_per_million_tokens" => ["outputPricePerMillionTokens", nil],
11160
11659
  "outputPricePerMillionTokens" => ["outputPricePerMillionTokens", nil],
11660
+ "cached_input_price_per_million_tokens" => ["cachedInputPricePerMillionTokens", nil],
11661
+ "cachedInputPricePerMillionTokens" => ["cachedInputPricePerMillionTokens", nil],
11161
11662
  "capabilities" => ["capabilities", ->(_v) { _v.is_a?(Array) ? _v.map { |_i| (->(_v) { encode_ModelSpec_Capability(_v) }).call(_i) } : _v }],
11162
11663
  "provider_model_id" => ["providerModelId", nil],
11163
11664
  "providerModelId" => ["providerModelId", nil],
@@ -11665,12 +12166,22 @@ module Cadenya
11665
12166
  "description" => ["description", nil],
11666
12167
  "adapter" => ["adapter", ->(_v) { encode_ToolSetAdapter(_v) }],
11667
12168
  "overlays" => ["overlays", ->(_v) { _v.is_a?(Array) ? _v.map { |_i| (->(_v) { encode_ToolOverlay(_v) }).call(_i) } : _v }],
12169
+ "secrets" => ["secrets", ->(_v) { _v.is_a?(Array) ? _v.map { |_i| (->(_v) { encode_ToolSetSpec_Secret(_v) }).call(_i) } : _v }],
11668
12170
  }.freeze
11669
12171
 
11670
12172
  def self.encode_ToolSetSpec(data)
11671
12173
  encode_fields(ENCODE_TOOL_SET_SPEC, data)
11672
12174
  end
11673
12175
 
12176
+ ENCODE_TOOL_SET_SPEC_SECRET = {
12177
+ "name" => ["name", nil],
12178
+ "value" => ["value", nil],
12179
+ }.freeze
12180
+
12181
+ def self.encode_ToolSetSpec_Secret(data)
12182
+ encode_fields(ENCODE_TOOL_SET_SPEC_SECRET, data)
12183
+ end
12184
+
11674
12185
  ENCODE_TOOL_SPEC = {
11675
12186
  "description" => ["description", nil],
11676
12187
  "requires_approval" => ["requiresApproval", nil],
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cadenya
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cadenya
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-09-18 00:00:00.000000000 Z
11
+ date: 2026-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday