anthropic 2.8.0 → 2.9.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 (170) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +36 -0
  3. data/README.md +1 -1
  4. data/lib/anthropic/error_classes.rb +4 -0
  5. data/lib/anthropic/helpers/threads/beta_message_thread.rb +30 -6
  6. data/lib/anthropic/helpers/tools/runner.rb +21 -4
  7. data/lib/anthropic/helpers/tracing/streamed_message.rb +8 -1
  8. data/lib/anthropic/internal/tracing.rb +1 -0
  9. data/lib/anthropic/internal/type/file_input.rb +11 -0
  10. data/lib/anthropic/internal/util.rb +43 -11
  11. data/lib/anthropic/models/anthropic_beta.rb +44 -30
  12. data/lib/anthropic/models/beta/beta_managed_agents_agent_toolset_default_config.rb +1 -1
  13. data/lib/anthropic/models/beta/beta_managed_agents_agent_toolset_default_config_params.rb +1 -1
  14. data/lib/anthropic/models/beta/beta_managed_agents_auto_policy.rb +3 -1
  15. data/lib/anthropic/models/beta/beta_managed_agents_bash_tool_config.rb +1 -1
  16. data/lib/anthropic/models/beta/beta_managed_agents_bash_tool_config_params.rb +1 -1
  17. data/lib/anthropic/models/beta/beta_managed_agents_edit_tool_config.rb +1 -1
  18. data/lib/anthropic/models/beta/beta_managed_agents_edit_tool_config_params.rb +1 -1
  19. data/lib/anthropic/models/beta/beta_managed_agents_glob_tool_config.rb +1 -1
  20. data/lib/anthropic/models/beta/beta_managed_agents_glob_tool_config_params.rb +1 -1
  21. data/lib/anthropic/models/beta/beta_managed_agents_grep_tool_config.rb +1 -1
  22. data/lib/anthropic/models/beta/beta_managed_agents_grep_tool_config_params.rb +1 -1
  23. data/lib/anthropic/models/beta/beta_managed_agents_mcp_tool_config.rb +1 -1
  24. data/lib/anthropic/models/beta/beta_managed_agents_mcp_tool_config_params.rb +1 -1
  25. data/lib/anthropic/models/beta/beta_managed_agents_mcp_toolset_default_config.rb +1 -1
  26. data/lib/anthropic/models/beta/beta_managed_agents_mcp_toolset_default_config_params.rb +1 -1
  27. data/lib/anthropic/models/beta/beta_managed_agents_multiagent_coordinator_params.rb +3 -2
  28. data/lib/anthropic/models/beta/beta_managed_agents_multiagent_params.rb +1 -1
  29. data/lib/anthropic/models/beta/beta_managed_agents_read_tool_config.rb +1 -1
  30. data/lib/anthropic/models/beta/beta_managed_agents_read_tool_config_params.rb +1 -1
  31. data/lib/anthropic/models/beta/beta_managed_agents_web_fetch_tool_config.rb +1 -1
  32. data/lib/anthropic/models/beta/beta_managed_agents_web_fetch_tool_config_params.rb +1 -1
  33. data/lib/anthropic/models/beta/beta_managed_agents_web_search_tool_config.rb +1 -1
  34. data/lib/anthropic/models/beta/beta_managed_agents_web_search_tool_config_params.rb +1 -1
  35. data/lib/anthropic/models/beta/beta_managed_agents_write_tool_config.rb +1 -1
  36. data/lib/anthropic/models/beta/beta_managed_agents_write_tool_config_params.rb +1 -1
  37. data/lib/anthropic/models/beta/organization/beta_bundle_attachment_not_supported_error.rb +24 -0
  38. data/lib/anthropic/models/beta/organization/beta_bundle_attachment_not_supported_error_details.rb +22 -0
  39. data/lib/anthropic/models/beta/organization/beta_bundle_on_call_error.rb +24 -0
  40. data/lib/anthropic/models/beta/organization/beta_bundle_on_call_error_details.rb +22 -0
  41. data/lib/anthropic/models/beta/organization/beta_external_key.rb +2 -2
  42. data/lib/anthropic/models/beta/organization/beta_rbac_role.rb +14 -5
  43. data/lib/anthropic/models/beta/organization/beta_rbac_role_source.rb +52 -0
  44. data/lib/anthropic/models/beta/organization/beta_rbac_role_source_built_in.rb +25 -0
  45. data/lib/anthropic/models/beta/organization/beta_rbac_role_source_custom.rb +20 -0
  46. data/lib/anthropic/models/beta/organization/claude_tag/beta_claude_tag_bundle.rb +15 -2
  47. data/lib/anthropic/models/beta/organization/claude_tag/bundle_update_params.rb +50 -0
  48. data/lib/anthropic/models/beta/organization/external_key_create_params.rb +3 -2
  49. data/lib/anthropic/models/beta/organization/plugin_list_params.rb +2 -1
  50. data/lib/anthropic/models/beta/organization/plugin_marketplace_list_params.rb +2 -1
  51. data/lib/anthropic/models/beta/organization/plugin_marketplace_retrieve_params.rb +2 -1
  52. data/lib/anthropic/models/beta/organization/plugin_retrieve_params.rb +2 -1
  53. data/lib/anthropic/models/beta/organization/plugins/installation_setting_list_params.rb +2 -1
  54. data/lib/anthropic/models/beta/organization/plugins/share_list_params.rb +2 -1
  55. data/lib/anthropic/models/beta/organization/plugins/version_download_params.rb +2 -1
  56. data/lib/anthropic/models/beta/organization/plugins/version_list_params.rb +2 -1
  57. data/lib/anthropic/models/beta/organization/plugins/version_retrieve_params.rb +2 -1
  58. data/lib/anthropic/models/beta/organization/workspace_update_params.rb +2 -1
  59. data/lib/anthropic/models/beta/sessions/beta_managed_agents_agent_auto_evaluated_permission.rb +1 -1
  60. data/lib/anthropic/models/beta/sessions/beta_managed_agents_agent_auto_evaluated_permission_deny.rb +7 -4
  61. data/lib/anthropic/models/error_details.rb +28 -3
  62. data/lib/anthropic/models/organization/external_key.rb +2 -2
  63. data/lib/anthropic/models/organization/external_key_create_params.rb +3 -2
  64. data/lib/anthropic/models/organization/key_profile_mismatch_error.rb +3 -3
  65. data/lib/anthropic/models/organization/key_profile_mismatch_error_details.rb +3 -3
  66. data/lib/anthropic/models/organization/rbac_role.rb +14 -5
  67. data/lib/anthropic/models/organization/rbac_role_source.rb +50 -0
  68. data/lib/anthropic/models/organization/rbac_role_source_built_in.rb +22 -0
  69. data/lib/anthropic/models/organization/rbac_role_source_custom.rb +18 -0
  70. data/lib/anthropic/models/organization/workspace_update_params.rb +2 -1
  71. data/lib/anthropic/models/parent_organization_required_error.rb +20 -0
  72. data/lib/anthropic/models/parent_organization_required_error_details.rb +18 -0
  73. data/lib/anthropic/models/rbac_role_not_found_error.rb +19 -0
  74. data/lib/anthropic/models/rbac_role_not_found_error_details.rb +17 -0
  75. data/lib/anthropic/models.rb +8 -0
  76. data/lib/anthropic/resources/beta/messages/batches.rb +6 -6
  77. data/lib/anthropic/resources/beta/messages.rb +5 -1
  78. data/lib/anthropic/resources/beta/organization/claude_tag/bundles.rb +51 -0
  79. data/lib/anthropic/resources/beta/organization/rbac_roles/permissions.rb +4 -0
  80. data/lib/anthropic/resources/beta/organization/rbac_roles.rb +7 -0
  81. data/lib/anthropic/resources/organization/rbac_roles/permissions.rb +4 -0
  82. data/lib/anthropic/resources/organization/rbac_roles.rb +7 -0
  83. data/lib/anthropic/version.rb +1 -1
  84. data/lib/anthropic.rb +15 -0
  85. data/rbi/anthropic/helpers/bedrock/client.rbi +6 -2
  86. data/rbi/anthropic/helpers/bedrock/event_stream.rbi +12 -3
  87. data/rbi/anthropic/helpers/bedrock/mantle_client.rbi +3 -1
  88. data/rbi/anthropic/helpers/google_cloud/client.rbi +3 -1
  89. data/rbi/anthropic/helpers/refusal_fallback.rbi +12 -4
  90. data/rbi/anthropic/helpers/vertex/client.rbi +6 -2
  91. data/rbi/anthropic/internal/tracing.rbi +2 -0
  92. data/rbi/anthropic/internal/util.rbi +2 -2
  93. data/rbi/anthropic/models/anthropic_beta.rbi +41 -41
  94. data/rbi/anthropic/models/beta/beta_managed_agents_auto_policy.rbi +3 -1
  95. data/rbi/anthropic/models/beta/beta_managed_agents_multiagent_coordinator_params.rbi +3 -2
  96. data/rbi/anthropic/models/beta/organization/beta_bundle_attachment_not_supported_error.rbi +25 -0
  97. data/rbi/anthropic/models/beta/organization/beta_bundle_attachment_not_supported_error_details.rbi +32 -0
  98. data/rbi/anthropic/models/beta/organization/beta_bundle_on_call_error.rbi +23 -0
  99. data/rbi/anthropic/models/beta/organization/beta_bundle_on_call_error_details.rbi +32 -0
  100. data/rbi/anthropic/models/beta/organization/beta_external_key.rbi +4 -4
  101. data/rbi/anthropic/models/beta/organization/beta_rbac_role.rbi +23 -6
  102. data/rbi/anthropic/models/beta/organization/beta_rbac_role_source.rbi +78 -0
  103. data/rbi/anthropic/models/beta/organization/beta_rbac_role_source_built_in.rbi +36 -0
  104. data/rbi/anthropic/models/beta/organization/beta_rbac_role_source_custom.rbi +34 -0
  105. data/rbi/anthropic/models/beta/organization/claude_tag/beta_claude_tag_bundle.rbi +11 -1
  106. data/rbi/anthropic/models/beta/organization/claude_tag/bundle_update_params.rbi +88 -0
  107. data/rbi/anthropic/models/beta/organization/external_key_create_params.rbi +6 -4
  108. data/rbi/anthropic/models/beta/organization/plugin_list_params.rbi +4 -2
  109. data/rbi/anthropic/models/beta/organization/plugin_marketplace_list_params.rbi +4 -2
  110. data/rbi/anthropic/models/beta/organization/plugin_marketplace_retrieve_params.rbi +4 -2
  111. data/rbi/anthropic/models/beta/organization/plugin_retrieve_params.rbi +4 -2
  112. data/rbi/anthropic/models/beta/organization/plugins/installation_setting_list_params.rbi +4 -2
  113. data/rbi/anthropic/models/beta/organization/plugins/share_list_params.rbi +4 -2
  114. data/rbi/anthropic/models/beta/organization/plugins/version_download_params.rbi +4 -2
  115. data/rbi/anthropic/models/beta/organization/plugins/version_list_params.rbi +4 -2
  116. data/rbi/anthropic/models/beta/organization/plugins/version_retrieve_params.rbi +4 -2
  117. data/rbi/anthropic/models/beta/organization/workspace_update_params.rbi +4 -2
  118. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_agent_auto_evaluated_permission_deny.rbi +10 -6
  119. data/rbi/anthropic/models/error_details.rbi +25 -1
  120. data/rbi/anthropic/models/organization/external_key.rbi +4 -4
  121. data/rbi/anthropic/models/organization/external_key_create_params.rbi +6 -4
  122. data/rbi/anthropic/models/organization/key_profile_mismatch_error.rbi +3 -3
  123. data/rbi/anthropic/models/organization/key_profile_mismatch_error_details.rbi +3 -3
  124. data/rbi/anthropic/models/organization/rbac_role.rbi +20 -6
  125. data/rbi/anthropic/models/organization/rbac_role_source.rbi +68 -0
  126. data/rbi/anthropic/models/organization/rbac_role_source_built_in.rbi +34 -0
  127. data/rbi/anthropic/models/organization/rbac_role_source_custom.rbi +32 -0
  128. data/rbi/anthropic/models/organization/workspace_update_params.rbi +4 -2
  129. data/rbi/anthropic/models/parent_organization_required_error.rbi +17 -0
  130. data/rbi/anthropic/models/parent_organization_required_error_details.rbi +28 -0
  131. data/rbi/anthropic/models/rbac_role_not_found_error.rbi +16 -0
  132. data/rbi/anthropic/models/rbac_role_not_found_error_details.rbi +27 -0
  133. data/rbi/anthropic/models.rbi +10 -0
  134. data/rbi/anthropic/resources/beta/organization/claude_tag/bundles.rbi +30 -0
  135. data/rbi/anthropic/resources/beta/organization/external_keys.rbi +3 -2
  136. data/rbi/anthropic/resources/beta/organization/plugin_marketplaces.rbi +4 -2
  137. data/rbi/anthropic/resources/beta/organization/plugins/installation_settings.rbi +2 -1
  138. data/rbi/anthropic/resources/beta/organization/plugins/shares.rbi +2 -1
  139. data/rbi/anthropic/resources/beta/organization/plugins/versions.rbi +6 -3
  140. data/rbi/anthropic/resources/beta/organization/plugins.rbi +4 -2
  141. data/rbi/anthropic/resources/beta/organization/workspaces.rbi +2 -1
  142. data/rbi/anthropic/resources/organization/external_keys.rbi +3 -2
  143. data/rbi/anthropic/resources/organization/workspaces.rbi +2 -1
  144. data/rbi/lib/anthropic/helpers/stainless_helper_header.rbi +6 -1
  145. data/sig/anthropic/helpers/sessions/event_accumulator.rbs +6 -2
  146. data/sig/anthropic/internal/tracing.rbs +1 -0
  147. data/sig/anthropic/internal/util.rbs +1 -1
  148. data/sig/anthropic/models/anthropic_beta.rbs +21 -21
  149. data/sig/anthropic/models/beta/organization/beta_bundle_attachment_not_supported_error.rbs +13 -0
  150. data/sig/anthropic/models/beta/organization/beta_bundle_attachment_not_supported_error_details.rbs +20 -0
  151. data/sig/anthropic/models/beta/organization/beta_bundle_on_call_error.rbs +13 -0
  152. data/sig/anthropic/models/beta/organization/beta_bundle_on_call_error_details.rbs +17 -0
  153. data/sig/anthropic/models/beta/organization/beta_rbac_role.rbs +5 -0
  154. data/sig/anthropic/models/beta/organization/beta_rbac_role_source.rbs +40 -0
  155. data/sig/anthropic/models/beta/organization/beta_rbac_role_source_built_in.rbs +17 -0
  156. data/sig/anthropic/models/beta/organization/beta_rbac_role_source_custom.rbs +17 -0
  157. data/sig/anthropic/models/beta/organization/claude_tag/beta_claude_tag_bundle.rbs +5 -0
  158. data/sig/anthropic/models/beta/organization/claude_tag/bundle_update_params.rbs +46 -0
  159. data/sig/anthropic/models/error_details.rbs +26 -0
  160. data/sig/anthropic/models/organization/rbac_role.rbs +5 -0
  161. data/sig/anthropic/models/organization/rbac_role_source.rbs +38 -0
  162. data/sig/anthropic/models/organization/rbac_role_source_built_in.rbs +15 -0
  163. data/sig/anthropic/models/organization/rbac_role_source_custom.rbs +15 -0
  164. data/sig/anthropic/models/parent_organization_required_error.rbs +9 -0
  165. data/sig/anthropic/models/parent_organization_required_error_details.rbs +14 -0
  166. data/sig/anthropic/models/rbac_role_not_found_error.rbs +9 -0
  167. data/sig/anthropic/models/rbac_role_not_found_error_details.rbs +14 -0
  168. data/sig/anthropic/models.rbs +8 -0
  169. data/sig/anthropic/resources/beta/organization/claude_tag/bundles.rbs +7 -0
  170. metadata +47 -2
