cadenya 0.2.0 → 0.3.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 (119) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/README.md +1 -1
  4. data/lib/cadenya/client.rb +14 -0
  5. data/lib/cadenya/models/agent_spec.rb +19 -4
  6. data/lib/cadenya/models/agents/webhook_delivery_data.rb +1 -0
  7. data/lib/cadenya/models/agents/webhook_delivery_list_params.rb +1 -0
  8. data/lib/cadenya/models/approval_requirement_filter.rb +26 -0
  9. data/lib/cadenya/models/attribute_filter.rb +38 -0
  10. data/lib/cadenya/models/objective_data.rb +21 -1
  11. data/lib/cadenya/models/objective_event_data.rb +32 -1
  12. data/lib/cadenya/models/objective_list_params.rb +2 -1
  13. data/lib/cadenya/models/objective_status.rb +2 -1
  14. data/lib/cadenya/models/profile_spec.rb +1 -0
  15. data/lib/cadenya/models/string_matcher.rb +47 -0
  16. data/lib/cadenya/models/tool_filter.rb +35 -0
  17. data/lib/cadenya/models/tool_set_adapter.rb +7 -1
  18. data/lib/cadenya/models/tool_set_adapter_mcp.rb +11 -33
  19. data/lib/cadenya/models/tool_set_adapter_openapi.rb +79 -0
  20. data/lib/cadenya/models/tool_set_get_openapi_spec_params.rb +26 -0
  21. data/lib/cadenya/models/tool_set_get_openapi_spec_response.rb +17 -0
  22. data/lib/cadenya/models/tool_sets/config_openapi.rb +29 -0
  23. data/lib/cadenya/models/tool_sets/tool_spec_config.rb +7 -1
  24. data/lib/cadenya/models/workspace.rb +27 -1
  25. data/lib/cadenya/models/workspace_admin/member_add_params.rb +39 -0
  26. data/lib/cadenya/models/workspace_admin/member_list_params.rb +39 -0
  27. data/lib/cadenya/models/workspace_admin/member_remove_params.rb +28 -0
  28. data/lib/cadenya/models/workspace_admin/profile_list_params.rb +44 -0
  29. data/lib/cadenya/models/workspace_admin_archive_params.rb +20 -0
  30. data/lib/cadenya/models/workspace_admin_create_params.rb +70 -0
  31. data/lib/cadenya/models/workspace_admin_list_params.rb +42 -0
  32. data/lib/cadenya/models/workspace_admin_retrieve_params.rb +20 -0
  33. data/lib/cadenya/models/workspace_admin_update_params.rb +85 -0
  34. data/lib/cadenya/models/workspace_member.rb +53 -0
  35. data/lib/cadenya/models.rb +26 -2
  36. data/lib/cadenya/resources/tool_sets.rb +31 -0
  37. data/lib/cadenya/resources/workspace_admin/members.rb +107 -0
  38. data/lib/cadenya/resources/workspace_admin/profiles.rb +54 -0
  39. data/lib/cadenya/resources/workspace_admin.rb +173 -0
  40. data/lib/cadenya/resources/workspaces.rb +4 -0
  41. data/lib/cadenya/version.rb +1 -1
  42. data/lib/cadenya.rb +21 -1
  43. data/rbi/cadenya/client.rbi +13 -0
  44. data/rbi/cadenya/models/agent_spec.rbi +21 -4
  45. data/rbi/cadenya/models/agents/webhook_delivery_data.rbi +5 -0
  46. data/rbi/cadenya/models/agents/webhook_delivery_list_params.rbi +5 -0
  47. data/rbi/cadenya/models/approval_requirement_filter.rbi +45 -0
  48. data/rbi/cadenya/models/attribute_filter.rbi +84 -0
  49. data/rbi/cadenya/models/objective_data.rbi +26 -0
  50. data/rbi/cadenya/models/objective_event_data.rbi +52 -0
  51. data/rbi/cadenya/models/objective_list_params.rbi +7 -2
  52. data/rbi/cadenya/models/objective_status.rbi +4 -2
  53. data/rbi/cadenya/models/profile_spec.rbi +5 -0
  54. data/rbi/cadenya/models/string_matcher.rbi +84 -0
  55. data/rbi/cadenya/models/tool_filter.rbi +66 -0
  56. data/rbi/cadenya/models/tool_set_adapter.rbi +14 -3
  57. data/rbi/cadenya/models/tool_set_adapter_mcp.rbi +16 -62
  58. data/rbi/cadenya/models/tool_set_adapter_openapi.rbi +127 -0
  59. data/rbi/cadenya/models/tool_set_get_openapi_spec_params.rbi +46 -0
  60. data/rbi/cadenya/models/tool_set_get_openapi_spec_response.rbi +33 -0
  61. data/rbi/cadenya/models/tool_sets/config_openapi.rbi +48 -0
  62. data/rbi/cadenya/models/tool_sets/tool_spec_config.rbi +11 -3
  63. data/rbi/cadenya/models/workspace.rbi +39 -3
  64. data/rbi/cadenya/models/workspace_admin/member_add_params.rbi +68 -0
  65. data/rbi/cadenya/models/workspace_admin/member_list_params.rbi +68 -0
  66. data/rbi/cadenya/models/workspace_admin/member_remove_params.rbi +48 -0
  67. data/rbi/cadenya/models/workspace_admin/profile_list_params.rbi +75 -0
  68. data/rbi/cadenya/models/workspace_admin_archive_params.rbi +38 -0
  69. data/rbi/cadenya/models/workspace_admin_create_params.rbi +127 -0
  70. data/rbi/cadenya/models/workspace_admin_list_params.rbi +70 -0
  71. data/rbi/cadenya/models/workspace_admin_retrieve_params.rbi +38 -0
  72. data/rbi/cadenya/models/workspace_admin_update_params.rbi +144 -0
  73. data/rbi/cadenya/models/workspace_member.rbi +80 -0
  74. data/rbi/cadenya/models.rbi +26 -2
  75. data/rbi/cadenya/resources/tool_sets.rbi +18 -0
  76. data/rbi/cadenya/resources/workspace_admin/members.rbi +83 -0
  77. data/rbi/cadenya/resources/workspace_admin/profiles.rbi +42 -0
  78. data/rbi/cadenya/resources/workspace_admin.rbi +131 -0
  79. data/rbi/cadenya/resources/workspaces.rbi +4 -0
  80. data/sig/cadenya/client.rbs +2 -0
  81. data/sig/cadenya/models/agent_spec.rbs +12 -5
  82. data/sig/cadenya/models/agents/webhook_delivery_data.rbs +2 -0
  83. data/sig/cadenya/models/agents/webhook_delivery_list_params.rbs +2 -0
  84. data/sig/cadenya/models/approval_requirement_filter.rbs +20 -0
  85. data/sig/cadenya/models/attribute_filter.rbs +44 -0
  86. data/sig/cadenya/models/objective_data.rbs +14 -0
  87. data/sig/cadenya/models/objective_event_data.rbs +21 -0
  88. data/sig/cadenya/models/objective_list_params.rbs +4 -2
  89. data/sig/cadenya/models/objective_status.rbs +4 -2
  90. data/sig/cadenya/models/profile_spec.rbs +5 -1
  91. data/sig/cadenya/models/string_matcher.rbs +57 -0
  92. data/sig/cadenya/models/tool_filter.rbs +41 -0
  93. data/sig/cadenya/models/tool_set_adapter.rbs +15 -3
  94. data/sig/cadenya/models/tool_set_adapter_mcp.rbs +16 -32
  95. data/sig/cadenya/models/tool_set_adapter_openapi.rbs +73 -0
  96. data/sig/cadenya/models/tool_set_get_openapi_spec_params.rbs +28 -0
  97. data/sig/cadenya/models/tool_set_get_openapi_spec_response.rbs +15 -0
  98. data/sig/cadenya/models/tool_sets/config_openapi.rbs +30 -0
  99. data/sig/cadenya/models/tool_sets/tool_spec_config.rbs +12 -3
  100. data/sig/cadenya/models/workspace.rbs +24 -3
  101. data/sig/cadenya/models/workspace_admin/member_add_params.rbs +38 -0
  102. data/sig/cadenya/models/workspace_admin/member_list_params.rbs +38 -0
  103. data/sig/cadenya/models/workspace_admin/member_remove_params.rbs +30 -0
  104. data/sig/cadenya/models/workspace_admin/profile_list_params.rbs +40 -0
  105. data/sig/cadenya/models/workspace_admin_archive_params.rbs +23 -0
  106. data/sig/cadenya/models/workspace_admin_create_params.rbs +58 -0
  107. data/sig/cadenya/models/workspace_admin_list_params.rbs +38 -0
  108. data/sig/cadenya/models/workspace_admin_retrieve_params.rbs +23 -0
  109. data/sig/cadenya/models/workspace_admin_update_params.rbs +76 -0
  110. data/sig/cadenya/models/workspace_member.rbs +46 -0
  111. data/sig/cadenya/models.rbs +26 -2
  112. data/sig/cadenya/resources/tool_sets.rbs +6 -0
  113. data/sig/cadenya/resources/workspace_admin/members.rbs +29 -0
  114. data/sig/cadenya/resources/workspace_admin/profiles.rbs +16 -0
  115. data/sig/cadenya/resources/workspace_admin.rbs +42 -0
  116. metadata +65 -5
  117. data/lib/cadenya/models/mcp_tool_filter.rb +0 -111
  118. data/rbi/cadenya/models/mcp_tool_filter.rbi +0 -235
  119. data/sig/cadenya/models/mcp_tool_filter.rbs +0 -138
