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,107 @@
1
+ # frozen_string_literal: true
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
+ #
15
+ # @overload list(workspace_id, cursor: nil, limit: nil, request_options: {})
16
+ #
17
+ # @param workspace_id [String] The workspace whose members will be listed (path).
18
+ #
19
+ # @param cursor [String] Pagination cursor from previous response
20
+ #
21
+ # @param limit [Integer] Maximum number of results to return
22
+ #
23
+ # @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}, nil]
24
+ #
25
+ # @return [Cadenya::Internal::CursorPagination<Cadenya::Models::WorkspaceMember>]
26
+ #
27
+ # @see Cadenya::Models::WorkspaceAdmin::MemberListParams
28
+ def list(workspace_id, params = {})
29
+ parsed, options = Cadenya::WorkspaceAdmin::MemberListParams.dump_request(params)
30
+ query = Cadenya::Internal::Util.encode_query_params(parsed)
31
+ @client.request(
32
+ method: :get,
33
+ path: ["v1/account/workspaces/%1$s/members", workspace_id],
34
+ query: query,
35
+ page: Cadenya::Internal::CursorPagination,
36
+ model: Cadenya::WorkspaceMember,
37
+ options: options
38
+ )
39
+ end
40
+
41
+ # Grants a profile access to the workspace by creating (or reactivating) the actor
42
+ # that links the profile to the workspace. Accepts either an existing profile_id
43
+ # or an email to resolve-or-invite. Idempotent for an already-active member. Admin
44
+ # only.
45
+ #
46
+ # @overload add(workspace_id, email: nil, profile_id: nil, request_options: {})
47
+ #
48
+ # @param workspace_id [String] The workspace to add the member to (path).
49
+ #
50
+ # @param email [String] Email address to add (resolve-or-invite). Mutually exclusive with profile_id.
51
+ #
52
+ # @param profile_id [String] An existing account profile to add. Mutually exclusive with email.
53
+ #
54
+ # @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}, nil]
55
+ #
56
+ # @return [Cadenya::Models::WorkspaceMember]
57
+ #
58
+ # @see Cadenya::Models::WorkspaceAdmin::MemberAddParams
59
+ def add(workspace_id, params = {})
60
+ parsed, options = Cadenya::WorkspaceAdmin::MemberAddParams.dump_request(params)
61
+ @client.request(
62
+ method: :post,
63
+ path: ["v1/account/workspaces/%1$s/members", workspace_id],
64
+ body: parsed,
65
+ model: Cadenya::WorkspaceMember,
66
+ options: options
67
+ )
68
+ end
69
+
70
+ # Revokes a member's access by deactivating their actor; the member is immediately
71
+ # cut off. The underlying profile is not deleted. Admin only.
72
+ #
73
+ # @overload remove(profile_id, workspace_id:, request_options: {})
74
+ #
75
+ # @param profile_id [String] The profile to remove from the workspace (path).
76
+ #
77
+ # @param workspace_id [String] The workspace to remove the member from (path).
78
+ #
79
+ # @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}, nil]
80
+ #
81
+ # @return [nil]
82
+ #
83
+ # @see Cadenya::Models::WorkspaceAdmin::MemberRemoveParams
84
+ def remove(profile_id, params)
85
+ parsed, options = Cadenya::WorkspaceAdmin::MemberRemoveParams.dump_request(params)
86
+ workspace_id =
87
+ parsed.delete(:workspace_id) do
88
+ raise ArgumentError.new("missing required path argument #{_1}")
89
+ end
90
+ @client.request(
91
+ method: :delete,
92
+ path: ["v1/account/workspaces/%1$s/members/%2$s", workspace_id, profile_id],
93
+ model: NilClass,
94
+ options: options
95
+ )
96
+ end
97
+
98
+ # @api private
99
+ #
100
+ # @param client [Cadenya::Client]
101
+ def initialize(client:)
102
+ @client = client
103
+ end
104
+ end
105
+ end
106
+ end
107
+ end
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
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
+ # Some parameter documentations has been truncated, see
14
+ # {Cadenya::Models::WorkspaceAdmin::ProfileListParams} for more details.
15
+ #
16
+ # Searches the account's profiles for a member picker, with free-form name/email
17
+ # search and an optional type filter. Account-scoped; admin only.
18
+ #
19
+ # @overload list(cursor: nil, limit: nil, query: nil, request_options: {})
20
+ #
21
+ # @param cursor [String] Pagination cursor from previous response
22
+ #
23
+ # @param limit [Integer] Maximum number of results to return
24
+ #
25
+ # @param query [String] Free-form search over profile name and email. Case-insensitive substring
26
+ #
27
+ # @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}, nil]
28
+ #
29
+ # @return [Cadenya::Internal::CursorPagination<Cadenya::Models::Profile>]
30
+ #
31
+ # @see Cadenya::Models::WorkspaceAdmin::ProfileListParams
32
+ def list(params = {})
33
+ parsed, options = Cadenya::WorkspaceAdmin::ProfileListParams.dump_request(params)
34
+ query = Cadenya::Internal::Util.encode_query_params(parsed)
35
+ @client.request(
36
+ method: :get,
37
+ path: "v1/account/profiles",
38
+ query: query,
39
+ page: Cadenya::Internal::CursorPagination,
40
+ model: Cadenya::Profile,
41
+ options: options
42
+ )
43
+ end
44
+
45
+ # @api private
46
+ #
47
+ # @param client [Cadenya::Client]
48
+ def initialize(client:)
49
+ @client = client
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,173 @@
1
+ # frozen_string_literal: true
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
+ # @return [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
+ # @return [Cadenya::Resources::WorkspaceAdmin::Profiles]
28
+ attr_reader :profiles
29
+
30
+ # Some parameter documentations has been truncated, see
31
+ # {Cadenya::Models::WorkspaceAdminCreateParams} for more details.
32
+ #
33
+ # Creates a new workspace in the account. Admin only.
34
+ #
35
+ # @overload create(metadata:, spec:, request_options: {})
36
+ #
37
+ # @param metadata [Cadenya::Models::WorkspaceAdminCreateParams::Metadata] CreateAccountResourceMetadata contains the user-provided fields for creating
38
+ #
39
+ # @param spec [Cadenya::Models::WorkspaceSpec]
40
+ #
41
+ # @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}, nil]
42
+ #
43
+ # @return [Cadenya::Models::Workspace]
44
+ #
45
+ # @see Cadenya::Models::WorkspaceAdminCreateParams
46
+ def create(params)
47
+ parsed, options = Cadenya::WorkspaceAdminCreateParams.dump_request(params)
48
+ @client.request(
49
+ method: :post,
50
+ path: "v1/account/workspaces",
51
+ body: parsed,
52
+ model: Cadenya::Workspace,
53
+ options: options
54
+ )
55
+ end
56
+
57
+ # Retrieves a workspace in the account by ID. Admin only.
58
+ #
59
+ # @overload retrieve(workspace_id, request_options: {})
60
+ #
61
+ # @param workspace_id [String] Workspace ID to retrieve (path).
62
+ #
63
+ # @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}, nil]
64
+ #
65
+ # @return [Cadenya::Models::Workspace]
66
+ #
67
+ # @see Cadenya::Models::WorkspaceAdminRetrieveParams
68
+ def retrieve(workspace_id, params = {})
69
+ @client.request(
70
+ method: :get,
71
+ path: ["v1/account/workspaces/%1$s", workspace_id],
72
+ model: Cadenya::Workspace,
73
+ options: params[:request_options]
74
+ )
75
+ end
76
+
77
+ # Some parameter documentations has been truncated, see
78
+ # {Cadenya::Models::WorkspaceAdminUpdateParams} for more details.
79
+ #
80
+ # Updates a workspace's metadata (e.g. name) and spec. Admin only.
81
+ #
82
+ # @overload update(workspace_id, metadata: nil, spec: nil, update_mask: nil, request_options: {})
83
+ #
84
+ # @param workspace_id [String] Workspace ID to update (path).
85
+ #
86
+ # @param metadata [Cadenya::Models::WorkspaceAdminUpdateParams::Metadata] UpdateAccountResourceMetadata contains the user-provided fields for updating
87
+ #
88
+ # @param spec [Cadenya::Models::WorkspaceSpec]
89
+ #
90
+ # @param update_mask [String] Fields to update.
91
+ #
92
+ # @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}, nil]
93
+ #
94
+ # @return [Cadenya::Models::Workspace]
95
+ #
96
+ # @see Cadenya::Models::WorkspaceAdminUpdateParams
97
+ def update(workspace_id, params = {})
98
+ parsed, options = Cadenya::WorkspaceAdminUpdateParams.dump_request(params)
99
+ @client.request(
100
+ method: :patch,
101
+ path: ["v1/account/workspaces/%1$s", workspace_id],
102
+ body: parsed,
103
+ model: Cadenya::Workspace,
104
+ options: options
105
+ )
106
+ end
107
+
108
+ # Some parameter documentations has been truncated, see
109
+ # {Cadenya::Models::WorkspaceAdminListParams} for more details.
110
+ #
111
+ # Lists every workspace in the account, optionally including archived ones. Admin
112
+ # only.
113
+ #
114
+ # @overload list(cursor: nil, include_archived: nil, limit: nil, request_options: {})
115
+ #
116
+ # @param cursor [String] Pagination cursor from previous response
117
+ #
118
+ # @param include_archived [Boolean] When true, archived workspaces are included in the results. Defaults to
119
+ #
120
+ # @param limit [Integer] Maximum number of results to return
121
+ #
122
+ # @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}, nil]
123
+ #
124
+ # @return [Cadenya::Internal::CursorPagination<Cadenya::Models::Workspace>]
125
+ #
126
+ # @see Cadenya::Models::WorkspaceAdminListParams
127
+ def list(params = {})
128
+ parsed, options = Cadenya::WorkspaceAdminListParams.dump_request(params)
129
+ query = Cadenya::Internal::Util.encode_query_params(parsed)
130
+ @client.request(
131
+ method: :get,
132
+ path: "v1/account/workspaces",
133
+ query: query.transform_keys(include_archived: "includeArchived"),
134
+ page: Cadenya::Internal::CursorPagination,
135
+ model: Cadenya::Workspace,
136
+ options: options
137
+ )
138
+ end
139
+
140
+ # Archives a workspace (soft delete). The workspace is retained, but any
141
+ # subsequent request scoped to it returns a permission error. Archiving the
142
+ # account's last active (non-archived) workspace is not allowed and returns
143
+ # FailedPrecondition. Admin only.
144
+ #
145
+ # @overload archive(workspace_id, request_options: {})
146
+ #
147
+ # @param workspace_id [String] Workspace ID to archive (path).
148
+ #
149
+ # @param request_options [Cadenya::RequestOptions, Hash{Symbol=>Object}, nil]
150
+ #
151
+ # @return [nil]
152
+ #
153
+ # @see Cadenya::Models::WorkspaceAdminArchiveParams
154
+ def archive(workspace_id, params = {})
155
+ @client.request(
156
+ method: :delete,
157
+ path: ["v1/account/workspaces/%1$s", workspace_id],
158
+ model: NilClass,
159
+ options: params[:request_options]
160
+ )
161
+ end
162
+
163
+ # @api private
164
+ #
165
+ # @param client [Cadenya::Client]
166
+ def initialize(client:)
167
+ @client = client
168
+ @members = Cadenya::Resources::WorkspaceAdmin::Members.new(client: client)
169
+ @profiles = Cadenya::Resources::WorkspaceAdmin::Profiles.new(client: client)
170
+ end
171
+ end
172
+ end
173
+ 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
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cadenya
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
data/lib/cadenya.rb CHANGED
@@ -120,8 +120,10 @@ require_relative "cadenya/models/api_keys/access_list_params"
120
120
  require_relative "cadenya/models/api_keys/access_remove_params"