@@ -3,9 +3,9 @@
3
3
  module Anthropic
4
4
  module Models
5
5
  module Organization
6
- # The External Key is bound to a user profile, and the Workspace does not have
7
- # that user profile. A Workspace can use only a key bound to its own user profile
8
- # or a key that isn't bound to one.
6
+ # After this request, the External Key and the Workspace would not have the same
7
+ # user profile. A key and its Workspace must have the same user profile, or both
8
+ # have none.
9
9
  class KeyProfileMismatchError < Anthropic::Errors::BadRequestError
10
10
  sig { returns(Symbol) }
11
11
  def error_code
@@ -15,9 +15,9 @@ module Anthropic
15
15
  sig { returns(Symbol) }
16
16
  attr_accessor :error_code
17
17
 
18
- # The External Key is bound to a user profile, and the Workspace does not have
19
- # that user profile. A Workspace can use only a key bound to its own user profile
20
- # or a key that isn't bound to one.
18
+ # After this request, the External Key and the Workspace would not have the same
19
+ # user profile. A key and its Workspace must have the same user profile, or both
20
+ # have none.
21
21
  sig { params(error_code: Symbol).returns(T.attached_class) }
22
22
  def self.new(error_code: :key_profile_mismatch)
23
23
  end
@@ -20,12 +20,17 @@ module Anthropic
20
20
  sig { returns(Time) }
