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
@@ -24,18 +24,32 @@ module Cadenya
24
24
  sig { params(labels: T::Hash[Symbol, String]).void }
25
25
  attr_writer :labels
26
26
 
27
+ # Desired lifecycle state for the schedule. Defaults to STATE_ACTIVE when
28
+ # unspecified. Declare STATE_PAUSED to provision a schedule without it firing.
29
+ # STATE_ARCHIVED is rejected here.
30
+ sig { returns(T.nilable(Cadenya::AgentScheduleEntry::State::OrSymbol)) }
31
+ attr_reader :state
32
+
33
+ sig { params(state: Cadenya::AgentScheduleEntry::State::OrSymbol).void }
34
+ attr_writer :state
35
+
27
36
  sig do
28
37
  params(
29
38
  name: String,
30
39
  spec: Cadenya::Agents::AgentScheduleSpec::OrHash,
31
- labels: T::Hash[Symbol, String]
40
+ labels: T::Hash[Symbol, String],
41
+ state: Cadenya::AgentScheduleEntry::State::OrSymbol
32
42
  ).returns(T.attached_class)
33
43
  end
34
44
  def self.new(
35
45
  name:,
36
46
  # AgentScheduleSpec is the user-provided configuration for a schedule.
37
47
  spec:,
38
- labels: nil
48
+ labels: nil,
49
+ # Desired lifecycle state for the schedule. Defaults to STATE_ACTIVE when
50
+ # unspecified. Declare STATE_PAUSED to provision a schedule without it firing.
51
+ # STATE_ARCHIVED is rejected here.
52
+ state: nil
39
53
  )
40
54
  end
41
55
 
@@ -44,12 +58,47 @@ module Cadenya
44
58
  {
45
59
  name: String,
46
60
  spec: Cadenya::Agents::AgentScheduleSpec,
47
- labels: T::Hash[Symbol, String]
61
+ labels: T::Hash[Symbol, String],
62
+ state: Cadenya::AgentScheduleEntry::State::OrSymbol
48
63
  }
49
64
  )
50
65
  end
51
66
  def to_hash
52
67
  end
68
+
69
+ # Desired lifecycle state for the schedule. Defaults to STATE_ACTIVE when
70
+ # unspecified. Declare STATE_PAUSED to provision a schedule without it firing.
71
+ # STATE_ARCHIVED is rejected here.
72
+ module State
73
+ extend Cadenya::Internal::Type::Enum
74
+
75
+ TaggedSymbol =
76
+ T.type_alias { T.all(Symbol, Cadenya::AgentScheduleEntry::State) }
77
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
78
+
79
+ STATE_UNSPECIFIED =
80
+ T.let(
81
+ :STATE_UNSPECIFIED,
82
+ Cadenya::AgentScheduleEntry::State::TaggedSymbol
83
+ )
84
+ STATE_ACTIVE =
85
+ T.let(:STATE_ACTIVE, Cadenya::AgentScheduleEntry::State::TaggedSymbol)
86
+ STATE_PAUSED =
87
+ T.let(:STATE_PAUSED, Cadenya::AgentScheduleEntry::State::TaggedSymbol)
88
+ STATE_ARCHIVED =
89
+ T.let(
90
+ :STATE_ARCHIVED,
91
+ Cadenya::AgentScheduleEntry::State::TaggedSymbol
92
+ )
93
+
94
+ sig do
95
+ override.returns(
96
+ T::Array[Cadenya::AgentScheduleEntry::State::TaggedSymbol]
97
+ )
98
+ end
99
+ def self.values
100
+ end
101
+ end
53
102
  end
54
103
  end
55
104
  end
@@ -6,10 +6,6 @@ module Cadenya
6
6
  OrHash =
7
7
  T.type_alias { T.any(Cadenya::AgentSpec, Cadenya::Internal::AnyHash) }
8
8
 
9
- # Status of the agent
10
- sig { returns(Cadenya::AgentSpec::Status::OrSymbol) }
11
- attr_accessor :status
12
-
13
9
  # Controls how variations are automatically selected when creating objectives
14
10
  # Defaults to RANDOM when unspecified
15
11
  sig { returns(Cadenya::AgentSpec::VariationSelectionMode::OrSymbol) }
@@ -53,7 +49,6 @@ module Cadenya
53
49
  # Agent specification (user-provided configuration)
54
50
  sig do