@@ -0,0 +1,38 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Models
5
+ class WorkspaceAdminRetrieveParams < 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(
12
+ Cadenya::WorkspaceAdminRetrieveParams,
13
+ Cadenya::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ sig { returns(String) }
18
+ attr_accessor :workspace_id
19
+
20
+ sig do
21
+ params(
22
+ workspace_id: String,
23
+ request_options: Cadenya::RequestOptions::OrHash
24
+ ).returns(T.attached_class)
25
+ end
26
+ def self.new(workspace_id:, request_options: {})
27
+ end
28
+
29
+ sig do
30
+ override.returns(
31
+ { workspace_id: String, request_options: Cadenya::RequestOptions }
32
+ )
33
+ end
34
+ def to_hash
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,144 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Models
5
+ class WorkspaceAdminUpdateParams < 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::WorkspaceAdminUpdateParams, Cadenya::Internal::AnyHash)
12
+ end
13
+
14
+ sig { returns(String) }
15
+ attr_accessor :workspace_id
16
+
17
+ # UpdateAccountResourceMetadata contains the user-provided fields for updating an
18
+ # account-scoped resource. Read-only fields (id, account_id, profile_id) are
19
+ # excluded since they are set by the server.
20
+ sig { returns(T.nilable(Cadenya::WorkspaceAdminUpdateParams::Metadata)) }
21
+ attr_reader :metadata
22
+
23
+ sig do
24
+ params(
25
+ metadata: Cadenya::WorkspaceAdminUpdateParams::Metadata::OrHash
26
+ ).void
27
+ end
28
+ attr_writer :metadata
29
+
30
+ sig { returns(T.nilable(Cadenya::WorkspaceSpec)) }
31
+ attr_reader :spec
32
+
33
+ sig { params(spec: Cadenya::WorkspaceSpec::OrHash).void }
34
+ attr_writer :spec
35
+
36
+ # Fields to update.
37
+ sig { returns(T.nilable(String)) }
38
+ attr_reader :update_mask
39
+
40
+ sig { params(update_mask: String).void }
41
+ attr_writer :update_mask
42
+
43
+ sig do
44
+ params(
45
+ workspace_id: String,
46
+ metadata: Cadenya::WorkspaceAdminUpdateParams::Metadata::OrHash,
47
+ spec: Cadenya::WorkspaceSpec::OrHash,
48
+ update_mask: String,
49
+ request_options: Cadenya::RequestOptions::OrHash
50
+ ).returns(T.attached_class)
51
+ end
52
+ def self.new(
53
+ workspace_id:,
54
+ # UpdateAccountResourceMetadata contains the user-provided fields for updating an
55
+ # account-scoped resource. Read-only fields (id, account_id, profile_id) are
56
+ # excluded since they are set by the server.
57
+ metadata: nil,
58
+ spec: nil,
59
+ # Fields to update.
60
+ update_mask: nil,
61
+ request_options: {}
62
+ )
63
+ end
64
+
65
+ sig do
66
+ override.returns(
67
+ {
68
+ workspace_id: String,
69
+ metadata: Cadenya::WorkspaceAdminUpdateParams::Metadata,
70
+ spec: Cadenya::WorkspaceSpec,
71
+ update_mask: String,
72
+ request_options: Cadenya::RequestOptions
73
+ }
74
+ )
75
+ end
76
+ def to_hash
77
+ end
78
+
79
+ class Metadata < Cadenya::Internal::Type::BaseModel
80
+ OrHash =
81
+ T.type_alias do
82
+ T.any(
83
+ Cadenya::WorkspaceAdminUpdateParams::Metadata,
84
+ Cadenya::Internal::AnyHash
85
+ )
86
+ end
87
+
88
+ # Human-readable name for the resource (e.g., "Production API Key", "Staging
89
+ # Workspace")
90
+ sig { returns(String) }
91
+ attr_accessor :name
92
+
93
+ # External ID for the resource (e.g., a workflow ID from an external system)
94
+ sig { returns(T.nilable(String)) }
95
+ attr_reader :external_id
96
+
97
+ sig { params(external_id: String).void }
98
+ attr_writer :external_id
99
+
100
+ # Arbitrary key-value pairs for categorization and filtering Examples:
101
+ # {"environment": "production", "team": "platform", "version": "v2"}
102
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
103
+ attr_reader :labels
104
+
105
+ sig { params(labels: T::Hash[Symbol, String]).void }
106
+ attr_writer :labels
107
+
108
+ # UpdateAccountResourceMetadata contains the user-provided fields for updating an
109
+ # account-scoped resource. Read-only fields (id, account_id, profile_id) are
110
+ # excluded since they are set by the server.
111
+ sig do
112
+ params(
113
+ name: String,
114
+ external_id: String,
115
+ labels: T::Hash[Symbol, String]
116
+ ).returns(T.attached_class)
117
+ end
118
+ def self.new(
119
+ # Human-readable name for the resource (e.g., "Production API Key", "Staging
120
+ # Workspace")
121
+ name:,
122
+ # External ID for the resource (e.g., a workflow ID from an external system)
123
+ external_id: nil,
124
+ # Arbitrary key-value pairs for categorization and filtering Examples:
125
+ # {"environment": "production", "team": "platform", "version": "v2"}
126
+ labels: nil
127
+ )
128
+ end
129
+
130
+ sig do
131
+ override.returns(
132
+ {
133
+ name: String,
134
+ external_id: String,
135
+ labels: T::Hash[Symbol, String]
136
+ }
137
+ )
138
+ end
139
+ def to_hash
140
+ end
141
+ end
142
+ end
143
+ end
144
+ end
@@ -0,0 +1,80 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Models
5
+ class WorkspaceMember < Cadenya::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Cadenya::WorkspaceMember, Cadenya::Internal::AnyHash)
9
+ end
10
+
11
+ # The actor row linking the profile to the workspace (the junction record).
12
+ sig { returns(String) }
13
+ attr_accessor :actor_id
14
+
15
+ # The account profile that has access to the workspace.
16
+ sig { returns(String) }
17
+ attr_accessor :profile_id
18
+
19
+ # When the member was added to the workspace.
20
+ sig { returns(T.nilable(Time)) }
21
+ attr_reader :added_at
22
+
23
+ sig { params(added_at: Time).void }
24
+ attr_writer :added_at
25
+
26
+ # Email address of the member's profile.
27
+ sig { returns(T.nilable(String)) }
28
+ attr_reader :email
29
+
30
+ sig { params(email: String).void }
31
+ attr_writer :email
32
+
33
+ # Display name of the member's profile.
34
+ sig { returns(T.nilable(String)) }
35
+ attr_reader :name
36
+
37
+ sig { params(name: String).void }
38
+ attr_writer :name
39
+
40
+ # A member of a workspace: the profile granted access plus the actor row that
41
+ # links it to the workspace. Returned by member list/add operations.
42
+ sig do
43
+ params(
44
+ actor_id: String,
45
+ profile_id: String,
46
+ added_at: Time,
47
+ email: String,
48
+ name: String
49
+ ).returns(T.attached_class)
50
+ end
51
+ def self.new(
52
+ # The actor row linking the profile to the workspace (the junction record).
53
+ actor_id:,
54
+ # The account profile that has access to the workspace.
55
+ profile_id:,
56
+ # When the member was added to the workspace.
57
+ added_at: nil,
58
+ # Email address of the member's profile.
59
+ email: nil,
60
+ # Display name of the member's profile.
61
+ name: nil
62
+ )
63
+ end
64
+
65
+ sig do
66
+ override.returns(
67
+ {
68
+ actor_id: String,
69
+ profile_id: String,
70
+ added_at: Time,
71
+ email: String,
72
+ name: String
73
+ }
74
+ )
75
+ end
76
+ def to_hash
77
+ end
78
+ end
79
+ end
80
+ end
@@ -58,10 +58,14 @@ module Cadenya
58
58
 