21
21
  attr_accessor :created_at
22
22
 
23
- # Name of the RBAC Role. For a role created by Anthropic, this is Anthropic's name
24
- # for the access that the role grants. Anthropic may change this name, so to keep
25
- # a lasting reference to a role, store its `id`.
23
+ # Name of the RBAC Role. For a built-in role, this is Anthropic's name for the
24
+ # access that the role grants. Anthropic may change this name, so to keep a
25
+ # lasting reference to a role, store its `id`.
26
26
  sig { returns(String) }
27
27
  attr_accessor :display_name
28
28
 
29
+ # Whether the RBAC Role is built-in or custom. More values of `type` may be added,
30
+ # so do not treat every role that is not `built_in` as `custom`.
31
+ sig { returns(Anthropic::Organization::RBACRoleSource::Variants) }
32
+ attr_accessor :source
33
+
29
34
  # Object type.
30
35
  #
31
36
  # For RBAC Roles, this is always `"rbac_role"`.
@@ -41,6 +46,11 @@ module Anthropic
41
46
  id: String,
42
47
  created_at: Time,
43
48
  display_name: String,
49
+ source:
50
+ T.any(
51
+ Anthropic::Organization::RBACRoleSourceBuiltIn::OrHash,
52
+ Anthropic::Organization::RBACRoleSourceCustom::OrHash
53
+ ),
44
54
  updated_at: Time,
