cadenya 0.9.0 → 0.11.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 (135) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +7 -7
  4. data/lib/cadenya/models/agent.rb +28 -1
  5. data/lib/cadenya/models/agent_archive_params.rb +26 -0
  6. data/lib/cadenya/models/agent_entry.rb +31 -1
  7. data/lib/cadenya/models/agent_list_params.rb +12 -12
  8. data/lib/cadenya/models/agent_publish_params.rb +26 -0
  9. data/lib/cadenya/models/agent_schedule_entry.rb +31 -1
  10. data/lib/cadenya/models/agent_spec.rb +1 -24
  11. data/lib/cadenya/models/agent_unarchive_params.rb +26 -0
  12. data/lib/cadenya/models/agent_unpublish_params.rb +26 -0
  13. data/lib/cadenya/models/agents/agent_schedule.rb +30 -1
  14. data/lib/cadenya/models/agents/agent_schedule_info.rb +1 -1
  15. data/lib/cadenya/models/agents/agent_schedule_spec.rb +18 -30
  16. data/lib/cadenya/models/agents/agent_variation_spec.rb +18 -5
  17. data/lib/cadenya/models/agents/schedule_archive_params.rb +34 -0
  18. data/lib/cadenya/models/agents/schedule_pause_params.rb +34 -0
  19. data/lib/cadenya/models/agents/schedule_resume_params.rb +34 -0
  20. data/lib/cadenya/models/bulk_workspace_apply_data.rb +6 -7
  21. data/lib/cadenya/models/model.rb +25 -1
  22. data/lib/cadenya/models/model_disable_params.rb +26 -0
  23. data/lib/cadenya/models/model_enable_params.rb +26 -0
  24. data/lib/cadenya/models/model_list_params.rb +11 -11
  25. data/lib/cadenya/models/model_spec.rb +1 -23
  26. data/lib/cadenya/models/objective.rb +11 -1
  27. data/lib/cadenya/models/objective_create_params.rb +19 -5
  28. data/lib/cadenya/models/resource_metadata.rb +9 -1
  29. data/lib/cadenya/models/tool_entry.rb +31 -1
  30. data/lib/cadenya/models/tool_set.rb +27 -1
  31. data/lib/cadenya/models/tool_set_archive_params.rb +26 -0
  32. data/lib/cadenya/models/tool_set_list_params.rb +26 -1
  33. data/lib/cadenya/models/tool_set_unarchive_params.rb +26 -0
  34. data/lib/cadenya/models/tool_sets/tool.rb +28 -1
  35. data/lib/cadenya/models/tool_sets/tool_list_params.rb +11 -12
  36. data/lib/cadenya/models/tool_sets/tool_omit_params.rb +34 -0
  37. data/lib/cadenya/models/tool_sets/tool_restore_params.rb +34 -0
  38. data/lib/cadenya/models/tool_sets/tool_spec.rb +3 -23
  39. data/lib/cadenya/models.rb +16 -2
  40. data/lib/cadenya/resources/account.rb +1 -1
  41. data/lib/cadenya/resources/agents/schedules.rb +112 -0
  42. data/lib/cadenya/resources/agents.rb +126 -2
  43. data/lib/cadenya/resources/api_keys.rb +2 -2
  44. data/lib/cadenya/resources/models.rb +39 -13
  45. data/lib/cadenya/resources/objectives.rb +4 -2
  46. data/lib/cadenya/resources/tool_sets/tools.rb +77 -3
  47. data/lib/cadenya/resources/tool_sets.rb +73 -2
  48. data/lib/cadenya/version.rb +1 -1
  49. data/lib/cadenya.rb +13 -1
  50. data/rbi/cadenya/models/agent.rbi +34 -0
  51. data/rbi/cadenya/models/agent_archive_params.rbi +43 -0
  52. data/rbi/cadenya/models/agent_entry.rbi +41 -0
  53. data/rbi/cadenya/models/agent_list_params.rbi +22 -31
  54. data/rbi/cadenya/models/agent_publish_params.rbi +43 -0
  55. data/rbi/cadenya/models/agent_schedule_entry.rbi +52 -3
  56. data/rbi/cadenya/models/agent_spec.rbi +0 -41
  57. data/rbi/cadenya/models/agent_unarchive_params.rbi +43 -0
  58. data/rbi/cadenya/models/agent_unpublish_params.rbi +43 -0
  59. data/rbi/cadenya/models/agents/agent_schedule.rbi +54 -0
  60. data/rbi/cadenya/models/agents/agent_schedule_info.rbi +2 -2
  61. data/rbi/cadenya/models/agents/agent_schedule_spec.rbi +28 -67
  62. data/rbi/cadenya/models/agents/agent_variation_spec.rbi +29 -8
  63. data/rbi/cadenya/models/agents/schedule_archive_params.rbi +53 -0
  64. data/rbi/cadenya/models/agents/schedule_pause_params.rbi +53 -0
  65. data/rbi/cadenya/models/agents/schedule_resume_params.rbi +53 -0
  66. data/rbi/cadenya/models/bulk_workspace_apply_data.rbi +12 -14
  67. data/rbi/cadenya/models/model.rbi +30 -0
  68. data/rbi/cadenya/models/model_disable_params.rbi +43 -0
  69. data/rbi/cadenya/models/model_enable_params.rbi +43 -0
  70. data/rbi/cadenya/models/model_list_params.rbi +20 -26
  71. data/rbi/cadenya/models/model_spec.rbi +3 -42
  72. data/rbi/cadenya/models/objective.rbi +14 -3
  73. data/rbi/cadenya/models/objective_create_params.rbi +25 -6
  74. data/rbi/cadenya/models/resource_metadata.rbi +14 -3
  75. data/rbi/cadenya/models/tool_entry.rbi +44 -3
  76. data/rbi/cadenya/models/tool_set.rbi +35 -0
  77. data/rbi/cadenya/models/tool_set_archive_params.rbi +43 -0
  78. data/rbi/cadenya/models/tool_set_list_params.rbi +44 -0
  79. data/rbi/cadenya/models/tool_set_unarchive_params.rbi +43 -0
  80. data/rbi/cadenya/models/tool_sets/tool.rbi +43 -0
  81. data/rbi/cadenya/models/tool_sets/tool_list_params.rbi +26 -27
  82. data/rbi/cadenya/models/tool_sets/tool_omit_params.rbi +50 -0
  83. data/rbi/cadenya/models/tool_sets/tool_restore_params.rbi +53 -0
  84. data/rbi/cadenya/models/tool_sets/tool_spec.rbi +3 -49
  85. data/rbi/cadenya/models.rbi +16 -2
  86. data/rbi/cadenya/resources/agents/schedules.rbi +70 -0
  87. data/rbi/cadenya/resources/agents.rbi +79 -3
  88. data/rbi/cadenya/resources/models.rbi +26 -10
  89. data/rbi/cadenya/resources/objectives.rbi +10 -3
  90. data/rbi/cadenya/resources/tool_sets/tools.rbi +46 -4
  91. data/rbi/cadenya/resources/tool_sets.rbi +44 -0
  92. data/sig/cadenya/models/agent.rbs +19 -0
  93. data/sig/cadenya/models/agent_archive_params.rbs +28 -0
  94. data/sig/cadenya/models/agent_entry.rbs +23 -0
  95. data/sig/cadenya/models/agent_list_params.rbs +15 -18
  96. data/sig/cadenya/models/agent_publish_params.rbs +28 -0
  97. data/sig/cadenya/models/agent_schedule_entry.rbs +26 -3
  98. data/sig/cadenya/models/agent_spec.rbs +0 -22
  99. data/sig/cadenya/models/agent_unarchive_params.rbs +28 -0
  100. data/sig/cadenya/models/agent_unpublish_params.rbs +28 -0
  101. data/sig/cadenya/models/agents/agent_schedule.rbs +19 -0
  102. data/sig/cadenya/models/agents/agent_schedule_spec.rbs +12 -29
  103. data/sig/cadenya/models/agents/agent_variation_spec.rbs +12 -5
  104. data/sig/cadenya/models/agents/schedule_archive_params.rbs +34 -0
  105. data/sig/cadenya/models/agents/schedule_pause_params.rbs +34 -0
  106. data/sig/cadenya/models/agents/schedule_resume_params.rbs +34 -0
  107. data/sig/cadenya/models/model.rbs +17 -0
  108. data/sig/cadenya/models/model_disable_params.rbs +28 -0
  109. data/sig/cadenya/models/model_enable_params.rbs +28 -0
  110. data/sig/cadenya/models/model_list_params.rbs +13 -16
  111. data/sig/cadenya/models/model_spec.rbs +3 -27
  112. data/sig/cadenya/models/objective.rbs +10 -3
  113. data/sig/cadenya/models/objective_create_params.rbs +7 -0
  114. data/sig/cadenya/models/resource_metadata.rbs +10 -3
  115. data/sig/cadenya/models/tool_entry.rbs +26 -3
  116. data/sig/cadenya/models/tool_set.rbs +17 -0
  117. data/sig/cadenya/models/tool_set_archive_params.rbs +28 -0
  118. data/sig/cadenya/models/tool_set_list_params.rbs +22 -1
  119. data/sig/cadenya/models/tool_set_unarchive_params.rbs +28 -0
  120. data/sig/cadenya/models/tool_sets/tool.rbs +22 -0
  121. data/sig/cadenya/models/tool_sets/tool_list_params.rbs +18 -18
  122. data/sig/cadenya/models/tool_sets/tool_omit_params.rbs +34 -0
  123. data/sig/cadenya/models/tool_sets/tool_restore_params.rbs +34 -0
  124. data/sig/cadenya/models/tool_sets/tool_spec.rbs +2 -26
  125. data/sig/cadenya/models.rbs +16 -2
  126. data/sig/cadenya/resources/agents/schedules.rbs +21 -0
  127. data/sig/cadenya/resources/agents.rbs +25 -1
  128. data/sig/cadenya/resources/models.rbs +8 -3
  129. data/sig/cadenya/resources/objectives.rbs +1 -0
  130. data/sig/cadenya/resources/tool_sets/tools.rbs +15 -1
  131. data/sig/cadenya/resources/tool_sets.rbs +13 -0
  132. metadata +41 -5
  133. data/lib/cadenya/models/model_set_status_params.rb +0 -48
  134. data/rbi/cadenya/models/model_set_status_params.rbi +0 -95
  135. data/sig/cadenya/models/model_set_status_params.rbs +0 -55