59
59
  APIKeyUpdateParams = Cadenya::Models::APIKeyUpdateParams
60
60
 
61
+ ApprovalRequirementFilter = Cadenya::Models::ApprovalRequirementFilter
62
+
61
63
  AssistantMessage = Cadenya::Models::AssistantMessage
62
64
 
63
65
  AssistantToolCall = Cadenya::Models::AssistantToolCall
64
66
 
67
+ AttributeFilter = Cadenya::Models::AttributeFilter
68
+
65
69
  BareMetadata = Cadenya::Models::BareMetadata
66
70
 
67
71
  BulkWorkspaceApply = Cadenya::Models::BulkWorkspaceApply
@@ -91,8 +95,6 @@ module Cadenya
91
95
 
92
96
  CreateResourceMetadata = Cadenya::Models::CreateResourceMetadata
93
97
 
94
- McpToolFilter = Cadenya::Models::McpToolFilter
95
-
96
98
  MemoryEntryItem = Cadenya::Models::MemoryEntryItem
97
99
 
98
100
  MemoryLayer = Cadenya::Models::MemoryLayer
@@ -186,6 +188,8 @@ module Cadenya
186
188
  SearchSearchToolsOrToolSetsParams =
187
189
  Cadenya::Models::SearchSearchToolsOrToolSetsParams
