cadenya 0.17.0 → 0.18.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 +1 -1
- data/lib/cadenya/models/objectives/objective_tool_call_data.rb +11 -1
- data/lib/cadenya/models/objectives/objective_tool_call_info.rb +27 -1
- data/lib/cadenya/models/objectives/objective_tool_call_with_result.rb +11 -1
- data/lib/cadenya/models/objectives/resolved_secret.rb +43 -0
- data/lib/cadenya/models/tool_sets/secret_create_params.rb +50 -0
- data/lib/cadenya/models/tool_sets/secret_delete_params.rb +34 -0
- data/lib/cadenya/models/tool_sets/secret_list_params.rb +86 -0
- data/lib/cadenya/models/tool_sets/secret_retrieve_params.rb +34 -0
- data/lib/cadenya/models/tool_sets/secret_update_params.rb +65 -0
- data/lib/cadenya/models/tool_sets/tool_set_secret.rb +41 -0
- data/lib/cadenya/models/tool_sets/tool_set_secret_info.rb +34 -0
- data/lib/cadenya/models/tool_sets/tool_set_secret_spec.rb +19 -0
- data/lib/cadenya/resources/tool_sets/secrets.rb +224 -0
- data/lib/cadenya/resources/tool_sets.rb +9 -0
- data/lib/cadenya/version.rb +1 -1
- data/lib/cadenya.rb +10 -0
- data/rbi/cadenya/models/objectives/objective_tool_call_data.rbi +19 -0
- data/rbi/cadenya/models/objectives/objective_tool_call_info.rbi +45 -3
- data/rbi/cadenya/models/objectives/objective_tool_call_with_result.rbi +19 -0
- data/rbi/cadenya/models/objectives/resolved_secret.rbi +104 -0
- data/rbi/cadenya/models/tool_sets/secret_create_params.rbi +76 -0
- data/rbi/cadenya/models/tool_sets/secret_delete_params.rbi +53 -0
- data/rbi/cadenya/models/tool_sets/secret_list_params.rbi +129 -0
- data/rbi/cadenya/models/tool_sets/secret_retrieve_params.rbi +53 -0
- data/rbi/cadenya/models/tool_sets/secret_update_params.rbi +93 -0
- data/rbi/cadenya/models/tool_sets/tool_set_secret.rbi +64 -0
- data/rbi/cadenya/models/tool_sets/tool_set_secret_info.rbi +55 -0
- data/rbi/cadenya/models/tool_sets/tool_set_secret_spec.rbi +33 -0
- data/rbi/cadenya/resources/tool_sets/secrets.rbi +164 -0
- data/rbi/cadenya/resources/tool_sets.rbi +8 -0
- data/sig/cadenya/models/objectives/objective_tool_call_data.rbs +9 -0
- data/sig/cadenya/models/objectives/objective_tool_call_info.rbs +20 -3
- data/sig/cadenya/models/objectives/objective_tool_call_with_result.rbs +9 -0
- data/sig/cadenya/models/objectives/resolved_secret.rbs +50 -0
- data/sig/cadenya/models/tool_sets/secret_create_params.rbs +43 -0
- data/sig/cadenya/models/tool_sets/secret_delete_params.rbs +34 -0
- data/sig/cadenya/models/tool_sets/secret_list_params.rbs +82 -0
- data/sig/cadenya/models/tool_sets/secret_retrieve_params.rbs +34 -0
- data/sig/cadenya/models/tool_sets/secret_update_params.rbs +63 -0
- data/sig/cadenya/models/tool_sets/tool_set_secret.rbs +38 -0
- data/sig/cadenya/models/tool_sets/tool_set_secret_info.rbs +27 -0
- data/sig/cadenya/models/tool_sets/tool_set_secret_spec.rbs +19 -0
- data/sig/cadenya/resources/tool_sets/secrets.rbs +54 -0
- data/sig/cadenya/resources/tool_sets.rbs +2 -0
- metadata +32 -2
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Cadenya
|
|
4
|
+
module Resources
|
|
5
|
+
class ToolSets
|
|
6
|
+
# Manage tool sets and the tools they contain. Tool sets group related tools, and
|
|
7
|
+
# tools define specific capabilities available to agents.
|
|
8
|
+
#
|
|
9
|
+
# When a tool set is managed, only API key actors can modify its tools; human
|
|
10
|
+
# (profile) actors cannot.
|
|
11
|
+
class Secrets
|
|
12
|
+
# Some parameter documentations has been truncated, see
|
|
13
|
+
# {Cadenya::Models::ToolSets::SecretCreateParams} for more details.
|
|
14
|
+
#
|
|
15
|
+
# Creates a new secret scoped to the tool set
|
|
16
|
+
#
|
|
17
|
+
# @overload create(tool_set_id, workspace_id:, metadata:, spec:, request_options: {})
|
|
18
|
+
#
|
|
19
|
+
# @param tool_set_id [String] Path param: The tool set that will own this secret. Accepts the canonical ts\_…
|
|
20
|
+
# f
|
|
21
|
+
#
|
|
22
|
+
# @param workspace_id [String] Path param: The workspace that owns the tool set.
|
|
23
|
+
#
|
|
24
|
+
# @param metadata [Cadenya::Models::CreateResourceMetadata] Body param: CreateResourceMetadata contains the user-provided fields for creatin
|
|
25
|
+
#
|
|
26
|
+
# @param spec [Cadenya::Models::ToolSets::ToolSetSecretSpec] Body param
|
|
27
|
+
#
|
|
28
|
+
# @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
29
|
+
#
|
|
30
|
+
# @return [Cadenya::Models::ToolSets::ToolSetSecret]
|
|
31
|
+
#
|
|
32
|
+
# @see Cadenya::Models::ToolSets::SecretCreateParams
|
|
33
|
+
def create(tool_set_id, params)
|
|
34
|
+
parsed, options = Cadenya::ToolSets::SecretCreateParams.dump_request(params)
|
|
35
|
+
workspace_id =
|
|
36
|
+
parsed.delete(:workspace_id) do
|
|
37
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
38
|
+
end
|
|
39
|
+
@client.request(
|
|
40
|
+
method: :post,
|
|
41
|
+
path: ["v1/workspaces/%1$s/tool_sets/%2$s/secrets", workspace_id, tool_set_id],
|
|
42
|
+
body: parsed,
|
|
43
|
+
model: Cadenya::ToolSets::ToolSetSecret,
|
|
44
|
+
options: options
|
|
45
|
+
)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Some parameter documentations has been truncated, see
|
|
49
|
+
# {Cadenya::Models::ToolSets::SecretRetrieveParams} for more details.
|
|
50
|
+
#
|
|
51
|
+
# Retrieves a tool set secret by ID from the tool set
|
|
52
|
+
#
|
|
53
|
+
# @overload retrieve(id, workspace_id:, tool_set_id:, request_options: {})
|
|
54
|
+
#
|
|
55
|
+
# @param id [String] The secret to retrieve.
|
|
56
|
+
#
|
|
57
|
+
# @param workspace_id [String] The workspace that owns the tool set.
|
|
58
|
+
#
|
|
59
|
+
# @param tool_set_id [String] The tool set the secret belongs to. Accepts the canonical ts\_… form
|
|
60
|
+
#
|
|
61
|
+
# @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
62
|
+
#
|
|
63
|
+
# @return [Cadenya::Models::ToolSets::ToolSetSecret]
|
|
64
|
+
#
|
|
65
|
+
# @see Cadenya::Models::ToolSets::SecretRetrieveParams
|
|
66
|
+
def retrieve(id, params)
|
|
67
|
+
parsed, options = Cadenya::ToolSets::SecretRetrieveParams.dump_request(params)
|
|
68
|
+
workspace_id =
|
|
69
|
+
parsed.delete(:workspace_id) do
|
|
70
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
71
|
+
end
|
|
72
|
+
tool_set_id =
|
|
73
|
+
parsed.delete(:tool_set_id) do
|
|
74
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
75
|
+
end
|
|
76
|
+
@client.request(
|
|
77
|
+
method: :get,
|
|
78
|
+
path: ["v1/workspaces/%1$s/tool_sets/%2$s/secrets/%3$s", workspace_id, tool_set_id, id],
|
|
79
|
+
model: Cadenya::ToolSets::ToolSetSecret,
|
|
80
|
+
options: options
|
|
81
|
+
)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Some parameter documentations has been truncated, see
|
|
85
|
+
# {Cadenya::Models::ToolSets::SecretUpdateParams} for more details.
|
|
86
|
+
#
|
|
87
|
+
# Updates a secret scoped to the tool set
|
|
88
|
+
#
|
|
89
|
+
# @overload update(id, workspace_id:, tool_set_id:, metadata: nil, spec: nil, update_mask: nil, request_options: {})
|
|
90
|
+
#
|
|
91
|
+
# @param id [String] Path param: The secret to update.
|
|
92
|
+
#
|
|
93
|
+
# @param workspace_id [String] Path param: The workspace that owns the tool set.
|
|
94
|
+
#
|
|
95
|
+
# @param tool_set_id [String] Path param: The tool set the secret belongs to. Accepts the canonical ts\_… form
|
|
96
|
+
#
|
|
97
|
+
# @param metadata [Cadenya::Models::UpdateResourceMetadata] Body param: UpdateResourceMetadata contains the user-provided fields for updatin
|
|
98
|
+
#
|
|
99
|
+
# @param spec [Cadenya::Models::ToolSets::ToolSetSecretSpec] Body param
|
|
100
|
+
#
|
|
101
|
+
# @param update_mask [String] Body param: Fields to update.
|
|
102
|
+
#
|
|
103
|
+
# @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
104
|
+
#
|
|
105
|
+
# @return [Cadenya::Models::ToolSets::ToolSetSecret]
|
|
106
|
+
#
|
|
107
|
+
# @see Cadenya::Models::ToolSets::SecretUpdateParams
|
|
108
|
+
def update(id, params)
|
|
109
|
+
parsed, options = Cadenya::ToolSets::SecretUpdateParams.dump_request(params)
|
|
110
|
+
workspace_id =
|
|
111
|
+
parsed.delete(:workspace_id) do
|
|
112
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
113
|
+
end
|
|
114
|
+
tool_set_id =
|
|
115
|
+
parsed.delete(:tool_set_id) do
|
|
116
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
117
|
+
end
|
|
118
|
+
@client.request(
|
|
119
|
+
method: :patch,
|
|
120
|
+
path: ["v1/workspaces/%1$s/tool_sets/%2$s/secrets/%3$s", workspace_id, tool_set_id, id],
|
|
121
|
+
body: parsed,
|
|
122
|
+
model: Cadenya::ToolSets::ToolSetSecret,
|
|
123
|
+
options: options
|
|
124
|
+
)
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Some parameter documentations has been truncated, see
|
|
128
|
+
# {Cadenya::Models::ToolSets::SecretListParams} for more details.
|
|
129
|
+
#
|
|
130
|
+
# Lists all secrets scoped to the tool set
|
|
131
|
+
#
|
|
132
|
+
# @overload list(tool_set_id, workspace_id:, bundle_key: nil, cursor: nil, include_info: nil, limit: nil, prefix: nil, query: nil, sort_order: nil, request_options: {})
|
|
133
|
+
#
|
|
134
|
+
# @param tool_set_id [String] Path param: The tool set whose secrets will be listed. Accepts the canonical
|
|
135
|
+
# ts\_
|
|
136
|
+
#
|
|
137
|
+
# @param workspace_id [String] Path param: The workspace that owns the tool set.
|
|
138
|
+
#
|
|
139
|
+
# @param bundle_key [String] Query param: Filter by bundle_key — return only resources owned by this bundle.
|
|
140
|
+
#
|
|
141
|
+
# @param cursor [String] Query param: Pagination cursor from previous response
|
|
142
|
+
#
|
|
143
|
+
# @param include_info [Boolean] Query param: When set to true you may use more of your alloted API rate-limit
|
|
144
|
+
#
|
|
145
|
+
# @param limit [Integer] Query param: Maximum number of results to return
|
|
146
|
+
#
|
|
147
|
+
# @param prefix [String] Query param: Filter expression (query param: prefix)
|
|
148
|
+
#
|
|
149
|
+
# @param query [String] Query param: Free-form search query
|
|
150
|
+
#
|
|
151
|
+
# @param sort_order [String] Query param: Sort order for results (asc or desc by creation time)
|
|
152
|
+
#
|
|
153
|
+
# @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
154
|
+
#
|
|
155
|
+
# @return [Cadenya::Internal::CursorPagination<Cadenya::Models::ToolSets::ToolSetSecret>]
|
|
156
|
+
#
|
|
157
|
+
# @see Cadenya::Models::ToolSets::SecretListParams
|
|
158
|
+
def list(tool_set_id, params)
|
|
159
|
+
parsed, options = Cadenya::ToolSets::SecretListParams.dump_request(params)
|
|
160
|
+
query = Cadenya::Internal::Util.encode_query_params(parsed)
|
|
161
|
+
workspace_id =
|
|
162
|
+
parsed.delete(:workspace_id) do
|
|
163
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
164
|
+
end
|
|
165
|
+
@client.request(
|
|
166
|
+
method: :get,
|
|
167
|
+
path: ["v1/workspaces/%1$s/tool_sets/%2$s/secrets", workspace_id, tool_set_id],
|
|
168
|
+
query: query.transform_keys(
|
|
169
|
+
bundle_key: "bundleKey",
|
|
170
|
+
include_info: "includeInfo",
|
|
171
|
+
sort_order: "sortOrder"
|
|
172
|
+
),
|
|
173
|
+
page: Cadenya::Internal::CursorPagination,
|
|
174
|
+
model: Cadenya::ToolSets::ToolSetSecret,
|
|
175
|
+
options: options
|
|
176
|
+
)
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Some parameter documentations has been truncated, see
|
|
180
|
+
# {Cadenya::Models::ToolSets::SecretDeleteParams} for more details.
|
|
181
|
+
#
|
|
182
|
+
# Deletes a secret scoped to the tool set
|
|
183
|
+
#
|
|
184
|
+
# @overload delete(id, workspace_id:, tool_set_id:, request_options: {})
|
|
185
|
+
#
|
|
186
|
+
# @param id [String] The secret to delete.
|
|
187
|
+
#
|
|
188
|
+
# @param workspace_id [String] The workspace that owns the tool set.
|
|
189
|
+
#
|
|
190
|
+
# @param tool_set_id [String] The tool set the secret belongs to. Accepts the canonical ts\_… form
|
|
191
|
+
#
|
|
192
|
+
# @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
193
|
+
#
|
|
194
|
+
# @return [nil]
|
|
195
|
+
#
|
|
196
|
+
# @see Cadenya::Models::ToolSets::SecretDeleteParams
|
|
197
|
+
def delete(id, params)
|
|
198
|
+
parsed, options = Cadenya::ToolSets::SecretDeleteParams.dump_request(params)
|
|
199
|
+
workspace_id =
|
|
200
|
+
parsed.delete(:workspace_id) do
|
|
201
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
202
|
+
end
|
|
203
|
+
tool_set_id =
|
|
204
|
+
parsed.delete(:tool_set_id) do
|
|
205
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
206
|
+
end
|
|
207
|
+
@client.request(
|
|
208
|
+
method: :delete,
|
|
209
|
+
path: ["v1/workspaces/%1$s/tool_sets/%2$s/secrets/%3$s", workspace_id, tool_set_id, id],
|
|
210
|
+
model: NilClass,
|
|
211
|
+
options: options
|
|
212
|
+
)
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# @api private
|
|
216
|
+
#
|
|
217
|
+
# @param client [Cadenya::Client]
|
|
218
|
+
def initialize(client:)
|
|
219
|
+
@client = client
|
|
220
|
+
end
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
end
|
|
224
|
+
end
|
|
@@ -16,6 +16,14 @@ module Cadenya
|
|
|
16
16
|
# @return [Cadenya::Resources::ToolSets::Tools]
|
|
17
17
|
attr_reader :tools
|
|
18
18
|
|
|
19
|
+
# Manage tool sets and the tools they contain. Tool sets group related tools, and
|
|
20
|
+
# tools define specific capabilities available to agents.
|
|
21
|
+
#
|
|
22
|
+
# When a tool set is managed, only API key actors can modify its tools; human
|
|
23
|
+
# (profile) actors cannot.
|
|
24
|
+
# @return [Cadenya::Resources::ToolSets::Secrets]
|
|
25
|
+
attr_reader :secrets
|
|
26
|
+
|
|
19
27
|
# Some parameter documentations has been truncated, see
|
|
20
28
|
# {Cadenya::Models::ToolSetCreateParams} for more details.
|
|
21
29
|
#
|
|
@@ -333,6 +341,7 @@ module Cadenya
|
|
|
333
341
|
def initialize(client:)
|
|
334
342
|
@client = client
|
|
335
343
|
@tools = Cadenya::Resources::ToolSets::Tools.new(client: client)
|
|
344
|
+
@secrets = Cadenya::Resources::ToolSets::Secrets.new(client: client)
|
|
336
345
|
end
|
|
337
346
|
end
|
|
338
347
|
end
|
data/lib/cadenya/version.rb
CHANGED
data/lib/cadenya.rb
CHANGED
|
@@ -230,6 +230,7 @@ require_relative "cadenya/models/objectives/objective_tool_call_result_content_b
|
|
|
230
230
|
require_relative "cadenya/models/objectives/objective_tool_call_result_image_block"
|
|
231
231
|
require_relative "cadenya/models/objectives/objective_tool_call_result_text_block"
|
|
232
232
|
require_relative "cadenya/models/objectives/objective_tool_call_with_result"
|
|
233
|
+
require_relative "cadenya/models/objectives/resolved_secret"
|
|
233
234
|
require_relative "cadenya/models/objectives/task_list_params"
|
|
234
235
|
require_relative "cadenya/models/objectives/task_retrieve_params"
|
|
235
236
|
require_relative "cadenya/models/objectives/tool_call_approve_params"
|
|
@@ -281,6 +282,11 @@ require_relative "cadenya/models/tool_set_retrieve_params"
|
|
|
281
282
|
require_relative "cadenya/models/tool_sets/config_http"
|
|
282
283
|
require_relative "cadenya/models/tool_sets/config_mcp"
|
|
283
284
|
require_relative "cadenya/models/tool_sets/config_openapi"
|
|
285
|
+
require_relative "cadenya/models/tool_sets/secret_create_params"
|
|
286
|
+
require_relative "cadenya/models/tool_sets/secret_delete_params"
|
|
287
|
+
require_relative "cadenya/models/tool_sets/secret_list_params"
|
|
288
|
+
require_relative "cadenya/models/tool_sets/secret_retrieve_params"
|
|
289
|
+
require_relative "cadenya/models/tool_sets/secret_update_params"
|
|
284
290
|
require_relative "cadenya/models/tool_sets/tool"
|
|
285
291
|
require_relative "cadenya/models/tool_sets/tool_create_params"
|
|
286
292
|
require_relative "cadenya/models/tool_sets/tool_delete_params"
|
|
@@ -289,6 +295,9 @@ require_relative "cadenya/models/tool_sets/tool_list_params"
|
|
|
289
295
|
require_relative "cadenya/models/tool_sets/tool_omit_params"
|
|
290
296
|
require_relative "cadenya/models/tool_sets/tool_restore_params"
|
|
291
297
|
require_relative "cadenya/models/tool_sets/tool_retrieve_params"
|
|
298
|
+
require_relative "cadenya/models/tool_sets/tool_set_secret"
|
|
299
|
+
require_relative "cadenya/models/tool_sets/tool_set_secret_info"
|
|
300
|
+
require_relative "cadenya/models/tool_sets/tool_set_secret_spec"
|
|
292
301
|
require_relative "cadenya/models/tool_sets/tool_spec"
|
|
293
302
|
require_relative "cadenya/models/tool_sets/tool_spec_config"
|
|
294
303
|
require_relative "cadenya/models/tool_sets/tool_update_params"
|
|
@@ -353,6 +362,7 @@ require_relative "cadenya/resources/objectives/tools"
|
|
|
353
362
|
require_relative "cadenya/resources/profiles"
|
|
354
363
|
require_relative "cadenya/resources/search"
|
|
355
364
|
require_relative "cadenya/resources/tool_sets"
|
|
365
|
+
require_relative "cadenya/resources/tool_sets/secrets"
|
|
356
366
|
require_relative "cadenya/resources/tool_sets/tools"
|
|
357
367
|
require_relative "cadenya/resources/uploads"
|
|
358
368
|
require_relative "cadenya/resources/webhooks"
|
|
@@ -38,6 +38,20 @@ module Cadenya
|
|
|
38
38
|
sig { params(memo: String).void }
|
|
39
39
|
attr_writer :memo
|
|
40
40
|
|
|
41
|
+
# List of resolved secrets used by the tool call
|
|
42
|
+
sig do
|
|
43
|
+
returns(T.nilable(T::Array[Cadenya::Objectives::ResolvedSecret]))
|
|
44
|
+
end
|
|
45
|
+
attr_reader :resolved_secrets
|
|
46
|
+
|
|
47
|
+
sig do
|
|
48
|
+
params(
|
|
49
|
+
resolved_secrets:
|
|
50
|
+
T::Array[Cadenya::Objectives::ResolvedSecret::OrHash]
|
|
51
|
+
).void
|
|
52
|
+
end
|
|
53
|
+
attr_writer :resolved_secrets
|
|
54
|
+
|
|
41
55
|
# A profile identifies a user or non-human principal (such as an API key) at the
|
|
42
56
|
# account level. Profiles are account-scoped and can be granted access to multiple
|
|
43
57
|
# workspaces.
|
|
@@ -52,6 +66,8 @@ module Cadenya
|
|
|
52
66
|
callable: Cadenya::CallableTool::OrHash,
|
|
53
67
|
arguments: T::Hash[Symbol, T.anything],
|
|
54
68
|
memo: String,
|
|
69
|
+
resolved_secrets:
|
|
70
|
+
T::Array[Cadenya::Objectives::ResolvedSecret::OrHash],
|
|
55
71
|
status_changed_by: Cadenya::Profile::OrHash
|
|
56
72
|
).returns(T.attached_class)
|
|
57
73
|
end
|
|
@@ -65,6 +81,8 @@ module Cadenya
|
|
|
65
81
|
arguments: nil,
|
|
66
82
|
# A memo supplied by the reviewer when denying the tool call
|
|
67
83
|
memo: nil,
|
|
84
|
+
# List of resolved secrets used by the tool call
|
|
85
|
+
resolved_secrets: nil,
|
|
68
86
|
# A profile identifies a user or non-human principal (such as an API key) at the
|
|
69
87
|
# account level. Profiles are account-scoped and can be granted access to multiple
|
|
70
88
|
# workspaces.
|
|
@@ -78,6 +96,7 @@ module Cadenya
|
|
|
78
96
|
callable: Cadenya::CallableTool,
|
|
79
97
|
arguments: T::Hash[Symbol, T.anything],
|
|
80
98
|
memo: String,
|
|
99
|
+
resolved_secrets: T::Array[Cadenya::Objectives::ResolvedSecret],
|
|
81
100
|
status_changed_by: Cadenya::Profile
|
|
82
101
|
}
|
|
83
102
|
)
|
|
@@ -31,10 +31,36 @@ module Cadenya
|
|
|
31
31
|
sig { params(objective: Cadenya::OperationMetadata::OrHash).void }
|
|
32
32
|
attr_writer :objective
|
|
33
33
|
|
|
34
|
+
# BareMetadata contains the minimal metadata for a resource: the ID and an
|
|
35
|
+
# optional human-readable name. These are used for reference fields where the full
|
|
36
|
+
# metadata (account scoping, timestamps, labels, external IDs) is not needed —
|
|
37
|
+
# e.g., the tool references inside an agent variation spec or the tools assigned
|
|
38
|
+
# to an objective. Both fields are server-populated; clients provide IDs through
|
|
39
|
+
# sibling fields rather than by constructing a BareMetadata themselves.
|
|
40
|
+
sig { returns(T.nilable(Cadenya::BareMetadata)) }
|
|
41
|
+
attr_reader :tool
|
|
42
|
+
|
|
43
|
+
sig { params(tool: Cadenya::BareMetadata::OrHash).void }
|
|
44
|
+
attr_writer :tool
|
|
45
|
+
|
|
46
|
+
# BareMetadata contains the minimal metadata for a resource: the ID and an
|
|
47
|
+
# optional human-readable name. These are used for reference fields where the full
|
|
48
|
+
# metadata (account scoping, timestamps, labels, external IDs) is not needed —
|
|
49
|
+
# e.g., the tool references inside an agent variation spec or the tools assigned
|
|
50
|
+
# to an objective. Both fields are server-populated; clients provide IDs through
|
|
51
|
+
# sibling fields rather than by constructing a BareMetadata themselves.
|
|
52
|
+
sig { returns(T.nilable(Cadenya::BareMetadata)) }
|
|
53
|
+
attr_reader :tool_set
|
|
54
|
+
|
|
55
|
+
sig { params(tool_set: Cadenya::BareMetadata::OrHash).void }
|
|
56
|
+
attr_writer :tool_set
|
|
57
|
+
|
|
34
58
|
sig do
|
|
35
59
|
params(
|
|
36
60
|
created_by: Cadenya::Profile::OrHash,
|
|
37
|
-
objective: Cadenya::OperationMetadata::OrHash
|
|
61
|
+
objective: Cadenya::OperationMetadata::OrHash,
|
|
62
|
+
tool: Cadenya::BareMetadata::OrHash,
|
|
63
|
+
tool_set: Cadenya::BareMetadata::OrHash
|
|
38
64
|
).returns(T.attached_class)
|
|
39
65
|
end
|
|
40
66
|
def self.new(
|
|
@@ -44,7 +70,21 @@ module Cadenya
|
|
|
44
70
|
created_by: nil,
|
|
45
71
|
# Metadata for ephemeral operations and activities (e.g., objectives, executions,
|
|
46
72
|
# runs)
|
|
47
|
-
objective: nil
|
|
73
|
+
objective: nil,
|
|
74
|
+
# BareMetadata contains the minimal metadata for a resource: the ID and an
|
|
75
|
+
# optional human-readable name. These are used for reference fields where the full
|
|
76
|
+
# metadata (account scoping, timestamps, labels, external IDs) is not needed —
|
|
77
|
+
# e.g., the tool references inside an agent variation spec or the tools assigned
|
|
78
|
+
# to an objective. Both fields are server-populated; clients provide IDs through
|
|
79
|
+
# sibling fields rather than by constructing a BareMetadata themselves.
|
|
80
|
+
tool: nil,
|
|
81
|
+
# BareMetadata contains the minimal metadata for a resource: the ID and an
|
|
82
|
+
# optional human-readable name. These are used for reference fields where the full
|
|
83
|
+
# metadata (account scoping, timestamps, labels, external IDs) is not needed —
|
|
84
|
+
# e.g., the tool references inside an agent variation spec or the tools assigned
|
|
85
|
+
# to an objective. Both fields are server-populated; clients provide IDs through
|
|
86
|
+
# sibling fields rather than by constructing a BareMetadata themselves.
|
|
87
|
+
tool_set: nil
|
|
48
88
|
)
|
|
49
89
|
end
|
|
50
90
|
|
|
@@ -52,7 +92,9 @@ module Cadenya
|
|
|
52
92
|
override.returns(
|
|
53
93
|
{
|
|
54
94
|
created_by: Cadenya::Profile,
|
|
55
|
-
objective: Cadenya::OperationMetadata
|
|
95
|
+
objective: Cadenya::OperationMetadata,
|
|
96
|
+
tool: Cadenya::BareMetadata,
|
|
97
|
+
tool_set: Cadenya::BareMetadata
|
|
56
98
|
}
|
|
57
99
|
)
|
|
58
100
|
end
|
|
@@ -53,6 +53,20 @@ module Cadenya
|
|
|
53
53
|
end
|
|
54
54
|
attr_accessor :execution_status
|
|
55
55
|
|
|
56
|
+
# List of resolved secrets used by the tool call
|
|
57
|
+
sig do
|
|
58
|
+
returns(T.nilable(T::Array[Cadenya::Objectives::ResolvedSecret]))
|
|
59
|
+
end
|
|
60
|
+
attr_reader :resolved_secrets
|
|
61
|
+
|
|
62
|
+
sig do
|
|
63
|
+
params(
|
|
64
|
+
resolved_secrets:
|
|
65
|
+
T::Array[Cadenya::Objectives::ResolvedSecret::OrHash]
|
|
66
|
+
).void
|
|
67
|
+
end
|
|
68
|
+
attr_writer :resolved_secrets
|
|
69
|
+
|
|
56
70
|
# ObjectiveToolCallResult is the content a tool returned after execution. Tools
|
|
57
71
|
# can return multiple content blocks, and blocks can be multi-modal (text, image,
|
|
58
72
|
# audio). Media blocks are stored by Cadenya and served as short-lived signed URLs
|
|
@@ -78,6 +92,8 @@ module Cadenya
|
|
|
78
92
|
metadata: Cadenya::OperationMetadata::OrHash,
|
|
79
93
|
status:
|
|
80
94
|
Cadenya::Objectives::ObjectiveToolCallWithResult::Status::OrSymbol,
|
|
95
|
+
resolved_secrets:
|
|
96
|
+
T::Array[Cadenya::Objectives::ResolvedSecret::OrHash],
|
|
81
97
|
result: Cadenya::Objectives::ObjectiveToolCallResult::OrHash
|
|
82
98
|
).returns(T.attached_class)
|
|
83
99
|
end
|
|
@@ -90,6 +106,8 @@ module Cadenya
|
|
|
90
106
|
metadata:,
|
|
91
107
|
# Current status of the tool call
|
|
92
108
|
status:,
|
|
109
|
+
# List of resolved secrets used by the tool call
|
|
110
|
+
resolved_secrets: nil,
|
|
93
111
|
# ObjectiveToolCallResult is the content a tool returned after execution. Tools
|
|
94
112
|
# can return multiple content blocks, and blocks can be multi-modal (text, image,
|
|
95
113
|
# audio). Media blocks are stored by Cadenya and served as short-lived signed URLs
|
|
@@ -108,6 +126,7 @@ module Cadenya
|
|
|
108
126
|
metadata: Cadenya::OperationMetadata,
|
|
109
127
|
status:
|
|
110
128
|
Cadenya::Objectives::ObjectiveToolCallWithResult::Status::TaggedSymbol,
|
|
129
|
+
resolved_secrets: T::Array[Cadenya::Objectives::ResolvedSecret],
|
|
111
130
|
result: Cadenya::Objectives::ObjectiveToolCallResult
|
|
112
131
|
}
|
|
113
132
|
)
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Cadenya
|
|
4
|
+
module Models
|
|
5
|
+
module Objectives
|
|
6
|
+
class ResolvedSecret < Cadenya::Internal::Type::BaseModel
|
|
7
|
+
OrHash =
|
|
8
|
+
T.type_alias do
|
|
9
|
+
T.any(
|
|
10
|
+
Cadenya::Objectives::ResolvedSecret,
|
|
11
|
+
Cadenya::Internal::AnyHash
|
|
12
|
+
)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
sig { returns(T.nilable(String)) }
|
|
16
|
+
attr_reader :key
|
|
17
|
+
|
|
18
|
+
sig { params(key: String).void }
|
|
19
|
+
attr_writer :key
|
|
20
|
+
|
|
21
|
+
sig do
|
|
22
|
+
returns(
|
|
23
|
+
T.nilable(Cadenya::Objectives::ResolvedSecret::Source::TaggedSymbol)
|
|
24
|
+
)
|
|
25
|
+
end
|
|
26
|
+
attr_reader :source
|
|
27
|
+
|
|
28
|
+
sig do
|
|
29
|
+
params(
|
|
30
|
+
source: Cadenya::Objectives::ResolvedSecret::Source::OrSymbol
|
|
31
|
+
).void
|
|
32
|
+
end
|
|
33
|
+
attr_writer :source
|
|
34
|
+
|
|
35
|
+
# ResolvedSecret is a resolved secret value from the workspace, toolset, or
|
|
36
|
+
# objective. When a tool is called, it will rely on secrets in the order of:
|
|
37
|
+
#
|
|
38
|
+
# - Objective
|
|
39
|
+
# - Toolset
|
|
40
|
+
# - Workspace
|
|
41
|
+
sig do
|
|
42
|
+
params(
|
|
43
|
+
key: String,
|
|
44
|
+
source: Cadenya::Objectives::ResolvedSecret::Source::OrSymbol
|
|
45
|
+
).returns(T.attached_class)
|
|
46
|
+
end
|
|
47
|
+
def self.new(key: nil, source: nil)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
sig do
|
|
51
|
+
override.returns(
|
|
52
|
+
{
|
|
53
|
+
key: String,
|
|
54
|
+
source: Cadenya::Objectives::ResolvedSecret::Source::TaggedSymbol
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
end
|
|
58
|
+
def to_hash
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
module Source
|
|
62
|
+
extend Cadenya::Internal::Type::Enum
|
|
63
|
+
|
|
64
|
+
TaggedSymbol =
|
|
65
|
+
T.type_alias do
|
|
66
|
+
T.all(Symbol, Cadenya::Objectives::ResolvedSecret::Source)
|
|
67
|
+
end
|
|
68
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
69
|
+
|
|
70
|
+
RESOLVED_SECRET_SOURCE_UNSPECIFIED =
|
|
71
|
+
T.let(
|
|
72
|
+
:RESOLVED_SECRET_SOURCE_UNSPECIFIED,
|
|
73
|
+
Cadenya::Objectives::ResolvedSecret::Source::TaggedSymbol
|
|
74
|
+
)
|
|
75
|
+
RESOLVED_SECRET_SOURCE_WORKSPACE =
|
|
76
|
+
T.let(
|
|
77
|
+
:RESOLVED_SECRET_SOURCE_WORKSPACE,
|
|
78
|
+
Cadenya::Objectives::ResolvedSecret::Source::TaggedSymbol
|
|
79
|
+
)
|
|
80
|
+
RESOLVED_SECRET_SOURCE_TOOLSET =
|
|
81
|
+
T.let(
|
|
82
|
+
:RESOLVED_SECRET_SOURCE_TOOLSET,
|
|
83
|
+
Cadenya::Objectives::ResolvedSecret::Source::TaggedSymbol
|
|
84
|
+
)
|
|
85
|
+
RESOLVED_SECRET_SOURCE_OBJECTIVE =
|
|
86
|
+
T.let(
|
|
87
|
+
:RESOLVED_SECRET_SOURCE_OBJECTIVE,
|
|
88
|
+
Cadenya::Objectives::ResolvedSecret::Source::TaggedSymbol
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
sig do
|
|
92
|
+
override.returns(
|
|
93
|
+
T::Array[
|
|
94
|
+
Cadenya::Objectives::ResolvedSecret::Source::TaggedSymbol
|
|
95
|
+
]
|
|
96
|
+
)
|
|
97
|
+
end
|
|
98
|
+
def self.values
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Cadenya
|
|
4
|
+
module Models
|
|
5
|
+
module ToolSets
|
|
6
|
+
class SecretCreateParams < 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::ToolSets::SecretCreateParams,
|
|
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 :tool_set_id
|
|
23
|
+
|
|
24
|
+
# CreateResourceMetadata contains the user-provided fields for creating a
|
|
25
|
+
# workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
|
|
26
|
+
# profile_id, created_at) are excluded since they are set by the server.
|
|
27
|
+
sig { returns(Cadenya::CreateResourceMetadata) }
|
|
28
|
+
attr_reader :metadata
|
|
29
|
+
|
|
30
|
+
sig { params(metadata: Cadenya::CreateResourceMetadata::OrHash).void }
|
|
31
|
+
attr_writer :metadata
|
|
32
|
+
|
|
33
|
+
sig { returns(Cadenya::ToolSets::ToolSetSecretSpec) }
|
|
34
|
+
attr_reader :spec
|
|
35
|
+
|
|
36
|
+
sig { params(spec: Cadenya::ToolSets::ToolSetSecretSpec::OrHash).void }
|
|
37
|
+
attr_writer :spec
|
|
38
|
+
|
|
39
|
+
sig do
|
|
40
|
+
params(
|
|
41
|
+
workspace_id: String,
|
|
42
|
+
tool_set_id: String,
|
|
43
|
+
metadata: Cadenya::CreateResourceMetadata::OrHash,
|
|
44
|
+
spec: Cadenya::ToolSets::ToolSetSecretSpec::OrHash,
|
|
45
|
+
request_options: Cadenya::RequestOptions::OrHash
|
|
46
|
+
).returns(T.attached_class)
|
|
47
|
+
end
|
|
48
|
+
def self.new(
|
|
49
|
+
workspace_id:,
|
|
50
|
+
tool_set_id:,
|
|
51
|
+
# CreateResourceMetadata contains the user-provided fields for creating a
|
|
52
|
+
# workspace-scoped resource. Read-only fields (id, account_id, workspace_id,
|
|
53
|
+
# profile_id, created_at) are excluded since they are set by the server.
|
|
54
|
+
metadata:,
|
|
55
|
+
spec:,
|
|
56
|
+
request_options: {}
|
|
57
|
+
)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
sig do
|
|
61
|
+
override.returns(
|
|
62
|
+
{
|
|
63
|
+
workspace_id: String,
|
|
64
|
+
tool_set_id: String,
|
|
65
|
+
metadata: Cadenya::CreateResourceMetadata,
|
|
66
|
+
spec: Cadenya::ToolSets::ToolSetSecretSpec,
|
|
67
|
+
request_options: Cadenya::RequestOptions
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
end
|
|
71
|
+
def to_hash
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|