121
121
  require_relative "cadenya/models/api_key_spec"
122
122
  require_relative "cadenya/models/api_key_update_params"
123
+ require_relative "cadenya/models/approval_requirement_filter"
123
124
  require_relative "cadenya/models/assistant_message"
124
125
  require_relative "cadenya/models/assistant_tool_call"
126
+ require_relative "cadenya/models/attribute_filter"
125
127
  require_relative "cadenya/models/bare_metadata"
126
128
  require_relative "cadenya/models/bulk_workspace_apply"
127
129
  require_relative "cadenya/models/bulk_workspace_apply_data"
@@ -146,7 +148,6 @@ require_relative "cadenya/models/callable_tool"
146
148
  require_relative "cadenya/models/context_window_compacted"
147
149
  require_relative "cadenya/models/create_operation_metadata"
148
150
  require_relative "cadenya/models/create_resource_metadata"
149
- require_relative "cadenya/models/mcp_tool_filter"
150
151
  require_relative "cadenya/models/memory_entry_item"
151
152
  require_relative "cadenya/models/memory_layer"
152
153
  require_relative "cadenya/models/memory_layer_create_params"
@@ -222,6 +223,7 @@ require_relative "cadenya/models/resource_metadata"
222
223
  require_relative "cadenya/models/rotate_webhook_signing_key_response"
