cadenya 0.26.0 → 0.28.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 (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/cadenya/models/account_info.rb +13 -1
  5. data/lib/cadenya/models/account_rotate_challenge_token_params.rb +14 -0
  6. data/lib/cadenya/models/agent_spec.rb +16 -15
  7. data/lib/cadenya/models/agents/agent_schedule_spec.rb +21 -20
  8. data/lib/cadenya/models/agents/agent_variation_spec.rb +16 -14
  9. data/lib/cadenya/models/agents/webhook_delivery_data.rb +1 -0
  10. data/lib/cadenya/models/agents/webhook_delivery_list_params.rb +1 -0
  11. data/lib/cadenya/models/objective.rb +18 -16
  12. data/lib/cadenya/models/objective_continue_params.rb +1 -26
  13. data/lib/cadenya/models/objective_create_params.rb +28 -25
  14. data/lib/cadenya/models/objective_event_data.rb +63 -1
  15. data/lib/cadenya/models/rotate_challenge_token_response.rb +18 -0
  16. data/lib/cadenya/models/tool_set_adapter_mcp.rb +38 -1
  17. data/lib/cadenya/models/tool_sets/tool_info.rb +14 -1
  18. data/lib/cadenya/models.rb +4 -0
  19. data/lib/cadenya/resources/account.rb +19 -0
  20. data/lib/cadenya/resources/objectives.rb +6 -8
  21. data/lib/cadenya/version.rb +1 -1
  22. data/lib/cadenya.rb +2 -0
  23. data/rbi/cadenya/models/account_info.rbi +19 -0
  24. data/rbi/cadenya/models/account_rotate_challenge_token_params.rbi +30 -0
  25. data/rbi/cadenya/models/agent_spec.rbi +23 -19
  26. data/rbi/cadenya/models/agents/agent_schedule_spec.rbi +38 -36
  27. data/rbi/cadenya/models/agents/agent_variation_spec.rbi +25 -21
  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 +24 -24
  31. data/rbi/cadenya/models/objective_continue_params.rbi +0 -49
  32. data/rbi/cadenya/models/objective_create_params.rbi +39 -37
  33. data/rbi/cadenya/models/objective_event_data.rbi +128 -0
  34. data/rbi/cadenya/models/rotate_challenge_token_response.rbi +30 -0
  35. data/rbi/cadenya/models/tool_set_adapter_mcp.rbi +69 -0
  36. data/rbi/cadenya/models/tool_sets/tool_info.rbi +17 -0
  37. data/rbi/cadenya/models.rbi +5 -0
  38. data/rbi/cadenya/resources/account.rbi +10 -0
  39. data/rbi/cadenya/resources/objectives.rbi +16 -20
  40. data/sig/cadenya/models/account_info.rbs +11 -1
  41. data/sig/cadenya/models/account_rotate_challenge_token_params.rbs +15 -0
  42. data/sig/cadenya/models/agent_spec.rbs +9 -7
  43. data/sig/cadenya/models/agents/agent_schedule_spec.rbs +15 -15
  44. data/sig/cadenya/models/agents/agent_variation_spec.rbs +7 -7
  45. data/sig/cadenya/models/agents/webhook_delivery_data.rbs +2 -0
  46. data/sig/cadenya/models/agents/webhook_delivery_list_params.rbs +2 -0
  47. data/sig/cadenya/models/objective.rbs +14 -14
  48. data/sig/cadenya/models/objective_continue_params.rbs +1 -26
  49. data/sig/cadenya/models/objective_create_params.rbs +16 -16
  50. data/sig/cadenya/models/objective_event_data.rbs +56 -0
  51. data/sig/cadenya/models/rotate_challenge_token_response.rbs +15 -0
  52. data/sig/cadenya/models/tool_set_adapter_mcp.rbs +32 -0
  53. data/sig/cadenya/models/tool_sets/tool_info.rbs +11 -1
  54. data/sig/cadenya/models.rbs +4 -0
  55. data/sig/cadenya/resources/account.rbs +4 -0
  56. data/sig/cadenya/resources/objectives.rbs +3 -4
  57. metadata +8 -2
@@ -6,10 +6,10 @@ module Cadenya
6
6
  OrHash =
7
7
  T.type_alias { T.any(Cadenya::Objective, Cadenya::Internal::AnyHash) }
8
8
 
9
- # The initial message sent to the agent. This becomes the first user message in
10
- # the LLM chat history.
9
+ # The first user message in the LLM chat history, either provided explicitly at
10
+ # creation or rendered from the variation's first_user_message_template.
11
11
  sig { returns(String) }
12
- attr_accessor :initial_message
12
+ attr_accessor :first_user_message
13
13
 
14
14
  # Metadata for ephemeral operations and activities (e.g., objectives, executions,
15
15
  # runs)
@@ -75,12 +75,12 @@ module Cadenya
75
75
  sig { returns(String) }
76
76
  attr_accessor :system_prompt
77
77
 
78
- # Arbitrary data for the objective
78
+ # Arbitrary data rendered into the variation's first_user_message_template
79
79
  sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
80
- attr_reader :data
80
+ attr_reader :first_user_message_data
81
81
 
82
- sig { params(data: T::Hash[Symbol, T.anything]).void }
83
- attr_writer :data
82
+ sig { params(first_user_message_data: T::Hash[Symbol, T.anything]).void }
83
+ attr_writer :first_user_message_data
84
84
 
85
85
  # ObjectiveInfo provides read-only aggregated statistics about an objective's
86
86
  # execution
@@ -114,12 +114,12 @@ module Cadenya
114
114
  sig { params(state_message: String).void }
115
115
  attr_writer :state_message
116
116
 
117
- # Arbitrary data used to render the variation's user_message_template
117
+ # Arbitrary data rendered into the variation's system_prompt_template
118
118
  sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
119
- attr_reader :user_data
119
+ attr_reader :system_prompt_data
120
120
 
121
- sig { params(user_data: T::Hash[Symbol, T.anything]).void }
122
- attr_writer :user_data
121
+ sig { params(system_prompt_data: T::Hash[Symbol, T.anything]).void }
122
+ attr_writer :system_prompt_data
123
123
 
124
124
  # Objective is the data for an objective. It contains the snapshotted fields for
125
125
  # the selected agent and variation. Secrets are returned only with their names,
@@ -127,28 +127,28 @@ module Cadenya
127
127
  sig do
128
128
  params(
129
129
  config_snapshot: Cadenya::ObjectiveConfigSnapshot::OrHash,
130
- initial_message: String,
130
+ first_user_message: String,
131
131
  metadata: Cadenya::OperationMetadata::OrHash,
132
132
  state: Cadenya::Objective::State::OrSymbol,
133
133
  system_prompt: String,
134
- data: T::Hash[Symbol, T.anything],
135
134
  episodic_memory: Cadenya::Objective::EpisodicMemory::OrHash,
135
+ first_user_message_data: T::Hash[Symbol, T.anything],
136
136
  info: Cadenya::ObjectiveInfo::OrHash,
137
137
  memory_cascade: T::Array[Cadenya::MemoryReference::OrHash],
138
138
  output: T::Hash[Symbol, T.anything],
139
139
  parent_objective_id: String,
140
140
  secrets: T::Array[Cadenya::ObjectiveSecret::OrHash],
141
141
  state_message: String,
142
- user_data: T::Hash[Symbol, T.anything]
142
+ system_prompt_data: T::Hash[Symbol, T.anything]
143
143
  ).returns(T.attached_class)
144
144
  end
145
145
  def self.new(
146
146
  # ObjectiveConfigSnapshot is the point-in-time snapshot of the agent, variation,
147
147
  # and (when applicable) schedule that an objective was started with.
148
148
  config_snapshot:,
149
- # The initial message sent to the agent. This becomes the first user message in
150
- # the LLM chat history.
151
- initial_message:,
149
+ # The first user message in the LLM chat history, either provided explicitly at
150
+ # creation or rendered from the variation's first_user_message_template.
151
+ first_user_message:,
152
152
  # Metadata for ephemeral operations and activities (e.g., objectives, executions,
153
153
  # runs)
154
154
  metadata:,
@@ -156,10 +156,10 @@ module Cadenya
156
156
  state:,
157
157
  # system_prompt is read-only, derived from the selected variation's prompt
158
158
  system_prompt:,
159
- # Arbitrary data for the objective
160
- data: nil,
161
159
  # Episodic is used to configure the episodic memory for the objective
162
160
  episodic_memory: nil,
161
+ # Arbitrary data rendered into the variation's first_user_message_template
162
+ first_user_message_data: nil,
163
163
  # ObjectiveInfo provides read-only aggregated statistics about an objective's
164
164
  # execution
165
165
  info: nil,
@@ -189,8 +189,8 @@ module Cadenya
189
189
  secrets: nil,
190
190
  # Optional human-readable detail about the current state (e.g. a failure reason).
191
191
  state_message: nil,
192
- # Arbitrary data used to render the variation's user_message_template
193
- user_data: nil
192
+ # Arbitrary data rendered into the variation's system_prompt_template
193
+ system_prompt_data: nil
194
194
  )
195
195
  end
196
196
 
@@ -198,19 +198,19 @@ module Cadenya
198
198
  override.returns(
199
199
  {
200
200
  config_snapshot: Cadenya::ObjectiveConfigSnapshot,
201
- initial_message: String,
201
+ first_user_message: String,
202
202
  metadata: Cadenya::OperationMetadata,
203
203
  state: Cadenya::Objective::State::TaggedSymbol,
204
204
  system_prompt: String,
205
- data: T::Hash[Symbol, T.anything],
206
205
  episodic_memory: Cadenya::Objective::EpisodicMemory,
206
+ first_user_message_data: T::Hash[Symbol, T.anything],
207
207
  info: Cadenya::ObjectiveInfo,
208
208
  memory_cascade: T::Array[Cadenya::MemoryReference],
209
209
  output: T::Hash[Symbol, T.anything],
210
210
  parent_objective_id: String,
211
211
  secrets: T::Array[Cadenya::ObjectiveSecret],
212
212
  state_message: String,
213
- user_data: T::Hash[Symbol, T.anything]
213
+ system_prompt_data: T::Hash[Symbol, T.anything]
214
214
  }
215
215
  )
216
216
  end
@@ -32,27 +32,12 @@ module Cadenya
32
32
  sig { params(message: String).void }
33
33
  attr_writer :message
34
34
 
35
- # Secrets that should be included with the message. Helpful for when you need to
36
- # update secrets on the objective (IE: A secret expires and needs to be refreshed)
37
- sig do
38
- returns(T.nilable(T::Array[Cadenya::ObjectiveContinueParams::Secret]))
39
- end
40
- attr_reader :secrets
41
-
42
- sig do
43
- params(
44
- secrets: T::Array[Cadenya::ObjectiveContinueParams::Secret::OrHash]
45
- ).void
46
- end
47
- attr_writer :secrets
48
-
49
35
  sig do
50
36
  params(
51
37
  workspace_id: String,
52
38
  objective_id: String,
53
39
  enqueue: T::Boolean,
54
40
  message: String,
55
- secrets: T::Array[Cadenya::ObjectiveContinueParams::Secret::OrHash],
56
41
  request_options: Cadenya::RequestOptions::OrHash
57
42
  ).returns(T.attached_class)
58
43
  end
@@ -64,9 +49,6 @@ module Cadenya
64
49
  enqueue: nil,
65
50
  # The message to continue an objective that has completed (or you are enqueing)
66
51
  message: nil,
67
- # Secrets that should be included with the message. Helpful for when you need to
68
- # update secrets on the objective (IE: A secret expires and needs to be refreshed)
69
- secrets: nil,
70
52
  request_options: {}
71
53
  )