@@ -153,6 +153,76 @@ module Cadenya
153
153
  )
154
154
  end
155
155
 
156
+ # Transitions a schedule to STATE_ARCHIVED and removes its underlying timer.
157
+ # Archiving is terminal: archived schedules never fire and cannot be reactivated;
158
+ # create a new schedule instead.
159
+ sig do
160
+ params(
161
+ id: String,
162
+ workspace_id: String,
163
+ agent_id: String,
164
+ request_options: Cadenya::RequestOptions::OrHash
165
+ ).returns(Cadenya::Agents::AgentSchedule)
166
+ end
167
+ def archive(
168
+ # Schedule ID. Accepts the canonical `as_…` form or the `external_id:<value>`
169
+ # form.
170
+ id,
171
+ # Workspace ID.
172
+ workspace_id:,
173
+ # Agent ID. Accepts the canonical `agent_…` form or the `external_id:<value>`
174
+ # form.
175
+ agent_id:,
176
+ request_options: {}
177
+ )
178
+ end
179
+
180
+ # Transitions a schedule to STATE_PAUSED. Paused schedules retain history but do
181
+ # not fire.
182
+ sig do
183
+ params(
184
+ id: String,
185
+ workspace_id: String,
186
+ agent_id: String,
187
+ request_options: Cadenya::RequestOptions::OrHash
188
+ ).returns(Cadenya::Agents::AgentSchedule)
189
+ end
190
+ def pause(
191
+ # Schedule ID. Accepts the canonical `as_…` form or the `external_id:<value>`
192
+ # form.
193
+ id,
194
+ # Workspace ID.
195
+ workspace_id:,
196
+ # Agent ID. Accepts the canonical `agent_…` form or the `external_id:<value>`
197
+ # form.
198
+ agent_id:,
199
+ request_options: {}
200
+ )
201
+ end
202
+
203
+ # Transitions a paused schedule back to STATE_ACTIVE so it fires on its cadence
204
+ # again. Archived schedules cannot be resumed.
205
+ sig do
206
+ params(
207
+ id: String,
208
+ workspace_id: String,
209
+ agent_id: String,
210
+ request_options: Cadenya::RequestOptions::OrHash
211
+ ).returns(Cadenya::Agents::AgentSchedule)
212
+ end
213
+ def resume(
214
+ # Schedule ID. Accepts the canonical `as_…` form or the `external_id:<value>`
215
+ # form.
216
+ id,
217
+ # Workspace ID.
218
+ workspace_id:,
219
+ # Agent ID. Accepts the canonical `agent_…` form or the `external_id:<value>`
220
+ # form.
221
+ agent_id:,
222
+ request_options: {}
223
+ )
224
+ end
225
+
156
226
  # @api private