223
224
  require_relative "cadenya/models/search_search_tools_or_tool_sets_params"
224
225
  require_relative "cadenya/models/search_search_tools_or_tool_sets_response"
226
+ require_relative "cadenya/models/string_matcher"
225
227
  require_relative "cadenya/models/sub_agent_spawned"
226
228
  require_relative "cadenya/models/sub_agent_updated"
227
229
  require_relative "cadenya/models/sync_completed"
@@ -233,22 +235,27 @@ require_relative "cadenya/models/tool_called"
233
235
  require_relative "cadenya/models/tool_denied"
234
236
  require_relative "cadenya/models/tool_entry"
235
237
  require_relative "cadenya/models/tool_error"
238
+ require_relative "cadenya/models/tool_filter"
236
239
  require_relative "cadenya/models/tool_result"
237
240
  require_relative "cadenya/models/tool_set"
238
241
  require_relative "cadenya/models/tool_set_adapter"
239
242
  require_relative "cadenya/models/tool_set_adapter_http"
240
243
  require_relative "cadenya/models/tool_set_adapter_mcp"
244
+ require_relative "cadenya/models/tool_set_adapter_openapi"
241
245
  require_relative "cadenya/models/tool_set_create_params"
242
246
  require_relative "cadenya/models/tool_set_delete_params"