72
54
  end
@@ -78,43 +60,12 @@ module Cadenya
78
60
  objective_id: String,
79
61
  enqueue: T::Boolean,
80
62
  message: String,
81
- secrets: T::Array[Cadenya::ObjectiveContinueParams::Secret],
82
63
  request_options: Cadenya::RequestOptions
83
64
  }
84
65
  )
85
66
  end
86
67
  def to_hash
87
68
  end
88
-
89
- class Secret < Cadenya::Internal::Type::BaseModel
90
- OrHash =
91
- T.type_alias do
92
- T.any(
93
- Cadenya::ObjectiveContinueParams::Secret,
94
- Cadenya::Internal::AnyHash
95
- )
96
- end
97
-
98
- sig { returns(T.nilable(String)) }
99
- attr_reader :name
100
-
101
- sig { params(name: String).void }
102
- attr_writer :name
103
-
104
- sig { returns(T.nilable(String)) }
105
- attr_reader :value
106
-
107
- sig { params(value: String).void }
108
- attr_writer :value
109
-
110
- sig { params(name: String, value: String).returns(T.attached_class) }
111
- def self.new(name: nil, value: nil)
112
- end
113
-
114
- sig { override.returns({ name: String, value: String }) }
115
- def to_hash
116
- end
117
- end
118
69
  end