157
227
  sig { params(client: Cadenya::Client).returns(T.attached_class) }
158
228
  def self.new(client:)
@@ -107,7 +107,7 @@ module Cadenya
107
107
  prefix: String,
108
108
  query: String,
109
109
  sort_order: String,
110
- status: Cadenya::AgentListParams::Status::OrSymbol,
110
+ state: Cadenya::AgentListParams::State::OrSymbol,
111
111
  variation_selection_mode:
112
112
  Cadenya::AgentListParams::VariationSelectionMode::OrSymbol,
113
113
  request_options: Cadenya::RequestOptions::OrHash
@@ -131,8 +131,8 @@ module Cadenya
131
131
  query: nil,
132
132
  # Sort order for results (asc or desc by creation time)
133
133
  sort_order: nil,
134
- # Filter by agent publication status
135
- status: nil,
134
+ # Filter by agent lifecycle state
135
+ state: nil,
136
136
  # Filter by variation selection mode
137
137
  variation_selection_mode: nil,
138
138
  request_options: {}
@@ -157,6 +157,82 @@ module Cadenya
157
157
  )
158
158
  end
159
159
 
160
+ # Transitions an agent to STATE_ARCHIVED. Archived agents are hidden from list
161
+ # results and cannot be used for objectives; active schedules are paused.
162
+ sig do
163
+ params(
164
+ id: String,
165
+ workspace_id: String,
166
+ request_options: Cadenya::RequestOptions::OrHash
167
+ ).returns(Cadenya::Agent)
168
+ end
169
+ def archive(
170
+ # Agent ID. Accepts the canonical `agent_…` form or the `external_id:<value>`
171
+ # form.
172
+ id,
173
+ # Workspace ID.
174
+ workspace_id:,
175
+ request_options: {}
176
+ )
177
+ end
178
+
179
+ # Transitions an agent to STATE_PUBLISHED, making it available for objectives. The
180
+ # agent must have at least one variation.
181
+ sig do
182
+ params(
183
+ id: String,
184
+ workspace_id: String,
185
+ request_options: Cadenya::RequestOptions::OrHash
186
+ ).returns(Cadenya::Agent)
187
+ end
188
+ def publish(
189
+ # Agent ID. Accepts the canonical `agent_…` form or the `external_id:<value>`
190
+ # form.
191
+ id,
192
+ # Workspace ID.
193
+ workspace_id:,
194
+ request_options: {}
195
+ )
196
+ end
197
+
198
+ # Transitions an archived agent back to STATE_DRAFT. Publish the agent again to
199
+ # make it available for objectives.
200
+ sig do
201
+ params(
202
+ id: String,
203
+ workspace_id: String,
204
+ request_options: Cadenya::RequestOptions::OrHash
205
+ ).returns(Cadenya::Agent)
206
+ end
207
+ def unarchive(
208
+ # Agent ID. Accepts the canonical `agent_…` form or the `external_id:<value>`
209
+ # form.
210
+ id,
211
+ # Workspace ID.
212
+ workspace_id:,
213
+ request_options: {}
214
+ )
215
+ end
216
+
217
+ # Transitions a published agent back to STATE_DRAFT. Active schedules for the
218
+ # agent are paused until it is published again.
219
+ sig do
220
+ params(
221
+ id: String,
222
+ workspace_id: String,
223
+ request_options: Cadenya::RequestOptions::OrHash
224
+ ).returns(Cadenya::Agent)
225
+ end
226
+ def unpublish(
227
+ # Agent ID. Accepts the canonical `agent_…` form or the `external_id:<value>`
228
+ # form.
229
+ id,
230
+ # Workspace ID.
231
+ workspace_id:,
232
+ request_options: {}
233
+ )
234
+ end
235
+
160
236
  # @api private