45
55
  type: Symbol
46
56
  ).returns(T.attached_class)
@@ -50,10 +60,13 @@ module Anthropic
50
60
  id:,
51
61
  # RFC 3339 datetime string indicating when the RBAC Role was created.
52
62
  created_at:,
53
- # Name of the RBAC Role. For a role created by Anthropic, this is Anthropic's name
54
- # for the access that the role grants. Anthropic may change this name, so to keep
55
- # a lasting reference to a role, store its `id`.
63
+ # Name of the RBAC Role. For a built-in role, this is Anthropic's name for the
64
+ # access that the role grants. Anthropic may change this name, so to keep a
65
+ # lasting reference to a role, store its `id`.
56
66
  display_name:,
67
+ # Whether the RBAC Role is built-in or custom. More values of `type` may be added,
68
+ # so do not treat every role that is not `built_in` as `custom`.
69
+ source:,
57
70
  # RFC 3339 datetime string indicating when the RBAC Role was last updated.
58
71
  updated_at:,
59
72
  # Object type.
@@ -69,6 +82,7 @@ module Anthropic
69
82
  id: String,
70
83
  created_at: Time,
71
84
  display_name: String,
85
+ source: Anthropic::Organization::RBACRoleSource::Variants,
72
86
  type: Symbol,