119
70
  end
120
71
  end
@@ -17,10 +17,11 @@ module Cadenya
17
17
  sig { returns(String) }
18
18
  attr_accessor :agent_id
19
19
 
20
- # Arbitrary data for the objective. May be used in liquid templates for prompts
21
- # configured on the agent variation
20
+ # Arbitrary data rendered into the selected variation's system_prompt_template
21
+ # (liquid) to produce the objective's system prompt. If the agent has a
22
+ # system_prompt_data_schema, this must satisfy it.
22
23
  sig { returns(T::Hash[Symbol, T.anything]) }
23
- attr_accessor :data
24
+ attr_accessor :system_prompt_data
24
25
 
25
26
  # Episodic is used to configure the episodic memory for the objective
26
27
  sig { returns(T.nilable(Cadenya::ObjectiveCreateParams::EpisodicMemory)) }
@@ -34,16 +35,25 @@ module Cadenya
34
35
  end
35
36
  attr_writer :episodic_memory
36
37
 
37
- # Optional override for the initial message sent to the agent. This becomes the
38
- # first user message in the LLM chat history. When not set, the selected
39
- # variation's user_message_template is rendered with user_data instead. If neither
40
- # this field nor a user_message_template is present, the request is rejected with
38
+ # Optional explicit first user message for the LLM chat history. When not set, the
39
+ # selected variation's first_user_message_template is rendered with
40
+ # first_user_message_data instead. If neither this field nor a
41
+ # first_user_message_template is present, the request is rejected with
41
42
  # InvalidArgument.
