@anthropic-ai/sdk 0.125.0 → 0.126.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 (297) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +846 -840
  7. package/client.js.map +1 -1
  8. package/client.mjs +846 -834
  9. package/client.mjs.map +1 -1
  10. package/core/api-promise.js +71 -68
  11. package/core/api-promise.js.map +1 -1
  12. package/core/api-promise.mjs +71 -64
  13. package/core/api-promise.mjs.map +1 -1
  14. package/core/error.js +5 -2
  15. package/core/error.js.map +1 -1
  16. package/core/error.mjs +5 -2
  17. package/core/error.mjs.map +1 -1
  18. package/core/pagination.js +56 -50
  19. package/core/pagination.js.map +1 -1
  20. package/core/pagination.mjs +56 -41
  21. package/core/pagination.mjs.map +1 -1
  22. package/core/streaming.js +212 -209
  23. package/core/streaming.js.map +1 -1
  24. package/core/streaming.mjs +212 -209
  25. package/core/streaming.mjs.map +1 -1
  26. package/helpers/beta/mcp.js +14 -19
  27. package/helpers/beta/mcp.js.map +1 -1
  28. package/helpers/beta/mcp.mjs +14 -13
  29. package/helpers/beta/mcp.mjs.map +1 -1
  30. package/internal/constants.js +1 -1
  31. package/internal/constants.js.map +1 -1
  32. package/internal/decoders/jsonl.js +27 -24
  33. package/internal/decoders/jsonl.js.map +1 -1
  34. package/internal/decoders/jsonl.mjs +27 -24
  35. package/internal/decoders/jsonl.mjs.map +1 -1
  36. package/internal/decoders/line.js +52 -49
  37. package/internal/decoders/line.js.map +1 -1
  38. package/internal/decoders/line.mjs +52 -43
  39. package/internal/decoders/line.mjs.map +1 -1
  40. package/internal/file-store.js +256 -258
  41. package/internal/file-store.js.map +1 -1
  42. package/internal/file-store.mjs +256 -243
  43. package/internal/file-store.mjs.map +1 -1
  44. package/internal/node.browser.d.mts.map +1 -1
  45. package/internal/node.browser.d.ts.map +1 -1
  46. package/internal/node.browser.js.map +1 -1
  47. package/internal/node.browser.mjs +7 -7
  48. package/internal/node.browser.mjs.map +1 -1
  49. package/internal/shim-types.js +0 -6
  50. package/internal/shim-types.js.map +1 -1
  51. package/internal/shim-types.mjs +0 -6
  52. package/internal/shim-types.mjs.map +1 -1
  53. package/internal/shims.js +0 -6
  54. package/internal/shims.js.map +1 -1
  55. package/internal/shims.mjs +0 -6
  56. package/internal/shims.mjs.map +1 -1
  57. package/internal/stainless-helper-header.js +6 -6
  58. package/internal/stainless-helper-header.js.map +1 -1
  59. package/internal/utils/async-queue.js +66 -63
  60. package/internal/utils/async-queue.js.map +1 -1
  61. package/internal/utils/async-queue.mjs +66 -56
  62. package/internal/utils/async-queue.mjs.map +1 -1
  63. package/internal/utils/bytes.d.mts +1 -1
  64. package/internal/utils/bytes.d.mts.map +1 -1
  65. package/internal/utils/bytes.d.ts +1 -1
  66. package/internal/utils/bytes.d.ts.map +1 -1
  67. package/lib/BetaMessageStream.js +593 -590
  68. package/lib/BetaMessageStream.js.map +1 -1
  69. package/lib/BetaMessageStream.mjs +593 -590
  70. package/lib/BetaMessageStream.mjs.map +1 -1
  71. package/lib/MessageStream.js +544 -541
  72. package/lib/MessageStream.js.map +1 -1
  73. package/lib/MessageStream.mjs +544 -541
  74. package/lib/MessageStream.mjs.map +1 -1
  75. package/lib/environments/poller.js +180 -174
  76. package/lib/environments/poller.js.map +1 -1
  77. package/lib/environments/poller.mjs +180 -153
  78. package/lib/environments/poller.mjs.map +1 -1
  79. package/lib/environments/worker.js +375 -369
  80. package/lib/environments/worker.js.map +1 -1
  81. package/lib/environments/worker.mjs +374 -329
  82. package/lib/environments/worker.mjs.map +1 -1
  83. package/lib/tools/BetaToolRunner.js +316 -313
  84. package/lib/tools/BetaToolRunner.js.map +1 -1
  85. package/lib/tools/BetaToolRunner.mjs +315 -306
  86. package/lib/tools/BetaToolRunner.mjs.map +1 -1
  87. package/lib/tools/SessionToolRunner.js +241 -235
  88. package/lib/tools/SessionToolRunner.js.map +1 -1
  89. package/lib/tools/SessionToolRunner.mjs +241 -192
  90. package/lib/tools/SessionToolRunner.mjs.map +1 -1
  91. package/lib/tools/ToolError.js +39 -36
  92. package/lib/tools/ToolError.js.map +1 -1
  93. package/lib/tools/ToolError.mjs +39 -13
  94. package/lib/tools/ToolError.mjs.map +1 -1
  95. package/package.json +3 -3
  96. package/resources/beta/agents/agents.js +135 -132
  97. package/resources/beta/agents/agents.js.map +1 -1
  98. package/resources/beta/agents/agents.mjs +135 -132
  99. package/resources/beta/agents/agents.mjs.map +1 -1
  100. package/resources/beta/beta.d.mts +5 -5
  101. package/resources/beta/beta.d.mts.map +1 -1
  102. package/resources/beta/beta.d.ts +5 -5
  103. package/resources/beta/beta.d.ts.map +1 -1
  104. package/resources/beta/beta.js +39 -36
  105. package/resources/beta/beta.js.map +1 -1
  106. package/resources/beta/beta.mjs +39 -36
  107. package/resources/beta/beta.mjs.map +1 -1
  108. package/resources/beta/dreams.d.mts +2 -28
  109. package/resources/beta/dreams.d.mts.map +1 -1
  110. package/resources/beta/dreams.d.ts +2 -28
  111. package/resources/beta/dreams.d.ts.map +1 -1
  112. package/resources/beta/environments/environments.js +157 -154
  113. package/resources/beta/environments/environments.js.map +1 -1
  114. package/resources/beta/environments/environments.mjs +157 -154
  115. package/resources/beta/environments/environments.mjs.map +1 -1
  116. package/resources/beta/environments/work.js +255 -252
  117. package/resources/beta/environments/work.js.map +1 -1
  118. package/resources/beta/environments/work.mjs +255 -252
  119. package/resources/beta/environments/work.mjs.map +1 -1
  120. package/resources/beta/index.d.mts +2 -2
  121. package/resources/beta/index.d.mts.map +1 -1
  122. package/resources/beta/index.d.ts +2 -2
  123. package/resources/beta/index.d.ts.map +1 -1
  124. package/resources/beta/index.js.map +1 -1
  125. package/resources/beta/index.mjs.map +1 -1
  126. package/resources/beta/memory-stores/memory-stores.js +150 -147
  127. package/resources/beta/memory-stores/memory-stores.js.map +1 -1
  128. package/resources/beta/memory-stores/memory-stores.mjs +150 -147
  129. package/resources/beta/memory-stores/memory-stores.mjs.map +1 -1
  130. package/resources/beta/messages/batches.d.mts +12 -1
  131. package/resources/beta/messages/batches.d.mts.map +1 -1
  132. package/resources/beta/messages/batches.d.ts +12 -1
  133. package/resources/beta/messages/batches.d.ts.map +1 -1
  134. package/resources/beta/messages/index.d.mts +1 -1
  135. package/resources/beta/messages/index.d.mts.map +1 -1
  136. package/resources/beta/messages/index.d.ts +1 -1
  137. package/resources/beta/messages/index.d.ts.map +1 -1
  138. package/resources/beta/messages/index.js.map +1 -1
  139. package/resources/beta/messages/index.mjs.map +1 -1
  140. package/resources/beta/messages/messages.d.mts +238 -100
  141. package/resources/beta/messages/messages.d.mts.map +1 -1
  142. package/resources/beta/messages/messages.d.ts +238 -100
  143. package/resources/beta/messages/messages.d.ts.map +1 -1
  144. package/resources/beta/messages/messages.js +113 -110
  145. package/resources/beta/messages/messages.js.map +1 -1
  146. package/resources/beta/messages/messages.mjs +113 -110
  147. package/resources/beta/messages/messages.mjs.map +1 -1
  148. package/resources/beta/models.d.mts +22 -1
  149. package/resources/beta/models.d.mts.map +1 -1
  150. package/resources/beta/models.d.ts +22 -1
  151. package/resources/beta/models.d.ts.map +1 -1
  152. package/resources/beta/organization/federation/federation.js +11 -8
  153. package/resources/beta/organization/federation/federation.js.map +1 -1
  154. package/resources/beta/organization/federation/federation.mjs +11 -8
  155. package/resources/beta/organization/federation/federation.mjs.map +1 -1
  156. package/resources/beta/organization/federation/rules/rules.js +187 -184
  157. package/resources/beta/organization/federation/rules/rules.js.map +1 -1
  158. package/resources/beta/organization/federation/rules/rules.mjs +187 -184
  159. package/resources/beta/organization/federation/rules/rules.mjs.map +1 -1
  160. package/resources/beta/organization/organization.js +38 -35
  161. package/resources/beta/organization/organization.js.map +1 -1
  162. package/resources/beta/organization/organization.mjs +38 -35
  163. package/resources/beta/organization/organization.mjs.map +1 -1
  164. package/resources/beta/organization/service-accounts/service-accounts.js +163 -160
  165. package/resources/beta/organization/service-accounts/service-accounts.js.map +1 -1
  166. package/resources/beta/organization/service-accounts/service-accounts.mjs +163 -160
  167. package/resources/beta/organization/service-accounts/service-accounts.mjs.map +1 -1
  168. package/resources/beta/organization/workspaces/workspaces.d.mts +3 -3
  169. package/resources/beta/organization/workspaces/workspaces.d.mts.map +1 -1
  170. package/resources/beta/organization/workspaces/workspaces.d.ts +3 -3
  171. package/resources/beta/organization/workspaces/workspaces.d.ts.map +1 -1
  172. package/resources/beta/organization/workspaces/workspaces.js +97 -94
  173. package/resources/beta/organization/workspaces/workspaces.js.map +1 -1
  174. package/resources/beta/organization/workspaces/workspaces.mjs +97 -94
  175. package/resources/beta/organization/workspaces/workspaces.mjs.map +1 -1
  176. package/resources/beta/sessions/events.d.mts +12 -21
  177. package/resources/beta/sessions/events.d.mts.map +1 -1
  178. package/resources/beta/sessions/events.d.ts +12 -21
  179. package/resources/beta/sessions/events.d.ts.map +1 -1
  180. package/resources/beta/sessions/events.js +118 -115
  181. package/resources/beta/sessions/events.js.map +1 -1
  182. package/resources/beta/sessions/events.mjs +118 -115
  183. package/resources/beta/sessions/events.mjs.map +1 -1
  184. package/resources/beta/sessions/resources.d.mts +0 -3
  185. package/resources/beta/sessions/resources.d.mts.map +1 -1
  186. package/resources/beta/sessions/resources.d.ts +0 -3
  187. package/resources/beta/sessions/resources.d.ts.map +1 -1
  188. package/resources/beta/sessions/sessions.d.mts +2 -2
  189. package/resources/beta/sessions/sessions.d.ts +2 -2
  190. package/resources/beta/sessions/sessions.js +161 -158
  191. package/resources/beta/sessions/sessions.js.map +1 -1
  192. package/resources/beta/sessions/sessions.mjs +161 -158
  193. package/resources/beta/sessions/sessions.mjs.map +1 -1
  194. package/resources/beta/sessions/threads/threads.js +86 -83
  195. package/resources/beta/sessions/threads/threads.js.map +1 -1
  196. package/resources/beta/sessions/threads/threads.mjs +86 -83
  197. package/resources/beta/sessions/threads/threads.mjs.map +1 -1
  198. package/resources/beta/skills/skills.js +104 -101
  199. package/resources/beta/skills/skills.js.map +1 -1
  200. package/resources/beta/skills/skills.mjs +104 -101
  201. package/resources/beta/skills/skills.mjs.map +1 -1
  202. package/resources/beta/tunnels/tunnels.js +188 -185
  203. package/resources/beta/tunnels/tunnels.js.map +1 -1
  204. package/resources/beta/tunnels/tunnels.mjs +188 -185
  205. package/resources/beta/tunnels/tunnels.mjs.map +1 -1
  206. package/resources/beta/user-profiles.d.mts +45 -0
  207. package/resources/beta/user-profiles.d.mts.map +1 -1
  208. package/resources/beta/user-profiles.d.ts +45 -0
  209. package/resources/beta/user-profiles.d.ts.map +1 -1
  210. package/resources/beta/user-profiles.js +25 -10
  211. package/resources/beta/user-profiles.js.map +1 -1
  212. package/resources/beta/user-profiles.mjs +25 -10
  213. package/resources/beta/user-profiles.mjs.map +1 -1
  214. package/resources/beta/vaults/credentials.d.mts +0 -14
  215. package/resources/beta/vaults/credentials.d.mts.map +1 -1
  216. package/resources/beta/vaults/credentials.d.ts +0 -14
  217. package/resources/beta/vaults/credentials.d.ts.map +1 -1
  218. package/resources/beta/vaults/vaults.js +156 -153
  219. package/resources/beta/vaults/vaults.js.map +1 -1
  220. package/resources/beta/vaults/vaults.mjs +156 -153
  221. package/resources/beta/vaults/vaults.mjs.map +1 -1
  222. package/resources/completions.d.mts +1 -1
  223. package/resources/completions.d.ts +1 -1
  224. package/resources/index.d.mts +1 -1
  225. package/resources/index.d.mts.map +1 -1
  226. package/resources/index.d.ts +1 -1
  227. package/resources/index.d.ts.map +1 -1
  228. package/resources/index.js.map +1 -1
  229. package/resources/index.mjs.map +1 -1
  230. package/resources/messages/index.d.mts +1 -1
  231. package/resources/messages/index.d.mts.map +1 -1
  232. package/resources/messages/index.d.ts +1 -1
  233. package/resources/messages/index.d.ts.map +1 -1
  234. package/resources/messages/index.js.map +1 -1
  235. package/resources/messages/index.mjs.map +1 -1
  236. package/resources/messages/messages.d.mts +100 -63
  237. package/resources/messages/messages.d.mts.map +1 -1
  238. package/resources/messages/messages.d.ts +100 -63
  239. package/resources/messages/messages.d.ts.map +1 -1
  240. package/resources/messages/messages.js +115 -112
  241. package/resources/messages/messages.js.map +1 -1
  242. package/resources/messages/messages.mjs +115 -112
  243. package/resources/messages/messages.mjs.map +1 -1
  244. package/resources/skills/skills.js +88 -85
  245. package/resources/skills/skills.js.map +1 -1
  246. package/resources/skills/skills.mjs +88 -85
  247. package/resources/skills/skills.mjs.map +1 -1
  248. package/resources/top-level.js +0 -1
  249. package/resources/top-level.js.map +1 -1
  250. package/resources/top-level.mjs +0 -1
  251. package/resources/top-level.mjs.map +1 -1
  252. package/src/client.ts +13 -1
  253. package/src/internal/node.browser.ts +7 -7
  254. package/src/internal/utils/bytes.ts +1 -1
  255. package/src/resources/beta/beta.ts +24 -1
  256. package/src/resources/beta/dreams.ts +2 -28
  257. package/src/resources/beta/index.ts +11 -0
  258. package/src/resources/beta/messages/batches.ts +13 -1
  259. package/src/resources/beta/messages/index.ts +10 -0
  260. package/src/resources/beta/messages/messages.ts +288 -99
  261. package/src/resources/beta/models.ts +25 -0
  262. package/src/resources/beta/organization/workspaces/workspaces.ts +3 -3
  263. package/src/resources/beta/sessions/events.ts +12 -21
  264. package/src/resources/beta/sessions/resources.ts +0 -3
  265. package/src/resources/beta/sessions/sessions.ts +2 -2
  266. package/src/resources/beta/user-profiles.ts +75 -10
  267. package/src/resources/beta/vaults/credentials.ts +0 -14
  268. package/src/resources/completions.ts +1 -1
  269. package/src/resources/index.ts +6 -0
  270. package/src/resources/messages/index.ts +6 -0
  271. package/src/resources/messages/messages.ts +128 -62
  272. package/src/tsconfig.json +13 -3
  273. package/src/version.ts +1 -1
  274. package/tools/agent-toolset/fs-util.js +0 -6
  275. package/tools/agent-toolset/fs-util.js.map +1 -1
  276. package/tools/agent-toolset/fs-util.mjs +0 -6
  277. package/tools/agent-toolset/fs-util.mjs.map +1 -1
  278. package/tools/agent-toolset/memories.js +4 -4
  279. package/tools/agent-toolset/memories.js.map +1 -1
  280. package/tools/agent-toolset/memories.mjs +2 -2
  281. package/tools/agent-toolset/memories.mjs.map +1 -1
  282. package/tools/agent-toolset/node.browser.js +12 -12
  283. package/tools/agent-toolset/node.browser.js.map +1 -1
  284. package/tools/agent-toolset/node.js +142 -139
  285. package/tools/agent-toolset/node.js.map +1 -1
  286. package/tools/agent-toolset/node.mjs +132 -125
  287. package/tools/agent-toolset/node.mjs.map +1 -1
  288. package/tools/agent-toolset/skills.js +5 -5
  289. package/tools/agent-toolset/skills.js.map +1 -1
  290. package/tools/agent-toolset/sync-interval.js +3 -3
  291. package/tools/agent-toolset/sync-interval.js.map +1 -1
  292. package/tools/memory/node.browser.js +2 -2
  293. package/tools/memory/node.browser.js.map +1 -1
  294. package/version.d.mts +1 -1
  295. package/version.d.ts +1 -1
  296. package/version.js +1 -1
  297. package/version.mjs +1 -1