55
51
  params(
56
- status: Cadenya::AgentSpec::Status::OrSymbol,
57
52
  variation_selection_mode:
58
53
  Cadenya::AgentSpec::VariationSelectionMode::OrSymbol,
59
54
  description: String,
@@ -63,8 +58,6 @@ module Cadenya
63
58
  ).returns(T.attached_class)
64
59
  end
65
60
  def self.new(
66
- # Status of the agent
67
- status:,
68
61
  # Controls how variations are automatically selected when creating objectives
69
62
  # Defaults to RANDOM when unspecified
70
63
  variation_selection_mode:,
@@ -89,7 +82,6 @@ module Cadenya
89
82
  sig do
90
83
  override.returns(
91
84
  {
92
- status: Cadenya::AgentSpec::Status::OrSymbol,
93
85
  variation_selection_mode:
94
86
  Cadenya::AgentSpec::VariationSelectionMode::OrSymbol,
95
87
  description: String,
@@ -102,39 +94,6 @@ module Cadenya
102
94
  def to_hash
103
95
  end
104
96
 
105
- # Status of the agent
106
- module Status
107
- extend Cadenya::Internal::Type::Enum
108
-
109
- TaggedSymbol =
110
- T.type_alias { T.all(Symbol, Cadenya::AgentSpec::Status) }
111
- OrSymbol = T.type_alias { T.any(Symbol, String) }
112
-
113
- AGENT_STATUS_UNSPECIFIED =
114
- T.let(
115
- :AGENT_STATUS_UNSPECIFIED,
116
- Cadenya::AgentSpec::Status::TaggedSymbol
117
- )
118
- AGENT_STATUS_DRAFT =
119
- T.let(:AGENT_STATUS_DRAFT, Cadenya::AgentSpec::Status::TaggedSymbol)
120
- AGENT_STATUS_PUBLISHED =
121
- T.let(
122
- :AGENT_STATUS_PUBLISHED,
123
- Cadenya::AgentSpec::Status::TaggedSymbol
124
- )
125
- AGENT_STATUS_ARCHIVED =
126
- T.let(
127
- :AGENT_STATUS_ARCHIVED,
128
- Cadenya::AgentSpec::Status::TaggedSymbol
129
- )
130
-
131
- sig do
132
- override.returns(T::Array[Cadenya::AgentSpec::Status::TaggedSymbol])
133
- end
134
- def self.values
135
- end
136
- end
137
-
138
97
  # Controls how variations are automatically selected when creating objectives
139
98
  # Defaults to RANDOM when unspecified
140
99
  module VariationSelectionMode
@@ -0,0 +1,43 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Models
5
+ class AgentUnarchiveParams < Cadenya::Internal::Type::BaseModel
6
+ extend Cadenya::Internal::Type::RequestParameters::Converter
7
+ include Cadenya::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(Cadenya::AgentUnarchiveParams, Cadenya::Internal::AnyHash)
12
+ end
13
+
14
+ sig { returns(String) }
15
+ attr_accessor :workspace_id
16
+
17
+ sig { returns(String) }
18
+ attr_accessor :id
19
+
20
+ sig do
21
+ params(
22
+ workspace_id: String,
23
+ id: String,
24
+ request_options: Cadenya::RequestOptions::OrHash
25
+ ).returns(T.attached_class)
26
+ end
27
+ def self.new(workspace_id:, id:, request_options: {})
28
+ end
29
+
30
+ sig do
31
+ override.returns(
32
+ {
33
+ workspace_id: String,
34
+ id: String,
35
+ request_options: Cadenya::RequestOptions
36
+ }
37
+ )
38
+ end
39
+ def to_hash
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,43 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Models
5
+ class AgentUnpublishParams < Cadenya::Internal::Type::BaseModel
6
+ extend Cadenya::Internal::Type::RequestParameters::Converter
7
+ include Cadenya::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(Cadenya::AgentUnpublishParams, Cadenya::Internal::AnyHash)
12
+ end
13
+
14
+ sig { returns(String) }
15
+ attr_accessor :workspace_id
16
+
17
+ sig { returns(String) }
18
+ attr_accessor :id
19
+
20
+ sig do
21
+ params(
22
+ workspace_id: String,
23
+ id: String,
24
+ request_options: Cadenya::RequestOptions::OrHash
25
+ ).returns(T.attached_class)
26
+ end
27
+ def self.new(workspace_id:, id:, request_options: {})
28
+ end
29
+
30
+ sig do
31
+ override.returns(
32
+ {
33
+ workspace_id: String,
34
+ id: String,
35
+ request_options: Cadenya::RequestOptions
36
+ }
37
+ )
38
+ end
39
+ def to_hash
40
+ end
41
+ end
42
+ end
43
+ end
@@ -32,12 +32,19 @@ module Cadenya
32
32
  sig { params(info: Cadenya::Agents::AgentScheduleInfo::OrHash).void }
33
33
  attr_writer :info
34
34
 
35
+ # The current lifecycle state of the schedule. Output only. Schedules are created
36
+ # STATE_ACTIVE; use the :pause, :resume, and :archive actions to transition
37
+ # between states.
38
+ sig { returns(Cadenya::Agents::AgentSchedule::State::TaggedSymbol) }
39
+ attr_accessor :state
40
+
35
41
  # AgentSchedule resource — a recurring trigger attached to an agent that creates
36
42
  # objectives on its cadence.
37
43
  sig do
38
44
  params(
39
45
  metadata: Cadenya::ResourceMetadata::OrHash,
40
46
  spec: Cadenya::Agents::AgentScheduleSpec::OrHash,
47
+ state: Cadenya::Agents::AgentSchedule::State::OrSymbol,
41
48
  info: Cadenya::Agents::AgentScheduleInfo::OrHash
42
49
  ).returns(T.attached_class)
43
50
  end
@@ -46,6 +53,10 @@ module Cadenya
46
53
  metadata:,
47
54
  # AgentScheduleSpec is the user-provided configuration for a schedule.
48
55
  spec:,
56
+ # The current lifecycle state of the schedule. Output only. Schedules are created
57
+ # STATE_ACTIVE; use the :pause, :resume, and :archive actions to transition
58
+ # between states.
59
+ state:,
49
60
  # AgentScheduleInfo provides read-only runtime data about a schedule.
50
61
  info: nil
51
62
  )
@@ -56,12 +67,55 @@ module Cadenya
56
67
  {
57
68
  metadata: Cadenya::ResourceMetadata,
58
69
  spec: Cadenya::Agents::AgentScheduleSpec,
70
+ state: Cadenya::Agents::AgentSchedule::State::TaggedSymbol,
59
71
  info: Cadenya::Agents::AgentScheduleInfo
60
72
  }
61
73
  )
62
74
  end
63
75
  def to_hash
64
76
  end
77
+
78
+ # The current lifecycle state of the schedule. Output only. Schedules are created
79
+ # STATE_ACTIVE; use the :pause, :resume, and :archive actions to transition
80
+ # between states.
81
+ module State
82
+ extend Cadenya::Internal::Type::Enum
83
+
84
+ TaggedSymbol =
85
+ T.type_alias do
86
+ T.all(Symbol, Cadenya::Agents::AgentSchedule::State)
87
+ end
88
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
89
+
90
+ STATE_UNSPECIFIED =
91
+ T.let(
92
+ :STATE_UNSPECIFIED,
93
+ Cadenya::Agents::AgentSchedule::State::TaggedSymbol
94
+ )
95
+ STATE_ACTIVE =
96
+ T.let(
97
+ :STATE_ACTIVE,
98
+ Cadenya::Agents::AgentSchedule::State::TaggedSymbol
99
+ )
100
+ STATE_PAUSED =
101
+ T.let(
102
+ :STATE_PAUSED,
103
+ Cadenya::Agents::AgentSchedule::State::TaggedSymbol
104
+ )
105
+ STATE_ARCHIVED =
106
+ T.let(
107
+ :STATE_ARCHIVED,
108
+ Cadenya::Agents::AgentSchedule::State::TaggedSymbol
109
+ )
110
+
111
+ sig do
112
+ override.returns(
113
+ T::Array[Cadenya::Agents::AgentSchedule::State::TaggedSymbol]
114
+ )
115
+ end
116
+ def self.values
117
+ end
118
+ end
65
119
  end
66
120
  end
67
121
  end
@@ -52,7 +52,7 @@ module Cadenya
52
52
  attr_writer :last_skip_reason
53
53
 
54
54
  # When the schedule will next fire. Computed from the spec; absent when the
55
- # schedule is PAUSED/ARCHIVED or has no future fire times.
55
+ # schedule is STATE_PAUSED/STATE_ARCHIVED or has no future fire times.
56
56
  sig { returns(T.nilable(Time)) }
57
57
  attr_reader :next_fire_at
58
58
 
@@ -92,7 +92,7 @@ module Cadenya
92
92
  # Reason for the most recent skip (e.g. "previous objective still running").
93
93
  last_skip_reason: nil,
94
94
  # When the schedule will next fire. Computed from the spec; absent when the
95
- # schedule is PAUSED/ARCHIVED or has no future fire times.
95
+ # schedule is STATE_PAUSED/STATE_ARCHIVED or has no future fire times.
96
96
  next_fire_at: nil,
97
97
  # Lifetime count of objectives created by this schedule.
98
98
  total_fires: nil
@@ -14,11 +14,6 @@ module Cadenya
14
14
  )