42
43
  sig { returns(T.nilable(String)) }
43
- attr_reader :initial_message
44
+ attr_reader :first_user_message
44
45
 
45
- sig { params(initial_message: String).void }
46
- attr_writer :initial_message
46
+ sig { params(first_user_message: String).void }
47
+ attr_writer :first_user_message
48
+
49
+ # Arbitrary data rendered into the selected variation's
50
+ # first_user_message_template (liquid) to produce the first user message. Separate
51
+ # from `system_prompt_data`, which renders the system prompt template.
52
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
53
+ attr_reader :first_user_message_data
54
+
55
+ sig { params(first_user_message_data: T::Hash[Symbol, T.anything]).void }
56
+ attr_writer :first_user_message_data
47
57
 
48
58
  # Memory layers/entries layered over the baseline cascade inherited from the
49
59
  # selected variation — element-level rules over inherited styles, in CSS terms.
@@ -89,15 +99,6 @@ module Cadenya
89
99
  end
90
100
  attr_writer :secrets
91
101
 
92
- # Arbitrary data rendered into the selected variation's user_message_template
93
- # (liquid) to produce the initial user message. Separate from `data`, which
94
- # renders the system prompt template.
95
- sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
96
- attr_reader :user_data
97
-
98
- sig { params(user_data: T::Hash[Symbol, T.anything]).void }
99
- attr_writer :user_data
100
-
101
102
  # Optional explicit variation selection. Overrides the agent's
102
103
  # variation_selection_mode.
103
104
  sig { returns(T.nilable(String)) }
@@ -110,14 +111,14 @@ module Cadenya
110
111
  params(
111
112
  workspace_id: String,
112
113
  agent_id: String,
113
- data: T::Hash[Symbol, T.anything],
114
+ system_prompt_data: T::Hash[Symbol, T.anything],
114
115
  episodic_memory:
115
116
  Cadenya::ObjectiveCreateParams::EpisodicMemory::OrHash,
116
- initial_message: String,
117
+ first_user_message: String,
118
+ first_user_message_data: T::Hash[Symbol, T.anything],
117
119
  memory_cascade: T::Array[Cadenya::MemoryReference::OrHash],
118
120
  metadata: Cadenya::CreateOperationMetadata::OrHash,
119
121
  secrets: T::Array[Cadenya::ObjectiveCreateParams::Secret::OrHash],
120
- user_data: T::Hash[Symbol, T.anything],
121
122
  variation_id: String,
122
123
  request_options: Cadenya::RequestOptions::OrHash
123
124
  ).returns(T.attached_class)