243
247
  require_relative "cadenya/models/tool_set_entry"
244
248
  require_relative "cadenya/models/tool_set_event"
245
249
  require_relative "cadenya/models/tool_set_event_data"
250
+ require_relative "cadenya/models/tool_set_get_openapi_spec_params"
251
+ require_relative "cadenya/models/tool_set_get_openapi_spec_response"
246
252
  require_relative "cadenya/models/tool_set_info"
247
253
  require_relative "cadenya/models/tool_set_list_events_params"
248
254
  require_relative "cadenya/models/tool_set_list_params"
249
255
  require_relative "cadenya/models/tool_set_retrieve_params"
250
256
  require_relative "cadenya/models/tool_sets/config_http"
251
257
  require_relative "cadenya/models/tool_sets/config_mcp"
258
+ require_relative "cadenya/models/tool_sets/config_openapi"
252
259
  require_relative "cadenya/models/tool_sets/tool"
253
260
  require_relative "cadenya/models/tool_sets/tool_create_params"
254
261
  require_relative "cadenya/models/tool_sets/tool_delete_params"
@@ -274,8 +281,18 @@ require_relative "cadenya/models/variation_memory_layer_entry"
274
281
  require_relative "cadenya/models/webhook_unsafe_unwrap_params"
275
282
  require_relative "cadenya/models/webhook_unwrap_params"
