@anthropic-ai/sdk 0.123.0 → 0.124.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 +28 -0
- package/client.d.mts +6 -5
- package/client.d.mts.map +1 -1
- package/client.d.ts +6 -5
- package/client.d.ts.map +1 -1
- package/client.js +2 -1
- package/client.js.map +1 -1
- package/client.mjs +2 -1
- package/client.mjs.map +1 -1
- package/core/streaming.js +4 -2
- package/core/streaming.js.map +1 -1
- package/core/streaming.mjs +4 -2
- package/core/streaming.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/beta/agents/agents.d.mts +45 -0
- package/resources/beta/agents/agents.d.mts.map +1 -1
- package/resources/beta/agents/agents.d.ts +45 -0
- package/resources/beta/agents/agents.d.ts.map +1 -1
- package/resources/beta/agents/agents.js +25 -10
- package/resources/beta/agents/agents.js.map +1 -1
- package/resources/beta/agents/agents.mjs +25 -10
- package/resources/beta/agents/agents.mjs.map +1 -1
- package/resources/beta/agents/versions.d.mts +9 -0
- package/resources/beta/agents/versions.d.mts.map +1 -1
- package/resources/beta/agents/versions.d.ts +9 -0
- package/resources/beta/agents/versions.d.ts.map +1 -1
- package/resources/beta/agents/versions.js +5 -2
- package/resources/beta/agents/versions.js.map +1 -1
- package/resources/beta/agents/versions.mjs +5 -2
- package/resources/beta/agents/versions.mjs.map +1 -1
- package/resources/beta/deployment-runs.d.mts +18 -0
- package/resources/beta/deployment-runs.d.mts.map +1 -1
- package/resources/beta/deployment-runs.d.ts +18 -0
- package/resources/beta/deployment-runs.d.ts.map +1 -1
- package/resources/beta/deployment-runs.js +10 -4
- package/resources/beta/deployment-runs.js.map +1 -1
- package/resources/beta/deployment-runs.mjs +10 -4
- package/resources/beta/deployment-runs.mjs.map +1 -1
- package/resources/beta/deployments.d.mts +72 -0
- package/resources/beta/deployments.d.mts.map +1 -1
- package/resources/beta/deployments.d.ts +72 -0
- package/resources/beta/deployments.d.ts.map +1 -1
- package/resources/beta/deployments.js +40 -16
- package/resources/beta/deployments.js.map +1 -1
- package/resources/beta/deployments.mjs +40 -16
- package/resources/beta/deployments.mjs.map +1 -1
- package/resources/beta/dreams.d.mts +45 -0
- package/resources/beta/dreams.d.mts.map +1 -1
- package/resources/beta/dreams.d.ts +45 -0
- package/resources/beta/dreams.d.ts.map +1 -1
- package/resources/beta/dreams.js +25 -10
- package/resources/beta/dreams.js.map +1 -1
- package/resources/beta/dreams.mjs +25 -10
- package/resources/beta/dreams.mjs.map +1 -1
- package/resources/beta/environments/environments.d.mts +54 -0
- package/resources/beta/environments/environments.d.mts.map +1 -1
- package/resources/beta/environments/environments.d.ts +54 -0
- package/resources/beta/environments/environments.d.ts.map +1 -1
- package/resources/beta/environments/environments.js +30 -12
- package/resources/beta/environments/environments.js.map +1 -1
- package/resources/beta/environments/environments.mjs +30 -12
- package/resources/beta/environments/environments.mjs.map +1 -1
- package/resources/beta/environments/work.d.mts +36 -0
- package/resources/beta/environments/work.d.mts.map +1 -1
- package/resources/beta/environments/work.d.ts +36 -0
- package/resources/beta/environments/work.d.ts.map +1 -1
- package/resources/beta/environments/work.js +20 -8
- package/resources/beta/environments/work.js.map +1 -1
- package/resources/beta/environments/work.mjs +20 -8
- package/resources/beta/environments/work.mjs.map +1 -1
- package/resources/beta/files.d.mts +48 -1
- package/resources/beta/files.d.mts.map +1 -1
- package/resources/beta/files.d.ts +48 -1
- package/resources/beta/files.d.ts.map +1 -1
- package/resources/beta/files.js +22 -9
- package/resources/beta/files.js.map +1 -1
- package/resources/beta/files.mjs +22 -9
- package/resources/beta/files.mjs.map +1 -1
- package/resources/beta/memory-stores/memories.d.mts +45 -0
- package/resources/beta/memory-stores/memories.d.mts.map +1 -1
- package/resources/beta/memory-stores/memories.d.ts +45 -0
- package/resources/beta/memory-stores/memories.d.ts.map +1 -1
- package/resources/beta/memory-stores/memories.js +25 -10
- package/resources/beta/memory-stores/memories.js.map +1 -1
- package/resources/beta/memory-stores/memories.mjs +25 -10
- package/resources/beta/memory-stores/memories.mjs.map +1 -1
- package/resources/beta/memory-stores/memory-stores.d.mts +54 -0
- package/resources/beta/memory-stores/memory-stores.d.mts.map +1 -1
- package/resources/beta/memory-stores/memory-stores.d.ts +54 -0
- package/resources/beta/memory-stores/memory-stores.d.ts.map +1 -1
- package/resources/beta/memory-stores/memory-stores.js +30 -12
- package/resources/beta/memory-stores/memory-stores.js.map +1 -1
- package/resources/beta/memory-stores/memory-stores.mjs +30 -12
- package/resources/beta/memory-stores/memory-stores.mjs.map +1 -1
- package/resources/beta/memory-stores/memory-versions.d.mts +31 -4
- package/resources/beta/memory-stores/memory-versions.d.mts.map +1 -1
- package/resources/beta/memory-stores/memory-versions.d.ts +31 -4
- package/resources/beta/memory-stores/memory-versions.d.ts.map +1 -1
- package/resources/beta/memory-stores/memory-versions.js +15 -6
- package/resources/beta/memory-stores/memory-versions.js.map +1 -1
- package/resources/beta/memory-stores/memory-versions.mjs +15 -6
- package/resources/beta/memory-stores/memory-versions.mjs.map +1 -1
- package/resources/beta/messages/batches.d.mts +54 -0
- package/resources/beta/messages/batches.d.mts.map +1 -1
- package/resources/beta/messages/batches.d.ts +54 -0
- package/resources/beta/messages/batches.d.ts.map +1 -1
- package/resources/beta/messages/batches.js +25 -11
- package/resources/beta/messages/batches.js.map +1 -1
- package/resources/beta/messages/batches.mjs +25 -11
- package/resources/beta/messages/batches.mjs.map +1 -1
- package/resources/beta/messages/messages.d.mts +18 -0
- package/resources/beta/messages/messages.d.mts.map +1 -1
- package/resources/beta/messages/messages.d.ts +18 -0
- package/resources/beta/messages/messages.d.ts.map +1 -1
- package/resources/beta/messages/messages.js +4 -2
- package/resources/beta/messages/messages.js.map +1 -1
- package/resources/beta/messages/messages.mjs +4 -2
- package/resources/beta/messages/messages.mjs.map +1 -1
- package/resources/beta/models.d.mts +18 -0
- package/resources/beta/models.d.mts.map +1 -1
- package/resources/beta/models.d.ts +18 -0
- package/resources/beta/models.d.ts.map +1 -1
- package/resources/beta/models.js +10 -4
- package/resources/beta/models.js.map +1 -1
- package/resources/beta/models.mjs +10 -4
- package/resources/beta/models.mjs.map +1 -1
- package/resources/beta/organization/compliance-settings.d.mts +5 -3
- package/resources/beta/organization/compliance-settings.d.mts.map +1 -1
- package/resources/beta/organization/compliance-settings.d.ts +5 -3
- package/resources/beta/organization/compliance-settings.d.ts.map +1 -1
- package/resources/beta/organization/index.d.mts +1 -1
- package/resources/beta/organization/index.d.mts.map +1 -1
- package/resources/beta/organization/index.d.ts +1 -1
- package/resources/beta/organization/index.d.ts.map +1 -1
- package/resources/beta/organization/index.js.map +1 -1
- package/resources/beta/organization/index.mjs.map +1 -1
- package/resources/beta/organization/organization.d.mts +2 -2
- package/resources/beta/organization/organization.d.mts.map +1 -1
- package/resources/beta/organization/organization.d.ts +2 -2
- package/resources/beta/organization/organization.d.ts.map +1 -1
- package/resources/beta/organization/organization.js.map +1 -1
- package/resources/beta/organization/organization.mjs.map +1 -1
- package/resources/beta/sessions/events.d.mts +27 -0
- package/resources/beta/sessions/events.d.mts.map +1 -1
- package/resources/beta/sessions/events.d.ts +27 -0
- package/resources/beta/sessions/events.d.ts.map +1 -1
- package/resources/beta/sessions/events.js +15 -6
- package/resources/beta/sessions/events.js.map +1 -1
- package/resources/beta/sessions/events.mjs +15 -6
- package/resources/beta/sessions/events.mjs.map +1 -1
- package/resources/beta/sessions/resources.d.mts +45 -0
- package/resources/beta/sessions/resources.d.mts.map +1 -1
- package/resources/beta/sessions/resources.d.ts +45 -0
- package/resources/beta/sessions/resources.d.ts.map +1 -1
- package/resources/beta/sessions/resources.js +25 -10
- package/resources/beta/sessions/resources.js.map +1 -1
- package/resources/beta/sessions/resources.mjs +25 -10
- package/resources/beta/sessions/resources.mjs.map +1 -1
- package/resources/beta/sessions/sessions.d.mts +54 -0
- package/resources/beta/sessions/sessions.d.mts.map +1 -1
- package/resources/beta/sessions/sessions.d.ts +54 -0
- package/resources/beta/sessions/sessions.d.ts.map +1 -1
- package/resources/beta/sessions/sessions.js +30 -12
- package/resources/beta/sessions/sessions.js.map +1 -1
- package/resources/beta/sessions/sessions.mjs +30 -12
- package/resources/beta/sessions/sessions.mjs.map +1 -1
- package/resources/beta/sessions/threads/events.d.mts +18 -0
- package/resources/beta/sessions/threads/events.d.mts.map +1 -1
- package/resources/beta/sessions/threads/events.d.ts +18 -0
- package/resources/beta/sessions/threads/events.d.ts.map +1 -1
- package/resources/beta/sessions/threads/events.js +10 -4
- package/resources/beta/sessions/threads/events.js.map +1 -1
- package/resources/beta/sessions/threads/events.mjs +10 -4
- package/resources/beta/sessions/threads/events.mjs.map +1 -1
- package/resources/beta/sessions/threads/threads.d.mts +27 -0
- package/resources/beta/sessions/threads/threads.d.mts.map +1 -1
- package/resources/beta/sessions/threads/threads.d.ts +27 -0
- package/resources/beta/sessions/threads/threads.d.ts.map +1 -1
- package/resources/beta/sessions/threads/threads.js +15 -6
- package/resources/beta/sessions/threads/threads.js.map +1 -1
- package/resources/beta/sessions/threads/threads.mjs +15 -6
- package/resources/beta/sessions/threads/threads.mjs.map +1 -1
- package/resources/beta/skills/skills.d.mts +36 -0
- package/resources/beta/skills/skills.d.mts.map +1 -1
- package/resources/beta/skills/skills.d.ts +36 -0
- package/resources/beta/skills/skills.d.ts.map +1 -1
- package/resources/beta/skills/skills.js +20 -8
- package/resources/beta/skills/skills.js.map +1 -1
- package/resources/beta/skills/skills.mjs +20 -8
- package/resources/beta/skills/skills.mjs.map +1 -1
- package/resources/beta/skills/versions.d.mts +45 -0
- package/resources/beta/skills/versions.d.mts.map +1 -1
- package/resources/beta/skills/versions.d.ts +45 -0
- package/resources/beta/skills/versions.d.ts.map +1 -1
- package/resources/beta/skills/versions.js +22 -9
- package/resources/beta/skills/versions.js.map +1 -1
- package/resources/beta/skills/versions.mjs +22 -9
- package/resources/beta/skills/versions.mjs.map +1 -1
- package/resources/beta/tunnels/certificates.d.mts +36 -0
- package/resources/beta/tunnels/certificates.d.mts.map +1 -1
- package/resources/beta/tunnels/certificates.d.ts +36 -0
- package/resources/beta/tunnels/certificates.d.ts.map +1 -1
- package/resources/beta/tunnels/certificates.js +20 -8
- package/resources/beta/tunnels/certificates.js.map +1 -1
- package/resources/beta/tunnels/certificates.mjs +20 -8
- package/resources/beta/tunnels/certificates.mjs.map +1 -1
- package/resources/beta/tunnels/tunnels.d.mts +54 -0
- package/resources/beta/tunnels/tunnels.d.mts.map +1 -1
- package/resources/beta/tunnels/tunnels.d.ts +54 -0
- package/resources/beta/tunnels/tunnels.d.ts.map +1 -1
- package/resources/beta/tunnels/tunnels.js +30 -12
- package/resources/beta/tunnels/tunnels.js.map +1 -1
- package/resources/beta/tunnels/tunnels.mjs +30 -12
- package/resources/beta/tunnels/tunnels.mjs.map +1 -1
- package/resources/beta/vaults/credentials.d.mts +63 -0
- package/resources/beta/vaults/credentials.d.mts.map +1 -1
- package/resources/beta/vaults/credentials.d.ts +63 -0
- package/resources/beta/vaults/credentials.d.ts.map +1 -1
- package/resources/beta/vaults/credentials.js +35 -14
- package/resources/beta/vaults/credentials.js.map +1 -1
- package/resources/beta/vaults/credentials.mjs +35 -14
- package/resources/beta/vaults/credentials.mjs.map +1 -1
- package/resources/beta/vaults/vaults.d.mts +54 -0
- package/resources/beta/vaults/vaults.d.mts.map +1 -1
- package/resources/beta/vaults/vaults.d.ts +54 -0
- package/resources/beta/vaults/vaults.d.ts.map +1 -1
- package/resources/beta/vaults/vaults.js +30 -12
- package/resources/beta/vaults/vaults.js.map +1 -1
- package/resources/beta/vaults/vaults.mjs +30 -12
- package/resources/beta/vaults/vaults.mjs.map +1 -1
- package/resources/completions.d.mts +9 -0
- package/resources/completions.d.mts.map +1 -1
- package/resources/completions.d.ts +9 -0
- package/resources/completions.d.ts.map +1 -1
- package/resources/completions.js +5 -2
- package/resources/completions.js.map +1 -1
- package/resources/completions.mjs +5 -2
- package/resources/completions.mjs.map +1 -1
- package/resources/files.d.mts +104 -15
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts +104 -15
- package/resources/files.d.ts.map +1 -1
- package/resources/files.js +79 -10
- package/resources/files.js.map +1 -1
- package/resources/files.mjs +79 -10
- package/resources/files.mjs.map +1 -1
- package/resources/index.d.mts +2 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -2
- 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/batches.d.mts +68 -6
- package/resources/messages/batches.d.mts.map +1 -1
- package/resources/messages/batches.d.ts +68 -6
- package/resources/messages/batches.d.ts.map +1 -1
- package/resources/messages/batches.js +52 -13
- package/resources/messages/batches.js.map +1 -1
- package/resources/messages/batches.mjs +52 -13
- package/resources/messages/batches.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 +20 -2
- package/resources/messages/messages.d.mts.map +1 -1
- package/resources/messages/messages.d.ts +20 -2
- package/resources/messages/messages.d.ts.map +1 -1
- package/resources/messages/messages.js +10 -4
- package/resources/messages/messages.js.map +1 -1
- package/resources/messages/messages.mjs +10 -4
- package/resources/messages/messages.mjs.map +1 -1
- package/resources/models.d.mts +31 -0
- package/resources/models.d.mts.map +1 -1
- package/resources/models.d.ts +31 -0
- package/resources/models.d.ts.map +1 -1
- package/resources/models.js +23 -4
- package/resources/models.js.map +1 -1
- package/resources/models.mjs +23 -4
- package/resources/models.mjs.map +1 -1
- package/resources/skills/index.d.mts +1 -1
- package/resources/skills/index.d.mts.map +1 -1
- package/resources/skills/index.d.ts +1 -1
- package/resources/skills/index.d.ts.map +1 -1
- package/resources/skills/index.js.map +1 -1
- package/resources/skills/index.mjs.map +1 -1
- package/resources/skills/skills.d.mts +75 -10
- package/resources/skills/skills.d.mts.map +1 -1
- package/resources/skills/skills.d.ts +75 -10
- package/resources/skills/skills.d.ts.map +1 -1
- package/resources/skills/skills.js +64 -8
- package/resources/skills/skills.js.map +1 -1
- package/resources/skills/skills.mjs +64 -8
- package/resources/skills/skills.mjs.map +1 -1
- package/resources/skills/versions.d.mts +75 -5
- package/resources/skills/versions.d.mts.map +1 -1
- package/resources/skills/versions.d.ts +75 -5
- package/resources/skills/versions.d.ts.map +1 -1
- package/resources/skills/versions.js +67 -7
- package/resources/skills/versions.js.map +1 -1
- package/resources/skills/versions.mjs +67 -7
- package/resources/skills/versions.mjs.map +1 -1
- package/src/client.ts +12 -1
- package/src/core/streaming.ts +4 -2
- package/src/resources/beta/agents/agents.ts +75 -10
- package/src/resources/beta/agents/versions.ts +15 -2
- package/src/resources/beta/deployment-runs.ts +30 -4
- package/src/resources/beta/deployments.ts +120 -16
- package/src/resources/beta/dreams.ts +75 -10
- package/src/resources/beta/environments/environments.ts +90 -12
- package/src/resources/beta/environments/work.ts +60 -8
- package/src/resources/beta/files.ts +75 -11
- package/src/resources/beta/memory-stores/memories.ts +75 -10
- package/src/resources/beta/memory-stores/memory-stores.ts +90 -12
- package/src/resources/beta/memory-stores/memory-versions.ts +49 -10
- package/src/resources/beta/messages/batches.ts +85 -11
- package/src/resources/beta/messages/messages.ts +24 -2
- package/src/resources/beta/models.ts +30 -4
- package/src/resources/beta/organization/compliance-settings.ts +12 -2
- package/src/resources/beta/organization/index.ts +2 -0
- package/src/resources/beta/organization/organization.ts +4 -0
- package/src/resources/beta/sessions/events.ts +45 -6
- package/src/resources/beta/sessions/resources.ts +75 -10
- package/src/resources/beta/sessions/sessions.ts +90 -12
- package/src/resources/beta/sessions/threads/events.ts +30 -4
- package/src/resources/beta/sessions/threads/threads.ts +45 -6
- package/src/resources/beta/skills/skills.ts +60 -8
- package/src/resources/beta/skills/versions.ts +72 -9
- package/src/resources/beta/tunnels/certificates.ts +60 -8
- package/src/resources/beta/tunnels/tunnels.ts +90 -12
- package/src/resources/beta/vaults/credentials.ts +105 -14
- package/src/resources/beta/vaults/vaults.ts +90 -12
- package/src/resources/completions.ts +15 -2
- package/src/resources/files.ts +161 -18
- package/src/resources/index.ts +5 -0
- package/src/resources/messages/batches.ts +137 -13
- package/src/resources/messages/index.ts +4 -0
- package/src/resources/messages/messages.ts +38 -4
- package/src/resources/models.ts +43 -4
- package/src/resources/skills/index.ts +2 -0
- package/src/resources/skills/skills.ts +127 -13
- package/src/resources/skills/versions.ts +115 -11
- package/src/tools/agent-toolset/fs-util.ts +16 -4
- package/src/version.ts +1 -1
- package/tools/agent-toolset/fs-util.d.mts +11 -4
- package/tools/agent-toolset/fs-util.d.mts.map +1 -1
- package/tools/agent-toolset/fs-util.d.ts +11 -4
- package/tools/agent-toolset/fs-util.d.ts.map +1 -1
- package/tools/agent-toolset/fs-util.js +14 -4
- package/tools/agent-toolset/fs-util.js.map +1 -1
- package/tools/agent-toolset/fs-util.mjs +14 -4
- package/tools/agent-toolset/fs-util.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
|
@@ -27,11 +27,14 @@ export class Resources extends APIResource {
|
|
|
27
27
|
params: ResourceRetrieveParams,
|
|
28
28
|
options?: RequestOptions,
|
|
29
29
|
): APIPromise<ResourceRetrieveResponse> {
|
|
30
|
-
const { session_id, betas } = params;
|
|
30
|
+
const { session_id, betas, workspace_id } = params;
|
|
31
31
|
return this._client.get(path`/v1/sessions/${session_id}/resources/${resourceID}?beta=true`, {
|
|
32
32
|
...options,
|
|
33
33
|
headers: buildHeaders([
|
|
34
|
-
{
|
|
34
|
+
{
|
|
35
|
+
'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
|
|
36
|
+
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
37
|
+
},
|
|
35
38
|
options?.headers,
|
|
36
39
|
]),
|
|
37
40
|
});
|
|
@@ -57,12 +60,15 @@ export class Resources extends APIResource {
|
|
|
57
60
|
params: ResourceUpdateParams,
|
|
58
61
|
options?: RequestOptions,
|
|
59
62
|
): APIPromise<ResourceUpdateResponse> {
|
|
60
|
-
const { session_id, betas, ...body } = params;
|
|
63
|
+
const { session_id, betas, workspace_id, ...body } = params;
|
|
61
64
|
return this._client.post(path`/v1/sessions/${session_id}/resources/${resourceID}?beta=true`, {
|
|
62
65
|
body,
|
|
63
66
|
...options,
|
|
64
67
|
headers: buildHeaders([
|
|
65
|
-
{
|
|
68
|
+
{
|
|
69
|
+
'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
|
|
70
|
+
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
71
|
+
},
|
|
66
72
|
options?.headers,
|
|
67
73
|
]),
|
|
68
74
|
});
|
|
@@ -86,7 +92,7 @@ export class Resources extends APIResource {
|
|
|
86
92
|
params: ResourceListParams | null | undefined = {},
|
|
87
93
|
options?: RequestOptions,
|
|
88
94
|
): PagePromise<BetaManagedAgentsSessionResourcesPageCursor, BetaManagedAgentsSessionResource> {
|
|
89
|
-
const { betas, ...query } = params ?? {};
|
|
95
|
+
const { betas, workspace_id, ...query } = params ?? {};
|
|
90
96
|
return this._client.getAPIList(
|
|
91
97
|
path`/v1/sessions/${sessionID}/resources?beta=true`,
|
|
92
98
|
PageCursor<BetaManagedAgentsSessionResource>,
|
|
@@ -94,7 +100,10 @@ export class Resources extends APIResource {
|
|
|
94
100
|
query,
|
|
95
101
|
...options,
|
|
96
102
|
headers: buildHeaders([
|
|
97
|
-
{
|
|
103
|
+
{
|
|
104
|
+
'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
|
|
105
|
+
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
106
|
+
},
|
|
98
107
|
options?.headers,
|
|
99
108
|
]),
|
|
100
109
|
},
|
|
@@ -118,11 +127,14 @@ export class Resources extends APIResource {
|
|
|
118
127
|
params: ResourceDeleteParams,
|
|
119
128
|
options?: RequestOptions,
|
|
120
129
|
): APIPromise<BetaManagedAgentsDeleteSessionResource> {
|
|
121
|
-
const { session_id, betas } = params;
|
|
130
|
+
const { session_id, betas, workspace_id } = params;
|
|
122
131
|
return this._client.delete(path`/v1/sessions/${session_id}/resources/${resourceID}?beta=true`, {
|
|
123
132
|
...options,
|
|
124
133
|
headers: buildHeaders([
|
|
125
|
-
{
|
|
134
|
+
{
|
|
135
|
+
'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
|
|
136
|
+
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
137
|
+
},
|
|
126
138
|
options?.headers,
|
|
127
139
|
]),
|
|
128
140
|
});
|
|
@@ -148,12 +160,15 @@ export class Resources extends APIResource {
|
|
|
148
160
|
params: ResourceAddParams,
|
|
149
161
|
options?: RequestOptions,
|
|
150
162
|
): APIPromise<BetaManagedAgentsFileResource> {
|
|
151
|
-
const { betas, ...body } = params;
|
|
163
|
+
const { betas, workspace_id, ...body } = params;
|
|
152
164
|
return this._client.post(path`/v1/sessions/${sessionID}/resources?beta=true`, {
|
|
153
165
|
body,
|
|
154
166
|
...options,
|
|
155
167
|
headers: buildHeaders([
|
|
156
|
-
{
|
|
168
|
+
{
|
|
169
|
+
'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
|
|
170
|
+
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
171
|
+
},
|
|
157
172
|
options?.headers,
|
|
158
173
|
]),
|
|
159
174
|
});
|
|
@@ -289,6 +304,16 @@ export interface ResourceRetrieveParams {
|
|
|
289
304
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
290
305
|
*/
|
|
291
306
|
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Header param: Optional header to select the Workspace for this request. The
|
|
310
|
+
* value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
|
|
311
|
+
*
|
|
312
|
+
* Only needed for credentials that can act on more than one Workspace. A
|
|
313
|
+
* credential that belongs to a specific Workspace may omit it; if sent, it must
|
|
314
|
+
* match that Workspace.
|
|
315
|
+
*/
|
|
316
|
+
workspace_id?: string;
|
|
292
317
|
}
|
|
293
318
|
|
|
294
319
|
export interface ResourceUpdateParams {
|
|
@@ -307,6 +332,16 @@ export interface ResourceUpdateParams {
|
|
|
307
332
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
308
333
|
*/
|
|
309
334
|
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Header param: Optional header to select the Workspace for this request. The
|
|
338
|
+
* value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
|
|
339
|
+
*
|
|
340
|
+
* Only needed for credentials that can act on more than one Workspace. A
|
|
341
|
+
* credential that belongs to a specific Workspace may omit it; if sent, it must
|
|
342
|
+
* match that Workspace.
|
|
343
|
+
*/
|
|
344
|
+
workspace_id?: string;
|
|
310
345
|
}
|
|
311
346
|
|
|
312
347
|
export interface ResourceListParams extends PageCursorParams {
|
|
@@ -314,6 +349,16 @@ export interface ResourceListParams extends PageCursorParams {
|
|
|
314
349
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
315
350
|
*/
|
|
316
351
|
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Header param: Optional header to select the Workspace for this request. The
|
|
355
|
+
* value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
|
|
356
|
+
*
|
|
357
|
+
* Only needed for credentials that can act on more than one Workspace. A
|
|
358
|
+
* credential that belongs to a specific Workspace may omit it; if sent, it must
|
|
359
|
+
* match that Workspace.
|
|
360
|
+
*/
|
|
361
|
+
workspace_id?: string;
|
|
317
362
|
}
|
|
318
363
|
|
|
319
364
|
export interface ResourceDeleteParams {
|
|
@@ -326,6 +371,16 @@ export interface ResourceDeleteParams {
|
|
|
326
371
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
327
372
|
*/
|
|
328
373
|
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Header param: Optional header to select the Workspace for this request. The
|
|
377
|
+
* value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
|
|
378
|
+
*
|
|
379
|
+
* Only needed for credentials that can act on more than one Workspace. A
|
|
380
|
+
* credential that belongs to a specific Workspace may omit it; if sent, it must
|
|
381
|
+
* match that Workspace.
|
|
382
|
+
*/
|
|
383
|
+
workspace_id?: string;
|
|
329
384
|
}
|
|
330
385
|
|
|
331
386
|
export interface ResourceAddParams {
|
|
@@ -349,6 +404,16 @@ export interface ResourceAddParams {
|
|
|
349
404
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
350
405
|
*/
|
|
351
406
|
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* Header param: Optional header to select the Workspace for this request. The
|
|
410
|
+
* value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
|
|
411
|
+
*
|
|
412
|
+
* Only needed for credentials that can act on more than one Workspace. A
|
|
413
|
+
* credential that belongs to a specific Workspace may omit it; if sent, it must
|
|
414
|
+
* match that Workspace.
|
|
415
|
+
*/
|
|
416
|
+
workspace_id?: string;
|
|
352
417
|
}
|
|
353
418
|
|
|
354
419
|
export declare namespace Resources {
|
|
@@ -146,12 +146,15 @@ export class Sessions extends APIResource {
|
|
|
146
146
|
* ```
|
|
147
147
|
*/
|
|
148
148
|
create(params: SessionCreateParams, options?: RequestOptions): APIPromise<BetaManagedAgentsSession> {
|
|
149
|
-
const { betas, ...body } = params;
|
|
149
|
+
const { betas, workspace_id, ...body } = params;
|
|
150
150
|
return this._client.post('/v1/sessions?beta=true', {
|
|
151
151
|
body,
|
|
152
152
|
...options,
|
|
153
153
|
headers: buildHeaders([
|
|
154
|
-
{
|
|
154
|
+
{
|
|
155
|
+
'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
|
|
156
|
+
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
157
|
+
},
|
|
155
158
|
options?.headers,
|
|
156
159
|
]),
|
|
157
160
|
});
|
|
@@ -173,11 +176,14 @@ export class Sessions extends APIResource {
|
|
|
173
176
|
params: SessionRetrieveParams | null | undefined = {},
|
|
174
177
|
options?: RequestOptions,
|
|
175
178
|
): APIPromise<BetaManagedAgentsSession> {
|
|
176
|
-
const { betas } = params ?? {};
|
|
179
|
+
const { betas, workspace_id } = params ?? {};
|
|
177
180
|
return this._client.get(path`/v1/sessions/${sessionID}?beta=true`, {
|
|
178
181
|
...options,
|
|
179
182
|
headers: buildHeaders([
|
|
180
|
-
{
|
|
183
|
+
{
|
|
184
|
+
'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
|
|
185
|
+
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
186
|
+
},
|
|
181
187
|
options?.headers,
|
|
182
188
|
]),
|
|
183
189
|
});
|
|
@@ -199,12 +205,15 @@ export class Sessions extends APIResource {
|
|
|
199
205
|
params: SessionUpdateParams,
|
|
200
206
|
options?: RequestOptions,
|
|
201
207
|
): APIPromise<BetaManagedAgentsSession> {
|
|
202
|
-
const { betas, ...body } = params;
|
|
208
|
+
const { betas, workspace_id, ...body } = params;
|
|
203
209
|
return this._client.post(path`/v1/sessions/${sessionID}?beta=true`, {
|
|
204
210
|
body,
|
|
205
211
|
...options,
|
|
206
212
|
headers: buildHeaders([
|
|
207
|
-
{
|
|
213
|
+
{
|
|
214
|
+
'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
|
|
215
|
+
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
216
|
+
},
|
|
208
217
|
options?.headers,
|
|
209
218
|
]),
|
|
210
219
|
});
|
|
@@ -225,7 +234,7 @@ export class Sessions extends APIResource {
|
|
|
225
234
|
params: SessionListParams | null | undefined = {},
|
|
226
235
|
options?: RequestOptions,
|
|
227
236
|
): PagePromise<BetaManagedAgentsSessionsBidirectionalPageCursor, BetaManagedAgentsSession> {
|
|
228
|
-
const { betas, ...query } = params ?? {};
|
|
237
|
+
const { betas, workspace_id, ...query } = params ?? {};
|
|
229
238
|
return this._client.getAPIList(
|
|
230
239
|
'/v1/sessions?beta=true',
|
|
231
240
|
BidirectionalPageCursor<BetaManagedAgentsSession>,
|
|
@@ -233,7 +242,10 @@ export class Sessions extends APIResource {
|
|
|
233
242
|
query,
|
|
234
243
|
...options,
|
|
235
244
|
headers: buildHeaders([
|
|
236
|
-
{
|
|
245
|
+
{
|
|
246
|
+
'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
|
|
247
|
+
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
248
|
+
},
|
|
237
249
|
options?.headers,
|
|
238
250
|
]),
|
|
239
251
|
},
|
|
@@ -256,11 +268,14 @@ export class Sessions extends APIResource {
|
|
|
256
268
|
params: SessionDeleteParams | null | undefined = {},
|
|
257
269
|
options?: RequestOptions,
|
|
258
270
|
): APIPromise<BetaManagedAgentsDeletedSession> {
|
|
259
|
-
const { betas } = params ?? {};
|
|
271
|
+
const { betas, workspace_id } = params ?? {};
|
|
260
272
|
return this._client.delete(path`/v1/sessions/${sessionID}?beta=true`, {
|
|
261
273
|
...options,
|
|
262
274
|
headers: buildHeaders([
|
|
263
|
-
{
|
|
275
|
+
{
|
|
276
|
+
'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
|
|
277
|
+
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
278
|
+
},
|
|
264
279
|
options?.headers,
|
|
265
280
|
]),
|
|
266
281
|
});
|
|
@@ -282,11 +297,14 @@ export class Sessions extends APIResource {
|
|
|
282
297
|
params: SessionArchiveParams | null | undefined = {},
|
|
283
298
|
options?: RequestOptions,
|
|
284
299
|
): APIPromise<BetaManagedAgentsSession> {
|
|
285
|
-
const { betas } = params ?? {};
|
|
300
|
+
const { betas, workspace_id } = params ?? {};
|
|
286
301
|
return this._client.post(path`/v1/sessions/${sessionID}/archive?beta=true`, {
|
|
287
302
|
...options,
|
|
288
303
|
headers: buildHeaders([
|
|
289
|
-
{
|
|
304
|
+
{
|
|
305
|
+
'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
|
|
306
|
+
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
307
|
+
},
|
|
290
308
|
options?.headers,
|
|
291
309
|
]),
|
|
292
310
|
});
|
|
@@ -1119,6 +1137,16 @@ export interface SessionCreateParams {
|
|
|
1119
1137
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
1120
1138
|
*/
|
|
1121
1139
|
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
1140
|
+
|
|
1141
|
+
/**
|
|
1142
|
+
* Header param: Optional header to select the Workspace for this request. The
|
|
1143
|
+
* value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
|
|
1144
|
+
*
|
|
1145
|
+
* Only needed for credentials that can act on more than one Workspace. A
|
|
1146
|
+
* credential that belongs to a specific Workspace may omit it; if sent, it must
|
|
1147
|
+
* match that Workspace.
|
|
1148
|
+
*/
|
|
1149
|
+
workspace_id?: string;
|
|
1122
1150
|
}
|
|
1123
1151
|
|
|
1124
1152
|
export interface SessionRetrieveParams {
|
|
@@ -1126,6 +1154,16 @@ export interface SessionRetrieveParams {
|
|
|
1126
1154
|
* Optional header to specify the beta version(s) you want to use.
|
|
1127
1155
|
*/
|
|
1128
1156
|
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
1157
|
+
|
|
1158
|
+
/**
|
|
1159
|
+
* Optional header to select the Workspace for this request. The value is a
|
|
1160
|
+
* Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
|
|
1161
|
+
*
|
|
1162
|
+
* Only needed for credentials that can act on more than one Workspace. A
|
|
1163
|
+
* credential that belongs to a specific Workspace may omit it; if sent, it must
|
|
1164
|
+
* match that Workspace.
|
|
1165
|
+
*/
|
|
1166
|
+
workspace_id?: string;
|
|
1129
1167
|
}
|
|
1130
1168
|
|
|
1131
1169
|
export interface SessionUpdateParams {
|
|
@@ -1164,6 +1202,16 @@ export interface SessionUpdateParams {
|
|
|
1164
1202
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
1165
1203
|
*/
|
|
1166
1204
|
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
1205
|
+
|
|
1206
|
+
/**
|
|
1207
|
+
* Header param: Optional header to select the Workspace for this request. The
|
|
1208
|
+
* value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
|
|
1209
|
+
*
|
|
1210
|
+
* Only needed for credentials that can act on more than one Workspace. A
|
|
1211
|
+
* credential that belongs to a specific Workspace may omit it; if sent, it must
|
|
1212
|
+
* match that Workspace.
|
|
1213
|
+
*/
|
|
1214
|
+
workspace_id?: string;
|
|
1167
1215
|
}
|
|
1168
1216
|
|
|
1169
1217
|
export interface SessionListParams extends BidirectionalPageCursorParams {
|
|
@@ -1230,6 +1278,16 @@ export interface SessionListParams extends BidirectionalPageCursorParams {
|
|
|
1230
1278
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
1231
1279
|
*/
|
|
1232
1280
|
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
1281
|
+
|
|
1282
|
+
/**
|
|
1283
|
+
* Header param: Optional header to select the Workspace for this request. The
|
|
1284
|
+
* value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
|
|
1285
|
+
*
|
|
1286
|
+
* Only needed for credentials that can act on more than one Workspace. A
|
|
1287
|
+
* credential that belongs to a specific Workspace may omit it; if sent, it must
|
|
1288
|
+
* match that Workspace.
|
|
1289
|
+
*/
|
|
1290
|
+
workspace_id?: string;
|
|
1233
1291
|
}
|
|
1234
1292
|
|
|
1235
1293
|
export interface SessionDeleteParams {
|
|
@@ -1237,6 +1295,16 @@ export interface SessionDeleteParams {
|
|
|
1237
1295
|
* Optional header to specify the beta version(s) you want to use.
|
|
1238
1296
|
*/
|
|
1239
1297
|
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
1298
|
+
|
|
1299
|
+
/**
|
|
1300
|
+
* Optional header to select the Workspace for this request. The value is a
|
|
1301
|
+
* Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
|
|
1302
|
+
*
|
|
1303
|
+
* Only needed for credentials that can act on more than one Workspace. A
|
|
1304
|
+
* credential that belongs to a specific Workspace may omit it; if sent, it must
|
|
1305
|
+
* match that Workspace.
|
|
1306
|
+
*/
|
|
1307
|
+
workspace_id?: string;
|
|
1240
1308
|
}
|
|
1241
1309
|
|
|
1242
1310
|
export interface SessionArchiveParams {
|
|
@@ -1244,6 +1312,16 @@ export interface SessionArchiveParams {
|
|
|
1244
1312
|
* Optional header to specify the beta version(s) you want to use.
|
|
1245
1313
|
*/
|
|
1246
1314
|
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
1315
|
+
|
|
1316
|
+
/**
|
|
1317
|
+
* Optional header to select the Workspace for this request. The value is a
|
|
1318
|
+
* Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
|
|
1319
|
+
*
|
|
1320
|
+
* Only needed for credentials that can act on more than one Workspace. A
|
|
1321
|
+
* credential that belongs to a specific Workspace may omit it; if sent, it must
|
|
1322
|
+
* match that Workspace.
|
|
1323
|
+
*/
|
|
1324
|
+
workspace_id?: string;
|
|
1247
1325
|
}
|
|
1248
1326
|
|
|
1249
1327
|
Sessions.Events = Events;
|
|
@@ -33,7 +33,7 @@ export class Events extends APIResource {
|
|
|
33
33
|
params: EventListParams,
|
|
34
34
|
options?: RequestOptions,
|
|
35
35
|
): PagePromise<BetaManagedAgentsSessionEventsPageCursor, EventsAPI.BetaManagedAgentsSessionEvent> {
|
|
36
|
-
const { session_id, betas, ...query } = params;
|
|
36
|
+
const { session_id, betas, workspace_id, ...query } = params;
|
|
37
37
|
return this._client.getAPIList(
|
|
38
38
|
path`/v1/sessions/${session_id}/threads/${threadID}/events?beta=true`,
|
|
39
39
|
PageCursor<EventsAPI.BetaManagedAgentsSessionEvent>,
|
|
@@ -41,7 +41,10 @@ export class Events extends APIResource {
|
|
|
41
41
|
query,
|
|
42
42
|
...options,
|
|
43
43
|
headers: buildHeaders([
|
|
44
|
-
{
|
|
44
|
+
{
|
|
45
|
+
'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
|
|
46
|
+
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
47
|
+
},
|
|
45
48
|
options?.headers,
|
|
46
49
|
]),
|
|
47
50
|
},
|
|
@@ -65,12 +68,15 @@ export class Events extends APIResource {
|
|
|
65
68
|
params: EventStreamParams,
|
|
66
69
|
options?: RequestOptions,
|
|
67
70
|
): APIPromise<Stream<ThreadsAPI.BetaManagedAgentsStreamSessionThreadEvents>> {
|
|
68
|
-
const { session_id, betas, ...query } = params;
|
|
71
|
+
const { session_id, betas, workspace_id, ...query } = params;
|
|
69
72
|
return this._client.get(path`/v1/sessions/${session_id}/threads/${threadID}/stream?beta=true`, {
|
|
70
73
|
query,
|
|
71
74
|
...options,
|
|
72
75
|
headers: buildHeaders([
|
|
73
|
-
{
|
|
76
|
+
{
|
|
77
|
+
'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
|
|
78
|
+
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
79
|
+
},
|
|
74
80
|
options?.headers,
|
|
75
81
|
]),
|
|
76
82
|
stream: true,
|
|
@@ -88,6 +94,16 @@ export interface EventListParams extends PageCursorParams {
|
|
|
88
94
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
89
95
|
*/
|
|
90
96
|
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Header param: Optional header to select the Workspace for this request. The
|
|
100
|
+
* value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
|
|
101
|
+
*
|
|
102
|
+
* Only needed for credentials that can act on more than one Workspace. A
|
|
103
|
+
* credential that belongs to a specific Workspace may omit it; if sent, it must
|
|
104
|
+
* match that Workspace.
|
|
105
|
+
*/
|
|
106
|
+
workspace_id?: string;
|
|
91
107
|
}
|
|
92
108
|
|
|
93
109
|
export interface EventStreamParams {
|
|
@@ -114,6 +130,16 @@ export interface EventStreamParams {
|
|
|
114
130
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
115
131
|
*/
|
|
116
132
|
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Header param: Optional header to select the Workspace for this request. The
|
|
136
|
+
* value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
|
|
137
|
+
*
|
|
138
|
+
* Only needed for credentials that can act on more than one Workspace. A
|
|
139
|
+
* credential that belongs to a specific Workspace may omit it; if sent, it must
|
|
140
|
+
* match that Workspace.
|
|
141
|
+
*/
|
|
142
|
+
workspace_id?: string;
|
|
117
143
|
}
|
|
118
144
|
|
|
119
145
|
export declare namespace Events {
|
|
@@ -33,11 +33,14 @@ export class Threads extends APIResource {
|
|
|
33
33
|
params: ThreadRetrieveParams,
|
|
34
34
|
options?: RequestOptions,
|
|
35
35
|
): APIPromise<BetaManagedAgentsSessionThread> {
|
|
36
|
-
const { session_id, betas } = params;
|
|
36
|
+
const { session_id, betas, workspace_id } = params;
|
|
37
37
|
return this._client.get(path`/v1/sessions/${session_id}/threads/${threadID}?beta=true`, {
|
|
38
38
|
...options,
|
|
39
39
|
headers: buildHeaders([
|
|
40
|
-
{
|
|
40
|
+
{
|
|
41
|
+
'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
|
|
42
|
+
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
43
|
+
},
|
|
41
44
|
options?.headers,
|
|
42
45
|
]),
|
|
43
46
|
});
|
|
@@ -61,7 +64,7 @@ export class Threads extends APIResource {
|
|
|
61
64
|
params: ThreadListParams | null | undefined = {},
|
|
62
65
|
options?: RequestOptions,
|
|
63
66
|
): PagePromise<BetaManagedAgentsSessionThreadsPageCursor, BetaManagedAgentsSessionThread> {
|
|
64
|
-
const { betas, ...query } = params ?? {};
|
|
67
|
+
const { betas, workspace_id, ...query } = params ?? {};
|
|
65
68
|
return this._client.getAPIList(
|
|
66
69
|
path`/v1/sessions/${sessionID}/threads?beta=true`,
|
|
67
70
|
PageCursor<BetaManagedAgentsSessionThread>,
|
|
@@ -69,7 +72,10 @@ export class Threads extends APIResource {
|
|
|
69
72
|
query,
|
|
70
73
|
...options,
|
|
71
74
|
headers: buildHeaders([
|
|
72
|
-
{
|
|
75
|
+
{
|
|
76
|
+
'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
|
|
77
|
+
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
78
|
+
},
|
|
73
79
|
options?.headers,
|
|
74
80
|
]),
|
|
75
81
|
},
|
|
@@ -93,11 +99,14 @@ export class Threads extends APIResource {
|
|
|
93
99
|
params: ThreadArchiveParams,
|
|
94
100
|
options?: RequestOptions,
|
|
95
101
|
): APIPromise<BetaManagedAgentsSessionThread> {
|
|
96
|
-
const { session_id, betas } = params;
|
|
102
|
+
const { session_id, betas, workspace_id } = params;
|
|
97
103
|
return this._client.post(path`/v1/sessions/${session_id}/threads/${threadID}/archive?beta=true`, {
|
|
98
104
|
...options,
|
|
99
105
|
headers: buildHeaders([
|
|
100
|
-
{
|
|
106
|
+
{
|
|
107
|
+
'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString(),
|
|
108
|
+
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
109
|
+
},
|
|
101
110
|
options?.headers,
|
|
102
111
|
]),
|
|
103
112
|
});
|
|
@@ -287,6 +296,16 @@ export interface ThreadRetrieveParams {
|
|
|
287
296
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
288
297
|
*/
|
|
289
298
|
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Header param: Optional header to select the Workspace for this request. The
|
|
302
|
+
* value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
|
|
303
|
+
*
|
|
304
|
+
* Only needed for credentials that can act on more than one Workspace. A
|
|
305
|
+
* credential that belongs to a specific Workspace may omit it; if sent, it must
|
|
306
|
+
* match that Workspace.
|
|
307
|
+
*/
|
|
308
|
+
workspace_id?: string;
|
|
290
309
|
}
|
|
291
310
|
|
|
292
311
|
export interface ThreadListParams extends PageCursorParams {
|
|
@@ -294,6 +313,16 @@ export interface ThreadListParams extends PageCursorParams {
|
|
|
294
313
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
295
314
|
*/
|
|
296
315
|
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Header param: Optional header to select the Workspace for this request. The
|
|
319
|
+
* value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
|
|
320
|
+
*
|
|
321
|
+
* Only needed for credentials that can act on more than one Workspace. A
|
|
322
|
+
* credential that belongs to a specific Workspace may omit it; if sent, it must
|
|
323
|
+
* match that Workspace.
|
|
324
|
+
*/
|
|
325
|
+
workspace_id?: string;
|
|
297
326
|
}
|
|
298
327
|
|
|
299
328
|
export interface ThreadArchiveParams {
|
|
@@ -306,6 +335,16 @@ export interface ThreadArchiveParams {
|
|
|
306
335
|
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
307
336
|
*/
|
|
308
337
|
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Header param: Optional header to select the Workspace for this request. The
|
|
341
|
+
* value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).
|
|
342
|
+
*
|
|
343
|
+
* Only needed for credentials that can act on more than one Workspace. A
|
|
344
|
+
* credential that belongs to a specific Workspace may omit it; if sent, it must
|
|
345
|
+
* match that Workspace.
|
|
346
|
+
*/
|
|
347
|
+
workspace_id?: string;
|
|
309
348
|
}
|
|
310
349
|
|
|
311
350
|
Threads.Events = Events;
|