15
15
  end
16
16
 
17
- # The initial message passed to CreateObjective on each fire. Becomes the first
18
- # user message in the objective's chat history.
19
- sig { returns(String) }
20
- attr_accessor :initial_message
21
-
22
17
  # Schedule defines WHEN the schedule fires. Temporal-style structured form: a list
23
18
  # of calendar rules (wall-clock) and/or interval rules (duration), OR'd together.
24
19
  # At least one rule is required.
@@ -40,6 +35,15 @@ module Cadenya
40
35
  sig { params(data: T.anything).void }
41
36
  attr_writer :data
42
37
 
38
+ # Optional initial message passed to CreateObjective on each fire. Becomes the
39
+ # first user message in the objective's chat history. When unset, the fired
40
+ # objective defers to the selected variation's user_message_template.
41
+ sig { returns(T.nilable(String)) }
42
+ attr_reader :initial_message
43
+
44
+ sig { params(initial_message: String).void }
45
+ attr_writer :initial_message
46
+
43
47
  # What to do when the previous run is still in flight. Defaults to SKIP.
44
48
  sig do
45
49
  returns(
@@ -58,20 +62,14 @@ module Cadenya
58
62
  end
59
63
  attr_writer :overlap_policy
60
64
 
61
- # Lifecycle. Defaults to ACTIVE on create when unspecified.
62
- sig do
63
- returns(
64
- T.nilable(Cadenya::Agents::AgentScheduleSpec::Status::OrSymbol)
65
- )
66
- end
67
- attr_reader :status
65
+ # Optional data rendered into the variation's user_message_template when each
66
+ # fired objective is created. Separate from `data`, which renders the system
67
+ # prompt template.
68
+ sig { returns(T.nilable(T.anything)) }
69
+ attr_reader :user_data
68
70
 
69
- sig do
70
- params(
71
- status: Cadenya::Agents::AgentScheduleSpec::Status::OrSymbol
72
- ).void
73
- end
74
- attr_writer :status
71
+ sig { params(user_data: T.anything).void }
72
+ attr_writer :user_data
75
73
 
76
74
  # Optional explicit variation. When unset, the agent's variation_selection_mode
77
75
  # chooses per fire.
@@ -84,19 +82,16 @@ module Cadenya
84
82
  # AgentScheduleSpec is the user-provided configuration for a schedule.
85
83
  sig do
86
84
  params(
87
- initial_message: String,
88
85
  schedule: Cadenya::Agents::AgentScheduleSpecSchedule::OrHash,
89
86
  data: T.anything,
87
+ initial_message: String,
90
88
  overlap_policy:
91
89
  Cadenya::Agents::AgentScheduleSpec::OverlapPolicy::OrSymbol,
92
- status: Cadenya::Agents::AgentScheduleSpec::Status::OrSymbol,
90
+ user_data: T.anything,
93
91
  variation_id: String
94
92
  ).returns(T.attached_class)
95
93
  end
96
94
  def self.new(
97
- # The initial message passed to CreateObjective on each fire. Becomes the first
98
- # user message in the objective's chat history.
99
- initial_message:,
100
95
  # Schedule defines WHEN the schedule fires. Temporal-style structured form: a list
101
96
  # of calendar rules (wall-clock) and/or interval rules (duration), OR'd together.
102
97
  # At least one rule is required.
@@ -104,10 +99,16 @@ module Cadenya
104
99
  # Optional input data passed to the objective. If the agent has an
105
100
  # input_data_schema, this must satisfy it.
106
101
  data: nil,
102
+ # Optional initial message passed to CreateObjective on each fire. Becomes the
103
+ # first user message in the objective's chat history. When unset, the fired
104
+ # objective defers to the selected variation's user_message_template.
105
+ initial_message: nil,
107
106
  # What to do when the previous run is still in flight. Defaults to SKIP.
108
107
  overlap_policy: nil,
109
- # Lifecycle. Defaults to ACTIVE on create when unspecified.
110
- status: nil,
108
+ # Optional data rendered into the variation's user_message_template when each
109
+ # fired objective is created. Separate from `data`, which renders the system
110
+ # prompt template.
111
+ user_data: nil,
111
112
  # Optional explicit variation. When unset, the agent's variation_selection_mode
112
113
  # chooses per fire.
113
114
  variation_id: nil
@@ -117,12 +118,12 @@ module Cadenya
117
118
  sig do
118
119
  override.returns(
119
120
  {
120
- initial_message: String,
121
121
  schedule: Cadenya::Agents::AgentScheduleSpecSchedule,
122
122
  data: T.anything,
123
+ initial_message: String,
123
124
  overlap_policy:
124
125
  Cadenya::Agents::AgentScheduleSpec::OverlapPolicy::OrSymbol,
125
- status: Cadenya::Agents::AgentScheduleSpec::Status::OrSymbol,
126
+ user_data: T.anything,
126
127
  variation_id: String
127
128
  }
128
129
  )
@@ -166,46 +167,6 @@ module Cadenya
166
167
  def self.values
167
168
  end
168
169
  end
169
-
170
- # Lifecycle. Defaults to ACTIVE on create when unspecified.
171
- module Status
172
- extend Cadenya::Internal::Type::Enum
173
-
174
- TaggedSymbol =
175
- T.type_alias do
176
- T.all(Symbol, Cadenya::Agents::AgentScheduleSpec::Status)
177
- end
178
- OrSymbol = T.type_alias { T.any(Symbol, String) }
179
-
180
- AGENT_SCHEDULE_STATUS_UNSPECIFIED =
181
- T.let(
182
- :AGENT_SCHEDULE_STATUS_UNSPECIFIED,
183
- Cadenya::Agents::AgentScheduleSpec::Status::TaggedSymbol
184
- )
185
- AGENT_SCHEDULE_STATUS_ACTIVE =
186
- T.let(
187
- :AGENT_SCHEDULE_STATUS_ACTIVE,
188
- Cadenya::Agents::AgentScheduleSpec::Status::TaggedSymbol
189
- )
190
- AGENT_SCHEDULE_STATUS_PAUSED =
191
- T.let(
192
- :AGENT_SCHEDULE_STATUS_PAUSED,
193
- Cadenya::Agents::AgentScheduleSpec::Status::TaggedSymbol
194
- )
195
- AGENT_SCHEDULE_STATUS_ARCHIVED =
196
- T.let(
197
- :AGENT_SCHEDULE_STATUS_ARCHIVED,
198
- Cadenya::Agents::AgentScheduleSpec::Status::TaggedSymbol
199
- )
200
-
201
- sig do
202
- override.returns(
203
- T::Array[Cadenya::Agents::AgentScheduleSpec::Status::TaggedSymbol]
204
- )
205
- end
206
- def self.values
207
- end
208
- end
209
170
  end
210
171
  end
211
172
  end
@@ -103,12 +103,24 @@ module Cadenya
103
103
  end
104
104
  attr_writer :progressive_discovery
105
105
 
106
- # The system prompt for this variation
106
+ # Liquid template for the system prompt of objectives using this variation.
107
+ # Rendered with CreateObjectiveRequest.data into Objective.system_prompt.
107
108
  sig { returns(T.nilable(String)) }
108
- attr_reader :prompt
109
+ attr_reader :system_prompt_template
109
110
 
110
- sig { params(prompt: String).void }
111
- attr_writer :prompt
111
+ sig { params(system_prompt_template: String).void }
112
+ attr_writer :system_prompt_template
113
+
114
+ # Liquid template for the initial user message of objectives using this variation.
115
+ # Rendered with CreateObjectiveRequest.user_data and becomes the first user
116
+ # message in the LLM chat history. CreateObjectiveRequest.initial_message, when
117
+ # set, overrides the rendered result. If neither this template nor initial_message
118
+ # is present, objective creation is rejected with InvalidArgument.
119
+ sig { returns(T.nilable(String)) }
120
+ attr_reader :user_message_template
121
+
122
+ sig { params(user_message_template: String).void }
123
+ attr_writer :user_message_template
112
124
 
113
125
  # Weight for weighted random selection (>= 0). P(v) = v.weight / sum(all_weights).
114
126
  # Only used when the agent's variation_selection_mode is WEIGHTED. A weight of 0
@@ -133,7 +145,8 @@ module Cadenya
133
145
  Cadenya::Agents::AgentVariationSpecModelConfig::OrHash,
134
146
  progressive_discovery:
135
147
  Cadenya::Agents::AgentVariationSpecProgressiveDiscovery::OrHash,
136
- prompt: String,
148
+ system_prompt_template: String,
149
+ user_message_template: String,
137
150
  weight: Integer
138
151
  ).returns(T.attached_class)
139
152
  end
@@ -162,8 +175,15 @@ module Cadenya
162
175
  # tool search. These are used in conjunction with the context-aware tool search
163
176
  # and can help select the best tools for the task.
164
177
  progressive_discovery: nil,
165
- # The system prompt for this variation
166
- prompt: nil,
178
+ # Liquid template for the system prompt of objectives using this variation.
179
+ # Rendered with CreateObjectiveRequest.data into Objective.system_prompt.
180
+ system_prompt_template: nil,
181
+ # Liquid template for the initial user message of objectives using this variation.
182
+ # Rendered with CreateObjectiveRequest.user_data and becomes the first user
183
+ # message in the LLM chat history. CreateObjectiveRequest.initial_message, when
184
+ # set, overrides the rendered result. If neither this template nor initial_message
185
+ # is present, objective creation is rejected with InvalidArgument.
186
+ user_message_template: nil,
167
187
  # Weight for weighted random selection (>= 0). P(v) = v.weight / sum(all_weights).
168
188
  # Only used when the agent's variation_selection_mode is WEIGHTED. A weight of 0
169
189
  # means never auto-selected, but can still be chosen explicitly via variation_id
@@ -184,7 +204,8 @@ module Cadenya
184
204
  model_config: Cadenya::Agents::AgentVariationSpecModelConfig,
185
205
  progressive_discovery:
186
206
  Cadenya::Agents::AgentVariationSpecProgressiveDiscovery,
187
- prompt: String,
207
+ system_prompt_template: String,
208
+ user_message_template: String,
188
209
  weight: Integer
189
210
  }