161
237
  sig { params(client: Cadenya::Client).returns(T.attached_class) }
162
238
  def self.new(client:)
@@ -35,7 +35,7 @@ module Cadenya
35
35
  prefix: String,
36
36
  query: String,
37
37
  sort_order: String,
38
- status: Cadenya::ModelListParams::Status::OrSymbol,
38
+ state: Cadenya::ModelListParams::State::OrSymbol,
39
39
  request_options: Cadenya::RequestOptions::OrHash
40
40
  ).returns(Cadenya::Internal::CursorPagination[Cadenya::Model])
41
41
  end
@@ -60,28 +60,44 @@ module Cadenya
60
60
  query: nil,
61
61
  # Sort order for results (asc or desc by creation time)
62
62
  sort_order: nil,
63
- # Filter by model status
64
- status: nil,
63
+ # Filter by model state
64
+ state: nil,
65
65
  request_options: {}
66
66
  )
67
67
  end
68
68
 
69
- # Enables or disables a model in the workspace
69
+ # Transitions a model to STATE_DISABLED. Fails while agent variations are still
70
+ # provisioned on the model; use :swapModelOnVariations to move them first.
70
71
  sig do
71
72
  params(
72
73
  id: String,
73
74
  workspace_id: String,
74
- status: Cadenya::ModelSetStatusParams::Status::OrSymbol,
75
75
  request_options: Cadenya::RequestOptions::OrHash
76
76
  ).returns(Cadenya::Model)
77
77
  end
