cadenya 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +7 -7
- data/lib/cadenya/models/agent.rb +28 -1
- data/lib/cadenya/models/agent_archive_params.rb +26 -0
- data/lib/cadenya/models/agent_entry.rb +31 -1
- data/lib/cadenya/models/agent_list_params.rb +12 -12
- data/lib/cadenya/models/agent_publish_params.rb +26 -0
- data/lib/cadenya/models/agent_schedule_entry.rb +31 -1
- data/lib/cadenya/models/agent_spec.rb +1 -24
- data/lib/cadenya/models/agent_unarchive_params.rb +26 -0
- data/lib/cadenya/models/agent_unpublish_params.rb +26 -0
- data/lib/cadenya/models/agents/agent_schedule.rb +30 -1
- data/lib/cadenya/models/agents/agent_schedule_info.rb +1 -1
- data/lib/cadenya/models/agents/agent_schedule_spec.rb +1 -24
- data/lib/cadenya/models/agents/schedule_archive_params.rb +34 -0
- data/lib/cadenya/models/agents/schedule_pause_params.rb +34 -0
- data/lib/cadenya/models/agents/schedule_resume_params.rb +34 -0
- data/lib/cadenya/models/bulk_workspace_apply_data.rb +6 -7
- data/lib/cadenya/models/model.rb +25 -1
- data/lib/cadenya/models/model_disable_params.rb +26 -0
- data/lib/cadenya/models/model_enable_params.rb +26 -0
- data/lib/cadenya/models/model_list_params.rb +11 -11
- data/lib/cadenya/models/model_spec.rb +1 -23
- data/lib/cadenya/models/resource_metadata.rb +9 -1
- data/lib/cadenya/models/tool_entry.rb +31 -1
- data/lib/cadenya/models/tool_set.rb +27 -1
- data/lib/cadenya/models/tool_set_archive_params.rb +26 -0
- data/lib/cadenya/models/tool_set_list_params.rb +26 -1
- data/lib/cadenya/models/tool_set_unarchive_params.rb +26 -0
- data/lib/cadenya/models/tool_sets/tool.rb +28 -1
- data/lib/cadenya/models/tool_sets/tool_list_params.rb +11 -12
- data/lib/cadenya/models/tool_sets/tool_omit_params.rb +34 -0
- data/lib/cadenya/models/tool_sets/tool_restore_params.rb +34 -0
- data/lib/cadenya/models/tool_sets/tool_spec.rb +3 -23
- data/lib/cadenya/models.rb +16 -2
- data/lib/cadenya/resources/account.rb +1 -1
- data/lib/cadenya/resources/agents/schedules.rb +112 -0
- data/lib/cadenya/resources/agents.rb +126 -2
- data/lib/cadenya/resources/api_keys.rb +2 -2
- data/lib/cadenya/resources/models.rb +39 -13
- data/lib/cadenya/resources/tool_sets/tools.rb +77 -3
- data/lib/cadenya/resources/tool_sets.rb +73 -2
- data/lib/cadenya/version.rb +1 -1
- data/lib/cadenya.rb +13 -1
- data/rbi/cadenya/models/agent.rbi +34 -0
- data/rbi/cadenya/models/agent_archive_params.rbi +43 -0
- data/rbi/cadenya/models/agent_entry.rbi +41 -0
- data/rbi/cadenya/models/agent_list_params.rbi +22 -31
- data/rbi/cadenya/models/agent_publish_params.rbi +43 -0
- data/rbi/cadenya/models/agent_schedule_entry.rbi +52 -3
- data/rbi/cadenya/models/agent_spec.rbi +0 -41
- data/rbi/cadenya/models/agent_unarchive_params.rbi +43 -0
- data/rbi/cadenya/models/agent_unpublish_params.rbi +43 -0
- data/rbi/cadenya/models/agents/agent_schedule.rbi +54 -0
- data/rbi/cadenya/models/agents/agent_schedule_info.rbi +2 -2
- data/rbi/cadenya/models/agents/agent_schedule_spec.rbi +0 -59
- data/rbi/cadenya/models/agents/schedule_archive_params.rbi +53 -0
- data/rbi/cadenya/models/agents/schedule_pause_params.rbi +53 -0
- data/rbi/cadenya/models/agents/schedule_resume_params.rbi +53 -0
- data/rbi/cadenya/models/bulk_workspace_apply_data.rbi +12 -14
- data/rbi/cadenya/models/model.rbi +30 -0
- data/rbi/cadenya/models/model_disable_params.rbi +43 -0
- data/rbi/cadenya/models/model_enable_params.rbi +43 -0
- data/rbi/cadenya/models/model_list_params.rbi +20 -26
- data/rbi/cadenya/models/model_spec.rbi +3 -42
- data/rbi/cadenya/models/resource_metadata.rbi +14 -3
- data/rbi/cadenya/models/tool_entry.rbi +44 -3
- data/rbi/cadenya/models/tool_set.rbi +35 -0
- data/rbi/cadenya/models/tool_set_archive_params.rbi +43 -0
- data/rbi/cadenya/models/tool_set_list_params.rbi +44 -0
- data/rbi/cadenya/models/tool_set_unarchive_params.rbi +43 -0
- data/rbi/cadenya/models/tool_sets/tool.rbi +43 -0
- data/rbi/cadenya/models/tool_sets/tool_list_params.rbi +26 -27
- data/rbi/cadenya/models/tool_sets/tool_omit_params.rbi +50 -0
- data/rbi/cadenya/models/tool_sets/tool_restore_params.rbi +53 -0
- data/rbi/cadenya/models/tool_sets/tool_spec.rbi +3 -49
- data/rbi/cadenya/models.rbi +16 -2
- data/rbi/cadenya/resources/agents/schedules.rbi +70 -0
- data/rbi/cadenya/resources/agents.rbi +79 -3
- data/rbi/cadenya/resources/models.rbi +26 -10
- data/rbi/cadenya/resources/tool_sets/tools.rbi +46 -4
- data/rbi/cadenya/resources/tool_sets.rbi +44 -0
- data/sig/cadenya/models/agent.rbs +19 -0
- data/sig/cadenya/models/agent_archive_params.rbs +28 -0
- data/sig/cadenya/models/agent_entry.rbs +23 -0
- data/sig/cadenya/models/agent_list_params.rbs +15 -18
- data/sig/cadenya/models/agent_publish_params.rbs +28 -0
- data/sig/cadenya/models/agent_schedule_entry.rbs +26 -3
- data/sig/cadenya/models/agent_spec.rbs +0 -22
- data/sig/cadenya/models/agent_unarchive_params.rbs +28 -0
- data/sig/cadenya/models/agent_unpublish_params.rbs +28 -0
- data/sig/cadenya/models/agents/agent_schedule.rbs +19 -0
- data/sig/cadenya/models/agents/agent_schedule_spec.rbs +0 -26
- data/sig/cadenya/models/agents/schedule_archive_params.rbs +34 -0
- data/sig/cadenya/models/agents/schedule_pause_params.rbs +34 -0
- data/sig/cadenya/models/agents/schedule_resume_params.rbs +34 -0
- data/sig/cadenya/models/model.rbs +17 -0
- data/sig/cadenya/models/model_disable_params.rbs +28 -0
- data/sig/cadenya/models/model_enable_params.rbs +28 -0
- data/sig/cadenya/models/model_list_params.rbs +13 -16
- data/sig/cadenya/models/model_spec.rbs +3 -27
- data/sig/cadenya/models/resource_metadata.rbs +10 -3
- data/sig/cadenya/models/tool_entry.rbs +26 -3
- data/sig/cadenya/models/tool_set.rbs +17 -0
- data/sig/cadenya/models/tool_set_archive_params.rbs +28 -0
- data/sig/cadenya/models/tool_set_list_params.rbs +22 -1
- data/sig/cadenya/models/tool_set_unarchive_params.rbs +28 -0
- data/sig/cadenya/models/tool_sets/tool.rbs +22 -0
- data/sig/cadenya/models/tool_sets/tool_list_params.rbs +18 -18
- data/sig/cadenya/models/tool_sets/tool_omit_params.rbs +34 -0
- data/sig/cadenya/models/tool_sets/tool_restore_params.rbs +34 -0
- data/sig/cadenya/models/tool_sets/tool_spec.rbs +2 -26
- data/sig/cadenya/models.rbs +16 -2
- data/sig/cadenya/resources/agents/schedules.rbs +21 -0
- data/sig/cadenya/resources/agents.rbs +25 -1
- data/sig/cadenya/resources/models.rbs +8 -3
- data/sig/cadenya/resources/tool_sets/tools.rbs +15 -1
- data/sig/cadenya/resources/tool_sets.rbs +13 -0
- metadata +41 -5
- data/lib/cadenya/models/model_set_status_params.rb +0 -48
- data/rbi/cadenya/models/model_set_status_params.rbi +0 -95
- data/sig/cadenya/models/model_set_status_params.rbs +0 -55
|
@@ -20,6 +20,12 @@ module Cadenya
|
|
|
20
20
|
sig { params(spec: Cadenya::AgentSpec::OrHash).void }
|
|
21
21
|
attr_writer :spec
|
|
22
22
|
|
|
23
|
+
# The current lifecycle state of the agent. Output only. Agents are created in
|
|
24
|
+
# STATE_DRAFT; use the :publish, :unpublish, :archive, and :unarchive actions to
|
|
25
|
+
# transition between states.
|
|
26
|
+
sig { returns(Cadenya::Agent::State::TaggedSymbol) }
|
|
27
|
+
attr_accessor :state
|
|
28
|
+
|
|
23
29
|
# AgentInfo contains simple information about an agent for display or quick
|
|
24
30
|
# reference
|
|
25
31
|
sig { returns(T.nilable(Cadenya::AgentInfo)) }
|
|
@@ -33,6 +39,7 @@ module Cadenya
|
|
|
33
39
|
params(
|
|
34
40
|
metadata: Cadenya::ResourceMetadata::OrHash,
|
|
35
41
|
spec: Cadenya::AgentSpec::OrHash,
|
|
42
|
+
state: Cadenya::Agent::State::OrSymbol,
|
|
36
43
|
info: Cadenya::AgentInfo::OrHash
|
|
37
44
|
).returns(T.attached_class)
|
|
38
45
|
end
|
|
@@ -41,6 +48,10 @@ module Cadenya
|
|
|
41
48
|
metadata:,
|
|
42
49
|
# Agent specification (user-provided configuration)
|
|
43
50
|
spec:,
|
|
51
|
+
# The current lifecycle state of the agent. Output only. Agents are created in
|
|
52
|
+
# STATE_DRAFT; use the :publish, :unpublish, :archive, and :unarchive actions to
|
|
53
|
+
# transition between states.
|
|
54
|
+
state:,
|
|
44
55
|
# AgentInfo contains simple information about an agent for display or quick
|
|
45
56
|
# reference
|
|
46
57
|
info: nil
|
|
@@ -52,12 +63,35 @@ module Cadenya
|
|
|
52
63
|
{
|
|
53
64
|
metadata: Cadenya::ResourceMetadata,
|
|
54
65
|
spec: Cadenya::AgentSpec,
|
|
66
|
+
state: Cadenya::Agent::State::TaggedSymbol,
|
|
55
67
|
info: Cadenya::AgentInfo
|
|
56
68
|
}
|
|
57
69
|
)
|
|
58
70
|
end
|
|
59
71
|
def to_hash
|
|
60
72
|
end
|
|
73
|
+
|
|
74
|
+
# The current lifecycle state of the agent. Output only. Agents are created in
|
|
75
|
+
# STATE_DRAFT; use the :publish, :unpublish, :archive, and :unarchive actions to
|
|
76
|
+
# transition between states.
|
|
77
|
+
module State
|
|
78
|
+
extend Cadenya::Internal::Type::Enum
|
|
79
|
+
|
|
80
|
+
TaggedSymbol = T.type_alias { T.all(Symbol, Cadenya::Agent::State) }
|
|
81
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
82
|
+
|
|
83
|
+
STATE_UNSPECIFIED =
|
|
84
|
+
T.let(:STATE_UNSPECIFIED, Cadenya::Agent::State::TaggedSymbol)
|
|
85
|
+
STATE_DRAFT = T.let(:STATE_DRAFT, Cadenya::Agent::State::TaggedSymbol)
|
|
86
|
+
STATE_PUBLISHED =
|
|
87
|
+
T.let(:STATE_PUBLISHED, Cadenya::Agent::State::TaggedSymbol)
|
|
88
|
+
STATE_ARCHIVED =
|
|
89
|
+
T.let(:STATE_ARCHIVED, Cadenya::Agent::State::TaggedSymbol)
|
|
90
|
+
|
|
91
|
+
sig { override.returns(T::Array[Cadenya::Agent::State::TaggedSymbol]) }
|
|
92
|
+
def self.values
|
|
93
|
+
end
|
|
94
|
+
end
|
|
61
95
|
end
|
|
62
96
|
end
|
|
63
97
|
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Cadenya
|
|
4
|
+
module Models
|
|
5
|
+
class AgentArchiveParams < 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::AgentArchiveParams, 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
|
|
@@ -33,6 +33,15 @@ module Cadenya
|
|
|
33
33
|
end
|
|
34
34
|
attr_writer :schedules
|
|
35
35
|
|
|
36
|
+
# Desired lifecycle state for the agent. Defaults to STATE_DRAFT when unspecified.
|
|
37
|
+
# STATE_PUBLISHED publishes the agent once its variations exist; see also
|
|
38
|
+
# BulkWorkspaceApplyData.automatically_publish_agents.
|
|
39
|
+
sig { returns(T.nilable(Cadenya::AgentEntry::State::OrSymbol)) }
|
|
40
|
+
attr_reader :state
|
|
41
|
+
|
|
42
|
+
sig { params(state: Cadenya::AgentEntry::State::OrSymbol).void }
|
|
43
|
+
attr_writer :state
|
|
44
|
+
|
|
36
45
|
# Variations under this agent, keyed by external_id.
|
|
37
46
|
sig { returns(T.nilable(T::Hash[Symbol, Cadenya::AgentVariationEntry])) }
|
|
38
47
|
attr_reader :variations
|
|
@@ -50,6 +59,7 @@ module Cadenya
|
|
|
50
59
|
spec: Cadenya::AgentSpec::OrHash,
|
|
51
60
|
labels: T::Hash[Symbol, String],
|
|
52
61
|
schedules: T::Hash[Symbol, Cadenya::AgentScheduleEntry::OrHash],
|
|
62
|
+
state: Cadenya::AgentEntry::State::OrSymbol,
|
|
53
63
|
variations: T::Hash[Symbol, Cadenya::AgentVariationEntry::OrHash]
|
|
54
64
|
).returns(T.attached_class)
|
|
55
65
|
end
|
|
@@ -60,6 +70,10 @@ module Cadenya
|
|
|
60
70
|
labels: nil,
|
|
61
71
|
# Schedules under this agent, keyed by external_id.
|
|
62
72
|
schedules: nil,
|
|
73
|
+
# Desired lifecycle state for the agent. Defaults to STATE_DRAFT when unspecified.
|
|
74
|
+
# STATE_PUBLISHED publishes the agent once its variations exist; see also
|
|
75
|
+
# BulkWorkspaceApplyData.automatically_publish_agents.
|
|
76
|
+
state: nil,
|
|
63
77
|
# Variations under this agent, keyed by external_id.
|
|
64
78
|
variations: nil
|
|
65
79
|
)
|
|
@@ -72,12 +86,39 @@ module Cadenya
|
|
|
72
86
|
spec: Cadenya::AgentSpec,
|
|
73
87
|
labels: T::Hash[Symbol, String],
|
|
74
88
|
schedules: T::Hash[Symbol, Cadenya::AgentScheduleEntry],
|
|
89
|
+
state: Cadenya::AgentEntry::State::OrSymbol,
|
|
75
90
|
variations: T::Hash[Symbol, Cadenya::AgentVariationEntry]
|
|
76
91
|
}
|
|
77
92
|
)
|
|
78
93
|
end
|
|
79
94
|
def to_hash
|
|
80
95
|
end
|
|
96
|
+
|
|
97
|
+
# Desired lifecycle state for the agent. Defaults to STATE_DRAFT when unspecified.
|
|
98
|
+
# STATE_PUBLISHED publishes the agent once its variations exist; see also
|
|
99
|
+
# BulkWorkspaceApplyData.automatically_publish_agents.
|
|
100
|
+
module State
|
|
101
|
+
extend Cadenya::Internal::Type::Enum
|
|
102
|
+
|
|
103
|
+
TaggedSymbol =
|
|
104
|
+
T.type_alias { T.all(Symbol, Cadenya::AgentEntry::State) }
|
|
105
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
106
|
+
|
|
107
|
+
STATE_UNSPECIFIED =
|
|
108
|
+
T.let(:STATE_UNSPECIFIED, Cadenya::AgentEntry::State::TaggedSymbol)
|
|
109
|
+
STATE_DRAFT =
|
|
110
|
+
T.let(:STATE_DRAFT, Cadenya::AgentEntry::State::TaggedSymbol)
|
|
111
|
+
STATE_PUBLISHED =
|
|
112
|
+
T.let(:STATE_PUBLISHED, Cadenya::AgentEntry::State::TaggedSymbol)
|
|
113
|
+
STATE_ARCHIVED =
|
|
114
|
+
T.let(:STATE_ARCHIVED, Cadenya::AgentEntry::State::TaggedSymbol)
|
|
115
|
+
|
|
116
|
+
sig do
|
|
117
|
+
override.returns(T::Array[Cadenya::AgentEntry::State::TaggedSymbol])
|
|
118
|
+
end
|
|
119
|
+
def self.values
|
|
120
|
+
end
|
|
121
|
+
end
|
|
81
122
|
end
|
|
82
123
|
end
|
|
83
124
|
end
|
|
@@ -64,12 +64,12 @@ module Cadenya
|
|
|
64
64
|
sig { params(sort_order: String).void }
|
|
65
65
|
attr_writer :sort_order
|
|
66
66
|
|
|
67
|
-
# Filter by agent
|
|
68
|
-
sig { returns(T.nilable(Cadenya::AgentListParams::
|
|
69
|
-
attr_reader :
|
|
67
|
+
# Filter by agent lifecycle state
|
|
68
|
+
sig { returns(T.nilable(Cadenya::AgentListParams::State::OrSymbol)) }
|
|
69
|
+
attr_reader :state
|
|
70
70
|
|
|
71
|
-
sig { params(
|
|
72
|
-
attr_writer :
|
|
71
|
+
sig { params(state: Cadenya::AgentListParams::State::OrSymbol).void }
|
|
72
|
+
attr_writer :state
|
|
73
73
|
|
|
74
74
|
# Filter by variation selection mode
|
|
75
75
|
sig do
|
|
@@ -97,7 +97,7 @@ module Cadenya
|
|
|
97
97
|
prefix: String,
|
|
98
98
|
query: String,
|
|
99
99
|
sort_order: String,
|
|
100
|
-
|
|
100
|
+
state: Cadenya::AgentListParams::State::OrSymbol,
|
|
101
101
|
variation_selection_mode:
|
|
102
102
|
Cadenya::AgentListParams::VariationSelectionMode::OrSymbol,
|
|
103
103
|
request_options: Cadenya::RequestOptions::OrHash
|
|
@@ -120,8 +120,8 @@ module Cadenya
|
|
|
120
120
|
query: nil,
|
|
121
121
|
# Sort order for results (asc or desc by creation time)
|
|
122
122
|
sort_order: nil,
|
|
123
|
-
# Filter by agent
|
|
124
|
-
|
|
123
|
+
# Filter by agent lifecycle state
|
|
124
|
+
state: nil,
|
|
125
125
|
# Filter by variation selection mode
|
|
126
126
|
variation_selection_mode: nil,
|
|
127
127
|
request_options: {}
|
|
@@ -139,7 +139,7 @@ module Cadenya
|
|
|
139
139
|
prefix: String,
|
|
140
140
|
query: String,
|
|
141
141
|
sort_order: String,
|
|
142
|
-
|
|
142
|
+
state: Cadenya::AgentListParams::State::OrSymbol,
|
|
143
143
|
variation_selection_mode:
|
|
144
144
|
Cadenya::AgentListParams::VariationSelectionMode::OrSymbol,
|
|
145
145
|
request_options: Cadenya::RequestOptions
|
|
@@ -149,38 +149,29 @@ module Cadenya
|
|
|
149
149
|
def to_hash
|
|
150
150
|
end
|
|
151
151
|
|
|
152
|
-
# Filter by agent
|
|
153
|
-
module
|
|
152
|
+
# Filter by agent lifecycle state
|
|
153
|
+
module State
|
|
154
154
|
extend Cadenya::Internal::Type::Enum
|
|
155
155
|
|
|
156
156
|
TaggedSymbol =
|
|
157
|
-
T.type_alias { T.all(Symbol, Cadenya::AgentListParams::
|
|
157
|
+
T.type_alias { T.all(Symbol, Cadenya::AgentListParams::State) }
|
|
158
158
|
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
159
159
|
|
|
160
|
-
|
|
160
|
+
STATE_UNSPECIFIED =
|
|
161
161
|
T.let(
|
|
162
|
-
:
|
|
163
|
-
Cadenya::AgentListParams::
|
|
164
|
-
)
|
|
165
|
-
AGENT_STATUS_DRAFT =
|
|
166
|
-
T.let(
|
|
167
|
-
:AGENT_STATUS_DRAFT,
|
|
168
|
-
Cadenya::AgentListParams::Status::TaggedSymbol
|
|
169
|
-
)
|
|
170
|
-
AGENT_STATUS_PUBLISHED =
|
|
171
|
-
T.let(
|
|
172
|
-
:AGENT_STATUS_PUBLISHED,
|
|
173
|
-
Cadenya::AgentListParams::Status::TaggedSymbol
|
|
174
|
-
)
|
|
175
|
-
AGENT_STATUS_ARCHIVED =
|
|
176
|
-
T.let(
|
|
177
|
-
:AGENT_STATUS_ARCHIVED,
|
|
178
|
-
Cadenya::AgentListParams::Status::TaggedSymbol
|
|
162
|
+
:STATE_UNSPECIFIED,
|
|
163
|
+
Cadenya::AgentListParams::State::TaggedSymbol
|
|
179
164
|
)
|
|
165
|
+
STATE_DRAFT =
|
|
166
|
+
T.let(:STATE_DRAFT, Cadenya::AgentListParams::State::TaggedSymbol)
|
|
167
|
+
STATE_PUBLISHED =
|
|
168
|
+
T.let(:STATE_PUBLISHED, Cadenya::AgentListParams::State::TaggedSymbol)
|
|
169
|
+
STATE_ARCHIVED =
|
|
170
|
+
T.let(:STATE_ARCHIVED, Cadenya::AgentListParams::State::TaggedSymbol)
|
|
180
171
|
|
|
181
172
|
sig do
|
|
182
173
|
override.returns(
|
|
183
|
-
T::Array[Cadenya::AgentListParams::
|
|
174
|
+
T::Array[Cadenya::AgentListParams::State::TaggedSymbol]
|
|
184
175
|
)
|
|
185
176
|
end
|
|
186
177
|
def self.values
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Cadenya
|
|
4
|
+
module Models
|
|
5
|
+
class AgentPublishParams < 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::AgentPublishParams, 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
|
|
@@ -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
|
|
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
|
|
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
|