188
190
 
191
+ StringMatcher = Cadenya::Models::StringMatcher
192
+
189
193
  SubAgentSpawned = Cadenya::Models::SubAgentSpawned
190
194
 
191
195
  SubAgentUpdated = Cadenya::Models::SubAgentUpdated
@@ -208,6 +212,8 @@ module Cadenya
208
212
 
209
213
  ToolError = Cadenya::Models::ToolError
210
214
 
215
+ ToolFilter = Cadenya::Models::ToolFilter
216
+
211
217
  ToolResult = Cadenya::Models::ToolResult
212
218
 
213
219
  ToolSet = Cadenya::Models::ToolSet
@@ -218,6 +224,8 @@ module Cadenya
218
224
 
219
225
  ToolSetAdapterMcp = Cadenya::Models::ToolSetAdapterMcp
220
226
 
227
+ ToolSetAdapterOpenAPI = Cadenya::Models::ToolSetAdapterOpenAPI
228
+
221
229
  ToolSetCreateParams = Cadenya::Models::ToolSetCreateParams
222
230
 
223
231
  ToolSetDeleteParams = Cadenya::Models::ToolSetDeleteParams
@@ -228,6 +236,8 @@ module Cadenya
228
236
 
229
237
  ToolSetEventData = Cadenya::Models::ToolSetEventData