73
87
  updated_at: Time
74
88
  }
@@ -0,0 +1,68 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Organization
6
+ module RBACRoleSource
7
+ extend Anthropic::Internal::Type::Union
8
+
9
+ Variants =
10
+ T.type_alias do
11
+ T.any(
12
+ Anthropic::Organization::RBACRoleSourceBuiltIn,
13
+ Anthropic::Organization::RBACRoleSourceCustom
14
+ )
15
+ end
16
+
17
+ module Type
18
+ extend Anthropic::Internal::Type::Enum
19
+
20
+ TaggedSymbol =
21
+ T.type_alias do
22
+ T.all(Symbol, Anthropic::Organization::RBACRoleSource::Type)
23
+ end
24
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
25
+
26
+ BUILT_IN =
27
+ T.let(
28
+ :built_in,
29
+ Anthropic::Organization::RBACRoleSource::Type::TaggedSymbol
30
+ )
31
+ CUSTOM =
32
+ T.let(
33
+ :custom,
34
+ Anthropic::Organization::RBACRoleSource::Type::TaggedSymbol
35
+ )
36
+
37
+ sig do
38
+ override.returns(
39
+ T::Array[
40
+ Anthropic::Organization::RBACRoleSource::Type::TaggedSymbol
41
+ ]
42
+ )
43
+ end
44
+ def self.values
45
+ end
46
+ end
47
+
48
+ sig do
49
+ override.returns(
50
+ T::Array[Anthropic::Organization::RBACRoleSource::Variants]
51
+ )
52
+ end
53
+ def self.variants
54
+ end
55
+
56
+ # Creates a new instance of the variant class whose `type` matches the given
57
+ # value, passing the remaining arguments to its constructor.
58
+ sig do
59
+ params(
60
+ type: Anthropic::Organization::RBACRoleSource::Type::OrSymbol
61
+ ).returns(Anthropic::Organization::RBACRoleSource::Variants)
62
+ end
63
+ def self.new(type:)
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,34 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Organization
6
+ class RBACRoleSourceBuiltIn < Anthropic::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Anthropic::Organization::RBACRoleSourceBuiltIn,
11
+ Anthropic::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ # Anthropic provisions the RBAC Role, and the organization's administrators cannot
16
+ # change or delete it.
17
+ sig { returns(Symbol) }
18
+ attr_accessor :type
19
+
20
+ sig { params(type: Symbol).returns(T.attached_class) }
21
+ def self.new(
22
+ # Anthropic provisions the RBAC Role, and the organization's administrators cannot
23
+ # change or delete it.
24
+ type: :built_in
25
+ )
26
+ end
27
+
28
+ sig { override.returns({ type: Symbol }) }
29
+ def to_hash
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,32 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Organization
6
+ class RBACRoleSourceCustom < Anthropic::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Anthropic::Organization::RBACRoleSourceCustom,
11
+ Anthropic::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ # The organization's administrators can change and delete the RBAC Role.
16
+ sig { returns(Symbol) }
17
+ attr_accessor :type
18
+
19
+ sig { params(type: Symbol).returns(T.attached_class) }
20
+ def self.new(
21
+ # The organization's administrators can change and delete the RBAC Role.
22
+ type: :custom
23
+ )
24
+ end
25
+
26
+ sig { override.returns({ type: Symbol }) }
27
+ def to_hash
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -74,7 +74,8 @@ module Anthropic
74
74
  # the Workspace must then name this user profile; the API rejects a request that
75
75
  # names none or a different one. Once set, it can't be replaced or removed
76
76
  # (sending the same ID again changes nothing); only deleting the user profile
77
- # clears it. The default Workspace can't have a user profile.
77
+ # clears it. It can't be set on a Workspace whose External Key isn't bound to this
78
+ # user profile. The default Workspace can't have a user profile.
78
79
  sig { returns(T.nilable(String)) }
79
80
  attr_reader :user_profile_id
80
81
 
@@ -123,7 +124,8 @@ module Anthropic
123
124
  # the Workspace must then name this user profile; the API rejects a request that
124
125
  # names none or a different one. Once set, it can't be replaced or removed
125
126
  # (sending the same ID again changes nothing); only deleting the user profile
126
- # clears it. The default Workspace can't have a user profile.
127
+ # clears it. It can't be set on a Workspace whose External Key isn't bound to this
128
+ # user profile. The default Workspace can't have a user profile.
127
129
  user_profile_id: nil,
128
130
  request_options: {}
129
131
  )