78
- def set_status(
79
- # Path param: Model ID
78
+ def disable(
79
+ # Model ID
80
80
  id,
81
- # Path param: Workspace ID.
81
+ # Workspace ID.
82
+ workspace_id:,
83
+ request_options: {}
84
+ )
85
+ end
86
+
87
+ # Transitions a model to STATE_ENABLED, making it available for agent variations
88
+ # in the workspace
89
+ sig do
90
+ params(
91
+ id: String,
92
+ workspace_id: String,
93
+ request_options: Cadenya::RequestOptions::OrHash
94
+ ).returns(Cadenya::Model)
95
+ end
96
+ def enable(
97
+ # Model ID
98
+ id,
99
+ # Workspace ID.
82
100
  workspace_id:,
83
- # Body param: The new status for the model
84
- status: nil,
85
101
  request_options: {}
86
102
  )
87
103
  end
@@ -25,6 +25,7 @@ module Cadenya
25
25
  memory_stack: T::Array[Cadenya::MemoryReference::OrHash],
26
26
  metadata: Cadenya::CreateOperationMetadata::OrHash,
27
27
  secrets: T::Array[Cadenya::ObjectiveCreateParams::Secret::OrHash],
28
+ user_data: T::Hash[Symbol, T.anything],
28
29
  variation_id: String,
29
30
  request_options: Cadenya::RequestOptions::OrHash
30
31
  ).returns(Cadenya::Objective)
@@ -35,9 +36,11 @@ module Cadenya
35
36
  # Arbitrary data for the objective. May be used in liquid templates for prompts
36
37
  # configured on the agent variation
37
38
  data:,
38
- # Optional override for initial message sent to the agent. This becomes the first
39
- # user message in the LLM chat history. The agent variation is used to set this if
40
- # not present.
39
+ # Optional override for the initial message sent to the agent. This becomes the
40
+ # first user message in the LLM chat history. When not set, the selected
41
+ # variation's user_message_template is rendered with user_data instead. If neither
42
+ # this field nor a user_message_template is present, the request is rejected with
43
+ # InvalidArgument.
41
44
  initial_message: nil,
42
45
  # Memory layers/entries to push onto this objective's memory stack on top of the
43
46
  # baseline stack inherited from the selected variation.
@@ -62,6 +65,10 @@ module Cadenya
62
65
  # Secrets that can be used in the headers for tool calls using the secret
63
66
  # interpolation format.
64
67
  secrets: nil,
68
+ # Arbitrary data rendered into the selected variation's user_message_template
69
+ # (liquid) to produce the initial user message. Separate from `data`, which
70
+ # renders the system prompt template.
71
+ user_data: nil,
65
72
  # Optional explicit variation selection. Overrides the agent's
66
73
  # variation_selection_mode.
67
74
  variation_id: nil,
@@ -104,8 +104,8 @@ module Cadenya
104
104
  query: String,
105
105
  requires_approval: T::Boolean,
106
106
  sort_order: String,
107
- statuses:
108
- T::Array[Cadenya::ToolSets::ToolListParams::Status::OrSymbol],
107
+ states:
108
+ T::Array[Cadenya::ToolSets::ToolListParams::State::OrSymbol],
109
109
  request_options: Cadenya::RequestOptions::OrHash
110
110
  ).returns(
111
111
  Cadenya::Internal::CursorPagination[Cadenya::ToolSets::Tool]
@@ -137,8 +137,8 @@ module Cadenya
137
137
  requires_approval: nil,
138
138
  # Query param: Sort order for results (asc or desc by creation time)
139
139
  sort_order: nil,
140
- # Query param: Filter by tool status. Multiple values are OR'd together.
141
- statuses: nil,
140
+ # Query param: Filter by tool state. Multiple values are OR'd together.
141
+ states: nil,
142
142
  request_options: {}
143
143
  )
144
144
  end
@@ -163,6 +163,48 @@ module Cadenya
163
163
  )
164
164
  end
165
165
 
166
+ # Transitions a tool to STATE_OMITTED, excluding it from agent use. Fails if the
167
+ # tool is currently assigned to agent variations.
168
+ sig do
169
+ params(
170
+ id: String,
171
+ workspace_id: String,
172
+ tool_set_id: String,
173
+ request_options: Cadenya::RequestOptions::OrHash
174
+ ).returns(Cadenya::ToolSets::Tool)
175
+ end
176
+ def omit(
177
+ # Tool ID. Accepts the canonical tool\_… form or the external_id:<value> form.
178
+ id,
179
+ # Workspace ID.
180
+ workspace_id:,
181
+ # Tool set ID. Accepts the canonical ts\_… form or the external_id:<value> form.
182
+ tool_set_id:,
183
+ request_options: {}
184
+ )
185
+ end
186
+
187
+ # Transitions an omitted tool back to STATE_AVAILABLE. For managed tool sets, the
188
+ # next sync may omit the tool again if its filters still exclude it.
189
+ sig do
190
+ params(
191
+ id: String,
192
+ workspace_id: String,
193
+ tool_set_id: String,
194
+ request_options: Cadenya::RequestOptions::OrHash
195
+ ).returns(Cadenya::ToolSets::Tool)
196
+ end
197
+ def restore(
198
+ # Tool ID. Accepts the canonical tool\_… form or the external_id:<value> form.
199
+ id,
200
+ # Workspace ID.
201
+ workspace_id:,
202
+ # Tool set ID. Accepts the canonical ts\_… form or the external_id:<value> form.
203
+ tool_set_id:,
204
+ request_options: {}
205
+ )
206
+ end
207
+
166
208
  # @api private