276
283
  require_relative "cadenya/models/workspace"
284
+ require_relative "cadenya/models/workspace_admin/member_add_params"
285
+ require_relative "cadenya/models/workspace_admin/member_list_params"
286
+ require_relative "cadenya/models/workspace_admin/member_remove_params"
287
+ require_relative "cadenya/models/workspace_admin/profile_list_params"
288
+ require_relative "cadenya/models/workspace_admin_archive_params"
289
+ require_relative "cadenya/models/workspace_admin_create_params"
290
+ require_relative "cadenya/models/workspace_admin_list_params"
291
+ require_relative "cadenya/models/workspace_admin_retrieve_params"
292
+ require_relative "cadenya/models/workspace_admin_update_params"
277
293
  require_relative "cadenya/models/workspace_get_params"
278
294
  require_relative "cadenya/models/workspace_list_params"
295
+ require_relative "cadenya/models/workspace_member"
279
296
  require_relative "cadenya/models/workspace_secret"
280
297
  require_relative "cadenya/models/workspace_secret_create_params"
281
298
  require_relative "cadenya/models/workspace_secret_delete_params"
@@ -309,5 +326,8 @@ require_relative "cadenya/resources/tool_sets"
309
326
  require_relative "cadenya/resources/tool_sets/tools"
310
327
  require_relative "cadenya/resources/uploads"
311
328
  require_relative "cadenya/resources/webhooks"
329
+ require_relative "cadenya/resources/workspace_admin"
330
+ require_relative "cadenya/resources/workspace_admin/members"
331
+ require_relative "cadenya/resources/workspace_admin/profiles"
312
332
  require_relative "cadenya/resources/workspaces"
313
333
  require_relative "cadenya/resources/workspace_secrets"
@@ -68,9 +68,22 @@ module Cadenya
68
68
 
69
69
  # Manage workspaces within an account. Workspaces provide organizational grouping
70
70
  # and isolation for resources such as agents, tools, and API keys.
71
+ #
72
+ # This is the workspace-scoped, end-user surface. Administrative operations
73
+ # (create / archive workspaces, manage members) live in WorkspaceAdminService
74
+ # under /v1/account/workspaces and require the admin role.
71
75
  sig { returns(Cadenya::Resources::Workspaces) }
72
76
  attr_reader :workspaces
73
77
 
78
+ # Administer workspaces across the account: create and archive workspaces and
79
+ # manage their membership. These operations are account-scoped and require the
80
+ # admin role (a token whose profile holds the WorkOS admin role); they live under
81
+ # /v1/account/workspaces rather than the workspace-scoped /v1/workspaces tree so
82
+ # an admin can manage any workspace in the account, including ones they are not
83
+ # themselves a member of.
84
+ sig { returns(Cadenya::Resources::WorkspaceAdmin) }
85
+ attr_reader :workspace_admin
86
+
74
87
  sig { returns(Cadenya::Resources::Webhooks) }
75
88
  attr_reader :webhooks
76
89
 
@@ -27,12 +27,22 @@ module Cadenya
27
27
  # data schema is also valuable when using an agent as a sub-agent, as the schema
28
28
  # is used as the tool's input parameter schema. If omitted, the sub-agent schema
29
29
  # will be loaded with a simple "prompt" free text string as its schema.
30
- sig { returns(T.nilable(T.anything)) }
30
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
31
31
  attr_reader :input_data_schema
32
32
 