230
238
 
239
+ ToolSetGetOpenAPISpecParams = Cadenya::Models::ToolSetGetOpenAPISpecParams
240
+
231
241
  ToolSetInfo = Cadenya::Models::ToolSetInfo
232
242
 
233
243
  ToolSetListEventsParams = Cadenya::Models::ToolSetListEventsParams
@@ -270,10 +280,24 @@ module Cadenya
270
280
 
271
281
  Workspace = Cadenya::Models::Workspace
272
282
 
283
+ WorkspaceAdmin = Cadenya::Models::WorkspaceAdmin
284
+
285
+ WorkspaceAdminArchiveParams = Cadenya::Models::WorkspaceAdminArchiveParams
286
+
287
+ WorkspaceAdminCreateParams = Cadenya::Models::WorkspaceAdminCreateParams
288
+
289
+ WorkspaceAdminListParams = Cadenya::Models::WorkspaceAdminListParams
290
+
291
+ WorkspaceAdminRetrieveParams = Cadenya::Models::WorkspaceAdminRetrieveParams
292
+
293
+ WorkspaceAdminUpdateParams = Cadenya::Models::WorkspaceAdminUpdateParams
294
+
273
295
  WorkspaceGetParams = Cadenya::Models::WorkspaceGetParams
274
296
 
275
297
  WorkspaceListParams = Cadenya::Models::WorkspaceListParams
276
298
 
299
+ WorkspaceMember = Cadenya::Models::WorkspaceMember
300
+
277
301
  WorkspaceSecret = Cadenya::Models::WorkspaceSecret
278
302
 
279
303
  WorkspaceSecretCreateParams = Cadenya::Models::WorkspaceSecretCreateParams
@@ -136,6 +136,24 @@ module Cadenya
136
136
  )
137
137
  end
138
138
 