@@ -9,91 +9,94 @@ const pagination_1 = require("../../core/pagination.js");
9
9
  const headers_1 = require("../../internal/headers.js");
10
10
  const uploads_1 = require("../../internal/uploads.js");
11
11
  const path_1 = require("../../internal/utils/path.js");
12
- class Skills extends resource_1.APIResource {
13
- constructor() {
14
- super(...arguments);
15
- this.versions = new VersionsAPI.Versions(this._client);
12
+ var Skills = /* @__PURE__ */ (() => {
13
+ class Skills extends resource_1.APIResource {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.versions = new VersionsAPI.Versions(this._client);
17
+ }
18
+ /**
19
+ * Create Skill
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * const skill = await client.skills.create({
24
+ * files: [fs.createReadStream('path/to/file')],
25
+ * });
26
+ * ```
27
+ */
28
+ create(params, options) {
29
+ const { workspace_id, ...body } = params;
30
+ return this._client.post('/v1/skills', (0, uploads_1.multipartFormRequestOptions)({
31
+ body,
32
+ ...options,
33
+ headers: (0, headers_1.buildHeaders)([
34
+ { ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
35
+ options?.headers,
36
+ ]),
37
+ }, this._client, false));
38
+ }
39
+ /**
40
+ * Get Skill
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * const skill = await client.skills.retrieve('skill_id');
45
+ * ```
46
+ */
47
+ retrieve(skillID, params = {}, options) {
48
+ const { workspace_id } = params ?? {};
49
+ return this._client.get((0, path_1.path) `/v1/skills/${skillID}`, {
50
+ ...options,
51
+ headers: (0, headers_1.buildHeaders)([
52
+ { ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
53
+ options?.headers,
54
+ ]),
55
+ });
56
+ }
57
+ /**
58
+ * List Skills
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * // Automatically fetches more pages as needed.
63
+ * for await (const skill of client.skills.list()) {
64
+ * // ...
65
+ * }
66
+ * ```
67
+ */
68
+ list(params = {}, options) {
69
+ const { workspace_id, ...query } = params ?? {};
70
+ return this._client.getAPIList('/v1/skills', (pagination_1.PageCursor), {
71
+ query,
72
+ ...options,
73
+ headers: (0, headers_1.buildHeaders)([
74
+ { ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
75
+ options?.headers,
76
+ ]),
77
+ });
78
+ }
79
+ /**
80
+ * Delete Skill
81
+ *
82
+ * @example
83
+ * ```ts
84
+ * const deletedSkill = await client.skills.delete('skill_id');
85
+ * ```
86
+ */
87
+ delete(skillID, params = {}, options) {
88
+ const { workspace_id } = params ?? {};
89
+ return this._client.delete((0, path_1.path) `/v1/skills/${skillID}`, {
90
+ ...options,
91
+ headers: (0, headers_1.buildHeaders)([
92
+ { ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
93
+ options?.headers,
94
+ ]),
95
+ });
96
+ }
16
97
  }
17
- /**
18
- * Create Skill
19
- *
20
- * @example
21
- * ```ts
22
- * const skill = await client.skills.create({
23
- * files: [fs.createReadStream('path/to/file')],
24
- * });
25
- * ```
26
- */
27
- create(params, options) {
28
- const { workspace_id, ...body } = params;
29
- return this._client.post('/v1/skills', (0, uploads_1.multipartFormRequestOptions)({
30
- body,
31
- ...options,
32
- headers: (0, headers_1.buildHeaders)([
33
- { ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
34
- options?.headers,
35
- ]),
36
- }, this._client, false));
37
- }
38
- /**
39
- * Get Skill
40
- *
41
- * @example
42
- * ```ts
43
- * const skill = await client.skills.retrieve('skill_id');
44
- * ```
45
- */
46
- retrieve(skillID, params = {}, options) {
47
- const { workspace_id } = params ?? {};
48
- return this._client.get((0, path_1.path) `/v1/skills/${skillID}`, {
49
- ...options,
50
- headers: (0, headers_1.buildHeaders)([
51
- { ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
52
- options?.headers,
53
- ]),
54
- });
55
- }
56
- /**
57
- * List Skills
58
- *
59
- * @example
60
- * ```ts
61
- * // Automatically fetches more pages as needed.
62
- * for await (const skill of client.skills.list()) {
63
- * // ...
64
- * }
65
- * ```
66
- */
67
- list(params = {}, options) {
68
- const { workspace_id, ...query } = params ?? {};
69
- return this._client.getAPIList('/v1/skills', (pagination_1.PageCursor), {
70
- query,
71
- ...options,
72
- headers: (0, headers_1.buildHeaders)([
73
- { ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
74
- options?.headers,
75
- ]),
76
- });
77
- }
78
- /**
79
- * Delete Skill
80
- *
81
- * @example
82
- * ```ts
83
- * const deletedSkill = await client.skills.delete('skill_id');
84
- * ```
85
- */
86
- delete(skillID, params = {}, options) {
87
- const { workspace_id } = params ?? {};
88
- return this._client.delete((0, path_1.path) `/v1/skills/${skillID}`, {
89
- ...options,
90
- headers: (0, headers_1.buildHeaders)([
91
- { ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
92
- options?.headers,
93
- ]),
94
- });
95
- }
96
- }
98
+ Skills.Versions = versions_1.Versions;
99
+ return Skills;
100
+ })();
97
101
  exports.Skills = Skills;
98
- Skills.Versions = versions_1.Versions;
99
102
  //# sourceMappingURL=skills.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"skills.js","sourceRoot":"","sources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AK,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;YAChD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE,CAAA,uBAAiB,CAAA,EAAE;gBAC9D,KAAK;gBACL,GAAG,OAAO;gBACV,OAAO,EAAE,IAAA,sBAAY,EAAC;oBACpB,EAAE,GAAG,CAAC,YAAY,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,wBAAwB,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE;oBACtF,OAAO,EAAE,OAAO;iBACjB,CAAC;aACH,CAAC,CAAC;QACL,CAAC;QAED;;;;;;;WAOG;QACH,MAAM,CACJ,OAAe,EACf,SAA+C,EAAE,EACjD,OAAwB;YAExB,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;YACtC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,cAAc,OAAO,EAAE,EAAE;gBACtD,GAAG,OAAO;gBACV,OAAO,EAAE,IAAA,sBAAY,EAAC;oBACpB,EAAE,GAAG,CAAC,YAAY,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,wBAAwB,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE;oBACtF,OAAO,EAAE,OAAO;iBACjB,CAAC;aACH,CAAC,CAAC;QACL,CAAC;KACF;IA8JD,MAAM,CAAC,QAAQ,GAAG,mBAAQ,CAAC;;;AArQ3B,wBAuGC"}
@@ -5,90 +5,93 @@ import { PageCursor } from "../../core/pagination.mjs";
5
5
  import { buildHeaders } from "../../internal/headers.mjs";
6
6
  import { multipartFormRequestOptions } from "../../internal/uploads.mjs";
7
7
  import { path } from "../../internal/utils/path.mjs";
8
- export class Skills extends APIResource {
9
- constructor() {
10
- super(...arguments);
11
- this.versions = new VersionsAPI.Versions(this._client);
8
+ export var Skills = /* @__PURE__ */ (() => {
9
+ class Skills extends APIResource {
10
+ constructor() {
11
+ super(...arguments);
12
+ this.versions = new VersionsAPI.Versions(this._client);
13
+ }
14
+ /**
15
+ * Create Skill
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const skill = await client.skills.create({
20
+ * files: [fs.createReadStream('path/to/file')],
21
+ * });
22
+ * ```
23
+ */
24
+ create(params, options) {
25
+ const { workspace_id, ...body } = params;
26
+ return this._client.post('/v1/skills', multipartFormRequestOptions({
27
+ body,
28
+ ...options,
29
+ headers: buildHeaders([
30
+ { ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
31
+ options?.headers,
32
+ ]),
33
+ }, this._client, false));
34
+ }
35
+ /**
36
+ * Get Skill
37
+ *
38
+ * @example
39
+ * ```ts
40
+ * const skill = await client.skills.retrieve('skill_id');
41
+ * ```
42
+ */
43
+ retrieve(skillID, params = {}, options) {
44
+ const { workspace_id } = params ?? {};
45
+ return this._client.get(path `/v1/skills/${skillID}`, {
46
+ ...options,
47
+ headers: buildHeaders([
48
+ { ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
49
+ options?.headers,
50
+ ]),
51
+ });
52
+ }
53
+ /**
54
+ * List Skills
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * // Automatically fetches more pages as needed.
59
+ * for await (const skill of client.skills.list()) {
60
+ * // ...
61
+ * }
62
+ * ```
63
+ */
64
+ list(params = {}, options) {
65
+ const { workspace_id, ...query } = params ?? {};
66
+ return this._client.getAPIList('/v1/skills', (PageCursor), {
67
+ query,
68
+ ...options,
69
+ headers: buildHeaders([
70
+ { ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
71
+ options?.headers,
72
+ ]),
73
+ });
74
+ }
75
+ /**
76
+ * Delete Skill
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * const deletedSkill = await client.skills.delete('skill_id');
81
+ * ```
82
+ */
83
+ delete(skillID, params = {}, options) {
84
+ const { workspace_id } = params ?? {};
85
+ return this._client.delete(path `/v1/skills/${skillID}`, {
86
+ ...options,
87
+ headers: buildHeaders([
88
+ { ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
89
+ options?.headers,
90
+ ]),
91
+ });
92
+ }
12
93
  }
13
- /**
14
- * Create Skill
15
- *
16
- * @example
17
- * ```ts
18
- * const skill = await client.skills.create({
19
- * files: [fs.createReadStream('path/to/file')],
20
- * });
21
- * ```
22
- */
23
- create(params, options) {
24
- const { workspace_id, ...body } = params;
25
- return this._client.post('/v1/skills', multipartFormRequestOptions({
26
- body,
27
- ...options,
28
- headers: buildHeaders([
29
- { ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
30
- options?.headers,
31
- ]),
32
- }, this._client, false));
33
- }
34
- /**
35
- * Get Skill
36
- *
37
- * @example
38
- * ```ts
39
- * const skill = await client.skills.retrieve('skill_id');
40
- * ```
41
- */
42
- retrieve(skillID, params = {}, options) {
43
- const { workspace_id } = params ?? {};
44
- return this._client.get(path `/v1/skills/${skillID}`, {
45
- ...options,
46
- headers: buildHeaders([
47
- { ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
48
- options?.headers,
49
- ]),
50
- });
51
- }
52
- /**
53
- * List Skills
54
- *
55
- * @example
56
- * ```ts
57
- * // Automatically fetches more pages as needed.
58
- * for await (const skill of client.skills.list()) {
59
- * // ...
60
- * }
61
- * ```
62
- */
63
- list(params = {}, options) {
64
- const { workspace_id, ...query } = params ?? {};
65
- return this._client.getAPIList('/v1/skills', (PageCursor), {
66
- query,
67
- ...options,
68
- headers: buildHeaders([
69
- { ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
70
- options?.headers,
71
- ]),
72
- });
73
- }
74
- /**
75
- * Delete Skill
76
- *
77
- * @example
78
- * ```ts
79
- * const deletedSkill = await client.skills.delete('skill_id');
80
- * ```
81
- */
82
- delete(skillID, params = {}, options) {
83
- const { workspace_id } = params ?? {};
84
- return this._client.delete(path `/v1/skills/${skillID}`, {
85
- ...options,
86
- headers: buildHeaders([
87
- { ...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined) },
88
- options?.headers,
89
- ]),
90
- });
91
- }
92
- }
93
- Skills.Versions = Versions;
94
+ Skills.Versions = Versions;
95
+ return Skills;
96
+ })();
94
97
  //# sourceMappingURL=skills.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"skills.mjs","sourceRoot":"","sources":["../../src/resources/skills/skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,WAAW,uBAAmB;AAC1C,OAAO,EAQL,QAAQ,GACT,uBAAmB;AAEpB,OAAO,EAAE,UAAU,EAAsC,kCAA8B;AAEvF,OAAO,EAAE,YAAY,EAAE,mCAA+B;AAEtD,OAAO,EAAE,2BAA2B,EAAE,mCAA+B;AACrE,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD,MAAM,OAAO,MAAO,SAAQ,WAAW;IAAvC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAsG1E,CAAC;IApGC;;;;;;;;;OASG;IACH,MAAM,CAAC,MAAyB,EAAE,OAAwB;QACxD,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,YAAY,EACZ,2BAA2B,CACzB;YACE,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB,EAAE,GAAG,CAAC,YAAY,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,wBAAwB,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE;gBACtF,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,EACD,IAAI,CAAC,OAAO,EACZ,KAAK,CACN,CACF,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,QAAQ,CACN,OAAe,EACf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AAY,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE;oBACtF,OAAO,EAAE,OAAO;iBACjB,CAAC;aACH,CAAC,CAAC;QACL,CAAC;KACF;IA8JD,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC"}
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
3
  //# sourceMappingURL=top-level.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"top-level.js","sourceRoot":"","sources":["../src/resources/top-level.ts"],"names":[],"mappings":";AAAA,sFAAsF"}
1
+ {"version":3,"file":"top-level.js","sourceRoot":"","sources":["../src/resources/top-level.ts"],"names":[],"mappings":""}
@@ -1,3 +1,2 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
1
  export {};
3
2
  //# sourceMappingURL=top-level.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"top-level.mjs","sourceRoot":"","sources":["../src/resources/top-level.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
1
+ {"version":3,"file":"top-level.mjs","sourceRoot":"","sources":["../src/resources/top-level.ts"],"names":[],"mappings":""}
package/src/client.ts CHANGED
@@ -320,6 +320,12 @@ import {
320
320
  WebFetchToolResultErrorBlock,
321
321
  WebFetchToolResultErrorBlockParam,
322
322
  WebFetchToolResultErrorCode,
323
+ WebFetchURLSourceAll,
324
+ WebFetchURLSourceExcept,
325
+ WebFetchURLSourceNone,
326
+ WebFetchURLSourceOnly,
327
+ WebFetchURLSourceToolReference,
328
+ WebFetchURLSources,
323
329
  WebSearchResultBlock,
324
330
  WebSearchResultBlockParam,
325
331
  WebSearchTool20250305,
@@ -1484,7 +1490,7 @@ export class BaseAnthropic {
1484
1490
  const maxRetries = options.maxRetries ?? this.maxRetries;
1485
1491
  timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
1486
1492
  }
1487
- await sleep(timeoutMillis);
1493
+ await sleep(timeoutMillis, options.signal ?? undefined);
1488
1494
 
1489
1495
  return this.makeRequest(options, retriesRemaining - 1, requestLogID);
1490
1496
  }
@@ -1935,6 +1941,12 @@ export declare namespace Anthropic {
1935
1941
  type WebFetchToolResultErrorBlock as WebFetchToolResultErrorBlock,
1936
1942
  type WebFetchToolResultErrorBlockParam as WebFetchToolResultErrorBlockParam,
1937
1943
  type WebFetchToolResultErrorCode as WebFetchToolResultErrorCode,
1944
+ type WebFetchURLSourceAll as WebFetchURLSourceAll,
1945
+ type WebFetchURLSourceExcept as WebFetchURLSourceExcept,
1946
+ type WebFetchURLSourceNone as WebFetchURLSourceNone,
1947
+ type WebFetchURLSourceOnly as WebFetchURLSourceOnly,
1948
+ type WebFetchURLSourceToolReference as WebFetchURLSourceToolReference,
1949
+ type WebFetchURLSources as WebFetchURLSources,
1938
1950
  type WebSearchResultBlock as WebSearchResultBlock,
1939
1951
  type WebSearchResultBlockParam as WebSearchResultBlockParam,
1940
1952
  type WebSearchTool20250305 as WebSearchTool20250305,
@@ -13,10 +13,10 @@ function unavailable<T extends object>(module: string): T {
13
13
  });
14
14
  }
15
15
 
16
- export const child_process: typeof node.child_process = unavailable('child_process');
17
- export const crypto: typeof node.crypto = unavailable('crypto');
18
- export const fs: typeof node.fs = unavailable('fs');
19
- export const os: typeof node.os = unavailable('os');
20
- export const path: typeof node.path = unavailable('path');
21
- export const stream: typeof node.stream = unavailable('stream');
22
- export const util: typeof node.util = unavailable('util');
16
+ export const child_process: typeof node.child_process = /* @__PURE__ */ unavailable('child_process');
17
+ export const crypto: typeof node.crypto = /* @__PURE__ */ unavailable('crypto');
18
+ export const fs: typeof node.fs = /* @__PURE__ */ unavailable('fs');
19
+ export const os: typeof node.os = /* @__PURE__ */ unavailable('os');
20
+ export const path: typeof node.path = /* @__PURE__ */ unavailable('path');
21
+ export const stream: typeof node.stream = /* @__PURE__ */ unavailable('stream');
22
+ export const util: typeof node.util = /* @__PURE__ */ unavailable('util');
@@ -14,7 +14,7 @@ export function concatBytes(buffers: Uint8Array[]): Uint8Array {
14
14
  }
15
15
 
16
16
  let encodeUTF8_: (str: string) => Uint8Array;
17
- export function encodeUTF8(str: string) {
17
+ export function encodeUTF8(str: string): Uint8Array {
18
18
  let encoder;
19
19
  return (
20
20
  encodeUTF8_ ??
@@ -115,6 +115,7 @@ import {
115
115
  import * as ModelsAPI from './models';
116
116
  import {
117
117
  BetaCapabilitySupport,
118
+ BetaCompactionCapability,
118
119
  BetaContextManagementCapability,
119
120
  BetaEffortCapability,
120
121
  BetaModelCapabilities,
@@ -407,6 +408,7 @@ import {
407
408
  BetaCompact20260112Edit,
408
409
  BetaCompactionBlock,
409
410
  BetaCompactionBlockParam,
411
+ BetaCompactionConfig,
410
412
  BetaCompactionContentBlockDelta,
411
413
  BetaCompactionIterationUsage,
412
414
  BetaComputerCursorPositionConfig,
@@ -466,6 +468,7 @@ import {
466
468
  BetaJSONOutputFormat,
467
469
  BetaInputTokensClearAtLeast,
468
470
  BetaInputTokensTrigger,
471
+ BetaInputTransformation,
469
472
  BetaMCPToolResultBlock,
470
473
  BetaMCPToolUseBlock,
471
474
  BetaMCPToolUseBlockParam,
@@ -513,6 +516,7 @@ import {
513
516
  BetaSignatureDelta,
514
517
  BetaSkillParams,
515
518
  BetaStopReason,
519
+ BetaSummarizeCompaction,
516
520
  BetaSystemMessageOutputConfig,
517
521
  BetaTextBlock,
518
522
  BetaTextBlockParam,
@@ -538,6 +542,7 @@ import {
538
542
  BetaThinkingConfigParam,
539
543
  BetaThinkingDelta,
540
544
  BetaThinkingDroppedInputTransformation,
545
+ BetaThinkingMismatchAllowedInputTransformation,
541
546
  BetaThinkingPrefixMismatchBehavior,
542
547
  BetaThinkingTurns,
543
548
  BetaTokenTaskBudget,
@@ -582,6 +587,12 @@ import {
582
587
  BetaWebFetchToolResultErrorBlock,
583
588
  BetaWebFetchToolResultErrorBlockParam,
584
589
  BetaWebFetchToolResultErrorCode,
590
+ BetaWebFetchURLSourceAll,
591
+ BetaWebFetchURLSourceExcept,
592
+ BetaWebFetchURLSourceNone,
593
+ BetaWebFetchURLSourceOnly,
594
+ BetaWebFetchURLSourceToolReference,
595
+ BetaWebFetchURLSources,
585
596
  BetaWebSearchResultBlock,
586
597
  BetaWebSearchResultBlockParam,
587
598
  BetaWebSearchTool20250305,
@@ -753,7 +764,8 @@ export type AnthropicBeta =
753
764
  | 'ce-user-management-2026-07-13'
754
765
  | 'mid-conversation-output-config-2026-07-01'
755
766
  | 'thinking-binding-controls-2026-08-01'
756
- | 'mid-conversation-system-clear-at-2026-08-21';
767
+ | 'mid-conversation-system-clear-at-2026-08-21'
768
+ | 'compact-2026-09-04';
757
769
 
758
770
  export interface BetaAPIError {
759
771
  message: string;
@@ -887,6 +899,7 @@ export declare namespace Beta {
887
899
  export {
888
900
  Models as Models,
889
901
  type BetaCapabilitySupport as BetaCapabilitySupport,
902
+ type BetaCompactionCapability as BetaCompactionCapability,
890
903
  type BetaContextManagementCapability as BetaContextManagementCapability,
891
904
  type BetaEffortCapability as BetaEffortCapability,
892
905
  type BetaModelCapabilities as BetaModelCapabilities,
@@ -1004,6 +1017,7 @@ export declare namespace Beta {
1004
1017
  type BetaCompact20260112Edit as BetaCompact20260112Edit,
1005
1018
  type BetaCompactionBlock as BetaCompactionBlock,
1006
1019
  type BetaCompactionBlockParam as BetaCompactionBlockParam,
1020
+ type BetaCompactionConfig as BetaCompactionConfig,
1007
1021
  type BetaCompactionContentBlockDelta as BetaCompactionContentBlockDelta,
1008
1022
  type BetaCompactionIterationUsage as BetaCompactionIterationUsage,
1009
1023
  type BetaComputerCursorPositionConfig as BetaComputerCursorPositionConfig,
@@ -1063,6 +1077,7 @@ export declare namespace Beta {
1063
1077
  type BetaJSONOutputFormat as BetaJSONOutputFormat,
1064
1078
  type BetaInputTokensClearAtLeast as BetaInputTokensClearAtLeast,
1065
1079
  type BetaInputTokensTrigger as BetaInputTokensTrigger,
1080
+ type BetaInputTransformation as BetaInputTransformation,
1066
1081
  type BetaMCPToolConfig as BetaMCPToolConfig,
1067
1082
  type BetaMCPToolDefaultConfig as BetaMCPToolDefaultConfig,
1068
1083
  type BetaMCPToolResultBlock as BetaMCPToolResultBlock,
@@ -1112,6 +1127,7 @@ export declare namespace Beta {
1112
1127
  type BetaSignatureDelta as BetaSignatureDelta,
1113
1128
  type BetaSkillParams as BetaSkillParams,
1114
1129
  type BetaStopReason as BetaStopReason,
1130
+ type BetaSummarizeCompaction as BetaSummarizeCompaction,
1115
1131
  type BetaSystemMessageOutputConfig as BetaSystemMessageOutputConfig,
1116
1132
  type BetaTextBlock as BetaTextBlock,
1117
1133
  type BetaTextBlockParam as BetaTextBlockParam,
@@ -1137,6 +1153,7 @@ export declare namespace Beta {
1137
1153
  type BetaThinkingConfigParam as BetaThinkingConfigParam,
1138
1154
  type BetaThinkingDelta as BetaThinkingDelta,
1139
1155
  type BetaThinkingDroppedInputTransformation as BetaThinkingDroppedInputTransformation,
1156
+ type BetaThinkingMismatchAllowedInputTransformation as BetaThinkingMismatchAllowedInputTransformation,
1140
1157
  type BetaThinkingPrefixMismatchBehavior as BetaThinkingPrefixMismatchBehavior,
1141
1158
  type BetaThinkingTurns as BetaThinkingTurns,
1142
1159
  type BetaTokenTaskBudget as BetaTokenTaskBudget,
@@ -1181,6 +1198,12 @@ export declare namespace Beta {
1181
1198
  type BetaWebFetchToolResultErrorBlock as BetaWebFetchToolResultErrorBlock,
1182
1199
  type BetaWebFetchToolResultErrorBlockParam as BetaWebFetchToolResultErrorBlockParam,
1183
1200
  type BetaWebFetchToolResultErrorCode as BetaWebFetchToolResultErrorCode,
1201
+ type BetaWebFetchURLSourceAll as BetaWebFetchURLSourceAll,
1202
+ type BetaWebFetchURLSourceExcept as BetaWebFetchURLSourceExcept,
1203
+ type BetaWebFetchURLSourceNone as BetaWebFetchURLSourceNone,
1204
+ type BetaWebFetchURLSourceOnly as BetaWebFetchURLSourceOnly,
1205
+ type BetaWebFetchURLSourceToolReference as BetaWebFetchURLSourceToolReference,
1206
+ type BetaWebFetchURLSources as BetaWebFetchURLSources,
1184
1207
  type BetaWebSearchResultBlock as BetaWebSearchResultBlock,
1185
1208
  type BetaWebSearchResultBlockParam as BetaWebSearchResultBlockParam,
1186
1209
  type BetaWebSearchTool20250305 as BetaWebSearchTool20250305,
@@ -190,11 +190,6 @@ export interface BetaDream {
190
190
  */
191
191
  model: BetaDreamModelConfig;
192
192
 
193
- /**
194
- * The default destination: the job creates a new output memory store as a clone of
195
- * the memory_store input and writes the consolidated memories into it. The input
196
- * store is never mutated.
197
- */
198
193
  output_behavior: BetaOutputBehavior;
199
194
 
200
195
  outputs: Array<BetaDreamOutput>;
@@ -223,11 +218,6 @@ export interface BetaDreamError {
223
218
  type: string;
224
219
  }
225
220
 
226
- /**
227
- * An input memory store the dream reads from. The dream never mutates this store
228
- * unless it is also the destination: with output_behavior {type:
229
- * "update_existing"} the job consolidates this store in place.
230
- */
231
221
  export type BetaDreamInput = BetaDreamMemoryStoreInput | BetaDreamSessionsInput;
232
222
 
233
223
  /**
@@ -333,15 +323,6 @@ export interface BetaDreamUsage {
333
323
  output_tokens: number;
334
324
  }
335
325
 
336
- /**
337
- * The `output_behavior.memory_store_id` target is still held by a prior
338
- * `{type: "update_existing"}` dream — one that is `pending` or `running`, or was
339
- * canceled with its final writes still landing. Rarely the named dream has just
340
- * finished (`completed`/`failed`) and its execution is still closing; an immediate
341
- * retry then almost always succeeds. The message names the holding dream when the
342
- * server can identify it (rarely omitted); poll it to a terminal state or cancel
343
- * it, then retry. Carried with `x-should-retry: false`.
344
- */
345
326
  export type BetaDreamingError =
346
327
  | BetaAPI.BetaInvalidRequestError
347
328
  | BetaAPI.BetaAuthenticationError
@@ -354,11 +335,6 @@ export type BetaDreamingError =
354
335
  | BetaAPI.BetaOverloadedError
355
336
  | BetaTargetStoreHeldError;
356
337
 
357
- /**
358
- * The default destination: the job creates a new output memory store as a clone of
359
- * the memory_store input and writes the consolidated memories into it. The input
360
- * store is never mutated.
361
- */
362
338
  export type BetaOutputBehavior = BetaOutputBehaviorCreateNew | BetaOutputBehaviorUpdateExisting;
363
339
 
364
340
  /**
@@ -407,7 +383,7 @@ export interface DreamCreateParams {
407
383
  inputs: Array<BetaDreamInput>;
408
384
 
409
385
  /**
410
- * Body param: Model identifier and configuration applied to every pipeline stage.
386
+ * Body param
411
387
  */
412
388
  model: string | BetaDreamModelConfigParam;
413
389
 
@@ -417,9 +393,7 @@ export interface DreamCreateParams {
417
393
  instructions?: string | null;
418
394
 
419
395
  /**
420
- * Body param: The default destination: the job creates a new output memory store
421
- * as a clone of the memory_store input and writes the consolidated memories into
422
- * it. The input store is never mutated.
396
+ * Body param
423
397
  */
424
398
  output_behavior?: BetaOutputBehavior;
425
399