@@ -125,17 +126,22 @@ module Cadenya
125
126
  def self.new(
126
127
  workspace_id:,
127
128
  agent_id:,
128
- # Arbitrary data for the objective. May be used in liquid templates for prompts
129
- # configured on the agent variation
130
- data:,
129
+ # Arbitrary data rendered into the selected variation's system_prompt_template
130
+ # (liquid) to produce the objective's system prompt. If the agent has a
131
+ # system_prompt_data_schema, this must satisfy it.
132
+ system_prompt_data:,
131
133
  # Episodic is used to configure the episodic memory for the objective
132
134
  episodic_memory: nil,
133
- # Optional override for the initial message sent to the agent. This becomes the
134
- # first user message in the LLM chat history. When not set, the selected
135
- # variation's user_message_template is rendered with user_data instead. If neither
136
- # this field nor a user_message_template is present, the request is rejected with
135
+ # Optional explicit first user message for the LLM chat history. When not set, the
136
+ # selected variation's first_user_message_template is rendered with
137
+ # first_user_message_data instead. If neither this field nor a
138
+ # first_user_message_template is present, the request is rejected with
137
139
  # InvalidArgument.
138
- initial_message: nil,
140
+ first_user_message: nil,
141
+ # Arbitrary data rendered into the selected variation's
142
+ # first_user_message_template (liquid) to produce the first user message. Separate
143
+ # from `system_prompt_data`, which renders the system prompt template.
144
+ first_user_message_data: nil,
139
145
  # Memory layers/entries layered over the baseline cascade inherited from the
140
146
  # selected variation — element-level rules over inherited styles, in CSS terms.
141
147
  #
@@ -157,10 +163,6 @@ module Cadenya
157
163
  # Secrets that can be used in the headers for tool calls using the secret
158
164
  # interpolation format.
159
165
  secrets: nil,
160
- # Arbitrary data rendered into the selected variation's user_message_template
161
- # (liquid) to produce the initial user message. Separate from `data`, which
162
- # renders the system prompt template.
163
- user_data: nil,
164
166
  # Optional explicit variation selection. Overrides the agent's
165
167
  # variation_selection_mode.
166
168
  variation_id: nil,
@@ -173,13 +175,13 @@ module Cadenya
173
175
  {
174
176
  workspace_id: String,
175
177
  agent_id: String,
176
- data: T::Hash[Symbol, T.anything],
178
+ system_prompt_data: T::Hash[Symbol, T.anything],
177
179
  episodic_memory: Cadenya::ObjectiveCreateParams::EpisodicMemory,
178
- initial_message: String,
180
+ first_user_message: String,
181
+ first_user_message_data: T::Hash[Symbol, T.anything],
179
182
  memory_cascade: T::Array[Cadenya::MemoryReference],
180
183
  metadata: Cadenya::CreateOperationMetadata,
181
184
  secrets: T::Array[Cadenya::ObjectiveCreateParams::Secret],
182
- user_data: T::Hash[Symbol, T.anything],
183
185
  variation_id: String,
184
186
  request_options: Cadenya::RequestOptions
185
187
  }
@@ -61,6 +61,17 @@ module Cadenya
61
61
  sig { params(memory_read: Cadenya::MemoryRead::OrHash).void }
62
62
  attr_writer :memory_read
63
63
 
64
+ # Notice is a non-terminal diagnostic emitted by the runtime when something
65
+ # noteworthy but non-fatal happens during an objective — for example a
66
+ # just-in-time tool set failing to load, or a previously loaded tool being dropped
67
+ # because it was archived. Notices carry no structured payload; they exist to make
68
+ # the objective timeline self-explanatory.
69
+ sig { returns(T.nilable(Cadenya::ObjectiveEventData::Notice)) }
70
+ attr_reader :notice
71
+
72
+ sig { params(notice: Cadenya::ObjectiveEventData::Notice::OrHash).void }
73
+ attr_writer :notice
74
+
64
75
  sig { returns(T.nilable(Cadenya::SubAgentSpawned)) }
65
76
  attr_reader :sub_agent_spawned
66
77
 
@@ -133,6 +144,7 @@ module Cadenya
133
144
  error: Cadenya::ObjectiveError::OrHash,
134
145
  finalized: Cadenya::ObjectiveEventData::Finalized::OrHash,
135
146
  memory_read: Cadenya::MemoryRead::OrHash,
147
+ notice: Cadenya::ObjectiveEventData::Notice::OrHash,
136
148
  sub_agent_spawned: Cadenya::SubAgentSpawned::OrHash,
137
149
  sub_agent_updated: Cadenya::SubAgentUpdated::OrHash,
138
150
  tool_approval_requested: Cadenya::ToolApprovalRequested::OrHash,
@@ -161,6 +173,12 @@ module Cadenya
161
173
  # cascade and loads an entry. Lookups that miss (key not found in any layer) do
162
174
  # not emit this event.
163
175
  memory_read: nil,
176
+ # Notice is a non-terminal diagnostic emitted by the runtime when something
177
+ # noteworthy but non-fatal happens during an objective — for example a
178
+ # just-in-time tool set failing to load, or a previously loaded tool being dropped
179
+ # because it was archived. Notices carry no structured payload; they exist to make
180
+ # the objective timeline self-explanatory.
181
+ notice: nil,
164
182
  sub_agent_spawned: nil,
165
183
  sub_agent_updated: nil,
166
184
  tool_approval_requested: nil,
@@ -183,6 +201,7 @@ module Cadenya
183
201
  error: Cadenya::ObjectiveError,
184
202
  finalized: Cadenya::ObjectiveEventData::Finalized,
185
203
  memory_read: Cadenya::MemoryRead,
204
+ notice: Cadenya::ObjectiveEventData::Notice,
186
205
  sub_agent_spawned: Cadenya::SubAgentSpawned,
187
206
  sub_agent_updated: Cadenya::SubAgentUpdated,
188
207
  tool_approval_requested: Cadenya::ToolApprovalRequested,
@@ -268,6 +287,115 @@ module Cadenya
268
287
  def to_hash
269
288
  end
270
289
  end
290
+
291
+ class Notice < Cadenya::Internal::Type::BaseModel
292
+ OrHash =
293
+ T.type_alias do
294
+ T.any(
295
+ Cadenya::ObjectiveEventData::Notice,
296
+ Cadenya::Internal::AnyHash
297
+ )
298
+ end
299
+
300
+ # Stable machine-readable identifier for the notice kind (for example
301
+ # "tool_set_load_failed", "tool_archived"). Clients can switch on it or use it as
302
+ # an i18n key; the message is the English fallback.
303
+ sig { returns(T.nilable(String)) }
304
+ attr_reader :key
305
+
306
+ sig { params(key: String).void }
307
+ attr_writer :key
308
+
309
+ sig do
310
+ returns(
311
+ T.nilable(Cadenya::ObjectiveEventData::Notice::Level::TaggedSymbol)
312
+ )
313
+ end
314
+ attr_reader :level
315
+
316
+ sig do
317
+ params(
318
+ level: Cadenya::ObjectiveEventData::Notice::Level::OrSymbol
319
+ ).void
320
+ end
321
+ attr_writer :level
322
+
323
+ # Human-readable description of what happened.
324
+ sig { returns(T.nilable(String)) }
325
+ attr_reader :message
326
+
327
+ sig { params(message: String).void }
328
+ attr_writer :message
329
+
330
+ # Notice is a non-terminal diagnostic emitted by the runtime when something
331
+ # noteworthy but non-fatal happens during an objective — for example a
332
+ # just-in-time tool set failing to load, or a previously loaded tool being dropped
333
+ # because it was archived. Notices carry no structured payload; they exist to make
334
+ # the objective timeline self-explanatory.
335
+ sig do
336
+ params(
337
+ key: String,
338
+ level: Cadenya::ObjectiveEventData::Notice::Level::OrSymbol,
339
+ message: String
340
+ ).returns(T.attached_class)
341
+ end
342
+ def self.new(
343
+ # Stable machine-readable identifier for the notice kind (for example
344
+ # "tool_set_load_failed", "tool_archived"). Clients can switch on it or use it as
345
+ # an i18n key; the message is the English fallback.
346
+ key: nil,
347
+ level: nil,
348
+ # Human-readable description of what happened.
349
+ message: nil
350
+ )
351
+ end
352
+
353
+ sig do
354
+ override.returns(
355
+ {
356
+ key: String,
357
+ level: Cadenya::ObjectiveEventData::Notice::Level::TaggedSymbol,
358
+ message: String
359
+ }
360
+ )
361
+ end
362
+ def to_hash
363
+ end
364
+
365
+ module Level
366
+ extend Cadenya::Internal::Type::Enum
367
+
368
+ TaggedSymbol =
369
+ T.type_alias do
370
+ T.all(Symbol, Cadenya::ObjectiveEventData::Notice::Level)
371
+ end
372
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
373
+
374
+ LEVEL_UNSPECIFIED =
375
+ T.let(
376
+ :LEVEL_UNSPECIFIED,
377
+ Cadenya::ObjectiveEventData::Notice::Level::TaggedSymbol
378
+ )
379
+ LEVEL_INFO =
380
+ T.let(
381
+ :LEVEL_INFO,
382
+ Cadenya::ObjectiveEventData::Notice::Level::TaggedSymbol
383
+ )
384
+ LEVEL_WARN =
385
+ T.let(
386
+ :LEVEL_WARN,
387
+ Cadenya::ObjectiveEventData::Notice::Level::TaggedSymbol
388
+ )
389
+
390
+ sig do
391
+ override.returns(
392
+ T::Array[Cadenya::ObjectiveEventData::Notice::Level::TaggedSymbol]
393
+ )
394
+ end
395
+ def self.values
396
+ end
397
+ end
398
+ end
271
399
  end
272
400
  end
273
401
  end
@@ -0,0 +1,30 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Models
5
+ class RotateChallengeTokenResponse < Cadenya::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Cadenya::RotateChallengeTokenResponse,
10
+ Cadenya::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ sig { returns(T.nilable(String)) }
15
+ attr_reader :challenge_token
16
+
17
+ sig { params(challenge_token: String).void }
18
+ attr_writer :challenge_token
19
+
20
+ # Response containing the newly generated challenge token.
21
+ sig { params(challenge_token: String).returns(T.attached_class) }
22
+ def self.new(challenge_token: nil)
23
+ end
24
+
25
+ sig { override.returns({ challenge_token: String }) }
26
+ def to_hash
27
+ end
28
+ end
29
+ end
30
+ end
@@ -28,6 +28,17 @@ module Cadenya
28
28
  sig { params(include_tools: Cadenya::ToolFilter::OrHash).void }
29
29
  attr_writer :include_tools
30
30
 
31
+ # Defines behavior for just-in-time capable tool set adapters (IE: MCP).
32
+ sig { returns(T.nilable(Cadenya::ToolSetAdapterMcp::JustInTime)) }
33
+ attr_reader :just_in_time
34
+
35
+ sig do
36
+ params(
37
+ just_in_time: Cadenya::ToolSetAdapterMcp::JustInTime::OrHash
38
+ ).void
39
+ end
40
+ attr_writer :just_in_time
41
+
31
42
  # Approval filters that will automatically set the approval requirement on tools
32
43
  # synced from an external source
33
44
  sig { returns(T.nilable(Cadenya::ApprovalRequirementFilter)) }
@@ -49,6 +60,7 @@ module Cadenya
49
60
  exclude_tools: Cadenya::ToolFilter::OrHash,
50
61
  headers: T::Hash[Symbol, String],
51
62
  include_tools: Cadenya::ToolFilter::OrHash,
63
+ just_in_time: Cadenya::ToolSetAdapterMcp::JustInTime::OrHash,
52
64
  tool_approvals: Cadenya::ApprovalRequirementFilter::OrHash,
53
65
  url: String
54
66
  ).returns(T.attached_class)