@@ -0,0 +1,17 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ # The endpoint serves only organizations that belong to a parent organization, and
6
+ # this organization belongs to none.
7
+ class ParentOrganizationRequiredError < Anthropic::Errors::BadRequestError
8
+ sig { returns(Symbol) }
9
+ def error_code
10
+ end
11
+
12
+ sig { returns(Anthropic::ParentOrganizationRequiredErrorDetails) }
13
+ def details
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,28 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ class ParentOrganizationRequiredErrorDetails < Anthropic::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Anthropic::ParentOrganizationRequiredErrorDetails,
10
+ Anthropic::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ sig { returns(Symbol) }
15
+ attr_accessor :error_code
16
+
17
+ # The endpoint serves only organizations that belong to a parent organization, and
18
+ # this organization belongs to none.
19
+ sig { params(error_code: Symbol).returns(T.attached_class) }
20
+ def self.new(error_code: :parent_organization_required)
21
+ end
22
+
23
+ sig { override.returns({ error_code: Symbol }) }
24
+ def to_hash
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,16 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ # No RBAC Role with this ID was found.
6
+ class RBACRoleNotFoundError < Anthropic::Errors::NotFoundError
7
+ sig { returns(Symbol) }
8
+ def error_code
9
+ end
10
+
11
+ sig { returns(Anthropic::RBACRoleNotFoundErrorDetails) }
12
+ def details
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,27 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ class RBACRoleNotFoundErrorDetails < Anthropic::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Anthropic::RBACRoleNotFoundErrorDetails,
10
+ Anthropic::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ sig { returns(Symbol) }
15
+ attr_accessor :error_code
16
+
17
+ # No RBAC Role with this ID was found.
18
+ sig { params(error_code: Symbol).returns(T.attached_class) }
19
+ def self.new(error_code: :rbac_role_not_found)
20
+ end
21
+
22
+ sig { override.returns({ error_code: Symbol }) }
23
+ def to_hash
24
+ end
25
+ end
26
+ end
27
+ end
@@ -781,6 +781,12 @@ module Anthropic
781
781
 
782
782
  OverloadedError = Anthropic::Models::OverloadedError
783
783
 
784
+ ParentOrganizationRequiredError =
785
+ Anthropic::Models::ParentOrganizationRequiredError
786
+
787
+ ParentOrganizationRequiredErrorDetails =
788
+ Anthropic::Models::ParentOrganizationRequiredErrorDetails
789
+
784
790
  PermissionError = Anthropic::Models::PermissionError
785
791
 
786
792
  PlainTextSource = Anthropic::Models::PlainTextSource
@@ -808,6 +814,10 @@ module Anthropic
808
814
 
809
815
  RawMessageStreamEvent = Anthropic::Models::RawMessageStreamEvent
810
816
 
817
+ RBACRoleNotFoundError = Anthropic::Models::RBACRoleNotFoundError
818
+
819
+ RBACRoleNotFoundErrorDetails = Anthropic::Models::RBACRoleNotFoundErrorDetails
820
+
811
821
  RedactedThinkingBlock = Anthropic::Models::RedactedThinkingBlock
812
822
 
813
823
  RedactedThinkingBlockParam = Anthropic::Models::RedactedThinkingBlockParam
@@ -35,6 +35,36 @@ module Anthropic
35
35
  )
36
36
  end
37
37
 
38
+ # Change a Bundle's instructions. The update is partial: a field left out is
39
+ # unchanged, and `instructions` sent as null or as an empty string clears them.
40
+ # The later of two updates wins. Sessions that start after the change use the new
41
+ # instructions; sessions already running keep the ones they started with. Some
42
+ # Bundles are managed in claude.ai, and an update of one returns 400.
43
+ sig do
44
+ params(
45
+ bundle_id: String,
46
+ instructions: T.nilable(String),
47
+ betas:
48
+ T::Array[T.any(Anthropic::AnthropicBeta::OrSymbol, String)],
49
+ request_options: Anthropic::RequestOptions::OrHash
50
+ ).returns(
51
+ Anthropic::Beta::Organization::ClaudeTag::BetaClaudeTagBundle
52
+ )
53
+ end
54
+ def update(
55
+ # Path param: The Bundle's identifier, starting with `capp_`.
56
+ bundle_id,
57
+ # Body param: Instructions for Claude, up to 10,000 bytes (UTF-8), added to the
58
+ # instructions of every session that can use the Bundle. Null or an empty string
59
+ # clears them.
60
+ instructions: nil,
61
+ # Header param: This endpoint is in beta: requests must send
62
+ # `experimental-claude-tag-2026-10-21` in this header.
63
+ betas: nil,
64
+ request_options: {}
65
+ )
66
+ end
67
+
38
68
  # List the organization's Bundles, newest first by `created_at`. A Bundle that
39
69
  # Claude Tag manages for itself is not listed.
40
70
  sig do
@@ -32,8 +32,9 @@ module Anthropic
32
32
  # customers: bind a customer's key to that customer's user profile. A key bound to
33
33
  # a user profile can only be attached to a Workspace that has the same user
34
34
  # profile, and the binding cannot be changed later. Omit this field only for your
35
- # organization's own key, because a key created without a user profile ID can be
36
- # attached to any Workspace, including another customer's.
35
+ # organization's own key, never a customer's. A key created without a user profile
36
+ # ID can't be attached to a Workspace that has a user profile, and you can't add
37
+ # one to the key later.
37
38
  user_profile_id: nil,
38
39
  request_options: {}
39
40
  )
@@ -35,7 +35,8 @@ module Anthropic
35
35
  # the organization's UUID or its `org_`-prefixed ID. A value that is neither
