@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.
- package/CHANGELOG.md +50 -0
- package/client.d.mts +2 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -2
- package/client.d.ts.map +1 -1
- package/client.js +846 -840
- package/client.js.map +1 -1
- package/client.mjs +846 -834
- package/client.mjs.map +1 -1
- package/core/api-promise.js +71 -68
- package/core/api-promise.js.map +1 -1
- package/core/api-promise.mjs +71 -64
- package/core/api-promise.mjs.map +1 -1
- package/core/error.js +5 -2
- package/core/error.js.map +1 -1
- package/core/error.mjs +5 -2
- package/core/error.mjs.map +1 -1
- package/core/pagination.js +56 -50
- package/core/pagination.js.map +1 -1
- package/core/pagination.mjs +56 -41
- package/core/pagination.mjs.map +1 -1
- package/core/streaming.js +212 -209
- package/core/streaming.js.map +1 -1
- package/core/streaming.mjs +212 -209
- package/core/streaming.mjs.map +1 -1
- package/helpers/beta/mcp.js +14 -19
- package/helpers/beta/mcp.js.map +1 -1
- package/helpers/beta/mcp.mjs +14 -13
- package/helpers/beta/mcp.mjs.map +1 -1
- package/internal/constants.js +1 -1
- package/internal/constants.js.map +1 -1
- package/internal/decoders/jsonl.js +27 -24
- package/internal/decoders/jsonl.js.map +1 -1
- package/internal/decoders/jsonl.mjs +27 -24
- package/internal/decoders/jsonl.mjs.map +1 -1
- package/internal/decoders/line.js +52 -49
- package/internal/decoders/line.js.map +1 -1
- package/internal/decoders/line.mjs +52 -43
- package/internal/decoders/line.mjs.map +1 -1
- package/internal/file-store.js +256 -258
- package/internal/file-store.js.map +1 -1
- package/internal/file-store.mjs +256 -243
- package/internal/file-store.mjs.map +1 -1
- package/internal/node.browser.d.mts.map +1 -1
- package/internal/node.browser.d.ts.map +1 -1
- package/internal/node.browser.js.map +1 -1
- package/internal/node.browser.mjs +7 -7
- package/internal/node.browser.mjs.map +1 -1
- package/internal/shim-types.js +0 -6
- package/internal/shim-types.js.map +1 -1
- package/internal/shim-types.mjs +0 -6
- package/internal/shim-types.mjs.map +1 -1
- package/internal/shims.js +0 -6
- package/internal/shims.js.map +1 -1
- package/internal/shims.mjs +0 -6
- package/internal/shims.mjs.map +1 -1
- package/internal/stainless-helper-header.js +6 -6
- package/internal/stainless-helper-header.js.map +1 -1
- package/internal/utils/async-queue.js +66 -63
- package/internal/utils/async-queue.js.map +1 -1
- package/internal/utils/async-queue.mjs +66 -56
- package/internal/utils/async-queue.mjs.map +1 -1
- package/internal/utils/bytes.d.mts +1 -1
- package/internal/utils/bytes.d.mts.map +1 -1
- package/internal/utils/bytes.d.ts +1 -1
- package/internal/utils/bytes.d.ts.map +1 -1
- package/lib/BetaMessageStream.js +593 -590
- package/lib/BetaMessageStream.js.map +1 -1
- package/lib/BetaMessageStream.mjs +593 -590
- package/lib/BetaMessageStream.mjs.map +1 -1
- package/lib/MessageStream.js +544 -541
- package/lib/MessageStream.js.map +1 -1
- package/lib/MessageStream.mjs +544 -541
- package/lib/MessageStream.mjs.map +1 -1
- package/lib/environments/poller.js +180 -174
- package/lib/environments/poller.js.map +1 -1
- package/lib/environments/poller.mjs +180 -153
- package/lib/environments/poller.mjs.map +1 -1
- package/lib/environments/worker.js +375 -369
- package/lib/environments/worker.js.map +1 -1
- package/lib/environments/worker.mjs +374 -329
- package/lib/environments/worker.mjs.map +1 -1
- package/lib/tools/BetaToolRunner.js +316 -313
- package/lib/tools/BetaToolRunner.js.map +1 -1
- package/lib/tools/BetaToolRunner.mjs +315 -306
- package/lib/tools/BetaToolRunner.mjs.map +1 -1
- package/lib/tools/SessionToolRunner.js +241 -235
- package/lib/tools/SessionToolRunner.js.map +1 -1
- package/lib/tools/SessionToolRunner.mjs +241 -192
- package/lib/tools/SessionToolRunner.mjs.map +1 -1
- package/lib/tools/ToolError.js +39 -36
- package/lib/tools/ToolError.js.map +1 -1
- package/lib/tools/ToolError.mjs +39 -13
- package/lib/tools/ToolError.mjs.map +1 -1
- package/package.json +3 -3
- package/resources/beta/agents/agents.js +135 -132
- package/resources/beta/agents/agents.js.map +1 -1
- package/resources/beta/agents/agents.mjs +135 -132
- package/resources/beta/agents/agents.mjs.map +1 -1
- package/resources/beta/beta.d.mts +5 -5
- package/resources/beta/beta.d.mts.map +1 -1
- package/resources/beta/beta.d.ts +5 -5
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js +39 -36
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs +39 -36
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/dreams.d.mts +2 -28
- package/resources/beta/dreams.d.mts.map +1 -1
- package/resources/beta/dreams.d.ts +2 -28
- package/resources/beta/dreams.d.ts.map +1 -1
- package/resources/beta/environments/environments.js +157 -154
- package/resources/beta/environments/environments.js.map +1 -1
- package/resources/beta/environments/environments.mjs +157 -154
- package/resources/beta/environments/environments.mjs.map +1 -1
- package/resources/beta/environments/work.js +255 -252
- package/resources/beta/environments/work.js.map +1 -1
- package/resources/beta/environments/work.mjs +255 -252
- package/resources/beta/environments/work.mjs.map +1 -1
- package/resources/beta/index.d.mts +2 -2
- package/resources/beta/index.d.mts.map +1 -1
- package/resources/beta/index.d.ts +2 -2
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/memory-stores/memory-stores.js +150 -147
- package/resources/beta/memory-stores/memory-stores.js.map +1 -1
- package/resources/beta/memory-stores/memory-stores.mjs +150 -147
- package/resources/beta/memory-stores/memory-stores.mjs.map +1 -1
- package/resources/beta/messages/batches.d.mts +12 -1
- package/resources/beta/messages/batches.d.mts.map +1 -1
- package/resources/beta/messages/batches.d.ts +12 -1
- package/resources/beta/messages/batches.d.ts.map +1 -1
- package/resources/beta/messages/index.d.mts +1 -1
- package/resources/beta/messages/index.d.mts.map +1 -1
- package/resources/beta/messages/index.d.ts +1 -1
- package/resources/beta/messages/index.d.ts.map +1 -1
- package/resources/beta/messages/index.js.map +1 -1
- package/resources/beta/messages/index.mjs.map +1 -1
- package/resources/beta/messages/messages.d.mts +238 -100
- package/resources/beta/messages/messages.d.mts.map +1 -1
- package/resources/beta/messages/messages.d.ts +238 -100
- package/resources/beta/messages/messages.d.ts.map +1 -1
- package/resources/beta/messages/messages.js +113 -110
- package/resources/beta/messages/messages.js.map +1 -1
- package/resources/beta/messages/messages.mjs +113 -110
- package/resources/beta/messages/messages.mjs.map +1 -1
- package/resources/beta/models.d.mts +22 -1
- package/resources/beta/models.d.mts.map +1 -1
- package/resources/beta/models.d.ts +22 -1
- package/resources/beta/models.d.ts.map +1 -1
- package/resources/beta/organization/federation/federation.js +11 -8
- package/resources/beta/organization/federation/federation.js.map +1 -1
- package/resources/beta/organization/federation/federation.mjs +11 -8
- package/resources/beta/organization/federation/federation.mjs.map +1 -1
- package/resources/beta/organization/federation/rules/rules.js +187 -184
- package/resources/beta/organization/federation/rules/rules.js.map +1 -1
- package/resources/beta/organization/federation/rules/rules.mjs +187 -184
- package/resources/beta/organization/federation/rules/rules.mjs.map +1 -1
- package/resources/beta/organization/organization.js +38 -35
- package/resources/beta/organization/organization.js.map +1 -1
- package/resources/beta/organization/organization.mjs +38 -35
- package/resources/beta/organization/organization.mjs.map +1 -1
- package/resources/beta/organization/service-accounts/service-accounts.js +163 -160
- package/resources/beta/organization/service-accounts/service-accounts.js.map +1 -1
- package/resources/beta/organization/service-accounts/service-accounts.mjs +163 -160
- package/resources/beta/organization/service-accounts/service-accounts.mjs.map +1 -1
- package/resources/beta/organization/workspaces/workspaces.d.mts +3 -3
- package/resources/beta/organization/workspaces/workspaces.d.mts.map +1 -1
- package/resources/beta/organization/workspaces/workspaces.d.ts +3 -3
- package/resources/beta/organization/workspaces/workspaces.d.ts.map +1 -1
- package/resources/beta/organization/workspaces/workspaces.js +97 -94
- package/resources/beta/organization/workspaces/workspaces.js.map +1 -1
- package/resources/beta/organization/workspaces/workspaces.mjs +97 -94
- package/resources/beta/organization/workspaces/workspaces.mjs.map +1 -1
- package/resources/beta/sessions/events.d.mts +12 -21
- package/resources/beta/sessions/events.d.mts.map +1 -1
- package/resources/beta/sessions/events.d.ts +12 -21
- package/resources/beta/sessions/events.d.ts.map +1 -1
- package/resources/beta/sessions/events.js +118 -115
- package/resources/beta/sessions/events.js.map +1 -1
- package/resources/beta/sessions/events.mjs +118 -115
- package/resources/beta/sessions/events.mjs.map +1 -1
- package/resources/beta/sessions/resources.d.mts +0 -3
- package/resources/beta/sessions/resources.d.mts.map +1 -1
- package/resources/beta/sessions/resources.d.ts +0 -3
- package/resources/beta/sessions/resources.d.ts.map +1 -1
- package/resources/beta/sessions/sessions.d.mts +2 -2
- package/resources/beta/sessions/sessions.d.ts +2 -2
- package/resources/beta/sessions/sessions.js +161 -158
- package/resources/beta/sessions/sessions.js.map +1 -1
- package/resources/beta/sessions/sessions.mjs +161 -158
- package/resources/beta/sessions/sessions.mjs.map +1 -1
- package/resources/beta/sessions/threads/threads.js +86 -83
- package/resources/beta/sessions/threads/threads.js.map +1 -1
- package/resources/beta/sessions/threads/threads.mjs +86 -83
- package/resources/beta/sessions/threads/threads.mjs.map +1 -1
- package/resources/beta/skills/skills.js +104 -101
- package/resources/beta/skills/skills.js.map +1 -1
- package/resources/beta/skills/skills.mjs +104 -101
- package/resources/beta/skills/skills.mjs.map +1 -1
- package/resources/beta/tunnels/tunnels.js +188 -185
- package/resources/beta/tunnels/tunnels.js.map +1 -1
- package/resources/beta/tunnels/tunnels.mjs +188 -185
- package/resources/beta/tunnels/tunnels.mjs.map +1 -1
- package/resources/beta/user-profiles.d.mts +45 -0
- package/resources/beta/user-profiles.d.mts.map +1 -1
- package/resources/beta/user-profiles.d.ts +45 -0
- package/resources/beta/user-profiles.d.ts.map +1 -1
- package/resources/beta/user-profiles.js +25 -10
- package/resources/beta/user-profiles.js.map +1 -1
- package/resources/beta/user-profiles.mjs +25 -10
- package/resources/beta/user-profiles.mjs.map +1 -1
- package/resources/beta/vaults/credentials.d.mts +0 -14
- package/resources/beta/vaults/credentials.d.mts.map +1 -1
- package/resources/beta/vaults/credentials.d.ts +0 -14
- package/resources/beta/vaults/credentials.d.ts.map +1 -1
- package/resources/beta/vaults/vaults.js +156 -153
- package/resources/beta/vaults/vaults.js.map +1 -1
- package/resources/beta/vaults/vaults.mjs +156 -153
- package/resources/beta/vaults/vaults.mjs.map +1 -1
- package/resources/completions.d.mts +1 -1
- package/resources/completions.d.ts +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/messages/index.d.mts +1 -1
- package/resources/messages/index.d.mts.map +1 -1
- package/resources/messages/index.d.ts +1 -1
- package/resources/messages/index.d.ts.map +1 -1
- package/resources/messages/index.js.map +1 -1
- package/resources/messages/index.mjs.map +1 -1
- package/resources/messages/messages.d.mts +100 -63
- package/resources/messages/messages.d.mts.map +1 -1
- package/resources/messages/messages.d.ts +100 -63
- package/resources/messages/messages.d.ts.map +1 -1
- package/resources/messages/messages.js +115 -112
- package/resources/messages/messages.js.map +1 -1
- package/resources/messages/messages.mjs +115 -112
- package/resources/messages/messages.mjs.map +1 -1
- package/resources/skills/skills.js +88 -85
- package/resources/skills/skills.js.map +1 -1
- package/resources/skills/skills.mjs +88 -85
- package/resources/skills/skills.mjs.map +1 -1
- package/resources/top-level.js +0 -1
- package/resources/top-level.js.map +1 -1
- package/resources/top-level.mjs +0 -1
- package/resources/top-level.mjs.map +1 -1
- package/src/client.ts +13 -1
- package/src/internal/node.browser.ts +7 -7
- package/src/internal/utils/bytes.ts +1 -1
- package/src/resources/beta/beta.ts +24 -1
- package/src/resources/beta/dreams.ts +2 -28
- package/src/resources/beta/index.ts +11 -0
- package/src/resources/beta/messages/batches.ts +13 -1
- package/src/resources/beta/messages/index.ts +10 -0
- package/src/resources/beta/messages/messages.ts +288 -99
- package/src/resources/beta/models.ts +25 -0
- package/src/resources/beta/organization/workspaces/workspaces.ts +3 -3
- package/src/resources/beta/sessions/events.ts +12 -21
- package/src/resources/beta/sessions/resources.ts +0 -3
- package/src/resources/beta/sessions/sessions.ts +2 -2
- package/src/resources/beta/user-profiles.ts +75 -10
- package/src/resources/beta/vaults/credentials.ts +0 -14
- package/src/resources/completions.ts +1 -1
- package/src/resources/index.ts +6 -0
- package/src/resources/messages/index.ts +6 -0
- package/src/resources/messages/messages.ts +128 -62
- package/src/tsconfig.json +13 -3
- package/src/version.ts +1 -1
- package/tools/agent-toolset/fs-util.js +0 -6
- package/tools/agent-toolset/fs-util.js.map +1 -1
- package/tools/agent-toolset/fs-util.mjs +0 -6
- package/tools/agent-toolset/fs-util.mjs.map +1 -1
- package/tools/agent-toolset/memories.js +4 -4
- package/tools/agent-toolset/memories.js.map +1 -1
- package/tools/agent-toolset/memories.mjs +2 -2
- package/tools/agent-toolset/memories.mjs.map +1 -1
- package/tools/agent-toolset/node.browser.js +12 -12
- package/tools/agent-toolset/node.browser.js.map +1 -1
- package/tools/agent-toolset/node.js +142 -139
- package/tools/agent-toolset/node.js.map +1 -1
- package/tools/agent-toolset/node.mjs +132 -125
- package/tools/agent-toolset/node.mjs.map +1 -1
- package/tools/agent-toolset/skills.js +5 -5
- package/tools/agent-toolset/skills.js.map +1 -1
- package/tools/agent-toolset/sync-interval.js +3 -3
- package/tools/agent-toolset/sync-interval.js.map +1 -1
- package/tools/memory/node.browser.js +2 -2
- package/tools/memory/node.browser.js.map +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- 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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
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":["../../src/resources/skills/skills.ts"],"names":[],"mappings":";;;;AAAA,qDAAkD;AAClD,mEAA0C;AAC1C,4CASoB;AAEpB,yDAAuF;AAEvF,uDAAsD;AAEtD,uDAAqE;AACrE,uDAAiD
|
|
1
|
+
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../../src/resources/skills/skills.ts"],"names":[],"mappings":";;;;AAAA,qDAAkD;AAClD,mEAA0C;AAC1C,4CASoB;AAEpB,yDAAuF;AAEvF,uDAAsD;AAEtD,uDAAqE;AACrE,uDAAiD;;IAEjD,MAAa,MAAO,SAAQ,sBAAW;QAAvC;;YACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAsG1E,CAAC;QApGC;;;;;;;;;WASG;QACH,MAAM,CAAC,MAAyB,EAAE,OAAwB;YACxD,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;YACzC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,YAAY,EACZ,IAAA,qCAA2B,EACzB;gBACE,IAAI;gBACJ,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,EACD,IAAI,CAAC,OAAO,EACZ,KAAK,CACN,CACF,CAAC;QACJ,CAAC;QAED;;;;;;;WAOG;QACH,QAAQ,CACN,OAAe,EACf,SAAiD,EAAE,EACnD,OAAwB;YAExB,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;YACtC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,cAAc,OAAO,EAAE,EAAE;gBACnD,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;;;;;;;;;;WAUG;QACH,IAAI,CACF,SAA6C,EAAE,EAC/C,OAAwB;YAExB,MAAM,EAAE,YAAY,EAAE,GAAG,KAAK,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
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
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,
|
|
1
|
+
{"version":3,"file":"skills.mjs","sourceRoot":"","sources":["../../src/resources/skills/skills.ts"],"names":[],"mappings":"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"}
|
package/resources/top-level.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"top-level.js","sourceRoot":"","sources":["../src/resources/top-level.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"top-level.js","sourceRoot":"","sources":["../src/resources/top-level.ts"],"names":[],"mappings":""}
|
package/resources/top-level.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"top-level.mjs","sourceRoot":"","sources":["../src/resources/top-level.ts"],"names":[],"mappings":"
|
|
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
|
|
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
|
|
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
|
|