@@ -59,6 +71,8 @@ module Cadenya
59
71
  headers: nil,
60
72
  # Top-level filter with simple boolean logic (no nesting)
61
73
  include_tools: nil,
74
+ # Defines behavior for just-in-time capable tool set adapters (IE: MCP).
75
+ just_in_time: nil,
62
76
  # Approval filters that will automatically set the approval requirement on tools
63
77
  # synced from an external source
64
78
  tool_approvals: nil,
@@ -72,6 +86,7 @@ module Cadenya
72
86
  exclude_tools: Cadenya::ToolFilter,
73
87
  headers: T::Hash[Symbol, String],
74
88
  include_tools: Cadenya::ToolFilter,
89
+ just_in_time: Cadenya::ToolSetAdapterMcp::JustInTime,
75
90
  tool_approvals: Cadenya::ApprovalRequirementFilter,
76
91
  url: String
77
92
  }
@@ -79,6 +94,60 @@ module Cadenya
79
94
  end
80
95
  def to_hash
81
96
  end
97
+
98
+ class JustInTime < Cadenya::Internal::Type::BaseModel
99
+ OrHash =
100
+ T.type_alias do
101
+ T.any(
102
+ Cadenya::ToolSetAdapterMcp::JustInTime,
103
+ Cadenya::Internal::AnyHash
104
+ )
105
+ end
106
+
107
+ sig { returns(T.nilable(T::Boolean)) }
108
+ attr_reader :enabled
109
+
110
+ sig { params(enabled: T::Boolean).void }
111
+ attr_writer :enabled
112
+
113
+ # If set, an objective will automatically be failed if tools cannot be loaded in
114
+ # the initial stages of an objective being created. Tools are loaded
115
+ # asynchronously, so this setting is useful for ensuring that an objective
116
+ # continued any further if tools are not available.
117
+ sig { returns(T.nilable(T::Boolean)) }
118
+ attr_reader :fail_objective_on_tool_list_error
119
+
120
+ sig { params(fail_objective_on_tool_list_error: T::Boolean).void }
121
+ attr_writer :fail_objective_on_tool_list_error
122
+
123
+ # Defines behavior for just-in-time capable tool set adapters (IE: MCP).
124
+ sig do
125
+ params(
126
+ enabled: T::Boolean,
127
+ fail_objective_on_tool_list_error: T::Boolean
128
+ ).returns(T.attached_class)
129
+ end
130
+ def self.new(
131
+ enabled: nil,
132
+ # If set, an objective will automatically be failed if tools cannot be loaded in
133
+ # the initial stages of an objective being created. Tools are loaded
134
+ # asynchronously, so this setting is useful for ensuring that an objective
135
+ # continued any further if tools are not available.
136
+ fail_objective_on_tool_list_error: nil
137
+ )
138
+ end
139
+
140
+ sig do
141
+ override.returns(
142
+ {
143
+ enabled: T::Boolean,
144
+ fail_objective_on_tool_list_error: T::Boolean
145
+ }
146
+ )
147
+ end
148
+ def to_hash
149
+ end
150
+ end
82
151
  end
