@anthropic-ai/sdk 0.108.0 → 0.109.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 +8 -0
- package/client.d.mts +3 -1
- package/client.d.mts.map +1 -1
- package/client.d.ts +3 -1
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/core/pagination.d.mts +20 -0
- package/core/pagination.d.mts.map +1 -1
- package/core/pagination.d.ts +20 -0
- package/core/pagination.d.ts.map +1 -1
- package/core/pagination.js +26 -1
- package/core/pagination.js.map +1 -1
- package/core/pagination.mjs +24 -0
- package/core/pagination.mjs.map +1 -1
- package/core/streaming.d.mts.map +1 -1
- package/core/streaming.d.ts.map +1 -1
- package/core/streaming.js +2 -0
- package/core/streaming.js.map +1 -1
- package/core/streaming.mjs +2 -0
- package/core/streaming.mjs.map +1 -1
- package/lib/sessions/accumulate.d.mts +22 -0
- package/lib/sessions/accumulate.d.mts.map +1 -0
- package/lib/sessions/accumulate.d.ts +22 -0
- package/lib/sessions/accumulate.d.ts.map +1 -0
- package/lib/sessions/accumulate.js +87 -0
- package/lib/sessions/accumulate.js.map +1 -0
- package/lib/sessions/accumulate.mjs +84 -0
- package/lib/sessions/accumulate.mjs.map +1 -0
- package/package.json +1 -1
- package/resources/beta/beta.d.mts +4 -4
- package/resources/beta/beta.d.mts.map +1 -1
- package/resources/beta/beta.d.ts +4 -4
- 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/environments/work.d.mts +2 -1
- package/resources/beta/environments/work.d.mts.map +1 -1
- package/resources/beta/environments/work.d.ts +2 -1
- package/resources/beta/environments/work.d.ts.map +1 -1
- package/resources/beta/environments/work.js.map +1 -1
- 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/sessions/events.d.mts +15 -2
- package/resources/beta/sessions/events.d.mts.map +1 -1
- package/resources/beta/sessions/events.d.ts +15 -2
- package/resources/beta/sessions/events.d.ts.map +1 -1
- package/resources/beta/sessions/events.js +2 -1
- package/resources/beta/sessions/events.js.map +1 -1
- package/resources/beta/sessions/events.mjs +2 -1
- package/resources/beta/sessions/events.mjs.map +1 -1
- package/resources/beta/sessions/index.d.mts +1 -1
- package/resources/beta/sessions/index.d.mts.map +1 -1
- package/resources/beta/sessions/index.d.ts +1 -1
- package/resources/beta/sessions/index.d.ts.map +1 -1
- package/resources/beta/sessions/index.js.map +1 -1
- package/resources/beta/sessions/index.mjs.map +1 -1
- package/resources/beta/sessions/sessions.d.mts +121 -6
- package/resources/beta/sessions/sessions.d.mts.map +1 -1
- package/resources/beta/sessions/sessions.d.ts +121 -6
- package/resources/beta/sessions/sessions.d.ts.map +1 -1
- package/resources/beta/sessions/sessions.js +1 -1
- package/resources/beta/sessions/sessions.js.map +1 -1
- package/resources/beta/sessions/sessions.mjs +2 -2
- package/resources/beta/sessions/sessions.mjs.map +1 -1
- package/resources/beta/sessions/threads/threads.d.mts +1 -1
- package/resources/beta/sessions/threads/threads.d.mts.map +1 -1
- package/resources/beta/sessions/threads/threads.d.ts +1 -1
- package/resources/beta/sessions/threads/threads.d.ts.map +1 -1
- package/resources/beta/sessions/threads/threads.js.map +1 -1
- package/resources/beta/sessions/threads/threads.mjs.map +1 -1
- package/resources/beta/vaults/credentials.d.mts +52 -1
- package/resources/beta/vaults/credentials.d.mts.map +1 -1
- package/resources/beta/vaults/credentials.d.ts +52 -1
- package/resources/beta/vaults/credentials.d.ts.map +1 -1
- package/resources/beta/vaults/index.d.mts +1 -1
- package/resources/beta/vaults/index.d.mts.map +1 -1
- package/resources/beta/vaults/index.d.ts +1 -1
- package/resources/beta/vaults/index.d.ts.map +1 -1
- package/resources/beta/vaults/index.js.map +1 -1
- package/resources/beta/vaults/index.mjs.map +1 -1
- package/resources/beta/vaults/vaults.d.mts +2 -2
- package/resources/beta/vaults/vaults.d.mts.map +1 -1
- package/resources/beta/vaults/vaults.d.ts +2 -2
- package/resources/beta/vaults/vaults.d.ts.map +1 -1
- package/resources/beta/vaults/vaults.js.map +1 -1
- package/resources/beta/vaults/vaults.mjs.map +1 -1
- package/resources/beta/webhooks.d.mts +183 -2
- package/resources/beta/webhooks.d.mts.map +1 -1
- package/resources/beta/webhooks.d.ts +183 -2
- package/resources/beta/webhooks.d.ts.map +1 -1
- package/src/client.ts +8 -0
- package/src/core/pagination.ts +60 -0
- package/src/core/streaming.ts +2 -0
- package/src/lib/sessions/accumulate.ts +129 -0
- package/src/resources/beta/beta.ts +60 -2
- package/src/resources/beta/environments/work.ts +2 -1
- package/src/resources/beta/index.ts +30 -1
- package/src/resources/beta/sessions/events.ts +19 -2
- package/src/resources/beta/sessions/index.ts +9 -1
- package/src/resources/beta/sessions/sessions.ts +174 -14
- package/src/resources/beta/sessions/threads/threads.ts +2 -0
- package/src/resources/beta/vaults/credentials.ts +63 -0
- package/src/resources/beta/vaults/index.ts +3 -0
- package/src/resources/beta/vaults/vaults.ts +6 -0
- package/src/resources/beta/webhooks.ts +304 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -433,11 +433,17 @@ export {
|
|
|
433
433
|
} from './models';
|
|
434
434
|
export {
|
|
435
435
|
Sessions,
|
|
436
|
+
type BetaManagedAgentsAgentMessagePreview,
|
|
436
437
|
type BetaManagedAgentsAgentParams,
|
|
438
|
+
type BetaManagedAgentsAgentThinkingPreview,
|
|
439
|
+
type BetaManagedAgentsAgentWithOverridesParams,
|
|
437
440
|
type BetaManagedAgentsBranchCheckout,
|
|
438
441
|
type BetaManagedAgentsCacheCreationUsage,
|
|
439
442
|
type BetaManagedAgentsCommitCheckout,
|
|
440
443
|
type BetaManagedAgentsDeletedSession,
|
|
444
|
+
type BetaManagedAgentsDeltaContent,
|
|
445
|
+
type BetaManagedAgentsDeltaEvent,
|
|
446
|
+
type BetaManagedAgentsDeltaType,
|
|
441
447
|
type BetaManagedAgentsFileResourceParams,
|
|
442
448
|
type BetaManagedAgentsGitHubRepositoryResourceParams,
|
|
443
449
|
type BetaManagedAgentsMemoryStoreResourceParam,
|
|
@@ -452,6 +458,8 @@ export {
|
|
|
452
458
|
type BetaManagedAgentsSessionStats,
|
|
453
459
|
type BetaManagedAgentsSessionUpdatedEvent,
|
|
454
460
|
type BetaManagedAgentsSessionUsage,
|
|
461
|
+
type BetaManagedAgentsStartEvent,
|
|
462
|
+
type BetaManagedAgentsStartEventPreview,
|
|
455
463
|
type BetaManagedAgentsSystemContentBlock,
|
|
456
464
|
type BetaManagedAgentsSystemMessageEvent,
|
|
457
465
|
type BetaManagedAgentsUserToolResultEvent,
|
|
@@ -461,7 +469,7 @@ export {
|
|
|
461
469
|
type SessionListParams,
|
|
462
470
|
type SessionDeleteParams,
|
|
463
471
|
type SessionArchiveParams,
|
|
464
|
-
type
|
|
472
|
+
type BetaManagedAgentsSessionsBidirectionalPageCursor,
|
|
465
473
|
} from './sessions/index';
|
|
466
474
|
export {
|
|
467
475
|
Skills,
|
|
@@ -501,8 +509,29 @@ export {
|
|
|
501
509
|
} from './vaults/index';
|
|
502
510
|
export {
|
|
503
511
|
Webhooks,
|
|
512
|
+
type BetaWebhookAgentArchivedEventData,
|
|
513
|
+
type BetaWebhookAgentCreatedEventData,
|
|
514
|
+
type BetaWebhookAgentDeletedEventData,
|
|
515
|
+
type BetaWebhookAgentUpdatedEventData,
|
|
516
|
+
type BetaWebhookDeploymentArchivedEventData,
|
|
517
|
+
type BetaWebhookDeploymentCreatedEventData,
|
|
518
|
+
type BetaWebhookDeploymentDeletedEventData,
|
|
519
|
+
type BetaWebhookDeploymentPausedEventData,
|
|
520
|
+
type BetaWebhookDeploymentRunFailedEventData,
|
|
521
|
+
type BetaWebhookDeploymentRunStartedEventData,
|
|
522
|
+
type BetaWebhookDeploymentRunSucceededEventData,
|
|
523
|
+
type BetaWebhookDeploymentUnpausedEventData,
|
|
524
|
+
type BetaWebhookDeploymentUpdatedEventData,
|
|
525
|
+
type BetaWebhookEnvironmentArchivedEventData,
|
|
526
|
+
type BetaWebhookEnvironmentCreatedEventData,
|
|
527
|
+
type BetaWebhookEnvironmentDeletedEventData,
|
|
528
|
+
type BetaWebhookEnvironmentDeletedEventType,
|
|
529
|
+
type BetaWebhookEnvironmentUpdatedEventData,
|
|
504
530
|
type BetaWebhookEvent,
|
|
505
531
|
type BetaWebhookEventData,
|
|
532
|
+
type BetaWebhookMemoryStoreArchivedEventData,
|
|
533
|
+
type BetaWebhookMemoryStoreCreatedEventData,
|
|
534
|
+
type BetaWebhookMemoryStoreDeletedEventData,
|
|
506
535
|
type BetaWebhookSessionArchivedEventData,
|
|
507
536
|
type BetaWebhookSessionCreatedEventData,
|
|
508
537
|
type BetaWebhookSessionDeletedEventData,
|
|
@@ -105,8 +105,9 @@ export class Events extends APIResource {
|
|
|
105
105
|
params: EventStreamParams | undefined = {},
|
|
106
106
|
options?: RequestOptions,
|
|
107
107
|
): APIPromise<Stream<BetaManagedAgentsStreamSessionEvents>> {
|
|
108
|
-
const { betas } = params ?? {};
|
|
108
|
+
const { betas, ...query } = params ?? {};
|
|
109
109
|
return this._client.get(path`/v1/sessions/${sessionID}/events/stream?beta=true`, {
|
|
110
|
+
query,
|
|
110
111
|
...options,
|
|
111
112
|
headers: buildHeaders([
|
|
112
113
|
{ 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
|
|
@@ -1451,6 +1452,8 @@ export type BetaManagedAgentsStreamSessionEvents =
|
|
|
1451
1452
|
| SessionsAPI.BetaManagedAgentsUserToolResultEvent
|
|
1452
1453
|
| BetaManagedAgentsSessionThreadStatusRescheduledEvent
|
|
1453
1454
|
| SessionsAPI.BetaManagedAgentsSessionUpdatedEvent
|
|
1455
|
+
| SessionsAPI.BetaManagedAgentsStartEvent
|
|
1456
|
+
| SessionsAPI.BetaManagedAgentsDeltaEvent
|
|
1454
1457
|
| SessionsAPI.BetaManagedAgentsSystemMessageEvent;
|
|
1455
1458
|
|
|
1456
1459
|
/**
|
|
@@ -1918,7 +1921,21 @@ export interface EventSendParams {
|
|
|
1918
1921
|
|
|
1919
1922
|
export interface EventStreamParams {
|
|
1920
1923
|
/**
|
|
1921
|
-
*
|
|
1924
|
+
* Query param: When set, this connection also receives streaming deltas
|
|
1925
|
+
* (`event_start`, `event_delta`) while an event is being produced, before the
|
|
1926
|
+
* event itself arrives. Deltas are best-effort; when the final event is produced
|
|
1927
|
+
* it carries the complete content. A model request that ends early (an error or
|
|
1928
|
+
* interrupt) produces no final event — its terminal `span.model_request_end`
|
|
1929
|
+
* closes the preview. Accepts one or more event types to preview and may be
|
|
1930
|
+
* repeated: `agent.message` streams `content_delta` fragments; `agent.thinking` is
|
|
1931
|
+
* start-only — a signal that the agent has begun extended thinking, concluded by
|
|
1932
|
+
* the `agent.thinking` event itself. Only previews of the requested event types
|
|
1933
|
+
* are sent.
|
|
1934
|
+
*/
|
|
1935
|
+
event_deltas?: Array<SessionsAPI.BetaManagedAgentsDeltaType>;
|
|
1936
|
+
|
|
1937
|
+
/**
|
|
1938
|
+
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
1922
1939
|
*/
|
|
1923
1940
|
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
1924
1941
|
}
|
|
@@ -99,11 +99,17 @@ export {
|
|
|
99
99
|
} from './resources';
|
|
100
100
|
export {
|
|
101
101
|
Sessions,
|
|
102
|
+
type BetaManagedAgentsAgentMessagePreview,
|
|
102
103
|
type BetaManagedAgentsAgentParams,
|
|
104
|
+
type BetaManagedAgentsAgentThinkingPreview,
|
|
105
|
+
type BetaManagedAgentsAgentWithOverridesParams,
|
|
103
106
|
type BetaManagedAgentsBranchCheckout,
|
|
104
107
|
type BetaManagedAgentsCacheCreationUsage,
|
|
105
108
|
type BetaManagedAgentsCommitCheckout,
|
|
106
109
|
type BetaManagedAgentsDeletedSession,
|
|
110
|
+
type BetaManagedAgentsDeltaContent,
|
|
111
|
+
type BetaManagedAgentsDeltaEvent,
|
|
112
|
+
type BetaManagedAgentsDeltaType,
|
|
107
113
|
type BetaManagedAgentsFileResourceParams,
|
|
108
114
|
type BetaManagedAgentsGitHubRepositoryResourceParams,
|
|
109
115
|
type BetaManagedAgentsMemoryStoreResourceParam,
|
|
@@ -118,6 +124,8 @@ export {
|
|
|
118
124
|
type BetaManagedAgentsSessionStats,
|
|
119
125
|
type BetaManagedAgentsSessionUpdatedEvent,
|
|
120
126
|
type BetaManagedAgentsSessionUsage,
|
|
127
|
+
type BetaManagedAgentsStartEvent,
|
|
128
|
+
type BetaManagedAgentsStartEventPreview,
|
|
121
129
|
type BetaManagedAgentsSystemContentBlock,
|
|
122
130
|
type BetaManagedAgentsSystemMessageEvent,
|
|
123
131
|
type BetaManagedAgentsUserToolResultEvent,
|
|
@@ -127,7 +135,7 @@ export {
|
|
|
127
135
|
type SessionListParams,
|
|
128
136
|
type SessionDeleteParams,
|
|
129
137
|
type SessionArchiveParams,
|
|
130
|
-
type
|
|
138
|
+
type BetaManagedAgentsSessionsBidirectionalPageCursor,
|
|
131
139
|
} from './sessions';
|
|
132
140
|
export {
|
|
133
141
|
Threads,
|
|
@@ -116,7 +116,11 @@ import {
|
|
|
116
116
|
Threads,
|
|
117
117
|
} from './threads/threads';
|
|
118
118
|
import { APIPromise } from '../../../core/api-promise';
|
|
119
|
-
import {
|
|
119
|
+
import {
|
|
120
|
+
BidirectionalPageCursor,
|
|
121
|
+
type BidirectionalPageCursorParams,
|
|
122
|
+
PagePromise,
|
|
123
|
+
} from '../../../core/pagination';
|
|
120
124
|
import { buildHeaders } from '../../../internal/headers';
|
|
121
125
|
import { RequestOptions } from '../../../internal/request-options';
|
|
122
126
|
import { path } from '../../../internal/utils/path';
|
|
@@ -217,16 +221,20 @@ export class Sessions extends APIResource {
|
|
|
217
221
|
list(
|
|
218
222
|
params: SessionListParams | null | undefined = {},
|
|
219
223
|
options?: RequestOptions,
|
|
220
|
-
): PagePromise<
|
|
224
|
+
): PagePromise<BetaManagedAgentsSessionsBidirectionalPageCursor, BetaManagedAgentsSession> {
|
|
221
225
|
const { betas, ...query } = params ?? {};
|
|
222
|
-
return this._client.getAPIList(
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
options
|
|
228
|
-
|
|
229
|
-
|
|
226
|
+
return this._client.getAPIList(
|
|
227
|
+
'/v1/sessions?beta=true',
|
|
228
|
+
BidirectionalPageCursor<BetaManagedAgentsSession>,
|
|
229
|
+
{
|
|
230
|
+
query,
|
|
231
|
+
...options,
|
|
232
|
+
headers: buildHeaders([
|
|
233
|
+
{ 'anthropic-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
|
|
234
|
+
options?.headers,
|
|
235
|
+
]),
|
|
236
|
+
},
|
|
237
|
+
);
|
|
230
238
|
}
|
|
231
239
|
|
|
232
240
|
/**
|
|
@@ -282,7 +290,18 @@ export class Sessions extends APIResource {
|
|
|
282
290
|
}
|
|
283
291
|
}
|
|
284
292
|
|
|
285
|
-
export type
|
|
293
|
+
export type BetaManagedAgentsSessionsBidirectionalPageCursor =
|
|
294
|
+
BidirectionalPageCursor<BetaManagedAgentsSession>;
|
|
295
|
+
|
|
296
|
+
export interface BetaManagedAgentsAgentMessagePreview {
|
|
297
|
+
/**
|
|
298
|
+
* The id the buffered agent.message will carry if it is emitted. Matches the
|
|
299
|
+
* event_id on this preview's event_delta events.
|
|
300
|
+
*/
|
|
301
|
+
id: string;
|
|
302
|
+
|
|
303
|
+
type: 'agent.message';
|
|
304
|
+
}
|
|
286
305
|
|
|
287
306
|
/**
|
|
288
307
|
* Specification for an Agent. Provide a specific `version` or use the short-form
|
|
@@ -303,6 +322,69 @@ export interface BetaManagedAgentsAgentParams {
|
|
|
303
322
|
version?: number;
|
|
304
323
|
}
|
|
305
324
|
|
|
325
|
+
export interface BetaManagedAgentsAgentThinkingPreview {
|
|
326
|
+
/**
|
|
327
|
+
* The id the buffered agent.thinking will carry if it is emitted. Start-only — no
|
|
328
|
+
* event_delta events follow.
|
|
329
|
+
*/
|
|
330
|
+
id: string;
|
|
331
|
+
|
|
332
|
+
type: 'agent.thinking';
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Reference to an `agent` plus optional configuration overrides. Each provided
|
|
337
|
+
* field replaces the agent's value for the caller's use; the agent resource is
|
|
338
|
+
* unchanged.
|
|
339
|
+
*/
|
|
340
|
+
export interface BetaManagedAgentsAgentWithOverridesParams {
|
|
341
|
+
/**
|
|
342
|
+
* The `agent` ID.
|
|
343
|
+
*/
|
|
344
|
+
id: string;
|
|
345
|
+
|
|
346
|
+
type: 'agent_with_overrides';
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Replacement MCP server list. Full replacement: the provided array becomes the
|
|
350
|
+
* MCP servers. Send an empty array to clear; omit to preserve the agent's servers.
|
|
351
|
+
*/
|
|
352
|
+
mcp_servers?: Array<AgentsAPI.BetaManagedAgentsURLMCPServerParams>;
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Replacement model. Accepts the model string, e.g. `claude-opus-4-6`, or a
|
|
356
|
+
* `model_config` object. Omit to use the agent's model.
|
|
357
|
+
*/
|
|
358
|
+
model?: AgentsAPI.BetaManagedAgentsModel | AgentsAPI.BetaManagedAgentsModelConfigParams;
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Replacement skill list. Full replacement: the provided array becomes the skills.
|
|
362
|
+
* Send an empty array to clear; omit to preserve the agent's skills.
|
|
363
|
+
*/
|
|
364
|
+
skills?: Array<AgentsAPI.BetaManagedAgentsSkillParams>;
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Replacement system prompt. Up to 100,000 characters. Set to null to clear the
|
|
368
|
+
* agent's system prompt; omit to preserve it.
|
|
369
|
+
*/
|
|
370
|
+
system?: string | null;
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Replacement tool list. Full replacement: the provided array becomes the tool
|
|
374
|
+
* configuration. Send an empty array to clear; omit to preserve the agent's tools.
|
|
375
|
+
*/
|
|
376
|
+
tools?: Array<
|
|
377
|
+
| AgentsAPI.BetaManagedAgentsAgentToolset20260401Params
|
|
378
|
+
| AgentsAPI.BetaManagedAgentsMCPToolsetParams
|
|
379
|
+
| AgentsAPI.BetaManagedAgentsCustomToolParams
|
|
380
|
+
>;
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* The specific `agent` version to use. Omit to use the latest version.
|
|
384
|
+
*/
|
|
385
|
+
version?: number;
|
|
386
|
+
}
|
|
387
|
+
|
|
306
388
|
export interface BetaManagedAgentsBranchCheckout {
|
|
307
389
|
/**
|
|
308
390
|
* Branch name to check out.
|
|
@@ -345,6 +427,52 @@ export interface BetaManagedAgentsDeletedSession {
|
|
|
345
427
|
type: 'session_deleted';
|
|
346
428
|
}
|
|
347
429
|
|
|
430
|
+
export interface BetaManagedAgentsDeltaContent {
|
|
431
|
+
/**
|
|
432
|
+
* Regular text content.
|
|
433
|
+
*/
|
|
434
|
+
content: EventsAPI.BetaManagedAgentsTextBlock;
|
|
435
|
+
|
|
436
|
+
type: 'content_delta';
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* Which entry in the previewed event's content array this fragment lands in.
|
|
440
|
+
* Insert content as that entry when the index is new; append to the existing entry
|
|
441
|
+
* otherwise.
|
|
442
|
+
*/
|
|
443
|
+
index?: number;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* An incremental update to an event that is still being streamed. Deltas are
|
|
448
|
+
* best-effort and may stop early; when the buffered event with id == event_id is
|
|
449
|
+
* produced it carries the complete content. A model request that ends early (an
|
|
450
|
+
* error or interrupt) produces no buffered event — its terminal
|
|
451
|
+
* span.model_request_end closes the preview. Only sent on stream connections that
|
|
452
|
+
* opt in via event_deltas; never appears in event history.
|
|
453
|
+
*/
|
|
454
|
+
export interface BetaManagedAgentsDeltaEvent {
|
|
455
|
+
/**
|
|
456
|
+
* One fragment of the previewed event. The delta type is named for the previewed
|
|
457
|
+
* event's field it streams into: agent.message events stream content_delta
|
|
458
|
+
* fragments, each a partial element of the content array.
|
|
459
|
+
*/
|
|
460
|
+
delta: BetaManagedAgentsDeltaContent;
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* The id of the event being previewed. Matches event.id on the corresponding
|
|
464
|
+
* event_start and the buffered event that reconciles the preview.
|
|
465
|
+
*/
|
|
466
|
+
event_id: string;
|
|
467
|
+
|
|
468
|
+
type: 'event_delta';
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* EventDeltaType enum
|
|
473
|
+
*/
|
|
474
|
+
export type BetaManagedAgentsDeltaType = 'agent.message' | 'agent.thinking';
|
|
475
|
+
|
|
348
476
|
/**
|
|
349
477
|
* Mount a file uploaded via the Files API into the session.
|
|
350
478
|
*/
|
|
@@ -718,6 +846,30 @@ export interface BetaManagedAgentsSessionUsage {
|
|
|
718
846
|
output_tokens?: number;
|
|
719
847
|
}
|
|
720
848
|
|
|
849
|
+
/**
|
|
850
|
+
* Opens a preview of a buffered event. Carries the previewed event's type and id
|
|
851
|
+
* only. Followed by zero or more event_delta events with the same event id,
|
|
852
|
+
* normally concluded by the buffered event carrying that id. If the producing
|
|
853
|
+
* model request ends without that event (an error or interrupt mid-stream), its
|
|
854
|
+
* terminal span.model_request_end closes the preview. Only sent on stream
|
|
855
|
+
* connections that opt in via event_deltas; never appears in event history.
|
|
856
|
+
*/
|
|
857
|
+
export interface BetaManagedAgentsStartEvent {
|
|
858
|
+
/**
|
|
859
|
+
* The previewed event's type and id. The event type determines which delta types
|
|
860
|
+
* the preview's event_delta events carry: agent.message events stream
|
|
861
|
+
* content_delta fragments; agent.thinking previews are start-only — no deltas
|
|
862
|
+
* follow, and the buffered agent.thinking with the same id concludes them.
|
|
863
|
+
*/
|
|
864
|
+
event: BetaManagedAgentsStartEventPreview;
|
|
865
|
+
|
|
866
|
+
type: 'event_start';
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
export type BetaManagedAgentsStartEventPreview =
|
|
870
|
+
| BetaManagedAgentsAgentMessagePreview
|
|
871
|
+
| BetaManagedAgentsAgentThinkingPreview;
|
|
872
|
+
|
|
721
873
|
/**
|
|
722
874
|
* Regular text content.
|
|
723
875
|
*/
|
|
@@ -807,7 +959,7 @@ export interface SessionCreateParams {
|
|
|
807
959
|
* latest version for the session, or an `agent` object with both id and version
|
|
808
960
|
* specified.
|
|
809
961
|
*/
|
|
810
|
-
agent: string | BetaManagedAgentsAgentParams;
|
|
962
|
+
agent: string | BetaManagedAgentsAgentParams | BetaManagedAgentsAgentWithOverridesParams;
|
|
811
963
|
|
|
812
964
|
/**
|
|
813
965
|
* Body param: ID of the `environment` defining the container configuration for
|
|
@@ -887,7 +1039,7 @@ export interface SessionUpdateParams {
|
|
|
887
1039
|
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
888
1040
|
}
|
|
889
1041
|
|
|
890
|
-
export interface SessionListParams extends
|
|
1042
|
+
export interface SessionListParams extends BidirectionalPageCursorParams {
|
|
891
1043
|
/**
|
|
892
1044
|
* Query param: Filter sessions created with this agent ID.
|
|
893
1045
|
*/
|
|
@@ -973,11 +1125,17 @@ Sessions.Threads = Threads;
|
|
|
973
1125
|
|
|
974
1126
|
export declare namespace Sessions {
|
|
975
1127
|
export {
|
|
1128
|
+
type BetaManagedAgentsAgentMessagePreview as BetaManagedAgentsAgentMessagePreview,
|
|
976
1129
|
type BetaManagedAgentsAgentParams as BetaManagedAgentsAgentParams,
|
|
1130
|
+
type BetaManagedAgentsAgentThinkingPreview as BetaManagedAgentsAgentThinkingPreview,
|
|
1131
|
+
type BetaManagedAgentsAgentWithOverridesParams as BetaManagedAgentsAgentWithOverridesParams,
|
|
977
1132
|
type BetaManagedAgentsBranchCheckout as BetaManagedAgentsBranchCheckout,
|
|
978
1133
|
type BetaManagedAgentsCacheCreationUsage as BetaManagedAgentsCacheCreationUsage,
|
|
979
1134
|
type BetaManagedAgentsCommitCheckout as BetaManagedAgentsCommitCheckout,
|
|
980
1135
|
type BetaManagedAgentsDeletedSession as BetaManagedAgentsDeletedSession,
|
|
1136
|
+
type BetaManagedAgentsDeltaContent as BetaManagedAgentsDeltaContent,
|
|
1137
|
+
type BetaManagedAgentsDeltaEvent as BetaManagedAgentsDeltaEvent,
|
|
1138
|
+
type BetaManagedAgentsDeltaType as BetaManagedAgentsDeltaType,
|
|
981
1139
|
type BetaManagedAgentsFileResourceParams as BetaManagedAgentsFileResourceParams,
|
|
982
1140
|
type BetaManagedAgentsGitHubRepositoryResourceParams as BetaManagedAgentsGitHubRepositoryResourceParams,
|
|
983
1141
|
type BetaManagedAgentsMemoryStoreResourceParam as BetaManagedAgentsMemoryStoreResourceParam,
|
|
@@ -992,10 +1150,12 @@ export declare namespace Sessions {
|
|
|
992
1150
|
type BetaManagedAgentsSessionStats as BetaManagedAgentsSessionStats,
|
|
993
1151
|
type BetaManagedAgentsSessionUpdatedEvent as BetaManagedAgentsSessionUpdatedEvent,
|
|
994
1152
|
type BetaManagedAgentsSessionUsage as BetaManagedAgentsSessionUsage,
|
|
1153
|
+
type BetaManagedAgentsStartEvent as BetaManagedAgentsStartEvent,
|
|
1154
|
+
type BetaManagedAgentsStartEventPreview as BetaManagedAgentsStartEventPreview,
|
|
995
1155
|
type BetaManagedAgentsSystemContentBlock as BetaManagedAgentsSystemContentBlock,
|
|
996
1156
|
type BetaManagedAgentsSystemMessageEvent as BetaManagedAgentsSystemMessageEvent,
|
|
997
1157
|
type BetaManagedAgentsUserToolResultEvent as BetaManagedAgentsUserToolResultEvent,
|
|
998
|
-
type
|
|
1158
|
+
type BetaManagedAgentsSessionsBidirectionalPageCursor as BetaManagedAgentsSessionsBidirectionalPageCursor,
|
|
999
1159
|
type SessionCreateParams as SessionCreateParams,
|
|
1000
1160
|
type SessionRetrieveParams as SessionRetrieveParams,
|
|
1001
1161
|
type SessionUpdateParams as SessionUpdateParams,
|
|
@@ -256,6 +256,8 @@ export type BetaManagedAgentsStreamSessionThreadEvents =
|
|
|
256
256
|
| SessionsAPI.BetaManagedAgentsUserToolResultEvent
|
|
257
257
|
| EventsAPI.BetaManagedAgentsSessionThreadStatusRescheduledEvent
|
|
258
258
|
| SessionsAPI.BetaManagedAgentsSessionUpdatedEvent
|
|
259
|
+
| SessionsAPI.BetaManagedAgentsStartEvent
|
|
260
|
+
| SessionsAPI.BetaManagedAgentsDeltaEvent
|
|
259
261
|
| SessionsAPI.BetaManagedAgentsSystemMessageEvent;
|
|
260
262
|
|
|
261
263
|
export interface ThreadRetrieveParams {
|
|
@@ -342,6 +342,11 @@ export interface BetaManagedAgentsDeletedCredential {
|
|
|
342
342
|
* Environment variable credential details. The secret value is never returned.
|
|
343
343
|
*/
|
|
344
344
|
export interface BetaManagedAgentsEnvironmentVariableAuthResponse {
|
|
345
|
+
/**
|
|
346
|
+
* Where in the outbound request the secret value is substituted.
|
|
347
|
+
*/
|
|
348
|
+
injection_location: BetaManagedAgentsInjectionLocationResponse;
|
|
349
|
+
|
|
345
350
|
/**
|
|
346
351
|
* Outbound hosts the secret value is substituted on.
|
|
347
352
|
*/
|
|
@@ -377,6 +382,11 @@ export interface BetaManagedAgentsEnvironmentVariableCreateParams {
|
|
|
377
382
|
secret_value: string;
|
|
378
383
|
|
|
379
384
|
type: 'environment_variable';
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* Where in the outbound request the secret value may be substituted.
|
|
388
|
+
*/
|
|
389
|
+
injection_location?: BetaManagedAgentsInjectionLocationParams;
|
|
380
390
|
}
|
|
381
391
|
|
|
382
392
|
/**
|
|
@@ -386,6 +396,11 @@ export interface BetaManagedAgentsEnvironmentVariableCreateParams {
|
|
|
386
396
|
export interface BetaManagedAgentsEnvironmentVariableUpdateParams {
|
|
387
397
|
type: 'environment_variable';
|
|
388
398
|
|
|
399
|
+
/**
|
|
400
|
+
* Updated injection location.
|
|
401
|
+
*/
|
|
402
|
+
injection_location?: BetaManagedAgentsInjectionLocationUpdateParams;
|
|
403
|
+
|
|
389
404
|
/**
|
|
390
405
|
* Updated networking scope. Full replacement.
|
|
391
406
|
*/
|
|
@@ -397,6 +412,51 @@ export interface BetaManagedAgentsEnvironmentVariableUpdateParams {
|
|
|
397
412
|
secret_value?: string | null;
|
|
398
413
|
}
|
|
399
414
|
|
|
415
|
+
/**
|
|
416
|
+
* Where in the outbound request the secret value may be substituted.
|
|
417
|
+
*/
|
|
418
|
+
export interface BetaManagedAgentsInjectionLocationParams {
|
|
419
|
+
/**
|
|
420
|
+
* Substitute when the placeholder appears in the request body.
|
|
421
|
+
*/
|
|
422
|
+
body?: boolean;
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Substitute when the placeholder appears in a request header value.
|
|
426
|
+
*/
|
|
427
|
+
header?: boolean;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* Where in the outbound request the secret value is substituted.
|
|
432
|
+
*/
|
|
433
|
+
export interface BetaManagedAgentsInjectionLocationResponse {
|
|
434
|
+
/**
|
|
435
|
+
* Whether the placeholder is substituted in the request body.
|
|
436
|
+
*/
|
|
437
|
+
body: boolean;
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* Whether the placeholder is substituted in request header values.
|
|
441
|
+
*/
|
|
442
|
+
header: boolean;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* Updated injection location.
|
|
447
|
+
*/
|
|
448
|
+
export interface BetaManagedAgentsInjectionLocationUpdateParams {
|
|
449
|
+
/**
|
|
450
|
+
* Substitute when the placeholder appears in the request body.
|
|
451
|
+
*/
|
|
452
|
+
body?: boolean;
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* Substitute when the placeholder appears in a request header value.
|
|
456
|
+
*/
|
|
457
|
+
header?: boolean;
|
|
458
|
+
}
|
|
459
|
+
|
|
400
460
|
/**
|
|
401
461
|
* Substitute the secret only on requests to the listed hosts.
|
|
402
462
|
*/
|
|
@@ -908,6 +968,9 @@ export declare namespace Credentials {
|
|
|
908
968
|
type BetaManagedAgentsEnvironmentVariableAuthResponse as BetaManagedAgentsEnvironmentVariableAuthResponse,
|
|
909
969
|
type BetaManagedAgentsEnvironmentVariableCreateParams as BetaManagedAgentsEnvironmentVariableCreateParams,
|
|
910
970
|
type BetaManagedAgentsEnvironmentVariableUpdateParams as BetaManagedAgentsEnvironmentVariableUpdateParams,
|
|
971
|
+
type BetaManagedAgentsInjectionLocationParams as BetaManagedAgentsInjectionLocationParams,
|
|
972
|
+
type BetaManagedAgentsInjectionLocationResponse as BetaManagedAgentsInjectionLocationResponse,
|
|
973
|
+
type BetaManagedAgentsInjectionLocationUpdateParams as BetaManagedAgentsInjectionLocationUpdateParams,
|
|
911
974
|
type BetaManagedAgentsLimitedCredentialNetworkingParams as BetaManagedAgentsLimitedCredentialNetworkingParams,
|
|
912
975
|
type BetaManagedAgentsLimitedCredentialNetworkingResponse as BetaManagedAgentsLimitedCredentialNetworkingResponse,
|
|
913
976
|
type BetaManagedAgentsMCPOAuthAuthResponse as BetaManagedAgentsMCPOAuthAuthResponse,
|
|
@@ -10,6 +10,9 @@ export {
|
|
|
10
10
|
type BetaManagedAgentsEnvironmentVariableAuthResponse,
|
|
11
11
|
type BetaManagedAgentsEnvironmentVariableCreateParams,
|
|
12
12
|
type BetaManagedAgentsEnvironmentVariableUpdateParams,
|
|
13
|
+
type BetaManagedAgentsInjectionLocationParams,
|
|
14
|
+
type BetaManagedAgentsInjectionLocationResponse,
|
|
15
|
+
type BetaManagedAgentsInjectionLocationUpdateParams,
|
|
13
16
|
type BetaManagedAgentsLimitedCredentialNetworkingParams,
|
|
14
17
|
type BetaManagedAgentsLimitedCredentialNetworkingResponse,
|
|
15
18
|
type BetaManagedAgentsMCPOAuthAuthResponse,
|
|
@@ -13,6 +13,9 @@ import {
|
|
|
13
13
|
BetaManagedAgentsEnvironmentVariableAuthResponse,
|
|
14
14
|
BetaManagedAgentsEnvironmentVariableCreateParams,
|
|
15
15
|
BetaManagedAgentsEnvironmentVariableUpdateParams,
|
|
16
|
+
BetaManagedAgentsInjectionLocationParams,
|
|
17
|
+
BetaManagedAgentsInjectionLocationResponse,
|
|
18
|
+
BetaManagedAgentsInjectionLocationUpdateParams,
|
|
16
19
|
BetaManagedAgentsLimitedCredentialNetworkingParams,
|
|
17
20
|
BetaManagedAgentsLimitedCredentialNetworkingResponse,
|
|
18
21
|
BetaManagedAgentsMCPOAuthAuthResponse,
|
|
@@ -355,6 +358,9 @@ export declare namespace Vaults {
|
|
|
355
358
|
type BetaManagedAgentsEnvironmentVariableAuthResponse as BetaManagedAgentsEnvironmentVariableAuthResponse,
|
|
356
359
|
type BetaManagedAgentsEnvironmentVariableCreateParams as BetaManagedAgentsEnvironmentVariableCreateParams,
|
|
357
360
|
type BetaManagedAgentsEnvironmentVariableUpdateParams as BetaManagedAgentsEnvironmentVariableUpdateParams,
|
|
361
|
+
type BetaManagedAgentsInjectionLocationParams as BetaManagedAgentsInjectionLocationParams,
|
|
362
|
+
type BetaManagedAgentsInjectionLocationResponse as BetaManagedAgentsInjectionLocationResponse,
|
|
363
|
+
type BetaManagedAgentsInjectionLocationUpdateParams as BetaManagedAgentsInjectionLocationUpdateParams,
|
|
358
364
|
type BetaManagedAgentsLimitedCredentialNetworkingParams as BetaManagedAgentsLimitedCredentialNetworkingParams,
|
|
359
365
|
type BetaManagedAgentsLimitedCredentialNetworkingResponse as BetaManagedAgentsLimitedCredentialNetworkingResponse,
|
|
360
366
|
type BetaManagedAgentsMCPOAuthAuthResponse as BetaManagedAgentsMCPOAuthAuthResponse,
|