190
211
  )
@@ -0,0 +1,53 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Models
5
+ module Agents
6
+ class ScheduleArchiveParams < Cadenya::Internal::Type::BaseModel
7
+ extend Cadenya::Internal::Type::RequestParameters::Converter
8
+ include Cadenya::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Cadenya::Agents::ScheduleArchiveParams,
14
+ Cadenya::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :workspace_id
20
+
21
+ sig { returns(String) }
22
+ attr_accessor :agent_id
23
+
24
+ sig { returns(String) }
25
+ attr_accessor :id
26
+
27
+ sig do
28
+ params(
29
+ workspace_id: String,
30
+ agent_id: String,
31
+ id: String,
32
+ request_options: Cadenya::RequestOptions::OrHash
33
+ ).returns(T.attached_class)
34
+ end
35
+ def self.new(workspace_id:, agent_id:, id:, request_options: {})
36
+ end
37
+
38
+ sig do
39
+ override.returns(
40
+ {
41
+ workspace_id: String,
42
+ agent_id: String,
43
+ id: String,
44
+ request_options: Cadenya::RequestOptions
45
+ }
46
+ )
47
+ end
48
+ def to_hash
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,53 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Models
5
+ module Agents
6
+ class SchedulePauseParams < Cadenya::Internal::Type::BaseModel
7
+ extend Cadenya::Internal::Type::RequestParameters::Converter
8
+ include Cadenya::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Cadenya::Agents::SchedulePauseParams,
14
+ Cadenya::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :workspace_id
20
+
21
+ sig { returns(String) }
22
+ attr_accessor :agent_id
23
+
24
+ sig { returns(String) }
25
+ attr_accessor :id
26
+
27
+ sig do
28
+ params(
29
+ workspace_id: String,
30
+ agent_id: String,
31
+ id: String,
32
+ request_options: Cadenya::RequestOptions::OrHash
33
+ ).returns(T.attached_class)
34
+ end
35
+ def self.new(workspace_id:, agent_id:, id:, request_options: {})
36
+ end
37
+
38
+ sig do
39
+ override.returns(
40
+ {
41
+ workspace_id: String,
42
+ agent_id: String,
43
+ id: String,
44
+ request_options: Cadenya::RequestOptions
45
+ }
46
+ )
47
+ end
48
+ def to_hash
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end