@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
|
@@ -8,191 +8,194 @@ const certificates_1 = require("./certificates.js");
|
|
|
8
8
|
const pagination_1 = require("../../../core/pagination.js");
|
|
9
9
|
const headers_1 = require("../../../internal/headers.js");
|
|
10
10
|
const path_1 = require("../../../internal/utils/path.js");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
var Tunnels = /* @__PURE__ */ (() => {
|
|
12
|
+
class Tunnels extends resource_1.APIResource {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.certificates = new CertificatesAPI.Certificates(this._client);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The Tunnels API is in research preview. It requires the
|
|
19
|
+
* `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a
|
|
20
|
+
* deprecation period. It supersedes the Admin API endpoints at
|
|
21
|
+
* `/v1/organizations/tunnels`, which remain available during a migration window.
|
|
22
|
+
*
|
|
23
|
+
* Creates a tunnel. Creation allocates a fresh hostname and provisions the tunnel;
|
|
24
|
+
* it is not idempotent. The new tunnel rejects MCP traffic until at least one CA
|
|
25
|
+
* certificate is added.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const betaTunnel = await client.beta.tunnels.create();
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
create(params, options) {
|
|
33
|
+
const { betas, workspace_id, ...body } = params;
|
|
34
|
+
return this._client.post('/v1/tunnels?beta=true', {
|
|
35
|
+
body,
|
|
36
|
+
...options,
|
|
37
|
+
headers: (0, headers_1.buildHeaders)([
|
|
38
|
+
{
|
|
39
|
+
'anthropic-beta': [...(betas ?? []), 'mcp-tunnels-2026-06-22'].toString(),
|
|
40
|
+
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
41
|
+
},
|
|
42
|
+
options?.headers,
|
|
43
|
+
]),
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The Tunnels API is in research preview. It requires the
|
|
48
|
+
* `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a
|
|
49
|
+
* deprecation period. It supersedes the Admin API endpoints at
|
|
50
|
+
* `/v1/organizations/tunnels`, which remain available during a migration window.
|
|
51
|
+
*
|
|
52
|
+
* Fetches a tunnel by ID.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const betaTunnel = await client.beta.tunnels.retrieve(
|
|
57
|
+
* 'tunnel_id',
|
|
58
|
+
* );
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
retrieve(tunnelID, params = {}, options) {
|
|
62
|
+
const { betas, workspace_id } = params ?? {};
|
|
63
|
+
return this._client.get((0, path_1.path) `/v1/tunnels/${tunnelID}?beta=true`, {
|
|
64
|
+
...options,
|
|
65
|
+
headers: (0, headers_1.buildHeaders)([
|
|
66
|
+
{
|
|
67
|
+
'anthropic-beta': [...(betas ?? []), 'mcp-tunnels-2026-06-22'].toString(),
|
|
68
|
+
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
69
|
+
},
|
|
70
|
+
options?.headers,
|
|
71
|
+
]),
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The Tunnels API is in research preview. It requires the
|
|
76
|
+
* `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a
|
|
77
|
+
* deprecation period. It supersedes the Admin API endpoints at
|
|
78
|
+
* `/v1/organizations/tunnels`, which remain available during a migration window.
|
|
79
|
+
*
|
|
80
|
+
* Lists tunnels. Results are ordered by creation time, newest first; archived
|
|
81
|
+
* tunnels are excluded unless include_archived is set.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* // Automatically fetches more pages as needed.
|
|
86
|
+
* for await (const betaTunnel of client.beta.tunnels.list()) {
|
|
87
|
+
* // ...
|
|
88
|
+
* }
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
list(params = {}, options) {
|
|
92
|
+
const { betas, workspace_id, ...query } = params ?? {};
|
|
93
|
+
return this._client.getAPIList('/v1/tunnels?beta=true', (pagination_1.PageCursor), {
|
|
94
|
+
query,
|
|
95
|
+
...options,
|
|
96
|
+
headers: (0, headers_1.buildHeaders)([
|
|
97
|
+
{
|
|
98
|
+
'anthropic-beta': [...(betas ?? []), 'mcp-tunnels-2026-06-22'].toString(),
|
|
99
|
+
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
100
|
+
},
|
|
101
|
+
options?.headers,
|
|
102
|
+
]),
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* The Tunnels API is in research preview. It requires the
|
|
107
|
+
* `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a
|
|
108
|
+
* deprecation period. It supersedes the Admin API endpoints at
|
|
109
|
+
* `/v1/organizations/tunnels`, which remain available during a migration window.
|
|
110
|
+
*
|
|
111
|
+
* Archives a tunnel. Archival is irreversible: every non-archived certificate on
|
|
112
|
+
* the tunnel is archived in the same operation, the hostname is retired and never
|
|
113
|
+
* re-allocated, and the tunnel token is invalidated. Retrying against an
|
|
114
|
+
* already-archived tunnel returns the existing record unchanged.
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```ts
|
|
118
|
+
* const betaTunnel = await client.beta.tunnels.archive(
|
|
119
|
+
* 'tunnel_id',
|
|
120
|
+
* );
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
archive(tunnelID, params = {}, options) {
|
|
124
|
+
const { betas, workspace_id } = params ?? {};
|
|
125
|
+
return this._client.post((0, path_1.path) `/v1/tunnels/${tunnelID}/archive?beta=true`, {
|
|
126
|
+
...options,
|
|
127
|
+
headers: (0, headers_1.buildHeaders)([
|
|
128
|
+
{
|
|
129
|
+
'anthropic-beta': [...(betas ?? []), 'mcp-tunnels-2026-06-22'].toString(),
|
|
130
|
+
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
131
|
+
},
|
|
132
|
+
options?.headers,
|
|
133
|
+
]),
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* The Tunnels API is in research preview. It requires the
|
|
138
|
+
* `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a
|
|
139
|
+
* deprecation period. It supersedes the Admin API endpoints at
|
|
140
|
+
* `/v1/organizations/tunnels`, which remain available during a migration window.
|
|
141
|
+
*
|
|
142
|
+
* Reveals a tunnel's connector token. The value is fetched live on each call;
|
|
143
|
+
* Anthropic does not store it. Repeated calls return the same value until the
|
|
144
|
+
* token is rotated. Exposed as POST so the token does not appear in intermediary
|
|
145
|
+
* access logs.
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* ```ts
|
|
149
|
+
* const betaTunnelToken =
|
|
150
|
+
* await client.beta.tunnels.revealToken('tunnel_id');
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
revealToken(tunnelID, params = {}, options) {
|
|
154
|
+
const { betas, workspace_id } = params ?? {};
|
|
155
|
+
return this._client.post((0, path_1.path) `/v1/tunnels/${tunnelID}/reveal_token?beta=true`, {
|
|
156
|
+
...options,
|
|
157
|
+
headers: (0, headers_1.buildHeaders)([
|
|
158
|
+
{
|
|
159
|
+
'anthropic-beta': [...(betas ?? []), 'mcp-tunnels-2026-06-22'].toString(),
|
|
160
|
+
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
161
|
+
},
|
|
162
|
+
options?.headers,
|
|
163
|
+
]),
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* The Tunnels API is in research preview. It requires the
|
|
168
|
+
* `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a
|
|
169
|
+
* deprecation period. It supersedes the Admin API endpoints at
|
|
170
|
+
* `/v1/organizations/tunnels`, which remain available during a migration window.
|
|
171
|
+
*
|
|
172
|
+
* Rotates a tunnel's connector token. Rotation invalidates the current token for
|
|
173
|
+
* new connections and returns a fresh value; established connections are not
|
|
174
|
+
* severed. A connector restarted after rotation must use the new value.
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* ```ts
|
|
178
|
+
* const betaTunnelToken =
|
|
179
|
+
* await client.beta.tunnels.rotateToken('tunnel_id');
|
|
180
|
+
* ```
|
|
181
|
+
*/
|
|
182
|
+
rotateToken(tunnelID, params, options) {
|
|
183
|
+
const { betas, workspace_id, ...body } = params;
|
|
184
|
+
return this._client.post((0, path_1.path) `/v1/tunnels/${tunnelID}/rotate_token?beta=true`, {
|
|
185
|
+
body,
|
|
186
|
+
...options,
|
|
187
|
+
headers: (0, headers_1.buildHeaders)([
|
|
188
|
+
{
|
|
189
|
+
'anthropic-beta': [...(betas ?? []), 'mcp-tunnels-2026-06-22'].toString(),
|
|
190
|
+
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
191
|
+
},
|
|
192
|
+
options?.headers,
|
|
193
|
+
]),
|
|
194
|
+
});
|
|
195
|
+
}
|
|
15
196
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* deprecation period. It supersedes the Admin API endpoints at
|
|
20
|
-
* `/v1/organizations/tunnels`, which remain available during a migration window.
|
|
21
|
-
*
|
|
22
|
-
* Creates a tunnel. Creation allocates a fresh hostname and provisions the tunnel;
|
|
23
|
-
* it is not idempotent. The new tunnel rejects MCP traffic until at least one CA
|
|
24
|
-
* certificate is added.
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```ts
|
|
28
|
-
* const betaTunnel = await client.beta.tunnels.create();
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
create(params, options) {
|
|
32
|
-
const { betas, workspace_id, ...body } = params;
|
|
33
|
-
return this._client.post('/v1/tunnels?beta=true', {
|
|
34
|
-
body,
|
|
35
|
-
...options,
|
|
36
|
-
headers: (0, headers_1.buildHeaders)([
|
|
37
|
-
{
|
|
38
|
-
'anthropic-beta': [...(betas ?? []), 'mcp-tunnels-2026-06-22'].toString(),
|
|
39
|
-
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
40
|
-
},
|
|
41
|
-
options?.headers,
|
|
42
|
-
]),
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* The Tunnels API is in research preview. It requires the
|
|
47
|
-
* `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a
|
|
48
|
-
* deprecation period. It supersedes the Admin API endpoints at
|
|
49
|
-
* `/v1/organizations/tunnels`, which remain available during a migration window.
|
|
50
|
-
*
|
|
51
|
-
* Fetches a tunnel by ID.
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* ```ts
|
|
55
|
-
* const betaTunnel = await client.beta.tunnels.retrieve(
|
|
56
|
-
* 'tunnel_id',
|
|
57
|
-
* );
|
|
58
|
-
* ```
|
|
59
|
-
*/
|
|
60
|
-
retrieve(tunnelID, params = {}, options) {
|
|
61
|
-
const { betas, workspace_id } = params ?? {};
|
|
62
|
-
return this._client.get((0, path_1.path) `/v1/tunnels/${tunnelID}?beta=true`, {
|
|
63
|
-
...options,
|
|
64
|
-
headers: (0, headers_1.buildHeaders)([
|
|
65
|
-
{
|
|
66
|
-
'anthropic-beta': [...(betas ?? []), 'mcp-tunnels-2026-06-22'].toString(),
|
|
67
|
-
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
68
|
-
},
|
|
69
|
-
options?.headers,
|
|
70
|
-
]),
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* The Tunnels API is in research preview. It requires the
|
|
75
|
-
* `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a
|
|
76
|
-
* deprecation period. It supersedes the Admin API endpoints at
|
|
77
|
-
* `/v1/organizations/tunnels`, which remain available during a migration window.
|
|
78
|
-
*
|
|
79
|
-
* Lists tunnels. Results are ordered by creation time, newest first; archived
|
|
80
|
-
* tunnels are excluded unless include_archived is set.
|
|
81
|
-
*
|
|
82
|
-
* @example
|
|
83
|
-
* ```ts
|
|
84
|
-
* // Automatically fetches more pages as needed.
|
|
85
|
-
* for await (const betaTunnel of client.beta.tunnels.list()) {
|
|
86
|
-
* // ...
|
|
87
|
-
* }
|
|
88
|
-
* ```
|
|
89
|
-
*/
|
|
90
|
-
list(params = {}, options) {
|
|
91
|
-
const { betas, workspace_id, ...query } = params ?? {};
|
|
92
|
-
return this._client.getAPIList('/v1/tunnels?beta=true', (pagination_1.PageCursor), {
|
|
93
|
-
query,
|
|
94
|
-
...options,
|
|
95
|
-
headers: (0, headers_1.buildHeaders)([
|
|
96
|
-
{
|
|
97
|
-
'anthropic-beta': [...(betas ?? []), 'mcp-tunnels-2026-06-22'].toString(),
|
|
98
|
-
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
99
|
-
},
|
|
100
|
-
options?.headers,
|
|
101
|
-
]),
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* The Tunnels API is in research preview. It requires the
|
|
106
|
-
* `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a
|
|
107
|
-
* deprecation period. It supersedes the Admin API endpoints at
|
|
108
|
-
* `/v1/organizations/tunnels`, which remain available during a migration window.
|
|
109
|
-
*
|
|
110
|
-
* Archives a tunnel. Archival is irreversible: every non-archived certificate on
|
|
111
|
-
* the tunnel is archived in the same operation, the hostname is retired and never
|
|
112
|
-
* re-allocated, and the tunnel token is invalidated. Retrying against an
|
|
113
|
-
* already-archived tunnel returns the existing record unchanged.
|
|
114
|
-
*
|
|
115
|
-
* @example
|
|
116
|
-
* ```ts
|
|
117
|
-
* const betaTunnel = await client.beta.tunnels.archive(
|
|
118
|
-
* 'tunnel_id',
|
|
119
|
-
* );
|
|
120
|
-
* ```
|
|
121
|
-
*/
|
|
122
|
-
archive(tunnelID, params = {}, options) {
|
|
123
|
-
const { betas, workspace_id } = params ?? {};
|
|
124
|
-
return this._client.post((0, path_1.path) `/v1/tunnels/${tunnelID}/archive?beta=true`, {
|
|
125
|
-
...options,
|
|
126
|
-
headers: (0, headers_1.buildHeaders)([
|
|
127
|
-
{
|
|
128
|
-
'anthropic-beta': [...(betas ?? []), 'mcp-tunnels-2026-06-22'].toString(),
|
|
129
|
-
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
130
|
-
},
|
|
131
|
-
options?.headers,
|
|
132
|
-
]),
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* The Tunnels API is in research preview. It requires the
|
|
137
|
-
* `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a
|
|
138
|
-
* deprecation period. It supersedes the Admin API endpoints at
|
|
139
|
-
* `/v1/organizations/tunnels`, which remain available during a migration window.
|
|
140
|
-
*
|
|
141
|
-
* Reveals a tunnel's connector token. The value is fetched live on each call;
|
|
142
|
-
* Anthropic does not store it. Repeated calls return the same value until the
|
|
143
|
-
* token is rotated. Exposed as POST so the token does not appear in intermediary
|
|
144
|
-
* access logs.
|
|
145
|
-
*
|
|
146
|
-
* @example
|
|
147
|
-
* ```ts
|
|
148
|
-
* const betaTunnelToken =
|
|
149
|
-
* await client.beta.tunnels.revealToken('tunnel_id');
|
|
150
|
-
* ```
|
|
151
|
-
*/
|
|
152
|
-
revealToken(tunnelID, params = {}, options) {
|
|
153
|
-
const { betas, workspace_id } = params ?? {};
|
|
154
|
-
return this._client.post((0, path_1.path) `/v1/tunnels/${tunnelID}/reveal_token?beta=true`, {
|
|
155
|
-
...options,
|
|
156
|
-
headers: (0, headers_1.buildHeaders)([
|
|
157
|
-
{
|
|
158
|
-
'anthropic-beta': [...(betas ?? []), 'mcp-tunnels-2026-06-22'].toString(),
|
|
159
|
-
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
160
|
-
},
|
|
161
|
-
options?.headers,
|
|
162
|
-
]),
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* The Tunnels API is in research preview. It requires the
|
|
167
|
-
* `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a
|
|
168
|
-
* deprecation period. It supersedes the Admin API endpoints at
|
|
169
|
-
* `/v1/organizations/tunnels`, which remain available during a migration window.
|
|
170
|
-
*
|
|
171
|
-
* Rotates a tunnel's connector token. Rotation invalidates the current token for
|
|
172
|
-
* new connections and returns a fresh value; established connections are not
|
|
173
|
-
* severed. A connector restarted after rotation must use the new value.
|
|
174
|
-
*
|
|
175
|
-
* @example
|
|
176
|
-
* ```ts
|
|
177
|
-
* const betaTunnelToken =
|
|
178
|
-
* await client.beta.tunnels.rotateToken('tunnel_id');
|
|
179
|
-
* ```
|
|
180
|
-
*/
|
|
181
|
-
rotateToken(tunnelID, params, options) {
|
|
182
|
-
const { betas, workspace_id, ...body } = params;
|
|
183
|
-
return this._client.post((0, path_1.path) `/v1/tunnels/${tunnelID}/rotate_token?beta=true`, {
|
|
184
|
-
body,
|
|
185
|
-
...options,
|
|
186
|
-
headers: (0, headers_1.buildHeaders)([
|
|
187
|
-
{
|
|
188
|
-
'anthropic-beta': [...(betas ?? []), 'mcp-tunnels-2026-06-22'].toString(),
|
|
189
|
-
...(workspace_id != null ? { 'anthropic-workspace-id': workspace_id } : undefined),
|
|
190
|
-
},
|
|
191
|
-
options?.headers,
|
|
192
|
-
]),
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
}
|
|
197
|
+
Tunnels.Certificates = certificates_1.Certificates;
|
|
198
|
+
return Tunnels;
|
|
199
|
+
})();
|
|
196
200
|
exports.Tunnels = Tunnels;
|
|
197
|
-
Tunnels.Certificates = certificates_1.Certificates;
|
|
198
201
|
//# sourceMappingURL=tunnels.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tunnels.js","sourceRoot":"","sources":["../../../src/resources/beta/tunnels/tunnels.ts"],"names":[],"mappings":";;;;AAAA,wDAAqD;AAErD,2EAAkD;AAClD,oDAQwB;AAExB,4DAA0F;AAC1F,0DAAyD;AAEzD,0DAAoD
|
|
1
|
+
{"version":3,"file":"tunnels.js","sourceRoot":"","sources":["../../../src/resources/beta/tunnels/tunnels.ts"],"names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