167
209
  sig { params(client: Cadenya::Client).returns(T.attached_class) }
168
210
  def self.new(client:)
@@ -95,6 +95,7 @@ module Cadenya
95
95
  prefix: String,
96
96
  query: String,
97
97
  sort_order: String,
98
+ state: Cadenya::ToolSetListParams::State::OrSymbol,
98
99
  request_options: Cadenya::RequestOptions::OrHash
99
100
  ).returns(Cadenya::Internal::CursorPagination[Cadenya::ToolSet])
100
101
  end
@@ -115,6 +116,9 @@ module Cadenya
115
116
  query: nil,
116
117
  # Sort order for results (asc or desc by creation time)
117
118
  sort_order: nil,
119
+ # Filter by tool set lifecycle state. Defaults to STATE_ACTIVE when unspecified;
120
+ # pass STATE_ARCHIVED to list archived tool sets.
121
+ state: nil,
118
122
  request_options: {}
119
123
  )
120
124
  end
@@ -136,6 +140,27 @@ module Cadenya
136
140
  )
137
141
  end
138
142
 
143
+ # Transitions a tool set to STATE_ARCHIVED. Syncing stops, the tool set is hidden
144
+ # from list results, its tools are no longer offered to objectives, and new
145
+ # variation assignments are rejected. Existing assignments are retained, and
146
+ # history is preserved — unlike delete, archiving works while the tool set is
147
+ # still assigned to agent variations.
148
+ sig do
149
+ params(
150
+ id: String,
151
+ workspace_id: String,
152
+ request_options: Cadenya::RequestOptions::OrHash
153
+ ).returns(Cadenya::ToolSet)
154
+ end
155
+ def archive(
156
+ # Tool set ID. Accepts the canonical ts\_… form or the external_id:<value> form.
157
+ id,
158
+ # Workspace ID.
159
+ workspace_id:,
160
+ request_options: {}
161
+ )
162
+ end
163
+
139
164
  # Retrieves the current OpenAPI specification JSON that has been consumed by the
140
165
  # tool set. Only applicable to tool sets using the OpenAPI adapter.
141
166
  sig do
@@ -184,6 +209,25 @@ module Cadenya
184
209
  )
185
210
  end
186
211
 
212
+ # Transitions an archived tool set back to STATE_ACTIVE. Managed tool sets resume
213
+ # syncing on their next cycle and their tools become available to objectives
214
+ # again.
215
+ sig do
216
+ params(
217
+ id: String,
218
+ workspace_id: String,
219
+ request_options: Cadenya::RequestOptions::OrHash
220
+ ).returns(Cadenya::ToolSet)
221
+ end
222
+ def unarchive(
223
+ # Tool set ID. Accepts the canonical ts\_… form or the external_id:<value> form.
224
+ id,
225
+ # Workspace ID.
226
+ workspace_id:,
227
+ request_options: {}
228
+ )
229
+ end
230
+
187
231
  # @api private
188
232
  sig { params(client: Cadenya::Client).returns(T.attached_class) }
189
233
  def self.new(client:)
@@ -4,6 +4,7 @@ module Cadenya
4
4
  {
5
5
  metadata: Cadenya::ResourceMetadata,
6
6
  spec: Cadenya::AgentSpec,
7
+ state: Cadenya::Models::Agent::state,
7
8
  info: Cadenya::AgentInfo
8
9
  }
9
10
 
@@ -12,6 +13,8 @@ module Cadenya
12
13
 
13
14
  attr_accessor spec: Cadenya::AgentSpec
14
15
 
16
+ attr_accessor state: Cadenya::Models::Agent::state
17
+
15
18
  attr_reader info: Cadenya::AgentInfo?
16
19
 
17
20
  def info=: (Cadenya::AgentInfo) -> Cadenya::AgentInfo
@@ -19,14 +22,30 @@ module Cadenya
19
22
  def initialize: (
20
23
  metadata: Cadenya::ResourceMetadata,
21
24
  spec: Cadenya::AgentSpec,
25
+ state: Cadenya::Models::Agent::state,
22
26
  ?info: Cadenya::AgentInfo
23
27
  ) -> void
