cadenya 0.8.0 → 0.9.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 (41) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +1 -1
  4. data/lib/cadenya/models/objective.rb +116 -18
  5. data/lib/cadenya/models/objective_config_snapshot.rb +39 -0
  6. data/lib/cadenya/models/objective_create_params.rb +65 -4
  7. data/lib/cadenya/models/objective_info.rb +45 -29
  8. data/lib/cadenya/models/objective_secret.rb +15 -0
  9. data/lib/cadenya/models/objectives/objective_tool_call.rb +19 -19
  10. data/lib/cadenya/models.rb +3 -5
  11. data/lib/cadenya/resources/objectives/tool_calls.rb +4 -4
  12. data/lib/cadenya/resources/objectives.rb +11 -5
  13. data/lib/cadenya/version.rb +1 -1
  14. data/lib/cadenya.rb +2 -3
  15. data/rbi/cadenya/models/objective.rbi +172 -32
  16. data/rbi/cadenya/models/objective_config_snapshot.rbi +70 -0
  17. data/rbi/cadenya/models/objective_create_params.rbi +112 -6
  18. data/rbi/cadenya/models/objective_info.rbi +50 -56
  19. data/rbi/cadenya/models/objective_secret.rbi +26 -0
  20. data/rbi/cadenya/models/objectives/objective_tool_call.rbi +47 -57
  21. data/rbi/cadenya/models/profile_spec.rbi +2 -2
  22. data/rbi/cadenya/models.rbi +3 -5
  23. data/rbi/cadenya/resources/objectives.rbi +29 -1
  24. data/sig/cadenya/models/objective.rbs +85 -15
  25. data/sig/cadenya/models/objective_config_snapshot.rbs +40 -0
  26. data/sig/cadenya/models/objective_create_params.rbs +45 -4
  27. data/sig/cadenya/models/objective_info.rbs +26 -38
  28. data/sig/cadenya/models/objective_secret.rbs +15 -0
  29. data/sig/cadenya/models/objectives/objective_tool_call.rbs +23 -27
  30. data/sig/cadenya/models.rbs +3 -5
  31. data/sig/cadenya/resources/objectives.rbs +4 -1
  32. metadata +8 -11
  33. data/lib/cadenya/models/objective_data.rb +0 -127
  34. data/lib/cadenya/models/objective_data_secret.rb +0 -21
  35. data/lib/cadenya/models/objective_status.rb +0 -37
  36. data/rbi/cadenya/models/objective_data.rbi +0 -198
  37. data/rbi/cadenya/models/objective_data_secret.rbi +0 -32
  38. data/rbi/cadenya/models/objective_status.rbi +0 -75
  39. data/sig/cadenya/models/objective_data.rbs +0 -98
  40. data/sig/cadenya/models/objective_data_secret.rbs +0 -19
  41. data/sig/cadenya/models/objective_status.rbs +0 -47