139
+ # Retrieves the current OpenAPI specification JSON that has been consumed by the
140
+ # tool set. Only applicable to tool sets using the OpenAPI adapter.
141
+ sig do
142
+ params(
143
+ tool_set_id: String,
144
+ workspace_id: String,
145
+ request_options: Cadenya::RequestOptions::OrHash
146
+ ).returns(Cadenya::Models::ToolSetGetOpenAPISpecResponse)
147
+ end
148
+ def get_openapi_spec(
149
+ # Tool set ID. Accepts the canonical ts\_… form or the external_id:<value> form.
150
+ tool_set_id,
151
+ # Workspace ID.
152
+ workspace_id:,
153
+ request_options: {}
154
+ )
155
+ end
156
+
139
157
  # Lists all events (including sync status) for a tool set
140
158
  sig do
141
159
  params(
@@ -0,0 +1,83 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Resources
5
+ class WorkspaceAdmin
6
+ # Administer workspaces across the account: create and archive workspaces and
7
+ # manage their membership. These operations are account-scoped and require the
8
+ # admin role (a token whose profile holds the WorkOS admin role); they live under
9
+ # /v1/account/workspaces rather than the workspace-scoped /v1/workspaces tree so
10
+ # an admin can manage any workspace in the account, including ones they are not
11
+ # themselves a member of.
12
+ class Members
13
+ # Lists the members of a workspace. Admin only.
14
+ sig do
15
+ params(
16
+ workspace_id: String,
17
+ cursor: String,
18
+ limit: Integer,
19
+ request_options: Cadenya::RequestOptions::OrHash
20
+ ).returns(
21
+ Cadenya::Internal::CursorPagination[Cadenya::WorkspaceMember]
22
+ )
23
+ end
24
+ def list(
25
+ # The workspace whose members will be listed (path).
26
+ workspace_id,
27
+ # Pagination cursor from previous response
28
+ cursor: nil,
29
+ # Maximum number of results to return
30
+ limit: nil,
31
+ request_options: {}
32
+ )
33
+ end
34
+
35
+ # Grants a profile access to the workspace by creating (or reactivating) the actor
36
+ # that links the profile to the workspace. Accepts either an existing profile_id
37
+ # or an email to resolve-or-invite. Idempotent for an already-active member. Admin
38
+ # only.
39
+ sig do
40
+ params(
41
+ workspace_id: String,
42
+ email: String,
43
+ profile_id: String,
44
+ request_options: Cadenya::RequestOptions::OrHash
45
+ ).returns(Cadenya::WorkspaceMember)
46
+ end
47
+ def add(
48
+ # The workspace to add the member to (path).
49
+ workspace_id,
50
+ # Email address to add (resolve-or-invite). Mutually exclusive with profile_id.
51
+ email: nil,
52
+ # An existing account profile to add. Mutually exclusive with email.
53
+ profile_id: nil,
54
+ request_options: {}
55
+ )
56
+ end
57
+
58
+ # Revokes a member's access by deactivating their actor; the member is immediately
59
+ # cut off. The underlying profile is not deleted. Admin only.
60
+ sig do
61
+ params(
62
+ profile_id: String,
63
+ workspace_id: String,
64
+ request_options: Cadenya::RequestOptions::OrHash
65
+ ).void
66
+ end
67
+ def remove(
68
+ # The profile to remove from the workspace (path).
69
+ profile_id,
70
+ # The workspace to remove the member from (path).
71
+ workspace_id:,
72
+ request_options: {}
73
+ )
74
+ end
75
+
76
+ # @api private
77
+ sig { params(client: Cadenya::Client).returns(T.attached_class) }
78
+ def self.new(client:)
79
+ end
80
+ end
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,42 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Resources
5
+ class WorkspaceAdmin
6
+ # Administer workspaces across the account: create and archive workspaces and
7
+ # manage their membership. These operations are account-scoped and require the
8
+ # admin role (a token whose profile holds the WorkOS admin role); they live under
9
+ # /v1/account/workspaces rather than the workspace-scoped /v1/workspaces tree so
10
+ # an admin can manage any workspace in the account, including ones they are not
11
+ # themselves a member of.
12
+ class Profiles
13
+ # Searches the account's profiles for a member picker, with free-form name/email
14
+ # search and an optional type filter. Account-scoped; admin only.
15
+ sig do
16
+ params(
17
+ cursor: String,
18
+ limit: Integer,
19
+ query: String,
20
+ request_options: Cadenya::RequestOptions::OrHash
21
+ ).returns(Cadenya::Internal::CursorPagination[Cadenya::Profile])
22
+ end
23
+ def list(
24
+ # Pagination cursor from previous response
25
+ cursor: nil,
26
+ # Maximum number of results to return
27
+ limit: nil,
28
+ # Free-form search over profile name and email. Case-insensitive substring match;
29
+ # empty returns all profiles.
30
+ query: nil,
31
+ request_options: {}
32
+ )
33
+ end
34
+
35
+ # @api private
36
+ sig { params(client: Cadenya::Client).returns(T.attached_class) }
37
+ def self.new(client:)
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,131 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Resources
5
+ # Administer workspaces across the account: create and archive workspaces and
6
+ # manage their membership. These operations are account-scoped and require the
7
+ # admin role (a token whose profile holds the WorkOS admin role); they live under
8
+ # /v1/account/workspaces rather than the workspace-scoped /v1/workspaces tree so
9
+ # an admin can manage any workspace in the account, including ones they are not
10
+ # themselves a member of.
11
+ class WorkspaceAdmin
12
+ # Administer workspaces across the account: create and archive workspaces and
13
+ # manage their membership. These operations are account-scoped and require the
14
+ # admin role (a token whose profile holds the WorkOS admin role); they live under
15
+ # /v1/account/workspaces rather than the workspace-scoped /v1/workspaces tree so
16
+ # an admin can manage any workspace in the account, including ones they are not
17
+ # themselves a member of.
18
+ sig { returns(Cadenya::Resources::WorkspaceAdmin::Members) }
19
+ attr_reader :members
20
+
21
+ # Administer workspaces across the account: create and archive workspaces and
22
+ # manage their membership. These operations are account-scoped and require the
23
+ # admin role (a token whose profile holds the WorkOS admin role); they live under
24
+ # /v1/account/workspaces rather than the workspace-scoped /v1/workspaces tree so
25
+ # an admin can manage any workspace in the account, including ones they are not
26
+ # themselves a member of.
27
+ sig { returns(Cadenya::Resources::WorkspaceAdmin::Profiles) }
28
+ attr_reader :profiles
29
+
30
+ # Creates a new workspace in the account. Admin only.
31
+ sig do
32
+ params(
33
+ metadata: Cadenya::WorkspaceAdminCreateParams::Metadata::OrHash,
34
+ spec: Cadenya::WorkspaceSpec::OrHash,
35
+ request_options: Cadenya::RequestOptions::OrHash
36
+ ).returns(Cadenya::Workspace)
37
+ end
38
+ def create(
39
+ # CreateAccountResourceMetadata contains the user-provided fields for creating an
40
+ # account-scoped resource. Read-only fields (id, account_id, profile_id) are
41
+ # excluded since they are set by the server.
42
+ metadata:,
43
+ spec:,
44
+ request_options: {}
45
+ )
46
+ end
47
+
48
+ # Retrieves a workspace in the account by ID. Admin only.
49
+ sig do
50
+ params(
51
+ workspace_id: String,
52
+ request_options: Cadenya::RequestOptions::OrHash
53
+ ).returns(Cadenya::Workspace)
54
+ end
55
+ def retrieve(
56
+ # Workspace ID to retrieve (path).
57
+ workspace_id,
58
+ request_options: {}
59
+ )
60
+ end
61
+
62
+ # Updates a workspace's metadata (e.g. name) and spec. Admin only.
63
+ sig do
64
+ params(
65
+ workspace_id: String,
66
+ metadata: Cadenya::WorkspaceAdminUpdateParams::Metadata::OrHash,
67
+ spec: Cadenya::WorkspaceSpec::OrHash,
68
+ update_mask: String,
69
+ request_options: Cadenya::RequestOptions::OrHash
70
+ ).returns(Cadenya::Workspace)
71
+ end
72
+ def update(
73
+ # Workspace ID to update (path).
74
+ workspace_id,
75
+ # UpdateAccountResourceMetadata contains the user-provided fields for updating an
76
+ # account-scoped resource. Read-only fields (id, account_id, profile_id) are
77
+ # excluded since they are set by the server.
78
+ metadata: nil,
79
+ spec: nil,
80
+ # Fields to update.
81
+ update_mask: nil,
82
+ request_options: {}
83
+ )
84
+ end
85
+
86
+ # Lists every workspace in the account, optionally including archived ones. Admin
87
+ # only.
88
+ sig do
89
+ params(
90
+ cursor: String,
91
+ include_archived: T::Boolean,
92
+ limit: Integer,
93
+ request_options: Cadenya::RequestOptions::OrHash
94
+ ).returns(Cadenya::Internal::CursorPagination[Cadenya::Workspace])
95
+ end
96
+ def list(
97
+ # Pagination cursor from previous response
98
+ cursor: nil,
99
+ # When true, archived workspaces are included in the results. Defaults to false
100
+ # (active workspaces only).
101
+ include_archived: nil,
102
+ # Maximum number of results to return
103
+ limit: nil,
104
+ request_options: {}
105
+ )
106
+ end
107
+
108
+ # Archives a workspace (soft delete). The workspace is retained, but any
109
+ # subsequent request scoped to it returns a permission error. Archiving the
110
+ # account's last active (non-archived) workspace is not allowed and returns
111
+ # FailedPrecondition. Admin only.
112
+ sig do
113
+ params(
114
+ workspace_id: String,
115
+ request_options: Cadenya::RequestOptions::OrHash
116
+ ).void
117
+ end
118
+ def archive(
119
+ # Workspace ID to archive (path).
120
+ workspace_id,
121
+ request_options: {}
122
+ )
123
+ end
124
+
125
+ # @api private
126
+ sig { params(client: Cadenya::Client).returns(T.attached_class) }
127
+ def self.new(client:)
128
+ end
129
+ end
130
+ end
131
+ end
@@ -4,6 +4,10 @@ module Cadenya
4
4
  module Resources
5
5
  # Manage workspaces within an account. Workspaces provide organizational grouping
6
6
  # and isolation for resources such as agents, tools, and API keys.
7
+ #
8
+ # This is the workspace-scoped, end-user surface. Administrative operations
9
+ # (create / archive workspaces, manage members) live in WorkspaceAdminService
10
+ # under /v1/account/workspaces and require the admin role.
7
11
  class Workspaces
8
12
  # Lists all workspaces for the current account
9
13
  sig do
@@ -34,6 +34,8 @@ module Cadenya
34
34
 
35
35
  attr_reader workspaces: Cadenya::Resources::Workspaces
36
36
 
37
+ attr_reader workspace_admin: Cadenya::Resources::WorkspaceAdmin
38
+
37
39
  attr_reader webhooks: Cadenya::Resources::Webhooks
38
40
 
39
41
  attr_reader bulk_workspace_resources: Cadenya::Resources::BulkWorkspaceResources
@@ -5,7 +5,8 @@ module Cadenya
5
5
  status: Cadenya::Models::AgentSpec::status,
6
6
  variation_selection_mode: Cadenya::Models::AgentSpec::variation_selection_mode,
7
7
  description: String,
8
- input_data_schema: top,
8
+ input_data_schema: ::Hash[Symbol, top],
9
+ output_definition: ::Hash[Symbol, top],
9
10
  webhook_events_url: String
10
11
  }