36
36
  # returns a 400; an organization that is not a child of the key's parent, or where
37
37
  # the Plugins API is not available, returns a 404. Any other key may pass only its
38
- # own organization's ID here; another organization returns a 404.
38
+ # own organization's ID here; another organization returns a 404. A key with no
39
+ # organization of its own must always pass `organization_id`.
39
40
  organization_id: nil,
40
41
  # Header param: This endpoint is in beta: requests must send
41
42
  # `ce-plugins-2026-09-01` in this header.
@@ -135,7 +136,8 @@ module Anthropic
135
136
  # the organization's UUID or its `org_`-prefixed ID. A value that is neither
136
137
  # returns a 400; an organization that is not a child of the key's parent, or where
137
138
  # the Plugins API is not available, returns a 404. Any other key may pass only its
138
- # own organization's ID here; another organization returns a 404.
139
+ # own organization's ID here; another organization returns a 404. A key with no
140
+ # organization of its own must always pass `organization_id`.
139
141
  organization_id: nil,
140
142
  # Query param: `organization` for the organization's plugin marketplaces, `user`
141
143
  # for members' personal plugin marketplaces.
@@ -55,7 +55,8 @@ module Anthropic
55
55
  # the organization's UUID or its `org_`-prefixed ID. A value that is neither
56
56
  # returns a 400; an organization that is not a child of the key's parent, or where
57
57
  # the Plugins API is not available, returns a 404. Any other key may pass only its
58
- # own organization's ID here; another organization returns a 404.
58
+ # own organization's ID here; another organization returns a 404. A key with no
59
+ # organization of its own must always pass `organization_id`.
59
60
  organization_id: nil,
60
61
  # Query param: Optionally set to the `next_page` token from the previous response.
61
62
  page: nil,
@@ -57,7 +57,8 @@ module Anthropic
57
57
  # the organization's UUID or its `org_`-prefixed ID. A value that is neither
58
58
  # returns a 400; an organization that is not a child of the key's parent, or where
59
59
  # the Plugins API is not available, returns a 404. Any other key may pass only its
60
- # own organization's ID here; another organization returns a 404.
60
+ # own organization's ID here; another organization returns a 404. A key with no
61
+ # organization of its own must always pass `organization_id`.
61
62
  organization_id: nil,
62
63
  # Query param: Optionally set to the `next_page` token from the previous response.
63
64
  page: nil,
@@ -103,7 +103,8 @@ module Anthropic
103
103
  # the organization's UUID or its `org_`-prefixed ID. A value that is neither
104
104
  # returns a 400; an organization that is not a child of the key's parent, or where
105
105
  # the Plugins API is not available, returns a 404. Any other key may pass only its
106
- # own organization's ID here; another organization returns a 404.
106
+ # own organization's ID here; another organization returns a 404. A key with no
107
+ # organization of its own must always pass `organization_id`.
107
108
  organization_id: nil,
108
109
  # Header param: This endpoint is in beta: requests must send
109
110
  # `ce-plugins-2026-09-01` in this header.
@@ -155,7 +156,8 @@ module Anthropic
155
156
  # the organization's UUID or its `org_`-prefixed ID. A value that is neither
156
157
  # returns a 400; an organization that is not a child of the key's parent, or where
157
158
  # the Plugins API is not available, returns a 404. Any other key may pass only its
158
- # own organization's ID here; another organization returns a 404.
159
+ # own organization's ID here; another organization returns a 404. A key with no
160
+ # organization of its own must always pass `organization_id`.
159
161
  organization_id: nil,
160
162
  # Query param: Optionally set to the `next_page` token from the previous response.
161
163
  page: nil,
@@ -216,7 +218,8 @@ module Anthropic
216
218
  # the organization's UUID or its `org_`-prefixed ID. A value that is neither
217
219
  # returns a 400; an organization that is not a child of the key's parent, or where
218
220
  # the Plugins API is not available, returns a 404. Any other key may pass only its
219
- # own organization's ID here; another organization returns a 404.
221
+ # own organization's ID here; another organization returns a 404. A key with no
222
+ # organization of its own must always pass `organization_id`.
220
223
  organization_id: nil,
221
224
  # Header param: This endpoint is in beta: requests must send
222
225
  # `ce-plugins-2026-09-01` in this header.
@@ -122,7 +122,8 @@ module Anthropic
122
122
  # the organization's UUID or its `org_`-prefixed ID. A value that is neither
123
123
  # returns a 400; an organization that is not a child of the key's parent, or where
124
124
  # the Plugins API is not available, returns a 404. Any other key may pass only its
125
- # own organization's ID here; another organization returns a 404.
125
+ # own organization's ID here; another organization returns a 404. A key with no
126
+ # organization of its own must always pass `organization_id`.
126
127
  organization_id: nil,
127
128
  # Header param: This endpoint is in beta: requests must send
128
129
  # `ce-plugins-2026-09-01` in this header.
@@ -250,7 +251,8 @@ module Anthropic
250
251
  # the organization's UUID or its `org_`-prefixed ID. A value that is neither