24
28
 
25
29
  def to_hash: -> {
26
30
  metadata: Cadenya::ResourceMetadata,
27
31
  spec: Cadenya::AgentSpec,
32
+ state: Cadenya::Models::Agent::state,
28
33
  info: Cadenya::AgentInfo
29
34
  }
35
+
36
+ type state =
37
+ :STATE_UNSPECIFIED | :STATE_DRAFT | :STATE_PUBLISHED | :STATE_ARCHIVED
38
+
39
+ module State
40
+ extend Cadenya::Internal::Type::Enum
41
+
42
+ STATE_UNSPECIFIED: :STATE_UNSPECIFIED
43
+ STATE_DRAFT: :STATE_DRAFT
44
+ STATE_PUBLISHED: :STATE_PUBLISHED
45
+ STATE_ARCHIVED: :STATE_ARCHIVED
46
+
47
+ def self?.values: -> ::Array[Cadenya::Models::Agent::state]
48
+ end
30
49
  end
31
50
  end
32
51
  end
@@ -0,0 +1,28 @@
1
+ module Cadenya
2
+ module Models
3
+ type agent_archive_params =
4
+ { workspace_id: String, id: String }
5
+ & Cadenya::Internal::Type::request_parameters
6
+
7
+ class AgentArchiveParams < Cadenya::Internal::Type::BaseModel
8
+ extend Cadenya::Internal::Type::RequestParameters::Converter
9
+ include Cadenya::Internal::Type::RequestParameters
10
+
11
+ attr_accessor workspace_id: String
12
+
13
+ attr_accessor id: String
14
+
15
+ def initialize: (
16
+ workspace_id: String,
17
+ id: String,
18
+ ?request_options: Cadenya::request_opts
19
+ ) -> void
20
+
21
+ def to_hash: -> {
22
+ workspace_id: String,
23
+ id: String,
24
+ request_options: Cadenya::RequestOptions
25
+ }
26
+ end
27
+ end
28
+ end
@@ -6,6 +6,7 @@ module Cadenya
6
6
  spec: Cadenya::AgentSpec,
7
7
  labels: ::Hash[Symbol, String],
8
8
  schedules: ::Hash[Symbol, Cadenya::AgentScheduleEntry],
9
+ state: Cadenya::Models::AgentEntry::state,
9
10
  variations: ::Hash[Symbol, Cadenya::AgentVariationEntry]
10
11
  }
11
12
 
@@ -24,6 +25,12 @@ module Cadenya
24
25
  ::Hash[Symbol, Cadenya::AgentScheduleEntry]
25
26
  ) -> ::Hash[Symbol, Cadenya::AgentScheduleEntry]
26
27
 
28
+ attr_reader state: Cadenya::Models::AgentEntry::state?
29
+
30
+ def state=: (
31
+ Cadenya::Models::AgentEntry::state
32
+ ) -> Cadenya::Models::AgentEntry::state
33
+
27
34
  attr_reader variations: ::Hash[Symbol, Cadenya::AgentVariationEntry]?
28
35
 
29
36
  def variations=: (
@@ -35,6 +42,7 @@ module Cadenya
35
42
  spec: Cadenya::AgentSpec,
36
43
  ?labels: ::Hash[Symbol, String],
37
44
  ?schedules: ::Hash[Symbol, Cadenya::AgentScheduleEntry],
45
+ ?state: Cadenya::Models::AgentEntry::state,
38
46
  ?variations: ::Hash[Symbol, Cadenya::AgentVariationEntry]
39
47
  ) -> void
40
48
 
@@ -43,8 +51,23 @@ module Cadenya
43
51
  spec: Cadenya::AgentSpec,
44
52
  labels: ::Hash[Symbol, String],
45
53
  schedules: ::Hash[Symbol, Cadenya::AgentScheduleEntry],
54
+ state: Cadenya::Models::AgentEntry::state,
46
55
  variations: ::Hash[Symbol, Cadenya::AgentVariationEntry]
47
56
  }
57
+
58
+ type state =
59
+ :STATE_UNSPECIFIED | :STATE_DRAFT | :STATE_PUBLISHED | :STATE_ARCHIVED
60
+
61
+ module State
62
+ extend Cadenya::Internal::Type::Enum
63
+
64
+ STATE_UNSPECIFIED: :STATE_UNSPECIFIED
65
+ STATE_DRAFT: :STATE_DRAFT
66
+ STATE_PUBLISHED: :STATE_PUBLISHED
67
+ STATE_ARCHIVED: :STATE_ARCHIVED
68
+
69
+ def self?.values: -> ::Array[Cadenya::Models::AgentEntry::state]
70
+ end
48
71
  end