11
12
 
@@ -18,9 +19,13 @@ module Cadenya
18
19
 
19
20
  def description=: (String) -> String
20
21
 
21
- attr_reader input_data_schema: top?
22
+ attr_reader input_data_schema: ::Hash[Symbol, top]?
22
23
 
23
- def input_data_schema=: (top) -> top
24
+ def input_data_schema=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top]
25
+
26
+ attr_reader output_definition: ::Hash[Symbol, top]?
27
+
28
+ def output_definition=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top]
24
29
 
25
30
  attr_reader webhook_events_url: String?
26
31
 
@@ -30,7 +35,8 @@ module Cadenya
30
35
  status: Cadenya::Models::AgentSpec::status,
31
36
  variation_selection_mode: Cadenya::Models::AgentSpec::variation_selection_mode,
32
37
  ?description: String,
33
- ?input_data_schema: top,
38
+ ?input_data_schema: ::Hash[Symbol, top],
39
+ ?output_definition: ::Hash[Symbol, top],
34
40
  ?webhook_events_url: String
35
41
  ) -> void
36
42
 
@@ -38,7 +44,8 @@ module Cadenya
38
44
  status: Cadenya::Models::AgentSpec::status,
39
45
  variation_selection_mode: Cadenya::Models::AgentSpec::variation_selection_mode,
40
46
  description: String,
41
- input_data_schema: top,
47
+ input_data_schema: ::Hash[Symbol, top],
48
+ output_definition: ::Hash[Symbol, top],
42
49
  webhook_events_url: String
43
50
  }
44
51