251
252
  # returns a 400; an organization that is not a child of the key's parent, or where
252
253
  # the Plugins API is not available, returns a 404. Any other key may pass only its
253
- # own organization's ID here; another organization returns a 404.
254
+ # own organization's ID here; another organization returns a 404. A key with no
255
+ # organization of its own must always pass `organization_id`.
254
256
  organization_id: nil,
255
257
  # Query param: `organization` for Plugins in the organization's plugin
256
258
  # marketplaces, `user` for Plugins in members' personal plugin marketplaces.
@@ -135,7 +135,8 @@ module Anthropic
135
135
  # the Workspace must then name this user profile; the API rejects a request that
136
136
  # names none or a different one. Once set, it can't be replaced or removed
137
137
  # (sending the same ID again changes nothing); only deleting the user profile
138
- # clears it. The default Workspace can't have a user profile.
138
+ # clears it. It can't be set on a Workspace whose External Key isn't bound to this
139
+ # user profile. The default Workspace can't have a user profile.
139
140
  user_profile_id: nil,
140
141
  request_options: {}
141
142
  )
@@ -31,8 +31,9 @@ module Anthropic
31
31
  # customers: bind a customer's key to that customer's user profile. A key bound to
32
32
  # a user profile can only be attached to a Workspace that has the same user
33
33
  # profile, and the binding cannot be changed later. Omit this field only for your
34
- # organization's own key, because a key created without a user profile ID can be
35
- # attached to any Workspace, including another customer's.
34
+ # organization's own key, never a customer's. A key created without a user profile
35
+ # ID can't be attached to a Workspace that has a user profile, and you can't add
36
+ # one to the key later.
36
37
  user_profile_id: nil,
37
38
  request_options: {}
38
39
  )
@@ -124,7 +124,8 @@ module Anthropic
124
124
  # the Workspace must then name this user profile; the API rejects a request that
125
125
  # names none or a different one. Once set, it can't be replaced or removed
126
126
  # (sending the same ID again changes nothing); only deleting the user profile
127
- # clears it. The default Workspace can't have a user profile.
127
+ # clears it. It can't be set on a Workspace whose External Key isn't bound to this
128
+ # user profile. The default Workspace can't have a user profile.
128
129
  user_profile_id: nil,
129
130
  request_options: {}
130
131
  )
@@ -12,7 +12,12 @@ module Anthropic
12
12
  MESSAGE_THREAD = T.let("message-thread", String)
13
13
 
14
14
  class << self
15
- sig { params(headers: T::Hash[T.any(String, Symbol), T.untyped], value: String).returns(String) }
15
+ sig do
16
+ params(
17
+ headers: T::Hash[T.any(String, Symbol), T.untyped],
18
+ value: String
19
+ ).returns(String)
20
+ end
16
21
  def merged_value(headers, value)
17
22
  end
18
23
  end
@@ -21,9 +21,13 @@ module Anthropic
21
21
 
22
22
  private
23
23
 
24
- def on_event_start: (Anthropic::Beta::BetaManagedAgentsStartEvent event) -> void
24
+ def on_event_start: (
25
+ Anthropic::Beta::BetaManagedAgentsStartEvent event
26
+ ) -> void
25
27
 
26
- def on_event_delta: (Anthropic::Beta::BetaManagedAgentsDeltaEvent event) -> void
28
+ def on_event_delta: (
29
+ Anthropic::Beta::BetaManagedAgentsDeltaEvent event
30
+ ) -> void
27
31
  end
28
32
  end
29
33
  end
@@ -315,6 +315,7 @@ module Anthropic
315
315
  ORGANIZATION_CLAUDE_TAG_SLACK_WORKSPACES_UPDATE: "anthropic.organization.claude_tag.slack_workspaces.update"
316
316
  ORGANIZATION_CLAUDE_TAG_SLACK_WORKSPACES_LIST: "anthropic.organization.claude_tag.slack_workspaces.list"
317
317
  ORGANIZATION_CLAUDE_TAG_BUNDLES_RETRIEVE: "anthropic.organization.claude_tag.bundles.retrieve"
318
+ ORGANIZATION_CLAUDE_TAG_BUNDLES_UPDATE: "anthropic.organization.claude_tag.bundles.update"
318
319
  ORGANIZATION_CLAUDE_TAG_BUNDLES_LIST: "anthropic.organization.claude_tag.bundles.list"
319
320
  ORGANIZATION_CLAUDE_TAG_BUNDLES_TARGETS_CREATE: "anthropic.organization.claude_tag.bundles.targets.create"
320
321
  ORGANIZATION_CLAUDE_TAG_BUNDLES_TARGETS_RETRIEVE: "anthropic.organization.claude_tag.bundles.targets.retrieve"
@@ -94,7 +94,7 @@ module Anthropic
94
94
 
95
95
  def close: -> void
96
96
 
97
- private def read_enum: (Integer? max_len) -> String
97
+ private def read_enum: (Integer? max_len) -> String?
98
98
 
99
99
  def read: (?Integer? max_len, ?String? out_string) -> String?
100
100