cadenya 0.4.0 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e7f15c89788992e84faa1b1a059033314f7c115317be1f0fdba0e49793bc0aa6
4
- data.tar.gz: d56587810401e084e8b5497254d6a6680fc22b3eff1bf70af6bc20461a3b19e1
3
+ metadata.gz: f2d3ccc2b08967b6c09113b9f86077582cecb2ff914643efd624d35f590ee2e9
4
+ data.tar.gz: 7e2cfc5c58da2c628a855f586bc46aba2b96c936ac13611c3cb0761b54c0e028
5
5
  SHA512:
6
- metadata.gz: c696765a5ffb6e7c97c6b3cb729b711fe424626b45e6e0732ef37a5dc9b56bde28f8ca54d0db305657bf459b4e3dfa3081f905e26a17a6e503b3b5709b82ef38
7
- data.tar.gz: 9f178edbcaf810c598ccf931ee62bc8c68479f41128c63143852a255b673dcd69e1306706407cf7c0bb7f2ced5c8c581be9d45be426d04ab0306e3ce13e934cc
6
+ metadata.gz: 577b0a9463ee0830ec2f85033e6e858172101ca5580f398c919c4c45b6c5d5867358fa2c3e1dc18f316040ce50bde17065d18991a7bc053a8d4a4dcae936ac54
7
+ data.tar.gz: 623d30dc59554aeb07440ac9c163fc99ff2cb45120c36601a74133b3cb7cb02301f37b5abcf47addf165eacdc2652254846a81d9bf0f2d02ce49d71ac3f091f3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.0 (2026-06-07)
4
+
5
+ Full Changelog: [v0.4.0...v0.5.0](https://github.com/cadenya/cadenya-ruby/compare/v0.4.0...v0.5.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([d88fdeb](https://github.com/cadenya/cadenya-ruby/commit/d88fdeb06d9d9ba77523cb5b36818c74119ec466))
10
+
3
11
  ## 0.4.0 (2026-06-07)
4
12
 
5
13
  Full Changelog: [v0.3.0...v0.4.0](https://github.com/cadenya/cadenya-ruby/compare/v0.3.0...v0.4.0)
data/README.md CHANGED
@@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application
26
26
  <!-- x-release-please-start-version -->
27
27
 
28
28
  ```ruby
29
- gem "cadenya", "~> 0.4.0"
29
+ gem "cadenya", "~> 0.5.0"
30
30
  ```
31
31
 
32
32
  <!-- x-release-please-end -->
@@ -15,7 +15,16 @@ module Cadenya
15
15
  # @return [Cadenya::Models::AIProviderKeySpec]
16
16
  required :spec, -> { Cadenya::AIProviderKeySpec }
17
17
 
18
- # @!method initialize(metadata:, spec:)
18
+ response_only do
19
+ # @!attribute info
20
+ # AIProviderKeyInfo carries server-derived, read-only details about a key, for AI
21
+ # provider management UIs.
22
+ #
23
+ # @return [Cadenya::Models::AIProviderKey::Info, nil]
24
+ optional :info, -> { Cadenya::AIProviderKey::Info }
25
+ end
26
+
27
+ # @!method initialize(metadata:, spec:, info: nil)
19
28
  # Some parameter documentations has been truncated, see
20
29
  # {Cadenya::Models::AIProviderKey} for more details.
21
30
  #
@@ -25,6 +34,33 @@ module Cadenya
25
34
  # @param metadata [Cadenya::Models::ResourceMetadata] Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
26
35
  #
27
36
  # @param spec [Cadenya::Models::AIProviderKeySpec]
37
+ #
38
+ # @param info [Cadenya::Models::AIProviderKey::Info] AIProviderKeyInfo carries server-derived, read-only details about a key, for
39
+
40
+ # @see Cadenya::Models::AIProviderKey#info
41
+ class Info < Cadenya::Internal::Type::BaseModel
42
+ response_only do
43
+ # @!attribute disabled_model_count
44
+ # Number of disabled models provisioned on this key.
45
+ #
46
+ # @return [Integer, nil]
47
+ optional :disabled_model_count, Integer, api_name: :disabledModelCount
48
+
49
+ # @!attribute enabled_model_count
50
+ # Number of enabled models provisioned on this key.
51
+ #
52
+ # @return [Integer, nil]
53
+ optional :enabled_model_count, Integer, api_name: :enabledModelCount
54
+ end
55
+
56
+ # @!method initialize(disabled_model_count: nil, enabled_model_count: nil)
57
+ # AIProviderKeyInfo carries server-derived, read-only details about a key, for AI
58
+ # provider management UIs.
59
+ #
60
+ # @param disabled_model_count [Integer] Number of disabled models provisioned on this key.
61
+ #
62
+ # @param enabled_model_count [Integer] Number of enabled models provisioned on this key.
63
+ end
28
64
  end
29
65
  end
30
66
  end
@@ -18,6 +18,13 @@ module Cadenya
18
18
  # @return [String, nil]
19
19
  optional :cursor, String
20
20
 
21
+ # @!attribute include_info
22
+ # When true, populate each item's info (model counts), at the cost of extra
23
+ # lookups.
24
+ #
25
+ # @return [Boolean, nil]
26
+ optional :include_info, Cadenya::Internal::Type::Boolean
27
+
21
28
  # @!attribute limit
22
29
  # Maximum number of results to return
23
30
  #
@@ -42,11 +49,16 @@ module Cadenya
42
49
  # @return [String, nil]
43
50
  optional :sort_order, String
44
51
 
45
- # @!method initialize(workspace_id:, cursor: nil, limit: nil, prefix: nil, query: nil, sort_order: nil, request_options: {})
52
+ # @!method initialize(workspace_id:, cursor: nil, include_info: nil, limit: nil, prefix: nil, query: nil, sort_order: nil, request_options: {})
53
+ # Some parameter documentations has been truncated, see
54
+ # {Cadenya::Models::AIProviderKeyListParams} for more details.
55
+ #
46
56
  # @param workspace_id [String]
47
57
  #
48
58
  # @param cursor [String] Pagination cursor from previous response
49
59
  #
60
+ # @param include_info [Boolean] When true, populate each item's info (model counts), at the cost of extra
61
+ #
50
62
  # @param limit [Integer] Maximum number of results to return
51
63
  #
52
64
  # @param prefix [String] Filter expression (query param: prefix)
@@ -10,27 +10,42 @@ module Cadenya
10
10
  # @return [String, nil]
11
11
  optional :api_key, String, api_name: :apiKey
12
12
 
13
- # @!attribute provider
14
- # The AI provider this key authenticates against. Currently "openrouter".
13
+ # @!attribute openrouter
14
+ # OpenRouterConfig holds OpenRouter-specific settings. Empty for now; it exists as
15
+ # the oneof seam so provider-specific options (region, base URL, etc.) can be
16
+ # added later without restructuring the spec.
15
17
  #
16
- # @return [String, nil]
17
- optional :provider, String
18
+ # @return [Object, nil]
19
+ optional :openrouter, Cadenya::Internal::Type::Unknown
18
20
 
19
- # @!attribute region
20
- # The provider region. "us" or "eu". Defaults to "us".
21
+ # @!attribute provider
22
+ # The AI provider this key authenticates against.
21
23
  #
22
- # @return [String, nil]
23
- optional :region, String
24
+ # @return [Symbol, Cadenya::Models::AIProviderKeySpec::Provider, nil]
25
+ optional :provider, enum: -> { Cadenya::AIProviderKeySpec::Provider }
24
26
 
25
- # @!method initialize(api_key: nil, provider: nil, region: nil)
27
+ # @!method initialize(api_key: nil, openrouter: nil, provider: nil)
26
28
  # Some parameter documentations has been truncated, see
27
29
  # {Cadenya::Models::AIProviderKeySpec} for more details.
28
30
  #
29
31
  # @param api_key [String] The provider credential. Accepted on create/update; never populated in
30
32
  #
31
- # @param provider [String] The AI provider this key authenticates against. Currently "openrouter".
33
+ # @param openrouter [Object] OpenRouterConfig holds OpenRouter-specific settings. Empty for now; it exists
32
34
  #
33
- # @param region [String] The provider region. "us" or "eu". Defaults to "us".
35
+ # @param provider [Symbol, Cadenya::Models::AIProviderKeySpec::Provider] The AI provider this key authenticates against.
36
+
37
+ # The AI provider this key authenticates against.
38
+ #
39
+ # @see Cadenya::Models::AIProviderKeySpec#provider
40
+ module Provider
41
+ extend Cadenya::Internal::Type::Enum
42
+
43
+ AI_PROVIDER_UNSPECIFIED = :AI_PROVIDER_UNSPECIFIED
44
+ AI_PROVIDER_OPENROUTER = :AI_PROVIDER_OPENROUTER
45
+
46
+ # @!method self.values
47
+ # @return [Array<Symbol>]
48
+ end
34
49
  end
35
50
  end
36
51
  end
@@ -16,13 +16,68 @@ module Cadenya
16
16
  # @return [Cadenya::Models::ModelSpec]
17
17
  required :spec, -> { Cadenya::ModelSpec }
18
18
 
19
- # @!method initialize(metadata:, spec:)
19
+ response_only do
20
+ # @!attribute info
21
+ # ModelInfo carries server-derived, read-only details about a model.
22
+ #
23
+ # @return [Cadenya::Models::Model::Info, nil]
24
+ optional :info, -> { Cadenya::Model::Info }
25
+ end
26
+
27
+ # @!method initialize(metadata:, spec:, info: nil)
20
28
  # Some parameter documentations has been truncated, see {Cadenya::Models::Model}
21
29
  # for more details.
22
30
  #
23
31
  # @param metadata [Cadenya::Models::ResourceMetadata] Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
24
32
  #
25
33
  # @param spec [Cadenya::Models::ModelSpec] Model specification
34
+ #
35
+ # @param info [Cadenya::Models::Model::Info] ModelInfo carries server-derived, read-only details about a model.
36
+
37
+ # @see Cadenya::Models::Model#info
38
+ class Info < Cadenya::Internal::Type::BaseModel
39
+ response_only do
40
+ # @!attribute ai_provider_key
41
+ # BareMetadata contains the minimal metadata for a resource: the ID and an
42
+ # optional human-readable name. These are used for reference fields where the full
43
+ # metadata (account scoping, timestamps, labels, external IDs) is not needed —
44
+ # e.g., the tool references inside an agent variation spec or the tools assigned
45
+ # to an objective. Both fields are server-populated; clients provide IDs through
46
+ # sibling fields rather than by constructing a BareMetadata themselves.
47
+ #
48
+ # @return [Cadenya::Models::BareMetadata, nil]
49
+ optional :ai_provider_key, -> { Cadenya::BareMetadata }, api_name: :aiProviderKey
50
+
51
+ # @!attribute provider
52
+ # The AI provider this model routes through (via its provider key).
53
+ #
54
+ # @return [Symbol, Cadenya::Models::Model::Info::Provider, nil]
55
+ optional :provider, enum: -> { Cadenya::Model::Info::Provider }
56
+ end
57
+
58
+ # @!method initialize(ai_provider_key: nil, provider: nil)
59
+ # Some parameter documentations has been truncated, see
60
+ # {Cadenya::Models::Model::Info} for more details.
61
+ #
62
+ # ModelInfo carries server-derived, read-only details about a model.
63
+ #
64
+ # @param ai_provider_key [Cadenya::Models::BareMetadata] BareMetadata contains the minimal metadata for a resource: the ID and an
65
+ #
66
+ # @param provider [Symbol, Cadenya::Models::Model::Info::Provider] The AI provider this model routes through (via its provider key).
67
+
68
+ # The AI provider this model routes through (via its provider key).
69
+ #
70
+ # @see Cadenya::Models::Model::Info#provider
71
+ module Provider
72
+ extend Cadenya::Internal::Type::Enum
73
+
74
+ AI_PROVIDER_UNSPECIFIED = :AI_PROVIDER_UNSPECIFIED
75
+ AI_PROVIDER_OPENROUTER = :AI_PROVIDER_OPENROUTER
76
+
77
+ # @!method self.values
78
+ # @return [Array<Symbol>]
79
+ end
80
+ end
26
81
  end
27
82
  end
28
83
  end
@@ -12,6 +12,13 @@ module Cadenya
12
12
  # @return [String]
13
13
  required :workspace_id, String
14
14
 
15
+ # @!attribute ai_provider_key_id
16
+ # Filter to models provisioned on a specific AI provider key. Accepts the key's id
17
+ # or an "external_id:"-prefixed slug.
18
+ #
19
+ # @return [String, nil]
20
+ optional :ai_provider_key_id, String
21
+
15
22
  # @!attribute bundle_key
16
23
  # Filter by bundle_key — return only resources owned by this bundle.
17
24
  #
@@ -24,6 +31,13 @@ module Cadenya
24
31
  # @return [String, nil]
25
32
  optional :cursor, String
26
33
 
34
+ # @!attribute include_info
35
+ # When true, populate each item's info (e.g. the AI provider), at the cost of
36
+ # extra lookups.
37
+ #
38
+ # @return [Boolean, nil]
39
+ optional :include_info, Cadenya::Internal::Type::Boolean
40
+
27
41
  # @!attribute limit
28
42
  # Maximum number of results to return
29
43
  #
@@ -54,13 +68,20 @@ module Cadenya
54
68
  # @return [Symbol, Cadenya::Models::ModelListParams::Status, nil]
55
69
  optional :status, enum: -> { Cadenya::ModelListParams::Status }
56
70
 
57
- # @!method initialize(workspace_id:, bundle_key: nil, cursor: nil, limit: nil, prefix: nil, query: nil, sort_order: nil, status: nil, request_options: {})
71
+ # @!method initialize(workspace_id:, ai_provider_key_id: nil, bundle_key: nil, cursor: nil, include_info: nil, limit: nil, prefix: nil, query: nil, sort_order: nil, status: nil, request_options: {})
72
+ # Some parameter documentations has been truncated, see
73
+ # {Cadenya::Models::ModelListParams} for more details.
74
+ #
58
75
  # @param workspace_id [String]
59
76
  #
77
+ # @param ai_provider_key_id [String] Filter to models provisioned on a specific AI provider key. Accepts the
78
+ #
60
79
  # @param bundle_key [String] Filter by bundle_key — return only resources owned by this bundle.
61
80
  #
62
81
  # @param cursor [String] Pagination cursor from previous response
63
82
  #
83
+ # @param include_info [Boolean] When true, populate each item's info (e.g. the AI provider), at the cost of
84
+ #
64
85
  # @param limit [Integer] Maximum number of results to return
65
86
  #
66
87
  # @param prefix [String] Filter by name prefix
@@ -96,14 +96,19 @@ module Cadenya
96
96
  )
97
97
  end
98
98
 
99
+ # Some parameter documentations has been truncated, see
100
+ # {Cadenya::Models::AIProviderKeyListParams} for more details.
101
+ #
99
102
  # Lists all customer-provided AI provider keys in the workspace
100
103
  #
101
- # @overload list(workspace_id, cursor: nil, limit: nil, prefix: nil, query: nil, sort_order: nil, request_options: {})
104
+ # @overload list(workspace_id, cursor: nil, include_info: nil, limit: nil, prefix: nil, query: nil, sort_order: nil, request_options: {})
102
105
  #
103
106
  # @param workspace_id [String] The workspace whose keys will be listed.
104
107
  #
105
108
  # @param cursor [String] Pagination cursor from previous response
106
109
  #
110
+ # @param include_info [Boolean] When true, populate each item's info (model counts), at the cost of extra
111
+ #
107
112
  # @param limit [Integer] Maximum number of results to return
108
113
  #
109
114
  # @param prefix [String] Filter expression (query param: prefix)
@@ -123,7 +128,7 @@ module Cadenya
123
128
  @client.request(
124
129
  method: :get,
125
130
  path: ["v1/workspaces/%1$s/ai_provider_keys", workspace_id],
126
- query: query.transform_keys(sort_order: "sortOrder"),
131
+ query: query.transform_keys(include_info: "includeInfo", sort_order: "sortOrder"),
127
132
  page: Cadenya::Internal::CursorPagination,
128
133
  model: Cadenya::AIProviderKey,
129
134
  options: options
@@ -33,16 +33,23 @@ module Cadenya
33
33
  )
34
34
  end
35
35
 
36
+ # Some parameter documentations has been truncated, see
37
+ # {Cadenya::Models::ModelListParams} for more details.
38
+ #
36
39
  # Lists all models in the workspace
37
40
  #
38
- # @overload list(workspace_id, bundle_key: nil, cursor: nil, limit: nil, prefix: nil, query: nil, sort_order: nil, status: nil, request_options: {})
41
+ # @overload list(workspace_id, ai_provider_key_id: nil, bundle_key: nil, cursor: nil, include_info: nil, limit: nil, prefix: nil, query: nil, sort_order: nil, status: nil, request_options: {})
39
42
  #
40
43
  # @param workspace_id [String] Workspace ID.
41
44
  #
45
+ # @param ai_provider_key_id [String] Filter to models provisioned on a specific AI provider key. Accepts the
46
+ #
42
47
  # @param bundle_key [String] Filter by bundle_key — return only resources owned by this bundle.
43
48
  #
44
49
  # @param cursor [String] Pagination cursor from previous response
45
50
  #
51
+ # @param include_info [Boolean] When true, populate each item's info (e.g. the AI provider), at the cost of
52
+ #
46
53
  # @param limit [Integer] Maximum number of results to return
47
54
  #
48
55
  # @param prefix [String] Filter by name prefix
@@ -64,7 +71,12 @@ module Cadenya
64
71
  @client.request(
65
72
  method: :get,
66
73
  path: ["v1/workspaces/%1$s/models", workspace_id],
67
- query: query.transform_keys(bundle_key: "bundleKey", sort_order: "sortOrder"),
74
+ query: query.transform_keys(
75
+ ai_provider_key_id: "aiProviderKeyId",
76
+ bundle_key: "bundleKey",
77
+ include_info: "includeInfo",
78
+ sort_order: "sortOrder"
79
+ ),
68
80
  page: Cadenya::Internal::CursorPagination,
69
81
  model: Cadenya::Model,
70
82
  options: options
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cadenya
4
- VERSION = "0.4.0"
4
+ VERSION = "0.5.0"
5
5
  end
@@ -21,18 +21,30 @@ module Cadenya
21
21
  sig { params(spec: Cadenya::AIProviderKeySpec::OrHash).void }
22
22
  attr_writer :spec
23
23
 
24
+ # AIProviderKeyInfo carries server-derived, read-only details about a key, for AI
25
+ # provider management UIs.
26
+ sig { returns(T.nilable(Cadenya::AIProviderKey::Info)) }
27
+ attr_reader :info
28
+
29
+ sig { params(info: Cadenya::AIProviderKey::Info::OrHash).void }
30
+ attr_writer :info
31
+
24
32
  # AIProviderKey is a customer-provided (BYOK) credential for an AI provider,
25
33
  # scoped to a workspace. The secret value is never returned in responses.
26
34
  sig do
27
35
  params(
28
36
  metadata: Cadenya::ResourceMetadata::OrHash,
29
- spec: Cadenya::AIProviderKeySpec::OrHash
37
+ spec: Cadenya::AIProviderKeySpec::OrHash,
38
+ info: Cadenya::AIProviderKey::Info::OrHash
30
39
  ).returns(T.attached_class)
31
40
  end
32
41
  def self.new(
33
42
  # Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
34
43
  metadata:,
35
- spec:
44
+ spec:,
45
+ # AIProviderKeyInfo carries server-derived, read-only details about a key, for AI
46
+ # provider management UIs.
47
+ info: nil
36
48
  )
37
49
  end
38
50
 
@@ -40,12 +52,58 @@ module Cadenya
40
52
  override.returns(
41
53
  {
42
54
  metadata: Cadenya::ResourceMetadata,
43
- spec: Cadenya::AIProviderKeySpec
55
+ spec: Cadenya::AIProviderKeySpec,
56
+ info: Cadenya::AIProviderKey::Info
44
57
  }
45
58
  )
46
59
  end
47
60
  def to_hash
48
61
  end
62
+
63
+ class Info < Cadenya::Internal::Type::BaseModel
64
+ OrHash =
65
+ T.type_alias do
66
+ T.any(Cadenya::AIProviderKey::Info, Cadenya::Internal::AnyHash)
67
+ end
68
+
69
+ # Number of disabled models provisioned on this key.
70
+ sig { returns(T.nilable(Integer)) }
71
+ attr_reader :disabled_model_count
72
+
73
+ sig { params(disabled_model_count: Integer).void }
74
+ attr_writer :disabled_model_count
75
+
76
+ # Number of enabled models provisioned on this key.
77
+ sig { returns(T.nilable(Integer)) }
78
+ attr_reader :enabled_model_count
79
+
80
+ sig { params(enabled_model_count: Integer).void }
81
+ attr_writer :enabled_model_count
82
+
83
+ # AIProviderKeyInfo carries server-derived, read-only details about a key, for AI
84
+ # provider management UIs.
85
+ sig do
86
+ params(
87
+ disabled_model_count: Integer,
88
+ enabled_model_count: Integer
89
+ ).returns(T.attached_class)
90
+ end
91
+ def self.new(
92
+ # Number of disabled models provisioned on this key.
93
+ disabled_model_count: nil,
94
+ # Number of enabled models provisioned on this key.
95
+ enabled_model_count: nil
96
+ )
97
+ end
98
+
99
+ sig do
100
+ override.returns(
101
+ { disabled_model_count: Integer, enabled_model_count: Integer }
102
+ )
103
+ end
104
+ def to_hash
105
+ end
106
+ end
49
107
  end
50
108
  end
51
109
  end
@@ -21,6 +21,14 @@ module Cadenya
21
21
  sig { params(cursor: String).void }
22
22
  attr_writer :cursor
23
23
 
24
+ # When true, populate each item's info (model counts), at the cost of extra
25
+ # lookups.
26
+ sig { returns(T.nilable(T::Boolean)) }
27
+ attr_reader :include_info
28
+
29
+ sig { params(include_info: T::Boolean).void }
30
+ attr_writer :include_info
31
+
24
32
  # Maximum number of results to return
25
33
  sig { returns(T.nilable(Integer)) }
26
34
  attr_reader :limit
@@ -53,6 +61,7 @@ module Cadenya
53
61
  params(
54
62
  workspace_id: String,
55
63
  cursor: String,
64
+ include_info: T::Boolean,
56
65
  limit: Integer,
57
66
  prefix: String,
58
67
  query: String,
@@ -64,6 +73,9 @@ module Cadenya
64
73
  workspace_id:,
65
74
  # Pagination cursor from previous response
66
75
  cursor: nil,
76
+ # When true, populate each item's info (model counts), at the cost of extra
77
+ # lookups.
78
+ include_info: nil,
67
79
  # Maximum number of results to return
68
80
  limit: nil,
69
81
  # Filter expression (query param: prefix)
@@ -81,6 +93,7 @@ module Cadenya
81
93
  {
82
94
  workspace_id: String,
83
95
  cursor: String,
96
+ include_info: T::Boolean,
84
97
  limit: Integer,
85
98
  prefix: String,
86
99
  query: String,
@@ -16,41 +16,83 @@ module Cadenya
16
16
  sig { params(api_key: String).void }
17
17
  attr_writer :api_key
18
18
 
19
- # The AI provider this key authenticates against. Currently "openrouter".
20
- sig { returns(T.nilable(String)) }
21
- attr_reader :provider
19
+ # OpenRouterConfig holds OpenRouter-specific settings. Empty for now; it exists as
20
+ # the oneof seam so provider-specific options (region, base URL, etc.) can be
21
+ # added later without restructuring the spec.
22
+ sig { returns(T.nilable(T.anything)) }
23
+ attr_reader :openrouter
22
24
 
23
- sig { params(provider: String).void }
24
- attr_writer :provider
25
+ sig { params(openrouter: T.anything).void }
26
+ attr_writer :openrouter
25
27
 
26
- # The provider region. "us" or "eu". Defaults to "us".
27
- sig { returns(T.nilable(String)) }
28
- attr_reader :region
28
+ # The AI provider this key authenticates against.
29
+ sig { returns(T.nilable(Cadenya::AIProviderKeySpec::Provider::OrSymbol)) }
30
+ attr_reader :provider
29
31
 
30
- sig { params(region: String).void }
31
- attr_writer :region
32
+ sig do
33
+ params(provider: Cadenya::AIProviderKeySpec::Provider::OrSymbol).void
34
+ end
35
+ attr_writer :provider
32
36
 
33
37
  sig do
34
- params(api_key: String, provider: String, region: String).returns(
35
- T.attached_class
36
- )
38
+ params(
39
+ api_key: String,
40
+ openrouter: T.anything,
41
+ provider: Cadenya::AIProviderKeySpec::Provider::OrSymbol
42
+ ).returns(T.attached_class)
37
43
  end
38
44
  def self.new(
39
45
  # The provider credential. Accepted on create/update; never populated in responses
40
46
  # (the server returns an empty value to avoid leaking it).
41
47
  api_key: nil,
42
- # The AI provider this key authenticates against. Currently "openrouter".
43
- provider: nil,
44
- # The provider region. "us" or "eu". Defaults to "us".
45
- region: nil
48
+ # OpenRouterConfig holds OpenRouter-specific settings. Empty for now; it exists as
49
+ # the oneof seam so provider-specific options (region, base URL, etc.) can be
50
+ # added later without restructuring the spec.
51
+ openrouter: nil,
52
+ # The AI provider this key authenticates against.
53
+ provider: nil
46
54
  )
47
55
  end
48
56
 
49
57
  sig do
50
- override.returns({ api_key: String, provider: String, region: String })
58
+ override.returns(
59
+ {
60
+ api_key: String,
61
+ openrouter: T.anything,
62
+ provider: Cadenya::AIProviderKeySpec::Provider::OrSymbol
63
+ }
64
+ )
51
65
  end
52
66
  def to_hash
53
67
  end
68
+
69
+ # The AI provider this key authenticates against.
70
+ module Provider
71
+ extend Cadenya::Internal::Type::Enum
72
+
73
+ TaggedSymbol =
74
+ T.type_alias { T.all(Symbol, Cadenya::AIProviderKeySpec::Provider) }
75
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
76
+
77
+ AI_PROVIDER_UNSPECIFIED =
78
+ T.let(
79
+ :AI_PROVIDER_UNSPECIFIED,
80
+ Cadenya::AIProviderKeySpec::Provider::TaggedSymbol
81
+ )
82
+ AI_PROVIDER_OPENROUTER =
83
+ T.let(
84
+ :AI_PROVIDER_OPENROUTER,
85
+ Cadenya::AIProviderKeySpec::Provider::TaggedSymbol
86
+ )
87
+
88
+ sig do
89
+ override.returns(
90
+ T::Array[Cadenya::AIProviderKeySpec::Provider::TaggedSymbol]
91
+ )
92
+ end
93
+ def self.values
94
+ end
95
+ end
54
96
  end
55
97
  end
56
98
  end
@@ -20,27 +20,126 @@ module Cadenya
20
20
  sig { params(spec: Cadenya::ModelSpec::OrHash).void }
21
21
  attr_writer :spec
22
22
 
23
+ # ModelInfo carries server-derived, read-only details about a model.
24
+ sig { returns(T.nilable(Cadenya::Model::Info)) }
25
+ attr_reader :info
26
+
27
+ sig { params(info: Cadenya::Model::Info::OrHash).void }
28
+ attr_writer :info
29
+
23
30
  sig do
24
31
  params(
25
32
  metadata: Cadenya::ResourceMetadata::OrHash,
26
- spec: Cadenya::ModelSpec::OrHash
33
+ spec: Cadenya::ModelSpec::OrHash,
34
+ info: Cadenya::Model::Info::OrHash
27
35
  ).returns(T.attached_class)
28
36
  end
29
37
  def self.new(
30
38
  # Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
31
39
  metadata:,
32
40
  # Model specification
33
- spec:
41
+ spec:,
42
+ # ModelInfo carries server-derived, read-only details about a model.
43
+ info: nil
34
44
  )
35
45
  end
36
46
 
37
47
  sig do
38
48
  override.returns(
39
- { metadata: Cadenya::ResourceMetadata, spec: Cadenya::ModelSpec }
49
+ {
50
+ metadata: Cadenya::ResourceMetadata,
51
+ spec: Cadenya::ModelSpec,
52
+ info: Cadenya::Model::Info
53
+ }
40
54
  )
41
55
  end
42
56
  def to_hash
43
57
  end
58
+
59
+ class Info < Cadenya::Internal::Type::BaseModel
60
+ OrHash =
61
+ T.type_alias do
62
+ T.any(Cadenya::Model::Info, Cadenya::Internal::AnyHash)
63
+ end
64
+
65
+ # BareMetadata contains the minimal metadata for a resource: the ID and an
66
+ # optional human-readable name. These are used for reference fields where the full
67
+ # metadata (account scoping, timestamps, labels, external IDs) is not needed —
68
+ # e.g., the tool references inside an agent variation spec or the tools assigned
69
+ # to an objective. Both fields are server-populated; clients provide IDs through
70
+ # sibling fields rather than by constructing a BareMetadata themselves.
71
+ sig { returns(T.nilable(Cadenya::BareMetadata)) }
72
+ attr_reader :ai_provider_key
73
+
74
+ sig { params(ai_provider_key: Cadenya::BareMetadata::OrHash).void }
75
+ attr_writer :ai_provider_key
76
+
77
+ # The AI provider this model routes through (via its provider key).
78
+ sig { returns(T.nilable(Cadenya::Model::Info::Provider::TaggedSymbol)) }
79
+ attr_reader :provider
80
+
81
+ sig { params(provider: Cadenya::Model::Info::Provider::OrSymbol).void }
82
+ attr_writer :provider
83
+
84
+ # ModelInfo carries server-derived, read-only details about a model.
85
+ sig do
86
+ params(
87
+ ai_provider_key: Cadenya::BareMetadata::OrHash,
88
+ provider: Cadenya::Model::Info::Provider::OrSymbol
89
+ ).returns(T.attached_class)
90
+ end
91
+ def self.new(
92
+ # BareMetadata contains the minimal metadata for a resource: the ID and an
93
+ # optional human-readable name. These are used for reference fields where the full
94
+ # metadata (account scoping, timestamps, labels, external IDs) is not needed —
95
+ # e.g., the tool references inside an agent variation spec or the tools assigned
96
+ # to an objective. Both fields are server-populated; clients provide IDs through
97
+ # sibling fields rather than by constructing a BareMetadata themselves.
98
+ ai_provider_key: nil,
99
+ # The AI provider this model routes through (via its provider key).
100
+ provider: nil
101
+ )
102
+ end
103
+
104
+ sig do
105
+ override.returns(
106
+ {
107
+ ai_provider_key: Cadenya::BareMetadata,
108
+ provider: Cadenya::Model::Info::Provider::TaggedSymbol
109
+ }
110
+ )
111
+ end
112
+ def to_hash
113
+ end
114
+
115
+ # The AI provider this model routes through (via its provider key).
116
+ module Provider
117
+ extend Cadenya::Internal::Type::Enum
118
+
119
+ TaggedSymbol =
120
+ T.type_alias { T.all(Symbol, Cadenya::Model::Info::Provider) }
121
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
122
+
123
+ AI_PROVIDER_UNSPECIFIED =
124
+ T.let(
125
+ :AI_PROVIDER_UNSPECIFIED,
126
+ Cadenya::Model::Info::Provider::TaggedSymbol
127
+ )
128
+ AI_PROVIDER_OPENROUTER =
129
+ T.let(
130
+ :AI_PROVIDER_OPENROUTER,
131
+ Cadenya::Model::Info::Provider::TaggedSymbol
132
+ )
133
+
134
+ sig do
135
+ override.returns(
136
+ T::Array[Cadenya::Model::Info::Provider::TaggedSymbol]
137
+ )
138
+ end
139
+ def self.values
140
+ end
141
+ end
142
+ end
44
143
  end
45
144
  end
46
145
  end
@@ -14,6 +14,14 @@ module Cadenya
14
14
  sig { returns(String) }
15
15
  attr_accessor :workspace_id
16
16
 
17
+ # Filter to models provisioned on a specific AI provider key. Accepts the key's id
18
+ # or an "external_id:"-prefixed slug.
19
+ sig { returns(T.nilable(String)) }
20
+ attr_reader :ai_provider_key_id
21
+
22
+ sig { params(ai_provider_key_id: String).void }
23
+ attr_writer :ai_provider_key_id
24
+
17
25
  # Filter by bundle_key — return only resources owned by this bundle.
18
26
  sig { returns(T.nilable(String)) }
19
27
  attr_reader :bundle_key
@@ -28,6 +36,14 @@ module Cadenya
28
36
  sig { params(cursor: String).void }
29
37
  attr_writer :cursor
30
38
 
39
+ # When true, populate each item's info (e.g. the AI provider), at the cost of
40
+ # extra lookups.
41
+ sig { returns(T.nilable(T::Boolean)) }
42
+ attr_reader :include_info
43
+
44
+ sig { params(include_info: T::Boolean).void }
45
+ attr_writer :include_info
46
+
31
47
  # Maximum number of results to return
32
48
  sig { returns(T.nilable(Integer)) }
33
49
  attr_reader :limit
@@ -66,8 +82,10 @@ module Cadenya
66
82
  sig do
67
83
  params(
68
84
  workspace_id: String,
85
+ ai_provider_key_id: String,
69
86
  bundle_key: String,
70
87
  cursor: String,
88
+ include_info: T::Boolean,
71
89
  limit: Integer,
72
90
  prefix: String,
73
91
  query: String,
@@ -78,10 +96,16 @@ module Cadenya
78
96
  end
79
97
  def self.new(
80
98
  workspace_id:,
99
+ # Filter to models provisioned on a specific AI provider key. Accepts the key's id
100
+ # or an "external_id:"-prefixed slug.
101
+ ai_provider_key_id: nil,
81
102
  # Filter by bundle_key — return only resources owned by this bundle.
82
103
  bundle_key: nil,
83
104
  # Pagination cursor from previous response
84
105
  cursor: nil,
106
+ # When true, populate each item's info (e.g. the AI provider), at the cost of
107
+ # extra lookups.
108
+ include_info: nil,
85
109
  # Maximum number of results to return
86
110
  limit: nil,
87
111
  # Filter by name prefix
@@ -100,8 +124,10 @@ module Cadenya
100
124
  override.returns(
101
125
  {
102
126
  workspace_id: String,
127
+ ai_provider_key_id: String,
103
128
  bundle_key: String,
104
129
  cursor: String,
130
+ include_info: T::Boolean,
105
131
  limit: Integer,
106
132
  prefix: String,
107
133
  query: String,
@@ -75,6 +75,7 @@ module Cadenya
75
75
  params(
76
76
  workspace_id: String,
77
77
  cursor: String,
78
+ include_info: T::Boolean,
78
79
  limit: Integer,
79
80
  prefix: String,
80
81
  query: String,
@@ -87,6 +88,9 @@ module Cadenya
87
88
  workspace_id,
88
89
  # Pagination cursor from previous response
89
90
  cursor: nil,
91
+ # When true, populate each item's info (model counts), at the cost of extra
92
+ # lookups.
93
+ include_info: nil,
90
94
  # Maximum number of results to return
91
95
  limit: nil,
92
96
  # Filter expression (query param: prefix)
@@ -27,8 +27,10 @@ module Cadenya
27
27
  sig do
28
28
  params(
29
29
  workspace_id: String,
30
+ ai_provider_key_id: String,
30
31
  bundle_key: String,
31
32
  cursor: String,
33
+ include_info: T::Boolean,
32
34
  limit: Integer,
33
35
  prefix: String,
34
36
  query: String,
@@ -40,10 +42,16 @@ module Cadenya
40
42
  def list(
41
43
  # Workspace ID.
42
44
  workspace_id,
45
+ # Filter to models provisioned on a specific AI provider key. Accepts the key's id
46
+ # or an "external_id:"-prefixed slug.
47
+ ai_provider_key_id: nil,
43
48
  # Filter by bundle_key — return only resources owned by this bundle.
44
49
  bundle_key: nil,
45
50
  # Pagination cursor from previous response
46
51
  cursor: nil,
52
+ # When true, populate each item's info (e.g. the AI provider), at the cost of
53
+ # extra lookups.
54
+ include_info: nil,
47
55
  # Maximum number of results to return
48
56
  limit: nil,
49
57
  # Filter by name prefix
@@ -1,22 +1,55 @@
1
1
  module Cadenya
2
2
  module Models
3
3
  type ai_provider_key =
4
- { metadata: Cadenya::ResourceMetadata, spec: Cadenya::AIProviderKeySpec }
4
+ {
5
+ metadata: Cadenya::ResourceMetadata,
6
+ spec: Cadenya::AIProviderKeySpec,
7
+ info: Cadenya::AIProviderKey::Info
8
+ }
5
9
 
6
10
  class AIProviderKey < Cadenya::Internal::Type::BaseModel
7
11
  attr_accessor metadata: Cadenya::ResourceMetadata
8
12
 
9
13
  attr_accessor spec: Cadenya::AIProviderKeySpec
10
14
 
15
+ attr_reader info: Cadenya::AIProviderKey::Info?
16
+
17
+ def info=: (Cadenya::AIProviderKey::Info) -> Cadenya::AIProviderKey::Info
18
+
11
19
  def initialize: (
12
20
  metadata: Cadenya::ResourceMetadata,
13
- spec: Cadenya::AIProviderKeySpec
21
+ spec: Cadenya::AIProviderKeySpec,
22
+ ?info: Cadenya::AIProviderKey::Info
14
23
  ) -> void
15
24
 
16
25
  def to_hash: -> {
17
26
  metadata: Cadenya::ResourceMetadata,
18
- spec: Cadenya::AIProviderKeySpec
27
+ spec: Cadenya::AIProviderKeySpec,
28
+ info: Cadenya::AIProviderKey::Info
19
29
  }
30
+
31
+ type info =
32
+ { disabled_model_count: Integer, enabled_model_count: Integer }
33
+
34
+ class Info < Cadenya::Internal::Type::BaseModel
35
+ attr_reader disabled_model_count: Integer?
36
+
37
+ def disabled_model_count=: (Integer) -> Integer
38
+
39
+ attr_reader enabled_model_count: Integer?
40
+
41
+ def enabled_model_count=: (Integer) -> Integer
42
+
43
+ def initialize: (
44
+ ?disabled_model_count: Integer,
45
+ ?enabled_model_count: Integer
46
+ ) -> void
47
+
48
+ def to_hash: -> {
49
+ disabled_model_count: Integer,
50
+ enabled_model_count: Integer
51
+ }
52
+ end
20
53
  end
21
54
  end
22
55
  end
@@ -4,6 +4,7 @@ module Cadenya
4
4
  {
5
5
  workspace_id: String,
6
6
  cursor: String,
7
+ include_info: bool,
7
8
  limit: Integer,
8
9
  prefix: String,
9
10
  query: String,
@@ -21,6 +22,10 @@ module Cadenya
21
22
 
22
23
  def cursor=: (String) -> String
23
24
 
25
+ attr_reader include_info: bool?
26
+
27
+ def include_info=: (bool) -> bool
28
+
24
29
  attr_reader limit: Integer?
25
30
 
26
31
  def limit=: (Integer) -> Integer
@@ -40,6 +45,7 @@ module Cadenya
40
45
  def initialize: (
41
46
  workspace_id: String,
42
47
  ?cursor: String,
48
+ ?include_info: bool,
43
49
  ?limit: Integer,
44
50
  ?prefix: String,
45
51
  ?query: String,
@@ -50,6 +56,7 @@ module Cadenya
50
56
  def to_hash: -> {
51
57
  workspace_id: String,
52
58
  cursor: String,
59
+ include_info: bool,
53
60
  limit: Integer,
54
61
  prefix: String,
55
62
  query: String,
@@ -1,28 +1,49 @@
1
1
  module Cadenya
2
2
  module Models
3
3
  type ai_provider_key_spec =
4
- { api_key: String, provider: String, region: String }
4
+ {
5
+ api_key: String,
6
+ openrouter: top,
7
+ provider: Cadenya::Models::AIProviderKeySpec::provider
8
+ }
5
9
 
6
10
  class AIProviderKeySpec < Cadenya::Internal::Type::BaseModel
7
11
  attr_reader api_key: String?
8
12
 
9
13
  def api_key=: (String) -> String
10
14
 
11
- attr_reader provider: String?
15
+ attr_reader openrouter: top?
12
16
 
13
- def provider=: (String) -> String
17
+ def openrouter=: (top) -> top
14
18
 
15
- attr_reader region: String?
19
+ attr_reader provider: Cadenya::Models::AIProviderKeySpec::provider?
16
20
 
17
- def region=: (String) -> String
21
+ def provider=: (
22
+ Cadenya::Models::AIProviderKeySpec::provider
23
+ ) -> Cadenya::Models::AIProviderKeySpec::provider
18
24
 
19
25
  def initialize: (
20
26
  ?api_key: String,
21
- ?provider: String,
22
- ?region: String
27
+ ?openrouter: top,
28
+ ?provider: Cadenya::Models::AIProviderKeySpec::provider
23
29
  ) -> void
24
30
 
25
- def to_hash: -> { api_key: String, provider: String, region: String }
31
+ def to_hash: -> {
32
+ api_key: String,
33
+ openrouter: top,
34
+ provider: Cadenya::Models::AIProviderKeySpec::provider
35
+ }
36
+
37
+ type provider = :AI_PROVIDER_UNSPECIFIED | :AI_PROVIDER_OPENROUTER
38
+
39
+ module Provider
40
+ extend Cadenya::Internal::Type::Enum
41
+
42
+ AI_PROVIDER_UNSPECIFIED: :AI_PROVIDER_UNSPECIFIED
43
+ AI_PROVIDER_OPENROUTER: :AI_PROVIDER_OPENROUTER
44
+
45
+ def self?.values: -> ::Array[Cadenya::Models::AIProviderKeySpec::provider]
46
+ end
26
47
  end
27
48
  end
28
49
  end
@@ -1,22 +1,71 @@
1
1
  module Cadenya
2
2
  module Models
3
3
  type model =
4
- { metadata: Cadenya::ResourceMetadata, spec: Cadenya::ModelSpec }
4
+ {
5
+ metadata: Cadenya::ResourceMetadata,
6
+ spec: Cadenya::ModelSpec,
7
+ info: Cadenya::Model::Info
8
+ }
5
9
 
6
10
  class Model < Cadenya::Internal::Type::BaseModel
7
11
  attr_accessor metadata: Cadenya::ResourceMetadata
8
12
 
9
13
  attr_accessor spec: Cadenya::ModelSpec
10
14
 
15
+ attr_reader info: Cadenya::Model::Info?
16
+
17
+ def info=: (Cadenya::Model::Info) -> Cadenya::Model::Info
18
+
11
19
  def initialize: (
12
20
  metadata: Cadenya::ResourceMetadata,
13
- spec: Cadenya::ModelSpec
21
+ spec: Cadenya::ModelSpec,
22
+ ?info: Cadenya::Model::Info
14
23
  ) -> void
15
24
 
16
25
  def to_hash: -> {
17
26
  metadata: Cadenya::ResourceMetadata,
18
- spec: Cadenya::ModelSpec
27
+ spec: Cadenya::ModelSpec,
28
+ info: Cadenya::Model::Info
19
29
  }
30
+
31
+ type info =
32
+ {
33
+ ai_provider_key: Cadenya::BareMetadata,
34
+ provider: Cadenya::Models::Model::Info::provider
35
+ }
36
+
37
+ class Info < Cadenya::Internal::Type::BaseModel
38
+ attr_reader ai_provider_key: Cadenya::BareMetadata?
39
+
40
+ def ai_provider_key=: (Cadenya::BareMetadata) -> Cadenya::BareMetadata
41
+
42
+ attr_reader provider: Cadenya::Models::Model::Info::provider?
43
+
44
+ def provider=: (
45
+ Cadenya::Models::Model::Info::provider
46
+ ) -> Cadenya::Models::Model::Info::provider
47
+
48
+ def initialize: (
49
+ ?ai_provider_key: Cadenya::BareMetadata,
50
+ ?provider: Cadenya::Models::Model::Info::provider
51
+ ) -> void
52
+
53
+ def to_hash: -> {
54
+ ai_provider_key: Cadenya::BareMetadata,
55
+ provider: Cadenya::Models::Model::Info::provider
56
+ }
57
+
58
+ type provider = :AI_PROVIDER_UNSPECIFIED | :AI_PROVIDER_OPENROUTER
59
+
60
+ module Provider
61
+ extend Cadenya::Internal::Type::Enum
62
+
63
+ AI_PROVIDER_UNSPECIFIED: :AI_PROVIDER_UNSPECIFIED
64
+ AI_PROVIDER_OPENROUTER: :AI_PROVIDER_OPENROUTER
65
+
66
+ def self?.values: -> ::Array[Cadenya::Models::Model::Info::provider]
67
+ end
68
+ end
20
69
  end
21
70
  end
22
71
  end
@@ -3,8 +3,10 @@ module Cadenya
3
3
  type model_list_params =
4
4
  {
5
5
  workspace_id: String,
6
+ ai_provider_key_id: String,
6
7
  bundle_key: String,
7
8
  cursor: String,
9
+ include_info: bool,
8
10
  limit: Integer,
9
11
  prefix: String,
10
12
  query: String,
@@ -19,6 +21,10 @@ module Cadenya
19
21
 
20
22
  attr_accessor workspace_id: String
21
23
 
24
+ attr_reader ai_provider_key_id: String?
25
+
26
+ def ai_provider_key_id=: (String) -> String
27
+
22
28
  attr_reader bundle_key: String?
23
29
 
24
30
  def bundle_key=: (String) -> String
@@ -27,6 +33,10 @@ module Cadenya
27
33
 
28
34
  def cursor=: (String) -> String
29
35
 
36
+ attr_reader include_info: bool?
37
+
38
+ def include_info=: (bool) -> bool
39
+
30
40
  attr_reader limit: Integer?
31
41
 
32
42
  def limit=: (Integer) -> Integer
@@ -51,8 +61,10 @@ module Cadenya
51
61
 
52
62
  def initialize: (
53
63
  workspace_id: String,
64
+ ?ai_provider_key_id: String,
54
65
  ?bundle_key: String,
55
66
  ?cursor: String,
67
+ ?include_info: bool,
56
68
  ?limit: Integer,
57
69
  ?prefix: String,
58
70
  ?query: String,
@@ -63,8 +75,10 @@ module Cadenya
63
75
 
64
76
  def to_hash: -> {
65
77
  workspace_id: String,
78
+ ai_provider_key_id: String,
66
79
  bundle_key: String,
67
80
  cursor: String,
81
+ include_info: bool,
68
82
  limit: Integer,
69
83
  prefix: String,
70
84
  query: String,
@@ -26,6 +26,7 @@ module Cadenya
26
26
  def list: (
27
27
  String workspace_id,
28
28
  ?cursor: String,
29
+ ?include_info: bool,
29
30
  ?limit: Integer,
30
31
  ?prefix: String,
31
32
  ?query: String,
@@ -9,8 +9,10 @@ module Cadenya
9
9
 
10
10
  def list: (
11
11
  String workspace_id,
12
+ ?ai_provider_key_id: String,
12
13
  ?bundle_key: String,
13
14
  ?cursor: String,
15
+ ?include_info: bool,
14
16
  ?limit: Integer,
15
17
  ?prefix: String,
16
18
  ?query: String,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cadenya
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cadenya