@anthropic-ai/sdk 0.121.0 → 0.123.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 +63 -0
- package/README.md +1 -1
- package/core/credentials.d.mts.map +1 -1
- package/core/credentials.d.ts.map +1 -1
- package/core/credentials.js +5 -7
- package/core/credentials.js.map +1 -1
- package/core/credentials.mjs +5 -7
- package/core/credentials.mjs.map +1 -1
- package/core/middleware.d.mts.map +1 -1
- package/core/middleware.d.ts.map +1 -1
- package/core/middleware.js +4 -4
- package/core/middleware.js.map +1 -1
- package/core/middleware.mjs +4 -4
- package/core/middleware.mjs.map +1 -1
- package/internal/errors.d.mts.map +1 -1
- package/internal/errors.d.ts.map +1 -1
- package/internal/errors.js +3 -1
- package/internal/errors.js.map +1 -1
- package/internal/errors.mjs +3 -1
- package/internal/errors.mjs.map +1 -1
- package/internal/file-store.d.mts.map +1 -1
- package/internal/file-store.d.ts.map +1 -1
- package/internal/file-store.js +23 -25
- package/internal/file-store.js.map +1 -1
- package/internal/file-store.mjs +5 -6
- package/internal/file-store.mjs.map +1 -1
- package/internal/node.browser.d.mts +9 -0
- package/internal/node.browser.d.mts.map +1 -0
- package/internal/node.browser.d.ts +9 -0
- package/internal/node.browser.d.ts.map +1 -0
- package/internal/node.browser.js +22 -0
- package/internal/node.browser.js.map +1 -0
- package/internal/node.browser.mjs +19 -0
- package/internal/node.browser.mjs.map +1 -0
- package/internal/node.d.mts +14 -0
- package/internal/node.d.mts.map +1 -0
- package/internal/node.d.ts +14 -0
- package/internal/node.d.ts.map +1 -0
- package/internal/node.js +24 -0
- package/internal/node.js.map +1 -0
- package/internal/node.mjs +14 -0
- package/internal/node.mjs.map +1 -0
- package/internal/parse.js +1 -1
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +1 -1
- package/internal/parse.mjs.map +1 -1
- package/internal/uploads.js +10 -6
- package/internal/uploads.js.map +1 -1
- package/internal/uploads.mjs +10 -6
- package/internal/uploads.mjs.map +1 -1
- package/lib/BetaMessageStream.d.mts.map +1 -1
- package/lib/BetaMessageStream.d.ts.map +1 -1
- package/lib/BetaMessageStream.js +3 -0
- package/lib/BetaMessageStream.js.map +1 -1
- package/lib/BetaMessageStream.mjs +3 -0
- package/lib/BetaMessageStream.mjs.map +1 -1
- package/lib/credentials/credential-chain.js +1 -1
- package/lib/credentials/credential-chain.js.map +1 -1
- package/lib/credentials/credential-chain.mjs +1 -1
- package/lib/credentials/credential-chain.mjs.map +1 -1
- package/lib/credentials/identity-token.js +1 -1
- package/lib/credentials/identity-token.js.map +1 -1
- package/lib/credentials/identity-token.mjs +1 -1
- package/lib/credentials/identity-token.mjs.map +1 -1
- package/lib/credentials/types.d.mts.map +1 -1
- package/lib/credentials/types.d.ts.map +1 -1
- package/lib/credentials/types.js +2 -3
- package/lib/credentials/types.js.map +1 -1
- package/lib/credentials/types.mjs +2 -3
- package/lib/credentials/types.mjs.map +1 -1
- package/lib/credentials/user-oauth.js +1 -1
- package/lib/credentials/user-oauth.js.map +1 -1
- package/lib/credentials/user-oauth.mjs +1 -1
- package/lib/credentials/user-oauth.mjs.map +1 -1
- package/lib/middleware.d.mts.map +1 -1
- package/lib/middleware.d.ts.map +1 -1
- package/lib/middleware.js +30 -7
- package/lib/middleware.js.map +1 -1
- package/lib/middleware.mjs +30 -7
- package/lib/middleware.mjs.map +1 -1
- package/lib/sessions/accumulate.d.mts +3 -2
- package/lib/sessions/accumulate.d.mts.map +1 -1
- package/lib/sessions/accumulate.d.ts +3 -2
- package/lib/sessions/accumulate.d.ts.map +1 -1
- package/lib/sessions/accumulate.js +3 -45
- package/lib/sessions/accumulate.js.map +1 -1
- package/lib/sessions/accumulate.mjs +3 -45
- package/lib/sessions/accumulate.mjs.map +1 -1
- package/package.json +3 -1
- package/resources/beta/agents/agents.d.mts +1 -1
- package/resources/beta/agents/agents.d.mts.map +1 -1
- package/resources/beta/agents/agents.d.ts +1 -1
- package/resources/beta/agents/agents.d.ts.map +1 -1
- package/resources/beta/agents/agents.js.map +1 -1
- package/resources/beta/agents/agents.mjs.map +1 -1
- package/resources/beta/beta.d.mts +9 -9
- package/resources/beta/beta.d.mts.map +1 -1
- package/resources/beta/beta.d.ts +9 -9
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/deployment-runs.d.mts +6 -6
- package/resources/beta/deployment-runs.d.ts +6 -6
- package/resources/beta/deployments.d.mts +3 -2
- package/resources/beta/deployments.d.mts.map +1 -1
- package/resources/beta/deployments.d.ts +3 -2
- package/resources/beta/deployments.d.ts.map +1 -1
- package/resources/beta/dreams.d.mts +28 -1
- package/resources/beta/dreams.d.mts.map +1 -1
- package/resources/beta/dreams.d.ts +28 -1
- package/resources/beta/dreams.d.ts.map +1 -1
- package/resources/beta/files.d.mts +25 -5
- package/resources/beta/files.d.mts.map +1 -1
- package/resources/beta/files.d.ts +25 -5
- package/resources/beta/files.d.ts.map +1 -1
- package/resources/beta/files.js +6 -6
- package/resources/beta/files.js.map +1 -1
- package/resources/beta/files.mjs +7 -7
- package/resources/beta/files.mjs.map +1 -1
- package/resources/beta/index.d.mts +4 -4
- package/resources/beta/index.d.mts.map +1 -1
- package/resources/beta/index.d.ts +4 -4
- 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/memories.d.mts +6 -4
- package/resources/beta/memory-stores/memories.d.mts.map +1 -1
- package/resources/beta/memory-stores/memories.d.ts +6 -4
- package/resources/beta/memory-stores/memories.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 +148 -21
- package/resources/beta/messages/messages.d.mts.map +1 -1
- package/resources/beta/messages/messages.d.ts +148 -21
- package/resources/beta/messages/messages.d.ts.map +1 -1
- package/resources/beta/messages/messages.js.map +1 -1
- package/resources/beta/messages/messages.mjs.map +1 -1
- package/resources/beta/organization/compliance-settings.d.mts +74 -0
- package/resources/beta/organization/compliance-settings.d.mts.map +1 -0
- package/resources/beta/organization/compliance-settings.d.ts +74 -0
- package/resources/beta/organization/compliance-settings.d.ts.map +1 -0
- package/resources/beta/organization/compliance-settings.js +52 -0
- package/resources/beta/organization/compliance-settings.js.map +1 -0
- package/resources/beta/organization/compliance-settings.mjs +48 -0
- package/resources/beta/organization/compliance-settings.mjs.map +1 -0
- package/resources/beta/organization/external-keys.d.mts +6 -3
- package/resources/beta/organization/external-keys.d.mts.map +1 -1
- package/resources/beta/organization/external-keys.d.ts +6 -3
- package/resources/beta/organization/external-keys.d.ts.map +1 -1
- package/resources/beta/organization/index.d.mts +1 -0
- package/resources/beta/organization/index.d.mts.map +1 -1
- package/resources/beta/organization/index.d.ts +1 -0
- package/resources/beta/organization/index.d.ts.map +1 -1
- package/resources/beta/organization/index.js +3 -1
- package/resources/beta/organization/index.js.map +1 -1
- package/resources/beta/organization/index.mjs +1 -0
- package/resources/beta/organization/index.mjs.map +1 -1
- package/resources/beta/organization/organization.d.mts +4 -0
- package/resources/beta/organization/organization.d.mts.map +1 -1
- package/resources/beta/organization/organization.d.ts +4 -0
- package/resources/beta/organization/organization.d.ts.map +1 -1
- package/resources/beta/organization/organization.js +4 -0
- package/resources/beta/organization/organization.js.map +1 -1
- package/resources/beta/organization/organization.mjs +4 -0
- package/resources/beta/organization/organization.mjs.map +1 -1
- package/resources/beta/organization/rate-limits.d.mts +2 -3
- package/resources/beta/organization/rate-limits.d.mts.map +1 -1
- package/resources/beta/organization/rate-limits.d.ts +2 -3
- package/resources/beta/organization/rate-limits.d.ts.map +1 -1
- package/resources/beta/organization/rate-limits.js +2 -3
- package/resources/beta/organization/rate-limits.js.map +1 -1
- package/resources/beta/organization/rate-limits.mjs +2 -3
- package/resources/beta/organization/rate-limits.mjs.map +1 -1
- package/resources/beta/organization/workspaces/rate-limits.d.mts +2 -3
- package/resources/beta/organization/workspaces/rate-limits.d.mts.map +1 -1
- package/resources/beta/organization/workspaces/rate-limits.d.ts +2 -3
- package/resources/beta/organization/workspaces/rate-limits.d.ts.map +1 -1
- package/resources/beta/organization/workspaces/rate-limits.js +2 -3
- package/resources/beta/organization/workspaces/rate-limits.js.map +1 -1
- package/resources/beta/organization/workspaces/rate-limits.mjs +2 -3
- package/resources/beta/organization/workspaces/rate-limits.mjs.map +1 -1
- package/resources/beta/organization/workspaces/workspaces.d.mts +28 -12
- package/resources/beta/organization/workspaces/workspaces.d.mts.map +1 -1
- package/resources/beta/organization/workspaces/workspaces.d.ts +28 -12
- package/resources/beta/organization/workspaces/workspaces.d.ts.map +1 -1
- package/resources/beta/organization/workspaces/workspaces.js.map +1 -1
- package/resources/beta/organization/workspaces/workspaces.mjs.map +1 -1
- package/resources/beta/sessions/events.d.mts +1 -1
- package/resources/beta/sessions/events.d.ts +1 -1
- package/resources/beta/sessions/sessions.d.mts +10 -10
- package/resources/beta/sessions/sessions.d.ts +10 -10
- package/resources/beta/skills/index.d.mts +2 -2
- package/resources/beta/skills/index.d.mts.map +1 -1
- package/resources/beta/skills/index.d.ts +2 -2
- package/resources/beta/skills/index.d.ts.map +1 -1
- package/resources/beta/skills/index.js.map +1 -1
- package/resources/beta/skills/index.mjs.map +1 -1
- package/resources/beta/skills/skills.d.mts +48 -120
- package/resources/beta/skills/skills.d.mts.map +1 -1
- package/resources/beta/skills/skills.d.ts +48 -120
- package/resources/beta/skills/skills.d.ts.map +1 -1
- package/resources/beta/skills/skills.js +12 -8
- package/resources/beta/skills/skills.js.map +1 -1
- package/resources/beta/skills/skills.mjs +12 -8
- package/resources/beta/skills/skills.mjs.map +1 -1
- package/resources/beta/skills/versions.d.mts +35 -138
- package/resources/beta/skills/versions.d.mts.map +1 -1
- package/resources/beta/skills/versions.d.ts +35 -138
- package/resources/beta/skills/versions.d.ts.map +1 -1
- package/resources/beta/skills/versions.js +18 -18
- package/resources/beta/skills/versions.js.map +1 -1
- package/resources/beta/skills/versions.mjs +18 -18
- package/resources/beta/skills/versions.mjs.map +1 -1
- package/resources/beta/user-profiles.d.mts +21 -25
- package/resources/beta/user-profiles.d.mts.map +1 -1
- package/resources/beta/user-profiles.d.ts +21 -25
- package/resources/beta/user-profiles.d.ts.map +1 -1
- package/resources/beta/webhooks.d.mts +16 -17
- package/resources/beta/webhooks.d.mts.map +1 -1
- package/resources/beta/webhooks.d.ts +16 -17
- package/resources/beta/webhooks.d.ts.map +1 -1
- package/resources/beta/webhooks.js +21 -8
- package/resources/beta/webhooks.js.map +1 -1
- package/resources/beta/webhooks.mjs +21 -8
- package/resources/beta/webhooks.mjs.map +1 -1
- package/resources/messages/messages.d.mts +1 -3
- package/resources/messages/messages.d.mts.map +1 -1
- package/resources/messages/messages.d.ts +1 -3
- package/resources/messages/messages.d.ts.map +1 -1
- package/resources/messages/messages.js.map +1 -1
- package/resources/messages/messages.mjs.map +1 -1
- package/src/core/credentials.ts +5 -7
- package/src/core/middleware.ts +4 -3
- package/src/internal/errors.ts +3 -1
- package/src/internal/file-store.ts +11 -10
- package/src/internal/node.browser.ts +22 -0
- package/src/internal/node.ts +14 -0
- package/src/internal/parse.ts +1 -1
- package/src/internal/uploads.ts +10 -7
- package/src/lib/BetaMessageStream.ts +4 -0
- package/src/lib/credentials/credential-chain.ts +1 -1
- package/src/lib/credentials/identity-token.ts +1 -1
- package/src/lib/credentials/types.ts +2 -3
- package/src/lib/credentials/user-oauth.ts +1 -1
- package/src/lib/middleware.ts +33 -9
- package/src/lib/sessions/accumulate.ts +7 -47
- package/src/resources/beta/agents/agents.ts +1 -0
- package/src/resources/beta/beta.ts +28 -15
- package/src/resources/beta/deployment-runs.ts +6 -6
- package/src/resources/beta/deployments.ts +3 -2
- package/src/resources/beta/dreams.ts +42 -0
- package/src/resources/beta/files.ts +34 -11
- package/src/resources/beta/index.ts +12 -7
- package/src/resources/beta/memory-stores/memories.ts +6 -4
- package/src/resources/beta/messages/index.ts +5 -1
- package/src/resources/beta/messages/messages.ts +171 -30
- package/src/resources/beta/organization/compliance-settings.ts +96 -0
- package/src/resources/beta/organization/external-keys.ts +6 -3
- package/src/resources/beta/organization/index.ts +9 -0
- package/src/resources/beta/organization/organization.ts +24 -0
- package/src/resources/beta/organization/rate-limits.ts +2 -3
- package/src/resources/beta/organization/workspaces/rate-limits.ts +2 -3
- package/src/resources/beta/organization/workspaces/workspaces.ts +28 -12
- package/src/resources/beta/sessions/events.ts +1 -1
- package/src/resources/beta/sessions/sessions.ts +10 -10
- package/src/resources/beta/skills/index.ts +7 -10
- package/src/resources/beta/skills/skills.ts +60 -150
- package/src/resources/beta/skills/versions.ts +43 -166
- package/src/resources/beta/user-profiles.ts +24 -27
- package/src/resources/beta/webhooks.ts +25 -29
- package/src/resources/messages/messages.ts +2 -8
- package/src/tools/agent-toolset/fs-util.ts +6 -5
- package/src/tools/agent-toolset/memories.ts +5 -3
- package/src/tools/agent-toolset/node.browser.ts +0 -4
- package/src/tools/agent-toolset/node.ts +118 -13
- package/src/tools/agent-toolset/skills.ts +10 -43
- package/src/version.ts +1 -1
- package/tools/agent-toolset/fs-util.d.mts.map +1 -1
- package/tools/agent-toolset/fs-util.d.ts.map +1 -1
- package/tools/agent-toolset/fs-util.js +13 -15
- package/tools/agent-toolset/fs-util.js.map +1 -1
- package/tools/agent-toolset/fs-util.mjs +3 -4
- package/tools/agent-toolset/fs-util.mjs.map +1 -1
- package/tools/agent-toolset/memories.d.mts.map +1 -1
- package/tools/agent-toolset/memories.d.ts.map +1 -1
- package/tools/agent-toolset/memories.js +6 -4
- package/tools/agent-toolset/memories.js.map +1 -1
- package/tools/agent-toolset/memories.mjs +5 -3
- package/tools/agent-toolset/memories.mjs.map +1 -1
- package/tools/agent-toolset/node.browser.d.mts +0 -1
- package/tools/agent-toolset/node.browser.d.mts.map +1 -1
- package/tools/agent-toolset/node.browser.d.ts +0 -1
- package/tools/agent-toolset/node.browser.d.ts.map +1 -1
- package/tools/agent-toolset/node.browser.js +0 -4
- package/tools/agent-toolset/node.browser.js.map +1 -1
- package/tools/agent-toolset/node.browser.mjs +0 -3
- package/tools/agent-toolset/node.browser.mjs.map +1 -1
- package/tools/agent-toolset/node.d.mts +9 -7
- package/tools/agent-toolset/node.d.mts.map +1 -1
- package/tools/agent-toolset/node.d.ts +9 -7
- package/tools/agent-toolset/node.d.ts.map +1 -1
- package/tools/agent-toolset/node.js +96 -8
- package/tools/agent-toolset/node.js.map +1 -1
- package/tools/agent-toolset/node.mjs +96 -7
- package/tools/agent-toolset/node.mjs.map +1 -1
- package/tools/agent-toolset/skills.d.mts +0 -8
- package/tools/agent-toolset/skills.d.mts.map +1 -1
- package/tools/agent-toolset/skills.d.ts +0 -8
- package/tools/agent-toolset/skills.d.ts.map +1 -1
- package/tools/agent-toolset/skills.js +20 -46
- package/tools/agent-toolset/skills.js.map +1 -1
- package/tools/agent-toolset/skills.mjs +9 -33
- package/tools/agent-toolset/skills.mjs.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
|
@@ -16,17 +16,17 @@ export class Versions extends APIResource {
|
|
|
16
16
|
*
|
|
17
17
|
* @example
|
|
18
18
|
* ```ts
|
|
19
|
-
* const
|
|
20
|
-
* 'skill_id',
|
|
21
|
-
*
|
|
22
|
-
*
|
|
19
|
+
* const betaSkillVersion =
|
|
20
|
+
* await client.beta.skills.versions.create('skill_id', {
|
|
21
|
+
* files: [fs.createReadStream('path/to/file')],
|
|
22
|
+
* });
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
25
|
create(
|
|
26
26
|
skillID: string,
|
|
27
27
|
params: VersionCreateParams,
|
|
28
28
|
options?: RequestOptions,
|
|
29
|
-
): APIPromise<
|
|
29
|
+
): APIPromise<BetaSkillVersion> {
|
|
30
30
|
const { betas, ...body } = params;
|
|
31
31
|
return this._client.post(
|
|
32
32
|
path`/v1/skills/${skillID}/versions?beta=true`,
|
|
@@ -35,7 +35,7 @@ export class Versions extends APIResource {
|
|
|
35
35
|
body,
|
|
36
36
|
...options,
|
|
37
37
|
headers: buildHeaders([
|
|
38
|
-
{
|
|
38
|
+
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
39
39
|
options?.headers,
|
|
40
40
|
]),
|
|
41
41
|
},
|
|
@@ -50,22 +50,22 @@ export class Versions extends APIResource {
|
|
|
50
50
|
*
|
|
51
51
|
* @example
|
|
52
52
|
* ```ts
|
|
53
|
-
* const
|
|
54
|
-
* 'version',
|
|
55
|
-
*
|
|
56
|
-
*
|
|
53
|
+
* const betaSkillVersion =
|
|
54
|
+
* await client.beta.skills.versions.retrieve('version', {
|
|
55
|
+
* skill_id: 'skill_id',
|
|
56
|
+
* });
|
|
57
57
|
* ```
|
|
58
58
|
*/
|
|
59
59
|
retrieve(
|
|
60
60
|
version: string,
|
|
61
61
|
params: VersionRetrieveParams,
|
|
62
62
|
options?: RequestOptions,
|
|
63
|
-
): APIPromise<
|
|
63
|
+
): APIPromise<BetaSkillVersion> {
|
|
64
64
|
const { skill_id, betas } = params;
|
|
65
65
|
return this._client.get(path`/v1/skills/${skill_id}/versions/${version}?beta=true`, {
|
|
66
66
|
...options,
|
|
67
67
|
headers: buildHeaders([
|
|
68
|
-
{
|
|
68
|
+
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
69
69
|
options?.headers,
|
|
70
70
|
]),
|
|
71
71
|
});
|
|
@@ -77,7 +77,7 @@ export class Versions extends APIResource {
|
|
|
77
77
|
* @example
|
|
78
78
|
* ```ts
|
|
79
79
|
* // Automatically fetches more pages as needed.
|
|
80
|
-
* for await (const
|
|
80
|
+
* for await (const betaSkillVersion of client.beta.skills.versions.list(
|
|
81
81
|
* 'skill_id',
|
|
82
82
|
* )) {
|
|
83
83
|
* // ...
|
|
@@ -88,16 +88,16 @@ export class Versions extends APIResource {
|
|
|
88
88
|
skillID: string,
|
|
89
89
|
params: VersionListParams | null | undefined = {},
|
|
90
90
|
options?: RequestOptions,
|
|
91
|
-
): PagePromise<
|
|
91
|
+
): PagePromise<BetaSkillVersionsPageCursor, BetaSkillVersion> {
|
|
92
92
|
const { betas, ...query } = params ?? {};
|
|
93
93
|
return this._client.getAPIList(
|
|
94
94
|
path`/v1/skills/${skillID}/versions?beta=true`,
|
|
95
|
-
PageCursor<
|
|
95
|
+
PageCursor<BetaSkillVersion>,
|
|
96
96
|
{
|
|
97
97
|
query,
|
|
98
98
|
...options,
|
|
99
99
|
headers: buildHeaders([
|
|
100
|
-
{
|
|
100
|
+
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
101
101
|
options?.headers,
|
|
102
102
|
]),
|
|
103
103
|
},
|
|
@@ -109,22 +109,22 @@ export class Versions extends APIResource {
|
|
|
109
109
|
*
|
|
110
110
|
* @example
|
|
111
111
|
* ```ts
|
|
112
|
-
* const
|
|
113
|
-
* 'version',
|
|
114
|
-
*
|
|
115
|
-
*
|
|
112
|
+
* const betaDeletedSkillVersion =
|
|
113
|
+
* await client.beta.skills.versions.delete('version', {
|
|
114
|
+
* skill_id: 'skill_id',
|
|
115
|
+
* });
|
|
116
116
|
* ```
|
|
117
117
|
*/
|
|
118
118
|
delete(
|
|
119
119
|
version: string,
|
|
120
120
|
params: VersionDeleteParams,
|
|
121
121
|
options?: RequestOptions,
|
|
122
|
-
): APIPromise<
|
|
122
|
+
): APIPromise<BetaDeletedSkillVersion> {
|
|
123
123
|
const { skill_id, betas } = params;
|
|
124
124
|
return this._client.delete(path`/v1/skills/${skill_id}/versions/${version}?beta=true`, {
|
|
125
125
|
...options,
|
|
126
126
|
headers: buildHeaders([
|
|
127
|
-
{
|
|
127
|
+
{ ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined) },
|
|
128
128
|
options?.headers,
|
|
129
129
|
]),
|
|
130
130
|
});
|
|
@@ -150,8 +150,8 @@ export class Versions extends APIResource {
|
|
|
150
150
|
...options,
|
|
151
151
|
headers: buildHeaders([
|
|
152
152
|
{
|
|
153
|
-
'anthropic-beta': [...(betas ?? []), 'skills-2025-10-02'].toString(),
|
|
154
153
|
Accept: 'application/binary',
|
|
154
|
+
...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined),
|
|
155
155
|
},
|
|
156
156
|
options?.headers,
|
|
157
157
|
]),
|
|
@@ -160,72 +160,32 @@ export class Versions extends APIResource {
|
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
export type
|
|
163
|
+
export type BetaSkillVersionsPageCursor = PageCursor<BetaSkillVersion>;
|
|
164
164
|
|
|
165
|
-
export interface
|
|
165
|
+
export interface BetaDeletedSkillVersion {
|
|
166
166
|
/**
|
|
167
|
-
* Unique identifier for the
|
|
168
|
-
*
|
|
169
|
-
* The format and length of IDs may change over time.
|
|
167
|
+
* Unique identifier for this Skill Version. The id addresses the version in paths
|
|
168
|
+
* and pins it in references.
|
|
170
169
|
*/
|
|
171
170
|
id: string;
|
|
172
171
|
|
|
173
172
|
/**
|
|
174
|
-
*
|
|
175
|
-
*/
|
|
176
|
-
created_at: string;
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* Description of the skill version.
|
|
180
|
-
*
|
|
181
|
-
* This is extracted from the SKILL.md file in the skill upload.
|
|
182
|
-
*/
|
|
183
|
-
description: string;
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* Directory name of the skill version.
|
|
187
|
-
*
|
|
188
|
-
* This is the top-level directory name that was extracted from the uploaded files.
|
|
189
|
-
*/
|
|
190
|
-
directory: string;
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* Human-readable name of the skill version.
|
|
194
|
-
*
|
|
195
|
-
* This is extracted from the SKILL.md file in the skill upload.
|
|
196
|
-
*/
|
|
197
|
-
name: string;
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* Identifier for the skill that this version belongs to.
|
|
201
|
-
*/
|
|
202
|
-
skill_id: string;
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Object type.
|
|
206
|
-
*
|
|
207
|
-
* For Skill Versions, this is always `"skill_version"`.
|
|
208
|
-
*/
|
|
209
|
-
type: string;
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* Version identifier for the skill.
|
|
173
|
+
* Deleted object type.
|
|
213
174
|
*
|
|
214
|
-
*
|
|
175
|
+
* For Skill Versions, this is always `"skill_version_deleted"`.
|
|
215
176
|
*/
|
|
216
|
-
|
|
177
|
+
type: 'skill_version_deleted';
|
|
217
178
|
}
|
|
218
179
|
|
|
219
|
-
export interface
|
|
180
|
+
export interface BetaSkillVersion {
|
|
220
181
|
/**
|
|
221
|
-
* Unique identifier for the
|
|
222
|
-
*
|
|
223
|
-
* The format and length of IDs may change over time.
|
|
182
|
+
* Unique identifier for this Skill Version. The id addresses the version in paths
|
|
183
|
+
* and pins it in references.
|
|
224
184
|
*/
|
|
225
185
|
id: string;
|
|
226
186
|
|
|
227
187
|
/**
|
|
228
|
-
* ISO 8601 timestamp of when the skill
|
|
188
|
+
* ISO 8601 timestamp of when the skill was created.
|
|
229
189
|
*/
|
|
230
190
|
created_at: string;
|
|
231
191
|
|
|
@@ -237,76 +197,18 @@ export interface VersionRetrieveResponse {
|
|
|
237
197
|
description: string;
|
|
238
198
|
|
|
239
199
|
/**
|
|
240
|
-
*
|
|
241
|
-
*
|
|
242
|
-
*
|
|
243
|
-
|
|
244
|
-
directory: string;
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* Human-readable name of the skill version.
|
|
248
|
-
*
|
|
249
|
-
* This is extracted from the SKILL.md file in the skill upload.
|
|
200
|
+
* The Skill's immutable kebab-case slug, set at creation from the first upload's
|
|
201
|
+
* SKILL.md frontmatter `name` (or its enclosing directory). Every later upload
|
|
202
|
+
* must resolve to the same value. Also the top-level directory of the Skill's
|
|
203
|
+
* mounted files and the base name of a downloaded archive.
|
|
250
204
|
*/
|
|
251
205
|
name: string;
|
|
252
206
|
|
|
253
207
|
/**
|
|
254
|
-
*
|
|
255
|
-
*/
|
|
256
|
-
skill_id: string;
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* Object type.
|
|
260
|
-
*
|
|
261
|
-
* For Skill Versions, this is always `"skill_version"`.
|
|
262
|
-
*/
|
|
263
|
-
type: string;
|
|
264
|
-
|
|
265
|
-
/**
|
|
266
|
-
* Version identifier for the skill.
|
|
267
|
-
*
|
|
268
|
-
* Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
|
|
269
|
-
*/
|
|
270
|
-
version: string;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
export interface VersionListResponse {
|
|
274
|
-
/**
|
|
275
|
-
* Unique identifier for the skill version.
|
|
208
|
+
* Unique identifier for the skill.
|
|
276
209
|
*
|
|
277
210
|
* The format and length of IDs may change over time.
|
|
278
211
|
*/
|
|
279
|
-
id: string;
|
|
280
|
-
|
|
281
|
-
/**
|
|
282
|
-
* ISO 8601 timestamp of when the skill version was created.
|
|
283
|
-
*/
|
|
284
|
-
created_at: string;
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* Description of the skill version.
|
|
288
|
-
*
|
|
289
|
-
* This is extracted from the SKILL.md file in the skill upload.
|
|
290
|
-
*/
|
|
291
|
-
description: string;
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* Directory name of the skill version.
|
|
295
|
-
*
|
|
296
|
-
* This is the top-level directory name that was extracted from the uploaded files.
|
|
297
|
-
*/
|
|
298
|
-
directory: string;
|
|
299
|
-
|
|
300
|
-
/**
|
|
301
|
-
* Human-readable name of the skill version.
|
|
302
|
-
*
|
|
303
|
-
* This is extracted from the SKILL.md file in the skill upload.
|
|
304
|
-
*/
|
|
305
|
-
name: string;
|
|
306
|
-
|
|
307
|
-
/**
|
|
308
|
-
* Identifier for the skill that this version belongs to.
|
|
309
|
-
*/
|
|
310
212
|
skill_id: string;
|
|
311
213
|
|
|
312
214
|
/**
|
|
@@ -314,30 +216,7 @@ export interface VersionListResponse {
|
|
|
314
216
|
*
|
|
315
217
|
* For Skill Versions, this is always `"skill_version"`.
|
|
316
218
|
*/
|
|
317
|
-
type:
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* Version identifier for the skill.
|
|
321
|
-
*
|
|
322
|
-
* Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
|
|
323
|
-
*/
|
|
324
|
-
version: string;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
export interface VersionDeleteResponse {
|
|
328
|
-
/**
|
|
329
|
-
* Version identifier for the skill.
|
|
330
|
-
*
|
|
331
|
-
* Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
|
|
332
|
-
*/
|
|
333
|
-
id: string;
|
|
334
|
-
|
|
335
|
-
/**
|
|
336
|
-
* Deleted object type.
|
|
337
|
-
*
|
|
338
|
-
* For Skill Versions, this is always `"skill_version_deleted"`.
|
|
339
|
-
*/
|
|
340
|
-
type: string;
|
|
219
|
+
type: 'skill_version';
|
|
341
220
|
}
|
|
342
221
|
|
|
343
222
|
export interface VersionCreateParams {
|
|
@@ -406,11 +285,9 @@ export interface VersionDownloadParams {
|
|
|
406
285
|
|
|
407
286
|
export declare namespace Versions {
|
|
408
287
|
export {
|
|
409
|
-
type
|
|
410
|
-
type
|
|
411
|
-
type
|
|
412
|
-
type VersionDeleteResponse as VersionDeleteResponse,
|
|
413
|
-
type VersionListResponsesPageCursor as VersionListResponsesPageCursor,
|
|
288
|
+
type BetaDeletedSkillVersion as BetaDeletedSkillVersion,
|
|
289
|
+
type BetaSkillVersion as BetaSkillVersion,
|
|
290
|
+
type BetaSkillVersionsPageCursor as BetaSkillVersionsPageCursor,
|
|
414
291
|
type VersionCreateParams as VersionCreateParams,
|
|
415
292
|
type VersionRetrieveParams as VersionRetrieveParams,
|
|
416
293
|
type VersionListParams as VersionListParams,
|
|
@@ -186,18 +186,16 @@ export interface BetaUserProfile {
|
|
|
186
186
|
external_id?: string | null;
|
|
187
187
|
|
|
188
188
|
/**
|
|
189
|
-
*
|
|
190
|
-
* For a resold-to company (`access_type` `passthrough`, or `relationship` `resold`
|
|
191
|
-
* under the `user-profiles-2026-03-24` header) this is that company's name.
|
|
189
|
+
* A timestamp in RFC 3339 format
|
|
192
190
|
*/
|
|
193
|
-
|
|
191
|
+
external_user_onboarded_at?: string | null;
|
|
194
192
|
|
|
195
193
|
/**
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
194
|
+
* Real-world name of the entity this profile represents (company or individual).
|
|
195
|
+
* For a company the platform resells Claude access to (`access_type`
|
|
196
|
+
* `passthrough`) this is that company's name.
|
|
199
197
|
*/
|
|
200
|
-
|
|
198
|
+
name?: string | null;
|
|
201
199
|
}
|
|
202
200
|
|
|
203
201
|
export interface BetaUserProfileEnrollmentURL {
|
|
@@ -240,6 +238,11 @@ export interface UserProfileCreateParams {
|
|
|
240
238
|
*/
|
|
241
239
|
external_id?: string | null;
|
|
242
240
|
|
|
241
|
+
/**
|
|
242
|
+
* Body param: A timestamp in RFC 3339 format
|
|
243
|
+
*/
|
|
244
|
+
external_user_onboarded_at?: string;
|
|
245
|
+
|
|
243
246
|
/**
|
|
244
247
|
* Body param: Free-form key-value data to attach to this user profile. Maximum 16
|
|
245
248
|
* keys, with keys up to 64 characters and values up to 512 characters. Values must
|
|
@@ -249,20 +252,12 @@ export interface UserProfileCreateParams {
|
|
|
249
252
|
|
|
250
253
|
/**
|
|
251
254
|
* Body param: Optional for all profiles. Real-world name of the entity this
|
|
252
|
-
* profile represents (company or individual); for a
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
+
* profile represents (company or individual); for a company the platform resells
|
|
256
|
+
* Claude access to (`access_type` `passthrough`), that company's name where known.
|
|
257
|
+
* Maximum 255 characters.
|
|
255
258
|
*/
|
|
256
259
|
name?: string | null;
|
|
257
260
|
|
|
258
|
-
/**
|
|
259
|
-
* Body param: How the entity behind a user profile relates to the platform that
|
|
260
|
-
* owns the API key. `external`: an individual end-user of the platform. `resold`:
|
|
261
|
-
* a company the platform resells Claude access to. `internal`: the platform's own
|
|
262
|
-
* usage.
|
|
263
|
-
*/
|
|
264
|
-
relationship?: 'external' | 'resold' | 'internal';
|
|
265
|
-
|
|
266
261
|
/**
|
|
267
262
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
268
263
|
*/
|
|
@@ -292,6 +287,11 @@ export interface UserProfileUpdateParams {
|
|
|
292
287
|
*/
|
|
293
288
|
external_id?: string | null;
|
|
294
289
|
|
|
290
|
+
/**
|
|
291
|
+
* Body param: A timestamp in RFC 3339 format
|
|
292
|
+
*/
|
|
293
|
+
external_user_onboarded_at?: string;
|
|
294
|
+
|
|
295
295
|
/**
|
|
296
296
|
* Body param: Key-value pairs to merge into the stored metadata. Keys provided
|
|
297
297
|
* overwrite existing values. To remove a key, set its value to an empty string.
|
|
@@ -306,14 +306,6 @@ export interface UserProfileUpdateParams {
|
|
|
306
306
|
*/
|
|
307
307
|
name?: string | null;
|
|
308
308
|
|
|
309
|
-
/**
|
|
310
|
-
* Body param: How the entity behind a user profile relates to the platform that
|
|
311
|
-
* owns the API key. `external`: an individual end-user of the platform. `resold`:
|
|
312
|
-
* a company the platform resells Claude access to. `internal`: the platform's own
|
|
313
|
-
* usage.
|
|
314
|
-
*/
|
|
315
|
-
relationship?: 'external' | 'resold' | 'internal' | null;
|
|
316
|
-
|
|
317
309
|
/**
|
|
318
310
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
319
311
|
*/
|
|
@@ -326,6 +318,11 @@ export interface UserProfileListParams extends PageCursorParams {
|
|
|
326
318
|
*/
|
|
327
319
|
order?: 'asc' | 'desc';
|
|
328
320
|
|
|
321
|
+
/**
|
|
322
|
+
* Query param: Query parameter for order_by
|
|
323
|
+
*/
|
|
324
|
+
order_by?: 'created_at' | 'name';
|
|
325
|
+
|
|
329
326
|
/**
|
|
330
327
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
331
328
|
*/
|
|
@@ -4,17 +4,27 @@ import { APIResource } from '../../core/resource';
|
|
|
4
4
|
import { Webhook } from 'standardwebhooks';
|
|
5
5
|
|
|
6
6
|
export class Webhooks extends APIResource {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Parses a webhook payload into an event without verifying its signature. Prefer
|
|
9
|
+
* `unwrap()` unless you have already verified the signature yourself.
|
|
10
|
+
*/
|
|
11
|
+
parseUnverified(body: string): BetaWebhookEvent {
|
|
12
|
+
return JSON.parse(body) as BetaWebhookEvent;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Verifies the webhook signature from the `webhook-id`, `webhook-timestamp` and
|
|
17
|
+
* `webhook-signature` headers using your webhook signing key, then parses the
|
|
18
|
+
* payload into an event. Fails if the signature is missing or invalid.
|
|
19
|
+
*/
|
|
20
|
+
unwrap(body: string, options: { headers: Record<string, string>; key?: string }): BetaWebhookEvent {
|
|
21
|
+
const headers = options?.headers;
|
|
22
|
+
if (headers == null) throw new Error('Webhook headers are required in order to verify the signature');
|
|
23
|
+
const keyStr: string | null = options.key === undefined ? this._client.webhookKey : options.key;
|
|
24
|
+
if (!keyStr) throw new Error('Webhook key must not be null or empty in order to unwrap');
|
|
25
|
+
const wh = new Webhook(keyStr);
|
|
26
|
+
wh.verify(body, headers);
|
|
27
|
+
return JSON.parse(body) as BetaWebhookEvent;
|
|
18
28
|
}
|
|
19
29
|
}
|
|
20
30
|
|
|
@@ -690,24 +700,10 @@ export interface BetaWebhookVaultDeletedEventData {
|
|
|
690
700
|
workspace_id: string;
|
|
691
701
|
}
|
|
692
702
|
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
id: string;
|
|
698
|
-
|
|
699
|
-
/**
|
|
700
|
-
* RFC 3339 timestamp when the event occurred.
|
|
701
|
-
*/
|
|
702
|
-
created_at: string;
|
|
703
|
-
|
|
704
|
-
data: BetaWebhookEventData;
|
|
705
|
-
|
|
706
|
-
/**
|
|
707
|
-
* Object type. Always `event` for webhook payloads.
|
|
708
|
-
*/
|
|
709
|
-
type: 'event';
|
|
710
|
-
}
|
|
703
|
+
/**
|
|
704
|
+
* @deprecated UnwrapWebhookEvent has been renamed to BetaWebhookEvent
|
|
705
|
+
*/
|
|
706
|
+
export type UnwrapWebhookEvent = BetaWebhookEvent;
|
|
711
707
|
|
|
712
708
|
export declare namespace Webhooks {
|
|
713
709
|
export {
|
|
@@ -949,10 +949,6 @@ export interface BrowserSwitchTabConfig {
|
|
|
949
949
|
export interface BrowserToolset20260801 {
|
|
950
950
|
type: 'browser_toolset_20260801';
|
|
951
951
|
|
|
952
|
-
allowed_callers?: Array<
|
|
953
|
-
'direct' | 'code_execution_20250825' | 'code_execution_20260120' | 'code_execution_20260521'
|
|
954
|
-
>;
|
|
955
|
-
|
|
956
952
|
/**
|
|
957
953
|
* Create a cache control breakpoint at this content block.
|
|
958
954
|
*/
|
|
@@ -1960,10 +1956,6 @@ export interface ComputerScrollConfig {
|
|
|
1960
1956
|
export interface ComputerToolset20260801 {
|
|
1961
1957
|
type: 'computer_toolset_20260801';
|
|
1962
1958
|
|
|
1963
|
-
allowed_callers?: Array<
|
|
1964
|
-
'direct' | 'code_execution_20250825' | 'code_execution_20260120' | 'code_execution_20260521'
|
|
1965
|
-
>;
|
|
1966
|
-
|
|
1967
1959
|
/**
|
|
1968
1960
|
* Create a cache control breakpoint at this content block.
|
|
1969
1961
|
*/
|
|
@@ -2664,6 +2656,8 @@ export interface Metadata {
|
|
|
2664
2656
|
* details and options.
|
|
2665
2657
|
*/
|
|
2666
2658
|
export type Model =
|
|
2659
|
+
| 'claude-fable-5-1'
|
|
2660
|
+
| 'claude-mythos-5-1'
|
|
2667
2661
|
| 'claude-sonnet-5'
|
|
2668
2662
|
| 'claude-fable-5'
|
|
2669
2663
|
| 'claude-mythos-5'
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
* and these helpers can be reused by every file tool.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { randomUUID } from 'node:crypto';
|
|
8
|
+
import type { FileHandle } from 'node:fs/promises';
|
|
9
|
+
import { crypto, fs as nodefs, path } from '../../internal/node';
|
|
11
10
|
import { ToolError } from '../../lib/tools/ToolError';
|
|
12
11
|
|
|
12
|
+
const fs = nodefs.promises;
|
|
13
|
+
|
|
13
14
|
/** Mode for directories the file tools create — not world-writable under a 0 umask. */
|
|
14
15
|
export const DIR_CREATE_MODE = 0o755;
|
|
15
16
|
/** Mode for files the file tools create. */
|
|
@@ -140,8 +141,8 @@ export async function confineToRoot(
|
|
|
140
141
|
*/
|
|
141
142
|
export async function atomicWriteFile(targetPath: string, content: string): Promise<void> {
|
|
142
143
|
const dir = path.dirname(targetPath);
|
|
143
|
-
const tempPath = path.join(dir, `.tmp-${process.pid}-${randomUUID()}`);
|
|
144
|
-
let handle:
|
|
144
|
+
const tempPath = path.join(dir, `.tmp-${process.pid}-${crypto.randomUUID()}`);
|
|
145
|
+
let handle: FileHandle | undefined;
|
|
145
146
|
try {
|
|
146
147
|
handle = await fs.open(tempPath, 'wx', FILE_CREATE_MODE);
|
|
147
148
|
await handle.writeFile(content, 'utf-8');
|
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
* it is reachable through the shimmed `node.ts` entry point.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import
|
|
14
|
-
import { createHash } from 'node:crypto';
|
|
13
|
+
import { crypto, path } from '../../internal/node';
|
|
15
14
|
import type { Anthropic } from '../../client';
|
|
16
15
|
import { AnthropicError } from '../../core/error';
|
|
17
16
|
import { loggerFor, type Logger } from '../../internal/utils/log';
|
|
@@ -51,7 +50,10 @@ export const MARKER_PATH = '.anthropic-memory-store';
|
|
|
51
50
|
const MARKER_VERSION = 1;
|
|
52
51
|
|
|
53
52
|
function markerSha(memoryStoreId: string): string {
|
|
54
|
-
return
|
|
53
|
+
return crypto
|
|
54
|
+
.createHash('sha256')
|
|
55
|
+
.update(`version ${MARKER_VERSION}\n${memoryStoreId}`, 'utf-8')
|
|
56
|
+
.digest('hex');
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
/** How long a file must stay missing locally before its server delete goes out. */
|
|
@@ -96,10 +96,6 @@ export function setupSkills(_ctx: AgentToolContext): Promise<() => Promise<void>
|
|
|
96
96
|
return nodeOnly('setupSkills');
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
export function resolveSkillVersion(_client: Anthropic, _skillId: string, _version: string): Promise<string> {
|
|
100
|
-
return nodeOnly('resolveSkillVersion');
|
|
101
|
-
}
|
|
102
|
-
|
|
103
99
|
export function extractSkillArchive(_resp: Response, _dest: string): Promise<void> {
|
|
104
100
|
return nodeOnly('extractSkillArchive');
|
|
105
101
|
}
|