@anthropic-ai/sdk 0.118.0 → 0.119.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 (137) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/client.d.mts +8 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +8 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +6 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +6 -0
  9. package/client.mjs.map +1 -1
  10. package/lib/tools/BetaRunnableTool.d.mts +4 -1
  11. package/lib/tools/BetaRunnableTool.d.mts.map +1 -1
  12. package/lib/tools/BetaRunnableTool.d.ts +4 -1
  13. package/lib/tools/BetaRunnableTool.d.ts.map +1 -1
  14. package/lib/tools/BetaRunnableTool.js +7 -2
  15. package/lib/tools/BetaRunnableTool.js.map +1 -1
  16. package/lib/tools/BetaRunnableTool.mjs +7 -2
  17. package/lib/tools/BetaRunnableTool.mjs.map +1 -1
  18. package/lib/tools/BetaToolRunner.d.mts.map +1 -1
  19. package/lib/tools/BetaToolRunner.d.ts.map +1 -1
  20. package/lib/tools/BetaToolRunner.js +3 -1
  21. package/lib/tools/BetaToolRunner.js.map +1 -1
  22. package/lib/tools/BetaToolRunner.mjs +3 -1
  23. package/lib/tools/BetaToolRunner.mjs.map +1 -1
  24. package/package.json +1 -1
  25. package/resources/beta/beta.d.mts +4 -4
  26. package/resources/beta/beta.d.mts.map +1 -1
  27. package/resources/beta/beta.d.ts +4 -4
  28. package/resources/beta/beta.d.ts.map +1 -1
  29. package/resources/beta/beta.js.map +1 -1
  30. package/resources/beta/beta.mjs.map +1 -1
  31. package/resources/beta/files.d.mts +22 -22
  32. package/resources/beta/files.d.mts.map +1 -1
  33. package/resources/beta/files.d.ts +22 -22
  34. package/resources/beta/files.d.ts.map +1 -1
  35. package/resources/beta/files.js +4 -4
  36. package/resources/beta/files.js.map +1 -1
  37. package/resources/beta/files.mjs +4 -4
  38. package/resources/beta/files.mjs.map +1 -1
  39. package/resources/beta/index.d.mts +2 -2
  40. package/resources/beta/index.d.mts.map +1 -1
  41. package/resources/beta/index.d.ts +2 -2
  42. package/resources/beta/index.d.ts.map +1 -1
  43. package/resources/beta/index.js.map +1 -1
  44. package/resources/beta/index.mjs.map +1 -1
  45. package/resources/beta/messages/index.d.mts +1 -1
  46. package/resources/beta/messages/index.d.mts.map +1 -1
  47. package/resources/beta/messages/index.d.ts +1 -1
  48. package/resources/beta/messages/index.d.ts.map +1 -1
  49. package/resources/beta/messages/index.js.map +1 -1
  50. package/resources/beta/messages/index.mjs.map +1 -1
  51. package/resources/beta/messages/messages.d.mts +1201 -4
  52. package/resources/beta/messages/messages.d.mts.map +1 -1
  53. package/resources/beta/messages/messages.d.ts +1201 -4
  54. package/resources/beta/messages/messages.d.ts.map +1 -1
  55. package/resources/beta/messages/messages.js.map +1 -1
  56. package/resources/beta/messages/messages.mjs.map +1 -1
  57. package/resources/files.d.mts +105 -0
  58. package/resources/files.d.mts.map +1 -0
  59. package/resources/files.d.ts +105 -0
  60. package/resources/files.d.ts.map +1 -0
  61. package/resources/files.js +52 -0
  62. package/resources/files.js.map +1 -0
  63. package/resources/files.mjs +48 -0
  64. package/resources/files.mjs.map +1 -0
  65. package/resources/index.d.mts +3 -1
  66. package/resources/index.d.mts.map +1 -1
  67. package/resources/index.d.ts +3 -1
  68. package/resources/index.d.ts.map +1 -1
  69. package/resources/index.js +5 -1
  70. package/resources/index.js.map +1 -1
  71. package/resources/index.mjs +2 -0
  72. package/resources/index.mjs.map +1 -1
  73. package/resources/messages/index.d.mts +1 -1
  74. package/resources/messages/index.d.mts.map +1 -1
  75. package/resources/messages/index.d.ts +1 -1
  76. package/resources/messages/index.d.ts.map +1 -1
  77. package/resources/messages/index.js.map +1 -1
  78. package/resources/messages/index.mjs.map +1 -1
  79. package/resources/messages/messages.d.mts +1267 -7
  80. package/resources/messages/messages.d.mts.map +1 -1
  81. package/resources/messages/messages.d.ts +1267 -7
  82. package/resources/messages/messages.d.ts.map +1 -1
  83. package/resources/messages/messages.js.map +1 -1
  84. package/resources/messages/messages.mjs.map +1 -1
  85. package/resources/skills/index.d.mts +3 -0
  86. package/resources/skills/index.d.mts.map +1 -0
  87. package/resources/skills/index.d.ts +3 -0
  88. package/resources/skills/index.d.ts.map +1 -0
  89. package/resources/skills/index.js +9 -0
  90. package/resources/skills/index.js.map +1 -0
  91. package/resources/skills/index.mjs +4 -0
  92. package/resources/skills/index.mjs.map +1 -0
  93. package/resources/skills/skills.d.mts +129 -0
  94. package/resources/skills/skills.d.mts.map +1 -0
  95. package/resources/skills/skills.d.ts +129 -0
  96. package/resources/skills/skills.d.ts.map +1 -0
  97. package/resources/skills/skills.js +44 -0
  98. package/resources/skills/skills.js.map +1 -0
  99. package/resources/skills/skills.mjs +39 -0
  100. package/resources/skills/skills.mjs.map +1 -0
  101. package/resources/skills/versions.d.mts +104 -0
  102. package/resources/skills/versions.d.mts.map +1 -0
  103. package/resources/skills/versions.d.ts +104 -0
  104. package/resources/skills/versions.d.ts.map +1 -0
  105. package/resources/skills/versions.js +41 -0
  106. package/resources/skills/versions.js.map +1 -0
  107. package/resources/skills/versions.mjs +37 -0
  108. package/resources/skills/versions.mjs.map +1 -0
  109. package/resources/skills.d.mts +2 -0
  110. package/resources/skills.d.mts.map +1 -0
  111. package/resources/skills.d.ts +2 -0
  112. package/resources/skills.d.ts.map +1 -0
  113. package/resources/skills.js +6 -0
  114. package/resources/skills.js.map +1 -0
  115. package/resources/skills.mjs +3 -0
  116. package/resources/skills.mjs.map +1 -0
  117. package/src/client.ts +172 -0
  118. package/src/lib/tools/BetaRunnableTool.ts +9 -2
  119. package/src/lib/tools/BetaToolRunner.ts +6 -1
  120. package/src/resources/beta/beta.ts +126 -6
  121. package/src/resources/beta/files.ts +27 -27
  122. package/src/resources/beta/index.ts +63 -3
  123. package/src/resources/beta/messages/index.ts +60 -0
  124. package/src/resources/beta/messages/messages.ts +1861 -411
  125. package/src/resources/files.ts +163 -0
  126. package/src/resources/index.ts +83 -0
  127. package/src/resources/messages/index.ts +66 -0
  128. package/src/resources/messages/messages.ts +1648 -115
  129. package/src/resources/skills/index.ts +21 -0
  130. package/src/resources/skills/skills.ts +194 -0
  131. package/src/resources/skills/versions.ts +160 -0
  132. package/src/resources/skills.ts +3 -0
  133. package/src/version.ts +1 -1
  134. package/version.d.mts +1 -1
  135. package/version.d.ts +1 -1
  136. package/version.js +1 -1
  137. package/version.mjs +1 -1