83
152
  end
84
153
  end
@@ -25,9 +25,20 @@ module Cadenya
25
25
  sig { params(tool_set: Cadenya::ResourceMetadata::OrHash).void }
26
26
  attr_writer :tool_set
27
27
 
28
+ # Content signature identifying the tool within its tool set: a hash of the
29
+ # sanitized llm_tool_name, description, and canonical parameters. Two tools with
30
+ # the same llm_tool_name but different parameters or description (as MCP servers
31
+ # may return per user) have distinct signatures.
32
+ sig { returns(T.nilable(String)) }
33
+ attr_reader :signature
34
+
35
+ sig { params(signature: String).void }
36
+ attr_writer :signature
37
+
28
38
  sig do
29
39
  params(
30
40
  created_by: Cadenya::Profile::OrHash,
41
+ signature: String,
31
42
  tool_set: Cadenya::ResourceMetadata::OrHash
32
43
  ).returns(T.attached_class)
33
44
  end
@@ -36,6 +47,11 @@ module Cadenya
36
47
  # account level. Profiles are account-scoped and can be granted access to multiple
37
48
  # workspaces.
38
49
  created_by: nil,
50
+ # Content signature identifying the tool within its tool set: a hash of the
51
+ # sanitized llm_tool_name, description, and canonical parameters. Two tools with
52
+ # the same llm_tool_name but different parameters or description (as MCP servers
53
+ # may return per user) have distinct signatures.
54
+ signature: nil,
39
55
  # Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
40
56
  tool_set: nil
41
57
  )
@@ -45,6 +61,7 @@ module Cadenya
45
61
  override.returns(
46
62
  {
47
63
  created_by: Cadenya::Profile,
64
+ signature: String,
48
65
  tool_set: Cadenya::ResourceMetadata
49
66
  }
50
67
  )