33
- sig { params(input_data_schema: T.anything).void }
33
+ sig { params(input_data_schema: T::Hash[Symbol, T.anything]).void }
34
34
  attr_writer :input_data_schema
35
35
 
36
+ # Optional output definition for objectives created for this agent. When provided,
37
+ # Cadenya will append a tool to that will be called by the LLM in use by the
38
+ # variant to extract information in the format provided here. Use this option when
39
+ # you want structured data to be created by your objectives.
40
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
41
+ attr_reader :output_definition
42
+
43
+ sig { params(output_definition: T::Hash[Symbol, T.anything]).void }
44
+ attr_writer :output_definition
45
+
36
46
  # The URL that Cadenya will send events for any objective assigned to the agent.
37
47
  sig { returns(T.nilable(String)) }
38
48
  attr_reader :webhook_events_url
@@ -47,7 +57,8 @@ module Cadenya
47
57
  variation_selection_mode:
48
58
  Cadenya::AgentSpec::VariationSelectionMode::OrSymbol,
49
59
  description: String,
50
- input_data_schema: T.anything,
60
+ input_data_schema: T::Hash[Symbol, T.anything],
61
+ output_definition: T::Hash[Symbol, T.anything],
51
62
  webhook_events_url: String
52
63
  ).returns(T.attached_class)
53
64
  end
@@ -65,6 +76,11 @@ module Cadenya
65
76
  # is used as the tool's input parameter schema. If omitted, the sub-agent schema
66
77
  # will be loaded with a simple "prompt" free text string as its schema.
67
78
  input_data_schema: nil,
79
+ # Optional output definition for objectives created for this agent. When provided,
80
+ # Cadenya will append a tool to that will be called by the LLM in use by the
81
+ # variant to extract information in the format provided here. Use this option when
82
+ # you want structured data to be created by your objectives.
83
+ output_definition: nil,
68
84
  # The URL that Cadenya will send events for any objective assigned to the agent.
69
85
  webhook_events_url: nil
70
86
  )
@@ -77,7 +93,8 @@ module Cadenya
77
93
  variation_selection_mode:
78
94
  Cadenya::AgentSpec::VariationSelectionMode::OrSymbol,
79
95
  description: String,
80
- input_data_schema: T.anything,
96
+ input_data_schema: T::Hash[Symbol, T.anything],
97
+ output_definition: T::Hash[Symbol, T.anything],
81
98
  webhook_events_url: String
82
99
  }
83
100
  )
@@ -223,6 +223,11 @@ module Cadenya
223
223
  :OBJECTIVE_EVENT_TYPE_SUB_AGENT_UPDATED,
224
224
  Cadenya::Agents::WebhookDeliveryData::EventType::TaggedSymbol
225
225
  )
226
+ OBJECTIVE_EVENT_TYPE_FINALIZED =
227
+ T.let(
228
+ :OBJECTIVE_EVENT_TYPE_FINALIZED,
229
+ Cadenya::Agents::WebhookDeliveryData::EventType::TaggedSymbol
230
+ )
226
231
 
227
232
  sig do
228
233
  override.returns(
@@ -192,6 +192,11 @@ module Cadenya
192
192
  :OBJECTIVE_EVENT_TYPE_SUB_AGENT_UPDATED,
193
193
  Cadenya::Agents::WebhookDeliveryListParams::EventType::TaggedSymbol
194
194
  )
195
+ OBJECTIVE_EVENT_TYPE_FINALIZED =
196
+ T.let(
197
+ :OBJECTIVE_EVENT_TYPE_FINALIZED,
198
+ Cadenya::Agents::WebhookDeliveryListParams::EventType::TaggedSymbol
199
+ )
195
200
 
196
201
  sig do