@@ -1,198 +0,0 @@
1
- # typed: strong
2
-
3
- module Cadenya
4
- module Models
5
- class ObjectiveData < Cadenya::Internal::Type::BaseModel
6
- OrHash =
7
- T.type_alias do
8
- T.any(Cadenya::ObjectiveData, Cadenya::Internal::AnyHash)
9
- end
10
-
11
- # Represents a dynamically typed value which can be either null, a number, a
12
- # string, a boolean, a recursive struct value, or a list of values.
13
- sig { returns(T.nilable(T.anything)) }
14
- attr_reader :data
15
-
16
- sig { params(data: T.anything).void }
17
- attr_writer :data
18
-
19
- # The initial message sent to the agent. This becomes the first user message in
20
- # the LLM chat history.
21
- sig { returns(T.nilable(String)) }
22
- attr_reader :initial_message
23
-
24
- sig { params(initial_message: String).void }
25
- attr_writer :initial_message
26
-
27
- # Memory layers/entries to push onto this objective's memory stack on top of the
28
- # baseline stack inherited from the selected variation.
29
- #
30
- # Array order is push order: the first element sits lower in the objective's
31
- # contribution to the stack; the LAST element ends up on top of the effective
32
- # stack. Entries pinned via memory_entry_id behave as single-entry layers at their
33
- # position.
34
- #
35
- # System-managed layers (e.g., episodic) cannot be referenced here; they attach
36
- # themselves automatically based on episodic_key.
37
- #
38
- # Stack size cap: the TOTAL effective stack (variation's memory layers
39
- #
40
- # - this field) must not exceed 10 entries. A request that would produce an
41
- # effective stack larger than 10 is rejected with InvalidArgument.
42
- sig { returns(T.nilable(T::Array[Cadenya::MemoryReference])) }
43
- attr_reader :memory_stack
44
-
45
- sig do
46
- params(memory_stack: T::Array[Cadenya::MemoryReference::OrHash]).void
47
- end
48
- attr_writer :memory_stack
49
-
50
- # Secrets that can be used in the headers for tool calls using the secret
51
- # interpolation format.
52
- sig { returns(T.nilable(T::Array[Cadenya::ObjectiveDataSecret])) }
53
- attr_reader :secrets
54
-
55
- sig do
56
- params(secrets: T::Array[Cadenya::ObjectiveDataSecret::OrHash]).void
57
- end
58
- attr_writer :secrets
59
-
60
- # Agent resource
61
- sig { returns(T.nilable(Cadenya::Agent)) }
62
- attr_reader :agent
63
-
64
- sig { params(agent: Cadenya::Agent::OrHash).void }
65
- attr_writer :agent
66
-
67
- # The output of the objective, populated when the objective completes. Will match
68
- # the schema of output_json_schema or output_json_inferred.
69
- sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
70
- attr_reader :output
71
-
72
- sig { params(output: T::Hash[Symbol, T.anything]).void }
73
- attr_writer :output
74
-
75
- # Snapshot of the agent spec's output_definition at objective creation time. When
76
- # present, the objective will run an extraction step after the LLM finishes.
77
- sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
78
- attr_reader :output_definition
79
-
80
- sig { params(output_definition: T::Hash[Symbol, T.anything]).void }
81
- attr_writer :output_definition
82
-
83
- # A parent objective means the objective was spawned off using a separate agent to
84
- # complete an objective
85
- sig { returns(T.nilable(String)) }
86
- attr_reader :parent_objective_id
87
-
88
- sig { params(parent_objective_id: String).void }
89
- attr_writer :parent_objective_id
90
-
91
- # ID of the AgentSchedule that produced this objective, when applicable. Populated
92
- # when the objective is created from a schedule fire; empty when the objective was
93
- # created via CreateObjective directly.
94
- sig { returns(T.nilable(String)) }
95
- attr_reader :source_schedule_id
96
-
97
- sig { params(source_schedule_id: String).void }
98
- attr_writer :source_schedule_id
99
-
100
- # system_prompt is read-only, derived from the selected variation's prompt
101
- sig { returns(T.nilable(String)) }
102
- attr_reader :system_prompt
103
-
104
- sig { params(system_prompt: String).void }
105
- attr_writer :system_prompt
106
-
107
- # AgentVariation resource
108
- sig { returns(T.nilable(Cadenya::Agents::AgentVariation)) }
109
- attr_reader :variation
110
-
111
- sig { params(variation: Cadenya::Agents::AgentVariation::OrHash).void }
112
- attr_writer :variation
113
-
114
- sig do
115
- params(
116
- agent: Cadenya::Agent::OrHash,
117
- data: T.anything,
118
- initial_message: String,
119
- memory_stack: T::Array[Cadenya::MemoryReference::OrHash],
120
- output: T::Hash[Symbol, T.anything],
121
- output_definition: T::Hash[Symbol, T.anything],
122
- parent_objective_id: String,
123
- secrets: T::Array[Cadenya::ObjectiveDataSecret::OrHash],
124
- source_schedule_id: String,
125
- system_prompt: String,
126
- variation: Cadenya::Agents::AgentVariation::OrHash
127
- ).returns(T.attached_class)
128
- end
129
- def self.new(
130
- # Agent resource
131
- agent: nil,
132
- # Represents a dynamically typed value which can be either null, a number, a
133
- # string, a boolean, a recursive struct value, or a list of values.
134
- data: nil,
135
- # The initial message sent to the agent. This becomes the first user message in
136
- # the LLM chat history.
137
- initial_message: nil,
138
- # Memory layers/entries to push onto this objective's memory stack on top of the
139
- # baseline stack inherited from the selected variation.
140
- #
141
- # Array order is push order: the first element sits lower in the objective's
142
- # contribution to the stack; the LAST element ends up on top of the effective
143
- # stack. Entries pinned via memory_entry_id behave as single-entry layers at their
144
- # position.
145
- #
146
- # System-managed layers (e.g., episodic) cannot be referenced here; they attach
147
- # themselves automatically based on episodic_key.
148
- #
149
- # Stack size cap: the TOTAL effective stack (variation's memory layers
150
- #
151
- # - this field) must not exceed 10 entries. A request that would produce an
152
- # effective stack larger than 10 is rejected with InvalidArgument.
153
- memory_stack: nil,
154
- # The output of the objective, populated when the objective completes. Will match
155
- # the schema of output_json_schema or output_json_inferred.
156
- output: nil,
157
- # Snapshot of the agent spec's output_definition at objective creation time. When
158
- # present, the objective will run an extraction step after the LLM finishes.
159
- output_definition: nil,
160
- # A parent objective means the objective was spawned off using a separate agent to
161
- # complete an objective
162
- parent_objective_id: nil,
163
- # Secrets that can be used in the headers for tool calls using the secret
164
- # interpolation format.
165
- secrets: nil,
166
- # ID of the AgentSchedule that produced this objective, when applicable. Populated
167
- # when the objective is created from a schedule fire; empty when the objective was
168
- # created via CreateObjective directly.
169
- source_schedule_id: nil,
170
- # system_prompt is read-only, derived from the selected variation's prompt
171
- system_prompt: nil,
172
- # AgentVariation resource
173
- variation: nil
174
- )
175
- end
176
-
177
- sig do
178
- override.returns(
179
- {
180
- agent: Cadenya::Agent,
181
- data: T.anything,
182
- initial_message: String,
183
- memory_stack: T::Array[Cadenya::MemoryReference],
184
- output: T::Hash[Symbol, T.anything],
185
- output_definition: T::Hash[Symbol, T.anything],
186
- parent_objective_id: String,
187
- secrets: T::Array[Cadenya::ObjectiveDataSecret],
188
- source_schedule_id: String,
189
- system_prompt: String,
190
- variation: Cadenya::Agents::AgentVariation
191
- }
192
- )
193
- end
194
- def to_hash
195
- end
196
- end
197
- end
198
- end
@@ -1,32 +0,0 @@
1
- # typed: strong
2
-
3
- module Cadenya
4
- module Models
5
- class ObjectiveDataSecret < Cadenya::Internal::Type::BaseModel
6
- OrHash =
7
- T.type_alias do
8
- T.any(Cadenya::ObjectiveDataSecret, Cadenya::Internal::AnyHash)
9
- end
10
-
11
- sig { returns(T.nilable(String)) }
12
- attr_reader :name
13
-
14
- sig { params(name: String).void }
15
- attr_writer :name
16
-
17
- sig { returns(T.nilable(String)) }
18
- attr_reader :value
19
-
20
- sig { params(value: String).void }
21
- attr_writer :value
22
-
23
- sig { params(name: String, value: String).returns(T.attached_class) }
24
- def self.new(name: nil, value: nil)
25
- end
26
-
27
- sig { override.returns({ name: String, value: String }) }
28
- def to_hash
29
- end
30
- end
31
- end
32
- end
@@ -1,75 +0,0 @@
1
- # typed: strong
2
-
3
- module Cadenya
4
- module Models
5
- class ObjectiveStatus < Cadenya::Internal::Type::BaseModel
6
- OrHash =
7
- T.type_alias do
8
- T.any(Cadenya::ObjectiveStatus, Cadenya::Internal::AnyHash)
9
- end
10
-
11
- sig { returns(Cadenya::ObjectiveStatus::State::TaggedSymbol) }
12
- attr_accessor :state
13
-
14
- sig { returns(T.nilable(String)) }
15
- attr_reader :message
16
-
17
- sig { params(message: String).void }
18
- attr_writer :message
19
-
20
- sig do
21
- params(
22
- state: Cadenya::ObjectiveStatus::State::OrSymbol,
23
- message: String
24
- ).returns(T.attached_class)
25
- end
26
- def self.new(state:, message: nil)
27
- end
28
-
29
- sig do
30
- override.returns(
31
- {
32
- state: Cadenya::ObjectiveStatus::State::TaggedSymbol,
33
- message: String
34
- }
35
- )
36
- end
37
- def to_hash
38
- end
39
-
40
- module State
41
- extend Cadenya::Internal::Type::Enum
42
-
43
- TaggedSymbol =
44
- T.type_alias { T.all(Symbol, Cadenya::ObjectiveStatus::State) }
45
- OrSymbol = T.type_alias { T.any(Symbol, String) }
46
-
47
- STATE_UNSPECIFIED =
48
- T.let(
49
- :STATE_UNSPECIFIED,
50
- Cadenya::ObjectiveStatus::State::TaggedSymbol
51
- )
52
- STATE_PENDING =
53
- T.let(:STATE_PENDING, Cadenya::ObjectiveStatus::State::TaggedSymbol)
54
- STATE_RUNNING =
55
- T.let(:STATE_RUNNING, Cadenya::ObjectiveStatus::State::TaggedSymbol)
56
- STATE_WAITING =
57
- T.let(:STATE_WAITING, Cadenya::ObjectiveStatus::State::TaggedSymbol)
58
- STATE_FAILED =
59
- T.let(:STATE_FAILED, Cadenya::ObjectiveStatus::State::TaggedSymbol)
60
- STATE_CANCELLED =
61
- T.let(:STATE_CANCELLED, Cadenya::ObjectiveStatus::State::TaggedSymbol)
62
- STATE_FINALIZED =
63
- T.let(:STATE_FINALIZED, Cadenya::ObjectiveStatus::State::TaggedSymbol)
64
-
65
- sig do
66
- override.returns(
67
- T::Array[Cadenya::ObjectiveStatus::State::TaggedSymbol]
68
- )
69
- end
70
- def self.values
71
- end
72
- end
73
- end
74
- end
75
- end
@@ -1,98 +0,0 @@
1
- module Cadenya
2
- module Models
3
- type objective_data =
4
- {
5
- agent: Cadenya::Agent,
6
- data: top,
7
- initial_message: String,
8
- memory_stack: ::Array[Cadenya::MemoryReference],
9
- output: ::Hash[Symbol, top],
10
- output_definition: ::Hash[Symbol, top],
11
- parent_objective_id: String,
12
- secrets: ::Array[Cadenya::ObjectiveDataSecret],
13
- source_schedule_id: String,
14
- system_prompt: String,
15
- variation: Cadenya::Agents::AgentVariation
16
- }
17
-
18
- class ObjectiveData < Cadenya::Internal::Type::BaseModel
19
- attr_reader data: top?
20
-
21
- def data=: (top) -> top
22
-
23
- attr_reader initial_message: String?
24
-
25
- def initial_message=: (String) -> String
26
-
27
- attr_reader memory_stack: ::Array[Cadenya::MemoryReference]?
28
-
29
- def memory_stack=: (
30
- ::Array[Cadenya::MemoryReference]
31
- ) -> ::Array[Cadenya::MemoryReference]
32
-
33
- attr_reader secrets: ::Array[Cadenya::ObjectiveDataSecret]?
34
-
35
- def secrets=: (
36
- ::Array[Cadenya::ObjectiveDataSecret]
37
- ) -> ::Array[Cadenya::ObjectiveDataSecret]
38
-
39
- attr_reader agent: Cadenya::Agent?
40
-
41
- def agent=: (Cadenya::Agent) -> Cadenya::Agent
42
-
43
- attr_reader output: ::Hash[Symbol, top]?
44
-
45
- def output=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top]
46
-
47
- attr_reader output_definition: ::Hash[Symbol, top]?
48
-
49
- def output_definition=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top]
50
-
51
- attr_reader parent_objective_id: String?
52
-
53
- def parent_objective_id=: (String) -> String
54
-
55
- attr_reader source_schedule_id: String?
56
-
57
- def source_schedule_id=: (String) -> String
58
-
59
- attr_reader system_prompt: String?
60
-
61
- def system_prompt=: (String) -> String
62
-
63
- attr_reader variation: Cadenya::Agents::AgentVariation?
64
-
65
- def variation=: (
66
- Cadenya::Agents::AgentVariation
67
- ) -> Cadenya::Agents::AgentVariation
68
-
69
- def initialize: (
70
- ?agent: Cadenya::Agent,
71
- ?data: top,
72
- ?initial_message: String,
73
- ?memory_stack: ::Array[Cadenya::MemoryReference],
74
- ?output: ::Hash[Symbol, top],
75
- ?output_definition: ::Hash[Symbol, top],
76
- ?parent_objective_id: String,
77
- ?secrets: ::Array[Cadenya::ObjectiveDataSecret],
78
- ?source_schedule_id: String,
79
- ?system_prompt: String,
80
- ?variation: Cadenya::Agents::AgentVariation
81
- ) -> void
82
-
83
- def to_hash: -> {
84
- agent: Cadenya::Agent,
85
- data: top,
86
- initial_message: String,
87
- memory_stack: ::Array[Cadenya::MemoryReference],
88
- output: ::Hash[Symbol, top],
89
- output_definition: ::Hash[Symbol, top],
90
- parent_objective_id: String,
91
- secrets: ::Array[Cadenya::ObjectiveDataSecret],
92
- source_schedule_id: String,
93
- system_prompt: String,
94
- variation: Cadenya::Agents::AgentVariation
95
- }
96
- end
97
- end
98
- end
@@ -1,19 +0,0 @@
1
- module Cadenya
2
- module Models
3
- type objective_data_secret = { name: String, value: String }
4
-
5
- class ObjectiveDataSecret < Cadenya::Internal::Type::BaseModel
6
- attr_reader name: String?
7
-
8
- def name=: (String) -> String
9
-
10
- attr_reader value: String?
11
-
12
- def value=: (String) -> String
13
-
14
- def initialize: (?name: String, ?value: String) -> void
15
-
16
- def to_hash: -> { name: String, value: String }
17
- end
18
- end
19
- end
@@ -1,47 +0,0 @@
1
- module Cadenya
2
- module Models
3
- type objective_status =
4
- { state: Cadenya::Models::ObjectiveStatus::state, message: String }
5
-
6
- class ObjectiveStatus < Cadenya::Internal::Type::BaseModel
7
- attr_accessor state: Cadenya::Models::ObjectiveStatus::state
8
-
9
- attr_reader message: String?
10
-
11
- def message=: (String) -> String
12
-
13
- def initialize: (
14
- state: Cadenya::Models::ObjectiveStatus::state,
15
- ?message: String
16
- ) -> void
17
-
18
- def to_hash: -> {
19
- state: Cadenya::Models::ObjectiveStatus::state,
20
- message: String
21
- }
22
-
23
- type state =
24
- :STATE_UNSPECIFIED
25
- | :STATE_PENDING
26
- | :STATE_RUNNING
27
- | :STATE_WAITING
28
- | :STATE_FAILED
29
- | :STATE_CANCELLED
30
- | :STATE_FINALIZED
31
-
32
- module State
33
- extend Cadenya::Internal::Type::Enum
34
-
35
- STATE_UNSPECIFIED: :STATE_UNSPECIFIED
36
- STATE_PENDING: :STATE_PENDING
37
- STATE_RUNNING: :STATE_RUNNING
38
- STATE_WAITING: :STATE_WAITING
39
- STATE_FAILED: :STATE_FAILED
40
- STATE_CANCELLED: :STATE_CANCELLED
41
- STATE_FINALIZED: :STATE_FINALIZED
42
-
43
- def self?.values: -> ::Array[Cadenya::Models::ObjectiveStatus::state]
44
- end
45
- end
46
- end
47
- end