49
72
  end
50
73
  end
@@ -10,7 +10,7 @@ module Cadenya
10
10
  prefix: String,
11
11
  query: String,
12
12
  sort_order: String,
13
- status: Cadenya::Models::AgentListParams::status,
13
+ state: Cadenya::Models::AgentListParams::state,
14
14
  variation_selection_mode: Cadenya::Models::AgentListParams::variation_selection_mode
15
15
  }
16
16
  & Cadenya::Internal::Type::request_parameters
@@ -49,11 +49,11 @@ module Cadenya
49
49
 
50
50
  def sort_order=: (String) -> String
51
51
 
52
- attr_reader status: Cadenya::Models::AgentListParams::status?
52
+ attr_reader state: Cadenya::Models::AgentListParams::state?
53
53
 
54
- def status=: (
55
- Cadenya::Models::AgentListParams::status
56
- ) -> Cadenya::Models::AgentListParams::status
54
+ def state=: (
55
+ Cadenya::Models::AgentListParams::state
56
+ ) -> Cadenya::Models::AgentListParams::state
57
57
 
58
58
  attr_reader variation_selection_mode: Cadenya::Models::AgentListParams::variation_selection_mode?
59
59
 
@@ -70,7 +70,7 @@ module Cadenya
70
70
  ?prefix: String,
71
71
  ?query: String,
72
72
  ?sort_order: String,
73
- ?status: Cadenya::Models::AgentListParams::status,
73
+ ?state: Cadenya::Models::AgentListParams::state,
74
74
  ?variation_selection_mode: Cadenya::Models::AgentListParams::variation_selection_mode,
75
75
  ?request_options: Cadenya::request_opts
76
76
  ) -> void
@@ -84,26 +84,23 @@ module Cadenya
84
84
  prefix: String,
85
85
  query: String,
86
86
  sort_order: String,
87
- status: Cadenya::Models::AgentListParams::status,
87
+ state: Cadenya::Models::AgentListParams::state,
88
88
  variation_selection_mode: Cadenya::Models::AgentListParams::variation_selection_mode,
89
89
  request_options: Cadenya::RequestOptions
90
90
  }
91
91
 
92
- type status =
93
- :AGENT_STATUS_UNSPECIFIED
94
- | :AGENT_STATUS_DRAFT
95
- | :AGENT_STATUS_PUBLISHED
96
- | :AGENT_STATUS_ARCHIVED
92
+ type state =
93
+ :STATE_UNSPECIFIED | :STATE_DRAFT | :STATE_PUBLISHED | :STATE_ARCHIVED
97
94
 
98
- module Status
95
+ module State
99
96
  extend Cadenya::Internal::Type::Enum
100
97
 
101
- AGENT_STATUS_UNSPECIFIED: :AGENT_STATUS_UNSPECIFIED
102
- AGENT_STATUS_DRAFT: :AGENT_STATUS_DRAFT
103
- AGENT_STATUS_PUBLISHED: :AGENT_STATUS_PUBLISHED
104
- AGENT_STATUS_ARCHIVED: :AGENT_STATUS_ARCHIVED
98
+ STATE_UNSPECIFIED: :STATE_UNSPECIFIED
99
+ STATE_DRAFT: :STATE_DRAFT
100
+ STATE_PUBLISHED: :STATE_PUBLISHED
101
+ STATE_ARCHIVED: :STATE_ARCHIVED
105
102
 
106
- def self?.values: -> ::Array[Cadenya::Models::AgentListParams::status]
103
+ def self?.values: -> ::Array[Cadenya::Models::AgentListParams::state]
107
104
  end
108
105
 
109
106
  type variation_selection_mode =
@@ -0,0 +1,28 @@
1
+ module Cadenya
2
+ module Models
3
+ type agent_publish_params =
4
+ { workspace_id: String, id: String }
5
+ & Cadenya::Internal::Type::request_parameters
6
+
7
+ class AgentPublishParams < Cadenya::Internal::Type::BaseModel
8
+ extend Cadenya::Internal::Type::RequestParameters::Converter
9
+ include Cadenya::Internal::Type::RequestParameters
10
+
11
+ attr_accessor workspace_id: String
12
+
13
+ attr_accessor id: String
14
+
15
+ def initialize: (
16
+ workspace_id: String,
17
+ id: String,
18
+ ?request_options: Cadenya::request_opts
19
+ ) -> void
20
+
21
+ def to_hash: -> {
22
+ workspace_id: String,
23
+ id: String,
24
+ request_options: Cadenya::RequestOptions
25
+ }
26
+ end
27
+ end
28
+ end