197
202
  override.returns(
@@ -0,0 +1,45 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Models
5
+ class ApprovalRequirementFilter < Cadenya::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Cadenya::ApprovalRequirementFilter, Cadenya::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(T.nilable(T::Boolean)) }
12
+ attr_reader :always
13
+
14
+ sig { params(always: T::Boolean).void }
15
+ attr_writer :always
16
+
17
+ # Top-level filter with simple boolean logic (no nesting)
18
+ sig { returns(T.nilable(Cadenya::ToolFilter)) }
19
+ attr_reader :only
20
+
21
+ sig { params(only: Cadenya::ToolFilter::OrHash).void }
22
+ attr_writer :only
23
+
24
+ # Approval filters that will automatically set the approval requirement on tools
25
+ # synced from an external source
26
+ sig do
27
+ params(always: T::Boolean, only: Cadenya::ToolFilter::OrHash).returns(
28
+ T.attached_class
29
+ )
30
+ end
31
+ def self.new(
32
+ always: nil,
33
+ # Top-level filter with simple boolean logic (no nesting)
34
+ only: nil
35
+ )
36
+ end
37
+
38
+ sig do
39
+ override.returns({ always: T::Boolean, only: Cadenya::ToolFilter })
40
+ end
41
+ def to_hash
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,84 @@
1
+ # typed: strong
2
+
3
+ module Cadenya
4
+ module Models
5
+ class AttributeFilter < Cadenya::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Cadenya::AttributeFilter, Cadenya::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(Cadenya::AttributeFilter::Attribute::OrSymbol) }
12
+ attr_accessor :attribute
13
+
14
+ # String matching operations
15
+ sig { returns(T.nilable(Cadenya::StringMatcher)) }
16
+ attr_reader :matcher
17
+
18
+ sig { params(matcher: Cadenya::StringMatcher::OrHash).void }
19
+ attr_writer :matcher
20
+
21
+ # Single attribute filter
22
+ sig do
23
+ params(
24
+ attribute: Cadenya::AttributeFilter::Attribute::OrSymbol,
25
+ matcher: Cadenya::StringMatcher::OrHash
26
+ ).returns(T.attached_class)
27
+ end
28
+ def self.new(
29
+ attribute:,
30
+ # String matching operations
31
+ matcher: nil
32
+ )
33
+ end
34
+
35
+ sig do
36
+ override.returns(
37
+ {
38
+ attribute: Cadenya::AttributeFilter::Attribute::OrSymbol,
39
+ matcher: Cadenya::StringMatcher
40
+ }
41
+ )
42
+ end
43
+ def to_hash
44
+ end
45
+
46
+ module Attribute
47
+ extend Cadenya::Internal::Type::Enum
48
+
49
+ TaggedSymbol =
50
+ T.type_alias { T.all(Symbol, Cadenya::AttributeFilter::Attribute) }
51
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
52
+
53
+ ATTRIBUTE_UNSPECIFIED =
54
+ T.let(
55
+ :ATTRIBUTE_UNSPECIFIED,
56
+ Cadenya::AttributeFilter::Attribute::TaggedSymbol
57
+ )
58
+ ATTRIBUTE_NAME =
59
+ T.let(
60
+ :ATTRIBUTE_NAME,
61
+ Cadenya::AttributeFilter::Attribute::TaggedSymbol
62
+ )
63
+ ATTRIBUTE_TITLE =
64
+ T.let(
65
+ :ATTRIBUTE_TITLE,
66
+ Cadenya::AttributeFilter::Attribute::TaggedSymbol
67
+ )
68
+ ATTRIBUTE_DESCRIPTION =
69
+ T.let(
70
+ :ATTRIBUTE_DESCRIPTION,
71
+ Cadenya::AttributeFilter::Attribute::TaggedSymbol
72
+ )
73
+
74
+ sig do
75
+ override.returns(
76
+ T::Array[Cadenya::AttributeFilter::Attribute::TaggedSymbol]
77
+ )
78
+ end
79
+ def self.values
80
+ end
81
+ end
82
+ end
83
+ end
84
+ end