@@ -0,0 +1,21 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export {
4
+ Skills,
5
+ type DeletedSkill,
6
+ type Skill,
7
+ type SkillSource,
8
+ type SkillCreateParams,
9
+ type SkillListParams,
10
+ type SkillsPageCursor,
11
+ } from './skills';
12
+ export {
13
+ Versions,
14
+ type DeletedSkillVersion,
15
+ type SkillVersion,
16
+ type VersionCreateParams,
17
+ type VersionRetrieveParams,
18
+ type VersionListParams,
19
+ type VersionDeleteParams,
20
+ type SkillVersionsPageCursor,
21
+ } from './versions';
@@ -0,0 +1,194 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import * as VersionsAPI from './versions';
5
+ import {
6
+ DeletedSkillVersion,
7
+ SkillVersion,
8
+ SkillVersionsPageCursor,
9
+ VersionCreateParams,
10
+ VersionDeleteParams,
11
+ VersionListParams,
12
+ VersionRetrieveParams,
13
+ Versions,
14
+ } from './versions';
15
+ import { APIPromise } from '../../core/api-promise';
16
+ import { PageCursor, type PageCursorParams, PagePromise } from '../../core/pagination';
17
+ import { type Uploadable } from '../../core/uploads';
18
+ import { RequestOptions } from '../../internal/request-options';
19
+ import { multipartFormRequestOptions } from '../../internal/uploads';
20
+ import { path } from '../../internal/utils/path';
21
+
22
+ export class Skills extends APIResource {
23
+ versions: VersionsAPI.Versions = new VersionsAPI.Versions(this._client);
24
+
25
+ /**
26
+ * Create Skill
27
+ */
28
+ create(body: SkillCreateParams, options?: RequestOptions): APIPromise<Skill> {
29
+ return this._client.post(
30
+ '/v1/skills',
31
+ multipartFormRequestOptions({ body, ...options }, this._client, false),
32
+ );
33
+ }
34
+
35
+ /**
36
+ * Get Skill
37
+ */
38
+ retrieve(skillID: string, options?: RequestOptions): APIPromise<Skill> {
39
+ return this._client.get(path`/v1/skills/${skillID}`, options);
40
+ }
41
+
42
+ /**
43
+ * List Skills
44
+ */
45
+ list(
46
+ query: SkillListParams | null | undefined = {},
47
+ options?: RequestOptions,
48
+ ): PagePromise<SkillsPageCursor, Skill> {
49
+ return this._client.getAPIList('/v1/skills', PageCursor<Skill>, { query, ...options });
50
+ }
51
+
52
+ /**
53
+ * Delete Skill
54
+ */
55
+ delete(skillID: string, options?: RequestOptions): APIPromise<DeletedSkill> {
56
+ return this._client.delete(path`/v1/skills/${skillID}`, options);
57
+ }
58
+ }
59
+
60
+ export type SkillsPageCursor = PageCursor<Skill>;
61
+
62
+ export interface DeletedSkill {
63
+ /**
64
+ * Unique identifier for the skill.
65
+ *
66
+ * The format and length of IDs may change over time.
67
+ */
68
+ id: string;
69
+
70
+ /**
71
+ * Deleted object type.
72
+ *
73
+ * For Skills, this is always `"skill_deleted"`.
74
+ */
75
+ type: 'skill_deleted';
76
+ }
77
+
78
+ export interface Skill {
79
+ /**
80
+ * Unique identifier for the skill.
81
+ *
82
+ * The format and length of IDs may change over time.
83
+ */
84
+ id: string;
85
+
86
+ /**
87
+ * ISO 8601 timestamp of when the skill was created.
88
+ */
89
+ created_at: string;
90
+
91
+ /**
92
+ * Human-readable, single-line label for the Skill. Maximum 255 characters. Always
93
+ * set: derived from the SKILL.md frontmatter `name` when omitted at creation. Not
94
+ * unique.
95
+ */
96
+ display_name: string;
97
+
98
+ /**
99
+ * ID of the newest Skill Version — what `latest` references resolve to. Always
100
+ * set: a Skill holds at least one version.
101
+ */
102
+ latest_version_id: string;
103
+
104
+ /**
105
+ * Where the Skill comes from.
106
+ *
107
+ * Possible values:
108
+ *
109
+ * - `"custom"`: authored by the platform user; private to their workspace
110
+ * - `"anthropic"`: published by Anthropic; shared and read-only
111
+ * - `"anthropic_example"`: Anthropic-published sample Skill
112
+ * - `"plugin"`: resolved from an installed plugin
113
+ */
114
+ source: SkillSource;
115
+
116
+ /**
117
+ * Object type.
118
+ *
119
+ * For Skills, this is always `"skill"`.
120
+ */
121
+ type: 'skill';
122
+
123
+ /**
124
+ * ISO 8601 timestamp of when the skill was last updated.
125
+ */
126
+ updated_at: string;
127
+ }
128
+
129
+ export interface SkillSource {
130
+ /**
131
+ * Where the Skill comes from.
132
+ *
133
+ * Possible values:
134
+ *
135
+ * - `"custom"`: authored by the platform user; private to their workspace
136
+ * - `"anthropic"`: published by Anthropic; shared and read-only
137
+ * - `"anthropic_example"`: Anthropic-published sample Skill
138
+ * - `"plugin"`: resolved from an installed plugin
139
+ */
140
+ type: 'custom' | 'anthropic' | 'anthropic_example' | 'plugin';
141
+ }
142
+
143
+ export interface SkillCreateParams {
144
+ /**
145
+ * Files to upload for the skill.
146
+ *
147
+ * All files must be in the same top-level directory and must include a SKILL.md
148
+ * file at the root of that directory.
149
+ */
150
+ files: Array<Uploadable>;
151
+
152
+ /**
153
+ * Human-readable, single-line label for the Skill. Maximum 255 characters. Always
154
+ * set: derived from the SKILL.md frontmatter `name` when omitted at creation. Not
155
+ * unique.
156
+ */
157
+ display_name?: string | null;
158
+ }
159
+
160
+ export interface SkillListParams extends PageCursorParams {
161
+ /**
162
+ * Filter skills by source.
163
+ *
164
+ * If provided, only skills from the specified source will be returned:
165
+ *
166
+ * - `"custom"`: only return user-created skills
167
+ * - `"anthropic"`: only return Anthropic-created skills
168
+ */
169
+ source?: string | null;
170
+ }
171
+
172
+ Skills.Versions = Versions;
173
+
174
+ export declare namespace Skills {
175
+ export {
176
+ type DeletedSkill as DeletedSkill,
177
+ type Skill as Skill,
178
+ type SkillSource as SkillSource,
179
+ type SkillsPageCursor as SkillsPageCursor,
180
+ type SkillCreateParams as SkillCreateParams,
181
+ type SkillListParams as SkillListParams,
182
+ };
183
+
184
+ export {
185
+ Versions as Versions,
186
+ type DeletedSkillVersion as DeletedSkillVersion,
187
+ type SkillVersion as SkillVersion,
188
+ type SkillVersionsPageCursor as SkillVersionsPageCursor,
189
+ type VersionCreateParams as VersionCreateParams,
190
+ type VersionRetrieveParams as VersionRetrieveParams,
191
+ type VersionListParams as VersionListParams,
192
+ type VersionDeleteParams as VersionDeleteParams,
193
+ };
194
+ }
@@ -0,0 +1,160 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import { APIPromise } from '../../core/api-promise';
5
+ import { PageCursor, type PageCursorParams, PagePromise } from '../../core/pagination';
6
+ import { type Uploadable } from '../../core/uploads';
7
+ import { RequestOptions } from '../../internal/request-options';
8
+ import { multipartFormRequestOptions } from '../../internal/uploads';
9
+ import { path } from '../../internal/utils/path';
10
+
11
+ export class Versions extends APIResource {
12
+ /**
13
+ * Create Skill Version
14
+ */
15
+ create(skillID: string, body: VersionCreateParams, options?: RequestOptions): APIPromise<SkillVersion> {
16
+ return this._client.post(
17
+ path`/v1/skills/${skillID}/versions`,
18
+ multipartFormRequestOptions({ body, ...options }, this._client, false),
19
+ );
20
+ }
21
+
22
+ /**
23
+ * Get Skill Version
24
+ */
25
+ retrieve(
26
+ version: string,
27
+ params: VersionRetrieveParams,
28
+ options?: RequestOptions,
29
+ ): APIPromise<SkillVersion> {
30
+ const { skill_id } = params;
31
+ return this._client.get(path`/v1/skills/${skill_id}/versions/${version}`, options);
32
+ }
33
+
34
+ /**
35
+ * List Skill Versions
36
+ */
37
+ list(
38
+ skillID: string,
39
+ query: VersionListParams | null | undefined = {},
40
+ options?: RequestOptions,
41
+ ): PagePromise<SkillVersionsPageCursor, SkillVersion> {
42
+ return this._client.getAPIList(path`/v1/skills/${skillID}/versions`, PageCursor<SkillVersion>, {
43
+ query,
44
+ ...options,
45
+ });
46
+ }
47
+
48
+ /**
49
+ * Delete Skill Version
50
+ */
51
+ delete(
52
+ version: string,
53
+ params: VersionDeleteParams,
54
+ options?: RequestOptions,
55
+ ): APIPromise<DeletedSkillVersion> {
56
+ const { skill_id } = params;
57
+ return this._client.delete(path`/v1/skills/${skill_id}/versions/${version}`, options);
58
+ }
59
+ }
60
+
61
+ export type SkillVersionsPageCursor = PageCursor<SkillVersion>;
62
+
63
+ export interface DeletedSkillVersion {
64
+ /**
65
+ * Unique identifier for this Skill Version. The id addresses the version in paths
66
+ * and pins it in references.
67
+ */
68
+ id: string;
69
+
70
+ /**
71
+ * Deleted object type.
72
+ *
73
+ * For Skill Versions, this is always `"skill_version_deleted"`.
74
+ */
75
+ type: 'skill_version_deleted';
76
+ }
77
+
78
+ export interface SkillVersion {
79
+ /**
80
+ * Unique identifier for this Skill Version. The id addresses the version in paths
81
+ * and pins it in references.
82
+ */
83
+ id: string;
84
+
85
+ /**
86
+ * ISO 8601 timestamp of when the skill was created.
87
+ */
88
+ created_at: string;
89
+
90
+ /**
91
+ * Description of the skill version.
92
+ *
93
+ * This is extracted from the SKILL.md file in the skill upload.
94
+ */
95
+ description: string;
96
+
97
+ /**
98
+ * The Skill's immutable kebab-case slug, set at creation from the first upload's
99
+ * SKILL.md frontmatter `name` (or its enclosing directory). Every later upload
100
+ * must resolve to the same value. Also the top-level directory of the Skill's
101
+ * mounted files and the base name of a downloaded archive.
102
+ */
103
+ name: string;
104
+
105
+ /**
106
+ * Unique identifier for the skill.
107
+ *
108
+ * The format and length of IDs may change over time.
109
+ */
110
+ skill_id: string;
111
+
112
+ /**
113
+ * Object type.
114
+ *
115
+ * For Skill Versions, this is always `"skill_version"`.
116
+ */
117
+ type: 'skill_version';
118
+ }
119
+
120
+ export interface VersionCreateParams {
121
+ /**
122
+ * Files to upload for the skill.
123
+ *
124
+ * All files must be in the same top-level directory and must include a SKILL.md
125
+ * file at the root of that directory.
126
+ */
127
+ files: Array<Uploadable>;
128
+ }
129
+
130
+ export interface VersionRetrieveParams {
131
+ /**
132
+ * Unique identifier for the skill.
133
+ *
134
+ * The format and length of IDs may change over time.
135
+ */
136
+ skill_id: string;
137
+ }
138
+
139
+ export interface VersionListParams extends PageCursorParams {}
140
+
141
+ export interface VersionDeleteParams {
142
+ /**
143
+ * Unique identifier for the skill.
144
+ *
145
+ * The format and length of IDs may change over time.
146
+ */
147
+ skill_id: string;
148
+ }
149
+
150
+ export declare namespace Versions {
151
+ export {
152
+ type DeletedSkillVersion as DeletedSkillVersion,
153
+ type SkillVersion as SkillVersion,
154
+ type SkillVersionsPageCursor as SkillVersionsPageCursor,
155
+ type VersionCreateParams as VersionCreateParams,
156
+ type VersionRetrieveParams as VersionRetrieveParams,
157
+ type VersionListParams as VersionListParams,
158
+ type VersionDeleteParams as VersionDeleteParams,
159
+ };
160
+ }
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './skills/index';
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.118.0'; // x-release-please-version
1
+ export const VERSION = '0.119.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.118.0";
1
+ export declare const VERSION = "0.119.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.118.0";
1
+ export declare const VERSION = "0.119.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.118.0'; // x-release-please-version
4
+ exports.VERSION = '0.119.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.118.0'; // x-release-please-version
1
+ export const VERSION = '0.119.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map